diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 0000000..599d354 --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,294 @@ +# 应用部署文档 + +## 1. 环境要求 + +### 服务器要求 +- 操作系统:Linux(推荐 Ubuntu 18.04+ 或 CentOS 7+) +- 内存:至少 2GB RAM +- 存储空间:至少 10GB 可用空间 +- 网络:可访问 Gitea 仓库(http://8.137.125.67:4000)和互联网 + +### 软件依赖 +- Docker:用于容器化部署 +- Git:用于代码拉取 + +## 2. 部署前准备 + +### 2.1 安装 Docker + +#### Ubuntu/Debian +```bash +# 更新系统包 +apt-get update + +# 安装 Docker +curl -fsSL https://get.docker.com | sh + +# 启动 Docker 服务 +systemctl start docker + +# 设置 Docker 开机自启 +systemctl enable docker +``` + +#### CentOS/RHEL +```bash +# 更新系统包 +yum update + +# 安装 Docker +yum install -y docker + +# 启动 Docker 服务 +systemctl start docker + +# 设置 Docker 开机自启 +systemctl enable docker +``` + +### 2.2 配置防火墙和安全组 + +#### 2.2.1 系统防火墙设置 + +确保服务器开放以下端口: +- 3000:应用访问端口 +- 4000:Gitea 仓库访问端口(仅在需要访问仓库时) + +##### Ubuntu/Debian (ufw) +```bash +# 允许 3000 端口 +ufw allow 3000/tcp + +# 允许 4000 端口(如果需要) +ufw allow 4000/tcp + +# 启用防火墙 +ufw enable + +# 查看防火墙规则 +ufw status verbose +``` + +##### CentOS/RHEL (firewalld) +```bash +# 允许 3000 端口 +firewall-cmd --zone=public --add-port=3000/tcp --permanent + +# 允许 4000 端口(如果需要) +firewall-cmd --zone=public --add-port=4000/tcp --permanent + +# 重新加载防火墙 +firewall-cmd --reload + +# 查看防火墙规则 +firewall-cmd --list-ports --zone=public +``` + +#### 2.2.2 云服务商安全组设置 + +如果您使用的是云服务器(如阿里云、腾讯云、华为云等),还需要在云服务商控制台配置安全组规则: + +1. 登录云服务器控制台 +2. 找到对应服务器的安全组配置 +3. 添加入站规则: + - 端口范围:3000/3000 + - 协议:TCP + - 授权对象:0.0.0.0/0(允许所有IP访问,或根据需要设置特定IP) + - 描述:应用访问端口 + +### 2.3 配置 Git 凭证(可选) + +如果 Gitea 仓库需要认证,可以配置 Git 凭证缓存: + +```bash +# 设置凭证缓存时间(1小时) +git config --global credential.helper cache + +# 设置凭证永久保存 +git config --global credential.helper store + +# 首次拉取时会要求输入用户名和密码,之后会自动保存 +``` +## 3. 部署步骤 + +### 3.1 下载部署脚本 + +将 `deploy.sh` 脚本上传到服务器的任意目录,例如 `/root` 目录。 + +### 3.2 设置执行权限 + +```bash +chmod +x deploy.sh +``` + +### 3.3 运行部署脚本 + +```bash +./deploy.sh +``` + +### 3.4 部署过程说明 + +脚本将执行以下步骤: +1. **检查应用目录**:如果不存在则克隆仓库,存在则拉取最新代码 +2. **切换分支**:确保使用正确的 `Ly` 分支 +3. **拉取代码**:从 Gitea 仓库拉取最新代码 +4. **停止旧容器**:停止并删除旧的 Docker 容器 +5. **检查端口**:确保 3000 端口未被占用 +6. **构建镜像**:重新构建 Docker 镜像 +7. **启动容器**:启动新的 Docker 容器 +8. **清理镜像**:清理无用的 Docker 镜像 + +## 4. 验证部署 + +### 4.1 检查容器状态 + +```bash +docker ps | grep reject-app +``` + +正常输出示例: +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +abcdef123456 reject-app "node Reject.js" 1 minute ago Up 1 minute 0.0.0.0:3000->3000/tcp reject-app +``` + +### 4.2 检查端口映射 + +```bash +docker port reject-app +``` + +正常输出示例: +``` +3000/tcp -> 0.0.0.0:3000 +``` + +### 4.3 访问应用 + +在浏览器中访问:http://8.137.125.67:3000 + +## 5. 常见问题解决 + +### 5.1 拒绝连接错误 + +**错误现象**:访问 http://8.137.125.67:3000 时显示"拒绝连接" + +**可能原因及解决方法**: + +1. **防火墙未开放端口** + - 检查防火墙规则是否允许 3000 端口 + - 按照 2.2 节重新配置防火墙 + +2. **容器未正常启动** + - 检查容器状态:`docker ps -a | grep reject-app` + - 查看容器日志:`docker logs reject-app` + +3. **端口被占用** + - 检查 3000 端口占用情况:`lsof -i :3000` 或 `netstat -tulpn | grep :3000` + - 停止占用端口的进程或容器 + +### 5.2 数据库连接错误 + +**错误现象**:应用启动后显示数据库连接失败 + +**可能原因及解决方法**: + +1. **数据库配置错误** + - 检查 `Reject.js` 中的数据库连接配置 + - 确保数据库地址、用户名、密码正确 + +2. **数据库服务器未运行** + - 检查数据库服务器状态 + - 确保数据库服务器允许远程连接 + +### 5.3 代码拉取失败 + +**错误现象**:脚本执行时显示"代码拉取失败" + +**可能原因及解决方法**: + +1. **Gitea 仓库不可访问** + - 检查 Gitea 服务器状态:`curl -I http://8.137.125.67:4000` + - 确保服务器可以访问 Gitea 仓库 + +2. **分支名称错误** + - 检查 `deploy.sh` 中的 `BRANCH` 变量是否正确 + - 确保仓库中存在指定的分支 + +## 6. 应用维护 + +### 6.1 查看应用日志 + +```bash +docker logs reject-app +# 实时查看日志 +docker logs -f reject-app +``` + +### 6.2 重启应用 + +```bash +docker restart reject-app +``` + +### 6.3 更新应用 + +再次运行部署脚本即可更新应用: + +```bash +./deploy.sh +``` + +### 6.4 停止应用 + +```bash +docker stop reject-app +``` + +### 6.5 删除应用 + +```bash +# 停止并删除容器 +docker stop reject-app +docker rm reject-app + +# 删除镜像 +docker rmi reject-app + +# 删除应用目录 +rm -rf /app +``` + +## 7. 脚本说明 + +### 7.1 配置参数 + +脚本中的主要配置参数: + +- `REPO_URL`:Gitea 仓库地址 +- `APP_DIR`:应用部署目录 +- `BRANCH`:使用的代码分支 + +### 7.2 脚本功能 + +- **自动代码拉取**:从 Gitea 仓库拉取最新代码 +- **容器管理**:自动停止旧容器并启动新容器 +- **端口管理**:自动检查并清理占用 3000 端口的进程 +- **错误检查**:提供详细的错误信息和处理建议 +- **日志记录**:记录部署过程中的关键步骤 + +## 8. 注意事项 + +1. **第一次部署**:脚本会自动克隆仓库并启动应用 +2. **后续部署**:脚本会自动拉取最新代码并重启应用 +3. **分支切换**:如需切换分支,请修改 `deploy.sh` 中的 `BRANCH` 变量 +4. **数据持久化**:应用数据通过 Docker 卷映射到 `/app` 目录,确保该目录安全 +5. **定期备份**:建议定期备份 `/app` 目录和数据库 + +## 9. 联系方式 + +如有部署问题,请联系: +- 技术支持:[技术支持邮箱] +- 管理员:[管理员联系方式] + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..227301a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# 使用Node.js作为基础镜像 +FROM node:18-alpine + +# 设置工作目录 +WORKDIR /app + +# 设置npm镜像源为国内源加速依赖安装 +RUN npm config set registry https://registry.npmmirror.com + +# 复制package.json和package-lock.json +COPY package*.json ./ + +# 安装项目依赖 +RUN npm install + +# 复制应用代码 +COPY . . + +# 暴露端口 +EXPOSE 3000 + +# 直接使用node启动应用 +CMD ["node", "Reject.js"] \ No newline at end of file diff --git a/Reject.html b/Reject.html new file mode 100644 index 0000000..8f7739f --- /dev/null +++ b/Reject.html @@ -0,0 +1,3852 @@ + + + + + + + 货源审核系统 + + + + +
+ +
+ 未登录 + +
+ +

审核系统

+ + +
+ + + +
+ + + + +
+ + + + +
+ + + + + +
+ 总共 0 个项目 +
+ +
+
加载中...
+
+ + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ 大图查看 + +
+ + +
+ + + + + \ No newline at end of file diff --git a/Reject.js b/Reject.js new file mode 100644 index 0000000..c086f8c --- /dev/null +++ b/Reject.js @@ -0,0 +1,1672 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const cors = require('cors'); +const mysql = require('mysql2/promise'); +const path = require('path'); +const OssUploader = require('./oss-uploader'); +const app = express(); +const PORT = 3000; + +// 配置CORS +app.use(cors()); +app.use((req, res, next) => { + res.header('Access-Control-Allow-Origin', '*'); + res.header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); + res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization'); + if (req.method === 'OPTIONS') { + res.status(200).end(); + return; + } + next(); +}); +app.use(bodyParser.json({ limit: '10mb' })); +app.use(express.static(path.join(__dirname))); + +// 数据库配置 - 从环境变量获取,与docker-compose.yml保持一致 +const dbConfig = { + host: process.env.DB_HOST || '1.95.162.61', + user: process.env.DB_USER || 'root', + password: process.env.DB_PASSWORD || 'schl@2025', + database: process.env.DB_NAME || 'wechat_app', + waitForConnections: true, + connectionLimit: 20, // 增加连接池大小,提高并发处理能力 + queueLimit: 0, + connectTimeout: 10000, // 增加连接超时时间(mysql2支持的选项) + timezone: '+08:00' // 设置为北京时间时区 +}; + +// userlogin数据库配置 - 从环境变量获取 +const userLoginDbConfig = { + host: process.env.DB_HOST || '1.95.162.61', + user: process.env.DB_USER || 'root', + password: process.env.DB_PASSWORD || 'schl@2025', + database: process.env.USER_LOGIN_DB_NAME || 'userlogin', + waitForConnections: true, + connectionLimit: 20, // 增加连接池大小 + queueLimit: 0, + connectTimeout: 10000, // 增加连接超时时间(mysql2支持的选项) + timezone: '+08:00' // 设置为北京时间时区 +}; + +// 创建数据库连接池 +let pool; +let userLoginPool; + +// 初始化数据库连接 +async function initDatabase() { + try { + pool = mysql.createPool(dbConfig); + console.log('wechat_app数据库连接池创建成功'); + + // 初始化userlogin数据库连接池 + userLoginPool = mysql.createPool(userLoginDbConfig); + console.log('userlogin数据库连接池创建成功'); + + // 测试wechat_app连接 + const connection = await pool.getConnection(); + console.log('wechat_app数据库连接测试成功'); + connection.release(); + + // 测试userlogin连接 + const userLoginConnection = await userLoginPool.getConnection(); + console.log('userlogin数据库连接测试成功'); + userLoginConnection.release(); + + // 确保数据库结构 + await ensureDatabaseSchema(); + } catch (error) { + console.error('数据库初始化失败:', error.message); + console.error('错误详情:', error); + // 如果初始化失败,尝试重新初始化 + setTimeout(() => { + console.log('尝试重新初始化数据库连接...'); + initDatabase(); + }, 5000); + } +} + +// 通用响应函数 +function sendResponse(res, success, data = null, message = '') { + res.json({ + success, + data, + message + }); +} + +// 导出函数供测试使用 +module.exports.sendResponse = sendResponse; + +// 获取货源列表API +app.get('/api/supplies', async (req, res) => { + console.log('收到获取货源列表请求:', req.query); + try { + const connection = await pool.getConnection(); + // 支持search和keyword两种参数名,确保兼容性 + const { page = 1, pageSize = 10, search = '', keyword = '', status = '', phoneNumber = '' } = req.query; + // 如果提供了keyword参数,优先使用keyword + const actualSearch = keyword || search; + const offset = (page - 1) * pageSize; + + // 构建基础查询,添加LEFT JOIN获取用户信息 + let query = 'SELECT p.*, u.phoneNumber, u.nickName FROM products p LEFT JOIN users u ON p.sellerId = u.userId'; + let countQuery = 'SELECT COUNT(*) as total FROM products p LEFT JOIN users u ON p.sellerId = u.userId'; + let whereClause = ''; + let params = []; + + // 添加搜索条件 + if (actualSearch) { + whereClause += ` WHERE (p.id LIKE ? OR p.productId LIKE ? OR p.productName LIKE ?)`; + params.push(`%${actualSearch}%`, `%${actualSearch}%`, `%${actualSearch}%`); + } + + // 添加手机号搜索 + if (phoneNumber) { + whereClause += actualSearch ? ' AND' : ' WHERE'; + whereClause += ` u.phoneNumber LIKE ?`; + params.push(`%${phoneNumber}%`); + } + + // 添加状态筛选 + if (status) { + whereClause += (actualSearch || phoneNumber) ? ' AND' : ' WHERE'; + whereClause += ` status = ?`; + params.push(status); + } + + // 添加sellerId筛选,只返回指定用户的货源 + const { sellerId } = req.query; + if (sellerId) { + whereClause += (actualSearch || phoneNumber || status) ? ' AND' : ' WHERE'; + whereClause += ` p.sellerId = ?`; + params.push(sellerId); + } + + // 执行查询 + const [results] = await connection.query( + `${query}${whereClause} ORDER BY p.id DESC LIMIT ? OFFSET ?`, + [...params, parseInt(pageSize), offset] + ); + + // 获取总数 + const [countResults] = await connection.query( + `${countQuery}${whereClause}`, + params + ); + + connection.release(); + + // 处理返回结果中的imageUrls字段 + const processedResults = results.map(product => { + // 处理imageUrls字段 + let imageUrls = []; + + if (product.imageUrls) { + if (typeof product.imageUrls === 'string') { + // 尝试解析为JSON数组 + try { + let parsedImages = JSON.parse(product.imageUrls); + + // 检查是否是JSON字符串的字符串表示(转义的JSON) + if (typeof parsedImages === 'string' && + (parsedImages.startsWith('[') || parsedImages.startsWith('{'))) { + // 进行第二次解析 + parsedImages = JSON.parse(parsedImages); + } + + if (Array.isArray(parsedImages)) { + imageUrls = parsedImages; + } else if (typeof parsedImages === 'string') { + // 如果解析结果是字符串,可能是单个URL + imageUrls = [parsedImages]; + } + } catch (e) { + // 解析失败,尝试按逗号分隔 + if (product.imageUrls.includes(',')) { + imageUrls = product.imageUrls.split(',').map(url => url.trim()); + } else { + // 作为单个URL处理 + imageUrls = [product.imageUrls.trim()]; + } + } + } else if (Array.isArray(product.imageUrls)) { + // 已经是数组,直接使用 + imageUrls = product.imageUrls; + } else { + // 其他类型,转换为字符串数组 + imageUrls = [String(product.imageUrls)]; + } + } + + // 过滤并处理无效的URL:移除反引号并验证 + imageUrls = imageUrls + .filter(url => { + if (!url) return false; + const processedUrl = url.replace(/`/g, '').trim(); + return processedUrl.startsWith('http://') || processedUrl.startsWith('https://'); + }) + // 对每个有效URL进行处理,移除反引号 + .map(url => url.replace(/`/g, '').trim()); + + return { + ...product, + imageUrls + }; + }); + + // 返回结果 + sendResponse(res, true, { + list: processedResults, + total: countResults[0].total, + page: parseInt(page), + pageSize: parseInt(pageSize) + }, '获取货源列表成功'); + } catch (error) { + console.error('获取货源列表失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '获取货源列表失败'); + } +}); + +// 审核通过API +app.post('/api/supplies/:id/approve', async (req, res) => { + console.log('收到审核通过请求:', req.params.id, req.body); + try { + const connection = await pool.getConnection(); + const { remark = '' } = req.body; + const productId = req.params.id; + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentProduct] = await connection.query( + 'SELECT status FROM products WHERE id = ?', + [productId] + ); + + if (currentProduct.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '货源不存在'); + } + + // 检查状态是否可审核,只允许审核中的状态进行审核操作 + if (!['pending_review'].includes(currentProduct[0].status)) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '该货源已审核,无需重复操作'); + } + + // 更新状态为已审核 + await connection.query( + 'UPDATE products SET status = ?, audit_time = ? WHERE id = ?', + ['published', new Date(), productId] + ); + + // 记录日志 + await connection.query( + 'INSERT INTO audit_logs (supply_id, action, user_id, remark, created_at) VALUES (?, ?, ?, ?, ?)', + [productId, 'approve', 'system', remark, new Date()] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '审核通过成功'); + } catch (error) { + console.error('审核通过失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '审核通过失败'); + } +}); + +console.log('正在注册拒绝审核API路由: /api/supplies/:id/reject'); + +// 审核拒绝API +app.post('/api/supplies/:id/reject', async (req, res) => { + console.log('收到审核拒绝请求:', req.params.id, req.body); + try { + const connection = await pool.getConnection(); + // 同时支持reason和rejectReason参数,保持向后兼容 + const { reason, rejectReason = '', remark = '' } = req.body; + // 如果有reason参数,则使用reason,否则使用rejectReason + const actualRejectReason = reason || rejectReason; + const productId = req.params.id; + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentProduct] = await connection.query( + 'SELECT status FROM products WHERE id = ?', + [productId] + ); + + if (currentProduct.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '货源不存在'); + } + + // 检查状态是否可审核,只允许审核中的状态进行审核操作 + if (!['pending_review'].includes(currentProduct[0].status)) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '当前状态不允许审核拒绝'); + } + + // 更新状态和拒绝理由 + await connection.query( + 'UPDATE products SET status = ?, rejectReason = ?, audit_time = ? WHERE id = ?', + ['rejected', actualRejectReason, new Date(), productId] + ); + + // 记录日志 + await connection.query( + 'INSERT INTO audit_logs (supply_id, action, user_id, remark, created_at) VALUES (?, ?, ?, ?, ?)', + [productId, 'reject', 'system', remark, new Date()] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '审核拒绝成功'); + } catch (error) { + console.error('审核拒绝失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '审核拒绝失败'); + } +}); + +// 获取供应商列表API已删除 + +// 供应商审核通过API已删除 + +// 供应商审核拒绝API已删除 + +// 供应商开始合作API已删除 + +// 供应商终止合作API已删除 + +console.log('正在注册测试API路由: /api/test-db'); + +// 测试数据库连接API +app.get('/api/test-db', async (req, res) => { + console.log('收到数据库连接测试请求'); + try { + const connection = await pool.getConnection(); + const [results] = await connection.query('SELECT 1 + 1 as solution'); + connection.release(); + sendResponse(res, true, results[0], '数据库连接成功'); + } catch (error) { + console.error('数据库连接测试失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '数据库连接测试失败'); + } +}); + +// 登录API +app.post('/api/login', async (req, res) => { + try { + const { projectName, userName, password } = req.body; + + // 验证参数 + if (!projectName || !userName || !password) { + return sendResponse(res, false, null, '职位名称、用户名和密码不能为空'); + } + + // 1. 验证职位名称是否为允许的类型 + const allowedProjectNames = ['采购员', '管理员']; + if (!allowedProjectNames.includes(projectName)) { + return sendResponse(res, false, null, '仅允许采购员和管理员登录'); + } + + // 2. 在login表中验证登录信息 + const userLoginConnection = await userLoginPool.getConnection(); + const [loginResult] = await userLoginConnection.query( + 'SELECT id, projectName, userName, managerId FROM login WHERE projectName = ? AND userName = ? AND password = ?', + [projectName, userName, password] + ); + + if (loginResult.length === 0) { + userLoginConnection.release(); + return sendResponse(res, false, null, '职位名称、用户名或密码错误'); + } + + const loginInfo = loginResult[0]; + const { managerId } = loginInfo; + + // 2. 在personnel表中查询手机号码 + const [personnelResult] = await userLoginConnection.query( + 'SELECT phoneNumber, name FROM personnel WHERE managerId = ?', + [managerId] + ); + userLoginConnection.release(); + + if (personnelResult.length === 0) { + return sendResponse(res, false, null, '未找到对应的员工信息'); + } + + const { phoneNumber, name } = personnelResult[0]; + + // 3. 在users表中查询userId + const connection = await pool.getConnection(); + const [userResult] = await connection.query( + 'SELECT userId FROM users WHERE phoneNumber = ?', + [phoneNumber] + ); + connection.release(); + + let userId = null; + if (userResult.length > 0) { + userId = userResult[0].userId; + } + + // 4. 生成token(简单实现,实际项目中应使用JWT等安全机制) + const token = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; + + // 5. 返回登录结果 + const userInfo = { + id: loginInfo.id, + projectName: loginInfo.projectName, + userName: loginInfo.userName, + managerId: loginInfo.managerId, + name: name, + phoneNumber: phoneNumber, + userId: userId + }; + + sendResponse(res, true, { userInfo, token }, '登录成功'); + } catch (error) { + console.error('登录失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '登录失败,请稍后重试'); + } +}); + +// 获取联系人数据API +app.get('/api/contacts', async (req, res) => { + try { + // 直接从userlogin数据库的Personnel表查询联系人信息,只查询工位名为销售员的联系人 + const userLoginConnection = await userLoginPool.getConnection(); + const [personnelData] = await userLoginConnection.query( + 'SELECT id, projectName, alias, phoneNumber FROM Personnel WHERE projectName = "销售员" AND phoneNumber IS NOT NULL AND phoneNumber != ""' + ); + userLoginConnection.release(); + + if (personnelData.length === 0) { + sendResponse(res, true, [], '没有找到联系人信息'); + return; + } + + // 创建联系人数据数组,保持与原API相同的返回格式,使用实际的数据库ID + const contacts = personnelData.map((person) => ({ + id: person.id, // 使用数据库中的实际ID + salesPerson: person.projectName, // 销售员 + name: person.alias, // 联系人别名 + phoneNumber: person.phoneNumber // 电话号码 + })); + + sendResponse(res, true, contacts, '联系人数据获取成功'); + } catch (error) { + console.error('获取联系人数据失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '获取联系人数据失败'); + } +}); + + + +// 供应商审核通过API - /api/suppliers/:id/approve +console.log('正在注册供应商审核通过API路由: /api/suppliers/:id/approve'); +app.post('/api/suppliers/:id/approve', async (req, res) => { + console.log('收到供应商审核通过请求:', req.params); + try { + const connection = await pool.getConnection(); + const userId = req.params.id; + + if (!userId) { + connection.release(); + return sendResponse(res, false, null, '用户ID不能为空'); + } + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentUser] = await connection.query( + 'SELECT partnerstatus FROM users WHERE userId = ?', + [userId] + ); + + if (currentUser.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '供应商不存在'); + } + + if (currentUser[0].partnerstatus !== 'underreview') { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '当前状态不允许审核通过'); + } + + // 更新状态和审核时间 + await connection.query( + 'UPDATE users SET partnerstatus = ?, audit_time = ? WHERE userId = ?', + ['approved', new Date(), userId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '供应商审核通过成功'); + } catch (error) { + console.error('供应商审核通过失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '供应商审核通过失败'); + } +}); + +// 供应商审核拒绝API - /api/suppliers/:id/reject +console.log('正在注册供应商审核拒绝API路由: /api/suppliers/:id/reject'); +app.post('/api/suppliers/:id/reject', async (req, res) => { + console.log('收到供应商审核拒绝请求:', req.params, req.body); + try { + const connection = await pool.getConnection(); + const userId = req.params.id; + const { rejectReason } = req.body; + + if (!userId) { + connection.release(); + return sendResponse(res, false, null, '用户ID不能为空'); + } + + if (!rejectReason) { + connection.release(); + return sendResponse(res, false, null, '审核失败原因不能为空'); + } + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentUser] = await connection.query( + 'SELECT partnerstatus FROM users WHERE userId = ?', + [userId] + ); + + if (currentUser.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '供应商不存在'); + } + + if (currentUser[0].partnerstatus !== 'underreview') { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '当前状态不允许审核拒绝'); + } + + // 更新状态、审核失败原因和审核时间 + await connection.query( + 'UPDATE users SET partnerstatus = ?, reasonforfailure = ?, audit_time = ? WHERE userId = ?', + ['reviewfailed', rejectReason, new Date(), userId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '供应商审核拒绝成功'); + } catch (error) { + console.error('供应商审核拒绝失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '供应商审核拒绝失败'); + } +}); + +// 供应商开始合作API - /api/suppliers/:id/cooperate +console.log('正在注册供应商开始合作API路由: /api/suppliers/:id/cooperate'); +app.post('/api/suppliers/:id/cooperate', async (req, res) => { + console.log('收到供应商开始合作请求:', req.params); + try { + const connection = await pool.getConnection(); + const userId = req.params.id; + + if (!userId) { + connection.release(); + return sendResponse(res, false, null, '用户ID不能为空'); + } + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentUser] = await connection.query( + 'SELECT partnerstatus FROM users WHERE userId = ?', + [userId] + ); + + if (currentUser.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '供应商不存在'); + } + + if (currentUser[0].partnerstatus !== 'approved') { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '只有审核通过的供应商才能开始合作'); + } + + // 更新状态 + await connection.query( + 'UPDATE users SET partnerstatus = ? WHERE userId = ?', + ['incooperation', userId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '供应商开始合作成功'); + } catch (error) { + console.error('供应商开始合作失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '供应商开始合作失败'); + } +}); + +// 供应商终止合作API - /api/suppliers/:id/terminate +console.log('正在注册供应商终止合作API路由: /api/suppliers/:id/terminate'); +app.post('/api/suppliers/:id/terminate', async (req, res) => { + console.log('收到供应商终止合作请求:', req.params, req.body); + try { + const connection = await pool.getConnection(); + const userId = req.params.id; + const { reason } = req.body; + + if (!userId) { + connection.release(); + return sendResponse(res, false, null, '用户ID不能为空'); + } + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentUser] = await connection.query( + 'SELECT partnerstatus FROM users WHERE userId = ?', + [userId] + ); + + if (currentUser.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '供应商不存在'); + } + + if (currentUser[0].partnerstatus !== 'approved' && currentUser[0].partnerstatus !== 'incooperation') { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '只有审核通过或合作中的供应商才能终止合作'); + } + + // 更新状态和终止原因 + await connection.query( + 'UPDATE users SET partnerstatus = ?, terminate_reason = ? WHERE userId = ?', + ['notcooperative', reason, userId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '供应商终止合作成功'); + } catch (error) { + console.error('供应商终止合作失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '供应商终止合作失败'); + } +}); + +// 导入图片处理工具 +const ImageProcessor = require('./image-processor'); + +// 创建货源API - /api/supplies/create +console.log('正在注册创建货源API路由: /api/supplies/create'); +app.post('/api/supplies/create', async (req, res) => { + console.log('收到创建货源请求:', req.body); + let connection; + try { + connection = await pool.getConnection(); + const { productName, price, costprice, quantity, grossWeight, yolk, specification, quality, region, imageUrls, sellerId, supplyStatus, description, sourceType, contactId, category, producting } = req.body; + + // 开始事务 + await connection.beginTransaction(); + + // 验证必填字段 + if (!productName || !price || !quantity || !supplyStatus || !sourceType) { + connection.release(); + return sendResponse(res, false, null, '商品名称、价格、最小起订量、货源状态和货源类型不能为空'); + } + + // 如果sellerId为空,设置一个默认值 + if (!sellerId) { + sellerId = 'default_seller'; + } + + // 检查是否为重复货源 + console.log('检查是否为重复货源...'); + const [existingProducts] = await connection.query( + 'SELECT id FROM products WHERE productName = ? AND specification = ? AND region = ? AND price = ? AND yolk = ?', + [productName, specification, region, price, yolk] + ); + + if (existingProducts.length > 0) { + connection.release(); + return sendResponse(res, false, null, '检测到重复的货源数据,不允许创建'); + } + + // 处理联系人信息 + let productContact = ''; + let contactPhone = ''; + if (contactId) { + console.log('开始处理联系人信息,contactId:', contactId); + // 从userlogin数据库获取联系人信息 + const userLoginConnection = await userLoginPool.getConnection(); + const [personnelData] = await userLoginConnection.query( + 'SELECT alias, phoneNumber FROM Personnel WHERE projectName = "销售员" AND phoneNumber IS NOT NULL AND phoneNumber != "" AND id = ?', + [parseInt(contactId)] // 使用contactId直接查询对应的联系人 + ); + userLoginConnection.release(); + + console.log('查询到的联系人数据:', personnelData); + if (personnelData && personnelData.length > 0) { + productContact = personnelData[0].alias || ''; + contactPhone = personnelData[0].phoneNumber || ''; + console.log('获取到的联系人信息:', productContact, contactPhone); + } + } + + console.log('准备插入的联系人信息:', productContact, contactPhone); + + // 生成唯一的productId + const productId = `product_${Date.now()}_${Math.floor(Math.random() * 1000)}`; + + // 处理媒体文件上传(图片和视频) + let uploadedImageUrls = []; + if (Array.isArray(imageUrls) && imageUrls.length > 0) { + console.log('开始处理媒体文件上传,共', imageUrls.length, '个文件'); + + for (const mediaUrl of imageUrls) { + if (mediaUrl.startsWith('data:image/') || mediaUrl.startsWith('data:video/')) { + // 处理DataURL + let base64Data, ext, fileType; + if (mediaUrl.startsWith('data:image/')) { + // 图片类型 + base64Data = mediaUrl.replace(/^data:image\/(png|jpeg|jpg|gif);base64,/, ''); + ext = mediaUrl.match(/^data:image\/(png|jpeg|jpg|gif);base64,/)?.[1] || 'png'; + fileType = 'image'; + } else { + // 视频类型 + base64Data = mediaUrl.replace(/^data:video\/(mp4|mov|avi|wmv|flv);base64,/, ''); + ext = mediaUrl.match(/^data:video\/(mp4|mov|avi|wmv|flv);base64,/)?.[1] || 'mp4'; + fileType = 'video'; + } + + let buffer = Buffer.from(base64Data, 'base64'); + const filename = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}.${ext}`; + + try { + // 不再添加水印,前端已处理 + console.log('【水印处理】前端已添加水印,跳过后端水印处理'); + + // 使用OSS上传媒体文件 + const ossUrl = await OssUploader.uploadBuffer(buffer, filename, `products/${productName || 'general'}`, fileType); + uploadedImageUrls.push(ossUrl); + console.log(`${fileType}上传成功:`, ossUrl); + } catch (uploadError) { + console.error(`${fileType}上传失败:`, uploadError.message); + // 继续上传其他文件,不中断流程 + } + } else { + // 已经是URL,直接使用 + uploadedImageUrls.push(mediaUrl); + } + } + console.log('媒体文件处理完成,成功上传', uploadedImageUrls.length, '个文件'); + } + + // 创建商品数据 + const productData = { + productId, + sellerId: sellerId, // 使用前端传入的sellerId + productName, + category: category || '', // 添加种类 + price: price.toString(), // 确保是varchar类型 + costprice: costprice || '', // 添加采购价 + quantity: quantity, // 保持为逗号分隔的字符串,不转换为整数 + grossWeight, + yolk, + specification, + quality, + producting: producting || '', // 添加产品包装 + region, + status: 'published', // 直接上架,而不是审核中 + supplyStatus: supplyStatus || '', // 预售/现货 + sourceType: sourceType || '', // 平台货源/三方认证/三方未认证 + description: description || '', + rejectReason: '', + imageUrls: uploadedImageUrls.length > 0 ? JSON.stringify(uploadedImageUrls) : '[]', + created_at: new Date(), + product_contact: productContact, // 添加联系人名称 + contact_phone: contactPhone, // 添加联系人电话 + autoOfflineTime: req.body.autoOfflineTime, // 自动下架时间 + autoOfflineDays: req.body.autoOfflineDays, // 自动下架天数 + autoOfflineHours: req.body.autoOfflineHours // 自动下架小时数 + }; + + // 插入商品数据 + let result; + try { + // 检查products表是否有quality字段 + const [columns] = await connection.query('SHOW COLUMNS FROM products LIKE ?', ['quality']); + let insertQuery; + let insertParams; + + if (columns.length === 0) { + // 没有quality字段,不包含quality字段的插入 + insertQuery = 'INSERT INTO products (productId, sellerId, productName, category, price, costprice, quantity, grossWeight, yolk, specification, producting, region, status, supplyStatus, sourceType, description, rejectReason, imageUrls, created_at, audit_time, product_contact, contact_phone, autoOfflineTime, autoOfflineDays, autoOfflineHours) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; + insertParams = [ + productId, productData.sellerId, productName, category || '', price.toString(), costprice || '', quantity, grossWeight, + yolk, specification, producting, region, productData.status, productData.supplyStatus, productData.sourceType, + productData.description, productData.rejectReason, productData.imageUrls, new Date(), new Date(), + productContact, contactPhone, req.body.autoOfflineTime, req.body.autoOfflineDays, req.body.autoOfflineHours // 添加联系人信息和自动下架时间、小时数 + ]; + } else { + // 有quality字段,包含quality字段的插入 + insertQuery = 'INSERT INTO products (productId, sellerId, productName, category, price, costprice, quantity, grossWeight, yolk, specification, producting, quality, region, status, supplyStatus, sourceType, description, rejectReason, imageUrls, created_at, audit_time, product_contact, contact_phone, autoOfflineTime, autoOfflineDays, autoOfflineHours) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; + insertParams = [ + productId, productData.sellerId, productName, category || '', price.toString(), costprice || '', quantity, grossWeight, + yolk, specification, producting, quality, region, productData.status, productData.supplyStatus, + productData.sourceType, productData.description, productData.rejectReason, productData.imageUrls, + new Date(), new Date(), productContact, contactPhone, req.body.autoOfflineTime, req.body.autoOfflineDays, req.body.autoOfflineHours // 添加联系人信息和自动下架时间、小时数 + ]; + } + + result = await connection.query(insertQuery, insertParams); + } catch (insertError) { + await connection.rollback(); + connection.release(); + console.error('插入商品数据失败:', insertError.message); + console.error('SQL错误:', insertError.sqlMessage); + return sendResponse(res, false, null, `创建货源失败: ${insertError.sqlMessage}`); + } + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, { productId: result.insertId }, '货源创建成功'); + } catch (error) { + if (connection) { + try { + await connection.rollback(); + connection.release(); + } catch (rollbackError) { + console.error('回滚失败:', rollbackError.message); + } + } + console.error('创建货源失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, `创建货源失败: ${error.message}`); + } +}); + +// 媒体文件上传API - /api/upload-media +console.log('正在注册媒体文件上传API路由: /api/upload-media'); +app.post('/api/upload-media', async (req, res) => { + console.log('收到媒体文件上传请求:', req.body); + try { + const { fileData, fileName, folder = 'general' } = req.body; + + // 验证参数 + if (!fileData) { + return sendResponse(res, false, null, '文件数据不能为空'); + } + + let base64Data, ext, fileType; + if (fileData.startsWith('data:image/')) { + // 图片类型 + base64Data = fileData.replace(/^data:image\/(png|jpeg|jpg|gif);base64,/, ''); + ext = fileData.match(/^data:image\/(png|jpeg|jpg|gif);base64,/)?.[1] || 'png'; + fileType = 'image'; + } else if (fileData.startsWith('data:video/')) { + // 视频类型 + base64Data = fileData.replace(/^data:video\/(mp4|mov|avi|wmv|flv);base64,/, ''); + ext = fileData.match(/^data:video\/(mp4|mov|avi|wmv|flv);base64,/)?.[1] || 'mp4'; + fileType = 'video'; + } else { + return sendResponse(res, false, null, '不支持的文件类型'); + } + + let buffer = Buffer.from(base64Data, 'base64'); + const filename = fileName || `${Date.now()}-${Math.random().toString(36).substr(2, 9)}.${ext}`; + + try { + // 使用OSS上传媒体文件 + const ossUrl = await OssUploader.uploadBuffer(buffer, filename, `uploads/${folder}`, fileType); + console.log(`${fileType}上传成功:`, ossUrl); + + sendResponse(res, true, { + url: ossUrl, + fileType: fileType, + message: `${fileType}上传成功` + }, `${fileType}上传成功`); + } catch (uploadError) { + console.error(`${fileType}上传失败:`, uploadError.message); + sendResponse(res, false, null, `${fileType}上传失败: ${uploadError.message}`); + } + } catch (error) { + console.error('媒体文件上传API错误:', error.message); + sendResponse(res, false, null, `媒体文件上传失败: ${error.message}`); + } +}); + +// 图片上传API - /api/upload-image(兼容旧接口) +console.log('正在注册图片上传API路由: /api/upload-image'); +app.post('/api/upload-image', async (req, res) => { + console.log('收到图片上传请求,转发到媒体文件上传API'); + // 将请求转发到媒体文件上传API + const uploadMediaHandler = app._router.stack.find(layer => + layer.route && layer.route.path === '/api/upload-media' && layer.route.methods['post'] + ); + + if (uploadMediaHandler && uploadMediaHandler.route && uploadMediaHandler.route.stack[0]) { + return uploadMediaHandler.route.stack[0].handle(req, res); + } else { + sendResponse(res, false, null, '图片上传API内部错误'); + } +}); + +// 视频上传API - /api/upload-video(专门的视频上传接口) +console.log('正在注册视频上传API路由: /api/upload-video'); +app.post('/api/upload-video', async (req, res) => { + console.log('收到视频上传请求,转发到媒体文件上传API'); + // 将请求转发到媒体文件上传API + const uploadMediaHandler = app._router.stack.find(layer => + layer.route && layer.route.path === '/api/upload-media' && layer.route.methods['post'] + ); + + if (uploadMediaHandler && uploadMediaHandler.route && uploadMediaHandler.route.stack[0]) { + return uploadMediaHandler.route.stack[0].handle(req, res); + } else { + sendResponse(res, false, null, '视频上传API内部错误'); + } +}); + +// 获取审核失败原因API - /api/supplies/:id/reject-reason +console.log('正在注册获取审核失败原因API路由: /api/supplies/:id/reject-reason'); +app.get('/api/supplies/:id/reject-reason', async (req, res) => { + console.log('收到获取审核失败原因请求:', req.params.id); + try { + const connection = await pool.getConnection(); + const supplyId = req.params.id; + + // 查询该货源的拒绝原因 + const [supply] = await connection.query( + 'SELECT rejectReason FROM products WHERE id = ?', + [supplyId] + ); + + connection.release(); + + if (supply.length === 0) { + return sendResponse(res, false, null, '货源不存在'); + } + + sendResponse(res, true, { + rejectReason: supply[0].rejectReason + }, '获取审核失败原因成功'); + } catch (error) { + console.error('获取审核失败原因失败:', error.message); + sendResponse(res, false, null, '获取审核失败原因失败'); + } +}); + +// 下架货源API - /api/supplies/:id/unpublish +console.log('正在注册下架货源API路由: /api/supplies/:id/unpublish'); +app.post('/api/supplies/:id/unpublish', async (req, res) => { + console.log('收到下架货源请求:', req.params.id); + try { + const connection = await pool.getConnection(); + const productId = req.params.id; + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentProduct] = await connection.query( + 'SELECT status FROM products WHERE id = ?', + [productId] + ); + + if (currentProduct.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '货源不存在'); + } + + // 更新状态为下架 + await connection.query( + 'UPDATE products SET status = ? WHERE id = ?', + ['sold_out', productId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '货源下架成功'); + } catch (error) { + console.error('下架货源失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '货源下架失败'); + } +}); + +// 上架货源API - /api/supplies/:id/publish +console.log('正在注册上架货源API路由: /api/supplies/:id/publish'); +app.post('/api/supplies/:id/publish', async (req, res) => { + console.log('收到上架货源请求:', req.params.id); + try { + const connection = await pool.getConnection(); + const productId = req.params.id; + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentProduct] = await connection.query( + 'SELECT status FROM products WHERE id = ?', + [productId] + ); + + if (currentProduct.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '货源不存在'); + } + + // 更新状态为已发布(直接上架,不需要审核),同时更新updated_at和autoOfflineHours + await connection.query( + 'UPDATE products SET status = ?, updated_at = NOW() WHERE id = ?', + ['published', productId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '货源已成功上架'); + } catch (error) { + console.error('上架货源失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '货源上架失败'); + } +}); + +// 删除货源API - /api/supplies/:id/delete +console.log('正在注册删除货源API路由: /api/supplies/:id/delete'); +app.post('/api/supplies/:id/delete', async (req, res) => { + console.log('收到删除货源请求:', req.params.id); + try { + const connection = await pool.getConnection(); + const productId = req.params.id; + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentProduct] = await connection.query( + 'SELECT status FROM products WHERE id = ?', + [productId] + ); + + if (currentProduct.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '货源不存在'); + } + + // 删除货源 + await connection.query( + 'DELETE FROM products WHERE id = ?', + [productId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '货源删除成功'); + } catch (error) { + console.error('删除货源失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '货源删除失败'); + } +}); + +// 更新货源状态API - /api/supplies/:id +console.log('正在注册更新货源状态API路由: /api/supplies/:id'); +app.put('/api/supplies/:id', async (req, res) => { + console.log('收到更新货源状态请求:', req.params.id, req.body); + try { + const connection = await pool.getConnection(); + const productId = req.params.id; + const { status } = req.body; + + // 验证状态参数 + if (!status) { + connection.release(); + return sendResponse(res, false, null, '状态不能为空'); + } + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentProduct] = await connection.query( + 'SELECT status FROM products WHERE id = ?', + [productId] + ); + + if (currentProduct.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '货源不存在'); + } + + // 更新状态 + await connection.query( + 'UPDATE products SET status = ? WHERE id = ?', + [status, productId] + ); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '货源状态更新成功'); + } catch (error) { + console.error('更新货源状态失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '更新货源状态失败'); + } +}); + +// 编辑货源API - /api/supplies/:id/edit +console.log('正在注册编辑货源API路由: /api/supplies/:id/edit'); +app.put('/api/supplies/:id/edit', async (req, res) => { + console.log('收到编辑货源请求:', req.params.id, req.body); + try { + const connection = await pool.getConnection(); + const productId = req.params.id; + const { productName, price, costprice, quantity, grossWeight, yolk, specification, supplyStatus, description, region, contactId, producting, imageUrls } = req.body; + + // 开始事务 + await connection.beginTransaction(); + + // 检查当前状态 + const [currentProduct] = await connection.query( + 'SELECT status FROM products WHERE id = ?', + [productId] + ); + + if (currentProduct.length === 0) { + await connection.rollback(); + connection.release(); + return sendResponse(res, false, null, '货源不存在'); + } + + // 处理联系人信息 + let productContact = ''; + let contactPhone = ''; + if (contactId) { + // 从userlogin数据库获取联系人信息 + const userLoginConnection = await userLoginPool.getConnection(); + const [personnelData] = await userLoginConnection.query( + 'SELECT alias, phoneNumber FROM Personnel WHERE projectName = "销售员" AND phoneNumber IS NOT NULL AND phoneNumber != "" AND id = ?', + [parseInt(contactId)] // 使用contactId直接查询对应的联系人 + ); + userLoginConnection.release(); + + if (personnelData && personnelData.length > 0) { + productContact = personnelData[0].alias || ''; + contactPhone = personnelData[0].phoneNumber || ''; + } + } + + // 处理媒体文件上传(图片和视频) + let uploadedImageUrls = []; + if (Array.isArray(imageUrls) && imageUrls.length > 0) { + console.log('开始处理编辑媒体文件上传,共', imageUrls.length, '个文件'); + + for (const mediaUrl of imageUrls) { + if (mediaUrl.startsWith('data:image/') || mediaUrl.startsWith('data:video/')) { + // 处理DataURL + let base64Data, ext, fileType; + if (mediaUrl.startsWith('data:image/')) { + // 图片类型 + base64Data = mediaUrl.replace(/^data:image\/(png|jpeg|jpg|gif);base64,/, ''); + ext = mediaUrl.match(/^data:image\/(png|jpeg|jpg|gif);base64,/)?.[1] || 'png'; + fileType = 'image'; + } else { + // 视频类型 + base64Data = mediaUrl.replace(/^data:video\/(mp4|mov|avi|wmv|flv);base64,/, ''); + ext = mediaUrl.match(/^data:video\/(mp4|mov|avi|wmv|flv);base64,/)?.[1] || 'mp4'; + fileType = 'video'; + } + + let buffer = Buffer.from(base64Data, 'base64'); + const filename = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}.${ext}`; + + try { + // 不再添加水印,前端已处理 + console.log('【水印处理】前端已添加水印,跳过后端水印处理'); + + // 使用OSS上传媒体文件 + const ossUrl = await OssUploader.uploadBuffer(buffer, filename, `products/${productName || 'general'}`, fileType); + uploadedImageUrls.push(ossUrl); + console.log(`${fileType}上传成功:`, ossUrl); + } catch (uploadError) { + console.error(`${fileType}上传失败:`, uploadError.message); + // 继续上传其他文件,不中断流程 + } + } else { + // 已经是URL,直接使用 + uploadedImageUrls.push(mediaUrl); + } + } + console.log('媒体文件处理完成,成功上传', uploadedImageUrls.length, '个文件'); + } + + // 如果有新上传的图片,更新imageUrls字段 + if (uploadedImageUrls.length > 0) { + await connection.query( + 'UPDATE products SET imageUrls = ? WHERE id = ?', + [JSON.stringify(uploadedImageUrls), productId] + ); + } + + // 处理数量:保存所有数量值,与规格保持一致 + let quantityValue = quantity; // 直接保存前端提交的数量字符串 + // 如果是数字,转换为字符串 + if (typeof quantity === 'number') { + quantityValue = quantity.toString(); + } else if (typeof quantity === 'string' && !isNaN(parseFloat(quantity)) && isFinite(quantity)) { + // 如果是单个数字字符串,直接使用 + quantityValue = quantity; + } + + // 更新货源信息 + const updateQuery = ` + UPDATE products + SET productName = ?, price = ?, costprice = ?, quantity = ?, grossWeight = ?, + yolk = ?, specification = ?, producting = ?, supplyStatus = ?, description = ?, region = ?, + product_contact = ?, contact_phone = ?, imageUrls = ?, + autoOfflineHours = ?, updated_at = ? + WHERE id = ? + `; + + await connection.query(updateQuery, [ + productName, price.toString(), costprice || '', quantityValue, grossWeight, + yolk, specification, producting, supplyStatus, description, region, + productContact, contactPhone, JSON.stringify(uploadedImageUrls), + req.body.autoOfflineHours || 24, // 默认24小时 + new Date(), // 更新updated_at字段 + productId + ]); + + // 提交事务 + await connection.commit(); + connection.release(); + + sendResponse(res, true, null, '货源编辑成功'); + } catch (error) { + console.error('编辑货源失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '货源编辑失败'); + } +}); + +// 供应商列表查询API - /api/suppliers +console.log('正在注册供应商列表查询API路由: /api/suppliers'); +app.get('/api/suppliers', async (req, res) => { + console.log('收到供应商列表查询请求:', req.query); + try { + const connection = await pool.getConnection(); + const { page = 1, pageSize = 10, status = '', keyword = '', phoneNumber = '' } = req.query; + + // 构建查询条件 + let whereClause = ''; + let params = []; + + // 添加状态筛选 + if (status) { + whereClause += ` WHERE partnerstatus = ?`; + params.push(status); + } + + // 添加关键词搜索 + if (keyword) { + whereClause += status ? ' AND' : ' WHERE'; + whereClause += ` (username LIKE ? OR company LIKE ? OR phoneNumber LIKE ?)`; + params.push(`%${keyword}%`, `%${keyword}%`, `%${keyword}%`); + } + + // 添加手机号搜索(优先级高于keyword中的手机号搜索) + if (phoneNumber) { + whereClause += (status || keyword) ? ' AND' : ' WHERE'; + whereClause += ` phoneNumber LIKE ?`; + params.push(`%${phoneNumber}%`); + } + + // 获取总数 + const [totalResult] = await connection.query( + `SELECT COUNT(*) as total FROM users${whereClause}`, + params + ); + const total = totalResult[0].total; + + // 计算分页 + const offset = (page - 1) * pageSize; + params.push(parseInt(pageSize), offset); + + // 查询供应商列表 + const [suppliers] = await connection.query( + `SELECT userId, phoneNumber, province, city, district, detailedaddress, company, collaborationid, cooperation, businesslicenseurl, proofurl, brandurl, partnerstatus, reasonforfailure, reject_reason, terminate_reason, audit_time + FROM users${whereClause} + ORDER BY audit_time DESC LIMIT ? OFFSET ?`, + params + ); + + connection.release(); + + sendResponse(res, true, { + list: suppliers, + total, + page: parseInt(page), + pageSize: parseInt(pageSize) + }, '查询成功'); + } catch (error) { + console.error('供应商列表查询失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '供应商列表查询失败'); + } +}); + +// 首页路由 +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, 'Reject.html')); +}); + +// 错误处理中间件 +app.use((err, req, res, next) => { + console.error('服务器错误:', err.message); + console.error('错误详情:', err); + res.status(500).json({ + success: false, + message: '服务器内部错误' + }); +}); + +// 启动服务器 +async function startServer() { + try { + await initDatabase(); + + app.listen(PORT, () => { + console.log(`服务器已启动,监听端口 ${PORT}`); + console.log(`访问地址: http://localhost:${PORT}`); + }); + } catch (error) { + console.error('服务器启动失败:', error.message); + console.error('错误详情:', error); + // 如果启动失败,尝试重新启动 + setTimeout(() => { + console.log('尝试重新启动服务器...'); + startServer(); + }, 5000); + } +} + +// 确保数据库结构 +async function ensureDatabaseSchema() { + console.log('开始执行数据库结构检查...'); + try { + const connection = await pool.getConnection(); + console.log('获取数据库连接成功'); + + // 检查users表是否有必要的字段 + console.log('检查users表是否有partnerstatus字段...'); + const [partnerStatusColumns] = await connection.query( + 'SHOW COLUMNS FROM `users` LIKE ?', + ['partnerstatus'] + ); + console.log('检查表字段结果:', partnerStatusColumns.length > 0 ? '已存在' : '不存在'); + + if (partnerStatusColumns.length === 0) { + console.log('添加partnerstatus字段到users表...'); + await connection.query( + 'ALTER TABLE `users` ADD COLUMN partnerstatus VARCHAR(50) DEFAULT "underreview" COMMENT "合作商状态"' + ); + console.log('partnerstatus字段添加成功'); + } + + console.log('检查users表是否有reject_reason字段...'); + const [rejectReasonColumns] = await connection.query( + 'SHOW COLUMNS FROM `users` LIKE ?', + ['reject_reason'] + ); + console.log('检查表字段结果:', rejectReasonColumns.length > 0 ? '已存在' : '不存在'); + + if (rejectReasonColumns.length === 0) { + console.log('添加reject_reason字段到users表...'); + await connection.query( + 'ALTER TABLE `users` ADD COLUMN reject_reason TEXT COMMENT "拒绝理由"' + ); + console.log('reject_reason字段添加成功'); + } + + console.log('检查users表是否有terminate_reason字段...'); + const [terminateReasonColumns] = await connection.query( + 'SHOW COLUMNS FROM `users` LIKE ?', + ['terminate_reason'] + ); + console.log('检查表字段结果:', terminateReasonColumns.length > 0 ? '已存在' : '不存在'); + + if (terminateReasonColumns.length === 0) { + console.log('添加terminate_reason字段到users表...'); + await connection.query( + 'ALTER TABLE `users` ADD COLUMN terminate_reason TEXT COMMENT "终止合作理由"' + ); + console.log('terminate_reason字段添加成功'); + } + + console.log('检查users表是否有audit_time字段...'); + const [userAuditTimeColumns] = await connection.query( + 'SHOW COLUMNS FROM `users` LIKE ?', + ['audit_time'] + ); + console.log('检查表字段结果:', userAuditTimeColumns.length > 0 ? '已存在' : '不存在'); + + if (userAuditTimeColumns.length === 0) { + console.log('添加audit_time字段到users表...'); + await connection.query( + 'ALTER TABLE `users` ADD COLUMN audit_time DATETIME COMMENT "审核时间"' + ); + console.log('audit_time字段添加成功'); + } + + // 检查表是否有rejectReason字段 + console.log('检查表products是否有rejectReason字段...'); + const [columns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['rejectReason'] + ); + console.log('检查表字段结果:', columns.length > 0 ? '已存在' : '不存在'); + + if (columns.length === 0) { + console.log('添加rejectReason字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN rejectReason TEXT COMMENT "拒绝理由"' + ); + console.log('rejectReason字段添加成功'); + } + + // 检查表是否有autoOfflineTime字段 + console.log('检查表products是否有autoOfflineTime字段...'); + const [autoOfflineTimeColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['autoOfflineTime'] + ); + console.log('检查表字段结果:', autoOfflineTimeColumns.length > 0 ? '已存在' : '不存在'); + + if (autoOfflineTimeColumns.length === 0) { + console.log('添加autoOfflineTime字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN autoOfflineTime DATETIME COMMENT "自动下架时间"' + ); + console.log('autoOfflineTime字段添加成功'); + } + + // 检查表是否有autoOfflineDays字段 + console.log('检查表products是否有autoOfflineDays字段...'); + const [autoOfflineDaysColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['autoOfflineDays'] + ); + console.log('检查表字段结果:', autoOfflineDaysColumns.length > 0 ? '已存在' : '不存在'); + + if (autoOfflineDaysColumns.length === 0) { + console.log('添加autoOfflineDays字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN autoOfflineDays INT COMMENT "自动下架天数"' + ); + console.log('autoOfflineDays字段添加成功'); + } + + // 检查表是否有autoOfflineHours字段 + console.log('检查表products是否有autoOfflineHours字段...'); + const [autoOfflineHoursColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['autoOfflineHours'] + ); + console.log('检查表字段结果:', autoOfflineHoursColumns.length > 0 ? '已存在' : '不存在'); + + if (autoOfflineHoursColumns.length === 0) { + console.log('添加autoOfflineHours字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN autoOfflineHours FLOAT COMMENT "自动下架小时数"' + ); + console.log('autoOfflineHours字段添加成功'); + } + + // 检查表是否有supplyStatus字段 + console.log('检查表products是否有supplyStatus字段...'); + const [supplyStatusColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['supplyStatus'] + ); + console.log('检查表字段结果:', supplyStatusColumns.length > 0 ? '已存在' : '不存在'); + + if (supplyStatusColumns.length === 0) { + console.log('添加supplyStatus字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN supplyStatus VARCHAR(50) COMMENT "货源状态"' + ); + console.log('supplyStatus字段添加成功'); + } + + // 检查表是否有sourceType字段 + console.log('检查表products是否有sourceType字段...'); + const [sourceTypeColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['sourceType'] + ); + console.log('检查表字段结果:', sourceTypeColumns.length > 0 ? '已存在' : '不存在'); + + if (sourceTypeColumns.length === 0) { + console.log('添加sourceType字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN sourceType VARCHAR(50) COMMENT "货源类型"' + ); + console.log('sourceType字段添加成功'); + } + + // 检查表是否有category字段 + console.log('检查表products是否有category字段...'); + const [categoryColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['category'] + ); + console.log('检查表字段结果:', categoryColumns.length > 0 ? '已存在' : '不存在'); + + if (categoryColumns.length === 0) { + console.log('添加category字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN category VARCHAR(50) COMMENT "种类"' + ); + console.log('category字段添加成功'); + } + + // 检查表是否有audit_time字段 + console.log('检查表products是否有audit_time字段...'); + const [auditTimeColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['audit_time'] + ); + console.log('检查表字段结果:', auditTimeColumns.length > 0 ? '已存在' : '不存在'); + + if (auditTimeColumns.length === 0) { + console.log('添加audit_time字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN audit_time DATETIME COMMENT "审核时间"' + ); + console.log('audit_time字段添加成功'); + } + + // 检查表是否有producting字段 + console.log('检查表products是否有producting字段...'); + const [productingColumns] = await connection.query( + 'SHOW COLUMNS FROM `products` LIKE ?', + ['producting'] + ); + console.log('检查表字段结果:', productingColumns.length > 0 ? '已存在' : '不存在'); + + if (productingColumns.length === 0) { + console.log('添加producting字段到products表...'); + await connection.query( + 'ALTER TABLE `products` ADD COLUMN producting VARCHAR(255) COMMENT "产品包装"' + ); + console.log('producting字段添加成功'); + } + + // 检查audit_logs表是否存在,如果不存在则创建 + console.log('检查audit_logs表是否存在...'); + const [tables] = await connection.query( + "SHOW TABLES LIKE 'audit_logs'" + ); + console.log('检查表存在性结果:', tables.length > 0 ? '已存在' : '不存在'); + + if (tables.length === 0) { + console.log('创建audit_logs表...'); + await connection.query(` + CREATE TABLE audit_logs ( + id INT AUTO_INCREMENT PRIMARY KEY, + supply_id VARCHAR(50) NOT NULL, + action VARCHAR(20) NOT NULL COMMENT 'approve或reject', + user_id VARCHAR(50) NOT NULL COMMENT '操作人ID', + remark TEXT COMMENT '备注信息', + created_at DATETIME NOT NULL, + INDEX idx_supply_id (supply_id), + INDEX idx_created_at (created_at) + ) COMMENT '审核操作日志表' + `); + console.log('audit_logs表创建成功'); + } + + connection.release(); + console.log('数据库结构检查完成'); + } catch (error) { + console.error('数据库结构检查失败:', error.message); + console.error('错误详情:', error); + } +} + +// 启动服务器 +startServer(); + +// 优雅关闭 +process.on('SIGINT', async () => { + console.log('正在关闭服务器...'); + if (pool) { + try { + await pool.end(); + console.log('数据库连接池已关闭'); + } catch (error) { + console.error('关闭数据库连接池失败:', error.message); + } + } + console.log('服务器已关闭'); + process.exit(0); +}); + +module.exports = app; \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..a0b992b --- /dev/null +++ b/deploy.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# 部署脚本:当Gitea仓库有更新时,一键部署新代码到云服务器 + +# 配置参数 +GITEA_USER="SwtTt29" +GITEA_PASSWORD="qazswt123" +REPO_URL="http://${GITEA_USER}:${GITEA_PASSWORD}@8.137.125.67:4000/SwtTt29/Review.git" +APP_DIR="/app" +DOCKER_COMPOSE_FILE="docker-compose.yml" +BRANCH="sh" +IMAGE_NAME="reject-app" # 改为与docker-compose.yml中一致的镜像名称 +CONTAINER_NAME="reject-app" + +# 输出日志函数 +log() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" +} + +# 关闭错误立即停止,改用手动错误检查 +source /etc/profile + +log "开始部署应用..." + +# 确保脚本具有执行权限 +chmod +x "$0" + +# 1. 检查应用目录是否存在 +if [ ! -d "$APP_DIR" ]; then + log "应用目录不存在,开始克隆仓库..." + git clone "$REPO_URL" "$APP_DIR" + if [ $? -ne 0 ]; then + log "错误:克隆仓库失败!请检查网络连接和仓库地址。" + exit 1 + fi + cd "$APP_DIR" + git checkout "$BRANCH" + if [ $? -ne 0 ]; then + log "错误:切换分支失败!请检查分支名称是否正确。" + exit 1 + fi +else + log "应用目录已存在,开始拉取最新代码..." + cd "$APP_DIR" + # 处理分支冲突问题 + if ! git pull origin "$BRANCH" --ff-only; then + log "快进合并失败,尝试先重置本地分支再拉取..." + git fetch origin + git reset --hard origin/"$BRANCH" + if [ $? -ne 0 ]; then + log "错误:重置本地分支失败!" + exit 1 + fi + fi +fi + +# 2. 检查docker-compose.yml文件是否存在 +if [ ! -f "$DOCKER_COMPOSE_FILE" ]; then + log "错误:$DOCKER_COMPOSE_FILE 文件不存在!" + exit 1 +fi + +# 3. 停止并删除旧的Docker容器 +log "停止并删除旧的Docker容器..." +docker-compose -f "$DOCKER_COMPOSE_FILE" down +if [ $? -ne 0 ]; then + log "警告:docker-compose down失败,尝试直接删除容器..." +fi + +# 强制删除可能残留的容器 +if docker ps -a | grep -q "$CONTAINER_NAME"; then + log "强制删除残留的容器 $CONTAINER_NAME..." + docker rm -f "$CONTAINER_NAME" + if [ $? -ne 0 ]; then + log "错误:强制删除容器失败!" + exit 1 + fi +fi + +# 4. 直接使用docker build命令构建镜像,绕过docker-compose的buildx依赖 +log "重新构建Docker镜像..." +docker build -t "$IMAGE_NAME" . +if [ $? -ne 0 ]; then + log "错误:构建镜像失败!请检查Dockerfile和依赖。" + exit 1 +fi + +# 5. 启动新的Docker容器(不使用build参数) +log "启动新的Docker容器..." +# 使用--no-build参数避免docker-compose尝试重新构建 +docker-compose -f "$DOCKER_COMPOSE_FILE" up -d --no-build +if [ $? -ne 0 ]; then + log "错误:启动容器失败!请检查配置文件。" + exit 1 +fi + +# 6. 验证容器是否正常启动 +log "验证容器运行状态..." +sleep 10 +if docker-compose -f "$DOCKER_COMPOSE_FILE" ps | grep -q "Up"; then + log "容器启动成功!" +else + log "警告:容器可能未正常启动,正在检查日志..." + docker-compose -f "$DOCKER_COMPOSE_FILE" logs | tail -50 +fi + +# 7. 清理无用的Docker镜像 +log "清理无用的Docker镜像..." +docker image prune -f + +log "应用部署完成!" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3e54cb9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +# 移除version声明以解决兼容性警告 + +services: + app: + build: . + image: reject-app + container_name: reject-app + ports: + - "3000:3000" + environment: + - NODE_ENV=production + - DB_HOST=1.95.162.61 + - DB_USER=root + - DB_PASSWORD=schl@2025 + - DB_NAME=wechat_app + - USER_LOGIN_DB_NAME=userlogin + restart: always + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" \ No newline at end of file diff --git a/health-check.sh b/health-check.sh new file mode 100644 index 0000000..718247c --- /dev/null +++ b/health-check.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +# 健康检查脚本:定期检查应用是否正常运行,如果不正常则自动重启 + +# 配置参数 +APP_DIR="/app" +DOCKER_COMPOSE_FILE="docker-compose.yml" +CHECK_INTERVAL=300 # 检查间隔(秒) +MAX_RESTARTS=3 # 最大重启次数 +RESTART_INTERVAL=3600 # 重启间隔(秒) + +# 带颜色的日志函数 +colored_log() { + local color=$1 + local message=$2 + local reset="\033[0m" + local colors=( + ["red"]="\033[31m" + ["green"]="\033[32m" + ["yellow"]="\033[33m" + ["blue"]="\033[34m" + ["purple"]="\033[35m" + ) + echo -e "${colors[$color]}[$(date '+%Y-%m-%d %H:%M:%S')] $message$reset" +} + +log() { + colored_log "blue" "$1" +} + +success() { + colored_log "green" "$1" +} + +error() { + colored_log "red" "$1" +} + +warning() { + colored_log "yellow" "$1" +} + +log "启动健康检查服务..." + +# 初始化重启计数器 +restart_count=0 +last_restart_time=$(date +%s) + +while true; do + log "开始健康检查..." + + cd "$APP_DIR" + + # 检查容器是否在运行 + if docker-compose -f "$DOCKER_COMPOSE_FILE" ps | grep -q "Up"; then + # 检查应用是否能正常响应 + if curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 > /dev/null; then + success "应用运行正常" + else + warning "应用容器在运行,但无法正常响应请求" + + # 查看应用日志 + log "查看应用日志:" + docker-compose -f "$DOCKER_COMPOSE_FILE" logs -n 10 + + # 检查重启次数 + current_time=$(date +%s) + time_since_last_restart=$((current_time - last_restart_time)) + + if [ $restart_count -lt $MAX_RESTARTS ] || [ $time_since_last_restart -gt $RESTART_INTERVAL ]; then + log "尝试重启应用..." + if docker-compose -f "$DOCKER_COMPOSE_FILE" restart; then + success "应用已重启" + restart_count=$((restart_count + 1)) + last_restart_time=$current_time + else + error "应用重启失败" + fi + else + error "已达到最大重启次数,在$RESTART_INTERVAL秒内不再尝试重启" + fi + fi + else + warning "应用容器未运行" + + # 检查重启次数 + current_time=$(date +%s) + time_since_last_restart=$((current_time - last_restart_time)) + + if [ $restart_count -lt $MAX_RESTARTS ] || [ $time_since_last_restart -gt $RESTART_INTERVAL ]; then + log "尝试启动应用..." + if docker-compose -f "$DOCKER_COMPOSE_FILE" up -d; then + success "应用已启动" + restart_count=$((restart_count + 1)) + last_restart_time=$current_time + else + error "应用启动失败" + fi + else + error "已达到最大重启次数,在$RESTART_INTERVAL秒内不再尝试启动" + fi + fi + + log "健康检查完成,等待$CHECK_INTERVAL秒后再次检查..." + sleep $CHECK_INTERVAL +done \ No newline at end of file diff --git a/image-processor.js b/image-processor.js new file mode 100644 index 0000000..0b965d4 --- /dev/null +++ b/image-processor.js @@ -0,0 +1,124 @@ +const sharp = require('sharp'); + +class ImageProcessor { + /** + * 为图片添加文字水印 + * @param {Buffer} imageBuffer - 原始图片的Buffer数据 + * @param {String} text - 水印文字内容 + * @param {Object} options - 水印配置选项 + * @returns {Promise} - 添加水印后的图片Buffer + */ + static async addWatermark(imageBuffer, text = '又鸟蛋平台', options = {}) { + try { + console.log('【图片处理】开始添加水印'); + + // 设置默认配置 + const defaultOptions = { + fontSize: 20, // 字体大小 - 减小以确保完整显示 + color: 'rgba(0,0,0,0.5)', // 文字颜色(加深以便更清晰) + position: 'bottom-right', // 水印位置 + marginX: -50, // X轴边距 - 调整使水印居中在红色框中 + marginY: 10 // Y轴边距 - 减小使水印靠下,放入红色框中 + }; + + // 强制使用'bottom-right'位置 + options.position = 'bottom-right'; + + const config = { ...defaultOptions, ...options }; + + // 使用sharp处理图片 + const image = sharp(imageBuffer); + + // 获取图片信息以确定水印位置 + const metadata = await image.metadata(); + const width = metadata.width || 800; + const height = metadata.height || 600; + + // 确定水印位置 + let x = config.marginX; + let y = config.marginY; + + if (config.position === 'bottom-right') { + // 右下角位置,需要计算文字宽度(这里简化处理,实际应该根据字体计算) + // 这里使用一个简单的估算:每个字符约占字体大小的0.6倍宽度 + const estimatedTextWidth = text.length * config.fontSize * 0.6; + x = width - estimatedTextWidth - config.marginX; + y = height - config.fontSize - config.marginY; + } else if (config.position === 'center') { + x = (width / 2) - (text.length * config.fontSize * 0.3); + y = height / 2; + } else if (config.position === 'top-left') { + // 左上角,使用默认的margin值 + } + + // 确保位置不会超出图片边界 + x = Math.max(0, Math.min(x, width - 1)); + y = Math.max(config.fontSize, Math.min(y, height - 1)); + + // 添加文字水印 + const watermarkedBuffer = await image + .composite([{ + input: Buffer.from(` + ${text} + `), + gravity: 'southeast' + }]) + .toBuffer(); + + console.log('【图片处理】水印添加成功'); + return watermarkedBuffer; + } catch (error) { + console.error('【图片处理】添加水印失败:', error.message); + console.error('【图片处理】错误详情:', error); + // 如果水印添加失败,返回原始图片 + return imageBuffer; + } + } + + /** + * 批量为图片添加水印 + * @param {Array} imageBuffers - 图片Buffer数组 + * @param {String} text - 水印文字内容 + * @param {Object} options - 水印配置选项 + * @returns {Promise>} - 添加水印后的图片Buffer数组 + */ + static async addWatermarkToMultiple(imageBuffers, text = '又鸟蛋平台', options = {}) { + try { + console.log(`【图片处理】开始批量添加水印,共${imageBuffers.length}张图片`); + + const watermarkedPromises = imageBuffers.map(buffer => + this.addWatermark(buffer, text, options) + ); + + const results = await Promise.all(watermarkedPromises); + console.log('【图片处理】批量水印添加完成'); + return results; + } catch (error) { + console.error('【图片处理】批量添加水印失败:', error.message); + throw error; + } + } + + /** + * 为Base64编码的图片添加水印 + * @param {String} base64Image - Base64编码的图片 + * @param {String} text - 水印文字内容 + * @param {Object} options - 水印配置选项 + * @returns {Promise} - 添加水印后的图片Buffer + */ + static async addWatermarkToBase64(base64Image, text = '又鸟蛋平台', options = {}) { + try { + // 移除Base64前缀 + const base64Data = base64Image.replace(/^data:image\/(png|jpeg|jpg|gif);base64,/, ''); + // 转换为Buffer + const buffer = Buffer.from(base64Data, 'base64'); + // 添加水印 + return await this.addWatermark(buffer, text, options); + } catch (error) { + console.error('【图片处理】为Base64图片添加水印失败:', error.message); + throw error; + } + } +} + +module.exports = ImageProcessor; diff --git a/login.html b/login.html new file mode 100644 index 0000000..1c14435 --- /dev/null +++ b/login.html @@ -0,0 +1,255 @@ + + + + + + 登录页面 + + + + + + + + \ No newline at end of file diff --git a/node_modules/.bin/_mocha b/node_modules/.bin/_mocha new file mode 100644 index 0000000..7c66ee8 --- /dev/null +++ b/node_modules/.bin/_mocha @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mocha/bin/_mocha" "$@" +else + exec node "$basedir/../mocha/bin/_mocha" "$@" +fi diff --git a/node_modules/.bin/_mocha.cmd b/node_modules/.bin/_mocha.cmd new file mode 100644 index 0000000..417aa20 --- /dev/null +++ b/node_modules/.bin/_mocha.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mocha\bin\_mocha" %* diff --git a/node_modules/.bin/_mocha.ps1 b/node_modules/.bin/_mocha.ps1 new file mode 100644 index 0000000..c17fc71 --- /dev/null +++ b/node_modules/.bin/_mocha.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mocha/bin/_mocha" $args + } else { + & "$basedir/node$exe" "$basedir/../mocha/bin/_mocha" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mocha/bin/_mocha" $args + } else { + & "node$exe" "$basedir/../mocha/bin/_mocha" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/baseline-browser-mapping b/node_modules/.bin/baseline-browser-mapping new file mode 100644 index 0000000..1977474 --- /dev/null +++ b/node_modules/.bin/baseline-browser-mapping @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../baseline-browser-mapping/dist/cli.js" "$@" +else + exec node "$basedir/../baseline-browser-mapping/dist/cli.js" "$@" +fi diff --git a/node_modules/.bin/baseline-browser-mapping.cmd b/node_modules/.bin/baseline-browser-mapping.cmd new file mode 100644 index 0000000..7db3642 --- /dev/null +++ b/node_modules/.bin/baseline-browser-mapping.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\baseline-browser-mapping\dist\cli.js" %* diff --git a/node_modules/.bin/baseline-browser-mapping.ps1 b/node_modules/.bin/baseline-browser-mapping.ps1 new file mode 100644 index 0000000..e241c1d --- /dev/null +++ b/node_modules/.bin/baseline-browser-mapping.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../baseline-browser-mapping/dist/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../baseline-browser-mapping/dist/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../baseline-browser-mapping/dist/cli.js" $args + } else { + & "node$exe" "$basedir/../baseline-browser-mapping/dist/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist new file mode 100644 index 0000000..60e71ad --- /dev/null +++ b/node_modules/.bin/browserslist @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@" +else + exec node "$basedir/../browserslist/cli.js" "$@" +fi diff --git a/node_modules/.bin/browserslist.cmd b/node_modules/.bin/browserslist.cmd new file mode 100644 index 0000000..f93c251 --- /dev/null +++ b/node_modules/.bin/browserslist.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserslist\cli.js" %* diff --git a/node_modules/.bin/browserslist.ps1 b/node_modules/.bin/browserslist.ps1 new file mode 100644 index 0000000..01e10a0 --- /dev/null +++ b/node_modules/.bin/browserslist.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../browserslist/cli.js" $args + } else { + & "node$exe" "$basedir/../browserslist/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 100644 index 0000000..601762c --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@" +else + exec node "$basedir/../esprima/bin/esparse.js" "$@" +fi diff --git a/node_modules/.bin/esparse.cmd b/node_modules/.bin/esparse.cmd new file mode 100644 index 0000000..2ca6d50 --- /dev/null +++ b/node_modules/.bin/esparse.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esparse.js" %* diff --git a/node_modules/.bin/esparse.ps1 b/node_modules/.bin/esparse.ps1 new file mode 100644 index 0000000..f19ed73 --- /dev/null +++ b/node_modules/.bin/esparse.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args + } else { + & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../esprima/bin/esparse.js" $args + } else { + & "node$exe" "$basedir/../esprima/bin/esparse.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 100644 index 0000000..e2fee1f --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@" +else + exec node "$basedir/../esprima/bin/esvalidate.js" "$@" +fi diff --git a/node_modules/.bin/esvalidate.cmd b/node_modules/.bin/esvalidate.cmd new file mode 100644 index 0000000..4c41643 --- /dev/null +++ b/node_modules/.bin/esvalidate.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %* diff --git a/node_modules/.bin/esvalidate.ps1 b/node_modules/.bin/esvalidate.ps1 new file mode 100644 index 0000000..23699d1 --- /dev/null +++ b/node_modules/.bin/esvalidate.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } else { + & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } else { + & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/flat b/node_modules/.bin/flat new file mode 100644 index 0000000..8aee6fd --- /dev/null +++ b/node_modules/.bin/flat @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../flat/cli.js" "$@" +else + exec node "$basedir/../flat/cli.js" "$@" +fi diff --git a/node_modules/.bin/flat.cmd b/node_modules/.bin/flat.cmd new file mode 100644 index 0000000..bae8d2c --- /dev/null +++ b/node_modules/.bin/flat.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\flat\cli.js" %* diff --git a/node_modules/.bin/flat.ps1 b/node_modules/.bin/flat.ps1 new file mode 100644 index 0000000..92a76a9 --- /dev/null +++ b/node_modules/.bin/flat.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../flat/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../flat/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../flat/cli.js" $args + } else { + & "node$exe" "$basedir/../flat/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/glob b/node_modules/.bin/glob new file mode 100644 index 0000000..6fbc4bb --- /dev/null +++ b/node_modules/.bin/glob @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../glob/dist/esm/bin.mjs" "$@" +else + exec node "$basedir/../glob/dist/esm/bin.mjs" "$@" +fi diff --git a/node_modules/.bin/glob.cmd b/node_modules/.bin/glob.cmd new file mode 100644 index 0000000..3c1d48a --- /dev/null +++ b/node_modules/.bin/glob.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\glob\dist\esm\bin.mjs" %* diff --git a/node_modules/.bin/glob.ps1 b/node_modules/.bin/glob.ps1 new file mode 100644 index 0000000..71ac2b2 --- /dev/null +++ b/node_modules/.bin/glob.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args + } else { + & "$basedir/node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args + } else { + & "node$exe" "$basedir/../glob/dist/esm/bin.mjs" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/he b/node_modules/.bin/he new file mode 100644 index 0000000..441322a --- /dev/null +++ b/node_modules/.bin/he @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../he/bin/he" "$@" +else + exec node "$basedir/../he/bin/he" "$@" +fi diff --git a/node_modules/.bin/he.cmd b/node_modules/.bin/he.cmd new file mode 100644 index 0000000..611a864 --- /dev/null +++ b/node_modules/.bin/he.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\he\bin\he" %* diff --git a/node_modules/.bin/he.ps1 b/node_modules/.bin/he.ps1 new file mode 100644 index 0000000..b0010bc --- /dev/null +++ b/node_modules/.bin/he.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../he/bin/he" $args + } else { + & "$basedir/node$exe" "$basedir/../he/bin/he" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../he/bin/he" $args + } else { + & "node$exe" "$basedir/../he/bin/he" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 100644 index 0000000..82416ef --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@" +else + exec node "$basedir/../js-yaml/bin/js-yaml.js" "$@" +fi diff --git a/node_modules/.bin/js-yaml.cmd b/node_modules/.bin/js-yaml.cmd new file mode 100644 index 0000000..453312b --- /dev/null +++ b/node_modules/.bin/js-yaml.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\js-yaml\bin\js-yaml.js" %* diff --git a/node_modules/.bin/js-yaml.ps1 b/node_modules/.bin/js-yaml.ps1 new file mode 100644 index 0000000..2acfc61 --- /dev/null +++ b/node_modules/.bin/js-yaml.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } else { + & "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } else { + & "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc new file mode 100644 index 0000000..879c413 --- /dev/null +++ b/node_modules/.bin/jsesc @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@" +else + exec node "$basedir/../jsesc/bin/jsesc" "$@" +fi diff --git a/node_modules/.bin/jsesc.cmd b/node_modules/.bin/jsesc.cmd new file mode 100644 index 0000000..eb41110 --- /dev/null +++ b/node_modules/.bin/jsesc.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jsesc\bin\jsesc" %* diff --git a/node_modules/.bin/jsesc.ps1 b/node_modules/.bin/jsesc.ps1 new file mode 100644 index 0000000..6007e02 --- /dev/null +++ b/node_modules/.bin/jsesc.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args + } else { + & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../jsesc/bin/jsesc" $args + } else { + & "node$exe" "$basedir/../jsesc/bin/jsesc" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 100644 index 0000000..abf72a4 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" +else + exec node "$basedir/../json5/lib/cli.js" "$@" +fi diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd new file mode 100644 index 0000000..95c137f --- /dev/null +++ b/node_modules/.bin/json5.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %* diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 new file mode 100644 index 0000000..8700ddb --- /dev/null +++ b/node_modules/.bin/json5.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 100644 index 0000000..7751de3 --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mime/cli.js" "$@" +else + exec node "$basedir/../mime/cli.js" "$@" +fi diff --git a/node_modules/.bin/mime.cmd b/node_modules/.bin/mime.cmd new file mode 100644 index 0000000..54491f1 --- /dev/null +++ b/node_modules/.bin/mime.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\cli.js" %* diff --git a/node_modules/.bin/mime.ps1 b/node_modules/.bin/mime.ps1 new file mode 100644 index 0000000..2222f40 --- /dev/null +++ b/node_modules/.bin/mime.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mime/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mime/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mime/cli.js" $args + } else { + & "node$exe" "$basedir/../mime/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 100644 index 0000000..1ab9c81 --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" +else + exec node "$basedir/../mkdirp/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/mkdirp.cmd b/node_modules/.bin/mkdirp.cmd new file mode 100644 index 0000000..a865dd9 --- /dev/null +++ b/node_modules/.bin/mkdirp.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %* diff --git a/node_modules/.bin/mkdirp.ps1 b/node_modules/.bin/mkdirp.ps1 new file mode 100644 index 0000000..911e854 --- /dev/null +++ b/node_modules/.bin/mkdirp.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mocha b/node_modules/.bin/mocha new file mode 100644 index 0000000..227fcc4 --- /dev/null +++ b/node_modules/.bin/mocha @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mocha/bin/mocha.js" "$@" +else + exec node "$basedir/../mocha/bin/mocha.js" "$@" +fi diff --git a/node_modules/.bin/mocha.cmd b/node_modules/.bin/mocha.cmd new file mode 100644 index 0000000..b328ae9 --- /dev/null +++ b/node_modules/.bin/mocha.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mocha\bin\mocha.js" %* diff --git a/node_modules/.bin/mocha.ps1 b/node_modules/.bin/mocha.ps1 new file mode 100644 index 0000000..5f83501 --- /dev/null +++ b/node_modules/.bin/mocha.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mocha/bin/mocha.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mocha/bin/mocha.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mocha/bin/mocha.js" $args + } else { + & "node$exe" "$basedir/../mocha/bin/mocha.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which new file mode 100644 index 0000000..b49b03f --- /dev/null +++ b/node_modules/.bin/node-which @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../which/bin/node-which" "$@" +else + exec node "$basedir/../which/bin/node-which" "$@" +fi diff --git a/node_modules/.bin/node-which.cmd b/node_modules/.bin/node-which.cmd new file mode 100644 index 0000000..8738aed --- /dev/null +++ b/node_modules/.bin/node-which.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\node-which" %* diff --git a/node_modules/.bin/node-which.ps1 b/node_modules/.bin/node-which.ps1 new file mode 100644 index 0000000..cfb09e8 --- /dev/null +++ b/node_modules/.bin/node-which.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args + } else { + & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../which/bin/node-which" $args + } else { + & "node$exe" "$basedir/../which/bin/node-which" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/nyc b/node_modules/.bin/nyc new file mode 100644 index 0000000..2ac5bc9 --- /dev/null +++ b/node_modules/.bin/nyc @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../nyc/bin/nyc.js" "$@" +else + exec node "$basedir/../nyc/bin/nyc.js" "$@" +fi diff --git a/node_modules/.bin/nyc.cmd b/node_modules/.bin/nyc.cmd new file mode 100644 index 0000000..1cf2c09 --- /dev/null +++ b/node_modules/.bin/nyc.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nyc\bin\nyc.js" %* diff --git a/node_modules/.bin/nyc.ps1 b/node_modules/.bin/nyc.ps1 new file mode 100644 index 0000000..49f9e8b --- /dev/null +++ b/node_modules/.bin/nyc.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../nyc/bin/nyc.js" $args + } else { + & "$basedir/node$exe" "$basedir/../nyc/bin/nyc.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../nyc/bin/nyc.js" $args + } else { + & "node$exe" "$basedir/../nyc/bin/nyc.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/os-name b/node_modules/.bin/os-name new file mode 100644 index 0000000..7a6412e --- /dev/null +++ b/node_modules/.bin/os-name @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../os-name/cli.js" "$@" +else + exec node "$basedir/../os-name/cli.js" "$@" +fi diff --git a/node_modules/.bin/os-name.cmd b/node_modules/.bin/os-name.cmd new file mode 100644 index 0000000..88737b3 --- /dev/null +++ b/node_modules/.bin/os-name.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\os-name\cli.js" %* diff --git a/node_modules/.bin/os-name.ps1 b/node_modules/.bin/os-name.ps1 new file mode 100644 index 0000000..d91951a --- /dev/null +++ b/node_modules/.bin/os-name.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../os-name/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../os-name/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../os-name/cli.js" $args + } else { + & "node$exe" "$basedir/../os-name/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/osx-release b/node_modules/.bin/osx-release new file mode 100644 index 0000000..57b4389 --- /dev/null +++ b/node_modules/.bin/osx-release @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../osx-release/cli.js" "$@" +else + exec node "$basedir/../osx-release/cli.js" "$@" +fi diff --git a/node_modules/.bin/osx-release.cmd b/node_modules/.bin/osx-release.cmd new file mode 100644 index 0000000..56bf33c --- /dev/null +++ b/node_modules/.bin/osx-release.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\osx-release\cli.js" %* diff --git a/node_modules/.bin/osx-release.ps1 b/node_modules/.bin/osx-release.ps1 new file mode 100644 index 0000000..d2a7053 --- /dev/null +++ b/node_modules/.bin/osx-release.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../osx-release/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../osx-release/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../osx-release/cli.js" $args + } else { + & "node$exe" "$basedir/../osx-release/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser new file mode 100644 index 0000000..7696ad4 --- /dev/null +++ b/node_modules/.bin/parser @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@" +else + exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@" +fi diff --git a/node_modules/.bin/parser.cmd b/node_modules/.bin/parser.cmd new file mode 100644 index 0000000..1ad5c81 --- /dev/null +++ b/node_modules/.bin/parser.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %* diff --git a/node_modules/.bin/parser.ps1 b/node_modules/.bin/parser.ps1 new file mode 100644 index 0000000..8926517 --- /dev/null +++ b/node_modules/.bin/parser.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } else { + & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } else { + & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf new file mode 100644 index 0000000..6d6240a --- /dev/null +++ b/node_modules/.bin/rimraf @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../rimraf/bin.js" "$@" +else + exec node "$basedir/../rimraf/bin.js" "$@" +fi diff --git a/node_modules/.bin/rimraf.cmd b/node_modules/.bin/rimraf.cmd new file mode 100644 index 0000000..13f45ec --- /dev/null +++ b/node_modules/.bin/rimraf.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rimraf\bin.js" %* diff --git a/node_modules/.bin/rimraf.ps1 b/node_modules/.bin/rimraf.ps1 new file mode 100644 index 0000000..1716791 --- /dev/null +++ b/node_modules/.bin/rimraf.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args + } else { + & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../rimraf/bin.js" $args + } else { + & "node$exe" "$basedir/../rimraf/bin.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 100644 index 0000000..97c5327 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..9913fa9 --- /dev/null +++ b/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..314717a --- /dev/null +++ b/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db new file mode 100644 index 0000000..cced63c --- /dev/null +++ b/node_modules/.bin/update-browserslist-db @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../update-browserslist-db/cli.js" "$@" +else + exec node "$basedir/../update-browserslist-db/cli.js" "$@" +fi diff --git a/node_modules/.bin/update-browserslist-db.cmd b/node_modules/.bin/update-browserslist-db.cmd new file mode 100644 index 0000000..2e14905 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\update-browserslist-db\cli.js" %* diff --git a/node_modules/.bin/update-browserslist-db.ps1 b/node_modules/.bin/update-browserslist-db.ps1 new file mode 100644 index 0000000..7abdf26 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } else { + & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid new file mode 100644 index 0000000..0c2d469 --- /dev/null +++ b/node_modules/.bin/uuid @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../uuid/dist/bin/uuid" "$@" +else + exec node "$basedir/../uuid/dist/bin/uuid" "$@" +fi diff --git a/node_modules/.bin/uuid.cmd b/node_modules/.bin/uuid.cmd new file mode 100644 index 0000000..0f2376e --- /dev/null +++ b/node_modules/.bin/uuid.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\uuid\dist\bin\uuid" %* diff --git a/node_modules/.bin/uuid.ps1 b/node_modules/.bin/uuid.ps1 new file mode 100644 index 0000000..7804628 --- /dev/null +++ b/node_modules/.bin/uuid.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } else { + & "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } else { + & "node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.cache/nyc/Reject-ec60338d4f36f5f2ccd51af745b84e9abe3a4a2f956dc3d2553e3e463a6b8fe4.js b/node_modules/.cache/nyc/Reject-ec60338d4f36f5f2ccd51af745b84e9abe3a4a2f956dc3d2553e3e463a6b8fe4.js new file mode 100644 index 0000000..162b7bd --- /dev/null +++ b/node_modules/.cache/nyc/Reject-ec60338d4f36f5f2ccd51af745b84e9abe3a4a2f956dc3d2553e3e463a6b8fe4.js @@ -0,0 +1,125 @@ +function cov_1kbb7fz0lp(){var path="D:\\wechatapp\\SH\\SH\\Reject.js";var hash="0949a5d7e06e37b0d3d9929399aaaff6f267dbef";var global=new Function("return this")();var gcv="__coverage__";var coverageData={path:"D:\\wechatapp\\SH\\SH\\Reject.js",statementMap:{"0":{start:{line:1,column:16},end:{line:1,column:34}},"1":{start:{line:2,column:19},end:{line:2,column:41}},"2":{start:{line:3,column:13},end:{line:3,column:28}},"3":{start:{line:4,column:14},end:{line:4,column:39}},"4":{start:{line:5,column:13},end:{line:5,column:28}},"5":{start:{line:6,column:12},end:{line:6,column:21}},"6":{start:{line:7,column:13},end:{line:7,column:37}},"7":{start:{line:10,column:0},end:{line:10,column:16}},"8":{start:{line:11,column:0},end:{line:20,column:3}},"9":{start:{line:12,column:4},end:{line:12,column:51}},"10":{start:{line:13,column:4},end:{line:13,column:82}},"11":{start:{line:14,column:4},end:{line:14,column:78}},"12":{start:{line:15,column:4},end:{line:18,column:5}},"13":{start:{line:16,column:8},end:{line:16,column:30}},"14":{start:{line:17,column:8},end:{line:17,column:15}},"15":{start:{line:19,column:4},end:{line:19,column:11}},"16":{start:{line:21,column:0},end:{line:21,column:27}},"17":{start:{line:22,column:0},end:{line:22,column:46}},"18":{start:{line:25,column:17},end:{line:33,column:1}},"19":{start:{line:36,column:26},end:{line:44,column:1}},"20":{start:{line:52,column:4},end:{line:80,column:5}},"21":{start:{line:53,column:8},end:{line:53,column:42}},"22":{start:{line:54,column:8},end:{line:54,column:44}},"23":{start:{line:57,column:8},end:{line:57,column:60}},"24":{start:{line:58,column:8},end:{line:58,column:43}},"25":{start:{line:61,column:27},end:{line:61,column:53}},"26":{start:{line:62,column:8},end:{line:62,column:43}},"27":{start:{line:63,column:8},end:{line:63,column:29}},"28":{start:{line:66,column:36},end:{line:66,column:71}},"29":{start:{line:67,column:8},end:{line:67,column:42}},"30":{start:{line:68,column:8},end:{line:68,column:38}},"31":{start:{line:71,column:8},end:{line:71,column:37}},"32":{start:{line:73,column:8},end:{line:73,column:50}},"33":{start:{line:74,column:8},end:{line:74,column:38}},"34":{start:{line:76,column:8},end:{line:79,column:17}},"35":{start:{line:77,column:12},end:{line:77,column:43}},"36":{start:{line:78,column:12},end:{line:78,column:27}},"37":{start:{line:85,column:4},end:{line:89,column:7}},"38":{start:{line:93,column:0},end:{line:206,column:3}},"39":{start:{line:94,column:4},end:{line:94,column:42}},"40":{start:{line:95,column:4},end:{line:205,column:5}},"41":{start:{line:96,column:27},end:{line:96,column:53}},"42":{start:{line:98,column:84},end:{line:98,column:93}},"43":{start:{line:100,column:29},end:{line:100,column:46}},"44":{start:{line:101,column:23},end:{line:101,column:44}},"45":{start:{line:104,column:20},end:{line:104,column:118}},"46":{start:{line:105,column:25},end:{line:105,column:110}},"47":{start:{line:106,column:26},end:{line:106,column:28}},"48":{start:{line:107,column:21},end:{line:107,column:23}},"49":{start:{line:110,column:8},end:{line:113,column:9}},"50":{start:{line:111,column:12},end:{line:111,column:96}},"51":{start:{line:112,column:12},end:{line:112,column:87}},"52":{start:{line:116,column:8},end:{line:120,column:9}},"53":{start:{line:117,column:12},end:{line:117,column:60}},"54":{start:{line:118,column:12},end:{line:118,column:41}},"55":{start:{line:119,column:12},end:{line:119,column:32}},"56":{start:{line:123,column:26},end:{line:126,column:9}},"57":{start:{line:129,column:31},end:{line:132,column:9}},"58":{start:{line:134,column:8},end:{line:134,column:29}},"59":{start:{line:137,column:33},end:{line:192,column:10}},"60":{start:{line:139,column:28},end:{line:139,column:30}},"61":{start:{line:141,column:12},end:{line:176,column:13}},"62":{start:{line:142,column:16},end:{line:175,column:17}},"63":{start:{line:144,column:20},end:{line:168,column:21}},"64":{start:{line:145,column:43},end:{line:145,column:72}},"65":{start:{line:148,column:24},end:{line:152,column:25}},"66":{start:{line:151,column:28},end:{line:151,column:68}},"67":{start:{line:154,column:24},end:{line:159,column:25}},"68":{start:{line:155,column:28},end:{line:155,column:53}},"69":{start:{line:156,column:31},end:{line:159,column:25}},"70":{start:{line:158,column:28},end:{line:158,column:55}},"71":{start:{line:162,column:24},end:{line:167,column:25}},"72":{start:{line:163,column:28},end:{line:163,column:92}},"73":{start:{line:163,column:80},end:{line:163,column:90}},"74":{start:{line:166,column:28},end:{line:166,column:67}},"75":{start:{line:169,column:23},end:{line:175,column:17}},"76":{start:{line:171,column:20},end:{line:171,column:50}},"77":{start:{line:174,column:20},end:{line:174,column:60}},"78":{start:{line:179,column:12},end:{line:186,column:58}},"79":{start:{line:181,column:20},end:{line:181,column:43}},"80":{start:{line:181,column:30},end:{line:181,column:43}},"81":{start:{line:182,column:41},end:{line:182,column:69}},"82":{start:{line:183,column:20},end:{line:183,column:101}},"83":{start:{line:186,column:28},end:{line:186,column:56}},"84":{start:{line:188,column:12},end:{line:191,column:14}},"85":{start:{line:195,column:8},end:{line:200,column:23}},"86":{start:{line:202,column:8},end:{line:202,column:50}},"87":{start:{line:203,column:8},end:{line:203,column:38}},"88":{start:{line:204,column:8},end:{line:204,column:51}},"89":{start:{line:209,column:0},end:{line:260,column:3}},"90":{start:{line:210,column:4},end:{line:210,column:54}},"91":{start:{line:211,column:4},end:{line:259,column:5}},"92":{start:{line:212,column:27},end:{line:212,column:53}},"93":{start:{line:213,column:32},end:{line:213,column:40}},"94":{start:{line:214,column:26},end:{line:214,column:39}},"95":{start:{line:217,column:8},end:{line:217,column:44}},"96":{start:{line:220,column:33},end:{line:223,column:9}},"97":{start:{line:225,column:8},end:{line:229,column:9}},"98":{start:{line:226,column:12},end:{line:226,column:40}},"99":{start:{line:227,column:12},end:{line:227,column:33}},"100":{start:{line:228,column:12},end:{line:228,column:59}},"101":{start:{line:232,column:8},end:{line:236,column:9}},"102":{start:{line:233,column:12},end:{line:233,column:40}},"103":{start:{line:234,column:12},end:{line:234,column:33}},"104":{start:{line:235,column:12},end:{line:235,column:67}},"105":{start:{line:239,column:8},end:{line:242,column:10}},"106":{start:{line:245,column:8},end:{line:248,column:10}},"107":{start:{line:251,column:8},end:{line:251,column:34}},"108":{start:{line:252,column:8},end:{line:252,column:29}},"109":{start:{line:254,column:8},end:{line:254,column:48}},"110":{start:{line:256,column:8},end:{line:256,column:48}},"111":{start:{line:257,column:8},end:{line:257,column:38}},"112":{start:{line:258,column:8},end:{line:258,column:49}},"113":{start:{line:262,column:0},end:{line:262,column:55}},"114":{start:{line:265,column:0},end:{line:318,column:3}},"115":{start:{line:266,column:4},end:{line:266,column:54}},"116":{start:{line:267,column:4},end:{line:317,column:5}},"117":{start:{line:268,column:27},end:{line:268,column:53}},"118":{start:{line:270,column:59},end:{line:270,column:67}},"119":{start:{line:272,column:35},end:{line:272,column:57}},"120":{start:{line:273,column:26},end:{line:273,column:39}},"121":{start:{line:276,column:8},end:{line:276,column:44}},"122":{start:{line:279,column:33},end:{line:282,column:9}},"123":{start:{line:284,column:8},end:{line:288,column:9}},"124":{start:{line:285,column:12},end:{line:285,column:40}},"125":{start:{line:286,column:12},end:{line:286,column:33}},"126":{start:{line:287,column:12},end:{line:287,column:59}},"127":{start:{line:290,column:8},end:{line:294,column:9}},"128":{start:{line:291,column:12},end:{line:291,column:40}},"129":{start:{line:292,column:12},end:{line:292,column:33}},"130":{start:{line:293,column:12},end:{line:293,column:65}},"131":{start:{line:297,column:8},end:{line:300,column:10}},"132":{start:{line:303,column:8},end:{line:306,column:10}},"133":{start:{line:309,column:8},end:{line:309,column:34}},"134":{start:{line:310,column:8},end:{line:310,column:29}},"135":{start:{line:312,column:8},end:{line:312,column:48}},"136":{start:{line:314,column:8},end:{line:314,column:48}},"137":{start:{line:315,column:8},end:{line:315,column:38}},"138":{start:{line:316,column:8},end:{line:316,column:49}},"139":{start:{line:330,column:0},end:{line:330,column:41}},"140":{start:{line:333,column:0},end:{line:345,column:3}},"141":{start:{line:334,column:4},end:{line:334,column:31}},"142":{start:{line:335,column:4},end:{line:344,column:5}},"143":{start:{line:336,column:27},end:{line:336,column:53}},"144":{start:{line:337,column:26},end:{line:337,column:76}},"145":{start:{line:338,column:8},end:{line:338,column:29}},"146":{start:{line:339,column:8},end:{line:339,column:55}},"147":{start:{line:341,column:8},end:{line:341,column:51}},"148":{start:{line:342,column:8},end:{line:342,column:38}},"149":{start:{line:343,column:8},end:{line:343,column:52}},"150":{start:{line:348,column:0},end:{line:415,column:3}},"151":{start:{line:349,column:4},end:{line:414,column:5}},"152":{start:{line:351,column:36},end:{line:351,column:71}},"153":{start:{line:352,column:31},end:{line:354,column:9}},"154":{start:{line:355,column:8},end:{line:355,column:38}},"155":{start:{line:357,column:8},end:{line:360,column:9}},"156":{start:{line:358,column:12},end:{line:358,column:53}},"157":{start:{line:359,column:12},end:{line:359,column:19}},"158":{start:{line:363,column:27},end:{line:363,column:53}},"159":{start:{line:366,column:26},end:{line:366,column:69}},"160":{start:{line:366,column:53},end:{line:366,column:68}},"161":{start:{line:369,column:30},end:{line:372,column:9}},"162":{start:{line:374,column:8},end:{line:374,column:29}},"163":{start:{line:377,column:25},end:{line:377,column:27}},"164":{start:{line:378,column:31},end:{line:378,column:40}},"165":{start:{line:381,column:8},end:{line:407,column:9}},"166":{start:{line:382,column:33},end:{line:382,column:44}},"167":{start:{line:385,column:33},end:{line:387,column:13}},"168":{start:{line:386,column:16},end:{line:386,column:71}},"169":{start:{line:389,column:12},end:{line:405,column:13}},"170":{start:{line:390,column:16},end:{line:404,column:17}},"171":{start:{line:392,column:20},end:{line:403,column:21}},"172":{start:{line:393,column:40},end:{line:393,column:73}},"173":{start:{line:394,column:24},end:{line:402,column:25}},"174":{start:{line:395,column:28},end:{line:395,column:56}},"175":{start:{line:396,column:28},end:{line:401,column:31}},"176":{start:{line:409,column:8},end:{line:409,column:55}},"177":{start:{line:411,column:8},end:{line:411,column:51}},"178":{start:{line:412,column:8},end:{line:412,column:38}},"179":{start:{line:413,column:8},end:{line:413,column:52}},"180":{start:{line:418,column:0},end:{line:447,column:3}},"181":{start:{line:419,column:4},end:{line:446,column:5}},"182":{start:{line:420,column:23},end:{line:420,column:33}},"183":{start:{line:421,column:49},end:{line:421,column:57}},"184":{start:{line:424,column:40},end:{line:424,column:95}},"185":{start:{line:426,column:27},end:{line:426,column:53}},"186":{start:{line:429,column:25},end:{line:432,column:9}},"187":{start:{line:434,column:8},end:{line:434,column:29}},"188":{start:{line:436,column:8},end:{line:439,column:9}},"189":{start:{line:437,column:12},end:{line:437,column:55}},"190":{start:{line:438,column:12},end:{line:438,column:19}},"191":{start:{line:441,column:8},end:{line:441,column:53}},"192":{start:{line:443,column:8},end:{line:443,column:53}},"193":{start:{line:444,column:8},end:{line:444,column:38}},"194":{start:{line:445,column:8},end:{line:445,column:54}},"195":{start:{line:450,column:0},end:{line:450,column:60}},"196":{start:{line:451,column:0},end:{line:499,column:3}},"197":{start:{line:452,column:4},end:{line:452,column:44}},"198":{start:{line:453,column:4},end:{line:498,column:5}},"199":{start:{line:454,column:27},end:{line:454,column:53}},"200":{start:{line:455,column:23},end:{line:455,column:36}},"201":{start:{line:457,column:8},end:{line:460,column:9}},"202":{start:{line:458,column:12},end:{line:458,column:33}},"203":{start:{line:459,column:12},end:{line:459,column:62}},"204":{start:{line:463,column:8},end:{line:463,column:44}},"205":{start:{line:466,column:30},end:{line:469,column:9}},"206":{start:{line:471,column:8},end:{line:475,column:9}},"207":{start:{line:472,column:12},end:{line:472,column:40}},"208":{start:{line:473,column:12},end:{line:473,column:33}},"209":{start:{line:474,column:12},end:{line:474,column:60}},"210":{start:{line:477,column:8},end:{line:481,column:9}},"211":{start:{line:478,column:12},end:{line:478,column:40}},"212":{start:{line:479,column:12},end:{line:479,column:33}},"213":{start:{line:480,column:12},end:{line:480,column:65}},"214":{start:{line:484,column:8},end:{line:487,column:10}},"215":{start:{line:490,column:8},end:{line:490,column:34}},"216":{start:{line:491,column:8},end:{line:491,column:29}},"217":{start:{line:493,column:8},end:{line:493,column:51}},"218":{start:{line:495,column:8},end:{line:495,column:51}},"219":{start:{line:496,column:8},end:{line:496,column:38}},"220":{start:{line:497,column:8},end:{line:497,column:52}},"221":{start:{line:502,column:0},end:{line:502,column:59}},"222":{start:{line:503,column:0},end:{line:557,column:3}},"223":{start:{line:504,column:4},end:{line:504,column:54}},"224":{start:{line:505,column:4},end:{line:556,column:5}},"225":{start:{line:506,column:27},end:{line:506,column:53}},"226":{start:{line:507,column:23},end:{line:507,column:36}},"227":{start:{line:508,column:33},end:{line:508,column:41}},"228":{start:{line:510,column:8},end:{line:513,column:9}},"229":{start:{line:511,column:12},end:{line:511,column:33}},"230":{start:{line:512,column:12},end:{line:512,column:62}},"231":{start:{line:515,column:8},end:{line:518,column:9}},"232":{start:{line:516,column:12},end:{line:516,column:33}},"233":{start:{line:517,column:12},end:{line:517,column:64}},"234":{start:{line:521,column:8},end:{line:521,column:44}},"235":{start:{line:524,column:30},end:{line:527,column:9}},"236":{start:{line:529,column:8},end:{line:533,column:9}},"237":{start:{line:530,column:12},end:{line:530,column:40}},"238":{start:{line:531,column:12},end:{line:531,column:33}},"239":{start:{line:532,column:12},end:{line:532,column:60}},"240":{start:{line:535,column:8},end:{line:539,column:9}},"241":{start:{line:536,column:12},end:{line:536,column:40}},"242":{start:{line:537,column:12},end:{line:537,column:33}},"243":{start:{line:538,column:12},end:{line:538,column:65}},"244":{start:{line:542,column:8},end:{line:545,column:10}},"245":{start:{line:548,column:8},end:{line:548,column:34}},"246":{start:{line:549,column:8},end:{line:549,column:29}},"247":{start:{line:551,column:8},end:{line:551,column:51}},"248":{start:{line:553,column:8},end:{line:553,column:51}},"249":{start:{line:554,column:8},end:{line:554,column:38}},"250":{start:{line:555,column:8},end:{line:555,column:52}},"251":{start:{line:560,column:0},end:{line:560,column:62}},"252":{start:{line:561,column:0},end:{line:609,column:3}},"253":{start:{line:562,column:4},end:{line:562,column:44}},"254":{start:{line:563,column:4},end:{line:608,column:5}},"255":{start:{line:564,column:27},end:{line:564,column:53}},"256":{start:{line:565,column:23},end:{line:565,column:36}},"257":{start:{line:567,column:8},end:{line:570,column:9}},"258":{start:{line:568,column:12},end:{line:568,column:33}},"259":{start:{line:569,column:12},end:{line:569,column:62}},"260":{start:{line:573,column:8},end:{line:573,column:44}},"261":{start:{line:576,column:30},end:{line:579,column:9}},"262":{start:{line:581,column:8},end:{line:585,column:9}},"263":{start:{line:582,column:12},end:{line:582,column:40}},"264":{start:{line:583,column:12},end:{line:583,column:33}},"265":{start:{line:584,column:12},end:{line:584,column:60}},"266":{start:{line:587,column:8},end:{line:591,column:9}},"267":{start:{line:588,column:12},end:{line:588,column:40}},"268":{start:{line:589,column:12},end:{line:589,column:33}},"269":{start:{line:590,column:12},end:{line:590,column:70}},"270":{start:{line:594,column:8},end:{line:597,column:10}},"271":{start:{line:600,column:8},end:{line:600,column:34}},"272":{start:{line:601,column:8},end:{line:601,column:29}},"273":{start:{line:603,column:8},end:{line:603,column:51}},"274":{start:{line:605,column:8},end:{line:605,column:51}},"275":{start:{line:606,column:8},end:{line:606,column:38}},"276":{start:{line:607,column:8},end:{line:607,column:52}},"277":{start:{line:612,column:0},end:{line:612,column:62}},"278":{start:{line:613,column:0},end:{line:662,column:3}},"279":{start:{line:614,column:4},end:{line:614,column:54}},"280":{start:{line:615,column:4},end:{line:661,column:5}},"281":{start:{line:616,column:27},end:{line:616,column:53}},"282":{start:{line:617,column:23},end:{line:617,column:36}},"283":{start:{line:618,column:27},end:{line:618,column:35}},"284":{start:{line:620,column:8},end:{line:623,column:9}},"285":{start:{line:621,column:12},end:{line:621,column:33}},"286":{start:{line:622,column:12},end:{line:622,column:62}},"287":{start:{line:626,column:8},end:{line:626,column:44}},"288":{start:{line:629,column:30},end:{line:632,column:9}},"289":{start:{line:634,column:8},end:{line:638,column:9}},"290":{start:{line:635,column:12},end:{line:635,column:40}},"291":{start:{line:636,column:12},end:{line:636,column:33}},"292":{start:{line:637,column:12},end:{line:637,column:60}},"293":{start:{line:640,column:8},end:{line:644,column:9}},"294":{start:{line:641,column:12},end:{line:641,column:40}},"295":{start:{line:642,column:12},end:{line:642,column:33}},"296":{start:{line:643,column:12},end:{line:643,column:74}},"297":{start:{line:647,column:8},end:{line:650,column:10}},"298":{start:{line:653,column:8},end:{line:653,column:34}},"299":{start:{line:654,column:8},end:{line:654,column:29}},"300":{start:{line:656,column:8},end:{line:656,column:51}},"301":{start:{line:658,column:8},end:{line:658,column:51}},"302":{start:{line:659,column:8},end:{line:659,column:38}},"303":{start:{line:660,column:8},end:{line:660,column:52}},"304":{start:{line:665,column:0},end:{line:665,column:48}},"305":{start:{line:666,column:0},end:{line:721,column:3}},"306":{start:{line:667,column:4},end:{line:667,column:43}},"307":{start:{line:668,column:4},end:{line:720,column:5}},"308":{start:{line:669,column:27},end:{line:669,column:53}},"309":{start:{line:670,column:71},end:{line:670,column:80}},"310":{start:{line:673,column:26},end:{line:673,column:28}},"311":{start:{line:674,column:21},end:{line:674,column:23}},"312":{start:{line:677,column:8},end:{line:680,column:9}},"313":{start:{line:678,column:12},end:{line:678,column:54}},"314":{start:{line:679,column:12},end:{line:679,column:32}},"315":{start:{line:683,column:8},end:{line:687,column:9}},"316":{start:{line:684,column:12},end:{line:684,column:54}},"317":{start:{line:685,column:12},end:{line:685,column:88}},"318":{start:{line:686,column:12},end:{line:686,column:72}},"319":{start:{line:690,column:30},end:{line:693,column:9}},"320":{start:{line:694,column:22},end:{line:694,column:42}},"321":{start:{line:697,column:23},end:{line:697,column:44}},"322":{start:{line:698,column:8},end:{line:698,column:48}},"323":{start:{line:701,column:28},end:{line:706,column:9}},"324":{start:{line:708,column:8},end:{line:708,column:29}},"325":{start:{line:710,column:8},end:{line:715,column:19}},"326":{start:{line:717,column:8},end:{line:717,column:51}},"327":{start:{line:718,column:8},end:{line:718,column:38}},"328":{start:{line:719,column:8},end:{line:719,column:52}},"329":{start:{line:724,column:0},end:{line:726,column:3}},"330":{start:{line:725,column:4},end:{line:725,column:54}},"331":{start:{line:729,column:0},end:{line:736,column:3}},"332":{start:{line:730,column:4},end:{line:730,column:41}},"333":{start:{line:731,column:4},end:{line:731,column:32}},"334":{start:{line:732,column:4},end:{line:735,column:7}},"335":{start:{line:740,column:4},end:{line:755,column:5}},"336":{start:{line:741,column:8},end:{line:741,column:29}},"337":{start:{line:743,column:8},end:{line:746,column:11}},"338":{start:{line:744,column:12},end:{line:744,column:47}},"339":{start:{line:745,column:12},end:{line:745,column:58}},"340":{start:{line:748,column:8},end:{line:748,column:49}},"341":{start:{line:749,column:8},end:{line:749,column:38}},"342":{start:{line:751,column:8},end:{line:754,column:17}},"343":{start:{line:752,column:12},end:{line:752,column:40}},"344":{start:{line:753,column:12},end:{line:753,column:26}},"345":{start:{line:760,column:4},end:{line:760,column:34}},"346":{start:{line:761,column:4},end:{line:887,column:5}},"347":{start:{line:762,column:27},end:{line:762,column:53}},"348":{start:{line:763,column:8},end:{line:763,column:33}},"349":{start:{line:766,column:8},end:{line:766,column:53}},"350":{start:{line:767,column:39},end:{line:770,column:9}},"351":{start:{line:771,column:8},end:{line:771,column:81}},"352":{start:{line:773,column:8},end:{line:779,column:9}},"353":{start:{line:774,column:12},end:{line:774,column:55}},"354":{start:{line:775,column:12},end:{line:777,column:14}},"355":{start:{line:778,column:12},end:{line:778,column:47}},"356":{start:{line:781,column:8},end:{line:781,column:53}},"357":{start:{line:782,column:38},end:{line:785,column:9}},"358":{start:{line:786,column:8},end:{line:786,column:80}},"359":{start:{line:788,column:8},end:{line:794,column:9}},"360":{start:{line:789,column:12},end:{line:789,column:55}},"361":{start:{line:790,column:12},end:{line:792,column:14}},"362":{start:{line:793,column:12},end:{line:793,column:47}},"363":{start:{line:796,column:8},end:{line:796,column:56}},"364":{start:{line:797,column:41},end:{line:800,column:9}},"365":{start:{line:801,column:8},end:{line:801,column:83}},"366":{start:{line:803,column:8},end:{line:809,column:9}},"367":{start:{line:804,column:12},end:{line:804,column:58}},"368":{start:{line:805,column:12},end:{line:807,column:14}},"369":{start:{line:808,column:12},end:{line:808,column:50}},"370":{start:{line:811,column:8},end:{line:811,column:50}},"371":{start:{line:812,column:39},end:{line:815,column:9}},"372":{start:{line:816,column:8},end:{line:816,column:81}},"373":{start:{line:818,column:8},end:{line:824,column:9}},"374":{start:{line:819,column:12},end:{line:819,column:52}},"375":{start:{line:820,column:12},end:{line:822,column:14}},"376":{start:{line:823,column:12},end:{line:823,column:44}},"377":{start:{line:827,column:8},end:{line:827,column:55}},"378":{start:{line:828,column:26},end:{line:831,column:9}},"379":{start:{line:832,column:8},end:{line:832,column:68}},"380":{start:{line:834,column:8},end:{line:840,column:9}},"381":{start:{line:835,column:12},end:{line:835,column:57}},"382":{start:{line:836,column:12},end:{line:838,column:14}},"383":{start:{line:839,column:12},end:{line:839,column:46}},"384":{start:{line:843,column:8},end:{line:843,column:53}},"385":{start:{line:844,column:35},end:{line:847,column:9}},"386":{start:{line:848,column:8},end:{line:848,column:77}},"387":{start:{line:850,column:8},end:{line:856,column:9}},"388":{start:{line:851,column:12},end:{line:851,column:55}},"389":{start:{line:852,column:12},end:{line:854,column:14}},"390":{start:{line:855,column:12},end:{line:855,column:44}},"391":{start:{line:859,column:8},end:{line:859,column:44}},"392":{start:{line:860,column:25},end:{line:862,column:9}},"393":{start:{line:863,column:8},end:{line:863,column:68}},"394":{start:{line:865,column:8},end:{line:880,column:9}},"395":{start:{line:866,column:12},end:{line:866,column:44}},"396":{start:{line:867,column:12},end:{line:878,column:15}},"397":{start:{line:879,column:12},end:{line:879,column:43}},"398":{start:{line:882,column:8},end:{line:882,column:29}},"399":{start:{line:883,column:8},end:{line:883,column:33}},"400":{start:{line:885,column:8},end:{line:885,column:51}},"401":{start:{line:886,column:8},end:{line:886,column:38}},"402":{start:{line:891,column:0},end:{line:891,column:14}},"403":{start:{line:894,column:0},end:{line:906,column:3}},"404":{start:{line:895,column:4},end:{line:895,column:30}},"405":{start:{line:896,column:4},end:{line:903,column:5}},"406":{start:{line:897,column:8},end:{line:902,column:9}},"407":{start:{line:898,column:12},end:{line:898,column:29}},"408":{start:{line:899,column:12},end:{line:899,column:37}},"409":{start:{line:901,column:12},end:{line:901,column:56}},"410":{start:{line:904,column:4},end:{line:904,column:26}},"411":{start:{line:905,column:4},end:{line:905,column:20}},"412":{start:{line:908,column:0},end:{line:908,column:21}}},fnMap:{"0":{name:"(anonymous_0)",decl:{start:{line:11,column:8},end:{line:11,column:9}},loc:{start:{line:11,column:28},end:{line:20,column:1}},line:11},"1":{name:"initDatabase",decl:{start:{line:51,column:15},end:{line:51,column:27}},loc:{start:{line:51,column:30},end:{line:81,column:1}},line:51},"2":{name:"(anonymous_2)",decl:{start:{line:76,column:19},end:{line:76,column:20}},loc:{start:{line:76,column:25},end:{line:79,column:9}},line:76},"3":{name:"sendResponse",decl:{start:{line:84,column:9},end:{line:84,column:21}},loc:{start:{line:84,column:63},end:{line:90,column:1}},line:84},"4":{name:"(anonymous_4)",decl:{start:{line:93,column:25},end:{line:93,column:26}},loc:{start:{line:93,column:45},end:{line:206,column:1}},line:93},"5":{name:"(anonymous_5)",decl:{start:{line:137,column:45},end:{line:137,column:46}},loc:{start:{line:137,column:56},end:{line:192,column:9}},line:137},"6":{name:"(anonymous_6)",decl:{start:{line:163,column:73},end:{line:163,column:74}},loc:{start:{line:163,column:80},end:{line:163,column:90}},line:163},"7":{name:"(anonymous_7)",decl:{start:{line:180,column:24},end:{line:180,column:25}},loc:{start:{line:180,column:31},end:{line:184,column:17}},line:180},"8":{name:"(anonymous_8)",decl:{start:{line:186,column:21},end:{line:186,column:22}},loc:{start:{line:186,column:28},end:{line:186,column:56}},line:186},"9":{name:"(anonymous_9)",decl:{start:{line:209,column:38},end:{line:209,column:39}},loc:{start:{line:209,column:58},end:{line:260,column:1}},line:209},"10":{name:"(anonymous_10)",decl:{start:{line:265,column:37},end:{line:265,column:38}},loc:{start:{line:265,column:57},end:{line:318,column:1}},line:265},"11":{name:"(anonymous_11)",decl:{start:{line:333,column:24},end:{line:333,column:25}},loc:{start:{line:333,column:44},end:{line:345,column:1}},line:333},"12":{name:"(anonymous_12)",decl:{start:{line:348,column:25},end:{line:348,column:26}},loc:{start:{line:348,column:45},end:{line:415,column:1}},line:348},"13":{name:"(anonymous_13)",decl:{start:{line:366,column:43},end:{line:366,column:44}},loc:{start:{line:366,column:53},end:{line:366,column:68}},line:366},"14":{name:"(anonymous_14)",decl:{start:{line:385,column:52},end:{line:385,column:53}},loc:{start:{line:386,column:16},end:{line:386,column:71}},line:386},"15":{name:"(anonymous_15)",decl:{start:{line:418,column:37},end:{line:418,column:38}},loc:{start:{line:418,column:57},end:{line:447,column:1}},line:418},"16":{name:"(anonymous_16)",decl:{start:{line:451,column:39},end:{line:451,column:40}},loc:{start:{line:451,column:59},end:{line:499,column:1}},line:451},"17":{name:"(anonymous_17)",decl:{start:{line:503,column:38},end:{line:503,column:39}},loc:{start:{line:503,column:58},end:{line:557,column:1}},line:503},"18":{name:"(anonymous_18)",decl:{start:{line:561,column:41},end:{line:561,column:42}},loc:{start:{line:561,column:61},end:{line:609,column:1}},line:561},"19":{name:"(anonymous_19)",decl:{start:{line:613,column:41},end:{line:613,column:42}},loc:{start:{line:613,column:61},end:{line:662,column:1}},line:613},"20":{name:"(anonymous_20)",decl:{start:{line:666,column:26},end:{line:666,column:27}},loc:{start:{line:666,column:46},end:{line:721,column:1}},line:666},"21":{name:"(anonymous_21)",decl:{start:{line:724,column:13},end:{line:724,column:14}},loc:{start:{line:724,column:27},end:{line:726,column:1}},line:724},"22":{name:"(anonymous_22)",decl:{start:{line:729,column:8},end:{line:729,column:9}},loc:{start:{line:729,column:33},end:{line:736,column:1}},line:729},"23":{name:"startServer",decl:{start:{line:739,column:15},end:{line:739,column:26}},loc:{start:{line:739,column:29},end:{line:756,column:1}},line:739},"24":{name:"(anonymous_24)",decl:{start:{line:743,column:25},end:{line:743,column:26}},loc:{start:{line:743,column:31},end:{line:746,column:9}},line:743},"25":{name:"(anonymous_25)",decl:{start:{line:751,column:19},end:{line:751,column:20}},loc:{start:{line:751,column:25},end:{line:754,column:9}},line:751},"26":{name:"ensureDatabaseSchema",decl:{start:{line:759,column:15},end:{line:759,column:35}},loc:{start:{line:759,column:38},end:{line:888,column:1}},line:759},"27":{name:"(anonymous_27)",decl:{start:{line:894,column:21},end:{line:894,column:22}},loc:{start:{line:894,column:33},end:{line:906,column:1}},line:894}},branchMap:{"0":{loc:{start:{line:7,column:13},end:{line:7,column:37}},type:"binary-expr",locations:[{start:{line:7,column:13},end:{line:7,column:29}},{start:{line:7,column:33},end:{line:7,column:37}}],line:7},"1":{loc:{start:{line:15,column:4},end:{line:18,column:5}},type:"if",locations:[{start:{line:15,column:4},end:{line:18,column:5}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:15},"2":{loc:{start:{line:84,column:36},end:{line:84,column:47}},type:"default-arg",locations:[{start:{line:84,column:43},end:{line:84,column:47}}],line:84},"3":{loc:{start:{line:84,column:49},end:{line:84,column:61}},type:"default-arg",locations:[{start:{line:84,column:59},end:{line:84,column:61}}],line:84},"4":{loc:{start:{line:98,column:16},end:{line:98,column:24}},type:"default-arg",locations:[{start:{line:98,column:23},end:{line:98,column:24}}],line:98},"5":{loc:{start:{line:98,column:26},end:{line:98,column:39}},type:"default-arg",locations:[{start:{line:98,column:37},end:{line:98,column:39}}],line:98},"6":{loc:{start:{line:98,column:41},end:{line:98,column:52}},type:"default-arg",locations:[{start:{line:98,column:50},end:{line:98,column:52}}],line:98},"7":{loc:{start:{line:98,column:54},end:{line:98,column:66}},type:"default-arg",locations:[{start:{line:98,column:64},end:{line:98,column:66}}],line:98},"8":{loc:{start:{line:98,column:68},end:{line:98,column:79}},type:"default-arg",locations:[{start:{line:98,column:77},end:{line:98,column:79}}],line:98},"9":{loc:{start:{line:100,column:29},end:{line:100,column:46}},type:"binary-expr",locations:[{start:{line:100,column:29},end:{line:100,column:36}},{start:{line:100,column:40},end:{line:100,column:46}}],line:100},"10":{loc:{start:{line:110,column:8},end:{line:113,column:9}},type:"if",locations:[{start:{line:110,column:8},end:{line:113,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:110},"11":{loc:{start:{line:116,column:8},end:{line:120,column:9}},type:"if",locations:[{start:{line:116,column:8},end:{line:120,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:116},"12":{loc:{start:{line:117,column:27},end:{line:117,column:59}},type:"cond-expr",locations:[{start:{line:117,column:42},end:{line:117,column:48}},{start:{line:117,column:51},end:{line:117,column:59}}],line:117},"13":{loc:{start:{line:141,column:12},end:{line:176,column:13}},type:"if",locations:[{start:{line:141,column:12},end:{line:176,column:13}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:141},"14":{loc:{start:{line:142,column:16},end:{line:175,column:17}},type:"if",locations:[{start:{line:142,column:16},end:{line:175,column:17}},{start:{line:169,column:23},end:{line:175,column:17}}],line:142},"15":{loc:{start:{line:148,column:24},end:{line:152,column:25}},type:"if",locations:[{start:{line:148,column:24},end:{line:152,column:25}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:148},"16":{loc:{start:{line:148,column:28},end:{line:149,column:90}},type:"binary-expr",locations:[{start:{line:148,column:28},end:{line:148,column:60}},{start:{line:149,column:29},end:{line:149,column:57}},{start:{line:149,column:61},end:{line:149,column:89}}],line:148},"17":{loc:{start:{line:154,column:24},end:{line:159,column:25}},type:"if",locations:[{start:{line:154,column:24},end:{line:159,column:25}},{start:{line:156,column:31},end:{line:159,column:25}}],line:154},"18":{loc:{start:{line:156,column:31},end:{line:159,column:25}},type:"if",locations:[{start:{line:156,column:31},end:{line:159,column:25}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:156},"19":{loc:{start:{line:162,column:24},end:{line:167,column:25}},type:"if",locations:[{start:{line:162,column:24},end:{line:167,column:25}},{start:{line:164,column:31},end:{line:167,column:25}}],line:162},"20":{loc:{start:{line:169,column:23},end:{line:175,column:17}},type:"if",locations:[{start:{line:169,column:23},end:{line:175,column:17}},{start:{line:172,column:23},end:{line:175,column:17}}],line:169},"21":{loc:{start:{line:181,column:20},end:{line:181,column:43}},type:"if",locations:[{start:{line:181,column:20},end:{line:181,column:43}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:181},"22":{loc:{start:{line:183,column:27},end:{line:183,column:100}},type:"binary-expr",locations:[{start:{line:183,column:27},end:{line:183,column:61}},{start:{line:183,column:65},end:{line:183,column:100}}],line:183},"23":{loc:{start:{line:213,column:16},end:{line:213,column:27}},type:"default-arg",locations:[{start:{line:213,column:25},end:{line:213,column:27}}],line:213},"24":{loc:{start:{line:225,column:8},end:{line:229,column:9}},type:"if",locations:[{start:{line:225,column:8},end:{line:229,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:225},"25":{loc:{start:{line:232,column:8},end:{line:236,column:9}},type:"if",locations:[{start:{line:232,column:8},end:{line:236,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:232},"26":{loc:{start:{line:270,column:24},end:{line:270,column:41}},type:"default-arg",locations:[{start:{line:270,column:39},end:{line:270,column:41}}],line:270},"27":{loc:{start:{line:270,column:43},end:{line:270,column:54}},type:"default-arg",locations:[{start:{line:270,column:52},end:{line:270,column:54}}],line:270},"28":{loc:{start:{line:272,column:35},end:{line:272,column:57}},type:"binary-expr",locations:[{start:{line:272,column:35},end:{line:272,column:41}},{start:{line:272,column:45},end:{line:272,column:57}}],line:272},"29":{loc:{start:{line:284,column:8},end:{line:288,column:9}},type:"if",locations:[{start:{line:284,column:8},end:{line:288,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:284},"30":{loc:{start:{line:290,column:8},end:{line:294,column:9}},type:"if",locations:[{start:{line:290,column:8},end:{line:294,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:290},"31":{loc:{start:{line:290,column:12},end:{line:290,column:103}},type:"binary-expr",locations:[{start:{line:290,column:12},end:{line:290,column:54}},{start:{line:290,column:58},end:{line:290,column:103}}],line:290},"32":{loc:{start:{line:357,column:8},end:{line:360,column:9}},type:"if",locations:[{start:{line:357,column:8},end:{line:360,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:357},"33":{loc:{start:{line:386,column:16},end:{line:386,column:71}},type:"binary-expr",locations:[{start:{line:386,column:16},end:{line:386,column:42}},{start:{line:386,column:46},end:{line:386,column:71}}],line:386},"34":{loc:{start:{line:389,column:12},end:{line:405,column:13}},type:"if",locations:[{start:{line:389,column:12},end:{line:405,column:13}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:389},"35":{loc:{start:{line:392,column:20},end:{line:403,column:21}},type:"if",locations:[{start:{line:392,column:20},end:{line:403,column:21}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:392},"36":{loc:{start:{line:392,column:24},end:{line:392,column:74}},type:"binary-expr",locations:[{start:{line:392,column:24},end:{line:392,column:40}},{start:{line:392,column:44},end:{line:392,column:74}}],line:392},"37":{loc:{start:{line:394,column:24},end:{line:402,column:25}},type:"if",locations:[{start:{line:394,column:24},end:{line:402,column:25}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:394},"38":{loc:{start:{line:436,column:8},end:{line:439,column:9}},type:"if",locations:[{start:{line:436,column:8},end:{line:439,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:436},"39":{loc:{start:{line:457,column:8},end:{line:460,column:9}},type:"if",locations:[{start:{line:457,column:8},end:{line:460,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:457},"40":{loc:{start:{line:471,column:8},end:{line:475,column:9}},type:"if",locations:[{start:{line:471,column:8},end:{line:475,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:471},"41":{loc:{start:{line:477,column:8},end:{line:481,column:9}},type:"if",locations:[{start:{line:477,column:8},end:{line:481,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:477},"42":{loc:{start:{line:510,column:8},end:{line:513,column:9}},type:"if",locations:[{start:{line:510,column:8},end:{line:513,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:510},"43":{loc:{start:{line:515,column:8},end:{line:518,column:9}},type:"if",locations:[{start:{line:515,column:8},end:{line:518,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:515},"44":{loc:{start:{line:529,column:8},end:{line:533,column:9}},type:"if",locations:[{start:{line:529,column:8},end:{line:533,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:529},"45":{loc:{start:{line:535,column:8},end:{line:539,column:9}},type:"if",locations:[{start:{line:535,column:8},end:{line:539,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:535},"46":{loc:{start:{line:567,column:8},end:{line:570,column:9}},type:"if",locations:[{start:{line:567,column:8},end:{line:570,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:567},"47":{loc:{start:{line:581,column:8},end:{line:585,column:9}},type:"if",locations:[{start:{line:581,column:8},end:{line:585,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:581},"48":{loc:{start:{line:587,column:8},end:{line:591,column:9}},type:"if",locations:[{start:{line:587,column:8},end:{line:591,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:587},"49":{loc:{start:{line:620,column:8},end:{line:623,column:9}},type:"if",locations:[{start:{line:620,column:8},end:{line:623,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:620},"50":{loc:{start:{line:634,column:8},end:{line:638,column:9}},type:"if",locations:[{start:{line:634,column:8},end:{line:638,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:634},"51":{loc:{start:{line:640,column:8},end:{line:644,column:9}},type:"if",locations:[{start:{line:640,column:8},end:{line:644,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:640},"52":{loc:{start:{line:640,column:12},end:{line:640,column:107}},type:"binary-expr",locations:[{start:{line:640,column:12},end:{line:640,column:55}},{start:{line:640,column:59},end:{line:640,column:107}}],line:640},"53":{loc:{start:{line:670,column:16},end:{line:670,column:24}},type:"default-arg",locations:[{start:{line:670,column:23},end:{line:670,column:24}}],line:670},"54":{loc:{start:{line:670,column:26},end:{line:670,column:39}},type:"default-arg",locations:[{start:{line:670,column:37},end:{line:670,column:39}}],line:670},"55":{loc:{start:{line:670,column:41},end:{line:670,column:52}},type:"default-arg",locations:[{start:{line:670,column:50},end:{line:670,column:52}}],line:670},"56":{loc:{start:{line:670,column:54},end:{line:670,column:66}},type:"default-arg",locations:[{start:{line:670,column:64},end:{line:670,column:66}}],line:670},"57":{loc:{start:{line:677,column:8},end:{line:680,column:9}},type:"if",locations:[{start:{line:677,column:8},end:{line:680,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:677},"58":{loc:{start:{line:683,column:8},end:{line:687,column:9}},type:"if",locations:[{start:{line:683,column:8},end:{line:687,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:683},"59":{loc:{start:{line:684,column:27},end:{line:684,column:53}},type:"cond-expr",locations:[{start:{line:684,column:36},end:{line:684,column:42}},{start:{line:684,column:45},end:{line:684,column:53}}],line:684},"60":{loc:{start:{line:771,column:32},end:{line:771,column:79}},type:"cond-expr",locations:[{start:{line:771,column:66},end:{line:771,column:71}},{start:{line:771,column:74},end:{line:771,column:79}}],line:771},"61":{loc:{start:{line:773,column:8},end:{line:779,column:9}},type:"if",locations:[{start:{line:773,column:8},end:{line:779,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:773},"62":{loc:{start:{line:786,column:32},end:{line:786,column:78}},type:"cond-expr",locations:[{start:{line:786,column:65},end:{line:786,column:70}},{start:{line:786,column:73},end:{line:786,column:78}}],line:786},"63":{loc:{start:{line:788,column:8},end:{line:794,column:9}},type:"if",locations:[{start:{line:788,column:8},end:{line:794,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:788},"64":{loc:{start:{line:801,column:32},end:{line:801,column:81}},type:"cond-expr",locations:[{start:{line:801,column:68},end:{line:801,column:73}},{start:{line:801,column:76},end:{line:801,column:81}}],line:801},"65":{loc:{start:{line:803,column:8},end:{line:809,column:9}},type:"if",locations:[{start:{line:803,column:8},end:{line:809,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:803},"66":{loc:{start:{line:816,column:32},end:{line:816,column:79}},type:"cond-expr",locations:[{start:{line:816,column:66},end:{line:816,column:71}},{start:{line:816,column:74},end:{line:816,column:79}}],line:816},"67":{loc:{start:{line:818,column:8},end:{line:824,column:9}},type:"if",locations:[{start:{line:818,column:8},end:{line:824,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:818},"68":{loc:{start:{line:832,column:32},end:{line:832,column:66}},type:"cond-expr",locations:[{start:{line:832,column:53},end:{line:832,column:58}},{start:{line:832,column:61},end:{line:832,column:66}}],line:832},"69":{loc:{start:{line:834,column:8},end:{line:840,column:9}},type:"if",locations:[{start:{line:834,column:8},end:{line:840,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:834},"70":{loc:{start:{line:848,column:32},end:{line:848,column:75}},type:"cond-expr",locations:[{start:{line:848,column:62},end:{line:848,column:67}},{start:{line:848,column:70},end:{line:848,column:75}}],line:848},"71":{loc:{start:{line:850,column:8},end:{line:856,column:9}},type:"if",locations:[{start:{line:850,column:8},end:{line:856,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:850},"72":{loc:{start:{line:863,column:33},end:{line:863,column:66}},type:"cond-expr",locations:[{start:{line:863,column:53},end:{line:863,column:58}},{start:{line:863,column:61},end:{line:863,column:66}}],line:863},"73":{loc:{start:{line:865,column:8},end:{line:880,column:9}},type:"if",locations:[{start:{line:865,column:8},end:{line:880,column:9}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:865},"74":{loc:{start:{line:896,column:4},end:{line:903,column:5}},type:"if",locations:[{start:{line:896,column:4},end:{line:903,column:5}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:896}},s:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"176":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"251":0,"252":0,"253":0,"254":0,"255":0,"256":0,"257":0,"258":0,"259":0,"260":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"267":0,"268":0,"269":0,"270":0,"271":0,"272":0,"273":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"287":0,"288":0,"289":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0,"296":0,"297":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":0,"304":0,"305":0,"306":0,"307":0,"308":0,"309":0,"310":0,"311":0,"312":0,"313":0,"314":0,"315":0,"316":0,"317":0,"318":0,"319":0,"320":0,"321":0,"322":0,"323":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"330":0,"331":0,"332":0,"333":0,"334":0,"335":0,"336":0,"337":0,"338":0,"339":0,"340":0,"341":0,"342":0,"343":0,"344":0,"345":0,"346":0,"347":0,"348":0,"349":0,"350":0,"351":0,"352":0,"353":0,"354":0,"355":0,"356":0,"357":0,"358":0,"359":0,"360":0,"361":0,"362":0,"363":0,"364":0,"365":0,"366":0,"367":0,"368":0,"369":0,"370":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"381":0,"382":0,"383":0,"384":0,"385":0,"386":0,"387":0,"388":0,"389":0,"390":0,"391":0,"392":0,"393":0,"394":0,"395":0,"396":0,"397":0,"398":0,"399":0,"400":0,"401":0,"402":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"411":0,"412":0},f:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0},b:{"0":[0,0],"1":[0,0],"2":[0],"3":[0],"4":[0],"5":[0],"6":[0],"7":[0],"8":[0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0],"24":[0,0],"25":[0,0],"26":[0],"27":[0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0],"53":[0],"54":[0],"55":[0],"56":[0],"57":[0,0],"58":[0,0],"59":[0,0],"60":[0,0],"61":[0,0],"62":[0,0],"63":[0,0],"64":[0,0],"65":[0,0],"66":[0,0],"67":[0,0],"68":[0,0],"69":[0,0],"70":[0,0],"71":[0,0],"72":[0,0],"73":[0,0],"74":[0,0]},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"0949a5d7e06e37b0d3d9929399aaaff6f267dbef"};var coverage=global[gcv]||(global[gcv]={});if(!coverage[path]||coverage[path].hash!==hash){coverage[path]=coverageData;}var actualCoverage=coverage[path];{// @ts-ignore +cov_1kbb7fz0lp=function(){return actualCoverage;};}return actualCoverage;}cov_1kbb7fz0lp();const express=(cov_1kbb7fz0lp().s[0]++,require('express'));const bodyParser=(cov_1kbb7fz0lp().s[1]++,require('body-parser'));const cors=(cov_1kbb7fz0lp().s[2]++,require('cors'));const mysql=(cov_1kbb7fz0lp().s[3]++,require('mysql2/promise'));const path=(cov_1kbb7fz0lp().s[4]++,require('path'));const app=(cov_1kbb7fz0lp().s[5]++,express());const PORT=(cov_1kbb7fz0lp().s[6]++,(cov_1kbb7fz0lp().b[0][0]++,process.env.PORT)||(cov_1kbb7fz0lp().b[0][1]++,3000));// 配置CORS +cov_1kbb7fz0lp().s[7]++;app.use(cors());cov_1kbb7fz0lp().s[8]++;app.use((req,res,next)=>{cov_1kbb7fz0lp().f[0]++;cov_1kbb7fz0lp().s[9]++;res.header('Access-Control-Allow-Origin','*');cov_1kbb7fz0lp().s[10]++;res.header('Access-Control-Allow-Methods','GET, POST, PUT, DELETE, OPTIONS');cov_1kbb7fz0lp().s[11]++;res.header('Access-Control-Allow-Headers','Content-Type, Authorization');cov_1kbb7fz0lp().s[12]++;if(req.method==='OPTIONS'){cov_1kbb7fz0lp().b[1][0]++;cov_1kbb7fz0lp().s[13]++;res.status(200).end();cov_1kbb7fz0lp().s[14]++;return;}else{cov_1kbb7fz0lp().b[1][1]++;}cov_1kbb7fz0lp().s[15]++;next();});cov_1kbb7fz0lp().s[16]++;app.use(bodyParser.json());cov_1kbb7fz0lp().s[17]++;app.use(express.static(path.join(__dirname)));// 数据库配置 +const dbConfig=(cov_1kbb7fz0lp().s[18]++,{host:'1.95.162.61',user:'root',password:'schl@2025',// 请替换为实际的数据库密码 +database:'wechat_app',// 连接到wechat_app数据库 +waitForConnections:true,connectionLimit:10,queueLimit:0});// userlogin数据库配置 +const userLoginDbConfig=(cov_1kbb7fz0lp().s[19]++,{host:'1.95.162.61',user:'root',password:'schl@2025',// 请替换为实际的数据库密码 +database:'userlogin',// 连接到userlogin数据库 +waitForConnections:true,connectionLimit:10,queueLimit:0});// 创建数据库连接池 +let pool;let userLoginPool;// 初始化数据库连接 +async function initDatabase(){cov_1kbb7fz0lp().f[1]++;cov_1kbb7fz0lp().s[20]++;try{cov_1kbb7fz0lp().s[21]++;pool=mysql.createPool(dbConfig);cov_1kbb7fz0lp().s[22]++;console.log('wechat_app数据库连接池创建成功');// 初始化userlogin数据库连接池 +cov_1kbb7fz0lp().s[23]++;userLoginPool=mysql.createPool(userLoginDbConfig);cov_1kbb7fz0lp().s[24]++;console.log('userlogin数据库连接池创建成功');// 测试wechat_app连接 +const connection=(cov_1kbb7fz0lp().s[25]++,await pool.getConnection());cov_1kbb7fz0lp().s[26]++;console.log('wechat_app数据库连接测试成功');cov_1kbb7fz0lp().s[27]++;connection.release();// 测试userlogin连接 +const userLoginConnection=(cov_1kbb7fz0lp().s[28]++,await userLoginPool.getConnection());cov_1kbb7fz0lp().s[29]++;console.log('userlogin数据库连接测试成功');cov_1kbb7fz0lp().s[30]++;userLoginConnection.release();// 确保数据库结构 +cov_1kbb7fz0lp().s[31]++;await ensureDatabaseSchema();}catch(error){cov_1kbb7fz0lp().s[32]++;console.error('数据库初始化失败:',error.message);cov_1kbb7fz0lp().s[33]++;console.error('错误详情:',error);// 如果初始化失败,尝试重新初始化 +cov_1kbb7fz0lp().s[34]++;setTimeout(()=>{cov_1kbb7fz0lp().f[2]++;cov_1kbb7fz0lp().s[35]++;console.log('尝试重新初始化数据库连接...');cov_1kbb7fz0lp().s[36]++;initDatabase();},5000);}}// 通用响应函数 +function sendResponse(res,success,data=(cov_1kbb7fz0lp().b[2][0]++,null),message=(cov_1kbb7fz0lp().b[3][0]++,'')){cov_1kbb7fz0lp().f[3]++;cov_1kbb7fz0lp().s[37]++;res.json({success,data,message});}// 获取货源列表API +cov_1kbb7fz0lp().s[38]++;app.get('/api/supplies',async(req,res)=>{cov_1kbb7fz0lp().f[4]++;cov_1kbb7fz0lp().s[39]++;console.log('收到获取货源列表请求:',req.query);cov_1kbb7fz0lp().s[40]++;try{const connection=(cov_1kbb7fz0lp().s[41]++,await pool.getConnection());// 支持search和keyword两种参数名,确保兼容性 +const{page=(cov_1kbb7fz0lp().b[4][0]++,1),pageSize=(cov_1kbb7fz0lp().b[5][0]++,10),search=(cov_1kbb7fz0lp().b[6][0]++,''),keyword=(cov_1kbb7fz0lp().b[7][0]++,''),status=(cov_1kbb7fz0lp().b[8][0]++,'')}=(cov_1kbb7fz0lp().s[42]++,req.query);// 如果提供了keyword参数,优先使用keyword +const actualSearch=(cov_1kbb7fz0lp().s[43]++,(cov_1kbb7fz0lp().b[9][0]++,keyword)||(cov_1kbb7fz0lp().b[9][1]++,search));const offset=(cov_1kbb7fz0lp().s[44]++,(page-1)*pageSize);// 构建基础查询,添加LEFT JOIN获取用户信息 +let query=(cov_1kbb7fz0lp().s[45]++,'SELECT p.*, u.phoneNumber, u.nickName FROM products p LEFT JOIN users u ON p.sellerId = u.userId');let countQuery=(cov_1kbb7fz0lp().s[46]++,'SELECT COUNT(*) as total FROM products p LEFT JOIN users u ON p.sellerId = u.userId');let whereClause=(cov_1kbb7fz0lp().s[47]++,'');let params=(cov_1kbb7fz0lp().s[48]++,[]);// 添加搜索条件 +cov_1kbb7fz0lp().s[49]++;if(actualSearch){cov_1kbb7fz0lp().b[10][0]++;cov_1kbb7fz0lp().s[50]++;whereClause+=` WHERE (p.id LIKE ? OR p.productId LIKE ? OR p.productName LIKE ?)`;cov_1kbb7fz0lp().s[51]++;params.push(`%${actualSearch}%`,`%${actualSearch}%`,`%${actualSearch}%`);}else{cov_1kbb7fz0lp().b[10][1]++;}// 添加状态筛选 +cov_1kbb7fz0lp().s[52]++;if(status){cov_1kbb7fz0lp().b[11][0]++;cov_1kbb7fz0lp().s[53]++;whereClause+=actualSearch?(cov_1kbb7fz0lp().b[12][0]++,' AND'):(cov_1kbb7fz0lp().b[12][1]++,' WHERE');cov_1kbb7fz0lp().s[54]++;whereClause+=` status = ?`;cov_1kbb7fz0lp().s[55]++;params.push(status);}else{cov_1kbb7fz0lp().b[11][1]++;}// 执行查询 +const[results]=(cov_1kbb7fz0lp().s[56]++,await connection.query(`${query}${whereClause} ORDER BY p.id DESC LIMIT ? OFFSET ?`,[...params,parseInt(pageSize),offset]));// 获取总数 +const[countResults]=(cov_1kbb7fz0lp().s[57]++,await connection.query(`${countQuery}${whereClause}`,params));cov_1kbb7fz0lp().s[58]++;connection.release();// 处理返回结果中的imageUrls字段 +const processedResults=(cov_1kbb7fz0lp().s[59]++,results.map(product=>{cov_1kbb7fz0lp().f[5]++;// 处理imageUrls字段 +let imageUrls=(cov_1kbb7fz0lp().s[60]++,[]);cov_1kbb7fz0lp().s[61]++;if(product.imageUrls){cov_1kbb7fz0lp().b[13][0]++;cov_1kbb7fz0lp().s[62]++;if(typeof product.imageUrls==='string'){cov_1kbb7fz0lp().b[14][0]++;cov_1kbb7fz0lp().s[63]++;// 尝试解析为JSON数组 +try{let parsedImages=(cov_1kbb7fz0lp().s[64]++,JSON.parse(product.imageUrls));// 检查是否是JSON字符串的字符串表示(转义的JSON) +cov_1kbb7fz0lp().s[65]++;if((cov_1kbb7fz0lp().b[16][0]++,typeof parsedImages==='string')&&((cov_1kbb7fz0lp().b[16][1]++,parsedImages.startsWith('['))||(cov_1kbb7fz0lp().b[16][2]++,parsedImages.startsWith('{')))){cov_1kbb7fz0lp().b[15][0]++;cov_1kbb7fz0lp().s[66]++;// 进行第二次解析 +parsedImages=JSON.parse(parsedImages);}else{cov_1kbb7fz0lp().b[15][1]++;}cov_1kbb7fz0lp().s[67]++;if(Array.isArray(parsedImages)){cov_1kbb7fz0lp().b[17][0]++;cov_1kbb7fz0lp().s[68]++;imageUrls=parsedImages;}else{cov_1kbb7fz0lp().b[17][1]++;cov_1kbb7fz0lp().s[69]++;if(typeof parsedImages==='string'){cov_1kbb7fz0lp().b[18][0]++;cov_1kbb7fz0lp().s[70]++;// 如果解析结果是字符串,可能是单个URL +imageUrls=[parsedImages];}else{cov_1kbb7fz0lp().b[18][1]++;}}}catch(e){cov_1kbb7fz0lp().s[71]++;// 解析失败,尝试按逗号分隔 +if(product.imageUrls.includes(',')){cov_1kbb7fz0lp().b[19][0]++;cov_1kbb7fz0lp().s[72]++;imageUrls=product.imageUrls.split(',').map(url=>{cov_1kbb7fz0lp().f[6]++;cov_1kbb7fz0lp().s[73]++;return url.trim();});}else{cov_1kbb7fz0lp().b[19][1]++;cov_1kbb7fz0lp().s[74]++;// 作为单个URL处理 +imageUrls=[product.imageUrls.trim()];}}}else{cov_1kbb7fz0lp().b[14][1]++;cov_1kbb7fz0lp().s[75]++;if(Array.isArray(product.imageUrls)){cov_1kbb7fz0lp().b[20][0]++;cov_1kbb7fz0lp().s[76]++;// 已经是数组,直接使用 +imageUrls=product.imageUrls;}else{cov_1kbb7fz0lp().b[20][1]++;cov_1kbb7fz0lp().s[77]++;// 其他类型,转换为字符串数组 +imageUrls=[String(product.imageUrls)];}}}else{cov_1kbb7fz0lp().b[13][1]++;}// 过滤并处理无效的URL:移除反引号并验证 +cov_1kbb7fz0lp().s[78]++;imageUrls=imageUrls.filter(url=>{cov_1kbb7fz0lp().f[7]++;cov_1kbb7fz0lp().s[79]++;if(!url){cov_1kbb7fz0lp().b[21][0]++;cov_1kbb7fz0lp().s[80]++;return false;}else{cov_1kbb7fz0lp().b[21][1]++;}const processedUrl=(cov_1kbb7fz0lp().s[81]++,url.replace(/`/g,'').trim());cov_1kbb7fz0lp().s[82]++;return(cov_1kbb7fz0lp().b[22][0]++,processedUrl.startsWith('http://'))||(cov_1kbb7fz0lp().b[22][1]++,processedUrl.startsWith('https://'));})// 对每个有效URL进行处理,移除反引号 +.map(url=>{cov_1kbb7fz0lp().f[8]++;cov_1kbb7fz0lp().s[83]++;return url.replace(/`/g,'').trim();});cov_1kbb7fz0lp().s[84]++;return{...product,imageUrls};}));// 返回结果 +cov_1kbb7fz0lp().s[85]++;sendResponse(res,true,{list:processedResults,total:countResults[0].total,page:parseInt(page),pageSize:parseInt(pageSize)},'获取货源列表成功');}catch(error){cov_1kbb7fz0lp().s[86]++;console.error('获取货源列表失败:',error.message);cov_1kbb7fz0lp().s[87]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[88]++;sendResponse(res,false,null,'获取货源列表失败');}});// 审核通过API +cov_1kbb7fz0lp().s[89]++;app.post('/api/supplies/:id/approve',async(req,res)=>{cov_1kbb7fz0lp().f[9]++;cov_1kbb7fz0lp().s[90]++;console.log('收到审核通过请求:',req.params.id,req.body);cov_1kbb7fz0lp().s[91]++;try{const connection=(cov_1kbb7fz0lp().s[92]++,await pool.getConnection());const{remark=(cov_1kbb7fz0lp().b[23][0]++,'')}=(cov_1kbb7fz0lp().s[93]++,req.body);const productId=(cov_1kbb7fz0lp().s[94]++,req.params.id);// 开始事务 +cov_1kbb7fz0lp().s[95]++;await connection.beginTransaction();// 检查当前状态 +const[currentProduct]=(cov_1kbb7fz0lp().s[96]++,await connection.query('SELECT status FROM products WHERE id = ?',[productId]));cov_1kbb7fz0lp().s[97]++;if(currentProduct.length===0){cov_1kbb7fz0lp().b[24][0]++;cov_1kbb7fz0lp().s[98]++;await connection.rollback();cov_1kbb7fz0lp().s[99]++;connection.release();cov_1kbb7fz0lp().s[100]++;return sendResponse(res,false,null,'货源不存在');}else{cov_1kbb7fz0lp().b[24][1]++;}// 检查状态是否可审核,增加对多种待审核状态的支持 +cov_1kbb7fz0lp().s[101]++;if(!['pending','draft','pending_review','underreview','待审核'].includes(currentProduct[0].status)){cov_1kbb7fz0lp().b[25][0]++;cov_1kbb7fz0lp().s[102]++;await connection.rollback();cov_1kbb7fz0lp().s[103]++;connection.release();cov_1kbb7fz0lp().s[104]++;return sendResponse(res,false,null,'该货源已审核,无需重复操作');}else{cov_1kbb7fz0lp().b[25][1]++;}// 更新状态 +cov_1kbb7fz0lp().s[105]++;await connection.query('UPDATE products SET status = ?, audit_time = ? WHERE id = ?',['published',new Date(),productId]);// 记录日志 +cov_1kbb7fz0lp().s[106]++;await connection.query('INSERT INTO audit_logs (supply_id, action, user_id, remark, created_at) VALUES (?, ?, ?, ?, ?)',[productId,'approve','system',remark,new Date()]);// 提交事务 +cov_1kbb7fz0lp().s[107]++;await connection.commit();cov_1kbb7fz0lp().s[108]++;connection.release();cov_1kbb7fz0lp().s[109]++;sendResponse(res,true,null,'审核通过成功');}catch(error){cov_1kbb7fz0lp().s[110]++;console.error('审核通过失败:',error.message);cov_1kbb7fz0lp().s[111]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[112]++;sendResponse(res,false,null,'审核通过失败');}});cov_1kbb7fz0lp().s[113]++;console.log('正在注册拒绝审核API路由: /api/supplies/:id/reject');// 审核拒绝API +cov_1kbb7fz0lp().s[114]++;app.post('/api/supplies/:id/reject',async(req,res)=>{cov_1kbb7fz0lp().f[10]++;cov_1kbb7fz0lp().s[115]++;console.log('收到审核拒绝请求:',req.params.id,req.body);cov_1kbb7fz0lp().s[116]++;try{const connection=(cov_1kbb7fz0lp().s[117]++,await pool.getConnection());// 同时支持reason和rejectReason参数,保持向后兼容 +const{reason,rejectReason=(cov_1kbb7fz0lp().b[26][0]++,''),remark=(cov_1kbb7fz0lp().b[27][0]++,'')}=(cov_1kbb7fz0lp().s[118]++,req.body);// 如果有reason参数,则使用reason,否则使用rejectReason +const actualRejectReason=(cov_1kbb7fz0lp().s[119]++,(cov_1kbb7fz0lp().b[28][0]++,reason)||(cov_1kbb7fz0lp().b[28][1]++,rejectReason));const productId=(cov_1kbb7fz0lp().s[120]++,req.params.id);// 开始事务 +cov_1kbb7fz0lp().s[121]++;await connection.beginTransaction();// 检查当前状态 +const[currentProduct]=(cov_1kbb7fz0lp().s[122]++,await connection.query('SELECT status FROM products WHERE id = ?',[productId]));cov_1kbb7fz0lp().s[123]++;if(currentProduct.length===0){cov_1kbb7fz0lp().b[29][0]++;cov_1kbb7fz0lp().s[124]++;await connection.rollback();cov_1kbb7fz0lp().s[125]++;connection.release();cov_1kbb7fz0lp().s[126]++;return sendResponse(res,false,null,'货源不存在');}else{cov_1kbb7fz0lp().b[29][1]++;}cov_1kbb7fz0lp().s[127]++;if((cov_1kbb7fz0lp().b[31][0]++,currentProduct[0].status!=='underreview')&&(cov_1kbb7fz0lp().b[31][1]++,currentProduct[0].status!=='pending_review')){cov_1kbb7fz0lp().b[30][0]++;cov_1kbb7fz0lp().s[128]++;await connection.rollback();cov_1kbb7fz0lp().s[129]++;connection.release();cov_1kbb7fz0lp().s[130]++;return sendResponse(res,false,null,'当前状态不允许审核拒绝');}else{cov_1kbb7fz0lp().b[30][1]++;}// 更新状态和拒绝理由 +cov_1kbb7fz0lp().s[131]++;await connection.query('UPDATE products SET status = ?, rejectReason = ?, audit_time = ? WHERE id = ?',['reviewfailed',actualRejectReason,new Date(),productId]);// 记录日志 +cov_1kbb7fz0lp().s[132]++;await connection.query('INSERT INTO audit_logs (supply_id, action, user_id, remark, created_at) VALUES (?, ?, ?, ?, ?)',[productId,'reject','system',remark,new Date()]);// 提交事务 +cov_1kbb7fz0lp().s[133]++;await connection.commit();cov_1kbb7fz0lp().s[134]++;connection.release();cov_1kbb7fz0lp().s[135]++;sendResponse(res,true,null,'审核拒绝成功');}catch(error){cov_1kbb7fz0lp().s[136]++;console.error('审核拒绝失败:',error.message);cov_1kbb7fz0lp().s[137]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[138]++;sendResponse(res,false,null,'审核拒绝失败');}});// 获取供应商列表API已删除 +// 供应商审核通过API已删除 +// 供应商审核拒绝API已删除 +// 供应商开始合作API已删除 +// 供应商终止合作API已删除 +cov_1kbb7fz0lp().s[139]++;console.log('正在注册测试API路由: /api/test-db');// 测试数据库连接API +cov_1kbb7fz0lp().s[140]++;app.get('/api/test-db',async(req,res)=>{cov_1kbb7fz0lp().f[11]++;cov_1kbb7fz0lp().s[141]++;console.log('收到数据库连接测试请求');cov_1kbb7fz0lp().s[142]++;try{const connection=(cov_1kbb7fz0lp().s[143]++,await pool.getConnection());const[results]=(cov_1kbb7fz0lp().s[144]++,await connection.query('SELECT 1 + 1 as solution'));cov_1kbb7fz0lp().s[145]++;connection.release();cov_1kbb7fz0lp().s[146]++;sendResponse(res,true,results[0],'数据库连接成功');}catch(error){cov_1kbb7fz0lp().s[147]++;console.error('数据库连接测试失败:',error.message);cov_1kbb7fz0lp().s[148]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[149]++;sendResponse(res,false,null,'数据库连接测试失败');}});// 获取联系人数据API +cov_1kbb7fz0lp().s[150]++;app.get('/api/contacts',async(req,res)=>{cov_1kbb7fz0lp().f[12]++;cov_1kbb7fz0lp().s[151]++;try{// 从userlogin数据库获取销售员信息 +const userLoginConnection=(cov_1kbb7fz0lp().s[152]++,await userLoginPool.getConnection());const[salesPersons]=(cov_1kbb7fz0lp().s[153]++,await userLoginConnection.query('SELECT DISTINCT projectName, userName FROM login WHERE projectName = "销售员"'));cov_1kbb7fz0lp().s[154]++;userLoginConnection.release();cov_1kbb7fz0lp().s[155]++;if(salesPersons.length===0){cov_1kbb7fz0lp().b[32][0]++;cov_1kbb7fz0lp().s[156]++;sendResponse(res,true,[],'没有找到销售员信息');cov_1kbb7fz0lp().s[157]++;return;}else{cov_1kbb7fz0lp().b[32][1]++;}// 从wechat_app数据库获取用户电话号码 +const connection=(cov_1kbb7fz0lp().s[158]++,await pool.getConnection());// 创建用户名数组用于批量查询 +const userNames=(cov_1kbb7fz0lp().s[159]++,salesPersons.map(person=>{cov_1kbb7fz0lp().f[13]++;cov_1kbb7fz0lp().s[160]++;return person.userName;}));// 使用IN语句批量查询用户信息,提高效率 +const[userResults]=(cov_1kbb7fz0lp().s[161]++,await connection.query('SELECT nickName, company, phoneNumber FROM users WHERE nickName IN (?) OR company IN (?)',[userNames,userNames]));cov_1kbb7fz0lp().s[162]++;connection.release();// 创建联系人数据数组 +const contacts=(cov_1kbb7fz0lp().s[163]++,[]);const processedUsers=(cov_1kbb7fz0lp().s[164]++,new Set());// 用于避免重复记录 +// 遍历销售员列表 +cov_1kbb7fz0lp().s[165]++;for(const salesPerson of salesPersons){const{userName}=(cov_1kbb7fz0lp().s[166]++,salesPerson);// 查找匹配的用户 +const matchedUsers=(cov_1kbb7fz0lp().s[167]++,userResults.filter(user=>{cov_1kbb7fz0lp().f[14]++;cov_1kbb7fz0lp().s[168]++;return(cov_1kbb7fz0lp().b[33][0]++,user.nickName===userName)||(cov_1kbb7fz0lp().b[33][1]++,user.company===userName);}));cov_1kbb7fz0lp().s[169]++;if(matchedUsers.length>0){cov_1kbb7fz0lp().b[34][0]++;cov_1kbb7fz0lp().s[170]++;for(const user of matchedUsers){cov_1kbb7fz0lp().s[171]++;// 只添加有电话号码的联系人,并且避免重复 +if((cov_1kbb7fz0lp().b[36][0]++,user.phoneNumber)&&(cov_1kbb7fz0lp().b[36][1]++,user.phoneNumber.trim()!=='')){cov_1kbb7fz0lp().b[35][0]++;const userKey=(cov_1kbb7fz0lp().s[172]++,`${userName}-${user.phoneNumber}`);cov_1kbb7fz0lp().s[173]++;if(!processedUsers.has(userKey)){cov_1kbb7fz0lp().b[37][0]++;cov_1kbb7fz0lp().s[174]++;processedUsers.add(userKey);cov_1kbb7fz0lp().s[175]++;contacts.push({id:contacts.length+1,salesPerson:salesPerson.projectName,name:userName,phoneNumber:user.phoneNumber});}else{cov_1kbb7fz0lp().b[37][1]++;}}else{cov_1kbb7fz0lp().b[35][1]++;}}}else{cov_1kbb7fz0lp().b[34][1]++;}// 如果没有找到匹配的用户或匹配的用户没有电话号码,跳过此销售员 +}cov_1kbb7fz0lp().s[176]++;sendResponse(res,true,contacts,'联系人数据获取成功');}catch(error){cov_1kbb7fz0lp().s[177]++;console.error('获取联系人数据失败:',error.message);cov_1kbb7fz0lp().s[178]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[179]++;sendResponse(res,false,null,'获取联系人数据失败');}});// 更新产品联系人API +cov_1kbb7fz0lp().s[180]++;app.put('/api/supplies/:id/contact',async(req,res)=>{cov_1kbb7fz0lp().f[15]++;cov_1kbb7fz0lp().s[181]++;try{const{id}=(cov_1kbb7fz0lp().s[182]++,req.params);const{productContact,contactPhone}=(cov_1kbb7fz0lp().s[183]++,req.body);// 移除"联系人"前缀和"销售员 - "前缀 +const processedProductContact=(cov_1kbb7fz0lp().s[184]++,productContact.replace(/^(联系人|销售员\s*-\s*)/g,'').trim());const connection=(cov_1kbb7fz0lp().s[185]++,await pool.getConnection());// 更新产品的联系人信息 +const[result]=(cov_1kbb7fz0lp().s[186]++,await connection.query('UPDATE products SET product_contact = ?, contact_phone = ? WHERE id = ?',[processedProductContact,contactPhone,id]));cov_1kbb7fz0lp().s[187]++;connection.release();cov_1kbb7fz0lp().s[188]++;if(result.affectedRows===0){cov_1kbb7fz0lp().b[38][0]++;cov_1kbb7fz0lp().s[189]++;sendResponse(res,false,null,'未找到指定的产品');cov_1kbb7fz0lp().s[190]++;return;}else{cov_1kbb7fz0lp().b[38][1]++;}cov_1kbb7fz0lp().s[191]++;sendResponse(res,true,null,'产品联系人信息更新成功');}catch(error){cov_1kbb7fz0lp().s[192]++;console.error('更新产品联系人信息失败:',error.message);cov_1kbb7fz0lp().s[193]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[194]++;sendResponse(res,false,null,'更新产品联系人信息失败');}});// 供应商审核通过API - /api/suppliers/:id/approve +cov_1kbb7fz0lp().s[195]++;console.log('正在注册供应商审核通过API路由: /api/suppliers/:id/approve');cov_1kbb7fz0lp().s[196]++;app.post('/api/suppliers/:id/approve',async(req,res)=>{cov_1kbb7fz0lp().f[16]++;cov_1kbb7fz0lp().s[197]++;console.log('收到供应商审核通过请求:',req.params);cov_1kbb7fz0lp().s[198]++;try{const connection=(cov_1kbb7fz0lp().s[199]++,await pool.getConnection());const userId=(cov_1kbb7fz0lp().s[200]++,req.params.id);cov_1kbb7fz0lp().s[201]++;if(!userId){cov_1kbb7fz0lp().b[39][0]++;cov_1kbb7fz0lp().s[202]++;connection.release();cov_1kbb7fz0lp().s[203]++;return sendResponse(res,false,null,'用户ID不能为空');}else{cov_1kbb7fz0lp().b[39][1]++;}// 开始事务 +cov_1kbb7fz0lp().s[204]++;await connection.beginTransaction();// 检查当前状态 +const[currentUser]=(cov_1kbb7fz0lp().s[205]++,await connection.query('SELECT partnerstatus FROM users WHERE userId = ?',[userId]));cov_1kbb7fz0lp().s[206]++;if(currentUser.length===0){cov_1kbb7fz0lp().b[40][0]++;cov_1kbb7fz0lp().s[207]++;await connection.rollback();cov_1kbb7fz0lp().s[208]++;connection.release();cov_1kbb7fz0lp().s[209]++;return sendResponse(res,false,null,'供应商不存在');}else{cov_1kbb7fz0lp().b[40][1]++;}cov_1kbb7fz0lp().s[210]++;if(currentUser[0].partnerstatus!=='underreview'){cov_1kbb7fz0lp().b[41][0]++;cov_1kbb7fz0lp().s[211]++;await connection.rollback();cov_1kbb7fz0lp().s[212]++;connection.release();cov_1kbb7fz0lp().s[213]++;return sendResponse(res,false,null,'当前状态不允许审核通过');}else{cov_1kbb7fz0lp().b[41][1]++;}// 更新状态和审核时间 +cov_1kbb7fz0lp().s[214]++;await connection.query('UPDATE users SET partnerstatus = ?, audit_time = ? WHERE userId = ?',['approved',new Date(),userId]);// 提交事务 +cov_1kbb7fz0lp().s[215]++;await connection.commit();cov_1kbb7fz0lp().s[216]++;connection.release();cov_1kbb7fz0lp().s[217]++;sendResponse(res,true,null,'供应商审核通过成功');}catch(error){cov_1kbb7fz0lp().s[218]++;console.error('供应商审核通过失败:',error.message);cov_1kbb7fz0lp().s[219]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[220]++;sendResponse(res,false,null,'供应商审核通过失败');}});// 供应商审核拒绝API - /api/suppliers/:id/reject +cov_1kbb7fz0lp().s[221]++;console.log('正在注册供应商审核拒绝API路由: /api/suppliers/:id/reject');cov_1kbb7fz0lp().s[222]++;app.post('/api/suppliers/:id/reject',async(req,res)=>{cov_1kbb7fz0lp().f[17]++;cov_1kbb7fz0lp().s[223]++;console.log('收到供应商审核拒绝请求:',req.params,req.body);cov_1kbb7fz0lp().s[224]++;try{const connection=(cov_1kbb7fz0lp().s[225]++,await pool.getConnection());const userId=(cov_1kbb7fz0lp().s[226]++,req.params.id);const{rejectReason}=(cov_1kbb7fz0lp().s[227]++,req.body);cov_1kbb7fz0lp().s[228]++;if(!userId){cov_1kbb7fz0lp().b[42][0]++;cov_1kbb7fz0lp().s[229]++;connection.release();cov_1kbb7fz0lp().s[230]++;return sendResponse(res,false,null,'用户ID不能为空');}else{cov_1kbb7fz0lp().b[42][1]++;}cov_1kbb7fz0lp().s[231]++;if(!rejectReason){cov_1kbb7fz0lp().b[43][0]++;cov_1kbb7fz0lp().s[232]++;connection.release();cov_1kbb7fz0lp().s[233]++;return sendResponse(res,false,null,'审核失败原因不能为空');}else{cov_1kbb7fz0lp().b[43][1]++;}// 开始事务 +cov_1kbb7fz0lp().s[234]++;await connection.beginTransaction();// 检查当前状态 +const[currentUser]=(cov_1kbb7fz0lp().s[235]++,await connection.query('SELECT partnerstatus FROM users WHERE userId = ?',[userId]));cov_1kbb7fz0lp().s[236]++;if(currentUser.length===0){cov_1kbb7fz0lp().b[44][0]++;cov_1kbb7fz0lp().s[237]++;await connection.rollback();cov_1kbb7fz0lp().s[238]++;connection.release();cov_1kbb7fz0lp().s[239]++;return sendResponse(res,false,null,'供应商不存在');}else{cov_1kbb7fz0lp().b[44][1]++;}cov_1kbb7fz0lp().s[240]++;if(currentUser[0].partnerstatus!=='underreview'){cov_1kbb7fz0lp().b[45][0]++;cov_1kbb7fz0lp().s[241]++;await connection.rollback();cov_1kbb7fz0lp().s[242]++;connection.release();cov_1kbb7fz0lp().s[243]++;return sendResponse(res,false,null,'当前状态不允许审核拒绝');}else{cov_1kbb7fz0lp().b[45][1]++;}// 更新状态、审核失败原因和审核时间 +cov_1kbb7fz0lp().s[244]++;await connection.query('UPDATE users SET partnerstatus = ?, reasonforfailure = ?, audit_time = ? WHERE userId = ?',['reviewfailed',rejectReason,new Date(),userId]);// 提交事务 +cov_1kbb7fz0lp().s[245]++;await connection.commit();cov_1kbb7fz0lp().s[246]++;connection.release();cov_1kbb7fz0lp().s[247]++;sendResponse(res,true,null,'供应商审核拒绝成功');}catch(error){cov_1kbb7fz0lp().s[248]++;console.error('供应商审核拒绝失败:',error.message);cov_1kbb7fz0lp().s[249]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[250]++;sendResponse(res,false,null,'供应商审核拒绝失败');}});// 供应商开始合作API - /api/suppliers/:id/cooperate +cov_1kbb7fz0lp().s[251]++;console.log('正在注册供应商开始合作API路由: /api/suppliers/:id/cooperate');cov_1kbb7fz0lp().s[252]++;app.post('/api/suppliers/:id/cooperate',async(req,res)=>{cov_1kbb7fz0lp().f[18]++;cov_1kbb7fz0lp().s[253]++;console.log('收到供应商开始合作请求:',req.params);cov_1kbb7fz0lp().s[254]++;try{const connection=(cov_1kbb7fz0lp().s[255]++,await pool.getConnection());const userId=(cov_1kbb7fz0lp().s[256]++,req.params.id);cov_1kbb7fz0lp().s[257]++;if(!userId){cov_1kbb7fz0lp().b[46][0]++;cov_1kbb7fz0lp().s[258]++;connection.release();cov_1kbb7fz0lp().s[259]++;return sendResponse(res,false,null,'用户ID不能为空');}else{cov_1kbb7fz0lp().b[46][1]++;}// 开始事务 +cov_1kbb7fz0lp().s[260]++;await connection.beginTransaction();// 检查当前状态 +const[currentUser]=(cov_1kbb7fz0lp().s[261]++,await connection.query('SELECT partnerstatus FROM users WHERE userId = ?',[userId]));cov_1kbb7fz0lp().s[262]++;if(currentUser.length===0){cov_1kbb7fz0lp().b[47][0]++;cov_1kbb7fz0lp().s[263]++;await connection.rollback();cov_1kbb7fz0lp().s[264]++;connection.release();cov_1kbb7fz0lp().s[265]++;return sendResponse(res,false,null,'供应商不存在');}else{cov_1kbb7fz0lp().b[47][1]++;}cov_1kbb7fz0lp().s[266]++;if(currentUser[0].partnerstatus!=='approved'){cov_1kbb7fz0lp().b[48][0]++;cov_1kbb7fz0lp().s[267]++;await connection.rollback();cov_1kbb7fz0lp().s[268]++;connection.release();cov_1kbb7fz0lp().s[269]++;return sendResponse(res,false,null,'只有审核通过的供应商才能开始合作');}else{cov_1kbb7fz0lp().b[48][1]++;}// 更新状态 +cov_1kbb7fz0lp().s[270]++;await connection.query('UPDATE users SET partnerstatus = ? WHERE userId = ?',['incooperation',userId]);// 提交事务 +cov_1kbb7fz0lp().s[271]++;await connection.commit();cov_1kbb7fz0lp().s[272]++;connection.release();cov_1kbb7fz0lp().s[273]++;sendResponse(res,true,null,'供应商开始合作成功');}catch(error){cov_1kbb7fz0lp().s[274]++;console.error('供应商开始合作失败:',error.message);cov_1kbb7fz0lp().s[275]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[276]++;sendResponse(res,false,null,'供应商开始合作失败');}});// 供应商终止合作API - /api/suppliers/:id/terminate +cov_1kbb7fz0lp().s[277]++;console.log('正在注册供应商终止合作API路由: /api/suppliers/:id/terminate');cov_1kbb7fz0lp().s[278]++;app.post('/api/suppliers/:id/terminate',async(req,res)=>{cov_1kbb7fz0lp().f[19]++;cov_1kbb7fz0lp().s[279]++;console.log('收到供应商终止合作请求:',req.params,req.body);cov_1kbb7fz0lp().s[280]++;try{const connection=(cov_1kbb7fz0lp().s[281]++,await pool.getConnection());const userId=(cov_1kbb7fz0lp().s[282]++,req.params.id);const{reason}=(cov_1kbb7fz0lp().s[283]++,req.body);cov_1kbb7fz0lp().s[284]++;if(!userId){cov_1kbb7fz0lp().b[49][0]++;cov_1kbb7fz0lp().s[285]++;connection.release();cov_1kbb7fz0lp().s[286]++;return sendResponse(res,false,null,'用户ID不能为空');}else{cov_1kbb7fz0lp().b[49][1]++;}// 开始事务 +cov_1kbb7fz0lp().s[287]++;await connection.beginTransaction();// 检查当前状态 +const[currentUser]=(cov_1kbb7fz0lp().s[288]++,await connection.query('SELECT partnerstatus FROM users WHERE userId = ?',[userId]));cov_1kbb7fz0lp().s[289]++;if(currentUser.length===0){cov_1kbb7fz0lp().b[50][0]++;cov_1kbb7fz0lp().s[290]++;await connection.rollback();cov_1kbb7fz0lp().s[291]++;connection.release();cov_1kbb7fz0lp().s[292]++;return sendResponse(res,false,null,'供应商不存在');}else{cov_1kbb7fz0lp().b[50][1]++;}cov_1kbb7fz0lp().s[293]++;if((cov_1kbb7fz0lp().b[52][0]++,currentUser[0].partnerstatus!=='approved')&&(cov_1kbb7fz0lp().b[52][1]++,currentUser[0].partnerstatus!=='incooperation')){cov_1kbb7fz0lp().b[51][0]++;cov_1kbb7fz0lp().s[294]++;await connection.rollback();cov_1kbb7fz0lp().s[295]++;connection.release();cov_1kbb7fz0lp().s[296]++;return sendResponse(res,false,null,'只有审核通过或合作中的供应商才能终止合作');}else{cov_1kbb7fz0lp().b[51][1]++;}// 更新状态和终止原因 +cov_1kbb7fz0lp().s[297]++;await connection.query('UPDATE users SET partnerstatus = ?, terminate_reason = ? WHERE userId = ?',['notcooperative',reason,userId]);// 提交事务 +cov_1kbb7fz0lp().s[298]++;await connection.commit();cov_1kbb7fz0lp().s[299]++;connection.release();cov_1kbb7fz0lp().s[300]++;sendResponse(res,true,null,'供应商终止合作成功');}catch(error){cov_1kbb7fz0lp().s[301]++;console.error('供应商终止合作失败:',error.message);cov_1kbb7fz0lp().s[302]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[303]++;sendResponse(res,false,null,'供应商终止合作失败');}});// 供应商列表查询API - /api/suppliers +cov_1kbb7fz0lp().s[304]++;console.log('正在注册供应商列表查询API路由: /api/suppliers');cov_1kbb7fz0lp().s[305]++;app.get('/api/suppliers',async(req,res)=>{cov_1kbb7fz0lp().f[20]++;cov_1kbb7fz0lp().s[306]++;console.log('收到供应商列表查询请求:',req.query);cov_1kbb7fz0lp().s[307]++;try{const connection=(cov_1kbb7fz0lp().s[308]++,await pool.getConnection());const{page=(cov_1kbb7fz0lp().b[53][0]++,1),pageSize=(cov_1kbb7fz0lp().b[54][0]++,10),status=(cov_1kbb7fz0lp().b[55][0]++,''),keyword=(cov_1kbb7fz0lp().b[56][0]++,'')}=(cov_1kbb7fz0lp().s[309]++,req.query);// 构建查询条件 +let whereClause=(cov_1kbb7fz0lp().s[310]++,'');let params=(cov_1kbb7fz0lp().s[311]++,[]);// 添加状态筛选 +cov_1kbb7fz0lp().s[312]++;if(status){cov_1kbb7fz0lp().b[57][0]++;cov_1kbb7fz0lp().s[313]++;whereClause+=` WHERE partnerstatus = ?`;cov_1kbb7fz0lp().s[314]++;params.push(status);}else{cov_1kbb7fz0lp().b[57][1]++;}// 添加关键词搜索 +cov_1kbb7fz0lp().s[315]++;if(keyword){cov_1kbb7fz0lp().b[58][0]++;cov_1kbb7fz0lp().s[316]++;whereClause+=status?(cov_1kbb7fz0lp().b[59][0]++,' AND'):(cov_1kbb7fz0lp().b[59][1]++,' WHERE');cov_1kbb7fz0lp().s[317]++;whereClause+=` (username LIKE ? OR company LIKE ? OR phoneNumber LIKE ?)`;cov_1kbb7fz0lp().s[318]++;params.push(`%${keyword}%`,`%${keyword}%`,`%${keyword}%`);}else{cov_1kbb7fz0lp().b[58][1]++;}// 获取总数 +const[totalResult]=(cov_1kbb7fz0lp().s[319]++,await connection.query(`SELECT COUNT(*) as total FROM users${whereClause}`,params));const total=(cov_1kbb7fz0lp().s[320]++,totalResult[0].total);// 计算分页 +const offset=(cov_1kbb7fz0lp().s[321]++,(page-1)*pageSize);cov_1kbb7fz0lp().s[322]++;params.push(parseInt(pageSize),offset);// 查询供应商列表 +const[suppliers]=(cov_1kbb7fz0lp().s[323]++,await connection.query(`SELECT userId, phoneNumber, province, city, district, detailedaddress, company, collaborationid, cooperation, businesslicenseurl, proofurl, brandurl, partnerstatus, reasonforfailure, reject_reason, terminate_reason, audit_time + FROM users${whereClause} + ORDER BY audit_time DESC LIMIT ? OFFSET ?`,params));cov_1kbb7fz0lp().s[324]++;connection.release();cov_1kbb7fz0lp().s[325]++;sendResponse(res,true,{list:suppliers,total,page:parseInt(page),pageSize:parseInt(pageSize)},'查询成功');}catch(error){cov_1kbb7fz0lp().s[326]++;console.error('供应商列表查询失败:',error.message);cov_1kbb7fz0lp().s[327]++;console.error('错误详情:',error);cov_1kbb7fz0lp().s[328]++;sendResponse(res,false,null,'供应商列表查询失败');}});// 首页路由 +cov_1kbb7fz0lp().s[329]++;app.get('/',(req,res)=>{cov_1kbb7fz0lp().f[21]++;cov_1kbb7fz0lp().s[330]++;res.sendFile(path.join(__dirname,'Reject.html'));});// 错误处理中间件 +cov_1kbb7fz0lp().s[331]++;app.use((err,req,res,next)=>{cov_1kbb7fz0lp().f[22]++;cov_1kbb7fz0lp().s[332]++;console.error('服务器错误:',err.message);cov_1kbb7fz0lp().s[333]++;console.error('错误详情:',err);cov_1kbb7fz0lp().s[334]++;res.status(500).json({success:false,message:'服务器内部错误'});});// 启动服务器 +async function startServer(){cov_1kbb7fz0lp().f[23]++;cov_1kbb7fz0lp().s[335]++;try{cov_1kbb7fz0lp().s[336]++;await initDatabase();cov_1kbb7fz0lp().s[337]++;app.listen(PORT,()=>{cov_1kbb7fz0lp().f[24]++;cov_1kbb7fz0lp().s[338]++;console.log(`服务器已启动,监听端口 ${PORT}`);cov_1kbb7fz0lp().s[339]++;console.log(`访问地址: http://localhost:${PORT}`);});}catch(error){cov_1kbb7fz0lp().s[340]++;console.error('服务器启动失败:',error.message);cov_1kbb7fz0lp().s[341]++;console.error('错误详情:',error);// 如果启动失败,尝试重新启动 +cov_1kbb7fz0lp().s[342]++;setTimeout(()=>{cov_1kbb7fz0lp().f[25]++;cov_1kbb7fz0lp().s[343]++;console.log('尝试重新启动服务器...');cov_1kbb7fz0lp().s[344]++;startServer();},5000);}}// 确保数据库结构 +async function ensureDatabaseSchema(){cov_1kbb7fz0lp().f[26]++;cov_1kbb7fz0lp().s[345]++;console.log('开始执行数据库结构检查...');cov_1kbb7fz0lp().s[346]++;try{const connection=(cov_1kbb7fz0lp().s[347]++,await pool.getConnection());cov_1kbb7fz0lp().s[348]++;console.log('获取数据库连接成功');// 检查users表是否有必要的字段 +cov_1kbb7fz0lp().s[349]++;console.log('检查users表是否有partnerstatus字段...');const[partnerStatusColumns]=(cov_1kbb7fz0lp().s[350]++,await connection.query('SHOW COLUMNS FROM `users` LIKE ?',['partnerstatus']));cov_1kbb7fz0lp().s[351]++;console.log('检查表字段结果:',partnerStatusColumns.length>0?(cov_1kbb7fz0lp().b[60][0]++,'已存在'):(cov_1kbb7fz0lp().b[60][1]++,'不存在'));cov_1kbb7fz0lp().s[352]++;if(partnerStatusColumns.length===0){cov_1kbb7fz0lp().b[61][0]++;cov_1kbb7fz0lp().s[353]++;console.log('添加partnerstatus字段到users表...');cov_1kbb7fz0lp().s[354]++;await connection.query('ALTER TABLE `users` ADD COLUMN partnerstatus VARCHAR(50) DEFAULT "underreview" COMMENT "合作商状态"');cov_1kbb7fz0lp().s[355]++;console.log('partnerstatus字段添加成功');}else{cov_1kbb7fz0lp().b[61][1]++;}cov_1kbb7fz0lp().s[356]++;console.log('检查users表是否有reject_reason字段...');const[rejectReasonColumns]=(cov_1kbb7fz0lp().s[357]++,await connection.query('SHOW COLUMNS FROM `users` LIKE ?',['reject_reason']));cov_1kbb7fz0lp().s[358]++;console.log('检查表字段结果:',rejectReasonColumns.length>0?(cov_1kbb7fz0lp().b[62][0]++,'已存在'):(cov_1kbb7fz0lp().b[62][1]++,'不存在'));cov_1kbb7fz0lp().s[359]++;if(rejectReasonColumns.length===0){cov_1kbb7fz0lp().b[63][0]++;cov_1kbb7fz0lp().s[360]++;console.log('添加reject_reason字段到users表...');cov_1kbb7fz0lp().s[361]++;await connection.query('ALTER TABLE `users` ADD COLUMN reject_reason TEXT COMMENT "拒绝理由"');cov_1kbb7fz0lp().s[362]++;console.log('reject_reason字段添加成功');}else{cov_1kbb7fz0lp().b[63][1]++;}cov_1kbb7fz0lp().s[363]++;console.log('检查users表是否有terminate_reason字段...');const[terminateReasonColumns]=(cov_1kbb7fz0lp().s[364]++,await connection.query('SHOW COLUMNS FROM `users` LIKE ?',['terminate_reason']));cov_1kbb7fz0lp().s[365]++;console.log('检查表字段结果:',terminateReasonColumns.length>0?(cov_1kbb7fz0lp().b[64][0]++,'已存在'):(cov_1kbb7fz0lp().b[64][1]++,'不存在'));cov_1kbb7fz0lp().s[366]++;if(terminateReasonColumns.length===0){cov_1kbb7fz0lp().b[65][0]++;cov_1kbb7fz0lp().s[367]++;console.log('添加terminate_reason字段到users表...');cov_1kbb7fz0lp().s[368]++;await connection.query('ALTER TABLE `users` ADD COLUMN terminate_reason TEXT COMMENT "终止合作理由"');cov_1kbb7fz0lp().s[369]++;console.log('terminate_reason字段添加成功');}else{cov_1kbb7fz0lp().b[65][1]++;}cov_1kbb7fz0lp().s[370]++;console.log('检查users表是否有audit_time字段...');const[userAuditTimeColumns]=(cov_1kbb7fz0lp().s[371]++,await connection.query('SHOW COLUMNS FROM `users` LIKE ?',['audit_time']));cov_1kbb7fz0lp().s[372]++;console.log('检查表字段结果:',userAuditTimeColumns.length>0?(cov_1kbb7fz0lp().b[66][0]++,'已存在'):(cov_1kbb7fz0lp().b[66][1]++,'不存在'));cov_1kbb7fz0lp().s[373]++;if(userAuditTimeColumns.length===0){cov_1kbb7fz0lp().b[67][0]++;cov_1kbb7fz0lp().s[374]++;console.log('添加audit_time字段到users表...');cov_1kbb7fz0lp().s[375]++;await connection.query('ALTER TABLE `users` ADD COLUMN audit_time DATETIME COMMENT "审核时间"');cov_1kbb7fz0lp().s[376]++;console.log('audit_time字段添加成功');}else{cov_1kbb7fz0lp().b[67][1]++;}// 检查表是否有rejectReason字段 +cov_1kbb7fz0lp().s[377]++;console.log('检查表products是否有rejectReason字段...');const[columns]=(cov_1kbb7fz0lp().s[378]++,await connection.query('SHOW COLUMNS FROM `products` LIKE ?',['rejectReason']));cov_1kbb7fz0lp().s[379]++;console.log('检查表字段结果:',columns.length>0?(cov_1kbb7fz0lp().b[68][0]++,'已存在'):(cov_1kbb7fz0lp().b[68][1]++,'不存在'));cov_1kbb7fz0lp().s[380]++;if(columns.length===0){cov_1kbb7fz0lp().b[69][0]++;cov_1kbb7fz0lp().s[381]++;console.log('添加rejectReason字段到products表...');cov_1kbb7fz0lp().s[382]++;await connection.query('ALTER TABLE `products` ADD COLUMN rejectReason TEXT COMMENT "拒绝理由"');cov_1kbb7fz0lp().s[383]++;console.log('rejectReason字段添加成功');}else{cov_1kbb7fz0lp().b[69][1]++;}// 检查表是否有audit_time字段 +cov_1kbb7fz0lp().s[384]++;console.log('检查表products是否有audit_time字段...');const[auditTimeColumns]=(cov_1kbb7fz0lp().s[385]++,await connection.query('SHOW COLUMNS FROM `products` LIKE ?',['audit_time']));cov_1kbb7fz0lp().s[386]++;console.log('检查表字段结果:',auditTimeColumns.length>0?(cov_1kbb7fz0lp().b[70][0]++,'已存在'):(cov_1kbb7fz0lp().b[70][1]++,'不存在'));cov_1kbb7fz0lp().s[387]++;if(auditTimeColumns.length===0){cov_1kbb7fz0lp().b[71][0]++;cov_1kbb7fz0lp().s[388]++;console.log('添加audit_time字段到products表...');cov_1kbb7fz0lp().s[389]++;await connection.query('ALTER TABLE `products` ADD COLUMN audit_time DATETIME COMMENT "审核时间"');cov_1kbb7fz0lp().s[390]++;console.log('audit_time字段添加成功');}else{cov_1kbb7fz0lp().b[71][1]++;}// 检查audit_logs表是否存在,如果不存在则创建 +cov_1kbb7fz0lp().s[391]++;console.log('检查audit_logs表是否存在...');const[tables]=(cov_1kbb7fz0lp().s[392]++,await connection.query("SHOW TABLES LIKE 'audit_logs'"));cov_1kbb7fz0lp().s[393]++;console.log('检查表存在性结果:',tables.length>0?(cov_1kbb7fz0lp().b[72][0]++,'已存在'):(cov_1kbb7fz0lp().b[72][1]++,'不存在'));cov_1kbb7fz0lp().s[394]++;if(tables.length===0){cov_1kbb7fz0lp().b[73][0]++;cov_1kbb7fz0lp().s[395]++;console.log('创建audit_logs表...');cov_1kbb7fz0lp().s[396]++;await connection.query(` + CREATE TABLE audit_logs ( + id INT AUTO_INCREMENT PRIMARY KEY, + supply_id VARCHAR(50) NOT NULL, + action VARCHAR(20) NOT NULL COMMENT 'approve或reject', + user_id VARCHAR(50) NOT NULL COMMENT '操作人ID', + remark TEXT COMMENT '备注信息', + created_at DATETIME NOT NULL, + INDEX idx_supply_id (supply_id), + INDEX idx_created_at (created_at) + ) COMMENT '审核操作日志表' + `);cov_1kbb7fz0lp().s[397]++;console.log('audit_logs表创建成功');}else{cov_1kbb7fz0lp().b[73][1]++;}cov_1kbb7fz0lp().s[398]++;connection.release();cov_1kbb7fz0lp().s[399]++;console.log('数据库结构检查完成');}catch(error){cov_1kbb7fz0lp().s[400]++;console.error('数据库结构检查失败:',error.message);cov_1kbb7fz0lp().s[401]++;console.error('错误详情:',error);}}// 启动服务器 +cov_1kbb7fz0lp().s[402]++;startServer();// 优雅关闭 +cov_1kbb7fz0lp().s[403]++;process.on('SIGINT',async()=>{cov_1kbb7fz0lp().f[27]++;cov_1kbb7fz0lp().s[404]++;console.log('正在关闭服务器...');cov_1kbb7fz0lp().s[405]++;if(pool){cov_1kbb7fz0lp().b[74][0]++;cov_1kbb7fz0lp().s[406]++;try{cov_1kbb7fz0lp().s[407]++;await pool.end();cov_1kbb7fz0lp().s[408]++;console.log('数据库连接池已关闭');}catch(error){cov_1kbb7fz0lp().s[409]++;console.error('关闭数据库连接池失败:',error.message);}}else{cov_1kbb7fz0lp().b[74][1]++;}cov_1kbb7fz0lp().s[410]++;console.log('服务器已关闭');cov_1kbb7fz0lp().s[411]++;process.exit(0);});cov_1kbb7fz0lp().s[412]++;module.exports=app; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJjb3ZfMWtiYjdmejBscCIsImFjdHVhbENvdmVyYWdlIiwiZXhwcmVzcyIsInMiLCJyZXF1aXJlIiwiYm9keVBhcnNlciIsImNvcnMiLCJteXNxbCIsInBhdGgiLCJhcHAiLCJQT1JUIiwiYiIsInByb2Nlc3MiLCJlbnYiLCJ1c2UiLCJyZXEiLCJyZXMiLCJuZXh0IiwiZiIsImhlYWRlciIsIm1ldGhvZCIsIn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mVDbGF1c2V9IE9SREVSIEJZIHAuaWQgREVTQyBMSU1JVCA/IE9GRlNFVCA/YCxcbiAgICAgICAgICAgIFsuLi5wYXJhbXMsIHBhcnNlSW50KHBhZ2VTaXplKSwgb2Zmc2V0XVxuICAgICAgICApO1xuICAgICAgICBcbiAgICAgICAgLy8g6I635Y+W5oC75pWwXG4gICAgICAgIGNvbnN0IFtjb3VudFJlc3VsdHNdID0gYXdhaXQgY29ubmVjdGlvbi5xdWVyeShcbiAgICAgICAgICAgIGAke2NvdW50UXVlcnl9JHt3aGVyZUNsYXVzZX1gLFxuICAgICAgICAgICAgcGFyYW1zXG4gICAgICAgICk7XG4gICAgICAgIFxuICAgICAgICBjb25uZWN0aW9uLnJlbGVhc2UoKTtcbiAgICAgICAgXG4gICAgICAgIC8vIOWkhOeQhui/lOWbnue7k+aenOS4reeahGltYWdlVXJsc+Wtl+autVxuICAgICAgICBjb25zdCBwcm9jZXNzZWRSZXN1bHRzID0gcmVzdWx0cy5tYXAocHJvZHVjdCA9PiB7XG4gICAgICAgICAgICAvLyDlpITnkIZpbWFnZVVybHPlrZfmrrVcbiAgICAgICAgICAgIGxldCBpbWFnZVVybHMgPSBbXTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgaWYgKHByb2R1Y3QuaW1hZ2VVcmxzKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcm9kdWN0LmltYWdlVXJscyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8g5bCd6K+V6Kej5p6Q5Li6SlNPTuaVsOe7hFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnNlZEltYWdlcyA9IEpTT04ucGFyc2UocHJvZHVjdC5pbWFnZVVybHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyDmo4Dmn6XmmK/lkKbmmK9KU09O5a2X56ym5Liy55qE5a2X56ym5Liy6KGo56S677yI6L2s5LmJ55qESlNPTu+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYXJzZWRJbWFnZXMgPT09ICdzdHJpbmcnICYmIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwYXJzZWRJbWFnZXMuc3RhcnRzV2l0aCgnWycpIHx8IHBhcnNlZEltYWdlcy5zdGFydHNXaXRoKCd7JykpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g6L+b6KGM56ys5LqM5qyh6Kej5p6QXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VkSW1hZ2VzID0gSlNPTi5wYXJzZShwYXJzZWRJbWFnZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShwYXJzZWRJbWFnZXMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2VVcmxzID0gcGFyc2VkSW1hZ2VzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgcGFyc2VkSW1hZ2VzID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIOWmguaenOino+aekOe7k+aenOaYr+Wtl+espuS4su+8jOWPr+iDveaYr+WNleS4qlVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlVXJscyA9IFtwYXJzZWRJbWFnZXNdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyDop6PmnpDlpLHotKXvvIzlsJ3or5XmjInpgJflj7fliIbpmpRcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcm9kdWN0LmltYWdlVXJscy5pbmNsdWRlcygnLCcpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2VVcmxzID0gcHJvZHVjdC5pbWFnZVVybHMuc3BsaXQoJywnKS5tYXAodXJsID0+IHVybC50cmltKCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyDkvZzkuLrljZXkuKpVUkzlpITnkIZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZVVybHMgPSBbcHJvZHVjdC5pbWFnZVVybHMudHJpbSgpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheShwcm9kdWN0LmltYWdlVXJscykpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8g5bey57uP5piv5pWw57uE77yM55u05o6l5L2/55SoXG4gICAgICAgICAgICAgICAgICAgIGltYWdlVXJscyA9IHByb2R1Y3QuaW1hZ2VVcmxzO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIOWFtuS7luexu+Wei++8jOi9rOaNouS4uuWtl+espuS4suaVsOe7hFxuICAgICAgICAgICAgICAgICAgICBpbWFnZVVybHMgPSBbU3RyaW5nKHByb2R1Y3QuaW1hZ2VVcmxzKV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICAvLyDov4fmu6TlubblpITnkIbml6DmlYjnmoRVUkzvvJrnp7vpmaTlj43lvJXlj7flubbpqozor4FcbiAgICAgICAgICAgIGltYWdlVXJscyA9IGltYWdlVXJsc1xuICAgICAgICAgICAgICAgIC5maWx0ZXIodXJsID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcHJvY2Vzc2VkVXJsID0gdXJsLnJlcGxhY2UoL2AvZywgJycpLnRyaW0oKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByb2Nlc3NlZFVybC5zdGFydHNXaXRoKCdodHRwOi8vJykgfHwgcHJvY2Vzc2VkVXJsLnN0YXJ0c1dpdGgoJ2h0dHBzOi8vJyk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAvLyDlr7nmr4/kuKrmnInmlYhVUkzov5vooYzlpITnkIbvvIznp7vpmaTlj43lvJXlj7dcbiAgICAgICAgICAgICAgICAubWFwKHVybCA9PiB1cmwucmVwbGFjZSgvYC9nLCAnJykudHJpbSgpKTtcbiAgICAgICAgICAgIFxuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAuLi5wcm9kdWN0LFxuICAgICAgICAgICAgICAgIGltYWdlVXJsc1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSk7XG4gICAgICAgIFxuICAgICAgICAvLyDov5Tlm57nu5PmnpxcbiAgICAgICAgc2VuZFJlc3BvbnNlKHJlcywgdHJ1ZSwge1xuICAgICAgICAgICAgbGlzdDogcHJvY2Vzc2VkUmVzdWx0cyxcbiAgICAgICAgICAgIHRvdGFsOiBjb3VudFJlc3VsdHNbMF0udG90YWwsXG4gICAgICAgICAgICBwYWdlOiBwYXJzZUludChwYWdlKSxcbiAgICAgICAgICAgIHBhZ2VTaXplOiBwYXJzZUludChwYWdlU2l6ZSlcbiAgICAgICAgfSwgJ+iOt+WPlui0p+a6kOWIl+ihqOaIkOWKnycpO1xuICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgIGNvbnNvbGUuZXJyb3IoJ+iOt+WPlui0p+a6kOWIl+ihqOWksei0pTonLCBlcnJvci5tZXNzYWdlKTtcbiAgICAgICAgY29uc29sZS5lcnJvcign6ZSZ6K+v6K+m5oOFOicsIGVycm9yKTtcbiAgICAgICAgc2VuZFJlc3BvbnNlKHJlcywgZmFsc2UsIG51bGwsICfojrflj5botKfmupDliJfooajlpLHotKUnKTtcbiAgICB9XG59KTtcblxuLy8g5a6h5qC46YCa6L+HQVBJXG5hcHAucG9zdCgnL2FwaS9zdXBwbGllcy86aWQvYXBwcm92ZScsIGFzeW5jIChyZXEsIHJlcykgPT4ge1xuICAgIGNvbnNvbGUubG9nKCfmlLbliLDlrqHmoLjpgJrov4for7fmsYI6JywgcmVxLnBhcmFtcy5pZCwgcmVxLmJvZHkpO1xuICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IGNvbm5lY3Rpb24gPSBhd2FpdCBwb29sLmdldENvbm5lY3Rpb24oKTtcbiAgICAgICAgY29uc3QgeyByZW1hcmsgPSAnJyB9ID0gcmVxLmJvZHk7XG4gICAgICAgIGNvbnN0IHByb2R1Y3RJZCA9IHJlcS5wYXJhbXMuaWQ7XG4gICAgICAgIFxuICAgICAgICAvLyDlvIDlp4vkuovliqFcbiAgICAgICAgYXdhaXQgY29ubmVjdGlvbi5iZWdpblRyYW5zYWN0aW9uKCk7XG4gICAgICAgIFxuICAgICAgICAvLyDmo4Dmn6XlvZPliY3nirbmgIFcbiAgICAgICAgY29uc3QgW2N1cnJlbnRQcm9kdWN0XSA9IGF3YWl0IGNvbm5lY3Rpb24ucXVlcnkoXG4gICAgICAgICAgICAnU0VMRUNUIHN0YXR1cyBGUk9NIHByb2R1Y3RzIFdIRVJFIGlkID0gPycsXG4gICAgICAgICAgICBbcHJvZHVjdElkXVxuICAgICAgICApO1xuICAgICAgICBcbiAgICAgICAgaWYgKGN1cnJlbnRQcm9kdWN0Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgYXdhaXQgY29ubmVjdGlvbi5yb2xsYmFjaygpO1xuICAgICAgICAgICAgY29ubmVjdGlvbi5yZWxlYXNlKCk7XG4gICAgICAgICAgICByZXR1cm4gc2VuZFJlc3BvbnNlKHJlcywgZmFsc2UsIG51bGwsICfotKfmupDkuI3lrZjlnKgnKTtcbiAgICAgICAgfVxuICAgICA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7XG4gICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgY29uc29sZS5lcnJvcign5pWw5o2u5bqT6L+e5o6l5rWL6K+V5aSx6LSlOicsIGVycm9yLm1lc3NhZ2UpO1xuICAgICAgICBjb25zb2xlLmVycm9yKCfplJnor6/or6bmg4U6JywgZXJyb3IpO1xuICAgICAgICBzZW5kUmVzcG9uc2UocmVzLCBmYWxzZSwgbnVsbCwgJ+aVsOaNruW6k+i/nuaOpea1i+ivleWksei0pScpO1xuICAgIH1cbn0pO1xuXG4vLyDojrflj5bogZTns7vkurrmlbDmja5BUElcbmFwcC5nZXQoJy9hcGkvY29udGFjdHMnLCBhc3luYyAocmVxLCByZXMpID0+IHtcbiAgICB0cnkge1xuICAgICAgICAvLyDku451c2VybG9naW7mlbDmja7lupPojrflj5bplIDllK7lkZjkv6Hmga9cbiAgICAgICAgY29uc3QgdXNlckxvZ2luQ29ubmVjdGlvbiA9IGF3YWl0IHVzZXJMb2dpblBvb2wuZ2V0Q29ubmVjdGlvbigpO1xuICAgICAgICBjb25zdCBbc2FsZXNQZXJzb25zXSA9IGF3YWl0IHVzZXJMb2dpbkNvbm5lY3Rpb24ucXVlcnkoXG4gICAgICAgICAgICAnU0VMRUNUIERJU1RJTkNUIHByb2plY3ROYW1lLCB1c2VyTmFtZSBGUk9NIGxvZ2luIFdIRVJFIHByb2plY3ROYW1lID0gXCLplIDllK7lkZhcIidcbiAgICAgICAgKTtcbiAgICAgICAgdXNlckxvZ2luQ29ubmVjdGlvbi5yZWxlYXNlKCk7XG4gICAgICAgIFxuICAgICAgICBpZiAoc2FsZXNQZXJzb25zLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgc2VuZFJlc3BvbnNlKHJlcywgdHJ1ZSwgW10sICfmsqHmnInmib7liLDplIDllK7lkZjkv6Hmga8nKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgLy8g5LuOd2VjaGF0X2Fw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iAgICAgICAgICAgIFxuICAgICAgICAgICAgLy8g5p+l5om+5Yy56YWN55qE55So5oi3XG4gICAgICAgICAgICBjb25zdCBtYXRjaGVkVXNlcnMgPSB1c2VyUmVzdWx0cy5maWx0ZXIodXNlciA9PiBcbiAgICAgICAgICAgICAgICB1c2VyLm5pY2tOYW1lID09PSB1c2VyTmFtZSB8fCB1c2VyLmNvbXBhbnkgPT09IHVzZXJOYW1lXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBpZiAobWF0Y2hlZFVzZXJzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHVzZXIgb2YgbWF0Y2hlZFVzZXJzKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIOWPqua3u+WKoOacieeUteivneWPt+eggeeahOiBlOezu+S6uu+8jOW5tuS4lOmBv+WFjemHjeWkjVxuICAgICAgICAgICAgICAgICAgICBpZiAodXNlci5waG9uZU51bWJlciAmJiB1c2VyLnBob25lTnVtYmVyLnRyaW0oKSAhPT0gJycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVzZXJLZXkgPSBgJHt1c2VyTmFtZX0tJHt1c2VyLnBob25lTnVtYmVyfWA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXByb2Nlc3NlZFVzZXJzLmhhcyh1c2VyS2V5KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NlZFVzZXJzLmFkZCh1c2VyS2V5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250YWN0cy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGNvbnRhY3RzLmxlbmd0aCArIDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbGVzUGVyc29uOiBzYWxlc1BlcnNvbi5wcm9qZWN0TmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogdXNlck5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBob25lTnVtYmVyOiB1c2VyLnBob25lTnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyDlpoLmnpzmsqHmnInmib7liLDljLnphY3nmoTnlKjmiLfmiJbljLnphY3nmoTnlKjmiLfmsqHmnInnlLXor53lj7fnoIHvvIzot7Pov4fmraTplIDllK7lkZhcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgc2VuZFJlc3BvbnNlKHJlcywgdHJ1ZSwgY29udGFjdHMsICfogZTns7vkurrmlbDmja7ojrflj5bmiJDlip8nKTtcbiAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICBjb25zb2xlLmVycm9yKCfojrflj5bogZTns7vkurrmlbDmja7lpLHotKU6JywgZXJyb3IubWVzc2FnZSk7XG4gICAgICAgIGNvbnNvbGUuZXJyb3IoJ+mUmeivr+ivpuaDhTonLCBlcnJvcik7XG4gICAgICAgIHNlbmRSZXNwb25zZShyZXMsIGZhbHNlLCBudWxsLCAn6I635Y+W6IGU57O75Lq65pWw5o2u5aSx6LSlJyk7XG4gICAgfVxufSk7XG5cbi8vIOabtOaWsOS6p+WTgeiBlOezu+S6ukFQSVxuYXBwLnB1dCgnL2FwaS9zdXBwbGllcy86aWQvY29udGFjdCcsIGFzeW5jIChyZXEsIHJlcykgPT4ge1xuICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IHsgaWQgfSA9IHJlcS5wYXJhbXM7XG4gICAgICAgIGNvbnN0IHsgcHJvZHVjdENvbnRhY3QsIGNvbnRhY3RQaG9uZSB9ID0gcmVxLmJvZHk7XG4gICAgICAgIFxuICAgICAgICAvLyDnp7vpmaRcIuiBlOezu+S6ulwi5YmN57y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WYgKCF1c2VySWQpIHtcbiAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVsZWFzZSgpO1xuICAgICAgICAgICAgcmV0dXJuIHNlbmRSZXNwb25zZShyZXMsIGZhbHNlLCBudWxsLCAn55So5oi3SUTkuI3og73kuLrnqbonKTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYgKCFyZWplY3RSZWFzb24pIHtcbiAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVsZWFzZSgpO1xuICAgICAgICAgICAgcmV0dXJuIHNlbmRSZXNwb25zZShyZXMsIGZhbHNlLCBudWxsLCAn5a6h5qC45aSx6LSl5Y6f5Zug5LiN6IO95Li656m6Jyk7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIC8vIOW8gOWni+S6i+WKoVxuICAgICAgICBhd2FpdCBjb25uZWN0aW9uLmJlZ2luVHJhbnNhY3Rpb24oKTtcbiAgICAgICAgXG4gICAgICAgIC8vIOajgOafpeW9k+WJjeeKtuaAgVxuICAgICAgICBjb25zdCBbY3VycmVudFVzZXJdID0gYXdhaXQgY29ubmVjdGlvbi5xdWVyeShcbiAgICAgICAgICAgICdTRUxFQ1QgcGFydG5lcnN0YXR1cyBGUk9NIHVzZXJzIFdIRVJFIHVzZXJJZCA9ID8nLFxuICAgICAgICAgICAgW3VzZXJJZF1cbiAgICAgICAgKTtcbiAgICAgICAgXG4gICAgICAgIGlmIChjdXJyZW50VXNlci5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIGF3YWl0IGNvbm5lY3Rpb24ucm9sbGJhY2soKTtcbiAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVsZWFzZSgpO1xuICAgICAgICAgICAgcmV0dXJuIHNlbmRSZXNwb25zZShyZXMsIGZhbHNlLCBudWxsLCAn5L6b5bqU5ZWG5LiN5a2Y5ZyoJyk7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGlmIChjdXJyZW50VXNlclswXS5wYXJ0bmVyc3Rh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Y29uc29sZS5sb2coJ+aUtuWIsOS+m+W6lOWVhuWIl+ihqOafpeivouivt+axgjonLCByZXEucXVlcnkpO1xuICAgIHRyeSB7XG4gICAgICAgIGNvbnN0IGNvbm5lY3Rpb24gPSBhd2FpdCBwb29sLmdldENvbm5lY3Rpb24oKTtcbiAgICAgICAgY29uc3QgeyBwYWdlID0gMSwgcGFnZVNpemUgPSAxMCwgc3RhdHVzID0gJycsIGtleXdvcmQgPSAnJyB9ID0gcmVxLnF1ZXJ5O1xuICAgICAgICBcbiAgICAgICAgLy8g5p6E5bu65p+l6K+i5p2h5Lu2XG4gICAgICAgIGxldCB3aGVyZUNsYXVzZSA9ICcnO1xuICAgICAgICBsZXQgcGFyYW1zID0gW107XG4gICAgICAgIFxuICAgICAgICAvLyDmt7vliqDnirbmgIHnrZvpgIlcbiAgICAgICAgaWYgKHN0YXR1cykge1xuICAgICAgICAgICAgd2hlcmVDbGF1c2UgKz0gYCBXSEVSRSBwYXJ0bmVyc3RhdHVzID0gP2A7XG4gICAgICAgICAgICBwYXJhbXMucHVzaChzdGF0dXMpO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICAvLyDmt7vliqDlhbPplK7or43mkJzntKJcbiAgICAgICAgaWYgKGtleXdvcmQpIHtcbiAgICAgICAgICAgIHdoZXJlQ2xhdXNlICs9IHN0YXR1cyA/ICcgQU5EJyA6ICcgV0hFUkUnO1xuICAgICAgICAgICAgd2hlcmVDbGF1c2UgKz0gYCAodXNlcm5hbWUgTElLRSA/IE9SIGNvbXBhbnkgTElLRSA/IE9SIHBob25lTnVtYmVyIExJS0UgPylgO1xuICAgICAgICAgICAgcGFyYW1zLnB1c2goYCUke2tleXdvcmR9JWAsIGAlJHtrZXl3b3JkfSVgLCBgJSR7a2V5d29yZH0lYCk7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIC8vIOiOt+WPluaAu+aVsFxuICAgICAgICBjb25zdCBbdG90YWxSZXN1bHRdID0gYXdhaXQgY29ub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x1bW5zXSA9IGF3YWl0IGNvbm5lY3Rpb24ucXVlcnkoXG4gICAgICAgICAgICAnU0hPVyBDT0xVTU5TIEZST00gYHVzZXJzYCBMSUtFID8nLFxuICAgICAgICAgICAgWydyZWplY3RfcmVhc29uJ11cbiAgICAgICAgKTtcbiAgICAgICAgY29uc29sZS5sb2coJ+ajgOafpeihqOWtl+autee7k+aenDonLCByZWplY3RSZWFzb25Db2x1bW5zLmxlbmd0aCA+IDAgPyAn5bey5a2Y5ZyoJyA6ICfkuI3lrZjlnKgnKTtcblxuICAgICAgICBpZiAocmVqZWN0UmVhc29uQ29sdW1ucy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmt7vliqByZWplY3RfcmVhc29u5a2X5q615YiwdXNlcnPooaguLi4nKTtcbiAgICAgICAgICAgIGF3YWl0IGNvbm5lY3Rpb24ucXVlcnkoXG4gICAgICAgICAgICAgICAgJ0FMVEVSIFRBQkxFIGB1c2Vyc2AgQUREIENPTFVNTiByZWplY3RfcmVhc29uIFRFWFQgQ09NTUVOVCBcIuaLkue7neeQhueUsVwiJ1xuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdyZWplY3RfcmVhc29u5a2X5q615re75Yqg5oiQ5YqfJyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zb2xlLmxvZygn5qOA5p+ldXNlcnPooajmmK/lkKbmnIl0ZXJtaW5hdGVfcmVhc29u5a2X5q61Li4uJyk7XG4gICAgICAgIGNvbnN0IFt0ZXJtaW5hdGVSZWFzb25Db2x1bW5zXSA9IGF3YWl0IGNvbm5lY3Rpb24ucXVlcnkoXG4gICAgICAgICAgICAnU0hPVyBDT0xVTU5TIEZST00gYHVzZXJzYCBMSUtFID8nLFxuICAgICAgICAgICAgWyd0ZXJtaW5hdGVfcmVhc29uJ11cbiAgICAgICAgKTtcbiAgICAgICAgY29uc29sZS5sb2coJ+ajgOafpeihqOWtl+autee7k+aen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ubG9nKCfmt7vliqBhdWRpdF90aW1l5a2X5q615YiwdXNlcnPooaguLi4nKTtcbiAgICAgICAgICAgIGF3YWl0IGNvbm5lY3Rpb24ucXVlcnkoXG4gICAgICAgICAgICAgICAgJ0FMVEVSIFRBQkxFIGB1c2Vyc2AgQUREIENPTFVNTiBhdWRpdF90aW1lIERBVEVUSU1FIENPTU1FTlQgXCLlrqHmoLjml7bpl7RcIidcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBjb25zb2xlLmxvZygnYXVkaXRfdGltZeWtl+autea3u+WKoOaIkOWKnycpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8g5qOA5p+l6KGo5piv5ZCm5pyJcmVqZWN0UmVhc29u5a2X5q61XG4gICAgICAgIGNvbnNvbGUubG9nKCfmo4Dmn6Xooahwcm9kdWN0c+aYr+WQpuaciXJlamVjdFJlYXNvbuWtl+autS4uLicpO1xuICAgICAgICBjb25zdCBbY29sdW1uc10gPSBhd2FpdCBjb25uZWN0aW9uLnF1ZXJ5KFxuICAgICAgICAgICAgJ1NIT1cgQ09MVU1OUyBGUk9NIGBwcm9kdWN0c2AgTElLRSA/JyxcbiAgICAgICAgICAgIFsncmVqZWN0UmVhc29uJ11cbiAgICAgICAgKTtcbiAgICAgICAgY29uc29sZS5sb2coJ+ajgOafpeihqOWtl+autee7k+aenDonLCBjb2x1bW5zLmxlbmd0aCA+IDAgPyAn5bey5a2Y5ZyoJyA6ICfkuI3lrZjlnKgnKTtcblxuICAgICAgICBpZiAoY29sdW1ucy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmt7vliqByZWplY3RSZWFzb27lrZfmrrXliLBwcm9kdWN0c+ihqC4uLicpO1xuICAgICAgICAgICAgYXdhaXQgY29ubmVjdGlvbi5xdWVyeShcbiAgICAgICAgICAgICAgICAnQUxURVIgVEFCTEUgYHByb2R1Y3RzYCBBREQgQ09MVU1OIHJlamVjdFJlYXNvbiBURVhUIENPTU1FT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ZWRfYXQgREFURVRJTUUgTk9UIE5VTEwsXG4gICAgICAgICAgICAgICAgICAgIElOREVYIGlkeF9zdXBwbHlfaWQgKHN1cHBseV9pZCksXG4gICAgICAgICAgICAgICAgICAgIElOREVYIGlkeF9jcmVhdGVkX2F0IChjcmVhdGVkX2F0KVxuICAgICAgICAgICAgICAgICkgQ09NTUVOVCAn5a6h5qC45pON5L2c5pel5b+X6KGoJ1xuICAgICAgICAgICAgYCk7XG4gICAgICAgICAgICBjb25zb2xlLmxvZygnYXVkaXRfbG9nc+ihqOWIm+W7uuaIkOWKnycpO1xuICAgICAgICB9XG5cbiAgICAgICAgY29ubmVjdGlvbi5yZWxlYXNlKCk7XG4gICAgICAgIGNvbnNvbGUubG9nKCfmlbDmja7lupPnu5PmnoTmo4Dmn6XlrozmiJAnKTtcbiAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICBjb25zb2xlLmVycm9yKCfmlbDmja7lupPnu5PmnoTmo4Dmn6XlpLHotKU6JywgZXJyb3IubWVzc2FnZSk7XG4gICAgICAgIGNvbnNvbGUuZXJyb3IoJ+mUmeivr+ivpuaDhTonLCBlcnJvcik7XG4gICAgfVxufVxuXG4vLyDlkK/liqjmnI3liqHlmahcbnN0YXJ0U2VydmVyKCk7XG5cbi8vIOS8mOmbheWFs+mXrVxucHJvY2Vzcy5vbignU0lHSU5UJywgYXN5bmMgKCkgPT4ge1xuICAgIGNvbnNvbGUubG9nKCfmraPlnKjlhbPpl63mnI3liqHlmaguLi4nKTtcbiAgICBpZiAocG9vbCkge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgYXdhaXQgcG9vbC5lbmQoKTtcbiAgICAgICAgICAgIGNvbnNvbGUubG9nKCfmlbDmja7lupPov57mjqXmsaDlt7LlhbPpl60nKTtcbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ+WFs+mXreaVsOaNruW6k+i/nuaOpeaxoOWksei0pT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R0FBRyxDQUFDLFdBQVcsQ0FBQyxDQUM1QixDQUFFLE1BQU9NLEtBQUssQ0FBRSxDQUFBL0MsY0FBQSxHQUFBRyxDQUFBLFFBQ1pxQyxPQUFPLENBQUNPLEtBQUssQ0FBQyxhQUFhLENBQUVBLEtBQUssQ0FBQ0MsT0FBTyxDQUFDLENBQy9DLENBQ0osQ0FBQyxLQUFBaEQsY0FBQSxHQUFBVyxDQUFBLFdBQUFYLGNBQUEsR0FBQUcsQ0FBQSxRQUNEcUMsT0FBTyxDQUFDQyxHQUFHLENBQUMsUUFBUSxDQUFDLENBQUN6QyxjQUFBLEdBQUFHLENBQUEsUUFDdEJTLE9BQU8sQ0FBQ29JLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FDbkIsQ0FBQyxDQUFDLENBQUNoSixjQUFBLEdBQUFHLENBQUEsUUFFSDhJLE1BQU0sQ0FBQ0MsT0FBTyxDQUFHekksR0FBRyIsImlnbm9yZUxpc3QiOltdfQ== \ No newline at end of file diff --git a/node_modules/.cache/nyc/test_blackbox-93b3e3e1f87a8794880cb36409dd640927cc67ff9e864ed72a9abaf9a88df76e.js b/node_modules/.cache/nyc/test_blackbox-93b3e3e1f87a8794880cb36409dd640927cc67ff9e864ed72a9abaf9a88df76e.js new file mode 100644 index 0000000..2d6d39c --- /dev/null +++ b/node_modules/.cache/nyc/test_blackbox-93b3e3e1f87a8794880cb36409dd640927cc67ff9e864ed72a9abaf9a88df76e.js @@ -0,0 +1,6 @@ +function cov_157o7hg9v2(){var path="D:\\wechatapp\\SH\\SH\\test_blackbox.js";var hash="14dd226c3b6f42a5ef39d757fcc997058d0393cb";var global=new Function("return this")();var gcv="__coverage__";var coverageData={path:"D:\\wechatapp\\SH\\SH\\test_blackbox.js",statementMap:{"0":{start:{line:1,column:16},end:{line:1,column:36}},"1":{start:{line:2,column:15},end:{line:2,column:37}},"2":{start:{line:3,column:12},end:{line:3,column:31}},"3":{start:{line:5,column:0},end:{line:93,column:3}},"4":{start:{line:7,column:4},end:{line:68,column:7}},"5":{start:{line:8,column:8},end:{line:21,column:11}},"6":{start:{line:9,column:24},end:{line:12,column:28}},"7":{start:{line:14,column:12},end:{line:14,column:48}},"8":{start:{line:15,column:12},end:{line:15,column:48}},"9":{start:{line:16,column:12},end:{line:16,column:59}},"10":{start:{line:17,column:12},end:{line:17,column:60}},"11":{start:{line:18,column:12},end:{line:18,column:59}},"12":{start:{line:19,column:12},end:{line:19,column:63}},"13":{start:{line:20,column:12},end:{line:20,column:57}},"14":{start:{line:23,column:8},end:{line:32,column:11}},"15":{start:{line:24,column:24},end:{line:27,column:28}},"16":{start:{line:29,column:12},end:{line:29,column:48}},"17":{start:{line:30,column:12},end:{line:30,column:48}},"18":{start:{line:31,column:12},end:{line:31,column:57}},"19":{start:{line:34,column:8},end:{line:43,column:11}},"20":{start:{line:35,column:24},end:{line:38,column:28}},"21":{start:{line:40,column:12},end:{line:40,column:48}},"22":{start:{line:41,column:12},end:{line:41,column:48}},"23":{start:{line:42,column:12},end:{line:42,column:57}},"24":{start:{line:45,column:8},end:{line:54,column:11}},"25":{start:{line:46,column:24},end:{line:49,column:28}},"26":{start:{line:51,column:12},end:{line:51,column:48}},"27":{start:{line:52,column:12},end:{line:52,column:48}},"28":{start:{line:53,column:12},end:{line:53,column:57}},"29":{start:{line:56,column:8},end:{line:67,column:11}},"30":{start:{line:57,column:24},end:{line:60,column:28}},"31":{start:{line:62,column:12},end:{line:62,column:48}},"32":{start:{line:63,column:12},end:{line:63,column:48}},"33":{start:{line:64,column:12},end:{line:64,column:57}},"34":{start:{line:65,column:12},end:{line:65,column:63}},"35":{start:{line:66,column:12},end:{line:66,column:55}},"36":{start:{line:71,column:4},end:{line:82,column:7}},"37":{start:{line:72,column:8},end:{line:81,column:11}},"38":{start:{line:73,column:24},end:{line:76,column:28}},"39":{start:{line:78,column:12},end:{line:78,column:48}},"40":{start:{line:79,column:12},end:{line:79,column:48}},"41":{start:{line:80,column:12},end:{line:80,column:63}},"42":{start:{line:85,column:4},end:{line:92,column:7}},"43":{start:{line:86,column:8},end:{line:91,column:11}},"44":{start:{line:87,column:24},end:{line:90,column:28}}},fnMap:{"0":{name:"(anonymous_0)",decl:{start:{line:5,column:25},end:{line:5,column:26}},loc:{start:{line:5,column:31},end:{line:93,column:1}},line:5},"1":{name:"(anonymous_1)",decl:{start:{line:7,column:34},end:{line:7,column:35}},loc:{start:{line:7,column:40},end:{line:68,column:5}},line:7},"2":{name:"(anonymous_2)",decl:{start:{line:8,column:30},end:{line:8,column:31}},loc:{start:{line:8,column:42},end:{line:21,column:9}},line:8},"3":{name:"(anonymous_3)",decl:{start:{line:23,column:32},end:{line:23,column:33}},loc:{start:{line:23,column:44},end:{line:32,column:9}},line:23},"4":{name:"(anonymous_4)",decl:{start:{line:34,column:37},end:{line:34,column:38}},loc:{start:{line:34,column:49},end:{line:43,column:9}},line:34},"5":{name:"(anonymous_5)",decl:{start:{line:45,column:25},end:{line:45,column:26}},loc:{start:{line:45,column:37},end:{line:54,column:9}},line:45},"6":{name:"(anonymous_6)",decl:{start:{line:56,column:23},end:{line:56,column:24}},loc:{start:{line:56,column:35},end:{line:67,column:9}},line:56},"7":{name:"(anonymous_7)",decl:{start:{line:71,column:33},end:{line:71,column:34}},loc:{start:{line:71,column:39},end:{line:82,column:5}},line:71},"8":{name:"(anonymous_8)",decl:{start:{line:72,column:26},end:{line:72,column:27}},loc:{start:{line:72,column:38},end:{line:81,column:9}},line:72},"9":{name:"(anonymous_9)",decl:{start:{line:85,column:22},end:{line:85,column:23}},loc:{start:{line:85,column:28},end:{line:92,column:5}},line:85},"10":{name:"(anonymous_10)",decl:{start:{line:86,column:32},end:{line:86,column:33}},loc:{start:{line:86,column:44},end:{line:91,column:9}},line:86}},branchMap:{},s:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0},f:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},b:{},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"14dd226c3b6f42a5ef39d757fcc997058d0393cb"};var coverage=global[gcv]||(global[gcv]={});if(!coverage[path]||coverage[path].hash!==hash){coverage[path]=coverageData;}var actualCoverage=coverage[path];{// @ts-ignore +cov_157o7hg9v2=function(){return actualCoverage;};}return actualCoverage;}cov_157o7hg9v2();const request=(cov_157o7hg9v2().s[0]++,require('supertest'));const expect=(cov_157o7hg9v2().s[1]++,require('chai').expect);const app=(cov_157o7hg9v2().s[2]++,require('./Reject'));cov_157o7hg9v2().s[3]++;describe('黑盒测试:API功能测试',()=>{cov_157o7hg9v2().f[0]++;cov_157o7hg9v2().s[4]++;// 测试获取货源列表API +describe('GET /api/supplies',()=>{cov_157o7hg9v2().f[1]++;cov_157o7hg9v2().s[5]++;it('应该返回货源列表,包含分页信息',async()=>{cov_157o7hg9v2().f[2]++;const res=(cov_157o7hg9v2().s[6]++,await request(app).get('/api/supplies').expect('Content-Type',/json/).expect(200));cov_157o7hg9v2().s[7]++;expect(res.body).to.be.an('object');cov_157o7hg9v2().s[8]++;expect(res.body.success).to.be.true;cov_157o7hg9v2().s[9]++;expect(res.body.data).to.have.property('list');cov_157o7hg9v2().s[10]++;expect(res.body.data).to.have.property('total');cov_157o7hg9v2().s[11]++;expect(res.body.data).to.have.property('page');cov_157o7hg9v2().s[12]++;expect(res.body.data).to.have.property('pageSize');cov_157o7hg9v2().s[13]++;expect(res.body.data.list).to.be.an('array');});cov_157o7hg9v2().s[14]++;it('应该支持keyword参数搜索功能',async()=>{cov_157o7hg9v2().f[3]++;const res=(cov_157o7hg9v2().s[15]++,await request(app).get('/api/supplies?keyword=罗曼灰').expect('Content-Type',/json/).expect(200));cov_157o7hg9v2().s[16]++;expect(res.body).to.be.an('object');cov_157o7hg9v2().s[17]++;expect(res.body.success).to.be.true;cov_157o7hg9v2().s[18]++;expect(res.body.data.list).to.be.an('array');});cov_157o7hg9v2().s[19]++;it('应该支持search参数搜索功能(向后兼容)',async()=>{cov_157o7hg9v2().f[4]++;const res=(cov_157o7hg9v2().s[20]++,await request(app).get('/api/supplies?search=罗曼灰').expect('Content-Type',/json/).expect(200));cov_157o7hg9v2().s[21]++;expect(res.body).to.be.an('object');cov_157o7hg9v2().s[22]++;expect(res.body.success).to.be.true;cov_157o7hg9v2().s[23]++;expect(res.body.data.list).to.be.an('array');});cov_157o7hg9v2().s[24]++;it('应该支持状态筛选功能',async()=>{cov_157o7hg9v2().f[5]++;const res=(cov_157o7hg9v2().s[25]++,await request(app).get('/api/supplies?status=pending_review').expect('Content-Type',/json/).expect(200));cov_157o7hg9v2().s[26]++;expect(res.body).to.be.an('object');cov_157o7hg9v2().s[27]++;expect(res.body.success).to.be.true;cov_157o7hg9v2().s[28]++;expect(res.body.data.list).to.be.an('array');});cov_157o7hg9v2().s[29]++;it('应该支持分页功能',async()=>{cov_157o7hg9v2().f[6]++;const res=(cov_157o7hg9v2().s[30]++,await request(app).get('/api/supplies?page=1&pageSize=5').expect('Content-Type',/json/).expect(200));cov_157o7hg9v2().s[31]++;expect(res.body).to.be.an('object');cov_157o7hg9v2().s[32]++;expect(res.body.success).to.be.true;cov_157o7hg9v2().s[33]++;expect(res.body.data.list).to.be.an('array');cov_157o7hg9v2().s[34]++;expect(res.body.data.list.length).to.be.at.most(5);cov_157o7hg9v2().s[35]++;expect(res.body.data.pageSize).to.equal(5);});});// 测试数据库连接API +cov_157o7hg9v2().s[36]++;describe('GET /api/test-db',()=>{cov_157o7hg9v2().f[7]++;cov_157o7hg9v2().s[37]++;it('应该返回数据库连接状态',async()=>{cov_157o7hg9v2().f[8]++;const res=(cov_157o7hg9v2().s[38]++,await request(app).get('/api/test-db').expect('Content-Type',/json/).expect(200));cov_157o7hg9v2().s[39]++;expect(res.body).to.be.an('object');cov_157o7hg9v2().s[40]++;expect(res.body.success).to.be.true;cov_157o7hg9v2().s[41]++;expect(res.body.data).to.have.property('solution');});});// 测试根路径 +cov_157o7hg9v2().s[42]++;describe('GET /',()=>{cov_157o7hg9v2().f[9]++;cov_157o7hg9v2().s[43]++;it('应该返回Reject.html页面',async()=>{cov_157o7hg9v2().f[10]++;const res=(cov_157o7hg9v2().s[44]++,await request(app).get('/').expect('Content-Type',/html/).expect(200));});});}); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJjb3ZfMTU3bzdoZzl2MiIsImFjdHVhbENvdmVyYWdlIiwicmVxdWVzdCIsInMiLCJyZXF1aXJlIiwiZXhwZWN0IiwiYXBwIiwiZGVzY3JpYmUiLCJmIiwiaXQiLCJyZXMiLCJnZXQiLCJib2R5IiwidG8iLCJiZSIsImFuIiwic3VjY2VzcyIsInRydWUiLCJkYXRhIiwiaGF2ZSIsInByb3BlcnR5IiwibGlzdCIsImxlbmd0aCIsImF0IiwibW9zdCIsInBhZ2VTaXplIiwiZXF1YWwiXSwic291cmNlcyI6WyJ0ZXN0X2JsYWNrYm94LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImNvbnN0IHJlcXVlc3QgPSByZXF1aXJlKCdzdXBlcnRlc3QnKTtcclxuY29uc3QgZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdDtcclxuY29uc3QgYXBwID0gcmVxdWlyZSgnLi9SZWplY3QnKTtcclxuXHJcbmRlc2NyaWJlKCfpu5Hnm5LmtYvor5XvvJpBUEnlip/og73mtYvor5UnLCAoKSA9PiB7XHJcbiAgICAvLyDmtYvor5Xojrflj5botKfmupDliJfooahBUElcclxuICAgIGRlc2NyaWJlKCdHRVQgL2FwaS9zdXBwbGllcycsICgpID0+IHtcclxuICAgICAg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y9hcGkvc3VwcGxpZXM/a2V5d29yZD3nvZfmm7zngbAnKVxyXG4gICAgICAgICAgICAgICAgLmV4cGVjdCgnQ29udGVudC1UeXBlJywgL2pzb24vKVxyXG4gICAgICAgICAgICAgICAgLmV4cGVjdCgyMDApO1xyXG4gICAgICAgICAgICBcclxuICAgICAgICAgICAgZXhwZWN0KHJlcy5ib2R5KS50by5iZS5hbignb2JqZWN0Jyk7XHJcbiAgICAgICAgICAgIGV4cGVjdChyZXMuYm9keS5zdWNjZXNzKS50by5iZS50cnVlO1xyXG4gICAgICAgICAgICBleHBlY3QocmVzLmJvZHkuZGF0YS5saXN0KS50by5iZS5hbignYXJyYXknKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBcclxuICAgICAgICBpdCgn5bqU6K+l5pSv5oyBc2VhcmNo5Y+C5pWw5pCc57Si5Yqf6IO977yI5ZCR5ZCO5YW85a6577yJJywgYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCByZXMgPSBhd2FpdCByZXF1ZXN0KGFwcClcclxuICAgICAgICAgICAgICAgIC5nZXQoJy9hcGkvc3VwcGxpZXM/c2VhcmNoPee9l+abvOeBsCcpXHJcbiAgICAgICAgICAgICAgICAuZXhwZWN0KCdDb250ZW50LVR5cGUnLCAvanNvbi8pXHJcbiAgICAgICAgICAgICAgICAuZXhwZWN0KDIwMCk7XHJcbiAgICAgICAgICAgIFxyXG4gICAgICAgICAgICBleHBlY3QocmVzLmJvZHkpLnRvLmJlLmFuKCdvYmplY3QnKTtcclxuICAgICAgICAgICAgZXhwZWN0KHJlcy5ib2R5LnN1Y2Nlc3MpLnRvLmJlLnRydWU7XHJcbiAgICAgICAgICAgIGV4cGVjdChyZXMuYm9keS5kYXRhLmxpc3QpLnRvLmJlLmFuKCdhcnJheScpO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIFxyXG4gICAgICAgIGl0KCflupTor6XmlK/mjIHnirbmgIHnrZvpgInlip/og70nLCBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgIGNvbnN0IHJlcyA9IGF3YWl0IHJlcXVlc3QoYXBwKVxyXG4gICAgICAgICAgICAgICAgLmdldCgnL2FwaS9zdXBwbGllcz9zdGF0dXM9cGVuZGluZ19yZXZpZXcnKVxyXG4gICAgICAgICAgICAgICAgLmV4cGVjdCgnQ29udGVudC1UeXBlJywgL2pzb24vKVxyXG4gICAgICAgICAgICAgICAgLmV4cGVjdCgyMDApO1xyXG4gICAgICAgICAgICBcclxuICAgICAgICAgICAgZXhwZWN0KHJlcy5ib2R5KS50by5iZS5hbignb2JqZWN0Jyk7XHJcbiAgICAgICAgICAgIGV4cGVjdChyZXMuYm9keS5zdWNjZXNzKS50by5iZS50cnVlO1xyXG4gICAgICAgICAgICBleHBlY3QocmVzLmJvZHkuZGF0YS5saXN0KS50by5iZS5hbignYXJyYXknKTtcclxuICAgICAgICB9KTtcclxuICAgICAgICBcclxuICAgICAgICBpdCgn5bqU6K+l5pSv5oyB5YiG6aG15Yqf6IO9JywgYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCByZXMgPSBhd2FpdCByZXF1ZXN0KGFwcClcclxuICAgICAgICAgICAgICAgIC5nZXQoJy9hcGkvc3VwcGxpZXM/cGFnZT0xJnBhZ2VTaXplPTUnKVxyXG4gICAgICAgICAgICAgICAgLmV4cGVjdCgnQ29udGVudC1UeXBlJywgL2pzb24vKVxyXG4gICAgICAgICAgICAgICAgLmV4cGVjdCgyMDApO1xyXG4gICAgICAgICAgICBcclxuICAgICAgICAgICAgZXhwZWN0KHJlcy5ib2R5KS50by5iZS5hbignb2JqZWN0Jyk7XHJcbiAgICAgICAgICAgIGV4cGVjdChyZXMuYm9keS5zdWNjZXNzKS50by5iZS50cnVlO1xyXG4gICAgICAgICAgICBleHBlY3QocmVzLmJvZHkuZGF0YS5saXN0KS50by5iZS5hbignYXJyYXknKTtcclxuICAgICAgICAgICAgZXhwZWN0KHJlcy5ib2R5LmRhdGEubGlzdC5sZW5ndGgpLnRvLmJlLmF0Lm1vc3QoNSk7XHJcbiAgICAgICAgICAgIGV4cGVjdChyZXMuYm9keS5kYXRhLnBhZ2VTaXplKS50by5lcXVhbCg1KTtcclxuICAgICAgICB9KTtcclxuICAgIH0pO1xyXG4gICAgXHJcbiAgICAvLyDmtYvor5XmlbDmja7lupPov57mjqVBUElcclxuICAgIGRlc2NyaWJlKCdHRVQgL2FwaS90ZXN0LWRiJywgKCkgPT4ge1xyXG4gICAgICAgIGl0KCflupTor6Xov5Tlm57mlbDmja7lupPov57mjqXnirbmgIEnLCBhc3luYyAoKSA9PiB7XHJcbiAgICAgICAgICAgIGNvbnN0IHJlcyA9IGF3YWl0IHJlcXVlc3QoYXBwKVxyXG4gICAgICAgICAgICAgICAgLmdldCgnL2FwaS90ZXN0LWRiJylcclxuICAgICAgICAgICAgICAgIC5leHBlY3QoJ0NvbnRlbnQtVHlwZScsIC9qc29uLylcclxuICAgICAgICAgICAgICAgIC5leHBlY3QoMjAwKTtcclxuICAgICAgICAgICAgXHJcbiAgICAgICAgICAgIGV4cGVjdChyZXMuYm9keSkudG8uYmUuYW4oJ29iamVjdCcpO1xyXG4gICAgICAgICAgICBleHBlY3QocmVzLmJvZHkuc3VjY2VzcykudG8uYmUudHJ1ZTtcclxuICAgICAgICAgICAgZXhwZWN0KHJlcy5ib2R5LmRhdGEpLnRvLmhhdmUucHJvcGVydHkoJ3NvbHV0aW9uJyk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9KTtcclxuICAgIFxyXG4gICAgLy8g5rWL6K+V5qC56Lev5b6EXHJcbiAgICBkZXNjcmliZSgnR0VUIC8nLCAoKSA9PiB7XHJcbiAgICAgICAgaXQoJ+W6lOivpei/lOWbnlJlamVjdC5odG1s6aG16Z2iJywgYXN5bmMgKCkgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCByZXMgPSBhd2FpdCByZXF1ZXN0KGFwcClcclxuICAgICAgICAgICAgICAgIC5nZXQoJy8nKVx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LENBQzlCQSxNQUFNLENBQUMsR0FBRyxDQUFDLEVBQ3BCLENBQUMsQ0FBQyxDQUNOLENBQUMsQ0FBQyxDQUNOLENBQUMsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ== \ No newline at end of file diff --git a/node_modules/.cache/nyc/test_whitebox-e1e835e4e2a7b02c25fb317e715f890fce4d7bceca855f68529f74379047ad31.js b/node_modules/.cache/nyc/test_whitebox-e1e835e4e2a7b02c25fb317e715f890fce4d7bceca855f68529f74379047ad31.js new file mode 100644 index 0000000..05bece2 --- /dev/null +++ b/node_modules/.cache/nyc/test_whitebox-e1e835e4e2a7b02c25fb317e715f890fce4d7bceca855f68529f74379047ad31.js @@ -0,0 +1,18 @@ +function cov_25j1qrcp5v(){var path="D:\\wechatapp\\SH\\SH\\test_whitebox.js";var hash="7d10ae8fd55c08a0c4637cb59d9b0b5f69e0c101";var global=new Function("return this")();var gcv="__coverage__";var coverageData={path:"D:\\wechatapp\\SH\\SH\\test_whitebox.js",statementMap:{"0":{start:{line:1,column:15},end:{line:1,column:37}},"1":{start:{line:4,column:0},end:{line:144,column:3}},"2":{start:{line:6,column:4},end:{line:128,column:7}},"3":{start:{line:9,column:32},end:{line:9,column:34}},"4":{start:{line:11,column:12},end:{line:46,column:13}},"5":{start:{line:12,column:16},end:{line:45,column:17}},"6":{start:{line:14,column:20},end:{line:38,column:21}},"7":{start:{line:15,column:43},end:{line:15,column:64}},"8":{start:{line:18,column:24},end:{line:22,column:25}},"9":{start:{line:21,column:28},end:{line:21,column:68}},"10":{start:{line:24,column:24},end:{line:29,column:25}},"11":{start:{line:25,column:28},end:{line:25,column:57}},"12":{start:{line:26,column:31},end:{line:29,column:25}},"13":{start:{line:28,column:28},end:{line:28,column:59}},"14":{start:{line:32,column:24},end:{line:37,column:25}},"15":{start:{line:33,column:28},end:{line:33,column:88}},"16":{start:{line:33,column:76},end:{line:33,column:86}},"17":{start:{line:36,column:28},end:{line:36,column:63}},"18":{start:{line:39,column:23},end:{line:45,column:17}},"19":{start:{line:41,column:20},end:{line:41,column:46}},"20":{start:{line:44,column:20},end:{line:44,column:56}},"21":{start:{line:49,column:12},end:{line:56,column:58}},"22":{start:{line:51,column:20},end:{line:51,column:43}},"23":{start:{line:51,column:30},end:{line:51,column:43}},"24":{start:{line:52,column:41},end:{line:52,column:69}},"25":{start:{line:53,column:20},end:{line:53,column:101}},"26":{start:{line:56,column:28},end:{line:56,column:56}},"27":{start:{line:58,column:12},end:{line:58,column:33}},"28":{start:{line:61,column:8},end:{line:69,column:11}},"29":{start:{line:62,column:30},end:{line:62,column:95}},"30":{start:{line:63,column:27},end:{line:63,column:54}},"31":{start:{line:65,column:12},end:{line:65,column:45}},"32":{start:{line:66,column:12},end:{line:66,column:47}},"33":{start:{line:67,column:12},end:{line:67,column:72}},"34":{start:{line:68,column:12},end:{line:68,column:72}},"35":{start:{line:71,column:8},end:{line:79,column:11}},"36":{start:{line:72,column:30},end:{line:72,column:97}},"37":{start:{line:73,column:27},end:{line:73,column:54}},"38":{start:{line:75,column:12},end:{line:75,column:45}},"39":{start:{line:76,column:12},end:{line:76,column:47}},"40":{start:{line:77,column:12},end:{line:77,column:72}},"41":{start:{line:78,column:12},end:{line:78,column:72}},"42":{start:{line:81,column:8},end:{line:89,column:11}},"43":{start:{line:82,column:30},end:{line:82,column:101}},"44":{start:{line:83,column:27},end:{line:83,column:54}},"45":{start:{line:85,column:12},end:{line:85,column:45}},"46":{start:{line:86,column:12},end:{line:86,column:47}},"47":{start:{line:87,column:12},end:{line:87,column:72}},"48":{start:{line:88,column:12},end:{line:88,column:72}},"49":{start:{line:91,column:8},end:{line:99,column:11}},"50":{start:{line:92,column:30},end:{line:92,column:92}},"51":{start:{line:93,column:27},end:{line:93,column:54}},"52":{start:{line:95,column:12},end:{line:95,column:45}},"53":{start:{line:96,column:12},end:{line:96,column:47}},"54":{start:{line:97,column:12},end:{line:97,column:72}},"55":{start:{line:98,column:12},end:{line:98,column:72}},"56":{start:{line:101,column:8},end:{line:108,column:11}},"57":{start:{line:102,column:30},end:{line:102,column:61}},"58":{start:{line:103,column:27},end:{line:103,column:54}},"59":{start:{line:105,column:12},end:{line:105,column:45}},"60":{start:{line:106,column:12},end:{line:106,column:47}},"61":{start:{line:107,column:12},end:{line:107,column:72}},"62":{start:{line:110,column:8},end:{line:118,column:11}},"63":{start:{line:111,column:30},end:{line:111,column:96}},"64":{start:{line:112,column:27},end:{line:112,column:54}},"65":{start:{line:114,column:12},end:{line:114,column:45}},"66":{start:{line:115,column:12},end:{line:115,column:47}},"67":{start:{line:116,column:12},end:{line:116,column:72}},"68":{start:{line:117,column:12},end:{line:117,column:72}},"69":{start:{line:120,column:8},end:{line:127,column:11}},"70":{start:{line:121,column:30},end:{line:121,column:107}},"71":{start:{line:122,column:27},end:{line:122,column:54}},"72":{start:{line:124,column:12},end:{line:124,column:45}},"73":{start:{line:125,column:12},end:{line:125,column:47}},"74":{start:{line:126,column:12},end:{line:126,column:72}},"75":{start:{line:131,column:4},end:{line:143,column:7}},"76":{start:{line:132,column:8},end:{line:142,column:11}},"77":{start:{line:134,column:39},end:{line:136,column:13}},"78":{start:{line:135,column:16},end:{line:135,column:41}},"79":{start:{line:138,column:12},end:{line:138,column:98}},"80":{start:{line:139,column:12},end:{line:139,column:84}},"81":{start:{line:140,column:12},end:{line:140,column:86}},"82":{start:{line:141,column:12},end:{line:141,column:60}}},fnMap:{"0":{name:"(anonymous_0)",decl:{start:{line:4,column:24},end:{line:4,column:25}},loc:{start:{line:4,column:30},end:{line:144,column:1}},line:4},"1":{name:"(anonymous_1)",decl:{start:{line:6,column:26},end:{line:6,column:27}},loc:{start:{line:6,column:32},end:{line:128,column:5}},line:6},"2":{name:"processImageUrls",decl:{start:{line:8,column:17},end:{line:8,column:33}},loc:{start:{line:8,column:45},end:{line:59,column:9}},line:8},"3":{name:"(anonymous_3)",decl:{start:{line:33,column:69},end:{line:33,column:70}},loc:{start:{line:33,column:76},end:{line:33,column:86}},line:33},"4":{name:"(anonymous_4)",decl:{start:{line:50,column:24},end:{line:50,column:25}},loc:{start:{line:50,column:31},end:{line:54,column:17}},line:50},"5":{name:"(anonymous_5)",decl:{start:{line:56,column:21},end:{line:56,column:22}},loc:{start:{line:56,column:28},end:{line:56,column:56}},line:56},"6":{name:"(anonymous_6)",decl:{start:{line:61,column:30},end:{line:61,column:31}},loc:{start:{line:61,column:36},end:{line:69,column:9}},line:61},"7":{name:"(anonymous_7)",decl:{start:{line:71,column:31},end:{line:71,column:32}},loc:{start:{line:71,column:37},end:{line:79,column:9}},line:71},"8":{name:"(anonymous_8)",decl:{start:{line:81,column:33},end:{line:81,column:34}},loc:{start:{line:81,column:39},end:{line:89,column:9}},line:81},"9":{name:"(anonymous_9)",decl:{start:{line:91,column:32},end:{line:91,column:33}},loc:{start:{line:91,column:38},end:{line:99,column:9}},line:91},"10":{name:"(anonymous_10)",decl:{start:{line:101,column:29},end:{line:101,column:30}},loc:{start:{line:101,column:35},end:{line:108,column:9}},line:101},"11":{name:"(anonymous_11)",decl:{start:{line:110,column:26},end:{line:110,column:27}},loc:{start:{line:110,column:32},end:{line:118,column:9}},line:110},"12":{name:"(anonymous_12)",decl:{start:{line:120,column:26},end:{line:120,column:27}},loc:{start:{line:120,column:32},end:{line:127,column:9}},line:120},"13":{name:"(anonymous_13)",decl:{start:{line:131,column:25},end:{line:131,column:26}},loc:{start:{line:131,column:31},end:{line:143,column:5}},line:131},"14":{name:"(anonymous_14)",decl:{start:{line:132,column:30},end:{line:132,column:31}},loc:{start:{line:132,column:36},end:{line:142,column:9}},line:132},"15":{name:"(anonymous_15)",decl:{start:{line:134,column:39},end:{line:134,column:40}},loc:{start:{line:134,column:60},end:{line:136,column:13}},line:134}},branchMap:{"0":{loc:{start:{line:11,column:12},end:{line:46,column:13}},type:"if",locations:[{start:{line:11,column:12},end:{line:46,column:13}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:11},"1":{loc:{start:{line:12,column:16},end:{line:45,column:17}},type:"if",locations:[{start:{line:12,column:16},end:{line:45,column:17}},{start:{line:39,column:23},end:{line:45,column:17}}],line:12},"2":{loc:{start:{line:18,column:24},end:{line:22,column:25}},type:"if",locations:[{start:{line:18,column:24},end:{line:22,column:25}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:18},"3":{loc:{start:{line:18,column:28},end:{line:19,column:90}},type:"binary-expr",locations:[{start:{line:18,column:28},end:{line:18,column:60}},{start:{line:19,column:29},end:{line:19,column:57}},{start:{line:19,column:61},end:{line:19,column:89}}],line:18},"4":{loc:{start:{line:24,column:24},end:{line:29,column:25}},type:"if",locations:[{start:{line:24,column:24},end:{line:29,column:25}},{start:{line:26,column:31},end:{line:29,column:25}}],line:24},"5":{loc:{start:{line:26,column:31},end:{line:29,column:25}},type:"if",locations:[{start:{line:26,column:31},end:{line:29,column:25}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:26},"6":{loc:{start:{line:32,column:24},end:{line:37,column:25}},type:"if",locations:[{start:{line:32,column:24},end:{line:37,column:25}},{start:{line:34,column:31},end:{line:37,column:25}}],line:32},"7":{loc:{start:{line:39,column:23},end:{line:45,column:17}},type:"if",locations:[{start:{line:39,column:23},end:{line:45,column:17}},{start:{line:42,column:23},end:{line:45,column:17}}],line:39},"8":{loc:{start:{line:51,column:20},end:{line:51,column:43}},type:"if",locations:[{start:{line:51,column:20},end:{line:51,column:43}},{start:{line:undefined,column:undefined},end:{line:undefined,column:undefined}}],line:51},"9":{loc:{start:{line:53,column:27},end:{line:53,column:100}},type:"binary-expr",locations:[{start:{line:53,column:27},end:{line:53,column:61}},{start:{line:53,column:65},end:{line:53,column:100}}],line:53},"10":{loc:{start:{line:135,column:23},end:{line:135,column:40}},type:"binary-expr",locations:[{start:{line:135,column:23},end:{line:135,column:30}},{start:{line:135,column:34},end:{line:135,column:40}}],line:135}},s:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0},f:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0},b:{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0]},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"7d10ae8fd55c08a0c4637cb59d9b0b5f69e0c101"};var coverage=global[gcv]||(global[gcv]={});if(!coverage[path]||coverage[path].hash!==hash){coverage[path]=coverageData;}var actualCoverage=coverage[path];{// @ts-ignore +cov_25j1qrcp5v=function(){return actualCoverage;};}return actualCoverage;}cov_25j1qrcp5v();const expect=(cov_25j1qrcp5v().s[0]++,require('chai').expect);// 从Reject.js中提取出来的关键业务逻辑函数 +cov_25j1qrcp5v().s[1]++;describe('白盒测试:核心业务逻辑',()=>{cov_25j1qrcp5v().f[0]++;cov_25j1qrcp5v().s[2]++;// 测试图片URL处理逻辑 +describe('图片URL处理函数',()=>{cov_25j1qrcp5v().f[1]++;// 模拟图片URL处理逻辑 +function processImageUrls(imageUrls){cov_25j1qrcp5v().f[2]++;let processedUrls=(cov_25j1qrcp5v().s[3]++,[]);cov_25j1qrcp5v().s[4]++;if(imageUrls){cov_25j1qrcp5v().b[0][0]++;cov_25j1qrcp5v().s[5]++;if(typeof imageUrls==='string'){cov_25j1qrcp5v().b[1][0]++;cov_25j1qrcp5v().s[6]++;// 尝试解析为JSON数组 +try{let parsedImages=(cov_25j1qrcp5v().s[7]++,JSON.parse(imageUrls));// 检查是否是JSON字符串的字符串表示(转义的JSON) +cov_25j1qrcp5v().s[8]++;if((cov_25j1qrcp5v().b[3][0]++,typeof parsedImages==='string')&&((cov_25j1qrcp5v().b[3][1]++,parsedImages.startsWith('['))||(cov_25j1qrcp5v().b[3][2]++,parsedImages.startsWith('{')))){cov_25j1qrcp5v().b[2][0]++;cov_25j1qrcp5v().s[9]++;// 进行第二次解析 +parsedImages=JSON.parse(parsedImages);}else{cov_25j1qrcp5v().b[2][1]++;}cov_25j1qrcp5v().s[10]++;if(Array.isArray(parsedImages)){cov_25j1qrcp5v().b[4][0]++;cov_25j1qrcp5v().s[11]++;processedUrls=parsedImages;}else{cov_25j1qrcp5v().b[4][1]++;cov_25j1qrcp5v().s[12]++;if(typeof parsedImages==='string'){cov_25j1qrcp5v().b[5][0]++;cov_25j1qrcp5v().s[13]++;// 如果解析结果是字符串,可能是单个URL +processedUrls=[parsedImages];}else{cov_25j1qrcp5v().b[5][1]++;}}}catch(e){cov_25j1qrcp5v().s[14]++;// 解析失败,尝试按逗号分隔 +if(imageUrls.includes(',')){cov_25j1qrcp5v().b[6][0]++;cov_25j1qrcp5v().s[15]++;processedUrls=imageUrls.split(',').map(url=>{cov_25j1qrcp5v().f[3]++;cov_25j1qrcp5v().s[16]++;return url.trim();});}else{cov_25j1qrcp5v().b[6][1]++;cov_25j1qrcp5v().s[17]++;// 作为单个URL处理 +processedUrls=[imageUrls.trim()];}}}else{cov_25j1qrcp5v().b[1][1]++;cov_25j1qrcp5v().s[18]++;if(Array.isArray(imageUrls)){cov_25j1qrcp5v().b[7][0]++;cov_25j1qrcp5v().s[19]++;// 已经是数组,直接使用 +processedUrls=imageUrls;}else{cov_25j1qrcp5v().b[7][1]++;cov_25j1qrcp5v().s[20]++;// 其他类型,转换为字符串数组 +processedUrls=[String(imageUrls)];}}}else{cov_25j1qrcp5v().b[0][1]++;}// 过滤并处理无效的URL:移除反引号并验证 +cov_25j1qrcp5v().s[21]++;processedUrls=processedUrls.filter(url=>{cov_25j1qrcp5v().f[4]++;cov_25j1qrcp5v().s[22]++;if(!url){cov_25j1qrcp5v().b[8][0]++;cov_25j1qrcp5v().s[23]++;return false;}else{cov_25j1qrcp5v().b[8][1]++;}const processedUrl=(cov_25j1qrcp5v().s[24]++,url.replace(/`/g,'').trim());cov_25j1qrcp5v().s[25]++;return(cov_25j1qrcp5v().b[9][0]++,processedUrl.startsWith('http://'))||(cov_25j1qrcp5v().b[9][1]++,processedUrl.startsWith('https://'));})// 对每个有效URL进行处理,移除反引号 +.map(url=>{cov_25j1qrcp5v().f[5]++;cov_25j1qrcp5v().s[26]++;return url.replace(/`/g,'').trim();});cov_25j1qrcp5v().s[27]++;return processedUrls;}cov_25j1qrcp5v().s[28]++;it('应该正确处理包含反引号的URL',()=>{cov_25j1qrcp5v().f[6]++;const imageUrls=(cov_25j1qrcp5v().s[29]++,'`http://example.com/image1.jpg`,`http://example.com/image2.jpg`');const result=(cov_25j1qrcp5v().s[30]++,processImageUrls(imageUrls));cov_25j1qrcp5v().s[31]++;expect(result).to.be.an('array');cov_25j1qrcp5v().s[32]++;expect(result).to.have.lengthOf(2);cov_25j1qrcp5v().s[33]++;expect(result[0]).to.equal('http://example.com/image1.jpg');cov_25j1qrcp5v().s[34]++;expect(result[1]).to.equal('http://example.com/image2.jpg');});cov_25j1qrcp5v().s[35]++;it('应该正确处理转义的JSON字符串',()=>{cov_25j1qrcp5v().f[7]++;const imageUrls=(cov_25j1qrcp5v().s[36]++,'["http://example.com/image1.jpg","http://example.com/image2.jpg"]');const result=(cov_25j1qrcp5v().s[37]++,processImageUrls(imageUrls));cov_25j1qrcp5v().s[38]++;expect(result).to.be.an('array');cov_25j1qrcp5v().s[39]++;expect(result).to.have.lengthOf(2);cov_25j1qrcp5v().s[40]++;expect(result[0]).to.equal('http://example.com/image1.jpg');cov_25j1qrcp5v().s[41]++;expect(result[1]).to.equal('http://example.com/image2.jpg');});cov_25j1qrcp5v().s[42]++;it('应该正确处理双重转义的JSON字符串',()=>{cov_25j1qrcp5v().f[8]++;const imageUrls=(cov_25j1qrcp5v().s[43]++,'[\"http://example.com/image1.jpg\",\"http://example.com/image2.jpg\"]');const result=(cov_25j1qrcp5v().s[44]++,processImageUrls(imageUrls));cov_25j1qrcp5v().s[45]++;expect(result).to.be.an('array');cov_25j1qrcp5v().s[46]++;expect(result).to.have.lengthOf(2);cov_25j1qrcp5v().s[47]++;expect(result[0]).to.equal('http://example.com/image1.jpg');cov_25j1qrcp5v().s[48]++;expect(result[1]).to.equal('http://example.com/image2.jpg');});cov_25j1qrcp5v().s[49]++;it('应该正确处理逗号分隔的URL字符串',()=>{cov_25j1qrcp5v().f[9]++;const imageUrls=(cov_25j1qrcp5v().s[50]++,'http://example.com/image1.jpg, http://example.com/image2.jpg');const result=(cov_25j1qrcp5v().s[51]++,processImageUrls(imageUrls));cov_25j1qrcp5v().s[52]++;expect(result).to.be.an('array');cov_25j1qrcp5v().s[53]++;expect(result).to.have.lengthOf(2);cov_25j1qrcp5v().s[54]++;expect(result[0]).to.equal('http://example.com/image1.jpg');cov_25j1qrcp5v().s[55]++;expect(result[1]).to.equal('http://example.com/image2.jpg');});cov_25j1qrcp5v().s[56]++;it('应该正确处理单个URL字符串',()=>{cov_25j1qrcp5v().f[10]++;const imageUrls=(cov_25j1qrcp5v().s[57]++,'http://example.com/image1.jpg');const result=(cov_25j1qrcp5v().s[58]++,processImageUrls(imageUrls));cov_25j1qrcp5v().s[59]++;expect(result).to.be.an('array');cov_25j1qrcp5v().s[60]++;expect(result).to.have.lengthOf(1);cov_25j1qrcp5v().s[61]++;expect(result[0]).to.equal('http://example.com/image1.jpg');});cov_25j1qrcp5v().s[62]++;it('应该正确处理URL数组',()=>{cov_25j1qrcp5v().f[11]++;const imageUrls=(cov_25j1qrcp5v().s[63]++,['http://example.com/image1.jpg','http://example.com/image2.jpg']);const result=(cov_25j1qrcp5v().s[64]++,processImageUrls(imageUrls));cov_25j1qrcp5v().s[65]++;expect(result).to.be.an('array');cov_25j1qrcp5v().s[66]++;expect(result).to.have.lengthOf(2);cov_25j1qrcp5v().s[67]++;expect(result[0]).to.equal('http://example.com/image1.jpg');cov_25j1qrcp5v().s[68]++;expect(result[1]).to.equal('http://example.com/image2.jpg');});cov_25j1qrcp5v().s[69]++;it('应该过滤掉无效的URL',()=>{cov_25j1qrcp5v().f[12]++;const imageUrls=(cov_25j1qrcp5v().s[70]++,['http://example.com/image1.jpg','not-a-url','ftp://invalid.com/image.jpg']);const result=(cov_25j1qrcp5v().s[71]++,processImageUrls(imageUrls));cov_25j1qrcp5v().s[72]++;expect(result).to.be.an('array');cov_25j1qrcp5v().s[73]++;expect(result).to.have.lengthOf(1);cov_25j1qrcp5v().s[74]++;expect(result[0]).to.equal('http://example.com/image1.jpg');});});// 测试搜索参数处理逻辑 +cov_25j1qrcp5v().s[75]++;describe('搜索参数处理逻辑',()=>{cov_25j1qrcp5v().f[13]++;cov_25j1qrcp5v().s[76]++;it('应该优先使用keyword参数',()=>{cov_25j1qrcp5v().f[14]++;cov_25j1qrcp5v().s[77]++;// 模拟搜索参数处理 +const handleSearchParams=(search,keyword)=>{cov_25j1qrcp5v().f[15]++;cov_25j1qrcp5v().s[78]++;return(cov_25j1qrcp5v().b[10][0]++,keyword)||(cov_25j1qrcp5v().b[10][1]++,search);};cov_25j1qrcp5v().s[79]++;expect(handleSearchParams('search-value','keyword-value')).to.equal('keyword-value');cov_25j1qrcp5v().s[80]++;expect(handleSearchParams('search-value','')).to.equal('search-value');cov_25j1qrcp5v().s[81]++;expect(handleSearchParams('','keyword-value')).to.equal('keyword-value');cov_25j1qrcp5v().s[82]++;expect(handleSearchParams('','')).to.equal('');});});}); +//# sourceMappingURL=data:application/json;char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uICAgICAgICAgICAgXG4gICAgICAgICAgICBpZiAoaW1hZ2VVcmxzKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpbWFnZVVybHMgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIOWwneivleino+aekOS4ukpTT07mlbDnu4RcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJzZWRJbWFnZXMgPSBKU09OLnBhcnNlKGltYWdlVXJscyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIOajgOafpeaYr+WQpuaYr0pTT07lrZfnrKbkuLLnmoTlrZfnrKbkuLLooajnpLrvvIjovazkuYnnmoRKU09O77yJXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBhcnNlZEltYWdlcyA9PT0gJ3N0cmluZycgJiYgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBhcnNlZEltYWdlcy5zdGFydHNXaXRoKCdbJykgfHwgcGFyc2VkSW1hZ2VzLnN0YXJ0c1dpdGgoJ3snKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyDov5vooYznrKzkuozmrKHop6PmnpBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZWRJbWFnZXMgPSBKU09OLnBhcnNlKHBhcnNlZEltYWdlcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHBhcnNlZEltYWdlcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzZWRVcmxzID0gcGFyc2VkSW1hZ2VzO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgcGFyc2VkSW1hZ2VzID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIOWmguaenOino+aekOe7k+aenOaYr+Wtl+espuS4su+8jOWPr+iDveaYr+WNleS4qlVSTFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NlZFVybHMgPSBbcGFyc2VkSW1hZ2VzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8g6Kej5p6Q5aSx6LSl77yM5bCd6K+V5oyJ6YCX5Y+35YiG6ZqUXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1hZ2VVcmxzLmluY2x1ZGVzKCcsJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzZWRVcmxzID0gaW1hZ2VVcmxzLnNwbGl0KCcsJykubWFwKHVybCA9PiB1cmwudHJpbSgpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8g5L2c5Li65Y2V5LiqVVJM5aSE55CGXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc2VkVXJscyA9IFtpbWFnZVVybHMudHJpbSgpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheShpbWFnZVVybHMpKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIOW3sue7j+aYr+aVsOe7hO+8jOebtOaOpeS9v+eUqFxuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzZWRVcmxzID0gaW1hZ2VVcmxzO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIOWFtuS7luexu+Wei++8jOi9rOaNouS4uuWtl+espuS4suaVsOe7hFxuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzZWRVcmxzID0gW1N0cmluZyhpbWFnZVVybHMpXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIC8vIOi/h+a7pOW5tuWkhOeQhuaXoOaViOeahFVSTO+8muenu+mZpOWPjeW8leWPt+W5tumqjOivgVxuICAgICAgICAgICAgcHJvY2Vzc2VkVXJscyA9IHByb2Nlc3NlZFVybHNcbiAgICAgICAgICAgICAgICAuZmlsdGVyKHVybCA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdXJsKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHByb2Nlc3NlZFVybCA9IHVybC5yZXBsYWNlKC9gL2csICcnKS50cmltKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwcm9jZXNzZWRVcmwuc3RhcnRzV2l0aCgnaHR0cDovLycpIHx8IHByb2Nlc3NlZFVybC5zdGFydHNXaXRoKCdodHRwczovLycpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLy8g5a+55q+P5Liq5pyJ5pWIVVJM6L+b6KGM5aSE55CG77yM56e76Zmk5Y+N5byV5Y+3XG4gICAgICAgICAgICAgICAgLm1hcCh1cmwgPT4gdXJsLnJlcGxhY2UoL2AvZywgJycpLnRyaW0oKSk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIHJldHVybiBwcm9jZXNzZWRVcmxzO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBpdCgn5bqU6K+l5q2j56Gu5aSE55CG5YyF5ZCr5Y+N5byV5Y+355qEVVJMJywgKCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgaW1hZ2VVcmxzID0gJ2BodHRwOi8vZXhhbXBsZS5jb20vaW1hZ2UxLmpwZ2AsYGh0dHA6Ly9leGFtcGxlLmNvbS9pbWFnZTIuanBnYCc7XG4gICAgICAgICAgICBjb25zdCByZX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6K+l5q2j56Gu5aSE55CG5Y+M6YeN6L2s5LmJ55qESlNPTuWtl+espuS4sicsICgpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGltYWdlVXJscyA9ICdbXFxcImh0dHA6Ly9leGFtcGxlLmNvbS9pbWFnZTEuanBnXFxcIixcXFwiaHR0cDovL2V4YW1wbGUuY29tL2ltYWdlMi5qcGdcXFwiXSc7XG4gICAgICAgICAgICBjb25zdCByZXN1bHQgPSBwcm9jZXNzSW1hZ2VVcmxzKGltYWdlVXJscyk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGV4cGVjdChyZXN1bHQpLnRvLmJlLmFuKCdhcnJheScpO1xuICAgICAgICAgICAgZXhwZWN0KHJlc3VsdCkudG8uaGF2ZS5sZW5ndGhPZigyKTtcbiAgICAgICAgICAgIGV4cGVjdChyZXN1bHRbMF0pLnRvLmVxdWFsKCdodHRwOi8vZXhhbXBsZS5jb20vaW1hZ2UxLmpwZycpO1xuICAgICAgICAgICAgZXhwZWN0KHJlc3VsdFsxXSkudG8uZXF1YWwoJ2h0dHA6Ly9leGFtcGxlLmNvbS9pbWFnZTIuanBnJyk7XG4gICAgICAgIH0pO1xuICAgICAgICBcbiAgICAgICAgaXQoJ+W6lOivpeato+ehruWkhOeQhumAl+WPt+WIhumalOeahFVSTOWtl+espuS4sicsICgpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGltYWdlVXJscyA9ICdodHRwOi8vZXhhbXBsZS5jb20vaW1hZ2UxLmpwZywgaHR0cDovL2V4YW1wbGUuY29tL2ltYWdlMi5qcGcnO1xuICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gcHJvY2Vzc0ltYWdlVXJscyhpbWFnZVVybHMpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBleHBlY3QocmVzdWx0KS50by5iZS5hbignYXJyYXknKTtcbiAgICAgICAgICAgIGV4cGVjdChyZXN1bHQpLnRvLmhhdmUubGVuZ3RoT2YoMik7XG4gICAgICAgICAgICBleHBlY3QocmVzdWx0WzBdKS50by5lcXVhbCgnaHR0cDovL2V4YW1wbGUuY29tL2ltYWdlMS5qcGcnKTtcbiAgICAgICAgICAgIGV4cGVjdChyZXN1bHRbMV0pLnRvLmVxdWFsKCdodHRwOi8vZXhhbXBsZS5jb20vaW1hZ2UyLmpwZycpO1xuICAgICAgICB9KTtcbiAgICAgICAgXG4gICAgICAgIGl0KCflupTor6XmraPnoa7lpITnkIbljZXkuKpVUkzlrZfnrKbkuLInLCAoKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBpbWFnZVVybHMgPSAnaHR0cDovL2V4YW1wbGUuY29tL2ltYWdlMS5qcGcnO1xuICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gcHJvY2Vzc0ltYWdlVXJscyhpbWFnZVVybHMpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBleHBlY3QocmVzdWx0KS50by5iZS5hbignYXJyYXknKTtcbiAgICAgICAgICAgIGV4cGVjdChyZXN1bHQpLnRvLmhhdmUubGVuZ3RoT2YoMSk7XG4gICAgICAgICAgICBleHBlY3QocmVzdWx0WzBdKS50by5lcXVhbCgnaHR0cDovL2V4YW1wbGUuY29tL2ltYWdlMS5qcGcnKTtcbiAgICAgICAgfSk7XG4gICAgICAgIFxuICAgICAgICBpdCgn5bqU6K+l5q2j56Gu5aSE55CGVVJM5pWw57uEJywgKCkgPT4ge1xuICAgICAgICAgICAgY29uc3QgaW1hZ2VVcmxzID0gWydodHRwOi8vZXhhbXBsZS5jb20vaW1hZ2UxLmpwZycsICdodHRwOi8vZXhhbXBsZS5jb20vaW1hZ2UyLmpwZyddO1xuICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gcHJvY2Vzc0ltYWdlVXJscyhpbWFnZVVybHMpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBleHBlY3QocmVzdWx0KS50by5iZS5hbignYXJyYXknKTtcbiAgICAgICAgICAgIGV4cGVjdChyZXN1bHQpLnRvLmhhdmUubGVuZ3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QUMsQ0FDbkQsQ0FBQyxDQUFDLENBQ04sQ0FBQyxDQUFDLENBQ04sQ0FBQyxDQUFDIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..f39158a --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,4882 @@ +{ +<<<<<<< Updated upstream + "name": "Review2", +======= + "name": "boss", +>>>>>>> Stashed changes + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@sinonjs/samsam": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.3.tgz", + "integrity": "sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "type-detect": "^4.1.0" + } + }, + "node_modules/@sinonjs/samsam/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/address": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", + "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.3.tgz", + "integrity": "sha512-yqXL+k5rr8+ZRpOAntkaaRgWgE5o8ESAj5DyRmVTCSoZxXmqemb9Dd7T4i5UzwuERdLAJUy6XzR9zFVuf0kzkw==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ali-oss": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/ali-oss/-/ali-oss-6.23.0.tgz", + "integrity": "sha512-FipRmyd16Pr/tEey/YaaQ/24Pc3HEpLM9S1DRakEuXlSLXNIJnu1oJtHM53eVYpvW3dXapSjrip3xylZUTIZVQ==", + "license": "MIT", + "dependencies": { + "address": "^1.2.2", + "agentkeepalive": "^3.4.1", + "bowser": "^1.6.0", + "copy-to": "^2.0.1", + "dateformat": "^2.0.0", + "debug": "^4.3.4", + "destroy": "^1.0.4", + "end-or-error": "^1.0.1", + "get-ready": "^1.0.0", + "humanize-ms": "^1.2.0", + "is-type-of": "^1.4.0", + "js-base64": "^2.5.2", + "jstoxml": "^2.0.0", + "lodash": "^4.17.21", + "merge-descriptors": "^1.0.1", + "mime": "^2.4.5", + "platform": "^1.3.1", + "pump": "^3.0.0", + "qs": "^6.4.0", + "sdk-base": "^2.0.1", + "stream-http": "2.8.2", + "stream-wormhole": "^1.0.4", + "urllib": "^2.44.0", + "utility": "^1.18.0", + "xml2js": "^0.6.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ali-oss/node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "license": "MIT" + }, + "node_modules/append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-require-extensions": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/axios": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.3.tgz", + "integrity": "sha512-8QdH6czo+G7uBsNo0GiUfouPN1lRzKdJTGnKXwe12gkFbnnOUaUKGN55dMkfy+mnxmvjwl9zcI4VncczcVXDhA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/body-parser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.1.tgz", + "integrity": "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bowser": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.9.4.tgz", + "integrity": "sha512-9IdMmj2KjigRq6oWhmwv1W36pDuA4STQZ8q6YO9um+x07xgYNCD3Oou+WP/3L1HNz7iqythGet3/p4wvc8AAwQ==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001759", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz", + "integrity": "sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.1.tgz", + "integrity": "sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/copy-to": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==", + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha512-GODcnWq3YGoTnygPfi02ygEiRxqUxpJwuRHjdhJYuxpcZmDq4rjBiXYmbCCzStxo176ixfLT6i4NPwQooRySnw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-require-extensions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", + "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "strip-bom": "^4.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-user-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-user-agent/-/default-user-agent-1.0.0.tgz", + "integrity": "sha512-bDF7bg6OSNcSwFWPu4zYKpVkJZQYVrAANMYB8bc9Szem1D0yKdm4sa/rOCs2aC9+2GMqQ7KnwtZRvDhmLF0dXw==", + "license": "MIT", + "dependencies": { + "os-name": "~1.0.3" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/digest-header": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/digest-header/-/digest-header-1.1.0.tgz", + "integrity": "sha512-glXVh42vz40yZb9Cq2oMOt70FIoWiv+vxNvdKdU8CwjLad25qHM3trLxhl9bVjdr6WaslIXhWpn0NO8T/67Qjg==", + "license": "MIT", + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.266", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.266.tgz", + "integrity": "sha512-kgWEglXvkEfMH7rxP5OSZZwnaDWT7J9EoZCujhnpLbfi0bbNtRkgdX2E3gt0Uer11c61qCYktB3hwkAS325sJg==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/end-or-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/end-or-error/-/end-or-error-1.0.1.tgz", + "integrity": "sha512-OclLMSug+k2A0JKuf494im25ANRBVW8qsjmwbgX7lQ8P82H21PQ1PWkoYwb9y5yMBS69BPlwtzdIFClo3+7kOQ==", + "license": "MIT", + "engines": { + "node": ">= 0.11.14" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/formidable": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.4.tgz", + "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", + "dezalgo": "^1.0.4", + "once": "^1.4.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/formstream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/formstream/-/formstream-1.5.2.tgz", + "integrity": "sha512-NASf0lgxC1AyKNXQIrXTEYkiX99LhCEXTkiGObXAkpBui86a4u8FjH1o2bGb3PpqI3kafC+yw4zWeK6l6VHTgg==", + "license": "MIT", + "dependencies": { + "destroy": "^1.0.4", + "mime": "^2.5.2", + "node-hex": "^1.0.1", + "pause-stream": "~0.0.11" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-ready": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-ready/-/get-ready-1.0.0.tgz", + "integrity": "sha512-mFXCZPJIlcYcth+N8267+mghfYN9h3EhsDa6JSnbA3Wrhh/XFpuowviFcsDeYZtKspQyWyJqfs4O6P8CHeTwzw==", + "license": "MIT" + }, + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz", + "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-class-hotfix": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz", + "integrity": "sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ==", + "license": "MIT" + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "append-transform": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "license": "ISC", + "dependencies": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "license": "BSD-3-Clause" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jstoxml": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/jstoxml/-/jstoxml-2.2.9.tgz", + "integrity": "sha512-OYWlK0j+roh+eyaMROlNbS5cd5R25Y+IUpdl7cNdB8HNrkgwQzIS7L9MegxOiWNBj9dQhA/yAxiMwCC5mwNoBw==", + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/lru.min": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.2.tgz", + "integrity": "sha512-Nv9KddBcQSlQopmBHXSsZVY5xsdlZkdH/Iey0BlcBYggMd4two7cZnKOK9vmy3nY0O5RGH99z1PCeTpPqszUYg==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mocha": { + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^9.0.5", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mysql2": { + "version": "3.15.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.15.3.tgz", + "integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.7.0", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-hex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/node-hex/-/node-hex-1.0.1.tgz", + "integrity": "sha512-iwpZdvW6Umz12ICmu9IYPRxg0tOLGmU3Tq2tKetejCj3oZd7b2nUXwP3a7QA5M9glWy8wlPS1G3RwM/CdsUbdQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "process-on-spawn": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nyc": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "bin": { + "nyc": "bin/nyc.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/nyc/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/nyc/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/nyc/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/nyc/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/nyc/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nyc/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nyc/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/nyc/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/nyc/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-name": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-1.0.3.tgz", + "integrity": "sha512-f5estLO2KN8vgtTRaILIgEGBoBrMnZ3JQ7W9TMZCnOIGwHe8TRGSpcagnWDo+Dfhd/z08k9Xe75hvciJJ8Qaew==", + "license": "MIT", + "dependencies": { + "osx-release": "^1.0.0", + "win-release": "^1.0.0" + }, + "bin": { + "os-name": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osx-release": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/osx-release/-/osx-release-1.1.0.tgz", + "integrity": "sha512-ixCMMwnVxyHFQLQnINhmIpWqXIfS2YOXchwQrk+OFzmo6nDjQ0E4KXAyyUh0T0MZgV4bUhkRrAbVqlE4yLVq4A==", + "license": "MIT", + "dependencies": { + "minimist": "^1.1.0" + }, + "bin": { + "osx-release": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/process-on-spawn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "fromentries": "^1.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.1.tgz", + "integrity": "sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.7.0", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", + "dev": true, + "license": "ISC", + "dependencies": { + "es6-error": "^4.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true, + "license": "ISC" + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz", + "integrity": "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==", + "license": "BlueOak-1.0.0" + }, + "node_modules/sdk-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/sdk-base/-/sdk-base-2.0.1.tgz", + "integrity": "sha512-eeG26wRwhtwYuKGCDM3LixCaxY27Pa/5lK4rLKhQa7HBjJ3U3Y+f81MMZQRsDw/8SC2Dao/83yJTXJ8aULuN8Q==", + "license": "MIT", + "dependencies": { + "get-ready": "~1.0.0" + } + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true, + "license": "ISC" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sinon": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.0.tgz", + "integrity": "sha512-TOgRcwFPbfGtpqvZw+hyqJDvqfapr1qUlOizROIk4bBLjlsjlB00Pg6wMFXNtJRpu+eCZuVOaLatG7M8105kAw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/spawn-wrap/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/spawn-wrap/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-http": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.2.tgz", + "integrity": "sha512-QllfrBhqF1DPcz46WxKTs6Mz1Bpc+8Qm6vbqOpVav5odAXwbyzwnEczoWqtxrsmlO+cJqtPrp/8gWKWjaKLLlA==", + "license": "MIT", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/stream-wormhole": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stream-wormhole/-/stream-wormhole-1.1.0.tgz", + "integrity": "sha512-gHFfL3px0Kctd6Po0M8TzEvt3De/xu6cnRrjlfYNhwbhLPLwigI2t1nc6jrzNuaYg5C4YF78PPFuQPzRiqn9ew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/superagent": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.3.tgz", + "integrity": "sha512-y/hkYGeXAj7wUMjxRbB21g/l6aAEituGXM9Rwl4o20+SX3e8YOSV6BxFXl+dL3Uk0mjSL3kCbNkwURm8/gEDig==", + "dev": true, + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.1", + "cookiejar": "^2.1.4", + "debug": "^4.3.7", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.4", + "formidable": "^3.5.4", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.2" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/supertest": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.1.4.tgz", + "integrity": "sha512-tjLPs7dVyqgItVFirHYqe2T+MfWc2VOBQ8QFKKbWTA3PU7liZR8zoSpAi/C1k1ilm9RsXIKYf197oap9wXGVYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "methods": "^1.1.2", + "superagent": "^10.2.3" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, + "node_modules/to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==", + "license": "MIT" + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/unescape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unescape/-/unescape-1.0.1.tgz", + "integrity": "sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz", + "integrity": "sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/urllib": { + "version": "2.44.0", + "resolved": "https://registry.npmjs.org/urllib/-/urllib-2.44.0.tgz", + "integrity": "sha512-zRCJqdfYllRDA9bXUtx+vccyRqtJPKsw85f44zH7zPD28PIvjMqIgw9VwoTLV7xTBWZsbebUFVHU5ghQcWku2A==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.3.0", + "content-type": "^1.0.2", + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "ee-first": "~1.1.1", + "formstream": "^1.1.0", + "humanize-ms": "^1.2.0", + "iconv-lite": "^0.6.3", + "pump": "^3.0.0", + "qs": "^6.4.0", + "statuses": "^1.3.1", + "utility": "^1.16.1" + }, + "engines": { + "node": ">= 0.10.0" + }, + "peerDependencies": { + "proxy-agent": "^5.0.0" + }, + "peerDependenciesMeta": { + "proxy-agent": { + "optional": true + } + } + }, + "node_modules/urllib/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/urllib/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/win-release": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha512-iCRnKVvGxOQdsKhcQId2PXV1vV3J/sDPXKA4Oe9+Eti2nb2ESEsYHRYls/UjoUW3bIc5ZDO8dTH50A/5iVN+bw==", + "license": "MIT", + "dependencies": { + "semver": "^5.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/win-release/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/workerpool": { + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/node_modules/@babel/code-frame/LICENSE b/node_modules/@babel/code-frame/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/code-frame/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/code-frame/README.md b/node_modules/@babel/code-frame/README.md new file mode 100644 index 0000000..7160755 --- /dev/null +++ b/node_modules/@babel/code-frame/README.md @@ -0,0 +1,19 @@ +# @babel/code-frame + +> Generate errors that contain a code frame that point to source locations. + +See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/code-frame +``` + +or using yarn: + +```sh +yarn add @babel/code-frame --dev +``` diff --git a/node_modules/@babel/code-frame/lib/index.js b/node_modules/@babel/code-frame/lib/index.js new file mode 100644 index 0000000..b409f30 --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js @@ -0,0 +1,216 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var picocolors = require('picocolors'); +var jsTokens = require('js-tokens'); +var helperValidatorIdentifier = require('@babel/helper-validator-identifier'); + +function isColorSupported() { + return (typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported + ); +} +const compose = (f, g) => v => f(g(v)); +function buildDefs(colors) { + return { + keyword: colors.cyan, + capitalized: colors.yellow, + jsxIdentifier: colors.yellow, + punctuator: colors.yellow, + number: colors.magenta, + string: colors.green, + regex: colors.magenta, + comment: colors.gray, + invalid: compose(compose(colors.white, colors.bgRed), colors.bold), + gutter: colors.gray, + marker: compose(colors.red, colors.bold), + message: compose(colors.red, colors.bold), + reset: colors.reset + }; +} +const defsOn = buildDefs(picocolors.createColors(true)); +const defsOff = buildDefs(picocolors.createColors(false)); +function getDefs(enabled) { + return enabled ? defsOn : defsOff; +} + +const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); +const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/; +const BRACKET = /^[()[\]{}]$/; +let tokenize; +{ + const JSX_TAG = /^[a-z][\w-]*$/i; + const getTokenType = function (token, offset, text) { + if (token.type === "name") { + if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) { + return "keyword"; + } + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === " defs[type](str)).join("\n"); + } else { + highlighted += value; + } + } + return highlighted; +} + +let deprecationWarningShown = false; +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; + } + if (endLine === -1) { + end = source.length; + } + const lineDiff = endLine - startLine; + const markerLines = {}; + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + return { + start, + end, + markerLines + }; +} +function codeFrameColumns(rawLines, loc, opts = {}) { + const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode; + const defs = getDefs(shouldHighlight); + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + defs.message(opts.message); + } + } + return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); + } else { + return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } + if (shouldHighlight) { + return defs.reset(frame); + } else { + return frame; + } +} +function index (rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); +} + +exports.codeFrameColumns = codeFrameColumns; +exports.default = index; +exports.highlight = highlight; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/code-frame/lib/index.js.map b/node_modules/@babel/code-frame/lib/index.js.map new file mode 100644 index 0000000..46a181d --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/defs.ts","../src/highlight.ts","../src/index.ts"],"sourcesContent":["import picocolors, { createColors } from \"picocolors\";\nimport type { Colors, Formatter } from \"picocolors/types\";\n\nexport function isColorSupported() {\n return (\n // See https://github.com/alexeyraspopov/picocolors/issues/62\n typeof process === \"object\" &&\n (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\")\n ? false\n : picocolors.isColorSupported\n );\n}\n\nexport type InternalTokenType =\n | \"keyword\"\n | \"capitalized\"\n | \"jsxIdentifier\"\n | \"punctuator\"\n | \"number\"\n | \"string\"\n | \"regex\"\n | \"comment\"\n | \"invalid\";\n\ntype UITokens = \"gutter\" | \"marker\" | \"message\";\n\nexport type Defs = {\n [_ in InternalTokenType | UITokens | \"reset\"]: Formatter;\n};\n\nconst compose: (f: (gv: U) => V, g: (v: T) => U) => (v: T) => V =\n (f, g) => v =>\n f(g(v));\n\n/**\n * Styles for token types.\n */\nfunction buildDefs(colors: Colors): Defs {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold),\n\n reset: colors.reset,\n };\n}\n\nconst defsOn = buildDefs(createColors(true));\nconst defsOff = buildDefs(createColors(false));\n\nexport function getDefs(enabled: boolean): Defs {\n return enabled ? defsOn : defsOff;\n}\n","import type { Token as JSToken, JSXToken } from \"js-tokens\";\nimport jsTokens from \"js-tokens\";\n\nimport {\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nimport { getDefs, type InternalTokenType } from \"./defs.ts\";\n\n/**\n * Names that are always allowed as identifiers, but also appear as keywords\n * within certain syntactic productions.\n *\n * https://tc39.es/ecma262/#sec-keywords-and-reserved-words\n *\n * `target` has been omitted since it is very likely going to be a false\n * positive.\n */\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\n\ntype Token = {\n type: InternalTokenType | \"uncolored\";\n value: string;\n};\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * RegExp to test for the three types of brackets.\n */\nconst BRACKET = /^[()[\\]{}]$/;\n\nlet tokenize: (\n text: string,\n) => Generator<{ type: InternalTokenType | \"uncolored\"; value: string }>;\n\nif (process.env.BABEL_8_BREAKING) {\n /**\n * Get the type of token, specifying punctuator type.\n */\n const getTokenType = function (\n token: JSToken | JSXToken,\n ): InternalTokenType | \"uncolored\" {\n if (token.type === \"IdentifierName\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (token.value[0] !== token.value[0].toLowerCase()) {\n return \"capitalized\";\n }\n }\n\n if (token.type === \"Punctuator\" && BRACKET.test(token.value)) {\n return \"uncolored\";\n }\n\n if (token.type === \"Invalid\" && token.value === \"@\") {\n return \"punctuator\";\n }\n\n switch (token.type) {\n case \"NumericLiteral\":\n return \"number\";\n\n case \"StringLiteral\":\n case \"JSXString\":\n case \"NoSubstitutionTemplate\":\n return \"string\";\n\n case \"RegularExpressionLiteral\":\n return \"regex\";\n\n case \"Punctuator\":\n case \"JSXPunctuator\":\n return \"punctuator\";\n\n case \"MultiLineComment\":\n case \"SingleLineComment\":\n return \"comment\";\n\n case \"Invalid\":\n case \"JSXInvalid\":\n return \"invalid\";\n\n case \"JSXIdentifier\":\n return \"jsxIdentifier\";\n\n default:\n return \"uncolored\";\n }\n };\n\n /**\n * Turn a string of JS into an array of objects.\n */\n tokenize = function* (text: string): Generator {\n for (const token of jsTokens(text, { jsx: true })) {\n switch (token.type) {\n case \"TemplateHead\":\n yield { type: \"string\", value: token.value.slice(0, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateMiddle\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateTail\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1) };\n break;\n\n default:\n yield {\n type: getTokenType(token),\n value: token.value,\n };\n }\n }\n };\n} else {\n /**\n * RegExp to test for what seems to be a JSX tag name.\n */\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n\n // The token here is defined in js-tokens@4. However we don't bother\n // typing it since the whole block will be removed in Babel 8\n const getTokenType = function (token: any, offset: number, text: string) {\n if (token.type === \"name\") {\n if (\n isKeyword(token.value) ||\n isStrictReservedWord(token.value, true) ||\n sometimesKeywords.has(token.value)\n ) {\n return \"keyword\";\n }\n\n if (\n JSX_TAG.test(token.value) &&\n (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \" defs[type as InternalTokenType](str))\n .join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n\n return highlighted;\n}\n","import { getDefs, isColorSupported } from \"./defs.ts\";\nimport { highlight } from \"./highlight.ts\";\n\nexport { highlight };\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: Array,\n opts: Options,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const shouldHighlight =\n opts.forceColor || (isColorSupported() && opts.highlightCode);\n const defs = getDefs(shouldHighlight);\n\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end).length;\n\n const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n defs.gutter(gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n defs.marker(\"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + defs.message(opts.message);\n }\n }\n return [\n defs.marker(\">\"),\n defs.gutter(gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : \"\"}`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (shouldHighlight) {\n return defs.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"names":["isColorSupported","process","env","FORCE_COLOR","picocolors","compose","f","g","v","buildDefs","colors","keyword","cyan","capitalized","yellow","jsxIdentifier","punctuator","number","magenta","string","green","regex","comment","gray","invalid","white","bgRed","bold","gutter","marker","red","message","reset","defsOn","createColors","defsOff","getDefs","enabled","sometimesKeywords","Set","NEWLINE","BRACKET","tokenize","JSX_TAG","getTokenType","token","offset","text","type","isKeyword","value","isStrictReservedWord","has","test","slice","toLowerCase","match","jsTokens","default","exec","matchToToken","index","highlight","defs","highlighted","split","map","str","join","deprecationWarningShown","getMarkerLines","loc","source","opts","startLoc","Object","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","shouldHighlight","forceColor","highlightCode","lines","hasColumns","numberMaxWidth","String","highlightedLines","frame","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","colNumber","emitWarning","deprecationError","Error","name","console","warn","location"],"mappings":";;;;;;;;AAGO,SAASA,gBAAgBA,GAAG;EACjC,QAEE,OAAOC,OAAO,KAAK,QAAQ,KACxBA,OAAO,CAACC,GAAG,CAACC,WAAW,KAAK,GAAG,IAAIF,OAAO,CAACC,GAAG,CAACC,WAAW,KAAK,OAAO,CAAC,GACtE,KAAK,GACLC,UAAU,CAACJ,gBAAAA;AAAgB,IAAA;AAEnC,CAAA;AAmBA,MAAMK,OAAkE,GACtEA,CAACC,CAAC,EAAEC,CAAC,KAAKC,CAAC,IACTF,CAAC,CAACC,CAAC,CAACC,CAAC,CAAC,CAAC,CAAA;AAKX,SAASC,SAASA,CAACC,MAAc,EAAQ;EACvC,OAAO;IACLC,OAAO,EAAED,MAAM,CAACE,IAAI;IACpBC,WAAW,EAAEH,MAAM,CAACI,MAAM;IAC1BC,aAAa,EAAEL,MAAM,CAACI,MAAM;IAC5BE,UAAU,EAAEN,MAAM,CAACI,MAAM;IACzBG,MAAM,EAAEP,MAAM,CAACQ,OAAO;IACtBC,MAAM,EAAET,MAAM,CAACU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,EAAA,OAAOE,gBAAgB,CAACC,QAAQ,EAAE2B,QAAQ,EAAEpD,IAAI,CAAC,CAAA;AACnD;;;;;;"} \ No newline at end of file diff --git a/node_modules/@babel/code-frame/package.json b/node_modules/@babel/code-frame/package.json new file mode 100644 index 0000000..c95c244 --- /dev/null +++ b/node_modules/@babel/code-frame/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/code-frame", + "version": "7.27.1", + "description": "Generate errors that contain a code frame that point to source locations.", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-code-frame", + "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-code-frame" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "devDependencies": { + "import-meta-resolve": "^4.1.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/compat-data/LICENSE b/node_modules/@babel/compat-data/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/compat-data/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/compat-data/README.md b/node_modules/@babel/compat-data/README.md new file mode 100644 index 0000000..c191898 --- /dev/null +++ b/node_modules/@babel/compat-data/README.md @@ -0,0 +1,19 @@ +# @babel/compat-data + +> The compat-data to determine required Babel plugins + +See our website [@babel/compat-data](https://babeljs.io/docs/babel-compat-data) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/compat-data +``` + +or using yarn: + +```sh +yarn add @babel/compat-data +``` diff --git a/node_modules/@babel/compat-data/corejs2-built-ins.js b/node_modules/@babel/compat-data/corejs2-built-ins.js new file mode 100644 index 0000000..ed19e0b --- /dev/null +++ b/node_modules/@babel/compat-data/corejs2-built-ins.js @@ -0,0 +1,2 @@ +// Todo (Babel 8): remove this file as Babel 8 drop support of core-js 2 +module.exports = require("./data/corejs2-built-ins.json"); diff --git a/node_modules/@babel/compat-data/corejs3-shipped-proposals.js b/node_modules/@babel/compat-data/corejs3-shipped-proposals.js new file mode 100644 index 0000000..7909b8c --- /dev/null +++ b/node_modules/@babel/compat-data/corejs3-shipped-proposals.js @@ -0,0 +1,2 @@ +// Todo (Babel 8): remove this file now that it is included in babel-plugin-polyfill-corejs3 +module.exports = require("./data/corejs3-shipped-proposals.json"); diff --git a/node_modules/@babel/compat-data/data/corejs2-built-ins.json b/node_modules/@babel/compat-data/data/corejs2-built-ins.json new file mode 100644 index 0000000..ba76060 --- /dev/null +++ b/node_modules/@babel/compat-data/data/corejs2-built-ins.json @@ -0,0 +1,2106 @@ +{ + "es6.array.copy-within": { + "chrome": "45", + "opera": "32", + "edge": "12", + "firefox": "32", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.31" + }, + "es6.array.every": { + "chrome": "5", + "opera": "10.10", + "edge": "12", + "firefox": "2", + "safari": "3.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.fill": { + "chrome": "45", + "opera": "32", + "edge": "12", + "firefox": "31", + "safari": "7.1", + "node": "4", + "deno": "1", + "ios": "8", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.31" + }, + "es6.array.filter": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.array.find": { + "chrome": "45", + "opera": "32", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "4", + "deno": "1", + "ios": "8", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.31" + }, + "es6.array.find-index": { + "chrome": "45", + "opera": "32", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "4", + "deno": "1", + "ios": "8", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.31" + }, + "es7.array.flat-map": { + "chrome": "69", + "opera": "56", + "edge": "79", + "firefox": "62", + "safari": "12", + "node": "11", + "deno": "1", + "ios": "12", + "samsung": "10", + "rhino": "1.7.15", + "opera_mobile": "48", + "electron": "4.0" + }, + "es6.array.for-each": { + "chrome": "5", + "opera": "10.10", + "edge": "12", + "firefox": "2", + "safari": "3.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.from": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "36", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "41", + "electron": "1.2" + }, + "es7.array.includes": { + "chrome": "47", + "opera": "34", + "edge": "14", + "firefox": "102", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "34", + "electron": "0.36" + }, + "es6.array.index-of": { + "chrome": "5", + "opera": "10.10", + "edge": "12", + "firefox": "2", + "safari": "3.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.is-array": { + "chrome": "5", + "opera": "10.50", + "edge": "12", + "firefox": "4", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.iterator": { + "chrome": "66", + "opera": "53", + "edge": "12", + "firefox": "60", + "safari": "9", + "node": "10", + "deno": "1", + "ios": "9", + "samsung": "9", + "rhino": "1.7.13", + "opera_mobile": "47", + "electron": "3.0" + }, + "es6.array.last-index-of": { + "chrome": "5", + "opera": "10.10", + "edge": "12", + "firefox": "2", + "safari": "3.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.map": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.array.of": { + "chrome": "45", + "opera": "32", + "edge": "12", + "firefox": "25", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.31" + }, + "es6.array.reduce": { + "chrome": "5", + "opera": "10.50", + "edge": "12", + "firefox": "3", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.reduce-right": { + "chrome": "5", + "opera": "10.50", + "edge": "12", + "firefox": "3", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.slice": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.array.some": { + "chrome": "5", + "opera": "10.10", + "edge": "12", + "firefox": "2", + "safari": "3.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.array.sort": { + "chrome": "63", + "opera": "50", + "edge": "12", + "firefox": "5", + "safari": "12", + "node": "10", + "deno": "1", + "ie": "9", + "ios": "12", + "samsung": "8", + "rhino": "1.7.13", + "opera_mobile": "46", + "electron": "3.0" + }, + "es6.array.species": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.date.now": { + "chrome": "5", + "opera": "10.50", + "edge": "12", + "firefox": "2", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.date.to-iso-string": { + "chrome": "5", + "opera": "10.50", + "edge": "12", + "firefox": "3.5", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.date.to-json": { + "chrome": "5", + "opera": "12.10", + "edge": "12", + "firefox": "4", + "safari": "10", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "10", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12.1", + "electron": "0.20" + }, + "es6.date.to-primitive": { + "chrome": "47", + "opera": "34", + "edge": "15", + "firefox": "44", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "34", + "electron": "0.36" + }, + "es6.date.to-string": { + "chrome": "5", + "opera": "10.50", + "edge": "12", + "firefox": "2", + "safari": "3.1", + "node": "0.4", + "deno": "1", + "ie": "10", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.function.bind": { + "chrome": "7", + "opera": "12", + "edge": "12", + "firefox": "4", + "safari": "5.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12", + "electron": "0.20" + }, + "es6.function.has-instance": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "50", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.function.name": { + "chrome": "5", + "opera": "10.50", + "edge": "14", + "firefox": "2", + "safari": "4", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es6.map": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "53", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.math.acosh": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.asinh": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.atanh": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.cbrt": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.clz32": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "31", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.cosh": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.expm1": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.fround": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "26", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.hypot": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "27", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.imul": { + "chrome": "30", + "opera": "17", + "edge": "12", + "firefox": "23", + "safari": "7", + "node": "0.12", + "deno": "1", + "android": "4.4", + "ios": "7", + "samsung": "2", + "rhino": "1.7.13", + "opera_mobile": "18", + "electron": "0.20" + }, + "es6.math.log1p": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.log10": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.log2": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.sign": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.sinh": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.tanh": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.math.trunc": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "25", + "safari": "7.1", + "node": "0.12", + "deno": "1", + "ios": "8", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.number.constructor": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "36", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.number.epsilon": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "25", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "2", + "rhino": "1.7.14", + "opera_mobile": "21", + "electron": "0.20" + }, + "es6.number.is-finite": { + "chrome": "19", + "opera": "15", + "edge": "12", + "firefox": "16", + "safari": "9", + "node": "0.8", + "deno": "1", + "android": "4.1", + "ios": "9", + "samsung": "1.5", + "rhino": "1.7.13", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.number.is-integer": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "16", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "2", + "rhino": "1.7.13", + "opera_mobile": "21", + "electron": "0.20" + }, + "es6.number.is-nan": { + "chrome": "19", + "opera": "15", + "edge": "12", + "firefox": "15", + "safari": "9", + "node": "0.8", + "deno": "1", + "android": "4.1", + "ios": "9", + "samsung": "1.5", + "rhino": "1.7.13", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.number.is-safe-integer": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "32", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "2", + "rhino": "1.7.13", + "opera_mobile": "21", + "electron": "0.20" + }, + "es6.number.max-safe-integer": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "31", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "2", + "rhino": "1.7.13", + "opera_mobile": "21", + "electron": "0.20" + }, + "es6.number.min-safe-integer": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "31", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "2", + "rhino": "1.7.13", + "opera_mobile": "21", + "electron": "0.20" + }, + "es6.number.parse-float": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "25", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "2", + "rhino": "1.7.14", + "opera_mobile": "21", + "electron": "0.20" + }, + "es6.number.parse-int": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "25", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "2", + "rhino": "1.7.14", + "opera_mobile": "21", + "electron": "0.20" + }, + "es6.object.assign": { + "chrome": "49", + "opera": "36", + "edge": "13", + "firefox": "36", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.object.create": { + "chrome": "5", + "opera": "12", + "edge": "12", + "firefox": "4", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12", + "electron": "0.20" + }, + "es7.object.define-getter": { + "chrome": "62", + "opera": "49", + "edge": "16", + "firefox": "48", + "safari": "9", + "node": "8.10", + "deno": "1", + "ios": "9", + "samsung": "8", + "opera_mobile": "46", + "electron": "3.0" + }, + "es7.object.define-setter": { + "chrome": "62", + "opera": "49", + "edge": "16", + "firefox": "48", + "safari": "9", + "node": "8.10", + "deno": "1", + "ios": "9", + "samsung": "8", + "opera_mobile": "46", + "electron": "3.0" + }, + "es6.object.define-property": { + "chrome": "5", + "opera": "12", + "edge": "12", + "firefox": "4", + "safari": "5.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12", + "electron": "0.20" + }, + "es6.object.define-properties": { + "chrome": "5", + "opera": "12", + "edge": "12", + "firefox": "4", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12", + "electron": "0.20" + }, + "es7.object.entries": { + "chrome": "54", + "opera": "41", + "edge": "14", + "firefox": "47", + "safari": "10.1", + "node": "7", + "deno": "1", + "ios": "10.3", + "samsung": "6", + "rhino": "1.7.14", + "opera_mobile": "41", + "electron": "1.4" + }, + "es6.object.freeze": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es6.object.get-own-property-descriptor": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es7.object.get-own-property-descriptors": { + "chrome": "54", + "opera": "41", + "edge": "15", + "firefox": "50", + "safari": "10.1", + "node": "7", + "deno": "1", + "ios": "10.3", + "samsung": "6", + "rhino": "1.8", + "opera_mobile": "41", + "electron": "1.4" + }, + "es6.object.get-own-property-names": { + "chrome": "40", + "opera": "27", + "edge": "12", + "firefox": "33", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "27", + "electron": "0.21" + }, + "es6.object.get-prototype-of": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es7.object.lookup-getter": { + "chrome": "62", + "opera": "49", + "edge": "79", + "firefox": "36", + "safari": "9", + "node": "8.10", + "deno": "1", + "ios": "9", + "samsung": "8", + "opera_mobile": "46", + "electron": "3.0" + }, + "es7.object.lookup-setter": { + "chrome": "62", + "opera": "49", + "edge": "79", + "firefox": "36", + "safari": "9", + "node": "8.10", + "deno": "1", + "ios": "9", + "samsung": "8", + "opera_mobile": "46", + "electron": "3.0" + }, + "es6.object.prevent-extensions": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es6.object.to-string": { + "chrome": "57", + "opera": "44", + "edge": "15", + "firefox": "51", + "safari": "10", + "node": "8", + "deno": "1", + "ios": "10", + "samsung": "7", + "opera_mobile": "43", + "electron": "1.7" + }, + "es6.object.is": { + "chrome": "19", + "opera": "15", + "edge": "12", + "firefox": "22", + "safari": "9", + "node": "0.8", + "deno": "1", + "android": "4.1", + "ios": "9", + "samsung": "1.5", + "rhino": "1.7.13", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.object.is-frozen": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es6.object.is-sealed": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es6.object.is-extensible": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es6.object.keys": { + "chrome": "40", + "opera": "27", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "27", + "electron": "0.21" + }, + "es6.object.seal": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "35", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.13", + "opera_mobile": "32", + "electron": "0.30" + }, + "es6.object.set-prototype-of": { + "chrome": "34", + "opera": "21", + "edge": "12", + "firefox": "31", + "safari": "9", + "node": "0.12", + "deno": "1", + "ie": "11", + "ios": "9", + "samsung": "2", + "rhino": "1.7.13", + "opera_mobile": "21", + "electron": "0.20" + }, + "es7.object.values": { + "chrome": "54", + "opera": "41", + "edge": "14", + "firefox": "47", + "safari": "10.1", + "node": "7", + "deno": "1", + "ios": "10.3", + "samsung": "6", + "rhino": "1.7.14", + "opera_mobile": "41", + "electron": "1.4" + }, + "es6.promise": { + "chrome": "51", + "opera": "38", + "edge": "14", + "firefox": "45", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "41", + "electron": "1.2" + }, + "es7.promise.finally": { + "chrome": "63", + "opera": "50", + "edge": "18", + "firefox": "58", + "safari": "11.1", + "node": "10", + "deno": "1", + "ios": "11.3", + "samsung": "8", + "rhino": "1.7.15", + "opera_mobile": "46", + "electron": "3.0" + }, + "es6.reflect.apply": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.construct": { + "chrome": "49", + "opera": "36", + "edge": "13", + "firefox": "49", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.define-property": { + "chrome": "49", + "opera": "36", + "edge": "13", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.delete-property": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.get": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.get-own-property-descriptor": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.get-prototype-of": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.has": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.is-extensible": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.own-keys": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.prevent-extensions": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.set": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.reflect.set-prototype-of": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "42", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.regexp.constructor": { + "chrome": "50", + "opera": "37", + "edge": "79", + "firefox": "40", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "37", + "electron": "1.1" + }, + "es6.regexp.flags": { + "chrome": "49", + "opera": "36", + "edge": "79", + "firefox": "37", + "safari": "9", + "node": "6", + "deno": "1", + "ios": "9", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "36", + "electron": "0.37" + }, + "es6.regexp.match": { + "chrome": "50", + "opera": "37", + "edge": "79", + "firefox": "49", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "37", + "electron": "1.1" + }, + "es6.regexp.replace": { + "chrome": "50", + "opera": "37", + "edge": "79", + "firefox": "49", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "37", + "electron": "1.1" + }, + "es6.regexp.split": { + "chrome": "50", + "opera": "37", + "edge": "79", + "firefox": "49", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "37", + "electron": "1.1" + }, + "es6.regexp.search": { + "chrome": "50", + "opera": "37", + "edge": "79", + "firefox": "49", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "37", + "electron": "1.1" + }, + "es6.regexp.to-string": { + "chrome": "50", + "opera": "37", + "edge": "79", + "firefox": "39", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "37", + "electron": "1.1" + }, + "es6.set": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "53", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.symbol": { + "chrome": "51", + "opera": "38", + "edge": "79", + "firefox": "51", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es7.symbol.async-iterator": { + "chrome": "63", + "opera": "50", + "edge": "79", + "firefox": "57", + "safari": "12", + "node": "10", + "deno": "1", + "ios": "12", + "samsung": "8", + "opera_mobile": "46", + "electron": "3.0" + }, + "es6.string.anchor": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.big": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.blink": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.bold": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.code-point-at": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "29", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.string.ends-with": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "29", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.string.fixed": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.fontcolor": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.fontsize": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.from-code-point": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "29", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.string.includes": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "40", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.string.italics": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.iterator": { + "chrome": "38", + "opera": "25", + "edge": "12", + "firefox": "36", + "safari": "9", + "node": "0.12", + "deno": "1", + "ios": "9", + "samsung": "3", + "rhino": "1.7.13", + "opera_mobile": "25", + "electron": "0.20" + }, + "es6.string.link": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es7.string.pad-start": { + "chrome": "57", + "opera": "44", + "edge": "15", + "firefox": "48", + "safari": "10", + "node": "8", + "deno": "1", + "ios": "10", + "samsung": "7", + "rhino": "1.7.13", + "opera_mobile": "43", + "electron": "1.7" + }, + "es7.string.pad-end": { + "chrome": "57", + "opera": "44", + "edge": "15", + "firefox": "48", + "safari": "10", + "node": "8", + "deno": "1", + "ios": "10", + "samsung": "7", + "rhino": "1.7.13", + "opera_mobile": "43", + "electron": "1.7" + }, + "es6.string.raw": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "34", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.14", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.string.repeat": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "24", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.string.small": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.starts-with": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "29", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "rhino": "1.7.13", + "opera_mobile": "28", + "electron": "0.21" + }, + "es6.string.strike": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.sub": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.sup": { + "chrome": "5", + "opera": "15", + "edge": "12", + "firefox": "17", + "safari": "6", + "node": "0.4", + "deno": "1", + "android": "4", + "ios": "7", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.14", + "opera_mobile": "14", + "electron": "0.20" + }, + "es6.string.trim": { + "chrome": "5", + "opera": "10.50", + "edge": "12", + "firefox": "3.5", + "safari": "4", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "es7.string.trim-left": { + "chrome": "66", + "opera": "53", + "edge": "79", + "firefox": "61", + "safari": "12", + "node": "10", + "deno": "1", + "ios": "12", + "samsung": "9", + "rhino": "1.7.13", + "opera_mobile": "47", + "electron": "3.0" + }, + "es7.string.trim-right": { + "chrome": "66", + "opera": "53", + "edge": "79", + "firefox": "61", + "safari": "12", + "node": "10", + "deno": "1", + "ios": "12", + "samsung": "9", + "rhino": "1.7.13", + "opera_mobile": "47", + "electron": "3.0" + }, + "es6.typed.array-buffer": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.data-view": { + "chrome": "5", + "opera": "12", + "edge": "12", + "firefox": "15", + "safari": "5.1", + "node": "0.4", + "deno": "1", + "ie": "10", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12", + "electron": "0.20" + }, + "es6.typed.int8-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.uint8-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.uint8-clamped-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.int16-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.uint16-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.int32-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.uint32-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.float32-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.typed.float64-array": { + "chrome": "51", + "opera": "38", + "edge": "13", + "firefox": "48", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.weak-map": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "53", + "safari": "9", + "node": "6.5", + "deno": "1", + "ios": "9", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "41", + "electron": "1.2" + }, + "es6.weak-set": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "53", + "safari": "9", + "node": "6.5", + "deno": "1", + "ios": "9", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "41", + "electron": "1.2" + } +} diff --git a/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json b/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json new file mode 100644 index 0000000..d03b698 --- /dev/null +++ b/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json @@ -0,0 +1,5 @@ +[ + "esnext.promise.all-settled", + "esnext.string.match-all", + "esnext.global-this" +] diff --git a/node_modules/@babel/compat-data/data/native-modules.json b/node_modules/@babel/compat-data/data/native-modules.json new file mode 100644 index 0000000..2328d21 --- /dev/null +++ b/node_modules/@babel/compat-data/data/native-modules.json @@ -0,0 +1,18 @@ +{ + "es6.module": { + "chrome": "61", + "and_chr": "61", + "edge": "16", + "firefox": "60", + "and_ff": "60", + "node": "13.2.0", + "opera": "48", + "op_mob": "45", + "safari": "10.1", + "ios": "10.3", + "samsung": "8.2", + "android": "61", + "electron": "2.0", + "ios_saf": "10.3" + } +} diff --git a/node_modules/@babel/compat-data/data/overlapping-plugins.json b/node_modules/@babel/compat-data/data/overlapping-plugins.json new file mode 100644 index 0000000..9b884bd --- /dev/null +++ b/node_modules/@babel/compat-data/data/overlapping-plugins.json @@ -0,0 +1,35 @@ +{ + "transform-async-to-generator": [ + "bugfix/transform-async-arrows-in-class" + ], + "transform-parameters": [ + "bugfix/transform-edge-default-parameters", + "bugfix/transform-safari-id-destructuring-collision-in-function-expression" + ], + "transform-function-name": [ + "bugfix/transform-edge-function-name" + ], + "transform-block-scoping": [ + "bugfix/transform-safari-block-shadowing", + "bugfix/transform-safari-for-shadowing" + ], + "transform-template-literals": [ + "bugfix/transform-tagged-template-caching" + ], + "transform-optional-chaining": [ + "bugfix/transform-v8-spread-parameters-in-optional-chaining" + ], + "proposal-optional-chaining": [ + "bugfix/transform-v8-spread-parameters-in-optional-chaining" + ], + "transform-class-properties": [ + "bugfix/transform-v8-static-class-fields-redefine-readonly", + "bugfix/transform-firefox-class-in-computed-class-key", + "bugfix/transform-safari-class-field-initializer-scope" + ], + "proposal-class-properties": [ + "bugfix/transform-v8-static-class-fields-redefine-readonly", + "bugfix/transform-firefox-class-in-computed-class-key", + "bugfix/transform-safari-class-field-initializer-scope" + ] +} diff --git a/node_modules/@babel/compat-data/data/plugin-bugfixes.json b/node_modules/@babel/compat-data/data/plugin-bugfixes.json new file mode 100644 index 0000000..3d1aed6 --- /dev/null +++ b/node_modules/@babel/compat-data/data/plugin-bugfixes.json @@ -0,0 +1,203 @@ +{ + "bugfix/transform-async-arrows-in-class": { + "chrome": "55", + "opera": "42", + "edge": "15", + "firefox": "52", + "safari": "11", + "node": "7.6", + "deno": "1", + "ios": "11", + "samsung": "6", + "opera_mobile": "42", + "electron": "1.6" + }, + "bugfix/transform-edge-default-parameters": { + "chrome": "49", + "opera": "36", + "edge": "18", + "firefox": "52", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "36", + "electron": "0.37" + }, + "bugfix/transform-edge-function-name": { + "chrome": "51", + "opera": "38", + "edge": "79", + "firefox": "53", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "bugfix/transform-safari-block-shadowing": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "44", + "safari": "11", + "node": "6", + "deno": "1", + "ie": "11", + "ios": "11", + "samsung": "5", + "opera_mobile": "36", + "electron": "0.37" + }, + "bugfix/transform-safari-for-shadowing": { + "chrome": "49", + "opera": "36", + "edge": "12", + "firefox": "4", + "safari": "11", + "node": "6", + "deno": "1", + "ie": "11", + "ios": "11", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "36", + "electron": "0.37" + }, + "bugfix/transform-safari-id-destructuring-collision-in-function-expression": { + "chrome": "49", + "opera": "36", + "edge": "14", + "firefox": "2", + "safari": "16.3", + "node": "6", + "deno": "1", + "ios": "16.3", + "samsung": "5", + "opera_mobile": "36", + "electron": "0.37" + }, + "bugfix/transform-tagged-template-caching": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "34", + "safari": "13", + "node": "4", + "deno": "1", + "ios": "13", + "samsung": "3.4", + "rhino": "1.7.14", + "opera_mobile": "28", + "electron": "0.21" + }, + "bugfix/transform-v8-spread-parameters-in-optional-chaining": { + "chrome": "91", + "opera": "77", + "edge": "91", + "firefox": "74", + "safari": "13.1", + "node": "16.9", + "deno": "1.9", + "ios": "13.4", + "samsung": "16", + "opera_mobile": "64", + "electron": "13.0" + }, + "transform-optional-chaining": { + "chrome": "80", + "opera": "67", + "edge": "80", + "firefox": "74", + "safari": "13.1", + "node": "14", + "deno": "1", + "ios": "13.4", + "samsung": "13", + "rhino": "1.8", + "opera_mobile": "57", + "electron": "8.0" + }, + "proposal-optional-chaining": { + "chrome": "80", + "opera": "67", + "edge": "80", + "firefox": "74", + "safari": "13.1", + "node": "14", + "deno": "1", + "ios": "13.4", + "samsung": "13", + "rhino": "1.8", + "opera_mobile": "57", + "electron": "8.0" + }, + "transform-parameters": { + "chrome": "49", + "opera": "36", + "edge": "15", + "firefox": "52", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "36", + "electron": "0.37" + }, + "transform-async-to-generator": { + "chrome": "55", + "opera": "42", + "edge": "15", + "firefox": "52", + "safari": "10.1", + "node": "7.6", + "deno": "1", + "ios": "10.3", + "samsung": "6", + "opera_mobile": "42", + "electron": "1.6" + }, + "transform-template-literals": { + "chrome": "41", + "opera": "28", + "edge": "13", + "firefox": "34", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "opera_mobile": "28", + "electron": "0.21" + }, + "transform-function-name": { + "chrome": "51", + "opera": "38", + "edge": "14", + "firefox": "53", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "transform-block-scoping": { + "chrome": "50", + "opera": "37", + "edge": "14", + "firefox": "53", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "37", + "electron": "1.1" + } +} diff --git a/node_modules/@babel/compat-data/data/plugins.json b/node_modules/@babel/compat-data/data/plugins.json new file mode 100644 index 0000000..c2ff459 --- /dev/null +++ b/node_modules/@babel/compat-data/data/plugins.json @@ -0,0 +1,838 @@ +{ + "transform-explicit-resource-management": { + "chrome": "134", + "edge": "134", + "firefox": "141", + "node": "24", + "electron": "35.0" + }, + "transform-duplicate-named-capturing-groups-regex": { + "chrome": "126", + "opera": "112", + "edge": "126", + "firefox": "129", + "safari": "17.4", + "node": "23", + "ios": "17.4", + "electron": "31.0" + }, + "transform-regexp-modifiers": { + "chrome": "125", + "opera": "111", + "edge": "125", + "firefox": "132", + "node": "23", + "samsung": "27", + "electron": "31.0" + }, + "transform-unicode-sets-regex": { + "chrome": "112", + "opera": "98", + "edge": "112", + "firefox": "116", + "safari": "17", + "node": "20", + "deno": "1.32", + "ios": "17", + "samsung": "23", + "opera_mobile": "75", + "electron": "24.0" + }, + "bugfix/transform-v8-static-class-fields-redefine-readonly": { + "chrome": "98", + "opera": "84", + "edge": "98", + "firefox": "75", + "safari": "15", + "node": "12", + "deno": "1.18", + "ios": "15", + "samsung": "11", + "opera_mobile": "52", + "electron": "17.0" + }, + "bugfix/transform-firefox-class-in-computed-class-key": { + "chrome": "74", + "opera": "62", + "edge": "79", + "firefox": "126", + "safari": "16", + "node": "12", + "deno": "1", + "ios": "16", + "samsung": "11", + "opera_mobile": "53", + "electron": "6.0" + }, + "bugfix/transform-safari-class-field-initializer-scope": { + "chrome": "74", + "opera": "62", + "edge": "79", + "firefox": "69", + "safari": "16", + "node": "12", + "deno": "1", + "ios": "16", + "samsung": "11", + "opera_mobile": "53", + "electron": "6.0" + }, + "transform-class-static-block": { + "chrome": "94", + "opera": "80", + "edge": "94", + "firefox": "93", + "safari": "16.4", + "node": "16.11", + "deno": "1.14", + "ios": "16.4", + "samsung": "17", + "opera_mobile": "66", + "electron": "15.0" + }, + "proposal-class-static-block": { + "chrome": "94", + "opera": "80", + "edge": "94", + "firefox": "93", + "safari": "16.4", + "node": "16.11", + "deno": "1.14", + "ios": "16.4", + "samsung": "17", + "opera_mobile": "66", + "electron": "15.0" + }, + "transform-private-property-in-object": { + "chrome": "91", + "opera": "77", + "edge": "91", + "firefox": "90", + "safari": "15", + "node": "16.9", + "deno": "1.9", + "ios": "15", + "samsung": "16", + "opera_mobile": "64", + "electron": "13.0" + }, + "proposal-private-property-in-object": { + "chrome": "91", + "opera": "77", + "edge": "91", + "firefox": "90", + "safari": "15", + "node": "16.9", + "deno": "1.9", + "ios": "15", + "samsung": "16", + "opera_mobile": "64", + "electron": "13.0" + }, + "transform-class-properties": { + "chrome": "74", + "opera": "62", + "edge": "79", + "firefox": "90", + "safari": "14.1", + "node": "12", + "deno": "1", + "ios": "14.5", + "samsung": "11", + "opera_mobile": "53", + "electron": "6.0" + }, + "proposal-class-properties": { + "chrome": "74", + "opera": "62", + "edge": "79", + "firefox": "90", + "safari": "14.1", + "node": "12", + "deno": "1", + "ios": "14.5", + "samsung": "11", + "opera_mobile": "53", + "electron": "6.0" + }, + "transform-private-methods": { + "chrome": "84", + "opera": "70", + "edge": "84", + "firefox": "90", + "safari": "15", + "node": "14.6", + "deno": "1", + "ios": "15", + "samsung": "14", + "opera_mobile": "60", + "electron": "10.0" + }, + "proposal-private-methods": { + "chrome": "84", + "opera": "70", + "edge": "84", + "firefox": "90", + "safari": "15", + "node": "14.6", + "deno": "1", + "ios": "15", + "samsung": "14", + "opera_mobile": "60", + "electron": "10.0" + }, + "transform-numeric-separator": { + "chrome": "75", + "opera": "62", + "edge": "79", + "firefox": "70", + "safari": "13", + "node": "12.5", + "deno": "1", + "ios": "13", + "samsung": "11", + "rhino": "1.7.14", + "opera_mobile": "54", + "electron": "6.0" + }, + "proposal-numeric-separator": { + "chrome": "75", + "opera": "62", + "edge": "79", + "firefox": "70", + "safari": "13", + "node": "12.5", + "deno": "1", + "ios": "13", + "samsung": "11", + "rhino": "1.7.14", + "opera_mobile": "54", + "electron": "6.0" + }, + "transform-logical-assignment-operators": { + "chrome": "85", + "opera": "71", + "edge": "85", + "firefox": "79", + "safari": "14", + "node": "15", + "deno": "1.2", + "ios": "14", + "samsung": "14", + "opera_mobile": "60", + "electron": "10.0" + }, + "proposal-logical-assignment-operators": { + "chrome": "85", + "opera": "71", + "edge": "85", + "firefox": "79", + "safari": "14", + "node": "15", + "deno": "1.2", + "ios": "14", + "samsung": "14", + "opera_mobile": "60", + "electron": "10.0" + }, + "transform-nullish-coalescing-operator": { + "chrome": "80", + "opera": "67", + "edge": "80", + "firefox": "72", + "safari": "13.1", + "node": "14", + "deno": "1", + "ios": "13.4", + "samsung": "13", + "rhino": "1.8", + "opera_mobile": "57", + "electron": "8.0" + }, + "proposal-nullish-coalescing-operator": { + "chrome": "80", + "opera": "67", + "edge": "80", + "firefox": "72", + "safari": "13.1", + "node": "14", + "deno": "1", + "ios": "13.4", + "samsung": "13", + "rhino": "1.8", + "opera_mobile": "57", + "electron": "8.0" + }, + "transform-optional-chaining": { + "chrome": "91", + "opera": "77", + "edge": "91", + "firefox": "74", + "safari": "13.1", + "node": "16.9", + "deno": "1.9", + "ios": "13.4", + "samsung": "16", + "opera_mobile": "64", + "electron": "13.0" + }, + "proposal-optional-chaining": { + "chrome": "91", + "opera": "77", + "edge": "91", + "firefox": "74", + "safari": "13.1", + "node": "16.9", + "deno": "1.9", + "ios": "13.4", + "samsung": "16", + "opera_mobile": "64", + "electron": "13.0" + }, + "transform-json-strings": { + "chrome": "66", + "opera": "53", + "edge": "79", + "firefox": "62", + "safari": "12", + "node": "10", + "deno": "1", + "ios": "12", + "samsung": "9", + "rhino": "1.7.14", + "opera_mobile": "47", + "electron": "3.0" + }, + "proposal-json-strings": { + "chrome": "66", + "opera": "53", + "edge": "79", + "firefox": "62", + "safari": "12", + "node": "10", + "deno": "1", + "ios": "12", + "samsung": "9", + "rhino": "1.7.14", + "opera_mobile": "47", + "electron": "3.0" + }, + "transform-optional-catch-binding": { + "chrome": "66", + "opera": "53", + "edge": "79", + "firefox": "58", + "safari": "11.1", + "node": "10", + "deno": "1", + "ios": "11.3", + "samsung": "9", + "opera_mobile": "47", + "electron": "3.0" + }, + "proposal-optional-catch-binding": { + "chrome": "66", + "opera": "53", + "edge": "79", + "firefox": "58", + "safari": "11.1", + "node": "10", + "deno": "1", + "ios": "11.3", + "samsung": "9", + "opera_mobile": "47", + "electron": "3.0" + }, + "transform-parameters": { + "chrome": "49", + "opera": "36", + "edge": "18", + "firefox": "52", + "safari": "16.3", + "node": "6", + "deno": "1", + "ios": "16.3", + "samsung": "5", + "opera_mobile": "36", + "electron": "0.37" + }, + "transform-async-generator-functions": { + "chrome": "63", + "opera": "50", + "edge": "79", + "firefox": "57", + "safari": "12", + "node": "10", + "deno": "1", + "ios": "12", + "samsung": "8", + "opera_mobile": "46", + "electron": "3.0" + }, + "proposal-async-generator-functions": { + "chrome": "63", + "opera": "50", + "edge": "79", + "firefox": "57", + "safari": "12", + "node": "10", + "deno": "1", + "ios": "12", + "samsung": "8", + "opera_mobile": "46", + "electron": "3.0" + }, + "transform-object-rest-spread": { + "chrome": "60", + "opera": "47", + "edge": "79", + "firefox": "55", + "safari": "11.1", + "node": "8.3", + "deno": "1", + "ios": "11.3", + "samsung": "8", + "opera_mobile": "44", + "electron": "2.0" + }, + "proposal-object-rest-spread": { + "chrome": "60", + "opera": "47", + "edge": "79", + "firefox": "55", + "safari": "11.1", + "node": "8.3", + "deno": "1", + "ios": "11.3", + "samsung": "8", + "opera_mobile": "44", + "electron": "2.0" + }, + "transform-dotall-regex": { + "chrome": "62", + "opera": "49", + "edge": "79", + "firefox": "78", + "safari": "11.1", + "node": "8.10", + "deno": "1", + "ios": "11.3", + "samsung": "8", + "rhino": "1.7.15", + "opera_mobile": "46", + "electron": "3.0" + }, + "transform-unicode-property-regex": { + "chrome": "64", + "opera": "51", + "edge": "79", + "firefox": "78", + "safari": "11.1", + "node": "10", + "deno": "1", + "ios": "11.3", + "samsung": "9", + "opera_mobile": "47", + "electron": "3.0" + }, + "proposal-unicode-property-regex": { + "chrome": "64", + "opera": "51", + "edge": "79", + "firefox": "78", + "safari": "11.1", + "node": "10", + "deno": "1", + "ios": "11.3", + "samsung": "9", + "opera_mobile": "47", + "electron": "3.0" + }, + "transform-named-capturing-groups-regex": { + "chrome": "64", + "opera": "51", + "edge": "79", + "firefox": "78", + "safari": "11.1", + "node": "10", + "deno": "1", + "ios": "11.3", + "samsung": "9", + "opera_mobile": "47", + "electron": "3.0" + }, + "transform-async-to-generator": { + "chrome": "55", + "opera": "42", + "edge": "15", + "firefox": "52", + "safari": "11", + "node": "7.6", + "deno": "1", + "ios": "11", + "samsung": "6", + "opera_mobile": "42", + "electron": "1.6" + }, + "transform-exponentiation-operator": { + "chrome": "52", + "opera": "39", + "edge": "14", + "firefox": "52", + "safari": "10.1", + "node": "7", + "deno": "1", + "ios": "10.3", + "samsung": "6", + "rhino": "1.7.14", + "opera_mobile": "41", + "electron": "1.3" + }, + "transform-template-literals": { + "chrome": "41", + "opera": "28", + "edge": "13", + "firefox": "34", + "safari": "13", + "node": "4", + "deno": "1", + "ios": "13", + "samsung": "3.4", + "opera_mobile": "28", + "electron": "0.21" + }, + "transform-literals": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "53", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.15", + "opera_mobile": "32", + "electron": "0.30" + }, + "transform-function-name": { + "chrome": "51", + "opera": "38", + "edge": "79", + "firefox": "53", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "transform-arrow-functions": { + "chrome": "47", + "opera": "34", + "edge": "13", + "firefox": "43", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.13", + "opera_mobile": "34", + "electron": "0.36" + }, + "transform-block-scoped-functions": { + "chrome": "41", + "opera": "28", + "edge": "12", + "firefox": "46", + "safari": "10", + "node": "4", + "deno": "1", + "ie": "11", + "ios": "10", + "samsung": "3.4", + "opera_mobile": "28", + "electron": "0.21" + }, + "transform-classes": { + "chrome": "46", + "opera": "33", + "edge": "13", + "firefox": "45", + "safari": "10", + "node": "5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "33", + "electron": "0.36" + }, + "transform-object-super": { + "chrome": "46", + "opera": "33", + "edge": "13", + "firefox": "45", + "safari": "10", + "node": "5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "33", + "electron": "0.36" + }, + "transform-shorthand-properties": { + "chrome": "43", + "opera": "30", + "edge": "12", + "firefox": "33", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.14", + "opera_mobile": "30", + "electron": "0.27" + }, + "transform-duplicate-keys": { + "chrome": "42", + "opera": "29", + "edge": "12", + "firefox": "34", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "3.4", + "opera_mobile": "29", + "electron": "0.25" + }, + "transform-computed-properties": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "34", + "safari": "7.1", + "node": "4", + "deno": "1", + "ios": "8", + "samsung": "4", + "rhino": "1.8", + "opera_mobile": "32", + "electron": "0.30" + }, + "transform-for-of": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "53", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "transform-sticky-regex": { + "chrome": "49", + "opera": "36", + "edge": "13", + "firefox": "3", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "rhino": "1.7.15", + "opera_mobile": "36", + "electron": "0.37" + }, + "transform-unicode-escapes": { + "chrome": "44", + "opera": "31", + "edge": "12", + "firefox": "53", + "safari": "9", + "node": "4", + "deno": "1", + "ios": "9", + "samsung": "4", + "rhino": "1.7.15", + "opera_mobile": "32", + "electron": "0.30" + }, + "transform-unicode-regex": { + "chrome": "50", + "opera": "37", + "edge": "13", + "firefox": "46", + "safari": "12", + "node": "6", + "deno": "1", + "ios": "12", + "samsung": "5", + "opera_mobile": "37", + "electron": "1.1" + }, + "transform-spread": { + "chrome": "46", + "opera": "33", + "edge": "13", + "firefox": "45", + "safari": "10", + "node": "5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "33", + "electron": "0.36" + }, + "transform-destructuring": { + "chrome": "51", + "opera": "38", + "edge": "15", + "firefox": "53", + "safari": "10", + "node": "6.5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "41", + "electron": "1.2" + }, + "transform-block-scoping": { + "chrome": "50", + "opera": "37", + "edge": "14", + "firefox": "53", + "safari": "11", + "node": "6", + "deno": "1", + "ios": "11", + "samsung": "5", + "opera_mobile": "37", + "electron": "1.1" + }, + "transform-typeof-symbol": { + "chrome": "48", + "opera": "35", + "edge": "12", + "firefox": "36", + "safari": "9", + "node": "6", + "deno": "1", + "ios": "9", + "samsung": "5", + "rhino": "1.8", + "opera_mobile": "35", + "electron": "0.37" + }, + "transform-new-target": { + "chrome": "46", + "opera": "33", + "edge": "14", + "firefox": "41", + "safari": "10", + "node": "5", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "33", + "electron": "0.36" + }, + "transform-regenerator": { + "chrome": "50", + "opera": "37", + "edge": "13", + "firefox": "53", + "safari": "10", + "node": "6", + "deno": "1", + "ios": "10", + "samsung": "5", + "opera_mobile": "37", + "electron": "1.1" + }, + "transform-member-expression-literals": { + "chrome": "7", + "opera": "12", + "edge": "12", + "firefox": "2", + "safari": "5.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12", + "electron": "0.20" + }, + "transform-property-literals": { + "chrome": "7", + "opera": "12", + "edge": "12", + "firefox": "2", + "safari": "5.1", + "node": "0.4", + "deno": "1", + "ie": "9", + "android": "4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "12", + "electron": "0.20" + }, + "transform-reserved-words": { + "chrome": "13", + "opera": "10.50", + "edge": "12", + "firefox": "2", + "safari": "3.1", + "node": "0.6", + "deno": "1", + "ie": "9", + "android": "4.4", + "ios": "6", + "phantom": "1.9", + "samsung": "1", + "rhino": "1.7.13", + "opera_mobile": "10.1", + "electron": "0.20" + }, + "transform-export-namespace-from": { + "chrome": "72", + "deno": "1.0", + "edge": "79", + "firefox": "80", + "node": "13.2.0", + "opera": "60", + "opera_mobile": "51", + "safari": "14.1", + "ios": "14.5", + "samsung": "11.0", + "android": "72", + "electron": "5.0" + }, + "proposal-export-namespace-from": { + "chrome": "72", + "deno": "1.0", + "edge": "79", + "firefox": "80", + "node": "13.2.0", + "opera": "60", + "opera_mobile": "51", + "safari": "14.1", + "ios": "14.5", + "samsung": "11.0", + "android": "72", + "electron": "5.0" + } +} diff --git a/node_modules/@babel/compat-data/native-modules.js b/node_modules/@babel/compat-data/native-modules.js new file mode 100644 index 0000000..f8c25fa --- /dev/null +++ b/node_modules/@babel/compat-data/native-modules.js @@ -0,0 +1,2 @@ +// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly +module.exports = require("./data/native-modules.json"); diff --git a/node_modules/@babel/compat-data/overlapping-plugins.js b/node_modules/@babel/compat-data/overlapping-plugins.js new file mode 100644 index 0000000..0dd35f1 --- /dev/null +++ b/node_modules/@babel/compat-data/overlapping-plugins.js @@ -0,0 +1,2 @@ +// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly +module.exports = require("./data/overlapping-plugins.json"); diff --git a/node_modules/@babel/compat-data/package.json b/node_modules/@babel/compat-data/package.json new file mode 100644 index 0000000..d3a7bc0 --- /dev/null +++ b/node_modules/@babel/compat-data/package.json @@ -0,0 +1,40 @@ +{ + "name": "@babel/compat-data", + "version": "7.28.5", + "author": "The Babel Team (https://babel.dev/team)", + "license": "MIT", + "description": "The compat-data to determine required Babel plugins", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-compat-data" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + "./plugins": "./plugins.js", + "./native-modules": "./native-modules.js", + "./corejs2-built-ins": "./corejs2-built-ins.js", + "./corejs3-shipped-proposals": "./corejs3-shipped-proposals.js", + "./overlapping-plugins": "./overlapping-plugins.js", + "./plugin-bugfixes": "./plugin-bugfixes.js" + }, + "scripts": { + "build-data": "./scripts/download-compat-table.sh && node ./scripts/build-data.mjs && node ./scripts/build-modules-support.mjs && node ./scripts/build-bugfixes-targets.mjs" + }, + "keywords": [ + "babel", + "compat-table", + "compat-data" + ], + "devDependencies": { + "@mdn/browser-compat-data": "^6.0.8", + "core-js-compat": "^3.43.0", + "electron-to-chromium": "^1.5.140" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/compat-data/plugin-bugfixes.js b/node_modules/@babel/compat-data/plugin-bugfixes.js new file mode 100644 index 0000000..9aaf364 --- /dev/null +++ b/node_modules/@babel/compat-data/plugin-bugfixes.js @@ -0,0 +1,2 @@ +// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly +module.exports = require("./data/plugin-bugfixes.json"); diff --git a/node_modules/@babel/compat-data/plugins.js b/node_modules/@babel/compat-data/plugins.js new file mode 100644 index 0000000..b191017 --- /dev/null +++ b/node_modules/@babel/compat-data/plugins.js @@ -0,0 +1,2 @@ +// Todo (Babel 8): remove this file, in Babel 8 users import the .json directly +module.exports = require("./data/plugins.json"); diff --git a/node_modules/@babel/core/LICENSE b/node_modules/@babel/core/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/core/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/core/README.md b/node_modules/@babel/core/README.md new file mode 100644 index 0000000..2903543 --- /dev/null +++ b/node_modules/@babel/core/README.md @@ -0,0 +1,19 @@ +# @babel/core + +> Babel compiler core. + +See our website [@babel/core](https://babeljs.io/docs/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/core +``` + +or using yarn: + +```sh +yarn add @babel/core --dev +``` diff --git a/node_modules/@babel/core/lib/config/cache-contexts.js b/node_modules/@babel/core/lib/config/cache-contexts.js new file mode 100644 index 0000000..f2ececd --- /dev/null +++ b/node_modules/@babel/core/lib/config/cache-contexts.js @@ -0,0 +1,5 @@ +"use strict"; + +0 && 0; + +//# sourceMappingURL=cache-contexts.js.map diff --git a/node_modules/@babel/core/lib/config/cache-contexts.js.map b/node_modules/@babel/core/lib/config/cache-contexts.js.map new file mode 100644 index 0000000..b151653 --- /dev/null +++ b/node_modules/@babel/core/lib/config/cache-contexts.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sources":["../../src/config/cache-contexts.ts"],"sourcesContent":["import type { ConfigContext } from \"./config-chain.ts\";\nimport type {\n CallerMetadata,\n TargetsListOrObject,\n} from \"./validation/options.ts\";\n\nexport type { ConfigContext as FullConfig };\n\nexport type FullPreset = {\n targets: TargetsListOrObject;\n} & ConfigContext;\nexport type FullPlugin = {\n assumptions: { [name: string]: boolean };\n} & FullPreset;\n\n// Context not including filename since it is used in places that cannot\n// process 'ignore'/'only' and other filename-based logic.\nexport type SimpleConfig = {\n envName: string;\n caller: CallerMetadata | undefined;\n};\nexport type SimplePreset = {\n targets: TargetsListOrObject;\n} & SimpleConfig;\nexport type SimplePlugin = {\n assumptions: {\n [name: string]: boolean;\n };\n} & SimplePreset;\n"],"mappings":"","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/caching.js b/node_modules/@babel/core/lib/config/caching.js new file mode 100644 index 0000000..344c839 --- /dev/null +++ b/node_modules/@babel/core/lib/config/caching.js @@ -0,0 +1,261 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.assertSimpleType = assertSimpleType; +exports.makeStrongCache = makeStrongCache; +exports.makeStrongCacheSync = makeStrongCacheSync; +exports.makeWeakCache = makeWeakCache; +exports.makeWeakCacheSync = makeWeakCacheSync; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _async = require("../gensync-utils/async.js"); +var _util = require("./util.js"); +const synchronize = gen => { + return _gensync()(gen).sync; +}; +function* genTrue() { + return true; +} +function makeWeakCache(handler) { + return makeCachedFunction(WeakMap, handler); +} +function makeWeakCacheSync(handler) { + return synchronize(makeWeakCache(handler)); +} +function makeStrongCache(handler) { + return makeCachedFunction(Map, handler); +} +function makeStrongCacheSync(handler) { + return synchronize(makeStrongCache(handler)); +} +function makeCachedFunction(CallCache, handler) { + const callCacheSync = new CallCache(); + const callCacheAsync = new CallCache(); + const futureCache = new CallCache(); + return function* cachedFunction(arg, data) { + const asyncContext = yield* (0, _async.isAsync)(); + const callCache = asyncContext ? callCacheAsync : callCacheSync; + const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data); + if (cached.valid) return cached.value; + const cache = new CacheConfigurator(data); + const handlerResult = handler(arg, cache); + let finishLock; + let value; + if ((0, _util.isIterableIterator)(handlerResult)) { + value = yield* (0, _async.onFirstPause)(handlerResult, () => { + finishLock = setupAsyncLocks(cache, futureCache, arg); + }); + } else { + value = handlerResult; + } + updateFunctionCache(callCache, cache, arg, value); + if (finishLock) { + futureCache.delete(arg); + finishLock.release(value); + } + return value; + }; +} +function* getCachedValue(cache, arg, data) { + const cachedValue = cache.get(arg); + if (cachedValue) { + for (const { + value, + valid + } of cachedValue) { + if (yield* valid(data)) return { + valid: true, + value + }; + } + } + return { + valid: false, + value: null + }; +} +function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) { + const cached = yield* getCachedValue(callCache, arg, data); + if (cached.valid) { + return cached; + } + if (asyncContext) { + const cached = yield* getCachedValue(futureCache, arg, data); + if (cached.valid) { + const value = yield* (0, _async.waitFor)(cached.value.promise); + return { + valid: true, + value + }; + } + } + return { + valid: false, + value: null + }; +} +function setupAsyncLocks(config, futureCache, arg) { + const finishLock = new Lock(); + updateFunctionCache(futureCache, config, arg, finishLock); + return finishLock; +} +function updateFunctionCache(cache, config, arg, value) { + if (!config.configured()) config.forever(); + let cachedValue = cache.get(arg); + config.deactivate(); + switch (config.mode()) { + case "forever": + cachedValue = [{ + value, + valid: genTrue + }]; + cache.set(arg, cachedValue); + break; + case "invalidate": + cachedValue = [{ + value, + valid: config.validator() + }]; + cache.set(arg, cachedValue); + break; + case "valid": + if (cachedValue) { + cachedValue.push({ + value, + valid: config.validator() + }); + } else { + cachedValue = [{ + value, + valid: config.validator() + }]; + cache.set(arg, cachedValue); + } + } +} +class CacheConfigurator { + constructor(data) { + this._active = true; + this._never = false; + this._forever = false; + this._invalidate = false; + this._configured = false; + this._pairs = []; + this._data = void 0; + this._data = data; + } + simple() { + return makeSimpleConfigurator(this); + } + mode() { + if (this._never) return "never"; + if (this._forever) return "forever"; + if (this._invalidate) return "invalidate"; + return "valid"; + } + forever() { + if (!this._active) { + throw new Error("Cannot change caching after evaluation has completed."); + } + if (this._never) { + throw new Error("Caching has already been configured with .never()"); + } + this._forever = true; + this._configured = true; + } + never() { + if (!this._active) { + throw new Error("Cannot change caching after evaluation has completed."); + } + if (this._forever) { + throw new Error("Caching has already been configured with .forever()"); + } + this._never = true; + this._configured = true; + } + using(handler) { + if (!this._active) { + throw new Error("Cannot change caching after evaluation has completed."); + } + if (this._never || this._forever) { + throw new Error("Caching has already been configured with .never or .forever()"); + } + this._configured = true; + const key = handler(this._data); + const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`); + if ((0, _async.isThenable)(key)) { + return key.then(key => { + this._pairs.push([key, fn]); + return key; + }); + } + this._pairs.push([key, fn]); + return key; + } + invalidate(handler) { + this._invalidate = true; + return this.using(handler); + } + validator() { + const pairs = this._pairs; + return function* (data) { + for (const [key, fn] of pairs) { + if (key !== (yield* fn(data))) return false; + } + return true; + }; + } + deactivate() { + this._active = false; + } + configured() { + return this._configured; + } +} +function makeSimpleConfigurator(cache) { + function cacheFn(val) { + if (typeof val === "boolean") { + if (val) cache.forever();else cache.never(); + return; + } + return cache.using(() => assertSimpleType(val())); + } + cacheFn.forever = () => cache.forever(); + cacheFn.never = () => cache.never(); + cacheFn.using = cb => cache.using(() => assertSimpleType(cb())); + cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb())); + return cacheFn; +} +function assertSimpleType(value) { + if ((0, _async.isThenable)(value)) { + throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`); + } + if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") { + throw new Error("Cache keys must be either string, boolean, number, null, or undefined."); + } + return value; +} +class Lock { + constructor() { + this.released = false; + this.promise = void 0; + this._resolve = void 0; + this.promise = new Promise(resolve => { + this._resolve = resolve; + }); + } + release(value) { + this.released = true; + this._resolve(value); + } +} +0 && 0; + +//# sourceMappingURL=caching.js.map diff --git a/node_modules/@babel/core/lib/config/caching.js.map b/node_modules/@babel/core/lib/config/caching.js.map new file mode 100644 index 0000000..333f0bb --- /dev/null +++ b/node_modules/@babel/core/lib/config/caching.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_async","_util","synchronize","gen","gensync","sync","genTrue","makeWeakCache","handler","makeCachedFunction","WeakMap","makeWeakCacheSync","makeStrongCache","Map","makeStrongCacheSync","CallCache","callCacheSync","callCacheAsync","futureCache","cachedFunction","arg","asyncContext","isAsync","callCache","cached","getCachedValueOrWait","valid","value","cache","CacheConfigurator","handlerResult","finishLock","isIterableIterator","onFirstPause","setupAsyncLocks","updateFunctionCache","delete","release","getCachedValue","cachedValue","get","waitFor","promise","config","Lock","configured","forever","deactivate","mode","set","validator","push","constructor","_active","_never","_forever","_invalidate","_configured","_pairs","_data","simple","makeSimpleConfigurator","Error","never","using","key","fn","maybeAsync","isThenable","then","invalidate","pairs","cacheFn","val","assertSimpleType","cb","released","_resolve","Promise","resolve"],"sources":["../../src/config/caching.ts"],"sourcesContent":["import gensync from \"gensync\";\nimport type { Handler } from \"gensync\";\nimport {\n maybeAsync,\n isAsync,\n onFirstPause,\n waitFor,\n isThenable,\n} from \"../gensync-utils/async.ts\";\nimport { isIterableIterator } from \"./util.ts\";\n\nexport type { CacheConfigurator };\n\nexport type SimpleCacheConfigurator = {\n (forever: boolean): void;\n (handler: () => T): T;\n\n forever: () => void;\n never: () => void;\n using: (handler: () => T) => T;\n invalidate: (handler: () => T) => T;\n};\n\nexport type CacheEntry = Array<{\n value: ResultT;\n valid: (channel: SideChannel) => Handler;\n}>;\n\nconst synchronize = (\n gen: (...args: ArgsT) => Handler,\n): ((...args: ArgsT) => ResultT) => {\n return gensync(gen).sync;\n};\n\n// eslint-disable-next-line require-yield\nfunction* genTrue() {\n return true;\n}\n\nexport function makeWeakCache(\n handler: (\n arg: ArgT,\n cache: CacheConfigurator,\n ) => Handler | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler {\n return makeCachedFunction(WeakMap, handler);\n}\n\nexport function makeWeakCacheSync(\n handler: (arg: ArgT, cache?: CacheConfigurator) => ResultT,\n): (arg: ArgT, data?: SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeWeakCache(handler),\n );\n}\n\nexport function makeStrongCache(\n handler: (\n arg: ArgT,\n cache: CacheConfigurator,\n ) => Handler | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler {\n return makeCachedFunction(Map, handler);\n}\n\nexport function makeStrongCacheSync(\n handler: (arg: ArgT, cache?: CacheConfigurator) => ResultT,\n): (arg: ArgT, data?: SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeStrongCache(handler),\n );\n}\n\n/* NOTE: Part of the logic explained in this comment is explained in the\n * getCachedValueOrWait and setupAsyncLocks functions.\n *\n * > There are only two hard things in Computer Science: cache invalidation and naming things.\n * > -- Phil Karlton\n *\n * I don't know if Phil was also thinking about handling a cache whose invalidation function is\n * defined asynchronously is considered, but it is REALLY hard to do correctly.\n *\n * The implemented logic (only when gensync is run asynchronously) is the following:\n * 1. If there is a valid cache associated to the current \"arg\" parameter,\n * a. RETURN the cached value\n * 3. If there is a FinishLock associated to the current \"arg\" parameter representing a valid cache,\n * a. Wait for that lock to be released\n * b. RETURN the value associated with that lock\n * 5. Start executing the function to be cached\n * a. If it pauses on a promise, then\n * i. Let FinishLock be a new lock\n * ii. Store FinishLock as associated to the current \"arg\" parameter\n * iii. Wait for the function to finish executing\n * iv. Release FinishLock\n * v. Send the function result to anyone waiting on FinishLock\n * 6. Store the result in the cache\n * 7. RETURN the result\n */\nfunction makeCachedFunction(\n CallCache: new () => CacheMap,\n handler: (\n arg: ArgT,\n cache: CacheConfigurator,\n ) => Handler | ResultT,\n): (arg: ArgT, data: SideChannel) => Handler {\n const callCacheSync = new CallCache();\n const callCacheAsync = new CallCache();\n const futureCache = new CallCache>();\n\n return function* cachedFunction(arg: ArgT, data: SideChannel) {\n const asyncContext = yield* isAsync();\n const callCache = asyncContext ? callCacheAsync : callCacheSync;\n\n const cached = yield* getCachedValueOrWait(\n asyncContext,\n callCache,\n futureCache,\n arg,\n data,\n );\n if (cached.valid) return cached.value;\n\n const cache = new CacheConfigurator(data);\n\n const handlerResult: Handler | ResultT = handler(arg, cache);\n\n let finishLock: Lock;\n let value: ResultT;\n\n if (isIterableIterator(handlerResult)) {\n value = yield* onFirstPause(handlerResult, () => {\n finishLock = setupAsyncLocks(cache, futureCache, arg);\n });\n } else {\n value = handlerResult;\n }\n\n updateFunctionCache(callCache, cache, arg, value);\n\n if (finishLock) {\n futureCache.delete(arg);\n finishLock.release(value);\n }\n\n return value;\n };\n}\n\ntype CacheMap =\n | Map>\n // @ts-expect-error todo(flow->ts): add `extends object` constraint to ArgT\n | WeakMap>;\n\nfunction* getCachedValue(\n cache: CacheMap,\n arg: ArgT,\n data: SideChannel,\n): Handler<{ valid: true; value: ResultT } | { valid: false; value: null }> {\n const cachedValue: CacheEntry | void = cache.get(arg);\n\n if (cachedValue) {\n for (const { value, valid } of cachedValue) {\n if (yield* valid(data)) return { valid: true, value };\n }\n }\n\n return { valid: false, value: null };\n}\n\nfunction* getCachedValueOrWait(\n asyncContext: boolean,\n callCache: CacheMap,\n futureCache: CacheMap, SideChannel>,\n arg: ArgT,\n data: SideChannel,\n): Handler<{ valid: true; value: ResultT } | { valid: false; value: null }> {\n const cached = yield* getCachedValue(callCache, arg, data);\n if (cached.valid) {\n return cached;\n }\n\n if (asyncContext) {\n const cached = yield* getCachedValue(futureCache, arg, data);\n if (cached.valid) {\n const value = yield* waitFor(cached.value.promise);\n return { valid: true, value };\n }\n }\n\n return { valid: false, value: null };\n}\n\nfunction setupAsyncLocks(\n config: CacheConfigurator,\n futureCache: CacheMap, SideChannel>,\n arg: ArgT,\n): Lock {\n const finishLock = new Lock();\n\n updateFunctionCache(futureCache, config, arg, finishLock);\n\n return finishLock;\n}\n\nfunction updateFunctionCache<\n ArgT,\n ResultT,\n SideChannel,\n Cache extends CacheMap,\n>(\n cache: Cache,\n config: CacheConfigurator,\n arg: ArgT,\n value: ResultT,\n) {\n if (!config.configured()) config.forever();\n\n let cachedValue: CacheEntry | void = cache.get(arg);\n\n config.deactivate();\n\n switch (config.mode()) {\n case \"forever\":\n cachedValue = [{ value, valid: genTrue }];\n cache.set(arg, cachedValue);\n break;\n case \"invalidate\":\n cachedValue = [{ value, valid: config.validator() }];\n cache.set(arg, cachedValue);\n break;\n case \"valid\":\n if (cachedValue) {\n cachedValue.push({ value, valid: config.validator() });\n } else {\n cachedValue = [{ value, valid: config.validator() }];\n cache.set(arg, cachedValue);\n }\n }\n}\n\nclass CacheConfigurator {\n _active: boolean = true;\n _never: boolean = false;\n _forever: boolean = false;\n _invalidate: boolean = false;\n\n _configured: boolean = false;\n\n _pairs: Array<\n [cachedValue: unknown, handler: (data: SideChannel) => Handler]\n > = [];\n\n _data: SideChannel;\n\n constructor(data: SideChannel) {\n this._data = data;\n }\n\n simple() {\n return makeSimpleConfigurator(this);\n }\n\n mode() {\n if (this._never) return \"never\";\n if (this._forever) return \"forever\";\n if (this._invalidate) return \"invalidate\";\n return \"valid\";\n }\n\n forever() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._never) {\n throw new Error(\"Caching has already been configured with .never()\");\n }\n this._forever = true;\n this._configured = true;\n }\n\n never() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._forever) {\n throw new Error(\"Caching has already been configured with .forever()\");\n }\n this._never = true;\n this._configured = true;\n }\n\n using(handler: (data: SideChannel) => T): T {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._never || this._forever) {\n throw new Error(\n \"Caching has already been configured with .never or .forever()\",\n );\n }\n this._configured = true;\n\n const key = handler(this._data);\n\n const fn = maybeAsync(\n handler,\n `You appear to be using an async cache handler, but Babel has been called synchronously`,\n );\n\n if (isThenable(key)) {\n // @ts-expect-error todo(flow->ts): improve function return type annotation\n return key.then((key: unknown) => {\n this._pairs.push([key, fn]);\n return key;\n });\n }\n\n this._pairs.push([key, fn]);\n return key;\n }\n\n invalidate(handler: (data: SideChannel) => T): T {\n this._invalidate = true;\n return this.using(handler);\n }\n\n validator(): (data: SideChannel) => Handler {\n const pairs = this._pairs;\n return function* (data: SideChannel) {\n for (const [key, fn] of pairs) {\n if (key !== (yield* fn(data))) return false;\n }\n return true;\n };\n }\n\n deactivate() {\n this._active = false;\n }\n\n configured() {\n return this._configured;\n }\n}\n\nfunction makeSimpleConfigurator(\n cache: CacheConfigurator,\n): SimpleCacheConfigurator {\n function cacheFn(val: any) {\n if (typeof val === \"boolean\") {\n if (val) cache.forever();\n else cache.never();\n return;\n }\n\n return cache.using(() => assertSimpleType(val()));\n }\n cacheFn.forever = () => cache.forever();\n cacheFn.never = () => cache.never();\n cacheFn.using = (cb: () => SimpleType) =>\n cache.using(() => assertSimpleType(cb()));\n cacheFn.invalidate = (cb: () => SimpleType) =>\n cache.invalidate(() => assertSimpleType(cb()));\n\n return cacheFn as any;\n}\n\n// Types are limited here so that in the future these values can be used\n// as part of Babel's caching logic.\nexport type SimpleType =\n | string\n | boolean\n | number\n | null\n | void\n | Promise;\nexport function assertSimpleType(value: unknown): SimpleType {\n if (isThenable(value)) {\n throw new Error(\n `You appear to be using an async cache handler, ` +\n `which your current version of Babel does not support. ` +\n `We may add support for this in the future, ` +\n `but if you're on the most recent version of @babel/core and still ` +\n `seeing this error, then you'll need to synchronously handle your caching logic.`,\n );\n }\n\n if (\n value != null &&\n typeof value !== \"string\" &&\n typeof value !== \"boolean\" &&\n typeof value !== \"number\"\n ) {\n throw new Error(\n \"Cache keys must be either string, boolean, number, null, or undefined.\",\n );\n }\n // @ts-expect-error Type 'unknown' is not assignable to type 'SimpleType'. This can be removed\n // when strictNullCheck is enabled\n return value;\n}\n\nclass Lock {\n released: boolean = false;\n promise: Promise;\n _resolve: (value: T) => void;\n\n constructor() {\n this.promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n }\n\n release(value: T) {\n this.released = true;\n this._resolve(value);\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AAmBA,MAAMG,WAAW,GACfC,GAAyC,IACP;EAClC,OAAOC,SAAMA,CAAC,CAACD,GAAG,CAAC,CAACE,IAAI;AAC1B,CAAC;AAGD,UAAUC,OAAOA,CAAA,EAAG;EAClB,OAAO,IAAI;AACb;AAEO,SAASC,aAAaA,CAC3BC,OAG+B,EACqB;EACpD,OAAOC,kBAAkB,CAA6BC,OAAO,EAAEF,OAAO,CAAC;AACzE;AAEO,SAASG,iBAAiBA,CAC/BH,OAAuE,E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IAAImC,KAAK,CACb,wEACF,CAAC;EACH;EAGA,OAAOnC,KAAK;AACd;AAEA,MAAMiB,IAAI,CAAI;EAKZQ,WAAWA,CAAA,EAAG;IAAA,KAJdwB,QAAQ,GAAY,KAAK;IAAA,KACzBlC,OAAO;IAAA,KACPmC,QAAQ;IAGN,IAAI,CAACnC,OAAO,GAAG,IAAIoC,OAAO,CAACC,OAAO,IAAI;MACpC,IAAI,CAACF,QAAQ,GAAGE,OAAO;IACzB,CAAC,CAAC;EACJ;EAEA1C,OAAOA,CAACV,KAAQ,EAAE;IAChB,IAAI,CAACiD,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,QAAQ,CAAClD,KAAK,CAAC;EACtB;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/config-chain.js b/node_modules/@babel/core/lib/config/config-chain.js new file mode 100644 index 0000000..5fded8e --- /dev/null +++ b/node_modules/@babel/core/lib/config/config-chain.js @@ -0,0 +1,469 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildPresetChain = buildPresetChain; +exports.buildPresetChainWalker = void 0; +exports.buildRootChain = buildRootChain; +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +function _debug() { + const data = require("debug"); + _debug = function () { + return data; + }; + return data; +} +var _options = require("./validation/options.js"); +var _patternToRegex = require("./pattern-to-regex.js"); +var _printer = require("./printer.js"); +var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js"); +var _configError = require("../errors/config-error.js"); +var _index = require("./files/index.js"); +var _caching = require("./caching.js"); +var _configDescriptors = require("./config-descriptors.js"); +const debug = _debug()("babel:config:config-chain"); +function* buildPresetChain(arg, context) { + const chain = yield* buildPresetChainWalker(arg, context); + if (!chain) return null; + return { + plugins: dedupDescriptors(chain.plugins), + presets: dedupDescriptors(chain.presets), + options: chain.options.map(o => createConfigChainOptions(o)), + files: new Set() + }; +} +const buildPresetChainWalker = exports.buildPresetChainWalker = makeChainWalker({ + root: preset => loadPresetDescriptors(preset), + env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), + overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), + overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName), + createLogger: () => () => {} +}); +const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors)); +const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName))); +const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index))); +const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName)))); +function* buildRootChain(opts, context) { + let configReport, babelRcReport; + const programmaticLogger = new _printer.ConfigPrinter(); + const programmaticChain = yield* loadProgrammaticChain({ + options: opts, + dirname: context.cwd + }, context, undefined, programmaticLogger); + if (!programmaticChain) return null; + const programmaticReport = yield* programmaticLogger.output(); + let configFile; + if (typeof opts.configFile === "string") { + configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller); + } else if (opts.configFile !== false) { + configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller); + } + let { + babelrc, + babelrcRoots + } = opts; + let babelrcRootsDirectory = context.cwd; + const configFileChain = emptyChain(); + const configFileLogger = new _printer.ConfigPrinter(); + if (configFile) { + const validatedFile = validateConfigFile(configFile); + const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger); + if (!result) return null; + configReport = yield* configFileLogger.output(); + if (babelrc === undefined) { + babelrc = validatedFile.options.babelrc; + } + if (babelrcRoots === undefined) { + babelrcRootsDirectory = validatedFile.dirname; + babelrcRoots = validatedFile.options.babelrcRoots; + } + mergeChain(configFileChain, result); + } + let ignoreFile, babelrcFile; + let isIgnored = false; + const fileChain = emptyChain(); + if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") { + const pkgData = yield* (0, _index.findPackageData)(context.filename); + if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) { + ({ + ignore: ignoreFile, + config: babelrcFile + } = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller)); + if (ignoreFile) { + fileChain.files.add(ignoreFile.filepath); + } + if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) { + isIgnored = true; + } + if (babelrcFile && !isIgnored) { + const validatedFile = validateBabelrcFile(babelrcFile); + const babelrcLogger = new _printer.ConfigPrinter(); + const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger); + if (!result) { + isIgnored = true; + } else { + babelRcReport = yield* babelrcLogger.output(); + mergeChain(fileChain, result); + } + } + if (babelrcFile && isIgnored) { + fileChain.files.add(babelrcFile.filepath); + } + } + } + if (context.showConfig) { + console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----"); + } + const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain); + return { + plugins: isIgnored ? [] : dedupDescriptors(chain.plugins), + presets: isIgnored ? [] : dedupDescriptors(chain.presets), + options: isIgnored ? [] : chain.options.map(o => createConfigChainOptions(o)), + fileHandling: isIgnored ? "ignored" : "transpile", + ignore: ignoreFile || undefined, + babelrc: babelrcFile || undefined, + config: configFile || undefined, + files: chain.files + }; +} +function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) { + if (typeof babelrcRoots === "boolean") return babelrcRoots; + const absoluteRoot = context.root; + if (babelrcRoots === undefined) { + return pkgData.directories.includes(absoluteRoot); + } + let babelrcPatterns = babelrcRoots; + if (!Array.isArray(babelrcPatterns)) { + babelrcPatterns = [babelrcPatterns]; + } + babelrcPatterns = babelrcPatterns.map(pat => { + return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat; + }); + if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) { + return pkgData.directories.includes(absoluteRoot); + } + return babelrcPatterns.some(pat => { + if (typeof pat === "string") { + pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory); + } + return pkgData.directories.some(directory => { + return matchPattern(pat, babelrcRootsDirectory, directory, context); + }); + }); +} +const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({ + filepath: file.filepath, + dirname: file.dirname, + options: (0, _options.validate)("configfile", file.options, file.filepath) +})); +const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({ + filepath: file.filepath, + dirname: file.dirname, + options: (0, _options.validate)("babelrcfile", file.options, file.filepath) +})); +const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({ + filepath: file.filepath, + dirname: file.dirname, + options: (0, _options.validate)("extendsfile", file.options, file.filepath) +})); +const loadProgrammaticChain = makeChainWalker({ + root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors), + env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName), + overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index), + overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName), + createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger) +}); +const loadFileChainWalker = makeChainWalker({ + root: file => loadFileDescriptors(file), + env: (file, envName) => loadFileEnvDescriptors(file)(envName), + overrides: (file, index) => loadFileOverridesDescriptors(file)(index), + overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName), + createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger) +}); +function* loadFileChain(input, context, files, baseLogger) { + const chain = yield* loadFileChainWalker(input, context, files, baseLogger); + chain == null || chain.files.add(input.filepath); + return chain; +} +const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors)); +const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName))); +const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index))); +const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName)))); +function buildFileLogger(filepath, context, baseLogger) { + if (!baseLogger) { + return () => {}; + } + return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, { + filepath + }); +} +function buildRootDescriptors({ + dirname, + options +}, alias, descriptors) { + return descriptors(dirname, options, alias); +} +function buildProgrammaticLogger(_, context, baseLogger) { + var _context$caller; + if (!baseLogger) { + return () => {}; + } + return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, { + callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name + }); +} +function buildEnvDescriptors({ + dirname, + options +}, alias, descriptors, envName) { + var _options$env; + const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName]; + return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null; +} +function buildOverrideDescriptors({ + dirname, + options +}, alias, descriptors, index) { + var _options$overrides; + const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index]; + if (!opts) throw new Error("Assertion failure - missing override"); + return descriptors(dirname, opts, `${alias}.overrides[${index}]`); +} +function buildOverrideEnvDescriptors({ + dirname, + options +}, alias, descriptors, index, envName) { + var _options$overrides2, _override$env; + const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index]; + if (!override) throw new Error("Assertion failure - missing override"); + const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName]; + return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null; +} +function makeChainWalker({ + root, + env, + overrides, + overridesEnv, + createLogger +}) { + return function* chainWalker(input, context, files = new Set(), baseLogger) { + const { + dirname + } = input; + const flattenedConfigs = []; + const rootOpts = root(input); + if (configIsApplicable(rootOpts, dirname, context, input.filepath)) { + flattenedConfigs.push({ + config: rootOpts, + envName: undefined, + index: undefined + }); + const envOpts = env(input, context.envName); + if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) { + flattenedConfigs.push({ + config: envOpts, + envName: context.envName, + index: undefined + }); + } + (rootOpts.options.overrides || []).forEach((_, index) => { + const overrideOps = overrides(input, index); + if (configIsApplicable(overrideOps, dirname, context, input.filepath)) { + flattenedConfigs.push({ + config: overrideOps, + index, + envName: undefined + }); + const overrideEnvOpts = overridesEnv(input, index, context.envName); + if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) { + flattenedConfigs.push({ + config: overrideEnvOpts, + index, + envName: context.envName + }); + } + } + }); + } + if (flattenedConfigs.some(({ + config: { + options: { + ignore, + only + } + } + }) => shouldIgnore(context, ignore, only, dirname))) { + return null; + } + const chain = emptyChain(); + const logger = createLogger(input, context, baseLogger); + for (const { + config, + index, + envName + } of flattenedConfigs) { + if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) { + return null; + } + logger(config, index, envName); + yield* mergeChainOpts(chain, config); + } + return chain; + }; +} +function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) { + if (opts.extends === undefined) return true; + const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller); + if (files.has(file)) { + throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n")); + } + files.add(file); + const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger); + files.delete(file); + if (!fileChain) return false; + mergeChain(chain, fileChain); + return true; +} +function mergeChain(target, source) { + target.options.push(...source.options); + target.plugins.push(...source.plugins); + target.presets.push(...source.presets); + for (const file of source.files) { + target.files.add(file); + } + return target; +} +function* mergeChainOpts(target, { + options, + plugins, + presets +}) { + target.options.push(options); + target.plugins.push(...(yield* plugins())); + target.presets.push(...(yield* presets())); + return target; +} +function emptyChain() { + return { + options: [], + presets: [], + plugins: [], + files: new Set() + }; +} +function createConfigChainOptions(opts) { + const options = Object.assign({}, opts); + delete options.extends; + delete options.env; + delete options.overrides; + delete options.plugins; + delete options.presets; + delete options.passPerPreset; + delete options.ignore; + delete options.only; + delete options.test; + delete options.include; + delete options.exclude; + if (hasOwnProperty.call(options, "sourceMap")) { + options.sourceMaps = options.sourceMap; + delete options.sourceMap; + } + return options; +} +function dedupDescriptors(items) { + const map = new Map(); + const descriptors = []; + for (const item of items) { + if (typeof item.value === "function") { + const fnKey = item.value; + let nameMap = map.get(fnKey); + if (!nameMap) { + nameMap = new Map(); + map.set(fnKey, nameMap); + } + let desc = nameMap.get(item.name); + if (!desc) { + desc = { + value: item + }; + descriptors.push(desc); + if (!item.ownPass) nameMap.set(item.name, desc); + } else { + desc.value = item; + } + } else { + descriptors.push({ + value: item + }); + } + } + return descriptors.reduce((acc, desc) => { + acc.push(desc.value); + return acc; + }, []); +} +function configIsApplicable({ + options +}, dirname, context, configName) { + return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname, configName)); +} +function configFieldIsApplicable(context, test, dirname, configName) { + const patterns = Array.isArray(test) ? test : [test]; + return matchesPatterns(context, patterns, dirname, configName); +} +function ignoreListReplacer(_key, value) { + if (value instanceof RegExp) { + return String(value); + } + return value; +} +function shouldIgnore(context, ignore, only, dirname) { + if (ignore && matchesPatterns(context, ignore, dirname)) { + var _context$filename; + const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`; + debug(message); + if (context.showConfig) { + console.log(message); + } + return true; + } + if (only && !matchesPatterns(context, only, dirname)) { + var _context$filename2; + const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`; + debug(message); + if (context.showConfig) { + console.log(message); + } + return true; + } + return false; +} +function matchesPatterns(context, patterns, dirname, configName) { + return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName)); +} +function matchPattern(pattern, dirname, pathToTest, context, configName) { + if (typeof pattern === "function") { + return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, { + dirname, + envName: context.envName, + caller: context.caller + }); + } + if (typeof pathToTest !== "string") { + throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName); + } + if (typeof pattern === "string") { + pattern = (0, _patternToRegex.default)(pattern, dirname); + } + return pattern.test(pathToTest); +} +0 && 0; + +//# sourceMappingURL=config-chain.js.map diff --git a/node_modules/@babel/core/lib/config/config-chain.js.map b/node_modules/@babel/core/lib/config/config-chain.js.map new file mode 100644 index 0000000..1ba2d19 --- /dev/null +++ b/node_modules/@babel/core/lib/config/config-chain.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","data","require","_debug","_options","_patternToRegex","_printer","_rewriteStackTrace","_configError","_index","_caching","_configDescriptors","debug","buildDebug","buildPresetChain","arg","context","chain","buildPresetChainWalker","plugins","dedupDescriptors","presets","options","map","o","createConfigChainOptions","files","Set","exports","makeChainWalker","root","preset","loadPresetDescriptors","env","envName","loadPresetEnvDescriptors","overrides","index","loadPresetOverridesDescriptors","overridesEnv","loadPresetOverridesEnvDescriptors","createLogger","makeWeakCacheSync","buildRootDescriptors","alias","createUncachedDescriptors","makeStrongCacheSync","buildEnvDescriptors","buildOverrideDescriptors","buildOverrideEnvDescriptors","buildRootChain","opts","configReport","babelRcReport","programmaticLogger","ConfigPrinter","programmaticChain","loadProgrammaticChain","dirname","cwd","undefined","programmaticReport","output","configFile","loadConfig","caller","findRootConfig","babelrc","babelrcRoots","babelrcRootsDirectory","configFileChain","emptyChain","configFileLogger","validatedFile","validateConfigFile","result","loadFileChain","mergeChain","ignoreFile","babelrcFile","isIgnored","fileChain","filename","pkgData","findPackageData","babelrcLoadEnabled","ignore","config","findRelativeConfig","add","filepath","shouldIgnore","validateBabelrcFile","babelrcLogger","showConfig","console","log","filter","x","join","fileHandling","absoluteRoot","directories","includes","babelrcPatterns","Array","isArray","pat","path","resolve","length","some","pathPatternToRegex","directory","matchPattern","file","validate","validateExtendFile","input","createCachedDescriptors","baseLogger","buildProgrammaticLogger","loadFileChainWalker","loadFileDescriptors","loadFileEnvDescriptors","loadFileOverridesDescriptors","loadFileOverridesEnvDescriptors","buildFileLogger","configure","ChainFormatter","Config","descriptors","_","_context$caller","Programmatic","callerName","name","_options$env","_options$overrides","Error","_options$overrides2","_override$env","override","chainWalker","flattenedConfigs","rootOpts","configIsApplicable","push","envOpts","forEach","overrideOps","overrideEnvOpts","only","logger","mergeExtendsChain","mergeChainOpts","extends","has","from","delete","target","source","Object","assign","passPerPreset","test","include","exclude","hasOwnProperty","call","sourceMaps","sourceMap","items","Map","item","value","fnKey","nameMap","get","set","desc","ownPass","reduce","acc","configName","configFieldIsApplicable","patterns","matchesPatterns","ignoreListReplacer","_key","RegExp","String","_context$filename","message","JSON","stringify","_context$filename2","pattern","pathToTest","endHiddenCallStack","ConfigError"],"sources":["../../src/config/config-chain.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\n\nimport path from \"node:path\";\nimport buildDebug from \"debug\";\nimport type { Handler } from \"gensync\";\nimport { validate } from \"./validation/options.ts\";\nimport type {\n ConfigApplicableTest,\n BabelrcSearch,\n CallerMetadata,\n MatchItem,\n InputOptions,\n ConfigChainOptions,\n} from \"./validation/options.ts\";\nimport pathPatternToRegex from \"./pattern-to-regex.ts\";\nimport { ConfigPrinter, ChainFormatter } from \"./printer.ts\";\nimport type { ReadonlyDeepArray } from \"./helpers/deep-array.ts\";\n\nimport { endHiddenCallStack } from \"../errors/rewrite-stack-trace.ts\";\nimport ConfigError from \"../errors/config-error.ts\";\nimport type { PluginAPI, PresetAPI } from \"./helpers/config-api.ts\";\n\nconst debug = buildDebug(\"babel:config:config-chain\");\n\nimport {\n findPackageData,\n findRelativeConfig,\n findRootConfig,\n loadConfig,\n} from \"./files/index.ts\";\nimport type { ConfigFile, IgnoreFile, FilePackageData } from \"./files/index.ts\";\n\nimport { makeWeakCacheSync, makeStrongCacheSync } from \"./caching.ts\";\n\nimport {\n createCachedDescriptors,\n createUncachedDescriptors,\n} from \"./config-descriptors.ts\";\nimport type {\n UnloadedDescriptor,\n OptionsAndDescriptors,\n ValidatedFile,\n} from \"./config-descriptors.ts\";\n\nexport type ConfigChain = {\n plugins: Array>;\n presets: Array>;\n options: Array;\n files: Set;\n};\n\nexport type PresetInstance = {\n options: InputOptions;\n alias: string;\n dirname: string;\n externalDependencies: ReadonlyDeepArray;\n};\n\nexport type ConfigContext = {\n filename: string | undefined;\n cwd: string;\n root: string;\n envName: string;\n caller: CallerMetadata | undefined;\n showConfig: boolean;\n};\n\n/**\n * Build a config chain for a given preset.\n */\nexport function* buildPresetChain(\n arg: PresetInstance,\n context: any,\n): Handler {\n const chain = yield* buildPresetChainWalker(arg, context);\n if (!chain) return null;\n\n return {\n plugins: dedupDescriptors(chain.plugins),\n presets: dedupDescriptors(chain.presets),\n options: chain.options.map(o => createConfigChainOptions(o)),\n files: new Set(),\n };\n}\n\nexport const buildPresetChainWalker = makeChainWalker({\n root: preset => loadPresetDescriptors(preset),\n env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),\n overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),\n overridesEnv: (preset, index, envName) =>\n loadPresetOverridesEnvDescriptors(preset)(index)(envName),\n createLogger: () => () => {}, // Currently we don't support logging how preset is expanded\n});\nconst loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) =>\n buildRootDescriptors(preset, preset.alias, createUncachedDescriptors),\n);\nconst loadPresetEnvDescriptors = makeWeakCacheSync((preset: PresetInstance) =>\n makeStrongCacheSync((envName: string) =>\n buildEnvDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n envName,\n ),\n ),\n);\nconst loadPresetOverridesDescriptors = makeWeakCacheSync(\n (preset: PresetInstance) =>\n makeStrongCacheSync((index: number) =>\n buildOverrideDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n index,\n ),\n ),\n);\nconst loadPresetOverridesEnvDescriptors = makeWeakCacheSync(\n (preset: PresetInstance) =>\n makeStrongCacheSync((index: number) =>\n makeStrongCacheSync((envName: string) =>\n buildOverrideEnvDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n index,\n envName,\n ),\n ),\n ),\n);\n\nexport type FileHandling = \"transpile\" | \"ignored\" | \"unsupported\";\nexport type RootConfigChain = ConfigChain & {\n babelrc: ConfigFile | undefined;\n config: ConfigFile | undefined;\n ignore: IgnoreFile | undefined;\n fileHandling: FileHandling;\n files: Set;\n};\n\n/**\n * Build a config chain for Babel's full root configuration.\n */\nexport function* buildRootChain(\n opts: InputOptions,\n context: ConfigContext,\n): Handler {\n let configReport, babelRcReport;\n const programmaticLogger = new ConfigPrinter();\n const programmaticChain = yield* loadProgrammaticChain(\n {\n options: opts,\n dirname: context.cwd,\n },\n context,\n undefined,\n programmaticLogger,\n );\n if (!programmaticChain) return null;\n const programmaticReport = yield* programmaticLogger.output();\n\n let configFile;\n if (typeof opts.configFile === \"string\") {\n configFile = yield* loadConfig(\n opts.configFile,\n context.cwd,\n context.envName,\n context.caller,\n );\n } else if (opts.configFile !== false) {\n configFile = yield* findRootConfig(\n context.root,\n context.envName,\n context.caller,\n );\n }\n\n let { babelrc, babelrcRoots } = opts;\n let babelrcRootsDirectory = context.cwd;\n\n const configFileChain = emptyChain();\n const configFileLogger = new ConfigPrinter();\n if (configFile) {\n const validatedFile = validateConfigFile(configFile);\n const result = yield* loadFileChain(\n validatedFile,\n context,\n undefined,\n configFileLogger,\n );\n if (!result) return null;\n configReport = yield* configFileLogger.output();\n\n // Allow config files to toggle `.babelrc` resolution on and off and\n // specify where the roots are.\n if (babelrc === undefined) {\n babelrc = validatedFile.options.babelrc;\n }\n if (babelrcRoots === undefined) {\n babelrcRootsDirectory = validatedFile.dirname;\n babelrcRoots = validatedFile.options.babelrcRoots;\n }\n\n mergeChain(configFileChain, result);\n }\n\n let ignoreFile, babelrcFile;\n let isIgnored = false;\n const fileChain = emptyChain();\n // resolve all .babelrc files\n if (\n (babelrc === true || babelrc === undefined) &&\n typeof context.filename === \"string\"\n ) {\n const pkgData = yield* findPackageData(context.filename);\n\n if (\n pkgData &&\n babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)\n ) {\n ({ ignore: ignoreFile, config: babelrcFile } = yield* findRelativeConfig(\n pkgData,\n context.envName,\n context.caller,\n ));\n\n if (ignoreFile) {\n fileChain.files.add(ignoreFile.filepath);\n }\n\n if (\n ignoreFile &&\n shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)\n ) {\n isIgnored = true;\n }\n\n if (babelrcFile && !isIgnored) {\n const validatedFile = validateBabelrcFile(babelrcFile);\n const babelrcLogger = new ConfigPrinter();\n const result = yield* loadFileChain(\n validatedFile,\n context,\n undefined,\n babelrcLogger,\n );\n if (!result) {\n isIgnored = true;\n } else {\n babelRcReport = yield* babelrcLogger.output();\n mergeChain(fileChain, result);\n }\n }\n\n if (babelrcFile && isIgnored) {\n fileChain.files.add(babelrcFile.filepath);\n }\n }\n }\n\n if (context.showConfig) {\n console.log(\n `Babel configs on \"${context.filename}\" (ascending priority):\\n` +\n // print config by the order of ascending priority\n [configReport, babelRcReport, programmaticReport]\n .filter(x => !!x)\n .join(\"\\n\\n\") +\n \"\\n-----End Babel configs-----\",\n );\n }\n // Insert file chain in front so programmatic options have priority\n // over configuration file chain items.\n const chain = mergeChain(\n mergeChain(mergeChain(emptyChain(), configFileChain), fileChain),\n programmaticChain,\n );\n\n return {\n plugins: isIgnored ? [] : dedupDescriptors(chain.plugins),\n presets: isIgnored ? [] : dedupDescriptors(chain.presets),\n options: isIgnored\n ? []\n : chain.options.map(o => createConfigChainOptions(o)),\n fileHandling: isIgnored ? \"ignored\" : \"transpile\",\n ignore: ignoreFile || undefined,\n babelrc: babelrcFile || undefined,\n config: configFile || undefined,\n files: chain.files,\n };\n}\n\nfunction babelrcLoadEnabled(\n context: ConfigContext,\n pkgData: FilePackageData,\n babelrcRoots: BabelrcSearch | undefined,\n babelrcRootsDirectory: string,\n): boolean {\n if (typeof babelrcRoots === \"boolean\") return babelrcRoots;\n\n const absoluteRoot = context.root;\n\n // Fast path to avoid having to match patterns if the babelrc is just\n // loading in the standard root directory.\n if (babelrcRoots === undefined) {\n return pkgData.directories.includes(absoluteRoot);\n }\n\n let babelrcPatterns = babelrcRoots;\n if (!Array.isArray(babelrcPatterns)) {\n babelrcPatterns = [babelrcPatterns];\n }\n babelrcPatterns = babelrcPatterns.map(pat => {\n return typeof pat === \"string\"\n ? path.resolve(babelrcRootsDirectory, pat)\n : pat;\n });\n\n // Fast path to avoid having to match patterns if the babelrc is just\n // loading in the standard root directory.\n if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {\n return pkgData.directories.includes(absoluteRoot);\n }\n\n return babelrcPatterns.some(pat => {\n if (typeof pat === \"string\") {\n pat = pathPatternToRegex(pat, babelrcRootsDirectory);\n }\n\n return pkgData.directories.some(directory => {\n return matchPattern(pat, babelrcRootsDirectory, directory, context);\n });\n });\n}\n\nconst validateConfigFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"configfile\", file.options, file.filepath),\n }),\n);\n\nconst validateBabelrcFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"babelrcfile\", file.options, file.filepath),\n }),\n);\n\nconst validateExtendFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"extendsfile\", file.options, file.filepath),\n }),\n);\n\n/**\n * Build a config chain for just the programmatic options passed into Babel.\n */\nconst loadProgrammaticChain = makeChainWalker({\n root: input => buildRootDescriptors(input, \"base\", createCachedDescriptors),\n env: (input, envName) =>\n buildEnvDescriptors(input, \"base\", createCachedDescriptors, envName),\n overrides: (input, index) =>\n buildOverrideDescriptors(input, \"base\", createCachedDescriptors, index),\n overridesEnv: (input, index, envName) =>\n buildOverrideEnvDescriptors(\n input,\n \"base\",\n createCachedDescriptors,\n index,\n envName,\n ),\n createLogger: (input, context, baseLogger) =>\n buildProgrammaticLogger(input, context, baseLogger),\n});\n\n/**\n * Build a config chain for a given file.\n */\nconst loadFileChainWalker = makeChainWalker({\n root: file => loadFileDescriptors(file),\n env: (file, envName) => loadFileEnvDescriptors(file)(envName),\n overrides: (file, index) => loadFileOverridesDescriptors(file)(index),\n overridesEnv: (file, index, envName) =>\n loadFileOverridesEnvDescriptors(file)(index)(envName),\n createLogger: (file, context, baseLogger) =>\n buildFileLogger(file.filepath, context, baseLogger),\n});\n\nfunction* loadFileChain(\n input: ValidatedFile,\n context: ConfigContext,\n files: Set,\n baseLogger: ConfigPrinter,\n) {\n const chain = yield* loadFileChainWalker(input, context, files, baseLogger);\n chain?.files.add(input.filepath);\n\n return chain;\n}\n\nconst loadFileDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n buildRootDescriptors(file, file.filepath, createUncachedDescriptors),\n);\nconst loadFileEnvDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n makeStrongCacheSync((envName: string) =>\n buildEnvDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n envName,\n ),\n ),\n);\nconst loadFileOverridesDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n makeStrongCacheSync((index: number) =>\n buildOverrideDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n index,\n ),\n ),\n);\nconst loadFileOverridesEnvDescriptors = makeWeakCacheSync(\n (file: ValidatedFile) =>\n makeStrongCacheSync((index: number) =>\n makeStrongCacheSync((envName: string) =>\n buildOverrideEnvDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n index,\n envName,\n ),\n ),\n ),\n);\n\nfunction buildFileLogger(\n filepath: string,\n context: ConfigContext,\n baseLogger: ConfigPrinter | void,\n) {\n if (!baseLogger) {\n return () => {};\n }\n return baseLogger.configure(context.showConfig, ChainFormatter.Config, {\n filepath,\n });\n}\n\nfunction buildRootDescriptors(\n { dirname, options }: Partial,\n alias: string,\n descriptors: (\n dirname: string,\n options: InputOptions,\n alias: string,\n ) => OptionsAndDescriptors,\n) {\n return descriptors(dirname, options, alias);\n}\n\nfunction buildProgrammaticLogger(\n _: unknown,\n context: ConfigContext,\n baseLogger: ConfigPrinter | void,\n) {\n if (!baseLogger) {\n return () => {};\n }\n return baseLogger.configure(context.showConfig, ChainFormatter.Programmatic, {\n callerName: context.caller?.name,\n });\n}\n\nfunction buildEnvDescriptors(\n { dirname, options }: Partial,\n alias: string,\n descriptors: (\n dirname: string,\n options: InputOptions,\n alias: string,\n ) => OptionsAndDescriptors,\n envName: string,\n) {\n const opts = options.env?.[envName];\n return opts ? descriptors(dirname, opts, `${alias}.env[\"${envName}\"]`) : null;\n}\n\nfunction buildOverrideDescriptors(\n { dirname, options }: Partial,\n alias: string,\n descriptors: (\n dirname: string,\n options: InputOptions,\n alias: string,\n ) => OptionsAndDescriptors,\n index: number,\n) {\n const opts = options.overrides?.[index];\n if (!opts) throw new Error(\"Assertion failure - missing override\");\n\n return descriptors(dirname, opts, `${alias}.overrides[${index}]`);\n}\n\nfunction buildOverrideEnvDescriptors(\n { dirname, options }: Partial,\n alias: string,\n descriptors: (\n dirname: string,\n options: InputOptions,\n alias: string,\n ) => OptionsAndDescriptors,\n index: number,\n envName: string,\n) {\n const override = options.overrides?.[index];\n if (!override) throw new Error(\"Assertion failure - missing override\");\n\n const opts = override.env?.[envName];\n return opts\n ? descriptors(\n dirname,\n opts,\n `${alias}.overrides[${index}].env[\"${envName}\"]`,\n )\n : null;\n}\n\nfunction makeChainWalker<\n ArgT extends {\n options: InputOptions;\n dirname: string;\n filepath?: string;\n },\n>({\n root,\n env,\n overrides,\n overridesEnv,\n createLogger,\n}: {\n root: (configEntry: ArgT) => OptionsAndDescriptors;\n env: (configEntry: ArgT, env: string) => OptionsAndDescriptors | null;\n overrides: (configEntry: ArgT, index: number) => OptionsAndDescriptors;\n overridesEnv: (\n configEntry: ArgT,\n index: number,\n env: string,\n ) => OptionsAndDescriptors | null;\n createLogger: (\n configEntry: ArgT,\n context: ConfigContext,\n printer: ConfigPrinter | void,\n ) => (\n opts: OptionsAndDescriptors,\n index?: number | null,\n env?: string | null,\n ) => void;\n}): (\n configEntry: ArgT,\n context: ConfigContext,\n files?: Set,\n baseLogger?: ConfigPrinter,\n) => Handler {\n return function* chainWalker(input, context, files = new Set(), baseLogger) {\n const { dirname } = input;\n\n const flattenedConfigs: Array<{\n config: OptionsAndDescriptors;\n index: number | undefined | null;\n envName: string | undefined | null;\n }> = [];\n\n const rootOpts = root(input);\n if (configIsApplicable(rootOpts, dirname, context, input.filepath)) {\n flattenedConfigs.push({\n config: rootOpts,\n envName: undefined,\n index: undefined,\n });\n\n const envOpts = env(input, context.envName);\n if (\n envOpts &&\n configIsApplicable(envOpts, dirname, context, input.filepath)\n ) {\n flattenedConfigs.push({\n config: envOpts,\n envName: context.envName,\n index: undefined,\n });\n }\n\n (rootOpts.options.overrides || []).forEach((_, index) => {\n const overrideOps = overrides(input, index);\n if (configIsApplicable(overrideOps, dirname, context, input.filepath)) {\n flattenedConfigs.push({\n config: overrideOps,\n index,\n envName: undefined,\n });\n\n const overrideEnvOpts = overridesEnv(input, index, context.envName);\n if (\n overrideEnvOpts &&\n configIsApplicable(\n overrideEnvOpts,\n dirname,\n context,\n input.filepath,\n )\n ) {\n flattenedConfigs.push({\n config: overrideEnvOpts,\n index,\n envName: context.envName,\n });\n }\n }\n });\n }\n\n // Process 'ignore' and 'only' before 'extends' items are processed so\n // that we don't do extra work loading extended configs if a file is\n // ignored.\n if (\n flattenedConfigs.some(\n ({\n config: {\n options: { ignore, only },\n },\n }) => shouldIgnore(context, ignore, only, dirname),\n )\n ) {\n return null;\n }\n\n const chain = emptyChain();\n const logger = createLogger(input, context, baseLogger);\n\n for (const { config, index, envName } of flattenedConfigs) {\n if (\n !(yield* mergeExtendsChain(\n chain,\n config.options,\n dirname,\n context,\n files,\n baseLogger,\n ))\n ) {\n return null;\n }\n\n logger(config, index, envName);\n yield* mergeChainOpts(chain, config);\n }\n return chain;\n };\n}\n\nfunction* mergeExtendsChain(\n chain: ConfigChain,\n opts: InputOptions,\n dirname: string,\n context: ConfigContext,\n files: Set,\n baseLogger?: ConfigPrinter,\n): Handler {\n if (opts.extends === undefined) return true;\n\n const file = yield* loadConfig(\n opts.extends,\n dirname,\n context.envName,\n context.caller,\n );\n\n if (files.has(file)) {\n throw new Error(\n `Configuration cycle detected loading ${file.filepath}.\\n` +\n `File already loaded following the config chain:\\n` +\n Array.from(files, file => ` - ${file.filepath}`).join(\"\\n\"),\n );\n }\n\n files.add(file);\n const fileChain = yield* loadFileChain(\n validateExtendFile(file),\n context,\n files,\n baseLogger,\n );\n files.delete(file);\n\n if (!fileChain) return false;\n\n mergeChain(chain, fileChain);\n\n return true;\n}\n\nfunction mergeChain(target: ConfigChain, source: ConfigChain): ConfigChain {\n target.options.push(...source.options);\n target.plugins.push(...source.plugins);\n target.presets.push(...source.presets);\n for (const file of source.files) {\n target.files.add(file);\n }\n\n return target;\n}\n\nfunction* mergeChainOpts(\n target: ConfigChain,\n { options, plugins, presets }: OptionsAndDescriptors,\n): Handler {\n target.options.push(options);\n target.plugins.push(...(yield* plugins()));\n target.presets.push(...(yield* presets()));\n\n return target;\n}\n\nfunction emptyChain(): ConfigChain {\n return {\n options: [],\n presets: [],\n plugins: [],\n files: new Set(),\n };\n}\n\nfunction createConfigChainOptions(opts: InputOptions): ConfigChainOptions {\n const options = {\n ...opts,\n };\n delete options.extends;\n delete options.env;\n delete options.overrides;\n delete options.plugins;\n delete options.presets;\n delete options.passPerPreset;\n delete options.ignore;\n delete options.only;\n delete options.test;\n delete options.include;\n delete options.exclude;\n\n // \"sourceMap\" is just aliased to sourceMap, so copy it over as\n // we merge the options together.\n if (Object.hasOwn(options, \"sourceMap\")) {\n options.sourceMaps = options.sourceMap;\n delete options.sourceMap;\n }\n return options;\n}\n\nfunction dedupDescriptors(\n items: Array>,\n): Array> {\n const map: Map<\n Function,\n Map }>\n > = new Map();\n\n const descriptors = [];\n\n for (const item of items) {\n if (typeof item.value === \"function\") {\n const fnKey = item.value;\n let nameMap = map.get(fnKey);\n if (!nameMap) {\n nameMap = new Map();\n map.set(fnKey, nameMap);\n }\n let desc = nameMap.get(item.name);\n if (!desc) {\n desc = { value: item };\n descriptors.push(desc);\n\n // Treat passPerPreset presets as unique, skipping them\n // in the merge processing steps.\n if (!item.ownPass) nameMap.set(item.name, desc);\n } else {\n desc.value = item;\n }\n } else {\n descriptors.push({ value: item });\n }\n }\n\n return descriptors.reduce((acc, desc) => {\n acc.push(desc.value);\n return acc;\n }, []);\n}\n\nfunction configIsApplicable(\n { options }: OptionsAndDescriptors,\n dirname: string,\n context: ConfigContext,\n configName: string,\n): boolean {\n return (\n (options.test === undefined ||\n configFieldIsApplicable(context, options.test, dirname, configName)) &&\n (options.include === undefined ||\n configFieldIsApplicable(context, options.include, dirname, configName)) &&\n (options.exclude === undefined ||\n !configFieldIsApplicable(context, options.exclude, dirname, configName))\n );\n}\n\nfunction configFieldIsApplicable(\n context: ConfigContext,\n test: ConfigApplicableTest,\n dirname: string,\n configName: string,\n): boolean {\n const patterns = Array.isArray(test) ? test : [test];\n\n return matchesPatterns(context, patterns, dirname, configName);\n}\n\n/**\n * Print the ignoreList-values in a more helpful way than the default.\n */\nfunction ignoreListReplacer(\n _key: string,\n value: MatchItem[] | MatchItem,\n): MatchItem[] | MatchItem | string {\n if (value instanceof RegExp) {\n return String(value);\n }\n\n return value;\n}\n\n/**\n * Tests if a filename should be ignored based on \"ignore\" and \"only\" options.\n */\nfunction shouldIgnore(\n context: ConfigContext,\n ignore: MatchItem[] | undefined | null,\n only: MatchItem[] | undefined | null,\n dirname: string,\n): boolean {\n if (ignore && matchesPatterns(context, ignore, dirname)) {\n const message = `No config is applied to \"${\n context.filename ?? \"(unknown)\"\n }\" because it matches one of \\`ignore: ${JSON.stringify(\n ignore,\n ignoreListReplacer,\n )}\\` from \"${dirname}\"`;\n debug(message);\n if (context.showConfig) {\n console.log(message);\n }\n return true;\n }\n\n if (only && !matchesPatterns(context, only, dirname)) {\n const message = `No config is applied to \"${\n context.filename ?? \"(unknown)\"\n }\" because it fails to match one of \\`only: ${JSON.stringify(\n only,\n ignoreListReplacer,\n )}\\` from \"${dirname}\"`;\n debug(message);\n if (context.showConfig) {\n console.log(message);\n }\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns result of calling function with filename if pattern is a function.\n * Otherwise returns result of matching pattern Regex with filename.\n */\nfunction matchesPatterns(\n context: ConfigContext,\n patterns: MatchItem[],\n dirname: string,\n configName?: string,\n): boolean {\n return patterns.some(pattern =>\n matchPattern(pattern, dirname, context.filename, context, configName),\n );\n}\n\nfunction matchPattern(\n pattern: MatchItem,\n dirname: string,\n pathToTest: string | undefined,\n context: ConfigContext,\n configName?: string,\n): boolean {\n if (typeof pattern === \"function\") {\n return !!endHiddenCallStack(pattern)(pathToTest, {\n dirname,\n envName: context.envName,\n caller: context.caller,\n });\n }\n\n if (typeof pathToTest !== \"string\") {\n throw new ConfigError(\n `Configuration contains string/RegExp pattern, but no filename was passed to Babel`,\n configName,\n );\n }\n\n if (typeof pattern === \"string\") {\n pattern = pathPatternToRegex(pattern, dirname);\n }\n return pattern.test(pathToTest);\n}\n"],"mappings":";;;;;;;;AAEA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAG,QAAA,GAAAF,OAAA;AASA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAGA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAQA,IAAAQ,QAAA,GAAAR,OAAA;AAEA,IAAAS,kBAAA,GAAAT,OAAA;AAZA,MAAMU,KAAK,GAAGC,OAASA,CAAC,CAAC,2BAA2B,CAAC;AAgD9C,UAAUC,gBAAgBA,CAC/BC,GAAmB,EACnBC,OAAY,EACiB;EAC7B,MAAMC,KAAK,GAAG,OAAOC,sBAAsB,CAACH,GAAG,EAAEC,OAAO,CAAC;EACzD,IAAI,CAACC,KAAK,EAAE,OAAO,IAAI;EAEvB,OAAO;IACLE,OAAO,EAAEC,gBAAgB,CAACH,KAAK,CAACE,OAAO,CAAC;IACxCE,OAAO,EAAED,gBAAgB,CAACH,KAAK,CAACI,OAAO,CAAC;IACxCC,OAAO,EAAEL,KAAK,CAACK,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIC,wBAAwB,CAACD,CAAC,CAAC,CAAC;IAC5DE,KAAK,EAAE,IAAIC,GAAG,CAAC;EACjB,CA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dpL,OAAO,CAACkE,QAAQ,YAAAkH,kBAAA,GAAI,WAAW,8CACaF,IAAI,CAACC,SAAS,CAC1D3C,IAAI,EACJoC,kBACF,CAAC,YAAYlI,OAAO,GAAG;IACvB9C,KAAK,CAACqL,OAAO,CAAC;IACd,IAAIjL,OAAO,CAAC8E,UAAU,EAAE;MACtBC,OAAO,CAACC,GAAG,CAACiG,OAAO,CAAC;IACtB;IACA,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd;AAMA,SAASN,eAAeA,CACtB3K,OAAsB,EACtB0K,QAAqB,EACrBhI,OAAe,EACf8H,UAAmB,EACV;EACT,OAAOE,QAAQ,CAAC3E,IAAI,CAACsF,OAAO,IAC1BnF,YAAY,CAACmF,OAAO,EAAE3I,OAAO,EAAE1C,OAAO,CAACkE,QAAQ,EAAElE,OAAO,EAAEwK,UAAU,CACtE,CAAC;AACH;AAEA,SAAStE,YAAYA,CACnBmF,OAAkB,EAClB3I,OAAe,EACf4I,UAA8B,EAC9BtL,OAAsB,EACtBwK,UAAmB,EACV;EACT,IAAI,OAAOa,OAAO,KAAK,UAAU,EAAE;IACjC,OAAO,CAAC,CAAC,IAAAE,qCAAkB,EAACF,OAAO,CAAC,CAACC,UAAU,EAAE;MAC/C5I,OAAO;MACPxB,OAAO,EAAElB,OAAO,CAACkB,OAAO;MACxB+B,MAAM,EAAEjD,OAAO,CAACiD;IAClB,CAAC,CAAC;EACJ;EAEA,IAAI,OAAOqI,UAAU,KAAK,QAAQ,EAAE;IAClC,MAAM,IAAIE,oBAAW,CACnB,mFAAmF,EACnFhB,UACF,CAAC;EACH;EAEA,IAAI,OAAOa,OAAO,KAAK,QAAQ,EAAE;IAC/BA,OAAO,GAAG,IAAArF,uBAAkB,EAACqF,OAAO,EAAE3I,OAAO,CAAC;EAChD;EACA,OAAO2I,OAAO,CAAChC,IAAI,CAACiC,UAAU,CAAC;AACjC;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/config-descriptors.js b/node_modules/@babel/core/lib/config/config-descriptors.js new file mode 100644 index 0000000..21fb414 --- /dev/null +++ b/node_modules/@babel/core/lib/config/config-descriptors.js @@ -0,0 +1,190 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createCachedDescriptors = createCachedDescriptors; +exports.createDescriptor = createDescriptor; +exports.createUncachedDescriptors = createUncachedDescriptors; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _functional = require("../gensync-utils/functional.js"); +var _index = require("./files/index.js"); +var _item = require("./item.js"); +var _caching = require("./caching.js"); +var _resolveTargets = require("./resolve-targets.js"); +function isEqualDescriptor(a, b) { + var _a$file, _b$file, _a$file2, _b$file2; + return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved); +} +function* handlerOf(value) { + return value; +} +function optionsWithResolvedBrowserslistConfigFile(options, dirname) { + if (typeof options.browserslistConfigFile === "string") { + options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname); + } + return options; +} +function createCachedDescriptors(dirname, options, alias) { + const { + plugins, + presets, + passPerPreset + } = options; + return { + options: optionsWithResolvedBrowserslistConfigFile(options, dirname), + plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]), + presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([]) + }; +} +function createUncachedDescriptors(dirname, options, alias) { + return { + options: optionsWithResolvedBrowserslistConfigFile(options, dirname), + plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)), + presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset)) + }; +} +const PRESET_DESCRIPTOR_CACHE = new WeakMap(); +const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { + const dirname = cache.using(dir => dir); + return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) { + const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset); + return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc)); + })); +}); +const PLUGIN_DESCRIPTOR_CACHE = new WeakMap(); +const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { + const dirname = cache.using(dir => dir); + return (0, _caching.makeStrongCache)(function* (alias) { + const descriptors = yield* createPluginDescriptors(items, dirname, alias); + return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc)); + }); +}); +const DEFAULT_OPTIONS = {}; +function loadCachedDescriptor(cache, desc) { + const { + value, + options = DEFAULT_OPTIONS + } = desc; + if (options === false) return desc; + let cacheByOptions = cache.get(value); + if (!cacheByOptions) { + cacheByOptions = new WeakMap(); + cache.set(value, cacheByOptions); + } + let possibilities = cacheByOptions.get(options); + if (!possibilities) { + possibilities = []; + cacheByOptions.set(options, possibilities); + } + if (!possibilities.includes(desc)) { + const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc)); + if (matches.length > 0) { + return matches[0]; + } + possibilities.push(desc); + } + return desc; +} +function* createPresetDescriptors(items, dirname, alias, passPerPreset) { + return yield* createDescriptors("preset", items, dirname, alias, passPerPreset); +} +function* createPluginDescriptors(items, dirname, alias) { + return yield* createDescriptors("plugin", items, dirname, alias); +} +function* createDescriptors(type, items, dirname, alias, ownPass) { + const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, { + type, + alias: `${alias}$${index}`, + ownPass: !!ownPass + }))); + assertNoDuplicates(descriptors); + return descriptors; +} +function* createDescriptor(pair, dirname, { + type, + alias, + ownPass +}) { + const desc = (0, _item.getItemDescriptor)(pair); + if (desc) { + return desc; + } + let name; + let options; + let value = pair; + if (Array.isArray(value)) { + if (value.length === 3) { + [value, options, name] = value; + } else { + [value, options] = value; + } + } + let file = undefined; + let filepath = null; + if (typeof value === "string") { + if (typeof type !== "string") { + throw new Error("To resolve a string-based item, the type of item must be given"); + } + const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset; + const request = value; + ({ + filepath, + value + } = yield* resolver(value, dirname)); + file = { + request, + resolved: filepath + }; + } + if (!value) { + throw new Error(`Unexpected falsy value: ${String(value)}`); + } + if (typeof value === "object" && value.__esModule) { + if (value.default) { + value = value.default; + } else { + throw new Error("Must export a default export when using ES6 modules."); + } + } + if (typeof value !== "object" && typeof value !== "function") { + throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`); + } + if (filepath !== null && typeof value === "object" && value) { + throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`); + } + return { + name, + alias: filepath || alias, + value, + options, + dirname, + ownPass, + file + }; +} +function assertNoDuplicates(items) { + const map = new Map(); + for (const item of items) { + if (typeof item.value !== "function") continue; + let nameMap = map.get(item.value); + if (!nameMap) { + nameMap = new Set(); + map.set(item.value, nameMap); + } + if (nameMap.has(item.name)) { + const conflicts = items.filter(i => i.value === item.value); + throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n")); + } + nameMap.add(item.name); + } +} +0 && 0; + +//# sourceMappingURL=config-descriptors.js.map diff --git a/node_modules/@babel/core/lib/config/config-descriptors.js.map b/node_modules/@babel/core/lib/config/config-descriptors.js.map new file mode 100644 index 0000000..fe7e0b9 --- /dev/null +++ b/node_modules/@babel/core/lib/config/config-descriptors.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_functional","_index","_item","_caching","_resolveTargets","isEqualDescriptor","a","b","_a$file","_b$file","_a$file2","_b$file2","name","value","options","dirname","alias","ownPass","file","request","resolved","handlerOf","optionsWithResolvedBrowserslistConfigFile","browserslistConfigFile","resolveBrowserslistConfigFile","createCachedDescriptors","plugins","presets","passPerPreset","createCachedPluginDescriptors","createCachedPresetDescriptors","createUncachedDescriptors","once","createPluginDescriptors","createPresetDescriptors","PRESET_DESCRIPTOR_CACHE","WeakMap","makeWeakCacheSync","items","cache","using","dir","makeStrongCacheSync","makeStrongCache","descriptors","map","desc","loadCachedDescriptor","PLUGIN_DESCRIPTOR_CACHE","DEFAULT_OPTIONS","cacheByOptions","get","set","possibilities","includes","matches","filter","possibility","length","push","createDescriptors","type","gensync","all","item","index","createDescriptor","assertNoDuplicates","pair","getItemDescriptor","Array","isArray","undefined","filepath","Error","resolver","loadPlugin","loadPreset","String","__esModule","default","Map","nameMap","Set","has","conflicts","i","JSON","stringify","join","add"],"sources":["../../src/config/config-descriptors.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\nimport { once } from \"../gensync-utils/functional.ts\";\n\nimport { loadPlugin, loadPreset } from \"./files/index.ts\";\n\nimport { getItemDescriptor } from \"./item.ts\";\n\nimport {\n makeWeakCacheSync,\n makeStrongCacheSync,\n makeStrongCache,\n} from \"./caching.ts\";\nimport type { CacheConfigurator } from \"./caching.ts\";\n\nimport type {\n PluginItem,\n InputOptions,\n PresetItem,\n} from \"./validation/options.ts\";\n\nimport { resolveBrowserslistConfigFile } from \"./resolve-targets.ts\";\nimport type { PluginAPI, PresetAPI } from \"./helpers/config-api.ts\";\n\n// Represents a config object and functions to lazily load the descriptors\n// for the plugins and presets so we don't load the plugins/presets unless\n// the options object actually ends up being applicable.\nexport type OptionsAndDescriptors = {\n options: InputOptions;\n plugins: () => Handler>>;\n presets: () => Handler>>;\n};\n\n// Represents a plugin or presets at a given location in a config object.\n// At this point these have been resolved to a specific object or function,\n// but have not yet been executed to call functions with options.\nexport interface UnloadedDescriptor {\n name: string | undefined;\n value: object | ((api: API, options: Options, dirname: string) => unknown);\n options: Options;\n dirname: string;\n alias: string;\n ownPass?: boolean;\n file?: {\n request: string;\n resolved: string;\n };\n}\n\nfunction isEqualDescriptor(\n a: UnloadedDescriptor,\n b: UnloadedDescriptor,\n): boolean {\n return (\n a.name === b.name &&\n a.value === b.value &&\n a.options === b.options &&\n a.dirname === b.dirname &&\n a.alias === b.alias &&\n a.ownPass === b.ownPass &&\n a.file?.request === b.file?.request &&\n a.file?.resolved === b.file?.resolved\n );\n}\n\nexport type ValidatedFile = {\n filepath: string;\n dirname: string;\n options: InputOptions;\n};\n\n// eslint-disable-next-line require-yield\nfunction* handlerOf(value: T): Handler {\n return value;\n}\n\nfunction optionsWithResolvedBrowserslistConfigFile(\n options: InputOptions,\n dirname: string,\n): InputOptions {\n if (typeof options.browserslistConfigFile === \"string\") {\n options.browserslistConfigFile = resolveBrowserslistConfigFile(\n options.browserslistConfigFile,\n dirname,\n );\n }\n return options;\n}\n\n/**\n * Create a set of descriptors from a given options object, preserving\n * descriptor identity based on the identity of the plugin/preset arrays\n * themselves, and potentially on the identity of the plugins/presets + options.\n */\nexport function createCachedDescriptors(\n dirname: string,\n options: InputOptions,\n alias: string,\n): OptionsAndDescriptors {\n const { plugins, presets, passPerPreset } = options;\n return {\n options: optionsWithResolvedBrowserslistConfigFile(options, dirname),\n plugins: plugins\n ? () =>\n // @ts-expect-error todo(flow->ts) ts complains about incorrect arguments\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n createCachedPluginDescriptors(plugins, dirname)(alias)\n : () => handlerOf([]),\n presets: presets\n ? () =>\n // @ts-expect-error todo(flow->ts) ts complains about incorrect arguments\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n createCachedPresetDescriptors(presets, dirname)(alias)(\n !!passPerPreset,\n )\n : () => handlerOf([]),\n };\n}\n\n/**\n * Create a set of descriptors from a given options object, with consistent\n * identity for the descriptors, but not caching based on any specific identity.\n */\nexport function createUncachedDescriptors(\n dirname: string,\n options: InputOptions,\n alias: string,\n): OptionsAndDescriptors {\n return {\n options: optionsWithResolvedBrowserslistConfigFile(options, dirname),\n // The returned result here is cached to represent a config object in\n // memory, so we build and memoize the descriptors to ensure the same\n // values are returned consistently.\n plugins: once(() =>\n createPluginDescriptors(options.plugins || [], dirname, alias),\n ),\n presets: once(() =>\n createPresetDescriptors(\n options.presets || [],\n dirname,\n alias,\n !!options.passPerPreset,\n ),\n ),\n };\n}\n\nconst PRESET_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPresetDescriptors = makeWeakCacheSync(\n (items: PresetItem[], cache: CacheConfigurator) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCacheSync((alias: string) =>\n makeStrongCache(function* (\n passPerPreset: boolean,\n ): Handler>> {\n const descriptors = yield* createPresetDescriptors(\n items,\n dirname,\n alias,\n passPerPreset,\n );\n return descriptors.map(\n // Items are cached using the overall preset array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc),\n );\n }),\n );\n },\n);\n\nconst PLUGIN_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPluginDescriptors = makeWeakCacheSync(\n (items: PluginItem[], cache: CacheConfigurator) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCache(function* (\n alias: string,\n ): Handler>> {\n const descriptors = yield* createPluginDescriptors(items, dirname, alias);\n return descriptors.map(\n // Items are cached using the overall plugin array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc),\n );\n });\n },\n);\n\n/**\n * When no options object is given in a descriptor, this object is used\n * as a WeakMap key in order to have consistent identity.\n */\nconst DEFAULT_OPTIONS = {};\n\n/**\n * Given the cache and a descriptor, returns a matching descriptor from the\n * cache, or else returns the input descriptor and adds it to the cache for\n * next time.\n */\nfunction loadCachedDescriptor(\n cache: WeakMap<\n object | Function,\n WeakMap>>\n >,\n desc: UnloadedDescriptor,\n) {\n const { value, options = DEFAULT_OPTIONS } = desc;\n if (options === false) return desc;\n\n let cacheByOptions = cache.get(value);\n if (!cacheByOptions) {\n cacheByOptions = new WeakMap();\n cache.set(value, cacheByOptions);\n }\n\n let possibilities = cacheByOptions.get(options);\n if (!possibilities) {\n possibilities = [];\n cacheByOptions.set(options, possibilities);\n }\n\n if (!possibilities.includes(desc)) {\n const matches = possibilities.filter(possibility =>\n isEqualDescriptor(possibility, desc),\n );\n if (matches.length > 0) {\n return matches[0];\n }\n\n possibilities.push(desc);\n }\n\n return desc;\n}\n\nfunction* createPresetDescriptors(\n items: PresetItem[],\n dirname: string,\n alias: string,\n passPerPreset: boolean,\n): Handler>> {\n return yield* createDescriptors(\n \"preset\",\n items,\n dirname,\n alias,\n passPerPreset,\n );\n}\n\nfunction* createPluginDescriptors(\n items: PluginItem[],\n dirname: string,\n alias: string,\n): Handler>> {\n return yield* createDescriptors(\"plugin\", items, dirname, alias);\n}\n\nfunction* createDescriptors(\n type: Type,\n items: Type extends \"plugin\" ? PluginItem[] : PresetItem[],\n dirname: string,\n alias: string,\n ownPass?: boolean,\n): Handler<\n Array>\n> {\n const descriptors = yield* gensync.all(\n items.map((item, index) =>\n createDescriptor(item, dirname, {\n type,\n alias: `${alias}$${index}`,\n ownPass: !!ownPass,\n }),\n ),\n );\n\n assertNoDuplicates(descriptors);\n\n return descriptors;\n}\n\n/**\n * Given a plugin/preset item, resolve it into a standard format.\n */\nexport function* createDescriptor(\n pair: PluginItem | PresetItem,\n dirname: string,\n {\n type,\n alias,\n ownPass,\n }: {\n type?: \"plugin\" | \"preset\";\n alias: string;\n ownPass?: boolean;\n },\n): Handler> {\n const desc = getItemDescriptor(pair);\n if (desc) {\n return desc;\n }\n\n let name;\n let options;\n let value = pair;\n if (Array.isArray(value)) {\n if (value.length === 3) {\n [value, options, name] = value;\n } else {\n [value, options] = value;\n }\n }\n\n let file = undefined;\n let filepath = null;\n if (typeof value === \"string\") {\n if (typeof type !== \"string\") {\n throw new Error(\n \"To resolve a string-based item, the type of item must be given\",\n );\n }\n const resolver = type === \"plugin\" ? loadPlugin : loadPreset;\n const request = value;\n\n // @ts-expect-error value must be a PluginItem\n ({ filepath, value } = yield* resolver(value, dirname));\n\n file = {\n request,\n resolved: filepath,\n };\n }\n\n if (!value) {\n throw new Error(`Unexpected falsy value: ${String(value)}`);\n }\n\n // @ts-expect-error Handle transpiled ES6 modules.\n if (typeof value === \"object\" && value.__esModule) {\n // @ts-expect-error Handle transpiled ES6 modules.\n if (value.default) {\n // @ts-expect-error Handle transpiled ES6 modules.\n value = value.default;\n } else {\n throw new Error(\"Must export a default export when using ES6 modules.\");\n }\n }\n\n if (typeof value !== \"object\" && typeof value !== \"function\") {\n throw new Error(\n `Unsupported format: ${typeof value}. Expected an object or a function.`,\n );\n }\n\n if (filepath !== null && typeof value === \"object\" && value) {\n // We allow object values for plugins/presets nested directly within a\n // config object, because it can be useful to define them in nested\n // configuration contexts.\n throw new Error(\n `Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`,\n );\n }\n\n return {\n name,\n alias: filepath || alias,\n value,\n options,\n dirname,\n ownPass,\n file,\n };\n}\n\nfunction assertNoDuplicates(items: Array>): void {\n const map = new Map();\n\n for (const item of items) {\n if (typeof item.value !== \"function\") continue;\n\n let nameMap = map.get(item.value);\n if (!nameMap) {\n nameMap = new Set();\n map.set(item.value, nameMap);\n }\n\n if (nameMap.has(item.name)) {\n const conflicts = items.filter(i => i.value === item.value);\n throw new Error(\n [\n `Duplicate plugin/preset detected.`,\n `If you'd like to use two separate instances of a plugin,`,\n `they need separate names, e.g.`,\n ``,\n ` plugins: [`,\n ` ['some-plugin', {}],`,\n ` ['some-plugin', {}, 'some unique name'],`,\n ` ]`,\n ``,\n `Duplicates detected are:`,\n `${JSON.stringify(conflicts, null, 2)}`,\n ].join(\"\\n\"),\n );\n }\n\n nameMap.add(item.name);\n }\n}\n"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,IAAI,CAACpD,IAAI,CAAC,EAAE;MAC1B,MAAMyE,SAAS,GAAG/C,KAAK,CAACkB,MAAM,CAAC8B,CAAC,IAAIA,CAAC,CAACzE,KAAK,KAAKmD,IAAI,CAACnD,KAAK,CAAC;MAC3D,MAAM,IAAI6D,KAAK,CACb,CACE,mCAAmC,EACnC,0DAA0D,EAC1D,gCAAgC,EAChC,EAAE,EACF,cAAc,EACd,0BAA0B,EAC1B,8CAA8C,EAC9C,KAAK,EACL,EAAE,EACF,0BAA0B,EAC1B,GAAGa,IAAI,CAACC,SAAS,CAACH,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CACxC,CAACI,IAAI,CAAC,IAAI,CACb,CAAC;IACH;IAEAP,OAAO,CAACQ,GAAG,CAAC1B,IAAI,CAACpD,IAAI,CAAC;EACxB;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/configuration.js b/node_modules/@babel/core/lib/config/files/configuration.js new file mode 100644 index 0000000..7e0c489 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/configuration.js @@ -0,0 +1,290 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ROOT_CONFIG_FILENAMES = void 0; +exports.findConfigUpwards = findConfigUpwards; +exports.findRelativeConfig = findRelativeConfig; +exports.findRootConfig = findRootConfig; +exports.loadConfig = loadConfig; +exports.resolveShowConfigPath = resolveShowConfigPath; +function _debug() { + const data = require("debug"); + _debug = function () { + return data; + }; + return data; +} +function _fs() { + const data = require("fs"); + _fs = function () { + return data; + }; + return data; +} +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +function _json() { + const data = require("json5"); + _json = function () { + return data; + }; + return data; +} +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _caching = require("../caching.js"); +var _configApi = require("../helpers/config-api.js"); +var _utils = require("./utils.js"); +var _moduleTypes = require("./module-types.js"); +var _patternToRegex = require("../pattern-to-regex.js"); +var _configError = require("../../errors/config-error.js"); +var fs = require("../../gensync-utils/fs.js"); +require("module"); +var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js"); +var _async = require("../../gensync-utils/async.js"); +const debug = _debug()("babel:config:loading:files:configuration"); +const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts", "babel.config.ts", "babel.config.mts"]; +const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"]; +const BABELIGNORE_FILENAME = ".babelignore"; +const runConfig = (0, _caching.makeWeakCache)(function* runConfig(options, cache) { + yield* []; + return { + options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)), + cacheNeedsConfiguration: !cache.configured() + }; +}); +function* readConfigCode(filepath, data) { + if (!_fs().existsSync(filepath)) return null; + let options = yield* (0, _moduleTypes.default)(filepath, (yield* (0, _async.isAsync)()) ? "auto" : "require", "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously " + "or when using the Node.js `--experimental-require-module` flag.", "You appear to be using a configuration file that contains top-level " + "await, which is only supported when running Babel asynchronously."); + let cacheNeedsConfiguration = false; + if (typeof options === "function") { + ({ + options, + cacheNeedsConfiguration + } = yield* runConfig(options, data)); + } + if (!options || typeof options !== "object" || Array.isArray(options)) { + throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath); + } + if (typeof options.then === "function") { + options.catch == null || options.catch(() => {}); + throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath); + } + if (cacheNeedsConfiguration) throwConfigError(filepath); + return buildConfigFileObject(options, filepath); +} +const cfboaf = new WeakMap(); +function buildConfigFileObject(options, filepath) { + let configFilesByFilepath = cfboaf.get(options); + if (!configFilesByFilepath) { + cfboaf.set(options, configFilesByFilepath = new Map()); + } + let configFile = configFilesByFilepath.get(filepath); + if (!configFile) { + configFile = { + filepath, + dirname: _path().dirname(filepath), + options + }; + configFilesByFilepath.set(filepath, configFile); + } + return configFile; +} +const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => { + const babel = file.options.babel; + if (babel === undefined) return null; + if (typeof babel !== "object" || Array.isArray(babel) || babel === null) { + throw new _configError.default(`.babel property must be an object`, file.filepath); + } + return { + filepath: file.filepath, + dirname: file.dirname, + options: babel + }; +}); +const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => { + let options; + try { + options = _json().parse(content); + } catch (err) { + throw new _configError.default(`Error while parsing config - ${err.message}`, filepath); + } + if (!options) throw new _configError.default(`No config detected`, filepath); + if (typeof options !== "object") { + throw new _configError.default(`Config returned typeof ${typeof options}`, filepath); + } + if (Array.isArray(options)) { + throw new _configError.default(`Expected config object but found array`, filepath); + } + delete options.$schema; + return { + filepath, + dirname: _path().dirname(filepath), + options + }; +}); +const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => { + const ignoreDir = _path().dirname(filepath); + const ignorePatterns = content.split("\n").map(line => line.replace(/#.*$/, "").trim()).filter(Boolean); + for (const pattern of ignorePatterns) { + if (pattern[0] === "!") { + throw new _configError.default(`Negation of file paths is not supported.`, filepath); + } + } + return { + filepath, + dirname: _path().dirname(filepath), + ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir)) + }; +}); +function findConfigUpwards(rootDir) { + let dirname = rootDir; + for (;;) { + for (const filename of ROOT_CONFIG_FILENAMES) { + if (_fs().existsSync(_path().join(dirname, filename))) { + return dirname; + } + } + const nextDir = _path().dirname(dirname); + if (dirname === nextDir) break; + dirname = nextDir; + } + return null; +} +function* findRelativeConfig(packageData, envName, caller) { + let config = null; + let ignore = null; + const dirname = _path().dirname(packageData.filepath); + for (const loc of packageData.directories) { + if (!config) { + var _packageData$pkg; + config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null); + } + if (!ignore) { + const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME); + ignore = yield* readIgnoreConfig(ignoreLoc); + if (ignore) { + debug("Found ignore %o from %o.", ignore.filepath, dirname); + } + } + } + return { + config, + ignore + }; +} +function findRootConfig(dirname, envName, caller) { + return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller); +} +function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) { + const configs = yield* _gensync().all(names.map(filename => readConfig(_path().join(dirname, filename), envName, caller))); + const config = configs.reduce((previousConfig, config) => { + if (config && previousConfig) { + throw new _configError.default(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`); + } + return config || previousConfig; + }, previousConfig); + if (config) { + debug("Found configuration %o from %o.", config.filepath, dirname); + } + return config; +} +function* loadConfig(name, dirname, envName, caller) { + const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, { + paths: [b] + }, M = require("module")) => { + let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); + if (f) return f; + f = new Error(`Cannot resolve module '${r}'`); + f.code = "MODULE_NOT_FOUND"; + throw f; + })(name, { + paths: [dirname] + }); + const conf = yield* readConfig(filepath, envName, caller); + if (!conf) { + throw new _configError.default(`Config file contains no configuration data`, filepath); + } + debug("Loaded config %o from %o.", name, dirname); + return conf; +} +function readConfig(filepath, envName, caller) { + const ext = _path().extname(filepath); + switch (ext) { + case ".js": + case ".cjs": + case ".mjs": + case ".ts": + case ".cts": + case ".mts": + return readConfigCode(filepath, { + envName, + caller + }); + default: + return readConfigJSON5(filepath); + } +} +function* resolveShowConfigPath(dirname) { + const targetPath = process.env.BABEL_SHOW_CONFIG_FOR; + if (targetPath != null) { + const absolutePath = _path().resolve(dirname, targetPath); + const stats = yield* fs.stat(absolutePath); + if (!stats.isFile()) { + throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`); + } + return absolutePath; + } + return null; +} +function throwConfigError(filepath) { + throw new _configError.default(`\ +Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured +for various types of caching, using the first param of their handler functions: + +module.exports = function(api) { + // The API exposes the following: + + // Cache the returned value forever and don't call this function again. + api.cache(true); + + // Don't cache at all. Not recommended because it will be very slow. + api.cache(false); + + // Cached based on the value of some function. If this function returns a value different from + // a previously-encountered value, the plugins will re-evaluate. + var env = api.cache(() => process.env.NODE_ENV); + + // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for + // any possible NODE_ENV value that might come up during plugin execution. + var isProd = api.cache(() => process.env.NODE_ENV === "production"); + + // .cache(fn) will perform a linear search though instances to find the matching plugin based + // based on previous instantiated plugins. If you want to recreate the plugin and discard the + // previous instance whenever something changes, you may use: + var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production"); + + // Note, we also expose the following more-verbose versions of the above examples: + api.cache.forever(); // api.cache(true) + api.cache.never(); // api.cache(false) + api.cache.using(fn); // api.cache(fn) + + // Return the value that will be cached. + return { }; +};`, filepath); +} +0 && 0; + +//# sourceMappingURL=configuration.js.map diff --git a/node_modules/@babel/core/lib/config/files/configuration.js.map b/node_modules/@babel/core/lib/config/files/configuration.js.map new file mode 100644 index 0000000..e7aa5f4 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/configuration.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_debug","data","require","_fs","_path","_json","_gensync","_caching","_configApi","_utils","_moduleTypes","_patternToRegex","_configError","fs","_rewriteStackTrace","_async","debug","buildDebug","ROOT_CONFIG_FILENAMES","exports","RELATIVE_CONFIG_FILENAMES","BABELIGNORE_FILENAME","runConfig","makeWeakCache","options","cache","endHiddenCallStack","makeConfigAPI","cacheNeedsConfiguration","configured","readConfigCode","filepath","nodeFs","existsSync","loadCodeDefault","isAsync","Array","isArray","ConfigError","then","catch","throwConfigError","buildConfigFileObject","cfboaf","WeakMap","configFilesByFilepath","get","set","Map","configFile","dirname","path","packageToBabelConfig","makeWeakCacheSync","file","babel","undefined","readConfigJSON5","makeStaticFileCache","content","json5","parse","err","message","$schema","readIgnoreConfig","ignoreDir","ignorePatterns","split","map","line","replace","trim","filter","Boolean","pattern","ignore","pathPatternToRegex","findConfigUpwards","rootDir","filename","join","nextDir","findRelativeConfig","packageData","envName","caller","config","loc","directories","_packageData$pkg","loadOneConfig","pkg","ignoreLoc","findRootConfig","names","previousConfig","configs","gensync","all","readConfig","reduce","basename","loadConfig","name","v","w","process","versions","node","resolve","r","paths","b","M","f","_findPath","_nodeModulePaths","concat","Error","code","conf","ext","extname","resolveShowConfigPath","targetPath","env","BABEL_SHOW_CONFIG_FOR","absolutePath","stats","stat","isFile"],"sources":["../../../src/config/files/configuration.ts"],"sourcesContent":["import buildDebug from \"debug\";\nimport nodeFs from \"node:fs\";\nimport path from \"node:path\";\nimport json5 from \"json5\";\nimport gensync from \"gensync\";\nimport type { Handler } from \"gensync\";\nimport { makeWeakCache, makeWeakCacheSync } from \"../caching.ts\";\nimport type { CacheConfigurator } from \"../caching.ts\";\nimport { makeConfigAPI } from \"../helpers/config-api.ts\";\nimport type { ConfigAPI } from \"../helpers/config-api.ts\";\nimport { makeStaticFileCache } from \"./utils.ts\";\nimport loadCodeDefault from \"./module-types.ts\";\nimport pathPatternToRegex from \"../pattern-to-regex.ts\";\nimport type { FilePackageData, RelativeConfig, ConfigFile } from \"./types.ts\";\nimport type { CallerMetadata, InputOptions } from \"../validation/options.ts\";\nimport ConfigError from \"../../errors/config-error.ts\";\n\nimport * as fs from \"../../gensync-utils/fs.ts\";\n\nimport { createRequire } from \"node:module\";\nimport { endHiddenCallStack } from \"../../errors/rewrite-stack-trace.ts\";\nimport { isAsync } from \"../../gensync-utils/async.ts\";\nconst require = createRequire(import.meta.url);\n\nconst debug = buildDebug(\"babel:config:loading:files:configuration\");\n\nexport const ROOT_CONFIG_FILENAMES = [\n \"babel.config.js\",\n \"babel.config.cjs\",\n \"babel.config.mjs\",\n \"babel.config.json\",\n \"babel.config.cts\",\n \"babel.config.ts\",\n \"babel.config.mts\",\n];\nconst RELATIVE_CONFIG_FILENAMES = [\n \".babelrc\",\n \".babelrc.js\",\n \".babelrc.cjs\",\n \".babelrc.mjs\",\n \".babelrc.json\",\n \".babelrc.cts\",\n];\n\nconst BABELIGNORE_FILENAME = \".babelignore\";\n\ntype ConfigCacheData = {\n envName: string;\n caller: CallerMetadata | undefined;\n};\n\nconst runConfig = makeWeakCache(function* runConfig(\n options: Function,\n cache: CacheConfigurator,\n): Handler<{\n options: InputOptions | null;\n cacheNeedsConfiguration: boolean;\n}> {\n // if we want to make it possible to use async configs\n yield* [];\n\n return {\n options: endHiddenCallStack(options as any as (api: ConfigAPI) => unknown)(\n makeConfigAPI(cache),\n ),\n cacheNeedsConfiguration: !cache.configured(),\n };\n});\n\nfunction* readConfigCode(\n filepath: string,\n data: ConfigCacheData,\n): Handler {\n if (!nodeFs.existsSync(filepath)) return null;\n\n let options = yield* loadCodeDefault(\n filepath,\n (yield* isAsync()) ? \"auto\" : \"require\",\n \"You appear to be using a native ECMAScript module configuration \" +\n \"file, which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n \"You appear to be using a configuration file that contains top-level \" +\n \"await, which is only supported when running Babel asynchronously.\",\n );\n\n let cacheNeedsConfiguration = false;\n if (typeof options === \"function\") {\n ({ options, cacheNeedsConfiguration } = yield* runConfig(options, data));\n }\n\n if (!options || typeof options !== \"object\" || Array.isArray(options)) {\n throw new ConfigError(\n `Configuration should be an exported JavaScript object.`,\n filepath,\n );\n }\n\n // @ts-expect-error todo(flow->ts)\n if (typeof options.then === \"function\") {\n // @ts-expect-error We use ?. in case options is a thenable but not a promise\n options.catch?.(() => {});\n throw new ConfigError(\n `You appear to be using an async configuration, ` +\n `which your current version of Babel does not support. ` +\n `We may add support for this in the future, ` +\n `but if you're on the most recent version of @babel/core and still ` +\n `seeing this error, then you'll need to synchronously return your config.`,\n filepath,\n );\n }\n\n if (cacheNeedsConfiguration) throwConfigError(filepath);\n\n return buildConfigFileObject(options, filepath);\n}\n\n// We cache the generated ConfigFile object rather than creating a new one\n// every time, so that it can be used as a cache key in other functions.\nconst cfboaf /* configFilesByOptionsAndFilepath */ = new WeakMap<\n InputOptions,\n Map\n>();\nfunction buildConfigFileObject(\n options: InputOptions,\n filepath: string,\n): ConfigFile {\n let configFilesByFilepath = cfboaf.get(options);\n if (!configFilesByFilepath) {\n cfboaf.set(options, (configFilesByFilepath = new Map()));\n }\n\n let configFile = configFilesByFilepath.get(filepath);\n if (!configFile) {\n configFile = {\n filepath,\n dirname: path.dirname(filepath),\n options,\n };\n configFilesByFilepath.set(filepath, configFile);\n }\n\n return configFile;\n}\n\nconst packageToBabelConfig = makeWeakCacheSync(\n (file: ConfigFile): ConfigFile | null => {\n const babel: unknown = file.options.babel;\n\n if (babel === undefined) return null;\n\n if (typeof babel !== \"object\" || Array.isArray(babel) || babel === null) {\n throw new ConfigError(`.babel property must be an object`, file.filepath);\n }\n\n return {\n filepath: file.filepath,\n dirname: file.dirname,\n options: babel,\n };\n },\n);\n\nconst readConfigJSON5 = makeStaticFileCache((filepath, content): ConfigFile => {\n let options;\n try {\n options = json5.parse(content);\n } catch (err) {\n throw new ConfigError(\n `Error while parsing config - ${err.message}`,\n filepath,\n );\n }\n\n if (!options) throw new ConfigError(`No config detected`, filepath);\n\n if (typeof options !== \"object\") {\n throw new ConfigError(`Config returned typeof ${typeof options}`, filepath);\n }\n if (Array.isArray(options)) {\n throw new ConfigError(`Expected config object but found array`, filepath);\n }\n\n delete options.$schema;\n\n return {\n filepath,\n dirname: path.dirname(filepath),\n options,\n };\n});\n\nconst readIgnoreConfig = makeStaticFileCache((filepath, content) => {\n const ignoreDir = path.dirname(filepath);\n const ignorePatterns = content\n .split(\"\\n\")\n .map(line =>\n line.replace(process.env.BABEL_8_BREAKING ? /^#.*$/ : /#.*$/, \"\").trim(),\n )\n .filter(Boolean);\n\n for (const pattern of ignorePatterns) {\n if (pattern[0] === \"!\") {\n throw new ConfigError(\n `Negation of file paths is not supported.`,\n filepath,\n );\n }\n }\n\n return {\n filepath,\n dirname: path.dirname(filepath),\n ignore: ignorePatterns.map(pattern =>\n pathPatternToRegex(pattern, ignoreDir),\n ),\n };\n});\n\nexport function findConfigUpwards(rootDir: string): string | null {\n let dirname = rootDir;\n for (;;) {\n for (const filename of ROOT_CONFIG_FILENAMES) {\n if (nodeFs.existsSync(path.join(dirname, filename))) {\n return dirname;\n }\n }\n\n const nextDir = path.dirname(dirname);\n if (dirname === nextDir) break;\n dirname = nextDir;\n }\n\n return null;\n}\n\nexport function* findRelativeConfig(\n packageData: FilePackageData,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler {\n let config = null;\n let ignore = null;\n\n const dirname = path.dirname(packageData.filepath);\n\n for (const loc of packageData.directories) {\n if (!config) {\n config = yield* loadOneConfig(\n RELATIVE_CONFIG_FILENAMES,\n loc,\n envName,\n caller,\n packageData.pkg?.dirname === loc\n ? packageToBabelConfig(packageData.pkg)\n : null,\n );\n }\n\n if (!ignore) {\n const ignoreLoc = path.join(loc, BABELIGNORE_FILENAME);\n ignore = yield* readIgnoreConfig(ignoreLoc);\n\n if (ignore) {\n debug(\"Found ignore %o from %o.\", ignore.filepath, dirname);\n }\n }\n }\n\n return { config, ignore };\n}\n\nexport function findRootConfig(\n dirname: string,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler {\n return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);\n}\n\nfunction* loadOneConfig(\n names: string[],\n dirname: string,\n envName: string,\n caller: CallerMetadata | undefined,\n previousConfig: ConfigFile | null = null,\n): Handler {\n const configs = yield* gensync.all(\n names.map(filename =>\n readConfig(path.join(dirname, filename), envName, caller),\n ),\n );\n const config = configs.reduce((previousConfig: ConfigFile | null, config) => {\n if (config && previousConfig) {\n throw new ConfigError(\n `Multiple configuration files found. Please remove one:\\n` +\n ` - ${path.basename(previousConfig.filepath)}\\n` +\n ` - ${config.filepath}\\n` +\n `from ${dirname}`,\n );\n }\n\n return config || previousConfig;\n }, previousConfig);\n\n if (config) {\n debug(\"Found configuration %o from %o.\", config.filepath, dirname);\n }\n return config;\n}\n\nexport function* loadConfig(\n name: string,\n dirname: string,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler {\n const filepath = require.resolve(name, { paths: [dirname] });\n\n const conf = yield* readConfig(filepath, envName, caller);\n if (!conf) {\n throw new ConfigError(\n `Config file contains no configuration data`,\n filepath,\n );\n }\n\n debug(\"Loaded config %o from %o.\", name, dirname);\n return conf;\n}\n\n/**\n * Read the given config file, returning the result. Returns null if no config was found, but will\n * throw if there are parsing errors while loading a config.\n */\nfunction readConfig(\n filepath: string,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler {\n const ext = path.extname(filepath);\n switch (ext) {\n case \".js\":\n case \".cjs\":\n case \".mjs\":\n case \".ts\":\n case \".cts\":\n case \".mts\":\n return readConfigCode(filepath, { envName, caller });\n default:\n return readConfigJSON5(filepath);\n }\n}\n\nexport function* resolveShowConfigPath(\n dirname: string,\n): Handler {\n const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;\n if (targetPath != null) {\n const absolutePath = path.resolve(dirname, targetPath);\n const stats = yield* fs.stat(absolutePath);\n if (!stats.isFile()) {\n throw new Error(\n `${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`,\n );\n }\n return absolutePath;\n }\n return null;\n}\n\nfunction throwConfigError(filepath: string): never {\n throw new ConfigError(\n `\\\nCaching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured\nfor various types of caching, using the first param of their handler functions:\n\nmodule.exports = function(api) {\n // The API exposes the following:\n\n // Cache the returned value forever and don't call this function again.\n api.cache(true);\n\n // Don't cache at all. Not recommended because it will be very slow.\n api.cache(false);\n\n // Cached based on the value of some function. If this function returns a value different from\n // a previously-encountered value, the plugins will re-evaluate.\n var env = api.cache(() => process.env.NODE_ENV);\n\n // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for\n // any possible NODE_ENV value that might come up during plugin execution.\n var isProd = api.cache(() => process.env.NODE_ENV === \"production\");\n\n // .cache(fn) will perform a linear search though instances to find the matching plugin based\n // based on previous instantiated plugins. If you want to recreate the plugin and discard the\n // previous instance whenever something changes, you may use:\n var isProd = api.cache.invalidate(() => process.env.NODE_ENV === \"production\");\n\n // Note, we also expose the following more-verbose versions of the above examples:\n api.cache.forever(); // api.cache(true)\n api.cache.never(); // api.cache(false)\n api.cache.using(fn); // api.cache(fn)\n\n // Return the value that will be cached.\n return { };\n};`,\n filepath,\n );\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,IAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAA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UAAU6F,qBAAqBA,CACpC1E,OAAe,EACS;EACxB,MAAM2E,UAAU,GAAGlB,OAAO,CAACmB,GAAG,CAACC,qBAAqB;EACpD,IAAIF,UAAU,IAAI,IAAI,EAAE;IACtB,MAAMG,YAAY,GAAG7E,MAAGA,CAAC,CAAC2D,OAAO,CAAC5D,OAAO,EAAE2E,UAAU,CAAC;IACtD,MAAMI,KAAK,GAAG,OAAOpH,EAAE,CAACqH,IAAI,CAACF,YAAY,CAAC;IAC1C,IAAI,CAACC,KAAK,CAACE,MAAM,CAAC,CAAC,EAAE;MACnB,MAAM,IAAIZ,KAAK,CACb,GAAGS,YAAY,sFACjB,CAAC;IACH;IACA,OAAOA,YAAY;EACrB;EACA,OAAO,IAAI;AACb;AAEA,SAASvF,gBAAgBA,CAACV,QAAgB,EAAS;EACjD,MAAM,IAAIO,oBAAW,CACnB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EACCP,QACF,CAAC;AACH;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/import.cjs b/node_modules/@babel/core/lib/config/files/import.cjs new file mode 100644 index 0000000..46fa5d5 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/import.cjs @@ -0,0 +1,6 @@ +module.exports = function import_(filepath) { + return import(filepath); +}; +0 && 0; + +//# sourceMappingURL=import.cjs.map diff --git a/node_modules/@babel/core/lib/config/files/import.cjs.map b/node_modules/@babel/core/lib/config/files/import.cjs.map new file mode 100644 index 0000000..2200da8 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/import.cjs.map @@ -0,0 +1 @@ +{"version":3,"names":["module","exports","import_","filepath"],"sources":["../../../src/config/files/import.cjs"],"sourcesContent":["// We keep this in a separate file so that in older node versions, where\n// import() isn't supported, we can try/catch around the require() call\n// when loading this file.\n\nmodule.exports = function import_(filepath) {\n return import(filepath);\n};\n"],"mappings":"AAIAA,MAAM,CAACC,OAAO,GAAG,SAASC,OAAOA,CAACC,QAAQ,EAAE;EAC1C,OAAO,OAAOA,QAAQ,CAAC;AACzB,CAAC;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/index-browser.js b/node_modules/@babel/core/lib/config/files/index-browser.js new file mode 100644 index 0000000..d8ba7db --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/index-browser.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ROOT_CONFIG_FILENAMES = void 0; +exports.findConfigUpwards = findConfigUpwards; +exports.findPackageData = findPackageData; +exports.findRelativeConfig = findRelativeConfig; +exports.findRootConfig = findRootConfig; +exports.loadConfig = loadConfig; +exports.loadPlugin = loadPlugin; +exports.loadPreset = loadPreset; +exports.resolvePlugin = resolvePlugin; +exports.resolvePreset = resolvePreset; +exports.resolveShowConfigPath = resolveShowConfigPath; +function findConfigUpwards(rootDir) { + return null; +} +function* findPackageData(filepath) { + return { + filepath, + directories: [], + pkg: null, + isPackage: false + }; +} +function* findRelativeConfig(pkgData, envName, caller) { + return { + config: null, + ignore: null + }; +} +function* findRootConfig(dirname, envName, caller) { + return null; +} +function* loadConfig(name, dirname, envName, caller) { + throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); +} +function* resolveShowConfigPath(dirname) { + return null; +} +const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = []; +function resolvePlugin(name, dirname) { + return null; +} +function resolvePreset(name, dirname) { + return null; +} +function loadPlugin(name, dirname) { + throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`); +} +function loadPreset(name, dirname) { + throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`); +} +0 && 0; + +//# sourceMappingURL=index-browser.js.map diff --git a/node_modules/@babel/core/lib/config/files/index-browser.js.map b/node_modules/@babel/core/lib/config/files/index-browser.js.map new file mode 100644 index 0000000..e10ddee --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/index-browser.js.map @@ -0,0 +1 @@ +{"version":3,"names":["findConfigUpwards","rootDir","findPackageData","filepath","directories","pkg","isPackage","findRelativeConfig","pkgData","envName","caller","config","ignore","findRootConfig","dirname","loadConfig","name","Error","resolveShowConfigPath","ROOT_CONFIG_FILENAMES","exports","resolvePlugin","resolvePreset","loadPlugin","loadPreset"],"sources":["../../../src/config/files/index-browser.ts"],"sourcesContent":["/* c8 ignore start */\n\nimport type { Handler } from \"gensync\";\n\nimport type {\n ConfigFile,\n IgnoreFile,\n RelativeConfig,\n FilePackageData,\n} from \"./types.ts\";\n\nimport type { CallerMetadata } from \"../validation/options.ts\";\n\nexport type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData };\n\nexport function findConfigUpwards(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n rootDir: string,\n): string | null {\n return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* findPackageData(filepath: string): Handler {\n return {\n filepath,\n directories: [],\n pkg: null,\n isPackage: false,\n };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRelativeConfig(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n pkgData: FilePackageData,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n envName: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n caller: CallerMetadata | undefined,\n): Handler {\n return { config: null, ignore: null };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRootConfig(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n dirname: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n envName: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n caller: CallerMetadata | undefined,\n): Handler {\n return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* loadConfig(\n name: string,\n dirname: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n envName: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n caller: CallerMetadata | undefined,\n): Handler {\n throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);\n}\n\n// eslint-disable-next-line require-yield\nexport function* resolveShowConfigPath(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n dirname: string,\n): Handler {\n return null;\n}\n\nexport const ROOT_CONFIG_FILENAMES: string[] = [];\n\ntype Resolved =\n | { loader: \"require\"; filepath: string }\n | { loader: \"import\"; filepath: string };\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function resolvePlugin(name: string, dirname: string): Resolved | null {\n return null;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function resolvePreset(name: string, dirname: string): Resolved | null {\n return null;\n}\n\nexport function loadPlugin(\n name: string,\n dirname: string,\n): Handler<{\n filepath: string;\n value: unknown;\n}> {\n throw new Error(\n `Cannot load plugin ${name} relative to ${dirname} in a browser`,\n );\n}\n\nexport function loadPreset(\n name: string,\n dirname: string,\n): Handler<{\n filepath: string;\n value: unknown;\n}> {\n throw new Error(\n `Cannot load preset ${name} relative to ${dirname} in a browser`,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeO,SAASA,iBAAiBA,CAE/BC,OAAe,EACA;EACf,OAAO,IAAI;AACb;AAGO,UAAUC,eAAeA,CAACC,QAAgB,EAA4B;EAC3E,OAAO;IACLA,QAAQ;IACRC,WAAW,EAAE,EAAE;IACfC,GAAG,EAAE,IAAI;IACTC,SAAS,EAAE;EACb,CAAC;AACH;AAGO,UAAUC,kBAAkBA,CAEjCC,OAAwB,EAExBC,OAAe,EAEfC,MAAkC,EACT;EACzB,OAAO;IAAEC,MAAM,EAAE,IAAI;IAAEC,MAAM,EAAE;EAAK,CAAC;AACvC;AAGO,UAAUC,cAAcA,CAE7BC,OAAe,EAEfL,OAAe,EAEfC,MAAkC,EACN;EAC5B,OAAO,IAAI;AACb;AAGO,UAAUK,UAAUA,CACzBC,IAAY,EACZF,OAAe,EAEfL,OAAe,EAEfC,MAAkC,EACb;EACrB,MAAM,IAAIO,KAAK,CAAC,eAAeD,IAAI,gBAAgBF,OAAO,eAAe,CAAC;AAC5E;AAGO,UAAUI,qBAAqBA,CAEpCJ,OAAe,EACS;EACxB,OAAO,IAAI;AACb;AAEO,MAAMK,qBAA+B,GAAAC,OAAA,CAAAD,qBAAA,GAAG,EAAE;AAO1C,SAASE,aAAaA,CAACL,IAAY,EAAEF,OAAe,EAAmB;EAC5E,OAAO,IAAI;AACb;AAGO,SAASQ,aAAaA,CAACN,IAAY,EAAEF,OAAe,EAAmB;EAC5E,OAAO,IAAI;AACb;AAEO,SAASS,UAAUA,CACxBP,IAAY,EACZF,OAAe,EAId;EACD,MAAM,IAAIG,KAAK,CACb,sBAAsBD,IAAI,gBAAgBF,OAAO,eACnD,CAAC;AACH;AAEO,SAASU,UAAUA,CACxBR,IAAY,EACZF,OAAe,EAId;EACD,MAAM,IAAIG,KAAK,CACb,sBAAsBD,IAAI,gBAAgBF,OAAO,eACnD,CAAC;AACH;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/index.js b/node_modules/@babel/core/lib/config/files/index.js new file mode 100644 index 0000000..8750f40 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/index.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "ROOT_CONFIG_FILENAMES", { + enumerable: true, + get: function () { + return _configuration.ROOT_CONFIG_FILENAMES; + } +}); +Object.defineProperty(exports, "findConfigUpwards", { + enumerable: true, + get: function () { + return _configuration.findConfigUpwards; + } +}); +Object.defineProperty(exports, "findPackageData", { + enumerable: true, + get: function () { + return _package.findPackageData; + } +}); +Object.defineProperty(exports, "findRelativeConfig", { + enumerable: true, + get: function () { + return _configuration.findRelativeConfig; + } +}); +Object.defineProperty(exports, "findRootConfig", { + enumerable: true, + get: function () { + return _configuration.findRootConfig; + } +}); +Object.defineProperty(exports, "loadConfig", { + enumerable: true, + get: function () { + return _configuration.loadConfig; + } +}); +Object.defineProperty(exports, "loadPlugin", { + enumerable: true, + get: function () { + return _plugins.loadPlugin; + } +}); +Object.defineProperty(exports, "loadPreset", { + enumerable: true, + get: function () { + return _plugins.loadPreset; + } +}); +Object.defineProperty(exports, "resolvePlugin", { + enumerable: true, + get: function () { + return _plugins.resolvePlugin; + } +}); +Object.defineProperty(exports, "resolvePreset", { + enumerable: true, + get: function () { + return _plugins.resolvePreset; + } +}); +Object.defineProperty(exports, "resolveShowConfigPath", { + enumerable: true, + get: function () { + return _configuration.resolveShowConfigPath; + } +}); +var _package = require("./package.js"); +var _configuration = require("./configuration.js"); +var _plugins = require("./plugins.js"); +({}); +0 && 0; + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/core/lib/config/files/index.js.map b/node_modules/@babel/core/lib/config/files/index.js.map new file mode 100644 index 0000000..1e473b8 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_package","require","_configuration","_plugins"],"sources":["../../../src/config/files/index.ts"],"sourcesContent":["type indexBrowserType = typeof import(\"./index-browser\");\ntype indexType = typeof import(\"./index\");\n\n// Kind of gross, but essentially asserting that the exports of this module are the same as the\n// exports of index-browser, since this file may be replaced at bundle time with index-browser.\n({}) as any as indexBrowserType as indexType;\n\nexport { findPackageData } from \"./package.ts\";\n\nexport {\n findConfigUpwards,\n findRelativeConfig,\n findRootConfig,\n loadConfig,\n resolveShowConfigPath,\n ROOT_CONFIG_FILENAMES,\n} from \"./configuration.ts\";\nexport type {\n ConfigFile,\n IgnoreFile,\n RelativeConfig,\n FilePackageData,\n} from \"./types.ts\";\nexport {\n loadPlugin,\n loadPreset,\n resolvePlugin,\n resolvePreset,\n} from \"./plugins.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AAcA,IAAAE,QAAA,GAAAF,OAAA;AAlBA,CAAC,CAAC,CAAC;AAA0C","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/module-types.js b/node_modules/@babel/core/lib/config/files/module-types.js new file mode 100644 index 0000000..c7bf699 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/module-types.js @@ -0,0 +1,211 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = loadCodeDefault; +exports.supportsESM = void 0; +var _async = require("../../gensync-utils/async.js"); +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +function _url() { + const data = require("url"); + _url = function () { + return data; + }; + return data; +} +require("module"); +function _semver() { + const data = require("semver"); + _semver = function () { + return data; + }; + return data; +} +function _debug() { + const data = require("debug"); + _debug = function () { + return data; + }; + return data; +} +var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js"); +var _configError = require("../../errors/config-error.js"); +var _transformFile = require("../../transform-file.js"); +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } +const debug = _debug()("babel:config:loading:files:module-types"); +{ + try { + var import_ = require("./import.cjs"); + } catch (_unused) {} +} +const supportsESM = exports.supportsESM = _semver().satisfies(process.versions.node, "^12.17 || >=13.2"); +const LOADING_CJS_FILES = new Set(); +function loadCjsDefault(filepath) { + if (LOADING_CJS_FILES.has(filepath)) { + debug("Auto-ignoring usage of config %o.", filepath); + return {}; + } + let module; + try { + LOADING_CJS_FILES.add(filepath); + module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath); + } finally { + LOADING_CJS_FILES.delete(filepath); + } + { + return module != null && (module.__esModule || module[Symbol.toStringTag] === "Module") ? module.default || (arguments[1] ? module : undefined) : module; + } +} +const loadMjsFromPath = (0, _rewriteStackTrace.endHiddenCallStack)(function () { + var _loadMjsFromPath = _asyncToGenerator(function* (filepath) { + const url = (0, _url().pathToFileURL)(filepath).toString() + "?import"; + { + if (!import_) { + throw new _configError.default("Internal error: Native ECMAScript modules aren't supported by this platform.\n", filepath); + } + return yield import_(url); + } + }); + function loadMjsFromPath(_x) { + return _loadMjsFromPath.apply(this, arguments); + } + return loadMjsFromPath; +}()); +const tsNotSupportedError = ext => `\ +You are using a ${ext} config file, but Babel only supports transpiling .cts configs. Either: +- Use a .cts config file +- Update to Node.js 23.6.0, which has native TypeScript support +- Install tsx to transpile ${ext} files on the fly\ +`; +const SUPPORTED_EXTENSIONS = { + ".js": "unknown", + ".mjs": "esm", + ".cjs": "cjs", + ".ts": "unknown", + ".mts": "esm", + ".cts": "cjs" +}; +const asyncModules = new Set(); +function* loadCodeDefault(filepath, loader, esmError, tlaError) { + let async; + const ext = _path().extname(filepath); + const isTS = ext === ".ts" || ext === ".cts" || ext === ".mts"; + const type = SUPPORTED_EXTENSIONS[hasOwnProperty.call(SUPPORTED_EXTENSIONS, ext) ? ext : ".js"]; + const pattern = `${loader} ${type}`; + switch (pattern) { + case "require cjs": + case "auto cjs": + if (isTS) { + return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath)); + } else { + return loadCjsDefault(filepath, arguments[2]); + } + case "auto unknown": + case "require unknown": + case "require esm": + try { + if (isTS) { + return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath)); + } else { + return loadCjsDefault(filepath, arguments[2]); + } + } catch (e) { + if (e.code === "ERR_REQUIRE_ASYNC_MODULE" || e.code === "ERR_REQUIRE_CYCLE_MODULE" && asyncModules.has(filepath)) { + asyncModules.add(filepath); + if (!(async != null ? async : async = yield* (0, _async.isAsync)())) { + throw new _configError.default(tlaError, filepath); + } + } else if (e.code === "ERR_REQUIRE_ESM" || type === "esm") {} else { + throw e; + } + } + case "auto esm": + if (async != null ? async : async = yield* (0, _async.isAsync)()) { + const promise = isTS ? ensureTsSupport(filepath, ext, () => loadMjsFromPath(filepath)) : loadMjsFromPath(filepath); + return (yield* (0, _async.waitFor)(promise)).default; + } + if (isTS) { + throw new _configError.default(tsNotSupportedError(ext), filepath); + } else { + throw new _configError.default(esmError, filepath); + } + default: + throw new Error("Internal Babel error: unreachable code."); + } +} +function ensureTsSupport(filepath, ext, callback) { + if (process.features.typescript || require.extensions[".ts"] || require.extensions[".cts"] || require.extensions[".mts"]) { + return callback(); + } + if (ext !== ".cts") { + throw new _configError.default(tsNotSupportedError(ext), filepath); + } + const opts = { + babelrc: false, + configFile: false, + sourceType: "unambiguous", + sourceMaps: "inline", + sourceFileName: _path().basename(filepath), + presets: [[getTSPreset(filepath), Object.assign({ + onlyRemoveTypeImports: true, + optimizeConstEnums: true + }, { + allowDeclareFields: true + })]] + }; + let handler = function (m, filename) { + if (handler && filename.endsWith(".cts")) { + try { + return m._compile((0, _transformFile.transformFileSync)(filename, Object.assign({}, opts, { + filename + })).code, filename); + } catch (error) { + const packageJson = require("@babel/preset-typescript/package.json"); + if (_semver().lt(packageJson.version, "7.21.4")) { + console.error("`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`."); + } + throw error; + } + } + return require.extensions[".js"](m, filename); + }; + require.extensions[ext] = handler; + try { + return callback(); + } finally { + if (require.extensions[ext] === handler) delete require.extensions[ext]; + handler = undefined; + } +} +function getTSPreset(filepath) { + try { + return require("@babel/preset-typescript"); + } catch (error) { + if (error.code !== "MODULE_NOT_FOUND") throw error; + let message = "You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!"; + { + if (process.versions.pnp) { + message += ` +If you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file: + +packageExtensions: +\t"@babel/core@*": +\t\tpeerDependencies: +\t\t\t"@babel/preset-typescript": "*" +`; + } + } + throw new _configError.default(message, filepath); + } +} +0 && 0; + +//# sourceMappingURL=module-types.js.map diff --git a/node_modules/@babel/core/lib/config/files/module-types.js.map b/node_modules/@babel/core/lib/config/files/module-types.js.map new file mode 100644 index 0000000..e7087bc --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/module-types.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_async","require","_path","data","_url","_semver","_debug","_rewriteStackTrace","_configError","_transformFile","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","debug","buildDebug","import_","_unused","supportsESM","exports","semver","satisfies","process","versions","node","LOADING_CJS_FILES","Set","loadCjsDefault","filepath","has","module","add","endHiddenCallStack","delete","__esModule","Symbol","toStringTag","default","undefined","loadMjsFromPath","_loadMjsFromPath","url","pathToFileURL","toString","ConfigError","_x","tsNotSupportedError","ext","SUPPORTED_EXTENSIONS","asyncModules","loadCodeDefault","loader","esmError","tlaError","async","path","extname","isTS","type","hasOwnProperty","call","pattern","ensureTsSupport","code","isAsync","promise","waitFor","Error","callback","features","typescript","extensions","opts","babelrc","configFile","sourceType","sourceMaps","sourceFileName","basename","presets","getTSPreset","Object","assign","onlyRemoveTypeImports","optimizeConstEnums","allowDeclareFields","handler","m","filename","endsWith","_compile","transformFileSync","error","packageJson","lt","version","console","message","pnp"],"sources":["../../../src/config/files/module-types.ts"],"sourcesContent":["import { isAsync, waitFor } from \"../../gensync-utils/async.ts\";\nimport type { Handler } from \"gensync\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { createRequire } from \"node:module\";\nimport semver from \"semver\";\nimport buildDebug from \"debug\";\n\nimport { endHiddenCallStack } from \"../../errors/rewrite-stack-trace.ts\";\nimport ConfigError from \"../../errors/config-error.ts\";\n\nimport type { InputOptions } from \"../index.ts\";\nimport { transformFileSync } from \"../../transform-file.ts\";\n\nconst debug = buildDebug(\"babel:config:loading:files:module-types\");\n\nconst require = createRequire(import.meta.url);\n\nif (!process.env.BABEL_8_BREAKING) {\n try {\n // Old Node.js versions don't support import() syntax.\n // eslint-disable-next-line no-var\n var import_:\n | ((specifier: string | URL) => any)\n | undefined = require(\"./import.cjs\");\n } catch {}\n}\n\nexport const supportsESM = semver.satisfies(\n process.versions.node,\n // older versions, starting from 10, support the dynamic\n // import syntax but always return a rejected promise.\n \"^12.17 || >=13.2\",\n);\n\nconst LOADING_CJS_FILES = new Set();\n\nfunction loadCjsDefault(filepath: string) {\n // The `require()` call below can make this code reentrant if a require hook\n // like @babel/register has been loaded into the system. That would cause\n // Babel to attempt to compile the `.babelrc.js` file as it loads below. To\n // cover this case, we auto-ignore re-entrant config processing. ESM loaders\n // do not have this problem, because loaders do not apply to themselves.\n if (LOADING_CJS_FILES.has(filepath)) {\n debug(\"Auto-ignoring usage of config %o.\", filepath);\n return {};\n }\n\n let module;\n try {\n LOADING_CJS_FILES.add(filepath);\n module = endHiddenCallStack(require)(filepath);\n } finally {\n LOADING_CJS_FILES.delete(filepath);\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default\n : module;\n } else {\n return module != null &&\n (module.__esModule || module[Symbol.toStringTag] === \"Module\")\n ? module.default ||\n /* fallbackToTranspiledModule */ (arguments[1] ? module : undefined)\n : module;\n }\n}\n\nconst loadMjsFromPath = endHiddenCallStack(async function loadMjsFromPath(\n filepath: string,\n) {\n // Add ?import as a workaround for https://github.com/nodejs/node/issues/55500\n const url = pathToFileURL(filepath).toString() + \"?import\";\n\n if (process.env.BABEL_8_BREAKING) {\n return await import(url);\n } else {\n if (!import_) {\n throw new ConfigError(\n \"Internal error: Native ECMAScript modules aren't supported by this platform.\\n\",\n filepath,\n );\n }\n\n return await import_(url);\n }\n});\n\nconst tsNotSupportedError = (ext: string) => `\\\nYou are using a ${ext} config file, but Babel only supports transpiling .cts configs. Either:\n- Use a .cts config file\n- Update to Node.js 23.6.0, which has native TypeScript support\n- Install tsx to transpile ${ext} files on the fly\\\n`;\n\nconst SUPPORTED_EXTENSIONS = {\n \".js\": \"unknown\",\n \".mjs\": \"esm\",\n \".cjs\": \"cjs\",\n \".ts\": \"unknown\",\n \".mts\": \"esm\",\n \".cts\": \"cjs\",\n} as const;\n\nconst asyncModules = new Set();\n\nexport default function* loadCodeDefault(\n filepath: string,\n loader: \"require\" | \"auto\",\n esmError: string,\n tlaError: string,\n): Handler {\n let async;\n\n const ext = path.extname(filepath);\n const isTS = ext === \".ts\" || ext === \".cts\" || ext === \".mts\";\n\n const type =\n SUPPORTED_EXTENSIONS[\n Object.hasOwn(SUPPORTED_EXTENSIONS, ext)\n ? (ext as keyof typeof SUPPORTED_EXTENSIONS)\n : (\".js\" as const)\n ];\n\n const pattern = `${loader} ${type}` as const;\n switch (pattern) {\n case \"require cjs\":\n case \"auto cjs\":\n if (isTS) {\n return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath));\n } else if (process.env.BABEL_8_BREAKING) {\n return loadCjsDefault(filepath);\n } else {\n return loadCjsDefault(\n filepath,\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n /* fallbackToTranspiledModule */ arguments[2],\n );\n }\n case \"auto unknown\":\n case \"require unknown\":\n case \"require esm\":\n try {\n if (isTS) {\n return ensureTsSupport(filepath, ext, () => loadCjsDefault(filepath));\n } else if (process.env.BABEL_8_BREAKING) {\n return loadCjsDefault(filepath);\n } else {\n return loadCjsDefault(\n filepath,\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n /* fallbackToTranspiledModule */ arguments[2],\n );\n }\n } catch (e) {\n if (\n e.code === \"ERR_REQUIRE_ASYNC_MODULE\" ||\n // Node.js 13.0.0 throws ERR_REQUIRE_CYCLE_MODULE instead of\n // ERR_REQUIRE_ASYNC_MODULE when requiring a module a second time\n // https://github.com/nodejs/node/issues/55516\n // This `asyncModules` won't catch all of such cases, but it will\n // at least catch those caused by Babel trying to load a module twice.\n (e.code === \"ERR_REQUIRE_CYCLE_MODULE\" && asyncModules.has(filepath))\n ) {\n asyncModules.add(filepath);\n if (!(async ??= yield* isAsync())) {\n throw new ConfigError(tlaError, filepath);\n }\n // fall through: require() failed due to TLA\n } else if (\n e.code === \"ERR_REQUIRE_ESM\" ||\n (!process.env.BABEL_8_BREAKING && type === \"esm\")\n ) {\n // fall through: require() failed due to ESM\n } else {\n throw e;\n }\n }\n // fall through: require() failed due to ESM or TLA, try import()\n case \"auto esm\":\n if ((async ??= yield* isAsync())) {\n const promise = isTS\n ? ensureTsSupport(filepath, ext, () => loadMjsFromPath(filepath))\n : loadMjsFromPath(filepath);\n\n return (yield* waitFor(promise)).default;\n }\n if (isTS) {\n throw new ConfigError(tsNotSupportedError(ext), filepath);\n } else {\n throw new ConfigError(esmError, filepath);\n }\n default:\n throw new Error(\"Internal Babel error: unreachable code.\");\n }\n}\n\nfunction ensureTsSupport(\n filepath: string,\n ext: string,\n callback: () => T,\n): T {\n if (\n process.features.typescript ||\n require.extensions[\".ts\"] ||\n require.extensions[\".cts\"] ||\n require.extensions[\".mts\"]\n ) {\n return callback();\n }\n\n if (ext !== \".cts\") {\n throw new ConfigError(tsNotSupportedError(ext), filepath);\n }\n\n const opts: InputOptions = {\n babelrc: false,\n configFile: false,\n sourceType: \"unambiguous\",\n sourceMaps: \"inline\",\n sourceFileName: path.basename(filepath),\n presets: [\n [\n getTSPreset(filepath),\n {\n onlyRemoveTypeImports: true,\n optimizeConstEnums: true,\n ...(process.env.BABEL_8_BREAKING ? {} : { allowDeclareFields: true }),\n },\n ],\n ],\n };\n\n let handler: NodeJS.RequireExtensions[\"\"] = function (m, filename) {\n // If we want to support `.ts`, `.d.ts` must be handled specially.\n if (handler && filename.endsWith(\".cts\")) {\n try {\n // @ts-expect-error Undocumented API\n return m._compile(\n transformFileSync(filename, {\n ...opts,\n filename,\n }).code,\n filename,\n );\n } catch (error) {\n // TODO(Babel 8): Add this as an optional peer dependency\n // eslint-disable-next-line import/no-extraneous-dependencies\n const packageJson = require(\"@babel/preset-typescript/package.json\");\n if (semver.lt(packageJson.version, \"7.21.4\")) {\n console.error(\n \"`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`.\",\n );\n }\n throw error;\n }\n }\n return require.extensions[\".js\"](m, filename);\n };\n require.extensions[ext] = handler;\n\n try {\n return callback();\n } finally {\n if (require.extensions[ext] === handler) delete require.extensions[ext];\n handler = undefined;\n }\n}\n\nfunction getTSPreset(filepath: string) {\n try {\n // eslint-disable-next-line import/no-extraneous-dependencies\n return require(\"@babel/preset-typescript\");\n } catch (error) {\n if (error.code !== \"MODULE_NOT_FOUND\") throw error;\n\n let message =\n \"You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!\";\n\n if (!process.env.BABEL_8_BREAKING) {\n if (process.versions.pnp) {\n // Using Yarn PnP, which doesn't allow requiring packages that are not\n // explicitly specified as dependencies.\n message += `\nIf you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file:\n\npackageExtensions:\n\\t\"@babel/core@*\":\n\\t\\tpeerDependencies:\n\\t\\t\\t\"@babel/preset-typescript\": \"*\"\n`;\n }\n }\n\n throw new ConfigError(message, filepath);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,SAAAC,MAAA;EAAA,MAAAC,IAAA,GAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAC,KAAA;EAAA,MAAAD,IAAA,GAAAF,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAD,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACAF,OAAA;AACA,SAAAI,QAAA;EAAA,MAAAF,IAAA,GAAAF,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAA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,EAAE;QAGd,MAAMC,WAAW,GAAG5G,OAAO,CAAC,uCAAuC,CAAC;QACpE,IAAImC,QAAKA,CAAC,CAAC0E,EAAE,CAACD,WAAW,CAACE,OAAO,EAAE,QAAQ,CAAC,EAAE;UAC5CC,OAAO,CAACJ,KAAK,CACX,4FACF,CAAC;QACH;QACA,MAAMA,KAAK;MACb;IACF;IACA,OAAO3G,OAAO,CAACsF,UAAU,CAAC,KAAK,CAAC,CAACgB,CAAC,EAAEC,QAAQ,CAAC;EAC/C,CAAC;EACDvG,OAAO,CAACsF,UAAU,CAACxB,GAAG,CAAC,GAAGuC,OAAO;EAEjC,IAAI;IACF,OAAOlB,QAAQ,CAAC,CAAC;EACnB,CAAC,SAAS;IACR,IAAInF,OAAO,CAACsF,UAAU,CAACxB,GAAG,CAAC,KAAKuC,OAAO,EAAE,OAAOrG,OAAO,CAACsF,UAAU,CAACxB,GAAG,CAAC;IACvEuC,OAAO,GAAGhD,SAAS;EACrB;AACF;AAEA,SAAS0C,WAAWA,CAACpD,QAAgB,EAAE;EACrC,IAAI;IAEF,OAAO3C,OAAO,CAAC,0BAA0B,CAAC;EAC5C,CAAC,CAAC,OAAO2G,KAAK,EAAE;IACd,IAAIA,KAAK,CAAC7B,IAAI,KAAK,kBAAkB,EAAE,MAAM6B,KAAK;IAElD,IAAIK,OAAO,GACT,yIAAyI;IAExG;MACjC,IAAI3E,OAAO,CAACC,QAAQ,CAAC2E,GAAG,EAAE;QAGxBD,OAAO,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;MACK;IACF;IAEA,MAAM,IAAIrD,oBAAW,CAACqD,OAAO,EAAErE,QAAQ,CAAC;EAC1C;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/package.js b/node_modules/@babel/core/lib/config/files/package.js new file mode 100644 index 0000000..eed8ab8 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/package.js @@ -0,0 +1,61 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findPackageData = findPackageData; +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +var _utils = require("./utils.js"); +var _configError = require("../../errors/config-error.js"); +const PACKAGE_FILENAME = "package.json"; +const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => { + let options; + try { + options = JSON.parse(content); + } catch (err) { + throw new _configError.default(`Error while parsing JSON - ${err.message}`, filepath); + } + if (!options) throw new Error(`${filepath}: No config detected`); + if (typeof options !== "object") { + throw new _configError.default(`Config returned typeof ${typeof options}`, filepath); + } + if (Array.isArray(options)) { + throw new _configError.default(`Expected config object but found array`, filepath); + } + return { + filepath, + dirname: _path().dirname(filepath), + options + }; +}); +function* findPackageData(filepath) { + let pkg = null; + const directories = []; + let isPackage = true; + let dirname = _path().dirname(filepath); + while (!pkg && _path().basename(dirname) !== "node_modules") { + directories.push(dirname); + pkg = yield* readConfigPackage(_path().join(dirname, PACKAGE_FILENAME)); + const nextLoc = _path().dirname(dirname); + if (dirname === nextLoc) { + isPackage = false; + break; + } + dirname = nextLoc; + } + return { + filepath, + directories, + pkg, + isPackage + }; +} +0 && 0; + +//# sourceMappingURL=package.js.map diff --git a/node_modules/@babel/core/lib/config/files/package.js.map b/node_modules/@babel/core/lib/config/files/package.js.map new file mode 100644 index 0000000..38aeb2c --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/package.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","data","require","_utils","_configError","PACKAGE_FILENAME","readConfigPackage","makeStaticFileCache","filepath","content","options","JSON","parse","err","ConfigError","message","Error","Array","isArray","dirname","path","findPackageData","pkg","directories","isPackage","basename","push","join","nextLoc"],"sources":["../../../src/config/files/package.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { Handler } from \"gensync\";\nimport { makeStaticFileCache } from \"./utils.ts\";\n\nimport type { ConfigFile, FilePackageData } from \"./types.ts\";\n\nimport ConfigError from \"../../errors/config-error.ts\";\n\nconst PACKAGE_FILENAME = \"package.json\";\n\nconst readConfigPackage = makeStaticFileCache(\n (filepath, content): ConfigFile => {\n let options;\n try {\n options = JSON.parse(content) as unknown;\n } catch (err) {\n throw new ConfigError(\n `Error while parsing JSON - ${err.message}`,\n filepath,\n );\n }\n\n if (!options) throw new Error(`${filepath}: No config detected`);\n\n if (typeof options !== \"object\") {\n throw new ConfigError(\n `Config returned typeof ${typeof options}`,\n filepath,\n );\n }\n if (Array.isArray(options)) {\n throw new ConfigError(`Expected config object but found array`, filepath);\n }\n\n return {\n filepath,\n dirname: path.dirname(filepath),\n options,\n };\n },\n);\n\n/**\n * Find metadata about the package that this file is inside of. Resolution\n * of Babel's config requires general package information to decide when to\n * search for .babelrc files\n */\nexport function* findPackageData(filepath: string): Handler {\n let pkg = null;\n const directories = [];\n let isPackage = true;\n\n let dirname = path.dirname(filepath);\n while (!pkg && path.basename(dirname) !== \"node_modules\") {\n directories.push(dirname);\n\n pkg = yield* readConfigPackage(path.join(dirname, PACKAGE_FILENAME));\n\n const nextLoc = path.dirname(dirname);\n if (dirname === nextLoc) {\n isPackage = false;\n break;\n }\n dirname = nextLoc;\n }\n\n return { filepath, directories, pkg, isPackage };\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAIA,IAAAE,YAAA,GAAAF,OAAA;AAEA,MAAMG,gBAAgB,GAAG,cAAc;AAEvC,MAAMC,iBAAiB,GAAG,IAAAC,0BAAmB,EAC3C,CAACC,QAAQ,EAAEC,OAAO,KAAiB;EACjC,IAAIC,OAAO;EACX,IAAI;IACFA,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,OAAO,CAAY;EAC1C,CAAC,CAAC,OAAOI,GAAG,EAAE;IACZ,MAAM,IAAIC,oBAAW,CACnB,8BAA8BD,GAA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} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/plugins.js b/node_modules/@babel/core/lib/config/files/plugins.js new file mode 100644 index 0000000..88f82dc --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/plugins.js @@ -0,0 +1,230 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.loadPlugin = loadPlugin; +exports.loadPreset = loadPreset; +exports.resolvePreset = exports.resolvePlugin = void 0; +function _debug() { + const data = require("debug"); + _debug = function () { + return data; + }; + return data; +} +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +var _async = require("../../gensync-utils/async.js"); +var _moduleTypes = require("./module-types.js"); +function _url() { + const data = require("url"); + _url = function () { + return data; + }; + return data; +} +var _importMetaResolve = require("../../vendor/import-meta-resolve.js"); +require("module"); +function _fs() { + const data = require("fs"); + _fs = function () { + return data; + }; + return data; +} +const debug = _debug()("babel:config:loading:files:plugins"); +const EXACT_RE = /^module:/; +const BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-plugin-)/; +const BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\/|babel-preset-)/; +const BABEL_PLUGIN_ORG_RE = /^(@babel\/)(?!plugin-|[^/]+\/)/; +const BABEL_PRESET_ORG_RE = /^(@babel\/)(?!preset-|[^/]+\/)/; +const OTHER_PLUGIN_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-plugin(?:-|\/|$)|[^/]+\/)/; +const OTHER_PRESET_ORG_RE = /^(@(?!babel\/)[^/]+\/)(?![^/]*babel-preset(?:-|\/|$)|[^/]+\/)/; +const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/; +const resolvePlugin = exports.resolvePlugin = resolveStandardizedName.bind(null, "plugin"); +const resolvePreset = exports.resolvePreset = resolveStandardizedName.bind(null, "preset"); +function* loadPlugin(name, dirname) { + const { + filepath, + loader + } = resolvePlugin(name, dirname, yield* (0, _async.isAsync)()); + const value = yield* requireModule("plugin", loader, filepath); + debug("Loaded plugin %o from %o.", name, dirname); + return { + filepath, + value + }; +} +function* loadPreset(name, dirname) { + const { + filepath, + loader + } = resolvePreset(name, dirname, yield* (0, _async.isAsync)()); + const value = yield* requireModule("preset", loader, filepath); + debug("Loaded preset %o from %o.", name, dirname); + return { + filepath, + value + }; +} +function standardizeName(type, name) { + if (_path().isAbsolute(name)) return name; + const isPreset = type === "preset"; + return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, ""); +} +function* resolveAlternativesHelper(type, name) { + const standardizedName = standardizeName(type, name); + const { + error, + value + } = yield standardizedName; + if (!error) return value; + if (error.code !== "MODULE_NOT_FOUND") throw error; + if (standardizedName !== name && !(yield name).error) { + error.message += `\n- If you want to resolve "${name}", use "module:${name}"`; + } + if (!(yield standardizeName(type, "@babel/" + name)).error) { + error.message += `\n- Did you mean "@babel/${name}"?`; + } + const oppositeType = type === "preset" ? "plugin" : "preset"; + if (!(yield standardizeName(oppositeType, name)).error) { + error.message += `\n- Did you accidentally pass a ${oppositeType} as a ${type}?`; + } + if (type === "plugin") { + const transformName = standardizedName.replace("-proposal-", "-transform-"); + if (transformName !== standardizedName && !(yield transformName).error) { + error.message += `\n- Did you mean "${transformName}"?`; + } + } + error.message += `\n +Make sure that all the Babel plugins and presets you are using +are defined as dependencies or devDependencies in your package.json +file. It's possible that the missing plugin is loaded by a preset +you are using that forgot to add the plugin to its dependencies: you +can workaround this problem by explicitly adding the missing package +to your top-level package.json. +`; + throw error; +} +function tryRequireResolve(id, dirname) { + try { + if (dirname) { + return { + error: null, + value: (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, { + paths: [b] + }, M = require("module")) => { + let f = M._findPath(r, M._nodeModulePaths(b).concat(b)); + if (f) return f; + f = new Error(`Cannot resolve module '${r}'`); + f.code = "MODULE_NOT_FOUND"; + throw f; + })(id, { + paths: [dirname] + }) + }; + } else { + return { + error: null, + value: require.resolve(id) + }; + } + } catch (error) { + return { + error, + value: null + }; + } +} +function tryImportMetaResolve(id, options) { + try { + return { + error: null, + value: (0, _importMetaResolve.resolve)(id, options) + }; + } catch (error) { + return { + error, + value: null + }; + } +} +function resolveStandardizedNameForRequire(type, name, dirname) { + const it = resolveAlternativesHelper(type, name); + let res = it.next(); + while (!res.done) { + res = it.next(tryRequireResolve(res.value, dirname)); + } + return { + loader: "require", + filepath: res.value + }; +} +function resolveStandardizedNameForImport(type, name, dirname) { + const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname, "./babel-virtual-resolve-base.js")).href; + const it = resolveAlternativesHelper(type, name); + let res = it.next(); + while (!res.done) { + res = it.next(tryImportMetaResolve(res.value, parentUrl)); + } + return { + loader: "auto", + filepath: (0, _url().fileURLToPath)(res.value) + }; +} +function resolveStandardizedName(type, name, dirname, allowAsync) { + if (!_moduleTypes.supportsESM || !allowAsync) { + return resolveStandardizedNameForRequire(type, name, dirname); + } + try { + const resolved = resolveStandardizedNameForImport(type, name, dirname); + if (!(0, _fs().existsSync)(resolved.filepath)) { + throw Object.assign(new Error(`Could not resolve "${name}" in file ${dirname}.`), { + type: "MODULE_NOT_FOUND" + }); + } + return resolved; + } catch (e) { + try { + return resolveStandardizedNameForRequire(type, name, dirname); + } catch (e2) { + if (e.type === "MODULE_NOT_FOUND") throw e; + if (e2.type === "MODULE_NOT_FOUND") throw e2; + throw e; + } + } +} +{ + var LOADING_MODULES = new Set(); +} +function* requireModule(type, loader, name) { + { + if (!(yield* (0, _async.isAsync)()) && LOADING_MODULES.has(name)) { + throw new Error(`Reentrant ${type} detected trying to load "${name}". This module is not ignored ` + "and is trying to load itself while compiling itself, leading to a dependency cycle. " + 'We recommend adding it to your "ignore" list in your babelrc, or to a .babelignore.'); + } + } + try { + { + LOADING_MODULES.add(name); + } + { + return yield* (0, _moduleTypes.default)(name, loader, `You appear to be using a native ECMAScript module ${type}, ` + "which is only supported when running Babel asynchronously " + "or when using the Node.js `--experimental-require-module` flag.", `You appear to be using a ${type} that contains top-level await, ` + "which is only supported when running Babel asynchronously.", true); + } + } catch (err) { + err.message = `[BABEL]: ${err.message} (While processing: ${name})`; + throw err; + } finally { + { + LOADING_MODULES.delete(name); + } + } +} +0 && 0; + +//# sourceMappingURL=plugins.js.map diff --git a/node_modules/@babel/core/lib/config/files/plugins.js.map b/node_modules/@babel/core/lib/config/files/plugins.js.map new file mode 100644 index 0000000..8285b34 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/plugins.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_debug","data","require","_path","_async","_moduleTypes","_url","_importMetaResolve","_fs","debug","buildDebug","EXACT_RE","BABEL_PLUGIN_PREFIX_RE","BABEL_PRESET_PREFIX_RE","BABEL_PLUGIN_ORG_RE","BABEL_PRESET_ORG_RE","OTHER_PLUGIN_ORG_RE","OTHER_PRESET_ORG_RE","OTHER_ORG_DEFAULT_RE","resolvePlugin","exports","resolveStandardizedName","bind","resolvePreset","loadPlugin","name","dirname","filepath","loader","isAsync","value","requireModule","loadPreset","standardizeName","type","path","isAbsolute","isPreset","replace","resolveAlternativesHelper","standardizedName","error","code","message","oppositeType","transformName","tryRequireResolve","id","v","w","split","process","versions","node","resolve","r","paths","b","M","f","_findPath","_nodeModulePaths","concat","Error","tryImportMetaResolve","options","importMetaResolve","resolveStandardizedNameForRequire","it","res","next","done","resolveStandardizedNameForImport","parentUrl","pathToFileURL","join","href","fileURLToPath","allowAsync","supportsESM","resolved","existsSync","Object","assign","e","e2","LOADING_MODULES","Set","has","add","loadCodeDefault","err","delete"],"sources":["../../../src/config/files/plugins.ts"],"sourcesContent":["/**\n * This file handles all logic for converting string-based configuration references into loaded objects.\n */\n\nimport buildDebug from \"debug\";\nimport path from \"node:path\";\nimport type { Handler } from \"gensync\";\nimport { isAsync } from \"../../gensync-utils/async.ts\";\nimport loadCodeDefault, { supportsESM } from \"./module-types.ts\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\n\nimport { resolve as importMetaResolve } from \"../../vendor/import-meta-resolve.js\";\n\nimport { createRequire } from \"node:module\";\nimport { existsSync } from \"node:fs\";\nconst require = createRequire(import.meta.url);\n\nconst debug = buildDebug(\"babel:config:loading:files:plugins\");\n\nconst EXACT_RE = /^module:/;\nconst BABEL_PLUGIN_PREFIX_RE = /^(?!@|module:|[^/]+\\/|babel-plugin-)/;\nconst BABEL_PRESET_PREFIX_RE = /^(?!@|module:|[^/]+\\/|babel-preset-)/;\nconst BABEL_PLUGIN_ORG_RE = /^(@babel\\/)(?!plugin-|[^/]+\\/)/;\nconst BABEL_PRESET_ORG_RE = /^(@babel\\/)(?!preset-|[^/]+\\/)/;\nconst OTHER_PLUGIN_ORG_RE =\n /^(@(?!babel\\/)[^/]+\\/)(?![^/]*babel-plugin(?:-|\\/|$)|[^/]+\\/)/;\nconst OTHER_PRESET_ORG_RE =\n /^(@(?!babel\\/)[^/]+\\/)(?![^/]*babel-preset(?:-|\\/|$)|[^/]+\\/)/;\nconst OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;\n\nexport const resolvePlugin = resolveStandardizedName.bind(null, \"plugin\");\nexport const resolvePreset = resolveStandardizedName.bind(null, \"preset\");\n\nexport function* loadPlugin(\n name: string,\n dirname: string,\n): Handler<{ filepath: string; value: unknown }> {\n const { filepath, loader } = resolvePlugin(name, dirname, yield* isAsync());\n\n const value = yield* requireModule(\"plugin\", loader, filepath);\n debug(\"Loaded plugin %o from %o.\", name, dirname);\n\n return { filepath, value };\n}\n\nexport function* loadPreset(\n name: string,\n dirname: string,\n): Handler<{ filepath: string; value: unknown }> {\n const { filepath, loader } = resolvePreset(name, dirname, yield* isAsync());\n\n const value = yield* requireModule(\"preset\", loader, filepath);\n\n debug(\"Loaded preset %o from %o.\", name, dirname);\n\n return { filepath, value };\n}\n\nfunction standardizeName(type: \"plugin\" | \"preset\", name: string) {\n // Let absolute and relative paths through.\n if (path.isAbsolute(name)) return name;\n\n const isPreset = type === \"preset\";\n\n return (\n name\n // foo -> babel-preset-foo\n .replace(\n isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE,\n `babel-${type}-`,\n )\n // @babel/es2015 -> @babel/preset-es2015\n .replace(\n isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE,\n `$1${type}-`,\n )\n // @foo/mypreset -> @foo/babel-preset-mypreset\n .replace(\n isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE,\n `$1babel-${type}-`,\n )\n // @foo -> @foo/babel-preset\n .replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`)\n // module:mypreset -> mypreset\n .replace(EXACT_RE, \"\")\n );\n}\n\ntype Result = { error: Error; value: null } | { error: null; value: T };\n\nfunction* resolveAlternativesHelper(\n type: \"plugin\" | \"preset\",\n name: string,\n): Iterator> {\n const standardizedName = standardizeName(type, name);\n const { error, value } = yield standardizedName;\n if (!error) return value;\n\n // @ts-expect-error code may not index error\n if (error.code !== \"MODULE_NOT_FOUND\") throw error;\n\n if (standardizedName !== name && !(yield name).error) {\n error.message += `\\n- If you want to resolve \"${name}\", use \"module:${name}\"`;\n }\n\n if (!(yield standardizeName(type, \"@babel/\" + name)).error) {\n error.message += `\\n- Did you mean \"@babel/${name}\"?`;\n }\n\n const oppositeType = type === \"preset\" ? \"plugin\" : \"preset\";\n if (!(yield standardizeName(oppositeType, name)).error) {\n error.message += `\\n- Did you accidentally pass a ${oppositeType} as a ${type}?`;\n }\n\n if (type === \"plugin\") {\n const transformName = standardizedName.replace(\"-proposal-\", \"-transform-\");\n if (transformName !== standardizedName && !(yield transformName).error) {\n error.message += `\\n- Did you mean \"${transformName}\"?`;\n }\n }\n\n error.message += `\\n\nMake sure that all the Babel plugins and presets you are using\nare defined as dependencies or devDependencies in your package.json\nfile. It's possible that the missing plugin is loaded by a preset\nyou are using that forgot to add the plugin to its dependencies: you\ncan workaround this problem by explicitly adding the missing package\nto your top-level package.json.\n`;\n\n throw error;\n}\n\nfunction tryRequireResolve(\n id: string,\n dirname: string | undefined,\n): Result {\n try {\n if (dirname) {\n return { error: null, value: require.resolve(id, { paths: [dirname] }) };\n } else {\n return { error: null, value: require.resolve(id) };\n }\n } catch (error) {\n return { error, value: null };\n }\n}\n\nfunction tryImportMetaResolve(\n id: Parameters[0],\n options: Parameters[1],\n): Result {\n try {\n return { error: null, value: importMetaResolve(id, options) };\n } catch (error) {\n return { error, value: null };\n }\n}\n\nfunction resolveStandardizedNameForRequire(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n) {\n const it = resolveAlternativesHelper(type, name);\n let res = it.next();\n while (!res.done) {\n res = it.next(tryRequireResolve(res.value, dirname));\n }\n return { loader: \"require\" as const, filepath: res.value };\n}\nfunction resolveStandardizedNameForImport(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n) {\n const parentUrl = pathToFileURL(\n path.join(dirname, \"./babel-virtual-resolve-base.js\"),\n ).href;\n\n const it = resolveAlternativesHelper(type, name);\n let res = it.next();\n while (!res.done) {\n res = it.next(tryImportMetaResolve(res.value, parentUrl));\n }\n return { loader: \"auto\" as const, filepath: fileURLToPath(res.value) };\n}\n\nfunction resolveStandardizedName(\n type: \"plugin\" | \"preset\",\n name: string,\n dirname: string,\n allowAsync: boolean,\n) {\n if (!supportsESM || !allowAsync) {\n return resolveStandardizedNameForRequire(type, name, dirname);\n }\n\n try {\n const resolved = resolveStandardizedNameForImport(type, name, dirname);\n // import-meta-resolve 4.0 does not throw if the module is not found.\n if (!existsSync(resolved.filepath)) {\n throw Object.assign(\n new Error(`Could not resolve \"${name}\" in file ${dirname}.`),\n { type: \"MODULE_NOT_FOUND\" },\n );\n }\n return resolved;\n } catch (e) {\n try {\n return resolveStandardizedNameForRequire(type, name, dirname);\n } catch (e2) {\n if (e.type === \"MODULE_NOT_FOUND\") throw e;\n if (e2.type === \"MODULE_NOT_FOUND\") throw e2;\n throw e;\n }\n }\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var LOADING_MODULES = new Set();\n}\nfunction* requireModule(\n type: string,\n loader: \"require\" | \"auto\",\n name: string,\n): Handler {\n if (!process.env.BABEL_8_BREAKING) {\n if (!(yield* isAsync()) && LOADING_MODULES.has(name)) {\n throw new Error(\n `Reentrant ${type} detected trying to load \"${name}\". This module is not ignored ` +\n \"and is trying to load itself while compiling itself, leading to a dependency cycle. \" +\n 'We recommend adding it to your \"ignore\" list in your babelrc, or to a .babelignore.',\n );\n }\n }\n\n try {\n if (!process.env.BABEL_8_BREAKING) {\n LOADING_MODULES.add(name);\n }\n\n if (process.env.BABEL_8_BREAKING) {\n return yield* loadCodeDefault(\n name,\n loader,\n `You appear to be using a native ECMAScript module ${type}, ` +\n \"which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n `You appear to be using a ${type} that contains top-level await, ` +\n \"which is only supported when running Babel asynchronously.\",\n );\n } else {\n return yield* loadCodeDefault(\n name,\n loader,\n `You appear to be using a native ECMAScript module ${type}, ` +\n \"which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n `You appear to be using a ${type} that contains top-level await, ` +\n \"which is only supported when running Babel asynchronously.\",\n // For backward compatibility, we need to support malformed presets\n // defined as separate named exports rather than a single default\n // export.\n // See packages/babel-core/test/fixtures/option-manager/presets/es2015_named.js\n // @ts-ignore(Babel 7 vs Babel 8) This param has been removed\n true,\n );\n }\n } catch (err) {\n err.message = `[BABEL]: ${err.message} (While processing: ${name})`;\n throw err;\n } finally {\n if (!process.env.BABEL_8_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CAAC;IACH;EACF;EAEA,IAAI;IACiC;MACjC6D,eAAe,CAACG,GAAG,CAAChE,IAAI,CAAC;IAC3B;IAYO;MACL,OAAO,OAAO,IAAAiE,oBAAe,EAC3BjE,IAAI,EACJG,MAAM,EACN,qDAAqDM,IAAI,IAAI,GAC3D,4DAA4D,GAC5D,iEAAiE,EACnE,4BAA4BA,IAAI,kCAAkC,GAChE,4DAA4D,EAM9D,IACF,CAAC;IACH;EACF,CAAC,CAAC,OAAOyD,GAAG,EAAE;IACZA,GAAG,CAAChD,OAAO,GAAG,YAAYgD,GAAG,CAAChD,OAAO,uBAAuBlB,IAAI,GAAG;IACnE,MAAMkE,GAAG;EACX,CAAC,SAAS;IAC2B;MACjCL,eAAe,CAACM,MAAM,CAACnE,IAAI,CAAC;IAC9B;EACF;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/types.js b/node_modules/@babel/core/lib/config/files/types.js new file mode 100644 index 0000000..8fd1422 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/types.js @@ -0,0 +1,5 @@ +"use strict"; + +0 && 0; + +//# sourceMappingURL=types.js.map diff --git a/node_modules/@babel/core/lib/config/files/types.js.map b/node_modules/@babel/core/lib/config/files/types.js.map new file mode 100644 index 0000000..bce052a --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/types.js.map @@ -0,0 +1 @@ +{"version":3,"names":[],"sources":["../../../src/config/files/types.ts"],"sourcesContent":["import type { InputOptions } from \"../index.ts\";\n\nexport type ConfigFile = {\n filepath: string;\n dirname: string;\n options: InputOptions & { babel?: unknown };\n};\n\nexport type IgnoreFile = {\n filepath: string;\n dirname: string;\n ignore: Array;\n};\n\nexport type RelativeConfig = {\n // The actual config, either from package.json#babel, .babelrc, or\n // .babelrc.js, if there was one.\n config: ConfigFile | null;\n // The .babelignore, if there was one.\n ignore: IgnoreFile | null;\n};\n\nexport type FilePackageData = {\n // The file in the package.\n filepath: string;\n // Any ancestor directories of the file that are within the package.\n directories: Array;\n // The contents of the package.json. May not be found if the package just\n // terminated at a node_modules folder without finding one.\n pkg: ConfigFile | null;\n // True if a package.json or node_modules folder was found while traversing\n // the directory structure.\n isPackage: boolean;\n};\n"],"mappings":"","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/files/utils.js b/node_modules/@babel/core/lib/config/files/utils.js new file mode 100644 index 0000000..406aab9 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/utils.js @@ -0,0 +1,36 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.makeStaticFileCache = makeStaticFileCache; +var _caching = require("../caching.js"); +var fs = require("../../gensync-utils/fs.js"); +function _fs2() { + const data = require("fs"); + _fs2 = function () { + return data; + }; + return data; +} +function makeStaticFileCache(fn) { + return (0, _caching.makeStrongCache)(function* (filepath, cache) { + const cached = cache.invalidate(() => fileMtime(filepath)); + if (cached === null) { + return null; + } + return fn(filepath, yield* fs.readFile(filepath, "utf8")); + }); +} +function fileMtime(filepath) { + if (!_fs2().existsSync(filepath)) return null; + try { + return +_fs2().statSync(filepath).mtime; + } catch (e) { + if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e; + } + return null; +} +0 && 0; + +//# sourceMappingURL=utils.js.map diff --git a/node_modules/@babel/core/lib/config/files/utils.js.map b/node_modules/@babel/core/lib/config/files/utils.js.map new file mode 100644 index 0000000..f3be225 --- /dev/null +++ b/node_modules/@babel/core/lib/config/files/utils.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_caching","require","fs","_fs2","data","makeStaticFileCache","fn","makeStrongCache","filepath","cache","cached","invalidate","fileMtime","readFile","nodeFs","existsSync","statSync","mtime","e","code"],"sources":["../../../src/config/files/utils.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\n\nimport { makeStrongCache } from \"../caching.ts\";\nimport type { CacheConfigurator } from \"../caching.ts\";\nimport * as fs from \"../../gensync-utils/fs.ts\";\nimport nodeFs from \"node:fs\";\n\nexport function makeStaticFileCache(\n fn: (filepath: string, contents: string) => T,\n) {\n return makeStrongCache(function* (\n filepath: string,\n cache: CacheConfigurator,\n ): Handler {\n const cached = cache.invalidate(() => fileMtime(filepath));\n\n if (cached === null) {\n return null;\n }\n\n return fn(filepath, yield* fs.readFile(filepath, \"utf8\"));\n });\n}\n\nfunction fileMtime(filepath: string): number | null {\n if (!nodeFs.existsSync(filepath)) return null;\n\n try {\n return +nodeFs.statSync(filepath).mtime;\n } catch (e) {\n if (e.code !== \"ENOENT\" && e.code !== \"ENOTDIR\") throw e;\n }\n\n return null;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,EAAA,GAAAD,OAAA;AACA,SAAAE,KAAA;EAAA,MAAAC,IAAA,GAAAH,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,SAASC,mBAAmBA,CACjCC,EAA6C,EAC7C;EACA,OAAO,IAAAC,wBAAe,EAAC,WACrBC,QAAgB,EAChBC,KAA8B,EACX;IACnB,MAAMC,MAAM,GAAGD,KAAK,CAACE,UAAU,CAAC,MAAMC,SAAS,CAACJ,QAAQ,CAAC,CAAC;IAE1D,IAAIE,MAAM,KAAK,IAAI,EAAE;MACnB,OAAO,IAAI;IACb;IAEA,OAAOJ,EAAE,CAACE,QAAQ,EAAE,OAAON,EAAE,CAACW,QAAQ,CAACL,QAAQ,EAAE,MAAM,CAAC,CAAC;EAC3D,CAAC,CAAC;AACJ;AAEA,SAASI,SAASA,CAACJ,QAAgB,EAAiB;EAClD,IAAI,CAACM,KAAKA,CAAC,CAACC,UAAU,CAACP,QAAQ,CAAC,EAAE,OAAO,IAAI;EAE7C,IAAI;IACF,OAAO,CAACM,KAAKA,CAAC,CAACE,QAAQ,CAACR,QAAQ,CAAC,CAACS,KAAK;EACzC,CAAC,CAAC,OAAOC,CAAC,EAAE;IACV,IAAIA,CAAC,CAACC,IAAI,KAAK,QAAQ,IAAID,CAAC,CAACC,IAAI,KAAK,SAAS,EAAE,MAAMD,CAAC;EAC1D;EAEA,OAAO,IAAI;AACb;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/full.js b/node_modules/@babel/core/lib/config/full.js new file mode 100644 index 0000000..c2477ce --- /dev/null +++ b/node_modules/@babel/core/lib/config/full.js @@ -0,0 +1,312 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _async = require("../gensync-utils/async.js"); +var _util = require("./util.js"); +var context = require("../index.js"); +var _plugin = require("./plugin.js"); +var _item = require("./item.js"); +var _configChain = require("./config-chain.js"); +var _deepArray = require("./helpers/deep-array.js"); +function _traverse() { + const data = require("@babel/traverse"); + _traverse = function () { + return data; + }; + return data; +} +var _caching = require("./caching.js"); +var _options = require("./validation/options.js"); +var _plugins = require("./validation/plugins.js"); +var _configApi = require("./helpers/config-api.js"); +var _partial = require("./partial.js"); +var _configError = require("../errors/config-error.js"); +var _default = exports.default = _gensync()(function* loadFullConfig(inputOpts) { + var _opts$assumptions; + const result = yield* (0, _partial.default)(inputOpts); + if (!result) { + return null; + } + const { + options, + context, + fileHandling + } = result; + if (fileHandling === "ignored") { + return null; + } + const optionDefaults = {}; + const { + plugins, + presets + } = options; + if (!plugins || !presets) { + throw new Error("Assertion failure - plugins and presets exist"); + } + const presetContext = Object.assign({}, context, { + targets: options.targets + }); + const toDescriptor = item => { + const desc = (0, _item.getItemDescriptor)(item); + if (!desc) { + throw new Error("Assertion failure - must be config item"); + } + return desc; + }; + const presetsDescriptors = presets.map(toDescriptor); + const initialPluginsDescriptors = plugins.map(toDescriptor); + const pluginDescriptorsByPass = [[]]; + const passes = []; + const externalDependencies = []; + const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) { + const presets = []; + for (let i = 0; i < rawPresets.length; i++) { + const descriptor = rawPresets[i]; + if (descriptor.options !== false) { + try { + var preset = yield* loadPresetDescriptor(descriptor, presetContext); + } catch (e) { + if (e.code === "BABEL_UNKNOWN_OPTION") { + (0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e); + } + throw e; + } + externalDependencies.push(preset.externalDependencies); + if (descriptor.ownPass) { + presets.push({ + preset: preset.chain, + pass: [] + }); + } else { + presets.unshift({ + preset: preset.chain, + pass: pluginDescriptorsPass + }); + } + } + } + if (presets.length > 0) { + pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass)); + for (const { + preset, + pass + } of presets) { + if (!preset) return true; + pass.push(...preset.plugins); + const ignored = yield* recursePresetDescriptors(preset.presets, pass); + if (ignored) return true; + preset.options.forEach(opts => { + (0, _util.mergeOptions)(optionDefaults, opts); + }); + } + } + })(presetsDescriptors, pluginDescriptorsByPass[0]); + if (ignored) return null; + const opts = optionDefaults; + (0, _util.mergeOptions)(opts, options); + const pluginContext = Object.assign({}, presetContext, { + assumptions: (_opts$assumptions = opts.assumptions) != null ? _opts$assumptions : {} + }); + yield* enhanceError(context, function* loadPluginDescriptors() { + pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors); + for (const descs of pluginDescriptorsByPass) { + const pass = []; + passes.push(pass); + for (let i = 0; i < descs.length; i++) { + const descriptor = descs[i]; + if (descriptor.options !== false) { + try { + var plugin = yield* loadPluginDescriptor(descriptor, pluginContext); + } catch (e) { + if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") { + (0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e); + } + throw e; + } + pass.push(plugin); + externalDependencies.push(plugin.externalDependencies); + } + } + } + })(); + opts.plugins = passes[0]; + opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({ + plugins + })); + opts.passPerPreset = opts.presets.length > 0; + return { + options: opts, + passes: passes, + externalDependencies: (0, _deepArray.finalize)(externalDependencies) + }; +}); +function enhanceError(context, fn) { + return function* (arg1, arg2) { + try { + return yield* fn(arg1, arg2); + } catch (e) { + if (!/^\[BABEL\]/.test(e.message)) { + var _context$filename; + e.message = `[BABEL] ${(_context$filename = context.filename) != null ? _context$filename : "unknown file"}: ${e.message}`; + } + throw e; + } + }; +} +const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function* ({ + value, + options, + dirname, + alias +}, cache) { + if (options === false) throw new Error("Assertion failure"); + options = options || {}; + const externalDependencies = []; + let item = value; + if (typeof value === "function") { + const factory = (0, _async.maybeAsync)(value, `You appear to be using an async plugin/preset, but Babel has been called synchronously`); + const api = Object.assign({}, context, apiFactory(cache, externalDependencies)); + try { + item = yield* factory(api, options, dirname); + } catch (e) { + if (alias) { + e.message += ` (While processing: ${JSON.stringify(alias)})`; + } + throw e; + } + } + if (!item || typeof item !== "object") { + throw new Error("Plugin/Preset did not return an object."); + } + if ((0, _async.isThenable)(item)) { + yield* []; + throw new Error(`You appear to be using a promise as a plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version. ` + `As an alternative, you can prefix the promise with "await". ` + `(While processing: ${JSON.stringify(alias)})`); + } + if (externalDependencies.length > 0 && (!cache.configured() || cache.mode() === "forever")) { + let error = `A plugin/preset has external untracked dependencies ` + `(${externalDependencies[0]}), but the cache `; + if (!cache.configured()) { + error += `has not been configured to be invalidated when the external dependencies change. `; + } else { + error += ` has been configured to never be invalidated. `; + } + error += `Plugins/presets should configure their cache to be invalidated when the external ` + `dependencies change, for example using \`api.cache.invalidate(() => ` + `statSync(filepath).mtimeMs)\` or \`api.cache.never()\`\n` + `(While processing: ${JSON.stringify(alias)})`; + throw new Error(error); + } + return { + value: item, + options, + dirname, + alias, + externalDependencies: (0, _deepArray.finalize)(externalDependencies) + }; +}); +const pluginDescriptorLoader = makeDescriptorLoader(_configApi.makePluginAPI); +const presetDescriptorLoader = makeDescriptorLoader(_configApi.makePresetAPI); +const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({ + value, + options, + dirname, + alias, + externalDependencies +}, cache) { + const pluginObj = (0, _plugins.validatePluginObject)(value); + const plugin = Object.assign({}, pluginObj); + if (plugin.visitor) { + plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor)); + } + if (plugin.inherits) { + const inheritsDescriptor = { + name: undefined, + alias: `${alias}$inherits`, + value: plugin.inherits, + options, + dirname + }; + const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => { + return cache.invalidate(data => run(inheritsDescriptor, data)); + }); + plugin.pre = chainMaybeAsync(inherits.pre, plugin.pre); + plugin.post = chainMaybeAsync(inherits.post, plugin.post); + plugin.manipulateOptions = chainMaybeAsync(inherits.manipulateOptions, plugin.manipulateOptions); + plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]); + if (inherits.externalDependencies.length > 0) { + if (externalDependencies.length === 0) { + externalDependencies = inherits.externalDependencies; + } else { + externalDependencies = (0, _deepArray.finalize)([externalDependencies, inherits.externalDependencies]); + } + } + } + return new _plugin.default(plugin, options, alias, externalDependencies); +}); +function* loadPluginDescriptor(descriptor, context) { + if (descriptor.value instanceof _plugin.default) { + if (descriptor.options) { + throw new Error("Passed options to an existing Plugin instance will not work."); + } + return descriptor.value; + } + return yield* instantiatePlugin(yield* pluginDescriptorLoader(descriptor, context), context); +} +const needsFilename = val => val && typeof val !== "function"; +const validateIfOptionNeedsFilename = (options, descriptor) => { + if (needsFilename(options.test) || needsFilename(options.include) || needsFilename(options.exclude)) { + const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */"; + throw new _configError.default([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n")); + } +}; +const validatePreset = (preset, context, descriptor) => { + if (!context.filename) { + var _options$overrides; + const { + options + } = preset; + validateIfOptionNeedsFilename(options, descriptor); + (_options$overrides = options.overrides) == null || _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor)); + } +}; +const instantiatePreset = (0, _caching.makeWeakCacheSync)(({ + value, + dirname, + alias, + externalDependencies +}) => { + return { + options: (0, _options.validate)("preset", value), + alias, + dirname, + externalDependencies + }; +}); +function* loadPresetDescriptor(descriptor, context) { + const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context)); + validatePreset(preset, context, descriptor); + return { + chain: yield* (0, _configChain.buildPresetChain)(preset, context), + externalDependencies: preset.externalDependencies + }; +} +function chainMaybeAsync(a, b) { + if (!a) return b; + if (!b) return a; + return function (...args) { + const res = a.apply(this, args); + if (res && typeof res.then === "function") { + return res.then(() => b.apply(this, args)); + } + return b.apply(this, args); + }; +} +0 && 0; + +//# sourceMappingURL=full.js.map diff --git a/node_modules/@babel/core/lib/config/full.js.map b/node_modules/@babel/core/lib/config/full.js.map new file mode 100644 index 0000000..8566ebe --- /dev/null +++ b/node_modules/@babel/core/lib/config/full.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_async","_util","context","_plugin","_item","_configChain","_deepArray","_traverse","_caching","_options","_plugins","_configApi","_partial","_configError","_default","exports","default","gensync","loadFullConfig","inputOpts","_opts$assumptions","result","loadPrivatePartialConfig","options","fileHandling","optionDefaults","plugins","presets","Error","presetContext","Object","assign","targets","toDescriptor","item","desc","getItemDescriptor","presetsDescriptors","map","initialPluginsDescriptors","pluginDescriptorsByPass","passes","externalDependencies","ignored","enhanceError","recursePresetDescriptors","rawPresets","pluginDescriptorsPass","i","length","descriptor","preset","loadPresetDescriptor","e","code","checkNoUnwrappedItemOptionPairs","push","ownPass","chain","pass","unshift","splice","o","filter","p","forEach","opts","mergeOptions","pluginContext","assumptions","loadPluginDescriptors","descs","plugin","loadPluginDescriptor","slice","passPerPreset","freezeDeepArray","fn","arg1","arg2","test","message","_context$filename","filename","makeDescriptorLoader","apiFactory","makeWeakCache","value","dirname","alias","cache","factory","maybeAsync","api","JSON","stringify","isThenable","configured","mode","error","pluginDescriptorLoader","makePluginAPI","presetDescriptorLoader","makePresetAPI","instantiatePlugin","pluginObj","validatePluginObject","visitor","traverse","explode","inherits","inheritsDescriptor","name","undefined","forwardAsync","run","invalidate","pre","chainMaybeAsync","post","manipulateOptions","visitors","merge","Plugin","needsFilename","val","validateIfOptionNeedsFilename","include","exclude","formattedPresetName","ConfigError","join","validatePreset","_options$overrides","overrides","overrideOptions","instantiatePreset","makeWeakCacheSync","validate","buildPresetChain","a","b","args","res","apply","then"],"sources":["../../src/config/full.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\nimport {\n forwardAsync,\n maybeAsync,\n isThenable,\n} from \"../gensync-utils/async.ts\";\n\nimport { mergeOptions } from \"./util.ts\";\nimport * as context from \"../index.ts\";\nimport Plugin from \"./plugin.ts\";\nimport { getItemDescriptor } from \"./item.ts\";\nimport { buildPresetChain } from \"./config-chain.ts\";\nimport { finalize as freezeDeepArray } from \"./helpers/deep-array.ts\";\nimport type { DeepArray, ReadonlyDeepArray } from \"./helpers/deep-array.ts\";\nimport type {\n ConfigContext,\n ConfigChain,\n PresetInstance,\n} from \"./config-chain.ts\";\nimport type { UnloadedDescriptor } from \"./config-descriptors.ts\";\nimport traverse from \"@babel/traverse\";\nimport { makeWeakCache, makeWeakCacheSync } from \"./caching.ts\";\nimport type { CacheConfigurator } from \"./caching.ts\";\nimport {\n validate,\n checkNoUnwrappedItemOptionPairs,\n} from \"./validation/options.ts\";\nimport type { InputOptions, PluginItem } from \"./validation/options.ts\";\nimport { validatePluginObject } from \"./validation/plugins.ts\";\nimport { makePluginAPI, makePresetAPI } from \"./helpers/config-api.ts\";\nimport type { PluginAPI, PresetAPI } from \"./helpers/config-api.ts\";\n\nimport loadPrivatePartialConfig from \"./partial.ts\";\nimport type { ResolvedOptions } from \"./validation/options.ts\";\n\nimport type * as Context from \"./cache-contexts.ts\";\nimport ConfigError from \"../errors/config-error.ts\";\n\ntype LoadedDescriptor = {\n value: any;\n options: object;\n dirname: string;\n alias: string;\n externalDependencies: ReadonlyDeepArray;\n};\n\nexport type { InputOptions } from \"./validation/options.ts\";\n\nexport type ResolvedConfig = {\n options: ResolvedOptions;\n passes: PluginPasses;\n externalDependencies: ReadonlyDeepArray;\n};\n\nexport type { Plugin };\nexport type PluginPassList = Array;\nexport type PluginPasses = Array;\n\nexport default gensync(function* loadFullConfig(\n inputOpts: InputOptions,\n): Handler {\n const result = yield* loadPrivatePartialConfig(inputOpts);\n if (!result) {\n return null;\n }\n const { options, context, fileHandling } = result;\n\n if (fileHandling === \"ignored\") {\n return null;\n }\n\n const optionDefaults = {};\n\n const { plugins, presets } = options;\n\n if (!plugins || !presets) {\n throw new Error(\"Assertion failure - plugins and presets exist\");\n }\n\n const presetContext: Context.FullPreset = {\n ...context,\n targets: options.targets,\n };\n\n const toDescriptor = (item: PluginItem) => {\n const desc = getItemDescriptor(item);\n if (!desc) {\n throw new Error(\"Assertion failure - must be config item\");\n }\n\n return desc;\n };\n\n const presetsDescriptors = presets.map(toDescriptor);\n const initialPluginsDescriptors = plugins.map(toDescriptor);\n const pluginDescriptorsByPass: Array>> = [\n [],\n ];\n const passes: Array> = [];\n\n const externalDependencies: DeepArray = [];\n\n const ignored = yield* enhanceError(\n context,\n function* recursePresetDescriptors(\n rawPresets: Array>,\n pluginDescriptorsPass: Array>,\n ): Handler {\n const presets: Array<{\n preset: ConfigChain | null;\n pass: Array>;\n }> = [];\n\n for (let i = 0; i < rawPresets.length; i++) {\n const descriptor = rawPresets[i];\n // @ts-expect-error TODO: disallow false\n if (descriptor.options !== false) {\n try {\n // eslint-disable-next-line no-var\n var preset = yield* loadPresetDescriptor(descriptor, presetContext);\n } catch (e) {\n if (e.code === \"BABEL_UNKNOWN_OPTION\") {\n checkNoUnwrappedItemOptionPairs(rawPresets, i, \"preset\", e);\n }\n throw e;\n }\n\n externalDependencies.push(preset.externalDependencies);\n\n // Presets normally run in reverse order, but if they\n // have their own pass they run after the presets\n // in the previous pass.\n if (descriptor.ownPass) {\n presets.push({ preset: preset.chain, pass: [] });\n } else {\n presets.unshift({\n preset: preset.chain,\n pass: pluginDescriptorsPass,\n });\n }\n }\n }\n\n // resolve presets\n if (presets.length > 0) {\n // The passes are created in the same order as the preset list, but are inserted before any\n // existing additional passes.\n pluginDescriptorsByPass.splice(\n 1,\n 0,\n ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass),\n );\n\n for (const { preset, pass } of presets) {\n if (!preset) return true;\n\n pass.push(...preset.plugins);\n\n const ignored = yield* recursePresetDescriptors(preset.presets, pass);\n if (ignored) return true;\n\n preset.options.forEach(opts => {\n mergeOptions(optionDefaults, opts);\n });\n }\n }\n },\n )(presetsDescriptors, pluginDescriptorsByPass[0]);\n\n if (ignored) return null;\n\n const opts = optionDefaults as ResolvedOptions;\n mergeOptions(opts, options);\n\n const pluginContext: Context.FullPlugin = {\n ...presetContext,\n assumptions: opts.assumptions ?? {},\n };\n\n yield* enhanceError(context, function* loadPluginDescriptors() {\n pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors);\n\n for (const descs of pluginDescriptorsByPass) {\n const pass: Plugin[] = [];\n passes.push(pass);\n\n for (let i = 0; i < descs.length; i++) {\n const descriptor = descs[i];\n // @ts-expect-error TODO: disallow false\n if (descriptor.options !== false) {\n try {\n // eslint-disable-next-line no-var\n var plugin = yield* loadPluginDescriptor(descriptor, pluginContext);\n } catch (e) {\n if (e.code === \"BABEL_UNKNOWN_PLUGIN_PROPERTY\") {\n // print special message for `plugins: [\"@babel/foo\", { foo: \"option\" }]`\n checkNoUnwrappedItemOptionPairs(descs, i, \"plugin\", e);\n }\n throw e;\n }\n pass.push(plugin);\n\n externalDependencies.push(plugin.externalDependencies);\n }\n }\n }\n })();\n\n opts.plugins = passes[0];\n opts.presets = passes\n .slice(1)\n .filter(plugins => plugins.length > 0)\n .map(plugins => ({ plugins }));\n opts.passPerPreset = opts.presets.length > 0;\n\n return {\n options: opts,\n passes: passes,\n externalDependencies: freezeDeepArray(externalDependencies),\n };\n});\n\nfunction enhanceError(context: ConfigContext, fn: T): T {\n return function* (arg1: unknown, arg2: unknown) {\n try {\n return yield* fn(arg1, arg2);\n } catch (e) {\n // There are a few case where thrown errors will try to annotate themselves multiple times, so\n // to keep things simple we just bail out if re-wrapping the message.\n if (!/^\\[BABEL\\]/.test(e.message)) {\n e.message = `[BABEL] ${context.filename ?? \"unknown file\"}: ${\n e.message\n }`;\n }\n\n throw e;\n }\n } as any;\n}\n\n/**\n * Load a generic plugin/preset from the given descriptor loaded from the config object.\n */\nconst makeDescriptorLoader = (\n apiFactory: (\n cache: CacheConfigurator,\n externalDependencies: Array,\n ) => API,\n) =>\n makeWeakCache(function* (\n { value, options, dirname, alias }: UnloadedDescriptor,\n cache: CacheConfigurator,\n ): Handler {\n // Disabled presets should already have been filtered out\n // @ts-expect-error expected\n if (options === false) throw new Error(\"Assertion failure\");\n\n options = options || {};\n\n const externalDependencies: Array = [];\n\n let item: unknown = value;\n if (typeof value === \"function\") {\n const factory = maybeAsync(\n value as (api: API, options: object, dirname: string) => unknown,\n `You appear to be using an async plugin/preset, but Babel has been called synchronously`,\n );\n\n const api = {\n ...context,\n ...apiFactory(cache, externalDependencies),\n };\n try {\n item = yield* factory(api, options, dirname);\n } catch (e) {\n if (alias) {\n e.message += ` (While processing: ${JSON.stringify(alias)})`;\n }\n throw e;\n }\n }\n\n if (!item || typeof item !== \"object\") {\n throw new Error(\"Plugin/Preset did not return an object.\");\n }\n\n if (isThenable(item)) {\n // if we want to support async plugins\n yield* [];\n\n throw new Error(\n `You appear to be using a promise as a plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, ` +\n `you may need to upgrade your @babel/core version. ` +\n `As an alternative, you can prefix the promise with \"await\". ` +\n `(While processing: ${JSON.stringify(alias)})`,\n );\n }\n\n if (\n externalDependencies.length > 0 &&\n (!cache.configured() || cache.mode() === \"forever\")\n ) {\n let error =\n `A plugin/preset has external untracked dependencies ` +\n `(${externalDependencies[0]}), but the cache `;\n if (!cache.configured()) {\n error += `has not been configured to be invalidated when the external dependencies change. `;\n } else {\n error += ` has been configured to never be invalidated. `;\n }\n error +=\n `Plugins/presets should configure their cache to be invalidated when the external ` +\n `dependencies change, for example using \\`api.cache.invalidate(() => ` +\n `statSync(filepath).mtimeMs)\\` or \\`api.cache.never()\\`\\n` +\n `(While processing: ${JSON.stringify(alias)})`;\n\n throw new Error(error);\n }\n\n return {\n value: item,\n options,\n dirname,\n alias,\n externalDependencies: freezeDeepArray(externalDependencies),\n };\n });\n\nconst pluginDescriptorLoader = makeDescriptorLoader<\n Context.SimplePlugin,\n PluginAPI\n>(makePluginAPI);\nconst presetDescriptorLoader = makeDescriptorLoader<\n Context.SimplePreset,\n PresetAPI\n>(makePresetAPI);\n\nconst instantiatePlugin = makeWeakCache(function* (\n { value, options, dirname, alias, externalDependencies }: LoadedDescriptor,\n cache: CacheConfigurator,\n): Handler {\n const pluginObj = validatePluginObject(value);\n\n const plugin = {\n ...pluginObj,\n };\n if (plugin.visitor) {\n plugin.visitor = traverse.explode({\n ...plugin.visitor,\n });\n }\n\n if (plugin.inherits) {\n const inheritsDescriptor: UnloadedDescriptor = {\n name: undefined,\n alias: `${alias}$inherits`,\n value: plugin.inherits,\n options,\n dirname,\n };\n\n const inherits = yield* forwardAsync(loadPluginDescriptor, run => {\n // If the inherited plugin changes, reinstantiate this plugin.\n return cache.invalidate(data => run(inheritsDescriptor, data));\n });\n\n plugin.pre = chainMaybeAsync(inherits.pre, plugin.pre);\n plugin.post = chainMaybeAsync(inherits.post, plugin.post);\n plugin.manipulateOptions = chainMaybeAsync(\n inherits.manipulateOptions,\n plugin.manipulateOptions,\n );\n plugin.visitor = traverse.visitors.merge([\n inherits.visitor || {},\n plugin.visitor || {},\n ]);\n\n if (inherits.externalDependencies.length > 0) {\n if (externalDependencies.length === 0) {\n externalDependencies = inherits.externalDependencies;\n } else {\n externalDependencies = freezeDeepArray([\n externalDependencies,\n inherits.externalDependencies,\n ]);\n }\n }\n }\n\n return new Plugin(plugin, options, alias, externalDependencies);\n});\n\n/**\n * Instantiate a plugin for the given descriptor, returning the plugin/options pair.\n */\nfunction* loadPluginDescriptor(\n descriptor: UnloadedDescriptor,\n context: Context.SimplePlugin,\n): Handler {\n if (descriptor.value instanceof Plugin) {\n if (descriptor.options) {\n throw new Error(\n \"Passed options to an existing Plugin instance will not work.\",\n );\n }\n\n return descriptor.value;\n }\n\n return yield* instantiatePlugin(\n yield* pluginDescriptorLoader(descriptor, context),\n context,\n );\n}\n\nconst needsFilename = (val: unknown) => val && typeof val !== \"function\";\n\nconst validateIfOptionNeedsFilename = (\n options: InputOptions,\n descriptor: UnloadedDescriptor,\n): void => {\n if (\n needsFilename(options.test) ||\n needsFilename(options.include) ||\n needsFilename(options.exclude)\n ) {\n const formattedPresetName = descriptor.name\n ? `\"${descriptor.name}\"`\n : \"/* your preset */\";\n throw new ConfigError(\n [\n `Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`,\n `\\`\\`\\``,\n `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`,\n `\\`\\`\\``,\n `See https://babeljs.io/docs/en/options#filename for more information.`,\n ].join(\"\\n\"),\n );\n }\n};\n\nconst validatePreset = (\n preset: PresetInstance,\n context: ConfigContext,\n descriptor: UnloadedDescriptor,\n): void => {\n if (!context.filename) {\n const { options } = preset;\n validateIfOptionNeedsFilename(options, descriptor);\n options.overrides?.forEach(overrideOptions =>\n validateIfOptionNeedsFilename(overrideOptions, descriptor),\n );\n }\n};\n\nconst instantiatePreset = makeWeakCacheSync(\n ({\n value,\n dirname,\n alias,\n externalDependencies,\n }: LoadedDescriptor): PresetInstance => {\n return {\n options: validate(\"preset\", value),\n alias,\n dirname,\n externalDependencies,\n };\n },\n);\n\n/**\n * Generate a config object that will act as the root of a new nested config.\n */\nfunction* loadPresetDescriptor(\n descriptor: UnloadedDescriptor,\n context: Context.FullPreset,\n): Handler<{\n chain: ConfigChain | null;\n externalDependencies: ReadonlyDeepArray;\n}> {\n const preset = instantiatePreset(\n yield* presetDescriptorLoader(descriptor, context),\n );\n validatePreset(preset, context, descriptor);\n return {\n chain: yield* buildPresetChain(preset, context),\n externalDependencies: preset.externalDependencies,\n };\n}\n\nfunction chainMaybeAsync>(\n a: undefined | ((...args: Args) => R),\n b: undefined | ((...args: Args) => R),\n): (...args: Args) => R {\n if (!a) return b;\n if (!b) return a;\n\n return function (this: unknown, ...args: Args) {\n const res = a.apply(this, args);\n if (res && typeof res.then === \"function\") {\n return res.then(() => b.apply(this, args));\n }\n return b.apply(this, args);\n } as (...args: Args) => R;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAE,MAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAQA,SAAAQ,UAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,SAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAU,QAAA,GAAAT,OAAA;AAEA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,QAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AAGA,IAAAa,QAAA,GAAAb,OAAA;AAIA,IAAAc,YAAA,GAAAd,OAAA;AAAoD,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAsBrCC,SAAMA,CAAC,CAAC,UAAUC,cAAcA,CAC7CC,SAAuB,E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AU,EAAE;MACzC,OAAOF,GAAG,CAACE,IAAI,CAAC,MAAMJ,CAAC,CAACG,KAAK,CAAC,IAAI,EAAEF,IAAI,CAAC,CAAC;IAC5C;IACA,OAAOD,CAAC,CAACG,KAAK,CAAC,IAAI,EAAEF,IAAI,CAAC;EAC5B,CAAC;AACH;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/helpers/config-api.js b/node_modules/@babel/core/lib/config/helpers/config-api.js new file mode 100644 index 0000000..57d3f37 --- /dev/null +++ b/node_modules/@babel/core/lib/config/helpers/config-api.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.makeConfigAPI = makeConfigAPI; +exports.makePluginAPI = makePluginAPI; +exports.makePresetAPI = makePresetAPI; +function _semver() { + const data = require("semver"); + _semver = function () { + return data; + }; + return data; +} +var _index = require("../../index.js"); +var _caching = require("../caching.js"); +function makeConfigAPI(cache) { + const env = value => cache.using(data => { + if (value === undefined) return data.envName; + if (typeof value === "function") { + return (0, _caching.assertSimpleType)(value(data.envName)); + } + return (Array.isArray(value) ? value : [value]).some(entry => { + if (typeof entry !== "string") { + throw new Error("Unexpected non-string value"); + } + return entry === data.envName; + }); + }); + const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller))); + return { + version: _index.version, + cache: cache.simple(), + env, + async: () => false, + caller, + assertVersion + }; +} +function makePresetAPI(cache, externalDependencies) { + const targets = () => JSON.parse(cache.using(data => JSON.stringify(data.targets))); + const addExternalDependency = ref => { + externalDependencies.push(ref); + }; + return Object.assign({}, makeConfigAPI(cache), { + targets, + addExternalDependency + }); +} +function makePluginAPI(cache, externalDependencies) { + const assumption = name => cache.using(data => data.assumptions[name]); + return Object.assign({}, makePresetAPI(cache, externalDependencies), { + assumption + }); +} +function assertVersion(range) { + if (typeof range === "number") { + if (!Number.isInteger(range)) { + throw new Error("Expected string or integer value."); + } + range = `^${range}.0.0-0`; + } + if (typeof range !== "string") { + throw new Error("Expected string or integer value."); + } + if (range === "*" || _semver().satisfies(_index.version, range)) return; + const limit = Error.stackTraceLimit; + if (typeof limit === "number" && limit < 25) { + Error.stackTraceLimit = 25; + } + const err = new Error(`Requires Babel "${range}", but was loaded with "${_index.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`); + if (typeof limit === "number") { + Error.stackTraceLimit = limit; + } + throw Object.assign(err, { + code: "BABEL_VERSION_UNSUPPORTED", + version: _index.version, + range + }); +} +0 && 0; + +//# sourceMappingURL=config-api.js.map diff --git a/node_modules/@babel/core/lib/config/helpers/config-api.js.map b/node_modules/@babel/core/lib/config/helpers/config-api.js.map new file mode 100644 index 0000000..eb11a61 --- /dev/null +++ b/node_modules/@babel/core/lib/config/helpers/config-api.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_semver","data","require","_index","_caching","makeConfigAPI","cache","env","value","using","undefined","envName","assertSimpleType","Array","isArray","some","entry","Error","caller","cb","version","coreVersion","simple","async","assertVersion","makePresetAPI","externalDependencies","targets","JSON","parse","stringify","addExternalDependency","ref","push","Object","assign","makePluginAPI","assumption","name","assumptions","range","Number","isInteger","semver","satisfies","limit","stackTraceLimit","err","code"],"sources":["../../../src/config/helpers/config-api.ts"],"sourcesContent":["import semver from \"semver\";\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nimport { version as coreVersion } from \"../../index.ts\";\nimport { assertSimpleType } from \"../caching.ts\";\nimport type {\n CacheConfigurator,\n SimpleCacheConfigurator,\n SimpleType,\n} from \"../caching.ts\";\n\nimport type {\n AssumptionName,\n CallerMetadata,\n InputOptions,\n} from \"../validation/options.ts\";\n\nimport type * as Context from \"../cache-contexts\";\n\ntype EnvName = NonNullable;\ntype EnvFunction = {\n (): string;\n (extractor: (envName: EnvName) => T): T;\n (envVar: string): boolean;\n (envVars: Array): boolean;\n};\n\ntype CallerFactory = {\n (\n extractor: (callerMetadata: CallerMetadata | undefined) => T,\n ): T;\n (\n extractor: (callerMetadata: CallerMetadata | undefined) => unknown,\n ): SimpleType;\n};\ntype TargetsFunction = () => Targets;\ntype AssumptionFunction = (name: AssumptionName) => boolean | undefined;\n\nexport type ConfigAPI = {\n version: string;\n cache: SimpleCacheConfigurator;\n env: EnvFunction;\n async: () => boolean;\n assertVersion: typeof assertVersion;\n caller?: CallerFactory;\n};\n\nexport type PresetAPI = {\n targets: TargetsFunction;\n addExternalDependency: (ref: string) => void;\n} & ConfigAPI;\n\nexport type PluginAPI = {\n assumption: AssumptionFunction;\n} & PresetAPI;\n\nexport function makeConfigAPI(\n cache: CacheConfigurator,\n): ConfigAPI {\n // TODO(@nicolo-ribaudo): If we remove the explicit type from `value`\n // and the `as any` type cast, TypeScript crashes in an infinite\n // recursion. After upgrading to TS4.7 and finishing the noImplicitAny\n // PR, we should check if it still crashes and report it to the TS team.\n const env: EnvFunction = ((\n value: string | string[] | ((babelEnv: string) => T),\n ) =>\n cache.using(data => {\n if (value === undefined) return data.envName;\n if (typeof value === \"function\") {\n return assertSimpleType(value(data.envName));\n }\n return (Array.isArray(value) ? value : [value]).some(entry => {\n if (typeof entry !== \"string\") {\n throw new Error(\"Unexpected non-string value\");\n }\n return entry === data.envName;\n });\n })) as any;\n\n const caller = (\n cb: (CallerMetadata: CallerMetadata | undefined) => SimpleType,\n ) => cache.using(data => assertSimpleType(cb(data.caller)));\n\n return {\n version: coreVersion,\n cache: cache.simple(),\n // Expose \".env()\" so people can easily get the same env that we expose using the \"env\" key.\n env,\n async: () => false,\n caller,\n assertVersion,\n };\n}\n\nexport function makePresetAPI(\n cache: CacheConfigurator,\n externalDependencies: Array,\n): PresetAPI {\n const targets = () =>\n // We are using JSON.parse/JSON.stringify because it's only possible to cache\n // primitive values. We can safely stringify the targets object because it\n // only contains strings as its properties.\n // Please make the Record and Tuple proposal happen!\n JSON.parse(cache.using(data => JSON.stringify(data.targets)));\n\n const addExternalDependency = (ref: string) => {\n externalDependencies.push(ref);\n };\n\n return { ...makeConfigAPI(cache), targets, addExternalDependency };\n}\n\nexport function makePluginAPI(\n cache: CacheConfigurator,\n externalDependencies: Array,\n): PluginAPI {\n const assumption = (name: string) =>\n cache.using(data => data.assumptions[name]);\n\n return { ...makePresetAPI(cache, externalDependencies), assumption };\n}\n\nfunction assertVersion(range: string | number): void {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n // We want \"*\" to also allow any pre-release, but we do not pass\n // the includePrerelease option to semver.satisfies because we\n // do not want ^7.0.0 to match 8.0.0-alpha.1.\n if (range === \"*\" || semver.satisfies(coreVersion, range)) return;\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n const err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${coreVersion}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(err, {\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version: coreVersion,\n range,\n });\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,IAAAE,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAoDO,SAASG,aAAaA,CAC3BC,KAAqC,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C6B,eAAe,GAAGD,KAAK;EAC/B;EAEA,MAAMX,MAAM,CAACC,MAAM,CAACY,GAAG,EAAE;IACvBC,IAAI,EAAE,2BAA2B;IACjC5B,OAAO,EAAEC,cAAW;IACpBmB;EACF,CAAC,CAAC;AACJ;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/helpers/deep-array.js b/node_modules/@babel/core/lib/config/helpers/deep-array.js new file mode 100644 index 0000000..c611db2 --- /dev/null +++ b/node_modules/@babel/core/lib/config/helpers/deep-array.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.finalize = finalize; +exports.flattenToSet = flattenToSet; +function finalize(deepArr) { + return Object.freeze(deepArr); +} +function flattenToSet(arr) { + const result = new Set(); + const stack = [arr]; + while (stack.length > 0) { + for (const el of stack.pop()) { + if (Array.isArray(el)) stack.push(el);else result.add(el); + } + } + return result; +} +0 && 0; + +//# sourceMappingURL=deep-array.js.map diff --git a/node_modules/@babel/core/lib/config/helpers/deep-array.js.map b/node_modules/@babel/core/lib/config/helpers/deep-array.js.map new file mode 100644 index 0000000..d8c7819 --- /dev/null +++ b/node_modules/@babel/core/lib/config/helpers/deep-array.js.map @@ -0,0 +1 @@ +{"version":3,"names":["finalize","deepArr","Object","freeze","flattenToSet","arr","result","Set","stack","length","el","pop","Array","isArray","push","add"],"sources":["../../../src/config/helpers/deep-array.ts"],"sourcesContent":["export type DeepArray = Array>;\n\n// Just to make sure that DeepArray is not assignable to ReadonlyDeepArray\ndeclare const __marker: unique symbol;\nexport type ReadonlyDeepArray = ReadonlyArray> & {\n [__marker]: true;\n};\n\nexport function finalize(deepArr: DeepArray): ReadonlyDeepArray {\n return Object.freeze(deepArr) as ReadonlyDeepArray;\n}\n\nexport function flattenToSet(\n arr: ReadonlyDeepArray,\n): Set {\n const result = new Set();\n const stack = [arr];\n while (stack.length > 0) {\n for (const el of stack.pop()) {\n if (Array.isArray(el)) stack.push(el as ReadonlyDeepArray);\n else result.add(el as T);\n }\n }\n return result;\n}\n"],"mappings":";;;;;;;AAQO,SAASA,QAAQA,CAAIC,OAAqB,EAAwB;EACvE,OAAOC,MAAM,CAACC,MAAM,CAACF,OAAO,CAAC;AAC/B;AAEO,SAASG,YAAYA,CAC1BC,GAAyB,EACjB;EACR,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAI,CAAC;EAC3B,MAAMC,KAAK,GAAG,CAACH,GAAG,CAAC;EACnB,OAAOG,KAAK,CAACC,MAAM,GAAG,CAAC,EAAE;IACvB,KAAK,MAAMC,EAAE,IAAIF,KAAK,CAACG,GAAG,CAAC,CAAC,EAAE;MAC5B,IAAIC,KAAK,CAACC,OAAO,CAACH,EAAE,CAAC,EAAEF,KAAK,CAACM,IAAI,CAACJ,EAA0B,CAAC,CAAC,KACzDJ,MAAM,CAACS,GAAG,CAACL,EAAO,CAAC;IAC1B;EACF;EACA,OAAOJ,MAAM;AACf;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/helpers/environment.js b/node_modules/@babel/core/lib/config/helpers/environment.js new file mode 100644 index 0000000..a23b80b --- /dev/null +++ b/node_modules/@babel/core/lib/config/helpers/environment.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getEnv = getEnv; +function getEnv(defaultValue = "development") { + return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue; +} +0 && 0; + +//# sourceMappingURL=environment.js.map diff --git a/node_modules/@babel/core/lib/config/helpers/environment.js.map b/node_modules/@babel/core/lib/config/helpers/environment.js.map new file mode 100644 index 0000000..c34fc17 --- /dev/null +++ b/node_modules/@babel/core/lib/config/helpers/environment.js.map @@ -0,0 +1 @@ +{"version":3,"names":["getEnv","defaultValue","process","env","BABEL_ENV","NODE_ENV"],"sources":["../../../src/config/helpers/environment.ts"],"sourcesContent":["export function getEnv(defaultValue: string = \"development\"): string {\n return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;\n}\n"],"mappings":";;;;;;AAAO,SAASA,MAAMA,CAACC,YAAoB,GAAG,aAAa,EAAU;EACnE,OAAOC,OAAO,CAACC,GAAG,CAACC,SAAS,IAAIF,OAAO,CAACC,GAAG,CAACE,QAAQ,IAAIJ,YAAY;AACtE;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/index.js b/node_modules/@babel/core/lib/config/index.js new file mode 100644 index 0000000..b2262b2 --- /dev/null +++ b/node_modules/@babel/core/lib/config/index.js @@ -0,0 +1,93 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createConfigItem = createConfigItem; +exports.createConfigItemAsync = createConfigItemAsync; +exports.createConfigItemSync = createConfigItemSync; +Object.defineProperty(exports, "default", { + enumerable: true, + get: function () { + return _full.default; + } +}); +exports.loadOptions = loadOptions; +exports.loadOptionsAsync = loadOptionsAsync; +exports.loadOptionsSync = loadOptionsSync; +exports.loadPartialConfig = loadPartialConfig; +exports.loadPartialConfigAsync = loadPartialConfigAsync; +exports.loadPartialConfigSync = loadPartialConfigSync; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _full = require("./full.js"); +var _partial = require("./partial.js"); +var _item = require("./item.js"); +var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js"); +const loadPartialConfigRunner = _gensync()(_partial.loadPartialConfig); +function loadPartialConfigAsync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.async)(...args); +} +function loadPartialConfigSync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.sync)(...args); +} +function loadPartialConfig(opts, callback) { + if (callback !== undefined) { + (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(opts, callback); + } else if (typeof opts === "function") { + (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(undefined, opts); + } else { + { + return loadPartialConfigSync(opts); + } + } +} +function* loadOptionsImpl(opts) { + var _config$options; + const config = yield* (0, _full.default)(opts); + return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null; +} +const loadOptionsRunner = _gensync()(loadOptionsImpl); +function loadOptionsAsync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.async)(...args); +} +function loadOptionsSync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.sync)(...args); +} +function loadOptions(opts, callback) { + if (callback !== undefined) { + (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(opts, callback); + } else if (typeof opts === "function") { + (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(undefined, opts); + } else { + { + return loadOptionsSync(opts); + } + } +} +const createConfigItemRunner = _gensync()(_item.createConfigItem); +function createConfigItemAsync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.async)(...args); +} +function createConfigItemSync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.sync)(...args); +} +function createConfigItem(target, options, callback) { + if (callback !== undefined) { + (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, options, callback); + } else if (typeof options === "function") { + (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, undefined, callback); + } else { + { + return createConfigItemSync(target, options); + } + } +} +0 && 0; + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/core/lib/config/index.js.map b/node_modules/@babel/core/lib/config/index.js.map new file mode 100644 index 0000000..aa6013e --- /dev/null +++ b/node_modules/@babel/core/lib/config/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_full","_partial","_item","_rewriteStackTrace","loadPartialConfigRunner","gensync","loadPartialConfigImpl","loadPartialConfigAsync","args","beginHiddenCallStack","async","loadPartialConfigSync","sync","loadPartialConfig","opts","callback","undefined","errback","loadOptionsImpl","_config$options","config","loadFullConfig","options","loadOptionsRunner","loadOptionsAsync","loadOptionsSync","loadOptions","createConfigItemRunner","createConfigItemImpl","createConfigItemAsync","createConfigItemSync","createConfigItem","target"],"sources":["../../src/config/index.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nexport type {\n ResolvedConfig,\n InputOptions,\n PluginPasses,\n Plugin,\n} from \"./full.ts\";\n\nimport type {\n InputOptions,\n PluginTarget,\n ResolvedOptions,\n} from \"./validation/options.ts\";\nexport type { ConfigAPI } from \"./helpers/config-api.ts\";\nimport type {\n PluginAPI as basePluginAPI,\n PresetAPI as basePresetAPI,\n} from \"./helpers/config-api.ts\";\nexport type { PluginObject } from \"./validation/plugins.ts\";\ntype PluginAPI = basePluginAPI & typeof import(\"..\");\ntype PresetAPI = basePresetAPI & typeof import(\"..\");\nexport type { PluginAPI, PresetAPI };\nexport type {\n CallerMetadata,\n NormalizedOptions,\n} from \"./validation/options.ts\";\n\nimport loadFullConfig from \"./full.ts\";\nimport {\n type PartialConfig,\n loadPartialConfig as loadPartialConfigImpl,\n} from \"./partial.ts\";\n\nexport { loadFullConfig as default };\nexport type { PartialConfig } from \"./partial.ts\";\n\nimport { createConfigItem as createConfigItemImpl } from \"./item.ts\";\nimport type { ConfigItem } from \"./item.ts\";\nexport type { ConfigItem };\n\nimport { beginHiddenCallStack } from \"../errors/rewrite-stack-trace.ts\";\n\nconst loadPartialConfigRunner = gensync(loadPartialConfigImpl);\nexport function loadPartialConfigAsync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(loadPartialConfigRunner.async)(...args);\n}\nexport function loadPartialConfigSync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(loadPartialConfigRunner.sync)(...args);\n}\nexport function loadPartialConfig(\n opts: Parameters[0],\n callback?: (err: Error, val: PartialConfig | null) => void,\n) {\n if (callback !== undefined) {\n beginHiddenCallStack(loadPartialConfigRunner.errback)(opts, callback);\n } else if (typeof opts === \"function\") {\n beginHiddenCallStack(loadPartialConfigRunner.errback)(\n undefined,\n opts as (err: Error, val: PartialConfig | null) => void,\n );\n } else {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'loadPartialConfig' function expects a callback. If you need to call it synchronously, please use 'loadPartialConfigSync'.\",\n );\n } else {\n return loadPartialConfigSync(opts);\n }\n }\n}\n\nfunction* loadOptionsImpl(opts: InputOptions): Handler {\n const config = yield* loadFullConfig(opts);\n // NOTE: We want to return \"null\" explicitly, while ?. alone returns undefined\n return config?.options ?? null;\n}\nconst loadOptionsRunner = gensync(loadOptionsImpl);\nexport function loadOptionsAsync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(loadOptionsRunner.async)(...args);\n}\nexport function loadOptionsSync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(loadOptionsRunner.sync)(...args);\n}\nexport function loadOptions(\n opts: Parameters[0],\n callback?: (err: Error, val: ResolvedOptions | null) => void,\n) {\n if (callback !== undefined) {\n beginHiddenCallStack(loadOptionsRunner.errback)(opts, callback);\n } else if (typeof opts === \"function\") {\n beginHiddenCallStack(loadOptionsRunner.errback)(\n undefined,\n opts as (err: Error, val: ResolvedOptions | null) => void,\n );\n } else {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'loadOptions' function expects a callback. If you need to call it synchronously, please use 'loadOptionsSync'.\",\n );\n } else {\n return loadOptionsSync(opts);\n }\n }\n}\n\nconst createConfigItemRunner = gensync(createConfigItemImpl);\nexport function createConfigItemAsync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(createConfigItemRunner.async)(...args);\n}\nexport function createConfigItemSync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(createConfigItemRunner.sync)(...args);\n}\nexport function createConfigItem(\n target: PluginTarget,\n options: Parameters[1],\n callback?: (err: Error, val: ConfigItem | null) => void,\n) {\n if (callback !== undefined) {\n beginHiddenCallStack(createConfigItemRunner.errback)(\n target,\n options,\n callback,\n );\n } else if (typeof options === \"function\") {\n beginHiddenCallStack(createConfigItemRunner.errback)(\n target,\n undefined,\n callback,\n );\n } else {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'createConfigItem' function expects a callback. If you need to call it synchronously, please use 'createConfigItemSync'.\",\n );\n } else {\n return createConfigItemSync(target, options);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AA4BA,IAAAE,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAQA,IAAAG,KAAA,GAAAH,OAAA;AAIA,IAAAI,kBAAA,GAAAJ,OAAA;AAEA,MAAMK,uBAAuB,GAAGC,SAAMA,CAAC,CAACC,0BAAqB,CAAC;AACvD,SAASC,sBAAsBA,CACpC,GAAGC,IAAsD,EACzD;EACA,OAAO,IAAAC,uCAAoB,EAACL,uBAAuB,CAACM,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACrE;AACO,SAASG,qBAAqBA,CACnC,GAAGH,IAAqD,EACxD;EACA,OAAO,IAAAC,uCAAoB,EAACL,uBAAuB,CAACQ,IAAI,CAAC,CAAC,GAAGJ,IAAI,CAAC;AACpE;AACO,SAASK,iBAAiBA,CAC/BC,IAAiD,EACjDC,QAA0D,EAC1D;EACA,IAAIA,QAAQ,KAAKC,SAAS,EAAE;IAC1B,IAAAP,uCAAoB,EAACL,uBAAuB,CAACa,OAAO,CAAC,CAACH,IAAI,EAAEC,QAAQ,CAAC;EACvE,CAAC,MAAM,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;IACrC,IAAAL,uCAAoB,EAACL,uBAAuB,CAACa,OAAO,CAAC,CACnDD,SAAS,EACTF,IACF,CAAC;EACH,CAAC,MAAM;IAKE;MACL,OAAOH,qBAAqB,CAACG,IAAI,CAAC;IACpC;EACF;AACF;AAEA,UAAU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,EAACkB,sBAAsB,CAACf,IAAI,CAAC,CAAC,GAAGJ,IAAI,CAAC;AACnE;AACO,SAASuB,gBAAgBA,CAC9BC,MAAoB,EACpBV,OAAmD,EACnDP,QAAkE,EAClE;EACA,IAAIA,QAAQ,KAAKC,SAAS,EAAE;IAC1B,IAAAP,uCAAoB,EAACkB,sBAAsB,CAACV,OAAO,CAAC,CAClDe,MAAM,EACNV,OAAO,EACPP,QACF,CAAC;EACH,CAAC,MAAM,IAAI,OAAOO,OAAO,KAAK,UAAU,EAAE;IACxC,IAAAb,uCAAoB,EAACkB,sBAAsB,CAACV,OAAO,CAAC,CAClDe,MAAM,EACNhB,SAAS,EACTD,QACF,CAAC;EACH,CAAC,MAAM;IAKE;MACL,OAAOe,oBAAoB,CAACE,MAAM,EAAEV,OAAO,CAAC;IAC9C;EACF;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/item.js b/node_modules/@babel/core/lib/config/item.js new file mode 100644 index 0000000..69cf01f --- /dev/null +++ b/node_modules/@babel/core/lib/config/item.js @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createConfigItem = createConfigItem; +exports.createItemFromDescriptor = createItemFromDescriptor; +exports.getItemDescriptor = getItemDescriptor; +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +var _configDescriptors = require("./config-descriptors.js"); +function createItemFromDescriptor(desc) { + return new ConfigItem(desc); +} +function* createConfigItem(value, { + dirname = ".", + type +} = {}) { + const descriptor = yield* (0, _configDescriptors.createDescriptor)(value, _path().resolve(dirname), { + type, + alias: "programmatic item" + }); + return createItemFromDescriptor(descriptor); +} +const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem"); +function getItemDescriptor(item) { + if (item != null && item[CONFIG_ITEM_BRAND]) { + return item._descriptor; + } + return undefined; +} +class ConfigItem { + constructor(descriptor) { + this._descriptor = void 0; + this[CONFIG_ITEM_BRAND] = true; + this.value = void 0; + this.options = void 0; + this.dirname = void 0; + this.name = void 0; + this.file = void 0; + this._descriptor = descriptor; + Object.defineProperty(this, "_descriptor", { + enumerable: false + }); + Object.defineProperty(this, CONFIG_ITEM_BRAND, { + enumerable: false + }); + this.value = this._descriptor.value; + this.options = this._descriptor.options; + this.dirname = this._descriptor.dirname; + this.name = this._descriptor.name; + this.file = this._descriptor.file ? { + request: this._descriptor.file.request, + resolved: this._descriptor.file.resolved + } : undefined; + Object.freeze(this); + } +} +Object.freeze(ConfigItem.prototype); +0 && 0; + +//# sourceMappingURL=item.js.map diff --git a/node_modules/@babel/core/lib/config/item.js.map b/node_modules/@babel/core/lib/config/item.js.map new file mode 100644 index 0000000..6bdc806 --- /dev/null +++ b/node_modules/@babel/core/lib/config/item.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","data","require","_configDescriptors","createItemFromDescriptor","desc","ConfigItem","createConfigItem","value","dirname","type","descriptor","createDescriptor","path","resolve","alias","CONFIG_ITEM_BRAND","Symbol","for","getItemDescriptor","item","_descriptor","undefined","constructor","options","name","file","Object","defineProperty","enumerable","request","resolved","freeze","prototype"],"sources":["../../src/config/item.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\nimport type { PluginItem, PresetItem } from \"./validation/options.ts\";\n\nimport path from \"node:path\";\nimport { createDescriptor } from \"./config-descriptors.ts\";\n\nimport type { UnloadedDescriptor } from \"./config-descriptors.ts\";\n\nexport function createItemFromDescriptor(\n desc: UnloadedDescriptor,\n): ConfigItem {\n return new ConfigItem(desc);\n}\n\n/**\n * Create a config item using the same value format used in Babel's config\n * files. Items returned from this function should be cached by the caller\n * ideally, as recreating the config item will mean re-resolving the item\n * and re-evaluating the plugin/preset function.\n */\nexport function* createConfigItem(\n value: PluginItem | PresetItem,\n {\n dirname = \".\",\n type,\n }: {\n dirname?: string;\n type?: \"preset\" | \"plugin\";\n } = {},\n): Handler> {\n const descriptor = yield* createDescriptor(value, path.resolve(dirname), {\n type,\n alias: \"programmatic item\",\n });\n\n return createItemFromDescriptor(descriptor);\n}\n\nconst CONFIG_ITEM_BRAND = Symbol.for(\"@babel/core@7 - ConfigItem\");\n\nexport function getItemDescriptor(\n item: unknown,\n): UnloadedDescriptor | void {\n if ((item as any)?.[CONFIG_ITEM_BRAND]) {\n return (item as ConfigItem)._descriptor;\n }\n\n return undefined;\n}\n\nexport type { ConfigItem };\n\n/**\n * A public representation of a plugin/preset that will _eventually_ be load.\n * Users can use this to interact with the results of a loaded Babel\n * configuration.\n *\n * Any changes to public properties of this class should be considered a\n * breaking change to Babel's API.\n */\nclass ConfigItem {\n /**\n * The private underlying descriptor that Babel actually cares about.\n * If you access this, you are a bad person.\n */\n _descriptor: UnloadedDescriptor;\n\n // TODO(Babel 9): Check if this symbol needs to be updated\n /**\n * Used to detect ConfigItem instances from other Babel instances.\n */\n [CONFIG_ITEM_BRAND] = true;\n\n /**\n * The resolved value of the item itself.\n */\n value: object | Function;\n\n /**\n * The options, if any, that were passed to the item.\n * Mutating this will lead to undefined behavior.\n *\n * \"false\" means that this item has been disabled.\n */\n options: object | void | false;\n\n /**\n * The directory that the options for this item are relative to.\n */\n dirname: string;\n\n /**\n * Get the name of the plugin, if the user gave it one.\n */\n name: string | void;\n\n /**\n * Data about the file that the item was loaded from, if Babel knows it.\n */\n file: {\n // The requested path, e.g. \"@babel/env\".\n request: string;\n // The resolved absolute path of the file.\n resolved: string;\n } | void;\n\n constructor(descriptor: UnloadedDescriptor) {\n // Make people less likely to stumble onto this if they are exploring\n // programmatically, and also make sure that if people happen to\n // pass the item through JSON.stringify, it doesn't show up.\n this._descriptor = descriptor;\n Object.defineProperty(this, \"_descriptor\", { enumerable: false });\n\n Object.defineProperty(this, CONFIG_ITEM_BRAND, { enumerable: false });\n\n this.value = this._descriptor.value;\n this.options = this._descriptor.options;\n this.dirname = this._descriptor.dirname;\n this.name = this._descriptor.name;\n this.file = this._descriptor.file\n ? {\n request: this._descriptor.file.request,\n resolved: this._descriptor.file.resolved,\n }\n : undefined;\n\n // Freeze the object to make it clear that people shouldn't expect mutating\n // this object to do anything. A new item should be created if they want\n // to change something.\n Object.freeze(this);\n }\n}\n\nObject.freeze(ConfigItem.prototype);\n"],"mappings":";;;;;;;;AAGA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAE,kBAAA,GAAAD,OAAA;AAIO,SAASE,wBAAwBA,CACtCC,IAA6B,EACZ;EACjB,OAAO,IAAIC,UAAU,CAACD,IAAI,CAAC;AAC7B;AAQO,UAAUE,gBAAgBA,CAC/BC,KAA8B,EAC9B;EACEC,OAAO,GAAG,GAAG;EACbC;AAIF,CAAC,GAAG,CAAC,CAAC,EACoB;EAC1B,MAAMC,UAAU,GAAG,OAAO,IAAAC,mCAAgB,EAACJ,KAAK,EAAEK,MAAGA,CAAC,CAACC,OAAO,CAACL,OAAO,CAAC,EAAE;IACvEC,IAAI;IACJK,KAAK,EAAE;EACT,CAAC,CAAC;EAEF,OAAOX,wBAAwB,CAACO,UAAU,CAAC;AAC7C;AAEA,MAAMK,iBAAiB,GAAGC,MAAM,CAACC,GAAG,CAAC,4BAA4B,CAAC;AAE3D,SAASC,iBAAiBA,CAC/BC,IAAa,EACmB;EAChC,IAAKA,IAAI,YAAJA,IAAI,CAAWJ,iBAAiB,CAAC,EAAE;IACtC,OAAQI,IAAI,CAAqBC,WAAW;EAC9C;EAEA,OAAOC,SAAS;AAClB;AAYA,MAAMhB,UAAU,CAAM;EA8CpBiB,WAAWA,CAACZ,UAAmC,EAAE;IAAA,KAzCjDU,WAAW;IAAA,KAMVL,iBAAiB,IAAI,IAAI;IAAA,KAK1BR,KAAK;IAAA,KAQLgB,OAAO;IAAA,KAKPf,OAAO;IAAA,KAKPgB,IAAI;IAAA,KAKJC,IAAI;IAWF,IAAI,CAACL,WAAW,GAAGV,UAAU;IAC7BgB,MAAM,CAACC,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE;MAAEC,UAAU,EAAE;IAAM,CAAC,CAAC;IAEjEF,MAAM,CAACC,cAAc,CAAC,IAAI,EAAEZ,iBAAiB,EAAE;MAAEa,UAAU,EAAE;IAAM,CAAC,CAAC;IAErE,IAAI,CAACrB,KAAK,GAAG,IAAI,CAACa,WAAW,CAACb,KAAK;IACnC,IAAI,CAACgB,OAAO,GAAG,IAAI,CAACH,WAAW,CAACG,OAAO;IACvC,IAAI,CAACf,OAAO,GAAG,IAAI,CAACY,WAAW,CAACZ,OAAO;IACvC,IAAI,CAACgB,IAAI,GAAG,IAAI,CAACJ,WAAW,CAACI,IAAI;IACjC,IAAI,CAACC,IAAI,GAAG,IAAI,CAACL,WAAW,CAACK,IAAI,GAC7B;MACEI,OAAO,EAAE,IAAI,CAACT,WAAW,CAACK,IAAI,CAACI,OAAO;MACtCC,QAAQ,EAAE,IAAI,CAACV,WAAW,CAACK,IAAI,CAACK;IAClC,CAAC,GACDT,SAAS;IAKbK,MAAM,CAACK,MAAM,CAAC,IAAI,CAAC;EACrB;AACF;AAEAL,MAAM,CAACK,MAAM,CAAC1B,UAAU,CAAC2B,SAAS,CAAC;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/partial.js b/node_modules/@babel/core/lib/config/partial.js new file mode 100644 index 0000000..a5a2f65 --- /dev/null +++ b/node_modules/@babel/core/lib/config/partial.js @@ -0,0 +1,158 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = loadPrivatePartialConfig; +exports.loadPartialConfig = loadPartialConfig; +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +var _plugin = require("./plugin.js"); +var _util = require("./util.js"); +var _item = require("./item.js"); +var _configChain = require("./config-chain.js"); +var _environment = require("./helpers/environment.js"); +var _options = require("./validation/options.js"); +var _index = require("./files/index.js"); +var _resolveTargets = require("./resolve-targets.js"); +const _excluded = ["showIgnoredFiles"]; +function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } +function resolveRootMode(rootDir, rootMode) { + switch (rootMode) { + case "root": + return rootDir; + case "upward-optional": + { + const upwardRootDir = (0, _index.findConfigUpwards)(rootDir); + return upwardRootDir === null ? rootDir : upwardRootDir; + } + case "upward": + { + const upwardRootDir = (0, _index.findConfigUpwards)(rootDir); + if (upwardRootDir !== null) return upwardRootDir; + throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_index.ROOT_CONFIG_FILENAMES.join(", ")}".`), { + code: "BABEL_ROOT_NOT_FOUND", + dirname: rootDir + }); + } + default: + throw new Error(`Assertion failure - unknown rootMode value.`); + } +} +function* loadPrivatePartialConfig(inputOpts) { + if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) { + throw new Error("Babel options must be an object, null, or undefined"); + } + const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {}; + const { + envName = (0, _environment.getEnv)(), + cwd = ".", + root: rootDir = ".", + rootMode = "root", + caller, + cloneInputAst = true + } = args; + const absoluteCwd = _path().resolve(cwd); + const absoluteRootDir = resolveRootMode(_path().resolve(absoluteCwd, rootDir), rootMode); + const filename = typeof args.filename === "string" ? _path().resolve(cwd, args.filename) : undefined; + const showConfigPath = yield* (0, _index.resolveShowConfigPath)(absoluteCwd); + const context = { + filename, + cwd: absoluteCwd, + root: absoluteRootDir, + envName, + caller, + showConfig: showConfigPath === filename + }; + const configChain = yield* (0, _configChain.buildRootChain)(args, context); + if (!configChain) return null; + const merged = { + assumptions: {} + }; + configChain.options.forEach(opts => { + (0, _util.mergeOptions)(merged, opts); + }); + const options = Object.assign({}, merged, { + targets: (0, _resolveTargets.resolveTargets)(merged, absoluteRootDir), + cloneInputAst, + babelrc: false, + configFile: false, + browserslistConfigFile: false, + passPerPreset: false, + envName: context.envName, + cwd: context.cwd, + root: context.root, + rootMode: "root", + filename: typeof context.filename === "string" ? context.filename : undefined, + plugins: configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)), + presets: configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)) + }); + return { + options, + context, + fileHandling: configChain.fileHandling, + ignore: configChain.ignore, + babelrc: configChain.babelrc, + config: configChain.config, + files: configChain.files + }; +} +function* loadPartialConfig(opts) { + let showIgnoredFiles = false; + if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) { + var _opts = opts; + ({ + showIgnoredFiles + } = _opts); + opts = _objectWithoutPropertiesLoose(_opts, _excluded); + _opts; + } + const result = yield* loadPrivatePartialConfig(opts); + if (!result) return null; + const { + options, + babelrc, + ignore, + config, + fileHandling, + files + } = result; + if (fileHandling === "ignored" && !showIgnoredFiles) { + return null; + } + (options.plugins || []).forEach(item => { + if (item.value instanceof _plugin.default) { + throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()"); + } + }); + return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files); +} +class PartialConfig { + constructor(options, babelrc, ignore, config, fileHandling, files) { + this.options = void 0; + this.babelrc = void 0; + this.babelignore = void 0; + this.config = void 0; + this.fileHandling = void 0; + this.files = void 0; + this.options = options; + this.babelignore = ignore; + this.babelrc = babelrc; + this.config = config; + this.fileHandling = fileHandling; + this.files = files; + Object.freeze(this); + } + hasFilesystemConfig() { + return this.babelrc !== undefined || this.config !== undefined; + } +} +Object.freeze(PartialConfig.prototype); +0 && 0; + +//# sourceMappingURL=partial.js.map diff --git a/node_modules/@babel/core/lib/config/partial.js.map b/node_modules/@babel/core/lib/config/partial.js.map new file mode 100644 index 0000000..e54684d --- /dev/null +++ b/node_modules/@babel/core/lib/config/partial.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","data","require","_plugin","_util","_item","_configChain","_environment","_options","_index","_resolveTargets","_excluded","_objectWithoutPropertiesLoose","r","e","t","n","hasOwnProperty","call","indexOf","resolveRootMode","rootDir","rootMode","upwardRootDir","findConfigUpwards","Object","assign","Error","ROOT_CONFIG_FILENAMES","join","code","dirname","loadPrivatePartialConfig","inputOpts","Array","isArray","args","validate","envName","getEnv","cwd","root","caller","cloneInputAst","absoluteCwd","path","resolve","absoluteRootDir","filename","undefined","showConfigPath","resolveShowConfigPath","context","showConfig","configChain","buildRootChain","merged","assumptions","options","forEach","opts","mergeOptions","targets","resolveTargets","babelrc","configFile","browserslistConfigFile","passPerPreset","plugins","map","descriptor","createItemFromDescriptor","presets","fileHandling","ignore","config","files","loadPartialConfig","showIgnoredFiles","_opts","result","item","value","Plugin","PartialConfig","filepath","constructor","babelignore","freeze","hasFilesystemConfig","prototype"],"sources":["../../src/config/partial.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { Handler } from \"gensync\";\nimport Plugin from \"./plugin.ts\";\nimport { mergeOptions } from \"./util.ts\";\nimport { createItemFromDescriptor } from \"./item.ts\";\nimport { buildRootChain } from \"./config-chain.ts\";\nimport type { ConfigContext, FileHandling } from \"./config-chain.ts\";\nimport { getEnv } from \"./helpers/environment.ts\";\nimport { validate } from \"./validation/options.ts\";\n\nimport type {\n RootMode,\n InputOptions,\n NormalizedOptions,\n} from \"./validation/options.ts\";\n\nimport {\n findConfigUpwards,\n resolveShowConfigPath,\n ROOT_CONFIG_FILENAMES,\n} from \"./files/index.ts\";\nimport type { ConfigFile, IgnoreFile } from \"./files/index.ts\";\nimport { resolveTargets } from \"./resolve-targets.ts\";\n\nfunction resolveRootMode(rootDir: string, rootMode: RootMode): string {\n switch (rootMode) {\n case \"root\":\n return rootDir;\n\n case \"upward-optional\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n return upwardRootDir === null ? rootDir : upwardRootDir;\n }\n\n case \"upward\": {\n const upwardRootDir = findConfigUpwards(rootDir);\n if (upwardRootDir !== null) return upwardRootDir;\n\n throw Object.assign(\n new Error(\n `Babel was run with rootMode:\"upward\" but a root could not ` +\n `be found when searching upward from \"${rootDir}\".\\n` +\n `One of the following config files must be in the directory tree: ` +\n `\"${ROOT_CONFIG_FILENAMES.join(\", \")}\".`,\n ) as any,\n {\n code: \"BABEL_ROOT_NOT_FOUND\",\n dirname: rootDir,\n },\n );\n }\n default:\n throw new Error(`Assertion failure - unknown rootMode value.`);\n }\n}\n\nexport type PrivPartialConfig = {\n showIgnoredFiles?: boolean;\n options: NormalizedOptions;\n context: ConfigContext;\n babelrc: ConfigFile | undefined;\n config: ConfigFile | undefined;\n ignore: IgnoreFile | undefined;\n fileHandling: FileHandling;\n files: Set;\n};\n\nexport default function* loadPrivatePartialConfig(\n inputOpts: InputOptions,\n): Handler {\n if (\n inputOpts != null &&\n (typeof inputOpts !== \"object\" || Array.isArray(inputOpts))\n ) {\n throw new Error(\"Babel options must be an object, null, or undefined\");\n }\n\n const args = inputOpts ? validate(\"arguments\", inputOpts) : {};\n\n const {\n envName = getEnv(),\n cwd = \".\",\n root: rootDir = \".\",\n rootMode = \"root\",\n caller,\n cloneInputAst = true,\n } = args;\n const absoluteCwd = path.resolve(cwd);\n const absoluteRootDir = resolveRootMode(\n path.resolve(absoluteCwd, rootDir),\n rootMode,\n );\n\n const filename =\n typeof args.filename === \"string\"\n ? path.resolve(cwd, args.filename)\n : undefined;\n\n const showConfigPath = yield* resolveShowConfigPath(absoluteCwd);\n\n const context: ConfigContext = {\n filename,\n cwd: absoluteCwd,\n root: absoluteRootDir,\n envName,\n caller,\n showConfig: showConfigPath === filename,\n };\n\n const configChain = yield* buildRootChain(args, context);\n if (!configChain) return null;\n\n const merged = {\n assumptions: {},\n };\n configChain.options.forEach(opts => {\n mergeOptions(merged as any, opts);\n });\n\n const options: NormalizedOptions = {\n ...merged,\n targets: resolveTargets(merged, absoluteRootDir),\n\n // Tack the passes onto the object itself so that, if this object is\n // passed back to Babel a second time, it will be in the right structure\n // to not change behavior.\n cloneInputAst,\n babelrc: false,\n configFile: false,\n browserslistConfigFile: false,\n passPerPreset: false,\n envName: context.envName,\n cwd: context.cwd,\n root: context.root,\n rootMode: \"root\",\n filename:\n typeof context.filename === \"string\" ? context.filename : undefined,\n\n plugins: configChain.plugins.map(descriptor =>\n createItemFromDescriptor(descriptor),\n ),\n presets: configChain.presets.map(descriptor =>\n createItemFromDescriptor(descriptor),\n ),\n };\n\n return {\n options,\n context,\n fileHandling: configChain.fileHandling,\n ignore: configChain.ignore,\n babelrc: configChain.babelrc,\n config: configChain.config,\n files: configChain.files,\n };\n}\n\nexport function* loadPartialConfig(\n opts?: InputOptions,\n): Handler {\n let showIgnoredFiles = false;\n // We only extract showIgnoredFiles if opts is an object, so that\n // loadPrivatePartialConfig can throw the appropriate error if it's not.\n if (typeof opts === \"object\" && opts !== null && !Array.isArray(opts)) {\n ({ showIgnoredFiles, ...opts } = opts);\n }\n\n const result: PrivPartialConfig | undefined | null =\n yield* loadPrivatePartialConfig(opts);\n if (!result) return null;\n\n const { options, babelrc, ignore, config, fileHandling, files } = result;\n\n if (fileHandling === \"ignored\" && !showIgnoredFiles) {\n return null;\n }\n\n (options.plugins || []).forEach(item => {\n if (item.value instanceof Plugin) {\n throw new Error(\n \"Passing cached plugin instances is not supported in \" +\n \"babel.loadPartialConfig()\",\n );\n }\n });\n\n return new PartialConfig(\n options,\n babelrc ? babelrc.filepath : undefined,\n ignore ? ignore.filepath : undefined,\n config ? config.filepath : undefined,\n fileHandling,\n files,\n );\n}\n\nexport type { PartialConfig };\n\nclass PartialConfig {\n /**\n * These properties are public, so any changes to them should be considered\n * a breaking change to Babel's API.\n */\n options: NormalizedOptions;\n babelrc: string | undefined;\n babelignore: string | undefined;\n config: string | undefined;\n fileHandling: FileHandling;\n files: Set;\n\n constructor(\n options: NormalizedOptions,\n babelrc: string | undefined,\n ignore: string | undefined,\n config: string | undefined,\n fileHandling: FileHandling,\n files: Set,\n ) {\n this.options = options;\n this.babelignore = ignore;\n this.babelrc = babelrc;\n this.config = config;\n this.fileHandling = fileHandling;\n this.files = files;\n\n // Freeze since this is a public API and it should be extremely obvious that\n // reassigning properties on here does nothing.\n Object.freeze(this);\n }\n\n /**\n * Returns true if there is a config file in the filesystem for this config.\n */\n hasFilesystemConfig(): boolean {\n return this.babelrc !== undefined || this.config !== undefined;\n }\n}\nObject.freeze(PartialConfig.prototype);\n"],"mappings":";;;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AAMA,IAAAQ,eAAA,GAAAR,OAAA;AAAsD,MAAAS,SAAA;AAAA,SAAAC,8BAAAC,CAAA,EAAAC,CAAA,gBAAAD,CAAA,iBAAAE,CAAA,gBAAAC,CAAA,IAAAH,CAAA,SAAAI,cAAA,CAAAC,IAAA,CAAAL,CAAA,EAAAG,CAAA,gBAAAF,CAAA,CAAAK,OAAA,CAAAH,CAAA,aAAAD,CAAA,CAAAC,CAAA,IAAAH,CAAA,CAAAG,CAAA,YAAAD,CAAA;AAEtD,SAASK,eAAeA,CAACC,OAAe,EAAEC,QAAkB,EAAU;EACpE,QAAQA,QAAQ;IACd,KAAK,MAAM;MACT,OAAOD,OAAO;IAEhB,KAAK,iBAAiB;MAAE;QACtB,MAAME,aAAa,GAAG,IAAAC,wBAAiB,EAACH,OAAO,CAAC;QAChD,OAAOE,aAAa,KAAK,IAAI,GAAGF,OAAO,GAAGE,aAAa;MACzD;IAEA,KAAK,QAAQ;MAAE;QACb,MAAMA,aAAa,GA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OAAO,CAACqB,QAAQ,GAAGpC,SAAS,EACtCyB,MAAM,GAAGA,MAAM,CAACW,QAAQ,GAAGpC,SAAS,EACpC0B,MAAM,GAAGA,MAAM,CAACU,QAAQ,GAAGpC,SAAS,EACpCwB,YAAY,EACZG,KACF,CAAC;AACH;AAIA,MAAMQ,aAAa,CAAC;EAYlBE,WAAWA,CACT5B,OAA0B,EAC1BM,OAA2B,EAC3BU,MAA0B,EAC1BC,MAA0B,EAC1BF,YAA0B,EAC1BG,KAAkB,EAClB;IAAA,KAdFlB,OAAO;IAAA,KACPM,OAAO;IAAA,KACPuB,WAAW;IAAA,KACXZ,MAAM;IAAA,KACNF,YAAY;IAAA,KACZG,KAAK;IAUH,IAAI,CAAClB,OAAO,GAAGA,OAAO;IACtB,IAAI,CAAC6B,WAAW,GAAGb,MAAM;IACzB,IAAI,CAACV,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACW,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACF,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACG,KAAK,GAAGA,KAAK;IAIlBnD,MAAM,CAAC+D,MAAM,CAAC,IAAI,CAAC;EACrB;EAKAC,mBAAmBA,CAAA,EAAY;IAC7B,OAAO,IAAI,CAACzB,OAAO,KAAKf,SAAS,IAAI,IAAI,CAAC0B,MAAM,KAAK1B,SAAS;EAChE;AACF;AACAxB,MAAM,CAAC+D,MAAM,CAACJ,aAAa,CAACM,SAAS,CAAC;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/pattern-to-regex.js b/node_modules/@babel/core/lib/config/pattern-to-regex.js new file mode 100644 index 0000000..e061f79 --- /dev/null +++ b/node_modules/@babel/core/lib/config/pattern-to-regex.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = pathToPattern; +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +const sep = `\\${_path().sep}`; +const endSep = `(?:${sep}|$)`; +const substitution = `[^${sep}]+`; +const starPat = `(?:${substitution}${sep})`; +const starPatLast = `(?:${substitution}${endSep})`; +const starStarPat = `${starPat}*?`; +const starStarPatLast = `${starPat}*?${starPatLast}?`; +function escapeRegExp(string) { + return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); +} +function pathToPattern(pattern, dirname) { + const parts = _path().resolve(dirname, pattern).split(_path().sep); + return new RegExp(["^", ...parts.map((part, i) => { + const last = i === parts.length - 1; + if (part === "**") return last ? starStarPatLast : starStarPat; + if (part === "*") return last ? starPatLast : starPat; + if (part.indexOf("*.") === 0) { + return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep); + } + return escapeRegExp(part) + (last ? endSep : sep); + })].join("")); +} +0 && 0; + +//# sourceMappingURL=pattern-to-regex.js.map diff --git a/node_modules/@babel/core/lib/config/pattern-to-regex.js.map b/node_modules/@babel/core/lib/config/pattern-to-regex.js.map new file mode 100644 index 0000000..5a02bc6 --- /dev/null +++ b/node_modules/@babel/core/lib/config/pattern-to-regex.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","data","require","sep","path","endSep","substitution","starPat","starPatLast","starStarPat","starStarPatLast","escapeRegExp","string","replace","pathToPattern","pattern","dirname","parts","resolve","split","RegExp","map","part","i","last","length","indexOf","slice","join"],"sources":["../../src/config/pattern-to-regex.ts"],"sourcesContent":["import path from \"node:path\";\n\nconst sep = `\\\\${path.sep}`;\nconst endSep = `(?:${sep}|$)`;\n\nconst substitution = `[^${sep}]+`;\n\nconst starPat = `(?:${substitution}${sep})`;\nconst starPatLast = `(?:${substitution}${endSep})`;\n\nconst starStarPat = `${starPat}*?`;\nconst starStarPatLast = `${starPat}*?${starPatLast}?`;\n\nfunction escapeRegExp(string: string) {\n return string.replace(/[|\\\\{}()[\\]^$+*?.]/g, \"\\\\$&\");\n}\n\n/**\n * Implement basic pattern matching that will allow users to do the simple\n * tests with * and **. If users want full complex pattern matching, then can\n * always use regex matching, or function validation.\n */\nexport default function pathToPattern(\n pattern: string,\n dirname: string,\n): RegExp {\n const parts = path.resolve(dirname, pattern).split(path.sep);\n\n return new RegExp(\n [\n \"^\",\n ...parts.map((part, i) => {\n const last = i === parts.length - 1;\n\n // ** matches 0 or more path parts.\n if (part === \"**\") return last ? starStarPatLast : starStarPat;\n\n // * matches 1 path part.\n if (part === \"*\") return last ? starPatLast : starPat;\n\n // *.ext matches a wildcard with an extension.\n if (part.indexOf(\"*.\") === 0) {\n return (\n substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep)\n );\n }\n\n // Otherwise match the pattern text.\n return escapeRegExp(part) + (last ? endSep : sep);\n }),\n ].join(\"\"),\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAME,GAAG,GAAG,KAAKC,MAAGA,CAAC,CAACD,GAAG,EAAE;AAC3B,MAAME,MAAM,GAAG,MAAMF,GAAG,KAAK;AAE7B,MAAMG,YAAY,GAAG,KAAKH,GAAG,IAAI;AAEjC,MAAMI,OAAO,GAAG,MAAMD,YAAY,GAAGH,GAAG,GAAG;AAC3C,MAAMK,WAAW,GAAG,MAAMF,YAAY,GAAGD,MAAM,GAAG;AAElD,MAAMI,WAAW,GAAG,GAAGF,OAAO,IAAI;AAClC,MAAMG,eAAe,GAAG,GAAGH,OAAO,KAAKC,WAAW,GAAG;AAErD,SAASG,YAAYA,CAACC,MAAc,EAAE;EACpC,OAAOA,MAAM,CAACC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC;AACtD;AAOe,SAASC,aAAaA,CACnCC,OAAe,EACfC,OAAe,EACP;EACR,MAAMC,KAAK,GAAGb,MAAGA,CAAC,CAACc,OAAO,CAACF,OAAO,EAAED,OAAO,CAAC,CAACI,KAAK,CAACf,MAAGA,CAAC,CAACD,GAAG,CAAC;EAE5D,OAAO,IAAIiB,MAAM,CACf,CACE,GAAG,EACH,GAAGH,KAAK,CAACI,GAAG,CAAC,CAACC,IAAI,EAAEC,CAAC,KAAK;IACxB,MAAMC,IAAI,GAAGD,CAAC,KAAKN,KAAK,CAACQ,MAAM,GAAG,CAAC;IAGnC,IAAIH,IAAI,KAAK,IAAI,EAAE,OAAOE,IAAI,GAAGd,eAAe,GAAGD,WAAW;IAG9D,IAAIa,IAAI,KAAK,GAAG,EAAE,OAAOE,IAAI,GAAGhB,WAAW,GAAGD,OAAO;IAGrD,IAAIe,IAAI,CAACI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;MAC5B,OACEpB,YAAY,GAAGK,YAAY,CAACW,IAAI,CAACK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAIH,IAAI,GAAGnB,MAAM,GAAGF,GAAG,CAAC;IAEtE;IAGA,OAAOQ,YAAY,CAACW,IAAI,CAAC,IAAIE,IAAI,GAAGnB,MAAM,GAAGF,GAAG,CAAC;EACnD,CAAC,CAAC,CACH,CAACyB,IAAI,CAAC,EAAE,CACX,CAAC;AACH;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/plugin.js b/node_modules/@babel/core/lib/config/plugin.js new file mode 100644 index 0000000..21a28cd --- /dev/null +++ b/node_modules/@babel/core/lib/config/plugin.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _deepArray = require("./helpers/deep-array.js"); +class Plugin { + constructor(plugin, options, key, externalDependencies = (0, _deepArray.finalize)([])) { + this.key = void 0; + this.manipulateOptions = void 0; + this.post = void 0; + this.pre = void 0; + this.visitor = void 0; + this.parserOverride = void 0; + this.generatorOverride = void 0; + this.options = void 0; + this.externalDependencies = void 0; + this.key = plugin.name || key; + this.manipulateOptions = plugin.manipulateOptions; + this.post = plugin.post; + this.pre = plugin.pre; + this.visitor = plugin.visitor || {}; + this.parserOverride = plugin.parserOverride; + this.generatorOverride = plugin.generatorOverride; + this.options = options; + this.externalDependencies = externalDependencies; + } +} +exports.default = Plugin; +0 && 0; + +//# sourceMappingURL=plugin.js.map diff --git a/node_modules/@babel/core/lib/config/plugin.js.map b/node_modules/@babel/core/lib/config/plugin.js.map new file mode 100644 index 0000000..c3bccb5 --- /dev/null +++ b/node_modules/@babel/core/lib/config/plugin.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_deepArray","require","Plugin","constructor","plugin","options","key","externalDependencies","finalize","manipulateOptions","post","pre","visitor","parserOverride","generatorOverride","name","exports","default"],"sources":["../../src/config/plugin.ts"],"sourcesContent":["import { finalize } from \"./helpers/deep-array.ts\";\nimport type { ReadonlyDeepArray } from \"./helpers/deep-array.ts\";\nimport type { PluginObject } from \"./validation/plugins.ts\";\n\nexport default class Plugin {\n key: string | undefined | null;\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n post?: PluginObject[\"post\"];\n pre?: PluginObject[\"pre\"];\n visitor: PluginObject[\"visitor\"];\n\n parserOverride?: PluginObject[\"parserOverride\"];\n generatorOverride?: PluginObject[\"generatorOverride\"];\n\n options: object;\n\n externalDependencies: ReadonlyDeepArray;\n\n constructor(\n plugin: PluginObject,\n options: object,\n key?: string,\n externalDependencies: ReadonlyDeepArray = finalize([]),\n ) {\n this.key = plugin.name || key;\n\n this.manipulateOptions = plugin.manipulateOptions;\n this.post = plugin.post;\n this.pre = plugin.pre;\n this.visitor = plugin.visitor || {};\n this.parserOverride = plugin.parserOverride;\n this.generatorOverride = plugin.generatorOverride;\n\n this.options = options;\n this.externalDependencies = externalDependencies;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAIe,MAAMC,MAAM,CAAC;EAc1BC,WAAWA,CACTC,MAAoB,EACpBC,OAAe,EACfC,GAAY,EACZC,oBAA+C,GAAG,IAAAC,mBAAQ,EAAC,EAAE,CAAC,EAC9D;IAAA,KAlBFF,GAAG;IAAA,KACHG,iBAAiB;IAAA,KACjBC,IAAI;IAAA,KACJC,GAAG;IAAA,KACHC,OAAO;IAAA,KAEPC,cAAc;IAAA,KACdC,iBAAiB;IAAA,KAEjBT,OAAO;IAAA,KAEPE,oBAAoB;IAQlB,IAAI,CAACD,GAAG,GAAGF,MAAM,CAACW,IAAI,IAAIT,GAAG;IAE7B,IAAI,CAACG,iBAAiB,GAAGL,MAAM,CAACK,iBAAiB;IACjD,IAAI,CAACC,IAAI,GAAGN,MAAM,CAACM,IAAI;IACvB,IAAI,CAACC,GAAG,GAAGP,MAAM,CAACO,GAAG;IACrB,IAAI,CAACC,OAAO,GAAGR,MAAM,CAACQ,OAAO,IAAI,CAAC,CAAC;IACnC,IAAI,CAACC,cAAc,GAAGT,MAAM,CAACS,cAAc;IAC3C,IAAI,CAACC,iBAAiB,GAAGV,MAAM,CAACU,iBAAiB;IAEjD,IAAI,CAACT,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACE,oBAAoB,GAAGA,oBAAoB;EAClD;AACF;AAACS,OAAA,CAAAC,OAAA,GAAAf,MAAA;AAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/printer.js b/node_modules/@babel/core/lib/config/printer.js new file mode 100644 index 0000000..3ac2c07 --- /dev/null +++ b/node_modules/@babel/core/lib/config/printer.js @@ -0,0 +1,113 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ConfigPrinter = exports.ChainFormatter = void 0; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +const ChainFormatter = exports.ChainFormatter = { + Programmatic: 0, + Config: 1 +}; +const Formatter = { + title(type, callerName, filepath) { + let title = ""; + if (type === ChainFormatter.Programmatic) { + title = "programmatic options"; + if (callerName) { + title += " from " + callerName; + } + } else { + title = "config " + filepath; + } + return title; + }, + loc(index, envName) { + let loc = ""; + if (index != null) { + loc += `.overrides[${index}]`; + } + if (envName != null) { + loc += `.env["${envName}"]`; + } + return loc; + }, + *optionsAndDescriptors(opt) { + const content = Object.assign({}, opt.options); + delete content.overrides; + delete content.env; + const pluginDescriptors = [...(yield* opt.plugins())]; + if (pluginDescriptors.length) { + content.plugins = pluginDescriptors.map(d => descriptorToConfig(d)); + } + const presetDescriptors = [...(yield* opt.presets())]; + if (presetDescriptors.length) { + content.presets = [...presetDescriptors].map(d => descriptorToConfig(d)); + } + return JSON.stringify(content, undefined, 2); + } +}; +function descriptorToConfig(d) { + var _d$file; + let name = (_d$file = d.file) == null ? void 0 : _d$file.request; + if (name == null) { + if (typeof d.value === "object") { + name = d.value; + } else if (typeof d.value === "function") { + name = `[Function: ${d.value.toString().slice(0, 50)} ... ]`; + } + } + if (name == null) { + name = "[Unknown]"; + } + if (d.options === undefined) { + return name; + } else if (d.name == null) { + return [name, d.options]; + } else { + return [name, d.options, d.name]; + } +} +class ConfigPrinter { + constructor() { + this._stack = []; + } + configure(enabled, type, { + callerName, + filepath + }) { + if (!enabled) return () => {}; + return (content, index, envName) => { + this._stack.push({ + type, + callerName, + filepath, + content, + index, + envName + }); + }; + } + static *format(config) { + let title = Formatter.title(config.type, config.callerName, config.filepath); + const loc = Formatter.loc(config.index, config.envName); + if (loc) title += ` ${loc}`; + const content = yield* Formatter.optionsAndDescriptors(config.content); + return `${title}\n${content}`; + } + *output() { + if (this._stack.length === 0) return ""; + const configs = yield* _gensync().all(this._stack.map(s => ConfigPrinter.format(s))); + return configs.join("\n\n"); + } +} +exports.ConfigPrinter = ConfigPrinter; +0 && 0; + +//# sourceMappingURL=printer.js.map diff --git a/node_modules/@babel/core/lib/config/printer.js.map b/node_modules/@babel/core/lib/config/printer.js.map new file mode 100644 index 0000000..0fa277b --- /dev/null +++ b/node_modules/@babel/core/lib/config/printer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","ChainFormatter","exports","Programmatic","Config","Formatter","title","type","callerName","filepath","loc","index","envName","optionsAndDescriptors","opt","content","Object","assign","options","overrides","env","pluginDescriptors","plugins","length","map","d","descriptorToConfig","presetDescriptors","presets","JSON","stringify","undefined","_d$file","name","file","request","value","toString","slice","ConfigPrinter","constructor","_stack","configure","enabled","push","format","config","output","configs","gensync","all","s","join"],"sources":["../../src/config/printer.ts"],"sourcesContent":["import gensync from \"gensync\";\n\nimport type { Handler } from \"gensync\";\n\nimport type {\n OptionsAndDescriptors,\n UnloadedDescriptor,\n} from \"./config-descriptors.ts\";\n\n// todo: Use flow enums when @babel/transform-flow-types supports it\nexport const ChainFormatter = {\n Programmatic: 0,\n Config: 1,\n};\n\ntype PrintableConfig = {\n content: OptionsAndDescriptors;\n type: (typeof ChainFormatter)[keyof typeof ChainFormatter];\n callerName: string | undefined | null;\n filepath: string | undefined | null;\n index: number | undefined | null;\n envName: string | undefined | null;\n};\n\nconst Formatter = {\n title(\n type: (typeof ChainFormatter)[keyof typeof ChainFormatter],\n callerName?: string | null,\n filepath?: string | null,\n ): string {\n let title = \"\";\n if (type === ChainFormatter.Programmatic) {\n title = \"programmatic options\";\n if (callerName) {\n title += \" from \" + callerName;\n }\n } else {\n title = \"config \" + filepath;\n }\n return title;\n },\n loc(index?: number | null, envName?: string | null): string {\n let loc = \"\";\n if (index != null) {\n loc += `.overrides[${index}]`;\n }\n if (envName != null) {\n loc += `.env[\"${envName}\"]`;\n }\n return loc;\n },\n\n *optionsAndDescriptors(opt: OptionsAndDescriptors) {\n const content = { ...opt.options };\n // overrides and env will be printed as separated config items\n delete content.overrides;\n delete content.env;\n // resolve to descriptors\n const pluginDescriptors = [...(yield* opt.plugins())];\n if (pluginDescriptors.length) {\n content.plugins = pluginDescriptors.map(d => descriptorToConfig(d));\n }\n const presetDescriptors = [...(yield* opt.presets())];\n if (presetDescriptors.length) {\n content.presets = [...presetDescriptors].map(d => descriptorToConfig(d));\n }\n return JSON.stringify(content, undefined, 2);\n },\n};\n\nfunction descriptorToConfig(\n d: UnloadedDescriptor,\n): string | [string, object] | [string, object, string] {\n let name: string = d.file?.request;\n if (name == null) {\n if (typeof d.value === \"object\") {\n // @ts-expect-error FIXME\n name = d.value;\n } else if (typeof d.value === \"function\") {\n // If the unloaded descriptor is a function, i.e. `plugins: [ require(\"my-plugin\") ]`,\n // we print the first 50 characters of the function source code and hopefully we can see\n // `name: 'my-plugin'` in the source\n name = `[Function: ${d.value.toString().slice(0, 50)} ... ]`;\n }\n }\n if (name == null) {\n name = \"[Unknown]\";\n }\n if (d.options === undefined) {\n return name;\n } else if (d.name == null) {\n return [name, d.options];\n } else {\n return [name, d.options, d.name];\n }\n}\n\nexport class ConfigPrinter {\n _stack: Array = [];\n configure(\n enabled: boolean,\n type: (typeof ChainFormatter)[keyof typeof ChainFormatter],\n {\n callerName,\n filepath,\n }: {\n callerName?: string;\n filepath?: string;\n },\n ) {\n if (!enabled) return () => {};\n return (\n content: OptionsAndDescriptors,\n index?: number | null,\n envName?: string | null,\n ) => {\n this._stack.push({\n type,\n callerName,\n filepath,\n content,\n index,\n envName,\n });\n };\n }\n static *format(config: PrintableConfig): Handler {\n let title = Formatter.title(\n config.type,\n config.callerName,\n config.filepath,\n );\n const loc = Formatter.loc(config.index, config.envName);\n if (loc) title += ` ${loc}`;\n const content = yield* Formatter.optionsAndDescriptors(config.content);\n return `${title}\\n${content}`;\n }\n\n *output(): Handler {\n if (this._stack.length === 0) return \"\";\n const configs = yield* gensync.all(\n this._stack.map(s => ConfigPrinter.format(s)),\n );\n return configs.join(\"\\n\\n\");\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5BE,YAAY,EAAE,CAAC;EACfC,MAAM,EAAE;AACV,CAAC;AAWD,MAAMC,SAAS,GAAG;EAChBC,KAAKA,CACHC,IAA0D,EAC1DC,UAA0B,EAC1BC,QAAwB,EAChB;IACR,IAAIH,KAAK,GAAG,EAAE;I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C,UAAU;QACVC,QAAQ;QACRM,OAAO;QACPJ,KAAK;QACLC;MACF,CAAC,CAAC;IACJ,CAAC;EACH;EACA,QAAQiC,MAAMA,CAACC,MAAuB,EAAmB;IACvD,IAAIxC,KAAK,GAAGD,SAAS,CAACC,KAAK,CACzBwC,MAAM,CAACvC,IAAI,EACXuC,MAAM,CAACtC,UAAU,EACjBsC,MAAM,CAACrC,QACT,CAAC;IACD,MAAMC,GAAG,GAAGL,SAAS,CAACK,GAAG,CAACoC,MAAM,CAACnC,KAAK,EAAEmC,MAAM,CAAClC,OAAO,CAAC;IACvD,IAAIF,GAAG,EAAEJ,KAAK,IAAI,IAAII,GAAG,EAAE;IAC3B,MAAMK,OAAO,GAAG,OAAOV,SAAS,CAACQ,qBAAqB,CAACiC,MAAM,CAAC/B,OAAO,CAAC;IACtE,OAAO,GAAGT,KAAK,KAAKS,OAAO,EAAE;EAC/B;EAEA,CAACgC,MAAMA,CAAA,EAAoB;IACzB,IAAI,IAAI,CAACN,MAAM,CAAClB,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE;IACvC,MAAMyB,OAAO,GAAG,OAAOC,SAAMA,CAAC,CAACC,GAAG,CAChC,IAAI,CAACT,MAAM,CAACjB,GAAG,CAAC2B,CAAC,IAAIZ,aAAa,CAACM,MAAM,CAACM,CAAC,CAAC,CAC9C,CAAC;IACD,OAAOH,OAAO,CAACI,IAAI,CAAC,MAAM,CAAC;EAC7B;AACF;AAAClD,OAAA,CAAAqC,aAAA,GAAAA,aAAA;AAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/resolve-targets-browser.js b/node_modules/@babel/core/lib/config/resolve-targets-browser.js new file mode 100644 index 0000000..3fdbd88 --- /dev/null +++ b/node_modules/@babel/core/lib/config/resolve-targets-browser.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile; +exports.resolveTargets = resolveTargets; +function _helperCompilationTargets() { + const data = require("@babel/helper-compilation-targets"); + _helperCompilationTargets = function () { + return data; + }; + return data; +} +function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) { + return undefined; +} +function resolveTargets(options, root) { + const optTargets = options.targets; + let targets; + if (typeof optTargets === "string" || Array.isArray(optTargets)) { + targets = { + browsers: optTargets + }; + } else if (optTargets) { + if ("esmodules" in optTargets) { + targets = Object.assign({}, optTargets, { + esmodules: "intersect" + }); + } else { + targets = optTargets; + } + } + return (0, _helperCompilationTargets().default)(targets, { + ignoreBrowserslistConfig: true, + browserslistEnv: options.browserslistEnv + }); +} +0 && 0; + +//# sourceMappingURL=resolve-targets-browser.js.map diff --git a/node_modules/@babel/core/lib/config/resolve-targets-browser.js.map b/node_modules/@babel/core/lib/config/resolve-targets-browser.js.map new file mode 100644 index 0000000..57b49e3 --- /dev/null +++ b/node_modules/@babel/core/lib/config/resolve-targets-browser.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_helperCompilationTargets","data","require","resolveBrowserslistConfigFile","browserslistConfigFile","configFilePath","undefined","resolveTargets","options","root","optTargets","targets","Array","isArray","browsers","Object","assign","esmodules","getTargets","ignoreBrowserslistConfig","browserslistEnv"],"sources":["../../src/config/resolve-targets-browser.ts"],"sourcesContent":["/* c8 ignore start */\n\nimport type { InputOptions } from \"./validation/options.ts\";\nimport getTargets, {\n type InputTargets,\n} from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport function resolveBrowserslistConfigFile(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n browserslistConfigFile: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n configFilePath: string,\n): string | void {\n return undefined;\n}\n\nexport function resolveTargets(\n options: InputOptions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n root: string,\n): Targets {\n const optTargets = options.targets;\n let targets: InputTargets;\n\n if (typeof optTargets === \"string\" || Array.isArray(optTargets)) {\n targets = { browsers: optTargets };\n } else if (optTargets) {\n if (\"esmodules\" in optTargets) {\n targets = { ...optTargets, esmodules: \"intersect\" };\n } else {\n // https://github.com/microsoft/TypeScript/issues/17002\n targets = optTargets as InputTargets;\n }\n }\n\n return getTargets(targets, {\n ignoreBrowserslistConfig: true,\n browserslistEnv: options.browserslistEnv,\n });\n}\n"],"mappings":";;;;;;;AAGA,SAAAA,0BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,yBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMO,SAASE,6BAA6BA,CAE3CC,sBAA8B,EAE9BC,cAAsB,EACP;EACf,OAAOC,SAAS;AAClB;AAEO,SAASC,cAAcA,CAC5BC,OAAqB,EAErBC,IAAY,EACH;EACT,MAAMC,UAAU,GAAGF,OAAO,CAACG,OAAO;EAClC,IAAIA,OAAqB;EAEzB,IAAI,OAAOD,UAAU,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,EAAE;IAC/DC,OAAO,GAAG;MAAEG,QAAQ,EAAEJ;IAAW,CAAC;EACpC,CAAC,MAAM,IAAIA,UAAU,EAAE;IACrB,IAAI,WAAW,IAAIA,UAAU,EAAE;MAC7BC,OAAO,GAAAI,MAAA,CAAAC,MAAA,KAAQN,UAAU;QAAEO,SAAS,EAAE;MAAW,EAAE;IACrD,CAAC,MAAM;MAELN,OAAO,GAAGD,UAA0B;IACtC;EACF;EAEA,OAAO,IAAAQ,mCAAU,EAACP,OAAO,EAAE;IACzBQ,wBAAwB,EAAE,IAAI;IAC9BC,eAAe,EAAEZ,OAAO,CAACY;EAC3B,CAAC,CAAC;AACJ;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/resolve-targets.js b/node_modules/@babel/core/lib/config/resolve-targets.js new file mode 100644 index 0000000..1fc539a --- /dev/null +++ b/node_modules/@babel/core/lib/config/resolve-targets.js @@ -0,0 +1,61 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile; +exports.resolveTargets = resolveTargets; +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +function _helperCompilationTargets() { + const data = require("@babel/helper-compilation-targets"); + _helperCompilationTargets = function () { + return data; + }; + return data; +} +({}); +function resolveBrowserslistConfigFile(browserslistConfigFile, configFileDir) { + return _path().resolve(configFileDir, browserslistConfigFile); +} +function resolveTargets(options, root) { + const optTargets = options.targets; + let targets; + if (typeof optTargets === "string" || Array.isArray(optTargets)) { + targets = { + browsers: optTargets + }; + } else if (optTargets) { + if ("esmodules" in optTargets) { + targets = Object.assign({}, optTargets, { + esmodules: "intersect" + }); + } else { + targets = optTargets; + } + } + const { + browserslistConfigFile + } = options; + let configFile; + let ignoreBrowserslistConfig = false; + if (typeof browserslistConfigFile === "string") { + configFile = browserslistConfigFile; + } else { + ignoreBrowserslistConfig = browserslistConfigFile === false; + } + return (0, _helperCompilationTargets().default)(targets, { + ignoreBrowserslistConfig, + configFile, + configPath: root, + browserslistEnv: options.browserslistEnv + }); +} +0 && 0; + +//# sourceMappingURL=resolve-targets.js.map diff --git a/node_modules/@babel/core/lib/config/resolve-targets.js.map b/node_modules/@babel/core/lib/config/resolve-targets.js.map new file mode 100644 index 0000000..1ab3b83 --- /dev/null +++ b/node_modules/@babel/core/lib/config/resolve-targets.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","data","require","_helperCompilationTargets","resolveBrowserslistConfigFile","browserslistConfigFile","configFileDir","path","resolve","resolveTargets","options","root","optTargets","targets","Array","isArray","browsers","Object","assign","esmodules","configFile","ignoreBrowserslistConfig","getTargets","configPath","browserslistEnv"],"sources":["../../src/config/resolve-targets.ts"],"sourcesContent":["type browserType = typeof import(\"./resolve-targets-browser\");\ntype nodeType = typeof import(\"./resolve-targets\");\n\n// Kind of gross, but essentially asserting that the exports of this module are the same as the\n// exports of index-browser, since this file may be replaced at bundle time with index-browser.\n({}) as any as browserType as nodeType;\n\nimport type { InputOptions } from \"./validation/options.ts\";\nimport path from \"node:path\";\nimport getTargets, {\n type InputTargets,\n} from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport function resolveBrowserslistConfigFile(\n browserslistConfigFile: string,\n configFileDir: string,\n): string | undefined {\n return path.resolve(configFileDir, browserslistConfigFile);\n}\n\nexport function resolveTargets(options: InputOptions, root: string): Targets {\n const optTargets = options.targets;\n let targets: InputTargets;\n\n if (typeof optTargets === \"string\" || Array.isArray(optTargets)) {\n targets = { browsers: optTargets };\n } else if (optTargets) {\n if (\"esmodules\" in optTargets) {\n targets = { ...optTargets, esmodules: \"intersect\" };\n } else {\n // https://github.com/microsoft/TypeScript/issues/17002\n targets = optTargets as InputTargets;\n }\n }\n\n const { browserslistConfigFile } = options;\n let configFile;\n let ignoreBrowserslistConfig = false;\n if (typeof browserslistConfigFile === \"string\") {\n configFile = browserslistConfigFile;\n } else {\n ignoreBrowserslistConfig = browserslistConfigFile === false;\n }\n\n return getTargets(targets, {\n ignoreBrowserslistConfig,\n configFile,\n configPath: root,\n browserslistEnv: options.browserslistEnv,\n });\n}\n"],"mappings":";;;;;;;AAQA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,0BAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,yBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAJA,CAAC,CAAC,CAAC;AAUI,SAASG,6BAA6BA,CAC3CC,sBAA8B,EAC9BC,aAAqB,EACD;EACpB,OAAOC,MAAGA,CAAC,CAACC,OAAO,CAACF,aAAa,EAAED,sBAAsB,CAAC;AAC5D;AAEO,SAASI,cAAcA,CAACC,OAAqB,EAAEC,IAAY,EAAW;EAC3E,MAAMC,UAAU,GAAGF,OAAO,CAACG,OAAO;EAClC,IAAIA,OAAqB;EAEzB,IAAI,OAAOD,UAAU,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,EAAE;IAC/DC,OAAO,GAAG;MAAEG,QAAQ,EAAEJ;IAAW,CAAC;EACpC,CAAC,MAAM,IAAIA,UAAU,EAAE;IACrB,IAAI,WAAW,IAAIA,UAAU,EAAE;MAC7BC,OAAO,GAAAI,MAAA,CAAAC,MAAA,KAAQN,UAAU;QAAEO,SAAS,EAAE;MAAW,EAAE;IACrD,CAAC,MAAM;MAELN,OAAO,GAAGD,UAA0B;IACtC;EACF;EAEA,MAAM;IAAEP;EAAuB,CAAC,GAAGK,OAAO;EAC1C,IAAIU,UAAU;EACd,IAAIC,wBAAwB,GAAG,KAAK;EACpC,IAAI,OAAOhB,sBAAsB,KAAK,QAAQ,EAAE;IAC9Ce,UAAU,GAAGf,sBAAsB;EACrC,CAAC,MAAM;IACLgB,wBAAwB,GAAGhB,sBAAsB,KAAK,KAAK;EAC7D;EAEA,OAAO,IAAAiB,mCAAU,EAACT,OAAO,EAAE;IACzBQ,wBAAwB;IACxBD,UAAU;IACVG,UAAU,EAAEZ,IAAI;IAChBa,eAAe,EAAEd,OAAO,CAACc;EAC3B,CAAC,CAAC;AACJ;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/util.js b/node_modules/@babel/core/lib/config/util.js new file mode 100644 index 0000000..077f1af --- /dev/null +++ b/node_modules/@babel/core/lib/config/util.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIterableIterator = isIterableIterator; +exports.mergeOptions = mergeOptions; +function mergeOptions(target, source) { + for (const k of Object.keys(source)) { + if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) { + const parserOpts = source[k]; + const targetObj = target[k] || (target[k] = {}); + mergeDefaultFields(targetObj, parserOpts); + } else { + const val = source[k]; + if (val !== undefined) target[k] = val; + } + } +} +function mergeDefaultFields(target, source) { + for (const k of Object.keys(source)) { + const val = source[k]; + if (val !== undefined) target[k] = val; + } +} +function isIterableIterator(value) { + return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function"; +} +0 && 0; + +//# sourceMappingURL=util.js.map diff --git a/node_modules/@babel/core/lib/config/util.js.map b/node_modules/@babel/core/lib/config/util.js.map new file mode 100644 index 0000000..2bdc742 --- /dev/null +++ b/node_modules/@babel/core/lib/config/util.js.map @@ -0,0 +1 @@ +{"version":3,"names":["mergeOptions","target","source","k","Object","keys","parserOpts","targetObj","mergeDefaultFields","val","undefined","isIterableIterator","value","next","Symbol","iterator"],"sources":["../../src/config/util.ts"],"sourcesContent":["import type { InputOptions, ResolvedOptions } from \"./validation/options.ts\";\n\nexport function mergeOptions(\n target: InputOptions | ResolvedOptions,\n source: InputOptions,\n): void {\n for (const k of Object.keys(source)) {\n if (\n (k === \"parserOpts\" || k === \"generatorOpts\" || k === \"assumptions\") &&\n source[k]\n ) {\n const parserOpts = source[k];\n const targetObj = target[k] || (target[k] = {});\n mergeDefaultFields(targetObj, parserOpts);\n } else {\n //@ts-expect-error k must index source\n const val = source[k];\n //@ts-expect-error assigning source to target\n if (val !== undefined) target[k] = val as any;\n }\n }\n}\n\nfunction mergeDefaultFields(target: T, source: T) {\n for (const k of Object.keys(source) as (keyof T)[]) {\n const val = source[k];\n if (val !== undefined) target[k] = val;\n }\n}\n\nexport function isIterableIterator(value: any): value is IterableIterator {\n return (\n !!value &&\n typeof value.next === \"function\" &&\n typeof value[Symbol.iterator] === \"function\"\n );\n}\n"],"mappings":";;;;;;;AAEO,SAASA,YAAYA,CAC1BC,MAAsC,EACtCC,MAAoB,EACd;EACN,KAAK,MAAMC,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,EAAE;IACnC,IACE,CAACC,CAAC,KAAK,YAAY,IAAIA,CAAC,KAAK,eAAe,IAAIA,CAAC,KAAK,aAAa,KACnED,MAAM,CAACC,CAAC,CAAC,EACT;MACA,MAAMG,UAAU,GAAGJ,MAAM,CAACC,CAAC,CAAC;MAC5B,MAAMI,SAAS,GAAGN,MAAM,CAACE,CAAC,CAAC,KAAKF,MAAM,CAACE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;MAC/CK,kBAAkB,CAACD,SAAS,EAAED,UAAU,CAAC;IAC3C,CAAC,MAAM;MAEL,MAAMG,GAAG,GAAGP,MAAM,CAACC,CAAC,CAAC;MAErB,IAAIM,GAAG,KAAKC,SAAS,EAAET,MAAM,CAACE,CAAC,CAAC,GAAGM,GAAU;IAC/C;EACF;AACF;AAEA,SAASD,kBAAkBA,CAAmBP,MAAS,EAAEC,MAAS,EAAE;EAClE,KAAK,MAAMC,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,EAAiB;IAClD,MAAMO,GAAG,GAAGP,MAAM,CAACC,CAAC,CAAC;IACrB,IAAIM,GAAG,KAAKC,SAAS,EAAET,MAAM,CAACE,CAAC,CAAC,GAAGM,GAAG;EACxC;AACF;AAEO,SAASE,kBAAkBA,CAACC,KAAU,EAAkC;EAC7E,OACE,CAAC,CAACA,KAAK,IACP,OAAOA,KAAK,CAACC,IAAI,KAAK,UAAU,IAChC,OAAOD,KAAK,CAACE,MAAM,CAACC,QAAQ,CAAC,KAAK,UAAU;AAEhD;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/validation/option-assertions.js b/node_modules/@babel/core/lib/config/validation/option-assertions.js new file mode 100644 index 0000000..0227971 --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/option-assertions.js @@ -0,0 +1,277 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.access = access; +exports.assertArray = assertArray; +exports.assertAssumptions = assertAssumptions; +exports.assertBabelrcSearch = assertBabelrcSearch; +exports.assertBoolean = assertBoolean; +exports.assertCallerMetadata = assertCallerMetadata; +exports.assertCompact = assertCompact; +exports.assertConfigApplicableTest = assertConfigApplicableTest; +exports.assertConfigFileSearch = assertConfigFileSearch; +exports.assertFunction = assertFunction; +exports.assertIgnoreList = assertIgnoreList; +exports.assertInputSourceMap = assertInputSourceMap; +exports.assertObject = assertObject; +exports.assertPluginList = assertPluginList; +exports.assertRootMode = assertRootMode; +exports.assertSourceMaps = assertSourceMaps; +exports.assertSourceType = assertSourceType; +exports.assertString = assertString; +exports.assertTargets = assertTargets; +exports.msg = msg; +function _helperCompilationTargets() { + const data = require("@babel/helper-compilation-targets"); + _helperCompilationTargets = function () { + return data; + }; + return data; +} +var _options = require("./options.js"); +function msg(loc) { + switch (loc.type) { + case "root": + return ``; + case "env": + return `${msg(loc.parent)}.env["${loc.name}"]`; + case "overrides": + return `${msg(loc.parent)}.overrides[${loc.index}]`; + case "option": + return `${msg(loc.parent)}.${loc.name}`; + case "access": + return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`; + default: + throw new Error(`Assertion failure: Unknown type ${loc.type}`); + } +} +function access(loc, name) { + return { + type: "access", + name, + parent: loc + }; +} +function assertRootMode(loc, value) { + if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") { + throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`); + } + return value; +} +function assertSourceMaps(loc, value) { + if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") { + throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`); + } + return value; +} +function assertCompact(loc, value) { + if (value !== undefined && typeof value !== "boolean" && value !== "auto") { + throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`); + } + return value; +} +function assertSourceType(loc, value) { + if (value !== undefined && value !== "module" && value !== "commonjs" && value !== "script" && value !== "unambiguous") { + throw new Error(`${msg(loc)} must be "module", "commonjs", "script", "unambiguous", or undefined`); + } + return value; +} +function assertCallerMetadata(loc, value) { + const obj = assertObject(loc, value); + if (obj) { + if (typeof obj.name !== "string") { + throw new Error(`${msg(loc)} set but does not contain "name" property string`); + } + for (const prop of Object.keys(obj)) { + const propLoc = access(loc, prop); + const value = obj[prop]; + if (value != null && typeof value !== "boolean" && typeof value !== "string" && typeof value !== "number") { + throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`); + } + } + } + return value; +} +function assertInputSourceMap(loc, value) { + if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) { + throw new Error(`${msg(loc)} must be a boolean, object, or undefined`); + } + return value; +} +function assertString(loc, value) { + if (value !== undefined && typeof value !== "string") { + throw new Error(`${msg(loc)} must be a string, or undefined`); + } + return value; +} +function assertFunction(loc, value) { + if (value !== undefined && typeof value !== "function") { + throw new Error(`${msg(loc)} must be a function, or undefined`); + } + return value; +} +function assertBoolean(loc, value) { + if (value !== undefined && typeof value !== "boolean") { + throw new Error(`${msg(loc)} must be a boolean, or undefined`); + } + return value; +} +function assertObject(loc, value) { + if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) { + throw new Error(`${msg(loc)} must be an object, or undefined`); + } + return value; +} +function assertArray(loc, value) { + if (value != null && !Array.isArray(value)) { + throw new Error(`${msg(loc)} must be an array, or undefined`); + } + return value; +} +function assertIgnoreList(loc, value) { + const arr = assertArray(loc, value); + arr == null || arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item)); + return arr; +} +function assertIgnoreItem(loc, value) { + if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) { + throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`); + } + return value; +} +function assertConfigApplicableTest(loc, value) { + if (value === undefined) { + return value; + } + if (Array.isArray(value)) { + value.forEach((item, i) => { + if (!checkValidTest(item)) { + throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); + } + }); + } else if (!checkValidTest(value)) { + throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`); + } + return value; +} +function checkValidTest(value) { + return typeof value === "string" || typeof value === "function" || value instanceof RegExp; +} +function assertConfigFileSearch(loc, value) { + if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") { + throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`); + } + return value; +} +function assertBabelrcSearch(loc, value) { + if (value === undefined || typeof value === "boolean") { + return value; + } + if (Array.isArray(value)) { + value.forEach((item, i) => { + if (!checkValidTest(item)) { + throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); + } + }); + } else if (!checkValidTest(value)) { + throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`); + } + return value; +} +function assertPluginList(loc, value) { + const arr = assertArray(loc, value); + if (arr) { + arr.forEach((item, i) => assertPluginItem(access(loc, i), item)); + } + return arr; +} +function assertPluginItem(loc, value) { + if (Array.isArray(value)) { + if (value.length === 0) { + throw new Error(`${msg(loc)} must include an object`); + } + if (value.length > 3) { + throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`); + } + assertPluginTarget(access(loc, 0), value[0]); + if (value.length > 1) { + const opts = value[1]; + if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) { + throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`); + } + } + if (value.length === 3) { + const name = value[2]; + if (name !== undefined && typeof name !== "string") { + throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`); + } + } + } else { + assertPluginTarget(loc, value); + } + return value; +} +function assertPluginTarget(loc, value) { + if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") { + throw new Error(`${msg(loc)} must be a string, object, function`); + } + return value; +} +function assertTargets(loc, value) { + if ((0, _helperCompilationTargets().isBrowsersQueryValid)(value)) return value; + if (typeof value !== "object" || !value || Array.isArray(value)) { + throw new Error(`${msg(loc)} must be a string, an array of strings or an object`); + } + const browsersLoc = access(loc, "browsers"); + const esmodulesLoc = access(loc, "esmodules"); + assertBrowsersList(browsersLoc, value.browsers); + assertBoolean(esmodulesLoc, value.esmodules); + for (const key of Object.keys(value)) { + const val = value[key]; + const subLoc = access(loc, key); + if (key === "esmodules") assertBoolean(subLoc, val);else if (key === "browsers") assertBrowsersList(subLoc, val);else if (!hasOwnProperty.call(_helperCompilationTargets().TargetNames, key)) { + const validTargets = Object.keys(_helperCompilationTargets().TargetNames).join(", "); + throw new Error(`${msg(subLoc)} is not a valid target. Supported targets are ${validTargets}`); + } else assertBrowserVersion(subLoc, val); + } + return value; +} +function assertBrowsersList(loc, value) { + if (value !== undefined && !(0, _helperCompilationTargets().isBrowsersQueryValid)(value)) { + throw new Error(`${msg(loc)} must be undefined, a string or an array of strings`); + } +} +function assertBrowserVersion(loc, value) { + if (typeof value === "number" && Math.round(value) === value) return; + if (typeof value === "string") return; + throw new Error(`${msg(loc)} must be a string or an integer number`); +} +function assertAssumptions(loc, value) { + if (value === undefined) return; + if (typeof value !== "object" || value === null) { + throw new Error(`${msg(loc)} must be an object or undefined.`); + } + let root = loc; + do { + root = root.parent; + } while (root.type !== "root"); + const inPreset = root.source === "preset"; + for (const name of Object.keys(value)) { + const subLoc = access(loc, name); + if (!_options.assumptionsNames.has(name)) { + throw new Error(`${msg(subLoc)} is not a supported assumption.`); + } + if (typeof value[name] !== "boolean") { + throw new Error(`${msg(subLoc)} must be a boolean.`); + } + if (inPreset && value[name] === false) { + throw new Error(`${msg(subLoc)} cannot be set to 'false' inside presets.`); + } + } + return value; +} +0 && 0; + +//# sourceMappingURL=option-assertions.js.map diff --git a/node_modules/@babel/core/lib/config/validation/option-assertions.js.map b/node_modules/@babel/core/lib/config/validation/option-assertions.js.map new file mode 100644 index 0000000..6f12483 --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/option-assertions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_helperCompilationTargets","data","require","_options","msg","loc","type","parent","name","index","JSON","stringify","Error","access","assertRootMode","value","undefined","assertSourceMaps","assertCompact","assertSourceType","assertCallerMetadata","obj","assertObject","prop","Object","keys","propLoc","assertInputSourceMap","assertString","assertFunction","assertBoolean","Array","isArray","assertArray","assertIgnoreList","arr","forEach","item","i","assertIgnoreItem","RegExp","assertConfigApplicableTest","checkValidTest","assertConfigFileSearch","assertBabelrcSearch","assertPluginList","assertPluginItem","length","assertPluginTarget","opts","assertTargets","isBrowsersQueryValid","browsersLoc","esmodulesLoc","assertBrowsersList","browsers","esmodules","key","val","subLoc","hasOwnProperty","call","TargetNames","validTargets","join","assertBrowserVersion","Math","round","assertAssumptions","root","inPreset","source","assumptionsNames","has"],"sources":["../../../src/config/validation/option-assertions.ts"],"sourcesContent":["import {\n isBrowsersQueryValid,\n TargetNames,\n} from \"@babel/helper-compilation-targets\";\n\nimport type {\n ConfigFileSearch,\n BabelrcSearch,\n MatchItem,\n PluginTarget,\n ConfigApplicableTest,\n SourceMapsOption,\n SourceTypeOption,\n CompactOption,\n RootInputSourceMapOption,\n NestingPath,\n CallerMetadata,\n RootMode,\n TargetsListOrObject,\n AssumptionName,\n PluginItem,\n} from \"./options.ts\";\n\nimport { assumptionsNames } from \"./options.ts\";\n\nexport type { RootPath } from \"./options.ts\";\n\nexport type ValidatorSet = {\n [name: string]: Validator;\n};\n\nexport type Validator = (loc: OptionPath, value: unknown) => T;\n\nexport function msg(loc: NestingPath | GeneralPath): string {\n switch (loc.type) {\n case \"root\":\n return ``;\n case \"env\":\n return `${msg(loc.parent)}.env[\"${loc.name}\"]`;\n case \"overrides\":\n return `${msg(loc.parent)}.overrides[${loc.index}]`;\n case \"option\":\n return `${msg(loc.parent)}.${loc.name}`;\n case \"access\":\n return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;\n default:\n // @ts-expect-error should not happen when code is type checked\n throw new Error(`Assertion failure: Unknown type ${loc.type}`);\n }\n}\n\nexport function access(loc: GeneralPath, name: string | number): AccessPath {\n return {\n type: \"access\",\n name,\n parent: loc,\n };\n}\n\nexport type OptionPath = Readonly<{\n type: \"option\";\n name: string;\n parent: NestingPath;\n}>;\ntype AccessPath = Readonly<{\n type: \"access\";\n name: string | number;\n parent: GeneralPath;\n}>;\ntype GeneralPath = OptionPath | AccessPath;\n\nexport function assertRootMode(\n loc: OptionPath,\n value: unknown,\n): RootMode | void {\n if (\n value !== undefined &&\n value !== \"root\" &&\n value !== \"upward\" &&\n value !== \"upward-optional\"\n ) {\n throw new Error(\n `${msg(loc)} must be a \"root\", \"upward\", \"upward-optional\" or undefined`,\n );\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertSourceMaps(\n loc: OptionPath,\n value: unknown,\n): SourceMapsOption | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n value !== \"inline\" &&\n value !== \"both\"\n ) {\n throw new Error(\n `${msg(loc)} must be a boolean, \"inline\", \"both\", or undefined`,\n );\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertCompact(\n loc: OptionPath,\n value: unknown,\n): CompactOption | void {\n if (value !== undefined && typeof value !== \"boolean\" && value !== \"auto\") {\n throw new Error(`${msg(loc)} must be a boolean, \"auto\", or undefined`);\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertSourceType(\n loc: OptionPath,\n value: unknown,\n): SourceTypeOption | void {\n if (\n value !== undefined &&\n value !== \"module\" &&\n value !== \"commonjs\" &&\n value !== \"script\" &&\n value !== \"unambiguous\"\n ) {\n throw new Error(\n `${msg(loc)} must be \"module\", \"commonjs\", \"script\", \"unambiguous\", or undefined`,\n );\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertCallerMetadata(\n loc: OptionPath,\n value: unknown,\n): CallerMetadata | undefined {\n const obj = assertObject(loc, value);\n if (obj) {\n if (typeof obj.name !== \"string\") {\n throw new Error(\n `${msg(loc)} set but does not contain \"name\" property string`,\n );\n }\n\n for (const prop of Object.keys(obj)) {\n const propLoc = access(loc, prop);\n const value = obj[prop];\n if (\n value != null &&\n typeof value !== \"boolean\" &&\n typeof value !== \"string\" &&\n typeof value !== \"number\"\n ) {\n // NOTE(logan): I'm limiting the type here so that we can guarantee that\n // the \"caller\" value will serialize to JSON nicely. We can always\n // allow more complex structures later though.\n throw new Error(\n `${msg(\n propLoc,\n )} must be null, undefined, a boolean, a string, or a number.`,\n );\n }\n }\n }\n // @ts-expect-error todo(flow->ts)\n return value;\n}\n\nexport function assertInputSourceMap(\n loc: OptionPath,\n value: unknown,\n): RootInputSourceMapOption {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n (typeof value !== \"object\" || !value)\n ) {\n throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);\n }\n return value as RootInputSourceMapOption;\n}\n\nexport function assertString(loc: GeneralPath, value: unknown): string | void {\n if (value !== undefined && typeof value !== \"string\") {\n throw new Error(`${msg(loc)} must be a string, or undefined`);\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertFunction(\n loc: GeneralPath,\n value: unknown,\n): Function | void {\n if (value !== undefined && typeof value !== \"function\") {\n throw new Error(`${msg(loc)} must be a function, or undefined`);\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertBoolean(\n loc: GeneralPath,\n value: unknown,\n): boolean | void {\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new Error(`${msg(loc)} must be a boolean, or undefined`);\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertObject(\n loc: GeneralPath,\n value: unknown,\n): { readonly [key: string]: unknown } | void {\n if (\n value !== undefined &&\n (typeof value !== \"object\" || Array.isArray(value) || !value)\n ) {\n throw new Error(`${msg(loc)} must be an object, or undefined`);\n }\n // @ts-expect-error todo(flow->ts) value is still typed as unknown, also assert function typically should not return a value\n return value;\n}\n\nexport function assertArray(\n loc: GeneralPath,\n value: Array | undefined | null,\n): Array | undefined | null {\n if (value != null && !Array.isArray(value)) {\n throw new Error(`${msg(loc)} must be an array, or undefined`);\n }\n return value;\n}\n\nexport function assertIgnoreList(\n loc: OptionPath,\n value: unknown[] | undefined,\n): MatchItem[] | void {\n const arr = assertArray(loc, value);\n arr?.forEach((item, i) => assertIgnoreItem(access(loc, i), item));\n // @ts-expect-error todo(flow->ts)\n return arr;\n}\nfunction assertIgnoreItem(loc: GeneralPath, value: unknown): MatchItem {\n if (\n typeof value !== \"string\" &&\n typeof value !== \"function\" &&\n !(value instanceof RegExp)\n ) {\n throw new Error(\n `${msg(\n loc,\n )} must be an array of string/Function/RegExp values, or undefined`,\n );\n }\n return value as MatchItem;\n}\n\nexport function assertConfigApplicableTest(\n loc: OptionPath,\n value: unknown,\n): ConfigApplicableTest | void {\n if (value === undefined) {\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n }\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(\n `${msg(access(loc, i))} must be a string/Function/RegExp.`,\n );\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(\n `${msg(loc)} must be a string/Function/RegExp, or an array of those`,\n );\n }\n return value as ConfigApplicableTest;\n}\n\nfunction checkValidTest(value: unknown): value is string | Function | RegExp {\n return (\n typeof value === \"string\" ||\n typeof value === \"function\" ||\n value instanceof RegExp\n );\n}\n\nexport function assertConfigFileSearch(\n loc: OptionPath,\n value: unknown,\n): ConfigFileSearch | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n typeof value !== \"string\"\n ) {\n throw new Error(\n `${msg(loc)} must be a undefined, a boolean, a string, ` +\n `got ${JSON.stringify(value)}`,\n );\n }\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n}\n\nexport function assertBabelrcSearch(\n loc: OptionPath,\n value: unknown,\n): BabelrcSearch | void {\n if (value === undefined || typeof value === \"boolean\") {\n // @ts-expect-error: TS can only narrow down the type when \"strictNullCheck\" is true\n return value;\n }\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(\n `${msg(access(loc, i))} must be a string/Function/RegExp.`,\n );\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(\n `${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` +\n `or an array of those, got ${JSON.stringify(value as any)}`,\n );\n }\n return value as BabelrcSearch;\n}\n\nexport function assertPluginList(\n loc: OptionPath,\n value: unknown[] | null | undefined,\n): PluginItem[] {\n const arr = assertArray(loc, value);\n if (arr) {\n // Loop instead of using `.map` in order to preserve object identity\n // for plugin array for use during config chain processing.\n arr.forEach((item, i) => assertPluginItem(access(loc, i), item));\n }\n return arr as PluginItem[];\n}\nfunction assertPluginItem(loc: GeneralPath, value: unknown): PluginItem {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n throw new Error(`${msg(loc)} must include an object`);\n }\n\n if (value.length > 3) {\n throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);\n }\n\n assertPluginTarget(access(loc, 0), value[0]);\n\n if (value.length > 1) {\n const opts = value[1];\n if (\n opts !== undefined &&\n opts !== false &&\n (typeof opts !== \"object\" || Array.isArray(opts) || opts === null)\n ) {\n throw new Error(\n `${msg(access(loc, 1))} must be an object, false, or undefined`,\n );\n }\n }\n if (value.length === 3) {\n const name = value[2];\n if (name !== undefined && typeof name !== \"string\") {\n throw new Error(\n `${msg(access(loc, 2))} must be a string, or undefined`,\n );\n }\n }\n } else {\n assertPluginTarget(loc, value);\n }\n\n return value as PluginItem;\n}\nfunction assertPluginTarget(loc: GeneralPath, value: unknown): PluginTarget {\n if (\n (typeof value !== \"object\" || !value) &&\n typeof value !== \"string\" &&\n typeof value !== \"function\"\n ) {\n throw new Error(`${msg(loc)} must be a string, object, function`);\n }\n return value as PluginTarget;\n}\n\nexport function assertTargets(\n loc: GeneralPath,\n value: any,\n): TargetsListOrObject {\n if (isBrowsersQueryValid(value)) return value;\n\n if (typeof value !== \"object\" || !value || Array.isArray(value)) {\n throw new Error(\n `${msg(loc)} must be a string, an array of strings or an object`,\n );\n }\n\n const browsersLoc = access(loc, \"browsers\");\n const esmodulesLoc = access(loc, \"esmodules\");\n\n assertBrowsersList(browsersLoc, value.browsers);\n assertBoolean(esmodulesLoc, value.esmodules);\n\n for (const key of Object.keys(value)) {\n const val = value[key];\n const subLoc = access(loc, key);\n\n if (key === \"esmodules\") assertBoolean(subLoc, val);\n else if (key === \"browsers\") assertBrowsersList(subLoc, val);\n else if (!Object.hasOwn(TargetNames, key)) {\n const validTargets = Object.keys(TargetNames).join(\", \");\n throw new Error(\n `${msg(\n subLoc,\n )} is not a valid target. Supported targets are ${validTargets}`,\n );\n } else assertBrowserVersion(subLoc, val);\n }\n\n return value;\n}\n\nfunction assertBrowsersList(loc: GeneralPath, value: unknown) {\n if (value !== undefined && !isBrowsersQueryValid(value)) {\n throw new Error(\n `${msg(loc)} must be undefined, a string or an array of strings`,\n );\n }\n}\n\nfunction assertBrowserVersion(loc: GeneralPath, value: unknown) {\n if (typeof value === \"number\" && Math.round(value) === value) return;\n if (typeof value === \"string\") return;\n\n throw new Error(`${msg(loc)} must be a string or an integer number`);\n}\n\nexport function assertAssumptions(\n loc: GeneralPath,\n value: { [key: string]: unknown },\n): { [name: string]: boolean } | void {\n if (value === undefined) return;\n\n if (typeof value !== \"object\" || value === null) {\n throw new Error(`${msg(loc)} must be an object or undefined.`);\n }\n\n // todo(flow->ts): remove any\n let root: any = loc;\n do {\n root = root.parent;\n } while (root.type !== \"root\");\n const inPreset = root.source === \"preset\";\n\n for (const name of Object.keys(value)) {\n const subLoc = access(loc, name);\n if (!assumptionsNames.has(name as AssumptionName)) {\n throw new Error(`${msg(subLoc)} is not a supported assumption.`);\n }\n if (typeof value[name] !== \"boolean\") {\n throw new Error(`${msg(subLoc)} must be a boolean.`);\n }\n if (inPreset && value[name] === false) {\n throw new Error(\n `${msg(subLoc)} cannot be set to 'false' inside presets.`,\n );\n }\n }\n\n // @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ACA,IAAI,OAAO5C,KAAK,CAACP,IAAI,CAAC,KAAK,SAAS,EAAE;MACpC,MAAM,IAAII,KAAK,CAAC,GAAGR,GAAG,CAACuD,MAAM,CAAC,qBAAqB,CAAC;IACtD;IACA,IAAIW,QAAQ,IAAIvD,KAAK,CAACP,IAAI,CAAC,KAAK,KAAK,EAAE;MACrC,MAAM,IAAII,KAAK,CACb,GAAGR,GAAG,CAACuD,MAAM,CAAC,2CAChB,CAAC;IACH;EACF;EAGA,OAAO5C,KAAK;AACd;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/validation/options.js b/node_modules/@babel/core/lib/config/validation/options.js new file mode 100644 index 0000000..3b78ada --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/options.js @@ -0,0 +1,189 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.assumptionsNames = void 0; +exports.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs; +exports.validate = validate; +var _removed = require("./removed.js"); +var _optionAssertions = require("./option-assertions.js"); +var _configError = require("../../errors/config-error.js"); +const ROOT_VALIDATORS = { + cwd: _optionAssertions.assertString, + root: _optionAssertions.assertString, + rootMode: _optionAssertions.assertRootMode, + configFile: _optionAssertions.assertConfigFileSearch, + caller: _optionAssertions.assertCallerMetadata, + filename: _optionAssertions.assertString, + filenameRelative: _optionAssertions.assertString, + code: _optionAssertions.assertBoolean, + ast: _optionAssertions.assertBoolean, + cloneInputAst: _optionAssertions.assertBoolean, + envName: _optionAssertions.assertString +}; +const BABELRC_VALIDATORS = { + babelrc: _optionAssertions.assertBoolean, + babelrcRoots: _optionAssertions.assertBabelrcSearch +}; +const NONPRESET_VALIDATORS = { + extends: _optionAssertions.assertString, + ignore: _optionAssertions.assertIgnoreList, + only: _optionAssertions.assertIgnoreList, + targets: _optionAssertions.assertTargets, + browserslistConfigFile: _optionAssertions.assertConfigFileSearch, + browserslistEnv: _optionAssertions.assertString +}; +const COMMON_VALIDATORS = { + inputSourceMap: _optionAssertions.assertInputSourceMap, + presets: _optionAssertions.assertPluginList, + plugins: _optionAssertions.assertPluginList, + passPerPreset: _optionAssertions.assertBoolean, + assumptions: _optionAssertions.assertAssumptions, + env: assertEnvSet, + overrides: assertOverridesList, + test: _optionAssertions.assertConfigApplicableTest, + include: _optionAssertions.assertConfigApplicableTest, + exclude: _optionAssertions.assertConfigApplicableTest, + retainLines: _optionAssertions.assertBoolean, + comments: _optionAssertions.assertBoolean, + shouldPrintComment: _optionAssertions.assertFunction, + compact: _optionAssertions.assertCompact, + minified: _optionAssertions.assertBoolean, + auxiliaryCommentBefore: _optionAssertions.assertString, + auxiliaryCommentAfter: _optionAssertions.assertString, + sourceType: _optionAssertions.assertSourceType, + wrapPluginVisitorMethod: _optionAssertions.assertFunction, + highlightCode: _optionAssertions.assertBoolean, + sourceMaps: _optionAssertions.assertSourceMaps, + sourceMap: _optionAssertions.assertSourceMaps, + sourceFileName: _optionAssertions.assertString, + sourceRoot: _optionAssertions.assertString, + parserOpts: _optionAssertions.assertObject, + generatorOpts: _optionAssertions.assertObject +}; +{ + Object.assign(COMMON_VALIDATORS, { + getModuleId: _optionAssertions.assertFunction, + moduleRoot: _optionAssertions.assertString, + moduleIds: _optionAssertions.assertBoolean, + moduleId: _optionAssertions.assertString + }); +} +const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "noUninitializedPrivateFieldAccess", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"]; +const assumptionsNames = exports.assumptionsNames = new Set(knownAssumptions); +function getSource(loc) { + return loc.type === "root" ? loc.source : getSource(loc.parent); +} +function validate(type, opts, filename) { + try { + return validateNested({ + type: "root", + source: type + }, opts); + } catch (error) { + const configError = new _configError.default(error.message, filename); + if (error.code) configError.code = error.code; + throw configError; + } +} +function validateNested(loc, opts) { + const type = getSource(loc); + assertNoDuplicateSourcemap(opts); + Object.keys(opts).forEach(key => { + const optLoc = { + type: "option", + name: key, + parent: loc + }; + if (type === "preset" && NONPRESET_VALIDATORS[key]) { + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`); + } + if (type !== "arguments" && ROOT_VALIDATORS[key]) { + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`); + } + if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) { + if (type === "babelrcfile" || type === "extendsfile") { + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or "extends"ed files, only in root programmatic options, ` + `or babel.config.js/config file options`); + } + throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`); + } + const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError; + validator(optLoc, opts[key]); + }); + return opts; +} +function throwUnknownError(loc) { + const key = loc.name; + if (_removed.default[key]) { + const { + message, + version = 5 + } = _removed.default[key]; + throw new Error(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`); + } else { + const unknownOptErr = new Error(`Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`); + unknownOptErr.code = "BABEL_UNKNOWN_OPTION"; + throw unknownOptErr; + } +} +function assertNoDuplicateSourcemap(opts) { + if (hasOwnProperty.call(opts, "sourceMap") && hasOwnProperty.call(opts, "sourceMaps")) { + throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both"); + } +} +function assertEnvSet(loc, value) { + if (loc.parent.type === "env") { + throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`); + } + const parent = loc.parent; + const obj = (0, _optionAssertions.assertObject)(loc, value); + if (obj) { + for (const envName of Object.keys(obj)) { + const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]); + if (!env) continue; + const envLoc = { + type: "env", + name: envName, + parent + }; + validateNested(envLoc, env); + } + } + return obj; +} +function assertOverridesList(loc, value) { + if (loc.parent.type === "env") { + throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`); + } + if (loc.parent.type === "overrides") { + throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`); + } + const parent = loc.parent; + const arr = (0, _optionAssertions.assertArray)(loc, value); + if (arr) { + for (const [index, item] of arr.entries()) { + const objLoc = (0, _optionAssertions.access)(loc, index); + const env = (0, _optionAssertions.assertObject)(objLoc, item); + if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`); + const overridesLoc = { + type: "overrides", + index, + parent + }; + validateNested(overridesLoc, env); + } + } + return arr; +} +function checkNoUnwrappedItemOptionPairs(items, index, type, e) { + if (index === 0) return; + const lastItem = items[index - 1]; + const thisItem = items[index]; + if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === "object") { + e.message += `\n- Maybe you meant to use\n` + `"${type}s": [\n ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, undefined, 2)}]\n]\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`; + } +} +0 && 0; + +//# sourceMappingURL=options.js.map diff --git a/node_modules/@babel/core/lib/config/validation/options.js.map b/node_modules/@babel/core/lib/config/validation/options.js.map new file mode 100644 index 0000000..0e5c0b7 --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/options.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_removed","require","_optionAssertions","_configError","ROOT_VALIDATORS","cwd","assertString","root","rootMode","assertRootMode","configFile","assertConfigFileSearch","caller","assertCallerMetadata","filename","filenameRelative","code","assertBoolean","ast","cloneInputAst","envName","BABELRC_VALIDATORS","babelrc","babelrcRoots","assertBabelrcSearch","NONPRESET_VALIDATORS","extends","ignore","assertIgnoreList","only","targets","assertTargets","browserslistConfigFile","browserslistEnv","COMMON_VALIDATORS","inputSourceMap","assertInputSourceMap","presets","assertPluginList","plugins","passPerPreset","assumptions","assertAssumptions","env","assertEnvSet","overrides","assertOverridesList","test","assertConfigApplicableTest","include","exclude","retainLines","comments","shouldPrintComment","assertFunction","compact","assertCompact","minified","auxiliaryCommentBefore","auxiliaryCommentAfter","sourceType","assertSourceType","wrapPluginVisitorMethod","highlightCode","sourceMaps","assertSourceMaps","sourceMap","sourceFileName","sourceRoot","parserOpts","assertObject","generatorOpts","Object","assign","getModuleId","moduleRoot","moduleIds","moduleId","knownAssumptions","assumptionsNames","exports","Set","getSource","loc","type","source","parent","validate","opts","validateNested","error","configError","ConfigError","message","assertNoDuplicateSourcemap","keys","forEach","key","optLoc","name","Error","msg","validator","throwUnknownError","removed","version","unknownOptErr","hasOwnProperty","call","value","obj","access","envLoc","arr","assertArray","index","item","entries","objLoc","overridesLoc","checkNoUnwrappedItemOptionPairs","items","e","lastItem","thisItem","file","options","undefined","request","JSON","stringify"],"sources":["../../../src/config/validation/options.ts"],"sourcesContent":["import type { InputTargets, Targets } from \"@babel/helper-compilation-targets\";\n\nimport type { ConfigItem } from \"../item.ts\";\n\nimport removed from \"./removed.ts\";\nimport {\n msg,\n access,\n assertString,\n assertBoolean,\n assertObject,\n assertArray,\n assertCallerMetadata,\n assertInputSourceMap,\n assertIgnoreList,\n assertPluginList,\n assertConfigApplicableTest,\n assertConfigFileSearch,\n assertBabelrcSearch,\n assertFunction,\n assertRootMode,\n assertSourceMaps,\n assertCompact,\n assertSourceType,\n assertTargets,\n assertAssumptions,\n} from \"./option-assertions.ts\";\nimport type {\n ValidatorSet,\n Validator,\n OptionPath,\n} from \"./option-assertions.ts\";\nimport type { UnloadedDescriptor } from \"../config-descriptors.ts\";\nimport type { PluginAPI } from \"../helpers/config-api.ts\";\nimport type { ParserOptions } from \"@babel/parser\";\nimport type { GeneratorOptions } from \"@babel/generator\";\nimport type { VisitWrapper } from \"@babel/traverse\";\nimport ConfigError from \"../../errors/config-error.ts\";\nimport type { PluginObject } from \"./plugins.ts\";\nimport type Plugin from \"../plugin.ts\";\nimport type { PresetAPI } from \"../index.ts\";\nimport type { PresetObject } from \"../../index.ts\";\n\nconst ROOT_VALIDATORS: ValidatorSet = {\n cwd: assertString as Validator,\n root: assertString as Validator,\n rootMode: assertRootMode as Validator,\n configFile: assertConfigFileSearch as Validator,\n\n caller: assertCallerMetadata as Validator,\n filename: assertString as Validator,\n filenameRelative: assertString as Validator,\n code: assertBoolean as Validator,\n ast: assertBoolean as Validator,\n\n cloneInputAst: assertBoolean as Validator,\n\n envName: assertString as Validator,\n};\n\nconst BABELRC_VALIDATORS: ValidatorSet = {\n babelrc: assertBoolean as Validator,\n babelrcRoots: assertBabelrcSearch as Validator,\n};\n\nconst NONPRESET_VALIDATORS: ValidatorSet = {\n extends: assertString as Validator,\n ignore: assertIgnoreList as Validator,\n only: assertIgnoreList as Validator,\n\n targets: assertTargets as Validator,\n browserslistConfigFile: assertConfigFileSearch as Validator<\n InputOptions[\"browserslistConfigFile\"]\n >,\n browserslistEnv: assertString as Validator,\n};\n\nconst COMMON_VALIDATORS: ValidatorSet = {\n // TODO: Should 'inputSourceMap' be moved to be a root-only option?\n // We may want a boolean-only version to be a common option, with the\n // object only allowed as a root config argument.\n inputSourceMap: assertInputSourceMap as Validator<\n InputOptions[\"inputSourceMap\"]\n >,\n presets: assertPluginList as Validator,\n plugins: assertPluginList as Validator,\n passPerPreset: assertBoolean as Validator,\n assumptions: assertAssumptions as Validator,\n\n env: assertEnvSet as Validator,\n overrides: assertOverridesList as Validator,\n\n // We could limit these to 'overrides' blocks, but it's not clear why we'd\n // bother, when the ability to limit a config to a specific set of files\n // is a fairly general useful feature.\n test: assertConfigApplicableTest as Validator,\n include: assertConfigApplicableTest as Validator,\n exclude: assertConfigApplicableTest as Validator,\n\n retainLines: assertBoolean as Validator,\n comments: assertBoolean as Validator,\n shouldPrintComment: assertFunction as Validator<\n InputOptions[\"shouldPrintComment\"]\n >,\n compact: assertCompact as Validator,\n minified: assertBoolean as Validator,\n auxiliaryCommentBefore: assertString as Validator<\n InputOptions[\"auxiliaryCommentBefore\"]\n >,\n auxiliaryCommentAfter: assertString as Validator<\n InputOptions[\"auxiliaryCommentAfter\"]\n >,\n sourceType: assertSourceType as Validator,\n wrapPluginVisitorMethod: assertFunction as Validator<\n InputOptions[\"wrapPluginVisitorMethod\"]\n >,\n highlightCode: assertBoolean as Validator,\n sourceMaps: assertSourceMaps as Validator,\n sourceMap: assertSourceMaps as Validator,\n sourceFileName: assertString as Validator,\n sourceRoot: assertString as Validator,\n parserOpts: assertObject as Validator,\n generatorOpts: assertObject as Validator,\n};\nif (!process.env.BABEL_8_BREAKING) {\n Object.assign(COMMON_VALIDATORS, {\n getModuleId: assertFunction,\n moduleRoot: assertString,\n moduleIds: assertBoolean,\n moduleId: assertString,\n });\n}\n\ntype Assumptions = {\n arrayLikeIsIterable?: boolean;\n constantReexports?: boolean;\n constantSuper?: boolean;\n enumerableModuleMeta?: boolean;\n ignoreFunctionLength?: boolean;\n ignoreToPrimitiveHint?: boolean;\n iterableIsArray?: boolean;\n mutableTemplateObject?: boolean;\n noClassCalls?: boolean;\n noDocumentAll?: boolean;\n noIncompleteNsImportDetection?: boolean;\n noNewArrows?: boolean;\n noUninitializedPrivateFieldAccess?: boolean;\n objectRestNoSymbols?: boolean;\n privateFieldsAsProperties?: boolean;\n privateFieldsAsSymbols?: boolean;\n pureGetters?: boolean;\n setClassMethods?: boolean;\n setComputedProperties?: boolean;\n setPublicClassFields?: boolean;\n setSpreadProperties?: boolean;\n skipForOfIteratorClosing?: boolean;\n superIsCallableConstructor?: boolean;\n};\n\nexport type AssumptionName = keyof Assumptions;\n\nexport type InputOptions = {\n cwd?: string;\n filename?: string;\n filenameRelative?: string;\n babelrc?: boolean;\n babelrcRoots?: BabelrcSearch;\n configFile?: ConfigFileSearch;\n root?: string;\n rootMode?: RootMode;\n code?: boolean;\n ast?: boolean;\n cloneInputAst?: boolean;\n inputSourceMap?: RootInputSourceMapOption;\n envName?: string;\n caller?: CallerMetadata;\n extends?: string;\n env?: EnvSet;\n ignore?: MatchItem[];\n only?: MatchItem[];\n overrides?: InputOptions[];\n showIgnoredFiles?: boolean;\n // Generally verify if a given config object should be applied to the given file.\n test?: ConfigApplicableTest;\n include?: ConfigApplicableTest;\n exclude?: ConfigApplicableTest;\n presets?: PresetItem[];\n plugins?: PluginItem[];\n passPerPreset?: boolean;\n assumptions?: Assumptions;\n // browserslists-related options\n targets?: TargetsListOrObject;\n browserslistConfigFile?: ConfigFileSearch;\n browserslistEnv?: string;\n // Options for @babel/generator\n retainLines?: GeneratorOptions[\"retainLines\"];\n comments?: GeneratorOptions[\"comments\"];\n shouldPrintComment?: GeneratorOptions[\"shouldPrintComment\"];\n compact?: GeneratorOptions[\"compact\"];\n minified?: GeneratorOptions[\"minified\"];\n auxiliaryCommentBefore?: GeneratorOptions[\"auxiliaryCommentBefore\"];\n auxiliaryCommentAfter?: GeneratorOptions[\"auxiliaryCommentAfter\"];\n // Parser\n sourceType?: SourceTypeOption;\n wrapPluginVisitorMethod?: VisitWrapper | null;\n highlightCode?: boolean;\n // Sourcemap generation options.\n sourceMaps?: SourceMapsOption;\n sourceMap?: SourceMapsOption;\n sourceFileName?: string;\n sourceRoot?: string;\n // Todo(Babel 9): Deprecate top level parserOpts\n parserOpts?: ParserOptions;\n // Todo(Babel 9): Deprecate top level generatorOpts\n generatorOpts?: GeneratorOptions;\n};\n\nexport type NormalizedOptions = Omit & {\n assumptions: Assumptions;\n targets: Targets;\n cloneInputAst: boolean;\n babelrc: false;\n configFile: false;\n browserslistConfigFile: false;\n passPerPreset: false;\n envName: string;\n cwd: string;\n root: string;\n rootMode: \"root\";\n filename: string | undefined;\n presets: ConfigItem[];\n plugins: ConfigItem[];\n};\n\nexport type ResolvedOptions = Omit<\n NormalizedOptions,\n \"presets\" | \"plugins\" | \"passPerPreset\"\n> & {\n presets: { plugins: Plugin[] }[];\n plugins: Plugin[];\n passPerPreset: boolean;\n};\n\nexport type ConfigChainOptions = Omit<\n InputOptions,\n | \"extends\"\n | \"env\"\n | \"overrides\"\n | \"plugins\"\n | \"presets\"\n | \"passPerPreset\"\n | \"ignore\"\n | \"only\"\n | \"test\"\n | \"include\"\n | \"exclude\"\n | \"sourceMap\"\n>;\n\nexport type CallerMetadata = {\n // If 'caller' is specified, require that the name is given for debugging\n // messages.\n name: string;\n supportsStaticESM?: boolean;\n supportsDynamicImport?: boolean;\n supportsTopLevelAwait?: boolean;\n supportsExportNamespaceFrom?: boolean;\n};\nexport type EnvSet = {\n [x: string]: T;\n};\nexport type MatchItem =\n | string\n | RegExp\n | ((\n path: string | undefined,\n context: { dirname: string; caller: CallerMetadata; envName: string },\n ) => unknown);\n\nexport type MaybeDefaultProperty = T | { default: T };\n\nexport type PluginTarget =\n | string\n | MaybeDefaultProperty<\n (api: PluginAPI, options?: object, dirname?: string) => PluginObject\n >;\nexport type PluginItem =\n | ConfigItem\n | PluginTarget\n | [PluginTarget, object]\n | [PluginTarget, object, string];\n\nexport type PresetTarget =\n | string\n | MaybeDefaultProperty<\n (api: PresetAPI, options?: object, dirname?: string) => PresetObject\n >;\nexport type PresetItem =\n | ConfigItem\n | PresetTarget\n | [PresetTarget, object]\n | [PresetTarget, object, string];\n\nexport type ConfigApplicableTest = MatchItem | Array;\n\nexport type ConfigFileSearch = string | boolean;\nexport type BabelrcSearch = boolean | MatchItem | MatchItem[];\nexport type SourceMapsOption = boolean | \"inline\" | \"both\";\nexport type SourceTypeOption = \"module\" | \"commonjs\" | \"script\" | \"unambiguous\";\nexport type CompactOption = boolean | \"auto\";\n// https://github.com/mozilla/source-map/blob/801be934007c3ed0ef66c620641b1668e92c891d/source-map.d.ts#L15C8-L23C2\ninterface InputSourceMap {\n version: number;\n sources: string[];\n names: string[];\n sourceRoot?: string | undefined;\n sourcesContent?: string[] | undefined;\n mappings: string;\n file: string;\n}\nexport type RootInputSourceMapOption = InputSourceMap | boolean;\nexport type RootMode = \"root\" | \"upward\" | \"upward-optional\";\n\nexport type TargetsListOrObject =\n | Targets\n | InputTargets\n | InputTargets[\"browsers\"];\n\nexport type OptionsSource =\n | \"arguments\"\n | \"configfile\"\n | \"babelrcfile\"\n | \"extendsfile\"\n | \"preset\"\n | \"plugin\";\n\nexport type RootPath = Readonly<{\n type: \"root\";\n source: OptionsSource;\n}>;\n\ntype OverridesPath = Readonly<{\n type: \"overrides\";\n index: number;\n parent: RootPath;\n}>;\n\ntype EnvPath = Readonly<{\n type: \"env\";\n name: string;\n parent: RootPath | OverridesPath;\n}>;\n\nexport type NestingPath = RootPath | OverridesPath | EnvPath;\n\nconst knownAssumptions = [\n \"arrayLikeIsIterable\",\n \"constantReexports\",\n \"constantSuper\",\n \"enumerableModuleMeta\",\n \"ignoreFunctionLength\",\n \"ignoreToPrimitiveHint\",\n \"iterableIsArray\",\n \"mutableTemplateObject\",\n \"noClassCalls\",\n \"noDocumentAll\",\n \"noIncompleteNsImportDetection\",\n \"noNewArrows\",\n \"noUninitializedPrivateFieldAccess\",\n \"objectRestNoSymbols\",\n \"privateFieldsAsSymbols\",\n \"privateFieldsAsProperties\",\n \"pureGetters\",\n \"setClassMethods\",\n \"setComputedProperties\",\n \"setPublicClassFields\",\n \"setSpreadProperties\",\n \"skipForOfIteratorClosing\",\n \"superIsCallableConstructor\",\n] as const;\nexport const assumptionsNames = new Set(knownAssumptions);\n\nfunction getSource(loc: NestingPath): OptionsSource {\n return loc.type === \"root\" ? loc.source : getSource(loc.parent);\n}\n\nexport function validate(\n type: OptionsSource,\n opts: any,\n filename?: string,\n): InputOptions {\n try {\n return validateNested(\n {\n type: \"root\",\n source: type,\n },\n opts,\n );\n } catch (error) {\n const configError = new ConfigError(error.message, filename);\n // @ts-expect-error TODO: .code is not defined on ConfigError or Error\n if (error.code) configError.code = error.code;\n throw configError;\n }\n}\n\nfunction validateNested(loc: NestingPath, opts: { [key: string]: unknown }) {\n const type = getSource(loc);\n assertNoDuplicateSourcemap(opts);\n\n Object.keys(opts).forEach((key: string) => {\n const optLoc = {\n type: \"option\",\n name: key,\n parent: loc,\n } as const;\n\n if (type === \"preset\" && NONPRESET_VALIDATORS[key]) {\n throw new Error(`${msg(optLoc)} is not allowed in preset options`);\n }\n if (type !== \"arguments\" && ROOT_VALIDATORS[key]) {\n throw new Error(\n `${msg(optLoc)} is only allowed in root programmatic options`,\n );\n }\n if (\n type !== \"arguments\" &&\n type !== \"configfile\" &&\n BABELRC_VALIDATORS[key]\n ) {\n if (type === \"babelrcfile\" || type === \"extendsfile\") {\n throw new Error(\n `${msg(\n optLoc,\n )} is not allowed in .babelrc or \"extends\"ed files, only in root programmatic options, ` +\n `or babel.config.js/config file options`,\n );\n }\n\n throw new Error(\n `${msg(\n optLoc,\n )} is only allowed in root programmatic options, or babel.config.js/config file options`,\n );\n }\n\n const validator =\n COMMON_VALIDATORS[key] ||\n NONPRESET_VALIDATORS[key] ||\n BABELRC_VALIDATORS[key] ||\n ROOT_VALIDATORS[key] ||\n (throwUnknownError as Validator);\n\n validator(optLoc, opts[key]);\n });\n\n return opts;\n}\n\nfunction throwUnknownError(loc: OptionPath) {\n const key = loc.name;\n\n if (removed[key]) {\n const { message, version = 5 } = removed[key];\n\n throw new Error(\n `Using removed Babel ${version} option: ${msg(loc)} - ${message}`,\n );\n } else {\n const unknownOptErr = new Error(\n `Unknown option: ${msg(\n loc,\n )}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`,\n );\n // @ts-expect-error todo(flow->ts): consider creating something like BabelConfigError with code field in it\n unknownOptErr.code = \"BABEL_UNKNOWN_OPTION\";\n\n throw unknownOptErr;\n }\n}\n\nfunction assertNoDuplicateSourcemap(opts: any): void {\n if (Object.hasOwn(opts, \"sourceMap\") && Object.hasOwn(opts, \"sourceMaps\")) {\n throw new Error(\".sourceMap is an alias for .sourceMaps, cannot use both\");\n }\n}\n\nfunction assertEnvSet(\n loc: OptionPath,\n value: unknown,\n): void | EnvSet {\n if (loc.parent.type === \"env\") {\n throw new Error(`${msg(loc)} is not allowed inside of another .env block`);\n }\n const parent: RootPath | OverridesPath = loc.parent;\n\n const obj = assertObject(loc, value);\n if (obj) {\n // Validate but don't copy the .env object in order to preserve\n // object identity for use during config chain processing.\n for (const envName of Object.keys(obj)) {\n const env = assertObject(access(loc, envName), obj[envName]);\n if (!env) continue;\n\n const envLoc = {\n type: \"env\",\n name: envName,\n parent,\n } as const;\n validateNested(envLoc, env);\n }\n }\n return obj;\n}\n\nfunction assertOverridesList(\n loc: OptionPath,\n value: unknown[],\n): undefined | InputOptions[] {\n if (loc.parent.type === \"env\") {\n throw new Error(`${msg(loc)} is not allowed inside an .env block`);\n }\n if (loc.parent.type === \"overrides\") {\n throw new Error(`${msg(loc)} is not allowed inside an .overrides block`);\n }\n const parent: RootPath = loc.parent;\n\n const arr = assertArray(loc, value);\n if (arr) {\n for (const [index, item] of arr.entries()) {\n const objLoc = access(loc, index);\n const env = assertObject(objLoc, item);\n if (!env) throw new Error(`${msg(objLoc)} must be an object`);\n\n const overridesLoc = {\n type: \"overrides\",\n index,\n parent,\n } as const;\n validateNested(overridesLoc, env);\n }\n }\n return arr;\n}\n\nexport function checkNoUnwrappedItemOptionPairs(\n items: Array>,\n index: number,\n type: \"plugin\" | \"preset\",\n e: Error,\n): void {\n if (index === 0) return;\n\n const lastItem = items[index - 1];\n const thisItem = items[index];\n\n if (\n lastItem.file &&\n lastItem.options === undefined &&\n typeof thisItem.value === \"object\"\n ) {\n e.message +=\n `\\n- Maybe you meant to use\\n` +\n `\"${type}s\": [\\n [\"${lastItem.file.request}\", ${JSON.stringify(\n thisItem.value,\n undefined,\n 2,\n )}]\\n]\\n` +\n `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`;\n }\n}\n"],"mappings":";;;;;;;;AAIA,IAAAA,QAA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AAC,CAAC,EAAE;MACzC,MAAMC,MAAM,GAAG,IAAAP,wBAAM,EAAC5B,GAAG,EAAEgC,KAAK,CAAC;MACjC,MAAMxE,GAAG,GAAG,IAAA2B,8BAAY,EAACgD,MAAM,EAAEF,IAAI,CAAC;MACtC,IAAI,CAACzE,GAAG,EAAE,MAAM,IAAIyD,KAAK,CAAC,GAAG,IAAAC,qBAAG,EAACiB,MAAM,CAAC,oBAAoB,CAAC;MAE7D,MAAMC,YAAY,GAAG;QACnBnC,IAAI,EAAE,WAAW;QACjB+B,KAAK;QACL7B;MACF,CAAU;MACVG,cAAc,CAAC8B,YAAY,EAAE5E,GAAG,CAAC;IACnC;EACF;EACA,OAAOsE,GAAG;AACZ;AAEO,SAASO,+BAA+BA,CAC7CC,KAAqC,EACrCN,KAAa,EACb/B,IAAyB,EACzBsC,CAAQ,EACF;EACN,IAAIP,KAAK,KAAK,CAAC,EAAE;EAEjB,MAAMQ,QAAQ,GAAGF,KAAK,CAACN,KAAK,GAAG,CAAC,CAAC;EACjC,MAAMS,QAAQ,GAAGH,KAAK,CAACN,KAAK,CAAC;EAE7B,IACEQ,QAAQ,CAACE,IAAI,IACbF,QAAQ,CAACG,OAAO,KAAKC,SAAS,IAC9B,OAAOH,QAAQ,CAACf,KAAK,KAAK,QAAQ,EAClC;IACAa,CAAC,CAAC7B,OAAO,IACP,8BAA8B,GAC9B,IAAIT,IAAI,cAAcuC,QAAQ,CAACE,IAAI,CAACG,OAAO,MAAMC,IAAI,CAACC,SAAS,CAC7DN,QAAQ,CAACf,KAAK,EACdkB,SAAS,EACT,CACF,CAAC,QAAQ,GACT,iBAAiB3C,IAAI,gEAAgE;EACzF;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/validation/plugins.js b/node_modules/@babel/core/lib/config/validation/plugins.js new file mode 100644 index 0000000..d744ecc --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/plugins.js @@ -0,0 +1,67 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validatePluginObject = validatePluginObject; +var _optionAssertions = require("./option-assertions.js"); +const VALIDATORS = { + name: _optionAssertions.assertString, + manipulateOptions: _optionAssertions.assertFunction, + pre: _optionAssertions.assertFunction, + post: _optionAssertions.assertFunction, + inherits: _optionAssertions.assertFunction, + visitor: assertVisitorMap, + parserOverride: _optionAssertions.assertFunction, + generatorOverride: _optionAssertions.assertFunction +}; +function assertVisitorMap(loc, value) { + const obj = (0, _optionAssertions.assertObject)(loc, value); + if (obj) { + Object.keys(obj).forEach(prop => { + if (prop !== "_exploded" && prop !== "_verified") { + assertVisitorHandler(prop, obj[prop]); + } + }); + if (obj.enter || obj.exit) { + throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`); + } + } + return obj; +} +function assertVisitorHandler(key, value) { + if (value && typeof value === "object") { + Object.keys(value).forEach(handler => { + if (handler !== "enter" && handler !== "exit") { + throw new Error(`.visitor["${key}"] may only have .enter and/or .exit handlers.`); + } + }); + } else if (typeof value !== "function") { + throw new Error(`.visitor["${key}"] must be a function`); + } +} +function validatePluginObject(obj) { + const rootPath = { + type: "root", + source: "plugin" + }; + Object.keys(obj).forEach(key => { + const validator = VALIDATORS[key]; + if (validator) { + const optLoc = { + type: "option", + name: key, + parent: rootPath + }; + validator(optLoc, obj[key]); + } else { + const invalidPluginPropertyError = new Error(`.${key} is not a valid Plugin property`); + invalidPluginPropertyError.code = "BABEL_UNKNOWN_PLUGIN_PROPERTY"; + throw invalidPluginPropertyError; + } + }); + return obj; +} +0 && 0; + +//# sourceMappingURL=plugins.js.map diff --git a/node_modules/@babel/core/lib/config/validation/plugins.js.map b/node_modules/@babel/core/lib/config/validation/plugins.js.map new file mode 100644 index 0000000..7cde24d --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/plugins.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_optionAssertions","require","VALIDATORS","name","assertString","manipulateOptions","assertFunction","pre","post","inherits","visitor","assertVisitorMap","parserOverride","generatorOverride","loc","value","obj","assertObject","Object","keys","forEach","prop","assertVisitorHandler","enter","exit","Error","msg","key","handler","validatePluginObject","rootPath","type","source","validator","optLoc","parent","invalidPluginPropertyError","code"],"sources":["../../../src/config/validation/plugins.ts"],"sourcesContent":["import {\n assertString,\n assertFunction,\n assertObject,\n msg,\n} from \"./option-assertions.ts\";\n\nimport type {\n ValidatorSet,\n Validator,\n OptionPath,\n RootPath,\n} from \"./option-assertions.ts\";\nimport type { parse, ParserOptions } from \"@babel/parser\";\nimport type { Visitor } from \"@babel/traverse\";\nimport type { ResolvedOptions } from \"./options.ts\";\nimport type { File, PluginAPI, PluginPass } from \"../../index.ts\";\nimport type { GeneratorOptions, GeneratorResult } from \"@babel/generator\";\nimport type babelGenerator from \"@babel/generator\";\n\n// Note: The casts here are just meant to be static assertions to make sure\n// that the assertion functions actually assert that the value's type matches\n// the declared types.\nconst VALIDATORS: ValidatorSet = {\n name: assertString as Validator,\n manipulateOptions: assertFunction as Validator<\n PluginObject[\"manipulateOptions\"]\n >,\n pre: assertFunction as Validator,\n post: assertFunction as Validator,\n inherits: assertFunction as Validator,\n visitor: assertVisitorMap as Validator,\n\n parserOverride: assertFunction as Validator,\n generatorOverride: assertFunction as Validator<\n PluginObject[\"generatorOverride\"]\n >,\n};\n\nfunction assertVisitorMap(loc: OptionPath, value: unknown): Visitor {\n const obj = assertObject(loc, value);\n if (obj) {\n Object.keys(obj).forEach(prop => {\n if (prop !== \"_exploded\" && prop !== \"_verified\") {\n assertVisitorHandler(prop, obj[prop]);\n }\n });\n\n if (obj.enter || obj.exit) {\n throw new Error(\n `${msg(\n loc,\n )} cannot contain catch-all \"enter\" or \"exit\" handlers. Please target individual nodes.`,\n );\n }\n }\n return obj as Visitor;\n}\n\nfunction assertVisitorHandler(\n key: string,\n value: unknown,\n): asserts value is VisitorHandler {\n if (value && typeof value === \"object\") {\n Object.keys(value).forEach((handler: string) => {\n if (handler !== \"enter\" && handler !== \"exit\") {\n throw new Error(\n `.visitor[\"${key}\"] may only have .enter and/or .exit handlers.`,\n );\n }\n });\n } else if (typeof value !== \"function\") {\n throw new Error(`.visitor[\"${key}\"] must be a function`);\n }\n}\n\ntype VisitorHandler =\n | Function\n | {\n enter?: Function;\n exit?: Function;\n };\n\nexport type PluginObject = {\n name?: string;\n manipulateOptions?: (\n options: ResolvedOptions,\n parserOpts: ParserOptions,\n ) => void;\n pre?: (this: S, file: File) => void | Promise;\n post?: (this: S, file: File) => void | Promise;\n inherits?: (\n api: PluginAPI,\n options: unknown,\n dirname: string,\n ) => PluginObject;\n visitor?: Visitor;\n parserOverride?: (\n ...args: [...Parameters, typeof parse]\n ) => ReturnType;\n generatorOverride?: (\n ast: File[\"ast\"],\n generatorOpts: GeneratorOptions,\n code: File[\"code\"],\n generate: typeof babelGenerator,\n ) => GeneratorResult;\n};\n\nexport function validatePluginObject(obj: {\n [key: string]: unknown;\n}): PluginObject {\n const rootPath: RootPath = {\n type: \"root\",\n source: \"plugin\",\n };\n Object.keys(obj).forEach((key: string) => {\n const validator = VALIDATORS[key];\n\n if (validator) {\n const optLoc: OptionPath = {\n type: \"option\",\n name: key,\n parent: rootPath,\n };\n validator(optLoc, obj[key]);\n } else {\n const invalidPluginPropertyError = new Error(\n `.${key} is not a valid Plugin property`,\n );\n // @ts-expect-error todo(flow->ts) consider adding BabelConfigError with code field\n invalidPluginPropertyError.code = \"BABEL_UNKNOWN_PLUGIN_PROPERTY\";\n throw invalidPluginPropertyError;\n }\n });\n\n return obj as any;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAuBA,MAAMC,UAAwB,GAAG;EAC/BC,IAAI,EAAEC,8BAA+C;EACrDC,iBAAiB,EAAEC,gCAElB;EACDC,GAAG,EAAED,gCAAgD;EACrDE,IAAI,EAAEF,gCAAiD;EACvDG,QAAQ,EAAEH,gCAAqD;EAC/DI,OAAO,EAAEC,gBAAsD;EAE/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CAAC,CAACI,OAAO,CAAEO,GAAW,IAAK;IACxC,MAAMM,SAAS,GAAG/B,UAAU,CAACyB,GAAG,CAAC;IAEjC,IAAIM,SAAS,EAAE;MACb,MAAMC,MAAkB,GAAG;QACzBH,IAAI,EAAE,QAAQ;QACd5B,IAAI,EAAEwB,GAAG;QACTQ,MAAM,EAAEL;MACV,CAAC;MACDG,SAAS,CAACC,MAAM,EAAElB,GAAG,CAACW,GAAG,CAAC,CAAC;IAC7B,CAAC,MAAM;MACL,MAAMS,0BAA0B,GAAG,IAAIX,KAAK,CAC1C,IAAIE,GAAG,iCACT,CAAC;MAEDS,0BAA0B,CAACC,IAAI,GAAG,+BAA+B;MACjE,MAAMD,0BAA0B;IAClC;EACF,CAAC,CAAC;EAEF,OAAOpB,GAAG;AACZ;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/config/validation/removed.js b/node_modules/@babel/core/lib/config/validation/removed.js new file mode 100644 index 0000000..9bd436e --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/removed.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = exports.default = { + auxiliaryComment: { + message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`" + }, + blacklist: { + message: "Put the specific transforms you want in the `plugins` option" + }, + breakConfig: { + message: "This is not a necessary option in Babel 6" + }, + experimental: { + message: "Put the specific transforms you want in the `plugins` option" + }, + externalHelpers: { + message: "Use the `external-helpers` plugin instead. " + "Check out http://babeljs.io/docs/plugins/external-helpers/" + }, + extra: { + message: "" + }, + jsxPragma: { + message: "use the `pragma` option in the `react-jsx` plugin. " + "Check out http://babeljs.io/docs/plugins/transform-react-jsx/" + }, + loose: { + message: "Specify the `loose` option for the relevant plugin you are using " + "or use a preset that sets the option." + }, + metadataUsedHelpers: { + message: "Not required anymore as this is enabled by default" + }, + modules: { + message: "Use the corresponding module transform plugin in the `plugins` option. " + "Check out http://babeljs.io/docs/plugins/#modules" + }, + nonStandard: { + message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " + "Also check out the react preset http://babeljs.io/docs/plugins/preset-react/" + }, + optional: { + message: "Put the specific transforms you want in the `plugins` option" + }, + sourceMapName: { + message: "The `sourceMapName` option has been removed because it makes more sense for the " + "tooling that calls Babel to assign `map.file` themselves." + }, + stage: { + message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets" + }, + whitelist: { + message: "Put the specific transforms you want in the `plugins` option" + }, + resolveModuleSource: { + version: 6, + message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options" + }, + metadata: { + version: 6, + message: "Generated plugin metadata is always included in the output result" + }, + sourceMapTarget: { + version: 6, + message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves." + } +}; +0 && 0; + +//# sourceMappingURL=removed.js.map diff --git a/node_modules/@babel/core/lib/config/validation/removed.js.map b/node_modules/@babel/core/lib/config/validation/removed.js.map new file mode 100644 index 0000000..fa56595 --- /dev/null +++ b/node_modules/@babel/core/lib/config/validation/removed.js.map @@ -0,0 +1 @@ +{"version":3,"names":["auxiliaryComment","message","blacklist","breakConfig","experimental","externalHelpers","extra","jsxPragma","loose","metadataUsedHelpers","modules","nonStandard","optional","sourceMapName","stage","whitelist","resolveModuleSource","version","metadata","sourceMapTarget"],"sources":["../../../src/config/validation/removed.ts"],"sourcesContent":["export default {\n auxiliaryComment: {\n message: \"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`\",\n },\n blacklist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n breakConfig: {\n message: \"This is not a necessary option in Babel 6\",\n },\n experimental: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n externalHelpers: {\n message:\n \"Use the `external-helpers` plugin instead. \" +\n \"Check out http://babeljs.io/docs/plugins/external-helpers/\",\n },\n extra: {\n message: \"\",\n },\n jsxPragma: {\n message:\n \"use the `pragma` option in the `react-jsx` plugin. \" +\n \"Check out http://babeljs.io/docs/plugins/transform-react-jsx/\",\n },\n loose: {\n message:\n \"Specify the `loose` option for the relevant plugin you are using \" +\n \"or use a preset that sets the option.\",\n },\n metadataUsedHelpers: {\n message: \"Not required anymore as this is enabled by default\",\n },\n modules: {\n message:\n \"Use the corresponding module transform plugin in the `plugins` option. \" +\n \"Check out http://babeljs.io/docs/plugins/#modules\",\n },\n nonStandard: {\n message:\n \"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. \" +\n \"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/\",\n },\n optional: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n sourceMapName: {\n message:\n \"The `sourceMapName` option has been removed because it makes more sense for the \" +\n \"tooling that calls Babel to assign `map.file` themselves.\",\n },\n stage: {\n message:\n \"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets\",\n },\n whitelist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n\n resolveModuleSource: {\n version: 6,\n message: \"Use `babel-plugin-module-resolver@3`'s 'resolvePath' options\",\n },\n metadata: {\n version: 6,\n message:\n \"Generated plugin metadata is always included in the output result\",\n },\n sourceMapTarget: {\n version: 6,\n message:\n \"The `sourceMapTarget` option has been removed because it makes more sense for the tooling \" +\n \"that calls Babel to assign `map.file` themselves.\",\n },\n} as { [name: string]: { version?: number; message: string } };\n"],"mappings":";;;;;;iCAAe;EACbA,gBAAgB,EAAE;IAChBC,OAAO,EAAE;EACX,CAAC;EACDC,SAAS,EAAE;IACTD,OAAO,EAAE;EACX,CAAC;EACDE,WAAW,EAAE;IACXF,OAAO,EAAE;EACX,CAAC;EACDG,YAAY,EAAE;IACZH,OAAO,EAAE;EACX,CAAC;EACDI,eAAe,EAAE;IACfJ,OAAO,EACL,6CAA6C,GAC7C;EACJ,CAAC;EACDK,KAAK,EAAE;IACLL,OAAO,EAAE;EACX,CAAC;EACDM,SAAS,EAAE;IACTN,OAAO,EACL,qDAAqD,GACrD;EACJ,CAAC;EACDO,KAAK,EAAE;IACLP,OAAO,EACL,mEAAmE,GACnE;EACJ,CAAC;EACDQ,mBAAmB,EAAE;IACnBR,OAAO,EAAE;EACX,CAAC;EACDS,OAAO,EAAE;IACPT,OAAO,EACL,yEAAyE,GACzE;EACJ,CAAC;EACDU,WAAW,EAAE;IACXV,OAAO,EACL,8EAA8E,GAC9E;EACJ,CAAC;EACDW,QAAQ,EAAE;IACRX,OAAO,EAAE;EACX,CAAC;EACDY,aAAa,EAAE;IACbZ,OAAO,EACL,kFAAkF,GAClF;EACJ,CAAC;EACDa,KAAK,EAAE;IACLb,OAAO,EACL;EACJ,CAAC;EACDc,SAAS,EAAE;IACTd,OAAO,EAAE;EACX,CAAC;EAEDe,mBAAmB,EAAE;IACnBC,OAAO,EAAE,CAAC;IACVhB,OAAO,EAAE;EACX,CAAC;EACDiB,QAAQ,EAAE;IACRD,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL;EACJ,CAAC;EACDkB,eAAe,EAAE;IACfF,OAAO,EAAE,CAAC;IACVhB,OAAO,EACL,4FAA4F,GAC5F;EACJ;AACF,CAAC;AAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/errors/config-error.js b/node_modules/@babel/core/lib/errors/config-error.js new file mode 100644 index 0000000..c290804 --- /dev/null +++ b/node_modules/@babel/core/lib/errors/config-error.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _rewriteStackTrace = require("./rewrite-stack-trace.js"); +class ConfigError extends Error { + constructor(message, filename) { + super(message); + (0, _rewriteStackTrace.expectedError)(this); + if (filename) (0, _rewriteStackTrace.injectVirtualStackFrame)(this, filename); + } +} +exports.default = ConfigError; +0 && 0; + +//# sourceMappingURL=config-error.js.map diff --git a/node_modules/@babel/core/lib/errors/config-error.js.map b/node_modules/@babel/core/lib/errors/config-error.js.map new file mode 100644 index 0000000..0045ded --- /dev/null +++ b/node_modules/@babel/core/lib/errors/config-error.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_rewriteStackTrace","require","ConfigError","Error","constructor","message","filename","expectedError","injectVirtualStackFrame","exports","default"],"sources":["../../src/errors/config-error.ts"],"sourcesContent":["import {\n injectVirtualStackFrame,\n expectedError,\n} from \"./rewrite-stack-trace.ts\";\n\nexport default class ConfigError extends Error {\n constructor(message: string, filename?: string) {\n super(message);\n expectedError(this);\n if (filename) injectVirtualStackFrame(this, filename);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAKe,MAAMC,WAAW,SAASC,KAAK,CAAC;EAC7CC,WAAWA,CAACC,OAAe,EAAEC,QAAiB,EAAE;IAC9C,KAAK,CAACD,OAAO,CAAC;IACd,IAAAE,gCAAa,EAAC,IAAI,CAAC;IACnB,IAAID,QAAQ,EAAE,IAAAE,0CAAuB,EAAC,IAAI,EAAEF,QAAQ,CAAC;EACvD;AACF;AAACG,OAAA,CAAAC,OAAA,GAAAR,WAAA;AAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js b/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js new file mode 100644 index 0000000..68896d3 --- /dev/null +++ b/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js @@ -0,0 +1,98 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.beginHiddenCallStack = beginHiddenCallStack; +exports.endHiddenCallStack = endHiddenCallStack; +exports.expectedError = expectedError; +exports.injectVirtualStackFrame = injectVirtualStackFrame; +var _Object$getOwnPropert; +const ErrorToString = Function.call.bind(Error.prototype.toString); +const SUPPORTED = !!Error.captureStackTrace && ((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit")) == null ? void 0 : _Object$getOwnPropert.writable) === true; +const START_HIDING = "startHiding - secret - don't use this - v1"; +const STOP_HIDING = "stopHiding - secret - don't use this - v1"; +const expectedErrors = new WeakSet(); +const virtualFrames = new WeakMap(); +function CallSite(filename) { + return Object.create({ + isNative: () => false, + isConstructor: () => false, + isToplevel: () => true, + getFileName: () => filename, + getLineNumber: () => undefined, + getColumnNumber: () => undefined, + getFunctionName: () => undefined, + getMethodName: () => undefined, + getTypeName: () => undefined, + toString: () => filename + }); +} +function injectVirtualStackFrame(error, filename) { + if (!SUPPORTED) return; + let frames = virtualFrames.get(error); + if (!frames) virtualFrames.set(error, frames = []); + frames.push(CallSite(filename)); + return error; +} +function expectedError(error) { + if (!SUPPORTED) return; + expectedErrors.add(error); + return error; +} +function beginHiddenCallStack(fn) { + if (!SUPPORTED) return fn; + return Object.defineProperty(function (...args) { + setupPrepareStackTrace(); + return fn(...args); + }, "name", { + value: STOP_HIDING + }); +} +function endHiddenCallStack(fn) { + if (!SUPPORTED) return fn; + return Object.defineProperty(function (...args) { + return fn(...args); + }, "name", { + value: START_HIDING + }); +} +function setupPrepareStackTrace() { + setupPrepareStackTrace = () => {}; + const { + prepareStackTrace = defaultPrepareStackTrace + } = Error; + const MIN_STACK_TRACE_LIMIT = 50; + Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, MIN_STACK_TRACE_LIMIT)); + Error.prepareStackTrace = function stackTraceRewriter(err, trace) { + let newTrace = []; + const isExpected = expectedErrors.has(err); + let status = isExpected ? "hiding" : "unknown"; + for (let i = 0; i < trace.length; i++) { + const name = trace[i].getFunctionName(); + if (name === START_HIDING) { + status = "hiding"; + } else if (name === STOP_HIDING) { + if (status === "hiding") { + status = "showing"; + if (virtualFrames.has(err)) { + newTrace.unshift(...virtualFrames.get(err)); + } + } else if (status === "unknown") { + newTrace = trace; + break; + } + } else if (status !== "hiding") { + newTrace.push(trace[i]); + } + } + return prepareStackTrace(err, newTrace); + }; +} +function defaultPrepareStackTrace(err, trace) { + if (trace.length === 0) return ErrorToString(err); + return `${ErrorToString(err)}\n at ${trace.join("\n at ")}`; +} +0 && 0; + +//# sourceMappingURL=rewrite-stack-trace.js.map diff --git a/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js.map b/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js.map new file mode 100644 index 0000000..725bf91 --- /dev/null +++ b/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js.map @@ -0,0 +1 @@ +{"version":3,"names":["ErrorToString","Function","call","bind","Error","prototype","toString","SUPPORTED","captureStackTrace","_Object$getOwnPropert","Object","getOwnPropertyDescriptor","writable","START_HIDING","STOP_HIDING","expectedErrors","WeakSet","virtualFrames","WeakMap","CallSite","filename","create","isNative","isConstructor","isToplevel","getFileName","getLineNumber","undefined","getColumnNumber","getFunctionName","getMethodName","getTypeName","injectVirtualStackFrame","error","frames","get","set","push","expectedError","add","beginHiddenCallStack","fn","defineProperty","args","setupPrepareStackTrace","value","endHiddenCallStack","prepareStackTrace","defaultPrepareStackTrace","MIN_STACK_TRACE_LIMIT","stackTraceLimit","Math","max","stackTraceRewriter","err","trace","newTrace","isExpected","has","status","i","length","name","unshift","join"],"sources":["../../src/errors/rewrite-stack-trace.ts"],"sourcesContent":["/**\n * This file uses the internal V8 Stack Trace API (https://v8.dev/docs/stack-trace-api)\n * to provide utilities to rewrite the stack trace.\n * When this API is not present, all the functions in this file become noops.\n *\n * beginHiddenCallStack(fn) and endHiddenCallStack(fn) wrap their parameter to\n * mark an hidden portion of the stack trace. The function passed to\n * beginHiddenCallStack is the first hidden function, while the function passed\n * to endHiddenCallStack is the first shown function.\n *\n * When an error is thrown _outside_ of the hidden zone, everything between\n * beginHiddenCallStack and endHiddenCallStack will not be shown.\n * If an error is thrown _inside_ the hidden zone, then the whole stack trace\n * will be visible: this is to avoid hiding real bugs.\n * However, if an error inside the hidden zone is expected, it can be marked\n * with the expectedError(error) function to keep the hidden frames hidden.\n *\n * Consider this call stack (the outer function is the bottom one):\n *\n * 1. a()\n * 2. endHiddenCallStack(b)()\n * 3. c()\n * 4. beginHiddenCallStack(d)()\n * 5. e()\n * 6. f()\n *\n * - If a() throws an error, then its shown call stack will be \"a, b, e, f\"\n * - If b() throws an error, then its shown call stack will be \"b, e, f\"\n * - If c() throws an expected error, then its shown call stack will be \"e, f\"\n * - If c() throws an unexpected error, then its shown call stack will be \"c, d, e, f\"\n * - If d() throws an expected error, then its shown call stack will be \"e, f\"\n * - If d() throws an unexpected error, then its shown call stack will be \"d, e, f\"\n * - If e() throws an error, then its shown call stack will be \"e, f\"\n *\n * Additionally, an error can inject additional \"virtual\" stack frames using the\n * injectVirtualStackFrame(error, filename) function: those are injected as a\n * replacement of the hidden frames.\n * In the example above, if we called injectVirtualStackFrame(err, \"h\") and\n * injectVirtualStackFrame(err, \"i\") on the expected error thrown by c(), its\n * shown call stack would have been \"h, i, e, f\".\n * This can be useful, for example, to report config validation errors as if they\n * were directly thrown in the config file.\n */\n\nconst ErrorToString = Function.call.bind(Error.prototype.toString);\n\nconst SUPPORTED =\n !!Error.captureStackTrace &&\n Object.getOwnPropertyDescriptor(Error, \"stackTraceLimit\")?.writable === true;\n\nconst START_HIDING = \"startHiding - secret - don't use this - v1\";\nconst STOP_HIDING = \"stopHiding - secret - don't use this - v1\";\n\ntype CallSite = NodeJS.CallSite;\n\nconst expectedErrors = new WeakSet();\nconst virtualFrames = new WeakMap();\n\nfunction CallSite(filename: string): CallSite {\n // We need to use a prototype otherwise it breaks source-map-support's internals\n return Object.create({\n isNative: () => false,\n isConstructor: () => false,\n isToplevel: () => true,\n getFileName: () => filename,\n getLineNumber: () => undefined,\n getColumnNumber: () => undefined,\n getFunctionName: () => undefined,\n getMethodName: () => undefined,\n getTypeName: () => undefined,\n toString: () => filename,\n } as CallSite);\n}\n\nexport function injectVirtualStackFrame(error: Error, filename: string) {\n if (!SUPPORTED) return;\n\n let frames = virtualFrames.get(error);\n if (!frames) virtualFrames.set(error, (frames = []));\n frames.push(CallSite(filename));\n\n return error;\n}\n\nexport function expectedError(error: Error) {\n if (!SUPPORTED) return;\n expectedErrors.add(error);\n return error;\n}\n\nexport function beginHiddenCallStack(\n fn: (...args: A) => R,\n) {\n if (!SUPPORTED) return fn;\n\n return Object.defineProperty(\n function (...args: A) {\n setupPrepareStackTrace();\n return fn(...args);\n },\n \"name\",\n { value: STOP_HIDING },\n );\n}\n\nexport function endHiddenCallStack(\n fn: (...args: A) => R,\n) {\n if (!SUPPORTED) return fn;\n\n return Object.defineProperty(\n function (...args: A) {\n return fn(...args);\n },\n \"name\",\n { value: START_HIDING },\n );\n}\n\nfunction setupPrepareStackTrace() {\n // @ts-expect-error This function is a singleton\n setupPrepareStackTrace = () => {};\n\n const { prepareStackTrace = defaultPrepareStackTrace } = Error;\n\n // We add some extra frames to Error.stackTraceLimit, so that we can\n // always show some useful frames even after deleting ours.\n // STACK_TRACE_LIMIT_DELTA should be around the maximum expected number\n // of internal frames, and not too big because capturing the stack trace\n // is slow (this is why Error.stackTraceLimit does not default to Infinity!).\n // Increase it if needed.\n // However, we only do it if the user did not explicitly set it to 0.\n const MIN_STACK_TRACE_LIMIT = 50;\n Error.stackTraceLimit &&= Math.max(\n Error.stackTraceLimit,\n MIN_STACK_TRACE_LIMIT,\n );\n\n Error.prepareStackTrace = function stackTraceRewriter(err, trace) {\n let newTrace = [];\n\n const isExpected = expectedErrors.has(err);\n let status: \"showing\" | \"hiding\" | \"unknown\" = isExpected\n ? \"hiding\"\n : \"unknown\";\n for (let i = 0; i < trace.length; i++) {\n const name = trace[i].getFunctionName();\n if (name === START_HIDING) {\n status = \"hiding\";\n } else if (name === STOP_HIDING) {\n if (status === \"hiding\") {\n status = \"showing\";\n if (virtualFrames.has(err)) {\n newTrace.unshift(...virtualFrames.get(err));\n }\n } else if (status === \"unknown\") {\n // Unexpected internal error, show the full stack trace\n newTrace = trace;\n break;\n }\n } else if (status !== \"hiding\") {\n newTrace.push(trace[i]);\n }\n }\n\n return prepareStackTrace(err, newTrace);\n };\n}\n\nfunction defaultPrepareStackTrace(err: Error, trace: CallSite[]) {\n if (trace.length === 0) return ErrorToString(err);\n return `${ErrorToString(err)}\\n at ${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ib/gensync-utils/async.js b/node_modules/@babel/core/lib/gensync-utils/async.js new file mode 100644 index 0000000..42946c6 --- /dev/null +++ b/node_modules/@babel/core/lib/gensync-utils/async.js @@ -0,0 +1,90 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.forwardAsync = forwardAsync; +exports.isAsync = void 0; +exports.isThenable = isThenable; +exports.maybeAsync = maybeAsync; +exports.waitFor = exports.onFirstPause = void 0; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } +function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } +const runGenerator = _gensync()(function* (item) { + return yield* item; +}); +const isAsync = exports.isAsync = _gensync()({ + sync: () => false, + errback: cb => cb(null, true) +}); +function maybeAsync(fn, message) { + return _gensync()({ + sync(...args) { + const result = fn.apply(this, args); + if (isThenable(result)) throw new Error(message); + return result; + }, + async(...args) { + return Promise.resolve(fn.apply(this, args)); + } + }); +} +const withKind = _gensync()({ + sync: cb => cb("sync"), + async: function () { + var _ref = _asyncToGenerator(function* (cb) { + return cb("async"); + }); + return function async(_x) { + return _ref.apply(this, arguments); + }; + }() +}); +function forwardAsync(action, cb) { + const g = _gensync()(action); + return withKind(kind => { + const adapted = g[kind]; + return cb(adapted); + }); +} +const onFirstPause = exports.onFirstPause = _gensync()({ + name: "onFirstPause", + arity: 2, + sync: function (item) { + return runGenerator.sync(item); + }, + errback: function (item, firstPause, cb) { + let completed = false; + runGenerator.errback(item, (err, value) => { + completed = true; + cb(err, value); + }); + if (!completed) { + firstPause(); + } + } +}); +const waitFor = exports.waitFor = _gensync()({ + sync: x => x, + async: function () { + var _ref2 = _asyncToGenerator(function* (x) { + return x; + }); + return function async(_x2) { + return _ref2.apply(this, arguments); + }; + }() +}); +function isThenable(val) { + return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function"; +} +0 && 0; + +//# sourceMappingURL=async.js.map diff --git a/node_modules/@babel/core/lib/gensync-utils/async.js.map b/node_modules/@babel/core/lib/gensync-utils/async.js.map new file mode 100644 index 0000000..595d757 --- /dev/null +++ b/node_modules/@babel/core/lib/gensync-utils/async.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","asyncGeneratorStep","n","t","e","r","o","a","c","i","u","value","done","Promise","resolve","then","_asyncToGenerator","arguments","apply","_next","_throw","runGenerator","gensync","item","isAsync","exports","sync","errback","cb","maybeAsync","fn","message","args","result","isThenable","Error","async","withKind","_ref","_x","forwardAsync","action","g","kind","adapted","onFirstPause","name","arity","firstPause","completed","err","waitFor","x","_ref2","_x2","val"],"sources":["../../src/gensync-utils/async.ts"],"sourcesContent":["import gensync, { type Gensync, type Handler, type Callback } from \"gensync\";\n\ntype MaybePromise = T | Promise;\n\nconst runGenerator: {\n sync(gen: Handler): Return;\n async(gen: Handler): Promise;\n errback(gen: Handler, cb: Callback): void;\n} = gensync(function* (item: Handler): Handler {\n return yield* item;\n});\n\n// This Gensync returns true if the current execution context is\n// asynchronous, otherwise it returns false.\nexport const isAsync = gensync({\n sync: () => false,\n errback: cb => cb(null, true),\n});\n\n// This function wraps any functions (which could be either synchronous or\n// asynchronous) with a Gensync. If the wrapped function returns a promise\n// but the current execution context is synchronous, it will throw the\n// provided error.\n// This is used to handle user-provided functions which could be asynchronous.\nexport function maybeAsync(\n fn: (...args: Args) => Return,\n message: string,\n): Gensync {\n return gensync({\n sync(...args) {\n const result = fn.apply(this, args);\n if (isThenable(result)) throw new Error(message);\n return result;\n },\n async(...args) {\n return Promise.resolve(fn.apply(this, args));\n },\n });\n}\n\nconst withKind = gensync({\n sync: cb => cb(\"sync\"),\n async: async cb => cb(\"async\"),\n}) as (cb: (kind: \"sync\" | \"async\") => MaybePromise) => Handler;\n\n// This function wraps a generator (or a Gensync) into another function which,\n// when called, will run the provided generator in a sync or async way, depending\n// on the execution context where this forwardAsync function is called.\n// This is useful, for example, when passing a callback to a function which isn't\n// aware of gensync, but it only knows about synchronous and asynchronous functions.\n// An example is cache.using, which being exposed to the user must be as simple as\n// possible:\n// yield* forwardAsync(gensyncFn, wrappedFn =>\n// cache.using(x => {\n// // Here we don't know about gensync. wrappedFn is a\n// // normal sync or async function\n// return wrappedFn(x);\n// })\n// )\nexport function forwardAsync(\n action: (...args: Args) => Handler,\n cb: (\n adapted: (...args: Args) => MaybePromise,\n ) => MaybePromise,\n): Handler {\n const g = gensync(action);\n return withKind(kind => {\n const adapted = g[kind];\n return cb(adapted);\n });\n}\n\n// If the given generator is executed asynchronously, the first time that it\n// is paused (i.e. When it yields a gensync generator which can't be run\n// synchronously), call the \"firstPause\" callback.\nexport const onFirstPause = gensync<\n [gen: Handler, firstPause: () => void],\n unknown\n>({\n name: \"onFirstPause\",\n arity: 2,\n sync: function (item) {\n return runGenerator.sync(item);\n },\n errback: function (item, firstPause, cb) {\n let completed = false;\n\n runGenerator.errback(item, (err, value) => {\n completed = true;\n cb(err, value);\n });\n\n if (!completed) {\n firstPause();\n }\n },\n}) as (gen: Handler, firstPause: () => void) => Handler;\n\n// Wait for the given promise to be resolved\nexport const waitFor = gensync({\n sync: x => x,\n async: async x => x,\n}) as (p: T | Promise) => Handler;\n\nexport function isThenable(val: any): val is PromiseLike {\n return (\n !!val &&\n (typeof val === \"object\" || typeof val === \"function\") &&\n !!val.then &&\n typeof val.then === \"function\"\n );\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6E,SAAAE,mBAAAC,CAAA,EAAAC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vC,IAAIqB,SAAS,GAAG,KAAK;IAErB5B,YAAY,CAACM,OAAO,CAACJ,IAAI,EAAE,CAAC2B,GAAG,EAAEvC,KAAK,KAAK;MACzCsC,SAAS,GAAG,IAAI;MAChBrB,EAAE,CAACsB,GAAG,EAAEvC,KAAK,CAAC;IAChB,CAAC,CAAC;IAEF,IAAI,CAACsC,SAAS,EAAE;MACdD,UAAU,CAAC,CAAC;IACd;EACF;AACF,CAAC,CAA+D;AAGzD,MAAMG,OAAO,GAAA1B,OAAA,CAAA0B,OAAA,GAAG7B,SAAMA,CAAC,CAAC;EAC7BI,IAAI,EAAE0B,CAAC,IAAIA,CAAC;EACZhB,KAAK;IAAA,IAAAiB,KAAA,GAAArC,iBAAA,CAAE,WAAMoC,CAAC;MAAA,OAAIA,CAAC;IAAA;IAAA,gBAAnBhB,KAAKA,CAAAkB,GAAA;MAAA,OAAAD,KAAA,CAAAnC,KAAA,OAAAD,SAAA;IAAA;EAAA;AACP,CAAC,CAAyC;AAEnC,SAASiB,UAAUA,CAAUqB,GAAQ,EAAyB;EACnE,OACE,CAAC,CAACA,GAAG,KACJ,OAAOA,GAAG,KAAK,QAAQ,IAAI,OAAOA,GAAG,KAAK,UAAU,CAAC,IACtD,CAAC,CAACA,GAAG,CAACxC,IAAI,IACV,OAAOwC,GAAG,CAACxC,IAAI,KAAK,UAAU;AAElC;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/gensync-utils/fs.js b/node_modules/@babel/core/lib/gensync-utils/fs.js new file mode 100644 index 0000000..b842df8 --- /dev/null +++ b/node_modules/@babel/core/lib/gensync-utils/fs.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.stat = exports.readFile = void 0; +function _fs() { + const data = require("fs"); + _fs = function () { + return data; + }; + return data; +} +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +const readFile = exports.readFile = _gensync()({ + sync: _fs().readFileSync, + errback: _fs().readFile +}); +const stat = exports.stat = _gensync()({ + sync: _fs().statSync, + errback: _fs().stat +}); +0 && 0; + +//# sourceMappingURL=fs.js.map diff --git a/node_modules/@babel/core/lib/gensync-utils/fs.js.map b/node_modules/@babel/core/lib/gensync-utils/fs.js.map new file mode 100644 index 0000000..ef4e8d9 --- /dev/null +++ b/node_modules/@babel/core/lib/gensync-utils/fs.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_fs","data","require","_gensync","readFile","exports","gensync","sync","fs","readFileSync","errback","stat","statSync"],"sources":["../../src/gensync-utils/fs.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport gensync from \"gensync\";\n\nexport const readFile = gensync<[filepath: string, encoding: \"utf8\"], string>({\n sync: fs.readFileSync,\n errback: fs.readFile,\n});\n\nexport const stat = gensync({\n sync: fs.statSync,\n errback: fs.stat,\n});\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,SAAMA,CAAC,CAA+C;EAC5EC,IAAI,EAAEC,IAACA,CAAC,CAACC,YAAY;EACrBC,OAAO,EAAEF,IAACA,CAAC,CAACJ;AACd,CAAC,CAAC;AAEK,MAAMO,IAAI,GAAAN,OAAA,CAAAM,IAAA,GAAGL,SAAMA,CAAC,CAAC;EAC1BC,IAAI,EAAEC,IAACA,CAAC,CAACI,QAAQ;EACjBF,OAAO,EAAEF,IAACA,CAAC,CAACG;AACd,CAAC,CAAC;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/gensync-utils/functional.js b/node_modules/@babel/core/lib/gensync-utils/functional.js new file mode 100644 index 0000000..d7f7755 --- /dev/null +++ b/node_modules/@babel/core/lib/gensync-utils/functional.js @@ -0,0 +1,58 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.once = once; +var _async = require("./async.js"); +function once(fn) { + let result; + let resultP; + let promiseReferenced = false; + return function* () { + if (!result) { + if (resultP) { + promiseReferenced = true; + return yield* (0, _async.waitFor)(resultP); + } + if (!(yield* (0, _async.isAsync)())) { + try { + result = { + ok: true, + value: yield* fn() + }; + } catch (error) { + result = { + ok: false, + value: error + }; + } + } else { + let resolve, reject; + resultP = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + try { + result = { + ok: true, + value: yield* fn() + }; + resultP = null; + if (promiseReferenced) resolve(result.value); + } catch (error) { + result = { + ok: false, + value: error + }; + resultP = null; + if (promiseReferenced) reject(error); + } + } + } + if (result.ok) return result.value;else throw result.value; + }; +} +0 && 0; + +//# sourceMappingURL=functional.js.map diff --git a/node_modules/@babel/core/lib/gensync-utils/functional.js.map b/node_modules/@babel/core/lib/gensync-utils/functional.js.map new file mode 100644 index 0000000..e8c5ed0 --- /dev/null +++ b/node_modules/@babel/core/lib/gensync-utils/functional.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_async","require","once","fn","result","resultP","promiseReferenced","waitFor","isAsync","ok","value","error","resolve","reject","Promise","res","rej"],"sources":["../../src/gensync-utils/functional.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\n\nimport { isAsync, waitFor } from \"./async.ts\";\n\nexport function once(fn: () => Handler): () => Handler {\n let result: { ok: true; value: R } | { ok: false; value: unknown };\n let resultP: Promise;\n let promiseReferenced = false;\n return function* () {\n if (!result) {\n if (resultP) {\n promiseReferenced = true;\n return yield* waitFor(resultP);\n }\n\n if (!(yield* isAsync())) {\n try {\n result = { ok: true, value: yield* fn() };\n } catch (error) {\n result = { ok: false, value: error };\n }\n } else {\n let resolve: (result: R) => void, reject: (error: unknown) => void;\n resultP = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n try {\n result = { ok: true, value: yield* fn() };\n // Avoid keeping the promise around\n // now that we have the result.\n resultP = null;\n // We only resolve/reject the promise if it has been actually\n // referenced. If there are no listeners we can forget about it.\n // In the reject case, this avoid uncatchable unhandledRejection\n // events.\n if (promiseReferenced) resolve(result.value);\n } catch (error) {\n result = { ok: false, value: error };\n resultP = null;\n if (promiseReferenced) reject(error);\n }\n }\n }\n\n if (result.ok) return result.value;\n else throw result.value;\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAEO,SAASC,IAAIA,CAAIC,EAAoB,EAAoB;EAC9D,IAAIC,MAA8D;EAClE,IAAIC,OAAmB;EACvB,IAAIC,iBAAiB,GAAG,KAAK;EAC7B,OAAO,aAAa;IAClB,IAAI,CAACF,MAAM,EAAE;MACX,IAAIC,OAAO,EAAE;QACXC,iBAAiB,GAAG,IAAI;QACxB,OAAO,OAAO,IAAAC,cAAO,EAACF,OAAO,CAAC;MAChC;MAEA,IAAI,EAAE,OAAO,IAAAG,cAAO,EAAC,CAAC,CAAC,EAAE;QACvB,IAAI;UACFJ,MAAM,GAAG;YAAEK,EAAE,EAAE,IAAI;YAAEC,KAAK,EAAE,OAAOP,EAAE,CAAC;UAAE,CAAC;QAC3C,CAAC,CAAC,OAAOQ,KAAK,EAAE;UACdP,MAAM,GAAG;YAAEK,EAAE,EAAE,KAAK;YAAEC,KAAK,EAAEC;UAAM,CAAC;QACtC;MACF,CAAC,MAAM;QACL,IAAIC,OAA4B,EAAEC,MAAgC;QAClER,OAAO,GAAG,IAAIS,OAAO,CAAC,CAACC,GAAG,EAAEC,GAAG,KAAK;UAClCJ,OAAO,GAAGG,GAAG;UACbF,MAAM,GAAGG,GAAG;QACd,CAAC,CAAC;QAEF,IAAI;UACFZ,MAAM,GAAG;YAAEK,EAAE,EAAE,IAAI;YAAEC,KAAK,EAAE,OAAOP,EAAE,CAAC;UAAE,CAAC;UAGzCE,OAAO,GAAG,IAAI;UAKd,IAAIC,iBAAiB,EAAEM,OAAO,CAACR,MAAM,CAACM,KAAK,CAAC;QAC9C,CAAC,CAAC,OAAOC,KAAK,EAAE;UACdP,MAAM,GAAG;YAAEK,EAAE,EAAE,KAAK;YAAEC,KAAK,EAAEC;UAAM,CAAC;UACpCN,OAAO,GAAG,IAAI;UACd,IAAIC,iBAAiB,EAAEO,MAAM,CAACF,KAAK,CAAC;QACtC;MACF;IACF;IAEA,IAAIP,MAAM,CAACK,EAAE,EAAE,OAAOL,MAAM,CAACM,KAAK,CAAC,KAC9B,MAAMN,MAAM,CAACM,KAAK;EACzB,CAAC;AACH;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/index.js b/node_modules/@babel/core/lib/index.js new file mode 100644 index 0000000..0bd9491 --- /dev/null +++ b/node_modules/@babel/core/lib/index.js @@ -0,0 +1,233 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DEFAULT_EXTENSIONS = void 0; +Object.defineProperty(exports, "File", { + enumerable: true, + get: function () { + return _file.default; + } +}); +Object.defineProperty(exports, "buildExternalHelpers", { + enumerable: true, + get: function () { + return _buildExternalHelpers.default; + } +}); +Object.defineProperty(exports, "createConfigItem", { + enumerable: true, + get: function () { + return _index2.createConfigItem; + } +}); +Object.defineProperty(exports, "createConfigItemAsync", { + enumerable: true, + get: function () { + return _index2.createConfigItemAsync; + } +}); +Object.defineProperty(exports, "createConfigItemSync", { + enumerable: true, + get: function () { + return _index2.createConfigItemSync; + } +}); +Object.defineProperty(exports, "getEnv", { + enumerable: true, + get: function () { + return _environment.getEnv; + } +}); +Object.defineProperty(exports, "loadOptions", { + enumerable: true, + get: function () { + return _index2.loadOptions; + } +}); +Object.defineProperty(exports, "loadOptionsAsync", { + enumerable: true, + get: function () { + return _index2.loadOptionsAsync; + } +}); +Object.defineProperty(exports, "loadOptionsSync", { + enumerable: true, + get: function () { + return _index2.loadOptionsSync; + } +}); +Object.defineProperty(exports, "loadPartialConfig", { + enumerable: true, + get: function () { + return _index2.loadPartialConfig; + } +}); +Object.defineProperty(exports, "loadPartialConfigAsync", { + enumerable: true, + get: function () { + return _index2.loadPartialConfigAsync; + } +}); +Object.defineProperty(exports, "loadPartialConfigSync", { + enumerable: true, + get: function () { + return _index2.loadPartialConfigSync; + } +}); +Object.defineProperty(exports, "parse", { + enumerable: true, + get: function () { + return _parse.parse; + } +}); +Object.defineProperty(exports, "parseAsync", { + enumerable: true, + get: function () { + return _parse.parseAsync; + } +}); +Object.defineProperty(exports, "parseSync", { + enumerable: true, + get: function () { + return _parse.parseSync; + } +}); +exports.resolvePreset = exports.resolvePlugin = void 0; +Object.defineProperty((0, exports), "template", { + enumerable: true, + get: function () { + return _template().default; + } +}); +Object.defineProperty((0, exports), "tokTypes", { + enumerable: true, + get: function () { + return _parser().tokTypes; + } +}); +Object.defineProperty(exports, "transform", { + enumerable: true, + get: function () { + return _transform.transform; + } +}); +Object.defineProperty(exports, "transformAsync", { + enumerable: true, + get: function () { + return _transform.transformAsync; + } +}); +Object.defineProperty(exports, "transformFile", { + enumerable: true, + get: function () { + return _transformFile.transformFile; + } +}); +Object.defineProperty(exports, "transformFileAsync", { + enumerable: true, + get: function () { + return _transformFile.transformFileAsync; + } +}); +Object.defineProperty(exports, "transformFileSync", { + enumerable: true, + get: function () { + return _transformFile.transformFileSync; + } +}); +Object.defineProperty(exports, "transformFromAst", { + enumerable: true, + get: function () { + return _transformAst.transformFromAst; + } +}); +Object.defineProperty(exports, "transformFromAstAsync", { + enumerable: true, + get: function () { + return _transformAst.transformFromAstAsync; + } +}); +Object.defineProperty(exports, "transformFromAstSync", { + enumerable: true, + get: function () { + return _transformAst.transformFromAstSync; + } +}); +Object.defineProperty(exports, "transformSync", { + enumerable: true, + get: function () { + return _transform.transformSync; + } +}); +Object.defineProperty((0, exports), "traverse", { + enumerable: true, + get: function () { + return _traverse().default; + } +}); +exports.version = exports.types = void 0; +var _file = require("./transformation/file/file.js"); +var _buildExternalHelpers = require("./tools/build-external-helpers.js"); +var resolvers = require("./config/files/index.js"); +var _environment = require("./config/helpers/environment.js"); +function _types() { + const data = require("@babel/types"); + _types = function () { + return data; + }; + return data; +} +Object.defineProperty((0, exports), "types", { + enumerable: true, + get: function () { + return _types(); + } +}); +function _parser() { + const data = require("@babel/parser"); + _parser = function () { + return data; + }; + return data; +} +function _traverse() { + const data = require("@babel/traverse"); + _traverse = function () { + return data; + }; + return data; +} +function _template() { + const data = require("@babel/template"); + _template = function () { + return data; + }; + return data; +} +var _index2 = require("./config/index.js"); +var _transform = require("./transform.js"); +var _transformFile = require("./transform-file.js"); +var _transformAst = require("./transform-ast.js"); +var _parse = require("./parse.js"); +; +const version = exports.version = "7.28.5"; +const resolvePlugin = (name, dirname) => resolvers.resolvePlugin(name, dirname, false).filepath; +exports.resolvePlugin = resolvePlugin; +const resolvePreset = (name, dirname) => resolvers.resolvePreset(name, dirname, false).filepath; +exports.resolvePreset = resolvePreset; +const DEFAULT_EXTENSIONS = exports.DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]); +{ + exports.OptionManager = class OptionManager { + init(opts) { + return (0, _index2.loadOptionsSync)(opts); + } + }; + exports.Plugin = function Plugin(alias) { + throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`); + }; +} +0 && (exports.types = exports.traverse = exports.tokTypes = exports.template = 0); + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/core/lib/index.js.map b/node_modules/@babel/core/lib/index.js.map new file mode 100644 index 0000000..cf14973 --- /dev/null +++ b/node_modules/@babel/core/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_file","require","_buildExternalHelpers","resolvers","_environment","_types","data","Object","defineProperty","exports","enumerable","get","_parser","_traverse","_template","_index2","_transform","_transformFile","_transformAst","_parse","version","resolvePlugin","name","dirname","filepath","resolvePreset","DEFAULT_EXTENSIONS","freeze","OptionManager","init","opts","loadOptionsSync","Plugin","alias","Error","types","traverse","tokTypes","template"],"sources":["../src/index.ts"],"sourcesContent":["if (!process.env.IS_PUBLISH && !USE_ESM && process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"BABEL_8_BREAKING is only supported in ESM. Please run `make use-esm`.\",\n );\n}\n\nexport const version = PACKAGE_JSON.version;\n\nexport { default as File } from \"./transformation/file/file.ts\";\nexport type { default as PluginPass } from \"./transformation/plugin-pass.ts\";\nexport { default as buildExternalHelpers } from \"./tools/build-external-helpers.ts\";\n\nimport * as resolvers from \"./config/files/index.ts\";\n// For backwards-compatibility, we expose the resolvers\n// with the old API.\nexport const resolvePlugin = (name: string, dirname: string) =>\n resolvers.resolvePlugin(name, dirname, false).filepath;\nexport const resolvePreset = (name: string, dirname: string) =>\n resolvers.resolvePreset(name, dirname, false).filepath;\n\nexport { getEnv } from \"./config/helpers/environment.ts\";\n\n// NOTE: Lazy re-exports aren't detected by the Node.js CJS-ESM interop.\n// These are handled by pluginInjectNodeReexportsHints in our babel.config.js\n// so that they can work well.\nexport * as types from \"@babel/types\";\nexport { tokTypes } from \"@babel/parser\";\nexport { default as traverse } from \"@babel/traverse\";\nexport { default as template } from \"@babel/template\";\n\n// rollup-plugin-dts assumes that all re-exported types are also valid values\n// Visitor is only a type, so we need to use this workaround to prevent\n// rollup-plugin-dts from breaking it.\n// TODO: Figure out how to fix this upstream.\nexport type { NodePath, Scope } from \"@babel/traverse\";\nexport type Visitor = import(\"@babel/traverse\").Visitor;\n\nexport {\n createConfigItem,\n createConfigItemAsync,\n createConfigItemSync,\n} from \"./config/index.ts\";\n\nexport {\n loadOptions,\n loadOptionsAsync,\n loadPartialConfig,\n loadPartialConfigAsync,\n loadPartialConfigSync,\n} from \"./config/index.ts\";\nimport { loadOptionsSync } from \"./config/index.ts\";\nimport type {\n ConfigApplicableTest,\n PluginItem,\n} from \"./config/validation/options.ts\";\nexport { loadOptionsSync };\nexport type { PluginItem };\n\nexport type PresetObject = {\n overrides?: PresetObject[];\n test?: ConfigApplicableTest;\n plugins?: PluginItem[];\n};\n\nexport type {\n CallerMetadata,\n ConfigAPI,\n ConfigItem,\n InputOptions,\n NormalizedOptions,\n PartialConfig,\n PluginAPI,\n PluginObject,\n PresetAPI,\n} from \"./config/index.ts\";\n\nexport {\n type FileResult,\n transform,\n transformAsync,\n transformSync,\n} from \"./transform.ts\";\nexport {\n transformFile,\n transformFileAsync,\n transformFileSync,\n} from \"./transform-file.ts\";\nexport {\n transformFromAst,\n transformFromAstAsync,\n transformFromAstSync,\n} from \"./transform-ast.ts\";\nexport { parse, parseAsync, parseSync } from \"./parse.ts\";\n\n/**\n * Recommended set of compilable extensions. Not used in @babel/core directly, but meant as\n * as an easy source for tooling making use of @babel/core.\n */\nexport const DEFAULT_EXTENSIONS = Object.freeze([\n \".js\",\n \".jsx\",\n \".es6\",\n \".es\",\n \".mjs\",\n \".cjs\",\n] as const);\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n // For easier backward-compatibility, provide an API like the one we exposed in Babel 6.\n // eslint-disable-next-line no-restricted-globals\n exports.OptionManager = class OptionManager {\n init(opts: any) {\n return loadOptionsSync(opts);\n }\n };\n\n // eslint-disable-next-line no-restricted-globals\n exports.Plugin = function Plugin(alias: string) {\n throw new Error(\n `The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`,\n );\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,qBAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAQA,IAAAG,YAAA,GAAAH,OAAA;AAAyD,SAAAI,OAAA;EAAA,MAAAC,IAAA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B,MAAM,CAACoB,MAAM,CAAC,CAC9C,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,CACE,CAAC;AAEoC;EAG7ClB,OAAO,CAACmB,aAAa,GAAG,MAAMA,aAAa,CAAC;IAC1CC,IAAIA,CAACC,IAAS,EAAE;MACd,OAAO,IAAAC,uBAAe,EAACD,IAAI,CAAC;IAC9B;EACF,CAAC;EAGDrB,OAAO,CAACuB,MAAM,GAAG,SAASA,MAAMA,CAACC,KAAa,EAAE;IAC9C,MAAM,IAAIC,KAAK,CACb,QAAQD,KAAK,kEACf,CAAC;EACH,CAAC;AACH;AAAC,MAAAxB,OAAA,CAAA0B,KAAA,GAAA1B,OAAA,CAAA2B,QAAA,GAAA3B,OAAA,CAAA4B,QAAA,GAAA5B,OAAA,CAAA6B,QAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/parse.js b/node_modules/@babel/core/lib/parse.js new file mode 100644 index 0000000..7e41142 --- /dev/null +++ b/node_modules/@babel/core/lib/parse.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parse = void 0; +exports.parseAsync = parseAsync; +exports.parseSync = parseSync; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _index = require("./config/index.js"); +var _index2 = require("./parser/index.js"); +var _normalizeOpts = require("./transformation/normalize-opts.js"); +var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js"); +const parseRunner = _gensync()(function* parse(code, opts) { + const config = yield* (0, _index.default)(opts); + if (config === null) { + return null; + } + return yield* (0, _index2.default)(config.passes, (0, _normalizeOpts.default)(config), code); +}); +const parse = exports.parse = function parse(code, opts, callback) { + if (typeof opts === "function") { + callback = opts; + opts = undefined; + } + if (callback === undefined) { + { + return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(code, opts); + } + } + (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.errback)(code, opts, callback); +}; +function parseSync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(...args); +} +function parseAsync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.async)(...args); +} +0 && 0; + +//# sourceMappingURL=parse.js.map diff --git a/node_modules/@babel/core/lib/parse.js.map b/node_modules/@babel/core/lib/parse.js.map new file mode 100644 index 0000000..d364a32 --- /dev/null +++ b/node_modules/@babel/core/lib/parse.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_index","_index2","_normalizeOpts","_rewriteStackTrace","parseRunner","gensync","parse","code","opts","config","loadConfig","parser","passes","normalizeOptions","exports","callback","undefined","beginHiddenCallStack","sync","errback","parseSync","args","parseAsync","async"],"sources":["../src/parse.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig, { type InputOptions } from \"./config/index.ts\";\nimport parser, { type ParseResult } from \"./parser/index.ts\";\nimport normalizeOptions from \"./transformation/normalize-opts.ts\";\n\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\ntype FileParseCallback = {\n (err: Error, ast: null): void;\n (err: null, ast: ParseResult | null): void;\n};\n\ntype Parse = {\n (code: string, callback: FileParseCallback): void;\n (\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileParseCallback,\n ): void;\n (code: string, opts?: InputOptions | null): ParseResult | null;\n};\n\nconst parseRunner = gensync(function* parse(\n code: string,\n opts: InputOptions | undefined | null,\n): Handler {\n const config = yield* loadConfig(opts);\n\n if (config === null) {\n return null;\n }\n\n return yield* parser(config.passes, normalizeOptions(config), code);\n});\n\nexport const parse: Parse = function parse(\n code,\n opts?,\n callback?: FileParseCallback,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined as InputOptions;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'parse' function expects a callback. If you need to call it synchronously, please use 'parseSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'parse' function will expect a callback. If you need to call it synchronously, please use 'parseSync'.\",\n // );\n return beginHiddenCallStack(parseRunner.sync)(code, opts);\n }\n }\n\n beginHiddenCallStack(parseRunner.errback)(code, opts, callback);\n};\n\nexport function parseSync(...args: Parameters) {\n return beginHiddenCallStack(parseRunner.sync)(...args);\n}\nexport function parseAsync(...args: Parameters) {\n return beginHiddenCallStack(parseRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AAiBA,MAAMK,WAAW,GAAGC,SAAMA,CAAC,CAAC,UAAUC,KAAKA,CACzCC,IAAY,EACZC,IAAqC,EACR;EAC7B,MAAMC,MAAM,GAAG,OAAO,IAAAC,cAAU,EAACF,IAAI,CAAC;EAEtC,IAAIC,MAAM,KAAK,IAAI,EAAE;IACnB,OAAO,IAAI;EACb;EAEA,OAAO,OAAO,IAAAE,eAAM,EAACF,MAAM,CAACG,MAAM,EAAE,IAAAC,sBAAgB,EAACJ,MAAM,CAAC,EAAEF,IAAI,CAAC;AACrE,CAAC,CAAC;AAEK,MAAMD,KAAY,GAAAQ,OAAA,CAAAR,KAAA,GAAG,SAASA,KAAKA,CACxCC,IAAI,EACJC,IAAK,EACLO,QAA4B,EAC5B;EACA,IAAI,OAAOP,IAAI,KAAK,UAAU,EAAE;IAC9BO,QAAQ,GAAGP,IAAI;IACfA,IAAI,GAAGQ,SAAyB;EAClC;EAEA,IAAID,QAAQ,KAAKC,SAAS,EAAE;IAKnB;MAIL,OAAO,IAAAC,uCAAoB,EAACb,WAAW,CAACc,IAAI,CAAC,CAACX,IAAI,EAAEC,IAAI,CAAC;IAC3D;EACF;EAEA,IAAAS,uCAAoB,EAACb,WAAW,CAACe,OAAO,CAAC,CAACZ,IAAI,EAAEC,IAAI,EAAEO,QAAQ,CAAC;AACjE,CAAC;AAEM,SAASK,SAASA,CAAC,GAAGC,IAAyC,EAAE;EACtE,OAAO,IAAAJ,uCAAoB,EAACb,WAAW,CAACc,IAAI,CAAC,CAAC,GAAGG,IAAI,CAAC;AACxD;AACO,SAASC,UAAUA,CAAC,GAAGD,IAA0C,EAAE;EACxE,OAAO,IAAAJ,uCAAoB,EAACb,WAAW,CAACmB,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACzD;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/parser/index.js b/node_modules/@babel/core/lib/parser/index.js new file mode 100644 index 0000000..d198bb2 --- /dev/null +++ b/node_modules/@babel/core/lib/parser/index.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parser; +function _parser() { + const data = require("@babel/parser"); + _parser = function () { + return data; + }; + return data; +} +function _codeFrame() { + const data = require("@babel/code-frame"); + _codeFrame = function () { + return data; + }; + return data; +} +var _missingPluginHelper = require("./util/missing-plugin-helper.js"); +function* parser(pluginPasses, { + parserOpts, + highlightCode = true, + filename = "unknown" +}, code) { + try { + const results = []; + for (const plugins of pluginPasses) { + for (const plugin of plugins) { + const { + parserOverride + } = plugin; + if (parserOverride) { + const ast = parserOverride(code, parserOpts, _parser().parse); + if (ast !== undefined) results.push(ast); + } + } + } + if (results.length === 0) { + return (0, _parser().parse)(code, parserOpts); + } else if (results.length === 1) { + yield* []; + if (typeof results[0].then === "function") { + throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); + } + return results[0]; + } + throw new Error("More than one plugin attempted to override parsing."); + } catch (err) { + if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") { + err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file."; + } + const { + loc, + missingPlugin + } = err; + if (loc) { + const codeFrame = (0, _codeFrame().codeFrameColumns)(code, { + start: { + line: loc.line, + column: loc.column + 1 + } + }, { + highlightCode + }); + if (missingPlugin) { + err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame, filename); + } else { + err.message = `${filename}: ${err.message}\n\n` + codeFrame; + } + err.code = "BABEL_PARSE_ERROR"; + } + throw err; + } +} +0 && 0; + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/core/lib/parser/index.js.map b/node_modules/@babel/core/lib/parser/index.js.map new file mode 100644 index 0000000..7701030 --- /dev/null +++ b/node_modules/@babel/core/lib/parser/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_parser","data","require","_codeFrame","_missingPluginHelper","parser","pluginPasses","parserOpts","highlightCode","filename","code","results","plugins","plugin","parserOverride","ast","parse","undefined","push","length","then","Error","err","message","loc","missingPlugin","codeFrame","codeFrameColumns","start","line","column","generateMissingPluginMessage"],"sources":["../../src/parser/index.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\nimport { parse, type ParseResult } from \"@babel/parser\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport generateMissingPluginMessage from \"./util/missing-plugin-helper.ts\";\nimport type { PluginPasses } from \"../config/index.ts\";\nimport type { ResolvedOptions } from \"../config/validation/options.ts\";\n\nexport type { ParseResult };\n\nexport default function* parser(\n pluginPasses: PluginPasses,\n { parserOpts, highlightCode = true, filename = \"unknown\" }: ResolvedOptions,\n code: string,\n): Handler {\n try {\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { parserOverride } = plugin;\n if (parserOverride) {\n const ast = parserOverride(code, parserOpts, parse);\n\n if (ast !== undefined) results.push(ast);\n }\n }\n }\n\n if (results.length === 0) {\n return parse(code, parserOpts);\n } else if (results.length === 1) {\n // If we want to allow async parsers\n yield* [];\n if (typeof (results[0] as any).then === \"function\") {\n throw new Error(\n `You appear to be using an async parser plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n return results[0];\n }\n // TODO: Add an error code\n throw new Error(\"More than one plugin attempted to override parsing.\");\n } catch (err) {\n if (err.code === \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\") {\n err.message +=\n \"\\nConsider renaming the file to '.mjs', or setting sourceType:module \" +\n \"or sourceType:unambiguous in your Babel config for this file.\";\n // err.code will be changed to BABEL_PARSE_ERROR later.\n }\n\n const { loc, missingPlugin } = err;\n if (loc) {\n const codeFrame = codeFrameColumns(\n code,\n {\n start: {\n line: loc.line,\n column: loc.column + 1,\n },\n },\n {\n highlightCode,\n },\n );\n if (missingPlugin) {\n err.message =\n `${filename}: ` +\n generateMissingPluginMessage(\n missingPlugin[0],\n loc,\n codeFrame,\n filename,\n );\n } else {\n err.message = `${filename}: ${err.message}\\n\\n` + codeFrame;\n }\n err.code = \"BABEL_PARSE_ERROR\";\n }\n throw err;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAG,oBAAA,GAAAF,OAAA;AAMe,UAAUG,MAAMA,CAC7BC,YAA0B,EAC1B;EAAEC,UAAU;EAAEC,aAAa,GAAG,IAAI;EAAEC,QAAQ,GAAG;AAA2B,CAAC,EAC3EC,IAAY,EACU;EACtB,IAAI;IACF,MAAMC,OAAO,GAAG,EAAE;IAClB,KAAK,MAAMC,OAAO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AO,GACT,GAAGd,QAAQ,IAAI,GACf,IAAAsB,4BAA4B,EAC1BN,aAAa,CAAC,CAAC,CAAC,EAChBD,GAAG,EACHE,SAAS,EACTjB,QACF,CAAC;MACL,CAAC,MAAM;QACLa,GAAG,CAACC,OAAO,GAAG,GAAGd,QAAQ,KAAKa,GAAG,CAACC,OAAO,MAAM,GAAGG,SAAS;MAC7D;MACAJ,GAAG,CAACZ,IAAI,GAAG,mBAAmB;IAChC;IACA,MAAMY,GAAG;EACX;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js b/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js new file mode 100644 index 0000000..5e05a26 --- /dev/null +++ b/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js @@ -0,0 +1,339 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = generateMissingPluginMessage; +const pluginNameMap = { + asyncDoExpressions: { + syntax: { + name: "@babel/plugin-syntax-async-do-expressions", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions" + } + }, + decimal: { + syntax: { + name: "@babel/plugin-syntax-decimal", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal" + } + }, + decorators: { + syntax: { + name: "@babel/plugin-syntax-decorators", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators" + }, + transform: { + name: "@babel/plugin-proposal-decorators", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators" + } + }, + doExpressions: { + syntax: { + name: "@babel/plugin-syntax-do-expressions", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions" + }, + transform: { + name: "@babel/plugin-proposal-do-expressions", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions" + } + }, + exportDefaultFrom: { + syntax: { + name: "@babel/plugin-syntax-export-default-from", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from" + }, + transform: { + name: "@babel/plugin-proposal-export-default-from", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from" + } + }, + flow: { + syntax: { + name: "@babel/plugin-syntax-flow", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow" + }, + transform: { + name: "@babel/preset-flow", + url: "https://github.com/babel/babel/tree/main/packages/babel-preset-flow" + } + }, + functionBind: { + syntax: { + name: "@babel/plugin-syntax-function-bind", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind" + }, + transform: { + name: "@babel/plugin-proposal-function-bind", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind" + } + }, + functionSent: { + syntax: { + name: "@babel/plugin-syntax-function-sent", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent" + }, + transform: { + name: "@babel/plugin-proposal-function-sent", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent" + } + }, + jsx: { + syntax: { + name: "@babel/plugin-syntax-jsx", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx" + }, + transform: { + name: "@babel/preset-react", + url: "https://github.com/babel/babel/tree/main/packages/babel-preset-react" + } + }, + pipelineOperator: { + syntax: { + name: "@babel/plugin-syntax-pipeline-operator", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator" + }, + transform: { + name: "@babel/plugin-proposal-pipeline-operator", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator" + } + }, + recordAndTuple: { + syntax: { + name: "@babel/plugin-syntax-record-and-tuple", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple" + } + }, + throwExpressions: { + syntax: { + name: "@babel/plugin-syntax-throw-expressions", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions" + }, + transform: { + name: "@babel/plugin-proposal-throw-expressions", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions" + } + }, + typescript: { + syntax: { + name: "@babel/plugin-syntax-typescript", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript" + }, + transform: { + name: "@babel/preset-typescript", + url: "https://github.com/babel/babel/tree/main/packages/babel-preset-typescript" + } + } +}; +{ + Object.assign(pluginNameMap, { + asyncGenerators: { + syntax: { + name: "@babel/plugin-syntax-async-generators", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators" + }, + transform: { + name: "@babel/plugin-transform-async-generator-functions", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions" + } + }, + classProperties: { + syntax: { + name: "@babel/plugin-syntax-class-properties", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties" + }, + transform: { + name: "@babel/plugin-transform-class-properties", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties" + } + }, + classPrivateProperties: { + syntax: { + name: "@babel/plugin-syntax-class-properties", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties" + }, + transform: { + name: "@babel/plugin-transform-class-properties", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties" + } + }, + classPrivateMethods: { + syntax: { + name: "@babel/plugin-syntax-class-properties", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties" + }, + transform: { + name: "@babel/plugin-transform-private-methods", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods" + } + }, + classStaticBlock: { + syntax: { + name: "@babel/plugin-syntax-class-static-block", + url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block" + }, + transform: { + name: "@babel/plugin-transform-class-static-block", + url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block" + } + }, + dynamicImport: { + syntax: { + name: "@babel/plugin-syntax-dynamic-import", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import" + } + }, + exportNamespaceFrom: { + syntax: { + name: "@babel/plugin-syntax-export-namespace-from", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from" + }, + transform: { + name: "@babel/plugin-transform-export-namespace-from", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from" + } + }, + importAssertions: { + syntax: { + name: "@babel/plugin-syntax-import-assertions", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions" + } + }, + importAttributes: { + syntax: { + name: "@babel/plugin-syntax-import-attributes", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes" + } + }, + importMeta: { + syntax: { + name: "@babel/plugin-syntax-import-meta", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta" + } + }, + logicalAssignment: { + syntax: { + name: "@babel/plugin-syntax-logical-assignment-operators", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators" + }, + transform: { + name: "@babel/plugin-transform-logical-assignment-operators", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators" + } + }, + moduleStringNames: { + syntax: { + name: "@babel/plugin-syntax-module-string-names", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names" + } + }, + numericSeparator: { + syntax: { + name: "@babel/plugin-syntax-numeric-separator", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator" + }, + transform: { + name: "@babel/plugin-transform-numeric-separator", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator" + } + }, + nullishCoalescingOperator: { + syntax: { + name: "@babel/plugin-syntax-nullish-coalescing-operator", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator" + }, + transform: { + name: "@babel/plugin-transform-nullish-coalescing-operator", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator" + } + }, + objectRestSpread: { + syntax: { + name: "@babel/plugin-syntax-object-rest-spread", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread" + }, + transform: { + name: "@babel/plugin-transform-object-rest-spread", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread" + } + }, + optionalCatchBinding: { + syntax: { + name: "@babel/plugin-syntax-optional-catch-binding", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding" + }, + transform: { + name: "@babel/plugin-transform-optional-catch-binding", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding" + } + }, + optionalChaining: { + syntax: { + name: "@babel/plugin-syntax-optional-chaining", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining" + }, + transform: { + name: "@babel/plugin-transform-optional-chaining", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining" + } + }, + privateIn: { + syntax: { + name: "@babel/plugin-syntax-private-property-in-object", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object" + }, + transform: { + name: "@babel/plugin-transform-private-property-in-object", + url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object" + } + }, + regexpUnicodeSets: { + syntax: { + name: "@babel/plugin-syntax-unicode-sets-regex", + url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md" + }, + transform: { + name: "@babel/plugin-transform-unicode-sets-regex", + url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md" + } + } + }); +} +const getNameURLCombination = ({ + name, + url +}) => `${name} (${url})`; +function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) { + let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame; + const pluginInfo = pluginNameMap[missingPluginName]; + if (pluginInfo) { + const { + syntax: syntaxPlugin, + transform: transformPlugin + } = pluginInfo; + if (syntaxPlugin) { + const syntaxPluginInfo = getNameURLCombination(syntaxPlugin); + if (transformPlugin) { + const transformPluginInfo = getNameURLCombination(transformPlugin); + const sectionType = transformPlugin.name.startsWith("@babel/plugin") ? "plugins" : "presets"; + helpMessage += `\n\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation. +If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`; + } else { + helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`; + } + } + } + const msgFilename = filename === "unknown" ? "" : filename; + helpMessage += ` + +If you already added the plugin for this syntax to your config, it's possible that your config \ +isn't being loaded. +You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \ +configuration: +\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} +See https://babeljs.io/docs/configuration#print-effective-configs for more info. +`; + return helpMessage; +} +0 && 0; + +//# sourceMappingURL=missing-plugin-helper.js.map diff --git a/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js.map b/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js.map new file mode 100644 index 0000000..c6dfa8f --- /dev/null +++ b/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js.map @@ -0,0 +1 @@ +{"version":3,"names":["pluginNameMap","asyncDoExpressions","syntax","name","url","decimal","decorators","transform","doExpressions","exportDefaultFrom","flow","functionBind","functionSent","jsx","pipelineOperator","recordAndTuple","throwExpressions","typescript","Object","assign","asyncGenerators","classProperties","classPrivateProperties","classPrivateMethods","classStaticBlock","dynamicImport","exportNamespaceFrom","importAssertions","importAttributes","importMeta","logicalAssignment","moduleStringNames","numericSeparator","nullishCoalescingOperator","objectRestSpread","optionalCatchBinding","optionalChaining","privateIn","regexpUnicodeSets","getNameURLCombination","generateMissingPluginMessage","missingPluginName","loc","codeFrame","filename","helpMessage","line","column","pluginInfo","syntaxPlugin","transformPlugin","syntaxPluginInfo","transformPluginInfo","sectionType","startsWith","msgFilename"],"sources":["../../../src/parser/util/missing-plugin-helper.ts"],"sourcesContent":["const pluginNameMap: Record<\n string,\n Partial>>\n> = {\n asyncDoExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-async-do-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions\",\n },\n },\n decimal: {\n syntax: {\n name: \"@babel/plugin-syntax-decimal\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal\",\n },\n },\n decorators: {\n syntax: {\n name: \"@babel/plugin-syntax-decorators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators\",\n },\n transform: {\n name: \"@babel/plugin-proposal-decorators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators\",\n },\n },\n doExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-do-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions\",\n },\n transform: {\n name: \"@babel/plugin-proposal-do-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions\",\n },\n },\n exportDefaultFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-default-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from\",\n },\n transform: {\n name: \"@babel/plugin-proposal-export-default-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from\",\n },\n },\n flow: {\n syntax: {\n name: \"@babel/plugin-syntax-flow\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow\",\n },\n transform: {\n name: \"@babel/preset-flow\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-preset-flow\",\n },\n },\n functionBind: {\n syntax: {\n name: \"@babel/plugin-syntax-function-bind\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-bind\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind\",\n },\n },\n functionSent: {\n syntax: {\n name: \"@babel/plugin-syntax-function-sent\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-sent\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent\",\n },\n },\n jsx: {\n syntax: {\n name: \"@babel/plugin-syntax-jsx\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx\",\n },\n transform: {\n name: \"@babel/preset-react\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-preset-react\",\n },\n },\n pipelineOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-pipeline-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator\",\n },\n transform: {\n name: \"@babel/plugin-proposal-pipeline-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator\",\n },\n },\n recordAndTuple: {\n syntax: {\n name: \"@babel/plugin-syntax-record-and-tuple\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple\",\n },\n },\n throwExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-throw-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions\",\n },\n transform: {\n name: \"@babel/plugin-proposal-throw-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions\",\n },\n },\n typescript: {\n syntax: {\n name: \"@babel/plugin-syntax-typescript\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript\",\n },\n transform: {\n name: \"@babel/preset-typescript\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-preset-typescript\",\n },\n },\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n // TODO: This plugins are now supported by default by @babel/parser.\n Object.assign(pluginNameMap, {\n asyncGenerators: {\n syntax: {\n name: \"@babel/plugin-syntax-async-generators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators\",\n },\n transform: {\n name: \"@babel/plugin-transform-async-generator-functions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions\",\n },\n },\n classProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties\",\n },\n transform: {\n name: \"@babel/plugin-transform-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties\",\n },\n },\n classPrivateProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties\",\n },\n transform: {\n name: \"@babel/plugin-transform-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties\",\n },\n },\n classPrivateMethods: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties\",\n },\n transform: {\n name: \"@babel/plugin-transform-private-methods\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods\",\n },\n },\n classStaticBlock: {\n syntax: {\n name: \"@babel/plugin-syntax-class-static-block\",\n url: \"https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block\",\n },\n transform: {\n name: \"@babel/plugin-transform-class-static-block\",\n url: \"https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block\",\n },\n },\n dynamicImport: {\n syntax: {\n name: \"@babel/plugin-syntax-dynamic-import\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import\",\n },\n },\n exportNamespaceFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-namespace-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from\",\n },\n transform: {\n name: \"@babel/plugin-transform-export-namespace-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from\",\n },\n },\n // Will be removed\n importAssertions: {\n syntax: {\n name: \"@babel/plugin-syntax-import-assertions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions\",\n },\n },\n importAttributes: {\n syntax: {\n name: \"@babel/plugin-syntax-import-attributes\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes\",\n },\n },\n importMeta: {\n syntax: {\n name: \"@babel/plugin-syntax-import-meta\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta\",\n },\n },\n logicalAssignment: {\n syntax: {\n name: \"@babel/plugin-syntax-logical-assignment-operators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators\",\n },\n transform: {\n name: \"@babel/plugin-transform-logical-assignment-operators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators\",\n },\n },\n moduleStringNames: {\n syntax: {\n name: \"@babel/plugin-syntax-module-string-names\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names\",\n },\n },\n numericSeparator: {\n syntax: {\n name: \"@babel/plugin-syntax-numeric-separator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator\",\n },\n transform: {\n name: \"@babel/plugin-transform-numeric-separator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator\",\n },\n },\n nullishCoalescingOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-nullish-coalescing-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator\",\n },\n transform: {\n name: \"@babel/plugin-transform-nullish-coalescing-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator\",\n },\n },\n objectRestSpread: {\n syntax: {\n name: \"@babel/plugin-syntax-object-rest-spread\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread\",\n },\n transform: {\n name: \"@babel/plugin-transform-object-rest-spread\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread\",\n },\n },\n optionalCatchBinding: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-catch-binding\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding\",\n },\n transform: {\n name: \"@babel/plugin-transform-optional-catch-binding\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding\",\n },\n },\n optionalChaining: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-chaining\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining\",\n },\n transform: {\n name: \"@babel/plugin-transform-optional-chaining\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining\",\n },\n },\n privateIn: {\n syntax: {\n name: \"@babel/plugin-syntax-private-property-in-object\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object\",\n },\n transform: {\n name: \"@babel/plugin-transform-private-property-in-object\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object\",\n },\n },\n regexpUnicodeSets: {\n syntax: {\n name: \"@babel/plugin-syntax-unicode-sets-regex\",\n url: \"https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md\",\n },\n transform: {\n name: \"@babel/plugin-transform-unicode-sets-regex\",\n url: \"https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md\",\n },\n },\n });\n}\n\nconst getNameURLCombination = ({ name, url }: { name: string; url: string }) =>\n `${name} (${url})`;\n\n/*\nReturns a string of the format:\nSupport for the experimental syntax [@babel/parser plugin name] isn't currently enabled ([loc]):\n\n[code frame]\n\nAdd [npm package name] ([url]) to the 'plugins' section of your Babel config\nto enable [parsing|transformation].\n*/\nexport default function generateMissingPluginMessage(\n missingPluginName: string,\n loc: {\n line: number;\n column: number;\n },\n codeFrame: string,\n filename: string,\n): string {\n let helpMessage =\n `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` +\n `(${loc.line}:${loc.column + 1}):\\n\\n` +\n codeFrame;\n const pluginInfo = pluginNameMap[missingPluginName];\n if (pluginInfo) {\n const { syntax: syntaxPlugin, transform: transformPlugin } = pluginInfo;\n if (syntaxPlugin) {\n const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);\n if (transformPlugin) {\n const transformPluginInfo = getNameURLCombination(transformPlugin);\n const sectionType = transformPlugin.name.startsWith(\"@babel/plugin\")\n ? \"plugins\"\n : \"presets\";\n helpMessage += `\\n\\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation.\nIf you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`;\n } else {\n helpMessage +=\n `\\n\\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` +\n `to enable parsing.`;\n }\n }\n }\n\n const msgFilename =\n filename === \"unknown\" ? \"\" : filename;\n helpMessage += `\n\nIf you already added the plugin for this syntax to your config, it's possible that your config \\\nisn't being loaded.\nYou can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \\\nconfiguration:\n\\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} \nSee https://babeljs.io/docs/configuration#print-effective-configs for more info.\n`;\n return helpMessage;\n}\n"],"mappings":";;;;;;AAAA,MAAMA,aAGL,GAAG;EACFC,kBAAkB,EAAE;IAClBC,MAAM,EAAE;MACNC,IAAI,EAAE,2CAA2C;MACjDC,GAAG,EAAE;IACP;EACF,CAAC;EACDC,OAAO,EAAE;IACPH,MAAM,EAAE;MACNC,IAAI,EAAE,8BAA8B;MACpCC,GAAG,EAAE;IACP;EACF,CAAC;EACDE,UAAU,EAAE;IACVJ,MAAM,EAAE;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EA,MAAMmC,qBAAqB,GAAGA,CAAC;EAAEpC,IAAI;EAAEC;AAAmC,CAAC,KACzE,GAAGD,IAAI,KAAKC,GAAG,GAAG;AAWL,SAASoC,4BAA4BA,CAClDC,iBAAyB,EACzBC,GAGC,EACDC,SAAiB,EACjBC,QAAgB,EACR;EACR,IAAIC,WAAW,GACb,wCAAwCJ,iBAAiB,4BAA4B,GACrF,IAAIC,GAAG,CAACI,IAAI,IAAIJ,GAAG,CAACK,MAAM,GAAG,CAAC,QAAQ,GACtCJ,SAAS;EACX,MAAMK,UAAU,GAAGhD,aAAa,CAACyC,iBAAiB,CAAC;EACnD,IAAIO,UAAU,EAAE;IACd,MAAM;MAAE9C,MAAM,EAAE+C,YAAY;MAAE1C,SAAS,EAAE2C;IAAgB,CAAC,GAAGF,UAAU;IACvE,IAAIC,YAAY,EAAE;MAChB,MAAME,gBAAgB,GAAGZ,qBAAqB,CAACU,YAAY,CAAC;MAC5D,IAAIC,eAAe,EAAE;QACnB,MAAME,mBAAmB,GAAGb,qBAAqB,CAACW,eAAe,CAAC;QAClE,MAAMG,WAAW,GAAGH,eAAe,CAAC/C,IAAI,CAACmD,UAAU,CAAC,eAAe,CAAC,GAChE,SAAS,GACT,SAAS;QACbT,WAAW,IAAI,WAAWO,mBAAmB,YAAYC,WAAW;AAC5E,qCAAqCF,gBAAgB,8CAA8C;MAC7F,CAAC,MAAM;QACLN,WAAW,IACT,WAAWM,gBAAgB,iDAAiD,GAC5E,oBAAoB;MACxB;IACF;EACF;EAEA,MAAMI,WAAW,GACfX,QAAQ,KAAK,SAAS,GAAG,0BAA0B,GAAGA,QAAQ;EAChEC,WAAW,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA,wCAAwCU,WAAW;AACnD;AACA,CAAC;EACC,OAAOV,WAAW;AACpB;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/tools/build-external-helpers.js b/node_modules/@babel/core/lib/tools/build-external-helpers.js new file mode 100644 index 0000000..88c90dc --- /dev/null +++ b/node_modules/@babel/core/lib/tools/build-external-helpers.js @@ -0,0 +1,144 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +function helpers() { + const data = require("@babel/helpers"); + helpers = function () { + return data; + }; + return data; +} +function _generator() { + const data = require("@babel/generator"); + _generator = function () { + return data; + }; + return data; +} +function _template() { + const data = require("@babel/template"); + _template = function () { + return data; + }; + return data; +} +function _t() { + const data = require("@babel/types"); + _t = function () { + return data; + }; + return data; +} +const { + arrayExpression, + assignmentExpression, + binaryExpression, + blockStatement, + callExpression, + cloneNode, + conditionalExpression, + exportNamedDeclaration, + exportSpecifier, + expressionStatement, + functionExpression, + identifier, + memberExpression, + objectExpression, + program, + stringLiteral, + unaryExpression, + variableDeclaration, + variableDeclarator +} = _t(); +const buildUmdWrapper = replacements => _template().default.statement` + (function (root, factory) { + if (typeof define === "function" && define.amd) { + define(AMD_ARGUMENTS, factory); + } else if (typeof exports === "object") { + factory(COMMON_ARGUMENTS); + } else { + factory(BROWSER_ARGUMENTS); + } + })(UMD_ROOT, function (FACTORY_PARAMETERS) { + FACTORY_BODY + }); + `(replacements); +function buildGlobal(allowlist) { + const namespace = identifier("babelHelpers"); + const body = []; + const container = functionExpression(null, [identifier("global")], blockStatement(body)); + const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]); + body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))])); + buildHelpers(body, namespace, allowlist); + return tree; +} +function buildModule(allowlist) { + const body = []; + const refs = buildHelpers(body, null, allowlist); + body.unshift(exportNamedDeclaration(null, Object.keys(refs).map(name => { + return exportSpecifier(cloneNode(refs[name]), identifier(name)); + }))); + return program(body, [], "module"); +} +function buildUmd(allowlist) { + const namespace = identifier("babelHelpers"); + const body = []; + body.push(variableDeclaration("var", [variableDeclarator(namespace, identifier("global"))])); + buildHelpers(body, namespace, allowlist); + return program([buildUmdWrapper({ + FACTORY_PARAMETERS: identifier("global"), + BROWSER_ARGUMENTS: assignmentExpression("=", memberExpression(identifier("root"), namespace), objectExpression([])), + COMMON_ARGUMENTS: identifier("exports"), + AMD_ARGUMENTS: arrayExpression([stringLiteral("exports")]), + FACTORY_BODY: body, + UMD_ROOT: identifier("this") + })]); +} +function buildVar(allowlist) { + const namespace = identifier("babelHelpers"); + const body = []; + body.push(variableDeclaration("var", [variableDeclarator(namespace, objectExpression([]))])); + const tree = program(body); + buildHelpers(body, namespace, allowlist); + body.push(expressionStatement(namespace)); + return tree; +} +function buildHelpers(body, namespace, allowlist) { + const getHelperReference = name => { + return namespace ? memberExpression(namespace, identifier(name)) : identifier(`_${name}`); + }; + const refs = {}; + helpers().list.forEach(function (name) { + if (allowlist && !allowlist.includes(name)) return; + const ref = refs[name] = getHelperReference(name); + const { + nodes + } = helpers().get(name, getHelperReference, namespace ? null : `_${name}`, [], namespace ? (ast, exportName, mapExportBindingAssignments) => { + mapExportBindingAssignments(node => assignmentExpression("=", ref, node)); + ast.body.push(expressionStatement(assignmentExpression("=", ref, identifier(exportName)))); + } : null); + body.push(...nodes); + }); + return refs; +} +function _default(allowlist, outputType = "global") { + let tree; + const build = { + global: buildGlobal, + module: buildModule, + umd: buildUmd, + var: buildVar + }[outputType]; + if (build) { + tree = build(allowlist); + } else { + throw new Error(`Unsupported output type ${outputType}`); + } + return (0, _generator().default)(tree).code; +} +0 && 0; + +//# sourceMappingURL=build-external-helpers.js.map diff --git a/node_modules/@babel/core/lib/tools/build-external-helpers.js.map b/node_modules/@babel/core/lib/tools/build-external-helpers.js.map new file mode 100644 index 0000000..56020e4 --- /dev/null +++ b/node_modules/@babel/core/lib/tools/build-external-helpers.js.map @@ -0,0 +1 @@ +{"version":3,"names":["helpers","data","require","_generator","_template","_t","arrayExpression","assignmentExpression","binaryExpression","blockStatement","callExpression","cloneNode","conditionalExpression","exportNamedDeclaration","exportSpecifier","expressionStatement","functionExpression","identifier","memberExpression","objectExpression","program","stringLiteral","unaryExpression","variableDeclaration","variableDeclarator","buildUmdWrapper","replacements","template","statement","buildGlobal","allowlist","namespace","body","container","tree","push","buildHelpers","buildModule","refs","unshift","Object","keys","map","name","buildUmd","FACTORY_PARAMETERS","BROWSER_ARGUMENTS","COMMON_ARGUMENTS","AMD_ARGUMENTS","FACTORY_BODY","UMD_ROOT","buildVar","getHelperReference","list","forEach","includes","ref","nodes","get","ast","exportName","mapExportBindingAssignments","node","_default","outputType","build","global","module","umd","var","Error","generator","code"],"sources":["../../src/tools/build-external-helpers.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport generator from \"@babel/generator\";\nimport template from \"@babel/template\";\nimport {\n arrayExpression,\n assignmentExpression,\n binaryExpression,\n blockStatement,\n callExpression,\n cloneNode,\n conditionalExpression,\n exportNamedDeclaration,\n exportSpecifier,\n expressionStatement,\n functionExpression,\n identifier,\n memberExpression,\n objectExpression,\n program,\n stringLiteral,\n unaryExpression,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { Replacements } from \"@babel/template\";\n\n// Wrapped to avoid wasting time parsing this when almost no-one uses\n// build-external-helpers.\nconst buildUmdWrapper = (replacements: Replacements) =>\n template.statement`\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n `(replacements);\n\nfunction buildGlobal(allowlist?: Array) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n const container = functionExpression(\n null,\n [identifier(\"global\")],\n blockStatement(body),\n );\n const tree = program([\n expressionStatement(\n callExpression(container, [\n // typeof global === \"undefined\" ? self : global\n conditionalExpression(\n binaryExpression(\n \"===\",\n unaryExpression(\"typeof\", identifier(\"global\")),\n stringLiteral(\"undefined\"),\n ),\n identifier(\"self\"),\n identifier(\"global\"),\n ),\n ]),\n ),\n ]);\n\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(\n namespace,\n assignmentExpression(\n \"=\",\n memberExpression(identifier(\"global\"), namespace),\n objectExpression([]),\n ),\n ),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return tree;\n}\n\nfunction buildModule(allowlist?: Array) {\n const body: t.Statement[] = [];\n const refs = buildHelpers(body, null, allowlist);\n\n body.unshift(\n exportNamedDeclaration(\n null,\n Object.keys(refs).map(name => {\n return exportSpecifier(cloneNode(refs[name]), identifier(name));\n }),\n ),\n );\n\n return program(body, [], \"module\");\n}\n\nfunction buildUmd(allowlist?: Array) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, identifier(\"global\")),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return program([\n buildUmdWrapper({\n FACTORY_PARAMETERS: identifier(\"global\"),\n BROWSER_ARGUMENTS: assignmentExpression(\n \"=\",\n memberExpression(identifier(\"root\"), namespace),\n objectExpression([]),\n ),\n COMMON_ARGUMENTS: identifier(\"exports\"),\n AMD_ARGUMENTS: arrayExpression([stringLiteral(\"exports\")]),\n FACTORY_BODY: body,\n UMD_ROOT: identifier(\"this\"),\n }),\n ]);\n}\n\nfunction buildVar(allowlist?: Array) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, objectExpression([])),\n ]),\n );\n const tree = program(body);\n buildHelpers(body, namespace, allowlist);\n body.push(expressionStatement(namespace));\n return tree;\n}\n\nfunction buildHelpers(\n body: t.Statement[],\n namespace: t.Expression,\n allowlist?: Array,\n): Record;\nfunction buildHelpers(\n body: t.Statement[],\n namespace: null,\n allowlist?: Array,\n): Record;\n\nfunction buildHelpers(\n body: t.Statement[],\n namespace: t.Expression | null,\n allowlist?: Array,\n) {\n const getHelperReference = (name: string) => {\n return namespace\n ? memberExpression(namespace, identifier(name))\n : identifier(`_${name}`);\n };\n\n const refs: { [key: string]: t.Identifier | t.MemberExpression } = {};\n helpers.list.forEach(function (name) {\n if (allowlist && !allowlist.includes(name)) return;\n\n const ref = (refs[name] = getHelperReference(name));\n\n const { nodes } = helpers.get(\n name,\n getHelperReference,\n namespace ? null : `_${name}`,\n [],\n namespace\n ? (ast, exportName, mapExportBindingAssignments) => {\n mapExportBindingAssignments(node =>\n assignmentExpression(\"=\", ref, node),\n );\n ast.body.push(\n expressionStatement(\n assignmentExpression(\"=\", ref, identifier(exportName)),\n ),\n );\n }\n : null,\n );\n\n body.push(...nodes);\n });\n return refs;\n}\nexport default function (\n allowlist?: Array,\n outputType: \"global\" | \"module\" | \"umd\" | \"var\" = \"global\",\n) {\n let tree: t.Program;\n\n const build = {\n global: buildGlobal,\n module: buildModule,\n umd: buildUmd,\n var: buildVar,\n }[outputType];\n\n if (build) {\n tree = build(allowlist);\n } else {\n throw new Error(`Unsupported output type ${outputType}`);\n }\n\n return generator(tree).code;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,GAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,EAAA,YAAAA,CAAA;IAAA,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AM;MAAEc;IAAM,CAAC,GAAGzD,OAAO,CAAD,CAAC,CAAC0D,GAAG,CAC3Bf,IAAI,EACJS,kBAAkB,EAClBrB,SAAS,GAAG,IAAI,GAAG,IAAIY,IAAI,EAAE,EAC7B,EAAE,EACFZ,SAAS,GACL,CAAC4B,GAAG,EAAEC,UAAU,EAAEC,2BAA2B,KAAK;MAChDA,2BAA2B,CAACC,IAAI,IAC9BvD,oBAAoB,CAAC,GAAG,EAAEiD,GAAG,EAAEM,IAAI,CACrC,CAAC;MACDH,GAAG,CAAC3B,IAAI,CAACG,IAAI,CACXpB,mBAAmB,CACjBR,oBAAoB,CAAC,GAAG,EAAEiD,GAAG,EAAEvC,UAAU,CAAC2C,UAAU,CAAC,CACvD,CACF,CAAC;IACH,CAAC,GACD,IACN,CAAC;IAED5B,IAAI,CAACG,IAAI,CAAC,GAAGsB,KAAK,CAAC;EACrB,CAAC,CAAC;EACF,OAAOnB,IAAI;AACb;AACe,SAAAyB,SACbjC,SAAyB,EACzBkC,UAA+C,GAAG,QAAQ,EAC1D;EACA,IAAI9B,IAAe;EAEnB,MAAM+B,KAAK,GAAG;IACZC,MAAM,EAAErC,WAAW;IACnBsC,MAAM,EAAE9B,WAAW;IACnB+B,GAAG,EAAExB,QAAQ;IACbyB,GAAG,EAAElB;EACP,CAAC,CAACa,UAAU,CAAC;EAEb,IAAIC,KAAK,EAAE;IACT/B,IAAI,GAAG+B,KAAK,CAACnC,SAAS,CAAC;EACzB,CAAC,MAAM;IACL,MAAM,IAAIwC,KAAK,CAAC,2BAA2BN,UAAU,EAAE,CAAC;EAC1D;EAEA,OAAO,IAAAO,oBAAS,EAACrC,IAAI,CAAC,CAACsC,IAAI;AAC7B;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transform-ast.js b/node_modules/@babel/core/lib/transform-ast.js new file mode 100644 index 0000000..0a86cd1 --- /dev/null +++ b/node_modules/@babel/core/lib/transform-ast.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformFromAst = void 0; +exports.transformFromAstAsync = transformFromAstAsync; +exports.transformFromAstSync = transformFromAstSync; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _index = require("./config/index.js"); +var _index2 = require("./transformation/index.js"); +var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js"); +const transformFromAstRunner = _gensync()(function* (ast, code, opts) { + const config = yield* (0, _index.default)(opts); + if (config === null) return null; + if (!ast) throw new Error("No AST given"); + return yield* (0, _index2.run)(config, code, ast); +}); +const transformFromAst = exports.transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) { + let opts; + let callback; + if (typeof optsOrCallback === "function") { + callback = optsOrCallback; + opts = undefined; + } else { + opts = optsOrCallback; + callback = maybeCallback; + } + if (callback === undefined) { + { + return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast, code, opts); + } + } + (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast, code, opts, callback); +}; +function transformFromAstSync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args); +} +function transformFromAstAsync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args); +} +0 && 0; + +//# sourceMappingURL=transform-ast.js.map diff --git a/node_modules/@babel/core/lib/transform-ast.js.map b/node_modules/@babel/core/lib/transform-ast.js.map new file mode 100644 index 0000000..ff14834 --- /dev/null +++ b/node_modules/@babel/core/lib/transform-ast.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_index","_index2","_rewriteStackTrace","transformFromAstRunner","gensync","ast","code","opts","config","loadConfig","Error","run","transformFromAst","exports","optsOrCallback","maybeCallback","callback","undefined","beginHiddenCallStack","sync","errback","transformFromAstSync","args","transformFromAstAsync","async"],"sources":["../src/transform-ast.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig from \"./config/index.ts\";\nimport type { InputOptions, ResolvedConfig } from \"./config/index.ts\";\nimport { run } from \"./transformation/index.ts\";\nimport type * as t from \"@babel/types\";\n\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\nimport type { FileResult, FileResultCallback } from \"./transformation/index.ts\";\ntype AstRoot = t.File | t.Program;\n\ntype TransformFromAst = {\n (ast: AstRoot, code: string, callback: FileResultCallback): void;\n (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileResultCallback,\n ): void;\n (ast: AstRoot, code: string, opts?: InputOptions | null): FileResult | null;\n};\n\nconst transformFromAstRunner = gensync(function* (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n): Handler {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n if (!ast) throw new Error(\"No AST given\");\n\n return yield* run(config, code, ast);\n});\n\nexport const transformFromAst: TransformFromAst = function transformFromAst(\n ast,\n code,\n optsOrCallback?: InputOptions | null | undefined | FileResultCallback,\n maybeCallback?: FileResultCallback,\n) {\n let opts: InputOptions | undefined | null;\n let callback: FileResultCallback | undefined;\n if (typeof optsOrCallback === \"function\") {\n callback = optsOrCallback;\n opts = undefined;\n } else {\n opts = optsOrCallback;\n callback = maybeCallback;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'transformFromAst' function expects a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'transformFromAst' function will expect a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n // );\n return beginHiddenCallStack(transformFromAstRunner.sync)(ast, code, opts);\n }\n }\n\n beginHiddenCallStack(transformFromAstRunner.errback)(\n ast,\n code,\n opts,\n callback,\n );\n};\n\nexport function transformFromAstSync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(transformFromAstRunner.sync)(...args);\n}\n\nexport function transformFromAstAsync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(transformFromAstRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAH,OAAA;AAgBA,MAAMI,sBAAsB,GAAGC,SAAMA,CAAC,CAAC,WACrCC,GAAY,EACZC,IAAY,EACZC,IAAqC,EACT;EAC5B,MAAMC,MAA6B,GAAG,OAAO,IAAAC,cAAU,EAACF,IAAI,CAAC;EAC7D,IAAIC,MAAM,KAAK,IAAI,EAAE,OAAO,IAAI;EAEhC,IAAI,CAACH,GAAG,EAAE,MAAM,IAAIK,KAAK,CAAC,cAAc,CAAC;EAEzC,OAAO,OAAO,IAAAC,WAAG,EAACH,MAAM,EAAEF,IAAI,EAAED,GAAG,CAAC;AACtC,CAAC,CAAC;AAEK,MAAMO,gBAAkC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAASA,gBAAgBA,CACzEP,GAAG,EACHC,IAAI,EACJQ,cAAqE,EACrEC,aAAkC,EAClC;EACA,IAAIR,IAAqC;EACzC,IAAIS,QAAwC;EAC5C,IAAI,OAAOF,cAAc,KAAK,UAAU,EAAE;IACxCE,QAAQ,GAAGF,cAAc;IACzBP,IAAI,GAAGU,SAAS;EAClB,CAAC,MAAM;IACLV,IAAI,GAAGO,cAAc;IACrBE,QAAQ,GAAGD,aAAa;EAC1B;EAEA,IAAIC,QAAQ,KAAKC,SAAS,EAAE;IAKnB;MAIL,OAAO,IAAAC,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAACd,GAAG,EAAEC,IAAI,EAAEC,IAAI,CAAC;IAC3E;EACF;EAEA,IAAAW,uCAAoB,EAACf,sBAAsB,CAACiB,OAAO,CAAC,CAClDf,GAAG,EACHC,IAAI,EACJC,IAAI,EACJS,QACF,CAAC;AACH,CAAC;AAEM,SAASK,oBAAoBA,CAClC,GAAGC,IAAoD,EACvD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAAC,GAAGG,IAAI,CAAC;AACnE;AAEO,SAASC,qBAAqBA,CACnC,GAAGD,IAAqD,EACxD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACqB,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACpE;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transform-file-browser.js b/node_modules/@babel/core/lib/transform-file-browser.js new file mode 100644 index 0000000..8576809 --- /dev/null +++ b/node_modules/@babel/core/lib/transform-file-browser.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformFile = void 0; +exports.transformFileAsync = transformFileAsync; +exports.transformFileSync = transformFileSync; +const transformFile = exports.transformFile = function transformFile(filename, opts, callback) { + if (typeof opts === "function") { + callback = opts; + } + callback(new Error("Transforming files is not supported in browsers"), null); +}; +function transformFileSync() { + throw new Error("Transforming files is not supported in browsers"); +} +function transformFileAsync() { + return Promise.reject(new Error("Transforming files is not supported in browsers")); +} +0 && 0; + +//# sourceMappingURL=transform-file-browser.js.map diff --git a/node_modules/@babel/core/lib/transform-file-browser.js.map b/node_modules/@babel/core/lib/transform-file-browser.js.map new file mode 100644 index 0000000..b632a42 --- /dev/null +++ b/node_modules/@babel/core/lib/transform-file-browser.js.map @@ -0,0 +1 @@ +{"version":3,"names":["transformFile","exports","filename","opts","callback","Error","transformFileSync","transformFileAsync","Promise","reject"],"sources":["../src/transform-file-browser.ts"],"sourcesContent":["/* c8 ignore start */\n\n// duplicated from transform-file so we do not have to import anything here\ntype TransformFile = {\n (filename: string, callback: (error: Error, file: null) => void): void;\n (\n filename: string,\n opts: any,\n callback: (error: Error, file: null) => void,\n ): void;\n};\n\nexport const transformFile: TransformFile = function transformFile(\n filename,\n opts,\n callback?: (error: Error, file: null) => void,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n }\n\n callback(new Error(\"Transforming files is not supported in browsers\"), null);\n};\n\nexport function transformFileSync(): never {\n throw new Error(\"Transforming files is not supported in browsers\");\n}\n\nexport function transformFileAsync() {\n return Promise.reject(\n new Error(\"Transforming files is not supported in browsers\"),\n );\n}\n"],"mappings":";;;;;;;;AAYO,MAAMA,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAASA,aAAaA,CAChEE,QAAQ,EACRC,IAAI,EACJC,QAA6C,EAC7C;EACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;IAC9BC,QAAQ,GAAGD,IAAI;EACjB;EAEAC,QAAQ,CAAC,IAAIC,KAAK,CAAC,iDAAiD,CAAC,EAAE,IAAI,CAAC;AAC9E,CAAC;AAEM,SAASC,iBAAiBA,CAAA,EAAU;EACzC,MAAM,IAAID,KAAK,CAAC,iDAAiD,CAAC;AACpE;AAEO,SAASE,kBAAkBA,CAAA,EAAG;EACnC,OAAOC,OAAO,CAACC,MAAM,CACnB,IAAIJ,KAAK,CAAC,iDAAiD,CAC7D,CAAC;AACH;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transform-file.js b/node_modules/@babel/core/lib/transform-file.js new file mode 100644 index 0000000..ce7f9f9 --- /dev/null +++ b/node_modules/@babel/core/lib/transform-file.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transformFile = transformFile; +exports.transformFileAsync = transformFileAsync; +exports.transformFileSync = transformFileSync; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _index = require("./config/index.js"); +var _index2 = require("./transformation/index.js"); +var fs = require("./gensync-utils/fs.js"); +({}); +const transformFileRunner = _gensync()(function* (filename, opts) { + const options = Object.assign({}, opts, { + filename + }); + const config = yield* (0, _index.default)(options); + if (config === null) return null; + const code = yield* fs.readFile(filename, "utf8"); + return yield* (0, _index2.run)(config, code); +}); +function transformFile(...args) { + transformFileRunner.errback(...args); +} +function transformFileSync(...args) { + return transformFileRunner.sync(...args); +} +function transformFileAsync(...args) { + return transformFileRunner.async(...args); +} +0 && 0; + +//# sourceMappingURL=transform-file.js.map diff --git a/node_modules/@babel/core/lib/transform-file.js.map b/node_modules/@babel/core/lib/transform-file.js.map new file mode 100644 index 0000000..aab7ce6 --- /dev/null +++ b/node_modules/@babel/core/lib/transform-file.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_index","_index2","fs","transformFileRunner","gensync","filename","opts","options","Object","assign","config","loadConfig","code","readFile","run","transformFile","args","errback","transformFileSync","sync","transformFileAsync","async"],"sources":["../src/transform-file.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig from \"./config/index.ts\";\nimport type { InputOptions, ResolvedConfig } from \"./config/index.ts\";\nimport { run } from \"./transformation/index.ts\";\nimport type { FileResult, FileResultCallback } from \"./transformation/index.ts\";\nimport * as fs from \"./gensync-utils/fs.ts\";\n\ntype transformFileBrowserType = typeof import(\"./transform-file-browser\");\ntype transformFileType = typeof import(\"./transform-file\");\n\n// Kind of gross, but essentially asserting that the exports of this module are the same as the\n// exports of transform-file-browser, since this file may be replaced at bundle time with\n// transform-file-browser.\n({}) as any as transformFileBrowserType as transformFileType;\n\nconst transformFileRunner = gensync(function* (\n filename: string,\n opts?: InputOptions,\n): Handler {\n const options = { ...opts, filename };\n\n const config: ResolvedConfig | null = yield* loadConfig(options);\n if (config === null) return null;\n\n const code = yield* fs.readFile(filename, \"utf8\");\n return yield* run(config, code);\n});\n\n// @ts-expect-error TS doesn't detect that this signature is compatible\nexport function transformFile(\n filename: string,\n callback: FileResultCallback,\n): void;\nexport function transformFile(\n filename: string,\n opts: InputOptions | undefined | null,\n callback: FileResultCallback,\n): void;\nexport function transformFile(\n ...args: Parameters\n) {\n transformFileRunner.errback(...args);\n}\n\nexport function transformFileSync(\n ...args: Parameters\n) {\n return transformFileRunner.sync(...args);\n}\nexport function transformFileAsync(\n ...args: Parameters\n) {\n return transformFileRunner.async(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,EAAA,GAAAH,OAAA;AAQA,CAAC,CAAC,CAAC;AAEH,MAAMI,mBAAmB,GAAGC,SAAMA,CAAC,CAAC,WAClCC,QAAgB,EAChBC,IAAmB,EACS;EAC5B,MAAMC,OAAO,GAAAC,MAAA,CAAAC,MAAA,KAAQH,IAAI;IAAED;EAAQ,EAAE;EAErC,MAAMK,MAA6B,GAAG,OAAO,IAAAC,cAAU,EAACJ,OAAO,CAAC;EAChE,IAAIG,MAAM,KAAK,IAAI,EAAE,OAAO,IAAI;EAEhC,MAAME,IAAI,GAAG,OAAOV,EAAE,CAACW,QAAQ,CAACR,QAAQ,EAAE,MAAM,CAAC;EACjD,OAAO,OAAO,IAAAS,WAAG,EAACJ,MAAM,EAAEE,IAAI,CAAC;AACjC,CAAC,CAAC;AAYK,SAASG,aAAaA,CAC3B,GAAGC,IAAoD,EACvD;EACAb,mBAAmB,CAACc,OAAO,CAAC,GAAGD,IAAI,CAAC;AACtC;AAEO,SAASE,iBAAiBA,CAC/B,GAAGF,IAAiD,EACpD;EACA,OAAOb,mBAAmB,CAACgB,IAAI,CAAC,GAAGH,IAAI,CAAC;AAC1C;AACO,SAASI,kBAAkBA,CAChC,GAAGJ,IAAkD,EACrD;EACA,OAAOb,mBAAmB,CAACkB,KAAK,CAAC,GAAGL,IAAI,CAAC;AAC3C;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transform.js b/node_modules/@babel/core/lib/transform.js new file mode 100644 index 0000000..be55705 --- /dev/null +++ b/node_modules/@babel/core/lib/transform.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.transform = void 0; +exports.transformAsync = transformAsync; +exports.transformSync = transformSync; +function _gensync() { + const data = require("gensync"); + _gensync = function () { + return data; + }; + return data; +} +var _index = require("./config/index.js"); +var _index2 = require("./transformation/index.js"); +var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js"); +const transformRunner = _gensync()(function* transform(code, opts) { + const config = yield* (0, _index.default)(opts); + if (config === null) return null; + return yield* (0, _index2.run)(config, code); +}); +const transform = exports.transform = function transform(code, optsOrCallback, maybeCallback) { + let opts; + let callback; + if (typeof optsOrCallback === "function") { + callback = optsOrCallback; + opts = undefined; + } else { + opts = optsOrCallback; + callback = maybeCallback; + } + if (callback === undefined) { + { + return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(code, opts); + } + } + (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.errback)(code, opts, callback); +}; +function transformSync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(...args); +} +function transformAsync(...args) { + return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.async)(...args); +} +0 && 0; + +//# sourceMappingURL=transform.js.map diff --git a/node_modules/@babel/core/lib/transform.js.map b/node_modules/@babel/core/lib/transform.js.map new file mode 100644 index 0000000..3a7832a --- /dev/null +++ b/node_modules/@babel/core/lib/transform.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_gensync","data","require","_index","_index2","_rewriteStackTrace","transformRunner","gensync","transform","code","opts","config","loadConfig","run","exports","optsOrCallback","maybeCallback","callback","undefined","beginHiddenCallStack","sync","errback","transformSync","args","transformAsync","async"],"sources":["../src/transform.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig from \"./config/index.ts\";\nimport type { InputOptions, ResolvedConfig } from \"./config/index.ts\";\nimport { run } from \"./transformation/index.ts\";\n\nimport type { FileResult, FileResultCallback } from \"./transformation/index.ts\";\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\nexport type { FileResult } from \"./transformation/index.ts\";\n\ntype Transform = {\n (code: string, callback: FileResultCallback): void;\n (\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileResultCallback,\n ): void;\n (code: string, opts?: InputOptions | null): FileResult | null;\n};\n\nconst transformRunner = gensync(function* transform(\n code: string,\n opts?: InputOptions,\n): Handler {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n return yield* run(config, code);\n});\n\nexport const transform: Transform = function transform(\n code,\n optsOrCallback?: InputOptions | null | undefined | FileResultCallback,\n maybeCallback?: FileResultCallback,\n) {\n let opts: InputOptions | undefined | null;\n let callback: FileResultCallback | undefined;\n if (typeof optsOrCallback === \"function\") {\n callback = optsOrCallback;\n opts = undefined;\n } else {\n opts = optsOrCallback;\n callback = maybeCallback;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'transform' function expects a callback. If you need to call it synchronously, please use 'transformSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'transform' function will expect a callback. If you need to call it synchronously, please use 'transformSync'.\",\n // );\n return beginHiddenCallStack(transformRunner.sync)(code, opts);\n }\n }\n\n beginHiddenCallStack(transformRunner.errback)(code, opts, callback);\n};\n\nexport function transformSync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(transformRunner.sync)(...args);\n}\nexport function transformAsync(\n ...args: Parameters\n) {\n return beginHiddenCallStack(transformRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IA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GAAGF,IAAI,CAAC;AAC7D;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js b/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js new file mode 100644 index 0000000..ec22ee3 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = loadBlockHoistPlugin; +function _traverse() { + const data = require("@babel/traverse"); + _traverse = function () { + return data; + }; + return data; +} +var _plugin = require("../config/plugin.js"); +let LOADED_PLUGIN; +const blockHoistPlugin = { + name: "internal.blockHoist", + visitor: { + Block: { + exit({ + node + }) { + node.body = performHoisting(node.body); + } + }, + SwitchCase: { + exit({ + node + }) { + node.consequent = performHoisting(node.consequent); + } + } + } +}; +function performHoisting(body) { + let max = Math.pow(2, 30) - 1; + let hasChange = false; + for (let i = 0; i < body.length; i++) { + const n = body[i]; + const p = priority(n); + if (p > max) { + hasChange = true; + break; + } + max = p; + } + if (!hasChange) return body; + return stableSort(body.slice()); +} +function loadBlockHoistPlugin() { + if (!LOADED_PLUGIN) { + LOADED_PLUGIN = new _plugin.default(Object.assign({}, blockHoistPlugin, { + visitor: _traverse().default.explode(blockHoistPlugin.visitor) + }), {}); + } + return LOADED_PLUGIN; +} +function priority(bodyNode) { + const priority = bodyNode == null ? void 0 : bodyNode._blockHoist; + if (priority == null) return 1; + if (priority === true) return 2; + return priority; +} +function stableSort(body) { + const buckets = Object.create(null); + for (let i = 0; i < body.length; i++) { + const n = body[i]; + const p = priority(n); + const bucket = buckets[p] || (buckets[p] = []); + bucket.push(n); + } + const keys = Object.keys(buckets).map(k => +k).sort((a, b) => b - a); + let index = 0; + for (const key of keys) { + const bucket = buckets[key]; + for (const n of bucket) { + body[index++] = n; + } + } + return body; +} +0 && 0; + +//# sourceMappingURL=block-hoist-plugin.js.map diff --git a/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js.map b/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js.map new file mode 100644 index 0000000..028e36a --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_traverse","data","require","_plugin","LOADED_PLUGIN","blockHoistPlugin","name","visitor","Block","exit","node","body","performHoisting","SwitchCase","consequent","max","Math","pow","hasChange","i","length","n","p","priority","stableSort","slice","loadBlockHoistPlugin","Plugin","Object","assign","traverse","explode","bodyNode","_blockHoist","buckets","create","bucket","push","keys","map","k","sort","a","b","index","key"],"sources":["../../src/transformation/block-hoist-plugin.ts"],"sourcesContent":["import traverse from \"@babel/traverse\";\nimport type { Statement } from \"@babel/types\";\nimport type { PluginObject } from \"../config/index.ts\";\nimport Plugin from \"../config/plugin.ts\";\n\nlet LOADED_PLUGIN: Plugin | void;\n\nconst blockHoistPlugin: PluginObject = {\n /**\n * [Please add a description.]\n *\n * Priority:\n *\n * - 0 We want this to be at the **very** bottom\n * - 1 Default node position\n * - 2 Priority over normal nodes\n * - 3 We want this to be at the **very** top\n * - 4 Reserved for the helpers used to implement module imports.\n */\n\n name: \"internal.blockHoist\",\n\n visitor: {\n Block: {\n exit({ node }) {\n node.body = performHoisting(node.body);\n },\n },\n SwitchCase: {\n exit({ node }) {\n // In case statements, hoisting is difficult to perform correctly due to\n // functions that are declared and referenced in different blocks.\n // Nevertheless, hoisting the statements *inside* of each case should at\n // least mitigate the failure cases.\n node.consequent = performHoisting(node.consequent);\n },\n },\n },\n};\n\nfunction performHoisting(body: Statement[]): Statement[] {\n // Largest SMI\n let max = 2 ** 30 - 1;\n let hasChange = false;\n for (let i = 0; i < body.length; i++) {\n const n = body[i];\n const p = priority(n);\n if (p > max) {\n hasChange = true;\n break;\n }\n max = p;\n }\n if (!hasChange) return body;\n\n // My kingdom for a stable sort!\n return stableSort(body.slice());\n}\n\nexport default function loadBlockHoistPlugin(): Plugin {\n if (!LOADED_PLUGIN) {\n // cache the loaded blockHoist plugin plugin\n LOADED_PLUGIN = new Plugin(\n {\n ...blockHoistPlugin,\n visitor: traverse.explode(blockHoistPlugin.visitor),\n },\n {},\n );\n }\n\n return LOADED_PLUGIN;\n}\n\nfunction priority(bodyNode: Statement & { _blockHoist?: number | true }) {\n const priority = bodyNode?._blockHoist;\n if (priority == null) return 1;\n if (priority === true) return 2;\n return priority;\n}\n\nfunction stableSort(body: Statement[]) {\n // By default, we use priorities of 0-4.\n const buckets = Object.create(null);\n\n // By collecting into buckets, we can guarantee a stable sort.\n for (let i = 0; i < body.length; i++) {\n const n = body[i];\n const p = priority(n);\n\n // In case some plugin is setting an unexpected priority.\n const bucket = buckets[p] || (buckets[p] = []);\n bucket.push(n);\n }\n\n // Sort our keys in descending order. Keys are unique, so we don't have to\n // worry about stability.\n const keys = Object.keys(buckets)\n .map(k => +k)\n .sort((a, b) => b - a);\n\n let index = 0;\n for (const key of keys) {\n const bucket = buckets[key];\n for (const n of bucket) {\n body[index++] = n;\n }\n }\n return body;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,IAAAE,OAAA,GAAAD,OAAA;AAEA,IAAIE,aAA4B;AAEhC,MAAMC,gBAA8B,GAAG;EAarCC,IAAI,EAAE,qBAAqB;EAE3BC,OAAO,EAAE;IACPC,KAAK,EAAE;MACLC,IAAIA,CAAC;QAAEC;MAAK,CAAC,EAAE;QACbA,IAAI,CAACC,IAAI,GAAGC,eAAe,CAACF,IAAI,CAACC,IAAI,CAAC;MACxC;IACF,CAAC;IACDE,UAAU,EAAE;MACVJ,IAAIA,CAAC;QAAEC;MAAK,CAAC,EAAE;QAKbA,IAAI,CAACI,UAAU,GAAGF,eAAe,CAACF,IAAI,CAACI,UAAU,CAAC;MACpD;IACF;EACF;AACF,CAAC;AAED,SAASF,eAAeA,CAACD,IAA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EAAE,EAAE;IACpC,MAAME,CAAC,GAAGV,IAAI,CAACQ,CAAC,CAAC;IACjB,MAAMG,CAAC,GAAGC,QAAQ,CAACF,CAAC,CAAC;IAGrB,MAAMe,MAAM,GAAGF,OAAO,CAACZ,CAAC,CAAC,KAAKY,OAAO,CAACZ,CAAC,CAAC,GAAG,EAAE,CAAC;IAC9Cc,MAAM,CAACC,IAAI,CAAChB,CAAC,CAAC;EAChB;EAIA,MAAMiB,IAAI,GAAGV,MAAM,CAACU,IAAI,CAACJ,OAAO,CAAC,CAC9BK,GAAG,CAACC,CAAC,IAAI,CAACA,CAAC,CAAC,CACZC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKA,CAAC,GAAGD,CAAC,CAAC;EAExB,IAAIE,KAAK,GAAG,CAAC;EACb,KAAK,MAAMC,GAAG,IAAIP,IAAI,EAAE;IACtB,MAAMF,MAAM,GAAGF,OAAO,CAACW,GAAG,CAAC;IAC3B,KAAK,MAAMxB,CAAC,IAAIe,MAAM,EAAE;MACtBzB,IAAI,CAACiC,KAAK,EAAE,CAAC,GAAGvB,CAAC;IACnB;EACF;EACA,OAAOV,IAAI;AACb;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs b/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs new file mode 100644 index 0000000..e606e55 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs @@ -0,0 +1,6 @@ +{ + exports.getModuleName = () => require("@babel/helper-module-transforms").getModuleName; +} +0 && 0; + +//# sourceMappingURL=babel-7-helpers.cjs.map diff --git a/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs.map b/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs.map new file mode 100644 index 0000000..d27a70c --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs.map @@ -0,0 +1 @@ +{"version":3,"names":["exports","getModuleName","require"],"sources":["../../../src/transformation/file/babel-7-helpers.cjs"],"sourcesContent":["// TODO(Babel 8): Remove this file\n\nif (!process.env.BABEL_8_BREAKING) {\n exports.getModuleName = () =>\n require(\"@babel/helper-module-transforms\").getModuleName;\n} else if (process.env.IS_PUBLISH) {\n throw new Error(\n \"Internal Babel error: This file should only be loaded in Babel 7\",\n );\n}\n"],"mappings":"AAEmC;EACjCA,OAAO,CAACC,aAAa,GAAG,MACtBC,OAAO,CAAC,iCAAiC,CAAC,CAACD,aAAa;AAC5D;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/file/file.js b/node_modules/@babel/core/lib/transformation/file/file.js new file mode 100644 index 0000000..60a7c32 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/file.js @@ -0,0 +1,212 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +function helpers() { + const data = require("@babel/helpers"); + helpers = function () { + return data; + }; + return data; +} +function _traverse() { + const data = require("@babel/traverse"); + _traverse = function () { + return data; + }; + return data; +} +function _codeFrame() { + const data = require("@babel/code-frame"); + _codeFrame = function () { + return data; + }; + return data; +} +function _t() { + const data = require("@babel/types"); + _t = function () { + return data; + }; + return data; +} +function _semver() { + const data = require("semver"); + _semver = function () { + return data; + }; + return data; +} +var _babel7Helpers = require("./babel-7-helpers.cjs"); +const { + cloneNode, + interpreterDirective, + traverseFast +} = _t(); +class File { + constructor(options, { + code, + ast, + inputMap + }) { + this._map = new Map(); + this.opts = void 0; + this.declarations = {}; + this.path = void 0; + this.ast = void 0; + this.scope = void 0; + this.metadata = {}; + this.code = ""; + this.inputMap = void 0; + this.hub = { + file: this, + getCode: () => this.code, + getScope: () => this.scope, + addHelper: this.addHelper.bind(this), + buildError: this.buildCodeFrameError.bind(this) + }; + this.opts = options; + this.code = code; + this.ast = ast; + this.inputMap = inputMap; + this.path = _traverse().NodePath.get({ + hub: this.hub, + parentPath: null, + parent: this.ast, + container: this.ast, + key: "program" + }).setContext(); + this.scope = this.path.scope; + } + get shebang() { + const { + interpreter + } = this.path.node; + return interpreter ? interpreter.value : ""; + } + set shebang(value) { + if (value) { + this.path.get("interpreter").replaceWith(interpreterDirective(value)); + } else { + this.path.get("interpreter").remove(); + } + } + set(key, val) { + { + if (key === "helpersNamespace") { + throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'."); + } + } + this._map.set(key, val); + } + get(key) { + return this._map.get(key); + } + has(key) { + return this._map.has(key); + } + availableHelper(name, versionRange) { + if (helpers().isInternal(name)) return false; + let minVersion; + try { + minVersion = helpers().minVersion(name); + } catch (err) { + if (err.code !== "BABEL_HELPER_UNKNOWN") throw err; + return false; + } + if (typeof versionRange !== "string") return true; + if (_semver().valid(versionRange)) versionRange = `^${versionRange}`; + { + return !_semver().intersects(`<${minVersion}`, versionRange) && !_semver().intersects(`>=8.0.0`, versionRange); + } + } + addHelper(name) { + if (helpers().isInternal(name)) { + throw new Error("Cannot use internal helper " + name); + } + return this._addHelper(name); + } + _addHelper(name) { + const declar = this.declarations[name]; + if (declar) return cloneNode(declar); + const generator = this.get("helperGenerator"); + if (generator) { + const res = generator(name); + if (res) return res; + } + helpers().minVersion(name); + const uid = this.declarations[name] = this.scope.generateUidIdentifier(name); + const dependencies = {}; + for (const dep of helpers().getDependencies(name)) { + dependencies[dep] = this._addHelper(dep); + } + const { + nodes, + globals + } = helpers().get(name, dep => dependencies[dep], uid.name, Object.keys(this.scope.getAllBindings())); + globals.forEach(name => { + if (this.path.scope.hasBinding(name, true)) { + this.path.scope.rename(name); + } + }); + nodes.forEach(node => { + node._compact = true; + }); + const added = this.path.unshiftContainer("body", nodes); + for (const path of added) { + if (path.isVariableDeclaration()) this.scope.registerDeclaration(path); + } + return uid; + } + buildCodeFrameError(node, msg, _Error = SyntaxError) { + let loc = node == null ? void 0 : node.loc; + if (!loc && node) { + traverseFast(node, function (node) { + if (node.loc) { + loc = node.loc; + return traverseFast.stop; + } + }); + let txt = "This is an error on an internal node. Probably an internal error."; + if (loc) txt += " Location has been estimated."; + msg += ` (${txt})`; + } + if (loc) { + const { + highlightCode = true + } = this.opts; + msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, { + start: { + line: loc.start.line, + column: loc.start.column + 1 + }, + end: loc.end && loc.start.line === loc.end.line ? { + line: loc.end.line, + column: loc.end.column + 1 + } : undefined + }, { + highlightCode + }); + } + return new _Error(msg); + } +} +exports.default = File; +{ + File.prototype.addImport = function addImport() { + throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'."); + }; + File.prototype.addTemplateObject = function addTemplateObject() { + throw new Error("This function has been moved into the template literal transform itself."); + }; + { + File.prototype.getModuleName = function getModuleName() { + return _babel7Helpers.getModuleName()(this.opts, this.opts); + }; + } +} +0 && 0; + +//# sourceMappingURL=file.js.map diff --git a/node_modules/@babel/core/lib/transformation/file/file.js.map b/node_modules/@babel/core/lib/transformation/file/file.js.map new file mode 100644 index 0000000..69b718a --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/file.js.map @@ -0,0 +1 @@ +{"version":3,"names":["helpers","data","require","_traverse","_codeFrame","_t","_semver","_babel7Helpers","cloneNode","interpreterDirective","traverseFast","File","constructor","options","code","ast","inputMap","_map","Map","opts","declarations","path","scope","metadata","hub","file","getCode","getScope","addHelper","bind","buildError","buildCodeFrameError","NodePath","get","parentPath","parent","container","key","setContext","shebang","interpreter","node","value","replaceWith","remove","set","val","Error","has","availableHelper","name","versionRange","isInternal","minVersion","err","semver","valid","intersects","_addHelper","declar","generator","res","uid","generateUidIdentifier","dependencies","dep","getDependencies","nodes","globals","Object","keys","getAllBindings","forEach","hasBinding","rename","_compact","added","unshiftContainer","isVariableDeclaration","registerDeclaration","msg","_Error","SyntaxError","loc","stop","txt","highlightCode","codeFrameColumns","start","line","column","end","undefined","exports","default","prototype","addImport","addTemplateObject","getModuleName","babel7"],"sources":["../../../src/transformation/file/file.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport { NodePath } from \"@babel/traverse\";\nimport type { HubInterface, Scope } from \"@babel/traverse\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport { cloneNode, interpreterDirective, traverseFast } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport semver from \"semver\";\n\nimport type { NormalizedFile } from \"../normalize-file.ts\";\n\n// @ts-expect-error This file is `any`\nimport babel7 from \"./babel-7-helpers.cjs\" with { if: \"!process.env.BABEL_8_BREAKING && (!USE_ESM || IS_STANDALONE)\" };\nimport type { ResolvedOptions } from \"../../config/validation/options.ts\";\nimport type { SourceMapConverter } from \"convert-source-map\";\n\nexport default class File {\n _map: Map = new Map();\n opts: ResolvedOptions;\n declarations: Record = {};\n path: NodePath;\n ast: t.File;\n scope: Scope;\n metadata: Record = {};\n code: string = \"\";\n inputMap: SourceMapConverter;\n\n hub: HubInterface & { file: File } = {\n // keep it for the usage in babel-core, ex: path.hub.file.opts.filename\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this),\n };\n\n constructor(\n options: ResolvedOptions,\n { code, ast, inputMap }: NormalizedFile,\n ) {\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n\n this.path = NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\",\n }).setContext() as NodePath;\n this.scope = this.path.scope;\n }\n\n /**\n * Provide backward-compatible access to the interpreter directive handling\n * in Babel 6.x. If you are writing a plugin for Babel 7.x, it would be\n * best to use 'program.interpreter' directly.\n */\n get shebang(): string {\n const { interpreter } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n set shebang(value: string) {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key: unknown, val: unknown) {\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"helpersNamespace\") {\n throw new Error(\n \"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" +\n \"If you are using @babel/plugin-external-helpers you will need to use a newer \" +\n \"version than the one you currently have installed. \" +\n \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" +\n \"alongside 'file.availableHelper()'.\",\n );\n }\n }\n\n this._map.set(key, val);\n }\n\n get(key: unknown): any {\n return this._map.get(key);\n }\n\n has(key: unknown): boolean {\n return this._map.has(key);\n }\n\n /**\n * Check if a given helper is available in @babel/core's helper list.\n *\n * This _also_ allows you to pass a Babel version specifically. If the\n * helper exists, but was not available for the full given range, it will be\n * considered unavailable.\n */\n availableHelper(name: string, versionRange?: string | null): boolean {\n if (helpers.isInternal(name)) return false;\n\n let minVersion;\n try {\n minVersion = helpers.minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with pre-release versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revisit the logic in\n // transform-runtime's definitions.js file.\n if (semver.valid(versionRange)) versionRange = `^${versionRange}`;\n\n if (process.env.BABEL_8_BREAKING) {\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=9.0.0`, versionRange)\n );\n } else {\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=8.0.0`, versionRange)\n );\n }\n }\n\n addHelper(name: string): t.Identifier {\n if (helpers.isInternal(name)) {\n throw new Error(\"Cannot use internal helper \" + name);\n }\n return this._addHelper(name);\n }\n\n _addHelper(name: string): t.Identifier {\n const declar = this.declarations[name];\n if (declar) return cloneNode(declar);\n\n const generator = this.get(\"helperGenerator\");\n if (generator) {\n const res = generator(name);\n if (res) return res;\n }\n\n // make sure that the helper exists\n helpers.minVersion(name);\n\n const uid = (this.declarations[name] =\n this.scope.generateUidIdentifier(name));\n\n const dependencies: { [key: string]: t.Identifier } = {};\n for (const dep of helpers.getDependencies(name)) {\n dependencies[dep] = this._addHelper(dep);\n }\n\n const { nodes, globals } = helpers.get(\n name,\n dep => dependencies[dep],\n uid.name,\n Object.keys(this.scope.getAllBindings()),\n );\n\n globals.forEach(name => {\n if (this.path.scope.hasBinding(name, true /* noGlobals */)) {\n this.path.scope.rename(name);\n }\n });\n\n nodes.forEach(node => {\n // @ts-expect-error Fixme: document _compact node property\n node._compact = true;\n });\n\n const added = this.path.unshiftContainer(\"body\", nodes);\n // TODO: NodePath#unshiftContainer should automatically register new\n // bindings.\n for (const path of added) {\n if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);\n }\n\n return uid;\n }\n\n buildCodeFrameError(\n node: t.Node | undefined | null,\n msg: string,\n _Error: typeof Error = SyntaxError,\n ): Error {\n let loc = node?.loc;\n\n if (!loc && node) {\n traverseFast(node, function (node) {\n if (node.loc) {\n loc = node.loc;\n return traverseFast.stop;\n }\n });\n\n let txt =\n \"This is an error on an internal node. Probably an internal error.\";\n if (loc) txt += \" Location has been estimated.\";\n\n msg += ` (${txt})`;\n }\n\n if (loc) {\n const { highlightCode = true } = this.opts;\n\n msg +=\n \"\\n\" +\n codeFrameColumns(\n this.code,\n {\n start: {\n line: loc.start.line,\n column: loc.start.column + 1,\n },\n end:\n loc.end && loc.start.line === loc.end.line\n ? {\n line: loc.end.line,\n column: loc.end.column + 1,\n }\n : undefined,\n },\n { highlightCode },\n );\n }\n\n return new _Error(msg);\n }\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // @ts-expect-error Babel 7\n File.prototype.addImport = function addImport() {\n throw new Error(\n \"This API has been removed. If you're looking for this \" +\n \"functionality in Babel 7, you should import the \" +\n \"'@babel/helper-module-imports' module and use the functions exposed \" +\n \" from that module, such as 'addNamed' or 'addDefault'.\",\n );\n };\n // @ts-expect-error Babel 7\n File.prototype.addTemplateObject = function addTemplateObject() {\n throw new Error(\n \"This function has been moved into the template literal transform itself.\",\n );\n };\n\n if (!USE_ESM || IS_STANDALONE) {\n // @ts-expect-error Babel 7\n File.prototype.getModuleName = function getModuleName() {\n return babel7.getModuleName()(this.opts, this.opts);\n };\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,GAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,EAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,IAAAM,cAAA,GAAAL,OAAA;AAAuH;EAP9GM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C;EACH,CAAC;EAE8B;IAE7BpC,IAAI,CAACoF,SAAS,CAACG,aAAa,GAAG,SAASA,aAAaA,CAAA,EAAG;MACtD,OAAOC,cAAM,CAACD,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC/E,IAAI,EAAE,IAAI,CAACA,IAAI,CAAC;IACrD,CAAC;EACH;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/file/generate.js b/node_modules/@babel/core/lib/transformation/file/generate.js new file mode 100644 index 0000000..10b5b29 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/generate.js @@ -0,0 +1,84 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = generateCode; +function _convertSourceMap() { + const data = require("convert-source-map"); + _convertSourceMap = function () { + return data; + }; + return data; +} +function _generator() { + const data = require("@babel/generator"); + _generator = function () { + return data; + }; + return data; +} +var _mergeMap = require("./merge-map.js"); +function generateCode(pluginPasses, file) { + const { + opts, + ast, + code, + inputMap + } = file; + const { + generatorOpts + } = opts; + generatorOpts.inputSourceMap = inputMap == null ? void 0 : inputMap.toObject(); + const results = []; + for (const plugins of pluginPasses) { + for (const plugin of plugins) { + const { + generatorOverride + } = plugin; + if (generatorOverride) { + const result = generatorOverride(ast, generatorOpts, code, _generator().default); + if (result !== undefined) results.push(result); + } + } + } + let result; + if (results.length === 0) { + result = (0, _generator().default)(ast, generatorOpts, code); + } else if (results.length === 1) { + result = results[0]; + if (typeof result.then === "function") { + throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`); + } + } else { + throw new Error("More than one plugin attempted to override codegen."); + } + let { + code: outputCode, + decodedMap: outputMap = result.map + } = result; + if (result.__mergedMap) { + outputMap = Object.assign({}, result.map); + } else { + if (outputMap) { + if (inputMap) { + outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap, generatorOpts.sourceFileName); + } else { + outputMap = result.map; + } + } + } + if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { + outputCode += "\n" + _convertSourceMap().fromObject(outputMap).toComment(); + } + if (opts.sourceMaps === "inline") { + outputMap = null; + } + return { + outputCode, + outputMap + }; +} +0 && 0; + +//# sourceMappingURL=generate.js.map diff --git a/node_modules/@babel/core/lib/transformation/file/generate.js.map b/node_modules/@babel/core/lib/transformation/file/generate.js.map new file mode 100644 index 0000000..d857215 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/generate.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_convertSourceMap","data","require","_generator","_mergeMap","generateCode","pluginPasses","file","opts","ast","code","inputMap","generatorOpts","inputSourceMap","toObject","results","plugins","plugin","generatorOverride","result","generate","undefined","push","length","then","Error","outputCode","decodedMap","outputMap","map","__mergedMap","Object","assign","mergeSourceMap","sourceFileName","sourceMaps","convertSourceMap","fromObject","toComment"],"sources":["../../../src/transformation/file/generate.ts"],"sourcesContent":["import type { PluginPasses } from \"../../config/index.ts\";\nimport convertSourceMap from \"convert-source-map\";\nimport type { GeneratorResult } from \"@babel/generator\";\nimport generate from \"@babel/generator\";\n\nimport type File from \"./file.ts\";\nimport mergeSourceMap from \"./merge-map.ts\";\n\nexport default function generateCode(\n pluginPasses: PluginPasses,\n file: File,\n): {\n outputCode: string;\n outputMap: GeneratorResult[\"map\"] | null;\n} {\n const { opts, ast, code, inputMap } = file;\n const { generatorOpts } = opts;\n\n generatorOpts.inputSourceMap = inputMap?.toObject();\n\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { generatorOverride } = plugin;\n if (generatorOverride) {\n const result = generatorOverride(ast, generatorOpts, code, generate);\n\n if (result !== undefined) results.push(result);\n }\n }\n }\n\n let result;\n if (results.length === 0) {\n result = generate(ast, generatorOpts, code);\n } else if (results.length === 1) {\n result = results[0];\n\n // @ts-expect-error check if generatorOverride returned a promise\n if (typeof result.then === \"function\") {\n throw new Error(\n `You appear to be using an async codegen plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, ` +\n `you may need to upgrade your @babel/core version.`,\n );\n }\n } else {\n throw new Error(\"More than one plugin attempted to override codegen.\");\n }\n\n // Decoded maps are faster to merge, so we attempt to get use the decodedMap\n // first. But to preserve backwards compat with older Generator, we'll fall\n // back to the encoded map.\n let { code: outputCode, decodedMap: outputMap = result.map } = result;\n\n // @ts-expect-error For backwards compat.\n if (result.__mergedMap) {\n /**\n * @see mergeSourceMap\n */\n outputMap = { ...result.map };\n } else {\n if (outputMap) {\n if (inputMap) {\n // mergeSourceMap returns an encoded map\n outputMap = mergeSourceMap(\n inputMap.toObject(),\n outputMap,\n generatorOpts.sourceFileName,\n );\n } else {\n // We cannot output a decoded map, so retrieve the encoded form. Because\n // the decoded form is free, it's fine to prioritize decoded first.\n outputMap = result.map;\n }\n }\n }\n\n if (opts.sourceMaps === \"inline\" || opts.sourceMaps === \"both\") {\n outputCode += \"\\n\" + convertSourceMap.fromObject(outputMap).toComment();\n }\n\n if (opts.sourceMaps === \"inline\") {\n outputMap = null;\n }\n\n // @ts-expect-error outputMap must be an EncodedSourceMap or null\n return { outputCode, outputMap };\n}\n"],"mappings":";;;;;;AACA,SAAAA,kBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,iBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,IAAAG,SAAA,GAAAF,OAAA;AAEe,SAASG,YAAYA,CAClCC,YAA0B,EAC1BC,IAAU,EAIV;EACA,MAAM;IAAEC,IAAI;IAAEC,GAAG;IAAEC,IAAI;IAAEC;EAAS,CAAC,GAAGJ,IAAI;EAC1C,MAAM;IAAEK;EAAc,CAAC,GAAGJ,IAAI;EAE9BI,aAAa,CA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,IAAAK,iBAAc,EACxBtB,QAAQ,CAACG,QAAQ,CAAC,CAAC,EACnBc,SAAS,EACThB,aAAa,CAACsB,cAChB,CAAC;MACH,CAAC,MAAM;QAGLN,SAAS,GAAGT,MAAM,CAACU,GAAG;MACxB;IACF;EACF;EAEA,IAAIrB,IAAI,CAAC2B,UAAU,KAAK,QAAQ,IAAI3B,IAAI,CAAC2B,UAAU,KAAK,MAAM,EAAE;IAC9DT,UAAU,IAAI,IAAI,GAAGU,kBAAeA,CAAC,CAACC,UAAU,CAACT,SAAS,CAAC,CAACU,SAAS,CAAC,CAAC;EACzE;EAEA,IAAI9B,IAAI,CAAC2B,UAAU,KAAK,QAAQ,EAAE;IAChCP,SAAS,GAAG,IAAI;EAClB;EAGA,OAAO;IAAEF,UAAU;IAAEE;EAAU,CAAC;AAClC;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/file/merge-map.js b/node_modules/@babel/core/lib/transformation/file/merge-map.js new file mode 100644 index 0000000..1b60d5c --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/merge-map.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mergeSourceMap; +function _remapping() { + const data = require("@jridgewell/remapping"); + _remapping = function () { + return data; + }; + return data; +} +function mergeSourceMap(inputMap, map, sourceFileName) { + const source = sourceFileName.replace(/\\/g, "/"); + let found = false; + const result = _remapping()(rootless(map), (s, ctx) => { + if (s === source && !found) { + found = true; + ctx.source = ""; + return rootless(inputMap); + } + return null; + }); + if (typeof inputMap.sourceRoot === "string") { + result.sourceRoot = inputMap.sourceRoot; + } + return Object.assign({}, result); +} +function rootless(map) { + return Object.assign({}, map, { + sourceRoot: null + }); +} +0 && 0; + +//# sourceMappingURL=merge-map.js.map diff --git a/node_modules/@babel/core/lib/transformation/file/merge-map.js.map b/node_modules/@babel/core/lib/transformation/file/merge-map.js.map new file mode 100644 index 0000000..5afc533 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/file/merge-map.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_remapping","data","require","mergeSourceMap","inputMap","map","sourceFileName","source","replace","found","result","remapping","rootless","s","ctx","sourceRoot","Object","assign"],"sources":["../../../src/transformation/file/merge-map.ts"],"sourcesContent":["type SourceMap = any;\nimport remapping from \"@jridgewell/remapping\";\n\nexport default function mergeSourceMap(\n inputMap: SourceMap,\n map: SourceMap,\n sourceFileName: string,\n): SourceMap {\n // On win32 machines, the sourceFileName uses backslash paths like\n // `C:\\foo\\bar.js`. But sourcemaps are always posix paths, so we need to\n // normalize to regular slashes before we can merge (else we won't find the\n // source associated with our input map).\n // This mirrors code done while generating the output map at\n // https://github.com/babel/babel/blob/5c2fcadc9ae34fd20dd72b1111d5cf50476d700d/packages/babel-generator/src/source-map.ts#L102\n const source = sourceFileName.replace(/\\\\/g, \"/\");\n\n // Prevent an infinite recursion if one of the input map's sources has the\n // same resolved path as the input map. In the case, it would keep find the\n // input map, then get it's sources which will include a path like the input\n // map, on and on.\n let found = false;\n const result = remapping(rootless(map), (s, ctx) => {\n if (s === source && !found) {\n found = true;\n // We empty the source location, which will prevent the sourcemap from\n // becoming relative to the input's location. Eg, if we're transforming a\n // file 'foo/bar.js', and it is a transformation of a `baz.js` file in the\n // same directory, the expected output is just `baz.js`. Without this step,\n // it would become `foo/baz.js`.\n ctx.source = \"\";\n\n return rootless(inputMap);\n }\n\n return null;\n });\n\n if (typeof inputMap.sourceRoot === \"string\") {\n result.sourceRoot = inputMap.sourceRoot;\n }\n\n // remapping returns a SourceMap class type, but this breaks code downstream in\n // @babel/traverse and @babel/types that relies on data being plain objects.\n // When it encounters the sourcemap type it outputs a \"don't know how to turn\n // this value into a node\" error. As a result, we are converting the merged\n // sourcemap to a plain js object.\n return { ...result };\n}\n\nfunction rootless(map: SourceMap): SourceMap {\n return {\n ...map,\n\n // This is a bit hack. Remapping will create absolute sources in our\n // sourcemap, but we want to maintain sources relative to the sourceRoot.\n // We'll re-add the sourceRoot after remapping.\n sourceRoot: null,\n };\n}\n"],"mappings":";;;;;;AACA,SAAAA,WAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,UAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEe,SAASE,cAAcA,CACpCC,QAAmB,EACnBC,GAAc,EACdC,cAAsB,EACX;EAOX,MAAMC,MAAM,GAAGD,cAAc,CAACE,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAMjD,IAAIC,KAAK,GAAG,KAAK;EACjB,MAAMC,MAAM,GAAGC,WAAQA,CAAC,CAACC,QAAQ,CAACP,GAAG,CAAC,EAAE,CAACQ,CAAC,EAAEC,GAAG,KAAK;IAClD,IAAID,CAAC,KAAKN,MAAM,IAAI,CAACE,KAAK,EAAE;MAC1BA,KAAK,GAAG,IAAI;MAMZK,GAAG,CAACP,MAAM,GAAG,EAAE;MAEf,OAAOK,QAAQ,CAACR,QAAQ,CAAC;IAC3B;IAEA,OAAO,IAAI;EACb,CAAC,CAAC;EAEF,IAAI,OAAOA,QAAQ,CAACW,UAAU,KAAK,QAAQ,EAAE;IAC3CL,MAAM,CAACK,UAAU,GAAGX,QAAQ,CAACW,UAAU;EACzC;EAOA,OAAAC,MAAA,CAAAC,MAAA,KAAYP,MAAM;AACpB;AAEA,SAASE,QAAQA,CAACP,GAAc,EAAa;EAC3C,OAAAW,MAAA,CAAAC,MAAA,KACKZ,GAAG;IAKNU,UAAU,EAAE;EAAI;AAEpB;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/index.js b/node_modules/@babel/core/lib/transformation/index.js new file mode 100644 index 0000000..7997e0a --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/index.js @@ -0,0 +1,92 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = run; +function _traverse() { + const data = require("@babel/traverse"); + _traverse = function () { + return data; + }; + return data; +} +var _pluginPass = require("./plugin-pass.js"); +var _blockHoistPlugin = require("./block-hoist-plugin.js"); +var _normalizeOpts = require("./normalize-opts.js"); +var _normalizeFile = require("./normalize-file.js"); +var _generate = require("./file/generate.js"); +var _deepArray = require("../config/helpers/deep-array.js"); +var _async = require("../gensync-utils/async.js"); +function* run(config, code, ast) { + const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast); + const opts = file.opts; + try { + yield* transformFile(file, config.passes); + } catch (e) { + var _opts$filename; + e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : "unknown file"}: ${e.message}`; + if (!e.code) { + e.code = "BABEL_TRANSFORM_ERROR"; + } + throw e; + } + let outputCode, outputMap; + try { + if (opts.code !== false) { + ({ + outputCode, + outputMap + } = (0, _generate.default)(config.passes, file)); + } + } catch (e) { + var _opts$filename2; + e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown file"}: ${e.message}`; + if (!e.code) { + e.code = "BABEL_GENERATE_ERROR"; + } + throw e; + } + return { + metadata: file.metadata, + options: opts, + ast: opts.ast === true ? file.ast : null, + code: outputCode === undefined ? null : outputCode, + map: outputMap === undefined ? null : outputMap, + sourceType: file.ast.program.sourceType, + externalDependencies: (0, _deepArray.flattenToSet)(config.externalDependencies) + }; +} +function* transformFile(file, pluginPasses) { + const async = yield* (0, _async.isAsync)(); + for (const pluginPairs of pluginPasses) { + const passPairs = []; + const passes = []; + const visitors = []; + for (const plugin of pluginPairs.concat([(0, _blockHoistPlugin.default)()])) { + const pass = new _pluginPass.default(file, plugin.key, plugin.options, async); + passPairs.push([plugin, pass]); + passes.push(pass); + visitors.push(plugin.visitor); + } + for (const [plugin, pass] of passPairs) { + if (plugin.pre) { + const fn = (0, _async.maybeAsync)(plugin.pre, `You appear to be using an async plugin/preset, but Babel has been called synchronously`); + yield* fn.call(pass, file); + } + } + const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod); + { + (0, _traverse().default)(file.ast, visitor, file.scope); + } + for (const [plugin, pass] of passPairs) { + if (plugin.post) { + const fn = (0, _async.maybeAsync)(plugin.post, `You appear to be using an async plugin/preset, but Babel has been called synchronously`); + yield* fn.call(pass, file); + } + } + } +} +0 && 0; + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/core/lib/transformation/index.js.map b/node_modules/@babel/core/lib/transformation/index.js.map new file mode 100644 index 0000000..6110529 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_traverse","data","require","_pluginPass","_blockHoistPlugin","_normalizeOpts","_normalizeFile","_generate","_deepArray","_async","run","config","code","ast","file","normalizeFile","passes","normalizeOptions","opts","transformFile","e","_opts$filename","message","filename","outputCode","outputMap","generateCode","_opts$filename2","metadata","options","undefined","map","sourceType","program","externalDependencies","flattenToSet","pluginPasses","async","isAsync","pluginPairs","passPairs","visitors","plugin","concat","loadBlockHoistPlugin","pass","PluginPass","key","push","visitor","pre","fn","maybeAsync","call","traverse","merge","wrapPluginVisitorMethod","scope","post"],"sources":["../../src/transformation/index.ts"],"sourcesContent":["import traverse from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\nimport type { GeneratorResult } from \"@babel/generator\";\n\nimport type { Handler } from \"gensync\";\n\nimport type { ResolvedConfig, Plugin, PluginPasses } from \"../config/index.ts\";\n\nimport PluginPass from \"./plugin-pass.ts\";\nimport loadBlockHoistPlugin from \"./block-hoist-plugin.ts\";\nimport normalizeOptions from \"./normalize-opts.ts\";\nimport normalizeFile from \"./normalize-file.ts\";\n\nimport generateCode from \"./file/generate.ts\";\nimport type File from \"./file/file.ts\";\n\nimport { flattenToSet } from \"../config/helpers/deep-array.ts\";\nimport { isAsync, maybeAsync } from \"../gensync-utils/async.ts\";\nimport type { SourceTypeOption } from \"../config/validation/options.ts\";\n\nexport type FileResultCallback = {\n (err: Error, file: null): void;\n (err: null, file: FileResult | null): void;\n};\n\nexport type FileResult = {\n metadata: Record;\n options: Record;\n ast: t.File | null;\n code: string | null;\n map: GeneratorResult[\"map\"];\n sourceType: Exclude;\n externalDependencies: Set;\n};\n\nexport function* run(\n config: ResolvedConfig,\n code: string,\n ast?: t.File | t.Program | null,\n): Handler {\n const file = yield* normalizeFile(\n config.passes,\n normalizeOptions(config),\n code,\n ast,\n );\n\n const opts = file.opts;\n try {\n yield* transformFile(file, config.passes);\n } catch (e) {\n e.message = `${opts.filename ?? \"unknown file\"}: ${e.message}`;\n if (!e.code) {\n e.code = \"BABEL_TRANSFORM_ERROR\";\n }\n throw e;\n }\n\n let outputCode, outputMap;\n try {\n if (opts.code !== false) {\n ({ outputCode, outputMap } = generateCode(config.passes, file));\n }\n } catch (e) {\n e.message = `${opts.filename ?? \"unknown file\"}: ${e.message}`;\n if (!e.code) {\n e.code = \"BABEL_GENERATE_ERROR\";\n }\n throw e;\n }\n\n return {\n metadata: file.metadata,\n options: opts,\n ast: opts.ast === true ? file.ast : null,\n code: outputCode === undefined ? null : outputCode,\n map: outputMap === undefined ? null : outputMap,\n sourceType: file.ast.program.sourceType,\n externalDependencies: flattenToSet(config.externalDependencies),\n };\n}\n\nfunction* transformFile(file: File, pluginPasses: PluginPasses): Handler {\n const async = yield* isAsync();\n\n for (const pluginPairs of pluginPasses) {\n const passPairs: [Plugin, PluginPass][] = [];\n const passes = [];\n const visitors = [];\n\n for (const plugin of pluginPairs.concat([loadBlockHoistPlugin()])) {\n const pass = new PluginPass(file, plugin.key, plugin.options, async);\n\n passPairs.push([plugin, pass]);\n passes.push(pass);\n visitors.push(plugin.visitor);\n }\n\n for (const [plugin, pass] of passPairs) {\n if (plugin.pre) {\n const fn = maybeAsync(\n plugin.pre,\n `You appear to be using an async plugin/preset, but Babel has been called synchronously`,\n );\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n yield* fn.call(pass, file);\n }\n }\n\n // merge all plugin visitors into a single visitor\n const visitor = traverse.visitors.merge(\n visitors,\n passes,\n file.opts.wrapPluginVisitorMethod,\n );\n if (process.env.BABEL_8_BREAKING) {\n traverse(file.ast.program, visitor, file.scope, null, file.path, true);\n } else {\n traverse(file.ast, visitor, file.scope);\n }\n\n for (const [plugin, pass] of passPairs) {\n if (plugin.post) {\n const fn = maybeAsync(\n plugin.post,\n `You appear to be using an async plugin/preset, but Babel has been called synchronously`,\n );\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n yield* fn.call(pass, file);\n }\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAQA,IAAAE,WAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAEA,IAAAK,SAAA,GAAAL,OAAA;AAGA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAkBO,UAAUQ,GAAGA,CAClBC,MAAsB,EACtBC,IAAY,EACZC,GAA+B,EACV;EACrB,MAAMC,IAAI,GAAG,OAAO,IAAAC,sBAAa,EAC/BJ,MAAM,CAACK,MAAM,EACb,IAAAC,sBAAgB,EAACN,MAAM,CAAC,EACxBC,IAAI,EACJC,GACF,CAAC;EAED,MAAMK,IAAI,GAAGJ,IAAI,CAACI,IAAI;EACtB,IAAI;IACF,OAAOC,aAAa,CAACL,IAAI,EAAEH,MAAM,CAACK,MAAM,CAAC;EAC3C,CAAC,CAAC,OAAOI,CAAC,EAAE;IAAA,IAAAC,cAAA;IACVD,CAAC,CAACE,OAAO,GAAG,IAAAD,cAAA,GAAGH,IAAI,CAACK,QAAQ,YAAAF,cAAA,GAAI,cAAc,KAAKD,CAAC,CAACE,OAAO,EAAE;IAC9D,IAAI,CAACF,CAAC,CAACR,IAAI,EAAE;MACXQ,CAAC,CAACR,IAAI,GAAG,u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diff --git a/node_modules/@babel/core/lib/transformation/normalize-file.js b/node_modules/@babel/core/lib/transformation/normalize-file.js new file mode 100644 index 0000000..20c5dc0 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/normalize-file.js @@ -0,0 +1,129 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = normalizeFile; +function _fs() { + const data = require("fs"); + _fs = function () { + return data; + }; + return data; +} +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +function _debug() { + const data = require("debug"); + _debug = function () { + return data; + }; + return data; +} +function _t() { + const data = require("@babel/types"); + _t = function () { + return data; + }; + return data; +} +function _convertSourceMap() { + const data = require("convert-source-map"); + _convertSourceMap = function () { + return data; + }; + return data; +} +var _file = require("./file/file.js"); +var _index = require("../parser/index.js"); +var _cloneDeep = require("./util/clone-deep.js"); +const { + file, + traverseFast +} = _t(); +const debug = _debug()("babel:transform:file"); +const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,.*$/; +const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/; +function* normalizeFile(pluginPasses, options, code, ast) { + code = `${code || ""}`; + if (ast) { + if (ast.type === "Program") { + ast = file(ast, [], []); + } else if (ast.type !== "File") { + throw new Error("AST root must be a Program or File node"); + } + if (options.cloneInputAst) { + ast = (0, _cloneDeep.default)(ast); + } + } else { + ast = yield* (0, _index.default)(pluginPasses, options, code); + } + let inputMap = null; + if (options.inputSourceMap !== false) { + if (typeof options.inputSourceMap === "object") { + inputMap = _convertSourceMap().fromObject(options.inputSourceMap); + } + if (!inputMap) { + const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast); + if (lastComment) { + try { + inputMap = _convertSourceMap().fromComment("//" + lastComment); + } catch (err) { + { + debug("discarding unknown inline input sourcemap"); + } + } + } + } + if (!inputMap) { + const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); + if (typeof options.filename === "string" && lastComment) { + try { + const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment); + const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]), "utf8"); + inputMap = _convertSourceMap().fromJSON(inputMapContent); + } catch (err) { + debug("discarding unknown file input sourcemap", err); + } + } else if (lastComment) { + debug("discarding un-loadable file input sourcemap"); + } + } + } + return new _file.default(options, { + code, + ast: ast, + inputMap + }); +} +function extractCommentsFromList(regex, comments, lastComment) { + if (comments) { + comments = comments.filter(({ + value + }) => { + if (regex.test(value)) { + lastComment = value; + return false; + } + return true; + }); + } + return [comments, lastComment]; +} +function extractComments(regex, ast) { + let lastComment = null; + traverseFast(ast, node => { + [node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment); + [node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment); + [node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment); + }); + return lastComment; +} +0 && 0; + +//# sourceMappingURL=normalize-file.js.map diff --git a/node_modules/@babel/core/lib/transformation/normalize-file.js.map b/node_modules/@babel/core/lib/transformation/normalize-file.js.map new file mode 100644 index 0000000..cb7aa24 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/normalize-file.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_fs","data","require","_path","_debug","_t","_convertSourceMap","_file","_index","_cloneDeep","file","traverseFast","debug","buildDebug","INLINE_SOURCEMAP_REGEX","EXTERNAL_SOURCEMAP_REGEX","normalizeFile","pluginPasses","options","code","ast","type","Error","cloneInputAst","cloneDeep","parser","inputMap","inputSourceMap","convertSourceMap","fromObject","lastComment","extractComments","fromComment","err","filename","match","exec","inputMapContent","fs","readFileSync","path","resolve","dirname","fromJSON","File","extractCommentsFromList","regex","comments","filter","value","test","node","leadingComments","innerComments","trailingComments"],"sources":["../../src/transformation/normalize-file.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport buildDebug from \"debug\";\nimport type { Handler } from \"gensync\";\nimport { file, traverseFast } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { PluginPasses } from \"../config/index.ts\";\nimport convertSourceMap from \"convert-source-map\";\nimport type { SourceMapConverter as Converter } from \"convert-source-map\";\nimport File from \"./file/file.ts\";\nimport parser from \"../parser/index.ts\";\nimport cloneDeep from \"./util/clone-deep.ts\";\nimport type { ResolvedOptions } from \"../config/validation/options.ts\";\n\nconst debug = buildDebug(\"babel:transform:file\");\n\n// These regexps are copied from the convert-source-map package,\n// but without // or /* at the beginning of the comment.\n\nconst INLINE_SOURCEMAP_REGEX =\n /^[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,.*$/;\nconst EXTERNAL_SOURCEMAP_REGEX =\n /^[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+)[ \\t]*$/;\n\nexport type NormalizedFile = {\n code: string;\n ast: t.File;\n inputMap: Converter | null;\n};\n\nexport default function* normalizeFile(\n pluginPasses: PluginPasses,\n options: ResolvedOptions,\n code: string,\n ast?: t.File | t.Program | null,\n): Handler {\n code = `${code || \"\"}`;\n\n if (ast) {\n if (ast.type === \"Program\") {\n ast = file(ast, [], []);\n } else if (ast.type !== \"File\") {\n throw new Error(\"AST root must be a Program or File node\");\n }\n\n if (options.cloneInputAst) {\n ast = cloneDeep(ast);\n }\n } else {\n ast = yield* parser(pluginPasses, options, code);\n }\n\n let inputMap = null;\n if (options.inputSourceMap !== false) {\n // If an explicit object is passed in, it overrides the processing of\n // source maps that may be in the file itself.\n if (typeof options.inputSourceMap === \"object\") {\n inputMap = convertSourceMap.fromObject(options.inputSourceMap);\n }\n\n if (!inputMap) {\n const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);\n if (lastComment) {\n try {\n inputMap = convertSourceMap.fromComment(\"//\" + lastComment);\n } catch (err) {\n if (process.env.BABEL_8_BREAKING) {\n console.warn(\n \"discarding unknown inline input sourcemap\",\n options.filename,\n err,\n );\n } else {\n debug(\"discarding unknown inline input sourcemap\");\n }\n }\n }\n }\n\n if (!inputMap) {\n const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);\n if (typeof options.filename === \"string\" && lastComment) {\n try {\n // when `lastComment` is non-null, EXTERNAL_SOURCEMAP_REGEX must have matches\n const match: [string, string] = EXTERNAL_SOURCEMAP_REGEX.exec(\n lastComment,\n ) as any;\n const inputMapContent = fs.readFileSync(\n path.resolve(path.dirname(options.filename), match[1]),\n \"utf8\",\n );\n inputMap = convertSourceMap.fromJSON(inputMapContent);\n } catch (err) {\n debug(\"discarding unknown file input sourcemap\", err);\n }\n } else if (lastComment) {\n debug(\"discarding un-loadable file input sourcemap\");\n }\n }\n }\n\n return new File(options, {\n code,\n ast: ast,\n inputMap,\n });\n}\n\nfunction extractCommentsFromList(\n regex: RegExp,\n comments: t.Comment[],\n lastComment: string | null,\n): [t.Comment[], string | null] {\n if (comments) {\n comments = comments.filter(({ value }) => {\n if (regex.test(value)) {\n lastComment = value;\n return false;\n }\n return true;\n });\n }\n return [comments, lastComment];\n}\n\nfunction extractComments(regex: RegExp, ast: t.Node) {\n let lastComment: string = null;\n traverseFast(ast, node => {\n [node.leadingComments, lastComment] = extractCommentsFromList(\n regex,\n node.leadingComments,\n lastComment,\n );\n [node.innerComments, lastComment] = extractCommentsFromList(\n regex,\n node.innerComments,\n lastComment,\n );\n [node.trailingComments, lastComment] = extractCommentsFromList(\n regex,\n node.trailingComments,\n lastComment,\n );\n });\n return lastComment;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;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AK,CAAC,6CAA6C,CAAC;MACtD;IACF;EACF;EAEA,OAAO,IAAIgC,aAAI,CAAC1B,OAAO,EAAE;IACvBC,IAAI;IACJC,GAAG,EAAEA,GAAG;IACRM;EACF,CAAC,CAAC;AACJ;AAEA,SAASmB,uBAAuBA,CAC9BC,KAAa,EACbC,QAAqB,EACrBjB,WAA0B,EACI;EAC9B,IAAIiB,QAAQ,EAAE;IACZA,QAAQ,GAAGA,QAAQ,CAACC,MAAM,CAAC,CAAC;MAAEC;IAAM,CAAC,KAAK;MACxC,IAAIH,KAAK,CAACI,IAAI,CAACD,KAAK,CAAC,EAAE;QACrBnB,WAAW,GAAGmB,KAAK;QACnB,OAAO,KAAK;MACd;MACA,OAAO,IAAI;IACb,CAAC,CAAC;EACJ;EACA,OAAO,CAACF,QAAQ,EAAEjB,WAAW,CAAC;AAChC;AAEA,SAASC,eAAeA,CAACe,KAAa,EAAE1B,GAAW,EAAE;EACnD,IAAIU,WAAmB,GAAG,IAAI;EAC9BnB,YAAY,CAACS,GAAG,EAAE+B,IAAI,IAAI;IACxB,CAACA,IAAI,CAACC,eAAe,EAAEtB,WAAW,CAAC,GAAGe,uBAAuB,CAC3DC,KAAK,EACLK,IAAI,CAACC,eAAe,EACpBtB,WACF,CAAC;IACD,CAACqB,IAAI,CAACE,aAAa,EAAEvB,WAAW,CAAC,GAAGe,uBAAuB,CACzDC,KAAK,EACLK,IAAI,CAACE,aAAa,EAClBvB,WACF,CAAC;IACD,CAACqB,IAAI,CAACG,gBAAgB,EAAExB,WAAW,CAAC,GAAGe,uBAAuB,CAC5DC,KAAK,EACLK,IAAI,CAACG,gBAAgB,EACrBxB,WACF,CAAC;EACH,CAAC,CAAC;EACF,OAAOA,WAAW;AACpB;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/normalize-opts.js b/node_modules/@babel/core/lib/transformation/normalize-opts.js new file mode 100644 index 0000000..c4d9d8b --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/normalize-opts.js @@ -0,0 +1,59 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = normalizeOptions; +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +function normalizeOptions(config) { + const { + filename, + cwd, + filenameRelative = typeof filename === "string" ? _path().relative(cwd, filename) : "unknown", + sourceType = "module", + inputSourceMap, + sourceMaps = !!inputSourceMap, + sourceRoot = config.options.moduleRoot, + sourceFileName = _path().basename(filenameRelative), + comments = true, + compact = "auto" + } = config.options; + const opts = config.options; + const options = Object.assign({}, opts, { + parserOpts: Object.assign({ + sourceType: _path().extname(filenameRelative) === ".mjs" ? "module" : sourceType, + sourceFileName: filename, + plugins: [] + }, opts.parserOpts), + generatorOpts: Object.assign({ + filename, + auxiliaryCommentBefore: opts.auxiliaryCommentBefore, + auxiliaryCommentAfter: opts.auxiliaryCommentAfter, + retainLines: opts.retainLines, + comments, + shouldPrintComment: opts.shouldPrintComment, + compact, + minified: opts.minified, + sourceMaps: !!sourceMaps, + sourceRoot, + sourceFileName + }, opts.generatorOpts) + }); + for (const plugins of config.passes) { + for (const plugin of plugins) { + if (plugin.manipulateOptions) { + plugin.manipulateOptions(options, options.parserOpts); + } + } + } + return options; +} +0 && 0; + +//# sourceMappingURL=normalize-opts.js.map diff --git a/node_modules/@babel/core/lib/transformation/normalize-opts.js.map b/node_modules/@babel/core/lib/transformation/normalize-opts.js.map new file mode 100644 index 0000000..1439fa9 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/normalize-opts.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","data","require","normalizeOptions","config","filename","cwd","filenameRelative","path","relative","sourceType","inputSourceMap","sourceMaps","sourceRoot","options","moduleRoot","sourceFileName","basename","comments","compact","opts","Object","assign","parserOpts","extname","plugins","generatorOpts","auxiliaryCommentBefore","auxiliaryCommentAfter","retainLines","shouldPrintComment","minified","passes","plugin","manipulateOptions"],"sources":["../../src/transformation/normalize-opts.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { ResolvedConfig } from \"../config/index.ts\";\nimport type { ResolvedOptions } from \"../config/validation/options.ts\";\n\nexport default function normalizeOptions(\n config: ResolvedConfig,\n): ResolvedOptions {\n const {\n filename,\n cwd,\n filenameRelative = typeof filename === \"string\"\n ? path.relative(cwd, filename)\n : \"unknown\",\n sourceType = \"module\",\n inputSourceMap,\n sourceMaps = !!inputSourceMap,\n sourceRoot = process.env.BABEL_8_BREAKING\n ? undefined\n : // @ts-ignore(Babel 7 vs Babel 8) moduleRoot is a Babel 7 option\n config.options.moduleRoot,\n\n sourceFileName = path.basename(filenameRelative),\n\n comments = true,\n compact = \"auto\",\n } = config.options;\n\n const opts = config.options;\n\n const options: ResolvedOptions = {\n ...opts,\n\n parserOpts: {\n sourceType:\n path.extname(filenameRelative) === \".mjs\" ? \"module\" : sourceType,\n\n // @ts-expect-error We should have passed `sourceFilename` here\n // pending https://github.com/babel/babel/issues/15917#issuecomment-2789278964\n sourceFileName: filename,\n plugins: [],\n ...opts.parserOpts,\n },\n\n generatorOpts: {\n // General generator flags.\n filename,\n\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n retainLines: opts.retainLines,\n comments,\n shouldPrintComment: opts.shouldPrintComment,\n compact,\n minified: opts.minified,\n\n // Source-map generation flags.\n // babel-generator does not differentiate between `true`, `\"inline\"` or `\"both\"`\n sourceMaps: !!sourceMaps,\n sourceRoot,\n sourceFileName,\n\n ...opts.generatorOpts,\n },\n };\n\n for (const plugins of config.passes) {\n for (const plugin of plugins) {\n if (plugin.manipulateOptions) {\n plugin.manipulateOptions(options, options.parserOpts);\n }\n }\n }\n\n return options;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIe,SAASE,gBAAgBA,CACtC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,MAAM,EAAE;IACnC,KAAK,MAAMC,MAAM,IAAIR,OAAO,EAAE;MAC5B,IAAIQ,MAAM,CAACC,iBAAiB,EAAE;QAC5BD,MAAM,CAACC,iBAAiB,CAACpB,OAAO,EAAEA,OAAO,CAACS,UAAU,CAAC;MACvD;IACF;EACF;EAEA,OAAOT,OAAO;AAChB;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/plugin-pass.js b/node_modules/@babel/core/lib/transformation/plugin-pass.js new file mode 100644 index 0000000..d8f2c5c --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/plugin-pass.js @@ -0,0 +1,50 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +class PluginPass { + constructor(file, key, options, isAsync) { + this._map = new Map(); + this.key = void 0; + this.file = void 0; + this.opts = void 0; + this.cwd = void 0; + this.filename = void 0; + this.isAsync = void 0; + this.key = key; + this.file = file; + this.opts = options || {}; + this.cwd = file.opts.cwd; + this.filename = file.opts.filename; + this.isAsync = isAsync; + } + set(key, val) { + this._map.set(key, val); + } + get(key) { + return this._map.get(key); + } + availableHelper(name, versionRange) { + return this.file.availableHelper(name, versionRange); + } + addHelper(name) { + return this.file.addHelper(name); + } + buildCodeFrameError(node, msg, _Error) { + return this.file.buildCodeFrameError(node, msg, _Error); + } +} +exports.default = PluginPass; +{ + PluginPass.prototype.getModuleName = function getModuleName() { + return this.file.getModuleName(); + }; + PluginPass.prototype.addImport = function addImport() { + this.file.addImport(); + }; +} +0 && 0; + +//# sourceMappingURL=plugin-pass.js.map diff --git a/node_modules/@babel/core/lib/transformation/plugin-pass.js.map b/node_modules/@babel/core/lib/transformation/plugin-pass.js.map new file mode 100644 index 0000000..e691707 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/plugin-pass.js.map @@ -0,0 +1 @@ +{"version":3,"names":["PluginPass","constructor","file","key","options","isAsync","_map","Map","opts","cwd","filename","set","val","get","availableHelper","name","versionRange","addHelper","buildCodeFrameError","node","msg","_Error","exports","default","prototype","getModuleName","addImport"],"sources":["../../src/transformation/plugin-pass.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\nimport type File from \"./file/file.ts\";\n\nexport default class PluginPass {\n _map: Map = new Map();\n key: string | undefined | null;\n file: File;\n opts: Partial;\n\n /**\n * The working directory that Babel's programmatic options are loaded\n * relative to.\n */\n cwd: string;\n\n /** The absolute path of the file being compiled. */\n filename: string | void;\n\n /**\n * Is Babel executed in async mode or not.\n */\n isAsync: boolean;\n\n constructor(\n file: File,\n key: string | null,\n options: Options | undefined,\n isAsync: boolean,\n ) {\n this.key = key;\n this.file = file;\n this.opts = options || {};\n this.cwd = file.opts.cwd;\n this.filename = file.opts.filename;\n this.isAsync = isAsync;\n }\n\n set(key: unknown, val: unknown) {\n this._map.set(key, val);\n }\n\n get(key: unknown): any {\n return this._map.get(key);\n }\n\n availableHelper(name: string, versionRange?: string | null) {\n return this.file.availableHelper(name, versionRange);\n }\n\n addHelper(name: string) {\n return this.file.addHelper(name);\n }\n\n buildCodeFrameError(\n node: t.Node | undefined | null,\n msg: string,\n _Error?: typeof Error,\n ) {\n return this.file.buildCodeFrameError(node, msg, _Error);\n }\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n (PluginPass as any).prototype.getModuleName = function getModuleName(\n this: PluginPass,\n ): string | undefined {\n // @ts-expect-error only exists in Babel 7\n return this.file.getModuleName();\n };\n (PluginPass as any).prototype.addImport = function addImport(\n this: PluginPass,\n ): void {\n // @ts-expect-error only exists in Babel 7\n this.file.addImport();\n };\n}\n"],"mappings":";;;;;;AAGe,MAAMA,UAAU,CAAmB;EAoBhDC,WAAWA,CACTC,IAAU,EACVC,GAAkB,EAClBC,OAA4B,EAC5BC,OAAgB,EAChB;IAAA,KAxBFC,IAAI,GAA0B,IAAIC,GAAG,CAAC,CAAC;IAAA,KACvCJ,GAAG;IAAA,KACHD,IAAI;IAAA,KACJM,IAAI;IAAA,KAMJC,GAAG;IAAA,KA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S,CAAC,CAAC;EACvB,CAAC;AACH;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/transformation/util/clone-deep.js b/node_modules/@babel/core/lib/transformation/util/clone-deep.js new file mode 100644 index 0000000..bc8eaa8 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/util/clone-deep.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +const circleSet = new Set(); +let depth = 0; +function deepClone(value, cache, allowCircle) { + if (value !== null) { + if (allowCircle) { + if (cache.has(value)) return cache.get(value); + } else if (++depth > 250) { + if (circleSet.has(value)) { + depth = 0; + circleSet.clear(); + throw new Error("Babel-deepClone: Cycles are not allowed in AST"); + } + circleSet.add(value); + } + let cloned; + if (Array.isArray(value)) { + cloned = new Array(value.length); + if (allowCircle) cache.set(value, cloned); + for (let i = 0; i < value.length; i++) { + cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache, allowCircle); + } + } else { + cloned = {}; + if (allowCircle) cache.set(value, cloned); + const keys = Object.keys(value); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache, allowCircle || key === "leadingComments" || key === "innerComments" || key === "trailingComments" || key === "extra"); + } + } + if (!allowCircle) { + if (depth-- > 250) circleSet.delete(value); + } + return cloned; + } + return value; +} +function _default(value) { + if (typeof value !== "object") return value; + { + try { + return deepClone(value, new Map(), true); + } catch (_) { + return structuredClone(value); + } + } +} +0 && 0; + +//# sourceMappingURL=clone-deep.js.map diff --git a/node_modules/@babel/core/lib/transformation/util/clone-deep.js.map b/node_modules/@babel/core/lib/transformation/util/clone-deep.js.map new file mode 100644 index 0000000..2c0a564 --- /dev/null +++ b/node_modules/@babel/core/lib/transformation/util/clone-deep.js.map @@ -0,0 +1 @@ +{"version":3,"names":["circleSet","Set","depth","deepClone","value","cache","allowCircle","has","get","clear","Error","add","cloned","Array","isArray","length","set","i","keys","Object","key","delete","_default","Map","_","structuredClone"],"sources":["../../../src/transformation/util/clone-deep.ts"],"sourcesContent":["const circleSet = new Set();\nlet depth = 0;\n// https://github.com/babel/babel/pull/14583#discussion_r882828856\nfunction deepClone(\n value: any,\n cache: Map,\n allowCircle: boolean,\n): any {\n if (value !== null) {\n if (allowCircle) {\n if (cache.has(value)) return cache.get(value);\n } else if (++depth > 250) {\n if (circleSet.has(value)) {\n depth = 0;\n circleSet.clear();\n throw new Error(\"Babel-deepClone: Cycles are not allowed in AST\");\n }\n circleSet.add(value);\n }\n let cloned: any;\n if (Array.isArray(value)) {\n cloned = new Array(value.length);\n if (allowCircle) cache.set(value, cloned);\n for (let i = 0; i < value.length; i++) {\n cloned[i] =\n typeof value[i] !== \"object\"\n ? value[i]\n : deepClone(value[i], cache, allowCircle);\n }\n } else {\n cloned = {};\n if (allowCircle) cache.set(value, cloned);\n const keys = Object.keys(value);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n cloned[key] =\n typeof value[key] !== \"object\"\n ? value[key]\n : deepClone(\n value[key],\n cache,\n allowCircle ||\n key === \"leadingComments\" ||\n key === \"innerComments\" ||\n key === \"trailingComments\" ||\n key === \"extra\",\n );\n }\n }\n if (!allowCircle) {\n if (depth-- > 250) circleSet.delete(value);\n }\n return cloned;\n }\n return value;\n}\n\nexport default function (value: T): T {\n if (typeof value !== \"object\") return value;\n\n if (process.env.BABEL_8_BREAKING) {\n if (!process.env.IS_PUBLISH && depth > 0) {\n throw new Error(\"depth > 0\");\n }\n return deepClone(value, new Map(), false);\n } else {\n try {\n return deepClone(value, new Map(), true);\n } catch (_) {\n return structuredClone(value);\n }\n }\n}\n"],"mappings":";;;;;;AAAA,MAAMA,SAAS,GAAG,IAAIC,GAAG,CAAC,CAAC;AAC3B,IAAIC,KAAK,GAAG,CAAC;AAEb,SAASC,SAASA,CAChBC,KAAU,EACVC,KAAoB,EACpBC,WAAoB,EACf;EACL,IAAIF,KAAK,KAAK,IAAI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,CAACD,CAAC,CAAC;QACnBL,MAAM,CAACQ,GAAG,CAAC,GACT,OAAOhB,KAAK,CAACgB,GAAG,CAAC,KAAK,QAAQ,GAC1BhB,KAAK,CAACgB,GAAG,CAAC,GACVjB,SAAS,CACPC,KAAK,CAACgB,GAAG,CAAC,EACVf,KAAK,EACLC,WAAW,IACTc,GAAG,KAAK,iBAAiB,IACzBA,GAAG,KAAK,eAAe,IACvBA,GAAG,KAAK,kBAAkB,IAC1BA,GAAG,KAAK,OACZ,CAAC;MACT;IACF;IACA,IAAI,CAACd,WAAW,EAAE;MAChB,IAAIJ,KAAK,EAAE,GAAG,GAAG,EAAEF,SAAS,CAACqB,MAAM,CAACjB,KAAK,CAAC;IAC5C;IACA,OAAOQ,MAAM;EACf;EACA,OAAOR,KAAK;AACd;AAEe,SAAAkB,SAAalB,KAAQ,EAAK;EACvC,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE,OAAOA,KAAK;EAOpC;IACL,IAAI;MACF,OAAOD,SAAS,CAACC,KAAK,EAAE,IAAImB,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC;IAC1C,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,OAAOC,eAAe,CAACrB,KAAK,CAAC;IAC/B;EACF;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/lib/vendor/import-meta-resolve.js b/node_modules/@babel/core/lib/vendor/import-meta-resolve.js new file mode 100644 index 0000000..90a5911 --- /dev/null +++ b/node_modules/@babel/core/lib/vendor/import-meta-resolve.js @@ -0,0 +1,1042 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.moduleResolve = moduleResolve; +exports.resolve = resolve; +function _assert() { + const data = require("assert"); + _assert = function () { + return data; + }; + return data; +} +function _fs() { + const data = _interopRequireWildcard(require("fs"), true); + _fs = function () { + return data; + }; + return data; +} +function _process() { + const data = require("process"); + _process = function () { + return data; + }; + return data; +} +function _url() { + const data = require("url"); + _url = function () { + return data; + }; + return data; +} +function _path() { + const data = require("path"); + _path = function () { + return data; + }; + return data; +} +function _module() { + const data = require("module"); + _module = function () { + return data; + }; + return data; +} +function _v() { + const data = require("v8"); + _v = function () { + return data; + }; + return data; +} +function _util() { + const data = require("util"); + _util = function () { + return data; + }; + return data; +} +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } +const own$1 = {}.hasOwnProperty; +const classRegExp = /^([A-Z][a-z\d]*)+$/; +const kTypes = new Set(['string', 'function', 'number', 'object', 'Function', 'Object', 'boolean', 'bigint', 'symbol']); +const codes = {}; +function formatList(array, type = 'and') { + return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(', ')}, ${type} ${array[array.length - 1]}`; +} +const messages = new Map(); +const nodeInternalPrefix = '__node_internal_'; +let userStackTraceLimit; +codes.ERR_INVALID_ARG_TYPE = createError('ERR_INVALID_ARG_TYPE', (name, expected, actual) => { + _assert()(typeof name === 'string', "'name' must be a string"); + if (!Array.isArray(expected)) { + expected = [expected]; + } + let message = 'The '; + if (name.endsWith(' argument')) { + message += `${name} `; + } else { + const type = name.includes('.') ? 'property' : 'argument'; + message += `"${name}" ${type} `; + } + message += 'must be '; + const types = []; + const instances = []; + const other = []; + for (const value of expected) { + _assert()(typeof value === 'string', 'All expected entries have to be of type string'); + if (kTypes.has(value)) { + types.push(value.toLowerCase()); + } else if (classRegExp.exec(value) === null) { + _assert()(value !== 'object', 'The value "object" should be written as "Object"'); + other.push(value); + } else { + instances.push(value); + } + } + if (instances.length > 0) { + const pos = types.indexOf('object'); + if (pos !== -1) { + types.slice(pos, 1); + instances.push('Object'); + } + } + if (types.length > 0) { + message += `${types.length > 1 ? 'one of type' : 'of type'} ${formatList(types, 'or')}`; + if (instances.length > 0 || other.length > 0) message += ' or '; + } + if (instances.length > 0) { + message += `an instance of ${formatList(instances, 'or')}`; + if (other.length > 0) message += ' or '; + } + if (other.length > 0) { + if (other.length > 1) { + message += `one of ${formatList(other, 'or')}`; + } else { + if (other[0].toLowerCase() !== other[0]) message += 'an '; + message += `${other[0]}`; + } + } + message += `. Received ${determineSpecificType(actual)}`; + return message; +}, TypeError); +codes.ERR_INVALID_MODULE_SPECIFIER = createError('ERR_INVALID_MODULE_SPECIFIER', (request, reason, base = undefined) => { + return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ''}`; +}, TypeError); +codes.ERR_INVALID_PACKAGE_CONFIG = createError('ERR_INVALID_PACKAGE_CONFIG', (path, base, message) => { + return `Invalid package config ${path}${base ? ` while importing ${base}` : ''}${message ? `. ${message}` : ''}`; +}, Error); +codes.ERR_INVALID_PACKAGE_TARGET = createError('ERR_INVALID_PACKAGE_TARGET', (packagePath, key, target, isImport = false, base = undefined) => { + const relatedError = typeof target === 'string' && !isImport && target.length > 0 && !target.startsWith('./'); + if (key === '.') { + _assert()(isImport === false); + return `Invalid "exports" main target ${JSON.stringify(target)} defined ` + `in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ''}${relatedError ? '; targets must start with "./"' : ''}`; + } + return `Invalid "${isImport ? 'imports' : 'exports'}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ''}${relatedError ? '; targets must start with "./"' : ''}`; +}, Error); +codes.ERR_MODULE_NOT_FOUND = createError('ERR_MODULE_NOT_FOUND', (path, base, exactUrl = false) => { + return `Cannot find ${exactUrl ? 'module' : 'package'} '${path}' imported from ${base}`; +}, Error); +codes.ERR_NETWORK_IMPORT_DISALLOWED = createError('ERR_NETWORK_IMPORT_DISALLOWED', "import of '%s' by %s is not supported: %s", Error); +codes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError('ERR_PACKAGE_IMPORT_NOT_DEFINED', (specifier, packagePath, base) => { + return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath}package.json` : ''} imported from ${base}`; +}, TypeError); +codes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError('ERR_PACKAGE_PATH_NOT_EXPORTED', (packagePath, subpath, base = undefined) => { + if (subpath === '.') return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ''}`; + return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ''}`; +}, Error); +codes.ERR_UNSUPPORTED_DIR_IMPORT = createError('ERR_UNSUPPORTED_DIR_IMPORT', "Directory import '%s' is not supported " + 'resolving ES modules imported from %s', Error); +codes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError('ERR_UNSUPPORTED_RESOLVE_REQUEST', 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError); +codes.ERR_UNKNOWN_FILE_EXTENSION = createError('ERR_UNKNOWN_FILE_EXTENSION', (extension, path) => { + return `Unknown file extension "${extension}" for ${path}`; +}, TypeError); +codes.ERR_INVALID_ARG_VALUE = createError('ERR_INVALID_ARG_VALUE', (name, value, reason = 'is invalid') => { + let inspected = (0, _util().inspect)(value); + if (inspected.length > 128) { + inspected = `${inspected.slice(0, 128)}...`; + } + const type = name.includes('.') ? 'property' : 'argument'; + return `The ${type} '${name}' ${reason}. Received ${inspected}`; +}, TypeError); +function createError(sym, value, constructor) { + messages.set(sym, value); + return makeNodeErrorWithCode(constructor, sym); +} +function makeNodeErrorWithCode(Base, key) { + return NodeError; + function NodeError(...parameters) { + const limit = Error.stackTraceLimit; + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0; + const error = new Base(); + if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit; + const message = getMessage(key, parameters, error); + Object.defineProperties(error, { + message: { + value: message, + enumerable: false, + writable: true, + configurable: true + }, + toString: { + value() { + return `${this.name} [${key}]: ${this.message}`; + }, + enumerable: false, + writable: true, + configurable: true + } + }); + captureLargerStackTrace(error); + error.code = key; + return error; + } +} +function isErrorStackTraceLimitWritable() { + try { + if (_v().startupSnapshot.isBuildingSnapshot()) { + return false; + } + } catch (_unused) {} + const desc = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit'); + if (desc === undefined) { + return Object.isExtensible(Error); + } + return own$1.call(desc, 'writable') && desc.writable !== undefined ? desc.writable : desc.set !== undefined; +} +function hideStackFrames(wrappedFunction) { + const hidden = nodeInternalPrefix + wrappedFunction.name; + Object.defineProperty(wrappedFunction, 'name', { + value: hidden + }); + return wrappedFunction; +} +const captureLargerStackTrace = hideStackFrames(function (error) { + const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable(); + if (stackTraceLimitIsWritable) { + userStackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Number.POSITIVE_INFINITY; + } + Error.captureStackTrace(error); + if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit; + return error; +}); +function getMessage(key, parameters, self) { + const message = messages.get(key); + _assert()(message !== undefined, 'expected `message` to be found'); + if (typeof message === 'function') { + _assert()(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not ` + `match the required ones (${message.length}).`); + return Reflect.apply(message, self, parameters); + } + const regex = /%[dfijoOs]/g; + let expectedLength = 0; + while (regex.exec(message) !== null) expectedLength++; + _assert()(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not ` + `match the required ones (${expectedLength}).`); + if (parameters.length === 0) return message; + parameters.unshift(message); + return Reflect.apply(_util().format, null, parameters); +} +function determineSpecificType(value) { + if (value === null || value === undefined) { + return String(value); + } + if (typeof value === 'function' && value.name) { + return `function ${value.name}`; + } + if (typeof value === 'object') { + if (value.constructor && value.constructor.name) { + return `an instance of ${value.constructor.name}`; + } + return `${(0, _util().inspect)(value, { + depth: -1 + })}`; + } + let inspected = (0, _util().inspect)(value, { + colors: false + }); + if (inspected.length > 28) { + inspected = `${inspected.slice(0, 25)}...`; + } + return `type ${typeof value} (${inspected})`; +} +const hasOwnProperty$1 = {}.hasOwnProperty; +const { + ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1 +} = codes; +const cache = new Map(); +function read(jsonPath, { + base, + specifier +}) { + const existing = cache.get(jsonPath); + if (existing) { + return existing; + } + let string; + try { + string = _fs().default.readFileSync(_path().toNamespacedPath(jsonPath), 'utf8'); + } catch (error) { + const exception = error; + if (exception.code !== 'ENOENT') { + throw exception; + } + } + const result = { + exists: false, + pjsonPath: jsonPath, + main: undefined, + name: undefined, + type: 'none', + exports: undefined, + imports: undefined + }; + if (string !== undefined) { + let parsed; + try { + parsed = JSON.parse(string); + } catch (error_) { + const cause = error_; + const error = new ERR_INVALID_PACKAGE_CONFIG$1(jsonPath, (base ? `"${specifier}" from ` : '') + (0, _url().fileURLToPath)(base || specifier), cause.message); + error.cause = cause; + throw error; + } + result.exists = true; + if (hasOwnProperty$1.call(parsed, 'name') && typeof parsed.name === 'string') { + result.name = parsed.name; + } + if (hasOwnProperty$1.call(parsed, 'main') && typeof parsed.main === 'string') { + result.main = parsed.main; + } + if (hasOwnProperty$1.call(parsed, 'exports')) { + result.exports = parsed.exports; + } + if (hasOwnProperty$1.call(parsed, 'imports')) { + result.imports = parsed.imports; + } + if (hasOwnProperty$1.call(parsed, 'type') && (parsed.type === 'commonjs' || parsed.type === 'module')) { + result.type = parsed.type; + } + } + cache.set(jsonPath, result); + return result; +} +function getPackageScopeConfig(resolved) { + let packageJSONUrl = new URL('package.json', resolved); + while (true) { + const packageJSONPath = packageJSONUrl.pathname; + if (packageJSONPath.endsWith('node_modules/package.json')) { + break; + } + const packageConfig = read((0, _url().fileURLToPath)(packageJSONUrl), { + specifier: resolved + }); + if (packageConfig.exists) { + return packageConfig; + } + const lastPackageJSONUrl = packageJSONUrl; + packageJSONUrl = new URL('../package.json', packageJSONUrl); + if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) { + break; + } + } + const packageJSONPath = (0, _url().fileURLToPath)(packageJSONUrl); + return { + pjsonPath: packageJSONPath, + exists: false, + type: 'none' + }; +} +function getPackageType(url) { + return getPackageScopeConfig(url).type; +} +const { + ERR_UNKNOWN_FILE_EXTENSION +} = codes; +const hasOwnProperty = {}.hasOwnProperty; +const extensionFormatMap = { + __proto__: null, + '.cjs': 'commonjs', + '.js': 'module', + '.json': 'json', + '.mjs': 'module' +}; +function mimeToFormat(mime) { + if (mime && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(mime)) return 'module'; + if (mime === 'application/json') return 'json'; + return null; +} +const protocolHandlers = { + __proto__: null, + 'data:': getDataProtocolModuleFormat, + 'file:': getFileProtocolModuleFormat, + 'http:': getHttpProtocolModuleFormat, + 'https:': getHttpProtocolModuleFormat, + 'node:'() { + return 'builtin'; + } +}; +function getDataProtocolModuleFormat(parsed) { + const { + 1: mime + } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [null, null, null]; + return mimeToFormat(mime); +} +function extname(url) { + const pathname = url.pathname; + let index = pathname.length; + while (index--) { + const code = pathname.codePointAt(index); + if (code === 47) { + return ''; + } + if (code === 46) { + return pathname.codePointAt(index - 1) === 47 ? '' : pathname.slice(index); + } + } + return ''; +} +function getFileProtocolModuleFormat(url, _context, ignoreErrors) { + const value = extname(url); + if (value === '.js') { + const packageType = getPackageType(url); + if (packageType !== 'none') { + return packageType; + } + return 'commonjs'; + } + if (value === '') { + const packageType = getPackageType(url); + if (packageType === 'none' || packageType === 'commonjs') { + return 'commonjs'; + } + return 'module'; + } + const format = extensionFormatMap[value]; + if (format) return format; + if (ignoreErrors) { + return undefined; + } + const filepath = (0, _url().fileURLToPath)(url); + throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath); +} +function getHttpProtocolModuleFormat() {} +function defaultGetFormatWithoutErrors(url, context) { + const protocol = url.protocol; + if (!hasOwnProperty.call(protocolHandlers, protocol)) { + return null; + } + return protocolHandlers[protocol](url, context, true) || null; +} +const { + ERR_INVALID_ARG_VALUE +} = codes; +const DEFAULT_CONDITIONS = Object.freeze(['node', 'import']); +const DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS); +function getDefaultConditions() { + return DEFAULT_CONDITIONS; +} +function getDefaultConditionsSet() { + return DEFAULT_CONDITIONS_SET; +} +function getConditionsSet(conditions) { + if (conditions !== undefined && conditions !== getDefaultConditions()) { + if (!Array.isArray(conditions)) { + throw new ERR_INVALID_ARG_VALUE('conditions', conditions, 'expected an array'); + } + return new Set(conditions); + } + return getDefaultConditionsSet(); +} +const RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace]; +const { + ERR_NETWORK_IMPORT_DISALLOWED, + ERR_INVALID_MODULE_SPECIFIER, + ERR_INVALID_PACKAGE_CONFIG, + ERR_INVALID_PACKAGE_TARGET, + ERR_MODULE_NOT_FOUND, + ERR_PACKAGE_IMPORT_NOT_DEFINED, + ERR_PACKAGE_PATH_NOT_EXPORTED, + ERR_UNSUPPORTED_DIR_IMPORT, + ERR_UNSUPPORTED_RESOLVE_REQUEST +} = codes; +const own = {}.hasOwnProperty; +const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; +const deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; +const invalidPackageNameRegEx = /^\.|%|\\/; +const patternRegEx = /\*/g; +const encodedSeparatorRegEx = /%2f|%5c/i; +const emittedPackageWarnings = new Set(); +const doubleSlashRegEx = /[/\\]{2}/; +function emitInvalidSegmentDeprecation(target, request, match, packageJsonUrl, internal, base, isTarget) { + if (_process().noDeprecation) { + return; + } + const pjsonPath = (0, _url().fileURLToPath)(packageJsonUrl); + const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null; + _process().emitWarning(`Use of deprecated ${double ? 'double slash' : 'leading or trailing slash matching'} resolving "${target}" for module ` + `request "${request}" ${request === match ? '' : `matched to "${match}" `}in the "${internal ? 'imports' : 'exports'}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, _url().fileURLToPath)(base)}` : ''}.`, 'DeprecationWarning', 'DEP0166'); +} +function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) { + if (_process().noDeprecation) { + return; + } + const format = defaultGetFormatWithoutErrors(url, { + parentURL: base.href + }); + if (format !== 'module') return; + const urlPath = (0, _url().fileURLToPath)(url.href); + const packagePath = (0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl)); + const basePath = (0, _url().fileURLToPath)(base); + if (!main) { + _process().emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\nDefault "index" lookups for the main are deprecated for ES modules.`, 'DeprecationWarning', 'DEP0151'); + } else if (_path().resolve(packagePath, main) !== urlPath) { + _process().emitWarning(`Package ${packagePath} has a "main" field set to "${main}", ` + `excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.\n Automatic extension resolution of the "main" field is ` + 'deprecated for ES modules.', 'DeprecationWarning', 'DEP0151'); + } +} +function tryStatSync(path) { + try { + return (0, _fs().statSync)(path); + } catch (_unused2) {} +} +function fileExists(url) { + const stats = (0, _fs().statSync)(url, { + throwIfNoEntry: false + }); + const isFile = stats ? stats.isFile() : undefined; + return isFile === null || isFile === undefined ? false : isFile; +} +function legacyMainResolve(packageJsonUrl, packageConfig, base) { + let guess; + if (packageConfig.main !== undefined) { + guess = new (_url().URL)(packageConfig.main, packageJsonUrl); + if (fileExists(guess)) return guess; + const tries = [`./${packageConfig.main}.js`, `./${packageConfig.main}.json`, `./${packageConfig.main}.node`, `./${packageConfig.main}/index.js`, `./${packageConfig.main}/index.json`, `./${packageConfig.main}/index.node`]; + let i = -1; + while (++i < tries.length) { + guess = new (_url().URL)(tries[i], packageJsonUrl); + if (fileExists(guess)) break; + guess = undefined; + } + if (guess) { + emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); + return guess; + } + } + const tries = ['./index.js', './index.json', './index.node']; + let i = -1; + while (++i < tries.length) { + guess = new (_url().URL)(tries[i], packageJsonUrl); + if (fileExists(guess)) break; + guess = undefined; + } + if (guess) { + emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main); + return guess; + } + throw new ERR_MODULE_NOT_FOUND((0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl)), (0, _url().fileURLToPath)(base)); +} +function finalizeResolution(resolved, base, preserveSymlinks) { + if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) { + throw new ERR_INVALID_MODULE_SPECIFIER(resolved.pathname, 'must not include encoded "/" or "\\" characters', (0, _url().fileURLToPath)(base)); + } + let filePath; + try { + filePath = (0, _url().fileURLToPath)(resolved); + } catch (error) { + const cause = error; + Object.defineProperty(cause, 'input', { + value: String(resolved) + }); + Object.defineProperty(cause, 'module', { + value: String(base) + }); + throw cause; + } + const stats = tryStatSync(filePath.endsWith('/') ? filePath.slice(-1) : filePath); + if (stats && stats.isDirectory()) { + const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, (0, _url().fileURLToPath)(base)); + error.url = String(resolved); + throw error; + } + if (!stats || !stats.isFile()) { + const error = new ERR_MODULE_NOT_FOUND(filePath || resolved.pathname, base && (0, _url().fileURLToPath)(base), true); + error.url = String(resolved); + throw error; + } + if (!preserveSymlinks) { + const real = (0, _fs().realpathSync)(filePath); + const { + search, + hash + } = resolved; + resolved = (0, _url().pathToFileURL)(real + (filePath.endsWith(_path().sep) ? '/' : '')); + resolved.search = search; + resolved.hash = hash; + } + return resolved; +} +function importNotDefined(specifier, packageJsonUrl, base) { + return new ERR_PACKAGE_IMPORT_NOT_DEFINED(specifier, packageJsonUrl && (0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl)), (0, _url().fileURLToPath)(base)); +} +function exportsNotFound(subpath, packageJsonUrl, base) { + return new ERR_PACKAGE_PATH_NOT_EXPORTED((0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl)), subpath, base && (0, _url().fileURLToPath)(base)); +} +function throwInvalidSubpath(request, match, packageJsonUrl, internal, base) { + const reason = `request is not a valid match in pattern "${match}" for the "${internal ? 'imports' : 'exports'}" resolution of ${(0, _url().fileURLToPath)(packageJsonUrl)}`; + throw new ERR_INVALID_MODULE_SPECIFIER(request, reason, base && (0, _url().fileURLToPath)(base)); +} +function invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) { + target = typeof target === 'object' && target !== null ? JSON.stringify(target, null, '') : `${target}`; + return new ERR_INVALID_PACKAGE_TARGET((0, _url().fileURLToPath)(new (_url().URL)('.', packageJsonUrl)), subpath, target, internal, base && (0, _url().fileURLToPath)(base)); +} +function resolvePackageTargetString(target, subpath, match, packageJsonUrl, base, pattern, internal, isPathMap, conditions) { + if (subpath !== '' && !pattern && target[target.length - 1] !== '/') throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (!target.startsWith('./')) { + if (internal && !target.startsWith('../') && !target.startsWith('/')) { + let isURL = false; + try { + new (_url().URL)(target); + isURL = true; + } catch (_unused3) {} + if (!isURL) { + const exportTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target + subpath; + return packageResolve(exportTarget, packageJsonUrl, conditions); + } + } + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + } + if (invalidSegmentRegEx.exec(target.slice(2)) !== null) { + if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) { + if (!isPathMap) { + const request = pattern ? match.replace('*', () => subpath) : match + subpath; + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target; + emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJsonUrl, internal, base, true); + } + } else { + throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + } + } + const resolved = new (_url().URL)(target, packageJsonUrl); + const resolvedPath = resolved.pathname; + const packagePath = new (_url().URL)('.', packageJsonUrl).pathname; + if (!resolvedPath.startsWith(packagePath)) throw invalidPackageTarget(match, target, packageJsonUrl, internal, base); + if (subpath === '') return resolved; + if (invalidSegmentRegEx.exec(subpath) !== null) { + const request = pattern ? match.replace('*', () => subpath) : match + subpath; + if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) { + if (!isPathMap) { + const resolvedTarget = pattern ? RegExpPrototypeSymbolReplace.call(patternRegEx, target, () => subpath) : target; + emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJsonUrl, internal, base, false); + } + } else { + throwInvalidSubpath(request, match, packageJsonUrl, internal, base); + } + } + if (pattern) { + return new (_url().URL)(RegExpPrototypeSymbolReplace.call(patternRegEx, resolved.href, () => subpath)); + } + return new (_url().URL)(subpath, resolved); +} +function isArrayIndex(key) { + const keyNumber = Number(key); + if (`${keyNumber}` !== key) return false; + return keyNumber >= 0 && keyNumber < 0xffffffff; +} +function resolvePackageTarget(packageJsonUrl, target, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions) { + if (typeof target === 'string') { + return resolvePackageTargetString(target, subpath, packageSubpath, packageJsonUrl, base, pattern, internal, isPathMap, conditions); + } + if (Array.isArray(target)) { + const targetList = target; + if (targetList.length === 0) return null; + let lastException; + let i = -1; + while (++i < targetList.length) { + const targetItem = targetList[i]; + let resolveResult; + try { + resolveResult = resolvePackageTarget(packageJsonUrl, targetItem, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions); + } catch (error) { + const exception = error; + lastException = exception; + if (exception.code === 'ERR_INVALID_PACKAGE_TARGET') continue; + throw error; + } + if (resolveResult === undefined) continue; + if (resolveResult === null) { + lastException = null; + continue; + } + return resolveResult; + } + if (lastException === undefined || lastException === null) { + return null; + } + throw lastException; + } + if (typeof target === 'object' && target !== null) { + const keys = Object.getOwnPropertyNames(target); + let i = -1; + while (++i < keys.length) { + const key = keys[i]; + if (isArrayIndex(key)) { + throw new ERR_INVALID_PACKAGE_CONFIG((0, _url().fileURLToPath)(packageJsonUrl), base, '"exports" cannot contain numeric property keys.'); + } + } + i = -1; + while (++i < keys.length) { + const key = keys[i]; + if (key === 'default' || conditions && conditions.has(key)) { + const conditionalTarget = target[key]; + const resolveResult = resolvePackageTarget(packageJsonUrl, conditionalTarget, subpath, packageSubpath, base, pattern, internal, isPathMap, conditions); + if (resolveResult === undefined) continue; + return resolveResult; + } + } + return null; + } + if (target === null) { + return null; + } + throw invalidPackageTarget(packageSubpath, target, packageJsonUrl, internal, base); +} +function isConditionalExportsMainSugar(exports, packageJsonUrl, base) { + if (typeof exports === 'string' || Array.isArray(exports)) return true; + if (typeof exports !== 'object' || exports === null) return false; + const keys = Object.getOwnPropertyNames(exports); + let isConditionalSugar = false; + let i = 0; + let keyIndex = -1; + while (++keyIndex < keys.length) { + const key = keys[keyIndex]; + const currentIsConditionalSugar = key === '' || key[0] !== '.'; + if (i++ === 0) { + isConditionalSugar = currentIsConditionalSugar; + } else if (isConditionalSugar !== currentIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG((0, _url().fileURLToPath)(packageJsonUrl), base, '"exports" cannot contain some keys starting with \'.\' and some not.' + ' The exports object must either be an object of package subpath keys' + ' or an object of main entry condition name keys only.'); + } + } + return isConditionalSugar; +} +function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { + if (_process().noDeprecation) { + return; + } + const pjsonPath = (0, _url().fileURLToPath)(pjsonUrl); + if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return; + emittedPackageWarnings.add(pjsonPath + '|' + match); + _process().emitWarning(`Use of deprecated trailing slash pattern mapping "${match}" in the ` + `"exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, _url().fileURLToPath)(base)}` : ''}. Mapping specifiers ending in "/" is no longer supported.`, 'DeprecationWarning', 'DEP0155'); +} +function packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions) { + let exports = packageConfig.exports; + if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) { + exports = { + '.': exports + }; + } + if (own.call(exports, packageSubpath) && !packageSubpath.includes('*') && !packageSubpath.endsWith('/')) { + const target = exports[packageSubpath]; + const resolveResult = resolvePackageTarget(packageJsonUrl, target, '', packageSubpath, base, false, false, false, conditions); + if (resolveResult === null || resolveResult === undefined) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + let bestMatch = ''; + let bestMatchSubpath = ''; + const keys = Object.getOwnPropertyNames(exports); + let i = -1; + while (++i < keys.length) { + const key = keys[i]; + const patternIndex = key.indexOf('*'); + if (patternIndex !== -1 && packageSubpath.startsWith(key.slice(0, patternIndex))) { + if (packageSubpath.endsWith('/')) { + emitTrailingSlashPatternDeprecation(packageSubpath, packageJsonUrl, base); + } + const patternTrailer = key.slice(patternIndex + 1); + if (packageSubpath.length >= key.length && packageSubpath.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf('*') === patternIndex) { + bestMatch = key; + bestMatchSubpath = packageSubpath.slice(patternIndex, packageSubpath.length - patternTrailer.length); + } + } + } + if (bestMatch) { + const target = exports[bestMatch]; + const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, false, packageSubpath.endsWith('/'), conditions); + if (resolveResult === null || resolveResult === undefined) { + throw exportsNotFound(packageSubpath, packageJsonUrl, base); + } + return resolveResult; + } + throw exportsNotFound(packageSubpath, packageJsonUrl, base); +} +function patternKeyCompare(a, b) { + const aPatternIndex = a.indexOf('*'); + const bPatternIndex = b.indexOf('*'); + const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; + const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; + if (baseLengthA > baseLengthB) return -1; + if (baseLengthB > baseLengthA) return 1; + if (aPatternIndex === -1) return 1; + if (bPatternIndex === -1) return -1; + if (a.length > b.length) return -1; + if (b.length > a.length) return 1; + return 0; +} +function packageImportsResolve(name, base, conditions) { + if (name === '#' || name.startsWith('#/') || name.endsWith('/')) { + const reason = 'is not a valid internal imports specifier name'; + throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, (0, _url().fileURLToPath)(base)); + } + let packageJsonUrl; + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + packageJsonUrl = (0, _url().pathToFileURL)(packageConfig.pjsonPath); + const imports = packageConfig.imports; + if (imports) { + if (own.call(imports, name) && !name.includes('*')) { + const resolveResult = resolvePackageTarget(packageJsonUrl, imports[name], '', name, base, false, true, false, conditions); + if (resolveResult !== null && resolveResult !== undefined) { + return resolveResult; + } + } else { + let bestMatch = ''; + let bestMatchSubpath = ''; + const keys = Object.getOwnPropertyNames(imports); + let i = -1; + while (++i < keys.length) { + const key = keys[i]; + const patternIndex = key.indexOf('*'); + if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) { + const patternTrailer = key.slice(patternIndex + 1); + if (name.length >= key.length && name.endsWith(patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && key.lastIndexOf('*') === patternIndex) { + bestMatch = key; + bestMatchSubpath = name.slice(patternIndex, name.length - patternTrailer.length); + } + } + } + if (bestMatch) { + const target = imports[bestMatch]; + const resolveResult = resolvePackageTarget(packageJsonUrl, target, bestMatchSubpath, bestMatch, base, true, true, false, conditions); + if (resolveResult !== null && resolveResult !== undefined) { + return resolveResult; + } + } + } + } + } + throw importNotDefined(name, packageJsonUrl, base); +} +function parsePackageName(specifier, base) { + let separatorIndex = specifier.indexOf('/'); + let validPackageName = true; + let isScoped = false; + if (specifier[0] === '@') { + isScoped = true; + if (separatorIndex === -1 || specifier.length === 0) { + validPackageName = false; + } else { + separatorIndex = specifier.indexOf('/', separatorIndex + 1); + } + } + const packageName = separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex); + if (invalidPackageNameRegEx.exec(packageName) !== null) { + validPackageName = false; + } + if (!validPackageName) { + throw new ERR_INVALID_MODULE_SPECIFIER(specifier, 'is not a valid package name', (0, _url().fileURLToPath)(base)); + } + const packageSubpath = '.' + (separatorIndex === -1 ? '' : specifier.slice(separatorIndex)); + return { + packageName, + packageSubpath, + isScoped + }; +} +function packageResolve(specifier, base, conditions) { + if (_module().builtinModules.includes(specifier)) { + return new (_url().URL)('node:' + specifier); + } + const { + packageName, + packageSubpath, + isScoped + } = parsePackageName(specifier, base); + const packageConfig = getPackageScopeConfig(base); + if (packageConfig.exists) { + const packageJsonUrl = (0, _url().pathToFileURL)(packageConfig.pjsonPath); + if (packageConfig.name === packageName && packageConfig.exports !== undefined && packageConfig.exports !== null) { + return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions); + } + } + let packageJsonUrl = new (_url().URL)('./node_modules/' + packageName + '/package.json', base); + let packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl); + let lastPath; + do { + const stat = tryStatSync(packageJsonPath.slice(0, -13)); + if (!stat || !stat.isDirectory()) { + lastPath = packageJsonPath; + packageJsonUrl = new (_url().URL)((isScoped ? '../../../../node_modules/' : '../../../node_modules/') + packageName + '/package.json', packageJsonUrl); + packageJsonPath = (0, _url().fileURLToPath)(packageJsonUrl); + continue; + } + const packageConfig = read(packageJsonPath, { + base, + specifier + }); + if (packageConfig.exports !== undefined && packageConfig.exports !== null) { + return packageExportsResolve(packageJsonUrl, packageSubpath, packageConfig, base, conditions); + } + if (packageSubpath === '.') { + return legacyMainResolve(packageJsonUrl, packageConfig, base); + } + return new (_url().URL)(packageSubpath, packageJsonUrl); + } while (packageJsonPath.length !== lastPath.length); + throw new ERR_MODULE_NOT_FOUND(packageName, (0, _url().fileURLToPath)(base), false); +} +function isRelativeSpecifier(specifier) { + if (specifier[0] === '.') { + if (specifier.length === 1 || specifier[1] === '/') return true; + if (specifier[1] === '.' && (specifier.length === 2 || specifier[2] === '/')) { + return true; + } + } + return false; +} +function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) { + if (specifier === '') return false; + if (specifier[0] === '/') return true; + return isRelativeSpecifier(specifier); +} +function moduleResolve(specifier, base, conditions, preserveSymlinks) { + const protocol = base.protocol; + const isData = protocol === 'data:'; + const isRemote = isData || protocol === 'http:' || protocol === 'https:'; + let resolved; + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + try { + resolved = new (_url().URL)(specifier, base); + } catch (error_) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base); + error.cause = error_; + throw error; + } + } else if (protocol === 'file:' && specifier[0] === '#') { + resolved = packageImportsResolve(specifier, base, conditions); + } else { + try { + resolved = new (_url().URL)(specifier); + } catch (error_) { + if (isRemote && !_module().builtinModules.includes(specifier)) { + const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base); + error.cause = error_; + throw error; + } + resolved = packageResolve(specifier, base, conditions); + } + } + _assert()(resolved !== undefined, 'expected to be defined'); + if (resolved.protocol !== 'file:') { + return resolved; + } + return finalizeResolution(resolved, base, preserveSymlinks); +} +function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { + if (parsedParentURL) { + const parentProtocol = parsedParentURL.protocol; + if (parentProtocol === 'http:' || parentProtocol === 'https:') { + if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { + const parsedProtocol = parsed == null ? void 0 : parsed.protocol; + if (parsedProtocol && parsedProtocol !== 'https:' && parsedProtocol !== 'http:') { + throw new ERR_NETWORK_IMPORT_DISALLOWED(specifier, parsedParentURL, 'remote imports cannot import from a local location.'); + } + return { + url: (parsed == null ? void 0 : parsed.href) || '' + }; + } + if (_module().builtinModules.includes(specifier)) { + throw new ERR_NETWORK_IMPORT_DISALLOWED(specifier, parsedParentURL, 'remote imports cannot import from a local location.'); + } + throw new ERR_NETWORK_IMPORT_DISALLOWED(specifier, parsedParentURL, 'only relative and absolute specifiers are supported.'); + } + } +} +function isURL(self) { + return Boolean(self && typeof self === 'object' && 'href' in self && typeof self.href === 'string' && 'protocol' in self && typeof self.protocol === 'string' && self.href && self.protocol); +} +function throwIfInvalidParentURL(parentURL) { + if (parentURL === undefined) { + return; + } + if (typeof parentURL !== 'string' && !isURL(parentURL)) { + throw new codes.ERR_INVALID_ARG_TYPE('parentURL', ['string', 'URL'], parentURL); + } +} +function defaultResolve(specifier, context = {}) { + const { + parentURL + } = context; + _assert()(parentURL !== undefined, 'expected `parentURL` to be defined'); + throwIfInvalidParentURL(parentURL); + let parsedParentURL; + if (parentURL) { + try { + parsedParentURL = new (_url().URL)(parentURL); + } catch (_unused4) {} + } + let parsed; + let protocol; + try { + parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier) ? new (_url().URL)(specifier, parsedParentURL) : new (_url().URL)(specifier); + protocol = parsed.protocol; + if (protocol === 'data:') { + return { + url: parsed.href, + format: null + }; + } + } catch (_unused5) {} + const maybeReturn = checkIfDisallowedImport(specifier, parsed, parsedParentURL); + if (maybeReturn) return maybeReturn; + if (protocol === undefined && parsed) { + protocol = parsed.protocol; + } + if (protocol === 'node:') { + return { + url: specifier + }; + } + if (parsed && parsed.protocol === 'node:') return { + url: specifier + }; + const conditions = getConditionsSet(context.conditions); + const url = moduleResolve(specifier, new (_url().URL)(parentURL), conditions, false); + return { + url: url.href, + format: defaultGetFormatWithoutErrors(url, { + parentURL + }) + }; +} +function resolve(specifier, parent) { + if (!parent) { + throw new Error('Please pass `parent`: `import-meta-resolve` cannot ponyfill that'); + } + try { + return defaultResolve(specifier, { + parentURL: parent + }).url; + } catch (error) { + const exception = error; + if ((exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' || exception.code === 'ERR_MODULE_NOT_FOUND') && typeof exception.url === 'string') { + return exception.url; + } + throw error; + } +} +0 && 0; + +//# sourceMappingURL=import-meta-resolve.js.map diff --git a/node_modules/@babel/core/lib/vendor/import-meta-resolve.js.map b/node_modules/@babel/core/lib/vendor/import-meta-resolve.js.map new file mode 100644 index 0000000..d9e5b42 --- /dev/null +++ b/node_modules/@babel/core/lib/vendor/import-meta-resolve.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assert","data","require","_fs","_interopRequireWildcard","_process","_url","_path","_module","_v","_util","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","own$1","classRegExp","kTypes","Set","codes","formatList","array","type","length","join","slice","messages","Map","nodeInternalPrefix","userStackTraceLimit","ERR_INVALID_ARG_TYPE","createError","name","expected","actual","assert","Array","isArray","message","endsWith","includes","types","instances","other","value","push","toLowerCase","exec","pos","indexOf","determineSpecificType","TypeError","ERR_INVALID_MODULE_SPECIFIER","request","reason","base","undefined","ERR_INVALID_PACKAGE_CONFIG","path","Error","ERR_INVALID_PACKAGE_TARGET","packagePath","key","target","isImport","relatedError","startsWith","JSON","stringify","ERR_MODULE_NOT_FOUND","exactUrl","ERR_NETWORK_IMPORT_DISALLOWED","ERR_PACKAGE_IMPORT_NOT_DEFINED","specifier","ERR_PACKAGE_PATH_NOT_EXPORTED","subpath","ERR_UNSUPPORTED_DIR_IMPORT","ERR_UNSUPPORTED_RESOLVE_REQUEST","ERR_UNKNOWN_FILE_EXTENSION","extension","ERR_INVALID_ARG_VALUE","inspected","inspect","sym","constructor","makeNodeErrorWithCode","Base","NodeError","parameters","limit","stackTraceLimit","isErrorStackTraceLimitWritable","error","getMessage","defineProperties","enumerable","writable","configurable","toString","captureLargerStackTrace","code","v8","startupSnapshot","isBuildingSnapshot","_unused","desc","isExtensible","hideStackFrames","wrappedFunction","hidden","stackTraceLimitIsWritable","Number","POSITIVE_INFINITY","captureStackTrace","self","Reflect","apply","regex","expectedLength","unshift","format","String","depth","colors","hasOwnProperty$1","ERR_INVALID_PACKAGE_CONFIG$1","cache","read","jsonPath","existing","string","fs","readFileSync","toNamespacedPath","exception","result","exists","pjsonPath","main","exports","imports","parsed","parse","error_","cause","fileURLToPath","getPackageScopeConfig","resolved","packageJSONUrl","URL","packageJSONPath","pathname","packageConfig","lastPackageJSONUrl","getPackageType","url","extensionFormatMap","mimeToFormat","mime","test","protocolHandlers","getDataProtocolModuleFormat","getFileProtocolModuleFormat","getHttpProtocolModuleFormat","node:","extname","index","codePointAt","_context","ignoreErrors","packageType","filepath","defaultGetFormatWithoutErrors","context","protocol","DEFAULT_CONDITIONS","freeze","DEFAULT_CONDITIONS_SET","getDefaultConditions","getDefaultConditionsSet","getConditionsSet","conditions","RegExpPrototypeSymbolReplace","RegExp","prototype","Symbol","replace","own","invalidSegmentRegEx","deprecatedInvalidSegmentRegEx","invalidPackageNameRegEx","patternRegEx","encodedSeparatorRegEx","emittedPackageWarnings","doubleSlashRegEx","emitInvalidSegmentDeprecation","match","packageJsonUrl","internal","isTarget","process","noDeprecation","double","emitWarning","emitLegacyIndexDeprecation","parentURL","href","urlPath","URL$1","basePath","resolve","tryStatSync","statSync","_unused2","fileExists","stats","throwIfNoEntry","isFile","legacyMainResolve","guess","tries","finalizeResolution","preserveSymlinks","filePath","isDirectory","real","realpathSync","search","hash","pathToFileURL","sep","importNotDefined","exportsNotFound","throwInvalidSubpath","invalidPackageTarget","resolvePackageTargetString","pattern","isPathMap","isURL","_unused3","exportTarget","packageResolve","resolvedTarget","resolvedPath","isArrayIndex","keyNumber","resolvePackageTarget","packageSubpath","targetList","lastException","targetItem","resolveResult","keys","getOwnPropertyNames","conditionalTarget","isConditionalExportsMainSugar","isConditionalSugar","keyIndex","currentIsConditionalSugar","emitTrailingSlashPatternDeprecation","pjsonUrl","add","packageExportsResolve","bestMatch","bestMatchSubpath","patternIndex","patternTrailer","patternKeyCompare","lastIndexOf","a","b","aPatternIndex","bPatternIndex","baseLengthA","baseLengthB","packageImportsResolve","parsePackageName","separatorIndex","validPackageName","isScoped","packageName","builtinModules","packageJsonPath","lastPath","stat","isRelativeSpecifier","shouldBeTreatedAsRelativeOrAbsolutePath","moduleResolve","isData","isRemote","checkIfDisallowedImport","parsedParentURL","parentProtocol","parsedProtocol","Boolean","throwIfInvalidParentURL","defaultResolve","_unused4","_unused5","maybeReturn","parent"],"sources":["../../src/vendor/import-meta-resolve.js"],"sourcesContent":["\n/****************************************************************************\\\n * NOTE FROM BABEL AUTHORS *\n * This file is inlined from https://github.com/wooorm/import-meta-resolve, *\n * because we need to compile it to CommonJS. *\n\\****************************************************************************/\n\n/*\n(The MIT License)\n\nCopyright (c) 2021 Titus Wormer \n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---\n\nThis is a derivative work based on:\n.\nWhich is licensed:\n\n\"\"\"\nCopyright Node.js contributors. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\"\"\"\n\nThis license applies to parts of Node.js originating from the\nhttps://github.com/joyent/node repository:\n\n\"\"\"\nCopyright Joyent, Inc. and other Node contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\"\"\"\n*/\n\nimport assert from 'assert';\nimport fs, { realpathSync, statSync } from 'fs';\nimport process from 'process';\nimport { fileURLToPath, URL as URL$1, pathToFileURL } from 'url';\nimport path from 'path';\nimport { builtinModules } from 'module';\nimport v8 from 'v8';\nimport { format, inspect } from 'util';\n\n/**\n * @typedef ErrnoExceptionFields\n * @property {number | undefined} [errnode]\n * @property {string | undefined} [code]\n * @property {string | undefined} [path]\n * @property {string | undefined} [syscall]\n * @property {string | undefined} [url]\n *\n * @typedef {Error & ErrnoExceptionFields} ErrnoException\n */\n\n\nconst own$1 = {}.hasOwnProperty;\n\nconst classRegExp = /^([A-Z][a-z\\d]*)+$/;\n// Sorted by a rough estimate on most frequently used entries.\nconst kTypes = new Set([\n 'string',\n 'function',\n 'number',\n 'object',\n // Accept 'Function' and 'Object' as alternative to the lower cased version.\n 'Function',\n 'Object',\n 'boolean',\n 'bigint',\n 'symbol'\n]);\n\nconst codes = {};\n\n/**\n * Create a list string in the form like 'A and B' or 'A, B, ..., and Z'.\n * We cannot use Intl.ListFormat because it's not available in\n * --without-intl builds.\n *\n * @param {Array} array\n * An array of strings.\n * @param {string} [type]\n * The list type to be inserted before the last element.\n * @returns {string}\n */\nfunction formatList(array, type = 'and') {\n return array.length < 3\n ? array.join(` ${type} `)\n : `${array.slice(0, -1).join(', ')}, ${type} ${array[array.length - 1]}`\n}\n\n/** @type {Map} */\nconst messages = new Map();\nconst nodeInternalPrefix = '__node_internal_';\n/** @type {number} */\nlet userStackTraceLimit;\n\ncodes.ERR_INVALID_ARG_TYPE = createError(\n 'ERR_INVALID_ARG_TYPE',\n /**\n * @param {string} name\n * @param {Array | string} expected\n * @param {unknown} actual\n */\n (name, expected, actual) => {\n assert(typeof name === 'string', \"'name' must be a string\");\n if (!Array.isArray(expected)) {\n expected = [expected];\n }\n\n let message = 'The ';\n if (name.endsWith(' argument')) {\n // For cases like 'first argument'\n message += `${name} `;\n } else {\n const type = name.includes('.') ? 'property' : 'argument';\n message += `\"${name}\" ${type} `;\n }\n\n message += 'must be ';\n\n /** @type {Array} */\n const types = [];\n /** @type {Array} */\n const instances = [];\n /** @type {Array} */\n const other = [];\n\n for (const value of expected) {\n assert(\n typeof value === 'string',\n 'All expected entries have to be of type string'\n );\n\n if (kTypes.has(value)) {\n types.push(value.toLowerCase());\n } else if (classRegExp.exec(value) === null) {\n assert(\n value !== 'object',\n 'The value \"object\" should be written as \"Object\"'\n );\n other.push(value);\n } else {\n instances.push(value);\n }\n }\n\n // Special handle `object` in case other instances are allowed to outline\n // the differences between each other.\n if (instances.length > 0) {\n const pos = types.indexOf('object');\n if (pos !== -1) {\n types.slice(pos, 1);\n instances.push('Object');\n }\n }\n\n if (types.length > 0) {\n message += `${types.length > 1 ? 'one of type' : 'of type'} ${formatList(\n types,\n 'or'\n )}`;\n if (instances.length > 0 || other.length > 0) message += ' or ';\n }\n\n if (instances.length > 0) {\n message += `an instance of ${formatList(instances, 'or')}`;\n if (other.length > 0) message += ' or ';\n }\n\n if (other.length > 0) {\n if (other.length > 1) {\n message += `one of ${formatList(other, 'or')}`;\n } else {\n if (other[0].toLowerCase() !== other[0]) message += 'an ';\n message += `${other[0]}`;\n }\n }\n\n message += `. Received ${determineSpecificType(actual)}`;\n\n return message\n },\n TypeError\n);\n\ncodes.ERR_INVALID_MODULE_SPECIFIER = createError(\n 'ERR_INVALID_MODULE_SPECIFIER',\n /**\n * @param {string} request\n * @param {string} reason\n * @param {string} [base]\n */\n (request, reason, base = undefined) => {\n return `Invalid module \"${request}\" ${reason}${\n base ? ` imported from ${base}` : ''\n }`\n },\n TypeError\n);\n\ncodes.ERR_INVALID_PACKAGE_CONFIG = createError(\n 'ERR_INVALID_PACKAGE_CONFIG',\n /**\n * @param {string} path\n * @param {string} [base]\n * @param {string} [message]\n */\n (path, base, message) => {\n return `Invalid package config ${path}${\n base ? ` while importing ${base}` : ''\n }${message ? `. ${message}` : ''}`\n },\n Error\n);\n\ncodes.ERR_INVALID_PACKAGE_TARGET = createError(\n 'ERR_INVALID_PACKAGE_TARGET',\n /**\n * @param {string} packagePath\n * @param {string} key\n * @param {unknown} target\n * @param {boolean} [isImport=false]\n * @param {string} [base]\n */\n (packagePath, key, target, isImport = false, base = undefined) => {\n const relatedError =\n typeof target === 'string' &&\n !isImport &&\n target.length > 0 &&\n !target.startsWith('./');\n if (key === '.') {\n assert(isImport === false);\n return (\n `Invalid \"exports\" main target ${JSON.stringify(target)} defined ` +\n `in the package config ${packagePath}package.json${\n base ? ` imported from ${base}` : ''\n }${relatedError ? '; targets must start with \"./\"' : ''}`\n )\n }\n\n return `Invalid \"${\n isImport ? 'imports' : 'exports'\n }\" target ${JSON.stringify(\n target\n )} defined for '${key}' in the package config ${packagePath}package.json${\n base ? ` imported from ${base}` : ''\n }${relatedError ? '; targets must start with \"./\"' : ''}`\n },\n Error\n);\n\ncodes.ERR_MODULE_NOT_FOUND = createError(\n 'ERR_MODULE_NOT_FOUND',\n /**\n * @param {string} path\n * @param {string} base\n * @param {boolean} [exactUrl]\n */\n (path, base, exactUrl = false) => {\n return `Cannot find ${\n exactUrl ? 'module' : 'package'\n } '${path}' imported from ${base}`\n },\n Error\n);\n\ncodes.ERR_NETWORK_IMPORT_DISALLOWED = createError(\n 'ERR_NETWORK_IMPORT_DISALLOWED',\n \"import of '%s' by %s is not supported: %s\",\n Error\n);\n\ncodes.ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(\n 'ERR_PACKAGE_IMPORT_NOT_DEFINED',\n /**\n * @param {string} specifier\n * @param {string} packagePath\n * @param {string} base\n */\n (specifier, packagePath, base) => {\n return `Package import specifier \"${specifier}\" is not defined${\n packagePath ? ` in package ${packagePath}package.json` : ''\n } imported from ${base}`\n },\n TypeError\n);\n\ncodes.ERR_PACKAGE_PATH_NOT_EXPORTED = createError(\n 'ERR_PACKAGE_PATH_NOT_EXPORTED',\n /**\n * @param {string} packagePath\n * @param {string} subpath\n * @param {string} [base]\n */\n (packagePath, subpath, base = undefined) => {\n if (subpath === '.')\n return `No \"exports\" main defined in ${packagePath}package.json${\n base ? ` imported from ${base}` : ''\n }`\n return `Package subpath '${subpath}' is not defined by \"exports\" in ${packagePath}package.json${\n base ? ` imported from ${base}` : ''\n }`\n },\n Error\n);\n\ncodes.ERR_UNSUPPORTED_DIR_IMPORT = createError(\n 'ERR_UNSUPPORTED_DIR_IMPORT',\n \"Directory import '%s' is not supported \" +\n 'resolving ES modules imported from %s',\n Error\n);\n\ncodes.ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(\n 'ERR_UNSUPPORTED_RESOLVE_REQUEST',\n 'Failed to resolve module specifier \"%s\" from \"%s\": Invalid relative URL or base scheme is not hierarchical.',\n TypeError\n);\n\ncodes.ERR_UNKNOWN_FILE_EXTENSION = createError(\n 'ERR_UNKNOWN_FILE_EXTENSION',\n /**\n * @param {string} extension\n * @param {string} path\n */\n (extension, path) => {\n return `Unknown file extension \"${extension}\" for ${path}`\n },\n TypeError\n);\n\ncodes.ERR_INVALID_ARG_VALUE = createError(\n 'ERR_INVALID_ARG_VALUE',\n /**\n * @param {string} name\n * @param {unknown} value\n * @param {string} [reason='is invalid']\n */\n (name, value, reason = 'is invalid') => {\n let inspected = inspect(value);\n\n if (inspected.length > 128) {\n inspected = `${inspected.slice(0, 128)}...`;\n }\n\n const type = name.includes('.') ? 'property' : 'argument';\n\n return `The ${type} '${name}' ${reason}. Received ${inspected}`\n },\n TypeError\n // Note: extra classes have been shaken out.\n // , RangeError\n);\n\n/**\n * Utility function for registering the error codes. Only used here. Exported\n * *only* to allow for testing.\n * @param {string} sym\n * @param {MessageFunction | string} value\n * @param {ErrorConstructor} constructor\n * @returns {new (...parameters: Array) => Error}\n */\nfunction createError(sym, value, constructor) {\n // Special case for SystemError that formats the error message differently\n // The SystemErrors only have SystemError as their base classes.\n messages.set(sym, value);\n\n return makeNodeErrorWithCode(constructor, sym)\n}\n\n/**\n * @param {ErrorConstructor} Base\n * @param {string} key\n * @returns {ErrorConstructor}\n */\nfunction makeNodeErrorWithCode(Base, key) {\n // @ts-expect-error It’s a Node error.\n return NodeError\n /**\n * @param {Array} parameters\n */\n function NodeError(...parameters) {\n const limit = Error.stackTraceLimit;\n if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;\n const error = new Base();\n // Reset the limit and setting the name property.\n if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;\n const message = getMessage(key, parameters, error);\n Object.defineProperties(error, {\n // Note: no need to implement `kIsNodeError` symbol, would be hard,\n // probably.\n message: {\n value: message,\n enumerable: false,\n writable: true,\n configurable: true\n },\n toString: {\n /** @this {Error} */\n value() {\n return `${this.name} [${key}]: ${this.message}`\n },\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n captureLargerStackTrace(error);\n // @ts-expect-error It’s a Node error.\n error.code = key;\n return error\n }\n}\n\n/**\n * @returns {boolean}\n */\nfunction isErrorStackTraceLimitWritable() {\n // Do no touch Error.stackTraceLimit as V8 would attempt to install\n // it again during deserialization.\n try {\n if (v8.startupSnapshot.isBuildingSnapshot()) {\n return false\n }\n } catch {}\n\n const desc = Object.getOwnPropertyDescriptor(Error, 'stackTraceLimit');\n if (desc === undefined) {\n return Object.isExtensible(Error)\n }\n\n return own$1.call(desc, 'writable') && desc.writable !== undefined\n ? desc.writable\n : desc.set !== undefined\n}\n\n/**\n * This function removes unnecessary frames from Node.js core errors.\n * @template {(...parameters: unknown[]) => unknown} T\n * @param {T} wrappedFunction\n * @returns {T}\n */\nfunction hideStackFrames(wrappedFunction) {\n // We rename the functions that will be hidden to cut off the stacktrace\n // at the outermost one\n const hidden = nodeInternalPrefix + wrappedFunction.name;\n Object.defineProperty(wrappedFunction, 'name', {value: hidden});\n return wrappedFunction\n}\n\nconst captureLargerStackTrace = hideStackFrames(\n /**\n * @param {Error} error\n * @returns {Error}\n */\n // @ts-expect-error: fine\n function (error) {\n const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();\n if (stackTraceLimitIsWritable) {\n userStackTraceLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = Number.POSITIVE_INFINITY;\n }\n\n Error.captureStackTrace(error);\n\n // Reset the limit\n if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;\n\n return error\n }\n);\n\n/**\n * @param {string} key\n * @param {Array} parameters\n * @param {Error} self\n * @returns {string}\n */\nfunction getMessage(key, parameters, self) {\n const message = messages.get(key);\n assert(message !== undefined, 'expected `message` to be found');\n\n if (typeof message === 'function') {\n assert(\n message.length <= parameters.length, // Default options do not count.\n `Code: ${key}; The provided arguments length (${parameters.length}) does not ` +\n `match the required ones (${message.length}).`\n );\n return Reflect.apply(message, self, parameters)\n }\n\n const regex = /%[dfijoOs]/g;\n let expectedLength = 0;\n while (regex.exec(message) !== null) expectedLength++;\n assert(\n expectedLength === parameters.length,\n `Code: ${key}; The provided arguments length (${parameters.length}) does not ` +\n `match the required ones (${expectedLength}).`\n );\n if (parameters.length === 0) return message\n\n parameters.unshift(message);\n return Reflect.apply(format, null, parameters)\n}\n\n/**\n * Determine the specific type of a value for type-mismatch errors.\n * @param {unknown} value\n * @returns {string}\n */\nfunction determineSpecificType(value) {\n if (value === null || value === undefined) {\n return String(value)\n }\n\n if (typeof value === 'function' && value.name) {\n return `function ${value.name}`\n }\n\n if (typeof value === 'object') {\n if (value.constructor && value.constructor.name) {\n return `an instance of ${value.constructor.name}`\n }\n\n return `${inspect(value, {depth: -1})}`\n }\n\n let inspected = inspect(value, {colors: false});\n\n if (inspected.length > 28) {\n inspected = `${inspected.slice(0, 25)}...`;\n }\n\n return `type ${typeof value} (${inspected})`\n}\n\n// Manually “tree shaken” from:\n// \n// Last checked on: Apr 29, 2023.\n// Removed the native dependency.\n// Also: no need to cache, we do that in resolve already.\n\n\nconst hasOwnProperty$1 = {}.hasOwnProperty;\n\nconst {ERR_INVALID_PACKAGE_CONFIG: ERR_INVALID_PACKAGE_CONFIG$1} = codes;\n\n/** @type {Map} */\nconst cache = new Map();\n\n/**\n * @param {string} jsonPath\n * @param {{specifier: URL | string, base?: URL}} options\n * @returns {PackageConfig}\n */\nfunction read(jsonPath, {base, specifier}) {\n const existing = cache.get(jsonPath);\n\n if (existing) {\n return existing\n }\n\n /** @type {string | undefined} */\n let string;\n\n try {\n string = fs.readFileSync(path.toNamespacedPath(jsonPath), 'utf8');\n } catch (error) {\n const exception = /** @type {ErrnoException} */ (error);\n\n if (exception.code !== 'ENOENT') {\n throw exception\n }\n }\n\n /** @type {PackageConfig} */\n const result = {\n exists: false,\n pjsonPath: jsonPath,\n main: undefined,\n name: undefined,\n type: 'none', // Ignore unknown types for forwards compatibility\n exports: undefined,\n imports: undefined\n };\n\n if (string !== undefined) {\n /** @type {Record} */\n let parsed;\n\n try {\n parsed = JSON.parse(string);\n } catch (error_) {\n const cause = /** @type {ErrnoException} */ (error_);\n const error = new ERR_INVALID_PACKAGE_CONFIG$1(\n jsonPath,\n (base ? `\"${specifier}\" from ` : '') + fileURLToPath(base || specifier),\n cause.message\n );\n error.cause = cause;\n throw error\n }\n\n result.exists = true;\n\n if (\n hasOwnProperty$1.call(parsed, 'name') &&\n typeof parsed.name === 'string'\n ) {\n result.name = parsed.name;\n }\n\n if (\n hasOwnProperty$1.call(parsed, 'main') &&\n typeof parsed.main === 'string'\n ) {\n result.main = parsed.main;\n }\n\n if (hasOwnProperty$1.call(parsed, 'exports')) {\n // @ts-expect-error: assume valid.\n result.exports = parsed.exports;\n }\n\n if (hasOwnProperty$1.call(parsed, 'imports')) {\n // @ts-expect-error: assume valid.\n result.imports = parsed.imports;\n }\n\n // Ignore unknown types for forwards compatibility\n if (\n hasOwnProperty$1.call(parsed, 'type') &&\n (parsed.type === 'commonjs' || parsed.type === 'module')\n ) {\n result.type = parsed.type;\n }\n }\n\n cache.set(jsonPath, result);\n\n return result\n}\n\n/**\n * @param {URL | string} resolved\n * @returns {PackageConfig}\n */\nfunction getPackageScopeConfig(resolved) {\n // Note: in Node, this is now a native module.\n let packageJSONUrl = new URL('package.json', resolved);\n\n while (true) {\n const packageJSONPath = packageJSONUrl.pathname;\n if (packageJSONPath.endsWith('node_modules/package.json')) {\n break\n }\n\n const packageConfig = read(fileURLToPath(packageJSONUrl), {\n specifier: resolved\n });\n\n if (packageConfig.exists) {\n return packageConfig\n }\n\n const lastPackageJSONUrl = packageJSONUrl;\n packageJSONUrl = new URL('../package.json', packageJSONUrl);\n\n // Terminates at root where ../package.json equals ../../package.json\n // (can't just check \"/package.json\" for Windows support).\n if (packageJSONUrl.pathname === lastPackageJSONUrl.pathname) {\n break\n }\n }\n\n const packageJSONPath = fileURLToPath(packageJSONUrl);\n // ^^ Note: in Node, this is now a native module.\n\n return {\n pjsonPath: packageJSONPath,\n exists: false,\n type: 'none'\n }\n}\n\n/**\n * Returns the package type for a given URL.\n * @param {URL} url - The URL to get the package type for.\n * @returns {PackageType}\n */\nfunction getPackageType(url) {\n // To do @anonrig: Write a C++ function that returns only \"type\".\n return getPackageScopeConfig(url).type\n}\n\n// Manually “tree shaken” from:\n// \n// Last checked on: Apr 29, 2023.\n\n\nconst {ERR_UNKNOWN_FILE_EXTENSION} = codes;\n\nconst hasOwnProperty = {}.hasOwnProperty;\n\n/** @type {Record} */\nconst extensionFormatMap = {\n // @ts-expect-error: hush.\n __proto__: null,\n '.cjs': 'commonjs',\n '.js': 'module',\n '.json': 'json',\n '.mjs': 'module'\n};\n\n/**\n * @param {string | null} mime\n * @returns {string | null}\n */\nfunction mimeToFormat(mime) {\n if (\n mime &&\n /\\s*(text|application)\\/javascript\\s*(;\\s*charset=utf-?8\\s*)?/i.test(mime)\n )\n return 'module'\n if (mime === 'application/json') return 'json'\n return null\n}\n\n/**\n * @callback ProtocolHandler\n * @param {URL} parsed\n * @param {{parentURL: string, source?: Buffer}} context\n * @param {boolean} ignoreErrors\n * @returns {string | null | void}\n */\n\n/**\n * @type {Record}\n */\nconst protocolHandlers = {\n // @ts-expect-error: hush.\n __proto__: null,\n 'data:': getDataProtocolModuleFormat,\n 'file:': getFileProtocolModuleFormat,\n 'http:': getHttpProtocolModuleFormat,\n 'https:': getHttpProtocolModuleFormat,\n 'node:'() {\n return 'builtin'\n }\n};\n\n/**\n * @param {URL} parsed\n */\nfunction getDataProtocolModuleFormat(parsed) {\n const {1: mime} = /^([^/]+\\/[^;,]+)[^,]*?(;base64)?,/.exec(\n parsed.pathname\n ) || [null, null, null];\n return mimeToFormat(mime)\n}\n\n/**\n * Returns the file extension from a URL.\n *\n * Should give similar result to\n * `require('node:path').extname(require('node:url').fileURLToPath(url))`\n * when used with a `file:` URL.\n *\n * @param {URL} url\n * @returns {string}\n */\nfunction extname(url) {\n const pathname = url.pathname;\n let index = pathname.length;\n\n while (index--) {\n const code = pathname.codePointAt(index);\n\n if (code === 47 /* `/` */) {\n return ''\n }\n\n if (code === 46 /* `.` */) {\n return pathname.codePointAt(index - 1) === 47 /* `/` */\n ? ''\n : pathname.slice(index)\n }\n }\n\n return ''\n}\n\n/**\n * @type {ProtocolHandler}\n */\nfunction getFileProtocolModuleFormat(url, _context, ignoreErrors) {\n const value = extname(url);\n\n if (value === '.js') {\n const packageType = getPackageType(url);\n\n if (packageType !== 'none') {\n return packageType\n }\n\n return 'commonjs'\n }\n\n if (value === '') {\n const packageType = getPackageType(url);\n\n // Legacy behavior\n if (packageType === 'none' || packageType === 'commonjs') {\n return 'commonjs'\n }\n\n // Note: we don’t implement WASM, so we don’t need\n // `getFormatOfExtensionlessFile` from `formats`.\n return 'module'\n }\n\n const format = extensionFormatMap[value];\n if (format) return format\n\n // Explicit undefined return indicates load hook should rerun format check\n if (ignoreErrors) {\n return undefined\n }\n\n const filepath = fileURLToPath(url);\n throw new ERR_UNKNOWN_FILE_EXTENSION(value, filepath)\n}\n\nfunction getHttpProtocolModuleFormat() {\n // To do: HTTPS imports.\n}\n\n/**\n * @param {URL} url\n * @param {{parentURL: string}} context\n * @returns {string | null}\n */\nfunction defaultGetFormatWithoutErrors(url, context) {\n const protocol = url.protocol;\n\n if (!hasOwnProperty.call(protocolHandlers, protocol)) {\n return null\n }\n\n return protocolHandlers[protocol](url, context, true) || null\n}\n\n// Manually “tree shaken” from:\n// \n// Last checked on: Apr 29, 2023.\n\n\nconst {ERR_INVALID_ARG_VALUE} = codes;\n\n// In Node itself these values are populated from CLI arguments, before any\n// user code runs.\n// Here we just define the defaults.\nconst DEFAULT_CONDITIONS = Object.freeze(['node', 'import']);\nconst DEFAULT_CONDITIONS_SET = new Set(DEFAULT_CONDITIONS);\n\n/**\n * Returns the default conditions for ES module loading.\n */\nfunction getDefaultConditions() {\n return DEFAULT_CONDITIONS\n}\n\n/**\n * Returns the default conditions for ES module loading, as a Set.\n */\nfunction getDefaultConditionsSet() {\n return DEFAULT_CONDITIONS_SET\n}\n\n/**\n * @param {Array} [conditions]\n * @returns {Set}\n */\nfunction getConditionsSet(conditions) {\n if (conditions !== undefined && conditions !== getDefaultConditions()) {\n if (!Array.isArray(conditions)) {\n throw new ERR_INVALID_ARG_VALUE(\n 'conditions',\n conditions,\n 'expected an array'\n )\n }\n\n return new Set(conditions)\n }\n\n return getDefaultConditionsSet()\n}\n\n// Manually “tree shaken” from:\n// \n// Last checked on: Apr 29, 2023.\n\n\nconst RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];\n\nconst {\n ERR_NETWORK_IMPORT_DISALLOWED,\n ERR_INVALID_MODULE_SPECIFIER,\n ERR_INVALID_PACKAGE_CONFIG,\n ERR_INVALID_PACKAGE_TARGET,\n ERR_MODULE_NOT_FOUND,\n ERR_PACKAGE_IMPORT_NOT_DEFINED,\n ERR_PACKAGE_PATH_NOT_EXPORTED,\n ERR_UNSUPPORTED_DIR_IMPORT,\n ERR_UNSUPPORTED_RESOLVE_REQUEST\n} = codes;\n\nconst own = {}.hasOwnProperty;\n\nconst invalidSegmentRegEx =\n /(^|\\\\|\\/)((\\.|%2e)(\\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\\\|\\/|$)/i;\nconst deprecatedInvalidSegmentRegEx =\n /(^|\\\\|\\/)((\\.|%2e)(\\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\\\|\\/|$)/i;\nconst invalidPackageNameRegEx = /^\\.|%|\\\\/;\nconst patternRegEx = /\\*/g;\nconst encodedSeparatorRegEx = /%2f|%5c/i;\n/** @type {Set} */\nconst emittedPackageWarnings = new Set();\n\nconst doubleSlashRegEx = /[/\\\\]{2}/;\n\n/**\n *\n * @param {string} target\n * @param {string} request\n * @param {string} match\n * @param {URL} packageJsonUrl\n * @param {boolean} internal\n * @param {URL} base\n * @param {boolean} isTarget\n */\nfunction emitInvalidSegmentDeprecation(\n target,\n request,\n match,\n packageJsonUrl,\n internal,\n base,\n isTarget\n) {\n // @ts-expect-error: apparently it does exist, TS.\n if (process.noDeprecation) {\n return\n }\n\n const pjsonPath = fileURLToPath(packageJsonUrl);\n const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;\n process.emitWarning(\n `Use of deprecated ${\n double ? 'double slash' : 'leading or trailing slash matching'\n } resolving \"${target}\" for module ` +\n `request \"${request}\" ${\n request === match ? '' : `matched to \"${match}\" `\n }in the \"${\n internal ? 'imports' : 'exports'\n }\" field module resolution of the package at ${pjsonPath}${\n base ? ` imported from ${fileURLToPath(base)}` : ''\n }.`,\n 'DeprecationWarning',\n 'DEP0166'\n );\n}\n\n/**\n * @param {URL} url\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @param {string} [main]\n * @returns {void}\n */\nfunction emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {\n // @ts-expect-error: apparently it does exist, TS.\n if (process.noDeprecation) {\n return\n }\n\n const format = defaultGetFormatWithoutErrors(url, {parentURL: base.href});\n if (format !== 'module') return\n const urlPath = fileURLToPath(url.href);\n const packagePath = fileURLToPath(new URL$1('.', packageJsonUrl));\n const basePath = fileURLToPath(base);\n if (!main) {\n process.emitWarning(\n `No \"main\" or \"exports\" field defined in the package.json for ${packagePath} resolving the main entry point \"${urlPath.slice(\n packagePath.length\n )}\", imported from ${basePath}.\\nDefault \"index\" lookups for the main are deprecated for ES modules.`,\n 'DeprecationWarning',\n 'DEP0151'\n );\n } else if (path.resolve(packagePath, main) !== urlPath) {\n process.emitWarning(\n `Package ${packagePath} has a \"main\" field set to \"${main}\", ` +\n `excluding the full filename and extension to the resolved file at \"${urlPath.slice(\n packagePath.length\n )}\", imported from ${basePath}.\\n Automatic extension resolution of the \"main\" field is ` +\n 'deprecated for ES modules.',\n 'DeprecationWarning',\n 'DEP0151'\n );\n }\n}\n\n/**\n * @param {string} path\n * @returns {Stats | undefined}\n */\nfunction tryStatSync(path) {\n // Note: from Node 15 onwards we can use `throwIfNoEntry: false` instead.\n try {\n return statSync(path)\n } catch {\n // Note: in Node code this returns `new Stats`,\n // but in Node 22 that’s marked as a deprecated internal API.\n // Which, well, we kinda are, but still to prevent that warning,\n // just yield `undefined`.\n }\n}\n\n/**\n * Legacy CommonJS main resolution:\n * 1. let M = pkg_url + (json main field)\n * 2. TRY(M, M.js, M.json, M.node)\n * 3. TRY(M/index.js, M/index.json, M/index.node)\n * 4. TRY(pkg_url/index.js, pkg_url/index.json, pkg_url/index.node)\n * 5. NOT_FOUND\n *\n * @param {URL} url\n * @returns {boolean}\n */\nfunction fileExists(url) {\n const stats = statSync(url, {throwIfNoEntry: false});\n const isFile = stats ? stats.isFile() : undefined;\n return isFile === null || isFile === undefined ? false : isFile\n}\n\n/**\n * @param {URL} packageJsonUrl\n * @param {PackageConfig} packageConfig\n * @param {URL} base\n * @returns {URL}\n */\nfunction legacyMainResolve(packageJsonUrl, packageConfig, base) {\n /** @type {URL | undefined} */\n let guess;\n if (packageConfig.main !== undefined) {\n guess = new URL$1(packageConfig.main, packageJsonUrl);\n // Note: fs check redundances will be handled by Descriptor cache here.\n if (fileExists(guess)) return guess\n\n const tries = [\n `./${packageConfig.main}.js`,\n `./${packageConfig.main}.json`,\n `./${packageConfig.main}.node`,\n `./${packageConfig.main}/index.js`,\n `./${packageConfig.main}/index.json`,\n `./${packageConfig.main}/index.node`\n ];\n let i = -1;\n\n while (++i < tries.length) {\n guess = new URL$1(tries[i], packageJsonUrl);\n if (fileExists(guess)) break\n guess = undefined;\n }\n\n if (guess) {\n emitLegacyIndexDeprecation(\n guess,\n packageJsonUrl,\n base,\n packageConfig.main\n );\n return guess\n }\n // Fallthrough.\n }\n\n const tries = ['./index.js', './index.json', './index.node'];\n let i = -1;\n\n while (++i < tries.length) {\n guess = new URL$1(tries[i], packageJsonUrl);\n if (fileExists(guess)) break\n guess = undefined;\n }\n\n if (guess) {\n emitLegacyIndexDeprecation(guess, packageJsonUrl, base, packageConfig.main);\n return guess\n }\n\n // Not found.\n throw new ERR_MODULE_NOT_FOUND(\n fileURLToPath(new URL$1('.', packageJsonUrl)),\n fileURLToPath(base)\n )\n}\n\n/**\n * @param {URL} resolved\n * @param {URL} base\n * @param {boolean} [preserveSymlinks]\n * @returns {URL}\n */\nfunction finalizeResolution(resolved, base, preserveSymlinks) {\n if (encodedSeparatorRegEx.exec(resolved.pathname) !== null) {\n throw new ERR_INVALID_MODULE_SPECIFIER(\n resolved.pathname,\n 'must not include encoded \"/\" or \"\\\\\" characters',\n fileURLToPath(base)\n )\n }\n\n /** @type {string} */\n let filePath;\n\n try {\n filePath = fileURLToPath(resolved);\n } catch (error) {\n const cause = /** @type {ErrnoException} */ (error);\n Object.defineProperty(cause, 'input', {value: String(resolved)});\n Object.defineProperty(cause, 'module', {value: String(base)});\n throw cause\n }\n\n const stats = tryStatSync(\n filePath.endsWith('/') ? filePath.slice(-1) : filePath\n );\n\n if (stats && stats.isDirectory()) {\n const error = new ERR_UNSUPPORTED_DIR_IMPORT(filePath, fileURLToPath(base));\n // @ts-expect-error Add this for `import.meta.resolve`.\n error.url = String(resolved);\n throw error\n }\n\n if (!stats || !stats.isFile()) {\n const error = new ERR_MODULE_NOT_FOUND(\n filePath || resolved.pathname,\n base && fileURLToPath(base),\n true\n );\n // @ts-expect-error Add this for `import.meta.resolve`.\n error.url = String(resolved);\n throw error\n }\n\n if (!preserveSymlinks) {\n const real = realpathSync(filePath);\n const {search, hash} = resolved;\n resolved = pathToFileURL(real + (filePath.endsWith(path.sep) ? '/' : ''));\n resolved.search = search;\n resolved.hash = hash;\n }\n\n return resolved\n}\n\n/**\n * @param {string} specifier\n * @param {URL | undefined} packageJsonUrl\n * @param {URL} base\n * @returns {Error}\n */\nfunction importNotDefined(specifier, packageJsonUrl, base) {\n return new ERR_PACKAGE_IMPORT_NOT_DEFINED(\n specifier,\n packageJsonUrl && fileURLToPath(new URL$1('.', packageJsonUrl)),\n fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} subpath\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @returns {Error}\n */\nfunction exportsNotFound(subpath, packageJsonUrl, base) {\n return new ERR_PACKAGE_PATH_NOT_EXPORTED(\n fileURLToPath(new URL$1('.', packageJsonUrl)),\n subpath,\n base && fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} request\n * @param {string} match\n * @param {URL} packageJsonUrl\n * @param {boolean} internal\n * @param {URL} [base]\n * @returns {never}\n */\nfunction throwInvalidSubpath(request, match, packageJsonUrl, internal, base) {\n const reason = `request is not a valid match in pattern \"${match}\" for the \"${\n internal ? 'imports' : 'exports'\n }\" resolution of ${fileURLToPath(packageJsonUrl)}`;\n throw new ERR_INVALID_MODULE_SPECIFIER(\n request,\n reason,\n base && fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} subpath\n * @param {unknown} target\n * @param {URL} packageJsonUrl\n * @param {boolean} internal\n * @param {URL} [base]\n * @returns {Error}\n */\nfunction invalidPackageTarget(subpath, target, packageJsonUrl, internal, base) {\n target =\n typeof target === 'object' && target !== null\n ? JSON.stringify(target, null, '')\n : `${target}`;\n\n return new ERR_INVALID_PACKAGE_TARGET(\n fileURLToPath(new URL$1('.', packageJsonUrl)),\n subpath,\n target,\n internal,\n base && fileURLToPath(base)\n )\n}\n\n/**\n * @param {string} target\n * @param {string} subpath\n * @param {string} match\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @param {boolean} pattern\n * @param {boolean} internal\n * @param {boolean} isPathMap\n * @param {Set | undefined} conditions\n * @returns {URL}\n */\nfunction resolvePackageTargetString(\n target,\n subpath,\n match,\n packageJsonUrl,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n) {\n if (subpath !== '' && !pattern && target[target.length - 1] !== '/')\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n\n if (!target.startsWith('./')) {\n if (internal && !target.startsWith('../') && !target.startsWith('/')) {\n let isURL = false;\n\n try {\n new URL$1(target);\n isURL = true;\n } catch {\n // Continue regardless of error.\n }\n\n if (!isURL) {\n const exportTarget = pattern\n ? RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n target,\n () => subpath\n )\n : target + subpath;\n\n return packageResolve(exportTarget, packageJsonUrl, conditions)\n }\n }\n\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n }\n\n if (invalidSegmentRegEx.exec(target.slice(2)) !== null) {\n if (deprecatedInvalidSegmentRegEx.exec(target.slice(2)) === null) {\n if (!isPathMap) {\n const request = pattern\n ? match.replace('*', () => subpath)\n : match + subpath;\n const resolvedTarget = pattern\n ? RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n target,\n () => subpath\n )\n : target;\n emitInvalidSegmentDeprecation(\n resolvedTarget,\n request,\n match,\n packageJsonUrl,\n internal,\n base,\n true\n );\n }\n } else {\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n }\n }\n\n const resolved = new URL$1(target, packageJsonUrl);\n const resolvedPath = resolved.pathname;\n const packagePath = new URL$1('.', packageJsonUrl).pathname;\n\n if (!resolvedPath.startsWith(packagePath))\n throw invalidPackageTarget(match, target, packageJsonUrl, internal, base)\n\n if (subpath === '') return resolved\n\n if (invalidSegmentRegEx.exec(subpath) !== null) {\n const request = pattern\n ? match.replace('*', () => subpath)\n : match + subpath;\n if (deprecatedInvalidSegmentRegEx.exec(subpath) === null) {\n if (!isPathMap) {\n const resolvedTarget = pattern\n ? RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n target,\n () => subpath\n )\n : target;\n emitInvalidSegmentDeprecation(\n resolvedTarget,\n request,\n match,\n packageJsonUrl,\n internal,\n base,\n false\n );\n }\n } else {\n throwInvalidSubpath(request, match, packageJsonUrl, internal, base);\n }\n }\n\n if (pattern) {\n return new URL$1(\n RegExpPrototypeSymbolReplace.call(\n patternRegEx,\n resolved.href,\n () => subpath\n )\n )\n }\n\n return new URL$1(subpath, resolved)\n}\n\n/**\n * @param {string} key\n * @returns {boolean}\n */\nfunction isArrayIndex(key) {\n const keyNumber = Number(key);\n if (`${keyNumber}` !== key) return false\n return keyNumber >= 0 && keyNumber < 0xff_ff_ff_ff\n}\n\n/**\n * @param {URL} packageJsonUrl\n * @param {unknown} target\n * @param {string} subpath\n * @param {string} packageSubpath\n * @param {URL} base\n * @param {boolean} pattern\n * @param {boolean} internal\n * @param {boolean} isPathMap\n * @param {Set | undefined} conditions\n * @returns {URL | null}\n */\nfunction resolvePackageTarget(\n packageJsonUrl,\n target,\n subpath,\n packageSubpath,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n) {\n if (typeof target === 'string') {\n return resolvePackageTargetString(\n target,\n subpath,\n packageSubpath,\n packageJsonUrl,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n )\n }\n\n if (Array.isArray(target)) {\n /** @type {Array} */\n const targetList = target;\n if (targetList.length === 0) return null\n\n /** @type {ErrnoException | null | undefined} */\n let lastException;\n let i = -1;\n\n while (++i < targetList.length) {\n const targetItem = targetList[i];\n /** @type {URL | null} */\n let resolveResult;\n try {\n resolveResult = resolvePackageTarget(\n packageJsonUrl,\n targetItem,\n subpath,\n packageSubpath,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n );\n } catch (error) {\n const exception = /** @type {ErrnoException} */ (error);\n lastException = exception;\n if (exception.code === 'ERR_INVALID_PACKAGE_TARGET') continue\n throw error\n }\n\n if (resolveResult === undefined) continue\n\n if (resolveResult === null) {\n lastException = null;\n continue\n }\n\n return resolveResult\n }\n\n if (lastException === undefined || lastException === null) {\n return null\n }\n\n throw lastException\n }\n\n if (typeof target === 'object' && target !== null) {\n const keys = Object.getOwnPropertyNames(target);\n let i = -1;\n\n while (++i < keys.length) {\n const key = keys[i];\n if (isArrayIndex(key)) {\n throw new ERR_INVALID_PACKAGE_CONFIG(\n fileURLToPath(packageJsonUrl),\n base,\n '\"exports\" cannot contain numeric property keys.'\n )\n }\n }\n\n i = -1;\n\n while (++i < keys.length) {\n const key = keys[i];\n if (key === 'default' || (conditions && conditions.has(key))) {\n // @ts-expect-error: indexable.\n const conditionalTarget = /** @type {unknown} */ (target[key]);\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n conditionalTarget,\n subpath,\n packageSubpath,\n base,\n pattern,\n internal,\n isPathMap,\n conditions\n );\n if (resolveResult === undefined) continue\n return resolveResult\n }\n }\n\n return null\n }\n\n if (target === null) {\n return null\n }\n\n throw invalidPackageTarget(\n packageSubpath,\n target,\n packageJsonUrl,\n internal,\n base\n )\n}\n\n/**\n * @param {unknown} exports\n * @param {URL} packageJsonUrl\n * @param {URL} base\n * @returns {boolean}\n */\nfunction isConditionalExportsMainSugar(exports, packageJsonUrl, base) {\n if (typeof exports === 'string' || Array.isArray(exports)) return true\n if (typeof exports !== 'object' || exports === null) return false\n\n const keys = Object.getOwnPropertyNames(exports);\n let isConditionalSugar = false;\n let i = 0;\n let keyIndex = -1;\n while (++keyIndex < keys.length) {\n const key = keys[keyIndex];\n const currentIsConditionalSugar = key === '' || key[0] !== '.';\n if (i++ === 0) {\n isConditionalSugar = currentIsConditionalSugar;\n } else if (isConditionalSugar !== currentIsConditionalSugar) {\n throw new ERR_INVALID_PACKAGE_CONFIG(\n fileURLToPath(packageJsonUrl),\n base,\n '\"exports\" cannot contain some keys starting with \\'.\\' and some not.' +\n ' The exports object must either be an object of package subpath keys' +\n ' or an object of main entry condition name keys only.'\n )\n }\n }\n\n return isConditionalSugar\n}\n\n/**\n * @param {string} match\n * @param {URL} pjsonUrl\n * @param {URL} base\n */\nfunction emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) {\n // @ts-expect-error: apparently it does exist, TS.\n if (process.noDeprecation) {\n return\n }\n\n const pjsonPath = fileURLToPath(pjsonUrl);\n if (emittedPackageWarnings.has(pjsonPath + '|' + match)) return\n emittedPackageWarnings.add(pjsonPath + '|' + match);\n process.emitWarning(\n `Use of deprecated trailing slash pattern mapping \"${match}\" in the ` +\n `\"exports\" field module resolution of the package at ${pjsonPath}${\n base ? ` imported from ${fileURLToPath(base)}` : ''\n }. Mapping specifiers ending in \"/\" is no longer supported.`,\n 'DeprecationWarning',\n 'DEP0155'\n );\n}\n\n/**\n * @param {URL} packageJsonUrl\n * @param {string} packageSubpath\n * @param {Record} packageConfig\n * @param {URL} base\n * @param {Set | undefined} conditions\n * @returns {URL}\n */\nfunction packageExportsResolve(\n packageJsonUrl,\n packageSubpath,\n packageConfig,\n base,\n conditions\n) {\n let exports = packageConfig.exports;\n\n if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {\n exports = {'.': exports};\n }\n\n if (\n own.call(exports, packageSubpath) &&\n !packageSubpath.includes('*') &&\n !packageSubpath.endsWith('/')\n ) {\n // @ts-expect-error: indexable.\n const target = exports[packageSubpath];\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n target,\n '',\n packageSubpath,\n base,\n false,\n false,\n false,\n conditions\n );\n if (resolveResult === null || resolveResult === undefined) {\n throw exportsNotFound(packageSubpath, packageJsonUrl, base)\n }\n\n return resolveResult\n }\n\n let bestMatch = '';\n let bestMatchSubpath = '';\n const keys = Object.getOwnPropertyNames(exports);\n let i = -1;\n\n while (++i < keys.length) {\n const key = keys[i];\n const patternIndex = key.indexOf('*');\n\n if (\n patternIndex !== -1 &&\n packageSubpath.startsWith(key.slice(0, patternIndex))\n ) {\n // When this reaches EOL, this can throw at the top of the whole function:\n //\n // if (StringPrototypeEndsWith(packageSubpath, '/'))\n // throwInvalidSubpath(packageSubpath)\n //\n // To match \"imports\" and the spec.\n if (packageSubpath.endsWith('/')) {\n emitTrailingSlashPatternDeprecation(\n packageSubpath,\n packageJsonUrl,\n base\n );\n }\n\n const patternTrailer = key.slice(patternIndex + 1);\n\n if (\n packageSubpath.length >= key.length &&\n packageSubpath.endsWith(patternTrailer) &&\n patternKeyCompare(bestMatch, key) === 1 &&\n key.lastIndexOf('*') === patternIndex\n ) {\n bestMatch = key;\n bestMatchSubpath = packageSubpath.slice(\n patternIndex,\n packageSubpath.length - patternTrailer.length\n );\n }\n }\n }\n\n if (bestMatch) {\n // @ts-expect-error: indexable.\n const target = /** @type {unknown} */ (exports[bestMatch]);\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n target,\n bestMatchSubpath,\n bestMatch,\n base,\n true,\n false,\n packageSubpath.endsWith('/'),\n conditions\n );\n\n if (resolveResult === null || resolveResult === undefined) {\n throw exportsNotFound(packageSubpath, packageJsonUrl, base)\n }\n\n return resolveResult\n }\n\n throw exportsNotFound(packageSubpath, packageJsonUrl, base)\n}\n\n/**\n * @param {string} a\n * @param {string} b\n */\nfunction patternKeyCompare(a, b) {\n const aPatternIndex = a.indexOf('*');\n const bPatternIndex = b.indexOf('*');\n const baseLengthA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;\n const baseLengthB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;\n if (baseLengthA > baseLengthB) return -1\n if (baseLengthB > baseLengthA) return 1\n if (aPatternIndex === -1) return 1\n if (bPatternIndex === -1) return -1\n if (a.length > b.length) return -1\n if (b.length > a.length) return 1\n return 0\n}\n\n/**\n * @param {string} name\n * @param {URL} base\n * @param {Set} [conditions]\n * @returns {URL}\n */\nfunction packageImportsResolve(name, base, conditions) {\n if (name === '#' || name.startsWith('#/') || name.endsWith('/')) {\n const reason = 'is not a valid internal imports specifier name';\n throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base))\n }\n\n /** @type {URL | undefined} */\n let packageJsonUrl;\n\n const packageConfig = getPackageScopeConfig(base);\n\n if (packageConfig.exists) {\n packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);\n const imports = packageConfig.imports;\n if (imports) {\n if (own.call(imports, name) && !name.includes('*')) {\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n imports[name],\n '',\n name,\n base,\n false,\n true,\n false,\n conditions\n );\n if (resolveResult !== null && resolveResult !== undefined) {\n return resolveResult\n }\n } else {\n let bestMatch = '';\n let bestMatchSubpath = '';\n const keys = Object.getOwnPropertyNames(imports);\n let i = -1;\n\n while (++i < keys.length) {\n const key = keys[i];\n const patternIndex = key.indexOf('*');\n\n if (patternIndex !== -1 && name.startsWith(key.slice(0, -1))) {\n const patternTrailer = key.slice(patternIndex + 1);\n if (\n name.length >= key.length &&\n name.endsWith(patternTrailer) &&\n patternKeyCompare(bestMatch, key) === 1 &&\n key.lastIndexOf('*') === patternIndex\n ) {\n bestMatch = key;\n bestMatchSubpath = name.slice(\n patternIndex,\n name.length - patternTrailer.length\n );\n }\n }\n }\n\n if (bestMatch) {\n const target = imports[bestMatch];\n const resolveResult = resolvePackageTarget(\n packageJsonUrl,\n target,\n bestMatchSubpath,\n bestMatch,\n base,\n true,\n true,\n false,\n conditions\n );\n\n if (resolveResult !== null && resolveResult !== undefined) {\n return resolveResult\n }\n }\n }\n }\n }\n\n throw importNotDefined(name, packageJsonUrl, base)\n}\n\n/**\n * @param {string} specifier\n * @param {URL} base\n */\nfunction parsePackageName(specifier, base) {\n let separatorIndex = specifier.indexOf('/');\n let validPackageName = true;\n let isScoped = false;\n if (specifier[0] === '@') {\n isScoped = true;\n if (separatorIndex === -1 || specifier.length === 0) {\n validPackageName = false;\n } else {\n separatorIndex = specifier.indexOf('/', separatorIndex + 1);\n }\n }\n\n const packageName =\n separatorIndex === -1 ? specifier : specifier.slice(0, separatorIndex);\n\n // Package name cannot have leading . and cannot have percent-encoding or\n // \\\\ separators.\n if (invalidPackageNameRegEx.exec(packageName) !== null) {\n validPackageName = false;\n }\n\n if (!validPackageName) {\n throw new ERR_INVALID_MODULE_SPECIFIER(\n specifier,\n 'is not a valid package name',\n fileURLToPath(base)\n )\n }\n\n const packageSubpath =\n '.' + (separatorIndex === -1 ? '' : specifier.slice(separatorIndex));\n\n return {packageName, packageSubpath, isScoped}\n}\n\n/**\n * @param {string} specifier\n * @param {URL} base\n * @param {Set | undefined} conditions\n * @returns {URL}\n */\nfunction packageResolve(specifier, base, conditions) {\n if (builtinModules.includes(specifier)) {\n return new URL$1('node:' + specifier)\n }\n\n const {packageName, packageSubpath, isScoped} = parsePackageName(\n specifier,\n base\n );\n\n // ResolveSelf\n const packageConfig = getPackageScopeConfig(base);\n\n // Can’t test.\n /* c8 ignore next 16 */\n if (packageConfig.exists) {\n const packageJsonUrl = pathToFileURL(packageConfig.pjsonPath);\n if (\n packageConfig.name === packageName &&\n packageConfig.exports !== undefined &&\n packageConfig.exports !== null\n ) {\n return packageExportsResolve(\n packageJsonUrl,\n packageSubpath,\n packageConfig,\n base,\n conditions\n )\n }\n }\n\n let packageJsonUrl = new URL$1(\n './node_modules/' + packageName + '/package.json',\n base\n );\n let packageJsonPath = fileURLToPath(packageJsonUrl);\n /** @type {string} */\n let lastPath;\n do {\n const stat = tryStatSync(packageJsonPath.slice(0, -13));\n if (!stat || !stat.isDirectory()) {\n lastPath = packageJsonPath;\n packageJsonUrl = new URL$1(\n (isScoped ? '../../../../node_modules/' : '../../../node_modules/') +\n packageName +\n '/package.json',\n packageJsonUrl\n );\n packageJsonPath = fileURLToPath(packageJsonUrl);\n continue\n }\n\n // Package match.\n const packageConfig = read(packageJsonPath, {base, specifier});\n if (packageConfig.exports !== undefined && packageConfig.exports !== null) {\n return packageExportsResolve(\n packageJsonUrl,\n packageSubpath,\n packageConfig,\n base,\n conditions\n )\n }\n\n if (packageSubpath === '.') {\n return legacyMainResolve(packageJsonUrl, packageConfig, base)\n }\n\n return new URL$1(packageSubpath, packageJsonUrl)\n // Cross-platform root check.\n } while (packageJsonPath.length !== lastPath.length)\n\n throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), false)\n}\n\n/**\n * @param {string} specifier\n * @returns {boolean}\n */\nfunction isRelativeSpecifier(specifier) {\n if (specifier[0] === '.') {\n if (specifier.length === 1 || specifier[1] === '/') return true\n if (\n specifier[1] === '.' &&\n (specifier.length === 2 || specifier[2] === '/')\n ) {\n return true\n }\n }\n\n return false\n}\n\n/**\n * @param {string} specifier\n * @returns {boolean}\n */\nfunction shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {\n if (specifier === '') return false\n if (specifier[0] === '/') return true\n return isRelativeSpecifier(specifier)\n}\n\n/**\n * The “Resolver Algorithm Specification” as detailed in the Node docs (which is\n * sync and slightly lower-level than `resolve`).\n *\n * @param {string} specifier\n * `/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`, etc.\n * @param {URL} base\n * Full URL (to a file) that `specifier` is resolved relative from.\n * @param {Set} [conditions]\n * Conditions.\n * @param {boolean} [preserveSymlinks]\n * Keep symlinks instead of resolving them.\n * @returns {URL}\n * A URL object to the found thing.\n */\nfunction moduleResolve(specifier, base, conditions, preserveSymlinks) {\n // Note: The Node code supports `base` as a string (in this internal API) too,\n // we don’t.\n const protocol = base.protocol;\n const isData = protocol === 'data:';\n const isRemote = isData || protocol === 'http:' || protocol === 'https:';\n // Order swapped from spec for minor perf gain.\n // Ok since relative URLs cannot parse as URLs.\n /** @type {URL | undefined} */\n let resolved;\n\n if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {\n try {\n resolved = new URL$1(specifier, base);\n } catch (error_) {\n const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);\n error.cause = error_;\n throw error\n }\n } else if (protocol === 'file:' && specifier[0] === '#') {\n resolved = packageImportsResolve(specifier, base, conditions);\n } else {\n try {\n resolved = new URL$1(specifier);\n } catch (error_) {\n // Note: actual code uses `canBeRequiredWithoutScheme`.\n if (isRemote && !builtinModules.includes(specifier)) {\n const error = new ERR_UNSUPPORTED_RESOLVE_REQUEST(specifier, base);\n error.cause = error_;\n throw error\n }\n\n resolved = packageResolve(specifier, base, conditions);\n }\n }\n\n assert(resolved !== undefined, 'expected to be defined');\n\n if (resolved.protocol !== 'file:') {\n return resolved\n }\n\n return finalizeResolution(resolved, base, preserveSymlinks)\n}\n\n/**\n * @param {string} specifier\n * @param {URL | undefined} parsed\n * @param {URL | undefined} parsedParentURL\n */\nfunction checkIfDisallowedImport(specifier, parsed, parsedParentURL) {\n if (parsedParentURL) {\n // Avoid accessing the `protocol` property due to the lazy getters.\n const parentProtocol = parsedParentURL.protocol;\n\n if (parentProtocol === 'http:' || parentProtocol === 'https:') {\n if (shouldBeTreatedAsRelativeOrAbsolutePath(specifier)) {\n // Avoid accessing the `protocol` property due to the lazy getters.\n const parsedProtocol = parsed?.protocol;\n\n // `data:` and `blob:` disallowed due to allowing file: access via\n // indirection\n if (\n parsedProtocol &&\n parsedProtocol !== 'https:' &&\n parsedProtocol !== 'http:'\n ) {\n throw new ERR_NETWORK_IMPORT_DISALLOWED(\n specifier,\n parsedParentURL,\n 'remote imports cannot import from a local location.'\n )\n }\n\n return {url: parsed?.href || ''}\n }\n\n if (builtinModules.includes(specifier)) {\n throw new ERR_NETWORK_IMPORT_DISALLOWED(\n specifier,\n parsedParentURL,\n 'remote imports cannot import from a local location.'\n )\n }\n\n throw new ERR_NETWORK_IMPORT_DISALLOWED(\n specifier,\n parsedParentURL,\n 'only relative and absolute specifiers are supported.'\n )\n }\n }\n}\n\n// Note: this is from:\n// \n/**\n * Checks if a value has the shape of a WHATWG URL object.\n *\n * Using a symbol or instanceof would not be able to recognize URL objects\n * coming from other implementations (e.g. in Electron), so instead we are\n * checking some well known properties for a lack of a better test.\n *\n * We use `href` and `protocol` as they are the only properties that are\n * easy to retrieve and calculate due to the lazy nature of the getters.\n *\n * @template {unknown} Value\n * @param {Value} self\n * @returns {Value is URL}\n */\nfunction isURL(self) {\n return Boolean(\n self &&\n typeof self === 'object' &&\n 'href' in self &&\n typeof self.href === 'string' &&\n 'protocol' in self &&\n typeof self.protocol === 'string' &&\n self.href &&\n self.protocol\n )\n}\n\n/**\n * Validate user-input in `context` supplied by a custom loader.\n *\n * @param {unknown} parentURL\n * @returns {asserts parentURL is URL | string | undefined}\n */\nfunction throwIfInvalidParentURL(parentURL) {\n if (parentURL === undefined) {\n return // Main entry point, so no parent\n }\n\n if (typeof parentURL !== 'string' && !isURL(parentURL)) {\n throw new codes.ERR_INVALID_ARG_TYPE(\n 'parentURL',\n ['string', 'URL'],\n parentURL\n )\n }\n}\n\n/**\n * @param {string} specifier\n * @param {{parentURL?: string, conditions?: Array}} context\n * @returns {{url: string, format?: string | null}}\n */\nfunction defaultResolve(specifier, context = {}) {\n const {parentURL} = context;\n assert(parentURL !== undefined, 'expected `parentURL` to be defined');\n throwIfInvalidParentURL(parentURL);\n\n /** @type {URL | undefined} */\n let parsedParentURL;\n if (parentURL) {\n try {\n parsedParentURL = new URL$1(parentURL);\n } catch {\n // Ignore exception\n }\n }\n\n /** @type {URL | undefined} */\n let parsed;\n /** @type {string | undefined} */\n let protocol;\n\n try {\n parsed = shouldBeTreatedAsRelativeOrAbsolutePath(specifier)\n ? new URL$1(specifier, parsedParentURL)\n : new URL$1(specifier);\n\n // Avoid accessing the `protocol` property due to the lazy getters.\n protocol = parsed.protocol;\n\n if (protocol === 'data:') {\n return {url: parsed.href, format: null}\n }\n } catch {\n // Ignore exception\n }\n\n // There are multiple deep branches that can either throw or return; instead\n // of duplicating that deeply nested logic for the possible returns, DRY and\n // check for a return. This seems the least gnarly.\n const maybeReturn = checkIfDisallowedImport(\n specifier,\n parsed,\n parsedParentURL\n );\n\n if (maybeReturn) return maybeReturn\n\n // This must come after checkIfDisallowedImport\n if (protocol === undefined && parsed) {\n protocol = parsed.protocol;\n }\n\n if (protocol === 'node:') {\n return {url: specifier}\n }\n\n // This must come after checkIfDisallowedImport\n if (parsed && parsed.protocol === 'node:') return {url: specifier}\n\n const conditions = getConditionsSet(context.conditions);\n\n const url = moduleResolve(specifier, new URL$1(parentURL), conditions, false);\n\n return {\n // Do NOT cast `url` to a string: that will work even when there are real\n // problems, silencing them\n url: url.href,\n format: defaultGetFormatWithoutErrors(url, {parentURL})\n }\n}\n\n/**\n * @typedef {import('./lib/errors.js').ErrnoException} ErrnoException\n */\n\n\n/**\n * Match `import.meta.resolve` except that `parent` is required (you can pass\n * `import.meta.url`).\n *\n * @param {string} specifier\n * The module specifier to resolve relative to parent\n * (`/example.js`, `./example.js`, `../example.js`, `some-package`, `fs`,\n * etc).\n * @param {string} parent\n * The absolute parent module URL to resolve from.\n * You must pass `import.meta.url` or something else.\n * @returns {string}\n * Returns a string to a full `file:`, `data:`, or `node:` URL\n * to the found thing.\n */\nfunction resolve(specifier, parent) {\n if (!parent) {\n throw new Error(\n 'Please pass `parent`: `import-meta-resolve` cannot ponyfill that'\n )\n }\n\n try {\n return defaultResolve(specifier, {parentURL: parent}).url\n } catch (error) {\n // See: \n const exception = /** @type {ErrnoException} */ (error);\n\n if (\n (exception.code === 'ERR_UNSUPPORTED_DIR_IMPORT' ||\n exception.code === 'ERR_MODULE_NOT_FOUND') &&\n typeof exception.url === 'string'\n ) {\n return exception.url\n }\n\n throw error\n }\n}\n\nexport { moduleResolve, resolve };\n"],"mappings":";;;;;;;AAoFA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,IAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA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1C,KAAM;IAEvD,IACE,CAAC0C,SAAS,CAAClC,IAAI,KAAK,4BAA4B,IAC9CkC,SAAS,CAAClC,IAAI,KAAK,sBAAsB,KAC3C,OAAOkC,SAAS,CAACqB,GAAG,KAAK,QAAQ,EACjC;MACA,OAAOrB,SAAS,CAACqB,GAAG;IACtB;IAEA,MAAM/D,KAAK;EACb;AACF;AAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/core/node_modules/.bin/semver b/node_modules/@babel/core/node_modules/.bin/semver new file mode 100644 index 0000000..97c5327 --- /dev/null +++ b/node_modules/@babel/core/node_modules/.bin/semver @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/@babel/core/node_modules/.bin/semver.cmd b/node_modules/@babel/core/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..9913fa9 --- /dev/null +++ b/node_modules/@babel/core/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/@babel/core/node_modules/.bin/semver.ps1 b/node_modules/@babel/core/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..314717a --- /dev/null +++ b/node_modules/@babel/core/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/@babel/core/node_modules/convert-source-map/LICENSE b/node_modules/@babel/core/node_modules/convert-source-map/LICENSE new file mode 100644 index 0000000..41702c5 --- /dev/null +++ b/node_modules/@babel/core/node_modules/convert-source-map/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/core/node_modules/convert-source-map/README.md b/node_modules/@babel/core/node_modules/convert-source-map/README.md new file mode 100644 index 0000000..aa4d804 --- /dev/null +++ b/node_modules/@babel/core/node_modules/convert-source-map/README.md @@ -0,0 +1,206 @@ +# convert-source-map [![Build Status][ci-image]][ci-url] + +Converts a source-map from/to different formats and allows adding/changing properties. + +```js +var convert = require('convert-source-map'); + +var json = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .toJSON(); + +var modified = convert + .fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') + .setProperty('sources', [ 'SRC/FOO.JS' ]) + .toJSON(); + +console.log(json); +console.log(modified); +``` + +```json +{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"} +``` + +## Upgrading + +Prior to v2.0.0, the `fromMapFileComment` and `fromMapFileSource` functions took a String directory path and used that to resolve & read the source map file from the filesystem. However, this made the library limited to nodejs environments and broke on sources with querystrings. + +In v2.0.0, you now need to pass a function that does the file reading. It will receive the source filename as a String that you can resolve to a filesystem path, URL, or anything else. + +If you are using `convert-source-map` in nodejs and want the previous behavior, you'll use a function like such: + +```diff ++ var fs = require('fs'); // Import the fs module to read a file ++ var path = require('path'); // Import the path module to resolve a path against your directory +- var conv = convert.fromMapFileSource(css, '../my-dir'); ++ var conv = convert.fromMapFileSource(css, function (filename) { ++ return fs.readFileSync(path.resolve('../my-dir', filename), 'utf-8'); ++ }); +``` + +## API + +### fromObject(obj) + +Returns source map converter from given object. + +### fromJSON(json) + +Returns source map converter from given json string. + +### fromURI(uri) + +Returns source map converter from given uri encoded json string. + +### fromBase64(base64) + +Returns source map converter from given base64 encoded json string. + +### fromComment(comment) + +Returns source map converter from given base64 or uri encoded json string prefixed with `//# sourceMappingURL=...`. + +### fromMapFileComment(comment, readMap) + +Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`. + +`readMap` must be a function which receives the source map filename and returns either a String or Buffer of the source map (if read synchronously), or a `Promise` containing a String or Buffer of the source map (if read asynchronously). + +If `readMap` doesn't return a `Promise`, `fromMapFileComment` will return a source map converter synchronously. + +If `readMap` returns a `Promise`, `fromMapFileComment` will also return `Promise`. The `Promise` will be either resolved with the source map converter or rejected with an error. + +#### Examples + +**Synchronous read in Node.js:** + +```js +var convert = require('convert-source-map'); +var fs = require('fs'); + +function readMap(filename) { + return fs.readFileSync(filename, 'utf8'); +} + +var json = convert + .fromMapFileComment('//# sourceMappingURL=map-file-comment.css.map', readMap) + .toJSON(); +console.log(json); +``` + + +**Asynchronous read in Node.js:** + +```js +var convert = require('convert-source-map'); +var { promises: fs } = require('fs'); // Notice the `promises` import + +function readMap(filename) { + return fs.readFile(filename, 'utf8'); +} + +var converter = await convert.fromMapFileComment('//# sourceMappingURL=map-file-comment.css.map', readMap) +var json = converter.toJSON(); +console.log(json); +``` + +**Asynchronous read in the browser:** + +```js +var convert = require('convert-source-map'); + +async function readMap(url) { + const res = await fetch(url); + return res.text(); +} + +const converter = await convert.fromMapFileComment('//# sourceMappingURL=map-file-comment.css.map', readMap) +var json = converter.toJSON(); +console.log(json); +``` + +### fromSource(source) + +Finds last sourcemap comment in file and returns source map converter or returns `null` if no source map comment was found. + +### fromMapFileSource(source, readMap) + +Finds last sourcemap comment in file and returns source map converter or returns `null` if no source map comment was found. + +`readMap` must be a function which receives the source map filename and returns either a String or Buffer of the source map (if read synchronously), or a `Promise` containing a String or Buffer of the source map (if read asynchronously). + +If `readMap` doesn't return a `Promise`, `fromMapFileSource` will return a source map converter synchronously. + +If `readMap` returns a `Promise`, `fromMapFileSource` will also return `Promise`. The `Promise` will be either resolved with the source map converter or rejected with an error. + +### toObject() + +Returns a copy of the underlying source map. + +### toJSON([space]) + +Converts source map to json string. If `space` is given (optional), this will be passed to +[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the +JSON string is generated. + +### toURI() + +Converts source map to uri encoded json string. + +### toBase64() + +Converts source map to base64 encoded json string. + +### toComment([options]) + +Converts source map to an inline comment that can be appended to the source-file. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would +normally see in a JS source file. + +When `options.encoding == 'uri'`, the data will be uri encoded, otherwise they will be base64 encoded. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + +### addProperty(key, value) + +Adds given property to the source map. Throws an error if property already exists. + +### setProperty(key, value) + +Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated. + +### getProperty(key) + +Gets given property of the source map. + +### removeComments(src) + +Returns `src` with all source map comments removed + +### removeMapFileComments(src) + +Returns `src` with all source map comments pointing to map files removed. + +### commentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments. + +Breaks down a source map comment into groups: Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. + +### mapFileCommentRegex + +Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files. + +### generateMapFileComment(file, [options]) + +Returns a comment that links to an external source map via `file`. + +By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file. + +When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file. + +[ci-url]: https://github.com/thlorenz/convert-source-map/actions?query=workflow:ci +[ci-image]: https://img.shields.io/github/workflow/status/thlorenz/convert-source-map/CI?style=flat-square diff --git a/node_modules/@babel/core/node_modules/convert-source-map/index.js b/node_modules/@babel/core/node_modules/convert-source-map/index.js new file mode 100644 index 0000000..2e8e916 --- /dev/null +++ b/node_modules/@babel/core/node_modules/convert-source-map/index.js @@ -0,0 +1,233 @@ +'use strict'; + +Object.defineProperty(exports, 'commentRegex', { + get: function getCommentRegex () { + // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. + return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg; + } +}); + + +Object.defineProperty(exports, 'mapFileCommentRegex', { + get: function getMapFileCommentRegex () { + // Matches sourceMappingURL in either // or /* comment styles. + return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg; + } +}); + +var decodeBase64; +if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + decodeBase64 = decodeBase64WithBufferFrom; + } else { + decodeBase64 = decodeBase64WithNewBuffer; + } +} else { + decodeBase64 = decodeBase64WithAtob; +} + +function decodeBase64WithBufferFrom(base64) { + return Buffer.from(base64, 'base64').toString(); +} + +function decodeBase64WithNewBuffer(base64) { + if (typeof value === 'number') { + throw new TypeError('The value to decode must not be of type number.'); + } + return new Buffer(base64, 'base64').toString(); +} + +function decodeBase64WithAtob(base64) { + return decodeURIComponent(escape(atob(base64))); +} + +function stripComment(sm) { + return sm.split(',').pop(); +} + +function readFromFileMap(sm, read) { + var r = exports.mapFileCommentRegex.exec(sm); + // for some odd reason //# .. captures in 1 and /* .. */ in 2 + var filename = r[1] || r[2]; + + try { + var sm = read(filename); + if (sm != null && typeof sm.catch === 'function') { + return sm.catch(throwError); + } else { + return sm; + } + } catch (e) { + throwError(e); + } + + function throwError(e) { + throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack); + } +} + +function Converter (sm, opts) { + opts = opts || {}; + + if (opts.hasComment) { + sm = stripComment(sm); + } + + if (opts.encoding === 'base64') { + sm = decodeBase64(sm); + } else if (opts.encoding === 'uri') { + sm = decodeURIComponent(sm); + } + + if (opts.isJSON || opts.encoding) { + sm = JSON.parse(sm); + } + + this.sourcemap = sm; +} + +Converter.prototype.toJSON = function (space) { + return JSON.stringify(this.sourcemap, null, space); +}; + +if (typeof Buffer !== 'undefined') { + if (typeof Buffer.from === 'function') { + Converter.prototype.toBase64 = encodeBase64WithBufferFrom; + } else { + Converter.prototype.toBase64 = encodeBase64WithNewBuffer; + } +} else { + Converter.prototype.toBase64 = encodeBase64WithBtoa; +} + +function encodeBase64WithBufferFrom() { + var json = this.toJSON(); + return Buffer.from(json, 'utf8').toString('base64'); +} + +function encodeBase64WithNewBuffer() { + var json = this.toJSON(); + if (typeof json === 'number') { + throw new TypeError('The json to encode must not be of type number.'); + } + return new Buffer(json, 'utf8').toString('base64'); +} + +function encodeBase64WithBtoa() { + var json = this.toJSON(); + return btoa(unescape(encodeURIComponent(json))); +} + +Converter.prototype.toURI = function () { + var json = this.toJSON(); + return encodeURIComponent(json); +}; + +Converter.prototype.toComment = function (options) { + var encoding, content, data; + if (options != null && options.encoding === 'uri') { + encoding = ''; + content = this.toURI(); + } else { + encoding = ';base64'; + content = this.toBase64(); + } + data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content; + return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; + +// returns copy instead of original +Converter.prototype.toObject = function () { + return JSON.parse(this.toJSON()); +}; + +Converter.prototype.addProperty = function (key, value) { + if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); + return this.setProperty(key, value); +}; + +Converter.prototype.setProperty = function (key, value) { + this.sourcemap[key] = value; + return this; +}; + +Converter.prototype.getProperty = function (key) { + return this.sourcemap[key]; +}; + +exports.fromObject = function (obj) { + return new Converter(obj); +}; + +exports.fromJSON = function (json) { + return new Converter(json, { isJSON: true }); +}; + +exports.fromURI = function (uri) { + return new Converter(uri, { encoding: 'uri' }); +}; + +exports.fromBase64 = function (base64) { + return new Converter(base64, { encoding: 'base64' }); +}; + +exports.fromComment = function (comment) { + var m, encoding; + comment = comment + .replace(/^\/\*/g, '//') + .replace(/\*\/$/g, ''); + m = exports.commentRegex.exec(comment); + encoding = m && m[4] || 'uri'; + return new Converter(comment, { encoding: encoding, hasComment: true }); +}; + +function makeConverter(sm) { + return new Converter(sm, { isJSON: true }); +} + +exports.fromMapFileComment = function (comment, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileComment`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + + var sm = readFromFileMap(comment, read); + if (sm != null && typeof sm.then === 'function') { + return sm.then(makeConverter); + } else { + return makeConverter(sm); + } +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromSource = function (content) { + var m = content.match(exports.commentRegex); + return m ? exports.fromComment(m.pop()) : null; +}; + +// Finds last sourcemap comment in file or returns null if none was found +exports.fromMapFileSource = function (content, read) { + if (typeof read === 'string') { + throw new Error( + 'String directory paths are no longer supported with `fromMapFileSource`\n' + + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' + ) + } + var m = content.match(exports.mapFileCommentRegex); + return m ? exports.fromMapFileComment(m.pop(), read) : null; +}; + +exports.removeComments = function (src) { + return src.replace(exports.commentRegex, ''); +}; + +exports.removeMapFileComments = function (src) { + return src.replace(exports.mapFileCommentRegex, ''); +}; + +exports.generateMapFileComment = function (file, options) { + var data = 'sourceMappingURL=' + file; + return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; +}; diff --git a/node_modules/@babel/core/node_modules/convert-source-map/package.json b/node_modules/@babel/core/node_modules/convert-source-map/package.json new file mode 100644 index 0000000..c38f29f --- /dev/null +++ b/node_modules/@babel/core/node_modules/convert-source-map/package.json @@ -0,0 +1,38 @@ +{ + "name": "convert-source-map", + "version": "2.0.0", + "description": "Converts a source-map from/to different formats and allows adding/changing properties.", + "main": "index.js", + "scripts": { + "test": "tap test/*.js --color" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/convert-source-map.git" + }, + "homepage": "https://github.com/thlorenz/convert-source-map", + "devDependencies": { + "inline-source-map": "~0.6.2", + "tap": "~9.0.0" + }, + "keywords": [ + "convert", + "sourcemap", + "source", + "map", + "browser", + "debug" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "http://thlorenz.com" + }, + "license": "MIT", + "engine": { + "node": ">=4" + }, + "files": [ + "index.js" + ] +} diff --git a/node_modules/@babel/core/node_modules/semver/LICENSE b/node_modules/@babel/core/node_modules/semver/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/@babel/core/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@babel/core/node_modules/semver/README.md b/node_modules/@babel/core/node_modules/semver/README.md new file mode 100644 index 0000000..2293a14 --- /dev/null +++ b/node_modules/@babel/core/node_modules/semver/README.md @@ -0,0 +1,443 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` diff --git a/node_modules/@babel/core/node_modules/semver/bin/semver.js b/node_modules/@babel/core/node_modules/semver/bin/semver.js new file mode 100644 index 0000000..666034a --- /dev/null +++ b/node_modules/@babel/core/node_modules/semver/bin/semver.js @@ -0,0 +1,174 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var rtl = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + '--rtl', + ' Coerce version strings right to left', + '', + '--ltr', + ' Coerce version strings left to right (default)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/node_modules/@babel/core/node_modules/semver/package.json b/node_modules/@babel/core/node_modules/semver/package.json new file mode 100644 index 0000000..6b970a6 --- /dev/null +++ b/node_modules/@babel/core/node_modules/semver/package.json @@ -0,0 +1,38 @@ +{ + "name": "semver", + "version": "6.3.1", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap test/ --100 --timeout=30", + "lint": "echo linting disabled", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap test/ --100 --timeout=30", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/template-oss": "4.17.0", + "tap": "^12.7.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "./bin/semver.js" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "content": "./scripts/template-oss", + "version": "4.17.0" + } +} diff --git a/node_modules/@babel/core/node_modules/semver/range.bnf b/node_modules/@babel/core/node_modules/semver/range.bnf new file mode 100644 index 0000000..d4c6ae0 --- /dev/null +++ b/node_modules/@babel/core/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/@babel/core/node_modules/semver/semver.js b/node_modules/@babel/core/node_modules/semver/semver.js new file mode 100644 index 0000000..39319c1 --- /dev/null +++ b/node_modules/@babel/core/node_modules/semver/semver.js @@ -0,0 +1,1643 @@ +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +// The actual regexps go on exports.re +var re = exports.re = [] +var safeRe = exports.safeRe = [] +var src = exports.src = [] +var t = exports.tokens = {} +var R = 0 + +function tok (n) { + t[n] = R++ +} + +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +tok('NUMERICIDENTIFIER') +src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' +tok('NUMERICIDENTIFIERLOOSE') +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +tok('NONNUMERICIDENTIFIER') +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +tok('MAINVERSION') +src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIER] + ')' + +tok('MAINVERSIONLOOSE') +src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +tok('PRERELEASEIDENTIFIER') +src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +tok('PRERELEASEIDENTIFIERLOOSE') +src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + + '|' + src[t.NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +tok('PRERELEASE') +src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))' + +tok('PRERELEASELOOSE') +src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +tok('BUILDIDENTIFIER') +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +tok('BUILD') +src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +tok('FULL') +tok('FULLPLAIN') +src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + + src[t.PRERELEASE] + '?' + + src[t.BUILD] + '?' + +src[t.FULL] = '^' + src[t.FULLPLAIN] + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +tok('LOOSEPLAIN') +src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + + src[t.PRERELEASELOOSE] + '?' + + src[t.BUILD] + '?' + +tok('LOOSE') +src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$' + +tok('GTLT') +src[t.GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +tok('XRANGEIDENTIFIERLOOSE') +src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +tok('XRANGEIDENTIFIER') +src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*' + +tok('XRANGEPLAIN') +src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + + '(?:' + src[t.PRERELEASE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGEPLAINLOOSE') +src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[t.PRERELEASELOOSE] + ')?' + + src[t.BUILD] + '?' + + ')?)?' + +tok('XRANGE') +src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$' +tok('XRANGELOOSE') +src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +tok('COERCE') +src[t.COERCE] = '(^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' +tok('COERCERTL') +re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +tok('LONETILDE') +src[t.LONETILDE] = '(?:~>?)' + +tok('TILDETRIM') +src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' +re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') +var tildeTrimReplace = '$1~' + +tok('TILDE') +src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$' +tok('TILDELOOSE') +src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +tok('LONECARET') +src[t.LONECARET] = '(?:\\^)' + +tok('CARETTRIM') +src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' +re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') +var caretTrimReplace = '$1^' + +tok('CARET') +src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$' +tok('CARETLOOSE') +src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +tok('COMPARATORLOOSE') +src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$' +tok('COMPARATOR') +src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +tok('COMPARATORTRIM') +src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +tok('HYPHENRANGE') +src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAIN] + ')' + + '\\s*$' + +tok('HYPHENRANGELOOSE') +src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[t.XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +tok('STAR') +src[t.STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +SemVer.prototype.compareBuild = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + var i = 0 + do { + var a = this.build[i] + var b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.compareBuild = compareBuild +function compareBuild (a, b, loose) { + var versionA = new SemVer(a, loose) + var versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.compareBuild(b, a, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + if (this.value === '') { + return true + } + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + this.raw) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + + // normalize spaces + range = range.split(/\s+/).join(' ') + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return ( + isSatisfiable(thisComparators, options) && + range.set.some(function (rangeComparators) { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every(function (thisComparator) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) +} + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +function isSatisfiable (comparators, options) { + var result = true + var remainingComparators = comparators.slice() + var testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every(function (otherComparator) { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(safeRe[t.STAR], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = safeRe[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + safeRe[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} diff --git a/node_modules/@babel/core/package.json b/node_modules/@babel/core/package.json new file mode 100644 index 0000000..3aed75d --- /dev/null +++ b/node_modules/@babel/core/package.json @@ -0,0 +1,82 @@ +{ + "name": "@babel/core", + "version": "7.28.5", + "description": "Babel compiler core.", + "main": "./lib/index.js", + "author": "The Babel Team (https://babel.dev/team)", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-core" + }, + "homepage": "https://babel.dev/docs/en/next/babel-core", + "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen", + "keywords": [ + "6to5", + "babel", + "classes", + "const", + "es6", + "harmony", + "let", + "modules", + "transpile", + "transpiler", + "var", + "babel-core", + "compiler" + ], + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + }, + "browser": { + "./lib/config/files/index.js": "./lib/config/files/index-browser.js", + "./lib/config/resolve-targets.js": "./lib/config/resolve-targets-browser.js", + "./lib/transform-file.js": "./lib/transform-file-browser.js", + "./src/config/files/index.ts": "./src/config/files/index-browser.ts", + "./src/config/resolve-targets.ts": "./src/config/resolve-targets-browser.ts", + "./src/transform-file.ts": "./src/transform-file-browser.ts" + }, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "devDependencies": { + "@babel/helper-transform-fixture-test-runner": "^7.28.5", + "@babel/plugin-syntax-flow": "^7.27.1", + "@babel/plugin-transform-flow-strip-types": "^7.27.1", + "@babel/plugin-transform-modules-commonjs": "^7.27.1", + "@babel/preset-env": "^7.28.5", + "@babel/preset-typescript": "^7.28.5", + "@jridgewell/trace-mapping": "^0.3.28", + "@types/convert-source-map": "^2.0.0", + "@types/debug": "^4.1.0", + "@types/resolve": "^1.3.2", + "@types/semver": "^5.4.0", + "rimraf": "^3.0.0", + "ts-node": "^11.0.0-beta.1", + "tsx": "^4.20.3" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/core/src/config/files/index-browser.ts b/node_modules/@babel/core/src/config/files/index-browser.ts new file mode 100644 index 0000000..435c068 --- /dev/null +++ b/node_modules/@babel/core/src/config/files/index-browser.ts @@ -0,0 +1,115 @@ +/* c8 ignore start */ + +import type { Handler } from "gensync"; + +import type { + ConfigFile, + IgnoreFile, + RelativeConfig, + FilePackageData, +} from "./types.ts"; + +import type { CallerMetadata } from "../validation/options.ts"; + +export type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData }; + +export function findConfigUpwards( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + rootDir: string, +): string | null { + return null; +} + +// eslint-disable-next-line require-yield +export function* findPackageData(filepath: string): Handler { + return { + filepath, + directories: [], + pkg: null, + isPackage: false, + }; +} + +// eslint-disable-next-line require-yield +export function* findRelativeConfig( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + pkgData: FilePackageData, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + envName: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + caller: CallerMetadata | undefined, +): Handler { + return { config: null, ignore: null }; +} + +// eslint-disable-next-line require-yield +export function* findRootConfig( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + dirname: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + envName: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + caller: CallerMetadata | undefined, +): Handler { + return null; +} + +// eslint-disable-next-line require-yield +export function* loadConfig( + name: string, + dirname: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + envName: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + caller: CallerMetadata | undefined, +): Handler { + throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); +} + +// eslint-disable-next-line require-yield +export function* resolveShowConfigPath( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + dirname: string, +): Handler { + return null; +} + +export const ROOT_CONFIG_FILENAMES: string[] = []; + +type Resolved = + | { loader: "require"; filepath: string } + | { loader: "import"; filepath: string }; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export function resolvePlugin(name: string, dirname: string): Resolved | null { + return null; +} + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export function resolvePreset(name: string, dirname: string): Resolved | null { + return null; +} + +export function loadPlugin( + name: string, + dirname: string, +): Handler<{ + filepath: string; + value: unknown; +}> { + throw new Error( + `Cannot load plugin ${name} relative to ${dirname} in a browser`, + ); +} + +export function loadPreset( + name: string, + dirname: string, +): Handler<{ + filepath: string; + value: unknown; +}> { + throw new Error( + `Cannot load preset ${name} relative to ${dirname} in a browser`, + ); +} diff --git a/node_modules/@babel/core/src/config/files/index.ts b/node_modules/@babel/core/src/config/files/index.ts new file mode 100644 index 0000000..b138e8d --- /dev/null +++ b/node_modules/@babel/core/src/config/files/index.ts @@ -0,0 +1,29 @@ +type indexBrowserType = typeof import("./index-browser"); +type indexType = typeof import("./index"); + +// Kind of gross, but essentially asserting that the exports of this module are the same as the +// exports of index-browser, since this file may be replaced at bundle time with index-browser. +({}) as any as indexBrowserType as indexType; + +export { findPackageData } from "./package.ts"; + +export { + findConfigUpwards, + findRelativeConfig, + findRootConfig, + loadConfig, + resolveShowConfigPath, + ROOT_CONFIG_FILENAMES, +} from "./configuration.ts"; +export type { + ConfigFile, + IgnoreFile, + RelativeConfig, + FilePackageData, +} from "./types.ts"; +export { + loadPlugin, + loadPreset, + resolvePlugin, + resolvePreset, +} from "./plugins.ts"; diff --git a/node_modules/@babel/core/src/config/resolve-targets-browser.ts b/node_modules/@babel/core/src/config/resolve-targets-browser.ts new file mode 100644 index 0000000..89e4194 --- /dev/null +++ b/node_modules/@babel/core/src/config/resolve-targets-browser.ts @@ -0,0 +1,42 @@ +/* c8 ignore start */ + +import type { InputOptions } from "./validation/options.ts"; +import getTargets, { + type InputTargets, +} from "@babel/helper-compilation-targets"; + +import type { Targets } from "@babel/helper-compilation-targets"; + +export function resolveBrowserslistConfigFile( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + browserslistConfigFile: string, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + configFilePath: string, +): string | void { + return undefined; +} + +export function resolveTargets( + options: InputOptions, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + root: string, +): Targets { + const optTargets = options.targets; + let targets: InputTargets; + + if (typeof optTargets === "string" || Array.isArray(optTargets)) { + targets = { browsers: optTargets }; + } else if (optTargets) { + if ("esmodules" in optTargets) { + targets = { ...optTargets, esmodules: "intersect" }; + } else { + // https://github.com/microsoft/TypeScript/issues/17002 + targets = optTargets as InputTargets; + } + } + + return getTargets(targets, { + ignoreBrowserslistConfig: true, + browserslistEnv: options.browserslistEnv, + }); +} diff --git a/node_modules/@babel/core/src/config/resolve-targets.ts b/node_modules/@babel/core/src/config/resolve-targets.ts new file mode 100644 index 0000000..d2996fd --- /dev/null +++ b/node_modules/@babel/core/src/config/resolve-targets.ts @@ -0,0 +1,53 @@ +type browserType = typeof import("./resolve-targets-browser"); +type nodeType = typeof import("./resolve-targets"); + +// Kind of gross, but essentially asserting that the exports of this module are the same as the +// exports of index-browser, since this file may be replaced at bundle time with index-browser. +({}) as any as browserType as nodeType; + +import type { InputOptions } from "./validation/options.ts"; +import path from "node:path"; +import getTargets, { + type InputTargets, +} from "@babel/helper-compilation-targets"; + +import type { Targets } from "@babel/helper-compilation-targets"; + +export function resolveBrowserslistConfigFile( + browserslistConfigFile: string, + configFileDir: string, +): string | undefined { + return path.resolve(configFileDir, browserslistConfigFile); +} + +export function resolveTargets(options: InputOptions, root: string): Targets { + const optTargets = options.targets; + let targets: InputTargets; + + if (typeof optTargets === "string" || Array.isArray(optTargets)) { + targets = { browsers: optTargets }; + } else if (optTargets) { + if ("esmodules" in optTargets) { + targets = { ...optTargets, esmodules: "intersect" }; + } else { + // https://github.com/microsoft/TypeScript/issues/17002 + targets = optTargets as InputTargets; + } + } + + const { browserslistConfigFile } = options; + let configFile; + let ignoreBrowserslistConfig = false; + if (typeof browserslistConfigFile === "string") { + configFile = browserslistConfigFile; + } else { + ignoreBrowserslistConfig = browserslistConfigFile === false; + } + + return getTargets(targets, { + ignoreBrowserslistConfig, + configFile, + configPath: root, + browserslistEnv: options.browserslistEnv, + }); +} diff --git a/node_modules/@babel/core/src/transform-file-browser.ts b/node_modules/@babel/core/src/transform-file-browser.ts new file mode 100644 index 0000000..0a15ca5 --- /dev/null +++ b/node_modules/@babel/core/src/transform-file-browser.ts @@ -0,0 +1,33 @@ +/* c8 ignore start */ + +// duplicated from transform-file so we do not have to import anything here +type TransformFile = { + (filename: string, callback: (error: Error, file: null) => void): void; + ( + filename: string, + opts: any, + callback: (error: Error, file: null) => void, + ): void; +}; + +export const transformFile: TransformFile = function transformFile( + filename, + opts, + callback?: (error: Error, file: null) => void, +) { + if (typeof opts === "function") { + callback = opts; + } + + callback(new Error("Transforming files is not supported in browsers"), null); +}; + +export function transformFileSync(): never { + throw new Error("Transforming files is not supported in browsers"); +} + +export function transformFileAsync() { + return Promise.reject( + new Error("Transforming files is not supported in browsers"), + ); +} diff --git a/node_modules/@babel/core/src/transform-file.ts b/node_modules/@babel/core/src/transform-file.ts new file mode 100644 index 0000000..6bc2f83 --- /dev/null +++ b/node_modules/@babel/core/src/transform-file.ts @@ -0,0 +1,55 @@ +import gensync, { type Handler } from "gensync"; + +import loadConfig from "./config/index.ts"; +import type { InputOptions, ResolvedConfig } from "./config/index.ts"; +import { run } from "./transformation/index.ts"; +import type { FileResult, FileResultCallback } from "./transformation/index.ts"; +import * as fs from "./gensync-utils/fs.ts"; + +type transformFileBrowserType = typeof import("./transform-file-browser"); +type transformFileType = typeof import("./transform-file"); + +// Kind of gross, but essentially asserting that the exports of this module are the same as the +// exports of transform-file-browser, since this file may be replaced at bundle time with +// transform-file-browser. +({}) as any as transformFileBrowserType as transformFileType; + +const transformFileRunner = gensync(function* ( + filename: string, + opts?: InputOptions, +): Handler { + const options = { ...opts, filename }; + + const config: ResolvedConfig | null = yield* loadConfig(options); + if (config === null) return null; + + const code = yield* fs.readFile(filename, "utf8"); + return yield* run(config, code); +}); + +// @ts-expect-error TS doesn't detect that this signature is compatible +export function transformFile( + filename: string, + callback: FileResultCallback, +): void; +export function transformFile( + filename: string, + opts: InputOptions | undefined | null, + callback: FileResultCallback, +): void; +export function transformFile( + ...args: Parameters +) { + transformFileRunner.errback(...args); +} + +export function transformFileSync( + ...args: Parameters +) { + return transformFileRunner.sync(...args); +} +export function transformFileAsync( + ...args: Parameters +) { + return transformFileRunner.async(...args); +} diff --git a/node_modules/@babel/generator/LICENSE b/node_modules/@babel/generator/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/generator/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/generator/README.md b/node_modules/@babel/generator/README.md new file mode 100644 index 0000000..d56149a --- /dev/null +++ b/node_modules/@babel/generator/README.md @@ -0,0 +1,19 @@ +# @babel/generator + +> Turns an AST into code. + +See our website [@babel/generator](https://babeljs.io/docs/babel-generator) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20generator%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/generator +``` + +or using yarn: + +```sh +yarn add @babel/generator --dev +``` diff --git a/node_modules/@babel/generator/lib/buffer.js b/node_modules/@babel/generator/lib/buffer.js new file mode 100644 index 0000000..4eceb96 --- /dev/null +++ b/node_modules/@babel/generator/lib/buffer.js @@ -0,0 +1,317 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +class Buffer { + constructor(map, indentChar) { + this._map = null; + this._buf = ""; + this._str = ""; + this._appendCount = 0; + this._last = 0; + this._queue = []; + this._queueCursor = 0; + this._canMarkIdName = true; + this._indentChar = ""; + this._fastIndentations = []; + this._position = { + line: 1, + column: 0 + }; + this._sourcePosition = { + identifierName: undefined, + identifierNamePos: undefined, + line: undefined, + column: undefined, + filename: undefined + }; + this._map = map; + this._indentChar = indentChar; + for (let i = 0; i < 64; i++) { + this._fastIndentations.push(indentChar.repeat(i)); + } + this._allocQueue(); + } + _allocQueue() { + const queue = this._queue; + for (let i = 0; i < 16; i++) { + queue.push({ + char: 0, + repeat: 1, + line: undefined, + column: undefined, + identifierName: undefined, + identifierNamePos: undefined, + filename: "" + }); + } + } + _pushQueue(char, repeat, line, column, filename) { + const cursor = this._queueCursor; + if (cursor === this._queue.length) { + this._allocQueue(); + } + const item = this._queue[cursor]; + item.char = char; + item.repeat = repeat; + item.line = line; + item.column = column; + item.filename = filename; + this._queueCursor++; + } + _popQueue() { + if (this._queueCursor === 0) { + throw new Error("Cannot pop from empty queue"); + } + return this._queue[--this._queueCursor]; + } + get() { + this._flush(); + const map = this._map; + const result = { + code: (this._buf + this._str).trimRight(), + decodedMap: map == null ? void 0 : map.getDecoded(), + get __mergedMap() { + return this.map; + }, + get map() { + const resultMap = map ? map.get() : null; + result.map = resultMap; + return resultMap; + }, + set map(value) { + Object.defineProperty(result, "map", { + value, + writable: true + }); + }, + get rawMappings() { + const mappings = map == null ? void 0 : map.getRawMappings(); + result.rawMappings = mappings; + return mappings; + }, + set rawMappings(value) { + Object.defineProperty(result, "rawMappings", { + value, + writable: true + }); + } + }; + return result; + } + append(str, maybeNewline) { + this._flush(); + this._append(str, this._sourcePosition, maybeNewline); + } + appendChar(char) { + this._flush(); + this._appendChar(char, 1, this._sourcePosition); + } + queue(char) { + if (char === 10) { + while (this._queueCursor !== 0) { + const char = this._queue[this._queueCursor - 1].char; + if (char !== 32 && char !== 9) { + break; + } + this._queueCursor--; + } + } + const sourcePosition = this._sourcePosition; + this._pushQueue(char, 1, sourcePosition.line, sourcePosition.column, sourcePosition.filename); + } + queueIndentation(repeat) { + if (repeat === 0) return; + this._pushQueue(-1, repeat, undefined, undefined, undefined); + } + _flush() { + const queueCursor = this._queueCursor; + const queue = this._queue; + for (let i = 0; i < queueCursor; i++) { + const item = queue[i]; + this._appendChar(item.char, item.repeat, item); + } + this._queueCursor = 0; + } + _appendChar(char, repeat, sourcePos) { + this._last = char; + if (char === -1) { + const fastIndentation = this._fastIndentations[repeat]; + if (fastIndentation !== undefined) { + this._str += fastIndentation; + } else { + this._str += repeat > 1 ? this._indentChar.repeat(repeat) : this._indentChar; + } + } else { + this._str += repeat > 1 ? String.fromCharCode(char).repeat(repeat) : String.fromCharCode(char); + } + if (char !== 10) { + this._mark(sourcePos.line, sourcePos.column, sourcePos.identifierName, sourcePos.identifierNamePos, sourcePos.filename); + this._position.column += repeat; + } else { + this._position.line++; + this._position.column = 0; + } + if (this._canMarkIdName) { + sourcePos.identifierName = undefined; + sourcePos.identifierNamePos = undefined; + } + } + _append(str, sourcePos, maybeNewline) { + const len = str.length; + const position = this._position; + this._last = str.charCodeAt(len - 1); + if (++this._appendCount > 4096) { + +this._str; + this._buf += this._str; + this._str = str; + this._appendCount = 0; + } else { + this._str += str; + } + if (!maybeNewline && !this._map) { + position.column += len; + return; + } + const { + column, + identifierName, + identifierNamePos, + filename + } = sourcePos; + let line = sourcePos.line; + if ((identifierName != null || identifierNamePos != null) && this._canMarkIdName) { + sourcePos.identifierName = undefined; + sourcePos.identifierNamePos = undefined; + } + let i = str.indexOf("\n"); + let last = 0; + if (i !== 0) { + this._mark(line, column, identifierName, identifierNamePos, filename); + } + while (i !== -1) { + position.line++; + position.column = 0; + last = i + 1; + if (last < len && line !== undefined) { + this._mark(++line, 0, undefined, undefined, filename); + } + i = str.indexOf("\n", last); + } + position.column += len - last; + } + _mark(line, column, identifierName, identifierNamePos, filename) { + var _this$_map; + (_this$_map = this._map) == null || _this$_map.mark(this._position, line, column, identifierName, identifierNamePos, filename); + } + removeTrailingNewline() { + const queueCursor = this._queueCursor; + if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 10) { + this._queueCursor--; + } + } + removeLastSemicolon() { + const queueCursor = this._queueCursor; + if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 59) { + this._queueCursor--; + } + } + getLastChar() { + const queueCursor = this._queueCursor; + return queueCursor !== 0 ? this._queue[queueCursor - 1].char : this._last; + } + getNewlineCount() { + const queueCursor = this._queueCursor; + let count = 0; + if (queueCursor === 0) return this._last === 10 ? 1 : 0; + for (let i = queueCursor - 1; i >= 0; i--) { + if (this._queue[i].char !== 10) { + break; + } + count++; + } + return count === queueCursor && this._last === 10 ? count + 1 : count; + } + endsWithCharAndNewline() { + const queue = this._queue; + const queueCursor = this._queueCursor; + if (queueCursor !== 0) { + const lastCp = queue[queueCursor - 1].char; + if (lastCp !== 10) return; + if (queueCursor > 1) { + return queue[queueCursor - 2].char; + } else { + return this._last; + } + } + } + hasContent() { + return this._queueCursor !== 0 || !!this._last; + } + exactSource(loc, cb) { + if (!this._map) { + cb(); + return; + } + this.source("start", loc); + const identifierName = loc.identifierName; + const sourcePos = this._sourcePosition; + if (identifierName) { + this._canMarkIdName = false; + sourcePos.identifierName = identifierName; + } + cb(); + if (identifierName) { + this._canMarkIdName = true; + sourcePos.identifierName = undefined; + sourcePos.identifierNamePos = undefined; + } + this.source("end", loc); + } + source(prop, loc) { + if (!this._map) return; + this._normalizePosition(prop, loc, 0); + } + sourceWithOffset(prop, loc, columnOffset) { + if (!this._map) return; + this._normalizePosition(prop, loc, columnOffset); + } + _normalizePosition(prop, loc, columnOffset) { + const pos = loc[prop]; + const target = this._sourcePosition; + if (pos) { + target.line = pos.line; + target.column = Math.max(pos.column + columnOffset, 0); + target.filename = loc.filename; + } + } + getCurrentColumn() { + const queue = this._queue; + const queueCursor = this._queueCursor; + let lastIndex = -1; + let len = 0; + for (let i = 0; i < queueCursor; i++) { + const item = queue[i]; + if (item.char === 10) { + lastIndex = len; + } + len += item.repeat; + } + return lastIndex === -1 ? this._position.column + len : len - 1 - lastIndex; + } + getCurrentLine() { + let count = 0; + const queue = this._queue; + for (let i = 0; i < this._queueCursor; i++) { + if (queue[i].char === 10) { + count++; + } + } + return this._position.line + count; + } +} +exports.default = Buffer; + +//# sourceMappingURL=buffer.js.map diff --git a/node_modules/@babel/generator/lib/buffer.js.map b/node_modules/@babel/generator/lib/buffer.js.map new file mode 100644 index 0000000..402a210 --- /dev/null +++ b/node_modules/@babel/generator/lib/buffer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["Buffer","constructor","map","indentChar","_map","_buf","_str","_appendCount","_last","_queue","_queueCursor","_canMarkIdName","_indentChar","_fastIndentations","_position","line","column","_sourcePosition","identifierName","undefined","identifierNamePos","filename","i","push","repeat","_allocQueue","queue","char","_pushQueue","cursor","length","item","_popQueue","Error","get","_flush","result","code","trimRight","decodedMap","getDecoded","__mergedMap","resultMap","value","Object","defineProperty","writable","rawMappings","mappings","getRawMappings","append","str","maybeNewline","_append","appendChar","_appendChar","sourcePosition","queueIndentation","queueCursor","sourcePos","fastIndentation","String","fromCharCode","_mark","len","position","charCodeAt","indexOf","last","_this$_map","mark","removeTrailingNewline","removeLastSemicolon","getLastChar","getNewlineCount","count","endsWithCharAndNewline","lastCp","hasContent","exactSource","loc","cb","source","prop","_normalizePosition","sourceWithOffset","columnOffset","pos","target","Math","max","getCurrentColumn","lastIndex","getCurrentLine","exports","default"],"sources":["../src/buffer.ts"],"sourcesContent":["import type SourceMap from \"./source-map.ts\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charcodes from \"charcodes\";\n\nexport type Pos = {\n line: number;\n column: number;\n index: number;\n};\nexport type Loc = {\n start?: Pos;\n end?: Pos;\n filename?: string;\n};\ntype SourcePos = {\n line: number | undefined;\n column: number | undefined;\n identifierName: string | undefined;\n filename: string | undefined;\n};\ntype InternalSourcePos = SourcePos & { identifierNamePos: Pos | undefined };\n\ntype QueueItem = {\n char: number;\n repeat: number;\n line: number | undefined;\n column: number | undefined;\n identifierName: undefined; // Not used, it always undefined.\n identifierNamePos: undefined; // Not used, it always undefined.\n filename: string | undefined;\n};\n\nexport default class Buffer {\n constructor(map: SourceMap | null, indentChar: string) {\n this._map = map;\n this._indentChar = indentChar;\n\n for (let i = 0; i < 64; i++) {\n this._fastIndentations.push(indentChar.repeat(i));\n }\n\n this._allocQueue();\n }\n\n _map: SourceMap | null = null;\n _buf = \"\";\n _str = \"\";\n _appendCount = 0;\n _last = 0;\n _queue: QueueItem[] = [];\n _queueCursor = 0;\n _canMarkIdName = true;\n _indentChar = \"\";\n _fastIndentations: string[] = [];\n\n _position = {\n line: 1,\n column: 0,\n };\n _sourcePosition: InternalSourcePos = {\n identifierName: undefined,\n identifierNamePos: undefined,\n line: undefined,\n column: undefined,\n filename: undefined,\n };\n\n _allocQueue() {\n const queue = this._queue;\n\n for (let i = 0; i < 16; i++) {\n queue.push({\n char: 0,\n repeat: 1,\n line: undefined,\n column: undefined,\n identifierName: undefined,\n identifierNamePos: undefined,\n filename: \"\",\n });\n }\n }\n\n _pushQueue(\n char: number,\n repeat: number,\n line: number | undefined,\n column: number | undefined,\n filename: string | undefined,\n ) {\n const cursor = this._queueCursor;\n if (cursor === this._queue.length) {\n this._allocQueue();\n }\n const item = this._queue[cursor];\n item.char = char;\n item.repeat = repeat;\n item.line = line;\n item.column = column;\n item.filename = filename;\n\n this._queueCursor++;\n }\n\n _popQueue(): QueueItem {\n if (this._queueCursor === 0) {\n throw new Error(\"Cannot pop from empty queue\");\n }\n return this._queue[--this._queueCursor];\n }\n\n /**\n * Get the final string output from the buffer, along with the sourcemap if one exists.\n */\n\n get() {\n this._flush();\n\n const map = this._map;\n const result = {\n // Whatever trim is used here should not execute a regex against the\n // source string since it may be arbitrarily large after all transformations\n code: (this._buf + this._str).trimRight(),\n // Decoded sourcemap is free to generate.\n decodedMap: map?.getDecoded(),\n // Used as a marker for backwards compatibility. We moved input map merging\n // into the generator. We cannot merge the input map a second time, so the\n // presence of this field tells us we've already done the work.\n get __mergedMap() {\n return this.map;\n },\n // Encoding the sourcemap is moderately CPU expensive.\n get map() {\n const resultMap = map ? map.get() : null;\n result.map = resultMap;\n return resultMap;\n },\n set map(value) {\n Object.defineProperty(result, \"map\", { value, writable: true });\n },\n // Retrieving the raw mappings is very memory intensive.\n get rawMappings() {\n const mappings = map?.getRawMappings();\n result.rawMappings = mappings;\n return mappings;\n },\n set rawMappings(value) {\n Object.defineProperty(result, \"rawMappings\", { value, writable: true });\n },\n };\n\n return result;\n }\n\n /**\n * Add a string to the buffer that cannot be reverted.\n */\n\n append(str: string, maybeNewline: boolean): void {\n this._flush();\n\n this._append(str, this._sourcePosition, maybeNewline);\n }\n\n appendChar(char: number): void {\n this._flush();\n this._appendChar(char, 1, this._sourcePosition);\n }\n\n /**\n * Add a string to the buffer than can be reverted.\n */\n queue(char: number): void {\n // Drop trailing spaces when a newline is inserted.\n if (char === charcodes.lineFeed) {\n while (this._queueCursor !== 0) {\n const char = this._queue[this._queueCursor - 1].char;\n if (char !== charcodes.space && char !== charcodes.tab) {\n break;\n }\n\n this._queueCursor--;\n }\n }\n\n const sourcePosition = this._sourcePosition;\n this._pushQueue(\n char,\n 1,\n sourcePosition.line,\n sourcePosition.column,\n sourcePosition.filename,\n );\n }\n\n /**\n * Same as queue, but this indentation will never have a sourcemap marker.\n */\n queueIndentation(repeat: number): void {\n if (repeat === 0) return;\n this._pushQueue(-1, repeat, undefined, undefined, undefined);\n }\n\n _flush(): void {\n const queueCursor = this._queueCursor;\n const queue = this._queue;\n for (let i = 0; i < queueCursor; i++) {\n const item: QueueItem = queue[i];\n this._appendChar(item.char, item.repeat, item);\n }\n this._queueCursor = 0;\n }\n\n _appendChar(\n char: number,\n repeat: number,\n sourcePos: InternalSourcePos,\n ): void {\n this._last = char;\n\n if (char === -1) {\n const fastIndentation = this._fastIndentations[repeat];\n if (fastIndentation !== undefined) {\n this._str += fastIndentation;\n } else {\n this._str +=\n repeat > 1 ? this._indentChar.repeat(repeat) : this._indentChar;\n }\n } else {\n this._str +=\n repeat > 1\n ? String.fromCharCode(char).repeat(repeat)\n : String.fromCharCode(char);\n }\n\n if (char !== charcodes.lineFeed) {\n this._mark(\n sourcePos.line,\n sourcePos.column,\n sourcePos.identifierName,\n sourcePos.identifierNamePos,\n sourcePos.filename,\n );\n this._position.column += repeat;\n } else {\n this._position.line++;\n this._position.column = 0;\n }\n\n if (this._canMarkIdName) {\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n }\n\n _append(\n str: string,\n sourcePos: InternalSourcePos,\n maybeNewline: boolean,\n ): void {\n const len = str.length;\n const position = this._position;\n\n this._last = str.charCodeAt(len - 1);\n\n if (++this._appendCount > 4096) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n +this._str; // Unexplainable huge performance boost. Ref: https://github.com/davidmarkclements/flatstr License: MIT\n this._buf += this._str;\n this._str = str;\n this._appendCount = 0;\n } else {\n this._str += str;\n }\n\n if (!maybeNewline && !this._map) {\n position.column += len;\n return;\n }\n\n const { column, identifierName, identifierNamePos, filename } = sourcePos;\n let line = sourcePos.line;\n\n if (\n (identifierName != null || identifierNamePos != null) &&\n this._canMarkIdName\n ) {\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n\n // Search for newline chars. We search only for `\\n`, since both `\\r` and\n // `\\r\\n` are normalized to `\\n` during parse. We exclude `\\u2028` and\n // `\\u2029` for performance reasons, they're so uncommon that it's probably\n // ok. It's also unclear how other sourcemap utilities handle them...\n let i = str.indexOf(\"\\n\");\n let last = 0;\n\n // If the string starts with a newline char, then adding a mark is redundant.\n // This catches both \"no newlines\" and \"newline after several chars\".\n if (i !== 0) {\n this._mark(line, column, identifierName, identifierNamePos, filename);\n }\n\n // Now, find each remaining newline char in the string.\n while (i !== -1) {\n position.line++;\n position.column = 0;\n last = i + 1;\n\n // We mark the start of each line, which happens directly after this newline char\n // unless this is the last char.\n // When manually adding multi-line content (such as a comment), `line` will be `undefined`.\n if (last < len && line !== undefined) {\n this._mark(++line, 0, undefined, undefined, filename);\n }\n i = str.indexOf(\"\\n\", last);\n }\n position.column += len - last;\n }\n\n _mark(\n line: number | undefined,\n column: number | undefined,\n identifierName: string | undefined,\n identifierNamePos: Pos | undefined,\n filename: string | undefined,\n ): void {\n this._map?.mark(\n this._position,\n line,\n column,\n identifierName,\n identifierNamePos,\n filename,\n );\n }\n\n removeTrailingNewline(): void {\n const queueCursor = this._queueCursor;\n if (\n queueCursor !== 0 &&\n this._queue[queueCursor - 1].char === charcodes.lineFeed\n ) {\n this._queueCursor--;\n }\n }\n\n removeLastSemicolon(): void {\n const queueCursor = this._queueCursor;\n if (\n queueCursor !== 0 &&\n this._queue[queueCursor - 1].char === charcodes.semicolon\n ) {\n this._queueCursor--;\n }\n }\n\n getLastChar(): number {\n const queueCursor = this._queueCursor;\n return queueCursor !== 0 ? this._queue[queueCursor - 1].char : this._last;\n }\n\n /**\n * This will only detect at most 1 newline after a call to `flush()`,\n * but this has not been found so far, and an accurate count can be achieved if needed later.\n */\n getNewlineCount(): number {\n const queueCursor = this._queueCursor;\n let count = 0;\n if (queueCursor === 0) return this._last === charcodes.lineFeed ? 1 : 0;\n for (let i = queueCursor - 1; i >= 0; i--) {\n if (this._queue[i].char !== charcodes.lineFeed) {\n break;\n }\n count++;\n }\n return count === queueCursor && this._last === charcodes.lineFeed\n ? count + 1\n : count;\n }\n\n /**\n * check if current _last + queue ends with newline, return the character before newline\n */\n endsWithCharAndNewline(): number | undefined {\n const queue = this._queue;\n const queueCursor = this._queueCursor;\n if (queueCursor !== 0) {\n // every element in queue is one-length whitespace string\n const lastCp = queue[queueCursor - 1].char;\n if (lastCp !== charcodes.lineFeed) return;\n if (queueCursor > 1) {\n return queue[queueCursor - 2].char;\n } else {\n return this._last;\n }\n }\n // We assume that everything being matched is at most a single token plus some whitespace,\n // which everything currently is, but otherwise we'd have to expand _last or check _buf.\n }\n\n hasContent(): boolean {\n return this._queueCursor !== 0 || !!this._last;\n }\n\n /**\n * Certain sourcemap usecases expect mappings to be more accurate than\n * Babel's generic sourcemap handling allows. For now, we special-case\n * identifiers to allow for the primary cases to work.\n * The goal of this line is to ensure that the map output from Babel will\n * have an exact range on identifiers in the output code. Without this\n * line, Babel would potentially include some number of trailing tokens\n * that are printed after the identifier, but before another location has\n * been assigned.\n * This allows tooling like Rollup and Webpack to more accurately perform\n * their own transformations. Most importantly, this allows the import/export\n * transformations performed by those tools to loose less information when\n * applying their own transformations on top of the code and map results\n * generated by Babel itself.\n *\n * The primary example of this is the snippet:\n *\n * import mod from \"mod\";\n * mod();\n *\n * With this line, there will be one mapping range over \"mod\" and another\n * over \"();\", where previously it would have been a single mapping.\n */\n exactSource(loc: Loc, cb: () => void) {\n if (!this._map) {\n cb();\n return;\n }\n\n this.source(\"start\", loc);\n // @ts-expect-error identifierName is not defined\n const identifierName = loc.identifierName;\n const sourcePos = this._sourcePosition;\n if (identifierName) {\n this._canMarkIdName = false;\n sourcePos.identifierName = identifierName;\n }\n cb();\n\n if (identifierName) {\n this._canMarkIdName = true;\n sourcePos.identifierName = undefined;\n sourcePos.identifierNamePos = undefined;\n }\n this.source(\"end\", loc);\n }\n\n /**\n * Sets a given position as the current source location so generated code after this call\n * will be given this position in the sourcemap.\n */\n\n source(prop: \"start\" | \"end\", loc: Loc): void {\n if (!this._map) return;\n\n // Since this is called extremely often, we reuse the same _sourcePosition\n // object for the whole lifetime of the buffer.\n this._normalizePosition(prop, loc, 0);\n }\n\n sourceWithOffset(\n prop: \"start\" | \"end\",\n loc: Loc,\n columnOffset: number,\n ): void {\n if (!this._map) return;\n\n this._normalizePosition(prop, loc, columnOffset);\n }\n\n _normalizePosition(prop: \"start\" | \"end\", loc: Loc, columnOffset: number) {\n const pos = loc[prop];\n const target = this._sourcePosition;\n\n if (pos) {\n target.line = pos.line;\n // TODO: Fix https://github.com/babel/babel/issues/15712 in downstream\n target.column = Math.max(pos.column + columnOffset, 0);\n target.filename = loc.filename;\n }\n }\n\n getCurrentColumn(): number {\n const queue = this._queue;\n const queueCursor = this._queueCursor;\n\n let lastIndex = -1;\n let len = 0;\n for (let i = 0; i < queueCursor; i++) {\n const item = queue[i];\n if (item.char === charcodes.lineFeed) {\n lastIndex = len;\n }\n len += item.repeat;\n }\n\n return lastIndex === -1 ? this._position.column + len : len - 1 - lastIndex;\n }\n\n getCurrentLine(): number {\n let count = 0;\n\n const queue = this._queue;\n for (let i = 0; i < this._queueCursor; i++) {\n if (queue[i].char === charcodes.lineFeed) {\n count++;\n }\n }\n\n return this._position.line + count;\n }\n}\n"],"mappings":";;;;;;AAkCe,MAAMA,MAAM,CAAC;EAC1BC,WAAWA,CAACC,GAAqB,EAAEC,UAAkB,EAAE;IAAA,KAWvDC,IAAI,GAAqB,IAAI;IAAA,KAC7BC,IAAI,GAAG,EAAE;IAAA,KACTC,IAAI,GAAG,EAAE;IAAA,KACTC,YAAY,GAAG,CAAC;IAAA,KAChBC,KAAK,GAAG,CAAC;IAAA,KACTC,MAAM,GAAgB,EAAE;IAAA,KACxBC,YAAY,GAAG,CAAC;IAAA,KAChBC,cAAc,GAAG,IAAI;IAAA,KACrBC,WAAW,GAAG,EAAE;IAAA,KAChBC,iBAAiB,GAAa,EAAE;IAAA,KAEhCC,SAAS,GAAG;MACVC,I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AAMjD,KAAK,GAAG,IAAI,CAACjB,MAAM;IACzB,KAAK,IAAIa,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG,IAAI,CAACZ,YAAY,EAAEY,CAAC,EAAE,EAAE;MAC1C,IAAII,KAAK,CAACJ,CAAC,CAAC,CAACK,IAAI,OAAuB,EAAE;QACxCgD,KAAK,EAAE;MACT;IACF;IAEA,OAAO,IAAI,CAAC7D,SAAS,CAACC,IAAI,GAAG4D,KAAK;EACpC;AACF;AAACmB,OAAA,CAAAC,OAAA,GAAA/F,MAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/base.js b/node_modules/@babel/generator/lib/generators/base.js new file mode 100644 index 0000000..eca9077 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/base.js @@ -0,0 +1,87 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BlockStatement = BlockStatement; +exports.Directive = Directive; +exports.DirectiveLiteral = DirectiveLiteral; +exports.File = File; +exports.InterpreterDirective = InterpreterDirective; +exports.Placeholder = Placeholder; +exports.Program = Program; +function File(node) { + if (node.program) { + this.print(node.program.interpreter); + } + this.print(node.program); +} +function Program(node) { + var _node$directives; + this.noIndentInnerCommentsHere(); + this.printInnerComments(); + const directivesLen = (_node$directives = node.directives) == null ? void 0 : _node$directives.length; + if (directivesLen) { + var _node$directives$trai; + const newline = node.body.length ? 2 : 1; + this.printSequence(node.directives, undefined, newline); + if (!((_node$directives$trai = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai.length)) { + this.newline(newline); + } + } + this.printSequence(node.body); +} +function BlockStatement(node) { + var _node$directives2; + this.tokenChar(123); + const exit = this.enterDelimited(); + const directivesLen = (_node$directives2 = node.directives) == null ? void 0 : _node$directives2.length; + if (directivesLen) { + var _node$directives$trai2; + const newline = node.body.length ? 2 : 1; + this.printSequence(node.directives, true, newline); + if (!((_node$directives$trai2 = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai2.length)) { + this.newline(newline); + } + } + this.printSequence(node.body, true); + exit(); + this.rightBrace(node); +} +function Directive(node) { + this.print(node.value); + this.semicolon(); +} +const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/; +const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/; +function DirectiveLiteral(node) { + const raw = this.getPossibleRaw(node); + if (!this.format.minified && raw !== undefined) { + this.token(raw); + return; + } + const { + value + } = node; + if (!unescapedDoubleQuoteRE.test(value)) { + this.token(`"${value}"`); + } else if (!unescapedSingleQuoteRE.test(value)) { + this.token(`'${value}'`); + } else { + throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes."); + } +} +function InterpreterDirective(node) { + this.token(`#!${node.value}`); + this.newline(1, true); +} +function Placeholder(node) { + this.token("%%"); + this.print(node.name); + this.token("%%"); + if (node.expectedNode === "Statement") { + this.semicolon(); + } +} + +//# sourceMappingURL=base.js.map diff --git a/node_modules/@babel/generator/lib/generators/base.js.map b/node_modules/@babel/generator/lib/generators/base.js.map new file mode 100644 index 0000000..c40d63c --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/base.js.map @@ -0,0 +1 @@ +{"version":3,"names":["File","node","program","print","interpreter","Program","_node$directives","noIndentInnerCommentsHere","printInnerComments","directivesLen","directives","length","_node$directives$trai","newline","body","printSequence","undefined","trailingComments","BlockStatement","_node$directives2","token","exit","enterDelimited","_node$directives$trai2","rightBrace","Directive","value","semicolon","unescapedSingleQuoteRE","unescapedDoubleQuoteRE","DirectiveLiteral","raw","getPossibleRaw","format","minified","test","Error","InterpreterDirective","Placeholder","name","expectedNode"],"sources":["../../src/generators/base.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function File(this: Printer, node: t.File) {\n if (node.program) {\n // Print this here to ensure that Program node 'leadingComments' still\n // get printed after the hashbang.\n this.print(node.program.interpreter);\n }\n\n this.print(node.program);\n}\n\nexport function Program(this: Printer, node: t.Program) {\n // An empty Program doesn't have any inner tokens, so\n // we must explicitly print its inner comments.\n this.noIndentInnerCommentsHere();\n this.printInnerComments();\n\n const directivesLen = node.directives?.length;\n if (directivesLen) {\n const newline = node.body.length ? 2 : 1;\n this.printSequence(node.directives, undefined, newline);\n if (!node.directives[directivesLen - 1].trailingComments?.length) {\n this.newline(newline);\n }\n }\n\n this.printSequence(node.body);\n}\n\nexport function BlockStatement(this: Printer, node: t.BlockStatement) {\n this.token(\"{\");\n const exit = this.enterDelimited();\n\n const directivesLen = node.directives?.length;\n if (directivesLen) {\n const newline = node.body.length ? 2 : 1;\n this.printSequence(node.directives, true, newline);\n if (!node.directives[directivesLen - 1].trailingComments?.length) {\n this.newline(newline);\n }\n }\n\n this.printSequence(node.body, true);\n\n exit();\n this.rightBrace(node);\n}\n\nexport function Directive(this: Printer, node: t.Directive) {\n this.print(node.value);\n this.semicolon();\n}\n\n// These regexes match an even number of \\ followed by a quote\nconst unescapedSingleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*'/;\nconst unescapedDoubleQuoteRE = /(?:^|[^\\\\])(?:\\\\\\\\)*\"/;\n\nexport function DirectiveLiteral(this: Printer, node: t.DirectiveLiteral) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.token(raw);\n return;\n }\n\n const { value } = node;\n\n // NOTE: In directives we can't change escapings,\n // because they change the behavior.\n // e.g. \"us\\x65 strict\" (\\x65 is e) is not a \"use strict\" directive.\n\n if (!unescapedDoubleQuoteRE.test(value)) {\n this.token(`\"${value}\"`);\n } else if (!unescapedSingleQuoteRE.test(value)) {\n this.token(`'${value}'`);\n } else {\n throw new Error(\n \"Malformed AST: it is not possible to print a directive containing\" +\n \" both unescaped single and double quotes.\",\n );\n }\n}\n\nexport function InterpreterDirective(\n this: Printer,\n node: t.InterpreterDirective,\n) {\n this.token(`#!${node.value}`);\n this.newline(1, true);\n}\n\nexport function Placeholder(this: Printer, node: t.Placeholder) {\n this.token(\"%%\");\n this.print(node.name);\n this.token(\"%%\");\n\n if (node.expectedNode === \"Statement\") {\n this.semicolon();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGO,SAASA,IAAIA,CAAgBC,IAAY,EAAE;EAChD,IAAIA,IAAI,CAACC,OAAO,EAAE;IAGhB,IAAI,CAACC,KAAK,CAACF,IAAI,CAACC,OAAO,CAACE,WAAW,CAAC;EACtC;EAEA,IAAI,CAACD,KAAK,CAACF,IAAI,CAACC,OAAO,CAAC;AAC1B;AAEO,SAASG,OAAOA,CAAgBJ,IAAe,EAAE;EAAA,IAAAK,gBAAA;EAGtD,IAAI,CAACC,yBAAyB,CAAC,CAAC;EAChC,IAAI,CAACC,kBAAkB,CAAC,CAAC;EAEzB,MAAMC,aAAa,IAAAH,gBAAA,GAAGL,IAAI,CAACS,UAAU,qBAAfJ,gBAAA,CAAiBK,MAAM;EAC7C,IAAIF,aAAa,EAAE;IAAA,IAAAG,qBAAA;IACjB,MAAMC,OAAO,GAAGZ,IAAI,CAACa,IAAI,CAACH,MAAM,GAAG,CAAC,GAAG,CAAC;IACxC,IAAI,CAACI,aAAa,CAACd,IAAI,CAACS,UAAU,EAAEM,SAAS,EAAEH,OAAO,CAAC;IACvD,IAAI,GAAAD,qBAAA,GAACX,IAAI,CAACS,UAAU,CAACD,aAAa,GAAG,CAAC,CAAC,CAACQ,gBAAgB,aAAnDL,qBAAA,CAAqDD,MAAM,GAAE;MAChE,IAAI,CAACE,OAAO,CAACA,OAAO,CAAC;IACvB;EACF;EAEA,IAAI,CAACE,aAAa,CAACd,IAAI,CAACa,IAAI,CAAC;AAC/B;AAEO,SAASI,cAAcA,CAAgBjB,IAAsB,EAAE;EAAA,IAAAkB,iBAAA;EACpE,IAAI,CAACC,SAAK,IAAI,CAAC;EACf,MAAMC,IAAI,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;EAElC,MAAMb,aAAa,IAAAU,iBAAA,GAAGlB,IAAI,CAACS,UAAU,qBAAfS,iBAAA,CAAiBR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K,CAAC,EAAE;IAC9C,IAAI,CAACN,KAAK,CAAC,IAAIM,KAAK,GAAG,CAAC;EAC1B,CAAC,MAAM;IACL,MAAM,IAAIU,KAAK,CACb,mEAAmE,GACjE,2CACJ,CAAC;EACH;AACF;AAEO,SAASC,oBAAoBA,CAElCpC,IAA4B,EAC5B;EACA,IAAI,CAACmB,KAAK,CAAC,KAAKnB,IAAI,CAACyB,KAAK,EAAE,CAAC;EAC7B,IAAI,CAACb,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC;AACvB;AAEO,SAASyB,WAAWA,CAAgBrC,IAAmB,EAAE;EAC9D,IAAI,CAACmB,KAAK,CAAC,IAAI,CAAC;EAChB,IAAI,CAACjB,KAAK,CAACF,IAAI,CAACsC,IAAI,CAAC;EACrB,IAAI,CAACnB,KAAK,CAAC,IAAI,CAAC;EAEhB,IAAInB,IAAI,CAACuC,YAAY,KAAK,WAAW,EAAE;IACrC,IAAI,CAACb,SAAS,CAAC,CAAC;EAClB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/classes.js b/node_modules/@babel/generator/lib/generators/classes.js new file mode 100644 index 0000000..6cdc975 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/classes.js @@ -0,0 +1,212 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ClassAccessorProperty = ClassAccessorProperty; +exports.ClassBody = ClassBody; +exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration; +exports.ClassMethod = ClassMethod; +exports.ClassPrivateMethod = ClassPrivateMethod; +exports.ClassPrivateProperty = ClassPrivateProperty; +exports.ClassProperty = ClassProperty; +exports.StaticBlock = StaticBlock; +exports._classMethodHead = _classMethodHead; +var _t = require("@babel/types"); +const { + isExportDefaultDeclaration, + isExportNamedDeclaration +} = _t; +function ClassDeclaration(node, parent) { + const inExport = isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent); + if (!inExport || !this._shouldPrintDecoratorsBeforeExport(parent)) { + this.printJoin(node.decorators); + } + if (node.declare) { + this.word("declare"); + this.space(); + } + if (node.abstract) { + this.word("abstract"); + this.space(); + } + this.word("class"); + if (node.id) { + this.space(); + this.print(node.id); + } + this.print(node.typeParameters); + if (node.superClass) { + this.space(); + this.word("extends"); + this.space(); + this.print(node.superClass); + this.print(node.superTypeParameters); + } + if (node.implements) { + this.space(); + this.word("implements"); + this.space(); + this.printList(node.implements); + } + this.space(); + this.print(node.body); +} +function ClassBody(node) { + this.tokenChar(123); + if (node.body.length === 0) { + this.tokenChar(125); + } else { + this.newline(); + const separator = classBodyEmptySemicolonsPrinter(this, node); + separator == null || separator(-1); + const exit = this.enterDelimited(); + this.printJoin(node.body, true, true, separator, true); + exit(); + if (!this.endsWith(10)) this.newline(); + this.rightBrace(node); + } +} +function classBodyEmptySemicolonsPrinter(printer, node) { + if (!printer.tokenMap || node.start == null || node.end == null) { + return null; + } + const indexes = printer.tokenMap.getIndexes(node); + if (!indexes) return null; + let k = 1; + let occurrenceCount = 0; + let nextLocIndex = 0; + const advanceNextLocIndex = () => { + while (nextLocIndex < node.body.length && node.body[nextLocIndex].start == null) { + nextLocIndex++; + } + }; + advanceNextLocIndex(); + return i => { + if (nextLocIndex <= i) { + nextLocIndex = i + 1; + advanceNextLocIndex(); + } + const end = nextLocIndex === node.body.length ? node.end : node.body[nextLocIndex].start; + let tok; + while (k < indexes.length && printer.tokenMap.matchesOriginal(tok = printer._tokens[indexes[k]], ";") && tok.start < end) { + printer.token(";", undefined, occurrenceCount++); + k++; + } + }; +} +function ClassProperty(node) { + this.printJoin(node.decorators); + if (!node.static && !this.format.preserveFormat) { + var _node$key$loc; + const endLine = (_node$key$loc = node.key.loc) == null || (_node$key$loc = _node$key$loc.end) == null ? void 0 : _node$key$loc.line; + if (endLine) this.catchUp(endLine); + } + this.tsPrintClassMemberModifiers(node); + if (node.computed) { + this.tokenChar(91); + this.print(node.key); + this.tokenChar(93); + } else { + this._variance(node); + this.print(node.key); + } + if (node.optional) { + this.tokenChar(63); + } + if (node.definite) { + this.tokenChar(33); + } + this.print(node.typeAnnotation); + if (node.value) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.value); + } + this.semicolon(); +} +function ClassAccessorProperty(node) { + var _node$key$loc2; + this.printJoin(node.decorators); + const endLine = (_node$key$loc2 = node.key.loc) == null || (_node$key$loc2 = _node$key$loc2.end) == null ? void 0 : _node$key$loc2.line; + if (endLine) this.catchUp(endLine); + this.tsPrintClassMemberModifiers(node); + this.word("accessor", true); + this.space(); + if (node.computed) { + this.tokenChar(91); + this.print(node.key); + this.tokenChar(93); + } else { + this._variance(node); + this.print(node.key); + } + if (node.optional) { + this.tokenChar(63); + } + if (node.definite) { + this.tokenChar(33); + } + this.print(node.typeAnnotation); + if (node.value) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.value); + } + this.semicolon(); +} +function ClassPrivateProperty(node) { + this.printJoin(node.decorators); + this.tsPrintClassMemberModifiers(node); + this.print(node.key); + if (node.optional) { + this.tokenChar(63); + } + if (node.definite) { + this.tokenChar(33); + } + this.print(node.typeAnnotation); + if (node.value) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.value); + } + this.semicolon(); +} +function ClassMethod(node) { + this._classMethodHead(node); + this.space(); + this.print(node.body); +} +function ClassPrivateMethod(node) { + this._classMethodHead(node); + this.space(); + this.print(node.body); +} +function _classMethodHead(node) { + this.printJoin(node.decorators); + if (!this.format.preserveFormat) { + var _node$key$loc3; + const endLine = (_node$key$loc3 = node.key.loc) == null || (_node$key$loc3 = _node$key$loc3.end) == null ? void 0 : _node$key$loc3.line; + if (endLine) this.catchUp(endLine); + } + this.tsPrintClassMemberModifiers(node); + this._methodHead(node); +} +function StaticBlock(node) { + this.word("static"); + this.space(); + this.tokenChar(123); + if (node.body.length === 0) { + this.tokenChar(125); + } else { + this.newline(); + this.printSequence(node.body, true); + this.rightBrace(node); + } +} + +//# sourceMappingURL=classes.js.map diff --git a/node_modules/@babel/generator/lib/generators/classes.js.map b/node_modules/@babel/generator/lib/generators/classes.js.map new file mode 100644 index 0000000..21240b0 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/classes.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","isExportDefaultDeclaration","isExportNamedDeclaration","ClassDeclaration","node","parent","inExport","_shouldPrintDecoratorsBeforeExport","printJoin","decorators","declare","word","space","abstract","id","print","typeParameters","superClass","superTypeParameters","implements","printList","body","ClassBody","token","length","newline","separator","classBodyEmptySemicolonsPrinter","exit","enterDelimited","endsWith","rightBrace","printer","tokenMap","start","end","indexes","getIndexes","k","occurrenceCount","nextLocIndex","advanceNextLocIndex","i","tok","matchesOriginal","_tokens","undefined","ClassProperty","static","format","preserveFormat","_node$key$loc","endLine","key","loc","line","catchUp","tsPrintClassMemberModifiers","computed","_variance","optional","definite","typeAnnotation","value","semicolon","ClassAccessorProperty","_node$key$loc2","ClassPrivateProperty","ClassMethod","_classMethodHead","ClassPrivateMethod","_node$key$loc3","_methodHead","StaticBlock","printSequence"],"sources":["../../src/generators/classes.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isExportDefaultDeclaration,\n isExportNamedDeclaration,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nexport function ClassDeclaration(\n this: Printer,\n node: t.ClassDeclaration,\n parent: t.Node,\n) {\n const inExport =\n isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent);\n\n if (\n !inExport ||\n !this._shouldPrintDecoratorsBeforeExport(\n parent as t.ExportDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n this.printJoin(node.decorators);\n }\n\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n // TS\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id);\n }\n\n this.print(node.typeParameters);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass);\n this.print(\n process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Renamed\n node.superTypeParameters,\n );\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements);\n }\n\n this.space();\n this.print(node.body);\n}\n\nexport { ClassDeclaration as ClassExpression };\n\nexport function ClassBody(this: Printer, node: t.ClassBody) {\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n\n const separator = classBodyEmptySemicolonsPrinter(this, node);\n separator?.(-1); // print leading semicolons in preserveFormat mode\n\n const exit = this.enterDelimited();\n this.printJoin(node.body, true, true, separator, true);\n exit();\n\n if (!this.endsWith(charCodes.lineFeed)) this.newline();\n\n this.rightBrace(node);\n }\n}\n\nfunction classBodyEmptySemicolonsPrinter(printer: Printer, node: t.ClassBody) {\n if (!printer.tokenMap || node.start == null || node.end == null) {\n return null;\n }\n\n // \"empty statements\" in class bodies are not represented in the AST.\n // Print them by checking if there are any ; tokens between the current AST\n // member and the next one.\n\n const indexes = printer.tokenMap.getIndexes(node);\n if (!indexes) return null;\n\n let k = 1; // start from 1 to skip '{'\n\n let occurrenceCount = 0;\n\n let nextLocIndex = 0;\n const advanceNextLocIndex = () => {\n while (\n nextLocIndex < node.body.length &&\n node.body[nextLocIndex].start == null\n ) {\n nextLocIndex++;\n }\n };\n advanceNextLocIndex();\n\n return (i: number) => {\n if (nextLocIndex <= i) {\n nextLocIndex = i + 1;\n advanceNextLocIndex();\n }\n\n const end =\n nextLocIndex === node.body.length\n ? node.end\n : node.body[nextLocIndex].start;\n\n let tok;\n while (\n k < indexes.length &&\n printer.tokenMap!.matchesOriginal(\n (tok = printer._tokens![indexes[k]]),\n \";\",\n ) &&\n tok.start < end!\n ) {\n printer.token(\";\", undefined, occurrenceCount++);\n k++;\n }\n };\n}\n\nexport function ClassProperty(this: Printer, node: t.ClassProperty) {\n this.printJoin(node.decorators);\n\n if (!node.static && !this.format.preserveFormat) {\n // catch up to property key, avoid line break\n // between member TS modifiers and the property key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n }\n\n this.tsPrintClassMemberModifiers(node);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key);\n this.token(\"]\");\n } else {\n this._variance(node);\n this.print(node.key);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value);\n }\n this.semicolon();\n}\n\nexport function ClassAccessorProperty(\n this: Printer,\n node: t.ClassAccessorProperty,\n) {\n this.printJoin(node.decorators);\n\n // catch up to property key, avoid line break\n // between member modifiers and the property key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n\n // TS does not support class accessor property yet\n this.tsPrintClassMemberModifiers(node);\n\n this.word(\"accessor\", true);\n this.space();\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key);\n this.token(\"]\");\n } else {\n // Todo: Flow does not support class accessor property yet.\n this._variance(node);\n this.print(node.key);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value);\n }\n this.semicolon();\n}\n\nexport function ClassPrivateProperty(\n this: Printer,\n node: t.ClassPrivateProperty,\n) {\n this.printJoin(node.decorators);\n this.tsPrintClassMemberModifiers(node);\n this.print(node.key);\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n this.print(node.typeAnnotation);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value);\n }\n this.semicolon();\n}\n\nexport function ClassMethod(this: Printer, node: t.ClassMethod) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body);\n}\n\nexport function ClassPrivateMethod(this: Printer, node: t.ClassPrivateMethod) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body);\n}\n\nexport function _classMethodHead(\n this: Printer,\n node: t.ClassMethod | t.ClassPrivateMethod | t.TSDeclareMethod,\n) {\n this.printJoin(node.decorators);\n\n if (!this.format.preserveFormat) {\n // catch up to method key, avoid line break\n // between member modifiers/method heads and the method key.\n const endLine = node.key.loc?.end?.line;\n if (endLine) this.catchUp(endLine);\n }\n\n this.tsPrintClassMemberModifiers(node);\n this._methodHead(node);\n}\n\nexport function StaticBlock(this: Printer, node: t.StaticBlock) {\n this.word(\"static\");\n this.space();\n this.token(\"{\");\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n this.printSequence(node.body, true);\n this.rightBrace(node);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAGsB;EAFpBC,0BAA0B;EAC1BC;AAAwB,IAAAH,EAAA;AAQnB,SAASI,gBAAgBA,CAE9BC,IAAwB,EACxBC,MAAc,EACd;EACA,MAAMC,QAAQ,GACZL,0BAA0B,CAACI,MAAM,CAAC,IAAIH,wBAAwB,CAACG,MAAM,CAAC;EAExE,IACE,CAACC,QAAQ,IACT,CAAC,IAAI,CAACC,kCAAkC,CACtCF,MACF,CAAC,EACD;IACA,IAAI,CAACG,SAAS,CAACJ,IAAI,CAACK,UAAU,CAAC;EACjC;EAEA,IAAIL,IAAI,CAACM,OAAO,EAAE;IAEhB,IAAI,CAACC,IAAI,CAAC,SAAS,CAAC;IACpB,IAAI,CAACC,KAAK,CAAC,CAAC;EACd;EAEA,IAAIR,IAAI,CAACS,QAAQ,EAAE;IAEjB,IAAI,CAACF,IAAI,CAAC,UAAU,CAAC;IACrB,IAAI,CAACC,KAAK,CAAC,CAAC;EACd;EAEA,IAAI,CAACD,IAAI,CAAC,OAAO,CA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AAI,CAACiE,gBAAgB,CAACjE,IAAI,CAAC;EAC3B,IAAI,CAACQ,KAAK,CAAC,CAAC;EACZ,IAAI,CAACG,KAAK,CAACX,IAAI,CAACiB,IAAI,CAAC;AACvB;AAEO,SAASgD,gBAAgBA,CAE9BjE,IAA8D,EAC9D;EACA,IAAI,CAACI,SAAS,CAACJ,IAAI,CAACK,UAAU,CAAC;EAE/B,IAAI,CAAC,IAAI,CAACwC,MAAM,CAACC,cAAc,EAAE;IAAA,IAAAqB,cAAA;IAG/B,MAAMnB,OAAO,IAAAmB,cAAA,GAAGnE,IAAI,CAACiD,GAAG,CAACC,GAAG,cAAAiB,cAAA,GAAZA,cAAA,CAAcpC,GAAG,qBAAjBoC,cAAA,CAAmBhB,IAAI;IACvC,IAAIH,OAAO,EAAE,IAAI,CAACI,OAAO,CAACJ,OAAO,CAAC;EACpC;EAEA,IAAI,CAACK,2BAA2B,CAACrD,IAAI,CAAC;EACtC,IAAI,CAACoE,WAAW,CAACpE,IAAI,CAAC;AACxB;AAEO,SAASqE,WAAWA,CAAgBrE,IAAmB,EAAE;EAC9D,IAAI,CAACO,IAAI,CAAC,QAAQ,CAAC;EACnB,IAAI,CAACC,KAAK,CAAC,CAAC;EACZ,IAAI,CAACW,SAAK,IAAI,CAAC;EACf,IAAInB,IAAI,CAACiB,IAAI,CAACG,MAAM,KAAK,CAAC,EAAE;IAC1B,IAAI,CAACD,SAAK,IAAI,CAAC;EACjB,CAAC,MAAM;IACL,IAAI,CAACE,OAAO,CAAC,CAAC;IACd,IAAI,CAACiD,aAAa,CAACtE,IAAI,CAACiB,IAAI,EAAE,IAAI,CAAC;IACnC,IAAI,CAACU,UAAU,CAAC3B,IAAI,CAAC;EACvB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/deprecated.js b/node_modules/@babel/generator/lib/generators/deprecated.js new file mode 100644 index 0000000..fc02bf9 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/deprecated.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addDeprecatedGenerators = addDeprecatedGenerators; +function addDeprecatedGenerators(PrinterClass) { + { + const deprecatedBabel7Generators = { + Noop() {}, + TSExpressionWithTypeArguments(node) { + this.print(node.expression); + this.print(node.typeParameters); + }, + DecimalLiteral(node) { + const raw = this.getPossibleRaw(node); + if (!this.format.minified && raw !== undefined) { + this.word(raw); + return; + } + this.word(node.value + "m"); + } + }; + Object.assign(PrinterClass.prototype, deprecatedBabel7Generators); + } +} + +//# sourceMappingURL=deprecated.js.map diff --git a/node_modules/@babel/generator/lib/generators/deprecated.js.map b/node_modules/@babel/generator/lib/generators/deprecated.js.map new file mode 100644 index 0000000..7327526 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/deprecated.js.map @@ -0,0 +1 @@ +{"version":3,"names":["addDeprecatedGenerators","PrinterClass","deprecatedBabel7Generators","Noop","TSExpressionWithTypeArguments","node","print","expression","typeParameters","DecimalLiteral","raw","getPossibleRaw","format","minified","undefined","word","value","Object","assign","prototype"],"sources":["../../src/generators/deprecated.ts"],"sourcesContent":["import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\n\nexport type DeprecatedBabel7ASTTypes =\n | \"Noop\"\n | \"TSExpressionWithTypeArguments\"\n | \"DecimalLiteral\";\n\nexport function addDeprecatedGenerators(PrinterClass: typeof Printer) {\n // Add Babel 7 generator methods that is removed in Babel 8\n if (!process.env.BABEL_8_BREAKING) {\n const deprecatedBabel7Generators = {\n Noop(this: Printer) {},\n\n TSExpressionWithTypeArguments(\n this: Printer,\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node: t.TSExpressionWithTypeArguments,\n ) {\n this.print(node.expression);\n this.print(node.typeParameters);\n },\n\n DecimalLiteral(this: Printer, node: any) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.word(raw);\n return;\n }\n this.word(node.value + \"m\");\n },\n } satisfies Record<\n DeprecatedBabel7ASTTypes,\n (this: Printer, node: any) => void\n >;\n Object.assign(PrinterClass.prototype, deprecatedBabel7Generators);\n }\n}\n"],"mappings":";;;;;;AAQO,SAASA,uBAAuBA,CAACC,YAA4B,EAAE;EAEjC;IACjC,MAAMC,0BAA0B,GAAG;MACjCC,IAAIA,CAAA,EAAgB,CAAC,CAAC;MAEtBC,6BAA6BA,CAG3BC,IAAqC,EACrC;QACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,UAAU,CAAC;QAC3B,IAAI,CAACD,KAAK,CAACD,IAAI,CAACG,cAAc,CAAC;MACjC,CAAC;MAEDC,cAAcA,CAAgBJ,IAAS,EAAE;QACvC,MAAMK,GAAG,GAAG,IAAI,CAACC,cAAc,CAACN,IAAI,CAAC;QACrC,IAAI,CAAC,IAAI,CAACO,MAAM,CAACC,QAAQ,IAAIH,GAAG,KAAKI,SAAS,EAAE;UAC9C,IAAI,CAACC,IAAI,CAACL,GAAG,CAAC;UACd;QACF;QACA,IAAI,CAACK,IAAI,CAACV,IAAI,CAACW,KAAK,GAAG,GAAG,CAAC;MAC7B;IACF,CAGC;IACDC,MAAM,CAACC,MAAM,CAACjB,YAAY,CAACkB,SAAS,EAAEjB,0BAA0B,CAAC;EACnE;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/expressions.js b/node_modules/@babel/generator/lib/generators/expressions.js new file mode 100644 index 0000000..5fc870e --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/expressions.js @@ -0,0 +1,300 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression; +exports.AssignmentPattern = AssignmentPattern; +exports.AwaitExpression = AwaitExpression; +exports.BindExpression = BindExpression; +exports.CallExpression = CallExpression; +exports.ConditionalExpression = ConditionalExpression; +exports.Decorator = Decorator; +exports.DoExpression = DoExpression; +exports.EmptyStatement = EmptyStatement; +exports.ExpressionStatement = ExpressionStatement; +exports.Import = Import; +exports.MemberExpression = MemberExpression; +exports.MetaProperty = MetaProperty; +exports.ModuleExpression = ModuleExpression; +exports.NewExpression = NewExpression; +exports.OptionalCallExpression = OptionalCallExpression; +exports.OptionalMemberExpression = OptionalMemberExpression; +exports.ParenthesizedExpression = ParenthesizedExpression; +exports.PrivateName = PrivateName; +exports.SequenceExpression = SequenceExpression; +exports.Super = Super; +exports.ThisExpression = ThisExpression; +exports.UnaryExpression = UnaryExpression; +exports.UpdateExpression = UpdateExpression; +exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier; +exports.YieldExpression = YieldExpression; +exports._shouldPrintDecoratorsBeforeExport = _shouldPrintDecoratorsBeforeExport; +var _t = require("@babel/types"); +var _index = require("../node/index.js"); +const { + isCallExpression, + isLiteral, + isMemberExpression, + isNewExpression, + isPattern +} = _t; +function UnaryExpression(node) { + const { + operator + } = node; + if (operator === "void" || operator === "delete" || operator === "typeof" || operator === "throw") { + this.word(operator); + this.space(); + } else { + this.token(operator); + } + this.print(node.argument); +} +function DoExpression(node) { + if (node.async) { + this.word("async", true); + this.space(); + } + this.word("do"); + this.space(); + this.print(node.body); +} +function ParenthesizedExpression(node) { + this.tokenChar(40); + const exit = this.enterDelimited(); + this.print(node.expression); + exit(); + this.rightParens(node); +} +function UpdateExpression(node) { + if (node.prefix) { + this.token(node.operator); + this.print(node.argument); + } else { + this.print(node.argument, true); + this.token(node.operator); + } +} +function ConditionalExpression(node) { + this.print(node.test); + this.space(); + this.tokenChar(63); + this.space(); + this.print(node.consequent); + this.space(); + this.tokenChar(58); + this.space(); + this.print(node.alternate); +} +function NewExpression(node, parent) { + this.word("new"); + this.space(); + this.print(node.callee); + if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, { + callee: node + }) && !isMemberExpression(parent) && !isNewExpression(parent)) { + return; + } + this.print(node.typeArguments); + { + this.print(node.typeParameters); + if (node.optional) { + this.token("?."); + } + } + if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")")) { + return; + } + this.tokenChar(40); + const exit = this.enterDelimited(); + this.printList(node.arguments, this.shouldPrintTrailingComma(")")); + exit(); + this.rightParens(node); +} +function SequenceExpression(node) { + this.printList(node.expressions); +} +function ThisExpression() { + this.word("this"); +} +function Super() { + this.word("super"); +} +function _shouldPrintDecoratorsBeforeExport(node) { + if (typeof this.format.decoratorsBeforeExport === "boolean") { + return this.format.decoratorsBeforeExport; + } + return typeof node.start === "number" && node.start === node.declaration.start; +} +function Decorator(node) { + this.tokenChar(64); + this.print(node.expression); + this.newline(); +} +function OptionalMemberExpression(node) { + let { + computed + } = node; + const { + optional, + property + } = node; + this.print(node.object); + if (!computed && isMemberExpression(property)) { + throw new TypeError("Got a MemberExpression for MemberExpression property"); + } + if (isLiteral(property) && typeof property.value === "number") { + computed = true; + } + if (optional) { + this.token("?."); + } + if (computed) { + this.tokenChar(91); + this.print(property); + this.tokenChar(93); + } else { + if (!optional) { + this.tokenChar(46); + } + this.print(property); + } +} +function OptionalCallExpression(node) { + this.print(node.callee); + { + this.print(node.typeParameters); + } + if (node.optional) { + this.token("?."); + } + this.print(node.typeArguments); + this.tokenChar(40); + const exit = this.enterDelimited(); + this.printList(node.arguments); + exit(); + this.rightParens(node); +} +function CallExpression(node) { + this.print(node.callee); + this.print(node.typeArguments); + { + this.print(node.typeParameters); + } + this.tokenChar(40); + const exit = this.enterDelimited(); + this.printList(node.arguments, this.shouldPrintTrailingComma(")")); + exit(); + this.rightParens(node); +} +function Import() { + this.word("import"); +} +function AwaitExpression(node) { + this.word("await"); + this.space(); + this.print(node.argument); +} +function YieldExpression(node) { + if (node.delegate) { + this.word("yield", true); + this.tokenChar(42); + if (node.argument) { + this.space(); + this.print(node.argument); + } + } else if (node.argument) { + this.word("yield", true); + this.space(); + this.print(node.argument); + } else { + this.word("yield"); + } +} +function EmptyStatement() { + this.semicolon(true); +} +function ExpressionStatement(node) { + this.tokenContext |= _index.TokenContext.expressionStatement; + this.print(node.expression); + this.semicolon(); +} +function AssignmentPattern(node) { + this.print(node.left); + if (node.left.type === "Identifier" || isPattern(node.left)) { + if (node.left.optional) this.tokenChar(63); + this.print(node.left.typeAnnotation); + } + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.right); +} +function AssignmentExpression(node) { + this.print(node.left); + this.space(); + if (node.operator === "in" || node.operator === "instanceof") { + this.word(node.operator); + } else { + this.token(node.operator); + this._endsWithDiv = node.operator === "/"; + } + this.space(); + this.print(node.right); +} +function BindExpression(node) { + this.print(node.object); + this.token("::"); + this.print(node.callee); +} +function MemberExpression(node) { + this.print(node.object); + if (!node.computed && isMemberExpression(node.property)) { + throw new TypeError("Got a MemberExpression for MemberExpression property"); + } + let computed = node.computed; + if (isLiteral(node.property) && typeof node.property.value === "number") { + computed = true; + } + if (computed) { + const exit = this.enterDelimited(); + this.tokenChar(91); + this.print(node.property); + this.tokenChar(93); + exit(); + } else { + this.tokenChar(46); + this.print(node.property); + } +} +function MetaProperty(node) { + this.print(node.meta); + this.tokenChar(46); + this.print(node.property); +} +function PrivateName(node) { + this.tokenChar(35); + this.print(node.id); +} +function V8IntrinsicIdentifier(node) { + this.tokenChar(37); + this.word(node.name); +} +function ModuleExpression(node) { + this.word("module", true); + this.space(); + this.tokenChar(123); + this.indent(); + const { + body + } = node; + if (body.body.length || body.directives.length) { + this.newline(); + } + this.print(body); + this.dedent(); + this.rightBrace(node); +} + +//# sourceMappingURL=expressions.js.map diff --git a/node_modules/@babel/generator/lib/generators/expressions.js.map b/node_modules/@babel/generator/lib/generators/expressions.js.map new file mode 100644 index 0000000..a4abd45 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/expressions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","_index","isCallExpression","isLiteral","isMemberExpression","isNewExpression","isPattern","UnaryExpression","node","operator","word","space","token","print","argument","DoExpression","async","body","ParenthesizedExpression","exit","enterDelimited","expression","rightParens","UpdateExpression","prefix","ConditionalExpression","test","consequent","alternate","NewExpression","parent","callee","format","minified","arguments","length","optional","typeArguments","typeParameters","tokenMap","endMatches","printList","shouldPrintTrailingComma","SequenceExpression","expressions","ThisExpression","Super","_shouldPrintDecoratorsBeforeExport","decoratorsBeforeExport","start","declaration","Decorator","newline","OptionalMemberExpression","computed","property","object","TypeError","value","OptionalCallExpression","CallExpression","Import","AwaitExpression","YieldExpression","delegate","EmptyStatement","semicolon","ExpressionStatement","tokenContext","TokenContext","expressionStatement","AssignmentPattern","left","type","typeAnnotation","right","AssignmentExpression","_endsWithDiv","BindExpression","MemberExpression","MetaProperty","meta","PrivateName","id","V8IntrinsicIdentifier","name","ModuleExpression","indent","directives","dedent","rightBrace"],"sources":["../../src/generators/expressions.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isCallExpression,\n isLiteral,\n isMemberExpression,\n isNewExpression,\n isPattern,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function UnaryExpression(this: Printer, node: t.UnaryExpression) {\n const { operator } = node;\n if (\n operator === \"void\" ||\n operator === \"delete\" ||\n operator === \"typeof\" ||\n // throwExpressions\n operator === \"throw\"\n ) {\n this.word(operator);\n this.space();\n } else {\n this.token(operator);\n }\n\n this.print(node.argument);\n}\n\nexport function DoExpression(this: Printer, node: t.DoExpression) {\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n this.word(\"do\");\n this.space();\n this.print(node.body);\n}\n\nexport function ParenthesizedExpression(\n this: Printer,\n node: t.ParenthesizedExpression,\n) {\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.print(node.expression);\n exit();\n this.rightParens(node);\n}\n\nexport function UpdateExpression(this: Printer, node: t.UpdateExpression) {\n if (node.prefix) {\n this.token(node.operator);\n this.print(node.argument);\n } else {\n this.print(node.argument, true);\n this.token(node.operator);\n }\n}\n\nexport function ConditionalExpression(\n this: Printer,\n node: t.ConditionalExpression,\n) {\n this.print(node.test);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.consequent);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.alternate);\n}\n\nexport function NewExpression(\n this: Printer,\n node: t.NewExpression,\n parent: t.Node,\n) {\n this.word(\"new\");\n this.space();\n this.print(node.callee);\n if (\n this.format.minified &&\n node.arguments.length === 0 &&\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n !node.optional &&\n !isCallExpression(parent, { callee: node }) &&\n !isMemberExpression(parent) &&\n !isNewExpression(parent)\n ) {\n return;\n }\n\n this.print(node.typeArguments);\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // Legacy TS AST\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n if (node.optional) {\n this.token(\"?.\");\n }\n }\n\n if (\n node.arguments.length === 0 &&\n this.tokenMap &&\n !this.tokenMap.endMatches(node, \")\")\n ) {\n return;\n }\n\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.printList(node.arguments, this.shouldPrintTrailingComma(\")\"));\n exit();\n this.rightParens(node);\n}\n\nexport function SequenceExpression(this: Printer, node: t.SequenceExpression) {\n this.printList(node.expressions);\n}\n\nexport function ThisExpression(this: Printer) {\n this.word(\"this\");\n}\n\nexport function Super(this: Printer) {\n this.word(\"super\");\n}\n\nexport function _shouldPrintDecoratorsBeforeExport(\n this: Printer,\n node: t.ExportDeclaration & { declaration: t.ClassDeclaration },\n) {\n if (typeof this.format.decoratorsBeforeExport === \"boolean\") {\n return this.format.decoratorsBeforeExport;\n }\n return (\n typeof node.start === \"number\" && node.start === node.declaration.start\n );\n}\n\nexport function Decorator(this: Printer, node: t.Decorator) {\n this.token(\"@\");\n this.print(node.expression);\n this.newline();\n}\n\nexport function OptionalMemberExpression(\n this: Printer,\n node: t.OptionalMemberExpression,\n) {\n let { computed } = node;\n const { optional, property } = node;\n\n this.print(node.object);\n\n if (!computed && isMemberExpression(property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n // @ts-expect-error todo(flow->ts) maybe instead of typeof check specific literal types?\n if (isLiteral(property) && typeof property.value === \"number\") {\n computed = true;\n }\n if (optional) {\n this.token(\"?.\");\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(property);\n this.token(\"]\");\n } else {\n if (!optional) {\n this.token(\".\");\n }\n this.print(property);\n }\n}\n\nexport function OptionalCallExpression(\n this: Printer,\n node: t.OptionalCallExpression,\n) {\n this.print(node.callee);\n\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // legacy TS AST\n }\n\n if (node.optional) {\n this.token(\"?.\");\n }\n\n this.print(node.typeArguments);\n\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.printList(node.arguments);\n exit();\n this.rightParens(node);\n}\n\nexport function CallExpression(this: Printer, node: t.CallExpression) {\n this.print(node.callee);\n\n this.print(node.typeArguments);\n if (!process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters); // legacy TS AST\n }\n this.token(\"(\");\n const exit = this.enterDelimited();\n this.printList(node.arguments, this.shouldPrintTrailingComma(\")\"));\n exit();\n this.rightParens(node);\n}\n\nexport function Import(this: Printer) {\n this.word(\"import\");\n}\n\nexport function AwaitExpression(this: Printer, node: t.AwaitExpression) {\n this.word(\"await\");\n this.space();\n this.print(node.argument);\n}\n\nexport function YieldExpression(this: Printer, node: t.YieldExpression) {\n if (node.delegate) {\n this.word(\"yield\", true);\n this.token(\"*\");\n if (node.argument) {\n this.space();\n // line terminators are allowed after yield*\n this.print(node.argument);\n }\n } else if (node.argument) {\n this.word(\"yield\", true);\n this.space();\n this.print(node.argument);\n } else {\n this.word(\"yield\");\n }\n}\n\nexport function EmptyStatement(this: Printer) {\n this.semicolon(true /* force */);\n}\n\nexport function ExpressionStatement(\n this: Printer,\n node: t.ExpressionStatement,\n) {\n this.tokenContext |= TokenContext.expressionStatement;\n this.print(node.expression);\n this.semicolon();\n}\n\nexport function AssignmentPattern(this: Printer, node: t.AssignmentPattern) {\n this.print(node.left);\n if (node.left.type === \"Identifier\" || isPattern(node.left)) {\n if (node.left.optional) this.token(\"?\");\n this.print(node.left.typeAnnotation);\n }\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right);\n}\n\nexport function AssignmentExpression(\n this: Printer,\n node: t.AssignmentExpression | t.BinaryExpression | t.LogicalExpression,\n) {\n this.print(node.left);\n\n this.space();\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n this.word(node.operator);\n } else {\n this.token(node.operator);\n this._endsWithDiv = node.operator === \"/\";\n }\n this.space();\n\n this.print(node.right);\n}\n\nexport function BindExpression(this: Printer, node: t.BindExpression) {\n this.print(node.object);\n this.token(\"::\");\n this.print(node.callee);\n}\n\nexport {\n AssignmentExpression as BinaryExpression,\n AssignmentExpression as LogicalExpression,\n};\n\nexport function MemberExpression(this: Printer, node: t.MemberExpression) {\n this.print(node.object);\n\n if (!node.computed && isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n // @ts-expect-error todo(flow->ts) maybe use specific literal types\n if (isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n\n if (computed) {\n const exit = this.enterDelimited();\n this.token(\"[\");\n this.print(node.property);\n this.token(\"]\");\n exit();\n } else {\n this.token(\".\");\n this.print(node.property);\n }\n}\n\nexport function MetaProperty(this: Printer, node: t.MetaProperty) {\n this.print(node.meta);\n this.token(\".\");\n this.print(node.property);\n}\n\nexport function PrivateName(this: Printer, node: t.PrivateName) {\n this.token(\"#\");\n this.print(node.id);\n}\n\nexport function V8IntrinsicIdentifier(\n this: Printer,\n node: t.V8IntrinsicIdentifier,\n) {\n this.token(\"%\");\n this.word(node.name);\n}\n\nexport function ModuleExpression(this: Printer, node: t.ModuleExpression) {\n this.word(\"module\", true);\n this.space();\n this.token(\"{\");\n this.indent();\n const { body } = node;\n if (body.body.length || body.directives.length) {\n this.newline();\n }\n this.print(body);\n this.dedent();\n this.rightBrace(node);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AAAgD;EAP9CE,gBAAgB;EAChBC,SAAS;EACTC,kBAAkB;EAClBC,eAAe;EACfC;AAAS,IAAAP,EAAA;AAKJ,SAASQ,eAAeA,CAAgBC,IAAuB,EAAE;EACtE,MAAM;IAAEC;EAAS,CAAC,GAAGD,IAAI;EACzB,IACEC,QAAQ,KAAK,MAAM,IACnBA,QAAQ,KAAK,QAAQ,IACrBA,QAAQ,KAAK,QAAQ,IAErBA,QAAQ,KAAK,OAAO,EACpB;IACA,IAAI,CAACC,IAAI,CAACD,QAAQ,CAAC;IACnB,IAAI,CAACE,KAAK,CAAC,CAAC;EACd,CAAC,MAAM;IACL,IAAI,CAACC,KAAK,CAACH,QAAQ,CAAC;EACtB;EAEA,IAAI,CAACI,KAAK,CAACL,IAAI,CAACM,QAAQ,CAAC;AAC3B;AAEO,SAASC,YAAYA,CAAgBP,IAAoB,EAAE;EAChE,IAAIA,IAAI,CAACQ,KAAK,EAAE;IACd,IAAI,CAACN,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC;IACxB,IAAI,CAACC,KAAK,CAAC,CAAC;EACd;EACA,IAAI,CAACD,IAAI,CAAC,IAAI,CAAC;EACf,IAAI,CAACC,KAAK,CAAC,CAAC;EACZ,IAAI,CAACE,KAAK,CAACL,IAAI,CAACS,IAAI,CAAC;AACvB;AAEO,SAASC,uBAAuBA,CAErCV,IAA+B,EAC/B;EACA,IAAI,CAACI,SAAK,GAAI,CAAC;EACf,MAAMO,IAAI,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;EAClC,IAAI,CAACP,KAAK,CAACL,IAAI,CAACa,UAAU,CAAC;EAC3BF,IAAI,CAAC,CAAC;EACN,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AAI,CAACuE,UAAU,CAACrD,MAAM,EAAE;IAC9C,IAAI,CAACiB,OAAO,CAAC,CAAC;EAChB;EACA,IAAI,CAACvC,KAAK,CAACI,IAAI,CAAC;EAChB,IAAI,CAACwE,MAAM,CAAC,CAAC;EACb,IAAI,CAACC,UAAU,CAAClF,IAAI,CAAC;AACvB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/flow.js b/node_modules/@babel/generator/lib/generators/flow.js new file mode 100644 index 0000000..6a59c9c --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/flow.js @@ -0,0 +1,658 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AnyTypeAnnotation = AnyTypeAnnotation; +exports.ArrayTypeAnnotation = ArrayTypeAnnotation; +exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; +exports.BooleanTypeAnnotation = BooleanTypeAnnotation; +exports.DeclareClass = DeclareClass; +exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration; +exports.DeclareExportDeclaration = DeclareExportDeclaration; +exports.DeclareFunction = DeclareFunction; +exports.DeclareInterface = DeclareInterface; +exports.DeclareModule = DeclareModule; +exports.DeclareModuleExports = DeclareModuleExports; +exports.DeclareOpaqueType = DeclareOpaqueType; +exports.DeclareTypeAlias = DeclareTypeAlias; +exports.DeclareVariable = DeclareVariable; +exports.DeclaredPredicate = DeclaredPredicate; +exports.EmptyTypeAnnotation = EmptyTypeAnnotation; +exports.EnumBooleanBody = EnumBooleanBody; +exports.EnumBooleanMember = EnumBooleanMember; +exports.EnumDeclaration = EnumDeclaration; +exports.EnumDefaultedMember = EnumDefaultedMember; +exports.EnumNumberBody = EnumNumberBody; +exports.EnumNumberMember = EnumNumberMember; +exports.EnumStringBody = EnumStringBody; +exports.EnumStringMember = EnumStringMember; +exports.EnumSymbolBody = EnumSymbolBody; +exports.ExistsTypeAnnotation = ExistsTypeAnnotation; +exports.FunctionTypeAnnotation = FunctionTypeAnnotation; +exports.FunctionTypeParam = FunctionTypeParam; +exports.IndexedAccessType = IndexedAccessType; +exports.InferredPredicate = InferredPredicate; +exports.InterfaceDeclaration = InterfaceDeclaration; +exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends; +exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation; +exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; +exports.MixedTypeAnnotation = MixedTypeAnnotation; +exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; +exports.NullableTypeAnnotation = NullableTypeAnnotation; +Object.defineProperty(exports, "NumberLiteralTypeAnnotation", { + enumerable: true, + get: function () { + return _types2.NumericLiteral; + } +}); +exports.NumberTypeAnnotation = NumberTypeAnnotation; +exports.ObjectTypeAnnotation = ObjectTypeAnnotation; +exports.ObjectTypeCallProperty = ObjectTypeCallProperty; +exports.ObjectTypeIndexer = ObjectTypeIndexer; +exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot; +exports.ObjectTypeProperty = ObjectTypeProperty; +exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; +exports.OpaqueType = OpaqueType; +exports.OptionalIndexedAccessType = OptionalIndexedAccessType; +exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; +Object.defineProperty(exports, "StringLiteralTypeAnnotation", { + enumerable: true, + get: function () { + return _types2.StringLiteral; + } +}); +exports.StringTypeAnnotation = StringTypeAnnotation; +exports.SymbolTypeAnnotation = SymbolTypeAnnotation; +exports.ThisTypeAnnotation = ThisTypeAnnotation; +exports.TupleTypeAnnotation = TupleTypeAnnotation; +exports.TypeAlias = TypeAlias; +exports.TypeAnnotation = TypeAnnotation; +exports.TypeCastExpression = TypeCastExpression; +exports.TypeParameter = TypeParameter; +exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation; +exports.TypeofTypeAnnotation = TypeofTypeAnnotation; +exports.UnionTypeAnnotation = UnionTypeAnnotation; +exports.Variance = Variance; +exports.VoidTypeAnnotation = VoidTypeAnnotation; +exports._interfaceish = _interfaceish; +exports._variance = _variance; +var _t = require("@babel/types"); +var _modules = require("./modules.js"); +var _index = require("../node/index.js"); +var _types2 = require("./types.js"); +const { + isDeclareExportDeclaration, + isStatement +} = _t; +function AnyTypeAnnotation() { + this.word("any"); +} +function ArrayTypeAnnotation(node) { + this.print(node.elementType, true); + this.tokenChar(91); + this.tokenChar(93); +} +function BooleanTypeAnnotation() { + this.word("boolean"); +} +function BooleanLiteralTypeAnnotation(node) { + this.word(node.value ? "true" : "false"); +} +function NullLiteralTypeAnnotation() { + this.word("null"); +} +function DeclareClass(node, parent) { + if (!isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + this.word("class"); + this.space(); + this._interfaceish(node); +} +function DeclareFunction(node, parent) { + if (!isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + this.word("function"); + this.space(); + this.print(node.id); + this.print(node.id.typeAnnotation.typeAnnotation); + if (node.predicate) { + this.space(); + this.print(node.predicate); + } + this.semicolon(); +} +function InferredPredicate() { + this.tokenChar(37); + this.word("checks"); +} +function DeclaredPredicate(node) { + this.tokenChar(37); + this.word("checks"); + this.tokenChar(40); + this.print(node.value); + this.tokenChar(41); +} +function DeclareInterface(node) { + this.word("declare"); + this.space(); + this.InterfaceDeclaration(node); +} +function DeclareModule(node) { + this.word("declare"); + this.space(); + this.word("module"); + this.space(); + this.print(node.id); + this.space(); + this.print(node.body); +} +function DeclareModuleExports(node) { + this.word("declare"); + this.space(); + this.word("module"); + this.tokenChar(46); + this.word("exports"); + this.print(node.typeAnnotation); +} +function DeclareTypeAlias(node) { + this.word("declare"); + this.space(); + this.TypeAlias(node); +} +function DeclareOpaqueType(node, parent) { + if (!isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + this.OpaqueType(node); +} +function DeclareVariable(node, parent) { + if (!isDeclareExportDeclaration(parent)) { + this.word("declare"); + this.space(); + } + this.word("var"); + this.space(); + this.print(node.id); + this.print(node.id.typeAnnotation); + this.semicolon(); +} +function DeclareExportDeclaration(node) { + this.word("declare"); + this.space(); + this.word("export"); + this.space(); + if (node.default) { + this.word("default"); + this.space(); + } + FlowExportDeclaration.call(this, node); +} +function DeclareExportAllDeclaration(node) { + this.word("declare"); + this.space(); + _modules.ExportAllDeclaration.call(this, node); +} +function EnumDeclaration(node) { + const { + id, + body + } = node; + this.word("enum"); + this.space(); + this.print(id); + this.print(body); +} +function enumExplicitType(context, name, hasExplicitType) { + if (hasExplicitType) { + context.space(); + context.word("of"); + context.space(); + context.word(name); + } + context.space(); +} +function enumBody(context, node) { + const { + members + } = node; + context.token("{"); + context.indent(); + context.newline(); + for (const member of members) { + context.print(member); + context.newline(); + } + if (node.hasUnknownMembers) { + context.token("..."); + context.newline(); + } + context.dedent(); + context.token("}"); +} +function EnumBooleanBody(node) { + const { + explicitType + } = node; + enumExplicitType(this, "boolean", explicitType); + enumBody(this, node); +} +function EnumNumberBody(node) { + const { + explicitType + } = node; + enumExplicitType(this, "number", explicitType); + enumBody(this, node); +} +function EnumStringBody(node) { + const { + explicitType + } = node; + enumExplicitType(this, "string", explicitType); + enumBody(this, node); +} +function EnumSymbolBody(node) { + enumExplicitType(this, "symbol", true); + enumBody(this, node); +} +function EnumDefaultedMember(node) { + const { + id + } = node; + this.print(id); + this.tokenChar(44); +} +function enumInitializedMember(context, node) { + context.print(node.id); + context.space(); + context.token("="); + context.space(); + context.print(node.init); + context.token(","); +} +function EnumBooleanMember(node) { + enumInitializedMember(this, node); +} +function EnumNumberMember(node) { + enumInitializedMember(this, node); +} +function EnumStringMember(node) { + enumInitializedMember(this, node); +} +function FlowExportDeclaration(node) { + if (node.declaration) { + const declar = node.declaration; + this.print(declar); + if (!isStatement(declar)) this.semicolon(); + } else { + this.tokenChar(123); + if (node.specifiers.length) { + this.space(); + this.printList(node.specifiers); + this.space(); + } + this.tokenChar(125); + if (node.source) { + this.space(); + this.word("from"); + this.space(); + this.print(node.source); + } + this.semicolon(); + } +} +function ExistsTypeAnnotation() { + this.tokenChar(42); +} +function FunctionTypeAnnotation(node, parent) { + this.print(node.typeParameters); + this.tokenChar(40); + if (node.this) { + this.word("this"); + this.tokenChar(58); + this.space(); + this.print(node.this.typeAnnotation); + if (node.params.length || node.rest) { + this.tokenChar(44); + this.space(); + } + } + this.printList(node.params); + if (node.rest) { + if (node.params.length) { + this.tokenChar(44); + this.space(); + } + this.token("..."); + this.print(node.rest); + } + this.tokenChar(41); + const type = parent == null ? void 0 : parent.type; + if (type != null && (type === "ObjectTypeCallProperty" || type === "ObjectTypeInternalSlot" || type === "DeclareFunction" || type === "ObjectTypeProperty" && parent.method)) { + this.tokenChar(58); + } else { + this.space(); + this.token("=>"); + } + this.space(); + this.print(node.returnType); +} +function FunctionTypeParam(node) { + this.print(node.name); + if (node.optional) this.tokenChar(63); + if (node.name) { + this.tokenChar(58); + this.space(); + } + this.print(node.typeAnnotation); +} +function InterfaceExtends(node) { + this.print(node.id); + this.print(node.typeParameters, true); +} +function _interfaceish(node) { + var _node$extends; + this.print(node.id); + this.print(node.typeParameters); + if ((_node$extends = node.extends) != null && _node$extends.length) { + this.space(); + this.word("extends"); + this.space(); + this.printList(node.extends); + } + if (node.type === "DeclareClass") { + var _node$mixins, _node$implements; + if ((_node$mixins = node.mixins) != null && _node$mixins.length) { + this.space(); + this.word("mixins"); + this.space(); + this.printList(node.mixins); + } + if ((_node$implements = node.implements) != null && _node$implements.length) { + this.space(); + this.word("implements"); + this.space(); + this.printList(node.implements); + } + } + this.space(); + this.print(node.body); +} +function _variance(node) { + var _node$variance; + const kind = (_node$variance = node.variance) == null ? void 0 : _node$variance.kind; + if (kind != null) { + if (kind === "plus") { + this.tokenChar(43); + } else if (kind === "minus") { + this.tokenChar(45); + } + } +} +function InterfaceDeclaration(node) { + this.word("interface"); + this.space(); + this._interfaceish(node); +} +function andSeparator(occurrenceCount) { + this.space(); + this.token("&", false, occurrenceCount); + this.space(); +} +function InterfaceTypeAnnotation(node) { + var _node$extends2; + this.word("interface"); + if ((_node$extends2 = node.extends) != null && _node$extends2.length) { + this.space(); + this.word("extends"); + this.space(); + this.printList(node.extends); + } + this.space(); + this.print(node.body); +} +function IntersectionTypeAnnotation(node) { + this.printJoin(node.types, undefined, undefined, andSeparator); +} +function MixedTypeAnnotation() { + this.word("mixed"); +} +function EmptyTypeAnnotation() { + this.word("empty"); +} +function NullableTypeAnnotation(node) { + this.tokenChar(63); + this.print(node.typeAnnotation); +} +function NumberTypeAnnotation() { + this.word("number"); +} +function StringTypeAnnotation() { + this.word("string"); +} +function ThisTypeAnnotation() { + this.word("this"); +} +function TupleTypeAnnotation(node) { + this.tokenChar(91); + this.printList(node.types); + this.tokenChar(93); +} +function TypeofTypeAnnotation(node) { + this.word("typeof"); + this.space(); + this.print(node.argument); +} +function TypeAlias(node) { + this.word("type"); + this.space(); + this.print(node.id); + this.print(node.typeParameters); + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.right); + this.semicolon(); +} +function TypeAnnotation(node, parent) { + this.tokenChar(58); + this.space(); + if (parent.type === "ArrowFunctionExpression") { + this.tokenContext |= _index.TokenContext.arrowFlowReturnType; + } else if (node.optional) { + this.tokenChar(63); + } + this.print(node.typeAnnotation); +} +function TypeParameterInstantiation(node) { + this.tokenChar(60); + this.printList(node.params); + this.tokenChar(62); +} +function TypeParameter(node) { + this._variance(node); + this.word(node.name); + if (node.bound) { + this.print(node.bound); + } + if (node.default) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.default); + } +} +function OpaqueType(node) { + this.word("opaque"); + this.space(); + this.word("type"); + this.space(); + this.print(node.id); + this.print(node.typeParameters); + if (node.supertype) { + this.tokenChar(58); + this.space(); + this.print(node.supertype); + } + if (node.impltype) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.impltype); + } + this.semicolon(); +} +function ObjectTypeAnnotation(node) { + if (node.exact) { + this.token("{|"); + } else { + this.tokenChar(123); + } + const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])]; + if (props.length) { + this.newline(); + this.space(); + this.printJoin(props, true, true, undefined, undefined, () => { + if (props.length !== 1 || node.inexact) { + this.tokenChar(44); + this.space(); + } + }); + this.space(); + } + if (node.inexact) { + this.indent(); + this.token("..."); + if (props.length) { + this.newline(); + } + this.dedent(); + } + if (node.exact) { + this.token("|}"); + } else { + this.tokenChar(125); + } +} +function ObjectTypeInternalSlot(node) { + if (node.static) { + this.word("static"); + this.space(); + } + this.tokenChar(91); + this.tokenChar(91); + this.print(node.id); + this.tokenChar(93); + this.tokenChar(93); + if (node.optional) this.tokenChar(63); + if (!node.method) { + this.tokenChar(58); + this.space(); + } + this.print(node.value); +} +function ObjectTypeCallProperty(node) { + if (node.static) { + this.word("static"); + this.space(); + } + this.print(node.value); +} +function ObjectTypeIndexer(node) { + if (node.static) { + this.word("static"); + this.space(); + } + this._variance(node); + this.tokenChar(91); + if (node.id) { + this.print(node.id); + this.tokenChar(58); + this.space(); + } + this.print(node.key); + this.tokenChar(93); + this.tokenChar(58); + this.space(); + this.print(node.value); +} +function ObjectTypeProperty(node) { + if (node.proto) { + this.word("proto"); + this.space(); + } + if (node.static) { + this.word("static"); + this.space(); + } + if (node.kind === "get" || node.kind === "set") { + this.word(node.kind); + this.space(); + } + this._variance(node); + this.print(node.key); + if (node.optional) this.tokenChar(63); + if (!node.method) { + this.tokenChar(58); + this.space(); + } + this.print(node.value); +} +function ObjectTypeSpreadProperty(node) { + this.token("..."); + this.print(node.argument); +} +function QualifiedTypeIdentifier(node) { + this.print(node.qualification); + this.tokenChar(46); + this.print(node.id); +} +function SymbolTypeAnnotation() { + this.word("symbol"); +} +function orSeparator(occurrenceCount) { + this.space(); + this.token("|", false, occurrenceCount); + this.space(); +} +function UnionTypeAnnotation(node) { + this.printJoin(node.types, undefined, undefined, orSeparator); +} +function TypeCastExpression(node) { + this.tokenChar(40); + this.print(node.expression); + this.print(node.typeAnnotation); + this.tokenChar(41); +} +function Variance(node) { + if (node.kind === "plus") { + this.tokenChar(43); + } else { + this.tokenChar(45); + } +} +function VoidTypeAnnotation() { + this.word("void"); +} +function IndexedAccessType(node) { + this.print(node.objectType, true); + this.tokenChar(91); + this.print(node.indexType); + this.tokenChar(93); +} +function OptionalIndexedAccessType(node) { + this.print(node.objectType); + if (node.optional) { + this.token("?."); + } + this.tokenChar(91); + this.print(node.indexType); + this.tokenChar(93); +} + +//# sourceMappingURL=flow.js.map diff --git a/node_modules/@babel/generator/lib/generators/flow.js.map b/node_modules/@babel/generator/lib/generators/flow.js.map new file mode 100644 index 0000000..ff68206 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/flow.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","_modules","_index","_types2","isDeclareExportDeclaration","isStatement","AnyTypeAnnotation","word","ArrayTypeAnnotation","node","print","elementType","token","BooleanTypeAnnotation","BooleanLiteralTypeAnnotation","value","NullLiteralTypeAnnotation","DeclareClass","parent","space","_interfaceish","DeclareFunction","id","typeAnnotation","predicate","semicolon","InferredPredicate","DeclaredPredicate","DeclareInterface","InterfaceDeclaration","DeclareModule","body","DeclareModuleExports","DeclareTypeAlias","TypeAlias","DeclareOpaqueType","OpaqueType","DeclareVariable","DeclareExportDeclaration","default","FlowExportDeclaration","call","DeclareExportAllDeclaration","ExportAllDeclaration","EnumDeclaration","enumExplicitType","context","name","hasExplicitType","enumBody","members","indent","newline","member","hasUnknownMembers","dedent","EnumBooleanBody","explicitType","EnumNumberBody","EnumStringBody","EnumSymbolBody","EnumDefaultedMember","enumInitializedMember","init","EnumBooleanMember","EnumNumberMember","EnumStringMember","declaration","declar","specifiers","length","printList","source","ExistsTypeAnnotation","FunctionTypeAnnotation","typeParameters","this","params","rest","type","method","returnType","FunctionTypeParam","optional","InterfaceExtends","_node$extends","extends","_node$mixins","_node$implements","mixins","implements","_variance","_node$variance","kind","variance","andSeparator","occurrenceCount","InterfaceTypeAnnotation","_node$extends2","IntersectionTypeAnnotation","printJoin","types","undefined","MixedTypeAnnotation","EmptyTypeAnnotation","NullableTypeAnnotation","NumberTypeAnnotation","StringTypeAnnotation","ThisTypeAnnotation","TupleTypeAnnotation","TypeofTypeAnnotation","argument","right","TypeAnnotation","tokenContext","TokenContext","arrowFlowReturnType","TypeParameterInstantiation","TypeParameter","bound","supertype","impltype","ObjectTypeAnnotation","exact","props","properties","callProperties","indexers","internalSlots","inexact","ObjectTypeInternalSlot","static","ObjectTypeCallProperty","ObjectTypeIndexer","key","ObjectTypeProperty","proto","ObjectTypeSpreadProperty","QualifiedTypeIdentifier","qualification","SymbolTypeAnnotation","orSeparator","UnionTypeAnnotation","TypeCastExpression","expression","Variance","VoidTypeAnnotation","IndexedAccessType","objectType","indexType","OptionalIndexedAccessType"],"sources":["../../src/generators/flow.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport { isDeclareExportDeclaration, isStatement } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { ExportAllDeclaration } from \"./modules.ts\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function AnyTypeAnnotation(this: Printer) {\n this.word(\"any\");\n}\n\nexport function ArrayTypeAnnotation(\n this: Printer,\n node: t.ArrayTypeAnnotation,\n) {\n this.print(node.elementType, true);\n this.token(\"[\");\n this.token(\"]\");\n}\n\nexport function BooleanTypeAnnotation(this: Printer) {\n this.word(\"boolean\");\n}\n\nexport function BooleanLiteralTypeAnnotation(\n this: Printer,\n node: t.BooleanLiteralTypeAnnotation,\n) {\n this.word(node.value ? \"true\" : \"false\");\n}\n\nexport function NullLiteralTypeAnnotation(this: Printer) {\n this.word(\"null\");\n}\n\nexport function DeclareClass(\n this: Printer,\n node: t.DeclareClass,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"class\");\n this.space();\n this._interfaceish(node);\n}\n\nexport function DeclareFunction(\n this: Printer,\n node: t.DeclareFunction,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"function\");\n this.space();\n this.print(node.id);\n // @ts-ignore(Babel 7 vs Babel 8) TODO(Babel 8) Remove this comment, since we'll remove the Noop node\n this.print(node.id.typeAnnotation.typeAnnotation);\n\n if (node.predicate) {\n this.space();\n this.print(node.predicate);\n }\n\n this.semicolon();\n}\n\nexport function InferredPredicate(this: Printer) {\n this.token(\"%\");\n this.word(\"checks\");\n}\n\nexport function DeclaredPredicate(this: Printer, node: t.DeclaredPredicate) {\n this.token(\"%\");\n this.word(\"checks\");\n this.token(\"(\");\n this.print(node.value);\n this.token(\")\");\n}\n\nexport function DeclareInterface(this: Printer, node: t.DeclareInterface) {\n this.word(\"declare\");\n this.space();\n this.InterfaceDeclaration(node);\n}\n\nexport function DeclareModule(this: Printer, node: t.DeclareModule) {\n this.word(\"declare\");\n this.space();\n this.word(\"module\");\n this.space();\n this.print(node.id);\n this.space();\n this.print(node.body);\n}\n\nexport function DeclareModuleExports(\n this: Printer,\n node: t.DeclareModuleExports,\n) {\n this.word(\"declare\");\n this.space();\n this.word(\"module\");\n this.token(\".\");\n this.word(\"exports\");\n this.print(node.typeAnnotation);\n}\n\nexport function DeclareTypeAlias(this: Printer, node: t.DeclareTypeAlias) {\n this.word(\"declare\");\n this.space();\n this.TypeAlias(node);\n}\n\nexport function DeclareOpaqueType(\n this: Printer,\n node: t.DeclareOpaqueType,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.OpaqueType(node);\n}\n\nexport function DeclareVariable(\n this: Printer,\n node: t.DeclareVariable,\n parent: t.Node,\n) {\n if (!isDeclareExportDeclaration(parent)) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"var\");\n this.space();\n this.print(node.id);\n this.print(node.id.typeAnnotation);\n this.semicolon();\n}\n\nexport function DeclareExportDeclaration(\n this: Printer,\n node: t.DeclareExportDeclaration,\n) {\n this.word(\"declare\");\n this.space();\n this.word(\"export\");\n this.space();\n if (node.default) {\n this.word(\"default\");\n this.space();\n }\n\n FlowExportDeclaration.call(this, node);\n}\n\nexport function DeclareExportAllDeclaration(\n this: Printer,\n node: t.DeclareExportAllDeclaration,\n) {\n this.word(\"declare\");\n this.space();\n ExportAllDeclaration.call(this, node);\n}\n\nexport function EnumDeclaration(this: Printer, node: t.EnumDeclaration) {\n const { id, body } = node;\n this.word(\"enum\");\n this.space();\n this.print(id);\n this.print(body);\n}\n\nfunction enumExplicitType(\n context: Printer,\n name: string,\n hasExplicitType: boolean,\n) {\n if (hasExplicitType) {\n context.space();\n context.word(\"of\");\n context.space();\n context.word(name);\n }\n context.space();\n}\n\nfunction enumBody(context: Printer, node: t.EnumBody) {\n const { members } = node;\n context.token(\"{\");\n context.indent();\n context.newline();\n for (const member of members) {\n context.print(member);\n context.newline();\n }\n if (node.hasUnknownMembers) {\n context.token(\"...\");\n context.newline();\n }\n context.dedent();\n context.token(\"}\");\n}\n\nexport function EnumBooleanBody(this: Printer, node: t.EnumBooleanBody) {\n const { explicitType } = node;\n enumExplicitType(this, \"boolean\", explicitType);\n enumBody(this, node);\n}\n\nexport function EnumNumberBody(this: Printer, node: t.EnumNumberBody) {\n const { explicitType } = node;\n enumExplicitType(this, \"number\", explicitType);\n enumBody(this, node);\n}\n\nexport function EnumStringBody(this: Printer, node: t.EnumStringBody) {\n const { explicitType } = node;\n enumExplicitType(this, \"string\", explicitType);\n enumBody(this, node);\n}\n\nexport function EnumSymbolBody(this: Printer, node: t.EnumSymbolBody) {\n enumExplicitType(this, \"symbol\", true);\n enumBody(this, node);\n}\n\nexport function EnumDefaultedMember(\n this: Printer,\n node: t.EnumDefaultedMember,\n) {\n const { id } = node;\n this.print(id);\n this.token(\",\");\n}\n\nfunction enumInitializedMember(\n context: Printer,\n node: t.EnumBooleanMember | t.EnumNumberMember | t.EnumStringMember,\n) {\n context.print(node.id);\n context.space();\n context.token(\"=\");\n context.space();\n context.print(node.init);\n context.token(\",\");\n}\n\nexport function EnumBooleanMember(this: Printer, node: t.EnumBooleanMember) {\n enumInitializedMember(this, node);\n}\n\nexport function EnumNumberMember(this: Printer, node: t.EnumNumberMember) {\n enumInitializedMember(this, node);\n}\n\nexport function EnumStringMember(this: Printer, node: t.EnumStringMember) {\n enumInitializedMember(this, node);\n}\n\nfunction FlowExportDeclaration(\n this: Printer,\n node: t.DeclareExportDeclaration,\n) {\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar);\n if (!isStatement(declar)) this.semicolon();\n } else {\n this.token(\"{\");\n if (node.specifiers!.length) {\n this.space();\n this.printList(node.specifiers);\n this.space();\n }\n this.token(\"}\");\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source);\n }\n\n this.semicolon();\n }\n}\n\nexport function ExistsTypeAnnotation(this: Printer) {\n this.token(\"*\");\n}\n\nexport function FunctionTypeAnnotation(\n this: Printer,\n node: t.FunctionTypeAnnotation,\n parent?: t.Node,\n) {\n this.print(node.typeParameters);\n this.token(\"(\");\n\n if (node.this) {\n this.word(\"this\");\n this.token(\":\");\n this.space();\n this.print(node.this.typeAnnotation);\n if (node.params.length || node.rest) {\n this.token(\",\");\n this.space();\n }\n }\n\n this.printList(node.params);\n\n if (node.rest) {\n if (node.params.length) {\n this.token(\",\");\n this.space();\n }\n this.token(\"...\");\n this.print(node.rest);\n }\n\n this.token(\")\");\n\n // this node type is overloaded, not sure why but it makes it EXTREMELY annoying\n\n const type = parent?.type;\n if (\n type != null &&\n (type === \"ObjectTypeCallProperty\" ||\n type === \"ObjectTypeInternalSlot\" ||\n type === \"DeclareFunction\" ||\n (type === \"ObjectTypeProperty\" && parent.method))\n ) {\n this.token(\":\");\n } else {\n this.space();\n this.token(\"=>\");\n }\n\n this.space();\n this.print(node.returnType);\n}\n\nexport function FunctionTypeParam(this: Printer, node: t.FunctionTypeParam) {\n this.print(node.name);\n if (node.optional) this.token(\"?\");\n if (node.name) {\n this.token(\":\");\n this.space();\n }\n this.print(node.typeAnnotation);\n}\n\nexport function InterfaceExtends(this: Printer, node: t.InterfaceExtends) {\n this.print(node.id);\n this.print(node.typeParameters, true);\n}\n\nexport {\n InterfaceExtends as ClassImplements,\n InterfaceExtends as GenericTypeAnnotation,\n};\n\nexport function _interfaceish(\n this: Printer,\n node: t.InterfaceDeclaration | t.DeclareInterface | t.DeclareClass,\n) {\n this.print(node.id);\n this.print(node.typeParameters);\n if (node.extends?.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(node.extends);\n }\n if (node.type === \"DeclareClass\") {\n if (node.mixins?.length) {\n this.space();\n this.word(\"mixins\");\n this.space();\n this.printList(node.mixins);\n }\n if (node.implements?.length) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements);\n }\n }\n this.space();\n this.print(node.body);\n}\n\nexport function _variance(\n this: Printer,\n node:\n | t.TypeParameter\n | t.ObjectTypeIndexer\n | t.ObjectTypeProperty\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassAccessorProperty,\n) {\n const kind = node.variance?.kind;\n if (kind != null) {\n if (kind === \"plus\") {\n this.token(\"+\");\n } else if (kind === \"minus\") {\n this.token(\"-\");\n }\n }\n}\n\nexport function InterfaceDeclaration(\n this: Printer,\n node: t.InterfaceDeclaration | t.DeclareInterface,\n) {\n this.word(\"interface\");\n this.space();\n this._interfaceish(node);\n}\n\nfunction andSeparator(this: Printer, occurrenceCount: number) {\n this.space();\n this.token(\"&\", false, occurrenceCount);\n this.space();\n}\n\nexport function InterfaceTypeAnnotation(\n this: Printer,\n node: t.InterfaceTypeAnnotation,\n) {\n this.word(\"interface\");\n if (node.extends?.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(node.extends);\n }\n this.space();\n this.print(node.body);\n}\n\nexport function IntersectionTypeAnnotation(\n this: Printer,\n node: t.IntersectionTypeAnnotation,\n) {\n this.printJoin(node.types, undefined, undefined, andSeparator);\n}\n\nexport function MixedTypeAnnotation(this: Printer) {\n this.word(\"mixed\");\n}\n\nexport function EmptyTypeAnnotation(this: Printer) {\n this.word(\"empty\");\n}\n\nexport function NullableTypeAnnotation(\n this: Printer,\n node: t.NullableTypeAnnotation,\n) {\n this.token(\"?\");\n this.print(node.typeAnnotation);\n}\n\nexport {\n NumericLiteral as NumberLiteralTypeAnnotation,\n StringLiteral as StringLiteralTypeAnnotation,\n} from \"./types.ts\";\n\nexport function NumberTypeAnnotation(this: Printer) {\n this.word(\"number\");\n}\n\nexport function StringTypeAnnotation(this: Printer) {\n this.word(\"string\");\n}\n\nexport function ThisTypeAnnotation(this: Printer) {\n this.word(\"this\");\n}\n\nexport function TupleTypeAnnotation(\n this: Printer,\n node: t.TupleTypeAnnotation,\n) {\n this.token(\"[\");\n this.printList(node.types);\n this.token(\"]\");\n}\n\nexport function TypeofTypeAnnotation(\n this: Printer,\n node: t.TypeofTypeAnnotation,\n) {\n this.word(\"typeof\");\n this.space();\n this.print(node.argument);\n}\n\nexport function TypeAlias(\n this: Printer,\n node: t.TypeAlias | t.DeclareTypeAlias,\n) {\n this.word(\"type\");\n this.space();\n this.print(node.id);\n this.print(node.typeParameters);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right);\n this.semicolon();\n}\n\nexport function TypeAnnotation(\n this: Printer,\n node: t.TypeAnnotation,\n parent: t.Node,\n) {\n this.token(\":\");\n this.space();\n if (parent.type === \"ArrowFunctionExpression\") {\n this.tokenContext |= TokenContext.arrowFlowReturnType;\n } else if (\n // @ts-expect-error todo(flow->ts) can this be removed? `.optional` looks to be not existing property\n node.optional\n ) {\n this.token(\"?\");\n }\n this.print(node.typeAnnotation);\n}\n\nexport function TypeParameterInstantiation(\n this: Printer,\n node: t.TypeParameterInstantiation,\n): void {\n this.token(\"<\");\n this.printList(node.params);\n this.token(\">\");\n}\n\nexport { TypeParameterInstantiation as TypeParameterDeclaration };\n\nexport function TypeParameter(this: Printer, node: t.TypeParameter) {\n this._variance(node);\n\n this.word(node.name);\n\n if (node.bound) {\n this.print(node.bound);\n }\n\n if (node.default) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.default);\n }\n}\n\nexport function OpaqueType(\n this: Printer,\n node: t.OpaqueType | t.DeclareOpaqueType,\n) {\n this.word(\"opaque\");\n this.space();\n this.word(\"type\");\n this.space();\n this.print(node.id);\n this.print(node.typeParameters);\n if (node.supertype) {\n this.token(\":\");\n this.space();\n this.print(node.supertype);\n }\n\n if (node.impltype) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.impltype);\n }\n this.semicolon();\n}\n\nexport function ObjectTypeAnnotation(\n this: Printer,\n node: t.ObjectTypeAnnotation,\n) {\n if (node.exact) {\n this.token(\"{|\");\n } else {\n this.token(\"{\");\n }\n\n // TODO: remove the array fallbacks and instead enforce the types to require an array\n const props = [\n ...node.properties,\n ...(node.callProperties || []),\n ...(node.indexers || []),\n ...(node.internalSlots || []),\n ];\n\n if (props.length) {\n this.newline();\n\n this.space();\n\n this.printJoin(props, true, true, undefined, undefined, () => {\n if (props.length !== 1 || node.inexact) {\n this.token(\",\");\n this.space();\n }\n });\n\n this.space();\n }\n\n if (node.inexact) {\n this.indent();\n this.token(\"...\");\n if (props.length) {\n this.newline();\n }\n this.dedent();\n }\n\n if (node.exact) {\n this.token(\"|}\");\n } else {\n this.token(\"}\");\n }\n}\n\nexport function ObjectTypeInternalSlot(\n this: Printer,\n node: t.ObjectTypeInternalSlot,\n) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this.token(\"[\");\n this.token(\"[\");\n this.print(node.id);\n this.token(\"]\");\n this.token(\"]\");\n if (node.optional) this.token(\"?\");\n if (!node.method) {\n this.token(\":\");\n this.space();\n }\n this.print(node.value);\n}\n\nexport function ObjectTypeCallProperty(\n this: Printer,\n node: t.ObjectTypeCallProperty,\n) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this.print(node.value);\n}\n\nexport function ObjectTypeIndexer(this: Printer, node: t.ObjectTypeIndexer) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this._variance(node);\n this.token(\"[\");\n if (node.id) {\n this.print(node.id);\n this.token(\":\");\n this.space();\n }\n this.print(node.key);\n this.token(\"]\");\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nexport function ObjectTypeProperty(this: Printer, node: t.ObjectTypeProperty) {\n if (node.proto) {\n this.word(\"proto\");\n this.space();\n }\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n if (node.kind === \"get\" || node.kind === \"set\") {\n this.word(node.kind);\n this.space();\n }\n this._variance(node);\n this.print(node.key);\n if (node.optional) this.token(\"?\");\n if (!node.method) {\n this.token(\":\");\n this.space();\n }\n this.print(node.value);\n}\n\nexport function ObjectTypeSpreadProperty(\n this: Printer,\n node: t.ObjectTypeSpreadProperty,\n) {\n this.token(\"...\");\n this.print(node.argument);\n}\n\nexport function QualifiedTypeIdentifier(\n this: Printer,\n node: t.QualifiedTypeIdentifier,\n) {\n this.print(node.qualification);\n this.token(\".\");\n this.print(node.id);\n}\n\nexport function SymbolTypeAnnotation(this: Printer) {\n this.word(\"symbol\");\n}\n\nfunction orSeparator(this: Printer, occurrenceCount: number) {\n this.space();\n this.token(\"|\", false, occurrenceCount);\n this.space();\n}\n\nexport function UnionTypeAnnotation(\n this: Printer,\n node: t.UnionTypeAnnotation,\n) {\n this.printJoin(node.types, undefined, undefined, orSeparator);\n}\n\nexport function TypeCastExpression(this: Printer, node: t.TypeCastExpression) {\n this.token(\"(\");\n this.print(node.expression);\n this.print(node.typeAnnotation);\n this.token(\")\");\n}\n\nexport function Variance(this: Printer, node: t.Variance) {\n if (node.kind === \"plus\") {\n this.token(\"+\");\n } else {\n this.token(\"-\");\n }\n}\n\nexport function VoidTypeAnnotation(this: Printer) {\n this.word(\"void\");\n}\n\nexport function IndexedAccessType(this: Printer, node: t.IndexedAccessType) {\n this.print(node.objectType, true);\n this.token(\"[\");\n this.print(node.indexType);\n this.token(\"]\");\n}\n\nexport function OptionalIndexedAccessType(\n this: Printer,\n node: t.OptionalIndexedAccessType,\n) {\n this.print(node.objectType);\n if (node.optional) {\n this.token(\"?.\");\n }\n this.token(\"[\");\n this.print(node.indexType);\n this.token(\"]\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAqdA,IAAAG,OAAA,GAAAH,OAAA;AAGoB;EA3dXI,0BAA0B;EAAEC;AAAW,IAAAN,EAAA;AAKzC,SAASO,iBAAiBA,CAAA,EAAgB;EAC/C,IAAI,CAACC,IAAI,CAAC,KAAK,CAAC;AAClB;AAEO,SAASC,mBAAmBA,CAEjCC,IAA2B,EAC3B;EACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,WAAW,EAAE,IAAI,CAAC;EAClC,IAAI,CAACC,SAAK,GAAI,CAAC;EACf,IAAI,CAACA,SAAK,GAAI,CAAC;AACjB;AAEO,SAASC,qBAAqBA,CAAA,EAAgB;EACnD,IAAI,CAACN,IAAI,CAAC,SAAS,CAAC;AACtB;AAEO,SAASO,4BAA4BA,CAE1CL,IAAoC,EACpC;EACA,IAAI,CAACF,IAAI,CAACE,IAAI,CAACM,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AAC1C;AAEO,SAASC,yBAAyBA,CAAA,EAAgB;EACvD,IAAI,CAACT,IAAI,CAAC,MAAM,CAAC;AACnB;AAEO,SAASU,YAAYA,CAE1BR,IAAoB,EACpBS,MAAc,EACd;EACA,IAAI,CAACd,0BAA0B,CAACc,MAAM,CAAC,EAAE;IACvC,IAAI,CAACX,IAAI,CAAC,SAAS,CAAC;IACpB,IAAI,CAACY,KAAK,CAAC,CAAC;EACd;EACA,IAAI,CAACZ,IAAI,CAAC,OAAO,CAAC;EAClB,IAAI,CAACY,KAAK,CAAC,CAAC;EACZ,IAAI,CAACC,aAAa,CAACX,IAAI,CAAC;AAC1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,EAAE;IACjB,IAAI,CAACvE,KAAK,CAAC,IAAI,CAAC;EAClB;EACA,IAAI,CAACA,SAAK,GAAI,CAAC;EACf,IAAI,CAACF,KAAK,CAACD,IAAI,CAAC4I,SAAS,CAAC;EAC1B,IAAI,CAACzI,SAAK,GAAI,CAAC;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/index.js b/node_modules/@babel/generator/lib/generators/index.js new file mode 100644 index 0000000..331c73f --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/index.js @@ -0,0 +1,128 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _templateLiterals = require("./template-literals.js"); +Object.keys(_templateLiterals).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _templateLiterals[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _templateLiterals[key]; + } + }); +}); +var _expressions = require("./expressions.js"); +Object.keys(_expressions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _expressions[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _expressions[key]; + } + }); +}); +var _statements = require("./statements.js"); +Object.keys(_statements).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _statements[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _statements[key]; + } + }); +}); +var _classes = require("./classes.js"); +Object.keys(_classes).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _classes[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _classes[key]; + } + }); +}); +var _methods = require("./methods.js"); +Object.keys(_methods).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _methods[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _methods[key]; + } + }); +}); +var _modules = require("./modules.js"); +Object.keys(_modules).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _modules[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _modules[key]; + } + }); +}); +var _types = require("./types.js"); +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _types[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _types[key]; + } + }); +}); +var _flow = require("./flow.js"); +Object.keys(_flow).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _flow[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _flow[key]; + } + }); +}); +var _base = require("./base.js"); +Object.keys(_base).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _base[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _base[key]; + } + }); +}); +var _jsx = require("./jsx.js"); +Object.keys(_jsx).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _jsx[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _jsx[key]; + } + }); +}); +var _typescript = require("./typescript.js"); +Object.keys(_typescript).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _typescript[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _typescript[key]; + } + }); +}); + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/generator/lib/generators/index.js.map b/node_modules/@babel/generator/lib/generators/index.js.map new file mode 100644 index 0000000..e8b0341 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_templateLiterals","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_expressions","_statements","_classes","_methods","_modules","_types","_flow","_base","_jsx","_typescript"],"sources":["../../src/generators/index.ts"],"sourcesContent":["export * from \"./template-literals.ts\";\nexport * from \"./expressions.ts\";\nexport * from \"./statements.ts\";\nexport * from \"./classes.ts\";\nexport * from \"./methods.ts\";\nexport * from \"./modules.ts\";\nexport * from \"./types.ts\";\nexport * from \"./flow.ts\";\nexport * from \"./base.ts\";\nexport * from \"./jsx.ts\";\nexport * from \"./typescript.ts\";\n"],"mappings":";;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,iBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,YAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,YAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,YAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,YAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,WAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,WAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,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AA,CAAA;MAAA,OAAAS,IAAA,CAAAb,GAAA;IAAA;EAAA;AAAA;AACA,IAAAc,WAAA,GAAAlB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAgB,WAAA,EAAAf,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAc,WAAA,CAAAd,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAU,WAAA,CAAAd,GAAA;IAAA;EAAA;AAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/jsx.js b/node_modules/@babel/generator/lib/generators/jsx.js new file mode 100644 index 0000000..2650ec1 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/jsx.js @@ -0,0 +1,126 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.JSXAttribute = JSXAttribute; +exports.JSXClosingElement = JSXClosingElement; +exports.JSXClosingFragment = JSXClosingFragment; +exports.JSXElement = JSXElement; +exports.JSXEmptyExpression = JSXEmptyExpression; +exports.JSXExpressionContainer = JSXExpressionContainer; +exports.JSXFragment = JSXFragment; +exports.JSXIdentifier = JSXIdentifier; +exports.JSXMemberExpression = JSXMemberExpression; +exports.JSXNamespacedName = JSXNamespacedName; +exports.JSXOpeningElement = JSXOpeningElement; +exports.JSXOpeningFragment = JSXOpeningFragment; +exports.JSXSpreadAttribute = JSXSpreadAttribute; +exports.JSXSpreadChild = JSXSpreadChild; +exports.JSXText = JSXText; +function JSXAttribute(node) { + this.print(node.name); + if (node.value) { + this.tokenChar(61); + this.print(node.value); + } +} +function JSXIdentifier(node) { + this.word(node.name); +} +function JSXNamespacedName(node) { + this.print(node.namespace); + this.tokenChar(58); + this.print(node.name); +} +function JSXMemberExpression(node) { + this.print(node.object); + this.tokenChar(46); + this.print(node.property); +} +function JSXSpreadAttribute(node) { + this.tokenChar(123); + this.token("..."); + this.print(node.argument); + this.rightBrace(node); +} +function JSXExpressionContainer(node) { + this.tokenChar(123); + this.print(node.expression); + this.rightBrace(node); +} +function JSXSpreadChild(node) { + this.tokenChar(123); + this.token("..."); + this.print(node.expression); + this.rightBrace(node); +} +function JSXText(node) { + const raw = this.getPossibleRaw(node); + if (raw !== undefined) { + this.token(raw, true); + } else { + this.token(node.value, true); + } +} +function JSXElement(node) { + const open = node.openingElement; + this.print(open); + if (open.selfClosing) return; + this.indent(); + for (const child of node.children) { + this.print(child); + } + this.dedent(); + this.print(node.closingElement); +} +function spaceSeparator() { + this.space(); +} +function JSXOpeningElement(node) { + this.tokenChar(60); + this.print(node.name); + { + if (node.typeArguments) { + this.print(node.typeArguments); + } + this.print(node.typeParameters); + } + if (node.attributes.length > 0) { + this.space(); + this.printJoin(node.attributes, undefined, undefined, spaceSeparator); + } + if (node.selfClosing) { + this.space(); + this.tokenChar(47); + } + this.tokenChar(62); +} +function JSXClosingElement(node) { + this.tokenChar(60); + this.tokenChar(47); + this.print(node.name); + this.tokenChar(62); +} +function JSXEmptyExpression() { + this.printInnerComments(); +} +function JSXFragment(node) { + this.print(node.openingFragment); + this.indent(); + for (const child of node.children) { + this.print(child); + } + this.dedent(); + this.print(node.closingFragment); +} +function JSXOpeningFragment() { + this.tokenChar(60); + this.tokenChar(62); +} +function JSXClosingFragment() { + this.token(" 0) {\n this.space();\n this.printJoin(node.attributes, undefined, undefined, spaceSeparator);\n }\n if (node.selfClosing) {\n this.space();\n this.token(\"/\");\n }\n this.token(\">\");\n}\n\nexport function JSXClosingElement(this: Printer, node: t.JSXClosingElement) {\n this.token(\"<\");\n this.token(\"/\");\n this.print(node.name);\n this.token(\">\");\n}\n\nexport function JSXEmptyExpression(this: Printer) {\n // This node is empty, so forcefully print its inner comments.\n this.printInnerComments();\n}\n\nexport function JSXFragment(this: Printer, node: t.JSXFragment) {\n this.print(node.openingFragment);\n\n this.indent();\n for (const child of node.children) {\n this.print(child);\n }\n this.dedent();\n\n this.print(node.closingFragment);\n}\n\nexport function JSXOpeningFragment(this: Printer) {\n this.token(\"<\");\n this.token(\">\");\n}\n\nexport function JSXClosingFragment(this: Printer) {\n this.token(\"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGO,SAASA,YAAYA,CAAgBC,IAAoB,EAAE;EAChE,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,IAAI,CAAC;EACrB,IAAIF,IAAI,CAACG,KAAK,EAAE;IACd,IAAI,CAACC,SAAK,GAAI,CAAC;IACf,IAAI,CAACH,KAAK,CAACD,IAAI,CAACG,KAAK,CAAC;EACxB;AACF;AAEO,SAASE,aAAaA,CAAgBL,IAAqB,EAAE;EAClE,IAAI,CAACM,IAAI,CAACN,IAAI,CAACE,IAAI,CAAC;AACtB;AAEO,SAASK,iBAAiBA,CAAgBP,IAAyB,EAAE;EAC1E,IAAI,CAACC,KAAK,CAACD,IAAI,CAACQ,SAAS,CAAC;EAC1B,IAAI,CAACJ,SAAK,GAAI,CAAC;EACf,IAAI,CAACH,KAAK,CAACD,IAAI,CAACE,IAAI,CAAC;AACvB;AAEO,SAASO,mBAAmBA,CAEjCT,IAA2B,EAC3B;EACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACU,MAAM,CAAC;EACvB,IAAI,CAACN,SAAK,GAAI,CAAC;EACf,IAAI,CAACH,KAAK,CAACD,IAAI,CAACW,QAAQ,CAAC;AAC3B;AAEO,SAASC,kBAAkBA,CAAgBZ,IAA0B,EAAE;EAC5E,IAAI,CAACI,SAAK,IAAI,CAAC;EACf,IAAI,CAACA,KAAK,CAAC,KAAK,CAAC;EACjB,IAAI,CAACH,KAAK,CAACD,IAAI,CAACa,QAAQ,CAAC;EACzB,IAAI,CAACC,UAAU,CAACd,IAAI,CAAC;AACvB;AAEO,SAASe,sBAAsBA,CAEpCf,IAA8B,EAC9B;EACA,IAAI,CAACI,SA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AAkBA,CAAA,EAAgB;EAChD,IAAI,CAACzC,SAAK,GAAI,CAAC;EACf,IAAI,CAACA,SAAK,GAAI,CAAC;AACjB;AAEO,SAAS0C,kBAAkBA,CAAA,EAAgB;EAChD,IAAI,CAAC1C,KAAK,CAAC,IAAI,CAAC;EAChB,IAAI,CAACA,SAAK,GAAI,CAAC;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/methods.js b/node_modules/@babel/generator/lib/generators/methods.js new file mode 100644 index 0000000..aca4aa3 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/methods.js @@ -0,0 +1,198 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ArrowFunctionExpression = ArrowFunctionExpression; +exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression; +exports._functionHead = _functionHead; +exports._methodHead = _methodHead; +exports._param = _param; +exports._parameters = _parameters; +exports._params = _params; +exports._predicate = _predicate; +exports._shouldPrintArrowParamsParens = _shouldPrintArrowParamsParens; +var _t = require("@babel/types"); +var _index = require("../node/index.js"); +const { + isIdentifier +} = _t; +function _params(node, idNode, parentNode) { + this.print(node.typeParameters); + const nameInfo = _getFuncIdName.call(this, idNode, parentNode); + if (nameInfo) { + this.sourceIdentifierName(nameInfo.name, nameInfo.pos); + } + this.tokenChar(40); + this._parameters(node.params, ")"); + const noLineTerminator = node.type === "ArrowFunctionExpression"; + this.print(node.returnType, noLineTerminator); + this._noLineTerminator = noLineTerminator; +} +function _parameters(parameters, endToken) { + const exit = this.enterDelimited(); + const trailingComma = this.shouldPrintTrailingComma(endToken); + const paramLength = parameters.length; + for (let i = 0; i < paramLength; i++) { + this._param(parameters[i]); + if (trailingComma || i < paramLength - 1) { + this.token(",", undefined, i); + this.space(); + } + } + this.token(endToken); + exit(); +} +function _param(parameter) { + this.printJoin(parameter.decorators); + this.print(parameter); + if (parameter.optional) { + this.tokenChar(63); + } + this.print(parameter.typeAnnotation); +} +function _methodHead(node) { + const kind = node.kind; + const key = node.key; + if (kind === "get" || kind === "set") { + this.word(kind); + this.space(); + } + if (node.async) { + this.word("async", true); + this.space(); + } + if (kind === "method" || kind === "init") { + if (node.generator) { + this.tokenChar(42); + } + } + if (node.computed) { + this.tokenChar(91); + this.print(key); + this.tokenChar(93); + } else { + this.print(key); + } + if (node.optional) { + this.tokenChar(63); + } + this._params(node, node.computed && node.key.type !== "StringLiteral" ? undefined : node.key); +} +function _predicate(node, noLineTerminatorAfter) { + if (node.predicate) { + if (!node.returnType) { + this.tokenChar(58); + } + this.space(); + this.print(node.predicate, noLineTerminatorAfter); + } +} +function _functionHead(node, parent) { + if (node.async) { + this.word("async"); + if (!this.format.preserveFormat) { + this._endsWithInnerRaw = false; + } + this.space(); + } + this.word("function"); + if (node.generator) { + if (!this.format.preserveFormat) { + this._endsWithInnerRaw = false; + } + this.tokenChar(42); + } + this.space(); + if (node.id) { + this.print(node.id); + } + this._params(node, node.id, parent); + if (node.type !== "TSDeclareFunction") { + this._predicate(node); + } +} +function FunctionExpression(node, parent) { + this._functionHead(node, parent); + this.space(); + this.print(node.body); +} +function ArrowFunctionExpression(node, parent) { + if (node.async) { + this.word("async", true); + this.space(); + } + if (this._shouldPrintArrowParamsParens(node)) { + this._params(node, undefined, parent); + } else { + this.print(node.params[0], true); + } + this._predicate(node, true); + this.space(); + this.printInnerComments(); + this.token("=>"); + this.space(); + this.tokenContext |= _index.TokenContext.arrowBody; + this.print(node.body); +} +function _shouldPrintArrowParamsParens(node) { + var _firstParam$leadingCo, _firstParam$trailingC; + if (node.params.length !== 1) return true; + if (node.typeParameters || node.returnType || node.predicate) { + return true; + } + const firstParam = node.params[0]; + if (!isIdentifier(firstParam) || firstParam.typeAnnotation || firstParam.optional || (_firstParam$leadingCo = firstParam.leadingComments) != null && _firstParam$leadingCo.length || (_firstParam$trailingC = firstParam.trailingComments) != null && _firstParam$trailingC.length) { + return true; + } + if (this.tokenMap) { + if (node.loc == null) return true; + if (this.tokenMap.findMatching(node, "(") !== null) return true; + const arrowToken = this.tokenMap.findMatching(node, "=>"); + if ((arrowToken == null ? void 0 : arrowToken.loc) == null) return true; + return arrowToken.loc.start.line !== node.loc.start.line; + } + if (this.format.retainLines) return true; + return false; +} +function _getFuncIdName(idNode, parent) { + let id = idNode; + if (!id && parent) { + const parentType = parent.type; + if (parentType === "VariableDeclarator") { + id = parent.id; + } else if (parentType === "AssignmentExpression" || parentType === "AssignmentPattern") { + id = parent.left; + } else if (parentType === "ObjectProperty" || parentType === "ClassProperty") { + if (!parent.computed || parent.key.type === "StringLiteral") { + id = parent.key; + } + } else if (parentType === "ClassPrivateProperty" || parentType === "ClassAccessorProperty") { + id = parent.key; + } + } + if (!id) return; + let nameInfo; + if (id.type === "Identifier") { + var _id$loc, _id$loc2; + nameInfo = { + pos: (_id$loc = id.loc) == null ? void 0 : _id$loc.start, + name: ((_id$loc2 = id.loc) == null ? void 0 : _id$loc2.identifierName) || id.name + }; + } else if (id.type === "PrivateName") { + var _id$loc3; + nameInfo = { + pos: (_id$loc3 = id.loc) == null ? void 0 : _id$loc3.start, + name: "#" + id.id.name + }; + } else if (id.type === "StringLiteral") { + var _id$loc4; + nameInfo = { + pos: (_id$loc4 = id.loc) == null ? void 0 : _id$loc4.start, + name: id.value + }; + } + return nameInfo; +} + +//# sourceMappingURL=methods.js.map diff --git a/node_modules/@babel/generator/lib/generators/methods.js.map b/node_modules/@babel/generator/lib/generators/methods.js.map new file mode 100644 index 0000000..eeba7f9 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/methods.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","_index","isIdentifier","_params","node","idNode","parentNode","print","typeParameters","nameInfo","_getFuncIdName","call","sourceIdentifierName","name","pos","token","_parameters","params","noLineTerminator","type","returnType","_noLineTerminator","parameters","endToken","exit","enterDelimited","trailingComma","shouldPrintTrailingComma","paramLength","length","i","_param","undefined","space","parameter","printJoin","decorators","optional","typeAnnotation","_methodHead","kind","key","word","async","generator","computed","_predicate","noLineTerminatorAfter","predicate","_functionHead","parent","format","preserveFormat","_endsWithInnerRaw","id","FunctionExpression","body","ArrowFunctionExpression","_shouldPrintArrowParamsParens","printInnerComments","tokenContext","TokenContext","arrowBody","_firstParam$leadingCo","_firstParam$trailingC","firstParam","leadingComments","trailingComments","tokenMap","loc","findMatching","arrowToken","start","line","retainLines","parentType","left","_id$loc","_id$loc2","identifierName","_id$loc3","_id$loc4","value"],"sources":["../../src/generators/methods.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\nimport { isIdentifier, type ParentMaps } from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\n\ntype ParentsOf = ParentMaps[T[\"type\"]];\n\nexport function _params(\n this: Printer,\n node: t.Function | t.TSDeclareMethod | t.TSDeclareFunction,\n idNode: t.Expression | t.PrivateName | null | undefined,\n parentNode?: ParentsOf,\n) {\n this.print(node.typeParameters);\n\n const nameInfo = _getFuncIdName.call(this, idNode, parentNode);\n if (nameInfo) {\n this.sourceIdentifierName(nameInfo.name, nameInfo.pos);\n }\n\n this.token(\"(\");\n this._parameters(node.params, \")\");\n\n const noLineTerminator = node.type === \"ArrowFunctionExpression\";\n this.print(node.returnType, noLineTerminator);\n\n this._noLineTerminator = noLineTerminator;\n}\n\nexport function _parameters(\n this: Printer,\n parameters: t.Function[\"params\"],\n endToken: string,\n) {\n const exit = this.enterDelimited();\n\n const trailingComma = this.shouldPrintTrailingComma(endToken);\n\n const paramLength = parameters.length;\n for (let i = 0; i < paramLength; i++) {\n this._param(parameters[i]);\n\n if (trailingComma || i < paramLength - 1) {\n this.token(\",\", undefined, i);\n this.space();\n }\n }\n\n this.token(endToken);\n exit();\n}\n\nexport function _param(\n this: Printer,\n parameter: t.Identifier | t.RestElement | t.Pattern | t.TSParameterProperty,\n) {\n // @ts-expect-error decorators is not in VoidPattern\n this.printJoin(parameter.decorators);\n this.print(parameter);\n if (\n // @ts-expect-error optional is not in TSParameterProperty\n parameter.optional\n ) {\n this.token(\"?\"); // TS / flow\n }\n\n this.print(\n // @ts-expect-error typeAnnotation is not in TSParameterProperty\n parameter.typeAnnotation,\n ); // TS / flow\n}\n\nexport function _methodHead(this: Printer, node: t.Method | t.TSDeclareMethod) {\n const kind = node.kind;\n const key = node.key;\n\n if (kind === \"get\" || kind === \"set\") {\n this.word(kind);\n this.space();\n }\n\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n\n if (\n kind === \"method\" ||\n // @ts-expect-error Fixme: kind: \"init\" is not defined\n kind === \"init\"\n ) {\n if (node.generator) {\n this.token(\"*\");\n }\n }\n\n if (node.computed) {\n this.token(\"[\");\n this.print(key);\n this.token(\"]\");\n } else {\n this.print(key);\n }\n\n if (\n // @ts-expect-error optional is not in ObjectMethod\n node.optional\n ) {\n // TS\n this.token(\"?\");\n }\n\n this._params(\n node,\n node.computed && node.key.type !== \"StringLiteral\" ? undefined : node.key,\n );\n}\n\nexport function _predicate(\n this: Printer,\n node:\n | t.FunctionDeclaration\n | t.FunctionExpression\n | t.ArrowFunctionExpression,\n noLineTerminatorAfter?: boolean,\n) {\n if (node.predicate) {\n if (!node.returnType) {\n this.token(\":\");\n }\n this.space();\n this.print(node.predicate, noLineTerminatorAfter);\n }\n}\n\nexport function _functionHead(\n this: Printer,\n node: t.FunctionDeclaration | t.FunctionExpression | t.TSDeclareFunction,\n parent: ParentsOf,\n) {\n if (node.async) {\n this.word(\"async\");\n if (!this.format.preserveFormat) {\n // We prevent inner comments from being printed here,\n // so that they are always consistently printed in the\n // same place regardless of the function type.\n this._endsWithInnerRaw = false;\n }\n this.space();\n }\n this.word(\"function\");\n if (node.generator) {\n if (!this.format.preserveFormat) {\n // We prevent inner comments from being printed here,\n // so that they are always consistently printed in the\n // same place regardless of the function type.\n this._endsWithInnerRaw = false;\n }\n this.token(\"*\");\n }\n\n this.space();\n if (node.id) {\n this.print(node.id);\n }\n\n this._params(node, node.id, parent);\n if (node.type !== \"TSDeclareFunction\") {\n this._predicate(node);\n }\n}\n\nexport function FunctionExpression(\n this: Printer,\n node: t.FunctionExpression,\n parent: ParentsOf,\n) {\n this._functionHead(node, parent);\n this.space();\n this.print(node.body);\n}\n\nexport { FunctionExpression as FunctionDeclaration };\n\nexport function ArrowFunctionExpression(\n this: Printer,\n node: t.ArrowFunctionExpression,\n parent: ParentsOf,\n) {\n if (node.async) {\n this.word(\"async\", true);\n this.space();\n }\n\n if (this._shouldPrintArrowParamsParens(node)) {\n this._params(node, undefined, parent);\n } else {\n this.print(node.params[0], true);\n }\n\n this._predicate(node, true);\n this.space();\n // When printing (x)/*1*/=>{}, we remove the parentheses\n // and thus there aren't two contiguous inner tokens.\n // We forcefully print inner comments here.\n this.printInnerComments();\n this.token(\"=>\");\n\n this.space();\n\n this.tokenContext |= TokenContext.arrowBody;\n this.print(node.body);\n}\n\n// Try to avoid printing parens in simple cases, but only if we're pretty\n// sure that they aren't needed by type annotations or potential newlines.\nexport function _shouldPrintArrowParamsParens(\n this: Printer,\n node: t.ArrowFunctionExpression,\n): boolean {\n if (node.params.length !== 1) return true;\n\n if (node.typeParameters || node.returnType || node.predicate) {\n return true;\n }\n\n const firstParam = node.params[0];\n if (\n !isIdentifier(firstParam) ||\n firstParam.typeAnnotation ||\n firstParam.optional ||\n // Flow does not support `foo /*: string*/ => {};`\n firstParam.leadingComments?.length ||\n firstParam.trailingComments?.length\n ) {\n return true;\n }\n\n if (this.tokenMap) {\n if (node.loc == null) return true;\n if (this.tokenMap.findMatching(node, \"(\") !== null) return true;\n const arrowToken = this.tokenMap.findMatching(node, \"=>\");\n if (arrowToken?.loc == null) return true;\n return arrowToken.loc.start.line !== node.loc.start.line;\n }\n\n if (this.format.retainLines) return true;\n\n return false;\n}\n\nfunction _getFuncIdName(\n this: Printer,\n idNode: t.Expression | t.PrivateName,\n parent: ParentsOf,\n) {\n let id: t.Expression | t.PrivateName | t.LVal | t.VoidPattern = idNode;\n\n if (!id && parent) {\n const parentType = parent.type;\n\n if (parentType === \"VariableDeclarator\") {\n id = parent.id;\n } else if (\n parentType === \"AssignmentExpression\" ||\n parentType === \"AssignmentPattern\"\n ) {\n id = parent.left;\n } else if (\n parentType === \"ObjectProperty\" ||\n parentType === \"ClassProperty\"\n ) {\n if (!parent.computed || parent.key.type === \"StringLiteral\") {\n id = parent.key;\n }\n } else if (\n parentType === \"ClassPrivateProperty\" ||\n parentType === \"ClassAccessorProperty\"\n ) {\n id = parent.key;\n }\n }\n\n if (!id) return;\n\n let nameInfo;\n\n if (id.type === \"Identifier\") {\n nameInfo = {\n pos: id.loc?.start,\n name: id.loc?.identifierName || id.name,\n };\n } else if (id.type === \"PrivateName\") {\n nameInfo = {\n pos: id.loc?.start,\n name: \"#\" + id.id.name,\n };\n } else if (id.type === \"StringLiteral\") {\n nameInfo = {\n pos: id.loc?.start,\n name: id.value,\n };\n }\n\n return nameInfo;\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,IAAAA,EAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAgD;EADvCE;AAAY,IAAAH,EAAA;AAKd,SAASI,OAAOA,CAErBC,IAA0D,EAC1DC,MAAuD,EACvDC,UAAmC,EACnC;EACA,IAAI,CAACC,KAAK,CAACH,IAAI,CAACI,cAAc,CAAC;EAE/B,MAAMC,QAAQ,GAAGC,cAAc,CAACC,IAAI,CAAC,IAAI,EAAEN,MAAM,EAAEC,UAAU,CAAC;EAC9D,IAAIG,QAAQ,EAAE;IACZ,IAAI,CAACG,oBAAoB,CAACH,QAAQ,CAACI,IAAI,EAAEJ,QAAQ,CAACK,GAAG,CAAC;EACxD;EAEA,IAAI,CAACC,SAAK,GAAI,CAAC;EACf,IAAI,CAACC,WAAW,CAACZ,IAAI,CAACa,MAAM,EAAE,GAAG,CAAC;EAElC,MAAMC,gBAAgB,GAAGd,IAAI,CAACe,IAAI,KAAK,yBAAyB;EAChE,IAAI,CAACZ,KAAK,CAACH,IAAI,CAACgB,UAAU,EAAEF,gBAAgB,CAAC;E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AI,KAAK,YAAY,EAAE;IAAA,IAAA0D,OAAA,EAAAC,QAAA;IAC5BrE,QAAQ,GAAG;MACTK,GAAG,GAAA+D,OAAA,GAAEvB,EAAE,CAACe,GAAG,qBAANQ,OAAA,CAAQL,KAAK;MAClB3D,IAAI,EAAE,EAAAiE,QAAA,GAAAxB,EAAE,CAACe,GAAG,qBAANS,QAAA,CAAQC,cAAc,KAAIzB,EAAE,CAACzC;IACrC,CAAC;EACH,CAAC,MAAM,IAAIyC,EAAE,CAACnC,IAAI,KAAK,aAAa,EAAE;IAAA,IAAA6D,QAAA;IACpCvE,QAAQ,GAAG;MACTK,GAAG,GAAAkE,QAAA,GAAE1B,EAAE,CAACe,GAAG,qBAANW,QAAA,CAAQR,KAAK;MAClB3D,IAAI,EAAE,GAAG,GAAGyC,EAAE,CAACA,EAAE,CAACzC;IACpB,CAAC;EACH,CAAC,MAAM,IAAIyC,EAAE,CAACnC,IAAI,KAAK,eAAe,EAAE;IAAA,IAAA8D,QAAA;IACtCxE,QAAQ,GAAG;MACTK,GAAG,GAAAmE,QAAA,GAAE3B,EAAE,CAACe,GAAG,qBAANY,QAAA,CAAQT,KAAK;MAClB3D,IAAI,EAAEyC,EAAE,CAAC4B;IACX,CAAC;EACH;EAEA,OAAOzE,QAAQ;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/modules.js b/node_modules/@babel/generator/lib/generators/modules.js new file mode 100644 index 0000000..08bb646 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/modules.js @@ -0,0 +1,287 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ExportAllDeclaration = ExportAllDeclaration; +exports.ExportDefaultDeclaration = ExportDefaultDeclaration; +exports.ExportDefaultSpecifier = ExportDefaultSpecifier; +exports.ExportNamedDeclaration = ExportNamedDeclaration; +exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; +exports.ExportSpecifier = ExportSpecifier; +exports.ImportAttribute = ImportAttribute; +exports.ImportDeclaration = ImportDeclaration; +exports.ImportDefaultSpecifier = ImportDefaultSpecifier; +exports.ImportExpression = ImportExpression; +exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; +exports.ImportSpecifier = ImportSpecifier; +exports._printAttributes = _printAttributes; +var _t = require("@babel/types"); +var _index = require("../node/index.js"); +const { + isClassDeclaration, + isExportDefaultSpecifier, + isExportNamespaceSpecifier, + isImportDefaultSpecifier, + isImportNamespaceSpecifier, + isStatement +} = _t; +function ImportSpecifier(node) { + if (node.importKind === "type" || node.importKind === "typeof") { + this.word(node.importKind); + this.space(); + } + this.print(node.imported); + if (node.local && node.local.name !== node.imported.name) { + this.space(); + this.word("as"); + this.space(); + this.print(node.local); + } +} +function ImportDefaultSpecifier(node) { + this.print(node.local); +} +function ExportDefaultSpecifier(node) { + this.print(node.exported); +} +function ExportSpecifier(node) { + if (node.exportKind === "type") { + this.word("type"); + this.space(); + } + this.print(node.local); + if (node.exported && node.local.name !== node.exported.name) { + this.space(); + this.word("as"); + this.space(); + this.print(node.exported); + } +} +function ExportNamespaceSpecifier(node) { + this.tokenChar(42); + this.space(); + this.word("as"); + this.space(); + this.print(node.exported); +} +let warningShown = false; +function _printAttributes(node, hasPreviousBrace) { + var _node$extra; + const { + importAttributesKeyword + } = this.format; + const { + attributes, + assertions + } = node; + if (attributes && !importAttributesKeyword && node.extra && (node.extra.deprecatedAssertSyntax || node.extra.deprecatedWithLegacySyntax) && !warningShown) { + warningShown = true; + console.warn(`\ +You are using import attributes, without specifying the desired output syntax. +Please specify the "importAttributesKeyword" generator option, whose value can be one of: + - "with" : \`import { a } from "b" with { type: "json" };\` + - "assert" : \`import { a } from "b" assert { type: "json" };\` + - "with-legacy" : \`import { a } from "b" with type: "json";\` +`); + } + const useAssertKeyword = importAttributesKeyword === "assert" || !importAttributesKeyword && assertions; + this.word(useAssertKeyword ? "assert" : "with"); + this.space(); + if (!useAssertKeyword && (importAttributesKeyword === "with-legacy" || !importAttributesKeyword && (_node$extra = node.extra) != null && _node$extra.deprecatedWithLegacySyntax)) { + this.printList(attributes || assertions); + return; + } + const occurrenceCount = hasPreviousBrace ? 1 : 0; + this.token("{", undefined, occurrenceCount); + this.space(); + this.printList(attributes || assertions, this.shouldPrintTrailingComma("}")); + this.space(); + this.token("}", undefined, occurrenceCount); +} +function ExportAllDeclaration(node) { + var _node$attributes, _node$assertions; + this.word("export"); + this.space(); + if (node.exportKind === "type") { + this.word("type"); + this.space(); + } + this.tokenChar(42); + this.space(); + this.word("from"); + this.space(); + if ((_node$attributes = node.attributes) != null && _node$attributes.length || (_node$assertions = node.assertions) != null && _node$assertions.length) { + this.print(node.source, true); + this.space(); + this._printAttributes(node, false); + } else { + this.print(node.source); + } + this.semicolon(); +} +function maybePrintDecoratorsBeforeExport(printer, node) { + if (isClassDeclaration(node.declaration) && printer._shouldPrintDecoratorsBeforeExport(node)) { + printer.printJoin(node.declaration.decorators); + } +} +function ExportNamedDeclaration(node) { + maybePrintDecoratorsBeforeExport(this, node); + this.word("export"); + this.space(); + if (node.declaration) { + const declar = node.declaration; + this.print(declar); + if (!isStatement(declar)) this.semicolon(); + } else { + if (node.exportKind === "type") { + this.word("type"); + this.space(); + } + const specifiers = node.specifiers.slice(0); + let hasSpecial = false; + for (;;) { + const first = specifiers[0]; + if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) { + hasSpecial = true; + this.print(specifiers.shift()); + if (specifiers.length) { + this.tokenChar(44); + this.space(); + } + } else { + break; + } + } + let hasBrace = false; + if (specifiers.length || !specifiers.length && !hasSpecial) { + hasBrace = true; + this.tokenChar(123); + if (specifiers.length) { + this.space(); + this.printList(specifiers, this.shouldPrintTrailingComma("}")); + this.space(); + } + this.tokenChar(125); + } + if (node.source) { + var _node$attributes2, _node$assertions2; + this.space(); + this.word("from"); + this.space(); + if ((_node$attributes2 = node.attributes) != null && _node$attributes2.length || (_node$assertions2 = node.assertions) != null && _node$assertions2.length) { + this.print(node.source, true); + this.space(); + this._printAttributes(node, hasBrace); + } else { + this.print(node.source); + } + } + this.semicolon(); + } +} +function ExportDefaultDeclaration(node) { + maybePrintDecoratorsBeforeExport(this, node); + this.word("export"); + this.noIndentInnerCommentsHere(); + this.space(); + this.word("default"); + this.space(); + this.tokenContext |= _index.TokenContext.exportDefault; + const declar = node.declaration; + this.print(declar); + if (!isStatement(declar)) this.semicolon(); +} +function ImportDeclaration(node) { + var _node$attributes3, _node$assertions3; + this.word("import"); + this.space(); + const isTypeKind = node.importKind === "type" || node.importKind === "typeof"; + if (isTypeKind) { + this.noIndentInnerCommentsHere(); + this.word(node.importKind); + this.space(); + } else if (node.module) { + this.noIndentInnerCommentsHere(); + this.word("module"); + this.space(); + } else if (node.phase) { + this.noIndentInnerCommentsHere(); + this.word(node.phase); + this.space(); + } + const specifiers = node.specifiers.slice(0); + const hasSpecifiers = !!specifiers.length; + while (hasSpecifiers) { + const first = specifiers[0]; + if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) { + this.print(specifiers.shift()); + if (specifiers.length) { + this.tokenChar(44); + this.space(); + } + } else { + break; + } + } + let hasBrace = false; + if (specifiers.length) { + hasBrace = true; + this.tokenChar(123); + this.space(); + this.printList(specifiers, this.shouldPrintTrailingComma("}")); + this.space(); + this.tokenChar(125); + } else if (isTypeKind && !hasSpecifiers) { + hasBrace = true; + this.tokenChar(123); + this.tokenChar(125); + } + if (hasSpecifiers || isTypeKind) { + this.space(); + this.word("from"); + this.space(); + } + if ((_node$attributes3 = node.attributes) != null && _node$attributes3.length || (_node$assertions3 = node.assertions) != null && _node$assertions3.length) { + this.print(node.source, true); + this.space(); + this._printAttributes(node, hasBrace); + } else { + this.print(node.source); + } + this.semicolon(); +} +function ImportAttribute(node) { + this.print(node.key); + this.tokenChar(58); + this.space(); + this.print(node.value); +} +function ImportNamespaceSpecifier(node) { + this.tokenChar(42); + this.space(); + this.word("as"); + this.space(); + this.print(node.local); +} +function ImportExpression(node) { + this.word("import"); + if (node.phase) { + this.tokenChar(46); + this.word(node.phase); + } + this.tokenChar(40); + const shouldPrintTrailingComma = this.shouldPrintTrailingComma(")"); + this.print(node.source); + if (node.options != null) { + this.tokenChar(44); + this.space(); + this.print(node.options); + } + if (shouldPrintTrailingComma) { + this.tokenChar(44); + } + this.rightParens(node); +} + +//# sourceMappingURL=modules.js.map diff --git a/node_modules/@babel/generator/lib/generators/modules.js.map b/node_modules/@babel/generator/lib/generators/modules.js.map new file mode 100644 index 0000000..0b2dd29 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/modules.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","_index","isClassDeclaration","isExportDefaultSpecifier","isExportNamespaceSpecifier","isImportDefaultSpecifier","isImportNamespaceSpecifier","isStatement","ImportSpecifier","node","importKind","word","space","print","imported","local","name","ImportDefaultSpecifier","ExportDefaultSpecifier","exported","ExportSpecifier","exportKind","ExportNamespaceSpecifier","token","warningShown","_printAttributes","hasPreviousBrace","_node$extra","importAttributesKeyword","format","attributes","assertions","extra","deprecatedAssertSyntax","deprecatedWithLegacySyntax","console","warn","useAssertKeyword","printList","occurrenceCount","undefined","shouldPrintTrailingComma","ExportAllDeclaration","_node$attributes","_node$assertions","length","source","semicolon","maybePrintDecoratorsBeforeExport","printer","declaration","_shouldPrintDecoratorsBeforeExport","printJoin","decorators","ExportNamedDeclaration","declar","specifiers","slice","hasSpecial","first","shift","hasBrace","_node$attributes2","_node$assertions2","ExportDefaultDeclaration","noIndentInnerCommentsHere","tokenContext","TokenContext","exportDefault","ImportDeclaration","_node$attributes3","_node$assertions3","isTypeKind","module","phase","hasSpecifiers","ImportAttribute","key","value","ImportNamespaceSpecifier","ImportExpression","options","rightParens"],"sources":["../../src/generators/modules.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isClassDeclaration,\n isExportDefaultSpecifier,\n isExportNamespaceSpecifier,\n isImportDefaultSpecifier,\n isImportNamespaceSpecifier,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function ImportSpecifier(this: Printer, node: t.ImportSpecifier) {\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n this.print(node.imported);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.local && node.local.name !== node.imported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local);\n }\n}\n\nexport function ImportDefaultSpecifier(\n this: Printer,\n node: t.ImportDefaultSpecifier,\n) {\n this.print(node.local);\n}\n\nexport function ExportDefaultSpecifier(\n this: Printer,\n node: t.ExportDefaultSpecifier,\n) {\n this.print(node.exported);\n}\n\nexport function ExportSpecifier(this: Printer, node: t.ExportSpecifier) {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n this.print(node.local);\n // @ts-expect-error todo(flow-ts) maybe check node type instead of relying on name to be undefined on t.StringLiteral\n if (node.exported && node.local.name !== node.exported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported);\n }\n}\n\nexport function ExportNamespaceSpecifier(\n this: Printer,\n node: t.ExportNamespaceSpecifier,\n) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported);\n}\n\nlet warningShown = false;\n\nexport function _printAttributes(\n this: Printer,\n node: Extract,\n hasPreviousBrace: boolean,\n) {\n const { importAttributesKeyword } = this.format;\n const { attributes, assertions } = node;\n\n if (\n !process.env.BABEL_8_BREAKING &&\n attributes &&\n !importAttributesKeyword &&\n node.extra &&\n (node.extra.deprecatedAssertSyntax ||\n node.extra.deprecatedWithLegacySyntax) &&\n // In the production build only show the warning once.\n // We want to show it per-usage locally for tests.\n (!process.env.IS_PUBLISH || !warningShown)\n ) {\n warningShown = true;\n console.warn(`\\\nYou are using import attributes, without specifying the desired output syntax.\nPlease specify the \"importAttributesKeyword\" generator option, whose value can be one of:\n - \"with\" : \\`import { a } from \"b\" with { type: \"json\" };\\`\n - \"assert\" : \\`import { a } from \"b\" assert { type: \"json\" };\\`\n - \"with-legacy\" : \\`import { a } from \"b\" with type: \"json\";\\`\n`);\n }\n\n const useAssertKeyword =\n importAttributesKeyword === \"assert\" ||\n (!importAttributesKeyword && assertions);\n\n this.word(useAssertKeyword ? \"assert\" : \"with\");\n this.space();\n\n if (\n !process.env.BABEL_8_BREAKING &&\n !useAssertKeyword &&\n (importAttributesKeyword === \"with-legacy\" ||\n (!importAttributesKeyword && node.extra?.deprecatedWithLegacySyntax))\n ) {\n // with-legacy\n this.printList(attributes || assertions);\n return;\n }\n\n const occurrenceCount = hasPreviousBrace ? 1 : 0;\n\n this.token(\"{\", undefined, occurrenceCount);\n this.space();\n this.printList(attributes || assertions, this.shouldPrintTrailingComma(\"}\"));\n this.space();\n this.token(\"}\", undefined, occurrenceCount);\n}\n\nexport function ExportAllDeclaration(\n this: Printer,\n node: t.ExportAllDeclaration | t.DeclareExportAllDeclaration,\n) {\n this.word(\"export\");\n this.space();\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n this.token(\"*\");\n this.space();\n this.word(\"from\");\n this.space();\n if (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, true);\n this.space();\n this._printAttributes(node, false);\n } else {\n this.print(node.source);\n }\n\n this.semicolon();\n}\n\nfunction maybePrintDecoratorsBeforeExport(\n printer: Printer,\n node: t.ExportNamedDeclaration | t.ExportDefaultDeclaration,\n) {\n if (\n isClassDeclaration(node.declaration) &&\n printer._shouldPrintDecoratorsBeforeExport(\n node as t.ExportNamedDeclaration & { declaration: t.ClassDeclaration },\n )\n ) {\n printer.printJoin(node.declaration.decorators);\n }\n}\n\nexport function ExportNamedDeclaration(\n this: Printer,\n node: t.ExportNamedDeclaration,\n) {\n maybePrintDecoratorsBeforeExport(this, node);\n\n this.word(\"export\");\n this.space();\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar);\n if (!isStatement(declar)) this.semicolon();\n } else {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n\n // print \"special\" specifiers first\n let hasSpecial = false;\n for (;;) {\n const first = specifiers[0];\n if (\n isExportDefaultSpecifier(first) ||\n isExportNamespaceSpecifier(first)\n ) {\n hasSpecial = true;\n this.print(specifiers.shift());\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n let hasBrace = false;\n if (specifiers.length || (!specifiers.length && !hasSpecial)) {\n hasBrace = true;\n this.token(\"{\");\n if (specifiers.length) {\n this.space();\n this.printList(specifiers, this.shouldPrintTrailingComma(\"}\"));\n this.space();\n }\n this.token(\"}\");\n }\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n if (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, true);\n this.space();\n this._printAttributes(node, hasBrace);\n } else {\n this.print(node.source);\n }\n }\n\n this.semicolon();\n }\n}\n\nexport function ExportDefaultDeclaration(\n this: Printer,\n node: t.ExportDefaultDeclaration,\n) {\n maybePrintDecoratorsBeforeExport(this, node);\n\n this.word(\"export\");\n this.noIndentInnerCommentsHere();\n this.space();\n this.word(\"default\");\n this.space();\n this.tokenContext |= TokenContext.exportDefault;\n const declar = node.declaration;\n this.print(declar);\n if (!isStatement(declar)) this.semicolon();\n}\n\nexport function ImportDeclaration(this: Printer, node: t.ImportDeclaration) {\n this.word(\"import\");\n this.space();\n\n const isTypeKind = node.importKind === \"type\" || node.importKind === \"typeof\";\n if (isTypeKind) {\n this.noIndentInnerCommentsHere();\n this.word(node.importKind!);\n this.space();\n } else if (node.module) {\n this.noIndentInnerCommentsHere();\n this.word(\"module\");\n this.space();\n } else if (node.phase) {\n this.noIndentInnerCommentsHere();\n this.word(node.phase);\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n const hasSpecifiers = !!specifiers.length;\n // print \"special\" specifiers first. The loop condition is constant,\n // but there is a \"break\" in the body.\n while (hasSpecifiers) {\n const first = specifiers[0];\n if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {\n this.print(specifiers.shift());\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n let hasBrace = false;\n if (specifiers.length) {\n hasBrace = true;\n this.token(\"{\");\n this.space();\n this.printList(specifiers, this.shouldPrintTrailingComma(\"}\"));\n this.space();\n this.token(\"}\");\n } else if (isTypeKind && !hasSpecifiers) {\n hasBrace = true;\n this.token(\"{\");\n this.token(\"}\");\n }\n\n if (hasSpecifiers || isTypeKind) {\n this.space();\n this.word(\"from\");\n this.space();\n }\n\n if (node.attributes?.length || node.assertions?.length) {\n this.print(node.source, true);\n this.space();\n this._printAttributes(node, hasBrace);\n } else {\n this.print(node.source);\n }\n\n this.semicolon();\n}\n\nexport function ImportAttribute(this: Printer, node: t.ImportAttribute) {\n this.print(node.key);\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nexport function ImportNamespaceSpecifier(\n this: Printer,\n node: t.ImportNamespaceSpecifier,\n) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local);\n}\n\nexport function ImportExpression(this: Printer, node: t.ImportExpression) {\n this.word(\"import\");\n if (node.phase) {\n this.token(\".\");\n this.word(node.phase);\n }\n this.token(\"(\");\n const shouldPrintTrailingComma = this.shouldPrintTrailingComma(\")\");\n this.print(node.source);\n if (node.options != null) {\n this.token(\",\");\n this.space();\n this.print(node.options);\n }\n if (shouldPrintTrailingComma) {\n this.token(\",\");\n }\n this.rightParens(node);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AASA,IAAAC,MAAA,GAAAD,OAAA;AAAgD;EAR9CE,kBAAkB;EAClBC,wBAAwB;EACxBC,0BAA0B;EAC1BC,wBAAwB;EACxBC,0BAA0B;EAC1BC;AAAW,IAAAR,EAAA;AAKN,SAASS,eAAeA,CAAgBC,IAAuB,EAAE;EACtE,IAAIA,IAAI,CAACC,U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K,CAACJ,IAAI,CAACqC,MAAM,CAAC;EACvB,IAAIrC,IAAI,CAACwE,OAAO,IAAI,IAAI,EAAE;IACxB,IAAI,CAAC1D,SAAK,GAAI,CAAC;IACf,IAAI,CAACX,KAAK,CAAC,CAAC;IACZ,IAAI,CAACC,KAAK,CAACJ,IAAI,CAACwE,OAAO,CAAC;EAC1B;EACA,IAAIxC,wBAAwB,EAAE;IAC5B,IAAI,CAAClB,SAAK,GAAI,CAAC;EACjB;EACA,IAAI,CAAC2D,WAAW,CAACzE,IAAI,CAAC;AACxB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/statements.js b/node_modules/@babel/generator/lib/generators/statements.js new file mode 100644 index 0000000..5233fdf --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/statements.js @@ -0,0 +1,277 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BreakStatement = BreakStatement; +exports.CatchClause = CatchClause; +exports.ContinueStatement = ContinueStatement; +exports.DebuggerStatement = DebuggerStatement; +exports.DoWhileStatement = DoWhileStatement; +exports.ForOfStatement = exports.ForInStatement = void 0; +exports.ForStatement = ForStatement; +exports.IfStatement = IfStatement; +exports.LabeledStatement = LabeledStatement; +exports.ReturnStatement = ReturnStatement; +exports.SwitchCase = SwitchCase; +exports.SwitchStatement = SwitchStatement; +exports.ThrowStatement = ThrowStatement; +exports.TryStatement = TryStatement; +exports.VariableDeclaration = VariableDeclaration; +exports.VariableDeclarator = VariableDeclarator; +exports.WhileStatement = WhileStatement; +exports.WithStatement = WithStatement; +var _t = require("@babel/types"); +const { + isFor, + isForStatement, + isIfStatement, + isStatement +} = _t; +function WithStatement(node) { + this.word("with"); + this.space(); + this.tokenChar(40); + this.print(node.object); + this.tokenChar(41); + this.printBlock(node); +} +function IfStatement(node) { + this.word("if"); + this.space(); + this.tokenChar(40); + this.print(node.test); + this.tokenChar(41); + this.space(); + const needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent)); + if (needsBlock) { + this.tokenChar(123); + this.newline(); + this.indent(); + } + this.printAndIndentOnComments(node.consequent); + if (needsBlock) { + this.dedent(); + this.newline(); + this.tokenChar(125); + } + if (node.alternate) { + if (this.endsWith(125)) this.space(); + this.word("else"); + this.space(); + this.printAndIndentOnComments(node.alternate); + } +} +function getLastStatement(statement) { + const { + body + } = statement; + if (isStatement(body) === false) { + return statement; + } + return getLastStatement(body); +} +function ForStatement(node) { + this.word("for"); + this.space(); + this.tokenChar(40); + { + const exit = this.enterForStatementInit(); + this.print(node.init); + exit(); + } + this.tokenChar(59); + if (node.test) { + this.space(); + this.print(node.test); + } + this.token(";", false, 1); + if (node.update) { + this.space(); + this.print(node.update); + } + this.tokenChar(41); + this.printBlock(node); +} +function WhileStatement(node) { + this.word("while"); + this.space(); + this.tokenChar(40); + this.print(node.test); + this.tokenChar(41); + this.printBlock(node); +} +function ForXStatement(node) { + this.word("for"); + this.space(); + const isForOf = node.type === "ForOfStatement"; + if (isForOf && node.await) { + this.word("await"); + this.space(); + } + this.noIndentInnerCommentsHere(); + this.tokenChar(40); + { + const exit = this.enterForXStatementInit(isForOf); + this.print(node.left); + exit == null || exit(); + } + this.space(); + this.word(isForOf ? "of" : "in"); + this.space(); + this.print(node.right); + this.tokenChar(41); + this.printBlock(node); +} +const ForInStatement = exports.ForInStatement = ForXStatement; +const ForOfStatement = exports.ForOfStatement = ForXStatement; +function DoWhileStatement(node) { + this.word("do"); + this.space(); + this.print(node.body); + this.space(); + this.word("while"); + this.space(); + this.tokenChar(40); + this.print(node.test); + this.tokenChar(41); + this.semicolon(); +} +function printStatementAfterKeyword(printer, node) { + if (node) { + printer.space(); + printer.printTerminatorless(node); + } + printer.semicolon(); +} +function BreakStatement(node) { + this.word("break"); + printStatementAfterKeyword(this, node.label); +} +function ContinueStatement(node) { + this.word("continue"); + printStatementAfterKeyword(this, node.label); +} +function ReturnStatement(node) { + this.word("return"); + printStatementAfterKeyword(this, node.argument); +} +function ThrowStatement(node) { + this.word("throw"); + printStatementAfterKeyword(this, node.argument); +} +function LabeledStatement(node) { + this.print(node.label); + this.tokenChar(58); + this.space(); + this.print(node.body); +} +function TryStatement(node) { + this.word("try"); + this.space(); + this.print(node.block); + this.space(); + if (node.handlers) { + this.print(node.handlers[0]); + } else { + this.print(node.handler); + } + if (node.finalizer) { + this.space(); + this.word("finally"); + this.space(); + this.print(node.finalizer); + } +} +function CatchClause(node) { + this.word("catch"); + this.space(); + if (node.param) { + this.tokenChar(40); + this.print(node.param); + this.print(node.param.typeAnnotation); + this.tokenChar(41); + this.space(); + } + this.print(node.body); +} +function SwitchStatement(node) { + this.word("switch"); + this.space(); + this.tokenChar(40); + this.print(node.discriminant); + this.tokenChar(41); + this.space(); + this.tokenChar(123); + this.printSequence(node.cases, true); + this.rightBrace(node); +} +function SwitchCase(node) { + if (node.test) { + this.word("case"); + this.space(); + this.print(node.test); + this.tokenChar(58); + } else { + this.word("default"); + this.tokenChar(58); + } + if (node.consequent.length) { + this.newline(); + this.printSequence(node.consequent, true); + } +} +function DebuggerStatement() { + this.word("debugger"); + this.semicolon(); +} +function VariableDeclaration(node, parent) { + if (node.declare) { + this.word("declare"); + this.space(); + } + const { + kind + } = node; + if (kind === "await using") { + this.word("await"); + this.space(); + this.word("using", true); + } else { + this.word(kind, kind === "using"); + } + this.space(); + let hasInits = false; + if (!isFor(parent)) { + for (const declar of node.declarations) { + if (declar.init) { + hasInits = true; + } + } + } + this.printList(node.declarations, undefined, undefined, node.declarations.length > 1, hasInits ? function (occurrenceCount) { + this.token(",", false, occurrenceCount); + this.newline(); + } : undefined); + if (isFor(parent)) { + if (isForStatement(parent)) { + if (parent.init === node) return; + } else { + if (parent.left === node) return; + } + } + this.semicolon(); +} +function VariableDeclarator(node) { + this.print(node.id); + if (node.definite) this.tokenChar(33); + this.print(node.id.typeAnnotation); + if (node.init) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.init); + } +} + +//# sourceMappingURL=statements.js.map diff --git a/node_modules/@babel/generator/lib/generators/statements.js.map b/node_modules/@babel/generator/lib/generators/statements.js.map new file mode 100644 index 0000000..fa13374 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/statements.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","isFor","isForStatement","isIfStatement","isStatement","WithStatement","node","word","space","token","print","object","printBlock","IfStatement","test","needsBlock","alternate","getLastStatement","consequent","newline","indent","printAndIndentOnComments","dedent","endsWith","statement","body","ForStatement","exit","enterForStatementInit","init","update","WhileStatement","ForXStatement","isForOf","type","await","noIndentInnerCommentsHere","enterForXStatementInit","left","right","ForInStatement","exports","ForOfStatement","DoWhileStatement","semicolon","printStatementAfterKeyword","printer","printTerminatorless","BreakStatement","label","ContinueStatement","ReturnStatement","argument","ThrowStatement","LabeledStatement","TryStatement","block","handlers","handler","finalizer","CatchClause","param","typeAnnotation","SwitchStatement","discriminant","printSequence","cases","rightBrace","SwitchCase","length","DebuggerStatement","VariableDeclaration","parent","declare","kind","hasInits","declar","declarations","printList","undefined","occurrenceCount","VariableDeclarator","id","definite"],"sources":["../../src/generators/statements.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport {\n isFor,\n isForStatement,\n isIfStatement,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nexport function WithStatement(this: Printer, node: t.WithStatement) {\n this.word(\"with\");\n this.space();\n this.token(\"(\");\n this.print(node.object);\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function IfStatement(this: Printer, node: t.IfStatement) {\n this.word(\"if\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.space();\n\n const needsBlock =\n node.alternate && isIfStatement(getLastStatement(node.consequent));\n if (needsBlock) {\n this.token(\"{\");\n this.newline();\n this.indent();\n }\n\n this.printAndIndentOnComments(node.consequent);\n\n if (needsBlock) {\n this.dedent();\n this.newline();\n this.token(\"}\");\n }\n\n if (node.alternate) {\n if (this.endsWith(charCodes.rightCurlyBrace)) this.space();\n this.word(\"else\");\n this.space();\n this.printAndIndentOnComments(node.alternate);\n }\n}\n\n// Recursively get the last statement.\nfunction getLastStatement(statement: t.Statement): t.Statement {\n // @ts-expect-error: If statement.body is empty or not a Node, isStatement will return false\n const { body } = statement;\n if (isStatement(body) === false) {\n return statement;\n }\n\n return getLastStatement(body);\n}\n\nexport function ForStatement(this: Printer, node: t.ForStatement) {\n this.word(\"for\");\n this.space();\n this.token(\"(\");\n\n {\n const exit = this.enterForStatementInit();\n this.print(node.init);\n exit();\n }\n\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test);\n }\n this.token(\";\", false, 1);\n\n if (node.update) {\n this.space();\n this.print(node.update);\n }\n\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function WhileStatement(this: Printer, node: t.WhileStatement) {\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.printBlock(node);\n}\n\nfunction ForXStatement(this: Printer, node: t.ForXStatement) {\n this.word(\"for\");\n this.space();\n const isForOf = node.type === \"ForOfStatement\";\n if (isForOf && node.await) {\n this.word(\"await\");\n this.space();\n }\n this.noIndentInnerCommentsHere();\n this.token(\"(\");\n {\n const exit = this.enterForXStatementInit(isForOf);\n this.print(node.left);\n exit?.();\n }\n this.space();\n this.word(isForOf ? \"of\" : \"in\");\n this.space();\n this.print(node.right);\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport const ForInStatement = ForXStatement;\nexport const ForOfStatement = ForXStatement;\n\nexport function DoWhileStatement(this: Printer, node: t.DoWhileStatement) {\n this.word(\"do\");\n this.space();\n this.print(node.body);\n this.space();\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.semicolon();\n}\n\nfunction printStatementAfterKeyword(\n printer: Printer,\n node: t.Node | null | undefined,\n) {\n if (node) {\n printer.space();\n printer.printTerminatorless(node);\n }\n\n printer.semicolon();\n}\n\nexport function BreakStatement(this: Printer, node: t.ContinueStatement) {\n this.word(\"break\");\n printStatementAfterKeyword(this, node.label);\n}\n\nexport function ContinueStatement(this: Printer, node: t.ContinueStatement) {\n this.word(\"continue\");\n printStatementAfterKeyword(this, node.label);\n}\n\nexport function ReturnStatement(this: Printer, node: t.ReturnStatement) {\n this.word(\"return\");\n printStatementAfterKeyword(this, node.argument);\n}\n\nexport function ThrowStatement(this: Printer, node: t.ThrowStatement) {\n this.word(\"throw\");\n printStatementAfterKeyword(this, node.argument);\n}\n\nexport function LabeledStatement(this: Printer, node: t.LabeledStatement) {\n this.print(node.label);\n this.token(\":\");\n this.space();\n this.print(node.body);\n}\n\nexport function TryStatement(this: Printer, node: t.TryStatement) {\n this.word(\"try\");\n this.space();\n this.print(node.block);\n this.space();\n\n // Esprima bug puts the catch clause in a `handlers` array.\n // see https://code.google.com/p/esprima/issues/detail?id=433\n // We run into this from regenerator generated ast.\n // @ts-expect-error todo(flow->ts) should ast node type be updated to support this?\n if (node.handlers) {\n // @ts-expect-error todo(flow->ts) should ast node type be updated to support this?\n this.print(node.handlers[0]);\n } else {\n this.print(node.handler);\n }\n\n if (node.finalizer) {\n this.space();\n this.word(\"finally\");\n this.space();\n this.print(node.finalizer);\n }\n}\n\nexport function CatchClause(this: Printer, node: t.CatchClause) {\n this.word(\"catch\");\n this.space();\n if (node.param) {\n this.token(\"(\");\n this.print(node.param);\n this.print(node.param.typeAnnotation);\n this.token(\")\");\n this.space();\n }\n this.print(node.body);\n}\n\nexport function SwitchStatement(this: Printer, node: t.SwitchStatement) {\n this.word(\"switch\");\n this.space();\n this.token(\"(\");\n this.print(node.discriminant);\n this.token(\")\");\n this.space();\n this.token(\"{\");\n\n this.printSequence(node.cases, true);\n\n this.rightBrace(node);\n}\n\nexport function SwitchCase(this: Printer, node: t.SwitchCase) {\n if (node.test) {\n this.word(\"case\");\n this.space();\n this.print(node.test);\n this.token(\":\");\n } else {\n this.word(\"default\");\n this.token(\":\");\n }\n\n if (node.consequent.length) {\n this.newline();\n this.printSequence(node.consequent, true);\n }\n}\n\nexport function DebuggerStatement(this: Printer) {\n this.word(\"debugger\");\n this.semicolon();\n}\n\nexport function VariableDeclaration(\n this: Printer,\n node: t.VariableDeclaration,\n parent: t.Node,\n) {\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n const { kind } = node;\n if (kind === \"await using\") {\n this.word(\"await\");\n this.space();\n this.word(\"using\", true);\n } else {\n this.word(kind, kind === \"using\");\n }\n this.space();\n\n let hasInits = false;\n // don't add whitespace to loop heads\n if (!isFor(parent)) {\n for (const declar of node.declarations) {\n if (declar.init) {\n // has an init so let's split it up over multiple lines\n hasInits = true;\n }\n }\n }\n\n //\n // use a pretty separator when we aren't in compact mode, have initializers and don't have retainLines on\n // this will format declarations like:\n //\n // let foo = \"bar\", bar = \"foo\";\n //\n // into\n //\n // let foo = \"bar\",\n // bar = \"foo\";\n //\n\n this.printList(\n node.declarations,\n undefined,\n undefined,\n node.declarations.length > 1,\n hasInits\n ? function (this: Printer, occurrenceCount: number) {\n this.token(\",\", false, occurrenceCount);\n this.newline();\n }\n : undefined,\n );\n\n if (isFor(parent)) {\n // don't give semicolons to these nodes since they'll be inserted in the parent generator\n if (isForStatement(parent)) {\n if (parent.init === node) return;\n } else {\n if (parent.left === node) return;\n }\n }\n\n this.semicolon();\n}\n\nexport function VariableDeclarator(this: Printer, node: t.VariableDeclarator) {\n this.print(node.id);\n if (node.definite) this.token(\"!\"); // TS\n // @ts-ignore(Babel 7 vs Babel 8) Property 'typeAnnotation' does not exist on type 'MemberExpression'.\n this.print(node.id.typeAnnotation);\n if (node.init) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.init);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAKsB;EAJpBC,KAAK;EACLC,cAAc;EACdC,aAAa;EACbC;AAAW,IAAAL,EAAA;AAQN,S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;AAEO,SAASqC,kBAAkBA,CAAgB3E,IAA0B,EAAE;EAC5E,IAAI,CAACI,KAAK,CAACJ,IAAI,CAAC4E,EAAE,CAAC;EACnB,IAAI5E,IAAI,CAAC6E,QAAQ,EAAE,IAAI,CAAC1E,SAAK,GAAI,CAAC;EAElC,IAAI,CAACC,KAAK,CAACJ,IAAI,CAAC4E,EAAE,CAACpB,cAAc,CAAC;EAClC,IAAIxD,IAAI,CAACuB,IAAI,EAAE;IACb,IAAI,CAACrB,KAAK,CAAC,CAAC;IACZ,IAAI,CAACC,SAAK,GAAI,CAAC;IACf,IAAI,CAACD,KAAK,CAAC,CAAC;IACZ,IAAI,CAACE,KAAK,CAACJ,IAAI,CAACuB,IAAI,CAAC;EACvB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/template-literals.js b/node_modules/@babel/generator/lib/generators/template-literals.js new file mode 100644 index 0000000..0e4b6a9 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/template-literals.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TaggedTemplateExpression = TaggedTemplateExpression; +exports.TemplateElement = TemplateElement; +exports.TemplateLiteral = TemplateLiteral; +exports._printTemplate = _printTemplate; +function TaggedTemplateExpression(node) { + this.print(node.tag); + { + this.print(node.typeParameters); + } + this.print(node.quasi); +} +function TemplateElement() { + throw new Error("TemplateElement printing is handled in TemplateLiteral"); +} +function _printTemplate(node, substitutions) { + const quasis = node.quasis; + let partRaw = "`"; + for (let i = 0; i < quasis.length - 1; i++) { + partRaw += quasis[i].value.raw; + this.token(partRaw + "${", true); + this.print(substitutions[i]); + partRaw = "}"; + if (this.tokenMap) { + const token = this.tokenMap.findMatching(node, "}", i); + if (token) this._catchUpTo(token.loc.start); + } + } + partRaw += quasis[quasis.length - 1].value.raw; + this.token(partRaw + "`", true); +} +function TemplateLiteral(node) { + this._printTemplate(node, node.expressions); +} + +//# sourceMappingURL=template-literals.js.map diff --git a/node_modules/@babel/generator/lib/generators/template-literals.js.map b/node_modules/@babel/generator/lib/generators/template-literals.js.map new file mode 100644 index 0000000..26bd4e9 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/template-literals.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TaggedTemplateExpression","node","print","tag","typeParameters","quasi","TemplateElement","Error","_printTemplate","substitutions","quasis","partRaw","i","length","value","raw","token","tokenMap","findMatching","_catchUpTo","loc","start","TemplateLiteral","expressions"],"sources":["../../src/generators/template-literals.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function TaggedTemplateExpression(\n this: Printer,\n node: t.TaggedTemplateExpression,\n) {\n this.print(node.tag);\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n this.print(node.typeArguments);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n this.print(node.typeParameters);\n }\n this.print(node.quasi);\n}\n\nexport function TemplateElement(this: Printer) {\n throw new Error(\"TemplateElement printing is handled in TemplateLiteral\");\n}\n\nexport type TemplateLiteralBase = t.Node & {\n quasis: t.TemplateElement[];\n};\n\nexport function _printTemplate(\n this: Printer,\n node: TemplateLiteralBase,\n substitutions: T[],\n) {\n const quasis = node.quasis;\n let partRaw = \"`\";\n for (let i = 0; i < quasis.length - 1; i++) {\n partRaw += quasis[i].value.raw;\n this.token(partRaw + \"${\", true);\n this.print(substitutions[i]);\n partRaw = \"}\";\n\n // In Babel 7 we have individual tokens for ${ and }, so the automatic\n // catchup logic does not work. Manually look for those tokens.\n if (!process.env.BABEL_8_BREAKING && this.tokenMap) {\n const token = this.tokenMap.findMatching(node, \"}\", i);\n if (token) this._catchUpTo(token.loc.start);\n }\n }\n partRaw += quasis[quasis.length - 1].value.raw;\n this.token(partRaw + \"`\", true);\n}\n\nexport function TemplateLiteral(this: Printer, node: t.TemplateLiteral) {\n this._printTemplate(node, node.expressions);\n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,EAAE;EACtE,IAAI,CAACO,cAAc,CAACP,IAAI,EAAEA,IAAI,CAACsB,WAAW,CAAC;AAC7C","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/types.js b/node_modules/@babel/generator/lib/generators/types.js new file mode 100644 index 0000000..7b93067 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/types.js @@ -0,0 +1,238 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ArgumentPlaceholder = ArgumentPlaceholder; +exports.ArrayPattern = exports.ArrayExpression = ArrayExpression; +exports.BigIntLiteral = BigIntLiteral; +exports.BooleanLiteral = BooleanLiteral; +exports.Identifier = Identifier; +exports.NullLiteral = NullLiteral; +exports.NumericLiteral = NumericLiteral; +exports.ObjectPattern = exports.ObjectExpression = ObjectExpression; +exports.ObjectMethod = ObjectMethod; +exports.ObjectProperty = ObjectProperty; +exports.PipelineBareFunction = PipelineBareFunction; +exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference; +exports.PipelineTopicExpression = PipelineTopicExpression; +exports.RecordExpression = RecordExpression; +exports.RegExpLiteral = RegExpLiteral; +exports.SpreadElement = exports.RestElement = RestElement; +exports.StringLiteral = StringLiteral; +exports.TopicReference = TopicReference; +exports.TupleExpression = TupleExpression; +exports.VoidPattern = VoidPattern; +exports._getRawIdentifier = _getRawIdentifier; +var _t = require("@babel/types"); +var _jsesc = require("jsesc"); +const { + isAssignmentPattern, + isIdentifier +} = _t; +let lastRawIdentNode = null; +let lastRawIdentResult = ""; +function _getRawIdentifier(node) { + if (node === lastRawIdentNode) return lastRawIdentResult; + lastRawIdentNode = node; + const { + name + } = node; + const token = this.tokenMap.find(node, tok => tok.value === name); + if (token) { + lastRawIdentResult = this._originalCode.slice(token.start, token.end); + return lastRawIdentResult; + } + return lastRawIdentResult = node.name; +} +function Identifier(node) { + var _node$loc; + this.sourceIdentifierName(((_node$loc = node.loc) == null ? void 0 : _node$loc.identifierName) || node.name); + this.word(this.tokenMap ? this._getRawIdentifier(node) : node.name); +} +function ArgumentPlaceholder() { + this.tokenChar(63); +} +function RestElement(node) { + this.token("..."); + this.print(node.argument); +} +function ObjectExpression(node) { + const props = node.properties; + this.tokenChar(123); + if (props.length) { + const exit = this.enterDelimited(); + this.space(); + this.printList(props, this.shouldPrintTrailingComma("}"), true, true); + this.space(); + exit(); + } + this.sourceWithOffset("end", node.loc, -1); + this.tokenChar(125); +} +function ObjectMethod(node) { + this.printJoin(node.decorators); + this._methodHead(node); + this.space(); + this.print(node.body); +} +function ObjectProperty(node) { + this.printJoin(node.decorators); + if (node.computed) { + this.tokenChar(91); + this.print(node.key); + this.tokenChar(93); + } else { + if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) { + this.print(node.value); + return; + } + this.print(node.key); + if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) { + return; + } + } + this.tokenChar(58); + this.space(); + this.print(node.value); +} +function ArrayExpression(node) { + const elems = node.elements; + const len = elems.length; + this.tokenChar(91); + const exit = this.enterDelimited(); + for (let i = 0; i < elems.length; i++) { + const elem = elems[i]; + if (elem) { + if (i > 0) this.space(); + this.print(elem); + if (i < len - 1 || this.shouldPrintTrailingComma("]")) { + this.token(",", false, i); + } + } else { + this.token(",", false, i); + } + } + exit(); + this.tokenChar(93); +} +function RecordExpression(node) { + const props = node.properties; + let startToken; + let endToken; + { + if (this.format.recordAndTupleSyntaxType === "bar") { + startToken = "{|"; + endToken = "|}"; + } else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) { + throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`); + } else { + startToken = "#{"; + endToken = "}"; + } + } + this.token(startToken); + if (props.length) { + this.space(); + this.printList(props, this.shouldPrintTrailingComma(endToken), true, true); + this.space(); + } + this.token(endToken); +} +function TupleExpression(node) { + const elems = node.elements; + const len = elems.length; + let startToken; + let endToken; + { + if (this.format.recordAndTupleSyntaxType === "bar") { + startToken = "[|"; + endToken = "|]"; + } else if (this.format.recordAndTupleSyntaxType === "hash") { + startToken = "#["; + endToken = "]"; + } else { + throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`); + } + } + this.token(startToken); + for (let i = 0; i < elems.length; i++) { + const elem = elems[i]; + if (elem) { + if (i > 0) this.space(); + this.print(elem); + if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) { + this.token(",", false, i); + } + } + } + this.token(endToken); +} +function RegExpLiteral(node) { + this.word(`/${node.pattern}/${node.flags}`); +} +function BooleanLiteral(node) { + this.word(node.value ? "true" : "false"); +} +function NullLiteral() { + this.word("null"); +} +function NumericLiteral(node) { + const raw = this.getPossibleRaw(node); + const opts = this.format.jsescOption; + const value = node.value; + const str = value + ""; + if (opts.numbers) { + this.number(_jsesc(value, opts), value); + } else if (raw == null) { + this.number(str, value); + } else if (this.format.minified) { + this.number(raw.length < str.length ? raw : str, value); + } else { + this.number(raw, value); + } +} +function StringLiteral(node) { + const raw = this.getPossibleRaw(node); + if (!this.format.minified && raw !== undefined) { + this.token(raw); + return; + } + const val = _jsesc(node.value, this.format.jsescOption); + this.token(val); +} +function BigIntLiteral(node) { + const raw = this.getPossibleRaw(node); + if (!this.format.minified && raw !== undefined) { + this.word(raw); + return; + } + this.word(node.value + "n"); +} +const validTopicTokenSet = new Set(["^^", "@@", "^", "%", "#"]); +function TopicReference() { + const { + topicToken + } = this.format; + if (validTopicTokenSet.has(topicToken)) { + this.token(topicToken); + } else { + const givenTopicTokenJSON = JSON.stringify(topicToken); + const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v)); + throw new Error(`The "topicToken" generator option must be one of ` + `${validTopics.join(", ")} (${givenTopicTokenJSON} received instead).`); + } +} +function PipelineTopicExpression(node) { + this.print(node.expression); +} +function PipelineBareFunction(node) { + this.print(node.callee); +} +function PipelinePrimaryTopicReference() { + this.tokenChar(35); +} +function VoidPattern() { + this.word("void"); +} + +//# sourceMappingURL=types.js.map diff --git a/node_modules/@babel/generator/lib/generators/types.js.map b/node_modules/@babel/generator/lib/generators/types.js.map new file mode 100644 index 0000000..fd52317 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/types.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","_jsesc","isAssignmentPattern","isIdentifier","lastRawIdentNode","lastRawIdentResult","_getRawIdentifier","node","name","token","tokenMap","find","tok","value","_originalCode","slice","start","end","Identifier","_node$loc","sourceIdentifierName","loc","identifierName","word","ArgumentPlaceholder","RestElement","print","argument","ObjectExpression","props","properties","length","exit","enterDelimited","space","printList","shouldPrintTrailingComma","sourceWithOffset","ObjectMethod","printJoin","decorators","_methodHead","body","ObjectProperty","computed","key","left","shorthand","ArrayExpression","elems","elements","len","i","elem","RecordExpression","startToken","endToken","format","recordAndTupleSyntaxType","Error","JSON","stringify","TupleExpression","RegExpLiteral","pattern","flags","BooleanLiteral","NullLiteral","NumericLiteral","raw","getPossibleRaw","opts","jsescOption","str","numbers","number","jsesc","minified","StringLiteral","undefined","val","BigIntLiteral","validTopicTokenSet","Set","TopicReference","topicToken","has","givenTopicTokenJSON","validTopics","Array","from","v","join","PipelineTopicExpression","expression","PipelineBareFunction","callee","PipelinePrimaryTopicReference","VoidPattern"],"sources":["../../src/generators/types.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport { isAssignmentPattern, isIdentifier } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport jsesc from \"jsesc\";\n\nlet lastRawIdentNode: t.Identifier | null = null;\nlet lastRawIdentResult: string = \"\";\nexport function _getRawIdentifier(this: Printer, node: t.Identifier) {\n if (node === lastRawIdentNode) return lastRawIdentResult;\n lastRawIdentNode = node;\n\n const { name } = node;\n const token = this.tokenMap!.find(node, tok => tok.value === name);\n if (token) {\n lastRawIdentResult = this._originalCode!.slice(token.start, token.end);\n return lastRawIdentResult;\n }\n return (lastRawIdentResult = node.name);\n}\n\nexport function Identifier(this: Printer, node: t.Identifier) {\n this.sourceIdentifierName(node.loc?.identifierName || node.name);\n\n this.word(this.tokenMap ? this._getRawIdentifier(node) : node.name);\n}\n\nexport function ArgumentPlaceholder(this: Printer) {\n this.token(\"?\");\n}\n\nexport function RestElement(this: Printer, node: t.RestElement) {\n this.token(\"...\");\n this.print(node.argument);\n}\n\nexport { RestElement as SpreadElement };\n\nexport function ObjectExpression(this: Printer, node: t.ObjectExpression) {\n const props = node.properties;\n\n this.token(\"{\");\n\n if (props.length) {\n const exit = this.enterDelimited();\n this.space();\n this.printList(props, this.shouldPrintTrailingComma(\"}\"), true, true);\n this.space();\n exit();\n }\n\n this.sourceWithOffset(\"end\", node.loc, -1);\n\n this.token(\"}\");\n}\n\nexport { ObjectExpression as ObjectPattern };\n\nexport function ObjectMethod(this: Printer, node: t.ObjectMethod) {\n this.printJoin(node.decorators);\n this._methodHead(node);\n this.space();\n this.print(node.body);\n}\n\nexport function ObjectProperty(this: Printer, node: t.ObjectProperty) {\n this.printJoin(node.decorators);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key);\n this.token(\"]\");\n } else {\n // print `({ foo: foo = 5 } = {})` as `({ foo = 5 } = {});`\n if (\n isAssignmentPattern(node.value) &&\n isIdentifier(node.key) &&\n // @ts-expect-error todo(flow->ts) `.name` does not exist on some types in union\n node.key.name === node.value.left.name\n ) {\n this.print(node.value);\n return;\n }\n\n this.print(node.key);\n\n // shorthand!\n if (\n node.shorthand &&\n isIdentifier(node.key) &&\n isIdentifier(node.value) &&\n node.key.name === node.value.name\n ) {\n return;\n }\n }\n\n this.token(\":\");\n this.space();\n this.print(node.value);\n}\n\nexport function ArrayExpression(this: Printer, node: t.ArrayExpression) {\n const elems = node.elements;\n const len = elems.length;\n\n this.token(\"[\");\n\n const exit = this.enterDelimited();\n\n for (let i = 0; i < elems.length; i++) {\n const elem = elems[i];\n if (elem) {\n if (i > 0) this.space();\n this.print(elem);\n if (i < len - 1 || this.shouldPrintTrailingComma(\"]\")) {\n this.token(\",\", false, i);\n }\n } else {\n // If the array expression ends with a hole, that hole\n // will be ignored by the interpreter, but if it ends with\n // two (or more) holes, we need to write out two (or more)\n // commas so that the resulting code is interpreted with\n // both (all) of the holes.\n this.token(\",\", false, i);\n }\n }\n\n exit();\n\n this.token(\"]\");\n}\n\nexport { ArrayExpression as ArrayPattern };\n\nexport function RecordExpression(this: Printer, node: t.RecordExpression) {\n const props = node.properties;\n\n let startToken;\n let endToken;\n if (process.env.BABEL_8_BREAKING) {\n startToken = \"#{\";\n endToken = \"}\";\n } else {\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"{|\";\n endToken = \"|}\";\n } else if (\n this.format.recordAndTupleSyntaxType !== \"hash\" &&\n this.format.recordAndTupleSyntaxType != null\n ) {\n throw new Error(\n `The \"recordAndTupleSyntaxType\" generator option must be \"bar\" or \"hash\" (${JSON.stringify(\n this.format.recordAndTupleSyntaxType,\n )} received).`,\n );\n } else {\n startToken = \"#{\";\n endToken = \"}\";\n }\n }\n\n this.token(startToken);\n\n if (props.length) {\n this.space();\n this.printList(props, this.shouldPrintTrailingComma(endToken), true, true);\n this.space();\n }\n this.token(endToken);\n}\n\nexport function TupleExpression(this: Printer, node: t.TupleExpression) {\n const elems = node.elements;\n const len = elems.length;\n\n let startToken;\n let endToken;\n if (process.env.BABEL_8_BREAKING) {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"[|\";\n endToken = \"|]\";\n } else if (this.format.recordAndTupleSyntaxType === \"hash\") {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n throw new Error(\n `${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`,\n );\n }\n }\n\n this.token(startToken);\n\n for (let i = 0; i < elems.length; i++) {\n const elem = elems[i];\n if (elem) {\n if (i > 0) this.space();\n this.print(elem);\n if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {\n this.token(\",\", false, i);\n }\n }\n }\n\n this.token(endToken);\n}\n\nexport function RegExpLiteral(this: Printer, node: t.RegExpLiteral) {\n this.word(`/${node.pattern}/${node.flags}`);\n}\n\nexport function BooleanLiteral(this: Printer, node: t.BooleanLiteral) {\n this.word(node.value ? \"true\" : \"false\");\n}\n\nexport function NullLiteral(this: Printer) {\n this.word(\"null\");\n}\n\nexport function NumericLiteral(this: Printer, node: t.NumericLiteral) {\n const raw = this.getPossibleRaw(node);\n const opts = this.format.jsescOption;\n const value = node.value;\n const str = value + \"\";\n if (opts.numbers) {\n this.number(jsesc(value, opts), value);\n } else if (raw == null) {\n this.number(str, value); // normalize\n } else if (this.format.minified) {\n this.number(raw.length < str.length ? raw : str, value);\n } else {\n this.number(raw, value);\n }\n}\n\nexport function StringLiteral(this: Printer, node: t.StringLiteral) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.token(raw);\n return;\n }\n\n const val = jsesc(node.value, this.format.jsescOption);\n\n this.token(val);\n}\n\nexport function BigIntLiteral(this: Printer, node: t.BigIntLiteral) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.word(raw);\n return;\n }\n this.word(node.value + \"n\");\n}\n\n// Hack pipe operator\nconst validTopicTokenSet = new Set([\n \"^^\",\n \"@@\",\n \"^\",\n \"%\",\n \"#\",\n]);\nexport function TopicReference(this: Printer) {\n const { topicToken } = this.format;\n\n if (validTopicTokenSet.has(topicToken)) {\n this.token(topicToken!);\n } else {\n const givenTopicTokenJSON = JSON.stringify(topicToken);\n const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v));\n throw new Error(\n `The \"topicToken\" generator option must be one of ` +\n `${validTopics.join(\", \")} (${givenTopicTokenJSON} received instead).`,\n );\n }\n}\n\n// Smart-mix pipe operator\nexport function PipelineTopicExpression(\n this: Printer,\n node: t.PipelineTopicExpression,\n) {\n this.print(node.expression);\n}\n\nexport function PipelineBareFunction(\n this: Printer,\n node: t.PipelineBareFunction,\n) {\n this.print(node.callee);\n}\n\nexport function PipelinePrimaryTopicReference(this: Printer) {\n this.token(\"#\");\n}\n\n// discard binding\nexport function VoidPattern(this: Printer) {\n this.word(\"void\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,EAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAA0B;EAFjBE,mBAAmB;EAAEC;AAAY,IAAAJ,EAAA;AAI1C,IAAIK,gBAAqC,GAAG,IAAI;AAChD,IAAIC,kBAA0B,GAAG,EAAE;AAC5B,SAASC,iBAAiBA,CAAgBC,IAAkB,EAAE;EACnE,IAAIA,IAAI,KAAKH,gBAAgB,EAAE,OAAOC,kBAAkB;EACxDD,gBAAgB,GAAGG,IAAI;EAEvB,MAAM;IAAEC;EAAK,CAAC,GAAGD,IAAI;EACrB,MAAME,KAAK,GAAG,IAAI,CAACC,QAAQ,CAAEC,IAAI,CAACJ,IAAI,EAAEK,GAAG,IAAIA,GAAG,CAACC,KAAK,KAAKL,IAAI,CAAC;EAClE,IAAIC,KAAK,EAAE;IACTJ,kBAAkB,GAAG,IAAI,CAACS,aAAa,CAAEC,KAAK,CAACN,KAAK,CAACO,KAAK,EAAEP,KAAK,CAACQ,GAAG,CAAC;IACtE,OAAOZ,kBAAkB;EAC3B;EACA,OAAQA,kBAAkB,GAAGE,IAAI,CAACC,IAAI;AACxC;AAEO,SAASU,UAAUA,CAAgBX,IAAkB,EAAE;EAAA,IAAAY,SAAA;EAC5D,IAAI,CAACC,oBAAoB,CAAC,EAAAD,SAAA,GAAAZ,IAAI,CAACc,GAAG,qBAARF,SAAA,CAAUG,cAAc,KAAIf,IAAI,CAACC,IAAI,CAAC;EAEhE,IAAI,CAACe,IAAI,CAAC,IAAI,CAACb,QAAQ,GAAG,IAAI,CAACJ,iBAAiB,CAACC,IAAI,CAAC,GAAGA,IAAI,CAACC,IAAI,CAAC;AACrE;AAEO,SAASgB,mBA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AAGO,SAASM,uBAAuBA,CAErCtF,IAA+B,EAC/B;EACA,IAAI,CAACmB,KAAK,CAACnB,IAAI,CAACuF,UAAU,CAAC;AAC7B;AAEO,SAASC,oBAAoBA,CAElCxF,IAA4B,EAC5B;EACA,IAAI,CAACmB,KAAK,CAACnB,IAAI,CAACyF,MAAM,CAAC;AACzB;AAEO,SAASC,6BAA6BA,CAAA,EAAgB;EAC3D,IAAI,CAACxF,SAAK,GAAI,CAAC;AACjB;AAGO,SAASyF,WAAWA,CAAA,EAAgB;EACzC,IAAI,CAAC3E,IAAI,CAAC,MAAM,CAAC;AACnB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/generators/typescript.js b/node_modules/@babel/generator/lib/generators/typescript.js new file mode 100644 index 0000000..ac27e97 --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/typescript.js @@ -0,0 +1,725 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TSAnyKeyword = TSAnyKeyword; +exports.TSArrayType = TSArrayType; +exports.TSSatisfiesExpression = exports.TSAsExpression = TSTypeExpression; +exports.TSBigIntKeyword = TSBigIntKeyword; +exports.TSBooleanKeyword = TSBooleanKeyword; +exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration; +exports.TSInterfaceHeritage = exports.TSClassImplements = TSClassImplements; +exports.TSConditionalType = TSConditionalType; +exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration; +exports.TSConstructorType = TSConstructorType; +exports.TSDeclareFunction = TSDeclareFunction; +exports.TSDeclareMethod = TSDeclareMethod; +exports.TSEnumBody = TSEnumBody; +exports.TSEnumDeclaration = TSEnumDeclaration; +exports.TSEnumMember = TSEnumMember; +exports.TSExportAssignment = TSExportAssignment; +exports.TSExternalModuleReference = TSExternalModuleReference; +exports.TSFunctionType = TSFunctionType; +exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration; +exports.TSImportType = TSImportType; +exports.TSIndexSignature = TSIndexSignature; +exports.TSIndexedAccessType = TSIndexedAccessType; +exports.TSInferType = TSInferType; +exports.TSInstantiationExpression = TSInstantiationExpression; +exports.TSInterfaceBody = TSInterfaceBody; +exports.TSInterfaceDeclaration = TSInterfaceDeclaration; +exports.TSIntersectionType = TSIntersectionType; +exports.TSIntrinsicKeyword = TSIntrinsicKeyword; +exports.TSLiteralType = TSLiteralType; +exports.TSMappedType = TSMappedType; +exports.TSMethodSignature = TSMethodSignature; +exports.TSModuleBlock = TSModuleBlock; +exports.TSModuleDeclaration = TSModuleDeclaration; +exports.TSNamedTupleMember = TSNamedTupleMember; +exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration; +exports.TSNeverKeyword = TSNeverKeyword; +exports.TSNonNullExpression = TSNonNullExpression; +exports.TSNullKeyword = TSNullKeyword; +exports.TSNumberKeyword = TSNumberKeyword; +exports.TSObjectKeyword = TSObjectKeyword; +exports.TSOptionalType = TSOptionalType; +exports.TSParameterProperty = TSParameterProperty; +exports.TSParenthesizedType = TSParenthesizedType; +exports.TSPropertySignature = TSPropertySignature; +exports.TSQualifiedName = TSQualifiedName; +exports.TSRestType = TSRestType; +exports.TSStringKeyword = TSStringKeyword; +exports.TSSymbolKeyword = TSSymbolKeyword; +exports.TSTemplateLiteralType = TSTemplateLiteralType; +exports.TSThisType = TSThisType; +exports.TSTupleType = TSTupleType; +exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration; +exports.TSTypeAnnotation = TSTypeAnnotation; +exports.TSTypeAssertion = TSTypeAssertion; +exports.TSTypeLiteral = TSTypeLiteral; +exports.TSTypeOperator = TSTypeOperator; +exports.TSTypeParameter = TSTypeParameter; +exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation; +exports.TSTypePredicate = TSTypePredicate; +exports.TSTypeQuery = TSTypeQuery; +exports.TSTypeReference = TSTypeReference; +exports.TSUndefinedKeyword = TSUndefinedKeyword; +exports.TSUnionType = TSUnionType; +exports.TSUnknownKeyword = TSUnknownKeyword; +exports.TSVoidKeyword = TSVoidKeyword; +exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers; +exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType; +exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName; +exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase; +function TSTypeAnnotation(node, parent) { + this.token((parent.type === "TSFunctionType" || parent.type === "TSConstructorType") && parent.typeAnnotation === node ? "=>" : ":"); + this.space(); + if (node.optional) this.tokenChar(63); + this.print(node.typeAnnotation); +} +function TSTypeParameterInstantiation(node, parent) { + this.tokenChar(60); + let printTrailingSeparator = parent.type === "ArrowFunctionExpression" && node.params.length === 1; + if (this.tokenMap && node.start != null && node.end != null) { + printTrailingSeparator && (printTrailingSeparator = !!this.tokenMap.find(node, t => this.tokenMap.matchesOriginal(t, ","))); + printTrailingSeparator || (printTrailingSeparator = this.shouldPrintTrailingComma(">")); + } + this.printList(node.params, printTrailingSeparator); + this.tokenChar(62); +} +function TSTypeParameter(node) { + if (node.const) { + this.word("const"); + this.space(); + } + if (node.in) { + this.word("in"); + this.space(); + } + if (node.out) { + this.word("out"); + this.space(); + } + this.word(node.name); + if (node.constraint) { + this.space(); + this.word("extends"); + this.space(); + this.print(node.constraint); + } + if (node.default) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.default); + } +} +function TSParameterProperty(node) { + if (node.accessibility) { + this.word(node.accessibility); + this.space(); + } + if (node.readonly) { + this.word("readonly"); + this.space(); + } + this._param(node.parameter); +} +function TSDeclareFunction(node, parent) { + if (node.declare) { + this.word("declare"); + this.space(); + } + this._functionHead(node, parent); + this.semicolon(); +} +function TSDeclareMethod(node) { + this._classMethodHead(node); + this.semicolon(); +} +function TSQualifiedName(node) { + this.print(node.left); + this.tokenChar(46); + this.print(node.right); +} +function TSCallSignatureDeclaration(node) { + this.tsPrintSignatureDeclarationBase(node); + maybePrintTrailingCommaOrSemicolon(this, node); +} +function maybePrintTrailingCommaOrSemicolon(printer, node) { + if (!printer.tokenMap || !node.start || !node.end) { + printer.semicolon(); + return; + } + if (printer.tokenMap.endMatches(node, ",")) { + printer.token(","); + } else if (printer.tokenMap.endMatches(node, ";")) { + printer.semicolon(); + } +} +function TSConstructSignatureDeclaration(node) { + this.word("new"); + this.space(); + this.tsPrintSignatureDeclarationBase(node); + maybePrintTrailingCommaOrSemicolon(this, node); +} +function TSPropertySignature(node) { + const { + readonly + } = node; + if (readonly) { + this.word("readonly"); + this.space(); + } + this.tsPrintPropertyOrMethodName(node); + this.print(node.typeAnnotation); + maybePrintTrailingCommaOrSemicolon(this, node); +} +function tsPrintPropertyOrMethodName(node) { + if (node.computed) { + this.tokenChar(91); + } + this.print(node.key); + if (node.computed) { + this.tokenChar(93); + } + if (node.optional) { + this.tokenChar(63); + } +} +function TSMethodSignature(node) { + const { + kind + } = node; + if (kind === "set" || kind === "get") { + this.word(kind); + this.space(); + } + this.tsPrintPropertyOrMethodName(node); + this.tsPrintSignatureDeclarationBase(node); + maybePrintTrailingCommaOrSemicolon(this, node); +} +function TSIndexSignature(node) { + const { + readonly, + static: isStatic + } = node; + if (isStatic) { + this.word("static"); + this.space(); + } + if (readonly) { + this.word("readonly"); + this.space(); + } + this.tokenChar(91); + this._parameters(node.parameters, "]"); + this.print(node.typeAnnotation); + maybePrintTrailingCommaOrSemicolon(this, node); +} +function TSAnyKeyword() { + this.word("any"); +} +function TSBigIntKeyword() { + this.word("bigint"); +} +function TSUnknownKeyword() { + this.word("unknown"); +} +function TSNumberKeyword() { + this.word("number"); +} +function TSObjectKeyword() { + this.word("object"); +} +function TSBooleanKeyword() { + this.word("boolean"); +} +function TSStringKeyword() { + this.word("string"); +} +function TSSymbolKeyword() { + this.word("symbol"); +} +function TSVoidKeyword() { + this.word("void"); +} +function TSUndefinedKeyword() { + this.word("undefined"); +} +function TSNullKeyword() { + this.word("null"); +} +function TSNeverKeyword() { + this.word("never"); +} +function TSIntrinsicKeyword() { + this.word("intrinsic"); +} +function TSThisType() { + this.word("this"); +} +function TSFunctionType(node) { + this.tsPrintFunctionOrConstructorType(node); +} +function TSConstructorType(node) { + if (node.abstract) { + this.word("abstract"); + this.space(); + } + this.word("new"); + this.space(); + this.tsPrintFunctionOrConstructorType(node); +} +function tsPrintFunctionOrConstructorType(node) { + const { + typeParameters + } = node; + const parameters = node.parameters; + this.print(typeParameters); + this.tokenChar(40); + this._parameters(parameters, ")"); + this.space(); + const returnType = node.typeAnnotation; + this.print(returnType); +} +function TSTypeReference(node) { + const typeArguments = node.typeParameters; + this.print(node.typeName, !!typeArguments); + this.print(typeArguments); +} +function TSTypePredicate(node) { + if (node.asserts) { + this.word("asserts"); + this.space(); + } + this.print(node.parameterName); + if (node.typeAnnotation) { + this.space(); + this.word("is"); + this.space(); + this.print(node.typeAnnotation.typeAnnotation); + } +} +function TSTypeQuery(node) { + this.word("typeof"); + this.space(); + this.print(node.exprName); + const typeArguments = node.typeParameters; + if (typeArguments) { + this.print(typeArguments); + } +} +function TSTypeLiteral(node) { + printBraced(this, node, () => this.printJoin(node.members, true, true)); +} +function TSArrayType(node) { + this.print(node.elementType, true); + this.tokenChar(91); + this.tokenChar(93); +} +function TSTupleType(node) { + this.tokenChar(91); + this.printList(node.elementTypes, this.shouldPrintTrailingComma("]")); + this.tokenChar(93); +} +function TSOptionalType(node) { + this.print(node.typeAnnotation); + this.tokenChar(63); +} +function TSRestType(node) { + this.token("..."); + this.print(node.typeAnnotation); +} +function TSNamedTupleMember(node) { + this.print(node.label); + if (node.optional) this.tokenChar(63); + this.tokenChar(58); + this.space(); + this.print(node.elementType); +} +function TSUnionType(node) { + tsPrintUnionOrIntersectionType(this, node, "|"); +} +function TSIntersectionType(node) { + tsPrintUnionOrIntersectionType(this, node, "&"); +} +function tsPrintUnionOrIntersectionType(printer, node, sep) { + var _printer$tokenMap; + let hasLeadingToken = 0; + if ((_printer$tokenMap = printer.tokenMap) != null && _printer$tokenMap.startMatches(node, sep)) { + hasLeadingToken = 1; + printer.token(sep); + } + printer.printJoin(node.types, undefined, undefined, function (i) { + this.space(); + this.token(sep, undefined, i + hasLeadingToken); + this.space(); + }); +} +function TSConditionalType(node) { + this.print(node.checkType); + this.space(); + this.word("extends"); + this.space(); + this.print(node.extendsType); + this.space(); + this.tokenChar(63); + this.space(); + this.print(node.trueType); + this.space(); + this.tokenChar(58); + this.space(); + this.print(node.falseType); +} +function TSInferType(node) { + this.word("infer"); + this.print(node.typeParameter); +} +function TSParenthesizedType(node) { + this.tokenChar(40); + this.print(node.typeAnnotation); + this.tokenChar(41); +} +function TSTypeOperator(node) { + this.word(node.operator); + this.space(); + this.print(node.typeAnnotation); +} +function TSIndexedAccessType(node) { + this.print(node.objectType, true); + this.tokenChar(91); + this.print(node.indexType); + this.tokenChar(93); +} +function TSMappedType(node) { + const { + nameType, + optional, + readonly, + typeAnnotation + } = node; + this.tokenChar(123); + const exit = this.enterDelimited(); + this.space(); + if (readonly) { + tokenIfPlusMinus(this, readonly); + this.word("readonly"); + this.space(); + } + this.tokenChar(91); + { + this.word(node.typeParameter.name); + } + this.space(); + this.word("in"); + this.space(); + { + this.print(node.typeParameter.constraint); + } + if (nameType) { + this.space(); + this.word("as"); + this.space(); + this.print(nameType); + } + this.tokenChar(93); + if (optional) { + tokenIfPlusMinus(this, optional); + this.tokenChar(63); + } + if (typeAnnotation) { + this.tokenChar(58); + this.space(); + this.print(typeAnnotation); + } + this.space(); + exit(); + this.tokenChar(125); +} +function tokenIfPlusMinus(self, tok) { + if (tok !== true) { + self.token(tok); + } +} +function TSTemplateLiteralType(node) { + this._printTemplate(node, node.types); +} +function TSLiteralType(node) { + this.print(node.literal); +} +function TSClassImplements(node) { + this.print(node.expression); + this.print(node.typeArguments); +} +function TSInterfaceDeclaration(node) { + const { + declare, + id, + typeParameters, + extends: extendz, + body + } = node; + if (declare) { + this.word("declare"); + this.space(); + } + this.word("interface"); + this.space(); + this.print(id); + this.print(typeParameters); + if (extendz != null && extendz.length) { + this.space(); + this.word("extends"); + this.space(); + this.printList(extendz); + } + this.space(); + this.print(body); +} +function TSInterfaceBody(node) { + printBraced(this, node, () => this.printJoin(node.body, true, true)); +} +function TSTypeAliasDeclaration(node) { + const { + declare, + id, + typeParameters, + typeAnnotation + } = node; + if (declare) { + this.word("declare"); + this.space(); + } + this.word("type"); + this.space(); + this.print(id); + this.print(typeParameters); + this.space(); + this.tokenChar(61); + this.space(); + this.print(typeAnnotation); + this.semicolon(); +} +function TSTypeExpression(node) { + const { + type, + expression, + typeAnnotation + } = node; + this.print(expression, true); + this.space(); + this.word(type === "TSAsExpression" ? "as" : "satisfies"); + this.space(); + this.print(typeAnnotation); +} +function TSTypeAssertion(node) { + const { + typeAnnotation, + expression + } = node; + this.tokenChar(60); + this.print(typeAnnotation); + this.tokenChar(62); + this.space(); + this.print(expression); +} +function TSInstantiationExpression(node) { + this.print(node.expression); + { + this.print(node.typeParameters); + } +} +function TSEnumDeclaration(node) { + const { + declare, + const: isConst, + id + } = node; + if (declare) { + this.word("declare"); + this.space(); + } + if (isConst) { + this.word("const"); + this.space(); + } + this.word("enum"); + this.space(); + this.print(id); + this.space(); + { + TSEnumBody.call(this, node); + } +} +function TSEnumBody(node) { + printBraced(this, node, () => { + var _this$shouldPrintTrai; + return this.printList(node.members, (_this$shouldPrintTrai = this.shouldPrintTrailingComma("}")) != null ? _this$shouldPrintTrai : true, true, true); + }); +} +function TSEnumMember(node) { + const { + id, + initializer + } = node; + this.print(id); + if (initializer) { + this.space(); + this.tokenChar(61); + this.space(); + this.print(initializer); + } +} +function TSModuleDeclaration(node) { + const { + declare, + id, + kind + } = node; + if (declare) { + this.word("declare"); + this.space(); + } + { + if (!node.global) { + this.word(kind != null ? kind : id.type === "Identifier" ? "namespace" : "module"); + this.space(); + } + this.print(id); + if (!node.body) { + this.semicolon(); + return; + } + let body = node.body; + while (body.type === "TSModuleDeclaration") { + this.tokenChar(46); + this.print(body.id); + body = body.body; + } + this.space(); + this.print(body); + } +} +function TSModuleBlock(node) { + printBraced(this, node, () => this.printSequence(node.body, true)); +} +function TSImportType(node) { + const { + argument, + qualifier, + options + } = node; + this.word("import"); + this.tokenChar(40); + this.print(argument); + if (options) { + this.tokenChar(44); + this.print(options); + } + this.tokenChar(41); + if (qualifier) { + this.tokenChar(46); + this.print(qualifier); + } + const typeArguments = node.typeParameters; + if (typeArguments) { + this.print(typeArguments); + } +} +function TSImportEqualsDeclaration(node) { + const { + id, + moduleReference + } = node; + if (node.isExport) { + this.word("export"); + this.space(); + } + this.word("import"); + this.space(); + this.print(id); + this.space(); + this.tokenChar(61); + this.space(); + this.print(moduleReference); + this.semicolon(); +} +function TSExternalModuleReference(node) { + this.token("require("); + this.print(node.expression); + this.tokenChar(41); +} +function TSNonNullExpression(node) { + this.print(node.expression); + this.tokenChar(33); +} +function TSExportAssignment(node) { + this.word("export"); + this.space(); + this.tokenChar(61); + this.space(); + this.print(node.expression); + this.semicolon(); +} +function TSNamespaceExportDeclaration(node) { + this.word("export"); + this.space(); + this.word("as"); + this.space(); + this.word("namespace"); + this.space(); + this.print(node.id); + this.semicolon(); +} +function tsPrintSignatureDeclarationBase(node) { + const { + typeParameters + } = node; + const parameters = node.parameters; + this.print(typeParameters); + this.tokenChar(40); + this._parameters(parameters, ")"); + const returnType = node.typeAnnotation; + this.print(returnType); +} +function tsPrintClassMemberModifiers(node) { + const isPrivateField = node.type === "ClassPrivateProperty"; + const isPublicField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty"; + printModifiersList(this, node, [isPublicField && node.declare && "declare", !isPrivateField && node.accessibility]); + if (node.static) { + this.word("static"); + this.space(); + } + printModifiersList(this, node, [!isPrivateField && node.abstract && "abstract", !isPrivateField && node.override && "override", (isPublicField || isPrivateField) && node.readonly && "readonly"]); +} +function printBraced(printer, node, cb) { + printer.token("{"); + const exit = printer.enterDelimited(); + cb(); + exit(); + printer.rightBrace(node); +} +function printModifiersList(printer, node, modifiers) { + var _printer$tokenMap2; + const modifiersSet = new Set(); + for (const modifier of modifiers) { + if (modifier) modifiersSet.add(modifier); + } + (_printer$tokenMap2 = printer.tokenMap) == null || _printer$tokenMap2.find(node, tok => { + if (modifiersSet.has(tok.value)) { + printer.token(tok.value); + printer.space(); + modifiersSet.delete(tok.value); + return modifiersSet.size === 0; + } + return false; + }); + for (const modifier of modifiersSet) { + printer.word(modifier); + printer.space(); + } +} + +//# sourceMappingURL=typescript.js.map diff --git a/node_modules/@babel/generator/lib/generators/typescript.js.map b/node_modules/@babel/generator/lib/generators/typescript.js.map new file mode 100644 index 0000000..77f136c --- /dev/null +++ b/node_modules/@babel/generator/lib/generators/typescript.js.map @@ -0,0 +1 @@ +{"version":3,"names":["TSTypeAnnotation","node","parent","token","type","typeAnnotation","space","optional","print","TSTypeParameterInstantiation","printTrailingSeparator","params","length","tokenMap","start","end","find","t","matchesOriginal","shouldPrintTrailingComma","printList","TSTypeParameter","const","word","in","out","name","constraint","default","TSParameterProperty","accessibility","readonly","_param","parameter","TSDeclareFunction","declare","_functionHead","semicolon","TSDeclareMethod","_classMethodHead","TSQualifiedName","left","right","TSCallSignatureDeclaration","tsPrintSignatureDeclarationBase","maybePrintTrailingCommaOrSemicolon","printer","endMatches","TSConstructSignatureDeclaration","TSPropertySignature","tsPrintPropertyOrMethodName","computed","key","TSMethodSignature","kind","TSIndexSignature","static","isStatic","_parameters","parameters","TSAnyKeyword","TSBigIntKeyword","TSUnknownKeyword","TSNumberKeyword","TSObjectKeyword","TSBooleanKeyword","TSStringKeyword","TSSymbolKeyword","TSVoidKeyword","TSUndefinedKeyword","TSNullKeyword","TSNeverKeyword","TSIntrinsicKeyword","TSThisType","TSFunctionType","tsPrintFunctionOrConstructorType","TSConstructorType","abstract","typeParameters","returnType","TSTypeReference","typeArguments","typeName","TSTypePredicate","asserts","parameterName","TSTypeQuery","exprName","TSTypeLiteral","printBraced","printJoin","members","TSArrayType","elementType","TSTupleType","elementTypes","TSOptionalType","TSRestType","TSNamedTupleMember","label","TSUnionType","tsPrintUnionOrIntersectionType","TSIntersectionType","sep","_printer$tokenMap","hasLeadingToken","startMatches","types","undefined","i","TSConditionalType","checkType","extendsType","trueType","falseType","TSInferType","typeParameter","TSParenthesizedType","TSTypeOperator","operator","TSIndexedAccessType","objectType","indexType","TSMappedType","nameType","exit","enterDelimited","tokenIfPlusMinus","self","tok","TSTemplateLiteralType","_printTemplate","TSLiteralType","literal","TSClassImplements","expression","TSInterfaceDeclaration","id","extends","extendz","body","TSInterfaceBody","TSTypeAliasDeclaration","TSTypeExpression","TSTypeAssertion","TSInstantiationExpression","TSEnumDeclaration","isConst","TSEnumBody","call","_this$shouldPrintTrai","TSEnumMember","initializer","TSModuleDeclaration","global","TSModuleBlock","printSequence","TSImportType","argument","qualifier","options","TSImportEqualsDeclaration","moduleReference","isExport","TSExternalModuleReference","TSNonNullExpression","TSExportAssignment","TSNamespaceExportDeclaration","tsPrintClassMemberModifiers","isPrivateField","isPublicField","printModifiersList","override","cb","rightBrace","modifiers","_printer$tokenMap2","modifiersSet","Set","modifier","add","has","value","delete","size"],"sources":["../../src/generators/typescript.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport type * as t from \"@babel/types\";\n\nexport function TSTypeAnnotation(\n this: Printer,\n node: t.TSTypeAnnotation,\n parent: t.Node,\n) {\n // TODO(@nicolo-ribaudo): investigate not including => in the range\n // of the return type of an arrow function type\n this.token(\n (parent.type === \"TSFunctionType\" || parent.type === \"TSConstructorType\") &&\n (process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n parent.returnType\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n parent.typeAnnotation) === node\n ? \"=>\"\n : \":\",\n );\n this.space();\n // @ts-expect-error todo(flow->ts) can this be removed? `.optional` looks to be not existing property\n if (node.optional) this.token(\"?\");\n this.print(node.typeAnnotation);\n}\n\nexport function TSTypeParameterInstantiation(\n this: Printer,\n node: t.TSTypeParameterInstantiation,\n parent: t.Node,\n): void {\n this.token(\"<\");\n\n let printTrailingSeparator: boolean | null =\n parent.type === \"ArrowFunctionExpression\" && node.params.length === 1;\n if (this.tokenMap && node.start != null && node.end != null) {\n // Only force the trailing comma for pre-existing nodes if they\n // already had a comma (either because they were multi-param, or\n // because they had a trailing comma)\n printTrailingSeparator &&= !!this.tokenMap.find(node, t =>\n this.tokenMap!.matchesOriginal(t, \",\"),\n );\n // Preserve the trailing comma if it was there before\n printTrailingSeparator ||= this.shouldPrintTrailingComma(\">\");\n }\n\n this.printList(node.params, printTrailingSeparator);\n this.token(\">\");\n}\n\nexport { TSTypeParameterInstantiation as TSTypeParameterDeclaration };\n\nexport function TSTypeParameter(this: Printer, node: t.TSTypeParameter) {\n if (node.const) {\n this.word(\"const\");\n this.space();\n }\n\n if (node.in) {\n this.word(\"in\");\n this.space();\n }\n\n if (node.out) {\n this.word(\"out\");\n this.space();\n }\n\n this.word(\n !process.env.BABEL_8_BREAKING\n ? (node.name as unknown as string)\n : (node.name as unknown as t.Identifier).name,\n );\n\n if (node.constraint) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.constraint);\n }\n\n if (node.default) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.default);\n }\n}\n\nexport function TSParameterProperty(\n this: Printer,\n node: t.TSParameterProperty,\n) {\n if (node.accessibility) {\n this.word(node.accessibility);\n this.space();\n }\n\n if (node.readonly) {\n this.word(\"readonly\");\n this.space();\n }\n\n this._param(node.parameter);\n}\n\nexport function TSDeclareFunction(\n this: Printer,\n node: t.TSDeclareFunction,\n parent: t.ParentMaps[\"TSDeclareFunction\"],\n) {\n if (node.declare) {\n this.word(\"declare\");\n this.space();\n }\n this._functionHead(node, parent);\n this.semicolon();\n}\n\nexport function TSDeclareMethod(this: Printer, node: t.TSDeclareMethod) {\n this._classMethodHead(node);\n this.semicolon();\n}\n\nexport function TSQualifiedName(this: Printer, node: t.TSQualifiedName) {\n this.print(node.left);\n this.token(\".\");\n this.print(node.right);\n}\n\nexport function TSCallSignatureDeclaration(\n this: Printer,\n node: t.TSCallSignatureDeclaration,\n) {\n this.tsPrintSignatureDeclarationBase(node);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nfunction maybePrintTrailingCommaOrSemicolon(printer: Printer, node: t.Node) {\n if (!printer.tokenMap || !node.start || !node.end) {\n printer.semicolon();\n return;\n }\n\n if (printer.tokenMap.endMatches(node, \",\")) {\n printer.token(\",\");\n } else if (printer.tokenMap.endMatches(node, \";\")) {\n printer.semicolon();\n }\n}\n\nexport function TSConstructSignatureDeclaration(\n this: Printer,\n node: t.TSConstructSignatureDeclaration,\n) {\n this.word(\"new\");\n this.space();\n this.tsPrintSignatureDeclarationBase(node);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function TSPropertySignature(\n this: Printer,\n node: t.TSPropertySignature,\n) {\n const { readonly } = node;\n if (readonly) {\n this.word(\"readonly\");\n this.space();\n }\n this.tsPrintPropertyOrMethodName(node);\n this.print(node.typeAnnotation);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function tsPrintPropertyOrMethodName(\n this: Printer,\n node: t.TSPropertySignature | t.TSMethodSignature,\n) {\n if (node.computed) {\n this.token(\"[\");\n }\n this.print(node.key);\n if (node.computed) {\n this.token(\"]\");\n }\n if (node.optional) {\n this.token(\"?\");\n }\n}\n\nexport function TSMethodSignature(this: Printer, node: t.TSMethodSignature) {\n const { kind } = node;\n if (kind === \"set\" || kind === \"get\") {\n this.word(kind);\n this.space();\n }\n this.tsPrintPropertyOrMethodName(node);\n this.tsPrintSignatureDeclarationBase(node);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function TSIndexSignature(this: Printer, node: t.TSIndexSignature) {\n const { readonly, static: isStatic } = node;\n if (isStatic) {\n this.word(\"static\");\n this.space();\n }\n if (readonly) {\n this.word(\"readonly\");\n this.space();\n }\n this.token(\"[\");\n this._parameters(node.parameters, \"]\");\n this.print(node.typeAnnotation);\n maybePrintTrailingCommaOrSemicolon(this, node);\n}\n\nexport function TSAnyKeyword(this: Printer) {\n this.word(\"any\");\n}\nexport function TSBigIntKeyword(this: Printer) {\n this.word(\"bigint\");\n}\nexport function TSUnknownKeyword(this: Printer) {\n this.word(\"unknown\");\n}\nexport function TSNumberKeyword(this: Printer) {\n this.word(\"number\");\n}\nexport function TSObjectKeyword(this: Printer) {\n this.word(\"object\");\n}\nexport function TSBooleanKeyword(this: Printer) {\n this.word(\"boolean\");\n}\nexport function TSStringKeyword(this: Printer) {\n this.word(\"string\");\n}\nexport function TSSymbolKeyword(this: Printer) {\n this.word(\"symbol\");\n}\nexport function TSVoidKeyword(this: Printer) {\n this.word(\"void\");\n}\nexport function TSUndefinedKeyword(this: Printer) {\n this.word(\"undefined\");\n}\nexport function TSNullKeyword(this: Printer) {\n this.word(\"null\");\n}\nexport function TSNeverKeyword(this: Printer) {\n this.word(\"never\");\n}\nexport function TSIntrinsicKeyword(this: Printer) {\n this.word(\"intrinsic\");\n}\n\nexport function TSThisType(this: Printer) {\n this.word(\"this\");\n}\n\nexport function TSFunctionType(this: Printer, node: t.TSFunctionType) {\n this.tsPrintFunctionOrConstructorType(node);\n}\n\nexport function TSConstructorType(this: Printer, node: t.TSConstructorType) {\n if (node.abstract) {\n this.word(\"abstract\");\n this.space();\n }\n this.word(\"new\");\n this.space();\n this.tsPrintFunctionOrConstructorType(node);\n}\n\nexport function tsPrintFunctionOrConstructorType(\n this: Printer,\n node: t.TSFunctionType | t.TSConstructorType,\n) {\n const { typeParameters } = node;\n const parameters = process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n node.params\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n node.parameters;\n this.print(typeParameters);\n this.token(\"(\");\n this._parameters(parameters, \")\");\n this.space();\n const returnType = process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n node.returnType\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n node.typeAnnotation;\n this.print(returnType);\n}\n\nexport function TSTypeReference(this: Printer, node: t.TSTypeReference) {\n const typeArguments = process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n node.typeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n node.typeParameters;\n this.print(node.typeName, !!typeArguments);\n this.print(typeArguments);\n}\n\nexport function TSTypePredicate(this: Printer, node: t.TSTypePredicate) {\n if (node.asserts) {\n this.word(\"asserts\");\n this.space();\n }\n this.print(node.parameterName);\n if (node.typeAnnotation) {\n this.space();\n this.word(\"is\");\n this.space();\n this.print(node.typeAnnotation.typeAnnotation);\n }\n}\n\nexport function TSTypeQuery(this: Printer, node: t.TSTypeQuery) {\n this.word(\"typeof\");\n this.space();\n this.print(node.exprName);\n\n const typeArguments = process.env.BABEL_8_BREAKING\n ? //@ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n node.typeArguments\n : //@ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node.typeParameters;\n if (typeArguments) {\n this.print(typeArguments);\n }\n}\n\nexport function TSTypeLiteral(this: Printer, node: t.TSTypeLiteral) {\n printBraced(this, node, () => this.printJoin(node.members, true, true));\n}\n\nexport function TSArrayType(this: Printer, node: t.TSArrayType) {\n this.print(node.elementType, true);\n\n this.token(\"[\");\n this.token(\"]\");\n}\n\nexport function TSTupleType(this: Printer, node: t.TSTupleType) {\n this.token(\"[\");\n this.printList(node.elementTypes, this.shouldPrintTrailingComma(\"]\"));\n this.token(\"]\");\n}\n\nexport function TSOptionalType(this: Printer, node: t.TSOptionalType) {\n this.print(node.typeAnnotation);\n this.token(\"?\");\n}\n\nexport function TSRestType(this: Printer, node: t.TSRestType) {\n this.token(\"...\");\n this.print(node.typeAnnotation);\n}\n\nexport function TSNamedTupleMember(this: Printer, node: t.TSNamedTupleMember) {\n this.print(node.label);\n if (node.optional) this.token(\"?\");\n this.token(\":\");\n this.space();\n this.print(node.elementType);\n}\n\nexport function TSUnionType(this: Printer, node: t.TSUnionType) {\n tsPrintUnionOrIntersectionType(this, node, \"|\");\n}\n\nexport function TSIntersectionType(this: Printer, node: t.TSIntersectionType) {\n tsPrintUnionOrIntersectionType(this, node, \"&\");\n}\n\nfunction tsPrintUnionOrIntersectionType(\n printer: Printer,\n node: t.TSUnionType | t.TSIntersectionType,\n sep: \"|\" | \"&\",\n) {\n let hasLeadingToken = 0;\n if (printer.tokenMap?.startMatches(node, sep)) {\n hasLeadingToken = 1;\n printer.token(sep);\n }\n\n printer.printJoin(node.types, undefined, undefined, function (i) {\n this.space();\n this.token(sep, undefined, i + hasLeadingToken);\n this.space();\n });\n}\n\nexport function TSConditionalType(this: Printer, node: t.TSConditionalType) {\n this.print(node.checkType);\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.extendsType);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.trueType);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.falseType);\n}\n\nexport function TSInferType(this: Printer, node: t.TSInferType) {\n this.word(\"infer\");\n this.print(node.typeParameter);\n}\n\nexport function TSParenthesizedType(\n this: Printer,\n node: t.TSParenthesizedType,\n) {\n this.token(\"(\");\n this.print(node.typeAnnotation);\n this.token(\")\");\n}\n\nexport function TSTypeOperator(this: Printer, node: t.TSTypeOperator) {\n this.word(node.operator);\n this.space();\n this.print(node.typeAnnotation);\n}\n\nexport function TSIndexedAccessType(\n this: Printer,\n node: t.TSIndexedAccessType,\n) {\n this.print(node.objectType, true);\n this.token(\"[\");\n this.print(node.indexType);\n this.token(\"]\");\n}\n\nexport function TSMappedType(this: Printer, node: t.TSMappedType) {\n const { nameType, optional, readonly, typeAnnotation } = node;\n this.token(\"{\");\n const exit = this.enterDelimited();\n this.space();\n if (readonly) {\n tokenIfPlusMinus(this, readonly);\n this.word(\"readonly\");\n this.space();\n }\n\n this.token(\"[\");\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n this.word(node.key.name);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n this.word(node.typeParameter.name);\n }\n\n this.space();\n this.word(\"in\");\n this.space();\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST shape\n this.print(node.constraint);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n this.print(node.typeParameter.constraint);\n }\n\n if (nameType) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(nameType);\n }\n\n this.token(\"]\");\n\n if (optional) {\n tokenIfPlusMinus(this, optional);\n this.token(\"?\");\n }\n\n if (typeAnnotation) {\n this.token(\":\");\n this.space();\n this.print(typeAnnotation);\n }\n this.space();\n exit();\n this.token(\"}\");\n}\n\nfunction tokenIfPlusMinus(self: Printer, tok: true | \"+\" | \"-\") {\n if (tok !== true) {\n self.token(tok);\n }\n}\n\nexport function TSTemplateLiteralType(\n this: Printer,\n node: t.TSTemplateLiteralType,\n) {\n this._printTemplate(node, node.types);\n}\n\nexport function TSLiteralType(this: Printer, node: t.TSLiteralType) {\n this.print(node.literal);\n}\n\nexport function TSClassImplements(\n this: Printer,\n // TODO(Babel 8): Just use t.TSClassImplements\n node: t.Node & {\n expression: t.TSEntityName;\n typeArguments?: t.TSTypeParameterInstantiation;\n },\n) {\n this.print(node.expression);\n this.print(node.typeArguments);\n}\n\nexport { TSClassImplements as TSInterfaceHeritage };\n\nexport function TSInterfaceDeclaration(\n this: Printer,\n node: t.TSInterfaceDeclaration,\n) {\n const { declare, id, typeParameters, extends: extendz, body } = node;\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"interface\");\n this.space();\n this.print(id);\n this.print(typeParameters);\n if (extendz?.length) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.printList(extendz);\n }\n this.space();\n this.print(body);\n}\n\nexport function TSInterfaceBody(this: Printer, node: t.TSInterfaceBody) {\n printBraced(this, node, () => this.printJoin(node.body, true, true));\n}\n\nexport function TSTypeAliasDeclaration(\n this: Printer,\n node: t.TSTypeAliasDeclaration,\n) {\n const { declare, id, typeParameters, typeAnnotation } = node;\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n this.word(\"type\");\n this.space();\n this.print(id);\n this.print(typeParameters);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(typeAnnotation);\n this.semicolon();\n}\n\nfunction TSTypeExpression(\n this: Printer,\n node: t.TSAsExpression | t.TSSatisfiesExpression,\n) {\n const { type, expression, typeAnnotation } = node;\n this.print(expression, true);\n this.space();\n this.word(type === \"TSAsExpression\" ? \"as\" : \"satisfies\");\n this.space();\n this.print(typeAnnotation);\n}\n\nexport {\n TSTypeExpression as TSAsExpression,\n TSTypeExpression as TSSatisfiesExpression,\n};\n\nexport function TSTypeAssertion(this: Printer, node: t.TSTypeAssertion) {\n const { typeAnnotation, expression } = node;\n this.token(\"<\");\n this.print(typeAnnotation);\n this.token(\">\");\n this.space();\n this.print(expression);\n}\n\nexport function TSInstantiationExpression(\n this: Printer,\n node: t.TSInstantiationExpression,\n) {\n this.print(node.expression);\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n this.print(node.typeArguments);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n this.print(node.typeParameters);\n }\n}\n\nexport function TSEnumDeclaration(this: Printer, node: t.TSEnumDeclaration) {\n const { declare, const: isConst, id } = node;\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n if (isConst) {\n this.word(\"const\");\n this.space();\n }\n this.word(\"enum\");\n this.space();\n this.print(id);\n this.space();\n\n if (process.env.BABEL_8_BREAKING) {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n this.print(node.body);\n } else {\n // cast to TSEnumBody for Babel 7 AST\n TSEnumBody.call(this, node as unknown as t.TSEnumBody);\n }\n}\n\nexport function TSEnumBody(this: Printer, node: t.TSEnumBody) {\n printBraced(this, node, () =>\n this.printList(\n node.members,\n this.shouldPrintTrailingComma(\"}\") ??\n (process.env.BABEL_8_BREAKING ? false : true),\n true,\n true,\n ),\n );\n}\n\nexport function TSEnumMember(this: Printer, node: t.TSEnumMember) {\n const { id, initializer } = node;\n this.print(id);\n if (initializer) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(initializer);\n }\n}\n\nexport function TSModuleDeclaration(\n this: Printer,\n node: t.TSModuleDeclaration,\n) {\n const { declare, id, kind } = node;\n\n if (declare) {\n this.word(\"declare\");\n this.space();\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (kind !== \"global\") {\n this.word(kind);\n this.space();\n }\n\n this.print(node.id);\n if (!node.body) {\n this.semicolon();\n return;\n }\n this.space();\n this.print(node.body);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n if (!node.global) {\n this.word(kind ?? (id.type === \"Identifier\" ? \"namespace\" : \"module\"));\n this.space();\n }\n\n this.print(id);\n\n if (!node.body) {\n this.semicolon();\n return;\n }\n\n let body = node.body;\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n while (body.type === \"TSModuleDeclaration\") {\n this.token(\".\");\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n this.print(body.id);\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST shape\n body = body.body;\n }\n\n this.space();\n this.print(body);\n }\n}\n\nexport function TSModuleBlock(this: Printer, node: t.TSModuleBlock) {\n printBraced(this, node, () => this.printSequence(node.body, true));\n}\n\nexport function TSImportType(this: Printer, node: t.TSImportType) {\n const { argument, qualifier, options } = node;\n this.word(\"import\");\n this.token(\"(\");\n this.print(argument);\n if (options) {\n this.token(\",\");\n this.print(options);\n }\n this.token(\")\");\n if (qualifier) {\n this.token(\".\");\n this.print(qualifier);\n }\n const typeArguments = process.env.BABEL_8_BREAKING\n ? //@ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n node.typeArguments\n : //@ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node.typeParameters;\n if (typeArguments) {\n this.print(typeArguments);\n }\n}\n\nexport function TSImportEqualsDeclaration(\n this: Printer,\n node: t.TSImportEqualsDeclaration,\n) {\n const { id, moduleReference } = node;\n if (\n !process.env.BABEL_8_BREAKING &&\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node.isExport\n ) {\n this.word(\"export\");\n this.space();\n }\n this.word(\"import\");\n this.space();\n this.print(id);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(moduleReference);\n this.semicolon();\n}\n\nexport function TSExternalModuleReference(\n this: Printer,\n node: t.TSExternalModuleReference,\n) {\n this.token(\"require(\");\n this.print(node.expression);\n this.token(\")\");\n}\n\nexport function TSNonNullExpression(\n this: Printer,\n node: t.TSNonNullExpression,\n) {\n this.print(node.expression);\n this.token(\"!\");\n}\n\nexport function TSExportAssignment(this: Printer, node: t.TSExportAssignment) {\n this.word(\"export\");\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.expression);\n this.semicolon();\n}\n\nexport function TSNamespaceExportDeclaration(\n this: Printer,\n node: t.TSNamespaceExportDeclaration,\n) {\n this.word(\"export\");\n this.space();\n this.word(\"as\");\n this.space();\n this.word(\"namespace\");\n this.space();\n this.print(node.id);\n this.semicolon();\n}\n\nexport function tsPrintSignatureDeclarationBase(this: Printer, node: any) {\n const { typeParameters } = node;\n const parameters = process.env.BABEL_8_BREAKING\n ? node.params\n : node.parameters;\n this.print(typeParameters);\n this.token(\"(\");\n this._parameters(parameters, \")\");\n const returnType = process.env.BABEL_8_BREAKING\n ? node.returnType\n : node.typeAnnotation;\n this.print(returnType);\n}\n\nexport function tsPrintClassMemberModifiers(\n this: Printer,\n node:\n | t.ClassProperty\n | t.ClassAccessorProperty\n | t.ClassPrivateProperty\n | t.ClassMethod\n | t.ClassPrivateMethod\n | t.TSDeclareMethod,\n) {\n const isPrivateField = node.type === \"ClassPrivateProperty\";\n const isPublicField =\n node.type === \"ClassAccessorProperty\" || node.type === \"ClassProperty\";\n printModifiersList(this, node, [\n isPublicField && node.declare && \"declare\",\n !isPrivateField && node.accessibility,\n ]);\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n printModifiersList(this, node, [\n !isPrivateField && node.abstract && \"abstract\",\n !isPrivateField && node.override && \"override\",\n (isPublicField || isPrivateField) && node.readonly && \"readonly\",\n ]);\n}\n\nfunction printBraced(printer: Printer, node: t.Node, cb: () => void) {\n printer.token(\"{\");\n const exit = printer.enterDelimited();\n cb();\n exit();\n printer.rightBrace(node);\n}\n\nfunction printModifiersList(\n printer: Printer,\n node: t.Node,\n modifiers: (string | false | null | undefined)[],\n) {\n const modifiersSet = new Set();\n for (const modifier of modifiers) {\n if (modifier) modifiersSet.add(modifier);\n }\n\n printer.tokenMap?.find(node, tok => {\n if (modifiersSet.has(tok.value)) {\n printer.token(tok.value);\n printer.space();\n modifiersSet.delete(tok.value);\n return modifiersSet.size === 0;\n }\n return false;\n });\n\n for (const modifier of modifiersSet) {\n printer.word(modifier);\n printer.space();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAASA,gBAAgBA,CAE9BC,IAAwB,EACxBC,MAAc,EACd;EAGA,IAAI,CAACC,KAAK,CACR,CAACD,MAAM,CAACE,IAAI,KAAK,gBAAgB,IAAIF,MAAM,CAACE,IAAI,KAAK,mBAAmB,KAKlEF,MAAM,CAACG,cAAc,KAAMJ,IAAI,GACjC,IAAI,GACJ,GACN,CAAC;EACD,IAAI,CAACK,KAAK,CAAC,CAAC;EAEZ,IAAIL,IAAI,CAACM,QAAQ,EAAE,IAAI,CAACJ,SAAK,GAAI,CAAC;EAClC,IAAI,CAACK,KAAK,CAACP,IAAI,CAACI,cAAc,CAAC;AACjC;AAEO,SAASI,4BAA4BA,CAE1CR,IAAoC,EACpCC,MAAc,EACR;EACN,IAAI,CAACC,SAAK,GAAI,CAAC;EAEf,IAA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D,KAAK,CAAC,EAAE;MAC/BxI,OAAO,CAAC3C,KAAK,CAAC8H,GAAG,CAACqD,KAAK,CAAC;MACxBxI,OAAO,CAACxC,KAAK,CAAC,CAAC;MACf2K,YAAY,CAACM,MAAM,CAACtD,GAAG,CAACqD,KAAK,CAAC;MAC9B,OAAOL,YAAY,CAACO,IAAI,KAAK,CAAC;IAChC;IACA,OAAO,KAAK;EACd,CAAC,CAAC;EAEF,KAAK,MAAML,QAAQ,IAAIF,YAAY,EAAE;IACnCnI,OAAO,CAACvB,IAAI,CAAC4J,QAAQ,CAAC;IACtBrI,OAAO,CAACxC,KAAK,CAAC,CAAC;EACjB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/index.js b/node_modules/@babel/generator/lib/index.js new file mode 100644 index 0000000..2e32510 --- /dev/null +++ b/node_modules/@babel/generator/lib/index.js @@ -0,0 +1,112 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +exports.generate = generate; +var _sourceMap = require("./source-map.js"); +var _printer = require("./printer.js"); +function normalizeOptions(code, opts, ast) { + if (opts.experimental_preserveFormat) { + if (typeof code !== "string") { + throw new Error("`experimental_preserveFormat` requires the original `code` to be passed to @babel/generator as a string"); + } + if (!opts.retainLines) { + throw new Error("`experimental_preserveFormat` requires `retainLines` to be set to `true`"); + } + if (opts.compact && opts.compact !== "auto") { + throw new Error("`experimental_preserveFormat` is not compatible with the `compact` option"); + } + if (opts.minified) { + throw new Error("`experimental_preserveFormat` is not compatible with the `minified` option"); + } + if (opts.jsescOption) { + throw new Error("`experimental_preserveFormat` is not compatible with the `jsescOption` option"); + } + if (!Array.isArray(ast.tokens)) { + throw new Error("`experimental_preserveFormat` requires the AST to have attached the token of the input code. Make sure to enable the `tokens: true` parser option."); + } + } + const format = { + auxiliaryCommentBefore: opts.auxiliaryCommentBefore, + auxiliaryCommentAfter: opts.auxiliaryCommentAfter, + shouldPrintComment: opts.shouldPrintComment, + preserveFormat: opts.experimental_preserveFormat, + retainLines: opts.retainLines, + retainFunctionParens: opts.retainFunctionParens, + comments: opts.comments == null || opts.comments, + compact: opts.compact, + minified: opts.minified, + concise: opts.concise, + indent: { + adjustMultilineComment: true, + style: " " + }, + jsescOption: Object.assign({ + quotes: "double", + wrap: true, + minimal: false + }, opts.jsescOption), + topicToken: opts.topicToken, + importAttributesKeyword: opts.importAttributesKeyword + }; + { + var _opts$recordAndTupleS; + format.decoratorsBeforeExport = opts.decoratorsBeforeExport; + format.jsescOption.json = opts.jsonCompatibleStrings; + format.recordAndTupleSyntaxType = (_opts$recordAndTupleS = opts.recordAndTupleSyntaxType) != null ? _opts$recordAndTupleS : "hash"; + } + if (format.minified) { + format.compact = true; + format.shouldPrintComment = format.shouldPrintComment || (() => format.comments); + } else { + format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.includes("@license") || value.includes("@preserve")); + } + if (format.compact === "auto") { + format.compact = typeof code === "string" && code.length > 500000; + if (format.compact) { + console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`); + } + } + if (format.compact || format.preserveFormat) { + format.indent.adjustMultilineComment = false; + } + const { + auxiliaryCommentBefore, + auxiliaryCommentAfter, + shouldPrintComment + } = format; + if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) { + format.auxiliaryCommentBefore = undefined; + } + if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) { + format.auxiliaryCommentAfter = undefined; + } + return format; +} +{ + exports.CodeGenerator = class CodeGenerator { + constructor(ast, opts = {}, code) { + this._ast = void 0; + this._format = void 0; + this._map = void 0; + this._ast = ast; + this._format = normalizeOptions(code, opts, ast); + this._map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; + } + generate() { + const printer = new _printer.default(this._format, this._map); + return printer.generate(this._ast); + } + }; +} +function generate(ast, opts = {}, code) { + const format = normalizeOptions(code, opts, ast); + const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; + const printer = new _printer.default(format, map, ast.tokens, typeof code === "string" ? code : null); + return printer.generate(ast); +} +var _default = exports.default = generate; + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/generator/lib/index.js.map b/node_modules/@babel/generator/lib/index.js.map new file mode 100644 index 0000000..ee70c39 --- /dev/null +++ b/node_modules/@babel/generator/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_sourceMap","require","_printer","normalizeOptions","code","opts","ast","experimental_preserveFormat","Error","retainLines","compact","minified","jsescOption","Array","isArray","tokens","format","auxiliaryCommentBefore","auxiliaryCommentAfter","shouldPrintComment","preserveFormat","retainFunctionParens","comments","concise","indent","adjustMultilineComment","style","Object","assign","quotes","wrap","minimal","topicToken","importAttributesKeyword","_opts$recordAndTupleS","decoratorsBeforeExport","json","jsonCompatibleStrings","recordAndTupleSyntaxType","value","includes","length","console","error","filename","undefined","exports","CodeGenerator","constructor","_ast","_format","_map","sourceMaps","SourceMap","generate","printer","Printer","map","_default","default"],"sources":["../src/index.ts"],"sourcesContent":["import SourceMap from \"./source-map.ts\";\nimport Printer from \"./printer.ts\";\nimport type * as t from \"@babel/types\";\nimport type { Opts as jsescOptions } from \"jsesc\";\nimport type { Format } from \"./printer.ts\";\nimport type {\n EncodedSourceMap,\n DecodedSourceMap,\n Mapping,\n} from \"@jridgewell/gen-mapping\";\n\n/**\n * Normalize generator options, setting defaults.\n *\n * - Detects code indentation.\n * - If `opts.compact = \"auto\"` and the code is over 500KB, `compact` will be set to `true`.\n */\n\nfunction normalizeOptions(\n code: string | { [filename: string]: string } | undefined,\n opts: GeneratorOptions,\n ast: t.Node,\n): Format {\n if (opts.experimental_preserveFormat) {\n if (typeof code !== \"string\") {\n throw new Error(\n \"`experimental_preserveFormat` requires the original `code` to be passed to @babel/generator as a string\",\n );\n }\n if (!opts.retainLines) {\n throw new Error(\n \"`experimental_preserveFormat` requires `retainLines` to be set to `true`\",\n );\n }\n if (opts.compact && opts.compact !== \"auto\") {\n throw new Error(\n \"`experimental_preserveFormat` is not compatible with the `compact` option\",\n );\n }\n if (opts.minified) {\n throw new Error(\n \"`experimental_preserveFormat` is not compatible with the `minified` option\",\n );\n }\n if (opts.jsescOption) {\n throw new Error(\n \"`experimental_preserveFormat` is not compatible with the `jsescOption` option\",\n );\n }\n if (!Array.isArray((ast as any).tokens)) {\n throw new Error(\n \"`experimental_preserveFormat` requires the AST to have attached the token of the input code. Make sure to enable the `tokens: true` parser option.\",\n );\n }\n }\n\n const format: Format = {\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n // @ts-expect-error define it later\n shouldPrintComment: opts.shouldPrintComment,\n preserveFormat: opts.experimental_preserveFormat,\n retainLines: opts.retainLines,\n retainFunctionParens: opts.retainFunctionParens,\n comments: opts.comments == null || opts.comments,\n compact: opts.compact,\n minified: opts.minified,\n concise: opts.concise,\n indent: {\n adjustMultilineComment: true,\n style: \" \",\n },\n jsescOption: {\n quotes: \"double\",\n wrap: true,\n minimal: process.env.BABEL_8_BREAKING ? true : false,\n ...opts.jsescOption,\n },\n topicToken: opts.topicToken,\n importAttributesKeyword: opts.importAttributesKeyword,\n };\n\n if (!process.env.BABEL_8_BREAKING) {\n format.decoratorsBeforeExport = opts.decoratorsBeforeExport;\n format.jsescOption.json = opts.jsonCompatibleStrings;\n format.recordAndTupleSyntaxType = opts.recordAndTupleSyntaxType ?? \"hash\";\n }\n\n if (format.minified) {\n format.compact = true;\n\n format.shouldPrintComment =\n format.shouldPrintComment || (() => format.comments);\n } else {\n format.shouldPrintComment =\n format.shouldPrintComment ||\n (value =>\n format.comments ||\n value.includes(\"@license\") ||\n value.includes(\"@preserve\"));\n }\n\n if (format.compact === \"auto\") {\n format.compact = typeof code === \"string\" && code.length > 500_000; // 500KB\n\n if (format.compact) {\n console.error(\n \"[BABEL] Note: The code generator has deoptimised the styling of \" +\n `${opts.filename} as it exceeds the max of ${\"500KB\"}.`,\n );\n }\n }\n\n if (format.compact || format.preserveFormat) {\n format.indent.adjustMultilineComment = false;\n }\n\n const { auxiliaryCommentBefore, auxiliaryCommentAfter, shouldPrintComment } =\n format;\n\n if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) {\n format.auxiliaryCommentBefore = undefined;\n }\n if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) {\n format.auxiliaryCommentAfter = undefined;\n }\n\n return format;\n}\n\nexport interface GeneratorOptions {\n /**\n * Optional string to add as a block comment at the start of the output file.\n */\n auxiliaryCommentBefore?: string;\n\n /**\n * Optional string to add as a block comment at the end of the output file.\n */\n auxiliaryCommentAfter?: string;\n\n /**\n * Function that takes a comment (as a string) and returns true if the comment should be included in the output.\n * By default, comments are included if `opts.comments` is `true` or if `opts.minified` is `false` and the comment\n * contains `@preserve` or `@license`.\n */\n shouldPrintComment?(comment: string): boolean;\n\n /**\n * Preserve the input code format while printing the transformed code.\n * This is experimental, and may have breaking changes in future\n * patch releases. It will be removed in a future minor release,\n * when it will graduate to stable.\n */\n experimental_preserveFormat?: boolean;\n\n /**\n * Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces).\n * Defaults to `false`.\n */\n retainLines?: boolean;\n\n /**\n * Retain parens around function expressions (could be used to change engine parsing behavior)\n * Defaults to `false`.\n */\n retainFunctionParens?: boolean;\n\n /**\n * Should comments be included in output? Defaults to `true`.\n */\n comments?: boolean;\n\n /**\n * Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`.\n */\n compact?: boolean | \"auto\";\n\n /**\n * Should the output be minified. Defaults to `false`.\n */\n minified?: boolean;\n\n /**\n * Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.\n */\n concise?: boolean;\n\n /**\n * Used in warning messages\n */\n filename?: string;\n\n /**\n * Enable generating source maps. Defaults to `false`.\n */\n sourceMaps?: boolean;\n\n inputSourceMap?: any;\n\n /**\n * A root for all relative URLs in the source map.\n */\n sourceRoot?: string;\n\n /**\n * The filename for the source code (i.e. the code in the `code` argument).\n * This will only be used if `code` is a string.\n */\n sourceFileName?: string;\n\n /**\n * Set to true to run jsesc with \"json\": true to print \"\\u00A9\" vs. \"©\";\n * @deprecated use `jsescOptions: { json: true }` instead\n */\n jsonCompatibleStrings?: boolean;\n\n /**\n * Set to true to enable support for experimental decorators syntax before\n * module exports. If not specified, decorators will be printed in the same\n * position as they were in the input source code.\n * @deprecated Removed in Babel 8\n */\n decoratorsBeforeExport?: boolean;\n\n /**\n * Options for outputting jsesc representation.\n */\n jsescOption?: jsescOptions;\n\n /**\n * For use with the recordAndTuple token.\n * @deprecated It will be removed in Babel 8.\n */\n recordAndTupleSyntaxType?: \"bar\" | \"hash\";\n\n /**\n * For use with the Hack-style pipe operator.\n * Changes what token is used for pipe bodies’ topic references.\n */\n topicToken?: \"%\" | \"#\" | \"@@\" | \"^^\" | \"^\";\n\n /**\n * The import attributes syntax style:\n * - \"with\" : `import { a } from \"b\" with { type: \"json\" };`\n * - \"assert\" : `import { a } from \"b\" assert { type: \"json\" };`\n * - \"with-legacy\" : `import { a } from \"b\" with type: \"json\";`\n */\n importAttributesKeyword?: \"with\" | \"assert\" | \"with-legacy\";\n}\n\nexport interface GeneratorResult {\n code: string;\n map: EncodedSourceMap | null;\n decodedMap: DecodedSourceMap | undefined;\n rawMappings: Mapping[] | undefined;\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n /**\n * We originally exported the Generator class above, but to make it extra clear that it is a private API,\n * we have moved that to an internal class instance and simplified the interface to the two public methods\n * that we wish to support.\n */\n\n // eslint-disable-next-line no-restricted-globals\n exports.CodeGenerator = class CodeGenerator {\n private _ast: t.Node;\n private _format: Format;\n private _map: SourceMap | null;\n constructor(ast: t.Node, opts: GeneratorOptions = {}, code?: string) {\n this._ast = ast;\n this._format = normalizeOptions(code, opts, ast);\n this._map = opts.sourceMaps ? new SourceMap(opts, code) : null;\n }\n generate(): GeneratorResult {\n const printer = new Printer(this._format, this._map);\n\n return printer.generate(this._ast);\n }\n };\n}\n\n/**\n * Turns an AST into code, maintaining sourcemaps, user preferences, and valid output.\n * @param ast - the abstract syntax tree from which to generate output code.\n * @param opts - used for specifying options for code generation.\n * @param code - the original source code, used for source maps.\n * @returns - an object containing the output code and source map.\n */\nexport function generate(\n ast: t.Node,\n opts: GeneratorOptions = {},\n code?: string | { [filename: string]: string },\n): GeneratorResult {\n const format = normalizeOptions(code, opts, ast);\n const map = opts.sourceMaps ? new SourceMap(opts, code) : null;\n\n const printer = new Printer(\n format,\n map,\n (ast as any).tokens,\n typeof code === \"string\" ? code : null,\n );\n\n return printer.generate(ast);\n}\n\nexport default generate;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAiBA,SAASE,gBAAgBA,CACvBC,IAAyD,EACzDC,IAAsB,EACtBC,GAAW,EACH;EACR,IAAID,IAAI,CAACE,2BAA2B,EAAE;IACpC,IAAI,OAAOH,IAAI,KAAK,QAAQ,EAAE;MAC5B,MAAM,IAAII,KAAK,CACb,yGACF,CAAC;IACH;IACA,IAAI,CAACH,IAAI,CAACI,WAAW,EAAE;MACrB,MAAM,IAAID,KAAK,CACb,0EACF,CAAC;IACH;IACA,IAAIH,IAAI,CAACK,OAAO,IAAIL,IAAI,CAACK,OAAO,KAAK,MAAM,EAAE;MAC3C,MAAM,IAAIF,KAAK,CACb,2EACF,CAAC;IACH;IACA,IAAIH,IAAI,CAACM,QAAQ,EAAE;MACjB,MAAM,IAAIH,KAAK,CACb,4EACF,CAAC;IACH;IACA,IAAIH,IAAI,CAACO,WAAW,EAAE;MACpB,MAAM,IAAIJ,KAAK,CACb,+EACF,CAAC;IACH;IACA,IAAI,CAACK,KAAK,CAACC,OAAO,CAAER,GAAG,CAASS,MAAM,CAAC,EAAE;MACvC,MAAM,IAAIP,KAAK,CACb,oJACF,CAAC;IACH;EACF;EAEA,MAAMQ,MAAc,GAAG;IACrBC,sBAAs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,CAACC,IAAI,EAAEC,IAAI,EAAEC,GAAG,CAAC;MAChD,IAAI,CAAC6C,IAAI,GAAG9C,IAAI,CAAC+C,UAAU,GAAG,IAAIC,kBAAS,CAAChD,IAAI,EAAED,IAAI,CAAC,GAAG,IAAI;IAChE;IACAkD,QAAQA,CAAA,EAAoB;MAC1B,MAAMC,OAAO,GAAG,IAAIC,gBAAO,CAAC,IAAI,CAACN,OAAO,EAAE,IAAI,CAACC,IAAI,CAAC;MAEpD,OAAOI,OAAO,CAACD,QAAQ,CAAC,IAAI,CAACL,IAAI,CAAC;IACpC;EACF,CAAC;AACH;AASO,SAASK,QAAQA,CACtBhD,GAAW,EACXD,IAAsB,GAAG,CAAC,CAAC,EAC3BD,IAA8C,EAC7B;EACjB,MAAMY,MAAM,GAAGb,gBAAgB,CAACC,IAAI,EAAEC,IAAI,EAAEC,GAAG,CAAC;EAChD,MAAMmD,GAAG,GAAGpD,IAAI,CAAC+C,UAAU,GAAG,IAAIC,kBAAS,CAAChD,IAAI,EAAED,IAAI,CAAC,GAAG,IAAI;EAE9D,MAAMmD,OAAO,GAAG,IAAIC,gBAAO,CACzBxC,MAAM,EACNyC,GAAG,EACFnD,GAAG,CAASS,MAAM,EACnB,OAAOX,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAG,IACpC,CAAC;EAED,OAAOmD,OAAO,CAACD,QAAQ,CAAChD,GAAG,CAAC;AAC9B;AAAC,IAAAoD,QAAA,GAAAZ,OAAA,CAAAa,OAAA,GAEcL,QAAQ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/node/index.js b/node_modules/@babel/generator/lib/node/index.js new file mode 100644 index 0000000..2fdc6ed --- /dev/null +++ b/node_modules/@babel/generator/lib/node/index.js @@ -0,0 +1,122 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TokenContext = void 0; +exports.isLastChild = isLastChild; +exports.needsParens = needsParens; +exports.needsWhitespace = needsWhitespace; +exports.needsWhitespaceAfter = needsWhitespaceAfter; +exports.needsWhitespaceBefore = needsWhitespaceBefore; +var whitespace = require("./whitespace.js"); +var parens = require("./parentheses.js"); +var _t = require("@babel/types"); +const { + FLIPPED_ALIAS_KEYS, + VISITOR_KEYS, + isCallExpression, + isDecorator, + isExpressionStatement, + isMemberExpression, + isNewExpression, + isParenthesizedExpression +} = _t; +const TokenContext = exports.TokenContext = { + normal: 0, + expressionStatement: 1, + arrowBody: 2, + exportDefault: 4, + arrowFlowReturnType: 8, + forInitHead: 16, + forInHead: 32, + forOfHead: 64, + forInOrInitHeadAccumulate: 128, + forInOrInitHeadAccumulatePassThroughMask: 128 +}; +function expandAliases(obj) { + const map = new Map(); + function add(type, func) { + const fn = map.get(type); + map.set(type, fn ? function (node, parent, stack, getRawIdentifier) { + var _fn; + return (_fn = fn(node, parent, stack, getRawIdentifier)) != null ? _fn : func(node, parent, stack, getRawIdentifier); + } : func); + } + for (const type of Object.keys(obj)) { + const aliases = FLIPPED_ALIAS_KEYS[type]; + if (aliases) { + for (const alias of aliases) { + add(alias, obj[type]); + } + } else { + add(type, obj[type]); + } + } + return map; +} +const expandedParens = expandAliases(parens); +const expandedWhitespaceNodes = expandAliases(whitespace.nodes); +function isOrHasCallExpression(node) { + if (isCallExpression(node)) { + return true; + } + return isMemberExpression(node) && isOrHasCallExpression(node.object); +} +function needsWhitespace(node, parent, type) { + var _expandedWhitespaceNo; + if (!node) return false; + if (isExpressionStatement(node)) { + node = node.expression; + } + const flag = (_expandedWhitespaceNo = expandedWhitespaceNodes.get(node.type)) == null ? void 0 : _expandedWhitespaceNo(node, parent); + if (typeof flag === "number") { + return (flag & type) !== 0; + } + return false; +} +function needsWhitespaceBefore(node, parent) { + return needsWhitespace(node, parent, 1); +} +function needsWhitespaceAfter(node, parent) { + return needsWhitespace(node, parent, 2); +} +function needsParens(node, parent, tokenContext, getRawIdentifier) { + var _expandedParens$get; + if (!parent) return false; + if (isNewExpression(parent) && parent.callee === node) { + if (isOrHasCallExpression(node)) return true; + } + if (isDecorator(parent)) { + return !isDecoratorMemberExpression(node) && !(isCallExpression(node) && isDecoratorMemberExpression(node.callee)) && !isParenthesizedExpression(node); + } + return ((_expandedParens$get = expandedParens.get(node.type)) == null ? void 0 : _expandedParens$get(node, parent, tokenContext, getRawIdentifier)) || false; +} +function isDecoratorMemberExpression(node) { + switch (node.type) { + case "Identifier": + return true; + case "MemberExpression": + return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object); + default: + return false; + } +} +function isLastChild(parent, child) { + const visitorKeys = VISITOR_KEYS[parent.type]; + for (let i = visitorKeys.length - 1; i >= 0; i--) { + const val = parent[visitorKeys[i]]; + if (val === child) { + return true; + } else if (Array.isArray(val)) { + let j = val.length - 1; + while (j >= 0 && val[j] === null) j--; + return j >= 0 && val[j] === child; + } else if (val) { + return false; + } + } + return false; +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/generator/lib/node/index.js.map b/node_modules/@babel/generator/lib/node/index.js.map new file mode 100644 index 0000000..53a905f --- /dev/null +++ b/node_modules/@babel/generator/lib/node/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["whitespace","require","parens","_t","FLIPPED_ALIAS_KEYS","VISITOR_KEYS","isCallExpression","isDecorator","isExpressionStatement","isMemberExpression","isNewExpression","isParenthesizedExpression","TokenContext","exports","normal","expressionStatement","arrowBody","exportDefault","arrowFlowReturnType","forInitHead","forInHead","forOfHead","forInOrInitHeadAccumulate","forInOrInitHeadAccumulatePassThroughMask","expandAliases","obj","map","Map","add","type","func","fn","get","set","node","parent","stack","getRawIdentifier","_fn","Object","keys","aliases","alias","expandedParens","expandedWhitespaceNodes","nodes","isOrHasCallExpression","object","needsWhitespace","_expandedWhitespaceNo","expression","flag","needsWhitespaceBefore","needsWhitespaceAfter","needsParens","tokenContext","_expandedParens$get","callee","isDecoratorMemberExpression","computed","property","isLastChild","child","visitorKeys","i","length","val","Array","isArray","j"],"sources":["../../src/node/index.ts"],"sourcesContent":["import * as whitespace from \"./whitespace.ts\";\nimport * as parens from \"./parentheses.ts\";\nimport {\n FLIPPED_ALIAS_KEYS,\n VISITOR_KEYS,\n isCallExpression,\n isDecorator,\n isExpressionStatement,\n isMemberExpression,\n isNewExpression,\n isParenthesizedExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport type { WhitespaceFlag } from \"./whitespace.ts\";\n\nexport const enum TokenContext {\n normal = 0,\n expressionStatement = 1 << 0,\n arrowBody = 1 << 1,\n exportDefault = 1 << 2,\n arrowFlowReturnType = 1 << 3,\n forInitHead = 1 << 4,\n forInHead = 1 << 5,\n forOfHead = 1 << 6,\n // This flag lives across the token boundary, and will\n // be reset after forIn or forInit head is printed\n forInOrInitHeadAccumulate = 1 << 7,\n forInOrInitHeadAccumulatePassThroughMask = 0x80,\n}\n\ntype NodeHandler = (\n node: t.Node,\n // todo:\n // node: K extends keyof typeof t\n // ? Extract\n // : t.Node,\n parent: t.Node,\n tokenContext?: number,\n getRawIdentifier?: (node: t.Identifier) => string,\n) => R | undefined;\n\nexport type NodeHandlers = {\n [K in string]?: NodeHandler;\n};\n\nfunction expandAliases(obj: NodeHandlers) {\n const map = new Map>();\n\n function add(type: string, func: NodeHandler) {\n const fn = map.get(type);\n map.set(\n type,\n fn\n ? function (node, parent, stack, getRawIdentifier) {\n return (\n fn(node, parent, stack, getRawIdentifier) ??\n func(node, parent, stack, getRawIdentifier)\n );\n }\n : func,\n );\n }\n\n for (const type of Object.keys(obj)) {\n const aliases = FLIPPED_ALIAS_KEYS[type];\n if (aliases) {\n for (const alias of aliases) {\n add(alias, obj[type]!);\n }\n } else {\n add(type, obj[type]!);\n }\n }\n\n return map;\n}\n\n// Rather than using `t.is` on each object property, we pre-expand any type aliases\n// into concrete types so that the 'find' call below can be as fast as possible.\nconst expandedParens = expandAliases(parens);\nconst expandedWhitespaceNodes = expandAliases(whitespace.nodes);\n\nfunction isOrHasCallExpression(node: t.Node): boolean {\n if (isCallExpression(node)) {\n return true;\n }\n\n return isMemberExpression(node) && isOrHasCallExpression(node.object);\n}\n\nexport function needsWhitespace(\n node: t.Node,\n parent: t.Node,\n type: WhitespaceFlag,\n): boolean {\n if (!node) return false;\n\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n const flag = expandedWhitespaceNodes.get(node.type)?.(node, parent);\n\n if (typeof flag === \"number\") {\n return (flag & type) !== 0;\n }\n\n return false;\n}\n\nexport function needsWhitespaceBefore(node: t.Node, parent: t.Node) {\n return needsWhitespace(node, parent, 1);\n}\n\nexport function needsWhitespaceAfter(node: t.Node, parent: t.Node) {\n return needsWhitespace(node, parent, 2);\n}\n\nexport function needsParens(\n node: t.Node,\n parent: t.Node | null,\n tokenContext?: number,\n getRawIdentifier?: (node: t.Identifier) => string,\n): boolean {\n if (!parent) return false;\n\n if (isNewExpression(parent) && parent.callee === node) {\n if (isOrHasCallExpression(node)) return true;\n }\n\n if (isDecorator(parent)) {\n return (\n !isDecoratorMemberExpression(node) &&\n !(isCallExpression(node) && isDecoratorMemberExpression(node.callee)) &&\n !isParenthesizedExpression(node)\n );\n }\n\n return (\n expandedParens.get(node.type)?.(\n node,\n parent,\n tokenContext,\n getRawIdentifier,\n ) || false\n );\n}\n\nfunction isDecoratorMemberExpression(node: t.Node): boolean {\n switch (node.type) {\n case \"Identifier\":\n return true;\n case \"MemberExpression\":\n return (\n !node.computed &&\n node.property.type === \"Identifier\" &&\n isDecoratorMemberExpression(node.object)\n );\n default:\n return false;\n }\n}\n\nexport function isLastChild(parent: t.Node, child: t.Node) {\n const visitorKeys = VISITOR_KEYS[parent.type];\n for (let i = visitorKeys.length - 1; i >= 0; i--) {\n const val = (parent as any)[visitorKeys[i]] as t.Node | t.Node[] | null;\n if (val === child) {\n return true;\n } else if (Array.isArray(val)) {\n let j = val.length - 1;\n while (j >= 0 && val[j] === null) j--;\n return j >= 0 && val[j] === child;\n } else if (val) {\n return false;\n }\n }\n return false;\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,UA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AAME,GAAG,GAAI/B,MAAM,CAAS4B,WAAW,CAACC,CAAC,CAAC,CAA6B;IACvE,IAAIE,GAAG,KAAKJ,KAAK,EAAE;MACjB,OAAO,IAAI;IACb,CAAC,MAAM,IAAIK,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE;MAC7B,IAAIG,CAAC,GAAGH,GAAG,CAACD,MAAM,GAAG,CAAC;MACtB,OAAOI,CAAC,IAAI,CAAC,IAAIH,GAAG,CAACG,CAAC,CAAC,KAAK,IAAI,EAAEA,CAAC,EAAE;MACrC,OAAOA,CAAC,IAAI,CAAC,IAAIH,GAAG,CAACG,CAAC,CAAC,KAAKP,KAAK;IACnC,CAAC,MAAM,IAAII,GAAG,EAAE;MACd,OAAO,KAAK;IACd;EACF;EACA,OAAO,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/node/parentheses.js b/node_modules/@babel/generator/lib/node/parentheses.js new file mode 100644 index 0000000..16543ac --- /dev/null +++ b/node_modules/@babel/generator/lib/node/parentheses.js @@ -0,0 +1,261 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AssignmentExpression = AssignmentExpression; +exports.Binary = Binary; +exports.BinaryExpression = BinaryExpression; +exports.ClassExpression = ClassExpression; +exports.ArrowFunctionExpression = exports.ConditionalExpression = ConditionalExpression; +exports.DoExpression = DoExpression; +exports.FunctionExpression = FunctionExpression; +exports.FunctionTypeAnnotation = FunctionTypeAnnotation; +exports.Identifier = Identifier; +exports.LogicalExpression = LogicalExpression; +exports.NullableTypeAnnotation = NullableTypeAnnotation; +exports.ObjectExpression = ObjectExpression; +exports.OptionalIndexedAccessType = OptionalIndexedAccessType; +exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression; +exports.SequenceExpression = SequenceExpression; +exports.TSSatisfiesExpression = exports.TSAsExpression = TSAsExpression; +exports.TSConditionalType = TSConditionalType; +exports.TSConstructorType = exports.TSFunctionType = TSFunctionType; +exports.TSInferType = TSInferType; +exports.TSInstantiationExpression = TSInstantiationExpression; +exports.TSIntersectionType = TSIntersectionType; +exports.UnaryLike = exports.TSTypeAssertion = UnaryLike; +exports.TSTypeOperator = TSTypeOperator; +exports.TSUnionType = TSUnionType; +exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; +exports.UpdateExpression = UpdateExpression; +exports.AwaitExpression = exports.YieldExpression = YieldExpression; +var _t = require("@babel/types"); +var _index = require("./index.js"); +const { + isArrayTypeAnnotation, + isBinaryExpression, + isCallExpression, + isForOfStatement, + isIndexedAccessType, + isMemberExpression, + isObjectPattern, + isOptionalMemberExpression, + isYieldExpression, + isStatement +} = _t; +const PRECEDENCE = new Map([["||", 0], ["??", 0], ["|>", 0], ["&&", 1], ["|", 2], ["^", 3], ["&", 4], ["==", 5], ["===", 5], ["!=", 5], ["!==", 5], ["<", 6], [">", 6], ["<=", 6], [">=", 6], ["in", 6], ["instanceof", 6], [">>", 7], ["<<", 7], [">>>", 7], ["+", 8], ["-", 8], ["*", 9], ["/", 9], ["%", 9], ["**", 10]]); +function getBinaryPrecedence(node, nodeType) { + if (nodeType === "BinaryExpression" || nodeType === "LogicalExpression") { + return PRECEDENCE.get(node.operator); + } + if (nodeType === "TSAsExpression" || nodeType === "TSSatisfiesExpression") { + return PRECEDENCE.get("in"); + } +} +function isTSTypeExpression(nodeType) { + return nodeType === "TSAsExpression" || nodeType === "TSSatisfiesExpression" || nodeType === "TSTypeAssertion"; +} +const isClassExtendsClause = (node, parent) => { + const parentType = parent.type; + return (parentType === "ClassDeclaration" || parentType === "ClassExpression") && parent.superClass === node; +}; +const hasPostfixPart = (node, parent) => { + const parentType = parent.type; + return (parentType === "MemberExpression" || parentType === "OptionalMemberExpression") && parent.object === node || (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression") && parent.callee === node || parentType === "TaggedTemplateExpression" && parent.tag === node || parentType === "TSNonNullExpression"; +}; +function NullableTypeAnnotation(node, parent) { + return isArrayTypeAnnotation(parent); +} +function FunctionTypeAnnotation(node, parent, tokenContext) { + const parentType = parent.type; + return (parentType === "UnionTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "ArrayTypeAnnotation" || Boolean(tokenContext & _index.TokenContext.arrowFlowReturnType) + ); +} +function UpdateExpression(node, parent) { + return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent); +} +function needsParenBeforeExpressionBrace(tokenContext) { + return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.arrowBody)); +} +function ObjectExpression(node, parent, tokenContext) { + return needsParenBeforeExpressionBrace(tokenContext); +} +function DoExpression(node, parent, tokenContext) { + return !node.async && Boolean(tokenContext & _index.TokenContext.expressionStatement); +} +function Binary(node, parent) { + const parentType = parent.type; + if (node.type === "BinaryExpression" && node.operator === "**" && parentType === "BinaryExpression" && parent.operator === "**") { + return parent.left === node; + } + if (isClassExtendsClause(node, parent)) { + return true; + } + if (hasPostfixPart(node, parent) || parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "AwaitExpression") { + return true; + } + const parentPos = getBinaryPrecedence(parent, parentType); + if (parentPos != null) { + const nodePos = getBinaryPrecedence(node, node.type); + if (parentPos === nodePos && parentType === "BinaryExpression" && parent.right === node || parentPos > nodePos) { + return true; + } + } +} +function UnionTypeAnnotation(node, parent) { + const parentType = parent.type; + return parentType === "ArrayTypeAnnotation" || parentType === "NullableTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "UnionTypeAnnotation"; +} +function OptionalIndexedAccessType(node, parent) { + return isIndexedAccessType(parent) && parent.objectType === node; +} +function TSAsExpression(node, parent) { + if ((parent.type === "AssignmentExpression" || parent.type === "AssignmentPattern") && parent.left === node) { + return true; + } + if (parent.type === "BinaryExpression" && (parent.operator === "|" || parent.operator === "&") && node === parent.left) { + return true; + } + return Binary(node, parent); +} +function TSConditionalType(node, parent) { + const parentType = parent.type; + if (parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType" || parentType === "TSTypeOperator" || parentType === "TSTypeParameter") { + return true; + } + if ((parentType === "TSIntersectionType" || parentType === "TSUnionType") && parent.types[0] === node) { + return true; + } + if (parentType === "TSConditionalType" && (parent.checkType === node || parent.extendsType === node)) { + return true; + } + return false; +} +function TSUnionType(node, parent) { + const parentType = parent.type; + return parentType === "TSIntersectionType" || parentType === "TSTypeOperator" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType"; +} +function TSIntersectionType(node, parent) { + const parentType = parent.type; + return parentType === "TSTypeOperator" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType"; +} +function TSInferType(node, parent) { + const parentType = parent.type; + if (parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType") { + return true; + } + if (node.typeParameter.constraint) { + if ((parentType === "TSIntersectionType" || parentType === "TSUnionType") && parent.types[0] === node) { + return true; + } + } + return false; +} +function TSTypeOperator(node, parent) { + const parentType = parent.type; + return parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType"; +} +function TSInstantiationExpression(node, parent) { + const parentType = parent.type; + return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.typeParameters; +} +function TSFunctionType(node, parent) { + const parentType = parent.type; + return parentType === "TSIntersectionType" || parentType === "TSUnionType" || parentType === "TSTypeOperator" || parentType === "TSOptionalType" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSConditionalType" && (parent.checkType === node || parent.extendsType === node); +} +function BinaryExpression(node, parent, tokenContext) { + return node.operator === "in" && Boolean(tokenContext & _index.TokenContext.forInOrInitHeadAccumulate); +} +function SequenceExpression(node, parent) { + const parentType = parent.type; + if (parentType === "SequenceExpression" || parentType === "ParenthesizedExpression" || parentType === "MemberExpression" && parent.property === node || parentType === "OptionalMemberExpression" && parent.property === node || parentType === "TemplateLiteral") { + return false; + } + if (parentType === "ClassDeclaration") { + return true; + } + if (parentType === "ForOfStatement") { + return parent.right === node; + } + if (parentType === "ExportDefaultDeclaration") { + return true; + } + return !isStatement(parent); +} +function YieldExpression(node, parent) { + const parentType = parent.type; + return parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "UnaryExpression" || parentType === "SpreadElement" || hasPostfixPart(node, parent) || parentType === "AwaitExpression" && isYieldExpression(node) || parentType === "ConditionalExpression" && node === parent.test || isClassExtendsClause(node, parent) || isTSTypeExpression(parentType); +} +function ClassExpression(node, parent, tokenContext) { + return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)); +} +function UnaryLike(node, parent) { + return hasPostfixPart(node, parent) || isBinaryExpression(parent) && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent); +} +function FunctionExpression(node, parent, tokenContext) { + return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)); +} +function ConditionalExpression(node, parent) { + const parentType = parent.type; + if (parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "ConditionalExpression" && parent.test === node || parentType === "AwaitExpression" || isTSTypeExpression(parentType)) { + return true; + } + return UnaryLike(node, parent); +} +function OptionalMemberExpression(node, parent) { + return isCallExpression(parent) && parent.callee === node || isMemberExpression(parent) && parent.object === node; +} +function AssignmentExpression(node, parent, tokenContext) { + if (needsParenBeforeExpressionBrace(tokenContext) && isObjectPattern(node.left)) { + return true; + } else { + return ConditionalExpression(node, parent); + } +} +function LogicalExpression(node, parent) { + const parentType = parent.type; + if (isTSTypeExpression(parentType)) return true; + if (parentType !== "LogicalExpression") return false; + switch (node.operator) { + case "||": + return parent.operator === "??" || parent.operator === "&&"; + case "&&": + return parent.operator === "??"; + case "??": + return parent.operator !== "??"; + } +} +function Identifier(node, parent, tokenContext, getRawIdentifier) { + var _node$extra; + const parentType = parent.type; + if ((_node$extra = node.extra) != null && _node$extra.parenthesized && parentType === "AssignmentExpression" && parent.left === node) { + const rightType = parent.right.type; + if ((rightType === "FunctionExpression" || rightType === "ClassExpression") && parent.right.id == null) { + return true; + } + } + if (getRawIdentifier && getRawIdentifier(node) !== node.name) { + return false; + } + if (node.name === "let") { + const isFollowedByBracket = isMemberExpression(parent, { + object: node, + computed: true + }) || isOptionalMemberExpression(parent, { + object: node, + computed: true, + optional: false + }); + if (isFollowedByBracket && tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.forInitHead | _index.TokenContext.forInHead)) { + return true; + } + return Boolean(tokenContext & _index.TokenContext.forOfHead); + } + return node.name === "async" && isForOfStatement(parent, { + left: node, + await: false + }); +} + +//# sourceMappingURL=parentheses.js.map diff --git a/node_modules/@babel/generator/lib/node/parentheses.js.map b/node_modules/@babel/generator/lib/node/parentheses.js.map new file mode 100644 index 0000000..4d32fa4 --- /dev/null +++ b/node_modules/@babel/generator/lib/node/parentheses.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","_index","isArrayTypeAnnotation","isBinaryExpression","isCallExpression","isForOfStatement","isIndexedAccessType","isMemberExpression","isObjectPattern","isOptionalMemberExpression","isYieldExpression","isStatement","PRECEDENCE","Map","getBinaryPrecedence","node","nodeType","get","operator","isTSTypeExpression","isClassExtendsClause","parent","parentType","type","superClass","hasPostfixPart","object","callee","tag","NullableTypeAnnotation","FunctionTypeAnnotation","tokenContext","Boolean","TokenContext","arrowFlowReturnType","UpdateExpression","needsParenBeforeExpressionBrace","expressionStatement","arrowBody","ObjectExpression","DoExpression","async","Binary","left","parentPos","nodePos","right","UnionTypeAnnotation","OptionalIndexedAccessType","objectType","TSAsExpression","TSConditionalType","types","checkType","extendsType","TSUnionType","TSIntersectionType","TSInferType","typeParameter","constraint","TSTypeOperator","TSInstantiationExpression","typeParameters","TSFunctionType","BinaryExpression","forInOrInitHeadAccumulate","SequenceExpression","property","YieldExpression","test","ClassExpression","exportDefault","UnaryLike","FunctionExpression","ConditionalExpression","OptionalMemberExpression","AssignmentExpression","LogicalExpression","Identifier","getRawIdentifier","_node$extra","extra","parenthesized","rightType","id","name","isFollowedByBracket","computed","optional","forInitHead","forInHead","forOfHead","await"],"sources":["../../src/node/parentheses.ts"],"sourcesContent":["import {\n isArrayTypeAnnotation,\n isBinaryExpression,\n isCallExpression,\n isForOfStatement,\n isIndexedAccessType,\n isMemberExpression,\n isObjectPattern,\n isOptionalMemberExpression,\n isYieldExpression,\n isStatement,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\nimport { TokenContext } from \"./index.ts\";\n\nconst PRECEDENCE = new Map([\n [\"||\", 0],\n [\"??\", 0],\n [\"|>\", 0],\n [\"&&\", 1],\n [\"|\", 2],\n [\"^\", 3],\n [\"&\", 4],\n [\"==\", 5],\n [\"===\", 5],\n [\"!=\", 5],\n [\"!==\", 5],\n [\"<\", 6],\n [\">\", 6],\n [\"<=\", 6],\n [\">=\", 6],\n [\"in\", 6],\n [\"instanceof\", 6],\n [\">>\", 7],\n [\"<<\", 7],\n [\">>>\", 7],\n [\"+\", 8],\n [\"-\", 8],\n [\"*\", 9],\n [\"/\", 9],\n [\"%\", 9],\n [\"**\", 10],\n]);\n\nfunction getBinaryPrecedence(\n node: t.Binary | t.TSAsExpression | t.TSSatisfiesExpression,\n nodeType: string,\n): number;\nfunction getBinaryPrecedence(\n node: t.Node,\n nodeType: string,\n): number | undefined;\nfunction getBinaryPrecedence(node: t.Node, nodeType: string) {\n if (nodeType === \"BinaryExpression\" || nodeType === \"LogicalExpression\") {\n return PRECEDENCE.get((node as t.Binary).operator);\n }\n if (nodeType === \"TSAsExpression\" || nodeType === \"TSSatisfiesExpression\") {\n return PRECEDENCE.get(\"in\");\n }\n}\n\nfunction isTSTypeExpression(nodeType: string) {\n return (\n nodeType === \"TSAsExpression\" ||\n nodeType === \"TSSatisfiesExpression\" ||\n nodeType === \"TSTypeAssertion\"\n );\n}\n\nconst isClassExtendsClause = (\n node: t.Node,\n parent: t.Node,\n): parent is t.Class => {\n const parentType = parent.type;\n return (\n (parentType === \"ClassDeclaration\" || parentType === \"ClassExpression\") &&\n parent.superClass === node\n );\n};\n\nconst hasPostfixPart = (node: t.Node, parent: t.Node) => {\n const parentType = parent.type;\n return (\n ((parentType === \"MemberExpression\" ||\n parentType === \"OptionalMemberExpression\") &&\n parent.object === node) ||\n ((parentType === \"CallExpression\" ||\n parentType === \"OptionalCallExpression\" ||\n parentType === \"NewExpression\") &&\n parent.callee === node) ||\n (parentType === \"TaggedTemplateExpression\" && parent.tag === node) ||\n parentType === \"TSNonNullExpression\"\n );\n};\n\nexport function NullableTypeAnnotation(\n node: t.NullableTypeAnnotation,\n parent: t.Node,\n): boolean {\n return isArrayTypeAnnotation(parent);\n}\n\nexport function FunctionTypeAnnotation(\n node: t.FunctionTypeAnnotation,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n const parentType = parent.type;\n return (\n // (() => A) | (() => B)\n parentType === \"UnionTypeAnnotation\" ||\n // (() => A) & (() => B)\n parentType === \"IntersectionTypeAnnotation\" ||\n // (() => A)[]\n parentType === \"ArrayTypeAnnotation\" ||\n Boolean(tokenContext & TokenContext.arrowFlowReturnType)\n );\n}\n\nexport function UpdateExpression(\n node: t.UpdateExpression,\n parent: t.Node,\n): boolean {\n return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);\n}\n\nfunction needsParenBeforeExpressionBrace(tokenContext: number) {\n return Boolean(\n tokenContext & (TokenContext.expressionStatement | TokenContext.arrowBody),\n );\n}\n\nexport function ObjectExpression(\n node: t.ObjectExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n return needsParenBeforeExpressionBrace(tokenContext);\n}\n\nexport function DoExpression(\n node: t.DoExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n // `async do` can start an expression statement\n return (\n !node.async && Boolean(tokenContext & TokenContext.expressionStatement)\n );\n}\n\nexport function Binary(\n node: t.Binary | t.TSAsExpression | t.TSSatisfiesExpression,\n parent: t.Node,\n): boolean | undefined {\n const parentType = parent.type;\n if (\n node.type === \"BinaryExpression\" &&\n node.operator === \"**\" &&\n parentType === \"BinaryExpression\" &&\n parent.operator === \"**\"\n ) {\n return parent.left === node;\n }\n\n if (isClassExtendsClause(node, parent)) {\n return true;\n }\n\n if (\n hasPostfixPart(node, parent) ||\n parentType === \"UnaryExpression\" ||\n parentType === \"SpreadElement\" ||\n parentType === \"AwaitExpression\"\n ) {\n return true;\n }\n\n const parentPos = getBinaryPrecedence(parent, parentType);\n if (parentPos != null) {\n const nodePos = getBinaryPrecedence(node, node.type);\n if (\n // Logical expressions with the same precedence don't need parens.\n (parentPos === nodePos &&\n parentType === \"BinaryExpression\" &&\n parent.right === node) ||\n parentPos > nodePos\n ) {\n return true;\n }\n }\n}\n\nexport function UnionTypeAnnotation(\n node: t.UnionTypeAnnotation,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"ArrayTypeAnnotation\" ||\n parentType === \"NullableTypeAnnotation\" ||\n parentType === \"IntersectionTypeAnnotation\" ||\n parentType === \"UnionTypeAnnotation\"\n );\n}\n\nexport { UnionTypeAnnotation as IntersectionTypeAnnotation };\n\nexport function OptionalIndexedAccessType(\n node: t.OptionalIndexedAccessType,\n parent: t.Node,\n): boolean {\n return isIndexedAccessType(parent) && parent.objectType === node;\n}\n\nexport function TSAsExpression(\n node: t.TSAsExpression | t.TSSatisfiesExpression,\n parent: t.Node,\n): boolean | undefined {\n if (\n (parent.type === \"AssignmentExpression\" ||\n parent.type === \"AssignmentPattern\") &&\n parent.left === node\n ) {\n return true;\n }\n if (\n parent.type === \"BinaryExpression\" &&\n (parent.operator === \"|\" || parent.operator === \"&\") &&\n node === parent.left\n ) {\n return true;\n }\n return Binary(node, parent);\n}\n\nexport { TSAsExpression as TSSatisfiesExpression };\n\nexport { UnaryLike as TSTypeAssertion };\n\nexport function TSConditionalType(\n node: t.TSConditionalType,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n if (\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\" ||\n parentType === \"TSTypeOperator\" ||\n // for `infer K extends (L extends M ? M : ...)`\n parentType === \"TSTypeParameter\"\n ) {\n return true;\n }\n if (\n (parentType === \"TSIntersectionType\" || parentType === \"TSUnionType\") &&\n parent.types[0] === node\n ) {\n return true;\n }\n if (\n parentType === \"TSConditionalType\" &&\n (parent.checkType === node || parent.extendsType === node)\n ) {\n return true;\n }\n return false;\n}\n\nexport function TSUnionType(node: t.TSUnionType, parent: t.Node): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSIntersectionType\" ||\n parentType === \"TSTypeOperator\" ||\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n );\n}\n\nexport function TSIntersectionType(\n node: t.TSUnionType,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSTypeOperator\" ||\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n );\n}\n\nexport function TSInferType(node: t.TSInferType, parent: t.Node): boolean {\n const parentType = parent.type;\n if (\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n ) {\n return true;\n }\n if (node.typeParameter.constraint) {\n if (\n (parentType === \"TSIntersectionType\" || parentType === \"TSUnionType\") &&\n parent.types[0] === node\n ) {\n return true;\n }\n }\n return false;\n}\n\nexport function TSTypeOperator(\n node: t.TSTypeOperator,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n parentType === \"TSOptionalType\"\n );\n}\n\nexport function TSInstantiationExpression(\n node: t.TSInstantiationExpression,\n parent: t.Node,\n) {\n const parentType = parent.type;\n return (\n (parentType === \"CallExpression\" ||\n parentType === \"OptionalCallExpression\" ||\n parentType === \"NewExpression\" ||\n parentType === \"TSInstantiationExpression\") &&\n !!(process.env.BABEL_8_BREAKING\n ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST\n parent.typeArguments\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n parent.typeParameters)\n );\n}\n\nexport function TSFunctionType(\n node: t.TSFunctionType,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"TSIntersectionType\" ||\n parentType === \"TSUnionType\" ||\n parentType === \"TSTypeOperator\" ||\n parentType === \"TSOptionalType\" ||\n parentType === \"TSArrayType\" ||\n (parentType === \"TSIndexedAccessType\" && parent.objectType === node) ||\n (parentType === \"TSConditionalType\" &&\n (parent.checkType === node || parent.extendsType === node))\n );\n}\n\nexport { TSFunctionType as TSConstructorType };\n\nexport function BinaryExpression(\n node: t.BinaryExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n // for ((1 in []);;);\n // for (var x = (1 in []) in 2);\n return (\n node.operator === \"in\" &&\n Boolean(tokenContext & TokenContext.forInOrInitHeadAccumulate)\n );\n}\n\nexport function SequenceExpression(\n node: t.SequenceExpression,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n if (\n parentType === \"SequenceExpression\" ||\n parentType === \"ParenthesizedExpression\" ||\n (parentType === \"MemberExpression\" && parent.property === node) ||\n (parentType === \"OptionalMemberExpression\" && parent.property === node) ||\n parentType === \"TemplateLiteral\"\n ) {\n return false;\n }\n if (parentType === \"ClassDeclaration\") {\n return true;\n }\n if (parentType === \"ForOfStatement\") {\n return parent.right === node;\n }\n if (parentType === \"ExportDefaultDeclaration\") {\n return true;\n }\n\n return !isStatement(parent);\n}\n\nexport function YieldExpression(\n node: t.YieldExpression,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n return (\n parentType === \"BinaryExpression\" ||\n parentType === \"LogicalExpression\" ||\n parentType === \"UnaryExpression\" ||\n parentType === \"SpreadElement\" ||\n hasPostfixPart(node, parent) ||\n (parentType === \"AwaitExpression\" && isYieldExpression(node)) ||\n (parentType === \"ConditionalExpression\" && node === parent.test) ||\n isClassExtendsClause(node, parent) ||\n isTSTypeExpression(parentType)\n );\n}\n\nexport { YieldExpression as AwaitExpression };\n\nexport function ClassExpression(\n node: t.ClassExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n return Boolean(\n tokenContext &\n (TokenContext.expressionStatement | TokenContext.exportDefault),\n );\n}\n\nexport function UnaryLike(\n node:\n | t.UnaryLike\n | t.TSTypeAssertion\n | t.ArrowFunctionExpression\n | t.ConditionalExpression\n | t.AssignmentExpression,\n parent: t.Node,\n): boolean {\n return (\n hasPostfixPart(node, parent) ||\n (isBinaryExpression(parent) &&\n parent.operator === \"**\" &&\n parent.left === node) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport function FunctionExpression(\n node: t.FunctionExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n return Boolean(\n tokenContext &\n (TokenContext.expressionStatement | TokenContext.exportDefault),\n );\n}\n\nexport function ConditionalExpression(\n node:\n | t.ConditionalExpression\n | t.ArrowFunctionExpression\n | t.AssignmentExpression,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n if (\n parentType === \"UnaryExpression\" ||\n parentType === \"SpreadElement\" ||\n parentType === \"BinaryExpression\" ||\n parentType === \"LogicalExpression\" ||\n (parentType === \"ConditionalExpression\" && parent.test === node) ||\n parentType === \"AwaitExpression\" ||\n isTSTypeExpression(parentType)\n ) {\n return true;\n }\n\n return UnaryLike(node, parent);\n}\n\nexport { ConditionalExpression as ArrowFunctionExpression };\n\nexport function OptionalMemberExpression(\n node: t.OptionalMemberExpression,\n parent: t.Node,\n): boolean {\n return (\n (isCallExpression(parent) && parent.callee === node) ||\n (isMemberExpression(parent) && parent.object === node)\n );\n}\n\nexport { OptionalMemberExpression as OptionalCallExpression };\n\nexport function AssignmentExpression(\n node: t.AssignmentExpression,\n parent: t.Node,\n tokenContext: number,\n): boolean {\n if (\n needsParenBeforeExpressionBrace(tokenContext) &&\n isObjectPattern(node.left)\n ) {\n return true;\n } else {\n return ConditionalExpression(node, parent);\n }\n}\n\nexport function LogicalExpression(\n node: t.LogicalExpression,\n parent: t.Node,\n): boolean {\n const parentType = parent.type;\n if (isTSTypeExpression(parentType)) return true;\n if (parentType !== \"LogicalExpression\") return false;\n switch (node.operator) {\n case \"||\":\n return parent.operator === \"??\" || parent.operator === \"&&\";\n case \"&&\":\n return parent.operator === \"??\";\n case \"??\":\n return parent.operator !== \"??\";\n }\n}\n\nexport function Identifier(\n node: t.Identifier,\n parent: t.Node,\n tokenContext: number,\n getRawIdentifier: (node: t.Identifier) => string,\n): boolean {\n const parentType = parent.type;\n // 13.15.2 AssignmentExpression RS: Evaluation\n // (fn) = function () {};\n if (\n node.extra?.parenthesized &&\n parentType === \"AssignmentExpression\" &&\n parent.left === node\n ) {\n const rightType = parent.right.type;\n if (\n (rightType === \"FunctionExpression\" || rightType === \"ClassExpression\") &&\n parent.right.id == null\n ) {\n return true;\n }\n }\n\n if (getRawIdentifier && getRawIdentifier(node) !== node.name) {\n return false;\n }\n\n // Non-strict code allows the identifier `let`, but it cannot occur as-is in\n // certain contexts to avoid ambiguity with contextual keyword `let`.\n if (node.name === \"let\") {\n // Some contexts only forbid `let [`, so check if the next token would\n // be the left bracket of a computed member expression.\n const isFollowedByBracket =\n isMemberExpression(parent, {\n object: node,\n computed: true,\n }) ||\n isOptionalMemberExpression(parent, {\n object: node,\n computed: true,\n optional: false,\n });\n if (\n isFollowedByBracket &&\n tokenContext &\n (TokenContext.expressionStatement |\n TokenContext.forInitHead |\n TokenContext.forInHead)\n ) {\n return true;\n }\n return Boolean(tokenContext & TokenContext.forOfHead);\n }\n\n // ECMAScript specifically forbids a for-of loop from starting with the\n // token sequence `for (async of`, because it would be ambiguous with\n // `for (async of => {};;)`, so we need to add extra parentheses.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AK,EAAE;EAAM,CAAC,CAAC;AAE1D","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/node/whitespace.js b/node_modules/@babel/generator/lib/node/whitespace.js new file mode 100644 index 0000000..76ffaf6 --- /dev/null +++ b/node_modules/@babel/generator/lib/node/whitespace.js @@ -0,0 +1,156 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.nodes = void 0; +var _t = require("@babel/types"); +const { + FLIPPED_ALIAS_KEYS, + isArrayExpression, + isAssignmentExpression, + isBinary, + isBlockStatement, + isCallExpression, + isFunction, + isIdentifier, + isLiteral, + isMemberExpression, + isObjectExpression, + isOptionalCallExpression, + isOptionalMemberExpression, + isStringLiteral +} = _t; +function crawlInternal(node, state) { + if (!node) return state; + if (isMemberExpression(node) || isOptionalMemberExpression(node)) { + crawlInternal(node.object, state); + if (node.computed) crawlInternal(node.property, state); + } else if (isBinary(node) || isAssignmentExpression(node)) { + crawlInternal(node.left, state); + crawlInternal(node.right, state); + } else if (isCallExpression(node) || isOptionalCallExpression(node)) { + state.hasCall = true; + crawlInternal(node.callee, state); + } else if (isFunction(node)) { + state.hasFunction = true; + } else if (isIdentifier(node)) { + state.hasHelper = state.hasHelper || node.callee && isHelper(node.callee); + } + return state; +} +function crawl(node) { + return crawlInternal(node, { + hasCall: false, + hasFunction: false, + hasHelper: false + }); +} +function isHelper(node) { + if (!node) return false; + if (isMemberExpression(node)) { + return isHelper(node.object) || isHelper(node.property); + } else if (isIdentifier(node)) { + return node.name === "require" || node.name.charCodeAt(0) === 95; + } else if (isCallExpression(node)) { + return isHelper(node.callee); + } else if (isBinary(node) || isAssignmentExpression(node)) { + return isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); + } else { + return false; + } +} +function isType(node) { + return isLiteral(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier(node) || isMemberExpression(node); +} +const nodes = exports.nodes = { + AssignmentExpression(node) { + const state = crawl(node.right); + if (state.hasCall && state.hasHelper || state.hasFunction) { + return state.hasFunction ? 1 | 2 : 2; + } + return 0; + }, + SwitchCase(node, parent) { + return (!!node.consequent.length || parent.cases[0] === node ? 1 : 0) | (!node.consequent.length && parent.cases[parent.cases.length - 1] === node ? 2 : 0); + }, + LogicalExpression(node) { + if (isFunction(node.left) || isFunction(node.right)) { + return 2; + } + return 0; + }, + Literal(node) { + if (isStringLiteral(node) && node.value === "use strict") { + return 2; + } + return 0; + }, + CallExpression(node) { + if (isFunction(node.callee) || isHelper(node)) { + return 1 | 2; + } + return 0; + }, + OptionalCallExpression(node) { + if (isFunction(node.callee)) { + return 1 | 2; + } + return 0; + }, + VariableDeclaration(node) { + for (let i = 0; i < node.declarations.length; i++) { + const declar = node.declarations[i]; + let enabled = isHelper(declar.id) && !isType(declar.init); + if (!enabled && declar.init) { + const state = crawl(declar.init); + enabled = isHelper(declar.init) && state.hasCall || state.hasFunction; + } + if (enabled) { + return 1 | 2; + } + } + return 0; + }, + IfStatement(node) { + if (isBlockStatement(node.consequent)) { + return 1 | 2; + } + return 0; + } +}; +nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) { + if (parent.properties[0] === node) { + return 1; + } + return 0; +}; +nodes.ObjectTypeCallProperty = function (node, parent) { + var _parent$properties; + if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) { + return 1; + } + return 0; +}; +nodes.ObjectTypeIndexer = function (node, parent) { + var _parent$properties2, _parent$callPropertie; + if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) { + return 1; + } + return 0; +}; +nodes.ObjectTypeInternalSlot = function (node, parent) { + var _parent$properties3, _parent$callPropertie2, _parent$indexers; + if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) != null && _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) != null && _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) != null && _parent$indexers.length)) { + return 1; + } + return 0; +}; +[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) { + [type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { + const ret = amounts ? 1 | 2 : 0; + nodes[type] = () => ret; + }); +}); + +//# sourceMappingURL=whitespace.js.map diff --git a/node_modules/@babel/generator/lib/node/whitespace.js.map b/node_modules/@babel/generator/lib/node/whitespace.js.map new file mode 100644 index 0000000..ff8933e --- /dev/null +++ b/node_modules/@babel/generator/lib/node/whitespace.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","FLIPPED_ALIAS_KEYS","isArrayExpression","isAssignmentExpression","isBinary","isBlockStatement","isCallExpression","isFunction","isIdentifier","isLiteral","isMemberExpression","isObjectExpression","isOptionalCallExpression","isOptionalMemberExpression","isStringLiteral","crawlInternal","node","state","object","computed","property","left","right","hasCall","callee","hasFunction","hasHelper","isHelper","crawl","name","charCodeAt","isType","nodes","exports","AssignmentExpression","SwitchCase","parent","consequent","length","cases","LogicalExpression","Literal","value","CallExpression","OptionalCallExpression","VariableDeclaration","i","declarations","declar","enabled","id","init","IfStatement","ObjectProperty","ObjectTypeProperty","ObjectMethod","properties","ObjectTypeCallProperty","_parent$properties","callProperties","ObjectTypeIndexer","_parent$properties2","_parent$callPropertie","indexers","ObjectTypeInternalSlot","_parent$properties3","_parent$callPropertie2","_parent$indexers","internalSlots","forEach","type","amounts","concat","ret"],"sources":["../../src/node/whitespace.ts"],"sourcesContent":["import {\n FLIPPED_ALIAS_KEYS,\n isArrayExpression,\n isAssignmentExpression,\n isBinary,\n isBlockStatement,\n isCallExpression,\n isFunction,\n isIdentifier,\n isLiteral,\n isMemberExpression,\n isObjectExpression,\n isOptionalCallExpression,\n isOptionalMemberExpression,\n isStringLiteral,\n} from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nimport type { NodeHandlers } from \"./index.ts\";\n\nimport type * as t from \"@babel/types\";\n\nconst enum WhitespaceFlag {\n none = 0,\n before = 1 << 0,\n after = 1 << 1,\n}\n\nexport type { WhitespaceFlag };\n\nfunction crawlInternal(\n node: t.Node,\n state: { hasCall: boolean; hasFunction: boolean; hasHelper: boolean },\n) {\n if (!node) return state;\n\n if (isMemberExpression(node) || isOptionalMemberExpression(node)) {\n crawlInternal(node.object, state);\n if (node.computed) crawlInternal(node.property, state);\n } else if (isBinary(node) || isAssignmentExpression(node)) {\n crawlInternal(node.left, state);\n crawlInternal(node.right, state);\n } else if (isCallExpression(node) || isOptionalCallExpression(node)) {\n state.hasCall = true;\n crawlInternal(node.callee, state);\n } else if (isFunction(node)) {\n state.hasFunction = true;\n } else if (isIdentifier(node)) {\n state.hasHelper =\n // @ts-expect-error todo(flow->ts): node.callee is not really expected here…\n state.hasHelper || (node.callee && isHelper(node.callee));\n }\n\n return state;\n}\n\n/**\n * Crawl a node to test if it contains a CallExpression, a Function, or a Helper.\n *\n * @example\n * crawl(node)\n * // { hasCall: false, hasFunction: true, hasHelper: false }\n */\n\nfunction crawl(node: t.Node) {\n return crawlInternal(node, {\n hasCall: false,\n hasFunction: false,\n hasHelper: false,\n });\n}\n\n/**\n * Test if a node is or has a helper.\n */\n\nfunction isHelper(node: t.Node): boolean {\n if (!node) return false;\n\n if (isMemberExpression(node)) {\n return isHelper(node.object) || isHelper(node.property);\n } else if (isIdentifier(node)) {\n return (\n node.name === \"require\" ||\n node.name.charCodeAt(0) === charCodes.underscore\n );\n } else if (isCallExpression(node)) {\n return isHelper(node.callee);\n } else if (isBinary(node) || isAssignmentExpression(node)) {\n return (\n (isIdentifier(node.left) && isHelper(node.left)) || isHelper(node.right)\n );\n } else {\n return false;\n }\n}\n\nfunction isType(node: t.Node | null | undefined) {\n return (\n isLiteral(node) ||\n isObjectExpression(node) ||\n isArrayExpression(node) ||\n isIdentifier(node) ||\n isMemberExpression(node)\n );\n}\n\n/**\n * Tests for node types that need whitespace.\n */\n\nexport const nodes: NodeHandlers = {\n /**\n * Test if AssignmentExpression needs whitespace.\n */\n\n AssignmentExpression(node: t.AssignmentExpression): WhitespaceFlag {\n const state = crawl(node.right);\n if ((state.hasCall && state.hasHelper) || state.hasFunction) {\n return state.hasFunction\n ? WhitespaceFlag.before | WhitespaceFlag.after\n : WhitespaceFlag.after;\n }\n return WhitespaceFlag.none;\n },\n\n /**\n * Test if SwitchCase needs whitespace.\n */\n\n SwitchCase(node: t.SwitchCase, parent: t.SwitchStatement): WhitespaceFlag {\n return (\n (!!node.consequent.length || parent.cases[0] === node\n ? WhitespaceFlag.before\n : WhitespaceFlag.none) |\n (!node.consequent.length && parent.cases[parent.cases.length - 1] === node\n ? WhitespaceFlag.after\n : WhitespaceFlag.none)\n );\n },\n\n /**\n * Test if LogicalExpression needs whitespace.\n */\n\n LogicalExpression(node: t.LogicalExpression): WhitespaceFlag {\n if (isFunction(node.left) || isFunction(node.right)) {\n return WhitespaceFlag.after;\n }\n return WhitespaceFlag.none;\n },\n\n /**\n * Test if Literal needs whitespace.\n */\n\n Literal(node: t.Literal): WhitespaceFlag {\n if (isStringLiteral(node) && node.value === \"use strict\") {\n return WhitespaceFlag.after;\n }\n return WhitespaceFlag.none;\n },\n\n /**\n * Test if CallExpressionish needs whitespace.\n */\n\n CallExpression(node: t.CallExpression): WhitespaceFlag {\n if (isFunction(node.callee) || isHelper(node)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n return WhitespaceFlag.none;\n },\n\n OptionalCallExpression(node: t.OptionalCallExpression): WhitespaceFlag {\n if (isFunction(node.callee)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n return WhitespaceFlag.none;\n },\n\n /**\n * Test if VariableDeclaration needs whitespace.\n */\n\n VariableDeclaration(node: t.VariableDeclaration): WhitespaceFlag {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n\n let enabled = isHelper(declar.id) && !isType(declar.init);\n if (!enabled && declar.init) {\n const state = crawl(declar.init);\n enabled = (isHelper(declar.init) && state.hasCall) || state.hasFunction;\n }\n\n if (enabled) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n }\n return WhitespaceFlag.none;\n },\n\n /**\n * Test if IfStatement needs whitespace.\n */\n\n IfStatement(node: t.IfStatement): WhitespaceFlag {\n if (isBlockStatement(node.consequent)) {\n return WhitespaceFlag.before | WhitespaceFlag.after;\n }\n return WhitespaceFlag.none;\n },\n};\n\n/**\n * Test if Property needs whitespace.\n */\n\nnodes.ObjectProperty =\n nodes.ObjectTypeProperty =\n nodes.ObjectMethod =\n function (\n node: t.ObjectProperty | t.ObjectTypeProperty | t.ObjectMethod,\n parent: t.ObjectExpression,\n ): WhitespaceFlag {\n if (parent.properties[0] === node) {\n return WhitespaceFlag.before;\n }\n return WhitespaceFlag.none;\n };\n\nnodes.ObjectTypeCallProperty = function (\n node: t.ObjectTypeCallProperty,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n // @ts-ignore(Babel 7 vs Babel 8) Difference parent.indexers\n if (parent.callProperties[0] === node && !parent.properties?.length) {\n return WhitespaceFlag.before;\n }\n return WhitespaceFlag.none;\n};\n\nnodes.ObjectTypeIndexer = function (\n node: t.ObjectTypeIndexer,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (\n // @ts-ignore(Babel 7 vs Babel 8) Difference parent.indexers\n parent.indexers[0] === node &&\n !parent.properties?.length &&\n !parent.callProperties?.length\n ) {\n return WhitespaceFlag.before;\n }\n return WhitespaceFlag.none;\n};\n\nnodes.ObjectTypeInternalSlot = function (\n node: t.ObjectTypeInternalSlot,\n parent: t.ObjectTypeAnnotation,\n): WhitespaceFlag {\n if (\n // @ts-ignore(Babel 7 vs Babel 8) Difference parent.indexers\n parent.internalSlots[0] === node &&\n !parent.properties?.length &&\n !parent.callProperties?.length &&\n !parent.indexers?.length\n ) {\n return WhitespaceFlag.before;\n }\n return WhitespaceFlag.none;\n};\n\n/**\n * Add whitespace tests for nodes and their aliases.\n */\n\n(\n [\n [\"Function\", true],\n [\"Class\", true],\n [\"Loop\", true],\n [\"LabeledStatement\", true],\n [\"SwitchStatement\", true],\n [\"TryStatement\", true],\n ] as const\n).forEach(function ([type, amounts]) {\n [type as string]\n .concat(FLIPPED_ALIAS_KEYS[type] || [])\n .forEach(function (type) {\n const ret = amounts ? WhitespaceFlag.before | WhitespaceFlag.after : 0;\n nodes[type] = () => ret;\n });\n});\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAesB;EAdpBC,kBAAkB;EAClBC,iBAAiB;EACjBC,sBAAsB;EACtBC,QAAQ;EACRC,gBAAgB;EAChBC,gBAAgB;EAChBC,UAAU;EACVC,YAAY;EACZC,SAAS;EACTC,kBAAkB;EAClBC,kBAAkB;EAClBC,wBAAwB;EACxBC,0BAA0B;EAC1BC;AAAe,IAAAf,EAAA;AAmBjB,SAASgB,aAAaA,CACpBC,IAAY,EACZC,KAAqE,EACrE;EACA,IAAI,CAACD,IAAI,EAAE,OAAOC,KAAK;EAEvB,IAAIP,kBAAkB,CAACM,IAAI,CAAC,IAAIH,0BAA0B,CAACG,IAAI,CAAC,EAAE;IAChED,aAAa,CAACC,IAAI,CAACE,MAAM,EAAED,KAAK,CAAC;IACjC,IAAID,IAAI,CAACG,QAAQ,EAAEJ,aAAa,CAACC,IAAI,CAACI,QAAQ,EAAEH,KAAK,CAAC;EACxD,CAAC,MAAM,IAAIb,QAAQ,CAACY,IAAI,CAAC,IAAIb,sBAAsB,CAACa,IAAI,CAAC,EAAE;IACzDD,aAAa,CAACC,IAAI,CAACK,IAAI,EAAEJ,KAAK,CAAC;IAC/BF,aAAa,CAACC,IAAI,CAACM,KAAK,EAAEL,KAAK,CAAC;EAClC,CAAC,MAAM,IAAIX,gBAAgB,CAACU,IAAI,CAAC,IAAIJ,wBAAwB,CAACI,IAAI,CAAC,EAAE;IACnEC,KAAK,CAACM,OAAO,GAAG,I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ACA;AACF,CAAC;AAOC,CACE,CAAC,UAAU,EAAE,IAAI,CAAC,EAClB,CAAC,OAAO,EAAE,IAAI,CAAC,EACf,CAAC,MAAM,EAAE,IAAI,CAAC,EACd,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAC1B,CAAC,iBAAiB,EAAE,IAAI,CAAC,EACzB,CAAC,cAAc,EAAE,IAAI,CAAC,CACvB,CACD+B,OAAO,CAAC,UAAU,CAACC,IAAI,EAAEC,OAAO,CAAC,EAAE;EACnC,CAACD,IAAI,CAAW,CACbE,MAAM,CAACvE,kBAAkB,CAACqE,IAAI,CAAC,IAAI,EAAE,CAAC,CACtCD,OAAO,CAAC,UAAUC,IAAI,EAAE;IACvB,MAAMG,GAAG,GAAGF,OAAO,GAAG,KAA4C,GAAG,CAAC;IACtEvC,KAAK,CAACsC,IAAI,CAAC,GAAG,MAAMG,GAAG;EACzB,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/generator/lib/printer.js b/node_modules/@babel/generator/lib/printer.js new file mode 100644 index 0000000..7e1e1e3 --- /dev/null +++ b/node_modules/@babel/generator/lib/printer.js @@ -0,0 +1,780 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _buffer = require("./buffer.js"); +var _index = require("./node/index.js"); +var n = _index; +var _t = require("@babel/types"); +var _tokenMap = require("./token-map.js"); +var generatorFunctions = require("./generators/index.js"); +var _deprecated = require("./generators/deprecated.js"); +const { + isExpression, + isFunction, + isStatement, + isClassBody, + isTSInterfaceBody, + isTSEnumMember +} = _t; +const SCIENTIFIC_NOTATION = /e/i; +const ZERO_DECIMAL_INTEGER = /\.0+$/; +const HAS_NEWLINE = /[\n\r\u2028\u2029]/; +const HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\n\r\u2028\u2029]|\*\//; +function commentIsNewline(c) { + return c.type === "CommentLine" || HAS_NEWLINE.test(c.value); +} +const { + needsParens +} = n; +class Printer { + constructor(format, map, tokens = null, originalCode = null) { + this.tokenContext = _index.TokenContext.normal; + this._tokens = null; + this._originalCode = null; + this._currentNode = null; + this._indent = 0; + this._indentRepeat = 0; + this._insideAux = false; + this._noLineTerminator = false; + this._noLineTerminatorAfterNode = null; + this._printAuxAfterOnNextUserNode = false; + this._printedComments = new Set(); + this._endsWithInteger = false; + this._endsWithWord = false; + this._endsWithDiv = false; + this._lastCommentLine = 0; + this._endsWithInnerRaw = false; + this._indentInnerComments = true; + this.tokenMap = null; + this._boundGetRawIdentifier = this._getRawIdentifier.bind(this); + this._printSemicolonBeforeNextNode = -1; + this._printSemicolonBeforeNextToken = -1; + this.format = format; + this._tokens = tokens; + this._originalCode = originalCode; + this._indentRepeat = format.indent.style.length; + this._inputMap = (map == null ? void 0 : map._inputMap) || null; + this._buf = new _buffer.default(map, format.indent.style[0]); + } + enterForStatementInit() { + this.tokenContext |= _index.TokenContext.forInitHead | _index.TokenContext.forInOrInitHeadAccumulate; + return () => this.tokenContext = _index.TokenContext.normal; + } + enterForXStatementInit(isForOf) { + if (isForOf) { + this.tokenContext |= _index.TokenContext.forOfHead; + return null; + } else { + this.tokenContext |= _index.TokenContext.forInHead | _index.TokenContext.forInOrInitHeadAccumulate; + return () => this.tokenContext = _index.TokenContext.normal; + } + } + enterDelimited() { + const oldTokenContext = this.tokenContext; + const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode; + if (!(oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) && oldNoLineTerminatorAfterNode === null) { + return () => {}; + } + this._noLineTerminatorAfterNode = null; + this.tokenContext = _index.TokenContext.normal; + return () => { + this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode; + this.tokenContext = oldTokenContext; + }; + } + generate(ast) { + if (this.format.preserveFormat) { + this.tokenMap = new _tokenMap.TokenMap(ast, this._tokens, this._originalCode); + } + this.print(ast); + this._maybeAddAuxComment(); + return this._buf.get(); + } + indent() { + const { + format + } = this; + if (format.preserveFormat || format.compact || format.concise) { + return; + } + this._indent++; + } + dedent() { + const { + format + } = this; + if (format.preserveFormat || format.compact || format.concise) { + return; + } + this._indent--; + } + semicolon(force = false) { + this._maybeAddAuxComment(); + if (force) { + this._appendChar(59); + this._noLineTerminator = false; + return; + } + if (this.tokenMap) { + const node = this._currentNode; + if (node.start != null && node.end != null) { + if (!this.tokenMap.endMatches(node, ";")) { + this._printSemicolonBeforeNextNode = this._buf.getCurrentLine(); + return; + } + const indexes = this.tokenMap.getIndexes(this._currentNode); + this._catchUpTo(this._tokens[indexes[indexes.length - 1]].loc.start); + } + } + this._queue(59); + this._noLineTerminator = false; + } + rightBrace(node) { + if (this.format.minified) { + this._buf.removeLastSemicolon(); + } + this.sourceWithOffset("end", node.loc, -1); + this.tokenChar(125); + } + rightParens(node) { + this.sourceWithOffset("end", node.loc, -1); + this.tokenChar(41); + } + space(force = false) { + const { + format + } = this; + if (format.compact || format.preserveFormat) return; + if (force) { + this._space(); + } else if (this._buf.hasContent()) { + const lastCp = this.getLastChar(); + if (lastCp !== 32 && lastCp !== 10) { + this._space(); + } + } + } + word(str, noLineTerminatorAfter = false) { + this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask; + this._maybePrintInnerComments(str); + this._maybeAddAuxComment(); + if (this.tokenMap) this._catchUpToCurrentToken(str); + if (this._endsWithWord || this._endsWithDiv && str.charCodeAt(0) === 47) { + this._space(); + } + this._append(str, false); + this._endsWithWord = true; + this._noLineTerminator = noLineTerminatorAfter; + } + number(str, number) { + function isNonDecimalLiteral(str) { + if (str.length > 2 && str.charCodeAt(0) === 48) { + const secondChar = str.charCodeAt(1); + return secondChar === 98 || secondChar === 111 || secondChar === 120; + } + return false; + } + this.word(str); + this._endsWithInteger = Number.isInteger(number) && !isNonDecimalLiteral(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46; + } + token(str, maybeNewline = false, occurrenceCount = 0) { + this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask; + this._maybePrintInnerComments(str, occurrenceCount); + this._maybeAddAuxComment(); + if (this.tokenMap) this._catchUpToCurrentToken(str, occurrenceCount); + const lastChar = this.getLastChar(); + const strFirst = str.charCodeAt(0); + if (lastChar === 33 && (str === "--" || strFirst === 61) || strFirst === 43 && lastChar === 43 || strFirst === 45 && lastChar === 45 || strFirst === 46 && this._endsWithInteger) { + this._space(); + } + this._append(str, maybeNewline); + this._noLineTerminator = false; + } + tokenChar(char) { + this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask; + const str = String.fromCharCode(char); + this._maybePrintInnerComments(str); + this._maybeAddAuxComment(); + if (this.tokenMap) this._catchUpToCurrentToken(str); + const lastChar = this.getLastChar(); + if (char === 43 && lastChar === 43 || char === 45 && lastChar === 45 || char === 46 && this._endsWithInteger) { + this._space(); + } + this._appendChar(char); + this._noLineTerminator = false; + } + newline(i = 1, force) { + if (i <= 0) return; + if (!force) { + if (this.format.retainLines || this.format.compact) return; + if (this.format.concise) { + this.space(); + return; + } + } + if (i > 2) i = 2; + i -= this._buf.getNewlineCount(); + for (let j = 0; j < i; j++) { + this._newline(); + } + return; + } + endsWith(char) { + return this.getLastChar() === char; + } + getLastChar() { + return this._buf.getLastChar(); + } + endsWithCharAndNewline() { + return this._buf.endsWithCharAndNewline(); + } + removeTrailingNewline() { + this._buf.removeTrailingNewline(); + } + exactSource(loc, cb) { + if (!loc) { + cb(); + return; + } + this._catchUp("start", loc); + this._buf.exactSource(loc, cb); + } + source(prop, loc) { + if (!loc) return; + this._catchUp(prop, loc); + this._buf.source(prop, loc); + } + sourceWithOffset(prop, loc, columnOffset) { + if (!loc || this.format.preserveFormat) return; + this._catchUp(prop, loc); + this._buf.sourceWithOffset(prop, loc, columnOffset); + } + sourceIdentifierName(identifierName, pos) { + if (!this._buf._canMarkIdName) return; + const sourcePosition = this._buf._sourcePosition; + sourcePosition.identifierNamePos = pos; + sourcePosition.identifierName = identifierName; + } + _space() { + this._queue(32); + } + _newline() { + this._queue(10); + } + _catchUpToCurrentToken(str, occurrenceCount = 0) { + const token = this.tokenMap.findMatching(this._currentNode, str, occurrenceCount); + if (token) this._catchUpTo(token.loc.start); + if (this._printSemicolonBeforeNextToken !== -1 && this._printSemicolonBeforeNextToken === this._buf.getCurrentLine()) { + this._buf.appendChar(59); + this._endsWithWord = false; + this._endsWithInteger = false; + this._endsWithDiv = false; + } + this._printSemicolonBeforeNextToken = -1; + this._printSemicolonBeforeNextNode = -1; + } + _append(str, maybeNewline) { + this._maybeIndent(str.charCodeAt(0)); + this._buf.append(str, maybeNewline); + this._endsWithWord = false; + this._endsWithInteger = false; + this._endsWithDiv = false; + } + _appendChar(char) { + this._maybeIndent(char); + this._buf.appendChar(char); + this._endsWithWord = false; + this._endsWithInteger = false; + this._endsWithDiv = false; + } + _queue(char) { + this._maybeIndent(char); + this._buf.queue(char); + this._endsWithWord = false; + this._endsWithInteger = false; + } + _maybeIndent(firstChar) { + if (this._indent && firstChar !== 10 && this.endsWith(10)) { + this._buf.queueIndentation(this._getIndent()); + } + } + _shouldIndent(firstChar) { + if (this._indent && firstChar !== 10 && this.endsWith(10)) { + return true; + } + } + catchUp(line) { + if (!this.format.retainLines) return; + const count = line - this._buf.getCurrentLine(); + for (let i = 0; i < count; i++) { + this._newline(); + } + } + _catchUp(prop, loc) { + const { + format + } = this; + if (!format.preserveFormat) { + if (format.retainLines && loc != null && loc[prop]) { + this.catchUp(loc[prop].line); + } + return; + } + const pos = loc == null ? void 0 : loc[prop]; + if (pos != null) this._catchUpTo(pos); + } + _catchUpTo({ + line, + column, + index + }) { + const count = line - this._buf.getCurrentLine(); + if (count > 0 && this._noLineTerminator) { + return; + } + for (let i = 0; i < count; i++) { + this._newline(); + } + const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn(); + if (spacesCount > 0) { + const spaces = this._originalCode ? this._originalCode.slice(index - spacesCount, index).replace(/[^\t\x0B\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]/gu, " ") : " ".repeat(spacesCount); + this._append(spaces, false); + } + } + _getIndent() { + return this._indentRepeat * this._indent; + } + printTerminatorless(node) { + this._noLineTerminator = true; + this.print(node); + } + print(node, noLineTerminatorAfter = false, trailingCommentsLineOffset) { + var _node$extra, _node$leadingComments, _node$leadingComments2; + if (!node) return; + this._endsWithInnerRaw = false; + const nodeType = node.type; + const format = this.format; + const oldConcise = format.concise; + if (node._compact) { + format.concise = true; + } + const printMethod = this[nodeType]; + if (printMethod === undefined) { + throw new ReferenceError(`unknown node of type ${JSON.stringify(nodeType)} with constructor ${JSON.stringify(node.constructor.name)}`); + } + const parent = this._currentNode; + this._currentNode = node; + if (this.tokenMap) { + this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode; + } + const oldInAux = this._insideAux; + this._insideAux = node.loc == null; + this._maybeAddAuxComment(this._insideAux && !oldInAux); + const parenthesized = (_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized; + let shouldPrintParens = parenthesized && format.preserveFormat || parenthesized && format.retainFunctionParens && nodeType === "FunctionExpression" || needsParens(node, parent, this.tokenContext, format.preserveFormat ? this._boundGetRawIdentifier : undefined); + if (!shouldPrintParens && parenthesized && (_node$leadingComments = node.leadingComments) != null && _node$leadingComments.length && node.leadingComments[0].type === "CommentBlock") { + const parentType = parent == null ? void 0 : parent.type; + switch (parentType) { + case "ExpressionStatement": + case "VariableDeclarator": + case "AssignmentExpression": + case "ReturnStatement": + break; + case "CallExpression": + case "OptionalCallExpression": + case "NewExpression": + if (parent.callee !== node) break; + default: + shouldPrintParens = true; + } + } + let indentParenthesized = false; + if (!shouldPrintParens && this._noLineTerminator && ((_node$leadingComments2 = node.leadingComments) != null && _node$leadingComments2.some(commentIsNewline) || this.format.retainLines && node.loc && node.loc.start.line > this._buf.getCurrentLine())) { + shouldPrintParens = true; + indentParenthesized = true; + } + let oldNoLineTerminatorAfterNode; + let oldTokenContext; + if (!shouldPrintParens) { + noLineTerminatorAfter || (noLineTerminatorAfter = !!parent && this._noLineTerminatorAfterNode === parent && n.isLastChild(parent, node)); + if (noLineTerminatorAfter) { + var _node$trailingComment; + if ((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.some(commentIsNewline)) { + if (isExpression(node)) shouldPrintParens = true; + } else { + oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode; + this._noLineTerminatorAfterNode = node; + } + } + } + if (shouldPrintParens) { + this.tokenChar(40); + if (indentParenthesized) this.indent(); + this._endsWithInnerRaw = false; + if (this.tokenContext & _index.TokenContext.forInOrInitHeadAccumulate) { + oldTokenContext = this.tokenContext; + this.tokenContext = _index.TokenContext.normal; + } + oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode; + this._noLineTerminatorAfterNode = null; + } + this._lastCommentLine = 0; + this._printLeadingComments(node, parent); + const loc = nodeType === "Program" || nodeType === "File" ? null : node.loc; + this.exactSource(loc, printMethod.bind(this, node, parent)); + if (shouldPrintParens) { + this._printTrailingComments(node, parent); + if (indentParenthesized) { + this.dedent(); + this.newline(); + } + this.tokenChar(41); + this._noLineTerminator = noLineTerminatorAfter; + if (oldTokenContext) this.tokenContext = oldTokenContext; + } else if (noLineTerminatorAfter && !this._noLineTerminator) { + this._noLineTerminator = true; + this._printTrailingComments(node, parent); + } else { + this._printTrailingComments(node, parent, trailingCommentsLineOffset); + } + this._currentNode = parent; + format.concise = oldConcise; + this._insideAux = oldInAux; + if (oldNoLineTerminatorAfterNode !== undefined) { + this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode; + } + this._endsWithInnerRaw = false; + } + _maybeAddAuxComment(enteredPositionlessNode) { + if (enteredPositionlessNode) this._printAuxBeforeComment(); + if (!this._insideAux) this._printAuxAfterComment(); + } + _printAuxBeforeComment() { + if (this._printAuxAfterOnNextUserNode) return; + this._printAuxAfterOnNextUserNode = true; + const comment = this.format.auxiliaryCommentBefore; + if (comment) { + this._printComment({ + type: "CommentBlock", + value: comment + }, 0); + } + } + _printAuxAfterComment() { + if (!this._printAuxAfterOnNextUserNode) return; + this._printAuxAfterOnNextUserNode = false; + const comment = this.format.auxiliaryCommentAfter; + if (comment) { + this._printComment({ + type: "CommentBlock", + value: comment + }, 0); + } + } + getPossibleRaw(node) { + const extra = node.extra; + if ((extra == null ? void 0 : extra.raw) != null && extra.rawValue != null && node.value === extra.rawValue) { + return extra.raw; + } + } + printJoin(nodes, statement, indent, separator, printTrailingSeparator, iterator, trailingCommentsLineOffset) { + if (!(nodes != null && nodes.length)) return; + if (indent == null && this.format.retainLines) { + var _nodes$0$loc; + const startLine = (_nodes$0$loc = nodes[0].loc) == null ? void 0 : _nodes$0$loc.start.line; + if (startLine != null && startLine !== this._buf.getCurrentLine()) { + indent = true; + } + } + if (indent) this.indent(); + const newlineOpts = { + nextNodeStartLine: 0 + }; + const boundSeparator = separator == null ? void 0 : separator.bind(this); + const len = nodes.length; + for (let i = 0; i < len; i++) { + const node = nodes[i]; + if (!node) continue; + if (statement) this._printNewline(i === 0, newlineOpts); + this.print(node, undefined, trailingCommentsLineOffset || 0); + iterator == null || iterator(node, i); + if (boundSeparator != null) { + if (i < len - 1) boundSeparator(i, false);else if (printTrailingSeparator) boundSeparator(i, true); + } + if (statement) { + var _node$trailingComment2; + if (!((_node$trailingComment2 = node.trailingComments) != null && _node$trailingComment2.length)) { + this._lastCommentLine = 0; + } + if (i + 1 === len) { + this.newline(1); + } else { + var _nextNode$loc; + const nextNode = nodes[i + 1]; + newlineOpts.nextNodeStartLine = ((_nextNode$loc = nextNode.loc) == null ? void 0 : _nextNode$loc.start.line) || 0; + this._printNewline(true, newlineOpts); + } + } + } + if (indent) this.dedent(); + } + printAndIndentOnComments(node) { + const indent = node.leadingComments && node.leadingComments.length > 0; + if (indent) this.indent(); + this.print(node); + if (indent) this.dedent(); + } + printBlock(parent) { + const node = parent.body; + if (node.type !== "EmptyStatement") { + this.space(); + } + this.print(node); + } + _printTrailingComments(node, parent, lineOffset) { + const { + innerComments, + trailingComments + } = node; + if (innerComments != null && innerComments.length) { + this._printComments(2, innerComments, node, parent, lineOffset); + } + if (trailingComments != null && trailingComments.length) { + this._printComments(2, trailingComments, node, parent, lineOffset); + } + } + _printLeadingComments(node, parent) { + const comments = node.leadingComments; + if (!(comments != null && comments.length)) return; + this._printComments(0, comments, node, parent); + } + _maybePrintInnerComments(nextTokenStr, nextTokenOccurrenceCount) { + if (this._endsWithInnerRaw) { + var _this$tokenMap; + this.printInnerComments((_this$tokenMap = this.tokenMap) == null ? void 0 : _this$tokenMap.findMatching(this._currentNode, nextTokenStr, nextTokenOccurrenceCount)); + } + this._endsWithInnerRaw = true; + this._indentInnerComments = true; + } + printInnerComments(nextToken) { + const node = this._currentNode; + const comments = node.innerComments; + if (!(comments != null && comments.length)) return; + const hasSpace = this.endsWith(32); + const indent = this._indentInnerComments; + const printedCommentsCount = this._printedComments.size; + if (indent) this.indent(); + this._printComments(1, comments, node, undefined, undefined, nextToken); + if (hasSpace && printedCommentsCount !== this._printedComments.size) { + this.space(); + } + if (indent) this.dedent(); + } + noIndentInnerCommentsHere() { + this._indentInnerComments = false; + } + printSequence(nodes, indent, trailingCommentsLineOffset) { + this.printJoin(nodes, true, indent != null ? indent : false, undefined, undefined, undefined, trailingCommentsLineOffset); + } + printList(items, printTrailingSeparator, statement, indent, separator, iterator) { + this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, iterator); + } + shouldPrintTrailingComma(listEnd) { + if (!this.tokenMap) return null; + const listEndIndex = this.tokenMap.findLastIndex(this._currentNode, token => this.tokenMap.matchesOriginal(token, listEnd)); + if (listEndIndex <= 0) return null; + return this.tokenMap.matchesOriginal(this._tokens[listEndIndex - 1], ","); + } + _printNewline(newLine, opts) { + const format = this.format; + if (format.retainLines || format.compact) return; + if (format.concise) { + this.space(); + return; + } + if (!newLine) { + return; + } + const startLine = opts.nextNodeStartLine; + const lastCommentLine = this._lastCommentLine; + if (startLine > 0 && lastCommentLine > 0) { + const offset = startLine - lastCommentLine; + if (offset >= 0) { + this.newline(offset || 1); + return; + } + } + if (this._buf.hasContent()) { + this.newline(1); + } + } + _shouldPrintComment(comment, nextToken) { + if (comment.ignore) return 0; + if (this._printedComments.has(comment)) return 0; + if (this._noLineTerminator && HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)) { + return 2; + } + if (nextToken && this.tokenMap) { + const commentTok = this.tokenMap.find(this._currentNode, token => token.value === comment.value); + if (commentTok && commentTok.start > nextToken.start) { + return 2; + } + } + this._printedComments.add(comment); + if (!this.format.shouldPrintComment(comment.value)) { + return 0; + } + return 1; + } + _printComment(comment, skipNewLines) { + const noLineTerminator = this._noLineTerminator; + const isBlockComment = comment.type === "CommentBlock"; + const printNewLines = isBlockComment && skipNewLines !== 1 && !this._noLineTerminator; + if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) { + this.newline(1); + } + const lastCharCode = this.getLastChar(); + if (lastCharCode !== 91 && lastCharCode !== 123 && lastCharCode !== 40) { + this.space(); + } + let val; + if (isBlockComment) { + val = `/*${comment.value}*/`; + if (this.format.indent.adjustMultilineComment) { + var _comment$loc; + const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column; + if (offset) { + const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); + val = val.replace(newlineRegex, "\n"); + } + if (this.format.concise) { + val = val.replace(/\n(?!$)/g, `\n`); + } else { + let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn(); + if (this._shouldIndent(47) || this.format.retainLines) { + indentSize += this._getIndent(); + } + val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`); + } + } + } else if (!noLineTerminator) { + val = `//${comment.value}`; + } else { + val = `/*${comment.value}*/`; + } + if (this._endsWithDiv) this._space(); + if (this.tokenMap) { + const { + _printSemicolonBeforeNextToken, + _printSemicolonBeforeNextNode + } = this; + this._printSemicolonBeforeNextToken = -1; + this._printSemicolonBeforeNextNode = -1; + this.source("start", comment.loc); + this._append(val, isBlockComment); + this._printSemicolonBeforeNextNode = _printSemicolonBeforeNextNode; + this._printSemicolonBeforeNextToken = _printSemicolonBeforeNextToken; + } else { + this.source("start", comment.loc); + this._append(val, isBlockComment); + } + if (!isBlockComment && !noLineTerminator) { + this.newline(1, true); + } + if (printNewLines && skipNewLines !== 3) { + this.newline(1); + } + } + _printComments(type, comments, node, parent, lineOffset = 0, nextToken) { + const nodeLoc = node.loc; + const len = comments.length; + let hasLoc = !!nodeLoc; + const nodeStartLine = hasLoc ? nodeLoc.start.line : 0; + const nodeEndLine = hasLoc ? nodeLoc.end.line : 0; + let lastLine = 0; + let leadingCommentNewline = 0; + const maybeNewline = this._noLineTerminator ? function () {} : this.newline.bind(this); + for (let i = 0; i < len; i++) { + const comment = comments[i]; + const shouldPrint = this._shouldPrintComment(comment, nextToken); + if (shouldPrint === 2) { + hasLoc = false; + break; + } + if (hasLoc && comment.loc && shouldPrint === 1) { + const commentStartLine = comment.loc.start.line; + const commentEndLine = comment.loc.end.line; + if (type === 0) { + let offset = 0; + if (i === 0) { + if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine !== commentEndLine)) { + offset = leadingCommentNewline = 1; + } + } else { + offset = commentStartLine - lastLine; + } + lastLine = commentEndLine; + maybeNewline(offset); + this._printComment(comment, 1); + if (i + 1 === len) { + maybeNewline(Math.max(nodeStartLine - lastLine, leadingCommentNewline)); + lastLine = nodeStartLine; + } + } else if (type === 1) { + const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine); + lastLine = commentEndLine; + maybeNewline(offset); + this._printComment(comment, 1); + if (i + 1 === len) { + maybeNewline(Math.min(1, nodeEndLine - lastLine)); + lastLine = nodeEndLine; + } + } else { + const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine); + lastLine = commentEndLine; + maybeNewline(offset); + this._printComment(comment, 1); + } + } else { + hasLoc = false; + if (shouldPrint !== 1) { + continue; + } + if (len === 1) { + const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value); + const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumMember(node); + if (type === 0) { + this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent, { + body: node + }) ? 1 : 0); + } else if (shouldSkipNewline && type === 2) { + this._printComment(comment, 1); + } else { + this._printComment(comment, 0); + } + } else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") { + this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0); + } else { + this._printComment(comment, 0); + } + } + } + if (type === 2 && hasLoc && lastLine) { + this._lastCommentLine = lastLine; + } + } +} +Object.assign(Printer.prototype, generatorFunctions); +{ + (0, _deprecated.addDeprecatedGenerators)(Printer); +} +var _default = exports.default = Printer; +function commaSeparator(occurrenceCount, last) { + this.token(",", false, occurrenceCount); + if (!last) this.space(); +} + +//# sourceMappingURL=printer.js.map diff --git a/node_modules/@babel/generator/lib/printer.js.map b/node_modules/@babel/generator/lib/printer.js.map new file mode 100644 index 0000000..8bc90bd --- /dev/null +++ b/node_modules/@babel/generator/lib/printer.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_buffer","require","_index","n","_t","_tokenMap","generatorFunctions","_deprecated","isExpression","isFunction","isStatement","isClassBody","isTSInterfaceBody","isTSEnumMember","SCIENTIFIC_NOTATION","ZERO_DECIMAL_INTEGER","HAS_NEWLINE","HAS_NEWLINE_OR_BlOCK_COMMENT_END","commentIsNewline","c","type","test","value","needsParens","Printer","constructor","format","map","tokens","originalCode","tokenContext","TokenContext","normal","_tokens","_originalCode","_currentNode","_indent","_indentRepeat","_insideAux","_noLineTerminator","_noLineTerminatorAfterNode","_printAuxAfterOnNextUserNode","_printedComments","Set","_endsWithInteger","_endsWithWord","_endsWithDiv","_lastCommentLine","_endsWithInnerRaw","_indentInnerComments","tokenMap","_boundGetRawIdentifier","_getRawIdentifier","bind","_printSemicolonBeforeNextNode","_printSemicolonBeforeNextToken","indent","style","length","_inputMap","_buf","Buffer","enterForStatementInit","forInitHead","forInOrInitHeadAccumulate","enterForXStatementInit","isForOf","forOfHead","forInHead","enterDelimited","oldTokenContext","oldNoLineTerminatorAfterNode","generate","ast","preserveFormat","TokenMap","print","_maybeAddAuxComment","get","compact","concise","dedent","semicolon","force","_appendChar","node","start","end","endMatches","getCurrentLine","indexes","getIndexes","_catchUpTo","loc","_queue","rightBrace","minified","removeLastSemicolon","sourceWithOffset","token","rightParens","space","_space","hasContent","lastCp","getLastChar","word","str","noLineTerminatorAfter","forInOrInitHeadAccumulatePassThroughMask","_maybePrintInnerComments","_catchUpToCurrentToken","charCodeAt","_append","number","isNonDecimalLiteral","secondChar","Number","isInteger","maybeNewline","occurrenceCount","lastChar","strFirst","tokenChar","char","String","fromCharCode","newline","i","retainLines","getNewlineCount","j","_newline","endsWith","endsWithCharAndNewline","removeTrailingNewline","exactSource","cb","_catchUp","source","prop","columnOffset","sourceIdentifierName","identifierName","pos","_canMarkIdName","sourcePosition","_sourcePosition","identifierNamePos","findMatching","appendChar","_maybeIndent","append","queue","firstChar","queueIndentation","_getIndent","_shouldIndent","catchUp","line","count","column","index","spacesCount","getCurrentColumn","spaces","slice","replace","repeat","printTerminatorless","trailingCommentsLineOffset","_node$extra","_node$leadingComments","_node$leadingComments2","nodeType","oldConcise","_compact","printMethod","undefined","ReferenceError","JSON","stringify","name","parent","oldInAux","parenthesized","extra","shouldPrintParens","retainFunctionParens","leadingComments","parentType","callee","indentParenthesized","some","isLastChild","_node$trailingComment","trailingComments","_printLeadingComments","_printTrailingComments","enteredPositionlessNode","_printAuxBeforeComment","_printAuxAfterComment","comment","auxiliaryCommentBefore","_printComment","auxiliaryCommentAfter","getPossibleRaw","raw","rawValue","printJoin","nodes","statement","separator","printTrailingSeparator","iterator","_nodes$0$loc","startLine","newlineOpts","nextNodeStartLine","boundSeparator","len","_printNewline","_node$trailingComment2","_nextNode$loc","nextNode","printAndIndentOnComments","printBlock","body","lineOffset","innerComments","_printComments","comments","nextTokenStr","nextTokenOccurrenceCount","_this$tokenMap","printInnerComments","nextToken","hasSpace","printedCommentsCount","size","noIndentInnerCommentsHere","printSequence","printList","items","commaSeparator","shouldPrintTrailingComma","listEnd","listEndIndex","findLastIndex","matchesOriginal","newLine","opts","lastCommentLine","offset","_shouldPrintComment","ignore","has","commentTok","find","add","shouldPrintComment","skipNewLines","noLineTerminator","isBlockComment","printNewLines","lastCharCode","val","adjustMultilineComment","_comment$loc","newlineRegex","RegExp","indentSize","nodeLoc","hasLoc","nodeStartLine","nodeEndLine","lastLine","leadingCommentNewline","shouldPrint","commentStartLine","commentEndLine","Math","max","min","singleLine","shouldSkipNewline","properties","Object","assign","prototype","addDeprecatedGenerators","_default","exports","default","last"],"sources":["../src/printer.ts"],"sourcesContent":["import Buffer, { type Pos } from \"./buffer.ts\";\nimport type { Loc } from \"./buffer.ts\";\nimport * as n from \"./node/index.ts\";\nimport type * as t from \"@babel/types\";\nimport {\n isExpression,\n isFunction,\n isStatement,\n isClassBody,\n isTSInterfaceBody,\n isTSEnumMember,\n} from \"@babel/types\";\nimport type { Opts as jsescOptions } from \"jsesc\";\n\nimport { TokenMap } from \"./token-map.ts\";\nimport type { GeneratorOptions } from \"./index.ts\";\nimport * as generatorFunctions from \"./generators/index.ts\";\nimport {\n addDeprecatedGenerators,\n type DeprecatedBabel7ASTTypes,\n} from \"./generators/deprecated.ts\";\nimport type SourceMap from \"./source-map.ts\";\nimport type { TraceMap } from \"@jridgewell/trace-mapping\";\nimport type { Token } from \"@babel/parser\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nconst SCIENTIFIC_NOTATION = /e/i;\nconst ZERO_DECIMAL_INTEGER = /\\.0+$/;\nconst HAS_NEWLINE = /[\\n\\r\\u2028\\u2029]/;\nconst HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\\n\\r\\u2028\\u2029]|\\*\\//;\n\nfunction commentIsNewline(c: t.Comment) {\n return c.type === \"CommentLine\" || HAS_NEWLINE.test(c.value);\n}\n\nconst { needsParens } = n;\n\nimport { TokenContext } from \"./node/index.ts\";\n\nconst enum COMMENT_TYPE {\n LEADING,\n INNER,\n TRAILING,\n}\n\nconst enum COMMENT_SKIP_NEWLINE {\n DEFAULT,\n ALL,\n LEADING,\n TRAILING,\n}\n\nconst enum PRINT_COMMENT_HINT {\n SKIP,\n ALLOW,\n DEFER,\n}\n\nexport type Format = {\n shouldPrintComment: (comment: string) => boolean;\n preserveFormat: boolean | undefined;\n retainLines: boolean | undefined;\n retainFunctionParens: boolean | undefined;\n comments: boolean | undefined;\n auxiliaryCommentBefore: string | undefined;\n auxiliaryCommentAfter: string | undefined;\n compact: boolean | \"auto\" | undefined;\n minified: boolean | undefined;\n concise: boolean | undefined;\n indent: {\n adjustMultilineComment: boolean;\n style: string;\n };\n /**\n * @deprecated Removed in Babel 8, syntax type is always 'hash'\n */\n recordAndTupleSyntaxType?: GeneratorOptions[\"recordAndTupleSyntaxType\"];\n jsescOption: jsescOptions;\n /**\n * @deprecated Removed in Babel 8, use `jsescOption` instead\n */\n jsonCompatibleStrings?: boolean;\n /**\n * For use with the Hack-style pipe operator.\n * Changes what token is used for pipe bodies’ topic references.\n */\n topicToken?: GeneratorOptions[\"topicToken\"];\n /**\n * @deprecated Removed in Babel 8\n */\n decoratorsBeforeExport?: boolean;\n /**\n * The import attributes syntax style:\n * - \"with\" : `import { a } from \"b\" with { type: \"json\" };`\n * - \"assert\" : `import { a } from \"b\" assert { type: \"json\" };`\n * - \"with-legacy\" : `import { a } from \"b\" with type: \"json\";`\n */\n importAttributesKeyword?: \"with\" | \"assert\" | \"with-legacy\";\n};\n\ninterface AddNewlinesOptions {\n nextNodeStartLine: number;\n}\n\ninterface PrintSequenceOptions extends Partial {\n statement?: boolean;\n indent?: boolean;\n trailingCommentsLineOffset?: number;\n}\n\ninterface PrintListOptions {\n separator?: (this: Printer, occurrenceCount: number, last: boolean) => void;\n iterator?: (node: t.Node, index: number) => void;\n statement?: boolean;\n indent?: boolean;\n printTrailingSeparator?: boolean;\n}\n\nexport type PrintJoinOptions = PrintListOptions & PrintSequenceOptions;\nclass Printer {\n constructor(\n format: Format,\n map: SourceMap | null,\n tokens: Token[] | null = null,\n originalCode: string | null = null,\n ) {\n this.format = format;\n\n this._tokens = tokens;\n this._originalCode = originalCode;\n\n this._indentRepeat = format.indent.style.length;\n\n this._inputMap = map?._inputMap || null;\n\n this._buf = new Buffer(map, format.indent.style[0]);\n }\n declare _inputMap: TraceMap | null;\n\n declare format: Format;\n\n enterForStatementInit() {\n this.tokenContext |=\n TokenContext.forInitHead | TokenContext.forInOrInitHeadAccumulate;\n return () => (this.tokenContext = TokenContext.normal);\n }\n\n enterForXStatementInit(isForOf: boolean) {\n if (isForOf) {\n this.tokenContext |= TokenContext.forOfHead;\n return null;\n } else {\n this.tokenContext |=\n TokenContext.forInHead | TokenContext.forInOrInitHeadAccumulate;\n return () => (this.tokenContext = TokenContext.normal);\n }\n }\n\n enterDelimited() {\n const oldTokenContext = this.tokenContext;\n const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode;\n if (\n !(oldTokenContext & TokenContext.forInOrInitHeadAccumulate) &&\n oldNoLineTerminatorAfterNode === null\n ) {\n return () => {};\n }\n this._noLineTerminatorAfterNode = null;\n this.tokenContext = TokenContext.normal;\n return () => {\n this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode;\n this.tokenContext = oldTokenContext;\n };\n }\n\n tokenContext: number = TokenContext.normal;\n\n _tokens: Token[] | null = null;\n _originalCode: string | null = null;\n\n declare _buf: Buffer;\n _currentNode: t.Node | null = null;\n _indent: number = 0;\n _indentRepeat: number = 0;\n _insideAux: boolean = false;\n _noLineTerminator: boolean = false;\n _noLineTerminatorAfterNode: t.Node | null = null;\n _printAuxAfterOnNextUserNode: boolean = false;\n _printedComments = new Set();\n _endsWithInteger = false;\n _endsWithWord = false;\n _endsWithDiv = false;\n _lastCommentLine = 0;\n _endsWithInnerRaw: boolean = false;\n _indentInnerComments: boolean = true;\n tokenMap: TokenMap | null = null;\n\n _boundGetRawIdentifier = this._getRawIdentifier.bind(this);\n\n generate(ast: t.Node) {\n if (this.format.preserveFormat) {\n this.tokenMap = new TokenMap(ast, this._tokens!, this._originalCode!);\n }\n this.print(ast);\n this._maybeAddAuxComment();\n\n return this._buf.get();\n }\n\n /**\n * Increment indent size.\n */\n\n indent(): void {\n const { format } = this;\n if (format.preserveFormat || format.compact || format.concise) {\n return;\n }\n\n this._indent++;\n }\n\n /**\n * Decrement indent size.\n */\n\n dedent(): void {\n const { format } = this;\n if (format.preserveFormat || format.compact || format.concise) {\n return;\n }\n\n this._indent--;\n }\n\n /**\n * If the next token is on the same line, we must first print a semicolon.\n * This option is only used in `preserveFormat` node, for semicolons that\n * might have omitted due to them being absent in the original code (thanks\n * to ASI).\n *\n * We need both *NextToken and *NextNode because we only want to insert the\n * semicolon when the next token starts a new node, and not in cases like\n * foo} (where } is not starting a new node). So we first set *NextNode, and\n * then the print() method will move it to *NextToken.\n */\n _printSemicolonBeforeNextNode: number = -1;\n _printSemicolonBeforeNextToken: number = -1;\n\n /**\n * Add a semicolon to the buffer.\n */\n semicolon(force: boolean = false): void {\n this._maybeAddAuxComment();\n if (force) {\n this._appendChar(charCodes.semicolon);\n this._noLineTerminator = false;\n return;\n }\n if (this.tokenMap) {\n const node = this._currentNode!;\n if (node.start != null && node.end != null) {\n if (!this.tokenMap.endMatches(node, \";\")) {\n // no semicolon\n this._printSemicolonBeforeNextNode = this._buf.getCurrentLine();\n return;\n }\n const indexes = this.tokenMap.getIndexes(this._currentNode!)!;\n this._catchUpTo(this._tokens![indexes[indexes.length - 1]].loc.start);\n }\n }\n this._queue(charCodes.semicolon);\n this._noLineTerminator = false;\n }\n\n /**\n * Add a right brace to the buffer.\n */\n\n rightBrace(node: t.Node): void {\n if (this.format.minified) {\n this._buf.removeLastSemicolon();\n }\n this.sourceWithOffset(\"end\", node.loc, -1);\n this.token(\"}\");\n }\n\n rightParens(node: t.Node): void {\n this.sourceWithOffset(\"end\", node.loc, -1);\n this.token(\")\");\n }\n\n /**\n * Add a space to the buffer unless it is compact.\n */\n\n space(force: boolean = false): void {\n const { format } = this;\n if (format.compact || format.preserveFormat) return;\n\n if (force) {\n this._space();\n } else if (this._buf.hasContent()) {\n const lastCp = this.getLastChar();\n if (lastCp !== charCodes.space && lastCp !== charCodes.lineFeed) {\n this._space();\n }\n }\n }\n\n /**\n * Writes a token that can't be safely parsed without taking whitespace into account.\n */\n\n word(str: string, noLineTerminatorAfter: boolean = false): void {\n this.tokenContext &= TokenContext.forInOrInitHeadAccumulatePassThroughMask;\n\n this._maybePrintInnerComments(str);\n\n this._maybeAddAuxComment();\n\n if (this.tokenMap) this._catchUpToCurrentToken(str);\n\n // prevent concatenating words and creating // comment out of division and regex\n if (\n this._endsWithWord ||\n (this._endsWithDiv && str.charCodeAt(0) === charCodes.slash)\n ) {\n this._space();\n }\n this._append(str, false);\n\n this._endsWithWord = true;\n this._noLineTerminator = noLineTerminatorAfter;\n }\n\n /**\n * Writes a number token so that we can validate if it is an integer.\n */\n\n number(str: string, number?: number): void {\n // const NON_DECIMAL_LITERAL = /^0[box]/;\n function isNonDecimalLiteral(str: string) {\n if (str.length > 2 && str.charCodeAt(0) === charCodes.digit0) {\n const secondChar = str.charCodeAt(1);\n return (\n secondChar === charCodes.lowercaseB ||\n secondChar === charCodes.lowercaseO ||\n secondChar === charCodes.lowercaseX\n );\n }\n return false;\n }\n this.word(str);\n\n // Integer tokens need special handling because they cannot have '.'s inserted\n // immediately after them.\n this._endsWithInteger =\n Number.isInteger(number) &&\n !isNonDecimalLiteral(str) &&\n !SCIENTIFIC_NOTATION.test(str) &&\n !ZERO_DECIMAL_INTEGER.test(str) &&\n str.charCodeAt(str.length - 1) !== charCodes.dot;\n }\n\n /**\n * Writes a simple token.\n *\n * @param {string} str The string to append.\n * @param {boolean} [maybeNewline=false] Wether `str` might potentially\n * contain a line terminator or not.\n * @param {number} [occurrenceCount=0] The occurrence count of this token in\n * the current node. This is used when printing in `preserveFormat` mode,\n * to know which token we should map to (for example, to disambiguate the\n * commas in an array literal).\n */\n token(str: string, maybeNewline = false, occurrenceCount = 0): void {\n this.tokenContext &= TokenContext.forInOrInitHeadAccumulatePassThroughMask;\n\n this._maybePrintInnerComments(str, occurrenceCount);\n\n this._maybeAddAuxComment();\n\n if (this.tokenMap) this._catchUpToCurrentToken(str, occurrenceCount);\n\n const lastChar = this.getLastChar();\n const strFirst = str.charCodeAt(0);\n if (\n (lastChar === charCodes.exclamationMark &&\n // space is mandatory to avoid outputting * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + pr + } else if (xm) { + ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr + } else if (xp) { + ret = '>=' + M + '.' + m + '.0' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + pr + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(safeRe[t.STAR], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version, options) { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + var match = null + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + var next + while ((next = safeRe[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + safeRe[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(match[2] + + '.' + (match[3] || '0') + + '.' + (match[4] || '0'), options) +} diff --git a/node_modules/@babel/helper-compilation-targets/package.json b/node_modules/@babel/helper-compilation-targets/package.json new file mode 100644 index 0000000..79c1e2b --- /dev/null +++ b/node_modules/@babel/helper-compilation-targets/package.json @@ -0,0 +1,43 @@ +{ + "name": "@babel/helper-compilation-targets", + "version": "7.27.2", + "author": "The Babel Team (https://babel.dev/team)", + "license": "MIT", + "description": "Helper functions on Babel compilation targets", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-compilation-targets" + }, + "main": "./lib/index.js", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "keywords": [ + "babel", + "babel-plugin" + ], + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "devDependencies": { + "@babel/helper-plugin-test-runner": "^7.27.1", + "@types/lru-cache": "^5.1.1", + "@types/semver": "^5.5.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-globals/LICENSE b/node_modules/@babel/helper-globals/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/helper-globals/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-globals/README.md b/node_modules/@babel/helper-globals/README.md new file mode 100644 index 0000000..3dc9f25 --- /dev/null +++ b/node_modules/@babel/helper-globals/README.md @@ -0,0 +1,19 @@ +# @babel/helper-globals + +> A collection of JavaScript globals for Babel internal usage + +See our website [@babel/helper-globals](https://babeljs.io/docs/babel-helper-globals) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-globals +``` + +or using yarn: + +```sh +yarn add @babel/helper-globals +``` diff --git a/node_modules/@babel/helper-globals/data/browser-upper.json b/node_modules/@babel/helper-globals/data/browser-upper.json new file mode 100644 index 0000000..8a4d6fd --- /dev/null +++ b/node_modules/@babel/helper-globals/data/browser-upper.json @@ -0,0 +1,911 @@ +[ + "AbortController", + "AbortSignal", + "AbsoluteOrientationSensor", + "AbstractRange", + "Accelerometer", + "AI", + "AICreateMonitor", + "AITextSession", + "AnalyserNode", + "Animation", + "AnimationEffect", + "AnimationEvent", + "AnimationPlaybackEvent", + "AnimationTimeline", + "AsyncDisposableStack", + "Attr", + "Audio", + "AudioBuffer", + "AudioBufferSourceNode", + "AudioContext", + "AudioData", + "AudioDecoder", + "AudioDestinationNode", + "AudioEncoder", + "AudioListener", + "AudioNode", + "AudioParam", + "AudioParamMap", + "AudioProcessingEvent", + "AudioScheduledSourceNode", + "AudioSinkInfo", + "AudioWorklet", + "AudioWorkletGlobalScope", + "AudioWorkletNode", + "AudioWorkletProcessor", + "AuthenticatorAssertionResponse", + "AuthenticatorAttestationResponse", + "AuthenticatorResponse", + "BackgroundFetchManager", + "BackgroundFetchRecord", + "BackgroundFetchRegistration", + "BarcodeDetector", + "BarProp", + "BaseAudioContext", + "BatteryManager", + "BeforeUnloadEvent", + "BiquadFilterNode", + "Blob", + "BlobEvent", + "Bluetooth", + "BluetoothCharacteristicProperties", + "BluetoothDevice", + "BluetoothRemoteGATTCharacteristic", + "BluetoothRemoteGATTDescriptor", + "BluetoothRemoteGATTServer", + "BluetoothRemoteGATTService", + "BluetoothUUID", + "BroadcastChannel", + "BrowserCaptureMediaStreamTrack", + "ByteLengthQueuingStrategy", + "Cache", + "CacheStorage", + "CanvasCaptureMediaStream", + "CanvasCaptureMediaStreamTrack", + "CanvasGradient", + "CanvasPattern", + "CanvasRenderingContext2D", + "CaptureController", + "CaretPosition", + "CDATASection", + "ChannelMergerNode", + "ChannelSplitterNode", + "ChapterInformation", + "CharacterBoundsUpdateEvent", + "CharacterData", + "Clipboard", + "ClipboardEvent", + "ClipboardItem", + "CloseEvent", + "CloseWatcher", + "CommandEvent", + "Comment", + "CompositionEvent", + "CompressionStream", + "ConstantSourceNode", + "ContentVisibilityAutoStateChangeEvent", + "ConvolverNode", + "CookieChangeEvent", + "CookieDeprecationLabel", + "CookieStore", + "CookieStoreManager", + "CountQueuingStrategy", + "Credential", + "CredentialsContainer", + "CropTarget", + "Crypto", + "CryptoKey", + "CSPViolationReportBody", + "CSS", + "CSSAnimation", + "CSSConditionRule", + "CSSContainerRule", + "CSSCounterStyleRule", + "CSSFontFaceRule", + "CSSFontFeatureValuesRule", + "CSSFontPaletteValuesRule", + "CSSGroupingRule", + "CSSImageValue", + "CSSImportRule", + "CSSKeyframeRule", + "CSSKeyframesRule", + "CSSKeywordValue", + "CSSLayerBlockRule", + "CSSLayerStatementRule", + "CSSMarginRule", + "CSSMathClamp", + "CSSMathInvert", + "CSSMathMax", + "CSSMathMin", + "CSSMathNegate", + "CSSMathProduct", + "CSSMathSum", + "CSSMathValue", + "CSSMatrixComponent", + "CSSMediaRule", + "CSSNamespaceRule", + "CSSNestedDeclarations", + "CSSNumericArray", + "CSSNumericValue", + "CSSPageDescriptors", + "CSSPageRule", + "CSSPerspective", + "CSSPositionTryDescriptors", + "CSSPositionTryRule", + "CSSPositionValue", + "CSSPropertyRule", + "CSSRotate", + "CSSRule", + "CSSRuleList", + "CSSScale", + "CSSScopeRule", + "CSSSkew", + "CSSSkewX", + "CSSSkewY", + "CSSStartingStyleRule", + "CSSStyleDeclaration", + "CSSStyleRule", + "CSSStyleSheet", + "CSSStyleValue", + "CSSSupportsRule", + "CSSTransformComponent", + "CSSTransformValue", + "CSSTransition", + "CSSTranslate", + "CSSUnitValue", + "CSSUnparsedValue", + "CSSVariableReferenceValue", + "CSSViewTransitionRule", + "CustomElementRegistry", + "CustomEvent", + "CustomStateSet", + "DataTransfer", + "DataTransferItem", + "DataTransferItemList", + "DecompressionStream", + "DelayNode", + "DelegatedInkTrailPresenter", + "DeviceMotionEvent", + "DeviceMotionEventAcceleration", + "DeviceMotionEventRotationRate", + "DeviceOrientationEvent", + "DevicePosture", + "DisposableStack", + "Document", + "DocumentFragment", + "DocumentPictureInPicture", + "DocumentPictureInPictureEvent", + "DocumentTimeline", + "DocumentType", + "DOMError", + "DOMException", + "DOMImplementation", + "DOMMatrix", + "DOMMatrixReadOnly", + "DOMParser", + "DOMPoint", + "DOMPointReadOnly", + "DOMQuad", + "DOMRect", + "DOMRectList", + "DOMRectReadOnly", + "DOMStringList", + "DOMStringMap", + "DOMTokenList", + "DragEvent", + "DynamicsCompressorNode", + "EditContext", + "Element", + "ElementInternals", + "EncodedAudioChunk", + "EncodedVideoChunk", + "ErrorEvent", + "Event", + "EventCounts", + "EventSource", + "EventTarget", + "External", + "EyeDropper", + "FeaturePolicy", + "FederatedCredential", + "Fence", + "FencedFrameConfig", + "FetchLaterResult", + "File", + "FileList", + "FileReader", + "FileSystem", + "FileSystemDirectoryEntry", + "FileSystemDirectoryHandle", + "FileSystemDirectoryReader", + "FileSystemEntry", + "FileSystemFileEntry", + "FileSystemFileHandle", + "FileSystemHandle", + "FileSystemObserver", + "FileSystemWritableFileStream", + "FocusEvent", + "FontData", + "FontFace", + "FontFaceSet", + "FontFaceSetLoadEvent", + "FormData", + "FormDataEvent", + "FragmentDirective", + "GainNode", + "Gamepad", + "GamepadAxisMoveEvent", + "GamepadButton", + "GamepadButtonEvent", + "GamepadEvent", + "GamepadHapticActuator", + "GamepadPose", + "Geolocation", + "GeolocationCoordinates", + "GeolocationPosition", + "GeolocationPositionError", + "GPU", + "GPUAdapter", + "GPUAdapterInfo", + "GPUBindGroup", + "GPUBindGroupLayout", + "GPUBuffer", + "GPUBufferUsage", + "GPUCanvasContext", + "GPUColorWrite", + "GPUCommandBuffer", + "GPUCommandEncoder", + "GPUCompilationInfo", + "GPUCompilationMessage", + "GPUComputePassEncoder", + "GPUComputePipeline", + "GPUDevice", + "GPUDeviceLostInfo", + "GPUError", + "GPUExternalTexture", + "GPUInternalError", + "GPUMapMode", + "GPUOutOfMemoryError", + "GPUPipelineError", + "GPUPipelineLayout", + "GPUQuerySet", + "GPUQueue", + "GPURenderBundle", + "GPURenderBundleEncoder", + "GPURenderPassEncoder", + "GPURenderPipeline", + "GPUSampler", + "GPUShaderModule", + "GPUShaderStage", + "GPUSupportedFeatures", + "GPUSupportedLimits", + "GPUTexture", + "GPUTextureUsage", + "GPUTextureView", + "GPUUncapturedErrorEvent", + "GPUValidationError", + "GravitySensor", + "Gyroscope", + "HashChangeEvent", + "Headers", + "HID", + "HIDConnectionEvent", + "HIDDevice", + "HIDInputReportEvent", + "Highlight", + "HighlightRegistry", + "History", + "HTMLAllCollection", + "HTMLAnchorElement", + "HTMLAreaElement", + "HTMLAudioElement", + "HTMLBaseElement", + "HTMLBodyElement", + "HTMLBRElement", + "HTMLButtonElement", + "HTMLCanvasElement", + "HTMLCollection", + "HTMLDataElement", + "HTMLDataListElement", + "HTMLDetailsElement", + "HTMLDialogElement", + "HTMLDirectoryElement", + "HTMLDivElement", + "HTMLDListElement", + "HTMLDocument", + "HTMLElement", + "HTMLEmbedElement", + "HTMLFencedFrameElement", + "HTMLFieldSetElement", + "HTMLFontElement", + "HTMLFormControlsCollection", + "HTMLFormElement", + "HTMLFrameElement", + "HTMLFrameSetElement", + "HTMLHeadElement", + "HTMLHeadingElement", + "HTMLHRElement", + "HTMLHtmlElement", + "HTMLIFrameElement", + "HTMLImageElement", + "HTMLInputElement", + "HTMLLabelElement", + "HTMLLegendElement", + "HTMLLIElement", + "HTMLLinkElement", + "HTMLMapElement", + "HTMLMarqueeElement", + "HTMLMediaElement", + "HTMLMenuElement", + "HTMLMetaElement", + "HTMLMeterElement", + "HTMLModElement", + "HTMLObjectElement", + "HTMLOListElement", + "HTMLOptGroupElement", + "HTMLOptionElement", + "HTMLOptionsCollection", + "HTMLOutputElement", + "HTMLParagraphElement", + "HTMLParamElement", + "HTMLPictureElement", + "HTMLPreElement", + "HTMLProgressElement", + "HTMLQuoteElement", + "HTMLScriptElement", + "HTMLSelectedContentElement", + "HTMLSelectElement", + "HTMLSlotElement", + "HTMLSourceElement", + "HTMLSpanElement", + "HTMLStyleElement", + "HTMLTableCaptionElement", + "HTMLTableCellElement", + "HTMLTableColElement", + "HTMLTableElement", + "HTMLTableRowElement", + "HTMLTableSectionElement", + "HTMLTemplateElement", + "HTMLTextAreaElement", + "HTMLTimeElement", + "HTMLTitleElement", + "HTMLTrackElement", + "HTMLUListElement", + "HTMLUnknownElement", + "HTMLVideoElement", + "IDBCursor", + "IDBCursorWithValue", + "IDBDatabase", + "IDBFactory", + "IDBIndex", + "IDBKeyRange", + "IDBObjectStore", + "IDBOpenDBRequest", + "IDBRequest", + "IDBTransaction", + "IDBVersionChangeEvent", + "IdentityCredential", + "IdentityCredentialError", + "IdentityProvider", + "IdleDeadline", + "IdleDetector", + "IIRFilterNode", + "Image", + "ImageBitmap", + "ImageBitmapRenderingContext", + "ImageCapture", + "ImageData", + "ImageDecoder", + "ImageTrack", + "ImageTrackList", + "Ink", + "InputDeviceCapabilities", + "InputDeviceInfo", + "InputEvent", + "IntersectionObserver", + "IntersectionObserverEntry", + "Keyboard", + "KeyboardEvent", + "KeyboardLayoutMap", + "KeyframeEffect", + "LanguageDetector", + "LargestContentfulPaint", + "LaunchParams", + "LaunchQueue", + "LayoutShift", + "LayoutShiftAttribution", + "LinearAccelerationSensor", + "Location", + "Lock", + "LockManager", + "MathMLElement", + "MediaCapabilities", + "MediaCapabilitiesInfo", + "MediaDeviceInfo", + "MediaDevices", + "MediaElementAudioSourceNode", + "MediaEncryptedEvent", + "MediaError", + "MediaKeyError", + "MediaKeyMessageEvent", + "MediaKeys", + "MediaKeySession", + "MediaKeyStatusMap", + "MediaKeySystemAccess", + "MediaList", + "MediaMetadata", + "MediaQueryList", + "MediaQueryListEvent", + "MediaRecorder", + "MediaRecorderErrorEvent", + "MediaSession", + "MediaSource", + "MediaSourceHandle", + "MediaStream", + "MediaStreamAudioDestinationNode", + "MediaStreamAudioSourceNode", + "MediaStreamEvent", + "MediaStreamTrack", + "MediaStreamTrackAudioSourceNode", + "MediaStreamTrackAudioStats", + "MediaStreamTrackEvent", + "MediaStreamTrackGenerator", + "MediaStreamTrackProcessor", + "MediaStreamTrackVideoStats", + "MessageChannel", + "MessageEvent", + "MessagePort", + "MIDIAccess", + "MIDIConnectionEvent", + "MIDIInput", + "MIDIInputMap", + "MIDIMessageEvent", + "MIDIOutput", + "MIDIOutputMap", + "MIDIPort", + "MimeType", + "MimeTypeArray", + "ModelGenericSession", + "ModelManager", + "MouseEvent", + "MutationEvent", + "MutationObserver", + "MutationRecord", + "NamedNodeMap", + "NavigateEvent", + "Navigation", + "NavigationActivation", + "NavigationCurrentEntryChangeEvent", + "NavigationDestination", + "NavigationHistoryEntry", + "NavigationPreloadManager", + "NavigationTransition", + "Navigator", + "NavigatorLogin", + "NavigatorManagedData", + "NavigatorUAData", + "NetworkInformation", + "Node", + "NodeFilter", + "NodeIterator", + "NodeList", + "Notification", + "NotifyPaintEvent", + "NotRestoredReasonDetails", + "NotRestoredReasons", + "Observable", + "OfflineAudioCompletionEvent", + "OfflineAudioContext", + "OffscreenCanvas", + "OffscreenCanvasRenderingContext2D", + "Option", + "OrientationSensor", + "OscillatorNode", + "OTPCredential", + "OverconstrainedError", + "PageRevealEvent", + "PageSwapEvent", + "PageTransitionEvent", + "PannerNode", + "PasswordCredential", + "Path2D", + "PaymentAddress", + "PaymentManager", + "PaymentMethodChangeEvent", + "PaymentRequest", + "PaymentRequestUpdateEvent", + "PaymentResponse", + "Performance", + "PerformanceElementTiming", + "PerformanceEntry", + "PerformanceEventTiming", + "PerformanceLongAnimationFrameTiming", + "PerformanceLongTaskTiming", + "PerformanceMark", + "PerformanceMeasure", + "PerformanceNavigation", + "PerformanceNavigationTiming", + "PerformanceObserver", + "PerformanceObserverEntryList", + "PerformancePaintTiming", + "PerformanceResourceTiming", + "PerformanceScriptTiming", + "PerformanceServerTiming", + "PerformanceTiming", + "PeriodicSyncManager", + "PeriodicWave", + "Permissions", + "PermissionStatus", + "PERSISTENT", + "PictureInPictureEvent", + "PictureInPictureWindow", + "Plugin", + "PluginArray", + "PointerEvent", + "PopStateEvent", + "Presentation", + "PresentationAvailability", + "PresentationConnection", + "PresentationConnectionAvailableEvent", + "PresentationConnectionCloseEvent", + "PresentationConnectionList", + "PresentationReceiver", + "PresentationRequest", + "PressureObserver", + "PressureRecord", + "ProcessingInstruction", + "Profiler", + "ProgressEvent", + "PromiseRejectionEvent", + "ProtectedAudience", + "PublicKeyCredential", + "PushManager", + "PushSubscription", + "PushSubscriptionOptions", + "RadioNodeList", + "Range", + "ReadableByteStreamController", + "ReadableStream", + "ReadableStreamBYOBReader", + "ReadableStreamBYOBRequest", + "ReadableStreamDefaultController", + "ReadableStreamDefaultReader", + "RelativeOrientationSensor", + "RemotePlayback", + "ReportBody", + "ReportingObserver", + "Request", + "ResizeObserver", + "ResizeObserverEntry", + "ResizeObserverSize", + "Response", + "RestrictionTarget", + "RTCCertificate", + "RTCDataChannel", + "RTCDataChannelEvent", + "RTCDtlsTransport", + "RTCDTMFSender", + "RTCDTMFToneChangeEvent", + "RTCEncodedAudioFrame", + "RTCEncodedVideoFrame", + "RTCError", + "RTCErrorEvent", + "RTCIceCandidate", + "RTCIceTransport", + "RTCPeerConnection", + "RTCPeerConnectionIceErrorEvent", + "RTCPeerConnectionIceEvent", + "RTCRtpReceiver", + "RTCRtpScriptTransform", + "RTCRtpSender", + "RTCRtpTransceiver", + "RTCSctpTransport", + "RTCSessionDescription", + "RTCStatsReport", + "RTCTrackEvent", + "Scheduler", + "Scheduling", + "Screen", + "ScreenDetailed", + "ScreenDetails", + "ScreenOrientation", + "ScriptProcessorNode", + "ScrollTimeline", + "SecurityPolicyViolationEvent", + "Selection", + "Sensor", + "SensorErrorEvent", + "Serial", + "SerialPort", + "ServiceWorker", + "ServiceWorkerContainer", + "ServiceWorkerRegistration", + "ShadowRoot", + "SharedStorage", + "SharedStorageAppendMethod", + "SharedStorageClearMethod", + "SharedStorageDeleteMethod", + "SharedStorageModifierMethod", + "SharedStorageSetMethod", + "SharedStorageWorklet", + "SharedWorker", + "SnapEvent", + "SourceBuffer", + "SourceBufferList", + "SpeechSynthesis", + "SpeechSynthesisErrorEvent", + "SpeechSynthesisEvent", + "SpeechSynthesisUtterance", + "SpeechSynthesisVoice", + "StaticRange", + "StereoPannerNode", + "Storage", + "StorageBucket", + "StorageBucketManager", + "StorageEvent", + "StorageManager", + "StylePropertyMap", + "StylePropertyMapReadOnly", + "StyleSheet", + "StyleSheetList", + "SubmitEvent", + "Subscriber", + "SubtleCrypto", + "SuppressedError", + "SVGAElement", + "SVGAngle", + "SVGAnimatedAngle", + "SVGAnimatedBoolean", + "SVGAnimatedEnumeration", + "SVGAnimatedInteger", + "SVGAnimatedLength", + "SVGAnimatedLengthList", + "SVGAnimatedNumber", + "SVGAnimatedNumberList", + "SVGAnimatedPreserveAspectRatio", + "SVGAnimatedRect", + "SVGAnimatedString", + "SVGAnimatedTransformList", + "SVGAnimateElement", + "SVGAnimateMotionElement", + "SVGAnimateTransformElement", + "SVGAnimationElement", + "SVGCircleElement", + "SVGClipPathElement", + "SVGComponentTransferFunctionElement", + "SVGDefsElement", + "SVGDescElement", + "SVGElement", + "SVGEllipseElement", + "SVGFEBlendElement", + "SVGFEColorMatrixElement", + "SVGFEComponentTransferElement", + "SVGFECompositeElement", + "SVGFEConvolveMatrixElement", + "SVGFEDiffuseLightingElement", + "SVGFEDisplacementMapElement", + "SVGFEDistantLightElement", + "SVGFEDropShadowElement", + "SVGFEFloodElement", + "SVGFEFuncAElement", + "SVGFEFuncBElement", + "SVGFEFuncGElement", + "SVGFEFuncRElement", + "SVGFEGaussianBlurElement", + "SVGFEImageElement", + "SVGFEMergeElement", + "SVGFEMergeNodeElement", + "SVGFEMorphologyElement", + "SVGFEOffsetElement", + "SVGFEPointLightElement", + "SVGFESpecularLightingElement", + "SVGFESpotLightElement", + "SVGFETileElement", + "SVGFETurbulenceElement", + "SVGFilterElement", + "SVGForeignObjectElement", + "SVGGElement", + "SVGGeometryElement", + "SVGGradientElement", + "SVGGraphicsElement", + "SVGImageElement", + "SVGLength", + "SVGLengthList", + "SVGLinearGradientElement", + "SVGLineElement", + "SVGMarkerElement", + "SVGMaskElement", + "SVGMatrix", + "SVGMetadataElement", + "SVGMPathElement", + "SVGNumber", + "SVGNumberList", + "SVGPathElement", + "SVGPatternElement", + "SVGPoint", + "SVGPointList", + "SVGPolygonElement", + "SVGPolylineElement", + "SVGPreserveAspectRatio", + "SVGRadialGradientElement", + "SVGRect", + "SVGRectElement", + "SVGScriptElement", + "SVGSetElement", + "SVGStopElement", + "SVGStringList", + "SVGStyleElement", + "SVGSVGElement", + "SVGSwitchElement", + "SVGSymbolElement", + "SVGTextContentElement", + "SVGTextElement", + "SVGTextPathElement", + "SVGTextPositioningElement", + "SVGTitleElement", + "SVGTransform", + "SVGTransformList", + "SVGTSpanElement", + "SVGUnitTypes", + "SVGUseElement", + "SVGViewElement", + "SyncManager", + "TaskAttributionTiming", + "TaskController", + "TaskPriorityChangeEvent", + "TaskSignal", + "TEMPORARY", + "Text", + "TextDecoder", + "TextDecoderStream", + "TextEncoder", + "TextEncoderStream", + "TextEvent", + "TextFormat", + "TextFormatUpdateEvent", + "TextMetrics", + "TextTrack", + "TextTrackCue", + "TextTrackCueList", + "TextTrackList", + "TextUpdateEvent", + "TimeEvent", + "TimeRanges", + "ToggleEvent", + "Touch", + "TouchEvent", + "TouchList", + "TrackEvent", + "TransformStream", + "TransformStreamDefaultController", + "TransitionEvent", + "TreeWalker", + "TrustedHTML", + "TrustedScript", + "TrustedScriptURL", + "TrustedTypePolicy", + "TrustedTypePolicyFactory", + "UIEvent", + "URL", + "URLPattern", + "URLSearchParams", + "USB", + "USBAlternateInterface", + "USBConfiguration", + "USBConnectionEvent", + "USBDevice", + "USBEndpoint", + "USBInterface", + "USBInTransferResult", + "USBIsochronousInTransferPacket", + "USBIsochronousInTransferResult", + "USBIsochronousOutTransferPacket", + "USBIsochronousOutTransferResult", + "USBOutTransferResult", + "UserActivation", + "ValidityState", + "VideoColorSpace", + "VideoDecoder", + "VideoEncoder", + "VideoFrame", + "VideoPlaybackQuality", + "ViewTimeline", + "ViewTransition", + "ViewTransitionTypeSet", + "VirtualKeyboard", + "VirtualKeyboardGeometryChangeEvent", + "VisibilityStateEntry", + "VisualViewport", + "VTTCue", + "VTTRegion", + "WakeLock", + "WakeLockSentinel", + "WaveShaperNode", + "WebAssembly", + "WebGL2RenderingContext", + "WebGLActiveInfo", + "WebGLBuffer", + "WebGLContextEvent", + "WebGLFramebuffer", + "WebGLObject", + "WebGLProgram", + "WebGLQuery", + "WebGLRenderbuffer", + "WebGLRenderingContext", + "WebGLSampler", + "WebGLShader", + "WebGLShaderPrecisionFormat", + "WebGLSync", + "WebGLTexture", + "WebGLTransformFeedback", + "WebGLUniformLocation", + "WebGLVertexArrayObject", + "WebSocket", + "WebSocketError", + "WebSocketStream", + "WebTransport", + "WebTransportBidirectionalStream", + "WebTransportDatagramDuplexStream", + "WebTransportError", + "WebTransportReceiveStream", + "WebTransportSendStream", + "WGSLLanguageFeatures", + "WheelEvent", + "Window", + "WindowControlsOverlay", + "WindowControlsOverlayGeometryChangeEvent", + "Worker", + "Worklet", + "WorkletGlobalScope", + "WritableStream", + "WritableStreamDefaultController", + "WritableStreamDefaultWriter", + "XMLDocument", + "XMLHttpRequest", + "XMLHttpRequestEventTarget", + "XMLHttpRequestUpload", + "XMLSerializer", + "XPathEvaluator", + "XPathExpression", + "XPathResult", + "XRAnchor", + "XRAnchorSet", + "XRBoundedReferenceSpace", + "XRCamera", + "XRCPUDepthInformation", + "XRDepthInformation", + "XRDOMOverlayState", + "XRFrame", + "XRHand", + "XRHitTestResult", + "XRHitTestSource", + "XRInputSource", + "XRInputSourceArray", + "XRInputSourceEvent", + "XRInputSourcesChangeEvent", + "XRJointPose", + "XRJointSpace", + "XRLayer", + "XRLightEstimate", + "XRLightProbe", + "XRPose", + "XRRay", + "XRReferenceSpace", + "XRReferenceSpaceEvent", + "XRRenderState", + "XRRigidTransform", + "XRSession", + "XRSessionEvent", + "XRSpace", + "XRSystem", + "XRTransientInputHitTestResult", + "XRTransientInputHitTestSource", + "XRView", + "XRViewerPose", + "XRViewport", + "XRWebGLBinding", + "XRWebGLDepthInformation", + "XRWebGLLayer", + "XSLTProcessor" +] diff --git a/node_modules/@babel/helper-globals/data/builtin-lower.json b/node_modules/@babel/helper-globals/data/builtin-lower.json new file mode 100644 index 0000000..ae57bc7 --- /dev/null +++ b/node_modules/@babel/helper-globals/data/builtin-lower.json @@ -0,0 +1,15 @@ +[ + "decodeURI", + "decodeURIComponent", + "encodeURI", + "encodeURIComponent", + "escape", + "eval", + "globalThis", + "isFinite", + "isNaN", + "parseFloat", + "parseInt", + "undefined", + "unescape" +] diff --git a/node_modules/@babel/helper-globals/data/builtin-upper.json b/node_modules/@babel/helper-globals/data/builtin-upper.json new file mode 100644 index 0000000..4863ce4 --- /dev/null +++ b/node_modules/@babel/helper-globals/data/builtin-upper.json @@ -0,0 +1,51 @@ +[ + "AggregateError", + "Array", + "ArrayBuffer", + "Atomics", + "BigInt", + "BigInt64Array", + "BigUint64Array", + "Boolean", + "DataView", + "Date", + "Error", + "EvalError", + "FinalizationRegistry", + "Float16Array", + "Float32Array", + "Float64Array", + "Function", + "Infinity", + "Int16Array", + "Int32Array", + "Int8Array", + "Intl", + "Iterator", + "JSON", + "Map", + "Math", + "NaN", + "Number", + "Object", + "Promise", + "Proxy", + "RangeError", + "ReferenceError", + "Reflect", + "RegExp", + "Set", + "SharedArrayBuffer", + "String", + "Symbol", + "SyntaxError", + "TypeError", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "URIError", + "WeakMap", + "WeakRef", + "WeakSet" +] diff --git a/node_modules/@babel/helper-globals/package.json b/node_modules/@babel/helper-globals/package.json new file mode 100644 index 0000000..4d55997 --- /dev/null +++ b/node_modules/@babel/helper-globals/package.json @@ -0,0 +1,32 @@ +{ + "name": "@babel/helper-globals", + "version": "7.28.0", + "author": "The Babel Team (https://babel.dev/team)", + "license": "MIT", + "description": "A collection of JavaScript globals for Babel internal usage", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-globals" + }, + "publishConfig": { + "access": "public" + }, + "exports": { + "./data/browser-upper.json": "./data/browser-upper.json", + "./data/builtin-lower.json": "./data/builtin-lower.json", + "./data/builtin-upper.json": "./data/builtin-upper.json", + "./package.json": "./package.json" + }, + "keywords": [ + "babel", + "globals" + ], + "devDependencies": { + "globals": "^16.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/LICENSE b/node_modules/@babel/helper-module-imports/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/helper-module-imports/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-module-imports/README.md b/node_modules/@babel/helper-module-imports/README.md new file mode 100644 index 0000000..aa47726 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/README.md @@ -0,0 +1,19 @@ +# @babel/helper-module-imports + +> Babel helper functions for inserting module loads + +See our website [@babel/helper-module-imports](https://babeljs.io/docs/babel-helper-module-imports) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-module-imports +``` + +or using yarn: + +```sh +yarn add @babel/helper-module-imports +``` diff --git a/node_modules/@babel/helper-module-imports/lib/import-builder.js b/node_modules/@babel/helper-module-imports/lib/import-builder.js new file mode 100644 index 0000000..b01187f --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-builder.js @@ -0,0 +1,122 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _assert = require("assert"); +var _t = require("@babel/types"); +const { + callExpression, + cloneNode, + expressionStatement, + identifier, + importDeclaration, + importDefaultSpecifier, + importNamespaceSpecifier, + importSpecifier, + memberExpression, + stringLiteral, + variableDeclaration, + variableDeclarator +} = _t; +class ImportBuilder { + constructor(importedSource, scope, hub) { + this._statements = []; + this._resultName = null; + this._importedSource = void 0; + this._scope = scope; + this._hub = hub; + this._importedSource = importedSource; + } + done() { + return { + statements: this._statements, + resultName: this._resultName + }; + } + import() { + this._statements.push(importDeclaration([], stringLiteral(this._importedSource))); + return this; + } + require() { + this._statements.push(expressionStatement(callExpression(identifier("require"), [stringLiteral(this._importedSource)]))); + return this; + } + namespace(name = "namespace") { + const local = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + _assert(statement.type === "ImportDeclaration"); + _assert(statement.specifiers.length === 0); + statement.specifiers = [importNamespaceSpecifier(local)]; + this._resultName = cloneNode(local); + return this; + } + default(name) { + const id = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + _assert(statement.type === "ImportDeclaration"); + _assert(statement.specifiers.length === 0); + statement.specifiers = [importDefaultSpecifier(id)]; + this._resultName = cloneNode(id); + return this; + } + named(name, importName) { + if (importName === "default") return this.default(name); + const id = this._scope.generateUidIdentifier(name); + const statement = this._statements[this._statements.length - 1]; + _assert(statement.type === "ImportDeclaration"); + _assert(statement.specifiers.length === 0); + statement.specifiers = [importSpecifier(id, identifier(importName))]; + this._resultName = cloneNode(id); + return this; + } + var(name) { + const id = this._scope.generateUidIdentifier(name); + let statement = this._statements[this._statements.length - 1]; + if (statement.type !== "ExpressionStatement") { + _assert(this._resultName); + statement = expressionStatement(this._resultName); + this._statements.push(statement); + } + this._statements[this._statements.length - 1] = variableDeclaration("var", [variableDeclarator(id, statement.expression)]); + this._resultName = cloneNode(id); + return this; + } + defaultInterop() { + return this._interop(this._hub.addHelper("interopRequireDefault")); + } + wildcardInterop() { + return this._interop(this._hub.addHelper("interopRequireWildcard")); + } + _interop(callee) { + const statement = this._statements[this._statements.length - 1]; + if (statement.type === "ExpressionStatement") { + statement.expression = callExpression(callee, [statement.expression]); + } else if (statement.type === "VariableDeclaration") { + _assert(statement.declarations.length === 1); + statement.declarations[0].init = callExpression(callee, [statement.declarations[0].init]); + } else { + _assert.fail("Unexpected type."); + } + return this; + } + prop(name) { + const statement = this._statements[this._statements.length - 1]; + if (statement.type === "ExpressionStatement") { + statement.expression = memberExpression(statement.expression, identifier(name)); + } else if (statement.type === "VariableDeclaration") { + _assert(statement.declarations.length === 1); + statement.declarations[0].init = memberExpression(statement.declarations[0].init, identifier(name)); + } else { + _assert.fail("Unexpected type:" + statement.type); + } + return this; + } + read(name) { + this._resultName = memberExpression(this._resultName, identifier(name)); + } +} +exports.default = ImportBuilder; + +//# sourceMappingURL=import-builder.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/import-builder.js.map b/node_modules/@babel/helper-module-imports/lib/import-builder.js.map new file mode 100644 index 0000000..920accc --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-builder.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assert","require","_t","callExpression","cloneNode","expressionStatement","identifier","importDeclaration","importDefaultSpecifier","importNamespaceSpecifier","importSpecifier","memberExpression","stringLiteral","variableDeclaration","variableDeclarator","ImportBuilder","constructor","importedSource","scope","hub","_statements","_resultName","_importedSource","_scope","_hub","done","statements","resultName","import","push","namespace","name","local","generateUidIdentifier","statement","length","assert","type","specifiers","default","id","named","importName","var","expression","defaultInterop","_interop","addHelper","wildcardInterop","callee","declarations","init","fail","prop","read","exports"],"sources":["../src/import-builder.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport {\n callExpression,\n cloneNode,\n expressionStatement,\n identifier,\n importDeclaration,\n importDefaultSpecifier,\n importNamespaceSpecifier,\n importSpecifier,\n memberExpression,\n stringLiteral,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { Scope, HubInterface } from \"@babel/traverse\";\n\n/**\n * A class to track and accumulate mutations to the AST that will eventually\n * output a new require/import statement list.\n */\nexport default class ImportBuilder {\n private _statements: t.Statement[] = [];\n private _resultName: t.Identifier | t.MemberExpression = null;\n\n declare _scope: Scope;\n declare _hub: HubInterface;\n private _importedSource: string;\n\n constructor(importedSource: string, scope: Scope, hub: HubInterface) {\n this._scope = scope;\n this._hub = hub;\n this._importedSource = importedSource;\n }\n\n done() {\n return {\n statements: this._statements,\n resultName: this._resultName,\n };\n }\n\n import() {\n this._statements.push(\n importDeclaration([], stringLiteral(this._importedSource)),\n );\n return this;\n }\n\n require() {\n this._statements.push(\n expressionStatement(\n callExpression(identifier(\"require\"), [\n stringLiteral(this._importedSource),\n ]),\n ),\n );\n return this;\n }\n\n namespace(name = \"namespace\") {\n const local = this._scope.generateUidIdentifier(name);\n\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importNamespaceSpecifier(local)];\n this._resultName = cloneNode(local);\n return this;\n }\n default(name: string) {\n const id = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importDefaultSpecifier(id)];\n this._resultName = cloneNode(id);\n return this;\n }\n named(name: string, importName: string) {\n if (importName === \"default\") return this.default(name);\n\n const id = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [importSpecifier(id, identifier(importName))];\n this._resultName = cloneNode(id);\n return this;\n }\n\n var(name: string) {\n const id = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n if (statement.type !== \"ExpressionStatement\") {\n assert(this._resultName);\n statement = expressionStatement(this._resultName);\n this._statements.push(statement);\n }\n this._statements[this._statements.length - 1] = variableDeclaration(\"var\", [\n variableDeclarator(id, statement.expression),\n ]);\n this._resultName = cloneNode(id);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee: t.Expression) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = callExpression(callee, [\n statement.declarations[0].init,\n ]);\n } else {\n assert.fail(\"Unexpected type.\");\n }\n return this;\n }\n\n prop(name: string) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = memberExpression(\n statement.expression,\n identifier(name),\n );\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = memberExpression(\n statement.declarations[0].init,\n identifier(name),\n );\n } else {\n assert.fail(\"Unexpected type:\" + statement.type);\n }\n return this;\n }\n\n read(name: string) {\n this._resultName = memberExpression(this._resultName, identifier(name));\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAasB;EAZpBE,cAAc;EACdC,SAAS;EACTC,mBAAmB;EACnBC,UAAU;EACVC,iBAAiB;EACjBC,sBAAsB;EACtBC,wBAAwB;EACxBC,eAAe;EACfC,gBAAgB;EAChBC,aAAa;EACbC,mBAAmB;EACnBC;AAAkB,IAAAZ,EAAA;AASL,MAAMa,aAAa,CAAC;EAQjCC,WAAWA,CAACC,cAAsB,EAAEC,KAAY,EAAEC,GAAiB,EAAE;IAAA,KAP7DC,WAAW,GAAkB,EAAE;IAAA,KAC/BC,WAAW,GAAsC,IAAI;IAAA,KAIrDC,eAAe;IAGr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ACgB,YAAY,CAAC,CAAC,CAAC,CAACC,IAAI,CAC/B,CAAC;IACJ,CAAC,MAAM;MACLf,OAAM,CAACgB,IAAI,CAAC,kBAAkB,CAAC;IACjC;IACA,OAAO,IAAI;EACb;EAEAC,IAAIA,CAACtB,IAAY,EAAE;IACjB,MAAMG,SAAS,GAAG,IAAI,CAACd,WAAW,CAAC,IAAI,CAACA,WAAW,CAACe,MAAM,GAAG,CAAC,CAAC;IAC/D,IAAID,SAAS,CAACG,IAAI,KAAK,qBAAqB,EAAE;MAC5CH,SAAS,CAACU,UAAU,GAAGjC,gBAAgB,CACrCuB,SAAS,CAACU,UAAU,EACpBtC,UAAU,CAACyB,IAAI,CACjB,CAAC;IACH,CAAC,MAAM,IAAIG,SAAS,CAACG,IAAI,KAAK,qBAAqB,EAAE;MACnDD,OAAM,CAACF,SAAS,CAACgB,YAAY,CAACf,MAAM,KAAK,CAAC,CAAC;MAC3CD,SAAS,CAACgB,YAAY,CAAC,CAAC,CAAC,CAACC,IAAI,GAAGxC,gBAAgB,CAC/CuB,SAAS,CAACgB,YAAY,CAAC,CAAC,CAAC,CAACC,IAAI,EAC9B7C,UAAU,CAACyB,IAAI,CACjB,CAAC;IACH,CAAC,MAAM;MACLK,OAAM,CAACgB,IAAI,CAAC,kBAAkB,GAAGlB,SAAS,CAACG,IAAI,CAAC;IAClD;IACA,OAAO,IAAI;EACb;EAEAiB,IAAIA,CAACvB,IAAY,EAAE;IACjB,IAAI,CAACV,WAAW,GAAGV,gBAAgB,CAAC,IAAI,CAACU,WAAW,EAAEf,UAAU,CAACyB,IAAI,CAAC,CAAC;EACzE;AACF;AAACwB,OAAA,CAAAhB,OAAA,GAAAxB,aAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/lib/import-injector.js b/node_modules/@babel/helper-module-imports/lib/import-injector.js new file mode 100644 index 0000000..0c61c56 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-injector.js @@ -0,0 +1,304 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _assert = require("assert"); +var _t = require("@babel/types"); +var _importBuilder = require("./import-builder.js"); +var _isModule = require("./is-module.js"); +const { + identifier, + importSpecifier, + numericLiteral, + sequenceExpression, + isImportDeclaration +} = _t; +class ImportInjector { + constructor(path, importedSource, opts) { + this._defaultOpts = { + importedSource: null, + importedType: "commonjs", + importedInterop: "babel", + importingInterop: "babel", + ensureLiveReference: false, + ensureNoContext: false, + importPosition: "before" + }; + const programPath = path.find(p => p.isProgram()); + this._programPath = programPath; + this._programScope = programPath.scope; + this._hub = programPath.hub; + this._defaultOpts = this._applyDefaults(importedSource, opts, true); + } + addDefault(importedSourceIn, opts) { + return this.addNamed("default", importedSourceIn, opts); + } + addNamed(importName, importedSourceIn, opts) { + _assert(typeof importName === "string"); + return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName); + } + addNamespace(importedSourceIn, opts) { + return this._generateImport(this._applyDefaults(importedSourceIn, opts), null); + } + addSideEffect(importedSourceIn, opts) { + return this._generateImport(this._applyDefaults(importedSourceIn, opts), void 0); + } + _applyDefaults(importedSource, opts, isInit = false) { + let newOpts; + if (typeof importedSource === "string") { + newOpts = Object.assign({}, this._defaultOpts, { + importedSource + }, opts); + } else { + _assert(!opts, "Unexpected secondary arguments."); + newOpts = Object.assign({}, this._defaultOpts, importedSource); + } + if (!isInit && opts) { + if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint; + if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist; + } + return newOpts; + } + _generateImport(opts, importName) { + const isDefault = importName === "default"; + const isNamed = !!importName && !isDefault; + const isNamespace = importName === null; + const { + importedSource, + importedType, + importedInterop, + importingInterop, + ensureLiveReference, + ensureNoContext, + nameHint, + importPosition, + blockHoist + } = opts; + let name = nameHint || importName; + const isMod = (0, _isModule.default)(this._programPath); + const isModuleForNode = isMod && importingInterop === "node"; + const isModuleForBabel = isMod && importingInterop === "babel"; + if (importPosition === "after" && !isMod) { + throw new Error(`"importPosition": "after" is only supported in modules`); + } + const builder = new _importBuilder.default(importedSource, this._programScope, this._hub); + if (importedType === "es6") { + if (!isModuleForNode && !isModuleForBabel) { + throw new Error("Cannot import an ES6 module from CommonJS"); + } + builder.import(); + if (isNamespace) { + builder.namespace(nameHint || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else if (importedType !== "commonjs") { + throw new Error(`Unexpected interopType "${importedType}"`); + } else if (importedInterop === "babel") { + if (isModuleForNode) { + name = name !== "default" ? name : importedSource; + const es6Default = `${importedSource}$es6Default`; + builder.import(); + if (isNamespace) { + builder.default(es6Default).var(name || importedSource).wildcardInterop(); + } else if (isDefault) { + if (ensureLiveReference) { + builder.default(es6Default).var(name || importedSource).defaultInterop().read("default"); + } else { + builder.default(es6Default).var(name).defaultInterop().prop(importName); + } + } else if (isNamed) { + builder.default(es6Default).read(importName); + } + } else if (isModuleForBabel) { + builder.import(); + if (isNamespace) { + builder.namespace(name || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + if (isNamespace) { + builder.var(name || importedSource).wildcardInterop(); + } else if ((isDefault || isNamed) && ensureLiveReference) { + if (isDefault) { + name = name !== "default" ? name : importedSource; + builder.var(name).read(importName); + builder.defaultInterop(); + } else { + builder.var(importedSource).read(importName); + } + } else if (isDefault) { + builder.var(name).defaultInterop().prop(importName); + } else if (isNamed) { + builder.var(name).prop(importName); + } + } + } else if (importedInterop === "compiled") { + if (isModuleForNode) { + builder.import(); + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault || isNamed) { + builder.default(importedSource).read(name); + } + } else if (isModuleForBabel) { + builder.import(); + if (isNamespace) { + builder.namespace(name || importedSource); + } else if (isDefault || isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + if (isNamespace) { + builder.var(name || importedSource); + } else if (isDefault || isNamed) { + if (ensureLiveReference) { + builder.var(importedSource).read(name); + } else { + builder.prop(importName).var(name); + } + } + } + } else if (importedInterop === "uncompiled") { + if (isDefault && ensureLiveReference) { + throw new Error("No live reference for commonjs default"); + } + if (isModuleForNode) { + builder.import(); + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault) { + builder.default(name); + } else if (isNamed) { + builder.default(importedSource).read(name); + } + } else if (isModuleForBabel) { + builder.import(); + if (isNamespace) { + builder.default(name || importedSource); + } else if (isDefault) { + builder.default(name); + } else if (isNamed) { + builder.named(name, importName); + } + } else { + builder.require(); + if (isNamespace) { + builder.var(name || importedSource); + } else if (isDefault) { + builder.var(name); + } else if (isNamed) { + if (ensureLiveReference) { + builder.var(importedSource).read(name); + } else { + builder.var(name).prop(importName); + } + } + } + } else { + throw new Error(`Unknown importedInterop "${importedInterop}".`); + } + const { + statements, + resultName + } = builder.done(); + this._insertStatements(statements, importPosition, blockHoist); + if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") { + return sequenceExpression([numericLiteral(0), resultName]); + } + return resultName; + } + _insertStatements(statements, importPosition = "before", blockHoist = 3) { + if (importPosition === "after") { + if (this._insertStatementsAfter(statements)) return; + } else { + if (this._insertStatementsBefore(statements, blockHoist)) return; + } + this._programPath.unshiftContainer("body", statements); + } + _insertStatementsBefore(statements, blockHoist) { + if (statements.length === 1 && isImportDeclaration(statements[0]) && isValueImport(statements[0])) { + const firstImportDecl = this._programPath.get("body").find(p => { + return p.isImportDeclaration() && isValueImport(p.node); + }); + if ((firstImportDecl == null ? void 0 : firstImportDecl.node.source.value) === statements[0].source.value && maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])) { + return true; + } + } + statements.forEach(node => { + node._blockHoist = blockHoist; + }); + const targetPath = this._programPath.get("body").find(p => { + const val = p.node._blockHoist; + return Number.isFinite(val) && val < 4; + }); + if (targetPath) { + targetPath.insertBefore(statements); + return true; + } + return false; + } + _insertStatementsAfter(statements) { + const statementsSet = new Set(statements); + const importDeclarations = new Map(); + for (const statement of statements) { + if (isImportDeclaration(statement) && isValueImport(statement)) { + const source = statement.source.value; + if (!importDeclarations.has(source)) importDeclarations.set(source, []); + importDeclarations.get(source).push(statement); + } + } + let lastImportPath = null; + for (const bodyStmt of this._programPath.get("body")) { + if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) { + lastImportPath = bodyStmt; + const source = bodyStmt.node.source.value; + const newImports = importDeclarations.get(source); + if (!newImports) continue; + for (const decl of newImports) { + if (!statementsSet.has(decl)) continue; + if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) { + statementsSet.delete(decl); + } + } + } + } + if (statementsSet.size === 0) return true; + if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet)); + return !!lastImportPath; + } +} +exports.default = ImportInjector; +function isValueImport(node) { + return node.importKind !== "type" && node.importKind !== "typeof"; +} +function hasNamespaceImport(node) { + return node.specifiers.length === 1 && node.specifiers[0].type === "ImportNamespaceSpecifier" || node.specifiers.length === 2 && node.specifiers[1].type === "ImportNamespaceSpecifier"; +} +function hasDefaultImport(node) { + return node.specifiers.length > 0 && node.specifiers[0].type === "ImportDefaultSpecifier"; +} +function maybeAppendImportSpecifiers(target, source) { + if (!target.specifiers.length) { + target.specifiers = source.specifiers; + return true; + } + if (!source.specifiers.length) return true; + if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false; + if (hasDefaultImport(source)) { + if (hasDefaultImport(target)) { + source.specifiers[0] = importSpecifier(source.specifiers[0].local, identifier("default")); + } else { + target.specifiers.unshift(source.specifiers.shift()); + } + } + target.specifiers.push(...source.specifiers); + return true; +} + +//# sourceMappingURL=import-injector.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/import-injector.js.map b/node_modules/@babel/helper-module-imports/lib/import-injector.js.map new file mode 100644 index 0000000..8fe3a98 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/import-injector.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assert","require","_t","_importBuilder","_isModule","identifier","importSpecifier","numericLiteral","sequenceExpression","isImportDeclaration","ImportInjector","constructor","path","importedSource","opts","_defaultOpts","importedType","importedInterop","importingInterop","ensureLiveReference","ensureNoContext","importPosition","programPath","find","p","isProgram","_programPath","_programScope","scope","_hub","hub","_applyDefaults","addDefault","importedSourceIn","addNamed","importName","assert","_generateImport","addNamespace","addSideEffect","isInit","newOpts","Object","assign","nameHint","undefined","blockHoist","isDefault","isNamed","isNamespace","name","isMod","isModule","isModuleForNode","isModuleForBabel","Error","builder","ImportBuilder","import","namespace","named","es6Default","default","var","wildcardInterop","defaultInterop","read","prop","statements","resultName","done","_insertStatements","type","_insertStatementsAfter","_insertStatementsBefore","unshiftContainer","length","isValueImport","firstImportDecl","get","node","source","value","maybeAppendImportSpecifiers","forEach","_blockHoist","targetPath","val","Number","isFinite","insertBefore","statementsSet","Set","importDeclarations","Map","statement","has","set","push","lastImportPath","bodyStmt","newImports","decl","delete","size","insertAfter","Array","from","exports","importKind","hasNamespaceImport","specifiers","hasDefaultImport","target","local","unshift","shift"],"sources":["../src/import-injector.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport {\n identifier,\n importSpecifier,\n numericLiteral,\n sequenceExpression,\n isImportDeclaration,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { NodePath, Scope, HubInterface } from \"@babel/traverse\";\n\nimport ImportBuilder from \"./import-builder.ts\";\nimport isModule from \"./is-module.ts\";\n\nexport type ImportOptions = {\n /**\n * The module being referenced.\n */\n importedSource: string | null;\n /**\n * The type of module being imported:\n *\n * * 'es6' - An ES6 module.\n * * 'commonjs' - A CommonJS module. (Default)\n */\n importedType: \"es6\" | \"commonjs\";\n /**\n * The type of interop behavior for namespace/default/named when loading\n * CommonJS modules.\n *\n * ## 'babel' (Default)\n *\n * Load using Babel's interop.\n *\n * If '.__esModule' is true, treat as 'compiled', else:\n *\n * * Namespace: A copy of the module.exports with .default\n * populated by the module.exports object.\n * * Default: The module.exports value.\n * * Named: The .named property of module.exports.\n *\n * The 'ensureLiveReference' has no effect on the liveness of these.\n *\n * ## 'compiled'\n *\n * Assume the module is ES6 compiled to CommonJS. Useful to avoid injecting\n * interop logic if you are confident that the module is a certain format.\n *\n * * Namespace: The root module.exports object.\n * * Default: The .default property of the namespace.\n * * Named: The .named property of the namespace.\n *\n * Will return erroneous results if the imported module is _not_ compiled\n * from ES6 with Babel.\n *\n * ## 'uncompiled'\n *\n * Assume the module is _not_ ES6 compiled to CommonJS. Used a simplified\n * access pattern that doesn't require additional function calls.\n *\n * Will return erroneous results if the imported module _is_ compiled\n * from ES6 with Babel.\n *\n * * Namespace: The module.exports object.\n * * Default: The module.exports object.\n * * Named: The .named property of module.exports.\n */\n importedInterop: \"babel\" | \"node\" | \"compiled\" | \"uncompiled\";\n /**\n * The type of CommonJS interop included in the environment that will be\n * loading the output code.\n *\n * * 'babel' - CommonJS modules load with Babel's interop. (Default)\n * * 'node' - CommonJS modules load with Node's interop.\n *\n * See descriptions in 'importedInterop' for more details.\n */\n importingInterop: \"babel\" | \"node\";\n /**\n * Define whether we explicitly care that the import be a live reference.\n * Only applies when importing default and named imports, not the namespace.\n *\n * * true - Force imported values to be live references.\n * * false - No particular requirements. Keeps the code simplest. (Default)\n */\n ensureLiveReference: boolean;\n /**\n * Define if we explicitly care that the result not be a property reference.\n *\n * * true - Force calls to exclude context. Useful if the value is going to\n * be used as function callee.\n * * false - No particular requirements for context of the access. (Default)\n */\n ensureNoContext: boolean;\n /**\n * Define whether the import should be loaded before or after the existing imports.\n * \"after\" is only allowed inside ECMAScript modules, since it's not possible to\n * reliably pick the location _after_ require() calls but _before_ other code in CJS.\n */\n importPosition: \"before\" | \"after\";\n\n nameHint?: string;\n blockHoist?: number;\n};\n\n/**\n * A general helper classes add imports via transforms. See README for usage.\n */\nexport default class ImportInjector {\n /**\n * The path used for manipulation.\n */\n declare _programPath: NodePath;\n\n /**\n * The scope used to generate unique variable names.\n */\n declare _programScope: Scope;\n\n /**\n * The file used to inject helpers and resolve paths.\n */\n declare _hub: HubInterface;\n\n /**\n * The default options to use with this instance when imports are added.\n */\n _defaultOpts: ImportOptions = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false,\n importPosition: \"before\",\n };\n\n constructor(\n path: NodePath,\n importedSource?: string,\n opts?: Partial,\n ) {\n const programPath = path.find(p => p.isProgram()) as NodePath;\n\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn: string, opts: Partial) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(\n importName: string,\n importedSourceIn: string,\n opts: Partial,\n ) {\n assert(typeof importName === \"string\");\n\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n importName,\n );\n }\n\n addNamespace(importedSourceIn: string, opts: Partial) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n null,\n );\n }\n\n addSideEffect(importedSourceIn: string, opts: Partial) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n void 0,\n );\n }\n\n _applyDefaults(\n importedSource: string | Partial,\n opts: Partial | undefined,\n isInit = false,\n ) {\n let newOpts: ImportOptions;\n if (typeof importedSource === \"string\") {\n newOpts = { ...this._defaultOpts, importedSource, ...opts };\n } else {\n assert(!opts, \"Unexpected secondary arguments.\");\n newOpts = { ...this._defaultOpts, ...importedSource };\n }\n\n if (!isInit && opts) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n return newOpts;\n }\n\n _generateImport(\n opts: Partial,\n importName: string | null | undefined,\n ) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n importPosition,\n\n // Not meant for public usage. Allows code that absolutely must control\n // ordering to set a specific hoist value on the import nodes.\n // This is ignored when \"importPosition\" is \"after\".\n blockHoist,\n } = opts;\n\n // Provide a hint for generateUidIdentifier for the local variable name\n // to use for the import, if the code will generate a simple assignment\n // to a variable.\n let name = nameHint || importName;\n\n const isMod = isModule(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n\n if (importPosition === \"after\" && !isMod) {\n throw new Error(`\"importPosition\": \"after\" is only supported in modules`);\n }\n\n const builder = new ImportBuilder(\n importedSource,\n this._programScope,\n this._hub,\n );\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(nameHint || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else if (importedType !== \"commonjs\") {\n throw new Error(`Unexpected interopType \"${importedType}\"`);\n } else if (importedInterop === \"babel\") {\n if (isModuleForNode) {\n // import _tmp from ''; var namespace = interopRequireWildcard(_tmp); namespace\n // import _tmp from ''; var def = interopRequireDefault(_tmp).default; def\n // import _tmp from ''; _tmp.named\n name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n\n builder.import();\n if (isNamespace) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .defaultInterop()\n .read(\"default\");\n } else {\n builder\n .default(es6Default)\n .var(name)\n .defaultInterop()\n .prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = interopRequireWildcard(require(''));\n // var def = interopRequireDefault(require('')).default; def\n // var named = require('').named; named\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource).wildcardInterop();\n } else if ((isDefault || isNamed) && ensureLiveReference) {\n if (isDefault) {\n name = name !== \"default\" ? name : importedSource;\n builder.var(name).read(importName);\n builder.defaultInterop();\n } else {\n builder.var(importedSource).read(importName);\n }\n } else if (isDefault) {\n builder.var(name).defaultInterop().prop(importName);\n } else if (isNamed) {\n builder.var(name).prop(importName);\n }\n }\n } else if (importedInterop === \"compiled\") {\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import namespace from ''; namespace.default\n // import namespace from ''; namespace.named\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n // Note: These lookups will break if the module has no __esModule set,\n // hence the warning that 'compiled' will not work on standard CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var namespace = require(''); namespace.default\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault || isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.prop(importName).var(name);\n }\n }\n }\n } else if (importedInterop === \"uncompiled\") {\n if (isDefault && ensureLiveReference) {\n throw new Error(\"No live reference for commonjs default\");\n }\n\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import def from ''; def;\n // import namespace from ''; namespace.named\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import namespace from '';\n // import def from '';\n // import { named } from ''; named;\n // Note: These lookups will break if the module has __esModule set,\n // hence the warning that 'uncompiled' will not work on ES6 transpiled\n // to CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var def = require(''); def\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault) {\n builder.var(name);\n } else if (isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.var(name).prop(importName);\n }\n }\n }\n } else {\n throw new Error(`Unknown importedInterop \"${importedInterop}\".`);\n }\n\n const { statements, resultName } = builder.done();\n\n this._insertStatements(statements, importPosition, blockHoist);\n\n if (\n (isDefault || isNamed) &&\n ensureNoContext &&\n resultName.type !== \"Identifier\"\n ) {\n return sequenceExpression([numericLiteral(0), resultName]);\n }\n return resultName;\n }\n\n _insertStatements(\n statements: t.Statement[],\n importPosition = \"before\",\n blockHoist = 3,\n ) {\n if (importPosition === \"after\") {\n if (this._insertStatementsAfter(statements)) return;\n } else {\n if (this._insertStatementsBefore(statements, blockHoist)) return;\n }\n\n this._programPath.unshiftContainer(\"body\", statements);\n }\n\n _insertStatementsBefore(statements: t.Statement[], blockHoist: number) {\n if (\n statements.length === 1 &&\n isImportDeclaration(statements[0]) &&\n isValueImport(statements[0])\n ) {\n const firstImportDecl = this._programPath\n .get(\"body\")\n .find((p): p is NodePath => {\n return p.isImportDeclaration() && isValueImport(p.node);\n });\n\n if (\n firstImportDecl?.node.source.value === statements[0].source.value &&\n maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])\n ) {\n return true;\n }\n }\n\n statements.forEach(node => {\n // @ts-expect-error handle _blockHoist\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n // @ts-expect-error todo(flow->ts): avoid mutations\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n return true;\n }\n\n return false;\n }\n\n _insertStatementsAfter(statements: t.Statement[]): boolean {\n const statementsSet = new Set(statements);\n const importDeclarations: Map = new Map();\n\n for (const statement of statements) {\n if (isImportDeclaration(statement) && isValueImport(statement)) {\n const source = statement.source.value;\n if (!importDeclarations.has(source)) importDeclarations.set(source, []);\n importDeclarations.get(source).push(statement);\n }\n }\n\n let lastImportPath = null;\n for (const bodyStmt of this._programPath.get(\"body\")) {\n if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) {\n lastImportPath = bodyStmt;\n\n const source = bodyStmt.node.source.value;\n const newImports = importDeclarations.get(source);\n if (!newImports) continue;\n\n for (const decl of newImports) {\n if (!statementsSet.has(decl)) continue;\n if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) {\n statementsSet.delete(decl);\n }\n }\n }\n }\n\n if (statementsSet.size === 0) return true;\n\n if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet));\n\n return !!lastImportPath;\n }\n}\n\nfunction isValueImport(node: t.ImportDeclaration) {\n return node.importKind !== \"type\" && node.importKind !== \"typeof\";\n}\n\nfunction hasNamespaceImport(node: t.ImportDeclaration) {\n return (\n (node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ImportNamespaceSpecifier\") ||\n (node.specifiers.length === 2 &&\n node.specifiers[1].type === \"ImportNamespaceSpecifier\")\n );\n}\n\nfunction hasDefaultImport(node: t.ImportDeclaration) {\n return (\n node.specifiers.length > 0 &&\n node.specifiers[0].type === \"ImportDefaultSpecifier\"\n );\n}\n\nfunction maybeAppendImportSpecifiers(\n target: t.ImportDeclaration,\n source: t.ImportDeclaration,\n): boolean {\n if (!target.specifiers.length) {\n target.specifiers = source.specifiers;\n return true;\n }\n if (!source.specifiers.length) return true;\n\n if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false;\n\n if (hasDefaultImport(source)) {\n if (hasDefaultImport(target)) {\n source.specifiers[0] = importSpecifier(\n source.specifiers[0].local,\n identifier(\"default\"),\n );\n } else {\n target.specifiers.unshift(source.specifiers.shift());\n }\n }\n\n target.specifiers.push(...source.specifiers);\n\n return true;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAD,OAAA;AAUA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAAsC;EAVpCI,UAAU;EACVC,eAAe;EACfC,cAAc;EACdC,kBAAkB;EAClBC;AAAmB,IAAAP,EAAA;AAsGN,MAAMQ,cAAc,CAAC;EA6BlCC,WAAWA,CACTC,IAAc,EACdC,cAAuB,EACvBC,IAA6B,EAC7B;IAAA,KAdFC,YAAY,GAAkB;MAC5BF,cAAc,EAAE,IAAI;MACpBG,YAAY,EAAE,UAAU;MACxBC,eAAe,EAAE,OAAO;MACxBC,gBAAgB,EAAE,OAAO;MACzBC,mBAAmB,EAAE,KAAK;MAC1BC,eAAe,EAAE,KAAK;MACtBC,cAAc,EAAE;IAClB,CAAC;IAOC,MAAMC,WAAW,GAAGV,IAAI,CAACW,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACC,SAAS,CAAC,CAAC,CAAwB;IAExE,IAAI,CAACC,YAAY,GAAGJ,WAAW;IAC/B,IAAI,CAACK,aAAa,GAAGL,WAAW,CAACM,KAAK;IACtC,IAAI,CAACC,IAAI,GAAGP,WAAW,CAACQ,GAAG;IAE3B,IAAI,CAACf,YAAY,GAAG,IAAI,CAACgB,cAAc,CAAClB,cAAc,EAAEC,IAAI,EAAE,IAAI,CAAC;EACrE;EAEAkB,UAAUA,CAACC,gBAAwB,EAAEnB,IAA4B,EAAE;IACjE,OAAO,IAAI,CAACoB,QAAQ,CAAC,SAAS,EAAED,gBAAgB,EAAEnB,IAAI,CAAC;EACzD;EAEAoB,QAAQA,CACNC,UAAkB,EAClBF,gBAAwB,EACxBnB,IAA4B,EAC5B;IACAsB,OAAM,CAAC,OAAOD,UAAU,KAAK,QAAQ,C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AACG,MAAM,CAAC,IAAIH,kBAAkB,CAAC7B,MAAM,CAAC,EAAE,OAAO,KAAK;EAE1E,IAAI+B,gBAAgB,CAAC/B,MAAM,CAAC,EAAE;IAC5B,IAAI+B,gBAAgB,CAACC,MAAM,CAAC,EAAE;MAC5BhC,MAAM,CAAC8B,UAAU,CAAC,CAAC,CAAC,GAAGzG,eAAe,CACpC2E,MAAM,CAAC8B,UAAU,CAAC,CAAC,CAAC,CAACG,KAAK,EAC1B7G,UAAU,CAAC,SAAS,CACtB,CAAC;IACH,CAAC,MAAM;MACL4G,MAAM,CAACF,UAAU,CAACI,OAAO,CAAClC,MAAM,CAAC8B,UAAU,CAACK,KAAK,CAAC,CAAC,CAAC;IACtD;EACF;EAEAH,MAAM,CAACF,UAAU,CAACb,IAAI,CAAC,GAAGjB,MAAM,CAAC8B,UAAU,CAAC;EAE5C,OAAO,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/lib/index.js b/node_modules/@babel/helper-module-imports/lib/index.js new file mode 100644 index 0000000..84f97fc --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/index.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "ImportInjector", { + enumerable: true, + get: function () { + return _importInjector.default; + } +}); +exports.addDefault = addDefault; +exports.addNamed = addNamed; +exports.addNamespace = addNamespace; +exports.addSideEffect = addSideEffect; +Object.defineProperty(exports, "isModule", { + enumerable: true, + get: function () { + return _isModule.default; + } +}); +var _importInjector = require("./import-injector.js"); +var _isModule = require("./is-module.js"); +function addDefault(path, importedSource, opts) { + return new _importInjector.default(path).addDefault(importedSource, opts); +} +function addNamed(path, name, importedSource, opts) { + return new _importInjector.default(path).addNamed(name, importedSource, opts); +} +function addNamespace(path, importedSource, opts) { + return new _importInjector.default(path).addNamespace(importedSource, opts); +} +function addSideEffect(path, importedSource, opts) { + return new _importInjector.default(path).addSideEffect(importedSource, opts); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/index.js.map b/node_modules/@babel/helper-module-imports/lib/index.js.map new file mode 100644 index 0000000..787cfd3 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_importInjector","require","_isModule","addDefault","path","importedSource","opts","ImportInjector","addNamed","name","addNamespace","addSideEffect"],"sources":["../src/index.ts"],"sourcesContent":["import ImportInjector, { type ImportOptions } from \"./import-injector.ts\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module.ts\";\n\nexport function addDefault(\n path: NodePath,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<\n Partial,\n \"ensureLiveReference\" | \"ensureNoContext\"\n >,\n): t.Identifier;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit, \"ensureLiveReference\"> & {\n ensureLiveReference: true;\n },\n): t.MemberExpression;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit, \"ensureNoContext\"> & {\n ensureNoContext: true;\n },\n): t.SequenceExpression;\n/**\n * add a named import to the program path of given path\n *\n * @export\n * @param {NodePath} path The starting path to find a program path\n * @param {string} name The name of the generated binding. Babel will prefix it with `_`\n * @param {string} importedSource The source of the import\n * @param {Partial} [opts]\n * @returns {t.Identifier | t.MemberExpression | t.SequenceExpression} If opts.ensureNoContext is true, returns a SequenceExpression,\n * else if opts.ensureLiveReference is true, returns a MemberExpression, else returns an Identifier\n */\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\nexport { addNamed };\n\nexport function addNamespace(\n path: NodePath,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(\n path: NodePath,\n importedSource: string,\n opts?: Partial,\n) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEO,SAASE,UAAUA,CACxBC,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACD,UAAU,CAACE,cAAc,EAAEC,IAAI,CAAC;AAClE;AAsCA,SAASE,QAAQA,CACfJ,IAAc,EACdK,IAAY,EACZJ,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACI,QAAQ,CAACC,IAAI,EAAEJ,cAAc,EAAEC,IAAI,CAAC;AACtE;AAGO,SAASI,YAAYA,CAC1BN,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACM,YAAY,CAACL,cAAc,EAAEC,IAAI,CAAC;AACpE;AAEO,SAASK,aAAaA,CAC3BP,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACO,aAAa,CAACN,cAAc,EAAEC,IAAI,CAAC;AACrE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/lib/is-module.js b/node_modules/@babel/helper-module-imports/lib/is-module.js new file mode 100644 index 0000000..0bbda01 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/is-module.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isModule; +function isModule(path) { + return path.node.sourceType === "module"; +} + +//# sourceMappingURL=is-module.js.map diff --git a/node_modules/@babel/helper-module-imports/lib/is-module.js.map b/node_modules/@babel/helper-module-imports/lib/is-module.js.map new file mode 100644 index 0000000..c460806 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/lib/is-module.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isModule","path","node","sourceType"],"sources":["../src/is-module.ts"],"sourcesContent":["import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\n/**\n * A small utility to check if a file qualifies as a module.\n */\nexport default function isModule(path: NodePath) {\n return path.node.sourceType === \"module\";\n}\n"],"mappings":";;;;;;AAMe,SAASA,QAAQA,CAACC,IAAyB,EAAE;EAC1D,OAAOA,IAAI,CAACC,IAAI,CAACC,UAAU,KAAK,QAAQ;AAC1C","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-imports/package.json b/node_modules/@babel/helper-module-imports/package.json new file mode 100644 index 0000000..f9dee72 --- /dev/null +++ b/node_modules/@babel/helper-module-imports/package.json @@ -0,0 +1,28 @@ +{ + "name": "@babel/helper-module-imports", + "version": "7.27.1", + "description": "Babel helper functions for inserting module loads", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-helper-module-imports", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-module-imports" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "devDependencies": { + "@babel/core": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/LICENSE b/node_modules/@babel/helper-module-transforms/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-module-transforms/README.md b/node_modules/@babel/helper-module-transforms/README.md new file mode 100644 index 0000000..d0f82fe --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/README.md @@ -0,0 +1,19 @@ +# @babel/helper-module-transforms + +> Babel helper functions for implementing ES6 module transformations + +See our website [@babel/helper-module-transforms](https://babeljs.io/docs/babel-helper-module-transforms) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-module-transforms +``` + +or using yarn: + +```sh +yarn add @babel/helper-module-transforms +``` diff --git a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js new file mode 100644 index 0000000..90fcea6 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildDynamicImport = buildDynamicImport; +var _core = require("@babel/core"); +{ + exports.getDynamicImportSource = function getDynamicImportSource(node) { + const [source] = node.arguments; + return _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) ? source : _core.template.expression.ast`\`\${${source}}\``; + }; +} +function buildDynamicImport(node, deferToThen, wrapWithPromise, builder) { + const specifier = _core.types.isCallExpression(node) ? node.arguments[0] : node.source; + if (_core.types.isStringLiteral(specifier) || _core.types.isTemplateLiteral(specifier) && specifier.quasis.length === 0) { + if (deferToThen) { + return _core.template.expression.ast` + Promise.resolve().then(() => ${builder(specifier)}) + `; + } else return builder(specifier); + } + const specifierToString = _core.types.isTemplateLiteral(specifier) ? _core.types.identifier("specifier") : _core.types.templateLiteral([_core.types.templateElement({ + raw: "" + }), _core.types.templateElement({ + raw: "" + })], [_core.types.identifier("specifier")]); + if (deferToThen) { + return _core.template.expression.ast` + (specifier => + new Promise(r => r(${specifierToString})) + .then(s => ${builder(_core.types.identifier("s"))}) + )(${specifier}) + `; + } else if (wrapWithPromise) { + return _core.template.expression.ast` + (specifier => + new Promise(r => r(${builder(specifierToString)})) + )(${specifier}) + `; + } else { + return _core.template.expression.ast` + (specifier => ${builder(specifierToString)})(${specifier}) + `; + } +} + +//# sourceMappingURL=dynamic-import.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map new file mode 100644 index 0000000..1ae8dc3 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","exports","getDynamicImportSource","node","source","arguments","t","isStringLiteral","isTemplateLiteral","template","expression","ast","buildDynamicImport","deferToThen","wrapWithPromise","builder","specifier","isCallExpression","quasis","length","specifierToString","identifier","templateLiteral","templateElement","raw"],"sources":["../src/dynamic-import.ts"],"sourcesContent":["// Heavily inspired by\n// https://github.com/airbnb/babel-plugin-dynamic-import-node/blob/master/src/utils.js\n\nimport { types as t, template } from \"@babel/core\";\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.getDynamicImportSource = function getDynamicImportSource(\n node: t.CallExpression,\n ): t.StringLiteral | t.TemplateLiteral {\n const [source] = node.arguments;\n\n return t.isStringLiteral(source) || t.isTemplateLiteral(source)\n ? source\n : (template.expression.ast`\\`\\${${source}}\\`` as t.TemplateLiteral);\n };\n}\n\nexport function buildDynamicImport(\n node: t.CallExpression | t.ImportExpression,\n deferToThen: boolean,\n wrapWithPromise: boolean,\n builder: (specifier: t.Expression) => t.Expression,\n): t.Expression {\n const specifier = t.isCallExpression(node) ? node.arguments[0] : node.source;\n\n if (\n t.isStringLiteral(specifier) ||\n (t.isTemplateLiteral(specifier) && specifier.quasis.length === 0)\n ) {\n if (deferToThen) {\n return template.expression.ast`\n Promise.resolve().then(() => ${builder(specifier)})\n `;\n } else return builder(specifier);\n }\n\n const specifierToString = t.isTemplateLiteral(specifier)\n ? t.identifier(\"specifier\")\n : t.templateLiteral(\n [t.templateElement({ raw: \"\" }), t.templateElement({ raw: \"\" })],\n [t.identifier(\"specifier\")],\n );\n\n if (deferToThen) {\n return template.expression.ast`\n (specifier =>\n new Promise(r => r(${specifierToString}))\n .then(s => ${builder(t.identifier(\"s\"))})\n )(${specifier})\n `;\n } else if (wrapWithPromise) {\n return template.expression.ast`\n (specifier =>\n new Promise(r => r(${builder(specifierToString)}))\n )(${specifier})\n `;\n } else {\n return template.expression.ast`\n (specifier => ${builder(specifierToString)})(${specifier})\n `;\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEiE;EAE/DC,OAAO,CAACC,sBAAsB,GAAG,SAASA,sBAAsBA,CAC9DC,IAAsB,EACe;IACrC,MAAM,CAACC,MAAM,CAAC,GAAGD,IAAI,CAACE,SAAS;IAE/B,OAAOC,WAAC,CAACC,eAAe,CAACH,MAAM,CAAC,IAAIE,WAAC,CAACE,iBAAiB,CAACJ,MAAM,CAAC,GAC3DA,MAAM,GACLK,cAAQ,CAACC,UAAU,CAACC,GAAG,QAAQP,MAAM,KAA2B;EACvE,CAAC;AACH;AAEO,SAASQ,kBAAkBA,CAChCT,IA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,CAAC,MAAM;IACL,OAAOP,cAAQ,CAACC,UAAU,CAACC,GAAG;AAClC,sBAAsBI,OAAO,CAACK,iBAAiB,CAAC,KAAKJ,SAAS;AAC9D,KAAK;EACH;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js new file mode 100644 index 0000000..b1a6ed7 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getModuleName; +{ + const originalGetModuleName = getModuleName; + exports.default = getModuleName = function getModuleName(rootOpts, pluginOpts) { + var _pluginOpts$moduleId, _pluginOpts$moduleIds, _pluginOpts$getModule, _pluginOpts$moduleRoo; + return originalGetModuleName(rootOpts, { + moduleId: (_pluginOpts$moduleId = pluginOpts.moduleId) != null ? _pluginOpts$moduleId : rootOpts.moduleId, + moduleIds: (_pluginOpts$moduleIds = pluginOpts.moduleIds) != null ? _pluginOpts$moduleIds : rootOpts.moduleIds, + getModuleId: (_pluginOpts$getModule = pluginOpts.getModuleId) != null ? _pluginOpts$getModule : rootOpts.getModuleId, + moduleRoot: (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot + }); + }; +} +function getModuleName(rootOpts, pluginOpts) { + const { + filename, + filenameRelative = filename, + sourceRoot = pluginOpts.moduleRoot + } = rootOpts; + const { + moduleId, + moduleIds = !!moduleId, + getModuleId, + moduleRoot = sourceRoot + } = pluginOpts; + if (!moduleIds) return null; + if (moduleId != null && !getModuleId) { + return moduleId; + } + let moduleName = moduleRoot != null ? moduleRoot + "/" : ""; + if (filenameRelative) { + const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : ""; + moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.\w*$/, ""); + } + moduleName = moduleName.replace(/\\/g, "/"); + if (getModuleId) { + return getModuleId(moduleName) || moduleName; + } else { + return moduleName; + } +} + +//# sourceMappingURL=get-module-name.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map new file mode 100644 index 0000000..fd69f3b --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map @@ -0,0 +1 @@ +{"version":3,"names":["originalGetModuleName","getModuleName","exports","default","rootOpts","pluginOpts","_pluginOpts$moduleId","_pluginOpts$moduleIds","_pluginOpts$getModule","_pluginOpts$moduleRoo","moduleId","moduleIds","getModuleId","moduleRoot","filename","filenameRelative","sourceRoot","moduleName","sourceRootReplacer","RegExp","replace"],"sources":["../src/get-module-name.ts"],"sourcesContent":["type RootOptions = {\n filename?: string;\n filenameRelative?: string;\n sourceRoot?: string;\n};\n\nexport type PluginOptions = {\n moduleId?: string;\n moduleIds?: boolean;\n getModuleId?: (moduleName: string) => string | null | undefined;\n moduleRoot?: string;\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n const originalGetModuleName = getModuleName;\n\n // @ts-expect-error TS doesn't like reassigning a function.\n getModuleName = function getModuleName(\n rootOpts: RootOptions & PluginOptions,\n pluginOpts: PluginOptions,\n ): string | null {\n return originalGetModuleName(rootOpts, {\n moduleId: pluginOpts.moduleId ?? rootOpts.moduleId,\n moduleIds: pluginOpts.moduleIds ?? rootOpts.moduleIds,\n getModuleId: pluginOpts.getModuleId ?? rootOpts.getModuleId,\n moduleRoot: pluginOpts.moduleRoot ?? rootOpts.moduleRoot,\n });\n };\n}\n\nexport default function getModuleName(\n rootOpts: RootOptions,\n pluginOpts: PluginOptions,\n): string | null {\n const {\n filename,\n filenameRelative = filename,\n sourceRoot = pluginOpts.moduleRoot,\n } = rootOpts;\n\n const {\n moduleId,\n moduleIds = !!moduleId,\n\n getModuleId,\n\n moduleRoot = sourceRoot,\n } = pluginOpts;\n\n if (!moduleIds) return null;\n\n // moduleId is n/a if a `getModuleId()` is provided\n if (moduleId != null && !getModuleId) {\n return moduleId;\n }\n\n let moduleName = moduleRoot != null ? moduleRoot + \"/\" : \"\";\n\n if (filenameRelative) {\n const sourceRootReplacer =\n sourceRoot != null ? new RegExp(\"^\" + sourceRoot + \"/?\") : \"\";\n\n moduleName += filenameRelative\n // remove sourceRoot from filename\n .replace(sourceRootReplacer, \"\")\n // remove extension\n .replace(/\\.\\w*$/, \"\");\n }\n\n // normalize path separators\n moduleName = moduleName.replace(/\\\\/g, \"/\");\n\n if (getModuleId) {\n // If return is falsy, assume they want us to use our generated default name\n return getModuleId(moduleName) || moduleName;\n } else {\n return moduleName;\n }\n}\n"],"mappings":";;;;;;AAamC;EACjC,MAAMA,qBAAqB,GAAGC,aAAa;EAG3CC,OAAA,CAAAC,OAAA,GAAAF,aAAa,GAAG,SAASA,aAAaA,CACpCG,QAAqC,EACrCC,UAAyB,EACV;IAAA,IAAAC,oBAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;IACf,OAAOT,qBAAqB,CAACI,QAAQ,EAAE;MACrCM,QAAQ,GAAAJ,oBAAA,GAAED,UAAU,CAACK,QAAQ,YAAAJ,oBAAA,GAAIF,QAAQ,CAACM,QAAQ;MAClDC,SAAS,GAAAJ,qBAAA,GAAEF,UAAU,CAACM,SAAS,YAAAJ,qBAAA,GAAIH,QAAQ,CAACO,SAAS;MACrDC,WAAW,GAAAJ,qBAAA,GAAEH,UAAU,CAACO,WAAW,YAAAJ,qBAAA,GAAIJ,QAAQ,CAACQ,WAAW;MAC3DC,UAAU,GAAAJ,qBAAA,GAAEJ,UAAU,CAACQ,UAAU,YAAAJ,qBAAA,GAAIL,QAAQ,CAACS;IAChD,CAAC,CAAC;EACJ,CAAC;AACH;AAEe,SAASZ,aAAaA,CACnCG,QAAqB,EACrBC,UAAyB,EACV;EACf,MAAM;IACJS,QAAQ;IACRC,gBAAgB,GAAGD,QAAQ;IAC3BE,UAAU,GAAGX,UAAU,CAACQ;EAC1B,CAAC,GAAGT,QAAQ;EAEZ,MAAM;IACJM,QAAQ;IACRC,SAAS,GAAG,CAAC,CAACD,QAAQ;IAEtBE,WAAW;IAEXC,UAAU,GAAGG;EACf,CAAC,GAAGX,UAAU;EAEd,IAAI,CAACM,SAAS,EAAE,OAAO,IAAI;EAG3B,IAAID,QAAQ,IAAI,IAAI,IAAI,CAACE,WAAW,EAAE;IACpC,OAAOF,QAAQ;EACjB;EAEA,IAAIO,UAAU,GAAGJ,UAAU,IAAI,IAAI,GAAGA,UAAU,GAAG,GAAG,GAAG,EAAE;EAE3D,IAAIE,gBAAgB,EAAE;IACpB,MAAMG,kBAAkB,GACtBF,UAAU,IAAI,IAAI,GAAG,IAAIG,MAAM,CAAC,GAAG,GAAGH,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE;IAE/DC,UAAU,IAAIF,gBAAgB,CAE3BK,OAAO,CAACF,kBAAkB,EAAE,EAAE,CAAC,CAE/BE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;EAC1B;EAGAH,UAAU,GAAGA,UAAU,CAACG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAE3C,IAAIR,WAAW,EAAE;IAEf,OAAOA,WAAW,CAACK,UAAU,CAAC,IAAIA,UAAU;EAC9C,CAAC,MAAM;IACL,OAAOA,UAAU;EACnB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/index.js b/node_modules/@babel/helper-module-transforms/lib/index.js new file mode 100644 index 0000000..ac884d2 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/index.js @@ -0,0 +1,398 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "buildDynamicImport", { + enumerable: true, + get: function () { + return _dynamicImport.buildDynamicImport; + } +}); +exports.buildNamespaceInitStatements = buildNamespaceInitStatements; +exports.ensureStatementsHoisted = ensureStatementsHoisted; +Object.defineProperty(exports, "getModuleName", { + enumerable: true, + get: function () { + return _getModuleName.default; + } +}); +Object.defineProperty(exports, "hasExports", { + enumerable: true, + get: function () { + return _normalizeAndLoadMetadata.hasExports; + } +}); +Object.defineProperty(exports, "isModule", { + enumerable: true, + get: function () { + return _helperModuleImports.isModule; + } +}); +Object.defineProperty(exports, "isSideEffectImport", { + enumerable: true, + get: function () { + return _normalizeAndLoadMetadata.isSideEffectImport; + } +}); +exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader; +Object.defineProperty(exports, "rewriteThis", { + enumerable: true, + get: function () { + return _rewriteThis.default; + } +}); +exports.wrapInterop = wrapInterop; +var _assert = require("assert"); +var _core = require("@babel/core"); +var _helperModuleImports = require("@babel/helper-module-imports"); +var _rewriteThis = require("./rewrite-this.js"); +var _rewriteLiveReferences = require("./rewrite-live-references.js"); +var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js"); +var Lazy = require("./lazy-modules.js"); +var _dynamicImport = require("./dynamic-import.js"); +var _getModuleName = require("./get-module-name.js"); +{ + exports.getDynamicImportSource = require("./dynamic-import").getDynamicImportSource; +} +function rewriteModuleStatementsAndPrepareHeader(path, { + exportName, + strict, + allowTopLevelThis, + strictMode, + noInterop, + importInterop = noInterop ? "none" : "babel", + lazy, + getWrapperPayload = Lazy.toGetWrapperPayload(lazy != null ? lazy : false), + wrapReference = Lazy.wrapReference, + esNamespaceOnly, + filename, + constantReexports = arguments[1].loose, + enumerableModuleMeta = arguments[1].loose, + noIncompleteNsImportDetection +}) { + (0, _normalizeAndLoadMetadata.validateImportInteropOption)(importInterop); + _assert((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script"); + path.node.sourceType = "script"; + const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, { + importInterop, + initializeReexports: constantReexports, + getWrapperPayload, + esNamespaceOnly, + filename + }); + if (!allowTopLevelThis) { + (0, _rewriteThis.default)(path); + } + (0, _rewriteLiveReferences.default)(path, meta, wrapReference); + if (strictMode !== false) { + const hasStrict = path.node.directives.some(directive => { + return directive.value.value === "use strict"; + }); + if (!hasStrict) { + path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict"))); + } + } + const headers = []; + if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) { + headers.push(buildESModuleHeader(meta, enumerableModuleMeta)); + } + const nameList = buildExportNameListDeclaration(path, meta); + if (nameList) { + meta.exportNameListName = nameList.name; + headers.push(nameList.statement); + } + headers.push(...buildExportInitializationStatements(path, meta, wrapReference, constantReexports, noIncompleteNsImportDetection)); + return { + meta, + headers + }; +} +function ensureStatementsHoisted(statements) { + statements.forEach(header => { + header._blockHoist = 3; + }); +} +function wrapInterop(programPath, expr, type) { + if (type === "none") { + return null; + } + if (type === "node-namespace") { + return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"), [expr, _core.types.booleanLiteral(true)]); + } else if (type === "node-default") { + return null; + } + let helper; + if (type === "default") { + helper = "interopRequireDefault"; + } else if (type === "namespace") { + helper = "interopRequireWildcard"; + } else { + throw new Error(`Unknown interop: ${type}`); + } + return _core.types.callExpression(programPath.hub.addHelper(helper), [expr]); +} +function buildNamespaceInitStatements(metadata, sourceMetadata, constantReexports = false, wrapReference = Lazy.wrapReference) { + var _wrapReference; + const statements = []; + const srcNamespaceId = _core.types.identifier(sourceMetadata.name); + for (const localName of sourceMetadata.importsNamespace) { + if (localName === sourceMetadata.name) continue; + statements.push(_core.template.statement`var NAME = SOURCE;`({ + NAME: localName, + SOURCE: _core.types.cloneNode(srcNamespaceId) + })); + } + const srcNamespace = (_wrapReference = wrapReference(srcNamespaceId, sourceMetadata.wrap)) != null ? _wrapReference : srcNamespaceId; + if (constantReexports) { + statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference)); + } + for (const exportName of sourceMetadata.reexportNamespace) { + statements.push((!_core.types.isIdentifier(srcNamespace) ? _core.template.statement` + Object.defineProperty(EXPORTS, "NAME", { + enumerable: true, + get: function() { + return NAMESPACE; + } + }); + ` : _core.template.statement`EXPORTS.NAME = NAMESPACE;`)({ + EXPORTS: metadata.exportName, + NAME: exportName, + NAMESPACE: _core.types.cloneNode(srcNamespace) + })); + } + if (sourceMetadata.reexportAll) { + const statement = buildNamespaceReexport(metadata, _core.types.cloneNode(srcNamespace), constantReexports); + statement.loc = sourceMetadata.reexportAll.loc; + statements.push(statement); + } + return statements; +} +const ReexportTemplate = { + constant: ({ + exports, + exportName, + namespaceImport + }) => _core.template.statement.ast` + ${exports}.${exportName} = ${namespaceImport}; + `, + constantComputed: ({ + exports, + exportName, + namespaceImport + }) => _core.template.statement.ast` + ${exports}["${exportName}"] = ${namespaceImport}; + `, + spec: ({ + exports, + exportName, + namespaceImport + }) => _core.template.statement.ast` + Object.defineProperty(${exports}, "${exportName}", { + enumerable: true, + get: function() { + return ${namespaceImport}; + }, + }); + ` +}; +function buildReexportsFromMeta(meta, metadata, constantReexports, wrapReference) { + var _wrapReference2; + let namespace = _core.types.identifier(metadata.name); + namespace = (_wrapReference2 = wrapReference(namespace, metadata.wrap)) != null ? _wrapReference2 : namespace; + const { + stringSpecifiers + } = meta; + return Array.from(metadata.reexports, ([exportName, importName]) => { + let namespaceImport = _core.types.cloneNode(namespace); + if (importName === "default" && metadata.interop === "node-default") {} else if (stringSpecifiers.has(importName)) { + namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.stringLiteral(importName), true); + } else { + namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.identifier(importName)); + } + const astNodes = { + exports: meta.exportName, + exportName, + namespaceImport + }; + if (constantReexports || _core.types.isIdentifier(namespaceImport)) { + if (stringSpecifiers.has(exportName)) { + return ReexportTemplate.constantComputed(astNodes); + } else { + return ReexportTemplate.constant(astNodes); + } + } else { + return ReexportTemplate.spec(astNodes); + } + }); +} +function buildESModuleHeader(metadata, enumerableModuleMeta = false) { + return (enumerableModuleMeta ? _core.template.statement` + EXPORTS.__esModule = true; + ` : _core.template.statement` + Object.defineProperty(EXPORTS, "__esModule", { + value: true, + }); + `)({ + EXPORTS: metadata.exportName + }); +} +function buildNamespaceReexport(metadata, namespace, constantReexports) { + return (constantReexports ? _core.template.statement` + Object.keys(NAMESPACE).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + VERIFY_NAME_LIST; + if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; + + EXPORTS[key] = NAMESPACE[key]; + }); + ` : _core.template.statement` + Object.keys(NAMESPACE).forEach(function(key) { + if (key === "default" || key === "__esModule") return; + VERIFY_NAME_LIST; + if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; + + Object.defineProperty(EXPORTS, key, { + enumerable: true, + get: function() { + return NAMESPACE[key]; + }, + }); + }); + `)({ + NAMESPACE: namespace, + EXPORTS: metadata.exportName, + VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _core.template)` + if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return; + `({ + EXPORTS_LIST: metadata.exportNameListName + }) : null + }); +} +function buildExportNameListDeclaration(programPath, metadata) { + const exportedVars = Object.create(null); + for (const data of metadata.local.values()) { + for (const name of data.names) { + exportedVars[name] = true; + } + } + let hasReexport = false; + for (const data of metadata.source.values()) { + for (const exportName of data.reexports.keys()) { + exportedVars[exportName] = true; + } + for (const exportName of data.reexportNamespace) { + exportedVars[exportName] = true; + } + hasReexport = hasReexport || !!data.reexportAll; + } + if (!hasReexport || Object.keys(exportedVars).length === 0) return null; + const name = programPath.scope.generateUidIdentifier("exportNames"); + delete exportedVars.default; + return { + name: name.name, + statement: _core.types.variableDeclaration("var", [_core.types.variableDeclarator(name, _core.types.valueToNode(exportedVars))]) + }; +} +function buildExportInitializationStatements(programPath, metadata, wrapReference, constantReexports = false, noIncompleteNsImportDetection = false) { + const initStatements = []; + for (const [localName, data] of metadata.local) { + if (data.kind === "import") {} else if (data.kind === "hoisted") { + initStatements.push([data.names[0], buildInitStatement(metadata, data.names, _core.types.identifier(localName))]); + } else if (!noIncompleteNsImportDetection) { + for (const exportName of data.names) { + initStatements.push([exportName, null]); + } + } + } + for (const data of metadata.source.values()) { + if (!constantReexports) { + const reexportsStatements = buildReexportsFromMeta(metadata, data, false, wrapReference); + const reexports = [...data.reexports.keys()]; + for (let i = 0; i < reexportsStatements.length; i++) { + initStatements.push([reexports[i], reexportsStatements[i]]); + } + } + if (!noIncompleteNsImportDetection) { + for (const exportName of data.reexportNamespace) { + initStatements.push([exportName, null]); + } + } + } + initStatements.sort(([a], [b]) => { + if (a < b) return -1; + if (b < a) return 1; + return 0; + }); + const results = []; + if (noIncompleteNsImportDetection) { + for (const [, initStatement] of initStatements) { + results.push(initStatement); + } + } else { + const chunkSize = 100; + for (let i = 0; i < initStatements.length; i += chunkSize) { + let uninitializedExportNames = []; + for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) { + const [exportName, initStatement] = initStatements[i + j]; + if (initStatement !== null) { + if (uninitializedExportNames.length > 0) { + results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode())); + uninitializedExportNames = []; + } + results.push(initStatement); + } else { + uninitializedExportNames.push(exportName); + } + } + if (uninitializedExportNames.length > 0) { + results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode())); + } + } + } + return results; +} +const InitTemplate = { + computed: ({ + exports, + name, + value + }) => _core.template.expression.ast`${exports}["${name}"] = ${value}`, + default: ({ + exports, + name, + value + }) => _core.template.expression.ast`${exports}.${name} = ${value}`, + define: ({ + exports, + name, + value + }) => _core.template.expression.ast` + Object.defineProperty(${exports}, "${name}", { + enumerable: true, + value: void 0, + writable: true + })["${name}"] = ${value}` +}; +function buildInitStatement(metadata, exportNames, initExpr) { + const { + stringSpecifiers, + exportName: exports + } = metadata; + return _core.types.expressionStatement(exportNames.reduce((value, name) => { + const params = { + exports, + name, + value + }; + if (name === "__proto__") { + return InitTemplate.define(params); + } + if (stringSpecifiers.has(name)) { + return InitTemplate.computed(params); + } + return InitTemplate.default(params); + }, initExpr)); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/index.js.map b/node_modules/@babel/helper-module-transforms/lib/index.js.map new file mode 100644 index 0000000..2797847 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assert","require","_core","_helperModuleImports","_rewriteThis","_rewriteLiveReferences","_normalizeAndLoadMetadata","Lazy","_dynamicImport","_getModuleName","exports","getDynamicImportSource","rewriteModuleStatementsAndPrepareHeader","path","exportName","strict","allowTopLevelThis","strictMode","noInterop","importInterop","lazy","getWrapperPayload","toGetWrapperPayload","wrapReference","esNamespaceOnly","filename","constantReexports","arguments","loose","enumerableModuleMeta","noIncompleteNsImportDetection","validateImportInteropOption","assert","isModule","node","sourceType","meta","normalizeModuleAndLoadMetadata","initializeReexports","rewriteThis","rewriteLiveReferences","hasStrict","directives","some","directive","value","unshiftContainer","t","directiveLiteral","headers","hasExports","push","buildESModuleHeader","nameList","buildExportNameListDeclaration","exportNameListName","name","statement","buildExportInitializationStatements","ensureStatementsHoisted","statements","forEach","header","_blockHoist","wrapInterop","programPath","expr","type","callExpression","hub","addHelper","booleanLiteral","helper","Error","buildNamespaceInitStatements","metadata","sourceMetadata","_wrapReference","srcNamespaceId","identifier","localName","importsNamespace","template","NAME","SOURCE","cloneNode","srcNamespace","wrap","buildReexportsFromMeta","reexportNamespace","isIdentifier","EXPORTS","NAMESPACE","reexportAll","buildNamespaceReexport","loc","ReexportTemplate","constant","namespaceImport","ast","constantComputed","spec","_wrapReference2","namespace","stringSpecifiers","Array","from","reexports","importName","interop","has","memberExpression","stringLiteral","astNodes","VERIFY_NAME_LIST","EXPORTS_LIST","exportedVars","Object","create","data","local","values","names","hasReexport","source","keys","length","scope","generateUidIdentifier","default","variableDeclaration","variableDeclarator","valueToNode","initStatements","kind","buildInitStatement","reexportsStatements","i","sort","a","b","results","initStatement","chunkSize","uninitializedExportNames","j","buildUndefinedNode","InitTemplate","computed","expression","define","exportNames","initExpr","expressionStatement","reduce","params"],"sources":["../src/index.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport { template, types as t } from \"@babel/core\";\n\nimport { isModule } from \"@babel/helper-module-imports\";\n\nimport rewriteThis from \"./rewrite-this.ts\";\nimport rewriteLiveReferences from \"./rewrite-live-references.ts\";\nimport normalizeModuleAndLoadMetadata, {\n hasExports,\n isSideEffectImport,\n validateImportInteropOption,\n} from \"./normalize-and-load-metadata.ts\";\nimport type {\n ImportInterop,\n InteropType,\n ModuleMetadata,\n SourceModuleMetadata,\n} from \"./normalize-and-load-metadata.ts\";\nimport * as Lazy from \"./lazy-modules.ts\";\nimport type { NodePath } from \"@babel/core\";\n\nexport { buildDynamicImport } from \"./dynamic-import.ts\";\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.getDynamicImportSource =\n // eslint-disable-next-line no-restricted-globals, import/extensions\n require(\"./dynamic-import\").getDynamicImportSource;\n}\n\nexport { default as getModuleName } from \"./get-module-name.ts\";\nexport type { PluginOptions } from \"./get-module-name.ts\";\n\nexport { hasExports, isSideEffectImport, isModule, rewriteThis };\n\nexport interface RewriteModuleStatementsAndPrepareHeaderOptions {\n exportName?: string;\n strict: boolean;\n allowTopLevelThis?: boolean;\n strictMode: boolean;\n loose?: boolean;\n importInterop?: ImportInterop;\n noInterop?: boolean;\n lazy?: Lazy.Lazy;\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n wrapReference?: (ref: t.Expression, payload: unknown) => t.Expression | null;\n esNamespaceOnly?: boolean;\n filename: string | undefined;\n constantReexports?: boolean | void;\n enumerableModuleMeta?: boolean | void;\n noIncompleteNsImportDetection?: boolean | void;\n}\n\n/**\n * Perform all of the generic ES6 module rewriting needed to handle initial\n * module processing. This function will rewrite the majority of the given\n * program to reference the modules described by the returned metadata,\n * and returns a list of statements for use when initializing the module.\n */\nexport function rewriteModuleStatementsAndPrepareHeader(\n path: NodePath,\n {\n exportName,\n strict,\n allowTopLevelThis,\n strictMode,\n noInterop,\n importInterop = noInterop ? \"none\" : \"babel\",\n // TODO(Babel 8): After that `lazy` implementation is moved to the CJS\n // transform, remove this parameter.\n lazy,\n getWrapperPayload = Lazy.toGetWrapperPayload(lazy ?? false),\n wrapReference = Lazy.wrapReference,\n esNamespaceOnly,\n filename,\n\n constantReexports = process.env.BABEL_8_BREAKING\n ? undefined\n : arguments[1].loose,\n enumerableModuleMeta = process.env.BABEL_8_BREAKING\n ? undefined\n : arguments[1].loose,\n noIncompleteNsImportDetection,\n }: RewriteModuleStatementsAndPrepareHeaderOptions,\n) {\n validateImportInteropOption(importInterop);\n assert(isModule(path), \"Cannot process module statements in a script\");\n path.node.sourceType = \"script\";\n\n const meta = normalizeModuleAndLoadMetadata(path, exportName, {\n importInterop,\n initializeReexports: constantReexports,\n getWrapperPayload,\n esNamespaceOnly,\n filename,\n });\n\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n\n rewriteLiveReferences(path, meta, wrapReference);\n\n if (strictMode !== false) {\n const hasStrict = path.node.directives.some(directive => {\n return directive.value.value === \"use strict\";\n });\n if (!hasStrict) {\n path.unshiftContainer(\n \"directives\",\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n }\n }\n\n const headers = [];\n if (hasExports(meta) && !strict) {\n headers.push(buildESModuleHeader(meta, enumerableModuleMeta));\n }\n\n const nameList = buildExportNameListDeclaration(path, meta);\n\n if (nameList) {\n meta.exportNameListName = nameList.name;\n headers.push(nameList.statement);\n }\n\n // Create all of the statically known named exports.\n headers.push(\n ...buildExportInitializationStatements(\n path,\n meta,\n wrapReference,\n constantReexports,\n noIncompleteNsImportDetection,\n ),\n );\n\n return { meta, headers };\n}\n\n/**\n * Flag a set of statements as hoisted above all else so that module init\n * statements all run before user code.\n */\nexport function ensureStatementsHoisted(statements: t.Statement[]) {\n // Force all of the header fields to be at the top of the file.\n statements.forEach(header => {\n // @ts-expect-error Fixme: handle _blockHoist property\n header._blockHoist = 3;\n });\n}\n\n/**\n * Given an expression for a standard import object, like \"require('foo')\",\n * wrap it in a call to the interop helpers based on the type.\n */\nexport function wrapInterop(\n programPath: NodePath,\n expr: t.Expression,\n type: InteropType,\n): t.CallExpression {\n if (type === \"none\") {\n return null;\n }\n\n if (type === \"node-namespace\") {\n return t.callExpression(\n programPath.hub.addHelper(\"interopRequireWildcard\"),\n [expr, t.booleanLiteral(true)],\n );\n } else if (type === \"node-default\") {\n return null;\n }\n\n let helper;\n if (type === \"default\") {\n helper = \"interopRequireDefault\";\n } else if (type === \"namespace\") {\n helper = \"interopRequireWildcard\";\n } else {\n throw new Error(`Unknown interop: ${type}`);\n }\n\n return t.callExpression(programPath.hub.addHelper(helper), [expr]);\n}\n\n/**\n * Create the runtime initialization statements for a given requested source.\n * These will initialize all of the runtime import/export logic that\n * can't be handled statically by the statements created by\n * buildExportInitializationStatements().\n */\nexport function buildNamespaceInitStatements(\n metadata: ModuleMetadata,\n sourceMetadata: SourceModuleMetadata,\n constantReexports: boolean | void = false,\n wrapReference: (\n ref: t.Identifier,\n payload: unknown,\n ) => t.Expression | null = Lazy.wrapReference,\n) {\n const statements = [];\n\n const srcNamespaceId = t.identifier(sourceMetadata.name);\n\n for (const localName of sourceMetadata.importsNamespace) {\n if (localName === sourceMetadata.name) continue;\n\n // Create and assign binding to namespace object\n statements.push(\n template.statement`var NAME = SOURCE;`({\n NAME: localName,\n SOURCE: t.cloneNode(srcNamespaceId),\n }),\n );\n }\n\n const srcNamespace =\n wrapReference(srcNamespaceId, sourceMetadata.wrap) ?? srcNamespaceId;\n\n if (constantReexports) {\n statements.push(\n ...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference),\n );\n }\n for (const exportName of sourceMetadata.reexportNamespace) {\n // Assign export to namespace object.\n statements.push(\n (!t.isIdentifier(srcNamespace)\n ? template.statement`\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n `\n : template.statement`EXPORTS.NAME = NAMESPACE;`)({\n EXPORTS: metadata.exportName,\n NAME: exportName,\n NAMESPACE: t.cloneNode(srcNamespace),\n }),\n );\n }\n if (sourceMetadata.reexportAll) {\n const statement = buildNamespaceReexport(\n metadata,\n t.cloneNode(srcNamespace),\n constantReexports,\n );\n statement.loc = sourceMetadata.reexportAll.loc;\n\n // Iterate props creating getter for each prop.\n statements.push(statement);\n }\n return statements;\n}\n\ninterface ReexportParts {\n exports: string;\n exportName: string;\n namespaceImport: t.Expression;\n}\n\nconst ReexportTemplate = {\n constant: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n ${exports}.${exportName} = ${namespaceImport};\n `,\n constantComputed: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n ${exports}[\"${exportName}\"] = ${namespaceImport};\n `,\n spec: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n Object.defineProperty(${exports}, \"${exportName}\", {\n enumerable: true,\n get: function() {\n return ${namespaceImport};\n },\n });\n `,\n};\n\nfunction buildReexportsFromMeta(\n meta: ModuleMetadata,\n metadata: SourceModuleMetadata,\n constantReexports: boolean,\n wrapReference: (ref: t.Expression, payload: unknown) => t.Expression | null,\n): t.Statement[] {\n let namespace: t.Expression = t.identifier(metadata.name);\n namespace = wrapReference(namespace, metadata.wrap) ?? namespace;\n\n const { stringSpecifiers } = meta;\n return Array.from(metadata.reexports, ([exportName, importName]) => {\n let namespaceImport: t.Expression = t.cloneNode(namespace);\n if (importName === \"default\" && metadata.interop === \"node-default\") {\n // Nothing, it's ok as-is\n } else if (stringSpecifiers.has(importName)) {\n namespaceImport = t.memberExpression(\n namespaceImport,\n t.stringLiteral(importName),\n true,\n );\n } else {\n namespaceImport = t.memberExpression(\n namespaceImport,\n t.identifier(importName),\n );\n }\n const astNodes: ReexportParts = {\n exports: meta.exportName,\n exportName,\n namespaceImport,\n };\n if (constantReexports || t.isIdentifier(namespaceImport)) {\n if (stringSpecifiers.has(exportName)) {\n return ReexportTemplate.constantComputed(astNodes);\n } else {\n return ReexportTemplate.constant(astNodes);\n }\n } else {\n return ReexportTemplate.spec(astNodes);\n }\n });\n}\n\n/**\n * Build an \"__esModule\" header statement setting the property on a given object.\n */\nfunction buildESModuleHeader(\n metadata: ModuleMetadata,\n enumerableModuleMeta: boolean | void = false,\n) {\n return (\n enumerableModuleMeta\n ? template.statement`\n EXPORTS.__esModule = true;\n `\n : template.statement`\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n `\n )({ EXPORTS: metadata.exportName });\n}\n\n/**\n * Create a re-export initialization loop for a specific imported namespace.\n */\nfunction buildNamespaceReexport(\n metadata: ModuleMetadata,\n namespace: t.Expression,\n constantReexports: boolean | void,\n) {\n return (\n constantReexports\n ? template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;\n\n EXPORTS[key] = NAMESPACE[key];\n });\n `\n : // Also skip already assigned bindings if they are strictly equal\n // to be somewhat more spec-compliant when a file has multiple\n // namespace re-exports that would cause a binding to be exported\n // multiple times. However, multiple bindings of the same name that\n // export the same primitive value are silently skipped\n // (the spec requires an \"ambiguous bindings\" early error here).\n template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;\n\n Object.defineProperty(EXPORTS, key, {\n enumerable: true,\n get: function() {\n return NAMESPACE[key];\n },\n });\n });\n `\n )({\n NAMESPACE: namespace,\n EXPORTS: metadata.exportName,\n VERIFY_NAME_LIST: metadata.exportNameListName\n ? template`\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n `({ EXPORTS_LIST: metadata.exportNameListName })\n : null,\n });\n}\n\n/**\n * Build a statement declaring a variable that contains all of the exported\n * variable names in an object so they can easily be referenced from an\n * export * from statement to check for conflicts.\n */\nfunction buildExportNameListDeclaration(\n programPath: NodePath,\n metadata: ModuleMetadata,\n) {\n const exportedVars = Object.create(null);\n for (const data of metadata.local.values()) {\n for (const name of data.names) {\n exportedVars[name] = true;\n }\n }\n\n let hasReexport = false;\n for (const data of metadata.source.values()) {\n for (const exportName of data.reexports.keys()) {\n exportedVars[exportName] = true;\n }\n for (const exportName of data.reexportNamespace) {\n exportedVars[exportName] = true;\n }\n\n hasReexport = hasReexport || !!data.reexportAll;\n }\n\n if (!hasReexport || Object.keys(exportedVars).length === 0) return null;\n\n const name = programPath.scope.generateUidIdentifier(\"exportNames\");\n\n delete exportedVars.default;\n\n return {\n name: name.name,\n statement: t.variableDeclaration(\"var\", [\n t.variableDeclarator(name, t.valueToNode(exportedVars)),\n ]),\n };\n}\n\n/**\n * Create a set of statements that will initialize all of the statically-known\n * export names with their expected values.\n */\nfunction buildExportInitializationStatements(\n programPath: NodePath,\n metadata: ModuleMetadata,\n wrapReference: (ref: t.Expression, payload: unknown) => t.Expression | null,\n constantReexports: boolean | void = false,\n noIncompleteNsImportDetection: boolean | void = false,\n) {\n const initStatements: Array<[string, t.Statement | null]> = [];\n\n for (const [localName, data] of metadata.local) {\n if (data.kind === \"import\") {\n // No-open since these are explicitly set with the \"reexports\" block.\n } else if (data.kind === \"hoisted\") {\n initStatements.push([\n // data.names is always of length 1 because a hoisted export\n // name must be id of a function declaration\n data.names[0],\n buildInitStatement(metadata, data.names, t.identifier(localName)),\n ]);\n } else if (!noIncompleteNsImportDetection) {\n for (const exportName of data.names) {\n initStatements.push([exportName, null]);\n }\n }\n }\n\n for (const data of metadata.source.values()) {\n if (!constantReexports) {\n const reexportsStatements = buildReexportsFromMeta(\n metadata,\n data,\n false,\n wrapReference,\n );\n const reexports = [...data.reexports.keys()];\n for (let i = 0; i < reexportsStatements.length; i++) {\n initStatements.push([reexports[i], reexportsStatements[i]]);\n }\n }\n if (!noIncompleteNsImportDetection) {\n for (const exportName of data.reexportNamespace) {\n initStatements.push([exportName, null]);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-module-namespace-exotic-objects\n // The [Exports] list is ordered as if an Array of those String values\n // had been sorted using %Array.prototype.sort% using undefined as comparefn\n initStatements.sort(([a], [b]) => {\n if (a < b) return -1;\n if (b < a) return 1;\n return 0;\n });\n\n const results = [];\n if (noIncompleteNsImportDetection) {\n for (const [, initStatement] of initStatements) {\n results.push(initStatement);\n }\n } else {\n // We generate init statements (`exports.a = exports.b = ... = void 0`)\n // for every 100 exported names to avoid deeply-nested AST structures.\n const chunkSize = 100;\n for (let i = 0; i < initStatements.length; i += chunkSize) {\n let uninitializedExportNames = [];\n for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {\n const [exportName, initStatement] = initStatements[i + j];\n if (initStatement !== null) {\n if (uninitializedExportNames.length > 0) {\n results.push(\n buildInitStatement(\n metadata,\n uninitializedExportNames,\n programPath.scope.buildUndefinedNode(),\n ),\n );\n // reset after uninitializedExportNames has been transformed\n // to init statements\n uninitializedExportNames = [];\n }\n results.push(initStatement);\n } else {\n uninitializedExportNames.push(exportName);\n }\n }\n if (uninitializedExportNames.length > 0) {\n results.push(\n buildInitStatement(\n metadata,\n uninitializedExportNames,\n programPath.scope.buildUndefinedNode(),\n ),\n );\n }\n }\n }\n\n return results;\n}\n\ninterface InitParts {\n exports: string;\n name: string;\n value: t.Expression;\n}\n\n/**\n * Given a set of export names, create a set of nested assignments to\n * initialize them all to a given expression.\n */\nconst InitTemplate = {\n computed: ({ exports, name, value }: InitParts) =>\n template.expression.ast`${exports}[\"${name}\"] = ${value}`,\n default: ({ exports, name, value }: InitParts) =>\n template.expression.ast`${exports}.${name} = ${value}`,\n define: ({ exports, name, value }: InitParts) =>\n template.expression.ast`\n Object.defineProperty(${exports}, \"${name}\", {\n enumerable: true,\n value: void 0,\n writable: true\n })[\"${name}\"] = ${value}`,\n};\n\nfunction buildInitStatement(\n metadata: ModuleMetadata,\n exportNames: string[],\n initExpr: t.Expression,\n) {\n const { stringSpecifiers, exportName: exports } = metadata;\n return t.expressionStatement(\n exportNames.reduce((value, name) => {\n const params = {\n exports,\n name,\n value,\n };\n\n if (name === \"__proto__\") {\n return InitTemplate.define(params);\n }\n\n if (stringSpecifiers.has(name)) {\n return InitTemplate.computed(params);\n }\n\n return InitTemplate.default(params);\n }, initExpr),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,oBAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAL,OAAA;AAWA,IAAAM,IAAA,GAAAN,OAAA;AAGA,IAAAO,cAAA,GAAAP,OAAA;AASA,IAAAQ,cAAA,GAAAR,OAAA;AAPiE;EAE/DS,OAAO,CAACC,sBAAsB,GAE5BV,OAAO,CAAC,kBAAkB,CAAC,CAACU,sBAAsB;AACtD;AAmCO,SAASC,uCAAuCA,CACrDC,IAAyB,EACzB;EACEC,UAAU;EACVC,MAAM;EACNC,iBAAiB;EACjBC,UAAU;EACVC,SAAS;EACTC,aAAa,GAAGD,SAAS,GAAG,MAAM,GAAG,OAAO;EAG5CE,IAAI;EACJC,iBAAiB,GAAGd,IAAI,CAACe,mBAAmB,CAACF,IAAI,WAAJA,IAAI,GAAI,KAAK,CAAC;EAC3DG,aAAa,GAAGhB,IAAI,CAACgB,aAAa;EAClCC,eAAe;EACfC,QAAQ;EAERC,iBAAiB,GAEbC,SAAS,CAAC,CAAC,CAAC,CAACC,KAAK;EACtBC,oBAAoB,GAEhBF,SAAS,CAAC,CAAC,CAAC,CAACC,KAAK;EACtBE;AAC8C,CAAC,EACjD;EACA,IAAAC,qDAA2B,EAACZ,aAAa,CAAC;EAC1Ca,OAAM,CAA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C,KAC3CqC,cAAQ,CAACmE,UAAU,CAAClD,GAAG,GAAGzF,OAAO,IAAI8C,IAAI,MAAMX,KAAK,EAAE;EACxDyG,MAAM,EAAEA,CAAC;IAAE5I,OAAO;IAAE8C,IAAI;IAAEX;EAAiB,CAAC,KAC1CqC,cAAQ,CAACmE,UAAU,CAAClD,GAAG;AAC3B,8BAA8BzF,OAAO,MAAM8C,IAAI;AAC/C;AACA;AACA;AACA,YAAYA,IAAI,QAAQX,KAAK;AAC7B,CAAC;AAED,SAAS0F,kBAAkBA,CACzB5D,QAAwB,EACxB4E,WAAqB,EACrBC,QAAsB,EACtB;EACA,MAAM;IAAEhD,gBAAgB;IAAE1F,UAAU,EAAEJ;EAAQ,CAAC,GAAGiE,QAAQ;EAC1D,OAAO5B,WAAC,CAAC0G,mBAAmB,CAC1BF,WAAW,CAACG,MAAM,CAAC,CAAC7G,KAAK,EAAEW,IAAI,KAAK;IAClC,MAAMmG,MAAM,GAAG;MACbjJ,OAAO;MACP8C,IAAI;MACJX;IACF,CAAC;IAED,IAAIW,IAAI,KAAK,WAAW,EAAE;MACxB,OAAO2F,YAAY,CAACG,MAAM,CAACK,MAAM,CAAC;IACpC;IAEA,IAAInD,gBAAgB,CAACM,GAAG,CAACtD,IAAI,CAAC,EAAE;MAC9B,OAAO2F,YAAY,CAACC,QAAQ,CAACO,MAAM,CAAC;IACtC;IAEA,OAAOR,YAAY,CAAClB,OAAO,CAAC0B,MAAM,CAAC;EACrC,CAAC,EAAEH,QAAQ,CACb,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js new file mode 100644 index 0000000..acc89ff --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.toGetWrapperPayload = toGetWrapperPayload; +exports.wrapReference = wrapReference; +var _core = require("@babel/core"); +var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js"); +function toGetWrapperPayload(lazy) { + return (source, metadata) => { + if (lazy === false) return null; + if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null; + if (lazy === true) { + return source.includes(".") ? null : "lazy"; + } + if (Array.isArray(lazy)) { + return !lazy.includes(source) ? null : "lazy"; + } + if (typeof lazy === "function") { + return lazy(source) ? "lazy" : null; + } + throw new Error(`.lazy must be a boolean, string array, or function`); + }; +} +function wrapReference(ref, payload) { + if (payload === "lazy") return _core.types.callExpression(ref, []); + return null; +} + +//# sourceMappingURL=lazy-modules.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map new file mode 100644 index 0000000..890839b --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","_normalizeAndLoadMetadata","toGetWrapperPayload","lazy","source","metadata","isSideEffectImport","reexportAll","includes","Array","isArray","Error","wrapReference","ref","payload","t","callExpression"],"sources":["../src/lazy-modules.ts"],"sourcesContent":["// TODO: Move `lazy` implementation logic into the CommonJS plugin, since other\n// modules systems do not support `lazy`.\n\nimport { types as t } from \"@babel/core\";\nimport {\n type SourceModuleMetadata,\n isSideEffectImport,\n} from \"./normalize-and-load-metadata.ts\";\n\nexport type Lazy = boolean | string[] | ((source: string) => boolean);\n\nexport function toGetWrapperPayload(lazy: Lazy) {\n return (source: string, metadata: SourceModuleMetadata): null | \"lazy\" => {\n if (lazy === false) return null;\n if (isSideEffectImport(metadata) || metadata.reexportAll) return null;\n if (lazy === true) {\n // 'true' means that local relative files are eagerly loaded and\n // dependency modules are loaded lazily.\n return source.includes(\".\") ? null : \"lazy\";\n }\n if (Array.isArray(lazy)) {\n return !lazy.includes(source) ? null : \"lazy\";\n }\n if (typeof lazy === \"function\") {\n return lazy(source) ? \"lazy\" : null;\n }\n throw new Error(`.lazy must be a boolean, string array, or function`);\n };\n}\n\nexport function wrapReference(\n ref: t.Identifier,\n payload: unknown,\n): t.Expression | null {\n if (payload === \"lazy\") return t.callExpression(ref, []);\n return null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AAOO,SAASE,mBAAmBA,CAACC,IAAU,EAAE;EAC9C,OAAO,CAACC,MAAc,EAAEC,QAA8B,KAAoB;IACxE,IAAIF,IAAI,KAAK,KAAK,EAAE,OAAO,IAAI;IAC/B,IAAI,IAAAG,4CAAkB,EAACD,QAAQ,CAAC,IAAIA,QAAQ,CAACE,WAAW,EAAE,OAAO,IAAI;IACrE,IAAIJ,IAAI,KAAK,IAAI,EAAE;MAGjB,OAAOC,MAAM,CAACI,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,MAAM;IAC7C;IACA,IAAIC,KAAK,CAACC,OAAO,CAACP,IAAI,CAAC,EAAE;MACvB,OAAO,CAACA,IAAI,CAACK,QAAQ,CAACJ,MAAM,CAAC,GAAG,IAAI,GAAG,MAAM;IAC/C;IACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;MAC9B,OAAOA,IAAI,CAACC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IACrC;IACA,MAAM,IAAIO,KAAK,CAAC,oDAAoD,CAAC;EACvE,CAAC;AACH;AAEO,SAASC,aAAaA,CAC3BC,GAAiB,EACjBC,OAAgB,EACK;EACrB,IAAIA,OAAO,KAAK,MAAM,EAAE,OAAOC,WAAC,CAACC,cAAc,CAACH,GAAG,EAAE,EAAE,CAAC;EACxD,OAAO,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js new file mode 100644 index 0000000..5cf361f --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js @@ -0,0 +1,364 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = normalizeModuleAndLoadMetadata; +exports.hasExports = hasExports; +exports.isSideEffectImport = isSideEffectImport; +exports.validateImportInteropOption = validateImportInteropOption; +var _path = require("path"); +var _helperValidatorIdentifier = require("@babel/helper-validator-identifier"); +function hasExports(metadata) { + return metadata.hasExports; +} +function isSideEffectImport(source) { + return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll; +} +function validateImportInteropOption(importInterop) { + if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") { + throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`); + } + return importInterop; +} +function resolveImportInterop(importInterop, source, filename) { + if (typeof importInterop === "function") { + return validateImportInteropOption(importInterop(source, filename)); + } + return importInterop; +} +function normalizeModuleAndLoadMetadata(programPath, exportName, { + importInterop, + initializeReexports = false, + getWrapperPayload, + esNamespaceOnly = false, + filename +}) { + if (!exportName) { + exportName = programPath.scope.generateUidIdentifier("exports").name; + } + const stringSpecifiers = new Set(); + nameAnonymousExports(programPath); + const { + local, + sources, + hasExports + } = getModuleMetadata(programPath, { + initializeReexports, + getWrapperPayload + }, stringSpecifiers); + removeImportExportDeclarations(programPath); + for (const [source, metadata] of sources) { + const { + importsNamespace, + imports + } = metadata; + if (importsNamespace.size > 0 && imports.size === 0) { + const [nameOfnamespace] = importsNamespace; + metadata.name = nameOfnamespace; + } + const resolvedInterop = resolveImportInterop(importInterop, source, filename); + if (resolvedInterop === "none") { + metadata.interop = "none"; + } else if (resolvedInterop === "node" && metadata.interop === "namespace") { + metadata.interop = "node-namespace"; + } else if (resolvedInterop === "node" && metadata.interop === "default") { + metadata.interop = "node-default"; + } else if (esNamespaceOnly && metadata.interop === "namespace") { + metadata.interop = "default"; + } + } + return { + exportName, + exportNameListName: null, + hasExports, + local, + source: sources, + stringSpecifiers + }; +} +function getExportSpecifierName(path, stringSpecifiers) { + if (path.isIdentifier()) { + return path.node.name; + } else if (path.isStringLiteral()) { + const stringValue = path.node.value; + if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) { + stringSpecifiers.add(stringValue); + } + return stringValue; + } else { + throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`); + } +} +function assertExportSpecifier(path) { + if (path.isExportSpecifier()) { + return; + } else if (path.isExportNamespaceSpecifier()) { + throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`."); + } else { + throw path.buildCodeFrameError("Unexpected export specifier type"); + } +} +function getModuleMetadata(programPath, { + getWrapperPayload, + initializeReexports +}, stringSpecifiers) { + const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers); + const importNodes = new Map(); + const sourceData = new Map(); + const getData = (sourceNode, node) => { + const source = sourceNode.value; + let data = sourceData.get(source); + if (!data) { + data = { + name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name, + interop: "none", + loc: null, + imports: new Map(), + importsNamespace: new Set(), + reexports: new Map(), + reexportNamespace: new Set(), + reexportAll: null, + wrap: null, + get lazy() { + return this.wrap === "lazy"; + }, + referenced: false + }; + sourceData.set(source, data); + importNodes.set(source, [node]); + } else { + importNodes.get(source).push(node); + } + return data; + }; + let hasExports = false; + programPath.get("body").forEach(child => { + if (child.isImportDeclaration()) { + const data = getData(child.node.source, child.node); + if (!data.loc) data.loc = child.node.loc; + child.get("specifiers").forEach(spec => { + if (spec.isImportDefaultSpecifier()) { + const localName = spec.get("local").node.name; + data.imports.set(localName, "default"); + const reexport = localData.get(localName); + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexports.set(name, "default"); + }); + data.referenced = true; + } + } else if (spec.isImportNamespaceSpecifier()) { + const localName = spec.get("local").node.name; + data.importsNamespace.add(localName); + const reexport = localData.get(localName); + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexportNamespace.add(name); + }); + data.referenced = true; + } + } else if (spec.isImportSpecifier()) { + const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers); + const localName = spec.get("local").node.name; + data.imports.set(localName, importName); + const reexport = localData.get(localName); + if (reexport) { + localData.delete(localName); + reexport.names.forEach(name => { + data.reexports.set(name, importName); + }); + data.referenced = true; + } + } + }); + } else if (child.isExportAllDeclaration()) { + hasExports = true; + const data = getData(child.node.source, child.node); + if (!data.loc) data.loc = child.node.loc; + data.reexportAll = { + loc: child.node.loc + }; + data.referenced = true; + } else if (child.isExportNamedDeclaration() && child.node.source) { + hasExports = true; + const data = getData(child.node.source, child.node); + if (!data.loc) data.loc = child.node.loc; + child.get("specifiers").forEach(spec => { + assertExportSpecifier(spec); + const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers); + const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers); + data.reexports.set(exportName, importName); + data.referenced = true; + if (exportName === "__esModule") { + throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".'); + } + }); + } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) { + hasExports = true; + } + }); + for (const metadata of sourceData.values()) { + let needsDefault = false; + let needsNamed = false; + if (metadata.importsNamespace.size > 0) { + needsDefault = true; + needsNamed = true; + } + if (metadata.reexportAll) { + needsNamed = true; + } + for (const importName of metadata.imports.values()) { + if (importName === "default") needsDefault = true;else needsNamed = true; + } + for (const importName of metadata.reexports.values()) { + if (importName === "default") needsDefault = true;else needsNamed = true; + } + if (needsDefault && needsNamed) { + metadata.interop = "namespace"; + } else if (needsDefault) { + metadata.interop = "default"; + } + } + if (getWrapperPayload) { + for (const [source, metadata] of sourceData) { + metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source)); + } + } + return { + hasExports, + local: localData, + sources: sourceData + }; +} +function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) { + const bindingKindLookup = new Map(); + const programScope = programPath.scope; + const programChildren = programPath.get("body"); + programChildren.forEach(child => { + let kind; + if (child.isImportDeclaration()) { + kind = "import"; + } else { + if (child.isExportDefaultDeclaration()) { + child = child.get("declaration"); + } + if (child.isExportNamedDeclaration()) { + if (child.node.declaration) { + child = child.get("declaration"); + } else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) { + child.get("specifiers").forEach(spec => { + assertExportSpecifier(spec); + bindingKindLookup.set(spec.get("local").node.name, "block"); + }); + return; + } + } + if (child.isFunctionDeclaration()) { + kind = "hoisted"; + } else if (child.isClassDeclaration()) { + kind = "block"; + } else if (child.isVariableDeclaration({ + kind: "var" + })) { + kind = "var"; + } else if (child.isVariableDeclaration()) { + kind = "block"; + } else { + return; + } + } + Object.keys(child.getOuterBindingIdentifiers()).forEach(name => { + bindingKindLookup.set(name, kind); + }); + }); + const localMetadata = new Map(); + const getLocalMetadata = idPath => { + const localName = idPath.node.name; + let metadata = localMetadata.get(localName); + if (!metadata) { + var _bindingKindLookup$ge, _programScope$getBind; + const kind = (_bindingKindLookup$ge = bindingKindLookup.get(localName)) != null ? _bindingKindLookup$ge : (_programScope$getBind = programScope.getBinding(localName)) == null ? void 0 : _programScope$getBind.kind; + if (kind === undefined) { + throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`); + } + metadata = { + names: [], + kind + }; + localMetadata.set(localName, metadata); + } + return metadata; + }; + programChildren.forEach(child => { + if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) { + if (child.node.declaration) { + const declaration = child.get("declaration"); + const ids = declaration.getOuterBindingIdentifierPaths(); + Object.keys(ids).forEach(name => { + if (name === "__esModule") { + throw declaration.buildCodeFrameError('Illegal export "__esModule".'); + } + getLocalMetadata(ids[name]).names.push(name); + }); + } else { + child.get("specifiers").forEach(spec => { + const local = spec.get("local"); + const exported = spec.get("exported"); + const localMetadata = getLocalMetadata(local); + const exportName = getExportSpecifierName(exported, stringSpecifiers); + if (exportName === "__esModule") { + throw exported.buildCodeFrameError('Illegal export "__esModule".'); + } + localMetadata.names.push(exportName); + }); + } + } else if (child.isExportDefaultDeclaration()) { + const declaration = child.get("declaration"); + if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { + getLocalMetadata(declaration.get("id")).names.push("default"); + } else { + throw declaration.buildCodeFrameError("Unexpected default expression export."); + } + } + }); + return localMetadata; +} +function nameAnonymousExports(programPath) { + programPath.get("body").forEach(child => { + if (!child.isExportDefaultDeclaration()) return; + { + var _child$splitExportDec; + (_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration; + } + child.splitExportDeclaration(); + }); +} +function removeImportExportDeclarations(programPath) { + programPath.get("body").forEach(child => { + if (child.isImportDeclaration()) { + child.remove(); + } else if (child.isExportNamedDeclaration()) { + if (child.node.declaration) { + child.node.declaration._blockHoist = child.node._blockHoist; + child.replaceWith(child.node.declaration); + } else { + child.remove(); + } + } else if (child.isExportDefaultDeclaration()) { + const declaration = child.get("declaration"); + if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { + declaration._blockHoist = child.node._blockHoist; + child.replaceWith(declaration); + } else { + throw declaration.buildCodeFrameError("Unexpected default expression export."); + } + } else if (child.isExportAllDeclaration()) { + child.remove(); + } + }); +} + +//# sourceMappingURL=normalize-and-load-metadata.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map new file mode 100644 index 0000000..46fb2fd --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_path","require","_helperValidatorIdentifier","hasExports","metadata","isSideEffectImport","source","imports","size","importsNamespace","reexports","reexportNamespace","reexportAll","validateImportInteropOption","importInterop","Error","resolveImportInterop","filename","normalizeModuleAndLoadMetadata","programPath","exportName","initializeReexports","getWrapperPayload","esNamespaceOnly","scope","generateUidIdentifier","name","stringSpecifiers","Set","nameAnonymousExports","local","sources","getModuleMetadata","removeImportExportDeclarations","nameOfnamespace","resolvedInterop","interop","exportNameListName","getExportSpecifierName","path","isIdentifier","node","isStringLiteral","stringValue","value","isIdentifierName","add","type","assertExportSpecifier","isExportSpecifier","isExportNamespaceSpecifier","buildCodeFrameError","localData","getLocalExportMetadata","importNodes","Map","sourceData","getData","sourceNode","data","get","basename","extname","loc","wrap","lazy","referenced","set","push","forEach","child","isImportDeclaration","spec","isImportDefaultSpecifier","localName","reexport","delete","names","isImportNamespaceSpecifier","isImportSpecifier","importName","isExportAllDeclaration","isExportNamedDeclaration","isExportDefaultDeclaration","values","needsDefault","needsNamed","bindingKindLookup","programScope","programChildren","kind","declaration","isFunctionDeclaration","isClassDeclaration","isVariableDeclaration","Object","keys","getOuterBindingIdentifiers","localMetadata","getLocalMetadata","idPath","_bindingKindLookup$ge","_programScope$getBind","getBinding","undefined","ids","getOuterBindingIdentifierPaths","exported","_child$splitExportDec","splitExportDeclaration","NodePath","prototype","remove","_blockHoist","replaceWith"],"sources":["../src/normalize-and-load-metadata.ts"],"sourcesContent":["import { basename, extname } from \"node:path\";\nimport type { types as t, NodePath } from \"@babel/core\";\n\nimport { isIdentifierName } from \"@babel/helper-validator-identifier\";\n\nexport interface ModuleMetadata {\n exportName: string;\n // The name of the variable that will reference an object containing export names.\n exportNameListName: null | string;\n hasExports: boolean;\n // Lookup from local binding to export information.\n local: Map;\n // Lookup of source file to source file metadata.\n source: Map;\n // List of names that should only be printed as string literals.\n // i.e. `import { \"any unicode\" as foo } from \"some-module\"`\n // `stringSpecifiers` is Set(1) [\"any unicode\"]\n // In most cases `stringSpecifiers` is an empty Set\n stringSpecifiers: Set;\n}\n\nexport type InteropType =\n | \"default\" // Babel interop for default-only imports\n | \"namespace\" // Babel interop for namespace or default+named imports\n | \"node-default\" // Node.js interop for default-only imports\n | \"node-namespace\" // Node.js interop for namespace or default+named imports\n | \"none\"; // No interop, or named-only imports\n\nexport type ImportInterop =\n | \"none\"\n | \"babel\"\n | \"node\"\n | ((source: string, filename?: string) => \"none\" | \"babel\" | \"node\");\n\nexport interface SourceModuleMetadata {\n // A unique variable name to use for this namespace object. Centralized for simplicity.\n name: string;\n loc: t.SourceLocation | undefined | null;\n interop: InteropType;\n // Local binding to reference from this source namespace. Key: Local name, value: Import name\n imports: Map;\n // Local names that reference namespace object.\n importsNamespace: Set;\n // Reexports to create for namespace. Key: Export name, value: Import name\n reexports: Map;\n // List of names to re-export namespace as.\n reexportNamespace: Set;\n // Tracks if the source should be re-exported.\n reexportAll: null | {\n loc: t.SourceLocation | undefined | null;\n };\n wrap?: unknown;\n referenced: boolean;\n}\n\nexport interface LocalExportMetadata {\n names: Array; // names of exports,\n kind: \"import\" | \"hoisted\" | \"block\" | \"var\";\n}\n\n/**\n * Check if the module has any exports that need handling.\n */\nexport function hasExports(metadata: ModuleMetadata) {\n return metadata.hasExports;\n}\n\n/**\n * Check if a given source is an anonymous import, e.g. \"import 'foo';\"\n */\nexport function isSideEffectImport(source: SourceModuleMetadata) {\n return (\n source.imports.size === 0 &&\n source.importsNamespace.size === 0 &&\n source.reexports.size === 0 &&\n source.reexportNamespace.size === 0 &&\n !source.reexportAll\n );\n}\n\nexport function validateImportInteropOption(\n importInterop: any,\n): importInterop is ImportInterop {\n if (\n typeof importInterop !== \"function\" &&\n importInterop !== \"none\" &&\n importInterop !== \"babel\" &&\n importInterop !== \"node\"\n ) {\n throw new Error(\n `.importInterop must be one of \"none\", \"babel\", \"node\", or a function returning one of those values (received ${importInterop}).`,\n );\n }\n return importInterop;\n}\n\nfunction resolveImportInterop(\n importInterop: ImportInterop,\n source: string,\n filename: string | undefined,\n) {\n if (typeof importInterop === \"function\") {\n return validateImportInteropOption(importInterop(source, filename));\n }\n return importInterop;\n}\n\n/**\n * Remove all imports and exports from the file, and return all metadata\n * needed to reconstruct the module's behavior.\n */\nexport default function normalizeModuleAndLoadMetadata(\n programPath: NodePath,\n exportName: string,\n {\n importInterop,\n initializeReexports = false,\n getWrapperPayload,\n esNamespaceOnly = false,\n filename,\n }: {\n importInterop: ImportInterop;\n initializeReexports: boolean | void;\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n esNamespaceOnly: boolean;\n filename: string;\n },\n): ModuleMetadata {\n if (!exportName) {\n exportName = programPath.scope.generateUidIdentifier(\"exports\").name;\n }\n const stringSpecifiers = new Set();\n\n nameAnonymousExports(programPath);\n\n const { local, sources, hasExports } = getModuleMetadata(\n programPath,\n { initializeReexports, getWrapperPayload },\n stringSpecifiers,\n );\n\n removeImportExportDeclarations(programPath);\n\n // Reuse the imported namespace name if there is one.\n for (const [source, metadata] of sources) {\n const { importsNamespace, imports } = metadata;\n // If there is at least one namespace import and other imports, it may collipse with local ident, can be seen in issue 15879.\n if (importsNamespace.size > 0 && imports.size === 0) {\n const [nameOfnamespace] = importsNamespace;\n metadata.name = nameOfnamespace;\n }\n\n const resolvedInterop = resolveImportInterop(\n importInterop,\n source,\n filename,\n );\n\n if (resolvedInterop === \"none\") {\n metadata.interop = \"none\";\n } else if (resolvedInterop === \"node\" && metadata.interop === \"namespace\") {\n metadata.interop = \"node-namespace\";\n } else if (resolvedInterop === \"node\" && metadata.interop === \"default\") {\n metadata.interop = \"node-default\";\n } else if (esNamespaceOnly && metadata.interop === \"namespace\") {\n // Both the default and namespace interops pass through __esModule\n // objects, but the namespace interop is used to enable Babel's\n // destructuring-like interop behavior for normal CommonJS.\n // Since some tooling has started to remove that behavior, we expose\n // it as the `esNamespace` option.\n metadata.interop = \"default\";\n }\n }\n\n return {\n exportName,\n exportNameListName: null,\n hasExports,\n local,\n source: sources,\n stringSpecifiers,\n };\n}\n\nfunction getExportSpecifierName(\n path: NodePath,\n stringSpecifiers: Set,\n): string {\n if (path.isIdentifier()) {\n return path.node.name;\n } else if (path.isStringLiteral()) {\n const stringValue = path.node.value;\n // add specifier value to `stringSpecifiers` only when it can not be converted to an identifier name\n // i.e In `import { \"foo\" as bar }`\n // we do not consider `\"foo\"` to be a `stringSpecifier` because we can treat it as\n // `import { foo as bar }`\n // This helps minimize the size of `stringSpecifiers` and reduce overhead of checking valid identifier names\n // when building transpiled code from metadata\n if (!isIdentifierName(stringValue)) {\n stringSpecifiers.add(stringValue);\n }\n return stringValue;\n } else {\n throw new Error(\n `Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`,\n );\n }\n}\n\nfunction assertExportSpecifier(\n path: NodePath,\n): asserts path is NodePath {\n if (path.isExportSpecifier()) {\n return;\n } else if (path.isExportNamespaceSpecifier()) {\n throw path.buildCodeFrameError(\n \"Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.\",\n );\n } else {\n throw path.buildCodeFrameError(\"Unexpected export specifier type\");\n }\n}\n\n/**\n * Get metadata about the imports and exports present in this module.\n */\nfunction getModuleMetadata(\n programPath: NodePath,\n {\n getWrapperPayload,\n initializeReexports,\n }: {\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n initializeReexports: boolean | void;\n },\n stringSpecifiers: Set,\n) {\n const localData = getLocalExportMetadata(\n programPath,\n initializeReexports,\n stringSpecifiers,\n );\n\n const importNodes = new Map();\n const sourceData = new Map();\n const getData = (sourceNode: t.StringLiteral, node: t.Node) => {\n const source = sourceNode.value;\n\n let data = sourceData.get(source);\n if (!data) {\n data = {\n name: programPath.scope.generateUidIdentifier(\n basename(source, extname(source)),\n ).name,\n\n interop: \"none\",\n\n loc: null,\n\n // Data about the requested sources and names.\n imports: new Map(),\n importsNamespace: new Set(),\n\n // Metadata about data that is passed directly from source to export.\n reexports: new Map(),\n reexportNamespace: new Set(),\n reexportAll: null,\n\n wrap: null,\n\n // @ts-expect-error lazy is not listed in the type.\n // This is needed for compatibility with older version of the commonjs\n // plugins.\n // TODO(Babel 8): Remove this\n get lazy() {\n return this.wrap === \"lazy\";\n },\n\n referenced: false,\n };\n sourceData.set(source, data);\n importNodes.set(source, [node]);\n } else {\n importNodes.get(source).push(node);\n }\n return data;\n };\n let hasExports = false;\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n if (spec.isImportDefaultSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, \"default\");\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, \"default\");\n });\n data.referenced = true;\n }\n } else if (spec.isImportNamespaceSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.importsNamespace.add(localName);\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexportNamespace.add(name);\n });\n data.referenced = true;\n }\n } else if (spec.isImportSpecifier()) {\n const importName = getExportSpecifierName(\n spec.get(\"imported\"),\n stringSpecifiers,\n );\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, importName);\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, importName);\n });\n data.referenced = true;\n }\n }\n });\n } else if (child.isExportAllDeclaration()) {\n hasExports = true;\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n data.reexportAll = {\n loc: child.node.loc,\n };\n data.referenced = true;\n } else if (child.isExportNamedDeclaration() && child.node.source) {\n hasExports = true;\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n assertExportSpecifier(spec);\n const importName = getExportSpecifierName(\n spec.get(\"local\"),\n stringSpecifiers,\n );\n const exportName = getExportSpecifierName(\n spec.get(\"exported\"),\n stringSpecifiers,\n );\n\n data.reexports.set(exportName, importName);\n data.referenced = true;\n\n if (exportName === \"__esModule\") {\n throw spec\n .get(\"exported\")\n .buildCodeFrameError('Illegal export \"__esModule\".');\n }\n });\n } else if (\n child.isExportNamedDeclaration() ||\n child.isExportDefaultDeclaration()\n ) {\n hasExports = true;\n }\n });\n\n for (const metadata of sourceData.values()) {\n let needsDefault = false;\n let needsNamed = false;\n\n if (metadata.importsNamespace.size > 0) {\n needsDefault = true;\n needsNamed = true;\n }\n\n if (metadata.reexportAll) {\n needsNamed = true;\n }\n\n for (const importName of metadata.imports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n for (const importName of metadata.reexports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n\n if (needsDefault && needsNamed) {\n // TODO(logan): Using the namespace interop here is unfortunate. Revisit.\n metadata.interop = \"namespace\";\n } else if (needsDefault) {\n metadata.interop = \"default\";\n }\n }\n\n if (getWrapperPayload) {\n for (const [source, metadata] of sourceData) {\n metadata.wrap = getWrapperPayload(\n source,\n metadata,\n importNodes.get(source),\n );\n }\n }\n\n return {\n hasExports,\n local: localData,\n sources: sourceData,\n };\n}\n\ntype ModuleBindingKind = \"import\" | \"hoisted\" | \"block\" | \"var\";\n/**\n * Get metadata about local variables that are exported.\n */\nfunction getLocalExportMetadata(\n programPath: NodePath,\n initializeReexports: boolean | void,\n stringSpecifiers: Set,\n): Map {\n const bindingKindLookup = new Map();\n\n const programScope = programPath.scope;\n const programChildren = programPath.get(\"body\");\n\n programChildren.forEach((child: NodePath) => {\n let kind: ModuleBindingKind;\n if (child.isImportDeclaration()) {\n kind = \"import\";\n } else {\n if (child.isExportDefaultDeclaration()) {\n child = child.get(\"declaration\");\n }\n if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child = child.get(\"declaration\");\n } else if (\n initializeReexports &&\n child.node.source &&\n child.get(\"source\").isStringLiteral()\n ) {\n child.get(\"specifiers\").forEach(spec => {\n assertExportSpecifier(spec);\n bindingKindLookup.set(spec.get(\"local\").node.name, \"block\");\n });\n return;\n }\n }\n\n if (child.isFunctionDeclaration()) {\n kind = \"hoisted\";\n } else if (child.isClassDeclaration()) {\n kind = \"block\";\n } else if (child.isVariableDeclaration({ kind: \"var\" })) {\n kind = \"var\";\n } else if (child.isVariableDeclaration()) {\n kind = \"block\";\n } else {\n return;\n }\n }\n\n Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {\n bindingKindLookup.set(name, kind);\n });\n });\n\n const localMetadata = new Map();\n const getLocalMetadata = (idPath: NodePath) => {\n const localName = idPath.node.name;\n let metadata = localMetadata.get(localName);\n\n if (!metadata) {\n // If localName is not found in the bindingKindLookup generated\n // from top level declarations, it could be a reference to a var\n // declaration defined within block statement or switch case\n const kind: ModuleBindingKind =\n bindingKindLookup.get(localName) ??\n (programScope.getBinding(localName)?.kind as \"var\" | undefined);\n\n if (kind === undefined) {\n throw idPath.buildCodeFrameError(\n `Exporting local \"${localName}\", which is not declared.`,\n );\n }\n\n metadata = {\n names: [],\n kind,\n };\n localMetadata.set(localName, metadata);\n }\n return metadata;\n };\n\n programChildren.forEach(child => {\n if (\n child.isExportNamedDeclaration() &&\n (initializeReexports || !child.node.source)\n ) {\n if (child.node.declaration) {\n const declaration = child.get(\"declaration\");\n const ids = declaration.getOuterBindingIdentifierPaths();\n Object.keys(ids).forEach(name => {\n if (name === \"__esModule\") {\n throw declaration.buildCodeFrameError(\n 'Illegal export \"__esModule\".',\n );\n }\n getLocalMetadata(ids[name]).names.push(name);\n });\n } else {\n child.get(\"specifiers\").forEach(spec => {\n const local = spec.get(\"local\");\n const exported = spec.get(\"exported\");\n const localMetadata = getLocalMetadata(local);\n const exportName = getExportSpecifierName(exported, stringSpecifiers);\n\n if (exportName === \"__esModule\") {\n throw exported.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n localMetadata.names.push(exportName);\n });\n }\n } else if (child.isExportDefaultDeclaration()) {\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n getLocalMetadata(declaration.get(\"id\")).names.push(\"default\");\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n }\n });\n return localMetadata;\n}\n\n/**\n * Ensure that all exported values have local binding names.\n */\nfunction nameAnonymousExports(programPath: NodePath) {\n // Name anonymous exported locals.\n programPath.get(\"body\").forEach(child => {\n if (!child.isExportDefaultDeclaration()) return;\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n child.splitExportDeclaration ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.splitExportDeclaration;\n }\n child.splitExportDeclaration();\n });\n}\n\nfunction removeImportExportDeclarations(programPath: NodePath) {\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n child.remove();\n } else if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n // @ts-expect-error todo(flow->ts): avoid mutations\n child.node.declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(child.node.declaration);\n } else {\n child.remove();\n }\n } else if (child.isExportDefaultDeclaration()) {\n // export default foo;\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n // @ts-expect-error todo(flow->ts): avoid mutations\n declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(declaration);\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n } else if (child.isExportAllDeclaration()) {\n child.remove();\n }\n });\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,0BAAA,GAAAD,OAAA;AA4DO,SAASE,UAAUA,CAACC,QAAwB,EAAE;EACnD,OAAOA,QAAQ,CAACD,UAAU;AAC5B;AAKO,SAASE,kBAAkBA,CAACC,MAA4B,EAAE;EAC/D,OACEA,MAAM,CAACC,OAAO,CAACC,IAAI,KAAK,CAAC,IACzBF,MA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W,CAAC;MAChC,CAAC,MAAM;QAEL,MAAMA,WAAW,CAACxC,mBAAmB,CACnC,uCACF,CAAC;MACH;IACF,CAAC,MAAM,IAAImB,KAAK,CAACW,sBAAsB,CAAC,CAAC,EAAE;MACzCX,KAAK,CAAC0C,MAAM,CAAC,CAAC;IAChB;EACF,CAAC,CAAC;AACJ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js new file mode 100644 index 0000000..f19f0f0 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js @@ -0,0 +1,360 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rewriteLiveReferences; +var _core = require("@babel/core"); +function isInType(path) { + do { + switch (path.parent.type) { + case "TSTypeAnnotation": + case "TSTypeAliasDeclaration": + case "TSTypeReference": + case "TypeAnnotation": + case "TypeAlias": + return true; + case "ExportSpecifier": + return path.parentPath.parent.exportKind === "type"; + default: + if (path.parentPath.isStatement() || path.parentPath.isExpression()) { + return false; + } + } + } while (path = path.parentPath); +} +function rewriteLiveReferences(programPath, metadata, wrapReference) { + const imported = new Map(); + const exported = new Map(); + const requeueInParent = path => { + programPath.requeue(path); + }; + for (const [source, data] of metadata.source) { + for (const [localName, importName] of data.imports) { + imported.set(localName, [source, importName, null]); + } + for (const localName of data.importsNamespace) { + imported.set(localName, [source, null, localName]); + } + } + for (const [local, data] of metadata.local) { + let exportMeta = exported.get(local); + if (!exportMeta) { + exportMeta = []; + exported.set(local, exportMeta); + } + exportMeta.push(...data.names); + } + const rewriteBindingInitVisitorState = { + metadata, + requeueInParent, + scope: programPath.scope, + exported + }; + programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState); + const rewriteReferencesVisitorState = { + seen: new WeakSet(), + metadata, + requeueInParent, + scope: programPath.scope, + imported, + exported, + buildImportReference([source, importName, localName], identNode) { + const meta = metadata.source.get(source); + meta.referenced = true; + if (localName) { + if (meta.wrap) { + var _wrapReference; + identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode; + } + return identNode; + } + let namespace = _core.types.identifier(meta.name); + if (meta.wrap) { + var _wrapReference2; + namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace; + } + if (importName === "default" && meta.interop === "node-default") { + return namespace; + } + const computed = metadata.stringSpecifiers.has(importName); + return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed); + } + }; + programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState); +} +const rewriteBindingInitVisitor = { + Scope(path) { + path.skip(); + }, + ClassDeclaration(path) { + const { + requeueInParent, + exported, + metadata + } = this; + const { + id + } = path.node; + if (!id) throw new Error("Expected class to have a name"); + const localName = id.name; + const exportNames = exported.get(localName) || []; + if (exportNames.length > 0) { + const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope)); + statement._blockHoist = path.node._blockHoist; + requeueInParent(path.insertAfter(statement)[0]); + } + }, + VariableDeclaration(path) { + const { + requeueInParent, + exported, + metadata + } = this; + const isVar = path.node.kind === "var"; + for (const decl of path.get("declarations")) { + const { + id + } = decl.node; + let { + init + } = decl.node; + if (_core.types.isIdentifier(id) && exported.has(id.name) && !_core.types.isArrowFunctionExpression(init) && (!_core.types.isFunctionExpression(init) || init.id) && (!_core.types.isClassExpression(init) || init.id)) { + if (!init) { + if (isVar) { + continue; + } else { + init = path.scope.buildUndefinedNode(); + } + } + decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope); + requeueInParent(decl.get("init")); + } else { + for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) { + if (exported.has(localName)) { + const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope)); + statement._blockHoist = path.node._blockHoist; + requeueInParent(path.insertAfter(statement)[0]); + } + } + } + } + } +}; +const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => { + const exportsObjectName = metadata.exportName; + for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) { + if (currentScope.hasOwnBinding(exportsObjectName)) { + currentScope.rename(exportsObjectName); + } + } + return (exportNames || []).reduce((expr, exportName) => { + const { + stringSpecifiers + } = metadata; + const computed = stringSpecifiers.has(exportName); + return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr); + }, localExpr); +}; +const buildImportThrow = localName => { + return _core.template.expression.ast` + (function() { + throw new Error('"' + '${localName}' + '" is read-only.'); + })() + `; +}; +const rewriteReferencesVisitor = { + ReferencedIdentifier(path) { + const { + seen, + buildImportReference, + scope, + imported, + requeueInParent + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const localName = path.node.name; + const importData = imported.get(localName); + if (importData) { + if (isInType(path)) { + throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. ` + `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`); + } + const localBinding = path.scope.getBinding(localName); + const rootBinding = scope.getBinding(localName); + if (rootBinding !== localBinding) return; + const ref = buildImportReference(importData, path.node); + ref.loc = path.node.loc; + if ((path.parentPath.isCallExpression({ + callee: path.node + }) || path.parentPath.isOptionalCallExpression({ + callee: path.node + }) || path.parentPath.isTaggedTemplateExpression({ + tag: path.node + })) && _core.types.isMemberExpression(ref)) { + path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref])); + } else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) { + const { + object, + property + } = ref; + path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name))); + } else { + path.replaceWith(ref); + } + requeueInParent(path); + path.skip(); + } + }, + UpdateExpression(path) { + const { + scope, + seen, + imported, + exported, + requeueInParent, + buildImportReference + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const arg = path.get("argument"); + if (arg.isMemberExpression()) return; + const update = path.node; + if (arg.isIdentifier()) { + const localName = arg.node.name; + if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { + return; + } + const exportedNames = exported.get(localName); + const importData = imported.get(localName); + if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { + if (importData) { + path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName))); + } else if (update.prefix) { + path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope)); + } else { + const ref = scope.generateDeclaredUidIdentifier(localName); + path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(ref), _core.types.cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope), _core.types.cloneNode(ref)])); + } + } + } + requeueInParent(path); + path.skip(); + }, + AssignmentExpression: { + exit(path) { + const { + scope, + seen, + imported, + exported, + requeueInParent, + buildImportReference + } = this; + if (seen.has(path.node)) return; + seen.add(path.node); + const left = path.get("left"); + if (left.isMemberExpression()) return; + if (left.isIdentifier()) { + const localName = left.node.name; + if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { + return; + } + const exportedNames = exported.get(localName); + const importData = imported.get(localName); + if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { + const assignment = path.node; + if (importData) { + assignment.left = buildImportReference(importData, left.node); + assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]); + } + const { + operator + } = assignment; + let newExpr; + if (operator === "=") { + newExpr = assignment; + } else if (operator === "&&=" || operator === "||=" || operator === "??=") { + newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); + } else { + newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); + } + path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope)); + requeueInParent(path); + path.skip(); + } + } else { + const ids = left.getOuterBindingIdentifiers(); + const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName)); + const id = programScopeIds.find(localName => imported.has(localName)); + if (id) { + path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]); + } + const items = []; + programScopeIds.forEach(localName => { + const exportedNames = exported.get(localName) || []; + if (exportedNames.length > 0) { + items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope)); + } + }); + if (items.length > 0) { + let node = _core.types.sequenceExpression(items); + if (path.parentPath.isExpressionStatement()) { + node = _core.types.expressionStatement(node); + node._blockHoist = path.parentPath.node._blockHoist; + } + const statement = path.insertAfter(node)[0]; + requeueInParent(statement); + } + } + } + }, + ForXStatement(path) { + const { + scope, + node + } = path; + const { + left + } = node; + const { + exported, + imported, + scope: programScope + } = this; + if (!_core.types.isVariableDeclaration(left)) { + let didTransformExport = false, + importConstViolationName; + const loopBodyScope = path.get("body").scope; + for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) { + if (programScope.getBinding(name) === scope.getBinding(name)) { + if (exported.has(name)) { + didTransformExport = true; + if (loopBodyScope.hasOwnBinding(name)) { + loopBodyScope.rename(name); + } + } + if (imported.has(name) && !importConstViolationName) { + importConstViolationName = name; + } + } + } + if (!didTransformExport && !importConstViolationName) { + return; + } + path.ensureBlock(); + const bodyPath = path.get("body"); + const newLoopId = scope.generateUidIdentifierBasedOnNode(left); + path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))])); + scope.registerDeclaration(path.get("left")); + if (didTransformExport) { + bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId))); + } + if (importConstViolationName) { + bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName))); + } + } + } +}; + +//# sourceMappingURL=rewrite-live-references.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map new file mode 100644 index 0000000..f24c2cd --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","isInType","path","parent","type","parentPath","exportKind","isStatement","isExpression","rewriteLiveReferences","programPath","metadata","wrapReference","imported","Map","exported","requeueInParent","requeue","source","data","localName","importName","imports","set","importsNamespace","local","exportMeta","get","push","names","rewriteBindingInitVisitorState","scope","traverse","rewriteBindingInitVisitor","rewriteReferencesVisitorState","seen","WeakSet","buildImportReference","identNode","meta","referenced","wrap","_wrapReference","namespace","t","identifier","name","_wrapReference2","interop","computed","stringSpecifiers","has","memberExpression","stringLiteral","rewriteReferencesVisitor","Scope","skip","ClassDeclaration","id","node","Error","exportNames","length","statement","expressionStatement","buildBindingExportAssignmentExpression","_blockHoist","insertAfter","VariableDeclaration","isVar","kind","decl","init","isIdentifier","isArrowFunctionExpression","isFunctionExpression","isClassExpression","buildUndefinedNode","Object","keys","getOuterBindingIdentifiers","localExpr","exportsObjectName","exportName","currentScope","hasOwnBinding","rename","reduce","expr","assignmentExpression","buildImportThrow","template","expression","ast","ReferencedIdentifier","add","importData","buildCodeFrameError","localBinding","getBinding","rootBinding","ref","loc","isCallExpression","callee","isOptionalCallExpression","isTaggedTemplateExpression","tag","isMemberExpression","replaceWith","sequenceExpression","numericLiteral","isJSXIdentifier","object","property","jsxMemberExpression","jsxIdentifier","UpdateExpression","arg","update","exportedNames","operator","prefix","cloneNode","generateDeclaredUidIdentifier","AssignmentExpression","exit","left","assignment","right","newExpr","logicalExpression","slice","binaryExpression","ids","programScopeIds","filter","find","items","forEach","isExpressionStatement","ForXStatement","programScope","isVariableDeclaration","didTransformExport","importConstViolationName","loopBodyScope","ensureBlock","bodyPath","newLoopId","generateUidIdentifierBasedOnNode","variableDeclaration","variableDeclarator","registerDeclaration","unshiftContainer"],"sources":["../src/rewrite-live-references.ts"],"sourcesContent":["import { template, types as t } from \"@babel/core\";\nimport type { NodePath, Visitor, Scope } from \"@babel/core\";\n\nimport type { ModuleMetadata } from \"./normalize-and-load-metadata.ts\";\n\ninterface RewriteReferencesVisitorState {\n exported: Map;\n metadata: ModuleMetadata;\n requeueInParent: (path: NodePath) => void;\n scope: Scope;\n imported: Map;\n buildImportReference: (\n [source, importName, localName]: readonly [string, string, string],\n identNode: t.Identifier | t.CallExpression | t.JSXIdentifier,\n ) => any;\n seen: WeakSet;\n}\n\ninterface RewriteBindingInitVisitorState {\n exported: Map;\n metadata: ModuleMetadata;\n requeueInParent: (path: NodePath) => void;\n scope: Scope;\n}\n\nfunction isInType(path: NodePath) {\n do {\n switch (path.parent.type) {\n case \"TSTypeAnnotation\":\n case \"TSTypeAliasDeclaration\":\n case \"TSTypeReference\":\n case \"TypeAnnotation\":\n case \"TypeAlias\":\n return true;\n case \"ExportSpecifier\":\n return (\n (\n path.parentPath.parent as\n | t.ExportDefaultDeclaration\n | t.ExportNamedDeclaration\n ).exportKind === \"type\"\n );\n default:\n if (path.parentPath.isStatement() || path.parentPath.isExpression()) {\n return false;\n }\n }\n } while ((path = path.parentPath));\n}\n\nexport default function rewriteLiveReferences(\n programPath: NodePath,\n metadata: ModuleMetadata,\n wrapReference: (ref: t.Expression, payload: unknown) => null | t.Expression,\n) {\n const imported = new Map();\n const exported = new Map();\n const requeueInParent = (path: NodePath) => {\n // Manually re-queue `exports.default =` expressions so that the ES3\n // transform has an opportunity to convert them. Ideally this would\n // happen automatically from the replaceWith above. See #4140 for\n // more info.\n programPath.requeue(path);\n };\n\n for (const [source, data] of metadata.source) {\n for (const [localName, importName] of data.imports) {\n imported.set(localName, [source, importName, null]);\n }\n for (const localName of data.importsNamespace) {\n imported.set(localName, [source, null, localName]);\n }\n }\n\n for (const [local, data] of metadata.local) {\n let exportMeta = exported.get(local);\n if (!exportMeta) {\n exportMeta = [];\n exported.set(local, exportMeta);\n }\n\n exportMeta.push(...data.names);\n }\n\n // Rewrite initialization of bindings to update exports.\n const rewriteBindingInitVisitorState: RewriteBindingInitVisitorState = {\n metadata,\n requeueInParent,\n scope: programPath.scope,\n exported, // local name => exported name list\n };\n programPath.traverse(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n rewriteBindingInitVisitor,\n rewriteBindingInitVisitorState,\n );\n\n // Rewrite reads/writes from imports and exports to have the correct behavior.\n const rewriteReferencesVisitorState: RewriteReferencesVisitorState = {\n seen: new WeakSet(),\n metadata,\n requeueInParent,\n scope: programPath.scope,\n imported, // local / import\n exported, // local name => exported name list\n buildImportReference([source, importName, localName], identNode) {\n const meta = metadata.source.get(source);\n meta.referenced = true;\n\n if (localName) {\n if (meta.wrap) {\n // @ts-expect-error Fixme: we should handle the case when identNode is a JSXIdentifier\n identNode = wrapReference(identNode, meta.wrap) ?? identNode;\n }\n return identNode;\n }\n\n let namespace: t.Expression = t.identifier(meta.name);\n if (meta.wrap) {\n namespace = wrapReference(namespace, meta.wrap) ?? namespace;\n }\n\n if (importName === \"default\" && meta.interop === \"node-default\") {\n return namespace;\n }\n\n const computed = metadata.stringSpecifiers.has(importName);\n\n return t.memberExpression(\n namespace,\n computed ? t.stringLiteral(importName) : t.identifier(importName),\n computed,\n );\n },\n };\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);\n}\n\n/**\n * A visitor to inject export update statements during binding initialization.\n */\nconst rewriteBindingInitVisitor: Visitor = {\n Scope(path) {\n path.skip();\n },\n ClassDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const { id } = path.node;\n if (!id) throw new Error(\"Expected class to have a name\");\n const localName = id.name;\n\n const exportNames = exported.get(localName) || [];\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n buildBindingExportAssignmentExpression(\n metadata,\n exportNames,\n t.identifier(localName),\n path.scope,\n ),\n );\n // @ts-expect-error todo(flow->ts): avoid mutations\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n },\n VariableDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const isVar = path.node.kind === \"var\";\n\n for (const decl of path.get(\"declarations\")) {\n const { id } = decl.node;\n let { init } = decl.node;\n if (\n t.isIdentifier(id) &&\n exported.has(id.name) &&\n !t.isArrowFunctionExpression(init) &&\n (!t.isFunctionExpression(init) || init.id) &&\n (!t.isClassExpression(init) || init.id)\n ) {\n if (!init) {\n if (isVar) {\n // This variable might have already been assigned to, and the\n // uninitalized declaration doesn't set it to `undefined` and does\n // not updated the exported value.\n continue;\n } else {\n init = path.scope.buildUndefinedNode();\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n decl.node.init = buildBindingExportAssignmentExpression(\n metadata,\n exported.get(id.name),\n init,\n path.scope,\n );\n requeueInParent(decl.get(\"init\"));\n } else {\n for (const localName of Object.keys(\n decl.getOuterBindingIdentifiers(),\n )) {\n if (exported.has(localName)) {\n const statement = t.expressionStatement(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n buildBindingExportAssignmentExpression(\n metadata,\n exported.get(localName),\n t.identifier(localName),\n path.scope,\n ),\n );\n // @ts-expect-error todo(flow->ts): avoid mutations\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n }\n }\n }\n },\n};\n\nconst buildBindingExportAssignmentExpression = (\n metadata: ModuleMetadata,\n exportNames: string[],\n localExpr: t.Expression,\n scope: Scope,\n) => {\n const exportsObjectName = metadata.exportName;\n for (\n let currentScope = scope;\n currentScope != null;\n currentScope = currentScope.parent\n ) {\n if (currentScope.hasOwnBinding(exportsObjectName)) {\n currentScope.rename(exportsObjectName);\n }\n }\n return (exportNames || []).reduce((expr, exportName) => {\n // class Foo {} export { Foo, Foo as Bar };\n // as\n // class Foo {} exports.Foo = exports.Bar = Foo;\n const { stringSpecifiers } = metadata;\n const computed = stringSpecifiers.has(exportName);\n return t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(exportsObjectName),\n computed ? t.stringLiteral(exportName) : t.identifier(exportName),\n /* computed */ computed,\n ),\n expr,\n );\n }, localExpr);\n};\n\nconst buildImportThrow = (localName: string) => {\n return template.expression.ast`\n (function() {\n throw new Error('\"' + '${localName}' + '\" is read-only.');\n })()\n `;\n};\n\nconst rewriteReferencesVisitor: Visitor = {\n ReferencedIdentifier(path) {\n const { seen, buildImportReference, scope, imported, requeueInParent } =\n this;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const localName = path.node.name;\n\n const importData = imported.get(localName);\n if (importData) {\n if (isInType(path)) {\n throw path.buildCodeFrameError(\n `Cannot transform the imported binding \"${localName}\" since it's also used in a type annotation. ` +\n `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`,\n );\n }\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = scope.getBinding(localName);\n\n // redeclared in this scope\n if (rootBinding !== localBinding) return;\n\n const ref = buildImportReference(importData, path.node);\n\n // Preserve the binding location so that sourcemaps are nicer.\n ref.loc = path.node.loc;\n\n if (\n (path.parentPath.isCallExpression({ callee: path.node }) ||\n path.parentPath.isOptionalCallExpression({ callee: path.node }) ||\n path.parentPath.isTaggedTemplateExpression({ tag: path.node })) &&\n t.isMemberExpression(ref)\n ) {\n path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref]));\n } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) {\n const { object, property } = ref;\n path.replaceWith(\n t.jsxMemberExpression(\n // @ts-expect-error todo(flow->ts): possible bug `object` might not have a name\n t.jsxIdentifier(object.name),\n // @ts-expect-error todo(flow->ts): possible bug `property` might not have a name\n t.jsxIdentifier(property.name),\n ),\n );\n } else {\n path.replaceWith(ref);\n }\n\n requeueInParent(path);\n\n // The path could have been replaced with an identifier that would\n // otherwise be re-visited, so we skip processing its children.\n path.skip();\n }\n },\n\n UpdateExpression(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n\n seen.add(path.node);\n\n const arg = path.get(\"argument\");\n\n // No change needed\n if (arg.isMemberExpression()) return;\n\n const update = path.node;\n\n if (arg.isIdentifier()) {\n const localName = arg.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n\n if (exportedNames?.length > 0 || importData) {\n if (importData) {\n path.replaceWith(\n t.assignmentExpression(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n (update.operator[0] + \"=\") as t.AssignmentExpression[\"operator\"],\n buildImportReference(importData, arg.node),\n buildImportThrow(localName),\n ),\n );\n } else if (update.prefix) {\n // ++foo\n // => exports.foo = ++foo\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.cloneNode(update),\n path.scope,\n ),\n );\n } else {\n // foo++\n // => (ref = i++, exports.i = i, ref)\n const ref = scope.generateDeclaredUidIdentifier(localName);\n\n path.replaceWith(\n t.sequenceExpression([\n t.assignmentExpression(\n \"=\",\n t.cloneNode(ref),\n t.cloneNode(update),\n ),\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n path.scope,\n ),\n t.cloneNode(ref),\n ]),\n );\n }\n }\n }\n\n requeueInParent(path);\n path.skip();\n },\n\n AssignmentExpression: {\n exit(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const left = path.get(\"left\");\n\n // No change needed\n if (left.isMemberExpression()) return;\n\n if (left.isIdentifier()) {\n // Simple update-assign foo += 1; export { foo };\n // => exports.foo = (foo += 1);\n const localName = left.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n if (exportedNames?.length > 0 || importData) {\n const assignment = path.node;\n\n if (importData) {\n assignment.left = buildImportReference(importData, left.node);\n\n assignment.right = t.sequenceExpression([\n assignment.right,\n buildImportThrow(localName),\n ]);\n }\n\n const { operator } = assignment;\n let newExpr;\n if (operator === \"=\") {\n newExpr = assignment;\n } else if (\n operator === \"&&=\" ||\n operator === \"||=\" ||\n operator === \"??=\"\n ) {\n newExpr = t.assignmentExpression(\n \"=\",\n assignment.left,\n t.logicalExpression(\n operator.slice(0, -1) as t.LogicalExpression[\"operator\"],\n t.cloneNode(assignment.left) as t.Expression,\n assignment.right,\n ),\n );\n } else {\n newExpr = t.assignmentExpression(\n \"=\",\n assignment.left,\n t.binaryExpression(\n operator.slice(0, -1) as t.BinaryExpression[\"operator\"],\n t.cloneNode(assignment.left) as t.Expression,\n assignment.right,\n ),\n );\n }\n\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n newExpr,\n path.scope,\n ),\n );\n\n requeueInParent(path);\n\n path.skip();\n }\n } else {\n const ids = left.getOuterBindingIdentifiers();\n const programScopeIds = Object.keys(ids).filter(\n localName =>\n scope.getBinding(localName) === path.scope.getBinding(localName),\n );\n const id = programScopeIds.find(localName => imported.has(localName));\n\n if (id) {\n path.node.right = t.sequenceExpression([\n path.node.right,\n buildImportThrow(id),\n ]);\n }\n\n // Complex ({a, b, c} = {}); export { a, c };\n // => ({a, b, c} = {}), (exports.a = a, exports.c = c);\n const items: t.Expression[] = [];\n programScopeIds.forEach(localName => {\n const exportedNames = exported.get(localName) || [];\n if (exportedNames.length > 0) {\n items.push(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n path.scope,\n ),\n );\n }\n });\n\n if (items.length > 0) {\n let node: t.Node = t.sequenceExpression(items);\n if (path.parentPath.isExpressionStatement()) {\n node = t.expressionStatement(node);\n // @ts-expect-error todo(flow->ts): avoid mutations\n node._blockHoist = path.parentPath.node._blockHoist;\n }\n\n const statement = path.insertAfter(node)[0];\n requeueInParent(statement);\n }\n }\n },\n },\n ForXStatement(path) {\n const { scope, node } = path;\n const { left } = node;\n const { exported, imported, scope: programScope } = this;\n\n if (!t.isVariableDeclaration(left)) {\n let didTransformExport = false,\n importConstViolationName;\n const loopBodyScope = path.get(\"body\").scope;\n for (const name of Object.keys(t.getOuterBindingIdentifiers(left))) {\n if (programScope.getBinding(name) === scope.getBinding(name)) {\n if (exported.has(name)) {\n didTransformExport = true;\n if (loopBodyScope.hasOwnBinding(name)) {\n loopBodyScope.rename(name);\n }\n }\n if (imported.has(name) && !importConstViolationName) {\n importConstViolationName = name;\n }\n }\n }\n if (!didTransformExport && !importConstViolationName) {\n return;\n }\n\n path.ensureBlock();\n const bodyPath = path.get(\"body\") as NodePath;\n\n const newLoopId = scope.generateUidIdentifierBasedOnNode(left);\n path\n .get(\"left\")\n .replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.cloneNode(newLoopId)),\n ]),\n );\n scope.registerDeclaration(path.get(\"left\"));\n\n if (didTransformExport) {\n bodyPath.unshiftContainer(\n \"body\",\n t.expressionStatement(t.assignmentExpression(\"=\", left, newLoopId)),\n );\n }\n if (importConstViolationName) {\n bodyPath.unshiftContainer(\n \"body\",\n t.expressionStatement(buildImportThrow(importConstViolationName)),\n );\n }\n }\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAyBA,SAASC,QAAQA,CAACC,IAAc,EAAE;EAChC,GAAG;IACD,QAAQA,IAAI,CAACC,MAAM,CAACC,IAAI;MACtB,KAAK,kBAAkB;MACvB,KAAK,wBAAwB;MAC7B,KAAK,iBAAiB;MACtB,KAAK,gBAAgB;MACrB,KAAK,WAAW;QACd,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,aAAa,CAAC7D,aAAa,CAACvC,IAAI,CAAC,EAAE;cACrCoG,aAAa,CAAC5D,MAAM,CAACxC,IAAI,CAAC;YAC5B;UACF;UACA,IAAIjC,QAAQ,CAACsC,GAAG,CAACL,IAAI,CAAC,IAAI,CAACmG,wBAAwB,EAAE;YACnDA,wBAAwB,GAAGnG,IAAI;UACjC;QACF;MACF;MACA,IAAI,CAACkG,kBAAkB,IAAI,CAACC,wBAAwB,EAAE;QACpD;MACF;MAEA/I,IAAI,CAACiJ,WAAW,CAAC,CAAC;MAClB,MAAMC,QAAQ,GAAGlJ,IAAI,CAACyB,GAAG,CAAC,MAAM,CAA+B;MAE/D,MAAM0H,SAAS,GAAGtH,KAAK,CAACuH,gCAAgC,CAACvB,IAAI,CAAC;MAC9D7H,IAAI,CACDyB,GAAG,CAAC,MAAM,CAAC,CACXkF,WAAW,CACVjE,WAAC,CAAC2G,mBAAmB,CAAC,KAAK,EAAE,CAC3B3G,WAAC,CAAC4G,kBAAkB,CAAC5G,WAAC,CAAC+E,SAAS,CAAC0B,SAAS,CAAC,CAAC,CAC7C,CACH,CAAC;MACHtH,KAAK,CAAC0H,mBAAmB,CAACvJ,IAAI,CAACyB,GAAG,CAAC,MAAM,CAAC,CAAC;MAE3C,IAAIqH,kBAAkB,EAAE;QACtBI,QAAQ,CAACM,gBAAgB,CACvB,MAAM,EACN9G,WAAC,CAACoB,mBAAmB,CAACpB,WAAC,CAAC6C,oBAAoB,CAAC,GAAG,EAAEsC,IAAI,EAAEsB,SAAS,CAAC,CACpE,CAAC;MACH;MACA,IAAIJ,wBAAwB,EAAE;QAC5BG,QAAQ,CAACM,gBAAgB,CACvB,MAAM,EACN9G,WAAC,CAACoB,mBAAmB,CAAC0B,gBAAgB,CAACuD,wBAAwB,CAAC,CAClE,CAAC;MACH;IACF;EACF;AACF,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js new file mode 100644 index 0000000..b537652 --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rewriteThis; +var _core = require("@babel/core"); +var _traverse = require("@babel/traverse"); +let rewriteThisVisitor; +function rewriteThis(programPath) { + if (!rewriteThisVisitor) { + rewriteThisVisitor = _traverse.visitors.environmentVisitor({ + ThisExpression(path) { + path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true)); + } + }); + rewriteThisVisitor.noScope = true; + } + (0, _traverse.default)(programPath.node, rewriteThisVisitor); +} + +//# sourceMappingURL=rewrite-this.js.map diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map new file mode 100644 index 0000000..3cdfc3f --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_core","require","_traverse","rewriteThisVisitor","rewriteThis","programPath","visitors","environmentVisitor","ThisExpression","path","replaceWith","t","unaryExpression","numericLiteral","noScope","traverse","node"],"sources":["../src/rewrite-this.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport traverse, { visitors, type NodePath } from \"@babel/traverse\";\n\n/**\n * A lazily constructed visitor to walk the tree, rewriting all `this` references in the\n * top-level scope to be `void 0` (undefined).\n *\n */\nlet rewriteThisVisitor: Parameters[1];\n\nexport default function rewriteThis(programPath: NodePath) {\n if (!rewriteThisVisitor) {\n rewriteThisVisitor = visitors.environmentVisitor({\n ThisExpression(path) {\n path.replaceWith(t.unaryExpression(\"void\", t.numericLiteral(0), true));\n },\n });\n rewriteThisVisitor.noScope = true;\n }\n // Rewrite \"this\" to be \"undefined\".\n traverse(programPath.node, rewriteThisVisitor);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOA,IAAIE,kBAAkD;AAEvC,SAASC,WAAWA,CAACC,WAAqB,EAAE;EACzD,IAAI,CAACF,kBAAkB,EAAE;IACvBA,kBAAkB,GAAGG,kBAAQ,CAACC,kBAAkB,CAAC;MAC/CC,cAAcA,CAACC,IAAI,EAAE;QACnBA,IAAI,CAACC,WAAW,CAACC,WAAC,CAACC,eAAe,CAAC,MAAM,EAAED,WAAC,CAACE,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;MACxE;IACF,CAAC,CAAC;IACFV,kBAAkB,CAACW,OAAO,GAAG,IAAI;EACnC;EAEA,IAAAC,iBAAQ,EAACV,WAAW,CAACW,IAAI,EAAEb,kBAAkB,CAAC;AAChD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-module-transforms/package.json b/node_modules/@babel/helper-module-transforms/package.json new file mode 100644 index 0000000..5c7241e --- /dev/null +++ b/node_modules/@babel/helper-module-transforms/package.json @@ -0,0 +1,32 @@ +{ + "name": "@babel/helper-module-transforms", + "version": "7.28.3", + "description": "Babel helper functions for implementing ES6 module transformations", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-helper-module-transforms", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-module-transforms" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "devDependencies": { + "@babel/core": "^7.28.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-string-parser/LICENSE b/node_modules/@babel/helper-string-parser/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/helper-string-parser/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-string-parser/README.md b/node_modules/@babel/helper-string-parser/README.md new file mode 100644 index 0000000..771b470 --- /dev/null +++ b/node_modules/@babel/helper-string-parser/README.md @@ -0,0 +1,19 @@ +# @babel/helper-string-parser + +> A utility package to parse strings + +See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-string-parser +``` + +or using yarn: + +```sh +yarn add @babel/helper-string-parser +``` diff --git a/node_modules/@babel/helper-string-parser/lib/index.js b/node_modules/@babel/helper-string-parser/lib/index.js new file mode 100644 index 0000000..2d94115 --- /dev/null +++ b/node_modules/@babel/helper-string-parser/lib/index.js @@ -0,0 +1,295 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.readCodePoint = readCodePoint; +exports.readInt = readInt; +exports.readStringContents = readStringContents; +var _isDigit = function isDigit(code) { + return code >= 48 && code <= 57; +}; +const forbiddenNumericSeparatorSiblings = { + decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), + hex: new Set([46, 88, 95, 120]) +}; +const isAllowedNumericSeparatorSibling = { + bin: ch => ch === 48 || ch === 49, + oct: ch => ch >= 48 && ch <= 55, + dec: ch => ch >= 48 && ch <= 57, + hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 +}; +function readStringContents(type, input, pos, lineStart, curLine, errors) { + const initialPos = pos; + const initialLineStart = lineStart; + const initialCurLine = curLine; + let out = ""; + let firstInvalidLoc = null; + let chunkStart = pos; + const { + length + } = input; + for (;;) { + if (pos >= length) { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + out += input.slice(chunkStart, pos); + break; + } + const ch = input.charCodeAt(pos); + if (isStringEnd(type, ch, input, pos)) { + out += input.slice(chunkStart, pos); + break; + } + if (ch === 92) { + out += input.slice(chunkStart, pos); + const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); + if (res.ch === null && !firstInvalidLoc) { + firstInvalidLoc = { + pos, + lineStart, + curLine + }; + } else { + out += res.ch; + } + ({ + pos, + lineStart, + curLine + } = res); + chunkStart = pos; + } else if (ch === 8232 || ch === 8233) { + ++pos; + ++curLine; + lineStart = pos; + } else if (ch === 10 || ch === 13) { + if (type === "template") { + out += input.slice(chunkStart, pos) + "\n"; + ++pos; + if (ch === 13 && input.charCodeAt(pos) === 10) { + ++pos; + } + ++curLine; + chunkStart = lineStart = pos; + } else { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + } + } else { + ++pos; + } + } + return { + pos, + str: out, + firstInvalidLoc, + lineStart, + curLine, + containsInvalid: !!firstInvalidLoc + }; +} +function isStringEnd(type, ch, input, pos) { + if (type === "template") { + return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; + } + return ch === (type === "double" ? 34 : 39); +} +function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { + const throwOnInvalid = !inTemplate; + pos++; + const res = ch => ({ + pos, + ch, + lineStart, + curLine + }); + const ch = input.charCodeAt(pos++); + switch (ch) { + case 110: + return res("\n"); + case 114: + return res("\r"); + case 120: + { + let code; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCharCode(code)); + } + case 117: + { + let code; + ({ + code, + pos + } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCodePoint(code)); + } + case 116: + return res("\t"); + case 98: + return res("\b"); + case 118: + return res("\u000b"); + case 102: + return res("\f"); + case 13: + if (input.charCodeAt(pos) === 10) { + ++pos; + } + case 10: + lineStart = pos; + ++curLine; + case 8232: + case 8233: + return res(""); + case 56: + case 57: + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(pos - 1, lineStart, curLine); + } + default: + if (ch >= 48 && ch <= 55) { + const startPos = pos - 1; + const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); + let octalStr = match[0]; + let octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + pos += octalStr.length - 1; + const next = input.charCodeAt(pos); + if (octalStr !== "0" || next === 56 || next === 57) { + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(startPos, lineStart, curLine); + } + } + return res(String.fromCharCode(octal)); + } + return res(String.fromCharCode(ch)); + } +} +function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { + const initialPos = pos; + let n; + ({ + n, + pos + } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); + if (n === null) { + if (throwOnInvalid) { + errors.invalidEscapeSequence(initialPos, lineStart, curLine); + } else { + pos = initialPos - 1; + } + } + return { + code: n, + pos + }; +} +function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { + const start = pos; + const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; + const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; + let invalid = false; + let total = 0; + for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { + const code = input.charCodeAt(pos); + let val; + if (code === 95 && allowNumSeparator !== "bail") { + const prev = input.charCodeAt(pos - 1); + const next = input.charCodeAt(pos + 1); + if (!allowNumSeparator) { + if (bailOnError) return { + n: null, + pos + }; + errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); + } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { + if (bailOnError) return { + n: null, + pos + }; + errors.unexpectedNumericSeparator(pos, lineStart, curLine); + } + ++pos; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (_isDigit(code)) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + if (val <= 9 && bailOnError) { + return { + n: null, + pos + }; + } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { + val = 0; + } else if (forceLen) { + val = 0; + invalid = true; + } else { + break; + } + } + ++pos; + total = total * radix + val; + } + if (pos === start || len != null && pos - start !== len || invalid) { + return { + n: null, + pos + }; + } + return { + n: total, + pos + }; +} +function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { + const ch = input.charCodeAt(pos); + let code; + if (ch === 123) { + ++pos; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); + ++pos; + if (code !== null && code > 0x10ffff) { + if (throwOnInvalid) { + errors.invalidCodePoint(pos, lineStart, curLine); + } else { + return { + code: null, + pos + }; + } + } + } else { + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); + } + return { + code, + pos + }; +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-string-parser/lib/index.js.map b/node_modules/@babel/helper-string-parser/lib/index.js.map new file mode 100644 index 0000000..cd50797 --- /dev/null +++ b/node_modules/@babel/helper-string-parser/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["isDigit","code","forbiddenNumericSeparatorSiblings","decBinOct","Set","hex","isAllowedNumericSeparatorSibling","bin","ch","oct","dec","readStringContents","type","input","pos","lineStart","curLine","errors","initialPos","initialLineStart","initialCurLine","out","firstInvalidLoc","chunkStart","length","unterminated","slice","charCodeAt","isStringEnd","res","readEscapedChar","str","containsInvalid","inTemplate","throwOnInvalid","readHexChar","String","fromCharCode","readCodePoint","fromCodePoint","strictNumericEscape","startPos","match","exec","octalStr","octal","parseInt","next","len","forceLen","n","readInt","invalidEscapeSequence","radix","allowNumSeparator","bailOnError","start","forbiddenSiblings","isAllowedSibling","invalid","total","i","e","Infinity","val","prev","numericSeparatorInEscapeSequence","Number","isNaN","has","unexpectedNumericSeparator","_isDigit","invalidDigit","indexOf","invalidCodePoint"],"sources":["../src/index.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n"],"mappings":";;;;;;;;eAAA,SAASA,OAAOA,CAACC,IAAI,EAAE;EACrB,OAAOA,IAAI,MAAU,IAAIA,IAAI,MAAU;AACzC,CAAC;AAID,MAAMC,iCAAiC,GAAG;EACxCC,SAAS,EAAE,IAAIC,GAAG,CAAS,kCAS1B,CAAC;EACFC,GAAG,EAAE,IAAID,GAAG,CAAS,iBAKpB;AACH,CAAC;AAED,MAAME,gCAAgC,GAAG;EAEvCC,GAAG,EAAGC,EAAU,IAAKA,EAAE,OAAqB,IAAIA,EAAE,OAAqB;EAGvEC,GAAG,EAAGD,EAAU,IAAKA,EAAE,MAAoB,IAAIA,EAAE,MAAoB;EAGrEE,GAAG,EAAGF,E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EACfkB,cAAuB,EACvBjB,MAA8B,EAC9B;EACA,MAAMT,EAAE,GAAGK,KAAK,CAACc,UAAU,CAACb,GAAG,CAAC;EAChC,IAAIb,IAAI;EAER,IAAIO,EAAE,QAA6B,EAAE;IACnC,EAAEM,GAAG;IACL,CAAC;MAAEb,IAAI;MAAEa;IAAI,CAAC,GAAGqB,WAAW,CAC1BtB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACPH,KAAK,CAAC4D,OAAO,CAAC,GAAG,EAAE3D,GAAG,CAAC,GAAGA,GAAG,EAC7B,IAAI,EACJoB,cAAc,EACdjB,MACF,CAAC;IACD,EAAEH,GAAG;IACL,IAAIb,IAAI,KAAK,IAAI,IAAIA,IAAI,GAAG,QAAQ,EAAE;MACpC,IAAIiC,cAAc,EAAE;QAClBjB,MAAM,CAACyD,gBAAgB,CAAC5D,GAAG,EAAEC,SAAS,EAAEC,OAAO,CAAC;MAClD,CAAC,MAAM;QACL,OAAO;UAAEf,IAAI,EAAE,IAAI;UAAEa;QAAI,CAAC;MAC5B;IACF;EACF,CAAC,MAAM;IACL,CAAC;MAAEb,IAAI;MAAEa;IAAI,CAAC,GAAGqB,WAAW,CAC1BtB,KAAK,EACLC,GAAG,EACHC,SAAS,EACTC,OAAO,EACP,CAAC,EACD,KAAK,EACLkB,cAAc,EACdjB,MACF,CAAC;EACH;EACA,OAAO;IAAEhB,IAAI;IAAEa;EAAI,CAAC;AACtB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-string-parser/package.json b/node_modules/@babel/helper-string-parser/package.json new file mode 100644 index 0000000..c4c86e4 --- /dev/null +++ b/node_modules/@babel/helper-string-parser/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/helper-string-parser", + "version": "7.27.1", + "description": "A utility package to parse strings", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-string-parser" + }, + "homepage": "https://babel.dev/docs/en/next/babel-helper-string-parser", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "devDependencies": { + "charcodes": "^0.2.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/helper-validator-identifier/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md new file mode 100644 index 0000000..05c19e6 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/README.md @@ -0,0 +1,19 @@ +# @babel/helper-validator-identifier + +> Validate identifier/keywords name + +See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/babel-helper-validator-identifier) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-validator-identifier +``` + +or using yarn: + +```sh +yarn add @babel/helper-validator-identifier +``` diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/helper-validator-identifier/lib/identifier.js new file mode 100644 index 0000000..b12e6e4 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +exports.isIdentifierStart = isIdentifierStart; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088f\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7dc\ua7f1-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1add\u1ae0-\u1aeb\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +function isInAstralSet(code, set) { + let pos = 0x10000; + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + return false; +} +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +function isIdentifierName(name) { + let isFirst = true; + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { + return false; + } + } else if (!isIdentifierChar(cp)) { + return false; + } + } + return !isFirst; +} + +//# sourceMappingURL=identifier.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map new file mode 100644 index 0000000..71d32ff --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map @@ -0,0 +1 @@ +{"version":3,"names":["nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","RegExp","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","code","set","pos","i","length","isIdentifierStart","test","String","fromCharCode","isIdentifierChar","isIdentifierName","name","isFirst","cp","charCodeAt","trail"],"sources":["../src/identifier.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.cjs`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3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u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.cjs`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n"],"mappings":";;;;;;;;AAaA,IAAIA,4BAA4B,GAAG,spIAAspI;AAEzrI,IAAIC,uBAAuB,GAAG,4lFAA4lF;AAE1nF,MAAMC,uBAAuB,GAAG,IAAIC,MAAM,CACxC,GAAG,GAAGH,4BAA4B,GAAG,GACvC,CAAC;AACD,MAAMI,kBAAkB,GAAG,IAAID,MAAM,CACnC,GAAG,GAAGH,4BAA4B,GAAGC,uBAAuB,GAAG,GACjE,CAAC;AAEDD,4BAA4B,GAAGC,uBAAuB,GAAG,IAAI;AAQ7D,MAAMI,0BAA0B,GAAG,CAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,EAAE,EAAC,CAAC,EAAC,EAA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C,CAAC;EAC3E;EACA,OACED,aAAa,CAACC,IAAI,EAAEH,0BAA0B,CAAC,IAC/CE,aAAa,CAACC,IAAI,EAAEF,qBAAqB,CAAC;AAE9C;AAIO,SAASY,gBAAgBA,CAACC,IAAY,EAAW;EACtD,IAAIC,OAAO,GAAG,IAAI;EAClB,KAAK,IAAIT,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAED,CAAC,EAAE,EAAE;IAKpC,IAAIU,EAAE,GAAGF,IAAI,CAACG,UAAU,CAACX,CAAC,CAAC;IAC3B,IAAI,CAACU,EAAE,GAAG,MAAM,MAAM,MAAM,IAAIV,CAAC,GAAG,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAE;MACnD,MAAMW,KAAK,GAAGJ,IAAI,CAACG,UAAU,CAAC,EAAEX,CAAC,CAAC;MAClC,IAAI,CAACY,KAAK,GAAG,MAAM,MAAM,MAAM,EAAE;QAC/BF,EAAE,GAAG,OAAO,IAAI,CAACA,EAAE,GAAG,KAAK,KAAK,EAAE,CAAC,IAAIE,KAAK,GAAG,KAAK,CAAC;MACvD;IACF;IACA,IAAIH,OAAO,EAAE;MACXA,OAAO,GAAG,KAAK;MACf,IAAI,CAACP,iBAAiB,CAACQ,EAAE,CAAC,EAAE;QAC1B,OAAO,KAAK;MACd;IACF,CAAC,MAAM,IAAI,CAACJ,gBAAgB,CAACI,EAAE,CAAC,EAAE;MAChC,OAAO,KAAK;IACd;EACF;EACA,OAAO,CAACD,OAAO;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/helper-validator-identifier/lib/index.js new file mode 100644 index 0000000..76b2282 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/index.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "isIdentifierChar", { + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +}); +Object.defineProperty(exports, "isIdentifierName", { + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +}); +Object.defineProperty(exports, "isIdentifierStart", { + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +}); +Object.defineProperty(exports, "isKeyword", { + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +}); +Object.defineProperty(exports, "isReservedWord", { + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +}); +Object.defineProperty(exports, "isStrictReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +}); +var _identifier = require("./identifier.js"); +var _keyword = require("./keyword.js"); + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js.map b/node_modules/@babel/helper-validator-identifier/lib/index.js.map new file mode 100644 index 0000000..d985f3b --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier.ts\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/helper-validator-identifier/lib/keyword.js new file mode 100644 index 0000000..054cf84 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isKeyword = isKeyword; +exports.isReservedWord = isReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} +function isKeyword(word) { + return keywords.has(word); +} + +//# sourceMappingURL=keyword.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map new file mode 100644 index 0000000..3471f78 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map @@ -0,0 +1 @@ +{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,I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,IAAI,CAAC;AAE9E;AAEO,SAASM,SAASA,CAACN,IAAY,EAAW;EAC/C,OAAOL,QAAQ,CAACQ,GAAG,CAACH,IAAI,CAAC;AAC3B","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json new file mode 100644 index 0000000..1aea38d --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/helper-validator-identifier", + "version": "7.28.5", + "description": "Validate identifier/keywords name", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "devDependencies": { + "@unicode/unicode-17.0.0": "^1.6.10", + "charcodes": "^0.2.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/LICENSE b/node_modules/@babel/helper-validator-option/LICENSE new file mode 100644 index 0000000..f31575e --- /dev/null +++ b/node_modules/@babel/helper-validator-option/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-validator-option/README.md b/node_modules/@babel/helper-validator-option/README.md new file mode 100644 index 0000000..c5c7b5d --- /dev/null +++ b/node_modules/@babel/helper-validator-option/README.md @@ -0,0 +1,19 @@ +# @babel/helper-validator-option + +> Validate plugin/preset options + +See our website [@babel/helper-validator-option](https://babeljs.io/docs/babel-helper-validator-option) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-validator-option +``` + +or using yarn: + +```sh +yarn add @babel/helper-validator-option +``` diff --git a/node_modules/@babel/helper-validator-option/lib/find-suggestion.js b/node_modules/@babel/helper-validator-option/lib/find-suggestion.js new file mode 100644 index 0000000..beada9a --- /dev/null +++ b/node_modules/@babel/helper-validator-option/lib/find-suggestion.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findSuggestion = findSuggestion; +const { + min +} = Math; +function levenshtein(a, b) { + let t = [], + u = [], + i, + j; + const m = a.length, + n = b.length; + if (!m) { + return n; + } + if (!n) { + return m; + } + for (j = 0; j <= n; j++) { + t[j] = j; + } + for (i = 1; i <= m; i++) { + for (u = [i], j = 1; j <= n; j++) { + u[j] = a[i - 1] === b[j - 1] ? t[j - 1] : min(t[j - 1], t[j], u[j - 1]) + 1; + } + t = u; + } + return u[n]; +} +function findSuggestion(str, arr) { + const distances = arr.map(el => levenshtein(el, str)); + return arr[distances.indexOf(min(...distances))]; +} + +//# sourceMappingURL=find-suggestion.js.map diff --git a/node_modules/@babel/helper-validator-option/lib/find-suggestion.js.map b/node_modules/@babel/helper-validator-option/lib/find-suggestion.js.map new file mode 100644 index 0000000..84d7a7b --- /dev/null +++ b/node_modules/@babel/helper-validator-option/lib/find-suggestion.js.map @@ -0,0 +1 @@ +{"version":3,"names":["min","Math","levenshtein","a","b","t","u","i","j","m","length","n","findSuggestion","str","arr","distances","map","el","indexOf"],"sources":["../src/find-suggestion.ts"],"sourcesContent":["const { min } = Math;\n\n// a minimal leven distance implementation\n// balanced maintainability with code size\n// It is not blazingly fast but should be okay for Babel user case\n// where it will be run for at most tens of time on strings\n// that have less than 20 ASCII characters\n\n// https://rosettacode.org/wiki/Levenshtein_distance#ES5\nfunction levenshtein(a: string, b: string): number {\n let t = [],\n u: number[] = [],\n i,\n j;\n const m = a.length,\n n = b.length;\n if (!m) {\n return n;\n }\n if (!n) {\n return m;\n }\n for (j = 0; j <= n; j++) {\n t[j] = j;\n }\n for (i = 1; i <= m; i++) {\n for (u = [i], j = 1; j <= n; j++) {\n u[j] =\n a[i - 1] === b[j - 1] ? t[j - 1] : min(t[j - 1], t[j], u[j - 1]) + 1;\n }\n t = u;\n }\n return u[n];\n}\n\n/**\n * Given a string `str` and an array of candidates `arr`,\n * return the first of elements in candidates that has minimal\n * Levenshtein distance with `str`.\n * @export\n * @param {string} str\n * @param {string[]} arr\n * @returns {string}\n */\nexport function findSuggestion(str: string, arr: readonly string[]): string {\n const distances = arr.map(el => levenshtein(el, str));\n return arr[distances.indexOf(min(...distances))];\n}\n"],"mappings":";;;;;;AAAA,MAAM;EAAEA;AAAI,CAAC,GAAGC,IAAI;AASpB,SAASC,WAAWA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACjD,IAAIC,CAAC,GAAG,EAAE;IACRC,CAAW,GAAG,EAAE;IAChBC,CAAC;IACDC,CAAC;EACH,MAAMC,CAAC,GAAGN,CAAC,CAACO,MAAM;IAChBC,CAAC,GAAGP,CAAC,CAACM,MAAM;EACd,IAAI,CAACD,CAAC,EAAE;IACN,OAAOE,CAAC;EACV;EACA,IAAI,CAACA,CAAC,EAAE;IACN,OAAOF,CAAC;EACV;EACA,KAAKD,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIG,CAAC,EAAEH,CAAC,EAAE,EAAE;IACvBH,CAAC,CAACG,CAAC,CAAC,GAAGA,CAAC;EACV;EACA,KAAKD,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIE,CAAC,EAAEF,CAAC,EAAE,EAAE;IACvB,KAAKD,CAAC,GAAG,CAACC,CAAC,CAAC,EAAEC,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIG,CAAC,EAAEH,CAAC,EAAE,EAAE;MAChCF,CAAC,CAACE,CAAC,CAAC,GACFL,CAAC,CAACI,CAAC,GAAG,CAAC,CAAC,KAAKH,CAAC,CAACI,CAAC,GAAG,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,GAAG,CAAC,CAAC,GAAGR,GAAG,CAACK,CAAC,CAACG,CAAC,GAAG,CAAC,CAAC,EAAEH,CAAC,CAACG,CAAC,CAAC,EAAEF,CAAC,CAACE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACxE;IACAH,CAAC,GAAGC,CAAC;EACP;EACA,OAAOA,CAAC,CAACK,CAAC,CAAC;AACb;AAWO,SAASC,cAAcA,CAACC,GAAW,EAAEC,GAAsB,EAAU;EAC1E,MAAMC,SAAS,GAAGD,GAAG,CAACE,GAAG,CAASC,EAAE,IAAIf,WAAW,CAACe,EAAE,EAAEJ,GAAG,CAAC,CAAC;EAC7D,OAAOC,GAAG,CAACC,SAAS,CAACG,OAAO,CAAClB,GAAG,CAAC,GAAGe,SAAS,CAAC,CAAC,CAAC;AAClD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/lib/index.js b/node_modules/@babel/helper-validator-option/lib/index.js new file mode 100644 index 0000000..533eb45 --- /dev/null +++ b/node_modules/@babel/helper-validator-option/lib/index.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "OptionValidator", { + enumerable: true, + get: function () { + return _validator.OptionValidator; + } +}); +Object.defineProperty(exports, "findSuggestion", { + enumerable: true, + get: function () { + return _findSuggestion.findSuggestion; + } +}); +var _validator = require("./validator.js"); +var _findSuggestion = require("./find-suggestion.js"); + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-validator-option/lib/index.js.map b/node_modules/@babel/helper-validator-option/lib/index.js.map new file mode 100644 index 0000000..b0c471b --- /dev/null +++ b/node_modules/@babel/helper-validator-option/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_validator","require","_findSuggestion"],"sources":["../src/index.ts"],"sourcesContent":["export { OptionValidator } from \"./validator.ts\";\nexport { findSuggestion } from \"./find-suggestion.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/lib/validator.js b/node_modules/@babel/helper-validator-option/lib/validator.js new file mode 100644 index 0000000..5c9312e --- /dev/null +++ b/node_modules/@babel/helper-validator-option/lib/validator.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.OptionValidator = void 0; +var _findSuggestion = require("./find-suggestion.js"); +class OptionValidator { + constructor(descriptor) { + this.descriptor = descriptor; + } + validateTopLevelOptions(options, TopLevelOptionShape) { + const validOptionNames = Object.keys(TopLevelOptionShape); + for (const option of Object.keys(options)) { + if (!validOptionNames.includes(option)) { + throw new Error(this.formatMessage(`'${option}' is not a valid top-level option. +- Did you mean '${(0, _findSuggestion.findSuggestion)(option, validOptionNames)}'?`)); + } + } + } + validateBooleanOption(name, value, defaultValue) { + if (value === undefined) { + return defaultValue; + } else { + this.invariant(typeof value === "boolean", `'${name}' option must be a boolean.`); + } + return value; + } + validateStringOption(name, value, defaultValue) { + if (value === undefined) { + return defaultValue; + } else { + this.invariant(typeof value === "string", `'${name}' option must be a string.`); + } + return value; + } + invariant(condition, message) { + if (!condition) { + throw new Error(this.formatMessage(message)); + } + } + formatMessage(message) { + return `${this.descriptor}: ${message}`; + } +} +exports.OptionValidator = OptionValidator; + +//# sourceMappingURL=validator.js.map diff --git a/node_modules/@babel/helper-validator-option/lib/validator.js.map b/node_modules/@babel/helper-validator-option/lib/validator.js.map new file mode 100644 index 0000000..0bc61cb --- /dev/null +++ b/node_modules/@babel/helper-validator-option/lib/validator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_findSuggestion","require","OptionValidator","constructor","descriptor","validateTopLevelOptions","options","TopLevelOptionShape","validOptionNames","Object","keys","option","includes","Error","formatMessage","findSuggestion","validateBooleanOption","name","value","defaultValue","undefined","invariant","validateStringOption","condition","message","exports"],"sources":["../src/validator.ts"],"sourcesContent":["import { findSuggestion } from \"./find-suggestion.ts\";\n\nexport class OptionValidator {\n declare descriptor: string;\n constructor(descriptor: string) {\n this.descriptor = descriptor;\n }\n\n /**\n * Validate if the given `options` follow the name of keys defined in the `TopLevelOptionShape`\n *\n * @param {Object} options\n * @param {Object} TopLevelOptionShape\n * An object with all the valid key names that `options` should be allowed to have\n * The property values of `TopLevelOptionShape` can be arbitrary\n * @memberof OptionValidator\n */\n validateTopLevelOptions(options: object, TopLevelOptionShape: object): void {\n const validOptionNames = Object.keys(TopLevelOptionShape);\n for (const option of Object.keys(options)) {\n if (!validOptionNames.includes(option)) {\n throw new Error(\n this.formatMessage(`'${option}' is not a valid top-level option.\n- Did you mean '${findSuggestion(option, validOptionNames)}'?`),\n );\n }\n }\n }\n\n // note: we do not consider rewrite them to high order functions\n // until we have to support `validateNumberOption`.\n validateBooleanOption(\n name: string,\n value?: boolean,\n defaultValue?: T,\n ): boolean | T {\n if (value === undefined) {\n return defaultValue;\n } else {\n this.invariant(\n typeof value === \"boolean\",\n `'${name}' option must be a boolean.`,\n );\n }\n return value;\n }\n\n validateStringOption(\n name: string,\n value?: string,\n defaultValue?: T,\n ): string | T {\n if (value === undefined) {\n return defaultValue;\n } else {\n this.invariant(\n typeof value === \"string\",\n `'${name}' option must be a string.`,\n );\n }\n return value;\n }\n /**\n * A helper interface copied from the `invariant` npm package.\n * It throws given `message` when `condition` is not met\n *\n * @param {boolean} condition\n * @param {string} message\n * @memberof OptionValidator\n */\n invariant(condition: boolean, message: string): void {\n if (!condition) {\n throw new Error(this.formatMessage(message));\n }\n }\n\n formatMessage(message: string): string {\n return `${this.descriptor}: ${message}`;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEO,MAAMC,eAAe,CAAC;EAE3BC,WAAWA,CAACC,UAAkB,EAAE;IAC9B,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;EAWAC,uBAAuBA,CAACC,OAAe,EAAEC,mBAA2B,EAAQ;IAC1E,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CAACH,mBAAmB,CAAC;IACzD,KAAK,MAAMI,MAAM,IAAIF,MAAM,CAACC,IAAI,CAACJ,OAAO,CAAC,EAAE;MACzC,IAAI,CAACE,gBAAgB,CAACI,QAAQ,CAACD,MAAM,CAAC,EAAE;QACtC,MAAM,IAAIE,KAAK,CACb,IAAI,CAACC,aAAa,CAAC,IAAIH,MAAM;AACvC,kBAAkB,IAAAI,8BAAc,EAACJ,MAAM,EAAEH,gBAAgB,CAAC,IAAI,CACtD,CAAC;MACH;IACF;EACF;EAIAQ,qBAAqBA,CACnBC,IAAY,EACZC,KAAe,EACfC,YAAgB,EACH;IACb,IAAID,KAAK,KAAKE,SAAS,EAAE;MACvB,OAAOD,YAAY;IACrB,CAAC,MAAM;MACL,IAAI,CAACE,SAAS,CACZ,OAAOH,KAAK,KAAK,SAAS,EAC1B,IAAID,IAAI,6BACV,CAAC;IACH;IACA,OAAOC,KAAK;EACd;EAEAI,oBAAoBA,CAClBL,IAAY,EACZC,KAAc,EACdC,YAAgB,EACJ;IACZ,IAAID,KAAK,KAAKE,SAAS,EAAE;MACvB,OAAOD,YAAY;IACrB,CAAC,MAAM;MACL,IAAI,CAACE,SAAS,CACZ,OAAOH,KAAK,KAAK,QAAQ,EACzB,IAAID,IAAI,4BACV,CAAC;IACH;IACA,OAAOC,KAAK;EACd;EASAG,SAASA,CAACE,SAAkB,EAAEC,OAAe,EAAQ;IACnD,IAAI,CAACD,SAAS,EAAE;MACd,MAAM,IAAIV,KAAK,CAAC,IAAI,CAACC,aAAa,CAACU,OAAO,CAAC,CAAC;IAC9C;EACF;EAEAV,aAAaA,CAACU,OAAe,EAAU;IACrC,OAAO,GAAG,IAAI,CAACpB,UAAU,KAAKoB,OAAO,EAAE;EACzC;AACF;AAACC,OAAA,CAAAvB,eAAA,GAAAA,eAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-option/package.json b/node_modules/@babel/helper-validator-option/package.json new file mode 100644 index 0000000..1c97a90 --- /dev/null +++ b/node_modules/@babel/helper-validator-option/package.json @@ -0,0 +1,27 @@ +{ + "name": "@babel/helper-validator-option", + "version": "7.27.1", + "description": "Validate plugin/preset options", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-option" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helpers/LICENSE b/node_modules/@babel/helpers/LICENSE new file mode 100644 index 0000000..37b2c99 --- /dev/null +++ b/node_modules/@babel/helpers/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors +Copyright (c) 2014-present, Facebook, Inc. (ONLY ./src/helpers/regenerator* files) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helpers/README.md b/node_modules/@babel/helpers/README.md new file mode 100644 index 0000000..95fcf29 --- /dev/null +++ b/node_modules/@babel/helpers/README.md @@ -0,0 +1,19 @@ +# @babel/helpers + +> Collection of helper functions used by Babel transforms. + +See our website [@babel/helpers](https://babeljs.io/docs/babel-helpers) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/helpers +``` + +or using yarn: + +```sh +yarn add @babel/helpers --dev +``` diff --git a/node_modules/@babel/helpers/lib/helpers-generated.js b/node_modules/@babel/helpers/lib/helpers-generated.js new file mode 100644 index 0000000..508f0c4 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers-generated.js @@ -0,0 +1,1442 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _template = require("@babel/template"); +function helper(minVersion, source, metadata) { + return Object.freeze({ + minVersion, + ast: () => _template.default.program.ast(source, { + preserveComments: true + }), + metadata + }); +} +const helpers = exports.default = { + __proto__: null, + OverloadYield: helper("7.18.14", "function _OverloadYield(e,d){this.v=e,this.k=d}", { + globals: [], + locals: { + _OverloadYield: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_OverloadYield", + dependencies: {}, + internal: false + }), + applyDecoratedDescriptor: helper("7.0.0-beta.0", 'function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach(function(i){a[i]=n[i]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce(function(r,n){return n(i,e,r)||r},a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}', { + globals: ["Object"], + locals: { + _applyDecoratedDescriptor: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_applyDecoratedDescriptor", + dependencies: {}, + internal: false + }), + applyDecs2311: helper("7.24.0", 'function applyDecs2311(e,t,n,r,o,i){var a,c,u,s,f,l,p,d=Symbol.metadata||Symbol.for("Symbol.metadata"),m=Object.defineProperty,h=Object.create,y=[h(null),h(null)],v=t.length;function g(t,n,r){return function(o,i){n&&(i=o,o=e);for(var a=0;a=0;O-=n?2:1){var T=b(h[O],"A decorator","be",!0),z=n?h[O-1]:void 0,A={},H={kind:["field","accessor","method","getter","setter","class"][o],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw new TypeError("attempted to call addInitializer after decoration was finished");b(t,"An initializer","be",!0),i.push(t)}.bind(null,A)};if(w)c=T.call(z,N,H),A.v=1,b(c,"class decorators","return")&&(N=c);else if(H.static=s,H.private=f,c=H.access={has:f?p.bind():function(e){return r in e}},j||(c.get=f?E?function(e){return d(e),P.value}:I("get",0,d):function(e){return e[r]}),E||S||(c.set=f?I("set",0,d):function(e,t){e[r]=t}),N=T.call(z,D?{get:P.get,set:P.set}:P[F],H),A.v=1,D){if("object"==typeof N&&N)(c=b(N.get,"accessor.get"))&&(P.get=c),(c=b(N.set,"accessor.set"))&&(P.set=c),(c=b(N.init,"accessor.init"))&&k.unshift(c);else if(void 0!==N)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else b(N,(l?"field":"method")+" decorators","return")&&(l?k.unshift(N):P[F]=N)}return o<2&&u.push(g(k,s,1),g(i,s,0)),l||w||(f?D?u.splice(-1,0,I("get",s),I("set",s)):u.push(E?P[F]:b.call.bind(P[F])):m(e,r,P)),N}function w(e){return m(e,d,{configurable:!0,enumerable:!0,value:a})}return void 0!==i&&(a=i[d]),a=h(null==a?null:a),f=[],l=function(e){e&&f.push(g(e))},p=function(t,r){for(var i=0;ir.length)&&(a=r.length);for(var e=0,n=Array(a);e=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){t=t.call(r)},n:function(){var r=t.next();return a=r.done,r},e:function(r){u=!0,o=r},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}', { + globals: ["Symbol", "Array", "TypeError"], + locals: { + _createForOfIteratorHelper: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_createForOfIteratorHelper", + dependencies: { + unsupportedIterableToArray: ["body.0.body.body.1.consequent.body.0.test.left.right.right.callee"] + }, + internal: false + }), + createForOfIteratorHelperLoose: helper("7.9.0", 'function _createForOfIteratorHelperLoose(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}', { + globals: ["Symbol", "Array", "TypeError"], + locals: { + _createForOfIteratorHelperLoose: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_createForOfIteratorHelperLoose", + dependencies: { + unsupportedIterableToArray: ["body.0.body.body.2.test.left.right.right.callee"] + }, + internal: false + }), + createSuper: helper("7.9.0", "function _createSuper(t){var r=isNativeReflectConstruct();return function(){var e,o=getPrototypeOf(t);if(r){var s=getPrototypeOf(this).constructor;e=Reflect.construct(o,arguments,s)}else e=o.apply(this,arguments);return possibleConstructorReturn(this,e)}}", { + globals: ["Reflect"], + locals: { + _createSuper: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_createSuper", + dependencies: { + getPrototypeOf: ["body.0.body.body.1.argument.body.body.0.declarations.1.init.callee", "body.0.body.body.1.argument.body.body.1.consequent.body.0.declarations.0.init.object.callee"], + isNativeReflectConstruct: ["body.0.body.body.0.declarations.0.init.callee"], + possibleConstructorReturn: ["body.0.body.body.1.argument.body.body.2.argument.callee"] + }, + internal: false + }), + decorate: helper("7.1.5", 'function _decorate(e,r,t,i){var o=_getDecoratorsApi();if(i)for(var n=0;n=0;n--){var s=r[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,o[n])(a)||a);e=l.element,this.addElementPlacement(e,r),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var p=0;p=0;i--){var o=this.fromClassDescriptor(e),n=this.toClassDescriptor((0,r[i])(o)||o);if(void 0!==n.finisher&&t.push(n.finisher),void 0!==n.elements){e=n.elements;for(var s=0;s1){for(var t=Array(n),f=0;f3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&dn||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a \'"+o+"\' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(define(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(u,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",define(GeneratorFunctionPrototype,o,"GeneratorFunction"),define(u),define(u,o,"Generator"),define(u,n,function(){return this}),define(u,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:i,m:f}})()}', { + globals: ["Symbol", "Object", "TypeError"], + locals: { + _regenerator: ["body.0.id", "body.0.body.body.9.argument.expressions.9.callee.left"] + }, + exportBindingAssignments: ["body.0.body.body.9.argument.expressions.9.callee"], + exportName: "_regenerator", + dependencies: { + regeneratorDefine: ["body.0.body.body.1.body.body.1.argument.expressions.0.callee", "body.0.body.body.7.declarations.0.init.alternate.expressions.0.callee", "body.0.body.body.8.body.body.0.argument.expressions.0.alternate.expressions.1.callee", "body.0.body.body.9.argument.expressions.1.callee", "body.0.body.body.9.argument.expressions.2.callee", "body.0.body.body.9.argument.expressions.4.callee", "body.0.body.body.9.argument.expressions.5.callee", "body.0.body.body.9.argument.expressions.6.callee", "body.0.body.body.9.argument.expressions.7.callee", "body.0.body.body.9.argument.expressions.8.callee"] + }, + internal: false + }), + regeneratorAsync: helper("7.27.0", "function _regeneratorAsync(n,e,r,t,o){var a=asyncGen(n,e,r,t,o);return a.next().then(function(n){return n.done?n.value:a.next()})}", { + globals: [], + locals: { + _regeneratorAsync: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_regeneratorAsync", + dependencies: { + regeneratorAsyncGen: ["body.0.body.body.0.declarations.0.init.callee"] + }, + internal: false + }), + regeneratorAsyncGen: helper("7.27.0", "function _regeneratorAsyncGen(r,e,t,o,n){return new regeneratorAsyncIterator(regenerator().w(r,e,t,o),n||Promise)}", { + globals: ["Promise"], + locals: { + _regeneratorAsyncGen: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_regeneratorAsyncGen", + dependencies: { + regenerator: ["body.0.body.body.0.argument.arguments.0.callee.object.callee"], + regeneratorAsyncIterator: ["body.0.body.body.0.argument.callee"] + }, + internal: false + }), + regeneratorAsyncIterator: helper("7.27.0", 'function AsyncIterator(t,e){function n(r,o,i,f){try{var c=t[r](o),u=c.value;return u instanceof OverloadYield?e.resolve(u.v).then(function(t){n("next",t,i,f)},function(t){n("throw",t,i,f)}):e.resolve(u).then(function(t){c.value=t,i(c)},function(t){return n("throw",t,i,f)})}catch(t){f(t)}}var r;this.next||(define(AsyncIterator.prototype),define(AsyncIterator.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),define(this,"_invoke",function(t,o,i){function f(){return new e(function(e,r){n(t,i,e,r)})}return r=r?r.then(f,f):f()},!0)}', { + globals: ["Symbol"], + locals: { + AsyncIterator: ["body.0.id", "body.0.body.body.2.expression.expressions.0.right.expressions.0.arguments.0.object", "body.0.body.body.2.expression.expressions.0.right.expressions.1.arguments.0.object"] + }, + exportBindingAssignments: [], + exportName: "AsyncIterator", + dependencies: { + OverloadYield: ["body.0.body.body.0.body.body.0.block.body.1.argument.test.right"], + regeneratorDefine: ["body.0.body.body.2.expression.expressions.0.right.expressions.0.callee", "body.0.body.body.2.expression.expressions.0.right.expressions.1.callee", "body.0.body.body.2.expression.expressions.1.callee"] + }, + internal: true + }), + regeneratorDefine: helper("7.27.0", 'function regeneratorDefine(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}regeneratorDefine=function(e,r,n,t){function o(r,n){regeneratorDefine(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},regeneratorDefine(e,r,n,t)}', { + globals: ["Object"], + locals: { + regeneratorDefine: ["body.0.id", "body.0.body.body.2.expression.expressions.0.right.body.body.0.body.body.0.expression.callee", "body.0.body.body.2.expression.expressions.1.callee", "body.0.body.body.2.expression.expressions.0.left"] + }, + exportBindingAssignments: ["body.0.body.body.2.expression.expressions.0"], + exportName: "regeneratorDefine", + dependencies: {}, + internal: true + }), + regeneratorKeys: helper("7.27.0", "function _regeneratorKeys(e){var n=Object(e),r=[];for(var t in n)r.unshift(t);return function e(){for(;r.length;)if((t=r.pop())in n)return e.value=t,e.done=!1,e;return e.done=!0,e}}", { + globals: ["Object"], + locals: { + _regeneratorKeys: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_regeneratorKeys", + dependencies: {}, + internal: false + }), + regeneratorValues: helper("7.18.0", 'function _regeneratorValues(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}', { + globals: ["Symbol", "isNaN", "TypeError"], + locals: { + _regeneratorValues: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_regeneratorValues", + dependencies: {}, + internal: false + }), + set: helper("7.0.0-beta.0", 'function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f)}else defineProperty(o,r,t);return!0},set(e,r,t,o)}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t}', { + globals: ["Reflect", "Object", "TypeError"], + locals: { + set: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.1.body.body.0.test.left.argument.callee", "body.0.body.body.0.argument.expressions.0.left"], + _set: ["body.1.id"] + }, + exportBindingAssignments: [], + exportName: "_set", + dependencies: { + superPropBase: ["body.0.body.body.0.argument.expressions.0.right.alternate.body.body.0.declarations.1.init.callee"], + defineProperty: ["body.0.body.body.0.argument.expressions.0.right.alternate.body.body.2.alternate.expression.callee"] + }, + internal: false + }), + setFunctionName: helper("7.23.6", 'function setFunctionName(e,t,n){"symbol"==typeof t&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}', { + globals: ["Object"], + locals: { + setFunctionName: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "setFunctionName", + dependencies: {}, + internal: false + }), + setPrototypeOf: helper("7.0.0-beta.0", "function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}", { + globals: ["Object"], + locals: { + _setPrototypeOf: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.0.body.body.0.argument.expressions.0.left"] + }, + exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"], + exportName: "_setPrototypeOf", + dependencies: {}, + internal: false + }), + skipFirstGeneratorNext: helper("7.0.0-beta.0", "function _skipFirstGeneratorNext(t){return function(){var r=t.apply(this,arguments);return r.next(),r}}", { + globals: [], + locals: { + _skipFirstGeneratorNext: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_skipFirstGeneratorNext", + dependencies: {}, + internal: false + }), + slicedToArray: helper("7.0.0-beta.0", "function _slicedToArray(r,e){return arrayWithHoles(r)||iterableToArrayLimit(r,e)||unsupportedIterableToArray(r,e)||nonIterableRest()}", { + globals: [], + locals: { + _slicedToArray: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_slicedToArray", + dependencies: { + arrayWithHoles: ["body.0.body.body.0.argument.left.left.left.callee"], + iterableToArrayLimit: ["body.0.body.body.0.argument.left.left.right.callee"], + unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"], + nonIterableRest: ["body.0.body.body.0.argument.right.callee"] + }, + internal: false + }), + superPropBase: helper("7.0.0-beta.0", "function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=getPrototypeOf(t)););return t}", { + globals: [], + locals: { + _superPropBase: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_superPropBase", + dependencies: { + getPrototypeOf: ["body.0.body.body.0.test.right.right.right.callee"] + }, + internal: false + }), + superPropGet: helper("7.25.0", 'function _superPropGet(t,o,e,r){var p=get(getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}', { + globals: [], + locals: { + _superPropGet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_superPropGet", + dependencies: { + get: ["body.0.body.body.0.declarations.0.init.callee"], + getPrototypeOf: ["body.0.body.body.0.declarations.0.init.arguments.0.callee"] + }, + internal: false + }), + superPropSet: helper("7.25.0", "function _superPropSet(t,e,o,r,p,f){return set(getPrototypeOf(f?t.prototype:t),e,o,r,p)}", { + globals: [], + locals: { + _superPropSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_superPropSet", + dependencies: { + set: ["body.0.body.body.0.argument.callee"], + getPrototypeOf: ["body.0.body.body.0.argument.arguments.0.callee"] + }, + internal: false + }), + taggedTemplateLiteral: helper("7.0.0-beta.0", "function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}", { + globals: ["Object"], + locals: { + _taggedTemplateLiteral: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_taggedTemplateLiteral", + dependencies: {}, + internal: false + }), + taggedTemplateLiteralLoose: helper("7.0.0-beta.0", "function _taggedTemplateLiteralLoose(e,t){return t||(t=e.slice(0)),e.raw=t,e}", { + globals: [], + locals: { + _taggedTemplateLiteralLoose: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_taggedTemplateLiteralLoose", + dependencies: {}, + internal: false + }), + tdz: helper("7.5.5", 'function _tdzError(e){throw new ReferenceError(e+" is not defined - temporal dead zone")}', { + globals: ["ReferenceError"], + locals: { + _tdzError: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_tdzError", + dependencies: {}, + internal: false + }), + temporalRef: helper("7.0.0-beta.0", "function _temporalRef(r,e){return r===undef?err(e):r}", { + globals: [], + locals: { + _temporalRef: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_temporalRef", + dependencies: { + temporalUndefined: ["body.0.body.body.0.argument.test.right"], + tdz: ["body.0.body.body.0.argument.consequent.callee"] + }, + internal: false + }), + temporalUndefined: helper("7.0.0-beta.0", "function _temporalUndefined(){}", { + globals: [], + locals: { + _temporalUndefined: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_temporalUndefined", + dependencies: {}, + internal: false + }), + toArray: helper("7.0.0-beta.0", "function _toArray(r){return arrayWithHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableRest()}", { + globals: [], + locals: { + _toArray: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_toArray", + dependencies: { + arrayWithHoles: ["body.0.body.body.0.argument.left.left.left.callee"], + iterableToArray: ["body.0.body.body.0.argument.left.left.right.callee"], + unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"], + nonIterableRest: ["body.0.body.body.0.argument.right.callee"] + }, + internal: false + }), + toConsumableArray: helper("7.0.0-beta.0", "function _toConsumableArray(r){return arrayWithoutHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableSpread()}", { + globals: [], + locals: { + _toConsumableArray: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_toConsumableArray", + dependencies: { + arrayWithoutHoles: ["body.0.body.body.0.argument.left.left.left.callee"], + iterableToArray: ["body.0.body.body.0.argument.left.left.right.callee"], + unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"], + nonIterableSpread: ["body.0.body.body.0.argument.right.callee"] + }, + internal: false + }), + toPrimitive: helper("7.1.5", 'function toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}', { + globals: ["Symbol", "TypeError", "String", "Number"], + locals: { + toPrimitive: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "toPrimitive", + dependencies: {}, + internal: false + }), + toPropertyKey: helper("7.1.5", 'function toPropertyKey(t){var i=toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}', { + globals: [], + locals: { + toPropertyKey: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "toPropertyKey", + dependencies: { + toPrimitive: ["body.0.body.body.0.declarations.0.init.callee"] + }, + internal: false + }), + toSetter: helper("7.24.0", 'function _toSetter(t,e,n){e||(e=[]);var r=e.length++;return Object.defineProperty({},"_",{set:function(o){e[r]=o,t.apply(n,e)}})}', { + globals: ["Object"], + locals: { + _toSetter: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_toSetter", + dependencies: {}, + internal: false + }), + tsRewriteRelativeImportExtensions: helper("7.27.0", 'function tsRewriteRelativeImportExtensions(t,e){return"string"==typeof t&&/^\\.\\.?\\//.test(t)?t.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+)?)\\.([cm]?)ts$/i,function(t,s,r,n,o){return s?e?".jsx":".js":!r||n&&o?r+n+"."+o.toLowerCase()+"js":t}):t}', { + globals: [], + locals: { + tsRewriteRelativeImportExtensions: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "tsRewriteRelativeImportExtensions", + dependencies: {}, + internal: false + }), + typeof: helper("7.0.0-beta.0", 'function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}', { + globals: ["Symbol"], + locals: { + _typeof: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.0.body.body.0.argument.expressions.0.left"] + }, + exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"], + exportName: "_typeof", + dependencies: {}, + internal: false + }), + unsupportedIterableToArray: helper("7.9.0", 'function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?arrayLikeToArray(r,a):void 0}}', { + globals: ["Array"], + locals: { + _unsupportedIterableToArray: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_unsupportedIterableToArray", + dependencies: { + arrayLikeToArray: ["body.0.body.body.0.consequent.body.0.consequent.argument.callee", "body.0.body.body.0.consequent.body.2.argument.expressions.1.alternate.consequent.callee"] + }, + internal: false + }), + usingCtx: helper("7.23.9", 'function _usingCtx(){var r="function"==typeof SuppressedError?SuppressedError:function(r,e){var n=Error();return n.name="SuppressedError",n.error=r,n.suppressed=e,n},e={},n=[];function using(r,e){if(null!=e){if(Object(e)!==e)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(r)var o=e[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(void 0===o&&(o=e[Symbol.dispose||Symbol.for("Symbol.dispose")],r))var t=o;if("function"!=typeof o)throw new TypeError("Object is not disposable.");t&&(o=function(){try{t.call(e)}catch(r){return Promise.reject(r)}}),n.push({v:e,d:o,a:r})}else r&&n.push({d:e,a:r});return e}return{e:e,u:using.bind(null,!1),a:using.bind(null,!0),d:function(){var o,t=this.e,s=0;function next(){for(;o=n.pop();)try{if(!o.a&&1===s)return s=0,n.push(o),Promise.resolve().then(next);if(o.d){var r=o.d.call(o.v);if(o.a)return s|=2,Promise.resolve(r).then(next,err)}else s|=1}catch(r){return err(r)}if(1===s)return t!==e?Promise.reject(t):Promise.resolve();if(t!==e)throw t}function err(n){return t=t!==e?new r(n,t):n,next()}return next()}}}', { + globals: ["SuppressedError", "Error", "Object", "TypeError", "Symbol", "Promise"], + locals: { + _usingCtx: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_usingCtx", + dependencies: {}, + internal: false + }), + wrapAsyncGenerator: helper("7.0.0-beta.0", 'function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments))}}function AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then(function(t){if(u){var i="return"===r?"return":"next";if(!o.k||t.done)return resume(i,t);t=e[i](t).value}settle(n.done?"return":"normal",t)},function(e){resume("throw",e)})}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":r.resolve({value:n,done:!0});break;case"throw":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function(e,n){return new Promise(function(o,u){var i={key:e,arg:n,resolve:o,reject:u,next:null};t?t=t.next=i:(r=t=i,resume(e,n))})},"function"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};', { + globals: ["Promise", "Symbol"], + locals: { + _wrapAsyncGenerator: ["body.0.id"], + AsyncGenerator: ["body.1.id", "body.0.body.body.0.argument.body.body.0.argument.callee", "body.2.expression.expressions.0.left.object.object", "body.2.expression.expressions.1.left.object.object", "body.2.expression.expressions.2.left.object.object", "body.2.expression.expressions.3.left.object.object"] + }, + exportBindingAssignments: [], + exportName: "_wrapAsyncGenerator", + dependencies: { + OverloadYield: ["body.1.body.body.1.body.body.0.block.body.0.declarations.2.init.right"] + }, + internal: false + }), + wrapNativeSuper: helper("7.0.0-beta.0", 'function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(t){if(null===t||!isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return construct(t,arguments,getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}', { + globals: ["Map", "TypeError", "Object"], + locals: { + _wrapNativeSuper: ["body.0.id", "body.0.body.body.1.argument.expressions.1.callee", "body.0.body.body.1.argument.expressions.0.left"] + }, + exportBindingAssignments: ["body.0.body.body.1.argument.expressions.0"], + exportName: "_wrapNativeSuper", + dependencies: { + getPrototypeOf: ["body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.arguments.2.object.callee"], + setPrototypeOf: ["body.0.body.body.1.argument.expressions.0.right.body.body.4.argument.expressions.1.callee"], + isNativeFunction: ["body.0.body.body.1.argument.expressions.0.right.body.body.0.test.right.argument.callee"], + construct: ["body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.callee"] + }, + internal: false + }), + wrapRegExp: helper("7.19.0", 'function _wrapRegExp(){_wrapRegExp=function(e,r){return new BabelRegExp(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function BabelRegExp(e,t,p){var o=RegExp(e,t);return r.set(o,p||r.get(e)),setPrototypeOf(o,BabelRegExp.prototype)}function buildGroups(e,t){var p=r.get(t);return Object.keys(p).reduce(function(r,t){var o=p[t];if("number"==typeof o)r[t]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1]+)(>|$)/g,function(e,r,t){if(""===t)return e;var p=o[r];return Array.isArray(p)?"$"+p.join("$"):"number"==typeof p?"$"+p:""}))}if("function"==typeof p){var i=this;return e[Symbol.replace].call(this,t,function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(buildGroups(e,i)),p.apply(this,e)})}return e[Symbol.replace].call(this,t,p)},_wrapRegExp.apply(this,arguments)}', { + globals: ["RegExp", "WeakMap", "Object", "Symbol", "Array"], + locals: { + _wrapRegExp: ["body.0.id", "body.0.body.body.4.argument.expressions.3.callee.object", "body.0.body.body.0.expression.left"] + }, + exportBindingAssignments: ["body.0.body.body.0.expression"], + exportName: "_wrapRegExp", + dependencies: { + setPrototypeOf: ["body.0.body.body.2.body.body.1.argument.expressions.1.callee"], + inherits: ["body.0.body.body.4.argument.expressions.0.callee"] + }, + internal: false + }), + writeOnlyError: helper("7.12.13", "function _writeOnlyError(r){throw new TypeError('\"'+r+'\" is write-only')}", { + globals: ["TypeError"], + locals: { + _writeOnlyError: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_writeOnlyError", + dependencies: {}, + internal: false + }) +}; +{ + Object.assign(helpers, { + AwaitValue: helper("7.0.0-beta.0", "function _AwaitValue(t){this.wrapped=t}", { + globals: [], + locals: { + _AwaitValue: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_AwaitValue", + dependencies: {}, + internal: false + }), + applyDecs: helper("7.17.8", 'function old_createMetadataMethodsForProperty(e,t,a,r){return{getMetadata:function(o){old_assertNotFinished(r,"getMetadata"),old_assertMetadataKey(o);var i=e[o];if(void 0!==i)if(1===t){var n=i.public;if(void 0!==n)return n[a]}else if(2===t){var l=i.private;if(void 0!==l)return l.get(a)}else if(Object.hasOwnProperty.call(i,"constructor"))return i.constructor},setMetadata:function(o,i){old_assertNotFinished(r,"setMetadata"),old_assertMetadataKey(o);var n=e[o];if(void 0===n&&(n=e[o]={}),1===t){var l=n.public;void 0===l&&(l=n.public={}),l[a]=i}else if(2===t){var s=n.priv;void 0===s&&(s=n.private=new Map),s.set(a,i)}else n.constructor=i}}}function old_convertMetadataMapToFinal(e,t){var a=e[Symbol.metadata||Symbol.for("Symbol.metadata")],r=Object.getOwnPropertySymbols(t);if(0!==r.length){for(var o=0;o=0;m--){var b;void 0!==(p=old_memberDec(h[m],r,c,l,s,o,i,n,f))&&(old_assertValidReturnValue(o,p),0===o?b=p:1===o?(b=old_getInit(p),v=p.get||f.get,y=p.set||f.set,f={get:v,set:y}):f=p,void 0!==b&&(void 0===d?d=b:"function"==typeof d?d=[d,b]:d.push(b)))}if(0===o||1===o){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var g=d;d=function(e,t){for(var a=t,r=0;r3,m=v>=5;if(m?(u=t,f=r,0!=(v-=5)&&(p=n=n||[])):(u=t.prototype,f=a,0!==v&&(p=i=i||[])),0!==v&&!h){var b=m?s:l,g=b.get(y)||0;if(!0===g||3===g&&4!==v||4===g&&3!==v)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+y);!g&&v>2?b.set(y,v):b.set(y,!0)}old_applyMemberDec(e,u,d,y,v,m,h,f,p)}}old_pushInitializers(e,i),old_pushInitializers(e,n)}function old_pushInitializers(e,t){t&&e.push(function(e){for(var a=0;a0){for(var o=[],i=t,n=t.name,l=r.length-1;l>=0;l--){var s={v:!1};try{var c=Object.assign({kind:"class",name:n,addInitializer:old_createAddInitializerMethod(o,s)},old_createMetadataMethodsForProperty(a,0,n,s)),d=r[l](i,c)}finally{s.v=!0}void 0!==d&&(old_assertValidReturnValue(10,d),i=d)}e.push(i,function(){for(var e=0;e=0;v--){var g;void 0!==(f=memberDec(h[v],a,c,o,n,i,s,u))&&(assertValidReturnValue(n,f),0===n?g=f:1===n?(g=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f,void 0!==g&&(void 0===l?l=g:"function"==typeof l?l=[l,g]:l.push(g)))}if(0===n||1===n){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var y=l;l=function(e,t){for(var r=t,a=0;a3,h=f>=5;if(h?(l=t,0!=(f-=5)&&(u=n=n||[])):(l=t.prototype,0!==f&&(u=a=a||[])),0!==f&&!d){var v=h?s:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(e,l,c,p,f,h,d,u)}}pushInitializers(e,a),pushInitializers(e,n)}(a,e,t),function(e,t,r){if(r.length>0){for(var a=[],n=t,i=t.name,s=r.length-1;s>=0;s--){var o={v:!1};try{var c=r[s](n,{kind:"class",name:i,addInitializer:createAddInitializerMethod(a,o)})}finally{o.v=!0}void 0!==c&&(assertValidReturnValue(10,c),n=c)}e.push(n,function(){for(var e=0;e=0;g--){var y;void 0!==(p=memberDec(v[g],n,c,s,a,i,o,f))&&(assertValidReturnValue(a,p),0===a?y=p:1===a?(y=p.init,d=p.get||f.get,h=p.set||f.set,f={get:d,set:h}):f=p,void 0!==y&&(void 0===l?l=y:"function"==typeof l?l=[l,y]:l.push(y)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var m=l;l=function(e,t){for(var r=t,n=0;n3,h=f>=5;if(h?(l=e,0!=(f-=5)&&(u=n=n||[])):(l=e.prototype,0!==f&&(u=r=r||[])),0!==f&&!d){var v=h?o:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(a,l,c,p,f,h,d,u)}}return pushInitializers(a,r),pushInitializers(a,n),a}function pushInitializers(e,t){t&&e.push(function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var o={v:!1};try{var s=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,o)})}finally{o.v=!0}void 0!==s&&(assertValidReturnValue(10,s),n=s)}return[n,function(){for(var e=0;e=0;m--){var b;void 0!==(h=memberDec(g[m],n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?b=h:1===a?(b=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==b&&(void 0===l?l=b:"function"==typeof l?l=[l,b]:l.push(b)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var I=l;l=function(e,t){for(var r=t,n=0;n3,y=d>=5,g=r;if(y?(f=e,0!=(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),g=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=y?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,y,v,p,g)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push(function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e=0;j-=r?2:1){var D=v[j],E=r?v[j-1]:void 0,I={},O={kind:["field","accessor","method","getter","setter","class"][o],name:n,metadata:a,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");s(t,"An initializer","be",!0),c.push(t)}.bind(null,I)};try{if(b)(y=s(D.call(E,P,O),"class decorators","return"))&&(P=y);else{var k,F;O.static=l,O.private=f,f?2===o?k=function(e){return m(e),w.value}:(o<4&&(k=i(w,"get",m)),3!==o&&(F=i(w,"set",m))):(k=function(e){return e[n]},(o<2||4===o)&&(F=function(e,t){e[n]=t}));var N=O.access={has:f?h.bind():function(e){return n in e}};if(k&&(N.get=k),F&&(N.set=F),P=D.call(E,d?{get:w.get,set:w.set}:w[A],O),d){if("object"==typeof P&&P)(y=s(P.get,"accessor.get"))&&(w.get=y),(y=s(P.set,"accessor.set"))&&(w.set=y),(y=s(P.init,"accessor.init"))&&S.push(y);else if(void 0!==P)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else s(P,(p?"field":"method")+" decorators","return")&&(p?S.push(P):w[A]=P)}}finally{I.v=!0}}return(p||d)&&u.push(function(e,t){for(var r=S.length-1;r>=0;r--)t=S[r].call(e,t);return t}),p||b||(f?d?u.push(i(w,"get"),i(w,"set")):u.push(2===o?w[A]:i.call.bind(w[A])):Object.defineProperty(e,n,w)),P}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var l=a[Symbol.metadata||Symbol.for("Symbol.metadata")];var f=Object.create(null==l?null:l),p=function(e,t,r,n){var o,a,i=[],s=function(t){return checkInRHS(t)===e},u=new Map;function l(e){e&&i.push(c.bind(null,e))}for(var f=0;f3,y=16&d,v=!!(8&d),g=0==(d&=7),b=h+"/"+v;if(!g&&!m){var w=u.get(b);if(!0===w||3===w&&4!==d||4===w&&3!==d)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);u.set(b,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?"#"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,g,1===d,v&&m?s:r)}}return l(o),l(a),i}(e,t,o,f);return r.length||u(e,f),{e:p,get c(){var t=[];return r.length&&[u(applyDec(e,[r],n,e.name,5,f,t),f),c.bind(null,t,e)]}}}', { + globals: ["TypeError", "Array", "Object", "Error", "Symbol", "Map"], + locals: { + applyDecs2305: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "applyDecs2305", + dependencies: { + checkInRHS: ["body.0.body.body.6.declarations.1.init.callee.body.body.0.declarations.3.init.body.body.0.argument.left.callee"], + setFunctionName: ["body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.0.consequent.right.properties.0.value.callee", "body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.1.right.callee"], + toPropertyKey: ["body.0.body.body.6.declarations.1.init.callee.body.body.2.body.body.1.consequent.body.2.expression.arguments.3.alternate.callee"] + }, + internal: false + }), + classApplyDescriptorDestructureSet: helper("7.13.10", 'function _classApplyDescriptorDestructureSet(e,t){if(t.set)return"__destrObj"in t||(t.__destrObj={set value(r){t.set.call(e,r)}}),t.__destrObj;if(!t.writable)throw new TypeError("attempted to set read only private field");return t}', { + globals: ["TypeError"], + locals: { + _classApplyDescriptorDestructureSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classApplyDescriptorDestructureSet", + dependencies: {}, + internal: false + }), + classApplyDescriptorGet: helper("7.13.10", "function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}", { + globals: [], + locals: { + _classApplyDescriptorGet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classApplyDescriptorGet", + dependencies: {}, + internal: false + }), + classApplyDescriptorSet: helper("7.13.10", 'function _classApplyDescriptorSet(e,t,l){if(t.set)t.set.call(e,l);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=l}}', { + globals: ["TypeError"], + locals: { + _classApplyDescriptorSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classApplyDescriptorSet", + dependencies: {}, + internal: false + }), + classCheckPrivateStaticAccess: helper("7.13.10", "function _classCheckPrivateStaticAccess(s,a,r){return assertClassBrand(a,s,r)}", { + globals: [], + locals: { + _classCheckPrivateStaticAccess: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classCheckPrivateStaticAccess", + dependencies: { + assertClassBrand: ["body.0.body.body.0.argument.callee"] + }, + internal: false + }), + classCheckPrivateStaticFieldDescriptor: helper("7.13.10", 'function _classCheckPrivateStaticFieldDescriptor(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}', { + globals: ["TypeError"], + locals: { + _classCheckPrivateStaticFieldDescriptor: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classCheckPrivateStaticFieldDescriptor", + dependencies: {}, + internal: false + }), + classExtractFieldDescriptor: helper("7.13.10", "function _classExtractFieldDescriptor(e,t){return classPrivateFieldGet2(t,e)}", { + globals: [], + locals: { + _classExtractFieldDescriptor: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classExtractFieldDescriptor", + dependencies: { + classPrivateFieldGet2: ["body.0.body.body.0.argument.callee"] + }, + internal: false + }), + classPrivateFieldDestructureSet: helper("7.4.4", "function _classPrivateFieldDestructureSet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorDestructureSet(e,r)}", { + globals: [], + locals: { + _classPrivateFieldDestructureSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classPrivateFieldDestructureSet", + dependencies: { + classApplyDescriptorDestructureSet: ["body.0.body.body.1.argument.callee"], + classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"] + }, + internal: false + }), + classPrivateFieldGet: helper("7.0.0-beta.0", "function _classPrivateFieldGet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorGet(e,r)}", { + globals: [], + locals: { + _classPrivateFieldGet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classPrivateFieldGet", + dependencies: { + classApplyDescriptorGet: ["body.0.body.body.1.argument.callee"], + classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"] + }, + internal: false + }), + classPrivateFieldSet: helper("7.0.0-beta.0", "function _classPrivateFieldSet(e,t,r){var s=classPrivateFieldGet2(t,e);return classApplyDescriptorSet(e,s,r),r}", { + globals: [], + locals: { + _classPrivateFieldSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classPrivateFieldSet", + dependencies: { + classApplyDescriptorSet: ["body.0.body.body.1.argument.expressions.0.callee"], + classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"] + }, + internal: false + }), + classPrivateMethodGet: helper("7.1.6", "function _classPrivateMethodGet(s,a,r){return assertClassBrand(a,s),r}", { + globals: [], + locals: { + _classPrivateMethodGet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classPrivateMethodGet", + dependencies: { + assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"] + }, + internal: false + }), + classPrivateMethodSet: helper("7.1.6", 'function _classPrivateMethodSet(){throw new TypeError("attempted to reassign private method")}', { + globals: ["TypeError"], + locals: { + _classPrivateMethodSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classPrivateMethodSet", + dependencies: {}, + internal: false + }), + classStaticPrivateFieldDestructureSet: helper("7.13.10", 'function _classStaticPrivateFieldDestructureSet(t,r,s){return assertClassBrand(r,t),classCheckPrivateStaticFieldDescriptor(s,"set"),classApplyDescriptorDestructureSet(t,s)}', { + globals: [], + locals: { + _classStaticPrivateFieldDestructureSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classStaticPrivateFieldDestructureSet", + dependencies: { + classApplyDescriptorDestructureSet: ["body.0.body.body.0.argument.expressions.2.callee"], + assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"], + classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"] + }, + internal: false + }), + classStaticPrivateFieldSpecGet: helper("7.0.2", 'function _classStaticPrivateFieldSpecGet(t,s,r){return assertClassBrand(s,t),classCheckPrivateStaticFieldDescriptor(r,"get"),classApplyDescriptorGet(t,r)}', { + globals: [], + locals: { + _classStaticPrivateFieldSpecGet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classStaticPrivateFieldSpecGet", + dependencies: { + classApplyDescriptorGet: ["body.0.body.body.0.argument.expressions.2.callee"], + assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"], + classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"] + }, + internal: false + }), + classStaticPrivateFieldSpecSet: helper("7.0.2", 'function _classStaticPrivateFieldSpecSet(s,t,r,e){return assertClassBrand(t,s),classCheckPrivateStaticFieldDescriptor(r,"set"),classApplyDescriptorSet(s,r,e),e}', { + globals: [], + locals: { + _classStaticPrivateFieldSpecSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classStaticPrivateFieldSpecSet", + dependencies: { + classApplyDescriptorSet: ["body.0.body.body.0.argument.expressions.2.callee"], + assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"], + classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"] + }, + internal: false + }), + classStaticPrivateMethodSet: helper("7.3.2", 'function _classStaticPrivateMethodSet(){throw new TypeError("attempted to set read only static private field")}', { + globals: ["TypeError"], + locals: { + _classStaticPrivateMethodSet: ["body.0.id"] + }, + exportBindingAssignments: [], + exportName: "_classStaticPrivateMethodSet", + dependencies: {}, + internal: false + }), + defineEnumerableProperties: helper("7.0.0-beta.0", 'function _defineEnumerableProperties(e,r){for(var t in r){var n=r[t];n.configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t,n)}if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(r),b=0;b0;)try{var o=r.pop(),p=o.d.call(o.v);if(o.a)return Promise.resolve(p).then(next,err)}catch(r){return err(r)}if(s)throw e}function err(r){return e=s?new dispose_SuppressedError(e,r):r,s=!0,next()}return next()}', { + globals: ["SuppressedError", "Error", "Object", "Promise"], + locals: { + dispose_SuppressedError: ["body.0.id", "body.0.body.body.0.argument.expressions.0.alternate.expressions.1.left.object", "body.0.body.body.0.argument.expressions.0.alternate.expressions.1.right.arguments.1.properties.0.value.properties.0.value", "body.0.body.body.0.argument.expressions.1.callee", "body.1.body.body.1.body.body.0.argument.expressions.0.right.consequent.callee", "body.0.body.body.0.argument.expressions.0.consequent.left", "body.0.body.body.0.argument.expressions.0.alternate.expressions.0.left"], + _dispose: ["body.1.id"] + }, + exportBindingAssignments: [], + exportName: "_dispose", + dependencies: {}, + internal: false + }), + objectSpread: helper("7.0.0-beta.0", 'function _objectSpread(e){for(var r=1;r t.Program;\n metadata: HelperMetadata;\n}\n\nexport interface HelperMetadata {\n globals: string[];\n locals: { [name: string]: string[] };\n dependencies: { [name: string]: string[] };\n exportBindingAssignments: string[];\n exportName: string;\n internal: boolean;\n}\n\nfunction helper(\n minVersion: string,\n source: string,\n metadata: HelperMetadata,\n): Helper {\n return Object.freeze({\n minVersion,\n ast: () => template.program.ast(source, { preserveComments: true }),\n metadata,\n });\n}\n\nexport { helpers as default };\nconst helpers: Record = {\n __proto__: null,\n // size: 47, gzip size: 63\n OverloadYield: helper(\n \"7.18.14\",\n \"function _OverloadYield(e,d){this.v=e,this.k=d}\",\n {\n globals: [],\n locals: { _OverloadYield: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_OverloadYield\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 443, gzip size: 268\n applyDecoratedDescriptor: helper(\n \"7.0.0-beta.0\",\n 'function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach(function(i){a[i]=n[i]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,(\"value\"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce(function(r,n){return n(i,e,r)||r},a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}',\n {\n globals: [\"Object\"],\n locals: { _applyDecoratedDescriptor: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_applyDecoratedDescriptor\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 2839, gzip size: 1468\n applyDecs2311: helper(\n \"7.24.0\",\n 'function applyDecs2311(e,t,n,r,o,i){var a,c,u,s,f,l,p,d=Symbol.metadata||Symbol.for(\"Symbol.metadata\"),m=Object.defineProperty,h=Object.create,y=[h(null),h(null)],v=t.length;function g(t,n,r){return function(o,i){n&&(i=o,o=e);for(var a=0;a=0;O-=n?2:1){var T=b(h[O],\"A decorator\",\"be\",!0),z=n?h[O-1]:void 0,A={},H={kind:[\"field\",\"accessor\",\"method\",\"getter\",\"setter\",\"class\"][o],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw new TypeError(\"attempted to call addInitializer after decoration was finished\");b(t,\"An initializer\",\"be\",!0),i.push(t)}.bind(null,A)};if(w)c=T.call(z,N,H),A.v=1,b(c,\"class decorators\",\"return\")&&(N=c);else if(H.static=s,H.private=f,c=H.access={has:f?p.bind():function(e){return r in e}},j||(c.get=f?E?function(e){return d(e),P.value}:I(\"get\",0,d):function(e){return e[r]}),E||S||(c.set=f?I(\"set\",0,d):function(e,t){e[r]=t}),N=T.call(z,D?{get:P.get,set:P.set}:P[F],H),A.v=1,D){if(\"object\"==typeof N&&N)(c=b(N.get,\"accessor.get\"))&&(P.get=c),(c=b(N.set,\"accessor.set\"))&&(P.set=c),(c=b(N.init,\"accessor.init\"))&&k.unshift(c);else if(void 0!==N)throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\")}else b(N,(l?\"field\":\"method\")+\" decorators\",\"return\")&&(l?k.unshift(N):P[F]=N)}return o<2&&u.push(g(k,s,1),g(i,s,0)),l||w||(f?D?u.splice(-1,0,I(\"get\",s),I(\"set\",s)):u.push(E?P[F]:b.call.bind(P[F])):m(e,r,P)),N}function w(e){return m(e,d,{configurable:!0,enumerable:!0,value:a})}return void 0!==i&&(a=i[d]),a=h(null==a?null:a),f=[],l=function(e){e&&f.push(g(e))},p=function(t,r){for(var i=0;ir.length)&&(a=r.length);for(var e=0,n=Array(a);e=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:F}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var o,a=!0,u=!1;return{s:function(){t=t.call(r)},n:function(){var r=t.next();return a=r.done,r},e:function(r){u=!0,o=r},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}',\n {\n globals: [\"Symbol\", \"Array\", \"TypeError\"],\n locals: { _createForOfIteratorHelper: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_createForOfIteratorHelper\",\n dependencies: {\n unsupportedIterableToArray: [\n \"body.0.body.body.1.consequent.body.0.test.left.right.right.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 488, gzip size: 335\n createForOfIteratorHelperLoose: helper(\n \"7.9.0\",\n 'function _createForOfIteratorHelperLoose(r,e){var t=\"undefined\"!=typeof Symbol&&r[Symbol.iterator]||r[\"@@iterator\"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=unsupportedIterableToArray(r))||e&&r&&\"number\"==typeof r.length){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}',\n {\n globals: [\"Symbol\", \"Array\", \"TypeError\"],\n locals: { _createForOfIteratorHelperLoose: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_createForOfIteratorHelperLoose\",\n dependencies: {\n unsupportedIterableToArray: [\n \"body.0.body.body.2.test.left.right.right.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 255, gzip size: 172\n createSuper: helper(\n \"7.9.0\",\n \"function _createSuper(t){var r=isNativeReflectConstruct();return function(){var e,o=getPrototypeOf(t);if(r){var s=getPrototypeOf(this).constructor;e=Reflect.construct(o,arguments,s)}else e=o.apply(this,arguments);return possibleConstructorReturn(this,e)}}\",\n {\n globals: [\"Reflect\"],\n locals: { _createSuper: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_createSuper\",\n dependencies: {\n getPrototypeOf: [\n \"body.0.body.body.1.argument.body.body.0.declarations.1.init.callee\",\n \"body.0.body.body.1.argument.body.body.1.consequent.body.0.declarations.0.init.object.callee\",\n ],\n isNativeReflectConstruct: [\n \"body.0.body.body.0.declarations.0.init.callee\",\n ],\n possibleConstructorReturn: [\n \"body.0.body.body.1.argument.body.body.2.argument.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 7013, gzip size: 2052\n decorate: helper(\n \"7.1.5\",\n 'function _decorate(e,r,t,i){var o=_getDecoratorsApi();if(i)for(var n=0;n=0;n--){var s=r[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,o[n])(a)||a);e=l.element,this.addElementPlacement(e,r),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var p=0;p=0;i--){var o=this.fromClassDescriptor(e),n=this.toClassDescriptor((0,r[i])(o)||o);if(void 0!==n.finisher&&t.push(n.finisher),void 0!==n.elements){e=n.elements;for(var s=0;s1){for(var t=Array(n),f=0;f3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&dn||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError(\"Generator is already running\");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o=\"next\"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError(\"iterator result is not an object\");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError(\"The iterator does not provide a \\'\"+o+\"\\' method\"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(define(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,o,\"GeneratorFunction\")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(u,\"constructor\",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,\"constructor\",GeneratorFunction),GeneratorFunction.displayName=\"GeneratorFunction\",define(GeneratorFunctionPrototype,o,\"GeneratorFunction\"),define(u),define(u,o,\"Generator\"),define(u,n,function(){return this}),define(u,\"toString\",function(){return\"[object Generator]\"}),(_regenerator=function(){return{w:i,m:f}})()}',\n {\n globals: [\"Symbol\", \"Object\", \"TypeError\"],\n locals: {\n _regenerator: [\n \"body.0.id\",\n \"body.0.body.body.9.argument.expressions.9.callee.left\",\n ],\n },\n exportBindingAssignments: [\n \"body.0.body.body.9.argument.expressions.9.callee\",\n ],\n exportName: \"_regenerator\",\n dependencies: {\n regeneratorDefine: [\n \"body.0.body.body.1.body.body.1.argument.expressions.0.callee\",\n \"body.0.body.body.7.declarations.0.init.alternate.expressions.0.callee\",\n \"body.0.body.body.8.body.body.0.argument.expressions.0.alternate.expressions.1.callee\",\n \"body.0.body.body.9.argument.expressions.1.callee\",\n \"body.0.body.body.9.argument.expressions.2.callee\",\n \"body.0.body.body.9.argument.expressions.4.callee\",\n \"body.0.body.body.9.argument.expressions.5.callee\",\n \"body.0.body.body.9.argument.expressions.6.callee\",\n \"body.0.body.body.9.argument.expressions.7.callee\",\n \"body.0.body.body.9.argument.expressions.8.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 130, gzip size: 118\n regeneratorAsync: helper(\n \"7.27.0\",\n \"function _regeneratorAsync(n,e,r,t,o){var a=asyncGen(n,e,r,t,o);return a.next().then(function(n){return n.done?n.value:a.next()})}\",\n {\n globals: [],\n locals: { _regeneratorAsync: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_regeneratorAsync\",\n dependencies: {\n regeneratorAsyncGen: [\"body.0.body.body.0.declarations.0.init.callee\"],\n },\n internal: false,\n },\n ),\n // size: 114, gzip size: 101\n regeneratorAsyncGen: helper(\n \"7.27.0\",\n \"function _regeneratorAsyncGen(r,e,t,o,n){return new regeneratorAsyncIterator(regenerator().w(r,e,t,o),n||Promise)}\",\n {\n globals: [\"Promise\"],\n locals: { _regeneratorAsyncGen: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_regeneratorAsyncGen\",\n dependencies: {\n regenerator: [\n \"body.0.body.body.0.argument.arguments.0.callee.object.callee\",\n ],\n regeneratorAsyncIterator: [\"body.0.body.body.0.argument.callee\"],\n },\n internal: false,\n },\n ),\n // size: 585, gzip size: 303\n regeneratorAsyncIterator: helper(\n \"7.27.0\",\n 'function AsyncIterator(t,e){function n(r,o,i,f){try{var c=t[r](o),u=c.value;return u instanceof OverloadYield?e.resolve(u.v).then(function(t){n(\"next\",t,i,f)},function(t){n(\"throw\",t,i,f)}):e.resolve(u).then(function(t){c.value=t,i(c)},function(t){return n(\"throw\",t,i,f)})}catch(t){f(t)}}var r;this.next||(define(AsyncIterator.prototype),define(AsyncIterator.prototype,\"function\"==typeof Symbol&&Symbol.asyncIterator||\"@asyncIterator\",function(){return this})),define(this,\"_invoke\",function(t,o,i){function f(){return new e(function(e,r){n(t,i,e,r)})}return r=r?r.then(f,f):f()},!0)}',\n {\n globals: [\"Symbol\"],\n locals: {\n AsyncIterator: [\n \"body.0.id\",\n \"body.0.body.body.2.expression.expressions.0.right.expressions.0.arguments.0.object\",\n \"body.0.body.body.2.expression.expressions.0.right.expressions.1.arguments.0.object\",\n ],\n },\n exportBindingAssignments: [],\n exportName: \"AsyncIterator\",\n dependencies: {\n OverloadYield: [\n \"body.0.body.body.0.body.body.0.block.body.1.argument.test.right\",\n ],\n regeneratorDefine: [\n \"body.0.body.body.2.expression.expressions.0.right.expressions.0.callee\",\n \"body.0.body.body.2.expression.expressions.0.right.expressions.1.callee\",\n \"body.0.body.body.2.expression.expressions.1.callee\",\n ],\n },\n internal: true,\n },\n ),\n // size: 347, gzip size: 221\n regeneratorDefine: helper(\n \"7.27.0\",\n 'function regeneratorDefine(e,r,n,t){var i=Object.defineProperty;try{i({},\"\",{})}catch(e){i=0}regeneratorDefine=function(e,r,n,t){function o(r,n){regeneratorDefine(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o(\"next\",0),o(\"throw\",1),o(\"return\",2))},regeneratorDefine(e,r,n,t)}',\n {\n globals: [\"Object\"],\n locals: {\n regeneratorDefine: [\n \"body.0.id\",\n \"body.0.body.body.2.expression.expressions.0.right.body.body.0.body.body.0.expression.callee\",\n \"body.0.body.body.2.expression.expressions.1.callee\",\n \"body.0.body.body.2.expression.expressions.0.left\",\n ],\n },\n exportBindingAssignments: [\"body.0.body.body.2.expression.expressions.0\"],\n exportName: \"regeneratorDefine\",\n dependencies: {},\n internal: true,\n },\n ),\n // size: 181, gzip size: 152\n regeneratorKeys: helper(\n \"7.27.0\",\n \"function _regeneratorKeys(e){var n=Object(e),r=[];for(var t in n)r.unshift(t);return function e(){for(;r.length;)if((t=r.pop())in n)return e.value=t,e.done=!1,e;return e.done=!0,e}}\",\n {\n globals: [\"Object\"],\n locals: { _regeneratorKeys: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_regeneratorKeys\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 327, gzip size: 234\n regeneratorValues: helper(\n \"7.18.0\",\n 'function _regeneratorValues(e){if(null!=e){var t=e[\"function\"==typeof Symbol&&Symbol.iterator||\"@@iterator\"],r=0;if(t)return t.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(typeof e+\" is not iterable\")}',\n {\n globals: [\"Symbol\", \"isNaN\", \"TypeError\"],\n locals: { _regeneratorValues: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_regeneratorValues\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 494, gzip size: 274\n set: helper(\n \"7.0.0-beta.0\",\n 'function set(e,r,t,o){return set=\"undefined\"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f)}else defineProperty(o,r,t);return!0},set(e,r,t,o)}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError(\"failed to set property\");return t}',\n {\n globals: [\"Reflect\", \"Object\", \"TypeError\"],\n locals: {\n set: [\n \"body.0.id\",\n \"body.0.body.body.0.argument.expressions.1.callee\",\n \"body.1.body.body.0.test.left.argument.callee\",\n \"body.0.body.body.0.argument.expressions.0.left\",\n ],\n _set: [\"body.1.id\"],\n },\n exportBindingAssignments: [],\n exportName: \"_set\",\n dependencies: {\n superPropBase: [\n \"body.0.body.body.0.argument.expressions.0.right.alternate.body.body.0.declarations.1.init.callee\",\n ],\n defineProperty: [\n \"body.0.body.body.0.argument.expressions.0.right.alternate.body.body.2.alternate.expression.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 178, gzip size: 166\n setFunctionName: helper(\n \"7.23.6\",\n 'function setFunctionName(e,t,n){\"symbol\"==typeof t&&(t=(t=t.description)?\"[\"+t+\"]\":\"\");try{Object.defineProperty(e,\"name\",{configurable:!0,value:n?n+\" \"+t:t})}catch(e){}return e}',\n {\n globals: [\"Object\"],\n locals: { setFunctionName: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"setFunctionName\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 163, gzip size: 102\n setPrototypeOf: helper(\n \"7.0.0-beta.0\",\n \"function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}\",\n {\n globals: [\"Object\"],\n locals: {\n _setPrototypeOf: [\n \"body.0.id\",\n \"body.0.body.body.0.argument.expressions.1.callee\",\n \"body.0.body.body.0.argument.expressions.0.left\",\n ],\n },\n exportBindingAssignments: [\"body.0.body.body.0.argument.expressions.0\"],\n exportName: \"_setPrototypeOf\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 103, gzip size: 107\n skipFirstGeneratorNext: helper(\n \"7.0.0-beta.0\",\n \"function _skipFirstGeneratorNext(t){return function(){var r=t.apply(this,arguments);return r.next(),r}}\",\n {\n globals: [],\n locals: { _skipFirstGeneratorNext: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_skipFirstGeneratorNext\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 133, gzip size: 117\n slicedToArray: helper(\n \"7.0.0-beta.0\",\n \"function _slicedToArray(r,e){return arrayWithHoles(r)||iterableToArrayLimit(r,e)||unsupportedIterableToArray(r,e)||nonIterableRest()}\",\n {\n globals: [],\n locals: { _slicedToArray: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_slicedToArray\",\n dependencies: {\n arrayWithHoles: [\"body.0.body.body.0.argument.left.left.left.callee\"],\n iterableToArrayLimit: [\n \"body.0.body.body.0.argument.left.left.right.callee\",\n ],\n unsupportedIterableToArray: [\n \"body.0.body.body.0.argument.left.right.callee\",\n ],\n nonIterableRest: [\"body.0.body.body.0.argument.right.callee\"],\n },\n internal: false,\n },\n ),\n // size: 104, gzip size: 113\n superPropBase: helper(\n \"7.0.0-beta.0\",\n \"function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=getPrototypeOf(t)););return t}\",\n {\n globals: [],\n locals: { _superPropBase: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_superPropBase\",\n dependencies: {\n getPrototypeOf: [\"body.0.body.body.0.test.right.right.right.callee\"],\n },\n internal: false,\n },\n ),\n // size: 149, gzip size: 134\n superPropGet: helper(\n \"7.25.0\",\n 'function _superPropGet(t,o,e,r){var p=get(getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&\"function\"==typeof p?function(t){return p.apply(e,t)}:p}',\n {\n globals: [],\n locals: { _superPropGet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_superPropGet\",\n dependencies: {\n get: [\"body.0.body.body.0.declarations.0.init.callee\"],\n getPrototypeOf: [\n \"body.0.body.body.0.declarations.0.init.arguments.0.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 88, gzip size: 95\n superPropSet: helper(\n \"7.25.0\",\n \"function _superPropSet(t,e,o,r,p,f){return set(getPrototypeOf(f?t.prototype:t),e,o,r,p)}\",\n {\n globals: [],\n locals: { _superPropSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_superPropSet\",\n dependencies: {\n set: [\"body.0.body.body.0.argument.callee\"],\n getPrototypeOf: [\"body.0.body.body.0.argument.arguments.0.callee\"],\n },\n internal: false,\n },\n ),\n // size: 135, gzip size: 128\n taggedTemplateLiteral: helper(\n \"7.0.0-beta.0\",\n \"function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}\",\n {\n globals: [\"Object\"],\n locals: { _taggedTemplateLiteral: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_taggedTemplateLiteral\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 77, gzip size: 94\n taggedTemplateLiteralLoose: helper(\n \"7.0.0-beta.0\",\n \"function _taggedTemplateLiteralLoose(e,t){return t||(t=e.slice(0)),e.raw=t,e}\",\n {\n globals: [],\n locals: { _taggedTemplateLiteralLoose: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_taggedTemplateLiteralLoose\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 89, gzip size: 97\n tdz: helper(\n \"7.5.5\",\n 'function _tdzError(e){throw new ReferenceError(e+\" is not defined - temporal dead zone\")}',\n {\n globals: [\"ReferenceError\"],\n locals: { _tdzError: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_tdzError\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 53, gzip size: 73\n temporalRef: helper(\n \"7.0.0-beta.0\",\n \"function _temporalRef(r,e){return r===undef?err(e):r}\",\n {\n globals: [],\n locals: { _temporalRef: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_temporalRef\",\n dependencies: {\n temporalUndefined: [\"body.0.body.body.0.argument.test.right\"],\n tdz: [\"body.0.body.body.0.argument.consequent.callee\"],\n },\n internal: false,\n },\n ),\n // size: 31, gzip size: 51\n temporalUndefined: helper(\"7.0.0-beta.0\", \"function _temporalUndefined(){}\", {\n globals: [],\n locals: { _temporalUndefined: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_temporalUndefined\",\n dependencies: {},\n internal: false,\n }),\n // size: 116, gzip size: 102\n toArray: helper(\n \"7.0.0-beta.0\",\n \"function _toArray(r){return arrayWithHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableRest()}\",\n {\n globals: [],\n locals: { _toArray: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_toArray\",\n dependencies: {\n arrayWithHoles: [\"body.0.body.body.0.argument.left.left.left.callee\"],\n iterableToArray: [\"body.0.body.body.0.argument.left.left.right.callee\"],\n unsupportedIterableToArray: [\n \"body.0.body.body.0.argument.left.right.callee\",\n ],\n nonIterableRest: [\"body.0.body.body.0.argument.right.callee\"],\n },\n internal: false,\n },\n ),\n // size: 131, gzip size: 114\n toConsumableArray: helper(\n \"7.0.0-beta.0\",\n \"function _toConsumableArray(r){return arrayWithoutHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableSpread()}\",\n {\n globals: [],\n locals: { _toConsumableArray: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_toConsumableArray\",\n dependencies: {\n arrayWithoutHoles: [\n \"body.0.body.body.0.argument.left.left.left.callee\",\n ],\n iterableToArray: [\"body.0.body.body.0.argument.left.left.right.callee\"],\n unsupportedIterableToArray: [\n \"body.0.body.body.0.argument.left.right.callee\",\n ],\n nonIterableSpread: [\"body.0.body.body.0.argument.right.callee\"],\n },\n internal: false,\n },\n ),\n // size: 270, gzip size: 201\n toPrimitive: helper(\n \"7.1.5\",\n 'function toPrimitive(t,r){if(\"object\"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||\"default\");if(\"object\"!=typeof i)return i;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}return(\"string\"===r?String:Number)(t)}',\n {\n globals: [\"Symbol\", \"TypeError\", \"String\", \"Number\"],\n locals: { toPrimitive: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"toPrimitive\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 88, gzip size: 102\n toPropertyKey: helper(\n \"7.1.5\",\n 'function toPropertyKey(t){var i=toPrimitive(t,\"string\");return\"symbol\"==typeof i?i:i+\"\"}',\n {\n globals: [],\n locals: { toPropertyKey: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"toPropertyKey\",\n dependencies: {\n toPrimitive: [\"body.0.body.body.0.declarations.0.init.callee\"],\n },\n internal: false,\n },\n ),\n // size: 129, gzip size: 133\n toSetter: helper(\n \"7.24.0\",\n 'function _toSetter(t,e,n){e||(e=[]);var r=e.length++;return Object.defineProperty({},\"_\",{set:function(o){e[r]=o,t.apply(n,e)}})}',\n {\n globals: [\"Object\"],\n locals: { _toSetter: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_toSetter\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 241, gzip size: 209\n tsRewriteRelativeImportExtensions: helper(\n \"7.27.0\",\n 'function tsRewriteRelativeImportExtensions(t,e){return\"string\"==typeof t&&/^\\\\.\\\\.?\\\\//.test(t)?t.replace(/\\\\.(tsx)$|((?:\\\\.d)?)((?:\\\\.[^./]+)?)\\\\.([cm]?)ts$/i,function(t,s,r,n,o){return s?e?\".jsx\":\".js\":!r||n&&o?r+n+\".\"+o.toLowerCase()+\"js\":t}):t}',\n {\n globals: [],\n locals: { tsRewriteRelativeImportExtensions: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"tsRewriteRelativeImportExtensions\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 274, gzip size: 157\n typeof: helper(\n \"7.0.0-beta.0\",\n 'function _typeof(o){\"@babel/helpers - typeof\";return _typeof=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&\"function\"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?\"symbol\":typeof o},_typeof(o)}',\n {\n globals: [\"Symbol\"],\n locals: {\n _typeof: [\n \"body.0.id\",\n \"body.0.body.body.0.argument.expressions.1.callee\",\n \"body.0.body.body.0.argument.expressions.0.left\",\n ],\n },\n exportBindingAssignments: [\"body.0.body.body.0.argument.expressions.0\"],\n exportName: \"_typeof\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 328, gzip size: 247\n unsupportedIterableToArray: helper(\n \"7.9.0\",\n 'function _unsupportedIterableToArray(r,a){if(r){if(\"string\"==typeof r)return arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return\"Object\"===t&&r.constructor&&(t=r.constructor.name),\"Map\"===t||\"Set\"===t?Array.from(r):\"Arguments\"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?arrayLikeToArray(r,a):void 0}}',\n {\n globals: [\"Array\"],\n locals: { _unsupportedIterableToArray: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_unsupportedIterableToArray\",\n dependencies: {\n arrayLikeToArray: [\n \"body.0.body.body.0.consequent.body.0.consequent.argument.callee\",\n \"body.0.body.body.0.consequent.body.2.argument.expressions.1.alternate.consequent.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 1117, gzip size: 548\n usingCtx: helper(\n \"7.23.9\",\n 'function _usingCtx(){var r=\"function\"==typeof SuppressedError?SuppressedError:function(r,e){var n=Error();return n.name=\"SuppressedError\",n.error=r,n.suppressed=e,n},e={},n=[];function using(r,e){if(null!=e){if(Object(e)!==e)throw new TypeError(\"using declarations can only be used with objects, functions, null, or undefined.\");if(r)var o=e[Symbol.asyncDispose||Symbol.for(\"Symbol.asyncDispose\")];if(void 0===o&&(o=e[Symbol.dispose||Symbol.for(\"Symbol.dispose\")],r))var t=o;if(\"function\"!=typeof o)throw new TypeError(\"Object is not disposable.\");t&&(o=function(){try{t.call(e)}catch(r){return Promise.reject(r)}}),n.push({v:e,d:o,a:r})}else r&&n.push({d:e,a:r});return e}return{e:e,u:using.bind(null,!1),a:using.bind(null,!0),d:function(){var o,t=this.e,s=0;function next(){for(;o=n.pop();)try{if(!o.a&&1===s)return s=0,n.push(o),Promise.resolve().then(next);if(o.d){var r=o.d.call(o.v);if(o.a)return s|=2,Promise.resolve(r).then(next,err)}else s|=1}catch(r){return err(r)}if(1===s)return t!==e?Promise.reject(t):Promise.resolve();if(t!==e)throw t}function err(n){return t=t!==e?new r(n,t):n,next()}return next()}}}',\n {\n globals: [\n \"SuppressedError\",\n \"Error\",\n \"Object\",\n \"TypeError\",\n \"Symbol\",\n \"Promise\",\n ],\n locals: { _usingCtx: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_usingCtx\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 1166, gzip size: 524\n wrapAsyncGenerator: helper(\n \"7.0.0-beta.0\",\n 'function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments))}}function AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then(function(t){if(u){var i=\"return\"===r?\"return\":\"next\";if(!o.k||t.done)return resume(i,t);t=e[i](t).value}settle(n.done?\"return\":\"normal\",t)},function(e){resume(\"throw\",e)})}catch(e){settle(\"throw\",e)}}function settle(e,n){switch(e){case\"return\":r.resolve({value:n,done:!0});break;case\"throw\":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function(e,n){return new Promise(function(o,u){var i={key:e,arg:n,resolve:o,reject:u,next:null};t?t=t.next=i:(r=t=i,resume(e,n))})},\"function\"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype[\"function\"==typeof Symbol&&Symbol.asyncIterator||\"@@asyncIterator\"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke(\"next\",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke(\"throw\",e)},AsyncGenerator.prototype.return=function(e){return this._invoke(\"return\",e)};',\n {\n globals: [\"Promise\", \"Symbol\"],\n locals: {\n _wrapAsyncGenerator: [\"body.0.id\"],\n AsyncGenerator: [\n \"body.1.id\",\n \"body.0.body.body.0.argument.body.body.0.argument.callee\",\n \"body.2.expression.expressions.0.left.object.object\",\n \"body.2.expression.expressions.1.left.object.object\",\n \"body.2.expression.expressions.2.left.object.object\",\n \"body.2.expression.expressions.3.left.object.object\",\n ],\n },\n exportBindingAssignments: [],\n exportName: \"_wrapAsyncGenerator\",\n dependencies: {\n OverloadYield: [\n \"body.1.body.body.1.body.body.0.block.body.0.declarations.2.init.right\",\n ],\n },\n internal: false,\n },\n ),\n // size: 563, gzip size: 318\n wrapNativeSuper: helper(\n \"7.0.0-beta.0\",\n 'function _wrapNativeSuper(t){var r=\"function\"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(t){if(null===t||!isNativeFunction(t))return t;if(\"function\"!=typeof t)throw new TypeError(\"Super expression must either be null or a function\");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return construct(t,arguments,getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}',\n {\n globals: [\"Map\", \"TypeError\", \"Object\"],\n locals: {\n _wrapNativeSuper: [\n \"body.0.id\",\n \"body.0.body.body.1.argument.expressions.1.callee\",\n \"body.0.body.body.1.argument.expressions.0.left\",\n ],\n },\n exportBindingAssignments: [\"body.0.body.body.1.argument.expressions.0\"],\n exportName: \"_wrapNativeSuper\",\n dependencies: {\n getPrototypeOf: [\n \"body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.arguments.2.object.callee\",\n ],\n setPrototypeOf: [\n \"body.0.body.body.1.argument.expressions.0.right.body.body.4.argument.expressions.1.callee\",\n ],\n isNativeFunction: [\n \"body.0.body.body.1.argument.expressions.0.right.body.body.0.test.right.argument.callee\",\n ],\n construct: [\n \"body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 1207, gzip size: 556\n wrapRegExp: helper(\n \"7.19.0\",\n 'function _wrapRegExp(){_wrapRegExp=function(e,r){return new BabelRegExp(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function BabelRegExp(e,t,p){var o=RegExp(e,t);return r.set(o,p||r.get(e)),setPrototypeOf(o,BabelRegExp.prototype)}function buildGroups(e,t){var p=r.get(t);return Object.keys(p).reduce(function(r,t){var o=p[t];if(\"number\"==typeof o)r[t]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1]+)(>|$)/g,function(e,r,t){if(\"\"===t)return e;var p=o[r];return Array.isArray(p)?\"$\"+p.join(\"$\"):\"number\"==typeof p?\"$\"+p:\"\"}))}if(\"function\"==typeof p){var i=this;return e[Symbol.replace].call(this,t,function(){var e=arguments;return\"object\"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(buildGroups(e,i)),p.apply(this,e)})}return e[Symbol.replace].call(this,t,p)},_wrapRegExp.apply(this,arguments)}',\n {\n globals: [\"RegExp\", \"WeakMap\", \"Object\", \"Symbol\", \"Array\"],\n locals: {\n _wrapRegExp: [\n \"body.0.id\",\n \"body.0.body.body.4.argument.expressions.3.callee.object\",\n \"body.0.body.body.0.expression.left\",\n ],\n },\n exportBindingAssignments: [\"body.0.body.body.0.expression\"],\n exportName: \"_wrapRegExp\",\n dependencies: {\n setPrototypeOf: [\n \"body.0.body.body.2.body.body.1.argument.expressions.1.callee\",\n ],\n inherits: [\"body.0.body.body.4.argument.expressions.0.callee\"],\n },\n internal: false,\n },\n ),\n // size: 73, gzip size: 86\n writeOnlyError: helper(\n \"7.12.13\",\n \"function _writeOnlyError(r){throw new TypeError('\\\"'+r+'\\\" is write-only')}\",\n {\n globals: [\"TypeError\"],\n locals: { _writeOnlyError: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_writeOnlyError\",\n dependencies: {},\n internal: false,\n },\n ),\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n Object.assign(helpers, {\n // size: 39, gzip size: 59\n AwaitValue: helper(\n \"7.0.0-beta.0\",\n \"function _AwaitValue(t){this.wrapped=t}\",\n {\n globals: [],\n locals: { _AwaitValue: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_AwaitValue\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 5757, gzip size: 2178\n applyDecs: helper(\n \"7.17.8\",\n 'function old_createMetadataMethodsForProperty(e,t,a,r){return{getMetadata:function(o){old_assertNotFinished(r,\"getMetadata\"),old_assertMetadataKey(o);var i=e[o];if(void 0!==i)if(1===t){var n=i.public;if(void 0!==n)return n[a]}else if(2===t){var l=i.private;if(void 0!==l)return l.get(a)}else if(Object.hasOwnProperty.call(i,\"constructor\"))return i.constructor},setMetadata:function(o,i){old_assertNotFinished(r,\"setMetadata\"),old_assertMetadataKey(o);var n=e[o];if(void 0===n&&(n=e[o]={}),1===t){var l=n.public;void 0===l&&(l=n.public={}),l[a]=i}else if(2===t){var s=n.priv;void 0===s&&(s=n.private=new Map),s.set(a,i)}else n.constructor=i}}}function old_convertMetadataMapToFinal(e,t){var a=e[Symbol.metadata||Symbol.for(\"Symbol.metadata\")],r=Object.getOwnPropertySymbols(t);if(0!==r.length){for(var o=0;o=0;m--){var b;void 0!==(p=old_memberDec(h[m],r,c,l,s,o,i,n,f))&&(old_assertValidReturnValue(o,p),0===o?b=p:1===o?(b=old_getInit(p),v=p.get||f.get,y=p.set||f.set,f={get:v,set:y}):f=p,void 0!==b&&(void 0===d?d=b:\"function\"==typeof d?d=[d,b]:d.push(b)))}if(0===o||1===o){if(void 0===d)d=function(e,t){return t};else if(\"function\"!=typeof d){var g=d;d=function(e,t){for(var a=t,r=0;r3,m=v>=5;if(m?(u=t,f=r,0!=(v-=5)&&(p=n=n||[])):(u=t.prototype,f=a,0!==v&&(p=i=i||[])),0!==v&&!h){var b=m?s:l,g=b.get(y)||0;if(!0===g||3===g&&4!==v||4===g&&3!==v)throw Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+y);!g&&v>2?b.set(y,v):b.set(y,!0)}old_applyMemberDec(e,u,d,y,v,m,h,f,p)}}old_pushInitializers(e,i),old_pushInitializers(e,n)}function old_pushInitializers(e,t){t&&e.push(function(e){for(var a=0;a0){for(var o=[],i=t,n=t.name,l=r.length-1;l>=0;l--){var s={v:!1};try{var c=Object.assign({kind:\"class\",name:n,addInitializer:old_createAddInitializerMethod(o,s)},old_createMetadataMethodsForProperty(a,0,n,s)),d=r[l](i,c)}finally{s.v=!0}void 0!==d&&(old_assertValidReturnValue(10,d),i=d)}e.push(i,function(){for(var e=0;e=0;v--){var g;void 0!==(f=memberDec(h[v],a,c,o,n,i,s,u))&&(assertValidReturnValue(n,f),0===n?g=f:1===n?(g=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f,void 0!==g&&(void 0===l?l=g:\"function\"==typeof l?l=[l,g]:l.push(g)))}if(0===n||1===n){if(void 0===l)l=function(e,t){return t};else if(\"function\"!=typeof l){var y=l;l=function(e,t){for(var r=t,a=0;a3,h=f>=5;if(h?(l=t,0!=(f-=5)&&(u=n=n||[])):(l=t.prototype,0!==f&&(u=a=a||[])),0!==f&&!d){var v=h?s:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(e,l,c,p,f,h,d,u)}}pushInitializers(e,a),pushInitializers(e,n)}(a,e,t),function(e,t,r){if(r.length>0){for(var a=[],n=t,i=t.name,s=r.length-1;s>=0;s--){var o={v:!1};try{var c=r[s](n,{kind:\"class\",name:i,addInitializer:createAddInitializerMethod(a,o)})}finally{o.v=!0}void 0!==c&&(assertValidReturnValue(10,c),n=c)}e.push(n,function(){for(var e=0;e=0;g--){var y;void 0!==(p=memberDec(v[g],n,c,s,a,i,o,f))&&(assertValidReturnValue(a,p),0===a?y=p:1===a?(y=p.init,d=p.get||f.get,h=p.set||f.set,f={get:d,set:h}):f=p,void 0!==y&&(void 0===l?l=y:\"function\"==typeof l?l=[l,y]:l.push(y)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if(\"function\"!=typeof l){var m=l;l=function(e,t){for(var r=t,n=0;n3,h=f>=5;if(h?(l=e,0!=(f-=5)&&(u=n=n||[])):(l=e.prototype,0!==f&&(u=r=r||[])),0!==f&&!d){var v=h?o:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(a,l,c,p,f,h,d,u)}}return pushInitializers(a,r),pushInitializers(a,n),a}function pushInitializers(e,t){t&&e.push(function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var o={v:!1};try{var s=t[i](n,{kind:\"class\",name:a,addInitializer:createAddInitializerMethod(r,o)})}finally{o.v=!0}void 0!==s&&(assertValidReturnValue(10,s),n=s)}return[n,function(){for(var e=0;e=0;m--){var b;void 0!==(h=memberDec(g[m],n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?b=h:1===a?(b=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==b&&(void 0===l?l=b:\"function\"==typeof l?l=[l,b]:l.push(b)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if(\"function\"!=typeof l){var I=l;l=function(e,t){for(var r=t,n=0;n3,y=d>=5,g=r;if(y?(f=e,0!=(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),g=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=y?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)throw Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,y,v,p,g)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push(function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:\"class\",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e=0;j-=r?2:1){var D=v[j],E=r?v[j-1]:void 0,I={},O={kind:[\"field\",\"accessor\",\"method\",\"getter\",\"setter\",\"class\"][o],name:n,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(\"attempted to call addInitializer after decoration was finished\");s(t,\"An initializer\",\"be\",!0),c.push(t)}.bind(null,I)};try{if(b)(y=s(D.call(E,P,O),\"class decorators\",\"return\"))&&(P=y);else{var k,F;O.static=l,O.private=f,f?2===o?k=function(e){return m(e),w.value}:(o<4&&(k=i(w,\"get\",m)),3!==o&&(F=i(w,\"set\",m))):(k=function(e){return e[n]},(o<2||4===o)&&(F=function(e,t){e[n]=t}));var N=O.access={has:f?h.bind():function(e){return n in e}};if(k&&(N.get=k),F&&(N.set=F),P=D.call(E,d?{get:w.get,set:w.set}:w[A],O),d){if(\"object\"==typeof P&&P)(y=s(P.get,\"accessor.get\"))&&(w.get=y),(y=s(P.set,\"accessor.set\"))&&(w.set=y),(y=s(P.init,\"accessor.init\"))&&S.push(y);else if(void 0!==P)throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or void 0\")}else s(P,(p?\"field\":\"method\")+\" decorators\",\"return\")&&(p?S.push(P):w[A]=P)}}finally{I.v=!0}}return(p||d)&&u.push(function(e,t){for(var r=S.length-1;r>=0;r--)t=S[r].call(e,t);return t}),p||b||(f?d?u.push(i(w,\"get\"),i(w,\"set\")):u.push(2===o?w[A]:i.call.bind(w[A])):Object.defineProperty(e,n,w)),P}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(\"Symbol.metadata\"),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var l=a[Symbol.metadata||Symbol.for(\"Symbol.metadata\")];var f=Object.create(null==l?null:l),p=function(e,t,r,n){var o,a,i=[],s=function(t){return checkInRHS(t)===e},u=new Map;function l(e){e&&i.push(c.bind(null,e))}for(var f=0;f3,y=16&d,v=!!(8&d),g=0==(d&=7),b=h+\"/\"+v;if(!g&&!m){var w=u.get(b);if(!0===w||3===w&&4!==d||4===w&&3!==d)throw Error(\"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \"+h);u.set(b,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?\"#\"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,g,1===d,v&&m?s:r)}}return l(o),l(a),i}(e,t,o,f);return r.length||u(e,f),{e:p,get c(){var t=[];return r.length&&[u(applyDec(e,[r],n,e.name,5,f,t),f),c.bind(null,t,e)]}}}',\n {\n globals: [\"TypeError\", \"Array\", \"Object\", \"Error\", \"Symbol\", \"Map\"],\n locals: { applyDecs2305: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"applyDecs2305\",\n dependencies: {\n checkInRHS: [\n \"body.0.body.body.6.declarations.1.init.callee.body.body.0.declarations.3.init.body.body.0.argument.left.callee\",\n ],\n setFunctionName: [\n \"body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.0.consequent.right.properties.0.value.callee\",\n \"body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.1.right.callee\",\n ],\n toPropertyKey: [\n \"body.0.body.body.6.declarations.1.init.callee.body.body.2.body.body.1.consequent.body.2.expression.arguments.3.alternate.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 231, gzip size: 189\n classApplyDescriptorDestructureSet: helper(\n \"7.13.10\",\n 'function _classApplyDescriptorDestructureSet(e,t){if(t.set)return\"__destrObj\"in t||(t.__destrObj={set value(r){t.set.call(e,r)}}),t.__destrObj;if(!t.writable)throw new TypeError(\"attempted to set read only private field\");return t}',\n {\n globals: [\"TypeError\"],\n locals: { _classApplyDescriptorDestructureSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classApplyDescriptorDestructureSet\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 74, gzip size: 90\n classApplyDescriptorGet: helper(\n \"7.13.10\",\n \"function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}\",\n {\n globals: [],\n locals: { _classApplyDescriptorGet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classApplyDescriptorGet\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 161, gzip size: 149\n classApplyDescriptorSet: helper(\n \"7.13.10\",\n 'function _classApplyDescriptorSet(e,t,l){if(t.set)t.set.call(e,l);else{if(!t.writable)throw new TypeError(\"attempted to set read only private field\");t.value=l}}',\n {\n globals: [\"TypeError\"],\n locals: { _classApplyDescriptorSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classApplyDescriptorSet\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 78, gzip size: 93\n classCheckPrivateStaticAccess: helper(\n \"7.13.10\",\n \"function _classCheckPrivateStaticAccess(s,a,r){return assertClassBrand(a,s,r)}\",\n {\n globals: [],\n locals: { _classCheckPrivateStaticAccess: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classCheckPrivateStaticAccess\",\n dependencies: {\n assertClassBrand: [\"body.0.body.body.0.argument.callee\"],\n },\n internal: false,\n },\n ),\n // size: 154, gzip size: 145\n classCheckPrivateStaticFieldDescriptor: helper(\n \"7.13.10\",\n 'function _classCheckPrivateStaticFieldDescriptor(t,e){if(void 0===t)throw new TypeError(\"attempted to \"+e+\" private static field before its declaration\")}',\n {\n globals: [\"TypeError\"],\n locals: { _classCheckPrivateStaticFieldDescriptor: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classCheckPrivateStaticFieldDescriptor\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 77, gzip size: 91\n classExtractFieldDescriptor: helper(\n \"7.13.10\",\n \"function _classExtractFieldDescriptor(e,t){return classPrivateFieldGet2(t,e)}\",\n {\n globals: [],\n locals: { _classExtractFieldDescriptor: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classExtractFieldDescriptor\",\n dependencies: {\n classPrivateFieldGet2: [\"body.0.body.body.0.argument.callee\"],\n },\n internal: false,\n },\n ),\n // size: 127, gzip size: 111\n classPrivateFieldDestructureSet: helper(\n \"7.4.4\",\n \"function _classPrivateFieldDestructureSet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorDestructureSet(e,r)}\",\n {\n globals: [],\n locals: { _classPrivateFieldDestructureSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classPrivateFieldDestructureSet\",\n dependencies: {\n classApplyDescriptorDestructureSet: [\n \"body.0.body.body.1.argument.callee\",\n ],\n classPrivateFieldGet2: [\n \"body.0.body.body.0.declarations.0.init.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 105, gzip size: 100\n classPrivateFieldGet: helper(\n \"7.0.0-beta.0\",\n \"function _classPrivateFieldGet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorGet(e,r)}\",\n {\n globals: [],\n locals: { _classPrivateFieldGet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classPrivateFieldGet\",\n dependencies: {\n classApplyDescriptorGet: [\"body.0.body.body.1.argument.callee\"],\n classPrivateFieldGet2: [\n \"body.0.body.body.0.declarations.0.init.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 111, gzip size: 109\n classPrivateFieldSet: helper(\n \"7.0.0-beta.0\",\n \"function _classPrivateFieldSet(e,t,r){var s=classPrivateFieldGet2(t,e);return classApplyDescriptorSet(e,s,r),r}\",\n {\n globals: [],\n locals: { _classPrivateFieldSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classPrivateFieldSet\",\n dependencies: {\n classApplyDescriptorSet: [\n \"body.0.body.body.1.argument.expressions.0.callee\",\n ],\n classPrivateFieldGet2: [\n \"body.0.body.body.0.declarations.0.init.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 70, gzip size: 88\n classPrivateMethodGet: helper(\n \"7.1.6\",\n \"function _classPrivateMethodGet(s,a,r){return assertClassBrand(a,s),r}\",\n {\n globals: [],\n locals: { _classPrivateMethodGet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classPrivateMethodGet\",\n dependencies: {\n assertClassBrand: [\n \"body.0.body.body.0.argument.expressions.0.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 94, gzip size: 102\n classPrivateMethodSet: helper(\n \"7.1.6\",\n 'function _classPrivateMethodSet(){throw new TypeError(\"attempted to reassign private method\")}',\n {\n globals: [\"TypeError\"],\n locals: { _classPrivateMethodSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classPrivateMethodSet\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 172, gzip size: 135\n classStaticPrivateFieldDestructureSet: helper(\n \"7.13.10\",\n 'function _classStaticPrivateFieldDestructureSet(t,r,s){return assertClassBrand(r,t),classCheckPrivateStaticFieldDescriptor(s,\"set\"),classApplyDescriptorDestructureSet(t,s)}',\n {\n globals: [],\n locals: { _classStaticPrivateFieldDestructureSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classStaticPrivateFieldDestructureSet\",\n dependencies: {\n classApplyDescriptorDestructureSet: [\n \"body.0.body.body.0.argument.expressions.2.callee\",\n ],\n assertClassBrand: [\n \"body.0.body.body.0.argument.expressions.0.callee\",\n ],\n classCheckPrivateStaticFieldDescriptor: [\n \"body.0.body.body.0.argument.expressions.1.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 154, gzip size: 133\n classStaticPrivateFieldSpecGet: helper(\n \"7.0.2\",\n 'function _classStaticPrivateFieldSpecGet(t,s,r){return assertClassBrand(s,t),classCheckPrivateStaticFieldDescriptor(r,\"get\"),classApplyDescriptorGet(t,r)}',\n {\n globals: [],\n locals: { _classStaticPrivateFieldSpecGet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classStaticPrivateFieldSpecGet\",\n dependencies: {\n classApplyDescriptorGet: [\n \"body.0.body.body.0.argument.expressions.2.callee\",\n ],\n assertClassBrand: [\n \"body.0.body.body.0.argument.expressions.0.callee\",\n ],\n classCheckPrivateStaticFieldDescriptor: [\n \"body.0.body.body.0.argument.expressions.1.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 160, gzip size: 134\n classStaticPrivateFieldSpecSet: helper(\n \"7.0.2\",\n 'function _classStaticPrivateFieldSpecSet(s,t,r,e){return assertClassBrand(t,s),classCheckPrivateStaticFieldDescriptor(r,\"set\"),classApplyDescriptorSet(s,r,e),e}',\n {\n globals: [],\n locals: { _classStaticPrivateFieldSpecSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classStaticPrivateFieldSpecSet\",\n dependencies: {\n classApplyDescriptorSet: [\n \"body.0.body.body.0.argument.expressions.2.callee\",\n ],\n assertClassBrand: [\n \"body.0.body.body.0.argument.expressions.0.callee\",\n ],\n classCheckPrivateStaticFieldDescriptor: [\n \"body.0.body.body.0.argument.expressions.1.callee\",\n ],\n },\n internal: false,\n },\n ),\n // size: 111, gzip size: 114\n classStaticPrivateMethodSet: helper(\n \"7.3.2\",\n 'function _classStaticPrivateMethodSet(){throw new TypeError(\"attempted to set read only static private field\")}',\n {\n globals: [\"TypeError\"],\n locals: { _classStaticPrivateMethodSet: [\"body.0.id\"] },\n exportBindingAssignments: [],\n exportName: \"_classStaticPrivateMethodSet\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 368, gzip size: 204\n defineEnumerableProperties: helper(\n \"7.0.0-beta.0\",\n 'function _defineEnumerableProperties(e,r){for(var t in r){var n=r[t];n.configurable=n.enumerable=!0,\"value\"in n&&(n.writable=!0),Object.defineProperty(e,t,n)}if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(r),b=0;b0;)try{var o=r.pop(),p=o.d.call(o.v);if(o.a)return Promise.resolve(p).then(next,err)}catch(r){return err(r)}if(s)throw e}function err(r){return e=s?new dispose_SuppressedError(e,r):r,s=!0,next()}return next()}',\n {\n globals: [\"SuppressedError\", \"Error\", \"Object\", \"Promise\"],\n locals: {\n dispose_SuppressedError: [\n \"body.0.id\",\n \"body.0.body.body.0.argument.expressions.0.alternate.expressions.1.left.object\",\n \"body.0.body.body.0.argument.expressions.0.alternate.expressions.1.right.arguments.1.properties.0.value.properties.0.value\",\n \"body.0.body.body.0.argument.expressions.1.callee\",\n \"body.1.body.body.1.body.body.0.argument.expressions.0.right.consequent.callee\",\n \"body.0.body.body.0.argument.expressions.0.consequent.left\",\n \"body.0.body.body.0.argument.expressions.0.alternate.expressions.0.left\",\n ],\n _dispose: [\"body.1.id\"],\n },\n exportBindingAssignments: [],\n exportName: \"_dispose\",\n dependencies: {},\n internal: false,\n },\n ),\n // size: 359, gzip size: 235\n objectSpread: helper(\n \"7.0.0-beta.0\",\n 'function _objectSpread(e){for(var r=1;r {\n constructor(value: T, /** 0: await 1: delegate */ kind: 0 | 1);\n\n v: T;\n k: Kind;\n}\n\n// The actual implementation of _OverloadYield starts here\nfunction _OverloadYield(this: _OverloadYield, value: T, kind: Kind) {\n this.v = value;\n this.k = kind;\n}\n\nexport { _OverloadYield as default };\n"],"mappings":";;;;;;AAkBA,SAASA,cAAcA,CAA6BC,KAAQ,EAAEC,IAAU,EAAE;EACxE,IAAI,CAACC,CAAC,GAAGF,KAAK;EACd,IAAI,CAACG,CAAC,GAAGF,IAAI;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecoratedDescriptor.js b/node_modules/@babel/helpers/lib/helpers/applyDecoratedDescriptor.js new file mode 100644 index 0000000..f6d5dd7 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecoratedDescriptor.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _applyDecoratedDescriptor; +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object.keys(descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + if ("value" in desc || desc.initializer) { + desc.writable = true; + } + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = void 0; + } + if (desc.initializer === void 0) { + Object.defineProperty(target, property, desc); + return null; + } + return desc; +} + +//# sourceMappingURL=applyDecoratedDescriptor.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecoratedDescriptor.js.map b/node_modules/@babel/helpers/lib/helpers/applyDecoratedDescriptor.js.map new file mode 100644 index 0000000..75c428e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecoratedDescriptor.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_applyDecoratedDescriptor","target","property","decorators","descriptor","context","desc","Object","keys","forEach","key","enumerable","configurable","initializer","writable","slice","reverse","reduce","decorator","value","call","defineProperty"],"sources":["../../src/helpers/applyDecoratedDescriptor.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\ninterface DescriptorWithInitializer extends PropertyDescriptor {\n initializer?: () => any;\n}\n\ndeclare const Object: Omit & {\n keys(o: T): Array;\n};\n\nexport default function _applyDecoratedDescriptor(\n target: T,\n property: PropertyKey,\n decorators: ((\n t: T,\n p: PropertyKey,\n desc: DescriptorWithInitializer,\n ) => any)[],\n descriptor: DescriptorWithInitializer,\n context: DecoratorContext,\n) {\n var desc: DescriptorWithInitializer = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if (\"value\" in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators\n .slice()\n .reverse()\n .reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = void 0;\n }\n\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n return null;\n }\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line at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs.js b/node_modules/@babel/helpers/lib/helpers/applyDecs.js new file mode 100644 index 0000000..3bb23ec --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs.js @@ -0,0 +1,459 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = applyDecs; +var _setFunctionName = require("setFunctionName"); +var _toPropertyKey = require("toPropertyKey"); +function old_createMetadataMethodsForProperty(metadataMap, kind, property, decoratorFinishedRef) { + return { + getMetadata: function (key) { + old_assertNotFinished(decoratorFinishedRef, "getMetadata"); + old_assertMetadataKey(key); + var metadataForKey = metadataMap[key]; + if (metadataForKey === void 0) return void 0; + if (kind === 1) { + var pub = metadataForKey.public; + if (pub !== void 0) { + return pub[property]; + } + } else if (kind === 2) { + var priv = metadataForKey.private; + if (priv !== void 0) { + return priv.get(property); + } + } else if (Object.hasOwnProperty.call(metadataForKey, "constructor")) { + return metadataForKey.constructor; + } + }, + setMetadata: function (key, value) { + old_assertNotFinished(decoratorFinishedRef, "setMetadata"); + old_assertMetadataKey(key); + var metadataForKey = metadataMap[key]; + if (metadataForKey === void 0) { + metadataForKey = metadataMap[key] = {}; + } + if (kind === 1) { + var pub = metadataForKey.public; + if (pub === void 0) { + pub = metadataForKey.public = {}; + } + pub[property] = value; + } else if (kind === 2) { + var priv = metadataForKey.priv; + if (priv === void 0) { + priv = metadataForKey.private = new Map(); + } + priv.set(property, value); + } else { + metadataForKey.constructor = value; + } + } + }; +} +function old_convertMetadataMapToFinal(obj, metadataMap) { + var parentMetadataMap = obj[Symbol.metadata || Symbol.for("Symbol.metadata")]; + var metadataKeys = Object.getOwnPropertySymbols(metadataMap); + if (metadataKeys.length === 0) return; + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i]; + var metaForKey = metadataMap[key]; + var parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null; + var pub = metaForKey.public; + var parentPub = parentMetaForKey ? parentMetaForKey.public : null; + if (pub && parentPub) { + Object.setPrototypeOf(pub, parentPub); + } + var priv = metaForKey.private; + if (priv) { + var privArr = Array.from(priv.values()); + var parentPriv = parentMetaForKey ? parentMetaForKey.private : null; + if (parentPriv) { + privArr = privArr.concat(parentPriv); + } + metaForKey.private = privArr; + } + if (parentMetaForKey) { + Object.setPrototypeOf(metaForKey, parentMetaForKey); + } + } + if (parentMetadataMap) { + Object.setPrototypeOf(metadataMap, parentMetadataMap); + } + obj[Symbol.metadata || Symbol.for("Symbol.metadata")] = metadataMap; +} +function old_createAddInitializerMethod(initializers, decoratorFinishedRef) { + return function addInitializer(initializer) { + old_assertNotFinished(decoratorFinishedRef, "addInitializer"); + old_assertCallable(initializer, "An initializer"); + initializers.push(initializer); + }; +} +function old_memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value) { + var kindStr; + switch (kind) { + case 1: + kindStr = "accessor"; + break; + case 2: + kindStr = "method"; + break; + case 3: + kindStr = "getter"; + break; + case 4: + kindStr = "setter"; + break; + default: + kindStr = "field"; + } + var ctx = { + kind: kindStr, + name: isPrivate ? "#" + name : _toPropertyKey(name), + isStatic: isStatic, + isPrivate: isPrivate + }; + var decoratorFinishedRef = { + v: false + }; + if (kind !== 0) { + ctx.addInitializer = old_createAddInitializerMethod(initializers, decoratorFinishedRef); + } + var metadataKind, metadataName; + if (isPrivate) { + metadataKind = 2; + metadataName = Symbol(name); + var access = {}; + if (kind === 0) { + access.get = desc.get; + access.set = desc.set; + } else if (kind === 2) { + access.get = function () { + return desc.value; + }; + } else { + if (kind === 1 || kind === 3) { + access.get = function () { + return desc.get.call(this); + }; + } + if (kind === 1 || kind === 4) { + access.set = function (v) { + desc.set.call(this, v); + }; + } + } + ctx.access = access; + } else { + metadataKind = 1; + metadataName = name; + } + try { + return dec(value, Object.assign(ctx, old_createMetadataMethodsForProperty(metadataMap, metadataKind, metadataName, decoratorFinishedRef))); + } finally { + decoratorFinishedRef.v = true; + } +} +function old_assertNotFinished(decoratorFinishedRef, fnName) { + if (decoratorFinishedRef.v) { + throw new Error("attempted to call " + fnName + " after decoration was finished"); + } +} +function old_assertMetadataKey(key) { + if (typeof key !== "symbol") { + throw new TypeError("Metadata keys must be symbols, received: " + key); + } +} +function old_assertCallable(fn, hint) { + if (typeof fn !== "function") { + throw new TypeError(hint + " must be a function"); + } +} +function old_assertValidReturnValue(kind, value) { + var type = typeof value; + if (kind === 1) { + if (type !== "object" || value === null) { + throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + } + if (value.get !== undefined) { + old_assertCallable(value.get, "accessor.get"); + } + if (value.set !== undefined) { + old_assertCallable(value.set, "accessor.set"); + } + if (value.init !== undefined) { + old_assertCallable(value.init, "accessor.init"); + } + if (value.initializer !== undefined) { + old_assertCallable(value.initializer, "accessor.initializer"); + } + } else if (type !== "function") { + var hint; + if (kind === 0) { + hint = "field"; + } else if (kind === 10) { + hint = "class"; + } else { + hint = "method"; + } + throw new TypeError(hint + " decorators must return a function or void 0"); + } +} +function old_getInit(desc) { + var initializer; + if ((initializer = desc.init) == null && (initializer = desc.initializer) && typeof console !== "undefined") { + console.warn(".initializer has been renamed to .init as of March 2022"); + } + return initializer; +} +function old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers) { + var decs = decInfo[0]; + var desc, initializer, prefix, value; + if (isPrivate) { + if (kind === 0 || kind === 1) { + desc = { + get: decInfo[3], + set: decInfo[4] + }; + prefix = "get"; + } else if (kind === 3) { + desc = { + get: decInfo[3] + }; + prefix = "get"; + } else if (kind === 4) { + desc = { + set: decInfo[3] + }; + prefix = "set"; + } else { + desc = { + value: decInfo[3] + }; + } + if (kind !== 0) { + if (kind === 1) { + _setFunctionName(decInfo[4], "#" + name, "set"); + } + _setFunctionName(decInfo[3], "#" + name, prefix); + } + } else if (kind !== 0) { + desc = Object.getOwnPropertyDescriptor(base, name); + } + if (kind === 1) { + value = { + get: desc.get, + set: desc.set + }; + } else if (kind === 2) { + value = desc.value; + } else if (kind === 3) { + value = desc.get; + } else if (kind === 4) { + value = desc.set; + } + var newValue, get, set; + if (typeof decs === "function") { + newValue = old_memberDec(decs, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value); + if (newValue !== void 0) { + old_assertValidReturnValue(kind, newValue); + if (kind === 0) { + initializer = newValue; + } else if (kind === 1) { + initializer = old_getInit(newValue); + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + } + } else { + for (var i = decs.length - 1; i >= 0; i--) { + var dec = decs[i]; + newValue = old_memberDec(dec, name, desc, metadataMap, initializers, kind, isStatic, isPrivate, value); + if (newValue !== void 0) { + old_assertValidReturnValue(kind, newValue); + var newInit; + if (kind === 0) { + newInit = newValue; + } else if (kind === 1) { + newInit = old_getInit(newValue); + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + if (newInit !== void 0) { + if (initializer === void 0) { + initializer = newInit; + } else if (typeof initializer === "function") { + initializer = [initializer, newInit]; + } else { + initializer.push(newInit); + } + } + } + } + } + if (kind === 0 || kind === 1) { + if (initializer === void 0) { + initializer = function (instance, init) { + return init; + }; + } else if (typeof initializer !== "function") { + var ownInitializers = initializer; + initializer = function (instance, init) { + var value = init; + for (var i = 0; i < ownInitializers.length; i++) { + value = ownInitializers[i].call(instance, value); + } + return value; + }; + } else { + var originalInitializer = initializer; + initializer = function (instance, init) { + return originalInitializer.call(instance, init); + }; + } + ret.push(initializer); + } + if (kind !== 0) { + if (kind === 1) { + desc.get = value.get; + desc.set = value.set; + } else if (kind === 2) { + desc.value = value; + } else if (kind === 3) { + desc.get = value; + } else if (kind === 4) { + desc.set = value; + } + if (isPrivate) { + if (kind === 1) { + ret.push(function (instance, args) { + return value.get.call(instance, args); + }); + ret.push(function (instance, args) { + return value.set.call(instance, args); + }); + } else if (kind === 2) { + ret.push(value); + } else { + ret.push(function (instance, args) { + return value.call(instance, args); + }); + } + } else { + Object.defineProperty(base, name, desc); + } + } +} +function old_applyMemberDecs(ret, Class, protoMetadataMap, staticMetadataMap, decInfos) { + var protoInitializers; + var staticInitializers; + var existingProtoNonFields = new Map(); + var existingStaticNonFields = new Map(); + for (var i = 0; i < decInfos.length; i++) { + var decInfo = decInfos[i]; + if (!Array.isArray(decInfo)) continue; + var kind = decInfo[1]; + var name = decInfo[2]; + var isPrivate = decInfo.length > 3; + var isStatic = kind >= 5; + var base; + var metadataMap; + var initializers; + if (isStatic) { + base = Class; + metadataMap = staticMetadataMap; + kind = kind - 5; + if (kind !== 0) { + staticInitializers = staticInitializers || []; + initializers = staticInitializers; + } + } else { + base = Class.prototype; + metadataMap = protoMetadataMap; + if (kind !== 0) { + protoInitializers = protoInitializers || []; + initializers = protoInitializers; + } + } + if (kind !== 0 && !isPrivate) { + var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields; + var existingKind = existingNonFields.get(name) || 0; + if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) { + throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name); + } else if (!existingKind && kind > 2) { + existingNonFields.set(name, kind); + } else { + existingNonFields.set(name, true); + } + } + old_applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, metadataMap, initializers); + } + old_pushInitializers(ret, protoInitializers); + old_pushInitializers(ret, staticInitializers); +} +function old_pushInitializers(ret, initializers) { + if (initializers) { + ret.push(function (instance) { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(instance); + } + return instance; + }); + } +} +function old_applyClassDecs(ret, targetClass, metadataMap, classDecs) { + if (classDecs.length > 0) { + var initializers = []; + var newClass = targetClass; + var name = targetClass.name; + for (var i = classDecs.length - 1; i >= 0; i--) { + var decoratorFinishedRef = { + v: false + }; + try { + var ctx = Object.assign({ + kind: "class", + name: name, + addInitializer: old_createAddInitializerMethod(initializers, decoratorFinishedRef) + }, old_createMetadataMethodsForProperty(metadataMap, 0, name, decoratorFinishedRef)); + var nextNewClass = classDecs[i](newClass, ctx); + } finally { + decoratorFinishedRef.v = true; + } + if (nextNewClass !== undefined) { + old_assertValidReturnValue(10, nextNewClass); + newClass = nextNewClass; + } + } + ret.push(newClass, function () { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(newClass); + } + }); + } +} +function applyDecs(targetClass, memberDecs, classDecs) { + var ret = []; + var staticMetadataMap = {}; + var protoMetadataMap = {}; + old_applyMemberDecs(ret, targetClass, protoMetadataMap, staticMetadataMap, memberDecs); + old_convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap); + old_applyClassDecs(ret, targetClass, staticMetadataMap, classDecs); + old_convertMetadataMapToFinal(targetClass, staticMetadataMap); + return ret; +} + +//# sourceMappingURL=applyDecs.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs.js.map b/node_modules/@babel/helpers/lib/helpers/applyDecs.js.map new file mode 100644 index 0000000..00fb117 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_setFunctionName","require","_toPropertyKey","old_createMetadataMethodsForProperty","metadataMap","kind","property","decoratorFinishedRef","getMetadata","key","old_assertNotFinished","old_assertMetadataKey","metadataForKey","pub","public","priv","private","get","Object","hasOwnProperty","call","constructor","setMetadata","value","Map","set","old_convertMetadataMapToFinal","obj","parentMetadataMap","Symbol","metadata","for","metadataKeys","getOwnPropertySymbols","length","i","metaForKey","parentMetaForKey","parentPub","setPrototypeOf","privArr","Array","from","values","parentPriv","concat","old_createAddInitializerMethod","initializers","addInitializer","initializer","old_assertCallable","push","old_memberDec","dec","name","desc","isStatic","isPrivate","kindStr","ctx","toPropertyKey","v","metadataKind","metadataName","access","assign","fnName","Error","TypeError","fn","hint","old_assertValidReturnValue","type","undefined","init","old_getInit","console","warn","old_applyMemberDec","ret","base","decInfo","decs","prefix","setFunctionName","getOwnPropertyDescriptor","newValue","newInit","instance","ownInitializers","originalInitializer","args","defineProperty","old_applyMemberDecs","Class","protoMetadataMap","staticMetadataMap","decInfos","protoInitializers","staticInitializers","existingProtoNonFields","existingStaticNonFields","isArray","prototype","existingNonFields","existingKind","old_pushInitializers","old_applyClassDecs","targetClass","classDecs","newClass","nextNewClass","applyDecs","memberDecs"],"sources":["../../src/helpers/applyDecs.js"],"sourcesContent":["/* @minVersion 7.17.8 */\n/* @onlyBabel7 */\n\nimport setFunctionName from \"setFunctionName\";\nimport toPropertyKey from \"toPropertyKey\";\n/**\n * NOTE: This is an old version of the helper, used for 2021-12 decorators.\n * Updates should be done in applyDecs2203R.js.\n */\n\n/**\n Enums are used in this file, but not assigned to vars to avoid non-hoistable values\n\n CONSTRUCTOR = 0;\n PUBLIC = 1;\n PRIVATE = 2;\n\n FIELD = 0;\n ACCESSOR = 1;\n METHOD = 2;\n GETTER = 3;\n SETTER = 4;\n\n STATIC = 5;\n\n CLASS = 10; // only used in assertValidReturnValue\n*/\n\nfunction old_createMetadataMethodsForProperty(\n metadataMap,\n kind,\n property,\n decoratorFinishedRef,\n) {\n return {\n getMetadata: function (key) {\n old_assertNotFinished(decoratorFinishedRef, \"getMetadata\");\n old_assertMetadataKey(key);\n\n var metadataForKey = metadataMap[key];\n\n if (metadataForKey === void 0) return void 0;\n\n if (kind === 1 /* PUBLIC */) {\n var pub = metadataForKey.public;\n if (pub !== void 0) {\n return pub[property];\n }\n } else if (kind === 2 /* PRIVATE */) {\n var priv = metadataForKey.private;\n if (priv !== void 0) {\n return priv.get(property);\n }\n } else if (Object.hasOwnProperty.call(metadataForKey, \"constructor\")) {\n return metadataForKey.constructor;\n }\n },\n setMetadata: function (key, value) {\n old_assertNotFinished(decoratorFinishedRef, \"setMetadata\");\n old_assertMetadataKey(key);\n\n var metadataForKey = metadataMap[key];\n\n if (metadataForKey === void 0) {\n metadataForKey = metadataMap[key] = {};\n }\n\n if (kind === 1 /* PUBLIC */) {\n var pub = metadataForKey.public;\n\n if (pub === void 0) {\n pub = metadataForKey.public = {};\n }\n\n pub[property] = value;\n } else if (kind === 2 /* PRIVATE */) {\n var priv = metadataForKey.priv;\n\n if (priv === void 0) {\n priv = metadataForKey.private = new Map();\n }\n\n priv.set(property, value);\n } else {\n metadataForKey.constructor = value;\n }\n },\n };\n}\n\nfunction old_convertMetadataMapToFinal(obj, metadataMap) {\n var parentMetadataMap = obj[Symbol.metadata || Symbol.for(\"Symbol.metadata\")];\n var metadataKeys = Object.getOwnPropertySymbols(metadataMap);\n\n if (metadataKeys.length === 0) return;\n\n for (var i = 0; i < metadataKeys.length; i++) {\n var key = metadataKeys[i];\n var metaForKey = metadataMap[key];\n var parentMetaForKey = parentMetadataMap ? parentMetadataMap[key] : null;\n\n var pub = metaForKey.public;\n var parentPub = parentMetaForKey ? parentMetaForKey.public : null;\n\n if (pub && parentPub) {\n Object.setPrototypeOf(pub, parentPub);\n }\n\n var priv = metaForKey.private;\n\n if (priv) {\n var privArr = Array.from(priv.values());\n var parentPriv = parentMetaForKey ? parentMetaForKey.private : null;\n\n if (parentPriv) {\n privArr = privArr.concat(parentPriv);\n }\n\n metaForKey.private = privArr;\n }\n\n if (parentMetaForKey) {\n Object.setPrototypeOf(metaForKey, parentMetaForKey);\n }\n }\n\n if (parentMetadataMap) {\n Object.setPrototypeOf(metadataMap, parentMetadataMap);\n }\n\n obj[Symbol.metadata || Symbol.for(\"Symbol.metadata\")] = metadataMap;\n}\n\nfunction old_createAddInitializerMethod(initializers, decoratorFinishedRef) {\n return function addInitializer(initializer) {\n old_assertNotFinished(decoratorFinishedRef, \"addInitializer\");\n old_assertCallable(initializer, \"An initializer\");\n initializers.push(initializer);\n };\n}\n\nfunction old_memberDec(\n dec,\n name,\n desc,\n metadataMap,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n) {\n var kindStr;\n\n switch (kind) {\n case 1 /* ACCESSOR */:\n kindStr = \"accessor\";\n break;\n case 2 /* METHOD */:\n kindStr = \"method\";\n break;\n case 3 /* GETTER */:\n kindStr = \"getter\";\n break;\n case 4 /* SETTER */:\n kindStr = \"setter\";\n break;\n default:\n kindStr = \"field\";\n }\n\n var ctx = {\n kind: kindStr,\n name: isPrivate ? \"#\" + name : toPropertyKey(name),\n isStatic: isStatic,\n isPrivate: isPrivate,\n };\n\n var decoratorFinishedRef = { v: false };\n\n if (kind !== 0 /* FIELD */) {\n ctx.addInitializer = old_createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n );\n }\n\n var metadataKind, metadataName;\n\n if (isPrivate) {\n metadataKind = 2 /* PRIVATE */;\n metadataName = Symbol(name);\n\n var access = {};\n\n if (kind === 0 /* FIELD */) {\n access.get = desc.get;\n access.set = desc.set;\n } else if (kind === 2 /* METHOD */) {\n access.get = function () {\n return desc.value;\n };\n } else {\n // replace with values that will go through the final getter and setter\n if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {\n access.get = function () {\n return desc.get.call(this);\n };\n }\n\n if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {\n access.set = function (v) {\n desc.set.call(this, v);\n };\n }\n }\n\n ctx.access = access;\n } else {\n metadataKind = 1 /* PUBLIC */;\n metadataName = name;\n }\n\n try {\n return dec(\n value,\n Object.assign(\n ctx,\n old_createMetadataMethodsForProperty(\n metadataMap,\n metadataKind,\n metadataName,\n decoratorFinishedRef,\n ),\n ),\n );\n } finally {\n decoratorFinishedRef.v = true;\n }\n}\n\nfunction old_assertNotFinished(decoratorFinishedRef, fnName) {\n if (decoratorFinishedRef.v) {\n throw new Error(\n \"attempted to call \" + fnName + \" after decoration was finished\",\n );\n }\n}\n\nfunction old_assertMetadataKey(key) {\n if (typeof key !== \"symbol\") {\n throw new TypeError(\"Metadata keys must be symbols, received: \" + key);\n }\n}\n\nfunction old_assertCallable(fn, hint) {\n if (typeof fn !== \"function\") {\n throw new TypeError(hint + \" must be a function\");\n }\n}\n\nfunction old_assertValidReturnValue(kind, value) {\n var type = typeof value;\n\n if (kind === 1 /* ACCESSOR */) {\n if (type !== \"object\" || value === null) {\n throw new TypeError(\n \"accessor decorators must return an object with get, set, or init properties or void 0\",\n );\n }\n if (value.get !== undefined) {\n old_assertCallable(value.get, \"accessor.get\");\n }\n if (value.set !== undefined) {\n old_assertCallable(value.set, \"accessor.set\");\n }\n if (value.init !== undefined) {\n old_assertCallable(value.init, \"accessor.init\");\n }\n if (value.initializer !== undefined) {\n old_assertCallable(value.initializer, \"accessor.initializer\");\n }\n } else if (type !== \"function\") {\n var hint;\n if (kind === 0 /* FIELD */) {\n hint = \"field\";\n } else if (kind === 10 /* CLASS */) {\n hint = \"class\";\n } else {\n hint = \"method\";\n }\n throw new TypeError(hint + \" decorators must return a function or void 0\");\n }\n}\n\nfunction old_getInit(desc) {\n var initializer;\n if (\n (initializer = desc.init) == null &&\n (initializer = desc.initializer) &&\n typeof console !== \"undefined\"\n ) {\n console.warn(\".initializer has been renamed to .init as of March 2022\");\n }\n return initializer;\n}\n\nfunction old_applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n metadataMap,\n initializers,\n) {\n var decs = decInfo[0];\n\n var desc, initializer, prefix, value;\n\n if (isPrivate) {\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n desc = {\n get: decInfo[3],\n set: decInfo[4],\n };\n prefix = \"get\";\n } else if (kind === 3 /* GETTER */) {\n desc = {\n get: decInfo[3],\n };\n prefix = \"get\";\n } else if (kind === 4 /* SETTER */) {\n desc = {\n set: decInfo[3],\n };\n prefix = \"set\";\n } else {\n desc = {\n value: decInfo[3],\n };\n }\n if (kind !== 0 /* FIELD */) {\n if (kind === 1 /* ACCESSOR */) {\n setFunctionName(decInfo[4], \"#\" + name, \"set\");\n }\n setFunctionName(decInfo[3], \"#\" + name, prefix);\n }\n } else if (kind !== 0 /* FIELD */) {\n desc = Object.getOwnPropertyDescriptor(base, name);\n }\n\n if (kind === 1 /* ACCESSOR */) {\n value = {\n get: desc.get,\n set: desc.set,\n };\n } else if (kind === 2 /* METHOD */) {\n value = desc.value;\n } else if (kind === 3 /* GETTER */) {\n value = desc.get;\n } else if (kind === 4 /* SETTER */) {\n value = desc.set;\n }\n\n var newValue, get, set;\n\n if (typeof decs === \"function\") {\n newValue = old_memberDec(\n decs,\n name,\n desc,\n metadataMap,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n );\n\n if (newValue !== void 0) {\n old_assertValidReturnValue(kind, newValue);\n\n if (kind === 0 /* FIELD */) {\n initializer = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n initializer = old_getInit(newValue);\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n }\n } else {\n for (var i = decs.length - 1; i >= 0; i--) {\n var dec = decs[i];\n\n newValue = old_memberDec(\n dec,\n name,\n desc,\n metadataMap,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n );\n\n if (newValue !== void 0) {\n old_assertValidReturnValue(kind, newValue);\n var newInit;\n\n if (kind === 0 /* FIELD */) {\n newInit = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n newInit = old_getInit(newValue);\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n\n if (newInit !== void 0) {\n if (initializer === void 0) {\n initializer = newInit;\n } else if (typeof initializer === \"function\") {\n initializer = [initializer, newInit];\n } else {\n initializer.push(newInit);\n }\n }\n }\n }\n }\n\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n if (initializer === void 0) {\n // If the initializer was void 0, sub in a dummy initializer\n initializer = function (instance, init) {\n return init;\n };\n } else if (typeof initializer !== \"function\") {\n var ownInitializers = initializer;\n\n initializer = function (instance, init) {\n var value = init;\n\n for (var i = 0; i < ownInitializers.length; i++) {\n value = ownInitializers[i].call(instance, value);\n }\n\n return value;\n };\n } else {\n var originalInitializer = initializer;\n\n initializer = function (instance, init) {\n return originalInitializer.call(instance, init);\n };\n }\n\n ret.push(initializer);\n }\n\n if (kind !== 0 /* FIELD */) {\n if (kind === 1 /* ACCESSOR */) {\n desc.get = value.get;\n desc.set = value.set;\n } else if (kind === 2 /* METHOD */) {\n desc.value = value;\n } else if (kind === 3 /* GETTER */) {\n desc.get = value;\n } else if (kind === 4 /* SETTER */) {\n desc.set = value;\n }\n\n if (isPrivate) {\n if (kind === 1 /* ACCESSOR */) {\n ret.push(function (instance, args) {\n return value.get.call(instance, args);\n });\n ret.push(function (instance, args) {\n return value.set.call(instance, args);\n });\n } else if (kind === 2 /* METHOD */) {\n ret.push(value);\n } else {\n ret.push(function (instance, args) {\n return value.call(instance, args);\n });\n }\n } else {\n Object.defineProperty(base, name, desc);\n }\n }\n}\n\nfunction old_applyMemberDecs(\n ret,\n Class,\n protoMetadataMap,\n staticMetadataMap,\n decInfos,\n) {\n var protoInitializers;\n var staticInitializers;\n\n var existingProtoNonFields = new Map();\n var existingStaticNonFields = new Map();\n\n for (var i = 0; i < decInfos.length; i++) {\n var decInfo = decInfos[i];\n\n // skip computed property names\n if (!Array.isArray(decInfo)) continue;\n\n var kind = decInfo[1];\n var name = decInfo[2];\n var isPrivate = decInfo.length > 3;\n\n var isStatic = kind >= 5; /* STATIC */\n var base;\n var metadataMap;\n var initializers;\n\n if (isStatic) {\n base = Class;\n metadataMap = staticMetadataMap;\n kind = kind - 5 /* STATIC */;\n // initialize staticInitializers when we see a non-field static member\n if (kind !== 0 /* FIELD */) {\n staticInitializers = staticInitializers || [];\n initializers = staticInitializers;\n }\n } else {\n base = Class.prototype;\n metadataMap = protoMetadataMap;\n // initialize protoInitializers when we see a non-field member\n if (kind !== 0 /* FIELD */) {\n protoInitializers = protoInitializers || [];\n initializers = protoInitializers;\n }\n }\n\n if (kind !== 0 /* FIELD */ && !isPrivate) {\n var existingNonFields = isStatic\n ? existingStaticNonFields\n : existingProtoNonFields;\n\n var existingKind = existingNonFields.get(name) || 0;\n\n if (\n existingKind === true ||\n (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ ||\n (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */\n ) {\n throw new Error(\n \"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \" +\n name,\n );\n } else if (!existingKind && kind > 2 /* METHOD */) {\n existingNonFields.set(name, kind);\n } else {\n existingNonFields.set(name, true);\n }\n }\n\n old_applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n metadataMap,\n initializers,\n );\n }\n\n old_pushInitializers(ret, protoInitializers);\n old_pushInitializers(ret, staticInitializers);\n}\n\nfunction old_pushInitializers(ret, initializers) {\n if (initializers) {\n ret.push(function (instance) {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(instance);\n }\n return instance;\n });\n }\n}\n\nfunction old_applyClassDecs(ret, targetClass, metadataMap, classDecs) {\n if (classDecs.length > 0) {\n var initializers = [];\n var newClass = targetClass;\n var name = targetClass.name;\n\n for (var i = classDecs.length - 1; i >= 0; i--) {\n var decoratorFinishedRef = { v: false };\n\n try {\n var ctx = Object.assign(\n {\n kind: \"class\",\n name: name,\n addInitializer: old_createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n ),\n },\n old_createMetadataMethodsForProperty(\n metadataMap,\n 0 /* CONSTRUCTOR */,\n name,\n decoratorFinishedRef,\n ),\n );\n var nextNewClass = classDecs[i](newClass, ctx);\n } finally {\n decoratorFinishedRef.v = true;\n }\n\n if (nextNewClass !== undefined) {\n old_assertValidReturnValue(10 /* CLASS */, nextNewClass);\n newClass = nextNewClass;\n }\n }\n\n ret.push(newClass, function () {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(newClass);\n }\n });\n }\n}\n\n/**\n Basic usage:\n\n applyDecs(\n Class,\n [\n // member decorators\n [\n dec, // dec or array of decs\n 0, // kind of value being decorated\n 'prop', // name of public prop on class containing the value being decorated,\n '#p', // the name of the private property (if is private, void 0 otherwise),\n ]\n ],\n [\n // class decorators\n dec1, dec2\n ]\n )\n ```\n\n Fully transpiled example:\n\n ```js\n @dec\n class Class {\n @dec\n a = 123;\n\n @dec\n #a = 123;\n\n @dec\n @dec2\n accessor b = 123;\n\n @dec\n accessor #b = 123;\n\n @dec\n c() { console.log('c'); }\n\n @dec\n #c() { console.log('privC'); }\n\n @dec\n get d() { console.log('d'); }\n\n @dec\n get #d() { console.log('privD'); }\n\n @dec\n set e(v) { console.log('e'); }\n\n @dec\n set #e(v) { console.log('privE'); }\n }\n\n\n // becomes\n let initializeInstance;\n let initializeClass;\n\n let initA;\n let initPrivA;\n\n let initB;\n let initPrivB, getPrivB, setPrivB;\n\n let privC;\n let privD;\n let privE;\n\n let Class;\n class _Class {\n static {\n let ret = applyDecs(\n this,\n [\n [dec, 0, 'a'],\n [dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],\n [[dec, dec2], 1, 'b'],\n [dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],\n [dec, 2, 'c'],\n [dec, 2, 'c', () => console.log('privC')],\n [dec, 3, 'd'],\n [dec, 3, 'd', () => console.log('privD')],\n [dec, 4, 'e'],\n [dec, 4, 'e', () => console.log('privE')],\n ],\n [\n dec\n ]\n )\n\n initA = ret[0];\n\n initPrivA = ret[1];\n\n initB = ret[2];\n\n initPrivB = ret[3];\n getPrivB = ret[4];\n setPrivB = ret[5];\n\n privC = ret[6];\n\n privD = ret[7];\n\n privE = ret[8];\n\n initializeInstance = ret[9];\n\n Class = ret[10]\n\n initializeClass = ret[11];\n }\n\n a = (initializeInstance(this), initA(this, 123));\n\n #a = initPrivA(this, 123);\n\n #bData = initB(this, 123);\n get b() { return this.#bData }\n set b(v) { this.#bData = v }\n\n #privBData = initPrivB(this, 123);\n get #b() { return getPrivB(this); }\n set #b(v) { setPrivB(this, v); }\n\n c() { console.log('c'); }\n\n #c(...args) { return privC(this, ...args) }\n\n get d() { console.log('d'); }\n\n get #d() { return privD(this); }\n\n set e(v) { console.log('e'); }\n\n set #e(v) { privE(this, v); }\n }\n\n initializeClass(Class);\n */\nexport default function applyDecs(targetClass, memberDecs, classDecs) {\n var ret = [];\n var staticMetadataMap = {};\n\n var protoMetadataMap = {};\n\n old_applyMemberDecs(\n ret,\n targetClass,\n protoMetadataMap,\n staticMetadataMap,\n memberDecs,\n );\n\n old_convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap);\n\n old_applyClassDecs(ret, targetClass, staticMetadataMap, classDecs);\n\n old_convertMetadataMapToFinal(targetClass, staticMetadataMap);\n\n return ret;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAwBA,SAASE,oCAAoCA,CAC3CC,WAAW,EACXC,IAAI,EACJC,QAAQ,EACRC,oBAAoB,EACpB;EACA,OAAO;IACLC,WAAW,EAAE,SAAAA,CAAUC,GAAG,EAAE;MAC1BC,qBAAqB,CAACH,oBAAoB,EAAE,aAAa,CAAC;MAC1DI,qBAAqB,CAACF,GAAG,CAAC;MAE1B,IAAIG,cAAc,GAAGR,WAAW,CAACK,GAAG,CAAC;MAErC,IAAIG,cAAc,KAAK,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;MAE5C,IAAIP,IAAI,KAAK,CAAC,EAAe;QAC3B,IAAIQ,GAAG,GAAGD,cAAc,CAACE,MAAM;QAC/B,IAAID,GAAG,KAAK,KAAK,CAAC,EAAE;UAClB,OAAOA,GAAG,CAACP,QAAQ,CAAC;QACtB;MACF,CAAC,MAAM,IAAID,IAAI,KAAK,CAAC,EAAgB;QACnC,IAAIU,IAAI,GAAGH,cAAc,CAACI,OAAO;QACjC,IAAID,IAAI,KAAK,KAAK,CAAC,EAAE;UACnB,OAAOA,IAAI,CAACE,GAAG,CAACX,QAAQ,CAAC;QAC3B;MACF,CAAC,MAAM,IAAIY,MAAM,CAACC,cAAc,CAACC,IAAI,CAACR,cAAc,EAAE,aAAa,CAAC,EAAE;QACpE,OAAOA,cAAc,CAACS,WAAW;MAC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EAAE,EAAE;QAC5CY,YAAY,CAACZ,CAAC,CAAC,CAACf,IAAI,CAAC0F,QAAQ,CAAC;MAChC;IACF,CAAC,CAAC;EACJ;AACF;AAmJe,SAASE,SAASA,CAACJ,WAAW,EAAEK,UAAU,EAAEJ,SAAS,EAAE;EACpE,IAAI9B,GAAG,GAAG,EAAE;EACZ,IAAIiB,iBAAiB,GAAG,CAAC,CAAC;EAE1B,IAAID,gBAAgB,GAAG,CAAC,CAAC;EAEzBF,mBAAmB,CACjBd,GAAG,EACH6B,WAAW,EACXb,gBAAgB,EAChBC,iBAAiB,EACjBiB,UACF,CAAC;EAEDvF,6BAA6B,CAACkF,WAAW,CAACL,SAAS,EAAER,gBAAgB,CAAC;EAEtEY,kBAAkB,CAAC5B,GAAG,EAAE6B,WAAW,EAAEZ,iBAAiB,EAAEa,SAAS,CAAC;EAElEnF,6BAA6B,CAACkF,WAAW,EAAEZ,iBAAiB,CAAC;EAE7D,OAAOjB,GAAG;AACZ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2203.js b/node_modules/@babel/helpers/lib/helpers/applyDecs2203.js new file mode 100644 index 0000000..d61a4c4 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2203.js @@ -0,0 +1,363 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = applyDecs2203; +function applyDecs2203Factory() { + function createAddInitializerMethod(initializers, decoratorFinishedRef) { + return function addInitializer(initializer) { + assertNotFinished(decoratorFinishedRef, "addInitializer"); + assertCallable(initializer, "An initializer"); + initializers.push(initializer); + }; + } + function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) { + var kindStr; + switch (kind) { + case 1: + kindStr = "accessor"; + break; + case 2: + kindStr = "method"; + break; + case 3: + kindStr = "getter"; + break; + case 4: + kindStr = "setter"; + break; + default: + kindStr = "field"; + } + var ctx = { + kind: kindStr, + name: isPrivate ? "#" + name : name, + static: isStatic, + private: isPrivate + }; + var decoratorFinishedRef = { + v: false + }; + if (kind !== 0) { + ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef); + } + var get, set; + if (kind === 0) { + if (isPrivate) { + get = desc.get; + set = desc.set; + } else { + get = function () { + return this[name]; + }; + set = function (v) { + this[name] = v; + }; + } + } else if (kind === 2) { + get = function () { + return desc.value; + }; + } else { + if (kind === 1 || kind === 3) { + get = function () { + return desc.get.call(this); + }; + } + if (kind === 1 || kind === 4) { + set = function (v) { + desc.set.call(this, v); + }; + } + } + ctx.access = get && set ? { + get: get, + set: set + } : get ? { + get: get + } : { + set: set + }; + try { + return dec(value, ctx); + } finally { + decoratorFinishedRef.v = true; + } + } + function assertNotFinished(decoratorFinishedRef, fnName) { + if (decoratorFinishedRef.v) { + throw new Error("attempted to call " + fnName + " after decoration was finished"); + } + } + function assertCallable(fn, hint) { + if (typeof fn !== "function") { + throw new TypeError(hint + " must be a function"); + } + } + function assertValidReturnValue(kind, value) { + var type = typeof value; + if (kind === 1) { + if (type !== "object" || value === null) { + throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + } + if (value.get !== undefined) { + assertCallable(value.get, "accessor.get"); + } + if (value.set !== undefined) { + assertCallable(value.set, "accessor.set"); + } + if (value.init !== undefined) { + assertCallable(value.init, "accessor.init"); + } + } else if (type !== "function") { + var hint; + if (kind === 0) { + hint = "field"; + } else if (kind === 10) { + hint = "class"; + } else { + hint = "method"; + } + throw new TypeError(hint + " decorators must return a function or void 0"); + } + } + function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) { + var decs = decInfo[0]; + var desc, init, value; + if (isPrivate) { + if (kind === 0 || kind === 1) { + desc = { + get: decInfo[3], + set: decInfo[4] + }; + } else if (kind === 3) { + desc = { + get: decInfo[3] + }; + } else if (kind === 4) { + desc = { + set: decInfo[3] + }; + } else { + desc = { + value: decInfo[3] + }; + } + } else if (kind !== 0) { + desc = Object.getOwnPropertyDescriptor(base, name); + } + if (kind === 1) { + value = { + get: desc.get, + set: desc.set + }; + } else if (kind === 2) { + value = desc.value; + } else if (kind === 3) { + value = desc.get; + } else if (kind === 4) { + value = desc.set; + } + var newValue, get, set; + if (typeof decs === "function") { + newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value); + if (newValue !== void 0) { + assertValidReturnValue(kind, newValue); + if (kind === 0) { + init = newValue; + } else if (kind === 1) { + init = newValue.init; + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + } + } else { + for (var i = decs.length - 1; i >= 0; i--) { + var dec = decs[i]; + newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value); + if (newValue !== void 0) { + assertValidReturnValue(kind, newValue); + var newInit; + if (kind === 0) { + newInit = newValue; + } else if (kind === 1) { + newInit = newValue.init; + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + if (newInit !== void 0) { + if (init === void 0) { + init = newInit; + } else if (typeof init === "function") { + init = [init, newInit]; + } else { + init.push(newInit); + } + } + } + } + } + if (kind === 0 || kind === 1) { + if (init === void 0) { + init = function (instance, init) { + return init; + }; + } else if (typeof init !== "function") { + var ownInitializers = init; + init = function (instance, init) { + var value = init; + for (var i = 0; i < ownInitializers.length; i++) { + value = ownInitializers[i].call(instance, value); + } + return value; + }; + } else { + var originalInitializer = init; + init = function (instance, init) { + return originalInitializer.call(instance, init); + }; + } + ret.push(init); + } + if (kind !== 0) { + if (kind === 1) { + desc.get = value.get; + desc.set = value.set; + } else if (kind === 2) { + desc.value = value; + } else if (kind === 3) { + desc.get = value; + } else if (kind === 4) { + desc.set = value; + } + if (isPrivate) { + if (kind === 1) { + ret.push(function (instance, args) { + return value.get.call(instance, args); + }); + ret.push(function (instance, args) { + return value.set.call(instance, args); + }); + } else if (kind === 2) { + ret.push(value); + } else { + ret.push(function (instance, args) { + return value.call(instance, args); + }); + } + } else { + Object.defineProperty(base, name, desc); + } + } + } + function applyMemberDecs(ret, Class, decInfos) { + var protoInitializers; + var staticInitializers; + var existingProtoNonFields = new Map(); + var existingStaticNonFields = new Map(); + for (var i = 0; i < decInfos.length; i++) { + var decInfo = decInfos[i]; + if (!Array.isArray(decInfo)) continue; + var kind = decInfo[1]; + var name = decInfo[2]; + var isPrivate = decInfo.length > 3; + var isStatic = kind >= 5; + var base; + var initializers; + if (isStatic) { + base = Class; + kind = kind - 5; + if (kind !== 0) { + staticInitializers = staticInitializers || []; + initializers = staticInitializers; + } + } else { + base = Class.prototype; + if (kind !== 0) { + protoInitializers = protoInitializers || []; + initializers = protoInitializers; + } + } + if (kind !== 0 && !isPrivate) { + var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields; + var existingKind = existingNonFields.get(name) || 0; + if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) { + throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name); + } else if (!existingKind && kind > 2) { + existingNonFields.set(name, kind); + } else { + existingNonFields.set(name, true); + } + } + applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers); + } + pushInitializers(ret, protoInitializers); + pushInitializers(ret, staticInitializers); + } + function pushInitializers(ret, initializers) { + if (initializers) { + ret.push(function (instance) { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(instance); + } + return instance; + }); + } + } + function applyClassDecs(ret, targetClass, classDecs) { + if (classDecs.length > 0) { + var initializers = []; + var newClass = targetClass; + var name = targetClass.name; + for (var i = classDecs.length - 1; i >= 0; i--) { + var decoratorFinishedRef = { + v: false + }; + try { + var nextNewClass = classDecs[i](newClass, { + kind: "class", + name: name, + addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef) + }); + } finally { + decoratorFinishedRef.v = true; + } + if (nextNewClass !== undefined) { + assertValidReturnValue(10, nextNewClass); + newClass = nextNewClass; + } + } + ret.push(newClass, function () { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(newClass); + } + }); + } + } + return function applyDecs2203Impl(targetClass, memberDecs, classDecs) { + var ret = []; + applyMemberDecs(ret, targetClass, memberDecs); + applyClassDecs(ret, targetClass, classDecs); + return ret; + }; +} +var applyDecs2203Impl; +function applyDecs2203(targetClass, memberDecs, classDecs) { + applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory(); + return applyDecs2203Impl(targetClass, memberDecs, classDecs); +} + +//# sourceMappingURL=applyDecs2203.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2203.js.map b/node_modules/@babel/helpers/lib/helpers/applyDecs2203.js.map new file mode 100644 index 0000000..8de137e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2203.js.map @@ -0,0 +1 @@ +{"version":3,"names":["applyDecs2203Factory","createAddInitializerMethod","initializers","decoratorFinishedRef","addInitializer","initializer","assertNotFinished","assertCallable","push","memberDec","dec","name","desc","kind","isStatic","isPrivate","value","kindStr","ctx","static","private","v","get","set","call","access","fnName","Error","fn","hint","TypeError","assertValidReturnValue","type","undefined","init","applyMemberDec","ret","base","decInfo","decs","Object","getOwnPropertyDescriptor","newValue","i","length","newInit","instance","ownInitializers","originalInitializer","args","defineProperty","applyMemberDecs","Class","decInfos","protoInitializers","staticInitializers","existingProtoNonFields","Map","existingStaticNonFields","Array","isArray","prototype","existingNonFields","existingKind","pushInitializers","applyClassDecs","targetClass","classDecs","newClass","nextNewClass","applyDecs2203Impl","memberDecs","applyDecs2203"],"sources":["../../src/helpers/applyDecs2203.js"],"sourcesContent":["/* @minVersion 7.19.0 */\n/* @onlyBabel7 */\n\n/**\n * NOTE: This is an old version of the helper, used for 2022-03 decorators.\n * Updates should be done in applyDecs2203R.js.\n */\n\n/**\n Enums are used in this file, but not assigned to vars to avoid non-hoistable values\n\n CONSTRUCTOR = 0;\n PUBLIC = 1;\n PRIVATE = 2;\n\n FIELD = 0;\n ACCESSOR = 1;\n METHOD = 2;\n GETTER = 3;\n SETTER = 4;\n\n STATIC = 5;\n\n CLASS = 10; // only used in assertValidReturnValue\n*/\nfunction applyDecs2203Factory() {\n function createAddInitializerMethod(initializers, decoratorFinishedRef) {\n return function addInitializer(initializer) {\n assertNotFinished(decoratorFinishedRef, \"addInitializer\");\n assertCallable(initializer, \"An initializer\");\n initializers.push(initializer);\n };\n }\n\n function memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n ) {\n var kindStr;\n\n switch (kind) {\n case 1 /* ACCESSOR */:\n kindStr = \"accessor\";\n break;\n case 2 /* METHOD */:\n kindStr = \"method\";\n break;\n case 3 /* GETTER */:\n kindStr = \"getter\";\n break;\n case 4 /* SETTER */:\n kindStr = \"setter\";\n break;\n default:\n kindStr = \"field\";\n }\n\n var ctx = {\n kind: kindStr,\n name: isPrivate ? \"#\" + name : name,\n static: isStatic,\n private: isPrivate,\n };\n\n var decoratorFinishedRef = { v: false };\n\n if (kind !== 0 /* FIELD */) {\n ctx.addInitializer = createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n );\n }\n\n var get, set;\n if (kind === 0 /* FIELD */) {\n if (isPrivate) {\n get = desc.get;\n set = desc.set;\n } else {\n get = function () {\n return this[name];\n };\n set = function (v) {\n this[name] = v;\n };\n }\n } else if (kind === 2 /* METHOD */) {\n get = function () {\n return desc.value;\n };\n } else {\n // replace with values that will go through the final getter and setter\n if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {\n get = function () {\n return desc.get.call(this);\n };\n }\n\n if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {\n set = function (v) {\n desc.set.call(this, v);\n };\n }\n }\n ctx.access =\n get && set ? { get: get, set: set } : get ? { get: get } : { set: set };\n\n try {\n return dec(value, ctx);\n } finally {\n decoratorFinishedRef.v = true;\n }\n }\n\n function assertNotFinished(decoratorFinishedRef, fnName) {\n if (decoratorFinishedRef.v) {\n throw new Error(\n \"attempted to call \" + fnName + \" after decoration was finished\",\n );\n }\n }\n\n function assertCallable(fn, hint) {\n if (typeof fn !== \"function\") {\n throw new TypeError(hint + \" must be a function\");\n }\n }\n\n function assertValidReturnValue(kind, value) {\n var type = typeof value;\n\n if (kind === 1 /* ACCESSOR */) {\n if (type !== \"object\" || value === null) {\n throw new TypeError(\n \"accessor decorators must return an object with get, set, or init properties or void 0\",\n );\n }\n if (value.get !== undefined) {\n assertCallable(value.get, \"accessor.get\");\n }\n if (value.set !== undefined) {\n assertCallable(value.set, \"accessor.set\");\n }\n if (value.init !== undefined) {\n assertCallable(value.init, \"accessor.init\");\n }\n } else if (type !== \"function\") {\n var hint;\n if (kind === 0 /* FIELD */) {\n hint = \"field\";\n } else if (kind === 10 /* CLASS */) {\n hint = \"class\";\n } else {\n hint = \"method\";\n }\n throw new TypeError(\n hint + \" decorators must return a function or void 0\",\n );\n }\n }\n\n function applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n initializers,\n ) {\n var decs = decInfo[0];\n\n var desc, init, value;\n\n if (isPrivate) {\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n desc = {\n get: decInfo[3],\n set: decInfo[4],\n };\n } else if (kind === 3 /* GETTER */) {\n desc = {\n get: decInfo[3],\n };\n } else if (kind === 4 /* SETTER */) {\n desc = {\n set: decInfo[3],\n };\n } else {\n desc = {\n value: decInfo[3],\n };\n }\n } else if (kind !== 0 /* FIELD */) {\n desc = Object.getOwnPropertyDescriptor(base, name);\n }\n\n if (kind === 1 /* ACCESSOR */) {\n value = {\n get: desc.get,\n set: desc.set,\n };\n } else if (kind === 2 /* METHOD */) {\n value = desc.value;\n } else if (kind === 3 /* GETTER */) {\n value = desc.get;\n } else if (kind === 4 /* SETTER */) {\n value = desc.set;\n }\n\n var newValue, get, set;\n\n if (typeof decs === \"function\") {\n newValue = memberDec(\n decs,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n );\n\n if (newValue !== void 0) {\n assertValidReturnValue(kind, newValue);\n\n if (kind === 0 /* FIELD */) {\n init = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n init = newValue.init;\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n }\n } else {\n for (var i = decs.length - 1; i >= 0; i--) {\n var dec = decs[i];\n\n newValue = memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n );\n\n if (newValue !== void 0) {\n assertValidReturnValue(kind, newValue);\n var newInit;\n\n if (kind === 0 /* FIELD */) {\n newInit = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n newInit = newValue.init;\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n\n if (newInit !== void 0) {\n if (init === void 0) {\n init = newInit;\n } else if (typeof init === \"function\") {\n init = [init, newInit];\n } else {\n init.push(newInit);\n }\n }\n }\n }\n }\n\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n if (init === void 0) {\n // If the initializer was void 0, sub in a dummy initializer\n init = function (instance, init) {\n return init;\n };\n } else if (typeof init !== \"function\") {\n var ownInitializers = init;\n\n init = function (instance, init) {\n var value = init;\n\n for (var i = 0; i < ownInitializers.length; i++) {\n value = ownInitializers[i].call(instance, value);\n }\n\n return value;\n };\n } else {\n var originalInitializer = init;\n\n init = function (instance, init) {\n return originalInitializer.call(instance, init);\n };\n }\n\n ret.push(init);\n }\n\n if (kind !== 0 /* FIELD */) {\n if (kind === 1 /* ACCESSOR */) {\n desc.get = value.get;\n desc.set = value.set;\n } else if (kind === 2 /* METHOD */) {\n desc.value = value;\n } else if (kind === 3 /* GETTER */) {\n desc.get = value;\n } else if (kind === 4 /* SETTER */) {\n desc.set = value;\n }\n\n if (isPrivate) {\n if (kind === 1 /* ACCESSOR */) {\n ret.push(function (instance, args) {\n return value.get.call(instance, args);\n });\n ret.push(function (instance, args) {\n return value.set.call(instance, args);\n });\n } else if (kind === 2 /* METHOD */) {\n ret.push(value);\n } else {\n ret.push(function (instance, args) {\n return value.call(instance, args);\n });\n }\n } else {\n Object.defineProperty(base, name, desc);\n }\n }\n }\n\n function applyMemberDecs(ret, Class, decInfos) {\n var protoInitializers;\n var staticInitializers;\n\n var existingProtoNonFields = new Map();\n var existingStaticNonFields = new Map();\n\n for (var i = 0; i < decInfos.length; i++) {\n var decInfo = decInfos[i];\n\n // skip computed property names\n if (!Array.isArray(decInfo)) continue;\n\n var kind = decInfo[1];\n var name = decInfo[2];\n var isPrivate = decInfo.length > 3;\n\n var isStatic = kind >= 5; /* STATIC */\n var base;\n var initializers;\n\n if (isStatic) {\n base = Class;\n kind = kind - 5 /* STATIC */;\n // initialize staticInitializers when we see a non-field static member\n if (kind !== 0 /* FIELD */) {\n staticInitializers = staticInitializers || [];\n initializers = staticInitializers;\n }\n } else {\n base = Class.prototype;\n // initialize protoInitializers when we see a non-field member\n if (kind !== 0 /* FIELD */) {\n protoInitializers = protoInitializers || [];\n initializers = protoInitializers;\n }\n }\n\n if (kind !== 0 /* FIELD */ && !isPrivate) {\n var existingNonFields = isStatic\n ? existingStaticNonFields\n : existingProtoNonFields;\n\n var existingKind = existingNonFields.get(name) || 0;\n\n if (\n existingKind === true ||\n (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ ||\n (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */\n ) {\n throw new Error(\n \"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \" +\n name,\n );\n } else if (!existingKind && kind > 2 /* METHOD */) {\n existingNonFields.set(name, kind);\n } else {\n existingNonFields.set(name, true);\n }\n }\n\n applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n initializers,\n );\n }\n\n pushInitializers(ret, protoInitializers);\n pushInitializers(ret, staticInitializers);\n }\n\n function pushInitializers(ret, initializers) {\n if (initializers) {\n ret.push(function (instance) {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(instance);\n }\n return instance;\n });\n }\n }\n\n function applyClassDecs(ret, targetClass, classDecs) {\n if (classDecs.length > 0) {\n var initializers = [];\n var newClass = targetClass;\n var name = targetClass.name;\n\n for (var i = classDecs.length - 1; i >= 0; i--) {\n var decoratorFinishedRef = { v: false };\n\n try {\n var nextNewClass = classDecs[i](newClass, {\n kind: \"class\",\n name: name,\n addInitializer: createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n ),\n });\n } finally {\n decoratorFinishedRef.v = true;\n }\n\n if (nextNewClass !== undefined) {\n assertValidReturnValue(10 /* CLASS */, nextNewClass);\n newClass = nextNewClass;\n }\n }\n\n ret.push(newClass, function () {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(newClass);\n }\n });\n }\n }\n\n /**\n Basic usage:\n\n applyDecs(\n Class,\n [\n // member decorators\n [\n dec, // dec or array of decs\n 0, // kind of value being decorated\n 'prop', // name of public prop on class containing the value being decorated,\n '#p', // the name of the private property (if is private, void 0 otherwise),\n ]\n ],\n [\n // class decorators\n dec1, dec2\n ]\n )\n ```\n\n Fully transpiled example:\n\n ```js\n @dec\n class Class {\n @dec\n a = 123;\n\n @dec\n #a = 123;\n\n @dec\n @dec2\n accessor b = 123;\n\n @dec\n accessor #b = 123;\n\n @dec\n c() { console.log('c'); }\n\n @dec\n #c() { console.log('privC'); }\n\n @dec\n get d() { console.log('d'); }\n\n @dec\n get #d() { console.log('privD'); }\n\n @dec\n set e(v) { console.log('e'); }\n\n @dec\n set #e(v) { console.log('privE'); }\n }\n\n\n // becomes\n let initializeInstance;\n let initializeClass;\n\n let initA;\n let initPrivA;\n\n let initB;\n let initPrivB, getPrivB, setPrivB;\n\n let privC;\n let privD;\n let privE;\n\n let Class;\n class _Class {\n static {\n let ret = applyDecs(\n this,\n [\n [dec, 0, 'a'],\n [dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],\n [[dec, dec2], 1, 'b'],\n [dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],\n [dec, 2, 'c'],\n [dec, 2, 'c', () => console.log('privC')],\n [dec, 3, 'd'],\n [dec, 3, 'd', () => console.log('privD')],\n [dec, 4, 'e'],\n [dec, 4, 'e', () => console.log('privE')],\n ],\n [\n dec\n ]\n )\n\n initA = ret[0];\n\n initPrivA = ret[1];\n\n initB = ret[2];\n\n initPrivB = ret[3];\n getPrivB = ret[4];\n setPrivB = ret[5];\n\n privC = ret[6];\n\n privD = ret[7];\n\n privE = ret[8];\n\n initializeInstance = ret[9];\n\n Class = ret[10]\n\n initializeClass = ret[11];\n }\n\n a = (initializeInstance(this), initA(this, 123));\n\n #a = initPrivA(this, 123);\n\n #bData = initB(this, 123);\n get b() { return this.#bData }\n set b(v) { this.#bData = v }\n\n #privBData = initPrivB(this, 123);\n get #b() { return getPrivB(this); }\n set #b(v) { setPrivB(this, v); }\n\n c() { console.log('c'); }\n\n #c(...args) { return privC(this, ...args) }\n\n get d() { console.log('d'); }\n\n get #d() { return privD(this); }\n\n set e(v) { console.log('e'); }\n\n set #e(v) { privE(this, v); }\n }\n\n initializeClass(Class);\n */\n\n return function applyDecs2203Impl(targetClass, memberDecs, classDecs) {\n var ret = [];\n applyMemberDecs(ret, targetClass, memberDecs);\n applyClassDecs(ret, targetClass, classDecs);\n return ret;\n };\n}\n\nvar applyDecs2203Impl;\n\nexport default function applyDecs2203(targetClass, memberDecs, classDecs) {\n applyDecs2203Impl = applyDecs2203Impl || applyDecs2203Factory();\n return applyDecs2203Impl(targetClass, memberDecs, classDecs);\n}\n"],"mappings":";;;;;;AAyBA,SAASA,oBAAoBA,CAAA,EAAG;EAC9B,SAASC,0BAA0BA,CAACC,YAAY,EAAEC,oBAAoB,EAAE;IACtE,OAAO,SAASC,cAAcA,CAACC,WAAW,EAAE;MAC1CC,iBAAiB,CAACH,oBAAoB,EAAE,gBAAgB,CAAC;MACzDI,cAAc,CAACF,WAAW,EAAE,gBAAgB,CAAC;MAC7CH,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B;AAEN,SAASE,aAAaA,CAACN,WAAW,EAAEK,UAAU,EAAEJ,SAAS,EAAE;EACxEG,iBAAiB,GAAGA,iBAAiB,IAAItE,oBAAoB,CAAC,CAAC;EAC/D,OAAOsE,iBAAiB,CAACJ,WAAW,EAAEK,UAAU,EAAEJ,SAAS,CAAC;AAC9D","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js b/node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js new file mode 100644 index 0000000..8f2750d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js @@ -0,0 +1,376 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = applyDecs2203R; +var _setFunctionName = require("setFunctionName"); +var _toPropertyKey = require("toPropertyKey"); +function applyDecs2203RFactory() { + function createAddInitializerMethod(initializers, decoratorFinishedRef) { + return function addInitializer(initializer) { + assertNotFinished(decoratorFinishedRef, "addInitializer"); + assertCallable(initializer, "An initializer"); + initializers.push(initializer); + }; + } + function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) { + var kindStr; + switch (kind) { + case 1: + kindStr = "accessor"; + break; + case 2: + kindStr = "method"; + break; + case 3: + kindStr = "getter"; + break; + case 4: + kindStr = "setter"; + break; + default: + kindStr = "field"; + } + var ctx = { + kind: kindStr, + name: isPrivate ? "#" + name : _toPropertyKey(name), + static: isStatic, + private: isPrivate + }; + var decoratorFinishedRef = { + v: false + }; + if (kind !== 0) { + ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef); + } + var get, set; + if (kind === 0) { + if (isPrivate) { + get = desc.get; + set = desc.set; + } else { + get = function () { + return this[name]; + }; + set = function (v) { + this[name] = v; + }; + } + } else if (kind === 2) { + get = function () { + return desc.value; + }; + } else { + if (kind === 1 || kind === 3) { + get = function () { + return desc.get.call(this); + }; + } + if (kind === 1 || kind === 4) { + set = function (v) { + desc.set.call(this, v); + }; + } + } + ctx.access = get && set ? { + get: get, + set: set + } : get ? { + get: get + } : { + set: set + }; + try { + return dec(value, ctx); + } finally { + decoratorFinishedRef.v = true; + } + } + function assertNotFinished(decoratorFinishedRef, fnName) { + if (decoratorFinishedRef.v) { + throw new Error("attempted to call " + fnName + " after decoration was finished"); + } + } + function assertCallable(fn, hint) { + if (typeof fn !== "function") { + throw new TypeError(hint + " must be a function"); + } + } + function assertValidReturnValue(kind, value) { + var type = typeof value; + if (kind === 1) { + if (type !== "object" || value === null) { + throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + } + if (value.get !== undefined) { + assertCallable(value.get, "accessor.get"); + } + if (value.set !== undefined) { + assertCallable(value.set, "accessor.set"); + } + if (value.init !== undefined) { + assertCallable(value.init, "accessor.init"); + } + } else if (type !== "function") { + var hint; + if (kind === 0) { + hint = "field"; + } else if (kind === 10) { + hint = "class"; + } else { + hint = "method"; + } + throw new TypeError(hint + " decorators must return a function or void 0"); + } + } + function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) { + var decs = decInfo[0]; + var desc, init, prefix, value; + if (isPrivate) { + if (kind === 0 || kind === 1) { + desc = { + get: decInfo[3], + set: decInfo[4] + }; + prefix = "get"; + } else if (kind === 3) { + desc = { + get: decInfo[3] + }; + prefix = "get"; + } else if (kind === 4) { + desc = { + set: decInfo[3] + }; + prefix = "set"; + } else { + desc = { + value: decInfo[3] + }; + } + if (kind !== 0) { + if (kind === 1) { + _setFunctionName(decInfo[4], "#" + name, "set"); + } + _setFunctionName(decInfo[3], "#" + name, prefix); + } + } else if (kind !== 0) { + desc = Object.getOwnPropertyDescriptor(base, name); + } + if (kind === 1) { + value = { + get: desc.get, + set: desc.set + }; + } else if (kind === 2) { + value = desc.value; + } else if (kind === 3) { + value = desc.get; + } else if (kind === 4) { + value = desc.set; + } + var newValue, get, set; + if (typeof decs === "function") { + newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value); + if (newValue !== void 0) { + assertValidReturnValue(kind, newValue); + if (kind === 0) { + init = newValue; + } else if (kind === 1) { + init = newValue.init; + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + } + } else { + for (var i = decs.length - 1; i >= 0; i--) { + var dec = decs[i]; + newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value); + if (newValue !== void 0) { + assertValidReturnValue(kind, newValue); + var newInit; + if (kind === 0) { + newInit = newValue; + } else if (kind === 1) { + newInit = newValue.init; + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + if (newInit !== void 0) { + if (init === void 0) { + init = newInit; + } else if (typeof init === "function") { + init = [init, newInit]; + } else { + init.push(newInit); + } + } + } + } + } + if (kind === 0 || kind === 1) { + if (init === void 0) { + init = function (instance, init) { + return init; + }; + } else if (typeof init !== "function") { + var ownInitializers = init; + init = function (instance, init) { + var value = init; + for (var i = 0; i < ownInitializers.length; i++) { + value = ownInitializers[i].call(instance, value); + } + return value; + }; + } else { + var originalInitializer = init; + init = function (instance, init) { + return originalInitializer.call(instance, init); + }; + } + ret.push(init); + } + if (kind !== 0) { + if (kind === 1) { + desc.get = value.get; + desc.set = value.set; + } else if (kind === 2) { + desc.value = value; + } else if (kind === 3) { + desc.get = value; + } else if (kind === 4) { + desc.set = value; + } + if (isPrivate) { + if (kind === 1) { + ret.push(function (instance, args) { + return value.get.call(instance, args); + }); + ret.push(function (instance, args) { + return value.set.call(instance, args); + }); + } else if (kind === 2) { + ret.push(value); + } else { + ret.push(function (instance, args) { + return value.call(instance, args); + }); + } + } else { + Object.defineProperty(base, name, desc); + } + } + } + function applyMemberDecs(Class, decInfos) { + var ret = []; + var protoInitializers; + var staticInitializers; + var existingProtoNonFields = new Map(); + var existingStaticNonFields = new Map(); + for (var i = 0; i < decInfos.length; i++) { + var decInfo = decInfos[i]; + if (!Array.isArray(decInfo)) continue; + var kind = decInfo[1]; + var name = decInfo[2]; + var isPrivate = decInfo.length > 3; + var isStatic = kind >= 5; + var base; + var initializers; + if (isStatic) { + base = Class; + kind = kind - 5; + if (kind !== 0) { + staticInitializers = staticInitializers || []; + initializers = staticInitializers; + } + } else { + base = Class.prototype; + if (kind !== 0) { + protoInitializers = protoInitializers || []; + initializers = protoInitializers; + } + } + if (kind !== 0 && !isPrivate) { + var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields; + var existingKind = existingNonFields.get(name) || 0; + if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) { + throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name); + } else if (!existingKind && kind > 2) { + existingNonFields.set(name, kind); + } else { + existingNonFields.set(name, true); + } + } + applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers); + } + pushInitializers(ret, protoInitializers); + pushInitializers(ret, staticInitializers); + return ret; + } + function pushInitializers(ret, initializers) { + if (initializers) { + ret.push(function (instance) { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(instance); + } + return instance; + }); + } + } + function applyClassDecs(targetClass, classDecs) { + if (classDecs.length > 0) { + var initializers = []; + var newClass = targetClass; + var name = targetClass.name; + for (var i = classDecs.length - 1; i >= 0; i--) { + var decoratorFinishedRef = { + v: false + }; + try { + var nextNewClass = classDecs[i](newClass, { + kind: "class", + name: name, + addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef) + }); + } finally { + decoratorFinishedRef.v = true; + } + if (nextNewClass !== undefined) { + assertValidReturnValue(10, nextNewClass); + newClass = nextNewClass; + } + } + return [newClass, function () { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(newClass); + } + }]; + } + } + return function applyDecs2203R(targetClass, memberDecs, classDecs) { + return { + e: applyMemberDecs(targetClass, memberDecs), + get c() { + return applyClassDecs(targetClass, classDecs); + } + }; + }; +} +function applyDecs2203R(targetClass, memberDecs, classDecs) { + return (exports.default = applyDecs2203R = applyDecs2203RFactory())(targetClass, memberDecs, classDecs); +} + +//# sourceMappingURL=applyDecs2203R.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js.map b/node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js.map new file mode 100644 index 0000000..9d3d5cd --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_setFunctionName","require","_toPropertyKey","applyDecs2203RFactory","createAddInitializerMethod","initializers","decoratorFinishedRef","addInitializer","initializer","assertNotFinished","assertCallable","push","memberDec","dec","name","desc","kind","isStatic","isPrivate","value","kindStr","ctx","toPropertyKey","static","private","v","get","set","call","access","fnName","Error","fn","hint","TypeError","assertValidReturnValue","type","undefined","init","applyMemberDec","ret","base","decInfo","decs","prefix","setFunctionName","Object","getOwnPropertyDescriptor","newValue","i","length","newInit","instance","ownInitializers","originalInitializer","args","defineProperty","applyMemberDecs","Class","decInfos","protoInitializers","staticInitializers","existingProtoNonFields","Map","existingStaticNonFields","Array","isArray","prototype","existingNonFields","existingKind","pushInitializers","applyClassDecs","targetClass","classDecs","newClass","nextNewClass","applyDecs2203R","memberDecs","e","c","exports","default"],"sources":["../../src/helpers/applyDecs2203R.js"],"sourcesContent":["/* @minVersion 7.20.0 */\n/* @onlyBabel7 */\n\nimport setFunctionName from \"setFunctionName\";\nimport toPropertyKey from \"toPropertyKey\";\n\n/**\n Enums are used in this file, but not assigned to vars to avoid non-hoistable values\n\n CONSTRUCTOR = 0;\n PUBLIC = 1;\n PRIVATE = 2;\n\n FIELD = 0;\n ACCESSOR = 1;\n METHOD = 2;\n GETTER = 3;\n SETTER = 4;\n\n STATIC = 5;\n\n CLASS = 10; // only used in assertValidReturnValue\n*/\n\nfunction applyDecs2203RFactory() {\n function createAddInitializerMethod(initializers, decoratorFinishedRef) {\n return function addInitializer(initializer) {\n assertNotFinished(decoratorFinishedRef, \"addInitializer\");\n assertCallable(initializer, \"An initializer\");\n initializers.push(initializer);\n };\n }\n\n function memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n ) {\n var kindStr;\n\n switch (kind) {\n case 1 /* ACCESSOR */:\n kindStr = \"accessor\";\n break;\n case 2 /* METHOD */:\n kindStr = \"method\";\n break;\n case 3 /* GETTER */:\n kindStr = \"getter\";\n break;\n case 4 /* SETTER */:\n kindStr = \"setter\";\n break;\n default:\n kindStr = \"field\";\n }\n\n var ctx = {\n kind: kindStr,\n name: isPrivate ? \"#\" + name : toPropertyKey(name),\n static: isStatic,\n private: isPrivate,\n };\n\n var decoratorFinishedRef = { v: false };\n\n if (kind !== 0 /* FIELD */) {\n ctx.addInitializer = createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n );\n }\n\n var get, set;\n if (kind === 0 /* FIELD */) {\n if (isPrivate) {\n get = desc.get;\n set = desc.set;\n } else {\n get = function () {\n return this[name];\n };\n set = function (v) {\n this[name] = v;\n };\n }\n } else if (kind === 2 /* METHOD */) {\n get = function () {\n return desc.value;\n };\n } else {\n // replace with values that will go through the final getter and setter\n if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {\n get = function () {\n return desc.get.call(this);\n };\n }\n\n if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {\n set = function (v) {\n desc.set.call(this, v);\n };\n }\n }\n ctx.access =\n get && set ? { get: get, set: set } : get ? { get: get } : { set: set };\n\n try {\n return dec(value, ctx);\n } finally {\n decoratorFinishedRef.v = true;\n }\n }\n\n function assertNotFinished(decoratorFinishedRef, fnName) {\n if (decoratorFinishedRef.v) {\n throw new Error(\n \"attempted to call \" + fnName + \" after decoration was finished\",\n );\n }\n }\n\n function assertCallable(fn, hint) {\n if (typeof fn !== \"function\") {\n throw new TypeError(hint + \" must be a function\");\n }\n }\n\n function assertValidReturnValue(kind, value) {\n var type = typeof value;\n\n if (kind === 1 /* ACCESSOR */) {\n if (type !== \"object\" || value === null) {\n throw new TypeError(\n \"accessor decorators must return an object with get, set, or init properties or void 0\",\n );\n }\n if (value.get !== undefined) {\n assertCallable(value.get, \"accessor.get\");\n }\n if (value.set !== undefined) {\n assertCallable(value.set, \"accessor.set\");\n }\n if (value.init !== undefined) {\n assertCallable(value.init, \"accessor.init\");\n }\n } else if (type !== \"function\") {\n var hint;\n if (kind === 0 /* FIELD */) {\n hint = \"field\";\n } else if (kind === 10 /* CLASS */) {\n hint = \"class\";\n } else {\n hint = \"method\";\n }\n throw new TypeError(\n hint + \" decorators must return a function or void 0\",\n );\n }\n }\n\n function applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n initializers,\n ) {\n var decs = decInfo[0];\n\n var desc, init, prefix, value;\n\n if (isPrivate) {\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n desc = {\n get: decInfo[3],\n set: decInfo[4],\n };\n prefix = \"get\";\n } else if (kind === 3 /* GETTER */) {\n desc = {\n get: decInfo[3],\n };\n prefix = \"get\";\n } else if (kind === 4 /* SETTER */) {\n desc = {\n set: decInfo[3],\n };\n prefix = \"set\";\n } else {\n desc = {\n value: decInfo[3],\n };\n }\n if (kind !== 0 /* FIELD */) {\n if (kind === 1 /* ACCESSOR */) {\n setFunctionName(decInfo[4], \"#\" + name, \"set\");\n }\n setFunctionName(decInfo[3], \"#\" + name, prefix);\n }\n } else if (kind !== 0 /* FIELD */) {\n desc = Object.getOwnPropertyDescriptor(base, name);\n }\n\n if (kind === 1 /* ACCESSOR */) {\n value = {\n get: desc.get,\n set: desc.set,\n };\n } else if (kind === 2 /* METHOD */) {\n value = desc.value;\n } else if (kind === 3 /* GETTER */) {\n value = desc.get;\n } else if (kind === 4 /* SETTER */) {\n value = desc.set;\n }\n\n var newValue, get, set;\n\n if (typeof decs === \"function\") {\n newValue = memberDec(\n decs,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n );\n\n if (newValue !== void 0) {\n assertValidReturnValue(kind, newValue);\n\n if (kind === 0 /* FIELD */) {\n init = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n init = newValue.init;\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n }\n } else {\n for (var i = decs.length - 1; i >= 0; i--) {\n var dec = decs[i];\n\n newValue = memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n );\n\n if (newValue !== void 0) {\n assertValidReturnValue(kind, newValue);\n var newInit;\n\n if (kind === 0 /* FIELD */) {\n newInit = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n newInit = newValue.init;\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n\n if (newInit !== void 0) {\n if (init === void 0) {\n init = newInit;\n } else if (typeof init === \"function\") {\n init = [init, newInit];\n } else {\n init.push(newInit);\n }\n }\n }\n }\n }\n\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n if (init === void 0) {\n // If the initializer was void 0, sub in a dummy initializer\n init = function (instance, init) {\n return init;\n };\n } else if (typeof init !== \"function\") {\n var ownInitializers = init;\n\n init = function (instance, init) {\n var value = init;\n\n for (var i = 0; i < ownInitializers.length; i++) {\n value = ownInitializers[i].call(instance, value);\n }\n\n return value;\n };\n } else {\n var originalInitializer = init;\n\n init = function (instance, init) {\n return originalInitializer.call(instance, init);\n };\n }\n\n ret.push(init);\n }\n\n if (kind !== 0 /* FIELD */) {\n if (kind === 1 /* ACCESSOR */) {\n desc.get = value.get;\n desc.set = value.set;\n } else if (kind === 2 /* METHOD */) {\n desc.value = value;\n } else if (kind === 3 /* GETTER */) {\n desc.get = value;\n } else if (kind === 4 /* SETTER */) {\n desc.set = value;\n }\n\n if (isPrivate) {\n if (kind === 1 /* ACCESSOR */) {\n ret.push(function (instance, args) {\n return value.get.call(instance, args);\n });\n ret.push(function (instance, args) {\n return value.set.call(instance, args);\n });\n } else if (kind === 2 /* METHOD */) {\n ret.push(value);\n } else {\n ret.push(function (instance, args) {\n return value.call(instance, args);\n });\n }\n } else {\n Object.defineProperty(base, name, desc);\n }\n }\n }\n\n function applyMemberDecs(Class, decInfos) {\n var ret = [];\n var protoInitializers;\n var staticInitializers;\n\n var existingProtoNonFields = new Map();\n var existingStaticNonFields = new Map();\n\n for (var i = 0; i < decInfos.length; i++) {\n var decInfo = decInfos[i];\n\n // skip computed property names\n if (!Array.isArray(decInfo)) continue;\n\n var kind = decInfo[1];\n var name = decInfo[2];\n var isPrivate = decInfo.length > 3;\n\n var isStatic = kind >= 5; /* STATIC */\n var base;\n var initializers;\n\n if (isStatic) {\n base = Class;\n kind = kind - 5 /* STATIC */;\n // initialize staticInitializers when we see a non-field static member\n if (kind !== 0 /* FIELD */) {\n staticInitializers = staticInitializers || [];\n initializers = staticInitializers;\n }\n } else {\n base = Class.prototype;\n // initialize protoInitializers when we see a non-field member\n if (kind !== 0 /* FIELD */) {\n protoInitializers = protoInitializers || [];\n initializers = protoInitializers;\n }\n }\n\n if (kind !== 0 /* FIELD */ && !isPrivate) {\n var existingNonFields = isStatic\n ? existingStaticNonFields\n : existingProtoNonFields;\n\n var existingKind = existingNonFields.get(name) || 0;\n\n if (\n existingKind === true ||\n (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ ||\n (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */\n ) {\n throw new Error(\n \"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \" +\n name,\n );\n } else if (!existingKind && kind > 2 /* METHOD */) {\n existingNonFields.set(name, kind);\n } else {\n existingNonFields.set(name, true);\n }\n }\n\n applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n initializers,\n );\n }\n\n pushInitializers(ret, protoInitializers);\n pushInitializers(ret, staticInitializers);\n return ret;\n }\n\n function pushInitializers(ret, initializers) {\n if (initializers) {\n ret.push(function (instance) {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(instance);\n }\n return instance;\n });\n }\n }\n\n function applyClassDecs(targetClass, classDecs) {\n if (classDecs.length > 0) {\n var initializers = [];\n var newClass = targetClass;\n var name = targetClass.name;\n\n for (var i = classDecs.length - 1; i >= 0; i--) {\n var decoratorFinishedRef = { v: false };\n\n try {\n var nextNewClass = classDecs[i](newClass, {\n kind: \"class\",\n name: name,\n addInitializer: createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n ),\n });\n } finally {\n decoratorFinishedRef.v = true;\n }\n\n if (nextNewClass !== undefined) {\n assertValidReturnValue(10 /* CLASS */, nextNewClass);\n newClass = nextNewClass;\n }\n }\n\n return [\n newClass,\n function () {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(newClass);\n }\n },\n ];\n }\n // The transformer will not emit assignment when there are no class decorators,\n // so we don't have to return an empty array here.\n }\n\n /**\n Basic usage:\n\n applyDecs(\n Class,\n [\n // member decorators\n [\n dec, // dec or array of decs\n 0, // kind of value being decorated\n 'prop', // name of public prop on class containing the value being decorated,\n '#p', // the name of the private property (if is private, void 0 otherwise),\n ]\n ],\n [\n // class decorators\n dec1, dec2\n ]\n )\n ```\n\n Fully transpiled example:\n\n ```js\n @dec\n class Class {\n @dec\n a = 123;\n\n @dec\n #a = 123;\n\n @dec\n @dec2\n accessor b = 123;\n\n @dec\n accessor #b = 123;\n\n @dec\n c() { console.log('c'); }\n\n @dec\n #c() { console.log('privC'); }\n\n @dec\n get d() { console.log('d'); }\n\n @dec\n get #d() { console.log('privD'); }\n\n @dec\n set e(v) { console.log('e'); }\n\n @dec\n set #e(v) { console.log('privE'); }\n }\n\n\n // becomes\n let initializeInstance;\n let initializeClass;\n\n let initA;\n let initPrivA;\n\n let initB;\n let initPrivB, getPrivB, setPrivB;\n\n let privC;\n let privD;\n let privE;\n\n let Class;\n class _Class {\n static {\n let ret = applyDecs(\n this,\n [\n [dec, 0, 'a'],\n [dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],\n [[dec, dec2], 1, 'b'],\n [dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],\n [dec, 2, 'c'],\n [dec, 2, 'c', () => console.log('privC')],\n [dec, 3, 'd'],\n [dec, 3, 'd', () => console.log('privD')],\n [dec, 4, 'e'],\n [dec, 4, 'e', () => console.log('privE')],\n ],\n [\n dec\n ]\n )\n\n initA = ret[0];\n\n initPrivA = ret[1];\n\n initB = ret[2];\n\n initPrivB = ret[3];\n getPrivB = ret[4];\n setPrivB = ret[5];\n\n privC = ret[6];\n\n privD = ret[7];\n\n privE = ret[8];\n\n initializeInstance = ret[9];\n\n Class = ret[10]\n\n initializeClass = ret[11];\n }\n\n a = (initializeInstance(this), initA(this, 123));\n\n #a = initPrivA(this, 123);\n\n #bData = initB(this, 123);\n get b() { return this.#bData }\n set b(v) { this.#bData = v }\n\n #privBData = initPrivB(this, 123);\n get #b() { return getPrivB(this); }\n set #b(v) { setPrivB(this, v); }\n\n c() { console.log('c'); }\n\n #c(...args) { return privC(this, ...args) }\n\n get d() { console.log('d'); }\n\n get #d() { return privD(this); }\n\n set e(v) { console.log('e'); }\n\n set #e(v) { privE(this, v); }\n }\n\n initializeClass(Class);\n */\n\n return function applyDecs2203R(targetClass, memberDecs, classDecs) {\n return {\n e: applyMemberDecs(targetClass, memberDecs),\n // Lazily apply class decorations so that member init locals can be properly bound.\n get c() {\n return applyClassDecs(targetClass, classDecs);\n },\n };\n };\n}\n\nexport default function applyDecs2203R(targetClass, memberDecs, classDecs) {\n return (applyDecs2203R = applyDecs2203RFactory())(\n targetClass,\n memberDecs,\n classDecs,\n );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAoBA,SAASE,qBAAqBA,CAAA,EAAG;EAC/B,SAASC,0BAA0BA,CAACC,YAAY,EAAEC,oBAAoB,EAAE;IACtE,OAAO,SAASC,cAAcA,CAACC,WAAW,EAAE;MAC1CC,iB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QACV,KAAK,IAAIzB,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG5C,YAAY,CAAC6C,MAAM,EAAED,CAAC,EAAE,EAAE;UAC5C5C,YAAY,CAAC4C,CAAC,CAAC,CAACrB,IAAI,CAAC8C,QAAQ,CAAC;QAChC;MACF,CAAC,CACF;IACH;EAGF;EAoJA,OAAO,SAASE,cAAcA,CAACJ,WAAW,EAAEK,UAAU,EAAEJ,SAAS,EAAE;IACjE,OAAO;MACLK,CAAC,EAAErB,eAAe,CAACe,WAAW,EAAEK,UAAU,CAAC;MAE3C,IAAIE,CAACA,CAAA,EAAG;QACN,OAAOR,cAAc,CAACC,WAAW,EAAEC,SAAS,CAAC;MAC/C;IACF,CAAC;EACH,CAAC;AACH;AAEe,SAASG,cAAcA,CAACJ,WAAW,EAAEK,UAAU,EAAEJ,SAAS,EAAE;EACzE,OAAO,CAAAO,OAAA,CAAAC,OAAA,GAACL,cAAc,GAAGzE,qBAAqB,CAAC,CAAC,EAC9CqE,WAAW,EACXK,UAAU,EACVJ,SACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2301.js b/node_modules/@babel/helpers/lib/helpers/applyDecs2301.js new file mode 100644 index 0000000..aebfbff --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2301.js @@ -0,0 +1,421 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = applyDecs2301; +var _checkInRHS = require("checkInRHS"); +var _setFunctionName = require("setFunctionName"); +var _toPropertyKey = require("toPropertyKey"); +function applyDecs2301Factory() { + function createAddInitializerMethod(initializers, decoratorFinishedRef) { + return function addInitializer(initializer) { + assertNotFinished(decoratorFinishedRef, "addInitializer"); + assertCallable(initializer, "An initializer"); + initializers.push(initializer); + }; + } + function assertInstanceIfPrivate(has, target) { + if (!has(target)) { + throw new TypeError("Attempted to access private element on non-instance"); + } + } + function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand) { + var kindStr; + switch (kind) { + case 1: + kindStr = "accessor"; + break; + case 2: + kindStr = "method"; + break; + case 3: + kindStr = "getter"; + break; + case 4: + kindStr = "setter"; + break; + default: + kindStr = "field"; + } + var ctx = { + kind: kindStr, + name: isPrivate ? "#" + name : _toPropertyKey(name), + static: isStatic, + private: isPrivate + }; + var decoratorFinishedRef = { + v: false + }; + if (kind !== 0) { + ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef); + } + var get, set; + if (!isPrivate && (kind === 0 || kind === 2)) { + get = function (target) { + return target[name]; + }; + if (kind === 0) { + set = function (target, v) { + target[name] = v; + }; + } + } else if (kind === 2) { + get = function (target) { + assertInstanceIfPrivate(hasPrivateBrand, target); + return desc.value; + }; + } else { + var t = kind === 0 || kind === 1; + if (t || kind === 3) { + if (isPrivate) { + get = function (target) { + assertInstanceIfPrivate(hasPrivateBrand, target); + return desc.get.call(target); + }; + } else { + get = function (target) { + return desc.get.call(target); + }; + } + } + if (t || kind === 4) { + if (isPrivate) { + set = function (target, value) { + assertInstanceIfPrivate(hasPrivateBrand, target); + desc.set.call(target, value); + }; + } else { + set = function (target, value) { + desc.set.call(target, value); + }; + } + } + } + var has = isPrivate ? hasPrivateBrand.bind() : function (target) { + return name in target; + }; + ctx.access = get && set ? { + get: get, + set: set, + has: has + } : get ? { + get: get, + has: has + } : { + set: set, + has: has + }; + try { + return dec(value, ctx); + } finally { + decoratorFinishedRef.v = true; + } + } + function assertNotFinished(decoratorFinishedRef, fnName) { + if (decoratorFinishedRef.v) { + throw new Error("attempted to call " + fnName + " after decoration was finished"); + } + } + function assertCallable(fn, hint) { + if (typeof fn !== "function") { + throw new TypeError(hint + " must be a function"); + } + } + function assertValidReturnValue(kind, value) { + var type = typeof value; + if (kind === 1) { + if (type !== "object" || value === null) { + throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + } + if (value.get !== undefined) { + assertCallable(value.get, "accessor.get"); + } + if (value.set !== undefined) { + assertCallable(value.set, "accessor.set"); + } + if (value.init !== undefined) { + assertCallable(value.init, "accessor.init"); + } + } else if (type !== "function") { + var hint; + if (kind === 0) { + hint = "field"; + } else if (kind === 10) { + hint = "class"; + } else { + hint = "method"; + } + throw new TypeError(hint + " decorators must return a function or void 0"); + } + } + function curryThis1(fn) { + return function () { + return fn(this); + }; + } + function curryThis2(fn) { + return function (value) { + fn(this, value); + }; + } + function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand) { + var decs = decInfo[0]; + var desc, init, prefix, value; + if (isPrivate) { + if (kind === 0 || kind === 1) { + desc = { + get: curryThis1(decInfo[3]), + set: curryThis2(decInfo[4]) + }; + prefix = "get"; + } else { + if (kind === 3) { + desc = { + get: decInfo[3] + }; + prefix = "get"; + } else if (kind === 4) { + desc = { + set: decInfo[3] + }; + prefix = "set"; + } else { + desc = { + value: decInfo[3] + }; + } + } + if (kind !== 0) { + if (kind === 1) { + _setFunctionName(desc.set, "#" + name, "set"); + } + _setFunctionName(desc[prefix || "value"], "#" + name, prefix); + } + } else if (kind !== 0) { + desc = Object.getOwnPropertyDescriptor(base, name); + } + if (kind === 1) { + value = { + get: desc.get, + set: desc.set + }; + } else if (kind === 2) { + value = desc.value; + } else if (kind === 3) { + value = desc.get; + } else if (kind === 4) { + value = desc.set; + } + var newValue, get, set; + if (typeof decs === "function") { + newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand); + if (newValue !== void 0) { + assertValidReturnValue(kind, newValue); + if (kind === 0) { + init = newValue; + } else if (kind === 1) { + init = newValue.init; + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + } + } else { + for (var i = decs.length - 1; i >= 0; i--) { + var dec = decs[i]; + newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand); + if (newValue !== void 0) { + assertValidReturnValue(kind, newValue); + var newInit; + if (kind === 0) { + newInit = newValue; + } else if (kind === 1) { + newInit = newValue.init; + get = newValue.get || value.get; + set = newValue.set || value.set; + value = { + get: get, + set: set + }; + } else { + value = newValue; + } + if (newInit !== void 0) { + if (init === void 0) { + init = newInit; + } else if (typeof init === "function") { + init = [init, newInit]; + } else { + init.push(newInit); + } + } + } + } + } + if (kind === 0 || kind === 1) { + if (init === void 0) { + init = function (instance, init) { + return init; + }; + } else if (typeof init !== "function") { + var ownInitializers = init; + init = function (instance, init) { + var value = init; + for (var i = 0; i < ownInitializers.length; i++) { + value = ownInitializers[i].call(instance, value); + } + return value; + }; + } else { + var originalInitializer = init; + init = function (instance, init) { + return originalInitializer.call(instance, init); + }; + } + ret.push(init); + } + if (kind !== 0) { + if (kind === 1) { + desc.get = value.get; + desc.set = value.set; + } else if (kind === 2) { + desc.value = value; + } else if (kind === 3) { + desc.get = value; + } else if (kind === 4) { + desc.set = value; + } + if (isPrivate) { + if (kind === 1) { + ret.push(function (instance, args) { + return value.get.call(instance, args); + }); + ret.push(function (instance, args) { + return value.set.call(instance, args); + }); + } else if (kind === 2) { + ret.push(value); + } else { + ret.push(function (instance, args) { + return value.call(instance, args); + }); + } + } else { + Object.defineProperty(base, name, desc); + } + } + } + function applyMemberDecs(Class, decInfos, instanceBrand) { + var ret = []; + var protoInitializers; + var staticInitializers; + var staticBrand; + var existingProtoNonFields = new Map(); + var existingStaticNonFields = new Map(); + for (var i = 0; i < decInfos.length; i++) { + var decInfo = decInfos[i]; + if (!Array.isArray(decInfo)) continue; + var kind = decInfo[1]; + var name = decInfo[2]; + var isPrivate = decInfo.length > 3; + var isStatic = kind >= 5; + var base; + var initializers; + var hasPrivateBrand = instanceBrand; + if (isStatic) { + base = Class; + kind = kind - 5; + if (kind !== 0) { + staticInitializers = staticInitializers || []; + initializers = staticInitializers; + } + if (isPrivate && !staticBrand) { + staticBrand = function (_) { + return _checkInRHS(_) === Class; + }; + } + hasPrivateBrand = staticBrand; + } else { + base = Class.prototype; + if (kind !== 0) { + protoInitializers = protoInitializers || []; + initializers = protoInitializers; + } + } + if (kind !== 0 && !isPrivate) { + var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields; + var existingKind = existingNonFields.get(name) || 0; + if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) { + throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name); + } else if (!existingKind && kind > 2) { + existingNonFields.set(name, kind); + } else { + existingNonFields.set(name, true); + } + } + applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand); + } + pushInitializers(ret, protoInitializers); + pushInitializers(ret, staticInitializers); + return ret; + } + function pushInitializers(ret, initializers) { + if (initializers) { + ret.push(function (instance) { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(instance); + } + return instance; + }); + } + } + function applyClassDecs(targetClass, classDecs) { + if (classDecs.length > 0) { + var initializers = []; + var newClass = targetClass; + var name = targetClass.name; + for (var i = classDecs.length - 1; i >= 0; i--) { + var decoratorFinishedRef = { + v: false + }; + try { + var nextNewClass = classDecs[i](newClass, { + kind: "class", + name: name, + addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef) + }); + } finally { + decoratorFinishedRef.v = true; + } + if (nextNewClass !== undefined) { + assertValidReturnValue(10, nextNewClass); + newClass = nextNewClass; + } + } + return [newClass, function () { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(newClass); + } + }]; + } + } + return function applyDecs2301(targetClass, memberDecs, classDecs, instanceBrand) { + return { + e: applyMemberDecs(targetClass, memberDecs, instanceBrand), + get c() { + return applyClassDecs(targetClass, classDecs); + } + }; + }; +} +function applyDecs2301(targetClass, memberDecs, classDecs, instanceBrand) { + return (exports.default = applyDecs2301 = applyDecs2301Factory())(targetClass, memberDecs, classDecs, instanceBrand); +} + +//# sourceMappingURL=applyDecs2301.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2301.js.map b/node_modules/@babel/helpers/lib/helpers/applyDecs2301.js.map new file mode 100644 index 0000000..c493a71 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2301.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_checkInRHS","require","_setFunctionName","_toPropertyKey","applyDecs2301Factory","createAddInitializerMethod","initializers","decoratorFinishedRef","addInitializer","initializer","assertNotFinished","assertCallable","push","assertInstanceIfPrivate","has","target","TypeError","memberDec","dec","name","desc","kind","isStatic","isPrivate","value","hasPrivateBrand","kindStr","ctx","toPropertyKey","static","private","v","get","set","t","call","bind","access","fnName","Error","fn","hint","assertValidReturnValue","type","undefined","init","curryThis1","curryThis2","applyMemberDec","ret","base","decInfo","decs","prefix","setFunctionName","Object","getOwnPropertyDescriptor","newValue","i","length","newInit","instance","ownInitializers","originalInitializer","args","defineProperty","applyMemberDecs","Class","decInfos","instanceBrand","protoInitializers","staticInitializers","staticBrand","existingProtoNonFields","Map","existingStaticNonFields","Array","isArray","_","checkInRHS","prototype","existingNonFields","existingKind","pushInitializers","applyClassDecs","targetClass","classDecs","newClass","nextNewClass","applyDecs2301","memberDecs","e","c","exports","default"],"sources":["../../src/helpers/applyDecs2301.js"],"sourcesContent":["/* @minVersion 7.21.0 */\n/* @onlyBabel7 */\n\nimport checkInRHS from \"checkInRHS\";\nimport setFunctionName from \"setFunctionName\";\nimport toPropertyKey from \"toPropertyKey\";\n\n/**\n Enums are used in this file, but not assigned to vars to avoid non-hoistable values\n\n CONSTRUCTOR = 0;\n PUBLIC = 1;\n PRIVATE = 2;\n\n FIELD = 0;\n ACCESSOR = 1;\n METHOD = 2;\n GETTER = 3;\n SETTER = 4;\n\n STATIC = 5;\n\n CLASS = 10; // only used in assertValidReturnValue\n*/\n\nfunction applyDecs2301Factory() {\n function createAddInitializerMethod(initializers, decoratorFinishedRef) {\n return function addInitializer(initializer) {\n assertNotFinished(decoratorFinishedRef, \"addInitializer\");\n assertCallable(initializer, \"An initializer\");\n initializers.push(initializer);\n };\n }\n\n function assertInstanceIfPrivate(has, target) {\n if (!has(target)) {\n throw new TypeError(\n \"Attempted to access private element on non-instance\",\n );\n }\n }\n\n function memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n hasPrivateBrand,\n ) {\n var kindStr;\n\n switch (kind) {\n case 1 /* ACCESSOR */:\n kindStr = \"accessor\";\n break;\n case 2 /* METHOD */:\n kindStr = \"method\";\n break;\n case 3 /* GETTER */:\n kindStr = \"getter\";\n break;\n case 4 /* SETTER */:\n kindStr = \"setter\";\n break;\n default:\n kindStr = \"field\";\n }\n\n var ctx = {\n kind: kindStr,\n name: isPrivate ? \"#\" + name : toPropertyKey(name),\n static: isStatic,\n private: isPrivate,\n };\n\n var decoratorFinishedRef = { v: false };\n\n if (kind !== 0 /* FIELD */) {\n ctx.addInitializer = createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n );\n }\n\n var get, set;\n if (!isPrivate && (kind === 0 /* FIELD */ || kind === 2) /* METHOD */) {\n get = function (target) {\n return target[name];\n };\n if (kind === 0 /* FIELD */) {\n set = function (target, v) {\n target[name] = v;\n };\n }\n } else if (kind === 2 /* METHOD */) {\n // Assert: isPrivate is true.\n get = function (target) {\n assertInstanceIfPrivate(hasPrivateBrand, target);\n return desc.value;\n };\n } else {\n // Assert: If kind === 0, then isPrivate is true.\n var t = kind === 0 /* FIELD */ || kind === 1; /* ACCESSOR */\n if (t || kind === 3 /* GETTER */) {\n if (isPrivate) {\n get = function (target) {\n assertInstanceIfPrivate(hasPrivateBrand, target);\n return desc.get.call(target);\n };\n } else {\n get = function (target) {\n return desc.get.call(target);\n };\n }\n }\n if (t || kind === 4 /* SETTER */) {\n if (isPrivate) {\n set = function (target, value) {\n assertInstanceIfPrivate(hasPrivateBrand, target);\n desc.set.call(target, value);\n };\n } else {\n set = function (target, value) {\n desc.set.call(target, value);\n };\n }\n }\n }\n var has = isPrivate\n ? hasPrivateBrand.bind()\n : function (target) {\n return name in target;\n };\n ctx.access =\n get && set\n ? { get: get, set: set, has: has }\n : get\n ? { get: get, has: has }\n : { set: set, has: has };\n\n try {\n return dec(value, ctx);\n } finally {\n decoratorFinishedRef.v = true;\n }\n }\n\n function assertNotFinished(decoratorFinishedRef, fnName) {\n if (decoratorFinishedRef.v) {\n throw new Error(\n \"attempted to call \" + fnName + \" after decoration was finished\",\n );\n }\n }\n\n function assertCallable(fn, hint) {\n if (typeof fn !== \"function\") {\n throw new TypeError(hint + \" must be a function\");\n }\n }\n\n function assertValidReturnValue(kind, value) {\n var type = typeof value;\n\n if (kind === 1 /* ACCESSOR */) {\n if (type !== \"object\" || value === null) {\n throw new TypeError(\n \"accessor decorators must return an object with get, set, or init properties or void 0\",\n );\n }\n if (value.get !== undefined) {\n assertCallable(value.get, \"accessor.get\");\n }\n if (value.set !== undefined) {\n assertCallable(value.set, \"accessor.set\");\n }\n if (value.init !== undefined) {\n assertCallable(value.init, \"accessor.init\");\n }\n } else if (type !== \"function\") {\n var hint;\n if (kind === 0 /* FIELD */) {\n hint = \"field\";\n } else if (kind === 10 /* CLASS */) {\n hint = \"class\";\n } else {\n hint = \"method\";\n }\n throw new TypeError(\n hint + \" decorators must return a function or void 0\",\n );\n }\n }\n\n function curryThis1(fn) {\n return function () {\n return fn(this);\n };\n }\n function curryThis2(fn) {\n return function (value) {\n fn(this, value);\n };\n }\n\n function applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n initializers,\n hasPrivateBrand,\n ) {\n var decs = decInfo[0];\n\n var desc, init, prefix, value;\n\n if (isPrivate) {\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n desc = {\n get: curryThis1(decInfo[3]),\n set: curryThis2(decInfo[4]),\n };\n prefix = \"get\";\n } else {\n if (kind === 3 /* GETTER */) {\n desc = {\n get: decInfo[3],\n };\n prefix = \"get\";\n } else if (kind === 4 /* SETTER */) {\n desc = {\n set: decInfo[3],\n };\n prefix = \"set\";\n } else {\n desc = {\n value: decInfo[3],\n };\n }\n }\n if (kind !== 0 /* FIELD */) {\n if (kind === 1 /* ACCESSOR */) {\n setFunctionName(desc.set, \"#\" + name, \"set\");\n }\n setFunctionName(desc[prefix || \"value\"], \"#\" + name, prefix);\n }\n } else if (kind !== 0 /* FIELD */) {\n desc = Object.getOwnPropertyDescriptor(base, name);\n }\n\n if (kind === 1 /* ACCESSOR */) {\n value = {\n get: desc.get,\n set: desc.set,\n };\n } else if (kind === 2 /* METHOD */) {\n value = desc.value;\n } else if (kind === 3 /* GETTER */) {\n value = desc.get;\n } else if (kind === 4 /* SETTER */) {\n value = desc.set;\n }\n\n var newValue, get, set;\n\n if (typeof decs === \"function\") {\n newValue = memberDec(\n decs,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n hasPrivateBrand,\n );\n\n if (newValue !== void 0) {\n assertValidReturnValue(kind, newValue);\n\n if (kind === 0 /* FIELD */) {\n init = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n init = newValue.init;\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n }\n } else {\n for (var i = decs.length - 1; i >= 0; i--) {\n var dec = decs[i];\n\n newValue = memberDec(\n dec,\n name,\n desc,\n initializers,\n kind,\n isStatic,\n isPrivate,\n value,\n hasPrivateBrand,\n );\n\n if (newValue !== void 0) {\n assertValidReturnValue(kind, newValue);\n var newInit;\n\n if (kind === 0 /* FIELD */) {\n newInit = newValue;\n } else if (kind === 1 /* ACCESSOR */) {\n newInit = newValue.init;\n get = newValue.get || value.get;\n set = newValue.set || value.set;\n\n value = { get: get, set: set };\n } else {\n value = newValue;\n }\n\n if (newInit !== void 0) {\n if (init === void 0) {\n init = newInit;\n } else if (typeof init === \"function\") {\n init = [init, newInit];\n } else {\n init.push(newInit);\n }\n }\n }\n }\n }\n\n if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {\n if (init === void 0) {\n // If the initializer was void 0, sub in a dummy initializer\n init = function (instance, init) {\n return init;\n };\n } else if (typeof init !== \"function\") {\n var ownInitializers = init;\n\n init = function (instance, init) {\n var value = init;\n\n for (var i = 0; i < ownInitializers.length; i++) {\n value = ownInitializers[i].call(instance, value);\n }\n\n return value;\n };\n } else {\n var originalInitializer = init;\n\n init = function (instance, init) {\n return originalInitializer.call(instance, init);\n };\n }\n\n ret.push(init);\n }\n\n if (kind !== 0 /* FIELD */) {\n if (kind === 1 /* ACCESSOR */) {\n desc.get = value.get;\n desc.set = value.set;\n } else if (kind === 2 /* METHOD */) {\n desc.value = value;\n } else if (kind === 3 /* GETTER */) {\n desc.get = value;\n } else if (kind === 4 /* SETTER */) {\n desc.set = value;\n }\n\n if (isPrivate) {\n if (kind === 1 /* ACCESSOR */) {\n ret.push(function (instance, args) {\n return value.get.call(instance, args);\n });\n ret.push(function (instance, args) {\n return value.set.call(instance, args);\n });\n } else if (kind === 2 /* METHOD */) {\n ret.push(value);\n } else {\n ret.push(function (instance, args) {\n return value.call(instance, args);\n });\n }\n } else {\n Object.defineProperty(base, name, desc);\n }\n }\n }\n\n function applyMemberDecs(Class, decInfos, instanceBrand) {\n var ret = [];\n var protoInitializers;\n var staticInitializers;\n var staticBrand;\n\n var existingProtoNonFields = new Map();\n var existingStaticNonFields = new Map();\n\n for (var i = 0; i < decInfos.length; i++) {\n var decInfo = decInfos[i];\n\n // skip computed property names\n if (!Array.isArray(decInfo)) continue;\n\n var kind = decInfo[1];\n var name = decInfo[2];\n var isPrivate = decInfo.length > 3;\n\n var isStatic = kind >= 5; /* STATIC */\n var base;\n var initializers;\n var hasPrivateBrand = instanceBrand;\n\n if (isStatic) {\n base = Class;\n kind = kind - 5 /* STATIC */;\n // initialize staticInitializers when we see a non-field static member\n if (kind !== 0 /* FIELD */) {\n staticInitializers = staticInitializers || [];\n initializers = staticInitializers;\n }\n if (isPrivate && !staticBrand) {\n staticBrand = function (_) {\n return checkInRHS(_) === Class;\n };\n }\n hasPrivateBrand = staticBrand;\n } else {\n base = Class.prototype;\n // initialize protoInitializers when we see a non-field member\n if (kind !== 0 /* FIELD */) {\n protoInitializers = protoInitializers || [];\n initializers = protoInitializers;\n }\n }\n\n if (kind !== 0 /* FIELD */ && !isPrivate) {\n var existingNonFields = isStatic\n ? existingStaticNonFields\n : existingProtoNonFields;\n\n var existingKind = existingNonFields.get(name) || 0;\n\n if (\n existingKind === true ||\n (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ ||\n (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */\n ) {\n throw new Error(\n \"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \" +\n name,\n );\n } else if (!existingKind && kind > 2 /* METHOD */) {\n existingNonFields.set(name, kind);\n } else {\n existingNonFields.set(name, true);\n }\n }\n\n applyMemberDec(\n ret,\n base,\n decInfo,\n name,\n kind,\n isStatic,\n isPrivate,\n initializers,\n hasPrivateBrand,\n );\n }\n\n pushInitializers(ret, protoInitializers);\n pushInitializers(ret, staticInitializers);\n return ret;\n }\n\n function pushInitializers(ret, initializers) {\n if (initializers) {\n ret.push(function (instance) {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(instance);\n }\n return instance;\n });\n }\n }\n\n function applyClassDecs(targetClass, classDecs) {\n if (classDecs.length > 0) {\n var initializers = [];\n var newClass = targetClass;\n var name = targetClass.name;\n\n for (var i = classDecs.length - 1; i >= 0; i--) {\n var decoratorFinishedRef = { v: false };\n\n try {\n var nextNewClass = classDecs[i](newClass, {\n kind: \"class\",\n name: name,\n addInitializer: createAddInitializerMethod(\n initializers,\n decoratorFinishedRef,\n ),\n });\n } finally {\n decoratorFinishedRef.v = true;\n }\n\n if (nextNewClass !== undefined) {\n assertValidReturnValue(10 /* CLASS */, nextNewClass);\n newClass = nextNewClass;\n }\n }\n\n return [\n newClass,\n function () {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(newClass);\n }\n },\n ];\n }\n // The transformer will not emit assignment when there are no class decorators,\n // so we don't have to return an empty array here.\n }\n\n /**\n Basic usage:\n\n applyDecs(\n Class,\n [\n // member decorators\n [\n dec, // dec or array of decs\n 0, // kind of value being decorated\n 'prop', // name of public prop on class containing the value being decorated,\n '#p', // the name of the private property (if is private, void 0 otherwise),\n ]\n ],\n [\n // class decorators\n dec1, dec2\n ]\n )\n ```\n\n Fully transpiled example:\n\n ```js\n @dec\n class Class {\n @dec\n a = 123;\n\n @dec\n #a = 123;\n\n @dec\n @dec2\n accessor b = 123;\n\n @dec\n accessor #b = 123;\n\n @dec\n c() { console.log('c'); }\n\n @dec\n #c() { console.log('privC'); }\n\n @dec\n get d() { console.log('d'); }\n\n @dec\n get #d() { console.log('privD'); }\n\n @dec\n set e(v) { console.log('e'); }\n\n @dec\n set #e(v) { console.log('privE'); }\n }\n\n\n // becomes\n let initializeInstance;\n let initializeClass;\n\n let initA;\n let initPrivA;\n\n let initB;\n let initPrivB, getPrivB, setPrivB;\n\n let privC;\n let privD;\n let privE;\n\n let Class;\n class _Class {\n static {\n let ret = applyDecs(\n this,\n [\n [dec, 0, 'a'],\n [dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],\n [[dec, dec2], 1, 'b'],\n [dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],\n [dec, 2, 'c'],\n [dec, 2, 'c', () => console.log('privC')],\n [dec, 3, 'd'],\n [dec, 3, 'd', () => console.log('privD')],\n [dec, 4, 'e'],\n [dec, 4, 'e', () => console.log('privE')],\n ],\n [\n dec\n ]\n )\n\n initA = ret[0];\n\n initPrivA = ret[1];\n\n initB = ret[2];\n\n initPrivB = ret[3];\n getPrivB = ret[4];\n setPrivB = ret[5];\n\n privC = ret[6];\n\n privD = ret[7];\n\n privE = ret[8];\n\n initializeInstance = ret[9];\n\n Class = ret[10]\n\n initializeClass = ret[11];\n }\n\n a = (initializeInstance(this), initA(this, 123));\n\n #a = initPrivA(this, 123);\n\n #bData = initB(this, 123);\n get b() { return this.#bData }\n set b(v) { this.#bData = v }\n\n #privBData = initPrivB(this, 123);\n get #b() { return getPrivB(this); }\n set #b(v) { setPrivB(this, v); }\n\n c() { console.log('c'); }\n\n #c(...args) { return privC(this, ...args) }\n\n get d() { console.log('d'); }\n\n get #d() { return privD(this); }\n\n set e(v) { console.log('e'); }\n\n set #e(v) { privE(this, v); }\n }\n\n initializeClass(Class);\n */\n return function applyDecs2301(\n targetClass,\n memberDecs,\n classDecs,\n instanceBrand,\n ) {\n return {\n e: applyMemberDecs(targetClass, memberDecs, instanceBrand),\n // Lazily apply class decorations so that member init locals can be properly bound.\n get c() {\n return applyClassDecs(targetClass, classDecs);\n },\n };\n };\n}\n\nexport default function applyDecs2301(\n targetClass,\n memberDecs,\n classDecs,\n instanceBrand,\n) {\n return (applyDecs2301 = applyDecs2301Factory())(\n targetClass,\n memberDecs,\n classDecs,\n instanceBrand,\n );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAoBA,SAASG,oBAAoBA,CAAA,EAAG;EAC9B,SAASC,0BAA0BA,CAACC,YAAY,EAAEC,oBAAoB,EAAE;IACtE,OAAO,SAASC,cAAcA,CAACC,WAAW,EAAE;MAC1CC,iBAAiB,CAACH,oBAAoB,EAAE,gBAAgB,CAAC;MACzDI,cAAc,CAACF,WAAW,EAAE,gBAAgB,CAAC;MAC7CH,YAAY,CAACM,IAAI,CAACH,WAAW,CAAC;IAChC,CAAC;EACH;EAEA,SAASI,uBAAuBA,CAACC,GAAG,EAAEC,MAAM,EAAE;IAC5C,IAAI,CAACD,GAAG,CAACC,MAAM,CAAC,EAAE;MAChB,MAAM,IAAIC,SAAS,CACjB,qDACF,CAAC;IACH;EACF;EAEA,SAASC,SAASA,CAChBC,GAAG,EACHC,IAAI,EACJC,IAAI,EACJd,YAAY,EACZe,IAAI,EACJC,QAAQ,EACRC,SAAS,EACTC,KAA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AAGpD,YAAY,CAACqD,MAAM,EAAED,CAAC,EAAE,EAAE;UAC5CpD,YAAY,CAACoD,CAAC,CAAC,CAACvB,IAAI,CAACoD,QAAQ,CAAC;QAChC;MACF,CAAC,CACF;IACH;EAGF;EAmJA,OAAO,SAASE,aAAaA,CAC3BJ,WAAW,EACXK,UAAU,EACVJ,SAAS,EACTjB,aAAa,EACb;IACA,OAAO;MACLsB,CAAC,EAAEzB,eAAe,CAACmB,WAAW,EAAEK,UAAU,EAAErB,aAAa,CAAC;MAE1D,IAAIuB,CAACA,CAAA,EAAG;QACN,OAAOR,cAAc,CAACC,WAAW,EAAEC,SAAS,CAAC;MAC/C;IACF,CAAC;EACH,CAAC;AACH;AAEe,SAASG,aAAaA,CACnCJ,WAAW,EACXK,UAAU,EACVJ,SAAS,EACTjB,aAAa,EACb;EACA,OAAO,CAAAwB,OAAA,CAAAC,OAAA,GAACL,aAAa,GAAGrF,oBAAoB,CAAC,CAAC,EAC5CiF,WAAW,EACXK,UAAU,EACVJ,SAAS,EACTjB,aACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js b/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js new file mode 100644 index 0000000..d2940ae --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js @@ -0,0 +1,235 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = applyDecs2305; +var _checkInRHS = require("./checkInRHS.js"); +var _setFunctionName = require("./setFunctionName.js"); +var _toPropertyKey = require("./toPropertyKey.js"); +function applyDecs2305(targetClass, memberDecs, classDecs, classDecsHaveThis, instanceBrand, parentClass) { + function _bindPropCall(obj, name, before) { + return function (_this, value) { + if (before) { + before(_this); + } + return obj[name].call(_this, value); + }; + } + function runInitializers(initializers, value) { + for (var i = 0; i < initializers.length; i++) { + initializers[i].call(value); + } + return value; + } + function assertCallable(fn, hint1, hint2, throwUndefined) { + if (typeof fn !== "function") { + if (throwUndefined || fn !== void 0) { + throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined")); + } + } + return fn; + } + function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, metadata, initializers, ret, isStatic, isPrivate, isField, isAccessor, hasPrivateBrand) { + function assertInstanceIfPrivate(target) { + if (!hasPrivateBrand(target)) { + throw new TypeError("Attempted to access private element on non-instance"); + } + } + var decs = decInfo[0], + decVal = decInfo[3], + _, + isClass = !ret; + if (!isClass) { + if (!decoratorsHaveThis && !Array.isArray(decs)) { + decs = [decs]; + } + var desc = {}, + init = [], + key = kind === 3 ? "get" : kind === 4 || isAccessor ? "set" : "value"; + if (isPrivate) { + if (isField || isAccessor) { + desc = { + get: (0, _setFunctionName.default)(function () { + return decVal(this); + }, name, "get"), + set: function (value) { + decInfo[4](this, value); + } + }; + } else { + desc[key] = decVal; + } + if (!isField) { + (0, _setFunctionName.default)(desc[key], name, kind === 2 ? "" : key); + } + } else if (!isField) { + desc = Object.getOwnPropertyDescriptor(Class, name); + } + } + var newValue = Class; + for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) { + var dec = decs[i], + decThis = decoratorsHaveThis ? decs[i - 1] : void 0; + var decoratorFinishedRef = {}; + var ctx = { + kind: ["field", "accessor", "method", "getter", "setter", "class"][kind], + name: name, + metadata: metadata, + addInitializer: function (decoratorFinishedRef, initializer) { + if (decoratorFinishedRef.v) { + throw new Error("attempted to call addInitializer after decoration was finished"); + } + assertCallable(initializer, "An initializer", "be", true); + initializers.push(initializer); + }.bind(null, decoratorFinishedRef) + }; + try { + if (isClass) { + if (_ = assertCallable(dec.call(decThis, newValue, ctx), "class decorators", "return")) { + newValue = _; + } + } else { + ctx["static"] = isStatic; + ctx["private"] = isPrivate; + var get, set; + if (!isPrivate) { + get = function (target) { + return target[name]; + }; + if (kind < 2 || kind === 4) { + set = function (target, v) { + target[name] = v; + }; + } + } else if (kind === 2) { + get = function (_this) { + assertInstanceIfPrivate(_this); + return desc.value; + }; + } else { + if (kind < 4) { + get = _bindPropCall(desc, "get", assertInstanceIfPrivate); + } + if (kind !== 3) { + set = _bindPropCall(desc, "set", assertInstanceIfPrivate); + } + } + var access = ctx.access = { + has: isPrivate ? hasPrivateBrand.bind() : function (target) { + return name in target; + } + }; + if (get) access.get = get; + if (set) access.set = set; + newValue = dec.call(decThis, isAccessor ? { + get: desc.get, + set: desc.set + } : desc[key], ctx); + if (isAccessor) { + if (typeof newValue === "object" && newValue) { + if (_ = assertCallable(newValue.get, "accessor.get")) { + desc.get = _; + } + if (_ = assertCallable(newValue.set, "accessor.set")) { + desc.set = _; + } + if (_ = assertCallable(newValue.init, "accessor.init")) { + init.push(_); + } + } else if (newValue !== void 0) { + throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); + } + } else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) { + if (isField) { + init.push(newValue); + } else { + desc[key] = newValue; + } + } + } + } finally { + decoratorFinishedRef.v = true; + } + } + if (isField || isAccessor) { + ret.push(function (instance, value) { + for (var i = init.length - 1; i >= 0; i--) { + value = init[i].call(instance, value); + } + return value; + }); + } + if (!isField && !isClass) { + if (isPrivate) { + if (isAccessor) { + ret.push(_bindPropCall(desc, "get"), _bindPropCall(desc, "set")); + } else { + ret.push(kind === 2 ? desc[key] : _bindPropCall.call.bind(desc[key])); + } + } else { + Object.defineProperty(Class, name, desc); + } + } + return newValue; + } + function applyMemberDecs(Class, decInfos, instanceBrand, metadata) { + var ret = []; + var protoInitializers; + var staticInitializers; + var staticBrand = function (_) { + return (0, _checkInRHS.default)(_) === Class; + }; + var existingNonFields = new Map(); + function pushInitializers(initializers) { + if (initializers) { + ret.push(runInitializers.bind(null, initializers)); + } + } + for (var i = 0; i < decInfos.length; i++) { + var decInfo = decInfos[i]; + if (!Array.isArray(decInfo)) continue; + var kind = decInfo[1]; + var name = decInfo[2]; + var isPrivate = decInfo.length > 3; + var decoratorsHaveThis = kind & 16; + var isStatic = !!(kind & 8); + kind &= 7; + var isField = kind === 0; + var key = name + "/" + isStatic; + if (!isField && !isPrivate) { + var existingKind = existingNonFields.get(key); + if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) { + throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name); + } + existingNonFields.set(key, kind > 2 ? kind : true); + } + applyDec(isStatic ? Class : Class.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kind, metadata, isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, isStatic, isPrivate, isField, kind === 1, isStatic && isPrivate ? staticBrand : instanceBrand); + } + pushInitializers(protoInitializers); + pushInitializers(staticInitializers); + return ret; + } + function defineMetadata(Class, metadata) { + return Object.defineProperty(Class, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { + configurable: true, + enumerable: true, + value: metadata + }); + } + if (arguments.length >= 6) { + var parentMetadata = parentClass[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; + } + var metadata = Object.create(parentMetadata == null ? null : parentMetadata); + var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata); + if (!classDecs.length) defineMetadata(targetClass, metadata); + return { + e: e, + get c() { + var initializers = []; + return classDecs.length && [defineMetadata(applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, metadata, initializers), metadata), runInitializers.bind(null, initializers, targetClass)]; + } + }; +} + +//# sourceMappingURL=applyDecs2305.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js.map b/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js.map new file mode 100644 index 0000000..5950277 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2305.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_checkInRHS","require","_setFunctionName","_toPropertyKey","applyDecs2305","targetClass","memberDecs","classDecs","classDecsHaveThis","instanceBrand","parentClass","_bindPropCall","obj","name","before","_this","value","call","runInitializers","initializers","i","length","assertCallable","fn","hint1","hint2","throwUndefined","TypeError","applyDec","Class","decInfo","decoratorsHaveThis","kind","metadata","ret","isStatic","isPrivate","isField","isAccessor","hasPrivateBrand","assertInstanceIfPrivate","target","decs","decVal","_","isClass","Array","isArray","desc","init","key","get","setFunctionName","set","Object","getOwnPropertyDescriptor","newValue","dec","decThis","decoratorFinishedRef","ctx","addInitializer","initializer","v","Error","push","bind","access","has","instance","defineProperty","applyMemberDecs","decInfos","protoInitializers","staticInitializers","staticBrand","checkInRHS","existingNonFields","Map","pushInitializers","existingKind","prototype","toPropertyKey","defineMetadata","Symbol","configurable","enumerable","arguments","parentMetadata","create","e","c"],"sources":["../../src/helpers/applyDecs2305.ts"],"sourcesContent":["/* @minVersion 7.21.0 */\n/* @mangleFns */\n/* @onlyBabel7 */\n\nimport checkInRHS from \"./checkInRHS.ts\";\nimport setFunctionName from \"./setFunctionName.ts\";\nimport toPropertyKey from \"./toPropertyKey.ts\";\n\nconst enum PROP_KIND {\n FIELD = 0,\n ACCESSOR = 1,\n METHOD = 2,\n GETTER = 3,\n SETTER = 4,\n CLASS = 5,\n\n STATIC = 8,\n\n DECORATORS_HAVE_THIS = 16,\n}\n\ntype DecoratorFinishedRef = { v?: boolean };\ntype DecoratorContextAccess = {\n get?: (target: object) => any;\n set?: (target: object, value: any) => void;\n has: (target: object) => boolean;\n};\ntype DecoratorContext = {\n kind: \"accessor\" | \"method\" | \"getter\" | \"setter\" | \"field\" | \"class\";\n name: string;\n static?: boolean;\n private?: boolean;\n access?: DecoratorContextAccess;\n metadata?: any;\n addInitializer?: (initializer: Function) => void;\n};\ntype DecoratorInfo =\n | [\n decs: Function | Function[],\n kind: PROP_KIND,\n name: string,\n any?,\n Function?,\n ]\n | [classDecs: Function[]];\n\n/**\n Basic usage:\n\n applyDecs(\n Class,\n [\n // member decorators\n [\n decs, // dec, or array of decs, or array of this values and decs\n 0, // kind of value being decorated\n 'prop', // name of public prop on class containing the value being decorated,\n '#p', // the name of the private property (if is private, void 0 otherwise),\n ]\n ],\n [\n // class decorators\n dec1, dec2\n ]\n )\n ```\n\n Fully transpiled example:\n\n ```js\n @dec\n class Class {\n @dec\n a = 123;\n\n @dec\n #a = 123;\n\n @dec\n @dec2\n accessor b = 123;\n\n @dec\n accessor #b = 123;\n\n @dec\n c() { console.log('c'); }\n\n @dec\n #c() { console.log('privC'); }\n\n @dec\n get d() { console.log('d'); }\n\n @dec\n get #d() { console.log('privD'); }\n\n @dec\n set e(v) { console.log('e'); }\n\n @dec\n set #e(v) { console.log('privE'); }\n }\n\n\n // becomes\n let initializeInstance;\n let initializeClass;\n\n let initA;\n let initPrivA;\n\n let initB;\n let initPrivB, getPrivB, setPrivB;\n\n let privC;\n let privD;\n let privE;\n\n let Class;\n class _Class {\n static {\n let ret = applyDecs(\n this,\n [\n [dec, 0, 'a'],\n [dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],\n [[dec, dec2], 1, 'b'],\n [dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],\n [dec, 2, 'c'],\n [dec, 2, 'c', () => console.log('privC')],\n [dec, 3, 'd'],\n [dec, 3, 'd', () => console.log('privD')],\n [dec, 4, 'e'],\n [dec, 4, 'e', () => console.log('privE')],\n ],\n [\n dec\n ]\n );\n\n initA = ret[0];\n\n initPrivA = ret[1];\n\n initB = ret[2];\n\n initPrivB = ret[3];\n getPrivB = ret[4];\n setPrivB = ret[5];\n\n privC = ret[6];\n\n privD = ret[7];\n\n privE = ret[8];\n\n initializeInstance = ret[9];\n\n Class = ret[10]\n\n initializeClass = ret[11];\n }\n\n a = (initializeInstance(this), initA(this, 123));\n\n #a = initPrivA(this, 123);\n\n #bData = initB(this, 123);\n get b() { return this.#bData }\n set b(v) { this.#bData = v }\n\n #privBData = initPrivB(this, 123);\n get #b() { return getPrivB(this); }\n set #b(v) { setPrivB(this, v); }\n\n c() { console.log('c'); }\n\n #c(...args) { return privC(this, ...args) }\n\n get d() { console.log('d'); }\n\n get #d() { return privD(this); }\n\n set e(v) { console.log('e'); }\n\n set #e(v) { privE(this, v); }\n }\n\n initializeClass(Class);\n */\n\nexport default /* @no-mangle */ function applyDecs2305(\n targetClass: any,\n memberDecs: DecoratorInfo[],\n classDecs: Function[],\n classDecsHaveThis: number,\n instanceBrand: Function,\n parentClass: any,\n) {\n function _bindPropCall(obj: any, name: string, before?: Function) {\n return function (_this: any, value?: any) {\n if (before) {\n before(_this);\n }\n return obj[name].call(_this, value);\n };\n }\n\n function runInitializers(initializers: Function[], value: any) {\n for (var i = 0; i < initializers.length; i++) {\n initializers[i].call(value);\n }\n return value;\n }\n\n function assertCallable(\n fn: any,\n hint1: string,\n hint2?: string,\n throwUndefined?: boolean,\n ) {\n if (typeof fn !== \"function\") {\n if (throwUndefined || fn !== void 0) {\n throw new TypeError(\n hint1 +\n \" must \" +\n (hint2 || \"be\") +\n \" a function\" +\n (throwUndefined ? \"\" : \" or undefined\"),\n );\n }\n }\n return fn;\n }\n\n /* @no-mangle */\n function applyDec(\n Class: any,\n decInfo: DecoratorInfo,\n decoratorsHaveThis: number,\n name: string,\n kind: PROP_KIND,\n metadata: any,\n initializers: Function[],\n ret?: Function[],\n isStatic?: boolean,\n isPrivate?: boolean,\n isField?: boolean,\n isAccessor?: boolean,\n hasPrivateBrand?: Function,\n ) {\n function assertInstanceIfPrivate(target: any) {\n if (!hasPrivateBrand(target)) {\n throw new TypeError(\n \"Attempted to access private element on non-instance\",\n );\n }\n }\n\n var decs = decInfo[0],\n decVal = decInfo[3],\n _: any,\n isClass = !ret;\n\n if (!isClass) {\n if (!decoratorsHaveThis && !Array.isArray(decs)) {\n decs = [decs];\n }\n\n var desc: PropertyDescriptor = {},\n init: Function[] = [],\n key: \"get\" | \"set\" | \"value\" =\n kind === PROP_KIND.GETTER\n ? \"get\"\n : kind === PROP_KIND.SETTER || isAccessor\n ? \"set\"\n : \"value\";\n\n if (isPrivate) {\n if (isField || isAccessor) {\n desc = {\n get: setFunctionName(\n function (this: any) {\n return decVal(this);\n },\n name,\n \"get\",\n ),\n set: function (this: any, value: any) {\n decInfo[4](this, value);\n },\n };\n } else {\n desc[key] = decVal;\n }\n\n if (!isField) {\n setFunctionName(\n desc[key],\n name,\n kind === PROP_KIND.METHOD ? \"\" : key,\n );\n }\n } else if (!isField) {\n desc = Object.getOwnPropertyDescriptor(Class, name);\n }\n }\n\n var newValue = Class;\n\n for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {\n var dec = (decs as Function[])[i],\n decThis = decoratorsHaveThis ? (decs as any[])[i - 1] : void 0;\n\n var decoratorFinishedRef: DecoratorFinishedRef = {};\n var ctx: DecoratorContext = {\n kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][\n kind\n ] as any,\n\n name: name,\n metadata: metadata,\n addInitializer: function (\n decoratorFinishedRef: DecoratorFinishedRef,\n initializer: Function,\n ) {\n if (decoratorFinishedRef.v) {\n throw new Error(\n \"attempted to call addInitializer after decoration was finished\",\n );\n }\n assertCallable(initializer, \"An initializer\", \"be\", true);\n initializers.push(initializer);\n }.bind(null, decoratorFinishedRef),\n };\n\n try {\n if (isClass) {\n if (\n (_ = assertCallable(\n dec.call(decThis, newValue, ctx),\n \"class decorators\",\n \"return\",\n ))\n ) {\n newValue = _;\n }\n } else {\n ctx[\"static\"] = isStatic;\n ctx[\"private\"] = isPrivate;\n\n var get, set;\n if (!isPrivate) {\n get = function (target: any) {\n return target[name];\n };\n if (kind < PROP_KIND.METHOD || kind === PROP_KIND.SETTER) {\n set = function (target: any, v: any) {\n target[name] = v;\n };\n }\n } else if (kind === PROP_KIND.METHOD) {\n get = function (_this: any) {\n assertInstanceIfPrivate(_this);\n return desc.value;\n };\n } else {\n if (kind < PROP_KIND.SETTER) {\n get = _bindPropCall(desc, \"get\", assertInstanceIfPrivate);\n }\n if (kind !== PROP_KIND.GETTER) {\n set = _bindPropCall(desc, \"set\", assertInstanceIfPrivate);\n }\n }\n\n var access: DecoratorContextAccess = (ctx.access = {\n has: isPrivate\n ? // @ts-expect-error no thisArg\n hasPrivateBrand.bind()\n : function (target: object) {\n return name in target;\n },\n });\n if (get) access.get = get;\n if (set) access.set = set;\n\n newValue = dec.call(\n decThis,\n isAccessor\n ? {\n get: desc.get,\n set: desc.set,\n }\n : desc[key],\n ctx,\n );\n\n if (isAccessor) {\n if (typeof newValue === \"object\" && newValue) {\n if ((_ = assertCallable(newValue.get, \"accessor.get\"))) {\n desc.get = _;\n }\n if ((_ = assertCallable(newValue.set, \"accessor.set\"))) {\n desc.set = _;\n }\n if ((_ = assertCallable(newValue.init, \"accessor.init\"))) {\n init.push(_);\n }\n } else if (newValue !== void 0) {\n throw new TypeError(\n \"accessor decorators must return an object with get, set, or init properties or void 0\",\n );\n }\n } else if (\n assertCallable(\n newValue,\n (isField ? \"field\" : \"method\") + \" decorators\",\n \"return\",\n )\n ) {\n if (isField) {\n init.push(newValue);\n } else {\n desc[key] = newValue;\n }\n }\n }\n } finally {\n decoratorFinishedRef.v = true;\n }\n }\n\n if (isField || isAccessor) {\n ret.push(function (instance: any, value: any) {\n for (var i = init.length - 1; i >= 0; i--) {\n value = init[i].call(instance, value);\n }\n return value;\n });\n }\n\n if (!isField && !isClass) {\n if (isPrivate) {\n if (isAccessor) {\n ret.push(_bindPropCall(desc, \"get\"), _bindPropCall(desc, \"set\"));\n } else {\n ret.push(\n kind === PROP_KIND.METHOD\n ? desc[key]\n : _bindPropCall.call.bind(desc[key]),\n );\n }\n } else {\n Object.defineProperty(Class, name, desc);\n }\n }\n return newValue;\n }\n\n /* @no-mangle */\n function applyMemberDecs(\n Class: any,\n decInfos: DecoratorInfo[],\n instanceBrand: Function,\n metadata: any,\n ) {\n var ret: Function[] = [];\n var protoInitializers: Function[];\n var staticInitializers: Function[];\n var staticBrand = function (_: any) {\n return checkInRHS(_) === Class;\n };\n\n var existingNonFields = new Map();\n\n function pushInitializers(initializers: Function[]) {\n if (initializers) {\n ret.push(runInitializers.bind(null, initializers));\n }\n }\n\n for (var i = 0; i < decInfos.length; i++) {\n var decInfo = decInfos[i];\n\n // skip computed property names\n if (!Array.isArray(decInfo)) continue;\n\n var kind = decInfo[1];\n var name = decInfo[2];\n var isPrivate = decInfo.length > 3;\n\n var decoratorsHaveThis = kind & PROP_KIND.DECORATORS_HAVE_THIS;\n var isStatic = !!(kind & PROP_KIND.STATIC);\n\n kind &= 7; /* 0b111 */\n\n var isField = kind === PROP_KIND.FIELD;\n\n var key = name + \"/\" + isStatic;\n\n if (!isField && !isPrivate) {\n var existingKind = existingNonFields.get(key);\n\n if (\n existingKind === true ||\n (existingKind === PROP_KIND.GETTER && kind !== PROP_KIND.SETTER) ||\n (existingKind === PROP_KIND.SETTER && kind !== PROP_KIND.GETTER)\n ) {\n throw new Error(\n \"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: \" +\n name,\n );\n }\n existingNonFields.set(key, kind > PROP_KIND.METHOD ? kind : true);\n }\n\n applyDec(\n isStatic ? Class : Class.prototype,\n decInfo,\n decoratorsHaveThis,\n isPrivate ? \"#\" + name : (toPropertyKey(name) as string),\n kind,\n metadata,\n isStatic\n ? (staticInitializers = staticInitializers || [])\n : (protoInitializers = protoInitializers || []),\n ret,\n isStatic,\n isPrivate,\n isField,\n kind === PROP_KIND.ACCESSOR,\n isStatic && isPrivate ? staticBrand : instanceBrand,\n );\n }\n\n pushInitializers(protoInitializers);\n pushInitializers(staticInitializers);\n return ret;\n }\n\n function defineMetadata(Class: any, metadata: any) {\n return Object.defineProperty(\n Class,\n Symbol.metadata || Symbol[\"for\"](\"Symbol.metadata\"),\n { configurable: true, enumerable: true, value: metadata },\n );\n }\n\n if (arguments.length >= 6) {\n var parentMetadata =\n parentClass[Symbol.metadata || Symbol[\"for\"](\"Symbol.metadata\")];\n }\n var metadata = Object.create(parentMetadata == null ? null : parentMetadata);\n var e = applyMemberDecs(targetClass, memberDecs, instanceBrand, metadata);\n if (!classDecs.length) defineMetadata(targetClass, metadata);\n return {\n e: e,\n // Lazily apply class decorations so that member init locals can be properly bound.\n get c() {\n // The transformer will not emit assignment when there are no class decorators,\n // so we don't have to return an empty array here.\n var initializers: Function[] = [];\n return (\n classDecs.length && [\n defineMetadata(\n applyDec(\n targetClass,\n [classDecs],\n classDecsHaveThis,\n targetClass.name,\n PROP_KIND.CLASS,\n metadata,\n initializers,\n ),\n metadata,\n ),\n runInitializers.bind(null, initializers, targetClass),\n ]\n );\n },\n };\n}\n"],"mappings":";;;;;;AAIA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AA0LgC,SAASG,aAAaA,CACpDC,WAAgB,EAChBC,UAA2B,EAC3BC,SAAqB,EACrBC,iBAAyB,EACzBC,aAAuB,EACvBC,WAAgB,EAChB;EACA,SAASC,aAAaA,CAACC,GAAQ,EAAEC,IAAY,EAAEC,MAAiB,EAAE;IAChE,OAAO,UAAUC,KAAU,EAAEC,KAAW,EAAE;MACxC,IAAIF,MAAM,EAAE;QACVA,MAAM,CAACC,KAAK,CAAC;MACf;MACA,OAAOH,GAAG,CAACC,IAAI,CAAC,CAACI,IAAI,CAACF,KAAK,EAAEC,KAAK,CAAC;IACrC,CAAC;EACH;EAEA,SAASE,eAAeA,CAACC,YAAwB,EAAEH,KAAU,EAAE;IAC7D,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,YAAY,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;MAC5CD,YAAY,CAACC,CAAC,CAAC,CAACH,IAAI,CAACD,KAAK,CAAC;IAC7B;IACA,OAAOA,KAAK;EACd;EAEA,SAASM,cAAcA,CACrBC,EAAO,EACPC,KAAa,EACbC,KAAc,EACdC,cAAwB,EACxB;IACA,IAAI,OAAOH,EAAE,KAAK,UAAU,EAAE;MAC5B,IAAIG,cAAc,IAAIH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AACD,cAAc,IAAI,IAAI,GAAG,IAAI,GAAGA,cAAc,CAAC;EAC5E,IAAIE,CAAC,GAAGnB,eAAe,CAAClE,WAAW,EAAEC,UAAU,EAAEG,aAAa,EAAEwB,QAAQ,CAAC;EACzE,IAAI,CAAC1B,SAAS,CAACc,MAAM,EAAE8D,cAAc,CAAC9E,WAAW,EAAE4B,QAAQ,CAAC;EAC5D,OAAO;IACLyD,CAAC,EAAEA,CAAC;IAEJ,IAAIC,CAACA,CAAA,EAAG;MAGN,IAAIxE,YAAwB,GAAG,EAAE;MACjC,OACEZ,SAAS,CAACc,MAAM,IAAI,CAClB8D,cAAc,CACZvD,QAAQ,CACNvB,WAAW,EACX,CAACE,SAAS,CAAC,EACXC,iBAAiB,EACjBH,WAAW,CAACQ,IAAI,KAEhBoB,QAAQ,EACRd,YACF,CAAC,EACDc,QACF,CAAC,EACDf,eAAe,CAACgD,IAAI,CAAC,IAAI,EAAE/C,YAAY,EAAEd,WAAW,CAAC,CACtD;IAEL;EACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2311.js b/node_modules/@babel/helpers/lib/helpers/applyDecs2311.js new file mode 100644 index 0000000..971714b --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2311.js @@ -0,0 +1,236 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = applyDecs2311; +var _checkInRHS = require("./checkInRHS.js"); +var _setFunctionName = require("./setFunctionName.js"); +var _toPropertyKey = require("./toPropertyKey.js"); +function applyDecs2311(targetClass, classDecs, memberDecs, classDecsHaveThis, instanceBrand, parentClass) { + var symbolMetadata = Symbol.metadata || Symbol["for"]("Symbol.metadata"); + var defineProperty = Object.defineProperty; + var create = Object.create; + var metadata; + var existingNonFields = [create(null), create(null)]; + var hasClassDecs = classDecs.length; + var _; + function createRunInitializers(initializers, useStaticThis, hasValue) { + return function (thisArg, value) { + if (useStaticThis) { + value = thisArg; + thisArg = targetClass; + } + for (var i = 0; i < initializers.length; i++) { + value = initializers[i].apply(thisArg, hasValue ? [value] : []); + } + return hasValue ? value : thisArg; + }; + } + function assertCallable(fn, hint1, hint2, throwUndefined) { + if (typeof fn !== "function") { + if (throwUndefined || fn !== void 0) { + throw new TypeError(hint1 + " must " + (hint2 || "be") + " a function" + (throwUndefined ? "" : " or undefined")); + } + } + return fn; + } + function applyDec(Class, decInfo, decoratorsHaveThis, name, kind, initializers, ret, isStatic, isPrivate, isField, hasPrivateBrand) { + function assertInstanceIfPrivate(target) { + if (!hasPrivateBrand(target)) { + throw new TypeError("Attempted to access private element on non-instance"); + } + } + var decs = [].concat(decInfo[0]), + decVal = decInfo[3], + isClass = !ret; + var isAccessor = kind === 1; + var isGetter = kind === 3; + var isSetter = kind === 4; + var isMethod = kind === 2; + function _bindPropCall(name, useStaticThis, before) { + return function (_this, value) { + if (useStaticThis) { + value = _this; + _this = Class; + } + if (before) { + before(_this); + } + return desc[name].call(_this, value); + }; + } + if (!isClass) { + var desc = {}, + init = [], + key = isGetter ? "get" : isSetter || isAccessor ? "set" : "value"; + if (isPrivate) { + if (isField || isAccessor) { + desc = { + get: (0, _setFunctionName.default)(function () { + return decVal(this); + }, name, "get"), + set: function (value) { + decInfo[4](this, value); + } + }; + } else { + desc[key] = decVal; + } + if (!isField) { + (0, _setFunctionName.default)(desc[key], name, isMethod ? "" : key); + } + } else if (!isField) { + desc = Object.getOwnPropertyDescriptor(Class, name); + } + if (!isField && !isPrivate) { + _ = existingNonFields[+isStatic][name]; + if (_ && (_ ^ kind) !== 7) { + throw new Error("Decorating two elements with the same name (" + desc[key].name + ") is not supported yet"); + } + existingNonFields[+isStatic][name] = kind < 3 ? 1 : kind; + } + } + var newValue = Class; + for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) { + var dec = assertCallable(decs[i], "A decorator", "be", true), + decThis = decoratorsHaveThis ? decs[i - 1] : void 0; + var decoratorFinishedRef = {}; + var ctx = { + kind: ["field", "accessor", "method", "getter", "setter", "class"][kind], + name: name, + metadata: metadata, + addInitializer: function (decoratorFinishedRef, initializer) { + if (decoratorFinishedRef.v) { + throw new TypeError("attempted to call addInitializer after decoration was finished"); + } + assertCallable(initializer, "An initializer", "be", true); + initializers.push(initializer); + }.bind(null, decoratorFinishedRef) + }; + if (isClass) { + _ = dec.call(decThis, newValue, ctx); + decoratorFinishedRef.v = 1; + if (assertCallable(_, "class decorators", "return")) { + newValue = _; + } + } else { + ctx["static"] = isStatic; + ctx["private"] = isPrivate; + _ = ctx.access = { + has: isPrivate ? hasPrivateBrand.bind() : function (target) { + return name in target; + } + }; + if (!isSetter) { + _.get = isPrivate ? isMethod ? function (_this) { + assertInstanceIfPrivate(_this); + return desc.value; + } : _bindPropCall("get", 0, assertInstanceIfPrivate) : function (target) { + return target[name]; + }; + } + if (!isMethod && !isGetter) { + _.set = isPrivate ? _bindPropCall("set", 0, assertInstanceIfPrivate) : function (target, v) { + target[name] = v; + }; + } + newValue = dec.call(decThis, isAccessor ? { + get: desc.get, + set: desc.set + } : desc[key], ctx); + decoratorFinishedRef.v = 1; + if (isAccessor) { + if (typeof newValue === "object" && newValue) { + if (_ = assertCallable(newValue.get, "accessor.get")) { + desc.get = _; + } + if (_ = assertCallable(newValue.set, "accessor.set")) { + desc.set = _; + } + if (_ = assertCallable(newValue.init, "accessor.init")) { + init.unshift(_); + } + } else if (newValue !== void 0) { + throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined"); + } + } else if (assertCallable(newValue, (isField ? "field" : "method") + " decorators", "return")) { + if (isField) { + init.unshift(newValue); + } else { + desc[key] = newValue; + } + } + } + } + if (kind < 2) { + ret.push(createRunInitializers(init, isStatic, 1), createRunInitializers(initializers, isStatic, 0)); + } + if (!isField && !isClass) { + if (isPrivate) { + if (isAccessor) { + ret.splice(-1, 0, _bindPropCall("get", isStatic), _bindPropCall("set", isStatic)); + } else { + ret.push(isMethod ? desc[key] : assertCallable.call.bind(desc[key])); + } + } else { + defineProperty(Class, name, desc); + } + } + return newValue; + } + function applyMemberDecs() { + var ret = []; + var protoInitializers; + var staticInitializers; + var pushInitializers = function (initializers) { + if (initializers) { + ret.push(createRunInitializers(initializers)); + } + }; + var applyMemberDecsOfKind = function (isStatic, isField) { + for (var i = 0; i < memberDecs.length; i++) { + var decInfo = memberDecs[i]; + var kind = decInfo[1]; + var kindOnly = kind & 7; + if ((kind & 8) == isStatic && !kindOnly == isField) { + var name = decInfo[2]; + var isPrivate = !!decInfo[3]; + var decoratorsHaveThis = kind & 16; + applyDec(isStatic ? targetClass : targetClass.prototype, decInfo, decoratorsHaveThis, isPrivate ? "#" + name : (0, _toPropertyKey.default)(name), kindOnly, kindOnly < 2 ? [] : isStatic ? staticInitializers = staticInitializers || [] : protoInitializers = protoInitializers || [], ret, !!isStatic, isPrivate, isField, isStatic && isPrivate ? function (_) { + return (0, _checkInRHS.default)(_) === targetClass; + } : instanceBrand); + } + } + }; + applyMemberDecsOfKind(8, 0); + applyMemberDecsOfKind(0, 0); + applyMemberDecsOfKind(8, 1); + applyMemberDecsOfKind(0, 1); + pushInitializers(protoInitializers); + pushInitializers(staticInitializers); + return ret; + } + function defineMetadata(Class) { + return defineProperty(Class, symbolMetadata, { + configurable: true, + enumerable: true, + value: metadata + }); + } + if (parentClass !== undefined) { + metadata = parentClass[symbolMetadata]; + } + metadata = create(metadata == null ? null : metadata); + _ = applyMemberDecs(); + if (!hasClassDecs) defineMetadata(targetClass); + return { + e: _, + get c() { + var initializers = []; + return hasClassDecs && [defineMetadata(targetClass = applyDec(targetClass, [classDecs], classDecsHaveThis, targetClass.name, 5, initializers)), createRunInitializers(initializers, 1)]; + } + }; +} + +//# sourceMappingURL=applyDecs2311.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/applyDecs2311.js.map b/node_modules/@babel/helpers/lib/helpers/applyDecs2311.js.map new file mode 100644 index 0000000..f145827 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/applyDecs2311.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_checkInRHS","require","_setFunctionName","_toPropertyKey","applyDecs2311","targetClass","classDecs","memberDecs","classDecsHaveThis","instanceBrand","parentClass","symbolMetadata","Symbol","metadata","defineProperty","Object","create","existingNonFields","hasClassDecs","length","_","createRunInitializers","initializers","useStaticThis","hasValue","thisArg","value","i","apply","assertCallable","fn","hint1","hint2","throwUndefined","TypeError","applyDec","Class","decInfo","decoratorsHaveThis","name","kind","ret","isStatic","isPrivate","isField","hasPrivateBrand","assertInstanceIfPrivate","target","decs","concat","decVal","isClass","isAccessor","isGetter","isSetter","isMethod","_bindPropCall","before","_this","desc","call","init","key","get","setFunctionName","set","getOwnPropertyDescriptor","Error","newValue","dec","decThis","decoratorFinishedRef","ctx","addInitializer","initializer","v","push","bind","access","has","unshift","splice","applyMemberDecs","protoInitializers","staticInitializers","pushInitializers","applyMemberDecsOfKind","kindOnly","prototype","toPropertyKey","checkInRHS","defineMetadata","configurable","enumerable","undefined","e","c"],"sources":["../../src/helpers/applyDecs2311.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n/* @mangleFns */\n\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion -- `typescript-eslint` complains when using `!` */\n\nimport checkInRHS from \"./checkInRHS.ts\";\nimport setFunctionName from \"./setFunctionName.ts\";\nimport toPropertyKey from \"./toPropertyKey.ts\";\n\nconst enum PROP_KIND {\n FIELD = 0,\n ACCESSOR = 1,\n METHOD = 2,\n GETTER = 3,\n SETTER = 4,\n CLASS = 5,\n KIND_MASK = 7, // 0b111\n\n STATIC = 8,\n\n DECORATORS_HAVE_THIS = 16,\n}\n\ntype DecoratorFinishedRef = { v?: number };\ntype DecoratorContextAccess = {\n get?: (target: object) => any;\n set?: (target: object, value: any) => void;\n has: (target: object) => boolean;\n};\ntype DecoratorContext = {\n kind: \"accessor\" | \"method\" | \"getter\" | \"setter\" | \"field\" | \"class\";\n name: string | symbol;\n static?: boolean;\n private?: boolean;\n access?: DecoratorContextAccess;\n metadata?: any;\n addInitializer?: (initializer: Function) => void;\n};\ntype DecoratorInfo =\n | [\n decs: Function | Function[],\n kind: PROP_KIND,\n name: string,\n privateGetter?: Function,\n privateSetter?: Function,\n ]\n | [classDecs: Function[]];\ntype DecoratorNonFieldCheckStorage = Record<\n string | symbol,\n PROP_KIND.ACCESSOR | PROP_KIND.GETTER | PROP_KIND.SETTER\n>;\n/**\n Basic usage:\n\n applyDecs(\n Class,\n [\n // member decorators\n [\n decs, // dec, or array of decs, or array of this values and decs\n 0, // kind of value being decorated\n 'prop', // name of public prop on class containing the value being decorated,\n '#p', // the name of the private property (if is private, void 0 otherwise),\n ]\n ],\n [\n // class decorators\n dec1, dec2\n ]\n )\n ```\n\n Fully transpiled example:\n\n ```js\n @dec\n class Class {\n @dec\n a = 123;\n\n @dec\n #a = 123;\n\n @dec\n @dec2\n accessor b = 123;\n\n @dec\n accessor #b = 123;\n\n @dec\n c() { console.log('c'); }\n\n @dec\n #c() { console.log('privC'); }\n\n @dec\n get d() { console.log('d'); }\n\n @dec\n get #d() { console.log('privD'); }\n\n @dec\n set e(v) { console.log('e'); }\n\n @dec\n set #e(v) { console.log('privE'); }\n }\n\n\n // becomes\n let initializeInstance;\n let initializeClass;\n\n let initA;\n let initPrivA;\n\n let initB;\n let initPrivB, getPrivB, setPrivB;\n\n let privC;\n let privD;\n let privE;\n\n let Class;\n class _Class {\n static {\n let ret = applyDecs(\n this,\n [\n [dec, 0, 'a'],\n [dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],\n [[dec, dec2], 1, 'b'],\n [dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],\n [dec, 2, 'c'],\n [dec, 2, 'c', () => console.log('privC')],\n [dec, 3, 'd'],\n [dec, 3, 'd', () => console.log('privD')],\n [dec, 4, 'e'],\n [dec, 4, 'e', () => console.log('privE')],\n ],\n [\n dec\n ]\n );\n\n initA = ret[0];\n\n initPrivA = ret[1];\n\n initB = ret[2];\n\n initPrivB = ret[3];\n getPrivB = ret[4];\n setPrivB = ret[5];\n\n privC = ret[6];\n\n privD = ret[7];\n\n privE = ret[8];\n\n initializeInstance = ret[9];\n\n Class = ret[10]\n\n initializeClass = ret[11];\n }\n\n a = (initializeInstance(this), initA(this, 123));\n\n #a = initPrivA(this, 123);\n\n #bData = initB(this, 123);\n get b() { return this.#bData }\n set b(v) { this.#bData = v }\n\n #privBData = initPrivB(this, 123);\n get #b() { return getPrivB(this); }\n set #b(v) { setPrivB(this, v); }\n\n c() { console.log('c'); }\n\n #c(...args) { return privC(this, ...args) }\n\n get d() { console.log('d'); }\n\n get #d() { return privD(this); }\n\n set e(v) { console.log('e'); }\n\n set #e(v) { privE(this, v); }\n }\n\n initializeClass(Class);\n */\n\nexport default /* @no-mangle */ function applyDecs2311(\n targetClass: any,\n classDecs: Function[],\n memberDecs: DecoratorInfo[],\n classDecsHaveThis: number,\n instanceBrand: Function,\n parentClass: any,\n) {\n var symbolMetadata = Symbol.metadata || Symbol[\"for\"](\"Symbol.metadata\");\n var defineProperty = Object.defineProperty;\n var create = Object.create;\n var metadata: any;\n // Use both as and satisfies to ensure that we only use non-zero values\n var existingNonFields = [create(null), create(null)] as [\n DecoratorNonFieldCheckStorage,\n DecoratorNonFieldCheckStorage,\n ];\n var hasClassDecs = classDecs.length;\n // This is a temporary variable for smaller helper size\n var _: any;\n\n function createRunInitializers(\n initializers: Function[],\n useStaticThis?: 0 | 1 | boolean,\n hasValue?: 0 | 1,\n ) {\n return function (thisArg: any, value?: any) {\n if (useStaticThis) {\n value = thisArg;\n thisArg = targetClass;\n }\n for (var i = 0; i < initializers.length; i++) {\n value = initializers[i].apply(thisArg, hasValue ? [value] : []);\n }\n return hasValue ? value : thisArg;\n };\n }\n\n function assertCallable(\n fn: any,\n hint1: string,\n hint2?: string,\n throwUndefined?: boolean,\n ) {\n if (typeof fn !== \"function\") {\n if (throwUndefined || fn !== void 0) {\n throw new TypeError(\n hint1 +\n \" must \" +\n (hint2 || \"be\") +\n \" a function\" +\n (throwUndefined ? \"\" : \" or undefined\"),\n );\n }\n }\n return fn;\n }\n\n /* @no-mangle */\n function applyDec(\n Class: any,\n decInfo: DecoratorInfo,\n decoratorsHaveThis: 0 | PROP_KIND.DECORATORS_HAVE_THIS,\n name: string | symbol,\n kind: PROP_KIND,\n initializers: Function[],\n ret?: Function[],\n isStatic?: boolean,\n isPrivate?: boolean,\n isField?: 0 | 1,\n hasPrivateBrand?: Function,\n ) {\n function assertInstanceIfPrivate(target: any) {\n if (!hasPrivateBrand!(target)) {\n throw new TypeError(\n \"Attempted to access private element on non-instance\",\n );\n }\n }\n\n var decs = ([] as Function[]).concat(decInfo[0]),\n decVal = decInfo[3],\n isClass = !ret;\n\n var isAccessor = kind === PROP_KIND.ACCESSOR;\n var isGetter = kind === PROP_KIND.GETTER;\n var isSetter = kind === PROP_KIND.SETTER;\n var isMethod = kind === PROP_KIND.METHOD;\n\n function _bindPropCall(\n name: keyof PropertyDescriptor,\n useStaticThis: 0 | 1 | boolean,\n before?: Function,\n ) {\n return function (_this: any, value?: any) {\n if (useStaticThis) {\n value = _this;\n _this = Class;\n }\n if (before) {\n before(_this);\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return desc[name].call(_this, value);\n };\n }\n\n if (!isClass) {\n var desc: PropertyDescriptor = {},\n init: Function[] = [],\n key: \"get\" | \"set\" | \"value\" = isGetter\n ? \"get\"\n : isSetter || isAccessor\n ? \"set\"\n : \"value\";\n\n if (isPrivate) {\n if (isField || isAccessor) {\n desc = {\n get: setFunctionName(\n function (this: any) {\n return decVal!(this);\n },\n name,\n \"get\",\n ),\n set: function (this: any, value: any) {\n decInfo[4]!(this, value);\n },\n };\n } else {\n desc[key] = decVal;\n }\n\n if (!isField) {\n setFunctionName(desc[key], name, isMethod ? \"\" : key);\n }\n } else if (!isField) {\n desc = Object.getOwnPropertyDescriptor(Class, name)!;\n }\n\n if (!isField && !isPrivate) {\n _ = existingNonFields[+isStatic!][name];\n // flag is 1, 3, or 4; kind is 0, 1, 2, 3, or 4\n // flag ^ kind is 7 if and only if one of them is 3 and the other one is 4.\n if (_ && (_ ^ kind) !== 7) {\n throw new Error(\n \"Decorating two elements with the same name (\" +\n desc[key].name +\n \") is not supported yet\",\n );\n }\n // We use PROP_KIND.ACCESSOR to mark a name as \"fully used\":\n // either a get/set pair, or a non-getter/setter.\n existingNonFields[+isStatic!][name] =\n kind < PROP_KIND.GETTER\n ? PROP_KIND.ACCESSOR\n : (kind as PROP_KIND.GETTER | PROP_KIND.SETTER);\n }\n }\n\n var newValue = Class;\n\n for (var i = decs.length - 1; i >= 0; i -= decoratorsHaveThis ? 2 : 1) {\n var dec = assertCallable(decs[i], \"A decorator\", \"be\", true) as Function,\n decThis = decoratorsHaveThis ? decs[i - 1] : void 0;\n\n var decoratorFinishedRef: DecoratorFinishedRef = {};\n var ctx: DecoratorContext = {\n kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][\n kind\n ] as any,\n\n name: name,\n metadata: metadata,\n addInitializer: function (\n decoratorFinishedRef: DecoratorFinishedRef,\n initializer: Function,\n ) {\n if (decoratorFinishedRef.v) {\n throw new TypeError(\n \"attempted to call addInitializer after decoration was finished\",\n );\n }\n assertCallable(initializer, \"An initializer\", \"be\", true);\n initializers.push(initializer);\n }.bind(null, decoratorFinishedRef),\n };\n\n if (isClass) {\n _ = dec.call(decThis, newValue, ctx);\n decoratorFinishedRef.v = 1;\n\n if (assertCallable(_, \"class decorators\", \"return\")) {\n newValue = _;\n }\n } else {\n ctx[\"static\"] = isStatic;\n ctx[\"private\"] = isPrivate;\n\n _ = ctx.access = {\n has: isPrivate\n ? // @ts-expect-error no thisArg\n hasPrivateBrand.bind()\n : function (target: object) {\n return name in target;\n },\n };\n\n if (!isSetter) {\n _.get = isPrivate\n ? isMethod\n ? function (_this: any) {\n assertInstanceIfPrivate(_this);\n return desc.value;\n }\n : _bindPropCall(\"get\", 0, assertInstanceIfPrivate)\n : function (target: any) {\n return target[name];\n };\n }\n if (!isMethod && !isGetter) {\n _.set = isPrivate\n ? _bindPropCall(\"set\", 0, assertInstanceIfPrivate)\n : function (target: any, v: any) {\n target[name] = v;\n };\n }\n\n newValue = dec.call(\n decThis,\n isAccessor\n ? {\n get: desc!.get,\n set: desc!.set,\n }\n : desc![key!],\n ctx,\n );\n decoratorFinishedRef.v = 1;\n\n if (isAccessor) {\n if (typeof newValue === \"object\" && newValue) {\n if ((_ = assertCallable(newValue.get, \"accessor.get\"))) {\n desc!.get = _;\n }\n if ((_ = assertCallable(newValue.set, \"accessor.set\"))) {\n desc!.set = _;\n }\n if ((_ = assertCallable(newValue.init, \"accessor.init\"))) {\n init!.unshift(_);\n }\n } else if (newValue !== void 0) {\n throw new TypeError(\n \"accessor decorators must return an object with get, set, or init properties or undefined\",\n );\n }\n } else if (\n assertCallable(\n newValue,\n (isField ? \"field\" : \"method\") + \" decorators\",\n \"return\",\n )\n ) {\n if (isField) {\n init!.unshift(newValue);\n } else {\n desc![key!] = newValue;\n }\n }\n }\n }\n\n // isField || isAccessor\n if (kind < PROP_KIND.METHOD) {\n ret!.push(\n // init\n createRunInitializers(init!, isStatic, 1),\n // init_extra\n createRunInitializers(initializers, isStatic, 0),\n );\n }\n\n if (!isField && !isClass) {\n if (isPrivate) {\n if (isAccessor) {\n // get and set should be returned before init_extra\n ret!.splice(\n -1,\n 0,\n _bindPropCall(\"get\", isStatic!),\n _bindPropCall(\"set\", isStatic!),\n );\n } else {\n ret!.push(\n isMethod\n ? desc![key!]\n : // Equivalent to `Function.call`, just to reduce code size\n assertCallable.call.bind(desc![key!]),\n );\n }\n } else {\n defineProperty(Class, name, desc!);\n }\n }\n return newValue;\n }\n\n /* @no-mangle */\n function applyMemberDecs() {\n var ret: Function[] = [];\n var protoInitializers: Function[];\n var staticInitializers: Function[];\n\n var pushInitializers = function (initializers: Function[]) {\n if (initializers) {\n ret.push(createRunInitializers(initializers));\n }\n };\n\n var applyMemberDecsOfKind = function (\n isStatic: PROP_KIND.STATIC | 0,\n isField: 0 | 1,\n ) {\n for (var i = 0; i < memberDecs.length; i++) {\n var decInfo = memberDecs[i];\n\n var kind = decInfo[1]!;\n var kindOnly: PROP_KIND = kind & PROP_KIND.KIND_MASK;\n if (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison, eqeqeq\n (kind & PROP_KIND.STATIC) == isStatic &&\n // @ts-expect-error comparing a boolean with 0 | 1\n // eslint-disable-next-line eqeqeq\n !kindOnly == isField\n ) {\n var name = decInfo[2];\n var isPrivate = !!decInfo[3];\n\n var decoratorsHaveThis: 0 | PROP_KIND.DECORATORS_HAVE_THIS =\n kind & PROP_KIND.DECORATORS_HAVE_THIS;\n\n applyDec(\n isStatic ? targetClass : targetClass.prototype,\n decInfo,\n decoratorsHaveThis,\n isPrivate ? \"#\" + name : (toPropertyKey(name) as string),\n kindOnly,\n kindOnly < PROP_KIND.METHOD // isField || isAccessor\n ? /* fieldInitializers */ []\n : isStatic\n ? (staticInitializers = staticInitializers || [])\n : (protoInitializers = protoInitializers || []),\n ret,\n !!isStatic,\n isPrivate,\n isField,\n isStatic && isPrivate\n ? function (_: any) {\n return checkInRHS(_) === targetClass;\n }\n : instanceBrand,\n );\n }\n }\n };\n\n applyMemberDecsOfKind(PROP_KIND.STATIC, 0);\n applyMemberDecsOfKind(0, 0);\n applyMemberDecsOfKind(PROP_KIND.STATIC, 1);\n applyMemberDecsOfKind(0, 1);\n\n pushInitializers(protoInitializers!);\n pushInitializers(staticInitializers!);\n return ret;\n }\n\n function defineMetadata(Class: any) {\n return defineProperty(Class, symbolMetadata, {\n configurable: true,\n enumerable: true,\n value: metadata,\n });\n }\n\n if (parentClass !== undefined) {\n metadata = parentClass[symbolMetadata];\n }\n metadata = create(metadata == null ? null : metadata);\n _ = applyMemberDecs();\n if (!hasClassDecs) defineMetadata(targetClass);\n return {\n e: _,\n // Lazily apply class decorations so that member init locals can be properly bound.\n get c() {\n // The transformer will not emit assignment when there are no class decorators,\n // so we don't have to return an empty array here.\n var initializers: Function[] = [];\n return (\n hasClassDecs && [\n defineMetadata(\n (targetClass = applyDec(\n targetClass,\n [classDecs],\n classDecsHaveThis,\n targetClass.name,\n PROP_KIND.CLASS,\n initializers,\n )),\n ),\n createRunInitializers(initializers, 1),\n ]\n );\n },\n };\n}\n"],"mappings":";;;;;;AAKA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AA8LgC,SAASG,aAAaA,CACpDC,WAAgB,EAChBC,SAAqB,EACrBC,UAA2B,EAC3BC,iBAAyB,EACzBC,aAAuB,EACvBC,WAAgB,EAChB;EACA,IAAIC,cAAc,GAAGC,MAAM,CAACC,QAAQ,IAAID,MAAM,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC;EACxE,IAAIE,cAAc,GAAGC,MAAM,CAACD,cAAc;EAC1C,IAAIE,MAAM,GAAGD,MAAM,CAACC,MAAM;EAC1B,IAAIH,QAAa;EAEjB,IAAII,iBAAiB,GAAG,CAACD,MAAM,CAAC,IAAI,CAAC,EAAEA,MAAM,CAAC,IAAI,CAAC,CAGlD;EACD,IAAIE,YAAY,GAAGZ,SAAS,CAACa,MAAM;EAEnC,IAAIC,CAAM;EAEV,SAASC,qBAAqBA,CAC5BC,YAAwB,EACxBC,aAA+B,EAC/BC,QAAgB,EAChB;IACA,OAAO,UAAUC,OAAY,EAAEC,KAAW,EAAE;MAC1C,IAAIH,aAAa,EAAE;QACjBG,KAAK,GAAGD,OAAO;QACfA,OAAO,GAAGpB,WAAW;MACvB;MACA,KAAK,IAAIsB,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,YAAY,CAACH,MAAM,EAAEQ,CAAC,EAAE,EAAE;QAC5CD,KAAK,GAAGJ,YAAY,CAACK,CAAC,CAAC,CAACC,KAAK,CAACH,OAAO,EAAED,QAAQ,GAAG,CAACE,KAAK,CAAC,GAAG,EAAE,CAAC;MACjE;MACA,OA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MAAM,CAACH,QAAQ,IAAI,IAAI,GAAG,IAAI,GAAGA,QAAQ,CAAC;EACrDO,CAAC,GAAG8D,eAAe,CAAC,CAAC;EACrB,IAAI,CAAChE,YAAY,EAAEyE,cAAc,CAACtF,WAAW,CAAC;EAC9C,OAAO;IACL0F,CAAC,EAAE3E,CAAC;IAEJ,IAAI4E,CAACA,CAAA,EAAG;MAGN,IAAI1E,YAAwB,GAAG,EAAE;MACjC,OACEJ,YAAY,IAAI,CACdyE,cAAc,CACXtF,WAAW,GAAG8B,QAAQ,CACrB9B,WAAW,EACX,CAACC,SAAS,CAAC,EACXE,iBAAiB,EACjBH,WAAW,CAACkC,IAAI,KAEhBjB,YACF,CACF,CAAC,EACDD,qBAAqB,CAACC,YAAY,EAAE,CAAC,CAAC,CACvC;IAEL;EACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/arrayLikeToArray.js b/node_modules/@babel/helpers/lib/helpers/arrayLikeToArray.js new file mode 100644 index 0000000..2a41612 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/arrayLikeToArray.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _arrayLikeToArray; +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} + +//# sourceMappingURL=arrayLikeToArray.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/arrayLikeToArray.js.map b/node_modules/@babel/helpers/lib/helpers/arrayLikeToArray.js.map new file mode 100644 index 0000000..1af9c85 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/arrayLikeToArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayLikeToArray","arr","len","length","i","arr2","Array"],"sources":["../../src/helpers/arrayLikeToArray.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nexport default function _arrayLikeToArray(\n arr: ArrayLike,\n len?: number | null,\n) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,GAAiB,EACjBC,GAAmB,EACnB;EACA,IAAIA,GAAG,IAAI,IAAI,IAAIA,GAAG,GAAGD,GAAG,CAACE,MAAM,EAAED,GAAG,GAAGD,GAAG,CAACE,MAAM;EACrD,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEC,IAAI,GAAG,IAAIC,KAAK,CAAIJ,GAAG,CAAC,EAAEE,CAAC,GAAGF,GAAG,EAAEE,CAAC,EAAE,EAAEC,IAAI,CAACD,CAAC,CAAC,GAAGH,GAAG,CAACG,CAAC,CAAC;EACxE,OAAOC,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/arrayWithHoles.js b/node_modules/@babel/helpers/lib/helpers/arrayWithHoles.js new file mode 100644 index 0000000..89e2b90 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/arrayWithHoles.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _arrayWithHoles; +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} + +//# sourceMappingURL=arrayWithHoles.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/arrayWithHoles.js.map b/node_modules/@babel/helpers/lib/helpers/arrayWithHoles.js.map new file mode 100644 index 0000000..16d9dfe --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/arrayWithHoles.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayWithHoles","arr","Array","isArray"],"sources":["../../src/helpers/arrayWithHoles.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _arrayWithHoles(arr: Array) {\n if (Array.isArray(arr)) return arr;\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CAAIC,GAAa,EAAE;EACxD,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAOA,GAAG;AACpC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/arrayWithoutHoles.js b/node_modules/@babel/helpers/lib/helpers/arrayWithoutHoles.js new file mode 100644 index 0000000..5c9f4ae --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/arrayWithoutHoles.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _arrayWithoutHoles; +var _arrayLikeToArray = require("./arrayLikeToArray.js"); +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return (0, _arrayLikeToArray.default)(arr); +} + +//# sourceMappingURL=arrayWithoutHoles.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/arrayWithoutHoles.js.map b/node_modules/@babel/helpers/lib/helpers/arrayWithoutHoles.js.map new file mode 100644 index 0000000..d701d16 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/arrayWithoutHoles.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayLikeToArray","require","_arrayWithoutHoles","arr","Array","isArray","arrayLikeToArray"],"sources":["../../src/helpers/arrayWithoutHoles.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayLikeToArray from \"./arrayLikeToArray.ts\";\n\nexport default function _arrayWithoutHoles(arr: Array) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,kBAAkBA,CAAIC,GAAa,EAAE;EAC3D,IAAIC,KAAK,CAACC,OAAO,CAACF,GAAG,CAAC,EAAE,OAAO,IAAAG,yBAAgB,EAAIH,GAAG,CAAC;AACzD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/assertClassBrand.js b/node_modules/@babel/helpers/lib/helpers/assertClassBrand.js new file mode 100644 index 0000000..8d88e43 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/assertClassBrand.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _assertClassBrand; +function _assertClassBrand(brand, receiver, returnValue) { + if (typeof brand === "function" ? brand === receiver : brand.has(receiver)) { + return arguments.length < 3 ? receiver : returnValue; + } + throw new TypeError("Private element is not present on this object"); +} + +//# sourceMappingURL=assertClassBrand.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/assertClassBrand.js.map b/node_modules/@babel/helpers/lib/helpers/assertClassBrand.js.map new file mode 100644 index 0000000..c86acc2 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/assertClassBrand.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","brand","receiver","returnValue","has","arguments","length","TypeError"],"sources":["../../src/helpers/assertClassBrand.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nexport default function _assertClassBrand(\n brand: Function | WeakMap | WeakSet,\n receiver: any,\n returnValue?: any,\n) {\n if (typeof brand === \"function\" ? brand === receiver : brand.has(receiver)) {\n return arguments.length < 3 ? receiver : returnValue;\n }\n throw new TypeError(\"Private element is not present on this object\");\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,KAAkD,EAClDC,QAAa,EACbC,WAAiB,EACjB;EACA,IAAI,OAAOF,KAAK,KAAK,UAAU,GAAGA,KAAK,KAAKC,QAAQ,GAAGD,KAAK,CAACG,GAAG,CAACF,QAAQ,CAAC,EAAE;IAC1E,OAAOG,SAAS,CAACC,MAAM,GAAG,CAAC,GAAGJ,QAAQ,GAAGC,WAAW;EACtD;EACA,MAAM,IAAII,SAAS,CAAC,+CAA+C,CAAC;AACtE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/assertThisInitialized.js b/node_modules/@babel/helpers/lib/helpers/assertThisInitialized.js new file mode 100644 index 0000000..d8a4a59 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/assertThisInitialized.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _assertThisInitialized; +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + return self; +} + +//# sourceMappingURL=assertThisInitialized.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/assertThisInitialized.js.map b/node_modules/@babel/helpers/lib/helpers/assertThisInitialized.js.map new file mode 100644 index 0000000..654ac39 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/assertThisInitialized.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertThisInitialized","self","ReferenceError"],"sources":["../../src/helpers/assertThisInitialized.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _assertThisInitialized(self: T | undefined): T {\n if (self === void 0) {\n throw new ReferenceError(\n \"this hasn't been initialised - super() hasn't been called\",\n );\n }\n return self;\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAAIC,IAAmB,EAAK;EACxE,IAAIA,IAAI,KAAK,KAAK,CAAC,EAAE;IACnB,MAAM,IAAIC,cAAc,CACtB,2DACF,CAAC;EACH;EACA,OAAOD,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js b/node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js new file mode 100644 index 0000000..e1c9889 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js @@ -0,0 +1,52 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _asyncGeneratorDelegate; +var _OverloadYield = require("./OverloadYield.js"); +function _asyncGeneratorDelegate(inner) { + var iter = {}, + waiting = false; + function pump(key, value) { + waiting = true; + value = new Promise(function (resolve) { + resolve(inner[key](value)); + }); + return { + done: false, + value: new _OverloadYield.default(value, 1) + }; + } + iter[typeof Symbol !== "undefined" && Symbol.iterator || "@@iterator"] = function () { + return this; + }; + iter.next = function (value) { + if (waiting) { + waiting = false; + return value; + } + return pump("next", value); + }; + if (typeof inner["throw"] === "function") { + iter["throw"] = function (value) { + if (waiting) { + waiting = false; + throw value; + } + return pump("throw", value); + }; + } + if (typeof inner["return"] === "function") { + iter["return"] = function (value) { + if (waiting) { + waiting = false; + return value; + } + return pump("return", value); + }; + } + return iter; +} + +//# sourceMappingURL=asyncGeneratorDelegate.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js.map b/node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js.map new file mode 100644 index 0000000..569146f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_OverloadYield","require","_asyncGeneratorDelegate","inner","iter","waiting","pump","key","value","Promise","resolve","done","OverloadYield","Symbol","iterator","next"],"sources":["../../src/helpers/asyncGeneratorDelegate.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport OverloadYield from \"./OverloadYield.ts\";\n\nexport default function _asyncGeneratorDelegate(inner: Generator) {\n var iter = {} as Generator,\n // See the comment in AsyncGenerator to understand what this is.\n waiting = false;\n\n function pump(\n key: \"next\" | \"throw\" | \"return\",\n value: any,\n ): IteratorYieldResult {\n waiting = true;\n value = new Promise(function (resolve) {\n resolve(inner[key](value));\n });\n return {\n done: false,\n value: new OverloadYield(value, /* kind: delegate */ 1),\n };\n }\n\n iter[\n ((typeof Symbol !== \"undefined\" && Symbol.iterator) ||\n \"@@iterator\") as typeof Symbol.iterator\n ] = function () {\n return this;\n };\n\n iter.next = function (value: any) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"next\", value);\n };\n\n if (typeof inner[\"throw\"] === \"function\") {\n iter[\"throw\"] = function (value: any) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump(\"throw\", value);\n };\n }\n\n if (typeof inner[\"return\"] === \"function\") {\n iter[\"return\"] = function (value: any) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"return\", value);\n };\n }\n\n return iter;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAEe,SAASC,uBAAuBA,CAAIC,KAAmB,EAAE;EACtE,IAAIC,IAAI,GAAG,CAAC,CAAiB;IAE3BC,OAAO,GAAG,KAAK;EAEjB,SAASC,IAAIA,CACXC,GAAgC,EAChCC,KAAU,EACgB;IAC1BH,OAAO,GAAG,IAAI;IACdG,KAAK,GAAG,IAAIC,OAAO,CAAC,UAAUC,OAAO,EAAE;MACrCA,OAAO,CAACP,KAAK,CAACI,GAAG,CAAC,CAACC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC;IACF,OAAO;MACLG,IAAI,EAAE,KAAK;MACXH,KAAK,EAAE,IAAII,sBAAa,CAACJ,KAAK,EAAuB,CAAC;IACxD,CAAC;EACH;EAEAJ,IAAI,CACA,OAAOS,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,QAAQ,IAChD,YAAY,CACf,GAAG,YAAY;IACd,OAAO,IAAI;EACb,CAAC;EAEDV,IAAI,CAACW,IAAI,GAAG,UAAUP,KAAU,EAAE;IAChC,IAAIH,OAAO,EAAE;MACXA,OAAO,GAAG,KAAK;MACf,OAAOG,KAAK;IACd;IACA,OAAOF,IAAI,CAAC,MAAM,EAAEE,KAAK,CAAC;EAC5B,CAAC;EAED,IAAI,OAAOL,KAAK,CAAC,OAAO,CAAC,KAAK,UAAU,EAAE;IACxCC,IAAI,CAAC,OAAO,CAAC,GAAG,UAAUI,KAAU,EAAE;MACpC,IAAIH,OAAO,EAAE;QACXA,OAAO,GAAG,KAAK;QACf,MAAMG,KAAK;MACb;MACA,OAAOF,IAAI,CAAC,OAAO,EAAEE,KAAK,CAAC;IAC7B,CAAC;EACH;EAEA,IAAI,OAAOL,KAAK,CAAC,QAAQ,CAAC,KAAK,UAAU,EAAE;IACzCC,IAAI,CAAC,QAAQ,CAAC,GAAG,UAAUI,KAAU,EAAE;MACrC,IAAIH,OAAO,EAAE;QACXA,OAAO,GAAG,KAAK;QACf,OAAOG,KAAK;MACd;MACA,OAAOF,IAAI,CAAC,QAAQ,EAAEE,KAAK,CAAC;IAC9B,CAAC;EACH;EAEA,OAAOJ,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/asyncIterator.js b/node_modules/@babel/helpers/lib/helpers/asyncIterator.js new file mode 100644 index 0000000..ec1ea69 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/asyncIterator.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _asyncIterator; +function _asyncIterator(iterable) { + var method, + async, + sync, + retry = 2; + if (typeof Symbol !== "undefined") { + async = Symbol.asyncIterator; + sync = Symbol.iterator; + } + while (retry--) { + if (async && (method = iterable[async]) != null) { + return method.call(iterable); + } + if (sync && (method = iterable[sync]) != null) { + return new AsyncFromSyncIterator(method.call(iterable)); + } + async = "@@asyncIterator"; + sync = "@@iterator"; + } + throw new TypeError("Object is not async iterable"); +} +function AsyncFromSyncIterator(s) { + AsyncFromSyncIterator = function (s) { + this.s = s; + this.n = s.next; + }; + AsyncFromSyncIterator.prototype = { + s: null, + n: null, + next: function () { + return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); + }, + return: function (value) { + var ret = this.s["return"]; + if (ret === undefined) { + return Promise.resolve({ + value: value, + done: true + }); + } + return AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments)); + }, + throw: function (maybeError) { + var thr = this.s["return"]; + if (thr === undefined) { + return Promise.reject(maybeError); + } + return AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments)); + } + }; + function AsyncFromSyncIteratorContinuation(r) { + if (Object(r) !== r) { + return Promise.reject(new TypeError(r + " is not an object.")); + } + var done = r.done; + return Promise.resolve(r.value).then(function (value) { + return { + value: value, + done: done + }; + }); + } + return new AsyncFromSyncIterator(s); +} + +//# sourceMappingURL=asyncIterator.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/asyncIterator.js.map b/node_modules/@babel/helpers/lib/helpers/asyncIterator.js.map new file mode 100644 index 0000000..87fb7e6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/asyncIterator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_asyncIterator","iterable","method","async","sync","retry","Symbol","asyncIterator","iterator","call","AsyncFromSyncIterator","TypeError","s","n","next","prototype","AsyncFromSyncIteratorContinuation","apply","arguments","return","value","ret","undefined","Promise","resolve","done","throw","maybeError","thr","reject","r","Object","then"],"sources":["../../src/helpers/asyncIterator.ts"],"sourcesContent":["/* @minVersion 7.15.9 */\n\ntype AsyncIteratorFn = AsyncIterable[typeof Symbol.asyncIterator];\ntype SyncIteratorFn = Iterable[typeof Symbol.iterator];\n\nexport default function _asyncIterator(\n iterable: AsyncIterable | Iterable,\n) {\n var method: AsyncIteratorFn | SyncIteratorFn,\n async: typeof Symbol.asyncIterator | \"@@asyncIterator\" | undefined,\n sync: typeof Symbol.iterator | \"@@iterator\" | undefined,\n retry = 2;\n\n if (typeof Symbol !== \"undefined\") {\n async = Symbol.asyncIterator;\n sync = Symbol.iterator;\n }\n\n while (retry--) {\n // TypeScript doesn't have in-function narrowing, and TypeScript can't narrow\n // AsyncIterable | Iterable down to AsyncIterable. So let's use any here.\n if (async && (method = (iterable as any)[async]) != null) {\n return (method as AsyncIteratorFn).call(iterable as AsyncIterable);\n }\n // Same here, TypeScript can't narrow AsyncIterable | Iterable down to Iterable.\n if (sync && (method = (iterable as any)[sync]) != null) {\n return new AsyncFromSyncIterator(\n (method as SyncIteratorFn).call(iterable as Iterable),\n );\n }\n\n async = \"@@asyncIterator\";\n sync = \"@@iterator\";\n }\n\n throw new TypeError(\"Object is not async iterable\");\n}\n\n// AsyncFromSyncIterator is actually a class that implements AsyncIterator interface\ndeclare class AsyncFromSyncIterator\n implements AsyncIterator\n{\n s: Iterator;\n n: Iterator[\"next\"];\n constructor(s: Iterator);\n\n next(...args: [] | [TNext]): Promise>;\n return?(\n value?: TReturn | PromiseLike,\n ): Promise>;\n throw?(e?: any): Promise>;\n}\n\n// Actual implementation of AsyncFromSyncIterator starts here\n// class only exists in ES6, so we need to use the old school way\n// This makes ESLint and TypeScript complain a lot, but it's the only way\nfunction AsyncFromSyncIterator(s: any) {\n // @ts-expect-error - Intentionally overriding the constructor.\n AsyncFromSyncIterator = function (\n this: AsyncFromSyncIterator,\n s: Iterator,\n ) {\n this.s = s;\n this.n = s.next;\n };\n AsyncFromSyncIterator.prototype = {\n // Initiating the \"s\" and \"n\", use \"any\" to prevent TS from complaining\n /* SyncIterator */ s: null as any,\n /* SyncIterator.[[Next]] */ n: null as any,\n next: function () {\n return AsyncFromSyncIteratorContinuation(\n // Use \"arguments\" here for better compatibility and smaller bundle size\n // Intentionally casting \"arguments\" to an array for the type of func.apply\n this.n.apply(this.s, arguments as any as [] | [undefined]),\n );\n },\n return: function (value) {\n var ret = this.s[\"return\"];\n if (ret === undefined) {\n return Promise.resolve>({\n // \"TReturn | PromiseLike\" should have been unwrapped by Awaited,\n // but TypeScript choked, let's just casting it away\n value: value as TReturn,\n done: true,\n });\n }\n return AsyncFromSyncIteratorContinuation(\n ret.apply(\n this.s,\n // Use \"arguments\" here for better compatibility and smaller bundle size\n // Intentionally casting \"arguments\" to an array for the type of func.apply\n arguments as any as [] | [TReturn | PromiseLike],\n ),\n );\n },\n throw: function (maybeError?: any) {\n var thr = this.s[\"return\"];\n if (thr === undefined) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(maybeError);\n }\n return AsyncFromSyncIteratorContinuation(\n // Use \"arguments\" here for better compatibility and smaller bundle size\n // Intentionally casting \"arguments\" to an array for the type of func.apply\n thr.apply(this.s, arguments as any as [any]),\n );\n },\n } satisfies AsyncFromSyncIterator;\n\n function AsyncFromSyncIteratorContinuation(r: any) {\n // This step is _before_ calling AsyncFromSyncIteratorContinuation in the spec.\n if (Object(r) !== r) {\n return Promise.reject(new TypeError(r + \" is not an object.\"));\n }\n\n var done = r.done;\n return Promise.resolve(r.value).then>(\n function (value) {\n return { value: value, done: done };\n },\n );\n }\n\n return new AsyncFromSyncIterator(s);\n}\n"],"mappings":";;;;;;AAKe,SAASA,cAAcA,CACpCC,QAAwC,EACxC;EACA,IAAIC,MAA8C;IAChDC,KAAkE;IAClEC,IAAuD;IACvDC,KAAK,GAAG,CAAC;EAEX,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjCH,KAAK,GAAGG,MAAM,CAACC,aAAa;IAC5BH,IAAI,GAAGE,MAAM,CAACE,QAAQ;EACxB;EAEA,OAAOH,KAAK,EAAE,EAAE;IAGd,IAAIF,KAAK,IAAI,CAACD,MAAM,GAAID,QAAQ,CAASE,KAAK,CAAC,KAAK,IAAI,EAAE;MACxD,OAAQD,MAAM,CAAwBO,IAAI,CAACR,QAA4B,CAAC;IAC1E;IAEA,IAAIG,IAAI,IAAI,CAACF,MAAM,GAAID,QAAQ,CAASG,IAAI,CAAC,KAAK,IAAI,EAAE;MACtD,OAAO,IAAIM,qBAAqB,CAC7BR,MAAM,CAAuBO,IAAI,CAACR,QAAuB,CAC5D,CAAC;IACH;IAEAE,KAAK,GAAG,iBAAiB;IACzBC,IAAI,GAAG,YAAY;EACrB;EAEA,MAAM,IAAIO,SAAS,CAAC,8BAA8B,CAAC;AACrD;AAoBA,SAASD,qBAAqBA,CAAsCE,CAAM,EAAE;EAE1EF,qBAAqB,GAAG,SAAAA,CAEtBE,CAAc,EACd;IACA,IAAI,CAACA,CAAC,GAAGA,CAAC;IACV,IAAI,CAACC,CAAC,GAAGD,CAAC,CAACE,IAAI;EACjB,CAAC;EACDJ,qBAAqB,CAACK,SAAS,GAAG;IAEbH,CAAC,EAAE,IAAW;IACLC,CAAC,EAAE,IAAW;IAC1CC,IAAI,EAAE,SAAAA,CAA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F,CAAC;EACH;EAEA,OAAO,IAAIf,qBAAqB,CAACE,CAAC,CAAC;AACrC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/asyncToGenerator.js b/node_modules/@babel/helpers/lib/helpers/asyncToGenerator.js new file mode 100644 index 0000000..9fec08d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/asyncToGenerator.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _asyncToGenerator; +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; +} + +//# sourceMappingURL=asyncToGenerator.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/asyncToGenerator.js.map b/node_modules/@babel/helpers/lib/helpers/asyncToGenerator.js.map new file mode 100644 index 0000000..3f8ac55 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/asyncToGenerator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined"],"sources":["../../src/helpers/asyncToGenerator.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nfunction asyncGeneratorStep(\n gen: Generator>,\n resolve: (value: TReturn) => void,\n reject: (error: unknown) => void,\n _next: (value: Awaited | undefined) => void,\n _throw: (err: unknown) => void,\n key: \"next\",\n arg: Awaited | undefined,\n): void;\nfunction asyncGeneratorStep(\n gen: Generator>,\n resolve: (value: TReturn) => void,\n reject: (error: unknown) => void,\n _next: (value: Awaited | undefined) => void,\n _throw: (err: unknown) => void,\n key: \"throw\",\n arg: unknown,\n): void;\nfunction asyncGeneratorStep(\n gen: Generator>,\n resolve: (value: TReturn) => void,\n reject: (error: unknown) => void,\n _next: (value: Awaited | undefined) => void,\n _throw: (err: unknown) => void,\n key: \"next\" | \"throw\",\n arg: any,\n): void {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n // The \"value\" variable is defined above before the \"info.done\" guard\n // So TypeScript can't narrowing \"value\" to TReturn here\n // If we use \"info.value\" here the type is narrowed correctly.\n // Still requires manual casting for the smaller bundle size.\n resolve(value as TReturn);\n } else {\n // Same as above, TypeScript can't narrow \"value\" to TYield here\n Promise.resolve(value as TYield).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator<\n This,\n Args extends unknown[],\n TYield,\n TReturn,\n>(\n fn: (\n this: This,\n ...args: Args\n ) => Generator>,\n): (this: This, ...args: Args) => Promise {\n return function (this: any) {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n // Casting \"args\" to \"Args\" is intentional since we are trying to avoid the spread operator (not ES5)\n var gen = fn.apply(self, args as any as Args);\n function _next(value: Awaited | undefined) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err: unknown) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n"],"mappings":";;;;;;AAoBA,SAASA,kBAAkBA,CACzBC,GAAgD,EAChDC,OAAiC,EACjCC,MAAgC,EAChCC,KAAmD,EACnDC,MAA8B,EAC9BC,GAAqB,EACrBC,GAAQ,EACF;EACN,IAAI;IACF,IAAIC,IAAI,GAAGP,GAAG,CAACK,GAAG,CAAC,CAACC,GAAG,CAAC;IACxB,IAAIE,KAAK,GAAGD,IAAI,CAACC,KAAK;EACxB,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdP,MAAM,CAACO,KAAK,CAAC;IACb;EACF;EAEA,IAAIF,IAAI,CAACG,IAAI,EAAE;IAKbT,OAAO,CAACO,KAAgB,CAAC;EAC3B,CAAC,MAAM;IAELG,OAAO,CAACV,OAAO,CAACO,KAAe,CAAC,CAACI,IAAI,CAACT,KAAK,EAAEC,MAAM,CAAC;EACtD;AACF;AAEe,SAASS,iBAAiBA,CAMvCC,EAGgD,EACC;EACjD,OAAO,YAAqB;IAC1B,IAAIC,IAAI,GAAG,IAAI;MACbC,IAAI,GAAGC,SAAS;IAClB,OAAO,IAAIN,OAAO,CAAC,UAAUV,OAAO,EAAEC,MAAM,EAAE;MAE5C,IAAIF,GAAG,GAAGc,EAAE,CAACI,KAAK,CAACH,IAAI,EAAEC,IAAmB,CAAC;MAC7C,SAASb,KAAKA,CAACK,KAAkC,EAAE;QACjDT,kBAAkB,CAACC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAE,MAAM,EAAEI,KAAK,CAAC;MACxE;MACA,SAASJ,MAAMA,CAACe,GAAY,EAAE;QAC5BpB,kBAAkB,CAACC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAE,OAAO,EAAEe,GAAG,CAAC;MACvE;MAEAhB,KAAK,CAACiB,SAAS,CAAC;IAClB,CAAC,CAAC;EACJ,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js b/node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js new file mode 100644 index 0000000..1338393 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _awaitAsyncGenerator; +var _OverloadYield = require("./OverloadYield.js"); +function _awaitAsyncGenerator(value) { + return new _OverloadYield.default(value, 0); +} + +//# sourceMappingURL=awaitAsyncGenerator.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js.map b/node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js.map new file mode 100644 index 0000000..01d2295 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_OverloadYield","require","_awaitAsyncGenerator","value","OverloadYield"],"sources":["../../src/helpers/awaitAsyncGenerator.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport OverloadYield from \"./OverloadYield.ts\";\n\nexport default function _awaitAsyncGenerator(value: T) {\n return new OverloadYield(value, /* kind: await */ 0);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAEe,SAASC,oBAAoBA,CAAIC,KAAQ,EAAE;EACxD,OAAO,IAAIC,sBAAa,CAAID,KAAK,EAAoB,CAAC,CAAC;AACzD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/callSuper.js b/node_modules/@babel/helpers/lib/helpers/callSuper.js new file mode 100644 index 0000000..2be00ab --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/callSuper.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _callSuper; +var _getPrototypeOf = require("./getPrototypeOf.js"); +var _isNativeReflectConstruct = require("./isNativeReflectConstruct.js"); +var _possibleConstructorReturn = require("./possibleConstructorReturn.js"); +function _callSuper(_this, derived, args) { + derived = (0, _getPrototypeOf.default)(derived); + return (0, _possibleConstructorReturn.default)(_this, (0, _isNativeReflectConstruct.default)() ? Reflect.construct(derived, args || [], (0, _getPrototypeOf.default)(_this).constructor) : derived.apply(_this, args)); +} + +//# sourceMappingURL=callSuper.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/callSuper.js.map b/node_modules/@babel/helpers/lib/helpers/callSuper.js.map new file mode 100644 index 0000000..7177eeb --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/callSuper.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_getPrototypeOf","require","_isNativeReflectConstruct","_possibleConstructorReturn","_callSuper","_this","derived","args","getPrototypeOf","possibleConstructorReturn","isNativeReflectConstruct","Reflect","construct","constructor","apply"],"sources":["../../src/helpers/callSuper.ts"],"sourcesContent":["/* @minVersion 7.23.8 */\n\n// This is duplicated to packages/babel-plugin-transform-classes/src/inline-callSuper-helpers.ts\n\nimport getPrototypeOf from \"./getPrototypeOf.ts\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.ts\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.ts\";\n\nexport default function _callSuper(\n _this: object,\n derived: Function,\n args: ArrayLike,\n) {\n // Super\n derived = getPrototypeOf(derived);\n return possibleConstructorReturn(\n _this,\n isNativeReflectConstruct()\n ? // NOTE: This doesn't work if this.__proto__.constructor has been modified.\n Reflect.construct(\n derived,\n args || [],\n getPrototypeOf(_this).constructor,\n )\n : derived.apply(_this, args),\n );\n}\n"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAEe,SAASG,UAAUA,CAChCC,KAAa,EACbC,OAAiB,EACjBC,IAAoB,EACpB;EAEAD,OAAO,GAAG,IAAAE,uBAAc,EAACF,OAAO,CAAC;EACjC,OAAO,IAAAG,kCAAyB,EAC9BJ,KAAK,EACL,IAAAK,iCAAwB,EAAC,CAAC,GAEtBC,OAAO,CAACC,SAAS,CACfN,OAAO,EACPC,IAAI,IAAI,EAAE,EACV,IAAAC,uBAAc,EAACH,KAAK,CAAC,CAACQ,WACxB,CAAC,GACDP,OAAO,CAACQ,KAAK,CAACT,KAAK,EAAEE,IAAI,CAC/B,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/checkInRHS.js b/node_modules/@babel/helpers/lib/helpers/checkInRHS.js new file mode 100644 index 0000000..0a6d3c7 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/checkInRHS.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _checkInRHS; +function _checkInRHS(value) { + if (Object(value) !== value) { + throw TypeError("right-hand side of 'in' should be an object, got " + (value !== null ? typeof value : "null")); + } + return value; +} + +//# sourceMappingURL=checkInRHS.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/checkInRHS.js.map b/node_modules/@babel/helpers/lib/helpers/checkInRHS.js.map new file mode 100644 index 0000000..5bcc4cc --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/checkInRHS.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_checkInRHS","value","Object","TypeError"],"sources":["../../src/helpers/checkInRHS.ts"],"sourcesContent":["/* @minVersion 7.20.5 */\n\nexport default function _checkInRHS(value: unknown) {\n if (Object(value) !== value) {\n throw TypeError(\n \"right-hand side of 'in' should be an object, got \" +\n (value !== null ? typeof value : \"null\"),\n );\n }\n return value;\n}\n"],"mappings":";;;;;;AAEe,SAASA,WAAWA,CAACC,KAAc,EAAE;EAClD,IAAIC,MAAM,CAACD,KAAK,CAAC,KAAKA,KAAK,EAAE;IAC3B,MAAME,SAAS,CACb,mDAAmD,IAChDF,KAAK,KAAK,IAAI,GAAG,OAAOA,KAAK,GAAG,MAAM,CAC3C,CAAC;EACH;EACA,OAAOA,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/checkPrivateRedeclaration.js b/node_modules/@babel/helpers/lib/helpers/checkPrivateRedeclaration.js new file mode 100644 index 0000000..b14520e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/checkPrivateRedeclaration.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _checkPrivateRedeclaration; +function _checkPrivateRedeclaration(obj, privateCollection) { + if (privateCollection.has(obj)) { + throw new TypeError("Cannot initialize the same private elements twice on an object"); + } +} + +//# sourceMappingURL=checkPrivateRedeclaration.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/checkPrivateRedeclaration.js.map b/node_modules/@babel/helpers/lib/helpers/checkPrivateRedeclaration.js.map new file mode 100644 index 0000000..9170bc5 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/checkPrivateRedeclaration.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_checkPrivateRedeclaration","obj","privateCollection","has","TypeError"],"sources":["../../src/helpers/checkPrivateRedeclaration.ts"],"sourcesContent":["/* @minVersion 7.14.1 */\n\nexport default function _checkPrivateRedeclaration(\n obj: object,\n privateCollection: WeakMap | WeakSet,\n) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\n \"Cannot initialize the same private elements twice on an object\",\n );\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,0BAA0BA,CAChDC,GAAW,EACXC,iBAA6D,EAC7D;EACA,IAAIA,iBAAiB,CAACC,GAAG,CAACF,GAAG,CAAC,EAAE;IAC9B,MAAM,IAAIG,SAAS,CACjB,gEACF,CAAC;EACH;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorDestructureSet.js b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorDestructureSet.js new file mode 100644 index 0000000..0159ce6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorDestructureSet.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classApplyDescriptorDestructureSet; +function _classApplyDescriptorDestructureSet(receiver, descriptor) { + if (descriptor.set) { + if (!("__destrObj" in descriptor)) { + descriptor.__destrObj = { + set value(v) { + descriptor.set.call(receiver, v); + } + }; + } + return descriptor.__destrObj; + } else { + if (!descriptor.writable) { + throw new TypeError("attempted to set read only private field"); + } + return descriptor; + } +} + +//# sourceMappingURL=classApplyDescriptorDestructureSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorDestructureSet.js.map b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorDestructureSet.js.map new file mode 100644 index 0000000..3cb2557 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorDestructureSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorDestructureSet","receiver","descriptor","set","__destrObj","value","v","call","writable","TypeError"],"sources":["../../src/helpers/classApplyDescriptorDestructureSet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nexport default function _classApplyDescriptorDestructureSet(\n receiver,\n descriptor,\n) {\n if (descriptor.set) {\n if (!(\"__destrObj\" in descriptor)) {\n descriptor.__destrObj = {\n set value(v) {\n descriptor.set.call(receiver, v);\n },\n };\n }\n return descriptor.__destrObj;\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n return descriptor;\n }\n}\n"],"mappings":";;;;;;AAGe,SAASA,mCAAmCA,CACzDC,QAAQ,EACRC,UAAU,EACV;EACA,IAAIA,UAAU,CAACC,GAAG,EAAE;IAClB,IAAI,EAAE,YAAY,IAAID,UAAU,CAAC,EAAE;MACjCA,UAAU,CAACE,UAAU,GAAG;QACtB,IAAIC,KAAKA,CAACC,CAAC,EAAE;UACXJ,UAAU,CAACC,GAAG,CAACI,IAAI,CAACN,QAAQ,EAAEK,CAAC,CAAC;QAClC;MACF,CAAC;IACH;IACA,OAAOJ,UAAU,CAACE,UAAU;EAC9B,CAAC,MAAM;IACL,IAAI,CAACF,UAAU,CAACM,QAAQ,EAAE;MAIxB,MAAM,IAAIC,SAAS,CAAC,0CAA0C,CAAC;IACjE;IAEA,OAAOP,UAAU;EACnB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorGet.js b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorGet.js new file mode 100644 index 0000000..0730734 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorGet.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classApplyDescriptorGet; +function _classApplyDescriptorGet(receiver, descriptor) { + if (descriptor.get) { + return descriptor.get.call(receiver); + } + return descriptor.value; +} + +//# sourceMappingURL=classApplyDescriptorGet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorGet.js.map b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorGet.js.map new file mode 100644 index 0000000..45fabb9 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorGet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorGet","receiver","descriptor","get","call","value"],"sources":["../../src/helpers/classApplyDescriptorGet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nexport default function _classApplyDescriptorGet(receiver, descriptor) {\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,wBAAwBA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EACrE,IAAIA,UAAU,CAACC,GAAG,EAAE;IAClB,OAAOD,UAAU,CAACC,GAAG,CAACC,IAAI,CAACH,QAAQ,CAAC;EACtC;EACA,OAAOC,UAAU,CAACG,KAAK;AACzB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorSet.js b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorSet.js new file mode 100644 index 0000000..a0ffc8a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorSet.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classApplyDescriptorSet; +function _classApplyDescriptorSet(receiver, descriptor, value) { + if (descriptor.set) { + descriptor.set.call(receiver, value); + } else { + if (!descriptor.writable) { + throw new TypeError("attempted to set read only private field"); + } + descriptor.value = value; + } +} + +//# sourceMappingURL=classApplyDescriptorSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorSet.js.map b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorSet.js.map new file mode 100644 index 0000000..5438c78 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classApplyDescriptorSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorSet","receiver","descriptor","value","set","call","writable","TypeError"],"sources":["../../src/helpers/classApplyDescriptorSet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nexport default function _classApplyDescriptorSet(receiver, descriptor, value) {\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n descriptor.value = value;\n }\n}\n"],"mappings":";;;;;;AAGe,SAASA,wBAAwBA,CAACC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,EAAE;EAC5E,IAAID,UAAU,CAACE,GAAG,EAAE;IAClBF,UAAU,CAACE,GAAG,CAACC,IAAI,CAACJ,QAAQ,EAAEE,KAAK,CAAC;EACtC,CAAC,MAAM;IACL,IAAI,CAACD,UAAU,CAACI,QAAQ,EAAE;MAIxB,MAAM,IAAIC,SAAS,CAAC,0CAA0C,CAAC;IACjE;IACAL,UAAU,CAACC,KAAK,GAAGA,KAAK;EAC1B;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classCallCheck.js b/node_modules/@babel/helpers/lib/helpers/classCallCheck.js new file mode 100644 index 0000000..9b56e55 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classCallCheck.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classCallCheck; +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +//# sourceMappingURL=classCallCheck.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classCallCheck.js.map b/node_modules/@babel/helpers/lib/helpers/classCallCheck.js.map new file mode 100644 index 0000000..041b85c --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classCallCheck.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classCallCheck","instance","Constructor","TypeError"],"sources":["../../src/helpers/classCallCheck.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _classCallCheck(\n instance: unknown,\n Constructor: new (...args: any[]) => T,\n): asserts instance is T {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CACrCC,QAAiB,EACjBC,WAAsC,EACf;EACvB,IAAI,EAAED,QAAQ,YAAYC,WAAW,CAAC,EAAE;IACtC,MAAM,IAAIC,SAAS,CAAC,mCAAmC,CAAC;EAC1D;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticAccess.js b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticAccess.js new file mode 100644 index 0000000..d6adf18 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticAccess.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classCheckPrivateStaticAccess; +var _assertClassBrand = require("assertClassBrand"); +function _classCheckPrivateStaticAccess(receiver, classConstructor, returnValue) { + return _assertClassBrand(classConstructor, receiver, returnValue); +} + +//# sourceMappingURL=classCheckPrivateStaticAccess.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticAccess.js.map b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticAccess.js.map new file mode 100644 index 0000000..34add34 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticAccess.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","require","_classCheckPrivateStaticAccess","receiver","classConstructor","returnValue","assertClassBrand"],"sources":["../../src/helpers/classCheckPrivateStaticAccess.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nimport assertClassBrand from \"assertClassBrand\";\nexport default function _classCheckPrivateStaticAccess(\n receiver,\n classConstructor,\n returnValue,\n) {\n return assertClassBrand(classConstructor, receiver, returnValue);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,iBAAA,GAAAC,OAAA;AACe,SAASC,8BAA8BA,CACpDC,QAAQ,EACRC,gBAAgB,EAChBC,WAAW,EACX;EACA,OAAOC,iBAAgB,CAACF,gBAAgB,EAAED,QAAQ,EAAEE,WAAW,CAAC;AAClE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticFieldDescriptor.js b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticFieldDescriptor.js new file mode 100644 index 0000000..6d96b72 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticFieldDescriptor.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classCheckPrivateStaticFieldDescriptor; +function _classCheckPrivateStaticFieldDescriptor(descriptor, action) { + if (descriptor === undefined) { + throw new TypeError("attempted to " + action + " private static field before its declaration"); + } +} + +//# sourceMappingURL=classCheckPrivateStaticFieldDescriptor.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticFieldDescriptor.js.map b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticFieldDescriptor.js.map new file mode 100644 index 0000000..183b321 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classCheckPrivateStaticFieldDescriptor.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classCheckPrivateStaticFieldDescriptor","descriptor","action","undefined","TypeError"],"sources":["../../src/helpers/classCheckPrivateStaticFieldDescriptor.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nexport default function _classCheckPrivateStaticFieldDescriptor(\n descriptor,\n action,\n) {\n if (descriptor === undefined) {\n throw new TypeError(\n \"attempted to \" + action + \" private static field before its declaration\",\n );\n }\n}\n"],"mappings":";;;;;;AAGe,SAASA,uCAAuCA,CAC7DC,UAAU,EACVC,MAAM,EACN;EACA,IAAID,UAAU,KAAKE,SAAS,EAAE;IAC5B,MAAM,IAAIC,SAAS,CACjB,eAAe,GAAGF,MAAM,GAAG,8CAC7B,CAAC;EACH;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classExtractFieldDescriptor.js b/node_modules/@babel/helpers/lib/helpers/classExtractFieldDescriptor.js new file mode 100644 index 0000000..aee037e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classExtractFieldDescriptor.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classExtractFieldDescriptor; +var _classPrivateFieldGet = require("classPrivateFieldGet2"); +function _classExtractFieldDescriptor(receiver, privateMap) { + return _classPrivateFieldGet(privateMap, receiver); +} + +//# sourceMappingURL=classExtractFieldDescriptor.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classExtractFieldDescriptor.js.map b/node_modules/@babel/helpers/lib/helpers/classExtractFieldDescriptor.js.map new file mode 100644 index 0000000..e6e81e8 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classExtractFieldDescriptor.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classPrivateFieldGet","require","_classExtractFieldDescriptor","receiver","privateMap","classPrivateFieldGet2"],"sources":["../../src/helpers/classExtractFieldDescriptor.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\n\nexport default function _classExtractFieldDescriptor(receiver, privateMap) {\n return classPrivateFieldGet2(privateMap, receiver);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,qBAAA,GAAAC,OAAA;AAEe,SAASC,4BAA4BA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EACzE,OAAOC,qBAAqB,CAACD,UAAU,EAAED,QAAQ,CAAC;AACpD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classNameTDZError.js b/node_modules/@babel/helpers/lib/helpers/classNameTDZError.js new file mode 100644 index 0000000..6adfc09 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classNameTDZError.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classNameTDZError; +function _classNameTDZError(name) { + throw new ReferenceError('Class "' + name + '" cannot be referenced in computed property keys.'); +} + +//# sourceMappingURL=classNameTDZError.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classNameTDZError.js.map b/node_modules/@babel/helpers/lib/helpers/classNameTDZError.js.map new file mode 100644 index 0000000..a640081 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classNameTDZError.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classNameTDZError","name","ReferenceError"],"sources":["../../src/helpers/classNameTDZError.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _classNameTDZError(name) {\n throw new ReferenceError(\n 'Class \"' + name + '\" cannot be referenced in computed property keys.',\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,kBAAkBA,CAACC,IAAI,EAAE;EAC/C,MAAM,IAAIC,cAAc,CACtB,SAAS,GAAGD,IAAI,GAAG,mDACrB,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldDestructureSet.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldDestructureSet.js new file mode 100644 index 0000000..caeb8a5 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldDestructureSet.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldDestructureSet; +var _classApplyDescriptorDestructureSet = require("classApplyDescriptorDestructureSet"); +var _classPrivateFieldGet = require("classPrivateFieldGet2"); +function _classPrivateFieldDestructureSet(receiver, privateMap) { + var descriptor = _classPrivateFieldGet(privateMap, receiver); + return _classApplyDescriptorDestructureSet(receiver, descriptor); +} + +//# sourceMappingURL=classPrivateFieldDestructureSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldDestructureSet.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldDestructureSet.js.map new file mode 100644 index 0000000..ab46f77 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldDestructureSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorDestructureSet","require","_classPrivateFieldGet","_classPrivateFieldDestructureSet","receiver","privateMap","descriptor","classPrivateFieldGet2","classApplyDescriptorDestructureSet"],"sources":["../../src/helpers/classPrivateFieldDestructureSet.js"],"sourcesContent":["/* @minVersion 7.4.4 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorDestructureSet from \"classApplyDescriptorDestructureSet\";\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\nexport default function _classPrivateFieldDestructureSet(receiver, privateMap) {\n var descriptor = classPrivateFieldGet2(privateMap, receiver);\n return classApplyDescriptorDestructureSet(receiver, descriptor);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,mCAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACe,SAASE,gCAAgCA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EAC7E,IAAIC,UAAU,GAAGC,qBAAqB,CAACF,UAAU,EAAED,QAAQ,CAAC;EAC5D,OAAOI,mCAAkC,CAACJ,QAAQ,EAAEE,UAAU,CAAC;AACjE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet.js new file mode 100644 index 0000000..225733f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldGet; +var _classApplyDescriptorGet = require("classApplyDescriptorGet"); +var _classPrivateFieldGet2 = require("classPrivateFieldGet2"); +function _classPrivateFieldGet(receiver, privateMap) { + var descriptor = _classPrivateFieldGet2(privateMap, receiver); + return _classApplyDescriptorGet(receiver, descriptor); +} + +//# sourceMappingURL=classPrivateFieldGet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet.js.map new file mode 100644 index 0000000..8ba6a91 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorGet","require","_classPrivateFieldGet2","_classPrivateFieldGet","receiver","privateMap","descriptor","classPrivateFieldGet2","classApplyDescriptorGet"],"sources":["../../src/helpers/classPrivateFieldGet.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorGet from \"classApplyDescriptorGet\";\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\nexport default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = classPrivateFieldGet2(privateMap, receiver);\n return classApplyDescriptorGet(receiver, descriptor);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACe,SAASE,qBAAqBA,CAACC,QAAQ,EAAEC,UAAU,EAAE;EAClE,IAAIC,UAAU,GAAGC,sBAAqB,CAACF,UAAU,EAAED,QAAQ,CAAC;EAC5D,OAAOI,wBAAuB,CAACJ,QAAQ,EAAEE,UAAU,CAAC;AACtD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet2.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet2.js new file mode 100644 index 0000000..655c903 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet2.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldGet2; +var _assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateFieldGet2(privateMap, receiver) { + return privateMap.get((0, _assertClassBrand.default)(privateMap, receiver)); +} + +//# sourceMappingURL=classPrivateFieldGet2.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet2.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet2.js.map new file mode 100644 index 0000000..fbc62e4 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldGet2.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","require","_classPrivateFieldGet2","privateMap","receiver","get","assertClassBrand"],"sources":["../../src/helpers/classPrivateFieldGet2.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nimport assertClassBrand from \"./assertClassBrand.ts\";\n\nexport default function _classPrivateFieldGet2(\n privateMap: WeakMap,\n receiver: any,\n) {\n return privateMap.get(assertClassBrand(privateMap, receiver));\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,sBAAsBA,CAC5CC,UAA6B,EAC7BC,QAAa,EACb;EACA,OAAOD,UAAU,CAACE,GAAG,CAAC,IAAAC,yBAAgB,EAACH,UAAU,EAAEC,QAAQ,CAAC,CAAC;AAC/D","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldInitSpec.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldInitSpec.js new file mode 100644 index 0000000..db6806b --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldInitSpec.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldInitSpec; +var _checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js"); +function _classPrivateFieldInitSpec(obj, privateMap, value) { + (0, _checkPrivateRedeclaration.default)(obj, privateMap); + privateMap.set(obj, value); +} + +//# sourceMappingURL=classPrivateFieldInitSpec.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldInitSpec.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldInitSpec.js.map new file mode 100644 index 0000000..24b691d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldInitSpec.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_checkPrivateRedeclaration","require","_classPrivateFieldInitSpec","obj","privateMap","value","checkPrivateRedeclaration","set"],"sources":["../../src/helpers/classPrivateFieldInitSpec.ts"],"sourcesContent":["/* @minVersion 7.14.1 */\n\nimport checkPrivateRedeclaration from \"./checkPrivateRedeclaration.ts\";\n\nexport default function _classPrivateFieldInitSpec(\n obj: object,\n privateMap: WeakMap,\n value: unknown,\n) {\n checkPrivateRedeclaration(obj, privateMap);\n privateMap.set(obj, value);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,0BAAA,GAAAC,OAAA;AAEe,SAASC,0BAA0BA,CAChDC,GAAW,EACXC,UAAoC,EACpCC,KAAc,EACd;EACA,IAAAC,kCAAyB,EAACH,GAAG,EAAEC,UAAU,CAAC;EAC1CA,UAAU,CAACG,GAAG,CAACJ,GAAG,EAAEE,KAAK,CAAC;AAC5B","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseBase.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseBase.js new file mode 100644 index 0000000..d89790b --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseBase.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldBase; +function _classPrivateFieldBase(receiver, privateKey) { + if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { + throw new TypeError("attempted to use private field on non-instance"); + } + return receiver; +} + +//# sourceMappingURL=classPrivateFieldLooseBase.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseBase.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseBase.js.map new file mode 100644 index 0000000..187b029 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseBase.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classPrivateFieldBase","receiver","privateKey","Object","prototype","hasOwnProperty","call","TypeError"],"sources":["../../src/helpers/classPrivateFieldLooseBase.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _classPrivateFieldBase(\n receiver: T,\n privateKey: PropertyKey,\n) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError(\"attempted to use private field on non-instance\");\n }\n return receiver;\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAC5CC,QAAW,EACXC,UAAuB,EACvB;EACA,IAAI,CAACC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,QAAQ,EAAEC,UAAU,CAAC,EAAE;IAC/D,MAAM,IAAIK,SAAS,CAAC,gDAAgD,CAAC;EACvE;EACA,OAAON,QAAQ;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseKey.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseKey.js new file mode 100644 index 0000000..5c3dac4 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseKey.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldKey; +var id = 0; +function _classPrivateFieldKey(name) { + return "__private_" + id++ + "_" + name; +} + +//# sourceMappingURL=classPrivateFieldLooseKey.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseKey.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseKey.js.map new file mode 100644 index 0000000..6b84014 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldLooseKey.js.map @@ -0,0 +1 @@ +{"version":3,"names":["id","_classPrivateFieldKey","name"],"sources":["../../src/helpers/classPrivateFieldLooseKey.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nvar id = 0;\nexport default function _classPrivateFieldKey(name: string) {\n return \"__private_\" + id++ + \"_\" + name;\n}\n"],"mappings":";;;;;;AAEA,IAAIA,EAAE,GAAG,CAAC;AACK,SAASC,qBAAqBA,CAACC,IAAY,EAAE;EAC1D,OAAO,YAAY,GAAGF,EAAE,EAAE,GAAG,GAAG,GAAGE,IAAI;AACzC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet.js new file mode 100644 index 0000000..f246619 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldSet; +var _classApplyDescriptorSet = require("classApplyDescriptorSet"); +var _classPrivateFieldGet = require("classPrivateFieldGet2"); +function _classPrivateFieldSet(receiver, privateMap, value) { + var descriptor = _classPrivateFieldGet(privateMap, receiver); + _classApplyDescriptorSet(receiver, descriptor, value); + return value; +} + +//# sourceMappingURL=classPrivateFieldSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet.js.map new file mode 100644 index 0000000..67802c5 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorSet","require","_classPrivateFieldGet","_classPrivateFieldSet","receiver","privateMap","value","descriptor","classPrivateFieldGet2","classApplyDescriptorSet"],"sources":["../../src/helpers/classPrivateFieldSet.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorSet from \"classApplyDescriptorSet\";\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\nexport default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = classPrivateFieldGet2(privateMap, receiver);\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACe,SAASE,qBAAqBA,CAACC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,EAAE;EACzE,IAAIC,UAAU,GAAGC,qBAAqB,CAACH,UAAU,EAAED,QAAQ,CAAC;EAC5DK,wBAAuB,CAACL,QAAQ,EAAEG,UAAU,EAAED,KAAK,CAAC;EACpD,OAAOA,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet2.js b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet2.js new file mode 100644 index 0000000..19cfe7f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet2.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateFieldSet2; +var _assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateFieldSet2(privateMap, receiver, value) { + privateMap.set((0, _assertClassBrand.default)(privateMap, receiver), value); + return value; +} + +//# sourceMappingURL=classPrivateFieldSet2.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet2.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet2.js.map new file mode 100644 index 0000000..26a4e30 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateFieldSet2.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","require","_classPrivateFieldSet2","privateMap","receiver","value","set","assertClassBrand"],"sources":["../../src/helpers/classPrivateFieldSet2.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nimport assertClassBrand from \"./assertClassBrand.ts\";\n\nexport default function _classPrivateFieldSet2(\n privateMap: WeakMap,\n receiver: any,\n value: any,\n) {\n privateMap.set(assertClassBrand(privateMap, receiver), value);\n return value;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,sBAAsBA,CAC5CC,UAA6B,EAC7BC,QAAa,EACbC,KAAU,EACV;EACAF,UAAU,CAACG,GAAG,CAAC,IAAAC,yBAAgB,EAACJ,UAAU,EAAEC,QAAQ,CAAC,EAAEC,KAAK,CAAC;EAC7D,OAAOA,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateGetter.js b/node_modules/@babel/helpers/lib/helpers/classPrivateGetter.js new file mode 100644 index 0000000..ed413e0 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateGetter.js @@ -0,0 +1,12 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateGetter; +var _assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateGetter(privateMap, receiver, getter) { + return getter((0, _assertClassBrand.default)(privateMap, receiver)); +} + +//# sourceMappingURL=classPrivateGetter.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateGetter.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateGetter.js.map new file mode 100644 index 0000000..2799dc4 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateGetter.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","require","_classPrivateGetter","privateMap","receiver","getter","assertClassBrand"],"sources":["../../src/helpers/classPrivateGetter.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nimport assertClassBrand from \"./assertClassBrand.ts\";\n\nexport default function _classPrivateGetter(\n privateMap: WeakMap | WeakSet,\n receiver: any,\n getter: Function,\n) {\n return getter(assertClassBrand(privateMap, receiver));\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,mBAAmBA,CACzCC,UAA4C,EAC5CC,QAAa,EACbC,MAAgB,EAChB;EACA,OAAOA,MAAM,CAAC,IAAAC,yBAAgB,EAACH,UAAU,EAAEC,QAAQ,CAAC,CAAC;AACvD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateMethodGet.js b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodGet.js new file mode 100644 index 0000000..a42ba7a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodGet.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateMethodGet; +var _assertClassBrand = require("assertClassBrand"); +function _classPrivateMethodGet(receiver, privateSet, fn) { + _assertClassBrand(privateSet, receiver); + return fn; +} + +//# sourceMappingURL=classPrivateMethodGet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateMethodGet.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodGet.js.map new file mode 100644 index 0000000..fbdb746 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodGet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","require","_classPrivateMethodGet","receiver","privateSet","fn","assertClassBrand"],"sources":["../../src/helpers/classPrivateMethodGet.js"],"sourcesContent":["/* @minVersion 7.1.6 */\n/* @onlyBabel7 */\n\nimport assertClassBrand from \"assertClassBrand\";\nexport default function _classPrivateMethodGet(receiver, privateSet, fn) {\n assertClassBrand(privateSet, receiver);\n return fn;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,iBAAA,GAAAC,OAAA;AACe,SAASC,sBAAsBA,CAACC,QAAQ,EAAEC,UAAU,EAAEC,EAAE,EAAE;EACvEC,iBAAgB,CAACF,UAAU,EAAED,QAAQ,CAAC;EACtC,OAAOE,EAAE;AACX","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateMethodInitSpec.js b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodInitSpec.js new file mode 100644 index 0000000..efc9502 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodInitSpec.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateMethodInitSpec; +var _checkPrivateRedeclaration = require("./checkPrivateRedeclaration.js"); +function _classPrivateMethodInitSpec(obj, privateSet) { + (0, _checkPrivateRedeclaration.default)(obj, privateSet); + privateSet.add(obj); +} + +//# sourceMappingURL=classPrivateMethodInitSpec.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateMethodInitSpec.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodInitSpec.js.map new file mode 100644 index 0000000..98bf9ec --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodInitSpec.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_checkPrivateRedeclaration","require","_classPrivateMethodInitSpec","obj","privateSet","checkPrivateRedeclaration","add"],"sources":["../../src/helpers/classPrivateMethodInitSpec.ts"],"sourcesContent":["/* @minVersion 7.14.1 */\n\nimport checkPrivateRedeclaration from \"./checkPrivateRedeclaration.ts\";\n\nexport default function _classPrivateMethodInitSpec(\n obj: object,\n privateSet: WeakSet,\n) {\n checkPrivateRedeclaration(obj, privateSet);\n privateSet.add(obj);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,0BAAA,GAAAC,OAAA;AAEe,SAASC,2BAA2BA,CACjDC,GAAW,EACXC,UAA2B,EAC3B;EACA,IAAAC,kCAAyB,EAACF,GAAG,EAAEC,UAAU,CAAC;EAC1CA,UAAU,CAACE,GAAG,CAACH,GAAG,CAAC;AACrB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateMethodSet.js b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodSet.js new file mode 100644 index 0000000..4949058 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodSet.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateMethodSet; +function _classPrivateMethodSet() { + throw new TypeError("attempted to reassign private method"); +} + +//# sourceMappingURL=classPrivateMethodSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateMethodSet.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodSet.js.map new file mode 100644 index 0000000..ec8a20f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateMethodSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classPrivateMethodSet","TypeError"],"sources":["../../src/helpers/classPrivateMethodSet.js"],"sourcesContent":["/* @minVersion 7.1.6 */\n/* @onlyBabel7 */\n\n// use readOnlyError instead of attemptSet\n\nexport default function _classPrivateMethodSet() {\n throw new TypeError(\"attempted to reassign private method\");\n}\n"],"mappings":";;;;;;AAKe,SAASA,sBAAsBA,CAAA,EAAG;EAC/C,MAAM,IAAIC,SAAS,CAAC,sCAAsC,CAAC;AAC7D","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateSetter.js b/node_modules/@babel/helpers/lib/helpers/classPrivateSetter.js new file mode 100644 index 0000000..f02ce7a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateSetter.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classPrivateSetter; +var _assertClassBrand = require("./assertClassBrand.js"); +function _classPrivateSetter(privateMap, setter, receiver, value) { + setter((0, _assertClassBrand.default)(privateMap, receiver), value); + return value; +} + +//# sourceMappingURL=classPrivateSetter.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classPrivateSetter.js.map b/node_modules/@babel/helpers/lib/helpers/classPrivateSetter.js.map new file mode 100644 index 0000000..bbd9c5d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classPrivateSetter.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","require","_classPrivateSetter","privateMap","setter","receiver","value","assertClassBrand"],"sources":["../../src/helpers/classPrivateSetter.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nimport assertClassBrand from \"./assertClassBrand.ts\";\n\nexport default function _classPrivateSetter(\n privateMap: WeakMap | WeakSet,\n setter: Function,\n receiver: any,\n value: any,\n) {\n setter(assertClassBrand(privateMap, receiver), value);\n return value;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,mBAAmBA,CACzCC,UAA4C,EAC5CC,MAAgB,EAChBC,QAAa,EACbC,KAAU,EACV;EACAF,MAAM,CAAC,IAAAG,yBAAgB,EAACJ,UAAU,EAAEE,QAAQ,CAAC,EAAEC,KAAK,CAAC;EACrD,OAAOA,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldDestructureSet.js b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldDestructureSet.js new file mode 100644 index 0000000..2a60646 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldDestructureSet.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classStaticPrivateFieldDestructureSet; +var _classApplyDescriptorDestructureSet = require("classApplyDescriptorDestructureSet"); +var _assertClassBrand = require("assertClassBrand"); +var _classCheckPrivateStaticFieldDescriptor = require("classCheckPrivateStaticFieldDescriptor"); +function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) { + _assertClassBrand(classConstructor, receiver); + _classCheckPrivateStaticFieldDescriptor(descriptor, "set"); + return _classApplyDescriptorDestructureSet(receiver, descriptor); +} + +//# sourceMappingURL=classStaticPrivateFieldDestructureSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldDestructureSet.js.map b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldDestructureSet.js.map new file mode 100644 index 0000000..c25c924 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldDestructureSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorDestructureSet","require","_assertClassBrand","_classCheckPrivateStaticFieldDescriptor","_classStaticPrivateFieldDestructureSet","receiver","classConstructor","descriptor","assertClassBrand","classCheckPrivateStaticFieldDescriptor","classApplyDescriptorDestructureSet"],"sources":["../../src/helpers/classStaticPrivateFieldDestructureSet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorDestructureSet from \"classApplyDescriptorDestructureSet\";\nimport assertClassBrand from \"assertClassBrand\";\nimport classCheckPrivateStaticFieldDescriptor from \"classCheckPrivateStaticFieldDescriptor\";\nexport default function _classStaticPrivateFieldDestructureSet(\n receiver,\n classConstructor,\n descriptor,\n) {\n assertClassBrand(classConstructor, receiver);\n classCheckPrivateStaticFieldDescriptor(descriptor, \"set\");\n return classApplyDescriptorDestructureSet(receiver, descriptor);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,mCAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,uCAAA,GAAAF,OAAA;AACe,SAASG,sCAAsCA,CAC5DC,QAAQ,EACRC,gBAAgB,EAChBC,UAAU,EACV;EACAC,iBAAgB,CAACF,gBAAgB,EAAED,QAAQ,CAAC;EAC5CI,uCAAsC,CAACF,UAAU,EAAE,KAAK,CAAC;EACzD,OAAOG,mCAAkC,CAACL,QAAQ,EAAEE,UAAU,CAAC;AACjE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecGet.js b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecGet.js new file mode 100644 index 0000000..4e12ada --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecGet.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classStaticPrivateFieldSpecGet; +var _classApplyDescriptorGet = require("classApplyDescriptorGet"); +var _assertClassBrand = require("assertClassBrand"); +var _classCheckPrivateStaticFieldDescriptor = require("classCheckPrivateStaticFieldDescriptor"); +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { + _assertClassBrand(classConstructor, receiver); + _classCheckPrivateStaticFieldDescriptor(descriptor, "get"); + return _classApplyDescriptorGet(receiver, descriptor); +} + +//# sourceMappingURL=classStaticPrivateFieldSpecGet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecGet.js.map b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecGet.js.map new file mode 100644 index 0000000..a707005 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecGet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorGet","require","_assertClassBrand","_classCheckPrivateStaticFieldDescriptor","_classStaticPrivateFieldSpecGet","receiver","classConstructor","descriptor","assertClassBrand","classCheckPrivateStaticFieldDescriptor","classApplyDescriptorGet"],"sources":["../../src/helpers/classStaticPrivateFieldSpecGet.js"],"sourcesContent":["/* @minVersion 7.0.2 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorGet from \"classApplyDescriptorGet\";\nimport assertClassBrand from \"assertClassBrand\";\nimport classCheckPrivateStaticFieldDescriptor from \"classCheckPrivateStaticFieldDescriptor\";\nexport default function _classStaticPrivateFieldSpecGet(\n receiver,\n classConstructor,\n descriptor,\n) {\n assertClassBrand(classConstructor, receiver);\n classCheckPrivateStaticFieldDescriptor(descriptor, \"get\");\n return classApplyDescriptorGet(receiver, descriptor);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,uCAAA,GAAAF,OAAA;AACe,SAASG,+BAA+BA,CACrDC,QAAQ,EACRC,gBAAgB,EAChBC,UAAU,EACV;EACAC,iBAAgB,CAACF,gBAAgB,EAAED,QAAQ,CAAC;EAC5CI,uCAAsC,CAACF,UAAU,EAAE,KAAK,CAAC;EACzD,OAAOG,wBAAuB,CAACL,QAAQ,EAAEE,UAAU,CAAC;AACtD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecSet.js b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecSet.js new file mode 100644 index 0000000..b0aa794 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecSet.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classStaticPrivateFieldSpecSet; +var _classApplyDescriptorSet = require("classApplyDescriptorSet"); +var _assertClassBrand = require("assertClassBrand"); +var _classCheckPrivateStaticFieldDescriptor = require("classCheckPrivateStaticFieldDescriptor"); +function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { + _assertClassBrand(classConstructor, receiver); + _classCheckPrivateStaticFieldDescriptor(descriptor, "set"); + _classApplyDescriptorSet(receiver, descriptor, value); + return value; +} + +//# sourceMappingURL=classStaticPrivateFieldSpecSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecSet.js.map b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecSet.js.map new file mode 100644 index 0000000..a57c804 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateFieldSpecSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classApplyDescriptorSet","require","_assertClassBrand","_classCheckPrivateStaticFieldDescriptor","_classStaticPrivateFieldSpecSet","receiver","classConstructor","descriptor","value","assertClassBrand","classCheckPrivateStaticFieldDescriptor","classApplyDescriptorSet"],"sources":["../../src/helpers/classStaticPrivateFieldSpecSet.js"],"sourcesContent":["/* @minVersion 7.0.2 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorSet from \"classApplyDescriptorSet\";\nimport assertClassBrand from \"assertClassBrand\";\nimport classCheckPrivateStaticFieldDescriptor from \"classCheckPrivateStaticFieldDescriptor\";\nexport default function _classStaticPrivateFieldSpecSet(\n receiver,\n classConstructor,\n descriptor,\n value,\n) {\n assertClassBrand(classConstructor, receiver);\n classCheckPrivateStaticFieldDescriptor(descriptor, \"set\");\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,uCAAA,GAAAF,OAAA;AACe,SAASG,+BAA+BA,CACrDC,QAAQ,EACRC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACL;EACAC,iBAAgB,CAACH,gBAAgB,EAAED,QAAQ,CAAC;EAC5CK,uCAAsC,CAACH,UAAU,EAAE,KAAK,CAAC;EACzDI,wBAAuB,CAACN,QAAQ,EAAEE,UAAU,EAAEC,KAAK,CAAC;EACpD,OAAOA,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodGet.js b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodGet.js new file mode 100644 index 0000000..21003ce --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodGet.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classStaticPrivateMethodGet; +var _assertClassBrand = require("./assertClassBrand.js"); +function _classStaticPrivateMethodGet(receiver, classConstructor, method) { + (0, _assertClassBrand.default)(classConstructor, receiver); + return method; +} + +//# sourceMappingURL=classStaticPrivateMethodGet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodGet.js.map b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodGet.js.map new file mode 100644 index 0000000..ac2401b --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodGet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertClassBrand","require","_classStaticPrivateMethodGet","receiver","classConstructor","method","assertClassBrand"],"sources":["../../src/helpers/classStaticPrivateMethodGet.ts"],"sourcesContent":["/* @minVersion 7.3.2 */\n\nimport assertClassBrand from \"./assertClassBrand.ts\";\nexport default function _classStaticPrivateMethodGet(\n receiver: Function,\n classConstructor: Function,\n method: T,\n) {\n assertClassBrand(classConstructor, receiver);\n return method;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AACe,SAASC,4BAA4BA,CAClDC,QAAkB,EAClBC,gBAA0B,EAC1BC,MAAS,EACT;EACA,IAAAC,yBAAgB,EAACF,gBAAgB,EAAED,QAAQ,CAAC;EAC5C,OAAOE,MAAM;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodSet.js b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodSet.js new file mode 100644 index 0000000..a983dfc --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodSet.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _classStaticPrivateMethodSet; +function _classStaticPrivateMethodSet() { + throw new TypeError("attempted to set read only static private field"); +} + +//# sourceMappingURL=classStaticPrivateMethodSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodSet.js.map b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodSet.js.map new file mode 100644 index 0000000..1be9fa8 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/classStaticPrivateMethodSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_classStaticPrivateMethodSet","TypeError"],"sources":["../../src/helpers/classStaticPrivateMethodSet.js"],"sourcesContent":["/* @minVersion 7.3.2 */\n/* @onlyBabel7 */\n\nexport default function _classStaticPrivateMethodSet() {\n throw new TypeError(\"attempted to set read only static private field\");\n}\n"],"mappings":";;;;;;AAGe,SAASA,4BAA4BA,CAAA,EAAG;EACrD,MAAM,IAAIC,SAAS,CAAC,iDAAiD,CAAC;AACxE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/construct.js b/node_modules/@babel/helpers/lib/helpers/construct.js new file mode 100644 index 0000000..e32d400 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/construct.js @@ -0,0 +1,20 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _construct; +var _isNativeReflectConstruct = require("./isNativeReflectConstruct.js"); +var _setPrototypeOf = require("./setPrototypeOf.js"); +function _construct(Parent, args, Class) { + if ((0, _isNativeReflectConstruct.default)()) { + return Reflect.construct.apply(null, arguments); + } + var a = [null]; + a.push.apply(a, args); + var instance = new (Parent.bind.apply(Parent, a))(); + if (Class) (0, _setPrototypeOf.default)(instance, Class.prototype); + return instance; +} + +//# sourceMappingURL=construct.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/construct.js.map b/node_modules/@babel/helpers/lib/helpers/construct.js.map new file mode 100644 index 0000000..b7c87a0 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/construct.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_isNativeReflectConstruct","require","_setPrototypeOf","_construct","Parent","args","Class","isNativeReflectConstruct","Reflect","construct","apply","arguments","a","push","instance","bind","setPrototypeOf","prototype"],"sources":["../../src/helpers/construct.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.ts\";\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\n\nexport default function _construct(\n Parent: Function,\n args: any[],\n Class: Function,\n): any {\n if (isNativeReflectConstruct()) {\n // Avoid issues with Class being present but undefined when it wasn't\n // present in the original call.\n return Reflect.construct.apply(null, arguments as any);\n }\n // NOTE: If Parent !== Class, the correct __proto__ is set *after*\n // calling the constructor.\n var a: [any, ...any[]] = [null];\n a.push.apply(a, args);\n var instance = new (Parent.bind.apply(Parent, a))();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEe,SAASE,UAAUA,CAChCC,MAAgB,EAChBC,IAAW,EACXC,KAAe,EACV;EACL,IAAI,IAAAC,iCAAwB,EAAC,CAAC,EAAE;IAG9B,OAAOC,OAAO,CAACC,SAAS,CAACC,KAAK,CAAC,IAAI,EAAEC,SAAgB,CAAC;EACxD;EAGA,IAAIC,CAAkB,GAAG,CAAC,IAAI,CAAC;EAC/BA,CAAC,CAACC,IAAI,CAACH,KAAK,CAACE,CAAC,EAAEP,IAAI,CAAC;EACrB,IAAIS,QAAQ,GAAG,KAAKV,MAAM,CAACW,IAAI,CAACL,KAAK,CAACN,MAAM,EAAEQ,CAAC,CAAC,EAAE,CAAC;EACnD,IAAIN,KAAK,EAAE,IAAAU,uBAAc,EAACF,QAAQ,EAAER,KAAK,CAACW,SAAS,CAAC;EACpD,OAAOH,QAAQ;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/createClass.js b/node_modules/@babel/helpers/lib/helpers/createClass.js new file mode 100644 index 0000000..c10839c --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createClass.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createClass; +var _toPropertyKey = require("./toPropertyKey.js"); +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, (0, _toPropertyKey.default)(descriptor.key), descriptor); + } +} +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} + +//# sourceMappingURL=createClass.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/createClass.js.map b/node_modules/@babel/helpers/lib/helpers/createClass.js.map new file mode 100644 index 0000000..b570f68 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createClass.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_toPropertyKey","require","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","toPropertyKey","key","_createClass","Constructor","protoProps","staticProps","prototype"],"sources":["../../src/helpers/createClass.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport toPropertyKey from \"./toPropertyKey.ts\";\n\ninterface Prop extends PropertyDescriptor {\n key: PropertyKey;\n}\n\nfunction _defineProperties(target: object, props: Prop[]): void {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\n\nexport default function _createClass any>(\n Constructor: T,\n protoProps?: Prop[],\n staticProps?: Prop[],\n): T {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", { writable: false });\n return Constructor;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAMA,SAASC,iBAAiBA,CAACC,MAAc,EAAEC,KAAa,EAAQ;EAC9D,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,KAAK,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;IACrC,IAAIE,UAAU,GAAGH,KAAK,CAACC,CAAC,CAAC;IACzBE,UAAU,CAACC,UAAU,GAAGD,UAAU,CAACC,UAAU,IAAI,KAAK;IACtDD,UAAU,CAACE,YAAY,GAAG,IAAI;IAC9B,IAAI,OAAO,IAAIF,UAAU,EAAEA,UAAU,CAACG,QAAQ,GAAG,IAAI;IACrDC,MAAM,CAACC,cAAc,CAACT,MAAM,EAAE,IAAAU,sBAAa,EAACN,UAAU,CAACO,GAAG,CAAC,EAAEP,UAAU,CAAC;EAC1E;AACF;AAEe,SAASQ,YAAYA,CAClCC,WAAc,EACdC,UAAmB,EACnBC,WAAoB,EACjB;EACH,IAAID,UAAU,EAAEf,iBAAiB,CAACc,WAAW,CAACG,SAAS,EAAEF,UAAU,CAAC;EACpE,IAAIC,WAAW,EAAEhB,iBAAiB,CAACc,WAAW,EAAEE,WAAW,CAAC;EAC5DP,MAAM,CAACC,cAAc,CAACI,WAAW,EAAE,WAAW,EAAE;IAAEN,QAAQ,EAAE;EAAM,CAAC,CAAC;EACpE,OAAOM,WAAW;AACpB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelper.js b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelper.js new file mode 100644 index 0000000..c4ebafc --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelper.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createForOfIteratorHelper; +var _unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +function _createForOfIteratorHelper(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (!it) { + if (Array.isArray(o) || (it = (0, _unsupportedIterableToArray.default)(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + var F = function () {}; + return { + s: F, + n: function () { + if (i >= o.length) { + return { + done: true + }; + } + return { + done: false, + value: o[i++] + }; + }, + e: function (e) { + throw e; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, + didErr = false, + err; + return { + s: function () { + it = it.call(o); + }, + n: function () { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function (e) { + didErr = true; + err = e; + }, + f: function () { + try { + if (!normalCompletion && it["return"] != null) { + it["return"](); + } + } finally { + if (didErr) throw err; + } + } + }; +} + +//# sourceMappingURL=createForOfIteratorHelper.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelper.js.map b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelper.js.map new file mode 100644 index 0000000..7e04327 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelper.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_unsupportedIterableToArray","require","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","unsupportedIterableToArray","length","i","F","s","n","done","value","e","f","TypeError","normalCompletion","didErr","err","call","step","next"],"sources":["../../src/helpers/createForOfIteratorHelper.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n\nexport type IteratorFunction = () => Iterator;\n\nexport interface ForOfIteratorHelper {\n // s: start (create the iterator)\n s: () => void;\n // n: next\n n: () => IteratorResult;\n // e: error (called whenever something throws)\n e: (e: Error) => void;\n // f: finish (always called at the end)\n f: () => void;\n}\n\nexport default function _createForOfIteratorHelper(\n o: T[] | Iterable | ArrayLike,\n allowArrayLike: boolean,\n): ForOfIteratorHelper {\n var it: IteratorFunction | Iterator | T[] | undefined =\n (typeof Symbol !== \"undefined\" && (o as Iterable)[Symbol.iterator]) ||\n (o as any)[\"@@iterator\"];\n\n if (!it) {\n // Fallback for engines without symbol support\n if (\n Array.isArray(o) ||\n // union type doesn't work with function overload, have to use \"as any\".\n (it = unsupportedIterableToArray(o as any) as T[] | undefined) ||\n (allowArrayLike && o && typeof (o as ArrayLike).length === \"number\")\n ) {\n if (it) o = it;\n var i = 0;\n var F = function () {};\n return {\n s: F,\n n: function () {\n // After \"Array.isArray\" check, unsupportedIterableToArray to array, and allow arraylike\n // o is sure to be an array or arraylike, but TypeScript doesn't know that\n if (i >= (o as T[] | ArrayLike).length) {\n // explicit missing the \"value\" (undefined) to reduce the bundle size\n return { done: true } as IteratorReturnResult;\n }\n return { done: false, value: (o as T[] | ArrayLike)[i++] };\n },\n e: function (e: Error) {\n throw e;\n },\n f: F,\n };\n }\n\n throw new TypeError(\n \"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n }\n\n var normalCompletion = true,\n didErr = false,\n err: Error | undefined;\n\n // \"it\" is being reassigned multiple times to reduce the variables (bundle size)\n // thus TypeScript can't infer the correct type of the \"it\"\n return {\n s: function () {\n it = (it as IteratorFunction).call(o);\n },\n n: function () {\n var step = (it as Iterator).next();\n normalCompletion = step.done!;\n return step;\n },\n e: function (e: Error) {\n didErr = true;\n err = e;\n },\n f: function () {\n try {\n if (!normalCompletion && (it as Iterator)[\"return\"] != null) {\n (it as Iterator)[\"return\"]!();\n }\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (didErr) throw err!;\n }\n },\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,2BAAA,GAAAC,OAAA;AAee,SAASC,0BAA0BA,CAChDC,CAAmC,EACnCC,cAAuB,EACC;EACxB,IAAIC,EAAu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AACT,IAAK;MAC7B,OAAOS,IAAI;IACb,CAAC;IACDP,CAAC,EAAE,SAAAA,CAAUA,CAAQ,EAAE;MACrBI,MAAM,GAAG,IAAI;MACbC,GAAG,GAAGL,CAAC;IACT,CAAC;IACDC,CAAC,EAAE,SAAAA,CAAA,EAAY;MACb,IAAI;QACF,IAAI,CAACE,gBAAgB,IAAKhB,EAAE,CAAiB,QAAQ,CAAC,IAAI,IAAI,EAAE;UAC7DA,EAAE,CAAiB,QAAQ,CAAC,CAAE,CAAC;QAClC;MACF,CAAC,SAAS;QAER,IAAIiB,MAAM,EAAE,MAAMC,GAAG;MACvB;IACF;EACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelperLoose.js b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelperLoose.js new file mode 100644 index 0000000..71b0d50 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelperLoose.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createForOfIteratorHelperLoose; +var _unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = (0, _unsupportedIterableToArray.default)(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) { + return { + done: true + }; + } + return { + done: false, + value: o[i++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +//# sourceMappingURL=createForOfIteratorHelperLoose.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelperLoose.js.map b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelperLoose.js.map new file mode 100644 index 0000000..fec96ad --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createForOfIteratorHelperLoose.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_unsupportedIterableToArray","require","_createForOfIteratorHelperLoose","o","allowArrayLike","it","Symbol","iterator","call","next","bind","Array","isArray","unsupportedIterableToArray","length","i","done","value","TypeError"],"sources":["../../src/helpers/createForOfIteratorHelperLoose.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n\nimport type { IteratorFunction } from \"./createForOfIteratorHelper.ts\";\n\nexport default function _createForOfIteratorHelperLoose(\n o: T[] | Iterable | ArrayLike,\n allowArrayLike: boolean,\n): () => IteratorResult {\n var it:\n | IteratorFunction\n | Iterator\n | T[]\n | IteratorResult\n | undefined =\n (typeof Symbol !== \"undefined\" && (o as Iterable)[Symbol.iterator]) ||\n (o as any)[\"@@iterator\"];\n\n if (it) return (it = (it as IteratorFunction).call(o)).next.bind(it);\n\n // Fallback for engines without symbol support\n if (\n Array.isArray(o) ||\n // union type doesn't work with function overload, have to use \"as any\".\n (it = unsupportedIterableToArray(o as any) as T[] | undefined) ||\n (allowArrayLike && o && typeof (o as ArrayLike).length === \"number\")\n ) {\n if (it) o = it;\n var i = 0;\n return function () {\n // After \"Array.isArray\" check, unsupportedIterableToArray to array, and allow arraylike\n // o is sure to be an array or arraylike, but TypeScript doesn't know that\n if (i >= (o as T[] | ArrayLike).length) {\n // explicit missing the \"value\" (undefined) to reduce the bundle size\n return { done: true } as IteratorReturnResult;\n }\n\n return { done: false, value: (o as T[] | ArrayLike)[i++] };\n };\n }\n\n throw new TypeError(\n \"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,2BAAA,GAAAC,OAAA;AAIe,SAASC,+BAA+BA,CACrDC,CAAmC,EACnCC,cAAuB,EACa;EACpC,IAAIC,EAKS,GACV,OAAOC,MAAM,KAAK,WAAW,IAAKH,CAAC,CAAiBG,MAAM,CAACC,QAAQ,CAAC,IACpEJ,CAAC,CAAS,YAAY,CAAC;EAE1B,IAAIE,EAAE,EAAE,OAAO,CAACA,EAAE,GAAIA,EAAE,CAAyBG,IAAI,CAACL,CAAC,CAAC,EAAEM,IAAI,CAACC,IAAI,CAACL,EAAE,CAAC;EAGvE,IACEM,KAAK,CAACC,OAAO,CAACT,CAAC,CAAC,KAEfE,EAAE,GAAG,IAAAQ,mCAA0B,EAACV,CAAQ,CAAoB,CAAC,IAC7DC,cAAc,IAAID,CAAC,IAAI,OAAQA,CAAC,CAAkBW,MAAM,KAAK,QAAS,EACvE;IACA,IAAIT,EAAE,EAAEF,CAAC,GAAGE,EAAE;IACd,IAAIU,CAAC,GAAG,CAAC;IACT,OAAO,YAAY;MAGjB,IAAIA,CAAC,IAAKZ,CAAC,CAAwBW,MAAM,EAAE;QAEzC,OAAO;UAAEE,IAAI,EAAE;QAAK,CAAC;MACvB;MAEA,OAAO;QAAEA,IAAI,EAAE,KAAK;QAAEC,KAAK,EAAGd,CAAC,CAAwBY,CAAC,EAAE;MAAE,CAAC;IAC/D,CAAC;EACH;EAEA,MAAM,IAAIG,SAAS,CACjB,uIACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/createSuper.js b/node_modules/@babel/helpers/lib/helpers/createSuper.js new file mode 100644 index 0000000..03b94bd --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createSuper.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createSuper; +var _getPrototypeOf = require("getPrototypeOf"); +var _isNativeReflectConstruct = require("isNativeReflectConstruct"); +var _possibleConstructorReturn = require("possibleConstructorReturn"); +function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + return function _createSuperInternal() { + var Super = _getPrototypeOf(Derived), + result; + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + return _possibleConstructorReturn(this, result); + }; +} + +//# sourceMappingURL=createSuper.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/createSuper.js.map b/node_modules/@babel/helpers/lib/helpers/createSuper.js.map new file mode 100644 index 0000000..fbbd49a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/createSuper.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_getPrototypeOf","require","_isNativeReflectConstruct","_possibleConstructorReturn","_createSuper","Derived","hasNativeReflectConstruct","isNativeReflectConstruct","_createSuperInternal","Super","getPrototypeOf","result","NewTarget","constructor","Reflect","construct","arguments","apply","possibleConstructorReturn"],"sources":["../../src/helpers/createSuper.js"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport getPrototypeOf from \"getPrototypeOf\";\nimport isNativeReflectConstruct from \"isNativeReflectConstruct\";\nimport possibleConstructorReturn from \"possibleConstructorReturn\";\n\nexport default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n // NOTE: This doesn't work if this.__proto__.constructor has been modified.\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n };\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAEe,SAASG,YAAYA,CAACC,OAAO,EAAE;EAC5C,IAAIC,yBAAyB,GAAGC,yBAAwB,CAAC,CAAC;EAE1D,OAAO,SAASC,oBAAoBA,CAAA,EAAG;IACrC,IAAIC,KAAK,GAAGC,eAAc,CAACL,OAAO,CAAC;MACjCM,MAAM;IACR,IAAIL,yBAAyB,EAAE;MAE7B,IAAIM,SAAS,GAAGF,eAAc,CAAC,IAAI,CAAC,CAACG,WAAW;MAChDF,MAAM,GAAGG,OAAO,CAACC,SAAS,CAACN,KAAK,EAAEO,SAAS,EAAEJ,SAAS,CAAC;IACzD,CAAC,MAAM;MACLD,MAAM,GAAGF,KAAK,CAACQ,KAAK,CAAC,IAAI,EAAED,SAAS,CAAC;IACvC;IACA,OAAOE,0BAAyB,CAAC,IAAI,EAAEP,MAAM,CAAC;EAChD,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/decorate.js b/node_modules/@babel/helpers/lib/helpers/decorate.js new file mode 100644 index 0000000..63e0c41 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/decorate.js @@ -0,0 +1,350 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _decorate; +var _toArray = require("toArray"); +var _toPropertyKey = require("toPropertyKey"); +function _decorate(decorators, factory, superClass, mixins) { + var api = _getDecoratorsApi(); + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + api = mixins[i](api); + } + } + var r = factory(function initialize(O) { + api.initializeInstanceElements(O, decorated.elements); + }, superClass); + var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); + api.initializeClassElements(r.F, decorated.elements); + return api.runClassFinishers(r.F, decorated.finishers); +} +function _getDecoratorsApi() { + _getDecoratorsApi = function () { + return api; + }; + var api = { + elementsDefinitionOrder: [["method"], ["field"]], + initializeInstanceElements: function (O, elements) { + ["method", "field"].forEach(function (kind) { + elements.forEach(function (element) { + if (element.kind === kind && element.placement === "own") { + this.defineClassElement(O, element); + } + }, this); + }, this); + }, + initializeClassElements: function (F, elements) { + var proto = F.prototype; + ["method", "field"].forEach(function (kind) { + elements.forEach(function (element) { + var placement = element.placement; + if (element.kind === kind && (placement === "static" || placement === "prototype")) { + var receiver = placement === "static" ? F : proto; + this.defineClassElement(receiver, element); + } + }, this); + }, this); + }, + defineClassElement: function (receiver, element) { + var descriptor = element.descriptor; + if (element.kind === "field") { + var initializer = element.initializer; + descriptor = { + enumerable: descriptor.enumerable, + writable: descriptor.writable, + configurable: descriptor.configurable, + value: initializer === void 0 ? void 0 : initializer.call(receiver) + }; + } + Object.defineProperty(receiver, element.key, descriptor); + }, + decorateClass: function (elements, decorators) { + var newElements = []; + var finishers = []; + var placements = { + static: [], + prototype: [], + own: [] + }; + elements.forEach(function (element) { + this.addElementPlacement(element, placements); + }, this); + elements.forEach(function (element) { + if (!_hasDecorators(element)) return newElements.push(element); + var elementFinishersExtras = this.decorateElement(element, placements); + newElements.push(elementFinishersExtras.element); + newElements.push.apply(newElements, elementFinishersExtras.extras); + finishers.push.apply(finishers, elementFinishersExtras.finishers); + }, this); + if (!decorators) { + return { + elements: newElements, + finishers: finishers + }; + } + var result = this.decorateConstructor(newElements, decorators); + finishers.push.apply(finishers, result.finishers); + result.finishers = finishers; + return result; + }, + addElementPlacement: function (element, placements, silent) { + var keys = placements[element.placement]; + if (!silent && keys.indexOf(element.key) !== -1) { + throw new TypeError("Duplicated element (" + element.key + ")"); + } + keys.push(element.key); + }, + decorateElement: function (element, placements) { + var extras = []; + var finishers = []; + for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { + var keys = placements[element.placement]; + keys.splice(keys.indexOf(element.key), 1); + var elementObject = this.fromElementDescriptor(element); + var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); + element = elementFinisherExtras.element; + this.addElementPlacement(element, placements); + if (elementFinisherExtras.finisher) { + finishers.push(elementFinisherExtras.finisher); + } + var newExtras = elementFinisherExtras.extras; + if (newExtras) { + for (var j = 0; j < newExtras.length; j++) { + this.addElementPlacement(newExtras[j], placements); + } + extras.push.apply(extras, newExtras); + } + } + return { + element: element, + finishers: finishers, + extras: extras + }; + }, + decorateConstructor: function (elements, decorators) { + var finishers = []; + for (var i = decorators.length - 1; i >= 0; i--) { + var obj = this.fromClassDescriptor(elements); + var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); + if (elementsAndFinisher.finisher !== undefined) { + finishers.push(elementsAndFinisher.finisher); + } + if (elementsAndFinisher.elements !== undefined) { + elements = elementsAndFinisher.elements; + for (var j = 0; j < elements.length - 1; j++) { + for (var k = j + 1; k < elements.length; k++) { + if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { + throw new TypeError("Duplicated element (" + elements[j].key + ")"); + } + } + } + } + } + return { + elements: elements, + finishers: finishers + }; + }, + fromElementDescriptor: function (element) { + var obj = { + kind: element.kind, + key: element.key, + placement: element.placement, + descriptor: element.descriptor + }; + var desc = { + value: "Descriptor", + configurable: true + }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + if (element.kind === "field") obj.initializer = element.initializer; + return obj; + }, + toElementDescriptors: function (elementObjects) { + if (elementObjects === undefined) return; + return _toArray(elementObjects).map(function (elementObject) { + var element = this.toElementDescriptor(elementObject); + this.disallowProperty(elementObject, "finisher", "An element descriptor"); + this.disallowProperty(elementObject, "extras", "An element descriptor"); + return element; + }, this); + }, + toElementDescriptor: function (elementObject) { + var kind = String(elementObject.kind); + if (kind !== "method" && kind !== "field") { + throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); + } + var key = _toPropertyKey(elementObject.key); + var placement = String(elementObject.placement); + if (placement !== "static" && placement !== "prototype" && placement !== "own") { + throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); + } + var descriptor = elementObject.descriptor; + this.disallowProperty(elementObject, "elements", "An element descriptor"); + var element = { + kind: kind, + key: key, + placement: placement, + descriptor: Object.assign({}, descriptor) + }; + if (kind !== "field") { + this.disallowProperty(elementObject, "initializer", "A method descriptor"); + } else { + this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); + this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); + this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); + element.initializer = elementObject.initializer; + } + return element; + }, + toElementFinisherExtras: function (elementObject) { + var element = this.toElementDescriptor(elementObject); + var finisher = _optionalCallableProperty(elementObject, "finisher"); + var extras = this.toElementDescriptors(elementObject.extras); + return { + element: element, + finisher: finisher, + extras: extras + }; + }, + fromClassDescriptor: function (elements) { + var obj = { + kind: "class", + elements: elements.map(this.fromElementDescriptor, this) + }; + var desc = { + value: "Descriptor", + configurable: true + }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + return obj; + }, + toClassDescriptor: function (obj) { + var kind = String(obj.kind); + if (kind !== "class") { + throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); + } + this.disallowProperty(obj, "key", "A class descriptor"); + this.disallowProperty(obj, "placement", "A class descriptor"); + this.disallowProperty(obj, "descriptor", "A class descriptor"); + this.disallowProperty(obj, "initializer", "A class descriptor"); + this.disallowProperty(obj, "extras", "A class descriptor"); + var finisher = _optionalCallableProperty(obj, "finisher"); + var elements = this.toElementDescriptors(obj.elements); + return { + elements: elements, + finisher: finisher + }; + }, + runClassFinishers: function (constructor, finishers) { + for (var i = 0; i < finishers.length; i++) { + var newConstructor = (0, finishers[i])(constructor); + if (newConstructor !== undefined) { + if (typeof newConstructor !== "function") { + throw new TypeError("Finishers must return a constructor."); + } + constructor = newConstructor; + } + } + return constructor; + }, + disallowProperty: function (obj, name, objectType) { + if (obj[name] !== undefined) { + throw new TypeError(objectType + " can't have a ." + name + " property."); + } + } + }; + return api; +} +function _createElementDescriptor(def) { + var key = _toPropertyKey(def.key); + var descriptor; + if (def.kind === "method") { + descriptor = { + value: def.value, + writable: true, + configurable: true, + enumerable: false + }; + } else if (def.kind === "get") { + descriptor = { + get: def.value, + configurable: true, + enumerable: false + }; + } else if (def.kind === "set") { + descriptor = { + set: def.value, + configurable: true, + enumerable: false + }; + } else if (def.kind === "field") { + descriptor = { + configurable: true, + writable: true, + enumerable: true + }; + } + var element = { + kind: def.kind === "field" ? "field" : "method", + key: key, + placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", + descriptor: descriptor + }; + if (def.decorators) element.decorators = def.decorators; + if (def.kind === "field") element.initializer = def.value; + return element; +} +function _coalesceGetterSetter(element, other) { + if (element.descriptor.get !== undefined) { + other.descriptor.get = element.descriptor.get; + } else { + other.descriptor.set = element.descriptor.set; + } +} +function _coalesceClassElements(elements) { + var newElements = []; + var isSameElement = function (other) { + return other.kind === "method" && other.key === element.key && other.placement === element.placement; + }; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + var other; + if (element.kind === "method" && (other = newElements.find(isSameElement))) { + if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { + if (_hasDecorators(element) || _hasDecorators(other)) { + throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); + } + other.descriptor = element.descriptor; + } else { + if (_hasDecorators(element)) { + if (_hasDecorators(other)) { + throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); + } + other.decorators = element.decorators; + } + _coalesceGetterSetter(element, other); + } + } else { + newElements.push(element); + } + } + return newElements; +} +function _hasDecorators(element) { + return element.decorators && element.decorators.length; +} +function _isDataDescriptor(desc) { + return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); +} +function _optionalCallableProperty(obj, name) { + var value = obj[name]; + if (value !== undefined && typeof value !== "function") { + throw new TypeError("Expected '" + name + "' to be a function"); + } + return value; +} + +//# sourceMappingURL=decorate.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/decorate.js.map b/node_modules/@babel/helpers/lib/helpers/decorate.js.map new file mode 100644 index 0000000..44b01c6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/decorate.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_toArray","require","_toPropertyKey","_decorate","decorators","factory","superClass","mixins","api","_getDecoratorsApi","i","length","r","initialize","O","initializeInstanceElements","decorated","elements","decorateClass","_coalesceClassElements","d","map","_createElementDescriptor","initializeClassElements","F","runClassFinishers","finishers","elementsDefinitionOrder","forEach","kind","element","placement","defineClassElement","proto","prototype","receiver","descriptor","initializer","enumerable","writable","configurable","value","call","Object","defineProperty","key","newElements","placements","static","own","addElementPlacement","_hasDecorators","push","elementFinishersExtras","decorateElement","apply","extras","result","decorateConstructor","silent","keys","indexOf","TypeError","splice","elementObject","fromElementDescriptor","elementFinisherExtras","toElementFinisherExtras","finisher","newExtras","j","obj","fromClassDescriptor","elementsAndFinisher","toClassDescriptor","undefined","k","desc","Symbol","toStringTag","toElementDescriptors","elementObjects","toArray","toElementDescriptor","disallowProperty","String","toPropertyKey","assign","_optionalCallableProperty","constructor","newConstructor","name","objectType","def","get","set","_coalesceGetterSetter","other","isSameElement","find","_isDataDescriptor","ReferenceError"],"sources":["../../src/helpers/decorate.js"],"sourcesContent":["/* @minVersion 7.1.5 */\n\n// TODO: Only Babel 7\n\nimport toArray from \"toArray\";\nimport toPropertyKey from \"toPropertyKey\";\n\n/*::\n type PropertyDescriptor =\n | {\n value: any,\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n }\n | {\n get?: () => any,\n set?: (v: any) => void,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type FieldDescriptor ={\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type Placement = \"static\" | \"prototype\" | \"own\";\n type Key = string | symbol; // PrivateName is not supported yet.\n\n type ElementDescriptor =\n | {\n kind: \"method\",\n key: Key,\n placement: Placement,\n descriptor: PropertyDescriptor\n }\n | {\n kind: \"field\",\n key: Key,\n placement: Placement,\n descriptor: FieldDescriptor,\n initializer?: () => any,\n };\n\n // This is exposed to the user code\n type ElementObjectInput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n };\n\n // This is exposed to the user code\n type ElementObjectOutput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n extras?: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n // This is exposed to the user code\n type ClassObject = {\n [@@toStringTag]?: \"Descriptor\",\n kind: \"class\",\n elements: ElementDescriptor[],\n };\n\n type ElementDecorator = (descriptor: ElementObjectInput) => ?ElementObjectOutput;\n type ClassDecorator = (descriptor: ClassObject) => ?ClassObject;\n type ClassFinisher = (cl: Class) => Class;\n\n // Only used by Babel in the transform output, not part of the spec.\n type ElementDefinition =\n | {\n kind: \"method\",\n value: any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n }\n | {\n kind: \"field\",\n value: () => any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n };\n\n declare function ClassFactory(initialize: (instance: C) => void): {\n F: Class,\n d: ElementDefinition[]\n }\n\n */\n\n/*::\n // Various combinations with/without extras and with one or many finishers\n\n type ElementFinisherExtras = {\n element: ElementDescriptor,\n finisher?: ClassFinisher,\n extras?: ElementDescriptor[],\n };\n\n type ElementFinishersExtras = {\n element: ElementDescriptor,\n finishers: ClassFinisher[],\n extras: ElementDescriptor[],\n };\n\n type ElementsFinisher = {\n elements: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n type ElementsFinishers = {\n elements: ElementDescriptor[],\n finishers: ClassFinisher[],\n };\n\n */\n\n/*::\n\n type Placements = {\n static: Key[],\n prototype: Key[],\n own: Key[],\n };\n\n */\n\n// ClassDefinitionEvaluation (Steps 26-*)\nexport default function _decorate(\n decorators /*: ClassDecorator[] */,\n factory /*: ClassFactory */,\n superClass /*: ?Class<*> */,\n mixins /*: ?Array */,\n) /*: Class<*> */ {\n var api = _getDecoratorsApi();\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n api = mixins[i](api);\n }\n }\n\n var r = factory(function initialize(O) {\n api.initializeInstanceElements(O, decorated.elements);\n }, superClass);\n var decorated = api.decorateClass(\n _coalesceClassElements(r.d.map(_createElementDescriptor)),\n decorators,\n );\n\n api.initializeClassElements(r.F, decorated.elements);\n\n return api.runClassFinishers(r.F, decorated.finishers);\n}\n\nfunction _getDecoratorsApi() {\n _getDecoratorsApi = function () {\n return api;\n };\n\n var api = {\n elementsDefinitionOrder: [[\"method\"], [\"field\"]],\n\n // InitializeInstanceElements\n initializeInstanceElements: function (\n /*::*/ O /*: C */,\n elements /*: ElementDescriptor[] */,\n ) {\n [\"method\", \"field\"].forEach(function (kind) {\n elements.forEach(function (element /*: ElementDescriptor */) {\n if (element.kind === kind && element.placement === \"own\") {\n this.defineClassElement(O, element);\n }\n }, this);\n }, this);\n },\n\n // InitializeClassElements\n initializeClassElements: function (\n /*::*/ F /*: Class */,\n elements /*: ElementDescriptor[] */,\n ) {\n var proto = F.prototype;\n\n [\"method\", \"field\"].forEach(function (kind) {\n elements.forEach(function (element /*: ElementDescriptor */) {\n var placement = element.placement;\n if (\n element.kind === kind &&\n (placement === \"static\" || placement === \"prototype\")\n ) {\n var receiver = placement === \"static\" ? F : proto;\n this.defineClassElement(receiver, element);\n }\n }, this);\n }, this);\n },\n\n // DefineClassElement\n defineClassElement: function (\n /*::*/ receiver /*: C | Class */,\n element /*: ElementDescriptor */,\n ) {\n var descriptor /*: PropertyDescriptor */ = element.descriptor;\n if (element.kind === \"field\") {\n var initializer = element.initializer;\n descriptor = {\n enumerable: descriptor.enumerable,\n writable: descriptor.writable,\n configurable: descriptor.configurable,\n value: initializer === void 0 ? void 0 : initializer.call(receiver),\n };\n }\n Object.defineProperty(receiver, element.key, descriptor);\n },\n\n // DecorateClass\n decorateClass: function (\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var newElements /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n var placements /*: Placements */ = {\n static: [],\n prototype: [],\n own: [],\n };\n\n elements.forEach(function (element /*: ElementDescriptor */) {\n this.addElementPlacement(element, placements);\n }, this);\n\n elements.forEach(function (element /*: ElementDescriptor */) {\n if (!_hasDecorators(element)) return newElements.push(element);\n\n var elementFinishersExtras /*: ElementFinishersExtras */ =\n this.decorateElement(element, placements);\n newElements.push(elementFinishersExtras.element);\n newElements.push.apply(newElements, elementFinishersExtras.extras);\n finishers.push.apply(finishers, elementFinishersExtras.finishers);\n }, this);\n\n if (!decorators) {\n return { elements: newElements, finishers: finishers };\n }\n\n var result /*: ElementsFinishers */ = this.decorateConstructor(\n newElements,\n decorators,\n );\n finishers.push.apply(finishers, result.finishers);\n result.finishers = finishers;\n\n return result;\n },\n\n // AddElementPlacement\n addElementPlacement: function (\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n silent /*: boolean */,\n ) {\n var keys = placements[element.placement];\n if (!silent && keys.indexOf(element.key) !== -1) {\n throw new TypeError(\"Duplicated element (\" + element.key + \")\");\n }\n keys.push(element.key);\n },\n\n // DecorateElement\n decorateElement: function (\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n ) /*: ElementFinishersExtras */ {\n var extras /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n\n for (\n var decorators = element.decorators, i = decorators.length - 1;\n i >= 0;\n i--\n ) {\n // (inlined) RemoveElementPlacement\n var keys = placements[element.placement];\n keys.splice(keys.indexOf(element.key), 1);\n\n var elementObject /*: ElementObjectInput */ =\n this.fromElementDescriptor(element);\n var elementFinisherExtras /*: ElementFinisherExtras */ =\n this.toElementFinisherExtras(\n (0, decorators[i])(elementObject) /*: ElementObjectOutput */ ||\n elementObject,\n );\n\n element = elementFinisherExtras.element;\n this.addElementPlacement(element, placements);\n\n if (elementFinisherExtras.finisher) {\n finishers.push(elementFinisherExtras.finisher);\n }\n\n var newExtras /*: ElementDescriptor[] | void */ =\n elementFinisherExtras.extras;\n if (newExtras) {\n for (var j = 0; j < newExtras.length; j++) {\n this.addElementPlacement(newExtras[j], placements);\n }\n extras.push.apply(extras, newExtras);\n }\n }\n\n return { element: element, finishers: finishers, extras: extras };\n },\n\n // DecorateConstructor\n decorateConstructor: function (\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var finishers /*: ClassFinisher[] */ = [];\n\n for (var i = decorators.length - 1; i >= 0; i--) {\n var obj /*: ClassObject */ = this.fromClassDescriptor(elements);\n var elementsAndFinisher /*: ElementsFinisher */ =\n this.toClassDescriptor(\n (0, decorators[i])(obj) /*: ClassObject */ || obj,\n );\n\n if (elementsAndFinisher.finisher !== undefined) {\n finishers.push(elementsAndFinisher.finisher);\n }\n\n if (elementsAndFinisher.elements !== undefined) {\n elements = elementsAndFinisher.elements;\n\n for (var j = 0; j < elements.length - 1; j++) {\n for (var k = j + 1; k < elements.length; k++) {\n if (\n elements[j].key === elements[k].key &&\n elements[j].placement === elements[k].placement\n ) {\n throw new TypeError(\n \"Duplicated element (\" + elements[j].key + \")\",\n );\n }\n }\n }\n }\n }\n\n return { elements: elements, finishers: finishers };\n },\n\n // FromElementDescriptor\n fromElementDescriptor: function (\n element /*: ElementDescriptor */,\n ) /*: ElementObject */ {\n var obj /*: ElementObject */ = {\n kind: element.kind,\n key: element.key,\n placement: element.placement,\n descriptor: element.descriptor,\n };\n\n var desc = {\n value: \"Descriptor\",\n configurable: true,\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n if (element.kind === \"field\") obj.initializer = element.initializer;\n\n return obj;\n },\n\n // ToElementDescriptors\n toElementDescriptors: function (\n elementObjects /*: ElementObject[] */,\n ) /*: ElementDescriptor[] */ {\n if (elementObjects === undefined) return;\n return toArray(elementObjects).map(function (elementObject) {\n var element = this.toElementDescriptor(elementObject);\n this.disallowProperty(\n elementObject,\n \"finisher\",\n \"An element descriptor\",\n );\n this.disallowProperty(elementObject, \"extras\", \"An element descriptor\");\n return element;\n }, this);\n },\n\n // ToElementDescriptor\n toElementDescriptor: function (\n elementObject /*: ElementObject */,\n ) /*: ElementDescriptor */ {\n var kind = String(elementObject.kind);\n if (kind !== \"method\" && kind !== \"field\") {\n throw new TypeError(\n 'An element descriptor\\'s .kind property must be either \"method\" or' +\n ' \"field\", but a decorator created an element descriptor with' +\n ' .kind \"' +\n kind +\n '\"',\n );\n }\n\n var key = toPropertyKey(elementObject.key);\n\n var placement = String(elementObject.placement);\n if (\n placement !== \"static\" &&\n placement !== \"prototype\" &&\n placement !== \"own\"\n ) {\n throw new TypeError(\n 'An element descriptor\\'s .placement property must be one of \"static\",' +\n ' \"prototype\" or \"own\", but a decorator created an element descriptor' +\n ' with .placement \"' +\n placement +\n '\"',\n );\n }\n\n var descriptor /*: PropertyDescriptor */ = elementObject.descriptor;\n\n this.disallowProperty(elementObject, \"elements\", \"An element descriptor\");\n\n var element /*: ElementDescriptor */ = {\n kind: kind,\n key: key,\n placement: placement,\n descriptor: Object.assign({}, descriptor),\n };\n\n if (kind !== \"field\") {\n this.disallowProperty(\n elementObject,\n \"initializer\",\n \"A method descriptor\",\n );\n } else {\n this.disallowProperty(\n descriptor,\n \"get\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"set\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"value\",\n \"The property descriptor of a field descriptor\",\n );\n\n element.initializer = elementObject.initializer;\n }\n\n return element;\n },\n\n toElementFinisherExtras: function (\n elementObject /*: ElementObject */,\n ) /*: ElementFinisherExtras */ {\n var element /*: ElementDescriptor */ =\n this.toElementDescriptor(elementObject);\n var finisher /*: ClassFinisher */ = _optionalCallableProperty(\n elementObject,\n \"finisher\",\n );\n var extras /*: ElementDescriptors[] */ = this.toElementDescriptors(\n elementObject.extras,\n );\n\n return { element: element, finisher: finisher, extras: extras };\n },\n\n // FromClassDescriptor\n fromClassDescriptor: function (\n elements /*: ElementDescriptor[] */,\n ) /*: ClassObject */ {\n var obj = {\n kind: \"class\",\n elements: elements.map(this.fromElementDescriptor, this),\n };\n\n var desc = { value: \"Descriptor\", configurable: true };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n return obj;\n },\n\n // ToClassDescriptor\n toClassDescriptor: function (\n obj /*: ClassObject */,\n ) /*: ElementsFinisher */ {\n var kind = String(obj.kind);\n if (kind !== \"class\") {\n throw new TypeError(\n 'A class descriptor\\'s .kind property must be \"class\", but a decorator' +\n ' created a class descriptor with .kind \"' +\n kind +\n '\"',\n );\n }\n\n this.disallowProperty(obj, \"key\", \"A class descriptor\");\n this.disallowProperty(obj, \"placement\", \"A class descriptor\");\n this.disallowProperty(obj, \"descriptor\", \"A class descriptor\");\n this.disallowProperty(obj, \"initializer\", \"A class descriptor\");\n this.disallowProperty(obj, \"extras\", \"A class descriptor\");\n\n var finisher = _optionalCallableProperty(obj, \"finisher\");\n var elements = this.toElementDescriptors(obj.elements);\n\n return { elements: elements, finisher: finisher };\n },\n\n // RunClassFinishers\n runClassFinishers: function (\n constructor /*: Class<*> */,\n finishers /*: ClassFinisher[] */,\n ) /*: Class<*> */ {\n for (var i = 0; i < finishers.length; i++) {\n var newConstructor /*: ?Class<*> */ = (0, finishers[i])(constructor);\n if (newConstructor !== undefined) {\n // NOTE: This should check if IsConstructor(newConstructor) is false.\n if (typeof newConstructor !== \"function\") {\n throw new TypeError(\"Finishers must return a constructor.\");\n }\n constructor = newConstructor;\n }\n }\n return constructor;\n },\n\n disallowProperty: function (obj, name, objectType) {\n if (obj[name] !== undefined) {\n throw new TypeError(\n objectType + \" can't have a .\" + name + \" property.\",\n );\n }\n },\n };\n\n return api;\n}\n\n// ClassElementEvaluation\nfunction _createElementDescriptor(\n def /*: ElementDefinition */,\n) /*: ElementDescriptor */ {\n var key = toPropertyKey(def.key);\n\n var descriptor /*: PropertyDescriptor */;\n if (def.kind === \"method\") {\n descriptor = {\n value: def.value,\n writable: true,\n configurable: true,\n enumerable: false,\n };\n } else if (def.kind === \"get\") {\n descriptor = { get: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"set\") {\n descriptor = { set: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"field\") {\n descriptor = { configurable: true, writable: true, enumerable: true };\n }\n\n var element /*: ElementDescriptor */ = {\n kind: def.kind === \"field\" ? \"field\" : \"method\",\n key: key,\n placement: def.static\n ? \"static\"\n : def.kind === \"field\"\n ? \"own\"\n : \"prototype\",\n descriptor: descriptor,\n };\n if (def.decorators) element.decorators = def.decorators;\n if (def.kind === \"field\") element.initializer = def.value;\n\n return element;\n}\n\n// CoalesceGetterSetter\nfunction _coalesceGetterSetter(\n element /*: ElementDescriptor */,\n other /*: ElementDescriptor */,\n) {\n if (element.descriptor.get !== undefined) {\n other.descriptor.get = element.descriptor.get;\n } else {\n other.descriptor.set = element.descriptor.set;\n }\n}\n\n// CoalesceClassElements\nfunction _coalesceClassElements(\n elements /*: ElementDescriptor[] */,\n) /*: ElementDescriptor[] */ {\n var newElements /*: ElementDescriptor[] */ = [];\n\n var isSameElement = function (other /*: ElementDescriptor */) /*: boolean */ {\n return (\n other.kind === \"method\" &&\n other.key === element.key &&\n other.placement === element.placement\n );\n };\n\n for (var i = 0; i < elements.length; i++) {\n var element /*: ElementDescriptor */ = elements[i];\n var other /*: ElementDescriptor */;\n\n if (\n element.kind === \"method\" &&\n (other = newElements.find(isSameElement))\n ) {\n if (\n _isDataDescriptor(element.descriptor) ||\n _isDataDescriptor(other.descriptor)\n ) {\n if (_hasDecorators(element) || _hasDecorators(other)) {\n throw new ReferenceError(\n \"Duplicated methods (\" + element.key + \") can't be decorated.\",\n );\n }\n other.descriptor = element.descriptor;\n } else {\n if (_hasDecorators(element)) {\n if (_hasDecorators(other)) {\n throw new ReferenceError(\n \"Decorators can't be placed on different accessors with for \" +\n \"the same property (\" +\n element.key +\n \").\",\n );\n }\n other.decorators = element.decorators;\n }\n _coalesceGetterSetter(element, other);\n }\n } else {\n newElements.push(element);\n }\n }\n\n return newElements;\n}\n\nfunction _hasDecorators(element /*: ElementDescriptor */) /*: boolean */ {\n return element.decorators && element.decorators.length;\n}\n\nfunction _isDataDescriptor(desc /*: PropertyDescriptor */) /*: boolean */ {\n return (\n desc !== undefined &&\n !(desc.value === undefined && desc.writable === undefined)\n );\n}\n\nfunction _optionalCallableProperty /*::*/(\n obj /*: T */,\n name /*: $Keys */,\n) /*: ?Function */ {\n var value = obj[name];\n if (value !== undefined && typeof value !== \"function\") {\n throw new TypeError(\"Expected '\" + name + \"' to be a function\");\n }\n return value;\n}\n"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AA8He,SAASE,SAASA,CAC/BC,UAAU,EACVC,OAAO,EACPC,UAAU,EACVC,MAAM,EACU;EAChB,IAAIC,GAAG,GAAGC,iBAAiB,CAAC,CAAC;EAC7B,IAAIF,MAAM,EAAE;IACV,KAAK,IAAIG,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,MAAM,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;MACtCF,GAAG,GAAGD,MAAM,CAACG,CAAC,CAAC,CAACF,GAAG,CAAC;IACtB;EACF;EAEA,IAAII,CAAC,GAAGP,OAAO,CAAC,SAASQ,UAAUA,CAACC,CAAC,EAAE;IACrCN,GAAG,CAACO,0BAA0B,CAACD,CAAC,EAAEE,SAAS,CAACC,QAAQ,CAAC;EACvD,CAAC,EAAEX,UAAU,CAAC;EACd,IAAIU,SAAS,GAAGR,GAAG,CAACU,aAAa,CAC/BC,sBAAsB,CAACP,CAAC,CAACQ,CAAC,CAACC,GAAG,CAACC,wBAAwB,CAAC,CAAC,EACzDlB,UACF,CAAC;EAEDI,GAAG,CAACe,uBAAuB,CAACX,CAAC,CAACY,CAAC,EAAER,SAAS,CAACC,QAAQ,CAAC;EAEpD,OAAOT,GAAG,CAACiB,iBAAiB,CAACb,CAAC,CAACY,CAAC,EAAER,SAAS,CAACU,SAAS,CAAC;AACxD;AAEA,SAASjB,iBAAiBA,CAAA,EAAG;EAC3BA,iBAAiB,GAAG,SAAAA,CAAA,EAAY;IAC9B,OAAOD,GAAG;EACZ,CAAC;EAED,IAAIA,GAAG,GAAG;IACRmB,uBAAuB,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,CA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AAcA,CAACrB,OAAO,EAA0C;EACvE,OAAOA,OAAO,CAAC1B,UAAU,IAAI0B,OAAO,CAAC1B,UAAU,CAACO,MAAM;AACxD;AAEA,SAASyF,iBAAiBA,CAACvB,IAAI,EAA2C;EACxE,OACEA,IAAI,KAAKF,SAAS,IAClB,EAAEE,IAAI,CAACpC,KAAK,KAAKkC,SAAS,IAAIE,IAAI,CAACtC,QAAQ,KAAKoC,SAAS,CAAC;AAE9D;AAEA,SAASa,yBAAyBA,CAChCjB,GAAG,EACHoB,IAAI,EACa;EACjB,IAAIlD,KAAK,GAAG8B,GAAG,CAACoB,IAAI,CAAC;EACrB,IAAIlD,KAAK,KAAKkC,SAAS,IAAI,OAAOlC,KAAK,KAAK,UAAU,EAAE;IACtD,MAAM,IAAIqB,SAAS,CAAC,YAAY,GAAG6B,IAAI,GAAG,oBAAoB,CAAC;EACjE;EACA,OAAOlD,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/defaults.js b/node_modules/@babel/helpers/lib/helpers/defaults.js new file mode 100644 index 0000000..d040656 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defaults.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _defaults; +function _defaults(obj, defaults) { + for (var keys = Object.getOwnPropertyNames(defaults), i = 0; i < keys.length; i++) { + var key = keys[i], + value = Object.getOwnPropertyDescriptor(defaults, key); + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + return obj; +} + +//# sourceMappingURL=defaults.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/defaults.js.map b/node_modules/@babel/helpers/lib/helpers/defaults.js.map new file mode 100644 index 0000000..4e3003e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defaults.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_defaults","obj","defaults","keys","Object","getOwnPropertyNames","i","length","key","value","getOwnPropertyDescriptor","configurable","undefined","defineProperty"],"sources":["../../src/helpers/defaults.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _defaults(\n obj: T,\n defaults: S,\n): NonNullable {\n for (\n var keys: string[] = Object.getOwnPropertyNames(defaults), i = 0;\n i < keys.length;\n i++\n ) {\n var key: string = keys[i],\n value: PropertyDescriptor | undefined = Object.getOwnPropertyDescriptor(\n defaults,\n key,\n );\n if (value && value.configurable && obj[key as keyof T] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj as NonNullable;\n}\n"],"mappings":";;;;;;AAEe,SAASA,SAASA,CAC/BC,GAAM,EACNC,QAAW,EACS;EACpB,KACE,IAAIC,IAAc,GAAGC,MAAM,CAACC,mBAAmB,CAACH,QAAQ,CAAC,EAAEI,CAAC,GAAG,CAAC,EAChEA,CAAC,GAAGH,IAAI,CAACI,MAAM,EACfD,CAAC,EAAE,EACH;IACA,IAAIE,GAAW,GAAGL,IAAI,CAACG,CAAC,CAAC;MACvBG,KAAqC,GAAGL,MAAM,CAACM,wBAAwB,CACrER,QAAQ,EACRM,GACF,CAAC;IACH,IAAIC,KAAK,IAAIA,KAAK,CAACE,YAAY,IAAIV,GAAG,CAACO,GAAG,CAAY,KAAKI,SAAS,EAAE;MACpER,MAAM,CAACS,cAAc,CAACZ,GAAG,EAAEO,GAAG,EAAEC,KAAK,CAAC;IACxC;EACF;EACA,OAAOR,GAAG;AACZ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/defineAccessor.js b/node_modules/@babel/helpers/lib/helpers/defineAccessor.js new file mode 100644 index 0000000..fc5f8bc --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defineAccessor.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _defineAccessor; +function _defineAccessor(type, obj, key, fn) { + var desc = { + configurable: true, + enumerable: true + }; + desc[type] = fn; + return Object.defineProperty(obj, key, desc); +} + +//# sourceMappingURL=defineAccessor.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/defineAccessor.js.map b/node_modules/@babel/helpers/lib/helpers/defineAccessor.js.map new file mode 100644 index 0000000..9dd4e0d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defineAccessor.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_defineAccessor","type","obj","key","fn","desc","configurable","enumerable","Object","defineProperty"],"sources":["../../src/helpers/defineAccessor.ts"],"sourcesContent":["/* @minVersion 7.20.7 */\n\nexport default function _defineAccessor(\n type: Type,\n obj: any,\n key: string | symbol,\n fn: PropertyDescriptor[Type],\n) {\n var desc: PropertyDescriptor = { configurable: true, enumerable: true };\n desc[type] = fn;\n return Object.defineProperty(obj, key, desc);\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CACrCC,IAAU,EACVC,GAAQ,EACRC,GAAoB,EACpBC,EAA4B,EAC5B;EACA,IAAIC,IAAwB,GAAG;IAAEC,YAAY,EAAE,IAAI;IAAEC,UAAU,EAAE;EAAK,CAAC;EACvEF,IAAI,CAACJ,IAAI,CAAC,GAAGG,EAAE;EACf,OAAOI,MAAM,CAACC,cAAc,CAACP,GAAG,EAAEC,GAAG,EAAEE,IAAI,CAAC;AAC9C","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/defineEnumerableProperties.js b/node_modules/@babel/helpers/lib/helpers/defineEnumerableProperties.js new file mode 100644 index 0000000..a497e1d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defineEnumerableProperties.js @@ -0,0 +1,27 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _defineEnumerableProperties; +function _defineEnumerableProperties(obj, descs) { + for (var key in descs) { + var desc = descs[key]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, key, desc); + } + if (Object.getOwnPropertySymbols) { + var objectSymbols = Object.getOwnPropertySymbols(descs); + for (var i = 0; i < objectSymbols.length; i++) { + var sym = objectSymbols[i]; + desc = descs[sym]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, sym, desc); + } + } + return obj; +} + +//# sourceMappingURL=defineEnumerableProperties.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/defineEnumerableProperties.js.map b/node_modules/@babel/helpers/lib/helpers/defineEnumerableProperties.js.map new file mode 100644 index 0000000..31fd3a8 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defineEnumerableProperties.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_defineEnumerableProperties","obj","descs","key","desc","configurable","enumerable","writable","Object","defineProperty","getOwnPropertySymbols","objectSymbols","i","length","sym"],"sources":["../../src/helpers/defineEnumerableProperties.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\nexport default function _defineEnumerableProperties(\n obj: T,\n descs: { [key: string | symbol]: PropertyDescriptor },\n): T {\n // eslint-disable-next-line guard-for-in\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n\n // Symbols are not enumerated over by for-in loops. If native\n // Symbols are available, fetch all of the descs object's own\n // symbol properties and define them on our target object too.\n if (Object.getOwnPropertySymbols) {\n var objectSymbols = Object.getOwnPropertySymbols(descs);\n for (var i = 0; i < objectSymbols.length; i++) {\n var sym = objectSymbols[i];\n desc = descs[sym];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, sym, desc);\n }\n }\n return obj;\n}\n"],"mappings":";;;;;;AAEe,SAASA,2BAA2BA,CACjDC,GAAM,EACNC,KAAqD,EAClD;EAEH,KAAK,IAAIC,GAAG,IAAID,KAAK,EAAE;IACrB,IAAIE,IAAI,GAAGF,KAAK,CAACC,GAAG,CAAC;IACrBC,IAAI,CAACC,YAAY,GAAGD,IAAI,CAACE,UAAU,GAAG,IAAI;IAC1C,IAAI,OAAO,IAAIF,IAAI,EAAEA,IAAI,CAACG,QAAQ,GAAG,IAAI;IACzCC,MAAM,CAACC,cAAc,CAACR,GAAG,EAAEE,GAAG,EAAEC,IAAI,CAAC;EACvC;EAKA,IAAII,MAAM,CAACE,qBAAqB,EAAE;IAChC,IAAIC,aAAa,GAAGH,MAAM,CAACE,qBAAqB,CAACR,KAAK,CAAC;IACvD,KAAK,IAAIU,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,aAAa,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;MAC7C,IAAIE,GAAG,GAAGH,aAAa,CAACC,CAAC,CAAC;MAC1BR,IAAI,GAAGF,KAAK,CAACY,GAAG,CAAC;MACjBV,IAAI,CAACC,YAAY,GAAGD,IAAI,CAACE,UAAU,GAAG,IAAI;MAC1C,IAAI,OAAO,IAAIF,IAAI,EAAEA,IAAI,CAACG,QAAQ,GAAG,IAAI;MACzCC,MAAM,CAACC,cAAc,CAACR,GAAG,EAAEa,GAAG,EAAEV,IAAI,CAAC;IACvC;EACF;EACA,OAAOH,GAAG;AACZ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/defineProperty.js b/node_modules/@babel/helpers/lib/helpers/defineProperty.js new file mode 100644 index 0000000..989df3a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defineProperty.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _defineProperty; +var _toPropertyKey = require("./toPropertyKey.js"); +function _defineProperty(obj, key, value) { + key = (0, _toPropertyKey.default)(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +//# sourceMappingURL=defineProperty.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/defineProperty.js.map b/node_modules/@babel/helpers/lib/helpers/defineProperty.js.map new file mode 100644 index 0000000..9e8a52d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/defineProperty.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_toPropertyKey","require","_defineProperty","obj","key","value","toPropertyKey","Object","defineProperty","enumerable","configurable","writable"],"sources":["../../src/helpers/defineProperty.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\nimport toPropertyKey from \"./toPropertyKey.ts\";\n\nexport default function _defineProperty(\n obj: T,\n key: PropertyKey,\n value: any,\n) {\n key = toPropertyKey(key);\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n } else {\n // @ts-expect-error - Explicitly assigning to generic type key\n obj[key] = value;\n }\n return obj;\n}\n"],"mappings":";;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAEe,SAASC,eAAeA,CACrCC,GAAM,EACNC,GAAgB,EAChBC,KAAU,EACV;EACAD,GAAG,GAAG,IAAAE,sBAAa,EAACF,GAAG,CAAC;EAMxB,IAAIA,GAAG,IAAID,GAAG,EAAE;IACdI,MAAM,CAACC,cAAc,CAACL,GAAG,EAAEC,GAAG,EAAE;MAC9BC,KAAK,EAAEA,KAAK;MACZI,UAAU,EAAE,IAAI;MAChBC,YAAY,EAAE,IAAI;MAClBC,QAAQ,EAAE;IACZ,CAAC,CAAC;EACJ,CAAC,MAAM;IAELR,GAAG,CAACC,GAAG,CAAC,GAAGC,KAAK;EAClB;EACA,OAAOF,GAAG;AACZ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/dispose.js b/node_modules/@babel/helpers/lib/helpers/dispose.js new file mode 100644 index 0000000..3093b47 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/dispose.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _dispose; +function dispose_SuppressedError(error, suppressed) { + if (typeof SuppressedError !== "undefined") { + dispose_SuppressedError = SuppressedError; + } else { + dispose_SuppressedError = function SuppressedError(error, suppressed) { + this.suppressed = suppressed; + this.error = error; + this.stack = new Error().stack; + }; + dispose_SuppressedError.prototype = Object.create(Error.prototype, { + constructor: { + value: dispose_SuppressedError, + writable: true, + configurable: true + } + }); + } + return new dispose_SuppressedError(error, suppressed); +} +function _dispose(stack, error, hasError) { + function next() { + while (stack.length > 0) { + try { + var r = stack.pop(); + var p = r.d.call(r.v); + if (r.a) return Promise.resolve(p).then(next, err); + } catch (e) { + return err(e); + } + } + if (hasError) throw error; + } + function err(e) { + error = hasError ? new dispose_SuppressedError(error, e) : e; + hasError = true; + return next(); + } + return next(); +} + +//# sourceMappingURL=dispose.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/dispose.js.map b/node_modules/@babel/helpers/lib/helpers/dispose.js.map new file mode 100644 index 0000000..dd2e587 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/dispose.js.map @@ -0,0 +1 @@ +{"version":3,"names":["dispose_SuppressedError","error","suppressed","SuppressedError","stack","Error","prototype","Object","create","constructor","value","writable","configurable","_dispose","hasError","next","length","r","pop","p","d","call","v","a","Promise","resolve","then","err","e"],"sources":["../../src/helpers/dispose.js"],"sourcesContent":["/* @minVersion 7.22.0 */\n/* @onlyBabel7 */\n\nfunction dispose_SuppressedError(error, suppressed) {\n if (typeof SuppressedError !== \"undefined\") {\n // eslint-disable-next-line no-undef\n dispose_SuppressedError = SuppressedError;\n } else {\n dispose_SuppressedError = function SuppressedError(error, suppressed) {\n this.suppressed = suppressed;\n this.error = error;\n this.stack = new Error().stack;\n };\n dispose_SuppressedError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: dispose_SuppressedError,\n writable: true,\n configurable: true,\n },\n });\n }\n return new dispose_SuppressedError(error, suppressed);\n}\n\nexport default function _dispose(stack, error, hasError) {\n function next() {\n while (stack.length > 0) {\n try {\n var r = stack.pop();\n var p = r.d.call(r.v);\n if (r.a) return Promise.resolve(p).then(next, err);\n } catch (e) {\n return err(e);\n }\n }\n if (hasError) throw error;\n }\n\n function err(e) {\n error = hasError ? new dispose_SuppressedError(error, e) : e;\n hasError = true;\n\n return next();\n }\n\n return next();\n}\n"],"mappings":";;;;;;AAGA,SAASA,uBAAuBA,CAACC,KAAK,EAAEC,UAAU,EAAE;EAClD,IAAI,OAAOC,eAAe,KAAK,WAAW,EAAE;IAE1CH,uBAAuB,GAAGG,eAAe;EAC3C,CAAC,MAAM;IACLH,uBAAuB,GAAG,SAASG,eAAeA,CAACF,KAAK,EAAEC,UAAU,EAAE;MACpE,IAAI,CAACA,UAAU,GAAGA,UAAU;MAC5B,IAAI,CAACD,KAAK,GAAGA,KAAK;MAClB,IAAI,CAACG,KAAK,GAAG,IAAIC,KAAK,CAAC,CAAC,CAACD,KAAK;IAChC,CAAC;IACDJ,uBAAuB,CAACM,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACH,KAAK,CAACC,SAAS,EAAE;MACjEG,WAAW,EAAE;QACXC,KAAK,EAAEV,uBAAuB;QAC9BW,QAAQ,EAAE,IAAI;QACdC,YAAY,EAAE;MAChB;IACF,CAAC,CAAC;EACJ;EACA,OAAO,IAAIZ,uBAAuB,CAACC,KAAK,EAAEC,UAAU,CAAC;AACvD;AAEe,SAASW,QAAQA,CAACT,KAAK,EAAEH,KAAK,EAAEa,QAAQ,EAAE;EACvD,SAASC,IAAIA,CAAA,EAAG;IACd,OAAOX,KAAK,CAACY,MAAM,GAAG,CAAC,EAAE;MACvB,IAAI;QACF,IAAIC,CAAC,GAAGb,KAAK,CAACc,GAAG,CAAC,CAAC;QACnB,IAAIC,CAAC,GAAGF,CAAC,CAACG,CAAC,CAACC,IAAI,CAACJ,CAAC,CAACK,CAAC,CAAC;QACrB,IAAIL,CAAC,CAACM,CAAC,EAAE,OAAOC,OAAO,CAACC,OAAO,CAACN,CAAC,CAAC,CAACO,IAAI,CAACX,IAAI,EAAEY,GAAG,CAAC;MACpD,CAAC,CAAC,OAAOC,CAAC,EAAE;QACV,OAAOD,GAAG,CAACC,CAAC,CAAC;MACf;IACF;IACA,IAAId,QAAQ,EAAE,MAAMb,KAAK;EAC3B;EAEA,SAAS0B,GAAGA,CAACC,CAAC,EAAE;IACd3B,KAAK,GAAGa,QAAQ,GAAG,IAAId,uBAAuB,CAACC,KAAK,EAAE2B,CAAC,CAAC,GAAGA,CAAC;IAC5Dd,QAAQ,GAAG,IAAI;IAEf,OAAOC,IAAI,CAAC,CAAC;EACf;EAEA,OAAOA,IAAI,CAAC,CAAC;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/extends.js b/node_modules/@babel/helpers/lib/helpers/extends.js new file mode 100644 index 0000000..bb9d07d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/extends.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _extends; +function _extends() { + exports.default = _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(null, arguments); +} + +//# sourceMappingURL=extends.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/extends.js.map b/node_modules/@babel/helpers/lib/helpers/extends.js.map new file mode 100644 index 0000000..3fa6dc7 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/extends.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_extends","exports","default","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply"],"sources":["../../src/helpers/extends.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\ntype Intersection = R extends [infer H, ...infer S]\n ? H & Intersection\n : unknown;\n\nexport default function _extends(\n target: T,\n ...sources: U\n): T & Intersection;\nexport default function _extends() {\n // @ts-expect-error explicitly assign to function\n _extends = Object.assign\n ? // need a bind because https://github.com/babel/babel/issues/14527\n // @ts-expect-error -- intentionally omitting the argument\n Object.assign.bind(/* undefined */)\n : function (target: any) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n\n return _extends.apply(\n null,\n arguments as any as [source: object, ...target: any[]],\n );\n}\n"],"mappings":";;;;;;AAUe,SAASA,QAAQA,CAAA,EAAG;EAEjCC,OAAA,CAAAC,OAAA,GAAAF,QAAQ,GAAGG,MAAM,CAACC,MAAM,GAGpBD,MAAM,CAACC,MAAM,CAACC,IAAI,CAAgB,CAAC,GACnC,UAAUC,MAAW,EAAE;IACrB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,SAAS,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;MACzC,IAAIG,MAAM,GAAGF,SAAS,CAACD,CAAC,CAAC;MACzB,KAAK,IAAII,GAAG,IAAID,MAAM,EAAE;QACtB,IAAIP,MAAM,CAACS,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,MAAM,EAAEC,GAAG,CAAC,EAAE;UACrDL,MAAM,CAACK,GAAG,CAAC,GAAGD,MAAM,CAACC,GAAG,CAAC;QAC3B;MACF;IACF;IACA,OAAOL,MAAM;EACf,CAAC;EAEL,OAAON,QAAQ,CAACe,KAAK,CACnB,IAAI,EACJP,SACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/get.js b/node_modules/@babel/helpers/lib/helpers/get.js new file mode 100644 index 0000000..a2d3796 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/get.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _get; +var _superPropBase = require("./superPropBase.js"); +function _get() { + if (typeof Reflect !== "undefined" && Reflect.get) { + exports.default = _get = Reflect.get.bind(); + } else { + exports.default = _get = function _get(target, property, receiver) { + var base = (0, _superPropBase.default)(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.get) { + return desc.get.call(arguments.length < 3 ? target : receiver); + } + return desc.value; + }; + } + return _get.apply(null, arguments); +} + +//# sourceMappingURL=get.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/get.js.map b/node_modules/@babel/helpers/lib/helpers/get.js.map new file mode 100644 index 0000000..08de655 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/get.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_superPropBase","require","_get","Reflect","get","exports","default","bind","target","property","receiver","base","superPropBase","desc","Object","getOwnPropertyDescriptor","call","arguments","length","value","apply"],"sources":["../../src/helpers/get.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport superPropBase from \"./superPropBase.ts\";\n\n// https://tc39.es/ecma262/multipage/reflection.html#sec-reflect.get\n//\n// 28.1ak.5 Reflect.get ( target, propertyKey [ , receiver ] )\nexport default function _get(\n target: T,\n property: P,\n receiver?: unknown,\n): P extends keyof T ? T[P] : any;\nexport default function _get(): any {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n // need a bind because https://github.com/babel/babel/issues/14527\n // @ts-expect-error function reassign\n _get = Reflect.get.bind(/* undefined */);\n } else {\n // @ts-expect-error function reassign\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n\n if (!base) return;\n\n var desc = Object.getOwnPropertyDescriptor(base, property)!;\n if (desc.get) {\n // STEP 3. If receiver is not present, then set receiver to target.\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get.apply(null, arguments as any as Parameters);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAUe,SAASC,IAAIA,CAAA,EAAQ;EAClC,IAAI,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACC,GAAG,EAAE;IAGjDC,OAAA,CAAAC,OAAA,GAAAJ,IAAI,GAAGC,OAAO,CAACC,GAAG,CAACG,IAAI,CAAgB,CAAC;EAC1C,CAAC,MAAM;IAELF,OAAA,CAAAC,OAAA,GAAAJ,IAAI,GAAG,SAASA,IAAIA,CAACM,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAE;MAC/C,IAAIC,IAAI,GAAG,IAAAC,sBAAa,EAACJ,MAAM,EAAEC,QAAQ,CAAC;MAE1C,IAAI,CAACE,IAAI,EAAE;MAEX,IAAIE,IAAI,GAAGC,MAAM,CAACC,wBAAwB,CAACJ,IAAI,EAAEF,QAAQ,CAAE;MAC3D,IAAII,IAAI,CAACT,GAAG,EAAE;QAEZ,OAAOS,IAAI,CAACT,GAAG,CAACY,IAAI,CAACC,SAAS,CAACC,MAAM,GAAG,CAAC,GAAGV,MAAM,GAAGE,QAAQ,CAAC;MAChE;MAEA,OAAOG,IAAI,CAACM,KAAK;IACnB,CAAC;EACH;EAEA,OAAOjB,IAAI,CAACkB,KAAK,CAAC,IAAI,EAAEH,SAAkD,CAAC;AAC7E","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/getPrototypeOf.js b/node_modules/@babel/helpers/lib/helpers/getPrototypeOf.js new file mode 100644 index 0000000..6fc2df9 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/getPrototypeOf.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _getPrototypeOf; +function _getPrototypeOf(o) { + exports.default = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} + +//# sourceMappingURL=getPrototypeOf.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/getPrototypeOf.js.map b/node_modules/@babel/helpers/lib/helpers/getPrototypeOf.js.map new file mode 100644 index 0000000..12b67d8 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/getPrototypeOf.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_getPrototypeOf","o","exports","default","Object","setPrototypeOf","getPrototypeOf","bind","__proto__"],"sources":["../../src/helpers/getPrototypeOf.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _getPrototypeOf(o: object): any {\n // @ts-expect-error explicitly assign to function\n _getPrototypeOf = Object.setPrototypeOf\n ? // @ts-expect-error -- intentionally omitting the argument\n Object.getPrototypeOf.bind(/* undefined */)\n : function _getPrototypeOf(o: T) {\n return (o as any).__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CAACC,CAAS,EAAO;EAEtDC,OAAA,CAAAC,OAAA,GAAAH,eAAe,GAAGI,MAAM,CAACC,cAAc,GAEnCD,MAAM,CAACE,cAAc,CAACC,IAAI,CAAgB,CAAC,GAC3C,SAASP,eAAeA,CAAmBC,CAAI,EAAE;IAC/C,OAAQA,CAAC,CAASO,SAAS,IAAIJ,MAAM,CAACE,cAAc,CAACL,CAAC,CAAC;EACzD,CAAC;EACL,OAAOD,eAAe,CAACC,CAAC,CAAC;AAC3B","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/identity.js b/node_modules/@babel/helpers/lib/helpers/identity.js new file mode 100644 index 0000000..7a5f5f4 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/identity.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _identity; +function _identity(x) { + return x; +} + +//# sourceMappingURL=identity.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/identity.js.map b/node_modules/@babel/helpers/lib/helpers/identity.js.map new file mode 100644 index 0000000..a7b15d0 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/identity.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_identity","x"],"sources":["../../src/helpers/identity.ts"],"sourcesContent":["/* @minVersion 7.17.0 */\n\nexport default function _identity(x: T) {\n return x;\n}\n"],"mappings":";;;;;;AAEe,SAASA,SAASA,CAAIC,CAAI,EAAE;EACzC,OAAOA,CAAC;AACV","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/importDeferProxy.js b/node_modules/@babel/helpers/lib/helpers/importDeferProxy.js new file mode 100644 index 0000000..1529609 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/importDeferProxy.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _importDeferProxy; +function _importDeferProxy(init) { + var ns = null; + var constValue = function (v) { + return function () { + return v; + }; + }; + var proxy = function (run) { + return function (_target, p, receiver) { + if (ns === null) ns = init(); + return run(ns, p, receiver); + }; + }; + return new Proxy({}, { + defineProperty: constValue(false), + deleteProperty: constValue(false), + get: proxy(Reflect.get), + getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor), + getPrototypeOf: constValue(null), + isExtensible: constValue(false), + has: proxy(Reflect.has), + ownKeys: proxy(Reflect.ownKeys), + preventExtensions: constValue(true), + set: constValue(false), + setPrototypeOf: constValue(false) + }); +} + +//# sourceMappingURL=importDeferProxy.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/importDeferProxy.js.map b/node_modules/@babel/helpers/lib/helpers/importDeferProxy.js.map new file mode 100644 index 0000000..dd66b3d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/importDeferProxy.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_importDeferProxy","init","ns","constValue","v","proxy","run","_target","p","receiver","Proxy","defineProperty","deleteProperty","get","Reflect","getOwnPropertyDescriptor","getPrototypeOf","isExtensible","has","ownKeys","preventExtensions","set","setPrototypeOf"],"sources":["../../src/helpers/importDeferProxy.ts"],"sourcesContent":["/* @minVersion 7.23.0 */\n\nexport default function _importDeferProxy(\n init: () => T,\n): ProxyHandler {\n var ns: T | null = null;\n\n var constValue = function (v: V) {\n return function (): V {\n return v;\n };\n };\n\n var proxy = function (run: Function) {\n return function (_target: T, p?: string | symbol, receiver?: any) {\n if (ns === null) ns = init();\n return run(ns, p, receiver);\n };\n };\n\n return new Proxy(\n {},\n {\n defineProperty: constValue(false),\n deleteProperty: constValue(false),\n get: proxy(Reflect.get),\n getOwnPropertyDescriptor: proxy(Reflect.getOwnPropertyDescriptor),\n getPrototypeOf: constValue(null),\n isExtensible: constValue(false),\n has: proxy(Reflect.has),\n ownKeys: proxy(Reflect.ownKeys),\n preventExtensions: constValue(true),\n set: constValue(false),\n setPrototypeOf: constValue(false),\n },\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CACvCC,IAAa,EACI;EACjB,IAAIC,EAAY,GAAG,IAAI;EAEvB,IAAIC,UAAU,GAAG,SAAAA,CAAoCC,CAAI,EAAE;IACzD,OAAO,YAAe;MACpB,OAAOA,CAAC;IACV,CAAC;EACH,CAAC;EAED,IAAIC,KAAK,GAAG,SAAAA,CAAUC,GAAa,EAAE;IACnC,OAAO,UAAUC,OAAU,EAAEC,CAAmB,EAAEC,QAAc,EAAE;MAChE,IAAIP,EAAE,KAAK,IAAI,EAAEA,EAAE,GAAGD,IAAI,CAAC,CAAC;MAC5B,OAAOK,GAAG,CAACJ,EAAE,EAAEM,CAAC,EAAEC,QAAQ,CAAC;IAC7B,CAAC;EACH,CAAC;EAED,OAAO,IAAIC,KAAK,CACd,CAAC,CAAC,EACF;IACEC,cAAc,EAAER,UAAU,CAAC,KAAK,CAAC;IACjCS,cAAc,EAAET,UAAU,CAAC,KAAK,CAAC;IACjCU,GAAG,EAAER,KAAK,CAACS,OAAO,CAACD,GAAG,CAAC;IACvBE,wBAAwB,EAAEV,KAAK,CAACS,OAAO,CAACC,wBAAwB,CAAC;IACjEC,cAAc,EAAEb,UAAU,CAAC,IAAI,CAAC;IAChCc,YAAY,EAAEd,UAAU,CAAC,KAAK,CAAC;IAC/Be,GAAG,EAAEb,KAAK,CAACS,OAAO,CAACI,GAAG,CAAC;IACvBC,OAAO,EAAEd,KAAK,CAACS,OAAO,CAACK,OAAO,CAAC;IAC/BC,iBAAiB,EAAEjB,UAAU,CAAC,IAAI,CAAC;IACnCkB,GAAG,EAAElB,UAAU,CAAC,KAAK,CAAC;IACtBmB,cAAc,EAAEnB,UAAU,CAAC,KAAK;EAClC,CACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/inherits.js b/node_modules/@babel/helpers/lib/helpers/inherits.js new file mode 100644 index 0000000..6039a8e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/inherits.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _inherits; +var _setPrototypeOf = require("./setPrototypeOf.js"); +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) (0, _setPrototypeOf.default)(subClass, superClass); +} + +//# sourceMappingURL=inherits.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/inherits.js.map b/node_modules/@babel/helpers/lib/helpers/inherits.js.map new file mode 100644 index 0000000..c175318 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/inherits.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_setPrototypeOf","require","_inherits","subClass","superClass","TypeError","prototype","Object","create","constructor","value","writable","configurable","defineProperty","setPrototypeOf"],"sources":["../../src/helpers/inherits.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\n\nexport default function _inherits(\n subClass: Function,\n superClass: Function | null,\n) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n // We can't use defineProperty to set the prototype in a single step because it\n // doesn't work in Chrome <= 36. https://github.com/babel/babel/issues/14056\n // V8 bug: https://bugs.chromium.org/p/v8/issues/detail?id=3334\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true,\n },\n });\n Object.defineProperty(subClass, \"prototype\", { writable: false });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAEe,SAASC,SAASA,CAC/BC,QAAkB,EAClBC,UAA2B,EAC3B;EACA,IAAI,OAAOA,UAAU,KAAK,UAAU,IAAIA,UAAU,KAAK,IAAI,EAAE;IAC3D,MAAM,IAAIC,SAAS,CAAC,oDAAoD,CAAC;EAC3E;EAIAF,QAAQ,CAACG,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACJ,UAAU,IAAIA,UAAU,CAACE,SAAS,EAAE;IACrEG,WAAW,EAAE;MACXC,KAAK,EAAEP,QAAQ;MACfQ,QAAQ,EAAE,IAAI;MACdC,YAAY,EAAE;IAChB;EACF,CAAC,CAAC;EACFL,MAAM,CAACM,cAAc,CAACV,QAAQ,EAAE,WAAW,EAAE;IAAEQ,QAAQ,EAAE;EAAM,CAAC,CAAC;EACjE,IAAIP,UAAU,EAAE,IAAAU,uBAAc,EAACX,QAAQ,EAAEC,UAAU,CAAC;AACtD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/inheritsLoose.js b/node_modules/@babel/helpers/lib/helpers/inheritsLoose.js new file mode 100644 index 0000000..0de50d7 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/inheritsLoose.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _inheritsLoose; +var _setPrototypeOf = require("./setPrototypeOf.js"); +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + (0, _setPrototypeOf.default)(subClass, superClass); +} + +//# sourceMappingURL=inheritsLoose.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/inheritsLoose.js.map b/node_modules/@babel/helpers/lib/helpers/inheritsLoose.js.map new file mode 100644 index 0000000..44cd15d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/inheritsLoose.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_setPrototypeOf","require","_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","setPrototypeOf"],"sources":["../../src/helpers/inheritsLoose.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\n\nexport default function _inheritsLoose(\n subClass: Function,\n superClass: Function,\n) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAEe,SAASC,cAAcA,CACpCC,QAAkB,EAClBC,UAAoB,EACpB;EACAD,QAAQ,CAACE,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACH,UAAU,CAACC,SAAS,CAAC;EACxDF,QAAQ,CAACE,SAAS,CAACG,WAAW,GAAGL,QAAQ;EACzC,IAAAM,uBAAc,EAACN,QAAQ,EAAEC,UAAU,CAAC;AACtC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/initializerDefineProperty.js b/node_modules/@babel/helpers/lib/helpers/initializerDefineProperty.js new file mode 100644 index 0000000..c0daf6d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/initializerDefineProperty.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _initializerDefineProperty; +function _initializerDefineProperty(target, property, descriptor, context) { + if (!descriptor) return; + Object.defineProperty(target, property, { + enumerable: descriptor.enumerable, + configurable: descriptor.configurable, + writable: descriptor.writable, + value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 + }); +} + +//# sourceMappingURL=initializerDefineProperty.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/initializerDefineProperty.js.map b/node_modules/@babel/helpers/lib/helpers/initializerDefineProperty.js.map new file mode 100644 index 0000000..abee831 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/initializerDefineProperty.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call"],"sources":["../../src/helpers/initializerDefineProperty.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\ninterface DescriptorWithInitializer extends PropertyDescriptor {\n initializer?: () => any;\n}\n\nexport default function _initializerDefineProperty(\n target: T,\n property: PropertyKey,\n descriptor: DescriptorWithInitializer | undefined,\n context: DecoratorContext,\n): void {\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer\n ? descriptor.initializer.call(context)\n : void 0,\n });\n}\n"],"mappings":";;;;;;AAMe,SAASA,0BAA0BA,CAChDC,MAAS,EACTC,QAAqB,EACrBC,UAAiD,EACjDC,OAAyB,EACnB;EACN,IAAI,CAACD,UAAU,EAAE;EAEjBE,MAAM,CAACC,cAAc,CAACL,MAAM,EAAEC,QAAQ,EAAE;IACtCK,UAAU,EAAEJ,UAAU,CAACI,UAAU;IACjCC,YAAY,EAAEL,UAAU,CAACK,YAAY;IACrCC,QAAQ,EAAEN,UAAU,CAACM,QAAQ;IAC7BC,KAAK,EAAEP,UAAU,CAACQ,WAAW,GACzBR,UAAU,CAACQ,WAAW,CAACC,IAAI,CAACR,OAAO,CAAC,GACpC,KAAK;EACX,CAAC,CAAC;AACJ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/initializerWarningHelper.js b/node_modules/@babel/helpers/lib/helpers/initializerWarningHelper.js new file mode 100644 index 0000000..4d8e5aa --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/initializerWarningHelper.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _initializerWarningHelper; +function _initializerWarningHelper(descriptor, context) { + throw new Error("Decorating class property failed. Please ensure that " + "transform-class-properties is enabled and runs after the decorators transform."); +} + +//# sourceMappingURL=initializerWarningHelper.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/initializerWarningHelper.js.map b/node_modules/@babel/helpers/lib/helpers/initializerWarningHelper.js.map new file mode 100644 index 0000000..dec71a1 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/initializerWarningHelper.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_initializerWarningHelper","descriptor","context","Error"],"sources":["../../src/helpers/initializerWarningHelper.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport default function _initializerWarningHelper(\n descriptor: PropertyDescriptor,\n context: DecoratorContext,\n): never {\n throw new Error(\n \"Decorating class property failed. Please ensure that \" +\n \"transform-class-properties is enabled and runs after the decorators transform.\",\n );\n}\n"],"mappings":";;;;;;AAGe,SAASA,yBAAyBA,CAC/CC,UAA8B,EAC9BC,OAAyB,EAClB;EACP,MAAM,IAAIC,KAAK,CACb,uDAAuD,GACrD,gFACJ,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/instanceof.js b/node_modules/@babel/helpers/lib/helpers/instanceof.js new file mode 100644 index 0000000..ff8272d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/instanceof.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _instanceof; +function _instanceof(left, right) { + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { + return !!right[Symbol.hasInstance](left); + } else { + return left instanceof right; + } +} + +//# sourceMappingURL=instanceof.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/instanceof.js.map b/node_modules/@babel/helpers/lib/helpers/instanceof.js.map new file mode 100644 index 0000000..725c002 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/instanceof.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_instanceof","left","right","Symbol","hasInstance"],"sources":["../../src/helpers/instanceof.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _instanceof(left: any, right: Function) {\n if (\n right != null &&\n typeof Symbol !== \"undefined\" &&\n right[Symbol.hasInstance]\n ) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,WAAWA,CAACC,IAAS,EAAEC,KAAe,EAAE;EAC9D,IACEA,KAAK,IAAI,IAAI,IACb,OAAOC,MAAM,KAAK,WAAW,IAC7BD,KAAK,CAACC,MAAM,CAACC,WAAW,CAAC,EACzB;IACA,OAAO,CAAC,CAACF,KAAK,CAACC,MAAM,CAACC,WAAW,CAAC,CAACH,IAAI,CAAC;EAC1C,CAAC,MAAM;IACL,OAAOA,IAAI,YAAYC,KAAK;EAC9B;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/interopRequireDefault.js b/node_modules/@babel/helpers/lib/helpers/interopRequireDefault.js new file mode 100644 index 0000000..8c2873d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/interopRequireDefault.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _interopRequireDefault; +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + +//# sourceMappingURL=interopRequireDefault.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/interopRequireDefault.js.map b/node_modules/@babel/helpers/lib/helpers/interopRequireDefault.js.map new file mode 100644 index 0000000..71e0a55 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/interopRequireDefault.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_interopRequireDefault","obj","__esModule","default"],"sources":["../../src/helpers/interopRequireDefault.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _interopRequireDefault(obj: any) {\n return obj && obj.__esModule ? obj : { default: obj };\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAACC,GAAQ,EAAE;EACvD,OAAOA,GAAG,IAAIA,GAAG,CAACC,UAAU,GAAGD,GAAG,GAAG;IAAEE,OAAO,EAAEF;EAAI,CAAC;AACvD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js b/node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js new file mode 100644 index 0000000..eaa82e5 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _interopRequireWildcard; +function _interopRequireWildcard(obj, nodeInterop) { + if (typeof WeakMap === "function") { + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + } + return (exports.default = _interopRequireWildcard = function (obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + var _; + var newObj = { + __proto__: null, + default: obj + }; + var desc; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return newObj; + } + _ = nodeInterop ? cacheNodeInterop : cacheBabelInterop; + if (_) { + if (_.has(obj)) return _.get(obj); + _.set(obj, newObj); + } + for (const key in obj) { + if (key !== "default" && {}.hasOwnProperty.call(obj, key)) { + desc = (_ = Object.defineProperty) && Object.getOwnPropertyDescriptor(obj, key); + if (desc && (desc.get || desc.set)) { + _(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + return newObj; + })(obj, nodeInterop); +} + +//# sourceMappingURL=interopRequireWildcard.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js.map b/node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js.map new file mode 100644 index 0000000..10bd88b --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_interopRequireWildcard","obj","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","exports","default","__esModule","_","newObj","__proto__","desc","has","get","set","key","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/helpers/interopRequireWildcard.ts"],"sourcesContent":["/* @minVersion 7.14.0 */\n\nexport default function _interopRequireWildcard(\n obj: any,\n nodeInterop: boolean,\n) {\n if (typeof WeakMap === \"function\") {\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n }\n\n // @ts-expect-error: assign to function\n return (_interopRequireWildcard = function (obj: any, nodeInterop: boolean) {\n if (!nodeInterop && obj && obj.__esModule) {\n return obj;\n }\n // Temporary variable for output size\n var _;\n var newObj: { [key: string]: any } = { __proto__: null, default: obj };\n var desc: PropertyDescriptor | undefined;\n\n if (\n obj === null ||\n (typeof obj !== \"object\" && typeof obj !== \"function\")\n ) {\n return newObj;\n }\n\n _ = nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n if (_) {\n if (_.has(obj)) return _.get(obj);\n _.set(obj, newObj);\n }\n\n for (const key in obj) {\n if (key !== \"default\" && {}.hasOwnProperty.call(obj, key)) {\n desc =\n (_ = Object.defineProperty) &&\n Object.getOwnPropertyDescriptor(obj, key);\n if (desc && (desc.get || desc.set)) {\n _(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n return newObj;\n })(obj, nodeInterop);\n}\n"],"mappings":";;;;;;AAEe,SAASA,uBAAuBA,CAC7CC,GAAQ,EACRC,WAAoB,EACpB;EACA,IAAI,OAAOC,OAAO,KAAK,UAAU,EAAE;IACjC,IAAIC,iBAAiB,GAAG,IAAID,OAAO,CAAC,CAAC;IACrC,IAAIE,gBAAgB,GAAG,IAAIF,OA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MAAM;EACf,CAAC,EAAET,GAAG,EAAEC,WAAW,CAAC;AACtB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/isNativeFunction.js b/node_modules/@babel/helpers/lib/helpers/isNativeFunction.js new file mode 100644 index 0000000..2d3c70c --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/isNativeFunction.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _isNativeFunction; +function _isNativeFunction(fn) { + try { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } catch (_e) { + return typeof fn === "function"; + } +} + +//# sourceMappingURL=isNativeFunction.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/isNativeFunction.js.map b/node_modules/@babel/helpers/lib/helpers/isNativeFunction.js.map new file mode 100644 index 0000000..2b1c076 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/isNativeFunction.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_isNativeFunction","fn","Function","toString","call","indexOf","_e"],"sources":["../../src/helpers/isNativeFunction.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _isNativeFunction(fn: unknown): fn is Function {\n // Note: This function returns \"true\" for core-js functions.\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (_e) {\n // Firefox 31 throws when \"toString\" is applied to an HTMLElement\n return typeof fn === \"function\";\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CAACC,EAAW,EAAkB;EAErE,IAAI;IACF,OAAOC,QAAQ,CAACC,QAAQ,CAACC,IAAI,CAACH,EAAE,CAAC,CAACI,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;EACnE,CAAC,CAAC,OAAOC,EAAE,EAAE;IAEX,OAAO,OAAOL,EAAE,KAAK,UAAU;EACjC;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/isNativeReflectConstruct.js b/node_modules/@babel/helpers/lib/helpers/isNativeReflectConstruct.js new file mode 100644 index 0000000..dbf66cd --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/isNativeReflectConstruct.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _isNativeReflectConstruct; +function _isNativeReflectConstruct() { + try { + var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (_) {} + return (exports.default = _isNativeReflectConstruct = function () { + return !!result; + })(); +} + +//# sourceMappingURL=isNativeReflectConstruct.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/isNativeReflectConstruct.js.map b/node_modules/@babel/helpers/lib/helpers/isNativeReflectConstruct.js.map new file mode 100644 index 0000000..21028fd --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/isNativeReflectConstruct.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_isNativeReflectConstruct","result","Boolean","prototype","valueOf","call","Reflect","construct","_","exports","default"],"sources":["../../src/helpers/isNativeReflectConstruct.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nexport default function _isNativeReflectConstruct() {\n // Since Reflect.construct can't be properly polyfilled, some\n // implementations (e.g. core-js@2) don't set the correct internal slots.\n // Those polyfills don't allow us to subclass built-ins, so we need to\n // use our fallback implementation.\n try {\n // If the internal slots aren't set, this throws an error similar to\n // TypeError: this is not a Boolean object.\n var result = !Boolean.prototype.valueOf.call(\n Reflect.construct(Boolean, [], function () {}),\n );\n } catch (_) {}\n // @ts-expect-error assign to function\n return (_isNativeReflectConstruct = function () {\n return !!result;\n })();\n}\n"],"mappings":";;;;;;AAEe,SAASA,yBAAyBA,CAAA,EAAG;EAKlD,IAAI;IAGF,IAAIC,MAAM,GAAG,CAACC,OAAO,CAACC,SAAS,CAACC,OAAO,CAACC,IAAI,CAC1CC,OAAO,CAACC,SAAS,CAACL,OAAO,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC,CAC/C,CAAC;EACH,CAAC,CAAC,OAAOM,CAAC,EAAE,CAAC;EAEb,OAAO,CAAAC,OAAA,CAAAC,OAAA,GAACV,yBAAyB,GAAG,SAAAA,CAAA,EAAY;IAC9C,OAAO,CAAC,CAACC,MAAM;EACjB,CAAC,EAAE,CAAC;AACN","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/iterableToArray.js b/node_modules/@babel/helpers/lib/helpers/iterableToArray.js new file mode 100644 index 0000000..07ea96f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/iterableToArray.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _iterableToArray; +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) { + return Array.from(iter); + } +} + +//# sourceMappingURL=iterableToArray.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/iterableToArray.js.map b/node_modules/@babel/helpers/lib/helpers/iterableToArray.js.map new file mode 100644 index 0000000..e6481d7 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/iterableToArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_iterableToArray","iter","Symbol","iterator","Array","from"],"sources":["../../src/helpers/iterableToArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _iterableToArray(iter: Iterable) {\n if (\n (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null) ||\n (iter as any)[\"@@iterator\"] != null\n ) {\n return Array.from(iter);\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,gBAAgBA,CAAIC,IAAiB,EAAE;EAC7D,IACG,OAAOC,MAAM,KAAK,WAAW,IAAID,IAAI,CAACC,MAAM,CAACC,QAAQ,CAAC,IAAI,IAAI,IAC9DF,IAAI,CAAS,YAAY,CAAC,IAAI,IAAI,EACnC;IACA,OAAOG,KAAK,CAACC,IAAI,CAACJ,IAAI,CAAC;EACzB;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js b/node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js new file mode 100644 index 0000000..9d35185 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js @@ -0,0 +1,41 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _iterableToArrayLimit; +function _iterableToArrayLimit(arr, i) { + var iterator = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (iterator == null) return; + var _arr = []; + var iteratorNormalCompletion = true; + var didIteratorError = false; + var step, iteratorError, next, _return; + try { + next = (iterator = iterator.call(arr)).next; + if (i === 0) { + if (Object(iterator) !== iterator) return; + iteratorNormalCompletion = false; + } else { + for (; !(iteratorNormalCompletion = (step = next.call(iterator)).done); iteratorNormalCompletion = true) { + _arr.push(step.value); + if (_arr.length === i) break; + } + } + } catch (err) { + didIteratorError = true; + iteratorError = err; + } finally { + try { + if (!iteratorNormalCompletion && iterator["return"] != null) { + _return = iterator["return"](); + if (Object(_return) !== _return) return; + } + } finally { + if (didIteratorError) throw iteratorError; + } + } + return _arr; +} + +//# sourceMappingURL=iterableToArrayLimit.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js.map b/node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js.map new file mode 100644 index 0000000..6ac2817 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_iterableToArrayLimit","arr","i","iterator","Symbol","_arr","iteratorNormalCompletion","didIteratorError","step","iteratorError","next","_return","call","Object","done","push","value","length","err"],"sources":["../../src/helpers/iterableToArrayLimit.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _iterableToArrayLimit(arr: Iterable, i: number) {\n // this is an expanded form of \\`for...of\\` that properly supports abrupt completions of\n // iterators etc.\n\n var iterator: Iterator =\n arr == null\n ? null\n : (typeof Symbol !== \"undefined\" && arr[Symbol.iterator]) ||\n (arr as any)[\"@@iterator\"];\n if (iterator == null) return;\n\n var _arr: T[] = [];\n var iteratorNormalCompletion = true;\n var didIteratorError = false;\n var step, iteratorError, next, _return;\n try {\n next = (iterator = (iterator as unknown as Function).call(arr)).next;\n if (i === 0) {\n if (Object(iterator) !== iterator) return;\n iteratorNormalCompletion = false;\n } else {\n for (\n ;\n !(iteratorNormalCompletion = (step = next.call(iterator)).done);\n iteratorNormalCompletion = true\n ) {\n _arr.push(step.value);\n if (_arr.length === i) break;\n }\n }\n } catch (err) {\n didIteratorError = true;\n iteratorError = err;\n } finally {\n try {\n if (!iteratorNormalCompletion && iterator[\"return\"] != null) {\n _return = iterator[\"return\"]();\n // eslint-disable-next-line no-unsafe-finally\n if (Object(_return) !== _return) return;\n }\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (didIteratorError) throw iteratorError;\n }\n }\n return _arr;\n}\n"],"mappings":";;;;;;AAEe,SAASA,qBAAqBA,CAAIC,GAAgB,EAAEC,CAAS,EAAE;EAI5E,IAAIC,QAAqB,GACvBF,GAAG,IAAI,IAAI,GACP,IAAI,GACH,OAAOG,MAAM,KAAK,WAAW,IAAIH,GAAG,CAACG,MAAM,CAACD,QAAQ,CAAC,IACrDF,GAAG,CAAS,YAAY,CAAC;EAChC,IAAIE,QAAQ,IAAI,IAAI,EAAE;EAEtB,IAAIE,IAAS,GAAG,EAAE;EAClB,IAAIC,wBAAwB,GAAG,IAAI;EACnC,IAAIC,gBAAgB,GAAG,KAAK;EAC5B,IAAIC,IAAI,EAAEC,aAAa,EAAEC,IAAI,EAAEC,OAAO;EACtC,IAAI;IACFD,IAAI,GAAG,CAACP,QAAQ,GAAIA,QAAQ,CAAyBS,IAAI,CAACX,GAAG,CAAC,EAAES,IAAI;IACpE,IAAIR,CAAC,KAAK,CAAC,EAAE;MACX,IAAIW,MAAM,CAACV,QAAQ,CAAC,KAAKA,QAAQ,EAAE;MACnCG,wBAAwB,GAAG,KAAK;IAClC,CAAC,MAAM;MACL,OAEE,EAAEA,wBAAwB,GAAG,CAACE,IAAI,GAAGE,IAAI,CAACE,IAAI,CAACT,QAAQ,CAAC,EAAEW,IAAI,CAAC,EAC/DR,wBAAwB,GAAG,IAAI,EAC/B;QACAD,IAAI,CAACU,IAAI,CAACP,IAAI,CAACQ,KAAK,CAAC;QACrB,IAAIX,IAAI,CAACY,MAAM,KAAKf,CAAC,EAAE;MACzB;IACF;EACF,CAAC,CAAC,OAAOgB,GAAG,EAAE;IACZX,gBAAgB,GAAG,IAAI;IACvBE,aAAa,GAAGS,GAAG;EACrB,CAAC,SAAS;IACR,IAAI;MACF,IAAI,CAACZ,wBAAwB,IAAIH,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE;QAC3DQ,OAAO,GAAGR,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE9B,IAAIU,MAAM,CAACF,OAAO,CAAC,KAAKA,OAAO,EAAE;MACnC;IACF,CAAC,SAAS;MAER,IAAIJ,gBAAgB,EAAE,MAAME,aAAa;IAC3C;EACF;EACA,OAAOJ,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/jsx.js b/node_modules/@babel/helpers/lib/helpers/jsx.js new file mode 100644 index 0000000..ca5a957 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/jsx.js @@ -0,0 +1,47 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createRawReactElement; +var REACT_ELEMENT_TYPE; +function _createRawReactElement(type, props, key, children) { + if (!REACT_ELEMENT_TYPE) { + REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; + } + var defaultProps = type && type.defaultProps; + var childrenLength = arguments.length - 3; + if (!props && childrenLength !== 0) { + props = { + children: void 0 + }; + } + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = new Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 3]; + } + props.children = childArray; + } + if (props && defaultProps) { + for (var propName in defaultProps) { + if (props[propName] === void 0) { + props[propName] = defaultProps[propName]; + } + } + } else if (!props) { + props = defaultProps || {}; + } + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key === undefined ? null : "" + key, + ref: null, + props: props, + _owner: null + }; +} + +//# sourceMappingURL=jsx.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/jsx.js.map b/node_modules/@babel/helpers/lib/helpers/jsx.js.map new file mode 100644 index 0000000..ef821f6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/jsx.js.map @@ -0,0 +1 @@ +{"version":3,"names":["REACT_ELEMENT_TYPE","_createRawReactElement","type","props","key","children","Symbol","defaultProps","childrenLength","arguments","length","childArray","Array","i","propName","$$typeof","undefined","ref","_owner"],"sources":["../../src/helpers/jsx.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nvar REACT_ELEMENT_TYPE: symbol | 0xeac7;\n\ninterface Props {\n children?: any;\n [propName: string]: any;\n}\n\ninterface ReactElement {\n $$typeof: typeof REACT_ELEMENT_TYPE;\n type: any;\n key: string | null;\n ref: null;\n props: Props;\n _owner: null;\n}\n\ntype ReactElementType = any;\ntype ReactKey = string | number | bigint;\ntype ReactNode =\n | ReactElement\n | string\n | number\n | Iterable\n | boolean\n | null\n | undefined;\n\nexport default function _createRawReactElement(\n type: ReactElementType,\n props: Props,\n key?: ReactKey,\n children?: ReactNode[],\n): ReactElement {\n if (!REACT_ELEMENT_TYPE) {\n REACT_ELEMENT_TYPE =\n (typeof Symbol === \"function\" &&\n // \"for\" is a reserved keyword in ES3 so escaping it here for backward compatibility\n Symbol[\"for\"] &&\n Symbol[\"for\"](\"react.element\")) ||\n 0xeac7;\n }\n\n var defaultProps: Props = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = { children: void 0 };\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = new Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : \"\" + key,\n ref: null,\n props: props,\n _owner: null,\n };\n}\n"],"mappings":";;;;;;AAEA,IAAIA,kBAAmC;AA2BxB,SAASC,sBAAsBA,CAC5CC,IAAsB,EACtBC,KAAY,EACZC,GAAc,EACdC,QAAsB,EACR;EACd,IAAI,CAACL,kBAAkB,EAAE;IACvBA,kBAAkB,GACf,OAAOM,MAAM,KAAK,UAAU,IAE3BA,MAAM,CAAC,KAAK,CAAC,IACbA,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,IAChC,MAAM;EACV;EAEA,IAAIC,YAAmB,GAAGL,IAAI,IAAIA,IAAI,CAACK,YAAY;EACnD,IAAIC,cAAc,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC;EAEzC,IAAI,CAACP,KAAK,IAAIK,cAAc,KAAK,CAAC,EAAE;IAGlCL,KAAK,GAAG;MAAEE,QAAQ,EAAE,KAAK;IAAE,CAAC;EAC9B;EAEA,IAAIG,cAAc,KAAK,CAAC,EAAE;IACxBL,KAAK,CAACE,QAAQ,GAAGA,QAAQ;EAC3B,CAAC,MAAM,IAAIG,cAAc,GAAG,CAAC,EAAE;IAC7B,IAAIG,UAAU,GAAG,IAAIC,KAAK,CAACJ,cAAc,CAAC;IAC1C,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,cAAc,EAAEK,CAAC,EAAE,EAAE;MACvCF,UAAU,CAACE,CAAC,CAAC,GAAGJ,SAAS,CAACI,CAAC,GAAG,CAAC,CAAC;IAClC;IACAV,KAAK,CAACE,QAAQ,GAAGM,UAAU;EAC7B;EAEA,IAAIR,KAAK,IAAII,YAAY,EAAE;IACzB,KAAK,IAAIO,QAAQ,IAAIP,YAAY,EAAE;MACjC,IAAIJ,KAAK,CAACW,QAAQ,CAAC,KAAK,KAAK,CAAC,EAAE;QAC9BX,KAAK,CAACW,QAAQ,CAAC,GAAGP,YAAY,CAACO,QAAQ,CAAC;MAC1C;IACF;EACF,CAAC,MAAM,IAAI,CAACX,KAAK,EAAE;IACjBA,KAAK,GAAGI,YAAY,IAAI,CAAC,CAAC;EAC5B;EAEA,OAAO;IACLQ,QAAQ,EAAEf,kBAAkB;IAC5BE,IAAI,EAAEA,IAAI;IACVE,GAAG,EAAEA,GAAG,KAAKY,SAAS,GAAG,IAAI,GAAG,EAAE,GAAGZ,GAAG;IACxCa,GAAG,EAAE,IAAI;IACTd,KAAK,EAAEA,KAAK;IACZe,MAAM,EAAE;EACV,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/maybeArrayLike.js b/node_modules/@babel/helpers/lib/helpers/maybeArrayLike.js new file mode 100644 index 0000000..572bbb0 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/maybeArrayLike.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _maybeArrayLike; +var _arrayLikeToArray = require("./arrayLikeToArray.js"); +function _maybeArrayLike(orElse, arr, i) { + if (arr && !Array.isArray(arr) && typeof arr.length === "number") { + var len = arr.length; + return (0, _arrayLikeToArray.default)(arr, i !== void 0 && i < len ? i : len); + } + return orElse(arr, i); +} + +//# sourceMappingURL=maybeArrayLike.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/maybeArrayLike.js.map b/node_modules/@babel/helpers/lib/helpers/maybeArrayLike.js.map new file mode 100644 index 0000000..b69080f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/maybeArrayLike.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayLikeToArray","require","_maybeArrayLike","orElse","arr","i","Array","isArray","length","len","arrayLikeToArray"],"sources":["../../src/helpers/maybeArrayLike.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport arrayLikeToArray from \"./arrayLikeToArray.ts\";\n\nexport default function _maybeArrayLike(\n orElse: (arr: any, i: number) => T[] | undefined,\n arr: ArrayLike,\n i: number,\n) {\n if (arr && !Array.isArray(arr) && typeof arr.length === \"number\") {\n var len = arr.length;\n return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len);\n }\n return orElse(arr, i);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAEe,SAASC,eAAeA,CACrCC,MAAgD,EAChDC,GAAiB,EACjBC,CAAS,EACT;EACA,IAAID,GAAG,IAAI,CAACE,KAAK,CAACC,OAAO,CAACH,GAAG,CAAC,IAAI,OAAOA,GAAG,CAACI,MAAM,KAAK,QAAQ,EAAE;IAChE,IAAIC,GAAG,GAAGL,GAAG,CAACI,MAAM;IACpB,OAAO,IAAAE,yBAAgB,EAAIN,GAAG,EAAEC,CAAC,KAAK,KAAK,CAAC,IAAIA,CAAC,GAAGI,GAAG,GAAGJ,CAAC,GAAGI,GAAG,CAAC;EACpE;EACA,OAAON,MAAM,CAACC,GAAG,EAAEC,CAAC,CAAC;AACvB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/newArrowCheck.js b/node_modules/@babel/helpers/lib/helpers/newArrowCheck.js new file mode 100644 index 0000000..d750092 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/newArrowCheck.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _newArrowCheck; +function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +} + +//# sourceMappingURL=newArrowCheck.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/newArrowCheck.js.map b/node_modules/@babel/helpers/lib/helpers/newArrowCheck.js.map new file mode 100644 index 0000000..4bb901f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/newArrowCheck.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_newArrowCheck","innerThis","boundThis","TypeError"],"sources":["../../src/helpers/newArrowCheck.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _newArrowCheck(innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,cAAcA,CAACC,SAAS,EAAEC,SAAS,EAAE;EAC3D,IAAID,SAAS,KAAKC,SAAS,EAAE;IAC3B,MAAM,IAAIC,SAAS,CAAC,sCAAsC,CAAC;EAC7D;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/nonIterableRest.js b/node_modules/@babel/helpers/lib/helpers/nonIterableRest.js new file mode 100644 index 0000000..391972f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/nonIterableRest.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _nonIterableRest; +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +//# sourceMappingURL=nonIterableRest.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/nonIterableRest.js.map b/node_modules/@babel/helpers/lib/helpers/nonIterableRest.js.map new file mode 100644 index 0000000..f651ddc --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/nonIterableRest.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_nonIterableRest","TypeError"],"sources":["../../src/helpers/nonIterableRest.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _nonIterableRest() {\n throw new TypeError(\n \"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,gBAAgBA,CAAA,EAAG;EACzC,MAAM,IAAIC,SAAS,CACjB,2IACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/nonIterableSpread.js b/node_modules/@babel/helpers/lib/helpers/nonIterableSpread.js new file mode 100644 index 0000000..6a8bc3f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/nonIterableSpread.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _nonIterableSpread; +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} + +//# sourceMappingURL=nonIterableSpread.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/nonIterableSpread.js.map b/node_modules/@babel/helpers/lib/helpers/nonIterableSpread.js.map new file mode 100644 index 0000000..ddd8644 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/nonIterableSpread.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_nonIterableSpread","TypeError"],"sources":["../../src/helpers/nonIterableSpread.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _nonIterableSpread() {\n throw new TypeError(\n \"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,kBAAkBA,CAAA,EAAG;EAC3C,MAAM,IAAIC,SAAS,CACjB,sIACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/nullishReceiverError.js b/node_modules/@babel/helpers/lib/helpers/nullishReceiverError.js new file mode 100644 index 0000000..741d352 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/nullishReceiverError.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _nullishReceiverError; +function _nullishReceiverError(r) { + throw new TypeError("Cannot set property of null or undefined."); +} + +//# sourceMappingURL=nullishReceiverError.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/nullishReceiverError.js.map b/node_modules/@babel/helpers/lib/helpers/nullishReceiverError.js.map new file mode 100644 index 0000000..e485bde --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/nullishReceiverError.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_nullishReceiverError","r","TypeError"],"sources":["../../src/helpers/nullishReceiverError.js"],"sourcesContent":["/* @minVersion 7.22.6 */\n\n// eslint-disable-next-line no-unused-vars\nexport default function _nullishReceiverError(r) {\n throw new TypeError(\"Cannot set property of null or undefined.\");\n}\n"],"mappings":";;;;;;AAGe,SAASA,qBAAqBA,CAACC,CAAC,EAAE;EAC/C,MAAM,IAAIC,SAAS,CAAC,2CAA2C,CAAC;AAClE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/objectDestructuringEmpty.js b/node_modules/@babel/helpers/lib/helpers/objectDestructuringEmpty.js new file mode 100644 index 0000000..30a045a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectDestructuringEmpty.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _objectDestructuringEmpty; +function _objectDestructuringEmpty(obj) { + if (obj == null) throw new TypeError("Cannot destructure " + obj); +} + +//# sourceMappingURL=objectDestructuringEmpty.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/objectDestructuringEmpty.js.map b/node_modules/@babel/helpers/lib/helpers/objectDestructuringEmpty.js.map new file mode 100644 index 0000000..5b914f8 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectDestructuringEmpty.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_objectDestructuringEmpty","obj","TypeError"],"sources":["../../src/helpers/objectDestructuringEmpty.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _objectDestructuringEmpty(\n obj: T | null | undefined,\n): asserts obj is T {\n if (obj == null) throw new TypeError(\"Cannot destructure \" + obj);\n}\n"],"mappings":";;;;;;AAEe,SAASA,yBAAyBA,CAC/CC,GAAyB,EACP;EAClB,IAAIA,GAAG,IAAI,IAAI,EAAE,MAAM,IAAIC,SAAS,CAAC,qBAAqB,GAAGD,GAAG,CAAC;AACnE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/objectSpread.js b/node_modules/@babel/helpers/lib/helpers/objectSpread.js new file mode 100644 index 0000000..e65ac31 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectSpread.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _objectSpread; +var _defineProperty = require("./defineProperty.js"); +function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? Object(arguments[i]) : {}; + var ownKeys = Object.keys(source); + if (typeof Object.getOwnPropertySymbols === "function") { + ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + ownKeys.forEach(function (key) { + (0, _defineProperty.default)(target, key, source[key]); + }); + } + return target; +} + +//# sourceMappingURL=objectSpread.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/objectSpread.js.map b/node_modules/@babel/helpers/lib/helpers/objectSpread.js.map new file mode 100644 index 0000000..0579011 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectSpread.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_defineProperty","require","_objectSpread","target","i","arguments","length","source","Object","ownKeys","keys","getOwnPropertySymbols","push","apply","filter","sym","getOwnPropertyDescriptor","enumerable","forEach","key","defineProperty"],"sources":["../../src/helpers/objectSpread.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nimport defineProperty from \"./defineProperty.ts\";\n\ntype Intersection = R extends [infer H, ...infer S]\n ? H & Intersection\n : unknown;\n\nexport default function _objectSpread(\n target: T,\n ...sources: U\n): T & Intersection;\nexport default function _objectSpread(target: object) {\n for (var i = 1; i < arguments.length; i++) {\n var source: object = arguments[i] != null ? Object(arguments[i]) : {};\n var ownKeys: PropertyKey[] = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys.push.apply(\n ownKeys,\n Object.getOwnPropertySymbols(source).filter(function (sym) {\n // sym already comes from `Object.getOwnPropertySymbols`, so getOwnPropertyDescriptor should always be defined\n return Object.getOwnPropertyDescriptor(source, sym)!.enumerable;\n }),\n );\n }\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key as keyof typeof source]);\n });\n }\n return target;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,eAAA,GAAAC,OAAA;AAUe,SAASC,aAAaA,CAACC,MAAc,EAAE;EACpD,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,SAAS,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IACzC,IAAIG,MAAc,GAAGF,SAAS,CAACD,CAAC,CAAC,IAAI,IAAI,GAAGI,MAAM,CAACH,SAAS,CAACD,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrE,IAAIK,OAAsB,GAAGD,MAAM,CAACE,IAAI,CAACH,MAAM,CAAC;IAChD,IAAI,OAAOC,MAAM,CAACG,qBAAqB,KAAK,UAAU,EAAE;MACtDF,OAAO,CAACG,IAAI,CAACC,KAAK,CAChBJ,OAAO,EACPD,MAAM,CAACG,qBAAqB,CAACJ,MAAM,CAAC,CAACO,MAAM,CAAC,UAAUC,GAAG,EAAE;QAEzD,OAAOP,MAAM,CAACQ,wBAAwB,CAACT,MAAM,EAAEQ,GAAG,CAAC,CAAEE,UAAU;MACjE,CAAC,CACH,CAAC;IACH;IACAR,OAAO,CAACS,OAAO,CAAC,UAAUC,GAAG,EAAE;MAC7B,IAAAC,uBAAc,EAACjB,MAAM,EAAEgB,GAAG,EAAEZ,MAAM,CAACY,GAAG,CAAwB,CAAC;IACjE,CAAC,CAAC;EACJ;EACA,OAAOhB,MAAM;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/objectSpread2.js b/node_modules/@babel/helpers/lib/helpers/objectSpread2.js new file mode 100644 index 0000000..be4e56a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectSpread2.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _objectSpread2; +var _defineProperty = require("./defineProperty.js"); +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + keys.push.apply(keys, symbols); + } + return keys; +} +function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + (0, _defineProperty.default)(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; +} + +//# sourceMappingURL=objectSpread2.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/objectSpread2.js.map b/node_modules/@babel/helpers/lib/helpers/objectSpread2.js.map new file mode 100644 index 0000000..73f81ba --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectSpread2.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_defineProperty","require","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread2","target","i","arguments","length","source","forEach","key","defineProperty","getOwnPropertyDescriptors","defineProperties"],"sources":["../../src/helpers/objectSpread2.ts"],"sourcesContent":["/* @minVersion 7.5.0 */\n\nimport defineProperty from \"./defineProperty.ts\";\n\n// This function is different to \"Reflect.ownKeys\". The enumerableOnly\n// filters on symbol properties only. Returned string properties are always\n// enumerable. It is good to use in objectSpread.\n\nfunction ownKeys(\n object: object,\n enumerableOnly?: boolean | undefined,\n): (string | symbol)[] {\n var keys: (string | symbol)[] = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n // sym already comes from `Object.getOwnPropertySymbols`, so getOwnPropertyDescriptor should always be defined\n return Object.getOwnPropertyDescriptor(object, sym)!.enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\n\ntype Intersection = R extends [infer H, ...infer S]\n ? H & Intersection\n : unknown;\n\nexport default function _objectSpread2(\n target: T,\n ...sources: U\n): T & Intersection;\nexport default function _objectSpread2(target: object) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(\n target,\n key,\n // key already comes from ownKeys, so getOwnPropertyDescriptor should always be defined\n Object.getOwnPropertyDescriptor(source, key)!,\n );\n });\n }\n }\n return target;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAMA,SAASC,OAAOA,CACdC,MAAc,EACdC,cAAoC,EACf;EACrB,IAAIC,IAAyB,GAAGC,MAAM,CAACD,IAAI,CAACF,MAAM,CAAC;EACnD,IAAIG,MAAM,C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C7C,CAAC;MACH,CAAC,CAAC;IACJ;EACF;EACA,OAAON,MAAM;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js b/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js new file mode 100644 index 0000000..bb6e691 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _objectWithoutProperties; +var _objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose.js"); +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + var target = (0, _objectWithoutPropertiesLoose.default)(source, excluded); + var key, i; + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) !== -1) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + return target; +} + +//# sourceMappingURL=objectWithoutProperties.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js.map b/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js.map new file mode 100644 index 0000000..0e8dc84 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectWithoutProperties.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_objectWithoutPropertiesLoose","require","_objectWithoutProperties","source","excluded","target","objectWithoutPropertiesLoose","key","i","Object","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","prototype","propertyIsEnumerable","call"],"sources":["../../src/helpers/objectWithoutProperties.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.ts\";\n\nexport default function _objectWithoutProperties(\n source: null | undefined,\n excluded: PropertyKey[],\n): Record;\nexport default function _objectWithoutProperties<\n T extends object,\n K extends PropertyKey[],\n>(\n source: T | null | undefined,\n excluded: K,\n): Pick>;\nexport default function _objectWithoutProperties<\n T extends object,\n K extends PropertyKey[],\n>(\n source: T | null | undefined,\n excluded: K,\n): Pick> | Record {\n if (source == null) return {};\n\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i] as keyof typeof source & keyof typeof target;\n if (excluded.indexOf(key) !== -1) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,6BAAA,GAAAC,OAAA;AAae,SAASC,wBAAwBA,CAI9CC,MAA4B,EAC5BC,QAAW,EACmD;EAC9D,IAAID,MAAM,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;EAE7B,IAAIE,MAAM,GAAG,IAAAC,qCAA4B,EAACH,MAAM,EAAEC,QAAQ,CAAC;EAC3D,IAAIG,GAAG,EAAEC,CAAC;EAEV,IAAIC,MAAM,CAACC,qBAAqB,EAAE;IAChC,IAAIC,gBAAgB,GAAGF,MAAM,CAACC,qBAAqB,CAACP,MAAM,CAAC;IAC3D,KAAKK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGG,gBAAgB,CAACC,MAAM,EAAEJ,CAAC,EAAE,EAAE;MAC5CD,GAAG,GAAGI,gBAAgB,CAACH,CAAC,CAA8C;MACtE,IAAIJ,QAAQ,CAACS,OAAO,CAACN,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;MAClC,IAAI,CAACE,MAAM,CAACK,SAAS,CAACC,oBAAoB,CAACC,IAAI,CAACb,MAAM,EAAEI,GAAG,CAAC,EAAE;MAC9DF,MAAM,CAACE,GAAG,CAAC,GAAGJ,MAAM,CAACI,GAAG,CAAC;IAC3B;EACF;EAEA,OAAOF,MAAM;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js b/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js new file mode 100644 index 0000000..c611f6e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _objectWithoutPropertiesLoose; +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + if (excluded.indexOf(key) !== -1) continue; + target[key] = source[key]; + } + } + return target; +} + +//# sourceMappingURL=objectWithoutPropertiesLoose.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js.map b/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js.map new file mode 100644 index 0000000..424f455 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/objectWithoutPropertiesLoose.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_objectWithoutPropertiesLoose","source","excluded","target","key","Object","prototype","hasOwnProperty","call","indexOf"],"sources":["../../src/helpers/objectWithoutPropertiesLoose.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _objectWithoutPropertiesLoose<\n T extends object,\n K extends PropertyKey[],\n>(\n source: T | null | undefined,\n excluded: K,\n): Pick>;\nexport default function _objectWithoutPropertiesLoose<\n T extends object,\n K extends Array,\n>(source: T | null | undefined, excluded: K): Omit;\nexport default function _objectWithoutPropertiesLoose(\n source: T | null | undefined,\n excluded: PropertyKey[],\n): Partial {\n if (source == null) return {};\n\n var target: Partial = {};\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (excluded.indexOf(key) !== -1) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n"],"mappings":";;;;;;AAae,SAASA,6BAA6BA,CACnDC,MAA4B,EAC5BC,QAAuB,EACX;EACZ,IAAID,MAAM,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;EAE7B,IAAIE,MAAkB,GAAG,CAAC,CAAC;EAE3B,KAAK,IAAIC,GAAG,IAAIH,MAAM,EAAE;IACtB,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,MAAM,EAAEG,GAAG,CAAC,EAAE;MACrD,IAAIF,QAAQ,CAACO,OAAO,CAACL,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;MAClCD,MAAM,CAACC,GAAG,CAAC,GAAGH,MAAM,CAACG,GAAG,CAAC;IAC3B;EACF;EAEA,OAAOD,MAAM;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/possibleConstructorReturn.js b/node_modules/@babel/helpers/lib/helpers/possibleConstructorReturn.js new file mode 100644 index 0000000..6350d06 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/possibleConstructorReturn.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _possibleConstructorReturn; +var _assertThisInitialized = require("./assertThisInitialized.js"); +function _possibleConstructorReturn(self, value) { + if (value && (typeof value === "object" || typeof value === "function")) { + return value; + } else if (value !== void 0) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + return (0, _assertThisInitialized.default)(self); +} + +//# sourceMappingURL=possibleConstructorReturn.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/possibleConstructorReturn.js.map b/node_modules/@babel/helpers/lib/helpers/possibleConstructorReturn.js.map new file mode 100644 index 0000000..aca1bc9 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/possibleConstructorReturn.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_assertThisInitialized","require","_possibleConstructorReturn","self","value","TypeError","assertThisInitialized"],"sources":["../../src/helpers/possibleConstructorReturn.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport assertThisInitialized from \"./assertThisInitialized.ts\";\n\nexport default function _possibleConstructorReturn(\n self: object | undefined,\n value: unknown,\n) {\n if (value && (typeof value === \"object\" || typeof value === \"function\")) {\n return value;\n } else if (value !== void 0) {\n throw new TypeError(\n \"Derived constructors may only return object or undefined\",\n );\n }\n\n return assertThisInitialized(self);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,sBAAA,GAAAC,OAAA;AAEe,SAASC,0BAA0BA,CAChDC,IAAwB,EACxBC,KAAc,EACd;EACA,IAAIA,KAAK,KAAK,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,UAAU,CAAC,EAAE;IACvE,OAAOA,KAAK;EACd,CAAC,MAAM,IAAIA,KAAK,KAAK,KAAK,CAAC,EAAE;IAC3B,MAAM,IAAIC,SAAS,CACjB,0DACF,CAAC;EACH;EAEA,OAAO,IAAAC,8BAAqB,EAACH,IAAI,CAAC;AACpC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/readOnlyError.js b/node_modules/@babel/helpers/lib/helpers/readOnlyError.js new file mode 100644 index 0000000..e96906f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/readOnlyError.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _readOnlyError; +function _readOnlyError(name) { + throw new TypeError('"' + name + '" is read-only'); +} + +//# sourceMappingURL=readOnlyError.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/readOnlyError.js.map b/node_modules/@babel/helpers/lib/helpers/readOnlyError.js.map new file mode 100644 index 0000000..d96eb46 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/readOnlyError.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_readOnlyError","name","TypeError"],"sources":["../../src/helpers/readOnlyError.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _readOnlyError(name: string) {\n throw new TypeError('\"' + name + '\" is read-only');\n}\n"],"mappings":";;;;;;AAEe,SAASA,cAAcA,CAACC,IAAY,EAAE;EACnD,MAAM,IAAIC,SAAS,CAAC,GAAG,GAAGD,IAAI,GAAG,gBAAgB,CAAC;AACpD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regenerator.js b/node_modules/@babel/helpers/lib/helpers/regenerator.js new file mode 100644 index 0000000..f1cb61b --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regenerator.js @@ -0,0 +1,188 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _regenerator; +var _regeneratorDefine = require("./regeneratorDefine.js"); +function _regenerator() { + var undefined; + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + var _; + function wrap(innerFn, outerFn, self, tryLocsList) { + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + (0, _regeneratorDefine.default)(generator, "_invoke", makeInvokeMethod(innerFn, self, tryLocsList), true); + return generator; + } + var ContinueSentinel = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + _ = Object.getPrototypeOf; + var IteratorPrototype = [][iteratorSymbol] ? _(_([][iteratorSymbol]())) : ((0, _regeneratorDefine.default)(_ = {}, iteratorSymbol, function () { + return this; + }), _); + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = GeneratorFunctionPrototype; + (0, _regeneratorDefine.default)(Gp, "constructor", GeneratorFunctionPrototype); + (0, _regeneratorDefine.default)(GeneratorFunctionPrototype, "constructor", GeneratorFunction); + GeneratorFunction.displayName = "GeneratorFunction"; + (0, _regeneratorDefine.default)(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); + (0, _regeneratorDefine.default)(Gp); + (0, _regeneratorDefine.default)(Gp, toStringTagSymbol, "Generator"); + (0, _regeneratorDefine.default)(Gp, iteratorSymbol, function () { + return this; + }); + (0, _regeneratorDefine.default)(Gp, "toString", function () { + return "[object Generator]"; + }); + function mark(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + (0, _regeneratorDefine.default)(genFun, toStringTagSymbol, "GeneratorFunction"); + } + genFun.prototype = Object.create(Gp); + return genFun; + } + function makeInvokeMethod(innerFn, self, tryLocsList) { + var state = 0; + function invoke(_methodName, _method, _arg) { + if (state > 1) { + throw TypeError("Generator is already running"); + } else if (done) { + if (_method === 1) { + Context_dispatchExceptionOrFinishOrAbrupt(_method, _arg); + } + } + method = _method; + arg = _arg; + while ((_ = method < 2 ? undefined : arg) || !done) { + if (!delegateIterator) { + if (!method) { + ctx.v = arg; + } else if (method < 3) { + if (method > 1) ctx.n = -1; + Context_dispatchExceptionOrFinishOrAbrupt(method, arg); + } else { + ctx.n = arg; + } + } + try { + state = 2; + if (delegateIterator) { + if (!method) _methodName = "next"; + if (_ = delegateIterator[_methodName]) { + if (!(_ = _.call(delegateIterator, arg))) { + throw TypeError("iterator result is not an object"); + } + if (!_.done) { + return _; + } + arg = _.value; + if (method < 2) { + method = 0; + } + } else { + if (method === 1 && (_ = delegateIterator["return"])) { + _.call(delegateIterator); + } + if (method < 2) { + arg = TypeError("The iterator does not provide a '" + _methodName + "' method"); + method = 1; + } + } + delegateIterator = undefined; + } else { + if (done = ctx.n < 0) { + _ = arg; + } else { + _ = innerFn.call(self, ctx); + } + if (_ !== ContinueSentinel) { + break; + } + } + } catch (e) { + delegateIterator = undefined; + method = 1; + arg = e; + } finally { + state = 1; + } + } + return { + value: _, + done: done + }; + } + var tryEntries = tryLocsList || []; + var done = false; + var delegateIterator; + var method; + var arg; + var ctx = { + p: 0, + n: 0, + v: undefined, + a: Context_dispatchExceptionOrFinishOrAbrupt, + f: Context_dispatchExceptionOrFinishOrAbrupt.bind(undefined, 4), + d: function (iterable, nextLoc) { + delegateIterator = iterable; + method = 0; + arg = undefined; + ctx.n = nextLoc; + return ContinueSentinel; + } + }; + function Context_dispatchExceptionOrFinishOrAbrupt(_type, _arg) { + method = _type; + arg = _arg; + for (_ = 0; !done && state && !shouldReturn && _ < tryEntries.length; _++) { + var entry = tryEntries[_]; + var prev = ctx.p; + var finallyLoc = entry[2]; + var shouldReturn; + if (_type > 3) { + if (shouldReturn = finallyLoc === _arg) { + arg = entry[(method = entry[4]) ? 5 : (method = 3, 3)]; + entry[4] = entry[5] = undefined; + } + } else { + if (entry[0] <= prev) { + if (shouldReturn = _type < 2 && prev < entry[1]) { + method = 0; + ctx.v = _arg; + ctx.n = entry[1]; + } else if (prev < finallyLoc) { + if (shouldReturn = _type < 3 || entry[0] > _arg || _arg > finallyLoc) { + entry[4] = _type; + entry[5] = _arg; + ctx.n = finallyLoc; + method = 0; + } + } + } + } + } + if (shouldReturn || _type > 1) { + return ContinueSentinel; + } + done = true; + throw _arg; + } + return invoke; + } + return (exports.default = _regenerator = function () { + return { + w: wrap, + m: mark + }; + })(); +} + +//# sourceMappingURL=regenerator.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regenerator.js.map b/node_modules/@babel/helpers/lib/helpers/regenerator.js.map new file mode 100644 index 0000000..ef35e2d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regenerator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_regeneratorDefine","require","_regenerator","undefined","$Symbol","Symbol","iteratorSymbol","iterator","toStringTagSymbol","toStringTag","_","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","prototype","Generator","generator","Object","create","define","makeInvokeMethod","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","getPrototypeOf","IteratorPrototype","Gp","displayName","mark","genFun","setPrototypeOf","__proto__","state","invoke","_methodName","_method","_arg","TypeError","done","Context_dispatchExceptionOrFinishOrAbrupt","method","arg","delegateIterator","ctx","v","n","call","value","e","tryEntries","p","a","f","bind","d","iterable","nextLoc","_type","shouldReturn","length","entry","prev","finallyLoc","exports","default","w","m"],"sources":["../../src/helpers/regenerator.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n/* @mangleFns */\n\n/* eslint-disable @typescript-eslint/no-use-before-define */\n/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */\n\nimport define from \"./regeneratorDefine.ts\";\n\nconst enum GenState {\n SuspendedStart,\n SuspendedYieldOrCompleted,\n Executing,\n}\n\nconst enum OperatorType {\n Next,\n Throw,\n Return,\n Jump,\n Finish,\n}\n\nconst enum ContextNext {\n End = -1,\n}\n\ntype TryLocs = [\n tryLoc: number,\n catchLoc?: number,\n finallyLoc?: number,\n afterLoc?: number,\n];\n\ntype TryEntry = [\n ...TryLocs,\n recordType?: OperatorType.Throw | OperatorType.Jump | OperatorType.Return,\n recordArg?: any,\n];\n\ntype Context = {\n // prev\n p: number;\n // next\n n: number;\n // value\n v: any;\n\n // abrupt\n a(type: OperatorType, arg?: any): any;\n // finish\n f(finallyLoc: number): any;\n // delegateYield\n d(iterable: any, nextLoc: number): any;\n};\n\nexport default function /* @no-mangle */ _regenerator() {\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */\n\n var undefined: undefined; // More compressible than void 0.\n var $Symbol =\n typeof Symbol === \"function\" ? Symbol : ({} as SymbolConstructor);\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n var _: any;\n\n function wrap(\n innerFn: (this: unknown, context: Context) => unknown,\n outerFn: Function,\n self: unknown,\n tryLocsList: TryLocs[],\n ) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator =\n outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n define(\n generator,\n \"_invoke\",\n makeInvokeMethod(innerFn, self, tryLocsList),\n true,\n );\n\n return generator;\n }\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n /* @no-mangle */\n function Generator() {}\n /* @no-mangle */\n function GeneratorFunction() {}\n /* @no-mangle */\n function GeneratorFunctionPrototype() {}\n\n _ = Object.getPrototypeOf;\n var IteratorPrototype = [][iteratorSymbol as typeof Symbol.iterator]\n ? // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n _(_([][iteratorSymbol as typeof Symbol.iterator]()))\n : // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n (define((_ = {}), iteratorSymbol, function (this: unknown) {\n return this;\n }),\n _);\n\n var Gp =\n (GeneratorFunctionPrototype.prototype =\n Generator.prototype =\n Object.create(IteratorPrototype));\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = \"GeneratorFunction\";\n define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\");\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n define(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function (this: Generator) {\n return this;\n });\n\n define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n });\n\n function mark(genFun: Function) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n // @ts-expect-error assign to __proto__\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n }\n\n function makeInvokeMethod(\n innerFn: Function,\n self: unknown,\n tryLocsList: TryLocs[],\n ) {\n var state = GenState.SuspendedStart;\n\n function invoke(\n _methodName: \"next\" | \"throw\" | \"return\",\n _method: OperatorType.Next | OperatorType.Throw | OperatorType.Return,\n _arg: any,\n ) {\n if (state > 1 /* Executing */) {\n throw TypeError(\"Generator is already running\");\n } else if (done) {\n if (_method === OperatorType.Throw) {\n Context_dispatchExceptionOrFinishOrAbrupt(_method, _arg);\n }\n }\n\n method = _method;\n arg = _arg;\n\n while ((_ = method < 2 /* Next | Throw */ ? undefined : arg) || !done) {\n if (!delegateIterator) {\n if (!method /* Next */) {\n ctx.v = arg;\n } else if (method < 3 /* Throw | Return */) {\n if (method > 1 /* Return */) ctx.n = ContextNext.End;\n Context_dispatchExceptionOrFinishOrAbrupt(method, arg);\n } else {\n /* Jump */\n ctx.n = arg;\n }\n }\n try {\n state = GenState.Executing;\n if (delegateIterator) {\n // Call delegate.iterator[context.method](context.arg) and handle the result\n\n if (!method /* Next */) _methodName = \"next\";\n if ((_ = delegateIterator[_methodName])) {\n if (!(_ = _.call(delegateIterator, arg))) {\n throw TypeError(\"iterator result is not an object\");\n }\n if (!_.done) {\n // Re-yield the result returned by the delegate method.\n return _;\n }\n\n arg = _.value;\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n // method !== OperatorType.Return\n if (method < 2 /* Throw */) {\n method = OperatorType.Next;\n }\n } else {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (\n method === OperatorType.Throw &&\n (_ = delegateIterator[\"return\"])\n ) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n _.call(delegateIterator);\n }\n\n if (method < 2 /* Next | Throw */) {\n arg = TypeError(\n \"The iterator does not provide a '\" +\n _methodName +\n \"' method\",\n );\n method = OperatorType.Throw;\n }\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n // &\n // A .throw or .return when the delegate iterator has no .throw\n // method, or a missing .next method, always terminate the\n // yield* loop.\n delegateIterator = undefined;\n } else {\n if ((done = ctx.n < 0) /* End */) {\n _ = arg;\n } else {\n _ = innerFn.call(self, ctx);\n }\n\n if (_ !== ContinueSentinel) {\n break;\n }\n }\n } catch (e) {\n delegateIterator = undefined;\n method = OperatorType.Throw;\n arg = e;\n } finally {\n state = GenState.SuspendedYieldOrCompleted;\n }\n }\n // Be forgiving, per GeneratorResume behavior specified since ES2015:\n // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume\n // Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume\n return {\n value: _,\n done: done,\n };\n }\n\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n var tryEntries: TryEntry[] = tryLocsList || [];\n var done = false;\n var delegateIterator: Iterator | undefined;\n var method: OperatorType;\n var arg: any;\n\n var ctx: Context = {\n p: 0,\n n: 0,\n\n v: undefined,\n\n // abrupt\n a: Context_dispatchExceptionOrFinishOrAbrupt,\n // finish\n f: Context_dispatchExceptionOrFinishOrAbrupt.bind(\n undefined,\n OperatorType.Finish,\n ),\n // delegateYield\n d: function (iterable: any, nextLoc: number) {\n delegateIterator = iterable;\n\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n method = OperatorType.Next;\n arg = undefined;\n ctx.n = nextLoc;\n\n return ContinueSentinel;\n },\n };\n\n function Context_dispatchExceptionOrFinishOrAbrupt(\n _type: OperatorType,\n _arg: any,\n ) {\n method = _type;\n arg = _arg;\n for (\n _ = 0;\n !done &&\n state /* state !== SuspendedStart */ &&\n !shouldReturn &&\n _ < tryEntries.length;\n _++\n ) {\n var entry = tryEntries[_];\n var prev = ctx.p;\n var finallyLoc = entry[2]!;\n var shouldReturn;\n\n if (_type > 3 /* Finish */) {\n if ((shouldReturn = finallyLoc === _arg)) {\n // The following code logic is equivalent to the commented code.\n // if ((method = entry[4]!)) {\n // arg = entry[5];\n // } else {\n // method = OperatorType.Jump;\n // arg = entry[3];\n // }\n arg =\n entry[\n // eslint-disable-next-line no-cond-assign\n (method = entry[4]!) ? 5 : ((method = OperatorType.Jump), 3)\n ];\n entry[4] = entry[5] = undefined;\n }\n } else {\n if (entry[0] <= prev) {\n if ((shouldReturn = _type < 2 /* Throw */ && prev < entry[1]!)) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n method = OperatorType.Next;\n ctx.v = _arg;\n ctx.n = entry[1]!;\n } else if (prev < finallyLoc) {\n if (\n (shouldReturn =\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n _type < 3 /* Throw | Return */ ||\n entry[0] > _arg ||\n _arg > finallyLoc)\n ) {\n entry[4] = _type as\n | OperatorType.Return\n | OperatorType.Jump\n | OperatorType.Throw;\n entry[5] = _arg;\n ctx.n = finallyLoc;\n method = OperatorType.Next;\n }\n }\n }\n }\n }\n if (shouldReturn || _type > 1 /* _type !== Throw */) {\n return ContinueSentinel;\n }\n done = true;\n throw _arg;\n }\n\n return invoke;\n }\n\n // @ts-expect-error explicit function assignment\n return (_regenerator = function () {\n return { w: wrap, m: mark };\n })();\n}\n"],"mappings":";;;;;;AAMA,IAAAA,kBAAA,GAAAC,OAAA;AAiDe,SAA0BC,YAAYA,CAAA,EAAG;EAGtD,IAAIC,SAAoB;EACxB,IAAIC,OAAO,GACT,OAAOC,MAAM,KAAK,UAAU,GAAGA,MAAM,GAAI,CAAC,CAAuB;EACnE,IAAIC,cAAc,GAAGF,OAAO,CAACG,QAAQ,IAAI,YAAY;EACrD,IAAIC,iBAAiB,GAAGJ,OAAO,CAACK,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KAAK,GAAG,CAAC,EAAwB;QACnD,OAAOpC,gBAAgB;MACzB;MACAiB,IAAI,GAAG,IAAI;MACX,MAAMF,IAAI;IACZ;IAEA,OAAOH,MAAM;EACf;EAGA,OAAO,CAAA8B,OAAA,CAAAC,OAAA,GAACjE,YAAY,GAAG,SAAAA,CAAA,EAAY;IACjC,OAAO;MAAEkE,CAAC,EAAEzD,IAAI;MAAE0D,CAAC,EAAEtC;IAAK,CAAC;EAC7B,CAAC,EAAE,CAAC;AACN","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorAsync.js b/node_modules/@babel/helpers/lib/helpers/regeneratorAsync.js new file mode 100644 index 0000000..e0d6840 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorAsync.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _regeneratorAsync; +var _regeneratorAsyncGen = require("./regeneratorAsyncGen.js"); +function _regeneratorAsync(innerFn, outerFn, self, tryLocsList, PromiseImpl) { + var iter = (0, _regeneratorAsyncGen.default)(innerFn, outerFn, self, tryLocsList, PromiseImpl); + return iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); +} + +//# sourceMappingURL=regeneratorAsync.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorAsync.js.map b/node_modules/@babel/helpers/lib/helpers/regeneratorAsync.js.map new file mode 100644 index 0000000..98e7cab --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorAsync.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_regeneratorAsyncGen","require","_regeneratorAsync","innerFn","outerFn","self","tryLocsList","PromiseImpl","iter","asyncGen","next","then","result","done","value"],"sources":["../../src/helpers/regeneratorAsync.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n\nimport asyncGen from \"./regeneratorAsyncGen.ts\";\n\nexport default function _regeneratorAsync(\n innerFn: Function,\n outerFn: Function,\n self: any,\n tryLocsList: any[],\n PromiseImpl: PromiseConstructor | undefined,\n) {\n var iter = asyncGen(innerFn, outerFn, self, tryLocsList, PromiseImpl);\n return iter.next().then(function (result: IteratorResult) {\n return result.done ? result.value : iter.next();\n });\n}\n"],"mappings":";;;;;;AAEA,IAAAA,oBAAA,GAAAC,OAAA;AAEe,SAASC,iBAAiBA,CACvCC,OAAiB,EACjBC,OAAiB,EACjBC,IAAS,EACTC,WAAkB,EAClBC,WAA2C,EAC3C;EACA,IAAIC,IAAI,GAAG,IAAAC,4BAAQ,EAACN,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAEC,WAAW,EAAEC,WAAW,CAAC;EACrE,OAAOC,IAAI,CAACE,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,UAAUC,MAA2B,EAAE;IAC7D,OAAOA,MAAM,CAACC,IAAI,GAAGD,MAAM,CAACE,KAAK,GAAGN,IAAI,CAACE,IAAI,CAAC,CAAC;EACjD,CAAC,CAAC;AACJ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncGen.js b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncGen.js new file mode 100644 index 0000000..3192016 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncGen.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _regeneratorAsyncGen; +var _regenerator = require("./regenerator.js"); +var _regeneratorAsyncIterator = require("./regeneratorAsyncIterator.js"); +function _regeneratorAsyncGen(innerFn, outerFn, self, tryLocsList, PromiseImpl) { + return new _regeneratorAsyncIterator.default((0, _regenerator.default)().w(innerFn, outerFn, self, tryLocsList), PromiseImpl || Promise); +} + +//# sourceMappingURL=regeneratorAsyncGen.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncGen.js.map b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncGen.js.map new file mode 100644 index 0000000..9850e1e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncGen.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_regenerator","require","_regeneratorAsyncIterator","_regeneratorAsyncGen","innerFn","outerFn","self","tryLocsList","PromiseImpl","regeneratorAsyncIterator","regenerator","w","Promise"],"sources":["../../src/helpers/regeneratorAsyncGen.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n/* @mangleFns */\n\nimport regenerator from \"./regenerator.ts\";\nimport regeneratorAsyncIterator from \"./regeneratorAsyncIterator.ts\";\n\nexport default /* @no-mangle */ function _regeneratorAsyncGen(\n innerFn: Function,\n outerFn: Function,\n self: any,\n tryLocsList: any[],\n PromiseImpl: PromiseConstructor | undefined,\n) {\n return new (regeneratorAsyncIterator as any)(\n regenerator().w(innerFn as any, outerFn, self, tryLocsList),\n PromiseImpl || Promise,\n );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AAEgC,SAASE,oBAAoBA,CAC3DC,OAAiB,EACjBC,OAAiB,EACjBC,IAAS,EACTC,WAAkB,EAClBC,WAA2C,EAC3C;EACA,OAAO,IAAKC,iCAAwB,CAClC,IAAAC,oBAAW,EAAC,CAAC,CAACC,CAAC,CAACP,OAAO,EAASC,OAAO,EAAEC,IAAI,EAAEC,WAAW,CAAC,EAC3DC,WAAW,IAAII,OACjB,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncIterator.js b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncIterator.js new file mode 100644 index 0000000..6f44e0b --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncIterator.js @@ -0,0 +1,49 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = AsyncIterator; +var _OverloadYield = require("./OverloadYield.js"); +var _regeneratorDefine = require("./regeneratorDefine.js"); +function AsyncIterator(generator, PromiseImpl) { + if (!this.next) { + (0, _regeneratorDefine.default)(AsyncIterator.prototype); + (0, _regeneratorDefine.default)(AsyncIterator.prototype, typeof Symbol === "function" && Symbol.asyncIterator || "@asyncIterator", function () { + return this; + }); + } + function invoke(method, arg, resolve, reject) { + try { + var result = generator[method](arg); + var value = result.value; + if (value instanceof _OverloadYield.default) { + return PromiseImpl.resolve(value.v).then(function (value) { + invoke("next", value, resolve, reject); + }, function (err) { + invoke("throw", err, resolve, reject); + }); + } + return PromiseImpl.resolve(value).then(function (unwrapped) { + result.value = unwrapped; + resolve(result); + }, function (error) { + return invoke("throw", error, resolve, reject); + }); + } catch (error) { + reject(error); + } + } + var previousPromise; + function enqueue(method, i, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + (0, _regeneratorDefine.default)(this, "_invoke", enqueue, true); +} + +//# sourceMappingURL=regeneratorAsyncIterator.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncIterator.js.map b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncIterator.js.map new file mode 100644 index 0000000..4f1c09d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorAsyncIterator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_OverloadYield","require","_regeneratorDefine","AsyncIterator","generator","PromiseImpl","next","define","prototype","Symbol","asyncIterator","invoke","method","arg","resolve","reject","result","value","OverloadYield","v","then","err","unwrapped","error","previousPromise","enqueue","i","callInvokeWithMethodAndArg"],"sources":["../../src/helpers/regeneratorAsyncIterator.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n/* @mangleFns */\n/* @internal */\n\nimport OverloadYield from \"./OverloadYield.ts\";\nimport define from \"./regeneratorDefine.ts\";\n\nexport default /* @no-mangle */ function AsyncIterator(\n this: any,\n generator: Generator,\n PromiseImpl: PromiseConstructor,\n) {\n if (!this.next) {\n define(AsyncIterator.prototype);\n define(\n AsyncIterator.prototype,\n (typeof Symbol === \"function\" && Symbol.asyncIterator) ||\n \"@asyncIterator\",\n function (this: any) {\n return this;\n },\n );\n }\n\n function invoke(\n method: \"next\" | \"throw\" | \"return\",\n arg: any,\n resolve: (value: any) => void,\n reject: (error: any) => void,\n ): any {\n try {\n var result = generator[method](arg);\n var value = result.value;\n if (value instanceof OverloadYield) {\n return PromiseImpl.resolve(value.v).then(\n function (value) {\n invoke(\"next\", value, resolve, reject);\n },\n function (err) {\n invoke(\"throw\", err, resolve, reject);\n },\n );\n }\n\n return PromiseImpl.resolve(value).then(\n function (unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n },\n function (error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n },\n );\n } catch (error) {\n reject(error);\n }\n }\n\n var previousPromise: Promise;\n\n function enqueue(method: \"next\" | \"throw\" | \"return\", i: number, arg: any) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return (previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise\n ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg,\n )\n : callInvokeWithMethodAndArg());\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n define(this, \"_invoke\", enqueue, true);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEgC,SAASE,aAAaA,CAEpDC,SAAoB,EACpBC,WAA+B,EAC/B;EACA,IAAI,CAAC,IAAI,CAACC,IAAI,EAAE;IACd,IAAAC,0BAAM,EAACJ,aAAa,CAACK,SAAS,CAAC;IAC/B,IAAAD,0BAAM,EACJJ,aAAa,CAACK,SAAS,EACtB,OAAOC,MAAM,KAAK,UAAU,IAAIA,MAAM,CAACC,aAAa,IACnD,gBAAgB,EAClB,YAAqB;MACnB,OAAO,IAAI;IACb,CACF,CAAC;EACH;EAEA,SAASC,MAAMA,CACbC,MAAmC,EACnCC,GAAQ,EACRC,OAA6B,EAC7BC,MAA4B,EACvB;IACL,IAAI;MACF,IAAIC,MAAM,GAAGZ,SAAS,CAACQ,MAAM,CAAC,CAACC,GAAG,CAAC;MACnC,IAAII,KAAK,GAAGD,MAAM,CAACC,KAAK;MACxB,IAAIA,KAAK,YAAYC,sBAAa,EAAE;QAClC,OAAOb,WAAW,CAACS,OAAO,CAACG,KAAK,CAACE,CAAC,CAAC,CAACC,IAAI,CACtC,UAAUH,KAAK,EAAE;UACfN,MAAM,CAAC,MAAM,EAAEM,KAAK,EAAEH,OAAO,EAAEC,MAAM,CAAC;QACxC,CAAC,EACD,UAAUM,GAAG,EAAE;UACbV,MAAM,CAAC,OAAO,EAAEU,GAAG,EAAEP,OAAO,EAAEC,MAAM,CAAC;QACvC,CACF,CAAC;MACH;MAEA,OAAOV,WAAW,CAACS,OAAO,CAACG,KAAK,CAAC,CAACG,IAAI,CACpC,UAAUE,SAAS,EAAE;QAInBN,MAAM,CAACC,KAAK,GAAGK,SAAS;QACxBR,OAAO,CAACE,MAAM,CAAC;MACjB,CAAC,EACD,UAAUO,KAAK,EAAE;QAGf,OAAOZ,MAAM,CAAC,OAAO,EAAEY,KAAK,EAAET,OAAO,EAAEC,MAAM,CAAC;MAChD,CACF,CAAC;IACH,CAAC,CAAC,OAAOQ,KAAK,EAAE;MACdR,MAAM,CAACQ,KAAK,CAAC;IACf;EACF;EAEA,IAAIC,eAA6B;EAEjC,SAASC,OAAOA,CAACb,MAAmC,EAAEc,CAAS,EAAEb,GAAQ,EAAE;IACzE,SAASc,0BAA0BA,CAAA,EAAG;MACpC,OAAO,IAAItB,WAAW,CAAC,UAAUS,OAAO,EAAEC,MAAM,EAAE;QAChDJ,MAAM,CAACC,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,CAAC;MACtC,CAAC,CAAC;IACJ;IAEA,OAAQS,eAAe,GAarBA,eAAe,GACXA,eAAe,CAACJ,IAAI,CAClBO,0BAA0B,EAG1BA,0BACF,CAAC,GACDA,0BAA0B,CAAC,CAAC;EACpC;EAIA,IAAApB,0BAAM,EAAC,IAAI,EAAE,SAAS,EAAEkB,OAAO,EAAE,IAAI,CAAC;AACxC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorDefine.js b/node_modules/@babel/helpers/lib/helpers/regeneratorDefine.js new file mode 100644 index 0000000..c0b0a17 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorDefine.js @@ -0,0 +1,40 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = regeneratorDefine; +function regeneratorDefine(obj, key, value, noFlags) { + var define = Object.defineProperty; + try { + define({}, "", {}); + } catch (_) { + define = 0; + } + exports.default = regeneratorDefine = function (obj, key, value, noFlags) { + function defineIteratorMethod(method, i) { + regeneratorDefine(obj, method, function (arg) { + return this._invoke(method, i, arg); + }); + } + if (!key) { + defineIteratorMethod("next", 0); + defineIteratorMethod("throw", 1); + defineIteratorMethod("return", 2); + } else { + if (define) { + define(obj, key, { + value: value, + enumerable: !noFlags, + configurable: !noFlags, + writable: !noFlags + }); + } else { + obj[key] = value; + } + } + }; + regeneratorDefine(obj, key, value, noFlags); +} + +//# sourceMappingURL=regeneratorDefine.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorDefine.js.map b/node_modules/@babel/helpers/lib/helpers/regeneratorDefine.js.map new file mode 100644 index 0000000..a8af99e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorDefine.js.map @@ -0,0 +1 @@ +{"version":3,"names":["regeneratorDefine","obj","key","value","noFlags","define","Object","defineProperty","_","exports","default","defineIteratorMethod","method","i","arg","_invoke","enumerable","configurable","writable"],"sources":["../../src/helpers/regeneratorDefine.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n/* @mangleFns */\n/* @internal */\n\n// Also used to define Iterator Methods\n// Defining the .next, .throw, and .return methods of the Iterator interface in terms of a single ._invoke method.\nexport default function regeneratorDefine(\n obj: any,\n key?: PropertyKey,\n value?: unknown,\n noFlags?: true,\n) {\n var define: typeof Object.defineProperty | 0 = Object.defineProperty;\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\", {});\n } catch (_) {\n define = 0;\n }\n\n // @ts-expect-error explicit function reassign\n regeneratorDefine = function (\n obj: any,\n key?: PropertyKey,\n value?: unknown,\n noFlags?: true,\n ) {\n function defineIteratorMethod(method: string, i: number) {\n regeneratorDefine(obj, method, function (this: any, arg: any) {\n return this._invoke(method, i, arg);\n });\n }\n if (!key) {\n defineIteratorMethod(\"next\", 0);\n defineIteratorMethod(\"throw\", 1);\n defineIteratorMethod(\"return\", 2);\n } else {\n if (define) {\n define(obj, key, {\n value: value,\n enumerable: !noFlags,\n configurable: !noFlags,\n writable: !noFlags,\n });\n } else {\n obj[key] = value;\n }\n }\n };\n regeneratorDefine(obj, key, value, noFlags);\n}\n"],"mappings":";;;;;;AAMe,SAASA,iBAAiBA,CACvCC,GAAQ,EACRC,GAAiB,EACjBC,KAAe,EACfC,OAAc,EACd;EACA,IAAIC,MAAwC,GAAGC,MAAM,CAACC,cAAc;EACpE,IAAI;IAEFF,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;EACpB,CAAC,CAAC,OAAOG,CAAC,EAAE;IACVH,MAAM,GAAG,CAAC;EACZ;EAGAI,OAAA,CAAAC,OAAA,GAAAV,iBAAiB,GAAG,SAAAA,CAClBC,GAAQ,EACRC,GAAiB,EACjBC,KAAe,EACfC,OAAc,EACd;IACA,SAASO,oBAAoBA,CAACC,MAAc,EAAEC,CAAS,EAAE;MACvDb,iBAAiB,CAACC,GAAG,EAAEW,MAAM,EAAE,UAAqBE,GAAQ,EAAE;QAC5D,OAAO,IAAI,CAACC,OAAO,CAACH,MAAM,EAAEC,CAAC,EAAEC,GAAG,CAAC;MACrC,CAAC,CAAC;IACJ;IACA,IAAI,CAACZ,GAAG,EAAE;MACRS,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;MAC/BA,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC;MAChCA,oBAAoB,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnC,CAAC,MAAM;MACL,IAAIN,MAAM,EAAE;QACVA,MAAM,CAACJ,GAAG,EAAEC,GAAG,EAAE;UACfC,KAAK,EAAEA,KAAK;UACZa,UAAU,EAAE,CAACZ,OAAO;UACpBa,YAAY,EAAE,CAACb,OAAO;UACtBc,QAAQ,EAAE,CAACd;QACb,CAAC,CAAC;MACJ,CAAC,MAAM;QACLH,GAAG,CAACC,GAAG,CAAC,GAAGC,KAAK;MAClB;IACF;EACF,CAAC;EACDH,iBAAiB,CAACC,GAAG,EAAEC,GAAG,EAAEC,KAAK,EAAEC,OAAO,CAAC;AAC7C","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorKeys.js b/node_modules/@babel/helpers/lib/helpers/regeneratorKeys.js new file mode 100644 index 0000000..2b0d80e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorKeys.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _regeneratorKeys; +function _regeneratorKeys(val) { + var object = Object(val); + var keys = []; + var key; + for (var key in object) { + keys.unshift(key); + } + return function next() { + while (keys.length) { + key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + next.done = true; + return next; + }; +} + +//# sourceMappingURL=regeneratorKeys.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorKeys.js.map b/node_modules/@babel/helpers/lib/helpers/regeneratorKeys.js.map new file mode 100644 index 0000000..4f70dde --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorKeys.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_regeneratorKeys","val","object","Object","keys","key","unshift","next","length","pop","value","done"],"sources":["../../src/helpers/regeneratorKeys.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n/* @mangleFns */\n\nexport default function _regeneratorKeys(val: unknown) {\n var object = Object(val);\n var keys: string[] = [];\n var key: string;\n // eslint-disable-next-line guard-for-in\n for (var key in object) {\n keys.unshift(key);\n }\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n key = keys.pop()!;\n if (key in object) {\n // @ts-expect-error assign to () => ...\n next.value = key;\n // @ts-expect-error assign to () => ...\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n // @ts-expect-error assign to () => ...\n next.done = true;\n return next;\n };\n}\n"],"mappings":";;;;;;AAGe,SAASA,gBAAgBA,CAACC,GAAY,EAAE;EACrD,IAAIC,MAAM,GAAGC,MAAM,CAACF,GAAG,CAAC;EACxB,IAAIG,IAAc,GAAG,EAAE;EACvB,IAAIC,GAAW;EAEf,KAAK,IAAIA,GAAG,IAAIH,MAAM,EAAE;IACtBE,IAAI,CAACE,OAAO,CAACD,GAAG,CAAC;EACnB;EAIA,OAAO,SAASE,IAAIA,CAAA,EAAG;IACrB,OAAOH,IAAI,CAACI,MAAM,EAAE;MAClBH,GAAG,GAAGD,IAAI,CAACK,GAAG,CAAC,CAAE;MACjB,IAAIJ,GAAG,IAAIH,MAAM,EAAE;QAEjBK,IAAI,CAACG,KAAK,GAAGL,GAAG;QAEhBE,IAAI,CAACI,IAAI,GAAG,KAAK;QACjB,OAAOJ,IAAI;MACb;IACF;IAMAA,IAAI,CAACI,IAAI,GAAG,IAAI;IAChB,OAAOJ,IAAI;EACb,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js b/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js new file mode 100644 index 0000000..7b244a2 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js @@ -0,0 +1,98 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _regeneratorRuntime; +var _OverloadYield = require("./OverloadYield.js"); +var _regenerator = require("./regenerator.js"); +var _regeneratorAsync = require("./regeneratorAsync.js"); +var _regeneratorAsyncGen = require("./regeneratorAsyncGen.js"); +var _regeneratorAsyncIterator = require("./regeneratorAsyncIterator.js"); +var _regeneratorKeys = require("./regeneratorKeys.js"); +var _regeneratorValues = require("./regeneratorValues.js"); +function _regeneratorRuntime() { + "use strict"; + + var r = (0, _regenerator.default)(); + var gen = r.m(_regeneratorRuntime); + var GeneratorFunctionPrototype = Object.getPrototypeOf ? Object.getPrototypeOf(gen) : gen.__proto__; + var GeneratorFunction = GeneratorFunctionPrototype.constructor; + function isGeneratorFunction(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; + } + var abruptMap = { + throw: 1, + return: 2, + break: 3, + continue: 3 + }; + function wrapInnerFn(innerFn) { + var compatContext; + var callSyncState; + return function (context) { + if (!compatContext) { + compatContext = { + stop: function () { + return callSyncState(context.a, 2); + }, + catch: function () { + return context.v; + }, + abrupt: function (type, arg) { + return callSyncState(context.a, abruptMap[type], arg); + }, + delegateYield: function (iterable, resultName, nextLoc) { + compatContext.resultName = resultName; + return callSyncState(context.d, (0, _regeneratorValues.default)(iterable), nextLoc); + }, + finish: function (finallyLoc) { + return callSyncState(context.f, finallyLoc); + } + }; + callSyncState = function (fn, a1, a2) { + context.p = compatContext.prev; + context.n = compatContext.next; + try { + return fn(a1, a2); + } finally { + compatContext.next = context.n; + } + }; + } + if (compatContext.resultName) { + compatContext[compatContext.resultName] = context.v; + compatContext.resultName = undefined; + } + compatContext.sent = context.v; + compatContext.next = context.n; + try { + return innerFn.call(this, compatContext); + } finally { + context.p = compatContext.prev; + context.n = compatContext.next; + } + }; + } + return (exports.default = _regeneratorRuntime = function () { + return { + wrap: function (innerFn, outerFn, self, tryLocsList) { + return r.w(wrapInnerFn(innerFn), outerFn, self, tryLocsList && tryLocsList.reverse()); + }, + isGeneratorFunction: isGeneratorFunction, + mark: r.m, + awrap: function (value, kind) { + return new _OverloadYield.default(value, kind); + }, + AsyncIterator: _regeneratorAsyncIterator.default, + async: function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { + return (isGeneratorFunction(outerFn) ? _regeneratorAsyncGen.default : _regeneratorAsync.default)(wrapInnerFn(innerFn), outerFn, self, tryLocsList, PromiseImpl); + }, + keys: _regeneratorKeys.default, + values: _regeneratorValues.default + }; + })(); +} + +//# sourceMappingURL=regeneratorRuntime.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js.map b/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js.map new file mode 100644 index 0000000..8ed17c6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_OverloadYield","require","_regenerator","_regeneratorAsync","_regeneratorAsyncGen","_regeneratorAsyncIterator","_regeneratorKeys","_regeneratorValues","_regeneratorRuntime","r","regenerator","gen","m","GeneratorFunctionPrototype","Object","getPrototypeOf","__proto__","GeneratorFunction","constructor","isGeneratorFunction","genFun","ctor","displayName","name","abruptMap","throw","return","break","continue","wrapInnerFn","innerFn","compatContext","callSyncState","context","stop","a","catch","v","abrupt","type","arg","delegateYield","iterable","resultName","nextLoc","d","values","finish","finallyLoc","f","fn","a1","a2","p","prev","n","next","undefined","sent","call","exports","default","wrap","outerFn","self","tryLocsList","w","reverse","mark","awrap","value","kind","OverloadYield","AsyncIterator","async","PromiseImpl","asyncGen","keys"],"sources":["../../src/helpers/regeneratorRuntime.ts"],"sourcesContent":["/* @minVersion 7.18.0 */\n/* @mangleFns */\n/* @onlyBabel7 */\n\nimport OverloadYield from \"./OverloadYield.ts\";\nimport regenerator from \"./regenerator.ts\";\nimport async from \"./regeneratorAsync.ts\";\nimport asyncGen from \"./regeneratorAsyncGen.ts\";\nimport AsyncIterator from \"./regeneratorAsyncIterator.ts\";\nimport keys from \"./regeneratorKeys.ts\";\nimport values from \"./regeneratorValues.ts\";\n\ntype CompatContext = {\n prev?: number;\n next?: number;\n sent?: any;\n\n stop(): any;\n abrupt(type: \"throw\" | \"break\" | \"continue\" | \"return\", arg: any): any;\n finish(finallyLoc: number): any;\n catch(tryLoc: number): any;\n delegateYield(iterable: any, resultName: `t${number}`, nextLoc: number): any;\n\n resultName?: `t${number}` | undefined;\n\n [key: `t${number}`]: any;\n};\ntype CompatInnerFn = (this: unknown, context: CompatContext) => unknown;\n\nexport default function /* @no-mangle */ _regeneratorRuntime() {\n \"use strict\";\n\n var r = regenerator();\n\n type InnerFn = Parameters[0];\n type Context = Parameters[0];\n\n var gen = r.m(_regeneratorRuntime);\n var GeneratorFunctionPrototype = Object.getPrototypeOf\n ? Object.getPrototypeOf(gen)\n : (gen as any).__proto__;\n var GeneratorFunction = GeneratorFunctionPrototype.constructor;\n\n function isGeneratorFunction(genFun: any) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n }\n\n var abruptMap = {\n throw: 1,\n return: 2,\n break: 3,\n continue: 3,\n };\n\n function wrapInnerFn(innerFn: CompatInnerFn): InnerFn {\n var compatContext: CompatContext;\n var callSyncState: (\n fn: (a: A1, b: A2) => R,\n a1: A1,\n a2?: A2,\n ) => R;\n return function (context: Context) {\n if (!compatContext) {\n // Shim the old context shape on top of the new one.\n compatContext = {\n stop: function () {\n return callSyncState(context.a, 2);\n },\n catch: function () {\n return context.v;\n },\n abrupt: function (type, arg) {\n return callSyncState(context.a, abruptMap[type], arg);\n },\n delegateYield: function (iterable, resultName, nextLoc) {\n compatContext.resultName = resultName;\n return callSyncState(context.d, values(iterable), nextLoc);\n },\n finish: function (finallyLoc) {\n return callSyncState(context.f, finallyLoc);\n },\n };\n callSyncState = function (fn, a1, a2) {\n context.p = compatContext.prev!;\n context.n = compatContext.next!;\n try {\n return fn(a1, a2!);\n } finally {\n compatContext.next = context.n;\n }\n };\n }\n if (compatContext.resultName) {\n compatContext[compatContext.resultName] = context.v;\n compatContext.resultName = undefined;\n }\n compatContext.sent = context.v;\n compatContext.next = context.n;\n try {\n return innerFn.call(this, compatContext);\n } finally {\n context.p = compatContext.prev!;\n context.n = compatContext.next;\n }\n };\n }\n\n // @ts-expect-error explicit function assignment\n return (_regeneratorRuntime = function () {\n return {\n wrap: function (\n innerFn: CompatInnerFn,\n outerFn: Parameters[1],\n self: Parameters[2],\n tryLocsList: Parameters[3],\n ) {\n return r.w(\n wrapInnerFn(innerFn),\n outerFn,\n self,\n tryLocsList && tryLocsList.reverse(),\n );\n },\n isGeneratorFunction: isGeneratorFunction,\n mark: r.m,\n awrap: function (value: any, kind: any) {\n return new OverloadYield(value, kind);\n },\n AsyncIterator: AsyncIterator,\n async: function (\n innerFn: CompatInnerFn,\n outerFn: Function,\n self: any,\n tryLocsList: any[],\n PromiseImpl?: PromiseConstructor,\n ) {\n return (isGeneratorFunction(outerFn) ? asyncGen : async)(\n wrapInnerFn(innerFn),\n outerFn,\n self,\n tryLocsList,\n PromiseImpl,\n );\n },\n keys: keys,\n values: values,\n };\n })();\n}\n"],"mappings":";;;;;;AAIA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAmBe,SAA0BO,mBAAmBA,CAAA,EAAG;EAC7D,YAAY;;EAEZ,IAAIC,CAAC,GAAG,IAAAC,oBAAW,EAAC,CAAC;EAKrB,IAAIC,GAAG,GAAGF,CAAC,CAACG,CAAC,CAACJ,mBAAmB,CAAC;EAClC,IAAIK,0BAA0B,GAAGC,MAAM,CAACC,cAAc,GAClDD,MAAM,CAACC,cAAc,CAACJ,GAAG,CAAC,GACzBA,GAAG,CAASK,SAAS;EAC1B,IAAIC,iBAAiB,GAAGJ,0BAA0B,CAACK,WAAW;EAE9D,SAASC,mBAAmBA,CAACC,MAAW,EAAE;IACxC,IAAIC,IAAI,GAAG,OAAOD,MAAM,KAAK,UAAU,IAAIA,MAAM,CAACF,WAAW;IAC7D,OAAOG,IAAI,GACPA,IAAI,KAAKJ,iBAAiB,IAGxB,CAACI,IAAI,CAACC,WAAW,IAAID,IAAI,CAACE,IAAI,MAAM,mBAAmB,GACzD,KAAK;EACX;EAEA,IAAIC,SAAS,GAAG;IACdC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE,CAAC;IACRC,QAAQ,EAAE;EACZ,CAAC;EAED,SAASC,WAAWA,CAACC,OAAsB,EAAW;IACpD,IAAIC,aAA4B;IAChC,IAAIC,aAIE;IACN,OAAO,UAAUC,OAAgB,EAAE;MACjC,IAAI,CAACF,aAAa,EAAE;QAElBA,aAAa,GAAG;U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,CAAC;AACN","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorValues.js b/node_modules/@babel/helpers/lib/helpers/regeneratorValues.js new file mode 100644 index 0000000..f5efcd4 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorValues.js @@ -0,0 +1,32 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _regeneratorValues; +function _regeneratorValues(iterable) { + if (iterable != null) { + var iteratorMethod = iterable[typeof Symbol === "function" && Symbol.iterator || "@@iterator"], + i = 0; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + if (typeof iterable.next === "function") { + return iterable; + } + if (!isNaN(iterable.length)) { + return { + next: function () { + if (iterable && i >= iterable.length) iterable = undefined; + return { + value: iterable && iterable[i++], + done: !iterable + }; + } + }; + } + } + throw new TypeError(typeof iterable + " is not iterable"); +} + +//# sourceMappingURL=regeneratorValues.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/regeneratorValues.js.map b/node_modules/@babel/helpers/lib/helpers/regeneratorValues.js.map new file mode 100644 index 0000000..43a352c --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/regeneratorValues.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_regeneratorValues","iterable","iteratorMethod","Symbol","iterator","i","call","next","isNaN","length","undefined","value","done","TypeError"],"sources":["../../src/helpers/regeneratorValues.ts"],"sourcesContent":["/* @minVersion 7.18.0 */\n/* @mangleFns */\n\nexport default function _regeneratorValues(iterable: any) {\n if (iterable != null) {\n var iteratorMethod =\n iterable[\n (typeof Symbol === \"function\" && Symbol.iterator) || \"@@iterator\"\n ],\n i = 0;\n\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n return {\n next: function () {\n if (iterable && i >= iterable.length) iterable = undefined;\n return { value: iterable && iterable[i++], done: !iterable };\n },\n };\n }\n }\n\n throw new TypeError(typeof iterable + \" is not iterable\");\n}\n"],"mappings":";;;;;;AAGe,SAASA,kBAAkBA,CAACC,QAAa,EAAE;EACxD,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,IAAIC,cAAc,GACdD,QAAQ,CACL,OAAOE,MAAM,KAAK,UAAU,IAAIA,MAAM,CAACC,QAAQ,IAAK,YAAY,CAClE;MACHC,CAAC,GAAG,CAAC;IAEP,IAAIH,cAAc,EAAE;MAClB,OAAOA,cAAc,CAACI,IAAI,CAACL,QAAQ,CAAC;IACtC;IAEA,IAAI,OAAOA,QAAQ,CAACM,IAAI,KAAK,UAAU,EAAE;MACvC,OAAON,QAAQ;IACjB;IAEA,IAAI,CAACO,KAAK,CAACP,QAAQ,CAACQ,MAAM,CAAC,EAAE;MAC3B,OAAO;QACLF,IAAI,EAAE,SAAAA,CAAA,EAAY;UAChB,IAAIN,QAAQ,IAAII,CAAC,IAAIJ,QAAQ,CAACQ,MAAM,EAAER,QAAQ,GAAGS,SAAS;UAC1D,OAAO;YAAEC,KAAK,EAAEV,QAAQ,IAAIA,QAAQ,CAACI,CAAC,EAAE,CAAC;YAAEO,IAAI,EAAE,CAACX;UAAS,CAAC;QAC9D;MACF,CAAC;IACH;EACF;EAEA,MAAM,IAAIY,SAAS,CAAC,OAAOZ,QAAQ,GAAG,kBAAkB,CAAC;AAC3D","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/set.js b/node_modules/@babel/helpers/lib/helpers/set.js new file mode 100644 index 0000000..3cc8d6d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/set.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _set; +var _superPropBase = require("./superPropBase.js"); +var _defineProperty = require("./defineProperty.js"); +function set(target, property, value, receiver) { + if (typeof Reflect !== "undefined" && Reflect.set) { + set = Reflect.set; + } else { + set = function set(target, property, value, receiver) { + var base = (0, _superPropBase.default)(target, property); + var desc; + if (base) { + desc = Object.getOwnPropertyDescriptor(base, property); + if (desc.set) { + desc.set.call(receiver, value); + return true; + } else if (!desc.writable) { + return false; + } + } + desc = Object.getOwnPropertyDescriptor(receiver, property); + if (desc) { + if (!desc.writable) { + return false; + } + desc.value = value; + Object.defineProperty(receiver, property, desc); + } else { + (0, _defineProperty.default)(receiver, property, value); + } + return true; + }; + } + return set(target, property, value, receiver); +} +function _set(target, property, value, receiver, isStrict) { + var s = set(target, property, value, receiver || target); + if (!s && isStrict) { + throw new TypeError("failed to set property"); + } + return value; +} + +//# sourceMappingURL=set.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/set.js.map b/node_modules/@babel/helpers/lib/helpers/set.js.map new file mode 100644 index 0000000..4d7e530 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/set.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_superPropBase","require","_defineProperty","set","target","property","value","receiver","Reflect","base","superPropBase","desc","Object","getOwnPropertyDescriptor","call","writable","defineProperty","_set","isStrict","s","TypeError"],"sources":["../../src/helpers/set.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport superPropBase from \"./superPropBase.ts\";\nimport defineProperty from \"./defineProperty.ts\";\n\nfunction set(\n target: object,\n property: PropertyKey,\n value: any,\n receiver?: any,\n): boolean {\n if (typeof Reflect !== \"undefined\" && Reflect.set) {\n // @ts-expect-error explicit function reassign\n set = Reflect.set;\n } else {\n // @ts-expect-error explicit function reassign\n set = function set(target, property, value, receiver) {\n var base = superPropBase(target, property);\n var desc;\n\n if (base) {\n desc = Object.getOwnPropertyDescriptor(base, property)!;\n if (desc.set) {\n desc.set.call(receiver, value);\n return true;\n // so getOwnPropertyDescriptor should always be defined\n } else if (!desc.writable) {\n // Both getter and non-writable fall into this.\n return false;\n }\n }\n\n // Without a super that defines the property, spec boils down to\n // \"define on receiver\" for some reason.\n desc = Object.getOwnPropertyDescriptor(receiver, property);\n if (desc) {\n if (!desc.writable) {\n // Setter, getter, and non-writable fall into this.\n return false;\n }\n\n desc.value = value;\n Object.defineProperty(receiver, property, desc);\n } else {\n // Avoid setters that may be defined on Sub's prototype, but not on\n // the instance.\n defineProperty(receiver, property, value);\n }\n\n return true;\n };\n }\n\n return set(target, property, value, receiver);\n}\n\nexport default function _set(\n target: object,\n property: PropertyKey,\n value: any,\n receiver?: any,\n isStrict?: boolean,\n) {\n var s = set(target, property, value, receiver || target);\n if (!s && isStrict) {\n throw new TypeError(\"failed to set property\");\n }\n\n return value;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,SAASE,GAAGA,CACVC,MAAc,EACdC,QAAqB,EACrBC,KAAU,EACVC,QAAc,EACL;EACT,IAAI,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACL,GAAG,EAAE;IAEjDA,GAAG,GAAGK,OAAO,CAACL,GAAG;EACnB,CAAC,MAAM;IAELA,GAAG,GAAG,SAASA,GAAGA,CAACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,EAAE;MACpD,IAAIE,IAAI,GAAG,IAAAC,sBAAa,EAACN,MAAM,EAAEC,QAAQ,CAAC;MAC1C,IAAIM,IAAI;MAER,IAAIF,IAAI,EAAE;QACRE,IAAI,GAAGC,MAAM,CAACC,wBAAwB,CAACJ,IAAI,EAAEJ,QAAQ,CAAE;QACvD,IAAIM,IAAI,CAACR,GAAG,EAAE;UACZQ,IAAI,CAACR,GAAG,CAACW,IAAI,CAACP,QAAQ,EAAED,KAAK,CAAC;UAC9B,OAAO,IAAI;QAEb,CAAC,MAAM,IAAI,CAACK,IAAI,CAACI,QAAQ,EAAE;UAEzB,OAAO,KAAK;QACd;MACF;MAIAJ,IAAI,GAAGC,MAAM,CAACC,wBAAwB,CAACN,QAAQ,EAAEF,QAAQ,CAAC;MAC1D,IAAIM,IAAI,EAAE;QACR,IAAI,CAACA,IAAI,CAACI,QAAQ,EAAE;UAElB,OAAO,KAAK;QACd;QAEAJ,IAAI,CAACL,KAAK,GAAGA,KAAK;QAClBM,MAAM,CAACI,cAAc,CAACT,QAAQ,EAAEF,QAAQ,EAAEM,IAAI,CAAC;MACjD,CAAC,MAAM;QAGL,IAAAK,uBAAc,EAACT,QAAQ,EAAEF,QAAQ,EAAEC,KAAK,CAAC;MAC3C;MAEA,OAAO,IAAI;IACb,CAAC;EACH;EAEA,OAAOH,GAAG,CAACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,CAAC;AAC/C;AAEe,SAASU,IAAIA,CAC1Bb,MAAc,EACdC,QAAqB,EACrBC,KAAU,EACVC,QAAc,EACdW,QAAkB,EAClB;EACA,IAAIC,CAAC,GAAGhB,GAAG,CAACC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,QAAQ,IAAIH,MAAM,CAAC;EACxD,IAAI,CAACe,CAAC,IAAID,QAAQ,EAAE;IAClB,MAAM,IAAIE,SAAS,CAAC,wBAAwB,CAAC;EAC/C;EAEA,OAAOd,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/setFunctionName.js b/node_modules/@babel/helpers/lib/helpers/setFunctionName.js new file mode 100644 index 0000000..f711baf --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/setFunctionName.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = setFunctionName; +function setFunctionName(fn, name, prefix) { + if (typeof name === "symbol") { + name = name.description; + name = name ? "[" + name + "]" : ""; + } + try { + Object.defineProperty(fn, "name", { + configurable: true, + value: prefix ? prefix + " " + name : name + }); + } catch (_) {} + return fn; +} + +//# sourceMappingURL=setFunctionName.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/setFunctionName.js.map b/node_modules/@babel/helpers/lib/helpers/setFunctionName.js.map new file mode 100644 index 0000000..4875728 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/setFunctionName.js.map @@ -0,0 +1 @@ +{"version":3,"names":["setFunctionName","fn","name","prefix","description","Object","defineProperty","configurable","value","_"],"sources":["../../src/helpers/setFunctionName.ts"],"sourcesContent":["/* @minVersion 7.23.6 */\n\n// https://tc39.es/ecma262/#sec-setfunctionname\nexport default function setFunctionName(\n fn: T,\n name: symbol | string,\n prefix?: string,\n): T {\n if (typeof name === \"symbol\") {\n // Here `undefined` is possible, we check for it in the next line.\n name = name.description!;\n name = name ? \"[\" + name + \"]\" : \"\";\n }\n // In some older browsers .name was non-configurable, here we catch any\n // errors thrown by defineProperty.\n try {\n Object.defineProperty(fn, \"name\", {\n configurable: true,\n value: prefix ? prefix + \" \" + name : name,\n });\n } catch (_) {}\n return fn;\n}\n"],"mappings":";;;;;;AAGe,SAASA,eAAeA,CACrCC,EAAK,EACLC,IAAqB,EACrBC,MAAe,EACZ;EACH,IAAI,OAAOD,IAAI,KAAK,QAAQ,EAAE;IAE5BA,IAAI,GAAGA,IAAI,CAACE,WAAY;IACxBF,IAAI,GAAGA,IAAI,GAAG,GAAG,GAAGA,IAAI,GAAG,GAAG,GAAG,EAAE;EACrC;EAGA,IAAI;IACFG,MAAM,CAACC,cAAc,CAACL,EAAE,EAAE,MAAM,EAAE;MAChCM,YAAY,EAAE,IAAI;MAClBC,KAAK,EAAEL,MAAM,GAAGA,MAAM,GAAG,GAAG,GAAGD,IAAI,GAAGA;IACxC,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOO,CAAC,EAAE,CAAC;EACb,OAAOR,EAAE;AACX","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/setPrototypeOf.js b/node_modules/@babel/helpers/lib/helpers/setPrototypeOf.js new file mode 100644 index 0000000..359c5cc --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/setPrototypeOf.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _setPrototypeOf; +function _setPrototypeOf(o, p) { + exports.default = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); +} + +//# sourceMappingURL=setPrototypeOf.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/setPrototypeOf.js.map b/node_modules/@babel/helpers/lib/helpers/setPrototypeOf.js.map new file mode 100644 index 0000000..247e092 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/setPrototypeOf.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_setPrototypeOf","o","p","exports","default","Object","setPrototypeOf","bind","__proto__"],"sources":["../../src/helpers/setPrototypeOf.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _setPrototypeOf(o: object, p: object) {\n // @ts-expect-error - assigning to function\n _setPrototypeOf = Object.setPrototypeOf\n ? // @ts-expect-error - intentionally omitted argument\n Object.setPrototypeOf.bind(/* undefined */)\n : function _setPrototypeOf(o: object, p: object) {\n (o as any).__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CAACC,CAAS,EAAEC,CAAS,EAAE;EAE5DC,OAAA,CAAAC,OAAA,GAAAJ,eAAe,GAAGK,MAAM,CAACC,cAAc,GAEnCD,MAAM,CAACC,cAAc,CAACC,IAAI,CAAgB,CAAC,GAC3C,SAASP,eAAeA,CAACC,CAAS,EAAEC,CAAS,EAAE;IAC5CD,CAAC,CAASO,SAAS,GAAGN,CAAC;IACxB,OAAOD,CAAC;EACV,CAAC;EACL,OAAOD,eAAe,CAACC,CAAC,EAAEC,CAAC,CAAC;AAC9B","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/skipFirstGeneratorNext.js b/node_modules/@babel/helpers/lib/helpers/skipFirstGeneratorNext.js new file mode 100644 index 0000000..a72ba92 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/skipFirstGeneratorNext.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _skipFirstGeneratorNext; +function _skipFirstGeneratorNext(fn) { + return function () { + var it = fn.apply(this, arguments); + it.next(); + return it; + }; +} + +//# sourceMappingURL=skipFirstGeneratorNext.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/skipFirstGeneratorNext.js.map b/node_modules/@babel/helpers/lib/helpers/skipFirstGeneratorNext.js.map new file mode 100644 index 0000000..c2c43a5 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/skipFirstGeneratorNext.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_skipFirstGeneratorNext","fn","it","apply","arguments","next"],"sources":["../../src/helpers/skipFirstGeneratorNext.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _skipFirstGeneratorNext(fn) {\n return function () {\n var it = fn.apply(this, arguments);\n it.next();\n return it;\n };\n}\n"],"mappings":";;;;;;AAEe,SAASA,uBAAuBA,CAACC,EAAE,EAAE;EAClD,OAAO,YAAY;IACjB,IAAIC,EAAE,GAAGD,EAAE,CAACE,KAAK,CAAC,IAAI,EAAEC,SAAS,CAAC;IAClCF,EAAE,CAACG,IAAI,CAAC,CAAC;IACT,OAAOH,EAAE;EACX,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/slicedToArray.js b/node_modules/@babel/helpers/lib/helpers/slicedToArray.js new file mode 100644 index 0000000..a56f68d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/slicedToArray.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _slicedToArray; +var _arrayWithHoles = require("./arrayWithHoles.js"); +var _iterableToArrayLimit = require("./iterableToArrayLimit.js"); +var _unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var _nonIterableRest = require("./nonIterableRest.js"); +function _slicedToArray(arr, i) { + return (0, _arrayWithHoles.default)(arr) || (0, _iterableToArrayLimit.default)(arr, i) || (0, _unsupportedIterableToArray.default)(arr, i) || (0, _nonIterableRest.default)(); +} + +//# sourceMappingURL=slicedToArray.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/slicedToArray.js.map b/node_modules/@babel/helpers/lib/helpers/slicedToArray.js.map new file mode 100644 index 0000000..fe33ffb --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/slicedToArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayWithHoles","require","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_slicedToArray","arr","i","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest"],"sources":["../../src/helpers/slicedToArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithHoles from \"./arrayWithHoles.ts\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableRest is still being converted to TS.\nimport nonIterableRest from \"./nonIterableRest.ts\";\n\nexport default function _slicedToArray(arr: any, i: number): T[] {\n return (\n arrayWithHoles(arr) ||\n iterableToArrayLimit(arr, i) ||\n unsupportedIterableToArray(arr, i) ||\n nonIterableRest()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEe,SAASI,cAAcA,CAAIC,GAAQ,EAAEC,CAAS,EAAO;EAClE,OACE,IAAAC,uBAAc,EAAIF,GAAG,CAAC,IACtB,IAAAG,6BAAoB,EAAIH,GAAG,EAAEC,CAAC,CAAC,IAC/B,IAAAG,mCAA0B,EAAIJ,GAAG,EAAEC,CAAC,CAAC,IACrC,IAAAI,wBAAe,EAAC,CAAC;AAErB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/superPropBase.js b/node_modules/@babel/helpers/lib/helpers/superPropBase.js new file mode 100644 index 0000000..0763ce1 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/superPropBase.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _superPropBase; +var _getPrototypeOf = require("./getPrototypeOf.js"); +function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = (0, _getPrototypeOf.default)(object); + if (object === null) break; + } + return object; +} + +//# sourceMappingURL=superPropBase.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/superPropBase.js.map b/node_modules/@babel/helpers/lib/helpers/superPropBase.js.map new file mode 100644 index 0000000..0892acb --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/superPropBase.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_getPrototypeOf","require","_superPropBase","object","property","Object","prototype","hasOwnProperty","call","getPrototypeOf"],"sources":["../../src/helpers/superPropBase.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport getPrototypeOf from \"./getPrototypeOf.ts\";\n\nexport default function _superPropBase(object: object, property: PropertyKey) {\n // Yes, this throws if object is null to being with, that's on purpose.\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n return object;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAEe,SAASC,cAAcA,CAACC,MAAc,EAAEC,QAAqB,EAAE;EAE5E,OAAO,CAACC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACL,MAAM,EAAEC,QAAQ,CAAC,EAAE;IAC9DD,MAAM,GAAG,IAAAM,uBAAc,EAACN,MAAM,CAAC;IAC/B,IAAIA,MAAM,KAAK,IAAI,EAAE;EACvB;EACA,OAAOA,MAAM;AACf","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/superPropGet.js b/node_modules/@babel/helpers/lib/helpers/superPropGet.js new file mode 100644 index 0000000..ad4630f --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/superPropGet.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _superPropGet; +var _get = require("./get.js"); +var _getPrototypeOf = require("./getPrototypeOf.js"); +function _superPropGet(classArg, property, receiver, flags) { + var result = (0, _get.default)((0, _getPrototypeOf.default)(flags & 1 ? classArg.prototype : classArg), property, receiver); + return flags & 2 && typeof result === "function" ? function (args) { + return result.apply(receiver, args); + } : result; +} + +//# sourceMappingURL=superPropGet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/superPropGet.js.map b/node_modules/@babel/helpers/lib/helpers/superPropGet.js.map new file mode 100644 index 0000000..c3e1f3e --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/superPropGet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_get","require","_getPrototypeOf","_superPropGet","classArg","property","receiver","flags","result","get","getPrototypeOf","prototype","args","apply"],"sources":["../../src/helpers/superPropGet.ts"],"sourcesContent":["/* @minVersion 7.25.0 */\n\nimport get from \"./get.ts\";\nimport getPrototypeOf from \"./getPrototypeOf.ts\";\n\nconst enum Flags {\n Prototype = 0b1,\n Call = 0b10,\n}\n\nexport default function _superPropGet(\n classArg: any,\n property: string,\n receiver: any,\n flags?: number,\n) {\n var result = get(\n getPrototypeOf(\n // @ts-expect-error flags may be undefined\n flags & Flags.Prototype ? classArg.prototype : classArg,\n ),\n property,\n receiver,\n );\n // @ts-expect-error flags may be undefined\n return flags & Flags.Call && typeof result === \"function\"\n ? function (args: any[]) {\n return result.apply(receiver, args);\n }\n : result;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAOe,SAASE,aAAaA,CACnCC,QAAa,EACbC,QAAgB,EAChBC,QAAa,EACbC,KAAc,EACd;EACA,IAAIC,MAAM,GAAG,IAAAC,YAAG,EACd,IAAAC,uBAAc,EAEZH,KAAK,IAAkB,GAAGH,QAAQ,CAACO,SAAS,GAAGP,QACjD,CAAC,EACDC,QAAQ,EACRC,QACF,CAAC;EAED,OAAOC,KAAK,IAAa,IAAI,OAAOC,MAAM,KAAK,UAAU,GACrD,UAAUI,IAAW,EAAE;IACrB,OAAOJ,MAAM,CAACK,KAAK,CAACP,QAAQ,EAAEM,IAAI,CAAC;EACrC,CAAC,GACDJ,MAAM;AACZ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/superPropSet.js b/node_modules/@babel/helpers/lib/helpers/superPropSet.js new file mode 100644 index 0000000..ba0ace3 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/superPropSet.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _superPropSet; +var _set = require("./set.js"); +var _getPrototypeOf = require("./getPrototypeOf.js"); +function _superPropSet(classArg, property, value, receiver, isStrict, prototype) { + return (0, _set.default)((0, _getPrototypeOf.default)(prototype ? classArg.prototype : classArg), property, value, receiver, isStrict); +} + +//# sourceMappingURL=superPropSet.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/superPropSet.js.map b/node_modules/@babel/helpers/lib/helpers/superPropSet.js.map new file mode 100644 index 0000000..bbe7cbf --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/superPropSet.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_set","require","_getPrototypeOf","_superPropSet","classArg","property","value","receiver","isStrict","prototype","set","getPrototypeOf"],"sources":["../../src/helpers/superPropSet.ts"],"sourcesContent":["/* @minVersion 7.25.0 */\n\nimport set from \"./set.ts\";\nimport getPrototypeOf from \"./getPrototypeOf.ts\";\n\nexport default function _superPropSet(\n classArg: any,\n property: string,\n value: any,\n receiver: any,\n isStrict: boolean,\n prototype?: 1,\n) {\n return set(\n getPrototypeOf(prototype ? classArg.prototype : classArg),\n property,\n value,\n receiver,\n isStrict,\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEe,SAASE,aAAaA,CACnCC,QAAa,EACbC,QAAgB,EAChBC,KAAU,EACVC,QAAa,EACbC,QAAiB,EACjBC,SAAa,EACb;EACA,OAAO,IAAAC,YAAG,EACR,IAAAC,uBAAc,EAACF,SAAS,GAAGL,QAAQ,CAACK,SAAS,GAAGL,QAAQ,CAAC,EACzDC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,QACF,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteral.js b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteral.js new file mode 100644 index 0000000..c68ece6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteral.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _taggedTemplateLiteral; +function _taggedTemplateLiteral(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + return Object.freeze(Object.defineProperties(strings, { + raw: { + value: Object.freeze(raw) + } + })); +} + +//# sourceMappingURL=taggedTemplateLiteral.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteral.js.map b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteral.js.map new file mode 100644 index 0000000..944b495 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteral.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_taggedTemplateLiteral","strings","raw","slice","Object","freeze","defineProperties","value"],"sources":["../../src/helpers/taggedTemplateLiteral.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _taggedTemplateLiteral(\n strings: readonly string[],\n raw?: readonly string[],\n): TemplateStringsArray {\n if (!raw) {\n raw = strings.slice(0);\n }\n return Object.freeze(\n Object.defineProperties(strings as any, {\n raw: { value: Object.freeze(raw) },\n }),\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,sBAAsBA,CAC5CC,OAA0B,EAC1BC,GAAuB,EACD;EACtB,IAAI,CAACA,GAAG,EAAE;IACRA,GAAG,GAAGD,OAAO,CAACE,KAAK,CAAC,CAAC,CAAC;EACxB;EACA,OAAOC,MAAM,CAACC,MAAM,CAClBD,MAAM,CAACE,gBAAgB,CAAuBL,OAAO,EAAS;IAC5DC,GAAG,EAAE;MAAEK,KAAK,EAAEH,MAAM,CAACC,MAAM,CAACH,GAAG;IAAE;EACnC,CAAC,CACH,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteralLoose.js b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteralLoose.js new file mode 100644 index 0000000..42416c6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteralLoose.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _taggedTemplateLiteralLoose; +function _taggedTemplateLiteralLoose(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + strings.raw = raw; + return strings; +} + +//# sourceMappingURL=taggedTemplateLiteralLoose.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteralLoose.js.map b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteralLoose.js.map new file mode 100644 index 0000000..f934494 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/taggedTemplateLiteralLoose.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_taggedTemplateLiteralLoose","strings","raw","slice"],"sources":["../../src/helpers/taggedTemplateLiteralLoose.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _taggedTemplateLiteralLoose(\n strings: readonly string[],\n raw?: readonly string[],\n): TemplateStringsArray {\n if (!raw) {\n raw = strings.slice(0);\n }\n // Loose: TemplateStringsArray['raw'] is readonly, so we have to cast it to any before assigning\n (strings as any).raw = raw;\n return strings as TemplateStringsArray;\n}\n"],"mappings":";;;;;;AAEe,SAASA,2BAA2BA,CACjDC,OAA0B,EAC1BC,GAAuB,EACD;EACtB,IAAI,CAACA,GAAG,EAAE;IACRA,GAAG,GAAGD,OAAO,CAACE,KAAK,CAAC,CAAC,CAAC;EACxB;EAECF,OAAO,CAASC,GAAG,GAAGA,GAAG;EAC1B,OAAOD,OAAO;AAChB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/tdz.js b/node_modules/@babel/helpers/lib/helpers/tdz.js new file mode 100644 index 0000000..1d371b1 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/tdz.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _tdzError; +function _tdzError(name) { + throw new ReferenceError(name + " is not defined - temporal dead zone"); +} + +//# sourceMappingURL=tdz.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/tdz.js.map b/node_modules/@babel/helpers/lib/helpers/tdz.js.map new file mode 100644 index 0000000..5c92cbe --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/tdz.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_tdzError","name","ReferenceError"],"sources":["../../src/helpers/tdz.ts"],"sourcesContent":["/* @minVersion 7.5.5 */\n\nexport default function _tdzError(name: string): never {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n}\n"],"mappings":";;;;;;AAEe,SAASA,SAASA,CAACC,IAAY,EAAS;EACrD,MAAM,IAAIC,cAAc,CAACD,IAAI,GAAG,sCAAsC,CAAC;AACzE","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/temporalRef.js b/node_modules/@babel/helpers/lib/helpers/temporalRef.js new file mode 100644 index 0000000..431b9af --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/temporalRef.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _temporalRef; +var _temporalUndefined = require("./temporalUndefined.js"); +var _tdz = require("./tdz.js"); +function _temporalRef(val, name) { + return val === _temporalUndefined.default ? (0, _tdz.default)(name) : val; +} + +//# sourceMappingURL=temporalRef.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/temporalRef.js.map b/node_modules/@babel/helpers/lib/helpers/temporalRef.js.map new file mode 100644 index 0000000..35d88a9 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/temporalRef.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_temporalUndefined","require","_tdz","_temporalRef","val","name","undef","err"],"sources":["../../src/helpers/temporalRef.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport undef from \"./temporalUndefined.ts\";\nimport err from \"./tdz.ts\";\n\nexport default function _temporalRef(val: T, name: string) {\n return val === undef ? err(name) : val;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAEe,SAASE,YAAYA,CAAIC,GAAM,EAAEC,IAAY,EAAE;EAC5D,OAAOD,GAAG,KAAKE,0BAAK,GAAG,IAAAC,YAAG,EAACF,IAAI,CAAC,GAAGD,GAAG;AACxC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/temporalUndefined.js b/node_modules/@babel/helpers/lib/helpers/temporalUndefined.js new file mode 100644 index 0000000..e826773 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/temporalUndefined.js @@ -0,0 +1,9 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _temporalUndefined; +function _temporalUndefined() {} + +//# sourceMappingURL=temporalUndefined.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/temporalUndefined.js.map b/node_modules/@babel/helpers/lib/helpers/temporalUndefined.js.map new file mode 100644 index 0000000..784feed --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/temporalUndefined.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_temporalUndefined"],"sources":["../../src/helpers/temporalUndefined.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\n// This function isn't mean to be called, but to be used as a reference.\n// We can't use a normal object because it isn't hoisted.\nexport default function _temporalUndefined(this: never): void {}\n"],"mappings":";;;;;;AAIe,SAASA,kBAAkBA,CAAA,EAAoB,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/toArray.js b/node_modules/@babel/helpers/lib/helpers/toArray.js new file mode 100644 index 0000000..d6ffd85 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toArray.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _toArray; +var _arrayWithHoles = require("./arrayWithHoles.js"); +var _iterableToArray = require("./iterableToArray.js"); +var _unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var _nonIterableRest = require("./nonIterableRest.js"); +function _toArray(arr) { + return (0, _arrayWithHoles.default)(arr) || (0, _iterableToArray.default)(arr) || (0, _unsupportedIterableToArray.default)(arr) || (0, _nonIterableRest.default)(); +} + +//# sourceMappingURL=toArray.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/toArray.js.map b/node_modules/@babel/helpers/lib/helpers/toArray.js.map new file mode 100644 index 0000000..5b04603 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayWithHoles","require","_iterableToArray","_unsupportedIterableToArray","_nonIterableRest","_toArray","arr","arrayWithHoles","iterableToArray","unsupportedIterableToArray","nonIterableRest"],"sources":["../../src/helpers/toArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithHoles from \"./arrayWithHoles.ts\";\nimport iterableToArray from \"./iterableToArray.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableRest is still being converted to TS.\nimport nonIterableRest from \"./nonIterableRest.ts\";\n\nexport default function _toArray(arr: any): T[] {\n return (\n arrayWithHoles(arr) ||\n iterableToArray(arr) ||\n unsupportedIterableToArray(arr) ||\n nonIterableRest()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAEe,SAASI,QAAQA,CAAIC,GAAQ,EAAO;EACjD,OACE,IAAAC,uBAAc,EAAID,GAAG,CAAC,IACtB,IAAAE,wBAAe,EAAIF,GAAG,CAAC,IACvB,IAAAG,mCAA0B,EAAIH,GAAG,CAAC,IAClC,IAAAI,wBAAe,EAAC,CAAC;AAErB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/toConsumableArray.js b/node_modules/@babel/helpers/lib/helpers/toConsumableArray.js new file mode 100644 index 0000000..97734be --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toConsumableArray.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _toConsumableArray; +var _arrayWithoutHoles = require("./arrayWithoutHoles.js"); +var _iterableToArray = require("./iterableToArray.js"); +var _unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var _nonIterableSpread = require("./nonIterableSpread.js"); +function _toConsumableArray(arr) { + return (0, _arrayWithoutHoles.default)(arr) || (0, _iterableToArray.default)(arr) || (0, _unsupportedIterableToArray.default)(arr) || (0, _nonIterableSpread.default)(); +} + +//# sourceMappingURL=toConsumableArray.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/toConsumableArray.js.map b/node_modules/@babel/helpers/lib/helpers/toConsumableArray.js.map new file mode 100644 index 0000000..d8af985 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toConsumableArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayWithoutHoles","require","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","_toConsumableArray","arr","arrayWithoutHoles","iterableToArray","unsupportedIterableToArray","nonIterableSpread"],"sources":["../../src/helpers/toConsumableArray.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport arrayWithoutHoles from \"./arrayWithoutHoles.ts\";\nimport iterableToArray from \"./iterableToArray.ts\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n// @ts-expect-error nonIterableSpread is still being converted to TS.\nimport nonIterableSpread from \"./nonIterableSpread.ts\";\n\nexport default function _toConsumableArray(arr: any): T[] {\n return (\n arrayWithoutHoles(arr) ||\n iterableToArray(arr) ||\n unsupportedIterableToArray(arr) ||\n nonIterableSpread()\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,kBAAA,GAAAH,OAAA;AAEe,SAASI,kBAAkBA,CAAIC,GAAQ,EAAO;EAC3D,OACE,IAAAC,0BAAiB,EAAID,GAAG,CAAC,IACzB,IAAAE,wBAAe,EAAIF,GAAG,CAAC,IACvB,IAAAG,mCAA0B,EAAIH,GAAG,CAAC,IAClC,IAAAI,0BAAiB,EAAC,CAAC;AAEvB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/toPrimitive.js b/node_modules/@babel/helpers/lib/helpers/toPrimitive.js new file mode 100644 index 0000000..f56a3ab --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toPrimitive.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = toPrimitive; +function toPrimitive(input, hint) { + if (typeof input !== "object" || !input) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); +} + +//# sourceMappingURL=toPrimitive.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/toPrimitive.js.map b/node_modules/@babel/helpers/lib/helpers/toPrimitive.js.map new file mode 100644 index 0000000..7f54858 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toPrimitive.js.map @@ -0,0 +1 @@ +{"version":3,"names":["toPrimitive","input","hint","prim","Symbol","undefined","res","call","TypeError","String","Number"],"sources":["../../src/helpers/toPrimitive.ts"],"sourcesContent":["/* @minVersion 7.1.5 */\n\n// https://tc39.es/ecma262/#sec-toprimitive\nexport default function toPrimitive(\n input: unknown,\n hint?: \"default\" | \"string\" | \"number\",\n) {\n if (typeof input !== \"object\" || !input) return input;\n // @ts-expect-error Symbol.toPrimitive might not index {}\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\n"],"mappings":";;;;;;AAGe,SAASA,WAAWA,CACjCC,KAAc,EACdC,IAAsC,EACtC;EACA,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,CAACA,KAAK,EAAE,OAAOA,KAAK;EAErD,IAAIE,IAAI,GAAGF,KAAK,CAACG,MAAM,CAACJ,WAAW,CAAC;EACpC,IAAIG,IAAI,KAAKE,SAAS,EAAE;IACtB,IAAIC,GAAG,GAAGH,IAAI,CAACI,IAAI,CAACN,KAAK,EAAEC,IAAI,IAAI,SAAS,CAAC;IAC7C,IAAI,OAAOI,GAAG,KAAK,QAAQ,EAAE,OAAOA,GAAG;IACvC,MAAM,IAAIE,SAAS,CAAC,8CAA8C,CAAC;EACrE;EACA,OAAO,CAACN,IAAI,KAAK,QAAQ,GAAGO,MAAM,GAAGC,MAAM,EAAET,KAAK,CAAC;AACrD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/toPropertyKey.js b/node_modules/@babel/helpers/lib/helpers/toPropertyKey.js new file mode 100644 index 0000000..92493ff --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toPropertyKey.js @@ -0,0 +1,13 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = toPropertyKey; +var _toPrimitive = require("./toPrimitive.js"); +function toPropertyKey(arg) { + var key = (0, _toPrimitive.default)(arg, "string"); + return typeof key === "symbol" ? key : String(key); +} + +//# sourceMappingURL=toPropertyKey.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/toPropertyKey.js.map b/node_modules/@babel/helpers/lib/helpers/toPropertyKey.js.map new file mode 100644 index 0000000..ce72780 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toPropertyKey.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_toPrimitive","require","toPropertyKey","arg","key","toPrimitive","String"],"sources":["../../src/helpers/toPropertyKey.ts"],"sourcesContent":["/* @minVersion 7.1.5 */\n\n// https://tc39.es/ecma262/#sec-topropertykey\n\nimport toPrimitive from \"./toPrimitive.ts\";\n\nexport default function toPropertyKey(arg: unknown) {\n var key = toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AAEe,SAASC,aAAaA,CAACC,GAAY,EAAE;EAClD,IAAIC,GAAG,GAAG,IAAAC,oBAAW,EAACF,GAAG,EAAE,QAAQ,CAAC;EACpC,OAAO,OAAOC,GAAG,KAAK,QAAQ,GAAGA,GAAG,GAAGE,MAAM,CAACF,GAAG,CAAC;AACpD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/toSetter.js b/node_modules/@babel/helpers/lib/helpers/toSetter.js new file mode 100644 index 0000000..e18e7cd --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toSetter.js @@ -0,0 +1,18 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _toSetter; +function _toSetter(fn, args, thisArg) { + if (!args) args = []; + var l = args.length++; + return Object.defineProperty({}, "_", { + set: function (v) { + args[l] = v; + fn.apply(thisArg, args); + } + }); +} + +//# sourceMappingURL=toSetter.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/toSetter.js.map b/node_modules/@babel/helpers/lib/helpers/toSetter.js.map new file mode 100644 index 0000000..38fe33c --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/toSetter.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_toSetter","fn","args","thisArg","l","length","Object","defineProperty","set","v","apply"],"sources":["../../src/helpers/toSetter.ts"],"sourcesContent":["/* @minVersion 7.24.0 */\n\nexport default function _toSetter(fn: Function, args: any[], thisArg: any) {\n if (!args) args = [];\n var l = args.length++;\n return Object.defineProperty({}, \"_\", {\n set: function (v) {\n args[l] = v;\n fn.apply(thisArg, args);\n },\n });\n}\n"],"mappings":";;;;;;AAEe,SAASA,SAASA,CAACC,EAAY,EAAEC,IAAW,EAAEC,OAAY,EAAE;EACzE,IAAI,CAACD,IAAI,EAAEA,IAAI,GAAG,EAAE;EACpB,IAAIE,CAAC,GAAGF,IAAI,CAACG,MAAM,EAAE;EACrB,OAAOC,MAAM,CAACC,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE;IACpCC,GAAG,EAAE,SAAAA,CAAUC,CAAC,EAAE;MAChBP,IAAI,CAACE,CAAC,CAAC,GAAGK,CAAC;MACXR,EAAE,CAACS,KAAK,CAACP,OAAO,EAAED,IAAI,CAAC;IACzB;EACF,CAAC,CAAC;AACJ","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/tsRewriteRelativeImportExtensions.js b/node_modules/@babel/helpers/lib/helpers/tsRewriteRelativeImportExtensions.js new file mode 100644 index 0000000..25618aa --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/tsRewriteRelativeImportExtensions.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = tsRewriteRelativeImportExtensions; +function tsRewriteRelativeImportExtensions(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) { + return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path; +} + +//# sourceMappingURL=tsRewriteRelativeImportExtensions.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/tsRewriteRelativeImportExtensions.js.map b/node_modules/@babel/helpers/lib/helpers/tsRewriteRelativeImportExtensions.js.map new file mode 100644 index 0000000..c6f76a8 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/tsRewriteRelativeImportExtensions.js.map @@ -0,0 +1 @@ +{"version":3,"names":["tsRewriteRelativeImportExtensions","path","preserveJsx","test","replace","m","tsx","d","ext","cm","toLowerCase"],"sources":["../../src/helpers/tsRewriteRelativeImportExtensions.ts"],"sourcesContent":["/* @minVersion 7.27.0 */\n\n// https://github.com/microsoft/TypeScript/blob/71716a2868c87248af5020e33a84a2178d41a2d6/src/compiler/factory/emitHelpers.ts#L1451\nexport default function tsRewriteRelativeImportExtensions(\n path: unknown,\n preserveJsx?: boolean,\n) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(\n /\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+)?)\\.([cm]?)ts$/i,\n function (m, tsx, d, ext, cm) {\n return tsx\n ? preserveJsx\n ? \".jsx\"\n : \".js\"\n : d && (!ext || !cm)\n ? m\n : d + ext + \".\" + cm.toLowerCase() + \"js\";\n },\n );\n }\n return path;\n}\n"],"mappings":";;;;;;AAGe,SAASA,iCAAiCA,CACvDC,IAAa,EACbC,WAAqB,EACrB;EACA,IAAI,OAAOD,IAAI,KAAK,QAAQ,IAAI,UAAU,CAACE,IAAI,CAACF,IAAI,CAAC,EAAE;IACrD,OAAOA,IAAI,CAACG,OAAO,CACjB,iDAAiD,EACjD,UAAUC,CAAC,EAAEC,GAAG,EAAEC,CAAC,EAAEC,GAAG,EAAEC,EAAE,EAAE;MAC5B,OAAOH,GAAG,GACNJ,WAAW,GACT,MAAM,GACN,KAAK,GACPK,CAAC,KAAK,CAACC,GAAG,IAAI,CAACC,EAAE,CAAC,GAChBJ,CAAC,GACDE,CAAC,GAAGC,GAAG,GAAG,GAAG,GAAGC,EAAE,CAACC,WAAW,CAAC,CAAC,GAAG,IAAI;IAC/C,CACF,CAAC;EACH;EACA,OAAOT,IAAI;AACb","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/typeof.js b/node_modules/@babel/helpers/lib/helpers/typeof.js new file mode 100644 index 0000000..2d066d2 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/typeof.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _typeof; +function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + exports.default = _typeof = function (obj) { + return typeof obj; + }; + } else { + exports.default = _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + return _typeof(obj); +} + +//# sourceMappingURL=typeof.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/typeof.js.map b/node_modules/@babel/helpers/lib/helpers/typeof.js.map new file mode 100644 index 0000000..38dc7ef --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/typeof.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_typeof","obj","Symbol","iterator","exports","default","constructor","prototype"],"sources":["../../src/helpers/typeof.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _typeof(\n obj: unknown,\n):\n | \"string\"\n | \"number\"\n | \"bigint\"\n | \"boolean\"\n | \"symbol\"\n | \"undefined\"\n | \"object\"\n | \"function\" {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n // @ts-expect-error -- deliberate re-defining typeof\n _typeof = function (obj: unknown) {\n return typeof obj;\n };\n } else {\n // @ts-expect-error -- deliberate re-defining typeof\n _typeof = function (obj: unknown) {\n return obj &&\n typeof Symbol === \"function\" &&\n obj.constructor === Symbol &&\n obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n"],"mappings":";;;;;;AAEe,SAASA,OAAOA,CAC7BC,GAAY,EASC;EACb,yBAAyB;;EAEzB,IAAI,OAAOC,MAAM,KAAK,UAAU,IAAI,OAAOA,MAAM,CAACC,QAAQ,KAAK,QAAQ,EAAE;IAEvEC,OAAA,CAAAC,OAAA,GAAAL,OAAO,GAAG,SAAAA,CAAUC,GAAY,EAAE;MAChC,OAAO,OAAOA,GAAG;IACnB,CAAC;EACH,CAAC,MAAM;IAELG,OAAA,CAAAC,OAAA,GAAAL,OAAO,GAAG,SAAAA,CAAUC,GAAY,EAAE;MAChC,OAAOA,GAAG,IACR,OAAOC,MAAM,KAAK,UAAU,IAC5BD,GAAG,CAACK,WAAW,KAAKJ,MAAM,IAC1BD,GAAG,KAAKC,MAAM,CAACK,SAAS,GACtB,QAAQ,GACR,OAAON,GAAG;IAChB,CAAC;EACH;EAEA,OAAOD,OAAO,CAACC,GAAG,CAAC;AACrB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/unsupportedIterableToArray.js b/node_modules/@babel/helpers/lib/helpers/unsupportedIterableToArray.js new file mode 100644 index 0000000..f23883a --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/unsupportedIterableToArray.js @@ -0,0 +1,19 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _unsupportedIterableToArray; +var _arrayLikeToArray = require("./arrayLikeToArray.js"); +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return (0, _arrayLikeToArray.default)(o, minLen); + var name = Object.prototype.toString.call(o).slice(8, -1); + if (name === "Object" && o.constructor) name = o.constructor.name; + if (name === "Map" || name === "Set") return Array.from(o); + if (name === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(name)) { + return (0, _arrayLikeToArray.default)(o, minLen); + } +} + +//# sourceMappingURL=unsupportedIterableToArray.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/unsupportedIterableToArray.js.map b/node_modules/@babel/helpers/lib/helpers/unsupportedIterableToArray.js.map new file mode 100644 index 0000000..9878054 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/unsupportedIterableToArray.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_arrayLikeToArray","require","_unsupportedIterableToArray","o","minLen","arrayLikeToArray","name","Object","prototype","toString","call","slice","constructor","Array","from","test"],"sources":["../../src/helpers/unsupportedIterableToArray.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport arrayLikeToArray from \"./arrayLikeToArray.ts\";\n\ntype NonArrayIterable = Iterable> =\n T extends Array ? never : Iterable;\n\nexport default function _unsupportedIterableToArray(\n o: RelativeIndexable /* string | typedarray */ | ArrayLike | Set,\n minLen?: number | null,\n): T[];\nexport default function _unsupportedIterableToArray(\n o: Map,\n minLen?: number | null,\n): [K, T][];\n// This is a specific overload added specifically for createForOfIteratorHelpers.ts\nexport default function _unsupportedIterableToArray(\n o: NonArrayIterable,\n minLen?: number | null,\n): undefined;\nexport default function _unsupportedIterableToArray(\n o: any,\n minLen?: number | null,\n): any[] | undefined {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var name = Object.prototype.toString.call(o).slice(8, -1);\n if (name === \"Object\" && o.constructor) name = o.constructor.name;\n if (name === \"Map\" || name === \"Set\") return Array.from(o);\n if (\n name === \"Arguments\" ||\n /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(name)\n ) {\n return arrayLikeToArray(o, minLen);\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAkBe,SAASC,2BAA2BA,CACjDC,CAAM,EACNC,MAAsB,EACH;EACnB,IAAI,CAACD,CAAC,EAAE;EACR,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE,OAAO,IAAAE,yBAAgB,EAASF,CAAC,EAAEC,MAAM,CAAC;EACrE,IAAIE,IAAI,GAAGC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACP,CAAC,CAAC,CAACQ,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzD,IAAIL,IAAI,KAAK,QAAQ,IAAIH,CAAC,CAACS,WAAW,EAAEN,IAAI,GAAGH,CAAC,CAACS,WAAW,CAACN,IAAI;EACjE,IAAIA,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,KAAK,EAAE,OAAOO,KAAK,CAACC,IAAI,CAACX,CAAC,CAAC;EAC1D,IACEG,IAAI,KAAK,WAAW,IACpB,0CAA0C,CAACS,IAAI,CAACT,IAAI,CAAC,EACrD;IACA,OAAO,IAAAD,yBAAgB,EAACF,CAAC,EAAEC,MAAM,CAAC;EACpC;AACF","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/using.js b/node_modules/@babel/helpers/lib/helpers/using.js new file mode 100644 index 0000000..b98a85d --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/using.js @@ -0,0 +1,29 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _using; +function _using(stack, value, isAwait) { + if (value === null || value === void 0) return value; + if (Object(value) !== value) { + throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); + } + if (isAwait) { + var dispose = value[Symbol.asyncDispose || Symbol.for("Symbol.asyncDispose")]; + } + if (dispose === null || dispose === void 0) { + dispose = value[Symbol.dispose || Symbol.for("Symbol.dispose")]; + } + if (typeof dispose !== "function") { + throw new TypeError(`Property [Symbol.dispose] is not a function.`); + } + stack.push({ + v: value, + d: dispose, + a: isAwait + }); + return value; +} + +//# sourceMappingURL=using.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/using.js.map b/node_modules/@babel/helpers/lib/helpers/using.js.map new file mode 100644 index 0000000..de39a15 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/using.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_using","stack","value","isAwait","Object","TypeError","dispose","Symbol","asyncDispose","for","push","v","d","a"],"sources":["../../src/helpers/using.js"],"sourcesContent":["/* @minVersion 7.22.0 */\n/* @onlyBabel7 */\n\nexport default function _using(stack, value, isAwait) {\n if (value === null || value === void 0) return value;\n if (Object(value) !== value) {\n throw new TypeError(\n \"using declarations can only be used with objects, functions, null, or undefined.\",\n );\n }\n // core-js-pure uses Symbol.for for polyfilling well-known symbols\n if (isAwait) {\n var dispose =\n value[Symbol.asyncDispose || Symbol.for(\"Symbol.asyncDispose\")];\n }\n if (dispose === null || dispose === void 0) {\n dispose = value[Symbol.dispose || Symbol.for(\"Symbol.dispose\")];\n }\n if (typeof dispose !== \"function\") {\n throw new TypeError(`Property [Symbol.dispose] is not a function.`);\n }\n stack.push({ v: value, d: dispose, a: isAwait });\n return value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,MAAMA,CAACC,KAAK,EAAEC,KAAK,EAAEC,OAAO,EAAE;EACpD,IAAID,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,KAAK,CAAC,EAAE,OAAOA,KAAK;EACpD,IAAIE,MAAM,CAACF,KAAK,CAAC,KAAKA,KAAK,EAAE;IAC3B,MAAM,IAAIG,SAAS,CACjB,kFACF,CAAC;EACH;EAEA,IAAIF,OAAO,EAAE;IACX,IAAIG,OAAO,GACTJ,KAAK,CAACK,MAAM,CAACC,YAAY,IAAID,MAAM,CAACE,GAAG,CAAC,qBAAqB,CAAC,CAAC;EACnE;EACA,IAAIH,OAAO,KAAK,IAAI,IAAIA,OAAO,KAAK,KAAK,CAAC,EAAE;IAC1CA,OAAO,GAAGJ,KAAK,CAACK,MAAM,CAACD,OAAO,IAAIC,MAAM,CAACE,GAAG,CAAC,gBAAgB,CAAC,CAAC;EACjE;EACA,IAAI,OAAOH,OAAO,KAAK,UAAU,EAAE;IACjC,MAAM,IAAID,SAAS,CAAC,8CAA8C,CAAC;EACrE;EACAJ,KAAK,CAACS,IAAI,CAAC;IAAEC,CAAC,EAAET,KAAK;IAAEU,CAAC,EAAEN,OAAO;IAAEO,CAAC,EAAEV;EAAQ,CAAC,CAAC;EAChD,OAAOD,KAAK;AACd","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/usingCtx.js b/node_modules/@babel/helpers/lib/helpers/usingCtx.js new file mode 100644 index 0000000..f6ee6d6 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/usingCtx.js @@ -0,0 +1,103 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _usingCtx; +function _usingCtx() { + var _disposeSuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed) { + var err = new Error(); + err.name = "SuppressedError"; + err.error = error; + err.suppressed = suppressed; + return err; + }, + empty = {}, + stack = []; + function using(isAwait, value) { + if (value != null) { + if (Object(value) !== value) { + throw new TypeError("using declarations can only be used with objects, functions, null, or undefined."); + } + if (isAwait) { + var dispose = value[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")]; + } + if (dispose === undefined) { + dispose = value[Symbol.dispose || Symbol["for"]("Symbol.dispose")]; + if (isAwait) { + var inner = dispose; + } + } + if (typeof dispose !== "function") { + throw new TypeError("Object is not disposable."); + } + if (inner) { + dispose = function () { + try { + inner.call(value); + } catch (e) { + return Promise.reject(e); + } + }; + } + stack.push({ + v: value, + d: dispose, + a: isAwait + }); + } else if (isAwait) { + stack.push({ + d: value, + a: isAwait + }); + } + return value; + } + return { + e: empty, + u: using.bind(null, false), + a: using.bind(null, true), + d: function () { + var error = this.e, + state = 0, + resource; + function next() { + while (resource = stack.pop()) { + try { + if (!resource.a && state === 1) { + state = 0; + stack.push(resource); + return Promise.resolve().then(next); + } + if (resource.d) { + var disposalResult = resource.d.call(resource.v); + if (resource.a) { + state |= 2; + return Promise.resolve(disposalResult).then(next, err); + } + } else { + state |= 1; + } + } catch (e) { + return err(e); + } + } + if (state === 1) { + if (error !== empty) { + return Promise.reject(error); + } else { + return Promise.resolve(); + } + } + if (error !== empty) throw error; + } + function err(e) { + error = error !== empty ? new _disposeSuppressedError(e, error) : e; + return next(); + } + return next(); + } + }; +} + +//# sourceMappingURL=usingCtx.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/usingCtx.js.map b/node_modules/@babel/helpers/lib/helpers/usingCtx.js.map new file mode 100644 index 0000000..e15d3f3 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/usingCtx.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_usingCtx","_disposeSuppressedError","SuppressedError","error","suppressed","err","Error","name","empty","stack","using","isAwait","value","Object","TypeError","dispose","Symbol","asyncDispose","undefined","inner","call","e","Promise","reject","push","v","d","a","u","bind","state","resource","next","pop","resolve","then","disposalResult"],"sources":["../../src/helpers/usingCtx.ts"],"sourcesContent":["/* @minVersion 7.23.9 */\n\ntype Stack =\n | {\n v: Disposable | AsyncDisposable;\n d: null | undefined | DisposeLike;\n a: boolean;\n }\n | {\n d: null | undefined;\n a: true;\n };\n\ntype DisposeLike = () => void | PromiseLike;\n\ninterface UsingCtxReturn {\n e: object;\n u: (value: Disposable | null | undefined) => Disposable | null | undefined;\n a: (\n value: AsyncDisposable | Disposable | null | undefined,\n ) => AsyncDisposable | Disposable | null | undefined;\n d: DisposeLike;\n}\n\nconst enum StateFlag {\n NONE = 0,\n NEEDS_AWAIT = 1,\n HAS_AWAITED = 2,\n}\n\nexport default function _usingCtx(): UsingCtxReturn {\n var _disposeSuppressedError =\n typeof SuppressedError === \"function\"\n ? SuppressedError\n : (function (error: Error, suppressed: Error) {\n var err = new Error() as SuppressedError;\n err.name = \"SuppressedError\";\n err.error = error;\n err.suppressed = suppressed;\n return err;\n } as SuppressedErrorConstructor),\n empty = {},\n stack: Stack[] = [];\n function using(\n isAwait: true,\n value: AsyncDisposable | Disposable | null | undefined,\n ): AsyncDisposable | Disposable | null | undefined;\n function using(\n isAwait: false,\n value: Disposable | null | undefined,\n ): Disposable | null | undefined;\n function using(\n isAwait: boolean,\n value: AsyncDisposable | Disposable | null | undefined,\n ): AsyncDisposable | Disposable | null | undefined {\n if (value != null) {\n if (Object(value) !== value) {\n throw new TypeError(\n \"using declarations can only be used with objects, functions, null, or undefined.\",\n );\n }\n // core-js-pure uses Symbol.for for polyfilling well-known symbols\n if (isAwait) {\n // value can either be an AsyncDisposable or a Disposable\n // Try AsyncDisposable first\n var dispose: DisposeLike | null | undefined = (\n value as AsyncDisposable\n )[Symbol.asyncDispose || Symbol[\"for\"](\"Symbol.asyncDispose\")];\n }\n if (dispose === undefined) {\n dispose = (value as Disposable)[\n Symbol.dispose || Symbol[\"for\"](\"Symbol.dispose\")\n ];\n if (isAwait) {\n var inner = dispose;\n }\n }\n if (typeof dispose !== \"function\") {\n throw new TypeError(\"Object is not disposable.\");\n }\n // @ts-expect-error use before assignment\n if (inner) {\n dispose = function () {\n try {\n inner.call(value);\n } catch (e) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(e);\n }\n };\n }\n stack.push({ v: value, d: dispose, a: isAwait });\n } else if (isAwait) {\n // provide the nullish `value` as `d` for minification gain\n stack.push({ d: value, a: isAwait });\n }\n return value;\n }\n return {\n // error\n e: empty,\n // using\n u: using.bind(null, false),\n // await using\n // full generic signature to avoid type widening\n a: using.bind<\n null,\n [true],\n [AsyncDisposable | Disposable | null | undefined],\n AsyncDisposable | Disposable | null | undefined\n >(null, true),\n // dispose\n d: function () {\n var error = this.e,\n state: StateFlag = StateFlag.NONE,\n resource;\n\n function next(): Promise | void {\n while ((resource = stack.pop())) {\n try {\n if (!resource.a && state === StateFlag.NEEDS_AWAIT) {\n state = StateFlag.NONE;\n stack.push(resource);\n return Promise.resolve().then(next);\n }\n if (resource.d) {\n var disposalResult = resource.d.call(resource.v);\n if (resource.a) {\n state |= StateFlag.HAS_AWAITED;\n return Promise.resolve(disposalResult).then(next, err);\n }\n } else {\n state |= StateFlag.NEEDS_AWAIT;\n }\n } catch (e) {\n return err(e as Error);\n }\n }\n if (state === StateFlag.NEEDS_AWAIT) {\n if (error !== empty) {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n return Promise.reject(error);\n } else {\n return Promise.resolve();\n }\n }\n\n if (error !== empty) throw error as Error;\n }\n\n function err(e: Error): Promise | void {\n error = error !== empty ? new _disposeSuppressedError(e, error) : e;\n\n return next();\n }\n\n return next();\n },\n } satisfies UsingCtxReturn;\n}\n"],"mappings":";;;;;;AA8Be,SAASA,SAASA,CAAA,EAAmB;EAClD,IAAIC,uBAAuB,GACvB,OAAOC,eAAe,KAAK,UAAU,GACjCA,eAAe,GACd,UAAUC,KAAY,EAAEC,UAAiB,EAAE;MAC1C,IAAIC,GAAG,GAAG,IAAIC,KAAK,CAAC,CAAoB;MACxCD,GAAG,CAACE,IAAI,GAAG,iBAAiB;MAC5BF,GAAG,CAACF,KAAK,GAAGA,KAAK;MACjBE,GAAG,CAACD,UAAU,GAAGA,UAAU;MAC3B,OAAOC,GAAG;IACZ,CAAgC;IACtCG,KAAK,GAAG,CAAC,CAAC;IACVC,KAAc,GAAG,EAAE;EASrB,SAASC,KAAKA,CACZC,OAAgB,EAChBC,KAAsD,EACL;IACjD,IAAIA,KAAK,IAAI,IAAI,EAAE;MACjB,IAAIC,MAAM,CAACD,KAAK,CAAC,KAAKA,KAAK,EAAE;QAC3B,MAAM,IAAIE,SAAS,CACjB,kFACF,CAAC;MACH;MAEA,IAAIH,OAAO,EAAE;QAGX,IAAII,OAAuC,GACzCH,KAAK,CACLI,MAAM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babel/helpers/lib/helpers/wrapAsyncGenerator.js b/node_modules/@babel/helpers/lib/helpers/wrapAsyncGenerator.js new file mode 100644 index 0000000..97811be --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/wrapAsyncGenerator.js @@ -0,0 +1,97 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _wrapAsyncGenerator; +var _OverloadYield = require("./OverloadYield.js"); +function _wrapAsyncGenerator(fn) { + return function () { + return new AsyncGenerator(fn.apply(this, arguments)); + }; +} +function AsyncGenerator(gen) { + var front, back; + function send(key, arg) { + return new Promise(function (resolve, reject) { + var request = { + key: key, + arg: arg, + resolve: resolve, + reject: reject, + next: null + }; + if (back) { + back = back.next = request; + } else { + front = back = request; + resume(key, arg); + } + }); + } + function resume(key, arg) { + try { + var result = gen[key](arg); + var value = result.value; + var overloaded = value instanceof _OverloadYield.default; + Promise.resolve(overloaded ? value.v : value).then(function (arg) { + if (overloaded) { + var nextKey = key === "return" ? "return" : "next"; + if (!value.k || arg.done) { + return resume(nextKey, arg); + } else { + arg = gen[nextKey](arg).value; + } + } + settle(result.done ? "return" : "normal", arg); + }, function (err) { + resume("throw", err); + }); + } catch (err) { + settle("throw", err); + } + } + function settle(type, value) { + switch (type) { + case "return": + front.resolve({ + value: value, + done: true + }); + break; + case "throw": + front.reject(value); + break; + default: + front.resolve({ + value: value, + done: false + }); + break; + } + front = front.next; + if (front) { + resume(front.key, front.arg); + } else { + back = null; + } + } + this._invoke = send; + if (typeof gen["return"] !== "function") { + this["return"] = undefined; + } +} +AsyncGenerator.prototype[typeof Symbol === "function" && Symbol.asyncIterator || "@@asyncIterator"] = function () { + return this; +}; +AsyncGenerator.prototype.next = function (arg) { + return this._invoke("next", arg); +}; +AsyncGenerator.prototype["throw"] = function (arg) { + return this._invoke("throw", arg); +}; +AsyncGenerator.prototype["return"] = function (arg) { + return this._invoke("return", arg); +}; + +//# sourceMappingURL=wrapAsyncGenerator.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/wrapAsyncGenerator.js.map b/node_modules/@babel/helpers/lib/helpers/wrapAsyncGenerator.js.map new file mode 100644 index 0000000..304e7b3 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/wrapAsyncGenerator.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_OverloadYield","require","_wrapAsyncGenerator","fn","AsyncGenerator","apply","arguments","gen","front","back","send","key","arg","Promise","resolve","reject","request","next","resume","result","value","overloaded","OverloadYield","v","then","nextKey","k","done","settle","err","type","_invoke","undefined","prototype","Symbol","asyncIterator"],"sources":["../../src/helpers/wrapAsyncGenerator.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nimport OverloadYield from \"./OverloadYield.ts\";\n\nexport default function _wrapAsyncGenerator(fn: GeneratorFunction) {\n return function (this: any) {\n // Use \"arguments\" here for better compatibility and smaller bundle size\n return new AsyncGenerator(fn.apply(this, arguments as any));\n };\n}\n\n/* == The implementation of the AsyncGenerator class == */\n\ntype AsyncIteratorMethod = \"next\" | \"throw\" | \"return\";\n\ndeclare class AsyncGenerator\n implements globalThis.AsyncGenerator\n{\n _invoke: (\n key: AsyncIteratorMethod,\n arg: IteratorResult,\n ) => Promise>;\n\n constructor(gen: Generator);\n\n next(...args: [] | [TNext]): Promise>;\n return(\n value: TReturn | PromiseLike,\n ): Promise>;\n throw(e: any): Promise>;\n [Symbol.asyncIterator](): AsyncGenerator;\n [Symbol.asyncDispose](): Promise;\n}\n\ninterface AsyncGeneratorRequest {\n key: AsyncIteratorMethod;\n arg: IteratorResult;\n resolve: (value: IteratorResult) => void;\n reject: (error: any) => void;\n next: AsyncGeneratorRequest | null;\n}\n\nfunction AsyncGenerator(\n this: AsyncGenerator,\n gen: Generator,\n) {\n var front: AsyncGeneratorRequest | null,\n back: AsyncGeneratorRequest | null;\n\n function send(key: AsyncIteratorMethod, arg: IteratorResult) {\n return new Promise>(function (resolve, reject) {\n var request: AsyncGeneratorRequest = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null,\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key: AsyncIteratorMethod, arg: IteratorResult) {\n try {\n var result = gen[key](arg);\n var value = result.value;\n var overloaded = value instanceof OverloadYield;\n\n Promise.resolve(\n overloaded ? (value as OverloadYield).v : value,\n ).then(\n function (arg: any) {\n if (overloaded) {\n // Overloaded yield requires calling into the generator twice:\n // - first we get the iterator result wrapped in a promise\n // (the gen[key](arg) call above)\n // - then we await it (the Promise.resolve call above)\n // - then we give the result back to the iterator, so that it can:\n // * if it was an await, use its result\n // * if it was a yield*, possibly return the `done: true` signal\n // so that yield* knows that the iterator is finished.\n // This needs to happen in the second call, because in the\n // first one `done: true` was hidden in the promise and thus\n // not visible to the (sync) yield*.\n // The other part of this implementation is in asyncGeneratorDelegate.\n var nextKey: \"return\" | \"next\" =\n key === \"return\" ? \"return\" : \"next\";\n if (\n !(value as OverloadYield>).k ||\n arg.done\n ) {\n // await or end of yield*\n // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -- smaller bundle size\n return resume(nextKey, arg);\n } else {\n // yield*, not done\n arg = gen[nextKey](arg).value;\n }\n }\n\n settle(result.done ? \"return\" : \"normal\", arg);\n },\n function (err) {\n resume(\"throw\", err);\n },\n );\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type: AsyncIteratorMethod | \"normal\", value: any) {\n switch (type) {\n case \"return\":\n front!.resolve({ value: value, done: true });\n break;\n case \"throw\":\n front!.reject(value);\n break;\n default:\n front!.resolve({ value: value, done: false });\n break;\n }\n\n front = front!.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide \"return\" method if generator return is not supported\n if (typeof gen[\"return\"] !== \"function\") {\n // @ts-expect-error -- intentionally remove \"return\" when not supported\n this[\"return\"] = undefined;\n }\n}\n\nAsyncGenerator.prototype[\n ((typeof Symbol === \"function\" && Symbol.asyncIterator) ||\n \"@@asyncIterator\") as typeof Symbol.asyncIterator\n] = function () {\n return this;\n};\n\nAsyncGenerator.prototype.next = function (arg: IteratorResult) {\n return this._invoke(\"next\", arg);\n};\nAsyncGenerator.prototype[\"throw\"] = function (arg: IteratorResult) {\n return this._invoke(\"throw\", arg);\n};\nAsyncGenerator.prototype[\"return\"] = function (arg: IteratorResult) {\n return this._invoke(\"return\", arg);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAEe,SAASC,mBAAmBA,CAACC,EAAqB,EAAE;EACjE,OAAO,YAAqB;IAE1B,OAAO,IAAIC,cAAc,CAACD,EAAE,CAACE,KAAK,CAAC,IAAI,EAAEC,SAAgB,CAAC,CAAC;EAC7D,CAAC;AACH;AAiCA,SAASF,cAAcA,CAErBG,GAAiC,EACjC;EACA,IAAIC,KAAsD,EACxDC,IAAqD;EAEvD,SAASC,IAAIA,CAACC,GAAwB,EAAEC,GAAsB,EAAE;IAC9D,OAAO,IAAIC,OAAO,CAA6B,UAAUC,OAAO,EAAEC,MAAM,EAAE;MACxE,IAAIC,OAAiD,GAAG;QACtDL,GAAG,EAAEA,GAAG;QACRC,GAAG,EAAEA,GAAG;QACRE,OAAO,EAAEA,OAAO;QAChBC,MAAM,EAAEA,MAAM;QACdE,IAAI,EAAE;MACR,CAAC;MAED,IAAIR,IAAI,EAAE;QACRA,IAAI,GAAGA,IAAI,CAACQ,IAAI,GAAGD,OAAO;MAC5B,CAAC,MAAM;QACLR,KAAK,GAAGC,IAAI,GAAGO,OAAO;QACtBE,MAAM,CAACP,GAAG,EAAEC,GAAG,CAAC;MAClB;IACF,CAAC,CAAC;EACJ;EAEA,SAASM,MAAMA,CAACP,GAAwB,EAAEC,GAA+B,EAAE;IACzE,IAAI;MACF,IAAIO,MAAM,GAAGZ,GAAG,CAACI,GAAG,CAAC,CAACC,GAAG,CAAC;MAC1B,IAAIQ,KAAK,GAAGD,MAAM,CAACC,KAAK;MACxB,IAA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EAAEH,KAAK,CAACI,GAAG,CAAC;IAC9B,CAAC,MAAM;MACLH,IAAI,GAAG,IAAI;IACb;EACF;EAEA,IAAI,CAACsB,OAAO,GAAGrB,IAAI;EAGnB,IAAI,OAAOH,GAAG,CAAC,QAAQ,CAAC,KAAK,UAAU,EAAE;IAEvC,IAAI,CAAC,QAAQ,CAAC,GAAGyB,SAAS;EAC5B;AACF;AAEA5B,cAAc,CAAC6B,SAAS,CACpB,OAAOC,MAAM,KAAK,UAAU,IAAIA,MAAM,CAACC,aAAa,IACpD,iBAAiB,CACpB,GAAG,YAAY;EACd,OAAO,IAAI;AACb,CAAC;AAED/B,cAAc,CAAC6B,SAAS,CAAChB,IAAI,GAAG,UAAUL,GAAwB,EAAE;EAClE,OAAO,IAAI,CAACmB,OAAO,CAAC,MAAM,EAAEnB,GAAG,CAAC;AAClC,CAAC;AACDR,cAAc,CAAC6B,SAAS,CAAC,OAAO,CAAC,GAAG,UAAUrB,GAAwB,EAAE;EACtE,OAAO,IAAI,CAACmB,OAAO,CAAC,OAAO,EAAEnB,GAAG,CAAC;AACnC,CAAC;AACDR,cAAc,CAAC6B,SAAS,CAAC,QAAQ,CAAC,GAAG,UAAUrB,GAAwB,EAAE;EACvE,OAAO,IAAI,CAACmB,OAAO,CAAC,QAAQ,EAAEnB,GAAG,CAAC;AACpC,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/wrapNativeSuper.js b/node_modules/@babel/helpers/lib/helpers/wrapNativeSuper.js new file mode 100644 index 0000000..2ed0b5c --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/wrapNativeSuper.js @@ -0,0 +1,38 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _wrapNativeSuper; +var _getPrototypeOf = require("./getPrototypeOf.js"); +var _setPrototypeOf = require("./setPrototypeOf.js"); +var _isNativeFunction = require("./isNativeFunction.js"); +var _construct = require("./construct.js"); +function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + exports.default = _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !(0, _isNativeFunction.default)(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (_cache !== undefined) { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return (0, _construct.default)(Class, arguments, (0, _getPrototypeOf.default)(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return (0, _setPrototypeOf.default)(Wrapper, Class); + }; + return _wrapNativeSuper(Class); +} + +//# sourceMappingURL=wrapNativeSuper.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/wrapNativeSuper.js.map b/node_modules/@babel/helpers/lib/helpers/wrapNativeSuper.js.map new file mode 100644 index 0000000..8b7e5bf --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/wrapNativeSuper.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_getPrototypeOf","require","_setPrototypeOf","_isNativeFunction","_construct","_wrapNativeSuper","Class","_cache","Map","undefined","exports","default","isNativeFunction","TypeError","has","get","set","Wrapper","construct","arguments","getPrototypeOf","constructor","prototype","Object","create","value","enumerable","writable","configurable","setPrototypeOf"],"sources":["../../src/helpers/wrapNativeSuper.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\n// Based on https://github.com/WebReflection/babel-plugin-transform-builtin-classes\n\nimport getPrototypeOf from \"./getPrototypeOf.ts\";\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\nimport isNativeFunction from \"./isNativeFunction.ts\";\nimport construct from \"./construct.ts\";\n\nexport default function _wrapNativeSuper(Class: Function | null) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n // @ts-expect-error -- reuse function id for helper size\n _wrapNativeSuper = function _wrapNativeSuper(Class: Function | null) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (_cache !== undefined) {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n // @ts-expect-error -- we are sure Class is a function here\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n });\n\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEe,SAASI,gBAAgBA,CAACC,KAAsB,EAAE;EAC/D,IAAIC,MAAM,GAAG,OAAOC,GAAG,KAAK,UAAU,GAAG,IAAIA,GAAG,CAAC,CAAC,GAAGC,SAAS;EAG9DC,OAAA,CAAAC,OAAA,GAAAN,gBAAgB,GAAG,SAASA,gBAAgBA,CAACC,KAAsB,EAAE;IACnE,IAAIA,KAAK,KAAK,IAAI,IAAI,CAAC,IAAAM,yBAAgB,EAACN,KAAK,CAAC,EAAE,OAAOA,KAAK;IAC5D,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;MAC/B,MAAM,IAAIO,SAAS,CAAC,oDAAoD,CAAC;IAC3E;IACA,IAAIN,MAAM,KAAKE,SAAS,EAAE;MACxB,IAAIF,MAAM,CAACO,GAAG,CAACR,KAAK,CAAC,EAAE,OAAOC,MAAM,CAACQ,GAAG,CAACT,KAAK,CAAC;MAC/CC,MAAM,CAACS,GAAG,CAACV,KAAK,EAAEW,OAAO,CAAC;IAC5B;IAEA,SAASA,OAAOA,CAAA,EAAG;MAEjB,OAAO,IAAAC,kBAAS,EAACZ,KAAK,EAAEa,SAAS,EAAE,IAAAC,uBAAc,EAAC,IAAI,CAAC,CAACC,WAAW,CAAC;IACtE;IACAJ,OAAO,CAACK,SAAS,GAAGC,MAAM,CAACC,MAAM,CAAClB,KAAK,CAACgB,SAAS,EAAE;MACjDD,WAAW,EAAE;QACXI,KAAK,EAAER,OAAO;QACdS,UAAU,EAAE,KAAK;QACjBC,QAAQ,EAAE,IAAI;QACdC,YAAY,EAAE;MAChB;IACF,CAAC,CAAC;IAEF,OAAO,IAAAC,uBAAc,EAACZ,OAAO,EAAEX,KAAK,CAAC;EACvC,CAAC;EAED,OAAOD,gBAAgB,CAACC,KAAK,CAAC;AAChC","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js b/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js new file mode 100644 index 0000000..a6e339c --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js @@ -0,0 +1,72 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _wrapRegExp; +var _setPrototypeOf = require("./setPrototypeOf.js"); +var _inherits = require("./inherits.js"); +function _wrapRegExp() { + exports.default = _wrapRegExp = function (re, groups) { + return new BabelRegExp(re, undefined, groups); + }; + var _super = RegExp.prototype; + var _groups = new WeakMap(); + function BabelRegExp(re, flags, groups) { + var _this = new RegExp(re, flags); + _groups.set(_this, groups || _groups.get(re)); + return (0, _setPrototypeOf.default)(_this, BabelRegExp.prototype); + } + (0, _inherits.default)(BabelRegExp, RegExp); + BabelRegExp.prototype.exec = function (str) { + var result = _super.exec.call(this, str); + if (result) { + result.groups = buildGroups(result, this); + var indices = result.indices; + if (indices) indices.groups = buildGroups(indices, this); + } + return result; + }; + BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { + if (typeof substitution === "string") { + var groups = _groups.get(this); + return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)(>|$)/g, function (match, name, end) { + if (end === "") { + return match; + } else { + var group = groups[name]; + return Array.isArray(group) ? "$" + group.join("$") : typeof group === "number" ? "$" + group : ""; + } + })); + } else if (typeof substitution === "function") { + var _this = this; + return _super[Symbol.replace].call(this, str, function () { + var args = arguments; + if (typeof args[args.length - 1] !== "object") { + args = [].slice.call(args); + args.push(buildGroups(args, _this)); + } + return substitution.apply(this, args); + }); + } else { + return _super[Symbol.replace].call(this, str, substitution); + } + }; + function buildGroups(result, re) { + var g = _groups.get(re); + return Object.keys(g).reduce(function (groups, name) { + var i = g[name]; + if (typeof i === "number") groups[name] = result[i];else { + var k = 0; + while (result[i[k]] === undefined && k + 1 < i.length) { + k++; + } + groups[name] = result[i[k]]; + } + return groups; + }, Object.create(null)); + } + return _wrapRegExp.apply(this, arguments); +} + +//# sourceMappingURL=wrapRegExp.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js.map b/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js.map new file mode 100644 index 0000000..dc18964 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/wrapRegExp.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_setPrototypeOf","require","_inherits","_wrapRegExp","exports","default","re","groups","BabelRegExp","undefined","_super","RegExp","prototype","_groups","WeakMap","flags","_this","set","get","setPrototypeOf","inherits","exec","str","result","call","buildGroups","indices","Symbol","replace","substitution","match","name","end","group","Array","isArray","join","args","arguments","length","slice","push","apply","g","Object","keys","reduce","i","k","create"],"sources":["../../src/helpers/wrapRegExp.ts"],"sourcesContent":["/* @minVersion 7.19.0 */\n\nimport setPrototypeOf from \"./setPrototypeOf.ts\";\nimport inherits from \"./inherits.ts\";\n\n// Define interfaces for clarity and type safety\ninterface GroupMap {\n [key: string]: number | [number, number];\n}\n\ndeclare class BabelRegExp extends RegExp {\n exec(str: string): RegExpExecArray | null;\n [Symbol.replace](str: string, substitution: string | Function): string;\n}\n\ninterface BabelRegExpConstructor {\n new (re: RegExp, flags?: string, groups?: GroupMap): BabelRegExp;\n readonly prototype: BabelRegExp;\n}\n\nexport default function _wrapRegExp(this: any): RegExp {\n // @ts-expect-error -- deliberately re-assign\n _wrapRegExp = function (re: RegExp, groups?: GroupMap): RegExp {\n return new (BabelRegExp as any as BabelRegExpConstructor)(\n re,\n undefined,\n groups,\n );\n };\n\n var _super = RegExp.prototype;\n var _groups = new WeakMap();\n\n function BabelRegExp(\n this: BabelRegExp,\n re: RegExp,\n flags?: string,\n groups?: GroupMap,\n ) {\n var _this = new RegExp(re, flags);\n // if the regex is re-created with 'g' flag\n _groups.set(_this, groups || _groups.get(re)!);\n return setPrototypeOf(_this, BabelRegExp.prototype) as BabelRegExp;\n }\n inherits(BabelRegExp, RegExp);\n\n BabelRegExp.prototype.exec = function (\n this: BabelRegExp,\n str: string,\n ): RegExpExecArray | null {\n var result = _super.exec.call(this, str);\n if (result) {\n result.groups = buildGroups(result, this);\n var indices = result.indices;\n if (indices) indices.groups = buildGroups(indices, this);\n }\n return result;\n };\n\n BabelRegExp.prototype[Symbol.replace] = function (\n this: BabelRegExp,\n str: string,\n substitution: string | Function,\n ): string {\n if (typeof substitution === \"string\") {\n var groups = _groups.get(this)!;\n return (\n _super[Symbol.replace] as (\n string: string,\n replaceValue: string,\n ) => string\n ).call(\n this,\n str,\n substitution.replace(/\\$<([^>]+)(>|$)/g, function (match, name, end) {\n if (end === \"\") {\n // return unterminated group name as-is\n return match;\n } else {\n var group = groups[name];\n return Array.isArray(group)\n ? \"$\" + group.join(\"$\")\n : typeof group === \"number\"\n ? \"$\" + group\n : \"\";\n }\n }),\n );\n } else if (typeof substitution === \"function\") {\n var _this = this;\n return (\n _super[Symbol.replace] as (\n string: string,\n replacer: (substring: string, ...args: any[]) => string,\n ) => string\n ).call(this, str, function (this: any) {\n var args: IArguments | any[] = arguments;\n // Modern engines already pass result.groups returned by exec() as the last arg.\n if (typeof args[args.length - 1] !== \"object\") {\n args = [].slice.call(args) as any[];\n args.push(buildGroups(args, _this));\n }\n return substitution.apply(this, args);\n });\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n };\n\n function buildGroups(\n result: RegExpExecArray,\n re: RegExp,\n ): Record;\n function buildGroups(\n result: RegExpIndicesArray,\n re: RegExp,\n ): Record;\n function buildGroups(\n result: RegExpExecArray | RegExpIndicesArray,\n re: RegExp,\n ): Record | Record {\n var g = _groups.get(re)!;\n return Object.keys(g).reduce(function (groups, name) {\n var i = g[name];\n if (typeof i === \"number\") groups[name] = result[i];\n else {\n var k = 0;\n while (result[i[k]] === undefined && k + 1 < i.length) {\n k++;\n }\n groups[name] = result[i[k]];\n }\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments as any);\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAiBe,SAASE,WAAWA,CAAA,EAAoB;EAErDC,OAAA,CAAAC,OAAA,GAAAF,WAAW,GAAG,SAAAA,CAAUG,EAAU,EAAEC,MAAiB,EAAU;IAC7D,OAAO,IAAKC,WAAW,CACrBF,EAAE,EACFG,SAAS,EACTF,MACF,CAAC;EACH,CAAC;EAED,IAAIG,MAAM,GAAGC,MAAM,CAACC,SAAS;EAC7B,IAAIC,OAAO,GAAG,IAAIC,OAAO,CAAmB,CAAC;EAE7C,SAASN,WAAWA,CAElBF,EAAU,EACVS,KAAc,EACdR,MAAiB,EACjB;IACA,IAAIS,KAAK,GAAG,IAAIL,MAAM,CAACL,EAAE,EAAES,KAAK,CAAC;IAEjCF,OAAO,CAACI,GAAG,CAACD,KAAK,EAAET,MAAM,IAAIM,OAAO,CAACK,GAAG,CAACZ,EAAE,CAAE,CAAC;IAC9C,OAAO,IAAAa,uBAAc,EAACH,KAAK,EAAER,WAAW,CAACI,SAAS,CAAC;EACrD;EACA,IAAAQ,iBAAQ,EAACZ,WAAW,EAAEG,MAAM,CAAC;EAE7BH,WAAW,CAACI,SAAS,CAACS,IAAI,GAAG,UAE3BC,GAAW,EACa;IACxB,IAAIC,MAAM,GAAGb,MAAM,CAACW,IAAI,CAACG,IAAI,CAAC,IAAI,EA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,CAAC,IAAI,EAAEJ,SAAgB,CAAC;AAClD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/helpers/writeOnlyError.js b/node_modules/@babel/helpers/lib/helpers/writeOnlyError.js new file mode 100644 index 0000000..d7e5248 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/writeOnlyError.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _writeOnlyError; +function _writeOnlyError(name) { + throw new TypeError('"' + name + '" is write-only'); +} + +//# sourceMappingURL=writeOnlyError.js.map diff --git a/node_modules/@babel/helpers/lib/helpers/writeOnlyError.js.map b/node_modules/@babel/helpers/lib/helpers/writeOnlyError.js.map new file mode 100644 index 0000000..d3db644 --- /dev/null +++ b/node_modules/@babel/helpers/lib/helpers/writeOnlyError.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_writeOnlyError","name","TypeError"],"sources":["../../src/helpers/writeOnlyError.ts"],"sourcesContent":["/* @minVersion 7.12.13 */\n\nexport default function _writeOnlyError(name: string) {\n throw new TypeError('\"' + name + '\" is write-only');\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CAACC,IAAY,EAAE;EACpD,MAAM,IAAIC,SAAS,CAAC,GAAG,GAAGD,IAAI,GAAG,iBAAiB,CAAC;AACrD","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/lib/index.js b/node_modules/@babel/helpers/lib/index.js new file mode 100644 index 0000000..a9bc9db --- /dev/null +++ b/node_modules/@babel/helpers/lib/index.js @@ -0,0 +1,126 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +exports.get = get; +exports.getDependencies = getDependencies; +exports.isInternal = isInternal; +exports.list = void 0; +exports.minVersion = minVersion; +var _t = require("@babel/types"); +var _helpersGenerated = require("./helpers-generated.js"); +const { + cloneNode, + identifier +} = _t; +function deep(obj, path, value) { + try { + const parts = path.split("."); + let last = parts.shift(); + while (parts.length > 0) { + obj = obj[last]; + last = parts.shift(); + } + if (arguments.length > 2) { + obj[last] = value; + } else { + return obj[last]; + } + } catch (e) { + e.message += ` (when accessing ${path})`; + throw e; + } +} +function permuteHelperAST(ast, metadata, bindingName, localBindings, getDependency, adjustAst) { + const { + locals, + dependencies, + exportBindingAssignments, + exportName + } = metadata; + const bindings = new Set(localBindings || []); + if (bindingName) bindings.add(bindingName); + for (const [name, paths] of (Object.entries || (o => Object.keys(o).map(k => [k, o[k]])))(locals)) { + let newName = name; + if (bindingName && name === exportName) { + newName = bindingName; + } else { + while (bindings.has(newName)) newName = "_" + newName; + } + if (newName !== name) { + for (const path of paths) { + deep(ast, path, identifier(newName)); + } + } + } + for (const [name, paths] of (Object.entries || (o => Object.keys(o).map(k => [k, o[k]])))(dependencies)) { + const ref = typeof getDependency === "function" && getDependency(name) || identifier(name); + for (const path of paths) { + deep(ast, path, cloneNode(ref)); + } + } + adjustAst == null || adjustAst(ast, exportName, map => { + exportBindingAssignments.forEach(p => deep(ast, p, map(deep(ast, p)))); + }); +} +const helperData = Object.create(null); +function loadHelper(name) { + if (!helperData[name]) { + const helper = _helpersGenerated.default[name]; + if (!helper) { + throw Object.assign(new ReferenceError(`Unknown helper ${name}`), { + code: "BABEL_HELPER_UNKNOWN", + helper: name + }); + } + helperData[name] = { + minVersion: helper.minVersion, + build(getDependency, bindingName, localBindings, adjustAst) { + const ast = helper.ast(); + permuteHelperAST(ast, helper.metadata, bindingName, localBindings, getDependency, adjustAst); + return { + nodes: ast.body, + globals: helper.metadata.globals + }; + }, + getDependencies() { + return Object.keys(helper.metadata.dependencies); + } + }; + } + return helperData[name]; +} +function get(name, getDependency, bindingName, localBindings, adjustAst) { + { + if (typeof bindingName === "object") { + const id = bindingName; + if ((id == null ? void 0 : id.type) === "Identifier") { + bindingName = id.name; + } else { + bindingName = undefined; + } + } + } + return loadHelper(name).build(getDependency, bindingName, localBindings, adjustAst); +} +function minVersion(name) { + return loadHelper(name).minVersion; +} +function getDependencies(name) { + return loadHelper(name).getDependencies(); +} +function isInternal(name) { + var _helpers$name; + return (_helpers$name = _helpersGenerated.default[name]) == null ? void 0 : _helpers$name.metadata.internal; +} +{ + exports.ensure = name => { + loadHelper(name); + }; +} +const list = exports.list = Object.keys(_helpersGenerated.default).map(name => name.replace(/^_/, "")); +var _default = exports.default = get; + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helpers/lib/index.js.map b/node_modules/@babel/helpers/lib/index.js.map new file mode 100644 index 0000000..10d10d5 --- /dev/null +++ b/node_modules/@babel/helpers/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_t","require","_helpersGenerated","cloneNode","identifier","deep","obj","path","value","parts","split","last","shift","length","arguments","e","message","permuteHelperAST","ast","metadata","bindingName","localBindings","getDependency","adjustAst","locals","dependencies","exportBindingAssignments","exportName","bindings","Set","add","name","paths","Object","entries","o","keys","map","k","newName","has","ref","forEach","p","helperData","create","loadHelper","helper","helpers","assign","ReferenceError","code","minVersion","build","nodes","body","globals","getDependencies","get","id","type","undefined","isInternal","_helpers$name","internal","exports","ensure","list","replace","_default","default"],"sources":["../src/index.ts"],"sourcesContent":["import { cloneNode, identifier } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport helpers from \"./helpers-generated.ts\";\nimport type { HelperMetadata } from \"./helpers-generated.ts\";\n\ntype GetDependency = (name: string) => t.Expression;\n\nfunction deep(obj: any, path: string, value?: unknown) {\n try {\n const parts = path.split(\".\");\n let last = parts.shift();\n while (parts.length > 0) {\n obj = obj[last];\n last = parts.shift();\n }\n if (arguments.length > 2) {\n obj[last] = value;\n } else {\n return obj[last];\n }\n } catch (e) {\n e.message += ` (when accessing ${path})`;\n throw e;\n }\n}\n\ntype AdjustAst = (\n ast: t.Program,\n exportName: string,\n mapExportBindingAssignments: (\n map: (node: t.Expression) => t.Expression,\n ) => void,\n) => void;\n\n/**\n * Given a helper AST and information about how it will be used, update the AST to match the usage.\n */\nfunction permuteHelperAST(\n ast: t.Program,\n metadata: HelperMetadata,\n bindingName: string | undefined,\n localBindings: string[] | undefined,\n getDependency: GetDependency | undefined,\n adjustAst: AdjustAst | undefined,\n) {\n const { locals, dependencies, exportBindingAssignments, exportName } =\n metadata;\n\n const bindings = new Set(localBindings || []);\n if (bindingName) bindings.add(bindingName);\n for (const [name, paths] of Object.entries(locals)) {\n let newName = name;\n if (bindingName && name === exportName) {\n newName = bindingName;\n } else {\n while (bindings.has(newName)) newName = \"_\" + newName;\n }\n\n if (newName !== name) {\n for (const path of paths) {\n deep(ast, path, identifier(newName));\n }\n }\n }\n\n for (const [name, paths] of Object.entries(dependencies)) {\n const ref =\n (typeof getDependency === \"function\" && getDependency(name)) ||\n identifier(name);\n for (const path of paths) {\n deep(ast, path, cloneNode(ref));\n }\n }\n\n adjustAst?.(ast, exportName, map => {\n exportBindingAssignments.forEach(p => deep(ast, p, map(deep(ast, p))));\n });\n}\n\ninterface HelperData {\n build: (\n getDependency: GetDependency | undefined,\n bindingName: string | undefined,\n localBindings: string[] | undefined,\n adjustAst: AdjustAst | undefined,\n ) => {\n nodes: t.Program[\"body\"];\n globals: string[];\n };\n minVersion: string;\n getDependencies: () => string[];\n}\n\nconst helperData: Record = Object.create(null);\nfunction loadHelper(name: string) {\n if (!helperData[name]) {\n const helper = helpers[name];\n if (!helper) {\n throw Object.assign(new ReferenceError(`Unknown helper ${name}`), {\n code: \"BABEL_HELPER_UNKNOWN\",\n helper: name,\n });\n }\n\n helperData[name] = {\n minVersion: helper.minVersion,\n build(getDependency, bindingName, localBindings, adjustAst) {\n const ast = helper.ast();\n permuteHelperAST(\n ast,\n helper.metadata,\n bindingName,\n localBindings,\n getDependency,\n adjustAst,\n );\n\n return {\n nodes: ast.body,\n globals: helper.metadata.globals,\n };\n },\n getDependencies() {\n return Object.keys(helper.metadata.dependencies);\n },\n };\n }\n\n return helperData[name];\n}\n\nexport function get(\n name: string,\n getDependency?: GetDependency,\n bindingName?: string,\n localBindings?: string[],\n adjustAst?: AdjustAst,\n) {\n if (!process.env.BABEL_8_BREAKING) {\n // In older versions, bindingName was a t.Identifier | t.MemberExpression\n if (typeof bindingName === \"object\") {\n const id = bindingName as t.Identifier | t.MemberExpression | null;\n if (id?.type === \"Identifier\") {\n bindingName = id.name;\n } else {\n bindingName = undefined;\n }\n }\n }\n return loadHelper(name).build(\n getDependency,\n bindingName,\n localBindings,\n adjustAst,\n );\n}\n\nexport function minVersion(name: string) {\n return loadHelper(name).minVersion;\n}\n\nexport function getDependencies(name: string): ReadonlyArray {\n return loadHelper(name).getDependencies();\n}\n\nexport function isInternal(name: string): boolean {\n return helpers[name]?.metadata.internal;\n}\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM) {\n // eslint-disable-next-line no-restricted-globals\n exports.ensure = (name: string) => {\n loadHelper(name);\n };\n}\n\nexport const list = Object.keys(helpers).map(name => name.replace(/^_/, \"\"));\n\nexport default get;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAA6C;EAFpCE,SAAS;EAAEC;AAAU,IAAAJ,EAAA;AAO9B,SAASK,IAAIA,CAACC,GAAQ,EAAEC,IAAY,EAAEC,KAAe,EAAE;EACrD,IAAI;IACF,MAAMC,KAAK,GAAGF,IAAI,CAACG,KAAK,CAAC,GAAG,CAAC;IAC7B,IAAIC,IAAI,GAAGF,KAAK,CAACG,KAAK,CAAC,CAAC;IACxB,OAAOH,KAAK,CAACI,MAAM,GAAG,CAAC,EAAE;MACvBP,GAAG,GAAGA,GAAG,CAACK,IAAI,CAAC;MACfA,IAAI,GAAGF,KAAK,CAACG,KAAK,CAAC,CAAC;IACtB;IACA,IAAIE,SAAS,CAACD,MAAM,GAAG,CAAC,EAAE;MACxBP,GAAG,CAACK,IAAI,CAAC,GAAGH,KAAK;IACnB,CAAC,MAAM;MACL,OAAOF,GAAG,CAACK,IAAI,CAAC;IAClB;EACF,CAAC,CAAC,OAAOI,CAAC,E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,IAAY,IAAK;IACjCe,UAAU,CAACf,IAAI,CAAC;EAClB,CAAC;AACH;AAEO,MAAMoC,IAAI,GAAAF,OAAA,CAAAE,IAAA,GAAGlC,MAAM,CAACG,IAAI,CAACY,yBAAO,CAAC,CAACX,GAAG,CAACN,IAAI,IAAIA,IAAI,CAACqC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAAK,OAAA,GAE9DZ,GAAG","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helpers/package.json b/node_modules/@babel/helpers/package.json new file mode 100644 index 0000000..621c19a --- /dev/null +++ b/node_modules/@babel/helpers/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/helpers", + "version": "7.28.4", + "description": "Collection of helper functions used by Babel transforms.", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-helpers", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helpers" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "devDependencies": { + "@babel/generator": "^7.28.3", + "@babel/helper-plugin-test-runner": "^7.27.1", + "@babel/parser": "^7.28.4", + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/parser/CHANGELOG.md b/node_modules/@babel/parser/CHANGELOG.md new file mode 100644 index 0000000..b3840ac --- /dev/null +++ b/node_modules/@babel/parser/CHANGELOG.md @@ -0,0 +1,1073 @@ +# Changelog + +> **Tags:** +> - :boom: [Breaking Change] +> - :eyeglasses: [Spec Compliance] +> - :rocket: [New Feature] +> - :bug: [Bug Fix] +> - :memo: [Documentation] +> - :house: [Internal] +> - :nail_care: [Polish] + +> Semver Policy: https://github.com/babel/babel/tree/main/packages/babel-parser#semver + +_Note: Gaps between patch versions are faulty, broken or test releases._ + +See the [Babel Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) for the pre-6.8.0 version Changelog. + +## 6.17.1 (2017-05-10) + +### :bug: Bug Fix + * Fix typo in flow spread operator error (Brian Ng) + * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko) + * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko) + * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng) + * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng) + * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng) + * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng) + +## 6.17.0 (2017-04-20) + +### :bug: Bug Fix + * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie) + * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons) + * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng) + * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons) + * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng) + * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng) + +## 7.0.0-beta.8 (2017-04-04) + +### New Feature +* Add support for flow type spread (#418) (Conrad Buck) +* Allow statics in flow interfaces (#427) (Brian Ng) + +### Bug Fix +* Fix predicate attachment to match flow parser (#428) (Brian Ng) +* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray) +* Fix rest parameters with array and objects (#424) (Brian Ng) +* Fix number parser (#433) (Alex Kuzmenko) + +### Docs +* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko) + +### Internal +* Use babel-register script when running babel smoke tests (#442) (Brian Ng) + +## 7.0.0-beta.7 (2017-03-22) + +### Spec Compliance +* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) + +### Bug Fix + +* Fix push-pop logic in flow (#405) (Daniel Tschinder) + +## 7.0.0-beta.6 (2017-03-21) + +### New Feature +* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons) + +### Polish +* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal) + +### Docs + +* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning) + +## 7.0.0-beta.5 (2017-03-21) + +### Bug Fix +* Throw error if new.target is used outside of a function (#402) (Brian Ng) +* Fix parsing of class properties (#351) (Kevin Gibbons) + +### Other + * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy) + * Optimize travis builds (#419) (Daniel Tschinder) + * Update codecov to 2.0 (#412) (Daniel Tschinder) + * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy) + * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning) + * Upgrade flow to 0.41 (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * Update yarn lock (Daniel Tschinder) + * Fix watch command (#403) (Brian Ng) + * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot]) + * Add estree test for correct order of directives (Daniel Tschinder) + * Add DoExpression to spec (#364) (Alex Kuzmenko) + * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde) + * Explain how to run only one test (#389) [skip ci] (Aaron Ang) + + ## 7.0.0-beta.4 (2017-03-01) + +* Don't consume async when checking for async func decl (#377) (Brian Ng) +* add `ranges` option [skip ci] (Henry Zhu) +* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine) + +## 7.0.0-beta.3 (2017-02-28) + +- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384) +- Merge changes from 6.x + +## 7.0.0-beta.2 (2017-02-20) + +- estree: correctly change literals in all cases (#368) (Daniel Tschinder) + +## 7.0.0-beta.1 (2017-02-20) + +- Fix negative number literal typeannotations (#366) (Daniel Tschinder) +- Update contributing with more test info [skip ci] (#355) (Brian Ng) + +## 7.0.0-beta.0 (2017-02-15) + +- Reintroduce Variance node (#333) (Daniel Tschinder) +- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick) +- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail) +- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot]) +- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot]) +- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder) +- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi) +- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder) +- Remove classConstructorCall plugin (#291) (Brian Ng) +- Update yarn.lock (Daniel Tschinder) +- Update cross-env to 3.x (Daniel Tschinder) +- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov) +- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens) + +## 6.16.1 (2017-02-23) + +### :bug: Regression + +- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375)) + +Need to modify Babel for this AST node change, so moving to 7.0. + +- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376)) + +[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted. + +## 6.16.0 (2017-02-23) + +### :rocket: New Feature + +***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder) + +We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/) + +We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc. + +To enable `estree` mode simply add the plugin in the config: +```json +{ + "plugins": [ "estree" ] +} +``` + +If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned. + +Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew) + +Babylon exports a new function to parse a single expression + +```js +import { parseExpression } from 'babylon'; + +const ast = parseExpression('x || y && z', options); +``` + +The returned AST will only consist of the expression. The options are the same as for `parse()` + +Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu) + +A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`. +Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ... + +Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris) + +Added support for function predicates which flow introduced in version 0.33.0 + +```js +declare function is_number(x: mixed): boolean %checks(typeof x === "number"); +``` + +Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder) + +Added support for imports within module declarations which flow introduced in version 0.37.0 + +```js +declare module "C" { + import type { DT } from "D"; + declare export type CT = { D: DT }; +} +``` + +### :eyeglasses: Spec Compliance + +Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) + +This example now correctly throws an error when there is a semicolon after the decorator: + +```js +class A { +@a; +foo(){} +} +``` + +Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder) + +Using keywords in imports is not allowed anymore: + +```js +import { default } from "foo"; +import { a as debugger } from "foo"; +``` + +Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder) + +In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration. + +Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder) + +The following code now correctly throws an error + +```js +import type { type a } from "foo"; +``` + +Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine) + +Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour. + +If you enable the flow plugin you can only define the type of the class properties, but not initialize them. + +Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder) + +Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`. + +```js +export default async function bar() {}; +``` + +### :nail_care: Polish + +Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng) + +### :bug: Bug Fix + +Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder) + +Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng) + +ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder) + +Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder) + +Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder) + +Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder) + +Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng) + +Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper) + + +### :house: Internal + +Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray) + +Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray) + +Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder) + +chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot]) + +Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder) + +Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot]) + +Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot]) + +devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo) + +Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder) + +Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder) + +### :memo: Documentation + +Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng) + +Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu) + +Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro) + +AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens) + +## 6.15.0 (2017-01-10) + +### :eyeglasses: Spec Compliance + +Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) + +This change implements flows new shorthand import syntax +and where previously you had to write this code: + +```js +import {someValue} from "blah"; +import type {someType} from "blah"; +import typeof {someOtherValue} from "blah"; +``` + +you can now write it like this: + +```js +import { + someValue, + type someType, + typeof someOtherValue, +} from "blah"; +``` + +For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request. + +flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin) + +This change now allows a leading pipe everywhere types can be used: +```js +var f = (x): | 1 | 2 => 1; +``` + +Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo) + +Previously babylon parsed the following exports, although they are not valid: +```js +export typeof foo; +export new Foo(); +export function() {}; +export for (;;); +export while(foo); +``` + +### :bug: Bug Fix + +Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin) + +This fixes parsing of this case: + +```js +const map = { + [age <= 17] : 'Too young' +}; +``` + +Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long) + +The following case produced an invalid AST +```js +
{/* foo */}
+``` + +Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy) + +When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST. + +Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant) + +Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray) + +### :house: Internal + +User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder) + +Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo) + +Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine) + +Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder) + +Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine) + +Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU) + +Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot]) + +chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot]) + +chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot]) + +## 6.14.1 (2016-11-17) + +### :bug: Bug Fix + +Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder) + +```js +{ + "plugins": ["*"] +} +``` + +Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer. + +## 6.14.0 (2016-11-16) + +### :eyeglasses: Spec Compliance + +Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) + +[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words) + +Babylon will throw for more reserved words such as `enum` or `await` (in strict mode). + +``` +class enum {} // throws +class await {} // throws in strict mode (module) +``` + +Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi) + +So where you used to have to write + +```js +type A = (x: string, y: boolean) => number; +type B = (z: string) => number; +type C = { [key: string]: number }; +``` + +you can now write (with flow 0.34.0) + +```js +type A = (string, boolean) => number; +type B = string => number; +type C = { [string]: number }; +``` + +Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner) + +Supports these form now of specifying array types: + +```js +var a: number[][][][]; +var b: string[][]; +``` + +### :bug: Bug Fix + +Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder) + +``` +declare module "foo" { declare module.exports: number } +declare module "foo" { declare module.exports: number; } // also allowed now +``` + +### :house: Internal + + * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman) + * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger) + * Add node 7 (Daniel Tschinder) + * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper) + +## v6.13.1 (2016-10-26) + +### :nail_care: Polish + +- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML)) + +```js +const babylon = require('babylon'); +const ast = babylon.parse('var foo = "lol";'); +``` + +With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph. + +**Without bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png) + +**With bundling** +![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png) + +- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu) +- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu) + +## v6.13.0 (2016-10-21) + +### :eyeglasses: Spec Compliance + +Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) + +> See https://flowtype.org/docs/variance.html for more information + +```js +type T = { +p: T }; +interface T { -p: T }; +declare class T { +[k:K]: V }; +class T { -[k:K]: V }; +class C2 { +p: T = e }; +``` + +Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman) + +```js +({ __proto__: 1, __proto__: 2 }) // Throws an error now +``` + +### :bug: Bug Fix + +Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman) + +```js +declare class A { + static: T; +} +``` + +Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine) + +```js +var foo = { async, bar }; +``` + +### :nail_care: Polish + +Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder) + +> This improves the performance slightly (because of hidden classes) + +### :house: Internal + +Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman) + +Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman) + +Readd missin .eslinignore for IDEs (Daniel Tschinder) + +Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman) + +Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman) + +Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman) + +## v6.12.0 (2016-10-14) + +### :eyeglasses: Spec Compliance + +Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) + +#### Dynamic Import + +- Proposal Repo: https://github.com/domenic/proposal-dynamic-import +- Championed by [@domenic](https://github.com/domenic) +- stage-2 +- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import) + +> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript + +```js +import(`./section-modules/${link.dataset.entryModule}.js`) +.then(module => { + module.loadPageInto(main); +}) +``` + +Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman) + +#### EmptyTypeAnnotation + +Just wasn't covered before. + +```js +type T = empty; +``` + +### :bug: Bug Fix + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing due to sparse array +export const { foo: [ ,, qux7 ] } = bar; +``` + +Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper) + +```js +declare class X { + foobar(): void; + static foobar(): void; +} +``` + +Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper) + +```js +class Foo { + delete(item: T): T { + return item; + } +} +``` + +Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder) + +```js +function *foo() { + const x = (yield 5: any); +} +``` + +### :nail_care: Polish + +Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman) + +```js +// Unexpected token, expected ; (1:6) +{ set 1 } +``` + +### :house: Internal + +Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder) + +Also run flow, linting, babel tests on separate instances (add back node 0.10) + +## v6.11.6 (2016-10-12) + +### :bug: Bug Fix/Regression + +Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels) + +```js +// was failing with `Cannot read property 'type' of null` because of null identifiers +export const { foo: [ ,, qux7 ] } = bar; +``` + +## v6.11.5 (2016-10-12) + +### :eyeglasses: Spec Compliance + +Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:20) +export function foo() {}; +export const { a: [{foo}] } = bar; +``` + +Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo) + +```js +// `foo` has already been exported. Exported identifiers must be unique. (2:22) +export const foo = 1; +export const [bar, ...foo] = baz; +``` + +### :bug: Bug Fix + +Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo) + +```js +// this is ok now +const test = ({async = true}) => {}; +``` + +### :nail_care: Polish + +Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder) + +```bash +# So in the case of a missing ending curly (`}`) +Module build failed: SyntaxError: Unexpected token, expected } (30:0) + 28 | } + 29 | +> 30 | + | ^ +``` + +## v6.11.4 (2016-10-03) + +Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) + +## v6.11.3 (2016-10-01) + +### :eyeglasses: Spec Compliance + +Add static errors for object rest (#149) ([@danez](https://github.com/danez)) + +> https://github.com/sebmarkbage/ecmascript-rest-spread + +Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right. + +```js +let { x, y, ...z } = { x: 1, y: 2, z: 3 }; +// x = 1 +// y = 2 +// z = { z: 3 } +``` + +#### New Syntax Errors: + +**SyntaxError**: The rest element has to be the last element when destructuring (1:10) +```bash +> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = { x: 1, y: 2, z: 3 } +# y = 2 +# z = 3 +``` + +Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think. + +**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13) + +```bash +> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3}; + | ^ +# Previous behavior: +# x = 1 +# y = { y: 2, z: 3 } +# z = { y: 2, z: 3 } +``` + +Before y and z would just be the same value anyway so there is no reason to need to have both. + +**SyntaxError**: A trailing comma is not permitted after the rest element (1:16) + +```js +let { x, y, ...z, } = obj; +``` + +The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense. + +--- + +get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell)) + +```js +// valid +function something({ set = null, get = null }) {} +``` + +## v6.11.2 (2016-09-23) + +### Bug Fix + +- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo + +```js +// regression with duplicate export check +SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13) + 20 | + 21 | export const { rhythm } = typography; +> 22 | export const { TypographyStyle } = typography +``` + +Bail out for now, and make a change to account for destructuring in the next release. + +## 6.11.1 (2016-09-22) + +### Bug Fix +- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez + +```javascript +export toString from './toString'; +``` + +```bash +`toString` has already been exported. Exported identifiers must be unique. (1:7) +> 1 | export toString from './toString'; + | ^ + 2 | +``` + +## 6.11.0 (2016-09-22) + +### Spec Compliance (will break CI) + +- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo + +```js +// Only one default export allowed per module. (2:9) +export default function() {}; +export { foo as default }; + +// Only one default export allowed per module. (2:0) +export default {}; +export default function() {}; + +// `Foo` has already been exported. Exported identifiers must be unique. (2:0) +export { Foo }; +export class Foo {}; +``` + +### New Feature (Syntax) + +- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88 + +```js +// AST +interface ClassProperty <: Node { + type: "ClassProperty"; + key: Identifier; + value: Expression; + computed: boolean; // added +} +``` + +```js +// with "plugins": ["classProperties"] +class Foo { + [x] + ['y'] +} + +class Bar { + [p] + [m] () {} +} + ``` + +### Bug Fix + +- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper + +```js +declare class X { + a: number; + static b: number; // static + c: number; // this was being marked as static in the AST as well +} +``` + +### Polish + +- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88 + +```js +// Used to error with: +// SyntaxError: Assigning to rvalue (1:0) + +// Now: +// Invalid left-hand side in assignment expression (1:0) +3 = 4 + +// Invalid left-hand side in for-in statement (1:5) +for (+i in {}); +``` + +### Internal + +- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez +- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo + +## 6.10.0 (2016-09-19) + +> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. + +### Spec Compliance + +* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) + +> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors + +More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists) + +For example: + +```js +// this errors because it uses destructuring and default parameters +// in a function with a "use strict" directive +function a([ option1, option2 ] = []) { + "use strict"; +} + ``` + +The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to. + +### New Feature + +* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer) + +Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8 + +Looks like: + +```js +var a : {| x: number, y: string |} = { x: 0, y: 'foo' }; +``` + +### Bug Fixes + +* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder) +* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper) +* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper) + +### Misc + +* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder) +* Fix Contributing guidelines [skip ci] (Daniel Tschinder) + +## 6.9.2 (2016-09-09) + +The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller. + +## 6.9.1 (2016-08-23) + +This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops. + +### Bug Fixes + +- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez +- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez +- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper +- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez +- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez + +## 6.9.0 (2016-08-16) + +### New syntax support + +- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer + +(Be aware that React is not going to support this syntax) + +```js +
+ {...todos.map(todo => )} +
+``` + +- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez + +```js +declare module "foo" { + declare module.exports: {} +} +``` + +### New Features + +- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain +- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens + +### Bug Fixes + +- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez +- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez +- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi +- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez +- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi +- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez +- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez + +### Internal + +- Add codecoverage to tests @danez +- Fix tests to not save expected output if we expect the test to fail @danez +- Make a shallow clone of babel for testing @danez +- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot +- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot +- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot +- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot + +## 6.8.4 (2016-07-06) + +### Bug Fixes + +- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez + +## 6.8.3 (2016-07-02) + +### Bug Fixes + +- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez + +## 6.8.2 (2016-06-24) + +### Bug Fixes + +- Fix parse error with yielding jsx elements in generators `function* it() { yield
; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal +- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez +- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez +- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez +- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez +- Support negative numeric type literals @kittens +- Remove line terminator restriction after await keyword @kittens +- Remove grouped type arrow restriction as it seems flow no longer has it @kittens +- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin +- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi + +### Documentation + +- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene +- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo + +### Internal + +- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez +- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez +- Upgrade test runner ava @kittens +- Add missing generate-identifier-regex script @kittens +- Rename parser context types @kittens +- Add node v6 to travis testing @hzoo +- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens + +## 6.8.1 (2016-06-06) + +### New Feature + +- Parse type parameter declarations with defaults like `type Foo = T` + +### Bug Fixes +- Type parameter declarations need 1 or more type parameters. +- The existential type `*` is not a valid type parameter. +- The existential type `*` is a primary type + +### Spec Compliance +- The param list for type parameter declarations now consists of `TypeParameter` nodes +- New `TypeParameter` AST Node (replaces using the `Identifier` node before) + +``` +interface TypeParameter <: Node { + bound: TypeAnnotation; + default: TypeAnnotation; + name: string; + variance: "plus" | "minus"; +} +``` + +## 6.8.0 (2016-05-02) + +#### New Feature + +##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12)) + +> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md). + +Examples: + +```js +class Foo { + constructor(@foo() x, @bar({ a: 123 }) @baz() y) {} +} + +export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {} + +var obj = { + method(@foo() x, @bar({ a: 123 }) @baz() y) {} +}; +``` + +##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17)) + +There is also a new node type, `ForAwaitStatement`. + +> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals). + +Example: + +```js +async function f() { + for await (let x of y); +} +``` diff --git a/node_modules/@babel/parser/LICENSE b/node_modules/@babel/parser/LICENSE new file mode 100644 index 0000000..d4c7fc5 --- /dev/null +++ b/node_modules/@babel/parser/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2014 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@babel/parser/README.md b/node_modules/@babel/parser/README.md new file mode 100644 index 0000000..a9463e8 --- /dev/null +++ b/node_modules/@babel/parser/README.md @@ -0,0 +1,19 @@ +# @babel/parser + +> A JavaScript parser + +See our website [@babel/parser](https://babeljs.io/docs/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/parser +``` + +or using yarn: + +```sh +yarn add @babel/parser --dev +``` diff --git a/node_modules/@babel/parser/bin/babel-parser.js b/node_modules/@babel/parser/bin/babel-parser.js new file mode 100644 index 0000000..4808c5e --- /dev/null +++ b/node_modules/@babel/parser/bin/babel-parser.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node +/* eslint-disable no-var, unicorn/prefer-node-protocol */ + +var parser = require(".."); +var fs = require("fs"); + +var filename = process.argv[2]; +if (!filename) { + console.error("no filename specified"); +} else { + var file = fs.readFileSync(filename, "utf8"); + var ast = parser.parse(file); + + console.log(JSON.stringify(ast, null, " ")); +} diff --git a/node_modules/@babel/parser/lib/index.js b/node_modules/@babel/parser/lib/index.js new file mode 100644 index 0000000..1c6ff4c --- /dev/null +++ b/node_modules/@babel/parser/lib/index.js @@ -0,0 +1,14662 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +function _objectWithoutPropertiesLoose(r, e) { + if (null == r) return {}; + var t = {}; + for (var n in r) if ({}.hasOwnProperty.call(r, n)) { + if (-1 !== e.indexOf(n)) continue; + t[n] = r[n]; + } + return t; +} +class Position { + constructor(line, col, index) { + this.line = void 0; + this.column = void 0; + this.index = void 0; + this.line = line; + this.column = col; + this.index = index; + } +} +class SourceLocation { + constructor(start, end) { + this.start = void 0; + this.end = void 0; + this.filename = void 0; + this.identifierName = void 0; + this.start = start; + this.end = end; + } +} +function createPositionWithColumnOffset(position, columnOffset) { + const { + line, + column, + index + } = position; + return new Position(line, column + columnOffset, index + columnOffset); +} +const code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"; +var ModuleErrors = { + ImportMetaOutsideModule: { + message: `import.meta may appear only with 'sourceType: "module"'`, + code + }, + ImportOutsideModule: { + message: `'import' and 'export' may appear only with 'sourceType: "module"'`, + code + } +}; +const NodeDescriptions = { + ArrayPattern: "array destructuring pattern", + AssignmentExpression: "assignment expression", + AssignmentPattern: "assignment expression", + ArrowFunctionExpression: "arrow function expression", + ConditionalExpression: "conditional expression", + CatchClause: "catch clause", + ForOfStatement: "for-of statement", + ForInStatement: "for-in statement", + ForStatement: "for-loop", + FormalParameters: "function parameter list", + Identifier: "identifier", + ImportSpecifier: "import specifier", + ImportDefaultSpecifier: "import default specifier", + ImportNamespaceSpecifier: "import namespace specifier", + ObjectPattern: "object destructuring pattern", + ParenthesizedExpression: "parenthesized expression", + RestElement: "rest element", + UpdateExpression: { + true: "prefix operation", + false: "postfix operation" + }, + VariableDeclarator: "variable declaration", + YieldExpression: "yield expression" +}; +const toNodeDescription = node => node.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node.prefix}`] : NodeDescriptions[node.type]; +var StandardErrors = { + AccessorIsGenerator: ({ + kind + }) => `A ${kind}ter cannot be a generator.`, + ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", + AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", + AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", + AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", + AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", + AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", + AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", + BadGetterArity: "A 'get' accessor must not have any formal parameters.", + BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", + BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", + ConstructorClassField: "Classes may not have a field named 'constructor'.", + ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", + ConstructorIsAccessor: "Class constructor may not be an accessor.", + ConstructorIsAsync: "Constructor can't be an async function.", + ConstructorIsGenerator: "Constructor can't be a generator.", + DeclarationMissingInitializer: ({ + kind + }) => `Missing initializer in ${kind} declaration.`, + DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", + DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", + DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", + DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", + DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", + DecoratorSemicolon: "Decorators must not be followed by a semicolon.", + DecoratorStaticBlock: "Decorators can't be used with a static block.", + DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.', + DeletePrivateField: "Deleting a private field is not allowed.", + DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", + DuplicateConstructor: "Duplicate constructor in the same class.", + DuplicateDefaultExport: "Only one default export allowed per module.", + DuplicateExport: ({ + exportName + }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, + DuplicateProto: "Redefinition of __proto__ property.", + DuplicateRegExpFlags: "Duplicate regular expression flag.", + ElementAfterRest: "Rest element must be last element.", + EscapedCharNotAnIdentifier: "Invalid Unicode escape.", + ExportBindingIsString: ({ + localName, + exportName + }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, + ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", + ForInOfLoopInitializer: ({ + type + }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, + ForInUsing: "For-in loop may not start with 'using' declaration.", + ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", + ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", + GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", + IllegalBreakContinue: ({ + type + }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, + IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", + IllegalReturn: "'return' outside of function.", + ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.", + ImportBindingIsString: ({ + importName + }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, + ImportCallArity: `\`import()\` requires exactly one or two arguments.`, + ImportCallNotNewExpression: "Cannot use new with import(...).", + ImportCallSpreadArgument: "`...` is not allowed in `import()`.", + ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", + ImportReflectionHasAssertion: "`import module x` cannot have assertions.", + ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', + IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", + InvalidBigIntLiteral: "Invalid BigIntLiteral.", + InvalidCodePoint: "Code point out of bounds.", + InvalidCoverDiscardElement: "'void' must be followed by an expression when not used in a binding position.", + InvalidCoverInitializedName: "Invalid shorthand property initializer.", + InvalidDecimal: "Invalid decimal.", + InvalidDigit: ({ + radix + }) => `Expected number in radix ${radix}.`, + InvalidEscapeSequence: "Bad character escape sequence.", + InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", + InvalidEscapedReservedWord: ({ + reservedWord + }) => `Escape sequence in keyword ${reservedWord}.`, + InvalidIdentifier: ({ + identifierName + }) => `Invalid identifier ${identifierName}.`, + InvalidLhs: ({ + ancestor + }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, + InvalidLhsBinding: ({ + ancestor + }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, + InvalidLhsOptionalChaining: ({ + ancestor + }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`, + InvalidNumber: "Invalid number.", + InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", + InvalidOrUnexpectedToken: ({ + unexpected + }) => `Unexpected character '${unexpected}'.`, + InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", + InvalidPrivateFieldResolution: ({ + identifierName + }) => `Private name #${identifierName} is not defined.`, + InvalidPropertyBindingPattern: "Binding member expression.", + InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", + InvalidRestAssignmentPattern: "Invalid rest operator's argument.", + LabelRedeclaration: ({ + labelName + }) => `Label '${labelName}' is already declared.`, + LetInLexicalBinding: "'let' is disallowed as a lexically bound name.", + LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", + MalformedRegExpFlags: "Invalid regular expression flag.", + MissingClassName: "A class name is required.", + MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", + MissingSemicolon: "Missing semicolon.", + MissingPlugin: ({ + missingPlugin + }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, + MissingOneOfPlugins: ({ + missingPlugin + }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, + MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", + MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", + ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", + ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", + ModuleAttributesWithDuplicateKeys: ({ + key + }) => `Duplicate key "${key}" is not allowed in module attributes.`, + ModuleExportNameHasLoneSurrogate: ({ + surrogateCharCode + }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, + ModuleExportUndefined: ({ + localName + }) => `Export '${localName}' is not defined.`, + MultipleDefaultsInSwitch: "Multiple default clauses.", + NewlineAfterThrow: "Illegal newline after throw.", + NoCatchOrFinally: "Missing catch or finally clause.", + NumberIdentifier: "Identifier directly after number.", + NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", + ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", + OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", + OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", + OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", + ParamDupe: "Argument name clash.", + PatternHasAccessor: "Object pattern can't contain getter or setter.", + PatternHasMethod: "Object pattern can't contain methods.", + PrivateInExpectedIn: ({ + identifierName + }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, + PrivateNameRedeclaration: ({ + identifierName + }) => `Duplicate private name #${identifierName}.`, + RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + RecordNoProto: "'__proto__' is not allowed in Record expressions.", + RestTrailingComma: "Unexpected trailing comma after rest element.", + SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", + SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", + SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.', + StaticPrototype: "Classes may not have static property named prototype.", + SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", + SuperPrivateField: "Private fields can't be accessed on super.", + TrailingDecorator: "Decorators must be attached to a class element.", + TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", + TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", + UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', + UnexpectedDigitAfterHash: "Unexpected digit after hash token.", + UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", + UnexpectedKeyword: ({ + keyword + }) => `Unexpected keyword '${keyword}'.`, + UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", + UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", + UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", + UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", + UnexpectedPrivateField: "Unexpected private name.", + UnexpectedReservedWord: ({ + reservedWord + }) => `Unexpected reserved word '${reservedWord}'.`, + UnexpectedSuper: "'super' is only allowed in object methods and classes.", + UnexpectedToken: ({ + expected, + unexpected + }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, + UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", + UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.", + UnexpectedVoidPattern: "Unexpected void binding.", + UnsupportedBind: "Binding should be performed on object property.", + UnsupportedDecoratorExport: "A decorated export must export a class declaration.", + UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", + UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", + UnsupportedMetaProperty: ({ + target, + onlyValidPropertyName + }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, + UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", + UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", + UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", + UnterminatedComment: "Unterminated comment.", + UnterminatedRegExp: "Unterminated regular expression.", + UnterminatedString: "Unterminated string constant.", + UnterminatedTemplate: "Unterminated template.", + UsingDeclarationExport: "Using declaration cannot be exported.", + UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", + VarRedeclaration: ({ + identifierName + }) => `Identifier '${identifierName}' has already been declared.`, + VoidPatternCatchClauseParam: "A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.", + VoidPatternInitializer: "A void binding may not have an initializer.", + YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", + YieldInParameter: "Yield expression is not allowed in formal parameters.", + YieldNotInGeneratorFunction: "'yield' is only allowed within generator functions.", + ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." +}; +var StrictModeErrors = { + StrictDelete: "Deleting local variable in strict mode.", + StrictEvalArguments: ({ + referenceName + }) => `Assigning to '${referenceName}' in strict mode.`, + StrictEvalArgumentsBinding: ({ + bindingName + }) => `Binding '${bindingName}' in strict mode.`, + StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", + StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", + StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", + StrictWith: "'with' in strict mode." +}; +var ParseExpressionErrors = { + ParseExpressionEmptyInput: "Unexpected parseExpression() input: The input is empty or contains only comments.", + ParseExpressionExpectsEOF: ({ + unexpected + }) => `Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(unexpected)}\`.` +}; +const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); +var PipelineOperatorErrors = Object.assign({ + PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", + PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', + PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", + PipeTopicUnconfiguredToken: ({ + token + }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, + PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", + PipeUnparenthesizedBody: ({ + type + }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ + type + })}; please wrap it in parentheses.` +}, { + PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', + PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", + PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", + PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", + PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", + PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' +}); +const _excluded = ["message"]; +function defineHidden(obj, key, value) { + Object.defineProperty(obj, key, { + enumerable: false, + configurable: true, + value + }); +} +function toParseErrorConstructor({ + toMessage, + code, + reasonCode, + syntaxPlugin +}) { + const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins"; + { + const oldReasonCodes = { + AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter", + AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters", + ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference", + SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter", + SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter", + SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType" + }; + if (oldReasonCodes[reasonCode]) { + reasonCode = oldReasonCodes[reasonCode]; + } + } + return function constructor(loc, details) { + const error = new SyntaxError(); + error.code = code; + error.reasonCode = reasonCode; + error.loc = loc; + error.pos = loc.index; + error.syntaxPlugin = syntaxPlugin; + if (hasMissingPlugin) { + error.missingPlugin = details.missingPlugin; + } + defineHidden(error, "clone", function clone(overrides = {}) { + var _overrides$loc; + const { + line, + column, + index + } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc; + return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details)); + }); + defineHidden(error, "details", details); + Object.defineProperty(error, "message", { + configurable: true, + get() { + const message = `${toMessage(details)} (${loc.line}:${loc.column})`; + this.message = message; + return message; + }, + set(value) { + Object.defineProperty(this, "message", { + value, + writable: true + }); + } + }); + return error; + }; +} +function ParseErrorEnum(argument, syntaxPlugin) { + if (Array.isArray(argument)) { + return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); + } + const ParseErrorConstructors = {}; + for (const reasonCode of Object.keys(argument)) { + const template = argument[reasonCode]; + const _ref = typeof template === "string" ? { + message: () => template + } : typeof template === "function" ? { + message: template + } : template, + { + message + } = _ref, + rest = _objectWithoutPropertiesLoose(_ref, _excluded); + const toMessage = typeof message === "string" ? () => message : message; + ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ + code: "BABEL_PARSER_SYNTAX_ERROR", + reasonCode, + toMessage + }, syntaxPlugin ? { + syntaxPlugin + } : {}, rest)); + } + return ParseErrorConstructors; +} +const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum(ParseExpressionErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); +function createDefaultOptions() { + return { + sourceType: "script", + sourceFilename: undefined, + startIndex: 0, + startColumn: 0, + startLine: 1, + allowAwaitOutsideFunction: false, + allowReturnOutsideFunction: false, + allowNewTargetOutsideFunction: false, + allowImportExportEverywhere: false, + allowSuperOutsideMethod: false, + allowUndeclaredExports: false, + allowYieldOutsideFunction: false, + plugins: [], + strictMode: undefined, + ranges: false, + tokens: false, + createImportExpressions: false, + createParenthesizedExpressions: false, + errorRecovery: false, + attachComment: true, + annexB: true + }; +} +function getOptions(opts) { + const options = createDefaultOptions(); + if (opts == null) { + return options; + } + if (opts.annexB != null && opts.annexB !== false) { + throw new Error("The `annexB` option can only be set to `false`."); + } + for (const key of Object.keys(options)) { + if (opts[key] != null) options[key] = opts[key]; + } + if (options.startLine === 1) { + if (opts.startIndex == null && options.startColumn > 0) { + options.startIndex = options.startColumn; + } else if (opts.startColumn == null && options.startIndex > 0) { + options.startColumn = options.startIndex; + } + } else if (opts.startColumn == null || opts.startIndex == null) { + if (opts.startIndex != null) { + throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`."); + } + } + if (options.sourceType === "commonjs") { + if (opts.allowAwaitOutsideFunction != null) { + throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`."); + } + if (opts.allowReturnOutsideFunction != null) { + throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`."); + } + if (opts.allowNewTargetOutsideFunction != null) { + throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`."); + } + } + return options; +} +const { + defineProperty +} = Object; +const toUnenumerable = (object, key) => { + if (object) { + defineProperty(object, key, { + enumerable: false, + value: object[key] + }); + } +}; +function toESTreeLocation(node) { + toUnenumerable(node.loc.start, "index"); + toUnenumerable(node.loc.end, "index"); + return node; +} +var estree = superClass => class ESTreeParserMixin extends superClass { + parse() { + const file = toESTreeLocation(super.parse()); + if (this.optionFlags & 256) { + file.tokens = file.tokens.map(toESTreeLocation); + } + return file; + } + parseRegExpLiteral({ + pattern, + flags + }) { + let regex = null; + try { + regex = new RegExp(pattern, flags); + } catch (_) {} + const node = this.estreeParseLiteral(regex); + node.regex = { + pattern, + flags + }; + return node; + } + parseBigIntLiteral(value) { + let bigInt; + try { + bigInt = BigInt(value); + } catch (_unused) { + bigInt = null; + } + const node = this.estreeParseLiteral(bigInt); + node.bigint = String(node.value || value); + return node; + } + parseDecimalLiteral(value) { + const decimal = null; + const node = this.estreeParseLiteral(decimal); + node.decimal = String(node.value || value); + return node; + } + estreeParseLiteral(value) { + return this.parseLiteral(value, "Literal"); + } + parseStringLiteral(value) { + return this.estreeParseLiteral(value); + } + parseNumericLiteral(value) { + return this.estreeParseLiteral(value); + } + parseNullLiteral() { + return this.estreeParseLiteral(null); + } + parseBooleanLiteral(value) { + return this.estreeParseLiteral(value); + } + estreeParseChainExpression(node, endLoc) { + const chain = this.startNodeAtNode(node); + chain.expression = node; + return this.finishNodeAt(chain, "ChainExpression", endLoc); + } + directiveToStmt(directive) { + const expression = directive.value; + delete directive.value; + this.castNodeTo(expression, "Literal"); + expression.raw = expression.extra.raw; + expression.value = expression.extra.expressionValue; + const stmt = this.castNodeTo(directive, "ExpressionStatement"); + stmt.expression = expression; + stmt.directive = expression.extra.rawValue; + delete expression.extra; + return stmt; + } + fillOptionalPropertiesForTSESLint(node) {} + cloneEstreeStringLiteral(node) { + const { + start, + end, + loc, + range, + raw, + value + } = node; + const cloned = Object.create(node.constructor.prototype); + cloned.type = "Literal"; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.raw = raw; + cloned.value = value; + return cloned; + } + initFunction(node, isAsync) { + super.initFunction(node, isAsync); + node.expression = false; + } + checkDeclaration(node) { + if (node != null && this.isObjectProperty(node)) { + this.checkDeclaration(node.value); + } else { + super.checkDeclaration(node); + } + } + getObjectOrClassMethodParams(method) { + return method.value.params; + } + isValidDirective(stmt) { + var _stmt$expression$extr; + return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); + } + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { + super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); + const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); + node.body = directiveStatements.concat(node.body); + delete node.directives; + } + parsePrivateName() { + const node = super.parsePrivateName(); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return node; + } + } + return this.convertPrivateNameToPrivateIdentifier(node); + } + convertPrivateNameToPrivateIdentifier(node) { + const name = super.getPrivateNameSV(node); + delete node.id; + node.name = name; + return this.castNodeTo(node, "PrivateIdentifier"); + } + isPrivateName(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.isPrivateName(node); + } + } + return node.type === "PrivateIdentifier"; + } + getPrivateNameSV(node) { + { + if (!this.getPluginOption("estree", "classFeatures")) { + return super.getPrivateNameSV(node); + } + } + return node.name; + } + parseLiteral(value, type) { + const node = super.parseLiteral(value, type); + node.raw = node.extra.raw; + delete node.extra; + return node; + } + parseFunctionBody(node, allowExpression, isMethod = false) { + super.parseFunctionBody(node, allowExpression, isMethod); + node.expression = node.body.type !== "BlockStatement"; + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + let funcNode = this.startNode(); + funcNode.kind = node.kind; + funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); + delete funcNode.kind; + const { + typeParameters + } = node; + if (typeParameters) { + delete node.typeParameters; + funcNode.typeParameters = typeParameters; + this.resetStartLocationFromNode(funcNode, typeParameters); + } + const valueNode = this.castNodeTo(funcNode, "FunctionExpression"); + node.value = valueNode; + if (type === "ClassPrivateMethod") { + node.computed = false; + } + if (type === "ObjectMethod") { + if (node.kind === "method") { + node.kind = "init"; + } + node.shorthand = false; + return this.finishNode(node, "Property"); + } else { + return this.finishNode(node, "MethodDefinition"); + } + } + nameIsConstructor(key) { + if (key.type === "Literal") return key.value === "constructor"; + return super.nameIsConstructor(key); + } + parseClassProperty(...args) { + const propertyNode = super.parseClassProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + { + this.castNodeTo(propertyNode, "PropertyDefinition"); + } + return propertyNode; + } + parseClassPrivateProperty(...args) { + const propertyNode = super.parseClassPrivateProperty(...args); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return propertyNode; + } + } + { + this.castNodeTo(propertyNode, "PropertyDefinition"); + } + propertyNode.computed = false; + return propertyNode; + } + parseClassAccessorProperty(node) { + const accessorPropertyNode = super.parseClassAccessorProperty(node); + { + if (!this.getPluginOption("estree", "classFeatures")) { + return accessorPropertyNode; + } + } + if (accessorPropertyNode.abstract && this.hasPlugin("typescript")) { + delete accessorPropertyNode.abstract; + this.castNodeTo(accessorPropertyNode, "TSAbstractAccessorProperty"); + } else { + this.castNodeTo(accessorPropertyNode, "AccessorProperty"); + } + return accessorPropertyNode; + } + parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { + const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); + if (node) { + node.kind = "init"; + this.castNodeTo(node, "Property"); + } + return node; + } + finishObjectProperty(node) { + node.kind = "init"; + return this.finishNode(node, "Property"); + } + isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) { + return type === "Property" ? "value" : super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding); + } + isAssignable(node, isBinding) { + if (node != null && this.isObjectProperty(node)) { + return this.isAssignable(node.value, isBinding); + } + return super.isAssignable(node, isBinding); + } + toAssignable(node, isLHS = false) { + if (node != null && this.isObjectProperty(node)) { + const { + key, + value + } = node; + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + this.toAssignable(value, isLHS); + } else { + super.toAssignable(node, isLHS); + } + } + toAssignableObjectExpressionProp(prop, isLast, isLHS) { + if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) { + this.raise(Errors.PatternHasAccessor, prop.key); + } else if (prop.type === "Property" && prop.method) { + this.raise(Errors.PatternHasMethod, prop.key); + } else { + super.toAssignableObjectExpressionProp(prop, isLast, isLHS); + } + } + finishCallExpression(unfinished, optional) { + const node = super.finishCallExpression(unfinished, optional); + if (node.callee.type === "Import") { + var _ref; + this.castNodeTo(node, "ImportExpression"); + node.source = node.arguments[0]; + node.options = (_ref = node.arguments[1]) != null ? _ref : null; + { + var _ref2; + node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; + } + delete node.arguments; + delete node.callee; + } else if (node.type === "OptionalCallExpression") { + this.castNodeTo(node, "CallExpression"); + } else { + node.optional = false; + } + return node; + } + toReferencedArguments(node) { + if (node.type === "ImportExpression") { + return; + } + super.toReferencedArguments(node); + } + parseExport(unfinished, decorators) { + const exportStartLoc = this.state.lastTokStartLoc; + const node = super.parseExport(unfinished, decorators); + switch (node.type) { + case "ExportAllDeclaration": + node.exported = null; + break; + case "ExportNamedDeclaration": + if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { + this.castNodeTo(node, "ExportAllDeclaration"); + node.exported = node.specifiers[0].exported; + delete node.specifiers; + } + case "ExportDefaultDeclaration": + { + var _declaration$decorato; + const { + declaration + } = node; + if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) { + this.resetStartLocation(node, exportStartLoc); + } + } + break; + } + return node; + } + stopParseSubscript(base, state) { + const node = super.stopParseSubscript(base, state); + if (state.optionalChainMember) { + return this.estreeParseChainExpression(node, base.loc.end); + } + return node; + } + parseMember(base, startLoc, state, computed, optional) { + const node = super.parseMember(base, startLoc, state, computed, optional); + if (node.type === "OptionalMemberExpression") { + this.castNodeTo(node, "MemberExpression"); + } else { + node.optional = false; + } + return node; + } + isOptionalMemberExpression(node) { + if (node.type === "ChainExpression") { + return node.expression.type === "MemberExpression"; + } + return super.isOptionalMemberExpression(node); + } + hasPropertyAsPrivateName(node) { + if (node.type === "ChainExpression") { + node = node.expression; + } + return super.hasPropertyAsPrivateName(node); + } + isObjectProperty(node) { + return node.type === "Property" && node.kind === "init" && !node.method; + } + isObjectMethod(node) { + return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set"); + } + castNodeTo(node, type) { + const result = super.castNodeTo(node, type); + this.fillOptionalPropertiesForTSESLint(result); + return result; + } + cloneIdentifier(node) { + const cloned = super.cloneIdentifier(node); + this.fillOptionalPropertiesForTSESLint(cloned); + return cloned; + } + cloneStringLiteral(node) { + if (node.type === "Literal") { + return this.cloneEstreeStringLiteral(node); + } + return super.cloneStringLiteral(node); + } + finishNodeAt(node, type, endLoc) { + return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); + } + finishNode(node, type) { + const result = super.finishNode(node, type); + this.fillOptionalPropertiesForTSESLint(result); + return result; + } + resetStartLocation(node, startLoc) { + super.resetStartLocation(node, startLoc); + toESTreeLocation(node); + } + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + super.resetEndLocation(node, endLoc); + toESTreeLocation(node); + } +}; +class TokContext { + constructor(token, preserveSpace) { + this.token = void 0; + this.preserveSpace = void 0; + this.token = token; + this.preserveSpace = !!preserveSpace; + } +} +const types = { + brace: new TokContext("{"), + j_oTag: new TokContext("...", true) +}; +{ + types.template = new TokContext("`", true); +} +const beforeExpr = true; +const startsExpr = true; +const isLoop = true; +const isAssign = true; +const prefix = true; +const postfix = true; +class ExportedTokenType { + constructor(label, conf = {}) { + this.label = void 0; + this.keyword = void 0; + this.beforeExpr = void 0; + this.startsExpr = void 0; + this.rightAssociative = void 0; + this.isLoop = void 0; + this.isAssign = void 0; + this.prefix = void 0; + this.postfix = void 0; + this.binop = void 0; + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.rightAssociative = !!conf.rightAssociative; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop != null ? conf.binop : null; + { + this.updateContext = null; + } + } +} +const keywords$1 = new Map(); +function createKeyword(name, options = {}) { + options.keyword = name; + const token = createToken(name, options); + keywords$1.set(name, token); + return token; +} +function createBinop(name, binop) { + return createToken(name, { + beforeExpr, + binop + }); +} +let tokenTypeCounter = -1; +const tokenTypes = []; +const tokenLabels = []; +const tokenBinops = []; +const tokenBeforeExprs = []; +const tokenStartsExprs = []; +const tokenPrefixes = []; +function createToken(name, options = {}) { + var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; + ++tokenTypeCounter; + tokenLabels.push(name); + tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); + tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); + tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); + tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); + tokenTypes.push(new ExportedTokenType(name, options)); + return tokenTypeCounter; +} +function createKeywordLike(name, options = {}) { + var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; + ++tokenTypeCounter; + keywords$1.set(name, tokenTypeCounter); + tokenLabels.push(name); + tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); + tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); + tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); + tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); + tokenTypes.push(new ExportedTokenType("name", options)); + return tokenTypeCounter; +} +const tt = { + bracketL: createToken("[", { + beforeExpr, + startsExpr + }), + bracketHashL: createToken("#[", { + beforeExpr, + startsExpr + }), + bracketBarL: createToken("[|", { + beforeExpr, + startsExpr + }), + bracketR: createToken("]"), + bracketBarR: createToken("|]"), + braceL: createToken("{", { + beforeExpr, + startsExpr + }), + braceBarL: createToken("{|", { + beforeExpr, + startsExpr + }), + braceHashL: createToken("#{", { + beforeExpr, + startsExpr + }), + braceR: createToken("}"), + braceBarR: createToken("|}"), + parenL: createToken("(", { + beforeExpr, + startsExpr + }), + parenR: createToken(")"), + comma: createToken(",", { + beforeExpr + }), + semi: createToken(";", { + beforeExpr + }), + colon: createToken(":", { + beforeExpr + }), + doubleColon: createToken("::", { + beforeExpr + }), + dot: createToken("."), + question: createToken("?", { + beforeExpr + }), + questionDot: createToken("?."), + arrow: createToken("=>", { + beforeExpr + }), + template: createToken("template"), + ellipsis: createToken("...", { + beforeExpr + }), + backQuote: createToken("`", { + startsExpr + }), + dollarBraceL: createToken("${", { + beforeExpr, + startsExpr + }), + templateTail: createToken("...`", { + startsExpr + }), + templateNonTail: createToken("...${", { + beforeExpr, + startsExpr + }), + at: createToken("@"), + hash: createToken("#", { + startsExpr + }), + interpreterDirective: createToken("#!..."), + eq: createToken("=", { + beforeExpr, + isAssign + }), + assign: createToken("_=", { + beforeExpr, + isAssign + }), + slashAssign: createToken("_=", { + beforeExpr, + isAssign + }), + xorAssign: createToken("_=", { + beforeExpr, + isAssign + }), + moduloAssign: createToken("_=", { + beforeExpr, + isAssign + }), + incDec: createToken("++/--", { + prefix, + postfix, + startsExpr + }), + bang: createToken("!", { + beforeExpr, + prefix, + startsExpr + }), + tilde: createToken("~", { + beforeExpr, + prefix, + startsExpr + }), + doubleCaret: createToken("^^", { + startsExpr + }), + doubleAt: createToken("@@", { + startsExpr + }), + pipeline: createBinop("|>", 0), + nullishCoalescing: createBinop("??", 1), + logicalOR: createBinop("||", 1), + logicalAND: createBinop("&&", 2), + bitwiseOR: createBinop("|", 3), + bitwiseXOR: createBinop("^", 4), + bitwiseAND: createBinop("&", 5), + equality: createBinop("==/!=/===/!==", 6), + lt: createBinop("/<=/>=", 7), + gt: createBinop("/<=/>=", 7), + relational: createBinop("/<=/>=", 7), + bitShift: createBinop("<>/>>>", 8), + bitShiftL: createBinop("<>/>>>", 8), + bitShiftR: createBinop("<>/>>>", 8), + plusMin: createToken("+/-", { + beforeExpr, + binop: 9, + prefix, + startsExpr + }), + modulo: createToken("%", { + binop: 10, + startsExpr + }), + star: createToken("*", { + binop: 10 + }), + slash: createBinop("/", 10), + exponent: createToken("**", { + beforeExpr, + binop: 11, + rightAssociative: true + }), + _in: createKeyword("in", { + beforeExpr, + binop: 7 + }), + _instanceof: createKeyword("instanceof", { + beforeExpr, + binop: 7 + }), + _break: createKeyword("break"), + _case: createKeyword("case", { + beforeExpr + }), + _catch: createKeyword("catch"), + _continue: createKeyword("continue"), + _debugger: createKeyword("debugger"), + _default: createKeyword("default", { + beforeExpr + }), + _else: createKeyword("else", { + beforeExpr + }), + _finally: createKeyword("finally"), + _function: createKeyword("function", { + startsExpr + }), + _if: createKeyword("if"), + _return: createKeyword("return", { + beforeExpr + }), + _switch: createKeyword("switch"), + _throw: createKeyword("throw", { + beforeExpr, + prefix, + startsExpr + }), + _try: createKeyword("try"), + _var: createKeyword("var"), + _const: createKeyword("const"), + _with: createKeyword("with"), + _new: createKeyword("new", { + beforeExpr, + startsExpr + }), + _this: createKeyword("this", { + startsExpr + }), + _super: createKeyword("super", { + startsExpr + }), + _class: createKeyword("class", { + startsExpr + }), + _extends: createKeyword("extends", { + beforeExpr + }), + _export: createKeyword("export"), + _import: createKeyword("import", { + startsExpr + }), + _null: createKeyword("null", { + startsExpr + }), + _true: createKeyword("true", { + startsExpr + }), + _false: createKeyword("false", { + startsExpr + }), + _typeof: createKeyword("typeof", { + beforeExpr, + prefix, + startsExpr + }), + _void: createKeyword("void", { + beforeExpr, + prefix, + startsExpr + }), + _delete: createKeyword("delete", { + beforeExpr, + prefix, + startsExpr + }), + _do: createKeyword("do", { + isLoop, + beforeExpr + }), + _for: createKeyword("for", { + isLoop + }), + _while: createKeyword("while", { + isLoop + }), + _as: createKeywordLike("as", { + startsExpr + }), + _assert: createKeywordLike("assert", { + startsExpr + }), + _async: createKeywordLike("async", { + startsExpr + }), + _await: createKeywordLike("await", { + startsExpr + }), + _defer: createKeywordLike("defer", { + startsExpr + }), + _from: createKeywordLike("from", { + startsExpr + }), + _get: createKeywordLike("get", { + startsExpr + }), + _let: createKeywordLike("let", { + startsExpr + }), + _meta: createKeywordLike("meta", { + startsExpr + }), + _of: createKeywordLike("of", { + startsExpr + }), + _sent: createKeywordLike("sent", { + startsExpr + }), + _set: createKeywordLike("set", { + startsExpr + }), + _source: createKeywordLike("source", { + startsExpr + }), + _static: createKeywordLike("static", { + startsExpr + }), + _using: createKeywordLike("using", { + startsExpr + }), + _yield: createKeywordLike("yield", { + startsExpr + }), + _asserts: createKeywordLike("asserts", { + startsExpr + }), + _checks: createKeywordLike("checks", { + startsExpr + }), + _exports: createKeywordLike("exports", { + startsExpr + }), + _global: createKeywordLike("global", { + startsExpr + }), + _implements: createKeywordLike("implements", { + startsExpr + }), + _intrinsic: createKeywordLike("intrinsic", { + startsExpr + }), + _infer: createKeywordLike("infer", { + startsExpr + }), + _is: createKeywordLike("is", { + startsExpr + }), + _mixins: createKeywordLike("mixins", { + startsExpr + }), + _proto: createKeywordLike("proto", { + startsExpr + }), + _require: createKeywordLike("require", { + startsExpr + }), + _satisfies: createKeywordLike("satisfies", { + startsExpr + }), + _keyof: createKeywordLike("keyof", { + startsExpr + }), + _readonly: createKeywordLike("readonly", { + startsExpr + }), + _unique: createKeywordLike("unique", { + startsExpr + }), + _abstract: createKeywordLike("abstract", { + startsExpr + }), + _declare: createKeywordLike("declare", { + startsExpr + }), + _enum: createKeywordLike("enum", { + startsExpr + }), + _module: createKeywordLike("module", { + startsExpr + }), + _namespace: createKeywordLike("namespace", { + startsExpr + }), + _interface: createKeywordLike("interface", { + startsExpr + }), + _type: createKeywordLike("type", { + startsExpr + }), + _opaque: createKeywordLike("opaque", { + startsExpr + }), + name: createToken("name", { + startsExpr + }), + placeholder: createToken("%%", { + startsExpr + }), + string: createToken("string", { + startsExpr + }), + num: createToken("num", { + startsExpr + }), + bigint: createToken("bigint", { + startsExpr + }), + decimal: createToken("decimal", { + startsExpr + }), + regexp: createToken("regexp", { + startsExpr + }), + privateName: createToken("#name", { + startsExpr + }), + eof: createToken("eof"), + jsxName: createToken("jsxName"), + jsxText: createToken("jsxText", { + beforeExpr + }), + jsxTagStart: createToken("jsxTagStart", { + startsExpr + }), + jsxTagEnd: createToken("jsxTagEnd") +}; +function tokenIsIdentifier(token) { + return token >= 93 && token <= 133; +} +function tokenKeywordOrIdentifierIsKeyword(token) { + return token <= 92; +} +function tokenIsKeywordOrIdentifier(token) { + return token >= 58 && token <= 133; +} +function tokenIsLiteralPropertyName(token) { + return token >= 58 && token <= 137; +} +function tokenComesBeforeExpression(token) { + return tokenBeforeExprs[token]; +} +function tokenCanStartExpression(token) { + return tokenStartsExprs[token]; +} +function tokenIsAssignment(token) { + return token >= 29 && token <= 33; +} +function tokenIsFlowInterfaceOrTypeOrOpaque(token) { + return token >= 129 && token <= 131; +} +function tokenIsLoop(token) { + return token >= 90 && token <= 92; +} +function tokenIsKeyword(token) { + return token >= 58 && token <= 92; +} +function tokenIsOperator(token) { + return token >= 39 && token <= 59; +} +function tokenIsPostfix(token) { + return token === 34; +} +function tokenIsPrefix(token) { + return tokenPrefixes[token]; +} +function tokenIsTSTypeOperator(token) { + return token >= 121 && token <= 123; +} +function tokenIsTSDeclarationStart(token) { + return token >= 124 && token <= 130; +} +function tokenLabelName(token) { + return tokenLabels[token]; +} +function tokenOperatorPrecedence(token) { + return tokenBinops[token]; +} +function tokenIsRightAssociative(token) { + return token === 57; +} +function tokenIsTemplate(token) { + return token >= 24 && token <= 25; +} +function getExportedToken(token) { + return tokenTypes[token]; +} +{ + tokenTypes[8].updateContext = context => { + context.pop(); + }; + tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { + context.push(types.brace); + }; + tokenTypes[22].updateContext = context => { + if (context[context.length - 1] === types.template) { + context.pop(); + } else { + context.push(types.template); + } + }; + tokenTypes[143].updateContext = context => { + context.push(types.j_expr, types.j_oTag); + }; +} +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088f\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7dc\ua7f1-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1add\u1ae0-\u1aeb\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +function isInAstralSet(code, set) { + let pos = 0x10000; + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + return false; +} +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} +function isKeyword(word) { + return keywords.has(word); +} +function isIteratorStart(current, next, next2) { + return current === 64 && next === 64 && isIdentifierStart(next2); +} +const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); +function canBeReservedWord(word) { + return reservedWordLikeSet.has(word); +} +class Scope { + constructor(flags) { + this.flags = 0; + this.names = new Map(); + this.firstLexicalName = ""; + this.flags = flags; + } +} +class ScopeHandler { + constructor(parser, inModule) { + this.parser = void 0; + this.scopeStack = []; + this.inModule = void 0; + this.undefinedExports = new Map(); + this.parser = parser; + this.inModule = inModule; + } + get inTopLevel() { + return (this.currentScope().flags & 1) > 0; + } + get inFunction() { + return (this.currentVarScopeFlags() & 2) > 0; + } + get allowSuper() { + return (this.currentThisScopeFlags() & 16) > 0; + } + get allowDirectSuper() { + return (this.currentThisScopeFlags() & 32) > 0; + } + get allowNewTarget() { + return (this.currentThisScopeFlags() & 512) > 0; + } + get inClass() { + return (this.currentThisScopeFlags() & 64) > 0; + } + get inClassAndNotInNonArrowFunction() { + const flags = this.currentThisScopeFlags(); + return (flags & 64) > 0 && (flags & 2) === 0; + } + get inStaticBlock() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & 128) { + return true; + } + if (flags & (1667 | 64)) { + return false; + } + } + } + get inNonArrowFunction() { + return (this.currentThisScopeFlags() & 2) > 0; + } + get inBareCaseStatement() { + return (this.currentScope().flags & 256) > 0; + } + get treatFunctionsAsVar() { + return this.treatFunctionsAsVarInScope(this.currentScope()); + } + createScope(flags) { + return new Scope(flags); + } + enter(flags) { + this.scopeStack.push(this.createScope(flags)); + } + exit() { + const scope = this.scopeStack.pop(); + return scope.flags; + } + treatFunctionsAsVarInScope(scope) { + return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1); + } + declareName(name, bindingType, loc) { + let scope = this.currentScope(); + if (bindingType & 8 || bindingType & 16) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + let type = scope.names.get(name) || 0; + if (bindingType & 16) { + type = type | 4; + } else { + if (!scope.firstLexicalName) { + scope.firstLexicalName = name; + } + type = type | 2; + } + scope.names.set(name, type); + if (bindingType & 8) { + this.maybeExportDefined(scope, name); + } + } else if (bindingType & 4) { + for (let i = this.scopeStack.length - 1; i >= 0; --i) { + scope = this.scopeStack[i]; + this.checkRedeclarationInScope(scope, name, bindingType, loc); + scope.names.set(name, (scope.names.get(name) || 0) | 1); + this.maybeExportDefined(scope, name); + if (scope.flags & 1667) break; + } + } + if (this.parser.inModule && scope.flags & 1) { + this.undefinedExports.delete(name); + } + } + maybeExportDefined(scope, name) { + if (this.parser.inModule && scope.flags & 1) { + this.undefinedExports.delete(name); + } + } + checkRedeclarationInScope(scope, name, bindingType, loc) { + if (this.isRedeclaredInScope(scope, name, bindingType)) { + this.parser.raise(Errors.VarRedeclaration, loc, { + identifierName: name + }); + } + } + isRedeclaredInScope(scope, name, bindingType) { + if (!(bindingType & 1)) return false; + if (bindingType & 8) { + return scope.names.has(name); + } + const type = scope.names.get(name) || 0; + if (bindingType & 16) { + return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0; + } + return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0; + } + checkLocalExport(id) { + const { + name + } = id; + const topLevelScope = this.scopeStack[0]; + if (!topLevelScope.names.has(name)) { + this.undefinedExports.set(name, id.loc.start); + } + } + currentScope() { + return this.scopeStack[this.scopeStack.length - 1]; + } + currentVarScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & 1667) { + return flags; + } + } + } + currentThisScopeFlags() { + for (let i = this.scopeStack.length - 1;; i--) { + const { + flags + } = this.scopeStack[i]; + if (flags & (1667 | 64) && !(flags & 4)) { + return flags; + } + } + } +} +class FlowScope extends Scope { + constructor(...args) { + super(...args); + this.declareFunctions = new Set(); + } +} +class FlowScopeHandler extends ScopeHandler { + createScope(flags) { + return new FlowScope(flags); + } + declareName(name, bindingType, loc) { + const scope = this.currentScope(); + if (bindingType & 2048) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + scope.declareFunctions.add(name); + return; + } + super.declareName(name, bindingType, loc); + } + isRedeclaredInScope(scope, name, bindingType) { + if (super.isRedeclaredInScope(scope, name, bindingType)) return true; + if (bindingType & 2048 && !scope.declareFunctions.has(name)) { + const type = scope.names.get(name); + return (type & 4) > 0 || (type & 2) > 0; + } + return false; + } + checkLocalExport(id) { + if (!this.scopeStack[0].declareFunctions.has(id.name)) { + super.checkLocalExport(id); + } + } +} +const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); +const FlowErrors = ParseErrorEnum`flow`({ + AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", + AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", + AssignReservedType: ({ + reservedType + }) => `Cannot overwrite reserved type ${reservedType}.`, + DeclareClassElement: "The `declare` modifier can only appear on class fields.", + DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", + DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", + EnumBooleanMemberNotInitialized: ({ + memberName, + enumName + }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, + EnumDuplicateMemberName: ({ + memberName, + enumName + }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, + EnumInconsistentMemberValues: ({ + enumName + }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, + EnumInvalidExplicitType: ({ + invalidEnumType, + enumName + }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidExplicitTypeUnknownSupplied: ({ + enumName + }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerPrimaryType: ({ + enumName, + memberName, + explicitType + }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, + EnumInvalidMemberInitializerSymbolType: ({ + enumName, + memberName + }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, + EnumInvalidMemberInitializerUnknownType: ({ + enumName, + memberName + }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, + EnumInvalidMemberName: ({ + enumName, + memberName, + suggestion + }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, + EnumNumberMemberNotInitialized: ({ + enumName, + memberName + }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, + EnumStringMemberInconsistentlyInitialized: ({ + enumName + }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, + GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", + ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", + ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", + InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", + InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", + InexactVariance: "Explicit inexact syntax cannot have variance.", + InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", + MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", + NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", + NestedFlowComment: "Cannot have a flow comment inside another flow comment.", + PatternIsOptional: Object.assign({ + message: "A binding pattern parameter cannot be optional in an implementation signature." + }, { + reasonCode: "OptionalBindingPattern" + }), + SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", + SpreadVariance: "Spread properties cannot have variance.", + ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", + ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", + ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", + ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", + ThisParamNoDefault: "The `this` parameter may not have a default value.", + TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", + UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", + UnexpectedReservedType: ({ + reservedType + }) => `Unexpected reserved type ${reservedType}.`, + UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", + UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", + UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", + UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', + UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", + UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", + UnsupportedDeclareExportKind: ({ + unsupportedExportKind, + suggestion + }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, + UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", + UnterminatedFlowComment: "Unterminated flow-comment." +}); +function isEsModuleType(bodyElement) { + return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); +} +function hasTypeImportKind(node) { + return node.importKind === "type" || node.importKind === "typeof"; +} +const exportSuggestions = { + const: "declare export var", + let: "declare export var", + type: "export type", + interface: "export interface" +}; +function partition(list, test) { + const list1 = []; + const list2 = []; + for (let i = 0; i < list.length; i++) { + (test(list[i], i, list) ? list1 : list2).push(list[i]); + } + return [list1, list2]; +} +const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; +var flow = superClass => class FlowParserMixin extends superClass { + constructor(...args) { + super(...args); + this.flowPragma = undefined; + } + getScopeHandler() { + return FlowScopeHandler; + } + shouldParseTypes() { + return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; + } + finishToken(type, val) { + if (type !== 134 && type !== 13 && type !== 28) { + if (this.flowPragma === undefined) { + this.flowPragma = null; + } + } + super.finishToken(type, val); + } + addComment(comment) { + if (this.flowPragma === undefined) { + const matches = FLOW_PRAGMA_REGEX.exec(comment.value); + if (!matches) ;else if (matches[1] === "flow") { + this.flowPragma = "flow"; + } else if (matches[1] === "noflow") { + this.flowPragma = "noflow"; + } else { + throw new Error("Unexpected flow pragma"); + } + } + super.addComment(comment); + } + flowParseTypeInitialiser(tok) { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || 14); + const type = this.flowParseType(); + this.state.inType = oldInType; + return type; + } + flowParsePredicate() { + const node = this.startNode(); + const moduloLoc = this.state.startLoc; + this.next(); + this.expectContextual(110); + if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { + this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); + } + if (this.eat(10)) { + node.value = super.parseExpression(); + this.expect(11); + return this.finishNode(node, "DeclaredPredicate"); + } else { + return this.finishNode(node, "InferredPredicate"); + } + } + flowParseTypeAndPredicateInitialiser() { + const oldInType = this.state.inType; + this.state.inType = true; + this.expect(14); + let type = null; + let predicate = null; + if (this.match(54)) { + this.state.inType = oldInType; + predicate = this.flowParsePredicate(); + } else { + type = this.flowParseType(); + this.state.inType = oldInType; + if (this.match(54)) { + predicate = this.flowParsePredicate(); + } + } + return [type, predicate]; + } + flowParseDeclareClass(node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); + } + flowParseDeclareFunction(node) { + this.next(); + const id = node.id = this.parseIdentifier(); + const typeNode = this.startNode(); + const typeContainer = this.startNode(); + if (this.match(47)) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + this.expect(10); + const tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + typeNode.this = tmp._this; + this.expect(11); + [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + this.resetEndLocation(id); + this.semicolon(); + this.scope.declareName(node.id.name, 2048, node.id.loc.start); + return this.finishNode(node, "DeclareFunction"); + } + flowParseDeclare(node, insideModule) { + if (this.match(80)) { + return this.flowParseDeclareClass(node); + } else if (this.match(68)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(74)) { + return this.flowParseDeclareVariable(node); + } else if (this.eatContextual(127)) { + if (this.match(16)) { + return this.flowParseDeclareModuleExports(node); + } else { + if (insideModule) { + this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); + } + return this.flowParseDeclareModule(node); + } + } else if (this.isContextual(130)) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual(131)) { + return this.flowParseDeclareOpaqueType(node); + } else if (this.isContextual(129)) { + return this.flowParseDeclareInterface(node); + } else if (this.match(82)) { + return this.flowParseDeclareExportDeclaration(node, insideModule); + } + throw this.unexpected(); + } + flowParseDeclareVariable(node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(true); + this.scope.declareName(node.id.name, 5, node.id.loc.start); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); + } + flowParseDeclareModule(node) { + this.scope.enter(0); + if (this.match(134)) { + node.id = super.parseExprAtom(); + } else { + node.id = this.parseIdentifier(); + } + const bodyNode = node.body = this.startNode(); + const body = bodyNode.body = []; + this.expect(5); + while (!this.match(8)) { + const bodyNode = this.startNode(); + if (this.match(83)) { + this.next(); + if (!this.isContextual(130) && !this.match(87)) { + this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); + } + body.push(super.parseImport(bodyNode)); + } else { + this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); + body.push(this.flowParseDeclare(bodyNode, true)); + } + } + this.scope.exit(); + this.expect(8); + this.finishNode(bodyNode, "BlockStatement"); + let kind = null; + let hasModuleExport = false; + body.forEach(bodyElement => { + if (isEsModuleType(bodyElement)) { + if (kind === "CommonJS") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "ES"; + } else if (bodyElement.type === "DeclareModuleExports") { + if (hasModuleExport) { + this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); + } + if (kind === "ES") { + this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); + } + kind = "CommonJS"; + hasModuleExport = true; + } + }); + node.kind = kind || "CommonJS"; + return this.finishNode(node, "DeclareModule"); + } + flowParseDeclareExportDeclaration(node, insideModule) { + this.expect(82); + if (this.eat(65)) { + if (this.match(68) || this.match(80)) { + node.declaration = this.flowParseDeclare(this.startNode()); + } else { + node.declaration = this.flowParseType(); + this.semicolon(); + } + node.default = true; + return this.finishNode(node, "DeclareExportDeclaration"); + } else { + if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { + const label = this.state.value; + throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { + unsupportedExportKind: label, + suggestion: exportSuggestions[label] + }); + } + if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { + node.declaration = this.flowParseDeclare(this.startNode()); + node.default = false; + return this.finishNode(node, "DeclareExportDeclaration"); + } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { + node = this.parseExport(node, null); + if (node.type === "ExportNamedDeclaration") { + node.default = false; + delete node.exportKind; + return this.castNodeTo(node, "DeclareExportDeclaration"); + } else { + return this.castNodeTo(node, "DeclareExportAllDeclaration"); + } + } + } + throw this.unexpected(); + } + flowParseDeclareModuleExports(node) { + this.next(); + this.expectContextual(111); + node.typeAnnotation = this.flowParseTypeAnnotation(); + this.semicolon(); + return this.finishNode(node, "DeclareModuleExports"); + } + flowParseDeclareTypeAlias(node) { + this.next(); + const finished = this.flowParseTypeAlias(node); + this.castNodeTo(finished, "DeclareTypeAlias"); + return finished; + } + flowParseDeclareOpaqueType(node) { + this.next(); + const finished = this.flowParseOpaqueType(node, true); + this.castNodeTo(finished, "DeclareOpaqueType"); + return finished; + } + flowParseDeclareInterface(node) { + this.next(); + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "DeclareInterface"); + } + flowParseInterfaceish(node, isClass) { + node.id = this.flowParseRestrictedIdentifier(!isClass, true); + this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (!isClass && this.eat(12)); + } + if (isClass) { + node.implements = []; + node.mixins = []; + if (this.eatContextual(117)) { + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + if (this.eatContextual(113)) { + do { + node.implements.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + } + node.body = this.flowParseObjectType({ + allowStatic: isClass, + allowExact: false, + allowSpread: false, + allowProto: isClass, + allowInexact: false + }); + } + flowParseInterfaceExtends() { + const node = this.startNode(); + node.id = this.flowParseQualifiedTypeIdentifier(); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + return this.finishNode(node, "InterfaceExtends"); + } + flowParseInterface(node) { + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "InterfaceDeclaration"); + } + checkNotUnderscore(word) { + if (word === "_") { + this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); + } + } + checkReservedType(word, startLoc, declaration) { + if (!reservedTypes.has(word)) return; + this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { + reservedType: word + }); + } + flowParseRestrictedIdentifier(liberal, declaration) { + this.checkReservedType(this.state.value, this.state.startLoc, declaration); + return this.parseIdentifier(liberal); + } + flowParseTypeAlias(node) { + node.id = this.flowParseRestrictedIdentifier(false, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.right = this.flowParseTypeInitialiser(29); + this.semicolon(); + return this.finishNode(node, "TypeAlias"); + } + flowParseOpaqueType(node, declare) { + this.expectContextual(130); + node.id = this.flowParseRestrictedIdentifier(true, true); + this.scope.declareName(node.id.name, 8201, node.id.loc.start); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + node.supertype = null; + if (this.match(14)) { + node.supertype = this.flowParseTypeInitialiser(14); + } + node.impltype = null; + if (!declare) { + node.impltype = this.flowParseTypeInitialiser(29); + } + this.semicolon(); + return this.finishNode(node, "OpaqueType"); + } + flowParseTypeParameter(requireDefault = false) { + const nodeStartLoc = this.state.startLoc; + const node = this.startNode(); + const variance = this.flowParseVariance(); + const ident = this.flowParseTypeAnnotatableIdentifier(); + node.name = ident.name; + node.variance = variance; + node.bound = ident.typeAnnotation; + if (this.match(29)) { + this.eat(29); + node.default = this.flowParseType(); + } else { + if (requireDefault) { + this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); + } + } + return this.finishNode(node, "TypeParameter"); + } + flowParseTypeParameterDeclaration() { + const oldInType = this.state.inType; + const node = this.startNode(); + node.params = []; + this.state.inType = true; + if (this.match(47) || this.match(143)) { + this.next(); + } else { + this.unexpected(); + } + let defaultRequired = false; + do { + const typeParameter = this.flowParseTypeParameter(defaultRequired); + node.params.push(typeParameter); + if (typeParameter.default) { + defaultRequired = true; + } + if (!this.match(48)) { + this.expect(12); + } + } while (!this.match(48)); + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterDeclaration"); + } + flowInTopLevelContext(cb) { + if (this.curContext() !== types.brace) { + const oldContext = this.state.context; + this.state.context = [oldContext[0]]; + try { + return cb(); + } finally { + this.state.context = oldContext; + } + } else { + return cb(); + } + } + flowParseTypeParameterInstantiationInExpression() { + if (this.reScan_lt() !== 47) return; + return this.flowParseTypeParameterInstantiation(); + } + flowParseTypeParameterInstantiation() { + const node = this.startNode(); + const oldInType = this.state.inType; + this.state.inType = true; + node.params = []; + this.flowInTopLevelContext(() => { + this.expect(47); + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = false; + while (!this.match(48)) { + node.params.push(this.flowParseType()); + if (!this.match(48)) { + this.expect(12); + } + } + this.state.noAnonFunctionType = oldNoAnonFunctionType; + }); + this.state.inType = oldInType; + if (!this.state.inType && this.curContext() === types.brace) { + this.reScan_lt_gt(); + } + this.expect(48); + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseTypeParameterInstantiationCallOrNew() { + if (this.reScan_lt() !== 47) return null; + const node = this.startNode(); + const oldInType = this.state.inType; + node.params = []; + this.state.inType = true; + this.expect(47); + while (!this.match(48)) { + node.params.push(this.flowParseTypeOrImplicitInstantiation()); + if (!this.match(48)) { + this.expect(12); + } + } + this.expect(48); + this.state.inType = oldInType; + return this.finishNode(node, "TypeParameterInstantiation"); + } + flowParseInterfaceType() { + const node = this.startNode(); + this.expectContextual(129); + node.extends = []; + if (this.eat(81)) { + do { + node.extends.push(this.flowParseInterfaceExtends()); + } while (this.eat(12)); + } + node.body = this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: false, + allowProto: false, + allowInexact: false + }); + return this.finishNode(node, "InterfaceTypeAnnotation"); + } + flowParseObjectPropertyKey() { + return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true); + } + flowParseObjectTypeIndexer(node, isStatic, variance) { + node.static = isStatic; + if (this.lookahead().type === 14) { + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + } else { + node.id = null; + node.key = this.flowParseType(); + } + this.expect(3); + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + return this.finishNode(node, "ObjectTypeIndexer"); + } + flowParseObjectTypeInternalSlot(node, isStatic) { + node.static = isStatic; + node.id = this.flowParseObjectPropertyKey(); + this.expect(3); + this.expect(3); + if (this.match(47) || this.match(10)) { + node.method = true; + node.optional = false; + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + } else { + node.method = false; + if (this.eat(17)) { + node.optional = true; + } + node.value = this.flowParseTypeInitialiser(); + } + return this.finishNode(node, "ObjectTypeInternalSlot"); + } + flowParseObjectTypeMethodish(node) { + node.params = []; + node.rest = null; + node.typeParameters = null; + node.this = null; + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + this.expect(10); + if (this.match(78)) { + node.this = this.flowParseFunctionTypeParam(true); + node.this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + node.params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + node.rest = this.flowParseFunctionTypeParam(false); + } + this.expect(11); + node.returnType = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + flowParseObjectTypeCallProperty(node, isStatic) { + const valueNode = this.startNode(); + node.static = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + return this.finishNode(node, "ObjectTypeCallProperty"); + } + flowParseObjectType({ + allowStatic, + allowExact, + allowSpread, + allowProto, + allowInexact + }) { + const oldInType = this.state.inType; + this.state.inType = true; + const nodeStart = this.startNode(); + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; + nodeStart.internalSlots = []; + let endDelim; + let exact; + let inexact = false; + if (allowExact && this.match(6)) { + this.expect(6); + endDelim = 9; + exact = true; + } else { + this.expect(5); + endDelim = 8; + exact = false; + } + nodeStart.exact = exact; + while (!this.match(endDelim)) { + let isStatic = false; + let protoStartLoc = null; + let inexactStartLoc = null; + const node = this.startNode(); + if (allowProto && this.isContextual(118)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + protoStartLoc = this.state.startLoc; + allowStatic = false; + } + } + if (allowStatic && this.isContextual(106)) { + const lookahead = this.lookahead(); + if (lookahead.type !== 14 && lookahead.type !== 17) { + this.next(); + isStatic = true; + } + } + const variance = this.flowParseVariance(); + if (this.eat(0)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (this.eat(0)) { + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); + } else { + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); + } + } else if (this.match(10) || this.match(47)) { + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); + } else { + let kind = "init"; + if (this.isContextual(99) || this.isContextual(104)) { + const lookahead = this.lookahead(); + if (tokenIsLiteralPropertyName(lookahead.type)) { + kind = this.state.value; + this.next(); + } + } + const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); + if (propOrInexact === null) { + inexact = true; + inexactStartLoc = this.state.lastTokStartLoc; + } else { + nodeStart.properties.push(propOrInexact); + } + } + this.flowObjectTypeSemicolon(); + if (inexactStartLoc && !this.match(8) && !this.match(9)) { + this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); + } + } + this.expect(endDelim); + if (allowSpread) { + nodeStart.inexact = inexact; + } + const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); + this.state.inType = oldInType; + return out; + } + flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { + if (this.eat(21)) { + const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); + if (isInexactToken) { + if (!allowSpread) { + this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); + } else if (!allowInexact) { + this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); + } + if (variance) { + this.raise(FlowErrors.InexactVariance, variance); + } + return null; + } + if (!allowSpread) { + this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); + } + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.raise(FlowErrors.SpreadVariance, variance); + } + node.argument = this.flowParseType(); + return this.finishNode(node, "ObjectTypeSpreadProperty"); + } else { + node.key = this.flowParseObjectPropertyKey(); + node.static = isStatic; + node.proto = protoStartLoc != null; + node.kind = kind; + let optional = false; + if (this.match(47) || this.match(10)) { + node.method = true; + if (protoStartLoc != null) { + this.unexpected(protoStartLoc); + } + if (variance) { + this.unexpected(variance.loc.start); + } + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); + if (kind === "get" || kind === "set") { + this.flowCheckGetterSetterParams(node); + } + if (!allowSpread && node.key.name === "constructor" && node.value.this) { + this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); + } + } else { + if (kind !== "init") this.unexpected(); + node.method = false; + if (this.eat(17)) { + optional = true; + } + node.value = this.flowParseTypeInitialiser(); + node.variance = variance; + } + node.optional = optional; + return this.finishNode(node, "ObjectTypeProperty"); + } + } + flowCheckGetterSetterParams(property) { + const paramCount = property.kind === "get" ? 0 : 1; + const length = property.value.params.length + (property.value.rest ? 1 : 0); + if (property.value.this) { + this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); + } + if (length !== paramCount) { + this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); + } + if (property.kind === "set" && property.value.rest) { + this.raise(Errors.BadSetterRestParameter, property); + } + } + flowObjectTypeSemicolon() { + if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { + this.unexpected(); + } + } + flowParseQualifiedTypeIdentifier(startLoc, id) { + startLoc != null ? startLoc : startLoc = this.state.startLoc; + let node = id || this.flowParseRestrictedIdentifier(true); + while (this.eat(16)) { + const node2 = this.startNodeAt(startLoc); + node2.qualification = node; + node2.id = this.flowParseRestrictedIdentifier(true); + node = this.finishNode(node2, "QualifiedTypeIdentifier"); + } + return node; + } + flowParseGenericType(startLoc, id) { + const node = this.startNodeAt(startLoc); + node.typeParameters = null; + node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } + return this.finishNode(node, "GenericTypeAnnotation"); + } + flowParseTypeofType() { + const node = this.startNode(); + this.expect(87); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); + } + flowParseTupleType() { + const node = this.startNode(); + node.types = []; + this.expect(0); + while (this.state.pos < this.length && !this.match(3)) { + node.types.push(this.flowParseType()); + if (this.match(3)) break; + this.expect(12); + } + this.expect(3); + return this.finishNode(node, "TupleTypeAnnotation"); + } + flowParseFunctionTypeParam(first) { + let name = null; + let optional = false; + let typeAnnotation = null; + const node = this.startNode(); + const lh = this.lookahead(); + const isThis = this.state.type === 78; + if (lh.type === 14 || lh.type === 17) { + if (isThis && !first) { + this.raise(FlowErrors.ThisParamMustBeFirst, node); + } + name = this.parseIdentifier(isThis); + if (this.eat(17)) { + optional = true; + if (isThis) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, node); + } + } + typeAnnotation = this.flowParseTypeInitialiser(); + } else { + typeAnnotation = this.flowParseType(); + } + node.name = name; + node.optional = optional; + node.typeAnnotation = typeAnnotation; + return this.finishNode(node, "FunctionTypeParam"); + } + reinterpretTypeAsFunctionTypeParam(type) { + const node = this.startNodeAt(type.loc.start); + node.name = null; + node.optional = false; + node.typeAnnotation = type; + return this.finishNode(node, "FunctionTypeParam"); + } + flowParseFunctionTypeParams(params = []) { + let rest = null; + let _this = null; + if (this.match(78)) { + _this = this.flowParseFunctionTypeParam(true); + _this.name = null; + if (!this.match(11)) { + this.expect(12); + } + } + while (!this.match(11) && !this.match(21)) { + params.push(this.flowParseFunctionTypeParam(false)); + if (!this.match(11)) { + this.expect(12); + } + } + if (this.eat(21)) { + rest = this.flowParseFunctionTypeParam(false); + } + return { + params, + rest, + _this + }; + } + flowIdentToTypeAnnotation(startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + case "empty": + return this.finishNode(node, "EmptyTypeAnnotation"); + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + case "symbol": + return this.finishNode(node, "SymbolTypeAnnotation"); + default: + this.checkNotUnderscore(id.name); + return this.flowParseGenericType(startLoc, id); + } + } + flowParsePrimaryType() { + const startLoc = this.state.startLoc; + const node = this.startNode(); + let tmp; + let type; + let isGroupedType = false; + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + switch (this.state.type) { + case 5: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: false, + allowSpread: true, + allowProto: false, + allowInexact: true + }); + case 6: + return this.flowParseObjectType({ + allowStatic: false, + allowExact: true, + allowSpread: true, + allowProto: false, + allowInexact: false + }); + case 0: + this.state.noAnonFunctionType = false; + type = this.flowParseTupleType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + return type; + case 47: + { + const node = this.startNode(); + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(10); + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 10: + { + const node = this.startNode(); + this.next(); + if (!this.match(11) && !this.match(21)) { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + const token = this.lookahead().type; + isGroupedType = token !== 17 && token !== 14; + } else { + isGroupedType = true; + } + } + if (isGroupedType) { + this.state.noAnonFunctionType = false; + type = this.flowParseType(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { + this.expect(11); + return type; + } else { + this.eat(12); + } + } + if (type) { + tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); + } else { + tmp = this.flowParseFunctionTypeParams(); + } + node.params = tmp.params; + node.rest = tmp.rest; + node.this = tmp._this; + this.expect(11); + this.expect(19); + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + case 134: + return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); + case 85: + case 86: + node.value = this.match(85); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + case 53: + if (this.state.value === "-") { + this.next(); + if (this.match(135)) { + return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); + } + if (this.match(136)) { + return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); + } + throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); + } + throw this.unexpected(); + case 135: + return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); + case 136: + return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); + case 88: + this.next(); + return this.finishNode(node, "VoidTypeAnnotation"); + case 84: + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); + case 78: + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); + case 55: + this.next(); + return this.finishNode(node, "ExistsTypeAnnotation"); + case 87: + return this.flowParseTypeofType(); + default: + if (tokenIsKeyword(this.state.type)) { + const label = tokenLabelName(this.state.type); + this.next(); + return super.createIdentifier(node, label); + } else if (tokenIsIdentifier(this.state.type)) { + if (this.isContextual(129)) { + return this.flowParseInterfaceType(); + } + return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); + } + } + throw this.unexpected(); + } + flowParsePostfixType() { + const startLoc = this.state.startLoc; + let type = this.flowParsePrimaryType(); + let seenOptionalIndexedAccess = false; + while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startLoc); + const optional = this.eat(18); + seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; + this.expect(0); + if (!optional && this.match(3)) { + node.elementType = type; + this.next(); + type = this.finishNode(node, "ArrayTypeAnnotation"); + } else { + node.objectType = type; + node.indexType = this.flowParseType(); + this.expect(3); + if (seenOptionalIndexedAccess) { + node.optional = optional; + type = this.finishNode(node, "OptionalIndexedAccessType"); + } else { + type = this.finishNode(node, "IndexedAccessType"); + } + } + } + return type; + } + flowParsePrefixType() { + const node = this.startNode(); + if (this.eat(17)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } + } + flowParseAnonFunctionWithoutParens() { + const param = this.flowParsePrefixType(); + if (!this.state.noAnonFunctionType && this.eat(19)) { + const node = this.startNodeAt(param.loc.start); + node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; + node.rest = null; + node.this = null; + node.returnType = this.flowParseType(); + node.typeParameters = null; + return this.finishNode(node, "FunctionTypeAnnotation"); + } + return param; + } + flowParseIntersectionType() { + const node = this.startNode(); + this.eat(45); + const type = this.flowParseAnonFunctionWithoutParens(); + node.types = [type]; + while (this.eat(45)) { + node.types.push(this.flowParseAnonFunctionWithoutParens()); + } + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); + } + flowParseUnionType() { + const node = this.startNode(); + this.eat(43); + const type = this.flowParseIntersectionType(); + node.types = [type]; + while (this.eat(43)) { + node.types.push(this.flowParseIntersectionType()); + } + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); + } + flowParseType() { + const oldInType = this.state.inType; + this.state.inType = true; + const type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; + } + flowParseTypeOrImplicitInstantiation() { + if (this.state.type === 132 && this.state.value === "_") { + const startLoc = this.state.startLoc; + const node = this.parseIdentifier(); + return this.flowParseGenericType(startLoc, node); + } else { + return this.flowParseType(); + } + } + flowParseTypeAnnotation() { + const node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); + } + flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { + const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); + if (this.match(14)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(ident); + } + return ident; + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + flowParseVariance() { + let variance = null; + if (this.match(53)) { + variance = this.startNode(); + if (this.state.value === "+") { + variance.kind = "plus"; + } else { + variance.kind = "minus"; + } + this.next(); + return this.finishNode(variance, "Variance"); + } + return variance; + } + parseFunctionBody(node, allowExpressionBody, isMethod = false) { + if (allowExpressionBody) { + this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); + return; + } + super.parseFunctionBody(node, false, isMethod); + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; + } + return super.parseFunctionBodyAndFinish(node, type, isMethod); + } + parseStatementLike(flags) { + if (this.state.strict && this.isContextual(129)) { + const lookahead = this.lookahead(); + if (tokenIsKeywordOrIdentifier(lookahead.type)) { + const node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } + } else if (this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + const stmt = super.parseStatementLike(flags); + if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { + this.flowPragma = null; + } + return stmt; + } + parseExpressionStatement(node, expr, decorators) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { + return this.flowParseDeclare(node); + } + } else if (tokenIsIdentifier(this.state.type)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); + } else if (expr.name === "opaque") { + return this.flowParseOpaqueType(node, false); + } + } + } + return super.parseExpressionStatement(node, expr, decorators); + } + shouldParseExportDeclaration() { + const { + type + } = this.state; + if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { + return !this.state.containsEsc; + } + return super.shouldParseExportDeclaration(); + } + isExportDefaultSpecifier() { + const { + type + } = this.state; + if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { + return this.state.containsEsc; + } + return super.isExportDefaultSpecifier(); + } + parseExportDefaultExpression() { + if (this.isContextual(126)) { + const node = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(node); + } + return super.parseExportDefaultExpression(); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (!this.match(17)) return expr; + if (this.state.maybeInArrowParameters) { + const nextCh = this.lookaheadCharCode(); + if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { + this.setOptionalParametersError(refExpressionErrors); + return expr; + } + } + this.expect(17); + const state = this.state.clone(); + const originalNoArrowAt = this.state.noArrowAt; + const node = this.startNodeAt(startLoc); + let { + consequent, + failed + } = this.tryParseConditionalConsequent(); + let [valid, invalid] = this.getArrowLikeExpressions(consequent); + if (failed || invalid.length > 0) { + const noArrowAt = [...originalNoArrowAt]; + if (invalid.length > 0) { + this.state = state; + this.state.noArrowAt = noArrowAt; + for (let i = 0; i < invalid.length; i++) { + noArrowAt.push(invalid[i].start); + } + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + [valid, invalid] = this.getArrowLikeExpressions(consequent); + } + if (failed && valid.length > 1) { + this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); + } + if (failed && valid.length === 1) { + this.state = state; + noArrowAt.push(valid[0].start); + this.state.noArrowAt = noArrowAt; + ({ + consequent, + failed + } = this.tryParseConditionalConsequent()); + } + } + this.getArrowLikeExpressions(consequent, true); + this.state.noArrowAt = originalNoArrowAt; + this.expect(14); + node.test = expr; + node.consequent = consequent; + node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); + return this.finishNode(node, "ConditionalExpression"); + } + tryParseConditionalConsequent() { + this.state.noArrowParamsConversionAt.push(this.state.start); + const consequent = this.parseMaybeAssignAllowIn(); + const failed = !this.match(14); + this.state.noArrowParamsConversionAt.pop(); + return { + consequent, + failed + }; + } + getArrowLikeExpressions(node, disallowInvalid) { + const stack = [node]; + const arrows = []; + while (stack.length !== 0) { + const node = stack.pop(); + if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { + if (node.typeParameters || !node.returnType) { + this.finishArrowValidation(node); + } else { + arrows.push(node); + } + stack.push(node.body); + } else if (node.type === "ConditionalExpression") { + stack.push(node.consequent); + stack.push(node.alternate); + } + } + if (disallowInvalid) { + arrows.forEach(node => this.finishArrowValidation(node)); + return [arrows, []]; + } + return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); + } + finishArrowValidation(node) { + var _node$extra; + this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); + this.scope.enter(514 | 4); + super.checkParams(node, false, true); + this.scope.exit(); + } + forwardNoArrowParamsConversionAt(node, parse) { + let result; + if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + this.state.noArrowParamsConversionAt.push(this.state.start); + result = parse(); + this.state.noArrowParamsConversionAt.pop(); + } else { + result = parse(); + } + return result; + } + parseParenItem(node, startLoc) { + const newNode = super.parseParenItem(node, startLoc); + if (this.eat(17)) { + newNode.optional = true; + this.resetEndLocation(node); + } + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startLoc); + typeCastNode.expression = newNode; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TypeCastExpression"); + } + return newNode; + } + assertModuleNodeAllowed(node) { + if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { + return; + } + super.assertModuleNodeAllowed(node); + } + parseExportDeclaration(node) { + if (this.isContextual(130)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + if (this.match(5)) { + node.specifiers = this.parseExportSpecifiers(true); + super.parseExportFrom(node); + return null; + } else { + return this.flowParseTypeAlias(declarationNode); + } + } else if (this.isContextual(131)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseOpaqueType(declarationNode, false); + } else if (this.isContextual(129)) { + node.exportKind = "type"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(declarationNode); + } else if (this.isContextual(126)) { + node.exportKind = "value"; + const declarationNode = this.startNode(); + this.next(); + return this.flowParseEnumDeclaration(declarationNode); + } else { + return super.parseExportDeclaration(node); + } + } + eatExportStar(node) { + if (super.eatExportStar(node)) return true; + if (this.isContextual(130) && this.lookahead().type === 55) { + node.exportKind = "type"; + this.next(); + this.next(); + return true; + } + return false; + } + maybeParseExportNamespaceSpecifier(node) { + const { + startLoc + } = this.state; + const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); + if (hasNamespace && node.exportKind === "type") { + this.unexpected(startLoc); + } + return hasNamespace; + } + parseClassId(node, isStatement, optionalId) { + super.parseClassId(node, isStatement, optionalId); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + } + parseClassMember(classBody, member, state) { + const { + startLoc + } = this.state; + if (this.isContextual(125)) { + if (super.parseClassMemberFromModifier(classBody, member)) { + return; + } + member.declare = true; + } + super.parseClassMember(classBody, member, state); + if (member.declare) { + if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { + this.raise(FlowErrors.DeclareClassElement, startLoc); + } else if (member.value) { + this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); + } + } + } + isIterator(word) { + return word === "iterator" || word === "asyncIterator"; + } + readIterator() { + const word = super.readWord1(); + const fullWord = "@@" + word; + if (!this.isIterator(word) || !this.state.inType) { + this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { + identifierName: fullWord + }); + } + this.finishToken(132, fullWord); + } + getTokenFromCode(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 123 && next === 124) { + this.finishOp(6, 2); + } else if (this.state.inType && (code === 62 || code === 60)) { + this.finishOp(code === 62 ? 48 : 47, 1); + } else if (this.state.inType && code === 63) { + if (next === 46) { + this.finishOp(18, 2); + } else { + this.finishOp(17, 1); + } + } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { + this.state.pos += 2; + this.readIterator(); + } else { + super.getTokenFromCode(code); + } + } + isAssignable(node, isBinding) { + if (node.type === "TypeCastExpression") { + return this.isAssignable(node.expression, isBinding); + } else { + return super.isAssignable(node, isBinding); + } + } + toAssignable(node, isLHS = false) { + if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + super.toAssignable(node, isLHS); + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + for (let i = 0; i < exprList.length; i++) { + const expr = exprList[i]; + if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { + exprList[i] = this.typeCastToParameter(expr); + } + } + super.toAssignableList(exprList, trailingCommaLoc, isLHS); + } + toReferencedList(exprList, isParenthesizedExpr) { + for (let i = 0; i < exprList.length; i++) { + var _expr$extra; + const expr = exprList[i]; + if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { + this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); + } + } + return exprList; + } + parseArrayLike(close, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, isTuple, refExpressionErrors); + if (refExpressionErrors != null && !this.state.maybeInArrowParameters) { + this.toReferencedList(node.elements); + } + return node; + } + isValidLVal(type, disallowCallExpression, isParenthesized, binding) { + return type === "TypeCastExpression" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding); + } + parseClassProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassProperty(node); + } + parseClassPrivateProperty(node) { + if (this.match(14)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return super.parseClassPrivateProperty(node); + } + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + isClassProperty() { + return this.match(14) || super.isClassProperty(); + } + isNonstaticConstructor(method) { + return !this.match(14) && super.isNonstaticConstructor(method); + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + if (method.params && isConstructor) { + const params = method.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { + const params = method.value.params; + if (params.length > 0 && this.isThisParam(params[0])) { + this.raise(FlowErrors.ThisParamBannedInConstructor, method); + } + } + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + if (method.variance) { + this.unexpected(method.variance.loc.start); + } + delete method.variance; + if (this.match(47)) { + method.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && (this.match(47) || this.match(51))) { + { + node.superTypeParameters = this.flowParseTypeParameterInstantiationInExpression(); + } + } + if (this.isContextual(113)) { + this.next(); + const implemented = node.implements = []; + do { + const node = this.startNode(); + node.id = this.flowParseRestrictedIdentifier(true); + if (this.match(47)) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + implemented.push(this.finishNode(node, "ClassImplements")); + } while (this.eat(12)); + } + } + checkGetterSetterParams(method) { + super.checkGetterSetterParams(method); + const params = this.getObjectOrClassMethodParams(method); + if (params.length > 0) { + const param = params[0]; + if (this.isThisParam(param) && method.kind === "get") { + this.raise(FlowErrors.GetterMayNotHaveThisParam, param); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.SetterMayNotHaveThisParam, param); + } + } + } + parsePropertyNamePrefixOperator(node) { + node.variance = this.flowParseVariance(); + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + if (prop.variance) { + this.unexpected(prop.variance.loc.start); + } + delete prop.variance; + let typeParameters; + if (this.match(47) && !isAccessor) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(10)) this.unexpected(); + } + const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + if (typeParameters) { + (result.value || result).typeParameters = typeParameters; + } + return result; + } + parseFunctionParamType(param) { + if (this.eat(17)) { + if (param.type !== "Identifier") { + this.raise(FlowErrors.PatternIsOptional, param); + } + if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamMayNotBeOptional, param); + } + param.optional = true; + } + if (this.match(14)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } else if (this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamAnnotationRequired, param); + } + if (this.match(29) && this.isThisParam(param)) { + this.raise(FlowErrors.ThisParamNoDefault, param); + } + this.resetEndLocation(param); + return param; + } + parseMaybeDefault(startLoc, left) { + const node = super.parseMaybeDefault(startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); + } + return node; + } + checkImportReflection(node) { + super.checkImportReflection(node); + if (node.module && node.importKind !== "value") { + this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); + } + } + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + if (!isExport) return true; + const ch = this.lookaheadCharCode(); + return ch === 123 || ch === 42; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + if (!phase && this.match(65)) { + return; + } + node.exportKind = phase === "type" ? phase : "value"; + } else { + if (phase === "type" && this.match(55)) this.unexpected(); + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + const firstIdent = specifier.imported; + let specifierTypeKind = null; + if (firstIdent.type === "Identifier") { + if (firstIdent.name === "type") { + specifierTypeKind = "type"; + } else if (firstIdent.name === "typeof") { + specifierTypeKind = "typeof"; + } + } + let isBinding = false; + if (this.isContextual(93) && !this.isLookaheadContextual("as")) { + const as_ident = this.parseIdentifier(true); + if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = as_ident; + specifier.importKind = specifierTypeKind; + specifier.local = this.cloneIdentifier(as_ident); + } else { + specifier.imported = firstIdent; + specifier.importKind = null; + specifier.local = this.parseIdentifier(); + } + } else { + if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { + specifier.imported = this.parseIdentifier(true); + specifier.importKind = specifierTypeKind; + } else { + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, specifier, { + importName: firstIdent.value + }); + } + specifier.imported = firstIdent; + specifier.importKind = null; + } + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + isBinding = true; + specifier.local = this.cloneIdentifier(specifier.imported); + } + } + const specifierIsTypeImport = hasTypeImportKind(specifier); + if (isInTypeOnlyImport && specifierIsTypeImport) { + this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); + } + if (isInTypeOnlyImport || specifierIsTypeImport) { + this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); + } + if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { + this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); + } + return this.finishImportSpecifier(specifier, "ImportSpecifier"); + } + parseBindingAtom() { + switch (this.state.type) { + case 78: + return this.parseIdentifier(true); + default: + return super.parseBindingAtom(); + } + } + parseFunctionParams(node, isConstructor) { + const kind = node.kind; + if (kind !== "get" && kind !== "set" && this.match(47)) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + super.parseFunctionParams(node, isConstructor); + } + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (this.match(14)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.resetEndLocation(decl.id); + } + } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + node.returnType = this.flowParseTypeAnnotation(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + } + return super.parseAsyncArrowFromCallExpression(node, call); + } + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx; + let state = null; + let jsx; + if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { + var _jsx2, _jsx3; + state = state || this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _arrowExpression$extr; + typeParameters = this.flowParseTypeParameterDeclaration(); + const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { + const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + this.resetStartLocationFromNode(result, typeParameters); + return result; + }); + if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); + const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); + if (expr.type !== "ArrowFunctionExpression") abort(); + expr.typeParameters = typeParameters; + this.resetStartLocationFromNode(expr, typeParameters); + return arrowExpression; + }, state); + let arrowExpression = null; + if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { + if (!arrow.error && !arrow.aborted) { + if (arrow.node.async) { + this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); + } + return arrow.node; + } + arrowExpression = arrow.node; + } + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + if (arrowExpression) { + this.state = arrow.failState; + return arrowExpression; + } + if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); + } + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(() => { + const oldNoAnonFunctionType = this.state.noAnonFunctionType; + this.state.noAnonFunctionType = true; + const typeNode = this.startNode(); + [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); + this.state.noAnonFunctionType = oldNoAnonFunctionType; + if (this.canInsertSemicolon()) this.unexpected(); + if (!this.match(19)) this.unexpected(); + return typeNode; + }); + if (result.thrown) return null; + if (result.error) this.state = result.failState; + node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; + } + return super.parseArrow(node); + } + shouldParseArrow(params) { + return this.match(14) || super.shouldParseArrow(params); + } + setArrowFunctionParameters(node, params) { + if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + node.params = params; + } else { + super.setArrowFunctionParameters(node, params); + } + } + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { + return; + } + for (let i = 0; i < node.params.length; i++) { + if (this.isThisParam(node.params[i]) && i > 0) { + this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); + } + } + super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); + } + parseParenAndDistinguishExpression(canBeArrow) { + return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start))); + } + parseSubscripts(base, startLoc, noCalls) { + if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) { + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.arguments = super.parseCallExpressionArguments(); + base = this.finishNode(node, "CallExpression"); + } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { + const state = this.state.clone(); + const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); + if (!arrow.error && !arrow.aborted) return arrow.node; + const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); + if (result.node && !result.error) return result.node; + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; + } + if (result.node) { + this.state = result.failState; + return result.node; + } + throw arrow.error || result.error; + } + return super.parseSubscripts(base, startLoc, noCalls); + } + parseSubscript(base, startLoc, noCalls, subscriptState) { + if (this.match(18) && this.isLookaheadToken_lt()) { + subscriptState.optionalChainMember = true; + if (noCalls) { + subscriptState.stop = true; + return base; + } + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); + this.expect(10); + node.arguments = this.parseCallExpressionArguments(); + node.optional = true; + return this.finishCallExpression(node, true); + } else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) { + const node = this.startNodeAt(startLoc); + node.callee = base; + const result = this.tryParse(() => { + node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); + this.expect(10); + node.arguments = super.parseCallExpressionArguments(); + if (subscriptState.optionalChainMember) { + node.optional = false; + } + return this.finishCallExpression(node, subscriptState.optionalChainMember); + }); + if (result.node) { + if (result.error) this.state = result.failState; + return result.node; + } + } + return super.parseSubscript(base, startLoc, noCalls, subscriptState); + } + parseNewCallee(node) { + super.parseNewCallee(node); + let targs = null; + if (this.shouldParseTypes() && this.match(47)) { + targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; + } + node.typeArguments = targs; + } + parseAsyncArrowWithTypeParameters(startLoc) { + const node = this.startNodeAt(startLoc); + this.parseFunctionParams(node, false); + if (!this.parseArrow(node)) return; + return super.parseArrowExpression(node, undefined, true); + } + readToken_mult_modulo(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 42 && next === 47 && this.state.hasFlowComment) { + this.state.hasFlowComment = false; + this.state.pos += 2; + this.nextToken(); + return; + } + super.readToken_mult_modulo(code); + } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (code === 124 && next === 125) { + this.finishOp(9, 2); + return; + } + super.readToken_pipe_amp(code); + } + parseTopLevel(file, program) { + const fileNode = super.parseTopLevel(file, program); + if (this.state.hasFlowComment) { + this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); + } + return fileNode; + } + skipBlockComment() { + if (this.hasPlugin("flowComments") && this.skipFlowComment()) { + if (this.state.hasFlowComment) { + throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); + } + this.hasFlowCommentCompletion(); + const commentSkip = this.skipFlowComment(); + if (commentSkip) { + this.state.pos += commentSkip; + this.state.hasFlowComment = true; + } + return; + } + return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); + } + skipFlowComment() { + const { + pos + } = this.state; + let shiftToFirstNonWhiteSpace = 2; + while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { + shiftToFirstNonWhiteSpace++; + } + const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); + const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); + if (ch2 === 58 && ch3 === 58) { + return shiftToFirstNonWhiteSpace + 2; + } + if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { + return shiftToFirstNonWhiteSpace + 12; + } + if (ch2 === 58 && ch3 !== 58) { + return shiftToFirstNonWhiteSpace; + } + return false; + } + hasFlowCommentCompletion() { + const end = this.input.indexOf("*/", this.state.pos); + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); + } + } + flowEnumErrorBooleanMemberNotInitialized(loc, { + enumName, + memberName + }) { + this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { + memberName, + enumName + }); + } + flowEnumErrorInvalidMemberInitializer(loc, enumContext) { + return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); + } + flowEnumErrorNumberMemberNotInitialized(loc, details) { + this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); + } + flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { + this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); + } + flowEnumMemberInit() { + const startLoc = this.state.startLoc; + const endOfInit = () => this.match(12) || this.match(8); + switch (this.state.type) { + case 135: + { + const literal = this.parseNumericLiteral(this.state.value); + if (endOfInit()) { + return { + type: "number", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 134: + { + const literal = this.parseStringLiteral(this.state.value); + if (endOfInit()) { + return { + type: "string", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + case 85: + case 86: + { + const literal = this.parseBooleanLiteral(this.match(85)); + if (endOfInit()) { + return { + type: "boolean", + loc: literal.loc.start, + value: literal + }; + } + return { + type: "invalid", + loc: startLoc + }; + } + default: + return { + type: "invalid", + loc: startLoc + }; + } + } + flowEnumMemberRaw() { + const loc = this.state.startLoc; + const id = this.parseIdentifier(true); + const init = this.eat(29) ? this.flowEnumMemberInit() : { + type: "none", + loc + }; + return { + id, + init + }; + } + flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { + const { + explicitType + } = context; + if (explicitType === null) { + return; + } + if (explicitType !== expectedType) { + this.flowEnumErrorInvalidMemberInitializer(loc, context); + } + } + flowEnumMembers({ + enumName, + explicitType + }) { + const seenNames = new Set(); + const members = { + booleanMembers: [], + numberMembers: [], + stringMembers: [], + defaultedMembers: [] + }; + let hasUnknownMembers = false; + while (!this.match(8)) { + if (this.eat(21)) { + hasUnknownMembers = true; + break; + } + const memberNode = this.startNode(); + const { + id, + init + } = this.flowEnumMemberRaw(); + const memberName = id.name; + if (memberName === "") { + continue; + } + if (/^[a-z]/.test(memberName)) { + this.raise(FlowErrors.EnumInvalidMemberName, id, { + memberName, + suggestion: memberName[0].toUpperCase() + memberName.slice(1), + enumName + }); + } + if (seenNames.has(memberName)) { + this.raise(FlowErrors.EnumDuplicateMemberName, id, { + memberName, + enumName + }); + } + seenNames.add(memberName); + const context = { + enumName, + explicitType, + memberName + }; + memberNode.id = id; + switch (init.type) { + case "boolean": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); + memberNode.init = init.value; + members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); + break; + } + case "number": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); + memberNode.init = init.value; + members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); + break; + } + case "string": + { + this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); + memberNode.init = init.value; + members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); + break; + } + case "invalid": + { + throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); + } + case "none": + { + switch (explicitType) { + case "boolean": + this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); + break; + case "number": + this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); + break; + default: + members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); + } + } + } + if (!this.match(8)) { + this.expect(12); + } + } + return { + members, + hasUnknownMembers + }; + } + flowEnumStringMembers(initializedMembers, defaultedMembers, { + enumName + }) { + if (initializedMembers.length === 0) { + return defaultedMembers; + } else if (defaultedMembers.length === 0) { + return initializedMembers; + } else if (defaultedMembers.length > initializedMembers.length) { + for (const member of initializedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return defaultedMembers; + } else { + for (const member of defaultedMembers) { + this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { + enumName + }); + } + return initializedMembers; + } + } + flowEnumParseExplicitType({ + enumName + }) { + if (!this.eatContextual(102)) return null; + if (!tokenIsIdentifier(this.state.type)) { + throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { + enumName + }); + } + const { + value + } = this.state; + this.next(); + if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { + this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { + enumName, + invalidEnumType: value + }); + } + return value; + } + flowEnumBody(node, id) { + const enumName = id.name; + const nameLoc = id.loc.start; + const explicitType = this.flowEnumParseExplicitType({ + enumName + }); + this.expect(5); + const { + members, + hasUnknownMembers + } = this.flowEnumMembers({ + enumName, + explicitType + }); + node.hasUnknownMembers = hasUnknownMembers; + switch (explicitType) { + case "boolean": + node.explicitType = true; + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + case "number": + node.explicitType = true; + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + case "string": + node.explicitType = true; + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + case "symbol": + node.members = members.defaultedMembers; + this.expect(8); + return this.finishNode(node, "EnumSymbolBody"); + default: + { + const empty = () => { + node.members = []; + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + }; + node.explicitType = false; + const boolsLen = members.booleanMembers.length; + const numsLen = members.numberMembers.length; + const strsLen = members.stringMembers.length; + const defaultedLen = members.defaultedMembers.length; + if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { + return empty(); + } else if (!boolsLen && !numsLen) { + node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { + enumName + }); + this.expect(8); + return this.finishNode(node, "EnumStringBody"); + } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.booleanMembers; + this.expect(8); + return this.finishNode(node, "EnumBooleanBody"); + } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { + for (const member of members.defaultedMembers) { + this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { + enumName, + memberName: member.id.name + }); + } + node.members = members.numberMembers; + this.expect(8); + return this.finishNode(node, "EnumNumberBody"); + } else { + this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { + enumName + }); + return empty(); + } + } + } + } + flowParseEnumDeclaration(node) { + const id = this.parseIdentifier(); + node.id = id; + node.body = this.flowEnumBody(this.startNode(), id); + return this.finishNode(node, "EnumDeclaration"); + } + jsxParseOpeningElementAfterName(node) { + if (this.shouldParseTypes()) { + if (this.match(47) || this.match(51)) { + node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); + } + } + return super.jsxParseOpeningElementAfterName(node); + } + isLookaheadToken_lt() { + const next = this.nextTokenStart(); + if (this.input.charCodeAt(next) === 60) { + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== 60 && afterNext !== 61; + } + return false; + } + reScan_lt_gt() { + const { + type + } = this.state; + if (type === 47) { + this.state.pos -= 1; + this.readToken_lt(); + } else if (type === 48) { + this.state.pos -= 1; + this.readToken_gt(); + } + } + reScan_lt() { + const { + type + } = this.state; + if (type === 51) { + this.state.pos -= 2; + this.finishOp(47, 1); + return 47; + } + return type; + } + maybeUnwrapTypeCastExpression(node) { + return node.type === "TypeCastExpression" ? node.expression : node; + } +}; +const entities = { + __proto__: null, + quot: "\u0022", + amp: "&", + apos: "\u0027", + lt: "<", + gt: ">", + nbsp: "\u00A0", + iexcl: "\u00A1", + cent: "\u00A2", + pound: "\u00A3", + curren: "\u00A4", + yen: "\u00A5", + brvbar: "\u00A6", + sect: "\u00A7", + uml: "\u00A8", + copy: "\u00A9", + ordf: "\u00AA", + laquo: "\u00AB", + not: "\u00AC", + shy: "\u00AD", + reg: "\u00AE", + macr: "\u00AF", + deg: "\u00B0", + plusmn: "\u00B1", + sup2: "\u00B2", + sup3: "\u00B3", + acute: "\u00B4", + micro: "\u00B5", + para: "\u00B6", + middot: "\u00B7", + cedil: "\u00B8", + sup1: "\u00B9", + ordm: "\u00BA", + raquo: "\u00BB", + frac14: "\u00BC", + frac12: "\u00BD", + frac34: "\u00BE", + iquest: "\u00BF", + Agrave: "\u00C0", + Aacute: "\u00C1", + Acirc: "\u00C2", + Atilde: "\u00C3", + Auml: "\u00C4", + Aring: "\u00C5", + AElig: "\u00C6", + Ccedil: "\u00C7", + Egrave: "\u00C8", + Eacute: "\u00C9", + Ecirc: "\u00CA", + Euml: "\u00CB", + Igrave: "\u00CC", + Iacute: "\u00CD", + Icirc: "\u00CE", + Iuml: "\u00CF", + ETH: "\u00D0", + Ntilde: "\u00D1", + Ograve: "\u00D2", + Oacute: "\u00D3", + Ocirc: "\u00D4", + Otilde: "\u00D5", + Ouml: "\u00D6", + times: "\u00D7", + Oslash: "\u00D8", + Ugrave: "\u00D9", + Uacute: "\u00DA", + Ucirc: "\u00DB", + Uuml: "\u00DC", + Yacute: "\u00DD", + THORN: "\u00DE", + szlig: "\u00DF", + agrave: "\u00E0", + aacute: "\u00E1", + acirc: "\u00E2", + atilde: "\u00E3", + auml: "\u00E4", + aring: "\u00E5", + aelig: "\u00E6", + ccedil: "\u00E7", + egrave: "\u00E8", + eacute: "\u00E9", + ecirc: "\u00EA", + euml: "\u00EB", + igrave: "\u00EC", + iacute: "\u00ED", + icirc: "\u00EE", + iuml: "\u00EF", + eth: "\u00F0", + ntilde: "\u00F1", + ograve: "\u00F2", + oacute: "\u00F3", + ocirc: "\u00F4", + otilde: "\u00F5", + ouml: "\u00F6", + divide: "\u00F7", + oslash: "\u00F8", + ugrave: "\u00F9", + uacute: "\u00FA", + ucirc: "\u00FB", + uuml: "\u00FC", + yacute: "\u00FD", + thorn: "\u00FE", + yuml: "\u00FF", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + fnof: "\u0192", + circ: "\u02C6", + tilde: "\u02DC", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + bull: "\u2022", + hellip: "\u2026", + permil: "\u2030", + prime: "\u2032", + Prime: "\u2033", + lsaquo: "\u2039", + rsaquo: "\u203A", + oline: "\u203E", + frasl: "\u2044", + euro: "\u20AC", + image: "\u2111", + weierp: "\u2118", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + int: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666" +}; +const lineBreak = /\r\n|[\r\n\u2028\u2029]/; +const lineBreakG = new RegExp(lineBreak.source, "g"); +function isNewLine(code) { + switch (code) { + case 10: + case 13: + case 8232: + case 8233: + return true; + default: + return false; + } +} +function hasNewLine(input, start, end) { + for (let i = start; i < end; i++) { + if (isNewLine(input.charCodeAt(i))) { + return true; + } + } + return false; +} +const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; +const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; +function isWhitespace(code) { + switch (code) { + case 0x0009: + case 0x000b: + case 0x000c: + case 32: + case 160: + case 5760: + case 0x2000: + case 0x2001: + case 0x2002: + case 0x2003: + case 0x2004: + case 0x2005: + case 0x2006: + case 0x2007: + case 0x2008: + case 0x2009: + case 0x200a: + case 0x202f: + case 0x205f: + case 0x3000: + case 0xfeff: + return true; + default: + return false; + } +} +const JsxErrors = ParseErrorEnum`jsx`({ + AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", + MissingClosingTagElement: ({ + openingTagName + }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, + MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", + UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", + UnexpectedToken: ({ + unexpected, + HTMLEntity + }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, + UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", + UnterminatedJsxContent: "Unterminated JSX contents.", + UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" +}); +function isFragment(object) { + return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; +} +function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; + } + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } + throw new Error("Node had unexpected type: " + object.type); +} +var jsx = superClass => class JSXParserMixin extends superClass { + jsxReadToken() { + let out = ""; + let chunkStart = this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 60: + case 123: + if (this.state.pos === this.state.start) { + if (ch === 60 && this.state.canStartJSXElement) { + ++this.state.pos; + this.finishToken(143); + } else { + super.getTokenFromCode(ch); + } + return; + } + out += this.input.slice(chunkStart, this.state.pos); + this.finishToken(142, out); + return; + case 38: + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + break; + case 62: + case 125: + default: + if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(true); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + } + } + jsxReadNewLine(normalizeCRLF) { + const ch = this.input.charCodeAt(this.state.pos); + let out; + ++this.state.pos; + if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + ++this.state.curLine; + this.state.lineStart = this.state.pos; + return out; + } + jsxReadString(quote) { + let out = ""; + let chunkStart = ++this.state.pos; + for (;;) { + if (this.state.pos >= this.length) { + throw this.raise(Errors.UnterminatedString, this.state.startLoc); + } + const ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + if (ch === 38) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + out += this.input.slice(chunkStart, this.state.pos++); + this.finishToken(134, out); + } + jsxReadEntity() { + const startPos = ++this.state.pos; + if (this.codePointAtPos(this.state.pos) === 35) { + ++this.state.pos; + let radix = 10; + if (this.codePointAtPos(this.state.pos) === 120) { + radix = 16; + ++this.state.pos; + } + const codePoint = this.readInt(radix, undefined, false, "bail"); + if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { + ++this.state.pos; + return String.fromCodePoint(codePoint); + } + } else { + let count = 0; + let semi = false; + while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) { + ++this.state.pos; + } + if (semi) { + const desc = this.input.slice(startPos, this.state.pos); + const entity = entities[desc]; + ++this.state.pos; + if (entity) { + return entity; + } + } + } + this.state.pos = startPos; + return "&"; + } + jsxReadWord() { + let ch; + const start = this.state.pos; + do { + ch = this.input.charCodeAt(++this.state.pos); + } while (isIdentifierChar(ch) || ch === 45); + this.finishToken(141, this.input.slice(start, this.state.pos)); + } + jsxParseIdentifier() { + const node = this.startNode(); + if (this.match(141)) { + node.name = this.state.value; + } else if (tokenIsKeyword(this.state.type)) { + node.name = tokenLabelName(this.state.type); + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "JSXIdentifier"); + } + jsxParseNamespacedName() { + const startLoc = this.state.startLoc; + const name = this.jsxParseIdentifier(); + if (!this.eat(14)) return name; + const node = this.startNodeAt(startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); + } + jsxParseElementName() { + const startLoc = this.state.startLoc; + let node = this.jsxParseNamespacedName(); + if (node.type === "JSXNamespacedName") { + return node; + } + while (this.eat(16)) { + const newNode = this.startNodeAt(startLoc); + newNode.object = node; + newNode.property = this.jsxParseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; + } + jsxParseAttributeValue() { + let node; + switch (this.state.type) { + case 5: + node = this.startNode(); + this.setContext(types.brace); + this.next(); + node = this.jsxParseExpressionContainer(node, types.j_oTag); + if (node.expression.type === "JSXEmptyExpression") { + this.raise(JsxErrors.AttributeIsEmpty, node); + } + return node; + case 143: + case 134: + return this.parseExprAtom(); + default: + throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); + } + } + jsxParseEmptyExpression() { + const node = this.startNodeAt(this.state.lastTokEndLoc); + return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); + } + jsxParseSpreadChild(node) { + this.next(); + node.expression = this.parseExpression(); + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadChild"); + } + jsxParseExpressionContainer(node, previousContext) { + if (this.match(8)) { + node.expression = this.jsxParseEmptyExpression(); + } else { + const expression = this.parseExpression(); + node.expression = expression; + } + this.setContext(previousContext); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXExpressionContainer"); + } + jsxParseAttribute() { + const node = this.startNode(); + if (this.match(5)) { + this.setContext(types.brace); + this.next(); + this.expect(21); + node.argument = this.parseMaybeAssignAllowIn(); + this.setContext(types.j_oTag); + this.state.canStartJSXElement = true; + this.expect(8); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsxParseNamespacedName(); + node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); + } + jsxParseOpeningElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(144)) { + return this.finishNode(node, "JSXOpeningFragment"); + } + node.name = this.jsxParseElementName(); + return this.jsxParseOpeningElementAfterName(node); + } + jsxParseOpeningElementAfterName(node) { + const attributes = []; + while (!this.match(56) && !this.match(144)) { + attributes.push(this.jsxParseAttribute()); + } + node.attributes = attributes; + node.selfClosing = this.eat(56); + this.expect(144); + return this.finishNode(node, "JSXOpeningElement"); + } + jsxParseClosingElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + if (this.eat(144)) { + return this.finishNode(node, "JSXClosingFragment"); + } + node.name = this.jsxParseElementName(); + this.expect(144); + return this.finishNode(node, "JSXClosingElement"); + } + jsxParseElementAt(startLoc) { + const node = this.startNodeAt(startLoc); + const children = []; + const openingElement = this.jsxParseOpeningElementAt(startLoc); + let closingElement = null; + if (!openingElement.selfClosing) { + contents: for (;;) { + switch (this.state.type) { + case 143: + startLoc = this.state.startLoc; + this.next(); + if (this.eat(56)) { + closingElement = this.jsxParseClosingElementAt(startLoc); + break contents; + } + children.push(this.jsxParseElementAt(startLoc)); + break; + case 142: + children.push(this.parseLiteral(this.state.value, "JSXText")); + break; + case 5: + { + const node = this.startNode(); + this.setContext(types.brace); + this.next(); + if (this.match(21)) { + children.push(this.jsxParseSpreadChild(node)); + } else { + children.push(this.jsxParseExpressionContainer(node, types.j_expr)); + } + break; + } + default: + this.unexpected(); + } + } + if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { + this.raise(JsxErrors.MissingClosingTagFragment, closingElement); + } else if (!isFragment(openingElement) && isFragment(closingElement)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } else if (!isFragment(openingElement) && !isFragment(closingElement)) { + if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { + this.raise(JsxErrors.MissingClosingTagElement, closingElement, { + openingTagName: getQualifiedJSXName(openingElement.name) + }); + } + } + } + if (isFragment(openingElement)) { + node.openingFragment = openingElement; + node.closingFragment = closingElement; + } else { + node.openingElement = openingElement; + node.closingElement = closingElement; + } + node.children = children; + if (this.match(47)) { + throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); + } + return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); + } + jsxParseElement() { + const startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startLoc); + } + setContext(newContext) { + const { + context + } = this.state; + context[context.length - 1] = newContext; + } + parseExprAtom(refExpressionErrors) { + if (this.match(143)) { + return this.jsxParseElement(); + } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { + this.replaceToken(143); + return this.jsxParseElement(); + } else { + return super.parseExprAtom(refExpressionErrors); + } + } + skipSpace() { + const curContext = this.curContext(); + if (!curContext.preserveSpace) super.skipSpace(); + } + getTokenFromCode(code) { + const context = this.curContext(); + if (context === types.j_expr) { + this.jsxReadToken(); + return; + } + if (context === types.j_oTag || context === types.j_cTag) { + if (isIdentifierStart(code)) { + this.jsxReadWord(); + return; + } + if (code === 62) { + ++this.state.pos; + this.finishToken(144); + return; + } + if ((code === 34 || code === 39) && context === types.j_oTag) { + this.jsxReadString(code); + return; + } + } + if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { + ++this.state.pos; + this.finishToken(143); + return; + } + super.getTokenFromCode(code); + } + updateContext(prevType) { + const { + context, + type + } = this.state; + if (type === 56 && prevType === 143) { + context.splice(-2, 2, types.j_cTag); + this.state.canStartJSXElement = false; + } else if (type === 143) { + context.push(types.j_oTag); + } else if (type === 144) { + const out = context[context.length - 1]; + if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { + context.pop(); + this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; + } else { + this.setContext(types.j_expr); + this.state.canStartJSXElement = true; + } + } else { + this.state.canStartJSXElement = tokenComesBeforeExpression(type); + } + } +}; +class TypeScriptScope extends Scope { + constructor(...args) { + super(...args); + this.tsNames = new Map(); + } +} +class TypeScriptScopeHandler extends ScopeHandler { + constructor(...args) { + super(...args); + this.importsStack = []; + } + createScope(flags) { + this.importsStack.push(new Set()); + return new TypeScriptScope(flags); + } + enter(flags) { + if (flags === 1024) { + this.importsStack.push(new Set()); + } + super.enter(flags); + } + exit() { + const flags = super.exit(); + if (flags === 1024) { + this.importsStack.pop(); + } + return flags; + } + hasImport(name, allowShadow) { + const len = this.importsStack.length; + if (this.importsStack[len - 1].has(name)) { + return true; + } + if (!allowShadow && len > 1) { + for (let i = 0; i < len - 1; i++) { + if (this.importsStack[i].has(name)) return true; + } + } + return false; + } + declareName(name, bindingType, loc) { + if (bindingType & 4096) { + if (this.hasImport(name, true)) { + this.parser.raise(Errors.VarRedeclaration, loc, { + identifierName: name + }); + } + this.importsStack[this.importsStack.length - 1].add(name); + return; + } + const scope = this.currentScope(); + let type = scope.tsNames.get(name) || 0; + if (bindingType & 1024) { + this.maybeExportDefined(scope, name); + scope.tsNames.set(name, type | 16); + return; + } + super.declareName(name, bindingType, loc); + if (bindingType & 2) { + if (!(bindingType & 1)) { + this.checkRedeclarationInScope(scope, name, bindingType, loc); + this.maybeExportDefined(scope, name); + } + type = type | 1; + } + if (bindingType & 256) { + type = type | 2; + } + if (bindingType & 512) { + type = type | 4; + } + if (bindingType & 128) { + type = type | 8; + } + if (type) scope.tsNames.set(name, type); + } + isRedeclaredInScope(scope, name, bindingType) { + const type = scope.tsNames.get(name); + if ((type & 2) > 0) { + if (bindingType & 256) { + const isConst = !!(bindingType & 512); + const wasConst = (type & 4) > 0; + return isConst !== wasConst; + } + return true; + } + if (bindingType & 128 && (type & 8) > 0) { + if (scope.names.get(name) & 2) { + return !!(bindingType & 1); + } else { + return false; + } + } + if (bindingType & 2 && (type & 1) > 0) { + return true; + } + return super.isRedeclaredInScope(scope, name, bindingType); + } + checkLocalExport(id) { + const { + name + } = id; + if (this.hasImport(name)) return; + const len = this.scopeStack.length; + for (let i = len - 1; i >= 0; i--) { + const scope = this.scopeStack[i]; + const type = scope.tsNames.get(name); + if ((type & 1) > 0 || (type & 16) > 0) { + return; + } + } + super.checkLocalExport(id); + } +} +class ProductionParameterHandler { + constructor() { + this.stacks = []; + } + enter(flags) { + this.stacks.push(flags); + } + exit() { + this.stacks.pop(); + } + currentFlags() { + return this.stacks[this.stacks.length - 1]; + } + get hasAwait() { + return (this.currentFlags() & 2) > 0; + } + get hasYield() { + return (this.currentFlags() & 1) > 0; + } + get hasReturn() { + return (this.currentFlags() & 4) > 0; + } + get hasIn() { + return (this.currentFlags() & 8) > 0; + } +} +function functionFlags(isAsync, isGenerator) { + return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); +} +class BaseParser { + constructor() { + this.sawUnambiguousESM = false; + this.ambiguousScriptDifferentAst = false; + } + sourceToOffsetPos(sourcePos) { + return sourcePos + this.startIndex; + } + offsetToSourcePos(offsetPos) { + return offsetPos - this.startIndex; + } + hasPlugin(pluginConfig) { + if (typeof pluginConfig === "string") { + return this.plugins.has(pluginConfig); + } else { + const [pluginName, pluginOptions] = pluginConfig; + if (!this.hasPlugin(pluginName)) { + return false; + } + const actualOptions = this.plugins.get(pluginName); + for (const key of Object.keys(pluginOptions)) { + if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { + return false; + } + } + return true; + } + } + getPluginOption(plugin, name) { + var _this$plugins$get; + return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; + } +} +function setTrailingComments(node, comments) { + if (node.trailingComments === undefined) { + node.trailingComments = comments; + } else { + node.trailingComments.unshift(...comments); + } +} +function setLeadingComments(node, comments) { + if (node.leadingComments === undefined) { + node.leadingComments = comments; + } else { + node.leadingComments.unshift(...comments); + } +} +function setInnerComments(node, comments) { + if (node.innerComments === undefined) { + node.innerComments = comments; + } else { + node.innerComments.unshift(...comments); + } +} +function adjustInnerComments(node, elements, commentWS) { + let lastElement = null; + let i = elements.length; + while (lastElement === null && i > 0) { + lastElement = elements[--i]; + } + if (lastElement === null || lastElement.start > commentWS.start) { + setInnerComments(node, commentWS.comments); + } else { + setTrailingComments(lastElement, commentWS.comments); + } +} +class CommentsParser extends BaseParser { + addComment(comment) { + if (this.filename) comment.loc.filename = this.filename; + const { + commentsLen + } = this.state; + if (this.comments.length !== commentsLen) { + this.comments.length = commentsLen; + } + this.comments.push(comment); + this.state.commentsLen++; + } + processComment(node) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + const lastCommentWS = commentStack[i]; + if (lastCommentWS.start === node.end) { + lastCommentWS.leadingNode = node; + i--; + } + const { + start: nodeStart + } = node; + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + if (commentEnd > nodeStart) { + commentWS.containingNode = node; + this.finalizeComment(commentWS); + commentStack.splice(i, 1); + } else { + if (commentEnd === nodeStart) { + commentWS.trailingNode = node; + } + break; + } + } + } + finalizeComment(commentWS) { + var _node$options; + const { + comments + } = commentWS; + if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { + if (commentWS.leadingNode !== null) { + setTrailingComments(commentWS.leadingNode, comments); + } + if (commentWS.trailingNode !== null) { + setLeadingComments(commentWS.trailingNode, comments); + } + } else { + const node = commentWS.containingNode; + const commentStart = commentWS.start; + if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + case "RecordExpression": + adjustInnerComments(node, node.properties, commentWS); + break; + case "CallExpression": + case "OptionalCallExpression": + adjustInnerComments(node, node.arguments, commentWS); + break; + case "ImportExpression": + adjustInnerComments(node, [node.source, (_node$options = node.options) != null ? _node$options : null], commentWS); + break; + case "FunctionDeclaration": + case "FunctionExpression": + case "ArrowFunctionExpression": + case "ObjectMethod": + case "ClassMethod": + case "ClassPrivateMethod": + adjustInnerComments(node, node.params, commentWS); + break; + case "ArrayExpression": + case "ArrayPattern": + case "TupleExpression": + adjustInnerComments(node, node.elements, commentWS); + break; + case "ExportNamedDeclaration": + case "ImportDeclaration": + adjustInnerComments(node, node.specifiers, commentWS); + break; + case "TSEnumDeclaration": + { + adjustInnerComments(node, node.members, commentWS); + } + break; + case "TSEnumBody": + adjustInnerComments(node, node.members, commentWS); + break; + default: + { + setInnerComments(node, comments); + } + } + } else { + setInnerComments(node, comments); + } + } + } + finalizeRemainingComments() { + const { + commentStack + } = this.state; + for (let i = commentStack.length - 1; i >= 0; i--) { + this.finalizeComment(commentStack[i]); + } + this.state.commentStack = []; + } + resetPreviousNodeTrailingComments(node) { + const { + commentStack + } = this.state; + const { + length + } = commentStack; + if (length === 0) return; + const commentWS = commentStack[length - 1]; + if (commentWS.leadingNode === node) { + commentWS.leadingNode = null; + } + } + takeSurroundingComments(node, start, end) { + const { + commentStack + } = this.state; + const commentStackLength = commentStack.length; + if (commentStackLength === 0) return; + let i = commentStackLength - 1; + for (; i >= 0; i--) { + const commentWS = commentStack[i]; + const commentEnd = commentWS.end; + const commentStart = commentWS.start; + if (commentStart === end) { + commentWS.leadingNode = node; + } else if (commentEnd === start) { + commentWS.trailingNode = node; + } else if (commentEnd < start) { + break; + } + } + } +} +class State { + constructor() { + this.flags = 1024; + this.startIndex = void 0; + this.curLine = void 0; + this.lineStart = void 0; + this.startLoc = void 0; + this.endLoc = void 0; + this.errors = []; + this.potentialArrowAt = -1; + this.noArrowAt = []; + this.noArrowParamsConversionAt = []; + this.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + this.labels = []; + this.commentsLen = 0; + this.commentStack = []; + this.pos = 0; + this.type = 140; + this.value = null; + this.start = 0; + this.end = 0; + this.lastTokEndLoc = null; + this.lastTokStartLoc = null; + this.context = [types.brace]; + this.firstInvalidTemplateEscapePos = null; + this.strictErrors = new Map(); + this.tokensLength = 0; + } + get strict() { + return (this.flags & 1) > 0; + } + set strict(v) { + if (v) this.flags |= 1;else this.flags &= -2; + } + init({ + strictMode, + sourceType, + startIndex, + startLine, + startColumn + }) { + this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; + this.startIndex = startIndex; + this.curLine = startLine; + this.lineStart = -startColumn; + this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex); + } + get maybeInArrowParameters() { + return (this.flags & 2) > 0; + } + set maybeInArrowParameters(v) { + if (v) this.flags |= 2;else this.flags &= -3; + } + get inType() { + return (this.flags & 4) > 0; + } + set inType(v) { + if (v) this.flags |= 4;else this.flags &= -5; + } + get noAnonFunctionType() { + return (this.flags & 8) > 0; + } + set noAnonFunctionType(v) { + if (v) this.flags |= 8;else this.flags &= -9; + } + get hasFlowComment() { + return (this.flags & 16) > 0; + } + set hasFlowComment(v) { + if (v) this.flags |= 16;else this.flags &= -17; + } + get isAmbientContext() { + return (this.flags & 32) > 0; + } + set isAmbientContext(v) { + if (v) this.flags |= 32;else this.flags &= -33; + } + get inAbstractClass() { + return (this.flags & 64) > 0; + } + set inAbstractClass(v) { + if (v) this.flags |= 64;else this.flags &= -65; + } + get inDisallowConditionalTypesContext() { + return (this.flags & 128) > 0; + } + set inDisallowConditionalTypesContext(v) { + if (v) this.flags |= 128;else this.flags &= -129; + } + get soloAwait() { + return (this.flags & 256) > 0; + } + set soloAwait(v) { + if (v) this.flags |= 256;else this.flags &= -257; + } + get inFSharpPipelineDirectBody() { + return (this.flags & 512) > 0; + } + set inFSharpPipelineDirectBody(v) { + if (v) this.flags |= 512;else this.flags &= -513; + } + get canStartJSXElement() { + return (this.flags & 1024) > 0; + } + set canStartJSXElement(v) { + if (v) this.flags |= 1024;else this.flags &= -1025; + } + get containsEsc() { + return (this.flags & 2048) > 0; + } + set containsEsc(v) { + if (v) this.flags |= 2048;else this.flags &= -2049; + } + get hasTopLevelAwait() { + return (this.flags & 4096) > 0; + } + set hasTopLevelAwait(v) { + if (v) this.flags |= 4096;else this.flags &= -4097; + } + curPosition() { + return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex); + } + clone() { + const state = new State(); + state.flags = this.flags; + state.startIndex = this.startIndex; + state.curLine = this.curLine; + state.lineStart = this.lineStart; + state.startLoc = this.startLoc; + state.endLoc = this.endLoc; + state.errors = this.errors.slice(); + state.potentialArrowAt = this.potentialArrowAt; + state.noArrowAt = this.noArrowAt.slice(); + state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(); + state.topicContext = this.topicContext; + state.labels = this.labels.slice(); + state.commentsLen = this.commentsLen; + state.commentStack = this.commentStack.slice(); + state.pos = this.pos; + state.type = this.type; + state.value = this.value; + state.start = this.start; + state.end = this.end; + state.lastTokEndLoc = this.lastTokEndLoc; + state.lastTokStartLoc = this.lastTokStartLoc; + state.context = this.context.slice(); + state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos; + state.strictErrors = this.strictErrors; + state.tokensLength = this.tokensLength; + return state; + } +} +var _isDigit = function isDigit(code) { + return code >= 48 && code <= 57; +}; +const forbiddenNumericSeparatorSiblings = { + decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), + hex: new Set([46, 88, 95, 120]) +}; +const isAllowedNumericSeparatorSibling = { + bin: ch => ch === 48 || ch === 49, + oct: ch => ch >= 48 && ch <= 55, + dec: ch => ch >= 48 && ch <= 57, + hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 +}; +function readStringContents(type, input, pos, lineStart, curLine, errors) { + const initialPos = pos; + const initialLineStart = lineStart; + const initialCurLine = curLine; + let out = ""; + let firstInvalidLoc = null; + let chunkStart = pos; + const { + length + } = input; + for (;;) { + if (pos >= length) { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + out += input.slice(chunkStart, pos); + break; + } + const ch = input.charCodeAt(pos); + if (isStringEnd(type, ch, input, pos)) { + out += input.slice(chunkStart, pos); + break; + } + if (ch === 92) { + out += input.slice(chunkStart, pos); + const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); + if (res.ch === null && !firstInvalidLoc) { + firstInvalidLoc = { + pos, + lineStart, + curLine + }; + } else { + out += res.ch; + } + ({ + pos, + lineStart, + curLine + } = res); + chunkStart = pos; + } else if (ch === 8232 || ch === 8233) { + ++pos; + ++curLine; + lineStart = pos; + } else if (ch === 10 || ch === 13) { + if (type === "template") { + out += input.slice(chunkStart, pos) + "\n"; + ++pos; + if (ch === 13 && input.charCodeAt(pos) === 10) { + ++pos; + } + ++curLine; + chunkStart = lineStart = pos; + } else { + errors.unterminated(initialPos, initialLineStart, initialCurLine); + } + } else { + ++pos; + } + } + return { + pos, + str: out, + firstInvalidLoc, + lineStart, + curLine, + containsInvalid: !!firstInvalidLoc + }; +} +function isStringEnd(type, ch, input, pos) { + if (type === "template") { + return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; + } + return ch === (type === "double" ? 34 : 39); +} +function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { + const throwOnInvalid = !inTemplate; + pos++; + const res = ch => ({ + pos, + ch, + lineStart, + curLine + }); + const ch = input.charCodeAt(pos++); + switch (ch) { + case 110: + return res("\n"); + case 114: + return res("\r"); + case 120: + { + let code; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCharCode(code)); + } + case 117: + { + let code; + ({ + code, + pos + } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); + return res(code === null ? null : String.fromCodePoint(code)); + } + case 116: + return res("\t"); + case 98: + return res("\b"); + case 118: + return res("\u000b"); + case 102: + return res("\f"); + case 13: + if (input.charCodeAt(pos) === 10) { + ++pos; + } + case 10: + lineStart = pos; + ++curLine; + case 8232: + case 8233: + return res(""); + case 56: + case 57: + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(pos - 1, lineStart, curLine); + } + default: + if (ch >= 48 && ch <= 55) { + const startPos = pos - 1; + const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); + let octalStr = match[0]; + let octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + pos += octalStr.length - 1; + const next = input.charCodeAt(pos); + if (octalStr !== "0" || next === 56 || next === 57) { + if (inTemplate) { + return res(null); + } else { + errors.strictNumericEscape(startPos, lineStart, curLine); + } + } + return res(String.fromCharCode(octal)); + } + return res(String.fromCharCode(ch)); + } +} +function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { + const initialPos = pos; + let n; + ({ + n, + pos + } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); + if (n === null) { + if (throwOnInvalid) { + errors.invalidEscapeSequence(initialPos, lineStart, curLine); + } else { + pos = initialPos - 1; + } + } + return { + code: n, + pos + }; +} +function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { + const start = pos; + const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; + const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; + let invalid = false; + let total = 0; + for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { + const code = input.charCodeAt(pos); + let val; + if (code === 95 && allowNumSeparator !== "bail") { + const prev = input.charCodeAt(pos - 1); + const next = input.charCodeAt(pos + 1); + if (!allowNumSeparator) { + if (bailOnError) return { + n: null, + pos + }; + errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); + } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { + if (bailOnError) return { + n: null, + pos + }; + errors.unexpectedNumericSeparator(pos, lineStart, curLine); + } + ++pos; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (_isDigit(code)) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + if (val <= 9 && bailOnError) { + return { + n: null, + pos + }; + } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { + val = 0; + } else if (forceLen) { + val = 0; + invalid = true; + } else { + break; + } + } + ++pos; + total = total * radix + val; + } + if (pos === start || len != null && pos - start !== len || invalid) { + return { + n: null, + pos + }; + } + return { + n: total, + pos + }; +} +function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { + const ch = input.charCodeAt(pos); + let code; + if (ch === 123) { + ++pos; + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); + ++pos; + if (code !== null && code > 0x10ffff) { + if (throwOnInvalid) { + errors.invalidCodePoint(pos, lineStart, curLine); + } else { + return { + code: null, + pos + }; + } + } + } else { + ({ + code, + pos + } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); + } + return { + code, + pos + }; +} +function buildPosition(pos, lineStart, curLine) { + return new Position(curLine, pos - lineStart, pos); +} +const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); +class Token { + constructor(state) { + const startIndex = state.startIndex || 0; + this.type = state.type; + this.value = state.value; + this.start = startIndex + state.start; + this.end = startIndex + state.end; + this.loc = new SourceLocation(state.startLoc, state.endLoc); + } +} +class Tokenizer extends CommentsParser { + constructor(options, input) { + super(); + this.isLookahead = void 0; + this.tokens = []; + this.errorHandlers_readInt = { + invalidDigit: (pos, lineStart, curLine, radix) => { + if (!(this.optionFlags & 2048)) return false; + this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { + radix + }); + return true; + }, + numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence), + unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator) + }; + this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { + invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence), + invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint) + }); + this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { + strictNumericEscape: (pos, lineStart, curLine) => { + this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine)); + }, + unterminated: (pos, lineStart, curLine) => { + throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine)); + } + }); + this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { + strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), + unterminated: (pos, lineStart, curLine) => { + throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine)); + } + }); + this.state = new State(); + this.state.init(options); + this.input = input; + this.length = input.length; + this.comments = []; + this.isLookahead = false; + } + pushToken(token) { + this.tokens.length = this.state.tokensLength; + this.tokens.push(token); + ++this.state.tokensLength; + } + next() { + this.checkKeywordEscapes(); + if (this.optionFlags & 256) { + this.pushToken(new Token(this.state)); + } + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + } + eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + } + match(type) { + return this.state.type === type; + } + createLookaheadState(state) { + return { + pos: state.pos, + value: null, + type: state.type, + start: state.start, + end: state.end, + context: [this.curContext()], + inType: state.inType, + startLoc: state.startLoc, + lastTokEndLoc: state.lastTokEndLoc, + curLine: state.curLine, + lineStart: state.lineStart, + curPosition: state.curPosition + }; + } + lookahead() { + const old = this.state; + this.state = this.createLookaheadState(old); + this.isLookahead = true; + this.nextToken(); + this.isLookahead = false; + const curr = this.state; + this.state = old; + return curr; + } + nextTokenStart() { + return this.nextTokenStartSince(this.state.pos); + } + nextTokenStartSince(pos) { + skipWhiteSpace.lastIndex = pos; + return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; + } + lookaheadCharCode() { + return this.lookaheadCharCodeSince(this.state.pos); + } + lookaheadCharCodeSince(pos) { + return this.input.charCodeAt(this.nextTokenStartSince(pos)); + } + nextTokenInLineStart() { + return this.nextTokenInLineStartSince(this.state.pos); + } + nextTokenInLineStartSince(pos) { + skipWhiteSpaceInLine.lastIndex = pos; + return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos; + } + lookaheadInLineCharCode() { + return this.input.charCodeAt(this.nextTokenInLineStart()); + } + codePointAtPos(pos) { + let cp = this.input.charCodeAt(pos); + if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { + const trail = this.input.charCodeAt(pos); + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + return cp; + } + setStrict(strict) { + this.state.strict = strict; + if (strict) { + this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at)); + this.state.strictErrors.clear(); + } + } + curContext() { + return this.state.context[this.state.context.length - 1]; + } + nextToken() { + this.skipSpace(); + this.state.start = this.state.pos; + if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); + if (this.state.pos >= this.length) { + this.finishToken(140); + return; + } + this.getTokenFromCode(this.codePointAtPos(this.state.pos)); + } + skipBlockComment(commentEnd) { + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + const start = this.state.pos; + const end = this.input.indexOf(commentEnd, start + 2); + if (end === -1) { + throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); + } + this.state.pos = end + commentEnd.length; + lineBreakG.lastIndex = start + 2; + while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { + ++this.state.curLine; + this.state.lineStart = lineBreakG.lastIndex; + } + if (this.isLookahead) return; + const comment = { + type: "CommentBlock", + value: this.input.slice(start + 2, end), + start: this.sourceToOffsetPos(start), + end: this.sourceToOffsetPos(end + commentEnd.length), + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.optionFlags & 256) this.pushToken(comment); + return comment; + } + skipLineComment(startSkip) { + const start = this.state.pos; + let startLoc; + if (!this.isLookahead) startLoc = this.state.curPosition(); + let ch = this.input.charCodeAt(this.state.pos += startSkip); + if (this.state.pos < this.length) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + } + if (this.isLookahead) return; + const end = this.state.pos; + const value = this.input.slice(start + startSkip, end); + const comment = { + type: "CommentLine", + value, + start: this.sourceToOffsetPos(start), + end: this.sourceToOffsetPos(end), + loc: new SourceLocation(startLoc, this.state.curPosition()) + }; + if (this.optionFlags & 256) this.pushToken(comment); + return comment; + } + skipSpace() { + const spaceStart = this.state.pos; + const comments = this.optionFlags & 4096 ? [] : null; + loop: while (this.state.pos < this.length) { + const ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 32: + case 160: + case 9: + ++this.state.pos; + break; + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + case 10: + case 8232: + case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + case 47: + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + { + const comment = this.skipBlockComment("*/"); + if (comment !== undefined) { + this.addComment(comment); + comments == null || comments.push(comment); + } + break; + } + case 47: + { + const comment = this.skipLineComment(2); + if (comment !== undefined) { + this.addComment(comment); + comments == null || comments.push(comment); + } + break; + } + default: + break loop; + } + break; + default: + if (isWhitespace(ch)) { + ++this.state.pos; + } else if (ch === 45 && !this.inModule && this.optionFlags & 8192) { + const pos = this.state.pos; + if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { + const comment = this.skipLineComment(3); + if (comment !== undefined) { + this.addComment(comment); + comments == null || comments.push(comment); + } + } else { + break loop; + } + } else if (ch === 60 && !this.inModule && this.optionFlags & 8192) { + const pos = this.state.pos; + if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { + const comment = this.skipLineComment(4); + if (comment !== undefined) { + this.addComment(comment); + comments == null || comments.push(comment); + } + } else { + break loop; + } + } else { + break loop; + } + } + } + if ((comments == null ? void 0 : comments.length) > 0) { + const end = this.state.pos; + const commentWhitespace = { + start: this.sourceToOffsetPos(spaceStart), + end: this.sourceToOffsetPos(end), + comments: comments, + leadingNode: null, + trailingNode: null, + containingNode: null + }; + this.state.commentStack.push(commentWhitespace); + } + } + finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + const prevType = this.state.type; + this.state.type = type; + this.state.value = val; + if (!this.isLookahead) { + this.updateContext(prevType); + } + } + replaceToken(type) { + this.state.type = type; + this.updateContext(); + } + readToken_numberSign() { + if (this.state.pos === 0 && this.readToken_interpreter()) { + return; + } + const nextPos = this.state.pos + 1; + const next = this.codePointAtPos(nextPos); + if (next >= 48 && next <= 57) { + throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition()); + } + if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { + this.expectPlugin("recordAndTuple"); + if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { + throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + if (next === 123) { + this.finishToken(7); + } else { + this.finishToken(1); + } + } else if (isIdentifierStart(next)) { + ++this.state.pos; + this.finishToken(139, this.readWord1(next)); + } else if (next === 92) { + ++this.state.pos; + this.finishToken(139, this.readWord1()); + } else { + this.finishOp(27, 1); + } + } + readToken_dot() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next >= 48 && next <= 57) { + this.readNumber(true); + return; + } + if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { + this.state.pos += 3; + this.finishToken(21); + } else { + ++this.state.pos; + this.finishToken(16); + } + } + readToken_slash() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + this.finishOp(31, 2); + } else { + this.finishOp(56, 1); + } + } + readToken_interpreter() { + if (this.state.pos !== 0 || this.length < 2) return false; + let ch = this.input.charCodeAt(this.state.pos + 1); + if (ch !== 33) return false; + const start = this.state.pos; + this.state.pos += 1; + while (!isNewLine(ch) && ++this.state.pos < this.length) { + ch = this.input.charCodeAt(this.state.pos); + } + const value = this.input.slice(start + 2, this.state.pos); + this.finishToken(28, value); + return true; + } + readToken_mult_modulo(code) { + let type = code === 42 ? 55 : 54; + let width = 1; + let next = this.input.charCodeAt(this.state.pos + 1); + if (code === 42 && next === 42) { + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = 57; + } + if (next === 61 && !this.state.inType) { + width++; + type = code === 37 ? 33 : 30; + } + this.finishOp(type, width); + } + readToken_pipe_amp(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) { + if (this.input.charCodeAt(this.state.pos + 2) === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(code === 124 ? 41 : 42, 2); + } + return; + } + if (code === 124) { + if (next === 62) { + this.finishOp(39, 2); + return; + } + if (this.hasPlugin("recordAndTuple") && next === 125) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(9); + return; + } + if (this.hasPlugin("recordAndTuple") && next === 93) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(4); + return; + } + } + if (next === 61) { + this.finishOp(30, 2); + return; + } + this.finishOp(code === 124 ? 43 : 45, 1); + } + readToken_caret() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61 && !this.state.inType) { + this.finishOp(32, 2); + } else if (next === 94 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "^^" + }])) { + this.finishOp(37, 2); + const lookaheadCh = this.input.codePointAt(this.state.pos); + if (lookaheadCh === 94) { + this.unexpected(); + } + } else { + this.finishOp(44, 1); + } + } + readToken_atSign() { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 64 && this.hasPlugin(["pipelineOperator", { + proposal: "hack", + topicToken: "@@" + }])) { + this.finishOp(38, 2); + } else { + this.finishOp(26, 1); + } + } + readToken_plus_min(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) { + this.finishOp(34, 2); + return; + } + if (next === 61) { + this.finishOp(30, 2); + } else { + this.finishOp(53, 1); + } + } + readToken_lt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + if (next === 60) { + if (this.input.charCodeAt(pos + 2) === 61) { + this.finishOp(30, 3); + return; + } + this.finishOp(51, 2); + return; + } + if (next === 61) { + this.finishOp(49, 2); + return; + } + this.finishOp(47, 1); + } + readToken_gt() { + const { + pos + } = this.state; + const next = this.input.charCodeAt(pos + 1); + if (next === 62) { + const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(pos + size) === 61) { + this.finishOp(30, size + 1); + return; + } + this.finishOp(52, size); + return; + } + if (next === 61) { + this.finishOp(49, 2); + return; + } + this.finishOp(48, 1); + } + readToken_eq_excl(code) { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); + return; + } + if (code === 61 && next === 62) { + this.state.pos += 2; + this.finishToken(19); + return; + } + this.finishOp(code === 61 ? 29 : 35, 1); + } + readToken_question() { + const next = this.input.charCodeAt(this.state.pos + 1); + const next2 = this.input.charCodeAt(this.state.pos + 2); + if (next === 63) { + if (next2 === 61) { + this.finishOp(30, 3); + } else { + this.finishOp(40, 2); + } + } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { + this.state.pos += 2; + this.finishToken(18); + } else { + ++this.state.pos; + this.finishToken(17); + } + } + getTokenFromCode(code) { + switch (code) { + case 46: + this.readToken_dot(); + return; + case 40: + ++this.state.pos; + this.finishToken(10); + return; + case 41: + ++this.state.pos; + this.finishToken(11); + return; + case 59: + ++this.state.pos; + this.finishToken(13); + return; + case 44: + ++this.state.pos; + this.finishToken(12); + return; + case 91: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(2); + } else { + ++this.state.pos; + this.finishToken(0); + } + return; + case 93: + ++this.state.pos; + this.finishToken(3); + return; + case 123: + if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { + if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { + throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); + } + this.state.pos += 2; + this.finishToken(6); + } else { + ++this.state.pos; + this.finishToken(5); + } + return; + case 125: + ++this.state.pos; + this.finishToken(8); + return; + case 58: + if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { + this.finishOp(15, 2); + } else { + ++this.state.pos; + this.finishToken(14); + } + return; + case 63: + this.readToken_question(); + return; + case 96: + this.readTemplateToken(); + return; + case 48: + { + const next = this.input.charCodeAt(this.state.pos + 1); + if (next === 120 || next === 88) { + this.readRadixNumber(16); + return; + } + if (next === 111 || next === 79) { + this.readRadixNumber(8); + return; + } + if (next === 98 || next === 66) { + this.readRadixNumber(2); + return; + } + } + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + this.readNumber(false); + return; + case 34: + case 39: + this.readString(code); + return; + case 47: + this.readToken_slash(); + return; + case 37: + case 42: + this.readToken_mult_modulo(code); + return; + case 124: + case 38: + this.readToken_pipe_amp(code); + return; + case 94: + this.readToken_caret(); + return; + case 43: + case 45: + this.readToken_plus_min(code); + return; + case 60: + this.readToken_lt(); + return; + case 62: + this.readToken_gt(); + return; + case 61: + case 33: + this.readToken_eq_excl(code); + return; + case 126: + this.finishOp(36, 1); + return; + case 64: + this.readToken_atSign(); + return; + case 35: + this.readToken_numberSign(); + return; + case 92: + this.readWord(); + return; + default: + if (isIdentifierStart(code)) { + this.readWord(code); + return; + } + } + throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), { + unexpected: String.fromCodePoint(code) + }); + } + finishOp(type, size) { + const str = this.input.slice(this.state.pos, this.state.pos + size); + this.state.pos += size; + this.finishToken(type, str); + } + readRegexp() { + const startLoc = this.state.startLoc; + const start = this.state.start + 1; + let escaped, inClass; + let { + pos + } = this.state; + for (;; ++pos) { + if (pos >= this.length) { + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); + } + const ch = this.input.charCodeAt(pos); + if (isNewLine(ch)) { + throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); + } + if (escaped) { + escaped = false; + } else { + if (ch === 91) { + inClass = true; + } else if (ch === 93 && inClass) { + inClass = false; + } else if (ch === 47 && !inClass) { + break; + } + escaped = ch === 92; + } + } + const content = this.input.slice(start, pos); + ++pos; + let mods = ""; + const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start); + while (pos < this.length) { + const cp = this.codePointAtPos(pos); + const char = String.fromCharCode(cp); + if (VALID_REGEX_FLAGS.has(cp)) { + if (cp === 118) { + if (mods.includes("u")) { + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); + } + } else if (cp === 117) { + if (mods.includes("v")) { + this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); + } + } + if (mods.includes(char)) { + this.raise(Errors.DuplicateRegExpFlags, nextPos()); + } + } else if (isIdentifierChar(cp) || cp === 92) { + this.raise(Errors.MalformedRegExpFlags, nextPos()); + } else { + break; + } + ++pos; + mods += char; + } + this.state.pos = pos; + this.finishToken(138, { + pattern: content, + flags: mods + }); + } + readInt(radix, len, forceLen = false, allowNumSeparator = true) { + const { + n, + pos + } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); + this.state.pos = pos; + return n; + } + readRadixNumber(radix) { + const start = this.state.pos; + const startLoc = this.state.curPosition(); + let isBigInt = false; + this.state.pos += 2; + const val = this.readInt(radix); + if (val == null) { + this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), { + radix + }); + } + const next = this.input.charCodeAt(this.state.pos); + if (next === 110) { + ++this.state.pos; + isBigInt = true; + } else if (next === 109) { + throw this.raise(Errors.InvalidDecimal, startLoc); + } + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); + } + if (isBigInt) { + const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); + this.finishToken(136, str); + return; + } + this.finishToken(135, val); + } + readNumber(startsWithDot) { + const start = this.state.pos; + const startLoc = this.state.curPosition(); + let isFloat = false; + let isBigInt = false; + let hasExponent = false; + let isOctal = false; + if (!startsWithDot && this.readInt(10) === null) { + this.raise(Errors.InvalidNumber, this.state.curPosition()); + } + const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; + if (hasLeadingZero) { + const integer = this.input.slice(start, this.state.pos); + this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc); + if (!this.state.strict) { + const underscorePos = integer.indexOf("_"); + if (underscorePos > 0) { + this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos)); + } + } + isOctal = hasLeadingZero && !/[89]/.test(integer); + } + let next = this.input.charCodeAt(this.state.pos); + if (next === 46 && !isOctal) { + ++this.state.pos; + this.readInt(10); + isFloat = true; + next = this.input.charCodeAt(this.state.pos); + } + if ((next === 69 || next === 101) && !isOctal) { + next = this.input.charCodeAt(++this.state.pos); + if (next === 43 || next === 45) { + ++this.state.pos; + } + if (this.readInt(10) === null) { + this.raise(Errors.InvalidOrMissingExponent, startLoc); + } + isFloat = true; + hasExponent = true; + next = this.input.charCodeAt(this.state.pos); + } + if (next === 110) { + if (isFloat || hasLeadingZero) { + this.raise(Errors.InvalidBigIntLiteral, startLoc); + } + ++this.state.pos; + isBigInt = true; + } + if (next === 109) { + this.expectPlugin("decimal", this.state.curPosition()); + if (hasExponent || hasLeadingZero) { + this.raise(Errors.InvalidDecimal, startLoc); + } + ++this.state.pos; + var isDecimal = true; + } + if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { + throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); + } + const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); + if (isBigInt) { + this.finishToken(136, str); + return; + } + if (isDecimal) { + this.finishToken(137, str); + return; + } + const val = isOctal ? parseInt(str, 8) : parseFloat(str); + this.finishToken(135, val); + } + readCodePoint(throwOnInvalid) { + const { + code, + pos + } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); + this.state.pos = pos; + return code; + } + readString(quote) { + const { + str, + pos, + curLine, + lineStart + } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); + this.state.pos = pos + 1; + this.state.lineStart = lineStart; + this.state.curLine = curLine; + this.finishToken(134, str); + } + readTemplateContinuation() { + if (!this.match(8)) { + this.unexpected(null, 8); + } + this.state.pos--; + this.readTemplateToken(); + } + readTemplateToken() { + const opening = this.input[this.state.pos]; + const { + str, + firstInvalidLoc, + pos, + curLine, + lineStart + } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); + this.state.pos = pos + 1; + this.state.lineStart = lineStart; + this.state.curLine = curLine; + if (firstInvalidLoc) { + this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos)); + } + if (this.input.codePointAt(pos) === 96) { + this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); + } else { + this.state.pos++; + this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); + } + } + recordStrictModeErrors(toParseError, at) { + const index = at.index; + if (this.state.strict && !this.state.strictErrors.has(index)) { + this.raise(toParseError, at); + } else { + this.state.strictErrors.set(index, [toParseError, at]); + } + } + readWord1(firstCode) { + this.state.containsEsc = false; + let word = ""; + const start = this.state.pos; + let chunkStart = this.state.pos; + if (firstCode !== undefined) { + this.state.pos += firstCode <= 0xffff ? 1 : 2; + } + while (this.state.pos < this.length) { + const ch = this.codePointAtPos(this.state.pos); + if (isIdentifierChar(ch)) { + this.state.pos += ch <= 0xffff ? 1 : 2; + } else if (ch === 92) { + this.state.containsEsc = true; + word += this.input.slice(chunkStart, this.state.pos); + const escStart = this.state.curPosition(); + const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; + if (this.input.charCodeAt(++this.state.pos) !== 117) { + this.raise(Errors.MissingUnicodeEscape, this.state.curPosition()); + chunkStart = this.state.pos - 1; + continue; + } + ++this.state.pos; + const esc = this.readCodePoint(true); + if (esc !== null) { + if (!identifierCheck(esc)) { + this.raise(Errors.EscapedCharNotAnIdentifier, escStart); + } + word += String.fromCodePoint(esc); + } + chunkStart = this.state.pos; + } else { + break; + } + } + return word + this.input.slice(chunkStart, this.state.pos); + } + readWord(firstCode) { + const word = this.readWord1(firstCode); + const type = keywords$1.get(word); + if (type !== undefined) { + this.finishToken(type, tokenLabelName(type)); + } else { + this.finishToken(132, word); + } + } + checkKeywordEscapes() { + const { + type + } = this.state; + if (tokenIsKeyword(type) && this.state.containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, { + reservedWord: tokenLabelName(type) + }); + } + } + raise(toParseError, at, details = {}) { + const loc = at instanceof Position ? at : at.loc.start; + const error = toParseError(loc, details); + if (!(this.optionFlags & 2048)) throw error; + if (!this.isLookahead) this.state.errors.push(error); + return error; + } + raiseOverwrite(toParseError, at, details = {}) { + const loc = at instanceof Position ? at : at.loc.start; + const pos = loc.index; + const errors = this.state.errors; + for (let i = errors.length - 1; i >= 0; i--) { + const error = errors[i]; + if (error.loc.index === pos) { + return errors[i] = toParseError(loc, details); + } + if (error.loc.index < pos) break; + } + return this.raise(toParseError, at, details); + } + updateContext(prevType) {} + unexpected(loc, type) { + throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, { + expected: type ? tokenLabelName(type) : null + }); + } + expectPlugin(pluginName, loc) { + if (this.hasPlugin(pluginName)) { + return true; + } + throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, { + missingPlugin: [pluginName] + }); + } + expectOnePlugin(pluginNames) { + if (!pluginNames.some(name => this.hasPlugin(name))) { + throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, { + missingPlugin: pluginNames + }); + } + } + errorBuilder(error) { + return (pos, lineStart, curLine) => { + this.raise(error, buildPosition(pos, lineStart, curLine)); + }; + } +} +class ClassScope { + constructor() { + this.privateNames = new Set(); + this.loneAccessors = new Map(); + this.undefinedPrivateNames = new Map(); + } +} +class ClassScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = []; + this.undefinedPrivateNames = new Map(); + this.parser = parser; + } + current() { + return this.stack[this.stack.length - 1]; + } + enter() { + this.stack.push(new ClassScope()); + } + exit() { + const oldClassScope = this.stack.pop(); + const current = this.current(); + for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { + if (current) { + if (!current.undefinedPrivateNames.has(name)) { + current.undefinedPrivateNames.set(name, loc); + } + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { + identifierName: name + }); + } + } + } + declarePrivateName(name, elementType, loc) { + const { + privateNames, + loneAccessors, + undefinedPrivateNames + } = this.current(); + let redefined = privateNames.has(name); + if (elementType & 3) { + const accessor = redefined && loneAccessors.get(name); + if (accessor) { + const oldStatic = accessor & 4; + const newStatic = elementType & 4; + const oldKind = accessor & 3; + const newKind = elementType & 3; + redefined = oldKind === newKind || oldStatic !== newStatic; + if (!redefined) loneAccessors.delete(name); + } else if (!redefined) { + loneAccessors.set(name, elementType); + } + } + if (redefined) { + this.parser.raise(Errors.PrivateNameRedeclaration, loc, { + identifierName: name + }); + } + privateNames.add(name); + undefinedPrivateNames.delete(name); + } + usePrivateName(name, loc) { + let classScope; + for (classScope of this.stack) { + if (classScope.privateNames.has(name)) return; + } + if (classScope) { + classScope.undefinedPrivateNames.set(name, loc); + } else { + this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { + identifierName: name + }); + } + } +} +class ExpressionScope { + constructor(type = 0) { + this.type = type; + } + canBeArrowParameterDeclaration() { + return this.type === 2 || this.type === 1; + } + isCertainlyParameterDeclaration() { + return this.type === 3; + } +} +class ArrowHeadParsingScope extends ExpressionScope { + constructor(type) { + super(type); + this.declarationErrors = new Map(); + } + recordDeclarationError(ParsingErrorClass, at) { + const index = at.index; + this.declarationErrors.set(index, [ParsingErrorClass, at]); + } + clearDeclarationError(index) { + this.declarationErrors.delete(index); + } + iterateErrors(iterator) { + this.declarationErrors.forEach(iterator); + } +} +class ExpressionScopeHandler { + constructor(parser) { + this.parser = void 0; + this.stack = [new ExpressionScope()]; + this.parser = parser; + } + enter(scope) { + this.stack.push(scope); + } + exit() { + this.stack.pop(); + } + recordParameterInitializerError(toParseError, node) { + const origin = node.loc.start; + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + while (!scope.isCertainlyParameterDeclaration()) { + if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(toParseError, origin); + } else { + return; + } + scope = stack[--i]; + } + this.parser.raise(toParseError, origin); + } + recordArrowParameterBindingError(error, node) { + const { + stack + } = this; + const scope = stack[stack.length - 1]; + const origin = node.loc.start; + if (scope.isCertainlyParameterDeclaration()) { + this.parser.raise(error, origin); + } else if (scope.canBeArrowParameterDeclaration()) { + scope.recordDeclarationError(error, origin); + } else { + return; + } + } + recordAsyncArrowParametersError(at) { + const { + stack + } = this; + let i = stack.length - 1; + let scope = stack[i]; + while (scope.canBeArrowParameterDeclaration()) { + if (scope.type === 2) { + scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at); + } + scope = stack[--i]; + } + } + validateAsPattern() { + const { + stack + } = this; + const currentScope = stack[stack.length - 1]; + if (!currentScope.canBeArrowParameterDeclaration()) return; + currentScope.iterateErrors(([toParseError, loc]) => { + this.parser.raise(toParseError, loc); + let i = stack.length - 2; + let scope = stack[i]; + while (scope.canBeArrowParameterDeclaration()) { + scope.clearDeclarationError(loc.index); + scope = stack[--i]; + } + }); + } +} +function newParameterDeclarationScope() { + return new ExpressionScope(3); +} +function newArrowHeadScope() { + return new ArrowHeadParsingScope(1); +} +function newAsyncArrowScope() { + return new ArrowHeadParsingScope(2); +} +function newExpressionScope() { + return new ExpressionScope(); +} +class UtilParser extends Tokenizer { + addExtra(node, key, value, enumerable = true) { + if (!node) return; + let { + extra + } = node; + if (extra == null) { + extra = {}; + node.extra = extra; + } + if (enumerable) { + extra[key] = value; + } else { + Object.defineProperty(extra, key, { + enumerable, + value + }); + } + } + isContextual(token) { + return this.state.type === token && !this.state.containsEsc; + } + isUnparsedContextual(nameStart, name) { + if (this.input.startsWith(name, nameStart)) { + const nextCh = this.input.charCodeAt(nameStart + name.length); + return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); + } + return false; + } + isLookaheadContextual(name) { + const next = this.nextTokenStart(); + return this.isUnparsedContextual(next, name); + } + eatContextual(token) { + if (this.isContextual(token)) { + this.next(); + return true; + } + return false; + } + expectContextual(token, toParseError) { + if (!this.eatContextual(token)) { + if (toParseError != null) { + throw this.raise(toParseError, this.state.startLoc); + } + this.unexpected(null, token); + } + } + canInsertSemicolon() { + return this.match(140) || this.match(8) || this.hasPrecedingLineBreak(); + } + hasPrecedingLineBreak() { + return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start); + } + hasFollowingLineBreak() { + return hasNewLine(this.input, this.state.end, this.nextTokenStart()); + } + isLineTerminator() { + return this.eat(13) || this.canInsertSemicolon(); + } + semicolon(allowAsi = true) { + if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; + this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc); + } + expect(type, loc) { + if (!this.eat(type)) { + this.unexpected(loc, type); + } + } + tryParse(fn, oldState = this.state.clone()) { + const abortSignal = { + node: null + }; + try { + const node = fn((node = null) => { + abortSignal.node = node; + throw abortSignal; + }); + if (this.state.errors.length > oldState.errors.length) { + const failState = this.state; + this.state = oldState; + this.state.tokensLength = failState.tokensLength; + return { + node, + error: failState.errors[oldState.errors.length], + thrown: false, + aborted: false, + failState + }; + } + return { + node: node, + error: null, + thrown: false, + aborted: false, + failState: null + }; + } catch (error) { + const failState = this.state; + this.state = oldState; + if (error instanceof SyntaxError) { + return { + node: null, + error, + thrown: true, + aborted: false, + failState + }; + } + if (error === abortSignal) { + return { + node: abortSignal.node, + error: null, + thrown: false, + aborted: true, + failState + }; + } + throw error; + } + } + checkExpressionErrors(refExpressionErrors, andThrow) { + if (!refExpressionErrors) return false; + const { + shorthandAssignLoc, + doubleProtoLoc, + privateKeyLoc, + optionalParametersLoc, + voidPatternLoc + } = refExpressionErrors; + const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc || !!voidPatternLoc; + if (!andThrow) { + return hasErrors; + } + if (shorthandAssignLoc != null) { + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); + } + if (doubleProtoLoc != null) { + this.raise(Errors.DuplicateProto, doubleProtoLoc); + } + if (privateKeyLoc != null) { + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); + } + if (optionalParametersLoc != null) { + this.unexpected(optionalParametersLoc); + } + if (voidPatternLoc != null) { + this.raise(Errors.InvalidCoverDiscardElement, voidPatternLoc); + } + } + isLiteralPropertyName() { + return tokenIsLiteralPropertyName(this.state.type); + } + isPrivateName(node) { + return node.type === "PrivateName"; + } + getPrivateNameSV(node) { + return node.id.name; + } + hasPropertyAsPrivateName(node) { + return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); + } + isObjectProperty(node) { + return node.type === "ObjectProperty"; + } + isObjectMethod(node) { + return node.type === "ObjectMethod"; + } + initializeScopes(inModule = this.options.sourceType === "module") { + const oldLabels = this.state.labels; + this.state.labels = []; + const oldExportedIdentifiers = this.exportedIdentifiers; + this.exportedIdentifiers = new Set(); + const oldInModule = this.inModule; + this.inModule = inModule; + const oldScope = this.scope; + const ScopeHandler = this.getScopeHandler(); + this.scope = new ScopeHandler(this, inModule); + const oldProdParam = this.prodParam; + this.prodParam = new ProductionParameterHandler(); + const oldClassScope = this.classScope; + this.classScope = new ClassScopeHandler(this); + const oldExpressionScope = this.expressionScope; + this.expressionScope = new ExpressionScopeHandler(this); + return () => { + this.state.labels = oldLabels; + this.exportedIdentifiers = oldExportedIdentifiers; + this.inModule = oldInModule; + this.scope = oldScope; + this.prodParam = oldProdParam; + this.classScope = oldClassScope; + this.expressionScope = oldExpressionScope; + }; + } + enterInitialScopes() { + let paramFlags = 0; + if (this.inModule || this.optionFlags & 1) { + paramFlags |= 2; + } + if (this.optionFlags & 32) { + paramFlags |= 1; + } + const isCommonJS = !this.inModule && this.options.sourceType === "commonjs"; + if (isCommonJS || this.optionFlags & 2) { + paramFlags |= 4; + } + this.prodParam.enter(paramFlags); + let scopeFlags = isCommonJS ? 514 : 1; + if (this.optionFlags & 4) { + scopeFlags |= 512; + } + this.scope.enter(scopeFlags); + } + checkDestructuringPrivate(refExpressionErrors) { + const { + privateKeyLoc + } = refExpressionErrors; + if (privateKeyLoc !== null) { + this.expectPlugin("destructuringPrivate", privateKeyLoc); + } + } +} +class ExpressionErrors { + constructor() { + this.shorthandAssignLoc = null; + this.doubleProtoLoc = null; + this.privateKeyLoc = null; + this.optionalParametersLoc = null; + this.voidPatternLoc = null; + } +} +class Node { + constructor(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + this.loc = new SourceLocation(loc); + if ((parser == null ? void 0 : parser.optionFlags) & 128) this.range = [pos, 0]; + if (parser != null && parser.filename) this.loc.filename = parser.filename; + } +} +const NodePrototype = Node.prototype; +{ + NodePrototype.__clone = function () { + const newNode = new Node(undefined, this.start, this.loc.start); + const keys = Object.keys(this); + for (let i = 0, length = keys.length; i < length; i++) { + const key = keys[i]; + if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { + newNode[key] = this[key]; + } + } + return newNode; + }; +} +class NodeUtils extends UtilParser { + startNode() { + const loc = this.state.startLoc; + return new Node(this, loc.index, loc); + } + startNodeAt(loc) { + return new Node(this, loc.index, loc); + } + startNodeAtNode(type) { + return this.startNodeAt(type.loc.start); + } + finishNode(node, type) { + return this.finishNodeAt(node, type, this.state.lastTokEndLoc); + } + finishNodeAt(node, type, endLoc) { + node.type = type; + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.optionFlags & 128) node.range[1] = endLoc.index; + if (this.optionFlags & 4096) { + this.processComment(node); + } + return node; + } + resetStartLocation(node, startLoc) { + node.start = startLoc.index; + node.loc.start = startLoc; + if (this.optionFlags & 128) node.range[0] = startLoc.index; + } + resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { + node.end = endLoc.index; + node.loc.end = endLoc; + if (this.optionFlags & 128) node.range[1] = endLoc.index; + } + resetStartLocationFromNode(node, locationNode) { + this.resetStartLocation(node, locationNode.loc.start); + } + castNodeTo(node, type) { + node.type = type; + return node; + } + cloneIdentifier(node) { + const { + type, + start, + end, + loc, + range, + name + } = node; + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.name = name; + if (node.extra) cloned.extra = node.extra; + return cloned; + } + cloneStringLiteral(node) { + const { + type, + start, + end, + loc, + range, + extra + } = node; + const cloned = Object.create(NodePrototype); + cloned.type = type; + cloned.start = start; + cloned.end = end; + cloned.loc = loc; + cloned.range = range; + cloned.extra = extra; + cloned.value = node.value; + return cloned; + } +} +const unwrapParenthesizedExpression = node => { + return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; +}; +class LValParser extends NodeUtils { + toAssignable(node, isLHS = false) { + var _node$extra, _node$extra3; + let parenthesized = undefined; + if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { + parenthesized = unwrapParenthesizedExpression(node); + if (isLHS) { + if (parenthesized.type === "Identifier") { + this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node); + } else if (parenthesized.type !== "CallExpression" && parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) { + this.raise(Errors.InvalidParenthesizedAssignment, node); + } + } else { + this.raise(Errors.InvalidParenthesizedAssignment, node); + } + } + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + case "VoidPattern": + break; + case "ObjectExpression": + this.castNodeTo(node, "ObjectPattern"); + for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { + var _node$extra2; + const prop = node.properties[i]; + const isLast = i === last; + this.toAssignableObjectExpressionProp(prop, isLast, isLHS); + if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc); + } + } + break; + case "ObjectProperty": + { + const { + key, + value + } = node; + if (this.isPrivateName(key)) { + this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); + } + this.toAssignable(value, isLHS); + break; + } + case "SpreadElement": + { + throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); + } + case "ArrayExpression": + this.castNodeTo(node, "ArrayPattern"); + this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); + break; + case "AssignmentExpression": + if (node.operator !== "=") { + this.raise(Errors.MissingEqInAssignment, node.left.loc.end); + } + this.castNodeTo(node, "AssignmentPattern"); + delete node.operator; + if (node.left.type === "VoidPattern") { + this.raise(Errors.VoidPatternInitializer, node.left); + } + this.toAssignable(node.left, isLHS); + break; + case "ParenthesizedExpression": + this.toAssignable(parenthesized, isLHS); + break; + } + } + toAssignableObjectExpressionProp(prop, isLast, isLHS) { + if (prop.type === "ObjectMethod") { + this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key); + } else if (prop.type === "SpreadElement") { + this.castNodeTo(prop, "RestElement"); + const arg = prop.argument; + this.checkToRestConversion(arg, false); + this.toAssignable(arg, isLHS); + if (!isLast) { + this.raise(Errors.RestTrailingComma, prop); + } + } else { + this.toAssignable(prop, isLHS); + } + } + toAssignableList(exprList, trailingCommaLoc, isLHS) { + const end = exprList.length - 1; + for (let i = 0; i <= end; i++) { + const elt = exprList[i]; + if (!elt) continue; + this.toAssignableListItem(exprList, i, isLHS); + if (elt.type === "RestElement") { + if (i < end) { + this.raise(Errors.RestTrailingComma, elt); + } else if (trailingCommaLoc) { + this.raise(Errors.RestTrailingComma, trailingCommaLoc); + } + } + } + } + toAssignableListItem(exprList, index, isLHS) { + const node = exprList[index]; + if (node.type === "SpreadElement") { + this.castNodeTo(node, "RestElement"); + const arg = node.argument; + this.checkToRestConversion(arg, true); + this.toAssignable(arg, isLHS); + } else { + this.toAssignable(node, isLHS); + } + } + isAssignable(node, isBinding) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + case "RestElement": + case "VoidPattern": + return true; + case "ObjectExpression": + { + const last = node.properties.length - 1; + return node.properties.every((prop, i) => { + return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); + }); + } + case "ObjectProperty": + return this.isAssignable(node.value); + case "SpreadElement": + return this.isAssignable(node.argument); + case "ArrayExpression": + return node.elements.every(element => element === null || this.isAssignable(element)); + case "AssignmentExpression": + return node.operator === "="; + case "ParenthesizedExpression": + return this.isAssignable(node.expression); + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; + default: + return false; + } + } + toReferencedList(exprList, isParenthesizedExpr) { + return exprList; + } + toReferencedListDeep(exprList, isParenthesizedExpr) { + this.toReferencedList(exprList, isParenthesizedExpr); + for (const expr of exprList) { + if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { + this.toReferencedListDeep(expr.elements); + } + } + } + parseSpread(refExpressionErrors) { + const node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); + return this.finishNode(node, "SpreadElement"); + } + parseRestBinding() { + const node = this.startNode(); + this.next(); + const argument = this.parseBindingAtom(); + if (argument.type === "VoidPattern") { + this.raise(Errors.UnexpectedVoidPattern, argument); + } + node.argument = argument; + return this.finishNode(node, "RestElement"); + } + parseBindingAtom() { + switch (this.state.type) { + case 0: + { + const node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(3, 93, 1); + return this.finishNode(node, "ArrayPattern"); + } + case 5: + return this.parseObjectLike(8, true); + case 88: + return this.parseVoidPattern(null); + } + return this.parseIdentifier(); + } + parseBindingList(close, closeCharCode, flags) { + const allowEmpty = flags & 1; + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + } + if (allowEmpty && this.match(12)) { + elts.push(null); + } else if (this.eat(close)) { + break; + } else if (this.match(21)) { + let rest = this.parseRestBinding(); + if (this.hasPlugin("flow") || flags & 2) { + rest = this.parseFunctionParamType(rest); + } + elts.push(rest); + if (!this.checkCommaAfterRest(closeCharCode)) { + this.expect(close); + break; + } + } else { + const decorators = []; + if (flags & 2) { + if (this.match(26) && this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc); + } + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + } + elts.push(this.parseBindingElement(flags, decorators)); + } + } + return elts; + } + parseBindingRestProperty(prop) { + this.next(); + if (this.hasPlugin("discardBinding") && this.match(88)) { + prop.argument = this.parseVoidPattern(null); + this.raise(Errors.UnexpectedVoidPattern, prop.argument); + } else { + prop.argument = this.parseIdentifier(); + } + this.checkCommaAfterRest(125); + return this.finishNode(prop, "RestElement"); + } + parseBindingProperty() { + const { + type, + startLoc + } = this.state; + if (type === 21) { + return this.parseBindingRestProperty(this.startNode()); + } + const prop = this.startNode(); + if (type === 139) { + this.expectPlugin("destructuringPrivate", startLoc); + this.classScope.usePrivateName(this.state.value, startLoc); + prop.key = this.parsePrivateName(); + } else { + this.parsePropertyName(prop); + } + prop.method = false; + return this.parseObjPropValue(prop, startLoc, false, false, true, false); + } + parseBindingElement(flags, decorators) { + const left = this.parseMaybeDefault(); + if (this.hasPlugin("flow") || flags & 2) { + this.parseFunctionParamType(left); + } + if (decorators.length) { + left.decorators = decorators; + this.resetStartLocationFromNode(left, decorators[0]); + } + const elt = this.parseMaybeDefault(left.loc.start, left); + return elt; + } + parseFunctionParamType(param) { + return param; + } + parseMaybeDefault(startLoc, left) { + startLoc != null ? startLoc : startLoc = this.state.startLoc; + left = left != null ? left : this.parseBindingAtom(); + if (!this.eat(29)) return left; + const node = this.startNodeAt(startLoc); + if (left.type === "VoidPattern") { + this.raise(Errors.VoidPatternInitializer, left); + } + node.left = left; + node.right = this.parseMaybeAssignAllowIn(); + return this.finishNode(node, "AssignmentPattern"); + } + isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) { + switch (type) { + case "AssignmentPattern": + return "left"; + case "RestElement": + return "argument"; + case "ObjectProperty": + return "value"; + case "ParenthesizedExpression": + return "expression"; + case "ArrayPattern": + return "elements"; + case "ObjectPattern": + return "properties"; + case "VoidPattern": + return true; + case "CallExpression": + if (!disallowCallExpression && !this.state.strict && this.optionFlags & 8192) { + return true; + } + } + return false; + } + isOptionalMemberExpression(expression) { + return expression.type === "OptionalMemberExpression"; + } + checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false, disallowCallExpression = false) { + var _expression$extra; + const type = expression.type; + if (this.isObjectMethod(expression)) return; + const isOptionalMemberExpression = this.isOptionalMemberExpression(expression); + if (isOptionalMemberExpression || type === "MemberExpression") { + if (isOptionalMemberExpression) { + this.expectPlugin("optionalChainingAssign", expression.loc.start); + if (ancestor.type !== "AssignmentExpression") { + this.raise(Errors.InvalidLhsOptionalChaining, expression, { + ancestor + }); + } + } + if (binding !== 64) { + this.raise(Errors.InvalidPropertyBindingPattern, expression); + } + return; + } + if (type === "Identifier") { + this.checkIdentifier(expression, binding, strictModeChanged); + const { + name + } = expression; + if (checkClashes) { + if (checkClashes.has(name)) { + this.raise(Errors.ParamDupe, expression); + } else { + checkClashes.add(name); + } + } + return; + } else if (type === "VoidPattern" && ancestor.type === "CatchClause") { + this.raise(Errors.VoidPatternCatchClauseParam, expression); + } + const unwrappedExpression = unwrapParenthesizedExpression(expression); + disallowCallExpression || (disallowCallExpression = unwrappedExpression.type === "CallExpression" && (unwrappedExpression.callee.type === "Import" || unwrappedExpression.callee.type === "Super")); + const validity = this.isValidLVal(type, disallowCallExpression, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); + if (validity === true) return; + if (validity === false) { + const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding; + this.raise(ParseErrorClass, expression, { + ancestor + }); + return; + } + let key, isParenthesizedExpression; + if (typeof validity === "string") { + key = validity; + isParenthesizedExpression = type === "ParenthesizedExpression"; + } else { + [key, isParenthesizedExpression] = validity; + } + const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? { + type + } : ancestor; + const val = expression[key]; + if (Array.isArray(val)) { + for (const child of val) { + if (child) { + this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, true); + } + } + } else if (val) { + this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression, disallowCallExpression); + } + } + checkIdentifier(at, bindingType, strictModeChanged = false) { + if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { + if (bindingType === 64) { + this.raise(Errors.StrictEvalArguments, at, { + referenceName: at.name + }); + } else { + this.raise(Errors.StrictEvalArgumentsBinding, at, { + bindingName: at.name + }); + } + } + if (bindingType & 8192 && at.name === "let") { + this.raise(Errors.LetInLexicalBinding, at); + } + if (!(bindingType & 64)) { + this.declareNameFromIdentifier(at, bindingType); + } + } + declareNameFromIdentifier(identifier, binding) { + this.scope.declareName(identifier.name, binding, identifier.loc.start); + } + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "ParenthesizedExpression": + this.checkToRestConversion(node.expression, allowPattern); + break; + case "Identifier": + case "MemberExpression": + break; + case "ArrayExpression": + case "ObjectExpression": + if (allowPattern) break; + default: + this.raise(Errors.InvalidRestAssignmentPattern, node); + } + } + checkCommaAfterRest(close) { + if (!this.match(12)) { + return false; + } + this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc); + return true; + } +} +const keywordAndTSRelationalOperator = /in(?:stanceof)?|as|satisfies/y; +function nonNull(x) { + if (x == null) { + throw new Error(`Unexpected ${x} value.`); + } + return x; +} +function assert(x) { + if (!x) { + throw new Error("Assert fail"); + } +} +const TSErrors = ParseErrorEnum`typescript`({ + AbstractMethodHasImplementation: ({ + methodName + }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, + AbstractPropertyHasInitializer: ({ + propertyName + }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, + AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", + AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", + AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.", + ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", + ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", + ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", + ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", + DeclareAccessor: ({ + kind + }) => `'declare' is not allowed in ${kind}ters.`, + DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", + DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", + DuplicateAccessibilityModifier: ({ + modifier + }) => `Accessibility modifier already seen: '${modifier}'.`, + DuplicateModifier: ({ + modifier + }) => `Duplicate modifier: '${modifier}'.`, + EmptyHeritageClauseType: ({ + token + }) => `'${token}' list cannot be empty.`, + EmptyTypeArguments: "Type argument list cannot be empty.", + EmptyTypeParameters: "Type parameter list cannot be empty.", + ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", + ImportAliasHasImportType: "An import alias can not use 'import type'.", + ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", + IncompatibleModifiers: ({ + modifiers + }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, + IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", + IndexSignatureHasAccessibility: ({ + modifier + }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, + IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", + IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", + IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", + InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", + InvalidHeritageClauseType: ({ + token + }) => `'${token}' list can only include identifiers or qualified-names with optional type arguments.`, + InvalidModifierOnAwaitUsingDeclaration: modifier => `'${modifier}' modifier cannot appear on an await using declaration.`, + InvalidModifierOnTypeMember: ({ + modifier + }) => `'${modifier}' modifier cannot appear on a type member.`, + InvalidModifierOnTypeParameter: ({ + modifier + }) => `'${modifier}' modifier cannot appear on a type parameter.`, + InvalidModifierOnTypeParameterPositions: ({ + modifier + }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, + InvalidModifierOnUsingDeclaration: modifier => `'${modifier}' modifier cannot appear on a using declaration.`, + InvalidModifiersOrder: ({ + orderedModifiers + }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, + InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", + InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", + MissingInterfaceName: "'interface' declarations must be followed by an identifier.", + NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", + NonClassMethodPropertyHasAbstractModifier: "'abstract' modifier can only appear on a class, method, or property declaration.", + OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", + OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", + PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", + PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", + PrivateElementHasAccessibility: ({ + modifier + }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, + ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", + ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.", + ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", + SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", + SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", + SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", + SingleTypeParameterWithoutTrailingComma: ({ + typeParameterName + }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, + StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", + TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).", + TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", + TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", + TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", + TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", + UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", + UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", + UnexpectedTypeAnnotation: "Did not expect a type annotation here.", + UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", + UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", + UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", + UnsupportedSignatureParameterKind: ({ + type + }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`, + UsingDeclarationInAmbientContext: kind => `'${kind}' declarations are not allowed in ambient contexts.` +}); +function keywordTypeFromName(value) { + switch (value) { + case "any": + return "TSAnyKeyword"; + case "boolean": + return "TSBooleanKeyword"; + case "bigint": + return "TSBigIntKeyword"; + case "never": + return "TSNeverKeyword"; + case "number": + return "TSNumberKeyword"; + case "object": + return "TSObjectKeyword"; + case "string": + return "TSStringKeyword"; + case "symbol": + return "TSSymbolKeyword"; + case "undefined": + return "TSUndefinedKeyword"; + case "unknown": + return "TSUnknownKeyword"; + default: + return undefined; + } +} +function tsIsAccessModifier(modifier) { + return modifier === "private" || modifier === "public" || modifier === "protected"; +} +function tsIsVarianceAnnotations(modifier) { + return modifier === "in" || modifier === "out"; +} +var typescript = superClass => class TypeScriptParserMixin extends superClass { + constructor(...args) { + super(...args); + this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, { + allowedModifiers: ["in", "out"], + disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameter + }); + this.tsParseConstModifier = this.tsParseModifiers.bind(this, { + allowedModifiers: ["const"], + disallowedModifiers: ["in", "out"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions + }); + this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, { + allowedModifiers: ["in", "out", "const"], + disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], + errorTemplate: TSErrors.InvalidModifierOnTypeParameter + }); + } + getScopeHandler() { + return TypeScriptScopeHandler; + } + tsIsIdentifier() { + return tokenIsIdentifier(this.state.type); + } + tsTokenCanFollowModifier() { + return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName(); + } + tsNextTokenOnSameLineAndCanFollowModifier() { + this.next(); + if (this.hasPrecedingLineBreak()) { + return false; + } + return this.tsTokenCanFollowModifier(); + } + tsNextTokenCanFollowModifier() { + if (this.match(106)) { + this.next(); + return this.tsTokenCanFollowModifier(); + } + return this.tsNextTokenOnSameLineAndCanFollowModifier(); + } + tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { + if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { + return undefined; + } + const modifier = this.state.value; + if (allowedModifiers.includes(modifier)) { + if (hasSeenStaticModifier && this.match(106)) { + return undefined; + } + if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { + return undefined; + } + if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { + return modifier; + } + } + return undefined; + } + tsParseModifiers({ + allowedModifiers, + disallowedModifiers, + stopOnStartOfClassStaticBlock, + errorTemplate = TSErrors.InvalidModifierOnTypeMember + }, modified) { + const enforceOrder = (loc, modifier, before, after) => { + if (modifier === before && modified[after]) { + this.raise(TSErrors.InvalidModifiersOrder, loc, { + orderedModifiers: [before, after] + }); + } + }; + const incompatible = (loc, modifier, mod1, mod2) => { + if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { + this.raise(TSErrors.IncompatibleModifiers, loc, { + modifiers: [mod1, mod2] + }); + } + }; + for (;;) { + const { + startLoc + } = this.state; + const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock, modified.static); + if (!modifier) break; + if (tsIsAccessModifier(modifier)) { + if (modified.accessibility) { + this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { + modifier + }); + } else { + enforceOrder(startLoc, modifier, modifier, "override"); + enforceOrder(startLoc, modifier, modifier, "static"); + enforceOrder(startLoc, modifier, modifier, "readonly"); + modified.accessibility = modifier; + } + } else if (tsIsVarianceAnnotations(modifier)) { + if (modified[modifier]) { + this.raise(TSErrors.DuplicateModifier, startLoc, { + modifier + }); + } + modified[modifier] = true; + enforceOrder(startLoc, modifier, "in", "out"); + } else { + if (hasOwnProperty.call(modified, modifier)) { + this.raise(TSErrors.DuplicateModifier, startLoc, { + modifier + }); + } else { + enforceOrder(startLoc, modifier, "static", "readonly"); + enforceOrder(startLoc, modifier, "static", "override"); + enforceOrder(startLoc, modifier, "override", "readonly"); + enforceOrder(startLoc, modifier, "abstract", "override"); + incompatible(startLoc, modifier, "declare", "override"); + incompatible(startLoc, modifier, "static", "abstract"); + } + modified[modifier] = true; + } + if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { + this.raise(errorTemplate, startLoc, { + modifier + }); + } + } + } + tsIsListTerminator(kind) { + switch (kind) { + case "EnumMembers": + case "TypeMembers": + return this.match(8); + case "HeritageClauseElement": + return this.match(5); + case "TupleElementTypes": + return this.match(3); + case "TypeParametersOrArguments": + return this.match(48); + } + } + tsParseList(kind, parseElement) { + const result = []; + while (!this.tsIsListTerminator(kind)) { + result.push(parseElement()); + } + return result; + } + tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { + return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); + } + tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { + const result = []; + let trailingCommaPos = -1; + for (;;) { + if (this.tsIsListTerminator(kind)) { + break; + } + trailingCommaPos = -1; + const element = parseElement(); + if (element == null) { + return undefined; + } + result.push(element); + if (this.eat(12)) { + trailingCommaPos = this.state.lastTokStartLoc.index; + continue; + } + if (this.tsIsListTerminator(kind)) { + break; + } + if (expectSuccess) { + this.expect(12); + } + return undefined; + } + if (refTrailingCommaPos) { + refTrailingCommaPos.value = trailingCommaPos; + } + return result; + } + tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { + if (!skipFirstToken) { + if (bracket) { + this.expect(0); + } else { + this.expect(47); + } + } + const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); + if (bracket) { + this.expect(3); + } else { + this.expect(48); + } + return result; + } + tsParseImportType() { + const node = this.startNode(); + this.expect(83); + this.expect(10); + if (!this.match(134)) { + this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc); + { + node.argument = super.parseExprAtom(); + } + } else { + { + node.argument = this.parseStringLiteral(this.state.value); + } + } + if (this.eat(12)) { + node.options = this.tsParseImportTypeOptions(); + } else { + node.options = null; + } + this.expect(11); + if (this.eat(16)) { + node.qualifier = this.tsParseEntityName(1 | 2); + } + if (this.match(47)) { + { + node.typeParameters = this.tsParseTypeArguments(); + } + } + return this.finishNode(node, "TSImportType"); + } + tsParseImportTypeOptions() { + const node = this.startNode(); + this.expect(5); + const withProperty = this.startNode(); + if (this.isContextual(76)) { + withProperty.method = false; + withProperty.key = this.parseIdentifier(true); + withProperty.computed = false; + withProperty.shorthand = false; + } else { + this.unexpected(null, 76); + } + this.expect(14); + withProperty.value = this.tsParseImportTypeWithPropertyValue(); + node.properties = [this.finishObjectProperty(withProperty)]; + this.eat(12); + this.expect(8); + return this.finishNode(node, "ObjectExpression"); + } + tsParseImportTypeWithPropertyValue() { + const node = this.startNode(); + const properties = []; + this.expect(5); + while (!this.match(8)) { + const type = this.state.type; + if (tokenIsIdentifier(type) || type === 134) { + properties.push(super.parsePropertyDefinition(null)); + } else { + this.unexpected(); + } + this.eat(12); + } + node.properties = properties; + this.next(); + return this.finishNode(node, "ObjectExpression"); + } + tsParseEntityName(flags) { + let entity; + if (flags & 1 && this.match(78)) { + if (flags & 2) { + entity = this.parseIdentifier(true); + } else { + const node = this.startNode(); + this.next(); + entity = this.finishNode(node, "ThisExpression"); + } + } else { + entity = this.parseIdentifier(!!(flags & 1)); + } + while (this.eat(16)) { + const node = this.startNodeAtNode(entity); + node.left = entity; + node.right = this.parseIdentifier(!!(flags & 1)); + entity = this.finishNode(node, "TSQualifiedName"); + } + return entity; + } + tsParseTypeReference() { + const node = this.startNode(); + node.typeName = this.tsParseEntityName(1); + if (!this.hasPrecedingLineBreak() && this.match(47)) { + { + node.typeParameters = this.tsParseTypeArguments(); + } + } + return this.finishNode(node, "TSTypeReference"); + } + tsParseThisTypePredicate(lhs) { + this.next(); + const node = this.startNodeAtNode(lhs); + node.parameterName = lhs; + node.typeAnnotation = this.tsParseTypeAnnotation(false); + node.asserts = false; + return this.finishNode(node, "TSTypePredicate"); + } + tsParseThisTypeNode() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSThisType"); + } + tsParseTypeQuery() { + const node = this.startNode(); + this.expect(87); + if (this.match(83)) { + node.exprName = this.tsParseImportType(); + } else { + { + node.exprName = this.tsParseEntityName(1 | 2); + } + } + if (!this.hasPrecedingLineBreak() && this.match(47)) { + { + node.typeParameters = this.tsParseTypeArguments(); + } + } + return this.finishNode(node, "TSTypeQuery"); + } + tsParseTypeParameter(parseModifiers) { + const node = this.startNode(); + parseModifiers(node); + node.name = this.tsParseTypeParameterName(); + node.constraint = this.tsEatThenParseType(81); + node.default = this.tsEatThenParseType(29); + return this.finishNode(node, "TSTypeParameter"); + } + tsTryParseTypeParameters(parseModifiers) { + if (this.match(47)) { + return this.tsParseTypeParameters(parseModifiers); + } + } + tsParseTypeParameters(parseModifiers) { + const node = this.startNode(); + if (this.match(47) || this.match(143)) { + this.next(); + } else { + this.unexpected(); + } + const refTrailingCommaPos = { + value: -1 + }; + node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeParameters, node); + } + if (refTrailingCommaPos.value !== -1) { + this.addExtra(node, "trailingComma", refTrailingCommaPos.value); + } + return this.finishNode(node, "TSTypeParameterDeclaration"); + } + tsFillSignature(returnToken, signature) { + const returnTokenRequired = returnToken === 19; + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + this.expect(10); + signature[paramsKey] = this.tsParseBindingListForSignature(); + if (returnTokenRequired) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } else if (this.match(returnToken)) { + signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); + } + } + tsParseBindingListForSignature() { + const list = super.parseBindingList(11, 41, 2); + for (const pattern of list) { + const { + type + } = pattern; + if (type === "AssignmentPattern" || type === "TSParameterProperty") { + this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, { + type + }); + } + } + return list; + } + tsParseTypeMemberSemicolon() { + if (!this.eat(12) && !this.isLineTerminator()) { + this.expect(13); + } + } + tsParseSignatureMember(kind, node) { + this.tsFillSignature(14, node); + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, kind); + } + tsIsUnambiguouslyIndexSignature() { + this.next(); + if (tokenIsIdentifier(this.state.type)) { + this.next(); + return this.match(14); + } + return false; + } + tsTryParseIndexSignature(node) { + if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { + return; + } + this.expect(0); + const id = this.parseIdentifier(); + id.typeAnnotation = this.tsParseTypeAnnotation(); + this.resetEndLocation(id); + this.expect(3); + node.parameters = [id]; + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(node, "TSIndexSignature"); + } + tsParsePropertyOrMethodSignature(node, readonly) { + if (this.eat(17)) node.optional = true; + if (this.match(10) || this.match(47)) { + if (readonly) { + this.raise(TSErrors.ReadonlyForMethodSignature, node); + } + const method = node; + if (method.kind && this.match(47)) { + this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition()); + } + this.tsFillSignature(14, method); + this.tsParseTypeMemberSemicolon(); + const paramsKey = "parameters"; + const returnTypeKey = "typeAnnotation"; + if (method.kind === "get") { + if (method[paramsKey].length > 0) { + this.raise(Errors.BadGetterArity, this.state.curPosition()); + if (this.isThisParam(method[paramsKey][0])) { + this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); + } + } + } else if (method.kind === "set") { + if (method[paramsKey].length !== 1) { + this.raise(Errors.BadSetterArity, this.state.curPosition()); + } else { + const firstParameter = method[paramsKey][0]; + if (this.isThisParam(firstParameter)) { + this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); + } + if (firstParameter.type === "Identifier" && firstParameter.optional) { + this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()); + } + if (firstParameter.type === "RestElement") { + this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition()); + } + } + if (method[returnTypeKey]) { + this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]); + } + } else { + method.kind = "method"; + } + return this.finishNode(method, "TSMethodSignature"); + } else { + const property = node; + if (readonly) property.readonly = true; + const type = this.tsTryParseTypeAnnotation(); + if (type) property.typeAnnotation = type; + this.tsParseTypeMemberSemicolon(); + return this.finishNode(property, "TSPropertySignature"); + } + } + tsParseTypeMember() { + const node = this.startNode(); + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); + } + if (this.match(77)) { + const id = this.startNode(); + this.next(); + if (this.match(10) || this.match(47)) { + return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); + } else { + node.key = this.createIdentifier(id, "new"); + return this.tsParsePropertyOrMethodSignature(node, false); + } + } + this.tsParseModifiers({ + allowedModifiers: ["readonly"], + disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] + }, node); + const idx = this.tsTryParseIndexSignature(node); + if (idx) { + return idx; + } + super.parsePropertyName(node); + if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { + node.kind = node.key.name; + super.parsePropertyName(node); + if (!this.match(10) && !this.match(47)) { + this.unexpected(null, 10); + } + } + return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); + } + tsParseTypeLiteral() { + const node = this.startNode(); + node.members = this.tsParseObjectTypeMembers(); + return this.finishNode(node, "TSTypeLiteral"); + } + tsParseObjectTypeMembers() { + this.expect(5); + const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); + this.expect(8); + return members; + } + tsIsStartOfMappedType() { + this.next(); + if (this.eat(53)) { + return this.isContextual(122); + } + if (this.isContextual(122)) { + this.next(); + } + if (!this.match(0)) { + return false; + } + this.next(); + if (!this.tsIsIdentifier()) { + return false; + } + this.next(); + return this.match(58); + } + tsParseMappedType() { + const node = this.startNode(); + this.expect(5); + if (this.match(53)) { + node.readonly = this.state.value; + this.next(); + this.expectContextual(122); + } else if (this.eatContextual(122)) { + node.readonly = true; + } + this.expect(0); + { + const typeParameter = this.startNode(); + typeParameter.name = this.tsParseTypeParameterName(); + typeParameter.constraint = this.tsExpectThenParseType(58); + node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); + } + node.nameType = this.eatContextual(93) ? this.tsParseType() : null; + this.expect(3); + if (this.match(53)) { + node.optional = this.state.value; + this.next(); + this.expect(17); + } else if (this.eat(17)) { + node.optional = true; + } + node.typeAnnotation = this.tsTryParseType(); + this.semicolon(); + this.expect(8); + return this.finishNode(node, "TSMappedType"); + } + tsParseTupleType() { + const node = this.startNode(); + node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); + let seenOptionalElement = false; + node.elementTypes.forEach(elementNode => { + const { + type + } = elementNode; + if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { + this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode); + } + seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); + }); + return this.finishNode(node, "TSTupleType"); + } + tsParseTupleElementType() { + const restStartLoc = this.state.startLoc; + const rest = this.eat(21); + const { + startLoc + } = this.state; + let labeled; + let label; + let optional; + let type; + const isWord = tokenIsKeywordOrIdentifier(this.state.type); + const chAfterWord = isWord ? this.lookaheadCharCode() : null; + if (chAfterWord === 58) { + labeled = true; + optional = false; + label = this.parseIdentifier(true); + this.expect(14); + type = this.tsParseType(); + } else if (chAfterWord === 63) { + optional = true; + const wordName = this.state.value; + const typeOrLabel = this.tsParseNonArrayType(); + if (this.lookaheadCharCode() === 58) { + labeled = true; + label = this.createIdentifier(this.startNodeAt(startLoc), wordName); + this.expect(17); + this.expect(14); + type = this.tsParseType(); + } else { + labeled = false; + type = typeOrLabel; + this.expect(17); + } + } else { + type = this.tsParseType(); + optional = this.eat(17); + labeled = this.eat(14); + } + if (labeled) { + let labeledNode; + if (label) { + labeledNode = this.startNodeAt(startLoc); + labeledNode.optional = optional; + labeledNode.label = label; + labeledNode.elementType = type; + if (this.eat(17)) { + labeledNode.optional = true; + this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc); + } + } else { + labeledNode = this.startNodeAt(startLoc); + labeledNode.optional = optional; + this.raise(TSErrors.InvalidTupleMemberLabel, type); + labeledNode.label = type; + labeledNode.elementType = this.tsParseType(); + } + type = this.finishNode(labeledNode, "TSNamedTupleMember"); + } else if (optional) { + const optionalTypeNode = this.startNodeAt(startLoc); + optionalTypeNode.typeAnnotation = type; + type = this.finishNode(optionalTypeNode, "TSOptionalType"); + } + if (rest) { + const restNode = this.startNodeAt(restStartLoc); + restNode.typeAnnotation = type; + type = this.finishNode(restNode, "TSRestType"); + } + return type; + } + tsParseParenthesizedType() { + const node = this.startNode(); + this.expect(10); + node.typeAnnotation = this.tsParseType(); + this.expect(11); + return this.finishNode(node, "TSParenthesizedType"); + } + tsParseFunctionOrConstructorType(type, abstract) { + const node = this.startNode(); + if (type === "TSConstructorType") { + node.abstract = !!abstract; + if (abstract) this.next(); + this.next(); + } + this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); + return this.finishNode(node, type); + } + tsParseLiteralTypeNode() { + const node = this.startNode(); + switch (this.state.type) { + case 135: + case 136: + case 134: + case 85: + case 86: + node.literal = super.parseExprAtom(); + break; + default: + this.unexpected(); + } + return this.finishNode(node, "TSLiteralType"); + } + tsParseTemplateLiteralType() { + { + const node = this.startNode(); + node.literal = super.parseTemplate(false); + return this.finishNode(node, "TSLiteralType"); + } + } + parseTemplateSubstitution() { + if (this.state.inType) return this.tsParseType(); + return super.parseTemplateSubstitution(); + } + tsParseThisTypeOrThisTypePredicate() { + const thisKeyword = this.tsParseThisTypeNode(); + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { + return this.tsParseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + tsParseNonArrayType() { + switch (this.state.type) { + case 134: + case 135: + case 136: + case 85: + case 86: + return this.tsParseLiteralTypeNode(); + case 53: + if (this.state.value === "-") { + const node = this.startNode(); + const nextToken = this.lookahead(); + if (nextToken.type !== 135 && nextToken.type !== 136) { + this.unexpected(); + } + node.literal = this.parseMaybeUnary(); + return this.finishNode(node, "TSLiteralType"); + } + break; + case 78: + return this.tsParseThisTypeOrThisTypePredicate(); + case 87: + return this.tsParseTypeQuery(); + case 83: + return this.tsParseImportType(); + case 5: + return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); + case 0: + return this.tsParseTupleType(); + case 10: + return this.tsParseParenthesizedType(); + case 25: + case 24: + return this.tsParseTemplateLiteralType(); + default: + { + const { + type + } = this.state; + if (tokenIsIdentifier(type) || type === 88 || type === 84) { + const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); + if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, nodeType); + } + return this.tsParseTypeReference(); + } + } + } + throw this.unexpected(); + } + tsParseArrayTypeOrHigher() { + const { + startLoc + } = this.state; + let type = this.tsParseNonArrayType(); + while (!this.hasPrecedingLineBreak() && this.eat(0)) { + if (this.match(3)) { + const node = this.startNodeAt(startLoc); + node.elementType = type; + this.expect(3); + type = this.finishNode(node, "TSArrayType"); + } else { + const node = this.startNodeAt(startLoc); + node.objectType = type; + node.indexType = this.tsParseType(); + this.expect(3); + type = this.finishNode(node, "TSIndexedAccessType"); + } + } + return type; + } + tsParseTypeOperator() { + const node = this.startNode(); + const operator = this.state.value; + this.next(); + node.operator = operator; + node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); + if (operator === "readonly") { + this.tsCheckTypeAnnotationForReadOnly(node); + } + return this.finishNode(node, "TSTypeOperator"); + } + tsCheckTypeAnnotationForReadOnly(node) { + switch (node.typeAnnotation.type) { + case "TSTupleType": + case "TSArrayType": + return; + default: + this.raise(TSErrors.UnexpectedReadonly, node); + } + } + tsParseInferType() { + const node = this.startNode(); + this.expectContextual(115); + const typeParameter = this.startNode(); + typeParameter.name = this.tsParseTypeParameterName(); + typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); + node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); + return this.finishNode(node, "TSInferType"); + } + tsParseConstraintForInferType() { + if (this.eat(81)) { + const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); + if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { + return constraint; + } + } + } + tsParseTypeOperatorOrHigher() { + const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; + return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); + } + tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { + const node = this.startNode(); + const hasLeadingOperator = this.eat(operator); + const types = []; + do { + types.push(parseConstituentType()); + } while (this.eat(operator)); + if (types.length === 1 && !hasLeadingOperator) { + return types[0]; + } + node.types = types; + return this.finishNode(node, kind); + } + tsParseIntersectionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); + } + tsParseUnionTypeOrHigher() { + return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); + } + tsIsStartOfFunctionType() { + if (this.match(47)) { + return true; + } + return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); + } + tsSkipParameterStart() { + if (tokenIsIdentifier(this.state.type) || this.match(78)) { + this.next(); + return true; + } + if (this.match(5)) { + const { + errors + } = this.state; + const previousErrorCount = errors.length; + try { + this.parseObjectLike(8, true); + return errors.length === previousErrorCount; + } catch (_unused) { + return false; + } + } + if (this.match(0)) { + this.next(); + const { + errors + } = this.state; + const previousErrorCount = errors.length; + try { + super.parseBindingList(3, 93, 1); + return errors.length === previousErrorCount; + } catch (_unused2) { + return false; + } + } + return false; + } + tsIsUnambiguouslyStartOfFunctionType() { + this.next(); + if (this.match(11) || this.match(21)) { + return true; + } + if (this.tsSkipParameterStart()) { + if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { + return true; + } + if (this.match(11)) { + this.next(); + if (this.match(19)) { + return true; + } + } + } + return false; + } + tsParseTypeOrTypePredicateAnnotation(returnToken) { + return this.tsInType(() => { + const t = this.startNode(); + this.expect(returnToken); + const node = this.startNode(); + const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); + if (asserts && this.match(78)) { + let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); + if (thisTypePredicate.type === "TSThisType") { + node.parameterName = thisTypePredicate; + node.asserts = true; + node.typeAnnotation = null; + thisTypePredicate = this.finishNode(node, "TSTypePredicate"); + } else { + this.resetStartLocationFromNode(thisTypePredicate, node); + thisTypePredicate.asserts = true; + } + t.typeAnnotation = thisTypePredicate; + return this.finishNode(t, "TSTypeAnnotation"); + } + const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); + if (!typePredicateVariable) { + if (!asserts) { + return this.tsParseTypeAnnotation(false, t); + } + node.parameterName = this.parseIdentifier(); + node.asserts = asserts; + node.typeAnnotation = null; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + } + const type = this.tsParseTypeAnnotation(false); + node.parameterName = typePredicateVariable; + node.typeAnnotation = type; + node.asserts = asserts; + t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); + return this.finishNode(t, "TSTypeAnnotation"); + }); + } + tsTryParseTypeOrTypePredicateAnnotation() { + if (this.match(14)) { + return this.tsParseTypeOrTypePredicateAnnotation(14); + } + } + tsTryParseTypeAnnotation() { + if (this.match(14)) { + return this.tsParseTypeAnnotation(); + } + } + tsTryParseType() { + return this.tsEatThenParseType(14); + } + tsParseTypePredicatePrefix() { + const id = this.parseIdentifier(); + if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { + this.next(); + return id; + } + } + tsParseTypePredicateAsserts() { + if (this.state.type !== 109) { + return false; + } + const containsEsc = this.state.containsEsc; + this.next(); + if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { + return false; + } + if (containsEsc) { + this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, { + reservedWord: "asserts" + }); + } + return true; + } + tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { + this.tsInType(() => { + if (eatColon) this.expect(14); + t.typeAnnotation = this.tsParseType(); + }); + return this.finishNode(t, "TSTypeAnnotation"); + } + tsParseType() { + assert(this.state.inType); + const type = this.tsParseNonConditionalType(); + if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { + return type; + } + const node = this.startNodeAtNode(type); + node.checkType = type; + node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); + this.expect(17); + node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + this.expect(14); + node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); + return this.finishNode(node, "TSConditionalType"); + } + isAbstractConstructorSignature() { + return this.isContextual(124) && this.isLookaheadContextual("new"); + } + tsParseNonConditionalType() { + if (this.tsIsStartOfFunctionType()) { + return this.tsParseFunctionOrConstructorType("TSFunctionType"); + } + if (this.match(77)) { + return this.tsParseFunctionOrConstructorType("TSConstructorType"); + } else if (this.isAbstractConstructorSignature()) { + return this.tsParseFunctionOrConstructorType("TSConstructorType", true); + } + return this.tsParseUnionTypeOrHigher(); + } + tsParseTypeAssertion() { + if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc); + } + const node = this.startNode(); + node.typeAnnotation = this.tsInType(() => { + this.next(); + return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); + }); + this.expect(48); + node.expression = this.parseMaybeUnary(); + return this.finishNode(node, "TSTypeAssertion"); + } + tsParseHeritageClause(token) { + const originalStartLoc = this.state.startLoc; + const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { + { + const node = this.startNode(); + node.expression = this.tsParseEntityName(1 | 2); + if (this.match(47)) { + node.typeParameters = this.tsParseTypeArguments(); + } + return this.finishNode(node, "TSExpressionWithTypeArguments"); + } + }); + if (!delimitedList.length) { + this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, { + token + }); + } + return delimitedList; + } + tsParseInterfaceDeclaration(node, properties = {}) { + if (this.hasFollowingLineBreak()) return null; + this.expectContextual(129); + if (properties.declare) node.declare = true; + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, 130); + } else { + node.id = null; + this.raise(TSErrors.MissingInterfaceName, this.state.startLoc); + } + node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); + if (this.eat(81)) { + node.extends = this.tsParseHeritageClause("extends"); + } + const body = this.startNode(); + body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); + node.body = this.finishNode(body, "TSInterfaceBody"); + return this.finishNode(node, "TSInterfaceDeclaration"); + } + tsParseTypeAliasDeclaration(node) { + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, 2); + node.typeAnnotation = this.tsInType(() => { + node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); + this.expect(29); + if (this.isContextual(114) && this.lookaheadCharCode() !== 46) { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "TSIntrinsicKeyword"); + } + return this.tsParseType(); + }); + this.semicolon(); + return this.finishNode(node, "TSTypeAliasDeclaration"); + } + tsInTopLevelContext(cb) { + if (this.curContext() !== types.brace) { + const oldContext = this.state.context; + this.state.context = [oldContext[0]]; + try { + return cb(); + } finally { + this.state.context = oldContext; + } + } else { + return cb(); + } + } + tsInType(cb) { + const oldInType = this.state.inType; + this.state.inType = true; + try { + return cb(); + } finally { + this.state.inType = oldInType; + } + } + tsInDisallowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; + this.state.inDisallowConditionalTypesContext = true; + try { + return cb(); + } finally { + this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsInAllowConditionalTypesContext(cb) { + const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; + this.state.inDisallowConditionalTypesContext = false; + try { + return cb(); + } finally { + this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; + } + } + tsEatThenParseType(token) { + if (this.match(token)) { + return this.tsNextThenParseType(); + } + } + tsExpectThenParseType(token) { + return this.tsInType(() => { + this.expect(token); + return this.tsParseType(); + }); + } + tsNextThenParseType() { + return this.tsInType(() => { + this.next(); + return this.tsParseType(); + }); + } + tsParseEnumMember() { + const node = this.startNode(); + node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); + if (this.eat(29)) { + node.initializer = super.parseMaybeAssignAllowIn(); + } + return this.finishNode(node, "TSEnumMember"); + } + tsParseEnumDeclaration(node, properties = {}) { + if (properties.const) node.const = true; + if (properties.declare) node.declare = true; + this.expectContextual(126); + node.id = this.parseIdentifier(); + this.checkIdentifier(node.id, node.const ? 8971 : 8459); + { + this.expect(5); + node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); + this.expect(8); + } + return this.finishNode(node, "TSEnumDeclaration"); + } + tsParseEnumBody() { + const node = this.startNode(); + this.expect(5); + node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); + this.expect(8); + return this.finishNode(node, "TSEnumBody"); + } + tsParseModuleBlock() { + const node = this.startNode(); + this.scope.enter(0); + this.expect(5); + super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); + this.scope.exit(); + return this.finishNode(node, "TSModuleBlock"); + } + tsParseModuleOrNamespaceDeclaration(node, nested = false) { + node.id = this.parseIdentifier(); + if (!nested) { + this.checkIdentifier(node.id, 1024); + } + if (this.eat(16)) { + const inner = this.startNode(); + this.tsParseModuleOrNamespaceDeclaration(inner, true); + node.body = inner; + } else { + this.scope.enter(1024); + this.prodParam.enter(0); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + tsParseAmbientExternalModuleDeclaration(node) { + if (this.isContextual(112)) { + node.kind = "global"; + { + node.global = true; + } + node.id = this.parseIdentifier(); + } else if (this.match(134)) { + node.kind = "module"; + node.id = super.parseStringLiteral(this.state.value); + } else { + this.unexpected(); + } + if (this.match(5)) { + this.scope.enter(1024); + this.prodParam.enter(0); + node.body = this.tsParseModuleBlock(); + this.prodParam.exit(); + this.scope.exit(); + } else { + this.semicolon(); + } + return this.finishNode(node, "TSModuleDeclaration"); + } + tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { + { + node.isExport = isExport || false; + } + node.id = maybeDefaultIdentifier || this.parseIdentifier(); + this.checkIdentifier(node.id, 4096); + this.expect(29); + const moduleReference = this.tsParseModuleReference(); + if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { + this.raise(TSErrors.ImportAliasHasImportType, moduleReference); + } + node.moduleReference = moduleReference; + this.semicolon(); + return this.finishNode(node, "TSImportEqualsDeclaration"); + } + tsIsExternalModuleReference() { + return this.isContextual(119) && this.lookaheadCharCode() === 40; + } + tsParseModuleReference() { + return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(0); + } + tsParseExternalModuleReference() { + const node = this.startNode(); + this.expectContextual(119); + this.expect(10); + if (!this.match(134)) { + this.unexpected(); + } + node.expression = super.parseExprAtom(); + this.expect(11); + this.sawUnambiguousESM = true; + return this.finishNode(node, "TSExternalModuleReference"); + } + tsLookAhead(f) { + const state = this.state.clone(); + const res = f(); + this.state = state; + return res; + } + tsTryParseAndCatch(f) { + const result = this.tryParse(abort => f() || abort()); + if (result.aborted || !result.node) return; + if (result.error) this.state = result.failState; + return result.node; + } + tsTryParse(f) { + const state = this.state.clone(); + const result = f(); + if (result !== undefined && result !== false) { + return result; + } + this.state = state; + } + tsTryParseDeclare(node) { + if (this.isLineTerminator()) { + return; + } + const startType = this.state.type; + return this.tsInAmbientContext(() => { + switch (startType) { + case 68: + node.declare = true; + return super.parseFunctionStatement(node, false, false); + case 80: + node.declare = true; + return this.parseClass(node, true, false); + case 126: + return this.tsParseEnumDeclaration(node, { + declare: true + }); + case 112: + return this.tsParseAmbientExternalModuleDeclaration(node); + case 100: + if (this.state.containsEsc) { + return; + } + case 75: + case 74: + if (!this.match(75) || !this.isLookaheadContextual("enum")) { + node.declare = true; + return this.parseVarStatement(node, this.state.value, true); + } + this.expect(75); + return this.tsParseEnumDeclaration(node, { + const: true, + declare: true + }); + case 107: + if (this.isUsing()) { + this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare"); + node.declare = true; + return this.parseVarStatement(node, "using", true); + } + break; + case 96: + if (this.isAwaitUsing()) { + this.raise(TSErrors.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare"); + node.declare = true; + this.next(); + return this.parseVarStatement(node, "await using", true); + } + break; + case 129: + { + const result = this.tsParseInterfaceDeclaration(node, { + declare: true + }); + if (result) return result; + } + default: + if (tokenIsIdentifier(startType)) { + return this.tsParseDeclaration(node, this.state.type, true, null); + } + } + }); + } + tsTryParseExportDeclaration() { + return this.tsParseDeclaration(this.startNode(), this.state.type, true, null); + } + tsParseDeclaration(node, type, next, decorators) { + switch (type) { + case 124: + if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { + return this.tsParseAbstractDeclaration(node, decorators); + } + break; + case 127: + if (this.tsCheckLineTerminator(next)) { + if (this.match(134)) { + return this.tsParseAmbientExternalModuleDeclaration(node); + } else if (tokenIsIdentifier(this.state.type)) { + node.kind = "module"; + return this.tsParseModuleOrNamespaceDeclaration(node); + } + } + break; + case 128: + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + node.kind = "namespace"; + return this.tsParseModuleOrNamespaceDeclaration(node); + } + break; + case 130: + if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { + return this.tsParseTypeAliasDeclaration(node); + } + break; + } + } + tsCheckLineTerminator(next) { + if (next) { + if (this.hasFollowingLineBreak()) return false; + this.next(); + return true; + } + return !this.isLineTerminator(); + } + tsTryParseGenericAsyncArrowFunction(startLoc) { + if (!this.match(47)) return; + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = true; + const res = this.tsTryParseAndCatch(() => { + const node = this.startNodeAt(startLoc); + node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + super.parseFunctionParams(node); + node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); + this.expect(19); + return node; + }); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + if (!res) return; + return super.parseArrowExpression(res, null, true); + } + tsParseTypeArgumentsInExpression() { + if (this.reScan_lt() !== 47) return; + return this.tsParseTypeArguments(); + } + tsParseTypeArguments() { + const node = this.startNode(); + node.params = this.tsInType(() => this.tsInTopLevelContext(() => { + this.expect(47); + return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); + })); + if (node.params.length === 0) { + this.raise(TSErrors.EmptyTypeArguments, node); + } else if (!this.state.inType && this.curContext() === types.brace) { + this.reScan_lt_gt(); + } + this.expect(48); + return this.finishNode(node, "TSTypeParameterInstantiation"); + } + tsIsDeclarationStart() { + return tokenIsTSDeclarationStart(this.state.type); + } + isExportDefaultSpecifier() { + if (this.tsIsDeclarationStart()) return false; + return super.isExportDefaultSpecifier(); + } + parseBindingElement(flags, decorators) { + const startLoc = decorators.length ? decorators[0].loc.start : this.state.startLoc; + const modified = {}; + this.tsParseModifiers({ + allowedModifiers: ["public", "private", "protected", "override", "readonly"] + }, modified); + const accessibility = modified.accessibility; + const override = modified.override; + const readonly = modified.readonly; + if (!(flags & 4) && (accessibility || readonly || override)) { + this.raise(TSErrors.UnexpectedParameterModifier, startLoc); + } + const left = this.parseMaybeDefault(); + if (flags & 2) { + this.parseFunctionParamType(left); + } + const elt = this.parseMaybeDefault(left.loc.start, left); + if (accessibility || readonly || override) { + const pp = this.startNodeAt(startLoc); + if (decorators.length) { + pp.decorators = decorators; + } + if (accessibility) pp.accessibility = accessibility; + if (readonly) pp.readonly = readonly; + if (override) pp.override = override; + if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { + this.raise(TSErrors.UnsupportedParameterPropertyKind, pp); + } + pp.parameter = elt; + return this.finishNode(pp, "TSParameterProperty"); + } + if (decorators.length) { + left.decorators = decorators; + } + return elt; + } + isSimpleParameter(node) { + return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); + } + tsDisallowOptionalPattern(node) { + for (const param of node.params) { + if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { + this.raise(TSErrors.PatternIsOptional, param); + } + } + } + setArrowFunctionParameters(node, params, trailingCommaLoc) { + super.setArrowFunctionParameters(node, params, trailingCommaLoc); + this.tsDisallowOptionalPattern(node); + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + if (this.match(14)) { + node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + } + const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; + if (bodilessType && !this.match(5) && this.isLineTerminator()) { + return this.finishNode(node, bodilessType); + } + if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { + this.raise(TSErrors.DeclareFunctionHasImplementation, node); + if (node.declare) { + return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); + } + } + this.tsDisallowOptionalPattern(node); + return super.parseFunctionBodyAndFinish(node, type, isMethod); + } + registerFunctionStatementId(node) { + if (!node.body && node.id) { + this.checkIdentifier(node.id, 1024); + } else { + super.registerFunctionStatementId(node); + } + } + tsCheckForInvalidTypeCasts(items) { + items.forEach(node => { + if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { + this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation); + } + }); + } + toReferencedList(exprList, isInParens) { + this.tsCheckForInvalidTypeCasts(exprList); + return exprList; + } + parseArrayLike(close, isTuple, refExpressionErrors) { + const node = super.parseArrayLike(close, isTuple, refExpressionErrors); + if (node.type === "ArrayExpression") { + this.tsCheckForInvalidTypeCasts(node.elements); + } + return node; + } + parseSubscript(base, startLoc, noCalls, state) { + if (!this.hasPrecedingLineBreak() && this.match(35)) { + this.state.canStartJSXElement = false; + this.next(); + const nonNullExpression = this.startNodeAt(startLoc); + nonNullExpression.expression = base; + return this.finishNode(nonNullExpression, "TSNonNullExpression"); + } + let isOptionalCall = false; + if (this.match(18) && this.lookaheadCharCode() === 60) { + if (noCalls) { + state.stop = true; + return base; + } + state.optionalChainMember = isOptionalCall = true; + this.next(); + } + if (this.match(47) || this.match(51)) { + let missingParenErrorLoc; + const result = this.tsTryParseAndCatch(() => { + if (!noCalls && this.atPossibleAsyncArrow(base)) { + const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); + if (asyncArrowFn) { + state.stop = true; + return asyncArrowFn; + } + } + const typeArguments = this.tsParseTypeArgumentsInExpression(); + if (!typeArguments) return; + if (isOptionalCall && !this.match(10)) { + missingParenErrorLoc = this.state.curPosition(); + return; + } + if (tokenIsTemplate(this.state.type)) { + const result = super.parseTaggedTemplateExpression(base, startLoc, state); + { + result.typeParameters = typeArguments; + } + return result; + } + if (!noCalls && this.eat(10)) { + const node = this.startNodeAt(startLoc); + node.callee = base; + node.arguments = this.parseCallExpressionArguments(); + this.tsCheckForInvalidTypeCasts(node.arguments); + { + node.typeParameters = typeArguments; + } + if (state.optionalChainMember) { + node.optional = isOptionalCall; + } + return this.finishCallExpression(node, state.optionalChainMember); + } + const tokenType = this.state.type; + if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) { + return; + } + const node = this.startNodeAt(startLoc); + node.expression = base; + { + node.typeParameters = typeArguments; + } + return this.finishNode(node, "TSInstantiationExpression"); + }); + if (missingParenErrorLoc) { + this.unexpected(missingParenErrorLoc, 10); + } + if (result) { + if (result.type === "TSInstantiationExpression") { + if (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40) { + this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); + } + if (!this.match(16) && !this.match(18)) { + result.expression = super.stopParseSubscript(base, state); + } + } + return result; + } + } + return super.parseSubscript(base, startLoc, noCalls, state); + } + parseNewCallee(node) { + var _callee$extra; + super.parseNewCallee(node); + const { + callee + } = node; + if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { + { + node.typeParameters = callee.typeParameters; + } + node.callee = callee.expression; + } + } + parseExprOp(left, leftStartLoc, minPrec) { + let isSatisfies; + if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) { + const node = this.startNodeAt(leftStartLoc); + node.expression = left; + node.typeAnnotation = this.tsInType(() => { + this.next(); + if (this.match(75)) { + if (isSatisfies) { + this.raise(Errors.UnexpectedKeyword, this.state.startLoc, { + keyword: "const" + }); + } + return this.tsParseTypeReference(); + } + return this.tsParseType(); + }); + this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); + this.reScan_lt_gt(); + return this.parseExprOp(node, leftStartLoc, minPrec); + } + return super.parseExprOp(left, leftStartLoc, minPrec); + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (!this.state.isAmbientContext) { + super.checkReservedWord(word, startLoc, checkKeywords, isBinding); + } + } + checkImportReflection(node) { + super.checkImportReflection(node); + if (node.module && node.importKind !== "value") { + this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); + } + } + checkDuplicateExports() {} + isPotentialImportPhase(isExport) { + if (super.isPotentialImportPhase(isExport)) return true; + if (this.isContextual(130)) { + const ch = this.lookaheadCharCode(); + return isExport ? ch === 123 || ch === 42 : ch !== 61; + } + return !isExport && this.isContextual(87); + } + applyImportPhase(node, isExport, phase, loc) { + super.applyImportPhase(node, isExport, phase, loc); + if (isExport) { + node.exportKind = phase === "type" ? "type" : "value"; + } else { + node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; + } + } + parseImport(node) { + if (this.match(134)) { + node.importKind = "value"; + return super.parseImport(node); + } + let importNode; + if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) { + node.importKind = "value"; + return this.tsParseImportEqualsDeclaration(node); + } else if (this.isContextual(130)) { + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); + if (this.lookaheadCharCode() === 61) { + return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); + } else { + importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); + } + } else { + importNode = super.parseImport(node); + } + if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { + this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode); + } + return importNode; + } + parseExport(node, decorators) { + if (this.match(83)) { + const nodeImportEquals = node; + this.next(); + let maybeDefaultIdentifier = null; + if (this.isContextual(130) && this.isPotentialImportPhase(false)) { + maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false); + } else { + nodeImportEquals.importKind = "value"; + } + const declaration = this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true); + { + return declaration; + } + } else if (this.eat(29)) { + const assign = node; + assign.expression = super.parseExpression(); + this.semicolon(); + this.sawUnambiguousESM = true; + return this.finishNode(assign, "TSExportAssignment"); + } else if (this.eatContextual(93)) { + const decl = node; + this.expectContextual(128); + decl.id = this.parseIdentifier(); + this.semicolon(); + return this.finishNode(decl, "TSNamespaceExportDeclaration"); + } else { + return super.parseExport(node, decorators); + } + } + isAbstractClass() { + return this.isContextual(124) && this.isLookaheadContextual("class"); + } + parseExportDefaultExpression() { + if (this.isAbstractClass()) { + const cls = this.startNode(); + this.next(); + cls.abstract = true; + return this.parseClass(cls, true, true); + } + if (this.match(129)) { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + } + return super.parseExportDefaultExpression(); + } + parseVarStatement(node, kind, allowMissingInitializer = false) { + const { + isAmbientContext + } = this.state; + const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); + if (!isAmbientContext) return declaration; + if (!node.declare && (kind === "using" || kind === "await using")) { + this.raiseOverwrite(TSErrors.UsingDeclarationInAmbientContext, node, kind); + return declaration; + } + for (const { + id, + init + } of declaration.declarations) { + if (!init) continue; + if (kind === "var" || kind === "let" || !!id.typeAnnotation) { + this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); + } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { + this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); + } + } + return declaration; + } + parseStatementContent(flags, decorators) { + if (!this.state.containsEsc) { + switch (this.state.type) { + case 75: + { + if (this.isLookaheadContextual("enum")) { + const node = this.startNode(); + this.expect(75); + return this.tsParseEnumDeclaration(node, { + const: true + }); + } + break; + } + case 124: + case 125: + { + if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) { + const token = this.state.type; + const node = this.startNode(); + this.next(); + const declaration = token === 125 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators); + if (declaration) { + if (token === 125) { + declaration.declare = true; + } + return declaration; + } else { + node.expression = this.createIdentifier(this.startNodeAt(node.loc.start), token === 125 ? "declare" : "abstract"); + this.semicolon(false); + return this.finishNode(node, "ExpressionStatement"); + } + } + break; + } + case 126: + return this.tsParseEnumDeclaration(this.startNode()); + case 112: + { + const nextCh = this.lookaheadCharCode(); + if (nextCh === 123) { + const node = this.startNode(); + return this.tsParseAmbientExternalModuleDeclaration(node); + } + break; + } + case 129: + { + const result = this.tsParseInterfaceDeclaration(this.startNode()); + if (result) return result; + break; + } + case 127: + { + if (this.nextTokenIsIdentifierOrStringLiteralOnSameLine()) { + const node = this.startNode(); + this.next(); + return this.tsParseDeclaration(node, 127, false, decorators); + } + break; + } + case 128: + { + if (this.nextTokenIsIdentifierOnSameLine()) { + const node = this.startNode(); + this.next(); + return this.tsParseDeclaration(node, 128, false, decorators); + } + break; + } + case 130: + { + if (this.nextTokenIsIdentifierOnSameLine()) { + const node = this.startNode(); + this.next(); + return this.tsParseTypeAliasDeclaration(node); + } + break; + } + } + } + return super.parseStatementContent(flags, decorators); + } + parseAccessModifier() { + return this.tsParseModifier(["public", "protected", "private"]); + } + tsHasSomeModifiers(member, modifiers) { + return modifiers.some(modifier => { + if (tsIsAccessModifier(modifier)) { + return member.accessibility === modifier; + } + return !!member[modifier]; + }); + } + tsIsStartOfStaticBlocks() { + return this.isContextual(106) && this.lookaheadCharCode() === 123; + } + parseClassMember(classBody, member, state) { + const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; + this.tsParseModifiers({ + allowedModifiers: modifiers, + disallowedModifiers: ["in", "out"], + stopOnStartOfClassStaticBlock: true, + errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions + }, member); + const callParseClassMemberWithIsStatic = () => { + if (this.tsIsStartOfStaticBlocks()) { + this.next(); + this.next(); + if (this.tsHasSomeModifiers(member, modifiers)) { + this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition()); + } + super.parseClassStaticBlock(classBody, member); + } else { + this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); + } + }; + if (member.declare) { + this.tsInAmbientContext(callParseClassMemberWithIsStatic); + } else { + callParseClassMemberWithIsStatic(); + } + } + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const idx = this.tsTryParseIndexSignature(member); + if (idx) { + classBody.body.push(idx); + if (member.abstract) { + this.raise(TSErrors.IndexSignatureHasAbstract, member); + } + if (member.accessibility) { + this.raise(TSErrors.IndexSignatureHasAccessibility, member, { + modifier: member.accessibility + }); + } + if (member.declare) { + this.raise(TSErrors.IndexSignatureHasDeclare, member); + } + if (member.override) { + this.raise(TSErrors.IndexSignatureHasOverride, member); + } + return; + } + if (!this.state.inAbstractClass && member.abstract) { + this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member); + } + if (member.override) { + if (!state.hadSuperClass) { + this.raise(TSErrors.OverrideNotInSubClass, member); + } + } + super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + parsePostMemberNameModifiers(methodOrProp) { + const optional = this.eat(17); + if (optional) methodOrProp.optional = true; + if (methodOrProp.readonly && this.match(10)) { + this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp); + } + if (methodOrProp.declare && this.match(10)) { + this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp); + } + } + shouldParseExportDeclaration() { + if (this.tsIsDeclarationStart()) return true; + return super.shouldParseExportDeclaration(); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (!this.match(17)) return expr; + if (this.state.maybeInArrowParameters) { + const nextCh = this.lookaheadCharCode(); + if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { + this.setOptionalParametersError(refExpressionErrors); + return expr; + } + } + return super.parseConditional(expr, startLoc, refExpressionErrors); + } + parseParenItem(node, startLoc) { + const newNode = super.parseParenItem(node, startLoc); + if (this.eat(17)) { + newNode.optional = true; + this.resetEndLocation(node); + } + if (this.match(14)) { + const typeCastNode = this.startNodeAt(startLoc); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); + return this.finishNode(typeCastNode, "TSTypeCastExpression"); + } + return node; + } + parseExportDeclaration(node) { + if (!this.state.isAmbientContext && this.isContextual(125)) { + return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); + } + const startLoc = this.state.startLoc; + const isDeclare = this.eatContextual(125); + if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) { + throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc); + } + const isIdentifier = tokenIsIdentifier(this.state.type); + const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); + if (!declaration) return null; + if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { + node.exportKind = "type"; + } + if (isDeclare && declaration.type !== "TSImportEqualsDeclaration") { + this.resetStartLocation(declaration, startLoc); + declaration.declare = true; + } + return declaration; + } + parseClassId(node, isStatement, optionalId, bindingType) { + if ((!isStatement || optionalId) && this.isContextual(113)) { + return; + } + super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331); + const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); + if (typeParameters) node.typeParameters = typeParameters; + } + parseClassPropertyAnnotation(node) { + if (!node.optional) { + if (this.eat(35)) { + node.definite = true; + } else if (this.eat(17)) { + node.optional = true; + } + } + const type = this.tsTryParseTypeAnnotation(); + if (type) node.typeAnnotation = type; + } + parseClassProperty(node) { + this.parseClassPropertyAnnotation(node); + if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { + this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc); + } + if (node.abstract && this.match(29)) { + const { + key + } = node; + this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, { + propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` + }); + } + return super.parseClassProperty(node); + } + parseClassPrivateProperty(node) { + if (node.abstract) { + this.raise(TSErrors.PrivateElementHasAbstract, node); + } + if (node.accessibility) { + this.raise(TSErrors.PrivateElementHasAccessibility, node, { + modifier: node.accessibility + }); + } + this.parseClassPropertyAnnotation(node); + return super.parseClassPrivateProperty(node); + } + parseClassAccessorProperty(node) { + this.parseClassPropertyAnnotation(node); + if (node.optional) { + this.raise(TSErrors.AccessorCannotBeOptional, node); + } + return super.parseClassAccessorProperty(node); + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters && isConstructor) { + this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters); + } + const { + declare = false, + kind + } = method; + if (declare && (kind === "get" || kind === "set")) { + this.raise(TSErrors.DeclareAccessor, method, { + kind + }); + } + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) method.typeParameters = typeParameters; + super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); + } + declareClassPrivateMethodInScope(node, kind) { + if (node.type === "TSDeclareMethod") return; + if (node.type === "MethodDefinition" && node.value.body == null) { + return; + } + super.declareClassPrivateMethodInScope(node, kind); + } + parseClassSuper(node) { + super.parseClassSuper(node); + if (node.superClass && (this.match(47) || this.match(51))) { + { + node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); + } + } + if (this.eatContextual(113)) { + node.implements = this.tsParseHeritageClause("implements"); + } + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) prop.typeParameters = typeParameters; + return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); + } + parseFunctionParams(node, isConstructor) { + const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); + if (typeParameters) node.typeParameters = typeParameters; + super.parseFunctionParams(node, isConstructor); + } + parseVarId(decl, kind) { + super.parseVarId(decl, kind); + if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { + decl.definite = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) { + decl.id.typeAnnotation = type; + this.resetEndLocation(decl.id); + } + } + parseAsyncArrowFromCallExpression(node, call) { + if (this.match(14)) { + node.returnType = this.tsParseTypeAnnotation(); + } + return super.parseAsyncArrowFromCallExpression(node, call); + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; + let state; + let jsx; + let typeCast; + if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { + state = this.state.clone(); + jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!jsx.error) return jsx.node; + const { + context + } = this.state; + const currentContext = context[context.length - 1]; + if (currentContext === types.j_oTag || currentContext === types.j_expr) { + context.pop(); + } + } + if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { + return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + } + if (!state || state === this.state) state = this.state.clone(); + let typeParameters; + const arrow = this.tryParse(abort => { + var _expr$extra, _typeParameters; + typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); + const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); + if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { + abort(); + } + if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { + this.resetStartLocationFromNode(expr, typeParameters); + } + expr.typeParameters = typeParameters; + return expr; + }, state); + if (!arrow.error && !arrow.aborted) { + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if (!jsx) { + assert(!this.hasPlugin("jsx")); + typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); + if (!typeCast.error) return typeCast.node; + } + if ((_jsx2 = jsx) != null && _jsx2.node) { + this.state = jsx.failState; + return jsx.node; + } + if (arrow.node) { + this.state = arrow.failState; + if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); + return arrow.node; + } + if ((_typeCast = typeCast) != null && _typeCast.node) { + this.state = typeCast.failState; + return typeCast.node; + } + throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); + } + reportReservedArrowTypeParam(node) { + var _node$extra2; + if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra2 = node.extra) != null && _node$extra2.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { + this.raise(TSErrors.ReservedArrowTypeParam, node); + } + } + parseMaybeUnary(refExpressionErrors, sawUnary) { + if (!this.hasPlugin("jsx") && this.match(47)) { + return this.tsParseTypeAssertion(); + } + return super.parseMaybeUnary(refExpressionErrors, sawUnary); + } + parseArrow(node) { + if (this.match(14)) { + const result = this.tryParse(abort => { + const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); + if (this.canInsertSemicolon() || !this.match(19)) abort(); + return returnType; + }); + if (result.aborted) return; + if (!result.thrown) { + if (result.error) this.state = result.failState; + node.returnType = result.node; + } + } + return super.parseArrow(node); + } + parseFunctionParamType(param) { + if (this.eat(17)) { + param.optional = true; + } + const type = this.tsTryParseTypeAnnotation(); + if (type) param.typeAnnotation = type; + this.resetEndLocation(param); + return param; + } + isAssignable(node, isBinding) { + switch (node.type) { + case "TSTypeCastExpression": + return this.isAssignable(node.expression, isBinding); + case "TSParameterProperty": + return true; + default: + return super.isAssignable(node, isBinding); + } + } + toAssignable(node, isLHS = false) { + switch (node.type) { + case "ParenthesizedExpression": + this.toAssignableParenthesizedExpression(node, isLHS); + break; + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + if (isLHS) { + this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node); + } else { + this.raise(TSErrors.UnexpectedTypeCastInParameter, node); + } + this.toAssignable(node.expression, isLHS); + break; + case "AssignmentExpression": + if (!isLHS && node.left.type === "TSTypeCastExpression") { + node.left = this.typeCastToParameter(node.left); + } + default: + super.toAssignable(node, isLHS); + } + } + toAssignableParenthesizedExpression(node, isLHS) { + switch (node.expression.type) { + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSNonNullExpression": + case "TSTypeAssertion": + case "ParenthesizedExpression": + this.toAssignable(node.expression, isLHS); + break; + default: + super.toAssignable(node, isLHS); + } + } + checkToRestConversion(node, allowPattern) { + switch (node.type) { + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + case "TSNonNullExpression": + this.checkToRestConversion(node.expression, false); + break; + default: + super.checkToRestConversion(node, allowPattern); + } + } + isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding) { + switch (type) { + case "TSTypeCastExpression": + return true; + case "TSParameterProperty": + return "parameter"; + case "TSNonNullExpression": + return "expression"; + case "TSAsExpression": + case "TSSatisfiesExpression": + case "TSTypeAssertion": + return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true]; + default: + return super.isValidLVal(type, disallowCallExpression, isUnparenthesizedInAssign, binding); + } + } + parseBindingAtom() { + if (this.state.type === 78) { + return this.parseIdentifier(true); + } + return super.parseBindingAtom(); + } + parseMaybeDecoratorArguments(expr, startLoc) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsParseTypeArgumentsInExpression(); + if (this.match(10)) { + const call = super.parseMaybeDecoratorArguments(expr, startLoc); + { + call.typeParameters = typeArguments; + } + return call; + } + this.unexpected(null, 10); + } + return super.parseMaybeDecoratorArguments(expr, startLoc); + } + checkCommaAfterRest(close) { + if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { + this.next(); + return false; + } + return super.checkCommaAfterRest(close); + } + isClassMethod() { + return this.match(47) || super.isClassMethod(); + } + isClassProperty() { + return this.match(35) || this.match(14) || super.isClassProperty(); + } + parseMaybeDefault(startLoc, left) { + const node = super.parseMaybeDefault(startLoc, left); + if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { + this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation); + } + return node; + } + getTokenFromCode(code) { + if (this.state.inType) { + if (code === 62) { + this.finishOp(48, 1); + return; + } + if (code === 60) { + this.finishOp(47, 1); + return; + } + } + super.getTokenFromCode(code); + } + reScan_lt_gt() { + const { + type + } = this.state; + if (type === 47) { + this.state.pos -= 1; + this.readToken_lt(); + } else if (type === 48) { + this.state.pos -= 1; + this.readToken_gt(); + } + } + reScan_lt() { + const { + type + } = this.state; + if (type === 51) { + this.state.pos -= 2; + this.finishOp(47, 1); + return 47; + } + return type; + } + toAssignableListItem(exprList, index, isLHS) { + const node = exprList[index]; + if (node.type === "TSTypeCastExpression") { + exprList[index] = this.typeCastToParameter(node); + } + super.toAssignableListItem(exprList, index, isLHS); + } + typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); + return node.expression; + } + shouldParseArrow(params) { + if (this.match(14)) { + return params.every(expr => this.isAssignable(expr, true)); + } + return super.shouldParseArrow(params); + } + shouldParseAsyncArrow() { + return this.match(14) || super.shouldParseAsyncArrow(); + } + canHaveLeadingDecorator() { + return super.canHaveLeadingDecorator() || this.isAbstractClass(); + } + jsxParseOpeningElementAfterName(node) { + if (this.match(47) || this.match(51)) { + const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); + if (typeArguments) { + { + node.typeParameters = typeArguments; + } + } + } + return super.jsxParseOpeningElementAfterName(node); + } + getGetterSetterExpectedParamCount(method) { + const baseCount = super.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + const firstParam = params[0]; + const hasContextParam = firstParam && this.isThisParam(firstParam); + return hasContextParam ? baseCount + 1 : baseCount; + } + parseCatchClauseParam() { + const param = super.parseCatchClauseParam(); + const type = this.tsTryParseTypeAnnotation(); + if (type) { + param.typeAnnotation = type; + this.resetEndLocation(param); + } + return param; + } + tsInAmbientContext(cb) { + const { + isAmbientContext: oldIsAmbientContext, + strict: oldStrict + } = this.state; + this.state.isAmbientContext = true; + this.state.strict = false; + try { + return cb(); + } finally { + this.state.isAmbientContext = oldIsAmbientContext; + this.state.strict = oldStrict; + } + } + parseClass(node, isStatement, optionalId) { + const oldInAbstractClass = this.state.inAbstractClass; + this.state.inAbstractClass = !!node.abstract; + try { + return super.parseClass(node, isStatement, optionalId); + } finally { + this.state.inAbstractClass = oldInAbstractClass; + } + } + tsParseAbstractDeclaration(node, decorators) { + if (this.match(80)) { + node.abstract = true; + return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); + } else if (this.isContextual(129)) { + if (!this.hasFollowingLineBreak()) { + node.abstract = true; + this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node); + return this.tsParseInterfaceDeclaration(node); + } else { + return null; + } + } + throw this.unexpected(null, 80); + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { + const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); + if (method.abstract || method.type === "TSAbstractMethodDefinition") { + const hasEstreePlugin = this.hasPlugin("estree"); + const methodFn = hasEstreePlugin ? method.value : method; + if (methodFn.body) { + const { + key + } = method; + this.raise(TSErrors.AbstractMethodHasImplementation, method, { + methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` + }); + } + } + return method; + } + tsParseTypeParameterName() { + const typeName = this.parseIdentifier(); + return typeName.name; + } + shouldParseAsAmbientContext() { + return !!this.getPluginOption("typescript", "dts"); + } + parse() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + return super.parse(); + } + getExpression() { + if (this.shouldParseAsAmbientContext()) { + this.state.isAmbientContext = true; + } + return super.getExpression(); + } + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (!isString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); + return this.finishNode(node, "ExportSpecifier"); + } + node.exportKind = "value"; + return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + if (!importedIsString && isMaybeTypeOnly) { + this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); + return this.finishNode(specifier, "ImportSpecifier"); + } + specifier.importKind = "value"; + return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096); + } + parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { + const leftOfAsKey = isImport ? "imported" : "local"; + const rightOfAsKey = isImport ? "local" : "exported"; + let leftOfAs = node[leftOfAsKey]; + let rightOfAs; + let hasTypeSpecifier = false; + let canParseAsKeyword = true; + const loc = leftOfAs.loc.start; + if (this.isContextual(93)) { + const firstAs = this.parseIdentifier(); + if (this.isContextual(93)) { + const secondAs = this.parseIdentifier(); + if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + leftOfAs = firstAs; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + canParseAsKeyword = false; + } else { + rightOfAs = secondAs; + canParseAsKeyword = false; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + canParseAsKeyword = false; + rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } else { + hasTypeSpecifier = true; + leftOfAs = firstAs; + } + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + hasTypeSpecifier = true; + if (isImport) { + leftOfAs = this.parseIdentifier(true); + if (!this.isContextual(93)) { + this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); + } + } else { + leftOfAs = this.parseModuleExportName(); + } + } + if (hasTypeSpecifier && isInTypeOnlyImportExport) { + this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc); + } + node[leftOfAsKey] = leftOfAs; + node[rightOfAsKey] = rightOfAs; + const kindKey = isImport ? "importKind" : "exportKind"; + node[kindKey] = hasTypeSpecifier ? "type" : "value"; + if (canParseAsKeyword && this.eatContextual(93)) { + node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); + } + if (!node[rightOfAsKey]) { + node[rightOfAsKey] = this.cloneIdentifier(node[leftOfAsKey]); + } + if (isImport) { + this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096); + } + } + fillOptionalPropertiesForTSESLint(node) { + var _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$optional5, _node$readonly4, _node$declare7, _node$global, _node$const2, _node$in, _node$out; + switch (node.type) { + case "ExpressionStatement": + (_node$directive = node.directive) != null ? _node$directive : node.directive = undefined; + return; + case "RestElement": + node.value = undefined; + case "Identifier": + case "ArrayPattern": + case "AssignmentPattern": + case "ObjectPattern": + (_node$decorators = node.decorators) != null ? _node$decorators : node.decorators = []; + (_node$optional = node.optional) != null ? _node$optional : node.optional = false; + (_node$typeAnnotation = node.typeAnnotation) != null ? _node$typeAnnotation : node.typeAnnotation = undefined; + return; + case "TSParameterProperty": + (_node$accessibility = node.accessibility) != null ? _node$accessibility : node.accessibility = undefined; + (_node$decorators2 = node.decorators) != null ? _node$decorators2 : node.decorators = []; + (_node$override = node.override) != null ? _node$override : node.override = false; + (_node$readonly = node.readonly) != null ? _node$readonly : node.readonly = false; + (_node$static = node.static) != null ? _node$static : node.static = false; + return; + case "TSEmptyBodyFunctionExpression": + node.body = null; + case "TSDeclareFunction": + case "FunctionDeclaration": + case "FunctionExpression": + case "ClassMethod": + case "ClassPrivateMethod": + (_node$declare = node.declare) != null ? _node$declare : node.declare = false; + (_node$returnType = node.returnType) != null ? _node$returnType : node.returnType = undefined; + (_node$typeParameters = node.typeParameters) != null ? _node$typeParameters : node.typeParameters = undefined; + return; + case "Property": + (_node$optional2 = node.optional) != null ? _node$optional2 : node.optional = false; + return; + case "TSMethodSignature": + case "TSPropertySignature": + (_node$optional3 = node.optional) != null ? _node$optional3 : node.optional = false; + case "TSIndexSignature": + (_node$accessibility2 = node.accessibility) != null ? _node$accessibility2 : node.accessibility = undefined; + (_node$readonly2 = node.readonly) != null ? _node$readonly2 : node.readonly = false; + (_node$static2 = node.static) != null ? _node$static2 : node.static = false; + return; + case "TSAbstractPropertyDefinition": + case "PropertyDefinition": + case "TSAbstractAccessorProperty": + case "AccessorProperty": + (_node$declare2 = node.declare) != null ? _node$declare2 : node.declare = false; + (_node$definite = node.definite) != null ? _node$definite : node.definite = false; + (_node$readonly3 = node.readonly) != null ? _node$readonly3 : node.readonly = false; + (_node$typeAnnotation2 = node.typeAnnotation) != null ? _node$typeAnnotation2 : node.typeAnnotation = undefined; + case "TSAbstractMethodDefinition": + case "MethodDefinition": + (_node$accessibility3 = node.accessibility) != null ? _node$accessibility3 : node.accessibility = undefined; + (_node$decorators3 = node.decorators) != null ? _node$decorators3 : node.decorators = []; + (_node$override2 = node.override) != null ? _node$override2 : node.override = false; + (_node$optional4 = node.optional) != null ? _node$optional4 : node.optional = false; + return; + case "ClassExpression": + (_node$id = node.id) != null ? _node$id : node.id = null; + case "ClassDeclaration": + (_node$abstract = node.abstract) != null ? _node$abstract : node.abstract = false; + (_node$declare3 = node.declare) != null ? _node$declare3 : node.declare = false; + (_node$decorators4 = node.decorators) != null ? _node$decorators4 : node.decorators = []; + (_node$implements = node.implements) != null ? _node$implements : node.implements = []; + (_node$superTypeArgume = node.superTypeArguments) != null ? _node$superTypeArgume : node.superTypeArguments = undefined; + (_node$typeParameters2 = node.typeParameters) != null ? _node$typeParameters2 : node.typeParameters = undefined; + return; + case "TSTypeAliasDeclaration": + case "VariableDeclaration": + (_node$declare4 = node.declare) != null ? _node$declare4 : node.declare = false; + return; + case "VariableDeclarator": + (_node$definite2 = node.definite) != null ? _node$definite2 : node.definite = false; + return; + case "TSEnumDeclaration": + (_node$const = node.const) != null ? _node$const : node.const = false; + (_node$declare5 = node.declare) != null ? _node$declare5 : node.declare = false; + return; + case "TSEnumMember": + (_node$computed = node.computed) != null ? _node$computed : node.computed = false; + return; + case "TSImportType": + (_node$qualifier = node.qualifier) != null ? _node$qualifier : node.qualifier = null; + (_node$options = node.options) != null ? _node$options : node.options = null; + return; + case "TSInterfaceDeclaration": + (_node$declare6 = node.declare) != null ? _node$declare6 : node.declare = false; + (_node$extends = node.extends) != null ? _node$extends : node.extends = []; + return; + case "TSMappedType": + (_node$optional5 = node.optional) != null ? _node$optional5 : node.optional = false; + (_node$readonly4 = node.readonly) != null ? _node$readonly4 : node.readonly = undefined; + return; + case "TSModuleDeclaration": + (_node$declare7 = node.declare) != null ? _node$declare7 : node.declare = false; + (_node$global = node.global) != null ? _node$global : node.global = node.kind === "global"; + return; + case "TSTypeParameter": + (_node$const2 = node.const) != null ? _node$const2 : node.const = false; + (_node$in = node.in) != null ? _node$in : node.in = false; + (_node$out = node.out) != null ? _node$out : node.out = false; + return; + } + } + chStartsBindingIdentifierAndNotRelationalOperator(ch, pos) { + if (isIdentifierStart(ch)) { + keywordAndTSRelationalOperator.lastIndex = pos; + if (keywordAndTSRelationalOperator.test(this.input)) { + const endCh = this.codePointAtPos(keywordAndTSRelationalOperator.lastIndex); + if (!isIdentifierChar(endCh) && endCh !== 92) { + return false; + } + } + return true; + } else if (ch === 92) { + return true; + } else { + return false; + } + } + nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine() { + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + return this.chStartsBindingIdentifierAndNotRelationalOperator(nextCh, next); + } + nextTokenIsIdentifierOrStringLiteralOnSameLine() { + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + return this.chStartsBindingIdentifier(nextCh, next) || nextCh === 34 || nextCh === 39; + } +}; +function isPossiblyLiteralEnum(expression) { + if (expression.type !== "MemberExpression") return false; + const { + computed, + property + } = expression; + if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { + return false; + } + return isUncomputedMemberExpressionChain(expression.object); +} +function isValidAmbientConstInitializer(expression, estree) { + var _expression$extra; + const { + type + } = expression; + if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) { + return false; + } + if (estree) { + if (type === "Literal") { + const { + value + } = expression; + if (typeof value === "string" || typeof value === "boolean") { + return true; + } + } + } else { + if (type === "StringLiteral" || type === "BooleanLiteral") { + return true; + } + } + if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) { + return true; + } + if (type === "TemplateLiteral" && expression.expressions.length === 0) { + return true; + } + if (isPossiblyLiteralEnum(expression)) { + return true; + } + return false; +} +function isNumber(expression, estree) { + if (estree) { + return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); + } + return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; +} +function isNegativeNumber(expression, estree) { + if (expression.type === "UnaryExpression") { + const { + operator, + argument + } = expression; + if (operator === "-" && isNumber(argument, estree)) { + return true; + } + } + return false; +} +function isUncomputedMemberExpressionChain(expression) { + if (expression.type === "Identifier") return true; + if (expression.type !== "MemberExpression" || expression.computed) { + return false; + } + return isUncomputedMemberExpressionChain(expression.object); +} +const PlaceholderErrors = ParseErrorEnum`placeholders`({ + ClassNameIsRequired: "A class name is required.", + UnexpectedSpace: "Unexpected space in placeholder." +}); +var placeholders = superClass => class PlaceholdersParserMixin extends superClass { + parsePlaceholder(expectedNode) { + if (this.match(133)) { + const node = this.startNode(); + this.next(); + this.assertNoSpace(); + node.name = super.parseIdentifier(true); + this.assertNoSpace(); + this.expect(133); + return this.finishPlaceholder(node, expectedNode); + } + } + finishPlaceholder(node, expectedNode) { + let placeholder = node; + if (!placeholder.expectedNode || !placeholder.type) { + placeholder = this.finishNode(placeholder, "Placeholder"); + } + placeholder.expectedNode = expectedNode; + return placeholder; + } + getTokenFromCode(code) { + if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { + this.finishOp(133, 2); + } else { + super.getTokenFromCode(code); + } + } + parseExprAtom(refExpressionErrors) { + return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); + } + parseIdentifier(liberal) { + return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (word !== undefined) { + super.checkReservedWord(word, startLoc, checkKeywords, isBinding); + } + } + cloneIdentifier(node) { + const cloned = super.cloneIdentifier(node); + if (cloned.type === "Placeholder") { + cloned.expectedNode = node.expectedNode; + } + return cloned; + } + cloneStringLiteral(node) { + if (node.type === "Placeholder") { + return this.cloneIdentifier(node); + } + return super.cloneStringLiteral(node); + } + parseBindingAtom() { + return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); + } + isValidLVal(type, disallowCallExpression, isParenthesized, binding) { + return type === "Placeholder" || super.isValidLVal(type, disallowCallExpression, isParenthesized, binding); + } + toAssignable(node, isLHS) { + if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { + node.expectedNode = "Pattern"; + } else { + super.toAssignable(node, isLHS); + } + } + chStartsBindingIdentifier(ch, pos) { + if (super.chStartsBindingIdentifier(ch, pos)) { + return true; + } + const next = this.nextTokenStart(); + if (this.input.charCodeAt(next) === 37 && this.input.charCodeAt(next + 1) === 37) { + return true; + } + return false; + } + verifyBreakContinue(node, isBreak) { + if (node.label && node.label.type === "Placeholder") return; + super.verifyBreakContinue(node, isBreak); + } + parseExpressionStatement(node, expr) { + var _expr$extra; + if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { + return super.parseExpressionStatement(node, expr); + } + if (this.match(14)) { + const stmt = node; + stmt.label = this.finishPlaceholder(expr, "Identifier"); + this.next(); + stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration(); + return this.finishNode(stmt, "LabeledStatement"); + } + this.semicolon(); + const stmtPlaceholder = node; + stmtPlaceholder.name = expr.name; + return this.finishPlaceholder(stmtPlaceholder, "Statement"); + } + parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { + return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); + } + parseFunctionId(requireId) { + return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); + } + parseClass(node, isStatement, optionalId) { + const type = isStatement ? "ClassDeclaration" : "ClassExpression"; + this.next(); + const oldStrict = this.state.strict; + const placeholder = this.parsePlaceholder("Identifier"); + if (placeholder) { + if (this.match(81) || this.match(133) || this.match(5)) { + node.id = placeholder; + } else if (optionalId || !isStatement) { + node.id = null; + node.body = this.finishPlaceholder(placeholder, "ClassBody"); + return this.finishNode(node, type); + } else { + throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc); + } + } else { + this.parseClassId(node, isStatement, optionalId); + } + super.parseClassSuper(node); + node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, type); + } + parseExport(node, decorators) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseExport(node, decorators); + const node2 = node; + if (!this.isContextual(98) && !this.match(12)) { + node2.specifiers = []; + node2.source = null; + node2.declaration = this.finishPlaceholder(placeholder, "Declaration"); + return this.finishNode(node2, "ExportNamedDeclaration"); + } + this.expectPlugin("exportDefaultFrom"); + const specifier = this.startNode(); + specifier.exported = placeholder; + node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return super.parseExport(node2, decorators); + } + isExportDefaultSpecifier() { + if (this.match(65)) { + const next = this.nextTokenStart(); + if (this.isUnparsedContextual(next, "from")) { + if (this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4))) { + return true; + } + } + } + return super.isExportDefaultSpecifier(); + } + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + var _specifiers; + if ((_specifiers = node.specifiers) != null && _specifiers.length) { + return true; + } + return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); + } + checkExport(node) { + const { + specifiers + } = node; + if (specifiers != null && specifiers.length) { + node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); + } + super.checkExport(node); + node.specifiers = specifiers; + } + parseImport(node) { + const placeholder = this.parsePlaceholder("Identifier"); + if (!placeholder) return super.parseImport(node); + node.specifiers = []; + if (!this.isContextual(98) && !this.match(12)) { + node.source = this.finishPlaceholder(placeholder, "StringLiteral"); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + const specifier = this.startNodeAtNode(placeholder); + specifier.local = placeholder; + node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); + if (this.eat(12)) { + const hasStarImport = this.maybeParseStarImportSpecifier(node); + if (!hasStarImport) this.parseNamedImportSpecifiers(node); + } + this.expectContextual(98); + node.source = this.parseImportSource(); + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); + } + parseImportSource() { + return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); + } + assertNoSpace() { + if (this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index)) { + this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc); + } + } +}; +var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass { + parseV8Intrinsic() { + if (this.match(54)) { + const v8IntrinsicStartLoc = this.state.startLoc; + const node = this.startNode(); + this.next(); + if (tokenIsIdentifier(this.state.type)) { + const name = this.parseIdentifierName(); + const identifier = this.createIdentifier(node, name); + this.castNodeTo(identifier, "V8IntrinsicIdentifier"); + if (this.match(10)) { + return identifier; + } + } + this.unexpected(v8IntrinsicStartLoc); + } + } + parseExprAtom(refExpressionErrors) { + return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); + } +}; +const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; +const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; +function validatePlugins(pluginsMap) { + if (pluginsMap.has("decorators")) { + if (pluginsMap.has("decorators-legacy")) { + throw new Error("Cannot use the decorators and decorators-legacy plugin together"); + } + const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport; + if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { + throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); + } + const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized; + if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { + throw new Error("'allowCallParenthesized' must be a boolean."); + } + } + if (pluginsMap.has("flow") && pluginsMap.has("typescript")) { + throw new Error("Cannot combine flow and typescript plugins."); + } + if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) { + throw new Error("Cannot combine placeholders and v8intrinsic plugins."); + } + if (pluginsMap.has("pipelineOperator")) { + var _pluginsMap$get2; + const proposal = pluginsMap.get("pipelineOperator").proposal; + if (!PIPELINE_PROPOSALS.includes(proposal)) { + const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); + throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); + } + if (proposal === "hack") { + if (pluginsMap.has("placeholders")) { + throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); + } + if (pluginsMap.has("v8intrinsic")) { + throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); + } + const topicToken = pluginsMap.get("pipelineOperator").topicToken; + if (!TOPIC_TOKENS.includes(topicToken)) { + const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); + throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); + } + { + var _pluginsMap$get; + if (topicToken === "#" && ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash") { + throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + } + } + } else if (proposal === "smart" && ((_pluginsMap$get2 = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get2.syntaxType) === "hash") { + throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); + } + } + if (pluginsMap.has("moduleAttributes")) { + { + if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions")) { + throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins."); + } + const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version; + if (moduleAttributesVersionPluginOption !== "may-2020") { + throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); + } + } + } + if (pluginsMap.has("importAssertions")) { + if (pluginsMap.has("deprecatedImportAssert")) { + throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins."); + } + } + if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax) { + { + pluginsMap.set("deprecatedImportAssert", {}); + } + } + if (pluginsMap.has("recordAndTuple")) { + { + const syntaxType = pluginsMap.get("recordAndTuple").syntaxType; + if (syntaxType != null) { + const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; + if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) { + throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); + } + } + } + } + if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) { + const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); + error.missingPlugins = "doExpressions"; + throw error; + } + if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") { + throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'."); + } + if (pluginsMap.has("discardBinding") && pluginsMap.get("discardBinding").syntaxType !== "void") { + throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'."); + } +} +const mixinPlugins = { + estree, + jsx, + flow, + typescript, + v8intrinsic, + placeholders +}; +const mixinPluginNames = Object.keys(mixinPlugins); +class ExpressionParser extends LValParser { + checkProto(prop, isRecord, sawProto, refExpressionErrors) { + if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { + return sawProto; + } + const key = prop.key; + const name = key.type === "Identifier" ? key.name : key.value; + if (name === "__proto__") { + if (isRecord) { + this.raise(Errors.RecordNoProto, key); + return true; + } + if (sawProto) { + if (refExpressionErrors) { + if (refExpressionErrors.doubleProtoLoc === null) { + refExpressionErrors.doubleProtoLoc = key.loc.start; + } + } else { + this.raise(Errors.DuplicateProto, key); + } + } + return true; + } + return sawProto; + } + shouldExitDescending(expr, potentialArrowAt) { + return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt; + } + getExpression() { + this.enterInitialScopes(); + this.nextToken(); + if (this.match(140)) { + throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc); + } + const expr = this.parseExpression(); + if (!this.match(140)) { + throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, { + unexpected: this.input.codePointAt(this.state.start) + }); + } + this.finalizeRemainingComments(); + expr.comments = this.comments; + expr.errors = this.state.errors; + if (this.optionFlags & 256) { + expr.tokens = this.tokens; + } + return expr; + } + parseExpression(disallowIn, refExpressionErrors) { + if (disallowIn) { + return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); + } + parseExpressionBase(refExpressionErrors) { + const startLoc = this.state.startLoc; + const expr = this.parseMaybeAssign(refExpressionErrors); + if (this.match(12)) { + const node = this.startNodeAt(startLoc); + node.expressions = [expr]; + while (this.eat(12)) { + node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); + } + this.toReferencedList(node.expressions); + return this.finishNode(node, "SequenceExpression"); + } + return expr; + } + parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { + return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { + return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); + } + setOptionalParametersError(refExpressionErrors) { + refExpressionErrors.optionalParametersLoc = this.state.startLoc; + } + parseMaybeAssign(refExpressionErrors, afterLeftParse) { + const startLoc = this.state.startLoc; + const isYield = this.isContextual(108); + if (isYield) { + if (this.prodParam.hasYield) { + this.next(); + let left = this.parseYield(startLoc); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startLoc); + } + return left; + } + } + let ownExpressionErrors; + if (refExpressionErrors) { + ownExpressionErrors = false; + } else { + refExpressionErrors = new ExpressionErrors(); + ownExpressionErrors = true; + } + const { + type + } = this.state; + if (type === 10 || tokenIsIdentifier(type)) { + this.state.potentialArrowAt = this.state.start; + } + let left = this.parseMaybeConditional(refExpressionErrors); + if (afterLeftParse) { + left = afterLeftParse.call(this, left, startLoc); + } + if (tokenIsAssignment(this.state.type)) { + const node = this.startNodeAt(startLoc); + const operator = this.state.value; + node.operator = operator; + if (this.match(29)) { + this.toAssignable(left, true); + node.left = left; + const startIndex = startLoc.index; + if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { + refExpressionErrors.doubleProtoLoc = null; + } + if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { + refExpressionErrors.shorthandAssignLoc = null; + } + if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { + this.checkDestructuringPrivate(refExpressionErrors); + refExpressionErrors.privateKeyLoc = null; + } + if (refExpressionErrors.voidPatternLoc != null && refExpressionErrors.voidPatternLoc.index >= startIndex) { + refExpressionErrors.voidPatternLoc = null; + } + } else { + node.left = left; + } + this.next(); + node.right = this.parseMaybeAssign(); + this.checkLVal(left, this.finishNode(node, "AssignmentExpression"), undefined, undefined, undefined, undefined, operator === "||=" || operator === "&&=" || operator === "??="); + return node; + } else if (ownExpressionErrors) { + this.checkExpressionErrors(refExpressionErrors, true); + } + if (isYield) { + const { + type + } = this.state; + const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); + if (startsExpr && !this.isAmbiguousPrefixOrIdentifier()) { + this.raiseOverwrite(Errors.YieldNotInGeneratorFunction, startLoc); + return this.parseYield(startLoc); + } + } + return left; + } + parseMaybeConditional(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprOps(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseConditional(expr, startLoc, refExpressionErrors); + } + parseConditional(expr, startLoc, refExpressionErrors) { + if (this.eat(17)) { + const node = this.startNodeAt(startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssignAllowIn(); + this.expect(14); + node.alternate = this.parseMaybeAssign(); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; + } + parseMaybeUnaryOrPrivate(refExpressionErrors) { + return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); + } + parseExprOps(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseExprOp(expr, startLoc, -1); + } + parseExprOp(left, leftStartLoc, minPrec) { + if (this.isPrivateName(left)) { + const value = this.getPrivateNameSV(left); + if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { + this.raise(Errors.PrivateInExpectedIn, left, { + identifierName: value + }); + } + this.classScope.usePrivateName(value, left.loc.start); + } + const op = this.state.type; + if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { + let prec = tokenOperatorPrecedence(op); + if (prec > minPrec) { + if (op === 39) { + this.expectPlugin("pipelineOperator"); + if (this.state.inFSharpPipelineDirectBody) { + return left; + } + this.checkPipelineAtInfixOperator(left, leftStartLoc); + } + const node = this.startNodeAt(leftStartLoc); + node.left = left; + node.operator = this.state.value; + const logical = op === 41 || op === 42; + const coalesce = op === 40; + if (coalesce) { + prec = tokenOperatorPrecedence(42); + } + this.next(); + if (op === 39 && this.hasPlugin(["pipelineOperator", { + proposal: "minimal" + }])) { + if (this.state.type === 96 && this.prodParam.hasAwait) { + throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc); + } + } + node.right = this.parseExprOpRightExpr(op, prec); + const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); + const nextOp = this.state.type; + if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { + throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc); + } + return this.parseExprOp(finishedNode, leftStartLoc, minPrec); + } + } + return left; + } + parseExprOpRightExpr(op, prec) { + const startLoc = this.state.startLoc; + switch (op) { + case 39: + switch (this.getPluginOption("pipelineOperator", "proposal")) { + case "hack": + return this.withTopicBindingContext(() => { + return this.parseHackPipeBody(); + }); + case "fsharp": + return this.withSoloAwaitPermittingContext(() => { + return this.parseFSharpPipelineBody(prec); + }); + } + if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { + return this.withTopicBindingContext(() => { + if (this.prodParam.hasYield && this.isContextual(108)) { + throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc); + } + return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); + }); + } + default: + return this.parseExprOpBaseRightExpr(op, prec); + } + } + parseExprOpBaseRightExpr(op, prec) { + const startLoc = this.state.startLoc; + return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); + } + parseHackPipeBody() { + var _body$extra; + const { + startLoc + } = this.state; + const body = this.parseMaybeAssign(); + const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); + if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { + this.raise(Errors.PipeUnparenthesizedBody, startLoc, { + type: body.type + }); + } + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipeTopicUnused, startLoc); + } + return body; + } + checkExponentialAfterUnary(node) { + if (this.match(57)) { + this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument); + } + } + parseMaybeUnary(refExpressionErrors, sawUnary) { + const startLoc = this.state.startLoc; + const isAwait = this.isContextual(96); + if (isAwait && this.recordAwaitIfAllowed()) { + this.next(); + const expr = this.parseAwait(startLoc); + if (!sawUnary) this.checkExponentialAfterUnary(expr); + return expr; + } + const update = this.match(34); + const node = this.startNode(); + if (tokenIsPrefix(this.state.type)) { + node.operator = this.state.value; + node.prefix = true; + if (this.match(72)) { + this.expectPlugin("throwExpressions"); + } + const isDelete = this.match(89); + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refExpressionErrors, true); + if (this.state.strict && isDelete) { + const arg = node.argument; + if (arg.type === "Identifier") { + this.raise(Errors.StrictDelete, node); + } else if (this.hasPropertyAsPrivateName(arg)) { + this.raise(Errors.DeletePrivateField, node); + } + } + if (!update) { + if (!sawUnary) { + this.checkExponentialAfterUnary(node); + } + return this.finishNode(node, "UnaryExpression"); + } + } + const expr = this.parseUpdate(node, update, refExpressionErrors); + if (isAwait) { + const { + type + } = this.state; + const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); + if (startsExpr && !this.isAmbiguousPrefixOrIdentifier()) { + this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc); + return this.parseAwait(startLoc); + } + } + return expr; + } + parseUpdate(node, update, refExpressionErrors) { + if (update) { + const updateExpressionNode = node; + this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression")); + return node; + } + const startLoc = this.state.startLoc; + let expr = this.parseExprSubscripts(refExpressionErrors); + if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; + while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { + const node = this.startNodeAt(startLoc); + node.operator = this.state.value; + node.prefix = false; + node.argument = expr; + this.next(); + this.checkLVal(expr, expr = this.finishNode(node, "UpdateExpression")); + } + return expr; + } + parseExprSubscripts(refExpressionErrors) { + const startLoc = this.state.startLoc; + const potentialArrowAt = this.state.potentialArrowAt; + const expr = this.parseExprAtom(refExpressionErrors); + if (this.shouldExitDescending(expr, potentialArrowAt)) { + return expr; + } + return this.parseSubscripts(expr, startLoc); + } + parseSubscripts(base, startLoc, noCalls) { + const state = { + optionalChainMember: false, + maybeAsyncArrow: this.atPossibleAsyncArrow(base), + stop: false + }; + do { + base = this.parseSubscript(base, startLoc, noCalls, state); + state.maybeAsyncArrow = false; + } while (!state.stop); + return base; + } + parseSubscript(base, startLoc, noCalls, state) { + const { + type + } = this.state; + if (!noCalls && type === 15) { + return this.parseBind(base, startLoc, noCalls, state); + } else if (tokenIsTemplate(type)) { + return this.parseTaggedTemplateExpression(base, startLoc, state); + } + let optional = false; + if (type === 18) { + if (noCalls) { + this.raise(Errors.OptionalChainingNoNew, this.state.startLoc); + if (this.lookaheadCharCode() === 40) { + return this.stopParseSubscript(base, state); + } + } + state.optionalChainMember = optional = true; + this.next(); + } + if (!noCalls && this.match(10)) { + return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); + } else { + const computed = this.eat(0); + if (computed || optional || this.eat(16)) { + return this.parseMember(base, startLoc, state, computed, optional); + } else { + return this.stopParseSubscript(base, state); + } + } + } + stopParseSubscript(base, state) { + state.stop = true; + return base; + } + parseMember(base, startLoc, state, computed, optional) { + const node = this.startNodeAt(startLoc); + node.object = base; + node.computed = computed; + if (computed) { + node.property = this.parseExpression(); + this.expect(3); + } else if (this.match(139)) { + if (base.type === "Super") { + this.raise(Errors.SuperPrivateField, startLoc); + } + this.classScope.usePrivateName(this.state.value, this.state.startLoc); + node.property = this.parsePrivateName(); + } else { + node.property = this.parseIdentifier(true); + } + if (state.optionalChainMember) { + node.optional = optional; + return this.finishNode(node, "OptionalMemberExpression"); + } else { + return this.finishNode(node, "MemberExpression"); + } + } + parseBind(base, startLoc, noCalls, state) { + const node = this.startNodeAt(startLoc); + node.object = base; + this.next(); + node.callee = this.parseNoCallExpr(); + state.stop = true; + return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); + } + parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + let refExpressionErrors = null; + this.state.maybeInArrowParameters = true; + this.next(); + const node = this.startNodeAt(startLoc); + node.callee = base; + const { + maybeAsyncArrow, + optionalChainMember + } = state; + if (maybeAsyncArrow) { + this.expressionScope.enter(newAsyncArrowScope()); + refExpressionErrors = new ExpressionErrors(); + } + if (optionalChainMember) { + node.optional = optional; + } + if (optional) { + node.arguments = this.parseCallExpressionArguments(); + } else { + node.arguments = this.parseCallExpressionArguments(base.type !== "Super", node, refExpressionErrors); + } + let finishedNode = this.finishCallExpression(node, optionalChainMember); + if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { + state.stop = true; + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); + } else { + if (maybeAsyncArrow) { + this.checkExpressionErrors(refExpressionErrors, true); + this.expressionScope.exit(); + } + this.toReferencedArguments(finishedNode); + } + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return finishedNode; + } + toReferencedArguments(node, isParenthesizedExpr) { + this.toReferencedListDeep(node.arguments, isParenthesizedExpr); + } + parseTaggedTemplateExpression(base, startLoc, state) { + const node = this.startNodeAt(startLoc); + node.tag = base; + node.quasi = this.parseTemplate(true); + if (state.optionalChainMember) { + this.raise(Errors.OptionalChainingNoTemplate, startLoc); + } + return this.finishNode(node, "TaggedTemplateExpression"); + } + atPossibleAsyncArrow(base) { + return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.offsetToSourcePos(base.start) === this.state.potentialArrowAt; + } + finishCallExpression(node, optional) { + if (node.callee.type === "Import") { + if (node.arguments.length === 0 || node.arguments.length > 2) { + this.raise(Errors.ImportCallArity, node); + } else { + for (const arg of node.arguments) { + if (arg.type === "SpreadElement") { + this.raise(Errors.ImportCallSpreadArgument, arg); + } + } + } + } + return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); + } + parseCallExpressionArguments(allowPlaceholder, nodeForExtra, refExpressionErrors) { + const elts = []; + let first = true; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + while (!this.eat(11)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(11)) { + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + this.next(); + break; + } + } + elts.push(this.parseExprListItem(11, false, refExpressionErrors, allowPlaceholder)); + } + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return elts; + } + shouldParseAsyncArrow() { + return this.match(19) && !this.canInsertSemicolon(); + } + parseAsyncArrowFromCallExpression(node, call) { + var _call$extra; + this.resetPreviousNodeTrailingComments(call); + this.expect(19); + this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); + if (call.innerComments) { + setInnerComments(node, call.innerComments); + } + if (call.callee.trailingComments) { + setInnerComments(node, call.callee.trailingComments); + } + return node; + } + parseNoCallExpr() { + const startLoc = this.state.startLoc; + return this.parseSubscripts(this.parseExprAtom(), startLoc, true); + } + parseExprAtom(refExpressionErrors) { + let node; + let decorators = null; + const { + type + } = this.state; + switch (type) { + case 79: + return this.parseSuper(); + case 83: + node = this.startNode(); + this.next(); + if (this.match(16)) { + return this.parseImportMetaPropertyOrPhaseCall(node); + } + if (this.match(10)) { + if (this.optionFlags & 512) { + return this.parseImportCall(node); + } else { + return this.finishNode(node, "Import"); + } + } else { + this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc); + return this.finishNode(node, "Import"); + } + case 78: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression"); + case 90: + { + return this.parseDo(this.startNode(), false); + } + case 56: + case 31: + { + this.readRegexp(); + return this.parseRegExpLiteral(this.state.value); + } + case 135: + return this.parseNumericLiteral(this.state.value); + case 136: + return this.parseBigIntLiteral(this.state.value); + case 134: + return this.parseStringLiteral(this.state.value); + case 84: + return this.parseNullLiteral(); + case 85: + return this.parseBooleanLiteral(true); + case 86: + return this.parseBooleanLiteral(false); + case 10: + { + const canBeArrow = this.state.potentialArrowAt === this.state.start; + return this.parseParenAndDistinguishExpression(canBeArrow); + } + case 0: + { + return this.parseArrayLike(3, false, refExpressionErrors); + } + case 5: + { + return this.parseObjectLike(8, false, false, refExpressionErrors); + } + case 68: + return this.parseFunctionOrFunctionSent(); + case 26: + decorators = this.parseDecorators(); + case 80: + return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); + case 77: + return this.parseNewOrNewTarget(); + case 25: + case 24: + return this.parseTemplate(false); + case 15: + { + node = this.startNode(); + this.next(); + node.object = null; + const callee = node.callee = this.parseNoCallExpr(); + if (callee.type === "MemberExpression") { + return this.finishNode(node, "BindExpression"); + } else { + throw this.raise(Errors.UnsupportedBind, callee); + } + } + case 139: + { + this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { + identifierName: this.state.value + }); + return this.parsePrivateName(); + } + case 33: + { + return this.parseTopicReferenceThenEqualsSign(54, "%"); + } + case 32: + { + return this.parseTopicReferenceThenEqualsSign(44, "^"); + } + case 37: + case 38: + { + return this.parseTopicReference("hack"); + } + case 44: + case 54: + case 27: + { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + if (pipeProposal) { + return this.parseTopicReference(pipeProposal); + } + throw this.unexpected(); + } + case 47: + { + const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); + if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { + throw this.expectOnePlugin(["jsx", "flow", "typescript"]); + } + throw this.unexpected(); + } + default: + { + if (type === 137) { + return this.parseDecimalLiteral(this.state.value); + } else if (type === 2 || type === 1) { + return this.parseArrayLike(this.state.type === 2 ? 4 : 3, true); + } else if (type === 6 || type === 7) { + return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); + } + } + if (tokenIsIdentifier(type)) { + if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { + return this.parseModuleExpression(); + } + const canBeArrow = this.state.potentialArrowAt === this.state.start; + const containsEsc = this.state.containsEsc; + const id = this.parseIdentifier(); + if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { + const { + type + } = this.state; + if (type === 68) { + this.resetPreviousNodeTrailingComments(id); + this.next(); + return this.parseAsyncFunctionExpression(this.startNodeAtNode(id)); + } else if (tokenIsIdentifier(type)) { + if (this.lookaheadCharCode() === 61) { + return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); + } else { + return id; + } + } else if (type === 90) { + this.resetPreviousNodeTrailingComments(id); + return this.parseDo(this.startNodeAtNode(id), true); + } + } + if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { + this.next(); + return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); + } + return id; + } else { + throw this.unexpected(); + } + } + } + parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { + const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); + if (pipeProposal) { + this.state.type = topicTokenType; + this.state.value = topicTokenValue; + this.state.pos--; + this.state.end--; + this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); + return this.parseTopicReference(pipeProposal); + } + throw this.unexpected(); + } + parseTopicReference(pipeProposal) { + const node = this.startNode(); + const startLoc = this.state.startLoc; + const tokenType = this.state.type; + this.next(); + return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); + } + finishTopicReference(node, startLoc, pipeProposal, tokenType) { + if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { + if (pipeProposal === "hack") { + if (!this.topicReferenceIsAllowedInCurrentContext()) { + this.raise(Errors.PipeTopicUnbound, startLoc); + } + this.registerTopicReference(); + return this.finishNode(node, "TopicReference"); + } else { + if (!this.topicReferenceIsAllowedInCurrentContext()) { + this.raise(Errors.PrimaryTopicNotAllowed, startLoc); + } + this.registerTopicReference(); + return this.finishNode(node, "PipelinePrimaryTopicReference"); + } + } else { + throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, { + token: tokenLabelName(tokenType) + }); + } + } + testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { + switch (pipeProposal) { + case "hack": + { + return this.hasPlugin(["pipelineOperator", { + topicToken: tokenLabelName(tokenType) + }]); + } + case "smart": + return tokenType === 27; + default: + throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc); + } + } + parseAsyncArrowUnaryFunction(node) { + this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); + const params = [this.parseIdentifier()]; + this.prodParam.exit(); + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition()); + } + this.expect(19); + return this.parseArrowExpression(node, params, true); + } + parseDo(node, isAsync) { + this.expectPlugin("doExpressions"); + if (isAsync) { + this.expectPlugin("asyncDoExpressions"); + } + node.async = isAsync; + this.next(); + const oldLabels = this.state.labels; + this.state.labels = []; + if (isAsync) { + this.prodParam.enter(2); + node.body = this.parseBlock(); + this.prodParam.exit(); + } else { + node.body = this.parseBlock(); + } + this.state.labels = oldLabels; + return this.finishNode(node, "DoExpression"); + } + parseSuper() { + const node = this.startNode(); + this.next(); + if (this.match(10) && !this.scope.allowDirectSuper) { + { + if (!(this.optionFlags & 16)) { + this.raise(Errors.SuperNotAllowed, node); + } + } + } else if (!this.scope.allowSuper) { + { + if (!(this.optionFlags & 16)) { + this.raise(Errors.UnexpectedSuper, node); + } + } + } + if (!this.match(10) && !this.match(0) && !this.match(16)) { + this.raise(Errors.UnsupportedSuper, node); + } + return this.finishNode(node, "Super"); + } + parsePrivateName() { + const node = this.startNode(); + const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)); + const name = this.state.value; + this.next(); + node.id = this.createIdentifier(id, name); + return this.finishNode(node, "PrivateName"); + } + parseFunctionOrFunctionSent() { + const node = this.startNode(); + this.next(); + if (this.prodParam.hasYield && this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); + this.next(); + if (this.match(103)) { + this.expectPlugin("functionSent"); + } else if (!this.hasPlugin("functionSent")) { + this.unexpected(); + } + return this.parseMetaProperty(node, meta, "sent"); + } + return this.parseFunction(node); + } + parseMetaProperty(node, meta, propertyName) { + node.meta = meta; + const containsEsc = this.state.containsEsc; + node.property = this.parseIdentifier(true); + if (node.property.name !== propertyName || containsEsc) { + this.raise(Errors.UnsupportedMetaProperty, node.property, { + target: meta.name, + onlyValidPropertyName: propertyName + }); + } + return this.finishNode(node, "MetaProperty"); + } + parseImportMetaPropertyOrPhaseCall(node) { + this.next(); + if (this.isContextual(105) || this.isContextual(97)) { + const isSource = this.isContextual(105); + this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"); + this.next(); + node.phase = isSource ? "source" : "defer"; + return this.parseImportCall(node); + } else { + const id = this.createIdentifierAt(this.startNodeAtNode(node), "import", this.state.lastTokStartLoc); + if (this.isContextual(101)) { + if (!this.inModule) { + this.raise(Errors.ImportMetaOutsideModule, id); + } + this.sawUnambiguousESM = true; + } + return this.parseMetaProperty(node, id, "meta"); + } + } + parseLiteralAtNode(value, type, node) { + this.addExtra(node, "rawValue", value); + this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); + node.value = value; + this.next(); + return this.finishNode(node, type); + } + parseLiteral(value, type) { + const node = this.startNode(); + return this.parseLiteralAtNode(value, type, node); + } + parseStringLiteral(value) { + return this.parseLiteral(value, "StringLiteral"); + } + parseNumericLiteral(value) { + return this.parseLiteral(value, "NumericLiteral"); + } + parseBigIntLiteral(value) { + { + return this.parseLiteral(value, "BigIntLiteral"); + } + } + parseDecimalLiteral(value) { + return this.parseLiteral(value, "DecimalLiteral"); + } + parseRegExpLiteral(value) { + const node = this.startNode(); + this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); + node.pattern = value.pattern; + node.flags = value.flags; + this.next(); + return this.finishNode(node, "RegExpLiteral"); + } + parseBooleanLiteral(value) { + const node = this.startNode(); + node.value = value; + this.next(); + return this.finishNode(node, "BooleanLiteral"); + } + parseNullLiteral() { + const node = this.startNode(); + this.next(); + return this.finishNode(node, "NullLiteral"); + } + parseParenAndDistinguishExpression(canBeArrow) { + const startLoc = this.state.startLoc; + let val; + this.next(); + this.expressionScope.enter(newArrowHeadScope()); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.maybeInArrowParameters = true; + this.state.inFSharpPipelineDirectBody = false; + const innerStartLoc = this.state.startLoc; + const exprList = []; + const refExpressionErrors = new ExpressionErrors(); + let first = true; + let spreadStartLoc; + let optionalCommaStartLoc; + while (!this.match(11)) { + if (first) { + first = false; + } else { + this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); + if (this.match(11)) { + optionalCommaStartLoc = this.state.startLoc; + break; + } + } + if (this.match(21)) { + const spreadNodeStartLoc = this.state.startLoc; + spreadStartLoc = this.state.startLoc; + exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); + if (!this.checkCommaAfterRest(41)) { + break; + } + } else { + exprList.push(this.parseMaybeAssignAllowInOrVoidPattern(11, refExpressionErrors, this.parseParenItem)); + } + } + const innerEndLoc = this.state.lastTokEndLoc; + this.expect(11); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let arrowNode = this.startNodeAt(startLoc); + if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { + this.checkDestructuringPrivate(refExpressionErrors); + this.expressionScope.validateAsPattern(); + this.expressionScope.exit(); + this.parseArrowExpression(arrowNode, exprList, false); + return arrowNode; + } + this.expressionScope.exit(); + if (!exprList.length) { + this.unexpected(this.state.lastTokStartLoc); + } + if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); + if (spreadStartLoc) this.unexpected(spreadStartLoc); + this.checkExpressionErrors(refExpressionErrors, true); + this.toReferencedListDeep(exprList, true); + if (exprList.length > 1) { + val = this.startNodeAt(innerStartLoc); + val.expressions = exprList; + this.finishNode(val, "SequenceExpression"); + this.resetEndLocation(val, innerEndLoc); + } else { + val = exprList[0]; + } + return this.wrapParenthesis(startLoc, val); + } + wrapParenthesis(startLoc, expression) { + if (!(this.optionFlags & 1024)) { + this.addExtra(expression, "parenthesized", true); + this.addExtra(expression, "parenStart", startLoc.index); + this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); + return expression; + } + const parenExpression = this.startNodeAt(startLoc); + parenExpression.expression = expression; + return this.finishNode(parenExpression, "ParenthesizedExpression"); + } + shouldParseArrow(params) { + return !this.canInsertSemicolon(); + } + parseArrow(node) { + if (this.eat(19)) { + return node; + } + } + parseParenItem(node, startLoc) { + return node; + } + parseNewOrNewTarget() { + const node = this.startNode(); + this.next(); + if (this.match(16)) { + const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); + this.next(); + const metaProp = this.parseMetaProperty(node, meta, "target"); + if (!this.scope.allowNewTarget) { + this.raise(Errors.UnexpectedNewTarget, metaProp); + } + return metaProp; + } + return this.parseNew(node); + } + parseNew(node) { + this.parseNewCallee(node); + if (this.eat(10)) { + const args = this.parseExprList(11); + this.toReferencedList(args); + node.arguments = args; + } else { + node.arguments = []; + } + return this.finishNode(node, "NewExpression"); + } + parseNewCallee(node) { + const isImport = this.match(83); + const callee = this.parseNoCallExpr(); + node.callee = callee; + if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) { + this.raise(Errors.ImportCallNotNewExpression, callee); + } + } + parseTemplateElement(isTagged) { + const { + start, + startLoc, + end, + value + } = this.state; + const elemStart = start + 1; + const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); + if (value === null) { + if (!isTagged) { + this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)); + } + } + const isTail = this.match(24); + const endOffset = isTail ? -1 : -2; + const elemEnd = end + endOffset; + elem.value = { + raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), + cooked: value === null ? null : value.slice(1, endOffset) + }; + elem.tail = isTail; + this.next(); + const finishedNode = this.finishNode(elem, "TemplateElement"); + this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); + return finishedNode; + } + parseTemplate(isTagged) { + const node = this.startNode(); + let curElt = this.parseTemplateElement(isTagged); + const quasis = [curElt]; + const substitutions = []; + while (!curElt.tail) { + substitutions.push(this.parseTemplateSubstitution()); + this.readTemplateContinuation(); + quasis.push(curElt = this.parseTemplateElement(isTagged)); + } + node.expressions = substitutions; + node.quasis = quasis; + return this.finishNode(node, "TemplateLiteral"); + } + parseTemplateSubstitution() { + return this.parseExpression(); + } + parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { + if (isRecord) { + this.expectPlugin("recordAndTuple"); + } + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + let sawProto = false; + let first = true; + const node = this.startNode(); + node.properties = []; + this.next(); + while (!this.match(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + this.addTrailingCommaExtraToNode(node); + break; + } + } + let prop; + if (isPattern) { + prop = this.parseBindingProperty(); + } else { + prop = this.parsePropertyDefinition(refExpressionErrors); + sawProto = this.checkProto(prop, isRecord, sawProto, refExpressionErrors); + } + if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { + this.raise(Errors.InvalidRecordProperty, prop); + } + { + if (prop.shorthand) { + this.addExtra(prop, "shorthand", true); + } + } + node.properties.push(prop); + } + this.next(); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + let type = "ObjectExpression"; + if (isPattern) { + type = "ObjectPattern"; + } else if (isRecord) { + type = "RecordExpression"; + } + return this.finishNode(node, type); + } + addTrailingCommaExtraToNode(node) { + this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index); + this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); + } + maybeAsyncOrAccessorProp(prop) { + return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); + } + parsePropertyDefinition(refExpressionErrors) { + let decorators = []; + if (this.match(26)) { + if (this.hasPlugin("decorators")) { + this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc); + } + while (this.match(26)) { + decorators.push(this.parseDecorator()); + } + } + const prop = this.startNode(); + let isAsync = false; + let isAccessor = false; + let startLoc; + if (this.match(21)) { + if (decorators.length) this.unexpected(); + return this.parseSpread(); + } + if (decorators.length) { + prop.decorators = decorators; + decorators = []; + } + prop.method = false; + if (refExpressionErrors) { + startLoc = this.state.startLoc; + } + let isGenerator = this.eat(55); + this.parsePropertyNamePrefixOperator(prop); + const containsEsc = this.state.containsEsc; + this.parsePropertyName(prop, refExpressionErrors); + if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { + const { + key + } = prop; + const keyName = key.name; + if (keyName === "async" && !this.hasPrecedingLineBreak()) { + isAsync = true; + this.resetPreviousNodeTrailingComments(key); + isGenerator = this.eat(55); + this.parsePropertyName(prop); + } + if (keyName === "get" || keyName === "set") { + isAccessor = true; + this.resetPreviousNodeTrailingComments(key); + prop.kind = keyName; + if (this.match(55)) { + isGenerator = true; + this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), { + kind: keyName + }); + this.next(); + } + this.parsePropertyName(prop); + } + } + return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); + } + getGetterSetterExpectedParamCount(method) { + return method.kind === "get" ? 0 : 1; + } + getObjectOrClassMethodParams(method) { + return method.params; + } + checkGetterSetterParams(method) { + var _params; + const paramCount = this.getGetterSetterExpectedParamCount(method); + const params = this.getObjectOrClassMethodParams(method); + if (params.length !== paramCount) { + this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method); + } + if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { + this.raise(Errors.BadSetterRestParameter, method); + } + } + parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { + if (isAccessor) { + const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); + this.checkGetterSetterParams(finishedProp); + return finishedProp; + } + if (isAsync || isGenerator || this.match(10)) { + if (isPattern) this.unexpected(); + prop.kind = "method"; + prop.method = true; + return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); + } + } + parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { + prop.shorthand = false; + if (this.eat(14)) { + prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowInOrVoidPattern(8, refExpressionErrors); + return this.finishObjectProperty(prop); + } + if (!prop.computed && prop.key.type === "Identifier") { + this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); + if (isPattern) { + prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key)); + } else if (this.match(29)) { + const shorthandAssignLoc = this.state.startLoc; + if (refExpressionErrors != null) { + if (refExpressionErrors.shorthandAssignLoc === null) { + refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; + } + } else { + this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); + } + prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key)); + } else { + prop.value = this.cloneIdentifier(prop.key); + } + prop.shorthand = true; + return this.finishObjectProperty(prop); + } + } + finishObjectProperty(node) { + return this.finishNode(node, "ObjectProperty"); + } + parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { + const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); + if (!node) this.unexpected(); + return node; + } + parsePropertyName(prop, refExpressionErrors) { + if (this.eat(0)) { + prop.computed = true; + prop.key = this.parseMaybeAssignAllowIn(); + this.expect(3); + } else { + const { + type, + value + } = this.state; + let key; + if (tokenIsKeywordOrIdentifier(type)) { + key = this.parseIdentifier(true); + } else { + switch (type) { + case 135: + key = this.parseNumericLiteral(value); + break; + case 134: + key = this.parseStringLiteral(value); + break; + case 136: + key = this.parseBigIntLiteral(value); + break; + case 139: + { + const privateKeyLoc = this.state.startLoc; + if (refExpressionErrors != null) { + if (refExpressionErrors.privateKeyLoc === null) { + refExpressionErrors.privateKeyLoc = privateKeyLoc; + } + } else { + this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); + } + key = this.parsePrivateName(); + break; + } + default: + if (type === 137) { + key = this.parseDecimalLiteral(value); + break; + } + this.unexpected(); + } + } + prop.key = key; + if (type !== 139) { + prop.computed = false; + } + } + } + initFunction(node, isAsync) { + node.id = null; + node.generator = false; + node.async = isAsync; + } + parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { + this.initFunction(node, isAsync); + node.generator = isGenerator; + this.scope.enter(514 | 16 | (inClassScope ? 576 : 0) | (allowDirectSuper ? 32 : 0)); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + this.parseFunctionParams(node, isConstructor); + const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); + this.prodParam.exit(); + this.scope.exit(); + return finishedNode; + } + parseArrayLike(close, isTuple, refExpressionErrors) { + if (isTuple) { + this.expectPlugin("recordAndTuple"); + } + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = false; + const node = this.startNode(); + this.next(); + node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); + } + parseArrowExpression(node, params, isAsync, trailingCommaLoc) { + this.scope.enter(514 | 4); + let flags = functionFlags(isAsync, false); + if (!this.match(5) && this.prodParam.hasIn) { + flags |= 8; + } + this.prodParam.enter(flags); + this.initFunction(node, isAsync); + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + if (params) { + this.state.maybeInArrowParameters = true; + this.setArrowFunctionParameters(node, params, trailingCommaLoc); + } + this.state.maybeInArrowParameters = false; + this.parseFunctionBody(node, true); + this.prodParam.exit(); + this.scope.exit(); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return this.finishNode(node, "ArrowFunctionExpression"); + } + setArrowFunctionParameters(node, params, trailingCommaLoc) { + this.toAssignableList(params, trailingCommaLoc, false); + node.params = params; + } + parseFunctionBodyAndFinish(node, type, isMethod = false) { + this.parseFunctionBody(node, false, isMethod); + return this.finishNode(node, type); + } + parseFunctionBody(node, allowExpression, isMethod = false) { + const isExpression = allowExpression && !this.match(5); + this.expressionScope.enter(newExpressionScope()); + if (isExpression) { + node.body = this.parseMaybeAssign(); + this.checkParams(node, false, allowExpression, false); + } else { + const oldStrict = this.state.strict; + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(this.prodParam.currentFlags() | 4); + node.body = this.parseBlock(true, false, hasStrictModeDirective => { + const nonSimple = !this.isSimpleParamList(node.params); + if (hasStrictModeDirective && nonSimple) { + this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node); + } + const strictModeChanged = !oldStrict && this.state.strict; + this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); + if (this.state.strict && node.id) { + this.checkIdentifier(node.id, 65, strictModeChanged); + } + }); + this.prodParam.exit(); + this.state.labels = oldLabels; + } + this.expressionScope.exit(); + } + isSimpleParameter(node) { + return node.type === "Identifier"; + } + isSimpleParamList(params) { + for (let i = 0, len = params.length; i < len; i++) { + if (!this.isSimpleParameter(params[i])) return false; + } + return true; + } + checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { + const checkClashes = !allowDuplicates && new Set(); + const formalParameters = { + type: "FormalParameters" + }; + for (const param of node.params) { + this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged); + } + } + parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { + const elts = []; + let first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.match(close)) { + if (nodeForExtra) { + this.addTrailingCommaExtraToNode(nodeForExtra); + } + this.next(); + break; + } + } + elts.push(this.parseExprListItem(close, allowEmpty, refExpressionErrors)); + } + return elts; + } + parseExprListItem(close, allowEmpty, refExpressionErrors, allowPlaceholder) { + let elt; + if (this.match(12)) { + if (!allowEmpty) { + this.raise(Errors.UnexpectedToken, this.state.curPosition(), { + unexpected: "," + }); + } + elt = null; + } else if (this.match(21)) { + const spreadNodeStartLoc = this.state.startLoc; + elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); + } else if (this.match(17)) { + this.expectPlugin("partialApplication"); + if (!allowPlaceholder) { + this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc); + } + const node = this.startNode(); + this.next(); + elt = this.finishNode(node, "ArgumentPlaceholder"); + } else { + elt = this.parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, this.parseParenItem); + } + return elt; + } + parseIdentifier(liberal) { + const node = this.startNode(); + const name = this.parseIdentifierName(liberal); + return this.createIdentifier(node, name); + } + createIdentifier(node, name) { + node.name = name; + node.loc.identifierName = name; + return this.finishNode(node, "Identifier"); + } + createIdentifierAt(node, name, endLoc) { + node.name = name; + node.loc.identifierName = name; + return this.finishNodeAt(node, "Identifier", endLoc); + } + parseIdentifierName(liberal) { + let name; + const { + startLoc, + type + } = this.state; + if (tokenIsKeywordOrIdentifier(type)) { + name = this.state.value; + } else { + this.unexpected(); + } + const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); + if (liberal) { + if (tokenIsKeyword) { + this.replaceToken(132); + } + } else { + this.checkReservedWord(name, startLoc, tokenIsKeyword, false); + } + this.next(); + return name; + } + checkReservedWord(word, startLoc, checkKeywords, isBinding) { + if (word.length > 10) { + return; + } + if (!canBeReservedWord(word)) { + return; + } + if (checkKeywords && isKeyword(word)) { + this.raise(Errors.UnexpectedKeyword, startLoc, { + keyword: word + }); + return; + } + const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; + if (reservedTest(word, this.inModule)) { + this.raise(Errors.UnexpectedReservedWord, startLoc, { + reservedWord: word + }); + return; + } else if (word === "yield") { + if (this.prodParam.hasYield) { + this.raise(Errors.YieldBindingIdentifier, startLoc); + return; + } + } else if (word === "await") { + if (this.prodParam.hasAwait) { + this.raise(Errors.AwaitBindingIdentifier, startLoc); + return; + } + if (this.scope.inStaticBlock) { + this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc); + return; + } + this.expressionScope.recordAsyncArrowParametersError(startLoc); + } else if (word === "arguments") { + if (this.scope.inClassAndNotInNonArrowFunction) { + this.raise(Errors.ArgumentsInClass, startLoc); + return; + } + } + } + recordAwaitIfAllowed() { + const isAwaitAllowed = this.prodParam.hasAwait; + if (isAwaitAllowed && !this.scope.inFunction) { + this.state.hasTopLevelAwait = true; + } + return isAwaitAllowed; + } + parseAwait(startLoc) { + const node = this.startNodeAt(startLoc); + this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node); + if (this.eat(55)) { + this.raise(Errors.ObsoleteAwaitStar, node); + } + if (!this.scope.inFunction && !(this.optionFlags & 1)) { + if (this.isAmbiguousPrefixOrIdentifier()) { + this.ambiguousScriptDifferentAst = true; + } else { + this.sawUnambiguousESM = true; + } + } + if (!this.state.soloAwait) { + node.argument = this.parseMaybeUnary(null, true); + } + return this.finishNode(node, "AwaitExpression"); + } + isAmbiguousPrefixOrIdentifier() { + if (this.hasPrecedingLineBreak()) return true; + const { + type + } = this.state; + return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; + } + parseYield(startLoc) { + const node = this.startNodeAt(startLoc); + this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node); + let delegating = false; + let argument = null; + if (!this.hasPrecedingLineBreak()) { + delegating = this.eat(55); + switch (this.state.type) { + case 13: + case 140: + case 8: + case 11: + case 3: + case 9: + case 14: + case 12: + if (!delegating) break; + default: + argument = this.parseMaybeAssign(); + } + } + node.delegate = delegating; + node.argument = argument; + return this.finishNode(node, "YieldExpression"); + } + parseImportCall(node) { + this.next(); + node.source = this.parseMaybeAssignAllowIn(); + node.options = null; + if (this.eat(12)) { + if (!this.match(11)) { + node.options = this.parseMaybeAssignAllowIn(); + if (this.eat(12)) { + this.addTrailingCommaExtraToNode(node.options); + if (!this.match(11)) { + do { + this.parseMaybeAssignAllowIn(); + } while (this.eat(12) && !this.match(11)); + this.raise(Errors.ImportCallArity, node); + } + } + } else { + this.addTrailingCommaExtraToNode(node.source); + } + } + this.expect(11); + return this.finishNode(node, "ImportExpression"); + } + checkPipelineAtInfixOperator(left, leftStartLoc) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + if (left.type === "SequenceExpression") { + this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc); + } + } + } + parseSmartPipelineBodyInStyle(childExpr, startLoc) { + if (this.isSimpleReference(childExpr)) { + const bodyNode = this.startNodeAt(startLoc); + bodyNode.callee = childExpr; + return this.finishNode(bodyNode, "PipelineBareFunction"); + } else { + const bodyNode = this.startNodeAt(startLoc); + this.checkSmartPipeTopicBodyEarlyErrors(startLoc); + bodyNode.expression = childExpr; + return this.finishNode(bodyNode, "PipelineTopicExpression"); + } + } + isSimpleReference(expression) { + switch (expression.type) { + case "MemberExpression": + return !expression.computed && this.isSimpleReference(expression.object); + case "Identifier": + return true; + default: + return false; + } + } + checkSmartPipeTopicBodyEarlyErrors(startLoc) { + if (this.match(19)) { + throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc); + } + if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(Errors.PipelineTopicUnused, startLoc); + } + } + withTopicBindingContext(callback) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 1, + maxTopicIndex: null + }; + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } + withSmartMixTopicForbiddingContext(callback) { + if (this.hasPlugin(["pipelineOperator", { + proposal: "smart" + }])) { + const outerContextTopicState = this.state.topicContext; + this.state.topicContext = { + maxNumOfResolvableTopics: 0, + maxTopicIndex: null + }; + try { + return callback(); + } finally { + this.state.topicContext = outerContextTopicState; + } + } else { + return callback(); + } + } + withSoloAwaitPermittingContext(callback) { + const outerContextSoloAwaitState = this.state.soloAwait; + this.state.soloAwait = true; + try { + return callback(); + } finally { + this.state.soloAwait = outerContextSoloAwaitState; + } + } + allowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToSet = 8 & ~flags; + if (prodParamToSet) { + this.prodParam.enter(flags | 8); + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + return callback(); + } + disallowInAnd(callback) { + const flags = this.prodParam.currentFlags(); + const prodParamToClear = 8 & flags; + if (prodParamToClear) { + this.prodParam.enter(flags & ~8); + try { + return callback(); + } finally { + this.prodParam.exit(); + } + } + return callback(); + } + registerTopicReference() { + this.state.topicContext.maxTopicIndex = 0; + } + topicReferenceIsAllowedInCurrentContext() { + return this.state.topicContext.maxNumOfResolvableTopics >= 1; + } + topicReferenceWasUsedInCurrentContext() { + return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; + } + parseFSharpPipelineBody(prec) { + const startLoc = this.state.startLoc; + this.state.potentialArrowAt = this.state.start; + const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; + this.state.inFSharpPipelineDirectBody = true; + const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); + this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; + return ret; + } + parseModuleExpression() { + this.expectPlugin("moduleBlocks"); + const node = this.startNode(); + this.next(); + if (!this.match(5)) { + this.unexpected(null, 5); + } + const program = this.startNodeAt(this.state.endLoc); + this.next(); + const revertScopes = this.initializeScopes(true); + this.enterInitialScopes(); + try { + node.body = this.parseProgram(program, 8, "module"); + } finally { + revertScopes(); + } + return this.finishNode(node, "ModuleExpression"); + } + parseVoidPattern(refExpressionErrors) { + this.expectPlugin("discardBinding"); + const node = this.startNode(); + if (refExpressionErrors != null) { + refExpressionErrors.voidPatternLoc = this.state.startLoc; + } + this.next(); + return this.finishNode(node, "VoidPattern"); + } + parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, afterLeftParse) { + if (refExpressionErrors != null && this.match(88)) { + const nextCode = this.lookaheadCharCode(); + if (nextCode === 44 || nextCode === (close === 3 ? 93 : close === 8 ? 125 : 41) || nextCode === 61) { + return this.parseMaybeDefault(this.state.startLoc, this.parseVoidPattern(refExpressionErrors)); + } + } + return this.parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse); + } + parsePropertyNamePrefixOperator(prop) {} +} +const loopLabel = { + kind: 1 + }, + switchLabel = { + kind: 2 + }; +const loneSurrogate = /[\uD800-\uDFFF]/u; +const keywordRelationalOperator = /in(?:stanceof)?/y; +function babel7CompatTokens(tokens, input, startIndex) { + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + const { + type + } = token; + if (typeof type === "number") { + { + if (type === 139) { + const { + loc, + start, + value, + end + } = token; + const hashEndPos = start + 1; + const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); + tokens.splice(i, 1, new Token({ + type: getExportedToken(27), + value: "#", + start: start, + end: hashEndPos, + startLoc: loc.start, + endLoc: hashEndLoc + }), new Token({ + type: getExportedToken(132), + value: value, + start: hashEndPos, + end: end, + startLoc: hashEndLoc, + endLoc: loc.end + })); + i++; + continue; + } + if (tokenIsTemplate(type)) { + const { + loc, + start, + value, + end + } = token; + const backquoteEnd = start + 1; + const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); + let startToken; + if (input.charCodeAt(start - startIndex) === 96) { + startToken = new Token({ + type: getExportedToken(22), + value: "`", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } else { + startToken = new Token({ + type: getExportedToken(8), + value: "}", + start: start, + end: backquoteEnd, + startLoc: loc.start, + endLoc: backquoteEndLoc + }); + } + let templateValue, templateElementEnd, templateElementEndLoc, endToken; + if (type === 24) { + templateElementEnd = end - 1; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); + templateValue = value === null ? null : value.slice(1, -1); + endToken = new Token({ + type: getExportedToken(22), + value: "`", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } else { + templateElementEnd = end - 2; + templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); + templateValue = value === null ? null : value.slice(1, -2); + endToken = new Token({ + type: getExportedToken(23), + value: "${", + start: templateElementEnd, + end: end, + startLoc: templateElementEndLoc, + endLoc: loc.end + }); + } + tokens.splice(i, 1, startToken, new Token({ + type: getExportedToken(20), + value: templateValue, + start: backquoteEnd, + end: templateElementEnd, + startLoc: backquoteEndLoc, + endLoc: templateElementEndLoc + }), endToken); + i += 2; + continue; + } + } + token.type = getExportedToken(type); + } + } + return tokens; +} +class StatementParser extends ExpressionParser { + parseTopLevel(file, program) { + file.program = this.parseProgram(program, 140, this.options.sourceType === "module" ? "module" : "script"); + file.comments = this.comments; + if (this.optionFlags & 256) { + file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex); + } + return this.finishNode(file, "File"); + } + parseProgram(program, end, sourceType) { + program.sourceType = sourceType; + program.interpreter = this.parseInterpreterDirective(); + this.parseBlockBody(program, true, true, end); + if (this.inModule) { + if (!(this.optionFlags & 64) && this.scope.undefinedExports.size > 0) { + for (const [localName, at] of Array.from(this.scope.undefinedExports)) { + this.raise(Errors.ModuleExportUndefined, at, { + localName + }); + } + } + this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait); + } + let finishedProgram; + if (end === 140) { + finishedProgram = this.finishNode(program, "Program"); + } else { + finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); + } + return finishedProgram; + } + stmtToDirective(stmt) { + const directive = this.castNodeTo(stmt, "Directive"); + const directiveLiteral = this.castNodeTo(stmt.expression, "DirectiveLiteral"); + const expressionValue = directiveLiteral.value; + const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)); + const val = directiveLiteral.value = raw.slice(1, -1); + this.addExtra(directiveLiteral, "raw", raw); + this.addExtra(directiveLiteral, "rawValue", val); + this.addExtra(directiveLiteral, "expressionValue", expressionValue); + directive.value = directiveLiteral; + delete stmt.expression; + return directive; + } + parseInterpreterDirective() { + if (!this.match(28)) { + return null; + } + const node = this.startNode(); + node.value = this.state.value; + this.next(); + return this.finishNode(node, "InterpreterDirective"); + } + isLet() { + if (!this.isContextual(100)) { + return false; + } + return this.hasFollowingBindingAtom(); + } + isUsing() { + if (!this.isContextual(107)) { + return false; + } + return this.nextTokenIsIdentifierOnSameLine(); + } + isForUsing() { + if (!this.isContextual(107)) { + return false; + } + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + if (this.isUnparsedContextual(next, "of")) { + const nextCharAfterOf = this.lookaheadCharCodeSince(next + 2); + if (nextCharAfterOf !== 61 && nextCharAfterOf !== 58 && nextCharAfterOf !== 59) { + return false; + } + } + if (this.chStartsBindingIdentifier(nextCh, next) || this.isUnparsedContextual(next, "void")) { + return true; + } + return false; + } + nextTokenIsIdentifierOnSameLine() { + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + return this.chStartsBindingIdentifier(nextCh, next); + } + isAwaitUsing() { + if (!this.isContextual(96)) { + return false; + } + let next = this.nextTokenInLineStart(); + if (this.isUnparsedContextual(next, "using")) { + next = this.nextTokenInLineStartSince(next + 5); + const nextCh = this.codePointAtPos(next); + if (this.chStartsBindingIdentifier(nextCh, next)) { + return true; + } + } + return false; + } + chStartsBindingIdentifier(ch, pos) { + if (isIdentifierStart(ch)) { + keywordRelationalOperator.lastIndex = pos; + if (keywordRelationalOperator.test(this.input)) { + const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); + if (!isIdentifierChar(endCh) && endCh !== 92) { + return false; + } + } + return true; + } else if (ch === 92) { + return true; + } else { + return false; + } + } + chStartsBindingPattern(ch) { + return ch === 91 || ch === 123; + } + hasFollowingBindingAtom() { + const next = this.nextTokenStart(); + const nextCh = this.codePointAtPos(next); + return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); + } + hasInLineFollowingBindingIdentifierOrBrace() { + const next = this.nextTokenInLineStart(); + const nextCh = this.codePointAtPos(next); + return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next); + } + allowsUsing() { + return (this.scope.inModule || !this.scope.inTopLevel) && !this.scope.inBareCaseStatement; + } + parseModuleItem() { + return this.parseStatementLike(1 | 2 | 4 | 8); + } + parseStatementListItem() { + return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8)); + } + parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) { + let flags = 0; + if (this.options.annexB && !this.state.strict) { + flags |= 4; + if (allowLabeledFunction) { + flags |= 8; + } + } + return this.parseStatementLike(flags); + } + parseStatement() { + return this.parseStatementLike(0); + } + parseStatementLike(flags) { + let decorators = null; + if (this.match(26)) { + decorators = this.parseDecorators(true); + } + return this.parseStatementContent(flags, decorators); + } + parseStatementContent(flags, decorators) { + const startType = this.state.type; + const node = this.startNode(); + const allowDeclaration = !!(flags & 2); + const allowFunctionDeclaration = !!(flags & 4); + const topLevel = flags & 1; + switch (startType) { + case 60: + return this.parseBreakContinueStatement(node, true); + case 63: + return this.parseBreakContinueStatement(node, false); + case 64: + return this.parseDebuggerStatement(node); + case 90: + return this.parseDoWhileStatement(node); + case 91: + return this.parseForStatement(node); + case 68: + if (this.lookaheadCharCode() === 46) break; + if (!allowFunctionDeclaration) { + this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc); + } + return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); + case 80: + if (!allowDeclaration) this.unexpected(); + return this.parseClass(this.maybeTakeDecorators(decorators, node), true); + case 69: + return this.parseIfStatement(node); + case 70: + return this.parseReturnStatement(node); + case 71: + return this.parseSwitchStatement(node); + case 72: + return this.parseThrowStatement(node); + case 73: + return this.parseTryStatement(node); + case 96: + if (this.isAwaitUsing()) { + if (!this.allowsUsing()) { + this.raise(Errors.UnexpectedUsingDeclaration, node); + } else if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, node); + } else if (!this.recordAwaitIfAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, node); + } + this.next(); + return this.parseVarStatement(node, "await using"); + } + break; + case 107: + if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) { + break; + } + if (!this.allowsUsing()) { + this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc); + } else if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); + } + return this.parseVarStatement(node, "using"); + case 100: + { + if (this.state.containsEsc) { + break; + } + const next = this.nextTokenStart(); + const nextCh = this.codePointAtPos(next); + if (nextCh !== 91) { + if (!allowDeclaration && this.hasFollowingLineBreak()) break; + if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) { + break; + } + } + } + case 75: + { + if (!allowDeclaration) { + this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); + } + } + case 74: + { + const kind = this.state.value; + return this.parseVarStatement(node, kind); + } + case 92: + return this.parseWhileStatement(node); + case 76: + return this.parseWithStatement(node); + case 5: + return this.parseBlock(); + case 13: + return this.parseEmptyStatement(node); + case 83: + { + const nextTokenCharCode = this.lookaheadCharCode(); + if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { + break; + } + } + case 82: + { + if (!(this.optionFlags & 8) && !topLevel) { + this.raise(Errors.UnexpectedImportExport, this.state.startLoc); + } + this.next(); + let result; + if (startType === 83) { + result = this.parseImport(node); + } else { + result = this.parseExport(node, decorators); + } + this.assertModuleNodeAllowed(result); + return result; + } + default: + { + if (this.isAsyncFunction()) { + if (!allowDeclaration) { + this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc); + } + this.next(); + return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); + } + } + } + const maybeName = this.state.value; + const expr = this.parseExpression(); + if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) { + return this.parseLabeledStatement(node, maybeName, expr, flags); + } else { + return this.parseExpressionStatement(node, expr, decorators); + } + } + assertModuleNodeAllowed(node) { + if (!(this.optionFlags & 8) && !this.inModule) { + this.raise(Errors.ImportOutsideModule, node); + } + } + decoratorsEnabledBeforeExport() { + if (this.hasPlugin("decorators-legacy")) return true; + return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false; + } + maybeTakeDecorators(maybeDecorators, classNode, exportNode) { + if (maybeDecorators) { + var _classNode$decorators; + if ((_classNode$decorators = classNode.decorators) != null && _classNode$decorators.length) { + if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { + this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]); + } + classNode.decorators.unshift(...maybeDecorators); + } else { + classNode.decorators = maybeDecorators; + } + this.resetStartLocationFromNode(classNode, maybeDecorators[0]); + if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); + } + return classNode; + } + canHaveLeadingDecorator() { + return this.match(80); + } + parseDecorators(allowExport) { + const decorators = []; + do { + decorators.push(this.parseDecorator()); + } while (this.match(26)); + if (this.match(82)) { + if (!allowExport) { + this.unexpected(); + } + if (!this.decoratorsEnabledBeforeExport()) { + this.raise(Errors.DecoratorExportClass, this.state.startLoc); + } + } else if (!this.canHaveLeadingDecorator()) { + throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc); + } + return decorators; + } + parseDecorator() { + this.expectOnePlugin(["decorators", "decorators-legacy"]); + const node = this.startNode(); + this.next(); + if (this.hasPlugin("decorators")) { + const startLoc = this.state.startLoc; + let expr; + if (this.match(10)) { + const startLoc = this.state.startLoc; + this.next(); + expr = this.parseExpression(); + this.expect(11); + expr = this.wrapParenthesis(startLoc, expr); + const paramsStartLoc = this.state.startLoc; + node.expression = this.parseMaybeDecoratorArguments(expr, startLoc); + if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { + this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc); + } + } else { + expr = this.parseIdentifier(false); + while (this.eat(16)) { + const node = this.startNodeAt(startLoc); + node.object = expr; + if (this.match(139)) { + this.classScope.usePrivateName(this.state.value, this.state.startLoc); + node.property = this.parsePrivateName(); + } else { + node.property = this.parseIdentifier(true); + } + node.computed = false; + expr = this.finishNode(node, "MemberExpression"); + } + node.expression = this.parseMaybeDecoratorArguments(expr, startLoc); + } + } else { + node.expression = this.parseExprSubscripts(); + } + return this.finishNode(node, "Decorator"); + } + parseMaybeDecoratorArguments(expr, startLoc) { + if (this.eat(10)) { + const node = this.startNodeAt(startLoc); + node.callee = expr; + node.arguments = this.parseCallExpressionArguments(); + this.toReferencedList(node.arguments); + return this.finishNode(node, "CallExpression"); + } + return expr; + } + parseBreakContinueStatement(node, isBreak) { + this.next(); + if (this.isLineTerminator()) { + node.label = null; + } else { + node.label = this.parseIdentifier(); + this.semicolon(); + } + this.verifyBreakContinue(node, isBreak); + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); + } + verifyBreakContinue(node, isBreak) { + let i; + for (i = 0; i < this.state.labels.length; ++i) { + const lab = this.state.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === 1)) { + break; + } + if (node.label && isBreak) break; + } + } + if (i === this.state.labels.length) { + const type = isBreak ? "BreakStatement" : "ContinueStatement"; + this.raise(Errors.IllegalBreakContinue, node, { + type + }); + } + } + parseDebuggerStatement(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); + } + parseHeaderExpression() { + this.expect(10); + const val = this.parseExpression(); + this.expect(11); + return val; + } + parseDoWhileStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.state.labels.pop(); + this.expect(92); + node.test = this.parseHeaderExpression(); + this.eat(13); + return this.finishNode(node, "DoWhileStatement"); + } + parseForStatement(node) { + this.next(); + this.state.labels.push(loopLabel); + let awaitAt = null; + if (this.isContextual(96) && this.recordAwaitIfAllowed()) { + awaitAt = this.state.startLoc; + this.next(); + } + this.scope.enter(0); + this.expect(10); + if (this.match(13)) { + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, null); + } + const startsWithLet = this.isContextual(100); + { + const startsWithAwaitUsing = this.isAwaitUsing(); + const starsWithUsingDeclaration = startsWithAwaitUsing || this.isForUsing(); + const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; + if (this.match(74) || this.match(75) || isLetOrUsing) { + const initNode = this.startNode(); + let kind; + if (startsWithAwaitUsing) { + kind = "await using"; + if (!this.recordAwaitIfAllowed()) { + this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc); + } + this.next(); + } else { + kind = this.state.value; + } + this.next(); + this.parseVar(initNode, true, kind); + const init = this.finishNode(initNode, "VariableDeclaration"); + const isForIn = this.match(58); + if (isForIn && starsWithUsingDeclaration) { + this.raise(Errors.ForInUsing, init); + } + if ((isForIn || this.isContextual(102)) && init.declarations.length === 1) { + return this.parseForIn(node, init, awaitAt); + } + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + } + } + const startsWithAsync = this.isContextual(95); + const refExpressionErrors = new ExpressionErrors(); + const init = this.parseExpression(true, refExpressionErrors); + const isForOf = this.isContextual(102); + if (isForOf) { + if (startsWithLet) { + this.raise(Errors.ForOfLet, init); + } + if (awaitAt === null && startsWithAsync && init.type === "Identifier") { + this.raise(Errors.ForOfAsync, init); + } + } + if (isForOf || this.match(58)) { + this.checkDestructuringPrivate(refExpressionErrors); + this.toAssignable(init, true); + const type = isForOf ? "ForOfStatement" : "ForInStatement"; + this.checkLVal(init, { + type + }); + return this.parseForIn(node, init, awaitAt); + } else { + this.checkExpressionErrors(refExpressionErrors, true); + } + if (awaitAt !== null) { + this.unexpected(awaitAt); + } + return this.parseFor(node, init); + } + parseFunctionStatement(node, isAsync, isHangingDeclaration) { + this.next(); + return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0)); + } + parseIfStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(); + node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null; + return this.finishNode(node, "IfStatement"); + } + parseReturnStatement(node) { + if (!this.prodParam.hasReturn) { + this.raise(Errors.IllegalReturn, this.state.startLoc); + } + this.next(); + if (this.isLineTerminator()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); + } + parseSwitchStatement(node) { + this.next(); + node.discriminant = this.parseHeaderExpression(); + const cases = node.cases = []; + this.expect(5); + this.state.labels.push(switchLabel); + this.scope.enter(256); + let cur; + for (let sawDefault; !this.match(8);) { + if (this.match(61) || this.match(65)) { + const isCase = this.match(61); + if (cur) this.finishNode(cur, "SwitchCase"); + cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { + this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc); + } + sawDefault = true; + cur.test = null; + } + this.expect(14); + } else { + if (cur) { + cur.consequent.push(this.parseStatementListItem()); + } else { + this.unexpected(); + } + } + } + this.scope.exit(); + if (cur) this.finishNode(cur, "SwitchCase"); + this.next(); + this.state.labels.pop(); + return this.finishNode(node, "SwitchStatement"); + } + parseThrowStatement(node) { + this.next(); + if (this.hasPrecedingLineBreak()) { + this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc); + } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); + } + parseCatchClauseParam() { + const param = this.parseBindingAtom(); + this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0); + this.checkLVal(param, { + type: "CatchClause" + }, 9); + return param; + } + parseTryStatement(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.match(62)) { + const clause = this.startNode(); + this.next(); + if (this.match(10)) { + this.expect(10); + clause.param = this.parseCatchClauseParam(); + this.expect(11); + } else { + clause.param = null; + this.scope.enter(0); + } + clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); + this.scope.exit(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(67) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) { + this.raise(Errors.NoCatchOrFinally, node); + } + return this.finishNode(node, "TryStatement"); + } + parseVarStatement(node, kind, allowMissingInitializer = false) { + this.next(); + this.parseVar(node, false, kind, allowMissingInitializer); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); + } + parseWhileStatement(node) { + this.next(); + node.test = this.parseHeaderExpression(); + this.state.labels.push(loopLabel); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.state.labels.pop(); + return this.finishNode(node, "WhileStatement"); + } + parseWithStatement(node) { + if (this.state.strict) { + this.raise(Errors.StrictWith, this.state.startLoc); + } + this.next(); + node.object = this.parseHeaderExpression(); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + return this.finishNode(node, "WithStatement"); + } + parseEmptyStatement(node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); + } + parseLabeledStatement(node, maybeName, expr, flags) { + for (const label of this.state.labels) { + if (label.name === maybeName) { + this.raise(Errors.LabelRedeclaration, expr, { + labelName: maybeName + }); + } + } + const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null; + for (let i = this.state.labels.length - 1; i >= 0; i--) { + const label = this.state.labels[i]; + if (label.statementStart === node.start) { + label.statementStart = this.sourceToOffsetPos(this.state.start); + label.kind = kind; + } else { + break; + } + } + this.state.labels.push({ + name: maybeName, + kind: kind, + statementStart: this.sourceToOffsetPos(this.state.start) + }); + node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); + this.state.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); + } + parseExpressionStatement(node, expr, decorators) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); + } + parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { + const node = this.startNode(); + if (allowDirectives) { + this.state.strictErrors.clear(); + } + this.expect(5); + if (createNewLexicalScope) { + this.scope.enter(0); + } + this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); + if (createNewLexicalScope) { + this.scope.exit(); + } + return this.finishNode(node, "BlockStatement"); + } + isValidDirective(stmt) { + return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; + } + parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { + const body = node.body = []; + const directives = node.directives = []; + this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); + } + parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { + const oldStrict = this.state.strict; + let hasStrictModeDirective = false; + let parsedNonDirective = false; + while (!this.match(end)) { + const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem(); + if (directives && !parsedNonDirective) { + if (this.isValidDirective(stmt)) { + const directive = this.stmtToDirective(stmt); + directives.push(directive); + if (!hasStrictModeDirective && directive.value.value === "use strict") { + hasStrictModeDirective = true; + this.setStrict(true); + } + continue; + } + parsedNonDirective = true; + this.state.strictErrors.clear(); + } + body.push(stmt); + } + afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective); + if (!oldStrict) { + this.setStrict(false); + } + this.next(); + } + parseFor(node, init) { + node.init = init; + this.semicolon(false); + node.test = this.match(13) ? null : this.parseExpression(); + this.semicolon(false); + node.update = this.match(11) ? null : this.parseExpression(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, "ForStatement"); + } + parseForIn(node, init, awaitAt) { + const isForIn = this.match(58); + this.next(); + if (isForIn) { + if (awaitAt !== null) this.unexpected(awaitAt); + } else { + node.await = awaitAt !== null; + } + if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { + this.raise(Errors.ForInOfLoopInitializer, init, { + type: isForIn ? "ForInStatement" : "ForOfStatement" + }); + } + if (init.type === "AssignmentPattern") { + this.raise(Errors.InvalidLhs, init, { + ancestor: { + type: "ForStatement" + } + }); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); + this.expect(11); + node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); + this.scope.exit(); + this.state.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); + } + parseVar(node, isFor, kind, allowMissingInitializer = false) { + const declarations = node.declarations = []; + node.kind = kind; + for (;;) { + const decl = this.startNode(); + this.parseVarId(decl, kind); + decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); + if (decl.init === null && !allowMissingInitializer) { + if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { + kind: "destructuring" + }); + } else if ((kind === "const" || kind === "using" || kind === "await using") && !(this.match(58) || this.isContextual(102))) { + this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { + kind + }); + } + } + declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(12)) break; + } + return node; + } + parseVarId(decl, kind) { + const id = this.parseBindingAtom(); + if (kind === "using" || kind === "await using") { + if (id.type === "ArrayPattern" || id.type === "ObjectPattern") { + this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start); + } + } else { + if (id.type === "VoidPattern") { + this.raise(Errors.UnexpectedVoidPattern, id.loc.start); + } + } + this.checkLVal(id, { + type: "VariableDeclarator" + }, kind === "var" ? 5 : 8201); + decl.id = id; + } + parseAsyncFunctionExpression(node) { + return this.parseFunction(node, 8); + } + parseFunction(node, flags = 0) { + const hangingDeclaration = flags & 2; + const isDeclaration = !!(flags & 1); + const requireId = isDeclaration && !(flags & 4); + const isAsync = !!(flags & 8); + this.initFunction(node, isAsync); + if (this.match(55)) { + if (hangingDeclaration) { + this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc); + } + this.next(); + node.generator = true; + } + if (isDeclaration) { + node.id = this.parseFunctionId(requireId); + } + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + this.state.maybeInArrowParameters = false; + this.scope.enter(514); + this.prodParam.enter(functionFlags(isAsync, node.generator)); + if (!isDeclaration) { + node.id = this.parseFunctionId(); + } + this.parseFunctionParams(node, false); + this.withSmartMixTopicForbiddingContext(() => { + this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); + }); + this.prodParam.exit(); + this.scope.exit(); + if (isDeclaration && !hangingDeclaration) { + this.registerFunctionStatementId(node); + } + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + return node; + } + parseFunctionId(requireId) { + return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; + } + parseFunctionParams(node, isConstructor) { + this.expect(10); + this.expressionScope.enter(newParameterDeclarationScope()); + node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0)); + this.expressionScope.exit(); + } + registerFunctionStatementId(node) { + if (!node.id) return; + this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start); + } + parseClass(node, isStatement, optionalId) { + this.next(); + const oldStrict = this.state.strict; + this.state.strict = true; + this.parseClassId(node, isStatement, optionalId); + this.parseClassSuper(node); + node.body = this.parseClassBody(!!node.superClass, oldStrict); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); + } + isClassProperty() { + return this.match(29) || this.match(13) || this.match(8); + } + isClassMethod() { + return this.match(10); + } + nameIsConstructor(key) { + return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor"; + } + isNonstaticConstructor(method) { + return !method.computed && !method.static && this.nameIsConstructor(method.key); + } + parseClassBody(hadSuperClass, oldStrict) { + this.classScope.enter(); + const state = { + hadConstructor: false, + hadSuperClass + }; + let decorators = []; + const classBody = this.startNode(); + classBody.body = []; + this.expect(5); + this.withSmartMixTopicForbiddingContext(() => { + while (!this.match(8)) { + if (this.eat(13)) { + if (decorators.length > 0) { + throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc); + } + continue; + } + if (this.match(26)) { + decorators.push(this.parseDecorator()); + continue; + } + const member = this.startNode(); + if (decorators.length) { + member.decorators = decorators; + this.resetStartLocationFromNode(member, decorators[0]); + decorators = []; + } + this.parseClassMember(classBody, member, state); + if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { + this.raise(Errors.DecoratorConstructor, member); + } + } + }); + this.state.strict = oldStrict; + this.next(); + if (decorators.length) { + throw this.raise(Errors.TrailingDecorator, this.state.startLoc); + } + this.classScope.exit(); + return this.finishNode(classBody, "ClassBody"); + } + parseClassMemberFromModifier(classBody, member) { + const key = this.parseIdentifier(true); + if (this.isClassMethod()) { + const method = member; + method.kind = "method"; + method.computed = false; + method.key = key; + method.static = false; + this.pushClassMethod(classBody, method, false, false, false, false); + return true; + } else if (this.isClassProperty()) { + const prop = member; + prop.computed = false; + prop.key = key; + prop.static = false; + classBody.body.push(this.parseClassProperty(prop)); + return true; + } + this.resetPreviousNodeTrailingComments(key); + return false; + } + parseClassMember(classBody, member, state) { + const isStatic = this.isContextual(106); + if (isStatic) { + if (this.parseClassMemberFromModifier(classBody, member)) { + return; + } + if (this.eat(5)) { + this.parseClassStaticBlock(classBody, member); + return; + } + } + this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); + } + parseClassMemberWithIsStatic(classBody, member, state, isStatic) { + const publicMethod = member; + const privateMethod = member; + const publicProp = member; + const privateProp = member; + const accessorProp = member; + const method = publicMethod; + const publicMember = publicMethod; + member.static = isStatic; + this.parsePropertyNamePrefixOperator(member); + if (this.eat(55)) { + method.kind = "method"; + const isPrivateName = this.match(139); + this.parseClassElementName(method); + this.parsePostMemberNameModifiers(method); + if (isPrivateName) { + this.pushClassPrivateMethod(classBody, privateMethod, true, false); + return; + } + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsGenerator, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, true, false, false, false); + return; + } + const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type); + const key = this.parseClassElementName(member); + const maybeContextualKw = isContextual ? key.name : null; + const isPrivate = this.isPrivateName(key); + const maybeQuestionTokenStartLoc = this.state.startLoc; + this.parsePostMemberNameModifiers(publicMember); + if (this.isClassMethod()) { + method.kind = "method"; + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + return; + } + const isConstructor = this.isNonstaticConstructor(publicMethod); + let allowsDirectSuper = false; + if (isConstructor) { + publicMethod.kind = "constructor"; + if (state.hadConstructor && !this.hasPlugin("typescript")) { + this.raise(Errors.DuplicateConstructor, key); + } + if (isConstructor && this.hasPlugin("typescript") && member.override) { + this.raise(Errors.OverrideOnConstructor, key); + } + state.hadConstructor = true; + allowsDirectSuper = state.hadSuperClass; + } + this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); + } else if (this.isClassProperty()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else if (maybeContextualKw === "async" && !this.isLineTerminator()) { + this.resetPreviousNodeTrailingComments(key); + const isGenerator = this.eat(55); + if (publicMember.optional) { + this.unexpected(maybeQuestionTokenStartLoc); + } + method.kind = "method"; + const isPrivate = this.match(139); + this.parseClassElementName(method); + this.parsePostMemberNameModifiers(publicMember); + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAsync, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); + } + } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) { + this.resetPreviousNodeTrailingComments(key); + method.kind = maybeContextualKw; + const isPrivate = this.match(139); + this.parseClassElementName(publicMethod); + if (isPrivate) { + this.pushClassPrivateMethod(classBody, privateMethod, false, false); + } else { + if (this.isNonstaticConstructor(publicMethod)) { + this.raise(Errors.ConstructorIsAccessor, publicMethod.key); + } + this.pushClassMethod(classBody, publicMethod, false, false, false, false); + } + this.checkGetterSetterParams(publicMethod); + } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) { + this.expectPlugin("decoratorAutoAccessors"); + this.resetPreviousNodeTrailingComments(key); + const isPrivate = this.match(139); + this.parseClassElementName(publicProp); + this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); + } else if (this.isLineTerminator()) { + if (isPrivate) { + this.pushClassPrivateProperty(classBody, privateProp); + } else { + this.pushClassProperty(classBody, publicProp); + } + } else { + this.unexpected(); + } + } + parseClassElementName(member) { + const { + type, + value + } = this.state; + if ((type === 132 || type === 134) && member.static && value === "prototype") { + this.raise(Errors.StaticPrototype, this.state.startLoc); + } + if (type === 139) { + if (value === "constructor") { + this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); + } + const key = this.parsePrivateName(); + member.key = key; + return key; + } + this.parsePropertyName(member); + return member.key; + } + parseClassStaticBlock(classBody, member) { + var _member$decorators; + this.scope.enter(576 | 128 | 16); + const oldLabels = this.state.labels; + this.state.labels = []; + this.prodParam.enter(0); + const body = member.body = []; + this.parseBlockOrModuleBlockBody(body, undefined, false, 8); + this.prodParam.exit(); + this.scope.exit(); + this.state.labels = oldLabels; + classBody.body.push(this.finishNode(member, "StaticBlock")); + if ((_member$decorators = member.decorators) != null && _member$decorators.length) { + this.raise(Errors.DecoratorStaticBlock, member); + } + } + pushClassProperty(classBody, prop) { + if (!prop.computed && this.nameIsConstructor(prop.key)) { + this.raise(Errors.ConstructorClassField, prop.key); + } + classBody.body.push(this.parseClassProperty(prop)); + } + pushClassPrivateProperty(classBody, prop) { + const node = this.parseClassPrivateProperty(prop); + classBody.body.push(node); + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); + } + pushClassAccessorProperty(classBody, prop, isPrivate) { + if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) { + this.raise(Errors.ConstructorClassField, prop.key); + } + const node = this.parseClassAccessorProperty(prop); + classBody.body.push(node); + if (isPrivate) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); + } + } + pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { + classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); + } + pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { + const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); + classBody.body.push(node); + const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0; + this.declareClassPrivateMethodInScope(node, kind); + } + declareClassPrivateMethodInScope(node, kind) { + this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); + } + parsePostMemberNameModifiers(methodOrProp) {} + parseClassPrivateProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassPrivateProperty"); + } + parseClassProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassProperty"); + } + parseClassAccessorProperty(node) { + this.parseInitializer(node); + this.semicolon(); + return this.finishNode(node, "ClassAccessorProperty"); + } + parseInitializer(node) { + this.scope.enter(576 | 16); + this.expressionScope.enter(newExpressionScope()); + this.prodParam.enter(0); + node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; + this.expressionScope.exit(); + this.prodParam.exit(); + this.scope.exit(); + } + parseClassId(node, isStatement, optionalId, bindingType = 8331) { + if (tokenIsIdentifier(this.state.type)) { + node.id = this.parseIdentifier(); + if (isStatement) { + this.declareNameFromIdentifier(node.id, bindingType); + } + } else { + if (optionalId || !isStatement) { + node.id = null; + } else { + throw this.raise(Errors.MissingClassName, this.state.startLoc); + } + } + } + parseClassSuper(node) { + node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; + } + parseExport(node, decorators) { + const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); + const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); + const parseAfterDefault = !hasDefault || this.eat(12); + const hasStar = parseAfterDefault && this.eatExportStar(node); + const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); + const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); + const isFromRequired = hasDefault || hasStar; + if (hasStar && !hasNamespace) { + if (hasDefault) this.unexpected(); + if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.parseExportFrom(node, true); + this.sawUnambiguousESM = true; + return this.finishNode(node, "ExportAllDeclaration"); + } + const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); + if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) { + this.unexpected(null, 5); + } + if (hasNamespace && parseAfterNamespace) { + this.unexpected(null, 98); + } + let hasDeclaration; + if (isFromRequired || hasSpecifiers) { + hasDeclaration = false; + if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.parseExportFrom(node, isFromRequired); + } else { + hasDeclaration = this.maybeParseExportDeclaration(node); + } + if (isFromRequired || hasSpecifiers || hasDeclaration) { + var _node2$declaration; + const node2 = node; + this.checkExport(node2, true, false, !!node2.source); + if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { + this.maybeTakeDecorators(decorators, node2.declaration, node2); + } else if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.sawUnambiguousESM = true; + return this.finishNode(node2, "ExportNamedDeclaration"); + } + if (this.eat(65)) { + const node2 = node; + const decl = this.parseExportDefaultExpression(); + node2.declaration = decl; + if (decl.type === "ClassDeclaration") { + this.maybeTakeDecorators(decorators, decl, node2); + } else if (decorators) { + throw this.raise(Errors.UnsupportedDecoratorExport, node); + } + this.checkExport(node2, true, true); + this.sawUnambiguousESM = true; + return this.finishNode(node2, "ExportDefaultDeclaration"); + } + throw this.unexpected(null, 5); + } + eatExportStar(node) { + return this.eat(55); + } + maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { + this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); + const id = maybeDefaultIdentifier || this.parseIdentifier(true); + const specifier = this.startNodeAtNode(id); + specifier.exported = id; + node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + return true; + } + return false; + } + maybeParseExportNamespaceSpecifier(node) { + if (this.isContextual(93)) { + var _ref, _ref$specifiers; + (_ref$specifiers = (_ref = node).specifiers) != null ? _ref$specifiers : _ref.specifiers = []; + const specifier = this.startNodeAt(this.state.lastTokStartLoc); + this.next(); + specifier.exported = this.parseModuleExportName(); + node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); + return true; + } + return false; + } + maybeParseExportNamedSpecifiers(node) { + if (this.match(5)) { + const node2 = node; + if (!node2.specifiers) node2.specifiers = []; + const isTypeExport = node2.exportKind === "type"; + node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); + node2.source = null; + if (this.hasPlugin("importAssertions")) { + node2.assertions = []; + } else { + node2.attributes = []; + } + node2.declaration = null; + return true; + } + return false; + } + maybeParseExportDeclaration(node) { + if (this.shouldParseExportDeclaration()) { + node.specifiers = []; + node.source = null; + if (this.hasPlugin("importAssertions")) { + node.assertions = []; + } else { + node.attributes = []; + } + node.declaration = this.parseExportDeclaration(node); + return true; + } + return false; + } + isAsyncFunction() { + if (!this.isContextual(95)) return false; + const next = this.nextTokenInLineStart(); + return this.isUnparsedContextual(next, "function"); + } + parseExportDefaultExpression() { + const expr = this.startNode(); + if (this.match(68)) { + this.next(); + return this.parseFunction(expr, 1 | 4); + } else if (this.isAsyncFunction()) { + this.next(); + this.next(); + return this.parseFunction(expr, 1 | 4 | 8); + } + if (this.match(80)) { + return this.parseClass(expr, true, true); + } + if (this.match(26)) { + if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); + } + return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); + } + if (this.match(75) || this.match(74) || this.isLet() || this.isUsing() || this.isAwaitUsing()) { + throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc); + } + const res = this.parseMaybeAssignAllowIn(); + this.semicolon(); + return res; + } + parseExportDeclaration(node) { + if (this.match(80)) { + const node = this.parseClass(this.startNode(), true, false); + return node; + } + return this.parseStatementListItem(); + } + isExportDefaultSpecifier() { + const { + type + } = this.state; + if (tokenIsIdentifier(type)) { + if (type === 95 && !this.state.containsEsc || type === 100) { + return false; + } + if ((type === 130 || type === 129) && !this.state.containsEsc) { + const next = this.nextTokenStart(); + const nextChar = this.input.charCodeAt(next); + if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next) && !this.input.startsWith("from", next)) { + this.expectOnePlugin(["flow", "typescript"]); + return false; + } + } + } else if (!this.match(65)) { + return false; + } + const next = this.nextTokenStart(); + const hasFrom = this.isUnparsedContextual(next, "from"); + if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { + return true; + } + if (this.match(65) && hasFrom) { + const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); + return nextAfterFrom === 34 || nextAfterFrom === 39; + } + return false; + } + parseExportFrom(node, expect) { + if (this.eatContextual(98)) { + node.source = this.parseImportSource(); + this.checkExport(node); + this.maybeParseImportAttributes(node); + this.checkJSONModuleImport(node); + } else if (expect) { + this.unexpected(); + } + this.semicolon(); + } + shouldParseExportDeclaration() { + const { + type + } = this.state; + if (type === 26) { + this.expectOnePlugin(["decorators", "decorators-legacy"]); + if (this.hasPlugin("decorators")) { + if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { + this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); + } + return true; + } + } + if (this.isUsing()) { + this.raise(Errors.UsingDeclarationExport, this.state.startLoc); + return true; + } + if (this.isAwaitUsing()) { + this.raise(Errors.UsingDeclarationExport, this.state.startLoc); + return true; + } + return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); + } + checkExport(node, checkNames, isDefault, isFrom) { + if (checkNames) { + var _node$specifiers; + if (isDefault) { + this.checkDuplicateExports(node, "default"); + if (this.hasPlugin("exportDefaultFrom")) { + var _declaration$extra; + const declaration = node.declaration; + if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { + this.raise(Errors.ExportDefaultFromAsIdentifier, declaration); + } + } + } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) { + for (const specifier of node.specifiers) { + const { + exported + } = specifier; + const exportName = exported.type === "Identifier" ? exported.name : exported.value; + this.checkDuplicateExports(specifier, exportName); + if (!isFrom && specifier.local) { + const { + local + } = specifier; + if (local.type !== "Identifier") { + this.raise(Errors.ExportBindingIsString, specifier, { + localName: local.value, + exportName + }); + } else { + this.checkReservedWord(local.name, local.loc.start, true, false); + this.scope.checkLocalExport(local); + } + } + } + } else if (node.declaration) { + const decl = node.declaration; + if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") { + const { + id + } = decl; + if (!id) throw new Error("Assertion failure"); + this.checkDuplicateExports(node, id.name); + } else if (decl.type === "VariableDeclaration") { + for (const declaration of decl.declarations) { + this.checkDeclaration(declaration.id); + } + } + } + } + } + checkDeclaration(node) { + if (node.type === "Identifier") { + this.checkDuplicateExports(node, node.name); + } else if (node.type === "ObjectPattern") { + for (const prop of node.properties) { + this.checkDeclaration(prop); + } + } else if (node.type === "ArrayPattern") { + for (const elem of node.elements) { + if (elem) { + this.checkDeclaration(elem); + } + } + } else if (node.type === "ObjectProperty") { + this.checkDeclaration(node.value); + } else if (node.type === "RestElement") { + this.checkDeclaration(node.argument); + } else if (node.type === "AssignmentPattern") { + this.checkDeclaration(node.left); + } + } + checkDuplicateExports(node, exportName) { + if (this.exportedIdentifiers.has(exportName)) { + if (exportName === "default") { + this.raise(Errors.DuplicateDefaultExport, node); + } else { + this.raise(Errors.DuplicateExport, node, { + exportName + }); + } + } + this.exportedIdentifiers.add(exportName); + } + parseExportSpecifiers(isInTypeExport) { + const nodes = []; + let first = true; + this.expect(5); + while (!this.eat(8)) { + if (first) { + first = false; + } else { + this.expect(12); + if (this.eat(8)) break; + } + const isMaybeTypeOnly = this.isContextual(130); + const isString = this.match(134); + const node = this.startNode(); + node.local = this.parseModuleExportName(); + nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); + } + return nodes; + } + parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { + if (this.eatContextual(93)) { + node.exported = this.parseModuleExportName(); + } else if (isString) { + node.exported = this.cloneStringLiteral(node.local); + } else if (!node.exported) { + node.exported = this.cloneIdentifier(node.local); + } + return this.finishNode(node, "ExportSpecifier"); + } + parseModuleExportName() { + if (this.match(134)) { + const result = this.parseStringLiteral(this.state.value); + const surrogate = loneSurrogate.exec(result.value); + if (surrogate) { + this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, { + surrogateCharCode: surrogate[0].charCodeAt(0) + }); + } + return result; + } + return this.parseIdentifier(true); + } + isJSONModuleImport(node) { + if (node.assertions != null) { + return node.assertions.some(({ + key, + value + }) => { + return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); + }); + } + return false; + } + checkImportReflection(node) { + const { + specifiers + } = node; + const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null; + if (node.phase === "source") { + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start); + } + } else if (node.phase === "defer") { + if (singleBindingType !== "ImportNamespaceSpecifier") { + this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start); + } + } else if (node.module) { + var _node$assertions; + if (singleBindingType !== "ImportDefaultSpecifier") { + this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start); + } + if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { + this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start); + } + } + } + checkJSONModuleImport(node) { + if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { + const { + specifiers + } = node; + if (specifiers != null) { + const nonDefaultNamedSpecifier = specifiers.find(specifier => { + let imported; + if (specifier.type === "ExportSpecifier") { + imported = specifier.local; + } else if (specifier.type === "ImportSpecifier") { + imported = specifier.imported; + } + if (imported !== undefined) { + return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; + } + }); + if (nonDefaultNamedSpecifier !== undefined) { + this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start); + } + } + } + } + isPotentialImportPhase(isExport) { + if (isExport) return false; + return this.isContextual(105) || this.isContextual(97) || this.isContextual(127); + } + applyImportPhase(node, isExport, phase, loc) { + if (isExport) { + return; + } + if (phase === "module") { + this.expectPlugin("importReflection", loc); + node.module = true; + } else if (this.hasPlugin("importReflection")) { + node.module = false; + } + if (phase === "source") { + this.expectPlugin("sourcePhaseImports", loc); + node.phase = "source"; + } else if (phase === "defer") { + this.expectPlugin("deferredImportEvaluation", loc); + node.phase = "defer"; + } else if (this.hasPlugin("sourcePhaseImports")) { + node.phase = null; + } + } + parseMaybeImportPhase(node, isExport) { + if (!this.isPotentialImportPhase(isExport)) { + this.applyImportPhase(node, isExport, null); + return null; + } + const phaseIdentifier = this.startNode(); + const phaseIdentifierName = this.parseIdentifierName(true); + const { + type + } = this.state; + const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + if (isImportPhase) { + this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.loc.start); + return null; + } else { + this.applyImportPhase(node, isExport, null); + return this.createIdentifier(phaseIdentifier, phaseIdentifierName); + } + } + isPrecedingIdImportPhase(phase) { + const { + type + } = this.state; + return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; + } + parseImport(node) { + if (this.match(134)) { + return this.parseImportSourceAndAttributes(node); + } + return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); + } + parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { + node.specifiers = []; + const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); + const parseNext = !hasDefault || this.eat(12); + const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); + if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); + this.expectContextual(98); + return this.parseImportSourceAndAttributes(node); + } + parseImportSourceAndAttributes(node) { + var _node$specifiers2; + (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = []; + node.source = this.parseImportSource(); + this.maybeParseImportAttributes(node); + this.checkImportReflection(node); + this.checkJSONModuleImport(node); + this.semicolon(); + this.sawUnambiguousESM = true; + return this.finishNode(node, "ImportDeclaration"); + } + parseImportSource() { + if (!this.match(134)) this.unexpected(); + return this.parseExprAtom(); + } + parseImportSpecifierLocal(node, specifier, type) { + specifier.local = this.parseIdentifier(); + node.specifiers.push(this.finishImportSpecifier(specifier, type)); + } + finishImportSpecifier(specifier, type, bindingType = 8201) { + this.checkLVal(specifier.local, { + type + }, bindingType); + return this.finishNode(specifier, type); + } + parseImportAttributes() { + this.expect(5); + const attrs = []; + const attrNames = new Set(); + do { + if (this.match(8)) { + break; + } + const node = this.startNode(); + const keyName = this.state.value; + if (attrNames.has(keyName)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, { + key: keyName + }); + } + attrNames.add(keyName); + if (this.match(134)) { + node.key = this.parseStringLiteral(keyName); + } else { + node.key = this.parseIdentifier(true); + } + this.expect(14); + if (!this.match(134)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); + } + node.value = this.parseStringLiteral(this.state.value); + attrs.push(this.finishNode(node, "ImportAttribute")); + } while (this.eat(12)); + this.expect(8); + return attrs; + } + parseModuleAttributes() { + const attrs = []; + const attributes = new Set(); + do { + const node = this.startNode(); + node.key = this.parseIdentifier(true); + if (node.key.name !== "type") { + this.raise(Errors.ModuleAttributeDifferentFromType, node.key); + } + if (attributes.has(node.key.name)) { + this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, { + key: node.key.name + }); + } + attributes.add(node.key.name); + this.expect(14); + if (!this.match(134)) { + throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); + } + node.value = this.parseStringLiteral(this.state.value); + attrs.push(this.finishNode(node, "ImportAttribute")); + } while (this.eat(12)); + return attrs; + } + maybeParseImportAttributes(node) { + let attributes; + { + var useWith = false; + } + if (this.match(76)) { + if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { + return; + } + this.next(); + if (this.hasPlugin("moduleAttributes")) { + attributes = this.parseModuleAttributes(); + this.addExtra(node, "deprecatedWithLegacySyntax", true); + } else { + attributes = this.parseImportAttributes(); + } + { + useWith = true; + } + } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { + if (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions")) { + this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc); + } + if (!this.hasPlugin("importAssertions")) { + this.addExtra(node, "deprecatedAssertSyntax", true); + } + this.next(); + attributes = this.parseImportAttributes(); + } else { + attributes = []; + } + if (!useWith && this.hasPlugin("importAssertions")) { + node.assertions = attributes; + } else { + node.attributes = attributes; + } + } + maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { + if (maybeDefaultIdentifier) { + const specifier = this.startNodeAtNode(maybeDefaultIdentifier); + specifier.local = maybeDefaultIdentifier; + node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); + return true; + } else if (tokenIsKeywordOrIdentifier(this.state.type)) { + this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); + return true; + } + return false; + } + maybeParseStarImportSpecifier(node) { + if (this.match(55)) { + const specifier = this.startNode(); + this.next(); + this.expectContextual(93); + this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); + return true; + } + return false; + } + parseNamedImportSpecifiers(node) { + let first = true; + this.expect(5); + while (!this.eat(8)) { + if (first) { + first = false; + } else { + if (this.eat(14)) { + throw this.raise(Errors.DestructureNamedImport, this.state.startLoc); + } + this.expect(12); + if (this.eat(8)) break; + } + const specifier = this.startNode(); + const importedIsString = this.match(134); + const isMaybeTypeOnly = this.isContextual(130); + specifier.imported = this.parseModuleExportName(); + const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); + node.specifiers.push(importSpecifier); + } + } + parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { + if (this.eatContextual(93)) { + specifier.local = this.parseIdentifier(); + } else { + const { + imported + } = specifier; + if (importedIsString) { + throw this.raise(Errors.ImportBindingIsString, specifier, { + importName: imported.value + }); + } + this.checkReservedWord(imported.name, specifier.loc.start, true, true); + if (!specifier.local) { + specifier.local = this.cloneIdentifier(imported); + } + } + return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); + } + isThisParam(param) { + return param.type === "Identifier" && param.name === "this"; + } +} +class Parser extends StatementParser { + constructor(options, input, pluginsMap) { + const normalizedOptions = getOptions(options); + super(normalizedOptions, input); + this.options = normalizedOptions; + this.initializeScopes(); + this.plugins = pluginsMap; + this.filename = normalizedOptions.sourceFilename; + this.startIndex = normalizedOptions.startIndex; + let optionFlags = 0; + if (normalizedOptions.allowAwaitOutsideFunction) { + optionFlags |= 1; + } + if (normalizedOptions.allowReturnOutsideFunction) { + optionFlags |= 2; + } + if (normalizedOptions.allowImportExportEverywhere) { + optionFlags |= 8; + } + if (normalizedOptions.allowSuperOutsideMethod) { + optionFlags |= 16; + } + if (normalizedOptions.allowUndeclaredExports) { + optionFlags |= 64; + } + if (normalizedOptions.allowNewTargetOutsideFunction) { + optionFlags |= 4; + } + if (normalizedOptions.allowYieldOutsideFunction) { + optionFlags |= 32; + } + if (normalizedOptions.ranges) { + optionFlags |= 128; + } + if (normalizedOptions.tokens) { + optionFlags |= 256; + } + if (normalizedOptions.createImportExpressions) { + optionFlags |= 512; + } + if (normalizedOptions.createParenthesizedExpressions) { + optionFlags |= 1024; + } + if (normalizedOptions.errorRecovery) { + optionFlags |= 2048; + } + if (normalizedOptions.attachComment) { + optionFlags |= 4096; + } + if (normalizedOptions.annexB) { + optionFlags |= 8192; + } + this.optionFlags = optionFlags; + } + getScopeHandler() { + return ScopeHandler; + } + parse() { + this.enterInitialScopes(); + const file = this.startNode(); + const program = this.startNode(); + this.nextToken(); + file.errors = null; + const result = this.parseTopLevel(file, program); + result.errors = this.state.errors; + result.comments.length = this.state.commentsLen; + return result; + } +} +function parse(input, options) { + var _options; + if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { + options = Object.assign({}, options); + try { + options.sourceType = "module"; + const parser = getParser(options, input); + const ast = parser.parse(); + if (parser.sawUnambiguousESM) { + return ast; + } + if (parser.ambiguousScriptDifferentAst) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused) {} + } else { + ast.program.sourceType = "script"; + } + return ast; + } catch (moduleError) { + try { + options.sourceType = "script"; + return getParser(options, input).parse(); + } catch (_unused2) {} + throw moduleError; + } + } else { + return getParser(options, input).parse(); + } +} +function parseExpression(input, options) { + const parser = getParser(options, input); + if (parser.options.strictMode) { + parser.state.strict = true; + } + return parser.getExpression(); +} +function generateExportedTokenTypes(internalTokenTypes) { + const tokenTypes = {}; + for (const typeName of Object.keys(internalTokenTypes)) { + tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); + } + return tokenTypes; +} +const tokTypes = generateExportedTokenTypes(tt); +function getParser(options, input) { + let cls = Parser; + const pluginsMap = new Map(); + if (options != null && options.plugins) { + for (const plugin of options.plugins) { + let name, opts; + if (typeof plugin === "string") { + name = plugin; + } else { + [name, opts] = plugin; + } + if (!pluginsMap.has(name)) { + pluginsMap.set(name, opts || {}); + } + } + validatePlugins(pluginsMap); + cls = getParserClass(pluginsMap); + } + return new cls(options, input, pluginsMap); +} +const parserClassCache = new Map(); +function getParserClass(pluginsMap) { + const pluginList = []; + for (const name of mixinPluginNames) { + if (pluginsMap.has(name)) { + pluginList.push(name); + } + } + const key = pluginList.join("|"); + let cls = parserClassCache.get(key); + if (!cls) { + cls = Parser; + for (const plugin of pluginList) { + cls = mixinPlugins[plugin](cls); + } + parserClassCache.set(key, cls); + } + return cls; +} +exports.parse = parse; +exports.parseExpression = parseExpression; +exports.tokTypes = tokTypes; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/parser/lib/index.js.map b/node_modules/@babel/parser/lib/index.js.map new file mode 100644 index 0000000..1aceda3 --- /dev/null +++ b/node_modules/@babel/parser/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/util/location.ts","../src/parse-error/module-errors.ts","../src/parse-error/to-node-description.ts","../src/parse-error/standard-errors.ts","../src/parse-error/strict-mode-errors.ts","../src/parse-error/parse-expression-errors.ts","../src/parse-error/pipeline-operator-errors.ts","../src/parse-error.ts","../src/options.ts","../src/plugins/estree.ts","../src/tokenizer/context.ts","../src/tokenizer/types.ts","../../babel-helper-validator-identifier/src/identifier.ts","../../babel-helper-validator-identifier/src/keyword.ts","../src/util/identifier.ts","../src/util/scope.ts","../src/plugins/flow/scope.ts","../src/plugins/flow/index.ts","../src/plugins/jsx/xhtml.ts","../src/util/whitespace.ts","../src/plugins/jsx/index.ts","../src/plugins/typescript/scope.ts","../src/util/production-parameter.ts","../src/parser/base.ts","../src/parser/comments.ts","../src/tokenizer/state.ts","../../babel-helper-string-parser/src/index.ts","../src/tokenizer/index.ts","../src/util/class-scope.ts","../src/util/expression-scope.ts","../src/parser/util.ts","../src/parser/node.ts","../src/parser/lval.ts","../src/plugins/typescript/index.ts","../src/plugins/placeholders.ts","../src/plugins/v8intrinsic.ts","../src/plugin-utils.ts","../src/parser/expression.ts","../src/parser/statement.ts","../src/parser/index.ts","../src/index.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string | undefined;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end!;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\n\nconst code = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code,\n },\n} satisfies ParseErrorTemplates;\n","const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\nconst toNodeDescription = (node: NodeWithDescription) =>\n node.type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[`${node.prefix}`]\n : NodeDescriptions[node.type];\n\nexport default toNodeDescription;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport type LValAncestor =\n | { type: \"UpdateExpression\"; prefix: boolean }\n | {\n type:\n | \"ArrayPattern\"\n | \"AssignmentExpression\"\n | \"CatchClause\"\n | \"ForOfStatement\"\n | \"FormalParameters\"\n | \"ForInStatement\"\n | \"ForStatement\"\n | \"ImportSpecifier\"\n | \"ImportNamespaceSpecifier\"\n | \"ImportDefaultSpecifier\"\n | \"ParenthesizedExpression\"\n | \"ObjectPattern\"\n | \"RestElement\"\n | \"VariableDeclarator\";\n };\n\nexport default {\n AccessorIsGenerator: ({ kind }: { kind: \"get\" | \"set\" }) =>\n `A ${kind}ter cannot be a generator.`,\n ArgumentsInClass:\n \"'arguments' is only allowed in functions and class methods.\",\n AsyncFunctionInSingleStatementContext:\n \"Async functions can only be declared at the top level or inside a block.\",\n AwaitBindingIdentifier:\n \"Can not use 'await' as identifier inside an async function.\",\n AwaitBindingIdentifierInStaticBlock:\n \"Can not use 'await' as identifier inside a static block.\",\n AwaitExpressionFormalParameter:\n \"'await' is not allowed in async function parameters.\",\n AwaitUsingNotInAsyncContext:\n \"'await using' is only allowed within async functions and at the top levels of modules.\",\n AwaitNotInAsyncContext:\n \"'await' is only allowed within async functions and at the top levels of modules.\",\n BadGetterArity: \"A 'get' accessor must not have any formal parameters.\",\n BadSetterArity: \"A 'set' accessor must have exactly one formal parameter.\",\n BadSetterRestParameter:\n \"A 'set' accessor function argument must not be a rest parameter.\",\n ConstructorClassField: \"Classes may not have a field named 'constructor'.\",\n ConstructorClassPrivateField:\n \"Classes may not have a private field named '#constructor'.\",\n ConstructorIsAccessor: \"Class constructor may not be an accessor.\",\n ConstructorIsAsync: \"Constructor can't be an async function.\",\n ConstructorIsGenerator: \"Constructor can't be a generator.\",\n DeclarationMissingInitializer: ({\n kind,\n }: {\n kind: \"await using\" | \"const\" | \"destructuring\" | \"using\";\n }) => `Missing initializer in ${kind} declaration.`,\n DecoratorArgumentsOutsideParentheses:\n \"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.\",\n DecoratorBeforeExport:\n \"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.\",\n DecoratorsBeforeAfterExport:\n \"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.\",\n DecoratorConstructor:\n \"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?\",\n DecoratorExportClass:\n \"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.\",\n DecoratorSemicolon: \"Decorators must not be followed by a semicolon.\",\n DecoratorStaticBlock: \"Decorators can't be used with a static block.\",\n DeferImportRequiresNamespace:\n 'Only `import defer * as x from \"./module\"` is valid.',\n DeletePrivateField: \"Deleting a private field is not allowed.\",\n DestructureNamedImport:\n \"ES2015 named imports do not destructure. Use another statement for destructuring after the import.\",\n DuplicateConstructor: \"Duplicate constructor in the same class.\",\n DuplicateDefaultExport: \"Only one default export allowed per module.\",\n DuplicateExport: ({ exportName }: { exportName: string }) =>\n `\\`${exportName}\\` has already been exported. Exported identifiers must be unique.`,\n DuplicateProto: \"Redefinition of __proto__ property.\",\n DuplicateRegExpFlags: \"Duplicate regular expression flag.\",\n ElementAfterRest: \"Rest element must be last element.\",\n EscapedCharNotAnIdentifier: \"Invalid Unicode escape.\",\n ExportBindingIsString: ({\n localName,\n exportName,\n }: {\n localName: string;\n exportName: string;\n }) =>\n `A string literal cannot be used as an exported binding without \\`from\\`.\\n- Did you mean \\`export { '${localName}' as '${exportName}' } from 'some-module'\\`?`,\n ExportDefaultFromAsIdentifier:\n \"'from' is not allowed as an identifier after 'export default'.\",\n\n ForInOfLoopInitializer: ({\n type,\n }: {\n type: \"ForInStatement\" | \"ForOfStatement\";\n }) =>\n `'${\n type === \"ForInStatement\" ? \"for-in\" : \"for-of\"\n }' loop variable declaration may not have an initializer.`,\n ForInUsing: \"For-in loop may not start with 'using' declaration.\",\n\n ForOfAsync: \"The left-hand side of a for-of loop may not be 'async'.\",\n ForOfLet: \"The left-hand side of a for-of loop may not start with 'let'.\",\n GeneratorInSingleStatementContext:\n \"Generators can only be declared at the top level or inside a block.\",\n\n IllegalBreakContinue: ({\n type,\n }: {\n type: \"BreakStatement\" | \"ContinueStatement\";\n }) => `Unsyntactic ${type === \"BreakStatement\" ? \"break\" : \"continue\"}.`,\n\n IllegalLanguageModeDirective:\n \"Illegal 'use strict' directive in function with non-simple parameter list.\",\n IllegalReturn: \"'return' outside of function.\",\n ImportAttributesUseAssert:\n \"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.\",\n ImportBindingIsString: ({ importName }: { importName: string }) =>\n `A string literal cannot be used as an imported binding.\\n- Did you mean \\`import { \"${importName}\" as foo }\\`?`,\n ImportCallArity: `\\`import()\\` requires exactly one or two arguments.`,\n ImportCallNotNewExpression: \"Cannot use new with import(...).\",\n ImportCallSpreadArgument: \"`...` is not allowed in `import()`.\",\n ImportJSONBindingNotDefault:\n \"A JSON module can only be imported with `default`.\",\n ImportReflectionHasAssertion: \"`import module x` cannot have assertions.\",\n ImportReflectionNotBinding:\n 'Only `import module x from \"./module\"` is valid.',\n IncompatibleRegExpUVFlags:\n \"The 'u' and 'v' regular expression flags cannot be enabled at the same time.\",\n InvalidBigIntLiteral: \"Invalid BigIntLiteral.\",\n InvalidCodePoint: \"Code point out of bounds.\",\n InvalidCoverDiscardElement:\n \"'void' must be followed by an expression when not used in a binding position.\",\n InvalidCoverInitializedName: \"Invalid shorthand property initializer.\",\n InvalidDecimal: \"Invalid decimal.\",\n InvalidDigit: ({ radix }: { radix: number }) =>\n `Expected number in radix ${radix}.`,\n InvalidEscapeSequence: \"Bad character escape sequence.\",\n InvalidEscapeSequenceTemplate: \"Invalid escape sequence in template.\",\n InvalidEscapedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Escape sequence in keyword ${reservedWord}.`,\n InvalidIdentifier: ({ identifierName }: { identifierName: string }) =>\n `Invalid identifier ${identifierName}.`,\n InvalidLhs: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsBinding: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`,\n InvalidLhsOptionalChaining: ({ ancestor }: { ancestor: LValAncestor }) =>\n `Invalid optional chaining in the left-hand side of ${toNodeDescription(\n ancestor,\n )}.`,\n InvalidNumber: \"Invalid number.\",\n InvalidOrMissingExponent:\n \"Floating-point numbers require a valid exponent after the 'e'.\",\n InvalidOrUnexpectedToken: ({ unexpected }: { unexpected: string }) =>\n `Unexpected character '${unexpected}'.`,\n InvalidParenthesizedAssignment: \"Invalid parenthesized assignment pattern.\",\n InvalidPrivateFieldResolution: ({\n identifierName,\n }: {\n identifierName: string;\n }) => `Private name #${identifierName} is not defined.`,\n InvalidPropertyBindingPattern: \"Binding member expression.\",\n InvalidRecordProperty:\n \"Only properties and spread elements are allowed in record definitions.\",\n InvalidRestAssignmentPattern: \"Invalid rest operator's argument.\",\n LabelRedeclaration: ({ labelName }: { labelName: string }) =>\n `Label '${labelName}' is already declared.`,\n LetInLexicalBinding: \"'let' is disallowed as a lexically bound name.\",\n LineTerminatorBeforeArrow: \"No line break is allowed before '=>'.\",\n MalformedRegExpFlags: \"Invalid regular expression flag.\",\n MissingClassName: \"A class name is required.\",\n MissingEqInAssignment:\n \"Only '=' operator can be used for specifying default value.\",\n MissingSemicolon: \"Missing semicolon.\",\n MissingPlugin: ({ missingPlugin }: { missingPlugin: [string] }) =>\n `This experimental syntax requires enabling the parser plugin: ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n // FIXME: Would be nice to make this \"missingPlugins\" instead.\n // Also, seems like we can drop the \"(s)\" from the message and just make it \"s\".\n MissingOneOfPlugins: ({ missingPlugin }: { missingPlugin: string[] }) =>\n `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin\n .map(name => JSON.stringify(name))\n .join(\", \")}.`,\n MissingUnicodeEscape: \"Expecting Unicode escape sequence \\\\uXXXX.\",\n MixingCoalesceWithLogical:\n \"Nullish coalescing operator(??) requires parens when mixing with logical operators.\",\n ModuleAttributeDifferentFromType:\n \"The only accepted module attribute is `type`.\",\n ModuleAttributeInvalidValue:\n \"Only string literals are allowed as module attribute values.\",\n ModuleAttributesWithDuplicateKeys: ({ key }: { key: string }) =>\n `Duplicate key \"${key}\" is not allowed in module attributes.`,\n ModuleExportNameHasLoneSurrogate: ({\n surrogateCharCode,\n }: {\n surrogateCharCode: number;\n }) =>\n `An export name cannot include a lone surrogate, found '\\\\u${surrogateCharCode.toString(\n 16,\n )}'.`,\n ModuleExportUndefined: ({ localName }: { localName: string }) =>\n `Export '${localName}' is not defined.`,\n MultipleDefaultsInSwitch: \"Multiple default clauses.\",\n NewlineAfterThrow: \"Illegal newline after throw.\",\n NoCatchOrFinally: \"Missing catch or finally clause.\",\n NumberIdentifier: \"Identifier directly after number.\",\n NumericSeparatorInEscapeSequence:\n \"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.\",\n ObsoleteAwaitStar:\n \"'await*' has been removed from the async functions proposal. Use Promise.all() instead.\",\n OptionalChainingNoNew:\n \"Constructors in/after an Optional Chain are not allowed.\",\n OptionalChainingNoTemplate:\n \"Tagged Template Literals are not allowed in optionalChain.\",\n OverrideOnConstructor:\n \"'override' modifier cannot appear on a constructor declaration.\",\n ParamDupe: \"Argument name clash.\",\n PatternHasAccessor: \"Object pattern can't contain getter or setter.\",\n PatternHasMethod: \"Object pattern can't contain methods.\",\n PrivateInExpectedIn: ({ identifierName }: { identifierName: string }) =>\n `Private names are only allowed in property accesses (\\`obj.#${identifierName}\\`) or in \\`in\\` expressions (\\`#${identifierName} in obj\\`).`,\n PrivateNameRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Duplicate private name #${identifierName}.`,\n RecordExpressionBarIncorrectEndSyntaxType:\n \"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionBarIncorrectStartSyntaxType:\n \"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n RecordExpressionHashIncorrectStartSyntaxType:\n \"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n RecordNoProto: \"'__proto__' is not allowed in Record expressions.\",\n RestTrailingComma: \"Unexpected trailing comma after rest element.\",\n SloppyFunction:\n \"In non-strict mode code, functions can only be declared at top level or inside a block.\",\n SloppyFunctionAnnexB:\n \"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.\",\n SourcePhaseImportRequiresDefault:\n 'Only `import source x from \"./module\"` is valid.',\n StaticPrototype: \"Classes may not have static property named prototype.\",\n SuperNotAllowed:\n \"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?\",\n SuperPrivateField: \"Private fields can't be accessed on super.\",\n TrailingDecorator: \"Decorators must be attached to a class element.\",\n TupleExpressionBarIncorrectEndSyntaxType:\n \"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionBarIncorrectStartSyntaxType:\n \"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.\",\n TupleExpressionHashIncorrectStartSyntaxType:\n \"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.\",\n UnexpectedArgumentPlaceholder: \"Unexpected argument placeholder.\",\n UnexpectedAwaitAfterPipelineBody:\n 'Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal.',\n UnexpectedDigitAfterHash: \"Unexpected digit after hash token.\",\n UnexpectedImportExport:\n \"'import' and 'export' may only appear at the top level.\",\n UnexpectedKeyword: ({ keyword }: { keyword: string }) =>\n `Unexpected keyword '${keyword}'.`,\n UnexpectedLeadingDecorator:\n \"Leading decorators must be attached to a class declaration.\",\n UnexpectedLexicalDeclaration:\n \"Lexical declaration cannot appear in a single-statement context.\",\n UnexpectedNewTarget:\n \"`new.target` can only be used in functions or class properties.\",\n UnexpectedNumericSeparator:\n \"A numeric separator is only allowed between two digits.\",\n UnexpectedPrivateField: \"Unexpected private name.\",\n UnexpectedReservedWord: ({ reservedWord }: { reservedWord: string }) =>\n `Unexpected reserved word '${reservedWord}'.`,\n UnexpectedSuper: \"'super' is only allowed in object methods and classes.\",\n UnexpectedToken: ({\n expected,\n unexpected,\n }: {\n expected?: string | null;\n unexpected?: string | null;\n }) =>\n `Unexpected token${unexpected ? ` '${unexpected}'.` : \"\"}${\n expected ? `, expected \"${expected}\"` : \"\"\n }`,\n UnexpectedTokenUnaryExponentiation:\n \"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.\",\n UnexpectedUsingDeclaration:\n \"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.\",\n UnexpectedVoidPattern: \"Unexpected void binding.\",\n UnsupportedBind: \"Binding should be performed on object property.\",\n UnsupportedDecoratorExport:\n \"A decorated export must export a class declaration.\",\n UnsupportedDefaultExport:\n \"Only expressions, functions or classes are allowed as the `default` export.\",\n UnsupportedImport:\n \"`import` can only be used in `import()` or `import.meta`.\",\n UnsupportedMetaProperty: ({\n target,\n onlyValidPropertyName,\n }: {\n target: string;\n onlyValidPropertyName: string;\n }) =>\n `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,\n UnsupportedParameterDecorator:\n \"Decorators cannot be used to decorate parameters.\",\n UnsupportedPropertyDecorator:\n \"Decorators cannot be used to decorate object literal properties.\",\n UnsupportedSuper:\n \"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).\",\n UnterminatedComment: \"Unterminated comment.\",\n UnterminatedRegExp: \"Unterminated regular expression.\",\n UnterminatedString: \"Unterminated string constant.\",\n UnterminatedTemplate: \"Unterminated template.\",\n UsingDeclarationExport: \"Using declaration cannot be exported.\",\n UsingDeclarationHasBindingPattern:\n \"Using declaration cannot have destructuring patterns.\",\n VarRedeclaration: ({ identifierName }: { identifierName: string }) =>\n `Identifier '${identifierName}' has already been declared.`,\n VoidPatternCatchClauseParam:\n \"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.\",\n VoidPatternInitializer: \"A void binding may not have an initializer.\",\n YieldBindingIdentifier:\n \"Can not use 'yield' as identifier inside a generator.\",\n YieldInParameter: \"Yield expression is not allowed in formal parameters.\",\n YieldNotInGeneratorFunction:\n \"'yield' is only allowed within generator functions.\",\n ZeroDigitNumericSeparator:\n \"Numeric separator can not be used after leading 0.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error\";\n\nexport default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\n\nexport default {\n ParseExpressionEmptyInput:\n \"Unexpected parseExpression() input: The input is empty or contains only comments.\",\n ParseExpressionExpectsEOF: ({ unexpected }: { unexpected: number }) =>\n `Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \\`${String.fromCodePoint(unexpected)}\\`.`,\n} satisfies ParseErrorTemplates;\n","import type { ParseErrorTemplates } from \"../parse-error.ts\";\nimport toNodeDescription from \"./to-node-description.ts\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType> =\n T extends Set ? M : unknown;\n\nexport type UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes: process.env.BABEL_8_BREAKING\n ? 'Topic references are only supported when using the `\"proposal\": \"hack\"` version of the pipeline proposal.'\n : 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n ...(process.env.BABEL_8_BREAKING\n ? {}\n : {\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n }),\n} satisfies ParseErrorTemplates;\n","import { Position } from \"./util/location.ts\";\n\ntype SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\ntype ParseErrorCode =\n | \"BABEL_PARSER_SYNTAX_ERROR\"\n | \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\";\n\n// Babel uses \"normal\" SyntaxErrors for it's errors, but adds some extra\n// functionality. This functionality is defined in the\n// `ParseErrorSpecification` interface below. We may choose to change to someday\n// give our errors their own full-blown class, but until then this allow us to\n// keep all the desirable properties of SyntaxErrors (like their name in stack\n// traces, etc.), and also allows us to punt on any publicly facing\n// class-hierarchy decisions until Babel 8.\ninterface ParseErrorSpecification {\n // Look, these *could* be readonly, but then Flow complains when we initially\n // set them. We could do a whole dance and make a special interface that's not\n // readonly for when we create the error, then cast it to the readonly\n // interface for public use, but the previous implementation didn't have them\n // as readonly, so let's just not worry about it for now.\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n missingPlugin?: string | string[];\n loc: Position;\n details: ErrorDetails;\n\n // We should consider removing this as it now just contains the same\n // information as `loc.index`.\n pos: number;\n}\n\nexport type ParseError = SyntaxError &\n ParseErrorSpecification;\n\n// By `ParseErrorConstructor`, we mean something like the new-less style\n// `ErrorConstructor`[1], since `ParseError`'s are not themselves actually\n// separate classes from `SyntaxError`'s.\n//\n// 1. https://github.com/microsoft/TypeScript/blob/v4.5.5/lib/lib.es5.d.ts#L1027\nexport type ParseErrorConstructor = (\n loc: Position,\n details: ErrorDetails,\n) => ParseError;\n\ntype ToMessage = (self: ErrorDetails) => string;\n\ntype ParseErrorCredentials = {\n code: string;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage;\n};\n\nfunction defineHidden(obj: object, key: string, value: unknown) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n configurable: true,\n value,\n });\n}\n\nfunction toParseErrorConstructor({\n toMessage,\n code,\n reasonCode,\n syntaxPlugin,\n}: ParseErrorCredentials): ParseErrorConstructor {\n const hasMissingPlugin =\n reasonCode === \"MissingPlugin\" || reasonCode === \"MissingOneOfPlugins\";\n\n if (!process.env.BABEL_8_BREAKING) {\n const oldReasonCodes: Record = {\n AccessorCannotDeclareThisParameter: \"AccesorCannotDeclareThisParameter\",\n AccessorCannotHaveTypeParameters: \"AccesorCannotHaveTypeParameters\",\n ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:\n \"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference\",\n SetAccessorCannotHaveOptionalParameter:\n \"SetAccesorCannotHaveOptionalParameter\",\n SetAccessorCannotHaveRestParameter: \"SetAccesorCannotHaveRestParameter\",\n SetAccessorCannotHaveReturnType: \"SetAccesorCannotHaveReturnType\",\n };\n if (oldReasonCodes[reasonCode]) {\n reasonCode = oldReasonCodes[reasonCode];\n }\n }\n\n return function constructor(loc: Position, details: ErrorDetails) {\n const error: ParseError = new SyntaxError() as any;\n\n error.code = code as ParseErrorCode;\n error.reasonCode = reasonCode;\n error.loc = loc;\n error.pos = loc.index;\n\n error.syntaxPlugin = syntaxPlugin;\n if (hasMissingPlugin) {\n error.missingPlugin = (details as any).missingPlugin;\n }\n\n type Overrides = {\n loc?: Position;\n details?: ErrorDetails;\n };\n defineHidden(error, \"clone\", function clone(overrides: Overrides = {}) {\n const { line, column, index } = overrides.loc ?? loc;\n return constructor(new Position(line, column, index), {\n ...details,\n ...overrides.details,\n });\n });\n\n defineHidden(error, \"details\", details);\n\n Object.defineProperty(error, \"message\", {\n configurable: true,\n get(this: ParseError): string {\n const message = `${toMessage(details)} (${loc.line}:${loc.column})`;\n this.message = message;\n return message;\n },\n set(value: string) {\n Object.defineProperty(this, \"message\", { value, writable: true });\n },\n });\n\n return error;\n };\n}\n\ntype ParseErrorTemplate =\n | string\n | ToMessage\n | { message: string | ToMessage; code?: ParseErrorCode };\n\nexport type ParseErrorTemplates = { [reasonCode: string]: ParseErrorTemplate };\n\n// This is the templated form of `ParseErrorEnum`.\n//\n// Note: We could factor out the return type calculation into something like\n// `ParseErrorConstructor`, and then we could\n// reuse it in the non-templated form of `ParseErrorEnum`, but TypeScript\n// doesn't seem to drill down that far when showing you the computed type of\n// an object in an editor, so we'll leave it inlined for now.\nexport function ParseErrorEnum(a: TemplateStringsArray): <\n T extends ParseErrorTemplates,\n>(\n parseErrorTemplates: T,\n) => {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\nexport function ParseErrorEnum(\n parseErrorTemplates: T,\n syntaxPlugin?: SyntaxPlugin,\n): {\n [K in keyof T]: ParseErrorConstructor<\n T[K] extends { message: string | ToMessage }\n ? T[K][\"message\"] extends ToMessage\n ? Parameters[0]\n : object\n : T[K] extends ToMessage\n ? Parameters[0]\n : object\n >;\n};\n\n// You call `ParseErrorEnum` with a mapping from `ReasonCode`'s to either:\n//\n// 1. a static error message,\n// 2. `toMessage` functions that define additional necessary `details` needed by\n// the `ParseError`, or\n// 3. Objects that contain a `message` of one of the above and overridden `code`\n// and/or `reasonCode`:\n//\n// ParseErrorEnum `optionalSyntaxPlugin` ({\n// ErrorWithStaticMessage: \"message\",\n// ErrorWithDynamicMessage: ({ type } : { type: string }) => `${type}`),\n// ErrorWithOverriddenCodeAndOrReasonCode: {\n// message: ({ type }: { type: string }) => `${type}`),\n// code: \"AN_ERROR_CODE\",\n// ...(BABEL_8_BREAKING ? { } : { reasonCode: \"CustomErrorReasonCode\" })\n// }\n// });\n//\nexport function ParseErrorEnum(\n argument: TemplateStringsArray | ParseErrorTemplates,\n syntaxPlugin?: SyntaxPlugin,\n) {\n // If the first parameter is an array, that means we were called with a tagged\n // template literal. Extract the syntaxPlugin from this, and call again in\n // the \"normalized\" form.\n if (Array.isArray(argument)) {\n return (parseErrorTemplates: ParseErrorTemplates) =>\n ParseErrorEnum(parseErrorTemplates, argument[0]);\n }\n\n const ParseErrorConstructors = {} as Record<\n string,\n ParseErrorConstructor\n >;\n\n for (const reasonCode of Object.keys(argument)) {\n const template = (argument as ParseErrorTemplates)[reasonCode];\n const { message, ...rest } =\n typeof template === \"string\"\n ? { message: () => template }\n : typeof template === \"function\"\n ? { message: template }\n : template;\n const toMessage = typeof message === \"string\" ? () => message : message;\n\n ParseErrorConstructors[reasonCode] = toParseErrorConstructor({\n code: \"BABEL_PARSER_SYNTAX_ERROR\",\n reasonCode,\n toMessage,\n ...(syntaxPlugin ? { syntaxPlugin } : {}),\n ...rest,\n });\n }\n\n return ParseErrorConstructors;\n}\n\nimport ModuleErrors from \"./parse-error/module-errors.ts\";\nimport StandardErrors from \"./parse-error/standard-errors.ts\";\nimport StrictModeErrors from \"./parse-error/strict-mode-errors.ts\";\nimport ParseExpressionErrors from \"./parse-error/parse-expression-errors.ts\";\nimport PipelineOperatorErrors from \"./parse-error/pipeline-operator-errors.ts\";\n\nexport const Errors = {\n ...ParseErrorEnum(ModuleErrors),\n ...ParseErrorEnum(StandardErrors),\n ...ParseErrorEnum(StrictModeErrors),\n ...ParseErrorEnum(ParseExpressionErrors),\n ...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),\n};\n\nexport type { LValAncestor } from \"./parse-error/standard-errors.ts\";\n","import type { Plugin } from \"./plugin-utils.ts\";\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport type SourceType = \"script\" | \"commonjs\" | \"module\" | \"unambiguous\";\n\nexport interface Options {\n /**\n * By default, import and export declarations can only appear at a program's top level.\n * Setting this option to true allows them anywhere where a statement is allowed.\n */\n allowImportExportEverywhere?: boolean;\n\n /**\n * By default, await use is not allowed outside of an async function.\n * Set this to true to accept such code.\n */\n allowAwaitOutsideFunction?: boolean;\n\n /**\n * By default, a return statement at the top level raises an error.\n * Set this to true to accept such code.\n */\n allowReturnOutsideFunction?: boolean;\n\n /**\n * By default, new.target use is not allowed outside of a function or class.\n * Set this to true to accept such code.\n */\n allowNewTargetOutsideFunction?: boolean;\n\n /**\n * By default, super calls are not allowed outside of a method.\n * Set this to true to accept such code.\n */\n allowSuperOutsideMethod?: boolean;\n\n /**\n * By default, exported identifiers must refer to a declared variable.\n * Set this to true to allow export statements to reference undeclared variables.\n */\n allowUndeclaredExports?: boolean;\n\n /**\n * By default, yield use is not allowed outside of a generator function.\n * Set this to true to accept such code.\n */\n\n allowYieldOutsideFunction?: boolean;\n\n /**\n * By default, Babel parser JavaScript code according to Annex B syntax.\n * Set this to `false` to disable such behavior.\n */\n annexB?: boolean;\n\n /**\n * By default, Babel attaches comments to adjacent AST nodes.\n * When this option is set to false, comments are not attached.\n * It can provide up to 30% performance improvement when the input code has many comments.\n * @babel/eslint-parser will set it for you.\n * It is not recommended to use attachComment: false with Babel transform,\n * as doing so removes all the comments in output code, and renders annotations such as\n * /* istanbul ignore next *\\/ nonfunctional.\n */\n attachComment?: boolean;\n\n /**\n * By default, Babel always throws an error when it finds some invalid code.\n * When this option is set to true, it will store the parsing error and\n * try to continue parsing the invalid input file.\n */\n errorRecovery?: boolean;\n\n /**\n * Indicate the mode the code should be parsed in.\n * Can be one of \"script\", \"commonjs\", \"module\", or \"unambiguous\". Defaults to \"script\".\n * \"unambiguous\" will make @babel/parser attempt to guess, based on the presence\n * of ES6 import or export statements.\n * Files with ES6 imports and exports are considered \"module\" and are otherwise \"script\".\n *\n * Use \"commonjs\" to parse code that is intended to be run in a CommonJS environment such as Node.js.\n */\n sourceType?: SourceType;\n\n /**\n * Correlate output AST nodes with their source filename.\n * Useful when generating code and source maps from the ASTs of multiple input files.\n */\n sourceFilename?: string;\n\n /**\n * By default, all source indexes start from 0.\n * You can provide a start index to alternatively start with.\n * Useful for integration with other source tools.\n */\n startIndex?: number;\n\n /**\n * By default, the first line of code parsed is treated as line 1.\n * You can provide a line number to alternatively start with.\n * Useful for integration with other source tools.\n */\n startLine?: number;\n\n /**\n * By default, the parsed code is treated as if it starts from line 1, column 0.\n * You can provide a column number to alternatively start with.\n * Useful for integration with other source tools.\n */\n startColumn?: number;\n\n /**\n * Array containing the plugins that you want to enable.\n */\n plugins?: Plugin[];\n\n /**\n * Should the parser work in strict mode.\n * Defaults to true if sourceType === 'module'. Otherwise, false.\n */\n strictMode?: boolean;\n\n /**\n * Adds a ranges property to each node: [node.start, node.end]\n */\n ranges?: boolean;\n\n /**\n * Adds all parsed tokens to a tokens property on the File node.\n */\n tokens?: boolean;\n\n /**\n * By default, the parser adds information about parentheses by setting\n * `extra.parenthesized` to `true` as needed.\n * When this option is `true` the parser creates `ParenthesizedExpression`\n * AST nodes instead of using the `extra` property.\n */\n createParenthesizedExpressions?: boolean;\n\n /**\n * The default is false in Babel 7 and true in Babel 8\n * Set this to true to parse it as an `ImportExpression` node.\n * Otherwise `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.\n */\n createImportExpressions?: boolean;\n}\n\nexport const enum OptionFlags {\n AllowAwaitOutsideFunction = 1 << 0,\n AllowReturnOutsideFunction = 1 << 1,\n AllowNewTargetOutsideFunction = 1 << 2,\n AllowImportExportEverywhere = 1 << 3,\n AllowSuperOutsideMethod = 1 << 4,\n AllowYieldOutsideFunction = 1 << 5,\n AllowUndeclaredExports = 1 << 6,\n Ranges = 1 << 7,\n Tokens = 1 << 8,\n CreateImportExpressions = 1 << 9,\n CreateParenthesizedExpressions = 1 << 10,\n ErrorRecovery = 1 << 11,\n AttachComment = 1 << 12,\n AnnexB = 1 << 13,\n}\n\ntype KeepOptionalKeys = \"sourceFilename\" | \"strictMode\";\nexport type OptionsWithDefaults = Omit, KeepOptionalKeys> &\n Pick;\n\nfunction createDefaultOptions(): OptionsWithDefaults {\n return {\n // Source type (\"script\" or \"module\") for different semantics\n sourceType: \"script\",\n // Source filename.\n sourceFilename: undefined,\n // Index (0-based) from which to start counting source. Useful for\n // integration with other tools.\n startIndex: 0,\n // Column (0-based) from which to start counting source. Useful for\n // integration with other tools.\n startColumn: 0,\n // Line (1-based) from which to start counting source. Useful for\n // integration with other tools.\n startLine: 1,\n // When enabled, await at the top level is not considered an\n // error.\n allowAwaitOutsideFunction: false,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, new.target outside a function or class is not\n // considered an error.\n allowNewTargetOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // When enabled, super outside a method is not considered an error.\n allowSuperOutsideMethod: false,\n // When enabled, export statements can reference undeclared variables.\n allowUndeclaredExports: false,\n allowYieldOutsideFunction: false,\n // An array of plugins to enable\n plugins: [],\n // TODO\n strictMode: undefined,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // Adds all parsed tokens to a `tokens` property on the `File` node\n tokens: false,\n // Whether to create ImportExpression AST nodes (if false\n // `import(foo)` will be parsed as CallExpression(Import, [Identifier(foo)])\n createImportExpressions: process.env.BABEL_8_BREAKING ? true : false,\n // Whether to create ParenthesizedExpression AST nodes (if false\n // the parser sets extra.parenthesized on the expression nodes instead).\n createParenthesizedExpressions: false,\n // When enabled, errors are attached to the AST instead of being directly thrown.\n // Some errors will still throw, because @babel/parser can't always recover.\n errorRecovery: false,\n // When enabled, comments will be attached to adjacent AST nodes as one of\n // `leadingComments`, `trailingComments` and `innerComments`. The comment attachment\n // is vital to preserve comments after transform. If you don't print AST back,\n // consider set this option to `false` for performance\n attachComment: true,\n // When enabled, the parser will support Annex B syntax.\n // https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers\n annexB: true,\n };\n}\n\n// Interpret and default an options object\n\nexport function getOptions(opts?: Options | null): OptionsWithDefaults {\n // https://github.com/babel/babel/pull/16918\n // `options` is accessed frequently, please make sure it is a fast object.\n // `%ToFastProperties` can make it a fast object, but the performance is the same as the slow object.\n const options: any = createDefaultOptions();\n\n if (opts == null) {\n return options;\n }\n if (opts.annexB != null && opts.annexB !== false) {\n throw new Error(\"The `annexB` option can only be set to `false`.\");\n }\n\n for (const key of Object.keys(options) as (keyof Options)[]) {\n if (opts[key] != null) options[key] = opts[key];\n }\n\n if (options.startLine === 1) {\n if (opts.startIndex == null && options.startColumn > 0) {\n options.startIndex = options.startColumn;\n } else if (opts.startColumn == null && options.startIndex > 0) {\n options.startColumn = options.startIndex;\n }\n } else if (opts.startColumn == null || opts.startIndex == null) {\n if (opts.startIndex != null || process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"With a `startLine > 1` you must also specify `startIndex` and `startColumn`.\",\n );\n }\n }\n\n if (options.sourceType === \"commonjs\") {\n if (opts.allowAwaitOutsideFunction != null) {\n throw new Error(\n \"The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.\",\n );\n }\n if (opts.allowReturnOutsideFunction != null) {\n throw new Error(\n \"`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.\",\n );\n }\n if (opts.allowNewTargetOutsideFunction != null) {\n throw new Error(\n \"`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.\",\n );\n }\n }\n\n return options;\n}\n","import type { TokenType } from \"../tokenizer/types.ts\";\nimport type Parser from \"../parser/index.ts\";\nimport type * as N from \"../types.ts\";\nimport type { Node as NodeType, NodeBase } from \"../types.ts\";\nimport type { Position } from \"../util/location.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { BindingFlag } from \"../util/scopeflags.ts\";\nimport { OptionFlags } from \"../options.ts\";\nimport type { ExpressionErrors } from \"../parser/util.ts\";\nimport type { ParseResult, File } from \"../index.ts\";\n\nconst { defineProperty } = Object;\nconst toUnenumerable = (object: any, key: string) => {\n if (object) {\n defineProperty(object, key, { enumerable: false, value: object[key] });\n }\n};\n\nfunction toESTreeLocation(node: any) {\n toUnenumerable(node.loc.start, \"index\");\n toUnenumerable(node.loc.end, \"index\");\n\n return node;\n}\n\nexport default (superClass: typeof Parser) =>\n class ESTreeParserMixin extends superClass implements Parser {\n parse(): ParseResult {\n const file = toESTreeLocation(super.parse());\n\n if (this.optionFlags & OptionFlags.Tokens) {\n file.tokens = file.tokens.map(toESTreeLocation);\n }\n\n return file;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseRegExpLiteral({ pattern, flags }): N.EstreeRegExpLiteral {\n let regex: RegExp | null = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (_) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n let bigInt: bigint | null;\n try {\n bigInt = BigInt(value);\n } catch {\n bigInt = null;\n }\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseDecimalLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/experimental/decimal.md\n // todo: use BigDecimal when node supports it.\n const decimal: null = null;\n const node = this.estreeParseLiteral(decimal);\n node.decimal = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any) {\n // @ts-expect-error ESTree plugin changes node types\n return this.parseLiteral(value, \"Literal\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseStringLiteral(value: any): N.Node {\n return this.estreeParseLiteral(value);\n }\n\n parseNumericLiteral(value: any): any {\n return this.estreeParseLiteral(value);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n parseNullLiteral(): N.Node {\n return this.estreeParseLiteral(null);\n }\n\n parseBooleanLiteral(value: boolean): N.BooleanLiteral {\n // @ts-expect-error ESTree plugin changes node types\n return this.estreeParseLiteral(value);\n }\n\n // https://github.com/estree/estree/blob/master/es2020.md#chainexpression\n estreeParseChainExpression(\n node: N.Expression,\n endLoc: Position,\n ): N.EstreeChainExpression {\n const chain = this.startNodeAtNode(node);\n chain.expression = node;\n return this.finishNodeAt(chain, \"ChainExpression\", endLoc);\n }\n\n // Cast a Directive to an ExpressionStatement. Mutates the input Directive.\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const expression = directive.value as any as N.EstreeLiteral;\n // @ts-expect-error delete non-optional properties\n delete directive.value;\n\n this.castNodeTo(expression, \"Literal\");\n expression.raw = expression.extra!.raw;\n expression.value = expression.extra!.expressionValue;\n\n const stmt = this.castNodeTo(directive, \"ExpressionStatement\");\n stmt.expression = expression;\n stmt.directive = expression.extra!.rawValue;\n\n delete expression.extra;\n\n return stmt;\n }\n\n /**\n * The TS-ESLint always define optional AST properties, here we provide the\n * default value for such properties immediately after `finishNode` was invoked.\n * This hook will be implemented by the typescript plugin.\n *\n * Note: This hook should be manually invoked when we change the `type` of a given AST\n * node, to ensure that the optional properties are correctly filled.\n * @param node The AST node finished by finishNode\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n fillOptionalPropertiesForTSESLint(node: NodeType) {}\n\n cloneEstreeStringLiteral(node: N.EstreeLiteral): N.EstreeLiteral {\n const { start, end, loc, range, raw, value } = node;\n const cloned = Object.create(node.constructor.prototype);\n cloned.type = \"Literal\";\n cloned.start = start;\n cloned.end = end;\n cloned.loc = loc;\n cloned.range = range;\n cloned.raw = raw;\n cloned.value = value;\n return cloned;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(node: N.BodilessFunctionOrMethodBase, isAsync: boolean): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (node != null && this.isObjectProperty(node)) {\n // @ts-expect-error plugin typings\n this.checkDeclaration((node as unknown as N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n getObjectOrClassMethodParams(method: N.ObjectMethod | N.ClassMethod) {\n return (method as unknown as N.EstreeMethodDefinition).value.params;\n }\n\n isValidDirective(stmt: N.Statement): stmt is N.ExpressionStatement {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n !stmt.expression.extra?.parenthesized\n );\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: boolean | undefined | null,\n topLevel: boolean,\n end: TokenType,\n afterBlockParse?: (hasStrictModeDirective: boolean) => void,\n ): void {\n super.parseBlockBody(\n node,\n allowDirectives,\n topLevel,\n end,\n afterBlockParse,\n );\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n // @ts-expect-error estree plugin typings\n node.body = directiveStatements.concat(node.body);\n // @ts-expect-error delete non-optional properties\n delete node.directives;\n }\n\n parsePrivateName(): any {\n const node = super.parsePrivateName();\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return node;\n }\n }\n return this.convertPrivateNameToPrivateIdentifier(node);\n }\n\n convertPrivateNameToPrivateIdentifier(\n node: N.PrivateName,\n ): N.EstreePrivateIdentifier {\n const name = super.getPrivateNameSV(node);\n // @ts-expect-error delete non-optional properties\n delete node.id;\n // @ts-expect-error mutate AST types\n node.name = name;\n return this.castNodeTo(node, \"PrivateIdentifier\");\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isPrivateName(node: N.Node): node is N.EstreePrivateIdentifier {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.isPrivateName(node);\n }\n }\n return node.type === \"PrivateIdentifier\";\n }\n\n // @ts-expect-error ESTree plugin changes node types\n getPrivateNameSV(node: N.EstreePrivateIdentifier): string {\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return super.getPrivateNameSV(node as unknown as N.PrivateName);\n }\n }\n return node.name;\n }\n\n // @ts-expect-error plugin may override interfaces\n parseLiteral(value: any, type: T[\"type\"]): T {\n const node = super.parseLiteral(value, type);\n // @ts-expect-error mutating AST types\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression?: boolean | null,\n isMethod: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n // @ts-expect-error plugin may override interfaces\n parseMethod<\n T extends N.ClassPrivateMethod | N.ObjectMethod | N.ClassMethod,\n >(\n node: Undone,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: T[\"type\"],\n inClassScope: boolean = false,\n ):\n | N.EstreeProperty\n | N.EstreeMethodDefinition\n | N.EstreeTSAbstractMethodDefinition {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n // @ts-expect-error delete non-optional properties\n delete funcNode.kind;\n const { typeParameters } = node;\n if (typeParameters) {\n delete node.typeParameters;\n funcNode.typeParameters = typeParameters;\n this.resetStartLocationFromNode(funcNode, typeParameters);\n }\n const valueNode = this.castNodeTo(\n funcNode as N.MethodLike,\n process.env.BABEL_8_BREAKING &&\n this.hasPlugin(\"typescript\") &&\n !funcNode.body\n ? \"TSEmptyBodyFunctionExpression\"\n : \"FunctionExpression\",\n );\n (\n node as unknown as Undone<\n | N.EstreeProperty\n | N.EstreeMethodDefinition\n | N.EstreeTSAbstractMethodDefinition\n >\n ).value = valueNode;\n if (type === \"ClassPrivateMethod\") {\n node.computed = false;\n }\n if (process.env.BABEL_8_BREAKING && this.hasPlugin(\"typescript\")) {\n // @ts-expect-error todo(flow->ts) property not defined for all types in union\n if (node.abstract) {\n // @ts-expect-error remove abstract from TSAbstractMethodDefinition\n delete node.abstract;\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"TSAbstractMethodDefinition\",\n );\n }\n }\n if (type === \"ObjectMethod\") {\n if ((node as any as N.ObjectMethod).kind === \"method\") {\n (node as any as N.EstreeProperty).kind = \"init\";\n }\n (node as any as N.EstreeProperty).shorthand = false;\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"Property\",\n );\n } else {\n return this.finishNode(\n // @ts-expect-error cast methods to estree types\n node as Undone,\n \"MethodDefinition\",\n );\n }\n }\n\n nameIsConstructor(key: N.Expression | N.PrivateName): boolean {\n if (key.type === \"Literal\") return key.value === \"constructor\";\n return super.nameIsConstructor(key);\n }\n\n parseClassProperty(...args: [N.ClassProperty]): any {\n const propertyNode = super.parseClassProperty(...args);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as unknown as N.EstreePropertyDefinition;\n }\n }\n if (\n process.env.BABEL_8_BREAKING &&\n propertyNode.abstract &&\n this.hasPlugin(\"typescript\")\n ) {\n delete propertyNode.abstract;\n this.castNodeTo(propertyNode, \"TSAbstractPropertyDefinition\");\n } else {\n this.castNodeTo(propertyNode, \"PropertyDefinition\");\n }\n return propertyNode;\n }\n\n parseClassPrivateProperty(...args: [N.ClassPrivateProperty]): any {\n const propertyNode = super.parseClassPrivateProperty(...args);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return propertyNode as unknown as N.EstreePropertyDefinition;\n }\n }\n if (\n process.env.BABEL_8_BREAKING &&\n propertyNode.abstract &&\n this.hasPlugin(\"typescript\")\n ) {\n this.castNodeTo(propertyNode, \"TSAbstractPropertyDefinition\");\n } else {\n this.castNodeTo(propertyNode, \"PropertyDefinition\");\n }\n propertyNode.computed = false;\n return propertyNode;\n }\n\n parseClassAccessorProperty(\n this: Parser,\n node: N.ClassAccessorProperty,\n ): any {\n const accessorPropertyNode = super.parseClassAccessorProperty(node);\n if (!process.env.BABEL_8_BREAKING) {\n if (!this.getPluginOption(\"estree\", \"classFeatures\")) {\n return accessorPropertyNode;\n }\n }\n if (accessorPropertyNode.abstract && this.hasPlugin(\"typescript\")) {\n delete accessorPropertyNode.abstract;\n this.castNodeTo(accessorPropertyNode, \"TSAbstractAccessorProperty\");\n } else {\n this.castNodeTo(accessorPropertyNode, \"AccessorProperty\");\n }\n return accessorPropertyNode;\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startLoc: Position | undefined | null,\n isPattern: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ObjectProperty | undefined | null {\n const node: N.EstreeProperty = super.parseObjectProperty(\n prop,\n startLoc,\n isPattern,\n refExpressionErrors,\n ) as any;\n\n if (node) {\n node.kind = \"init\";\n this.castNodeTo(node, \"Property\");\n }\n\n return node as any;\n }\n\n finishObjectProperty(node: Undone): N.ObjectProperty {\n (node as unknown as Undone).kind = \"init\";\n return this.finishNode(\n node as unknown as Undone,\n \"Property\",\n ) as any;\n }\n\n isValidLVal(\n type: string,\n disallowCallExpression: boolean,\n isUnparenthesizedInAssign: boolean,\n binding: BindingFlag,\n ) {\n return type === \"Property\"\n ? \"value\"\n : super.isValidLVal(\n type,\n disallowCallExpression,\n isUnparenthesizedInAssign,\n binding,\n );\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node != null && this.isObjectProperty(node)) {\n return this.isAssignable(node.value, isBinding);\n }\n return super.isAssignable(node, isBinding);\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (node != null && this.isObjectProperty(node)) {\n const { key, value } = node;\n if (this.isPrivateName(key)) {\n this.classScope.usePrivateName(\n this.getPrivateNameSV(key),\n key.loc.start,\n );\n }\n this.toAssignable(value, isLHS);\n } else {\n super.toAssignable(node, isLHS);\n }\n }\n\n toAssignableObjectExpressionProp(\n prop: N.Node,\n isLast: boolean,\n isLHS: boolean,\n ) {\n if (\n prop.type === \"Property\" &&\n (prop.kind === \"get\" || prop.kind === \"set\")\n ) {\n this.raise(Errors.PatternHasAccessor, prop.key);\n } else if (prop.type === \"Property\" && prop.method) {\n this.raise(Errors.PatternHasMethod, prop.key);\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast, isLHS);\n }\n }\n\n finishCallExpression(\n unfinished: Undone,\n optional: boolean,\n ): T {\n const node = super.finishCallExpression(unfinished, optional);\n\n if (node.callee.type === \"Import\") {\n this.castNodeTo(node, \"ImportExpression\");\n (node as N.Node as N.EstreeImportExpression).source = node\n .arguments[0] as N.Expression;\n (node as N.Node as N.EstreeImportExpression).options =\n (node.arguments[1] as N.Expression) ?? null;\n if (!process.env.BABEL_8_BREAKING) {\n // compatibility with previous ESTree AST\n (node as N.Node as N.EstreeImportExpression).attributes =\n (node.arguments[1] as N.Expression) ?? null;\n }\n // arguments isn't optional in the type definition\n // @ts-expect-error delete non-optional properties\n delete node.arguments;\n // callee isn't optional in the type definition\n // @ts-expect-error delete non-optional properties\n delete node.callee;\n } else if (node.type === \"OptionalCallExpression\") {\n this.castNodeTo(node, \"CallExpression\");\n } else {\n node.optional = false;\n }\n\n return node;\n }\n\n toReferencedArguments(\n node:\n | N.CallExpression\n | N.OptionalCallExpression\n | N.EstreeImportExpression,\n /* isParenthesizedExpr?: boolean, */\n ) {\n // ImportExpressions do not have an arguments array.\n if (node.type === \"ImportExpression\") {\n return;\n }\n\n super.toReferencedArguments(node);\n }\n\n parseExport(\n unfinished: Undone,\n decorators: N.Decorator[] | null,\n ) {\n const exportStartLoc = this.state.lastTokStartLoc!;\n const node = super.parseExport(unfinished, decorators);\n\n switch (node.type) {\n case \"ExportAllDeclaration\":\n // @ts-expect-error mutating AST types\n node.exported = null;\n break;\n\n case \"ExportNamedDeclaration\":\n if (\n node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ExportNamespaceSpecifier\"\n ) {\n this.castNodeTo(node, \"ExportAllDeclaration\");\n // @ts-expect-error mutating AST types\n node.exported = node.specifiers[0].exported;\n // @ts-expect-error The ESTree AST shape differs from the Babel AST\n delete node.specifiers;\n }\n\n // fallthrough\n case \"ExportDefaultDeclaration\":\n {\n const { declaration } = node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n // @ts-expect-error comparing undefined and number\n declaration.decorators?.length > 0 &&\n // decorator comes before export\n declaration.start === node.start\n ) {\n this.resetStartLocation(\n node,\n // For compatibility with ESLint's keyword-spacing rule, which assumes that an\n // export declaration must start with export.\n // https://github.com/babel/babel/issues/15085\n // Here we reset export declaration's start to be the start of the export token\n exportStartLoc,\n );\n }\n }\n\n break;\n }\n\n return node;\n }\n\n stopParseSubscript(base: N.Expression, state: N.ParseSubscriptState) {\n const node = super.stopParseSubscript(base, state);\n if (state.optionalChainMember) {\n return this.estreeParseChainExpression(node, base.loc.end);\n }\n return node;\n }\n\n parseMember(\n base: N.Expression,\n startLoc: Position,\n state: N.ParseSubscriptState,\n computed: boolean,\n optional: boolean,\n ) {\n const node = super.parseMember(base, startLoc, state, computed, optional);\n if (node.type === \"OptionalMemberExpression\") {\n this.castNodeTo(node, \"MemberExpression\");\n } else {\n node.optional = false;\n }\n return node;\n }\n\n isOptionalMemberExpression(node: N.Node) {\n if (node.type === \"ChainExpression\") {\n return node.expression.type === \"MemberExpression\";\n }\n return super.isOptionalMemberExpression(node);\n }\n\n hasPropertyAsPrivateName(node: N.Node): boolean {\n if (node.type === \"ChainExpression\") {\n node = node.expression;\n }\n return super.hasPropertyAsPrivateName(node);\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectProperty(node: N.Node): node is N.EstreeProperty {\n return node.type === \"Property\" && node.kind === \"init\" && !node.method;\n }\n\n // @ts-expect-error ESTree plugin changes node types\n isObjectMethod(node: N.Node): node is N.EstreeProperty {\n return (\n node.type === \"Property\" &&\n (node.method || node.kind === \"get\" || node.kind === \"set\")\n );\n }\n\n /* ============================================================ *\n * parser/node.ts *\n * ============================================================ */\n\n castNodeTo(\n node: N.Node,\n type: T,\n ): Extract {\n const result = super.castNodeTo(node, type);\n this.fillOptionalPropertiesForTSESLint(result);\n return result;\n }\n\n cloneIdentifier(node: T): T {\n const cloned = super.cloneIdentifier(node);\n this.fillOptionalPropertiesForTSESLint(cloned);\n return cloned;\n }\n\n cloneStringLiteral<\n T extends N.EstreeLiteral | N.StringLiteral | N.Placeholder,\n >(node: T): T {\n if (node.type === \"Literal\") {\n return this.cloneEstreeStringLiteral(node) as T;\n }\n return super.cloneStringLiteral(node);\n }\n\n finishNodeAt(\n node: Undone,\n type: T[\"type\"],\n endLoc: Position,\n ): T {\n return toESTreeLocation(super.finishNodeAt(node, type, endLoc));\n }\n\n // Override for TS-ESLint that does not allow optional AST properties\n finishNode(node: Undone, type: T[\"type\"]): T {\n const result = super.finishNode(node, type);\n this.fillOptionalPropertiesForTSESLint(result);\n return result;\n }\n\n resetStartLocation(node: N.Node, startLoc: Position) {\n super.resetStartLocation(node, startLoc);\n toESTreeLocation(node);\n }\n\n resetEndLocation(\n node: NodeBase,\n endLoc: Position = this.state.lastTokEndLoc!,\n ): void {\n super.resetEndLocation(node, endLoc);\n toESTreeLocation(node);\n }\n };\n","// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"...\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n","import { types as tc, type TokContext } from \"./context.ts\";\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between 1) binary\n// expression (<) and JSX Tag start (); 2) object literal and JSX\n// texts. It is set on the `updateContext` function in the JSX plugin.\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string;\n beforeExpr?: boolean;\n startsExpr?: boolean;\n rightAssociative?: boolean;\n isLoop?: boolean;\n isAssign?: boolean;\n prefix?: boolean;\n postfix?: boolean;\n binop?: number | null;\n};\n\n// Internally the tokenizer stores token as a number\nexport type TokenType = number;\n\n// The `ExportedTokenType` is exported via `tokTypes` and accessible\n// when `tokens: true` is enabled. Unlike internal token type, it provides\n// metadata of the tokens.\nexport class ExportedTokenType {\n label: string;\n keyword: string | undefined | null;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: number | undefined | null;\n // todo(Babel 8): remove updateContext from exposed token layout\n declare updateContext:\n | ((context: Array) => void)\n | undefined\n | null;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n if (!process.env.BABEL_8_BREAKING) {\n this.updateContext = null;\n }\n }\n}\n\n// A map from keyword/keyword-like string value to the token type\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = createToken(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return createToken(name, { beforeExpr, binop });\n}\n\nlet tokenTypeCounter = -1;\nexport const tokenTypes: ExportedTokenType[] = [];\nconst tokenLabels: string[] = [];\nconst tokenBinops: number[] = [];\nconst tokenBeforeExprs: boolean[] = [];\nconst tokenStartsExprs: boolean[] = [];\nconst tokenPrefixes: boolean[] = [];\n\nfunction createToken(name: string, options: TokenOptions = {}): TokenType {\n ++tokenTypeCounter;\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n tokenTypes.push(new ExportedTokenType(name, options));\n\n return tokenTypeCounter;\n}\n\nfunction createKeywordLike(\n name: string,\n options: TokenOptions = {},\n): TokenType {\n ++tokenTypeCounter;\n keywords.set(name, tokenTypeCounter);\n tokenLabels.push(name);\n tokenBinops.push(options.binop ?? -1);\n tokenBeforeExprs.push(options.beforeExpr ?? false);\n tokenStartsExprs.push(options.startsExpr ?? false);\n tokenPrefixes.push(options.prefix ?? false);\n // In the exported token type, we set the label as \"name\" for backward compatibility with Babel 7\n tokenTypes.push(new ExportedTokenType(\"name\", options));\n\n return tokenTypeCounter;\n}\n\n// For performance the token type helpers depend on the following declarations order.\n// When adding new token types, please also check if the token helpers need update.\n\nexport type InternalTokenTypes = typeof tt;\n\nexport const tt = {\n // Punctuation token types.\n bracketL: createToken(\"[\", { beforeExpr, startsExpr }),\n // TODO: Remove this in Babel 8\n bracketHashL: createToken(\"#[\", { beforeExpr, startsExpr }),\n // TODO: Remove this in Babel 8\n bracketBarL: createToken(\"[|\", { beforeExpr, startsExpr }),\n bracketR: createToken(\"]\"),\n // TODO: Remove this in Babel 8\n bracketBarR: createToken(\"|]\"),\n braceL: createToken(\"{\", { beforeExpr, startsExpr }),\n // TODO: Remove this in Babel 8\n braceBarL: createToken(\"{|\", { beforeExpr, startsExpr }),\n // TODO: Remove this in Babel 8\n braceHashL: createToken(\"#{\", { beforeExpr, startsExpr }),\n braceR: createToken(\"}\"),\n braceBarR: createToken(\"|}\"),\n parenL: createToken(\"(\", { beforeExpr, startsExpr }),\n parenR: createToken(\")\"),\n comma: createToken(\",\", { beforeExpr }),\n semi: createToken(\";\", { beforeExpr }),\n colon: createToken(\":\", { beforeExpr }),\n doubleColon: createToken(\"::\", { beforeExpr }),\n dot: createToken(\".\"),\n question: createToken(\"?\", { beforeExpr }),\n questionDot: createToken(\"?.\"),\n arrow: createToken(\"=>\", { beforeExpr }),\n template: createToken(\"template\"),\n ellipsis: createToken(\"...\", { beforeExpr }),\n backQuote: createToken(\"`\", { startsExpr }),\n dollarBraceL: createToken(\"${\", { beforeExpr, startsExpr }),\n // start: isTemplate\n templateTail: createToken(\"...`\", { startsExpr }),\n templateNonTail: createToken(\"...${\", { beforeExpr, startsExpr }),\n // end: isTemplate\n at: createToken(\"@\"),\n hash: createToken(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: createToken(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n // start: isAssign\n eq: createToken(\"=\", { beforeExpr, isAssign }),\n assign: createToken(\"_=\", { beforeExpr, isAssign }),\n slashAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // These are only needed to support % and ^ as a Hack-pipe topic token.\n // When the proposal settles on a token, the others can be merged with\n // tt.assign.\n xorAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n moduloAssign: createToken(\"_=\", { beforeExpr, isAssign }),\n // end: isAssign\n\n incDec: createToken(\"++/--\", { prefix, postfix, startsExpr }),\n bang: createToken(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: createToken(\"~\", { beforeExpr, prefix, startsExpr }),\n\n // More possible topic tokens.\n // When the proposal settles on a token, at least one of these may be removed.\n doubleCaret: createToken(\"^^\", { startsExpr }),\n doubleAt: createToken(\"@@\", { startsExpr }),\n\n // start: isBinop\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n lt: createBinop(\"/<=/>=\", 7),\n gt: createBinop(\"/<=/>=\", 7),\n relational: createBinop(\"/<=/>=\", 7),\n bitShift: createBinop(\"<>/>>>\", 8),\n bitShiftL: createBinop(\"<>/>>>\", 8),\n bitShiftR: createBinop(\"<>/>>>\", 8),\n plusMin: createToken(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: createToken(\"%\", { binop: 10, startsExpr }),\n // unset `beforeExpr` as it can be `function *`\n star: createToken(\"*\", { binop: 10 }),\n slash: createBinop(\"/\", 10),\n exponent: createToken(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n // Don't forget to update packages/babel-helper-validator-identifier/src/keyword.js\n // when new keywords are added\n // start: isLiteralPropertyName\n // start: isKeyword\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n // end: isBinop\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n // start: isLoop\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _for: createKeyword(\"for\", { isLoop }),\n _while: createKeyword(\"while\", { isLoop }),\n // end: isLoop\n // end: isKeyword\n\n // Primary literals\n // start: isIdentifier\n _as: createKeywordLike(\"as\", { startsExpr }),\n _assert: createKeywordLike(\"assert\", { startsExpr }),\n _async: createKeywordLike(\"async\", { startsExpr }),\n _await: createKeywordLike(\"await\", { startsExpr }),\n _defer: createKeywordLike(\"defer\", { startsExpr }),\n _from: createKeywordLike(\"from\", { startsExpr }),\n _get: createKeywordLike(\"get\", { startsExpr }),\n _let: createKeywordLike(\"let\", { startsExpr }),\n _meta: createKeywordLike(\"meta\", { startsExpr }),\n _of: createKeywordLike(\"of\", { startsExpr }),\n _sent: createKeywordLike(\"sent\", { startsExpr }),\n _set: createKeywordLike(\"set\", { startsExpr }),\n _source: createKeywordLike(\"source\", { startsExpr }),\n _static: createKeywordLike(\"static\", { startsExpr }),\n _using: createKeywordLike(\"using\", { startsExpr }),\n _yield: createKeywordLike(\"yield\", { startsExpr }),\n\n // Flow and TypeScript Keywordlike\n _asserts: createKeywordLike(\"asserts\", { startsExpr }),\n _checks: createKeywordLike(\"checks\", { startsExpr }),\n _exports: createKeywordLike(\"exports\", { startsExpr }),\n _global: createKeywordLike(\"global\", { startsExpr }),\n _implements: createKeywordLike(\"implements\", { startsExpr }),\n _intrinsic: createKeywordLike(\"intrinsic\", { startsExpr }),\n _infer: createKeywordLike(\"infer\", { startsExpr }),\n _is: createKeywordLike(\"is\", { startsExpr }),\n _mixins: createKeywordLike(\"mixins\", { startsExpr }),\n _proto: createKeywordLike(\"proto\", { startsExpr }),\n _require: createKeywordLike(\"require\", { startsExpr }),\n _satisfies: createKeywordLike(\"satisfies\", { startsExpr }),\n // start: isTSTypeOperator\n _keyof: createKeywordLike(\"keyof\", { startsExpr }),\n _readonly: createKeywordLike(\"readonly\", { startsExpr }),\n _unique: createKeywordLike(\"unique\", { startsExpr }),\n // end: isTSTypeOperator\n // start: isTSDeclarationStart\n _abstract: createKeywordLike(\"abstract\", { startsExpr }),\n _declare: createKeywordLike(\"declare\", { startsExpr }),\n _enum: createKeywordLike(\"enum\", { startsExpr }),\n _module: createKeywordLike(\"module\", { startsExpr }),\n _namespace: createKeywordLike(\"namespace\", { startsExpr }),\n // start: isFlowInterfaceOrTypeOrOpaque\n _interface: createKeywordLike(\"interface\", { startsExpr }),\n _type: createKeywordLike(\"type\", { startsExpr }),\n // end: isTSDeclarationStart\n _opaque: createKeywordLike(\"opaque\", { startsExpr }),\n // end: isFlowInterfaceOrTypeOrOpaque\n name: createToken(\"name\", { startsExpr }),\n\n // placeholder plugin\n placeholder: createToken(\"%%\", { startsExpr }),\n // end: isIdentifier\n\n string: createToken(\"string\", { startsExpr }),\n num: createToken(\"num\", { startsExpr }),\n bigint: createToken(\"bigint\", { startsExpr }),\n // TODO: Remove this in Babel 8\n decimal: createToken(\"decimal\", { startsExpr }),\n // end: isLiteralPropertyName\n regexp: createToken(\"regexp\", { startsExpr }),\n privateName: createToken(\"#name\", { startsExpr }),\n eof: createToken(\"eof\"),\n\n // jsx plugin\n jsxName: createToken(\"jsxName\"),\n jsxText: createToken(\"jsxText\", { beforeExpr }),\n jsxTagStart: createToken(\"jsxTagStart\", { startsExpr }),\n jsxTagEnd: createToken(\"jsxTagEnd\"),\n} as const;\n\nexport function tokenIsIdentifier(token: TokenType): boolean {\n return token >= tt._as && token <= tt.placeholder;\n}\n\nexport function tokenKeywordOrIdentifierIsKeyword(token: TokenType): boolean {\n // we can remove the token >= tt._in check when we\n // know a token is either keyword or identifier\n return token <= tt._while;\n}\n\nexport function tokenIsKeywordOrIdentifier(token: TokenType): boolean {\n return token >= tt._in && token <= tt.placeholder;\n}\n\nexport function tokenIsLiteralPropertyName(token: TokenType): boolean {\n return token >= tt._in && token <= tt.decimal;\n}\n\nexport function tokenComesBeforeExpression(token: TokenType): boolean {\n return tokenBeforeExprs[token];\n}\n\nexport function tokenCanStartExpression(token: TokenType): boolean {\n return tokenStartsExprs[token];\n}\n\nexport function tokenIsAssignment(token: TokenType): boolean {\n return token >= tt.eq && token <= tt.moduloAssign;\n}\n\nexport function tokenIsFlowInterfaceOrTypeOrOpaque(token: TokenType): boolean {\n return token >= tt._interface && token <= tt._opaque;\n}\n\nexport function tokenIsLoop(token: TokenType): boolean {\n return token >= tt._do && token <= tt._while;\n}\n\nexport function tokenIsKeyword(token: TokenType): boolean {\n return token >= tt._in && token <= tt._while;\n}\n\nexport function tokenIsOperator(token: TokenType): boolean {\n return token >= tt.pipeline && token <= tt._instanceof;\n}\n\nexport function tokenIsPostfix(token: TokenType): boolean {\n return token === tt.incDec;\n}\n\nexport function tokenIsPrefix(token: TokenType): boolean {\n return tokenPrefixes[token];\n}\n\nexport function tokenIsTSTypeOperator(token: TokenType): boolean {\n return token >= tt._keyof && token <= tt._unique;\n}\n\nexport function tokenIsTSDeclarationStart(token: TokenType): boolean {\n return token >= tt._abstract && token <= tt._type;\n}\n\nexport function tokenLabelName(token: TokenType): string {\n return tokenLabels[token];\n}\n\nexport function tokenOperatorPrecedence(token: TokenType): number {\n return tokenBinops[token];\n}\n\nexport function tokenIsBinaryOperator(token: TokenType): boolean {\n return tokenBinops[token] !== -1;\n}\n\nexport function tokenIsRightAssociative(token: TokenType): boolean {\n return token === tt.exponent;\n}\n\nexport function tokenIsTemplate(token: TokenType): boolean {\n return token >= tt.templateTail && token <= tt.templateNonTail;\n}\n\nexport function getExportedToken(token: TokenType): ExportedTokenType {\n return tokenTypes[token];\n}\n\nexport function isTokenType(obj: any): boolean {\n return typeof obj === \"number\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n tokenTypes[tt.braceR].updateContext = context => {\n context.pop();\n };\n\n tokenTypes[tt.braceL].updateContext =\n tokenTypes[tt.braceHashL].updateContext =\n tokenTypes[tt.dollarBraceL].updateContext =\n context => {\n context.push(tc.brace);\n };\n\n tokenTypes[tt.backQuote].updateContext = context => {\n if (context[context.length - 1] === tc.template) {\n context.pop();\n } else {\n context.push(tc.template);\n }\n };\n\n tokenTypes[tt.jsxTagStart].updateContext = context => {\n context.push(tc.j_expr, tc.j_oTag);\n };\n}\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.cjs`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.cjs`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(cp)) {\n return false;\n }\n }\n return !isFirst;\n}\n","const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n","import * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n","import { ScopeFlag, BindingFlag } from \"./scopeflags.ts\";\nimport type { Position } from \"./location.ts\";\nimport type * as N from \"../types.ts\";\nimport { Errors } from \"../parse-error.ts\";\nimport type Tokenizer from \"../tokenizer/index.ts\";\n\nexport const enum NameType {\n // var-declared names in the current lexical scope\n Var = 1 << 0,\n // lexically-declared names in the current lexical scope\n Lexical = 1 << 1,\n // lexically-declared FunctionDeclaration names in the current lexical scope\n Function = 1 << 2,\n}\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlag = 0;\n names: Map = new Map();\n firstLexicalName = \"\";\n\n constructor(flags: ScopeFlag) {\n this.flags = flags;\n }\n}\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n parser: Tokenizer;\n scopeStack: Array = [];\n inModule: boolean;\n undefinedExports: Map = new Map();\n\n constructor(parser: Tokenizer, inModule: boolean) {\n this.parser = parser;\n this.inModule = inModule;\n }\n\n get inTopLevel() {\n return (this.currentScope().flags & ScopeFlag.PROGRAM) > 0;\n }\n get inFunction() {\n return (this.currentVarScopeFlags() & ScopeFlag.FUNCTION_BASE) > 0;\n }\n get allowSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScopeFlags() & ScopeFlag.DIRECT_SUPER) > 0;\n }\n get allowNewTarget() {\n return (this.currentThisScopeFlags() & ScopeFlag.NEW_TARGET) > 0;\n }\n get inClass() {\n return (this.currentThisScopeFlags() & ScopeFlag.CLASS_BASE) > 0;\n }\n get inClassAndNotInNonArrowFunction() {\n const flags = this.currentThisScopeFlags();\n return (\n (flags & ScopeFlag.CLASS_BASE) > 0 &&\n (flags & ScopeFlag.FUNCTION_BASE) === 0\n );\n }\n get inStaticBlock() {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.STATIC_BLOCK) {\n return true;\n }\n if (flags & (ScopeFlag.VAR | ScopeFlag.CLASS_BASE)) {\n // function body, module body, class property initializers\n return false;\n }\n }\n }\n get inNonArrowFunction() {\n return (this.currentThisScopeFlags() & ScopeFlag.FUNCTION_BASE) > 0;\n }\n get inBareCaseStatement() {\n return (this.currentScope().flags & ScopeFlag.SWITCH) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlag): Scope {\n return new Scope(flags);\n }\n\n enter(flags: ScopeFlag) {\n /*:: +createScope: (flags:ScopeFlag) => IScope; */\n // @ts-expect-error This method will be overwritten by subclasses\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit(): ScopeFlag {\n const scope = this.scopeStack.pop()!;\n return scope.flags;\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & (ScopeFlag.FUNCTION_BASE | ScopeFlag.STATIC_BLOCK) ||\n (!this.parser.inModule && scope.flags & ScopeFlag.PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n let scope = this.currentScope();\n if (\n bindingType & BindingFlag.SCOPE_LEXICAL ||\n bindingType & BindingFlag.SCOPE_FUNCTION\n ) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n\n let type = scope.names.get(name) || 0;\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n type = type | NameType.Function;\n } else {\n if (!scope.firstLexicalName) {\n scope.firstLexicalName = name;\n }\n type = type | NameType.Lexical;\n }\n\n scope.names.set(name, type);\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BindingFlag.SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n scope.names.set(name, (scope.names.get(name) || 0) | NameType.Var);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & ScopeFlag.VAR) break;\n }\n }\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.parser.inModule && scope.flags & ScopeFlag.PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n loc: Position,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.parser.raise(Errors.VarRedeclaration, loc, {\n identifierName: name,\n });\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (!(bindingType & BindingFlag.KIND_VALUE)) return false;\n\n if (bindingType & BindingFlag.SCOPE_LEXICAL) {\n return scope.names.has(name);\n }\n\n const type = scope.names.get(name) || 0;\n\n if (bindingType & BindingFlag.SCOPE_FUNCTION) {\n return (\n (type & NameType.Lexical) > 0 ||\n (!this.treatFunctionsAsVarInScope(scope) && (type & NameType.Var) > 0)\n );\n }\n\n return (\n ((type & NameType.Lexical) > 0 &&\n // Annex B.3.4\n // https://tc39.es/ecma262/#sec-variablestatements-in-catch-blocks\n !(\n scope.flags & ScopeFlag.SIMPLE_CATCH &&\n scope.firstLexicalName === name\n )) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n (type & NameType.Function) > 0)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n const topLevelScope = this.scopeStack[0];\n if (!topLevelScope.names.has(name)) {\n this.undefinedExports.set(name, id.loc.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n currentVarScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (flags & ScopeFlag.VAR) {\n return flags;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n currentThisScopeFlags(): ScopeFlag {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const { flags } = this.scopeStack[i];\n if (\n flags & (ScopeFlag.VAR | ScopeFlag.CLASS_BASE) &&\n !(flags & ScopeFlag.ARROW)\n ) {\n return flags;\n }\n }\n }\n}\n","import type { Position } from \"../../util/location.ts\";\nimport ScopeHandler, { NameType, Scope } from \"../../util/scope.ts\";\nimport { BindingFlag, type ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type * as N from \"../../types.ts\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlag): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (\n bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN &&\n !scope.declareFunctions.has(name)\n ) {\n const type = scope.names.get(name)!;\n return (type & NameType.Function) > 0 || (type & NameType.Lexical) > 0;\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n","/*:: declare var invariant; */\n\nimport type Parser from \"../../parser/index.ts\";\nimport {\n tokenIsIdentifier,\n tokenIsKeyword,\n tokenIsKeywordOrIdentifier,\n tokenIsLiteralPropertyName,\n tokenLabelName,\n tt,\n type TokenType,\n tokenIsFlowInterfaceOrTypeOrOpaque,\n} from \"../../tokenizer/types.ts\";\nimport type * as N from \"../../types.ts\";\nimport type { Position } from \"../../util/location.ts\";\nimport { types as tc } from \"../../tokenizer/context.ts\";\nimport * as charCodes from \"charcodes\";\nimport { isIteratorStart } from \"../../util/identifier.ts\";\nimport FlowScopeHandler from \"./scope.ts\";\nimport { BindingFlag, ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type { ExpressionErrors } from \"../../parser/util.ts\";\nimport type { ParseStatementFlag } from \"../../parser/statement.ts\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error.ts\";\nimport type { Undone } from \"../../parser/node.ts\";\nimport type { ClassWithMixin, IJSXParserMixin } from \"../jsx/index.ts\";\n\nconst reservedTypes = new Set([\n \"_\",\n \"any\",\n \"bool\",\n \"boolean\",\n \"empty\",\n \"extends\",\n \"false\",\n \"interface\",\n \"mixed\",\n \"null\",\n \"number\",\n \"static\",\n \"string\",\n \"true\",\n \"typeof\",\n \"void\",\n]);\n\n/* eslint sort-keys: \"error\" */\n// The Errors key follows https://github.com/facebook/flow/blob/master/src/parser/parse_error.ml unless it does not exist\nconst FlowErrors = ParseErrorEnum`flow`({\n AmbiguousConditionalArrow:\n \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n AmbiguousDeclareModuleKind:\n \"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.\",\n // TODO: When we get proper string enums in typescript make this ReservedType.\n // Not really worth it to do the whole $Values dance with reservedTypes set.\n AssignReservedType: ({ reservedType }: { reservedType: string }) =>\n `Cannot overwrite reserved type ${reservedType}.`,\n DeclareClassElement:\n \"The `declare` modifier can only appear on class fields.\",\n DeclareClassFieldInitializer:\n \"Initializers are not allowed in fields with the `declare` modifier.\",\n DuplicateDeclareModuleExports:\n \"Duplicate `declare module.exports` statement.\",\n EnumBooleanMemberNotInitialized: ({\n memberName,\n enumName,\n }: {\n memberName: string;\n enumName: string;\n }) =>\n `Boolean enum members need to be initialized. Use either \\`${memberName} = true,\\` or \\`${memberName} = false,\\` in enum \\`${enumName}\\`.`,\n EnumDuplicateMemberName: ({\n memberName,\n enumName,\n }: {\n memberName: string;\n enumName: string;\n }) =>\n `Enum member names need to be unique, but the name \\`${memberName}\\` has already been used before in enum \\`${enumName}\\`.`,\n EnumInconsistentMemberValues: ({ enumName }: { enumName: string }) =>\n `Enum \\`${enumName}\\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,\n EnumInvalidExplicitType: ({\n invalidEnumType,\n enumName,\n }: {\n invalidEnumType: string;\n enumName: string;\n }) =>\n `Enum type \\`${invalidEnumType}\\` is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n EnumInvalidExplicitTypeUnknownSupplied: ({\n enumName,\n }: {\n enumName: string;\n }) =>\n `Supplied enum type is not valid. Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in enum \\`${enumName}\\`.`,\n\n // TODO: When moving to typescript, we should either have each of the\n // following errors only accept the specific strings they want:\n //\n // ...PrimaryType: explicitType: \"string\" | \"number\" | \"boolean\"\n // ...SymbolType: explicitType: \"symbol\"\n // ...UnknownType: explicitType: null\n //\n // Or, alternatively, merge these three errors together into one\n // `EnumInvalidMemberInitializer` error that can accept `EnumExplicitType`\n // without alteration, and then just have its message change based on the\n // explicitType.\n EnumInvalidMemberInitializerPrimaryType: ({\n enumName,\n memberName,\n explicitType,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `Enum \\`${enumName}\\` has type \\`${explicitType}\\`, so the initializer of \\`${memberName}\\` needs to be a ${explicitType} literal.`,\n EnumInvalidMemberInitializerSymbolType: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `Symbol enum members cannot be initialized. Use \\`${memberName},\\` in enum \\`${enumName}\\`.`,\n EnumInvalidMemberInitializerUnknownType: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n explicitType: EnumExplicitType;\n }) =>\n `The enum member initializer for \\`${memberName}\\` needs to be a literal (either a boolean, number, or string) in enum \\`${enumName}\\`.`,\n EnumInvalidMemberName: ({\n enumName,\n memberName,\n suggestion,\n }: {\n enumName: string;\n memberName: string;\n suggestion: string;\n }) =>\n `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \\`${memberName}\\`, consider using \\`${suggestion}\\`, in enum \\`${enumName}\\`.`,\n EnumNumberMemberNotInitialized: ({\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n }) =>\n `Number enum members need to be initialized, e.g. \\`${memberName} = 1\\` in enum \\`${enumName}\\`.`,\n EnumStringMemberInconsistentlyInitialized: ({\n enumName,\n }: {\n enumName: string;\n }) =>\n `String enum members need to consistently either all use initializers, or use no initializers, in enum \\`${enumName}\\`.`,\n GetterMayNotHaveThisParam: \"A getter cannot have a `this` parameter.\",\n ImportReflectionHasImportType:\n \"An `import module` declaration can not use `type` or `typeof` keyword.\",\n ImportTypeShorthandOnlyInPureImport:\n \"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.\",\n InexactInsideExact:\n \"Explicit inexact syntax cannot appear inside an explicit exact object type.\",\n InexactInsideNonObject:\n \"Explicit inexact syntax cannot appear in class or interface definitions.\",\n InexactVariance: \"Explicit inexact syntax cannot have variance.\",\n InvalidNonTypeImportInDeclareModule:\n \"Imports within a `declare module` body must always be `import type` or `import typeof`.\",\n MissingTypeParamDefault:\n \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n NestedDeclareModule:\n \"`declare module` cannot be used inside another `declare module`.\",\n NestedFlowComment: \"Cannot have a flow comment inside another flow comment.\",\n PatternIsOptional: {\n message:\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n // For consistency in TypeScript and Flow error codes\n ...(!process.env.BABEL_8_BREAKING\n ? { reasonCode: \"OptionalBindingPattern\" }\n : {}),\n },\n SetterMayNotHaveThisParam: \"A setter cannot have a `this` parameter.\",\n SpreadVariance: \"Spread properties cannot have variance.\",\n ThisParamAnnotationRequired:\n \"A type annotation is required for the `this` parameter.\",\n ThisParamBannedInConstructor:\n \"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.\",\n ThisParamMayNotBeOptional: \"The `this` parameter cannot be optional.\",\n ThisParamMustBeFirst:\n \"The `this` parameter must be the first function parameter.\",\n ThisParamNoDefault: \"The `this` parameter may not have a default value.\",\n TypeBeforeInitializer:\n \"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.\",\n TypeCastInPattern:\n \"The type cast expression is expected to be wrapped with parenthesis.\",\n UnexpectedExplicitInexactInObject:\n \"Explicit inexact syntax must appear at the end of an inexact object.\",\n UnexpectedReservedType: ({ reservedType }: { reservedType: string }) =>\n `Unexpected reserved type ${reservedType}.`,\n UnexpectedReservedUnderscore:\n \"`_` is only allowed as a type argument to call or new.\",\n UnexpectedSpaceBetweenModuloChecks:\n \"Spaces between `%` and `checks` are not allowed here.\",\n UnexpectedSpreadType:\n \"Spread operator cannot appear in class or interface definitions.\",\n UnexpectedSubtractionOperand:\n 'Unexpected token, expected \"number\" or \"bigint\".',\n UnexpectedTokenAfterTypeParameter:\n \"Expected an arrow function after this type parameter declaration.\",\n UnexpectedTypeParameterBeforeAsyncArrowFunction:\n \"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.\",\n UnsupportedDeclareExportKind: ({\n unsupportedExportKind,\n suggestion,\n }: {\n unsupportedExportKind: string;\n suggestion: string;\n }) =>\n `\\`declare export ${unsupportedExportKind}\\` is not supported. Use \\`${suggestion}\\` instead.`,\n UnsupportedStatementInDeclareModule:\n \"Only declares and type imports are allowed inside declare module.\",\n UnterminatedFlowComment: \"Unterminated flow-comment.\",\n});\n/* eslint-disable sort-keys */\n\nfunction isEsModuleType(bodyElement: N.Node): boolean {\n return (\n bodyElement.type === \"DeclareExportAllDeclaration\" ||\n (bodyElement.type === \"DeclareExportDeclaration\" &&\n (!bodyElement.declaration ||\n (bodyElement.declaration.type !== \"TypeAlias\" &&\n bodyElement.declaration.type !== \"InterfaceDeclaration\")))\n );\n}\n\nfunction hasTypeImportKind(\n node: Undone,\n): boolean {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\n\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\",\n};\n\n// Like Array#filter, but returns a tuple [ acceptedElements, discardedElements ]\nfunction partition(\n list: T[],\n test: (c: T, b: number, a: T[]) => boolean | undefined | null,\n): [T[], T[]] {\n const list1: T[] = [];\n const list2: T[] = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\n\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\n// Flow enums types\ntype EnumExplicitType = null | \"boolean\" | \"number\" | \"string\" | \"symbol\";\n\ntype EnumContext = {\n enumName: string;\n explicitType: EnumExplicitType;\n memberName: string;\n};\n\ntype EnumMemberInit =\n | {\n type: \"number\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"string\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"boolean\";\n loc: Position;\n value: N.Node;\n }\n | {\n type: \"invalid\";\n loc: Position;\n }\n | {\n type: \"none\";\n loc: Position;\n };\n\nexport default (superClass: ClassWithMixin) =>\n class FlowParserMixin extends superClass implements Parser {\n // The value of the @flow/@noflow pragma. Initially undefined, transitions\n // to \"@flow\" or \"@noflow\" if we see a pragma. Transitions to null if we are\n // past the initial comment.\n flowPragma: void | null | \"flow\" | \"noflow\" = undefined;\n\n getScopeHandler(): new (...args: any) => FlowScopeHandler {\n return FlowScopeHandler;\n }\n\n shouldParseTypes(): boolean {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n\n finishToken(type: TokenType, val: any): void {\n if (\n type !== tt.string &&\n type !== tt.semi &&\n type !== tt.interpreterDirective\n ) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n super.finishToken(type, val);\n }\n\n addComment(comment: N.Comment): void {\n if (this.flowPragma === undefined) {\n // Try to parse a flow pragma.\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) {\n // do nothing\n } else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n super.addComment(comment);\n }\n\n flowParseTypeInitialiser(tok?: TokenType): N.FlowType {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || tt.colon);\n\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParsePredicate(): N.FlowPredicate {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n this.next(); // eat `%`\n this.expectContextual(tt._checks);\n // Force '%' and 'checks' to be adjacent\n if (this.state.lastTokStartLoc!.index > moduloLoc.index + 1) {\n this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);\n }\n if (this.eat(tt.parenL)) {\n node.value = super.parseExpression();\n this.expect(tt.parenR);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n\n flowParseTypeAndPredicateInitialiser(): [\n N.FlowType | null,\n N.FlowPredicate | null,\n ] {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tt.colon);\n let type = null;\n let predicate = null;\n if (this.match(tt.modulo)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(tt.modulo)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n\n flowParseDeclareClass(\n node: Undone,\n ): N.FlowDeclareClass {\n this.next();\n this.flowParseInterfaceish(node, /*isClass*/ true);\n return this.finishNode(node, \"DeclareClass\");\n }\n\n flowParseDeclareFunction(\n node: Undone,\n ): N.FlowDeclareFunction {\n this.next();\n\n const id = (node.id = this.parseIdentifier());\n\n const typeNode = this.startNode();\n const typeContainer = this.startNode();\n\n if (this.match(tt.lt)) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n\n this.expect(tt.parenL);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n typeNode.this = tmp._this;\n this.expect(tt.parenR);\n\n [typeNode.returnType, node.predicate] =\n this.flowParseTypeAndPredicateInitialiser();\n\n typeContainer.typeAnnotation = this.finishNode(\n typeNode,\n \"FunctionTypeAnnotation\",\n );\n\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n\n this.resetEndLocation(id);\n this.semicolon();\n\n this.scope.declareName(\n node.id.name,\n BindingFlag.TYPE_FLOW_DECLARE_FN,\n node.id.loc.start,\n );\n\n return this.finishNode(node, \"DeclareFunction\");\n }\n\n flowParseDeclare(\n node: Undone,\n insideModule?: boolean,\n ): N.FlowDeclare {\n if (this.match(tt._class)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(tt._function)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(tt._var)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(tt._module)) {\n if (this.match(tt.dot)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(\n FlowErrors.NestedDeclareModule,\n this.state.lastTokStartLoc!,\n );\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(tt._type)) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(tt._opaque)) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(tt._interface)) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(tt._export)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n }\n throw this.unexpected();\n }\n\n flowParseDeclareVariable(\n node: Undone,\n ): N.FlowDeclareVariable {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(\n /*allowPrimitiveOverride*/ true,\n );\n this.scope.declareName(\n node.id.name,\n BindingFlag.TYPE_VAR,\n node.id.loc.start,\n );\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n\n flowParseDeclareModule(\n node: Undone,\n ): N.FlowDeclareModule {\n this.scope.enter(ScopeFlag.OTHER);\n\n if (this.match(tt.string)) {\n node.id = super.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n\n const bodyNode = (node.body = this.startNode());\n const body: N.Statement[] = (bodyNode.body = []);\n this.expect(tt.braceL);\n while (!this.match(tt.braceR)) {\n const bodyNode = this.startNode();\n\n if (this.match(tt._import)) {\n this.next();\n if (!this.isContextual(tt._type) && !this.match(tt._typeof)) {\n this.raise(\n FlowErrors.InvalidNonTypeImportInDeclareModule,\n this.state.lastTokStartLoc!,\n );\n }\n body.push(super.parseImport(bodyNode));\n } else {\n this.expectContextual(\n tt._declare,\n FlowErrors.UnsupportedStatementInDeclareModule,\n );\n body.push(this.flowParseDeclare(bodyNode, true));\n }\n }\n\n this.scope.exit();\n\n this.expect(tt.braceR);\n\n this.finishNode(bodyNode, \"BlockStatement\");\n\n let kind: \"CommonJS\" | \"ES\" | null = null;\n let hasModuleExport = false;\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement);\n }\n if (kind === \"ES\") {\n this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement);\n }\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n\n flowParseDeclareExportDeclaration(\n node: Undone,\n insideModule?: boolean | null,\n ): N.FlowDeclareExportDeclaration {\n this.expect(tt._export);\n\n if (this.eat(tt._default)) {\n if (this.match(tt._function) || this.match(tt._class)) {\n // declare export default class ...\n // declare export default function ...\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n // declare export default [type];\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (\n this.match(tt._const) ||\n this.isLet() ||\n ((this.isContextual(tt._type) || this.isContextual(tt._interface)) &&\n !insideModule)\n ) {\n const label = this.state.value as\n | \"const\"\n | \"let\"\n | \"type\"\n | \"interface\";\n throw this.raise(\n FlowErrors.UnsupportedDeclareExportKind,\n this.state.startLoc,\n {\n unsupportedExportKind: label,\n suggestion: exportSuggestions[label],\n },\n );\n }\n\n if (\n this.match(tt._var) || // declare export var ...\n this.match(tt._function) || // declare export function ...\n this.match(tt._class) || // declare export class ...\n this.isContextual(tt._opaque) // declare export opaque ..\n ) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (\n this.match(tt.star) || // declare export * from ''\n this.match(tt.braceL) || // declare export {} ...\n this.isContextual(tt._interface) || // declare export interface ...\n this.isContextual(tt._type) || // declare export type ...\n this.isContextual(tt._opaque) // declare export opaque type ...\n ) {\n node = this.parseExport(\n node as Undone,\n /* decorators */ null,\n );\n if (node.type === \"ExportNamedDeclaration\") {\n node.default = false;\n delete node.exportKind;\n return this.castNodeTo(\n node as N.ExportNamedDeclaration,\n \"DeclareExportDeclaration\",\n );\n } else {\n return this.castNodeTo(\n node as N.ExportAllDeclaration,\n \"DeclareExportAllDeclaration\",\n );\n }\n }\n }\n\n throw this.unexpected();\n }\n\n flowParseDeclareModuleExports(\n node: Undone,\n ): N.FlowDeclareModuleExports {\n this.next();\n this.expectContextual(tt._exports);\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n\n flowParseDeclareTypeAlias(\n node: Undone,\n ): N.FlowDeclareTypeAlias {\n this.next();\n const finished = this.flowParseTypeAlias(\n node,\n ) as unknown as N.FlowDeclareTypeAlias;\n // Don't do finishNode as we don't want to process comments twice\n this.castNodeTo(finished, \"DeclareTypeAlias\");\n return finished;\n }\n\n flowParseDeclareOpaqueType(\n node: Undone,\n ): N.FlowDeclareOpaqueType {\n this.next();\n const finished = this.flowParseOpaqueType(\n node,\n true,\n ) as unknown as N.FlowDeclareOpaqueType;\n // Don't do finishNode as we don't want to process comments twice\n this.castNodeTo(finished, \"DeclareOpaqueType\");\n return finished;\n }\n\n flowParseDeclareInterface(\n node: Undone,\n ): N.FlowDeclareInterface {\n this.next();\n this.flowParseInterfaceish(node, /* isClass */ false);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n // Interfaces\n\n flowParseInterfaceish(node: Undone, isClass: boolean): void {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ !isClass,\n /* declaration */ true,\n );\n\n this.scope.declareName(\n node.id.name,\n isClass ? BindingFlag.TYPE_FUNCTION : BindingFlag.TYPE_LEXICAL,\n node.id.loc.start,\n );\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.extends = [];\n\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(tt.comma));\n }\n\n if (isClass) {\n node.implements = [];\n node.mixins = [];\n\n if (this.eatContextual(tt._mixins)) {\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n if (this.eatContextual(tt._implements)) {\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false,\n });\n }\n\n flowParseInterfaceExtends(): N.FlowInterfaceExtends {\n const node = this.startNode();\n\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n return this.finishNode(node, \"InterfaceExtends\");\n }\n\n flowParseInterface(node: Undone): N.FlowInterface {\n this.flowParseInterfaceish(node, /* isClass */ false);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n\n checkNotUnderscore(word: string) {\n if (word === \"_\") {\n this.raise(\n FlowErrors.UnexpectedReservedUnderscore,\n this.state.startLoc,\n );\n }\n }\n\n checkReservedType(word: string, startLoc: Position, declaration?: boolean) {\n if (!reservedTypes.has(word)) return;\n\n this.raise(\n declaration\n ? FlowErrors.AssignReservedType\n : FlowErrors.UnexpectedReservedType,\n startLoc,\n {\n reservedType: word,\n },\n );\n }\n\n flowParseRestrictedIdentifier(\n liberal?: boolean,\n declaration?: boolean,\n ): N.Identifier {\n this.checkReservedType(\n this.state.value,\n this.state.startLoc,\n declaration,\n );\n return this.parseIdentifier(liberal);\n }\n\n // Type aliases\n\n flowParseTypeAlias(node: Undone): N.FlowTypeAlias {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ false,\n /* declaration */ true,\n );\n this.scope.declareName(\n node.id.name,\n BindingFlag.TYPE_LEXICAL,\n node.id.loc.start,\n );\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.right = this.flowParseTypeInitialiser(tt.eq);\n this.semicolon();\n\n return this.finishNode(node, \"TypeAlias\");\n }\n\n flowParseOpaqueType(\n node: Undone,\n declare: boolean,\n ): N.FlowOpaqueType {\n this.expectContextual(tt._type);\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n );\n this.scope.declareName(\n node.id.name,\n BindingFlag.TYPE_LEXICAL,\n node.id.loc.start,\n );\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n // Parse the supertype\n node.supertype = null;\n if (this.match(tt.colon)) {\n node.supertype = this.flowParseTypeInitialiser(tt.colon);\n }\n\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(tt.eq);\n }\n this.semicolon();\n\n return this.finishNode(node, \"OpaqueType\");\n }\n\n // Type annotations\n\n flowParseTypeParameter(requireDefault: boolean = false): N.TypeParameter {\n const nodeStartLoc = this.state.startLoc;\n\n const node = this.startNode();\n\n const variance = this.flowParseVariance();\n\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n // @ts-expect-error migrate to Babel types\n node.variance = variance;\n // @ts-expect-error migrate to Babel types\n node.bound = ident.typeAnnotation;\n\n if (this.match(tt.eq)) {\n this.eat(tt.eq);\n // @ts-expect-error migrate to Babel types\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc);\n }\n }\n\n return this.finishNode(node, \"TypeParameter\");\n }\n\n flowParseTypeParameterDeclaration(): N.TypeParameterDeclaration {\n const oldInType = this.state.inType;\n const node = this.startNode();\n node.params = [];\n\n this.state.inType = true;\n\n // istanbul ignore else: this condition is already checked at all call sites\n if (this.match(tt.lt) || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n let defaultRequired = false;\n\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n\n node.params.push(typeParameter);\n\n if (typeParameter.default) {\n defaultRequired = true;\n }\n\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n } while (!this.match(tt.gt));\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n\n // Parse in top level normal context if we are in a JSX context\n flowInTopLevelContext(cb: () => T): T {\n if (this.curContext() !== tc.brace) {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n } else {\n return cb();\n }\n }\n\n // Used when parsing type arguments from ES or JSX productions, where the first token\n // has been created without state.inType. Thus we need to re-scan the lt token.\n flowParseTypeParameterInstantiationInExpression():\n | N.TypeParameterInstantiation\n | undefined {\n if (this.reScan_lt() !== tt.lt) return;\n return this.flowParseTypeParameterInstantiation();\n }\n\n flowParseTypeParameterInstantiation(): N.TypeParameterInstantiation {\n const node = this.startNode();\n const oldInType = this.state.inType;\n\n this.state.inType = true;\n node.params = [];\n this.flowInTopLevelContext(() => {\n this.expect(tt.lt);\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.match(tt.gt)) {\n node.params.push(this.flowParseType());\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n });\n\n this.state.inType = oldInType;\n if (!this.state.inType && this.curContext() === tc.brace) {\n // rescan `>` when we are no longer in type context and JSX parsing context\n // since it was tokenized when `inType` is `true`.\n this.reScan_lt_gt();\n }\n this.expect(tt.gt);\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseTypeParameterInstantiationCallOrNew(): N.TypeParameterInstantiation | null {\n if (this.reScan_lt() !== tt.lt) return null;\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expect(tt.lt);\n while (!this.match(tt.gt)) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.match(tt.gt)) {\n this.expect(tt.comma);\n }\n }\n this.expect(tt.gt);\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseInterfaceType(): N.FlowInterfaceType {\n const node = this.startNode();\n this.expectContextual(tt._interface);\n\n node.extends = [];\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false,\n });\n\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n\n flowParseObjectPropertyKey(): N.Expression {\n return this.match(tt.num) || this.match(tt.string)\n ? super.parseExprAtom()\n : this.parseIdentifier(true);\n }\n\n flowParseObjectTypeIndexer(\n node: Undone,\n isStatic: boolean,\n variance?: N.FlowVariance | null,\n ): N.FlowObjectTypeIndexer {\n node.static = isStatic;\n\n // Note: bracketL has already been consumed\n if (this.lookahead().type === tt.colon) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(tt.bracketR);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n\n flowParseObjectTypeInternalSlot(\n node: Undone,\n isStatic: boolean,\n ): N.FlowObjectTypeInternalSlot {\n node.static = isStatic;\n // Note: both bracketL have already been consumed\n node.id = this.flowParseObjectPropertyKey();\n this.expect(tt.bracketR);\n this.expect(tt.bracketR);\n if (this.match(tt.lt) || this.match(tt.parenL)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.loc.start),\n );\n } else {\n node.method = false;\n if (this.eat(tt.question)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n\n flowParseObjectTypeMethodish(\n node: Undone,\n ): N.FlowFunctionTypeAnnotation {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n node.this = null;\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n this.expect(tt.parenL);\n if (this.match(tt._this)) {\n node.this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n node.this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n node.params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n\n if (this.eat(tt.ellipsis)) {\n node.rest = this.flowParseFunctionTypeParam(false);\n }\n this.expect(tt.parenR);\n node.returnType = this.flowParseTypeInitialiser();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n flowParseObjectTypeCallProperty(\n node: Undone,\n isStatic: boolean,\n ): N.FlowObjectTypeCallProperty {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact,\n }: {\n allowStatic: boolean;\n allowExact: boolean;\n allowSpread: boolean;\n allowProto: boolean;\n allowInexact: boolean;\n }): N.FlowObjectTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n\n const nodeStart = this.startNode();\n\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(tt.braceBarL)) {\n this.expect(tt.braceBarL);\n endDelim = tt.braceBarR;\n exact = true;\n } else {\n this.expect(tt.braceL);\n endDelim = tt.braceR;\n exact = false;\n }\n\n nodeStart.exact = exact;\n\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStartLoc: Position | undefined | null = null;\n let inexactStartLoc: Position | undefined | null = null;\n const node = this.startNode();\n\n if (allowProto && this.isContextual(tt._proto)) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n protoStartLoc = this.state.startLoc;\n allowStatic = false;\n }\n }\n\n if (allowStatic && this.isContextual(tt._static)) {\n const lookahead = this.lookahead();\n\n // static is a valid identifier name\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n isStatic = true;\n }\n }\n\n const variance = this.flowParseVariance();\n\n if (this.eat(tt.bracketL)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (this.eat(tt.bracketL)) {\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.internalSlots.push(\n this.flowParseObjectTypeInternalSlot(node, isStatic),\n );\n } else {\n nodeStart.indexers.push(\n this.flowParseObjectTypeIndexer(node, isStatic, variance),\n );\n }\n } else if (this.match(tt.parenL) || this.match(tt.lt)) {\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n nodeStart.callProperties.push(\n this.flowParseObjectTypeCallProperty(node, isStatic),\n );\n } else {\n let kind = \"init\";\n\n if (this.isContextual(tt._get) || this.isContextual(tt._set)) {\n const lookahead = this.lookahead();\n if (tokenIsLiteralPropertyName(lookahead.type)) {\n kind = this.state.value;\n this.next();\n }\n }\n\n const propOrInexact = this.flowParseObjectTypeProperty(\n node,\n isStatic,\n protoStartLoc,\n variance,\n kind,\n allowSpread,\n allowInexact ?? !exact,\n );\n\n if (propOrInexact === null) {\n inexact = true;\n inexactStartLoc = this.state.lastTokStartLoc;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n\n this.flowObjectTypeSemicolon();\n\n if (\n inexactStartLoc &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.raise(\n FlowErrors.UnexpectedExplicitInexactInObject,\n inexactStartLoc,\n );\n }\n }\n\n this.expect(endDelim);\n\n /* The inexact flag should only be added on ObjectTypeAnnotations that\n * are not the body of an interface, declare interface, or declare class.\n * Since spreads are only allowed in object types, checking that is\n * sufficient here.\n */\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n\n this.state.inType = oldInType;\n\n return out;\n }\n\n flowParseObjectTypeProperty(\n node: Undone,\n isStatic: boolean,\n protoStartLoc: Position | undefined | null,\n variance: N.FlowVariance | undefined | null,\n kind: string,\n allowSpread: boolean,\n allowInexact: boolean,\n ): N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty | null {\n if (this.eat(tt.ellipsis)) {\n const isInexactToken =\n this.match(tt.comma) ||\n this.match(tt.semi) ||\n this.match(tt.braceR) ||\n this.match(tt.braceBarR);\n\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(\n FlowErrors.InexactInsideNonObject,\n this.state.lastTokStartLoc!,\n );\n } else if (!allowInexact) {\n this.raise(\n FlowErrors.InexactInsideExact,\n this.state.lastTokStartLoc!,\n );\n }\n if (variance) {\n this.raise(FlowErrors.InexactVariance, variance);\n }\n\n return null;\n }\n\n if (!allowSpread) {\n this.raise(\n FlowErrors.UnexpectedSpreadType,\n this.state.lastTokStartLoc!,\n );\n }\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.raise(FlowErrors.SpreadVariance, variance);\n }\n\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStartLoc != null;\n node.kind = kind;\n\n let optional = false;\n if (this.match(tt.lt) || this.match(tt.parenL)) {\n // This is a method property\n node.method = true;\n\n if (protoStartLoc != null) {\n this.unexpected(protoStartLoc);\n }\n if (variance) {\n this.unexpected(variance.loc.start);\n }\n\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.loc.start),\n );\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n /** Declared classes/interfaces do not allow spread */\n if (\n !allowSpread &&\n node.key.name === \"constructor\" &&\n node.value.this\n ) {\n this.raise(\n FlowErrors.ThisParamBannedInConstructor,\n node.value.this,\n );\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n\n node.method = false;\n\n if (this.eat(tt.question)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n\n node.optional = optional;\n\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n // This is similar to checkGetterSetterParams, but as\n // @babel/parser uses non estree properties we cannot reuse it here\n flowCheckGetterSetterParams(\n property: Undone<\n N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty\n >,\n ): void {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const length =\n property.value.params.length + (property.value.rest ? 1 : 0);\n\n if (property.value.this) {\n this.raise(\n property.kind === \"get\"\n ? FlowErrors.GetterMayNotHaveThisParam\n : FlowErrors.SetterMayNotHaveThisParam,\n property.value.this,\n );\n }\n\n if (length !== paramCount) {\n this.raise(\n property.kind === \"get\"\n ? Errors.BadGetterArity\n : Errors.BadSetterArity,\n property,\n );\n }\n\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(Errors.BadSetterRestParameter, property);\n }\n }\n\n flowObjectTypeSemicolon(): void {\n if (\n !this.eat(tt.semi) &&\n !this.eat(tt.comma) &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.unexpected();\n }\n }\n\n flowParseQualifiedTypeIdentifier(\n startLoc?: Position,\n id?: N.Identifier,\n ): N.FlowQualifiedTypeIdentifier | N.Identifier {\n startLoc ??= this.state.startLoc;\n let node: N.Identifier | N.FlowQualifiedTypeIdentifier =\n id || this.flowParseRestrictedIdentifier(true);\n\n while (this.eat(tt.dot)) {\n const node2 = this.startNodeAt(startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n\n return node;\n }\n\n flowParseGenericType(\n startLoc: Position,\n id: N.Identifier,\n ): N.FlowGenericTypeAnnotation {\n const node = this.startNodeAt(startLoc);\n\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id);\n\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n\n flowParseTypeofType(): N.FlowTypeofTypeAnnotation {\n const node = this.startNode();\n this.expect(tt._typeof);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n\n flowParseTupleType(): N.FlowTupleTypeAnnotation {\n const node = this.startNode();\n node.types = [];\n this.expect(tt.bracketL);\n // We allow trailing commas\n while (this.state.pos < this.length && !this.match(tt.bracketR)) {\n node.types.push(this.flowParseType());\n if (this.match(tt.bracketR)) break;\n this.expect(tt.comma);\n }\n this.expect(tt.bracketR);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n\n flowParseFunctionTypeParam(first: boolean): N.FlowFunctionTypeParam {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode();\n const lh = this.lookahead();\n const isThis = this.state.type === tt._this;\n\n if (lh.type === tt.colon || lh.type === tt.question) {\n if (isThis && !first) {\n this.raise(FlowErrors.ThisParamMustBeFirst, node);\n }\n name = this.parseIdentifier(isThis);\n if (this.eat(tt.question)) {\n optional = true;\n if (isThis) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, node);\n }\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n reinterpretTypeAsFunctionTypeParam(\n type: N.FlowType,\n ): N.FlowFunctionTypeParam {\n const node = this.startNodeAt(type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n flowParseFunctionTypeParams(params: N.FlowFunctionTypeParam[] = []): {\n params: N.FlowFunctionTypeParam[];\n rest: N.FlowFunctionTypeParam | undefined | null;\n _this: N.FlowFunctionTypeParam | undefined | null;\n } {\n let rest: N.FlowFunctionTypeParam | undefined | null = null;\n let _this: N.FlowFunctionTypeParam | undefined | null = null;\n if (this.match(tt._this)) {\n _this = this.flowParseFunctionTypeParam(/* first */ true);\n // match Flow parser behavior\n _this.name = null;\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n params.push(this.flowParseFunctionTypeParam(false));\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n if (this.eat(tt.ellipsis)) {\n rest = this.flowParseFunctionTypeParam(false);\n }\n return { params, rest, _this };\n }\n\n flowIdentToTypeAnnotation(\n startLoc: Position,\n node: Undone,\n id: N.Identifier,\n ): N.FlowType {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n\n case \"symbol\":\n return this.finishNode(node, \"SymbolTypeAnnotation\");\n\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startLoc, id);\n }\n }\n\n // The parsing of types roughly parallels the parsing of expressions, and\n // primary types are kind of like primary expressions...they're the\n // primitives with which other types are constructed.\n flowParsePrimaryType(): N.FlowType {\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n\n switch (this.state.type) {\n case tt.braceL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true,\n });\n\n case tt.braceBarL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false,\n });\n\n case tt.bracketL:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n\n case tt.lt: {\n const node = this.startNode();\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(tt.parenL);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n case tt.parenL: {\n const node = this.startNode();\n this.next();\n\n // Check to see if this is actually a grouped type\n if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n if (tokenIsIdentifier(this.state.type) || this.match(tt._this)) {\n const token = this.lookahead().type;\n isGroupedType = token !== tt.question && token !== tt.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n // A `,` or a `) =>` means this is an anonymous function type\n if (\n this.state.noAnonFunctionType ||\n !(\n this.match(tt.comma) ||\n (this.match(tt.parenR) && this.lookahead().type === tt.arrow)\n )\n ) {\n this.expect(tt.parenR);\n return type;\n } else {\n // Eat a comma if there is one\n this.eat(tt.comma);\n }\n }\n\n if (type) {\n tmp = this.flowParseFunctionTypeParams([\n this.reinterpretTypeAsFunctionTypeParam(type),\n ]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n\n node.params = tmp.params;\n node.rest = tmp.rest;\n node.this = tmp._this;\n\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n node.typeParameters = null;\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n case tt.string:\n return this.parseLiteral(\n this.state.value,\n \"StringLiteralTypeAnnotation\",\n );\n\n case tt._true:\n case tt._false:\n node.value = this.match(tt._true);\n this.next();\n return this.finishNode(\n node as Undone,\n \"BooleanLiteralTypeAnnotation\",\n );\n\n case tt.plusMin:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(tt.num)) {\n return this.parseLiteralAtNode(\n -this.state.value,\n \"NumberLiteralTypeAnnotation\",\n node,\n );\n }\n\n if (this.match(tt.bigint)) {\n return this.parseLiteralAtNode(\n -this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n node,\n );\n }\n\n throw this.raise(\n FlowErrors.UnexpectedSubtractionOperand,\n this.state.startLoc,\n );\n }\n throw this.unexpected();\n case tt.num:\n return this.parseLiteral(\n this.state.value,\n \"NumberLiteralTypeAnnotation\",\n );\n\n case tt.bigint:\n return this.parseLiteral(\n this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n );\n\n case tt._void:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n\n case tt._null:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n\n case tt._this:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n\n case tt.star:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n\n case tt._typeof:\n return this.flowParseTypeofType();\n\n default:\n if (tokenIsKeyword(this.state.type)) {\n const label = tokenLabelName(this.state.type);\n this.next();\n return super.createIdentifier(node as Undone, label);\n } else if (tokenIsIdentifier(this.state.type)) {\n if (this.isContextual(tt._interface)) {\n return this.flowParseInterfaceType();\n }\n\n return this.flowIdentToTypeAnnotation(\n startLoc,\n node,\n this.parseIdentifier(),\n );\n }\n }\n\n throw this.unexpected();\n }\n\n flowParsePostfixType(): N.FlowType {\n const startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n let seenOptionalIndexedAccess = false;\n while (\n (this.match(tt.bracketL) || this.match(tt.questionDot)) &&\n !this.canInsertSemicolon()\n ) {\n const node = this.startNodeAt(startLoc);\n const optional = this.eat(tt.questionDot);\n seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional;\n this.expect(tt.bracketL);\n if (!optional && this.match(tt.bracketR)) {\n node.elementType = type;\n this.next(); // eat `]`\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n } else {\n node.objectType = type;\n node.indexType = this.flowParseType();\n this.expect(tt.bracketR);\n if (seenOptionalIndexedAccess) {\n node.optional = optional;\n type = this.finishNode(\n // @ts-expect-error todo(flow->ts)\n node,\n \"OptionalIndexedAccessType\",\n );\n } else {\n type = this.finishNode(\n // @ts-expect-error todo(flow->ts)\n node,\n \"IndexedAccessType\",\n );\n }\n }\n }\n return type;\n }\n\n flowParsePrefixType(): N.FlowType {\n const node = this.startNode();\n if (this.eat(tt.question)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n\n flowParseAnonFunctionWithoutParens(): N.FlowType {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) {\n // TODO: This should be a type error. Passing in a SourceLocation, and it expects a Position.\n const node = this.startNodeAt(\n param.loc.start,\n );\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.this = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n\n flowParseIntersectionType(): N.FlowType {\n const node = this.startNode();\n this.eat(tt.bitwiseAND);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(tt.bitwiseAND)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n\n flowParseUnionType(): N.FlowType {\n const node = this.startNode();\n this.eat(tt.bitwiseOR);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(tt.bitwiseOR)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n\n flowParseType(): N.FlowType {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParseTypeOrImplicitInstantiation(): N.FlowType {\n if (this.state.type === tt.name && this.state.value === \"_\") {\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n\n flowParseTypeAnnotation(): N.TypeAnnotation {\n const node = this.startNode();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n\n flowParseTypeAnnotatableIdentifier(\n allowPrimitiveOverride?: boolean,\n ): N.Identifier {\n const ident = allowPrimitiveOverride\n ? this.parseIdentifier()\n : this.flowParseRestrictedIdentifier();\n if (this.match(tt.colon)) {\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n\n typeCastToParameter(node: N.TypeCastExpression): N.Expression {\n (node.expression as N.Identifier).typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(node.expression, node.typeAnnotation.loc.end);\n\n return node.expression;\n }\n\n flowParseVariance(): N.FlowVariance | undefined | null {\n let variance = null;\n if (this.match(tt.plusMin)) {\n variance = this.startNode();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n return this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseFunctionBody(\n node: N.Function,\n allowExpressionBody?: boolean | null,\n isMethod: boolean = false,\n ): void {\n if (allowExpressionBody) {\n this.forwardNoArrowParamsConversionAt(node, () =>\n super.parseFunctionBody(node, true, isMethod),\n );\n return;\n }\n\n super.parseFunctionBody(node, false, isMethod);\n }\n\n parseFunctionBodyAndFinish<\n T extends\n | N.Function\n | N.TSDeclareMethod\n | N.TSDeclareFunction\n | N.ClassPrivateMethod,\n >(node: Undone, type: T[\"type\"], isMethod: boolean = false): T {\n if (this.match(tt.colon)) {\n const typeNode = this.startNode();\n\n [\n typeNode.typeAnnotation,\n // @ts-expect-error predicate may not exist\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser() as [\n N.FlowType,\n N.FlowPredicate,\n ];\n\n node.returnType = typeNode.typeAnnotation\n ? this.finishNode(typeNode, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n // interfaces and enums\n parseStatementLike(flags: ParseStatementFlag): N.Statement {\n // strict mode handling of `interface` since it's a reserved word\n if (this.state.strict && this.isContextual(tt._interface)) {\n const lookahead = this.lookahead();\n if (tokenIsKeywordOrIdentifier(lookahead.type)) {\n const node = this.startNode();\n this.next();\n return this.flowParseInterface(node);\n }\n } else if (this.isContextual(tt._enum)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n const stmt = super.parseStatementLike(flags);\n // We will parse a flow pragma in any comment before the first statement.\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n\n // declares, interfaces and type aliases\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n decorators: N.Decorator[] | null,\n ): N.ExpressionStatement {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (\n this.match(tt._class) ||\n tokenIsIdentifier(this.state.type) ||\n this.match(tt._function) ||\n this.match(tt._var) ||\n this.match(tt._export)\n ) {\n // @ts-expect-error: refine typings\n return this.flowParseDeclare(node);\n }\n } else if (tokenIsIdentifier(this.state.type)) {\n if (expr.name === \"interface\") {\n // @ts-expect-error: refine typings\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n // @ts-expect-error: refine typings\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n // @ts-expect-error: refine typings\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n\n return super.parseExpressionStatement(node, expr, decorators);\n }\n\n // export type\n shouldParseExportDeclaration(): boolean {\n const { type } = this.state;\n if (type === tt._enum || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {\n return !this.state.containsEsc;\n }\n return super.shouldParseExportDeclaration();\n }\n\n isExportDefaultSpecifier(): boolean {\n const { type } = this.state;\n if (type === tt._enum || tokenIsFlowInterfaceOrTypeOrOpaque(type)) {\n return this.state.containsEsc;\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n parseExportDefaultExpression() {\n if (this.isContextual(tt._enum)) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n\n parseConditional(\n expr: N.Expression,\n\n startLoc: Position,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.Expression {\n if (!this.match(tt.question)) return expr;\n\n if (this.state.maybeInArrowParameters) {\n const nextCh = this.lookaheadCharCode();\n // These tokens cannot start an expression, so if one of them follows\n // ? then we are probably in an arrow function parameters list and we\n // don't parse the conditional expression.\n if (\n nextCh === charCodes.comma || // (a?, b) => c\n nextCh === charCodes.equalsTo || // (a? = b) => c\n nextCh === charCodes.colon || // (a?: b) => c\n nextCh === charCodes.rightParenthesis // (a?) => c\n ) {\n /*:: invariant(refExpressionErrors != null) */\n this.setOptionalParametersError(refExpressionErrors!);\n return expr;\n }\n }\n\n this.expect(tt.question);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startLoc);\n let { consequent, failed } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n\n if (failed && valid.length > 1) {\n // if there are two or more possible correct ways of parsing, throw an\n // error.\n // e.g. Source: a ? (b): c => (d): e => f\n // Result 1: a ? b : (c => ((d): e => f))\n // Result 2: a ? ((b): c => d) : (e => f)\n this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc);\n }\n\n if (failed && valid.length === 1) {\n this.state = state;\n noArrowAt.push(valid[0].start);\n this.state.noArrowAt = noArrowAt;\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n }\n }\n\n this.getArrowLikeExpressions(consequent, true);\n\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(tt.colon);\n\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () =>\n this.parseMaybeAssign(undefined, undefined),\n );\n\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n tryParseConditionalConsequent(): {\n consequent: N.Expression;\n failed: boolean;\n } {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n\n const consequent = this.parseMaybeAssignAllowIn();\n const failed = !this.match(tt.colon);\n\n this.state.noArrowParamsConversionAt.pop();\n\n return { consequent, failed };\n }\n\n // Given an expression, walks through out its arrow functions whose body is\n // an expression and through out conditional expressions. It returns every\n // function which has been parsed with a return type but could have been\n // parenthesized expressions.\n // These functions are separated into two arrays: one containing the ones\n // whose parameters can be converted to assignable lists, one containing the\n // others.\n getArrowLikeExpressions(\n node: N.Expression,\n disallowInvalid?: boolean,\n ): [N.ArrowFunctionExpression[], N.ArrowFunctionExpression[]] {\n const stack = [node];\n const arrows: N.ArrowFunctionExpression[] = [];\n\n while (stack.length !== 0) {\n const node = stack.pop()!;\n if (\n node.type === \"ArrowFunctionExpression\" &&\n node.body.type !== \"BlockStatement\"\n ) {\n if (node.typeParameters || !node.returnType) {\n // This is an arrow expression without ambiguity, so check its parameters\n this.finishArrowValidation(node);\n } else {\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n\n return partition(arrows, node =>\n node.params.every(param => this.isAssignable(param, true)),\n );\n }\n\n finishArrowValidation(node: N.ArrowFunctionExpression) {\n this.toAssignableList(\n // node.params is Expression[] instead of $ReadOnlyArray because it\n // has not been converted yet.\n node.params as any as N.Expression[],\n node.extra?.trailingCommaLoc,\n /* isLHS */ false,\n );\n // Enter scope, as checkParams defines bindings\n this.scope.enter(ScopeFlag.FUNCTION | ScopeFlag.ARROW);\n // Use super's method to force the parameters to be checked\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n\n forwardNoArrowParamsConversionAt(\n node: Undone,\n parse: () => T,\n ): T {\n let result: T;\n if (\n this.state.noArrowParamsConversionAt.includes(\n this.offsetToSourcePos(node.start),\n )\n ) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n\n return result;\n }\n\n parseParenItem(\n node: T,\n startLoc: Position,\n ): T | N.TypeCastExpression | N.TsTypeCastExpression {\n const newNode = super.parseParenItem(node, startLoc);\n if (this.eat(tt.question)) {\n (newNode as N.Identifier).optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt(startLoc);\n typeCastNode.expression = newNode as N.Expression;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n\n return newNode;\n }\n\n assertModuleNodeAllowed(node: N.Node) {\n if (\n (node.type === \"ImportDeclaration\" &&\n (node.importKind === \"type\" || node.importKind === \"typeof\")) ||\n (node.type === \"ExportNamedDeclaration\" &&\n node.exportKind === \"type\") ||\n (node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\")\n ) {\n // Allow Flowtype imports and exports in all conditions because\n // Flow itself does not care about 'sourceType'.\n return;\n }\n\n super.assertModuleNodeAllowed(node);\n }\n\n parseExportDeclaration(\n node: N.ExportNamedDeclaration,\n ): N.Declaration | undefined | null {\n if (this.isContextual(tt._type)) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n\n if (this.match(tt.braceL)) {\n // export type { foo, bar };\n node.specifiers = this.parseExportSpecifiers(\n /* isInTypeExport */ true,\n );\n super.parseExportFrom(node);\n return null;\n } else {\n // export type Foo = Bar;\n // @ts-expect-error: refine typings\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(tt._opaque)) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n // export opaque type Foo = Bar;\n // @ts-expect-error: refine typings\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(tt._interface)) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n // @ts-expect-error: refine typings\n return this.flowParseInterface(declarationNode);\n } else if (this.isContextual(tt._enum)) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n // @ts-expect-error: refine typings\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n\n eatExportStar(\n node: Undone,\n ): node is Undone {\n if (super.eatExportStar(node)) return true;\n\n if (this.isContextual(tt._type) && this.lookahead().type === tt.star) {\n (\n node as Undone\n ).exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(\n node: Undone,\n ): node is Undone {\n const { startLoc } = this.state;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(startLoc);\n }\n return hasNamespace;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId?: boolean | null,\n ) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: N.ParseClassMemberState,\n ): void {\n const { startLoc } = this.state;\n if (this.isContextual(tt._declare)) {\n if (super.parseClassMemberFromModifier(classBody, member)) {\n // 'declare' is a class element name\n return;\n }\n\n member.declare = true;\n }\n\n super.parseClassMember(classBody, member, state);\n\n if (member.declare) {\n if (\n member.type !== \"ClassProperty\" &&\n member.type !== \"ClassPrivateProperty\" &&\n member.type !== \"PropertyDefinition\" // Used by estree plugin\n ) {\n this.raise(FlowErrors.DeclareClassElement, startLoc);\n } else if (member.value) {\n this.raise(FlowErrors.DeclareClassFieldInitializer, member.value);\n }\n }\n }\n\n isIterator(word: string): boolean {\n return word === \"iterator\" || word === \"asyncIterator\";\n }\n\n readIterator(): void {\n const word = super.readWord1();\n const fullWord = \"@@\" + word;\n\n // Allow @@iterator and @@asyncIterator as a identifier only inside type\n if (!this.isIterator(word) || !this.state.inType) {\n this.raise(Errors.InvalidIdentifier, this.state.curPosition(), {\n identifierName: fullWord,\n });\n }\n\n this.finishToken(tt.name, fullWord);\n }\n\n // ensure that inside flow types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === charCodes.leftCurlyBrace && next === charCodes.verticalBar) {\n this.finishOp(tt.braceBarL, 2);\n } else if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n this.finishOp(code === charCodes.greaterThan ? tt.gt : tt.lt, 1);\n } else if (this.state.inType && code === charCodes.questionMark) {\n if (next === charCodes.dot) {\n this.finishOp(tt.questionDot, 2);\n } else {\n // allow double nullable types in Flow: ??string\n this.finishOp(tt.question, 1);\n }\n } else if (\n isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))\n ) {\n this.state.pos += 2; // eat \"@@\"\n this.readIterator();\n } else {\n super.getTokenFromCode(code);\n }\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n if (node.type === \"TypeCastExpression\") {\n return this.isAssignable(node.expression, isBinding);\n } else {\n return super.isAssignable(node, isBinding);\n }\n }\n\n toAssignable(node: N.Node, isLHS: boolean = false): void {\n if (\n !isLHS &&\n node.type === \"AssignmentExpression\" &&\n node.left.type === \"TypeCastExpression\"\n ) {\n node.left = this.typeCastToParameter(node.left) as N.Assignable;\n }\n super.toAssignable(node, isLHS);\n }\n\n // turn type casts that we found in function parameter head into type annotated params\n toAssignableList(\n exprList: N.Expression[],\n trailingCommaLoc: Position | undefined | null,\n isLHS: boolean,\n ): void {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr?.type === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n super.toAssignableList(exprList, trailingCommaLoc, isLHS);\n }\n\n // this is a list of nodes, from something like a call expression, we need to filter the\n // type casts that we've found that are illegal in this context\n toReferencedList(\n exprList:\n | ReadonlyArray\n | ReadonlyArray,\n isParenthesizedExpr?: boolean,\n ):\n | ReadonlyArray\n | ReadonlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (\n expr &&\n expr.type === \"TypeCastExpression\" &&\n !expr.extra?.parenthesized &&\n (exprList.length > 1 || !isParenthesizedExpr)\n ) {\n this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation);\n }\n }\n\n return exprList;\n }\n\n parseArrayLike(\n close: TokenType,\n isTuple: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): N.ArrayExpression | N.TupleExpression {\n const node = super.parseArrayLike(close, isTuple, refExpressionErrors);\n\n // This could be an array pattern:\n // ([a: string, b: string]) => {}\n // In this case, we don't have to call toReferencedList. We will\n // call it, if needed, when we are sure that it is a parenthesized\n // expression by calling toReferencedListDeep.\n if (refExpressionErrors != null && !this.state.maybeInArrowParameters) {\n this.toReferencedList(node.elements);\n }\n\n return node;\n }\n\n isValidLVal(\n type: string,\n disallowCallExpression: boolean,\n isParenthesized: boolean,\n binding: BindingFlag,\n ) {\n return (\n type === \"TypeCastExpression\" ||\n super.isValidLVal(\n type,\n disallowCallExpression,\n isParenthesized,\n binding,\n )\n );\n }\n\n // parse class property type annotations\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n // determine whether or not we're currently in the position where a class method would appear\n isClassMethod(): boolean {\n return this.match(tt.lt) || super.isClassMethod();\n }\n\n // determine whether or not we're currently in the position where a class property would appear\n isClassProperty(): boolean {\n return this.match(tt.colon) || super.isClassProperty();\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return !this.match(tt.colon) && super.isNonstaticConstructor(method);\n }\n\n // parse type parameters for class methods\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n if ((method as any).variance) {\n this.unexpected((method as any).variance.loc.start);\n }\n delete (method as any).variance;\n if (this.match(tt.lt)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n\n if (method.params && isConstructor) {\n const params = method.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, method);\n }\n // estree support\n } else if (\n // @ts-expect-error TS does not know about the fact that estree can replace ClassMethod with MethodDefinition\n method.type === \"MethodDefinition\" &&\n isConstructor &&\n // @ts-expect-error estree\n method.value.params\n ) {\n // @ts-expect-error estree\n const params = method.value.params;\n if (params.length > 0 && this.isThisParam(params[0])) {\n this.raise(FlowErrors.ThisParamBannedInConstructor, method);\n }\n }\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n if ((method as any).variance) {\n this.unexpected((method as any).variance.loc.start);\n }\n delete (method as any).variance;\n if (this.match(tt.lt)) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n // parse a the super class type parameters and implements\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (\n node.superClass &&\n (this.match(tt.lt) ||\n // handles `class extends C<`\n this.match(tt.bitShiftL))\n ) {\n if (process.env.BABEL_8_BREAKING) {\n node.superTypeArguments =\n this.flowParseTypeParameterInstantiationInExpression();\n } else {\n node.superTypeParameters =\n this.flowParseTypeParameterInstantiationInExpression();\n }\n }\n if (this.isContextual(tt._implements)) {\n this.next();\n const implemented: N.FlowClassImplements[] = (node.implements = []);\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(/*liberal*/ true);\n if (this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(tt.comma));\n }\n }\n\n checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void {\n super.checkGetterSetterParams(method);\n const params = this.getObjectOrClassMethodParams(method);\n if (params.length > 0) {\n const param = params[0];\n if (this.isThisParam(param) && method.kind === \"get\") {\n this.raise(FlowErrors.GetterMayNotHaveThisParam, param);\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.SetterMayNotHaveThisParam, param);\n }\n }\n }\n\n parsePropertyNamePrefixOperator(\n node: N.ObjectOrClassMember | N.ClassMember,\n ): void {\n node.variance = this.flowParseVariance();\n }\n\n // parse type parameters for object method shorthand\n parseObjPropValue(\n prop: Undone,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): T {\n if ((prop as any).variance) {\n this.unexpected((prop as any).variance.loc.start);\n }\n delete (prop as any).variance;\n\n let typeParameters;\n\n // method shorthand\n if (this.match(tt.lt) && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(tt.parenL)) this.unexpected();\n }\n\n const result = super.parseObjPropValue(\n prop,\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n\n // add typeParameters if we found them\n if (typeParameters) {\n // @ts-expect-error: refine typings\n (result.value || result).typeParameters = typeParameters;\n }\n return result;\n }\n\n parseFunctionParamType(param: N.Pattern): N.Pattern {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(FlowErrors.PatternIsOptional, param);\n }\n if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, param);\n }\n\n (param as any as N.Identifier).optional = true;\n }\n if (this.match(tt.colon)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamAnnotationRequired, param);\n }\n\n if (this.match(tt.eq) && this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamNoDefault, param);\n }\n\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault

(\n startLoc?: Position | null,\n left?: P | null,\n ): P | N.AssignmentPattern {\n const node = super.parseMaybeDefault(startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation);\n }\n\n return node;\n }\n\n checkImportReflection(node: Undone) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(\n FlowErrors.ImportReflectionHasImportType,\n node.specifiers[0].loc.start,\n );\n }\n }\n\n parseImportSpecifierLocal<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(node: N.ImportDeclaration, specifier: Undone, type: T[\"type\"]): void {\n specifier.local = hasTypeImportKind(node)\n ? this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n )\n : this.parseIdentifier();\n\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n isPotentialImportPhase(isExport: boolean): boolean {\n if (super.isPotentialImportPhase(isExport)) return true;\n if (this.isContextual(tt._type)) {\n if (!isExport) return true;\n const ch = this.lookaheadCharCode();\n return ch === charCodes.leftCurlyBrace || ch === charCodes.asterisk;\n }\n return !isExport && this.isContextual(tt._typeof);\n }\n\n applyImportPhase(\n node: Undone,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n super.applyImportPhase(node, isExport, phase, loc);\n if (isExport) {\n if (!phase && this.match(tt._default)) {\n // TODO: Align with our TS AST and always add .exportKind\n return;\n }\n (node as N.ExportNamedDeclaration).exportKind =\n phase === \"type\" ? phase : \"value\";\n } else {\n if (phase === \"type\" && this.match(tt.star)) this.unexpected();\n (node as N.ImportDeclaration).importKind =\n phase === \"type\" || phase === \"typeof\" ? phase : \"value\";\n }\n }\n\n // parse import-type/typeof shorthand\n parseImportSpecifier(\n specifier: any,\n importedIsString: boolean,\n isInTypeOnlyImport: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isMaybeTypeOnly: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType: BindingFlag | undefined,\n ): N.ImportSpecifier {\n const firstIdent = specifier.imported;\n\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n\n let isBinding = false;\n if (this.isContextual(tt._as) && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (\n specifierTypeKind !== null &&\n !tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type as ,` or `import {type as }`\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = this.cloneIdentifier(as_ident);\n } else {\n // `import {type as foo`\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else {\n if (\n specifierTypeKind !== null &&\n tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type foo`\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n } else {\n if (importedIsString) {\n /*:: invariant(firstIdent instanceof N.StringLiteral) */\n throw this.raise(Errors.ImportBindingIsString, specifier, {\n importName: firstIdent.value,\n });\n }\n /*:: invariant(firstIdent instanceof N.Node) */\n specifier.imported = firstIdent;\n specifier.importKind = null;\n }\n\n if (this.eatContextual(tt._as)) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = this.cloneIdentifier(specifier.imported);\n }\n }\n\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (isInTypeOnlyImport && specifierIsTypeImport) {\n this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);\n }\n\n if (isInTypeOnlyImport || specifierIsTypeImport) {\n this.checkReservedType(\n specifier.local.name,\n specifier.local.loc.start,\n /* declaration */ true,\n );\n }\n\n if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {\n this.checkReservedWord(\n specifier.local.name,\n specifier.loc.start,\n true,\n true,\n );\n }\n\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\");\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n // parse function type parameters - function foo() {}\n parseFunctionParams(\n node: Undone,\n isConstructor: boolean,\n ): void {\n // @ts-expect-error kind may not index node\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, isConstructor);\n }\n\n // parse flow type annotations on variable declarator heads - let foo: string = bar\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n ): void {\n super.parseVarId(decl, kind);\n if (this.match(tt.colon)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n // todo description\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n // We need to support type parameter declarations for arrow functions. This\n // is tricky. There are three situations we need to handle\n //\n // 1. This is either JSX or an arrow function. We'll try JSX first. If that\n // fails, we'll try an arrow function. If that fails, we'll throw the JSX\n // error.\n // 2. This is an arrow function. We'll parse the type parameter declaration,\n // parse the rest, make sure the rest is an arrow function, and go from\n // there\n // 3. This is neither. Just call the super method\n parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n let state = null;\n\n let jsx;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.match(tt.lt))\n ) {\n state = this.state.clone();\n\n jsx = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n\n /*:: invariant(!jsx.aborted) */\n /*:: invariant(jsx.node != null) */\n if (!jsx.error) return jsx.node!;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === tc.j_oTag || currentContext === tc.j_expr) {\n context.pop();\n }\n }\n\n if (jsx?.error || this.match(tt.lt)) {\n state = state || this.state.clone();\n\n let typeParameters: N.TypeParameterDeclaration;\n\n const arrow = this.tryParse((abort: () => never) => {\n typeParameters = this.flowParseTypeParameterDeclaration();\n\n const arrowExpression = this.forwardNoArrowParamsConversionAt(\n typeParameters,\n () => {\n const result = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n );\n\n this.resetStartLocationFromNode(result, typeParameters);\n\n return result;\n },\n );\n\n // (() => {});\n // (() => {}: any);\n if (arrowExpression.extra?.parenthesized) abort();\n\n // The above can return a TypeCastExpression when the arrow\n // expression is not wrapped in parens. See also `this.parseParenItem`.\n // (() => {}: any);\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n\n if (expr.type !== \"ArrowFunctionExpression\") abort();\n\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n\n return arrowExpression;\n }, state);\n\n let arrowExpression:\n | N.ArrowFunctionExpression\n | N.TypeCastExpression\n | undefined\n | null = null;\n\n if (\n arrow.node &&\n this.maybeUnwrapTypeCastExpression(arrow.node).type ===\n \"ArrowFunctionExpression\"\n ) {\n if (!arrow.error && !arrow.aborted) {\n // async () => {}\n // @ts-expect-error: refine tryParse typings\n if (arrow.node.async) {\n /*:: invariant(typeParameters) */\n this.raise(\n FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,\n typeParameters!,\n );\n }\n return arrow.node;\n }\n\n // @ts-expect-error: refine typings\n arrowExpression = arrow.node;\n }\n\n // If we are here, both JSX and Flow parsing attempts failed.\n // Give the precedence to the JSX error, except if JSX had an\n // unrecoverable error while Flow didn't.\n // If the error is recoverable, we can only re-report it if there is\n // a node we can return.\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState!;\n return arrowExpression;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n /*:: invariant(typeParameters) */\n throw this.raise(\n FlowErrors.UnexpectedTokenAfterTypeParameter,\n typeParameters!,\n );\n }\n\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n // handle return types for arrow functions\n parseArrow(\n node: Undone,\n ): Undone | undefined | null {\n if (this.match(tt.colon)) {\n // @ts-expect-error todo(flow->ts)\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n\n const typeNode = this.startNode();\n\n [\n typeNode.typeAnnotation,\n // @ts-expect-error (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser() as [\n N.FlowType,\n N.FlowPredicate,\n ];\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(tt.arrow)) this.unexpected();\n\n return typeNode;\n });\n\n if (result.thrown) return null;\n /*:: invariant(result.node) */\n\n if (result.error) this.state = result.failState;\n\n // assign after it is clear it is an arrow\n // @ts-expect-error todo(flow->ts)\n node.returnType = result.node.typeAnnotation\n ? this.finishNode(result.node!, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow(params: Array): boolean {\n return this.match(tt.colon) || super.shouldParseArrow(params);\n }\n\n setArrowFunctionParameters(\n node: Undone,\n params:\n | Array\n | Array,\n ): void {\n if (\n this.state.noArrowParamsConversionAt.includes(\n this.offsetToSourcePos(node.start),\n )\n ) {\n node.params = params as N.ArrowFunctionExpression[\"params\"];\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(\n node: N.Function,\n allowDuplicates: boolean,\n isArrowFunction?: boolean | null,\n strictModeChanged: boolean = true,\n ): void {\n if (\n isArrowFunction &&\n this.state.noArrowParamsConversionAt.includes(\n this.offsetToSourcePos(node.start),\n )\n ) {\n return;\n }\n\n // ensure the `this` param is first, if it exists\n for (let i = 0; i < node.params.length; i++) {\n if (this.isThisParam(node.params[i]) && i > 0) {\n this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);\n }\n }\n\n super.checkParams(\n node,\n allowDuplicates,\n isArrowFunction,\n strictModeChanged,\n );\n }\n\n parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {\n return super.parseParenAndDistinguishExpression(\n canBeArrow &&\n !this.state.noArrowAt.includes(\n this.sourceToOffsetPos(this.state.start),\n ),\n );\n }\n\n parseSubscripts(\n base: N.Expression,\n startLoc: Position,\n noCalls?: boolean | null,\n ): N.Expression {\n if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.noArrowAt.includes(startLoc.index)\n ) {\n this.next();\n\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = super.parseCallExpressionArguments();\n base = this.finishNode(node, \"CallExpression\");\n } else if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.match(tt.lt)\n ) {\n const state = this.state.clone();\n const arrow = this.tryParse(\n abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(),\n state,\n );\n\n /*:: invariant(arrow.node != null) */\n // @ts-expect-error: refine tryParse typings\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n const result = this.tryParse(\n () => super.parseSubscripts(base, startLoc, noCalls),\n state,\n );\n\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n // @ts-expect-error: refine tryParse typings\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState!;\n return result.node;\n }\n\n throw arrow.error || result.error!;\n }\n\n return super.parseSubscripts(base, startLoc, noCalls);\n }\n\n parseSubscript(\n base: N.Expression,\n\n startLoc: Position,\n noCalls: boolean | undefined | null,\n subscriptState: N.ParseSubscriptState,\n ): N.Expression {\n if (this.match(tt.questionDot) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.typeArguments =\n this.flowParseTypeParameterInstantiationInExpression();\n this.expect(tt.parenL);\n node.arguments = this.parseCallExpressionArguments();\n node.optional = true;\n return this.finishCallExpression(node, /* optional */ true);\n } else if (\n !noCalls &&\n this.shouldParseTypes() &&\n (this.match(tt.lt) ||\n // also handles `new C<`\n this.match(tt.bitShiftL))\n ) {\n const node = this.startNodeAt<\n N.OptionalCallExpression | N.CallExpression\n >(startLoc);\n node.callee = base;\n\n const result = this.tryParse(() => {\n node.typeArguments =\n this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(tt.parenL);\n node.arguments = super.parseCallExpressionArguments();\n if (subscriptState.optionalChainMember) {\n (node as Undone).optional = false;\n }\n return this.finishCallExpression(\n node,\n subscriptState.optionalChainMember,\n );\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(\n base,\n\n startLoc,\n noCalls,\n subscriptState,\n );\n }\n\n parseNewCallee(node: N.NewExpression): void {\n super.parseNewCallee(node);\n\n let targs = null;\n if (this.shouldParseTypes() && this.match(tt.lt)) {\n targs = this.tryParse(() =>\n this.flowParseTypeParameterInstantiationCallOrNew(),\n ).node;\n }\n node.typeArguments = targs;\n }\n\n parseAsyncArrowWithTypeParameters(\n startLoc: Position,\n ): N.ArrowFunctionExpression | undefined | null {\n const node = this.startNodeAt(startLoc);\n this.parseFunctionParams(node, false);\n if (!this.parseArrow(node)) return;\n return super.parseArrowExpression(\n node,\n /* params */ undefined,\n /* isAsync */ true,\n );\n }\n\n readToken_mult_modulo(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.asterisk &&\n next === charCodes.slash &&\n this.state.hasFlowComment\n ) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.verticalBar &&\n next === charCodes.rightCurlyBrace\n ) {\n // '|}'\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file: N.File, program: N.Program): N.File {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(\n FlowErrors.UnterminatedFlowComment,\n this.state.curPosition(),\n );\n }\n return fileNode;\n }\n\n skipBlockComment(): N.CommentBlock | undefined {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc);\n }\n this.hasFlowCommentCompletion();\n const commentSkip = this.skipFlowComment();\n if (commentSkip) {\n this.state.pos += commentSkip;\n this.state.hasFlowComment = true;\n }\n return;\n }\n\n return super.skipBlockComment(this.state.hasFlowComment ? \"*-/\" : \"*/\");\n }\n\n skipFlowComment(): number | false {\n const { pos } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while (\n [charCodes.space, charCodes.tab].includes(\n // @ts-expect-error testing whether a number is included\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace),\n )\n ) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === charCodes.colon && ch3 === charCodes.colon) {\n return shiftToFirstNonWhiteSpace + 2; // check for /*::\n }\n if (\n this.input.slice(\n shiftToFirstNonWhiteSpace + pos,\n shiftToFirstNonWhiteSpace + pos + 12,\n ) === \"flow-include\"\n ) {\n return shiftToFirstNonWhiteSpace + 12; // check for /*flow-include\n }\n if (ch2 === charCodes.colon && ch3 !== charCodes.colon) {\n return shiftToFirstNonWhiteSpace; // check for /*:, advance up to :\n }\n return false;\n }\n\n hasFlowCommentCompletion(): void {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n }\n\n // Flow enum parsing\n\n flowEnumErrorBooleanMemberNotInitialized(\n loc: Position,\n {\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, {\n memberName,\n enumName,\n });\n }\n\n flowEnumErrorInvalidMemberInitializer(\n loc: Position,\n enumContext: EnumContext,\n ) {\n return this.raise(\n !enumContext.explicitType\n ? FlowErrors.EnumInvalidMemberInitializerUnknownType\n : enumContext.explicitType === \"symbol\"\n ? FlowErrors.EnumInvalidMemberInitializerSymbolType\n : FlowErrors.EnumInvalidMemberInitializerPrimaryType,\n loc,\n enumContext,\n );\n }\n\n flowEnumErrorNumberMemberNotInitialized(\n loc: Position,\n details: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details);\n }\n\n flowEnumErrorStringMemberInconsistentlyInitialized(\n node: N.Node,\n details: {\n enumName: string;\n },\n ): void {\n this.raise(\n FlowErrors.EnumStringMemberInconsistentlyInitialized,\n node,\n details,\n );\n }\n\n flowEnumMemberInit(): EnumMemberInit {\n const startLoc = this.state.startLoc;\n const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);\n switch (this.state.type) {\n case tt.num: {\n const literal = this.parseNumericLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"number\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt.string: {\n const literal = this.parseStringLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"string\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt._true:\n case tt._false: {\n const literal = this.parseBooleanLiteral(this.match(tt._true));\n if (endOfInit()) {\n return {\n type: \"boolean\",\n loc: literal.loc.start,\n value: literal,\n };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n default:\n return { type: \"invalid\", loc: startLoc };\n }\n }\n\n flowEnumMemberRaw(): {\n id: N.Identifier;\n init: EnumMemberInit;\n } {\n const loc = this.state.startLoc;\n const id = this.parseIdentifier(true);\n const init = this.eat(tt.eq)\n ? this.flowEnumMemberInit()\n : { type: \"none\" as const, loc };\n return { id, init };\n }\n\n flowEnumCheckExplicitTypeMismatch(\n loc: Position,\n context: EnumContext,\n expectedType: EnumExplicitType,\n ): void {\n const { explicitType } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(loc, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType,\n }: {\n enumName: string;\n explicitType: EnumExplicitType;\n }): {\n members: {\n booleanMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumBooleanMember\" }\n >[];\n numberMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumNumberMember\" }\n >[];\n stringMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumStringMember\" }\n >[];\n defaultedMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumDefaultedMember\" }\n >[];\n };\n hasUnknownMembers: boolean;\n } {\n const seenNames = new Set();\n const members = {\n booleanMembers: [],\n numberMembers: [],\n stringMembers: [],\n defaultedMembers: [],\n };\n let hasUnknownMembers = false;\n while (!this.match(tt.braceR)) {\n if (this.eat(tt.ellipsis)) {\n hasUnknownMembers = true;\n break;\n }\n const memberNode = this.startNode();\n const { id, init } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.raise(FlowErrors.EnumInvalidMemberName, id, {\n memberName,\n suggestion: memberName[0].toUpperCase() + memberName.slice(1),\n enumName,\n });\n }\n if (seenNames.has(memberName)) {\n this.raise(FlowErrors.EnumDuplicateMemberName, id, {\n memberName,\n enumName,\n });\n }\n seenNames.add(memberName);\n const context = { enumName, explicitType, memberName };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\": {\n this.flowEnumCheckExplicitTypeMismatch(\n init.loc,\n context,\n \"boolean\",\n );\n memberNode.init = init.value;\n members.booleanMembers.push(\n // @ts-expect-error NodeAny not supported\n this.finishNode(memberNode, \"EnumBooleanMember\"),\n );\n break;\n }\n case \"number\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(\n // @ts-expect-error NodeAny not supported\n this.finishNode(memberNode, \"EnumNumberMember\"),\n );\n break;\n }\n case \"string\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(\n // @ts-expect-error NodeAny not supported\n this.finishNode(memberNode, \"EnumStringMember\"),\n );\n break;\n }\n case \"invalid\": {\n throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);\n }\n case \"none\": {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(\n init.loc,\n context,\n );\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);\n break;\n default:\n members.defaultedMembers.push(\n // @ts-expect-error NodeAny not supported\n this.finishNode(memberNode, \"EnumDefaultedMember\"),\n );\n }\n }\n }\n\n if (!this.match(tt.braceR)) {\n this.expect(tt.comma);\n }\n }\n return { members, hasUnknownMembers };\n }\n\n flowEnumStringMembers(\n initializedMembers: Array,\n defaultedMembers: Array,\n {\n enumName,\n }: {\n enumName: string;\n },\n ): Array {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {\n enumName,\n });\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {\n enumName,\n });\n }\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName,\n }: {\n enumName: string;\n }): EnumExplicitType {\n if (!this.eatContextual(tt._of)) return null;\n\n if (!tokenIsIdentifier(this.state.type)) {\n throw this.raise(\n FlowErrors.EnumInvalidExplicitTypeUnknownSupplied,\n this.state.startLoc,\n {\n enumName,\n },\n );\n }\n\n const { value } = this.state;\n this.next();\n\n if (\n value !== \"boolean\" &&\n value !== \"number\" &&\n value !== \"string\" &&\n value !== \"symbol\"\n ) {\n this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, {\n enumName,\n invalidEnumType: value,\n });\n }\n\n return value;\n }\n\n flowEnumBody(node: Undone, id: N.Identifier): N.Node {\n const enumName = id.name;\n const nameLoc = id.loc.start;\n const explicitType = this.flowEnumParseExplicitType({ enumName });\n this.expect(tt.braceL);\n const { members, hasUnknownMembers } = this.flowEnumMembers({\n enumName,\n explicitType,\n });\n node.hasUnknownMembers = hasUnknownMembers;\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n default: {\n // `explicitType` is `null`\n const empty = () => {\n node.members = [];\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, {\n enumName,\n });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(\n node: Undone,\n ): N.FlowEnumDeclaration {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), id);\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n if (this.shouldParseTypes()) {\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n node.typeArguments =\n this.flowParseTypeParameterInstantiationInExpression();\n }\n }\n\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n // check if the next token is a tt.lt\n isLookaheadToken_lt(): boolean {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === charCodes.lessThan) {\n const afterNext = this.input.charCodeAt(next + 1);\n return (\n afterNext !== charCodes.lessThan && afterNext !== charCodes.equalsTo\n );\n }\n return false;\n }\n\n // used after we have finished parsing types\n reScan_lt_gt() {\n const { type } = this.state;\n if (type === tt.lt) {\n this.state.pos -= 1;\n this.readToken_lt();\n } else if (type === tt.gt) {\n this.state.pos -= 1;\n this.readToken_gt();\n }\n }\n\n reScan_lt() {\n const { type } = this.state;\n if (type === tt.bitShiftL) {\n this.state.pos -= 2;\n this.finishOp(tt.lt, 1);\n return tt.lt;\n }\n return type;\n }\n\n maybeUnwrapTypeCastExpression(node: N.Node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n };\n","const entities: { [name: string]: string } = {\n // @ts-expect-error __proto__ is not an actual property: https://github.com/microsoft/TypeScript/issues/38385\n __proto__: null,\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\",\n} as const;\nexport default entities;\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n|[\\r\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport function hasNewLine(input: string, start: number, end: number): boolean {\n for (let i = start; i < end; i++) {\n if (isNewLine(input.charCodeAt(i))) {\n return true;\n }\n }\n return false;\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import * as charCodes from \"charcodes\";\n\nimport XHTMLEntities from \"./xhtml.ts\";\nimport type Parser from \"../../parser/index.ts\";\nimport type { ExpressionErrors } from \"../../parser/util.ts\";\nimport {\n tokenComesBeforeExpression,\n tokenIsKeyword,\n tokenLabelName,\n type TokenType,\n tt,\n} from \"../../tokenizer/types.ts\";\nimport type { TokContext } from \"../../tokenizer/context.ts\";\nimport { types as tc } from \"../../tokenizer/context.ts\";\nimport type * as N from \"../../types.ts\";\nimport { isIdentifierChar, isIdentifierStart } from \"../../util/identifier.ts\";\nimport type { Position } from \"../../util/location.ts\";\nimport { isNewLine } from \"../../util/whitespace.ts\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error.ts\";\nimport type { Undone } from \"../../parser/node.ts\";\n\n/* eslint sort-keys: \"error\" */\nconst JsxErrors = ParseErrorEnum`jsx`({\n AttributeIsEmpty:\n \"JSX attributes must only be assigned a non-empty expression.\",\n MissingClosingTagElement: ({ openingTagName }: { openingTagName: string }) =>\n `Expected corresponding JSX closing tag for <${openingTagName}>.`,\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>.\",\n UnexpectedSequenceExpression:\n \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n // FIXME: Unify with Errors.UnexpectedToken\n UnexpectedToken: ({\n unexpected,\n HTMLEntity,\n }: {\n unexpected: string;\n HTMLEntity: string;\n }) =>\n `Unexpected token \\`${unexpected}\\`. Did you mean \\`${HTMLEntity}\\` or \\`{'${unexpected}'}\\`?`,\n UnsupportedJsxValue:\n \"JSX value should be either an expression or a quoted JSX text.\",\n UnterminatedJsxContent: \"Unterminated JSX contents.\",\n UnwrappedAdjacentJSXElements:\n \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?\",\n});\n\n/* eslint-disable sort-keys */\n\nfunction isFragment(object?: N.JSXTag | null): object is N.JSXFragmentTag {\n return object\n ? object.type === \"JSXOpeningFragment\" ||\n object.type === \"JSXClosingFragment\"\n : false;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(\n object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,\n): string {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return (\n getQualifiedJSXName(object.object) +\n \".\" +\n getQualifiedJSXName(object.property)\n );\n }\n\n // istanbul ignore next\n // @ts-expect-error - object is 'never'\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nexport interface IJSXParserMixin {\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement;\n}\n\nexport type ClassWithMixin<\n T extends new (...args: any) => any,\n M extends object,\n> = T extends new (...args: infer P) => infer I\n ? new (...args: P) => I & M\n : never;\n\nexport default (superClass: typeof Parser) =>\n class JSXParserMixin extends superClass implements Parser, IJSXParserMixin {\n // Reads inline JSX contents token.\n\n jsxReadToken(): void {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(\n JsxErrors.UnterminatedJsxContent,\n this.state.startLoc,\n );\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case charCodes.lessThan:\n case charCodes.leftCurlyBrace:\n if (this.state.pos === this.state.start) {\n if (ch === charCodes.lessThan && this.state.canStartJSXElement) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n } else {\n super.getTokenFromCode(ch);\n }\n return;\n }\n out += this.input.slice(chunkStart, this.state.pos);\n this.finishToken(tt.jsxText, out);\n return;\n\n case charCodes.ampersand:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n case charCodes.greaterThan:\n case charCodes.rightCurlyBrace:\n if (process.env.BABEL_8_BREAKING) {\n this.raise(JsxErrors.UnexpectedToken, this.state.curPosition(), {\n unexpected: this.input[this.state.pos],\n HTMLEntity:\n ch === charCodes.rightCurlyBrace ? \"}\" : \">\",\n });\n }\n /* falls through */\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF: boolean): string {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (\n ch === charCodes.carriageReturn &&\n this.input.charCodeAt(this.state.pos) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n\n return out;\n }\n\n jsxReadString(quote: number): void {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(Errors.UnterminatedString, this.state.startLoc);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === charCodes.ampersand) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n this.finishToken(tt.string, out);\n }\n\n jsxReadEntity(): string {\n const startPos = ++this.state.pos;\n if (this.codePointAtPos(this.state.pos) === charCodes.numberSign) {\n ++this.state.pos;\n\n let radix = 10;\n if (this.codePointAtPos(this.state.pos) === charCodes.lowercaseX) {\n radix = 16;\n ++this.state.pos;\n }\n\n const codePoint = this.readInt(\n radix,\n /* len */ undefined,\n /* forceLen */ false,\n /* allowNumSeparator */ \"bail\",\n );\n if (\n codePoint !== null &&\n this.codePointAtPos(this.state.pos) === charCodes.semicolon\n ) {\n ++this.state.pos;\n return String.fromCodePoint(codePoint);\n }\n } else {\n let count = 0;\n let semi = false;\n while (\n count++ < 10 &&\n this.state.pos < this.length &&\n !(semi = this.codePointAtPos(this.state.pos) === charCodes.semicolon)\n ) {\n ++this.state.pos;\n }\n\n if (semi) {\n const desc = this.input.slice(startPos, this.state.pos);\n const entity = XHTMLEntities[desc];\n ++this.state.pos;\n\n if (entity) {\n return entity;\n }\n }\n }\n\n // Not a valid entity\n this.state.pos = startPos;\n return \"&\";\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can\"t contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsxReadWord(): void {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === charCodes.dash);\n this.finishToken(tt.jsxName, this.input.slice(start, this.state.pos));\n }\n\n // Parse next token as JSX identifier\n\n jsxParseIdentifier(): N.JSXIdentifier {\n const node = this.startNode();\n if (this.match(tt.jsxName)) {\n node.name = this.state.value;\n } else if (tokenIsKeyword(this.state.type)) {\n node.name = tokenLabelName(this.state.type);\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n // Parse namespaced identifier.\n\n jsxParseNamespacedName(): N.JSXNamespacedName | N.JSXIdentifier {\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(tt.colon)) return name;\n\n const node = this.startNodeAt(startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsxParseElementName():\n | N.JSXIdentifier\n | N.JSXNamespacedName\n | N.JSXMemberExpression {\n const startLoc = this.state.startLoc;\n let node: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression =\n this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(tt.dot)) {\n const newNode = this.startNodeAt(startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsxParseAttributeValue():\n | N.JSXExpressionContainer\n | N.JSXElement\n | N.StringLiteral {\n let node;\n switch (this.state.type) {\n case tt.braceL:\n node = this.startNode();\n this.setContext(tc.brace);\n this.next();\n node = this.jsxParseExpressionContainer(node, tc.j_oTag);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(JsxErrors.AttributeIsEmpty, node);\n }\n return node;\n\n case tt.jsxTagStart:\n case tt.string:\n return this.parseExprAtom() as N.JSXElement | N.StringLiteral;\n\n default:\n throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsxParseEmptyExpression(): N.JSXEmptyExpression {\n const node = this.startNodeAt(this.state.lastTokEndLoc!);\n return this.finishNodeAt(node, \"JSXEmptyExpression\", this.state.startLoc);\n }\n\n // Parse JSX spread child\n\n jsxParseSpreadChild(node: Undone): N.JSXSpreadChild {\n this.next(); // ellipsis\n node.expression = this.parseExpression();\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsxParseExpressionContainer(\n node: Undone,\n previousContext: TokContext,\n ): N.JSXExpressionContainer {\n if (this.match(tt.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n expression.type === \"SequenceExpression\" &&\n !expression.extra?.parenthesized\n ) {\n this.raise(\n JsxErrors.UnexpectedSequenceExpression,\n expression.expressions[1],\n );\n }\n }\n\n node.expression = expression;\n }\n this.setContext(previousContext);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsxParseAttribute(): N.JSXAttribute | N.JSXSpreadAttribute {\n const node = this.startNode();\n if (this.match(tt.braceL)) {\n this.setContext(tc.brace);\n this.next();\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssignAllowIn();\n this.setContext(tc.j_oTag);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n // Parses JSX opening tag starting after \"<\".\n\n jsxParseOpeningElementAt(\n startLoc: Position,\n ): N.JSXOpeningElement | N.JSXOpeningFragment {\n const node = this.startNodeAt(\n startLoc,\n );\n if (this.eat(tt.jsxTagEnd)) {\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(\n node as Undone,\n );\n }\n\n jsxParseOpeningElementAfterName(\n node: Undone,\n ): N.JSXOpeningElement {\n const attributes: (N.JSXAttribute | N.JSXSpreadAttribute)[] = [];\n while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(tt.slash);\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n // Parses JSX closing tag starting after \"(\n startLoc,\n );\n if (this.eat(tt.jsxTagEnd)) {\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n node.name = this.jsxParseElementName();\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n // Parses entire JSX element, including it\"s opening tag\n // (starting after \"<\"), attributes, contents and closing tag.\n\n jsxParseElementAt(startLoc: Position): N.JSXElement | N.JSXFragment {\n const node = this.startNodeAt(startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startLoc);\n let closingElement = null;\n\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case tt.jsxTagStart:\n startLoc = this.state.startLoc;\n this.next();\n if (this.eat(tt.slash)) {\n closingElement = this.jsxParseClosingElementAt(startLoc);\n break contents;\n }\n children.push(this.jsxParseElementAt(startLoc));\n break;\n\n case tt.jsxText:\n children.push(this.parseLiteral(this.state.value, \"JSXText\"));\n break;\n\n case tt.braceL: {\n const node = this.startNode<\n N.JSXSpreadChild | N.JSXExpressionContainer\n >();\n this.setContext(tc.brace);\n this.next();\n if (this.match(tt.ellipsis)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(\n this.jsxParseExpressionContainer(node, tc.j_expr),\n );\n }\n\n break;\n }\n // istanbul ignore next - should never happen\n default:\n this.unexpected();\n }\n }\n\n if (\n isFragment(openingElement) &&\n !isFragment(closingElement) &&\n closingElement !== null\n ) {\n this.raise(JsxErrors.MissingClosingTagFragment, closingElement);\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(JsxErrors.MissingClosingTagElement, closingElement, {\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (\n getQualifiedJSXName(closingElement.name) !==\n getQualifiedJSXName(openingElement.name)\n ) {\n this.raise(JsxErrors.MissingClosingTagElement, closingElement, {\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n }\n }\n }\n\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n node.children = children;\n if (this.match(tt.lt)) {\n throw this.raise(\n JsxErrors.UnwrappedAdjacentJSXElements,\n this.state.startLoc,\n );\n }\n\n return isFragment(openingElement)\n ? this.finishNode(node, \"JSXFragment\")\n : this.finishNode(node, \"JSXElement\");\n }\n\n // Parses entire JSX element from current position.\n\n jsxParseElement(): N.JSXElement | N.JSXFragment {\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startLoc);\n }\n\n setContext(newContext: TokContext) {\n const { context } = this.state;\n context[context.length - 1] = newContext;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseExprAtom(refExpressionErrors?: ExpressionErrors | null): N.Expression {\n if (this.match(tt.jsxTagStart)) {\n return this.jsxParseElement();\n } else if (\n this.match(tt.lt) &&\n this.input.charCodeAt(this.state.pos) !== charCodes.exclamationMark\n ) {\n // In case we encounter an lt token here it will always be the start of\n // jsx as the lt sign is not allowed in places that expect an expression\n this.replaceToken(tt.jsxTagStart);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n skipSpace() {\n const curContext = this.curContext();\n if (!curContext.preserveSpace) super.skipSpace();\n }\n\n getTokenFromCode(code: number): void {\n const context = this.curContext();\n\n if (context === tc.j_expr) {\n this.jsxReadToken();\n return;\n }\n\n if (context === tc.j_oTag || context === tc.j_cTag) {\n if (isIdentifierStart(code)) {\n this.jsxReadWord();\n return;\n }\n\n if (code === charCodes.greaterThan) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagEnd);\n return;\n }\n\n if (\n (code === charCodes.quotationMark || code === charCodes.apostrophe) &&\n context === tc.j_oTag\n ) {\n this.jsxReadString(code);\n return;\n }\n }\n\n if (\n code === charCodes.lessThan &&\n this.state.canStartJSXElement &&\n this.input.charCodeAt(this.state.pos + 1) !== charCodes.exclamationMark\n ) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n return;\n }\n\n super.getTokenFromCode(code);\n }\n\n updateContext(prevType: TokenType): void {\n const { context, type } = this.state;\n if (type === tt.slash && prevType === tt.jsxTagStart) {\n // do not consider JSX expr -> JSX open tag -> ... anymore\n // reconsider as closing tag context\n context.splice(-2, 2, tc.j_cTag);\n this.state.canStartJSXElement = false;\n } else if (type === tt.jsxTagStart) {\n // start opening tag context\n context.push(tc.j_oTag);\n } else if (type === tt.jsxTagEnd) {\n const out = context[context.length - 1];\n if ((out === tc.j_oTag && prevType === tt.slash) || out === tc.j_cTag) {\n context.pop();\n this.state.canStartJSXElement =\n context[context.length - 1] === tc.j_expr;\n } else {\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement = true;\n }\n } else {\n this.state.canStartJSXElement = tokenComesBeforeExpression(type);\n }\n }\n };\n","import type { Position } from \"../../util/location.ts\";\nimport ScopeHandler, { NameType, Scope } from \"../../util/scope.ts\";\nimport { BindingFlag, ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type * as N from \"../../types.ts\";\nimport { Errors } from \"../../parse-error.ts\";\n\nconst enum TsNameType {\n Types = 1 << 0,\n // enums (which are also in .types)\n Enums = 1 << 1,\n // const enums (which are also in .enums and .types)\n ConstEnums = 1 << 2,\n // classes (which are also in .lexical) and interface (which are also in .types)\n Classes = 1 << 3,\n // namespaces and ambient functions (or classes) are too difficult to track,\n // especially without type analysis.\n // We need to track them anyway, to avoid \"X is not defined\" errors\n // when exporting them.\n ExportOnlyBindings = 1 << 4,\n}\n\nclass TypeScriptScope extends Scope {\n tsNames: Map = new Map();\n}\n\n// See https://github.com/babel/babel/pull/9766#discussion_r268920730 for an\n// explanation of how typescript handles scope.\n\nexport default class TypeScriptScopeHandler extends ScopeHandler {\n importsStack: Set[] = [];\n\n createScope(flags: ScopeFlag): TypeScriptScope {\n this.importsStack.push(new Set()); // Always keep the top-level scope for export checks.\n\n return new TypeScriptScope(flags);\n }\n\n enter(flags: ScopeFlag): void {\n if (flags === ScopeFlag.TS_MODULE) {\n this.importsStack.push(new Set());\n }\n\n super.enter(flags);\n }\n\n exit() {\n const flags = super.exit();\n\n if (flags === ScopeFlag.TS_MODULE) {\n this.importsStack.pop();\n }\n\n return flags;\n }\n\n hasImport(name: string, allowShadow?: boolean) {\n const len = this.importsStack.length;\n if (this.importsStack[len - 1].has(name)) {\n return true;\n }\n if (!allowShadow && len > 1) {\n for (let i = 0; i < len - 1; i++) {\n if (this.importsStack[i].has(name)) return true;\n }\n }\n return false;\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n if (bindingType & BindingFlag.FLAG_TS_IMPORT) {\n if (this.hasImport(name, true)) {\n this.parser.raise(Errors.VarRedeclaration, loc, {\n identifierName: name,\n });\n }\n this.importsStack[this.importsStack.length - 1].add(name);\n return;\n }\n\n const scope = this.currentScope();\n let type = scope.tsNames.get(name) || 0;\n\n if (bindingType & BindingFlag.FLAG_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.tsNames.set(name, type | TsNameType.ExportOnlyBindings);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n\n if (bindingType & BindingFlag.KIND_TYPE) {\n if (!(bindingType & BindingFlag.KIND_VALUE)) {\n // \"Value\" bindings have already been registered by the superclass.\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n }\n type = type | TsNameType.Types;\n }\n if (bindingType & BindingFlag.FLAG_TS_ENUM) {\n type = type | TsNameType.Enums;\n }\n if (bindingType & BindingFlag.FLAG_TS_CONST_ENUM) {\n type = type | TsNameType.ConstEnums;\n }\n if (bindingType & BindingFlag.FLAG_CLASS) {\n type = type | TsNameType.Classes;\n }\n if (type) scope.tsNames.set(name, type);\n }\n\n isRedeclaredInScope(\n scope: TypeScriptScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n const type = scope.tsNames.get(name)!;\n if ((type & TsNameType.Enums) > 0) {\n if (bindingType & BindingFlag.FLAG_TS_ENUM) {\n // Enums can be merged with other enums if they are both\n // const or both non-const.\n const isConst = !!(bindingType & BindingFlag.FLAG_TS_CONST_ENUM);\n const wasConst = (type & TsNameType.ConstEnums) > 0;\n return isConst !== wasConst;\n }\n return true;\n }\n if (\n bindingType & BindingFlag.FLAG_CLASS &&\n (type & TsNameType.Classes) > 0\n ) {\n if (scope.names.get(name)! & NameType.Lexical) {\n // Classes can be merged with interfaces\n return !!(bindingType & BindingFlag.KIND_VALUE);\n } else {\n // Interface can be merged with other classes or interfaces\n return false;\n }\n }\n if (bindingType & BindingFlag.KIND_TYPE && (type & TsNameType.Types) > 0) {\n return true;\n }\n\n return super.isRedeclaredInScope(scope, name, bindingType);\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n\n if (this.hasImport(name)) return;\n\n const len = this.scopeStack.length;\n for (let i = len - 1; i >= 0; i--) {\n const scope = this.scopeStack[i];\n const type = scope.tsNames.get(name)!;\n if (\n (type & TsNameType.Types) > 0 ||\n (type & TsNameType.ExportOnlyBindings) > 0\n ) {\n return;\n }\n }\n\n super.checkLocalExport(id);\n }\n}\n","// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport const enum ParamKind {\n // Initial Parameter flags\n PARAM = 0b0000,\n // track [Yield] production parameter\n PARAM_YIELD = 0b0001,\n // track [Await] production parameter\n PARAM_AWAIT = 0b0010,\n // track [Return] production parameter\n PARAM_RETURN = 0b0100,\n // track [In] production parameter\n PARAM_IN = 0b1000,\n}\n\n// todo(flow->ts) - check if more granular type can be used,\n// type below is not good because things like PARAM_AWAIT|PARAM_YIELD are not included\n// export type ParamKind =\n// | typeof PARAM\n// | typeof PARAM_AWAIT\n// | typeof PARAM_IN\n// | typeof PARAM_RETURN\n// | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array = [];\n enter(flags: ParamKind) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): ParamKind {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_RETURN) > 0;\n }\n\n get hasIn(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_IN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (\n (isAsync ? ParamKind.PARAM_AWAIT : 0) |\n (isGenerator ? ParamKind.PARAM_YIELD : 0)\n );\n}\n","import type { OptionFlags, Options } from \"../options.ts\";\nimport type State from \"../tokenizer/state.ts\";\nimport type { PluginsMap } from \"./index.ts\";\nimport type ScopeHandler from \"../util/scope.ts\";\nimport type ExpressionScopeHandler from \"../util/expression-scope.ts\";\nimport type ClassScopeHandler from \"../util/class-scope.ts\";\nimport type ProductionParameterHandler from \"../util/production-parameter.ts\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings.ts\";\nimport type * as N from \"../types.ts\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare optionFlags: OptionFlags;\n declare inModule: boolean;\n declare scope: ScopeHandler;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n declare startIndex: number;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n // Comment store for Program.comments\n declare comments: Array;\n\n sourceToOffsetPos(sourcePos: number) {\n return sourcePos + this.startIndex;\n }\n\n offsetToSourcePos(offsetPos: number) {\n return offsetPos - this.startIndex;\n }\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions)?.[\n name\n ];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base.ts\";\nimport type { Comment, Node } from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node.ts\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(node: Undone, comments: Array) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n const { commentsLen } = this.state;\n if (this.comments.length !== commentsLen) {\n this.comments.length = commentsLen;\n }\n this.comments.push(comment);\n this.state.commentsLen++;\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const node = commentWS.containingNode!;\n const commentStart = commentWS.start;\n if (\n this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) ===\n charCodes.comma\n ) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"ImportExpression\":\n adjustInnerComments(\n node,\n [node.source, node.options ?? null],\n commentWS,\n );\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n case \"TSEnumDeclaration\":\n if (!process.env.BABEL_8_BREAKING) {\n adjustInnerComments(node, node.members!, commentWS);\n } else {\n setInnerComments(node, comments);\n }\n break;\n case \"TSEnumBody\":\n adjustInnerComments(node, node.members, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 *​/ function f() {}\n * ```\n * the comment whitespace `/* 1 *​/` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 *​/` as\n * inner comments. So `/* 1 *​/` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import type { OptionsWithDefaults } from \"../options.ts\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location.ts\";\n\nimport { types as ct, type TokContext } from \"./context.ts\";\nimport { tt, type TokenType } from \"./types.ts\";\nimport type { Errors } from \"../parse-error.ts\";\nimport type { ParseError } from \"../parse-error.ts\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport const enum LoopLabelKind {\n Loop = 1,\n Switch = 2,\n}\n\ndeclare const bit: import(\"../../../../scripts/babel-plugin-bit-decorator/types.d.ts\").BitDecorator;\n\nexport default class State {\n @bit.storage flags: number = 0;\n\n @bit accessor strict = false;\n\n startIndex!: number;\n curLine!: number;\n lineStart!: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc!: Position;\n endLoc!: Position;\n\n init({\n strictMode,\n sourceType,\n startIndex,\n startLine,\n startColumn,\n }: OptionsWithDefaults): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.startIndex = startIndex;\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(\n startLine,\n startColumn,\n startIndex,\n );\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n @bit accessor maybeInArrowParameters = false;\n @bit accessor inType = false;\n @bit accessor noAnonFunctionType = false;\n @bit accessor hasFlowComment = false;\n @bit accessor isAmbientContext = false;\n @bit accessor inAbstractClass = false;\n @bit accessor inDisallowConditionalTypesContext = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n @bit accessor soloAwait = false;\n @bit accessor inFSharpPipelineDirectBody = false;\n\n // Labels in scope.\n labels: Array<{\n kind: LoopLabelKind | null;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n commentsLen = 0;\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position | null = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position | null = null;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n\n // Used to track whether a JSX element is allowed to form\n @bit accessor canStartJSXElement = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n @bit accessor containsEsc = false;\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n @bit accessor hasTopLevelAwait = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n /**\n * When we add a new property, we must manually update the `clone` method\n * @see State#clone\n */\n\n curPosition(): Position {\n return new Position(\n this.curLine,\n this.pos - this.lineStart,\n this.pos + this.startIndex,\n );\n }\n\n clone(): State {\n const state = new State();\n state.flags = this.flags;\n state.startIndex = this.startIndex;\n state.curLine = this.curLine;\n state.lineStart = this.lineStart;\n state.startLoc = this.startLoc;\n state.endLoc = this.endLoc;\n state.errors = this.errors.slice();\n state.potentialArrowAt = this.potentialArrowAt;\n state.noArrowAt = this.noArrowAt.slice();\n state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();\n state.topicContext = this.topicContext;\n state.labels = this.labels.slice();\n state.commentsLen = this.commentsLen;\n state.commentStack = this.commentStack.slice();\n state.pos = this.pos;\n state.type = this.type;\n state.value = this.value;\n state.start = this.start;\n state.end = this.end;\n state.lastTokEndLoc = this.lastTokEndLoc;\n state.lastTokStartLoc = this.lastTokStartLoc;\n state.context = this.context.slice();\n state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;\n state.strictErrors = this.strictErrors;\n state.tokensLength = this.tokensLength;\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position | null;\n curLine: number;\n lineStart: number;\n curPosition: State[\"curPosition\"];\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport type { OptionsWithDefaults } from \"../options.ts\";\nimport { OptionFlags } from \"../options.ts\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location.ts\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments.ts\";\nimport type * as N from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier.ts\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types.ts\";\nimport type { TokContext } from \"./context.ts\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error.ts\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace.ts\";\nimport State from \"./state.ts\";\nimport type { LookaheadState, DeferredStrictError } from \"./state.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { Node } from \"../types.ts\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings.ts\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n const startIndex = state.startIndex || 0;\n this.type = state.type;\n this.value = state.value;\n this.start = startIndex + state.start;\n this.end = startIndex + state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: OptionsWithDefaults, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.comments = [];\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.optionFlags & OptionFlags.Tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.lookaheadCharCodeSince(this.state.pos);\n }\n\n lookaheadCharCodeSince(pos: number): number {\n return this.input.charCodeAt(this.nextTokenStartSince(pos));\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, at),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end + commentEnd.length),\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n loc: new SourceLocation(startLoc!, this.state.curPosition()),\n };\n if (this.optionFlags & OptionFlags.Tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end),\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n loc: new SourceLocation(startLoc!, this.state.curPosition()),\n };\n if (this.optionFlags & OptionFlags.Tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments: N.Comment[] | null =\n this.optionFlags & OptionFlags.AttachComment ? [] : null;\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.optionFlags & OptionFlags.AnnexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.optionFlags & OptionFlags.AnnexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ` + + + +``` + +Browser support was done mostly for the online demo. If you find any errors - feel +free to send pull requests with fixes. Also note, that IE and other old browsers +needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. + +Notes: + +1. We have no resources to support browserified version. Don't expect it to be + well tested. Don't expect fast fixes if something goes wrong there. +2. `!!js/function` in browser bundle will not work by default. If you really need + it - load `esprima` parser first (via amd or directly). +3. `!!bin` in browser will return `Array`, because browsers do not support + node.js `Buffer` and adding Buffer shims is completely useless on practice. + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and +[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more +info. + +``` javascript +const yaml = require('js-yaml'); +const fs = require('fs'); + +// Get document, or throw exception on error +try { + const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### safeLoad (string [ , options ]) + +**Recommended loading way.** Parses `string` as single YAML document. Returns either a +plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does +not support regexps, functions and undefined. This method is safe for untrusted data. + +options: + +- `filename` _(default: null)_ - string to be used as a file path in + error/warning messages. +- `onWarning` _(default: null)_ - function to call on warning messages. + Loader will call this function with an instance of `YAMLException` for each warning. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. + - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: + http://www.yaml.org/spec/1.2/spec.html#id2802346 + - `JSON_SCHEMA` - all JSON-supported types: + http://www.yaml.org/spec/1.2/spec.html#id2803231 + - `CORE_SCHEMA` - same as `JSON_SCHEMA`: + http://www.yaml.org/spec/1.2/spec.html#id2804923 + - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones + (`!!js/undefined`, `!!js/regexp` and `!!js/function`): + http://yaml.org/type/ + - `DEFAULT_FULL_SCHEMA` - all supported YAML types. +- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. + +NOTE: This function **does not** understand multi-document sources, it throws +exception on those. + +NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. +So, the JSON schema is not as strictly defined in the YAML specification. +It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. +The core schema also has no such restrictions. It allows binary notation for integers. + + +### load (string [ , options ]) + +**Use with care with untrusted sources**. The same as `safeLoad()` but uses +`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: +`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you +must additionally validate object structure to avoid injections: + +``` javascript +const untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; + +// I'm just converting that string, what could possibly go wrong? +require('js-yaml').load(untrusted_code) + '' +``` + + +### safeLoadAll (string [, iterator] [, options ]) + +Same as `safeLoad()`, but understands multi-document sources. Applies +`iterator` to each document if specified, or returns array of documents. + +``` javascript +const yaml = require('js-yaml'); + +yaml.safeLoadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### loadAll (string [, iterator] [ , options ]) + +Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. + + +### safeDump (object [ , options ]) + +Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will +throw an exception if you try to dump regexps or functions. However, you can +disable exceptions by setting the `skipInvalid` option to `true`. + +options: + +- `indent` _(default: 2)_ - indentation width to use (in spaces). +- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements +- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function + in the safe schema) and skip pairs and single values with such types. +- `flowLevel` (default: -1) - specifies level of nesting, when to switch from + block to flow style for collections. -1 means block style everwhere +- `styles` - "tag" => "style" map. Each tag may have own set of styles. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. +- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a + function, use the function to sort the keys. +- `lineWidth` _(default: `80`)_ - set max line width. +- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references +- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older + yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 +- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. + +The following table show availlable styles (e.g. "canonical", +"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml +output is shown on the right side after `=>` (default setting) or `->`: + +``` none +!!null + "canonical" -> "~" + "lowercase" => "null" + "uppercase" -> "NULL" + "camelcase" -> "Null" + +!!int + "binary" -> "0b1", "0b101010", "0b1110001111010" + "octal" -> "01", "052", "016172" + "decimal" => "1", "42", "7290" + "hexadecimal" -> "0x1", "0x2A", "0x1C7A" + +!!bool + "lowercase" => "true", "false" + "uppercase" -> "TRUE", "FALSE" + "camelcase" -> "True", "False" + +!!float + "lowercase" => ".nan", '.inf' + "uppercase" -> ".NAN", '.INF' + "camelcase" -> ".NaN", '.Inf' +``` + +Example: + +``` javascript +safeDump (object, { + 'styles': { + '!!null': 'canonical' // dump null as ~ + }, + 'sortKeys': true // sort object keys +}); +``` + +### dump (object [ , options ]) + +Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). + + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScipt types. See also +[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and +[YAML types repository](http://yaml.org/type/). + +``` +!!null '' # null +!!bool 'yes' # bool +!!int '3...' # number +!!float '3.14...' # number +!!binary '...base64...' # buffer +!!timestamp 'YYYY-...' # date +!!omap [ ... ] # array of key-value pairs +!!pairs [ ... ] # array or array pairs +!!set { ... } # array of objects with given keys and null values +!!str '...' # string +!!seq [ ... ] # array +!!map { ... } # object +``` + +**JavaScript-specific tags** + +``` +!!js/regexp /pattern/gim # RegExp +!!js/undefined '' # Undefined +!!js/function 'function () {...}' # Function +``` + +Caveats +------- + +Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects +or arrays as keys, and stringifies (by calling `toString()` method) them at the +moment of adding them. + +``` yaml +--- +? [ foo, bar ] +: - baz +? { foo: bar } +: - baz + - baz +``` + +``` javascript +{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } +``` + +Also, reading of properties on implicit block mapping keys is not supported yet. +So, the following YAML document cannot be loaded. + +``` yaml +&anchor foo: + foo: bar + *anchor: duplicate key + baz: bat + *anchor: duplicate key +``` + + +js-yaml for enterprise +---------------------- + +Available as part of the Tidelift Subscription + +The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/bin/js-yaml.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/bin/js-yaml.js new file mode 100644 index 0000000..e79186b --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/bin/js-yaml.js @@ -0,0 +1,132 @@ +#!/usr/bin/env node + + +'use strict'; + +/*eslint-disable no-console*/ + + +// stdlib +var fs = require('fs'); + + +// 3rd-party +var argparse = require('argparse'); + + +// internal +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new argparse.ArgumentParser({ + prog: 'js-yaml', + version: require('../package.json').version, + addHelp: true +}); + + +cli.addArgument([ '-c', '--compact' ], { + help: 'Display errors in compact mode', + action: 'storeTrue' +}); + + +// deprecated (not needed after we removed output colors) +// option suppressed, but not completely removed for compatibility +cli.addArgument([ '-j', '--to-json' ], { + help: argparse.Const.SUPPRESS, + dest: 'json', + action: 'storeTrue' +}); + + +cli.addArgument([ '-t', '--trace' ], { + help: 'Show stack trace on error', + action: 'storeTrue' +}); + +cli.addArgument([ 'file' ], { + help: 'File to read, utf-8 encoded without BOM', + nargs: '?', + defaultValue: '-' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parseArgs(); + + +//////////////////////////////////////////////////////////////////////////////// + +function readFile(filename, encoding, callback) { + if (options.file === '-') { + // read from stdin + + var chunks = []; + + process.stdin.on('data', function (chunk) { + chunks.push(chunk); + }); + + process.stdin.on('end', function () { + return callback(null, Buffer.concat(chunks).toString(encoding)); + }); + } else { + fs.readFile(filename, encoding, callback); + } +} + +readFile(options.file, 'utf8', function (error, input) { + var output, isYaml; + + if (error) { + if (error.code === 'ENOENT') { + console.error('File not found: ' + options.file); + process.exit(2); + } + + console.error( + options.trace && error.stack || + error.message || + String(error)); + + process.exit(1); + } + + try { + output = JSON.parse(input); + isYaml = false; + } catch (err) { + if (err instanceof SyntaxError) { + try { + output = []; + yaml.loadAll(input, function (doc) { output.push(doc); }, {}); + isYaml = true; + + if (output.length === 0) output = null; + else if (output.length === 1) output = output[0]; + + } catch (e) { + if (options.trace && err.stack) console.error(e.stack); + else console.error(e.toString(options.compact)); + + process.exit(1); + } + } else { + console.error( + options.trace && err.stack || + err.message || + String(err)); + + process.exit(1); + } + } + + if (isYaml) console.log(JSON.stringify(output, null, ' ')); + else console.log(yaml.dump(output)); +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/dist/js-yaml.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/dist/js-yaml.js new file mode 100644 index 0000000..edd69ae --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/dist/js-yaml.js @@ -0,0 +1,4005 @@ +/*! js-yaml 3.14.2 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; + +},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; + +},{}],5:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +// set a property of a literal object, while protecting against prototype pollution, +// see https://github.com/nodeca/js-yaml/issues/164 for more details +function setProperty(object, key, value) { + // used for this specific key only because Object.defineProperty is slow + if (key === '__proto__') { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value: value + }); + } else { + object[key] = value; + } +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + setProperty(destination, key, source[key]); + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + setProperty(_result, keyNode, valueNode); + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; + +},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; + +},{"./common":2}],7:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; + +},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); + +},{"../schema":7,"./json":12}],9:[function(require,module,exports){ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); + +},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); + +},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); + +},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); + +},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; + +},{"./exception":4}],14:[function(require,module,exports){ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + +},{"../type":13}],15:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],16:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + +},{"../common":2,"../type":13}],17:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); + +},{"../common":2,"../type":13}],18:[function(require,module,exports){ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); + +},{"../../type":13}],19:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); + +},{"../../type":13}],20:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); + +},{"../../type":13}],21:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + +},{"../type":13}],22:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + +},{"../type":13}],23:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],24:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + +},{"../type":13}],25:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + +},{"../type":13}],26:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + +},{"../type":13}],27:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +},{"../type":13}],28:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + +},{"../type":13}],29:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + +},{"../type":13}],"/":[function(require,module,exports){ +'use strict'; + + +var yaml = require('./lib/js-yaml.js'); + + +module.exports = yaml; + +},{"./lib/js-yaml.js":1}]},{},[])("/") +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 0000000..66cc94e --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1 @@ +/*! js-yaml 3.14.2 https://github.com/nodeca/js-yaml */!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}(function(){return function i(r,o,a){function s(t,e){if(!o[t]){if(!r[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}n=o[t]={exports:{}},r[t][0].call(n.exports,function(e){return s(r[t][1][e]||e)},n,n.exports,i,r,o,a)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e{var n,i,r,o,a,s,c;if(null===t)return{};for(n={},r=0,o=(i=Object.keys(t)).length;r{if(0===i.length)return"''";if(!o.noCompatMode&&-1!==Q.indexOf(i))return"'"+i+"'";var e=o.indent*Math.max(1,r),t=-1===o.lineWidth?-1:Math.max(Math.min(o.lineWidth,40),o.lineWidth-e),n=a||-1=o.flowLevel;switch(ee(i,n,o.indent,t,function(e){for(var t=o,n=e,i=0,r=t.implicitTypes.length;i"+p(i,o.indent)+f(u(((t,n)=>{for(var e,i=/(\n+)([^\n]*)/g,r=(()=>{var e=-1!==(e=t.indexOf("\n"))?e:t.length;return i.lastIndex=e,d(t.slice(0,e),n)})(),o="\n"===t[0]||" "===t[0];s=i.exec(t);){var a=s[1],s=s[2];e=" "===s[0],r+=a+(o||e||""===s?"":"\n")+d(s,n),o=e}return r})(i,t),e));case E:return'"'+(e=>{for(var t,n,i="",r=0;rt&&o tag resolver accepts not "'+o+'" style');i=r.represent[o](t,o)}e.dump=i}return 1}}function Z(e,t,n,i,r,D){e.tag=null,e.dump=n,V(e,n,!1)||V(e,n,!0);var o,a,s=$.call(e.dump),c=(i=i&&(e.flowLevel<0||e.flowLevel>t),"[object Object]"===s||"[object Array]"===s);if(c&&(a=-1!==(o=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||a||2!==e.indent&&0 "+e.dump)}return 1}function ne(e,t){var n,i,r=[],o=[];for(!function e(t,n,i){var r,o,a;if(null!==t&&"object"==typeof t)if(-1!==(o=n.indexOf(t)))-1===i.indexOf(o)&&i.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;o>10),56320+(c-65536&1023)),e.position++}else O(e,"unknown escape sequence");n=i=e.position}else k(l)?(_(e,n,i,!0),U(e,L(e,!1,t)),n=i=e.position):e.position===e.lineStart&&D(e)?O(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}O(e,"unexpected end of the stream within a double quoted scalar")}}function $(e,t){var n,i,r=e.tag,o=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&45===i&&S(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,L(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,q(e,t,x,!1,!0),a.push(e.result),L(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)O(e,"bad indentation of a sequence entry");else if(e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndent{var t,n,i,r=!1,o=!1,a=e.input.charCodeAt(e.position);if(33===a){if(null!==e.tag&&O(e,"duplication of a tag property"),60===(a=e.input.charCodeAt(++e.position))?(r=!0,a=e.input.charCodeAt(++e.position)):33===a?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){for(;0!==(a=e.input.charCodeAt(++e.position))&&62!==a;);e.position{var t,n=e.input.charCodeAt(e.position);if(38===n){for(null!==e.anchor&&O(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!S(n)&&!I(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&O(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),1}})(e);)L(e,!0,-1)?(f=!0,s=o,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent{var i,r,o,a,s,c=e.tag,l=e.anchor,u={},p={},f=null,d=null,h=null,m=!1,g=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=u),s=e.input.charCodeAt(e.position);0!==s;){if(i=e.input.charCodeAt(e.position+1),o=e.line,a=e.position,63!==s&&58!==s||!S(i)){if(!q(e,n,y,!1,!0))break;if(e.line===o){for(s=e.input.charCodeAt(e.position);j(s);)s=e.input.charCodeAt(++e.position);if(58===s)S(s=e.input.charCodeAt(++e.position))||O(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(M(e,u,p,f,d,null),f=d=h=null),r=m=!(g=!0),f=e.tag,d=e.result;else{if(!g)return e.tag=c,e.anchor=l,1;O(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!g)return e.tag=c,e.anchor=l,1;O(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(m&&(M(e,u,p,f,d,null),f=d=h=null),r=m=g=!0):m?r=!(m=!1):O(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=i;if((e.line===o||e.lineIndent>t)&&(q(e,t,A,!0,r)&&(m?d=e.result:h=e.result),m||(M(e,u,p,f,d,h,o,a),f=d=h=null),L(e,!0,-1),s=e.input.charCodeAt(e.position)),t{var n,i,r,o,a,s,c,l,u,p=!0,f=e.tag,d=e.anchor,h={},m=e.input.charCodeAt(e.position);if(91===m)s=!(r=93),i=[];else{if(123!==m)return;r=125,s=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),m=e.input.charCodeAt(++e.position);0!==m;){if(L(e,!0,t),(m=e.input.charCodeAt(e.position))===r)return e.position++,e.tag=f,e.anchor=d,e.kind=s?"mapping":"sequence",e.result=i,1;p||O(e,"missed comma between flow collection entries"),u=null,o=a=!1,63===m&&S(e.input.charCodeAt(e.position+1))&&(o=a=!0,e.position++,L(e,!0,t)),n=e.line,q(e,t,g,!1,!0),l=e.tag,c=e.result,L(e,!0,t),m=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==m||(o=!0,m=e.input.charCodeAt(++e.position),L(e,!0,t),q(e,t,g,!1,!0),u=e.result),s?M(e,i,h,l,c,u):o?i.push(M(e,null,h,l,c,u)):i.push(c),L(e,!0,t),44===(m=e.input.charCodeAt(e.position))?(p=!0,m=e.input.charCodeAt(++e.position)):p=!1}O(e,"unexpected end of the stream within a flow collection")})(e,i)?d=!0:(a&&((e,t)=>{var n,i,r,o=b,a=!1,s=!1,c=t,l=0,u=!1,p=e.input.charCodeAt(e.position);if(124===p)i=!1;else{if(62!==p)return;i=!0}for(e.kind="scalar",e.result="";0!==p;)if(43===(p=e.input.charCodeAt(++e.position))||45===p)b===o?o=43===p?v:Y:O(e,"repeat of a chomping mode identifier");else{if(!(0<=(r=48<=(r=p)&&r<=57?r-48:-1)))break;0==r?O(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?O(e,"repeat of an indentation width identifier"):(c=t+r-1,s=!0)}if(j(p)){for(;j(p=e.input.charCodeAt(++e.position)););if(35===p)for(;!k(p=e.input.charCodeAt(++e.position))&&0!==p;);}for(;0!==p;){for(T(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndentc&&(c=e.lineIndent),k(p))l++;else{if(e.lineIndent{var n,i,r=e.input.charCodeAt(e.position);if(39===r){for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(_(e,n,e.position,!0),39!==(r=e.input.charCodeAt(++e.position)))return 1;n=e.position,e.position++,i=e.position}else k(r)?(_(e,n,i,!0),U(e,L(e,!1,t)),n=i=e.position):e.position===e.lineStart&&D(e)?O(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);O(e,"unexpected end of the stream within a single quoted scalar")}})(e,i)||K(e,i)?d=!0:(e=>{var t,n=e.input.charCodeAt(e.position);if(42===n){for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!S(n)&&!I(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&O(e,"name of an alias node must contain at least one character"),t=e.input.slice(t,e.position),m.call(e.anchorMap,t)||O(e,'unidentified alias "'+t+'"'),e.result=e.anchorMap[t],L(e,!0,-1),1}})(e)?(d=!0,null===e.tag&&null===e.anchor||O(e,"alias node should not have any properties")):((e,t,n)=>{var i,r,o,a,s,c,l,u=e.kind,p=e.result,f=e.input.charCodeAt(e.position);if(!S(f)&&!I(f)&&35!==f&&38!==f&&42!==f&&33!==f&&124!==f&&62!==f&&39!==f&&34!==f&&37!==f&&64!==f&&96!==f&&(63!==f&&45!==f||!(S(i=e.input.charCodeAt(e.position+1))||n&&I(i)))){for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==f;){if(58===f){if(S(i=e.input.charCodeAt(e.position+1))||n&&I(i))break}else if(35===f){if(S(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&D(e)||n&&I(f))break;if(k(f)){if(s=e.line,c=e.lineStart,l=e.lineIndent,L(e,!1,-1),t<=e.lineIndent){a=!0,f=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=l;break}}a&&(_(e,r,o,!1),U(e,e.line-s),r=o=e.position,a=!1),j(f)||(o=e.position+1),f=e.input.charCodeAt(++e.position)}if(_(e,r,o,!1),e.result)return 1;e.kind=u,e.result=p}})(e,i,g===n)&&(d=!0,null===e.tag)&&(e.tag="?"),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===p&&(d=s&&$(e,r))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&O(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c tag; it should be "'+u.kind+'", not "'+e.kind+'"'),u.resolve(e.result)?(e.result=u.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):O(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):O(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||d}function H(e,t){t=t||{};var n=new W(e=0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0))?e.slice(1):e,t),t=e.indexOf("\0");for(-1!==t&&(n.position=t,O(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.positiont/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t="";return this.name&&(t+='in "'+this.name+'" '),t+="at line "+(this.line+1)+", column "+(this.column+1),e||(e=this.getSnippet())&&(t+=":\n"+e),t},t.exports=i},{"./common":2}],7:[function(e,t,n){var i=e("./common"),r=e("./exception"),o=e("./type");function a(e,t,i){var r=[];return e.include.forEach(function(e){i=a(e,t,i)}),e[t].forEach(function(n){i.forEach(function(e,t){e.tag===n.tag&&e.kind===n.kind&&r.push(t)}),i.push(n)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),o.push(r>>8&255),o.push(255&r)),r=r<<6|i.indexOf(t.charAt(a));return 0==(e=n%4*6)?(o.push(r>>16&255),o.push(r>>8&255),o.push(255&r)):18==e?(o.push(r>>10&255),o.push(r>>2&255)):12==e&&o.push(r>>4&255),s?s.from?s.from(o):new s(o):o},predicate:function(e){return s&&s.isBuffer(e)},represent:function(e){for(var t,n="",i=0,r=e.length,o=c,a=0;a>18&63]+o[i>>12&63])+o[i>>6&63]+o[63&i]),i=(i<<8)+e[a];return 0==(t=r%3)?n=(n=n+o[i>>18&63]+o[i>>12&63])+o[i>>6&63]+o[63&i]:2==t?n=(n=n+o[i>>10&63]+o[i>>4&63])+o[i<<2&63]+o[64]:1==t&&(n=(n=n+o[i>>2&63]+o[i<<4&63])+o[64]+o[64]),n}})},{"../type":13}],15:[function(e,t,n){e=e("../type");t.exports=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){var t;return null!==e&&(4===(t=e.length)&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e))},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){var i=e("../common"),e=e("../type"),r=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var o=/^[-+]?[0-9]+e/;t.exports=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!r.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n=e.replace(/_/g,"").toLowerCase(),e="-"===n[0]?-1:1,i=[];return".inf"===(n=0<="+-".indexOf(n[0])?n.slice(1):n)?1==e?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===n?NaN:0<=n.indexOf(":")?(n.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),n=0,t=1,i.forEach(function(e){n+=e*t,t*=60}),e*n):e*parseFloat(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return t=e.toString(10),o.test(t)?t.replace("e",".e"):t},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){var i=e("../common"),e=e("../type");t.exports=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("0"===(t="-"!==(t=e[a])&&"+"!==t?t:e[++a])){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/exception.js new file mode 100644 index 0000000..b744a1e --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/exception.js @@ -0,0 +1,43 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/loader.js new file mode 100644 index 0000000..0e1e43d --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/loader.js @@ -0,0 +1,1660 @@ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +// set a property of a literal object, while protecting against prototype pollution, +// see https://github.com/nodeca/js-yaml/issues/164 for more details +function setProperty(object, key, value) { + // used for this specific key only because Object.defineProperty is slow + if (key === '__proto__') { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value: value + }); + } else { + object[key] = value; + } +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + setProperty(destination, key, source[key]); + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + setProperty(_result, keyNode, valueNode); + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/mark.js new file mode 100644 index 0000000..47b265c --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/mark.js @@ -0,0 +1,76 @@ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema.js new file mode 100644 index 0000000..ca7cf47 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema.js @@ -0,0 +1,108 @@ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/core.js new file mode 100644 index 0000000..206daab --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/core.js @@ -0,0 +1,18 @@ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/default_full.js new file mode 100644 index 0000000..a55ef42 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/default_full.js @@ -0,0 +1,25 @@ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js new file mode 100644 index 0000000..11d89bb --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js @@ -0,0 +1,28 @@ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js new file mode 100644 index 0000000..b7a33eb --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js @@ -0,0 +1,17 @@ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/json.js new file mode 100644 index 0000000..5be3dbf --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/schema/json.js @@ -0,0 +1,25 @@ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type.js new file mode 100644 index 0000000..90b702a --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type.js @@ -0,0 +1,61 @@ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/binary.js new file mode 100644 index 0000000..10b1875 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -0,0 +1,138 @@ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/bool.js new file mode 100644 index 0000000..cb77459 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -0,0 +1,35 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/float.js new file mode 100644 index 0000000..127671b --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -0,0 +1,116 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/int.js new file mode 100644 index 0000000..ba61c5f --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -0,0 +1,173 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/function.js new file mode 100644 index 0000000..8fab8c4 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -0,0 +1,93 @@ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js new file mode 100644 index 0000000..43fa470 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -0,0 +1,60 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js new file mode 100644 index 0000000..95b5569 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js @@ -0,0 +1,28 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/map.js new file mode 100644 index 0000000..f327bee --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/merge.js new file mode 100644 index 0000000..ae08a86 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -0,0 +1,12 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/null.js new file mode 100644 index 0000000..6874daa --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -0,0 +1,34 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/omap.js new file mode 100644 index 0000000..b2b5323 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -0,0 +1,44 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/pairs.js new file mode 100644 index 0000000..74b5240 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -0,0 +1,53 @@ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/seq.js new file mode 100644 index 0000000..be8f77f --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/set.js new file mode 100644 index 0000000..f885a32 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -0,0 +1,29 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/str.js new file mode 100644 index 0000000..27acc10 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/timestamp.js new file mode 100644 index 0000000..8fa9c58 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -0,0 +1,88 @@ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/package.json b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/package.json new file mode 100644 index 0000000..0d68bf6 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml/package.json @@ -0,0 +1,49 @@ +{ + "name": "js-yaml", + "version": "3.14.2", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "homepage": "https://github.com/nodeca/js-yaml", + "author": "Vladimir Zapparov ", + "contributors": [ + "Aleksey V Zapparov (http://www.ixti.net/)", + "Vitaly Puzrin (https://github.com/puzrin)", + "Martin Grenfell (http://got-ravings.blogspot.com)" + ], + "license": "MIT", + "repository": "nodeca/js-yaml", + "files": [ + "index.js", + "lib/", + "bin/", + "dist/" + ], + "bin": { + "js-yaml": "bin/js-yaml.js" + }, + "unpkg": "dist/js-yaml.min.js", + "jsdelivr": "dist/js-yaml.min.js", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "browserify": "^16.2.2", + "codemirror": "^5.13.4", + "eslint": "^7.0.0", + "fast-check": "^1.24.2", + "istanbul": "^0.4.5", + "mocha": "^7.1.2", + "uglify-js": "^3.0.1" + }, + "scripts": { + "test": "make test" + } +} diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/index.d.ts b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/index.d.ts new file mode 100644 index 0000000..fbde526 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/index.d.ts @@ -0,0 +1,83 @@ +declare namespace locatePath { + interface Options { + /** + Current working directory. + + @default process.cwd() + */ + readonly cwd?: string; + + /** + Type of path to match. + + @default 'file' + */ + readonly type?: 'file' | 'directory'; + + /** + Allow symbolic links to match if they point to the requested path type. + + @default true + */ + readonly allowSymlinks?: boolean; + } + + interface AsyncOptions extends Options { + /** + Number of concurrently pending promises. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `paths` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +declare const locatePath: { + /** + Get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + + @example + ``` + import locatePath = require('locate-path'); + + const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' + ]; + + (async () => { + console(await locatePath(files)); + //=> 'rainbow' + })(); + ``` + */ + (paths: Iterable, options?: locatePath.AsyncOptions): Promise< + string | undefined + >; + + /** + Synchronously get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + */ + sync( + paths: Iterable, + options?: locatePath.Options + ): string | undefined; +}; + +export = locatePath; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/index.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/index.js new file mode 100644 index 0000000..4604bbf --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/index.js @@ -0,0 +1,65 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const {promisify} = require('util'); +const pLocate = require('p-locate'); + +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); + +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; + +function checkType({type}) { + if (type in typeMappings) { + return; + } + + throw new Error(`Invalid type specified: ${type}`); +} + +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); + +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; + + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch (_) { + return false; + } + }, options); +}; + +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; + + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); + + if (matchType(options.type, stat)) { + return path_; + } + } catch (_) { + } + } +}; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/license b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/package.json b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/package.json new file mode 100644 index 0000000..063b290 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/package.json @@ -0,0 +1,45 @@ +{ + "name": "locate-path", + "version": "5.0.0", + "description": "Get the first path that exists on disk of multiple paths", + "license": "MIT", + "repository": "sindresorhus/locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "dependencies": { + "p-locate": "^4.1.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/readme.md b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/readme.md new file mode 100644 index 0000000..2184c6f --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path/readme.md @@ -0,0 +1,122 @@ +# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + + +## Install + +``` +$ npm install locate-path +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + console(await locatePath(files)); + //=> 'rainbow' +})(); +``` + + +## API + +### locatePath(paths, [options]) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `paths` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory. + +##### type + +Type: `string`
+Default: `file`
+Values: `file` `directory` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`
+Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### locatePath.sync(paths, [options]) + +Returns the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### cwd + +Same as above. + +##### type + +Same as above. + +##### allowSymlinks + +Same as above. + + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/index.d.ts b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/index.d.ts new file mode 100644 index 0000000..6bbfad4 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/index.d.ts @@ -0,0 +1,38 @@ +export interface Limit { + /** + @param fn - Promise-returning/async function. + @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. + @returns The promise returned by calling `fn(...arguments)`. + */ + ( + fn: (...arguments: Arguments) => PromiseLike | ReturnType, + ...arguments: Arguments + ): Promise; + + /** + The number of promises that are currently running. + */ + readonly activeCount: number; + + /** + The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + */ + readonly pendingCount: number; + + /** + Discard pending promises that are waiting to run. + + This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + + Note: This does not cancel promises that are already running. + */ + clearQueue(): void; +} + +/** +Run multiple promise-returning & async functions with limited concurrency. + +@param concurrency - Concurrency limit. Minimum: `1`. +@returns A `limit` function. +*/ +export default function pLimit(concurrency: number): Limit; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/index.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/index.js new file mode 100644 index 0000000..6a72a4c --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/index.js @@ -0,0 +1,57 @@ +'use strict'; +const pTry = require('p-try'); + +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + const run = (fn, resolve, ...args) => { + activeCount++; + + const result = pTry(fn, ...args); + + resolve(result); + + result.then(next, next); + }; + + const enqueue = (fn, resolve, ...args) => { + if (activeCount < concurrency) { + run(fn, resolve, ...args); + } else { + queue.push(run.bind(null, fn, resolve, ...args)); + } + }; + + const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.length + }, + clearQueue: { + value: () => { + queue.length = 0; + } + } + }); + + return generator; +}; + +module.exports = pLimit; +module.exports.default = pLimit; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/license b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/package.json b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/package.json new file mode 100644 index 0000000..99a814f --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/package.json @@ -0,0 +1,52 @@ +{ + "name": "p-limit", + "version": "2.3.0", + "description": "Run multiple promise-returning & async functions with limited concurrency", + "license": "MIT", + "repository": "sindresorhus/p-limit", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-try": "^2.0.0" + }, + "devDependencies": { + "ava": "^1.2.1", + "delay": "^4.1.0", + "in-range": "^1.0.0", + "random-int": "^1.0.0", + "time-span": "^2.0.0", + "tsd-check": "^0.3.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/readme.md b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/readme.md new file mode 100644 index 0000000..64aa476 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit/readme.md @@ -0,0 +1,101 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + +## Install + +``` +$ npm install p-limit +``` + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`\ +Minimum: `1`\ +Default: `Infinity` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + +### limit.clearQueue() + +Discard pending promises that are waiting to run. + +This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + +Note: This does not cancel promises that are already running. + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +

+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/index.d.ts b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/index.d.ts new file mode 100644 index 0000000..14115e1 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/index.d.ts @@ -0,0 +1,64 @@ +declare namespace pLocate { + interface Options { + /** + Number of concurrently pending promises returned by `tester`. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `input` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +declare const pLocate: { + /** + Get the first fulfilled promise that satisfies the provided testing function. + + @param input - An iterable of promises/values to test. + @param tester - This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + @returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + + @example + ``` + import pathExists = require('path-exists'); + import pLocate = require('p-locate'); + + const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' + ]; + + (async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' + })(); + ``` + */ + ( + input: Iterable | ValueType>, + tester: (element: ValueType) => PromiseLike | boolean, + options?: pLocate.Options + ): Promise; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function pLocate( + // input: Iterable | ValueType>, + // tester: (element: ValueType) => PromiseLike | boolean, + // options?: pLocate.Options + // ): Promise; + // export = pLocate; + default: typeof pLocate; +}; + +export = pLocate; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/index.js b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/index.js new file mode 100644 index 0000000..e13ce15 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/index.js @@ -0,0 +1,52 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); + +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + + return false; +}; + +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + + const limit = pLimit(options.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; + } + + throw error; + } +}; + +module.exports = pLocate; +// TODO: Remove this for the next major release +module.exports.default = pLocate; diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/license b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/package.json b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/package.json new file mode 100644 index 0000000..e3de275 --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/package.json @@ -0,0 +1,53 @@ +{ + "name": "p-locate", + "version": "4.1.0", + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "license": "MIT", + "repository": "sindresorhus/p-locate", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-limit": "^2.2.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "delay": "^4.1.0", + "in-range": "^1.0.0", + "time-span": "^3.0.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/readme.md b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/readme.md new file mode 100644 index 0000000..f8e2c2e --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate/readme.md @@ -0,0 +1,90 @@ +# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + + +## Install + +``` +$ npm install p-locate +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + + +## API + +### pLocate(input, tester, [options]) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +An iterable of promises/values to test. + +#### tester(element) + +Type: `Function` + +This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/@istanbuljs/load-nyc-config/package.json b/node_modules/@istanbuljs/load-nyc-config/package.json new file mode 100644 index 0000000..53207ef --- /dev/null +++ b/node_modules/@istanbuljs/load-nyc-config/package.json @@ -0,0 +1,49 @@ +{ + "name": "@istanbuljs/load-nyc-config", + "version": "1.1.0", + "description": "Utility function to load nyc configuration", + "main": "index.js", + "scripts": { + "pretest": "xo", + "test": "tap", + "snap": "npm test -- --snapshot", + "release": "standard-version" + }, + "engines": { + "node": ">=8" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/istanbuljs/load-nyc-config.git" + }, + "bugs": { + "url": "https://github.com/istanbuljs/load-nyc-config/issues" + }, + "homepage": "https://github.com/istanbuljs/load-nyc-config#readme", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "devDependencies": { + "semver": "^6.3.0", + "standard-version": "^7.0.0", + "tap": "^14.10.5", + "xo": "^0.25.3" + }, + "xo": { + "ignores": [ + "test/fixtures/extends/invalid.*" + ], + "rules": { + "require-atomic-updates": 0, + "capitalized-comments": 0, + "unicorn/import-index": 0, + "import/extensions": 0, + "import/no-useless-path-segments": 0 + } + } +} diff --git a/node_modules/@istanbuljs/schema/CHANGELOG.md b/node_modules/@istanbuljs/schema/CHANGELOG.md new file mode 100644 index 0000000..afdc835 --- /dev/null +++ b/node_modules/@istanbuljs/schema/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [0.1.3](https://github.com/istanbuljs/schema/compare/v0.1.2...v0.1.3) (2021-02-13) + + +### Features + +* Add `classPrivateMethods` and `topLevelAwait` default support ([#17](https://github.com/istanbuljs/schema/issues/17)) ([e732889](https://github.com/istanbuljs/schema/commit/e7328894ddeb61da256c1f13c2c2cc2e04f181df)), closes [#16](https://github.com/istanbuljs/schema/issues/16) +* Add `numericSeparator` to default `parserPlugins` ([#12](https://github.com/istanbuljs/schema/issues/12)) ([fe32f00](https://github.com/istanbuljs/schema/commit/fe32f002f54c61467b1c1a487081f51c85ec8d10)), closes [#5](https://github.com/istanbuljs/schema/issues/5) +* Add babel.config.mjs to default exclude ([#10](https://github.com/istanbuljs/schema/issues/10)) ([a4dbeaa](https://github.com/istanbuljs/schema/commit/a4dbeaa7045490a4d46754801ac71f5d99c9bd79)) + + +### Bug Fixes + +* Exclude tests with `tsx` or `jsx` extensions ([#13](https://github.com/istanbuljs/schema/issues/13)) ([c7747f7](https://github.com/istanbuljs/schema/commit/c7747f7a7df8a2b770036834af77dfd0ee445733)), closes [#11](https://github.com/istanbuljs/schema/issues/11) + +### [0.1.2](https://github.com/istanbuljs/schema/compare/v0.1.1...v0.1.2) (2019-12-05) + + +### Features + +* Ignore *.d.ts ([#6](https://github.com/istanbuljs/schema/issues/6)) ([d867eaf](https://github.com/istanbuljs/schema/commit/d867eaff6ca4abcd4301990e2bdcdf53e438e9c4)) +* Update default exclude of dev tool configurations ([#7](https://github.com/istanbuljs/schema/issues/7)) ([c89f818](https://github.com/istanbuljs/schema/commit/c89f8185f30879bcdf8d2f1c3b7aba0ac7056fa9)) + +## [0.1.1](https://github.com/istanbuljs/schema/compare/v0.1.0...v0.1.1) (2019-10-07) + + +### Bug Fixes + +* Add missing `instrument` option ([#3](https://github.com/istanbuljs/schema/issues/3)) ([bf1217d](https://github.com/istanbuljs/schema/commit/bf1217d)) + + +### Features + +* Add `use-spawn-wrap` nyc option ([#4](https://github.com/istanbuljs/schema/issues/4)) ([b2ce2e8](https://github.com/istanbuljs/schema/commit/b2ce2e8)) + +## 0.1.0 (2019-10-05) + + +### Features + +* Initial implementation ([99bd3a5](https://github.com/istanbuljs/schema/commit/99bd3a5)) diff --git a/node_modules/@istanbuljs/schema/LICENSE b/node_modules/@istanbuljs/schema/LICENSE new file mode 100644 index 0000000..807a18b --- /dev/null +++ b/node_modules/@istanbuljs/schema/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 CFWare, LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@istanbuljs/schema/README.md b/node_modules/@istanbuljs/schema/README.md new file mode 100644 index 0000000..9cac028 --- /dev/null +++ b/node_modules/@istanbuljs/schema/README.md @@ -0,0 +1,30 @@ +# @istanbuljs/schema + +[![Travis CI][travis-image]][travis-url] +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![MIT][license-image]](LICENSE) + +Schemas describing various structures used by nyc and istanbuljs + +## Usage + +```js +const {nyc} = require('@istanbuljs/schema').defaults; + +console.log(`Default exclude list:\n\t* ${nyc.exclude.join('\n\t* ')}`); +``` + +## `@istanbuljs/schema` for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `@istanbuljs/schema` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-istanbuljs-schema?utm_source=npm-istanbuljs-schema&utm_medium=referral&utm_campaign=enterprise) + +[npm-image]: https://img.shields.io/npm/v/@istanbuljs/schema.svg +[npm-url]: https://npmjs.org/package/@istanbuljs/schema +[travis-image]: https://travis-ci.org/istanbuljs/schema.svg?branch=master +[travis-url]: https://travis-ci.org/istanbuljs/schema +[downloads-image]: https://img.shields.io/npm/dm/@istanbuljs/schema.svg +[downloads-url]: https://npmjs.org/package/@istanbuljs/schema +[license-image]: https://img.shields.io/npm/l/@istanbuljs/schema.svg diff --git a/node_modules/@istanbuljs/schema/default-exclude.js b/node_modules/@istanbuljs/schema/default-exclude.js new file mode 100644 index 0000000..c6bb526 --- /dev/null +++ b/node_modules/@istanbuljs/schema/default-exclude.js @@ -0,0 +1,22 @@ +'use strict'; + +const defaultExtension = require('./default-extension.js'); +const testFileExtensions = defaultExtension + .map(extension => extension.slice(1)) + .join(','); + +module.exports = [ + 'coverage/**', + 'packages/*/test{,s}/**', + '**/*.d.ts', + 'test{,s}/**', + `test{,-*}.{${testFileExtensions}}`, + `**/*{.,-}test.{${testFileExtensions}}`, + '**/__tests__/**', + + /* Exclude common development tool configuration files */ + '**/{ava,babel,nyc}.config.{js,cjs,mjs}', + '**/jest.config.{js,cjs,mjs,ts}', + '**/{karma,rollup,webpack}.config.js', + '**/.{eslint,mocha}rc.{js,cjs}' +]; diff --git a/node_modules/@istanbuljs/schema/default-extension.js b/node_modules/@istanbuljs/schema/default-extension.js new file mode 100644 index 0000000..46ebadc --- /dev/null +++ b/node_modules/@istanbuljs/schema/default-extension.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = [ + '.js', + '.cjs', + '.mjs', + '.ts', + '.tsx', + '.jsx' +]; diff --git a/node_modules/@istanbuljs/schema/index.js b/node_modules/@istanbuljs/schema/index.js new file mode 100644 index 0000000..b35f610 --- /dev/null +++ b/node_modules/@istanbuljs/schema/index.js @@ -0,0 +1,466 @@ +'use strict'; + +const defaultExclude = require('./default-exclude.js'); +const defaultExtension = require('./default-extension.js'); + +const nycCommands = { + all: [null, 'check-coverage', 'instrument', 'merge', 'report'], + testExclude: [null, 'instrument', 'report', 'check-coverage'], + instrument: [null, 'instrument'], + checkCoverage: [null, 'report', 'check-coverage'], + report: [null, 'report'], + main: [null], + instrumentOnly: ['instrument'] +}; + +const cwd = { + description: 'working directory used when resolving paths', + type: 'string', + get default() { + return process.cwd(); + }, + nycCommands: nycCommands.all +}; + +const nycrcPath = { + description: 'specify an explicit path to find nyc configuration', + nycCommands: nycCommands.all +}; + +const tempDir = { + description: 'directory to output raw coverage information to', + type: 'string', + default: './.nyc_output', + nycAlias: 't', + nycHiddenAlias: 'temp-directory', + nycCommands: [null, 'check-coverage', 'merge', 'report'] +}; + +const testExclude = { + exclude: { + description: 'a list of specific files and directories that should be excluded from coverage, glob patterns are supported', + type: 'array', + items: { + type: 'string' + }, + default: defaultExclude, + nycCommands: nycCommands.testExclude, + nycAlias: 'x' + }, + excludeNodeModules: { + description: 'whether or not to exclude all node_module folders (i.e. **/node_modules/**) by default', + type: 'boolean', + default: true, + nycCommands: nycCommands.testExclude + }, + include: { + description: 'a list of specific files that should be covered, glob patterns are supported', + type: 'array', + items: { + type: 'string' + }, + default: [], + nycCommands: nycCommands.testExclude, + nycAlias: 'n' + }, + extension: { + description: 'a list of extensions that nyc should handle in addition to .js', + type: 'array', + items: { + type: 'string' + }, + default: defaultExtension, + nycCommands: nycCommands.testExclude, + nycAlias: 'e' + } +}; + +const instrumentVisitor = { + coverageVariable: { + description: 'variable to store coverage', + type: 'string', + default: '__coverage__', + nycCommands: nycCommands.instrument + }, + coverageGlobalScope: { + description: 'scope to store the coverage variable', + type: 'string', + default: 'this', + nycCommands: nycCommands.instrument + }, + coverageGlobalScopeFunc: { + description: 'avoid potentially replaced `Function` when finding global scope', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + }, + ignoreClassMethods: { + description: 'class method names to ignore for coverage', + type: 'array', + items: { + type: 'string' + }, + default: [], + nycCommands: nycCommands.instrument + } +}; + +const instrumentParseGen = { + autoWrap: { + description: 'allow `return` statements outside of functions', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + }, + esModules: { + description: 'should files be treated as ES Modules', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + }, + parserPlugins: { + description: 'babel parser plugins to use when parsing the source', + type: 'array', + items: { + type: 'string' + }, + /* Babel parser plugins are to be enabled when the feature is stage 3 and + * implemented in a released version of node.js. */ + default: [ + 'asyncGenerators', + 'bigInt', + 'classProperties', + 'classPrivateProperties', + 'classPrivateMethods', + 'dynamicImport', + 'importMeta', + 'numericSeparator', + 'objectRestSpread', + 'optionalCatchBinding', + 'topLevelAwait' + ], + nycCommands: nycCommands.instrument + }, + compact: { + description: 'should the output be compacted?', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + }, + preserveComments: { + description: 'should comments be preserved in the output?', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + }, + produceSourceMap: { + description: 'should source maps be produced?', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + } +}; + +const checkCoverage = { + excludeAfterRemap: { + description: 'should exclude logic be performed after the source-map remaps filenames?', + type: 'boolean', + default: true, + nycCommands: nycCommands.checkCoverage + }, + branches: { + description: 'what % of branches must be covered?', + type: 'number', + default: 0, + minimum: 0, + maximum: 100, + nycCommands: nycCommands.checkCoverage + }, + functions: { + description: 'what % of functions must be covered?', + type: 'number', + default: 0, + minimum: 0, + maximum: 100, + nycCommands: nycCommands.checkCoverage + }, + lines: { + description: 'what % of lines must be covered?', + type: 'number', + default: 90, + minimum: 0, + maximum: 100, + nycCommands: nycCommands.checkCoverage + }, + statements: { + description: 'what % of statements must be covered?', + type: 'number', + default: 0, + minimum: 0, + maximum: 100, + nycCommands: nycCommands.checkCoverage + }, + perFile: { + description: 'check thresholds per file', + type: 'boolean', + default: false, + nycCommands: nycCommands.checkCoverage + } +}; + +const report = { + checkCoverage: { + description: 'check whether coverage is within thresholds provided', + type: 'boolean', + default: false, + nycCommands: nycCommands.report + }, + reporter: { + description: 'coverage reporter(s) to use', + type: 'array', + items: { + type: 'string' + }, + default: ['text'], + nycCommands: nycCommands.report, + nycAlias: 'r' + }, + reportDir: { + description: 'directory to output coverage reports in', + type: 'string', + default: 'coverage', + nycCommands: nycCommands.report + }, + showProcessTree: { + description: 'display the tree of spawned processes', + type: 'boolean', + default: false, + nycCommands: nycCommands.report + }, + skipEmpty: { + description: 'don\'t show empty files (no lines of code) in report', + type: 'boolean', + default: false, + nycCommands: nycCommands.report + }, + skipFull: { + description: 'don\'t show files with 100% statement, branch, and function coverage', + type: 'boolean', + default: false, + nycCommands: nycCommands.report + } +}; + +const nycMain = { + silent: { + description: 'don\'t output a report after tests finish running', + type: 'boolean', + default: false, + nycCommands: nycCommands.main, + nycAlias: 's' + }, + all: { + description: 'whether or not to instrument all files of the project (not just the ones touched by your test suite)', + type: 'boolean', + default: false, + nycCommands: nycCommands.main, + nycAlias: 'a' + }, + eager: { + description: 'instantiate the instrumenter at startup (see https://git.io/vMKZ9)', + type: 'boolean', + default: false, + nycCommands: nycCommands.main + }, + cache: { + description: 'cache instrumentation results for improved performance', + type: 'boolean', + default: true, + nycCommands: nycCommands.main, + nycAlias: 'c' + }, + cacheDir: { + description: 'explicitly set location for instrumentation cache', + type: 'string', + nycCommands: nycCommands.main + }, + babelCache: { + description: 'cache babel transpilation results for improved performance', + type: 'boolean', + default: false, + nycCommands: nycCommands.main + }, + useSpawnWrap: { + description: 'use spawn-wrap instead of setting process.env.NODE_OPTIONS', + type: 'boolean', + default: false, + nycCommands: nycCommands.main + }, + hookRequire: { + description: 'should nyc wrap require?', + type: 'boolean', + default: true, + nycCommands: nycCommands.main + }, + hookRunInContext: { + description: 'should nyc wrap vm.runInContext?', + type: 'boolean', + default: false, + nycCommands: nycCommands.main + }, + hookRunInThisContext: { + description: 'should nyc wrap vm.runInThisContext?', + type: 'boolean', + default: false, + nycCommands: nycCommands.main + }, + clean: { + description: 'should the .nyc_output folder be cleaned before executing tests', + type: 'boolean', + default: true, + nycCommands: nycCommands.main + } +}; + +const instrumentOnly = { + inPlace: { + description: 'should nyc run the instrumentation in place?', + type: 'boolean', + default: false, + nycCommands: nycCommands.instrumentOnly + }, + exitOnError: { + description: 'should nyc exit when an instrumentation failure occurs?', + type: 'boolean', + default: false, + nycCommands: nycCommands.instrumentOnly + }, + delete: { + description: 'should the output folder be deleted before instrumenting files?', + type: 'boolean', + default: false, + nycCommands: nycCommands.instrumentOnly + }, + completeCopy: { + description: 'should nyc copy all files from input to output as well as instrumented files?', + type: 'boolean', + default: false, + nycCommands: nycCommands.instrumentOnly + } +}; + +const nyc = { + description: 'nyc configuration options', + type: 'object', + properties: { + cwd, + nycrcPath, + tempDir, + + /* Test Exclude */ + ...testExclude, + + /* Instrumentation settings */ + ...instrumentVisitor, + + /* Instrumentation parser/generator settings */ + ...instrumentParseGen, + sourceMap: { + description: 'should nyc detect and handle source maps?', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + }, + require: { + description: 'a list of additional modules that nyc should attempt to require in its subprocess, e.g., @babel/register, @babel/polyfill', + type: 'array', + items: { + type: 'string' + }, + default: [], + nycCommands: nycCommands.instrument, + nycAlias: 'i' + }, + instrument: { + description: 'should nyc handle instrumentation?', + type: 'boolean', + default: true, + nycCommands: nycCommands.instrument + }, + + /* Check coverage */ + ...checkCoverage, + + /* Report options */ + ...report, + + /* Main command options */ + ...nycMain, + + /* Instrument command options */ + ...instrumentOnly + } +}; + +const configs = { + nyc, + testExclude: { + description: 'test-exclude options', + type: 'object', + properties: { + cwd, + ...testExclude + } + }, + babelPluginIstanbul: { + description: 'babel-plugin-istanbul options', + type: 'object', + properties: { + cwd, + ...testExclude, + ...instrumentVisitor + } + }, + instrumentVisitor: { + description: 'instrument visitor options', + type: 'object', + properties: instrumentVisitor + }, + instrumenter: { + description: 'stand-alone instrumenter options', + type: 'object', + properties: { + ...instrumentVisitor, + ...instrumentParseGen + } + } +}; + +function defaultsReducer(defaults, [name, {default: value}]) { + /* Modifying arrays in defaults is safe, does not change schema. */ + if (Array.isArray(value)) { + value = [...value]; + } + + return Object.assign(defaults, {[name]: value}); +} + +module.exports = { + ...configs, + defaults: Object.keys(configs).reduce( + (defaults, id) => { + Object.defineProperty(defaults, id, { + enumerable: true, + get() { + /* This defers `process.cwd()` until defaults are requested. */ + return Object.entries(configs[id].properties) + .filter(([, info]) => 'default' in info) + .reduce(defaultsReducer, {}); + } + }); + + return defaults; + }, + {} + ) +}; diff --git a/node_modules/@istanbuljs/schema/package.json b/node_modules/@istanbuljs/schema/package.json new file mode 100644 index 0000000..1d22cde --- /dev/null +++ b/node_modules/@istanbuljs/schema/package.json @@ -0,0 +1,30 @@ +{ + "name": "@istanbuljs/schema", + "version": "0.1.3", + "description": "Schemas describing various structures used by nyc and istanbuljs", + "main": "index.js", + "scripts": { + "release": "standard-version --sign", + "pretest": "xo", + "test": "tap", + "snap": "npm test -- --snapshot" + }, + "engines": { + "node": ">=8" + }, + "author": "Corey Farrell", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/istanbuljs/schema.git" + }, + "bugs": { + "url": "https://github.com/istanbuljs/schema/issues" + }, + "homepage": "https://github.com/istanbuljs/schema#readme", + "devDependencies": { + "standard-version": "^7.0.0", + "tap": "^14.6.7", + "xo": "^0.25.3" + } +} diff --git a/node_modules/@jridgewell/gen-mapping/LICENSE b/node_modules/@jridgewell/gen-mapping/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@jridgewell/gen-mapping/README.md b/node_modules/@jridgewell/gen-mapping/README.md new file mode 100644 index 0000000..93692b1 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/README.md @@ -0,0 +1,227 @@ +# @jridgewell/gen-mapping + +> Generate source maps + +`gen-mapping` allows you to generate a source map during transpilation or minification. +With a source map, you're able to trace the original location in the source file, either in Chrome's +DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This +provides the same `addMapping` and `setSourceContent` API. + +## Installation + +```sh +npm install @jridgewell/gen-mapping +``` + +## Usage + +```typescript +import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping'; + +const map = new GenMapping({ + file: 'output.js', + sourceRoot: 'https://example.com/', +}); + +setSourceContent(map, 'input.js', `function foo() {}`); + +addMapping(map, { + // Lines start at line 1, columns at column 0. + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +addMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 9 }, + name: 'foo', +}); + +assert.deepEqual(toDecodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: [ + [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ] + ], +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: 'AAAA,SAASA', +}); +``` + +### Smaller Sourcemaps + +Not everything needs to be added to a sourcemap, and needless markings can cause signficantly +larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will +intelligently determine if this marking adds useful information. If not, the marking will be +skipped. + +```typescript +import { maybeAddMapping } from '@jridgewell/gen-mapping'; + +const map = new GenMapping(); + +// Adding a sourceless marking at the beginning of a line isn't useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, +}); + +// Adding a new source marking is useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +// But adding another marking pointing to the exact same original location isn't, even if the +// generated column changed. +maybeAddMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + names: [], + sources: ['input.js'], + sourcesContent: [null], + mappings: 'AAAA', +}); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map +Memory Usage: +gen-mapping: addSegment 5852872 bytes +gen-mapping: addMapping 7716042 bytes +source-map-js 6143250 bytes +source-map-0.6.1 6124102 bytes +source-map-0.8.0 6121173 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled) +gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled) +source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled) +source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled) +source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled) +gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled) +source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled) +source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled) +source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +babel.min.js.map +Memory Usage: +gen-mapping: addSegment 37578063 bytes +gen-mapping: addMapping 37212897 bytes +source-map-js 47638527 bytes +source-map-0.6.1 47690503 bytes +source-map-0.8.0 47470188 bytes +Smallest memory usage is gen-mapping: addMapping + +Adding speed: +gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled) +gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled) +source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled) +source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled) +source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled) +gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled) +source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled) +source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled) +source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +preact.js.map +Memory Usage: +gen-mapping: addSegment 416247 bytes +gen-mapping: addMapping 419824 bytes +source-map-js 1024619 bytes +source-map-0.6.1 1146004 bytes +source-map-0.8.0 1113250 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled) +gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled) +source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled) +source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled) +source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled) +gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled) +source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled) +source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled) +source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +react.js.map +Memory Usage: +gen-mapping: addSegment 975096 bytes +gen-mapping: addMapping 1102981 bytes +source-map-js 2918836 bytes +source-map-0.6.1 2885435 bytes +source-map-0.8.0 2874336 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled) +gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled) +source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled) +source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled) +source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled) +gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled) +source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled) +source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled) +source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled) +Fastest is gen-mapping: decoded output +``` + +[source-map]: https://www.npmjs.com/package/source-map +[trace-mapping]: https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs new file mode 100644 index 0000000..bbb0cac --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs @@ -0,0 +1,292 @@ +// src/set-array.ts +var SetArray = class { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +}; +function cast(set) { + return set; +} +function get(setarr, key) { + return cast(setarr)._indexes[key]; +} +function put(setarr, key) { + const index = get(setarr, key); + if (index !== void 0) return index; + const { array, _indexes: indexes } = cast(setarr); + const length = array.push(key); + return indexes[key] = length - 1; +} +function remove(setarr, key) { + const index = get(setarr, key); + if (index === void 0) return; + const { array, _indexes: indexes } = cast(setarr); + for (let i = index + 1; i < array.length; i++) { + const k = array[i]; + array[i - 1] = k; + indexes[k]--; + } + indexes[key] = void 0; + array.pop(); +} + +// src/gen-mapping.ts +import { + encode +} from "@jridgewell/sourcemap-codec"; +import { TraceMap, decodedMappings } from "@jridgewell/trace-mapping"; + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; + +// src/gen-mapping.ts +var NO_NAME = -1; +var GenMapping = class { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +}; +function cast2(map) { + return map; +} +function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + return addSegmentInternal( + false, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +} +function addMapping(map, mapping) { + return addMappingInternal(false, map, mapping); +} +var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal( + true, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +}; +var maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); +}; +function setSourceContent(map, source, content) { + const { + _sources: sources, + _sourcesContent: sourcesContent + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + sourcesContent[index] = content; +} +function setIgnore(map, source, ignore = true) { + const { + _sources: sources, + _sourcesContent: sourcesContent, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (ignore) put(ignoreList, index); + else remove(ignoreList, index); +} +function toDecodedMap(map) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + // _generatedRanges: generatedRanges, + } = cast2(map); + removeEmptyFinalLines(mappings); + return { + version: 3, + file: map.file || void 0, + names: names.array, + sourceRoot: map.sourceRoot || void 0, + sources: sources.array, + sourcesContent, + mappings, + // originalScopes, + // generatedRanges, + ignoreList: ignoreList.array + }; +} +function toEncodedMap(map) { + const decoded = toDecodedMap(map); + return Object.assign({}, decoded, { + // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), + // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), + mappings: encode(decoded.mappings) + }); +} +function fromMap(input) { + const map = new TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(cast2(gen)._names, map.names); + putAll(cast2(gen)._sources, map.sources); + cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); + cast2(gen)._mappings = decodedMappings(map); + if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); + return gen; +} +function allMappings(map) { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = void 0; + let original = void 0; + let name = void 0; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; +} +function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names + // _originalScopes: originalScopes, + } = cast2(map); + const line = getIndex(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) return; + return insert(line, index, [genColumn]); + } + assert(sourceLine); + assert(sourceColumn); + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert( + line, + index, + name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] + ); +} +function assert(_val) { +} +function getIndex(arr, index) { + for (let i = arr.length; i <= index; i++) { + arr[i] = []; + } + return arr[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) break; + } + if (len < length) mappings.length = len; +} +function putAll(setarr, array) { + for (let i = 0; i < array.length; i++) put(setarr, array[i]); +} +function skipSourceless(line, index) { + if (index === 0) return true; + const prev = line[index - 1]; + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + if (index === 0) return false; + const prev = line[index - 1]; + if (prev.length === 1) return false; + return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); +} +function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + null, + null, + null, + null, + null + ); + } + assert(original); + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + source, + original.line - 1, + original.column, + name, + content + ); +} +export { + GenMapping, + addMapping, + addSegment, + allMappings, + fromMap, + maybeAddMapping, + maybeAddSegment, + setIgnore, + setSourceContent, + toDecodedMap, + toEncodedMap +}; +//# sourceMappingURL=gen-mapping.mjs.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map new file mode 100644 index 0000000..4e37e45 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/set-array.ts", "../src/gen-mapping.ts", "../src/sourcemap-segment.ts"], + "mappings": ";AAUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,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,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", + "names": ["cast"] +} diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js new file mode 100644 index 0000000..cb84af5 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js @@ -0,0 +1,358 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module, require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod, global.sourcemapCodec, global.traceMapping); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.genMapping = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module, require_sourcemapCodec, require_traceMapping) { +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// umd:@jridgewell/sourcemap-codec +var require_sourcemap_codec = __commonJS({ + "umd:@jridgewell/sourcemap-codec"(exports, module2) { + module2.exports = require_sourcemapCodec; + } +}); + +// umd:@jridgewell/trace-mapping +var require_trace_mapping = __commonJS({ + "umd:@jridgewell/trace-mapping"(exports, module2) { + module2.exports = require_traceMapping; + } +}); + +// src/gen-mapping.ts +var gen_mapping_exports = {}; +__export(gen_mapping_exports, { + GenMapping: () => GenMapping, + addMapping: () => addMapping, + addSegment: () => addSegment, + allMappings: () => allMappings, + fromMap: () => fromMap, + maybeAddMapping: () => maybeAddMapping, + maybeAddSegment: () => maybeAddSegment, + setIgnore: () => setIgnore, + setSourceContent: () => setSourceContent, + toDecodedMap: () => toDecodedMap, + toEncodedMap: () => toEncodedMap +}); +module.exports = __toCommonJS(gen_mapping_exports); + +// src/set-array.ts +var SetArray = class { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +}; +function cast(set) { + return set; +} +function get(setarr, key) { + return cast(setarr)._indexes[key]; +} +function put(setarr, key) { + const index = get(setarr, key); + if (index !== void 0) return index; + const { array, _indexes: indexes } = cast(setarr); + const length = array.push(key); + return indexes[key] = length - 1; +} +function remove(setarr, key) { + const index = get(setarr, key); + if (index === void 0) return; + const { array, _indexes: indexes } = cast(setarr); + for (let i = index + 1; i < array.length; i++) { + const k = array[i]; + array[i - 1] = k; + indexes[k]--; + } + indexes[key] = void 0; + array.pop(); +} + +// src/gen-mapping.ts +var import_sourcemap_codec = __toESM(require_sourcemap_codec()); +var import_trace_mapping = __toESM(require_trace_mapping()); + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; + +// src/gen-mapping.ts +var NO_NAME = -1; +var GenMapping = class { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +}; +function cast2(map) { + return map; +} +function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + return addSegmentInternal( + false, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +} +function addMapping(map, mapping) { + return addMappingInternal(false, map, mapping); +} +var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal( + true, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content + ); +}; +var maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); +}; +function setSourceContent(map, source, content) { + const { + _sources: sources, + _sourcesContent: sourcesContent + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + sourcesContent[index] = content; +} +function setIgnore(map, source, ignore = true) { + const { + _sources: sources, + _sourcesContent: sourcesContent, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + } = cast2(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (ignore) put(ignoreList, index); + else remove(ignoreList, index); +} +function toDecodedMap(map) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + _ignoreList: ignoreList + // _originalScopes: originalScopes, + // _generatedRanges: generatedRanges, + } = cast2(map); + removeEmptyFinalLines(mappings); + return { + version: 3, + file: map.file || void 0, + names: names.array, + sourceRoot: map.sourceRoot || void 0, + sources: sources.array, + sourcesContent, + mappings, + // originalScopes, + // generatedRanges, + ignoreList: ignoreList.array + }; +} +function toEncodedMap(map) { + const decoded = toDecodedMap(map); + return Object.assign({}, decoded, { + // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), + // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), + mappings: (0, import_sourcemap_codec.encode)(decoded.mappings) + }); +} +function fromMap(input) { + const map = new import_trace_mapping.TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(cast2(gen)._names, map.names); + putAll(cast2(gen)._sources, map.sources); + cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); + cast2(gen)._mappings = (0, import_trace_mapping.decodedMappings)(map); + if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); + return gen; +} +function allMappings(map) { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = void 0; + let original = void 0; + let name = void 0; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; +} +function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names + // _originalScopes: originalScopes, + } = cast2(map); + const line = getIndex(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) return; + return insert(line, index, [genColumn]); + } + assert(sourceLine); + assert(sourceColumn); + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert( + line, + index, + name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] + ); +} +function assert(_val) { +} +function getIndex(arr, index) { + for (let i = arr.length; i <= index; i++) { + arr[i] = []; + } + return arr[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) break; + } + if (len < length) mappings.length = len; +} +function putAll(setarr, array) { + for (let i = 0; i < array.length; i++) put(setarr, array[i]); +} +function skipSourceless(line, index) { + if (index === 0) return true; + const prev = line[index - 1]; + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + if (index === 0) return false; + const prev = line[index - 1]; + if (prev.length === 1) return false; + return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); +} +function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + null, + null, + null, + null, + null + ); + } + assert(original); + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + source, + original.line - 1, + original.column, + name, + content + ); +} +})); +//# sourceMappingURL=gen-mapping.umd.js.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map new file mode 100644 index 0000000..b13750b --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/trace-mapping", "../src/gen-mapping.ts", "../src/set-array.ts", "../src/sourcemap-segment.ts"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,2CAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,QAAM,SAAS,MAAM,KAAK,GAAG;AAC7B,SAAQ,QAAQ,GAAG,IAAI,SAAS;AAClC;AAgBO,SAAS,OAAsB,QAAqB,KAAc;AACvE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW;AAEzB,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAChD,WAAS,IAAI,QAAQ,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC7C,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,IAAI,CAAC,IAAI;AACf,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B;AACA,MAAI,MAAM,OAAQ,UAAS,SAAS;AACtC;AAEA,SAAS,OAAkC,QAAqB,OAAY;AAC1E,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,QAAQ,MAAM,CAAC,CAAC;AAC7D;AAEA,SAAS,eAAe,MAA0B,OAAwB;AAGxE,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAI3B,SAAO,KAAK,WAAW;AACzB;AAEA,SAAS,WACP,MACA,OACA,cACA,YACA,cACA,YACS;AAET,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,WAAW,EAAG,QAAO;AAI9B,SACE,iBAAiB,KAAK,aAAa,KACnC,eAAe,KAAK,WAAW,KAC/B,iBAAiB,KAAK,aAAa,KACnC,gBAAgB,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAE5D;AAEA,SAAS,mBACP,UACA,KACA,SAOA;AACA,QAAM,EAAE,WAAW,QAAQ,UAAU,MAAM,QAAQ,IAAI;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", + "names": ["module", "module", "cast"] +} diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts new file mode 100644 index 0000000..9ba936e --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts @@ -0,0 +1,88 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + private _ignoreList; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; +}): void; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare const maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare const maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; +export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare function fromMap(input: SourceMapInput): GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare function allMappings(map: GenMapping): Mapping[]; diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts new file mode 100644 index 0000000..6ed4354 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts @@ -0,0 +1,32 @@ +type Key = string | number | symbol; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly T[]; + constructor(); +} +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare function get(setarr: SetArray, key: T): number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare function put(setarr: SetArray, key: T): number; +/** + * Pops the last added item out of the SetArray. + */ +export declare function pop(setarr: SetArray): void; +/** + * Removes the key, if it exists in the set. + */ +export declare function remove(setarr: SetArray, key: T): void; +export {}; diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts new file mode 100644 index 0000000..aa19fb5 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts @@ -0,0 +1,12 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts new file mode 100644 index 0000000..8eb90fb --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts @@ -0,0 +1,43 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export interface OriginalPos extends Pos { + source: string; +} +export interface BindingExpressionRange { + start: Pos; + expression: string; +} +export type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; diff --git a/node_modules/@jridgewell/gen-mapping/package.json b/node_modules/@jridgewell/gen-mapping/package.json new file mode 100644 index 0000000..036f9b7 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/package.json @@ -0,0 +1,67 @@ +{ + "name": "@jridgewell/gen-mapping", + "version": "0.3.13", + "description": "Generate source maps", + "keywords": [ + "source", + "map" + ], + "main": "dist/gen-mapping.umd.js", + "module": "dist/gen-mapping.mjs", + "types": "types/gen-mapping.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/gen-mapping.d.mts", + "default": "./dist/gen-mapping.mjs" + }, + "default": { + "types": "./types/gen-mapping.d.cts", + "default": "./dist/gen-mapping.umd.js" + } + }, + "./dist/gen-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs gen-mapping.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/gen-mapping" + }, + "author": "Justin Ridgewell ", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } +} diff --git a/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts b/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts new file mode 100644 index 0000000..ecc878c --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts @@ -0,0 +1,614 @@ +import { SetArray, put, remove } from './set-array'; +import { + encode, + // encodeGeneratedRanges, + // encodeOriginalScopes +} from '@jridgewell/sourcemap-codec'; +import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping'; + +import { + COLUMN, + SOURCES_INDEX, + SOURCE_LINE, + SOURCE_COLUMN, + NAMES_INDEX, +} from './sourcemap-segment'; + +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +// import type { OriginalScope, GeneratedRange } from '@jridgewell/sourcemap-codec'; +import type { SourceMapSegment } from './sourcemap-segment'; +import type { + DecodedSourceMap, + EncodedSourceMap, + Pos, + Mapping, + // BindingExpressionRange, + // OriginalPos, + // OriginalScopeInfo, + // GeneratedRangeInfo, +} from './types'; + +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; + +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; + +const NO_NAME = -1; + +/** + * Provides the state to generate a sourcemap. + */ +export class GenMapping { + declare private _names: SetArray; + declare private _sources: SetArray; + declare private _sourcesContent: (string | null)[]; + declare private _mappings: SourceMapSegment[][]; + // private declare _originalScopes: OriginalScope[][]; + // private declare _generatedRanges: GeneratedRange[]; + declare private _ignoreList: SetArray; + declare file: string | null | undefined; + declare sourceRoot: string | null | undefined; + + constructor({ file, sourceRoot }: Options = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + // this._originalScopes = []; + // this._generatedRanges = []; + this.file = file; + this.sourceRoot = sourceRoot; + this._ignoreList = new SetArray(); + } +} + +interface PublicMap { + _names: GenMapping['_names']; + _sources: GenMapping['_sources']; + _sourcesContent: GenMapping['_sourcesContent']; + _mappings: GenMapping['_mappings']; + // _originalScopes: GenMapping['_originalScopes']; + // _generatedRanges: GenMapping['_generatedRanges']; + _ignoreList: GenMapping['_ignoreList']; +} + +/** + * Typescript doesn't allow friend access to private fields, so this just casts the map into a type + * with public access modifiers. + */ +function cast(map: unknown): PublicMap { + return map as any; +} + +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source?: null, + sourceLine?: null, + sourceColumn?: null, + name?: null, + content?: null, +): void; +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source: string, + sourceLine: number, + sourceColumn: number, + name?: null, + content?: string | null, +): void; +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source: string, + sourceLine: number, + sourceColumn: number, + name: string, + content?: string | null, +): void; +export function addSegment( + map: GenMapping, + genLine: number, + genColumn: number, + source?: string | null, + sourceLine?: number | null, + sourceColumn?: number | null, + name?: string | null, + content?: string | null, +): void { + return addSegmentInternal( + false, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content, + ); +} + +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; + }, +): void; +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; + }, +): void; +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; + }, +): void; +export function addMapping( + map: GenMapping, + mapping: { + generated: Pos; + source?: string | null; + original?: Pos | null; + name?: string | null; + content?: string | null; + }, +): void { + return addMappingInternal(false, map, mapping as Parameters[2]); +} + +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export const maybeAddSegment: typeof addSegment = ( + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content, +) => { + return addSegmentInternal( + true, + map, + genLine, + genColumn, + source, + sourceLine, + sourceColumn, + name, + content, + ); +}; + +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export const maybeAddMapping: typeof addMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping as Parameters[2]); +}; + +/** + * Adds/removes the content of the source file to the source map. + */ +export function setSourceContent(map: GenMapping, source: string, content: string | null): void { + const { + _sources: sources, + _sourcesContent: sourcesContent, + // _originalScopes: originalScopes, + } = cast(map); + const index = put(sources, source); + sourcesContent[index] = content; + // if (index === originalScopes.length) originalScopes[index] = []; +} + +export function setIgnore(map: GenMapping, source: string, ignore = true) { + const { + _sources: sources, + _sourcesContent: sourcesContent, + _ignoreList: ignoreList, + // _originalScopes: originalScopes, + } = cast(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + // if (index === originalScopes.length) originalScopes[index] = []; + if (ignore) put(ignoreList, index); + else remove(ignoreList, index); +} + +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function toDecodedMap(map: GenMapping): DecodedSourceMap { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + _ignoreList: ignoreList, + // _originalScopes: originalScopes, + // _generatedRanges: generatedRanges, + } = cast(map); + removeEmptyFinalLines(mappings); + + return { + version: 3, + file: map.file || undefined, + names: names.array, + sourceRoot: map.sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + // originalScopes, + // generatedRanges, + ignoreList: ignoreList.array, + }; +} + +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function toEncodedMap(map: GenMapping): EncodedSourceMap { + const decoded = toDecodedMap(map); + return Object.assign({}, decoded, { + // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), + // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), + mappings: encode(decoded.mappings as SourceMapSegment[][]), + }); +} + +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export function fromMap(input: SourceMapInput): GenMapping { + const map = new TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + + putAll(cast(gen)._names, map.names); + putAll(cast(gen)._sources, map.sources as string[]); + cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); + cast(gen)._mappings = decodedMappings(map) as GenMapping['_mappings']; + // TODO: implement originalScopes/generatedRanges + if (map.ignoreList) putAll(cast(gen)._ignoreList, map.ignoreList); + + return gen; +} + +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export function allMappings(map: GenMapping): Mapping[] { + const out: Mapping[] = []; + const { _mappings: mappings, _sources: sources, _names: names } = cast(map); + + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + + const generated = { line: i + 1, column: seg[COLUMN] }; + let source: string | undefined = undefined; + let original: Pos | undefined = undefined; + let name: string | undefined = undefined; + + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + + if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; + } + + out.push({ generated, source, original, name } as Mapping); + } + } + + return out; +} + +// This split declaration is only so that terser can elminiate the static initialization block. +function addSegmentInternal( + skipable: boolean, + map: GenMapping, + genLine: number, + genColumn: number, + source: S, + sourceLine: S extends string ? number : null | undefined, + sourceColumn: S extends string ? number : null | undefined, + name: S extends string ? string | null | undefined : null | undefined, + content: S extends string ? string | null | undefined : null | undefined, +): void { + const { + _mappings: mappings, + _sources: sources, + _sourcesContent: sourcesContent, + _names: names, + // _originalScopes: originalScopes, + } = cast(map); + const line = getIndex(mappings, genLine); + const index = getColumnIndex(line, genColumn); + + if (!source) { + if (skipable && skipSourceless(line, index)) return; + return insert(line, index, [genColumn]); + } + + // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source + // isn't nullish. + assert(sourceLine); + assert(sourceColumn); + + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null; + // if (sourcesIndex === originalScopes.length) originalScopes[sourcesIndex] = []; + + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + + return insert( + line, + index, + name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn], + ); +} + +function assert(_val: unknown): asserts _val is T { + // noop. +} + +function getIndex(arr: T[][], index: number): T[] { + for (let i = arr.length; i <= index; i++) { + arr[i] = []; + } + return arr[index]; +} + +function getColumnIndex(line: SourceMapSegment[], genColumn: number): number { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) break; + } + return index; +} + +function insert(array: T[], index: number, value: T) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} + +function removeEmptyFinalLines(mappings: SourceMapSegment[][]) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) break; + } + if (len < length) mappings.length = len; +} + +function putAll(setarr: SetArray, array: T[]) { + for (let i = 0; i < array.length; i++) put(setarr, array[i]); +} + +function skipSourceless(line: SourceMapSegment[], index: number): boolean { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) return true; + + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; +} + +function skipSource( + line: SourceMapSegment[], + index: number, + sourcesIndex: number, + sourceLine: number, + sourceColumn: number, + namesIndex: number, +): boolean { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) return false; + + const prev = line[index - 1]; + + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) return false; + + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return ( + sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME) + ); +} + +function addMappingInternal( + skipable: boolean, + map: GenMapping, + mapping: { + generated: Pos; + source: S; + original: S extends string ? Pos : null | undefined; + name: S extends string ? string | null | undefined : null | undefined; + content: S extends string ? string | null | undefined : null | undefined; + }, +) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + null, + null, + null, + null, + null, + ); + } + assert(original); + return addSegmentInternal( + skipable, + map, + generated.line - 1, + generated.column, + source as string, + original.line - 1, + original.column, + name, + content, + ); +} + +/* +export function addOriginalScope( + map: GenMapping, + data: { + start: Pos; + end: Pos; + source: string; + kind: string; + name?: string; + variables?: string[]; + }, +): OriginalScopeInfo { + const { start, end, source, kind, name, variables } = data; + const { + _sources: sources, + _sourcesContent: sourcesContent, + _originalScopes: originalScopes, + _names: names, + } = cast(map); + const index = put(sources, source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (index === originalScopes.length) originalScopes[index] = []; + + const kindIndex = put(names, kind); + const scope: OriginalScope = name + ? [start.line - 1, start.column, end.line - 1, end.column, kindIndex, put(names, name)] + : [start.line - 1, start.column, end.line - 1, end.column, kindIndex]; + if (variables) { + scope.vars = variables.map((v) => put(names, v)); + } + const len = originalScopes[index].push(scope); + return [index, len - 1, variables]; +} +*/ + +// Generated Ranges +/* +export function addGeneratedRange( + map: GenMapping, + data: { + start: Pos; + isScope: boolean; + originalScope?: OriginalScopeInfo; + callsite?: OriginalPos; + }, +): GeneratedRangeInfo { + const { start, isScope, originalScope, callsite } = data; + const { + _originalScopes: originalScopes, + _sources: sources, + _sourcesContent: sourcesContent, + _generatedRanges: generatedRanges, + } = cast(map); + + const range: GeneratedRange = [ + start.line - 1, + start.column, + 0, + 0, + originalScope ? originalScope[0] : -1, + originalScope ? originalScope[1] : -1, + ]; + if (originalScope?.[2]) { + range.bindings = originalScope[2].map(() => [[-1]]); + } + if (callsite) { + const index = put(sources, callsite.source); + if (index === sourcesContent.length) sourcesContent[index] = null; + if (index === originalScopes.length) originalScopes[index] = []; + range.callsite = [index, callsite.line - 1, callsite.column]; + } + if (isScope) range.isScope = true; + generatedRanges.push(range); + + return [range, originalScope?.[2]]; +} + +export function setEndPosition(range: GeneratedRangeInfo, pos: Pos) { + range[0][2] = pos.line - 1; + range[0][3] = pos.column; +} + +export function addBinding( + map: GenMapping, + range: GeneratedRangeInfo, + variable: string, + expression: string | BindingExpressionRange, +) { + const { _names: names } = cast(map); + const bindings = (range[0].bindings ||= []); + const vars = range[1]; + + const index = vars!.indexOf(variable); + const binding = getIndex(bindings, index); + + if (typeof expression === 'string') binding[0] = [put(names, expression)]; + else { + const { start } = expression; + binding.push([put(names, expression.expression), start.line - 1, start.column]); + } +} +*/ diff --git a/node_modules/@jridgewell/gen-mapping/src/set-array.ts b/node_modules/@jridgewell/gen-mapping/src/set-array.ts new file mode 100644 index 0000000..a2a73a5 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/src/set-array.ts @@ -0,0 +1,82 @@ +type Key = string | number | symbol; + +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export class SetArray { + declare private _indexes: Record; + declare array: readonly T[]; + + constructor() { + this._indexes = { __proto__: null } as any; + this.array = []; + } +} + +interface PublicSet { + array: T[]; + _indexes: SetArray['_indexes']; +} + +/** + * Typescript doesn't allow friend access to private fields, so this just casts the set into a type + * with public access modifiers. + */ +function cast(set: SetArray): PublicSet { + return set as any; +} + +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export function get(setarr: SetArray, key: T): number | undefined { + return cast(setarr)._indexes[key]; +} + +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export function put(setarr: SetArray, key: T): number { + // The key may or may not be present. If it is present, it's a number. + const index = get(setarr, key); + if (index !== undefined) return index; + + const { array, _indexes: indexes } = cast(setarr); + + const length = array.push(key); + return (indexes[key] = length - 1); +} + +/** + * Pops the last added item out of the SetArray. + */ +export function pop(setarr: SetArray): void { + const { array, _indexes: indexes } = cast(setarr); + if (array.length === 0) return; + + const last = array.pop()!; + indexes[last] = undefined; +} + +/** + * Removes the key, if it exists in the set. + */ +export function remove(setarr: SetArray, key: T): void { + const index = get(setarr, key); + if (index === undefined) return; + + const { array, _indexes: indexes } = cast(setarr); + for (let i = index + 1; i < array.length; i++) { + const k = array[i]; + array[i - 1] = k; + indexes[k]!--; + } + indexes[key] = undefined; + array.pop(); +} diff --git a/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts b/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts new file mode 100644 index 0000000..fb296dd --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts @@ -0,0 +1,16 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; + +export type SourceMapSegment = + | [GeneratedColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; + +export const COLUMN = 0; +export const SOURCES_INDEX = 1; +export const SOURCE_LINE = 2; +export const SOURCE_COLUMN = 3; +export const NAMES_INDEX = 4; diff --git a/node_modules/@jridgewell/gen-mapping/src/types.ts b/node_modules/@jridgewell/gen-mapping/src/types.ts new file mode 100644 index 0000000..b087f70 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/src/types.ts @@ -0,0 +1,61 @@ +// import type { GeneratedRange, OriginalScope } from '@jridgewell/sourcemap-codec'; +import type { SourceMapSegment } from './sourcemap-segment'; + +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} + +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; + // originalScopes: string[]; + // generatedRanges: string; +} + +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; + // originalScopes: readonly OriginalScope[][]; + // generatedRanges: readonly GeneratedRange[]; +} + +export interface Pos { + line: number; // 1-based + column: number; // 0-based +} + +export interface OriginalPos extends Pos { + source: string; +} + +export interface BindingExpressionRange { + start: Pos; + expression: string; +} + +// export type OriginalScopeInfo = [number, number, string[] | undefined]; +// export type GeneratedRangeInfo = [GeneratedRange, string[] | undefined]; + +export type Mapping = + | { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; + } + | { + generated: Pos; + source: string; + original: Pos; + name: string; + } + | { + generated: Pos; + source: string; + original: Pos; + name: undefined; + }; diff --git a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts new file mode 100644 index 0000000..7618d85 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts @@ -0,0 +1,89 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.cts'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + private _ignoreList; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; +}): void; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare const maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare const maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; +export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare function fromMap(input: SourceMapInput): GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare function allMappings(map: GenMapping): Mapping[]; +//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map new file mode 100644 index 0000000..8a2b183 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd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,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts new file mode 100644 index 0000000..bbc0d89 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts @@ -0,0 +1,89 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.mts'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + private _ignoreList; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; +export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; +}): void; +export declare function addMapping(map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; +}): void; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare const maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare const maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; +export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toDecodedMap(map: GenMapping): DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function toEncodedMap(map: GenMapping): EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare function fromMap(input: SourceMapInput): GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare function allMappings(map: GenMapping): Mapping[]; +//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map new file mode 100644 index 0000000..8a2b183 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU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A,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts b/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts new file mode 100644 index 0000000..5d8cda3 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts @@ -0,0 +1,33 @@ +type Key = string | number | symbol; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly T[]; + constructor(); +} +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare function get(setarr: SetArray, key: T): number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare function put(setarr: SetArray, key: T): number; +/** + * Pops the last added item out of the SetArray. + */ +export declare function pop(setarr: SetArray): void; +/** + * Removes the key, if it exists in the set. + */ +export declare function remove(setarr: SetArray, key: T): void; +export {}; +//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map new file mode 100644 index 0000000..c52b8bc --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts b/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts new file mode 100644 index 0000000..5d8cda3 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts @@ -0,0 +1,33 @@ +type Key = string | number | symbol; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly T[]; + constructor(); +} +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare function get(setarr: SetArray, key: T): number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare function put(setarr: SetArray, key: T): number; +/** + * Pops the last added item out of the SetArray. + */ +export declare function pop(setarr: SetArray): void; +/** + * Removes the key, if it exists in the set. + */ +export declare function remove(setarr: SetArray, key: T): void; +export {}; +//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map new file mode 100644 index 0000000..c52b8bc --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts new file mode 100644 index 0000000..6886295 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts @@ -0,0 +1,13 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map new file mode 100644 index 0000000..23cdc45 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts new file mode 100644 index 0000000..6886295 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts @@ -0,0 +1,13 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map new file mode 100644 index 0000000..23cdc45 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.cts b/node_modules/@jridgewell/gen-mapping/types/types.d.cts new file mode 100644 index 0000000..58da00a --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/types.d.cts @@ -0,0 +1,44 @@ +import type { SourceMapSegment } from './sourcemap-segment.cts'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export interface OriginalPos extends Pos { + source: string; +} +export interface BindingExpressionRange { + start: Pos; + expression: string; +} +export type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map new file mode 100644 index 0000000..159e734 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAGlB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC;CAGzC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.mts b/node_modules/@jridgewell/gen-mapping/types/types.d.mts new file mode 100644 index 0000000..e9837eb --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/types.d.mts @@ -0,0 +1,44 @@ +import type { SourceMapSegment } from './sourcemap-segment.mts'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; + ignoreList?: readonly number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export interface OriginalPos extends Pos { + source: string; +} +export interface BindingExpressionRange { + start: Pos; + expression: string; +} +export type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map new file mode 100644 index 0000000..159e734 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map @@ -0,0 +1 @@ +{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ACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/LICENSE b/node_modules/@jridgewell/remapping/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@jridgewell/remapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@jridgewell/remapping/README.md b/node_modules/@jridgewell/remapping/README.md new file mode 100644 index 0000000..6d092d7 --- /dev/null +++ b/node_modules/@jridgewell/remapping/README.md @@ -0,0 +1,218 @@ +# @jridgewell/remapping + +> Remap sequential sourcemaps through transformations to point at the original source code + +Remapping allows you to take the sourcemaps generated through transforming your code and "remap" +them to the original source locations. Think "my minified code, transformed with babel and bundled +with webpack", all pointing to the correct location in your original source code. + +With remapping, none of your source code transformations need to be aware of the input's sourcemap, +they only need to generate an output sourcemap. This greatly simplifies building custom +transformations (think a find-and-replace). + +## Installation + +```sh +npm install @jridgewell/remapping +``` + +## Usage + +```typescript +function remapping( + map: SourceMap | SourceMap[], + loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined), + options?: { excludeContent: boolean, decodedMappings: boolean } +): SourceMap; + +// LoaderContext gives the loader the importing sourcemap, tree depth, the ability to override the +// "source" location (where child sources are resolved relative to, or the location of original +// source), and the ability to override the "content" of an original source for inclusion in the +// output sourcemap. +type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; +} +``` + +`remapping` takes the final output sourcemap, and a `loader` function. For every source file pointer +in the sourcemap, the `loader` will be called with the resolved path. If the path itself represents +a transformed file (it has a sourcmap associated with it), then the `loader` should return that +sourcemap. If not, the path will be treated as an original, untransformed source code. + +```js +// Babel transformed "helloworld.js" into "transformed.js" +const transformedMap = JSON.stringify({ + file: 'transformed.js', + // 1st column of 2nd line of output file translates into the 1st source + // file, line 3, column 2 + mappings: ';CAEE', + sources: ['helloworld.js'], + version: 3, +}); + +// Uglify minified "transformed.js" into "transformed.min.js" +const minifiedTransformedMap = JSON.stringify({ + file: 'transformed.min.js', + // 0th column of 1st line of output file translates into the 1st source + // file, line 2, column 1. + mappings: 'AACC', + names: [], + sources: ['transformed.js'], + version: 3, +}); + +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + // The "transformed.js" file is an transformed file. + if (file === 'transformed.js') { + // The root importer is empty. + console.assert(ctx.importer === ''); + // The depth in the sourcemap tree we're currently loading. + // The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc. + console.assert(ctx.depth === 1); + + return transformedMap; + } + + // Loader will be called to load transformedMap's source file pointers as well. + console.assert(file === 'helloworld.js'); + // `transformed.js`'s sourcemap points into `helloworld.js`. + console.assert(ctx.importer === 'transformed.js'); + // This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`. + console.assert(ctx.depth === 2); + return null; + } +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +In this example, `loader` will be called twice: + +1. `"transformed.js"`, the first source file pointer in the `minifiedTransformedMap`. We return the + associated sourcemap for it (its a transformed file, after all) so that sourcemap locations can + be traced through it into the source files it represents. +2. `"helloworld.js"`, our original, unmodified source code. This file does not have a sourcemap, so + we return `null`. + +The `remapped` sourcemap now points from `transformed.min.js` into locations in `helloworld.js`. If +you were to read the `mappings`, it says "0th column of the first line output line points to the 1st +column of the 2nd line of the file `helloworld.js`". + +### Multiple transformations of a file + +As a convenience, if you have multiple single-source transformations of a file, you may pass an +array of sourcemap files in the order of most-recent transformation sourcemap first. Note that this +changes the `importer` and `depth` of each call to our loader. So our above example could have been +written as: + +```js +const remapped = remapping( + [minifiedTransformedMap, transformedMap], + () => null +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +### Advanced control of the loading graph + +#### `source` + +The `source` property can overridden to any value to change the location of the current load. Eg, +for an original source file, it allows us to change the location to the original source regardless +of what the sourcemap source entry says. And for transformed files, it allows us to change the +relative resolving location for child sources of the loaded sourcemap. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // We pretend the transformed.js file actually exists in the 'src/' directory. When the nested + // source files are loaded, they will now be relative to `src/`. + ctx.source = 'src/transformed.js'; + return transformedMap; + } + + console.assert(file === 'src/helloworld.js'); + // We could futher change the source of this original file, eg, to be inside a nested directory + // itself. This will be reflected in the remapped sourcemap. + ctx.source = 'src/nested/transformed.js'; + return null; + } +); + +console.log(remapped); +// { +// …, +// sources: ['src/nested/helloworld.js'], +// }; +``` + + +#### `content` + +The `content` property can be overridden when we encounter an original source file. Eg, this allows +you to manually provide the source content of the original file regardless of whether the +`sourcesContent` field is present in the parent sourcemap. It can also be set to `null` to remove +the source content. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // transformedMap does not include a `sourcesContent` field, so usually the remapped sourcemap + // would not include any `sourcesContent` values. + return transformedMap; + } + + console.assert(file === 'helloworld.js'); + // We can read the file to provide the source content. + ctx.content = fs.readFileSync(file, 'utf8'); + return null; + } +); + +console.log(remapped); +// { +// …, +// sourcesContent: [ +// 'console.log("Hello world!")', +// ], +// }; +``` + +### Options + +#### excludeContent + +By default, `excludeContent` is `false`. Passing `{ excludeContent: true }` will exclude the +`sourcesContent` field from the returned sourcemap. This is mainly useful when you want to reduce +the size out the sourcemap. + +#### decodedMappings + +By default, `decodedMappings` is `false`. Passing `{ decodedMappings: true }` will leave the +`mappings` field in a [decoded state](https://github.com/rich-harris/sourcemap-codec) instead of +encoding into a VLQ string. diff --git a/node_modules/@jridgewell/remapping/dist/remapping.mjs b/node_modules/@jridgewell/remapping/dist/remapping.mjs new file mode 100644 index 0000000..8b7009c --- /dev/null +++ b/node_modules/@jridgewell/remapping/dist/remapping.mjs @@ -0,0 +1,144 @@ +// src/build-source-map-tree.ts +import { TraceMap } from "@jridgewell/trace-mapping"; + +// src/source-map-tree.ts +import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from "@jridgewell/gen-mapping"; +import { traceSegment, decodedMappings } from "@jridgewell/trace-mapping"; +var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false); +var EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; +} +function Source(map, sources, source, content, ignore) { + return { + map, + sources, + source, + content, + ignore + }; +} +function MapSource(map, sources) { + return Source(map, sources, "", null, false); +} +function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} +function traceMappings(tree) { + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + if (segment.length !== 1) { + const source2 = rootSources[segment[1]]; + traced = originalPositionFor( + source2, + segment[2], + segment[3], + segment.length === 5 ? rootNames[segment[4]] : "" + ); + if (traced == null) continue; + } + const { column, line, name, content, source, ignore } = traced; + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) setSourceContent(gen, source, content); + if (ignore) setIgnore(gen, source, true); + } + } + return gen; +} +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + const segment = traceSegment(source.map, line, column); + if (segment == null) return null; + if (segment.length === 1) return SOURCELESS_MAPPING; + return originalPositionFor( + source.sources[segment[1]], + segment[2], + segment[3], + segment.length === 5 ? source.map.names[segment[4]] : name + ); +} + +// src/build-source-map-tree.ts +function asArray(value) { + if (Array.isArray(value)) return value; + return [value]; +} +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new TraceMap(m, "")); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error( + `Transformation map ${i} must have exactly one source file. +Did you specify these with the most recent transformation maps first?` + ); + } + } + let tree = build(map, loader, "", 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} +function build(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + const ctx = { + importer, + depth, + source: sourceFile || "", + content: void 0, + ignore: void 0 + }; + const sourceMap = loader(ctx.source, ctx); + const { source, content, ignore } = ctx; + if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth); + const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + return MapSource(map, children); +} + +// src/source-map.ts +import { toDecodedMap, toEncodedMap } from "@jridgewell/gen-mapping"; +var SourceMap = class { + constructor(map, options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +}; + +// src/remapping.ts +function remapping(input, loader, options) { + const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} +export { + remapping as default +}; +//# sourceMappingURL=remapping.mjs.map diff --git a/node_modules/@jridgewell/remapping/dist/remapping.mjs.map b/node_modules/@jridgewell/remapping/dist/remapping.mjs.map new file mode 100644 index 0000000..66801e6 --- /dev/null +++ b/node_modules/@jridgewell/remapping/dist/remapping.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/build-source-map-tree.ts", "../src/source-map-tree.ts", "../src/source-map.ts", "../src/remapping.ts"], + "mappings": ";AAAA,SAAS,gBAAgB;;;ACAzB,SAAS,YAAY,iBAAiB,WAAW,wBAAwB;AACzE,SAAS,cAAc,uBAAuB;AA+B9C,IAAM,qBAAqC,8BAAc,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK;AACpF,IAAM,gBAA2B,CAAC;AAElC,SAAS,cACP,QACA,MACA,QACA,MACA,SACA,QACwB;AACxB,SAAO,EAAE,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO;AACvD;AAgBA,SAAS,OACP,KACA,SACA,QACA,SACA,QACS;AACT,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAMO,SAAS,UAAU,KAAe,SAA+B;AACtE,SAAO,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK;AAC7C;AAMO,SAAS,eACd,QACA,SACA,QACgB;AAChB,SAAO,OAAO,MAAM,eAAe,QAAQ,S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QAAQ,KAAK;AAMlF,UAAM,gBACJ,YAAY,SAAY,UAAU,iBAAiB,eAAe,CAAC,IAAI;AACzE,UAAM,UAAU,WAAW,SAAY,SAAS,aAAa,WAAW,SAAS,CAAC,IAAI;AACtF,WAAO,eAAe,QAAQ,eAAe,OAAO;AAAA,EACtD,CAAC;AAED,SAAO,UAAU,KAAK,QAAQ;AAChC;;;AExFA,SAAS,cAAc,oBAAoB;AAS3C,IAAqB,YAArB,MAA+B;AAAA,EAU7B,YAAY,KAAiB,SAAkB;AAC7C,UAAM,MAAM,QAAQ,kBAAkB,aAAa,GAAG,IAAI,aAAa,GAAG;AAC1E,SAAK,UAAU,IAAI;AACnB,SAAK,OAAO,IAAI;AAChB,SAAK,WAAW,IAAI;AACpB,SAAK,QAAQ,IAAI;AACjB,SAAK,aAAa,IAAI;AACtB,SAAK,aAAa,IAAI;AAEtB,SAAK,UAAU,IAAI;AACnB,QAAI,CAAC,QAAQ,gBAAgB;AAC3B,WAAK,iBAAiB,IAAI;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;;;ACLe,SAAR,UACL,OACA,QACA,SACW;AACX,QAAM,OACJ,OAAO,YAAY,WAAW,UAAU,EAAE,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,MAAM;AAC9F,QAAM,OAAO,mBAAmB,OAAO,MAAM;AAC7C,SAAO,IAAI,UAAU,cAAc,IAAI,GAAG,IAAI;AAChD;", + "names": ["source"] +} diff --git a/node_modules/@jridgewell/remapping/dist/remapping.umd.js b/node_modules/@jridgewell/remapping/dist/remapping.umd.js new file mode 100644 index 0000000..077eb4d --- /dev/null +++ b/node_modules/@jridgewell/remapping/dist/remapping.umd.js @@ -0,0 +1,212 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module, require('@jridgewell/gen-mapping'), require('@jridgewell/trace-mapping')); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module', '@jridgewell/gen-mapping', '@jridgewell/trace-mapping'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod, global.genMapping, global.traceMapping); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.remapping = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module, require_genMapping, require_traceMapping) { +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// umd:@jridgewell/trace-mapping +var require_trace_mapping = __commonJS({ + "umd:@jridgewell/trace-mapping"(exports, module2) { + module2.exports = require_traceMapping; + } +}); + +// umd:@jridgewell/gen-mapping +var require_gen_mapping = __commonJS({ + "umd:@jridgewell/gen-mapping"(exports, module2) { + module2.exports = require_genMapping; + } +}); + +// src/remapping.ts +var remapping_exports = {}; +__export(remapping_exports, { + default: () => remapping +}); +module.exports = __toCommonJS(remapping_exports); + +// src/build-source-map-tree.ts +var import_trace_mapping2 = __toESM(require_trace_mapping()); + +// src/source-map-tree.ts +var import_gen_mapping = __toESM(require_gen_mapping()); +var import_trace_mapping = __toESM(require_trace_mapping()); +var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false); +var EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content, ignore) { + return { source, line, column, name, content, ignore }; +} +function Source(map, sources, source, content, ignore) { + return { + map, + sources, + source, + content, + ignore + }; +} +function MapSource(map, sources) { + return Source(map, sources, "", null, false); +} +function OriginalSource(source, content, ignore) { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} +function traceMappings(tree) { + const gen = new import_gen_mapping.GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = (0, import_trace_mapping.decodedMappings)(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + if (segment.length !== 1) { + const source2 = rootSources[segment[1]]; + traced = originalPositionFor( + source2, + segment[2], + segment[3], + segment.length === 5 ? rootNames[segment[4]] : "" + ); + if (traced == null) continue; + } + const { column, line, name, content, source, ignore } = traced; + (0, import_gen_mapping.maybeAddSegment)(gen, i, genCol, source, line, column, name); + if (source && content != null) (0, import_gen_mapping.setSourceContent)(gen, source, content); + if (ignore) (0, import_gen_mapping.setIgnore)(gen, source, true); + } + } + return gen; +} +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + const segment = (0, import_trace_mapping.traceSegment)(source.map, line, column); + if (segment == null) return null; + if (segment.length === 1) return SOURCELESS_MAPPING; + return originalPositionFor( + source.sources[segment[1]], + segment[2], + segment[3], + segment.length === 5 ? source.map.names[segment[4]] : name + ); +} + +// src/build-source-map-tree.ts +function asArray(value) { + if (Array.isArray(value)) return value; + return [value]; +} +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new import_trace_mapping2.TraceMap(m, "")); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error( + `Transformation map ${i} must have exactly one source file. +Did you specify these with the most recent transformation maps first?` + ); + } + } + let tree = build(map, loader, "", 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} +function build(map, loader, importer, importerDepth) { + const { resolvedSources, sourcesContent, ignoreList } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + const ctx = { + importer, + depth, + source: sourceFile || "", + content: void 0, + ignore: void 0 + }; + const sourceMap = loader(ctx.source, ctx); + const { source, content, ignore } = ctx; + if (sourceMap) return build(new import_trace_mapping2.TraceMap(sourceMap, source), loader, source, depth); + const sourceContent = content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + return MapSource(map, children); +} + +// src/source-map.ts +var import_gen_mapping2 = __toESM(require_gen_mapping()); +var SourceMap = class { + constructor(map, options) { + const out = options.decodedMappings ? (0, import_gen_mapping2.toDecodedMap)(map) : (0, import_gen_mapping2.toEncodedMap)(map); + this.version = out.version; + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.ignoreList = out.ignoreList; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +}; + +// src/remapping.ts +function remapping(input, loader, options) { + const opts = typeof options === "object" ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} +})); +//# sourceMappingURL=remapping.umd.js.map diff --git a/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map b/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map new file mode 100644 index 0000000..d5e0786 --- /dev/null +++ b/node_modules/@jridgewell/remapping/dist/remapping.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["umd:@jridgewell/trace-mapping", "umd:@jridgewell/gen-mapping", "../src/remapping.ts", "../src/build-source-map-tree.ts", "../src/source-map-tree.ts", "../src/source-map.ts"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,2CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,yCAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAC,wBAAyB;;;ACAzB,yBAAyE;AACzE,2BAA8C;AA+B9C,IAAM,qBAAqC,8BAAc,IAAI,IAAI,IAAI,IAAI,MAAM,KAAK;AACpF,IAAM,gBAA2B,CAAC;AAElC,SAAS,cACP,QACA,MACA,QACA,MACA,SACA,QACwB;AACxB,SAAO,EAAE,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO;AACvD;AAgBA,SAAS,OACP,KACA,SACA,QACA,SACA,QACS;AACT,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAMO,SAAS,UAAU,KAAe,SAA+B;AACtE,SAAO,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK;AAC7C;AAMO,SAAS,eACd,QACA,SACA,QACgB;AAChB,SAAO,OAAO,MAAM,eAAe,QAAQ,SAAS,MAAM;AAC5D;AAMO,SAAS,cAAc,MAA6B;AAGzD,QAAM,MAAM,IAAI,8BAAW,EAAE,MAAM,KAAK,IAAI,KAAK,CAAC;AAClD,QAAM,EAAE,SAAS,aAAa,I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C,IAAI;AACtF,WAAO,eAAe,QAAQ,eAAe,OAAO;AAAA,EACtD,CAAC;AAED,SAAO,UAAU,KAAK,QAAQ;AAChC;;;AExFA,IAAAC,sBAA2C;AAS3C,IAAqB,YAArB,MAA+B;AAAA,EAU7B,YAAY,KAAiB,SAAkB;AAC7C,UAAM,MAAM,QAAQ,sBAAkB,kCAAa,GAAG,QAAI,kCAAa,GAAG;AAC1E,SAAK,UAAU,IAAI;AACnB,SAAK,OAAO,IAAI;AAChB,SAAK,WAAW,IAAI;AACpB,SAAK,QAAQ,IAAI;AACjB,SAAK,aAAa,IAAI;AACtB,SAAK,aAAa,IAAI;AAEtB,SAAK,UAAU,IAAI;AACnB,QAAI,CAAC,QAAQ,gBAAgB;AAC3B,WAAK,iBAAiB,IAAI;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,UAAU,IAAI;AAAA,EAC5B;AACF;;;AHLe,SAAR,UACL,OACA,QACA,SACW;AACX,QAAM,OACJ,OAAO,YAAY,WAAW,UAAU,EAAE,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,MAAM;AAC9F,QAAM,OAAO,mBAAmB,OAAO,MAAM;AAC7C,SAAO,IAAI,UAAU,cAAc,IAAI,GAAG,IAAI;AAChD;", + "names": ["module", "module", "import_trace_mapping", "source", "import_gen_mapping"] +} diff --git a/node_modules/@jridgewell/remapping/package.json b/node_modules/@jridgewell/remapping/package.json new file mode 100644 index 0000000..ed00441 --- /dev/null +++ b/node_modules/@jridgewell/remapping/package.json @@ -0,0 +1,71 @@ +{ + "name": "@jridgewell/remapping", + "version": "2.3.5", + "description": "Remap sequential sourcemaps through transformations to point at the original source code", + "keywords": [ + "source", + "map", + "remap" + ], + "main": "dist/remapping.umd.js", + "module": "dist/remapping.mjs", + "types": "types/remapping.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/remapping.d.mts", + "default": "./dist/remapping.mjs" + }, + "default": { + "types": "./types/remapping.d.cts", + "default": "./dist/remapping.umd.js" + } + }, + "./dist/remapping.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs remapping.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/remapping", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/remapping" + }, + "author": "Justin Ridgewell ", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "devDependencies": { + "source-map": "0.6.1" + } +} diff --git a/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts b/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts new file mode 100644 index 0000000..3e0262b --- /dev/null +++ b/node_modules/@jridgewell/remapping/src/build-source-map-tree.ts @@ -0,0 +1,89 @@ +import { TraceMap } from '@jridgewell/trace-mapping'; + +import { OriginalSource, MapSource } from './source-map-tree'; + +import type { Sources, MapSource as MapSourceType } from './source-map-tree'; +import type { SourceMapInput, SourceMapLoader, LoaderContext } from './types'; + +function asArray(value: T | T[]): T[] { + if (Array.isArray(value)) return value; + return [value]; +} + +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export default function buildSourceMapTree( + input: SourceMapInput | SourceMapInput[], + loader: SourceMapLoader, +): MapSourceType { + const maps = asArray(input).map((m) => new TraceMap(m, '')); + const map = maps.pop()!; + + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error( + `Transformation map ${i} must have exactly one source file.\n` + + 'Did you specify these with the most recent transformation maps first?', + ); + } + } + + let tree = build(map, loader, '', 0); + for (let i = maps.length - 1; i >= 0; i--) { + tree = MapSource(maps[i], [tree]); + } + return tree; +} + +function build( + map: TraceMap, + loader: SourceMapLoader, + importer: string, + importerDepth: number, +): MapSourceType { + const { resolvedSources, sourcesContent, ignoreList } = map; + + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile: string | null, i: number): Sources => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx: LoaderContext = { + importer, + depth, + source: sourceFile || '', + content: undefined, + ignore: undefined, + }; + + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + + const { source, content, ignore } = ctx; + + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth); + + // Else, it's an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = + content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; + return OriginalSource(source, sourceContent, ignored); + }); + + return MapSource(map, children); +} diff --git a/node_modules/@jridgewell/remapping/src/remapping.ts b/node_modules/@jridgewell/remapping/src/remapping.ts new file mode 100644 index 0000000..c0f8b0d --- /dev/null +++ b/node_modules/@jridgewell/remapping/src/remapping.ts @@ -0,0 +1,42 @@ +import buildSourceMapTree from './build-source-map-tree'; +import { traceMappings } from './source-map-tree'; +import SourceMap from './source-map'; + +import type { SourceMapInput, SourceMapLoader, Options } from './types'; +export type { + SourceMapSegment, + EncodedSourceMap, + EncodedSourceMap as RawSourceMap, + DecodedSourceMap, + SourceMapInput, + SourceMapLoader, + LoaderContext, + Options, +} from './types'; +export type { SourceMap }; + +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export default function remapping( + input: SourceMapInput | SourceMapInput[], + loader: SourceMapLoader, + options?: boolean | Options, +): SourceMap { + const opts = + typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} diff --git a/node_modules/@jridgewell/remapping/src/source-map-tree.ts b/node_modules/@jridgewell/remapping/src/source-map-tree.ts new file mode 100644 index 0000000..935240f --- /dev/null +++ b/node_modules/@jridgewell/remapping/src/source-map-tree.ts @@ -0,0 +1,172 @@ +import { GenMapping, maybeAddSegment, setIgnore, setSourceContent } from '@jridgewell/gen-mapping'; +import { traceSegment, decodedMappings } from '@jridgewell/trace-mapping'; + +import type { TraceMap } from '@jridgewell/trace-mapping'; + +export type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; + ignore: boolean; +}; + +export type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; + ignore: boolean; +}; + +export type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; + ignore: false; +}; + +export type Sources = OriginalSource | MapSource; + +const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); +const EMPTY_SOURCES: Sources[] = []; + +function SegmentObject( + source: string, + line: number, + column: number, + name: string, + content: string | null, + ignore: boolean, +): SourceMapSegmentObject { + return { source, line, column, name, content, ignore }; +} + +function Source( + map: TraceMap, + sources: Sources[], + source: '', + content: null, + ignore: false, +): MapSource; +function Source( + map: null, + sources: Sources[], + source: string, + content: string | null, + ignore: boolean, +): OriginalSource; +function Source( + map: TraceMap | null, + sources: Sources[], + source: string | '', + content: string | null, + ignore: boolean, +): Sources { + return { + map, + sources, + source, + content, + ignore, + } as any; +} + +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export function MapSource(map: TraceMap, sources: Sources[]): MapSource { + return Source(map, sources, '', null, false); +} + +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export function OriginalSource( + source: string, + content: string | null, + ignore: boolean, +): OriginalSource { + return Source(null, EMPTY_SOURCES, source, content, ignore); +} + +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export function traceMappings(tree: MapSource): GenMapping { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING; + + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor( + source, + segment[2], + segment[3], + segment.length === 5 ? rootNames[segment[4]] : '', + ); + + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) continue; + } + + const { column, line, name, content, source, ignore } = traced; + + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) setSourceContent(gen, source, content); + if (ignore) setIgnore(gen, source, true); + } + } + + return gen; +} + +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export function originalPositionFor( + source: Sources, + line: number, + column: number, + name: string, +): SourceMapSegmentObject | null { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content, source.ignore); + } + + const segment = traceSegment(source.map, line, column); + + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) return SOURCELESS_MAPPING; + + return originalPositionFor( + source.sources[segment[1]], + segment[2], + segment[3], + segment.length === 5 ? source.map.names[segment[4]] : name, + ); +} diff --git a/node_modules/@jridgewell/remapping/src/source-map.ts b/node_modules/@jridgewell/remapping/src/source-map.ts new file mode 100644 index 0000000..5156086 --- /dev/null +++ b/node_modules/@jridgewell/remapping/src/source-map.ts @@ -0,0 +1,38 @@ +import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping'; + +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types'; + +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export default class SourceMap { + declare file?: string | null; + declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + declare sourceRoot?: string; + declare names: string[]; + declare sources: (string | null)[]; + declare sourcesContent?: (string | null)[]; + declare version: 3; + declare ignoreList: number[] | undefined; + + constructor(map: GenMapping, options: Options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings as SourceMap['mappings']; + this.names = out.names as SourceMap['names']; + this.ignoreList = out.ignoreList as SourceMap['ignoreList']; + this.sourceRoot = out.sourceRoot; + + this.sources = out.sources as SourceMap['sources']; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent']; + } + } + + toString(): string { + return JSON.stringify(this); + } +} diff --git a/node_modules/@jridgewell/remapping/src/types.ts b/node_modules/@jridgewell/remapping/src/types.ts new file mode 100644 index 0000000..384961d --- /dev/null +++ b/node_modules/@jridgewell/remapping/src/types.ts @@ -0,0 +1,27 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; + +export type { + SourceMapSegment, + DecodedSourceMap, + EncodedSourceMap, +} from '@jridgewell/trace-mapping'; + +export type { SourceMapInput }; + +export type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; + ignore: boolean | undefined; +}; + +export type SourceMapLoader = ( + file: string, + ctx: LoaderContext, +) => SourceMapInput | null | undefined | void; + +export type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; diff --git a/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts new file mode 100644 index 0000000..e089aea --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts @@ -0,0 +1,15 @@ +import type { MapSource as MapSourceType } from './source-map-tree.cts'; +import type { SourceMapInput, SourceMapLoader } from './types.cts'; +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export = function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; +//# sourceMappingURL=build-source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map new file mode 100644 index 0000000..38e4290 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"build-source-map-tree.d.ts","sourceRoot":"","sources":["../src/build-source-map-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,SAAS,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAO9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,GACtB,aAAa,CAkBf"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts new file mode 100644 index 0000000..746ac5f --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts @@ -0,0 +1,15 @@ +import type { MapSource as MapSourceType } from './source-map-tree.mts'; +import type { SourceMapInput, SourceMapLoader } from './types.mts'; +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export default function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; +//# sourceMappingURL=build-source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map new file mode 100644 index 0000000..38e4290 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"build-source-map-tree.d.ts","sourceRoot":"","sources":["../src/build-source-map-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,SAAS,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,SAAS,CAAC;AAO9E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,GACtB,aAAa,CAkBf"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/remapping.d.cts b/node_modules/@jridgewell/remapping/types/remapping.d.cts new file mode 100644 index 0000000..2022784 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/remapping.d.cts @@ -0,0 +1,21 @@ +import SourceMap from './source-map.cts'; +import type { SourceMapInput, SourceMapLoader, Options } from './types.cts'; +export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types.cts'; +export type { SourceMap }; +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export = function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; +//# sourceMappingURL=remapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/remapping.d.cts.map b/node_modules/@jridgewell/remapping/types/remapping.d.cts.map new file mode 100644 index 0000000..9f2fd0e --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/remapping.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.d.ts","sourceRoot":"","sources":["../src/remapping.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAC1B,SAAS,CAKX"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/remapping.d.mts b/node_modules/@jridgewell/remapping/types/remapping.d.mts new file mode 100644 index 0000000..95c4066 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/remapping.d.mts @@ -0,0 +1,21 @@ +import SourceMap from './source-map.mts'; +import type { SourceMapInput, SourceMapLoader, Options } from './types.mts'; +export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types.mts'; +export type { SourceMap }; +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export default function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; +//# sourceMappingURL=remapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/remapping.d.mts.map b/node_modules/@jridgewell/remapping/types/remapping.d.mts.map new file mode 100644 index 0000000..9f2fd0e --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/remapping.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.d.ts","sourceRoot":"","sources":["../src/remapping.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,IAAI,YAAY,EAChC,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,aAAa,EACb,OAAO,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,cAAc,GAAG,cAAc,EAAE,EACxC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAC1B,SAAS,CAKX"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts b/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts new file mode 100644 index 0000000..440f65b --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts @@ -0,0 +1,46 @@ +import { GenMapping } from '@jridgewell/gen-mapping'; +import type { TraceMap } from '@jridgewell/trace-mapping'; +export type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; + ignore: boolean; +}; +export type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; + ignore: boolean; +}; +export type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; + ignore: false; +}; +export type Sources = OriginalSource | MapSource; +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource; +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export declare function traceMappings(tree: MapSource): GenMapping; +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; +//# sourceMappingURL=source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map b/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map new file mode 100644 index 0000000..e7cbfb9 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map-tree.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map-tree.d.ts","sourceRoot":"","sources":["../src/source-map-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,yBAAyB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AA8CjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,EAAE,OAAO,GACd,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAyCzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,IAAI,CAmB/B"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts b/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts new file mode 100644 index 0000000..440f65b --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts @@ -0,0 +1,46 @@ +import { GenMapping } from '@jridgewell/gen-mapping'; +import type { TraceMap } from '@jridgewell/trace-mapping'; +export type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; + ignore: boolean; +}; +export type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; + ignore: boolean; +}; +export type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; + ignore: false; +}; +export type Sources = OriginalSource | MapSource; +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export declare function OriginalSource(source: string, content: string | null, ignore: boolean): OriginalSource; +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export declare function traceMappings(tree: MapSource): GenMapping; +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; +//# sourceMappingURL=source-map-tree.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map b/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map new file mode 100644 index 0000000..e7cbfb9 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map-tree.d.ts","sourceRoot":"","sources":["../src/source-map-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgD,MAAM,yBAAyB,CAAC;AAGnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,IAAI,CAAC;IACV,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;AA8CjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,SAAS,CAEtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,EAAE,OAAO,GACd,cAAc,CAEhB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,UAAU,CAyCzD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,sBAAsB,GAAG,IAAI,CAmB/B"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map.d.cts b/node_modules/@jridgewell/remapping/types/source-map.d.cts new file mode 100644 index 0000000..fdb7eed --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map.d.cts @@ -0,0 +1,19 @@ +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types.cts'; +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export = class SourceMap { + file?: string | null; + mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + sourceRoot?: string; + names: string[]; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList: number[] | undefined; + constructor(map: GenMapping, options: Options); + toString(): string; +} +//# sourceMappingURL=source-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map.d.cts.map b/node_modules/@jridgewell/remapping/types/source-map.d.cts.map new file mode 100644 index 0000000..593daf8 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../src/source-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAE7B,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;IAe7C,QAAQ,IAAI,MAAM;CAGnB"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map.d.mts b/node_modules/@jridgewell/remapping/types/source-map.d.mts new file mode 100644 index 0000000..52ebba2 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map.d.mts @@ -0,0 +1,19 @@ +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types.mts'; +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export default class SourceMap { + file?: string | null; + mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + sourceRoot?: string; + names: string[]; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList: number[] | undefined; + constructor(map: GenMapping, options: Options); + toString(): string; +} +//# sourceMappingURL=source-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/source-map.d.mts.map b/node_modules/@jridgewell/remapping/types/source-map.d.mts.map new file mode 100644 index 0000000..593daf8 --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/source-map.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../src/source-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE3E;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;gBAE7B,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO;IAe7C,QAAQ,IAAI,MAAM;CAGnB"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/types.d.cts b/node_modules/@jridgewell/remapping/types/types.d.cts new file mode 100644 index 0000000..eeb320f --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/types.d.cts @@ -0,0 +1,16 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; +export type { SourceMapInput }; +export type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; + ignore: boolean | undefined; +}; +export type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; +export type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/types.d.cts.map b/node_modules/@jridgewell/remapping/types/types.d.cts.map new file mode 100644 index 0000000..4f8647e --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/types.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,KACf,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/types.d.mts b/node_modules/@jridgewell/remapping/types/types.d.mts new file mode 100644 index 0000000..eeb320f --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/types.d.mts @@ -0,0 +1,16 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; +export type { SourceMapInput }; +export type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; + ignore: boolean | undefined; +}; +export type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; +export type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/remapping/types/types.d.mts.map b/node_modules/@jridgewell/remapping/types/types.d.mts.map new file mode 100644 index 0000000..4f8647e --- /dev/null +++ b/node_modules/@jridgewell/remapping/types/types.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,aAAa,KACf,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/LICENSE b/node_modules/@jridgewell/resolve-uri/LICENSE new file mode 100644 index 0000000..0a81b2a --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/LICENSE @@ -0,0 +1,19 @@ +Copyright 2019 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/README.md b/node_modules/@jridgewell/resolve-uri/README.md new file mode 100644 index 0000000..2fe70df --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/README.md @@ -0,0 +1,40 @@ +# @jridgewell/resolve-uri + +> Resolve a URI relative to an optional base URI + +Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths. + +## Installation + +```sh +npm install @jridgewell/resolve-uri +``` + +## Usage + +```typescript +function resolve(input: string, base?: string): string; +``` + +```js +import resolve from '@jridgewell/resolve-uri'; + +resolve('foo', 'https://example.com'); // => 'https://example.com/foo' +``` + +| Input | Base | Resolution | Explanation | +|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------| +| `https://example.com` | _any_ | `https://example.com/` | Input is normalized only | +| `//example.com` | `https://base.com/` | `https://example.com/` | Input inherits the base's protocol | +| `//example.com` | _rest_ | `//example.com/` | Input is normalized only | +| `/example` | `https://base.com/` | `https://base.com/example` | Input inherits the base's origin | +| `/example` | `//base.com/` | `//base.com/example` | Input inherits the base's host and remains protocol relative | +| `/example` | _rest_ | `/example` | Input is normalized only | +| `example` | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base | +| `example` | `https://base.com/file` | `https://base.com/example` | Input is joined with the base without its file | +| `example` | `//base.com/dir/` | `//base.com/dir/example` | Input is joined with the base's last directory | +| `example` | `//base.com/file` | `//base.com/example` | Input is joined with the base without its file | +| `example` | `/base/dir/` | `/base/dir/example` | Input is joined with the base's last directory | +| `example` | `/base/file` | `/base/example` | Input is joined with the base without its file | +| `example` | `base/dir/` | `base/dir/example` | Input is joined with the base's last directory | +| `example` | `base/file` | `base/example` | Input is joined with the base without its file | diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs new file mode 100644 index 0000000..e958e88 --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs @@ -0,0 +1,232 @@ +// Matches the scheme of a URL, eg "http://" +const schemeRegex = /^[\w+.-]+:\/\//; +/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; +/** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith('//'); +} +function isAbsolutePath(input) { + return input.startsWith('/'); +} +function isFileUrl(input) { + return input.startsWith('file:'); +} +function isRelative(input) { + return /^[.?#]/.test(input); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); +} +function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: 7 /* Absolute */, + }; +} +function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = 6 /* SchemeRelative */; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = 5 /* AbsolutePath */; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? 3 /* Query */ + : input.startsWith('#') + ? 2 /* Hash */ + : 4 /* RelativePath */ + : 1 /* Empty */; + return url; +} +function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} +function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } +} +/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ +function normalizePath(url, type) { + const rel = type <= 4 /* RelativePath */; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; +} +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== 7 /* Absolute */) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case 1 /* Empty */: + url.hash = baseUrl.hash; + // fall through + case 2 /* Hash */: + url.query = baseUrl.query; + // fall through + case 3 /* Query */: + case 4 /* RelativePath */: + mergePaths(url, baseUrl); + // fall through + case 5 /* AbsolutePath */: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case 6 /* SchemeRelative */: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case 2 /* Hash */: + case 3 /* Query */: + return queryHash; + case 4 /* RelativePath */: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case 5 /* AbsolutePath */: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } +} + +export { resolve as default }; +//# sourceMappingURL=resolve-uri.mjs.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map new file mode 100644 index 0000000..1de97d0 --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.mjs","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":"AAAA;AACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;AAE5F;;;;;;;;;AASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;AAuBpF,SAAS,aAAa,CAAC,KAAa;IA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ri.umd.js new file mode 100644 index 0000000..a783049 --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js @@ -0,0 +1,240 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory()); +})(this, (function () { 'use strict'; + + // Matches the scheme of a URL, eg "http://" + const schemeRegex = /^[\w+.-]+:\/\//; + /** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ + const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; + /** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ + const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; + function isAbsoluteUrl(input) { + return schemeRegex.test(input); + } + function isSchemeRelativeUrl(input) { + return input.startsWith('//'); + } + function isAbsolutePath(input) { + return input.startsWith('/'); + } + function isFileUrl(input) { + return input.startsWith('file:'); + } + function isRelative(input) { + return /^[.?#]/.test(input); + } + function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); + } + function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); + } + function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: 7 /* Absolute */, + }; + } + function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = 6 /* SchemeRelative */; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = 5 /* AbsolutePath */; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? 3 /* Query */ + : input.startsWith('#') + ? 2 /* Hash */ + : 4 /* RelativePath */ + : 1 /* Empty */; + return url; + } + function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } + } + /** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ + function normalizePath(url, type) { + const rel = type <= 4 /* RelativePath */; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; + } + /** + * Attempts to resolve `input` URL/path relative to `base`. + */ + function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== 7 /* Absolute */) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case 1 /* Empty */: + url.hash = baseUrl.hash; + // fall through + case 2 /* Hash */: + url.query = baseUrl.query; + // fall through + case 3 /* Query */: + case 4 /* RelativePath */: + mergePaths(url, baseUrl); + // fall through + case 5 /* AbsolutePath */: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case 6 /* SchemeRelative */: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case 2 /* Hash */: + case 3 /* Query */: + return queryHash; + case 4 /* RelativePath */: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case 5 /* AbsolutePath */: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } + } + + return resolve; + +})); +//# sourceMappingURL=resolve-uri.umd.js.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map new file mode 100644 index 0000000..70a37f2 --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.umd.js","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.sche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,CAAC;YAE9B;gBACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;SACpF;IACH;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts b/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts new file mode 100644 index 0000000..b7f0b3b --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts @@ -0,0 +1,4 @@ +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@jridgewell/resolve-uri/package.json b/node_modules/@jridgewell/resolve-uri/package.json new file mode 100644 index 0000000..02a4c51 --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/package.json @@ -0,0 +1,69 @@ +{ + "name": "@jridgewell/resolve-uri", + "version": "3.1.2", + "description": "Resolve a URI relative to an optional base URI", + "keywords": [ + "resolve", + "uri", + "url", + "path" + ], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/resolve-uri", + "main": "dist/resolve-uri.umd.js", + "module": "dist/resolve-uri.mjs", + "types": "dist/types/resolve-uri.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/resolve-uri.d.ts", + "browser": "./dist/resolve-uri.umd.js", + "require": "./dist/resolve-uri.umd.js", + "import": "./dist/resolve-uri.mjs" + }, + "./dist/resolve-uri.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*", + "@rollup/plugin-typescript": "8.3.0", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "c8": "7.11.0", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.66.0", + "typescript": "4.5.5" + } +} diff --git a/node_modules/@jridgewell/sourcemap-codec/LICENSE b/node_modules/@jridgewell/sourcemap-codec/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@jridgewell/sourcemap-codec/README.md b/node_modules/@jridgewell/sourcemap-codec/README.md new file mode 100644 index 0000000..b3e0708 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/README.md @@ -0,0 +1,264 @@ +# @jridgewell/sourcemap-codec + +Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). + + +## Why? + +Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap. + +This package makes the process slightly easier. + + +## Installation + +```bash +npm install @jridgewell/sourcemap-codec +``` + + +## Usage + +```js +import { encode, decode } from '@jridgewell/sourcemap-codec'; + +var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); + +assert.deepEqual( decoded, [ + // the first line (of the generated code) has no mappings, + // as shown by the starting semi-colon (which separates lines) + [], + + // the second line contains four (comma-separated) segments + [ + // segments are encoded as you'd expect: + // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] + + // i.e. the first segment begins at column 2, and maps back to the second column + // of the second line (both zero-based) of the 0th source, and uses the 0th + // name in the `map.names` array + [ 2, 0, 2, 2, 0 ], + + // the remaining segments are 4-length rather than 5-length, + // because they don't map a name + [ 4, 0, 2, 4 ], + [ 6, 0, 2, 5 ], + [ 7, 0, 2, 7 ] + ], + + // the final line contains two segments + [ + [ 2, 1, 10, 19 ], + [ 12, 1, 11, 20 ] + ] +]); + +var encoded = encode( decoded ); +assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); +``` + +## Benchmarks + +``` +node v20.10.0 + +amp.js.map - 45120 segments + +Decode Memory Usage: +local code 5815135 bytes +@jridgewell/sourcemap-codec 1.4.15 5868160 bytes +sourcemap-codec 5492584 bytes +source-map-0.6.1 13569984 bytes +source-map-0.8.0 6390584 bytes +chrome dev tools 8011136 bytes +Smallest memory usage is sourcemap-codec + +Decode speed: +decode: local code x 492 ops/sec ±1.22% (90 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 499 ops/sec ±1.16% (89 runs sampled) +decode: sourcemap-codec x 376 ops/sec ±1.66% (89 runs sampled) +decode: source-map-0.6.1 x 34.99 ops/sec ±0.94% (48 runs sampled) +decode: source-map-0.8.0 x 351 ops/sec ±0.07% (95 runs sampled) +chrome dev tools x 165 ops/sec ±0.91% (86 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 444248 bytes +@jridgewell/sourcemap-codec 1.4.15 623024 bytes +sourcemap-codec 8696280 bytes +source-map-0.6.1 8745176 bytes +source-map-0.8.0 8736624 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 796 ops/sec ±0.11% (97 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 795 ops/sec ±0.25% (98 runs sampled) +encode: sourcemap-codec x 231 ops/sec ±0.83% (86 runs sampled) +encode: source-map-0.6.1 x 166 ops/sec ±0.57% (86 runs sampled) +encode: source-map-0.8.0 x 203 ops/sec ±0.45% (88 runs sampled) +Fastest is encode: local code,encode: @jridgewell/sourcemap-codec 1.4.15 + + +*** + + +babel.min.js.map - 347793 segments + +Decode Memory Usage: +local code 35424960 bytes +@jridgewell/sourcemap-codec 1.4.15 35424696 bytes +sourcemap-codec 36033464 bytes +source-map-0.6.1 62253704 bytes +source-map-0.8.0 43843920 bytes +chrome dev tools 45111400 bytes +Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 + +Decode speed: +decode: local code x 38.18 ops/sec ±5.44% (52 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 38.36 ops/sec ±5.02% (52 runs sampled) +decode: sourcemap-codec x 34.05 ops/sec ±4.45% (47 runs sampled) +decode: source-map-0.6.1 x 4.31 ops/sec ±2.76% (15 runs sampled) +decode: source-map-0.8.0 x 55.60 ops/sec ±0.13% (73 runs sampled) +chrome dev tools x 16.94 ops/sec ±3.78% (46 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +local code 2606016 bytes +@jridgewell/sourcemap-codec 1.4.15 2626440 bytes +sourcemap-codec 21152576 bytes +source-map-0.6.1 25023928 bytes +source-map-0.8.0 25256448 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 127 ops/sec ±0.18% (83 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 128 ops/sec ±0.26% (83 runs sampled) +encode: sourcemap-codec x 29.31 ops/sec ±2.55% (53 runs sampled) +encode: source-map-0.6.1 x 18.85 ops/sec ±3.19% (36 runs sampled) +encode: source-map-0.8.0 x 19.34 ops/sec ±1.97% (36 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 + + +*** + + +preact.js.map - 1992 segments + +Decode Memory Usage: +local code 261696 bytes +@jridgewell/sourcemap-codec 1.4.15 244296 bytes +sourcemap-codec 302816 bytes +source-map-0.6.1 939176 bytes +source-map-0.8.0 336 bytes +chrome dev tools 587368 bytes +Smallest memory usage is source-map-0.8.0 + +Decode speed: +decode: local code x 17,782 ops/sec ±0.32% (97 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 17,863 ops/sec ±0.40% (100 runs sampled) +decode: sourcemap-codec x 12,453 ops/sec ±0.27% (101 runs sampled) +decode: source-map-0.6.1 x 1,288 ops/sec ±1.05% (96 runs sampled) +decode: source-map-0.8.0 x 9,289 ops/sec ±0.27% (101 runs sampled) +chrome dev tools x 4,769 ops/sec ±0.18% (100 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 262944 bytes +@jridgewell/sourcemap-codec 1.4.15 25544 bytes +sourcemap-codec 323048 bytes +source-map-0.6.1 507808 bytes +source-map-0.8.0 507480 bytes +Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 + +Encode speed: +encode: local code x 24,207 ops/sec ±0.79% (95 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 24,288 ops/sec ±0.48% (96 runs sampled) +encode: sourcemap-codec x 6,761 ops/sec ±0.21% (100 runs sampled) +encode: source-map-0.6.1 x 5,374 ops/sec ±0.17% (99 runs sampled) +encode: source-map-0.8.0 x 5,633 ops/sec ±0.32% (99 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15,encode: local code + + +*** + + +react.js.map - 5726 segments + +Decode Memory Usage: +local code 678816 bytes +@jridgewell/sourcemap-codec 1.4.15 678816 bytes +sourcemap-codec 816400 bytes +source-map-0.6.1 2288864 bytes +source-map-0.8.0 721360 bytes +chrome dev tools 1012512 bytes +Smallest memory usage is local code + +Decode speed: +decode: local code x 6,178 ops/sec ±0.19% (98 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 6,261 ops/sec ±0.22% (100 runs sampled) +decode: sourcemap-codec x 4,472 ops/sec ±0.90% (99 runs sampled) +decode: source-map-0.6.1 x 449 ops/sec ±0.31% (95 runs sampled) +decode: source-map-0.8.0 x 3,219 ops/sec ±0.13% (100 runs sampled) +chrome dev tools x 1,743 ops/sec ±0.20% (99 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 140960 bytes +@jridgewell/sourcemap-codec 1.4.15 159808 bytes +sourcemap-codec 969304 bytes +source-map-0.6.1 930520 bytes +source-map-0.8.0 930248 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 8,013 ops/sec ±0.19% (100 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 7,989 ops/sec ±0.20% (101 runs sampled) +encode: sourcemap-codec x 2,472 ops/sec ±0.21% (99 runs sampled) +encode: source-map-0.6.1 x 2,200 ops/sec ±0.17% (99 runs sampled) +encode: source-map-0.8.0 x 2,220 ops/sec ±0.37% (99 runs sampled) +Fastest is encode: local code + + +*** + + +vscode.map - 2141001 segments + +Decode Memory Usage: +local code 198955264 bytes +@jridgewell/sourcemap-codec 1.4.15 199175352 bytes +sourcemap-codec 199102688 bytes +source-map-0.6.1 386323432 bytes +source-map-0.8.0 244116432 bytes +chrome dev tools 293734280 bytes +Smallest memory usage is local code + +Decode speed: +decode: local code x 3.90 ops/sec ±22.21% (15 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 3.95 ops/sec ±23.53% (15 runs sampled) +decode: sourcemap-codec x 3.82 ops/sec ±17.94% (14 runs sampled) +decode: source-map-0.6.1 x 0.61 ops/sec ±7.81% (6 runs sampled) +decode: source-map-0.8.0 x 9.54 ops/sec ±0.28% (28 runs sampled) +chrome dev tools x 2.18 ops/sec ±10.58% (10 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +local code 13509880 bytes +@jridgewell/sourcemap-codec 1.4.15 13537648 bytes +sourcemap-codec 32540104 bytes +source-map-0.6.1 127531040 bytes +source-map-0.8.0 127535312 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 20.10 ops/sec ±0.19% (38 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 20.26 ops/sec ±0.32% (38 runs sampled) +encode: sourcemap-codec x 5.44 ops/sec ±1.64% (18 runs sampled) +encode: source-map-0.6.1 x 2.30 ops/sec ±4.79% (10 runs sampled) +encode: source-map-0.8.0 x 2.46 ops/sec ±6.53% (10 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 +``` + +# License + +MIT diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs new file mode 100644 index 0000000..532bab3 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs @@ -0,0 +1,423 @@ +// src/vlq.ts +var comma = ",".charCodeAt(0); +var semicolon = ";".charCodeAt(0); +var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var intToChar = new Uint8Array(64); +var charToInt = new Uint8Array(128); +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function decodeInteger(reader, relative) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -2147483648 | -value; + } + return relative + value; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? -delta << 1 | 1 : delta << 1; + do { + let clamped = delta & 31; + delta >>>= 5; + if (delta > 0) clamped |= 32; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) return false; + return reader.peek() !== comma; +} + +// src/strings.ts +var bufLength = 1024 * 16; +var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } +} : { + decode(buf) { + let out = ""; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + } +}; +var StringWriter = class { + constructor() { + this.pos = 0; + this.out = ""; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +}; +var StringReader = class { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +}; + +// src/scopes.ts +var EMPTY = []; +function decodeOriginalScopes(input) { + const { length } = input; + const reader = new StringReader(input); + const scopes = []; + const stack = []; + let line = 0; + for (; reader.pos < length; reader.pos++) { + line = decodeInteger(reader, line); + const column = decodeInteger(reader, 0); + if (!hasMoreVlq(reader, length)) { + const last = stack.pop(); + last[2] = line; + last[3] = column; + continue; + } + const kind = decodeInteger(reader, 0); + const fields = decodeInteger(reader, 0); + const hasName = fields & 1; + const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; + let vars = EMPTY; + if (hasMoreVlq(reader, length)) { + vars = []; + do { + const varsIndex = decodeInteger(reader, 0); + vars.push(varsIndex); + } while (hasMoreVlq(reader, length)); + } + scope.vars = vars; + scopes.push(scope); + stack.push(scope); + } + return scopes; +} +function encodeOriginalScopes(scopes) { + const writer = new StringWriter(); + for (let i = 0; i < scopes.length; ) { + i = _encodeOriginalScopes(scopes, i, writer, [0]); + } + return writer.flush(); +} +function _encodeOriginalScopes(scopes, index, writer, state) { + const scope = scopes[index]; + const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; + if (index > 0) writer.write(comma); + state[0] = encodeInteger(writer, startLine, state[0]); + encodeInteger(writer, startColumn, 0); + encodeInteger(writer, kind, 0); + const fields = scope.length === 6 ? 1 : 0; + encodeInteger(writer, fields, 0); + if (scope.length === 6) encodeInteger(writer, scope[5], 0); + for (const v of vars) { + encodeInteger(writer, v, 0); + } + for (index++; index < scopes.length; ) { + const next = scopes[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeOriginalScopes(scopes, index, writer, state); + } + writer.write(comma); + state[0] = encodeInteger(writer, endLine, state[0]); + encodeInteger(writer, endColumn, 0); + return index; +} +function decodeGeneratedRanges(input) { + const { length } = input; + const reader = new StringReader(input); + const ranges = []; + const stack = []; + let genLine = 0; + let definitionSourcesIndex = 0; + let definitionScopeIndex = 0; + let callsiteSourcesIndex = 0; + let callsiteLine = 0; + let callsiteColumn = 0; + let bindingLine = 0; + let bindingColumn = 0; + do { + const semi = reader.indexOf(";"); + let genColumn = 0; + for (; reader.pos < semi; reader.pos++) { + genColumn = decodeInteger(reader, genColumn); + if (!hasMoreVlq(reader, semi)) { + const last = stack.pop(); + last[2] = genLine; + last[3] = genColumn; + continue; + } + const fields = decodeInteger(reader, 0); + const hasDefinition = fields & 1; + const hasCallsite = fields & 2; + const hasScope = fields & 4; + let callsite = null; + let bindings = EMPTY; + let range; + if (hasDefinition) { + const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); + definitionScopeIndex = decodeInteger( + reader, + definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 + ); + definitionSourcesIndex = defSourcesIndex; + range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; + } else { + range = [genLine, genColumn, 0, 0]; + } + range.isScope = !!hasScope; + if (hasCallsite) { + const prevCsi = callsiteSourcesIndex; + const prevLine = callsiteLine; + callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); + const sameSource = prevCsi === callsiteSourcesIndex; + callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); + callsiteColumn = decodeInteger( + reader, + sameSource && prevLine === callsiteLine ? callsiteColumn : 0 + ); + callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; + } + range.callsite = callsite; + if (hasMoreVlq(reader, semi)) { + bindings = []; + do { + bindingLine = genLine; + bindingColumn = genColumn; + const expressionsCount = decodeInteger(reader, 0); + let expressionRanges; + if (expressionsCount < -1) { + expressionRanges = [[decodeInteger(reader, 0)]]; + for (let i = -1; i > expressionsCount; i--) { + const prevBl = bindingLine; + bindingLine = decodeInteger(reader, bindingLine); + bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); + const expression = decodeInteger(reader, 0); + expressionRanges.push([expression, bindingLine, bindingColumn]); + } + } else { + expressionRanges = [[expressionsCount]]; + } + bindings.push(expressionRanges); + } while (hasMoreVlq(reader, semi)); + } + range.bindings = bindings; + ranges.push(range); + stack.push(range); + } + genLine++; + reader.pos = semi + 1; + } while (reader.pos < length); + return ranges; +} +function encodeGeneratedRanges(ranges) { + if (ranges.length === 0) return ""; + const writer = new StringWriter(); + for (let i = 0; i < ranges.length; ) { + i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); + } + return writer.flush(); +} +function _encodeGeneratedRanges(ranges, index, writer, state) { + const range = ranges[index]; + const { + 0: startLine, + 1: startColumn, + 2: endLine, + 3: endColumn, + isScope, + callsite, + bindings + } = range; + if (state[0] < startLine) { + catchupLine(writer, state[0], startLine); + state[0] = startLine; + state[1] = 0; + } else if (index > 0) { + writer.write(comma); + } + state[1] = encodeInteger(writer, range[1], state[1]); + const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); + encodeInteger(writer, fields, 0); + if (range.length === 6) { + const { 4: sourcesIndex, 5: scopesIndex } = range; + if (sourcesIndex !== state[2]) { + state[3] = 0; + } + state[2] = encodeInteger(writer, sourcesIndex, state[2]); + state[3] = encodeInteger(writer, scopesIndex, state[3]); + } + if (callsite) { + const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; + if (sourcesIndex !== state[4]) { + state[5] = 0; + state[6] = 0; + } else if (callLine !== state[5]) { + state[6] = 0; + } + state[4] = encodeInteger(writer, sourcesIndex, state[4]); + state[5] = encodeInteger(writer, callLine, state[5]); + state[6] = encodeInteger(writer, callColumn, state[6]); + } + if (bindings) { + for (const binding of bindings) { + if (binding.length > 1) encodeInteger(writer, -binding.length, 0); + const expression = binding[0][0]; + encodeInteger(writer, expression, 0); + let bindingStartLine = startLine; + let bindingStartColumn = startColumn; + for (let i = 1; i < binding.length; i++) { + const expRange = binding[i]; + bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); + bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); + encodeInteger(writer, expRange[0], 0); + } + } + } + for (index++; index < ranges.length; ) { + const next = ranges[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeGeneratedRanges(ranges, index, writer, state); + } + if (state[0] < endLine) { + catchupLine(writer, state[0], endLine); + state[0] = endLine; + state[1] = 0; + } else { + writer.write(comma); + } + state[1] = encodeInteger(writer, endColumn, state[1]); + return index; +} +function catchupLine(writer, lastLine, line) { + do { + writer.write(semicolon); + } while (++lastLine < line); +} + +// src/sourcemap-codec.ts +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(";"); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } else { + seg = [genColumn]; + } + line.push(seg); + reader.pos++; + } + if (!sorted) sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) writer.write(semicolon); + if (line.length === 0) continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} +export { + decode, + decodeGeneratedRanges, + decodeOriginalScopes, + encode, + encodeGeneratedRanges, + encodeOriginalScopes +}; +//# sourceMappingURL=sourcemap-codec.mjs.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map new file mode 100644 index 0000000..c276844 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts", "../src/sourcemap-codec.ts"], + "mappings": ";AAEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eA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AC,IAAI,EAAE,CAAC;AACnB;AAIO,SAAS,OAAO,SAA8C;AACnE,QAAM,SAAS,IAAI,aAAa;AAChC,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,QAAI,IAAI,EAAG,QAAO,MAAM,SAAS;AACjC,QAAI,KAAK,WAAW,EAAG;AAEvB,QAAI,YAAY;AAEhB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,UAAU,KAAK,CAAC;AACtB,UAAI,IAAI,EAAG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", + "names": [] +} diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js new file mode 100644 index 0000000..2d8e459 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js @@ -0,0 +1,464 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.sourcemapCodec = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module) { +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/sourcemap-codec.ts +var sourcemap_codec_exports = {}; +__export(sourcemap_codec_exports, { + decode: () => decode, + decodeGeneratedRanges: () => decodeGeneratedRanges, + decodeOriginalScopes: () => decodeOriginalScopes, + encode: () => encode, + encodeGeneratedRanges: () => encodeGeneratedRanges, + encodeOriginalScopes: () => encodeOriginalScopes +}); +module.exports = __toCommonJS(sourcemap_codec_exports); + +// src/vlq.ts +var comma = ",".charCodeAt(0); +var semicolon = ";".charCodeAt(0); +var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +var intToChar = new Uint8Array(64); +var charToInt = new Uint8Array(128); +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +function decodeInteger(reader, relative) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -2147483648 | -value; + } + return relative + value; +} +function encodeInteger(builder, num, relative) { + let delta = num - relative; + delta = delta < 0 ? -delta << 1 | 1 : delta << 1; + do { + let clamped = delta & 31; + delta >>>= 5; + if (delta > 0) clamped |= 32; + builder.write(intToChar[clamped]); + } while (delta > 0); + return num; +} +function hasMoreVlq(reader, max) { + if (reader.pos >= max) return false; + return reader.peek() !== comma; +} + +// src/strings.ts +var bufLength = 1024 * 16; +var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + } +} : { + decode(buf) { + let out = ""; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + } +}; +var StringWriter = class { + constructor() { + this.pos = 0; + this.out = ""; + this.buffer = new Uint8Array(bufLength); + } + write(v) { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + flush() { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +}; +var StringReader = class { + constructor(buffer) { + this.pos = 0; + this.buffer = buffer; + } + next() { + return this.buffer.charCodeAt(this.pos++); + } + peek() { + return this.buffer.charCodeAt(this.pos); + } + indexOf(char) { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +}; + +// src/scopes.ts +var EMPTY = []; +function decodeOriginalScopes(input) { + const { length } = input; + const reader = new StringReader(input); + const scopes = []; + const stack = []; + let line = 0; + for (; reader.pos < length; reader.pos++) { + line = decodeInteger(reader, line); + const column = decodeInteger(reader, 0); + if (!hasMoreVlq(reader, length)) { + const last = stack.pop(); + last[2] = line; + last[3] = column; + continue; + } + const kind = decodeInteger(reader, 0); + const fields = decodeInteger(reader, 0); + const hasName = fields & 1; + const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; + let vars = EMPTY; + if (hasMoreVlq(reader, length)) { + vars = []; + do { + const varsIndex = decodeInteger(reader, 0); + vars.push(varsIndex); + } while (hasMoreVlq(reader, length)); + } + scope.vars = vars; + scopes.push(scope); + stack.push(scope); + } + return scopes; +} +function encodeOriginalScopes(scopes) { + const writer = new StringWriter(); + for (let i = 0; i < scopes.length; ) { + i = _encodeOriginalScopes(scopes, i, writer, [0]); + } + return writer.flush(); +} +function _encodeOriginalScopes(scopes, index, writer, state) { + const scope = scopes[index]; + const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; + if (index > 0) writer.write(comma); + state[0] = encodeInteger(writer, startLine, state[0]); + encodeInteger(writer, startColumn, 0); + encodeInteger(writer, kind, 0); + const fields = scope.length === 6 ? 1 : 0; + encodeInteger(writer, fields, 0); + if (scope.length === 6) encodeInteger(writer, scope[5], 0); + for (const v of vars) { + encodeInteger(writer, v, 0); + } + for (index++; index < scopes.length; ) { + const next = scopes[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeOriginalScopes(scopes, index, writer, state); + } + writer.write(comma); + state[0] = encodeInteger(writer, endLine, state[0]); + encodeInteger(writer, endColumn, 0); + return index; +} +function decodeGeneratedRanges(input) { + const { length } = input; + const reader = new StringReader(input); + const ranges = []; + const stack = []; + let genLine = 0; + let definitionSourcesIndex = 0; + let definitionScopeIndex = 0; + let callsiteSourcesIndex = 0; + let callsiteLine = 0; + let callsiteColumn = 0; + let bindingLine = 0; + let bindingColumn = 0; + do { + const semi = reader.indexOf(";"); + let genColumn = 0; + for (; reader.pos < semi; reader.pos++) { + genColumn = decodeInteger(reader, genColumn); + if (!hasMoreVlq(reader, semi)) { + const last = stack.pop(); + last[2] = genLine; + last[3] = genColumn; + continue; + } + const fields = decodeInteger(reader, 0); + const hasDefinition = fields & 1; + const hasCallsite = fields & 2; + const hasScope = fields & 4; + let callsite = null; + let bindings = EMPTY; + let range; + if (hasDefinition) { + const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); + definitionScopeIndex = decodeInteger( + reader, + definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 + ); + definitionSourcesIndex = defSourcesIndex; + range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; + } else { + range = [genLine, genColumn, 0, 0]; + } + range.isScope = !!hasScope; + if (hasCallsite) { + const prevCsi = callsiteSourcesIndex; + const prevLine = callsiteLine; + callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); + const sameSource = prevCsi === callsiteSourcesIndex; + callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); + callsiteColumn = decodeInteger( + reader, + sameSource && prevLine === callsiteLine ? callsiteColumn : 0 + ); + callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; + } + range.callsite = callsite; + if (hasMoreVlq(reader, semi)) { + bindings = []; + do { + bindingLine = genLine; + bindingColumn = genColumn; + const expressionsCount = decodeInteger(reader, 0); + let expressionRanges; + if (expressionsCount < -1) { + expressionRanges = [[decodeInteger(reader, 0)]]; + for (let i = -1; i > expressionsCount; i--) { + const prevBl = bindingLine; + bindingLine = decodeInteger(reader, bindingLine); + bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); + const expression = decodeInteger(reader, 0); + expressionRanges.push([expression, bindingLine, bindingColumn]); + } + } else { + expressionRanges = [[expressionsCount]]; + } + bindings.push(expressionRanges); + } while (hasMoreVlq(reader, semi)); + } + range.bindings = bindings; + ranges.push(range); + stack.push(range); + } + genLine++; + reader.pos = semi + 1; + } while (reader.pos < length); + return ranges; +} +function encodeGeneratedRanges(ranges) { + if (ranges.length === 0) return ""; + const writer = new StringWriter(); + for (let i = 0; i < ranges.length; ) { + i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); + } + return writer.flush(); +} +function _encodeGeneratedRanges(ranges, index, writer, state) { + const range = ranges[index]; + const { + 0: startLine, + 1: startColumn, + 2: endLine, + 3: endColumn, + isScope, + callsite, + bindings + } = range; + if (state[0] < startLine) { + catchupLine(writer, state[0], startLine); + state[0] = startLine; + state[1] = 0; + } else if (index > 0) { + writer.write(comma); + } + state[1] = encodeInteger(writer, range[1], state[1]); + const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); + encodeInteger(writer, fields, 0); + if (range.length === 6) { + const { 4: sourcesIndex, 5: scopesIndex } = range; + if (sourcesIndex !== state[2]) { + state[3] = 0; + } + state[2] = encodeInteger(writer, sourcesIndex, state[2]); + state[3] = encodeInteger(writer, scopesIndex, state[3]); + } + if (callsite) { + const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; + if (sourcesIndex !== state[4]) { + state[5] = 0; + state[6] = 0; + } else if (callLine !== state[5]) { + state[6] = 0; + } + state[4] = encodeInteger(writer, sourcesIndex, state[4]); + state[5] = encodeInteger(writer, callLine, state[5]); + state[6] = encodeInteger(writer, callColumn, state[6]); + } + if (bindings) { + for (const binding of bindings) { + if (binding.length > 1) encodeInteger(writer, -binding.length, 0); + const expression = binding[0][0]; + encodeInteger(writer, expression, 0); + let bindingStartLine = startLine; + let bindingStartColumn = startColumn; + for (let i = 1; i < binding.length; i++) { + const expRange = binding[i]; + bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); + bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); + encodeInteger(writer, expRange[0], 0); + } + } + } + for (index++; index < ranges.length; ) { + const next = ranges[index]; + const { 0: l, 1: c } = next; + if (l > endLine || l === endLine && c >= endColumn) { + break; + } + index = _encodeGeneratedRanges(ranges, index, writer, state); + } + if (state[0] < endLine) { + catchupLine(writer, state[0], endLine); + state[0] = endLine; + state[1] = 0; + } else { + writer.write(comma); + } + state[1] = encodeInteger(writer, endColumn, state[1]); + return index; +} +function catchupLine(writer, lastLine, line) { + do { + writer.write(semicolon); + } while (++lastLine < line); +} + +// src/sourcemap-codec.ts +function decode(mappings) { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + do { + const semi = reader.indexOf(";"); + const line = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + while (reader.pos < semi) { + let seg; + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) sorted = false; + lastCol = genColumn; + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } else { + seg = [genColumn]; + } + line.push(seg); + reader.pos++; + } + if (!sorted) sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + return decoded; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) writer.write(semicolon); + if (line.length === 0) continue; + let genColumn = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + genColumn = encodeInteger(writer, segment[0], genColumn); + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + return writer.flush(); +} +})); +//# sourceMappingURL=sourcemap-codec.umd.js.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map new file mode 100644 index 0000000..abc18d2 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/sourcemap-codec.ts", "../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eAAe,QAAQ;AAC7B,aAAW;AAEX,MAAI,cAAc;AAChB,YAAQ,cAAc,CAAC;AAAA,EACzB;AAEA,SAAO,WAAW;AACpB;AAEO,SAAS,cAAc,SAAuB,KAAa,UAA0B;AAC1F,MAAI,QAAQ,MAAM;AAElB,UAAQ,QAAQ,IAAK,CAAC,SAAS,IAAK,IAAI,SAAS;AACjD,KAAG;AACD,QAAI,UAAU,QAAQ;AACtB,eAAW;AACX,QAAI,QAAQ,EAAG,YAAW;AAC1B,YAAQ,MAAM,UAAU,OAAO,CAAC;AAAA,EAClC,SAAS,QAAQ;AAEjB,SAAO;AACT;AAEO,SAAS,WAAW,QAAsB,KAAa;AAC5D,MAAI,O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AG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", + "names": [] +} diff --git a/node_modules/@jridgewell/sourcemap-codec/package.json b/node_modules/@jridgewell/sourcemap-codec/package.json new file mode 100644 index 0000000..da55137 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/package.json @@ -0,0 +1,63 @@ +{ + "name": "@jridgewell/sourcemap-codec", + "version": "1.5.5", + "description": "Encode/decode sourcemap mappings", + "keywords": [ + "sourcemap", + "vlq" + ], + "main": "dist/sourcemap-codec.umd.js", + "module": "dist/sourcemap-codec.mjs", + "types": "types/sourcemap-codec.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/sourcemap-codec.d.mts", + "default": "./dist/sourcemap-codec.mjs" + }, + "default": { + "types": "./types/sourcemap-codec.d.cts", + "default": "./dist/sourcemap-codec.umd.js" + } + }, + "./dist/sourcemap-codec.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs sourcemap-codec.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/sourcemap-codec", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/sourcemap-codec" + }, + "author": "Justin Ridgewell ", + "license": "MIT" +} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts b/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts new file mode 100644 index 0000000..d194c2f --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts @@ -0,0 +1,345 @@ +import { StringReader, StringWriter } from './strings'; +import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; + +const EMPTY: any[] = []; + +type Line = number; +type Column = number; +type Kind = number; +type Name = number; +type Var = number; +type SourcesIndex = number; +type ScopesIndex = number; + +type Mix = (A & O) | (B & O); + +export type OriginalScope = Mix< + [Line, Column, Line, Column, Kind], + [Line, Column, Line, Column, Kind, Name], + { vars: Var[] } +>; + +export type GeneratedRange = Mix< + [Line, Column, Line, Column], + [Line, Column, Line, Column, SourcesIndex, ScopesIndex], + { + callsite: CallSite | null; + bindings: Binding[]; + isScope: boolean; + } +>; +export type CallSite = [SourcesIndex, Line, Column]; +type Binding = BindingExpressionRange[]; +export type BindingExpressionRange = [Name] | [Name, Line, Column]; + +export function decodeOriginalScopes(input: string): OriginalScope[] { + const { length } = input; + const reader = new StringReader(input); + const scopes: OriginalScope[] = []; + const stack: OriginalScope[] = []; + let line = 0; + + for (; reader.pos < length; reader.pos++) { + line = decodeInteger(reader, line); + const column = decodeInteger(reader, 0); + + if (!hasMoreVlq(reader, length)) { + const last = stack.pop()!; + last[2] = line; + last[3] = column; + continue; + } + + const kind = decodeInteger(reader, 0); + const fields = decodeInteger(reader, 0); + const hasName = fields & 0b0001; + + const scope: OriginalScope = ( + hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind] + ) as OriginalScope; + + let vars: Var[] = EMPTY; + if (hasMoreVlq(reader, length)) { + vars = []; + do { + const varsIndex = decodeInteger(reader, 0); + vars.push(varsIndex); + } while (hasMoreVlq(reader, length)); + } + scope.vars = vars; + + scopes.push(scope); + stack.push(scope); + } + + return scopes; +} + +export function encodeOriginalScopes(scopes: OriginalScope[]): string { + const writer = new StringWriter(); + + for (let i = 0; i < scopes.length; ) { + i = _encodeOriginalScopes(scopes, i, writer, [0]); + } + + return writer.flush(); +} + +function _encodeOriginalScopes( + scopes: OriginalScope[], + index: number, + writer: StringWriter, + state: [ + number, // GenColumn + ], +): number { + const scope = scopes[index]; + const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; + + if (index > 0) writer.write(comma); + + state[0] = encodeInteger(writer, startLine, state[0]); + encodeInteger(writer, startColumn, 0); + encodeInteger(writer, kind, 0); + + const fields = scope.length === 6 ? 0b0001 : 0; + encodeInteger(writer, fields, 0); + if (scope.length === 6) encodeInteger(writer, scope[5], 0); + + for (const v of vars) { + encodeInteger(writer, v, 0); + } + + for (index++; index < scopes.length; ) { + const next = scopes[index]; + const { 0: l, 1: c } = next; + if (l > endLine || (l === endLine && c >= endColumn)) { + break; + } + index = _encodeOriginalScopes(scopes, index, writer, state); + } + + writer.write(comma); + state[0] = encodeInteger(writer, endLine, state[0]); + encodeInteger(writer, endColumn, 0); + + return index; +} + +export function decodeGeneratedRanges(input: string): GeneratedRange[] { + const { length } = input; + const reader = new StringReader(input); + const ranges: GeneratedRange[] = []; + const stack: GeneratedRange[] = []; + + let genLine = 0; + let definitionSourcesIndex = 0; + let definitionScopeIndex = 0; + let callsiteSourcesIndex = 0; + let callsiteLine = 0; + let callsiteColumn = 0; + let bindingLine = 0; + let bindingColumn = 0; + + do { + const semi = reader.indexOf(';'); + let genColumn = 0; + + for (; reader.pos < semi; reader.pos++) { + genColumn = decodeInteger(reader, genColumn); + + if (!hasMoreVlq(reader, semi)) { + const last = stack.pop()!; + last[2] = genLine; + last[3] = genColumn; + continue; + } + + const fields = decodeInteger(reader, 0); + const hasDefinition = fields & 0b0001; + const hasCallsite = fields & 0b0010; + const hasScope = fields & 0b0100; + + let callsite: CallSite | null = null; + let bindings: Binding[] = EMPTY; + let range: GeneratedRange; + if (hasDefinition) { + const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); + definitionScopeIndex = decodeInteger( + reader, + definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0, + ); + + definitionSourcesIndex = defSourcesIndex; + range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex] as GeneratedRange; + } else { + range = [genLine, genColumn, 0, 0] as GeneratedRange; + } + + range.isScope = !!hasScope; + + if (hasCallsite) { + const prevCsi = callsiteSourcesIndex; + const prevLine = callsiteLine; + callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); + const sameSource = prevCsi === callsiteSourcesIndex; + callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); + callsiteColumn = decodeInteger( + reader, + sameSource && prevLine === callsiteLine ? callsiteColumn : 0, + ); + + callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; + } + range.callsite = callsite; + + if (hasMoreVlq(reader, semi)) { + bindings = []; + do { + bindingLine = genLine; + bindingColumn = genColumn; + const expressionsCount = decodeInteger(reader, 0); + let expressionRanges: BindingExpressionRange[]; + if (expressionsCount < -1) { + expressionRanges = [[decodeInteger(reader, 0)]]; + for (let i = -1; i > expressionsCount; i--) { + const prevBl = bindingLine; + bindingLine = decodeInteger(reader, bindingLine); + bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); + const expression = decodeInteger(reader, 0); + expressionRanges.push([expression, bindingLine, bindingColumn]); + } + } else { + expressionRanges = [[expressionsCount]]; + } + bindings.push(expressionRanges); + } while (hasMoreVlq(reader, semi)); + } + range.bindings = bindings; + + ranges.push(range); + stack.push(range); + } + + genLine++; + reader.pos = semi + 1; + } while (reader.pos < length); + + return ranges; +} + +export function encodeGeneratedRanges(ranges: GeneratedRange[]): string { + if (ranges.length === 0) return ''; + + const writer = new StringWriter(); + + for (let i = 0; i < ranges.length; ) { + i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); + } + + return writer.flush(); +} + +function _encodeGeneratedRanges( + ranges: GeneratedRange[], + index: number, + writer: StringWriter, + state: [ + number, // GenLine + number, // GenColumn + number, // DefSourcesIndex + number, // DefScopesIndex + number, // CallSourcesIndex + number, // CallLine + number, // CallColumn + ], +): number { + const range = ranges[index]; + const { + 0: startLine, + 1: startColumn, + 2: endLine, + 3: endColumn, + isScope, + callsite, + bindings, + } = range; + + if (state[0] < startLine) { + catchupLine(writer, state[0], startLine); + state[0] = startLine; + state[1] = 0; + } else if (index > 0) { + writer.write(comma); + } + + state[1] = encodeInteger(writer, range[1], state[1]); + + const fields = + (range.length === 6 ? 0b0001 : 0) | (callsite ? 0b0010 : 0) | (isScope ? 0b0100 : 0); + encodeInteger(writer, fields, 0); + + if (range.length === 6) { + const { 4: sourcesIndex, 5: scopesIndex } = range; + if (sourcesIndex !== state[2]) { + state[3] = 0; + } + state[2] = encodeInteger(writer, sourcesIndex, state[2]); + state[3] = encodeInteger(writer, scopesIndex, state[3]); + } + + if (callsite) { + const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite!; + if (sourcesIndex !== state[4]) { + state[5] = 0; + state[6] = 0; + } else if (callLine !== state[5]) { + state[6] = 0; + } + state[4] = encodeInteger(writer, sourcesIndex, state[4]); + state[5] = encodeInteger(writer, callLine, state[5]); + state[6] = encodeInteger(writer, callColumn, state[6]); + } + + if (bindings) { + for (const binding of bindings) { + if (binding.length > 1) encodeInteger(writer, -binding.length, 0); + const expression = binding[0][0]; + encodeInteger(writer, expression, 0); + let bindingStartLine = startLine; + let bindingStartColumn = startColumn; + for (let i = 1; i < binding.length; i++) { + const expRange = binding[i]; + bindingStartLine = encodeInteger(writer, expRange[1]!, bindingStartLine); + bindingStartColumn = encodeInteger(writer, expRange[2]!, bindingStartColumn); + encodeInteger(writer, expRange[0]!, 0); + } + } + } + + for (index++; index < ranges.length; ) { + const next = ranges[index]; + const { 0: l, 1: c } = next; + if (l > endLine || (l === endLine && c >= endColumn)) { + break; + } + index = _encodeGeneratedRanges(ranges, index, writer, state); + } + + if (state[0] < endLine) { + catchupLine(writer, state[0], endLine); + state[0] = endLine; + state[1] = 0; + } else { + writer.write(comma); + } + state[1] = encodeInteger(writer, endColumn, state[1]); + + return index; +} + +function catchupLine(writer: StringWriter, lastLine: number, line: number) { + do { + writer.write(semicolon); + } while (++lastLine < line); +} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts b/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts new file mode 100644 index 0000000..a81f894 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts @@ -0,0 +1,111 @@ +import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; +import { StringWriter, StringReader } from './strings'; + +export { + decodeOriginalScopes, + encodeOriginalScopes, + decodeGeneratedRanges, + encodeGeneratedRanges, +} from './scopes'; +export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes'; + +export type SourceMapSegment = + | [number] + | [number, number, number, number] + | [number, number, number, number, number]; +export type SourceMapLine = SourceMapSegment[]; +export type SourceMapMappings = SourceMapLine[]; + +export function decode(mappings: string): SourceMapMappings { + const { length } = mappings; + const reader = new StringReader(mappings); + const decoded: SourceMapMappings = []; + let genColumn = 0; + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + + do { + const semi = reader.indexOf(';'); + const line: SourceMapLine = []; + let sorted = true; + let lastCol = 0; + genColumn = 0; + + while (reader.pos < semi) { + let seg: SourceMapSegment; + + genColumn = decodeInteger(reader, genColumn); + if (genColumn < lastCol) sorted = false; + lastCol = genColumn; + + if (hasMoreVlq(reader, semi)) { + sourcesIndex = decodeInteger(reader, sourcesIndex); + sourceLine = decodeInteger(reader, sourceLine); + sourceColumn = decodeInteger(reader, sourceColumn); + + if (hasMoreVlq(reader, semi)) { + namesIndex = decodeInteger(reader, namesIndex); + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; + } else { + seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; + } + } else { + seg = [genColumn]; + } + + line.push(seg); + reader.pos++; + } + + if (!sorted) sort(line); + decoded.push(line); + reader.pos = semi + 1; + } while (reader.pos <= length); + + return decoded; +} + +function sort(line: SourceMapSegment[]) { + line.sort(sortComparator); +} + +function sortComparator(a: SourceMapSegment, b: SourceMapSegment): number { + return a[0] - b[0]; +} + +export function encode(decoded: SourceMapMappings): string; +export function encode(decoded: Readonly): string; +export function encode(decoded: Readonly): string { + const writer = new StringWriter(); + let sourcesIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let namesIndex = 0; + + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) writer.write(semicolon); + if (line.length === 0) continue; + + let genColumn = 0; + + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + if (j > 0) writer.write(comma); + + genColumn = encodeInteger(writer, segment[0], genColumn); + + if (segment.length === 1) continue; + sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); + sourceLine = encodeInteger(writer, segment[2], sourceLine); + sourceColumn = encodeInteger(writer, segment[3], sourceColumn); + + if (segment.length === 4) continue; + namesIndex = encodeInteger(writer, segment[4], namesIndex); + } + } + + return writer.flush(); +} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/strings.ts b/node_modules/@jridgewell/sourcemap-codec/src/strings.ts new file mode 100644 index 0000000..d161965 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/src/strings.ts @@ -0,0 +1,65 @@ +const bufLength = 1024 * 16; + +// Provide a fallback for older environments. +const td = + typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf: Uint8Array): string { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf: Uint8Array): string { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; + +export class StringWriter { + pos = 0; + private out = ''; + private buffer = new Uint8Array(bufLength); + + write(v: number): void { + const { buffer } = this; + buffer[this.pos++] = v; + if (this.pos === bufLength) { + this.out += td.decode(buffer); + this.pos = 0; + } + } + + flush(): string { + const { buffer, out, pos } = this; + return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; + } +} + +export class StringReader { + pos = 0; + declare private buffer: string; + + constructor(buffer: string) { + this.buffer = buffer; + } + + next(): number { + return this.buffer.charCodeAt(this.pos++); + } + + peek(): number { + return this.buffer.charCodeAt(this.pos); + } + + indexOf(char: string): number { + const { buffer, pos } = this; + const idx = buffer.indexOf(char, pos); + return idx === -1 ? buffer.length : idx; + } +} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts b/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts new file mode 100644 index 0000000..a42c681 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts @@ -0,0 +1,55 @@ +import type { StringReader, StringWriter } from './strings'; + +export const comma = ','.charCodeAt(0); +export const semicolon = ';'.charCodeAt(0); + +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII + +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} + +export function decodeInteger(reader: StringReader, relative: number): number { + let value = 0; + let shift = 0; + let integer = 0; + + do { + const c = reader.next(); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + + const shouldNegate = value & 1; + value >>>= 1; + + if (shouldNegate) { + value = -0x80000000 | -value; + } + + return relative + value; +} + +export function encodeInteger(builder: StringWriter, num: number, relative: number): number { + let delta = num - relative; + + delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; + do { + let clamped = delta & 0b011111; + delta >>>= 5; + if (delta > 0) clamped |= 0b100000; + builder.write(intToChar[clamped]); + } while (delta > 0); + + return num; +} + +export function hasMoreVlq(reader: StringReader, max: number) { + if (reader.pos >= max) return false; + return reader.peek() !== comma; +} diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts new file mode 100644 index 0000000..c583c75 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts @@ -0,0 +1,50 @@ +type Line = number; +type Column = number; +type Kind = number; +type Name = number; +type Var = number; +type SourcesIndex = number; +type ScopesIndex = number; +type Mix = (A & O) | (B & O); +export type OriginalScope = Mix<[ + Line, + Column, + Line, + Column, + Kind +], [ + Line, + Column, + Line, + Column, + Kind, + Name +], { + vars: Var[]; +}>; +export type GeneratedRange = Mix<[ + Line, + Column, + Line, + Column +], [ + Line, + Column, + Line, + Column, + SourcesIndex, + ScopesIndex +], { + callsite: CallSite | null; + bindings: Binding[]; + isScope: boolean; +}>; +export type CallSite = [SourcesIndex, Line, Column]; +type Binding = BindingExpressionRange[]; +export type BindingExpressionRange = [Name] | [Name, Line, Column]; +export declare function decodeOriginalScopes(input: string): OriginalScope[]; +export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; +export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; +export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; +export {}; +//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map new file mode 100644 index 0000000..630e647 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts new file mode 100644 index 0000000..c583c75 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts @@ -0,0 +1,50 @@ +type Line = number; +type Column = number; +type Kind = number; +type Name = number; +type Var = number; +type SourcesIndex = number; +type ScopesIndex = number; +type Mix = (A & O) | (B & O); +export type OriginalScope = Mix<[ + Line, + Column, + Line, + Column, + Kind +], [ + Line, + Column, + Line, + Column, + Kind, + Name +], { + vars: Var[]; +}>; +export type GeneratedRange = Mix<[ + Line, + Column, + Line, + Column +], [ + Line, + Column, + Line, + Column, + SourcesIndex, + ScopesIndex +], { + callsite: CallSite | null; + bindings: Binding[]; + isScope: boolean; +}>; +export type CallSite = [SourcesIndex, Line, Column]; +type Binding = BindingExpressionRange[]; +export type BindingExpressionRange = [Name] | [Name, Line, Column]; +export declare function decodeOriginalScopes(input: string): OriginalScope[]; +export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; +export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; +export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; +export {}; +//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map new file mode 100644 index 0000000..630e647 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts new file mode 100644 index 0000000..5f35e22 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts @@ -0,0 +1,9 @@ +export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.cts'; +export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.cts'; +export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; +export type SourceMapLine = SourceMapSegment[]; +export type SourceMapMappings = SourceMapLine[]; +export declare function decode(mappings: string): SourceMapMappings; +export declare function encode(decoded: SourceMapMappings): string; +export declare function encode(decoded: Readonly): string; +//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map new file mode 100644 index 0000000..7123d52 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts new file mode 100644 index 0000000..199fb9f --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts @@ -0,0 +1,9 @@ +export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.mts'; +export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.mts'; +export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; +export type SourceMapLine = SourceMapSegment[]; +export type SourceMapMappings = SourceMapLine[]; +export declare function decode(mappings: string): SourceMapMappings; +export declare function encode(decoded: SourceMapMappings): string; +export declare function encode(decoded: Readonly): string; +//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map new file mode 100644 index 0000000..7123d52 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts new file mode 100644 index 0000000..62faceb --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts @@ -0,0 +1,16 @@ +export declare class StringWriter { + pos: number; + private out; + private buffer; + write(v: number): void; + flush(): string; +} +export declare class StringReader { + pos: number; + private buffer; + constructor(buffer: string); + next(): number; + peek(): number; + indexOf(char: string): number; +} +//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map new file mode 100644 index 0000000..d3602da --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts new file mode 100644 index 0000000..62faceb --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts @@ -0,0 +1,16 @@ +export declare class StringWriter { + pos: number; + private out; + private buffer; + write(v: number): void; + flush(): string; +} +export declare class StringReader { + pos: number; + private buffer; + constructor(buffer: string); + next(): number; + peek(): number; + indexOf(char: string): number; +} +//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map new file mode 100644 index 0000000..d3602da --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts new file mode 100644 index 0000000..dbd6602 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts @@ -0,0 +1,7 @@ +import type { StringReader, StringWriter } from './strings.cts'; +export declare const comma: number; +export declare const semicolon: number; +export declare function decodeInteger(reader: StringReader, relative: number): number; +export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; +export declare function hasMoreVlq(reader: StringReader, max: number): boolean; +//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map new file mode 100644 index 0000000..6fdc356 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts new file mode 100644 index 0000000..2c739bc --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts @@ -0,0 +1,7 @@ +import type { StringReader, StringWriter } from './strings.mts'; +export declare const comma: number; +export declare const semicolon: number; +export declare function decodeInteger(reader: StringReader, relative: number): number; +export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; +export declare function hasMoreVlq(reader: StringReader, max: number): boolean; +//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map new file mode 100644 index 0000000..6fdc356 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/LICENSE b/node_modules/@jridgewell/trace-mapping/LICENSE new file mode 100644 index 0000000..1f6ce94 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2024 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@jridgewell/trace-mapping/README.md b/node_modules/@jridgewell/trace-mapping/README.md new file mode 100644 index 0000000..9fc0ed0 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/README.md @@ -0,0 +1,348 @@ +# @jridgewell/trace-mapping + +> Trace the original position through a source map + +`trace-mapping` allows you to take the line and column of an output file and trace it to the +original location in the source file through a source map. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This +provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. + +## Installation + +```sh +npm install @jridgewell/trace-mapping +``` + +## Usage + +```typescript +import { + TraceMap, + originalPositionFor, + generatedPositionFor, + sourceContentFor, + isIgnored, +} from '@jridgewell/trace-mapping'; + +const tracer = new TraceMap({ + version: 3, + sources: ['input.js'], + sourcesContent: ['content of input.js'], + names: ['foo'], + mappings: 'KAyCIA', + ignoreList: [], +}); + +// Lines start at line 1, columns at column 0. +const traced = originalPositionFor(tracer, { line: 1, column: 5 }); +assert.deepEqual(traced, { + source: 'input.js', + line: 42, + column: 4, + name: 'foo', +}); + +const content = sourceContentFor(tracer, traced.source); +assert.strictEqual(content, 'content for input.js'); + +const generated = generatedPositionFor(tracer, { + source: 'input.js', + line: 42, + column: 4, +}); +assert.deepEqual(generated, { + line: 1, + column: 5, +}); + +const ignored = isIgnored(tracer, 'input.js'); +assert.equal(ignored, false); +``` + +We also provide a lower level API to get the actual segment that matches our line and column. Unlike +`originalPositionFor`, `traceSegment` uses a 0-base for `line`: + +```typescript +import { traceSegment } from '@jridgewell/trace-mapping'; + +// line is 0-base. +const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); + +// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] +// Again, line is 0-base and so is sourceLine +assert.deepEqual(traced, [5, 0, 41, 4, 0]); +``` + +### SectionedSourceMaps + +The sourcemap spec defines a special `sections` field that's designed to handle concatenation of +output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool +produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` +helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a +`TraceMap` instance: + +```typescript +import { AnyMap } from '@jridgewell/trace-mapping'; +const fooOutput = 'foo'; +const barOutput = 'bar'; +const output = [fooOutput, barOutput].join('\n'); + +const sectioned = new AnyMap({ + version: 3, + sections: [ + { + // 0-base line and column + offset: { line: 0, column: 0 }, + // fooOutput's sourcemap + map: { + version: 3, + sources: ['foo.js'], + names: ['foo'], + mappings: 'AAAAA', + }, + }, + { + // barOutput's sourcemap will not affect the first line, only the second + offset: { line: 1, column: 0 }, + map: { + version: 3, + sources: ['bar.js'], + names: ['bar'], + mappings: 'AAAAA', + }, + }, + ], +}); + +const traced = originalPositionFor(sectioned, { + line: 2, + column: 0, +}); + +assert.deepEqual(traced, { + source: 'bar.js', + line: 1, + column: 0, + name: 'bar', +}); +``` + +## Benchmarks + +``` +node v20.10.0 + +amp.js.map - 45120 segments + +Memory Usage: +trace-mapping decoded 414164 bytes +trace-mapping encoded 6274352 bytes +source-map-js 10968904 bytes +source-map-0.6.1 17587160 bytes +source-map-0.8.0 8812155 bytes +Chrome dev tools 8672912 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 205 ops/sec ±0.19% (88 runs sampled) +trace-mapping: encoded JSON input x 405 ops/sec ±1.47% (88 runs sampled) +trace-mapping: decoded Object input x 4,645 ops/sec ±0.15% (98 runs sampled) +trace-mapping: encoded Object input x 458 ops/sec ±1.63% (91 runs sampled) +source-map-js: encoded Object input x 75.48 ops/sec ±1.64% (67 runs sampled) +source-map-0.6.1: encoded Object input x 39.37 ops/sec ±1.44% (53 runs sampled) +Chrome dev tools: encoded Object input x 150 ops/sec ±1.76% (79 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 44,946 ops/sec ±0.16% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 37,995 ops/sec ±1.81% (89 runs sampled) +source-map-js: encoded originalPositionFor x 9,230 ops/sec ±1.36% (93 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 8,057 ops/sec ±0.84% (96 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 28,198 ops/sec ±1.12% (91 runs sampled) +Chrome dev tools: encoded originalPositionFor x 46,276 ops/sec ±1.35% (95 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 204,406 ops/sec ±0.19% (97 runs sampled) +trace-mapping: encoded originalPositionFor x 196,695 ops/sec ±0.24% (99 runs sampled) +source-map-js: encoded originalPositionFor x 11,948 ops/sec ±0.94% (99 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 10,730 ops/sec ±0.36% (100 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 51,427 ops/sec ±0.21% (98 runs sampled) +Chrome dev tools: encoded originalPositionFor x 162,615 ops/sec ±0.18% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +babel.min.js.map - 347793 segments + +Memory Usage: +trace-mapping decoded 18504 bytes +trace-mapping encoded 35428008 bytes +source-map-js 51676808 bytes +source-map-0.6.1 63367136 bytes +source-map-0.8.0 43158400 bytes +Chrome dev tools 50721552 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 17.82 ops/sec ±6.35% (35 runs sampled) +trace-mapping: encoded JSON input x 31.57 ops/sec ±7.50% (43 runs sampled) +trace-mapping: decoded Object input x 867 ops/sec ±0.74% (94 runs sampled) +trace-mapping: encoded Object input x 33.83 ops/sec ±7.66% (46 runs sampled) +source-map-js: encoded Object input x 6.58 ops/sec ±3.31% (20 runs sampled) +source-map-0.6.1: encoded Object input x 4.23 ops/sec ±3.43% (15 runs sampled) +Chrome dev tools: encoded Object input x 22.14 ops/sec ±3.79% (41 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 78,234 ops/sec ±1.48% (29 runs sampled) +trace-mapping: encoded originalPositionFor x 60,761 ops/sec ±1.35% (21 runs sampled) +source-map-js: encoded originalPositionFor x 51,448 ops/sec ±2.17% (89 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 47,221 ops/sec ±1.99% (15 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 84,002 ops/sec ±1.45% (27 runs sampled) +Chrome dev tools: encoded originalPositionFor x 106,457 ops/sec ±1.38% (37 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 930,943 ops/sec ±0.25% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 843,545 ops/sec ±0.34% (97 runs sampled) +source-map-js: encoded originalPositionFor x 114,510 ops/sec ±1.37% (36 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 87,412 ops/sec ±0.72% (92 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 197,709 ops/sec ±0.89% (59 runs sampled) +Chrome dev tools: encoded originalPositionFor x 688,983 ops/sec ±0.33% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +preact.js.map - 1992 segments + +Memory Usage: +trace-mapping decoded 33136 bytes +trace-mapping encoded 254240 bytes +source-map-js 837488 bytes +source-map-0.6.1 961928 bytes +source-map-0.8.0 54384 bytes +Chrome dev tools 709680 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 3,709 ops/sec ±0.13% (99 runs sampled) +trace-mapping: encoded JSON input x 6,447 ops/sec ±0.22% (101 runs sampled) +trace-mapping: decoded Object input x 83,062 ops/sec ±0.23% (100 runs sampled) +trace-mapping: encoded Object input x 14,980 ops/sec ±0.28% (100 runs sampled) +source-map-js: encoded Object input x 2,544 ops/sec ±0.16% (99 runs sampled) +source-map-0.6.1: encoded Object input x 1,221 ops/sec ±0.37% (97 runs sampled) +Chrome dev tools: encoded Object input x 4,241 ops/sec ±0.39% (93 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 91,028 ops/sec ±0.14% (94 runs sampled) +trace-mapping: encoded originalPositionFor x 84,348 ops/sec ±0.26% (98 runs sampled) +source-map-js: encoded originalPositionFor x 26,998 ops/sec ±0.23% (98 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 18,049 ops/sec ±0.26% (100 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 41,916 ops/sec ±0.28% (98 runs sampled) +Chrome dev tools: encoded originalPositionFor x 88,616 ops/sec ±0.14% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 319,960 ops/sec ±0.16% (100 runs sampled) +trace-mapping: encoded originalPositionFor x 302,153 ops/sec ±0.18% (100 runs sampled) +source-map-js: encoded originalPositionFor x 35,574 ops/sec ±0.19% (100 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 19,943 ops/sec ±0.12% (101 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 54,648 ops/sec ±0.20% (99 runs sampled) +Chrome dev tools: encoded originalPositionFor x 278,319 ops/sec ±0.17% (102 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +react.js.map - 5726 segments + +Memory Usage: +trace-mapping decoded 10872 bytes +trace-mapping encoded 681512 bytes +source-map-js 2563944 bytes +source-map-0.6.1 2150864 bytes +source-map-0.8.0 88680 bytes +Chrome dev tools 1149576 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1,887 ops/sec ±0.28% (99 runs sampled) +trace-mapping: encoded JSON input x 4,749 ops/sec ±0.48% (97 runs sampled) +trace-mapping: decoded Object input x 74,236 ops/sec ±0.11% (99 runs sampled) +trace-mapping: encoded Object input x 5,752 ops/sec ±0.38% (100 runs sampled) +source-map-js: encoded Object input x 806 ops/sec ±0.19% (97 runs sampled) +source-map-0.6.1: encoded Object input x 418 ops/sec ±0.33% (94 runs sampled) +Chrome dev tools: encoded Object input x 1,524 ops/sec ±0.57% (92 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 620,201 ops/sec ±0.33% (96 runs sampled) +trace-mapping: encoded originalPositionFor x 579,548 ops/sec ±0.35% (97 runs sampled) +source-map-js: encoded originalPositionFor x 230,983 ops/sec ±0.62% (54 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 158,145 ops/sec ±0.80% (46 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 343,801 ops/sec ±0.55% (96 runs sampled) +Chrome dev tools: encoded originalPositionFor x 659,649 ops/sec ±0.49% (98 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 2,368,079 ops/sec ±0.32% (98 runs sampled) +trace-mapping: encoded originalPositionFor x 2,134,039 ops/sec ±2.72% (87 runs sampled) +source-map-js: encoded originalPositionFor x 290,120 ops/sec ±2.49% (82 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 187,613 ops/sec ±0.86% (49 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 479,569 ops/sec ±0.65% (96 runs sampled) +Chrome dev tools: encoded originalPositionFor x 2,048,414 ops/sec ±0.24% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +vscode.map - 2141001 segments + +Memory Usage: +trace-mapping decoded 5206584 bytes +trace-mapping encoded 208370336 bytes +source-map-js 278493008 bytes +source-map-0.6.1 391564048 bytes +source-map-0.8.0 257508787 bytes +Chrome dev tools 291053000 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1.63 ops/sec ±33.88% (9 runs sampled) +trace-mapping: encoded JSON input x 3.29 ops/sec ±36.13% (13 runs sampled) +trace-mapping: decoded Object input x 103 ops/sec ±0.93% (77 runs sampled) +trace-mapping: encoded Object input x 5.42 ops/sec ±28.54% (19 runs sampled) +source-map-js: encoded Object input x 1.07 ops/sec ±13.84% (7 runs sampled) +source-map-0.6.1: encoded Object input x 0.60 ops/sec ±2.43% (6 runs sampled) +Chrome dev tools: encoded Object input x 2.61 ops/sec ±22.00% (11 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 257,019 ops/sec ±0.97% (93 runs sampled) +trace-mapping: encoded originalPositionFor x 179,163 ops/sec ±0.83% (92 runs sampled) +source-map-js: encoded originalPositionFor x 73,337 ops/sec ±1.35% (87 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 38,797 ops/sec ±1.66% (88 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 107,758 ops/sec ±1.94% (45 runs sampled) +Chrome dev tools: encoded originalPositionFor x 188,550 ops/sec ±1.85% (79 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 447,621 ops/sec ±3.64% (94 runs sampled) +trace-mapping: encoded originalPositionFor x 323,698 ops/sec ±5.20% (88 runs sampled) +source-map-js: encoded originalPositionFor x 78,387 ops/sec ±1.69% (89 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 41,016 ops/sec ±3.01% (25 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 124,204 ops/sec ±0.90% (92 runs sampled) +Chrome dev tools: encoded originalPositionFor x 230,087 ops/sec ±2.61% (93 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor +``` + +[source-map]: https://www.npmjs.com/package/source-map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs new file mode 100644 index 0000000..73a95c7 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs @@ -0,0 +1,493 @@ +// src/trace-mapping.ts +import { encode, decode } from "@jridgewell/sourcemap-codec"; + +// src/resolve.ts +import resolveUri from "@jridgewell/resolve-uri"; + +// src/strip-filename.ts +function stripFilename(path) { + if (!path) return ""; + const index = path.lastIndexOf("/"); + return path.slice(0, index + 1); +} + +// src/resolve.ts +function resolver(mapUrl, sourceRoot) { + const from = stripFilename(mapUrl); + const prefix = sourceRoot ? sourceRoot + "/" : ""; + return (source) => resolveUri(prefix + (source || ""), from); +} + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; +var REV_GENERATED_LINE = 1; +var REV_GENERATED_COLUMN = 2; + +// src/sort.ts +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) return mappings; + if (!owned) mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; +} + +// src/by-source.ts +function buildBySources(decoded, memos) { + const sources = memos.map(() => []); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) continue; + const sourceIndex2 = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const source = sources[sourceIndex2]; + const segs = source[sourceLine] || (source[sourceLine] = []); + segs.push([sourceColumn, i, seg[COLUMN]]); + } + } + for (let i = 0; i < sources.length; i++) { + const source = sources[i]; + for (let j = 0; j < source.length; j++) { + const line = source[j]; + if (line) line.sort(sortComparator); + } + } + return sources; +} + +// src/binary-search.ts +var found = false; +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + (high - low >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1 + }; +} +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + low = lastIndex === -1 ? 0 : lastIndex; + } else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return state.lastIndex = binarySearch(haystack, needle, low, high); +} + +// src/types.ts +function parse(map) { + return typeof map === "string" ? JSON.parse(map) : map; +} + +// src/flatten-map.ts +var FlattenMap = function(map, mapUrl) { + const parsed = parse(map); + if (!("sections" in parsed)) { + return new TraceMap(parsed, mapUrl); + } + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + const ignoreList = []; + recurse( + parsed, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + 0, + 0, + Infinity, + Infinity + ); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + ignoreList + }; + return presortedDecodedMap(joined); +}; +function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection( + map, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + lineOffset + offset.line, + columnOffset + offset.column, + sl, + sc + ); + } +} +function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const parsed = parse(input); + if ("sections" in parsed) return recurse(...arguments); + const map = new TraceMap(parsed, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) append(sourcesContent, contents); + else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); + if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + if (lineI > stopLine) return; + const out = getLine(mappings, lineI); + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + if (lineI === stopLine && column >= stopColumn) return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push( + seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] + ); + } + } +} +function append(arr, other) { + for (let i = 0; i < other.length; i++) arr.push(other[i]); +} +function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) arr[i] = []; + return arr[index]; +} + +// src/trace-mapping.ts +var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; +var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; +var LEAST_UPPER_BOUND = -1; +var GREATEST_LOWER_BOUND = 1; +var TraceMap = class { + constructor(map, mapUrl) { + const isString = typeof map === "string"; + if (!isString && map._decodedMemo) return map; + const parsed = parse(map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; + const resolve = resolver(mapUrl, sourceRoot); + this.resolvedSources = sources.map(resolve); + const { mappings } = parsed; + if (typeof mappings === "string") { + this._encoded = mappings; + this._decoded = void 0; + } else if (Array.isArray(mappings)) { + this._encoded = void 0; + this._decoded = maybeSort(mappings, isString); + } else if (parsed.sections) { + throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); + } else { + throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); + } + this._decodedMemo = memoizedState(); + this._bySources = void 0; + this._bySourceMemos = void 0; + } +}; +function cast(map) { + return map; +} +function encodedMappings(map) { + var _a, _b; + return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded); +} +function decodedMappings(map) { + var _a; + return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded)); +} +function traceSegment(map, line, column) { + const decoded = decodedMappings(map); + if (line >= decoded.length) return null; + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + GREATEST_LOWER_BOUND + ); + return index === -1 ? null : segments[index]; +} +function originalPositionFor(map, needle) { + let { line, column, bias } = needle; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + if (line >= decoded.length) return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + bias || GREATEST_LOWER_BOUND + ); + if (index === -1) return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping( + resolvedSources[segment[SOURCES_INDEX]], + segment[SOURCE_LINE] + 1, + segment[SOURCE_COLUMN], + segment.length === 5 ? names[segment[NAMES_INDEX]] : null + ); +} +function generatedPositionFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); +} +function allGeneratedPositionsFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); +} +function eachMapping(map, cb) { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name + }); + } + } +} +function sourceIndex(map, source) { + const { sources, resolvedSources } = map; + let index = sources.indexOf(source); + if (index === -1) index = resolvedSources.indexOf(source); + return index; +} +function sourceContentFor(map, source) { + const { sourcesContent } = map; + if (sourcesContent == null) return null; + const index = sourceIndex(map, source); + return index === -1 ? null : sourcesContent[index]; +} +function isIgnored(map, source) { + const { ignoreList } = map; + if (ignoreList == null) return false; + const index = sourceIndex(map, source); + return index === -1 ? false : ignoreList.includes(index); +} +function presortedDecodedMap(map, mapUrl) { + const tracer = new TraceMap(clone(map, []), mapUrl); + cast(tracer)._decoded = map.mappings; + return tracer; +} +function decodedMap(map) { + return clone(map, decodedMappings(map)); +} +function encodedMap(map) { + return clone(map, encodedMappings(map)); +} +function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + ignoreList: map.ignoreList || map.x_google_ignoreList + }; +} +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function GMapping(line, column) { + return { line, column }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } else if (bias === LEAST_UPPER_BOUND) index++; + if (index === -1 || index === segments.length) return -1; + return index; +} +function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + if (!found && bias === LEAST_UPPER_BOUND) min++; + if (min === -1 || min === segments.length) return []; + const matchedColumn = found ? column : segments[min][COLUMN]; + if (!found) min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} +function generatedPosition(map, source, line, column, bias, all) { + var _a, _b; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex2 = sources.indexOf(source); + if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); + if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); + const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); + const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); + const segments = generated[sourceIndex2][line]; + if (segments == null) return all ? [] : GMapping(null, null); + const memo = bySourceMemos[sourceIndex2]; + if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); +} +export { + FlattenMap as AnyMap, + FlattenMap, + GREATEST_LOWER_BOUND, + LEAST_UPPER_BOUND, + TraceMap, + allGeneratedPositionsFor, + decodedMap, + decodedMappings, + eachMapping, + encodedMap, + encodedMappings, + generatedPositionFor, + isIgnored, + originalPositionFor, + presortedDecodedMap, + sourceContentFor, + traceSegment +}; +//# sourceMappingURL=trace-mapping.mjs.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map new file mode 100644 index 0000000..a789581 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], + "mappings": ";AAAA,SAAS,QAAQ,cAAc;;;ACA/B,OAAO,gBAAgB;;;ACGR,SAAR,cAA+B,MAAyC;AAC7E,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,SAAO,KAAK,MAAM,GAAG,QAAQ,CAAC;AAChC;;;ADHe,SAAR,SACL,QACA,YACS;AACT,QAAM,OAAO,cAAc,MAAM;AAIjC,QAAM,SAAS,aAAa,aAAa,MAAM;AAE/C,SAAO,CAAC,WAAW,WAAW,UAAU,UAAU,KAAK,IAAI;AAC7D;;;AEAO,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;;;AClBrB,SAAR,UACL,UACA,OACsB;AACtB,QAAM,gBAAgB,wBAAwB,UAAU,CAAC;AACzD,MAAI,kBAAkB,SAAS,OAAQ,QAAO;AAI9C,MAAI,CAAC,MAAO,YAAW,SAAS,MAAM;AAEtC,WAAS,IAAI,eAAe,IAAI,SAAS,QAAQ,IAAI,wBAAwB,UAAU,IAAI,CAAC,GAAG;AAC7F,aAAS,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,SAAS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nE;AA6dE;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", + "names": ["sourceIndex", "sourceIndex"] +} diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js new file mode 100644 index 0000000..0387ae3 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js @@ -0,0 +1,559 @@ +(function (global, factory) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + factory(module, require('@jridgewell/resolve-uri'), require('@jridgewell/sourcemap-codec')); + module.exports = def(module); + } else if (typeof define === 'function' && define.amd) { + define(['module', '@jridgewell/resolve-uri', '@jridgewell/sourcemap-codec'], function(mod) { + factory.apply(this, arguments); + mod.exports = def(mod); + }); + } else { + const mod = { exports: {} }; + factory(mod, global.resolveURI, global.sourcemapCodec); + global = typeof globalThis !== 'undefined' ? globalThis : global || self; + global.traceMapping = def(mod); + } + function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } +})(this, (function (module, require_resolveURI, require_sourcemapCodec) { +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// umd:@jridgewell/sourcemap-codec +var require_sourcemap_codec = __commonJS({ + "umd:@jridgewell/sourcemap-codec"(exports, module2) { + module2.exports = require_sourcemapCodec; + } +}); + +// umd:@jridgewell/resolve-uri +var require_resolve_uri = __commonJS({ + "umd:@jridgewell/resolve-uri"(exports, module2) { + module2.exports = require_resolveURI; + } +}); + +// src/trace-mapping.ts +var trace_mapping_exports = {}; +__export(trace_mapping_exports, { + AnyMap: () => FlattenMap, + FlattenMap: () => FlattenMap, + GREATEST_LOWER_BOUND: () => GREATEST_LOWER_BOUND, + LEAST_UPPER_BOUND: () => LEAST_UPPER_BOUND, + TraceMap: () => TraceMap, + allGeneratedPositionsFor: () => allGeneratedPositionsFor, + decodedMap: () => decodedMap, + decodedMappings: () => decodedMappings, + eachMapping: () => eachMapping, + encodedMap: () => encodedMap, + encodedMappings: () => encodedMappings, + generatedPositionFor: () => generatedPositionFor, + isIgnored: () => isIgnored, + originalPositionFor: () => originalPositionFor, + presortedDecodedMap: () => presortedDecodedMap, + sourceContentFor: () => sourceContentFor, + traceSegment: () => traceSegment +}); +module.exports = __toCommonJS(trace_mapping_exports); +var import_sourcemap_codec = __toESM(require_sourcemap_codec()); + +// src/resolve.ts +var import_resolve_uri = __toESM(require_resolve_uri()); + +// src/strip-filename.ts +function stripFilename(path) { + if (!path) return ""; + const index = path.lastIndexOf("/"); + return path.slice(0, index + 1); +} + +// src/resolve.ts +function resolver(mapUrl, sourceRoot) { + const from = stripFilename(mapUrl); + const prefix = sourceRoot ? sourceRoot + "/" : ""; + return (source) => (0, import_resolve_uri.default)(prefix + (source || ""), from); +} + +// src/sourcemap-segment.ts +var COLUMN = 0; +var SOURCES_INDEX = 1; +var SOURCE_LINE = 2; +var SOURCE_COLUMN = 3; +var NAMES_INDEX = 4; +var REV_GENERATED_LINE = 1; +var REV_GENERATED_COLUMN = 2; + +// src/sort.ts +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) return mappings; + if (!owned) mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; +} + +// src/by-source.ts +function buildBySources(decoded, memos) { + const sources = memos.map(() => []); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) continue; + const sourceIndex2 = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const source = sources[sourceIndex2]; + const segs = source[sourceLine] || (source[sourceLine] = []); + segs.push([sourceColumn, i, seg[COLUMN]]); + } + } + for (let i = 0; i < sources.length; i++) { + const source = sources[i]; + for (let j = 0; j < source.length; j++) { + const line = source[j]; + if (line) line.sort(sortComparator); + } + } + return sources; +} + +// src/binary-search.ts +var found = false; +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + (high - low >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1 + }; +} +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + low = lastIndex === -1 ? 0 : lastIndex; + } else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return state.lastIndex = binarySearch(haystack, needle, low, high); +} + +// src/types.ts +function parse(map) { + return typeof map === "string" ? JSON.parse(map) : map; +} + +// src/flatten-map.ts +var FlattenMap = function(map, mapUrl) { + const parsed = parse(map); + if (!("sections" in parsed)) { + return new TraceMap(parsed, mapUrl); + } + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + const ignoreList = []; + recurse( + parsed, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + 0, + 0, + Infinity, + Infinity + ); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + ignoreList + }; + return presortedDecodedMap(joined); +}; +function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection( + map, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + lineOffset + offset.line, + columnOffset + offset.column, + sl, + sc + ); + } +} +function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { + const parsed = parse(input); + if ("sections" in parsed) return recurse(...arguments); + const map = new TraceMap(parsed, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) append(sourcesContent, contents); + else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); + if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + if (lineI > stopLine) return; + const out = getLine(mappings, lineI); + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + if (lineI === stopLine && column >= stopColumn) return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push( + seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] + ); + } + } +} +function append(arr, other) { + for (let i = 0; i < other.length; i++) arr.push(other[i]); +} +function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) arr[i] = []; + return arr[index]; +} + +// src/trace-mapping.ts +var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; +var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; +var LEAST_UPPER_BOUND = -1; +var GREATEST_LOWER_BOUND = 1; +var TraceMap = class { + constructor(map, mapUrl) { + const isString = typeof map === "string"; + if (!isString && map._decodedMemo) return map; + const parsed = parse(map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; + const resolve = resolver(mapUrl, sourceRoot); + this.resolvedSources = sources.map(resolve); + const { mappings } = parsed; + if (typeof mappings === "string") { + this._encoded = mappings; + this._decoded = void 0; + } else if (Array.isArray(mappings)) { + this._encoded = void 0; + this._decoded = maybeSort(mappings, isString); + } else if (parsed.sections) { + throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); + } else { + throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); + } + this._decodedMemo = memoizedState(); + this._bySources = void 0; + this._bySourceMemos = void 0; + } +}; +function cast(map) { + return map; +} +function encodedMappings(map) { + var _a, _b; + return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = (0, import_sourcemap_codec.encode)(cast(map)._decoded); +} +function decodedMappings(map) { + var _a; + return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded)); +} +function traceSegment(map, line, column) { + const decoded = decodedMappings(map); + if (line >= decoded.length) return null; + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + GREATEST_LOWER_BOUND + ); + return index === -1 ? null : segments[index]; +} +function originalPositionFor(map, needle) { + let { line, column, bias } = needle; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + if (line >= decoded.length) return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + bias || GREATEST_LOWER_BOUND + ); + if (index === -1) return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping( + resolvedSources[segment[SOURCES_INDEX]], + segment[SOURCE_LINE] + 1, + segment[SOURCE_COLUMN], + segment.length === 5 ? names[segment[NAMES_INDEX]] : null + ); +} +function generatedPositionFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); +} +function allGeneratedPositionsFor(map, needle) { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); +} +function eachMapping(map, cb) { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name + }); + } + } +} +function sourceIndex(map, source) { + const { sources, resolvedSources } = map; + let index = sources.indexOf(source); + if (index === -1) index = resolvedSources.indexOf(source); + return index; +} +function sourceContentFor(map, source) { + const { sourcesContent } = map; + if (sourcesContent == null) return null; + const index = sourceIndex(map, source); + return index === -1 ? null : sourcesContent[index]; +} +function isIgnored(map, source) { + const { ignoreList } = map; + if (ignoreList == null) return false; + const index = sourceIndex(map, source); + return index === -1 ? false : ignoreList.includes(index); +} +function presortedDecodedMap(map, mapUrl) { + const tracer = new TraceMap(clone(map, []), mapUrl); + cast(tracer)._decoded = map.mappings; + return tracer; +} +function decodedMap(map) { + return clone(map, decodedMappings(map)); +} +function encodedMap(map) { + return clone(map, encodedMappings(map)); +} +function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + ignoreList: map.ignoreList || map.x_google_ignoreList + }; +} +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function GMapping(line, column) { + return { line, column }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } else if (bias === LEAST_UPPER_BOUND) index++; + if (index === -1 || index === segments.length) return -1; + return index; +} +function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + if (!found && bias === LEAST_UPPER_BOUND) min++; + if (min === -1 || min === segments.length) return []; + const matchedColumn = found ? column : segments[min][COLUMN]; + if (!found) min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} +function generatedPosition(map, source, line, column, bias, all) { + var _a, _b; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex2 = sources.indexOf(source); + if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); + if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); + const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); + const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); + const segments = generated[sourceIndex2][line]; + if (segments == null) return all ? [] : GMapping(null, null); + const memo = bySourceMemos[sourceIndex2]; + if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); +} +})); +//# sourceMappingURL=trace-mapping.umd.js.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map new file mode 100644 index 0000000..68b0c77 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map @@ -0,0 +1,6 @@ +{ + "version": 3, + "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/resolve-uri", "../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], + "mappings": ";;;;;;;;;;;;;;;;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E/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", + "names": ["module", "module", "resolveUri", "sourceIndex", "sourceIndex"] +} diff --git a/node_modules/@jridgewell/trace-mapping/package.json b/node_modules/@jridgewell/trace-mapping/package.json new file mode 100644 index 0000000..9d3a1c0 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/package.json @@ -0,0 +1,67 @@ +{ + "name": "@jridgewell/trace-mapping", + "version": "0.3.31", + "description": "Trace the original position through a source map", + "keywords": [ + "source", + "map" + ], + "main": "dist/trace-mapping.umd.js", + "module": "dist/trace-mapping.mjs", + "types": "types/trace-mapping.d.cts", + "files": [ + "dist", + "src", + "types" + ], + "exports": { + ".": [ + { + "import": { + "types": "./types/trace-mapping.d.mts", + "default": "./dist/trace-mapping.mjs" + }, + "default": { + "types": "./types/trace-mapping.d.cts", + "default": "./dist/trace-mapping.umd.js" + } + }, + "./dist/trace-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:code benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.mjs", + "build": "run-s -n build:code build:types", + "build:code": "node ../../esbuild.mjs trace-mapping.ts", + "build:types": "run-s build:types:force build:types:emit build:types:mts", + "build:types:force": "rimraf tsconfig.build.tsbuildinfo", + "build:types:emit": "tsc --project tsconfig.build.json", + "build:types:mts": "node ../../mts-types.mjs", + "clean": "run-s -n clean:code clean:types", + "clean:code": "tsc --build --clean tsconfig.build.json", + "clean:types": "rimraf dist types", + "test": "run-s -n test:types test:only test:format", + "test:format": "prettier --check '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:types": "eslint '{src,test}/**/*.ts'", + "lint": "run-s -n lint:types lint:format", + "lint:format": "npm run test:format -- --write", + "lint:types": "npm run test:types -- --fix", + "prepublishOnly": "npm run-s -n build test" + }, + "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemaps.git", + "directory": "packages/trace-mapping" + }, + "author": "Justin Ridgewell ", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } +} diff --git a/node_modules/@jridgewell/trace-mapping/src/binary-search.ts b/node_modules/@jridgewell/trace-mapping/src/binary-search.ts new file mode 100644 index 0000000..c1144ad --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/binary-search.ts @@ -0,0 +1,115 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; +import { COLUMN } from './sourcemap-segment'; + +export type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; + +export let found = false; + +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export function binarySearch( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + low: number, + high: number, +): number { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN] - needle; + + if (cmp === 0) { + found = true; + return mid; + } + + if (cmp < 0) { + low = mid + 1; + } else { + high = mid - 1; + } + } + + found = false; + return low - 1; +} + +export function upperBound( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + index: number, +): number { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} + +export function lowerBound( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + index: number, +): number { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) break; + } + return index; +} + +export function memoizedState(): MemoState { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; +} + +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export function memoizedBinarySearch( + haystack: SourceMapSegment[] | ReverseSegment[], + needle: number, + state: MemoState, + key: number, +): number { + const { lastKey, lastNeedle, lastIndex } = state; + + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + + return (state.lastIndex = binarySearch(haystack, needle, low, high)); +} diff --git a/node_modules/@jridgewell/trace-mapping/src/by-source.ts b/node_modules/@jridgewell/trace-mapping/src/by-source.ts new file mode 100644 index 0000000..1da6af0 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/by-source.ts @@ -0,0 +1,41 @@ +import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment'; +import { sortComparator } from './sort'; + +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; + +export type Source = ReverseSegment[][]; + +// Rebuilds the original source files, with mappings that are ordered by source line/column instead +// of generated line/column. +export default function buildBySources( + decoded: readonly SourceMapSegment[][], + memos: unknown[], +): Source[] { + const sources: Source[] = memos.map(() => []); + + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) continue; + + const sourceIndex = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + + const source = sources[sourceIndex]; + const segs = (source[sourceLine] ||= []); + segs.push([sourceColumn, i, seg[COLUMN]]); + } + } + + for (let i = 0; i < sources.length; i++) { + const source = sources[i]; + for (let j = 0; j < source.length; j++) { + const line = source[j]; + if (line) line.sort(sortComparator); + } + } + + return sources; +} diff --git a/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts b/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts new file mode 100644 index 0000000..61ac40c --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts @@ -0,0 +1,192 @@ +import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping'; +import { + COLUMN, + SOURCES_INDEX, + SOURCE_LINE, + SOURCE_COLUMN, + NAMES_INDEX, +} from './sourcemap-segment'; +import { parse } from './types'; + +import type { + DecodedSourceMap, + DecodedSourceMapXInput, + EncodedSourceMapXInput, + SectionedSourceMapXInput, + SectionedSourceMapInput, + SectionXInput, + Ro, +} from './types'; +import type { SourceMapSegment } from './sourcemap-segment'; + +type FlattenMap = { + new (map: Ro, mapUrl?: string | null): TraceMap; + (map: Ro, mapUrl?: string | null): TraceMap; +}; + +export const FlattenMap: FlattenMap = function (map, mapUrl) { + const parsed = parse(map as SectionedSourceMapInput); + + if (!('sections' in parsed)) { + return new TraceMap(parsed as DecodedSourceMapXInput | EncodedSourceMapXInput, mapUrl); + } + + const mappings: SourceMapSegment[][] = []; + const sources: string[] = []; + const sourcesContent: (string | null)[] = []; + const names: string[] = []; + const ignoreList: number[] = []; + + recurse( + parsed, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + 0, + 0, + Infinity, + Infinity, + ); + + const joined: DecodedSourceMap = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + ignoreList, + }; + + return presortedDecodedMap(joined); +} as FlattenMap; + +function recurse( + input: SectionedSourceMapXInput, + mapUrl: string | null | undefined, + mappings: SourceMapSegment[][], + sources: string[], + sourcesContent: (string | null)[], + names: string[], + ignoreList: number[], + lineOffset: number, + columnOffset: number, + stopLine: number, + stopColumn: number, +) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + + addSection( + map, + mapUrl, + mappings, + sources, + sourcesContent, + names, + ignoreList, + lineOffset + offset.line, + columnOffset + offset.column, + sl, + sc, + ); + } +} + +function addSection( + input: SectionXInput['map'], + mapUrl: string | null | undefined, + mappings: SourceMapSegment[][], + sources: string[], + sourcesContent: (string | null)[], + names: string[], + ignoreList: number[], + lineOffset: number, + columnOffset: number, + stopLine: number, + stopColumn: number, +) { + const parsed = parse(input); + if ('sections' in parsed) return recurse(...(arguments as unknown as Parameters)); + + const map = new TraceMap(parsed, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; + + append(sources, resolvedSources); + append(names, map.names); + + if (contents) append(sourcesContent, contents); + else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); + + if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); + + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. But it may not have any columns that overstep, so we + // still need to check that we don't overstep lines, too. + if (lineI > stopLine) return; + + // The out line may already exist in mappings (if we're continuing the line started by a + // previous section). Or, we may have jumped ahead several lines to start this section. + const out = getLine(mappings, lineI); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (lineI === stopLine && column >= stopColumn) return; + + if (seg.length === 1) { + out.push([column]); + continue; + } + + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push( + seg.length === 4 + ? [column, sourcesIndex, sourceLine, sourceColumn] + : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]], + ); + } + } +} + +function append(arr: T[], other: T[]) { + for (let i = 0; i < other.length; i++) arr.push(other[i]); +} + +function getLine(arr: T[][], index: number): T[] { + for (let i = arr.length; i <= index; i++) arr[i] = []; + return arr[index]; +} diff --git a/node_modules/@jridgewell/trace-mapping/src/resolve.ts b/node_modules/@jridgewell/trace-mapping/src/resolve.ts new file mode 100644 index 0000000..30bfa3b --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/resolve.ts @@ -0,0 +1,16 @@ +import resolveUri from '@jridgewell/resolve-uri'; +import stripFilename from './strip-filename'; + +type Resolve = (source: string | null) => string; +export default function resolver( + mapUrl: string | null | undefined, + sourceRoot: string | undefined, +): Resolve { + const from = stripFilename(mapUrl); + // The sourceRoot is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + const prefix = sourceRoot ? sourceRoot + '/' : ''; + + return (source) => resolveUri(prefix + (source || ''), from); +} diff --git a/node_modules/@jridgewell/trace-mapping/src/sort.ts b/node_modules/@jridgewell/trace-mapping/src/sort.ts new file mode 100644 index 0000000..5d016cb --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/sort.ts @@ -0,0 +1,45 @@ +import { COLUMN } from './sourcemap-segment'; + +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; + +export default function maybeSort( + mappings: SourceMapSegment[][], + owned: boolean, +): SourceMapSegment[][] { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) return mappings; + + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) mappings = mappings.slice(); + + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} + +function nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) return i; + } + return mappings.length; +} + +function isSorted(line: SourceMapSegment[]): boolean { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} + +function sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] { + if (!owned) line = line.slice(); + return line.sort(sortComparator); +} + +export function sortComparator(a: T, b: T): number { + return a[COLUMN] - b[COLUMN]; +} diff --git a/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts b/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts new file mode 100644 index 0000000..94f1b6a --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts @@ -0,0 +1,23 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; + +type GeneratedLine = number; + +export type SourceMapSegment = + | [GeneratedColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] + | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; + +export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; + +export const COLUMN = 0; +export const SOURCES_INDEX = 1; +export const SOURCE_LINE = 2; +export const SOURCE_COLUMN = 3; +export const NAMES_INDEX = 4; + +export const REV_GENERATED_LINE = 1; +export const REV_GENERATED_COLUMN = 2; diff --git a/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts b/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts new file mode 100644 index 0000000..2c88980 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts @@ -0,0 +1,8 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export default function stripFilename(path: string | undefined | null): string { + if (!path) return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} diff --git a/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts b/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts new file mode 100644 index 0000000..0b793d5 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts @@ -0,0 +1,502 @@ +import { encode, decode } from '@jridgewell/sourcemap-codec'; + +import resolver from './resolve'; +import maybeSort from './sort'; +import buildBySources from './by-source'; +import { + memoizedState, + memoizedBinarySearch, + upperBound, + lowerBound, + found as bsFound, +} from './binary-search'; +import { + COLUMN, + SOURCES_INDEX, + SOURCE_LINE, + SOURCE_COLUMN, + NAMES_INDEX, + REV_GENERATED_LINE, + REV_GENERATED_COLUMN, +} from './sourcemap-segment'; +import { parse } from './types'; + +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; +import type { + SourceMapV3, + DecodedSourceMap, + EncodedSourceMap, + InvalidOriginalMapping, + OriginalMapping, + InvalidGeneratedMapping, + GeneratedMapping, + SourceMapInput, + Needle, + SourceNeedle, + SourceMap, + EachMapping, + Bias, + XInput, + SectionedSourceMap, + Ro, +} from './types'; +import type { Source } from './by-source'; +import type { MemoState } from './binary-search'; + +export type { SourceMapSegment } from './sourcemap-segment'; +export type { + SourceMap, + DecodedSourceMap, + EncodedSourceMap, + Section, + SectionedSourceMap, + SourceMapV3, + Bias, + EachMapping, + GeneratedMapping, + InvalidGeneratedMapping, + InvalidOriginalMapping, + Needle, + OriginalMapping, + OriginalMapping as Mapping, + SectionedSourceMapInput, + SourceMapInput, + SourceNeedle, + XInput, + EncodedSourceMapXInput, + DecodedSourceMapXInput, + SectionedSourceMapXInput, + SectionXInput, +} from './types'; + +interface PublicMap { + _encoded: TraceMap['_encoded']; + _decoded: TraceMap['_decoded']; + _decodedMemo: TraceMap['_decodedMemo']; + _bySources: TraceMap['_bySources']; + _bySourceMemos: TraceMap['_bySourceMemos']; +} + +const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; +const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; + +export const LEAST_UPPER_BOUND = -1; +export const GREATEST_LOWER_BOUND = 1; + +export { FlattenMap, FlattenMap as AnyMap } from './flatten-map'; + +export class TraceMap implements SourceMap { + declare version: SourceMapV3['version']; + declare file: SourceMapV3['file']; + declare names: SourceMapV3['names']; + declare sourceRoot: SourceMapV3['sourceRoot']; + declare sources: SourceMapV3['sources']; + declare sourcesContent: SourceMapV3['sourcesContent']; + declare ignoreList: SourceMapV3['ignoreList']; + + declare resolvedSources: string[]; + declare private _encoded: string | undefined; + + declare private _decoded: SourceMapSegment[][] | undefined; + declare private _decodedMemo: MemoState; + + declare private _bySources: Source[] | undefined; + declare private _bySourceMemos: MemoState[] | undefined; + + constructor(map: Ro, mapUrl?: string | null) { + const isString = typeof map === 'string'; + if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap; + + const parsed = parse(map as Exclude); + + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names || []; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + this.ignoreList = parsed.ignoreList || (parsed as XInput).x_google_ignoreList || undefined; + + const resolve = resolver(mapUrl, sourceRoot); + this.resolvedSources = sources.map(resolve); + + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } else if (Array.isArray(mappings)) { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } else if ((parsed as unknown as SectionedSourceMap).sections) { + throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); + } else { + throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); + } + + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } +} + +/** + * Typescript doesn't allow friend access to private fields, so this just casts the map into a type + * with public access modifiers. + */ +function cast(map: unknown): PublicMap { + return map as any; +} + +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'] { + return (cast(map)._encoded ??= encode(cast(map)._decoded!)); +} + +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export function decodedMappings(map: TraceMap): Readonly { + return (cast(map)._decoded ||= decode(cast(map)._encoded!)); +} + +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export function traceSegment( + map: TraceMap, + line: number, + column: number, +): Readonly | null { + const decoded = decodedMappings(map); + + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) return null; + + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + GREATEST_LOWER_BOUND, + ); + + return index === -1 ? null : segments[index]; +} + +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export function originalPositionFor( + map: TraceMap, + needle: Needle, +): OriginalMapping | InvalidOriginalMapping { + let { line, column, bias } = needle; + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + + const decoded = decodedMappings(map); + + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) return OMapping(null, null, null, null); + + const segments = decoded[line]; + const index = traceSegmentInternal( + segments, + cast(map)._decodedMemo, + line, + column, + bias || GREATEST_LOWER_BOUND, + ); + + if (index === -1) return OMapping(null, null, null, null); + + const segment = segments[index]; + if (segment.length === 1) return OMapping(null, null, null, null); + + const { names, resolvedSources } = map; + return OMapping( + resolvedSources[segment[SOURCES_INDEX]], + segment[SOURCE_LINE] + 1, + segment[SOURCE_COLUMN], + segment.length === 5 ? names[segment[NAMES_INDEX]] : null, + ); +} + +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export function generatedPositionFor( + map: TraceMap, + needle: SourceNeedle, +): GeneratedMapping | InvalidGeneratedMapping { + const { source, line, column, bias } = needle; + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); +} + +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[] { + const { source, line, column, bias } = needle; + // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); +} + +/** + * Iterates each mapping in generated position order. + */ +export function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) name = names[seg[4]]; + + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name, + } as EachMapping); + } + } +} + +function sourceIndex(map: TraceMap, source: string): number { + const { sources, resolvedSources } = map; + let index = sources.indexOf(source); + if (index === -1) index = resolvedSources.indexOf(source); + return index; +} + +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export function sourceContentFor(map: TraceMap, source: string): string | null { + const { sourcesContent } = map; + if (sourcesContent == null) return null; + const index = sourceIndex(map, source); + return index === -1 ? null : sourcesContent[index]; +} + +/** + * Determines if the source is marked to ignore by the source map. + */ +export function isIgnored(map: TraceMap, source: string): boolean { + const { ignoreList } = map; + if (ignoreList == null) return false; + const index = sourceIndex(map, source); + return index === -1 ? false : ignoreList.includes(index); +} + +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap { + const tracer = new TraceMap(clone(map, []), mapUrl); + cast(tracer)._decoded = map.mappings; + return tracer; +} + +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function decodedMap( + map: TraceMap, +): Omit & { mappings: readonly SourceMapSegment[][] } { + return clone(map, decodedMappings(map)); +} + +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export function encodedMap(map: TraceMap): EncodedSourceMap { + return clone(map, encodedMappings(map)); +} + +function clone( + map: TraceMap | DecodedSourceMap, + mappings: T, +): T extends string ? EncodedSourceMap : DecodedSourceMap { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + ignoreList: map.ignoreList || (map as XInput).x_google_ignoreList, + } as any; +} + +function OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping; +function OMapping( + source: string, + line: number, + column: number, + name: string | null, +): OriginalMapping; +function OMapping( + source: string | null, + line: number | null, + column: number | null, + name: string | null, +): OriginalMapping | InvalidOriginalMapping { + return { source, line, column, name } as any; +} + +function GMapping(line: null, column: null): InvalidGeneratedMapping; +function GMapping(line: number, column: number): GeneratedMapping; +function GMapping( + line: number | null, + column: number | null, +): GeneratedMapping | InvalidGeneratedMapping { + return { line, column } as any; +} + +function traceSegmentInternal( + segments: SourceMapSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): number; +function traceSegmentInternal( + segments: ReverseSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): number; +function traceSegmentInternal( + segments: SourceMapSegment[] | ReverseSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): number { + let index = memoizedBinarySearch(segments, column, memo, line); + if (bsFound) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } else if (bias === LEAST_UPPER_BOUND) index++; + + if (index === -1 || index === segments.length) return -1; + return index; +} + +function sliceGeneratedPositions( + segments: ReverseSegment[], + memo: MemoState, + line: number, + column: number, + bias: Bias, +): GeneratedMapping[] { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + + // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in + // insertion order) segment that matched. Even if we did respect the bias when tracing, we would + // still need to call `lowerBound()` to find the first segment, which is slower than just looking + // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the + // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to + // match LEAST_UPPER_BOUND. + if (!bsFound && bias === LEAST_UPPER_BOUND) min++; + + if (min === -1 || min === segments.length) return []; + + // We may have found the segment that started at an earlier column. If this is the case, then we + // need to slice all generated segments that match _that_ column, because all such segments span + // to our desired column. + const matchedColumn = bsFound ? column : segments[min][COLUMN]; + + // The binary search is not guaranteed to find the lower bound when a match wasn't found. + if (!bsFound) min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} + +function generatedPosition( + map: TraceMap, + source: string, + line: number, + column: number, + bias: Bias, + all: false, +): GeneratedMapping | InvalidGeneratedMapping; +function generatedPosition( + map: TraceMap, + source: string, + line: number, + column: number, + bias: Bias, + all: true, +): GeneratedMapping[]; +function generatedPosition( + map: TraceMap, + source: string, + line: number, + column: number, + bias: Bias, + all: boolean, +): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] { + line--; + if (line < 0) throw new Error(LINE_GTR_ZERO); + if (column < 0) throw new Error(COL_GTR_EQ_ZERO); + + const { sources, resolvedSources } = map; + let sourceIndex = sources.indexOf(source); + if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source); + if (sourceIndex === -1) return all ? [] : GMapping(null, null); + + const bySourceMemos = (cast(map)._bySourceMemos ||= sources.map(memoizedState)); + const generated = (cast(map)._bySources ||= buildBySources(decodedMappings(map), bySourceMemos)); + + const segments = generated[sourceIndex][line]; + if (segments == null) return all ? [] : GMapping(null, null); + + const memo = bySourceMemos[sourceIndex]; + + if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); + + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) return GMapping(null, null); + + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); +} diff --git a/node_modules/@jridgewell/trace-mapping/src/types.ts b/node_modules/@jridgewell/trace-mapping/src/types.ts new file mode 100644 index 0000000..730a61f --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/src/types.ts @@ -0,0 +1,114 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping'; + +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList?: number[]; +} + +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} + +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} + +export interface Section { + offset: { line: number; column: number }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} + +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} + +export type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; + +export type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; + +export type GeneratedMapping = { + line: number; + column: number; +}; +export type InvalidGeneratedMapping = { + line: null; + column: null; +}; + +export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; + +export type XInput = { x_google_ignoreList?: SourceMapV3['ignoreList'] }; +export type EncodedSourceMapXInput = EncodedSourceMap & XInput; +export type DecodedSourceMapXInput = DecodedSourceMap & XInput; +export type SectionedSourceMapXInput = Omit & { + sections: SectionXInput[]; +}; +export type SectionXInput = Omit & { + map: SectionedSourceMapInput; +}; + +export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; +export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; + +export type Needle = { line: number; column: number; bias?: Bias }; +export type SourceNeedle = { source: string; line: number; column: number; bias?: Bias }; + +export type EachMapping = + | { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; + } + | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; + }; + +export abstract class SourceMap { + declare version: SourceMapV3['version']; + declare file: SourceMapV3['file']; + declare names: SourceMapV3['names']; + declare sourceRoot: SourceMapV3['sourceRoot']; + declare sources: SourceMapV3['sources']; + declare sourcesContent: SourceMapV3['sourcesContent']; + declare resolvedSources: SourceMapV3['sources']; + declare ignoreList: SourceMapV3['ignoreList']; +} + +export type Ro = + T extends Array + ? V[] | Readonly | RoArray | Readonly> + : T extends object + ? T | Readonly | RoObject | Readonly> + : T; +type RoArray = Ro[]; +type RoObject = { [K in keyof T]: T[K] | Ro }; + +export function parse(map: T): Exclude { + return typeof map === 'string' ? JSON.parse(map) : (map as Exclude); +} diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts new file mode 100644 index 0000000..b7bb85c --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts @@ -0,0 +1,33 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.cts'; +export type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; +export declare let found: boolean; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; +export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function memoizedState(): MemoState; +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; +//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map new file mode 100644 index 0000000..648e84c --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts new file mode 100644 index 0000000..19e1e6b --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts @@ -0,0 +1,33 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.mts'; +export type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; +export declare let found: boolean; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; +export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function memoizedState(): MemoState; +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; +//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map new file mode 100644 index 0000000..648e84c --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts b/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts new file mode 100644 index 0000000..da49693 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; +export type Source = ReverseSegment[][]; +export = function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; +//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map new file mode 100644 index 0000000..32d2a7a --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts b/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts new file mode 100644 index 0000000..f361049 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; +export type Source = ReverseSegment[][]; +export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; +//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map new file mode 100644 index 0000000..32d2a7a --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts new file mode 100644 index 0000000..433d849 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts @@ -0,0 +1,9 @@ +import { TraceMap } from './trace-mapping.cts'; +import type { SectionedSourceMapInput, Ro } from './types.cts'; +type FlattenMap = { + new (map: Ro, mapUrl?: string | null): TraceMap; + (map: Ro, mapUrl?: string | null): TraceMap; +}; +export declare const FlattenMap: FlattenMap; +export {}; +//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map new file mode 100644 index 0000000..994b208 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts new file mode 100644 index 0000000..444a1be --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts @@ -0,0 +1,9 @@ +import { TraceMap } from './trace-mapping.mts'; +import type { SectionedSourceMapInput, Ro } from './types.mts'; +type FlattenMap = { + new (map: Ro, mapUrl?: string | null): TraceMap; + (map: Ro, mapUrl?: string | null): TraceMap; +}; +export declare const FlattenMap: FlattenMap; +export {}; +//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map new file mode 100644 index 0000000..994b208 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts b/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts new file mode 100644 index 0000000..62aeedb --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts @@ -0,0 +1,4 @@ +type Resolve = (source: string | null) => string; +export = function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; +export {}; +//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map new file mode 100644 index 0000000..9f155ac --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts b/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts new file mode 100644 index 0000000..e2798a1 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts @@ -0,0 +1,4 @@ +type Resolve = (source: string | null) => string; +export default function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; +export {}; +//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map new file mode 100644 index 0000000..9f155ac --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.cts b/node_modules/@jridgewell/trace-mapping/types/sort.d.cts new file mode 100644 index 0000000..aa14c12 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sort.d.cts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; +export = function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; +export declare function sortComparator(a: T, b: T): number; +//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map new file mode 100644 index 0000000..48b8e67 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.mts b/node_modules/@jridgewell/trace-mapping/types/sort.d.mts new file mode 100644 index 0000000..c5b94e6 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sort.d.mts @@ -0,0 +1,4 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; +export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; +export declare function sortComparator(a: T, b: T): number; +//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map new file mode 100644 index 0000000..48b8e67 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts new file mode 100644 index 0000000..8d3cabc --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts @@ -0,0 +1,17 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +type GeneratedLine = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export declare const REV_GENERATED_LINE = 1; +export declare const REV_GENERATED_COLUMN = 2; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map new file mode 100644 index 0000000..0c94a46 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts new file mode 100644 index 0000000..8d3cabc --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts @@ -0,0 +1,17 @@ +type GeneratedColumn = number; +type SourcesIndex = number; +type SourceLine = number; +type SourceColumn = number; +type NamesIndex = number; +type GeneratedLine = number; +export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export declare const REV_GENERATED_LINE = 1; +export declare const REV_GENERATED_COLUMN = 2; +export {}; +//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map new file mode 100644 index 0000000..0c94a46 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts new file mode 100644 index 0000000..8b3c0e9 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts @@ -0,0 +1,5 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export = function stripFilename(path: string | undefined | null): string; +//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map new file mode 100644 index 0000000..17a25da --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts new file mode 100644 index 0000000..cbbaee0 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts @@ -0,0 +1,5 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export default function stripFilename(path: string | undefined | null): string; +//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map new file mode 100644 index 0000000..17a25da --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts new file mode 100644 index 0000000..a40f305 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts @@ -0,0 +1,80 @@ +import type { SourceMapSegment } from './sourcemap-segment.cts'; +import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.cts'; +export type { SourceMapSegment } from './sourcemap-segment.cts'; +export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.cts'; +export declare const LEAST_UPPER_BOUND = -1; +export declare const GREATEST_LOWER_BOUND = 1; +export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.cts'; +export declare class TraceMap implements SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + ignoreList: SourceMapV3['ignoreList']; + resolvedSources: string[]; + private _encoded; + private _decoded; + private _decodedMemo; + private _bySources; + private _bySourceMemos; + constructor(map: Ro, mapUrl?: string | null); +} +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export declare function decodedMappings(map: TraceMap): Readonly; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export declare function traceSegment(map: TraceMap, line: number, column: number): Readonly | null; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; +/** + * Iterates each mapping in generated position order. + */ +export declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export declare function sourceContentFor(map: TraceMap, source: string): string | null; +/** + * Determines if the source is marked to ignore by the source map. + */ +export declare function isIgnored(map: TraceMap, source: string): boolean; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function decodedMap(map: TraceMap): Omit & { + mappings: readonly SourceMapSegment[][]; +}; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function encodedMap(map: TraceMap): EncodedSourceMap; +//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map new file mode 100644 index 0000000..b5a874c --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,GACd,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,qBAAa,QAAS,YAAW,SAAS;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,E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,YAAY,GAAG,gBAAgB,EAAE,CAIhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgCnF;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAIpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,GACZ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAA;CAAE,CAElF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAE1D"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts new file mode 100644 index 0000000..bc2ff0f --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts @@ -0,0 +1,80 @@ +import type { SourceMapSegment } from './sourcemap-segment.mts'; +import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.mts'; +export type { SourceMapSegment } from './sourcemap-segment.mts'; +export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.mts'; +export declare const LEAST_UPPER_BOUND = -1; +export declare const GREATEST_LOWER_BOUND = 1; +export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.mts'; +export declare class TraceMap implements SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + ignoreList: SourceMapV3['ignoreList']; + resolvedSources: string[]; + private _encoded; + private _decoded; + private _decodedMemo; + private _bySources; + private _bySourceMemos; + constructor(map: Ro, mapUrl?: string | null); +} +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export declare function decodedMappings(map: TraceMap): Readonly; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export declare function traceSegment(map: TraceMap, line: number, column: number): Readonly | null; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export declare function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; +/** + * Iterates each mapping in generated position order. + */ +export declare function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export declare function sourceContentFor(map: TraceMap, source: string): string | null; +/** + * Determines if the source is marked to ignore by the source map. + */ +export declare function isIgnored(map: TraceMap, source: string): boolean; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export declare function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function decodedMap(map: TraceMap): Omit & { + mappings: readonly SourceMapSegment[][]; +}; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare function encodedMap(map: TraceMap): EncodedSourceMap; +//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map new file mode 100644 index 0000000..b5a874c --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACv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@jridgewell/trace-mapping/types/types.d.cts new file mode 100644 index 0000000..729c2c3 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/types.d.cts @@ -0,0 +1,107 @@ +import type { SourceMapSegment } from './sourcemap-segment.cts'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.cts'; +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList?: number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} +export interface Section { + offset: { + line: number; + column: number; + }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} +export type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; +export type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; +export type GeneratedMapping = { + line: number; + column: number; +}; +export type InvalidGeneratedMapping = { + line: null; + column: null; +}; +export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; +export type XInput = { + x_google_ignoreList?: SourceMapV3['ignoreList']; +}; +export type EncodedSourceMapXInput = EncodedSourceMap & XInput; +export type DecodedSourceMapXInput = DecodedSourceMap & XInput; +export type SectionedSourceMapXInput = Omit & { + sections: SectionXInput[]; +}; +export type SectionXInput = Omit & { + map: SectionedSourceMapInput; +}; +export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; +export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; +export type Needle = { + line: number; + column: number; + bias?: Bias; +}; +export type SourceNeedle = { + source: string; + line: number; + column: number; + bias?: Bias; +}; +export type EachMapping = { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; +} | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; +}; +export declare abstract class SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: SourceMapV3['sources']; + ignoreList: SourceMapV3['ignoreList']; +} +export type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; +type RoArray = Ro[]; +type RoObject = { + [K in keyof T]: T[K] | Ro; +}; +export declare function parse(map: T): Exclude; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map new file mode 100644 index 0000000..9224783 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAA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,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/types.d.mts b/node_modules/@jridgewell/trace-mapping/types/types.d.mts new file mode 100644 index 0000000..a26d186 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/types.d.mts @@ -0,0 +1,107 @@ +import type { SourceMapSegment } from './sourcemap-segment.mts'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.mts'; +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + ignoreList?: number[]; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} +export interface Section { + offset: { + line: number; + column: number; + }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} +export type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; +export type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; +export type GeneratedMapping = { + line: number; + column: number; +}; +export type InvalidGeneratedMapping = { + line: null; + column: null; +}; +export type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; +export type XInput = { + x_google_ignoreList?: SourceMapV3['ignoreList']; +}; +export type EncodedSourceMapXInput = EncodedSourceMap & XInput; +export type DecodedSourceMapXInput = DecodedSourceMap & XInput; +export type SectionedSourceMapXInput = Omit & { + sections: SectionXInput[]; +}; +export type SectionXInput = Omit & { + map: SectionedSourceMapInput; +}; +export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; +export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; +export type Needle = { + line: number; + column: number; + bias?: Bias; +}; +export type SourceNeedle = { + source: string; + line: number; + column: number; + bias?: Bias; +}; +export type EachMapping = { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; +} | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; +}; +export declare abstract class SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: SourceMapV3['sources']; + ignoreList: SourceMapV3['ignoreList']; +} +export type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; +type RoArray = Ro[]; +type RoObject = { + [K in keyof T]: T[K] | Ro; +}; +export declare function parse(map: T): Exclude; +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map new file mode 100644 index 0000000..9224783 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAA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AC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/LICENSE b/node_modules/@noble/hashes/LICENSE new file mode 100644 index 0000000..9297a04 --- /dev/null +++ b/node_modules/@noble/hashes/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Paul Miller (https://paulmillr.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/@noble/hashes/README.md b/node_modules/@noble/hashes/README.md new file mode 100644 index 0000000..759d34b --- /dev/null +++ b/node_modules/@noble/hashes/README.md @@ -0,0 +1,521 @@ +# noble-hashes + +Audited & minimal JS implementation of hash functions, MACs and KDFs. + +- 🔒 [**Audited**](#security) by an independent security firm +- 🔻 Tree-shakeable: unused code is excluded from your builds +- 🏎 Fast: hand-optimized for caveats of JS engines +- 🔍 Reliable: chained / sliding window / DoS tests and fuzzing ensure correctness +- 🔁 No unrolled loops: makes it easier to verify and reduces source code size up to 5x +- 🦘 Includes SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF, Scrypt, Argon2 & KangarooTwelve +- 🪶 48KB for everything, 4.8KB (2.36KB gzipped) for single-hash build + +Take a glance at [GitHub Discussions](https://github.com/paulmillr/noble-hashes/discussions) for questions and support. +The library's initial development was funded by [Ethereum Foundation](https://ethereum.org/). + +### This library belongs to _noble_ cryptography + +> **noble cryptography** — high-security, easily auditable set of contained cryptographic libraries and tools. + +- Zero or minimal dependencies +- Highly readable TypeScript / JS code +- PGP-signed releases and transparent NPM builds +- All libraries: + [ciphers](https://github.com/paulmillr/noble-ciphers), + [curves](https://github.com/paulmillr/noble-curves), + [hashes](https://github.com/paulmillr/noble-hashes), + [post-quantum](https://github.com/paulmillr/noble-post-quantum), + 4kb [secp256k1](https://github.com/paulmillr/noble-secp256k1) / + [ed25519](https://github.com/paulmillr/noble-ed25519) +- [Check out homepage](https://paulmillr.com/noble/) + for reading resources, documentation and apps built with noble + +## Usage + +> `npm install @noble/hashes` + +> `deno add jsr:@noble/hashes` + +> `deno doc jsr:@noble/hashes` # command-line documentation + +We support all major platforms and runtimes. +For React Native, you may need a [polyfill for getRandomValues](https://github.com/LinusU/react-native-get-random-values). +A standalone file [noble-hashes.js](https://github.com/paulmillr/noble-hashes/releases) is also available. + +```js +// import * from '@noble/hashes'; // Error: use sub-imports, to ensure small app size +import { sha256 } from '@noble/hashes/sha2.js'; // ESM & Common.js +sha256(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // returns Uint8Array + +// Available modules +import { sha256, sha384, sha512, sha224, sha512_224, sha512_256 } from '@noble/hashes/sha2.js'; +import { sha3_256, sha3_512, keccak_256, keccak_512, shake128, shake256 } from '@noble/hashes/sha3.js'; +import { cshake256, turboshake256, kmac256, tuplehash256, k12, m14, keccakprg } from '@noble/hashes/sha3-addons.js'; +import { blake3 } from '@noble/hashes/blake3.js'; +import { blake2b, blake2s } from '@noble/hashes/blake2.js'; +import { blake256, blake512 } from '@noble/hashes/blake1.js'; +import { sha1, md5, ripemd160 } from '@noble/hashes/legacy.js'; +import { hmac } from '@noble/hashes/hmac.js'; +import { hkdf } from '@noble/hashes/hkdf.js'; +import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; +import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; +import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2.js'; +import * as utils from '@noble/hashes/utils'; // bytesToHex, bytesToUtf8, concatBytes... +``` + +- [sha2: sha256, sha384, sha512](#sha2-sha256-sha384-sha512-and-others) +- [sha3: FIPS, SHAKE, Keccak](#sha3-fips-shake-keccak) +- [sha3-addons: cSHAKE, KMAC, K12, M14, TurboSHAKE](#sha3-addons-cshake-kmac-k12-m14-turboshake) +- [blake, blake2, blake3](#blake-blake2-blake3) | [legacy: sha1, md5, ripemd160](#legacy-sha1-md5-ripemd160) +- MACs: [hmac](#hmac) | [sha3-addons kmac](#sha3-addons-cshake-kmac-k12-m14-turboshake) | [blake3 key mode](#blake2b-blake2s-blake3) +- KDFs: [hkdf](#hkdf) | [pbkdf2](#pbkdf2) | [scrypt](#scrypt) | [argon2](#argon2) +- [utils](#utils) +- [Security](#security) | [Speed](#speed) | [Contributing & testing](#contributing--testing) | [License](#license) + +### Implementations + +Hash functions: + +- `sha256()`: receive & return `Uint8Array` +- `sha256.create().update(a).update(b).digest()`: support partial updates +- `blake3.create({ context: 'e', dkLen: 32 })`: sometimes have options +- support little-endian architecture; also experimentally big-endian +- can hash up to 4GB per chunk, with any amount of chunks + +#### sha2: sha256, sha384, sha512 and others + +```typescript +import { sha224, sha256, sha384, sha512, sha512_224, sha512_256 } from '@noble/hashes/sha2.js'; +const res = sha256(Uint8Array.from([0xbc])); // basic +for (let hash of [sha256, sha384, sha512, sha224, sha512_224, sha512_256]) { + const arr = Uint8Array.from([0x10, 0x20, 0x30]); + const a = hash(arr); + const b = hash.create().update(arr).digest(); +} +``` + +See [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and +[the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). + +#### sha3: FIPS, SHAKE, Keccak + +```typescript +import { + keccak_224, keccak_256, keccak_384, keccak_512, + sha3_224, sha3_256, sha3_384, sha3_512, + shake128, shake256, +} from '@noble/hashes/sha3.js'; +for (let hash of [ + sha3_224, sha3_256, sha3_384, sha3_512, + keccak_224, keccak_256, keccak_384, keccak_512, +]) { + const arr = Uint8Array.from([0x10, 0x20, 0x30]); + const a = hash(arr); + const b = hash.create().update(arr).digest(); +} +const shka = shake128(Uint8Array.from([0x10]), { dkLen: 512 }); +const shkb = shake256(Uint8Array.from([0x30]), { dkLen: 512 }); +``` + +See [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), +[Website](https://keccak.team/keccak.html). + +Check out [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub) + +#### sha3-addons: cSHAKE, KMAC, K12, M14, TurboSHAKE + +```typescript +import { + cshake128, cshake256, + k12, + keccakprg, + kmac128, kmac256, + m14, + parallelhash256, + tuplehash256, + turboshake128, turboshake256 +} from '@noble/hashes/sha3-addons.js'; +const data = Uint8Array.from([0x10, 0x20, 0x30]); +const ec1 = cshake128(data, { personalization: 'def' }); +const ec2 = cshake256(data, { personalization: 'def' }); +const et1 = turboshake128(data); +const et2 = turboshake256(data, { D: 0x05 }); + // tuplehash(['ab', 'c']) !== tuplehash(['a', 'bc']) !== tuplehash([data]) +const et3 = tuplehash256([utf8ToBytes('ab'), utf8ToBytes('c')]); +// Not parallel in JS (similar to blake3 / k12), added for compat +const ep1 = parallelhash256(data, { blockLen: 8 }); +const kk = Uint8Array.from([0xca]); +const ek10 = kmac128(kk, data); +const ek11 = kmac256(kk, data); +const ek12 = k12(data); +const ek13 = m14(data); +// pseudo-random generator, first argument is capacity. XKCP recommends 254 bits capacity for 128-bit security strength. +// * with a capacity of 254 bits. +const p = keccakprg(254); +p.feed('test'); +const rand1b = p.fetch(1); +``` + +- Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): + cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants +- [Reduced-round Keccak](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): + - 🦘 K12 aka KangarooTwelve + - M14 aka MarsupilamiFourteen + - TurboSHAKE +- [KeccakPRG](https://keccak.team/files/CSF-0.1.pdf): Pseudo-random generator based on Keccak + +#### blake, blake2, blake3 + +```typescript +import { blake224, blake256, blake384, blake512 } from '@noble/hashes/blake1.js'; +import { blake2b, blake2s } from '@noble/hashes/blake2.js'; +import { blake3 } from '@noble/hashes/blake3.js'; + +for (let hash of [ + blake224, blake256, blake384, blake512, + blake2b, blake2s, blake3 +]) { + const arr = Uint8Array.from([0x10, 0x20, 0x30]); + const a = hash(arr); + const b = hash.create().update(arr).digest(); +} + +// blake2 advanced usage +const ab = Uint8Array.from([0x01]); +blake2s(ab); +blake2s(ab, { key: new Uint8Array(32) }); +blake2s(ab, { personalization: 'pers1234' }); +blake2s(ab, { salt: 'salt1234' }); +blake2b(ab); +blake2b(ab, { key: new Uint8Array(64) }); +blake2b(ab, { personalization: 'pers1234pers1234' }); +blake2b(ab, { salt: 'salt1234salt1234' }); + +// blake3 advanced usage +blake3(ab); +blake3(ab, { dkLen: 256 }); +blake3(ab, { key: new Uint8Array(32) }); +blake3(ab, { context: 'application-name' }); +``` + +- Blake1 is legacy hash, one of SHA3 proposals. It is rarely used anywhere. See [pdf](https://www.aumasson.jp/blake/blake.pdf). +- Blake2 is popular fast hash. blake2b focuses on 64-bit platforms while blake2s is for 8-bit to 32-bit ones. See [RFC 7693](https://datatracker.ietf.org/doc/html/rfc7693), [Website](https://www.blake2.net) +- Blake3 is faster, reduced-round blake2. See [Website & specs](https://blake3.io) + +#### legacy: sha1, md5, ripemd160 + +SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 + +```typescript +import { md5, ripemd160, sha1 } from '@noble/hashes/legacy.js'; +for (let hash of [md5, ripemd160, sha1]) { + const arr = Uint8Array.from([0x10, 0x20, 0x30]); + const a = hash(arr); + const b = hash.create().update(arr).digest(); +} +``` + +#### hmac + +```typescript +import { hmac } from '@noble/hashes/hmac.js'; +import { sha256 } from '@noble/hashes/sha2.js'; +const key = new Uint8Array(32).fill(1); +const msg = new Uint8Array(32).fill(2); +const mac1 = hmac(sha256, key, msg); +const mac2 = hmac.create(sha256, key).update(msg).digest(); +``` + +Matches [RFC 2104](https://datatracker.ietf.org/doc/html/rfc2104). + +#### hkdf + +```typescript +import { hkdf } from '@noble/hashes/hkdf.js'; +import { randomBytes } from '@noble/hashes/utils.js'; +import { sha256 } from '@noble/hashes/sha2.js'; +const inputKey = randomBytes(32); +const salt = randomBytes(32); +const info = 'application-key'; +const hk1 = hkdf(sha256, inputKey, salt, info, 32); + +// == same as +import { extract, expand } from '@noble/hashes/hkdf.js'; +import { sha256 } from '@noble/hashes/sha2.js'; +const prk = extract(sha256, inputKey, salt); +const hk2 = expand(sha256, prk, info, 32); +``` + +Matches [RFC 5869](https://datatracker.ietf.org/doc/html/rfc5869). + +#### pbkdf2 + +```typescript +import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js'; +import { sha256 } from '@noble/hashes/sha2.js'; +const pbkey1 = pbkdf2(sha256, 'password', 'salt', { c: 32, dkLen: 32 }); +const pbkey2 = await pbkdf2Async(sha256, 'password', 'salt', { c: 32, dkLen: 32 }); +const pbkey3 = await pbkdf2Async(sha256, Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { + c: 32, + dkLen: 32, +}); +``` + +Matches [RFC 2898](https://datatracker.ietf.org/doc/html/rfc2898). + +#### scrypt + +```typescript +import { scrypt, scryptAsync } from '@noble/hashes/scrypt.js'; +const scr1 = scrypt('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); +const scr2 = await scryptAsync('password', 'salt', { N: 2 ** 16, r: 8, p: 1, dkLen: 32 }); +const scr3 = await scryptAsync(Uint8Array.from([1, 2, 3]), Uint8Array.from([4, 5, 6]), { + N: 2 ** 17, + r: 8, + p: 1, + dkLen: 32, + onProgress(percentage) { + console.log('progress', percentage); + }, + maxmem: 2 ** 32 + 128 * 8 * 1, // N * r * p * 128 + (128*r*p) +}); +``` + +Conforms to [RFC 7914](https://datatracker.ietf.org/doc/html/rfc7914), +[Website](https://www.tarsnap.com/scrypt.html) + +- `N, r, p` are work factors. To understand them, see [the blog post](https://blog.filippo.io/the-scrypt-parameters/). + `r: 8, p: 1` are common. JS doesn't support parallelization, making increasing p meaningless. +- `dkLen` is the length of output bytes e.g. `32` or `64` +- `onProgress` can be used with async version of the function to report progress to a user. +- `maxmem` prevents DoS and is limited to `1GB + 1KB` (`2**30 + 2**10`), but can be adjusted using formula: `N * r * p * 128 + (128 * r * p)` + +Time it takes to derive Scrypt key under different values of N (2\*\*N) on Apple M4 (mobile phones can be 1x-4x slower): + +| N pow | Time | RAM | +| ----- | ---- | ----- | +| 16 | 0.1s | 64MB | +| 17 | 0.2s | 128MB | +| 18 | 0.4s | 256MB | +| 19 | 0.8s | 512MB | +| 20 | 1.5s | 1GB | +| 21 | 3.1s | 2GB | +| 22 | 6.2s | 4GB | +| 23 | 13s | 8GB | +| 24 | 27s | 16GB | + +> [!NOTE] +> We support N larger than `2**20` where available, however, +> not all JS engines support >= 2GB ArrayBuffer-s. +> When using such N, you'll need to manually adjust `maxmem`, using formula above. +> Other JS implementations don't support large N-s. + +#### argon2 + +```ts +import { argon2d, argon2i, argon2id } from '@noble/hashes/argon2.js'; +const arg1 = argon2id('password', 'saltsalt', { t: 2, m: 65536, p: 1, maxmem: 2 ** 32 - 1 }); +``` + +Argon2 [RFC 9106](https://datatracker.ietf.org/doc/html/rfc9106) implementation. + +> [!WARNING] +> Argon2 can't be fast in JS, because there is no fast Uint64Array. +> It is suggested to use [Scrypt](#scrypt) instead. +> Being 5x slower than native code means brute-forcing attackers have bigger advantage. + +#### utils + +```typescript +import { bytesToHex as toHex, randomBytes } from '@noble/hashes/utils'; +console.log(toHex(randomBytes(32))); +``` + +- `bytesToHex` will convert `Uint8Array` to a hex string +- `randomBytes(bytes)` will produce cryptographically secure random `Uint8Array` of length `bytes` + +## Security + +The library has been independently audited: + +- at version 1.0.0, in Jan 2022, by [Cure53](https://cure53.de) + - PDFs: [website](https://cure53.de/pentest-report_hashing-libs.pdf), [in-repo](./audit/2022-01-05-cure53-audit-nbl2.pdf) + - [Changes since audit](https://github.com/paulmillr/noble-hashes/compare/1.0.0..main). + - Scope: everything, besides `blake3`, `sha3-addons`, `sha1` and `argon2`, which have not been audited + - The audit has been funded by [Ethereum Foundation](https://ethereum.org/en/) with help of [Nomic Labs](https://nomiclabs.io) + +It is tested against property-based, cross-library and Wycheproof vectors, +and is being fuzzed in [the separate repo](https://github.com/paulmillr/fuzzing). + +If you see anything unusual: investigate and report. + +### Constant-timeness + +We're targetting algorithmic constant time. _JIT-compiler_ and _Garbage Collector_ make "constant time" +extremely hard to achieve [timing attack](https://en.wikipedia.org/wiki/Timing_attack) resistance +in a scripting language. Which means _any other JS library can't have +constant-timeness_. Even statically typed Rust, a language without GC, +[makes it harder to achieve constant-time](https://www.chosenplaintext.ca/open-source/rust-timing-shield/security) +for some cases. If your goal is absolute security, don't use any JS lib — including bindings to native ones. +Use low-level libraries & languages. + +### Memory dumping + +The library shares state buffers between hash +function calls. The buffers are zeroed-out after each call. However, if an attacker +can read application memory, you are doomed in any case: + +- At some point, input will be a string and strings are immutable in JS: + there is no way to overwrite them with zeros. For example: deriving + key from `scrypt(password, salt)` where password and salt are strings +- Input from a file will stay in file buffers +- Input / output will be re-used multiple times in application which means it could stay in memory +- `await anything()` will always write all internal variables (including numbers) + to memory. With async functions / Promises there are no guarantees when the code + chunk would be executed. Which means attacker can have plenty of time to read data from memory +- There is no way to guarantee anything about zeroing sensitive data without + complex tests-suite which will dump process memory and verify that there is + no sensitive data left. For JS it means testing all browsers (incl. mobile), + which is complex. And of course it will be useless without using the same + test-suite in the actual application that consumes the library + +### Supply chain security + +- **Commits** are signed with PGP keys, to prevent forgery. Make sure to verify commit signatures +- **Releases** are transparent and built on GitHub CI. Make sure to verify [provenance](https://docs.npmjs.com/generating-provenance-statements) logs + - Use GitHub CLI to verify single-file builds: + `gh attestation verify --owner paulmillr noble-hashes.js` +- **Rare releasing** is followed to ensure less re-audit need for end-users +- **Dependencies** are minimized and locked-down: any dependency could get hacked and users will be downloading malware with every install. + - We make sure to use as few dependencies as possible + - Automatic dep updates are prevented by locking-down version ranges; diffs are checked with `npm-diff` +- **Dev Dependencies** are disabled for end-users; they are only used to develop / build the source code + +For this package, there are 0 dependencies; and a few dev dependencies: + +- micro-bmark, micro-should and jsbt are used for benchmarking / testing / build tooling and developed by the same author +- prettier, fast-check and typescript are used for code quality / test generation / ts compilation. It's hard to audit their source code thoroughly and fully because of their size + +### Randomness + +We're deferring to built-in +[crypto.getRandomValues](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) +which is considered cryptographically secure (CSPRNG). + +In the past, browsers had bugs that made it weak: it may happen again. +Implementing a userspace CSPRNG to get resilient to the weakness +is even worse: there is no reliable userspace source of quality entropy. + +### Quantum computers + +Cryptographically relevant quantum computer, if built, will allow to +utilize Grover's algorithm to break hashes in 2^n/2 operations, instead of 2^n. + +This means SHA256 should be replaced with SHA512, SHA3-256 with SHA3-512, SHAKE128 with SHAKE256 etc. + +Australian ASD prohibits SHA256 and similar hashes [after 2030](https://www.cyber.gov.au/resources-business-and-government/essential-cyber-security/ism/cyber-security-guidelines/guidelines-cryptography). + +## Speed + +```sh +npm run bench:install && npm run bench +``` + +Benchmarks measured on Apple M4. + +``` +# 32B +sha256 x 1,968,503 ops/sec @ 508ns/op +sha512 x 740,740 ops/sec @ 1μs/op +sha3_256 x 287,686 ops/sec @ 3μs/op +sha3_512 x 288,267 ops/sec @ 3μs/op +k12 x 476,190 ops/sec @ 2μs/op +m14 x 423,190 ops/sec @ 2μs/op +blake2b x 464,252 ops/sec @ 2μs/op +blake2s x 766,871 ops/sec @ 1μs/op +blake3 x 879,507 ops/sec @ 1μs/op + +# 1MB +sha256 x 331 ops/sec @ 3ms/op +sha512 x 129 ops/sec @ 7ms/op +sha3_256 x 38 ops/sec @ 25ms/op +sha3_512 x 20 ops/sec @ 47ms/op +k12 x 88 ops/sec @ 11ms/op +m14 x 62 ops/sec @ 15ms/op +blake2b x 69 ops/sec @ 14ms/op +blake2s x 57 ops/sec @ 17ms/op +blake3 x 72 ops/sec @ 13ms/op + +# MAC +hmac(sha256) x 599,880 ops/sec @ 1μs/op +hmac(sha512) x 197,122 ops/sec @ 5μs/op +kmac256 x 87,981 ops/sec @ 11μs/op +blake3(key) x 796,812 ops/sec @ 1μs/op + +# KDF +hkdf(sha256) x 259,942 ops/sec @ 3μs/op +blake3(context) x 424,808 ops/sec @ 2μs/op +pbkdf2(sha256, c: 2 ** 18) x 5 ops/sec @ 197ms/op +pbkdf2(sha512, c: 2 ** 18) x 1 ops/sec @ 630ms/op +scrypt(n: 2 ** 18, r: 8, p: 1) x 2 ops/sec @ 400ms/op +argon2id(t: 1, m: 256MB) 2881ms +``` + +Compare to native node.js implementation that uses C bindings instead of pure-js code: + +``` +# native (node) 32B +sha256 x 2,267,573 ops/sec +sha512 x 983,284 ops/sec +sha3_256 x 1,522,070 ops/sec +blake2b x 1,512,859 ops/sec +blake2s x 1,821,493 ops/sec +hmac(sha256) x 1,085,776 ops/sec +hkdf(sha256) x 312,109 ops/sec +# native (node) KDF +pbkdf2(sha256, c: 2 ** 18) x 5 ops/sec @ 197ms/op +pbkdf2(sha512, c: 2 ** 18) x 1 ops/sec @ 630ms/op +scrypt(n: 2 ** 18, r: 8, p: 1) x 2 ops/sec @ 378ms/op +``` + +It is possible to [make this library 4x+ faster](./benchmark/README.md) by +_doing code generation of full loop unrolls_. We've decided against it. Reasons: + +- the library must be auditable, with minimum amount of code, and zero dependencies +- most method invocations with the lib are going to be something like hashing 32b to 64kb of data +- hashing big inputs is 10x faster with low-level languages, which means you should probably pick 'em instead + +The current performance is good enough when compared to other projects; SHA256 takes only 900 nanoseconds to run. + +## Contributing & testing + +`test/misc` directory contains implementations of loop unrolling and md5. + +- `npm install && npm run build && npm test` will build the code and run tests. +- `npm run lint` / `npm run format` will run linter / fix linter issues. +- `npm run bench` will run benchmarks, which may need their deps first (`npm run bench:install`) +- `npm run build:release` will build single file +- There is **additional** 20-min DoS test `npm run test:dos` and 2-hour "big" multicore test `npm run test:big`. + See [our approach to testing](./test/README.md) + +Additional resources: + +- NTT hashes are outside of scope of the library. You can view some of them in different repos: + - [Pedersen in micro-zk-proofs](https://github.com/paulmillr/micro-zk-proofs/blob/1ed5ce1253583b2e540eef7f3477fb52bf5344ff/src/pedersen.ts) + - [Poseidon in noble-curves](https://github.com/paulmillr/noble-curves/blob/3d124dd3ecec8b6634cc0b2ba1c183aded5304f9/src/abstract/poseidon.ts) +- Check out [guidelines](https://github.com/paulmillr/guidelines) for coding practices +- See [paulmillr.com/noble](https://paulmillr.com/noble/) for useful resources, articles, documentation and demos +related to the library. + +## License + +The MIT License (MIT) + +Copyright (c) 2022 Paul Miller [(https://paulmillr.com)](https://paulmillr.com) + +See LICENSE file. diff --git a/node_modules/@noble/hashes/_assert.d.ts b/node_modules/@noble/hashes/_assert.d.ts new file mode 100644 index 0000000..5d62f87 --- /dev/null +++ b/node_modules/@noble/hashes/_assert.d.ts @@ -0,0 +1,17 @@ +/** + * Internal assertion helpers. + * @module + * @deprecated + */ +import { abytes as ab, aexists as ae, anumber as an, aoutput as ao, type IHash as H } from './utils.ts'; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const abytes: typeof ab; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const aexists: typeof ae; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const anumber: typeof an; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const aoutput: typeof ao; +/** @deprecated Use import from `noble/hashes/utils` module */ +export type Hash = H; +//# sourceMappingURL=_assert.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_assert.d.ts.map b/node_modules/@noble/hashes/_assert.d.ts.map new file mode 100644 index 0000000..0ba0e4c --- /dev/null +++ b/node_modules/@noble/hashes/_assert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_assert.d.ts","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,KAAK,KAAK,IAAI,CAAC,EAChB,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/_assert.js b/node_modules/@noble/hashes/_assert.js new file mode 100644 index 0000000..b54da64 --- /dev/null +++ b/node_modules/@noble/hashes/_assert.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.aoutput = exports.anumber = exports.aexists = exports.abytes = void 0; +/** + * Internal assertion helpers. + * @module + * @deprecated + */ +const utils_ts_1 = require("./utils.js"); +/** @deprecated Use import from `noble/hashes/utils` module */ +exports.abytes = utils_ts_1.abytes; +/** @deprecated Use import from `noble/hashes/utils` module */ +exports.aexists = utils_ts_1.aexists; +/** @deprecated Use import from `noble/hashes/utils` module */ +exports.anumber = utils_ts_1.anumber; +/** @deprecated Use import from `noble/hashes/utils` module */ +exports.aoutput = utils_ts_1.aoutput; +//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_assert.js.map b/node_modules/@noble/hashes/_assert.js.map new file mode 100644 index 0000000..caf8b65 --- /dev/null +++ b/node_modules/@noble/hashes/_assert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_assert.js","sourceRoot":"","sources":["src/_assert.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,yCAMoB;AACpB,8DAA8D;AACjD,QAAA,MAAM,GAAc,iBAAE,CAAC;AACpC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC;AACrC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC;AACrC,8DAA8D;AACjD,QAAA,OAAO,GAAc,kBAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/_blake.d.ts b/node_modules/@noble/hashes/_blake.d.ts new file mode 100644 index 0000000..71ed85f --- /dev/null +++ b/node_modules/@noble/hashes/_blake.d.ts @@ -0,0 +1,14 @@ +/** + * Internal blake variable. + * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. + */ +export declare const BSIGMA: Uint8Array; +export type Num4 = { + a: number; + b: number; + c: number; + d: number; +}; +export declare function G1s(a: number, b: number, c: number, d: number, x: number): Num4; +export declare function G2s(a: number, b: number, c: number, d: number, x: number): Num4; +//# sourceMappingURL=_blake.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_blake.d.ts.map b/node_modules/@noble/hashes/_blake.d.ts.map new file mode 100644 index 0000000..7b11ac1 --- /dev/null +++ b/node_modules/@noble/hashes/_blake.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_blake.d.ts","sourceRoot":"","sources":["src/_blake.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,eAAO,MAAM,MAAM,EAAE,UAkBnB,CAAC;AAGH,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;CAAE,CAAC;AAGnE,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/_blake.js b/node_modules/@noble/hashes/_blake.js new file mode 100644 index 0000000..a0b2cb1 --- /dev/null +++ b/node_modules/@noble/hashes/_blake.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSIGMA = void 0; +exports.G1s = G1s; +exports.G2s = G2s; +/** + * Internal helpers for blake hash. + * @module + */ +const utils_ts_1 = require("./utils.js"); +/** + * Internal blake variable. + * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. + */ +// prettier-ignore +exports.BSIGMA = Uint8Array.from([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, + 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, + 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, + 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, + 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, + 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, + 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, + 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, + 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, + // Blake1, unused in others + 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, + 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, + 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, + 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, +]); +// Mixing function G splitted in two halfs +function G1s(a, b, c, d, x) { + a = (a + b + x) | 0; + d = (0, utils_ts_1.rotr)(d ^ a, 16); + c = (c + d) | 0; + b = (0, utils_ts_1.rotr)(b ^ c, 12); + return { a, b, c, d }; +} +function G2s(a, b, c, d, x) { + a = (a + b + x) | 0; + d = (0, utils_ts_1.rotr)(d ^ a, 8); + c = (c + d) | 0; + b = (0, utils_ts_1.rotr)(b ^ c, 7); + return { a, b, c, d }; +} +//# sourceMappingURL=_blake.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_blake.js.map b/node_modules/@noble/hashes/_blake.js.map new file mode 100644 index 0000000..b081eb6 --- /dev/null +++ b/node_modules/@noble/hashes/_blake.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_blake.js","sourceRoot":"","sources":["src/_blake.ts"],"names":[],"mappings":";;;AAmCA,kBAMC;AAED,kBAMC;AAjDD;;;GAGG;AACH,yCAAkC;AAElC;;;GAGG;AACH,kBAAkB;AACL,QAAA,MAAM,GAA+B,UAAU,CAAC,IAAI,CAAC;IAChE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IACpD,EAAE,EAAE,EAAE,EA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AA,eAAI,EAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/_md.d.ts b/node_modules/@noble/hashes/_md.d.ts new file mode 100644 index 0000000..ae184df --- /dev/null +++ b/node_modules/@noble/hashes/_md.d.ts @@ -0,0 +1,51 @@ +/** + * Internal Merkle-Damgard hash utils. + * @module + */ +import { type Input, Hash } from './utils.ts'; +/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ +export declare function setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void; +/** Choice: a ? b : c */ +export declare function Chi(a: number, b: number, c: number): number; +/** Majority function, true if any two inputs is true. */ +export declare function Maj(a: number, b: number, c: number): number; +/** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + */ +export declare abstract class HashMD> extends Hash { + protected abstract process(buf: DataView, offset: number): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + abstract destroy(): void; + protected abstract roundClean(): void; + readonly blockLen: number; + readonly outputLen: number; + readonly padOffset: number; + readonly isLE: boolean; + protected buffer: Uint8Array; + protected view: DataView; + protected finished: boolean; + protected length: number; + protected pos: number; + protected destroyed: boolean; + constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean); + update(data: Input): this; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; + _cloneInto(to?: T): T; + clone(): T; +} +/** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ +/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ +export declare const SHA256_IV: Uint32Array; +/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ +export declare const SHA224_IV: Uint32Array; +/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ +export declare const SHA384_IV: Uint32Array; +/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ +export declare const SHA512_IV: Uint32Array; +//# sourceMappingURL=_md.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_md.d.ts.map b/node_modules/@noble/hashes/_md.d.ts.map new file mode 100644 index 0000000..0f653d1 --- /dev/null +++ b/node_modules/@noble/hashes/_md.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_md.d.ts","sourceRoot":"","sources":["src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,IAAI,EAAwD,MAAM,YAAY,CAAC;AAEpG,gGAAgG;AAChG,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,GACZ,IAAI,CAUN;AAED,wBAAwB;AACxB,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,yDAAyD;AACzD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IAC/D,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAC/D,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAC/C,QAAQ,CAAC,OAAO,IAAI,IAAI;IACxB,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI;IAErC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAGvB,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC;IACzB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,SAAS,UAAS;gBAEhB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IASjF,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IA0BzB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IAkCjC,MAAM,IAAI,UAAU;IAOpB,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC;IAWrB,KAAK,IAAI,CAAC;CAGX;AAED;;;GAGG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,SAAS,EAAE,WAEtB,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,SAAS,EAAE,WAEtB,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,WAGtB,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,SAAS,EAAE,WAGtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/_md.js b/node_modules/@noble/hashes/_md.js new file mode 100644 index 0000000..53047f3 --- /dev/null +++ b/node_modules/@noble/hashes/_md.js @@ -0,0 +1,162 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SHA512_IV = exports.SHA384_IV = exports.SHA224_IV = exports.SHA256_IV = exports.HashMD = void 0; +exports.setBigUint64 = setBigUint64; +exports.Chi = Chi; +exports.Maj = Maj; +/** + * Internal Merkle-Damgard hash utils. + * @module + */ +const utils_ts_1 = require("./utils.js"); +/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ +function setBigUint64(view, byteOffset, value, isLE) { + if (typeof view.setBigUint64 === 'function') + return view.setBigUint64(byteOffset, value, isLE); + const _32n = BigInt(32); + const _u32_max = BigInt(0xffffffff); + const wh = Number((value >> _32n) & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE ? 4 : 0; + const l = isLE ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE); + view.setUint32(byteOffset + l, wl, isLE); +} +/** Choice: a ? b : c */ +function Chi(a, b, c) { + return (a & b) ^ (~a & c); +} +/** Majority function, true if any two inputs is true. */ +function Maj(a, b, c) { + return (a & b) ^ (a & c) ^ (b & c); +} +/** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + */ +class HashMD extends utils_ts_1.Hash { + constructor(blockLen, outputLen, padOffset, isLE) { + super(); + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE; + this.buffer = new Uint8Array(blockLen); + this.view = (0, utils_ts_1.createView)(this.buffer); + } + update(data) { + (0, utils_ts_1.aexists)(this); + data = (0, utils_ts_1.toBytes)(data); + (0, utils_ts_1.abytes)(data); + const { view, buffer, blockLen } = this; + const len = data.length; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path: we have at least one block in input, cast it to view and process + if (take === blockLen) { + const dataView = (0, utils_ts_1.createView)(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + (0, utils_ts_1.aexists)(this); + (0, utils_ts_1.aoutput)(out, this); + this.finished = true; + // Padding + // We can avoid allocation of buffer for padding completely if it + // was previously not allocated here. But it won't change performance. + const { buffer, view, blockLen, isLE } = this; + let { pos } = this; + // append the bit '1' to the message + buffer[pos++] = 0b10000000; + (0, utils_ts_1.clean)(this.buffer.subarray(pos)); + // we have less than padOffset left in buffer, so we cannot put length in + // current block, need process it and pad again + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + // Pad until full block byte with zeros + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that + // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. + // So we just write lowest 64 bits of that value. + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); + this.process(view, 0); + const oview = (0, utils_ts_1.createView)(out); + const len = this.outputLen; + // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT + if (len % 4) + throw new Error('_sha2: outputLen should be aligned to 32bit'); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error('_sha2: outputLen bigger than state'); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } + clone() { + return this._cloneInto(); + } +} +exports.HashMD = HashMD; +/** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ +/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ +exports.SHA256_IV = Uint32Array.from([ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, +]); +/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ +exports.SHA224_IV = Uint32Array.from([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, +]); +/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ +exports.SHA384_IV = Uint32Array.from([ + 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, + 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, +]); +/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ +exports.SHA512_IV = Uint32Array.from([ + 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, +]); +//# sourceMappingURL=_md.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_md.js.map b/node_modules/@noble/hashes/_md.js.map new file mode 100644 index 0000000..07270e0 --- /dev/null +++ b/node_modules/@noble/hashes/_md.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_md.js","sourceRoot":"","sources":["src/_md.ts"],"names":[],"mappings":";;;AAOA,oCAeC;AAGD,kBAEC;AAGD,kBAEC;AAhCD;;;GAGG;AACH,yCAAoG;AAEpG,gGAAgG;AAChG,SAAgB,YAAY,CAC1B,IAAc,EACd,UAAkB,EAClB,KAAa,EACb,IAAa;IAEb,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,UAAU;QAAE,OAAO,IAAI,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AAS,GAAgC,WAAW,CAAC,IAAI,CAAC;IACrE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/_u64.d.ts b/node_modules/@noble/hashes/_u64.d.ts new file mode 100644 index 0000000..ac5523a --- /dev/null +++ b/node_modules/@noble/hashes/_u64.d.ts @@ -0,0 +1,55 @@ +declare function fromBig(n: bigint, le?: boolean): { + h: number; + l: number; +}; +declare function split(lst: bigint[], le?: boolean): Uint32Array[]; +declare const toBig: (h: number, l: number) => bigint; +declare const shrSH: (h: number, _l: number, s: number) => number; +declare const shrSL: (h: number, l: number, s: number) => number; +declare const rotrSH: (h: number, l: number, s: number) => number; +declare const rotrSL: (h: number, l: number, s: number) => number; +declare const rotrBH: (h: number, l: number, s: number) => number; +declare const rotrBL: (h: number, l: number, s: number) => number; +declare const rotr32H: (_h: number, l: number) => number; +declare const rotr32L: (h: number, _l: number) => number; +declare const rotlSH: (h: number, l: number, s: number) => number; +declare const rotlSL: (h: number, l: number, s: number) => number; +declare const rotlBH: (h: number, l: number, s: number) => number; +declare const rotlBL: (h: number, l: number, s: number) => number; +declare function add(Ah: number, Al: number, Bh: number, Bl: number): { + h: number; + l: number; +}; +declare const add3L: (Al: number, Bl: number, Cl: number) => number; +declare const add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; +declare const add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; +declare const add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; +declare const add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; +declare const add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; +export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; +declare const u64: { + fromBig: typeof fromBig; + split: typeof split; + toBig: (h: number, l: number) => bigint; + shrSH: (h: number, _l: number, s: number) => number; + shrSL: (h: number, l: number, s: number) => number; + rotrSH: (h: number, l: number, s: number) => number; + rotrSL: (h: number, l: number, s: number) => number; + rotrBH: (h: number, l: number, s: number) => number; + rotrBL: (h: number, l: number, s: number) => number; + rotr32H: (_h: number, l: number) => number; + rotr32L: (h: number, _l: number) => number; + rotlSH: (h: number, l: number, s: number) => number; + rotlSL: (h: number, l: number, s: number) => number; + rotlBH: (h: number, l: number, s: number) => number; + rotlBL: (h: number, l: number, s: number) => number; + add: typeof add; + add3L: (Al: number, Bl: number, Cl: number) => number; + add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; + add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; + add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; + add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; + add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; +}; +export default u64; +//# sourceMappingURL=_u64.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_u64.d.ts.map b/node_modules/@noble/hashes/_u64.d.ts.map new file mode 100644 index 0000000..211a4c6 --- /dev/null +++ b/node_modules/@noble/hashes/_u64.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_u64.d.ts","sourceRoot":"","sources":["src/_u64.ts"],"names":[],"mappings":"AAQA,iBAAS,OAAO,CACd,CAAC,EAAE,MAAM,EACT,EAAE,UAAQ,GACT;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAGA;AAED,iBAAS,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,UAAQ,GAAG,WAAW,EAAE,CASvD;AAED,QAAA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EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,GAAG,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAOrpC,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/_u64.js b/node_modules/@noble/hashes/_u64.js new file mode 100644 index 0000000..3232f4d --- /dev/null +++ b/node_modules/@noble/hashes/_u64.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.toBig = exports.shrSL = exports.shrSH = exports.rotrSL = exports.rotrSH = exports.rotrBL = exports.rotrBH = exports.rotr32L = exports.rotr32H = exports.rotlSL = exports.rotlSH = exports.rotlBL = exports.rotlBH = exports.add5L = exports.add5H = exports.add4L = exports.add4H = exports.add3L = exports.add3H = void 0; +exports.add = add; +exports.fromBig = fromBig; +exports.split = split; +/** + * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. + * @todo re-check https://issues.chromium.org/issues/42212588 + * @module + */ +const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); +const _32n = /* @__PURE__ */ BigInt(32); +function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; + return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; +} +function split(lst, le = false) { + const len = lst.length; + let Ah = new Uint32Array(len); + let Al = new Uint32Array(len); + for (let i = 0; i < len; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; +} +const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); +exports.toBig = toBig; +// for Shift in [0, 32) +const shrSH = (h, _l, s) => h >>> s; +exports.shrSH = shrSH; +const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +exports.shrSL = shrSL; +// Right rotate for Shift in [1, 32) +const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); +exports.rotrSH = rotrSH; +const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +exports.rotrSL = rotrSL; +// Right rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); +exports.rotrBH = rotrBH; +const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); +exports.rotrBL = rotrBL; +// Right rotate for shift===32 (just swaps l&h) +const rotr32H = (_h, l) => l; +exports.rotr32H = rotr32H; +const rotr32L = (h, _l) => h; +exports.rotr32L = rotr32L; +// Left rotate for Shift in [1, 32) +const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); +exports.rotlSH = rotlSH; +const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); +exports.rotlSL = rotlSL; +// Left rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); +exports.rotlBH = rotlBH; +const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); +exports.rotlBL = rotlBL; +// JS uses 32-bit signed integers for bitwise operations which means we cannot +// simple take carry out of low bit sum by shift, we need to use division. +function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; +} +// Addition with more than 2 elements +const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +exports.add3L = add3L; +const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; +exports.add3H = add3H; +const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +exports.add4L = add4L; +const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; +exports.add4H = add4H; +const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +exports.add5L = add5L; +const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; +exports.add5H = add5H; +// prettier-ignore +const u64 = { + fromBig, split, toBig, + shrSH, shrSL, + rotrSH, rotrSL, rotrBH, rotrBL, + rotr32H, rotr32L, + rotlSH, rotlSL, rotlBH, rotlBL, + add, add3L, add3H, add4L, add4H, add5H, add5L, +}; +exports.default = u64; +//# sourceMappingURL=_u64.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/_u64.js.map b/node_modules/@noble/hashes/_u64.js.map new file mode 100644 index 0000000..49ffb25 --- /dev/null +++ b/node_modules/@noble/hashes/_u64.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_u64.js","sourceRoot":"","sources":["src/_u64.ts"],"names":[],"mappings":";;;AA+EE,kBAAG;AAA4C,0BAAO;AAAkG,sBAAK;AA/E/J;;;;GAIG;AACH,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;AACvD,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,SAAS,OAAO,CACd,CAAS,EACT,EAAE,GAAG,KAAK;IAKV,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;AACpF,CAAC;AAED,SAAS,KAAK,CAAC,GAAa,EAAE,EAAE,GAAG,KAAK;IACtC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAA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AE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAC9C,CAAC;AACF,kBAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/argon2.d.ts b/node_modules/@noble/hashes/argon2.d.ts new file mode 100644 index 0000000..67cb8f6 --- /dev/null +++ b/node_modules/@noble/hashes/argon2.d.ts @@ -0,0 +1,32 @@ +import { type KDFInput } from './utils.ts'; +/** + * Argon2 options. + * * t: time cost, m: mem cost in kb, p: parallelization. + * * key: optional key. personalization: arbitrary extra data. + * * dkLen: desired number of output bytes. + */ +export type ArgonOpts = { + t: number; + m: number; + p: number; + version?: number; + key?: KDFInput; + personalization?: KDFInput; + dkLen?: number; + asyncTick?: number; + maxmem?: number; + onProgress?: (progress: number) => void; +}; +/** argon2d GPU-resistant version. */ +export declare const argon2d: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; +/** argon2i side-channel-resistant version. */ +export declare const argon2i: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; +/** argon2id, combining i+d, the most popular version from RFC 9106 */ +export declare const argon2id: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; +/** argon2d async GPU-resistant version. */ +export declare const argon2dAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; +/** argon2i async side-channel-resistant version. */ +export declare const argon2iAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; +/** argon2id async, combining i+d, the most popular version from RFC 9106 */ +export declare const argon2idAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; +//# sourceMappingURL=argon2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/argon2.d.ts.map b/node_modules/@noble/hashes/argon2.d.ts.map new file mode 100644 index 0000000..0928c34 --- /dev/null +++ b/node_modules/@noble/hashes/argon2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"argon2.d.ts","sourceRoot":"","sources":["src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,UAAU,CAAmD,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/argon2.js b/node_modules/@noble/hashes/argon2.js new file mode 100644 index 0000000..44488ac --- /dev/null +++ b/node_modules/@noble/hashes/argon2.js @@ -0,0 +1,401 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.argon2idAsync = exports.argon2iAsync = exports.argon2dAsync = exports.argon2id = exports.argon2i = exports.argon2d = void 0; +/** + * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. + * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: + * * argon uses uint64, but JS doesn't have fast uint64array + * * uint64 multiplication is 1/3 of time + * * `P` function would be very nice with u64, because most of value will be in registers, + * hovewer with u32 it will require 32 registers, which is too much. + * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down + * @module + */ +const _u64_ts_1 = require("./_u64.js"); +const blake2_ts_1 = require("./blake2.js"); +const utils_ts_1 = require("./utils.js"); +const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 }; +const ARGON2_SYNC_POINTS = 4; +const abytesOrZero = (buf) => { + if (buf === undefined) + return Uint8Array.of(); + return (0, utils_ts_1.kdfInputToBytes)(buf); +}; +// u32 * u32 = u64 +function mul(a, b) { + const aL = a & 0xffff; + const aH = a >>> 16; + const bL = b & 0xffff; + const bH = b >>> 16; + const ll = Math.imul(aL, bL); + const hl = Math.imul(aH, bL); + const lh = Math.imul(aL, bH); + const hh = Math.imul(aH, bH); + const carry = (ll >>> 16) + (hl & 0xffff) + lh; + const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; + const low = (carry << 16) | (ll & 0xffff); + return { h: high, l: low }; +} +function mul2(a, b) { + // 2 * a * b (via shifts) + const { h, l } = mul(a, b); + return { h: ((h << 1) | (l >>> 31)) & 4294967295, l: (l << 1) & 4294967295 }; +} +// BlaMka permutation for Argon2 +// A + B + (2 * u32(A) * u32(B)) +function blamka(Ah, Al, Bh, Bl) { + const { h: Ch, l: Cl } = mul2(Al, Bl); + // A + B + (2 * A * B) + const Rll = (0, _u64_ts_1.add3L)(Al, Bl, Cl); + return { h: (0, _u64_ts_1.add3H)(Rll, Ah, Bh, Ch), l: Rll | 0 }; +} +// Temporary block buffer +const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) +function G(a, b, c, d) { + let Al = A2_BUF[2 * a], Ah = A2_BUF[2 * a + 1]; // prettier-ignore + let Bl = A2_BUF[2 * b], Bh = A2_BUF[2 * b + 1]; // prettier-ignore + let Cl = A2_BUF[2 * c], Ch = A2_BUF[2 * c + 1]; // prettier-ignore + let Dl = A2_BUF[2 * d], Dh = A2_BUF[2 * d + 1]; // prettier-ignore + ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: (0, _u64_ts_1.rotr32H)(Dh, Dl), Dl: (0, _u64_ts_1.rotr32L)(Dh, Dl) }); + ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: (0, _u64_ts_1.rotrSH)(Bh, Bl, 24), Bl: (0, _u64_ts_1.rotrSL)(Bh, Bl, 24) }); + ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: (0, _u64_ts_1.rotrSH)(Dh, Dl, 16), Dl: (0, _u64_ts_1.rotrSL)(Dh, Dl, 16) }); + ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: (0, _u64_ts_1.rotrBH)(Bh, Bl, 63), Bl: (0, _u64_ts_1.rotrBL)(Bh, Bl, 63) }); + (A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah); + (A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh); + (A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch); + (A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh); +} +// prettier-ignore +function P(v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11, v12, v13, v14, v15) { + G(v00, v04, v08, v12); + G(v01, v05, v09, v13); + G(v02, v06, v10, v14); + G(v03, v07, v11, v15); + G(v00, v05, v10, v15); + G(v01, v06, v11, v12); + G(v02, v07, v08, v13); + G(v03, v04, v09, v14); +} +function block(x, xPos, yPos, outPos, needXor) { + for (let i = 0; i < 256; i++) + A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; + // columns (8) + for (let i = 0; i < 128; i += 16) { + // prettier-ignore + P(i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15); + } + // rows (8) + for (let i = 0; i < 16; i += 2) { + // prettier-ignore + P(i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113); + } + if (needXor) + for (let i = 0; i < 256; i++) + x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; + else + for (let i = 0; i < 256; i++) + x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; + (0, utils_ts_1.clean)(A2_BUF); +} +// Variable-Length Hash Function H' +function Hp(A, dkLen) { + const A8 = (0, utils_ts_1.u8)(A); + const T = new Uint32Array(1); + const T8 = (0, utils_ts_1.u8)(T); + T[0] = dkLen; + // Fast path + if (dkLen <= 64) + return blake2_ts_1.blake2b.create({ dkLen }).update(T8).update(A8).digest(); + const out = new Uint8Array(dkLen); + let V = blake2_ts_1.blake2b.create({}).update(T8).update(A8).digest(); + let pos = 0; + // First block + out.set(V.subarray(0, 32)); + pos += 32; + // Rest blocks + for (; dkLen - pos > 64; pos += 32) { + const Vh = blake2_ts_1.blake2b.create({}).update(V); + Vh.digestInto(V); + Vh.destroy(); + out.set(V.subarray(0, 32), pos); + } + // Last block + out.set((0, blake2_ts_1.blake2b)(V, { dkLen: dkLen - pos }), pos); + (0, utils_ts_1.clean)(V, T); + return (0, utils_ts_1.u32)(out); +} +// Used only inside process block! +function indexAlpha(r, s, laneLen, segmentLen, index, randL, sameLane = false) { + // This is ugly, but close enough to reference implementation. + let area; + if (r === 0) { + if (s === 0) + area = index - 1; + else if (sameLane) + area = s * segmentLen + index - 1; + else + area = s * segmentLen + (index == 0 ? -1 : 0); + } + else if (sameLane) + area = laneLen - segmentLen + index - 1; + else + area = laneLen - segmentLen + (index == 0 ? -1 : 0); + const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; + const rel = area - 1 - mul(area, mul(randL, randL).h).h; + return (startPos + rel) % laneLen; +} +const maxUint32 = Math.pow(2, 32); +function isU32(num) { + return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; +} +function argon2Opts(opts) { + const merged = { + version: 0x13, + dkLen: 32, + maxmem: maxUint32 - 1, + asyncTick: 10, + }; + for (let [k, v] of Object.entries(opts)) + if (v != null) + merged[k] = v; + const { dkLen, p, m, t, version, onProgress } = merged; + if (!isU32(dkLen) || dkLen < 4) + throw new Error('dkLen should be at least 4 bytes'); + if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) + throw new Error('p should be 1 <= p < 2^24'); + if (!isU32(m)) + throw new Error('m should be 0 <= m < 2^32'); + if (!isU32(t) || t < 1) + throw new Error('t (iterations) should be 1 <= t < 2^32'); + if (onProgress !== undefined && typeof onProgress !== 'function') + throw new Error('progressCb should be function'); + /* + Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. + */ + if (!isU32(m) || m < 8 * p) + throw new Error('memory should be at least 8*p bytes'); + if (version !== 0x10 && version !== 0x13) + throw new Error('unknown version=' + version); + return merged; +} +function argon2Init(password, salt, type, opts) { + password = (0, utils_ts_1.kdfInputToBytes)(password); + salt = (0, utils_ts_1.kdfInputToBytes)(salt); + (0, utils_ts_1.abytes)(password); + (0, utils_ts_1.abytes)(salt); + if (!isU32(password.length)) + throw new Error('password should be less than 4 GB'); + if (!isU32(salt.length) || salt.length < 8) + throw new Error('salt should be at least 8 bytes and less than 4 GB'); + if (!Object.values(AT).includes(type)) + throw new Error('invalid type'); + let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = argon2Opts(opts); + // Validation + key = abytesOrZero(key); + personalization = abytesOrZero(personalization); + // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || + // LE32(v) || LE32(y) || LE32(length(P)) || P || + // LE32(length(S)) || S || LE32(length(K)) || K || + // LE32(length(X)) || X) + const h = blake2_ts_1.blake2b.create({}); + const BUF = new Uint32Array(1); + const BUF8 = (0, utils_ts_1.u8)(BUF); + for (let item of [p, dkLen, m, t, version, type]) { + BUF[0] = item; + h.update(BUF8); + } + for (let i of [password, salt, key, personalization]) { + BUF[0] = i.length; // BUF is u32 array, this is valid + h.update(BUF8).update(i); + } + const H0 = new Uint32Array(18); + const H0_8 = (0, utils_ts_1.u8)(H0); + h.digestInto(H0_8); + // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing + // Params + const lanes = p; + // m' = 4 * p * floor (m / 4p) + const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); + //q = m' / p columns + const laneLen = Math.floor(mP / p); + const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); + const memUsed = mP * 256; + if (!isU32(maxmem) || memUsed > maxmem) + throw new Error('mem should be less than 2**32, got: maxmem=' + maxmem + ', memused=' + memUsed); + const B = new Uint32Array(memUsed); + // Fill first blocks + for (let l = 0; l < p; l++) { + const i = 256 * laneLen * l; + // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) + H0[17] = l; + H0[16] = 0; + B.set(Hp(H0, 1024), i); + // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) + H0[16] = 1; + B.set(Hp(H0, 1024), i + 256); + } + let perBlock = () => { }; + if (onProgress) { + const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; + // Invoke callback if progress changes from 10.01 to 10.02 + // Allows to draw smooth progress bar on up to 8K screen + const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); + let blockCnt = 0; + perBlock = () => { + blockCnt++; + if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) + onProgress(blockCnt / totalBlock); + }; + } + (0, utils_ts_1.clean)(BUF, H0); + return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; +} +function argon2Output(B, p, laneLen, dkLen) { + const B_final = new Uint32Array(256); + for (let l = 0; l < p; l++) + for (let j = 0; j < 256; j++) + B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; + const res = (0, utils_ts_1.u8)(Hp(B_final, dkLen)); + (0, utils_ts_1.clean)(B_final); + return res; +} +function processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor) { + if (offset % laneLen) + prev = offset - 1; + let randL, randH; + if (dataIndependent) { + let i128 = index % 128; + if (i128 === 0) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + randL = address[2 * i128]; + randH = address[2 * i128 + 1]; + } + else { + const T = 256 * prev; + randL = B[T]; + randH = B[T + 1]; + } + // address block + const refLane = r === 0 && s === 0 ? l : randH % lanes; + const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); + const refBlock = laneLen * refLane + refPos; + // B[i][j] = G(B[i][j-1], B[l][z]) + block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); +} +function argon2(type, password, salt, opts) { + const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init(password, salt, type, opts); + // Pre-loop setup + // [address, input, zero_block] format so we can pass single U32 to block function + const address = new Uint32Array(3 * 256); + address[256 + 6] = mP; + address[256 + 8] = t; + address[256 + 10] = type; + for (let r = 0; r < t; r++) { + const needXor = r !== 0 && version === 0x13; + address[256 + 0] = r; + for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { + address[256 + 4] = s; + const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); + for (let l = 0; l < p; l++) { + address[256 + 2] = l; + address[256 + 12] = 0; + let startPos = 0; + if (r === 0 && s === 0) { + startPos = 2; + if (dataIndependent) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + } + // current block postion + let offset = l * laneLen + s * segmentLen + startPos; + // previous block position + let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; + for (let index = startPos; index < segmentLen; index++, offset++, prev++) { + perBlock(); + processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); + } + } + } + } + (0, utils_ts_1.clean)(address); + return argon2Output(B, p, laneLen, dkLen); +} +/** argon2d GPU-resistant version. */ +const argon2d = (password, salt, opts) => argon2(AT.Argond2d, password, salt, opts); +exports.argon2d = argon2d; +/** argon2i side-channel-resistant version. */ +const argon2i = (password, salt, opts) => argon2(AT.Argon2i, password, salt, opts); +exports.argon2i = argon2i; +/** argon2id, combining i+d, the most popular version from RFC 9106 */ +const argon2id = (password, salt, opts) => argon2(AT.Argon2id, password, salt, opts); +exports.argon2id = argon2id; +async function argon2Async(type, password, salt, opts) { + const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = argon2Init(password, salt, type, opts); + // Pre-loop setup + // [address, input, zero_block] format so we can pass single U32 to block function + const address = new Uint32Array(3 * 256); + address[256 + 6] = mP; + address[256 + 8] = t; + address[256 + 10] = type; + let ts = Date.now(); + for (let r = 0; r < t; r++) { + const needXor = r !== 0 && version === 0x13; + address[256 + 0] = r; + for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { + address[256 + 4] = s; + const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); + for (let l = 0; l < p; l++) { + address[256 + 2] = l; + address[256 + 12] = 0; + let startPos = 0; + if (r === 0 && s === 0) { + startPos = 2; + if (dataIndependent) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + } + // current block postion + let offset = l * laneLen + s * segmentLen + startPos; + // previous block position + let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; + for (let index = startPos; index < segmentLen; index++, offset++, prev++) { + perBlock(); + processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (!(diff >= 0 && diff < asyncTick)) { + await (0, utils_ts_1.nextTick)(); + ts += diff; + } + } + } + } + } + (0, utils_ts_1.clean)(address); + return argon2Output(B, p, laneLen, dkLen); +} +/** argon2d async GPU-resistant version. */ +const argon2dAsync = (password, salt, opts) => argon2Async(AT.Argond2d, password, salt, opts); +exports.argon2dAsync = argon2dAsync; +/** argon2i async side-channel-resistant version. */ +const argon2iAsync = (password, salt, opts) => argon2Async(AT.Argon2i, password, salt, opts); +exports.argon2iAsync = argon2iAsync; +/** argon2id async, combining i+d, the most popular version from RFC 9106 */ +const argon2idAsync = (password, salt, opts) => argon2Async(AT.Argon2id, password, salt, opts); +exports.argon2idAsync = argon2idAsync; +//# sourceMappingURL=argon2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/argon2.js.map b/node_modules/@noble/hashes/argon2.js.map new file mode 100644 index 0000000..74bde80 --- /dev/null +++ b/node_modules/@noble/hashes/argon2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"argon2.js","sourceRoot":"","sources":["src/argon2.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,uCAA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AAA,YAAY,gBAI+C;AACxE,4EAA4E;AACrE,MAAM,aAAa,GAAG,CAC3B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAJ5D,QAAA,aAAa,iBAI+C"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake1.d.ts b/node_modules/@noble/hashes/blake1.d.ts new file mode 100644 index 0000000..62d576f --- /dev/null +++ b/node_modules/@noble/hashes/blake1.d.ts @@ -0,0 +1,106 @@ +import { Hash, type CHashO, type Input } from './utils.ts'; +/** Blake1 options. Basically just "salt" */ +export type BlakeOpts = { + salt?: Uint8Array; +}; +declare abstract class BLAKE1> extends Hash { + protected finished: boolean; + protected length: number; + protected pos: number; + protected destroyed: boolean; + protected buffer: Uint8Array; + protected view: DataView; + protected salt: Uint32Array; + abstract compress(view: DataView, offset: number, withLength?: boolean): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + readonly blockLen: number; + readonly outputLen: number; + private lengthFlag; + private counterLen; + protected constants: Uint32Array; + constructor(blockLen: number, outputLen: number, lengthFlag: number, counterLen: number, saltLen: number, constants: Uint32Array, opts?: BlakeOpts); + update(data: Input): this; + destroy(): void; + _cloneInto(to?: T): T; + clone(): T; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; +} +declare class Blake1_32 extends BLAKE1 { + private v0; + private v1; + private v2; + private v3; + private v4; + private v5; + private v6; + private v7; + constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); + protected get(): [number, number, number, number, number, number, number, number]; + protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; + destroy(): void; + compress(view: DataView, offset: number, withLength?: boolean): void; +} +declare class Blake1_64 extends BLAKE1 { + private v0l; + private v0h; + private v1l; + private v1h; + private v2l; + private v2h; + private v3l; + private v3h; + private v4l; + private v4h; + private v5l; + private v5h; + private v6l; + private v6h; + private v7l; + private v7h; + constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); + protected get(): [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]; + protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; + destroy(): void; + compress(view: DataView, offset: number, withLength?: boolean): void; +} +export declare class BLAKE224 extends Blake1_32 { + constructor(opts?: BlakeOpts); +} +export declare class BLAKE256 extends Blake1_32 { + constructor(opts?: BlakeOpts); +} +export declare class BLAKE384 extends Blake1_64 { + constructor(opts?: BlakeOpts); +} +export declare class BLAKE512 extends Blake1_64 { + constructor(opts?: BlakeOpts); +} +/** blake1-224 hash function */ +export declare const blake224: CHashO; +/** blake1-256 hash function */ +export declare const blake256: CHashO; +/** blake1-384 hash function */ +export declare const blake384: CHashO; +/** blake1-512 hash function */ +export declare const blake512: CHashO; +export {}; +//# sourceMappingURL=blake1.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake1.d.ts.map b/node_modules/@noble/hashes/blake1.d.ts.map new file mode 100644 index 0000000..cecd4df --- /dev/null +++ b/node_modules/@noble/hashes/blake1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake1.d.ts","sourceRoot":"","sources":["src/blake1.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGO,IAAI,EAChB,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,CAAC;AAEpB,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAKF,uBAAe,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IACxD,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,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AAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake1.js b/node_modules/@noble/hashes/blake1.js new file mode 100644 index 0000000..a877fcb --- /dev/null +++ b/node_modules/@noble/hashes/blake1.js @@ -0,0 +1,459 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.blake512 = exports.blake384 = exports.blake256 = exports.blake224 = exports.BLAKE512 = exports.BLAKE384 = exports.BLAKE256 = exports.BLAKE224 = void 0; +/** + * Blake1 legacy hash function, one of SHA3 proposals. + * Rarely used. Check out blake2 or blake3 instead. + * https://www.aumasson.jp/blake/blake.pdf + * + * In the best case, there are 0 allocations. + * + * Differences from blake2: + * + * - BE instead of LE + * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: + * - length flag is located before actual length + * - padding block is compressed differently (no lengths) + * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` + * (-1 for g1, g2 without -1) + * - Salt is XOR-ed into constants instead of state + * - Salt is XOR-ed with output in `compress` + * - Additional rows (+64 bytes) in SIGMA for new rounds + * - Different round count: + * - 14 / 10 rounds in blake256 / blake2s + * - 16 / 12 rounds in blake512 / blake2b + * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 + * @module + */ +const _blake_ts_1 = require("./_blake.js"); +const _md_ts_1 = require("./_md.js"); +const u64 = require("./_u64.js"); +// prettier-ignore +const utils_ts_1 = require("./utils.js"); +// Empty zero-filled salt +const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); +class BLAKE1 extends utils_ts_1.Hash { + constructor(blockLen, outputLen, lengthFlag, counterLen, saltLen, constants, opts = {}) { + super(); + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + const { salt } = opts; + this.blockLen = blockLen; + this.outputLen = outputLen; + this.lengthFlag = lengthFlag; + this.counterLen = counterLen; + this.buffer = new Uint8Array(blockLen); + this.view = (0, utils_ts_1.createView)(this.buffer); + if (salt) { + let slt = salt; + slt = (0, utils_ts_1.toBytes)(slt); + (0, utils_ts_1.abytes)(slt); + if (slt.length !== 4 * saltLen) + throw new Error('wrong salt length'); + const salt32 = (this.salt = new Uint32Array(saltLen)); + const sv = (0, utils_ts_1.createView)(slt); + this.constants = constants.slice(); + for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { + salt32[i] = sv.getUint32(offset, false); + this.constants[i] ^= salt32[i]; + } + } + else { + this.salt = EMPTY_SALT; + this.constants = constants; + } + } + update(data) { + (0, utils_ts_1.aexists)(this); + data = (0, utils_ts_1.toBytes)(data); + (0, utils_ts_1.abytes)(data); + // From _md, but update length before each compress + const { view, buffer, blockLen } = this; + const len = data.length; + let dataView; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path: we have at least one block in input, cast it to view and process + if (take === blockLen) { + if (!dataView) + dataView = (0, utils_ts_1.createView)(data); + for (; blockLen <= len - pos; pos += blockLen) { + this.length += blockLen; + this.compress(dataView, pos); + } + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.length += blockLen; + this.compress(view, 0, true); + this.pos = 0; + } + } + return this; + } + destroy() { + this.destroyed = true; + if (this.salt !== EMPTY_SALT) { + (0, utils_ts_1.clean)(this.salt, this.constants); + } + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { buffer, length, finished, destroyed, constants, salt, pos } = this; + to.buffer.set(buffer); + to.constants = constants.slice(); + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + to.salt = salt.slice(); + return to; + } + clone() { + return this._cloneInto(); + } + digestInto(out) { + (0, utils_ts_1.aexists)(this); + (0, utils_ts_1.aoutput)(out, this); + this.finished = true; + // Padding + const { buffer, blockLen, counterLen, lengthFlag, view } = this; + (0, utils_ts_1.clean)(buffer.subarray(this.pos)); // clean buf + const counter = BigInt((this.length + this.pos) * 8); + const counterPos = blockLen - counterLen - 1; + buffer[this.pos] |= 128; // End block flag + this.length += this.pos; // add unwritten length + // Not enough in buffer for length: write what we have. + if (this.pos > counterPos) { + this.compress(view, 0); + (0, utils_ts_1.clean)(buffer); + this.pos = 0; + } + // Difference with md: here we have lengthFlag! + buffer[counterPos] |= lengthFlag; // Length flag + // We always set 8 byte length flag. Because length will overflow significantly sooner. + (0, _md_ts_1.setBigUint64)(view, blockLen - 8, counter, false); + this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? + // Write output + (0, utils_ts_1.clean)(buffer); + const v = (0, utils_ts_1.createView)(out); + const state = this.get(); + for (let i = 0; i < this.outputLen / 4; ++i) + v.setUint32(i * 4, state[i]); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } +} +// Constants +const B64C = /* @__PURE__ */ Uint32Array.from([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, + 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, +]); +// first half of C512 +const B32C = B64C.slice(0, 16); +const B256_IV = _md_ts_1.SHA256_IV.slice(); +const B224_IV = _md_ts_1.SHA224_IV.slice(); +const B384_IV = _md_ts_1.SHA384_IV.slice(); +const B512_IV = _md_ts_1.SHA512_IV.slice(); +function generateTBL256() { + const TBL = []; + for (let i = 0, j = 0; i < 14; i++, j += 16) { + for (let offset = 1; offset < 16; offset += 2) { + TBL.push(B32C[_blake_ts_1.BSIGMA[j + offset]]); + TBL.push(B32C[_blake_ts_1.BSIGMA[j + offset - 1]]); + } + } + return new Uint32Array(TBL); +} +const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute +// Reusable temporary buffer +const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); +class Blake1_32 extends BLAKE1 { + constructor(outputLen, IV, lengthFlag, opts = {}) { + super(64, outputLen, lengthFlag, 8, 4, B32C, opts); + this.v0 = IV[0] | 0; + this.v1 = IV[1] | 0; + this.v2 = IV[2] | 0; + this.v3 = IV[3] | 0; + this.v4 = IV[4] | 0; + this.v5 = IV[5] | 0; + this.v6 = IV[6] | 0; + this.v7 = IV[7] | 0; + } + get() { + const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; + return [v0, v1, v2, v3, v4, v5, v6, v7]; + } + // prettier-ignore + set(v0, v1, v2, v3, v4, v5, v6, v7) { + this.v0 = v0 | 0; + this.v1 = v1 | 0; + this.v2 = v2 | 0; + this.v3 = v3 | 0; + this.v4 = v4 | 0; + this.v5 = v5 | 0; + this.v6 = v6 | 0; + this.v7 = v7 | 0; + } + destroy() { + super.destroy(); + this.set(0, 0, 0, 0, 0, 0, 0, 0); + } + compress(view, offset, withLength = true) { + for (let i = 0; i < 16; i++, offset += 4) + BLAKE256_W[i] = view.getUint32(offset, false); + // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] + let v00 = this.v0 | 0; + let v01 = this.v1 | 0; + let v02 = this.v2 | 0; + let v03 = this.v3 | 0; + let v04 = this.v4 | 0; + let v05 = this.v5 | 0; + let v06 = this.v6 | 0; + let v07 = this.v7 | 0; + let v08 = this.constants[0] | 0; + let v09 = this.constants[1] | 0; + let v10 = this.constants[2] | 0; + let v11 = this.constants[3] | 0; + const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); + let v12 = (this.constants[4] ^ l) >>> 0; + let v13 = (this.constants[5] ^ l) >>> 0; + let v14 = (this.constants[6] ^ h) >>> 0; + let v15 = (this.constants[7] ^ h) >>> 0; + // prettier-ignore + for (let i = 0, k = 0, j = 0; i < 14; i++) { + ({ a: v00, b: v04, c: v08, d: v12 } = (0, _blake_ts_1.G1s)(v00, v04, v08, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v04, c: v08, d: v12 } = (0, _blake_ts_1.G2s)(v00, v04, v08, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v05, c: v09, d: v13 } = (0, _blake_ts_1.G1s)(v01, v05, v09, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v05, c: v09, d: v13 } = (0, _blake_ts_1.G2s)(v01, v05, v09, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v06, c: v10, d: v14 } = (0, _blake_ts_1.G1s)(v02, v06, v10, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v06, c: v10, d: v14 } = (0, _blake_ts_1.G2s)(v02, v06, v10, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v07, c: v11, d: v15 } = (0, _blake_ts_1.G1s)(v03, v07, v11, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v07, c: v11, d: v15 } = (0, _blake_ts_1.G2s)(v03, v07, v11, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v05, c: v10, d: v15 } = (0, _blake_ts_1.G1s)(v00, v05, v10, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v05, c: v10, d: v15 } = (0, _blake_ts_1.G2s)(v00, v05, v10, v15, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v06, c: v11, d: v12 } = (0, _blake_ts_1.G1s)(v01, v06, v11, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v06, c: v11, d: v12 } = (0, _blake_ts_1.G2s)(v01, v06, v11, v12, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v07, c: v08, d: v13 } = (0, _blake_ts_1.G1s)(v02, v07, v08, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v07, c: v08, d: v13 } = (0, _blake_ts_1.G2s)(v02, v07, v08, v13, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v04, c: v09, d: v14 } = (0, _blake_ts_1.G1s)(v03, v04, v09, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v04, c: v09, d: v14 } = (0, _blake_ts_1.G2s)(v03, v04, v09, v14, BLAKE256_W[_blake_ts_1.BSIGMA[k++]] ^ TBL256[j++])); + } + this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; + this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; + this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; + this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; + this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; + this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; + this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; + this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; + (0, utils_ts_1.clean)(BLAKE256_W); + } +} +const BBUF = /* @__PURE__ */ new Uint32Array(32); +const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); +function generateTBL512() { + const TBL = []; + for (let r = 0, k = 0; r < 16; r++, k += 16) { + for (let offset = 1; offset < 16; offset += 2) { + TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset] * 2 + 0]); + TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset] * 2 + 1]); + TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset - 1] * 2 + 0]); + TBL.push(B64C[_blake_ts_1.BSIGMA[k + offset - 1] * 2 + 1]); + } + } + return new Uint32Array(TBL); +} +const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute +// Mixing function G splitted in two halfs +function G1b(a, b, c, d, msg, k) { + const Xpos = 2 * _blake_ts_1.BSIGMA[k]; + const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore + let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore + let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore + let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore + let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; + Al = (ll | 0) >>> 0; + // v[d] = rotr(v[d] ^ v[a], 32) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 25) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); + (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); + (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); + (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); + (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); +} +function G2b(a, b, c, d, msg, k) { + const Xpos = 2 * _blake_ts_1.BSIGMA[k]; + const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore + let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore + let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore + let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore + let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 16) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 11) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); + (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); + (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); + (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); + (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); +} +class Blake1_64 extends BLAKE1 { + constructor(outputLen, IV, lengthFlag, opts = {}) { + super(128, outputLen, lengthFlag, 16, 8, B64C, opts); + this.v0l = IV[0] | 0; + this.v0h = IV[1] | 0; + this.v1l = IV[2] | 0; + this.v1h = IV[3] | 0; + this.v2l = IV[4] | 0; + this.v2h = IV[5] | 0; + this.v3l = IV[6] | 0; + this.v3h = IV[7] | 0; + this.v4l = IV[8] | 0; + this.v4h = IV[9] | 0; + this.v5l = IV[10] | 0; + this.v5h = IV[11] | 0; + this.v6l = IV[12] | 0; + this.v6h = IV[13] | 0; + this.v7l = IV[14] | 0; + this.v7h = IV[15] | 0; + } + // prettier-ignore + get() { + let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; + return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; + } + // prettier-ignore + set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { + this.v0l = v0l | 0; + this.v0h = v0h | 0; + this.v1l = v1l | 0; + this.v1h = v1h | 0; + this.v2l = v2l | 0; + this.v2h = v2h | 0; + this.v3l = v3l | 0; + this.v3h = v3h | 0; + this.v4l = v4l | 0; + this.v4h = v4h | 0; + this.v5l = v5l | 0; + this.v5h = v5h | 0; + this.v6l = v6l | 0; + this.v6h = v6h | 0; + this.v7l = v7l | 0; + this.v7h = v7h | 0; + } + destroy() { + super.destroy(); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + compress(view, offset, withLength = true) { + for (let i = 0; i < 32; i++, offset += 4) + BLAKE512_W[i] = view.getUint32(offset, false); + this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. + BBUF.set(this.constants.subarray(0, 16), 16); + if (withLength) { + const { h, l } = u64.fromBig(BigInt(this.length * 8)); + BBUF[24] = (BBUF[24] ^ h) >>> 0; + BBUF[25] = (BBUF[25] ^ l) >>> 0; + BBUF[26] = (BBUF[26] ^ h) >>> 0; + BBUF[27] = (BBUF[27] ^ l) >>> 0; + } + for (let i = 0, k = 0; i < 16; i++) { + G1b(0, 4, 8, 12, BLAKE512_W, k++); + G2b(0, 4, 8, 12, BLAKE512_W, k++); + G1b(1, 5, 9, 13, BLAKE512_W, k++); + G2b(1, 5, 9, 13, BLAKE512_W, k++); + G1b(2, 6, 10, 14, BLAKE512_W, k++); + G2b(2, 6, 10, 14, BLAKE512_W, k++); + G1b(3, 7, 11, 15, BLAKE512_W, k++); + G2b(3, 7, 11, 15, BLAKE512_W, k++); + G1b(0, 5, 10, 15, BLAKE512_W, k++); + G2b(0, 5, 10, 15, BLAKE512_W, k++); + G1b(1, 6, 11, 12, BLAKE512_W, k++); + G2b(1, 6, 11, 12, BLAKE512_W, k++); + G1b(2, 7, 8, 13, BLAKE512_W, k++); + G2b(2, 7, 8, 13, BLAKE512_W, k++); + G1b(3, 4, 9, 14, BLAKE512_W, k++); + G2b(3, 4, 9, 14, BLAKE512_W, k++); + } + this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; + this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; + this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; + this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; + this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; + this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; + this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; + this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; + this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; + this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; + this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; + this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; + this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; + this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; + this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; + this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; + (0, utils_ts_1.clean)(BBUF, BLAKE512_W); + } +} +class BLAKE224 extends Blake1_32 { + constructor(opts = {}) { + super(28, B224_IV, 0, opts); + } +} +exports.BLAKE224 = BLAKE224; +class BLAKE256 extends Blake1_32 { + constructor(opts = {}) { + super(32, B256_IV, 1, opts); + } +} +exports.BLAKE256 = BLAKE256; +class BLAKE384 extends Blake1_64 { + constructor(opts = {}) { + super(48, B384_IV, 0, opts); + } +} +exports.BLAKE384 = BLAKE384; +class BLAKE512 extends Blake1_64 { + constructor(opts = {}) { + super(64, B512_IV, 1, opts); + } +} +exports.BLAKE512 = BLAKE512; +/** blake1-224 hash function */ +exports.blake224 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE224(opts)); +/** blake1-256 hash function */ +exports.blake256 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE256(opts)); +/** blake1-384 hash function */ +exports.blake384 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE384(opts)); +/** blake1-512 hash function */ +exports.blake512 = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE512(opts)); +//# sourceMappingURL=blake1.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake1.js.map b/node_modules/@noble/hashes/blake1.js.map new file mode 100644 index 0000000..314f7a8 --- /dev/null +++ b/node_modules/@noble/hashes/blake1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake1.js","sourceRoot":"","sources":["src/blake1.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,2CAA+C;AAC/C,qCAAoF;AACpF,iCAAiC;AACjC,kBAAkB;AAClB,yCAKoB;AAOpB,yBAAyB;AACzB,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,WAAW,CA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AAE,EAAE,OAAO,EAAE,CAAW,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAJD,4BAIC;AACD,MAAa,QAAS,SAAQ,SAAS;IACrC,YAAY,OAAkB,EAAE;QAC9B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,CAAW,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAJD,4BAIC;AACD,MAAa,QAAS,SAAQ,SAAS;IACrC,YAAY,OAAkB,EAAE;QAC9B,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,CAAW,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAJD,4BAIC;AACD,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAClB,QAAA,QAAQ,GAA2B,IAAA,0BAAe,EAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2.d.ts b/node_modules/@noble/hashes/blake2.d.ts new file mode 100644 index 0000000..ea6ae41 --- /dev/null +++ b/node_modules/@noble/hashes/blake2.d.ts @@ -0,0 +1,116 @@ +import { Hash, type CHashO, type Input } from './utils.ts'; +/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ +export type Blake2Opts = { + dkLen?: number; + key?: Input; + salt?: Input; + personalization?: Input; +}; +/** Class, from which others are subclassed. */ +export declare abstract class BLAKE2> extends Hash { + protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + abstract destroy(): void; + protected buffer: Uint8Array; + protected buffer32: Uint32Array; + protected finished: boolean; + protected destroyed: boolean; + protected length: number; + protected pos: number; + readonly blockLen: number; + readonly outputLen: number; + constructor(blockLen: number, outputLen: number); + update(data: Input): this; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; + _cloneInto(to?: T): T; + clone(): T; +} +export declare class BLAKE2b extends BLAKE2 { + private v0l; + private v0h; + private v1l; + private v1h; + private v2l; + private v2h; + private v3l; + private v3h; + private v4l; + private v4h; + private v5l; + private v5h; + private v6l; + private v6h; + private v7l; + private v7h; + constructor(opts?: Blake2Opts); + protected get(): [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]; + protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; + protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; + destroy(): void; +} +/** + * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export declare const blake2b: CHashO; +export type Num16 = { + v0: number; + v1: number; + v2: number; + v3: number; + v4: number; + v5: number; + v6: number; + v7: number; + v8: number; + v9: number; + v10: number; + v11: number; + v12: number; + v13: number; + v14: number; + v15: number; +}; +export declare function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number): Num16; +export declare class BLAKE2s extends BLAKE2 { + private v0; + private v1; + private v2; + private v3; + private v4; + private v5; + private v6; + private v7; + constructor(opts?: Blake2Opts); + protected get(): [number, number, number, number, number, number, number, number]; + protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; + protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; + destroy(): void; +} +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export declare const blake2s: CHashO; +//# sourceMappingURL=blake2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2.d.ts.map b/node_modules/@noble/hashes/blake2.d.ts.map new file mode 100644 index 0000000..f7d88d1 --- /dev/null +++ b/node_modules/@noble/hashes/blake2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2.d.ts","sourceRoot":"","sources":["src/blake2.ts"],"names":[],"mappings":"AASA,OAAO,EAEmB,IAAI,EAC5B,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,CAAC;AAEpB,qGAAqG;AACrG,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AA+EF,+CAA+C;AAC/C,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IAC/D,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IACpF,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,EAAE;IAClC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAC/C,QAAQ,CAAC,OAAO,IAAI,IAAI;IACx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EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAC7F,IAAI;IAUP,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAkB3E,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,MAErB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2.js b/node_modules/@noble/hashes/blake2.js new file mode 100644 index 0000000..3b2a048 --- /dev/null +++ b/node_modules/@noble/hashes/blake2.js @@ -0,0 +1,420 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.blake2s = exports.BLAKE2s = exports.blake2b = exports.BLAKE2b = exports.BLAKE2 = void 0; +exports.compress = compress; +/** + * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. + * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. + * @module + */ +const _blake_ts_1 = require("./_blake.js"); +const _md_ts_1 = require("./_md.js"); +const u64 = require("./_u64.js"); +// prettier-ignore +const utils_ts_1 = require("./utils.js"); +// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. +const B2B_IV = /* @__PURE__ */ Uint32Array.from([ + 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, + 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, +]); +// Temporary buffer +const BBUF = /* @__PURE__ */ new Uint32Array(32); +// Mixing function G splitted in two halfs +function G1b(a, b, c, d, msg, x) { + // NOTE: V is LE here + const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore + let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore + let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore + let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore + let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 32) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 24) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); + (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); + (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); + (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); + (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); +} +function G2b(a, b, c, d, msg, x) { + // NOTE: V is LE here + const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore + let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore + let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore + let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore + let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 16) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 63) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); + (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); + (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); + (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); + (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); +} +function checkBlake2Opts(outputLen, opts = {}, keyLen, saltLen, persLen) { + (0, utils_ts_1.anumber)(keyLen); + if (outputLen < 0 || outputLen > keyLen) + throw new Error('outputLen bigger than keyLen'); + const { key, salt, personalization } = opts; + if (key !== undefined && (key.length < 1 || key.length > keyLen)) + throw new Error('key length must be undefined or 1..' + keyLen); + if (salt !== undefined && salt.length !== saltLen) + throw new Error('salt must be undefined or ' + saltLen); + if (personalization !== undefined && personalization.length !== persLen) + throw new Error('personalization must be undefined or ' + persLen); +} +/** Class, from which others are subclassed. */ +class BLAKE2 extends utils_ts_1.Hash { + constructor(blockLen, outputLen) { + super(); + this.finished = false; + this.destroyed = false; + this.length = 0; + this.pos = 0; + (0, utils_ts_1.anumber)(blockLen); + (0, utils_ts_1.anumber)(outputLen); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.buffer = new Uint8Array(blockLen); + this.buffer32 = (0, utils_ts_1.u32)(this.buffer); + } + update(data) { + (0, utils_ts_1.aexists)(this); + data = (0, utils_ts_1.toBytes)(data); + (0, utils_ts_1.abytes)(data); + // Main difference with other hashes: there is flag for last block, + // so we cannot process current block before we know that there + // is the next one. This significantly complicates logic and reduces ability + // to do zero-copy processing + const { blockLen, buffer, buffer32 } = this; + const len = data.length; + const offset = data.byteOffset; + const buf = data.buffer; + for (let pos = 0; pos < len;) { + // If buffer is full and we still have input (don't process last block, same as blake2s) + if (this.pos === blockLen) { + (0, utils_ts_1.swap32IfBE)(buffer32); + this.compress(buffer32, 0, false); + (0, utils_ts_1.swap32IfBE)(buffer32); + this.pos = 0; + } + const take = Math.min(blockLen - this.pos, len - pos); + const dataOffset = offset + pos; + // full block && aligned to 4 bytes && not last in input + if (take === blockLen && !(dataOffset % 4) && pos + take < len) { + const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); + (0, utils_ts_1.swap32IfBE)(data32); + for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { + this.length += blockLen; + this.compress(data32, pos32, false); + } + (0, utils_ts_1.swap32IfBE)(data32); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + this.length += take; + pos += take; + } + return this; + } + digestInto(out) { + (0, utils_ts_1.aexists)(this); + (0, utils_ts_1.aoutput)(out, this); + const { pos, buffer32 } = this; + this.finished = true; + // Padding + (0, utils_ts_1.clean)(this.buffer.subarray(pos)); + (0, utils_ts_1.swap32IfBE)(buffer32); + this.compress(buffer32, 0, true); + (0, utils_ts_1.swap32IfBE)(buffer32); + const out32 = (0, utils_ts_1.u32)(out); + this.get().forEach((v, i) => (out32[i] = (0, utils_ts_1.swap8IfBE)(v))); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + const { buffer, length, finished, destroyed, outputLen, pos } = this; + to || (to = new this.constructor({ dkLen: outputLen })); + to.set(...this.get()); + to.buffer.set(buffer); + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + // @ts-ignore + to.outputLen = outputLen; + return to; + } + clone() { + return this._cloneInto(); + } +} +exports.BLAKE2 = BLAKE2; +class BLAKE2b extends BLAKE2 { + constructor(opts = {}) { + const olen = opts.dkLen === undefined ? 64 : opts.dkLen; + super(128, olen); + // Same as SHA-512, but LE + this.v0l = B2B_IV[0] | 0; + this.v0h = B2B_IV[1] | 0; + this.v1l = B2B_IV[2] | 0; + this.v1h = B2B_IV[3] | 0; + this.v2l = B2B_IV[4] | 0; + this.v2h = B2B_IV[5] | 0; + this.v3l = B2B_IV[6] | 0; + this.v3h = B2B_IV[7] | 0; + this.v4l = B2B_IV[8] | 0; + this.v4h = B2B_IV[9] | 0; + this.v5l = B2B_IV[10] | 0; + this.v5h = B2B_IV[11] | 0; + this.v6l = B2B_IV[12] | 0; + this.v6h = B2B_IV[13] | 0; + this.v7l = B2B_IV[14] | 0; + this.v7h = B2B_IV[15] | 0; + checkBlake2Opts(olen, opts, 64, 16, 16); + let { key, personalization, salt } = opts; + let keyLength = 0; + if (key !== undefined) { + key = (0, utils_ts_1.toBytes)(key); + keyLength = key.length; + } + this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); + if (salt !== undefined) { + salt = (0, utils_ts_1.toBytes)(salt); + const slt = (0, utils_ts_1.u32)(salt); + this.v4l ^= (0, utils_ts_1.swap8IfBE)(slt[0]); + this.v4h ^= (0, utils_ts_1.swap8IfBE)(slt[1]); + this.v5l ^= (0, utils_ts_1.swap8IfBE)(slt[2]); + this.v5h ^= (0, utils_ts_1.swap8IfBE)(slt[3]); + } + if (personalization !== undefined) { + personalization = (0, utils_ts_1.toBytes)(personalization); + const pers = (0, utils_ts_1.u32)(personalization); + this.v6l ^= (0, utils_ts_1.swap8IfBE)(pers[0]); + this.v6h ^= (0, utils_ts_1.swap8IfBE)(pers[1]); + this.v7l ^= (0, utils_ts_1.swap8IfBE)(pers[2]); + this.v7h ^= (0, utils_ts_1.swap8IfBE)(pers[3]); + } + if (key !== undefined) { + // Pad to blockLen and update + const tmp = new Uint8Array(this.blockLen); + tmp.set(key); + this.update(tmp); + } + } + // prettier-ignore + get() { + let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; + return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; + } + // prettier-ignore + set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { + this.v0l = v0l | 0; + this.v0h = v0h | 0; + this.v1l = v1l | 0; + this.v1h = v1h | 0; + this.v2l = v2l | 0; + this.v2h = v2h | 0; + this.v3l = v3l | 0; + this.v3h = v3h | 0; + this.v4l = v4l | 0; + this.v4h = v4h | 0; + this.v5l = v5l | 0; + this.v5h = v5h | 0; + this.v6l = v6l | 0; + this.v6h = v6h | 0; + this.v7l = v7l | 0; + this.v7h = v7h | 0; + } + compress(msg, offset, isLast) { + this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. + BBUF.set(B2B_IV, 16); // Second half from IV. + let { h, l } = u64.fromBig(BigInt(this.length)); + BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. + BBUF[25] = B2B_IV[9] ^ h; // High word. + // Invert all bits for last block + if (isLast) { + BBUF[28] = ~BBUF[28]; + BBUF[29] = ~BBUF[29]; + } + let j = 0; + const s = _blake_ts_1.BSIGMA; + for (let i = 0; i < 12; i++) { + G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); + G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); + G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); + G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); + G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); + G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); + G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); + G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); + G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); + G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); + G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); + G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); + G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); + G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); + G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); + G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); + } + this.v0l ^= BBUF[0] ^ BBUF[16]; + this.v0h ^= BBUF[1] ^ BBUF[17]; + this.v1l ^= BBUF[2] ^ BBUF[18]; + this.v1h ^= BBUF[3] ^ BBUF[19]; + this.v2l ^= BBUF[4] ^ BBUF[20]; + this.v2h ^= BBUF[5] ^ BBUF[21]; + this.v3l ^= BBUF[6] ^ BBUF[22]; + this.v3h ^= BBUF[7] ^ BBUF[23]; + this.v4l ^= BBUF[8] ^ BBUF[24]; + this.v4h ^= BBUF[9] ^ BBUF[25]; + this.v5l ^= BBUF[10] ^ BBUF[26]; + this.v5h ^= BBUF[11] ^ BBUF[27]; + this.v6l ^= BBUF[12] ^ BBUF[28]; + this.v6h ^= BBUF[13] ^ BBUF[29]; + this.v7l ^= BBUF[14] ^ BBUF[30]; + this.v7h ^= BBUF[15] ^ BBUF[31]; + (0, utils_ts_1.clean)(BBUF); + } + destroy() { + this.destroyed = true; + (0, utils_ts_1.clean)(this.buffer32); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +} +exports.BLAKE2b = BLAKE2b; +/** + * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +exports.blake2b = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE2b(opts)); +// prettier-ignore +function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { + let j = 0; + for (let i = 0; i < rounds; i++) { + ({ a: v0, b: v4, c: v8, d: v12 } = (0, _blake_ts_1.G1s)(v0, v4, v8, v12, msg[offset + s[j++]])); + ({ a: v0, b: v4, c: v8, d: v12 } = (0, _blake_ts_1.G2s)(v0, v4, v8, v12, msg[offset + s[j++]])); + ({ a: v1, b: v5, c: v9, d: v13 } = (0, _blake_ts_1.G1s)(v1, v5, v9, v13, msg[offset + s[j++]])); + ({ a: v1, b: v5, c: v9, d: v13 } = (0, _blake_ts_1.G2s)(v1, v5, v9, v13, msg[offset + s[j++]])); + ({ a: v2, b: v6, c: v10, d: v14 } = (0, _blake_ts_1.G1s)(v2, v6, v10, v14, msg[offset + s[j++]])); + ({ a: v2, b: v6, c: v10, d: v14 } = (0, _blake_ts_1.G2s)(v2, v6, v10, v14, msg[offset + s[j++]])); + ({ a: v3, b: v7, c: v11, d: v15 } = (0, _blake_ts_1.G1s)(v3, v7, v11, v15, msg[offset + s[j++]])); + ({ a: v3, b: v7, c: v11, d: v15 } = (0, _blake_ts_1.G2s)(v3, v7, v11, v15, msg[offset + s[j++]])); + ({ a: v0, b: v5, c: v10, d: v15 } = (0, _blake_ts_1.G1s)(v0, v5, v10, v15, msg[offset + s[j++]])); + ({ a: v0, b: v5, c: v10, d: v15 } = (0, _blake_ts_1.G2s)(v0, v5, v10, v15, msg[offset + s[j++]])); + ({ a: v1, b: v6, c: v11, d: v12 } = (0, _blake_ts_1.G1s)(v1, v6, v11, v12, msg[offset + s[j++]])); + ({ a: v1, b: v6, c: v11, d: v12 } = (0, _blake_ts_1.G2s)(v1, v6, v11, v12, msg[offset + s[j++]])); + ({ a: v2, b: v7, c: v8, d: v13 } = (0, _blake_ts_1.G1s)(v2, v7, v8, v13, msg[offset + s[j++]])); + ({ a: v2, b: v7, c: v8, d: v13 } = (0, _blake_ts_1.G2s)(v2, v7, v8, v13, msg[offset + s[j++]])); + ({ a: v3, b: v4, c: v9, d: v14 } = (0, _blake_ts_1.G1s)(v3, v4, v9, v14, msg[offset + s[j++]])); + ({ a: v3, b: v4, c: v9, d: v14 } = (0, _blake_ts_1.G2s)(v3, v4, v9, v14, msg[offset + s[j++]])); + } + return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; +} +const B2S_IV = _md_ts_1.SHA256_IV; +class BLAKE2s extends BLAKE2 { + constructor(opts = {}) { + const olen = opts.dkLen === undefined ? 32 : opts.dkLen; + super(64, olen); + // Internal state, same as SHA-256 + this.v0 = B2S_IV[0] | 0; + this.v1 = B2S_IV[1] | 0; + this.v2 = B2S_IV[2] | 0; + this.v3 = B2S_IV[3] | 0; + this.v4 = B2S_IV[4] | 0; + this.v5 = B2S_IV[5] | 0; + this.v6 = B2S_IV[6] | 0; + this.v7 = B2S_IV[7] | 0; + checkBlake2Opts(olen, opts, 32, 8, 8); + let { key, personalization, salt } = opts; + let keyLength = 0; + if (key !== undefined) { + key = (0, utils_ts_1.toBytes)(key); + keyLength = key.length; + } + this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); + if (salt !== undefined) { + salt = (0, utils_ts_1.toBytes)(salt); + const slt = (0, utils_ts_1.u32)(salt); + this.v4 ^= (0, utils_ts_1.swap8IfBE)(slt[0]); + this.v5 ^= (0, utils_ts_1.swap8IfBE)(slt[1]); + } + if (personalization !== undefined) { + personalization = (0, utils_ts_1.toBytes)(personalization); + const pers = (0, utils_ts_1.u32)(personalization); + this.v6 ^= (0, utils_ts_1.swap8IfBE)(pers[0]); + this.v7 ^= (0, utils_ts_1.swap8IfBE)(pers[1]); + } + if (key !== undefined) { + // Pad to blockLen and update + (0, utils_ts_1.abytes)(key); + const tmp = new Uint8Array(this.blockLen); + tmp.set(key); + this.update(tmp); + } + } + get() { + const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; + return [v0, v1, v2, v3, v4, v5, v6, v7]; + } + // prettier-ignore + set(v0, v1, v2, v3, v4, v5, v6, v7) { + this.v0 = v0 | 0; + this.v1 = v1 | 0; + this.v2 = v2 | 0; + this.v3 = v3 | 0; + this.v4 = v4 | 0; + this.v5 = v5 | 0; + this.v6 = v6 | 0; + this.v7 = v7 | 0; + } + compress(msg, offset, isLast) { + const { h, l } = u64.fromBig(BigInt(this.length)); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(_blake_ts_1.BSIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7]); + this.v0 ^= v0 ^ v8; + this.v1 ^= v1 ^ v9; + this.v2 ^= v2 ^ v10; + this.v3 ^= v3 ^ v11; + this.v4 ^= v4 ^ v12; + this.v5 ^= v5 ^ v13; + this.v6 ^= v6 ^ v14; + this.v7 ^= v7 ^ v15; + } + destroy() { + this.destroyed = true; + (0, utils_ts_1.clean)(this.buffer32); + this.set(0, 0, 0, 0, 0, 0, 0, 0); + } +} +exports.BLAKE2s = BLAKE2s; +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +exports.blake2s = (0, utils_ts_1.createOptHasher)((opts) => new BLAKE2s(opts)); +//# sourceMappingURL=blake2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2.js.map b/node_modules/@noble/hashes/blake2.js.map new file mode 100644 index 0000000..8849793 --- /dev/null +++ b/node_modules/@noble/hashes/blake2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2.js","sourceRoot":"","sources":["src/blake2.ts"],"names":[],"mappings":";;;AA8WA,4BAyBC;AAvYD;;;;GAIG;AACH,2CAA+C;AAC/C,qCAAqC;AACrC,iCAAiC;AACjC,kBAAkB;AAClB,yCAIoB;AAUpB,oFAAoF;AACpF,MAAM,MAAM,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC9C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B,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;QACpB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC;IACtB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAA,gBAAK,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAlFD,0BAkFC;AAED;;;;GAIG;AACU,QAAA,OAAO,GAA2B,IAAA,0BAAe,EAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAC5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2b.d.ts b/node_modules/@noble/hashes/blake2b.d.ts new file mode 100644 index 0000000..a9ea37e --- /dev/null +++ b/node_modules/@noble/hashes/blake2b.d.ts @@ -0,0 +1,11 @@ +/** + * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. + * @module + * @deprecated + */ +import { BLAKE2b as B2B, blake2b as b2b } from './blake2.ts'; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const BLAKE2b: typeof B2B; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const blake2b: typeof b2b; +//# sourceMappingURL=blake2b.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2b.d.ts.map b/node_modules/@noble/hashes/blake2b.d.ts.map new file mode 100644 index 0000000..3b1ad51 --- /dev/null +++ b/node_modules/@noble/hashes/blake2b.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2b.d.ts","sourceRoot":"","sources":["src/blake2b.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7D,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2b.js b/node_modules/@noble/hashes/blake2b.js new file mode 100644 index 0000000..18cdcca --- /dev/null +++ b/node_modules/@noble/hashes/blake2b.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.blake2b = exports.BLAKE2b = void 0; +/** + * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. + * @module + * @deprecated + */ +const blake2_ts_1 = require("./blake2.js"); +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.BLAKE2b = blake2_ts_1.BLAKE2b; +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.blake2b = blake2_ts_1.blake2b; +//# sourceMappingURL=blake2b.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2b.js.map b/node_modules/@noble/hashes/blake2b.js.map new file mode 100644 index 0000000..65282ad --- /dev/null +++ b/node_modules/@noble/hashes/blake2b.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2b.js","sourceRoot":"","sources":["src/blake2b.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,2CAA6D;AAC7D,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC;AACvC,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2s.d.ts b/node_modules/@noble/hashes/blake2s.d.ts new file mode 100644 index 0000000..6720f35 --- /dev/null +++ b/node_modules/@noble/hashes/blake2s.d.ts @@ -0,0 +1,20 @@ +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. + * @module + * @deprecated + */ +import { G1s as G1s_n, G2s as G2s_n } from './_blake.ts'; +import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from './blake2.ts'; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const B2S_IV: Uint32Array; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const G1s: typeof G1s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const G2s: typeof G2s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const compress: typeof compress_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const BLAKE2s: typeof B2S; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const blake2s: typeof b2s; +//# sourceMappingURL=blake2s.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2s.d.ts.map b/node_modules/@noble/hashes/blake2s.d.ts.map new file mode 100644 index 0000000..9a54568 --- /dev/null +++ b/node_modules/@noble/hashes/blake2s.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2s.d.ts","sourceRoot":"","sources":["src/blake2s.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACrF,+DAA+D;AAC/D,eAAO,MAAM,MAAM,EAAE,WAAuB,CAAC;AAC7C,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,EAAE,OAAO,UAAuB,CAAC;AACtD,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2s.js b/node_modules/@noble/hashes/blake2s.js new file mode 100644 index 0000000..3d4f42b --- /dev/null +++ b/node_modules/@noble/hashes/blake2s.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.blake2s = exports.BLAKE2s = exports.compress = exports.G2s = exports.G1s = exports.B2S_IV = void 0; +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. + * @module + * @deprecated + */ +const _blake_ts_1 = require("./_blake.js"); +const _md_ts_1 = require("./_md.js"); +const blake2_ts_1 = require("./blake2.js"); +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.B2S_IV = _md_ts_1.SHA256_IV; +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.G1s = _blake_ts_1.G1s; +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.G2s = _blake_ts_1.G2s; +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.compress = blake2_ts_1.compress; +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.BLAKE2s = blake2_ts_1.BLAKE2s; +/** @deprecated Use import from `noble/hashes/blake2` module */ +exports.blake2s = blake2_ts_1.blake2s; +//# sourceMappingURL=blake2s.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake2s.js.map b/node_modules/@noble/hashes/blake2s.js.map new file mode 100644 index 0000000..84f0312 --- /dev/null +++ b/node_modules/@noble/hashes/blake2s.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2s.js","sourceRoot":"","sources":["src/blake2s.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,2CAAyD;AACzD,qCAAqC;AACrC,2CAAqF;AACrF,+DAA+D;AAClD,QAAA,MAAM,GAAgB,kBAAS,CAAC;AAC7C,+DAA+D;AAClD,QAAA,GAAG,GAAiB,eAAK,CAAC;AACvC,+DAA+D;AAClD,QAAA,GAAG,GAAiB,eAAK,CAAC;AACvC,+DAA+D;AAClD,QAAA,QAAQ,GAAsB,oBAAU,CAAC;AACtD,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC;AACvC,+DAA+D;AAClD,QAAA,OAAO,GAAe,mBAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake3.d.ts b/node_modules/@noble/hashes/blake3.d.ts new file mode 100644 index 0000000..234fa87 --- /dev/null +++ b/node_modules/@noble/hashes/blake3.d.ts @@ -0,0 +1,54 @@ +import { BLAKE2 } from './blake2.ts'; +import { type CHashXO, type HashXOF, type Input } from './utils.ts'; +/** + * Ensure to use EITHER `key` OR `context`, not both. + * + * * `key`: 32-byte MAC key. + * * `context`: string for KDF. Should be hardcoded, globally unique, and application - specific. + * A good default format for the context string is "[application] [commit timestamp] [purpose]". + */ +export type Blake3Opts = { + dkLen?: number; + key?: Input; + context?: Input; +}; +/** Blake3 hash. Can be used as MAC and KDF. */ +export declare class BLAKE3 extends BLAKE2 implements HashXOF { + private chunkPos; + private chunksDone; + private flags; + private IV; + private state; + private stack; + private posOut; + private bufferOut32; + private bufferOut; + private chunkOut; + private enableXOF; + constructor(opts?: Blake3Opts, flags?: number); + protected get(): []; + protected set(): void; + private b2Compress; + protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void; + _cloneInto(to?: BLAKE3): BLAKE3; + destroy(): void; + private b2CompressOut; + protected finish(): void; + private writeInto; + xofInto(out: Uint8Array): Uint8Array; + xof(bytes: number): Uint8Array; + digestInto(out: Uint8Array): Uint8Array; + digest(): Uint8Array; +} +/** + * BLAKE3 hash function. Can be used as MAC and KDF. + * @param msg - message that would be hashed + * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode + * @example + * const data = new Uint8Array(32); + * const hash = blake3(data); + * const mac = blake3(data, { key: new Uint8Array(32) }); + * const kdf = blake3(data, { context: 'application name' }); + */ +export declare const blake3: CHashXO; +//# sourceMappingURL=blake3.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake3.d.ts.map b/node_modules/@noble/hashes/blake3.d.ts.map new file mode 100644 index 0000000..f951d3d --- /dev/null +++ b/node_modules/@noble/hashes/blake3.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake3.d.ts","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAY,MAAM,aAAa,CAAC;AAE/C,OAAO,EAGL,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EACvC,MAAM,YAAY,CAAC;AAwBpB;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE1E,+CAA+C;AAC/C,qBAAa,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAE,YAAW,OAAO,CAAC,MAAM,CAAC;IACnE,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,EAAE,CAAc;IACxB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAqB;IAElC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAQ;gBAEb,IAAI,GAAE,UAAe,EAAE,KAAK,SAAI;IA2B5C,SAAS,CAAC,GAAG,IAAI,EAAE;IAGnB,SAAS,CAAC,GAAG,IAAI,IAAI;IACrB,OAAO,CAAC,UAAU;IAmBlB,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAAE,MAAU,EAAE,MAAM,GAAE,OAAe,GAAG,IAAI;IAiCvF,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAe/B,OAAO,IAAI,IAAI;IAMf,OAAO,CAAC,aAAa;IA+BrB,SAAS,CAAC,MAAM,IAAI,IAAI;IAoBxB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAIpC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAI9B,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAQvC,MAAM,IAAI,UAAU;CAGrB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,OAEpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake3.js b/node_modules/@noble/hashes/blake3.js new file mode 100644 index 0000000..8602342 --- /dev/null +++ b/node_modules/@noble/hashes/blake3.js @@ -0,0 +1,255 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.blake3 = exports.BLAKE3 = void 0; +/** + * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. + * + * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. + * Why is this so slow? While it should be 6x faster than blake2b, perf diff is only 20%: + * + * * There is only 30% reduction in number of rounds from blake2s + * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. + * These features are not present in JS, so we only get overhead from trees. + * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. + * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm + * @module + */ +const _md_ts_1 = require("./_md.js"); +const _u64_ts_1 = require("./_u64.js"); +const blake2_ts_1 = require("./blake2.js"); +// prettier-ignore +const utils_ts_1 = require("./utils.js"); +// Flag bitset +const B3_Flags = { + CHUNK_START: 0b1, + CHUNK_END: 0b10, + PARENT: 0b100, + ROOT: 0b1000, + KEYED_HASH: 0b10000, + DERIVE_KEY_CONTEXT: 0b100000, + DERIVE_KEY_MATERIAL: 0b1000000, +}; +const B3_IV = _md_ts_1.SHA256_IV.slice(); +const B3_SIGMA = /* @__PURE__ */ (() => { + const Id = Array.from({ length: 16 }, (_, i) => i); + const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); + const res = []; + for (let i = 0, v = Id; i < 7; i++, v = permute(v)) + res.push(...v); + return Uint8Array.from(res); +})(); +/** Blake3 hash. Can be used as MAC and KDF. */ +class BLAKE3 extends blake2_ts_1.BLAKE2 { + constructor(opts = {}, flags = 0) { + super(64, opts.dkLen === undefined ? 32 : opts.dkLen); + this.chunkPos = 0; // Position of current block in chunk + this.chunksDone = 0; // How many chunks we already have + this.flags = 0 | 0; + this.stack = []; + // Output + this.posOut = 0; + this.bufferOut32 = new Uint32Array(16); + this.chunkOut = 0; // index of output chunk + this.enableXOF = true; + const { key, context } = opts; + const hasContext = context !== undefined; + if (key !== undefined) { + if (hasContext) + throw new Error('Only "key" or "context" can be specified at same time'); + const k = (0, utils_ts_1.toBytes)(key).slice(); + (0, utils_ts_1.abytes)(k, 32); + this.IV = (0, utils_ts_1.u32)(k); + (0, utils_ts_1.swap32IfBE)(this.IV); + this.flags = flags | B3_Flags.KEYED_HASH; + } + else if (hasContext) { + const ctx = (0, utils_ts_1.toBytes)(context); + const contextKey = new BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) + .update(ctx) + .digest(); + this.IV = (0, utils_ts_1.u32)(contextKey); + (0, utils_ts_1.swap32IfBE)(this.IV); + this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; + } + else { + this.IV = B3_IV.slice(); + this.flags = flags; + } + this.state = this.IV.slice(); + this.bufferOut = (0, utils_ts_1.u8)(this.bufferOut32); + } + // Unused + get() { + return []; + } + set() { } + b2Compress(counter, flags, buf, bufPos = 0) { + const { state: s, pos } = this; + const { h, l } = (0, _u64_ts_1.fromBig)(BigInt(counter), true); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = (0, blake2_ts_1.compress)(B3_SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags); + s[0] = v0 ^ v8; + s[1] = v1 ^ v9; + s[2] = v2 ^ v10; + s[3] = v3 ^ v11; + s[4] = v4 ^ v12; + s[5] = v5 ^ v13; + s[6] = v6 ^ v14; + s[7] = v7 ^ v15; + } + compress(buf, bufPos = 0, isLast = false) { + // Compress last block + let flags = this.flags; + if (!this.chunkPos) + flags |= B3_Flags.CHUNK_START; + if (this.chunkPos === 15 || isLast) + flags |= B3_Flags.CHUNK_END; + if (!isLast) + this.pos = this.blockLen; + this.b2Compress(this.chunksDone, flags, buf, bufPos); + this.chunkPos += 1; + // If current block is last in chunk (16 blocks), then compress chunks + if (this.chunkPos === 16 || isLast) { + let chunk = this.state; + this.state = this.IV.slice(); + // If not the last one, compress only when there are trailing zeros in chunk counter + // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. + // 1 (001) - leaf not finished (just push current chunk to stack) + // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) + // 3 (011) - last leaf not finished + // 4 (100) - leafs finished at depth=1 and depth=2 + for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { + if (!(last = this.stack.pop())) + break; + this.buffer32.set(last, 0); + this.buffer32.set(chunk, 8); + this.pos = this.blockLen; + this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); + chunk = this.state; + this.state = this.IV.slice(); + } + this.chunksDone++; + this.chunkPos = 0; + this.stack.push(chunk); + } + this.pos = 0; + } + _cloneInto(to) { + to = super._cloneInto(to); + const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; + to.state.set(state.slice()); + to.stack = stack.map((i) => Uint32Array.from(i)); + to.IV.set(IV); + to.flags = flags; + to.chunkPos = chunkPos; + to.chunksDone = chunksDone; + to.posOut = posOut; + to.chunkOut = chunkOut; + to.enableXOF = this.enableXOF; + to.bufferOut32.set(this.bufferOut32); + return to; + } + destroy() { + this.destroyed = true; + (0, utils_ts_1.clean)(this.state, this.buffer32, this.IV, this.bufferOut32); + (0, utils_ts_1.clean)(...this.stack); + } + // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) + b2CompressOut() { + const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; + const { h, l } = (0, _u64_ts_1.fromBig)(BigInt(this.chunkOut++)); + (0, utils_ts_1.swap32IfBE)(buffer32); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = (0, blake2_ts_1.compress)(B3_SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags); + out32[0] = v0 ^ v8; + out32[1] = v1 ^ v9; + out32[2] = v2 ^ v10; + out32[3] = v3 ^ v11; + out32[4] = v4 ^ v12; + out32[5] = v5 ^ v13; + out32[6] = v6 ^ v14; + out32[7] = v7 ^ v15; + out32[8] = s[0] ^ v8; + out32[9] = s[1] ^ v9; + out32[10] = s[2] ^ v10; + out32[11] = s[3] ^ v11; + out32[12] = s[4] ^ v12; + out32[13] = s[5] ^ v13; + out32[14] = s[6] ^ v14; + out32[15] = s[7] ^ v15; + (0, utils_ts_1.swap32IfBE)(buffer32); + (0, utils_ts_1.swap32IfBE)(out32); + this.posOut = 0; + } + finish() { + if (this.finished) + return; + this.finished = true; + // Padding + (0, utils_ts_1.clean)(this.buffer.subarray(this.pos)); + // Process last chunk + let flags = this.flags | B3_Flags.ROOT; + if (this.stack.length) { + flags |= B3_Flags.PARENT; + (0, utils_ts_1.swap32IfBE)(this.buffer32); + this.compress(this.buffer32, 0, true); + (0, utils_ts_1.swap32IfBE)(this.buffer32); + this.chunksDone = 0; + this.pos = this.blockLen; + } + else { + flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; + } + this.flags = flags; + this.b2CompressOut(); + } + writeInto(out) { + (0, utils_ts_1.aexists)(this, false); + (0, utils_ts_1.abytes)(out); + this.finish(); + const { blockLen, bufferOut } = this; + for (let pos = 0, len = out.length; pos < len;) { + if (this.posOut >= blockLen) + this.b2CompressOut(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out) { + if (!this.enableXOF) + throw new Error('XOF is not possible after digest call'); + return this.writeInto(out); + } + xof(bytes) { + (0, utils_ts_1.anumber)(bytes); + return this.xofInto(new Uint8Array(bytes)); + } + digestInto(out) { + (0, utils_ts_1.aoutput)(out, this); + if (this.finished) + throw new Error('digest() was already called'); + this.enableXOF = false; + this.writeInto(out); + this.destroy(); + return out; + } + digest() { + return this.digestInto(new Uint8Array(this.outputLen)); + } +} +exports.BLAKE3 = BLAKE3; +/** + * BLAKE3 hash function. Can be used as MAC and KDF. + * @param msg - message that would be hashed + * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode + * @example + * const data = new Uint8Array(32); + * const hash = blake3(data); + * const mac = blake3(data, { key: new Uint8Array(32) }); + * const kdf = blake3(data, { context: 'application name' }); + */ +exports.blake3 = (0, utils_ts_1.createXOFer)((opts) => new BLAKE3(opts)); +//# sourceMappingURL=blake3.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/blake3.js.map b/node_modules/@noble/hashes/blake3.js.map new file mode 100644 index 0000000..6c06019 --- /dev/null +++ b/node_modules/@noble/hashes/blake3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake3.js","sourceRoot":"","sources":["src/blake3.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,qCAAqC;AAC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QAAA,MAAM,GAA4B,IAAA,sBAAW,EACxD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/crypto.d.ts b/node_modules/@noble/hashes/crypto.d.ts new file mode 100644 index 0000000..ac181a0 --- /dev/null +++ b/node_modules/@noble/hashes/crypto.d.ts @@ -0,0 +1,2 @@ +export declare const crypto: any; +//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/crypto.d.ts.map b/node_modules/@noble/hashes/crypto.d.ts.map new file mode 100644 index 0000000..4ecc6bc --- /dev/null +++ b/node_modules/@noble/hashes/crypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,EAAE,GACqE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/crypto.js b/node_modules/@noble/hashes/crypto.js new file mode 100644 index 0000000..8226391 --- /dev/null +++ b/node_modules/@noble/hashes/crypto.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.crypto = void 0; +exports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; +//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/crypto.js.map b/node_modules/@noble/hashes/crypto.js.map new file mode 100644 index 0000000..0bb417c --- /dev/null +++ b/node_modules/@noble/hashes/crypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.js","sourceRoot":"","sources":["src/crypto.ts"],"names":[],"mappings":";;;AAOa,QAAA,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/cryptoNode.d.ts b/node_modules/@noble/hashes/cryptoNode.d.ts new file mode 100644 index 0000000..98bda7b --- /dev/null +++ b/node_modules/@noble/hashes/cryptoNode.d.ts @@ -0,0 +1,2 @@ +export declare const crypto: any; +//# sourceMappingURL=cryptoNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/cryptoNode.d.ts.map b/node_modules/@noble/hashes/cryptoNode.d.ts.map new file mode 100644 index 0000000..4303dc7 --- /dev/null +++ b/node_modules/@noble/hashes/cryptoNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cryptoNode.d.ts","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,EAAE,GAKJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/cryptoNode.js b/node_modules/@noble/hashes/cryptoNode.js new file mode 100644 index 0000000..eba1a1f --- /dev/null +++ b/node_modules/@noble/hashes/cryptoNode.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.crypto = void 0; +/** + * Internal webcrypto alias. + * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. + * Falls back to Node.js built-in crypto for Node.js <=v14. + * See utils.ts for details. + * @module + */ +// @ts-ignore +const nc = require("node:crypto"); +exports.crypto = nc && typeof nc === 'object' && 'webcrypto' in nc + ? nc.webcrypto + : nc && typeof nc === 'object' && 'randomBytes' in nc + ? nc + : undefined; +//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/cryptoNode.js.map b/node_modules/@noble/hashes/cryptoNode.js.map new file mode 100644 index 0000000..14983d5 --- /dev/null +++ b/node_modules/@noble/hashes/cryptoNode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["src/cryptoNode.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,aAAa;AACb,kCAAkC;AACrB,QAAA,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE;IAC/C,CAAC,CAAE,EAAE,CAAC,SAAiB;IACvB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,aAAa,IAAI,EAAE;QACnD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/eskdf.d.ts b/node_modules/@noble/hashes/eskdf.d.ts new file mode 100644 index 0000000..66721eb --- /dev/null +++ b/node_modules/@noble/hashes/eskdf.d.ts @@ -0,0 +1,47 @@ +export declare function scrypt(password: string, salt: string): Uint8Array; +export declare function pbkdf2(password: string, salt: string): Uint8Array; +/** + * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. + */ +export declare function deriveMainSeed(username: string, password: string): Uint8Array; +type AccountID = number | string; +type OptsLength = { + keyLength: number; +}; +type OptsMod = { + modulus: bigint; +}; +type KeyOpts = undefined | OptsLength | OptsMod; +export interface ESKDF { + /** + * Derives a child key. Child key will not be associated with any + * other child key because of properties of underlying KDF. + * + * @param protocol - 3-15 character protocol name + * @param accountId - numeric identifier of account + * @param options - `keyLength: 64` or `modulus: 41920438n` + * @example deriveChildKey('aes', 0) + */ + deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; + /** + * Deletes the main seed from eskdf instance + */ + expire: () => void; + /** + * Account fingerprint + */ + fingerprint: string; +} +/** + * ESKDF + * @param username - username, email, or identifier, min: 8 characters, should have enough entropy + * @param password - password, min: 8 characters, should have enough entropy + * @example + * const kdf = await eskdf('example-university', 'beginning-new-example'); + * const key = kdf.deriveChildKey('aes', 0); + * console.log(kdf.fingerprint); + * kdf.expire(); + */ +export declare function eskdf(username: string, password: string): Promise; +export {}; +//# sourceMappingURL=eskdf.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/eskdf.d.ts.map b/node_modules/@noble/hashes/eskdf.d.ts.map new file mode 100644 index 0000000..1314513 --- /dev/null +++ b/node_modules/@noble/hashes/eskdf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eskdf.d.ts","sourceRoot":"","sources":["src/eskdf.ts"],"names":[],"mappings":"AAiBA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAGD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAiBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAY7E;AAED,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAgCjC,KAAK,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,KAAK,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACnC,KAAK,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAwChD,MAAM,WAAW,KAAK;IACpB;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC;IAC1F;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAuB9E"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/eskdf.js b/node_modules/@noble/hashes/eskdf.js new file mode 100644 index 0000000..ac23290 --- /dev/null +++ b/node_modules/@noble/hashes/eskdf.js @@ -0,0 +1,166 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.scrypt = scrypt; +exports.pbkdf2 = pbkdf2; +exports.deriveMainSeed = deriveMainSeed; +exports.eskdf = eskdf; +/** + * Experimental KDF for AES. + */ +const hkdf_ts_1 = require("./hkdf.js"); +const pbkdf2_ts_1 = require("./pbkdf2.js"); +const scrypt_ts_1 = require("./scrypt.js"); +const sha256_ts_1 = require("./sha256.js"); +const utils_ts_1 = require("./utils.js"); +// A tiny KDF for various applications like AES key-gen. +// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". +// Which is good enough: assume sha2-256 retained preimage resistance. +const SCRYPT_FACTOR = 2 ** 19; +const PBKDF2_FACTOR = 2 ** 17; +// Scrypt KDF +function scrypt(password, salt) { + return (0, scrypt_ts_1.scrypt)(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); +} +// PBKDF2-HMAC-SHA256 +function pbkdf2(password, salt) { + return (0, pbkdf2_ts_1.pbkdf2)(sha256_ts_1.sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); +} +// Combines two 32-byte byte arrays +function xor32(a, b) { + (0, utils_ts_1.abytes)(a, 32); + (0, utils_ts_1.abytes)(b, 32); + const arr = new Uint8Array(32); + for (let i = 0; i < 32; i++) { + arr[i] = a[i] ^ b[i]; + } + return arr; +} +function strHasLength(str, min, max) { + return typeof str === 'string' && str.length >= min && str.length <= max; +} +/** + * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. + */ +function deriveMainSeed(username, password) { + if (!strHasLength(username, 8, 255)) + throw new Error('invalid username'); + if (!strHasLength(password, 8, 255)) + throw new Error('invalid password'); + // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. + // String with non-ascii may be problematic in some envs + const codes = { _1: 1, _2: 2 }; + const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; + const scr = scrypt(password + sep.s, username + sep.s); + const pbk = pbkdf2(password + sep.p, username + sep.p); + const res = xor32(scr, pbk); + (0, utils_ts_1.clean)(scr, pbk); + return res; +} +/** + * Converts protocol & accountId pair to HKDF salt & info params. + */ +function getSaltInfo(protocol, accountId = 0) { + // Note that length here also repeats two lines below + // We do an additional length check here to reduce the scope of DoS attacks + if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { + throw new Error('invalid protocol'); + } + // Allow string account ids for some protocols + const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); + let salt; // Extract salt. Default is undefined. + if (typeof accountId === 'string') { + if (!allowsStr) + throw new Error('accountId must be a number'); + if (!strHasLength(accountId, 1, 255)) + throw new Error('accountId must be string of length 1..255'); + salt = (0, utils_ts_1.kdfInputToBytes)(accountId); + } + else if (Number.isSafeInteger(accountId)) { + if (accountId < 0 || accountId > Math.pow(2, 32) - 1) + throw new Error('invalid accountId'); + // Convert to Big Endian Uint32 + salt = new Uint8Array(4); + (0, utils_ts_1.createView)(salt).setUint32(0, accountId, false); + } + else { + throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); + } + const info = (0, utils_ts_1.kdfInputToBytes)(protocol); + return { salt, info }; +} +function countBytes(num) { + if (typeof num !== 'bigint' || num <= BigInt(128)) + throw new Error('invalid number'); + return Math.ceil(num.toString(2).length / 8); +} +/** + * Parses keyLength and modulus options to extract length of result key. + * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. + */ +function getKeyLength(options) { + if (!options || typeof options !== 'object') + return 32; + const hasLen = 'keyLength' in options; + const hasMod = 'modulus' in options; + if (hasLen && hasMod) + throw new Error('cannot combine keyLength and modulus options'); + if (!hasLen && !hasMod) + throw new Error('must have either keyLength or modulus option'); + // FIPS 186 B.4.1 requires at least 64 more bits + const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; + if (!(typeof l === 'number' && l >= 16 && l <= 8192)) + throw new Error('invalid keyLength'); + return l; +} +/** + * Converts key to bigint and divides it by modulus. Big Endian. + * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. + */ +function modReduceKey(key, modulus) { + const _1 = BigInt(1); + const num = BigInt('0x' + (0, utils_ts_1.bytesToHex)(key)); // check for ui8a, then bytesToNumber() + const res = (num % (modulus - _1)) + _1; // Remove 0 from output + if (res < _1) + throw new Error('expected positive number'); // Guard against bad values + const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes + const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() + const bytes = (0, utils_ts_1.hexToBytes)(hex); + if (bytes.length !== len) + throw new Error('invalid length of result key'); + return bytes; +} +/** + * ESKDF + * @param username - username, email, or identifier, min: 8 characters, should have enough entropy + * @param password - password, min: 8 characters, should have enough entropy + * @example + * const kdf = await eskdf('example-university', 'beginning-new-example'); + * const key = kdf.deriveChildKey('aes', 0); + * console.log(kdf.fingerprint); + * kdf.expire(); + */ +async function eskdf(username, password) { + // We are using closure + object instead of class because + // we want to make `seed` non-accessible for any external function. + let seed = deriveMainSeed(username, password); + function deriveCK(protocol, accountId = 0, options) { + (0, utils_ts_1.abytes)(seed, 32); + const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId + const keyLength = getKeyLength(options); // validate options + const key = (0, hkdf_ts_1.hkdf)(sha256_ts_1.sha256, seed, salt, info, keyLength); + // Modulus has already been validated + return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; + } + function expire() { + if (seed) + seed.fill(1); + seed = undefined; + } + // prettier-ignore + const fingerprint = Array.from(deriveCK('fingerprint', 0)) + .slice(0, 6) + .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) + .join(':'); + return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); +} +//# sourceMappingURL=eskdf.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/eskdf.js.map b/node_modules/@noble/hashes/eskdf.js.map new file mode 100644 index 0000000..c520444 --- /dev/null +++ b/node_modules/@noble/hashes/eskdf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"eskdf.js","sourceRoot":"","sources":["src/eskdf.ts"],"names":[],"mappings":";;AAiBA,wBAEC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QACrC,OAAO,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpF,CAAC;IACD,SAAS,MAAM;QACb,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,GAAG,SAAS,CAAC;IACnB,CAAC;IACD,kBAAkB;IAClB,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;SACvD,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/D,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_assert.d.ts b/node_modules/@noble/hashes/esm/_assert.d.ts new file mode 100644 index 0000000..5d62f87 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_assert.d.ts @@ -0,0 +1,17 @@ +/** + * Internal assertion helpers. + * @module + * @deprecated + */ +import { abytes as ab, aexists as ae, anumber as an, aoutput as ao, type IHash as H } from './utils.ts'; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const abytes: typeof ab; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const aexists: typeof ae; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const anumber: typeof an; +/** @deprecated Use import from `noble/hashes/utils` module */ +export declare const aoutput: typeof ao; +/** @deprecated Use import from `noble/hashes/utils` module */ +export type Hash = H; +//# sourceMappingURL=_assert.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_assert.d.ts.map b/node_modules/@noble/hashes/esm/_assert.d.ts.map new file mode 100644 index 0000000..8e49f06 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_assert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_assert.d.ts","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,KAAK,KAAK,IAAI,CAAC,EAChB,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,eAAO,MAAM,MAAM,EAAE,OAAO,EAAO,CAAC;AACpC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,OAAO,EAAO,CAAC;AACrC,8DAA8D;AAC9D,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_assert.js b/node_modules/@noble/hashes/esm/_assert.js new file mode 100644 index 0000000..91286fd --- /dev/null +++ b/node_modules/@noble/hashes/esm/_assert.js @@ -0,0 +1,15 @@ +/** + * Internal assertion helpers. + * @module + * @deprecated + */ +import { abytes as ab, aexists as ae, anumber as an, aoutput as ao, } from "./utils.js"; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const abytes = ab; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const aexists = ae; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const anumber = an; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const aoutput = ao; +//# sourceMappingURL=_assert.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_assert.js.map b/node_modules/@noble/hashes/esm/_assert.js.map new file mode 100644 index 0000000..a64fcf5 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_assert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_assert.js","sourceRoot":"","sources":["../src/_assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,MAAM,IAAI,EAAE,EACZ,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,EACb,OAAO,IAAI,EAAE,GAEd,MAAM,YAAY,CAAC;AACpB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,MAAM,GAAc,EAAE,CAAC;AACpC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC;AACrC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC;AACrC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_blake.d.ts b/node_modules/@noble/hashes/esm/_blake.d.ts new file mode 100644 index 0000000..71ed85f --- /dev/null +++ b/node_modules/@noble/hashes/esm/_blake.d.ts @@ -0,0 +1,14 @@ +/** + * Internal blake variable. + * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. + */ +export declare const BSIGMA: Uint8Array; +export type Num4 = { + a: number; + b: number; + c: number; + d: number; +}; +export declare function G1s(a: number, b: number, c: number, d: number, x: number): Num4; +export declare function G2s(a: number, b: number, c: number, d: number, x: number): Num4; +//# sourceMappingURL=_blake.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_blake.d.ts.map b/node_modules/@noble/hashes/esm/_blake.d.ts.map new file mode 100644 index 0000000..c945f9d --- /dev/null +++ b/node_modules/@noble/hashes/esm/_blake.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_blake.d.ts","sourceRoot":"","sources":["../src/_blake.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,eAAO,MAAM,MAAM,EAAE,UAkBnB,CAAC;AAGH,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;CAAE,CAAC;AAGnE,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM/E"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_blake.js b/node_modules/@noble/hashes/esm/_blake.js new file mode 100644 index 0000000..3573ee9 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_blake.js @@ -0,0 +1,45 @@ +/** + * Internal helpers for blake hash. + * @module + */ +import { rotr } from "./utils.js"; +/** + * Internal blake variable. + * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. + */ +// prettier-ignore +export const BSIGMA = /* @__PURE__ */ Uint8Array.from([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, + 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, + 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, + 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, + 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, + 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, + 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, + 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, + 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, + // Blake1, unused in others + 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, + 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, + 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, + 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, +]); +// Mixing function G splitted in two halfs +export function G1s(a, b, c, d, x) { + a = (a + b + x) | 0; + d = rotr(d ^ a, 16); + c = (c + d) | 0; + b = rotr(b ^ c, 12); + return { a, b, c, d }; +} +export function G2s(a, b, c, d, x) { + a = (a + b + x) | 0; + d = rotr(d ^ a, 8); + c = (c + d) | 0; + b = rotr(b ^ c, 7); + return { a, b, c, d }; +} +//# sourceMappingURL=_blake.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_blake.js.map b/node_modules/@noble/hashes/esm/_blake.js.map new file mode 100644 index 0000000..c8cdaaa --- /dev/null +++ b/node_modules/@noble/hashes/esm/_blake.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_blake.js","sourceRoot":"","sources":["../src/_blake.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;;GAGG;AACH,kBAAkB;AAClB,MAAM,CAAC,MAAM,MAAM,GAAe,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC;IAChE,CAAC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AAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_md.d.ts b/node_modules/@noble/hashes/esm/_md.d.ts new file mode 100644 index 0000000..ae184df --- /dev/null +++ b/node_modules/@noble/hashes/esm/_md.d.ts @@ -0,0 +1,51 @@ +/** + * Internal Merkle-Damgard hash utils. + * @module + */ +import { type Input, Hash } from './utils.ts'; +/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ +export declare function setBigUint64(view: DataView, byteOffset: number, value: bigint, isLE: boolean): void; +/** Choice: a ? b : c */ +export declare function Chi(a: number, b: number, c: number): number; +/** Majority function, true if any two inputs is true. */ +export declare function Maj(a: number, b: number, c: number): number; +/** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + */ +export declare abstract class HashMD> extends Hash { + protected abstract process(buf: DataView, offset: number): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + abstract destroy(): void; + protected abstract roundClean(): void; + readonly blockLen: number; + readonly outputLen: number; + readonly padOffset: number; + readonly isLE: boolean; + protected buffer: Uint8Array; + protected view: DataView; + protected finished: boolean; + protected length: number; + protected pos: number; + protected destroyed: boolean; + constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean); + update(data: Input): this; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; + _cloneInto(to?: T): T; + clone(): T; +} +/** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ +/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ +export declare const SHA256_IV: Uint32Array; +/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ +export declare const SHA224_IV: Uint32Array; +/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ +export declare const SHA384_IV: Uint32Array; +/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ +export declare const SHA512_IV: Uint32Array; +//# sourceMappingURL=_md.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_md.d.ts.map b/node_modules/@noble/hashes/esm/_md.d.ts.map new file mode 100644 index 0000000..d67c970 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_md.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_md.d.ts","sourceRoot":"","sources":["../src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,IAAI,EAAwD,MAAM,YAAY,CAAC;AAEpG,gGAAgG;AAChG,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,GACZ,IAAI,CAUN;AAED,wBAAwB;AACxB,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,yDAAyD;AACzD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,8BAAsB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,CAAC,CAAC;IAC/D,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,QA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diff --git a/node_modules/@noble/hashes/esm/_md.js b/node_modules/@noble/hashes/esm/_md.js new file mode 100644 index 0000000..3cf023d --- /dev/null +++ b/node_modules/@noble/hashes/esm/_md.js @@ -0,0 +1,155 @@ +/** + * Internal Merkle-Damgard hash utils. + * @module + */ +import { Hash, abytes, aexists, aoutput, clean, createView, toBytes } from "./utils.js"; +/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ +export function setBigUint64(view, byteOffset, value, isLE) { + if (typeof view.setBigUint64 === 'function') + return view.setBigUint64(byteOffset, value, isLE); + const _32n = BigInt(32); + const _u32_max = BigInt(0xffffffff); + const wh = Number((value >> _32n) & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE ? 4 : 0; + const l = isLE ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE); + view.setUint32(byteOffset + l, wl, isLE); +} +/** Choice: a ? b : c */ +export function Chi(a, b, c) { + return (a & b) ^ (~a & c); +} +/** Majority function, true if any two inputs is true. */ +export function Maj(a, b, c) { + return (a & b) ^ (a & c) ^ (b & c); +} +/** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + */ +export class HashMD extends Hash { + constructor(blockLen, outputLen, padOffset, isLE) { + super(); + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + aexists(this); + data = toBytes(data); + abytes(data); + const { view, buffer, blockLen } = this; + const len = data.length; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path: we have at least one block in input, cast it to view and process + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out) { + aexists(this); + aoutput(out, this); + this.finished = true; + // Padding + // We can avoid allocation of buffer for padding completely if it + // was previously not allocated here. But it won't change performance. + const { buffer, view, blockLen, isLE } = this; + let { pos } = this; + // append the bit '1' to the message + buffer[pos++] = 0b10000000; + clean(this.buffer.subarray(pos)); + // we have less than padOffset left in buffer, so we cannot put length in + // current block, need process it and pad again + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + // Pad until full block byte with zeros + for (let i = pos; i < blockLen; i++) + buffer[i] = 0; + // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that + // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. + // So we just write lowest 64 bits of that value. + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); + this.process(view, 0); + const oview = createView(out); + const len = this.outputLen; + // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT + if (len % 4) + throw new Error('_sha2: outputLen should be aligned to 32bit'); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) + throw new Error('_sha2: outputLen bigger than state'); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + if (length % blockLen) + to.buffer.set(buffer); + return to; + } + clone() { + return this._cloneInto(); + } +} +/** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ +/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ +export const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, +]); +/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ +export const SHA224_IV = /* @__PURE__ */ Uint32Array.from([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, +]); +/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ +export const SHA384_IV = /* @__PURE__ */ Uint32Array.from([ + 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, + 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, +]); +/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ +export const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, +]); +//# sourceMappingURL=_md.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_md.js.map b/node_modules/@noble/hashes/esm/_md.js.map new file mode 100644 index 0000000..4b3da57 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_md.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_md.js","sourceRoot":"","sources":["../src/_md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAc,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpG,gGAAgG;AAChG,MAAM,UAAU,YAAY,CAC1B,IAAc,EACd,UAAkB,EAClB,KAAa,EACb,IAA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UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAgB,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IACrE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/F,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_u64.d.ts b/node_modules/@noble/hashes/esm/_u64.d.ts new file mode 100644 index 0000000..ac5523a --- /dev/null +++ b/node_modules/@noble/hashes/esm/_u64.d.ts @@ -0,0 +1,55 @@ +declare function fromBig(n: bigint, le?: boolean): { + h: number; + l: number; +}; +declare function split(lst: bigint[], le?: boolean): Uint32Array[]; +declare const toBig: (h: number, l: number) => bigint; +declare const shrSH: (h: number, _l: number, s: number) => number; +declare const shrSL: (h: number, l: number, s: number) => number; +declare const rotrSH: (h: number, l: number, s: number) => number; +declare const rotrSL: (h: number, l: number, s: number) => number; +declare const rotrBH: (h: number, l: number, s: number) => number; +declare const rotrBL: (h: number, l: number, s: number) => number; +declare const rotr32H: (_h: number, l: number) => number; +declare const rotr32L: (h: number, _l: number) => number; +declare const rotlSH: (h: number, l: number, s: number) => number; +declare const rotlSL: (h: number, l: number, s: number) => number; +declare const rotlBH: (h: number, l: number, s: number) => number; +declare const rotlBL: (h: number, l: number, s: number) => number; +declare function add(Ah: number, Al: number, Bh: number, Bl: number): { + h: number; + l: number; +}; +declare const add3L: (Al: number, Bl: number, Cl: number) => number; +declare const add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; +declare const add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; +declare const add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; +declare const add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; +declare const add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; +export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; +declare const u64: { + fromBig: typeof fromBig; + split: typeof split; + toBig: (h: number, l: number) => bigint; + shrSH: (h: number, _l: number, s: number) => number; + shrSL: (h: number, l: number, s: number) => number; + rotrSH: (h: number, l: number, s: number) => number; + rotrSL: (h: number, l: number, s: number) => number; + rotrBH: (h: number, l: number, s: number) => number; + rotrBL: (h: number, l: number, s: number) => number; + rotr32H: (_h: number, l: number) => number; + rotr32L: (h: number, _l: number) => number; + rotlSH: (h: number, l: number, s: number) => number; + rotlSL: (h: number, l: number, s: number) => number; + rotlBH: (h: number, l: number, s: number) => number; + rotlBL: (h: number, l: number, s: number) => number; + add: typeof add; + add3L: (Al: number, Bl: number, Cl: number) => number; + add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; + add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; + add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; + add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; + add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; +}; +export default u64; +//# sourceMappingURL=_u64.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_u64.d.ts.map b/node_modules/@noble/hashes/esm/_u64.d.ts.map new file mode 100644 index 0000000..b1e0a4e --- /dev/null +++ b/node_modules/@noble/hashes/esm/_u64.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"_u64.d.ts","sourceRoot":"","sources":["../src/_u64.ts"],"names":[],"mappings":"AAQA,iBAAS,OAAO,CACd,CAAC,EAAE,MAAM,EACT,EAAE,UAAQ,GACT;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAA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No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_u64.js b/node_modules/@noble/hashes/esm/_u64.js new file mode 100644 index 0000000..6519354 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_u64.js @@ -0,0 +1,67 @@ +/** + * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. + * @todo re-check https://issues.chromium.org/issues/42212588 + * @module + */ +const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); +const _32n = /* @__PURE__ */ BigInt(32); +function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; + return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; +} +function split(lst, le = false) { + const len = lst.length; + let Ah = new Uint32Array(len); + let Al = new Uint32Array(len); + for (let i = 0; i < len; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; +} +const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); +// for Shift in [0, 32) +const shrSH = (h, _l, s) => h >>> s; +const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +// Right rotate for Shift in [1, 32) +const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); +const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +// Right rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); +const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); +// Right rotate for shift===32 (just swaps l&h) +const rotr32H = (_h, l) => l; +const rotr32L = (h, _l) => h; +// Left rotate for Shift in [1, 32) +const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); +const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); +// Left rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); +const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); +// JS uses 32-bit signed integers for bitwise operations which means we cannot +// simple take carry out of low bit sum by shift, we need to use division. +function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; +} +// Addition with more than 2 elements +const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; +const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; +const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; +// prettier-ignore +export { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig }; +// prettier-ignore +const u64 = { + fromBig, split, toBig, + shrSH, shrSL, + rotrSH, rotrSL, rotrBH, rotrBL, + rotr32H, rotr32L, + rotlSH, rotlSL, rotlBH, rotlBL, + add, add3L, add3H, add4L, add4H, add5H, add5L, +}; +export default u64; +//# sourceMappingURL=_u64.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/_u64.js.map b/node_modules/@noble/hashes/esm/_u64.js.map new file mode 100644 index 0000000..3626186 --- /dev/null +++ b/node_modules/@noble/hashes/esm/_u64.js.map @@ -0,0 +1 @@ +{"version":3,"file":"_u64.js","sourceRoot":"","sources":["../src/_u64.ts"],"names":[],"m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AC,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACjE,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAU,EAAE,CAChG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEvD,kBAAkB;AAClB,OAAO,EACL,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EACrK,CAAC;AACF,kBAAkB;AAClB,MAAM,GAAG,GAAkpC;IACzpC,OAAO,EAAE,KAAK,EAAE,KAAK;IACrB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9B,OAAO,EAAE,OAAO;IAChB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC9B,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;CAC9C,CAAC;AACF,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/argon2.d.ts b/node_modules/@noble/hashes/esm/argon2.d.ts new file mode 100644 index 0000000..67cb8f6 --- /dev/null +++ b/node_modules/@noble/hashes/esm/argon2.d.ts @@ -0,0 +1,32 @@ +import { type KDFInput } from './utils.ts'; +/** + * Argon2 options. + * * t: time cost, m: mem cost in kb, p: parallelization. + * * key: optional key. personalization: arbitrary extra data. + * * dkLen: desired number of output bytes. + */ +export type ArgonOpts = { + t: number; + m: number; + p: number; + version?: number; + key?: KDFInput; + personalization?: KDFInput; + dkLen?: number; + asyncTick?: number; + maxmem?: number; + onProgress?: (progress: number) => void; +}; +/** argon2d GPU-resistant version. */ +export declare const argon2d: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; +/** argon2i side-channel-resistant version. */ +export declare const argon2i: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; +/** argon2id, combining i+d, the most popular version from RFC 9106 */ +export declare const argon2id: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array; +/** argon2d async GPU-resistant version. */ +export declare const argon2dAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; +/** argon2i async side-channel-resistant version. */ +export declare const argon2iAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; +/** argon2id async, combining i+d, the most popular version from RFC 9106 */ +export declare const argon2idAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise; +//# sourceMappingURL=argon2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/argon2.d.ts.map b/node_modules/@noble/hashes/esm/argon2.d.ts.map new file mode 100644 index 0000000..65b1e4c --- /dev/null +++ b/node_modules/@noble/hashes/esm/argon2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"argon2.d.ts","sourceRoot":"","sources":["../src/argon2.ts"],"names":[],"mappings":"AAYA,OAAO,EAAqD,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAkK9F;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAuNF,qCAAqC;AACrC,eAAO,MAAM,OAAO,GAAI,UAAU,QAAQ,EAAE,MAAM,QAAQ,EAAE,MAAM,SAAS,KAAG,UACnC,CAAC;AAC5C,8CAA8C;AAC9C,eAAO,MAAM,OAAO,GAAI,UAAU,QAAQ,EAAE,MAAM,QAAQ,EAAE,MAAM,SAAS,KAAG,UACpC,CAAC;AAC3C,sEAAsE;AACtE,eAAO,MAAM,QAAQ,GAAI,UAAU,QAAQ,EAAE,MAAM,QAAQ,EAAE,MAAM,SAAS,KAAG,UACpC,CAAC;AAiE5C,2CAA2C;AAC3C,eAAO,MAAM,YAAY,GACvB,UAAU,QAAQ,EAClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAmD,CAAC;AACzE,oDAAoD;AACpD,eAAO,MAAM,YAAY,GACvB,UAAU,QAAQ,EAClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAkD,CAAC;AACxE,4EAA4E;AAC5E,eAAO,MAAM,aAAa,GACxB,UAAU,QAAQ,EAClB,MAAM,QAAQ,EACd,MAAM,SAAS,KACd,OAAO,CAAC,UAAU,CAAmD,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/argon2.js b/node_modules/@noble/hashes/esm/argon2.js new file mode 100644 index 0000000..3ba860f --- /dev/null +++ b/node_modules/@noble/hashes/esm/argon2.js @@ -0,0 +1,392 @@ +/** + * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. + * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: + * * argon uses uint64, but JS doesn't have fast uint64array + * * uint64 multiplication is 1/3 of time + * * `P` function would be very nice with u64, because most of value will be in registers, + * hovewer with u32 it will require 32 registers, which is too much. + * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down + * @module + */ +import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from "./_u64.js"; +import { blake2b } from "./blake2.js"; +import { abytes, clean, kdfInputToBytes, nextTick, u32, u8 } from "./utils.js"; +const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 }; +const ARGON2_SYNC_POINTS = 4; +const abytesOrZero = (buf) => { + if (buf === undefined) + return Uint8Array.of(); + return kdfInputToBytes(buf); +}; +// u32 * u32 = u64 +function mul(a, b) { + const aL = a & 0xffff; + const aH = a >>> 16; + const bL = b & 0xffff; + const bH = b >>> 16; + const ll = Math.imul(aL, bL); + const hl = Math.imul(aH, bL); + const lh = Math.imul(aL, bH); + const hh = Math.imul(aH, bH); + const carry = (ll >>> 16) + (hl & 0xffff) + lh; + const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; + const low = (carry << 16) | (ll & 0xffff); + return { h: high, l: low }; +} +function mul2(a, b) { + // 2 * a * b (via shifts) + const { h, l } = mul(a, b); + return { h: ((h << 1) | (l >>> 31)) & 4294967295, l: (l << 1) & 4294967295 }; +} +// BlaMka permutation for Argon2 +// A + B + (2 * u32(A) * u32(B)) +function blamka(Ah, Al, Bh, Bl) { + const { h: Ch, l: Cl } = mul2(Al, Bl); + // A + B + (2 * A * B) + const Rll = add3L(Al, Bl, Cl); + return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; +} +// Temporary block buffer +const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) +function G(a, b, c, d) { + let Al = A2_BUF[2 * a], Ah = A2_BUF[2 * a + 1]; // prettier-ignore + let Bl = A2_BUF[2 * b], Bh = A2_BUF[2 * b + 1]; // prettier-ignore + let Cl = A2_BUF[2 * c], Ch = A2_BUF[2 * c + 1]; // prettier-ignore + let Dl = A2_BUF[2 * d], Dh = A2_BUF[2 * d + 1]; // prettier-ignore + ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); + ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); + ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); + ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); + (A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah); + (A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh); + (A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch); + (A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh); +} +// prettier-ignore +function P(v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v10, v11, v12, v13, v14, v15) { + G(v00, v04, v08, v12); + G(v01, v05, v09, v13); + G(v02, v06, v10, v14); + G(v03, v07, v11, v15); + G(v00, v05, v10, v15); + G(v01, v06, v11, v12); + G(v02, v07, v08, v13); + G(v03, v04, v09, v14); +} +function block(x, xPos, yPos, outPos, needXor) { + for (let i = 0; i < 256; i++) + A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; + // columns (8) + for (let i = 0; i < 128; i += 16) { + // prettier-ignore + P(i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15); + } + // rows (8) + for (let i = 0; i < 16; i += 2) { + // prettier-ignore + P(i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113); + } + if (needXor) + for (let i = 0; i < 256; i++) + x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; + else + for (let i = 0; i < 256; i++) + x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; + clean(A2_BUF); +} +// Variable-Length Hash Function H' +function Hp(A, dkLen) { + const A8 = u8(A); + const T = new Uint32Array(1); + const T8 = u8(T); + T[0] = dkLen; + // Fast path + if (dkLen <= 64) + return blake2b.create({ dkLen }).update(T8).update(A8).digest(); + const out = new Uint8Array(dkLen); + let V = blake2b.create({}).update(T8).update(A8).digest(); + let pos = 0; + // First block + out.set(V.subarray(0, 32)); + pos += 32; + // Rest blocks + for (; dkLen - pos > 64; pos += 32) { + const Vh = blake2b.create({}).update(V); + Vh.digestInto(V); + Vh.destroy(); + out.set(V.subarray(0, 32), pos); + } + // Last block + out.set(blake2b(V, { dkLen: dkLen - pos }), pos); + clean(V, T); + return u32(out); +} +// Used only inside process block! +function indexAlpha(r, s, laneLen, segmentLen, index, randL, sameLane = false) { + // This is ugly, but close enough to reference implementation. + let area; + if (r === 0) { + if (s === 0) + area = index - 1; + else if (sameLane) + area = s * segmentLen + index - 1; + else + area = s * segmentLen + (index == 0 ? -1 : 0); + } + else if (sameLane) + area = laneLen - segmentLen + index - 1; + else + area = laneLen - segmentLen + (index == 0 ? -1 : 0); + const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; + const rel = area - 1 - mul(area, mul(randL, randL).h).h; + return (startPos + rel) % laneLen; +} +const maxUint32 = Math.pow(2, 32); +function isU32(num) { + return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; +} +function argon2Opts(opts) { + const merged = { + version: 0x13, + dkLen: 32, + maxmem: maxUint32 - 1, + asyncTick: 10, + }; + for (let [k, v] of Object.entries(opts)) + if (v != null) + merged[k] = v; + const { dkLen, p, m, t, version, onProgress } = merged; + if (!isU32(dkLen) || dkLen < 4) + throw new Error('dkLen should be at least 4 bytes'); + if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) + throw new Error('p should be 1 <= p < 2^24'); + if (!isU32(m)) + throw new Error('m should be 0 <= m < 2^32'); + if (!isU32(t) || t < 1) + throw new Error('t (iterations) should be 1 <= t < 2^32'); + if (onProgress !== undefined && typeof onProgress !== 'function') + throw new Error('progressCb should be function'); + /* + Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. + */ + if (!isU32(m) || m < 8 * p) + throw new Error('memory should be at least 8*p bytes'); + if (version !== 0x10 && version !== 0x13) + throw new Error('unknown version=' + version); + return merged; +} +function argon2Init(password, salt, type, opts) { + password = kdfInputToBytes(password); + salt = kdfInputToBytes(salt); + abytes(password); + abytes(salt); + if (!isU32(password.length)) + throw new Error('password should be less than 4 GB'); + if (!isU32(salt.length) || salt.length < 8) + throw new Error('salt should be at least 8 bytes and less than 4 GB'); + if (!Object.values(AT).includes(type)) + throw new Error('invalid type'); + let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = argon2Opts(opts); + // Validation + key = abytesOrZero(key); + personalization = abytesOrZero(personalization); + // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || + // LE32(v) || LE32(y) || LE32(length(P)) || P || + // LE32(length(S)) || S || LE32(length(K)) || K || + // LE32(length(X)) || X) + const h = blake2b.create({}); + const BUF = new Uint32Array(1); + const BUF8 = u8(BUF); + for (let item of [p, dkLen, m, t, version, type]) { + BUF[0] = item; + h.update(BUF8); + } + for (let i of [password, salt, key, personalization]) { + BUF[0] = i.length; // BUF is u32 array, this is valid + h.update(BUF8).update(i); + } + const H0 = new Uint32Array(18); + const H0_8 = u8(H0); + h.digestInto(H0_8); + // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing + // Params + const lanes = p; + // m' = 4 * p * floor (m / 4p) + const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); + //q = m' / p columns + const laneLen = Math.floor(mP / p); + const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); + const memUsed = mP * 256; + if (!isU32(maxmem) || memUsed > maxmem) + throw new Error('mem should be less than 2**32, got: maxmem=' + maxmem + ', memused=' + memUsed); + const B = new Uint32Array(memUsed); + // Fill first blocks + for (let l = 0; l < p; l++) { + const i = 256 * laneLen * l; + // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) + H0[17] = l; + H0[16] = 0; + B.set(Hp(H0, 1024), i); + // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) + H0[16] = 1; + B.set(Hp(H0, 1024), i + 256); + } + let perBlock = () => { }; + if (onProgress) { + const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; + // Invoke callback if progress changes from 10.01 to 10.02 + // Allows to draw smooth progress bar on up to 8K screen + const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); + let blockCnt = 0; + perBlock = () => { + blockCnt++; + if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) + onProgress(blockCnt / totalBlock); + }; + } + clean(BUF, H0); + return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; +} +function argon2Output(B, p, laneLen, dkLen) { + const B_final = new Uint32Array(256); + for (let l = 0; l < p; l++) + for (let j = 0; j < 256; j++) + B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; + const res = u8(Hp(B_final, dkLen)); + clean(B_final); + return res; +} +function processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor) { + if (offset % laneLen) + prev = offset - 1; + let randL, randH; + if (dataIndependent) { + let i128 = index % 128; + if (i128 === 0) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + randL = address[2 * i128]; + randH = address[2 * i128 + 1]; + } + else { + const T = 256 * prev; + randL = B[T]; + randH = B[T + 1]; + } + // address block + const refLane = r === 0 && s === 0 ? l : randH % lanes; + const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); + const refBlock = laneLen * refLane + refPos; + // B[i][j] = G(B[i][j-1], B[l][z]) + block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); +} +function argon2(type, password, salt, opts) { + const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init(password, salt, type, opts); + // Pre-loop setup + // [address, input, zero_block] format so we can pass single U32 to block function + const address = new Uint32Array(3 * 256); + address[256 + 6] = mP; + address[256 + 8] = t; + address[256 + 10] = type; + for (let r = 0; r < t; r++) { + const needXor = r !== 0 && version === 0x13; + address[256 + 0] = r; + for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { + address[256 + 4] = s; + const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); + for (let l = 0; l < p; l++) { + address[256 + 2] = l; + address[256 + 12] = 0; + let startPos = 0; + if (r === 0 && s === 0) { + startPos = 2; + if (dataIndependent) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + } + // current block postion + let offset = l * laneLen + s * segmentLen + startPos; + // previous block position + let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; + for (let index = startPos; index < segmentLen; index++, offset++, prev++) { + perBlock(); + processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); + } + } + } + } + clean(address); + return argon2Output(B, p, laneLen, dkLen); +} +/** argon2d GPU-resistant version. */ +export const argon2d = (password, salt, opts) => argon2(AT.Argond2d, password, salt, opts); +/** argon2i side-channel-resistant version. */ +export const argon2i = (password, salt, opts) => argon2(AT.Argon2i, password, salt, opts); +/** argon2id, combining i+d, the most popular version from RFC 9106 */ +export const argon2id = (password, salt, opts) => argon2(AT.Argon2id, password, salt, opts); +async function argon2Async(type, password, salt, opts) { + const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = argon2Init(password, salt, type, opts); + // Pre-loop setup + // [address, input, zero_block] format so we can pass single U32 to block function + const address = new Uint32Array(3 * 256); + address[256 + 6] = mP; + address[256 + 8] = t; + address[256 + 10] = type; + let ts = Date.now(); + for (let r = 0; r < t; r++) { + const needXor = r !== 0 && version === 0x13; + address[256 + 0] = r; + for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { + address[256 + 4] = s; + const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); + for (let l = 0; l < p; l++) { + address[256 + 2] = l; + address[256 + 12] = 0; + let startPos = 0; + if (r === 0 && s === 0) { + startPos = 2; + if (dataIndependent) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + } + // current block postion + let offset = l * laneLen + s * segmentLen + startPos; + // previous block position + let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; + for (let index = startPos; index < segmentLen; index++, offset++, prev++) { + perBlock(); + processBlock(B, address, l, r, s, index, laneLen, segmentLen, lanes, offset, prev, dataIndependent, needXor); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (!(diff >= 0 && diff < asyncTick)) { + await nextTick(); + ts += diff; + } + } + } + } + } + clean(address); + return argon2Output(B, p, laneLen, dkLen); +} +/** argon2d async GPU-resistant version. */ +export const argon2dAsync = (password, salt, opts) => argon2Async(AT.Argond2d, password, salt, opts); +/** argon2i async side-channel-resistant version. */ +export const argon2iAsync = (password, salt, opts) => argon2Async(AT.Argon2i, password, salt, opts); +/** argon2id async, combining i+d, the most popular version from RFC 9106 */ +export const argon2idAsync = (password, salt, opts) => argon2Async(AT.Argon2id, password, salt, opts); +//# sourceMappingURL=argon2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/argon2.js.map b/node_modules/@noble/hashes/esm/argon2.js.map new file mode 100644 index 0000000..4016856 --- /dev/null +++ b/node_modules/@noble/hashes/esm/argon2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"argon2.js","sourceRoot":"","sources":["../src/argon2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAiB,MAAM,YAAY,CAAC;AAE9F,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAW,CAAC;AAG7D,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,YAAY,GAAG,CAAC,GAAc,EAAE,EAAE;IACtC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,kBAAkB;AAClB,SAAS,GAAG,CAAC,CAAS,EAAE,CAAS;IAC/B,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;IACpB,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;IACpB,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7B,MAAM,EAAE,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,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzE,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACxE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,QAAkB,EAClB,IAAc,EACd,IAAe,EACM,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake1.d.ts b/node_modules/@noble/hashes/esm/blake1.d.ts new file mode 100644 index 0000000..62d576f --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake1.d.ts @@ -0,0 +1,106 @@ +import { Hash, type CHashO, type Input } from './utils.ts'; +/** Blake1 options. Basically just "salt" */ +export type BlakeOpts = { + salt?: Uint8Array; +}; +declare abstract class BLAKE1> extends Hash { + protected finished: boolean; + protected length: number; + protected pos: number; + protected destroyed: boolean; + protected buffer: Uint8Array; + protected view: DataView; + protected salt: Uint32Array; + abstract compress(view: DataView, offset: number, withLength?: boolean): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + readonly blockLen: number; + readonly outputLen: number; + private lengthFlag; + private counterLen; + protected constants: Uint32Array; + constructor(blockLen: number, outputLen: number, lengthFlag: number, counterLen: number, saltLen: number, constants: Uint32Array, opts?: BlakeOpts); + update(data: Input): this; + destroy(): void; + _cloneInto(to?: T): T; + clone(): T; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; +} +declare class Blake1_32 extends BLAKE1 { + private v0; + private v1; + private v2; + private v3; + private v4; + private v5; + private v6; + private v7; + constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); + protected get(): [number, number, number, number, number, number, number, number]; + protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; + destroy(): void; + compress(view: DataView, offset: number, withLength?: boolean): void; +} +declare class Blake1_64 extends BLAKE1 { + private v0l; + private v0h; + private v1l; + private v1h; + private v2l; + private v2h; + private v3l; + private v3h; + private v4l; + private v4h; + private v5l; + private v5h; + private v6l; + private v6h; + private v7l; + private v7h; + constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts?: BlakeOpts); + protected get(): [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]; + protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; + destroy(): void; + compress(view: DataView, offset: number, withLength?: boolean): void; +} +export declare class BLAKE224 extends Blake1_32 { + constructor(opts?: BlakeOpts); +} +export declare class BLAKE256 extends Blake1_32 { + constructor(opts?: BlakeOpts); +} +export declare class BLAKE384 extends Blake1_64 { + constructor(opts?: BlakeOpts); +} +export declare class BLAKE512 extends Blake1_64 { + constructor(opts?: BlakeOpts); +} +/** blake1-224 hash function */ +export declare const blake224: CHashO; +/** blake1-256 hash function */ +export declare const blake256: CHashO; +/** blake1-384 hash function */ +export declare const blake384: CHashO; +/** blake1-512 hash function */ +export declare const blake512: CHashO; +export {}; +//# sourceMappingURL=blake1.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake1.d.ts.map b/node_modules/@noble/hashes/esm/blake1.d.ts.map new file mode 100644 index 0000000..93d9bcf --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake1.d.ts","sourceRoot":"","sources":["../src/blake1.ts"],"names":[],"mappings":"AA4BA,OAAO,EAGO,IAAI,EAChB,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,C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zB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,IAAI,GAAE,SAAc;CAGjC;AACD,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC;AACF,+BAA+B;AAC/B,eAAO,MAAM,QAAQ,EAAE,MAEtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake1.js b/node_modules/@noble/hashes/esm/blake1.js new file mode 100644 index 0000000..549d49d --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake1.js @@ -0,0 +1,452 @@ +/** + * Blake1 legacy hash function, one of SHA3 proposals. + * Rarely used. Check out blake2 or blake3 instead. + * https://www.aumasson.jp/blake/blake.pdf + * + * In the best case, there are 0 allocations. + * + * Differences from blake2: + * + * - BE instead of LE + * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: + * - length flag is located before actual length + * - padding block is compressed differently (no lengths) + * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` + * (-1 for g1, g2 without -1) + * - Salt is XOR-ed into constants instead of state + * - Salt is XOR-ed with output in `compress` + * - Additional rows (+64 bytes) in SIGMA for new rounds + * - Different round count: + * - 14 / 10 rounds in blake256 / blake2s + * - 16 / 12 rounds in blake512 / blake2b + * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 + * @module + */ +import { BSIGMA, G1s, G2s } from "./_blake.js"; +import { setBigUint64, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from "./_md.js"; +import * as u64 from "./_u64.js"; +// prettier-ignore +import { abytes, aexists, aoutput, clean, createOptHasher, createView, Hash, toBytes, } from "./utils.js"; +// Empty zero-filled salt +const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); +class BLAKE1 extends Hash { + constructor(blockLen, outputLen, lengthFlag, counterLen, saltLen, constants, opts = {}) { + super(); + this.finished = false; + this.length = 0; + this.pos = 0; + this.destroyed = false; + const { salt } = opts; + this.blockLen = blockLen; + this.outputLen = outputLen; + this.lengthFlag = lengthFlag; + this.counterLen = counterLen; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + if (salt) { + let slt = salt; + slt = toBytes(slt); + abytes(slt); + if (slt.length !== 4 * saltLen) + throw new Error('wrong salt length'); + const salt32 = (this.salt = new Uint32Array(saltLen)); + const sv = createView(slt); + this.constants = constants.slice(); + for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { + salt32[i] = sv.getUint32(offset, false); + this.constants[i] ^= salt32[i]; + } + } + else { + this.salt = EMPTY_SALT; + this.constants = constants; + } + } + update(data) { + aexists(this); + data = toBytes(data); + abytes(data); + // From _md, but update length before each compress + const { view, buffer, blockLen } = this; + const len = data.length; + let dataView; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path: we have at least one block in input, cast it to view and process + if (take === blockLen) { + if (!dataView) + dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) { + this.length += blockLen; + this.compress(dataView, pos); + } + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.length += blockLen; + this.compress(view, 0, true); + this.pos = 0; + } + } + return this; + } + destroy() { + this.destroyed = true; + if (this.salt !== EMPTY_SALT) { + clean(this.salt, this.constants); + } + } + _cloneInto(to) { + to || (to = new this.constructor()); + to.set(...this.get()); + const { buffer, length, finished, destroyed, constants, salt, pos } = this; + to.buffer.set(buffer); + to.constants = constants.slice(); + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + to.salt = salt.slice(); + return to; + } + clone() { + return this._cloneInto(); + } + digestInto(out) { + aexists(this); + aoutput(out, this); + this.finished = true; + // Padding + const { buffer, blockLen, counterLen, lengthFlag, view } = this; + clean(buffer.subarray(this.pos)); // clean buf + const counter = BigInt((this.length + this.pos) * 8); + const counterPos = blockLen - counterLen - 1; + buffer[this.pos] |= 128; // End block flag + this.length += this.pos; // add unwritten length + // Not enough in buffer for length: write what we have. + if (this.pos > counterPos) { + this.compress(view, 0); + clean(buffer); + this.pos = 0; + } + // Difference with md: here we have lengthFlag! + buffer[counterPos] |= lengthFlag; // Length flag + // We always set 8 byte length flag. Because length will overflow significantly sooner. + setBigUint64(view, blockLen - 8, counter, false); + this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? + // Write output + clean(buffer); + const v = createView(out); + const state = this.get(); + for (let i = 0; i < this.outputLen / 4; ++i) + v.setUint32(i * 4, state[i]); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } +} +// Constants +const B64C = /* @__PURE__ */ Uint32Array.from([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, + 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, +]); +// first half of C512 +const B32C = B64C.slice(0, 16); +const B256_IV = SHA256_IV.slice(); +const B224_IV = SHA224_IV.slice(); +const B384_IV = SHA384_IV.slice(); +const B512_IV = SHA512_IV.slice(); +function generateTBL256() { + const TBL = []; + for (let i = 0, j = 0; i < 14; i++, j += 16) { + for (let offset = 1; offset < 16; offset += 2) { + TBL.push(B32C[BSIGMA[j + offset]]); + TBL.push(B32C[BSIGMA[j + offset - 1]]); + } + } + return new Uint32Array(TBL); +} +const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute +// Reusable temporary buffer +const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); +class Blake1_32 extends BLAKE1 { + constructor(outputLen, IV, lengthFlag, opts = {}) { + super(64, outputLen, lengthFlag, 8, 4, B32C, opts); + this.v0 = IV[0] | 0; + this.v1 = IV[1] | 0; + this.v2 = IV[2] | 0; + this.v3 = IV[3] | 0; + this.v4 = IV[4] | 0; + this.v5 = IV[5] | 0; + this.v6 = IV[6] | 0; + this.v7 = IV[7] | 0; + } + get() { + const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; + return [v0, v1, v2, v3, v4, v5, v6, v7]; + } + // prettier-ignore + set(v0, v1, v2, v3, v4, v5, v6, v7) { + this.v0 = v0 | 0; + this.v1 = v1 | 0; + this.v2 = v2 | 0; + this.v3 = v3 | 0; + this.v4 = v4 | 0; + this.v5 = v5 | 0; + this.v6 = v6 | 0; + this.v7 = v7 | 0; + } + destroy() { + super.destroy(); + this.set(0, 0, 0, 0, 0, 0, 0, 0); + } + compress(view, offset, withLength = true) { + for (let i = 0; i < 16; i++, offset += 4) + BLAKE256_W[i] = view.getUint32(offset, false); + // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] + let v00 = this.v0 | 0; + let v01 = this.v1 | 0; + let v02 = this.v2 | 0; + let v03 = this.v3 | 0; + let v04 = this.v4 | 0; + let v05 = this.v5 | 0; + let v06 = this.v6 | 0; + let v07 = this.v7 | 0; + let v08 = this.constants[0] | 0; + let v09 = this.constants[1] | 0; + let v10 = this.constants[2] | 0; + let v11 = this.constants[3] | 0; + const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); + let v12 = (this.constants[4] ^ l) >>> 0; + let v13 = (this.constants[5] ^ l) >>> 0; + let v14 = (this.constants[6] ^ h) >>> 0; + let v15 = (this.constants[7] ^ h) >>> 0; + // prettier-ignore + for (let i = 0, k = 0, j = 0; i < 14; i++) { + ({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + } + this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; + this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; + this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; + this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; + this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; + this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; + this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; + this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; + clean(BLAKE256_W); + } +} +const BBUF = /* @__PURE__ */ new Uint32Array(32); +const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); +function generateTBL512() { + const TBL = []; + for (let r = 0, k = 0; r < 16; r++, k += 16) { + for (let offset = 1; offset < 16; offset += 2) { + TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]); + TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]); + TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]); + TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]); + } + } + return new Uint32Array(TBL); +} +const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute +// Mixing function G splitted in two halfs +function G1b(a, b, c, d, msg, k) { + const Xpos = 2 * BSIGMA[k]; + const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore + let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore + let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore + let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore + let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; + Al = (ll | 0) >>> 0; + // v[d] = rotr(v[d] ^ v[a], 32) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 25) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); + (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); + (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); + (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); + (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); +} +function G2b(a, b, c, d, msg, k) { + const Xpos = 2 * BSIGMA[k]; + const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore + let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore + let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore + let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore + let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 16) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 11) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); + (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); + (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); + (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); + (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); +} +class Blake1_64 extends BLAKE1 { + constructor(outputLen, IV, lengthFlag, opts = {}) { + super(128, outputLen, lengthFlag, 16, 8, B64C, opts); + this.v0l = IV[0] | 0; + this.v0h = IV[1] | 0; + this.v1l = IV[2] | 0; + this.v1h = IV[3] | 0; + this.v2l = IV[4] | 0; + this.v2h = IV[5] | 0; + this.v3l = IV[6] | 0; + this.v3h = IV[7] | 0; + this.v4l = IV[8] | 0; + this.v4h = IV[9] | 0; + this.v5l = IV[10] | 0; + this.v5h = IV[11] | 0; + this.v6l = IV[12] | 0; + this.v6h = IV[13] | 0; + this.v7l = IV[14] | 0; + this.v7h = IV[15] | 0; + } + // prettier-ignore + get() { + let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; + return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; + } + // prettier-ignore + set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { + this.v0l = v0l | 0; + this.v0h = v0h | 0; + this.v1l = v1l | 0; + this.v1h = v1h | 0; + this.v2l = v2l | 0; + this.v2h = v2h | 0; + this.v3l = v3l | 0; + this.v3h = v3h | 0; + this.v4l = v4l | 0; + this.v4h = v4h | 0; + this.v5l = v5l | 0; + this.v5h = v5h | 0; + this.v6l = v6l | 0; + this.v6h = v6h | 0; + this.v7l = v7l | 0; + this.v7h = v7h | 0; + } + destroy() { + super.destroy(); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + compress(view, offset, withLength = true) { + for (let i = 0; i < 32; i++, offset += 4) + BLAKE512_W[i] = view.getUint32(offset, false); + this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. + BBUF.set(this.constants.subarray(0, 16), 16); + if (withLength) { + const { h, l } = u64.fromBig(BigInt(this.length * 8)); + BBUF[24] = (BBUF[24] ^ h) >>> 0; + BBUF[25] = (BBUF[25] ^ l) >>> 0; + BBUF[26] = (BBUF[26] ^ h) >>> 0; + BBUF[27] = (BBUF[27] ^ l) >>> 0; + } + for (let i = 0, k = 0; i < 16; i++) { + G1b(0, 4, 8, 12, BLAKE512_W, k++); + G2b(0, 4, 8, 12, BLAKE512_W, k++); + G1b(1, 5, 9, 13, BLAKE512_W, k++); + G2b(1, 5, 9, 13, BLAKE512_W, k++); + G1b(2, 6, 10, 14, BLAKE512_W, k++); + G2b(2, 6, 10, 14, BLAKE512_W, k++); + G1b(3, 7, 11, 15, BLAKE512_W, k++); + G2b(3, 7, 11, 15, BLAKE512_W, k++); + G1b(0, 5, 10, 15, BLAKE512_W, k++); + G2b(0, 5, 10, 15, BLAKE512_W, k++); + G1b(1, 6, 11, 12, BLAKE512_W, k++); + G2b(1, 6, 11, 12, BLAKE512_W, k++); + G1b(2, 7, 8, 13, BLAKE512_W, k++); + G2b(2, 7, 8, 13, BLAKE512_W, k++); + G1b(3, 4, 9, 14, BLAKE512_W, k++); + G2b(3, 4, 9, 14, BLAKE512_W, k++); + } + this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; + this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; + this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; + this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; + this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; + this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; + this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; + this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; + this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; + this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; + this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; + this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; + this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; + this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; + this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; + this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; + clean(BBUF, BLAKE512_W); + } +} +export class BLAKE224 extends Blake1_32 { + constructor(opts = {}) { + super(28, B224_IV, 0, opts); + } +} +export class BLAKE256 extends Blake1_32 { + constructor(opts = {}) { + super(32, B256_IV, 1, opts); + } +} +export class BLAKE384 extends Blake1_64 { + constructor(opts = {}) { + super(48, B384_IV, 0, opts); + } +} +export class BLAKE512 extends Blake1_64 { + constructor(opts = {}) { + super(64, B512_IV, 1, opts); + } +} +/** blake1-224 hash function */ +export const blake224 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE224(opts)); +/** blake1-256 hash function */ +export const blake256 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE256(opts)); +/** blake1-384 hash function */ +export const blake384 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE384(opts)); +/** blake1-512 hash function */ +export const blake512 = /* @__PURE__ */ createOptHasher((opts) => new BLAKE512(opts)); +//# sourceMappingURL=blake1.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake1.js.map b/node_modules/@noble/hashes/esm/blake1.js.map new file mode 100644 index 0000000..65325b8 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake1.js","sourceRoot":"","sources":["../src/blake1.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EACxB,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,IAAI,EAAE,OAAO,GAE1B,MAAM,YAAY,CAAC;AAOpB,yBAAyB;AACzB,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEtD,MAAe,MAA4B,SAAQ,IAAO;IAmBxD,YACE,QAAgB,EAChB,SAAiB,EACjB,UAAkB,EAClB,UAAkB,EAClB,OAAe,EACf,SAAsB,EACtB,OAAkB,EAAE;QAEpB,KAAK,EAAE,CAAC;QA3BA,aAAQ,GAAG,KAAK,CAAC;QACjB,WAAM,GAAG,CAAC,CAAC;QACX,QAAG,GAAG,CAAC,CAAC;QACR,cAAS,GAAG,KAAK,CAAC;QAyB1B,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,G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+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAW,eAAe,CAAC,eAAe,CAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC;AACF,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAW,eAAe,CAAC,eAAe,CAC7D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAC7B,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2.d.ts b/node_modules/@noble/hashes/esm/blake2.d.ts new file mode 100644 index 0000000..ea6ae41 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2.d.ts @@ -0,0 +1,116 @@ +import { Hash, type CHashO, type Input } from './utils.ts'; +/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ +export type Blake2Opts = { + dkLen?: number; + key?: Input; + salt?: Input; + personalization?: Input; +}; +/** Class, from which others are subclassed. */ +export declare abstract class BLAKE2> extends Hash { + protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + abstract destroy(): void; + protected buffer: Uint8Array; + protected buffer32: Uint32Array; + protected finished: boolean; + protected destroyed: boolean; + protected length: number; + protected pos: number; + readonly blockLen: number; + readonly outputLen: number; + constructor(blockLen: number, outputLen: number); + update(data: Input): this; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; + _cloneInto(to?: T): T; + clone(): T; +} +export declare class BLAKE2b extends BLAKE2 { + private v0l; + private v0h; + private v1l; + private v1h; + private v2l; + private v2h; + private v3l; + private v3h; + private v4l; + private v4h; + private v5l; + private v5h; + private v6l; + private v6h; + private v7l; + private v7h; + constructor(opts?: Blake2Opts); + protected get(): [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]; + protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void; + protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; + destroy(): void; +} +/** + * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export declare const blake2b: CHashO; +export type Num16 = { + v0: number; + v1: number; + v2: number; + v3: number; + v4: number; + v5: number; + v6: number; + v7: number; + v8: number; + v9: number; + v10: number; + v11: number; + v12: number; + v13: number; + v14: number; + v15: number; +}; +export declare function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number): Num16; +export declare class BLAKE2s extends BLAKE2 { + private v0; + private v1; + private v2; + private v3; + private v4; + private v5; + private v6; + private v7; + constructor(opts?: Blake2Opts); + protected get(): [number, number, number, number, number, number, number, number]; + protected set(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number): void; + protected compress(msg: Uint32Array, offset: number, isLast: boolean): void; + destroy(): void; +} +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export declare const blake2s: CHashO; +//# sourceMappingURL=blake2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2.d.ts.map b/node_modules/@noble/hashes/esm/blake2.d.ts.map new file mode 100644 index 0000000..2d53122 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2.d.ts","sourceRoot":"","sources":["../src/blake2.ts"],"names":[],"mappings":"AASA,OAAO,EAEmB,IAAI,EAC5B,KAAK,MAAM,EAAE,KAAK,KAAK,EACxB,MAAM,YAAY,CAAC;AAEpB,qGAAqG;A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Aa,OAAQ,SAAQ,MAAM,CAAC,OAAO,CAAC;IAE1C,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,EAAE,CAAiB;IAC3B,OAAO,CAAC,EAAE,CAAiB;gBAEf,IAAI,GAAE,UAAe;IA+BjC,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAKjF,SAAS,CAAC,GAAG,CACX,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAC7F,IAAI;IAUP,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAkB3E,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,MAErB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2.js b/node_modules/@noble/hashes/esm/blake2.js new file mode 100644 index 0000000..69b3c41 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2.js @@ -0,0 +1,413 @@ +/** + * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. + * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. + * @module + */ +import { BSIGMA, G1s, G2s } from "./_blake.js"; +import { SHA256_IV } from "./_md.js"; +import * as u64 from "./_u64.js"; +// prettier-ignore +import { abytes, aexists, anumber, aoutput, clean, createOptHasher, Hash, swap32IfBE, swap8IfBE, toBytes, u32 } from "./utils.js"; +// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. +const B2B_IV = /* @__PURE__ */ Uint32Array.from([ + 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, + 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, +]); +// Temporary buffer +const BBUF = /* @__PURE__ */ new Uint32Array(32); +// Mixing function G splitted in two halfs +function G1b(a, b, c, d, msg, x) { + // NOTE: V is LE here + const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore + let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore + let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore + let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore + let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 32) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 24) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); + (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); + (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); + (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); + (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); +} +function G2b(a, b, c, d, msg, x) { + // NOTE: V is LE here + const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore + let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore + let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore + let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore + let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 16) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 63) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); + (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); + (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); + (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); + (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); +} +function checkBlake2Opts(outputLen, opts = {}, keyLen, saltLen, persLen) { + anumber(keyLen); + if (outputLen < 0 || outputLen > keyLen) + throw new Error('outputLen bigger than keyLen'); + const { key, salt, personalization } = opts; + if (key !== undefined && (key.length < 1 || key.length > keyLen)) + throw new Error('key length must be undefined or 1..' + keyLen); + if (salt !== undefined && salt.length !== saltLen) + throw new Error('salt must be undefined or ' + saltLen); + if (personalization !== undefined && personalization.length !== persLen) + throw new Error('personalization must be undefined or ' + persLen); +} +/** Class, from which others are subclassed. */ +export class BLAKE2 extends Hash { + constructor(blockLen, outputLen) { + super(); + this.finished = false; + this.destroyed = false; + this.length = 0; + this.pos = 0; + anumber(blockLen); + anumber(outputLen); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.buffer = new Uint8Array(blockLen); + this.buffer32 = u32(this.buffer); + } + update(data) { + aexists(this); + data = toBytes(data); + abytes(data); + // Main difference with other hashes: there is flag for last block, + // so we cannot process current block before we know that there + // is the next one. This significantly complicates logic and reduces ability + // to do zero-copy processing + const { blockLen, buffer, buffer32 } = this; + const len = data.length; + const offset = data.byteOffset; + const buf = data.buffer; + for (let pos = 0; pos < len;) { + // If buffer is full and we still have input (don't process last block, same as blake2s) + if (this.pos === blockLen) { + swap32IfBE(buffer32); + this.compress(buffer32, 0, false); + swap32IfBE(buffer32); + this.pos = 0; + } + const take = Math.min(blockLen - this.pos, len - pos); + const dataOffset = offset + pos; + // full block && aligned to 4 bytes && not last in input + if (take === blockLen && !(dataOffset % 4) && pos + take < len) { + const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); + swap32IfBE(data32); + for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { + this.length += blockLen; + this.compress(data32, pos32, false); + } + swap32IfBE(data32); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + this.length += take; + pos += take; + } + return this; + } + digestInto(out) { + aexists(this); + aoutput(out, this); + const { pos, buffer32 } = this; + this.finished = true; + // Padding + clean(this.buffer.subarray(pos)); + swap32IfBE(buffer32); + this.compress(buffer32, 0, true); + swap32IfBE(buffer32); + const out32 = u32(out); + this.get().forEach((v, i) => (out32[i] = swap8IfBE(v))); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to) { + const { buffer, length, finished, destroyed, outputLen, pos } = this; + to || (to = new this.constructor({ dkLen: outputLen })); + to.set(...this.get()); + to.buffer.set(buffer); + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + // @ts-ignore + to.outputLen = outputLen; + return to; + } + clone() { + return this._cloneInto(); + } +} +export class BLAKE2b extends BLAKE2 { + constructor(opts = {}) { + const olen = opts.dkLen === undefined ? 64 : opts.dkLen; + super(128, olen); + // Same as SHA-512, but LE + this.v0l = B2B_IV[0] | 0; + this.v0h = B2B_IV[1] | 0; + this.v1l = B2B_IV[2] | 0; + this.v1h = B2B_IV[3] | 0; + this.v2l = B2B_IV[4] | 0; + this.v2h = B2B_IV[5] | 0; + this.v3l = B2B_IV[6] | 0; + this.v3h = B2B_IV[7] | 0; + this.v4l = B2B_IV[8] | 0; + this.v4h = B2B_IV[9] | 0; + this.v5l = B2B_IV[10] | 0; + this.v5h = B2B_IV[11] | 0; + this.v6l = B2B_IV[12] | 0; + this.v6h = B2B_IV[13] | 0; + this.v7l = B2B_IV[14] | 0; + this.v7h = B2B_IV[15] | 0; + checkBlake2Opts(olen, opts, 64, 16, 16); + let { key, personalization, salt } = opts; + let keyLength = 0; + if (key !== undefined) { + key = toBytes(key); + keyLength = key.length; + } + this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); + if (salt !== undefined) { + salt = toBytes(salt); + const slt = u32(salt); + this.v4l ^= swap8IfBE(slt[0]); + this.v4h ^= swap8IfBE(slt[1]); + this.v5l ^= swap8IfBE(slt[2]); + this.v5h ^= swap8IfBE(slt[3]); + } + if (personalization !== undefined) { + personalization = toBytes(personalization); + const pers = u32(personalization); + this.v6l ^= swap8IfBE(pers[0]); + this.v6h ^= swap8IfBE(pers[1]); + this.v7l ^= swap8IfBE(pers[2]); + this.v7h ^= swap8IfBE(pers[3]); + } + if (key !== undefined) { + // Pad to blockLen and update + const tmp = new Uint8Array(this.blockLen); + tmp.set(key); + this.update(tmp); + } + } + // prettier-ignore + get() { + let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; + return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; + } + // prettier-ignore + set(v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h) { + this.v0l = v0l | 0; + this.v0h = v0h | 0; + this.v1l = v1l | 0; + this.v1h = v1h | 0; + this.v2l = v2l | 0; + this.v2h = v2h | 0; + this.v3l = v3l | 0; + this.v3h = v3h | 0; + this.v4l = v4l | 0; + this.v4h = v4h | 0; + this.v5l = v5l | 0; + this.v5h = v5h | 0; + this.v6l = v6l | 0; + this.v6h = v6h | 0; + this.v7l = v7l | 0; + this.v7h = v7h | 0; + } + compress(msg, offset, isLast) { + this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. + BBUF.set(B2B_IV, 16); // Second half from IV. + let { h, l } = u64.fromBig(BigInt(this.length)); + BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. + BBUF[25] = B2B_IV[9] ^ h; // High word. + // Invert all bits for last block + if (isLast) { + BBUF[28] = ~BBUF[28]; + BBUF[29] = ~BBUF[29]; + } + let j = 0; + const s = BSIGMA; + for (let i = 0; i < 12; i++) { + G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); + G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); + G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); + G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); + G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); + G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); + G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); + G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); + G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); + G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); + G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); + G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); + G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); + G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); + G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); + G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); + } + this.v0l ^= BBUF[0] ^ BBUF[16]; + this.v0h ^= BBUF[1] ^ BBUF[17]; + this.v1l ^= BBUF[2] ^ BBUF[18]; + this.v1h ^= BBUF[3] ^ BBUF[19]; + this.v2l ^= BBUF[4] ^ BBUF[20]; + this.v2h ^= BBUF[5] ^ BBUF[21]; + this.v3l ^= BBUF[6] ^ BBUF[22]; + this.v3h ^= BBUF[7] ^ BBUF[23]; + this.v4l ^= BBUF[8] ^ BBUF[24]; + this.v4h ^= BBUF[9] ^ BBUF[25]; + this.v5l ^= BBUF[10] ^ BBUF[26]; + this.v5h ^= BBUF[11] ^ BBUF[27]; + this.v6l ^= BBUF[12] ^ BBUF[28]; + this.v6h ^= BBUF[13] ^ BBUF[29]; + this.v7l ^= BBUF[14] ^ BBUF[30]; + this.v7h ^= BBUF[15] ^ BBUF[31]; + clean(BBUF); + } + destroy() { + this.destroyed = true; + clean(this.buffer32); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +} +/** + * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export const blake2b = /* @__PURE__ */ createOptHasher((opts) => new BLAKE2b(opts)); +// prettier-ignore +export function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) { + let j = 0; + for (let i = 0; i < rounds; i++) { + ({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]])); + ({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]])); + ({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]])); + ({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]])); + ({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]])); + ({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]])); + ({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]])); + ({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]])); + ({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]])); + ({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]])); + ({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]])); + ({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]])); + ({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]])); + ({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]])); + ({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]])); + ({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]])); + } + return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; +} +const B2S_IV = SHA256_IV; +export class BLAKE2s extends BLAKE2 { + constructor(opts = {}) { + const olen = opts.dkLen === undefined ? 32 : opts.dkLen; + super(64, olen); + // Internal state, same as SHA-256 + this.v0 = B2S_IV[0] | 0; + this.v1 = B2S_IV[1] | 0; + this.v2 = B2S_IV[2] | 0; + this.v3 = B2S_IV[3] | 0; + this.v4 = B2S_IV[4] | 0; + this.v5 = B2S_IV[5] | 0; + this.v6 = B2S_IV[6] | 0; + this.v7 = B2S_IV[7] | 0; + checkBlake2Opts(olen, opts, 32, 8, 8); + let { key, personalization, salt } = opts; + let keyLength = 0; + if (key !== undefined) { + key = toBytes(key); + keyLength = key.length; + } + this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); + if (salt !== undefined) { + salt = toBytes(salt); + const slt = u32(salt); + this.v4 ^= swap8IfBE(slt[0]); + this.v5 ^= swap8IfBE(slt[1]); + } + if (personalization !== undefined) { + personalization = toBytes(personalization); + const pers = u32(personalization); + this.v6 ^= swap8IfBE(pers[0]); + this.v7 ^= swap8IfBE(pers[1]); + } + if (key !== undefined) { + // Pad to blockLen and update + abytes(key); + const tmp = new Uint8Array(this.blockLen); + tmp.set(key); + this.update(tmp); + } + } + get() { + const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; + return [v0, v1, v2, v3, v4, v5, v6, v7]; + } + // prettier-ignore + set(v0, v1, v2, v3, v4, v5, v6, v7) { + this.v0 = v0 | 0; + this.v1 = v1 | 0; + this.v2 = v2 | 0; + this.v3 = v3 | 0; + this.v4 = v4 | 0; + this.v5 = v5 | 0; + this.v6 = v6 | 0; + this.v7 = v7 | 0; + } + compress(msg, offset, isLast) { + const { h, l } = u64.fromBig(BigInt(this.length)); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(BSIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7]); + this.v0 ^= v0 ^ v8; + this.v1 ^= v1 ^ v9; + this.v2 ^= v2 ^ v10; + this.v3 ^= v3 ^ v11; + this.v4 ^= v4 ^ v12; + this.v5 ^= v5 ^ v13; + this.v6 ^= v6 ^ v14; + this.v7 ^= v7 ^ v15; + } + destroy() { + this.destroyed = true; + clean(this.buffer32); + this.set(0, 0, 0, 0, 0, 0, 0, 0); + } +} +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export const blake2s = /* @__PURE__ */ createOptHasher((opts) => new BLAKE2s(opts)); +//# sourceMappingURL=blake2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2.js.map b/node_modules/@noble/hashes/esm/blake2.js.map new file mode 100644 index 0000000..6289763 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2.js","sourceRoot":"","sources":["../src/blake2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAElE,MAAM,YAAY,CAAC;AAUpB,oFAAoF;AACpF,MAAM,MAAM,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC9C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,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,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAC5B,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2b.d.ts b/node_modules/@noble/hashes/esm/blake2b.d.ts new file mode 100644 index 0000000..a9ea37e --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2b.d.ts @@ -0,0 +1,11 @@ +/** + * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. + * @module + * @deprecated + */ +import { BLAKE2b as B2B, blake2b as b2b } from './blake2.ts'; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const BLAKE2b: typeof B2B; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const blake2b: typeof b2b; +//# sourceMappingURL=blake2b.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2b.d.ts.map b/node_modules/@noble/hashes/esm/blake2b.d.ts.map new file mode 100644 index 0000000..0307e90 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2b.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2b.d.ts","sourceRoot":"","sources":["../src/blake2b.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7D,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2b.js b/node_modules/@noble/hashes/esm/blake2b.js new file mode 100644 index 0000000..2a7fa35 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2b.js @@ -0,0 +1,11 @@ +/** + * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. + * @module + * @deprecated + */ +import { BLAKE2b as B2B, blake2b as b2b } from "./blake2.js"; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const BLAKE2b = B2B; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const blake2b = b2b; +//# sourceMappingURL=blake2b.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2b.js.map b/node_modules/@noble/hashes/esm/blake2b.js.map new file mode 100644 index 0000000..8450afa --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2b.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2b.js","sourceRoot":"","sources":["../src/blake2b.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2s.d.ts b/node_modules/@noble/hashes/esm/blake2s.d.ts new file mode 100644 index 0000000..6720f35 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2s.d.ts @@ -0,0 +1,20 @@ +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. + * @module + * @deprecated + */ +import { G1s as G1s_n, G2s as G2s_n } from './_blake.ts'; +import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from './blake2.ts'; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const B2S_IV: Uint32Array; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const G1s: typeof G1s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const G2s: typeof G2s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const compress: typeof compress_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const BLAKE2s: typeof B2S; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export declare const blake2s: typeof b2s; +//# sourceMappingURL=blake2s.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2s.d.ts.map b/node_modules/@noble/hashes/esm/blake2s.d.ts.map new file mode 100644 index 0000000..ced6ec7 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2s.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2s.d.ts","sourceRoot":"","sources":["../src/blake2s.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACrF,+DAA+D;AAC/D,eAAO,MAAM,MAAM,EAAE,WAAuB,CAAC;AAC7C,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,GAAG,EAAE,OAAO,KAAa,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,EAAE,OAAO,UAAuB,CAAC;AACtD,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC;AACvC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,OAAO,GAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2s.js b/node_modules/@noble/hashes/esm/blake2s.js new file mode 100644 index 0000000..a4d3337 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2s.js @@ -0,0 +1,21 @@ +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. + * @module + * @deprecated + */ +import { G1s as G1s_n, G2s as G2s_n } from "./_blake.js"; +import { SHA256_IV } from "./_md.js"; +import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from "./blake2.js"; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const B2S_IV = SHA256_IV; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const G1s = G1s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const G2s = G2s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const compress = compress_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const BLAKE2s = B2S; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const blake2s = b2s; +//# sourceMappingURL=blake2s.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake2s.js.map b/node_modules/@noble/hashes/esm/blake2s.js.map new file mode 100644 index 0000000..c0572b2 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake2s.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake2s.js","sourceRoot":"","sources":["../src/blake2s.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AACrF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,MAAM,GAAgB,SAAS,CAAC;AAC7C,+DAA+D;AAC/D,MAAM,CAAC,MAAM,GAAG,GAAiB,KAAK,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,GAAG,GAAiB,KAAK,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,QAAQ,GAAsB,UAAU,CAAC;AACtD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC;AACvC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,OAAO,GAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake3.d.ts b/node_modules/@noble/hashes/esm/blake3.d.ts new file mode 100644 index 0000000..234fa87 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake3.d.ts @@ -0,0 +1,54 @@ +import { BLAKE2 } from './blake2.ts'; +import { type CHashXO, type HashXOF, type Input } from './utils.ts'; +/** + * Ensure to use EITHER `key` OR `context`, not both. + * + * * `key`: 32-byte MAC key. + * * `context`: string for KDF. Should be hardcoded, globally unique, and application - specific. + * A good default format for the context string is "[application] [commit timestamp] [purpose]". + */ +export type Blake3Opts = { + dkLen?: number; + key?: Input; + context?: Input; +}; +/** Blake3 hash. Can be used as MAC and KDF. */ +export declare class BLAKE3 extends BLAKE2 implements HashXOF { + private chunkPos; + private chunksDone; + private flags; + private IV; + private state; + private stack; + private posOut; + private bufferOut32; + private bufferOut; + private chunkOut; + private enableXOF; + constructor(opts?: Blake3Opts, flags?: number); + protected get(): []; + protected set(): void; + private b2Compress; + protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void; + _cloneInto(to?: BLAKE3): BLAKE3; + destroy(): void; + private b2CompressOut; + protected finish(): void; + private writeInto; + xofInto(out: Uint8Array): Uint8Array; + xof(bytes: number): Uint8Array; + digestInto(out: Uint8Array): Uint8Array; + digest(): Uint8Array; +} +/** + * BLAKE3 hash function. Can be used as MAC and KDF. + * @param msg - message that would be hashed + * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode + * @example + * const data = new Uint8Array(32); + * const hash = blake3(data); + * const mac = blake3(data, { key: new Uint8Array(32) }); + * const kdf = blake3(data, { context: 'application name' }); + */ +export declare const blake3: CHashXO; +//# sourceMappingURL=blake3.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake3.d.ts.map b/node_modules/@noble/hashes/esm/blake3.d.ts.map new file mode 100644 index 0000000..4335e42 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake3.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"blake3.d.ts","sourceRoot":"","sources":["../src/blake3.ts"],"names":[],"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pC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAI9B,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAQvC,MAAM,IAAI,UAAU;CAGrB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM,EAAE,OAEpB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake3.js b/node_modules/@noble/hashes/esm/blake3.js new file mode 100644 index 0000000..e7e6e48 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake3.js @@ -0,0 +1,251 @@ +/** + * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. + * + * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. + * Why is this so slow? While it should be 6x faster than blake2b, perf diff is only 20%: + * + * * There is only 30% reduction in number of rounds from blake2s + * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. + * These features are not present in JS, so we only get overhead from trees. + * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. + * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm + * @module + */ +import { SHA256_IV } from "./_md.js"; +import { fromBig } from "./_u64.js"; +import { BLAKE2, compress } from "./blake2.js"; +// prettier-ignore +import { abytes, aexists, anumber, aoutput, clean, createXOFer, swap32IfBE, toBytes, u32, u8 } from "./utils.js"; +// Flag bitset +const B3_Flags = { + CHUNK_START: 0b1, + CHUNK_END: 0b10, + PARENT: 0b100, + ROOT: 0b1000, + KEYED_HASH: 0b10000, + DERIVE_KEY_CONTEXT: 0b100000, + DERIVE_KEY_MATERIAL: 0b1000000, +}; +const B3_IV = SHA256_IV.slice(); +const B3_SIGMA = /* @__PURE__ */ (() => { + const Id = Array.from({ length: 16 }, (_, i) => i); + const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); + const res = []; + for (let i = 0, v = Id; i < 7; i++, v = permute(v)) + res.push(...v); + return Uint8Array.from(res); +})(); +/** Blake3 hash. Can be used as MAC and KDF. */ +export class BLAKE3 extends BLAKE2 { + constructor(opts = {}, flags = 0) { + super(64, opts.dkLen === undefined ? 32 : opts.dkLen); + this.chunkPos = 0; // Position of current block in chunk + this.chunksDone = 0; // How many chunks we already have + this.flags = 0 | 0; + this.stack = []; + // Output + this.posOut = 0; + this.bufferOut32 = new Uint32Array(16); + this.chunkOut = 0; // index of output chunk + this.enableXOF = true; + const { key, context } = opts; + const hasContext = context !== undefined; + if (key !== undefined) { + if (hasContext) + throw new Error('Only "key" or "context" can be specified at same time'); + const k = toBytes(key).slice(); + abytes(k, 32); + this.IV = u32(k); + swap32IfBE(this.IV); + this.flags = flags | B3_Flags.KEYED_HASH; + } + else if (hasContext) { + const ctx = toBytes(context); + const contextKey = new BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) + .update(ctx) + .digest(); + this.IV = u32(contextKey); + swap32IfBE(this.IV); + this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; + } + else { + this.IV = B3_IV.slice(); + this.flags = flags; + } + this.state = this.IV.slice(); + this.bufferOut = u8(this.bufferOut32); + } + // Unused + get() { + return []; + } + set() { } + b2Compress(counter, flags, buf, bufPos = 0) { + const { state: s, pos } = this; + const { h, l } = fromBig(BigInt(counter), true); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, bufPos, buf, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags); + s[0] = v0 ^ v8; + s[1] = v1 ^ v9; + s[2] = v2 ^ v10; + s[3] = v3 ^ v11; + s[4] = v4 ^ v12; + s[5] = v5 ^ v13; + s[6] = v6 ^ v14; + s[7] = v7 ^ v15; + } + compress(buf, bufPos = 0, isLast = false) { + // Compress last block + let flags = this.flags; + if (!this.chunkPos) + flags |= B3_Flags.CHUNK_START; + if (this.chunkPos === 15 || isLast) + flags |= B3_Flags.CHUNK_END; + if (!isLast) + this.pos = this.blockLen; + this.b2Compress(this.chunksDone, flags, buf, bufPos); + this.chunkPos += 1; + // If current block is last in chunk (16 blocks), then compress chunks + if (this.chunkPos === 16 || isLast) { + let chunk = this.state; + this.state = this.IV.slice(); + // If not the last one, compress only when there are trailing zeros in chunk counter + // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. + // 1 (001) - leaf not finished (just push current chunk to stack) + // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) + // 3 (011) - last leaf not finished + // 4 (100) - leafs finished at depth=1 and depth=2 + for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { + if (!(last = this.stack.pop())) + break; + this.buffer32.set(last, 0); + this.buffer32.set(chunk, 8); + this.pos = this.blockLen; + this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); + chunk = this.state; + this.state = this.IV.slice(); + } + this.chunksDone++; + this.chunkPos = 0; + this.stack.push(chunk); + } + this.pos = 0; + } + _cloneInto(to) { + to = super._cloneInto(to); + const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; + to.state.set(state.slice()); + to.stack = stack.map((i) => Uint32Array.from(i)); + to.IV.set(IV); + to.flags = flags; + to.chunkPos = chunkPos; + to.chunksDone = chunksDone; + to.posOut = posOut; + to.chunkOut = chunkOut; + to.enableXOF = this.enableXOF; + to.bufferOut32.set(this.bufferOut32); + return to; + } + destroy() { + this.destroyed = true; + clean(this.state, this.buffer32, this.IV, this.bufferOut32); + clean(...this.stack); + } + // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) + b2CompressOut() { + const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; + const { h, l } = fromBig(BigInt(this.chunkOut++)); + swap32IfBE(buffer32); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(B3_SIGMA, 0, buffer32, 7, s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags); + out32[0] = v0 ^ v8; + out32[1] = v1 ^ v9; + out32[2] = v2 ^ v10; + out32[3] = v3 ^ v11; + out32[4] = v4 ^ v12; + out32[5] = v5 ^ v13; + out32[6] = v6 ^ v14; + out32[7] = v7 ^ v15; + out32[8] = s[0] ^ v8; + out32[9] = s[1] ^ v9; + out32[10] = s[2] ^ v10; + out32[11] = s[3] ^ v11; + out32[12] = s[4] ^ v12; + out32[13] = s[5] ^ v13; + out32[14] = s[6] ^ v14; + out32[15] = s[7] ^ v15; + swap32IfBE(buffer32); + swap32IfBE(out32); + this.posOut = 0; + } + finish() { + if (this.finished) + return; + this.finished = true; + // Padding + clean(this.buffer.subarray(this.pos)); + // Process last chunk + let flags = this.flags | B3_Flags.ROOT; + if (this.stack.length) { + flags |= B3_Flags.PARENT; + swap32IfBE(this.buffer32); + this.compress(this.buffer32, 0, true); + swap32IfBE(this.buffer32); + this.chunksDone = 0; + this.pos = this.blockLen; + } + else { + flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; + } + this.flags = flags; + this.b2CompressOut(); + } + writeInto(out) { + aexists(this, false); + abytes(out); + this.finish(); + const { blockLen, bufferOut } = this; + for (let pos = 0, len = out.length; pos < len;) { + if (this.posOut >= blockLen) + this.b2CompressOut(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out) { + if (!this.enableXOF) + throw new Error('XOF is not possible after digest call'); + return this.writeInto(out); + } + xof(bytes) { + anumber(bytes); + return this.xofInto(new Uint8Array(bytes)); + } + digestInto(out) { + aoutput(out, this); + if (this.finished) + throw new Error('digest() was already called'); + this.enableXOF = false; + this.writeInto(out); + this.destroy(); + return out; + } + digest() { + return this.digestInto(new Uint8Array(this.outputLen)); + } +} +/** + * BLAKE3 hash function. Can be used as MAC and KDF. + * @param msg - message that would be hashed + * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode + * @example + * const data = new Uint8Array(32); + * const hash = blake3(data); + * const mac = blake3(data, { key: new Uint8Array(32) }); + * const kdf = blake3(data, { context: 'application name' }); + */ +export const blake3 = /* @__PURE__ */ createXOFer((opts) => new BLAKE3(opts)); +//# sourceMappingURL=blake3.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/blake3.js.map b/node_modules/@noble/hashes/esm/blake3.js.map new file mode 100644 index 0000000..91f5a79 --- /dev/null +++ b/node_modules/@noble/hashes/esm/blake3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blake3.js","sourceRoot":"","sources":["../src/blake3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAEjD,MAAM,YAAY,CAAC;AAEpB,cAAc;AACd,MAAM,QAAQ,GAAG;IACf,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,OAAO;IACnB,kBAAkB,EAAE,QAAQ;IAC5B,mBAAmB,EAAE,SAAS;CACtB,CAAC;AAEX,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;AAEhC,MAAM,QAAQ,GAAe,eAAe,CAAC,CAAC,GAAG,EAAE;IACjD,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAA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;IACD,GAAG,CAAC,KAAa;QACf,OAAO,CAAC,KAAK,CAAC,CAAC;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,UAAU,CAAC,GAAe;QACxB,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAClE,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,MAAM,GAAY,eAAe,CAAC,WAAW,CACxD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAC3B,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/crypto.d.ts b/node_modules/@noble/hashes/esm/crypto.d.ts new file mode 100644 index 0000000..ac181a0 --- /dev/null +++ b/node_modules/@noble/hashes/esm/crypto.d.ts @@ -0,0 +1,2 @@ +export declare const crypto: any; +//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/crypto.d.ts.map b/node_modules/@noble/hashes/esm/crypto.d.ts.map new file mode 100644 index 0000000..756d982 --- /dev/null +++ b/node_modules/@noble/hashes/esm/crypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM,EAAE,GACqE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/crypto.js b/node_modules/@noble/hashes/esm/crypto.js new file mode 100644 index 0000000..8d499a0 --- /dev/null +++ b/node_modules/@noble/hashes/esm/crypto.js @@ -0,0 +1,2 @@ +export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; +//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/crypto.js.map b/node_modules/@noble/hashes/esm/crypto.js.map new file mode 100644 index 0000000..9ad4f45 --- /dev/null +++ b/node_modules/@noble/hashes/esm/crypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,MAAM,GACjB,OAAO,UAAU,KAAK,QAAQ,IAAI,QAAQ,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/cryptoNode.d.ts b/node_modules/@noble/hashes/esm/cryptoNode.d.ts new file mode 100644 index 0000000..98bda7b --- /dev/null +++ b/node_modules/@noble/hashes/esm/cryptoNode.d.ts @@ -0,0 +1,2 @@ +export declare const crypto: any; +//# sourceMappingURL=cryptoNode.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map b/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map new file mode 100644 index 0000000..90dcc44 --- /dev/null +++ b/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cryptoNode.d.ts","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,EAAE,GAKJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/cryptoNode.js b/node_modules/@noble/hashes/esm/cryptoNode.js new file mode 100644 index 0000000..4f77e8f --- /dev/null +++ b/node_modules/@noble/hashes/esm/cryptoNode.js @@ -0,0 +1,15 @@ +/** + * Internal webcrypto alias. + * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. + * Falls back to Node.js built-in crypto for Node.js <=v14. + * See utils.ts for details. + * @module + */ +// @ts-ignore +import * as nc from 'node:crypto'; +export const crypto = nc && typeof nc === 'object' && 'webcrypto' in nc + ? nc.webcrypto + : nc && typeof nc === 'object' && 'randomBytes' in nc + ? nc + : undefined; +//# sourceMappingURL=cryptoNode.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/cryptoNode.js.map b/node_modules/@noble/hashes/esm/cryptoNode.js.map new file mode 100644 index 0000000..6b07d8a --- /dev/null +++ b/node_modules/@noble/hashes/esm/cryptoNode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cryptoNode.js","sourceRoot":"","sources":["../src/cryptoNode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,MAAM,CAAC,MAAM,MAAM,GACjB,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,IAAI,EAAE;IAC/C,CAAC,CAAE,EAAE,CAAC,SAAiB;IACvB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,aAAa,IAAI,EAAE;QACnD,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,SAAS,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/eskdf.d.ts b/node_modules/@noble/hashes/esm/eskdf.d.ts new file mode 100644 index 0000000..66721eb --- /dev/null +++ b/node_modules/@noble/hashes/esm/eskdf.d.ts @@ -0,0 +1,47 @@ +export declare function scrypt(password: string, salt: string): Uint8Array; +export declare function pbkdf2(password: string, salt: string): Uint8Array; +/** + * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. + */ +export declare function deriveMainSeed(username: string, password: string): Uint8Array; +type AccountID = number | string; +type OptsLength = { + keyLength: number; +}; +type OptsMod = { + modulus: bigint; +}; +type KeyOpts = undefined | OptsLength | OptsMod; +export interface ESKDF { + /** + * Derives a child key. Child key will not be associated with any + * other child key because of properties of underlying KDF. + * + * @param protocol - 3-15 character protocol name + * @param accountId - numeric identifier of account + * @param options - `keyLength: 64` or `modulus: 41920438n` + * @example deriveChildKey('aes', 0) + */ + deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; + /** + * Deletes the main seed from eskdf instance + */ + expire: () => void; + /** + * Account fingerprint + */ + fingerprint: string; +} +/** + * ESKDF + * @param username - username, email, or identifier, min: 8 characters, should have enough entropy + * @param password - password, min: 8 characters, should have enough entropy + * @example + * const kdf = await eskdf('example-university', 'beginning-new-example'); + * const key = kdf.deriveChildKey('aes', 0); + * console.log(kdf.fingerprint); + * kdf.expire(); + */ +export declare function eskdf(username: string, password: string): Promise; +export {}; +//# sourceMappingURL=eskdf.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/eskdf.d.ts.map b/node_modules/@noble/hashes/esm/eskdf.d.ts.map new file mode 100644 index 0000000..f05732c --- /dev/null +++ b/node_modules/@noble/hashes/esm/eskdf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eskdf.d.ts","sourceRoot":"","sources":["../src/eskdf.ts"],"names":[],"mappings":"AAiBA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAGD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAEjE;AAiBD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAY7E;AAED,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAgCjC,KAAK,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,KAAK,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACnC,KAAK,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAwChD,MAAM,WAAW,KAAK;IACpB;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC;IAC1F;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAuB9E"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/eskdf.js b/node_modules/@noble/hashes/esm/eskdf.js new file mode 100644 index 0000000..96d7a50 --- /dev/null +++ b/node_modules/@noble/hashes/esm/eskdf.js @@ -0,0 +1,160 @@ +/** + * Experimental KDF for AES. + */ +import { hkdf } from "./hkdf.js"; +import { pbkdf2 as _pbkdf2 } from "./pbkdf2.js"; +import { scrypt as _scrypt } from "./scrypt.js"; +import { sha256 } from "./sha256.js"; +import { abytes, bytesToHex, clean, createView, hexToBytes, kdfInputToBytes } from "./utils.js"; +// A tiny KDF for various applications like AES key-gen. +// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". +// Which is good enough: assume sha2-256 retained preimage resistance. +const SCRYPT_FACTOR = 2 ** 19; +const PBKDF2_FACTOR = 2 ** 17; +// Scrypt KDF +export function scrypt(password, salt) { + return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); +} +// PBKDF2-HMAC-SHA256 +export function pbkdf2(password, salt) { + return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); +} +// Combines two 32-byte byte arrays +function xor32(a, b) { + abytes(a, 32); + abytes(b, 32); + const arr = new Uint8Array(32); + for (let i = 0; i < 32; i++) { + arr[i] = a[i] ^ b[i]; + } + return arr; +} +function strHasLength(str, min, max) { + return typeof str === 'string' && str.length >= min && str.length <= max; +} +/** + * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. + */ +export function deriveMainSeed(username, password) { + if (!strHasLength(username, 8, 255)) + throw new Error('invalid username'); + if (!strHasLength(password, 8, 255)) + throw new Error('invalid password'); + // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. + // String with non-ascii may be problematic in some envs + const codes = { _1: 1, _2: 2 }; + const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; + const scr = scrypt(password + sep.s, username + sep.s); + const pbk = pbkdf2(password + sep.p, username + sep.p); + const res = xor32(scr, pbk); + clean(scr, pbk); + return res; +} +/** + * Converts protocol & accountId pair to HKDF salt & info params. + */ +function getSaltInfo(protocol, accountId = 0) { + // Note that length here also repeats two lines below + // We do an additional length check here to reduce the scope of DoS attacks + if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { + throw new Error('invalid protocol'); + } + // Allow string account ids for some protocols + const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); + let salt; // Extract salt. Default is undefined. + if (typeof accountId === 'string') { + if (!allowsStr) + throw new Error('accountId must be a number'); + if (!strHasLength(accountId, 1, 255)) + throw new Error('accountId must be string of length 1..255'); + salt = kdfInputToBytes(accountId); + } + else if (Number.isSafeInteger(accountId)) { + if (accountId < 0 || accountId > Math.pow(2, 32) - 1) + throw new Error('invalid accountId'); + // Convert to Big Endian Uint32 + salt = new Uint8Array(4); + createView(salt).setUint32(0, accountId, false); + } + else { + throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); + } + const info = kdfInputToBytes(protocol); + return { salt, info }; +} +function countBytes(num) { + if (typeof num !== 'bigint' || num <= BigInt(128)) + throw new Error('invalid number'); + return Math.ceil(num.toString(2).length / 8); +} +/** + * Parses keyLength and modulus options to extract length of result key. + * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. + */ +function getKeyLength(options) { + if (!options || typeof options !== 'object') + return 32; + const hasLen = 'keyLength' in options; + const hasMod = 'modulus' in options; + if (hasLen && hasMod) + throw new Error('cannot combine keyLength and modulus options'); + if (!hasLen && !hasMod) + throw new Error('must have either keyLength or modulus option'); + // FIPS 186 B.4.1 requires at least 64 more bits + const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; + if (!(typeof l === 'number' && l >= 16 && l <= 8192)) + throw new Error('invalid keyLength'); + return l; +} +/** + * Converts key to bigint and divides it by modulus. Big Endian. + * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. + */ +function modReduceKey(key, modulus) { + const _1 = BigInt(1); + const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() + const res = (num % (modulus - _1)) + _1; // Remove 0 from output + if (res < _1) + throw new Error('expected positive number'); // Guard against bad values + const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes + const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() + const bytes = hexToBytes(hex); + if (bytes.length !== len) + throw new Error('invalid length of result key'); + return bytes; +} +/** + * ESKDF + * @param username - username, email, or identifier, min: 8 characters, should have enough entropy + * @param password - password, min: 8 characters, should have enough entropy + * @example + * const kdf = await eskdf('example-university', 'beginning-new-example'); + * const key = kdf.deriveChildKey('aes', 0); + * console.log(kdf.fingerprint); + * kdf.expire(); + */ +export async function eskdf(username, password) { + // We are using closure + object instead of class because + // we want to make `seed` non-accessible for any external function. + let seed = deriveMainSeed(username, password); + function deriveCK(protocol, accountId = 0, options) { + abytes(seed, 32); + const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId + const keyLength = getKeyLength(options); // validate options + const key = hkdf(sha256, seed, salt, info, keyLength); + // Modulus has already been validated + return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; + } + function expire() { + if (seed) + seed.fill(1); + seed = undefined; + } + // prettier-ignore + const fingerprint = Array.from(deriveCK('fingerprint', 0)) + .slice(0, 6) + .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) + .join(':'); + return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); +} +//# sourceMappingURL=eskdf.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/eskdf.js.map b/node_modules/@noble/hashes/esm/eskdf.js.map new file mode 100644 index 0000000..578d3f4 --- /dev/null +++ b/node_modules/@noble/hashes/esm/eskdf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"eskdf.js","sourceRoot":"","sources":["../src/eskdf.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEhG,wDAAwD;AACxD,gFAAgF;AAChF,sEAAsE;AAEtE,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC;AAC9B,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,CAAC;AAE9B,aAAa;AACb,MAAM,UAAU,MAAM,CAAC,QAAgB,EAAE,IAAY;IACnD,OAAO,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,qBAAqB;AACrB,MAAM,UAAU,MAAM,CAAC,QAAgB,EAAE,IAAY;IACnD,OAAO,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,IAA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WAAW,EAAE,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hkdf.d.ts b/node_modules/@noble/hashes/esm/hkdf.d.ts new file mode 100644 index 0000000..c54c4ab --- /dev/null +++ b/node_modules/@noble/hashes/esm/hkdf.d.ts @@ -0,0 +1,36 @@ +import { type CHash, type Input } from './utils.ts'; +/** + * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` + * Arguments position differs from spec (IKM is first one, since it is not optional) + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + */ +export declare function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array; +/** + * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` + * @param hash - hash function that would be used (e.g. sha256) + * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + */ +export declare function expand(hash: CHash, prk: Input, info?: Input, length?: number): Uint8Array; +/** + * HKDF (RFC 5869): derive keys from an initial input. + * Combines hkdf_extract + hkdf_expand in one step + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + * @example + * import { hkdf } from '@noble/hashes/hkdf'; + * import { sha256 } from '@noble/hashes/sha2'; + * import { randomBytes } from '@noble/hashes/utils'; + * const inputKey = randomBytes(32); + * const salt = randomBytes(32); + * const info = 'application-key'; + * const hk1 = hkdf(sha256, inputKey, salt, info, 32); + */ +export declare const hkdf: (hash: CHash, ikm: Input, salt: Input | undefined, info: Input | undefined, length: number) => Uint8Array; +//# sourceMappingURL=hkdf.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hkdf.d.ts.map b/node_modules/@noble/hashes/esm/hkdf.d.ts.map new file mode 100644 index 0000000..675ea9e --- /dev/null +++ b/node_modules/@noble/hashes/esm/hkdf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hkdf.d.ts","sourceRoot":"","sources":["../src/hkdf.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,KAAK,EAAS,KAAK,KAAK,EAAW,MAAM,YAAY,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,CAOzE;AAKD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAE,MAAW,GAAG,UAAU,CA4B7F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,KAAK,EACX,KAAK,KAAK,EACV,MAAM,KAAK,GAAG,SAAS,EACvB,MAAM,KAAK,GAAG,SAAS,EACvB,QAAQ,MAAM,KACb,UAAkE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hkdf.js b/node_modules/@noble/hashes/esm/hkdf.js new file mode 100644 index 0000000..a306a9b --- /dev/null +++ b/node_modules/@noble/hashes/esm/hkdf.js @@ -0,0 +1,82 @@ +/** + * HKDF (RFC 5869): extract + expand in one step. + * See https://soatok.blog/2021/11/17/understanding-hkdf/. + * @module + */ +import { hmac } from "./hmac.js"; +import { ahash, anumber, clean, toBytes } from "./utils.js"; +/** + * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` + * Arguments position differs from spec (IKM is first one, since it is not optional) + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + */ +export function extract(hash, ikm, salt) { + ahash(hash); + // NOTE: some libraries treat zero-length array as 'not provided'; + // we don't, since we have undefined as 'not provided' + // https://github.com/RustCrypto/KDFs/issues/15 + if (salt === undefined) + salt = new Uint8Array(hash.outputLen); + return hmac(hash, toBytes(salt), toBytes(ikm)); +} +const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]); +const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); +/** + * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` + * @param hash - hash function that would be used (e.g. sha256) + * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + */ +export function expand(hash, prk, info, length = 32) { + ahash(hash); + anumber(length); + const olen = hash.outputLen; + if (length > 255 * olen) + throw new Error('Length should be <= 255*HashLen'); + const blocks = Math.ceil(length / olen); + if (info === undefined) + info = EMPTY_BUFFER; + // first L(ength) octets of T + const okm = new Uint8Array(blocks * olen); + // Re-use HMAC instance between blocks + const HMAC = hmac.create(hash, prk); + const HMACTmp = HMAC._cloneInto(); + const T = new Uint8Array(HMAC.outputLen); + for (let counter = 0; counter < blocks; counter++) { + HKDF_COUNTER[0] = counter + 1; + // T(0) = empty string (zero length) + // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) + HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) + .update(info) + .update(HKDF_COUNTER) + .digestInto(T); + okm.set(T, olen * counter); + HMAC._cloneInto(HMACTmp); + } + HMAC.destroy(); + HMACTmp.destroy(); + clean(T, HKDF_COUNTER); + return okm.slice(0, length); +} +/** + * HKDF (RFC 5869): derive keys from an initial input. + * Combines hkdf_extract + hkdf_expand in one step + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + * @example + * import { hkdf } from '@noble/hashes/hkdf'; + * import { sha256 } from '@noble/hashes/sha2'; + * import { randomBytes } from '@noble/hashes/utils'; + * const inputKey = randomBytes(32); + * const salt = randomBytes(32); + * const info = 'application-key'; + * const hk1 = hkdf(sha256, inputKey, salt, info, 32); + */ +export const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length); +//# sourceMappingURL=hkdf.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hkdf.js.map b/node_modules/@noble/hashes/esm/hkdf.js.map new file mode 100644 index 0000000..8984004 --- /dev/null +++ b/node_modules/@noble/hashes/esm/hkdf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["../src/hkdf.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAc,KAAK,EAAc,OAAO,EAAE,MAAM,YAAY,CAAC;AAEpF;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY;IAC3D,KAAK,CAAC,IAAI,CAAC,CAAC;IACZ,kEAAkE;IAClE,sDAAsD;IACtD,+CAA+C;IAC/C,IAAI,IAAI,KAAK,SAAS;QAAE,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY,EAAE,SAAiB,EAAE;IAC/E,KAAK,CAAC,IAAI,CAAC,CAAC;IACZ,OAAO,CAAC,MAAM,CAAC,CAAC;IAChB,MAAM,IAAI,GAAG,IAAI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CAAC,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,IAAW,EACX,GAAU,EACV,IAAuB,EACvB,IAAuB,EACvB,MAAc,EACF,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hmac.d.ts b/node_modules/@noble/hashes/esm/hmac.d.ts new file mode 100644 index 0000000..86525f9 --- /dev/null +++ b/node_modules/@noble/hashes/esm/hmac.d.ts @@ -0,0 +1,35 @@ +/** + * HMAC: RFC2104 message authentication code. + * @module + */ +import { Hash, type CHash, type Input } from './utils.ts'; +export declare class HMAC> extends Hash> { + oHash: T; + iHash: T; + blockLen: number; + outputLen: number; + private finished; + private destroyed; + constructor(hash: CHash, _key: Input); + update(buf: Input): this; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; + _cloneInto(to?: HMAC): HMAC; + clone(): HMAC; + destroy(): void; +} +/** + * HMAC: RFC2104 message authentication code. + * @param hash - function that would be used e.g. sha256 + * @param key - message key + * @param message - message data + * @example + * import { hmac } from '@noble/hashes/hmac'; + * import { sha256 } from '@noble/hashes/sha2'; + * const mac1 = hmac(sha256, 'key', 'message'); + */ +export declare const hmac: { + (hash: CHash, key: Input, message: Input): Uint8Array; + create(hash: CHash, key: Input): HMAC; +}; +//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hmac.d.ts.map b/node_modules/@noble/hashes/esm/hmac.d.ts.map new file mode 100644 index 0000000..7cea37d --- /dev/null +++ b/node_modules/@noble/hashes/esm/hmac.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAiC,IAAI,EAAW,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAElG,qBAAa,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK;IAsBpC,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;IAKxB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IASjC,MAAM,IAAI,UAAU;IAKpB,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAajC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;IAGhB,OAAO,IAAI,IAAI;CAKhB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC;IACtD,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;CAEM,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hmac.js b/node_modules/@noble/hashes/esm/hmac.js new file mode 100644 index 0000000..4636246 --- /dev/null +++ b/node_modules/@noble/hashes/esm/hmac.js @@ -0,0 +1,86 @@ +/** + * HMAC: RFC2104 message authentication code. + * @module + */ +import { abytes, aexists, ahash, clean, Hash, toBytes } from "./utils.js"; +export class HMAC extends Hash { + constructor(hash, _key) { + super(); + this.finished = false; + this.destroyed = false; + ahash(hash); + const key = toBytes(_key); + this.iHash = hash.create(); + if (typeof this.iHash.update !== 'function') + throw new Error('Expected instance of class which extends utils.Hash'); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + // blockLen can be bigger than outputLen + pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36; + this.iHash.update(pad); + // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone + this.oHash = hash.create(); + // Undo internal XOR && apply outer XOR + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36 ^ 0x5c; + this.oHash.update(pad); + clean(pad); + } + update(buf) { + aexists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + aexists(this); + abytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + // Create new instance without calling constructor since key already in state and we don't know it. + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + clone() { + return this._cloneInto(); + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } +} +/** + * HMAC: RFC2104 message authentication code. + * @param hash - function that would be used e.g. sha256 + * @param key - message key + * @param message - message data + * @example + * import { hmac } from '@noble/hashes/hmac'; + * import { sha256 } from '@noble/hashes/sha2'; + * const mac1 = hmac(sha256, 'key', 'message'); + */ +export const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); +hmac.create = (hash, key) => new HMAC(hash, key); +//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/hmac.js.map b/node_modules/@noble/hashes/esm/hmac.js.map new file mode 100644 index 0000000..dc621aa --- /dev/null +++ b/node_modules/@noble/hashes/esm/hmac.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAA0B,MAAM,YAAY,CAAC;AAElG,MAAM,OAAO,IAAwB,SAAQ,IAAa;IAQxD,YAAY,IAAW,EAAE,IAAW;QAClC,KAAK,EAAE,CAAC;QAJF,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QAIxB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,EAAO,CAAC;QAChC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU;YACzC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrC,wCAAwC;QACxC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC1E,KAAK,IAA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AG,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/index.d.ts b/node_modules/@noble/hashes/esm/index.d.ts new file mode 100644 index 0000000..e26a57a --- /dev/null +++ b/node_modules/@noble/hashes/esm/index.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/index.d.ts.map b/node_modules/@noble/hashes/esm/index.d.ts.map new file mode 100644 index 0000000..535b86d --- /dev/null +++ b/node_modules/@noble/hashes/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/index.js b/node_modules/@noble/hashes/esm/index.js new file mode 100644 index 0000000..3a2f175 --- /dev/null +++ b/node_modules/@noble/hashes/esm/index.js @@ -0,0 +1,33 @@ +/** + * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. + * @module + * @example +```js +import { + sha256, sha384, sha512, sha224, sha512_224, sha512_256 +} from '@noble/hashes/sha2'; +import { + sha3_224, sha3_256, sha3_384, sha3_512, + keccak_224, keccak_256, keccak_384, keccak_512, + shake128, shake256 +} from '@noble/hashes/sha3'; +import { + cshake128, cshake256, + turboshake128, turboshake256, + kmac128, kmac256, + tuplehash256, parallelhash256, + k12, m14, keccakprg +} from '@noble/hashes/sha3-addons'; +import { blake3 } from '@noble/hashes/blake3'; +import { blake2b, blake2s } from '@noble/hashes/blake2'; +import { hmac } from '@noble/hashes/hmac'; +import { hkdf } from '@noble/hashes/hkdf'; +import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; +import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; +import { md5, ripemd160, sha1 } from '@noble/hashes/legacy'; +import * as utils from '@noble/hashes/utils'; +``` + */ +throw new Error('root module cannot be imported: import submodules instead. Check out README'); +export {}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/index.js.map b/node_modules/@noble/hashes/esm/index.js.map new file mode 100644 index 0000000..2b0c4ca --- /dev/null +++ b/node_modules/@noble/hashes/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/legacy.d.ts b/node_modules/@noble/hashes/esm/legacy.d.ts new file mode 100644 index 0000000..39c2632 --- /dev/null +++ b/node_modules/@noble/hashes/esm/legacy.d.ts @@ -0,0 +1,71 @@ +/** + +SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 + * @module + */ +import { HashMD } from './_md.ts'; +import { type CHash } from './utils.ts'; +/** SHA1 legacy hash class. */ +export declare class SHA1 extends HashMD { + private A; + private B; + private C; + private D; + private E; + constructor(); + protected get(): [number, number, number, number, number]; + protected set(A: number, B: number, C: number, D: number, E: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ +export declare const sha1: CHash; +/** MD5 legacy hash class. */ +export declare class MD5 extends HashMD { + private A; + private B; + private C; + private D; + constructor(); + protected get(): [number, number, number, number]; + protected set(A: number, B: number, C: number, D: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +/** + * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. + * MD5 architecture is similar to SHA1, with some differences: + * - Reduced output length: 16 bytes (128 bit) instead of 20 + * - 64 rounds, instead of 80 + * - Little-endian: could be faster, but will require more code + * - Non-linear index selection: huge speed-up for unroll + * - Per round constants: more memory accesses, additional speed-up for unroll + */ +export declare const md5: CHash; +export declare class RIPEMD160 extends HashMD { + private h0; + private h1; + private h2; + private h3; + private h4; + constructor(); + protected get(): [number, number, number, number, number]; + protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +/** + * RIPEMD-160 - a legacy hash function from 1990s. + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + */ +export declare const ripemd160: CHash; +//# sourceMappingURL=legacy.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/legacy.d.ts.map b/node_modules/@noble/hashes/esm/legacy.d.ts.map new file mode 100644 index 0000000..68a8353 --- /dev/null +++ b/node_modules/@noble/hashes/esm/legacy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAO,MAAM,EAAO,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAUnE,8BAA8B;AAC9B,qBAAa,IAAK,SAAQ,MAAM,CAAC,IAAI,CAAC;IACpC,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;;IAK3B,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIzD,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CA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M,CAAC;IAIzD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAO/E,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAmCvD,SAAS,CAAC,UAAU,IAAI,IAAI;IAG5B,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAA2D,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/legacy.js b/node_modules/@noble/hashes/esm/legacy.js new file mode 100644 index 0000000..7067dca --- /dev/null +++ b/node_modules/@noble/hashes/esm/legacy.js @@ -0,0 +1,281 @@ +/** + +SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 + * @module + */ +import { Chi, HashMD, Maj } from "./_md.js"; +import { clean, createHasher, rotl } from "./utils.js"; +/** Initial SHA1 state */ +const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ + 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, +]); +// Reusable temporary buffer +const SHA1_W = /* @__PURE__ */ new Uint32Array(80); +/** SHA1 legacy hash class. */ +export class SHA1 extends HashMD { + constructor() { + super(64, 20, 8, false); + this.A = SHA1_IV[0] | 0; + this.B = SHA1_IV[1] | 0; + this.C = SHA1_IV[2] | 0; + this.D = SHA1_IV[3] | 0; + this.E = SHA1_IV[4] | 0; + } + get() { + const { A, B, C, D, E } = this; + return [A, B, C, D, E]; + } + set(A, B, C, D, E) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + SHA1_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 80; i++) + SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); + // Compression function main loop, 80 rounds + let { A, B, C, D, E } = this; + for (let i = 0; i < 80; i++) { + let F, K; + if (i < 20) { + F = Chi(B, C, D); + K = 0x5a827999; + } + else if (i < 40) { + F = B ^ C ^ D; + K = 0x6ed9eba1; + } + else if (i < 60) { + F = Maj(B, C, D); + K = 0x8f1bbcdc; + } + else { + F = B ^ C ^ D; + K = 0xca62c1d6; + } + const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; + E = D; + D = C; + C = rotl(B, 30); + B = A; + A = T; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + this.set(A, B, C, D, E); + } + roundClean() { + clean(SHA1_W); + } + destroy() { + this.set(0, 0, 0, 0, 0); + clean(this.buffer); + } +} +/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ +export const sha1 = /* @__PURE__ */ createHasher(() => new SHA1()); +/** Per-round constants */ +const p32 = /* @__PURE__ */ Math.pow(2, 32); +const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1)))); +/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ +const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); +// Reusable temporary buffer +const MD5_W = /* @__PURE__ */ new Uint32Array(16); +/** MD5 legacy hash class. */ +export class MD5 extends HashMD { + constructor() { + super(64, 16, 8, true); + this.A = MD5_IV[0] | 0; + this.B = MD5_IV[1] | 0; + this.C = MD5_IV[2] | 0; + this.D = MD5_IV[3] | 0; + } + get() { + const { A, B, C, D } = this; + return [A, B, C, D]; + } + set(A, B, C, D) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + MD5_W[i] = view.getUint32(offset, true); + // Compression function main loop, 64 rounds + let { A, B, C, D } = this; + for (let i = 0; i < 64; i++) { + let F, g, s; + if (i < 16) { + F = Chi(B, C, D); + g = i; + s = [7, 12, 17, 22]; + } + else if (i < 32) { + F = Chi(D, B, C); + g = (5 * i + 1) % 16; + s = [5, 9, 14, 20]; + } + else if (i < 48) { + F = B ^ C ^ D; + g = (3 * i + 5) % 16; + s = [4, 11, 16, 23]; + } + else { + F = C ^ (B | ~D); + g = (7 * i) % 16; + s = [6, 10, 15, 21]; + } + F = F + A + K[i] + MD5_W[g]; + A = D; + D = C; + C = B; + B = B + rotl(F, s[i % 4]); + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + this.set(A, B, C, D); + } + roundClean() { + clean(MD5_W); + } + destroy() { + this.set(0, 0, 0, 0); + clean(this.buffer); + } +} +/** + * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. + * MD5 architecture is similar to SHA1, with some differences: + * - Reduced output length: 16 bytes (128 bit) instead of 20 + * - 64 rounds, instead of 80 + * - Little-endian: could be faster, but will require more code + * - Non-linear index selection: huge speed-up for unroll + * - Per round constants: more memory accesses, additional speed-up for unroll + */ +export const md5 = /* @__PURE__ */ createHasher(() => new MD5()); +// RIPEMD-160 +const Rho160 = /* @__PURE__ */ Uint8Array.from([ + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, +]); +const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); +const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); +const idxLR = /* @__PURE__ */ (() => { + const L = [Id160]; + const R = [Pi160]; + const res = [L, R]; + for (let i = 0; i < 4; i++) + for (let j of res) + j.push(j[i].map((k) => Rho160[k])); + return res; +})(); +const idxL = /* @__PURE__ */ (() => idxLR[0])(); +const idxR = /* @__PURE__ */ (() => idxLR[1])(); +// const [idxL, idxR] = idxLR; +const shifts160 = /* @__PURE__ */ [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], +].map((i) => Uint8Array.from(i)); +const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); +const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); +const Kl160 = /* @__PURE__ */ Uint32Array.from([ + 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, +]); +const Kr160 = /* @__PURE__ */ Uint32Array.from([ + 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, +]); +// It's called f() in spec. +function ripemd_f(group, x, y, z) { + if (group === 0) + return x ^ y ^ z; + if (group === 1) + return (x & y) | (~x & z); + if (group === 2) + return (x | ~y) ^ z; + if (group === 3) + return (x & z) | (y & ~z); + return x ^ (y | ~z); +} +// Reusable temporary buffer +const BUF_160 = /* @__PURE__ */ new Uint32Array(16); +export class RIPEMD160 extends HashMD { + constructor() { + super(64, 20, 8, true); + this.h0 = 0x67452301 | 0; + this.h1 = 0xefcdab89 | 0; + this.h2 = 0x98badcfe | 0; + this.h3 = 0x10325476 | 0; + this.h4 = 0xc3d2e1f0 | 0; + } + get() { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + set(h0, h1, h2, h3, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + BUF_160[i] = view.getUint32(offset, true); + // prettier-ignore + let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; + // Instead of iterating 0 to 80, we split it into 5 groups + // And use the groups in constants, functions, etc. Much simpler + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore + const rl = idxL[group], rr = idxR[group]; // prettier-ignore + const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore + for (let i = 0; i < 16; i++) { + const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; + al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore + } + // 2 loops are 10% faster + for (let i = 0; i < 16; i++) { + const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; + ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore + } + } + // Add the compressed chunk to the current hash value + this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); + } + roundClean() { + clean(BUF_160); + } + destroy() { + this.destroyed = true; + clean(this.buffer); + this.set(0, 0, 0, 0, 0); + } +} +/** + * RIPEMD-160 - a legacy hash function from 1990s. + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + */ +export const ripemd160 = /* @__PURE__ */ createHasher(() => new RIPEMD160()); +//# sourceMappingURL=legacy.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/legacy.js.map b/node_modules/@noble/hashes/esm/legacy.js.map new file mode 100644 index 0000000..c47bea7 --- /dev/null +++ b/node_modules/@noble/hashes/esm/legacy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"legacy.js","sourceRoot":"","sources":["../src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAc,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnE,yBAAyB;AACzB,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC3D,CAAC,CAAC;AAEH,4BAA4B;AAC5B,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AAEnD,8BAA8B;AAC9B,MAAM,OAAO,IAAK,SAAQ,MAAY;IAOpC;QACE,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAPlB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,MAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAI3B,CAAC;IACS,GAAG;QACX,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,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C,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/package.json b/node_modules/@noble/hashes/esm/package.json new file mode 100644 index 0000000..f42e46b --- /dev/null +++ b/node_modules/@noble/hashes/esm/package.json @@ -0,0 +1,10 @@ +{ + "type": "module", + "sideEffects": false, + "browser": { + "node:crypto": false + }, + "node": { + "./crypto": "./esm/cryptoNode.js" + } +} diff --git a/node_modules/@noble/hashes/esm/pbkdf2.d.ts b/node_modules/@noble/hashes/esm/pbkdf2.d.ts new file mode 100644 index 0000000..0697c69 --- /dev/null +++ b/node_modules/@noble/hashes/esm/pbkdf2.d.ts @@ -0,0 +1,23 @@ +import { type CHash, type KDFInput } from './utils.ts'; +export type Pbkdf2Opt = { + c: number; + dkLen?: number; + asyncTick?: number; +}; +/** + * PBKDF2-HMAC: RFC 2898 key derivation function + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated + * @param salt - cryptographic salt + * @param opts - {c, dkLen} where c is work factor and dkLen is output message size + * @example + * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); + */ +export declare function pbkdf2(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Uint8Array; +/** + * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. + * @example + * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); + */ +export declare function pbkdf2Async(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Promise; +//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map b/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map new file mode 100644 index 0000000..033d374 --- /dev/null +++ b/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../src/pbkdf2.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkCF;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,UAAU,CAsBZ;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,CAAC,CAsBrB"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/pbkdf2.js b/node_modules/@noble/hashes/esm/pbkdf2.js new file mode 100644 index 0000000..42e78dc --- /dev/null +++ b/node_modules/@noble/hashes/esm/pbkdf2.js @@ -0,0 +1,97 @@ +/** + * PBKDF (RFC 2898). Can be used to create a key from password and salt. + * @module + */ +import { hmac } from "./hmac.js"; +// prettier-ignore +import { ahash, anumber, asyncLoop, checkOpts, clean, createView, Hash, kdfInputToBytes } from "./utils.js"; +// Common prologue and epilogue for sync/async functions +function pbkdf2Init(hash, _password, _salt, _opts) { + ahash(hash); + const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + anumber(c); + anumber(dkLen); + anumber(asyncTick); + if (c < 1) + throw new Error('iterations (c) should be >= 1'); + const password = kdfInputToBytes(_password); + const salt = kdfInputToBytes(_salt); + // DK = PBKDF2(PRF, Password, Salt, c, dkLen); + const DK = new Uint8Array(dkLen); + // U1 = PRF(Password, Salt + INT_32_BE(i)) + const PRF = hmac.create(hash, password); + const PRFSalt = PRF._cloneInto().update(salt); + return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; +} +function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { + PRF.destroy(); + PRFSalt.destroy(); + if (prfW) + prfW.destroy(); + clean(u); + return DK; +} +/** + * PBKDF2-HMAC: RFC 2898 key derivation function + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated + * @param salt - cryptographic salt + * @param opts - {c, dkLen} where c is work factor and dkLen is output message size + * @example + * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); + */ +export function pbkdf2(hash, password, salt, opts) { + const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW; // Working copy + const arr = new Uint8Array(4); + const view = createView(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + for (let ui = 1; ui < c; ui++) { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + } + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} +/** + * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. + * @example + * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); + */ +export async function pbkdf2Async(hash, password, salt, opts) { + const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW; // Working copy + const arr = new Uint8Array(4); + const view = createView(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + await asyncLoop(c - 1, asyncTick, () => { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + }); + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} +//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/pbkdf2.js.map b/node_modules/@noble/hashes/esm/pbkdf2.js.map new file mode 100644 index 0000000..01ffaed --- /dev/null +++ b/node_modules/@noble/hashes/esm/pbkdf2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../src/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,kBAAkB;AAClB,OAAO,EACL,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAG/D,MAAM,YAAY,CAAC;AAOpB,wDAAwD;AACxD,SAAS,UAAU,CAAC,IAAW,EAAE,SAAmB,EAAE,KAAe,EAAE,KAAgB;IACrF,KAAK,CAAC,IAAI,CAAC,CAAC;IACZ,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,KA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AC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,MAAM,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;YACrC,2BAA2B;YAC3B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/ripemd160.d.ts b/node_modules/@noble/hashes/esm/ripemd160.d.ts new file mode 100644 index 0000000..2fb0fa7 --- /dev/null +++ b/node_modules/@noble/hashes/esm/ripemd160.d.ts @@ -0,0 +1,13 @@ +/** + * RIPEMD-160 legacy hash function. + * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + * @module + * @deprecated + */ +import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from './legacy.ts'; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const RIPEMD160: typeof RIPEMD160n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const ripemd160: typeof ripemd160n; +//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/ripemd160.d.ts.map b/node_modules/@noble/hashes/esm/ripemd160.d.ts.map new file mode 100644 index 0000000..a04f75b --- /dev/null +++ b/node_modules/@noble/hashes/esm/ripemd160.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../src/ripemd160.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/E,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC;AACvD,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/ripemd160.js b/node_modules/@noble/hashes/esm/ripemd160.js new file mode 100644 index 0000000..cdcac9b --- /dev/null +++ b/node_modules/@noble/hashes/esm/ripemd160.js @@ -0,0 +1,13 @@ +/** + * RIPEMD-160 legacy hash function. + * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + * @module + * @deprecated + */ +import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from "./legacy.js"; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const RIPEMD160 = RIPEMD160n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const ripemd160 = ripemd160n; +//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/ripemd160.js.map b/node_modules/@noble/hashes/esm/ripemd160.js.map new file mode 100644 index 0000000..82324f4 --- /dev/null +++ b/node_modules/@noble/hashes/esm/ripemd160.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../src/ripemd160.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAsB,UAAU,CAAC;AACvD,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAsB,UAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/scrypt.d.ts b/node_modules/@noble/hashes/esm/scrypt.d.ts new file mode 100644 index 0000000..38d0ef9 --- /dev/null +++ b/node_modules/@noble/hashes/esm/scrypt.d.ts @@ -0,0 +1,34 @@ +import { type KDFInput } from './utils.ts'; +export type ScryptOpts = { + N: number; + r: number; + p: number; + dkLen?: number; + asyncTick?: number; + maxmem?: number; + onProgress?: (progress: number) => void; +}; +/** + * Scrypt KDF from RFC 7914. + * @param password - pass + * @param salt - salt + * @param opts - parameters + * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) + * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance + * - `p` is parallelization factor (1 is common) + * - `dkLen` is output key length in bytes e.g. 32. + * - `asyncTick` - (default: 10) max time in ms for which async function can block execution + * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt + * - `onProgress` - callback function that would be executed for progress report + * @returns Derived key + * @example + * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export declare function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array; +/** + * Scrypt KDF from RFC 7914. Async version. + * @example + * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export declare function scryptAsync(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Promise; +//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/scrypt.d.ts.map b/node_modules/@noble/hashes/esm/scrypt.d.ts.map new file mode 100644 index 0000000..b47cc92 --- /dev/null +++ b/node_modules/@noble/hashes/esm/scrypt.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../src/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAuEpB,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAoFF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CA0BvF;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,UAAU,CAAC,CA2BrB"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/scrypt.js b/node_modules/@noble/hashes/esm/scrypt.js new file mode 100644 index 0000000..9b7e9a0 --- /dev/null +++ b/node_modules/@noble/hashes/esm/scrypt.js @@ -0,0 +1,228 @@ +/** + * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. + * @module + */ +import { pbkdf2 } from "./pbkdf2.js"; +import { sha256 } from "./sha2.js"; +// prettier-ignore +import { anumber, asyncLoop, checkOpts, clean, rotl, swap32IfBE, u32 } from "./utils.js"; +// The main Scrypt loop: uses Salsa extensively. +// Six versions of the function were tried, this is the fastest one. +// prettier-ignore +function XorAndSalsa(prev, pi, input, ii, out, oi) { + // Based on https://cr.yp.to/salsa20.html + // Xor blocks + let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; + let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; + let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; + let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; + let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; + let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; + let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; + let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; + // Save state to temporary variables (salsa) + let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; + // Main loop (salsa) + for (let i = 0; i < 8; i += 2) { + x04 ^= rotl(x00 + x12 | 0, 7); + x08 ^= rotl(x04 + x00 | 0, 9); + x12 ^= rotl(x08 + x04 | 0, 13); + x00 ^= rotl(x12 + x08 | 0, 18); + x09 ^= rotl(x05 + x01 | 0, 7); + x13 ^= rotl(x09 + x05 | 0, 9); + x01 ^= rotl(x13 + x09 | 0, 13); + x05 ^= rotl(x01 + x13 | 0, 18); + x14 ^= rotl(x10 + x06 | 0, 7); + x02 ^= rotl(x14 + x10 | 0, 9); + x06 ^= rotl(x02 + x14 | 0, 13); + x10 ^= rotl(x06 + x02 | 0, 18); + x03 ^= rotl(x15 + x11 | 0, 7); + x07 ^= rotl(x03 + x15 | 0, 9); + x11 ^= rotl(x07 + x03 | 0, 13); + x15 ^= rotl(x11 + x07 | 0, 18); + x01 ^= rotl(x00 + x03 | 0, 7); + x02 ^= rotl(x01 + x00 | 0, 9); + x03 ^= rotl(x02 + x01 | 0, 13); + x00 ^= rotl(x03 + x02 | 0, 18); + x06 ^= rotl(x05 + x04 | 0, 7); + x07 ^= rotl(x06 + x05 | 0, 9); + x04 ^= rotl(x07 + x06 | 0, 13); + x05 ^= rotl(x04 + x07 | 0, 18); + x11 ^= rotl(x10 + x09 | 0, 7); + x08 ^= rotl(x11 + x10 | 0, 9); + x09 ^= rotl(x08 + x11 | 0, 13); + x10 ^= rotl(x09 + x08 | 0, 18); + x12 ^= rotl(x15 + x14 | 0, 7); + x13 ^= rotl(x12 + x15 | 0, 9); + x14 ^= rotl(x13 + x12 | 0, 13); + x15 ^= rotl(x14 + x13 | 0, 18); + } + // Write output (salsa) + out[oi++] = (y00 + x00) | 0; + out[oi++] = (y01 + x01) | 0; + out[oi++] = (y02 + x02) | 0; + out[oi++] = (y03 + x03) | 0; + out[oi++] = (y04 + x04) | 0; + out[oi++] = (y05 + x05) | 0; + out[oi++] = (y06 + x06) | 0; + out[oi++] = (y07 + x07) | 0; + out[oi++] = (y08 + x08) | 0; + out[oi++] = (y09 + x09) | 0; + out[oi++] = (y10 + x10) | 0; + out[oi++] = (y11 + x11) | 0; + out[oi++] = (y12 + x12) | 0; + out[oi++] = (y13 + x13) | 0; + out[oi++] = (y14 + x14) | 0; + out[oi++] = (y15 + x15) | 0; +} +function BlockMix(input, ii, out, oi, r) { + // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) + let head = oi + 0; + let tail = oi + 16 * r; + for (let i = 0; i < 16; i++) + out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] + for (let i = 0; i < r; i++, head += 16, ii += 16) { + // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 + XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) + if (i > 0) + tail += 16; // First iteration overwrites tmp value in tail + XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) + } +} +// Common prologue and epilogue for sync/async functions +function scryptInit(password, salt, _opts) { + // Maxmem - 1GB+1KB by default + const opts = checkOpts({ + dkLen: 32, + asyncTick: 10, + maxmem: 1024 ** 3 + 1024, + }, _opts); + const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; + anumber(N); + anumber(r); + anumber(p); + anumber(dkLen); + anumber(asyncTick); + anumber(maxmem); + if (onProgress !== undefined && typeof onProgress !== 'function') + throw new Error('progressCb should be function'); + const blockSize = 128 * r; + const blockSize32 = blockSize / 4; + // Max N is 2^32 (Integrify is 32-bit). Real limit is 2^22: JS engines Uint8Array limit is 4GB in 2024. + // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, + // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: + // https://www.rfc-editor.org/errata_search.php?rfc=7914 + const pow32 = Math.pow(2, 32); + if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) { + throw new Error('Scrypt: N must be larger than 1, a power of 2, and less than 2^32'); + } + if (p < 0 || p > ((pow32 - 1) * 32) / blockSize) { + throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); + } + if (dkLen < 0 || dkLen > (pow32 - 1) * 32) { + throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); + } + const memUsed = blockSize * (N + p); + if (memUsed > maxmem) { + throw new Error('Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of ' + maxmem); + } + // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) + // Since it has only one iteration there is no reason to use async variant + const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); + const B32 = u32(B); + // Re-used between parallel iterations. Array(iterations) of B + const V = u32(new Uint8Array(blockSize * N)); + const tmp = u32(new Uint8Array(blockSize)); + let blockMixCb = () => { }; + if (onProgress) { + const totalBlockMix = 2 * N * p; + // Invoke callback if progress changes from 10.01 to 10.02 + // Allows to draw smooth progress bar on up to 8K screen + const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); + let blockMixCnt = 0; + blockMixCb = () => { + blockMixCnt++; + if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) + onProgress(blockMixCnt / totalBlockMix); + }; + } + return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; +} +function scryptOutput(password, dkLen, B, V, tmp) { + const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); + clean(B, V, tmp); + return res; +} +/** + * Scrypt KDF from RFC 7914. + * @param password - pass + * @param salt - salt + * @param opts - parameters + * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) + * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance + * - `p` is parallelization factor (1 is common) + * - `dkLen` is output key length in bytes e.g. 32. + * - `asyncTick` - (default: 10) max time in ms for which async function can block execution + * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt + * - `onProgress` - callback function that would be executed for progress report + * @returns Derived key + * @example + * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export function scrypt(password, salt, opts) { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); + swap32IfBE(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) + V[i] = B32[Pi + i]; // V[0] = B[i] + for (let i = 0, pos = 0; i < N - 1; i++) { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + } + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + for (let i = 0; i < N; i++) { + // First u32 of the last 64-byte block (u32 is LE) + const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + for (let k = 0; k < blockSize32; k++) + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + } + } + swap32IfBE(B32); + return scryptOutput(password, dkLen, B, V, tmp); +} +/** + * Scrypt KDF from RFC 7914. Async version. + * @example + * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export async function scryptAsync(password, salt, opts) { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); + swap32IfBE(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) + V[i] = B32[Pi + i]; // V[0] = B[i] + let pos = 0; + await asyncLoop(N - 1, asyncTick, () => { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + }); + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + await asyncLoop(N, asyncTick, () => { + // First u32 of the last 64-byte block (u32 is LE) + const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + for (let k = 0; k < blockSize32; k++) + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + }); + } + swap32IfBE(B32); + return scryptOutput(password, dkLen, B, V, tmp); +} +//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/scrypt.js.map b/node_modules/@noble/hashes/esm/scrypt.js.map new file mode 100644 index 0000000..cb5628b --- /dev/null +++ b/node_modules/@noble/hashes/esm/scrypt.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../src/scrypt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,kBAAkB;AAClB,OAAO,EACL,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,KAAK,EACD,IAAI,EACnB,UAAU,EACV,GAAG,EACJ,MAAM,YAAY,CAAC;AAEpB,gDAAgD;AAChD,oEAAoE;AACpE,kBAAkB;AAClB,SAAS,WAAW,CAClB,IAAiB,EACjB,EAA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AAC,CAAC,CAAC,CAAC,iBAAiB;YACtG,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,yBAAyB;YACvD,UAAU,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IACD,UAAU,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha1.d.ts b/node_modules/@noble/hashes/esm/sha1.d.ts new file mode 100644 index 0000000..7c36b9f --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha1.d.ts @@ -0,0 +1,11 @@ +/** + * SHA1 (RFC 3174) legacy hash function. + * @module + * @deprecated + */ +import { SHA1 as SHA1n, sha1 as sha1n } from './legacy.ts'; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const SHA1: typeof SHA1n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const sha1: typeof sha1n; +//# sourceMappingURL=sha1.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha1.d.ts.map b/node_modules/@noble/hashes/esm/sha1.d.ts.map new file mode 100644 index 0000000..908753d --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["../src/sha1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC3D,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha1.js b/node_modules/@noble/hashes/esm/sha1.js new file mode 100644 index 0000000..c8451df --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha1.js @@ -0,0 +1,11 @@ +/** + * SHA1 (RFC 3174) legacy hash function. + * @module + * @deprecated + */ +import { SHA1 as SHA1n, sha1 as sha1n } from "./legacy.js"; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const SHA1 = SHA1n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const sha1 = sha1n; +//# sourceMappingURL=sha1.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha1.js.map b/node_modules/@noble/hashes/esm/sha1.js.map new file mode 100644 index 0000000..2e28aab --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.js","sourceRoot":"","sources":["../src/sha1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC3D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,CAAC;AACxC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha2.d.ts b/node_modules/@noble/hashes/esm/sha2.d.ts new file mode 100644 index 0000000..33f2f7f --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha2.d.ts @@ -0,0 +1,159 @@ +/** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + */ +import { HashMD } from './_md.ts'; +import { type CHash } from './utils.ts'; +export declare class SHA256 extends HashMD { + protected A: number; + protected B: number; + protected C: number; + protected D: number; + protected E: number; + protected F: number; + protected G: number; + protected H: number; + constructor(outputLen?: number); + protected get(): [number, number, number, number, number, number, number, number]; + protected set(A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +export declare class SHA224 extends SHA256 { + protected A: number; + protected B: number; + protected C: number; + protected D: number; + protected E: number; + protected F: number; + protected G: number; + protected H: number; + constructor(); +} +export declare class SHA512 extends HashMD { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(outputLen?: number); + protected get(): [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]; + protected set(Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +export declare class SHA384 extends SHA512 { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(); +} +export declare class SHA512_224 extends SHA512 { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(); +} +export declare class SHA512_256 extends SHA512 { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(); +} +/** + * SHA2-256 hash function from RFC 4634. + * + * It is the fastest JS hash, even faster than Blake3. + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + */ +export declare const sha256: CHash; +/** SHA2-224 hash function from RFC 4634 */ +export declare const sha224: CHash; +/** SHA2-512 hash function from RFC 4634. */ +export declare const sha512: CHash; +/** SHA2-384 hash function from RFC 4634. */ +export declare const sha384: CHash; +/** + * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export declare const sha512_256: CHash; +/** + * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export declare const sha512_224: CHash; +//# sourceMappingURL=sha2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha2.d.ts.map b/node_modules/@noble/hashes/esm/sha2.d.ts.map new file mode 100644 index 0000000..4be5881 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["../src/sha2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAO,MAAM,EAAmD,MAAM,UAAU,CAAC;AAExF,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAoBnE,qBAAa,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC;IAGxC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAA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CAA2C;AAC3C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAE9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAC9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC;AACtF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha2.js b/node_modules/@noble/hashes/esm/sha2.js new file mode 100644 index 0000000..9795cc5 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha2.js @@ -0,0 +1,375 @@ +/** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + */ +import { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from "./_md.js"; +import * as u64 from "./_u64.js"; +import { clean, createHasher, rotr } from "./utils.js"; +/** + * Round constants: + * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) + */ +// prettier-ignore +const SHA256_K = /* @__PURE__ */ Uint32Array.from([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +]); +/** Reusable temporary buffer. "W" comes straight from spec. */ +const SHA256_W = /* @__PURE__ */ new Uint32Array(64); +export class SHA256 extends HashMD { + constructor(outputLen = 32) { + super(64, outputLen, 8, false); + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + this.A = SHA256_IV[0] | 0; + this.B = SHA256_IV[1] | 0; + this.C = SHA256_IV[2] | 0; + this.D = SHA256_IV[3] | 0; + this.E = SHA256_IV[4] | 0; + this.F = SHA256_IV[5] | 0; + this.G = SHA256_IV[6] | 0; + this.H = SHA256_IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + // prettier-ignore + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); + SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; + } + // Compression function main loop, 64 rounds + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); + const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); + const T2 = (sigma0 + Maj(A, B, C)) | 0; + H = G; + G = F; + F = E; + E = (D + T1) | 0; + D = C; + C = B; + B = A; + A = (T1 + T2) | 0; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + F = (F + this.F) | 0; + G = (G + this.G) | 0; + H = (H + this.H) | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + clean(SHA256_W); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + clean(this.buffer); + } +} +export class SHA224 extends SHA256 { + constructor() { + super(28); + this.A = SHA224_IV[0] | 0; + this.B = SHA224_IV[1] | 0; + this.C = SHA224_IV[2] | 0; + this.D = SHA224_IV[3] | 0; + this.E = SHA224_IV[4] | 0; + this.F = SHA224_IV[5] | 0; + this.G = SHA224_IV[6] | 0; + this.H = SHA224_IV[7] | 0; + } +} +// SHA2-512 is slower than sha256 in js because u64 operations are slow. +// Round contants +// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 +// prettier-ignore +const K512 = /* @__PURE__ */ (() => u64.split([ + '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', + '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', + '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', + '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', + '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', + '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', + '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', + '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', + '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', + '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', + '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', + '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', + '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', + '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', + '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', + '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', + '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', + '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', + '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', + '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' +].map(n => BigInt(n))))(); +const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); +const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); +// Reusable temporary buffers +const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); +const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); +export class SHA512 extends HashMD { + constructor(outputLen = 64) { + super(128, outputLen, 16, false); + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // h -- high 32 bits, l -- low 32 bits + this.Ah = SHA512_IV[0] | 0; + this.Al = SHA512_IV[1] | 0; + this.Bh = SHA512_IV[2] | 0; + this.Bl = SHA512_IV[3] | 0; + this.Ch = SHA512_IV[4] | 0; + this.Cl = SHA512_IV[5] | 0; + this.Dh = SHA512_IV[6] | 0; + this.Dl = SHA512_IV[7] | 0; + this.Eh = SHA512_IV[8] | 0; + this.El = SHA512_IV[9] | 0; + this.Fh = SHA512_IV[10] | 0; + this.Fl = SHA512_IV[11] | 0; + this.Gh = SHA512_IV[12] | 0; + this.Gl = SHA512_IV[13] | 0; + this.Hh = SHA512_IV[14] | 0; + this.Hl = SHA512_IV[15] | 0; + } + // prettier-ignore + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + // prettier-ignore + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + process(view, offset) { + // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H[i] = view.getUint32(offset); + SHA512_W_L[i] = view.getUint32((offset += 4)); + } + for (let i = 16; i < 80; i++) { + // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) + const W15h = SHA512_W_H[i - 15] | 0; + const W15l = SHA512_W_L[i - 15] | 0; + const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); + const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); + // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) + const W2h = SHA512_W_H[i - 2] | 0; + const W2l = SHA512_W_L[i - 2] | 0; + const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); + const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); + // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; + const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + SHA512_W_H[i] = SUMh | 0; + SHA512_W_L[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + // Compression function main loop, 80 rounds + for (let i = 0; i < 80; i++) { + // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) + const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); + const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); + //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const CHIh = (Eh & Fh) ^ (~Eh & Gh); + const CHIl = (El & Fl) ^ (~El & Gl); + // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] + // prettier-ignore + const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1l = T1ll | 0; + // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) + const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); + const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); + const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); + const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = u64.add3L(T1l, sigma0l, MAJl); + Ah = u64.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + // Add the compressed chunk to the current hash value + ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + roundClean() { + clean(SHA512_W_H, SHA512_W_L); + } + destroy() { + clean(this.buffer); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +} +export class SHA384 extends SHA512 { + constructor() { + super(48); + this.Ah = SHA384_IV[0] | 0; + this.Al = SHA384_IV[1] | 0; + this.Bh = SHA384_IV[2] | 0; + this.Bl = SHA384_IV[3] | 0; + this.Ch = SHA384_IV[4] | 0; + this.Cl = SHA384_IV[5] | 0; + this.Dh = SHA384_IV[6] | 0; + this.Dl = SHA384_IV[7] | 0; + this.Eh = SHA384_IV[8] | 0; + this.El = SHA384_IV[9] | 0; + this.Fh = SHA384_IV[10] | 0; + this.Fl = SHA384_IV[11] | 0; + this.Gh = SHA384_IV[12] | 0; + this.Gl = SHA384_IV[13] | 0; + this.Hh = SHA384_IV[14] | 0; + this.Hl = SHA384_IV[15] | 0; + } +} +/** + * Truncated SHA512/256 and SHA512/224. + * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. + * Then t hashes string to produce result IV. + * See `test/misc/sha2-gen-iv.js`. + */ +/** SHA512/224 IV */ +const T224_IV = /* @__PURE__ */ Uint32Array.from([ + 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, + 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, +]); +/** SHA512/256 IV */ +const T256_IV = /* @__PURE__ */ Uint32Array.from([ + 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, + 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, +]); +export class SHA512_224 extends SHA512 { + constructor() { + super(28); + this.Ah = T224_IV[0] | 0; + this.Al = T224_IV[1] | 0; + this.Bh = T224_IV[2] | 0; + this.Bl = T224_IV[3] | 0; + this.Ch = T224_IV[4] | 0; + this.Cl = T224_IV[5] | 0; + this.Dh = T224_IV[6] | 0; + this.Dl = T224_IV[7] | 0; + this.Eh = T224_IV[8] | 0; + this.El = T224_IV[9] | 0; + this.Fh = T224_IV[10] | 0; + this.Fl = T224_IV[11] | 0; + this.Gh = T224_IV[12] | 0; + this.Gl = T224_IV[13] | 0; + this.Hh = T224_IV[14] | 0; + this.Hl = T224_IV[15] | 0; + } +} +export class SHA512_256 extends SHA512 { + constructor() { + super(32); + this.Ah = T256_IV[0] | 0; + this.Al = T256_IV[1] | 0; + this.Bh = T256_IV[2] | 0; + this.Bl = T256_IV[3] | 0; + this.Ch = T256_IV[4] | 0; + this.Cl = T256_IV[5] | 0; + this.Dh = T256_IV[6] | 0; + this.Dl = T256_IV[7] | 0; + this.Eh = T256_IV[8] | 0; + this.El = T256_IV[9] | 0; + this.Fh = T256_IV[10] | 0; + this.Fl = T256_IV[11] | 0; + this.Gh = T256_IV[12] | 0; + this.Gl = T256_IV[13] | 0; + this.Hh = T256_IV[14] | 0; + this.Hl = T256_IV[15] | 0; + } +} +/** + * SHA2-256 hash function from RFC 4634. + * + * It is the fastest JS hash, even faster than Blake3. + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + */ +export const sha256 = /* @__PURE__ */ createHasher(() => new SHA256()); +/** SHA2-224 hash function from RFC 4634 */ +export const sha224 = /* @__PURE__ */ createHasher(() => new SHA224()); +/** SHA2-512 hash function from RFC 4634. */ +export const sha512 = /* @__PURE__ */ createHasher(() => new SHA512()); +/** SHA2-384 hash function from RFC 4634. */ +export const sha384 = /* @__PURE__ */ createHasher(() => new SHA384()); +/** + * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export const sha512_256 = /* @__PURE__ */ createHasher(() => new SHA512_256()); +/** + * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export const sha512_224 = /* @__PURE__ */ createHasher(() => new SHA512_224()); +//# sourceMappingURL=sha2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha2.js.map b/node_modules/@noble/hashes/esm/sha2.js.map new file mode 100644 index 0000000..f3fc032 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha2.js","sourceRoot":"","sources":["../src/sha2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,OAAO,EAAc,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEnE;;;GAGG;AACH,kBAAkB;AAClB,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAChD,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,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AAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAC9E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,MAAM,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAE9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,MAAM,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAC9E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,MAAM,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAE9E;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AACtF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAU,eAAe,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha256.d.ts b/node_modules/@noble/hashes/esm/sha256.d.ts new file mode 100644 index 0000000..ed04fe8 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha256.d.ts @@ -0,0 +1,20 @@ +/** + * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. + * + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * + * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + * @deprecated + */ +import { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n } from './sha2.ts'; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA256: typeof SHA256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha256: typeof sha256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA224: typeof SHA224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha224: typeof sha224n; +//# sourceMappingURL=sha256.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha256.d.ts.map b/node_modules/@noble/hashes/esm/sha256.d.ts.map new file mode 100644 index 0000000..2912e85 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha256.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha256.js b/node_modules/@noble/hashes/esm/sha256.js new file mode 100644 index 0000000..6bdee7c --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha256.js @@ -0,0 +1,20 @@ +/** + * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. + * + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * + * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + * @deprecated + */ +import { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n, } from "./sha2.js"; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA256 = SHA256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha256 = sha256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA224 = SHA224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha224 = sha224n; +//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha256.js.map b/node_modules/@noble/hashes/esm/sha256.js.map new file mode 100644 index 0000000..6df7235 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha256.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha256.js","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,GAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3-addons.d.ts b/node_modules/@noble/hashes/esm/sha3-addons.d.ts new file mode 100644 index 0000000..5bd2fe6 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3-addons.d.ts @@ -0,0 +1,142 @@ +/** + * SHA3 (keccak) addons. + * + * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): + * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants + * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): + * * 🦘 K12 aka KangarooTwelve + * * M14 aka MarsupilamiFourteen + * * TurboSHAKE + * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) + * @module + */ +import { Keccak, type ShakeOpts } from './sha3.ts'; +import { type CHashO, type CHashXO, Hash, type HashXOF, type Input } from './utils.ts'; +export type cShakeOpts = ShakeOpts & { + personalization?: Input; + NISTfn?: Input; +}; +export type ICShake = { + (msg: Input, opts?: cShakeOpts): Uint8Array; + outputLen: number; + blockLen: number; + create(opts: cShakeOpts): HashXOF; +}; +export type ITupleHash = { + (messages: Input[], opts?: cShakeOpts): Uint8Array; + create(opts?: cShakeOpts): TupleHash; +}; +export type IParHash = { + (message: Input, opts?: ParallelOpts): Uint8Array; + create(opts?: ParallelOpts): ParallelHash; +}; +export declare const cshake128: ICShake; +export declare const cshake256: ICShake; +export declare class KMAC extends Keccak implements HashXOF { + constructor(blockLen: number, outputLen: number, enableXOF: boolean, key: Input, opts?: cShakeOpts); + protected finish(): void; + _cloneInto(to?: KMAC): KMAC; + clone(): KMAC; +} +export declare const kmac128: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare const kmac256: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare const kmac128xof: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare const kmac256xof: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare class TupleHash extends Keccak implements HashXOF { + constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts?: cShakeOpts); + protected finish(): void; + _cloneInto(to?: TupleHash): TupleHash; + clone(): TupleHash; +} +/** 128-bit TupleHASH. */ +export declare const tuplehash128: ITupleHash; +/** 256-bit TupleHASH. */ +export declare const tuplehash256: ITupleHash; +/** 128-bit TupleHASH XOF. */ +export declare const tuplehash128xof: ITupleHash; +/** 256-bit TupleHASH XOF. */ +export declare const tuplehash256xof: ITupleHash; +type ParallelOpts = cShakeOpts & { + blockLen?: number; +}; +export declare class ParallelHash extends Keccak implements HashXOF { + private leafHash?; + protected leafCons: () => Hash; + private chunkPos; + private chunksDone; + private chunkLen; + constructor(blockLen: number, outputLen: number, leafCons: () => Hash, enableXOF: boolean, opts?: ParallelOpts); + protected finish(): void; + _cloneInto(to?: ParallelHash): ParallelHash; + destroy(): void; + clone(): ParallelHash; +} +/** 128-bit ParallelHash. In JS, it is not parallel. */ +export declare const parallelhash128: IParHash; +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export declare const parallelhash256: IParHash; +/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ +export declare const parallelhash128xof: IParHash; +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export declare const parallelhash256xof: IParHash; +export type TurboshakeOpts = ShakeOpts & { + D?: number; +}; +/** TurboSHAKE 128-bit: reduced 12-round keccak. */ +export declare const turboshake128: CHashXO; +/** TurboSHAKE 256-bit: reduced 12-round keccak. */ +export declare const turboshake256: CHashXO; +export type KangarooOpts = { + dkLen?: number; + personalization?: Input; +}; +export declare class KangarooTwelve extends Keccak implements HashXOF { + readonly chunkLen = 8192; + private leafHash?; + protected leafLen: number; + private personalization; + private chunkPos; + private chunksDone; + constructor(blockLen: number, leafLen: number, outputLen: number, rounds: number, opts: KangarooOpts); + update(data: Input): this; + protected finish(): void; + destroy(): void; + _cloneInto(to?: KangarooTwelve): KangarooTwelve; + clone(): KangarooTwelve; +} +/** KangarooTwelve: reduced 12-round keccak. */ +export declare const k12: CHashO; +/** MarsupilamiFourteen: reduced 14-round keccak. */ +export declare const m14: CHashO; +/** + * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. + */ +export declare class KeccakPRG extends Keccak { + protected rate: number; + constructor(capacity: number); + keccak(): void; + update(data: Input): this; + feed(data: Input): this; + protected finish(): void; + digestInto(_out: Uint8Array): Uint8Array; + fetch(bytes: number): Uint8Array; + forget(): void; + _cloneInto(to?: KeccakPRG): KeccakPRG; + clone(): KeccakPRG; +} +/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ +export declare const keccakprg: (capacity?: number) => KeccakPRG; +export {}; +//# sourceMappingURL=sha3-addons.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map b/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map new file mode 100644 index 0000000..4f4b11b --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha3-addons.d.ts","sourceRoot":"","sources":["../src/sha3-addons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,OAAO,EAGZ,IAAI,EACJ,KAAK,OAAO,EACZ,KAAK,KAAK,EAGX,MAAM,YAAY,CAAC;AAoCpB,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IAAE,eAAe,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AA0BjF,MAAM,MAAM,OAAO,GAAG;IACpB,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU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pB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAwBzB,SAAS,CAAC,MAAM,IAAI,IAAI;IAYxB,OAAO,IAAI,IAAI;IAMf,UAAU,CAAC,EAAE,CAAC,EAAE,cAAc,GAAG,cAAc;IAW/C,KAAK,IAAI,cAAc;CAGxB;AACD,+CAA+C;AAC/C,eAAO,MAAM,GAAG,EAAE,MAGZ,CAAC;AACP,oDAAoD;AACpD,eAAO,MAAM,GAAG,EAAE,MAGZ,CAAC;AAEP;;GAEG;AACH,qBAAa,SAAU,SAAQ,MAAM;IACnC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;gBACX,QAAQ,EAAE,MAAM;IAU5B,MAAM,IAAI,IAAI;IAQd,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAKzB,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAGvB,SAAS,CAAC,MAAM,IAAI,IAAI;IACxB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAGxC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAIhC,MAAM,IAAI,IAAI;IAQd,UAAU,CAAC,EAAE,CAAC,EAAE,SAAS,GAAG,SAAS;IAOrC,KAAK,IAAI,SAAS;CAGnB;AAED,gGAAgG;AAChG,eAAO,MAAM,SAAS,GAAI,iBAAc,KAAG,SAAoC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3-addons.js b/node_modules/@noble/hashes/esm/sha3-addons.js new file mode 100644 index 0000000..ec9c664 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3-addons.js @@ -0,0 +1,393 @@ +/** + * SHA3 (keccak) addons. + * + * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): + * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants + * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): + * * 🦘 K12 aka KangarooTwelve + * * M14 aka MarsupilamiFourteen + * * TurboSHAKE + * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) + * @module + */ +import { Keccak } from "./sha3.js"; +import { abytes, anumber, createOptHasher, createXOFer, Hash, toBytes, u32, } from "./utils.js"; +// cSHAKE && KMAC (NIST SP800-185) +const _8n = BigInt(8); +const _ffn = BigInt(0xff); +// NOTE: it is safe to use bigints here, since they used only for length encoding (not actual data). +// We use bigints in sha256 for lengths too. +function leftEncode(n) { + n = BigInt(n); + const res = [Number(n & _ffn)]; + n >>= _8n; + for (; n > 0; n >>= _8n) + res.unshift(Number(n & _ffn)); + res.unshift(res.length); + return new Uint8Array(res); +} +function rightEncode(n) { + n = BigInt(n); + const res = [Number(n & _ffn)]; + n >>= _8n; + for (; n > 0; n >>= _8n) + res.unshift(Number(n & _ffn)); + res.push(res.length); + return new Uint8Array(res); +} +function chooseLen(opts, outputLen) { + return opts.dkLen === undefined ? outputLen : opts.dkLen; +} +const abytesOrZero = (buf) => { + if (buf === undefined) + return Uint8Array.of(); + return toBytes(buf); +}; +// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block +const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block); +// Personalization +function cshakePers(hash, opts = {}) { + if (!opts || (!opts.personalization && !opts.NISTfn)) + return hash; + // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) + // bytepad(encode_string(N) || encode_string(S), 168) + const blockLenBytes = leftEncode(hash.blockLen); + const fn = abytesOrZero(opts.NISTfn); + const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits + const pers = abytesOrZero(opts.personalization); + const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits + if (!fn.length && !pers.length) + return hash; + hash.suffix = 0x04; + hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); + let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; + hash.update(getPadding(totalLen, hash.blockLen)); + return hash; +} +const gencShake = (suffix, blockLen, outputLen) => createXOFer((opts = {}) => cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)); +export const cshake128 = /* @__PURE__ */ (() => gencShake(0x1f, 168, 128 / 8))(); +export const cshake256 = /* @__PURE__ */ (() => gencShake(0x1f, 136, 256 / 8))(); +export class KMAC extends Keccak { + constructor(blockLen, outputLen, enableXOF, key, opts = {}) { + super(blockLen, 0x1f, outputLen, enableXOF); + cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); + key = toBytes(key); + abytes(key); + // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). + const blockLenBytes = leftEncode(this.blockLen); + const keyLen = leftEncode(_8n * BigInt(key.length)); + this.update(blockLenBytes).update(keyLen).update(key); + const totalLen = blockLenBytes.length + keyLen.length + key.length; + this.update(getPadding(totalLen, this.blockLen)); + } + finish() { + if (!this.finished) + this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to) { + // Create new instance without calling constructor since key already in state and we don't know it. + // Force "to" to be instance of KMAC instead of Sha3. + if (!to) { + to = Object.create(Object.getPrototypeOf(this), {}); + to.state = this.state.slice(); + to.blockLen = this.blockLen; + to.state32 = u32(to.state); + } + return super._cloneInto(to); + } + clone() { + return this._cloneInto(); + } +} +function genKmac(blockLen, outputLen, xof = false) { + const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest(); + kmac.create = (key, opts = {}) => new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); + return kmac; +} +export const kmac128 = /* @__PURE__ */ (() => genKmac(168, 128 / 8))(); +export const kmac256 = /* @__PURE__ */ (() => genKmac(136, 256 / 8))(); +export const kmac128xof = /* @__PURE__ */ (() => genKmac(168, 128 / 8, true))(); +export const kmac256xof = /* @__PURE__ */ (() => genKmac(136, 256 / 8, true))(); +// TupleHash +// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) +export class TupleHash extends Keccak { + constructor(blockLen, outputLen, enableXOF, opts = {}) { + super(blockLen, 0x1f, outputLen, enableXOF); + cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); + // Change update after cshake processed + this.update = (data) => { + data = toBytes(data); + abytes(data); + super.update(leftEncode(_8n * BigInt(data.length))); + super.update(data); + return this; + }; + } + finish() { + if (!this.finished) + super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to) { + to || (to = new TupleHash(this.blockLen, this.outputLen, this.enableXOF)); + return super._cloneInto(to); + } + clone() { + return this._cloneInto(); + } +} +function genTuple(blockLen, outputLen, xof = false) { + const tuple = (messages, opts) => { + const h = tuple.create(opts); + for (const msg of messages) + h.update(msg); + return h.digest(); + }; + tuple.create = (opts = {}) => new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); + return tuple; +} +/** 128-bit TupleHASH. */ +export const tuplehash128 = /* @__PURE__ */ (() => genTuple(168, 128 / 8))(); +/** 256-bit TupleHASH. */ +export const tuplehash256 = /* @__PURE__ */ (() => genTuple(136, 256 / 8))(); +/** 128-bit TupleHASH XOF. */ +export const tuplehash128xof = /* @__PURE__ */ (() => genTuple(168, 128 / 8, true))(); +/** 256-bit TupleHASH XOF. */ +export const tuplehash256xof = /* @__PURE__ */ (() => genTuple(136, 256 / 8, true))(); +export class ParallelHash extends Keccak { + constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) { + super(blockLen, 0x1f, outputLen, enableXOF); + this.chunkPos = 0; // Position of current block in chunk + this.chunksDone = 0; // How many chunks we already have + cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); + this.leafCons = leafCons; + let { blockLen: B } = opts; + B || (B = 8); + anumber(B); + this.chunkLen = B; + super.update(leftEncode(B)); + // Change update after cshake processed + this.update = (data) => { + data = toBytes(data); + abytes(data); + const { chunkLen, leafCons } = this; + for (let pos = 0, len = data.length; pos < len;) { + if (this.chunkPos == chunkLen || !this.leafHash) { + if (this.leafHash) { + super.update(this.leafHash.digest()); + this.chunksDone++; + } + this.leafHash = leafCons(); + this.chunkPos = 0; + } + const take = Math.min(chunkLen - this.chunkPos, len - pos); + this.leafHash.update(data.subarray(pos, pos + take)); + this.chunkPos += take; + pos += take; + } + return this; + }; + } + finish() { + if (this.finished) + return; + if (this.leafHash) { + super.update(this.leafHash.digest()); + this.chunksDone++; + } + super.update(rightEncode(this.chunksDone)); + super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to) { + to || (to = new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF)); + if (this.leafHash) + to.leafHash = this.leafHash._cloneInto(to.leafHash); + to.chunkPos = this.chunkPos; + to.chunkLen = this.chunkLen; + to.chunksDone = this.chunksDone; + return super._cloneInto(to); + } + destroy() { + super.destroy.call(this); + if (this.leafHash) + this.leafHash.destroy(); + } + clone() { + return this._cloneInto(); + } +} +function genPrl(blockLen, outputLen, leaf, xof = false) { + const parallel = (message, opts) => parallel.create(opts).update(message).digest(); + parallel.create = (opts = {}) => new ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts); + return parallel; +} +/** 128-bit ParallelHash. In JS, it is not parallel. */ +export const parallelhash128 = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128))(); +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export const parallelhash256 = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256))(); +/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ +export const parallelhash128xof = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128, true))(); +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export const parallelhash256xof = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256, true))(); +const genTurboshake = (blockLen, outputLen) => createXOFer((opts = {}) => { + const D = opts.D === undefined ? 0x1f : opts.D; + // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/ + if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) + throw new Error('invalid domain separation byte must be 0x01..0x7f, got: ' + D); + return new Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); +}); +/** TurboSHAKE 128-bit: reduced 12-round keccak. */ +export const turboshake128 = /* @__PURE__ */ genTurboshake(168, 256 / 8); +/** TurboSHAKE 256-bit: reduced 12-round keccak. */ +export const turboshake256 = /* @__PURE__ */ genTurboshake(136, 512 / 8); +// Kangaroo +// Same as NIST rightEncode, but returns [0] for zero string +function rightEncodeK12(n) { + n = BigInt(n); + const res = []; + for (; n > 0; n >>= _8n) + res.unshift(Number(n & _ffn)); + res.push(res.length); + return Uint8Array.from(res); +} +const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); +export class KangarooTwelve extends Keccak { + constructor(blockLen, leafLen, outputLen, rounds, opts) { + super(blockLen, 0x07, outputLen, true, rounds); + this.chunkLen = 8192; + this.chunkPos = 0; // Position of current block in chunk + this.chunksDone = 0; // How many chunks we already have + this.leafLen = leafLen; + this.personalization = abytesOrZero(opts.personalization); + } + update(data) { + data = toBytes(data); + abytes(data); + const { chunkLen, blockLen, leafLen, rounds } = this; + for (let pos = 0, len = data.length; pos < len;) { + if (this.chunkPos == chunkLen) { + if (this.leafHash) + super.update(this.leafHash.digest()); + else { + this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() + super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); + } + this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); + this.chunksDone++; + this.chunkPos = 0; + } + const take = Math.min(chunkLen - this.chunkPos, len - pos); + const chunk = data.subarray(pos, pos + take); + if (this.leafHash) + this.leafHash.update(chunk); + else + super.update(chunk); + this.chunkPos += take; + pos += take; + } + return this; + } + finish() { + if (this.finished) + return; + const { personalization } = this; + this.update(personalization).update(rightEncodeK12(personalization.length)); + // Leaf hash + if (this.leafHash) { + super.update(this.leafHash.digest()); + super.update(rightEncodeK12(this.chunksDone)); + super.update(Uint8Array.from([0xff, 0xff])); + } + super.finish.call(this); + } + destroy() { + super.destroy.call(this); + if (this.leafHash) + this.leafHash.destroy(); + // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input + this.personalization = EMPTY_BUFFER; + } + _cloneInto(to) { + const { blockLen, leafLen, leafHash, outputLen, rounds } = this; + to || (to = new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {})); + super._cloneInto(to); + if (leafHash) + to.leafHash = leafHash._cloneInto(to.leafHash); + to.personalization.set(this.personalization); + to.leafLen = this.leafLen; + to.chunkPos = this.chunkPos; + to.chunksDone = this.chunksDone; + return to; + } + clone() { + return this._cloneInto(); + } +} +/** KangarooTwelve: reduced 12-round keccak. */ +export const k12 = /* @__PURE__ */ (() => createOptHasher((opts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)))(); +/** MarsupilamiFourteen: reduced 14-round keccak. */ +export const m14 = /* @__PURE__ */ (() => createOptHasher((opts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts)))(); +/** + * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. + */ +export class KeccakPRG extends Keccak { + constructor(capacity) { + anumber(capacity); + // Rho should be full bytes + if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) + throw new Error('invalid capacity'); + // blockLen = rho in bytes + super((1600 - capacity - 2) / 8, 0, 0, true); + this.rate = 1600 - capacity; + this.posOut = Math.floor((this.rate + 7) / 8); + } + keccak() { + // Duplex padding + this.state[this.pos] ^= 0x01; + this.state[this.blockLen] ^= 0x02; // Rho is full bytes + super.keccak(); + this.pos = 0; + this.posOut = 0; + } + update(data) { + super.update(data); + this.posOut = this.blockLen; + return this; + } + feed(data) { + return this.update(data); + } + finish() { } + digestInto(_out) { + throw new Error('digest is not allowed, use .fetch instead'); + } + fetch(bytes) { + return this.xof(bytes); + } + // Ensure irreversibility (even if state leaked previous outputs cannot be computed) + forget() { + if (this.rate < 1600 / 2 + 1) + throw new Error('rate is too low to use .forget()'); + this.keccak(); + for (let i = 0; i < this.blockLen; i++) + this.state[i] = 0; + this.pos = this.blockLen; + this.keccak(); + this.posOut = this.blockLen; + } + _cloneInto(to) { + const { rate } = this; + to || (to = new KeccakPRG(1600 - rate)); + super._cloneInto(to); + to.rate = rate; + return to; + } + clone() { + return this._cloneInto(); + } +} +/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ +export const keccakprg = (capacity = 254) => new KeccakPRG(capacity); +//# sourceMappingURL=sha3-addons.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3-addons.js.map b/node_modules/@noble/hashes/esm/sha3-addons.js.map new file mode 100644 index 0000000..6587b0b --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3-addons.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha3-addons.js","sourceRoot":"","sources":["../src/sha3-addons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,MAAM,EAAkB,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,MAAM,EACN,OAAO,EAGP,eAAe,EACf,WAAW,EACX,IAAI,EAGJ,OAAO,EACP,GAAG,GACJ,MAAM,YAAY,CAAC;AAEpB,kCAAkC;AAClC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAE1B,oGAAoG;AACpG,4CAA4C;AAC5C,SAAS,UAAU,CAAC,CAAkB;IACpC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACd,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/B,CAAC,KAAK,GAAG,CAAC;IACV,OAAO,CAAC,GAAG,CAAC,EAAE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tB,EAAE,KAAF,EAAE,GAAK,IAAI,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,EAAC;QAClC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACrB,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,KAAK;QACH,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,GAAG,GAAG,EAAa,EAAE,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3.d.ts b/node_modules/@noble/hashes/esm/sha3.d.ts new file mode 100644 index 0000000..9df47b1 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3.d.ts @@ -0,0 +1,53 @@ +import { Hash, type CHash, type CHashXO, type HashXOF, type Input } from './utils.ts'; +/** `keccakf1600` internal function, additionally allows to adjust round count. */ +export declare function keccakP(s: Uint32Array, rounds?: number): void; +/** Keccak sponge function. */ +export declare class Keccak extends Hash implements HashXOF { + protected state: Uint8Array; + protected pos: number; + protected posOut: number; + protected finished: boolean; + protected state32: Uint32Array; + protected destroyed: boolean; + blockLen: number; + suffix: number; + outputLen: number; + protected enableXOF: boolean; + protected rounds: number; + constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number); + clone(): Keccak; + protected keccak(): void; + update(data: Input): this; + protected finish(): void; + protected writeInto(out: Uint8Array): Uint8Array; + xofInto(out: Uint8Array): Uint8Array; + xof(bytes: number): Uint8Array; + digestInto(out: Uint8Array): Uint8Array; + digest(): Uint8Array; + destroy(): void; + _cloneInto(to?: Keccak): Keccak; +} +/** SHA3-224 hash function. */ +export declare const sha3_224: CHash; +/** SHA3-256 hash function. Different from keccak-256. */ +export declare const sha3_256: CHash; +/** SHA3-384 hash function. */ +export declare const sha3_384: CHash; +/** SHA3-512 hash function. */ +export declare const sha3_512: CHash; +/** keccak-224 hash function. */ +export declare const keccak_224: CHash; +/** keccak-256 hash function. Different from SHA3-256. */ +export declare const keccak_256: CHash; +/** keccak-384 hash function. */ +export declare const keccak_384: CHash; +/** keccak-512 hash function. */ +export declare const keccak_512: CHash; +export type ShakeOpts = { + dkLen?: number; +}; +/** SHAKE128 XOF with 128-bit security. */ +export declare const shake128: CHashXO; +/** SHAKE256 XOF with 256-bit security. */ +export declare const shake256: CHashXO; +//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3.d.ts.map b/node_modules/@noble/hashes/esm/sha3.d.ts.map new file mode 100644 index 0000000..6024133 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../src/sha3.ts"],"names":[],"mappings":"AAaA,OAAO,EAE6B,IAAI,EAGtC,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EACnD,MAAM,YAAY,CAAC;AAoCpB,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAyCjE;AAED,8BAA8B;AAC9B,qBAAa,MAAO,SAAQ,IAAI,CAAC,MAAM,CAAE,YAAW,OAAO,CAAC,MAAM,CAAC;IACjE,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC;IAC5B,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC;IAC/B,SAAS,CAAC,SAAS,UAAS;IAErB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,SAAS,UAAS;IAC5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AC;AACxF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,EAAE,OAAgE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3.js b/node_modules/@noble/hashes/esm/sha3.js new file mode 100644 index 0000000..ed813d1 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3.js @@ -0,0 +1,234 @@ +/** + * SHA3 (keccak) hash function, based on a new "Sponge function" design. + * Different from older hashes, the internal state is bigger than output size. + * + * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), + * [Website](https://keccak.team/keccak.html), + * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). + * + * Check out `sha3-addons` module for cSHAKE, k12, and others. + * @module + */ +import { rotlBH, rotlBL, rotlSH, rotlSL, split } from "./_u64.js"; +// prettier-ignore +import { abytes, aexists, anumber, aoutput, clean, createHasher, createXOFer, Hash, swap32IfBE, toBytes, u32 } from "./utils.js"; +// No __PURE__ annotations in sha3 header: +// EVERYTHING is in fact used on every export. +// Various per round constants calculations +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const _7n = BigInt(7); +const _256n = BigInt(256); +const _0x71n = BigInt(0x71); +const SHA3_PI = []; +const SHA3_ROTL = []; +const _SHA3_IOTA = []; +for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { + // Pi + [x, y] = [y, (2 * x + 3 * y) % 5]; + SHA3_PI.push(2 * (5 * y + x)); + // Rotational + SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); + // Iota + let t = _0n; + for (let j = 0; j < 7; j++) { + R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; + if (R & _2n) + t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); + } + _SHA3_IOTA.push(t); +} +const IOTAS = split(_SHA3_IOTA, true); +const SHA3_IOTA_H = IOTAS[0]; +const SHA3_IOTA_L = IOTAS[1]; +// Left rotation (without 0, 32, 64) +const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); +const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); +/** `keccakf1600` internal function, additionally allows to adjust round count. */ +export function keccakP(s, rounds = 24) { + const B = new Uint32Array(5 * 2); + // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) + for (let round = 24 - rounds; round < 24; round++) { + // Theta θ + for (let x = 0; x < 10; x++) + B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; + for (let x = 0; x < 10; x += 2) { + const idx1 = (x + 8) % 10; + const idx0 = (x + 2) % 10; + const B0 = B[idx0]; + const B1 = B[idx0 + 1]; + const Th = rotlH(B0, B1, 1) ^ B[idx1]; + const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; + for (let y = 0; y < 50; y += 10) { + s[x + y] ^= Th; + s[x + y + 1] ^= Tl; + } + } + // Rho (ρ) and Pi (π) + let curH = s[2]; + let curL = s[3]; + for (let t = 0; t < 24; t++) { + const shift = SHA3_ROTL[t]; + const Th = rotlH(curH, curL, shift); + const Tl = rotlL(curH, curL, shift); + const PI = SHA3_PI[t]; + curH = s[PI]; + curL = s[PI + 1]; + s[PI] = Th; + s[PI + 1] = Tl; + } + // Chi (χ) + for (let y = 0; y < 50; y += 10) { + for (let x = 0; x < 10; x++) + B[x] = s[y + x]; + for (let x = 0; x < 10; x++) + s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; + } + // Iota (ι) + s[0] ^= SHA3_IOTA_H[round]; + s[1] ^= SHA3_IOTA_L[round]; + } + clean(B); +} +/** Keccak sponge function. */ +export class Keccak extends Hash { + // NOTE: we accept arguments in bytes instead of bits here. + constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { + super(); + this.pos = 0; + this.posOut = 0; + this.finished = false; + this.destroyed = false; + this.enableXOF = false; + this.blockLen = blockLen; + this.suffix = suffix; + this.outputLen = outputLen; + this.enableXOF = enableXOF; + this.rounds = rounds; + // Can be passed from user as dkLen + anumber(outputLen); + // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes + // 0 < blockLen < 200 + if (!(0 < blockLen && blockLen < 200)) + throw new Error('only keccak-f1600 function is supported'); + this.state = new Uint8Array(200); + this.state32 = u32(this.state); + } + clone() { + return this._cloneInto(); + } + keccak() { + swap32IfBE(this.state32); + keccakP(this.state32, this.rounds); + swap32IfBE(this.state32); + this.posOut = 0; + this.pos = 0; + } + update(data) { + aexists(this); + data = toBytes(data); + abytes(data); + const { blockLen, state } = this; + const len = data.length; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + for (let i = 0; i < take; i++) + state[this.pos++] ^= data[pos++]; + if (this.pos === blockLen) + this.keccak(); + } + return this; + } + finish() { + if (this.finished) + return; + this.finished = true; + const { state, suffix, pos, blockLen } = this; + // Do the padding + state[pos] ^= suffix; + if ((suffix & 0x80) !== 0 && pos === blockLen - 1) + this.keccak(); + state[blockLen - 1] ^= 0x80; + this.keccak(); + } + writeInto(out) { + aexists(this, false); + abytes(out); + this.finish(); + const bufferOut = this.state; + const { blockLen } = this; + for (let pos = 0, len = out.length; pos < len;) { + if (this.posOut >= blockLen) + this.keccak(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out) { + // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF + if (!this.enableXOF) + throw new Error('XOF is not possible for this instance'); + return this.writeInto(out); + } + xof(bytes) { + anumber(bytes); + return this.xofInto(new Uint8Array(bytes)); + } + digestInto(out) { + aoutput(out, this); + if (this.finished) + throw new Error('digest() was already called'); + this.writeInto(out); + this.destroy(); + return out; + } + digest() { + return this.digestInto(new Uint8Array(this.outputLen)); + } + destroy() { + this.destroyed = true; + clean(this.state); + } + _cloneInto(to) { + const { blockLen, suffix, outputLen, rounds, enableXOF } = this; + to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); + to.state32.set(this.state32); + to.pos = this.pos; + to.posOut = this.posOut; + to.finished = this.finished; + to.rounds = rounds; + // Suffix can change in cSHAKE + to.suffix = suffix; + to.outputLen = outputLen; + to.enableXOF = enableXOF; + to.destroyed = this.destroyed; + return to; + } +} +const gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen)); +/** SHA3-224 hash function. */ +export const sha3_224 = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))(); +/** SHA3-256 hash function. Different from keccak-256. */ +export const sha3_256 = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))(); +/** SHA3-384 hash function. */ +export const sha3_384 = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))(); +/** SHA3-512 hash function. */ +export const sha3_512 = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))(); +/** keccak-224 hash function. */ +export const keccak_224 = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))(); +/** keccak-256 hash function. Different from SHA3-256. */ +export const keccak_256 = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))(); +/** keccak-384 hash function. */ +export const keccak_384 = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))(); +/** keccak-512 hash function. */ +export const keccak_512 = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))(); +const genShake = (suffix, blockLen, outputLen) => createXOFer((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)); +/** SHAKE128 XOF with 128-bit security. */ +export const shake128 = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))(); +/** SHAKE256 XOF with 256-bit security. */ +export const shake256 = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))(); +//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha3.js.map b/node_modules/@noble/hashes/esm/sha3.js.map new file mode 100644 index 0000000..a0adf0e --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha3.js","sourceRoot":"","sources":["../src/sha3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClE,kBAAkB;AAClB,OAAO,EACL,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACjC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EACtC,UAAU,EACV,OAAO,EAAE,GAAG,EAEb,MAAM,YAAY,CAAC;AAEpB,0CAA0C;AAC1C,8CAA8C;AAC9C,2CAA2C;AAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,MAAM,OAAO,GAAa,EAAE,CAAC;AAC7B,MAAM,SAAS,GAAa,EAAE,CAAC;AAC/B,MAAM,UAAU,GAAa,EAAE,CAAC;AAChC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC;IAC/D,KAAK;IACL,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAA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e,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,0CAA0C;AAC1C,MAAM,CAAC,MAAM,QAAQ,GAAY,eAAe,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha512.d.ts b/node_modules/@noble/hashes/esm/sha512.d.ts new file mode 100644 index 0000000..46a27d0 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha512.d.ts @@ -0,0 +1,26 @@ +/** + * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. + * + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). + * @module + * @deprecated + */ +import { SHA384 as SHA384n, sha384 as sha384n, sha512_224 as sha512_224n, SHA512_224 as SHA512_224n, sha512_256 as sha512_256n, SHA512_256 as SHA512_256n, SHA512 as SHA512n, sha512 as sha512n } from './sha2.ts'; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA512: typeof SHA512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha512: typeof sha512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA384: typeof SHA384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha384: typeof sha384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA512_224: typeof SHA512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha512_224: typeof sha512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA512_256: typeof SHA512_256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha512_256: typeof sha512_256n; +//# sourceMappingURL=sha512.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha512.d.ts.map b/node_modules/@noble/hashes/esm/sha512.d.ts.map new file mode 100644 index 0000000..3886bc8 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha512.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha512.d.ts","sourceRoot":"","sources":["../src/sha512.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha512.js b/node_modules/@noble/hashes/esm/sha512.js new file mode 100644 index 0000000..d5f6910 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha512.js @@ -0,0 +1,26 @@ +/** + * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. + * + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). + * @module + * @deprecated + */ +import { SHA384 as SHA384n, sha384 as sha384n, sha512_224 as sha512_224n, SHA512_224 as SHA512_224n, sha512_256 as sha512_256n, SHA512_256 as SHA512_256n, SHA512 as SHA512n, sha512 as sha512n, } from "./sha2.js"; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA512 = SHA512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha512 = sha512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA384 = SHA384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha384 = sha384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA512_224 = SHA512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha512_224 = sha512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA512_256 = SHA512_256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha512_256 = sha512_256n; +//# sourceMappingURL=sha512.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/sha512.js.map b/node_modules/@noble/hashes/esm/sha512.js.map new file mode 100644 index 0000000..0371655 --- /dev/null +++ b/node_modules/@noble/hashes/esm/sha512.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha512.js","sourceRoot":"","sources":["../src/sha512.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,GAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAmB,OAAO,CAAC;AAC9C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC;AAC1D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC;AAC1D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC;AAC1D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,UAAU,GAAuB,WAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/utils.d.ts b/node_modules/@noble/hashes/esm/utils.d.ts new file mode 100644 index 0000000..90b8439 --- /dev/null +++ b/node_modules/@noble/hashes/esm/utils.d.ts @@ -0,0 +1,161 @@ +/** + * Utilities for hex, bytes, CSPRNG. + * @module + */ +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ +export declare function isBytes(a: unknown): a is Uint8Array; +/** Asserts something is positive integer. */ +export declare function anumber(n: number): void; +/** Asserts something is Uint8Array. */ +export declare function abytes(b: Uint8Array | undefined, ...lengths: number[]): void; +/** Asserts something is hash */ +export declare function ahash(h: IHash): void; +/** Asserts a hash instance has not been destroyed / finished */ +export declare function aexists(instance: any, checkFinished?: boolean): void; +/** Asserts output is properly-sized byte array */ +export declare function aoutput(out: any, instance: any): void; +/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ +export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; +/** Cast u8 / u16 / u32 to u8. */ +export declare function u8(arr: TypedArray): Uint8Array; +/** Cast u8 / u16 / u32 to u32. */ +export declare function u32(arr: TypedArray): Uint32Array; +/** Zeroize a byte array. Warning: JS provides no guarantees. */ +export declare function clean(...arrays: TypedArray[]): void; +/** Create DataView of an array for easy byte-level manipulation. */ +export declare function createView(arr: TypedArray): DataView; +/** The rotate right (circular right shift) operation for uint32 */ +export declare function rotr(word: number, shift: number): number; +/** The rotate left (circular left shift) operation for uint32 */ +export declare function rotl(word: number, shift: number): number; +/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ +export declare const isLE: boolean; +/** The byte swap operation for uint32 */ +export declare function byteSwap(word: number): number; +/** Conditionally byte swap if on a big-endian platform */ +export declare const swap8IfBE: (n: number) => number; +/** @deprecated */ +export declare const byteSwapIfBE: typeof swap8IfBE; +/** In place byte swap for Uint32Array */ +export declare function byteSwap32(arr: Uint32Array): Uint32Array; +export declare const swap32IfBE: (u: Uint32Array) => Uint32Array; +/** + * Convert byte array to hex string. Uses built-in function, when available. + * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' + */ +export declare function bytesToHex(bytes: Uint8Array): string; +/** + * Convert hex string to byte array. Uses built-in function, when available. + * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) + */ +export declare function hexToBytes(hex: string): Uint8Array; +/** + * There is no setImmediate in browser and setTimeout is slow. + * Call of async fn will return Promise, which will be fullfiled only on + * next scheduler queue processing step and this is exactly what we need. + */ +export declare const nextTick: () => Promise; +/** Returns control to thread each 'tick' ms to avoid blocking. */ +export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void): Promise; +/** + * Converts string to bytes using UTF8 encoding. + * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) + */ +export declare function utf8ToBytes(str: string): Uint8Array; +/** + * Converts bytes to string using UTF8 encoding. + * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' + */ +export declare function bytesToUtf8(bytes: Uint8Array): string; +/** Accepted input of hash functions. Strings are converted to byte arrays. */ +export type Input = string | Uint8Array; +/** + * Normalizes (non-hex) string or Uint8Array to Uint8Array. + * Warning: when Uint8Array is passed, it would NOT get copied. + * Keep in mind for future mutable operations. + */ +export declare function toBytes(data: Input): Uint8Array; +/** KDFs can accept string or Uint8Array for user convenience. */ +export type KDFInput = string | Uint8Array; +/** + * Helper for KDFs: consumes uint8array or string. + * When string is passed, does utf8 decoding, using TextDecoder. + */ +export declare function kdfInputToBytes(data: KDFInput): Uint8Array; +/** Copies several Uint8Arrays into one. */ +export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; +type EmptyObj = {}; +export declare function checkOpts(defaults: T1, opts?: T2): T1 & T2; +/** Hash interface. */ +export type IHash = { + (data: Uint8Array): Uint8Array; + blockLen: number; + outputLen: number; + create: any; +}; +/** For runtime check if class implements interface */ +export declare abstract class Hash> { + abstract blockLen: number; + abstract outputLen: number; + abstract update(buf: Input): this; + abstract digestInto(buf: Uint8Array): void; + abstract digest(): Uint8Array; + /** + * Resets internal state. Makes Hash instance unusable. + * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed + * by user, they will need to manually call `destroy()` when zeroing is necessary. + */ + abstract destroy(): void; + /** + * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` + * when no options are passed. + * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal + * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. + * There are no guarantees for clean-up because it's impossible in JS. + */ + abstract _cloneInto(to?: T): T; + abstract clone(): T; +} +/** + * XOF: streaming API to read digest in chunks. + * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. + * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot + * destroy state, next call can require more bytes. + */ +export type HashXOF> = Hash & { + xof(bytes: number): Uint8Array; + xofInto(buf: Uint8Array): Uint8Array; +}; +/** Hash function */ +export type CHash = ReturnType; +/** Hash function with output */ +export type CHashO = ReturnType; +/** XOF with output */ +export type CHashXO = ReturnType; +/** Wraps hash function, creating an interface on top of it */ +export declare function createHasher>(hashCons: () => Hash): { + (msg: Input): Uint8Array; + outputLen: number; + blockLen: number; + create(): Hash; +}; +export declare function createOptHasher, T extends Object>(hashCons: (opts?: T) => Hash): { + (msg: Input, opts?: T): Uint8Array; + outputLen: number; + blockLen: number; + create(opts?: T): Hash; +}; +export declare function createXOFer, T extends Object>(hashCons: (opts?: T) => HashXOF): { + (msg: Input, opts?: T): Uint8Array; + outputLen: number; + blockLen: number; + create(opts?: T): HashXOF; +}; +export declare const wrapConstructor: typeof createHasher; +export declare const wrapConstructorWithOpts: typeof createOptHasher; +export declare const wrapXOFConstructorWithOpts: typeof createXOFer; +/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ +export declare function randomBytes(bytesLength?: number): Uint8Array; +export {}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/utils.d.ts.map b/node_modules/@noble/hashes/esm/utils.d.ts.map new file mode 100644 index 0000000..8ab6570 --- /dev/null +++ b/node_modules/@noble/hashes/esm/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AAUtE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAI5E;AAED,gCAAgC;AAChC,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAKpC;AAED,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,UAAO,GAAG,IAAI,CAGjE;AAED,kDAAkD;AAClD,wBA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CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;CACnB,CAOA;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EACjE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAC9B;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;CAC3B,CAOA;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAChE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACjC;IACD,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9B,CAOA;AACD,eAAO,MAAM,eAAe,EAAE,OAAO,YAA2B,CAAC;AACjE,eAAO,MAAM,uBAAuB,EAAE,OAAO,eAAiC,CAAC;AAC/E,eAAO,MAAM,0BAA0B,EAAE,OAAO,WAAyB,CAAC;AAE1E,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,WAAW,SAAK,GAAG,UAAU,CASxD"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/utils.js b/node_modules/@noble/hashes/esm/utils.js new file mode 100644 index 0000000..9614c8e --- /dev/null +++ b/node_modules/@noble/hashes/esm/utils.js @@ -0,0 +1,281 @@ +/** + * Utilities for hex, bytes, CSPRNG. + * @module + */ +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. +// node.js versions earlier than v19 don't declare it in global scope. +// For node.js, package.json#exports field mapping rewrites import +// from `crypto` to `cryptoNode`, which imports native module. +// Makes the utils un-importable in browsers without a bundler. +// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. +import { crypto } from '@noble/hashes/crypto'; +/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ +export function isBytes(a) { + return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); +} +/** Asserts something is positive integer. */ +export function anumber(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error('positive integer expected, got ' + n); +} +/** Asserts something is Uint8Array. */ +export function abytes(b, ...lengths) { + if (!isBytes(b)) + throw new Error('Uint8Array expected'); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); +} +/** Asserts something is hash */ +export function ahash(h) { + if (typeof h !== 'function' || typeof h.create !== 'function') + throw new Error('Hash should be wrapped by utils.createHasher'); + anumber(h.outputLen); + anumber(h.blockLen); +} +/** Asserts a hash instance has not been destroyed / finished */ +export function aexists(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error('Hash instance has been destroyed'); + if (checkFinished && instance.finished) + throw new Error('Hash#digest() has already been called'); +} +/** Asserts output is properly-sized byte array */ +export function aoutput(out, instance) { + abytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error('digestInto() expects output buffer of length at least ' + min); + } +} +/** Cast u8 / u16 / u32 to u8. */ +export function u8(arr) { + return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); +} +/** Cast u8 / u16 / u32 to u32. */ +export function u32(arr) { + return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +} +/** Zeroize a byte array. Warning: JS provides no guarantees. */ +export function clean(...arrays) { + for (let i = 0; i < arrays.length; i++) { + arrays[i].fill(0); + } +} +/** Create DataView of an array for easy byte-level manipulation. */ +export function createView(arr) { + return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +} +/** The rotate right (circular right shift) operation for uint32 */ +export function rotr(word, shift) { + return (word << (32 - shift)) | (word >>> shift); +} +/** The rotate left (circular left shift) operation for uint32 */ +export function rotl(word, shift) { + return (word << shift) | ((word >>> (32 - shift)) >>> 0); +} +/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ +export const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); +/** The byte swap operation for uint32 */ +export function byteSwap(word) { + return (((word << 24) & 0xff000000) | + ((word << 8) & 0xff0000) | + ((word >>> 8) & 0xff00) | + ((word >>> 24) & 0xff)); +} +/** Conditionally byte swap if on a big-endian platform */ +export const swap8IfBE = isLE + ? (n) => n + : (n) => byteSwap(n); +/** @deprecated */ +export const byteSwapIfBE = swap8IfBE; +/** In place byte swap for Uint32Array */ +export function byteSwap32(arr) { + for (let i = 0; i < arr.length; i++) { + arr[i] = byteSwap(arr[i]); + } + return arr; +} +export const swap32IfBE = isLE + ? (u) => u + : byteSwap32; +// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex +const hasHexBuiltin = /* @__PURE__ */ (() => +// @ts-ignore +typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); +// Array where index 0xf0 (240) is mapped to string 'f0' +const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); +/** + * Convert byte array to hex string. Uses built-in function, when available. + * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' + */ +export function bytesToHex(bytes) { + abytes(bytes); + // @ts-ignore + if (hasHexBuiltin) + return bytes.toHex(); + // pre-caching improves the speed 6x + let hex = ''; + for (let i = 0; i < bytes.length; i++) { + hex += hexes[bytes[i]]; + } + return hex; +} +// We use optimized technique to convert hex string to byte array +const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; +function asciiToBase16(ch) { + if (ch >= asciis._0 && ch <= asciis._9) + return ch - asciis._0; // '2' => 50-48 + if (ch >= asciis.A && ch <= asciis.F) + return ch - (asciis.A - 10); // 'B' => 66-(65-10) + if (ch >= asciis.a && ch <= asciis.f) + return ch - (asciis.a - 10); // 'b' => 98-(97-10) + return; +} +/** + * Convert hex string to byte array. Uses built-in function, when available. + * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) + */ +export function hexToBytes(hex) { + if (typeof hex !== 'string') + throw new Error('hex string expected, got ' + typeof hex); + // @ts-ignore + if (hasHexBuiltin) + return Uint8Array.fromHex(hex); + const hl = hex.length; + const al = hl / 2; + if (hl % 2) + throw new Error('hex string expected, got unpadded hex of length ' + hl); + const array = new Uint8Array(al); + for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { + const n1 = asciiToBase16(hex.charCodeAt(hi)); + const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); + if (n1 === undefined || n2 === undefined) { + const char = hex[hi] + hex[hi + 1]; + throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); + } + array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 + } + return array; +} +/** + * There is no setImmediate in browser and setTimeout is slow. + * Call of async fn will return Promise, which will be fullfiled only on + * next scheduler queue processing step and this is exactly what we need. + */ +export const nextTick = async () => { }; +/** Returns control to thread each 'tick' ms to avoid blocking. */ +export async function asyncLoop(iters, tick, cb) { + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) + continue; + await nextTick(); + ts += diff; + } +} +/** + * Converts string to bytes using UTF8 encoding. + * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) + */ +export function utf8ToBytes(str) { + if (typeof str !== 'string') + throw new Error('string expected'); + return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 +} +/** + * Converts bytes to string using UTF8 encoding. + * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' + */ +export function bytesToUtf8(bytes) { + return new TextDecoder().decode(bytes); +} +/** + * Normalizes (non-hex) string or Uint8Array to Uint8Array. + * Warning: when Uint8Array is passed, it would NOT get copied. + * Keep in mind for future mutable operations. + */ +export function toBytes(data) { + if (typeof data === 'string') + data = utf8ToBytes(data); + abytes(data); + return data; +} +/** + * Helper for KDFs: consumes uint8array or string. + * When string is passed, does utf8 decoding, using TextDecoder. + */ +export function kdfInputToBytes(data) { + if (typeof data === 'string') + data = utf8ToBytes(data); + abytes(data); + return data; +} +/** Copies several Uint8Arrays into one. */ +export function concatBytes(...arrays) { + let sum = 0; + for (let i = 0; i < arrays.length; i++) { + const a = arrays[i]; + abytes(a); + sum += a.length; + } + const res = new Uint8Array(sum); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const a = arrays[i]; + res.set(a, pad); + pad += a.length; + } + return res; +} +export function checkOpts(defaults, opts) { + if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') + throw new Error('options should be object or undefined'); + const merged = Object.assign(defaults, opts); + return merged; +} +/** For runtime check if class implements interface */ +export class Hash { +} +/** Wraps hash function, creating an interface on top of it */ +export function createHasher(hashCons) { + const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); + const tmp = hashCons(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashCons(); + return hashC; +} +export function createOptHasher(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} +export function createXOFer(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} +export const wrapConstructor = createHasher; +export const wrapConstructorWithOpts = createOptHasher; +export const wrapXOFConstructorWithOpts = createXOFer; +/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ +export function randomBytes(bytesLength = 32) { + if (crypto && typeof crypto.getRandomValues === 'function') { + return crypto.getRandomValues(new Uint8Array(bytesLength)); + } + // Legacy Node.js compatibility + if (crypto && typeof crypto.randomBytes === 'function') { + return Uint8Array.from(crypto.randomBytes(bytesLength)); + } + throw new Error('crypto.getRandomValues must be defined'); +} +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/esm/utils.js.map b/node_modules/@noble/hashes/esm/utils.js.map new file mode 100644 index 0000000..8a068c0 --- /dev/null +++ b/node_modules/@noble/hashes/esm/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AAEtE,oFAAoF;AACpF,sEAAsE;AACtE,kEAAkE;AAClE,8DAA8D;AAC9D,+DAA+D;AAC/D,2EAA2E;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,qFAAqF;AACrF,MAAM,UAAU,OAAO,CAAC,CAAU;IAChC,OAAO,CAAC,YAAY,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AACnG,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM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.d.ts b/node_modules/@noble/hashes/hkdf.d.ts new file mode 100644 index 0000000..c54c4ab --- /dev/null +++ b/node_modules/@noble/hashes/hkdf.d.ts @@ -0,0 +1,36 @@ +import { type CHash, type Input } from './utils.ts'; +/** + * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` + * Arguments position differs from spec (IKM is first one, since it is not optional) + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + */ +export declare function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array; +/** + * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` + * @param hash - hash function that would be used (e.g. sha256) + * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + */ +export declare function expand(hash: CHash, prk: Input, info?: Input, length?: number): Uint8Array; +/** + * HKDF (RFC 5869): derive keys from an initial input. + * Combines hkdf_extract + hkdf_expand in one step + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + * @example + * import { hkdf } from '@noble/hashes/hkdf'; + * import { sha256 } from '@noble/hashes/sha2'; + * import { randomBytes } from '@noble/hashes/utils'; + * const inputKey = randomBytes(32); + * const salt = randomBytes(32); + * const info = 'application-key'; + * const hk1 = hkdf(sha256, inputKey, salt, info, 32); + */ +export declare const hkdf: (hash: CHash, ikm: Input, salt: Input | undefined, info: Input | undefined, length: number) => Uint8Array; +//# sourceMappingURL=hkdf.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/hkdf.d.ts.map b/node_modules/@noble/hashes/hkdf.d.ts.map new file mode 100644 index 0000000..76b0ebb --- /dev/null +++ b/node_modules/@noble/hashes/hkdf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hkdf.d.ts","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkB,KAAK,KAAK,EAAS,KAAK,KAAK,EAAW,MAAM,YAAY,CAAC;AAEpF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,UAAU,CAOzE;AAKD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAE,MAAW,GAAG,UAAU,CA4B7F;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,KAAK,EACX,KAAK,KAAK,EACV,MAAM,KAAK,GAAG,SAAS,EACvB,MAAM,KAAK,GAAG,SAAS,EACvB,QAAQ,MAAM,KACb,UAAkE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/hkdf.js b/node_modules/@noble/hashes/hkdf.js new file mode 100644 index 0000000..aca1674 --- /dev/null +++ b/node_modules/@noble/hashes/hkdf.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hkdf = void 0; +exports.extract = extract; +exports.expand = expand; +/** + * HKDF (RFC 5869): extract + expand in one step. + * See https://soatok.blog/2021/11/17/understanding-hkdf/. + * @module + */ +const hmac_ts_1 = require("./hmac.js"); +const utils_ts_1 = require("./utils.js"); +/** + * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` + * Arguments position differs from spec (IKM is first one, since it is not optional) + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + */ +function extract(hash, ikm, salt) { + (0, utils_ts_1.ahash)(hash); + // NOTE: some libraries treat zero-length array as 'not provided'; + // we don't, since we have undefined as 'not provided' + // https://github.com/RustCrypto/KDFs/issues/15 + if (salt === undefined) + salt = new Uint8Array(hash.outputLen); + return (0, hmac_ts_1.hmac)(hash, (0, utils_ts_1.toBytes)(salt), (0, utils_ts_1.toBytes)(ikm)); +} +const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]); +const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); +/** + * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` + * @param hash - hash function that would be used (e.g. sha256) + * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + */ +function expand(hash, prk, info, length = 32) { + (0, utils_ts_1.ahash)(hash); + (0, utils_ts_1.anumber)(length); + const olen = hash.outputLen; + if (length > 255 * olen) + throw new Error('Length should be <= 255*HashLen'); + const blocks = Math.ceil(length / olen); + if (info === undefined) + info = EMPTY_BUFFER; + // first L(ength) octets of T + const okm = new Uint8Array(blocks * olen); + // Re-use HMAC instance between blocks + const HMAC = hmac_ts_1.hmac.create(hash, prk); + const HMACTmp = HMAC._cloneInto(); + const T = new Uint8Array(HMAC.outputLen); + for (let counter = 0; counter < blocks; counter++) { + HKDF_COUNTER[0] = counter + 1; + // T(0) = empty string (zero length) + // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) + HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) + .update(info) + .update(HKDF_COUNTER) + .digestInto(T); + okm.set(T, olen * counter); + HMAC._cloneInto(HMACTmp); + } + HMAC.destroy(); + HMACTmp.destroy(); + (0, utils_ts_1.clean)(T, HKDF_COUNTER); + return okm.slice(0, length); +} +/** + * HKDF (RFC 5869): derive keys from an initial input. + * Combines hkdf_extract + hkdf_expand in one step + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + * @example + * import { hkdf } from '@noble/hashes/hkdf'; + * import { sha256 } from '@noble/hashes/sha2'; + * import { randomBytes } from '@noble/hashes/utils'; + * const inputKey = randomBytes(32); + * const salt = randomBytes(32); + * const info = 'application-key'; + * const hk1 = hkdf(sha256, inputKey, salt, info, 32); + */ +const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length); +exports.hkdf = hkdf; +//# sourceMappingURL=hkdf.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/hkdf.js.map b/node_modules/@noble/hashes/hkdf.js.map new file mode 100644 index 0000000..3d6d405 --- /dev/null +++ b/node_modules/@noble/hashes/hkdf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":";;;AAeA,0BAOC;AAYD,wBA4BC;AA9DD;;;;GAIG;AACH,uCAAiC;AACjC,yCAAoF;AAEpF;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY;IAC3D,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,kEAAkE;IAClE,sDAAsD;IACtD,+CAA+C;IAC/C,IAAI,IAAI,KAAK,SAAS;QAAE,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9D,OAAO,IAAA,cAAI,EAAC,IAAI,EAAE,IAAA,kBAAO,EAAC,IAAI,CAAC,EAAE,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AAErD;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY,EAAE,SAAiB,EAAE;IAC/E,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,IAAA,kBAAO,EAAC,MAAM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,CAAC,CAAC;IACvB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,IAAI,GAAG,CAClB,IAAW,EACX,GAAU,EACV,IAAuB,EACvB,IAAuB,EACvB,MAAc,EACF,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AANzD,QAAA,IAAI,QAMqD"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/hmac.d.ts b/node_modules/@noble/hashes/hmac.d.ts new file mode 100644 index 0000000..86525f9 --- /dev/null +++ b/node_modules/@noble/hashes/hmac.d.ts @@ -0,0 +1,35 @@ +/** + * HMAC: RFC2104 message authentication code. + * @module + */ +import { Hash, type CHash, type Input } from './utils.ts'; +export declare class HMAC> extends Hash> { + oHash: T; + iHash: T; + blockLen: number; + outputLen: number; + private finished; + private destroyed; + constructor(hash: CHash, _key: Input); + update(buf: Input): this; + digestInto(out: Uint8Array): void; + digest(): Uint8Array; + _cloneInto(to?: HMAC): HMAC; + clone(): HMAC; + destroy(): void; +} +/** + * HMAC: RFC2104 message authentication code. + * @param hash - function that would be used e.g. sha256 + * @param key - message key + * @param message - message data + * @example + * import { hmac } from '@noble/hashes/hmac'; + * import { sha256 } from '@noble/hashes/sha2'; + * const mac1 = hmac(sha256, 'key', 'message'); + */ +export declare const hmac: { + (hash: CHash, key: Input, message: Input): Uint8Array; + create(hash: CHash, key: Input): HMAC; +}; +//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/hmac.d.ts.map b/node_modules/@noble/hashes/hmac.d.ts.map new file mode 100644 index 0000000..5a7f0f3 --- /dev/null +++ b/node_modules/@noble/hashes/hmac.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAiC,IAAI,EAAW,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAElG,qBAAa,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK;IAsBpC,MAAM,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;IAKxB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI;IASjC,MAAM,IAAI,UAAU;IAKpB,UAAU,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAajC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;IAGhB,OAAO,IAAI,IAAI;CAKhB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,GAAG,UAAU,CAAC;IACtD,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;CAEM,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/hmac.js b/node_modules/@noble/hashes/hmac.js new file mode 100644 index 0000000..060cf57 --- /dev/null +++ b/node_modules/@noble/hashes/hmac.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hmac = exports.HMAC = void 0; +/** + * HMAC: RFC2104 message authentication code. + * @module + */ +const utils_ts_1 = require("./utils.js"); +class HMAC extends utils_ts_1.Hash { + constructor(hash, _key) { + super(); + this.finished = false; + this.destroyed = false; + (0, utils_ts_1.ahash)(hash); + const key = (0, utils_ts_1.toBytes)(_key); + this.iHash = hash.create(); + if (typeof this.iHash.update !== 'function') + throw new Error('Expected instance of class which extends utils.Hash'); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + // blockLen can be bigger than outputLen + pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36; + this.iHash.update(pad); + // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone + this.oHash = hash.create(); + // Undo internal XOR && apply outer XOR + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36 ^ 0x5c; + this.oHash.update(pad); + (0, utils_ts_1.clean)(pad); + } + update(buf) { + (0, utils_ts_1.aexists)(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + (0, utils_ts_1.aexists)(this); + (0, utils_ts_1.abytes)(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + // Create new instance without calling constructor since key already in state and we don't know it. + to || (to = Object.create(Object.getPrototypeOf(this), {})); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + clone() { + return this._cloneInto(); + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } +} +exports.HMAC = HMAC; +/** + * HMAC: RFC2104 message authentication code. + * @param hash - function that would be used e.g. sha256 + * @param key - message key + * @param message - message data + * @example + * import { hmac } from '@noble/hashes/hmac'; + * import { sha256 } from '@noble/hashes/sha2'; + * const mac1 = hmac(sha256, 'key', 'message'); + */ +const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); +exports.hmac = hmac; +exports.hmac.create = (hash, key) => new HMAC(hash, key); +//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/hmac.js.map b/node_modules/@noble/hashes/hmac.js.map new file mode 100644 index 0000000..b99d61a --- /dev/null +++ b/node_modules/@noble/hashes/hmac.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hmac.js","sourceRoot":"","sources":["src/hmac.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,yCAAkG;AAElG,MAAa,IAAwB,SAAQ,eAAa;IAQxD,YAAY,IAAW,EAAE,IAAW;QAClC,KAAK,EAAE,CAAC;QAJF,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QAIxB,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;QACZ,MAAM,GAAG,GAAG,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,EAAO,CAAC;QAChC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,UAAU;YACzC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrC,wCAAwC;QACxC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAA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OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;AAJvC,QAAA,IAAI,QAImC;AACpD,YAAI,CAAC,MAAM,GAAG,CAAC,IAAW,EAAE,GAAU,EAAE,EAAE,CAAC,IAAI,IAAI,CAAM,IAAI,EAAE,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/index.d.ts b/node_modules/@noble/hashes/index.d.ts new file mode 100644 index 0000000..f36479a --- /dev/null +++ b/node_modules/@noble/hashes/index.d.ts @@ -0,0 +1 @@ +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/index.d.ts.map b/node_modules/@noble/hashes/index.d.ts.map new file mode 100644 index 0000000..4e8c581 --- /dev/null +++ b/node_modules/@noble/hashes/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@noble/hashes/index.js b/node_modules/@noble/hashes/index.js new file mode 100644 index 0000000..b6a9fe7 --- /dev/null +++ b/node_modules/@noble/hashes/index.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. + * @module + * @example +```js +import { + sha256, sha384, sha512, sha224, sha512_224, sha512_256 +} from '@noble/hashes/sha2'; +import { + sha3_224, sha3_256, sha3_384, sha3_512, + keccak_224, keccak_256, keccak_384, keccak_512, + shake128, shake256 +} from '@noble/hashes/sha3'; +import { + cshake128, cshake256, + turboshake128, turboshake256, + kmac128, kmac256, + tuplehash256, parallelhash256, + k12, m14, keccakprg +} from '@noble/hashes/sha3-addons'; +import { blake3 } from '@noble/hashes/blake3'; +import { blake2b, blake2s } from '@noble/hashes/blake2'; +import { hmac } from '@noble/hashes/hmac'; +import { hkdf } from '@noble/hashes/hkdf'; +import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; +import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; +import { md5, ripemd160, sha1 } from '@noble/hashes/legacy'; +import * as utils from '@noble/hashes/utils'; +``` + */ +throw new Error('root module cannot be imported: import submodules instead. Check out README'); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/index.js.map b/node_modules/@noble/hashes/index.js.map new file mode 100644 index 0000000..1759fc6 --- /dev/null +++ b/node_modules/@noble/hashes/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/legacy.d.ts b/node_modules/@noble/hashes/legacy.d.ts new file mode 100644 index 0000000..39c2632 --- /dev/null +++ b/node_modules/@noble/hashes/legacy.d.ts @@ -0,0 +1,71 @@ +/** + +SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 + * @module + */ +import { HashMD } from './_md.ts'; +import { type CHash } from './utils.ts'; +/** SHA1 legacy hash class. */ +export declare class SHA1 extends HashMD { + private A; + private B; + private C; + private D; + private E; + constructor(); + protected get(): [number, number, number, number, number]; + protected set(A: number, B: number, C: number, D: number, E: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ +export declare const sha1: CHash; +/** MD5 legacy hash class. */ +export declare class MD5 extends HashMD { + private A; + private B; + private C; + private D; + constructor(); + protected get(): [number, number, number, number]; + protected set(A: number, B: number, C: number, D: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +/** + * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. + * MD5 architecture is similar to SHA1, with some differences: + * - Reduced output length: 16 bytes (128 bit) instead of 20 + * - 64 rounds, instead of 80 + * - Little-endian: could be faster, but will require more code + * - Non-linear index selection: huge speed-up for unroll + * - Per round constants: more memory accesses, additional speed-up for unroll + */ +export declare const md5: CHash; +export declare class RIPEMD160 extends HashMD { + private h0; + private h1; + private h2; + private h3; + private h4; + constructor(); + protected get(): [number, number, number, number, number]; + protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +/** + * RIPEMD-160 - a legacy hash function from 1990s. + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + */ +export declare const ripemd160: CHash; +//# sourceMappingURL=legacy.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/legacy.d.ts.map b/node_modules/@noble/hashes/legacy.d.ts.map new file mode 100644 index 0000000..0401f78 --- /dev/null +++ b/node_modules/@noble/hashes/legacy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["src/legacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAO,MAAM,EAAO,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAUnE,8BAA8B;AAC9B,qBAAa,IAAK,SAAQ,MAAM,CAAC,IAAI,CAAC;IACpC,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;IAC3B,OAAO,CAAC,CAAC,CAAkB;;IAK3B,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,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kB;;IAK5B,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAIzD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAO/E,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAmCvD,SAAS,CAAC,UAAU,IAAI,IAAI;IAG5B,OAAO,IAAI,IAAI;CAKhB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAA2D,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/legacy.js b/node_modules/@noble/hashes/legacy.js new file mode 100644 index 0000000..2f8f9c6 --- /dev/null +++ b/node_modules/@noble/hashes/legacy.js @@ -0,0 +1,287 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ripemd160 = exports.RIPEMD160 = exports.md5 = exports.MD5 = exports.sha1 = exports.SHA1 = void 0; +/** + +SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 + * @module + */ +const _md_ts_1 = require("./_md.js"); +const utils_ts_1 = require("./utils.js"); +/** Initial SHA1 state */ +const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ + 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, +]); +// Reusable temporary buffer +const SHA1_W = /* @__PURE__ */ new Uint32Array(80); +/** SHA1 legacy hash class. */ +class SHA1 extends _md_ts_1.HashMD { + constructor() { + super(64, 20, 8, false); + this.A = SHA1_IV[0] | 0; + this.B = SHA1_IV[1] | 0; + this.C = SHA1_IV[2] | 0; + this.D = SHA1_IV[3] | 0; + this.E = SHA1_IV[4] | 0; + } + get() { + const { A, B, C, D, E } = this; + return [A, B, C, D, E]; + } + set(A, B, C, D, E) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + SHA1_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 80; i++) + SHA1_W[i] = (0, utils_ts_1.rotl)(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); + // Compression function main loop, 80 rounds + let { A, B, C, D, E } = this; + for (let i = 0; i < 80; i++) { + let F, K; + if (i < 20) { + F = (0, _md_ts_1.Chi)(B, C, D); + K = 0x5a827999; + } + else if (i < 40) { + F = B ^ C ^ D; + K = 0x6ed9eba1; + } + else if (i < 60) { + F = (0, _md_ts_1.Maj)(B, C, D); + K = 0x8f1bbcdc; + } + else { + F = B ^ C ^ D; + K = 0xca62c1d6; + } + const T = ((0, utils_ts_1.rotl)(A, 5) + F + E + K + SHA1_W[i]) | 0; + E = D; + D = C; + C = (0, utils_ts_1.rotl)(B, 30); + B = A; + A = T; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + this.set(A, B, C, D, E); + } + roundClean() { + (0, utils_ts_1.clean)(SHA1_W); + } + destroy() { + this.set(0, 0, 0, 0, 0); + (0, utils_ts_1.clean)(this.buffer); + } +} +exports.SHA1 = SHA1; +/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ +exports.sha1 = (0, utils_ts_1.createHasher)(() => new SHA1()); +/** Per-round constants */ +const p32 = /* @__PURE__ */ Math.pow(2, 32); +const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1)))); +/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ +const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); +// Reusable temporary buffer +const MD5_W = /* @__PURE__ */ new Uint32Array(16); +/** MD5 legacy hash class. */ +class MD5 extends _md_ts_1.HashMD { + constructor() { + super(64, 16, 8, true); + this.A = MD5_IV[0] | 0; + this.B = MD5_IV[1] | 0; + this.C = MD5_IV[2] | 0; + this.D = MD5_IV[3] | 0; + } + get() { + const { A, B, C, D } = this; + return [A, B, C, D]; + } + set(A, B, C, D) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + MD5_W[i] = view.getUint32(offset, true); + // Compression function main loop, 64 rounds + let { A, B, C, D } = this; + for (let i = 0; i < 64; i++) { + let F, g, s; + if (i < 16) { + F = (0, _md_ts_1.Chi)(B, C, D); + g = i; + s = [7, 12, 17, 22]; + } + else if (i < 32) { + F = (0, _md_ts_1.Chi)(D, B, C); + g = (5 * i + 1) % 16; + s = [5, 9, 14, 20]; + } + else if (i < 48) { + F = B ^ C ^ D; + g = (3 * i + 5) % 16; + s = [4, 11, 16, 23]; + } + else { + F = C ^ (B | ~D); + g = (7 * i) % 16; + s = [6, 10, 15, 21]; + } + F = F + A + K[i] + MD5_W[g]; + A = D; + D = C; + C = B; + B = B + (0, utils_ts_1.rotl)(F, s[i % 4]); + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + this.set(A, B, C, D); + } + roundClean() { + (0, utils_ts_1.clean)(MD5_W); + } + destroy() { + this.set(0, 0, 0, 0); + (0, utils_ts_1.clean)(this.buffer); + } +} +exports.MD5 = MD5; +/** + * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. + * MD5 architecture is similar to SHA1, with some differences: + * - Reduced output length: 16 bytes (128 bit) instead of 20 + * - 64 rounds, instead of 80 + * - Little-endian: could be faster, but will require more code + * - Non-linear index selection: huge speed-up for unroll + * - Per round constants: more memory accesses, additional speed-up for unroll + */ +exports.md5 = (0, utils_ts_1.createHasher)(() => new MD5()); +// RIPEMD-160 +const Rho160 = /* @__PURE__ */ Uint8Array.from([ + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, +]); +const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); +const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); +const idxLR = /* @__PURE__ */ (() => { + const L = [Id160]; + const R = [Pi160]; + const res = [L, R]; + for (let i = 0; i < 4; i++) + for (let j of res) + j.push(j[i].map((k) => Rho160[k])); + return res; +})(); +const idxL = /* @__PURE__ */ (() => idxLR[0])(); +const idxR = /* @__PURE__ */ (() => idxLR[1])(); +// const [idxL, idxR] = idxLR; +const shifts160 = /* @__PURE__ */ [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], +].map((i) => Uint8Array.from(i)); +const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); +const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); +const Kl160 = /* @__PURE__ */ Uint32Array.from([ + 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, +]); +const Kr160 = /* @__PURE__ */ Uint32Array.from([ + 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, +]); +// It's called f() in spec. +function ripemd_f(group, x, y, z) { + if (group === 0) + return x ^ y ^ z; + if (group === 1) + return (x & y) | (~x & z); + if (group === 2) + return (x | ~y) ^ z; + if (group === 3) + return (x & z) | (y & ~z); + return x ^ (y | ~z); +} +// Reusable temporary buffer +const BUF_160 = /* @__PURE__ */ new Uint32Array(16); +class RIPEMD160 extends _md_ts_1.HashMD { + constructor() { + super(64, 20, 8, true); + this.h0 = 0x67452301 | 0; + this.h1 = 0xefcdab89 | 0; + this.h2 = 0x98badcfe | 0; + this.h3 = 0x10325476 | 0; + this.h4 = 0xc3d2e1f0 | 0; + } + get() { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + set(h0, h1, h2, h3, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + BUF_160[i] = view.getUint32(offset, true); + // prettier-ignore + let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; + // Instead of iterating 0 to 80, we split it into 5 groups + // And use the groups in constants, functions, etc. Much simpler + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore + const rl = idxL[group], rr = idxR[group]; // prettier-ignore + const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore + for (let i = 0; i < 16; i++) { + const tl = ((0, utils_ts_1.rotl)(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; + al = el, el = dl, dl = (0, utils_ts_1.rotl)(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore + } + // 2 loops are 10% faster + for (let i = 0; i < 16; i++) { + const tr = ((0, utils_ts_1.rotl)(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; + ar = er, er = dr, dr = (0, utils_ts_1.rotl)(cr, 10) | 0, cr = br, br = tr; // prettier-ignore + } + } + // Add the compressed chunk to the current hash value + this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); + } + roundClean() { + (0, utils_ts_1.clean)(BUF_160); + } + destroy() { + this.destroyed = true; + (0, utils_ts_1.clean)(this.buffer); + this.set(0, 0, 0, 0, 0); + } +} +exports.RIPEMD160 = RIPEMD160; +/** + * RIPEMD-160 - a legacy hash function from 1990s. + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + */ +exports.ripemd160 = (0, utils_ts_1.createHasher)(() => new RIPEMD160()); +//# sourceMappingURL=legacy.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/legacy.js.map b/node_modules/@noble/hashes/legacy.js.map new file mode 100644 index 0000000..f1c3a81 --- /dev/null +++ b/node_modules/@noble/hashes/legacy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"legacy.js","sourceRoot":"","sources":["src/legacy.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,qCAA4C;AAC5C,yCAAmE;AAEnE,yBAAyB;AACzB,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC3D,CAAC,CAAC;AAEH,4BAA4B;AAC5B,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;AAEnD,8BAA8B;AAC9B,MAAa,IAAK,SAAQ,eAAY;IAOpC;QACE,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;Q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,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EACvB,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CACxB,CAAC;IACJ,CAAC;IACS,UAAU;QAClB,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IACD,OAAO;QACL,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAA,gBAAK,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAhED,8BAgEC;AAED;;;;GAIG;AACU,QAAA,SAAS,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/package.json b/node_modules/@noble/hashes/package.json new file mode 100644 index 0000000..4d2fc73 --- /dev/null +++ b/node_modules/@noble/hashes/package.json @@ -0,0 +1,266 @@ +{ + "name": "@noble/hashes", + "version": "1.8.0", + "description": "Audited & minimal 0-dependency JS implementation of SHA, RIPEMD, BLAKE, HMAC, HKDF, PBKDF & Scrypt", + "files": [ + "/*.js", + "/*.js.map", + "/*.d.ts", + "/*.d.ts.map", + "esm", + "src/*.ts" + ], + "scripts": { + "bench": "node benchmark/noble.js", + "bench:compare": "MBENCH_DIMS='algorithm,buffer,library' node benchmark/hashes.js", + "bench:compare-hkdf": "MBENCH_DIMS='algorithm,length,library' node benchmark/hkdf.js", + "bench:compare-scrypt": "MBENCH_DIMS='iters,library' MBENCH_FILTER='async' node benchmark/scrypt.js", + "bench:install": "cd benchmark; npm install; npm install .. --install-links", + "build": "npm run build:clean; tsc && tsc -p tsconfig.cjs.json", + "build:clean": "rm -f *.{js,d.ts,js.map,d.ts.map} esm/*.{js,js.map,d.ts.map}", + "build:release": "npx jsbt esbuild test/build", + "lint": "prettier --check 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'", + "format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'", + "test": "node --import ./test/esm-register.js test/index.js", + "test:bun": "bun test/index.js", + "test:deno": "deno --allow-env --allow-read --import-map=./test/import_map.json test/index.js", + "test:dos": "node --import ./test/esm-register.js test/slow-dos.test.js", + "test:big": "node --import ./test/esm-register.js test/slow-big.test.js", + "test:kdf": "node --import ./test/esm-register.js test/slow-kdf.test.js" + }, + "author": "Paul Miller (https://paulmillr.com)", + "homepage": "https://paulmillr.com/noble/", + "repository": { + "type": "git", + "url": "git+https://github.com/paulmillr/noble-hashes.git" + }, + "license": "MIT", + "devDependencies": { + "@paulmillr/jsbt": "0.3.3", + "fast-check": "3.0.0", + "micro-bmark": "0.4.1", + "micro-should": "0.5.2", + "prettier": "3.5.3", + "typescript": "5.8.3" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "exports": { + ".": { + "import": "./esm/index.js", + "require": "./index.js" + }, + "./crypto": { + "node": { + "import": "./esm/cryptoNode.js", + "default": "./cryptoNode.js" + }, + "import": "./esm/crypto.js", + "default": "./crypto.js" + }, + "./_assert": { + "import": "./esm/_assert.js", + "require": "./_assert.js" + }, + "./_md": { + "import": "./esm/_md.js", + "require": "./_md.js" + }, + "./argon2": { + "import": "./esm/argon2.js", + "require": "./argon2.js" + }, + "./blake1": { + "import": "./esm/blake1.js", + "require": "./blake1.js" + }, + "./blake2": { + "import": "./esm/blake2.js", + "require": "./blake2.js" + }, + "./blake2b": { + "import": "./esm/blake2b.js", + "require": "./blake2b.js" + }, + "./blake2s": { + "import": "./esm/blake2s.js", + "require": "./blake2s.js" + }, + "./blake3": { + "import": "./esm/blake3.js", + "require": "./blake3.js" + }, + "./eskdf": { + "import": "./esm/eskdf.js", + "require": "./eskdf.js" + }, + "./hkdf": { + "import": "./esm/hkdf.js", + "require": "./hkdf.js" + }, + "./hmac": { + "import": "./esm/hmac.js", + "require": "./hmac.js" + }, + "./legacy": { + "import": "./esm/legacy.js", + "require": "./legacy.js" + }, + "./pbkdf2": { + "import": "./esm/pbkdf2.js", + "require": "./pbkdf2.js" + }, + "./ripemd160": { + "import": "./esm/ripemd160.js", + "require": "./ripemd160.js" + }, + "./scrypt": { + "import": "./esm/scrypt.js", + "require": "./scrypt.js" + }, + "./sha1": { + "import": "./esm/sha1.js", + "require": "./sha1.js" + }, + "./sha2": { + "import": "./esm/sha2.js", + "require": "./sha2.js" + }, + "./sha3-addons": { + "import": "./esm/sha3-addons.js", + "require": "./sha3-addons.js" + }, + "./sha3": { + "import": "./esm/sha3.js", + "require": "./sha3.js" + }, + "./sha256": { + "import": "./esm/sha256.js", + "require": "./sha256.js" + }, + "./sha512": { + "import": "./esm/sha512.js", + "require": "./sha512.js" + }, + "./utils": { + "import": "./esm/utils.js", + "require": "./utils.js" + }, + "./_assert.js": { + "import": "./esm/_assert.js", + "require": "./_assert.js" + }, + "./_md.js": { + "import": "./esm/_md.js", + "require": "./_md.js" + }, + "./argon2.js": { + "import": "./esm/argon2.js", + "require": "./argon2.js" + }, + "./blake1.js": { + "import": "./esm/blake1.js", + "require": "./blake1.js" + }, + "./blake2.js": { + "import": "./esm/blake2.js", + "require": "./blake2.js" + }, + "./blake2b.js": { + "import": "./esm/blake2b.js", + "require": "./blake2b.js" + }, + "./blake2s.js": { + "import": "./esm/blake2s.js", + "require": "./blake2s.js" + }, + "./blake3.js": { + "import": "./esm/blake3.js", + "require": "./blake3.js" + }, + "./eskdf.js": { + "import": "./esm/eskdf.js", + "require": "./eskdf.js" + }, + "./hkdf.js": { + "import": "./esm/hkdf.js", + "require": "./hkdf.js" + }, + "./hmac.js": { + "import": "./esm/hmac.js", + "require": "./hmac.js" + }, + "./legacy.js": { + "import": "./esm/legacy.js", + "require": "./legacy.js" + }, + "./pbkdf2.js": { + "import": "./esm/pbkdf2.js", + "require": "./pbkdf2.js" + }, + "./ripemd160.js": { + "import": "./esm/ripemd160.js", + "require": "./ripemd160.js" + }, + "./scrypt.js": { + "import": "./esm/scrypt.js", + "require": "./scrypt.js" + }, + "./sha1.js": { + "import": "./esm/sha1.js", + "require": "./sha1.js" + }, + "./sha2.js": { + "import": "./esm/sha2.js", + "require": "./sha2.js" + }, + "./sha3-addons.js": { + "import": "./esm/sha3-addons.js", + "require": "./sha3-addons.js" + }, + "./sha3.js": { + "import": "./esm/sha3.js", + "require": "./sha3.js" + }, + "./sha256.js": { + "import": "./esm/sha256.js", + "require": "./sha256.js" + }, + "./sha512.js": { + "import": "./esm/sha512.js", + "require": "./sha512.js" + }, + "./utils.js": { + "import": "./esm/utils.js", + "require": "./utils.js" + } + }, + "sideEffects": false, + "browser": { + "node:crypto": false, + "./crypto": "./crypto.js" + }, + "keywords": [ + "sha", + "sha2", + "sha3", + "sha256", + "sha512", + "keccak", + "kangarootwelve", + "ripemd160", + "blake2", + "blake3", + "hmac", + "hkdf", + "pbkdf2", + "scrypt", + "kdf", + "hash", + "cryptography", + "security", + "noble" + ], + "funding": "https://paulmillr.com/funding/" +} diff --git a/node_modules/@noble/hashes/pbkdf2.d.ts b/node_modules/@noble/hashes/pbkdf2.d.ts new file mode 100644 index 0000000..0697c69 --- /dev/null +++ b/node_modules/@noble/hashes/pbkdf2.d.ts @@ -0,0 +1,23 @@ +import { type CHash, type KDFInput } from './utils.ts'; +export type Pbkdf2Opt = { + c: number; + dkLen?: number; + asyncTick?: number; +}; +/** + * PBKDF2-HMAC: RFC 2898 key derivation function + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated + * @param salt - cryptographic salt + * @param opts - {c, dkLen} where c is work factor and dkLen is output message size + * @example + * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); + */ +export declare function pbkdf2(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Uint8Array; +/** + * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. + * @example + * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); + */ +export declare function pbkdf2Async(hash: CHash, password: KDFInput, salt: KDFInput, opts: Pbkdf2Opt): Promise; +//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/pbkdf2.d.ts.map b/node_modules/@noble/hashes/pbkdf2.d.ts.map new file mode 100644 index 0000000..a4d30f3 --- /dev/null +++ b/node_modules/@noble/hashes/pbkdf2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["src/pbkdf2.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,QAAQ,EACd,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAkCF;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,UAAU,CAsBZ;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,UAAU,CAAC,CAsBrB"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/pbkdf2.js b/node_modules/@noble/hashes/pbkdf2.js new file mode 100644 index 0000000..0d8cab0 --- /dev/null +++ b/node_modules/@noble/hashes/pbkdf2.js @@ -0,0 +1,101 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pbkdf2 = pbkdf2; +exports.pbkdf2Async = pbkdf2Async; +/** + * PBKDF (RFC 2898). Can be used to create a key from password and salt. + * @module + */ +const hmac_ts_1 = require("./hmac.js"); +// prettier-ignore +const utils_ts_1 = require("./utils.js"); +// Common prologue and epilogue for sync/async functions +function pbkdf2Init(hash, _password, _salt, _opts) { + (0, utils_ts_1.ahash)(hash); + const opts = (0, utils_ts_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + (0, utils_ts_1.anumber)(c); + (0, utils_ts_1.anumber)(dkLen); + (0, utils_ts_1.anumber)(asyncTick); + if (c < 1) + throw new Error('iterations (c) should be >= 1'); + const password = (0, utils_ts_1.kdfInputToBytes)(_password); + const salt = (0, utils_ts_1.kdfInputToBytes)(_salt); + // DK = PBKDF2(PRF, Password, Salt, c, dkLen); + const DK = new Uint8Array(dkLen); + // U1 = PRF(Password, Salt + INT_32_BE(i)) + const PRF = hmac_ts_1.hmac.create(hash, password); + const PRFSalt = PRF._cloneInto().update(salt); + return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; +} +function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { + PRF.destroy(); + PRFSalt.destroy(); + if (prfW) + prfW.destroy(); + (0, utils_ts_1.clean)(u); + return DK; +} +/** + * PBKDF2-HMAC: RFC 2898 key derivation function + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated + * @param salt - cryptographic salt + * @param opts - {c, dkLen} where c is work factor and dkLen is output message size + * @example + * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); + */ +function pbkdf2(hash, password, salt, opts) { + const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW; // Working copy + const arr = new Uint8Array(4); + const view = (0, utils_ts_1.createView)(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + for (let ui = 1; ui < c; ui++) { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + } + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} +/** + * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. + * @example + * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); + */ +async function pbkdf2Async(hash, password, salt, opts) { + const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW; // Working copy + const arr = new Uint8Array(4); + const view = (0, utils_ts_1.createView)(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + await (0, utils_ts_1.asyncLoop)(c - 1, asyncTick, () => { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + }); + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} +//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/pbkdf2.js.map b/node_modules/@noble/hashes/pbkdf2.js.map new file mode 100644 index 0000000..4579c9f --- /dev/null +++ b/node_modules/@noble/hashes/pbkdf2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["src/pbkdf2.ts"],"names":[],"mappings":";;AA4DA,wBA2BC;AAOD,kCA2BC;AAzHD;;;GAGG;AACH,uCAAiC;AACjC,kBAAkB;AAClB,yCAKoB;AAOpB,wDAAwD;AACxD,SAAS,UAAU,CAAC,IAAW,EAAE,SAAmB,EAAE,KAAe,EAAE,KAAgB;IACrF,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,MAAM,IAAI,GAAG,IAAA,oBAAS,EAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC5D,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACrC,IAAA,kBAAO,EAAC,CAAC,CAAC,CAAC;IACX,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;IACf,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC;IACnB,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAG,IAAA,0BAAe,EAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,IAAA,0BAAe,EAAC,KAAK,CAAC,CAAC;IACpC,8CAA8C;IAC9C,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,0CAA0C;IAC1C,MAAM,GAAG,GAAG,cAAI,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,EAAE,CAAC,EAAE,KAA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EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;QAClE,+BAA+B;QAC/B,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;QAC5B,6CAA6C;QAC7C,0CAA0C;QAC1C,CAAC,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5D,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACjC,MAAM,IAAA,oBAAS,EAAC,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;YACrC,2BAA2B;YAC3B,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE;gBAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/ripemd160.d.ts b/node_modules/@noble/hashes/ripemd160.d.ts new file mode 100644 index 0000000..2fb0fa7 --- /dev/null +++ b/node_modules/@noble/hashes/ripemd160.d.ts @@ -0,0 +1,13 @@ +/** + * RIPEMD-160 legacy hash function. + * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + * @module + * @deprecated + */ +import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from './legacy.ts'; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const RIPEMD160: typeof RIPEMD160n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const ripemd160: typeof ripemd160n; +//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/ripemd160.d.ts.map b/node_modules/@noble/hashes/ripemd160.d.ts.map new file mode 100644 index 0000000..f2050f4 --- /dev/null +++ b/node_modules/@noble/hashes/ripemd160.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["src/ripemd160.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/E,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC;AACvD,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,OAAO,UAAuB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/ripemd160.js b/node_modules/@noble/hashes/ripemd160.js new file mode 100644 index 0000000..9561e7b --- /dev/null +++ b/node_modules/@noble/hashes/ripemd160.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ripemd160 = exports.RIPEMD160 = void 0; +/** + * RIPEMD-160 legacy hash function. + * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + * @module + * @deprecated + */ +const legacy_ts_1 = require("./legacy.js"); +/** @deprecated Use import from `noble/hashes/legacy` module */ +exports.RIPEMD160 = legacy_ts_1.RIPEMD160; +/** @deprecated Use import from `noble/hashes/legacy` module */ +exports.ripemd160 = legacy_ts_1.ripemd160; +//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/ripemd160.js.map b/node_modules/@noble/hashes/ripemd160.js.map new file mode 100644 index 0000000..5dc975e --- /dev/null +++ b/node_modules/@noble/hashes/ripemd160.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["src/ripemd160.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,2CAA+E;AAC/E,+DAA+D;AAClD,QAAA,SAAS,GAAsB,qBAAU,CAAC;AACvD,+DAA+D;AAClD,QAAA,SAAS,GAAsB,qBAAU,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/scrypt.d.ts b/node_modules/@noble/hashes/scrypt.d.ts new file mode 100644 index 0000000..38d0ef9 --- /dev/null +++ b/node_modules/@noble/hashes/scrypt.d.ts @@ -0,0 +1,34 @@ +import { type KDFInput } from './utils.ts'; +export type ScryptOpts = { + N: number; + r: number; + p: number; + dkLen?: number; + asyncTick?: number; + maxmem?: number; + onProgress?: (progress: number) => void; +}; +/** + * Scrypt KDF from RFC 7914. + * @param password - pass + * @param salt - salt + * @param opts - parameters + * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) + * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance + * - `p` is parallelization factor (1 is common) + * - `dkLen` is output key length in bytes e.g. 32. + * - `asyncTick` - (default: 10) max time in ms for which async function can block execution + * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt + * - `onProgress` - callback function that would be executed for progress report + * @returns Derived key + * @example + * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export declare function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array; +/** + * Scrypt KDF from RFC 7914. Async version. + * @example + * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export declare function scryptAsync(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Promise; +//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/scrypt.d.ts.map b/node_modules/@noble/hashes/scrypt.d.ts.map new file mode 100644 index 0000000..49860bc --- /dev/null +++ b/node_modules/@noble/hashes/scrypt.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["src/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,QAAQ,EAGd,MAAM,YAAY,CAAC;AAuEpB,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAoFF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CA0BvF;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC,UAAU,CAAC,CA2BrB"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/scrypt.js b/node_modules/@noble/hashes/scrypt.js new file mode 100644 index 0000000..18605c8 --- /dev/null +++ b/node_modules/@noble/hashes/scrypt.js @@ -0,0 +1,232 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.scrypt = scrypt; +exports.scryptAsync = scryptAsync; +/** + * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. + * @module + */ +const pbkdf2_ts_1 = require("./pbkdf2.js"); +const sha2_ts_1 = require("./sha2.js"); +// prettier-ignore +const utils_ts_1 = require("./utils.js"); +// The main Scrypt loop: uses Salsa extensively. +// Six versions of the function were tried, this is the fastest one. +// prettier-ignore +function XorAndSalsa(prev, pi, input, ii, out, oi) { + // Based on https://cr.yp.to/salsa20.html + // Xor blocks + let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; + let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; + let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; + let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; + let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; + let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; + let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; + let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; + // Save state to temporary variables (salsa) + let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; + // Main loop (salsa) + for (let i = 0; i < 8; i += 2) { + x04 ^= (0, utils_ts_1.rotl)(x00 + x12 | 0, 7); + x08 ^= (0, utils_ts_1.rotl)(x04 + x00 | 0, 9); + x12 ^= (0, utils_ts_1.rotl)(x08 + x04 | 0, 13); + x00 ^= (0, utils_ts_1.rotl)(x12 + x08 | 0, 18); + x09 ^= (0, utils_ts_1.rotl)(x05 + x01 | 0, 7); + x13 ^= (0, utils_ts_1.rotl)(x09 + x05 | 0, 9); + x01 ^= (0, utils_ts_1.rotl)(x13 + x09 | 0, 13); + x05 ^= (0, utils_ts_1.rotl)(x01 + x13 | 0, 18); + x14 ^= (0, utils_ts_1.rotl)(x10 + x06 | 0, 7); + x02 ^= (0, utils_ts_1.rotl)(x14 + x10 | 0, 9); + x06 ^= (0, utils_ts_1.rotl)(x02 + x14 | 0, 13); + x10 ^= (0, utils_ts_1.rotl)(x06 + x02 | 0, 18); + x03 ^= (0, utils_ts_1.rotl)(x15 + x11 | 0, 7); + x07 ^= (0, utils_ts_1.rotl)(x03 + x15 | 0, 9); + x11 ^= (0, utils_ts_1.rotl)(x07 + x03 | 0, 13); + x15 ^= (0, utils_ts_1.rotl)(x11 + x07 | 0, 18); + x01 ^= (0, utils_ts_1.rotl)(x00 + x03 | 0, 7); + x02 ^= (0, utils_ts_1.rotl)(x01 + x00 | 0, 9); + x03 ^= (0, utils_ts_1.rotl)(x02 + x01 | 0, 13); + x00 ^= (0, utils_ts_1.rotl)(x03 + x02 | 0, 18); + x06 ^= (0, utils_ts_1.rotl)(x05 + x04 | 0, 7); + x07 ^= (0, utils_ts_1.rotl)(x06 + x05 | 0, 9); + x04 ^= (0, utils_ts_1.rotl)(x07 + x06 | 0, 13); + x05 ^= (0, utils_ts_1.rotl)(x04 + x07 | 0, 18); + x11 ^= (0, utils_ts_1.rotl)(x10 + x09 | 0, 7); + x08 ^= (0, utils_ts_1.rotl)(x11 + x10 | 0, 9); + x09 ^= (0, utils_ts_1.rotl)(x08 + x11 | 0, 13); + x10 ^= (0, utils_ts_1.rotl)(x09 + x08 | 0, 18); + x12 ^= (0, utils_ts_1.rotl)(x15 + x14 | 0, 7); + x13 ^= (0, utils_ts_1.rotl)(x12 + x15 | 0, 9); + x14 ^= (0, utils_ts_1.rotl)(x13 + x12 | 0, 13); + x15 ^= (0, utils_ts_1.rotl)(x14 + x13 | 0, 18); + } + // Write output (salsa) + out[oi++] = (y00 + x00) | 0; + out[oi++] = (y01 + x01) | 0; + out[oi++] = (y02 + x02) | 0; + out[oi++] = (y03 + x03) | 0; + out[oi++] = (y04 + x04) | 0; + out[oi++] = (y05 + x05) | 0; + out[oi++] = (y06 + x06) | 0; + out[oi++] = (y07 + x07) | 0; + out[oi++] = (y08 + x08) | 0; + out[oi++] = (y09 + x09) | 0; + out[oi++] = (y10 + x10) | 0; + out[oi++] = (y11 + x11) | 0; + out[oi++] = (y12 + x12) | 0; + out[oi++] = (y13 + x13) | 0; + out[oi++] = (y14 + x14) | 0; + out[oi++] = (y15 + x15) | 0; +} +function BlockMix(input, ii, out, oi, r) { + // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) + let head = oi + 0; + let tail = oi + 16 * r; + for (let i = 0; i < 16; i++) + out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] + for (let i = 0; i < r; i++, head += 16, ii += 16) { + // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 + XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) + if (i > 0) + tail += 16; // First iteration overwrites tmp value in tail + XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) + } +} +// Common prologue and epilogue for sync/async functions +function scryptInit(password, salt, _opts) { + // Maxmem - 1GB+1KB by default + const opts = (0, utils_ts_1.checkOpts)({ + dkLen: 32, + asyncTick: 10, + maxmem: 1024 ** 3 + 1024, + }, _opts); + const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; + (0, utils_ts_1.anumber)(N); + (0, utils_ts_1.anumber)(r); + (0, utils_ts_1.anumber)(p); + (0, utils_ts_1.anumber)(dkLen); + (0, utils_ts_1.anumber)(asyncTick); + (0, utils_ts_1.anumber)(maxmem); + if (onProgress !== undefined && typeof onProgress !== 'function') + throw new Error('progressCb should be function'); + const blockSize = 128 * r; + const blockSize32 = blockSize / 4; + // Max N is 2^32 (Integrify is 32-bit). Real limit is 2^22: JS engines Uint8Array limit is 4GB in 2024. + // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, + // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: + // https://www.rfc-editor.org/errata_search.php?rfc=7914 + const pow32 = Math.pow(2, 32); + if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) { + throw new Error('Scrypt: N must be larger than 1, a power of 2, and less than 2^32'); + } + if (p < 0 || p > ((pow32 - 1) * 32) / blockSize) { + throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); + } + if (dkLen < 0 || dkLen > (pow32 - 1) * 32) { + throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); + } + const memUsed = blockSize * (N + p); + if (memUsed > maxmem) { + throw new Error('Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of ' + maxmem); + } + // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) + // Since it has only one iteration there is no reason to use async variant + const B = (0, pbkdf2_ts_1.pbkdf2)(sha2_ts_1.sha256, password, salt, { c: 1, dkLen: blockSize * p }); + const B32 = (0, utils_ts_1.u32)(B); + // Re-used between parallel iterations. Array(iterations) of B + const V = (0, utils_ts_1.u32)(new Uint8Array(blockSize * N)); + const tmp = (0, utils_ts_1.u32)(new Uint8Array(blockSize)); + let blockMixCb = () => { }; + if (onProgress) { + const totalBlockMix = 2 * N * p; + // Invoke callback if progress changes from 10.01 to 10.02 + // Allows to draw smooth progress bar on up to 8K screen + const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); + let blockMixCnt = 0; + blockMixCb = () => { + blockMixCnt++; + if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) + onProgress(blockMixCnt / totalBlockMix); + }; + } + return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; +} +function scryptOutput(password, dkLen, B, V, tmp) { + const res = (0, pbkdf2_ts_1.pbkdf2)(sha2_ts_1.sha256, password, B, { c: 1, dkLen }); + (0, utils_ts_1.clean)(B, V, tmp); + return res; +} +/** + * Scrypt KDF from RFC 7914. + * @param password - pass + * @param salt - salt + * @param opts - parameters + * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) + * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance + * - `p` is parallelization factor (1 is common) + * - `dkLen` is output key length in bytes e.g. 32. + * - `asyncTick` - (default: 10) max time in ms for which async function can block execution + * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt + * - `onProgress` - callback function that would be executed for progress report + * @returns Derived key + * @example + * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +function scrypt(password, salt, opts) { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); + (0, utils_ts_1.swap32IfBE)(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) + V[i] = B32[Pi + i]; // V[0] = B[i] + for (let i = 0, pos = 0; i < N - 1; i++) { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + } + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + for (let i = 0; i < N; i++) { + // First u32 of the last 64-byte block (u32 is LE) + const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + for (let k = 0; k < blockSize32; k++) + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + } + } + (0, utils_ts_1.swap32IfBE)(B32); + return scryptOutput(password, dkLen, B, V, tmp); +} +/** + * Scrypt KDF from RFC 7914. Async version. + * @example + * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +async function scryptAsync(password, salt, opts) { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); + (0, utils_ts_1.swap32IfBE)(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) + V[i] = B32[Pi + i]; // V[0] = B[i] + let pos = 0; + await (0, utils_ts_1.asyncLoop)(N - 1, asyncTick, () => { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + }); + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + await (0, utils_ts_1.asyncLoop)(N, asyncTick, () => { + // First u32 of the last 64-byte block (u32 is LE) + const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + for (let k = 0; k < blockSize32; k++) + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + }); + } + (0, utils_ts_1.swap32IfBE)(B32); + return scryptOutput(password, dkLen, B, V, tmp); +} +//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/scrypt.js.map b/node_modules/@noble/hashes/scrypt.js.map new file mode 100644 index 0000000..ded97a0 --- /dev/null +++ b/node_modules/@noble/hashes/scrypt.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["src/scrypt.ts"],"names":[],"mappings":";;AAgMA,wBA0BC;AAOD,kCA+BC;AAhQD;;;GAGG;AACH,2CAAqC;AACrC,uCAAmC;AACnC,kBAAkB;AAClB,yCAMoB;AAEpB,gDAAgD;AAChD,oEAAoE;AACpE,kBAAkB;AAClB,SAAS,WAAW,CAClB,IAAiB,EACjB,EAAU,EACV,KAAkB,EAClB,EAAU,EACV,GAAgB,EAChB,EAAU;IAEV,yCAAyC;IACzC,aAAa;IACb,IAAI,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,C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G,WAAW,EAAE,CAAC,EAAE;gBAAE,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,iBAAiB;YACtG,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,yBAAyB;YACvD,UAAU,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IACD,IAAA,qBAAU,EAAC,GAAG,CAAC,CAAC;IAChB,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha1.d.ts b/node_modules/@noble/hashes/sha1.d.ts new file mode 100644 index 0000000..7c36b9f --- /dev/null +++ b/node_modules/@noble/hashes/sha1.d.ts @@ -0,0 +1,11 @@ +/** + * SHA1 (RFC 3174) legacy hash function. + * @module + * @deprecated + */ +import { SHA1 as SHA1n, sha1 as sha1n } from './legacy.ts'; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const SHA1: typeof SHA1n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export declare const sha1: typeof sha1n; +//# sourceMappingURL=sha1.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha1.d.ts.map b/node_modules/@noble/hashes/sha1.d.ts.map new file mode 100644 index 0000000..f590e00 --- /dev/null +++ b/node_modules/@noble/hashes/sha1.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.d.ts","sourceRoot":"","sources":["src/sha1.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,aAAa,CAAC;AAC3D,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC;AACxC,+DAA+D;AAC/D,eAAO,MAAM,IAAI,EAAE,OAAO,KAAa,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha1.js b/node_modules/@noble/hashes/sha1.js new file mode 100644 index 0000000..f881be1 --- /dev/null +++ b/node_modules/@noble/hashes/sha1.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sha1 = exports.SHA1 = void 0; +/** + * SHA1 (RFC 3174) legacy hash function. + * @module + * @deprecated + */ +const legacy_ts_1 = require("./legacy.js"); +/** @deprecated Use import from `noble/hashes/legacy` module */ +exports.SHA1 = legacy_ts_1.SHA1; +/** @deprecated Use import from `noble/hashes/legacy` module */ +exports.sha1 = legacy_ts_1.sha1; +//# sourceMappingURL=sha1.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha1.js.map b/node_modules/@noble/hashes/sha1.js.map new file mode 100644 index 0000000..de5634a --- /dev/null +++ b/node_modules/@noble/hashes/sha1.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha1.js","sourceRoot":"","sources":["src/sha1.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,2CAA2D;AAC3D,+DAA+D;AAClD,QAAA,IAAI,GAAiB,gBAAK,CAAC;AACxC,+DAA+D;AAClD,QAAA,IAAI,GAAiB,gBAAK,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha2.d.ts b/node_modules/@noble/hashes/sha2.d.ts new file mode 100644 index 0000000..33f2f7f --- /dev/null +++ b/node_modules/@noble/hashes/sha2.d.ts @@ -0,0 +1,159 @@ +/** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + */ +import { HashMD } from './_md.ts'; +import { type CHash } from './utils.ts'; +export declare class SHA256 extends HashMD { + protected A: number; + protected B: number; + protected C: number; + protected D: number; + protected E: number; + protected F: number; + protected G: number; + protected H: number; + constructor(outputLen?: number); + protected get(): [number, number, number, number, number, number, number, number]; + protected set(A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +export declare class SHA224 extends SHA256 { + protected A: number; + protected B: number; + protected C: number; + protected D: number; + protected E: number; + protected F: number; + protected G: number; + protected H: number; + constructor(); +} +export declare class SHA512 extends HashMD { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(outputLen?: number); + protected get(): [ + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number, + number + ]; + protected set(Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number): void; + protected process(view: DataView, offset: number): void; + protected roundClean(): void; + destroy(): void; +} +export declare class SHA384 extends SHA512 { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(); +} +export declare class SHA512_224 extends SHA512 { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(); +} +export declare class SHA512_256 extends SHA512 { + protected Ah: number; + protected Al: number; + protected Bh: number; + protected Bl: number; + protected Ch: number; + protected Cl: number; + protected Dh: number; + protected Dl: number; + protected Eh: number; + protected El: number; + protected Fh: number; + protected Fl: number; + protected Gh: number; + protected Gl: number; + protected Hh: number; + protected Hl: number; + constructor(); +} +/** + * SHA2-256 hash function from RFC 4634. + * + * It is the fastest JS hash, even faster than Blake3. + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + */ +export declare const sha256: CHash; +/** SHA2-224 hash function from RFC 4634 */ +export declare const sha224: CHash; +/** SHA2-512 hash function from RFC 4634. */ +export declare const sha512: CHash; +/** SHA2-384 hash function from RFC 4634. */ +export declare const sha384: CHash; +/** + * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export declare const sha512_256: CHash; +/** + * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export declare const sha512_224: CHash; +//# sourceMappingURL=sha2.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha2.d.ts.map b/node_modules/@noble/hashes/sha2.d.ts.map new file mode 100644 index 0000000..310e813 --- /dev/null +++ b/node_modules/@noble/hashes/sha2.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha2.d.ts","sourceRoot":"","sources":["src/sha2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAO,MAAM,EAAmD,MAAM,UAAU,CAAC;AAExF,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAoBnE,qBAAa,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC;IAGxC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAoB;IACvC,SA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;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAC9E,2CAA2C;AAC3C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAE9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAC9E,4CAA4C;AAC5C,eAAO,MAAM,MAAM,EAAE,KAAwD,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC;AACtF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAA4D,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha2.js b/node_modules/@noble/hashes/sha2.js new file mode 100644 index 0000000..962a9ac --- /dev/null +++ b/node_modules/@noble/hashes/sha2.js @@ -0,0 +1,384 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sha512_224 = exports.sha512_256 = exports.sha384 = exports.sha512 = exports.sha224 = exports.sha256 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA384 = exports.SHA512 = exports.SHA224 = exports.SHA256 = void 0; +/** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + */ +const _md_ts_1 = require("./_md.js"); +const u64 = require("./_u64.js"); +const utils_ts_1 = require("./utils.js"); +/** + * Round constants: + * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) + */ +// prettier-ignore +const SHA256_K = /* @__PURE__ */ Uint32Array.from([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +]); +/** Reusable temporary buffer. "W" comes straight from spec. */ +const SHA256_W = /* @__PURE__ */ new Uint32Array(64); +class SHA256 extends _md_ts_1.HashMD { + constructor(outputLen = 32) { + super(64, outputLen, 8, false); + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + this.A = _md_ts_1.SHA256_IV[0] | 0; + this.B = _md_ts_1.SHA256_IV[1] | 0; + this.C = _md_ts_1.SHA256_IV[2] | 0; + this.D = _md_ts_1.SHA256_IV[3] | 0; + this.E = _md_ts_1.SHA256_IV[4] | 0; + this.F = _md_ts_1.SHA256_IV[5] | 0; + this.G = _md_ts_1.SHA256_IV[6] | 0; + this.H = _md_ts_1.SHA256_IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + // prettier-ignore + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + process(view, offset) { + // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = (0, utils_ts_1.rotr)(W15, 7) ^ (0, utils_ts_1.rotr)(W15, 18) ^ (W15 >>> 3); + const s1 = (0, utils_ts_1.rotr)(W2, 17) ^ (0, utils_ts_1.rotr)(W2, 19) ^ (W2 >>> 10); + SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; + } + // Compression function main loop, 64 rounds + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = (0, utils_ts_1.rotr)(E, 6) ^ (0, utils_ts_1.rotr)(E, 11) ^ (0, utils_ts_1.rotr)(E, 25); + const T1 = (H + sigma1 + (0, _md_ts_1.Chi)(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const sigma0 = (0, utils_ts_1.rotr)(A, 2) ^ (0, utils_ts_1.rotr)(A, 13) ^ (0, utils_ts_1.rotr)(A, 22); + const T2 = (sigma0 + (0, _md_ts_1.Maj)(A, B, C)) | 0; + H = G; + G = F; + F = E; + E = (D + T1) | 0; + D = C; + C = B; + B = A; + A = (T1 + T2) | 0; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + F = (F + this.F) | 0; + G = (G + this.G) | 0; + H = (H + this.H) | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + (0, utils_ts_1.clean)(SHA256_W); + } + destroy() { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + (0, utils_ts_1.clean)(this.buffer); + } +} +exports.SHA256 = SHA256; +class SHA224 extends SHA256 { + constructor() { + super(28); + this.A = _md_ts_1.SHA224_IV[0] | 0; + this.B = _md_ts_1.SHA224_IV[1] | 0; + this.C = _md_ts_1.SHA224_IV[2] | 0; + this.D = _md_ts_1.SHA224_IV[3] | 0; + this.E = _md_ts_1.SHA224_IV[4] | 0; + this.F = _md_ts_1.SHA224_IV[5] | 0; + this.G = _md_ts_1.SHA224_IV[6] | 0; + this.H = _md_ts_1.SHA224_IV[7] | 0; + } +} +exports.SHA224 = SHA224; +// SHA2-512 is slower than sha256 in js because u64 operations are slow. +// Round contants +// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 +// prettier-ignore +const K512 = /* @__PURE__ */ (() => u64.split([ + '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', + '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', + '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', + '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', + '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', + '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', + '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', + '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', + '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', + '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', + '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', + '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', + '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', + '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', + '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', + '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', + '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', + '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', + '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', + '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' +].map(n => BigInt(n))))(); +const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); +const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); +// Reusable temporary buffers +const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); +const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); +class SHA512 extends _md_ts_1.HashMD { + constructor(outputLen = 64) { + super(128, outputLen, 16, false); + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // h -- high 32 bits, l -- low 32 bits + this.Ah = _md_ts_1.SHA512_IV[0] | 0; + this.Al = _md_ts_1.SHA512_IV[1] | 0; + this.Bh = _md_ts_1.SHA512_IV[2] | 0; + this.Bl = _md_ts_1.SHA512_IV[3] | 0; + this.Ch = _md_ts_1.SHA512_IV[4] | 0; + this.Cl = _md_ts_1.SHA512_IV[5] | 0; + this.Dh = _md_ts_1.SHA512_IV[6] | 0; + this.Dl = _md_ts_1.SHA512_IV[7] | 0; + this.Eh = _md_ts_1.SHA512_IV[8] | 0; + this.El = _md_ts_1.SHA512_IV[9] | 0; + this.Fh = _md_ts_1.SHA512_IV[10] | 0; + this.Fl = _md_ts_1.SHA512_IV[11] | 0; + this.Gh = _md_ts_1.SHA512_IV[12] | 0; + this.Gl = _md_ts_1.SHA512_IV[13] | 0; + this.Hh = _md_ts_1.SHA512_IV[14] | 0; + this.Hl = _md_ts_1.SHA512_IV[15] | 0; + } + // prettier-ignore + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + // prettier-ignore + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + process(view, offset) { + // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H[i] = view.getUint32(offset); + SHA512_W_L[i] = view.getUint32((offset += 4)); + } + for (let i = 16; i < 80; i++) { + // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) + const W15h = SHA512_W_H[i - 15] | 0; + const W15l = SHA512_W_L[i - 15] | 0; + const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); + const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); + // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) + const W2h = SHA512_W_H[i - 2] | 0; + const W2l = SHA512_W_L[i - 2] | 0; + const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); + const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); + // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; + const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + SHA512_W_H[i] = SUMh | 0; + SHA512_W_L[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + // Compression function main loop, 80 rounds + for (let i = 0; i < 80; i++) { + // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) + const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); + const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); + //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const CHIh = (Eh & Fh) ^ (~Eh & Gh); + const CHIl = (El & Fl) ^ (~El & Gl); + // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] + // prettier-ignore + const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1l = T1ll | 0; + // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) + const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); + const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); + const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); + const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = u64.add3L(T1l, sigma0l, MAJl); + Ah = u64.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + // Add the compressed chunk to the current hash value + ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + roundClean() { + (0, utils_ts_1.clean)(SHA512_W_H, SHA512_W_L); + } + destroy() { + (0, utils_ts_1.clean)(this.buffer); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +} +exports.SHA512 = SHA512; +class SHA384 extends SHA512 { + constructor() { + super(48); + this.Ah = _md_ts_1.SHA384_IV[0] | 0; + this.Al = _md_ts_1.SHA384_IV[1] | 0; + this.Bh = _md_ts_1.SHA384_IV[2] | 0; + this.Bl = _md_ts_1.SHA384_IV[3] | 0; + this.Ch = _md_ts_1.SHA384_IV[4] | 0; + this.Cl = _md_ts_1.SHA384_IV[5] | 0; + this.Dh = _md_ts_1.SHA384_IV[6] | 0; + this.Dl = _md_ts_1.SHA384_IV[7] | 0; + this.Eh = _md_ts_1.SHA384_IV[8] | 0; + this.El = _md_ts_1.SHA384_IV[9] | 0; + this.Fh = _md_ts_1.SHA384_IV[10] | 0; + this.Fl = _md_ts_1.SHA384_IV[11] | 0; + this.Gh = _md_ts_1.SHA384_IV[12] | 0; + this.Gl = _md_ts_1.SHA384_IV[13] | 0; + this.Hh = _md_ts_1.SHA384_IV[14] | 0; + this.Hl = _md_ts_1.SHA384_IV[15] | 0; + } +} +exports.SHA384 = SHA384; +/** + * Truncated SHA512/256 and SHA512/224. + * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. + * Then t hashes string to produce result IV. + * See `test/misc/sha2-gen-iv.js`. + */ +/** SHA512/224 IV */ +const T224_IV = /* @__PURE__ */ Uint32Array.from([ + 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, + 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, +]); +/** SHA512/256 IV */ +const T256_IV = /* @__PURE__ */ Uint32Array.from([ + 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, + 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, +]); +class SHA512_224 extends SHA512 { + constructor() { + super(28); + this.Ah = T224_IV[0] | 0; + this.Al = T224_IV[1] | 0; + this.Bh = T224_IV[2] | 0; + this.Bl = T224_IV[3] | 0; + this.Ch = T224_IV[4] | 0; + this.Cl = T224_IV[5] | 0; + this.Dh = T224_IV[6] | 0; + this.Dl = T224_IV[7] | 0; + this.Eh = T224_IV[8] | 0; + this.El = T224_IV[9] | 0; + this.Fh = T224_IV[10] | 0; + this.Fl = T224_IV[11] | 0; + this.Gh = T224_IV[12] | 0; + this.Gl = T224_IV[13] | 0; + this.Hh = T224_IV[14] | 0; + this.Hl = T224_IV[15] | 0; + } +} +exports.SHA512_224 = SHA512_224; +class SHA512_256 extends SHA512 { + constructor() { + super(32); + this.Ah = T256_IV[0] | 0; + this.Al = T256_IV[1] | 0; + this.Bh = T256_IV[2] | 0; + this.Bl = T256_IV[3] | 0; + this.Ch = T256_IV[4] | 0; + this.Cl = T256_IV[5] | 0; + this.Dh = T256_IV[6] | 0; + this.Dl = T256_IV[7] | 0; + this.Eh = T256_IV[8] | 0; + this.El = T256_IV[9] | 0; + this.Fh = T256_IV[10] | 0; + this.Fl = T256_IV[11] | 0; + this.Gh = T256_IV[12] | 0; + this.Gl = T256_IV[13] | 0; + this.Hh = T256_IV[14] | 0; + this.Hl = T256_IV[15] | 0; + } +} +exports.SHA512_256 = SHA512_256; +/** + * SHA2-256 hash function from RFC 4634. + * + * It is the fastest JS hash, even faster than Blake3. + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + */ +exports.sha256 = (0, utils_ts_1.createHasher)(() => new SHA256()); +/** SHA2-224 hash function from RFC 4634 */ +exports.sha224 = (0, utils_ts_1.createHasher)(() => new SHA224()); +/** SHA2-512 hash function from RFC 4634. */ +exports.sha512 = (0, utils_ts_1.createHasher)(() => new SHA512()); +/** SHA2-384 hash function from RFC 4634. */ +exports.sha384 = (0, utils_ts_1.createHasher)(() => new SHA384()); +/** + * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +exports.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256()); +/** + * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +exports.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224()); +//# sourceMappingURL=sha2.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha2.js.map b/node_modules/@noble/hashes/sha2.js.map new file mode 100644 index 0000000..b5cfb67 --- /dev/null +++ b/node_modules/@noble/hashes/sha2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha2.js","sourceRoot":"","sources":["src/sha2.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,qCAAwF;AACxF,iCAAiC;AACjC,yCAAmE;AAEnE;;;GAGG;AACH,kBAAkB;AAClB,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC;IAChD,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IAC9F,UAAU,EA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EAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAC9E,4CAA4C;AAC/B,QAAA,MAAM,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;AAE9E;;;GAGG;AACU,QAAA,UAAU,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC;AACtF;;;GAGG;AACU,QAAA,UAAU,GAA0B,IAAA,uBAAY,EAAC,GAAG,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha256.d.ts b/node_modules/@noble/hashes/sha256.d.ts new file mode 100644 index 0000000..ed04fe8 --- /dev/null +++ b/node_modules/@noble/hashes/sha256.d.ts @@ -0,0 +1,20 @@ +/** + * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. + * + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * + * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + * @deprecated + */ +import { SHA224 as SHA224n, sha224 as sha224n, SHA256 as SHA256n, sha256 as sha256n } from './sha2.ts'; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA256: typeof SHA256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha256: typeof sha256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA224: typeof SHA224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha224: typeof sha224n; +//# sourceMappingURL=sha256.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha256.d.ts.map b/node_modules/@noble/hashes/sha256.d.ts.map new file mode 100644 index 0000000..15911ba --- /dev/null +++ b/node_modules/@noble/hashes/sha256.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha256.js b/node_modules/@noble/hashes/sha256.js new file mode 100644 index 0000000..573bda9 --- /dev/null +++ b/node_modules/@noble/hashes/sha256.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sha224 = exports.SHA224 = exports.sha256 = exports.SHA256 = void 0; +/** + * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. + * + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * + * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + * @deprecated + */ +const sha2_ts_1 = require("./sha2.js"); +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.SHA256 = sha2_ts_1.SHA256; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.sha256 = sha2_ts_1.sha256; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.SHA224 = sha2_ts_1.SHA224; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.sha224 = sha2_ts_1.sha224; +//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha256.js.map b/node_modules/@noble/hashes/sha256.js.map new file mode 100644 index 0000000..69c5821 --- /dev/null +++ b/node_modules/@noble/hashes/sha256.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha256.js","sourceRoot":"","sources":["src/sha256.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,uCAKmB;AACnB,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3-addons.d.ts b/node_modules/@noble/hashes/sha3-addons.d.ts new file mode 100644 index 0000000..5bd2fe6 --- /dev/null +++ b/node_modules/@noble/hashes/sha3-addons.d.ts @@ -0,0 +1,142 @@ +/** + * SHA3 (keccak) addons. + * + * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): + * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants + * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): + * * 🦘 K12 aka KangarooTwelve + * * M14 aka MarsupilamiFourteen + * * TurboSHAKE + * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) + * @module + */ +import { Keccak, type ShakeOpts } from './sha3.ts'; +import { type CHashO, type CHashXO, Hash, type HashXOF, type Input } from './utils.ts'; +export type cShakeOpts = ShakeOpts & { + personalization?: Input; + NISTfn?: Input; +}; +export type ICShake = { + (msg: Input, opts?: cShakeOpts): Uint8Array; + outputLen: number; + blockLen: number; + create(opts: cShakeOpts): HashXOF; +}; +export type ITupleHash = { + (messages: Input[], opts?: cShakeOpts): Uint8Array; + create(opts?: cShakeOpts): TupleHash; +}; +export type IParHash = { + (message: Input, opts?: ParallelOpts): Uint8Array; + create(opts?: ParallelOpts): ParallelHash; +}; +export declare const cshake128: ICShake; +export declare const cshake256: ICShake; +export declare class KMAC extends Keccak implements HashXOF { + constructor(blockLen: number, outputLen: number, enableXOF: boolean, key: Input, opts?: cShakeOpts); + protected finish(): void; + _cloneInto(to?: KMAC): KMAC; + clone(): KMAC; +} +export declare const kmac128: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare const kmac256: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare const kmac128xof: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare const kmac256xof: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +}; +export declare class TupleHash extends Keccak implements HashXOF { + constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts?: cShakeOpts); + protected finish(): void; + _cloneInto(to?: TupleHash): TupleHash; + clone(): TupleHash; +} +/** 128-bit TupleHASH. */ +export declare const tuplehash128: ITupleHash; +/** 256-bit TupleHASH. */ +export declare const tuplehash256: ITupleHash; +/** 128-bit TupleHASH XOF. */ +export declare const tuplehash128xof: ITupleHash; +/** 256-bit TupleHASH XOF. */ +export declare const tuplehash256xof: ITupleHash; +type ParallelOpts = cShakeOpts & { + blockLen?: number; +}; +export declare class ParallelHash extends Keccak implements HashXOF { + private leafHash?; + protected leafCons: () => Hash; + private chunkPos; + private chunksDone; + private chunkLen; + constructor(blockLen: number, outputLen: number, leafCons: () => Hash, enableXOF: boolean, opts?: ParallelOpts); + protected finish(): void; + _cloneInto(to?: ParallelHash): ParallelHash; + destroy(): void; + clone(): ParallelHash; +} +/** 128-bit ParallelHash. In JS, it is not parallel. */ +export declare const parallelhash128: IParHash; +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export declare const parallelhash256: IParHash; +/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ +export declare const parallelhash128xof: IParHash; +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export declare const parallelhash256xof: IParHash; +export type TurboshakeOpts = ShakeOpts & { + D?: number; +}; +/** TurboSHAKE 128-bit: reduced 12-round keccak. */ +export declare const turboshake128: CHashXO; +/** TurboSHAKE 256-bit: reduced 12-round keccak. */ +export declare const turboshake256: CHashXO; +export type KangarooOpts = { + dkLen?: number; + personalization?: Input; +}; +export declare class KangarooTwelve extends Keccak implements HashXOF { + readonly chunkLen = 8192; + private leafHash?; + protected leafLen: number; + private personalization; + private chunkPos; + private chunksDone; + constructor(blockLen: number, leafLen: number, outputLen: number, rounds: number, opts: KangarooOpts); + update(data: Input): this; + protected finish(): void; + destroy(): void; + _cloneInto(to?: KangarooTwelve): KangarooTwelve; + clone(): KangarooTwelve; +} +/** KangarooTwelve: reduced 12-round keccak. */ +export declare const k12: CHashO; +/** MarsupilamiFourteen: reduced 14-round keccak. */ +export declare const m14: CHashO; +/** + * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. + */ +export declare class KeccakPRG extends Keccak { + protected rate: number; + constructor(capacity: number); + keccak(): void; + update(data: Input): this; + feed(data: Input): this; + protected finish(): void; + digestInto(_out: Uint8Array): Uint8Array; + fetch(bytes: number): Uint8Array; + forget(): void; + _cloneInto(to?: KeccakPRG): KeccakPRG; + clone(): KeccakPRG; +} +/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ +export declare const keccakprg: (capacity?: number) => KeccakPRG; +export {}; +//# sourceMappingURL=sha3-addons.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3-addons.d.ts.map b/node_modules/@noble/hashes/sha3-addons.d.ts.map new file mode 100644 index 0000000..7c2bee2 --- /dev/null +++ b/node_modules/@noble/hashes/sha3-addons.d.ts.map @@ -0,0 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AQd,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAKzB,IAAI,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAGvB,SAAS,CAAC,MAAM,IAAI,IAAI;IACxB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAGxC,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAIhC,MAAM,IAAI,IAAI;IAQd,UAAU,CAAC,EAAE,CAAC,EAAE,SAAS,GAAG,SAAS;IAOrC,KAAK,IAAI,SAAS;CAGnB;AAED,gGAAgG;AAChG,eAAO,MAAM,SAAS,GAAI,iBAAc,KAAG,SAAoC,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3-addons.js b/node_modules/@noble/hashes/sha3-addons.js new file mode 100644 index 0000000..ad75d78 --- /dev/null +++ b/node_modules/@noble/hashes/sha3-addons.js @@ -0,0 +1,402 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.keccakprg = exports.KeccakPRG = exports.m14 = exports.k12 = exports.KangarooTwelve = exports.turboshake256 = exports.turboshake128 = exports.parallelhash256xof = exports.parallelhash128xof = exports.parallelhash256 = exports.parallelhash128 = exports.ParallelHash = exports.tuplehash256xof = exports.tuplehash128xof = exports.tuplehash256 = exports.tuplehash128 = exports.TupleHash = exports.kmac256xof = exports.kmac128xof = exports.kmac256 = exports.kmac128 = exports.KMAC = exports.cshake256 = exports.cshake128 = void 0; +/** + * SHA3 (keccak) addons. + * + * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): + * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants + * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): + * * 🦘 K12 aka KangarooTwelve + * * M14 aka MarsupilamiFourteen + * * TurboSHAKE + * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) + * @module + */ +const sha3_ts_1 = require("./sha3.js"); +const utils_ts_1 = require("./utils.js"); +// cSHAKE && KMAC (NIST SP800-185) +const _8n = BigInt(8); +const _ffn = BigInt(0xff); +// NOTE: it is safe to use bigints here, since they used only for length encoding (not actual data). +// We use bigints in sha256 for lengths too. +function leftEncode(n) { + n = BigInt(n); + const res = [Number(n & _ffn)]; + n >>= _8n; + for (; n > 0; n >>= _8n) + res.unshift(Number(n & _ffn)); + res.unshift(res.length); + return new Uint8Array(res); +} +function rightEncode(n) { + n = BigInt(n); + const res = [Number(n & _ffn)]; + n >>= _8n; + for (; n > 0; n >>= _8n) + res.unshift(Number(n & _ffn)); + res.push(res.length); + return new Uint8Array(res); +} +function chooseLen(opts, outputLen) { + return opts.dkLen === undefined ? outputLen : opts.dkLen; +} +const abytesOrZero = (buf) => { + if (buf === undefined) + return Uint8Array.of(); + return (0, utils_ts_1.toBytes)(buf); +}; +// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block +const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block); +// Personalization +function cshakePers(hash, opts = {}) { + if (!opts || (!opts.personalization && !opts.NISTfn)) + return hash; + // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) + // bytepad(encode_string(N) || encode_string(S), 168) + const blockLenBytes = leftEncode(hash.blockLen); + const fn = abytesOrZero(opts.NISTfn); + const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits + const pers = abytesOrZero(opts.personalization); + const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits + if (!fn.length && !pers.length) + return hash; + hash.suffix = 0x04; + hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); + let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; + hash.update(getPadding(totalLen, hash.blockLen)); + return hash; +} +const gencShake = (suffix, blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => cshakePers(new sha3_ts_1.Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)); +exports.cshake128 = (() => gencShake(0x1f, 168, 128 / 8))(); +exports.cshake256 = (() => gencShake(0x1f, 136, 256 / 8))(); +class KMAC extends sha3_ts_1.Keccak { + constructor(blockLen, outputLen, enableXOF, key, opts = {}) { + super(blockLen, 0x1f, outputLen, enableXOF); + cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); + key = (0, utils_ts_1.toBytes)(key); + (0, utils_ts_1.abytes)(key); + // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). + const blockLenBytes = leftEncode(this.blockLen); + const keyLen = leftEncode(_8n * BigInt(key.length)); + this.update(blockLenBytes).update(keyLen).update(key); + const totalLen = blockLenBytes.length + keyLen.length + key.length; + this.update(getPadding(totalLen, this.blockLen)); + } + finish() { + if (!this.finished) + this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to) { + // Create new instance without calling constructor since key already in state and we don't know it. + // Force "to" to be instance of KMAC instead of Sha3. + if (!to) { + to = Object.create(Object.getPrototypeOf(this), {}); + to.state = this.state.slice(); + to.blockLen = this.blockLen; + to.state32 = (0, utils_ts_1.u32)(to.state); + } + return super._cloneInto(to); + } + clone() { + return this._cloneInto(); + } +} +exports.KMAC = KMAC; +function genKmac(blockLen, outputLen, xof = false) { + const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest(); + kmac.create = (key, opts = {}) => new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); + return kmac; +} +exports.kmac128 = (() => genKmac(168, 128 / 8))(); +exports.kmac256 = (() => genKmac(136, 256 / 8))(); +exports.kmac128xof = (() => genKmac(168, 128 / 8, true))(); +exports.kmac256xof = (() => genKmac(136, 256 / 8, true))(); +// TupleHash +// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) +class TupleHash extends sha3_ts_1.Keccak { + constructor(blockLen, outputLen, enableXOF, opts = {}) { + super(blockLen, 0x1f, outputLen, enableXOF); + cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); + // Change update after cshake processed + this.update = (data) => { + data = (0, utils_ts_1.toBytes)(data); + (0, utils_ts_1.abytes)(data); + super.update(leftEncode(_8n * BigInt(data.length))); + super.update(data); + return this; + }; + } + finish() { + if (!this.finished) + super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to) { + to || (to = new TupleHash(this.blockLen, this.outputLen, this.enableXOF)); + return super._cloneInto(to); + } + clone() { + return this._cloneInto(); + } +} +exports.TupleHash = TupleHash; +function genTuple(blockLen, outputLen, xof = false) { + const tuple = (messages, opts) => { + const h = tuple.create(opts); + for (const msg of messages) + h.update(msg); + return h.digest(); + }; + tuple.create = (opts = {}) => new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); + return tuple; +} +/** 128-bit TupleHASH. */ +exports.tuplehash128 = (() => genTuple(168, 128 / 8))(); +/** 256-bit TupleHASH. */ +exports.tuplehash256 = (() => genTuple(136, 256 / 8))(); +/** 128-bit TupleHASH XOF. */ +exports.tuplehash128xof = (() => genTuple(168, 128 / 8, true))(); +/** 256-bit TupleHASH XOF. */ +exports.tuplehash256xof = (() => genTuple(136, 256 / 8, true))(); +class ParallelHash extends sha3_ts_1.Keccak { + constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) { + super(blockLen, 0x1f, outputLen, enableXOF); + this.chunkPos = 0; // Position of current block in chunk + this.chunksDone = 0; // How many chunks we already have + cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); + this.leafCons = leafCons; + let { blockLen: B } = opts; + B || (B = 8); + (0, utils_ts_1.anumber)(B); + this.chunkLen = B; + super.update(leftEncode(B)); + // Change update after cshake processed + this.update = (data) => { + data = (0, utils_ts_1.toBytes)(data); + (0, utils_ts_1.abytes)(data); + const { chunkLen, leafCons } = this; + for (let pos = 0, len = data.length; pos < len;) { + if (this.chunkPos == chunkLen || !this.leafHash) { + if (this.leafHash) { + super.update(this.leafHash.digest()); + this.chunksDone++; + } + this.leafHash = leafCons(); + this.chunkPos = 0; + } + const take = Math.min(chunkLen - this.chunkPos, len - pos); + this.leafHash.update(data.subarray(pos, pos + take)); + this.chunkPos += take; + pos += take; + } + return this; + }; + } + finish() { + if (this.finished) + return; + if (this.leafHash) { + super.update(this.leafHash.digest()); + this.chunksDone++; + } + super.update(rightEncode(this.chunksDone)); + super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to) { + to || (to = new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF)); + if (this.leafHash) + to.leafHash = this.leafHash._cloneInto(to.leafHash); + to.chunkPos = this.chunkPos; + to.chunkLen = this.chunkLen; + to.chunksDone = this.chunksDone; + return super._cloneInto(to); + } + destroy() { + super.destroy.call(this); + if (this.leafHash) + this.leafHash.destroy(); + } + clone() { + return this._cloneInto(); + } +} +exports.ParallelHash = ParallelHash; +function genPrl(blockLen, outputLen, leaf, xof = false) { + const parallel = (message, opts) => parallel.create(opts).update(message).digest(); + parallel.create = (opts = {}) => new ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts); + return parallel; +} +/** 128-bit ParallelHash. In JS, it is not parallel. */ +exports.parallelhash128 = (() => genPrl(168, 128 / 8, exports.cshake128))(); +/** 256-bit ParallelHash. In JS, it is not parallel. */ +exports.parallelhash256 = (() => genPrl(136, 256 / 8, exports.cshake256))(); +/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ +exports.parallelhash128xof = (() => genPrl(168, 128 / 8, exports.cshake128, true))(); +/** 256-bit ParallelHash. In JS, it is not parallel. */ +exports.parallelhash256xof = (() => genPrl(136, 256 / 8, exports.cshake256, true))(); +const genTurboshake = (blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => { + const D = opts.D === undefined ? 0x1f : opts.D; + // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/ + if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) + throw new Error('invalid domain separation byte must be 0x01..0x7f, got: ' + D); + return new sha3_ts_1.Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); +}); +/** TurboSHAKE 128-bit: reduced 12-round keccak. */ +exports.turboshake128 = genTurboshake(168, 256 / 8); +/** TurboSHAKE 256-bit: reduced 12-round keccak. */ +exports.turboshake256 = genTurboshake(136, 512 / 8); +// Kangaroo +// Same as NIST rightEncode, but returns [0] for zero string +function rightEncodeK12(n) { + n = BigInt(n); + const res = []; + for (; n > 0; n >>= _8n) + res.unshift(Number(n & _ffn)); + res.push(res.length); + return Uint8Array.from(res); +} +const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); +class KangarooTwelve extends sha3_ts_1.Keccak { + constructor(blockLen, leafLen, outputLen, rounds, opts) { + super(blockLen, 0x07, outputLen, true, rounds); + this.chunkLen = 8192; + this.chunkPos = 0; // Position of current block in chunk + this.chunksDone = 0; // How many chunks we already have + this.leafLen = leafLen; + this.personalization = abytesOrZero(opts.personalization); + } + update(data) { + data = (0, utils_ts_1.toBytes)(data); + (0, utils_ts_1.abytes)(data); + const { chunkLen, blockLen, leafLen, rounds } = this; + for (let pos = 0, len = data.length; pos < len;) { + if (this.chunkPos == chunkLen) { + if (this.leafHash) + super.update(this.leafHash.digest()); + else { + this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() + super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); + } + this.leafHash = new sha3_ts_1.Keccak(blockLen, 0x0b, leafLen, false, rounds); + this.chunksDone++; + this.chunkPos = 0; + } + const take = Math.min(chunkLen - this.chunkPos, len - pos); + const chunk = data.subarray(pos, pos + take); + if (this.leafHash) + this.leafHash.update(chunk); + else + super.update(chunk); + this.chunkPos += take; + pos += take; + } + return this; + } + finish() { + if (this.finished) + return; + const { personalization } = this; + this.update(personalization).update(rightEncodeK12(personalization.length)); + // Leaf hash + if (this.leafHash) { + super.update(this.leafHash.digest()); + super.update(rightEncodeK12(this.chunksDone)); + super.update(Uint8Array.from([0xff, 0xff])); + } + super.finish.call(this); + } + destroy() { + super.destroy.call(this); + if (this.leafHash) + this.leafHash.destroy(); + // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input + this.personalization = EMPTY_BUFFER; + } + _cloneInto(to) { + const { blockLen, leafLen, leafHash, outputLen, rounds } = this; + to || (to = new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {})); + super._cloneInto(to); + if (leafHash) + to.leafHash = leafHash._cloneInto(to.leafHash); + to.personalization.set(this.personalization); + to.leafLen = this.leafLen; + to.chunkPos = this.chunkPos; + to.chunksDone = this.chunksDone; + return to; + } + clone() { + return this._cloneInto(); + } +} +exports.KangarooTwelve = KangarooTwelve; +/** KangarooTwelve: reduced 12-round keccak. */ +exports.k12 = (() => (0, utils_ts_1.createOptHasher)((opts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)))(); +/** MarsupilamiFourteen: reduced 14-round keccak. */ +exports.m14 = (() => (0, utils_ts_1.createOptHasher)((opts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts)))(); +/** + * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. + */ +class KeccakPRG extends sha3_ts_1.Keccak { + constructor(capacity) { + (0, utils_ts_1.anumber)(capacity); + // Rho should be full bytes + if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) + throw new Error('invalid capacity'); + // blockLen = rho in bytes + super((1600 - capacity - 2) / 8, 0, 0, true); + this.rate = 1600 - capacity; + this.posOut = Math.floor((this.rate + 7) / 8); + } + keccak() { + // Duplex padding + this.state[this.pos] ^= 0x01; + this.state[this.blockLen] ^= 0x02; // Rho is full bytes + super.keccak(); + this.pos = 0; + this.posOut = 0; + } + update(data) { + super.update(data); + this.posOut = this.blockLen; + return this; + } + feed(data) { + return this.update(data); + } + finish() { } + digestInto(_out) { + throw new Error('digest is not allowed, use .fetch instead'); + } + fetch(bytes) { + return this.xof(bytes); + } + // Ensure irreversibility (even if state leaked previous outputs cannot be computed) + forget() { + if (this.rate < 1600 / 2 + 1) + throw new Error('rate is too low to use .forget()'); + this.keccak(); + for (let i = 0; i < this.blockLen; i++) + this.state[i] = 0; + this.pos = this.blockLen; + this.keccak(); + this.posOut = this.blockLen; + } + _cloneInto(to) { + const { rate } = this; + to || (to = new KeccakPRG(1600 - rate)); + super._cloneInto(to); + to.rate = rate; + return to; + } + clone() { + return this._cloneInto(); + } +} +exports.KeccakPRG = KeccakPRG; +/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ +const keccakprg = (capacity = 254) => new KeccakPRG(capacity); +exports.keccakprg = keccakprg; +//# sourceMappingURL=sha3-addons.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3-addons.js.map b/node_modules/@noble/hashes/sha3-addons.js.map new file mode 100644 index 0000000..b37cd19 --- /dev/null +++ b/node_modules/@noble/hashes/sha3-addons.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha3-addons.js","sourceRoot":"","sources":["src/sha3-addons.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,uCAAmD;AACnD,yCAYoB;AAEpB,kCAAkC;AAClC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAE1B,oGAAoG;AACpG,4CAA4C;AAC5C,SAAS,UAAU,CAAC,CAAkB;IACpC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACd,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/B,CAAC,KAAK,GAAG,CAAC;IACV,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,GAAG;QAAE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC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CAAC,QAAQ,GAAG,GAAG,EAAa,EAAE,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC;AAAnE,QAAA,SAAS,aAA0D"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3.d.ts b/node_modules/@noble/hashes/sha3.d.ts new file mode 100644 index 0000000..9df47b1 --- /dev/null +++ b/node_modules/@noble/hashes/sha3.d.ts @@ -0,0 +1,53 @@ +import { Hash, type CHash, type CHashXO, type HashXOF, type Input } from './utils.ts'; +/** `keccakf1600` internal function, additionally allows to adjust round count. */ +export declare function keccakP(s: Uint32Array, rounds?: number): void; +/** Keccak sponge function. */ +export declare class Keccak extends Hash implements HashXOF { + protected state: Uint8Array; + protected pos: number; + protected posOut: number; + protected finished: boolean; + protected state32: Uint32Array; + protected destroyed: boolean; + blockLen: number; + suffix: number; + outputLen: number; + protected enableXOF: boolean; + protected rounds: number; + constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number); + clone(): Keccak; + protected keccak(): void; + update(data: Input): this; + protected finish(): void; + protected writeInto(out: Uint8Array): Uint8Array; + xofInto(out: Uint8Array): Uint8Array; + xof(bytes: number): Uint8Array; + digestInto(out: Uint8Array): Uint8Array; + digest(): Uint8Array; + destroy(): void; + _cloneInto(to?: Keccak): Keccak; +} +/** SHA3-224 hash function. */ +export declare const sha3_224: CHash; +/** SHA3-256 hash function. Different from keccak-256. */ +export declare const sha3_256: CHash; +/** SHA3-384 hash function. */ +export declare const sha3_384: CHash; +/** SHA3-512 hash function. */ +export declare const sha3_512: CHash; +/** keccak-224 hash function. */ +export declare const keccak_224: CHash; +/** keccak-256 hash function. Different from SHA3-256. */ +export declare const keccak_256: CHash; +/** keccak-384 hash function. */ +export declare const keccak_384: CHash; +/** keccak-512 hash function. */ +export declare const keccak_512: CHash; +export type ShakeOpts = { + dkLen?: number; +}; +/** SHAKE128 XOF with 128-bit security. */ +export declare const shake128: CHashXO; +/** SHAKE256 XOF with 256-bit security. */ +export declare const shake256: CHashXO; +//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3.d.ts.map b/node_modules/@noble/hashes/sha3.d.ts.map new file mode 100644 index 0000000..979f89d --- /dev/null +++ b/node_modules/@noble/hashes/sha3.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["src/sha3.ts"],"names":[],"mappings":"AAaA,OAAO,EAE6B,IAAI,EAGtC,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EACnD,MAAM,YAAY,CAAC;AAoCpB,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CAyCjE;AAED,8BAA8B;AAC9B,qBAAa,MAAO,SAAQ,IAAI,CAAC,MAAM,CAAE,YAAW,OAAO,CAAC,MAAM,CAAC;IACjE,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC;IAC5B,SAAS,CAAC,GAAG,SAAK;IAClB,SAAS,CAAC,MAAM,SAAK;IACrB,SAAS,CAAC,QAAQ,UAAS;IAC3B,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC;IAC/B,SAAS,CAAC,SAAS,UAAS;IAErB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,SAAS,UAAS;IAC5B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBAIvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,UAAQ,EACjB,MAAM,GAAE,MAAW;IAiBrB,KAAK,IAAI,MAAM;IAGf,SAAS,CAAC,MAAM,IAAI,IAAI;IAOxB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAazB,SAAS,CAAC,MAAM,IAAI,IAAI;IAUxB,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAehD,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAKpC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAI9B,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU;IAOvC,MAAM,IAAI,UAAU;IAGpB,OAAO,IAAI,IAAI;IAIf,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;CAehC;AAKD,8BAA8B;AAC9B,eAAO,MAAM,QAAQ,EAAE,KAAyD,CAAC;AACjF,yDAAyD;AACzD,eAAO,MAAM,QAAQ,EAAE,KAAyD,CAAC;AACjF,8BAA8B;AAC9B,eAAO,MAAM,QAAQ,EAAE,KAAyD,CAAC;AACjF,8BAA8B;AAC9B,eAAO,MAAM,QAAQ,EAAE,KAAwD,CAAC;AAEhF,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,KAAyD,CAAC;AACnF,yDAAyD;AACzD,eAAO,MAAM,UAAU,EAAE,KAAyD,CAAC;AACnF,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,KAAyD,CAAC;AACnF,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,KAAwD,CAAC;AAElF,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAQ3C,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,EAAE,OAAgE,CAAC;AACxF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,EAAE,OAAgE,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3.js b/node_modules/@noble/hashes/sha3.js new file mode 100644 index 0000000..bc61228 --- /dev/null +++ b/node_modules/@noble/hashes/sha3.js @@ -0,0 +1,239 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = void 0; +exports.keccakP = keccakP; +/** + * SHA3 (keccak) hash function, based on a new "Sponge function" design. + * Different from older hashes, the internal state is bigger than output size. + * + * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), + * [Website](https://keccak.team/keccak.html), + * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). + * + * Check out `sha3-addons` module for cSHAKE, k12, and others. + * @module + */ +const _u64_ts_1 = require("./_u64.js"); +// prettier-ignore +const utils_ts_1 = require("./utils.js"); +// No __PURE__ annotations in sha3 header: +// EVERYTHING is in fact used on every export. +// Various per round constants calculations +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const _7n = BigInt(7); +const _256n = BigInt(256); +const _0x71n = BigInt(0x71); +const SHA3_PI = []; +const SHA3_ROTL = []; +const _SHA3_IOTA = []; +for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { + // Pi + [x, y] = [y, (2 * x + 3 * y) % 5]; + SHA3_PI.push(2 * (5 * y + x)); + // Rotational + SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); + // Iota + let t = _0n; + for (let j = 0; j < 7; j++) { + R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; + if (R & _2n) + t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); + } + _SHA3_IOTA.push(t); +} +const IOTAS = (0, _u64_ts_1.split)(_SHA3_IOTA, true); +const SHA3_IOTA_H = IOTAS[0]; +const SHA3_IOTA_L = IOTAS[1]; +// Left rotation (without 0, 32, 64) +const rotlH = (h, l, s) => (s > 32 ? (0, _u64_ts_1.rotlBH)(h, l, s) : (0, _u64_ts_1.rotlSH)(h, l, s)); +const rotlL = (h, l, s) => (s > 32 ? (0, _u64_ts_1.rotlBL)(h, l, s) : (0, _u64_ts_1.rotlSL)(h, l, s)); +/** `keccakf1600` internal function, additionally allows to adjust round count. */ +function keccakP(s, rounds = 24) { + const B = new Uint32Array(5 * 2); + // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) + for (let round = 24 - rounds; round < 24; round++) { + // Theta θ + for (let x = 0; x < 10; x++) + B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; + for (let x = 0; x < 10; x += 2) { + const idx1 = (x + 8) % 10; + const idx0 = (x + 2) % 10; + const B0 = B[idx0]; + const B1 = B[idx0 + 1]; + const Th = rotlH(B0, B1, 1) ^ B[idx1]; + const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; + for (let y = 0; y < 50; y += 10) { + s[x + y] ^= Th; + s[x + y + 1] ^= Tl; + } + } + // Rho (ρ) and Pi (π) + let curH = s[2]; + let curL = s[3]; + for (let t = 0; t < 24; t++) { + const shift = SHA3_ROTL[t]; + const Th = rotlH(curH, curL, shift); + const Tl = rotlL(curH, curL, shift); + const PI = SHA3_PI[t]; + curH = s[PI]; + curL = s[PI + 1]; + s[PI] = Th; + s[PI + 1] = Tl; + } + // Chi (χ) + for (let y = 0; y < 50; y += 10) { + for (let x = 0; x < 10; x++) + B[x] = s[y + x]; + for (let x = 0; x < 10; x++) + s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; + } + // Iota (ι) + s[0] ^= SHA3_IOTA_H[round]; + s[1] ^= SHA3_IOTA_L[round]; + } + (0, utils_ts_1.clean)(B); +} +/** Keccak sponge function. */ +class Keccak extends utils_ts_1.Hash { + // NOTE: we accept arguments in bytes instead of bits here. + constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { + super(); + this.pos = 0; + this.posOut = 0; + this.finished = false; + this.destroyed = false; + this.enableXOF = false; + this.blockLen = blockLen; + this.suffix = suffix; + this.outputLen = outputLen; + this.enableXOF = enableXOF; + this.rounds = rounds; + // Can be passed from user as dkLen + (0, utils_ts_1.anumber)(outputLen); + // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes + // 0 < blockLen < 200 + if (!(0 < blockLen && blockLen < 200)) + throw new Error('only keccak-f1600 function is supported'); + this.state = new Uint8Array(200); + this.state32 = (0, utils_ts_1.u32)(this.state); + } + clone() { + return this._cloneInto(); + } + keccak() { + (0, utils_ts_1.swap32IfBE)(this.state32); + keccakP(this.state32, this.rounds); + (0, utils_ts_1.swap32IfBE)(this.state32); + this.posOut = 0; + this.pos = 0; + } + update(data) { + (0, utils_ts_1.aexists)(this); + data = (0, utils_ts_1.toBytes)(data); + (0, utils_ts_1.abytes)(data); + const { blockLen, state } = this; + const len = data.length; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + for (let i = 0; i < take; i++) + state[this.pos++] ^= data[pos++]; + if (this.pos === blockLen) + this.keccak(); + } + return this; + } + finish() { + if (this.finished) + return; + this.finished = true; + const { state, suffix, pos, blockLen } = this; + // Do the padding + state[pos] ^= suffix; + if ((suffix & 0x80) !== 0 && pos === blockLen - 1) + this.keccak(); + state[blockLen - 1] ^= 0x80; + this.keccak(); + } + writeInto(out) { + (0, utils_ts_1.aexists)(this, false); + (0, utils_ts_1.abytes)(out); + this.finish(); + const bufferOut = this.state; + const { blockLen } = this; + for (let pos = 0, len = out.length; pos < len;) { + if (this.posOut >= blockLen) + this.keccak(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out) { + // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF + if (!this.enableXOF) + throw new Error('XOF is not possible for this instance'); + return this.writeInto(out); + } + xof(bytes) { + (0, utils_ts_1.anumber)(bytes); + return this.xofInto(new Uint8Array(bytes)); + } + digestInto(out) { + (0, utils_ts_1.aoutput)(out, this); + if (this.finished) + throw new Error('digest() was already called'); + this.writeInto(out); + this.destroy(); + return out; + } + digest() { + return this.digestInto(new Uint8Array(this.outputLen)); + } + destroy() { + this.destroyed = true; + (0, utils_ts_1.clean)(this.state); + } + _cloneInto(to) { + const { blockLen, suffix, outputLen, rounds, enableXOF } = this; + to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); + to.state32.set(this.state32); + to.pos = this.pos; + to.posOut = this.posOut; + to.finished = this.finished; + to.rounds = rounds; + // Suffix can change in cSHAKE + to.suffix = suffix; + to.outputLen = outputLen; + to.enableXOF = enableXOF; + to.destroyed = this.destroyed; + return to; + } +} +exports.Keccak = Keccak; +const gen = (suffix, blockLen, outputLen) => (0, utils_ts_1.createHasher)(() => new Keccak(blockLen, suffix, outputLen)); +/** SHA3-224 hash function. */ +exports.sha3_224 = (() => gen(0x06, 144, 224 / 8))(); +/** SHA3-256 hash function. Different from keccak-256. */ +exports.sha3_256 = (() => gen(0x06, 136, 256 / 8))(); +/** SHA3-384 hash function. */ +exports.sha3_384 = (() => gen(0x06, 104, 384 / 8))(); +/** SHA3-512 hash function. */ +exports.sha3_512 = (() => gen(0x06, 72, 512 / 8))(); +/** keccak-224 hash function. */ +exports.keccak_224 = (() => gen(0x01, 144, 224 / 8))(); +/** keccak-256 hash function. Different from SHA3-256. */ +exports.keccak_256 = (() => gen(0x01, 136, 256 / 8))(); +/** keccak-384 hash function. */ +exports.keccak_384 = (() => gen(0x01, 104, 384 / 8))(); +/** keccak-512 hash function. */ +exports.keccak_512 = (() => gen(0x01, 72, 512 / 8))(); +const genShake = (suffix, blockLen, outputLen) => (0, utils_ts_1.createXOFer)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)); +/** SHAKE128 XOF with 128-bit security. */ +exports.shake128 = (() => genShake(0x1f, 168, 128 / 8))(); +/** SHAKE256 XOF with 256-bit security. */ +exports.shake256 = (() => genShake(0x1f, 136, 256 / 8))(); +//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha3.js.map b/node_modules/@noble/hashes/sha3.js.map new file mode 100644 index 0000000..42b47f3 --- /dev/null +++ b/node_modules/@noble/hashes/sha3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha3.js","sourceRoot":"","sources":["src/sha3.ts"],"names":[],"mappings":";;;AAwDA,0BAyCC;AAjGD;;;;;;;;;;GAUG;AACH,uCAAkE;AAClE,kBAAkB;AAClB,yCAMoB;AAEpB,0CAA0C;AAC1C,8CAA8C;AAC9C,2CAA2C;AAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,MAAM,OAAO,GAAa,EAAE,CAAC;AAC7B,MAAM,SAAS,GAAa,EAAE,CAAC;AAC/B,MAAM,UAAU,GAAa,EAAE,CAAC;AAChC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC;IAC/D,KAAK;IACL,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9B,aAAa;IACb,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,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/node_modules/@noble/hashes/sha512.d.ts new file mode 100644 index 0000000..46a27d0 --- /dev/null +++ b/node_modules/@noble/hashes/sha512.d.ts @@ -0,0 +1,26 @@ +/** + * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. + * + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). + * @module + * @deprecated + */ +import { SHA384 as SHA384n, sha384 as sha384n, sha512_224 as sha512_224n, SHA512_224 as SHA512_224n, sha512_256 as sha512_256n, SHA512_256 as SHA512_256n, SHA512 as SHA512n, sha512 as sha512n } from './sha2.ts'; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA512: typeof SHA512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha512: typeof sha512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA384: typeof SHA384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha384: typeof sha384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA512_224: typeof SHA512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha512_224: typeof sha512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const SHA512_256: typeof SHA512_256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export declare const sha512_256: typeof sha512_256n; +//# sourceMappingURL=sha512.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha512.d.ts.map b/node_modules/@noble/hashes/sha512.d.ts.map new file mode 100644 index 0000000..4ed35ec --- /dev/null +++ b/node_modules/@noble/hashes/sha512.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sha512.d.ts","sourceRoot":"","sources":["src/sha512.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,MAAM,IAAI,OAAO,EACjB,MAAM,IAAI,OAAO,EAClB,MAAM,WAAW,CAAC;AACnB,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAO,OAAiB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC;AAC1D,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,OAAO,WAAyB,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha512.js b/node_modules/@noble/hashes/sha512.js new file mode 100644 index 0000000..31cbbca --- /dev/null +++ b/node_modules/@noble/hashes/sha512.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sha512_256 = exports.SHA512_256 = exports.sha512_224 = exports.SHA512_224 = exports.sha384 = exports.SHA384 = exports.sha512 = exports.SHA512 = void 0; +/** + * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. + * + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). + * @module + * @deprecated + */ +const sha2_ts_1 = require("./sha2.js"); +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.SHA512 = sha2_ts_1.SHA512; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.sha512 = sha2_ts_1.sha512; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.SHA384 = sha2_ts_1.SHA384; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.sha384 = sha2_ts_1.sha384; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.SHA512_224 = sha2_ts_1.SHA512_224; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.sha512_224 = sha2_ts_1.sha512_224; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.SHA512_256 = sha2_ts_1.SHA512_256; +/** @deprecated Use import from `noble/hashes/sha2` module */ +exports.sha512_256 = sha2_ts_1.sha512_256; +//# sourceMappingURL=sha512.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/sha512.js.map b/node_modules/@noble/hashes/sha512.js.map new file mode 100644 index 0000000..e685b20 --- /dev/null +++ b/node_modules/@noble/hashes/sha512.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sha512.js","sourceRoot":"","sources":["src/sha512.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCASmB;AACnB,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,MAAM,GAAmB,gBAAO,CAAC;AAC9C,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC;AAC1D,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC;AAC1D,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC;AAC1D,6DAA6D;AAChD,QAAA,UAAU,GAAuB,oBAAW,CAAC"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/src/_assert.ts b/node_modules/@noble/hashes/src/_assert.ts new file mode 100644 index 0000000..3da1eb1 --- /dev/null +++ b/node_modules/@noble/hashes/src/_assert.ts @@ -0,0 +1,22 @@ +/** + * Internal assertion helpers. + * @module + * @deprecated + */ +import { + abytes as ab, + aexists as ae, + anumber as an, + aoutput as ao, + type IHash as H, +} from './utils.ts'; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const abytes: typeof ab = ab; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const aexists: typeof ae = ae; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const anumber: typeof an = an; +/** @deprecated Use import from `noble/hashes/utils` module */ +export const aoutput: typeof ao = ao; +/** @deprecated Use import from `noble/hashes/utils` module */ +export type Hash = H; diff --git a/node_modules/@noble/hashes/src/_blake.ts b/node_modules/@noble/hashes/src/_blake.ts new file mode 100644 index 0000000..2df27be --- /dev/null +++ b/node_modules/@noble/hashes/src/_blake.ts @@ -0,0 +1,50 @@ +/** + * Internal helpers for blake hash. + * @module + */ +import { rotr } from './utils.ts'; + +/** + * Internal blake variable. + * For BLAKE2b, the two extra permutations for rounds 10 and 11 are SIGMA[10..11] = SIGMA[0..1]. + */ +// prettier-ignore +export const BSIGMA: Uint8Array = /* @__PURE__ */ Uint8Array.from([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, + 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, + 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, + 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, + 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, + 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11, + 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10, + 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5, + 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3, + // Blake1, unused in others + 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4, + 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8, + 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13, + 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9, +]); + +// prettier-ignore +export type Num4 = { a: number; b: number; c: number; d: number; }; + +// Mixing function G splitted in two halfs +export function G1s(a: number, b: number, c: number, d: number, x: number): Num4 { + a = (a + b + x) | 0; + d = rotr(d ^ a, 16); + c = (c + d) | 0; + b = rotr(b ^ c, 12); + return { a, b, c, d }; +} + +export function G2s(a: number, b: number, c: number, d: number, x: number): Num4 { + a = (a + b + x) | 0; + d = rotr(d ^ a, 8); + c = (c + d) | 0; + b = rotr(b ^ c, 7); + return { a, b, c, d }; +} diff --git a/node_modules/@noble/hashes/src/_md.ts b/node_modules/@noble/hashes/src/_md.ts new file mode 100644 index 0000000..469b781 --- /dev/null +++ b/node_modules/@noble/hashes/src/_md.ts @@ -0,0 +1,176 @@ +/** + * Internal Merkle-Damgard hash utils. + * @module + */ +import { type Input, Hash, abytes, aexists, aoutput, clean, createView, toBytes } from './utils.ts'; + +/** Polyfill for Safari 14. https://caniuse.com/mdn-javascript_builtins_dataview_setbiguint64 */ +export function setBigUint64( + view: DataView, + byteOffset: number, + value: bigint, + isLE: boolean +): void { + if (typeof view.setBigUint64 === 'function') return view.setBigUint64(byteOffset, value, isLE); + const _32n = BigInt(32); + const _u32_max = BigInt(0xffffffff); + const wh = Number((value >> _32n) & _u32_max); + const wl = Number(value & _u32_max); + const h = isLE ? 4 : 0; + const l = isLE ? 0 : 4; + view.setUint32(byteOffset + h, wh, isLE); + view.setUint32(byteOffset + l, wl, isLE); +} + +/** Choice: a ? b : c */ +export function Chi(a: number, b: number, c: number): number { + return (a & b) ^ (~a & c); +} + +/** Majority function, true if any two inputs is true. */ +export function Maj(a: number, b: number, c: number): number { + return (a & b) ^ (a & c) ^ (b & c); +} + +/** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + */ +export abstract class HashMD> extends Hash { + protected abstract process(buf: DataView, offset: number): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + abstract destroy(): void; + protected abstract roundClean(): void; + + readonly blockLen: number; + readonly outputLen: number; + readonly padOffset: number; + readonly isLE: boolean; + + // For partial updates less than block size + protected buffer: Uint8Array; + protected view: DataView; + protected finished = false; + protected length = 0; + protected pos = 0; + protected destroyed = false; + + constructor(blockLen: number, outputLen: number, padOffset: number, isLE: boolean) { + super(); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data: Input): this { + aexists(this); + data = toBytes(data); + abytes(data); + const { view, buffer, blockLen } = this; + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path: we have at least one block in input, cast it to view and process + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + } + } + this.length += data.length; + this.roundClean(); + return this; + } + digestInto(out: Uint8Array): void { + aexists(this); + aoutput(out, this); + this.finished = true; + // Padding + // We can avoid allocation of buffer for padding completely if it + // was previously not allocated here. But it won't change performance. + const { buffer, view, blockLen, isLE } = this; + let { pos } = this; + // append the bit '1' to the message + buffer[pos++] = 0b10000000; + clean(this.buffer.subarray(pos)); + // we have less than padOffset left in buffer, so we cannot put length in + // current block, need process it and pad again + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + pos = 0; + } + // Pad until full block byte with zeros + for (let i = pos; i < blockLen; i++) buffer[i] = 0; + // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that + // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. + // So we just write lowest 64 bits of that value. + setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); + this.process(view, 0); + const oview = createView(out); + const len = this.outputLen; + // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT + if (len % 4) throw new Error('_sha2: outputLen should be aligned to 32bit'); + const outLen = len / 4; + const state = this.get(); + if (outLen > state.length) throw new Error('_sha2: outputLen bigger than state'); + for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE); + } + digest(): Uint8Array { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to?: T): T { + to ||= new (this.constructor as any)() as T; + to.set(...this.get()); + const { blockLen, buffer, length, finished, destroyed, pos } = this; + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + if (length % blockLen) to.buffer.set(buffer); + return to; + } + clone(): T { + return this._cloneInto(); + } +} + +/** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ + +/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */ +export const SHA256_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, +]); + +/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */ +export const SHA224_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4, +]); + +/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */ +export const SHA384_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ + 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, + 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4, +]); + +/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */ +export const SHA512_IV: Uint32Array = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, +]); diff --git a/node_modules/@noble/hashes/src/_u64.ts b/node_modules/@noble/hashes/src/_u64.ts new file mode 100644 index 0000000..703c7da --- /dev/null +++ b/node_modules/@noble/hashes/src/_u64.ts @@ -0,0 +1,91 @@ +/** + * Internal helpers for u64. BigUint64Array is too slow as per 2025, so we implement it using Uint32Array. + * @todo re-check https://issues.chromium.org/issues/42212588 + * @module + */ +const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); +const _32n = /* @__PURE__ */ BigInt(32); + +function fromBig( + n: bigint, + le = false +): { + h: number; + l: number; +} { + if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; + return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; +} + +function split(lst: bigint[], le = false): Uint32Array[] { + const len = lst.length; + let Ah = new Uint32Array(len); + let Al = new Uint32Array(len); + for (let i = 0; i < len; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; +} + +const toBig = (h: number, l: number): bigint => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); +// for Shift in [0, 32) +const shrSH = (h: number, _l: number, s: number): number => h >>> s; +const shrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s); +// Right rotate for Shift in [1, 32) +const rotrSH = (h: number, l: number, s: number): number => (h >>> s) | (l << (32 - s)); +const rotrSL = (h: number, l: number, s: number): number => (h << (32 - s)) | (l >>> s); +// Right rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotrBH = (h: number, l: number, s: number): number => (h << (64 - s)) | (l >>> (s - 32)); +const rotrBL = (h: number, l: number, s: number): number => (h >>> (s - 32)) | (l << (64 - s)); +// Right rotate for shift===32 (just swaps l&h) +const rotr32H = (_h: number, l: number): number => l; +const rotr32L = (h: number, _l: number): number => h; +// Left rotate for Shift in [1, 32) +const rotlSH = (h: number, l: number, s: number): number => (h << s) | (l >>> (32 - s)); +const rotlSL = (h: number, l: number, s: number): number => (l << s) | (h >>> (32 - s)); +// Left rotate for Shift in (32, 64), NOTE: 32 is special case. +const rotlBH = (h: number, l: number, s: number): number => (l << (s - 32)) | (h >>> (64 - s)); +const rotlBL = (h: number, l: number, s: number): number => (h << (s - 32)) | (l >>> (64 - s)); + +// JS uses 32-bit signed integers for bitwise operations which means we cannot +// simple take carry out of low bit sum by shift, we need to use division. +function add( + Ah: number, + Al: number, + Bh: number, + Bl: number +): { + h: number; + l: number; +} { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; +} +// Addition with more than 2 elements +const add3L = (Al: number, Bl: number, Cl: number): number => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +const add3H = (low: number, Ah: number, Bh: number, Ch: number): number => + (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; +const add4L = (Al: number, Bl: number, Cl: number, Dl: number): number => + (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +const add4H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number): number => + (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; +const add5L = (Al: number, Bl: number, Cl: number, Dl: number, El: number): number => + (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +const add5H = (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number): number => + (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; + +// prettier-ignore +export { + add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, rotlBH, rotlBL, rotlSH, rotlSL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, shrSH, shrSL, split, toBig +}; +// prettier-ignore +const u64: { fromBig: typeof fromBig; split: typeof split; toBig: (h: number, l: number) => bigint; shrSH: (h: number, _l: number, s: number) => number; shrSL: (h: number, l: number, s: number) => number; rotrSH: (h: number, l: number, s: number) => number; rotrSL: (h: number, l: number, s: number) => number; rotrBH: (h: number, l: number, s: number) => number; rotrBL: (h: number, l: number, s: number) => number; rotr32H: (_h: number, l: number) => number; rotr32L: (h: number, _l: number) => number; rotlSH: (h: number, l: number, s: number) => number; rotlSL: (h: number, l: number, s: number) => number; rotlBH: (h: number, l: number, s: number) => number; rotlBL: (h: number, l: number, s: number) => number; add: typeof add; add3L: (Al: number, Bl: number, Cl: number) => number; add3H: (low: number, Ah: number, Bh: number, Ch: number) => number; add4L: (Al: number, Bl: number, Cl: number, Dl: number) => number; add4H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number) => number; add5H: (low: number, Ah: number, Bh: number, Ch: number, Dh: number, Eh: number) => number; add5L: (Al: number, Bl: number, Cl: number, Dl: number, El: number) => number; } = { + fromBig, split, toBig, + shrSH, shrSL, + rotrSH, rotrSL, rotrBH, rotrBL, + rotr32H, rotr32L, + rotlSH, rotlSL, rotlBH, rotlBL, + add, add3L, add3H, add4L, add4H, add5H, add5L, +}; +export default u64; diff --git a/node_modules/@noble/hashes/src/argon2.ts b/node_modules/@noble/hashes/src/argon2.ts new file mode 100644 index 0000000..9bf7a7e --- /dev/null +++ b/node_modules/@noble/hashes/src/argon2.ts @@ -0,0 +1,497 @@ +/** + * Argon2 KDF from RFC 9106. Can be used to create a key from password and salt. + * We suggest to use Scrypt. JS Argon is 2-10x slower than native code because of 64-bitness: + * * argon uses uint64, but JS doesn't have fast uint64array + * * uint64 multiplication is 1/3 of time + * * `P` function would be very nice with u64, because most of value will be in registers, + * hovewer with u32 it will require 32 registers, which is too much. + * * JS arrays do slow bound checks, so reading from `A2_BUF` slows it down + * @module + */ +import { add3H, add3L, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL } from './_u64.ts'; +import { blake2b } from './blake2.ts'; +import { abytes, clean, kdfInputToBytes, nextTick, u32, u8, type KDFInput } from './utils.ts'; + +const AT = { Argond2d: 0, Argon2i: 1, Argon2id: 2 } as const; +type Types = (typeof AT)[keyof typeof AT]; + +const ARGON2_SYNC_POINTS = 4; +const abytesOrZero = (buf?: KDFInput) => { + if (buf === undefined) return Uint8Array.of(); + return kdfInputToBytes(buf); +}; + +// u32 * u32 = u64 +function mul(a: number, b: number) { + const aL = a & 0xffff; + const aH = a >>> 16; + const bL = b & 0xffff; + const bH = b >>> 16; + const ll = Math.imul(aL, bL); + const hl = Math.imul(aH, bL); + const lh = Math.imul(aL, bH); + const hh = Math.imul(aH, bH); + const carry = (ll >>> 16) + (hl & 0xffff) + lh; + const high = (hh + (hl >>> 16) + (carry >>> 16)) | 0; + const low = (carry << 16) | (ll & 0xffff); + return { h: high, l: low }; +} + +function mul2(a: number, b: number) { + // 2 * a * b (via shifts) + const { h, l } = mul(a, b); + return { h: ((h << 1) | (l >>> 31)) & 0xffff_ffff, l: (l << 1) & 0xffff_ffff }; +} + +// BlaMka permutation for Argon2 +// A + B + (2 * u32(A) * u32(B)) +function blamka(Ah: number, Al: number, Bh: number, Bl: number) { + const { h: Ch, l: Cl } = mul2(Al, Bl); + // A + B + (2 * A * B) + const Rll = add3L(Al, Bl, Cl); + return { h: add3H(Rll, Ah, Bh, Ch), l: Rll | 0 }; +} + +// Temporary block buffer +const A2_BUF = new Uint32Array(256); // 1024 bytes (matrix 16x16) + +function G(a: number, b: number, c: number, d: number) { + let Al = A2_BUF[2*a], Ah = A2_BUF[2*a + 1]; // prettier-ignore + let Bl = A2_BUF[2*b], Bh = A2_BUF[2*b + 1]; // prettier-ignore + let Cl = A2_BUF[2*c], Ch = A2_BUF[2*c + 1]; // prettier-ignore + let Dl = A2_BUF[2*d], Dh = A2_BUF[2*d + 1]; // prettier-ignore + + ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: rotr32H(Dh, Dl), Dl: rotr32L(Dh, Dl) }); + + ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: rotrSH(Bh, Bl, 24), Bl: rotrSL(Bh, Bl, 24) }); + + ({ h: Ah, l: Al } = blamka(Ah, Al, Bh, Bl)); + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: rotrSH(Dh, Dl, 16), Dl: rotrSL(Dh, Dl, 16) }); + + ({ h: Ch, l: Cl } = blamka(Ch, Cl, Dh, Dl)); + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: rotrBH(Bh, Bl, 63), Bl: rotrBL(Bh, Bl, 63) }); + + (A2_BUF[2 * a] = Al), (A2_BUF[2 * a + 1] = Ah); + (A2_BUF[2 * b] = Bl), (A2_BUF[2 * b + 1] = Bh); + (A2_BUF[2 * c] = Cl), (A2_BUF[2 * c + 1] = Ch); + (A2_BUF[2 * d] = Dl), (A2_BUF[2 * d + 1] = Dh); +} + +// prettier-ignore +function P( + v00: number, v01: number, v02: number, v03: number, v04: number, v05: number, v06: number, v07: number, + v08: number, v09: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, +) { + G(v00, v04, v08, v12); + G(v01, v05, v09, v13); + G(v02, v06, v10, v14); + G(v03, v07, v11, v15); + G(v00, v05, v10, v15); + G(v01, v06, v11, v12); + G(v02, v07, v08, v13); + G(v03, v04, v09, v14); +} + +function block(x: Uint32Array, xPos: number, yPos: number, outPos: number, needXor: boolean) { + for (let i = 0; i < 256; i++) A2_BUF[i] = x[xPos + i] ^ x[yPos + i]; + // columns (8) + for (let i = 0; i < 128; i += 16) { + // prettier-ignore + P( + i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, + i + 8, i + 9, i + 10, i + 11, i + 12, i + 13, i + 14, i + 15 + ); + } + // rows (8) + for (let i = 0; i < 16; i += 2) { + // prettier-ignore + P( + i, i + 1, i + 16, i + 17, i + 32, i + 33, i + 48, i + 49, + i + 64, i + 65, i + 80, i + 81, i + 96, i + 97, i + 112, i + 113 + ); + } + + if (needXor) for (let i = 0; i < 256; i++) x[outPos + i] ^= A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; + else for (let i = 0; i < 256; i++) x[outPos + i] = A2_BUF[i] ^ x[xPos + i] ^ x[yPos + i]; + clean(A2_BUF); +} + +// Variable-Length Hash Function H' +function Hp(A: Uint32Array, dkLen: number) { + const A8 = u8(A); + const T = new Uint32Array(1); + const T8 = u8(T); + T[0] = dkLen; + // Fast path + if (dkLen <= 64) return blake2b.create({ dkLen }).update(T8).update(A8).digest(); + const out = new Uint8Array(dkLen); + let V = blake2b.create({}).update(T8).update(A8).digest(); + let pos = 0; + // First block + out.set(V.subarray(0, 32)); + pos += 32; + // Rest blocks + for (; dkLen - pos > 64; pos += 32) { + const Vh = blake2b.create({}).update(V); + Vh.digestInto(V); + Vh.destroy(); + out.set(V.subarray(0, 32), pos); + } + // Last block + out.set(blake2b(V, { dkLen: dkLen - pos }), pos); + clean(V, T); + return u32(out); +} + +// Used only inside process block! +function indexAlpha( + r: number, + s: number, + laneLen: number, + segmentLen: number, + index: number, + randL: number, + sameLane: boolean = false +) { + // This is ugly, but close enough to reference implementation. + let area: number; + if (r === 0) { + if (s === 0) area = index - 1; + else if (sameLane) area = s * segmentLen + index - 1; + else area = s * segmentLen + (index == 0 ? -1 : 0); + } else if (sameLane) area = laneLen - segmentLen + index - 1; + else area = laneLen - segmentLen + (index == 0 ? -1 : 0); + const startPos = r !== 0 && s !== ARGON2_SYNC_POINTS - 1 ? (s + 1) * segmentLen : 0; + const rel = area - 1 - mul(area, mul(randL, randL).h).h; + return (startPos + rel) % laneLen; +} + +/** + * Argon2 options. + * * t: time cost, m: mem cost in kb, p: parallelization. + * * key: optional key. personalization: arbitrary extra data. + * * dkLen: desired number of output bytes. + */ +export type ArgonOpts = { + t: number; // Time cost, iterations count + m: number; // Memory cost (in KB) + p: number; // Parallelization parameter + version?: number; // Default: 0x13 (19) + key?: KDFInput; // Optional key + personalization?: KDFInput; // Optional arbitrary extra data + dkLen?: number; // Desired number of returned bytes + asyncTick?: number; // Maximum time in ms for which async function can block execution + maxmem?: number; + onProgress?: (progress: number) => void; +}; + +const maxUint32 = Math.pow(2, 32); +function isU32(num: number) { + return Number.isSafeInteger(num) && num >= 0 && num < maxUint32; +} + +function argon2Opts(opts: ArgonOpts) { + const merged: any = { + version: 0x13, + dkLen: 32, + maxmem: maxUint32 - 1, + asyncTick: 10, + }; + for (let [k, v] of Object.entries(opts)) if (v != null) merged[k] = v; + + const { dkLen, p, m, t, version, onProgress } = merged; + if (!isU32(dkLen) || dkLen < 4) throw new Error('dkLen should be at least 4 bytes'); + if (!isU32(p) || p < 1 || p >= Math.pow(2, 24)) throw new Error('p should be 1 <= p < 2^24'); + if (!isU32(m)) throw new Error('m should be 0 <= m < 2^32'); + if (!isU32(t) || t < 1) throw new Error('t (iterations) should be 1 <= t < 2^32'); + if (onProgress !== undefined && typeof onProgress !== 'function') + throw new Error('progressCb should be function'); + /* + Memory size m MUST be an integer number of kibibytes from 8*p to 2^(32)-1. The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p. + */ + if (!isU32(m) || m < 8 * p) throw new Error('memory should be at least 8*p bytes'); + if (version !== 0x10 && version !== 0x13) throw new Error('unknown version=' + version); + return merged; +} + +function argon2Init(password: KDFInput, salt: KDFInput, type: Types, opts: ArgonOpts) { + password = kdfInputToBytes(password); + salt = kdfInputToBytes(salt); + abytes(password); + abytes(salt); + if (!isU32(password.length)) throw new Error('password should be less than 4 GB'); + if (!isU32(salt.length) || salt.length < 8) + throw new Error('salt should be at least 8 bytes and less than 4 GB'); + if (!Object.values(AT).includes(type)) throw new Error('invalid type'); + let { p, dkLen, m, t, version, key, personalization, maxmem, onProgress, asyncTick } = + argon2Opts(opts); + + // Validation + key = abytesOrZero(key); + personalization = abytesOrZero(personalization); + // H_0 = H^(64)(LE32(p) || LE32(T) || LE32(m) || LE32(t) || + // LE32(v) || LE32(y) || LE32(length(P)) || P || + // LE32(length(S)) || S || LE32(length(K)) || K || + // LE32(length(X)) || X) + const h = blake2b.create({}); + const BUF = new Uint32Array(1); + const BUF8 = u8(BUF); + for (let item of [p, dkLen, m, t, version, type]) { + BUF[0] = item; + h.update(BUF8); + } + for (let i of [password, salt, key, personalization]) { + BUF[0] = i.length; // BUF is u32 array, this is valid + h.update(BUF8).update(i); + } + const H0 = new Uint32Array(18); + const H0_8 = u8(H0); + h.digestInto(H0_8); + // 256 u32 = 1024 (BLOCK_SIZE), fills A2_BUF on processing + + // Params + const lanes = p; + // m' = 4 * p * floor (m / 4p) + const mP = 4 * p * Math.floor(m / (ARGON2_SYNC_POINTS * p)); + //q = m' / p columns + const laneLen = Math.floor(mP / p); + const segmentLen = Math.floor(laneLen / ARGON2_SYNC_POINTS); + const memUsed = mP * 256; + if (!isU32(maxmem) || memUsed > maxmem) + throw new Error( + 'mem should be less than 2**32, got: maxmem=' + maxmem + ', memused=' + memUsed + ); + const B = new Uint32Array(memUsed); + // Fill first blocks + for (let l = 0; l < p; l++) { + const i = 256 * laneLen * l; + // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i)) + H0[17] = l; + H0[16] = 0; + B.set(Hp(H0, 1024), i); + // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i)) + H0[16] = 1; + B.set(Hp(H0, 1024), i + 256); + } + let perBlock = () => {}; + if (onProgress) { + const totalBlock = t * ARGON2_SYNC_POINTS * p * segmentLen; + // Invoke callback if progress changes from 10.01 to 10.02 + // Allows to draw smooth progress bar on up to 8K screen + const callbackPer = Math.max(Math.floor(totalBlock / 10000), 1); + let blockCnt = 0; + perBlock = () => { + blockCnt++; + if (onProgress && (!(blockCnt % callbackPer) || blockCnt === totalBlock)) + onProgress(blockCnt / totalBlock); + }; + } + clean(BUF, H0); + return { type, mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick }; +} + +function argon2Output(B: Uint32Array, p: number, laneLen: number, dkLen: number) { + const B_final = new Uint32Array(256); + for (let l = 0; l < p; l++) + for (let j = 0; j < 256; j++) B_final[j] ^= B[256 * (laneLen * l + laneLen - 1) + j]; + const res = u8(Hp(B_final, dkLen)); + clean(B_final); + return res; +} + +function processBlock( + B: Uint32Array, + address: Uint32Array, + l: number, + r: number, + s: number, + index: number, + laneLen: number, + segmentLen: number, + lanes: number, + offset: number, + prev: number, + dataIndependent: boolean, + needXor: boolean +) { + if (offset % laneLen) prev = offset - 1; + let randL, randH; + if (dataIndependent) { + let i128 = index % 128; + if (i128 === 0) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + randL = address[2 * i128]; + randH = address[2 * i128 + 1]; + } else { + const T = 256 * prev; + randL = B[T]; + randH = B[T + 1]; + } + // address block + const refLane = r === 0 && s === 0 ? l : randH % lanes; + const refPos = indexAlpha(r, s, laneLen, segmentLen, index, randL, refLane == l); + const refBlock = laneLen * refLane + refPos; + // B[i][j] = G(B[i][j-1], B[l][z]) + block(B, 256 * prev, 256 * refBlock, offset * 256, needXor); +} + +function argon2(type: Types, password: KDFInput, salt: KDFInput, opts: ArgonOpts) { + const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock } = argon2Init( + password, + salt, + type, + opts + ); + // Pre-loop setup + // [address, input, zero_block] format so we can pass single U32 to block function + const address = new Uint32Array(3 * 256); + address[256 + 6] = mP; + address[256 + 8] = t; + address[256 + 10] = type; + for (let r = 0; r < t; r++) { + const needXor = r !== 0 && version === 0x13; + address[256 + 0] = r; + for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { + address[256 + 4] = s; + const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); + for (let l = 0; l < p; l++) { + address[256 + 2] = l; + address[256 + 12] = 0; + let startPos = 0; + if (r === 0 && s === 0) { + startPos = 2; + if (dataIndependent) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + } + // current block postion + let offset = l * laneLen + s * segmentLen + startPos; + // previous block position + let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; + for (let index = startPos; index < segmentLen; index++, offset++, prev++) { + perBlock(); + processBlock( + B, + address, + l, + r, + s, + index, + laneLen, + segmentLen, + lanes, + offset, + prev, + dataIndependent, + needXor + ); + } + } + } + } + clean(address); + return argon2Output(B, p, laneLen, dkLen); +} + +/** argon2d GPU-resistant version. */ +export const argon2d = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => + argon2(AT.Argond2d, password, salt, opts); +/** argon2i side-channel-resistant version. */ +export const argon2i = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => + argon2(AT.Argon2i, password, salt, opts); +/** argon2id, combining i+d, the most popular version from RFC 9106 */ +export const argon2id = (password: KDFInput, salt: KDFInput, opts: ArgonOpts): Uint8Array => + argon2(AT.Argon2id, password, salt, opts); + +async function argon2Async(type: Types, password: KDFInput, salt: KDFInput, opts: ArgonOpts) { + const { mP, p, t, version, B, laneLen, lanes, segmentLen, dkLen, perBlock, asyncTick } = + argon2Init(password, salt, type, opts); + // Pre-loop setup + // [address, input, zero_block] format so we can pass single U32 to block function + const address = new Uint32Array(3 * 256); + address[256 + 6] = mP; + address[256 + 8] = t; + address[256 + 10] = type; + let ts = Date.now(); + for (let r = 0; r < t; r++) { + const needXor = r !== 0 && version === 0x13; + address[256 + 0] = r; + for (let s = 0; s < ARGON2_SYNC_POINTS; s++) { + address[256 + 4] = s; + const dataIndependent = type == AT.Argon2i || (type == AT.Argon2id && r === 0 && s < 2); + for (let l = 0; l < p; l++) { + address[256 + 2] = l; + address[256 + 12] = 0; + let startPos = 0; + if (r === 0 && s === 0) { + startPos = 2; + if (dataIndependent) { + address[256 + 12]++; + block(address, 256, 2 * 256, 0, false); + block(address, 0, 2 * 256, 0, false); + } + } + // current block postion + let offset = l * laneLen + s * segmentLen + startPos; + // previous block position + let prev = offset % laneLen ? offset - 1 : offset + laneLen - 1; + for (let index = startPos; index < segmentLen; index++, offset++, prev++) { + perBlock(); + processBlock( + B, + address, + l, + r, + s, + index, + laneLen, + segmentLen, + lanes, + offset, + prev, + dataIndependent, + needXor + ); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (!(diff >= 0 && diff < asyncTick)) { + await nextTick(); + ts += diff; + } + } + } + } + } + clean(address); + return argon2Output(B, p, laneLen, dkLen); +} + +/** argon2d async GPU-resistant version. */ +export const argon2dAsync = ( + password: KDFInput, + salt: KDFInput, + opts: ArgonOpts +): Promise => argon2Async(AT.Argond2d, password, salt, opts); +/** argon2i async side-channel-resistant version. */ +export const argon2iAsync = ( + password: KDFInput, + salt: KDFInput, + opts: ArgonOpts +): Promise => argon2Async(AT.Argon2i, password, salt, opts); +/** argon2id async, combining i+d, the most popular version from RFC 9106 */ +export const argon2idAsync = ( + password: KDFInput, + salt: KDFInput, + opts: ArgonOpts +): Promise => argon2Async(AT.Argon2id, password, salt, opts); diff --git a/node_modules/@noble/hashes/src/blake1.ts b/node_modules/@noble/hashes/src/blake1.ts new file mode 100644 index 0000000..d43ad26 --- /dev/null +++ b/node_modules/@noble/hashes/src/blake1.ts @@ -0,0 +1,534 @@ +/** + * Blake1 legacy hash function, one of SHA3 proposals. + * Rarely used. Check out blake2 or blake3 instead. + * https://www.aumasson.jp/blake/blake.pdf + * + * In the best case, there are 0 allocations. + * + * Differences from blake2: + * + * - BE instead of LE + * - Paddings, similar to MD5, RIPEMD, SHA1, SHA2, but: + * - length flag is located before actual length + * - padding block is compressed differently (no lengths) + * Instead of msg[sigma[k]], we have `msg[sigma[k]] ^ constants[sigma[k-1]]` + * (-1 for g1, g2 without -1) + * - Salt is XOR-ed into constants instead of state + * - Salt is XOR-ed with output in `compress` + * - Additional rows (+64 bytes) in SIGMA for new rounds + * - Different round count: + * - 14 / 10 rounds in blake256 / blake2s + * - 16 / 12 rounds in blake512 / blake2b + * - blake512: G1b: rotr 24 -> 25, G2b: rotr 63 -> 11 + * @module + */ +import { BSIGMA, G1s, G2s } from './_blake.ts'; +import { setBigUint64, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts'; +import * as u64 from './_u64.ts'; +// prettier-ignore +import { + abytes, aexists, aoutput, + clean, createOptHasher, + createView, Hash, toBytes, + type CHashO, type Input, +} from './utils.ts'; + +/** Blake1 options. Basically just "salt" */ +export type BlakeOpts = { + salt?: Uint8Array; +}; + +// Empty zero-filled salt +const EMPTY_SALT = /* @__PURE__ */ new Uint32Array(8); + +abstract class BLAKE1> extends Hash { + protected finished = false; + protected length = 0; + protected pos = 0; + protected destroyed = false; + // For partial updates less than block size + protected buffer: Uint8Array; + protected view: DataView; + protected salt: Uint32Array; + abstract compress(view: DataView, offset: number, withLength?: boolean): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + + readonly blockLen: number; + readonly outputLen: number; + private lengthFlag: number; + private counterLen: number; + protected constants: Uint32Array; + + constructor( + blockLen: number, + outputLen: number, + lengthFlag: number, + counterLen: number, + saltLen: number, + constants: Uint32Array, + opts: BlakeOpts = {} + ) { + super(); + const { salt } = opts; + this.blockLen = blockLen; + this.outputLen = outputLen; + this.lengthFlag = lengthFlag; + this.counterLen = counterLen; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + if (salt) { + let slt = salt; + slt = toBytes(slt); + abytes(slt); + if (slt.length !== 4 * saltLen) throw new Error('wrong salt length'); + const salt32 = (this.salt = new Uint32Array(saltLen)); + const sv = createView(slt); + this.constants = constants.slice(); + for (let i = 0, offset = 0; i < salt32.length; i++, offset += 4) { + salt32[i] = sv.getUint32(offset, false); + this.constants[i] ^= salt32[i]; + } + } else { + this.salt = EMPTY_SALT; + this.constants = constants; + } + } + update(data: Input): this { + aexists(this); + data = toBytes(data); + abytes(data); + // From _md, but update length before each compress + const { view, buffer, blockLen } = this; + const len = data.length; + let dataView; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path: we have at least one block in input, cast it to view and process + if (take === blockLen) { + if (!dataView) dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) { + this.length += blockLen; + this.compress(dataView, pos); + } + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.length += blockLen; + this.compress(view, 0, true); + this.pos = 0; + } + } + return this; + } + destroy(): void { + this.destroyed = true; + if (this.salt !== EMPTY_SALT) { + clean(this.salt, this.constants); + } + } + _cloneInto(to?: T): T { + to ||= new (this.constructor as any)() as T; + to.set(...this.get()); + const { buffer, length, finished, destroyed, constants, salt, pos } = this; + to.buffer.set(buffer); + to.constants = constants.slice(); + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + to.salt = salt.slice(); + return to; + } + clone(): T { + return this._cloneInto(); + } + digestInto(out: Uint8Array): void { + aexists(this); + aoutput(out, this); + this.finished = true; + // Padding + const { buffer, blockLen, counterLen, lengthFlag, view } = this; + clean(buffer.subarray(this.pos)); // clean buf + const counter = BigInt((this.length + this.pos) * 8); + const counterPos = blockLen - counterLen - 1; + buffer[this.pos] |= 0b1000_0000; // End block flag + this.length += this.pos; // add unwritten length + // Not enough in buffer for length: write what we have. + if (this.pos > counterPos) { + this.compress(view, 0); + clean(buffer); + this.pos = 0; + } + // Difference with md: here we have lengthFlag! + buffer[counterPos] |= lengthFlag; // Length flag + // We always set 8 byte length flag. Because length will overflow significantly sooner. + setBigUint64(view, blockLen - 8, counter, false); + this.compress(view, 0, this.pos !== 0); // don't add length if length is not empty block? + // Write output + clean(buffer); + const v = createView(out); + const state = this.get(); + for (let i = 0; i < this.outputLen / 4; ++i) v.setUint32(i * 4, state[i]); + } + digest(): Uint8Array { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } +} + +// Constants +const B64C = /* @__PURE__ */ Uint32Array.from([ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, + 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, + 0x9216d5d9, 0x8979fb1b, 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, + 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, +]); +// first half of C512 +const B32C = B64C.slice(0, 16); + +const B256_IV = SHA256_IV.slice(); +const B224_IV = SHA224_IV.slice(); +const B384_IV = SHA384_IV.slice(); +const B512_IV = SHA512_IV.slice(); + +function generateTBL256() { + const TBL = []; + for (let i = 0, j = 0; i < 14; i++, j += 16) { + for (let offset = 1; offset < 16; offset += 2) { + TBL.push(B32C[BSIGMA[j + offset]]); + TBL.push(B32C[BSIGMA[j + offset - 1]]); + } + } + return new Uint32Array(TBL); +} +const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute + +// Reusable temporary buffer +const BLAKE256_W = /* @__PURE__ */ new Uint32Array(16); + +class Blake1_32 extends BLAKE1 { + private v0: number; + private v1: number; + private v2: number; + private v3: number; + private v4: number; + private v5: number; + private v6: number; + private v7: number; + constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) { + super(64, outputLen, lengthFlag, 8, 4, B32C, opts); + this.v0 = IV[0] | 0; + this.v1 = IV[1] | 0; + this.v2 = IV[2] | 0; + this.v3 = IV[3] | 0; + this.v4 = IV[4] | 0; + this.v5 = IV[5] | 0; + this.v6 = IV[6] | 0; + this.v7 = IV[7] | 0; + } + protected get(): [number, number, number, number, number, number, number, number] { + const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; + return [v0, v1, v2, v3, v4, v5, v6, v7]; + } + // prettier-ignore + protected set( + v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number + ): void { + this.v0 = v0 | 0; + this.v1 = v1 | 0; + this.v2 = v2 | 0; + this.v3 = v3 | 0; + this.v4 = v4 | 0; + this.v5 = v5 | 0; + this.v6 = v6 | 0; + this.v7 = v7 | 0; + } + destroy(): void { + super.destroy(); + this.set(0, 0, 0, 0, 0, 0, 0, 0); + } + compress(view: DataView, offset: number, withLength = true): void { + for (let i = 0; i < 16; i++, offset += 4) BLAKE256_W[i] = view.getUint32(offset, false); + // NOTE: we cannot re-use compress from blake2s, since there is additional xor over u256[SIGMA[e]] + let v00 = this.v0 | 0; + let v01 = this.v1 | 0; + let v02 = this.v2 | 0; + let v03 = this.v3 | 0; + let v04 = this.v4 | 0; + let v05 = this.v5 | 0; + let v06 = this.v6 | 0; + let v07 = this.v7 | 0; + let v08 = this.constants[0] | 0; + let v09 = this.constants[1] | 0; + let v10 = this.constants[2] | 0; + let v11 = this.constants[3] | 0; + const { h, l } = u64.fromBig(BigInt(withLength ? this.length * 8 : 0)); + let v12 = (this.constants[4] ^ l) >>> 0; + let v13 = (this.constants[5] ^ l) >>> 0; + let v14 = (this.constants[6] ^ h) >>> 0; + let v15 = (this.constants[7] ^ h) >>> 0; + // prettier-ignore + for (let i = 0, k = 0, j = 0; i < 14; i++) { + ({ a: v00, b: v04, c: v08, d: v12 } = G1s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v04, c: v08, d: v12 } = G2s(v00, v04, v08, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v05, c: v09, d: v13 } = G1s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v05, c: v09, d: v13 } = G2s(v01, v05, v09, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v06, c: v10, d: v14 } = G1s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v06, c: v10, d: v14 } = G2s(v02, v06, v10, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v07, c: v11, d: v15 } = G1s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v07, c: v11, d: v15 } = G2s(v03, v07, v11, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v05, c: v10, d: v15 } = G1s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v00, b: v05, c: v10, d: v15 } = G2s(v00, v05, v10, v15, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v06, c: v11, d: v12 } = G1s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v01, b: v06, c: v11, d: v12 } = G2s(v01, v06, v11, v12, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v07, c: v08, d: v13 } = G1s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v02, b: v07, c: v08, d: v13 } = G2s(v02, v07, v08, v13, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v04, c: v09, d: v14 } = G1s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + ({ a: v03, b: v04, c: v09, d: v14 } = G2s(v03, v04, v09, v14, BLAKE256_W[BSIGMA[k++]] ^ TBL256[j++])); + } + this.v0 = (this.v0 ^ v00 ^ v08 ^ this.salt[0]) >>> 0; + this.v1 = (this.v1 ^ v01 ^ v09 ^ this.salt[1]) >>> 0; + this.v2 = (this.v2 ^ v02 ^ v10 ^ this.salt[2]) >>> 0; + this.v3 = (this.v3 ^ v03 ^ v11 ^ this.salt[3]) >>> 0; + this.v4 = (this.v4 ^ v04 ^ v12 ^ this.salt[0]) >>> 0; + this.v5 = (this.v5 ^ v05 ^ v13 ^ this.salt[1]) >>> 0; + this.v6 = (this.v6 ^ v06 ^ v14 ^ this.salt[2]) >>> 0; + this.v7 = (this.v7 ^ v07 ^ v15 ^ this.salt[3]) >>> 0; + clean(BLAKE256_W); + } +} + +const BBUF = /* @__PURE__ */ new Uint32Array(32); +const BLAKE512_W = /* @__PURE__ */ new Uint32Array(32); + +function generateTBL512() { + const TBL = []; + for (let r = 0, k = 0; r < 16; r++, k += 16) { + for (let offset = 1; offset < 16; offset += 2) { + TBL.push(B64C[BSIGMA[k + offset] * 2 + 0]); + TBL.push(B64C[BSIGMA[k + offset] * 2 + 1]); + TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 0]); + TBL.push(B64C[BSIGMA[k + offset - 1] * 2 + 1]); + } + } + return new Uint32Array(TBL); +} +const TBL512 = /* @__PURE__ */ generateTBL512(); // C512[SIGMA[X]] precompute + +// Mixing function G splitted in two halfs +function G1b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) { + const Xpos = 2 * BSIGMA[k]; + const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore + let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore + let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore + let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore + let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh) >>> 0; + Al = (ll | 0) >>> 0; + // v[d] = rotr(v[d] ^ v[a], 32) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 25) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 25), Bl: u64.rotrSL(Bh, Bl, 25) }); + (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); + (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); + (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); + (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); +} + +function G2b(a: number, b: number, c: number, d: number, msg: Uint32Array, k: number) { + const Xpos = 2 * BSIGMA[k]; + const Xl = msg[Xpos + 1] ^ TBL512[k * 2 + 1], Xh = msg[Xpos] ^ TBL512[k * 2]; // prettier-ignore + let Al = BBUF[2 * a + 1], Ah = BBUF[2 * a]; // prettier-ignore + let Bl = BBUF[2 * b + 1], Bh = BBUF[2 * b]; // prettier-ignore + let Cl = BBUF[2 * c + 1], Ch = BBUF[2 * c]; // prettier-ignore + let Dl = BBUF[2 * d + 1], Dh = BBUF[2 * d]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 16) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 11) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 11), Bl: u64.rotrSL(Bh, Bl, 11) }); + (BBUF[2 * a + 1] = Al), (BBUF[2 * a] = Ah); + (BBUF[2 * b + 1] = Bl), (BBUF[2 * b] = Bh); + (BBUF[2 * c + 1] = Cl), (BBUF[2 * c] = Ch); + (BBUF[2 * d + 1] = Dl), (BBUF[2 * d] = Dh); +} + +class Blake1_64 extends BLAKE1 { + private v0l: number; + private v0h: number; + private v1l: number; + private v1h: number; + private v2l: number; + private v2h: number; + private v3l: number; + private v3h: number; + private v4l: number; + private v4h: number; + private v5l: number; + private v5h: number; + private v6l: number; + private v6h: number; + private v7l: number; + private v7h: number; + constructor(outputLen: number, IV: Uint32Array, lengthFlag: number, opts: BlakeOpts = {}) { + super(128, outputLen, lengthFlag, 16, 8, B64C, opts); + this.v0l = IV[0] | 0; + this.v0h = IV[1] | 0; + this.v1l = IV[2] | 0; + this.v1h = IV[3] | 0; + this.v2l = IV[4] | 0; + this.v2h = IV[5] | 0; + this.v3l = IV[6] | 0; + this.v3h = IV[7] | 0; + this.v4l = IV[8] | 0; + this.v4h = IV[9] | 0; + this.v5l = IV[10] | 0; + this.v5h = IV[11] | 0; + this.v6l = IV[12] | 0; + this.v6h = IV[13] | 0; + this.v7l = IV[14] | 0; + this.v7h = IV[15] | 0; + } + // prettier-ignore + protected get(): [ + number, number, number, number, number, number, number, number, + number, number, number, number, number, number, number, number + ] { + let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; + return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; + } + // prettier-ignore + protected set( + v0l: number, v0h: number, v1l: number, v1h: number, + v2l: number, v2h: number, v3l: number, v3h: number, + v4l: number, v4h: number, v5l: number, v5h: number, + v6l: number, v6h: number, v7l: number, v7h: number + ): void { + this.v0l = v0l | 0; + this.v0h = v0h | 0; + this.v1l = v1l | 0; + this.v1h = v1h | 0; + this.v2l = v2l | 0; + this.v2h = v2h | 0; + this.v3l = v3l | 0; + this.v3h = v3h | 0; + this.v4l = v4l | 0; + this.v4h = v4h | 0; + this.v5l = v5l | 0; + this.v5h = v5h | 0; + this.v6l = v6l | 0; + this.v6h = v6h | 0; + this.v7l = v7l | 0; + this.v7h = v7h | 0; + } + destroy(): void { + super.destroy(); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + compress(view: DataView, offset: number, withLength = true): void { + for (let i = 0; i < 32; i++, offset += 4) BLAKE512_W[i] = view.getUint32(offset, false); + + this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. + BBUF.set(this.constants.subarray(0, 16), 16); + if (withLength) { + const { h, l } = u64.fromBig(BigInt(this.length * 8)); + BBUF[24] = (BBUF[24] ^ h) >>> 0; + BBUF[25] = (BBUF[25] ^ l) >>> 0; + BBUF[26] = (BBUF[26] ^ h) >>> 0; + BBUF[27] = (BBUF[27] ^ l) >>> 0; + } + for (let i = 0, k = 0; i < 16; i++) { + G1b(0, 4, 8, 12, BLAKE512_W, k++); + G2b(0, 4, 8, 12, BLAKE512_W, k++); + G1b(1, 5, 9, 13, BLAKE512_W, k++); + G2b(1, 5, 9, 13, BLAKE512_W, k++); + G1b(2, 6, 10, 14, BLAKE512_W, k++); + G2b(2, 6, 10, 14, BLAKE512_W, k++); + G1b(3, 7, 11, 15, BLAKE512_W, k++); + G2b(3, 7, 11, 15, BLAKE512_W, k++); + + G1b(0, 5, 10, 15, BLAKE512_W, k++); + G2b(0, 5, 10, 15, BLAKE512_W, k++); + G1b(1, 6, 11, 12, BLAKE512_W, k++); + G2b(1, 6, 11, 12, BLAKE512_W, k++); + G1b(2, 7, 8, 13, BLAKE512_W, k++); + G2b(2, 7, 8, 13, BLAKE512_W, k++); + G1b(3, 4, 9, 14, BLAKE512_W, k++); + G2b(3, 4, 9, 14, BLAKE512_W, k++); + } + this.v0l ^= BBUF[0] ^ BBUF[16] ^ this.salt[0]; + this.v0h ^= BBUF[1] ^ BBUF[17] ^ this.salt[1]; + this.v1l ^= BBUF[2] ^ BBUF[18] ^ this.salt[2]; + this.v1h ^= BBUF[3] ^ BBUF[19] ^ this.salt[3]; + this.v2l ^= BBUF[4] ^ BBUF[20] ^ this.salt[4]; + this.v2h ^= BBUF[5] ^ BBUF[21] ^ this.salt[5]; + this.v3l ^= BBUF[6] ^ BBUF[22] ^ this.salt[6]; + this.v3h ^= BBUF[7] ^ BBUF[23] ^ this.salt[7]; + this.v4l ^= BBUF[8] ^ BBUF[24] ^ this.salt[0]; + this.v4h ^= BBUF[9] ^ BBUF[25] ^ this.salt[1]; + this.v5l ^= BBUF[10] ^ BBUF[26] ^ this.salt[2]; + this.v5h ^= BBUF[11] ^ BBUF[27] ^ this.salt[3]; + this.v6l ^= BBUF[12] ^ BBUF[28] ^ this.salt[4]; + this.v6h ^= BBUF[13] ^ BBUF[29] ^ this.salt[5]; + this.v7l ^= BBUF[14] ^ BBUF[30] ^ this.salt[6]; + this.v7h ^= BBUF[15] ^ BBUF[31] ^ this.salt[7]; + clean(BBUF, BLAKE512_W); + } +} + +export class BLAKE224 extends Blake1_32 { + constructor(opts: BlakeOpts = {}) { + super(28, B224_IV, 0b0000_0000, opts); + } +} +export class BLAKE256 extends Blake1_32 { + constructor(opts: BlakeOpts = {}) { + super(32, B256_IV, 0b0000_0001, opts); + } +} +export class BLAKE384 extends Blake1_64 { + constructor(opts: BlakeOpts = {}) { + super(48, B384_IV, 0b0000_0000, opts); + } +} +export class BLAKE512 extends Blake1_64 { + constructor(opts: BlakeOpts = {}) { + super(64, B512_IV, 0b0000_0001, opts); + } +} +/** blake1-224 hash function */ +export const blake224: CHashO = /* @__PURE__ */ createOptHasher( + (opts) => new BLAKE224(opts) +); +/** blake1-256 hash function */ +export const blake256: CHashO = /* @__PURE__ */ createOptHasher( + (opts) => new BLAKE256(opts) +); +/** blake1-384 hash function */ +export const blake384: CHashO = /* @__PURE__ */ createOptHasher( + (opts) => new BLAKE384(opts) +); +/** blake1-512 hash function */ +export const blake512: CHashO = /* @__PURE__ */ createOptHasher( + (opts) => new BLAKE512(opts) +); diff --git a/node_modules/@noble/hashes/src/blake2.ts b/node_modules/@noble/hashes/src/blake2.ts new file mode 100644 index 0000000..3f8509f --- /dev/null +++ b/node_modules/@noble/hashes/src/blake2.ts @@ -0,0 +1,486 @@ +/** + * blake2b (64-bit) & blake2s (8 to 32-bit) hash functions. + * b could have been faster, but there is no fast u64 in js, so s is 1.5x faster. + * @module + */ +import { BSIGMA, G1s, G2s } from './_blake.ts'; +import { SHA256_IV } from './_md.ts'; +import * as u64 from './_u64.ts'; +// prettier-ignore +import { + abytes, aexists, anumber, aoutput, + clean, createOptHasher, Hash, swap32IfBE, swap8IfBE, toBytes, u32, + type CHashO, type Input +} from './utils.ts'; + +/** Blake hash options. dkLen is output length. key is used in MAC mode. salt is used in KDF mode. */ +export type Blake2Opts = { + dkLen?: number; + key?: Input; + salt?: Input; + personalization?: Input; +}; + +// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc. +const B2B_IV = /* @__PURE__ */ Uint32Array.from([ + 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a, + 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19, +]); +// Temporary buffer +const BBUF = /* @__PURE__ */ new Uint32Array(32); + +// Mixing function G splitted in two halfs +function G1b(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { + // NOTE: V is LE here + const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore + let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore + let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore + let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore + let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 32) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotr32H(Dh, Dl), Dl: u64.rotr32L(Dh, Dl) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 24) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrSH(Bh, Bl, 24), Bl: u64.rotrSL(Bh, Bl, 24) }); + (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); + (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); + (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); + (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); +} + +function G2b(a: number, b: number, c: number, d: number, msg: Uint32Array, x: number) { + // NOTE: V is LE here + const Xl = msg[x], Xh = msg[x + 1]; // prettier-ignore + let Al = BBUF[2 * a], Ah = BBUF[2 * a + 1]; // prettier-ignore + let Bl = BBUF[2 * b], Bh = BBUF[2 * b + 1]; // prettier-ignore + let Cl = BBUF[2 * c], Ch = BBUF[2 * c + 1]; // prettier-ignore + let Dl = BBUF[2 * d], Dh = BBUF[2 * d + 1]; // prettier-ignore + // v[a] = (v[a] + v[b] + x) | 0; + let ll = u64.add3L(Al, Bl, Xl); + Ah = u64.add3H(ll, Ah, Bh, Xh); + Al = ll | 0; + // v[d] = rotr(v[d] ^ v[a], 16) + ({ Dh, Dl } = { Dh: Dh ^ Ah, Dl: Dl ^ Al }); + ({ Dh, Dl } = { Dh: u64.rotrSH(Dh, Dl, 16), Dl: u64.rotrSL(Dh, Dl, 16) }); + // v[c] = (v[c] + v[d]) | 0; + ({ h: Ch, l: Cl } = u64.add(Ch, Cl, Dh, Dl)); + // v[b] = rotr(v[b] ^ v[c], 63) + ({ Bh, Bl } = { Bh: Bh ^ Ch, Bl: Bl ^ Cl }); + ({ Bh, Bl } = { Bh: u64.rotrBH(Bh, Bl, 63), Bl: u64.rotrBL(Bh, Bl, 63) }); + (BBUF[2 * a] = Al), (BBUF[2 * a + 1] = Ah); + (BBUF[2 * b] = Bl), (BBUF[2 * b + 1] = Bh); + (BBUF[2 * c] = Cl), (BBUF[2 * c + 1] = Ch); + (BBUF[2 * d] = Dl), (BBUF[2 * d + 1] = Dh); +} + +function checkBlake2Opts( + outputLen: number, + opts: Blake2Opts | undefined = {}, + keyLen: number, + saltLen: number, + persLen: number +) { + anumber(keyLen); + if (outputLen < 0 || outputLen > keyLen) throw new Error('outputLen bigger than keyLen'); + const { key, salt, personalization } = opts; + if (key !== undefined && (key.length < 1 || key.length > keyLen)) + throw new Error('key length must be undefined or 1..' + keyLen); + if (salt !== undefined && salt.length !== saltLen) + throw new Error('salt must be undefined or ' + saltLen); + if (personalization !== undefined && personalization.length !== persLen) + throw new Error('personalization must be undefined or ' + persLen); +} + +/** Class, from which others are subclassed. */ +export abstract class BLAKE2> extends Hash { + protected abstract compress(msg: Uint32Array, offset: number, isLast: boolean): void; + protected abstract get(): number[]; + protected abstract set(...args: number[]): void; + abstract destroy(): void; + protected buffer: Uint8Array; + protected buffer32: Uint32Array; + protected finished = false; + protected destroyed = false; + protected length: number = 0; + protected pos: number = 0; + readonly blockLen: number; + readonly outputLen: number; + + constructor(blockLen: number, outputLen: number) { + super(); + anumber(blockLen); + anumber(outputLen); + this.blockLen = blockLen; + this.outputLen = outputLen; + this.buffer = new Uint8Array(blockLen); + this.buffer32 = u32(this.buffer); + } + update(data: Input): this { + aexists(this); + data = toBytes(data); + abytes(data); + // Main difference with other hashes: there is flag for last block, + // so we cannot process current block before we know that there + // is the next one. This significantly complicates logic and reduces ability + // to do zero-copy processing + const { blockLen, buffer, buffer32 } = this; + const len = data.length; + const offset = data.byteOffset; + const buf = data.buffer; + for (let pos = 0; pos < len; ) { + // If buffer is full and we still have input (don't process last block, same as blake2s) + if (this.pos === blockLen) { + swap32IfBE(buffer32); + this.compress(buffer32, 0, false); + swap32IfBE(buffer32); + this.pos = 0; + } + const take = Math.min(blockLen - this.pos, len - pos); + const dataOffset = offset + pos; + // full block && aligned to 4 bytes && not last in input + if (take === blockLen && !(dataOffset % 4) && pos + take < len) { + const data32 = new Uint32Array(buf, dataOffset, Math.floor((len - pos) / 4)); + swap32IfBE(data32); + for (let pos32 = 0; pos + blockLen < len; pos32 += buffer32.length, pos += blockLen) { + this.length += blockLen; + this.compress(data32, pos32, false); + } + swap32IfBE(data32); + continue; + } + buffer.set(data.subarray(pos, pos + take), this.pos); + this.pos += take; + this.length += take; + pos += take; + } + return this; + } + digestInto(out: Uint8Array): void { + aexists(this); + aoutput(out, this); + const { pos, buffer32 } = this; + this.finished = true; + // Padding + clean(this.buffer.subarray(pos)); + swap32IfBE(buffer32); + this.compress(buffer32, 0, true); + swap32IfBE(buffer32); + const out32 = u32(out); + this.get().forEach((v, i) => (out32[i] = swap8IfBE(v))); + } + digest(): Uint8Array { + const { buffer, outputLen } = this; + this.digestInto(buffer); + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneInto(to?: T): T { + const { buffer, length, finished, destroyed, outputLen, pos } = this; + to ||= new (this.constructor as any)({ dkLen: outputLen }) as T; + to.set(...this.get()); + to.buffer.set(buffer); + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + // @ts-ignore + to.outputLen = outputLen; + return to; + } + clone(): T { + return this._cloneInto(); + } +} + +export class BLAKE2b extends BLAKE2 { + // Same as SHA-512, but LE + private v0l = B2B_IV[0] | 0; + private v0h = B2B_IV[1] | 0; + private v1l = B2B_IV[2] | 0; + private v1h = B2B_IV[3] | 0; + private v2l = B2B_IV[4] | 0; + private v2h = B2B_IV[5] | 0; + private v3l = B2B_IV[6] | 0; + private v3h = B2B_IV[7] | 0; + private v4l = B2B_IV[8] | 0; + private v4h = B2B_IV[9] | 0; + private v5l = B2B_IV[10] | 0; + private v5h = B2B_IV[11] | 0; + private v6l = B2B_IV[12] | 0; + private v6h = B2B_IV[13] | 0; + private v7l = B2B_IV[14] | 0; + private v7h = B2B_IV[15] | 0; + + constructor(opts: Blake2Opts = {}) { + const olen = opts.dkLen === undefined ? 64 : opts.dkLen; + super(128, olen); + checkBlake2Opts(olen, opts, 64, 16, 16); + let { key, personalization, salt } = opts; + let keyLength = 0; + if (key !== undefined) { + key = toBytes(key); + keyLength = key.length; + } + this.v0l ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); + if (salt !== undefined) { + salt = toBytes(salt); + const slt = u32(salt); + this.v4l ^= swap8IfBE(slt[0]); + this.v4h ^= swap8IfBE(slt[1]); + this.v5l ^= swap8IfBE(slt[2]); + this.v5h ^= swap8IfBE(slt[3]); + } + if (personalization !== undefined) { + personalization = toBytes(personalization); + const pers = u32(personalization); + this.v6l ^= swap8IfBE(pers[0]); + this.v6h ^= swap8IfBE(pers[1]); + this.v7l ^= swap8IfBE(pers[2]); + this.v7h ^= swap8IfBE(pers[3]); + } + if (key !== undefined) { + // Pad to blockLen and update + const tmp = new Uint8Array(this.blockLen); + tmp.set(key); + this.update(tmp); + } + } + // prettier-ignore + protected get(): [ + number, number, number, number, number, number, number, number, + number, number, number, number, number, number, number, number + ] { + let { v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h } = this; + return [v0l, v0h, v1l, v1h, v2l, v2h, v3l, v3h, v4l, v4h, v5l, v5h, v6l, v6h, v7l, v7h]; + } + // prettier-ignore + protected set( + v0l: number, v0h: number, v1l: number, v1h: number, + v2l: number, v2h: number, v3l: number, v3h: number, + v4l: number, v4h: number, v5l: number, v5h: number, + v6l: number, v6h: number, v7l: number, v7h: number + ): void { + this.v0l = v0l | 0; + this.v0h = v0h | 0; + this.v1l = v1l | 0; + this.v1h = v1h | 0; + this.v2l = v2l | 0; + this.v2h = v2h | 0; + this.v3l = v3l | 0; + this.v3h = v3h | 0; + this.v4l = v4l | 0; + this.v4h = v4h | 0; + this.v5l = v5l | 0; + this.v5h = v5h | 0; + this.v6l = v6l | 0; + this.v6h = v6h | 0; + this.v7l = v7l | 0; + this.v7h = v7h | 0; + } + protected compress(msg: Uint32Array, offset: number, isLast: boolean): void { + this.get().forEach((v, i) => (BBUF[i] = v)); // First half from state. + BBUF.set(B2B_IV, 16); // Second half from IV. + let { h, l } = u64.fromBig(BigInt(this.length)); + BBUF[24] = B2B_IV[8] ^ l; // Low word of the offset. + BBUF[25] = B2B_IV[9] ^ h; // High word. + // Invert all bits for last block + if (isLast) { + BBUF[28] = ~BBUF[28]; + BBUF[29] = ~BBUF[29]; + } + let j = 0; + const s = BSIGMA; + for (let i = 0; i < 12; i++) { + G1b(0, 4, 8, 12, msg, offset + 2 * s[j++]); + G2b(0, 4, 8, 12, msg, offset + 2 * s[j++]); + G1b(1, 5, 9, 13, msg, offset + 2 * s[j++]); + G2b(1, 5, 9, 13, msg, offset + 2 * s[j++]); + G1b(2, 6, 10, 14, msg, offset + 2 * s[j++]); + G2b(2, 6, 10, 14, msg, offset + 2 * s[j++]); + G1b(3, 7, 11, 15, msg, offset + 2 * s[j++]); + G2b(3, 7, 11, 15, msg, offset + 2 * s[j++]); + + G1b(0, 5, 10, 15, msg, offset + 2 * s[j++]); + G2b(0, 5, 10, 15, msg, offset + 2 * s[j++]); + G1b(1, 6, 11, 12, msg, offset + 2 * s[j++]); + G2b(1, 6, 11, 12, msg, offset + 2 * s[j++]); + G1b(2, 7, 8, 13, msg, offset + 2 * s[j++]); + G2b(2, 7, 8, 13, msg, offset + 2 * s[j++]); + G1b(3, 4, 9, 14, msg, offset + 2 * s[j++]); + G2b(3, 4, 9, 14, msg, offset + 2 * s[j++]); + } + this.v0l ^= BBUF[0] ^ BBUF[16]; + this.v0h ^= BBUF[1] ^ BBUF[17]; + this.v1l ^= BBUF[2] ^ BBUF[18]; + this.v1h ^= BBUF[3] ^ BBUF[19]; + this.v2l ^= BBUF[4] ^ BBUF[20]; + this.v2h ^= BBUF[5] ^ BBUF[21]; + this.v3l ^= BBUF[6] ^ BBUF[22]; + this.v3h ^= BBUF[7] ^ BBUF[23]; + this.v4l ^= BBUF[8] ^ BBUF[24]; + this.v4h ^= BBUF[9] ^ BBUF[25]; + this.v5l ^= BBUF[10] ^ BBUF[26]; + this.v5h ^= BBUF[11] ^ BBUF[27]; + this.v6l ^= BBUF[12] ^ BBUF[28]; + this.v6h ^= BBUF[13] ^ BBUF[29]; + this.v7l ^= BBUF[14] ^ BBUF[30]; + this.v7h ^= BBUF[15] ^ BBUF[31]; + clean(BBUF); + } + destroy(): void { + this.destroyed = true; + clean(this.buffer32); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +} + +/** + * Blake2b hash function. 64-bit. 1.5x slower than blake2s in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export const blake2b: CHashO = /* @__PURE__ */ createOptHasher( + (opts) => new BLAKE2b(opts) +); + +// ================= +// Blake2S +// ================= + +// prettier-ignore +export type Num16 = { + v0: number; v1: number; v2: number; v3: number; + v4: number; v5: number; v6: number; v7: number; + v8: number; v9: number; v10: number; v11: number; + v12: number; v13: number; v14: number; v15: number; +}; + +// prettier-ignore +export function compress(s: Uint8Array, offset: number, msg: Uint32Array, rounds: number, + v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, + v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, +): Num16 { + let j = 0; + for (let i = 0; i < rounds; i++) { + ({ a: v0, b: v4, c: v8, d: v12 } = G1s(v0, v4, v8, v12, msg[offset + s[j++]])); + ({ a: v0, b: v4, c: v8, d: v12 } = G2s(v0, v4, v8, v12, msg[offset + s[j++]])); + ({ a: v1, b: v5, c: v9, d: v13 } = G1s(v1, v5, v9, v13, msg[offset + s[j++]])); + ({ a: v1, b: v5, c: v9, d: v13 } = G2s(v1, v5, v9, v13, msg[offset + s[j++]])); + ({ a: v2, b: v6, c: v10, d: v14 } = G1s(v2, v6, v10, v14, msg[offset + s[j++]])); + ({ a: v2, b: v6, c: v10, d: v14 } = G2s(v2, v6, v10, v14, msg[offset + s[j++]])); + ({ a: v3, b: v7, c: v11, d: v15 } = G1s(v3, v7, v11, v15, msg[offset + s[j++]])); + ({ a: v3, b: v7, c: v11, d: v15 } = G2s(v3, v7, v11, v15, msg[offset + s[j++]])); + + ({ a: v0, b: v5, c: v10, d: v15 } = G1s(v0, v5, v10, v15, msg[offset + s[j++]])); + ({ a: v0, b: v5, c: v10, d: v15 } = G2s(v0, v5, v10, v15, msg[offset + s[j++]])); + ({ a: v1, b: v6, c: v11, d: v12 } = G1s(v1, v6, v11, v12, msg[offset + s[j++]])); + ({ a: v1, b: v6, c: v11, d: v12 } = G2s(v1, v6, v11, v12, msg[offset + s[j++]])); + ({ a: v2, b: v7, c: v8, d: v13 } = G1s(v2, v7, v8, v13, msg[offset + s[j++]])); + ({ a: v2, b: v7, c: v8, d: v13 } = G2s(v2, v7, v8, v13, msg[offset + s[j++]])); + ({ a: v3, b: v4, c: v9, d: v14 } = G1s(v3, v4, v9, v14, msg[offset + s[j++]])); + ({ a: v3, b: v4, c: v9, d: v14 } = G2s(v3, v4, v9, v14, msg[offset + s[j++]])); + } + return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 }; +} + +const B2S_IV = SHA256_IV; +export class BLAKE2s extends BLAKE2 { + // Internal state, same as SHA-256 + private v0 = B2S_IV[0] | 0; + private v1 = B2S_IV[1] | 0; + private v2 = B2S_IV[2] | 0; + private v3 = B2S_IV[3] | 0; + private v4 = B2S_IV[4] | 0; + private v5 = B2S_IV[5] | 0; + private v6 = B2S_IV[6] | 0; + private v7 = B2S_IV[7] | 0; + + constructor(opts: Blake2Opts = {}) { + const olen = opts.dkLen === undefined ? 32 : opts.dkLen; + super(64, olen); + checkBlake2Opts(olen, opts, 32, 8, 8); + let { key, personalization, salt } = opts; + let keyLength = 0; + if (key !== undefined) { + key = toBytes(key); + keyLength = key.length; + } + this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24); + if (salt !== undefined) { + salt = toBytes(salt); + const slt = u32(salt as Uint8Array); + this.v4 ^= swap8IfBE(slt[0]); + this.v5 ^= swap8IfBE(slt[1]); + } + if (personalization !== undefined) { + personalization = toBytes(personalization); + const pers = u32(personalization as Uint8Array); + this.v6 ^= swap8IfBE(pers[0]); + this.v7 ^= swap8IfBE(pers[1]); + } + if (key !== undefined) { + // Pad to blockLen and update + abytes(key); + const tmp = new Uint8Array(this.blockLen); + tmp.set(key); + this.update(tmp); + } + } + protected get(): [number, number, number, number, number, number, number, number] { + const { v0, v1, v2, v3, v4, v5, v6, v7 } = this; + return [v0, v1, v2, v3, v4, v5, v6, v7]; + } + // prettier-ignore + protected set( + v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number + ): void { + this.v0 = v0 | 0; + this.v1 = v1 | 0; + this.v2 = v2 | 0; + this.v3 = v3 | 0; + this.v4 = v4 | 0; + this.v5 = v5 | 0; + this.v6 = v6 | 0; + this.v7 = v7 | 0; + } + protected compress(msg: Uint32Array, offset: number, isLast: boolean): void { + const { h, l } = u64.fromBig(BigInt(this.length)); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = + compress( + BSIGMA, offset, msg, 10, + this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, + B2S_IV[0], B2S_IV[1], B2S_IV[2], B2S_IV[3], l ^ B2S_IV[4], h ^ B2S_IV[5], isLast ? ~B2S_IV[6] : B2S_IV[6], B2S_IV[7] + ); + this.v0 ^= v0 ^ v8; + this.v1 ^= v1 ^ v9; + this.v2 ^= v2 ^ v10; + this.v3 ^= v3 ^ v11; + this.v4 ^= v4 ^ v12; + this.v5 ^= v5 ^ v13; + this.v6 ^= v6 ^ v14; + this.v7 ^= v7 ^ v15; + } + destroy(): void { + this.destroyed = true; + clean(this.buffer32); + this.set(0, 0, 0, 0, 0, 0, 0, 0); + } +} + +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. 1.5x faster than blake2b in JS. + * @param msg - message that would be hashed + * @param opts - dkLen output length, key for MAC mode, salt, personalization + */ +export const blake2s: CHashO = /* @__PURE__ */ createOptHasher( + (opts) => new BLAKE2s(opts) +); diff --git a/node_modules/@noble/hashes/src/blake2b.ts b/node_modules/@noble/hashes/src/blake2b.ts new file mode 100644 index 0000000..ddfeadf --- /dev/null +++ b/node_modules/@noble/hashes/src/blake2b.ts @@ -0,0 +1,10 @@ +/** + * Blake2b hash function. Focuses on 64-bit platforms, but in JS speed different from Blake2s is negligible. + * @module + * @deprecated + */ +import { BLAKE2b as B2B, blake2b as b2b } from './blake2.ts'; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const BLAKE2b: typeof B2B = B2B; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const blake2b: typeof b2b = b2b; diff --git a/node_modules/@noble/hashes/src/blake2s.ts b/node_modules/@noble/hashes/src/blake2s.ts new file mode 100644 index 0000000..7c753b7 --- /dev/null +++ b/node_modules/@noble/hashes/src/blake2s.ts @@ -0,0 +1,20 @@ +/** + * Blake2s hash function. Focuses on 8-bit to 32-bit platforms. blake2b for 64-bit, but in JS it is slower. + * @module + * @deprecated + */ +import { G1s as G1s_n, G2s as G2s_n } from './_blake.ts'; +import { SHA256_IV } from './_md.ts'; +import { BLAKE2s as B2S, blake2s as b2s, compress as compress_n } from './blake2.ts'; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const B2S_IV: Uint32Array = SHA256_IV; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const G1s: typeof G1s_n = G1s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const G2s: typeof G2s_n = G2s_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const compress: typeof compress_n = compress_n; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const BLAKE2s: typeof B2S = B2S; +/** @deprecated Use import from `noble/hashes/blake2` module */ +export const blake2s: typeof b2s = b2s; diff --git a/node_modules/@noble/hashes/src/blake3.ts b/node_modules/@noble/hashes/src/blake3.ts new file mode 100644 index 0000000..e08395b --- /dev/null +++ b/node_modules/@noble/hashes/src/blake3.ts @@ -0,0 +1,272 @@ +/** + * Blake3 fast hash is Blake2 with reduced security (round count). Can also be used as MAC & KDF. + * + * It is advertised as "the fastest cryptographic hash". However, it isn't true in JS. + * Why is this so slow? While it should be 6x faster than blake2b, perf diff is only 20%: + * + * * There is only 30% reduction in number of rounds from blake2s + * * Speed-up comes from tree structure, which is parallelized using SIMD & threading. + * These features are not present in JS, so we only get overhead from trees. + * * Parallelization only happens on 1024-byte chunks: there is no benefit for small inputs. + * * It is still possible to make it faster using: a) loop unrolling b) web workers c) wasm + * @module + */ +import { SHA256_IV } from './_md.ts'; +import { fromBig } from './_u64.ts'; +import { BLAKE2, compress } from './blake2.ts'; +// prettier-ignore +import { + abytes, aexists, anumber, aoutput, + clean, createXOFer, swap32IfBE, toBytes, u32, u8, + type CHashXO, type HashXOF, type Input +} from './utils.ts'; + +// Flag bitset +const B3_Flags = { + CHUNK_START: 0b1, + CHUNK_END: 0b10, + PARENT: 0b100, + ROOT: 0b1000, + KEYED_HASH: 0b10000, + DERIVE_KEY_CONTEXT: 0b100000, + DERIVE_KEY_MATERIAL: 0b1000000, +} as const; + +const B3_IV = SHA256_IV.slice(); + +const B3_SIGMA: Uint8Array = /* @__PURE__ */ (() => { + const Id = Array.from({ length: 16 }, (_, i) => i); + const permute = (arr: number[]) => + [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]); + const res: number[] = []; + for (let i = 0, v = Id; i < 7; i++, v = permute(v)) res.push(...v); + return Uint8Array.from(res); +})(); + +/** + * Ensure to use EITHER `key` OR `context`, not both. + * + * * `key`: 32-byte MAC key. + * * `context`: string for KDF. Should be hardcoded, globally unique, and application - specific. + * A good default format for the context string is "[application] [commit timestamp] [purpose]". + */ +export type Blake3Opts = { dkLen?: number; key?: Input; context?: Input }; + +/** Blake3 hash. Can be used as MAC and KDF. */ +export class BLAKE3 extends BLAKE2 implements HashXOF { + private chunkPos = 0; // Position of current block in chunk + private chunksDone = 0; // How many chunks we already have + private flags = 0 | 0; + private IV: Uint32Array; + private state: Uint32Array; + private stack: Uint32Array[] = []; + // Output + private posOut = 0; + private bufferOut32 = new Uint32Array(16); + private bufferOut: Uint8Array; + private chunkOut = 0; // index of output chunk + private enableXOF = true; + + constructor(opts: Blake3Opts = {}, flags = 0) { + super(64, opts.dkLen === undefined ? 32 : opts.dkLen); + const { key, context } = opts; + const hasContext = context !== undefined; + if (key !== undefined) { + if (hasContext) throw new Error('Only "key" or "context" can be specified at same time'); + const k = toBytes(key).slice(); + abytes(k, 32); + this.IV = u32(k); + swap32IfBE(this.IV); + this.flags = flags | B3_Flags.KEYED_HASH; + } else if (hasContext) { + const ctx = toBytes(context); + const contextKey = new BLAKE3({ dkLen: 32 }, B3_Flags.DERIVE_KEY_CONTEXT) + .update(ctx) + .digest(); + this.IV = u32(contextKey); + swap32IfBE(this.IV); + this.flags = flags | B3_Flags.DERIVE_KEY_MATERIAL; + } else { + this.IV = B3_IV.slice(); + this.flags = flags; + } + this.state = this.IV.slice(); + this.bufferOut = u8(this.bufferOut32); + } + // Unused + protected get(): [] { + return []; + } + protected set(): void {} + private b2Compress(counter: number, flags: number, buf: Uint32Array, bufPos: number = 0) { + const { state: s, pos } = this; + const { h, l } = fromBig(BigInt(counter), true); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = + compress( + B3_SIGMA, bufPos, buf, 7, + s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], + B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], h, l, pos, flags + ); + s[0] = v0 ^ v8; + s[1] = v1 ^ v9; + s[2] = v2 ^ v10; + s[3] = v3 ^ v11; + s[4] = v4 ^ v12; + s[5] = v5 ^ v13; + s[6] = v6 ^ v14; + s[7] = v7 ^ v15; + } + protected compress(buf: Uint32Array, bufPos: number = 0, isLast: boolean = false): void { + // Compress last block + let flags = this.flags; + if (!this.chunkPos) flags |= B3_Flags.CHUNK_START; + if (this.chunkPos === 15 || isLast) flags |= B3_Flags.CHUNK_END; + if (!isLast) this.pos = this.blockLen; + this.b2Compress(this.chunksDone, flags, buf, bufPos); + this.chunkPos += 1; + // If current block is last in chunk (16 blocks), then compress chunks + if (this.chunkPos === 16 || isLast) { + let chunk = this.state; + this.state = this.IV.slice(); + // If not the last one, compress only when there are trailing zeros in chunk counter + // chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed. + // 1 (001) - leaf not finished (just push current chunk to stack) + // 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back) + // 3 (011) - last leaf not finished + // 4 (100) - leafs finished at depth=1 and depth=2 + for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) { + if (!(last = this.stack.pop())) break; + this.buffer32.set(last, 0); + this.buffer32.set(chunk, 8); + this.pos = this.blockLen; + this.b2Compress(0, this.flags | B3_Flags.PARENT, this.buffer32, 0); + chunk = this.state; + this.state = this.IV.slice(); + } + this.chunksDone++; + this.chunkPos = 0; + this.stack.push(chunk); + } + this.pos = 0; + } + _cloneInto(to?: BLAKE3): BLAKE3 { + to = super._cloneInto(to) as BLAKE3; + const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this; + to.state.set(state.slice()); + to.stack = stack.map((i) => Uint32Array.from(i)); + to.IV.set(IV); + to.flags = flags; + to.chunkPos = chunkPos; + to.chunksDone = chunksDone; + to.posOut = posOut; + to.chunkOut = chunkOut; + to.enableXOF = this.enableXOF; + to.bufferOut32.set(this.bufferOut32); + return to; + } + destroy(): void { + this.destroyed = true; + clean(this.state, this.buffer32, this.IV, this.bufferOut32); + clean(...this.stack); + } + // Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8) + private b2CompressOut() { + const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this; + const { h, l } = fromBig(BigInt(this.chunkOut++)); + swap32IfBE(buffer32); + // prettier-ignore + const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = + compress( + B3_SIGMA, 0, buffer32, 7, + s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], + B3_IV[0], B3_IV[1], B3_IV[2], B3_IV[3], l, h, pos, flags + ); + out32[0] = v0 ^ v8; + out32[1] = v1 ^ v9; + out32[2] = v2 ^ v10; + out32[3] = v3 ^ v11; + out32[4] = v4 ^ v12; + out32[5] = v5 ^ v13; + out32[6] = v6 ^ v14; + out32[7] = v7 ^ v15; + out32[8] = s[0] ^ v8; + out32[9] = s[1] ^ v9; + out32[10] = s[2] ^ v10; + out32[11] = s[3] ^ v11; + out32[12] = s[4] ^ v12; + out32[13] = s[5] ^ v13; + out32[14] = s[6] ^ v14; + out32[15] = s[7] ^ v15; + swap32IfBE(buffer32); + swap32IfBE(out32); + this.posOut = 0; + } + protected finish(): void { + if (this.finished) return; + this.finished = true; + // Padding + clean(this.buffer.subarray(this.pos)); + // Process last chunk + let flags = this.flags | B3_Flags.ROOT; + if (this.stack.length) { + flags |= B3_Flags.PARENT; + swap32IfBE(this.buffer32); + this.compress(this.buffer32, 0, true); + swap32IfBE(this.buffer32); + this.chunksDone = 0; + this.pos = this.blockLen; + } else { + flags |= (!this.chunkPos ? B3_Flags.CHUNK_START : 0) | B3_Flags.CHUNK_END; + } + this.flags = flags; + this.b2CompressOut(); + } + private writeInto(out: Uint8Array) { + aexists(this, false); + abytes(out); + this.finish(); + const { blockLen, bufferOut } = this; + for (let pos = 0, len = out.length; pos < len; ) { + if (this.posOut >= blockLen) this.b2CompressOut(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out: Uint8Array): Uint8Array { + if (!this.enableXOF) throw new Error('XOF is not possible after digest call'); + return this.writeInto(out); + } + xof(bytes: number): Uint8Array { + anumber(bytes); + return this.xofInto(new Uint8Array(bytes)); + } + digestInto(out: Uint8Array): Uint8Array { + aoutput(out, this); + if (this.finished) throw new Error('digest() was already called'); + this.enableXOF = false; + this.writeInto(out); + this.destroy(); + return out; + } + digest(): Uint8Array { + return this.digestInto(new Uint8Array(this.outputLen)); + } +} + +/** + * BLAKE3 hash function. Can be used as MAC and KDF. + * @param msg - message that would be hashed + * @param opts - `dkLen` for output length, `key` for MAC mode, `context` for KDF mode + * @example + * const data = new Uint8Array(32); + * const hash = blake3(data); + * const mac = blake3(data, { key: new Uint8Array(32) }); + * const kdf = blake3(data, { context: 'application name' }); + */ +export const blake3: CHashXO = /* @__PURE__ */ createXOFer( + (opts) => new BLAKE3(opts) +); diff --git a/node_modules/@noble/hashes/src/crypto.ts b/node_modules/@noble/hashes/src/crypto.ts new file mode 100644 index 0000000..61a59cf --- /dev/null +++ b/node_modules/@noble/hashes/src/crypto.ts @@ -0,0 +1,9 @@ +/** + * Internal webcrypto alias. + * We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. + * See utils.ts for details. + * @module + */ +declare const globalThis: Record | undefined; +export const crypto: any = + typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined; diff --git a/node_modules/@noble/hashes/src/cryptoNode.ts b/node_modules/@noble/hashes/src/cryptoNode.ts new file mode 100644 index 0000000..53a3cc7 --- /dev/null +++ b/node_modules/@noble/hashes/src/cryptoNode.ts @@ -0,0 +1,15 @@ +/** + * Internal webcrypto alias. + * We prefer WebCrypto aka globalThis.crypto, which exists in node.js 16+. + * Falls back to Node.js built-in crypto for Node.js <=v14. + * See utils.ts for details. + * @module + */ +// @ts-ignore +import * as nc from 'node:crypto'; +export const crypto: any = + nc && typeof nc === 'object' && 'webcrypto' in nc + ? (nc.webcrypto as any) + : nc && typeof nc === 'object' && 'randomBytes' in nc + ? nc + : undefined; diff --git a/node_modules/@noble/hashes/src/eskdf.ts b/node_modules/@noble/hashes/src/eskdf.ts new file mode 100644 index 0000000..58707d1 --- /dev/null +++ b/node_modules/@noble/hashes/src/eskdf.ts @@ -0,0 +1,187 @@ +/** + * Experimental KDF for AES. + */ +import { hkdf } from './hkdf.ts'; +import { pbkdf2 as _pbkdf2 } from './pbkdf2.ts'; +import { scrypt as _scrypt } from './scrypt.ts'; +import { sha256 } from './sha256.ts'; +import { abytes, bytesToHex, clean, createView, hexToBytes, kdfInputToBytes } from './utils.ts'; + +// A tiny KDF for various applications like AES key-gen. +// Uses HKDF in a non-standard way, so it's not "KDF-secure", only "PRF-secure". +// Which is good enough: assume sha2-256 retained preimage resistance. + +const SCRYPT_FACTOR = 2 ** 19; +const PBKDF2_FACTOR = 2 ** 17; + +// Scrypt KDF +export function scrypt(password: string, salt: string): Uint8Array { + return _scrypt(password, salt, { N: SCRYPT_FACTOR, r: 8, p: 1, dkLen: 32 }); +} + +// PBKDF2-HMAC-SHA256 +export function pbkdf2(password: string, salt: string): Uint8Array { + return _pbkdf2(sha256, password, salt, { c: PBKDF2_FACTOR, dkLen: 32 }); +} + +// Combines two 32-byte byte arrays +function xor32(a: Uint8Array, b: Uint8Array): Uint8Array { + abytes(a, 32); + abytes(b, 32); + const arr = new Uint8Array(32); + for (let i = 0; i < 32; i++) { + arr[i] = a[i] ^ b[i]; + } + return arr; +} + +function strHasLength(str: string, min: number, max: number): boolean { + return typeof str === 'string' && str.length >= min && str.length <= max; +} + +/** + * Derives main seed. Takes a lot of time. Prefer `eskdf` method instead. + */ +export function deriveMainSeed(username: string, password: string): Uint8Array { + if (!strHasLength(username, 8, 255)) throw new Error('invalid username'); + if (!strHasLength(password, 8, 255)) throw new Error('invalid password'); + // Declared like this to throw off minifiers which auto-convert .fromCharCode(1) to actual string. + // String with non-ascii may be problematic in some envs + const codes = { _1: 1, _2: 2 }; + const sep = { s: String.fromCharCode(codes._1), p: String.fromCharCode(codes._2) }; + const scr = scrypt(password + sep.s, username + sep.s); + const pbk = pbkdf2(password + sep.p, username + sep.p); + const res = xor32(scr, pbk); + clean(scr, pbk); + return res; +} + +type AccountID = number | string; + +/** + * Converts protocol & accountId pair to HKDF salt & info params. + */ +function getSaltInfo(protocol: string, accountId: AccountID = 0) { + // Note that length here also repeats two lines below + // We do an additional length check here to reduce the scope of DoS attacks + if (!(strHasLength(protocol, 3, 15) && /^[a-z0-9]{3,15}$/.test(protocol))) { + throw new Error('invalid protocol'); + } + + // Allow string account ids for some protocols + const allowsStr = /^password\d{0,3}|ssh|tor|file$/.test(protocol); + let salt: Uint8Array; // Extract salt. Default is undefined. + if (typeof accountId === 'string') { + if (!allowsStr) throw new Error('accountId must be a number'); + if (!strHasLength(accountId, 1, 255)) + throw new Error('accountId must be string of length 1..255'); + salt = kdfInputToBytes(accountId); + } else if (Number.isSafeInteger(accountId)) { + if (accountId < 0 || accountId > Math.pow(2, 32) - 1) throw new Error('invalid accountId'); + // Convert to Big Endian Uint32 + salt = new Uint8Array(4); + createView(salt).setUint32(0, accountId, false); + } else { + throw new Error('accountId must be a number' + (allowsStr ? ' or string' : '')); + } + const info = kdfInputToBytes(protocol); + return { salt, info }; +} + +type OptsLength = { keyLength: number }; +type OptsMod = { modulus: bigint }; +type KeyOpts = undefined | OptsLength | OptsMod; + +function countBytes(num: bigint): number { + if (typeof num !== 'bigint' || num <= BigInt(128)) throw new Error('invalid number'); + return Math.ceil(num.toString(2).length / 8); +} + +/** + * Parses keyLength and modulus options to extract length of result key. + * If modulus is used, adds 64 bits to it as per FIPS 186 B.4.1 to combat modulo bias. + */ +function getKeyLength(options: KeyOpts): number { + if (!options || typeof options !== 'object') return 32; + const hasLen = 'keyLength' in options; + const hasMod = 'modulus' in options; + if (hasLen && hasMod) throw new Error('cannot combine keyLength and modulus options'); + if (!hasLen && !hasMod) throw new Error('must have either keyLength or modulus option'); + // FIPS 186 B.4.1 requires at least 64 more bits + const l = hasMod ? countBytes(options.modulus) + 8 : options.keyLength; + if (!(typeof l === 'number' && l >= 16 && l <= 8192)) throw new Error('invalid keyLength'); + return l; +} + +/** + * Converts key to bigint and divides it by modulus. Big Endian. + * Implements FIPS 186 B.4.1, which removes 0 and modulo bias from output. + */ +function modReduceKey(key: Uint8Array, modulus: bigint): Uint8Array { + const _1 = BigInt(1); + const num = BigInt('0x' + bytesToHex(key)); // check for ui8a, then bytesToNumber() + const res = (num % (modulus - _1)) + _1; // Remove 0 from output + if (res < _1) throw new Error('expected positive number'); // Guard against bad values + const len = key.length - 8; // FIPS requires 64 more bits = 8 bytes + const hex = res.toString(16).padStart(len * 2, '0'); // numberToHex() + const bytes = hexToBytes(hex); + if (bytes.length !== len) throw new Error('invalid length of result key'); + return bytes; +} + +// We are not using classes because constructor cannot be async +export interface ESKDF { + /** + * Derives a child key. Child key will not be associated with any + * other child key because of properties of underlying KDF. + * + * @param protocol - 3-15 character protocol name + * @param accountId - numeric identifier of account + * @param options - `keyLength: 64` or `modulus: 41920438n` + * @example deriveChildKey('aes', 0) + */ + deriveChildKey: (protocol: string, accountId: AccountID, options?: KeyOpts) => Uint8Array; + /** + * Deletes the main seed from eskdf instance + */ + expire: () => void; + /** + * Account fingerprint + */ + fingerprint: string; +} + +/** + * ESKDF + * @param username - username, email, or identifier, min: 8 characters, should have enough entropy + * @param password - password, min: 8 characters, should have enough entropy + * @example + * const kdf = await eskdf('example-university', 'beginning-new-example'); + * const key = kdf.deriveChildKey('aes', 0); + * console.log(kdf.fingerprint); + * kdf.expire(); + */ +export async function eskdf(username: string, password: string): Promise { + // We are using closure + object instead of class because + // we want to make `seed` non-accessible for any external function. + let seed: Uint8Array | undefined = deriveMainSeed(username, password); + + function deriveCK(protocol: string, accountId: AccountID = 0, options?: KeyOpts): Uint8Array { + abytes(seed, 32); + const { salt, info } = getSaltInfo(protocol, accountId); // validate protocol & accountId + const keyLength = getKeyLength(options); // validate options + const key = hkdf(sha256, seed!, salt, info, keyLength); + // Modulus has already been validated + return options && 'modulus' in options ? modReduceKey(key, options.modulus) : key; + } + function expire() { + if (seed) seed.fill(1); + seed = undefined; + } + // prettier-ignore + const fingerprint = Array.from(deriveCK('fingerprint', 0)) + .slice(0, 6) + .map((char) => char.toString(16).padStart(2, '0').toUpperCase()) + .join(':'); + return Object.freeze({ deriveChildKey: deriveCK, expire, fingerprint }); +} diff --git a/node_modules/@noble/hashes/src/hkdf.ts b/node_modules/@noble/hashes/src/hkdf.ts new file mode 100644 index 0000000..acdc24e --- /dev/null +++ b/node_modules/@noble/hashes/src/hkdf.ts @@ -0,0 +1,88 @@ +/** + * HKDF (RFC 5869): extract + expand in one step. + * See https://soatok.blog/2021/11/17/understanding-hkdf/. + * @module + */ +import { hmac } from './hmac.ts'; +import { ahash, anumber, type CHash, clean, type Input, toBytes } from './utils.ts'; + +/** + * HKDF-extract from spec. Less important part. `HKDF-Extract(IKM, salt) -> PRK` + * Arguments position differs from spec (IKM is first one, since it is not optional) + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + */ +export function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array { + ahash(hash); + // NOTE: some libraries treat zero-length array as 'not provided'; + // we don't, since we have undefined as 'not provided' + // https://github.com/RustCrypto/KDFs/issues/15 + if (salt === undefined) salt = new Uint8Array(hash.outputLen); + return hmac(hash, toBytes(salt), toBytes(ikm)); +} + +const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.from([0]); +const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); + +/** + * HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM` + * @param hash - hash function that would be used (e.g. sha256) + * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + */ +export function expand(hash: CHash, prk: Input, info?: Input, length: number = 32): Uint8Array { + ahash(hash); + anumber(length); + const olen = hash.outputLen; + if (length > 255 * olen) throw new Error('Length should be <= 255*HashLen'); + const blocks = Math.ceil(length / olen); + if (info === undefined) info = EMPTY_BUFFER; + // first L(ength) octets of T + const okm = new Uint8Array(blocks * olen); + // Re-use HMAC instance between blocks + const HMAC = hmac.create(hash, prk); + const HMACTmp = HMAC._cloneInto(); + const T = new Uint8Array(HMAC.outputLen); + for (let counter = 0; counter < blocks; counter++) { + HKDF_COUNTER[0] = counter + 1; + // T(0) = empty string (zero length) + // T(N) = HMAC-Hash(PRK, T(N-1) | info | N) + HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T) + .update(info) + .update(HKDF_COUNTER) + .digestInto(T); + okm.set(T, olen * counter); + HMAC._cloneInto(HMACTmp); + } + HMAC.destroy(); + HMACTmp.destroy(); + clean(T, HKDF_COUNTER); + return okm.slice(0, length); +} + +/** + * HKDF (RFC 5869): derive keys from an initial input. + * Combines hkdf_extract + hkdf_expand in one step + * @param hash - hash function that would be used (e.g. sha256) + * @param ikm - input keying material, the initial key + * @param salt - optional salt value (a non-secret random value) + * @param info - optional context and application specific information (can be a zero-length string) + * @param length - length of output keying material in bytes + * @example + * import { hkdf } from '@noble/hashes/hkdf'; + * import { sha256 } from '@noble/hashes/sha2'; + * import { randomBytes } from '@noble/hashes/utils'; + * const inputKey = randomBytes(32); + * const salt = randomBytes(32); + * const info = 'application-key'; + * const hk1 = hkdf(sha256, inputKey, salt, info, 32); + */ +export const hkdf = ( + hash: CHash, + ikm: Input, + salt: Input | undefined, + info: Input | undefined, + length: number +): Uint8Array => expand(hash, extract(hash, ikm, salt), info, length); diff --git a/node_modules/@noble/hashes/src/hmac.ts b/node_modules/@noble/hashes/src/hmac.ts new file mode 100644 index 0000000..7cf028a --- /dev/null +++ b/node_modules/@noble/hashes/src/hmac.ts @@ -0,0 +1,94 @@ +/** + * HMAC: RFC2104 message authentication code. + * @module + */ +import { abytes, aexists, ahash, clean, Hash, toBytes, type CHash, type Input } from './utils.ts'; + +export class HMAC> extends Hash> { + oHash: T; + iHash: T; + blockLen: number; + outputLen: number; + private finished = false; + private destroyed = false; + + constructor(hash: CHash, _key: Input) { + super(); + ahash(hash); + const key = toBytes(_key); + this.iHash = hash.create() as T; + if (typeof this.iHash.update !== 'function') + throw new Error('Expected instance of class which extends utils.Hash'); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + // blockLen can be bigger than outputLen + pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36; + this.iHash.update(pad); + // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone + this.oHash = hash.create() as T; + // Undo internal XOR && apply outer XOR + for (let i = 0; i < pad.length; i++) pad[i] ^= 0x36 ^ 0x5c; + this.oHash.update(pad); + clean(pad); + } + update(buf: Input): this { + aexists(this); + this.iHash.update(buf); + return this; + } + digestInto(out: Uint8Array): void { + aexists(this); + abytes(out, this.outputLen); + this.finished = true; + this.iHash.digestInto(out); + this.oHash.update(out); + this.oHash.digestInto(out); + this.destroy(); + } + digest(): Uint8Array { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to?: HMAC): HMAC { + // Create new instance without calling constructor since key already in state and we don't know it. + to ||= Object.create(Object.getPrototypeOf(this), {}); + const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; + to = to as this; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + clone(): HMAC { + return this._cloneInto(); + } + destroy(): void { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } +} + +/** + * HMAC: RFC2104 message authentication code. + * @param hash - function that would be used e.g. sha256 + * @param key - message key + * @param message - message data + * @example + * import { hmac } from '@noble/hashes/hmac'; + * import { sha256 } from '@noble/hashes/sha2'; + * const mac1 = hmac(sha256, 'key', 'message'); + */ +export const hmac: { + (hash: CHash, key: Input, message: Input): Uint8Array; + create(hash: CHash, key: Input): HMAC; +} = (hash: CHash, key: Input, message: Input): Uint8Array => + new HMAC(hash, key).update(message).digest(); +hmac.create = (hash: CHash, key: Input) => new HMAC(hash, key); diff --git a/node_modules/@noble/hashes/src/index.ts b/node_modules/@noble/hashes/src/index.ts new file mode 100644 index 0000000..485d762 --- /dev/null +++ b/node_modules/@noble/hashes/src/index.ts @@ -0,0 +1,31 @@ +/** + * Audited & minimal JS implementation of hash functions, MACs and KDFs. Check out individual modules. + * @module + * @example +```js +import { + sha256, sha384, sha512, sha224, sha512_224, sha512_256 +} from '@noble/hashes/sha2'; +import { + sha3_224, sha3_256, sha3_384, sha3_512, + keccak_224, keccak_256, keccak_384, keccak_512, + shake128, shake256 +} from '@noble/hashes/sha3'; +import { + cshake128, cshake256, + turboshake128, turboshake256, + kmac128, kmac256, + tuplehash256, parallelhash256, + k12, m14, keccakprg +} from '@noble/hashes/sha3-addons'; +import { blake3 } from '@noble/hashes/blake3'; +import { blake2b, blake2s } from '@noble/hashes/blake2'; +import { hmac } from '@noble/hashes/hmac'; +import { hkdf } from '@noble/hashes/hkdf'; +import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'; +import { scrypt, scryptAsync } from '@noble/hashes/scrypt'; +import { md5, ripemd160, sha1 } from '@noble/hashes/legacy'; +import * as utils from '@noble/hashes/utils'; +``` + */ +throw new Error('root module cannot be imported: import submodules instead. Check out README'); diff --git a/node_modules/@noble/hashes/src/legacy.ts b/node_modules/@noble/hashes/src/legacy.ts new file mode 100644 index 0000000..47eaddc --- /dev/null +++ b/node_modules/@noble/hashes/src/legacy.ts @@ -0,0 +1,293 @@ +/** + +SHA1 (RFC 3174), MD5 (RFC 1321) and RIPEMD160 (RFC 2286) legacy, weak hash functions. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://datatracker.ietf.org/doc/html/rfc6151 + * @module + */ +import { Chi, HashMD, Maj } from './_md.ts'; +import { type CHash, clean, createHasher, rotl } from './utils.ts'; + +/** Initial SHA1 state */ +const SHA1_IV = /* @__PURE__ */ Uint32Array.from([ + 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, +]); + +// Reusable temporary buffer +const SHA1_W = /* @__PURE__ */ new Uint32Array(80); + +/** SHA1 legacy hash class. */ +export class SHA1 extends HashMD { + private A = SHA1_IV[0] | 0; + private B = SHA1_IV[1] | 0; + private C = SHA1_IV[2] | 0; + private D = SHA1_IV[3] | 0; + private E = SHA1_IV[4] | 0; + + constructor() { + super(64, 20, 8, false); + } + protected get(): [number, number, number, number, number] { + const { A, B, C, D, E } = this; + return [A, B, C, D, E]; + } + protected set(A: number, B: number, C: number, D: number, E: number): void { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + } + protected process(view: DataView, offset: number): void { + for (let i = 0; i < 16; i++, offset += 4) SHA1_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 80; i++) + SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1); + // Compression function main loop, 80 rounds + let { A, B, C, D, E } = this; + for (let i = 0; i < 80; i++) { + let F, K; + if (i < 20) { + F = Chi(B, C, D); + K = 0x5a827999; + } else if (i < 40) { + F = B ^ C ^ D; + K = 0x6ed9eba1; + } else if (i < 60) { + F = Maj(B, C, D); + K = 0x8f1bbcdc; + } else { + F = B ^ C ^ D; + K = 0xca62c1d6; + } + const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0; + E = D; + D = C; + C = rotl(B, 30); + B = A; + A = T; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + this.set(A, B, C, D, E); + } + protected roundClean(): void { + clean(SHA1_W); + } + destroy(): void { + this.set(0, 0, 0, 0, 0); + clean(this.buffer); + } +} + +/** SHA1 (RFC 3174) legacy hash function. It was cryptographically broken. */ +export const sha1: CHash = /* @__PURE__ */ createHasher(() => new SHA1()); + +/** Per-round constants */ +const p32 = /* @__PURE__ */ Math.pow(2, 32); +const K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => + Math.floor(p32 * Math.abs(Math.sin(i + 1))) +); + +/** md5 initial state: same as sha1, but 4 u32 instead of 5. */ +const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4); + +// Reusable temporary buffer +const MD5_W = /* @__PURE__ */ new Uint32Array(16); +/** MD5 legacy hash class. */ +export class MD5 extends HashMD { + private A = MD5_IV[0] | 0; + private B = MD5_IV[1] | 0; + private C = MD5_IV[2] | 0; + private D = MD5_IV[3] | 0; + + constructor() { + super(64, 16, 8, true); + } + protected get(): [number, number, number, number] { + const { A, B, C, D } = this; + return [A, B, C, D]; + } + protected set(A: number, B: number, C: number, D: number): void { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + } + protected process(view: DataView, offset: number): void { + for (let i = 0; i < 16; i++, offset += 4) MD5_W[i] = view.getUint32(offset, true); + // Compression function main loop, 64 rounds + let { A, B, C, D } = this; + for (let i = 0; i < 64; i++) { + let F, g, s; + if (i < 16) { + F = Chi(B, C, D); + g = i; + s = [7, 12, 17, 22]; + } else if (i < 32) { + F = Chi(D, B, C); + g = (5 * i + 1) % 16; + s = [5, 9, 14, 20]; + } else if (i < 48) { + F = B ^ C ^ D; + g = (3 * i + 5) % 16; + s = [4, 11, 16, 23]; + } else { + F = C ^ (B | ~D); + g = (7 * i) % 16; + s = [6, 10, 15, 21]; + } + F = F + A + K[i] + MD5_W[g]; + A = D; + D = C; + C = B; + B = B + rotl(F, s[i % 4]); + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + this.set(A, B, C, D); + } + protected roundClean(): void { + clean(MD5_W); + } + destroy(): void { + this.set(0, 0, 0, 0); + clean(this.buffer); + } +} + +/** + * MD5 (RFC 1321) legacy hash function. It was cryptographically broken. + * MD5 architecture is similar to SHA1, with some differences: + * - Reduced output length: 16 bytes (128 bit) instead of 20 + * - 64 rounds, instead of 80 + * - Little-endian: could be faster, but will require more code + * - Non-linear index selection: huge speed-up for unroll + * - Per round constants: more memory accesses, additional speed-up for unroll + */ +export const md5: CHash = /* @__PURE__ */ createHasher(() => new MD5()); + +// RIPEMD-160 + +const Rho160 = /* @__PURE__ */ Uint8Array.from([ + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, +]); +const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); +const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); +const idxLR = /* @__PURE__ */ (() => { + const L = [Id160]; + const R = [Pi160]; + const res = [L, R]; + for (let i = 0; i < 4; i++) for (let j of res) j.push(j[i].map((k) => Rho160[k])); + return res; +})(); +const idxL = /* @__PURE__ */ (() => idxLR[0])(); +const idxR = /* @__PURE__ */ (() => idxLR[1])(); +// const [idxL, idxR] = idxLR; + +const shifts160 = /* @__PURE__ */ [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], +].map((i) => Uint8Array.from(i)); +const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); +const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); +const Kl160 = /* @__PURE__ */ Uint32Array.from([ + 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, +]); +const Kr160 = /* @__PURE__ */ Uint32Array.from([ + 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, +]); +// It's called f() in spec. +function ripemd_f(group: number, x: number, y: number, z: number): number { + if (group === 0) return x ^ y ^ z; + if (group === 1) return (x & y) | (~x & z); + if (group === 2) return (x | ~y) ^ z; + if (group === 3) return (x & z) | (y & ~z); + return x ^ (y | ~z); +} +// Reusable temporary buffer +const BUF_160 = /* @__PURE__ */ new Uint32Array(16); +export class RIPEMD160 extends HashMD { + private h0 = 0x67452301 | 0; + private h1 = 0xefcdab89 | 0; + private h2 = 0x98badcfe | 0; + private h3 = 0x10325476 | 0; + private h4 = 0xc3d2e1f0 | 0; + + constructor() { + super(64, 20, 8, true); + } + protected get(): [number, number, number, number, number] { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + protected process(view: DataView, offset: number): void { + for (let i = 0; i < 16; i++, offset += 4) BUF_160[i] = view.getUint32(offset, true); + // prettier-ignore + let al = this.h0 | 0, ar = al, + bl = this.h1 | 0, br = bl, + cl = this.h2 | 0, cr = cl, + dl = this.h3 | 0, dr = dl, + el = this.h4 | 0, er = el; + + // Instead of iterating 0 to 80, we split it into 5 groups + // And use the groups in constants, functions, etc. Much simpler + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore + const rl = idxL[group], rr = idxR[group]; // prettier-ignore + const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore + for (let i = 0; i < 16; i++) { + const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; + al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore + } + // 2 loops are 10% faster + for (let i = 0; i < 16; i++) { + const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; + ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore + } + } + // Add the compressed chunk to the current hash value + this.set( + (this.h1 + cl + dr) | 0, + (this.h2 + dl + er) | 0, + (this.h3 + el + ar) | 0, + (this.h4 + al + br) | 0, + (this.h0 + bl + cr) | 0 + ); + } + protected roundClean(): void { + clean(BUF_160); + } + destroy(): void { + this.destroyed = true; + clean(this.buffer); + this.set(0, 0, 0, 0, 0); + } +} + +/** + * RIPEMD-160 - a legacy hash function from 1990s. + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + */ +export const ripemd160: CHash = /* @__PURE__ */ createHasher(() => new RIPEMD160()); diff --git a/node_modules/@noble/hashes/src/pbkdf2.ts b/node_modules/@noble/hashes/src/pbkdf2.ts new file mode 100644 index 0000000..ba2007c --- /dev/null +++ b/node_modules/@noble/hashes/src/pbkdf2.ts @@ -0,0 +1,122 @@ +/** + * PBKDF (RFC 2898). Can be used to create a key from password and salt. + * @module + */ +import { hmac } from './hmac.ts'; +// prettier-ignore +import { + ahash, anumber, + asyncLoop, checkOpts, clean, createView, Hash, kdfInputToBytes, + type CHash, + type KDFInput +} from './utils.ts'; + +export type Pbkdf2Opt = { + c: number; // Iterations + dkLen?: number; // Desired key length in bytes (Intended output length in octets of the derived key + asyncTick?: number; // Maximum time in ms for which async function can block execution +}; +// Common prologue and epilogue for sync/async functions +function pbkdf2Init(hash: CHash, _password: KDFInput, _salt: KDFInput, _opts: Pbkdf2Opt) { + ahash(hash); + const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + anumber(c); + anumber(dkLen); + anumber(asyncTick); + if (c < 1) throw new Error('iterations (c) should be >= 1'); + const password = kdfInputToBytes(_password); + const salt = kdfInputToBytes(_salt); + // DK = PBKDF2(PRF, Password, Salt, c, dkLen); + const DK = new Uint8Array(dkLen); + // U1 = PRF(Password, Salt + INT_32_BE(i)) + const PRF = hmac.create(hash, password); + const PRFSalt = PRF._cloneInto().update(salt); + return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; +} + +function pbkdf2Output>( + PRF: Hash, + PRFSalt: Hash, + DK: Uint8Array, + prfW: Hash, + u: Uint8Array +) { + PRF.destroy(); + PRFSalt.destroy(); + if (prfW) prfW.destroy(); + clean(u); + return DK; +} + +/** + * PBKDF2-HMAC: RFC 2898 key derivation function + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated + * @param salt - cryptographic salt + * @param opts - {c, dkLen} where c is work factor and dkLen is output message size + * @example + * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); + */ +export function pbkdf2( + hash: CHash, + password: KDFInput, + salt: KDFInput, + opts: Pbkdf2Opt +): Uint8Array { + const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW: any; // Working copy + const arr = new Uint8Array(4); + const view = createView(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + for (let ui = 1; ui < c; ui++) { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; + } + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} + +/** + * PBKDF2-HMAC: RFC 2898 key derivation function. Async version. + * @example + * await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 }); + */ +export async function pbkdf2Async( + hash: CHash, + password: KDFInput, + salt: KDFInput, + opts: Pbkdf2Opt +): Promise { + const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); + let prfW: any; // Working copy + const arr = new Uint8Array(4); + const view = createView(arr); + const u = new Uint8Array(PRF.outputLen); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { + // Ti = F(Password, Salt, c, i) + const Ti = DK.subarray(pos, pos + PRF.outputLen); + view.setInt32(0, ti, false); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + await asyncLoop(c - 1, asyncTick, () => { + // Uc = PRF(Password, Uc−1) + PRF._cloneInto(prfW).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) Ti[i] ^= u[i]; + }); + } + return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); +} diff --git a/node_modules/@noble/hashes/src/ripemd160.ts b/node_modules/@noble/hashes/src/ripemd160.ts new file mode 100644 index 0000000..73f72a5 --- /dev/null +++ b/node_modules/@noble/hashes/src/ripemd160.ts @@ -0,0 +1,12 @@ +/** + * RIPEMD-160 legacy hash function. + * https://homes.esat.kuleuven.be/~bosselae/ripemd160.html + * https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf + * @module + * @deprecated + */ +import { RIPEMD160 as RIPEMD160n, ripemd160 as ripemd160n } from './legacy.ts'; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const RIPEMD160: typeof RIPEMD160n = RIPEMD160n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const ripemd160: typeof ripemd160n = ripemd160n; diff --git a/node_modules/@noble/hashes/src/scrypt.ts b/node_modules/@noble/hashes/src/scrypt.ts new file mode 100644 index 0000000..143054e --- /dev/null +++ b/node_modules/@noble/hashes/src/scrypt.ts @@ -0,0 +1,257 @@ +/** + * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. + * @module + */ +import { pbkdf2 } from './pbkdf2.ts'; +import { sha256 } from './sha2.ts'; +// prettier-ignore +import { + anumber, asyncLoop, + checkOpts, clean, + type KDFInput, rotl, + swap32IfBE, + u32 +} from './utils.ts'; + +// The main Scrypt loop: uses Salsa extensively. +// Six versions of the function were tried, this is the fastest one. +// prettier-ignore +function XorAndSalsa( + prev: Uint32Array, + pi: number, + input: Uint32Array, + ii: number, + out: Uint32Array, + oi: number +) { + // Based on https://cr.yp.to/salsa20.html + // Xor blocks + let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; + let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; + let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; + let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; + let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; + let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; + let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; + let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; + // Save state to temporary variables (salsa) + let x00 = y00, x01 = y01, x02 = y02, x03 = y03, + x04 = y04, x05 = y05, x06 = y06, x07 = y07, + x08 = y08, x09 = y09, x10 = y10, x11 = y11, + x12 = y12, x13 = y13, x14 = y14, x15 = y15; + // Main loop (salsa) + for (let i = 0; i < 8; i += 2) { + x04 ^= rotl(x00 + x12 | 0, 7); x08 ^= rotl(x04 + x00 | 0, 9); + x12 ^= rotl(x08 + x04 | 0, 13); x00 ^= rotl(x12 + x08 | 0, 18); + x09 ^= rotl(x05 + x01 | 0, 7); x13 ^= rotl(x09 + x05 | 0, 9); + x01 ^= rotl(x13 + x09 | 0, 13); x05 ^= rotl(x01 + x13 | 0, 18); + x14 ^= rotl(x10 + x06 | 0, 7); x02 ^= rotl(x14 + x10 | 0, 9); + x06 ^= rotl(x02 + x14 | 0, 13); x10 ^= rotl(x06 + x02 | 0, 18); + x03 ^= rotl(x15 + x11 | 0, 7); x07 ^= rotl(x03 + x15 | 0, 9); + x11 ^= rotl(x07 + x03 | 0, 13); x15 ^= rotl(x11 + x07 | 0, 18); + x01 ^= rotl(x00 + x03 | 0, 7); x02 ^= rotl(x01 + x00 | 0, 9); + x03 ^= rotl(x02 + x01 | 0, 13); x00 ^= rotl(x03 + x02 | 0, 18); + x06 ^= rotl(x05 + x04 | 0, 7); x07 ^= rotl(x06 + x05 | 0, 9); + x04 ^= rotl(x07 + x06 | 0, 13); x05 ^= rotl(x04 + x07 | 0, 18); + x11 ^= rotl(x10 + x09 | 0, 7); x08 ^= rotl(x11 + x10 | 0, 9); + x09 ^= rotl(x08 + x11 | 0, 13); x10 ^= rotl(x09 + x08 | 0, 18); + x12 ^= rotl(x15 + x14 | 0, 7); x13 ^= rotl(x12 + x15 | 0, 9); + x14 ^= rotl(x13 + x12 | 0, 13); x15 ^= rotl(x14 + x13 | 0, 18); + } + // Write output (salsa) + out[oi++] = (y00 + x00) | 0; out[oi++] = (y01 + x01) | 0; + out[oi++] = (y02 + x02) | 0; out[oi++] = (y03 + x03) | 0; + out[oi++] = (y04 + x04) | 0; out[oi++] = (y05 + x05) | 0; + out[oi++] = (y06 + x06) | 0; out[oi++] = (y07 + x07) | 0; + out[oi++] = (y08 + x08) | 0; out[oi++] = (y09 + x09) | 0; + out[oi++] = (y10 + x10) | 0; out[oi++] = (y11 + x11) | 0; + out[oi++] = (y12 + x12) | 0; out[oi++] = (y13 + x13) | 0; + out[oi++] = (y14 + x14) | 0; out[oi++] = (y15 + x15) | 0; +} + +function BlockMix(input: Uint32Array, ii: number, out: Uint32Array, oi: number, r: number) { + // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) + let head = oi + 0; + let tail = oi + 16 * r; + for (let i = 0; i < 16; i++) out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] + for (let i = 0; i < r; i++, head += 16, ii += 16) { + // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 + XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) + if (i > 0) tail += 16; // First iteration overwrites tmp value in tail + XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) + } +} + +export type ScryptOpts = { + N: number; // cost factor + r: number; // block size + p: number; // parallelization + dkLen?: number; // key length + asyncTick?: number; // block execution max time + maxmem?: number; + onProgress?: (progress: number) => void; +}; + +// Common prologue and epilogue for sync/async functions +function scryptInit(password: KDFInput, salt: KDFInput, _opts?: ScryptOpts) { + // Maxmem - 1GB+1KB by default + const opts = checkOpts( + { + dkLen: 32, + asyncTick: 10, + maxmem: 1024 ** 3 + 1024, + }, + _opts + ); + const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; + anumber(N); + anumber(r); + anumber(p); + anumber(dkLen); + anumber(asyncTick); + anumber(maxmem); + if (onProgress !== undefined && typeof onProgress !== 'function') + throw new Error('progressCb should be function'); + const blockSize = 128 * r; + const blockSize32 = blockSize / 4; + + // Max N is 2^32 (Integrify is 32-bit). Real limit is 2^22: JS engines Uint8Array limit is 4GB in 2024. + // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, + // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: + // https://www.rfc-editor.org/errata_search.php?rfc=7914 + const pow32 = Math.pow(2, 32); + if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) { + throw new Error('Scrypt: N must be larger than 1, a power of 2, and less than 2^32'); + } + if (p < 0 || p > ((pow32 - 1) * 32) / blockSize) { + throw new Error( + 'Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)' + ); + } + if (dkLen < 0 || dkLen > (pow32 - 1) * 32) { + throw new Error( + 'Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32' + ); + } + const memUsed = blockSize * (N + p); + if (memUsed > maxmem) { + throw new Error( + 'Scrypt: memused is bigger than maxMem. Expected 128 * r * (N + p) > maxmem of ' + maxmem + ); + } + // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) + // Since it has only one iteration there is no reason to use async variant + const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p }); + const B32 = u32(B); + // Re-used between parallel iterations. Array(iterations) of B + const V = u32(new Uint8Array(blockSize * N)); + const tmp = u32(new Uint8Array(blockSize)); + let blockMixCb = () => {}; + if (onProgress) { + const totalBlockMix = 2 * N * p; + // Invoke callback if progress changes from 10.01 to 10.02 + // Allows to draw smooth progress bar on up to 8K screen + const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); + let blockMixCnt = 0; + blockMixCb = () => { + blockMixCnt++; + if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) + onProgress(blockMixCnt / totalBlockMix); + }; + } + return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; +} + +function scryptOutput( + password: KDFInput, + dkLen: number, + B: Uint8Array, + V: Uint32Array, + tmp: Uint32Array +) { + const res = pbkdf2(sha256, password, B, { c: 1, dkLen }); + clean(B, V, tmp); + return res; +} + +/** + * Scrypt KDF from RFC 7914. + * @param password - pass + * @param salt - salt + * @param opts - parameters + * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) + * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance + * - `p` is parallelization factor (1 is common) + * - `dkLen` is output key length in bytes e.g. 32. + * - `asyncTick` - (default: 10) max time in ms for which async function can block execution + * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt + * - `onProgress` - callback function that would be executed for progress report + * @returns Derived key + * @example + * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export function scrypt(password: KDFInput, salt: KDFInput, opts: ScryptOpts): Uint8Array { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit( + password, + salt, + opts + ); + swap32IfBE(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] + for (let i = 0, pos = 0; i < N - 1; i++) { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + } + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + for (let i = 0; i < N; i++) { + // First u32 of the last 64-byte block (u32 is LE) + const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + } + } + swap32IfBE(B32); + return scryptOutput(password, dkLen, B, V, tmp); +} + +/** + * Scrypt KDF from RFC 7914. Async version. + * @example + * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + */ +export async function scryptAsync( + password: KDFInput, + salt: KDFInput, + opts: ScryptOpts +): Promise { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit( + password, + salt, + opts + ); + swap32IfBE(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) V[i] = B32[Pi + i]; // V[0] = B[i] + let pos = 0; + await asyncLoop(N - 1, asyncTick, () => { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + }); + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + await asyncLoop(N, asyncTick, () => { + // First u32 of the last 64-byte block (u32 is LE) + const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + for (let k = 0; k < blockSize32; k++) tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + }); + } + swap32IfBE(B32); + return scryptOutput(password, dkLen, B, V, tmp); +} diff --git a/node_modules/@noble/hashes/src/sha1.ts b/node_modules/@noble/hashes/src/sha1.ts new file mode 100644 index 0000000..9a18822 --- /dev/null +++ b/node_modules/@noble/hashes/src/sha1.ts @@ -0,0 +1,10 @@ +/** + * SHA1 (RFC 3174) legacy hash function. + * @module + * @deprecated + */ +import { SHA1 as SHA1n, sha1 as sha1n } from './legacy.ts'; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const SHA1: typeof SHA1n = SHA1n; +/** @deprecated Use import from `noble/hashes/legacy` module */ +export const sha1: typeof sha1n = sha1n; diff --git a/node_modules/@noble/hashes/src/sha2.ts b/node_modules/@noble/hashes/src/sha2.ts new file mode 100644 index 0000000..7f1e722 --- /dev/null +++ b/node_modules/@noble/hashes/src/sha2.ts @@ -0,0 +1,402 @@ +/** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + */ +import { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from './_md.ts'; +import * as u64 from './_u64.ts'; +import { type CHash, clean, createHasher, rotr } from './utils.ts'; + +/** + * Round constants: + * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311) + */ +// prettier-ignore +const SHA256_K = /* @__PURE__ */ Uint32Array.from([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +]); + +/** Reusable temporary buffer. "W" comes straight from spec. */ +const SHA256_W = /* @__PURE__ */ new Uint32Array(64); +export class SHA256 extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + protected A: number = SHA256_IV[0] | 0; + protected B: number = SHA256_IV[1] | 0; + protected C: number = SHA256_IV[2] | 0; + protected D: number = SHA256_IV[3] | 0; + protected E: number = SHA256_IV[4] | 0; + protected F: number = SHA256_IV[5] | 0; + protected G: number = SHA256_IV[6] | 0; + protected H: number = SHA256_IV[7] | 0; + + constructor(outputLen: number = 32) { + super(64, outputLen, 8, false); + } + protected get(): [number, number, number, number, number, number, number, number] { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + // prettier-ignore + protected set( + A: number, B: number, C: number, D: number, E: number, F: number, G: number, H: number + ): void { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + protected process(view: DataView, offset: number): void { + // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); + SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; + } + // Compression function main loop, 64 rounds + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); + const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); + const T2 = (sigma0 + Maj(A, B, C)) | 0; + H = G; + G = F; + F = E; + E = (D + T1) | 0; + D = C; + C = B; + B = A; + A = (T1 + T2) | 0; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + F = (F + this.F) | 0; + G = (G + this.G) | 0; + H = (H + this.H) | 0; + this.set(A, B, C, D, E, F, G, H); + } + protected roundClean(): void { + clean(SHA256_W); + } + destroy(): void { + this.set(0, 0, 0, 0, 0, 0, 0, 0); + clean(this.buffer); + } +} + +export class SHA224 extends SHA256 { + protected A: number = SHA224_IV[0] | 0; + protected B: number = SHA224_IV[1] | 0; + protected C: number = SHA224_IV[2] | 0; + protected D: number = SHA224_IV[3] | 0; + protected E: number = SHA224_IV[4] | 0; + protected F: number = SHA224_IV[5] | 0; + protected G: number = SHA224_IV[6] | 0; + protected H: number = SHA224_IV[7] | 0; + constructor() { + super(28); + } +} + +// SHA2-512 is slower than sha256 in js because u64 operations are slow. + +// Round contants +// First 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409 +// prettier-ignore +const K512 = /* @__PURE__ */ (() => u64.split([ + '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', + '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', + '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', + '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', + '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', + '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', + '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', + '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', + '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', + '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', + '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', + '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', + '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', + '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', + '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', + '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', + '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', + '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', + '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', + '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' +].map(n => BigInt(n))))(); +const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); +const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); + +// Reusable temporary buffers +const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); +const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); + +export class SHA512 extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // h -- high 32 bits, l -- low 32 bits + protected Ah: number = SHA512_IV[0] | 0; + protected Al: number = SHA512_IV[1] | 0; + protected Bh: number = SHA512_IV[2] | 0; + protected Bl: number = SHA512_IV[3] | 0; + protected Ch: number = SHA512_IV[4] | 0; + protected Cl: number = SHA512_IV[5] | 0; + protected Dh: number = SHA512_IV[6] | 0; + protected Dl: number = SHA512_IV[7] | 0; + protected Eh: number = SHA512_IV[8] | 0; + protected El: number = SHA512_IV[9] | 0; + protected Fh: number = SHA512_IV[10] | 0; + protected Fl: number = SHA512_IV[11] | 0; + protected Gh: number = SHA512_IV[12] | 0; + protected Gl: number = SHA512_IV[13] | 0; + protected Hh: number = SHA512_IV[14] | 0; + protected Hl: number = SHA512_IV[15] | 0; + + constructor(outputLen: number = 64) { + super(128, outputLen, 16, false); + } + // prettier-ignore + protected get(): [ + number, number, number, number, number, number, number, number, + number, number, number, number, number, number, number, number + ] { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + // prettier-ignore + protected set( + Ah: number, Al: number, Bh: number, Bl: number, Ch: number, Cl: number, Dh: number, Dl: number, + Eh: number, El: number, Fh: number, Fl: number, Gh: number, Gl: number, Hh: number, Hl: number + ): void { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + protected process(view: DataView, offset: number): void { + // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H[i] = view.getUint32(offset); + SHA512_W_L[i] = view.getUint32((offset += 4)); + } + for (let i = 16; i < 80; i++) { + // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) + const W15h = SHA512_W_H[i - 15] | 0; + const W15l = SHA512_W_L[i - 15] | 0; + const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7); + const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7); + // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) + const W2h = SHA512_W_H[i - 2] | 0; + const W2l = SHA512_W_L[i - 2] | 0; + const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6); + const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6); + // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; + const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + SHA512_W_H[i] = SUMh | 0; + SHA512_W_L[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + // Compression function main loop, 80 rounds + for (let i = 0; i < 80; i++) { + // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) + const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41); + const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41); + //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const CHIh = (Eh & Fh) ^ (~Eh & Gh); + const CHIl = (El & Fl) ^ (~El & Gl); + // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] + // prettier-ignore + const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1l = T1ll | 0; + // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) + const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39); + const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39); + const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); + const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = u64.add3L(T1l, sigma0l, MAJl); + Ah = u64.add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + // Add the compressed chunk to the current hash value + ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + protected roundClean(): void { + clean(SHA512_W_H, SHA512_W_L); + } + destroy(): void { + clean(this.buffer); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } +} + +export class SHA384 extends SHA512 { + protected Ah: number = SHA384_IV[0] | 0; + protected Al: number = SHA384_IV[1] | 0; + protected Bh: number = SHA384_IV[2] | 0; + protected Bl: number = SHA384_IV[3] | 0; + protected Ch: number = SHA384_IV[4] | 0; + protected Cl: number = SHA384_IV[5] | 0; + protected Dh: number = SHA384_IV[6] | 0; + protected Dl: number = SHA384_IV[7] | 0; + protected Eh: number = SHA384_IV[8] | 0; + protected El: number = SHA384_IV[9] | 0; + protected Fh: number = SHA384_IV[10] | 0; + protected Fl: number = SHA384_IV[11] | 0; + protected Gh: number = SHA384_IV[12] | 0; + protected Gl: number = SHA384_IV[13] | 0; + protected Hh: number = SHA384_IV[14] | 0; + protected Hl: number = SHA384_IV[15] | 0; + + constructor() { + super(48); + } +} + +/** + * Truncated SHA512/256 and SHA512/224. + * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as "intermediary" IV of SHA512/t. + * Then t hashes string to produce result IV. + * See `test/misc/sha2-gen-iv.js`. + */ + +/** SHA512/224 IV */ +const T224_IV = /* @__PURE__ */ Uint32Array.from([ + 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf, + 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1, +]); + +/** SHA512/256 IV */ +const T256_IV = /* @__PURE__ */ Uint32Array.from([ + 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd, + 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2, +]); + +export class SHA512_224 extends SHA512 { + protected Ah: number = T224_IV[0] | 0; + protected Al: number = T224_IV[1] | 0; + protected Bh: number = T224_IV[2] | 0; + protected Bl: number = T224_IV[3] | 0; + protected Ch: number = T224_IV[4] | 0; + protected Cl: number = T224_IV[5] | 0; + protected Dh: number = T224_IV[6] | 0; + protected Dl: number = T224_IV[7] | 0; + protected Eh: number = T224_IV[8] | 0; + protected El: number = T224_IV[9] | 0; + protected Fh: number = T224_IV[10] | 0; + protected Fl: number = T224_IV[11] | 0; + protected Gh: number = T224_IV[12] | 0; + protected Gl: number = T224_IV[13] | 0; + protected Hh: number = T224_IV[14] | 0; + protected Hl: number = T224_IV[15] | 0; + + constructor() { + super(28); + } +} + +export class SHA512_256 extends SHA512 { + protected Ah: number = T256_IV[0] | 0; + protected Al: number = T256_IV[1] | 0; + protected Bh: number = T256_IV[2] | 0; + protected Bl: number = T256_IV[3] | 0; + protected Ch: number = T256_IV[4] | 0; + protected Cl: number = T256_IV[5] | 0; + protected Dh: number = T256_IV[6] | 0; + protected Dl: number = T256_IV[7] | 0; + protected Eh: number = T256_IV[8] | 0; + protected El: number = T256_IV[9] | 0; + protected Fh: number = T256_IV[10] | 0; + protected Fl: number = T256_IV[11] | 0; + protected Gh: number = T256_IV[12] | 0; + protected Gl: number = T256_IV[13] | 0; + protected Hh: number = T256_IV[14] | 0; + protected Hl: number = T256_IV[15] | 0; + + constructor() { + super(32); + } +} + +/** + * SHA2-256 hash function from RFC 4634. + * + * It is the fastest JS hash, even faster than Blake3. + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + */ +export const sha256: CHash = /* @__PURE__ */ createHasher(() => new SHA256()); +/** SHA2-224 hash function from RFC 4634 */ +export const sha224: CHash = /* @__PURE__ */ createHasher(() => new SHA224()); + +/** SHA2-512 hash function from RFC 4634. */ +export const sha512: CHash = /* @__PURE__ */ createHasher(() => new SHA512()); +/** SHA2-384 hash function from RFC 4634. */ +export const sha384: CHash = /* @__PURE__ */ createHasher(() => new SHA384()); + +/** + * SHA2-512/256 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export const sha512_256: CHash = /* @__PURE__ */ createHasher(() => new SHA512_256()); +/** + * SHA2-512/224 "truncated" hash function, with improved resistance to length extension attacks. + * See the paper on [truncated SHA512](https://eprint.iacr.org/2010/548.pdf). + */ +export const sha512_224: CHash = /* @__PURE__ */ createHasher(() => new SHA512_224()); diff --git a/node_modules/@noble/hashes/src/sha256.ts b/node_modules/@noble/hashes/src/sha256.ts new file mode 100644 index 0000000..61ea0eb --- /dev/null +++ b/node_modules/@noble/hashes/src/sha256.ts @@ -0,0 +1,24 @@ +/** + * SHA2-256 a.k.a. sha256. In JS, it is the fastest hash, even faster than Blake3. + * + * To break sha256 using birthday attack, attackers need to try 2^128 hashes. + * BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * + * Check out [FIPS 180-4](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf). + * @module + * @deprecated + */ +import { + SHA224 as SHA224n, + sha224 as sha224n, + SHA256 as SHA256n, + sha256 as sha256n, +} from './sha2.ts'; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA256: typeof SHA256n = SHA256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha256: typeof sha256n = sha256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA224: typeof SHA224n = SHA224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha224: typeof sha224n = sha224n; diff --git a/node_modules/@noble/hashes/src/sha3-addons.ts b/node_modules/@noble/hashes/src/sha3-addons.ts new file mode 100644 index 0000000..724a769 --- /dev/null +++ b/node_modules/@noble/hashes/src/sha3-addons.ts @@ -0,0 +1,499 @@ +/** + * SHA3 (keccak) addons. + * + * * Full [NIST SP 800-185](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-185.pdf): + * cSHAKE, KMAC, TupleHash, ParallelHash + XOF variants + * * Reduced-round Keccak [(draft)](https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/): + * * 🦘 K12 aka KangarooTwelve + * * M14 aka MarsupilamiFourteen + * * TurboSHAKE + * * KeccakPRG: Pseudo-random generator based on Keccak [(pdf)](https://keccak.team/files/CSF-0.1.pdf) + * @module + */ +import { Keccak, type ShakeOpts } from './sha3.ts'; +import { + abytes, + anumber, + type CHashO, + type CHashXO, + createOptHasher, + createXOFer, + Hash, + type HashXOF, + type Input, + toBytes, + u32, +} from './utils.ts'; + +// cSHAKE && KMAC (NIST SP800-185) +const _8n = BigInt(8); +const _ffn = BigInt(0xff); + +// NOTE: it is safe to use bigints here, since they used only for length encoding (not actual data). +// We use bigints in sha256 for lengths too. +function leftEncode(n: number | bigint): Uint8Array { + n = BigInt(n); + const res = [Number(n & _ffn)]; + n >>= _8n; + for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); + res.unshift(res.length); + return new Uint8Array(res); +} + +function rightEncode(n: number | bigint): Uint8Array { + n = BigInt(n); + const res = [Number(n & _ffn)]; + n >>= _8n; + for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); + res.push(res.length); + return new Uint8Array(res); +} + +function chooseLen(opts: ShakeOpts, outputLen: number): number { + return opts.dkLen === undefined ? outputLen : opts.dkLen; +} + +const abytesOrZero = (buf?: Input) => { + if (buf === undefined) return Uint8Array.of(); + return toBytes(buf); +}; +// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block +const getPadding = (len: number, block: number) => new Uint8Array((block - (len % block)) % block); +export type cShakeOpts = ShakeOpts & { personalization?: Input; NISTfn?: Input }; + +// Personalization +function cshakePers(hash: Keccak, opts: cShakeOpts = {}): Keccak { + if (!opts || (!opts.personalization && !opts.NISTfn)) return hash; + // Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later) + // bytepad(encode_string(N) || encode_string(S), 168) + const blockLenBytes = leftEncode(hash.blockLen); + const fn = abytesOrZero(opts.NISTfn); + const fnLen = leftEncode(_8n * BigInt(fn.length)); // length in bits + const pers = abytesOrZero(opts.personalization); + const persLen = leftEncode(_8n * BigInt(pers.length)); // length in bits + if (!fn.length && !pers.length) return hash; + hash.suffix = 0x04; + hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers); + let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length; + hash.update(getPadding(totalLen, hash.blockLen)); + return hash; +} + +const gencShake = (suffix: number, blockLen: number, outputLen: number) => + createXOFer((opts: cShakeOpts = {}) => + cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts) + ); + +// TODO: refactor +export type ICShake = { + (msg: Input, opts?: cShakeOpts): Uint8Array; + outputLen: number; + blockLen: number; + create(opts: cShakeOpts): HashXOF; +}; +export type ITupleHash = { + (messages: Input[], opts?: cShakeOpts): Uint8Array; + create(opts?: cShakeOpts): TupleHash; +}; +export type IParHash = { + (message: Input, opts?: ParallelOpts): Uint8Array; + create(opts?: ParallelOpts): ParallelHash; +}; +export const cshake128: ICShake = /* @__PURE__ */ (() => gencShake(0x1f, 168, 128 / 8))(); +export const cshake256: ICShake = /* @__PURE__ */ (() => gencShake(0x1f, 136, 256 / 8))(); + +export class KMAC extends Keccak implements HashXOF { + constructor( + blockLen: number, + outputLen: number, + enableXOF: boolean, + key: Input, + opts: cShakeOpts = {} + ) { + super(blockLen, 0x1f, outputLen, enableXOF); + cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization }); + key = toBytes(key); + abytes(key); + // 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L). + const blockLenBytes = leftEncode(this.blockLen); + const keyLen = leftEncode(_8n * BigInt(key.length)); + this.update(blockLenBytes).update(keyLen).update(key); + const totalLen = blockLenBytes.length + keyLen.length + key.length; + this.update(getPadding(totalLen, this.blockLen)); + } + protected finish(): void { + if (!this.finished) this.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to?: KMAC): KMAC { + // Create new instance without calling constructor since key already in state and we don't know it. + // Force "to" to be instance of KMAC instead of Sha3. + if (!to) { + to = Object.create(Object.getPrototypeOf(this), {}) as KMAC; + to.state = this.state.slice(); + to.blockLen = this.blockLen; + to.state32 = u32(to.state); + } + return super._cloneInto(to) as KMAC; + } + clone(): KMAC { + return this._cloneInto(); + } +} + +function genKmac(blockLen: number, outputLen: number, xof = false) { + const kmac = (key: Input, message: Input, opts?: cShakeOpts): Uint8Array => + kmac.create(key, opts).update(message).digest(); + kmac.create = (key: Input, opts: cShakeOpts = {}) => + new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts); + return kmac; +} + +export const kmac128: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +} = /* @__PURE__ */ (() => genKmac(168, 128 / 8))(); +export const kmac256: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +} = /* @__PURE__ */ (() => genKmac(136, 256 / 8))(); +export const kmac128xof: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +} = /* @__PURE__ */ (() => genKmac(168, 128 / 8, true))(); +export const kmac256xof: { + (key: Input, message: Input, opts?: cShakeOpts): Uint8Array; + create(key: Input, opts?: cShakeOpts): KMAC; +} = /* @__PURE__ */ (() => genKmac(136, 256 / 8, true))(); + +// TupleHash +// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd']) +export class TupleHash extends Keccak implements HashXOF { + constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts: cShakeOpts = {}) { + super(blockLen, 0x1f, outputLen, enableXOF); + cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization }); + // Change update after cshake processed + this.update = (data: Input) => { + data = toBytes(data); + abytes(data); + super.update(leftEncode(_8n * BigInt(data.length))); + super.update(data); + return this; + }; + } + protected finish(): void { + if (!this.finished) + super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to?: TupleHash): TupleHash { + to ||= new TupleHash(this.blockLen, this.outputLen, this.enableXOF); + return super._cloneInto(to) as TupleHash; + } + clone(): TupleHash { + return this._cloneInto(); + } +} + +function genTuple(blockLen: number, outputLen: number, xof = false) { + const tuple = (messages: Input[], opts?: cShakeOpts): Uint8Array => { + const h = tuple.create(opts); + for (const msg of messages) h.update(msg); + return h.digest(); + }; + tuple.create = (opts: cShakeOpts = {}) => + new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts); + return tuple; +} + +/** 128-bit TupleHASH. */ +export const tuplehash128: ITupleHash = /* @__PURE__ */ (() => genTuple(168, 128 / 8))(); +/** 256-bit TupleHASH. */ +export const tuplehash256: ITupleHash = /* @__PURE__ */ (() => genTuple(136, 256 / 8))(); +/** 128-bit TupleHASH XOF. */ +export const tuplehash128xof: ITupleHash = /* @__PURE__ */ (() => genTuple(168, 128 / 8, true))(); +/** 256-bit TupleHASH XOF. */ +export const tuplehash256xof: ITupleHash = /* @__PURE__ */ (() => genTuple(136, 256 / 8, true))(); + +// ParallelHash (same as K12/M14, but without speedup for inputs less 8kb, reduced number of rounds and more simple) +type ParallelOpts = cShakeOpts & { blockLen?: number }; + +export class ParallelHash extends Keccak implements HashXOF { + private leafHash?: Hash; + protected leafCons: () => Hash; + private chunkPos = 0; // Position of current block in chunk + private chunksDone = 0; // How many chunks we already have + private chunkLen: number; + constructor( + blockLen: number, + outputLen: number, + leafCons: () => Hash, + enableXOF: boolean, + opts: ParallelOpts = {} + ) { + super(blockLen, 0x1f, outputLen, enableXOF); + cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization }); + this.leafCons = leafCons; + let { blockLen: B } = opts; + B ||= 8; + anumber(B); + this.chunkLen = B; + super.update(leftEncode(B)); + // Change update after cshake processed + this.update = (data: Input) => { + data = toBytes(data); + abytes(data); + const { chunkLen, leafCons } = this; + for (let pos = 0, len = data.length; pos < len; ) { + if (this.chunkPos == chunkLen || !this.leafHash) { + if (this.leafHash) { + super.update(this.leafHash.digest()); + this.chunksDone++; + } + this.leafHash = leafCons(); + this.chunkPos = 0; + } + const take = Math.min(chunkLen - this.chunkPos, len - pos); + this.leafHash.update(data.subarray(pos, pos + take)); + this.chunkPos += take; + pos += take; + } + return this; + }; + } + protected finish(): void { + if (this.finished) return; + if (this.leafHash) { + super.update(this.leafHash.digest()); + this.chunksDone++; + } + super.update(rightEncode(this.chunksDone)); + super.update(rightEncode(this.enableXOF ? 0 : _8n * BigInt(this.outputLen))); // outputLen in bits + super.finish(); + } + _cloneInto(to?: ParallelHash): ParallelHash { + to ||= new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF); + if (this.leafHash) to.leafHash = this.leafHash._cloneInto(to.leafHash as Keccak); + to.chunkPos = this.chunkPos; + to.chunkLen = this.chunkLen; + to.chunksDone = this.chunksDone; + return super._cloneInto(to) as ParallelHash; + } + destroy(): void { + super.destroy.call(this); + if (this.leafHash) this.leafHash.destroy(); + } + clone(): ParallelHash { + return this._cloneInto(); + } +} + +function genPrl( + blockLen: number, + outputLen: number, + leaf: ReturnType, + xof = false +) { + const parallel = (message: Input, opts?: ParallelOpts): Uint8Array => + parallel.create(opts).update(message).digest(); + parallel.create = (opts: ParallelOpts = {}) => + new ParallelHash( + blockLen, + chooseLen(opts, outputLen), + () => leaf.create({ dkLen: 2 * outputLen }), + xof, + opts + ); + return parallel; +} + +/** 128-bit ParallelHash. In JS, it is not parallel. */ +export const parallelhash128: IParHash = /* @__PURE__ */ (() => genPrl(168, 128 / 8, cshake128))(); +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export const parallelhash256: IParHash = /* @__PURE__ */ (() => genPrl(136, 256 / 8, cshake256))(); +/** 128-bit ParallelHash XOF. In JS, it is not parallel. */ +export const parallelhash128xof: IParHash = /* @__PURE__ */ (() => + genPrl(168, 128 / 8, cshake128, true))(); +/** 256-bit ParallelHash. In JS, it is not parallel. */ +export const parallelhash256xof: IParHash = /* @__PURE__ */ (() => + genPrl(136, 256 / 8, cshake256, true))(); + +// Should be simple 'shake with 12 rounds', but no, we got whole new spec about Turbo SHAKE Pro MAX. +export type TurboshakeOpts = ShakeOpts & { + D?: number; // Domain separation byte +}; + +const genTurboshake = (blockLen: number, outputLen: number) => + createXOFer, TurboshakeOpts>((opts: TurboshakeOpts = {}) => { + const D = opts.D === undefined ? 0x1f : opts.D; + // Section 2.1 of https://datatracker.ietf.org/doc/draft-irtf-cfrg-kangarootwelve/ + if (!Number.isSafeInteger(D) || D < 0x01 || D > 0x7f) + throw new Error('invalid domain separation byte must be 0x01..0x7f, got: ' + D); + return new Keccak(blockLen, D, opts.dkLen === undefined ? outputLen : opts.dkLen, true, 12); + }); + +/** TurboSHAKE 128-bit: reduced 12-round keccak. */ +export const turboshake128: CHashXO = /* @__PURE__ */ genTurboshake(168, 256 / 8); +/** TurboSHAKE 256-bit: reduced 12-round keccak. */ +export const turboshake256: CHashXO = /* @__PURE__ */ genTurboshake(136, 512 / 8); + +// Kangaroo +// Same as NIST rightEncode, but returns [0] for zero string +function rightEncodeK12(n: number | bigint): Uint8Array { + n = BigInt(n); + const res: number[] = []; + for (; n > 0; n >>= _8n) res.unshift(Number(n & _ffn)); + res.push(res.length); + return Uint8Array.from(res); +} + +export type KangarooOpts = { dkLen?: number; personalization?: Input }; +const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of(); + +export class KangarooTwelve extends Keccak implements HashXOF { + readonly chunkLen = 8192; + private leafHash?: Keccak; + protected leafLen: number; + private personalization: Uint8Array; + private chunkPos = 0; // Position of current block in chunk + private chunksDone = 0; // How many chunks we already have + constructor( + blockLen: number, + leafLen: number, + outputLen: number, + rounds: number, + opts: KangarooOpts + ) { + super(blockLen, 0x07, outputLen, true, rounds); + this.leafLen = leafLen; + this.personalization = abytesOrZero(opts.personalization); + } + update(data: Input): this { + data = toBytes(data); + abytes(data); + const { chunkLen, blockLen, leafLen, rounds } = this; + for (let pos = 0, len = data.length; pos < len; ) { + if (this.chunkPos == chunkLen) { + if (this.leafHash) super.update(this.leafHash.digest()); + else { + this.suffix = 0x06; // Its safe to change suffix here since its used only in digest() + super.update(Uint8Array.from([3, 0, 0, 0, 0, 0, 0, 0])); + } + this.leafHash = new Keccak(blockLen, 0x0b, leafLen, false, rounds); + this.chunksDone++; + this.chunkPos = 0; + } + const take = Math.min(chunkLen - this.chunkPos, len - pos); + const chunk = data.subarray(pos, pos + take); + if (this.leafHash) this.leafHash.update(chunk); + else super.update(chunk); + this.chunkPos += take; + pos += take; + } + return this; + } + protected finish(): void { + if (this.finished) return; + const { personalization } = this; + this.update(personalization).update(rightEncodeK12(personalization.length)); + // Leaf hash + if (this.leafHash) { + super.update(this.leafHash.digest()); + super.update(rightEncodeK12(this.chunksDone)); + super.update(Uint8Array.from([0xff, 0xff])); + } + super.finish.call(this); + } + destroy(): void { + super.destroy.call(this); + if (this.leafHash) this.leafHash.destroy(); + // We cannot zero personalization buffer since it is user provided and we don't want to mutate user input + this.personalization = EMPTY_BUFFER; + } + _cloneInto(to?: KangarooTwelve): KangarooTwelve { + const { blockLen, leafLen, leafHash, outputLen, rounds } = this; + to ||= new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {}); + super._cloneInto(to); + if (leafHash) to.leafHash = leafHash._cloneInto(to.leafHash); + to.personalization.set(this.personalization); + to.leafLen = this.leafLen; + to.chunkPos = this.chunkPos; + to.chunksDone = this.chunksDone; + return to; + } + clone(): KangarooTwelve { + return this._cloneInto(); + } +} +/** KangarooTwelve: reduced 12-round keccak. */ +export const k12: CHashO = /* @__PURE__ */ (() => + createOptHasher( + (opts: KangarooOpts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts) + ))(); +/** MarsupilamiFourteen: reduced 14-round keccak. */ +export const m14: CHashO = /* @__PURE__ */ (() => + createOptHasher( + (opts: KangarooOpts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts) + ))(); + +/** + * More at https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG. + */ +export class KeccakPRG extends Keccak { + protected rate: number; + constructor(capacity: number) { + anumber(capacity); + // Rho should be full bytes + if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8) + throw new Error('invalid capacity'); + // blockLen = rho in bytes + super((1600 - capacity - 2) / 8, 0, 0, true); + this.rate = 1600 - capacity; + this.posOut = Math.floor((this.rate + 7) / 8); + } + keccak(): void { + // Duplex padding + this.state[this.pos] ^= 0x01; + this.state[this.blockLen] ^= 0x02; // Rho is full bytes + super.keccak(); + this.pos = 0; + this.posOut = 0; + } + update(data: Input): this { + super.update(data); + this.posOut = this.blockLen; + return this; + } + feed(data: Input): this { + return this.update(data); + } + protected finish(): void {} + digestInto(_out: Uint8Array): Uint8Array { + throw new Error('digest is not allowed, use .fetch instead'); + } + fetch(bytes: number): Uint8Array { + return this.xof(bytes); + } + // Ensure irreversibility (even if state leaked previous outputs cannot be computed) + forget(): void { + if (this.rate < 1600 / 2 + 1) throw new Error('rate is too low to use .forget()'); + this.keccak(); + for (let i = 0; i < this.blockLen; i++) this.state[i] = 0; + this.pos = this.blockLen; + this.keccak(); + this.posOut = this.blockLen; + } + _cloneInto(to?: KeccakPRG): KeccakPRG { + const { rate } = this; + to ||= new KeccakPRG(1600 - rate); + super._cloneInto(to); + to.rate = rate; + return to; + } + clone(): KeccakPRG { + return this._cloneInto(); + } +} + +/** KeccakPRG: Pseudo-random generator based on Keccak. https://keccak.team/files/CSF-0.1.pdf */ +export const keccakprg = (capacity = 254): KeccakPRG => new KeccakPRG(capacity); diff --git a/node_modules/@noble/hashes/src/sha3.ts b/node_modules/@noble/hashes/src/sha3.ts new file mode 100644 index 0000000..bb7b676 --- /dev/null +++ b/node_modules/@noble/hashes/src/sha3.ts @@ -0,0 +1,258 @@ +/** + * SHA3 (keccak) hash function, based on a new "Sponge function" design. + * Different from older hashes, the internal state is bigger than output size. + * + * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf), + * [Website](https://keccak.team/keccak.html), + * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub). + * + * Check out `sha3-addons` module for cSHAKE, k12, and others. + * @module + */ +import { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.ts'; +// prettier-ignore +import { + abytes, aexists, anumber, aoutput, + clean, createHasher, createXOFer, Hash, + swap32IfBE, + toBytes, u32, + type CHash, type CHashXO, type HashXOF, type Input +} from './utils.ts'; + +// No __PURE__ annotations in sha3 header: +// EVERYTHING is in fact used on every export. +// Various per round constants calculations +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const _7n = BigInt(7); +const _256n = BigInt(256); +const _0x71n = BigInt(0x71); +const SHA3_PI: number[] = []; +const SHA3_ROTL: number[] = []; +const _SHA3_IOTA: bigint[] = []; +for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { + // Pi + [x, y] = [y, (2 * x + 3 * y) % 5]; + SHA3_PI.push(2 * (5 * y + x)); + // Rotational + SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); + // Iota + let t = _0n; + for (let j = 0; j < 7; j++) { + R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; + if (R & _2n) t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); + } + _SHA3_IOTA.push(t); +} +const IOTAS = split(_SHA3_IOTA, true); +const SHA3_IOTA_H = IOTAS[0]; +const SHA3_IOTA_L = IOTAS[1]; + +// Left rotation (without 0, 32, 64) +const rotlH = (h: number, l: number, s: number) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); +const rotlL = (h: number, l: number, s: number) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); + +/** `keccakf1600` internal function, additionally allows to adjust round count. */ +export function keccakP(s: Uint32Array, rounds: number = 24): void { + const B = new Uint32Array(5 * 2); + // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) + for (let round = 24 - rounds; round < 24; round++) { + // Theta θ + for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; + for (let x = 0; x < 10; x += 2) { + const idx1 = (x + 8) % 10; + const idx0 = (x + 2) % 10; + const B0 = B[idx0]; + const B1 = B[idx0 + 1]; + const Th = rotlH(B0, B1, 1) ^ B[idx1]; + const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; + for (let y = 0; y < 50; y += 10) { + s[x + y] ^= Th; + s[x + y + 1] ^= Tl; + } + } + // Rho (ρ) and Pi (π) + let curH = s[2]; + let curL = s[3]; + for (let t = 0; t < 24; t++) { + const shift = SHA3_ROTL[t]; + const Th = rotlH(curH, curL, shift); + const Tl = rotlL(curH, curL, shift); + const PI = SHA3_PI[t]; + curH = s[PI]; + curL = s[PI + 1]; + s[PI] = Th; + s[PI + 1] = Tl; + } + // Chi (χ) + for (let y = 0; y < 50; y += 10) { + for (let x = 0; x < 10; x++) B[x] = s[y + x]; + for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; + } + // Iota (ι) + s[0] ^= SHA3_IOTA_H[round]; + s[1] ^= SHA3_IOTA_L[round]; + } + clean(B); +} + +/** Keccak sponge function. */ +export class Keccak extends Hash implements HashXOF { + protected state: Uint8Array; + protected pos = 0; + protected posOut = 0; + protected finished = false; + protected state32: Uint32Array; + protected destroyed = false; + + public blockLen: number; + public suffix: number; + public outputLen: number; + protected enableXOF = false; + protected rounds: number; + + // NOTE: we accept arguments in bytes instead of bits here. + constructor( + blockLen: number, + suffix: number, + outputLen: number, + enableXOF = false, + rounds: number = 24 + ) { + super(); + this.blockLen = blockLen; + this.suffix = suffix; + this.outputLen = outputLen; + this.enableXOF = enableXOF; + this.rounds = rounds; + // Can be passed from user as dkLen + anumber(outputLen); + // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes + // 0 < blockLen < 200 + if (!(0 < blockLen && blockLen < 200)) + throw new Error('only keccak-f1600 function is supported'); + this.state = new Uint8Array(200); + this.state32 = u32(this.state); + } + clone(): Keccak { + return this._cloneInto(); + } + protected keccak(): void { + swap32IfBE(this.state32); + keccakP(this.state32, this.rounds); + swap32IfBE(this.state32); + this.posOut = 0; + this.pos = 0; + } + update(data: Input): this { + aexists(this); + data = toBytes(data); + abytes(data); + const { blockLen, state } = this; + const len = data.length; + for (let pos = 0; pos < len; ) { + const take = Math.min(blockLen - this.pos, len - pos); + for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++]; + if (this.pos === blockLen) this.keccak(); + } + return this; + } + protected finish(): void { + if (this.finished) return; + this.finished = true; + const { state, suffix, pos, blockLen } = this; + // Do the padding + state[pos] ^= suffix; + if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak(); + state[blockLen - 1] ^= 0x80; + this.keccak(); + } + protected writeInto(out: Uint8Array): Uint8Array { + aexists(this, false); + abytes(out); + this.finish(); + const bufferOut = this.state; + const { blockLen } = this; + for (let pos = 0, len = out.length; pos < len; ) { + if (this.posOut >= blockLen) this.keccak(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out: Uint8Array): Uint8Array { + // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF + if (!this.enableXOF) throw new Error('XOF is not possible for this instance'); + return this.writeInto(out); + } + xof(bytes: number): Uint8Array { + anumber(bytes); + return this.xofInto(new Uint8Array(bytes)); + } + digestInto(out: Uint8Array): Uint8Array { + aoutput(out, this); + if (this.finished) throw new Error('digest() was already called'); + this.writeInto(out); + this.destroy(); + return out; + } + digest(): Uint8Array { + return this.digestInto(new Uint8Array(this.outputLen)); + } + destroy(): void { + this.destroyed = true; + clean(this.state); + } + _cloneInto(to?: Keccak): Keccak { + const { blockLen, suffix, outputLen, rounds, enableXOF } = this; + to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); + to.state32.set(this.state32); + to.pos = this.pos; + to.posOut = this.posOut; + to.finished = this.finished; + to.rounds = rounds; + // Suffix can change in cSHAKE + to.suffix = suffix; + to.outputLen = outputLen; + to.enableXOF = enableXOF; + to.destroyed = this.destroyed; + return to; + } +} + +const gen = (suffix: number, blockLen: number, outputLen: number) => + createHasher(() => new Keccak(blockLen, suffix, outputLen)); + +/** SHA3-224 hash function. */ +export const sha3_224: CHash = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))(); +/** SHA3-256 hash function. Different from keccak-256. */ +export const sha3_256: CHash = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))(); +/** SHA3-384 hash function. */ +export const sha3_384: CHash = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))(); +/** SHA3-512 hash function. */ +export const sha3_512: CHash = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))(); + +/** keccak-224 hash function. */ +export const keccak_224: CHash = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))(); +/** keccak-256 hash function. Different from SHA3-256. */ +export const keccak_256: CHash = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))(); +/** keccak-384 hash function. */ +export const keccak_384: CHash = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))(); +/** keccak-512 hash function. */ +export const keccak_512: CHash = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))(); + +export type ShakeOpts = { dkLen?: number }; + +const genShake = (suffix: number, blockLen: number, outputLen: number) => + createXOFer, ShakeOpts>( + (opts: ShakeOpts = {}) => + new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true) + ); + +/** SHAKE128 XOF with 128-bit security. */ +export const shake128: CHashXO = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))(); +/** SHAKE256 XOF with 256-bit security. */ +export const shake256: CHashXO = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))(); diff --git a/node_modules/@noble/hashes/src/sha512.ts b/node_modules/@noble/hashes/src/sha512.ts new file mode 100644 index 0000000..15bd252 --- /dev/null +++ b/node_modules/@noble/hashes/src/sha512.ts @@ -0,0 +1,34 @@ +/** + * SHA2-512 a.k.a. sha512 and sha384. It is slower than sha256 in js because u64 operations are slow. + * + * Check out [RFC 4634](https://datatracker.ietf.org/doc/html/rfc4634) and + * [the paper on truncated SHA512/256](https://eprint.iacr.org/2010/548.pdf). + * @module + * @deprecated + */ +import { + SHA384 as SHA384n, + sha384 as sha384n, + sha512_224 as sha512_224n, + SHA512_224 as SHA512_224n, + sha512_256 as sha512_256n, + SHA512_256 as SHA512_256n, + SHA512 as SHA512n, + sha512 as sha512n, +} from './sha2.ts'; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA512: typeof SHA512n = SHA512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha512: typeof sha512n = sha512n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA384: typeof SHA384n = SHA384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha384: typeof sha384n = sha384n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA512_224: typeof SHA512_224n = SHA512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha512_224: typeof sha512_224n = sha512_224n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const SHA512_256: typeof SHA512_256n = SHA512_256n; +/** @deprecated Use import from `noble/hashes/sha2` module */ +export const sha512_256: typeof sha512_256n = sha512_256n; diff --git a/node_modules/@noble/hashes/src/utils.ts b/node_modules/@noble/hashes/src/utils.ts new file mode 100644 index 0000000..4c8a679 --- /dev/null +++ b/node_modules/@noble/hashes/src/utils.ts @@ -0,0 +1,395 @@ +/** + * Utilities for hex, bytes, CSPRNG. + * @module + */ +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ + +// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. +// node.js versions earlier than v19 don't declare it in global scope. +// For node.js, package.json#exports field mapping rewrites import +// from `crypto` to `cryptoNode`, which imports native module. +// Makes the utils un-importable in browsers without a bundler. +// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. +import { crypto } from '@noble/hashes/crypto'; + +/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ +export function isBytes(a: unknown): a is Uint8Array { + return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); +} + +/** Asserts something is positive integer. */ +export function anumber(n: number): void { + if (!Number.isSafeInteger(n) || n < 0) throw new Error('positive integer expected, got ' + n); +} + +/** Asserts something is Uint8Array. */ +export function abytes(b: Uint8Array | undefined, ...lengths: number[]): void { + if (!isBytes(b)) throw new Error('Uint8Array expected'); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); +} + +/** Asserts something is hash */ +export function ahash(h: IHash): void { + if (typeof h !== 'function' || typeof h.create !== 'function') + throw new Error('Hash should be wrapped by utils.createHasher'); + anumber(h.outputLen); + anumber(h.blockLen); +} + +/** Asserts a hash instance has not been destroyed / finished */ +export function aexists(instance: any, checkFinished = true): void { + if (instance.destroyed) throw new Error('Hash instance has been destroyed'); + if (checkFinished && instance.finished) throw new Error('Hash#digest() has already been called'); +} + +/** Asserts output is properly-sized byte array */ +export function aoutput(out: any, instance: any): void { + abytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error('digestInto() expects output buffer of length at least ' + min); + } +} + +/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ +// prettier-ignore +export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | + Uint16Array | Int16Array | Uint32Array | Int32Array; + +/** Cast u8 / u16 / u32 to u8. */ +export function u8(arr: TypedArray): Uint8Array { + return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); +} + +/** Cast u8 / u16 / u32 to u32. */ +export function u32(arr: TypedArray): Uint32Array { + return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +} + +/** Zeroize a byte array. Warning: JS provides no guarantees. */ +export function clean(...arrays: TypedArray[]): void { + for (let i = 0; i < arrays.length; i++) { + arrays[i].fill(0); + } +} + +/** Create DataView of an array for easy byte-level manipulation. */ +export function createView(arr: TypedArray): DataView { + return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +} + +/** The rotate right (circular right shift) operation for uint32 */ +export function rotr(word: number, shift: number): number { + return (word << (32 - shift)) | (word >>> shift); +} + +/** The rotate left (circular left shift) operation for uint32 */ +export function rotl(word: number, shift: number): number { + return (word << shift) | ((word >>> (32 - shift)) >>> 0); +} + +/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ +export const isLE: boolean = /* @__PURE__ */ (() => + new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); + +/** The byte swap operation for uint32 */ +export function byteSwap(word: number): number { + return ( + ((word << 24) & 0xff000000) | + ((word << 8) & 0xff0000) | + ((word >>> 8) & 0xff00) | + ((word >>> 24) & 0xff) + ); +} +/** Conditionally byte swap if on a big-endian platform */ +export const swap8IfBE: (n: number) => number = isLE + ? (n: number) => n + : (n: number) => byteSwap(n); + +/** @deprecated */ +export const byteSwapIfBE: typeof swap8IfBE = swap8IfBE; +/** In place byte swap for Uint32Array */ +export function byteSwap32(arr: Uint32Array): Uint32Array { + for (let i = 0; i < arr.length; i++) { + arr[i] = byteSwap(arr[i]); + } + return arr; +} + +export const swap32IfBE: (u: Uint32Array) => Uint32Array = isLE + ? (u: Uint32Array) => u + : byteSwap32; + +// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex +const hasHexBuiltin: boolean = /* @__PURE__ */ (() => + // @ts-ignore + typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); + +// Array where index 0xf0 (240) is mapped to string 'f0' +const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => + i.toString(16).padStart(2, '0') +); + +/** + * Convert byte array to hex string. Uses built-in function, when available. + * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' + */ +export function bytesToHex(bytes: Uint8Array): string { + abytes(bytes); + // @ts-ignore + if (hasHexBuiltin) return bytes.toHex(); + // pre-caching improves the speed 6x + let hex = ''; + for (let i = 0; i < bytes.length; i++) { + hex += hexes[bytes[i]]; + } + return hex; +} + +// We use optimized technique to convert hex string to byte array +const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const; +function asciiToBase16(ch: number): number | undefined { + if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48 + if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10) + if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10) + return; +} + +/** + * Convert hex string to byte array. Uses built-in function, when available. + * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) + */ +export function hexToBytes(hex: string): Uint8Array { + if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex); + // @ts-ignore + if (hasHexBuiltin) return Uint8Array.fromHex(hex); + const hl = hex.length; + const al = hl / 2; + if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl); + const array = new Uint8Array(al); + for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { + const n1 = asciiToBase16(hex.charCodeAt(hi)); + const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); + if (n1 === undefined || n2 === undefined) { + const char = hex[hi] + hex[hi + 1]; + throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); + } + array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 + } + return array; +} + +/** + * There is no setImmediate in browser and setTimeout is slow. + * Call of async fn will return Promise, which will be fullfiled only on + * next scheduler queue processing step and this is exactly what we need. + */ +export const nextTick = async (): Promise => {}; + +/** Returns control to thread each 'tick' ms to avoid blocking. */ +export async function asyncLoop( + iters: number, + tick: number, + cb: (i: number) => void +): Promise { + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) continue; + await nextTick(); + ts += diff; + } +} + +// Global symbols, but ts doesn't see them: https://github.com/microsoft/TypeScript/issues/31535 +declare const TextEncoder: any; +declare const TextDecoder: any; + +/** + * Converts string to bytes using UTF8 encoding. + * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) + */ +export function utf8ToBytes(str: string): Uint8Array { + if (typeof str !== 'string') throw new Error('string expected'); + return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 +} + +/** + * Converts bytes to string using UTF8 encoding. + * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' + */ +export function bytesToUtf8(bytes: Uint8Array): string { + return new TextDecoder().decode(bytes); +} + +/** Accepted input of hash functions. Strings are converted to byte arrays. */ +export type Input = string | Uint8Array; +/** + * Normalizes (non-hex) string or Uint8Array to Uint8Array. + * Warning: when Uint8Array is passed, it would NOT get copied. + * Keep in mind for future mutable operations. + */ +export function toBytes(data: Input): Uint8Array { + if (typeof data === 'string') data = utf8ToBytes(data); + abytes(data); + return data; +} + +/** KDFs can accept string or Uint8Array for user convenience. */ +export type KDFInput = string | Uint8Array; +/** + * Helper for KDFs: consumes uint8array or string. + * When string is passed, does utf8 decoding, using TextDecoder. + */ +export function kdfInputToBytes(data: KDFInput): Uint8Array { + if (typeof data === 'string') data = utf8ToBytes(data); + abytes(data); + return data; +} + +/** Copies several Uint8Arrays into one. */ +export function concatBytes(...arrays: Uint8Array[]): Uint8Array { + let sum = 0; + for (let i = 0; i < arrays.length; i++) { + const a = arrays[i]; + abytes(a); + sum += a.length; + } + const res = new Uint8Array(sum); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const a = arrays[i]; + res.set(a, pad); + pad += a.length; + } + return res; +} + +type EmptyObj = {}; +export function checkOpts( + defaults: T1, + opts?: T2 +): T1 & T2 { + if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') + throw new Error('options should be object or undefined'); + const merged = Object.assign(defaults, opts); + return merged as T1 & T2; +} + +/** Hash interface. */ +export type IHash = { + (data: Uint8Array): Uint8Array; + blockLen: number; + outputLen: number; + create: any; +}; + +/** For runtime check if class implements interface */ +export abstract class Hash> { + abstract blockLen: number; // Bytes per block + abstract outputLen: number; // Bytes in output + abstract update(buf: Input): this; + // Writes digest into buf + abstract digestInto(buf: Uint8Array): void; + abstract digest(): Uint8Array; + /** + * Resets internal state. Makes Hash instance unusable. + * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed + * by user, they will need to manually call `destroy()` when zeroing is necessary. + */ + abstract destroy(): void; + /** + * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` + * when no options are passed. + * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal + * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. + * There are no guarantees for clean-up because it's impossible in JS. + */ + abstract _cloneInto(to?: T): T; + // Safe version that clones internal state + abstract clone(): T; +} + +/** + * XOF: streaming API to read digest in chunks. + * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. + * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot + * destroy state, next call can require more bytes. + */ +export type HashXOF> = Hash & { + xof(bytes: number): Uint8Array; // Read 'bytes' bytes from digest stream + xofInto(buf: Uint8Array): Uint8Array; // read buf.length bytes from digest stream into buf +}; + +/** Hash function */ +export type CHash = ReturnType; +/** Hash function with output */ +export type CHashO = ReturnType; +/** XOF with output */ +export type CHashXO = ReturnType; + +/** Wraps hash function, creating an interface on top of it */ +export function createHasher>( + hashCons: () => Hash +): { + (msg: Input): Uint8Array; + outputLen: number; + blockLen: number; + create(): Hash; +} { + const hashC = (msg: Input): Uint8Array => hashCons().update(toBytes(msg)).digest(); + const tmp = hashCons(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashCons(); + return hashC; +} + +export function createOptHasher, T extends Object>( + hashCons: (opts?: T) => Hash +): { + (msg: Input, opts?: T): Uint8Array; + outputLen: number; + blockLen: number; + create(opts?: T): Hash; +} { + const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({} as T); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts?: T) => hashCons(opts); + return hashC; +} + +export function createXOFer, T extends Object>( + hashCons: (opts?: T) => HashXOF +): { + (msg: Input, opts?: T): Uint8Array; + outputLen: number; + blockLen: number; + create(opts?: T): HashXOF; +} { + const hashC = (msg: Input, opts?: T): Uint8Array => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({} as T); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts?: T) => hashCons(opts); + return hashC; +} +export const wrapConstructor: typeof createHasher = createHasher; +export const wrapConstructorWithOpts: typeof createOptHasher = createOptHasher; +export const wrapXOFConstructorWithOpts: typeof createXOFer = createXOFer; + +/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ +export function randomBytes(bytesLength = 32): Uint8Array { + if (crypto && typeof crypto.getRandomValues === 'function') { + return crypto.getRandomValues(new Uint8Array(bytesLength)); + } + // Legacy Node.js compatibility + if (crypto && typeof crypto.randomBytes === 'function') { + return Uint8Array.from(crypto.randomBytes(bytesLength)); + } + throw new Error('crypto.getRandomValues must be defined'); +} diff --git a/node_modules/@noble/hashes/utils.d.ts b/node_modules/@noble/hashes/utils.d.ts new file mode 100644 index 0000000..90b8439 --- /dev/null +++ b/node_modules/@noble/hashes/utils.d.ts @@ -0,0 +1,161 @@ +/** + * Utilities for hex, bytes, CSPRNG. + * @module + */ +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ +export declare function isBytes(a: unknown): a is Uint8Array; +/** Asserts something is positive integer. */ +export declare function anumber(n: number): void; +/** Asserts something is Uint8Array. */ +export declare function abytes(b: Uint8Array | undefined, ...lengths: number[]): void; +/** Asserts something is hash */ +export declare function ahash(h: IHash): void; +/** Asserts a hash instance has not been destroyed / finished */ +export declare function aexists(instance: any, checkFinished?: boolean): void; +/** Asserts output is properly-sized byte array */ +export declare function aoutput(out: any, instance: any): void; +/** Generic type encompassing 8/16/32-byte arrays - but not 64-byte. */ +export type TypedArray = Int8Array | Uint8ClampedArray | Uint8Array | Uint16Array | Int16Array | Uint32Array | Int32Array; +/** Cast u8 / u16 / u32 to u8. */ +export declare function u8(arr: TypedArray): Uint8Array; +/** Cast u8 / u16 / u32 to u32. */ +export declare function u32(arr: TypedArray): Uint32Array; +/** Zeroize a byte array. Warning: JS provides no guarantees. */ +export declare function clean(...arrays: TypedArray[]): void; +/** Create DataView of an array for easy byte-level manipulation. */ +export declare function createView(arr: TypedArray): DataView; +/** The rotate right (circular right shift) operation for uint32 */ +export declare function rotr(word: number, shift: number): number; +/** The rotate left (circular left shift) operation for uint32 */ +export declare function rotl(word: number, shift: number): number; +/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ +export declare const isLE: boolean; +/** The byte swap operation for uint32 */ +export declare function byteSwap(word: number): number; +/** Conditionally byte swap if on a big-endian platform */ +export declare const swap8IfBE: (n: number) => number; +/** @deprecated */ +export declare const byteSwapIfBE: typeof swap8IfBE; +/** In place byte swap for Uint32Array */ +export declare function byteSwap32(arr: Uint32Array): Uint32Array; +export declare const swap32IfBE: (u: Uint32Array) => Uint32Array; +/** + * Convert byte array to hex string. Uses built-in function, when available. + * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' + */ +export declare function bytesToHex(bytes: Uint8Array): string; +/** + * Convert hex string to byte array. Uses built-in function, when available. + * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) + */ +export declare function hexToBytes(hex: string): Uint8Array; +/** + * There is no setImmediate in browser and setTimeout is slow. + * Call of async fn will return Promise, which will be fullfiled only on + * next scheduler queue processing step and this is exactly what we need. + */ +export declare const nextTick: () => Promise; +/** Returns control to thread each 'tick' ms to avoid blocking. */ +export declare function asyncLoop(iters: number, tick: number, cb: (i: number) => void): Promise; +/** + * Converts string to bytes using UTF8 encoding. + * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) + */ +export declare function utf8ToBytes(str: string): Uint8Array; +/** + * Converts bytes to string using UTF8 encoding. + * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' + */ +export declare function bytesToUtf8(bytes: Uint8Array): string; +/** Accepted input of hash functions. Strings are converted to byte arrays. */ +export type Input = string | Uint8Array; +/** + * Normalizes (non-hex) string or Uint8Array to Uint8Array. + * Warning: when Uint8Array is passed, it would NOT get copied. + * Keep in mind for future mutable operations. + */ +export declare function toBytes(data: Input): Uint8Array; +/** KDFs can accept string or Uint8Array for user convenience. */ +export type KDFInput = string | Uint8Array; +/** + * Helper for KDFs: consumes uint8array or string. + * When string is passed, does utf8 decoding, using TextDecoder. + */ +export declare function kdfInputToBytes(data: KDFInput): Uint8Array; +/** Copies several Uint8Arrays into one. */ +export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; +type EmptyObj = {}; +export declare function checkOpts(defaults: T1, opts?: T2): T1 & T2; +/** Hash interface. */ +export type IHash = { + (data: Uint8Array): Uint8Array; + blockLen: number; + outputLen: number; + create: any; +}; +/** For runtime check if class implements interface */ +export declare abstract class Hash> { + abstract blockLen: number; + abstract outputLen: number; + abstract update(buf: Input): this; + abstract digestInto(buf: Uint8Array): void; + abstract digest(): Uint8Array; + /** + * Resets internal state. Makes Hash instance unusable. + * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed + * by user, they will need to manually call `destroy()` when zeroing is necessary. + */ + abstract destroy(): void; + /** + * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()` + * when no options are passed. + * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal + * buffers are overwritten => causes buffer overwrite which is used for digest in some cases. + * There are no guarantees for clean-up because it's impossible in JS. + */ + abstract _cloneInto(to?: T): T; + abstract clone(): T; +} +/** + * XOF: streaming API to read digest in chunks. + * Same as 'squeeze' in keccak/k12 and 'seek' in blake3, but more generic name. + * When hash used in XOF mode it is up to user to call '.destroy' afterwards, since we cannot + * destroy state, next call can require more bytes. + */ +export type HashXOF> = Hash & { + xof(bytes: number): Uint8Array; + xofInto(buf: Uint8Array): Uint8Array; +}; +/** Hash function */ +export type CHash = ReturnType; +/** Hash function with output */ +export type CHashO = ReturnType; +/** XOF with output */ +export type CHashXO = ReturnType; +/** Wraps hash function, creating an interface on top of it */ +export declare function createHasher>(hashCons: () => Hash): { + (msg: Input): Uint8Array; + outputLen: number; + blockLen: number; + create(): Hash; +}; +export declare function createOptHasher, T extends Object>(hashCons: (opts?: T) => Hash): { + (msg: Input, opts?: T): Uint8Array; + outputLen: number; + blockLen: number; + create(opts?: T): Hash; +}; +export declare function createXOFer, T extends Object>(hashCons: (opts?: T) => HashXOF): { + (msg: Input, opts?: T): Uint8Array; + outputLen: number; + blockLen: number; + create(opts?: T): HashXOF; +}; +export declare const wrapConstructor: typeof createHasher; +export declare const wrapConstructorWithOpts: typeof createOptHasher; +export declare const wrapXOFConstructorWithOpts: typeof createXOFer; +/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ +export declare function randomBytes(bytesLength?: number): Uint8Array; +export {}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/utils.d.ts.map b/node_modules/@noble/hashes/utils.d.ts.map new file mode 100644 index 0000000..dd08975 --- /dev/null +++ b/node_modules/@noble/hashes/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,sEAAsE;AAUtE,qFAAqF;AACrF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAEnD;AAED,6CAA6C;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uCAAuC;AACvC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG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AA0B,EAAE,OAAO,WAAyB,CAAC;AAE1E,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,WAAW,SAAK,GAAG,UAAU,CASxD"} \ No newline at end of file diff --git a/node_modules/@noble/hashes/utils.js b/node_modules/@noble/hashes/utils.js new file mode 100644 index 0000000..aed9199 --- /dev/null +++ b/node_modules/@noble/hashes/utils.js @@ -0,0 +1,313 @@ +"use strict"; +/** + * Utilities for hex, bytes, CSPRNG. + * @module + */ +/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.Hash = exports.nextTick = exports.swap32IfBE = exports.byteSwapIfBE = exports.swap8IfBE = exports.isLE = void 0; +exports.isBytes = isBytes; +exports.anumber = anumber; +exports.abytes = abytes; +exports.ahash = ahash; +exports.aexists = aexists; +exports.aoutput = aoutput; +exports.u8 = u8; +exports.u32 = u32; +exports.clean = clean; +exports.createView = createView; +exports.rotr = rotr; +exports.rotl = rotl; +exports.byteSwap = byteSwap; +exports.byteSwap32 = byteSwap32; +exports.bytesToHex = bytesToHex; +exports.hexToBytes = hexToBytes; +exports.asyncLoop = asyncLoop; +exports.utf8ToBytes = utf8ToBytes; +exports.bytesToUtf8 = bytesToUtf8; +exports.toBytes = toBytes; +exports.kdfInputToBytes = kdfInputToBytes; +exports.concatBytes = concatBytes; +exports.checkOpts = checkOpts; +exports.createHasher = createHasher; +exports.createOptHasher = createOptHasher; +exports.createXOFer = createXOFer; +exports.randomBytes = randomBytes; +// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. +// node.js versions earlier than v19 don't declare it in global scope. +// For node.js, package.json#exports field mapping rewrites import +// from `crypto` to `cryptoNode`, which imports native module. +// Makes the utils un-importable in browsers without a bundler. +// Once node.js 18 is deprecated (2025-04-30), we can just drop the import. +const crypto_1 = require("@noble/hashes/crypto"); +/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */ +function isBytes(a) { + return a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array'); +} +/** Asserts something is positive integer. */ +function anumber(n) { + if (!Number.isSafeInteger(n) || n < 0) + throw new Error('positive integer expected, got ' + n); +} +/** Asserts something is Uint8Array. */ +function abytes(b, ...lengths) { + if (!isBytes(b)) + throw new Error('Uint8Array expected'); + if (lengths.length > 0 && !lengths.includes(b.length)) + throw new Error('Uint8Array expected of length ' + lengths + ', got length=' + b.length); +} +/** Asserts something is hash */ +function ahash(h) { + if (typeof h !== 'function' || typeof h.create !== 'function') + throw new Error('Hash should be wrapped by utils.createHasher'); + anumber(h.outputLen); + anumber(h.blockLen); +} +/** Asserts a hash instance has not been destroyed / finished */ +function aexists(instance, checkFinished = true) { + if (instance.destroyed) + throw new Error('Hash instance has been destroyed'); + if (checkFinished && instance.finished) + throw new Error('Hash#digest() has already been called'); +} +/** Asserts output is properly-sized byte array */ +function aoutput(out, instance) { + abytes(out); + const min = instance.outputLen; + if (out.length < min) { + throw new Error('digestInto() expects output buffer of length at least ' + min); + } +} +/** Cast u8 / u16 / u32 to u8. */ +function u8(arr) { + return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); +} +/** Cast u8 / u16 / u32 to u32. */ +function u32(arr) { + return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +} +/** Zeroize a byte array. Warning: JS provides no guarantees. */ +function clean(...arrays) { + for (let i = 0; i < arrays.length; i++) { + arrays[i].fill(0); + } +} +/** Create DataView of an array for easy byte-level manipulation. */ +function createView(arr) { + return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +} +/** The rotate right (circular right shift) operation for uint32 */ +function rotr(word, shift) { + return (word << (32 - shift)) | (word >>> shift); +} +/** The rotate left (circular left shift) operation for uint32 */ +function rotl(word, shift) { + return (word << shift) | ((word >>> (32 - shift)) >>> 0); +} +/** Is current platform little-endian? Most are. Big-Endian platform: IBM */ +exports.isLE = (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); +/** The byte swap operation for uint32 */ +function byteSwap(word) { + return (((word << 24) & 0xff000000) | + ((word << 8) & 0xff0000) | + ((word >>> 8) & 0xff00) | + ((word >>> 24) & 0xff)); +} +/** Conditionally byte swap if on a big-endian platform */ +exports.swap8IfBE = exports.isLE + ? (n) => n + : (n) => byteSwap(n); +/** @deprecated */ +exports.byteSwapIfBE = exports.swap8IfBE; +/** In place byte swap for Uint32Array */ +function byteSwap32(arr) { + for (let i = 0; i < arr.length; i++) { + arr[i] = byteSwap(arr[i]); + } + return arr; +} +exports.swap32IfBE = exports.isLE + ? (u) => u + : byteSwap32; +// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex +const hasHexBuiltin = /* @__PURE__ */ (() => +// @ts-ignore +typeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')(); +// Array where index 0xf0 (240) is mapped to string 'f0' +const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0')); +/** + * Convert byte array to hex string. Uses built-in function, when available. + * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123' + */ +function bytesToHex(bytes) { + abytes(bytes); + // @ts-ignore + if (hasHexBuiltin) + return bytes.toHex(); + // pre-caching improves the speed 6x + let hex = ''; + for (let i = 0; i < bytes.length; i++) { + hex += hexes[bytes[i]]; + } + return hex; +} +// We use optimized technique to convert hex string to byte array +const asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; +function asciiToBase16(ch) { + if (ch >= asciis._0 && ch <= asciis._9) + return ch - asciis._0; // '2' => 50-48 + if (ch >= asciis.A && ch <= asciis.F) + return ch - (asciis.A - 10); // 'B' => 66-(65-10) + if (ch >= asciis.a && ch <= asciis.f) + return ch - (asciis.a - 10); // 'b' => 98-(97-10) + return; +} +/** + * Convert hex string to byte array. Uses built-in function, when available. + * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23]) + */ +function hexToBytes(hex) { + if (typeof hex !== 'string') + throw new Error('hex string expected, got ' + typeof hex); + // @ts-ignore + if (hasHexBuiltin) + return Uint8Array.fromHex(hex); + const hl = hex.length; + const al = hl / 2; + if (hl % 2) + throw new Error('hex string expected, got unpadded hex of length ' + hl); + const array = new Uint8Array(al); + for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { + const n1 = asciiToBase16(hex.charCodeAt(hi)); + const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); + if (n1 === undefined || n2 === undefined) { + const char = hex[hi] + hex[hi + 1]; + throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); + } + array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163 + } + return array; +} +/** + * There is no setImmediate in browser and setTimeout is slow. + * Call of async fn will return Promise, which will be fullfiled only on + * next scheduler queue processing step and this is exactly what we need. + */ +const nextTick = async () => { }; +exports.nextTick = nextTick; +/** Returns control to thread each 'tick' ms to avoid blocking. */ +async function asyncLoop(iters, tick, cb) { + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) + continue; + await (0, exports.nextTick)(); + ts += diff; + } +} +/** + * Converts string to bytes using UTF8 encoding. + * @example utf8ToBytes('abc') // Uint8Array.from([97, 98, 99]) + */ +function utf8ToBytes(str) { + if (typeof str !== 'string') + throw new Error('string expected'); + return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 +} +/** + * Converts bytes to string using UTF8 encoding. + * @example bytesToUtf8(Uint8Array.from([97, 98, 99])) // 'abc' + */ +function bytesToUtf8(bytes) { + return new TextDecoder().decode(bytes); +} +/** + * Normalizes (non-hex) string or Uint8Array to Uint8Array. + * Warning: when Uint8Array is passed, it would NOT get copied. + * Keep in mind for future mutable operations. + */ +function toBytes(data) { + if (typeof data === 'string') + data = utf8ToBytes(data); + abytes(data); + return data; +} +/** + * Helper for KDFs: consumes uint8array or string. + * When string is passed, does utf8 decoding, using TextDecoder. + */ +function kdfInputToBytes(data) { + if (typeof data === 'string') + data = utf8ToBytes(data); + abytes(data); + return data; +} +/** Copies several Uint8Arrays into one. */ +function concatBytes(...arrays) { + let sum = 0; + for (let i = 0; i < arrays.length; i++) { + const a = arrays[i]; + abytes(a); + sum += a.length; + } + const res = new Uint8Array(sum); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const a = arrays[i]; + res.set(a, pad); + pad += a.length; + } + return res; +} +function checkOpts(defaults, opts) { + if (opts !== undefined && {}.toString.call(opts) !== '[object Object]') + throw new Error('options should be object or undefined'); + const merged = Object.assign(defaults, opts); + return merged; +} +/** For runtime check if class implements interface */ +class Hash { +} +exports.Hash = Hash; +/** Wraps hash function, creating an interface on top of it */ +function createHasher(hashCons) { + const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); + const tmp = hashCons(); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = () => hashCons(); + return hashC; +} +function createOptHasher(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} +function createXOFer(hashCons) { + const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest(); + const tmp = hashCons({}); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.create = (opts) => hashCons(opts); + return hashC; +} +exports.wrapConstructor = createHasher; +exports.wrapConstructorWithOpts = createOptHasher; +exports.wrapXOFConstructorWithOpts = createXOFer; +/** Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`. */ +function randomBytes(bytesLength = 32) { + if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') { + return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); + } + // Legacy Node.js compatibility + if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === 'function') { + return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength)); + } + throw new Error('crypto.getRandomValues must be defined'); +} +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@noble/hashes/utils.js.map b/node_modules/@noble/hashes/utils.js.map new file mode 100644 index 0000000..9e5e2f7 --- /dev/null +++ b/node_modules/@noble/hashes/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,sEAAsE;;;AAWtE,0BAEC;AAGD,0BAEC;AAGD,wBAIC;AAGD,sBAKC;AAGD,0BAGC;AAGD,0BAMC;AAQD,gBAEC;AAGD,kBAEC;AAGD,sBAIC;AAGD,gCAEC;AAGD,oBAEC;AAGD,oBAEC;AAOD,4BAOC;AASD,gCAKC;AAoBD,gCAUC;AAeD,gCAkBC;AAUD,8BAcC;AAUD,kCAGC;AAMD,kCAEC;AASD,0BAIC;AAQD,0CAIC;AAGD,kCAcC;AAGD,8BAQC;AAuDD,oCAcC;AAED,0CAcC;AAED,kCAcC;AAMD,kCASC;AApYD,oFAAoF;AACpF,sEAAsE;AACtE,kEAAkE;AAClE,8DAA8D;AAC9D,+DAA+D;AAC/D,2EAA2E;AAC3E,iDAA8C;AAE9C,qFAAqF;AACrF,SAAgB,OAAO,CAAC,CAAU;IAChC,OAAO,CAAC,YAAY,UAAU,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AACnG,CAAC;AAED,6CAA6C;AAC7C,SAAgB,OAAO,CAAC,CAAS;IAC/B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK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AE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACjG,MAAM,GAAG,GAAG,QAAQ,CAAC,EAAO,CAAC,CAAC;IAC9B,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAChC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC9B,KAAK,CAAC,MAAM,GAAG,CAAC,IAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC;AACY,QAAA,eAAe,GAAwB,YAAY,CAAC;AACpD,QAAA,uBAAuB,GAA2B,eAAe,CAAC;AAClE,QAAA,0BAA0B,GAAuB,WAAW,CAAC;AAE1E,sFAAsF;AACtF,SAAgB,WAAW,CAAC,WAAW,GAAG,EAAE;IAC1C,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,eAAe,KAAK,UAAU,EAAE,CAAC;QAC3D,OAAO,eAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,+BAA+B;IAC/B,IAAI,eAAM,IAAI,OAAO,eAAM,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QACvD,OAAO,UAAU,CAAC,IAAI,CAAC,eAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC5D,CAAC"} \ No newline at end of file diff --git a/node_modules/@paralleldrive/cuid2/LICENSE b/node_modules/@paralleldrive/cuid2/LICENSE new file mode 100644 index 0000000..030c537 --- /dev/null +++ b/node_modules/@paralleldrive/cuid2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Eric Elliott + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@paralleldrive/cuid2/README.md b/node_modules/@paralleldrive/cuid2/README.md new file mode 100644 index 0000000..be5503d --- /dev/null +++ b/node_modules/@paralleldrive/cuid2/README.md @@ -0,0 +1,397 @@ +# Cuid2 + +Secure, collision-resistant ids optimized for horizontal scaling and performance. Next generation UUIDs. + +Need unique ids in your app? Forget UUIDs and GUIDs which often collide in large apps. Use Cuid2, instead. + +**Cuid2 is:** + +* **Secure:** It's not feasible to guess the next id, existing valid ids, or learn anything about the referenced data from the id. Cuid2 uses multiple, independent entropy sources and hashes them with a security-audited, NIST-standard cryptographically secure hashing algorithm (Sha3). +* **Collision resistant:** It's extremely unlikely to generate the same id twice (by default, you'd need to generate roughly 4,000,000,000,000,000,000 ids ([`sqrt(36^(24-1) * 26) = 4.0268498e+18`](https://en.wikipedia.org/wiki/Birthday_problem#Square_approximation)) to reach 50% chance of collision.) +* **Horizontally scalable:** Generate ids on multiple machines without coordination. +* **Offline-compatible:** Generate ids without a network connection. +* **URL and name-friendly:** No special characters. +* **Fast and convenient:** No async operations. Won't introduce user-noticeable delays. Less than 5k, gzipped. +* **But not *too fast*:** If you can hash too quickly you can launch parallel attacks to find duplicates or break entropy-hiding. For unique ids, the fastest runner loses the security race. + + +**Cuid2 is not good for:** + +* Sequential ids (see the [note on K-sortable ids](https://github.com/paralleldrive/cuid2#note-on-k-sortablesequentialmonotonically-increasing-ids), below) +* High performance tight loops, such as render loops (if you don't need cross-host unique ids or security, consider a simple counter for this use-case, or try [Ulid](https://github.com/ulid/javascript) or [NanoId](https://github.com/ai/nanoid)). + + +## Getting Started + +``` +npm install --save @paralleldrive/cuid2 +``` + +Or + +``` +yarn add @paralleldrive/cuid2 +``` + +```js +import { createId } from '@paralleldrive/cuid2'; + +const ids = [ + createId(), // 'tz4a98xxat96iws9zmbrgj3a' + createId(), // 'pfh0haxfpzowht3oi213cqos' + createId(), // 'nc6bzmkmd014706rfda898to' +]; +``` + +Using Jest? Jump to [Using with Jest](#using-in-jest). + +### Configuration + +```js +import { init } from '@paralleldrive/cuid2'; + +// The init function returns a custom createId function with the specified +// configuration. All configuration properties are optional. +const createId = init({ + // A custom random function with the same API as Math.random. + // You can use this to pass a cryptographically secure random function. + random: Math.random, + // the length of the id + length: 10, + // A custom fingerprint for the host environment. This is used to help + // prevent collisions when generating ids in a distributed system. + fingerprint: 'a-custom-host-fingerprint', +}); + +console.log( + createId(), // wjfazn7qnd + createId(), // cerhuy9499 + createId(), // itp2u4ozr4 +); +``` + + +### Validation + +```js +import { createId, isCuid } from '@paralleldrive/cuid2'; + + +console.log( + isCuid(createId()), // true + isCuid('not a cuid'), // false +); +``` + + +## Trusted By + +* [Greenruhm](https://twitter.com/greenruhm) +* [Typebot](https://typebot.io/) +* [Submit my project](https://github.com/paralleldrive/cuid2/issues/new?title=Social+proof) + +## Why? + +Ids should be secure by default for the same reason that browser sessions should be secure by default. There are too many things that can go wrong when they're not, and insecure ids can cause problems in unexpected ways, including [unauthorized user](https://www.intruder.io/research/in-guid-we-trust) [account access](https://infosecwriteups.com/bugbounty-how-i-was-able-to-compromise-any-user-account-via-reset-password-functionality-a11bb5f863b3), [unauthorized access to user data](https://infosecwriteups.com/how-this-easy-vulnerability-resulted-in-a-20-000-bug-bounty-from-gitlab-d9dc9312c10a), and accidental leaks of user's personal data which can lead to catastrophic effects, even in innocent-sounding applications like fitness run trackers (see the [2018 Strava Pentagon breach](https://www.engadget.com/2018-02-02-strava-s-fitness-heatmaps-are-a-potential-catastrophe.html) and [PleaseRobMe](https://pleaserobme.com/why)). + +Not all security measures should be considered equal. For example, it's not a good idea to trust your browser's "Cryptographically Secure" Psuedo Random Number Generator (CSPRNG) (used in tools like `uuid` and `nanoid`). For example, there may be [bugs in browser CSPRNGs](https://bugs.chromium.org/p/chromium/issues/detail?id=552749). For many years, Chromium's `Math.random()` [wasn't very random at all](https://thenextweb.com/news/google-chromes-javascript-engine-finally-returns-actual-random-numbers). Cuid was created to solve the issue of untrustworthy entropy in id generators that led to frequent id collisions and related problems in production applications. Instead of trusting a single source of entropy, Cuid2 combines several sources of entropy to provide stronger security and collision-resistance guarantees than are available in other solutions. + +Modern web applications have different requirements than applications written in the early days of GUID (globally unique identifiers) and UUIDs (universally unique identifiers). In particular, Cuid2 aims to provide stronger uniqueness guarantees than any existing GUID or UUID implementation and protect against leaking any information about the data being referenced, or the system that generated the id. + +Cuid2 is the next generation of Cuid, which has been used in thousands of applications for over a decade with no confirmed collision reports. The changes in Cuid2 are significant and could potentially disrupt the many projects that rely on Cuid, so we decided to create a replacement library and id standard, instead. Cuid is now deprecated in favor of Cuid2. + +Entropy is a measure of the total information in a system. In the context of unique ids, a higher entropy will lead to fewer collisions, and can also make it more difficult for an attacker to guess a valid id. + +Cuid2 is made up of the following entropy sources: + +* An initial letter to make the id a usable identifier in JavaScript and HTML/CSS +* The current system time +* Pseudorandom values +* A session counter +* A host fingerprint + +The string is Base36 encoded, which means it contains only lowercase letters and the numbers: 0 - 9, with no special symbols. + + +### Horizontal scalability + +Today's applications don't run on any single machine. + +Applications might need to support online / offline capability, which means we need a way for clients on different hosts to generate ids that won't collide with ids generated by other hosts -- even if they're not connected to the network. + +Most pseudo-random algorithms use time in ms as a random seed. Random IDs lack sufficient entropy when running in separate processes (such as cloned virtual machines or client browsers) to guarantee against collisions. Application developers report v4 UUID collisions causing problems in their applications when the ID generation is distributed between lots of machines such that lots of IDs are generated in the same millisecond. + +Each new client exponentially increases the chance of collision in the same way that each new character in a random string exponentially reduces the chance of collision. Successful apps scale at hundreds or thousands of new clients per day, so fighting the lack of entropy by adding random characters is a recipe for ridiculously long identifiers. + +Because of the nature of this problem, it's possible to build an app from the ground up and scale it to a million users before this problem is detected. By the time you notice the problem (when your peak hour use requires dozens of ids to be created per ms), if your db doesn't have unique constraints on the id because you thought your guids were safe, you're in a world of hurt. Your users start to see data that doesn't belong to them because the db just returns the first ID match it finds. + +Alternatively, you've played it safe and you only let your database create ids. Writes only happen on a master database, and load is spread out over read replicas. But with this kind of strain, you have to start scaling your database writes horizontally, too, and suddenly your application starts to crawl (if the db is smart enough to guarantee unique ids between write hosts), or you start getting id collisions between different db hosts, so your write hosts don't agree about which ids represent which data. + + +### Performance + +Id generation should be fast enough that humans won't notice a delay, but too slow to feasibly brute force (even in parallel). That means no waiting around for asynchronous entropy pool requests, or cross-process/cross-network communication. Performance slows to impracticality in the browser. All sources of entropy need to be fast enough for synchronous access. + +Even worse, when the database is the only guarantee that ids are unique, that means that clients are forced to send incomplete records to the database, and wait for a network round-trip before they can use the ids in any algorithm. Forget about fast client performance. It simply isn't possible. + +That situation has caused some clients to create ids that are only usable in a single client session (such as an in-memory counter). When the database returns the real id, the client has to do some juggling logic to swap out the id being used, adding complexity to the client implementation code. + +If client side ID generation were stronger, the chances of collision would be much smaller, and the client could send complete records to the db for insertion without waiting for a full round-trip request to finish before using the ID. + + +#### Tiny + +Page loads need to be FAST, and that means we can't waste a lot of JavaScript on a complex algorithm. Cuid2 is tiny. This is especially important for thick-client JavaScript applications. + + +### Secure + +Client-visible ids often need to have sufficient random data and entropy to make it practically impossible to try to guess valid IDs based on an existing, known id. That makes simple sequential ids unusable in the context of client-side generated database keys. Additionally, using V4 UUIDs is also not safe, because there are known attacks on several id generating algorithms that a sophisticated attacker can use to predict next ids. Cuid2 has been audited by security experts and artificial intelligence, and is considered safe to use for use-cases like secret sharing links. + + +### Portable + +Most stronger forms of the UUID / GUID algorithms require access to OS services that are not available in browsers, meaning that they are impossible to implement as specified. Further, our id standard needs to be portable to many languages (the original cuid has 22 different language implementations). + +#### Ports + +* [Cuid2 for Clojure](https://github.com/hden/cuid2) - [Haokang Den](https://github.com/hden) +* [Cuid2 for ColdFusion](https://github.com/bennadel/CUID2-For-ColdFusion) - [Ben Nadel](https://github.com/bennadel) +* [Cuid2 for Dart](https://github.com/obsidiaHQ/cuid2) - [George Mamar](https://github.com/obsidiaHQ) +* [Cuid2 for Java](https://github.com/thibaultmeyer/cuid-java) - [Thibault Meyer](https://github.com/thibaultmeyer) +* [Cuid2 for .NET](https://github.com/visus-io/cuid.net) - [Visus](https://github.com/xaevik) +* [Cuid2 for PHP](https://github.com/visus-io/php-cuid2) - [Visus](https://github.com/xaevik) +* [Cuid2 for Python](https://github.com/gordon-code/cuid2) - [Gordon Code](https://github.com/gordon-code) +* [Cuid2 for Ruby](https://github.com/stulzer/cuid2/blob/main/lib/cuid2.rb) - [Rubens Stulzer](https://github.com/stulzer) +* [Cuid2 for Rust](https://github.com/mplanchard/cuid-rust) - [Matthew Planchard](https://github.com/mplanchard) + +## Improvements Over Cuid + +The original Cuid served us well for more than a decade. We used it across 2 different social networks, and to generate ids for Adobe Creative Cloud. We never had a problem with collisions in production systems using it. But there was room for improvement. + +### Better Collision Resistance + +Available entropy is the maximum number of unique ids that can be generated. Generally more entropy leads to lower probability of collision. For simplicity, we will assume a perfectly random distribution in the following discussion. + +The original Cuid ran for more than 10 years in across thousands of software implementations with zero confirmed collision reports, in some cases with more than 100 million users generating ids. + +The original Cuid had a maximum available entropy of about `3.71319E+29` (assuming 1 id per session). That's already a really big number, but the maximum recommended entropy in Cuid2 is `4.57458E+49`. For reference, that's about the same entropy difference as the size of a mosquito compared to the distance from earth to the nearest star. Cuid2 has a default entropy of `1.62155E+37`, which is a significant increase from the original Cuid and is comparable to the difference between the size of a baseball and the size of the moon. + +The hashing function mixes all the sources of entropy together into a single value, so it's important we use a high quality hashing algorithm. We have tested billions of ids with Cuid2 with zero collisions detected to-date. + + +### More Portable + +The original Cuid used different methods to generate fingerprints across different kinds of hosts, including browsers, Node, and React Native. Unfortunately, this caused several compatability problems across the cuid user ecosystem. + +In Node, each production host was slightly different, and we could reliable grab process ids and such to differentiate between hosts. Our early assumptions about different hosts generating different PIDs in Node proved to be false when we started deploying on cloud virtual hosts using identical containers and micro-container architectures. The result was that host fingerprint entropy was low in Node, limiting their ability to provide good collision resistance for horizontal server scaling in environments like cloud workers and micro-containers. + +It was also not possible to customize your fingerprint function if you had different fingerprinting needs using Cuid, e.g., if both `global` and `window` are `undefined`. + +Cuid2 uses a list of all global names in the JavaScript environment. Hashing it produces a very good host fingerprint, but we intentionally did not include a hash function in the original Cuid because all the secure ones we could find would bloat the bundle, so the original Cuid was unable to take full advantage of all of that unique host entropy. + +In Cuid2, we use a tiny, fast, security-audited, NIST-standardized hash function and we seed it with random entropy, so on production environments where the globals are all identical, we lose the unique fingerprint, but still get random entropy to replace it, strengthening collision resistance. + + +### Deterministic Length + +Length was non-deterministic in Cuid. This worked fine in almost all cases, but proved to be problematic for some data structure uses, forcing some users to create wrapper code to pad the output. We recommend sticking to the defaults for most cases, but if you don't need strong uniqueness guarantees, (e.g., your use-case is something like username or URL disambiguation), it can be fine to use a shorter version. + + +### More Efficient Session Counter Entropy + +The original Cuid wasted entropy on session counters that were not always used, rarely filled, and sometimes rolled over, meaning they could collide with each other if you generate enough ids in a tight loop, reducing their effectiveness. Cuid2 initializes the counter with a random number so the entropy is never wasted. It also uses the full precision of the native JS number type. If you only generate a single id, the counter just extends the random entropy, rather than wasting digits, providing even stronger anti-collision protection. + + +### Parameterized Length + +Different use-cases have different needs for entropy resistance. Sometimes, a short disambiguating series of random digits is enough: for example, it's common to use short slugs to disambiguate similar names, e.g. usernames or URL slugs. Since the original cuid did not hash its output, we had to make some seriously limiting entropy decisions to produce a short slug. In the new version, all sources of entropy are mixed with the hash function, and you can safely grab a substring of any length shorter than 32 digits. You can roughly estimate how many ids you can generate before reaching 50% chance of collision with: [`sqrt(36^(n-1)*26)`](https://en.wikipedia.org/wiki/Birthday_problem#Square_approximation), so if you use `4` digits, you'll reach 50% chance of collision after generating only `~1101` ids. That might be fine for username disambiguation. Are there more than 1k people who want to share the same username? + +By default, you'd need to generate `~4.0268498e+18` ids to reach a 50% chance of collision, and at maximum length, you'd need to generate `~6.7635614e+24` ids to reach 50% odds of collision. To use a custom length, import the `init` function, which takes configuration options: + +```js +import { init } from '@paralleldrive/cuid2'; +const length = 10; // 50% odds of collision after ~51,386,368 ids +const cuid = init({ length }); +console.log(cuid()); // nw8zzfaa4v +``` + + +### Enhanced Security + +The original Cuid leaked details about the id, including very limited data from the host environment (via the host fingerprint), and the exact time that the id was created. The new Cuid2 hashes all sources of entropy into a random-looking string. + +Due to the hashing algorithm, it should not be practically possible to recover any of the entropy sources from the generated ids. Cuid used roughly monotonically increasing ids for database performance reasons. Some people abused them to select data by creation date. If you want to be able to sort items by creation date, we recommend making a separate, indexed `createdAt` field in your database instead of using monotonic ids because: + +* It's easy to trick a client system to generate ids in the past or future. +* Order is not guaranteed across multiple hosts generating ids at nearly the same time. +* Deterministically monotic resolution was never guaranteed. + +In Cuid2, the hashing algorithm uses a salt. The salt is a random string which is added to the input entropy sources before the hashing function is applied. This makes it much more difficult for an attacker to guess valid ids, as the salt changes with each id, meaning the attacker is unable to use any existing ids as a basis for guessing others. + + +## Comparisons + +Security was the primary motivation for creating Cuid2. Our ids should be default-secure for the same reason we use https instead of http. The problem is, all our current id specifications are based on decades-old standards that were never designed with security in mind, optimizing for database performance charactaristics which are no longer relevant in modern, distributed applications. Almost all of the popular ids today optimize for being k-sortable, which was important 10 years ago. Here's what k-sortable means, and why it's no longer as important is it was when we created the Cuid specification which [helped inspire current standards like UUID v6 - v8](https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-00.html#section-11.2): + + +### Note on K-Sortable/Sequential/Monotonically Increasing Ids + +TL;DR: Stop worrying about K-Sortable ids. They're not a big deal anymore. Use `createdAt` fields instead. + +**The performance impact of using sequential keys in modern systems is often exaggerated.** If your database is too small to use cloud-native solutions, it's also too small to worry about the performance impact of sequential vs random ids unless you're living in the distant past (i.e. you're using hardware from 2010). If it's large enough to worry, random ids may still be faster. + +In the past, sequential keys could potentially have a significant impact on performance, but this is no longer the case in modern systems. + +One reason for using sequential keys is to avoid id fragmentation, which can require a large amount of disk space for databases with billions of records. However, at such a large scale, modern systems often use cloud-native databases that are designed to handle terabytes of data efficiently and at a low cost. Additionally, the entire database may be stored in memory, providing fast random-access lookup performance. Therefore, the impact of fragmented keys on performance is minimal. + +Worse, K-Sortable ids are not always a good thing for performance anyway, because they can cause hotspots in the database. If you have a system that generates a large number of ids in a short period of time, the ids will be generated in a sequential order, causing the tree to become unbalanced, which will lead to frequent rebalancing. This can cause a significant performance impact. + +So what kinds of operations suffer from a non-sequential id? Paged, sorted operations. Stuff like "fetch me 100000 records, sorted by id". That would be noticeably impacted, but how often do you need to sort by id if your id is opaque? I have never needed to. Modern cloud databases allow you to create indexes on `createdAt` fields which perform extremely well. + +The worst part of K-Sortable ids is their impact on security. K-Sortable = insecure. + + +### The Contenders + +We're unaware of any standard or library in the space that adequately meets all of our requirements. We'll use the following criteria to filter a list of commonly used alternatives. Let's start with the contenders: + +Database increment (Int, BigInt, AutoIncrement), [UUID v1 - v8](https://www.ietf.org/archive/id/draft-ietf-UUIDrev-rfc4122bis-00.html), [NanoId](https://github.com/ai/nanoid), [Ulid](https://github.com/ulid/javascript), [Sony Snowflake](https://github.com/sony/sonyflake) (inspired by Twitter Snowflake), [ShardingID](https://instagram-engineering.com/sharding-ids-at-instagram-1cf5a71e5a5c) (Instagram), [KSUID](https://github.com/segmentio/ksuid), [PushId](https://firebase.blog/posts/2015/02/the-2120-ways-to-ensure-unique_68) (Google), [XID](https://github.com/rs/xid), [ObjectId](https://www.mongodb.com/docs/manual/reference/method/ObjectId/) (MongoDB). + +Here are the disqualifiers we care about: + +* **Leaks information:** Database auto-increment, all UUIDs (except V4 and including V6 - V8), Ulid, Snowflake, ShardingId, pushId, ObjectId, KSUID +* **Collision Prone:** Database auto-increment, v4 UUID +* **Not cryptographically secure random output:** Database auto-increment, UUID v1, UUID v4 +* **Requires distributed coordination:** Snowflake, ShardingID, database increment +* **Not URL or name friendly:** UUID (too long, dashes), Ulid (too long), UUID v7 (too long) - anything else that supports special characters like dashes, spaces, underscores, #$%^&, etc. +* **Too fast:** UUID v1, UUID v4, NanoId, Ulid, Xid + + +Here are the qualifiers we care about: + +* **Secure - No leaked info, attack-resistant:** Cuid2, NanoId (Medium - trusts web crypto API entropy). +* **Collision resistant:** Cuid2, Cuid v1, NanoId, Snowflake, KSUID, XID, Ulid, ShardingId, ObjectId, UUID v6 - v8. +* **Horizontally scalable:** Cuid2, Cuid v1, NanoId, ObjectId, Ulid, KSUID, Xid, ShardingId, ObjectId, UUID v6 - v8. +* **Offline-compatible:** Cuid2, Cuid v1, NanoId, Ulid, UUID v6 - v8. +* **URL and name-friendly:** Cuid2, Cuid v1, NanoId (with custom alphabet). +* **Fast and convenient:** Cuid2, Cuid v1, NanoId, Ulid, KSUID, Xid, UUID v4, UUID v7. +* **But not *too fast*:** Cuid2, Cuid v1, UUID v7, Snowflake, ShardingId, ObjectId. + +Cuid2 is the only solution that passed all of our tests. + + +### NanoId and Ulid + +Overall, NanoId and Ulid seem to hit most of our requirements, Ulid leaks timestamps, and they both trust the random entropy from the Web Crypto API too much. The Web Crypto API trusts 2 untrustworthy things: The [random entropy source](https://docs.rs/bug/0.2.0/bug/rand/index.html#cryptographic-security), and the hashing algorithm used to stretch the entropy into random-looking data. Some implementations have had [serious bugs that made them vulnerable to attack](https://bugs.chromium.org/p/chromium/issues/detail?id=552749). + +Along with using cryptographically secure methods, Cuid2 supplies its own known entropy from a diverse pool and uses a security audited, NIST-standard cryptographically secure hashing algorithm. + +**Too fast:** NanoId and Ulid are also very fast. But that's not a good thing. The faster you can generate ids, the faster you can run collision attacks. Bad guys looking for statistical anomalies in the distribution of ids can use the speed of NanoId to their advantage. Cuid2 is fast enough to be convenient, but not so fast that it's a security risk. + + +#### Entropy Security Comparison + +* NanoId Entropy: Web Crypto. +* Ulid Entropy: Web Crypto + time stamp (leaked). +* Cuid2 Entropy: Web Crypto + time stamp + counter + host fingerprint + hashing algorithm. + + +## Testing + +Before each commit, we test over 10 million ids generated in parallel across 7 different CPU cores. With each batch of tests, we run a histogram analysis to ensure an even, random distribution across the entire entropy range. Any bias would make it more likely for ids to collide, so our tests will automatically fail if it finds any. + +Screen Shot 2022-12-30 at 6 19 15 PM + + +We also generate randograms and do spot visual inspections. + +![randogram](public/randogram.png) + +## Troubleshooting + +Some React Native environments may be missing TextEncoding features, which will need to be polyfilled. The following have both worked for users who have encountered this issue: + +``` +npm install --save fast-text-encoding +``` + +Then, before importing Cuid2: + +```js +import "fast-text-encoding"; +``` + +Alternatively, if that doesn't work: + +``` +npm install --save text-encoding-polyfill +``` + +Then, before importing Cuid2: + +```js +import "text-encoding-polyfill"; +``` + +### Using in Jest + +Jest uses jsdom, which builds a global object which doesn't comply with current standards. There is a known issue in Jest when jsdom environment is used. The results of `new TextEncoder().encode()` and `new Uint8Array()` are different, refer to [jestjs/jest#9983](https://github.com/jestjs/jest/issues/9983). + +To work around this limitation on jsdom (and by extension, Jest), you'll need to use custom environment which overwrites Uint8Array provided by jsdom: + +Install jest-environment-jsdom. Make sure to use the same version as your jest. See [this answer on Stackoverflow for reference](https://stackoverflow.com/a/72124554). + +``` +❯ npm i jest-environment-jsdom@27 +``` + +Create `jsdom-env.js` file in the root: + +```js +const JSDOMEnvironmentBase = require('jest-environment-jsdom'); + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +class JSDOMEnvironment extends JSDOMEnvironmentBase { + constructor(...args) { + const { global } = super(...args); + + global.Uint8Array = Uint8Array; + } +} + +exports.default = JSDOMEnvironment; +exports.TestEnvironment = JSDOMEnvironment; +``` + +Update scripts to use the custom environment: + +```js +{ + // ... + "scripts": { + // ... + "test": "react-scripts test --env=./jsdom-env.js", + // ... + }, +} +``` + +#### JSDOM is Missing Features + +JSDOM doesn't support TextEncoder and TextDecoder, refer jsdom/jsdom#2524. + +In Jest, features like Uint8Array/TextEncoder/TextDecoder may be available in the jsdom environment but may produce results different from the platform standards. These are known bugs which may be resolved by jsdom at some point, but there is no clear ETA. + +Note that this issue may impact any package that relies on the TextEncoder or TextDecorder standards. If you would like to use a simple test runner that just works, try [Riteway](https://github.com/paralleldrive/riteway). + + +## Sponsors + +This project is made possible by: + +* [DevAnywhere](https://devanywhere.io) - Expert mentorship for software builders, from junior developers to software leaders like VPE, CTO, and CEO. +* [EricElliottJS.com](https://ericelliottjs.com) - Learn JavaScript on demand with videos and interactive lessons. diff --git a/node_modules/@paralleldrive/cuid2/index.d.ts b/node_modules/@paralleldrive/cuid2/index.d.ts new file mode 100644 index 0000000..fccc626 --- /dev/null +++ b/node_modules/@paralleldrive/cuid2/index.d.ts @@ -0,0 +1,19 @@ +declare namespace cuid2 { + export function getConstants(): { + defaultLength: number + bigLength: number + } + + export function init(options?: { + random?: () => number + counter?: () => number + length?: number + fingerprint?: string + }): () => string + + export function isCuid(id: string): boolean + + export function createId(): string +} + +export = cuid2; diff --git a/node_modules/@paralleldrive/cuid2/index.js b/node_modules/@paralleldrive/cuid2/index.js new file mode 100644 index 0000000..88dff60 --- /dev/null +++ b/node_modules/@paralleldrive/cuid2/index.js @@ -0,0 +1,6 @@ +const { createId, init, getConstants, isCuid } = require("./src/index"); + +module.exports.createId = createId; +module.exports.init = init; +module.exports.getConstants = getConstants; +module.exports.isCuid = isCuid; diff --git a/node_modules/@paralleldrive/cuid2/package.json b/node_modules/@paralleldrive/cuid2/package.json new file mode 100644 index 0000000..871daa0 --- /dev/null +++ b/node_modules/@paralleldrive/cuid2/package.json @@ -0,0 +1,69 @@ +{ + "name": "@paralleldrive/cuid2", + "private": false, + "types": "index.d.ts", + "files": [ + "src/index.js", + "index.js", + "index.d.ts" + ], + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint --fix", + "typescript": "npx -p typescript tsc --esModuleInterop --rootDir . src/index-test.js --noEmit --allowJs --checkJs --target es2020 --moduleResolution node && echo 'TypeScript Complete.'", + "test": "NODE_ENV=test node src/index-test.js", + "test-color": "NODE_ENV=test node src/index-test.js | tap-nirvana", + "collision-test": "NODE_ENV=test node src/collision-test.js | tap-nirvana", + "histogram": "NODE_ENV=test node src/histogram.js | tap-nirvana", + "watch": "watch 'npm run -s test | tap-nirvana && npm run -s lint && npm run -s typescript' src", + "update": "updtr", + "release": "release-it" + }, + "pre-commit": [ + "lint", + "test-color", + "collision-test" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/ericelliott/cuid2.git" + }, + "keywords": [ + "uuid", + "guid", + "cuid", + "unique", + "id", + "ids", + "identifier", + "identifiers" + ], + "author": "Eric Elliott", + "license": "MIT", + "bugs": { + "url": "https://github.com/ericelliott/cuid2/issues" + }, + "homepage": "https://github.com/ericelliott/cuid2#readme", + "devDependencies": { + "eslint": "8.30.0", + "eslint-config-next": "13.1.1", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-prettier": "4.2.1", + "next": "13.1.1", + "pre-commit": "1.2.2", + "prettier": "2.8.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "release-it": "15.5.1", + "riteway": "7.0.0", + "tap-nirvana": "1.1.0", + "updtr": "4.0.0", + "watch": "1.0.2" + }, + "dependencies": { + "@noble/hashes": "^1.1.5" + }, + "version": "2.3.1" +} diff --git a/node_modules/@paralleldrive/cuid2/src/index.js b/node_modules/@paralleldrive/cuid2/src/index.js new file mode 100644 index 0000000..db29ad3 --- /dev/null +++ b/node_modules/@paralleldrive/cuid2/src/index.js @@ -0,0 +1,127 @@ +/* global global, window, module */ +const { sha3_512: sha3 } = require("@noble/hashes/sha3"); + +const defaultLength = 24; +const bigLength = 32; + +const createEntropy = (length = 4, random = Math.random) => { + let entropy = ""; + + while (entropy.length < length) { + entropy = entropy + Math.floor(random() * 36).toString(36); + } + return entropy; +}; + +/* + * Adapted from https://github.com/juanelas/bigint-conversion + * MIT License Copyright (c) 2018 Juan Hernández Serrano + */ +function bufToBigInt(buf) { + let bits = 8n; + + let value = 0n; + for (const i of buf.values()) { + const bi = BigInt(i); + value = (value << bits) + bi; + } + return value; +} + +const hash = (input = "") => { + // Drop the first character because it will bias the histogram + // to the left. + return bufToBigInt(sha3(input)).toString(36).slice(1); +}; + +const alphabet = Array.from({ length: 26 }, (x, i) => + String.fromCharCode(i + 97) +); + +const randomLetter = (random) => + alphabet[Math.floor(random() * alphabet.length)]; + +/* +This is a fingerprint of the host environment. It is used to help +prevent collisions when generating ids in a distributed system. +If no global object is available, you can pass in your own, or fall back +on a random string. +*/ +const createFingerprint = ({ + globalObj = typeof global !== "undefined" + ? global + : typeof window !== "undefined" + ? window + : {}, + random = Math.random, +} = {}) => { + const globals = Object.keys(globalObj).toString(); + const sourceString = globals.length + ? globals + createEntropy(bigLength, random) + : createEntropy(bigLength, random); + + return hash(sourceString).substring(0, bigLength); +}; + +const createCounter = (count) => () => { + return count++; +}; + +// ~22k hosts before 50% chance of initial counter collision +// with a remaining counter range of 9.0e+15 in JavaScript. +const initialCountMax = 476782367; + +const init = ({ + // Fallback if the user does not pass in a CSPRNG. This should be OK + // because we don't rely solely on the random number generator for entropy. + // We also use the host fingerprint, current time, and a session counter. + random = Math.random, + counter = createCounter(Math.floor(random() * initialCountMax)), + length = defaultLength, + fingerprint = createFingerprint({ random }), +} = {}) => { + return function cuid2() { + const firstLetter = randomLetter(random); + + // If we're lucky, the `.toString(36)` calls may reduce hashing rounds + // by shortening the input to the hash function a little. + const time = Date.now().toString(36); + const count = counter().toString(36); + + // The salt should be long enough to be globally unique across the full + // length of the hash. For simplicity, we use the same length as the + // intended id output. + const salt = createEntropy(length, random); + const hashInput = `${time + salt + count + fingerprint}`; + + return `${firstLetter + hash(hashInput).substring(1, length)}`; + }; +}; + +const createId = init(); + +const isCuid = (id, { minLength = 2, maxLength = bigLength } = {}) => { + const length = id.length; + const regex = /^[0-9a-z]+$/; + + try { + if ( + typeof id === "string" && + length >= minLength && + length <= maxLength && + regex.test(id) + ) + return true; + } finally { + } + + return false; +}; + +module.exports.getConstants = () => ({ defaultLength, bigLength }); +module.exports.init = init; +module.exports.createId = createId; +module.exports.bufToBigInt = bufToBigInt; +module.exports.createCounter = createCounter; +module.exports.createFingerprint = createFingerprint; +module.exports.isCuid = isCuid; diff --git a/node_modules/@pkgjs/parseargs/.editorconfig b/node_modules/@pkgjs/parseargs/.editorconfig new file mode 100644 index 0000000..b140163 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Copied from Node.js to ease compatibility in PR. +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true +quote_type = single diff --git a/node_modules/@pkgjs/parseargs/CHANGELOG.md b/node_modules/@pkgjs/parseargs/CHANGELOG.md new file mode 100644 index 0000000..2adc7d3 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/CHANGELOG.md @@ -0,0 +1,147 @@ +# Changelog + +## [0.11.0](https://github.com/pkgjs/parseargs/compare/v0.10.0...v0.11.0) (2022-10-08) + + +### Features + +* add `default` option parameter ([#142](https://github.com/pkgjs/parseargs/issues/142)) ([cd20847](https://github.com/pkgjs/parseargs/commit/cd20847a00b2f556aa9c085ac83b942c60868ec1)) + +## [0.10.0](https://github.com/pkgjs/parseargs/compare/v0.9.1...v0.10.0) (2022-07-21) + + +### Features + +* add parsed meta-data to returned properties ([#129](https://github.com/pkgjs/parseargs/issues/129)) ([91bfb4d](https://github.com/pkgjs/parseargs/commit/91bfb4d3f7b6937efab1b27c91c45d1205f1497e)) + +## [0.9.1](https://github.com/pkgjs/parseargs/compare/v0.9.0...v0.9.1) (2022-06-20) + + +### Bug Fixes + +* **runtime:** support node 14+ ([#135](https://github.com/pkgjs/parseargs/issues/135)) ([6a1c5a6](https://github.com/pkgjs/parseargs/commit/6a1c5a6f7cadf2f035e004027e2742e3c4ce554b)) + +## [0.9.0](https://github.com/pkgjs/parseargs/compare/v0.8.0...v0.9.0) (2022-05-23) + + +### ⚠ BREAKING CHANGES + +* drop handling of electron arguments (#121) + +### Code Refactoring + +* drop handling of electron arguments ([#121](https://github.com/pkgjs/parseargs/issues/121)) ([a2ffd53](https://github.com/pkgjs/parseargs/commit/a2ffd537c244a062371522b955acb45a404fc9f2)) + +## [0.8.0](https://github.com/pkgjs/parseargs/compare/v0.7.1...v0.8.0) (2022-05-16) + + +### ⚠ BREAKING CHANGES + +* switch type:string option arguments to greedy, but with error for suspect cases in strict mode (#88) +* positionals now opt-in when strict:true (#116) +* create result.values with null prototype (#111) + +### Features + +* create result.values with null prototype ([#111](https://github.com/pkgjs/parseargs/issues/111)) ([9d539c3](https://github.com/pkgjs/parseargs/commit/9d539c3d57f269c160e74e0656ad4fa84ff92ec2)) +* positionals now opt-in when strict:true ([#116](https://github.com/pkgjs/parseargs/issues/116)) ([3643338](https://github.com/pkgjs/parseargs/commit/364333826b746e8a7dc5505b4b22fd19ac51df3b)) +* switch type:string option arguments to greedy, but with error for suspect cases in strict mode ([#88](https://github.com/pkgjs/parseargs/issues/88)) ([c2b5e72](https://github.com/pkgjs/parseargs/commit/c2b5e72161991dfdc535909f1327cc9b970fe7e8)) + +### [0.7.1](https://github.com/pkgjs/parseargs/compare/v0.7.0...v0.7.1) (2022-04-15) + + +### Bug Fixes + +* resist pollution ([#106](https://github.com/pkgjs/parseargs/issues/106)) ([ecf2dec](https://github.com/pkgjs/parseargs/commit/ecf2dece0a9f2a76d789384d5d71c68ffe64022a)) + +## [0.7.0](https://github.com/pkgjs/parseargs/compare/v0.6.0...v0.7.0) (2022-04-13) + + +### Features + +* Add strict mode to parser ([#74](https://github.com/pkgjs/parseargs/issues/74)) ([8267d02](https://github.com/pkgjs/parseargs/commit/8267d02083a87b8b8a71fcce08348d1e031ea91c)) + +## [0.6.0](https://github.com/pkgjs/parseargs/compare/v0.5.0...v0.6.0) (2022-04-11) + + +### ⚠ BREAKING CHANGES + +* rework results to remove redundant `flags` property and store value true for boolean options (#83) +* switch to existing ERR_INVALID_ARG_VALUE (#97) + +### Code Refactoring + +* rework results to remove redundant `flags` property and store value true for boolean options ([#83](https://github.com/pkgjs/parseargs/issues/83)) ([be153db](https://github.com/pkgjs/parseargs/commit/be153dbed1d488cb7b6e27df92f601ba7337713d)) +* switch to existing ERR_INVALID_ARG_VALUE ([#97](https://github.com/pkgjs/parseargs/issues/97)) ([084a23f](https://github.com/pkgjs/parseargs/commit/084a23f9fde2da030b159edb1c2385f24579ce40)) + +## [0.5.0](https://github.com/pkgjs/parseargs/compare/v0.4.0...v0.5.0) (2022-04-10) + + +### ⚠ BREAKING CHANGES + +* Require type to be specified for each supplied option (#95) + +### Features + +* Require type to be specified for each supplied option ([#95](https://github.com/pkgjs/parseargs/issues/95)) ([02cd018](https://github.com/pkgjs/parseargs/commit/02cd01885b8aaa59f2db8308f2d4479e64340068)) + +## [0.4.0](https://github.com/pkgjs/parseargs/compare/v0.3.0...v0.4.0) (2022-03-12) + + +### ⚠ BREAKING CHANGES + +* parsing, revisit short option groups, add support for combined short and value (#75) +* restructure configuration to take options bag (#63) + +### Code Refactoring + +* parsing, revisit short option groups, add support for combined short and value ([#75](https://github.com/pkgjs/parseargs/issues/75)) ([a92600f](https://github.com/pkgjs/parseargs/commit/a92600fa6c214508ab1e016fa55879a314f541af)) +* restructure configuration to take options bag ([#63](https://github.com/pkgjs/parseargs/issues/63)) ([b412095](https://github.com/pkgjs/parseargs/commit/b4120957d90e809ee8b607b06e747d3e6a6b213e)) + +## [0.3.0](https://github.com/pkgjs/parseargs/compare/v0.2.0...v0.3.0) (2022-02-06) + + +### Features + +* **parser:** support short-option groups ([#59](https://github.com/pkgjs/parseargs/issues/59)) ([882067b](https://github.com/pkgjs/parseargs/commit/882067bc2d7cbc6b796f8e5a079a99bc99d4e6ba)) + +## [0.2.0](https://github.com/pkgjs/parseargs/compare/v0.1.1...v0.2.0) (2022-02-05) + + +### Features + +* basic support for shorts ([#50](https://github.com/pkgjs/parseargs/issues/50)) ([a2f36d7](https://github.com/pkgjs/parseargs/commit/a2f36d7da4145af1c92f76806b7fe2baf6beeceb)) + + +### Bug Fixes + +* always store value for a=b ([#43](https://github.com/pkgjs/parseargs/issues/43)) ([a85e8dc](https://github.com/pkgjs/parseargs/commit/a85e8dc06379fd2696ee195cc625de8fac6aee42)) +* support single dash as positional ([#49](https://github.com/pkgjs/parseargs/issues/49)) ([d795bf8](https://github.com/pkgjs/parseargs/commit/d795bf877d068fd67aec381f30b30b63f97109ad)) + +### [0.1.1](https://github.com/pkgjs/parseargs/compare/v0.1.0...v0.1.1) (2022-01-25) + + +### Bug Fixes + +* only use arrays in results for multiples ([#42](https://github.com/pkgjs/parseargs/issues/42)) ([c357584](https://github.com/pkgjs/parseargs/commit/c357584847912506319ed34a0840080116f4fd65)) + +## 0.1.0 (2022-01-22) + + +### Features + +* expand scenarios covered by default arguments for environments ([#20](https://github.com/pkgjs/parseargs/issues/20)) ([582ada7](https://github.com/pkgjs/parseargs/commit/582ada7be0eca3a73d6e0bd016e7ace43449fa4c)) +* update readme and include contributing guidelines ([8edd6fc](https://github.com/pkgjs/parseargs/commit/8edd6fc863cd705f6fac732724159ebe8065a2b0)) + + +### Bug Fixes + +* do not strip excess leading dashes on long option names ([#21](https://github.com/pkgjs/parseargs/issues/21)) ([f848590](https://github.com/pkgjs/parseargs/commit/f848590ebf3249ed5979ff47e003fa6e1a8ec5c0)) +* name & readme ([3f057c1](https://github.com/pkgjs/parseargs/commit/3f057c1b158a1bdbe878c64b57460c58e56e465f)) +* package.json values ([9bac300](https://github.com/pkgjs/parseargs/commit/9bac300e00cd76c77076bf9e75e44f8929512da9)) +* update readme name ([957d8d9](https://github.com/pkgjs/parseargs/commit/957d8d96e1dcb48297c0a14345d44c0123b2883e)) + + +### Build System + +* first release as minor ([421c6e2](https://github.com/pkgjs/parseargs/commit/421c6e2569a8668ad14fac5a5af5be60479a7571)) diff --git a/node_modules/@pkgjs/parseargs/LICENSE b/node_modules/@pkgjs/parseargs/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@pkgjs/parseargs/README.md b/node_modules/@pkgjs/parseargs/README.md new file mode 100644 index 0000000..0a04192 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/README.md @@ -0,0 +1,413 @@ + +# parseArgs + +[![Coverage][coverage-image]][coverage-url] + +Polyfill of `util.parseArgs()` + +## `util.parseArgs([config])` + + + +> Stability: 1 - Experimental + +* `config` {Object} Used to provide arguments for parsing and to configure + the parser. `config` supports the following properties: + * `args` {string\[]} array of argument strings. **Default:** `process.argv` + with `execPath` and `filename` removed. + * `options` {Object} Used to describe arguments known to the parser. + Keys of `options` are the long names of options and values are an + {Object} accepting the following properties: + * `type` {string} Type of argument, which must be either `boolean` or `string`. + * `multiple` {boolean} Whether this option can be provided multiple + times. If `true`, all values will be collected in an array. If + `false`, values for the option are last-wins. **Default:** `false`. + * `short` {string} A single character alias for the option. + * `default` {string | boolean | string\[] | boolean\[]} The default option + value when it is not set by args. It must be of the same type as the + the `type` property. When `multiple` is `true`, it must be an array. + * `strict` {boolean} Should an error be thrown when unknown arguments + are encountered, or when arguments are passed that do not match the + `type` configured in `options`. + **Default:** `true`. + * `allowPositionals` {boolean} Whether this command accepts positional + arguments. + **Default:** `false` if `strict` is `true`, otherwise `true`. + * `tokens` {boolean} Return the parsed tokens. This is useful for extending + the built-in behavior, from adding additional checks through to reprocessing + the tokens in different ways. + **Default:** `false`. + +* Returns: {Object} The parsed command line arguments: + * `values` {Object} A mapping of parsed option names with their {string} + or {boolean} values. + * `positionals` {string\[]} Positional arguments. + * `tokens` {Object\[] | undefined} See [parseArgs tokens](#parseargs-tokens) + section. Only returned if `config` includes `tokens: true`. + +Provides a higher level API for command-line argument parsing than interacting +with `process.argv` directly. Takes a specification for the expected arguments +and returns a structured object with the parsed options and positionals. + +```mjs +import { parseArgs } from 'node:util'; +const args = ['-f', '--bar', 'b']; +const options = { + foo: { + type: 'boolean', + short: 'f' + }, + bar: { + type: 'string' + } +}; +const { + values, + positionals +} = parseArgs({ args, options }); +console.log(values, positionals); +// Prints: [Object: null prototype] { foo: true, bar: 'b' } [] +``` + +```cjs +const { parseArgs } = require('node:util'); +const args = ['-f', '--bar', 'b']; +const options = { + foo: { + type: 'boolean', + short: 'f' + }, + bar: { + type: 'string' + } +}; +const { + values, + positionals +} = parseArgs({ args, options }); +console.log(values, positionals); +// Prints: [Object: null prototype] { foo: true, bar: 'b' } [] +``` + +`util.parseArgs` is experimental and behavior may change. Join the +conversation in [pkgjs/parseargs][] to contribute to the design. + +### `parseArgs` `tokens` + +Detailed parse information is available for adding custom behaviours by +specifying `tokens: true` in the configuration. +The returned tokens have properties describing: + +* all tokens + * `kind` {string} One of 'option', 'positional', or 'option-terminator'. + * `index` {number} Index of element in `args` containing token. So the + source argument for a token is `args[token.index]`. +* option tokens + * `name` {string} Long name of option. + * `rawName` {string} How option used in args, like `-f` of `--foo`. + * `value` {string | undefined} Option value specified in args. + Undefined for boolean options. + * `inlineValue` {boolean | undefined} Whether option value specified inline, + like `--foo=bar`. +* positional tokens + * `value` {string} The value of the positional argument in args (i.e. `args[index]`). +* option-terminator token + +The returned tokens are in the order encountered in the input args. Options +that appear more than once in args produce a token for each use. Short option +groups like `-xy` expand to a token for each option. So `-xxx` produces +three tokens. + +For example to use the returned tokens to add support for a negated option +like `--no-color`, the tokens can be reprocessed to change the value stored +for the negated option. + +```mjs +import { parseArgs } from 'node:util'; + +const options = { + 'color': { type: 'boolean' }, + 'no-color': { type: 'boolean' }, + 'logfile': { type: 'string' }, + 'no-logfile': { type: 'boolean' }, +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +// Reprocess the option tokens and overwrite the returned values. +tokens + .filter((token) => token.kind === 'option') + .forEach((token) => { + if (token.name.startsWith('no-')) { + // Store foo:false for --no-foo + const positiveName = token.name.slice(3); + values[positiveName] = false; + delete values[token.name]; + } else { + // Resave value so last one wins if both --foo and --no-foo. + values[token.name] = token.value ?? true; + } + }); + +const color = values.color; +const logfile = values.logfile ?? 'default.log'; + +console.log({ logfile, color }); +``` + +```cjs +const { parseArgs } = require('node:util'); + +const options = { + 'color': { type: 'boolean' }, + 'no-color': { type: 'boolean' }, + 'logfile': { type: 'string' }, + 'no-logfile': { type: 'boolean' }, +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +// Reprocess the option tokens and overwrite the returned values. +tokens + .filter((token) => token.kind === 'option') + .forEach((token) => { + if (token.name.startsWith('no-')) { + // Store foo:false for --no-foo + const positiveName = token.name.slice(3); + values[positiveName] = false; + delete values[token.name]; + } else { + // Resave value so last one wins if both --foo and --no-foo. + values[token.name] = token.value ?? true; + } + }); + +const color = values.color; +const logfile = values.logfile ?? 'default.log'; + +console.log({ logfile, color }); +``` + +Example usage showing negated options, and when an option is used +multiple ways then last one wins. + +```console +$ node negate.js +{ logfile: 'default.log', color: undefined } +$ node negate.js --no-logfile --no-color +{ logfile: false, color: false } +$ node negate.js --logfile=test.log --color +{ logfile: 'test.log', color: true } +$ node negate.js --no-logfile --logfile=test.log --color --no-color +{ logfile: 'test.log', color: false } +``` + +----- + + +## Table of Contents +- [`util.parseArgs([config])`](#utilparseargsconfig) +- [Scope](#scope) +- [Version Matchups](#version-matchups) +- [🚀 Getting Started](#-getting-started) +- [🙌 Contributing](#-contributing) +- [💡 `process.mainArgs` Proposal](#-processmainargs-proposal) + - [Implementation:](#implementation) +- [📃 Examples](#-examples) +- [F.A.Qs](#faqs) +- [Links & Resources](#links--resources) + +----- + +## Scope + +It is already possible to build great arg parsing modules on top of what Node.js provides; the prickly API is abstracted away by these modules. Thus, process.parseArgs() is not necessarily intended for library authors; it is intended for developers of simple CLI tools, ad-hoc scripts, deployed Node.js applications, and learning materials. + +It is exceedingly difficult to provide an API which would both be friendly to these Node.js users while being extensible enough for libraries to build upon. We chose to prioritize these use cases because these are currently not well-served by Node.js' API. + +---- + +## Version Matchups + +| Node.js | @pkgjs/parseArgs | +| -- | -- | +| [v18.3.0](https://nodejs.org/docs/latest-v18.x/api/util.html#utilparseargsconfig) | [v0.9.1](https://github.com/pkgjs/parseargs/tree/v0.9.1#utilparseargsconfig) | +| [v16.17.0](https://nodejs.org/dist/latest-v16.x/docs/api/util.html#utilparseargsconfig), [v18.7.0](https://nodejs.org/docs/latest-v18.x/api/util.html#utilparseargsconfig) | [0.10.0](https://github.com/pkgjs/parseargs/tree/v0.10.0#utilparseargsconfig) | + +---- + +## 🚀 Getting Started + +1. **Install dependencies.** + + ```bash + npm install + ``` + +2. **Open the index.js file and start editing!** + +3. **Test your code by calling parseArgs through our test file** + + ```bash + npm test + ``` + +---- + +## 🙌 Contributing + +Any person who wants to contribute to the initiative is welcome! Please first read the [Contributing Guide](CONTRIBUTING.md) + +Additionally, reading the [`Examples w/ Output`](#-examples-w-output) section of this document will be the best way to familiarize yourself with the target expected behavior for parseArgs() once it is fully implemented. + +This package was implemented using [tape](https://www.npmjs.com/package/tape) as its test harness. + +---- + +## 💡 `process.mainArgs` Proposal + +> Note: This can be moved forward independently of the `util.parseArgs()` proposal/work. + +### Implementation: + +```javascript +process.mainArgs = process.argv.slice(process._exec ? 1 : 2) +``` + +---- + +## 📃 Examples + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// specify the options that may be used +const options = { + foo: { type: 'string'}, + bar: { type: 'boolean' }, +}; +const args = ['--foo=a', '--bar']; +const { values, positionals } = parseArgs({ args, options }); +// values = { foo: 'a', bar: true } +// positionals = [] +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// type:string & multiple +const options = { + foo: { + type: 'string', + multiple: true, + }, +}; +const args = ['--foo=a', '--foo', 'b']; +const { values, positionals } = parseArgs({ args, options }); +// values = { foo: [ 'a', 'b' ] } +// positionals = [] +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// shorts +const options = { + foo: { + short: 'f', + type: 'boolean' + }, +}; +const args = ['-f', 'b']; +const { values, positionals } = parseArgs({ args, options, allowPositionals: true }); +// values = { foo: true } +// positionals = ['b'] +``` + +```js +const { parseArgs } = require('@pkgjs/parseargs'); +// unconfigured +const options = {}; +const args = ['-f', '--foo=a', '--bar', 'b']; +const { values, positionals } = parseArgs({ strict: false, args, options, allowPositionals: true }); +// values = { f: true, foo: 'a', bar: true } +// positionals = ['b'] +``` + +---- + +## F.A.Qs + +- Is `cmd --foo=bar baz` the same as `cmd baz --foo=bar`? + - yes +- Does the parser execute a function? + - no +- Does the parser execute one of several functions, depending on input? + - no +- Can subcommands take options that are distinct from the main command? + - no +- Does it output generated help when no options match? + - no +- Does it generated short usage? Like: `usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]` + - no (no usage/help at all) +- Does the user provide the long usage text? For each option? For the whole command? + - no +- Do subcommands (if implemented) have their own usage output? + - no +- Does usage print if the user runs `cmd --help`? + - no +- Does it set `process.exitCode`? + - no +- Does usage print to stderr or stdout? + - N/A +- Does it check types? (Say, specify that an option is a boolean, number, etc.) + - no +- Can an option have more than one type? (string or false, for example) + - no +- Can the user define a type? (Say, `type: path` to call `path.resolve()` on the argument.) + - no +- Does a `--foo=0o22` mean 0, 22, 18, or "0o22"? + - `"0o22"` +- Does it coerce types? + - no +- Does `--no-foo` coerce to `--foo=false`? For all options? Only boolean options? + - no, it sets `{values:{'no-foo': true}}` +- Is `--foo` the same as `--foo=true`? Only for known booleans? Only at the end? + - no, they are not the same. There is no special handling of `true` as a value so it is just another string. +- Does it read environment variables? Ie, is `FOO=1 cmd` the same as `cmd --foo=1`? + - no +- Do unknown arguments raise an error? Are they parsed? Are they treated as positional arguments? + - no, they are parsed, not treated as positionals +- Does `--` signal the end of options? + - yes +- Is `--` included as a positional? + - no +- Is `program -- foo` the same as `program foo`? + - yes, both store `{positionals:['foo']}` +- Does the API specify whether a `--` was present/relevant? + - no +- Is `-bar` the same as `--bar`? + - no, `-bar` is a short option or options, with expansion logic that follows the + [Utility Syntax Guidelines in POSIX.1-2017](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html). `-bar` expands to `-b`, `-a`, `-r`. +- Is `---foo` the same as `--foo`? + - no + - the first is a long option named `'-foo'` + - the second is a long option named `'foo'` +- Is `-` a positional? ie, `bash some-test.sh | tap -` + - yes + +## Links & Resources + +* [Initial Tooling Issue](https://github.com/nodejs/tooling/issues/19) +* [Initial Proposal](https://github.com/nodejs/node/pull/35015) +* [parseArgs Proposal](https://github.com/nodejs/node/pull/42675) + +[coverage-image]: https://img.shields.io/nycrc/pkgjs/parseargs +[coverage-url]: https://github.com/pkgjs/parseargs/blob/main/.nycrc +[pkgjs/parseargs]: https://github.com/pkgjs/parseargs diff --git a/node_modules/@pkgjs/parseargs/examples/is-default-value.js b/node_modules/@pkgjs/parseargs/examples/is-default-value.js new file mode 100644 index 0000000..0a67972 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/is-default-value.js @@ -0,0 +1,25 @@ +'use strict'; + +// This example shows how to understand if a default value is used or not. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + file: { short: 'f', type: 'string', default: 'FOO' }, +}; + +const { values, tokens } = parseArgs({ options, tokens: true }); + +const isFileDefault = !tokens.some((token) => token.kind === 'option' && + token.name === 'file' +); + +console.log(values); +console.log(`Is the file option [${values.file}] the default value? ${isFileDefault}`); + +// Try the following: +// node is-default-value.js +// node is-default-value.js -f FILE +// node is-default-value.js --file FILE diff --git a/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js b/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js new file mode 100644 index 0000000..943e643 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/limit-long-syntax.js @@ -0,0 +1,35 @@ +'use strict'; + +// This is an example of using tokens to add a custom behaviour. +// +// Require the use of `=` for long options and values by blocking +// the use of space separated values. +// So allow `--foo=bar`, and not allow `--foo bar`. +// +// Note: this is not a common behaviour, most CLIs allow both forms. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + file: { short: 'f', type: 'string' }, + log: { type: 'string' }, +}; + +const { values, tokens } = parseArgs({ options, tokens: true }); + +const badToken = tokens.find((token) => token.kind === 'option' && + token.value != null && + token.rawName.startsWith('--') && + !token.inlineValue +); +if (badToken) { + throw new Error(`Option value for '${badToken.rawName}' must be inline, like '${badToken.rawName}=VALUE'`); +} + +console.log(values); + +// Try the following: +// node limit-long-syntax.js -f FILE --log=LOG +// node limit-long-syntax.js --file FILE diff --git a/node_modules/@pkgjs/parseargs/examples/negate.js b/node_modules/@pkgjs/parseargs/examples/negate.js new file mode 100644 index 0000000..b663469 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/negate.js @@ -0,0 +1,43 @@ +'use strict'; + +// This example is used in the documentation. + +// How might I add my own support for --no-foo? + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + 'color': { type: 'boolean' }, + 'no-color': { type: 'boolean' }, + 'logfile': { type: 'string' }, + 'no-logfile': { type: 'boolean' }, +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +// Reprocess the option tokens and overwrite the returned values. +tokens + .filter((token) => token.kind === 'option') + .forEach((token) => { + if (token.name.startsWith('no-')) { + // Store foo:false for --no-foo + const positiveName = token.name.slice(3); + values[positiveName] = false; + delete values[token.name]; + } else { + // Resave value so last one wins if both --foo and --no-foo. + values[token.name] = token.value ?? true; + } + }); + +const color = values.color; +const logfile = values.logfile ?? 'default.log'; + +console.log({ logfile, color }); + +// Try the following: +// node negate.js +// node negate.js --no-logfile --no-color +// negate.js --logfile=test.log --color +// node negate.js --no-logfile --logfile=test.log --color --no-color diff --git a/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js b/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js new file mode 100644 index 0000000..0c32468 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/no-repeated-options.js @@ -0,0 +1,31 @@ +'use strict'; + +// This is an example of using tokens to add a custom behaviour. +// +// Throw an error if an option is used more than once. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const options = { + ding: { type: 'boolean', short: 'd' }, + beep: { type: 'boolean', short: 'b' } +}; +const { values, tokens } = parseArgs({ options, tokens: true }); + +const seenBefore = new Set(); +tokens.forEach((token) => { + if (token.kind !== 'option') return; + if (seenBefore.has(token.name)) { + throw new Error(`option '${token.name}' used multiple times`); + } + seenBefore.add(token.name); +}); + +console.log(values); + +// Try the following: +// node no-repeated-options --ding --beep +// node no-repeated-options --beep -b +// node no-repeated-options -ddd diff --git a/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs b/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs new file mode 100644 index 0000000..8ab7367 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/ordered-options.mjs @@ -0,0 +1,41 @@ +// This is an example of using tokens to add a custom behaviour. +// +// This adds a option order check so that --some-unstable-option +// may only be used after --enable-experimental-options +// +// Note: this is not a common behaviour, the order of different options +// does not usually matter. + +import { parseArgs } from '../index.js'; + +function findTokenIndex(tokens, target) { + return tokens.findIndex((token) => token.kind === 'option' && + token.name === target + ); +} + +const experimentalName = 'enable-experimental-options'; +const unstableName = 'some-unstable-option'; + +const options = { + [experimentalName]: { type: 'boolean' }, + [unstableName]: { type: 'boolean' }, +}; + +const { values, tokens } = parseArgs({ options, tokens: true }); + +const experimentalIndex = findTokenIndex(tokens, experimentalName); +const unstableIndex = findTokenIndex(tokens, unstableName); +if (unstableIndex !== -1 && + ((experimentalIndex === -1) || (unstableIndex < experimentalIndex))) { + throw new Error(`'--${experimentalName}' must be specified before '--${unstableName}'`); +} + +console.log(values); + +/* eslint-disable max-len */ +// Try the following: +// node ordered-options.mjs +// node ordered-options.mjs --some-unstable-option +// node ordered-options.mjs --some-unstable-option --enable-experimental-options +// node ordered-options.mjs --enable-experimental-options --some-unstable-option diff --git a/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js b/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js new file mode 100644 index 0000000..eff04c2 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/examples/simple-hard-coded.js @@ -0,0 +1,26 @@ +'use strict'; + +// This example is used in the documentation. + +// 1. const { parseArgs } = require('node:util'); // from node +// 2. const { parseArgs } = require('@pkgjs/parseargs'); // from package +const { parseArgs } = require('..'); // in repo + +const args = ['-f', '--bar', 'b']; +const options = { + foo: { + type: 'boolean', + short: 'f' + }, + bar: { + type: 'string' + } +}; +const { + values, + positionals +} = parseArgs({ args, options }); +console.log(values, positionals); + +// Try the following: +// node simple-hard-coded.js diff --git a/node_modules/@pkgjs/parseargs/index.js b/node_modules/@pkgjs/parseargs/index.js new file mode 100644 index 0000000..b1004c7 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/index.js @@ -0,0 +1,396 @@ +'use strict'; + +const { + ArrayPrototypeForEach, + ArrayPrototypeIncludes, + ArrayPrototypeMap, + ArrayPrototypePush, + ArrayPrototypePushApply, + ArrayPrototypeShift, + ArrayPrototypeSlice, + ArrayPrototypeUnshiftApply, + ObjectEntries, + ObjectPrototypeHasOwnProperty: ObjectHasOwn, + StringPrototypeCharAt, + StringPrototypeIndexOf, + StringPrototypeSlice, + StringPrototypeStartsWith, +} = require('./internal/primordials'); + +const { + validateArray, + validateBoolean, + validateBooleanArray, + validateObject, + validateString, + validateStringArray, + validateUnion, +} = require('./internal/validators'); + +const { + kEmptyObject, +} = require('./internal/util'); + +const { + findLongOptionForShort, + isLoneLongOption, + isLoneShortOption, + isLongOptionAndValue, + isOptionValue, + isOptionLikeValue, + isShortOptionAndValue, + isShortOptionGroup, + useDefaultValueOption, + objectGetOwn, + optionsGetOwn, +} = require('./utils'); + +const { + codes: { + ERR_INVALID_ARG_VALUE, + ERR_PARSE_ARGS_INVALID_OPTION_VALUE, + ERR_PARSE_ARGS_UNKNOWN_OPTION, + ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL, + }, +} = require('./internal/errors'); + +function getMainArgs() { + // Work out where to slice process.argv for user supplied arguments. + + // Check node options for scenarios where user CLI args follow executable. + const execArgv = process.execArgv; + if (ArrayPrototypeIncludes(execArgv, '-e') || + ArrayPrototypeIncludes(execArgv, '--eval') || + ArrayPrototypeIncludes(execArgv, '-p') || + ArrayPrototypeIncludes(execArgv, '--print')) { + return ArrayPrototypeSlice(process.argv, 1); + } + + // Normally first two arguments are executable and script, then CLI arguments + return ArrayPrototypeSlice(process.argv, 2); +} + +/** + * In strict mode, throw for possible usage errors like --foo --bar + * + * @param {object} token - from tokens as available from parseArgs + */ +function checkOptionLikeValue(token) { + if (!token.inlineValue && isOptionLikeValue(token.value)) { + // Only show short example if user used short option. + const example = StringPrototypeStartsWith(token.rawName, '--') ? + `'${token.rawName}=-XYZ'` : + `'--${token.name}=-XYZ' or '${token.rawName}-XYZ'`; + const errorMessage = `Option '${token.rawName}' argument is ambiguous. +Did you forget to specify the option argument for '${token.rawName}'? +To specify an option argument starting with a dash use ${example}.`; + throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(errorMessage); + } +} + +/** + * In strict mode, throw for usage errors. + * + * @param {object} config - from config passed to parseArgs + * @param {object} token - from tokens as available from parseArgs + */ +function checkOptionUsage(config, token) { + if (!ObjectHasOwn(config.options, token.name)) { + throw new ERR_PARSE_ARGS_UNKNOWN_OPTION( + token.rawName, config.allowPositionals); + } + + const short = optionsGetOwn(config.options, token.name, 'short'); + const shortAndLong = `${short ? `-${short}, ` : ''}--${token.name}`; + const type = optionsGetOwn(config.options, token.name, 'type'); + if (type === 'string' && typeof token.value !== 'string') { + throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(`Option '${shortAndLong} ' argument missing`); + } + // (Idiomatic test for undefined||null, expecting undefined.) + if (type === 'boolean' && token.value != null) { + throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(`Option '${shortAndLong}' does not take an argument`); + } +} + + +/** + * Store the option value in `values`. + * + * @param {string} longOption - long option name e.g. 'foo' + * @param {string|undefined} optionValue - value from user args + * @param {object} options - option configs, from parseArgs({ options }) + * @param {object} values - option values returned in `values` by parseArgs + */ +function storeOption(longOption, optionValue, options, values) { + if (longOption === '__proto__') { + return; // No. Just no. + } + + // We store based on the option value rather than option type, + // preserving the users intent for author to deal with. + const newValue = optionValue ?? true; + if (optionsGetOwn(options, longOption, 'multiple')) { + // Always store value in array, including for boolean. + // values[longOption] starts out not present, + // first value is added as new array [newValue], + // subsequent values are pushed to existing array. + // (note: values has null prototype, so simpler usage) + if (values[longOption]) { + ArrayPrototypePush(values[longOption], newValue); + } else { + values[longOption] = [newValue]; + } + } else { + values[longOption] = newValue; + } +} + +/** + * Store the default option value in `values`. + * + * @param {string} longOption - long option name e.g. 'foo' + * @param {string + * | boolean + * | string[] + * | boolean[]} optionValue - default value from option config + * @param {object} values - option values returned in `values` by parseArgs + */ +function storeDefaultOption(longOption, optionValue, values) { + if (longOption === '__proto__') { + return; // No. Just no. + } + + values[longOption] = optionValue; +} + +/** + * Process args and turn into identified tokens: + * - option (along with value, if any) + * - positional + * - option-terminator + * + * @param {string[]} args - from parseArgs({ args }) or mainArgs + * @param {object} options - option configs, from parseArgs({ options }) + */ +function argsToTokens(args, options) { + const tokens = []; + let index = -1; + let groupCount = 0; + + const remainingArgs = ArrayPrototypeSlice(args); + while (remainingArgs.length > 0) { + const arg = ArrayPrototypeShift(remainingArgs); + const nextArg = remainingArgs[0]; + if (groupCount > 0) + groupCount--; + else + index++; + + // Check if `arg` is an options terminator. + // Guideline 10 in https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html + if (arg === '--') { + // Everything after a bare '--' is considered a positional argument. + ArrayPrototypePush(tokens, { kind: 'option-terminator', index }); + ArrayPrototypePushApply( + tokens, ArrayPrototypeMap(remainingArgs, (arg) => { + return { kind: 'positional', index: ++index, value: arg }; + }) + ); + break; // Finished processing args, leave while loop. + } + + if (isLoneShortOption(arg)) { + // e.g. '-f' + const shortOption = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(shortOption, options); + let value; + let inlineValue; + if (optionsGetOwn(options, longOption, 'type') === 'string' && + isOptionValue(nextArg)) { + // e.g. '-f', 'bar' + value = ArrayPrototypeShift(remainingArgs); + inlineValue = false; + } + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: arg, + index, value, inlineValue }); + if (value != null) ++index; + continue; + } + + if (isShortOptionGroup(arg, options)) { + // Expand -fXzy to -f -X -z -y + const expanded = []; + for (let index = 1; index < arg.length; index++) { + const shortOption = StringPrototypeCharAt(arg, index); + const longOption = findLongOptionForShort(shortOption, options); + if (optionsGetOwn(options, longOption, 'type') !== 'string' || + index === arg.length - 1) { + // Boolean option, or last short in group. Well formed. + ArrayPrototypePush(expanded, `-${shortOption}`); + } else { + // String option in middle. Yuck. + // Expand -abfFILE to -a -b -fFILE + ArrayPrototypePush(expanded, `-${StringPrototypeSlice(arg, index)}`); + break; // finished short group + } + } + ArrayPrototypeUnshiftApply(remainingArgs, expanded); + groupCount = expanded.length; + continue; + } + + if (isShortOptionAndValue(arg, options)) { + // e.g. -fFILE + const shortOption = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(shortOption, options); + const value = StringPrototypeSlice(arg, 2); + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: `-${shortOption}`, + index, value, inlineValue: true }); + continue; + } + + if (isLoneLongOption(arg)) { + // e.g. '--foo' + const longOption = StringPrototypeSlice(arg, 2); + let value; + let inlineValue; + if (optionsGetOwn(options, longOption, 'type') === 'string' && + isOptionValue(nextArg)) { + // e.g. '--foo', 'bar' + value = ArrayPrototypeShift(remainingArgs); + inlineValue = false; + } + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: arg, + index, value, inlineValue }); + if (value != null) ++index; + continue; + } + + if (isLongOptionAndValue(arg)) { + // e.g. --foo=bar + const equalIndex = StringPrototypeIndexOf(arg, '='); + const longOption = StringPrototypeSlice(arg, 2, equalIndex); + const value = StringPrototypeSlice(arg, equalIndex + 1); + ArrayPrototypePush( + tokens, + { kind: 'option', name: longOption, rawName: `--${longOption}`, + index, value, inlineValue: true }); + continue; + } + + ArrayPrototypePush(tokens, { kind: 'positional', index, value: arg }); + } + + return tokens; +} + +const parseArgs = (config = kEmptyObject) => { + const args = objectGetOwn(config, 'args') ?? getMainArgs(); + const strict = objectGetOwn(config, 'strict') ?? true; + const allowPositionals = objectGetOwn(config, 'allowPositionals') ?? !strict; + const returnTokens = objectGetOwn(config, 'tokens') ?? false; + const options = objectGetOwn(config, 'options') ?? { __proto__: null }; + // Bundle these up for passing to strict-mode checks. + const parseConfig = { args, strict, options, allowPositionals }; + + // Validate input configuration. + validateArray(args, 'args'); + validateBoolean(strict, 'strict'); + validateBoolean(allowPositionals, 'allowPositionals'); + validateBoolean(returnTokens, 'tokens'); + validateObject(options, 'options'); + ArrayPrototypeForEach( + ObjectEntries(options), + ({ 0: longOption, 1: optionConfig }) => { + validateObject(optionConfig, `options.${longOption}`); + + // type is required + const optionType = objectGetOwn(optionConfig, 'type'); + validateUnion(optionType, `options.${longOption}.type`, ['string', 'boolean']); + + if (ObjectHasOwn(optionConfig, 'short')) { + const shortOption = optionConfig.short; + validateString(shortOption, `options.${longOption}.short`); + if (shortOption.length !== 1) { + throw new ERR_INVALID_ARG_VALUE( + `options.${longOption}.short`, + shortOption, + 'must be a single character' + ); + } + } + + const multipleOption = objectGetOwn(optionConfig, 'multiple'); + if (ObjectHasOwn(optionConfig, 'multiple')) { + validateBoolean(multipleOption, `options.${longOption}.multiple`); + } + + const defaultValue = objectGetOwn(optionConfig, 'default'); + if (defaultValue !== undefined) { + let validator; + switch (optionType) { + case 'string': + validator = multipleOption ? validateStringArray : validateString; + break; + + case 'boolean': + validator = multipleOption ? validateBooleanArray : validateBoolean; + break; + } + validator(defaultValue, `options.${longOption}.default`); + } + } + ); + + // Phase 1: identify tokens + const tokens = argsToTokens(args, options); + + // Phase 2: process tokens into parsed option values and positionals + const result = { + values: { __proto__: null }, + positionals: [], + }; + if (returnTokens) { + result.tokens = tokens; + } + ArrayPrototypeForEach(tokens, (token) => { + if (token.kind === 'option') { + if (strict) { + checkOptionUsage(parseConfig, token); + checkOptionLikeValue(token); + } + storeOption(token.name, token.value, options, result.values); + } else if (token.kind === 'positional') { + if (!allowPositionals) { + throw new ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL(token.value); + } + ArrayPrototypePush(result.positionals, token.value); + } + }); + + // Phase 3: fill in default values for missing args + ArrayPrototypeForEach(ObjectEntries(options), ({ 0: longOption, + 1: optionConfig }) => { + const mustSetDefault = useDefaultValueOption(longOption, + optionConfig, + result.values); + if (mustSetDefault) { + storeDefaultOption(longOption, + objectGetOwn(optionConfig, 'default'), + result.values); + } + }); + + + return result; +}; + +module.exports = { + parseArgs, +}; diff --git a/node_modules/@pkgjs/parseargs/internal/errors.js b/node_modules/@pkgjs/parseargs/internal/errors.js new file mode 100644 index 0000000..e1b237b --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/errors.js @@ -0,0 +1,47 @@ +'use strict'; + +class ERR_INVALID_ARG_TYPE extends TypeError { + constructor(name, expected, actual) { + super(`${name} must be ${expected} got ${actual}`); + this.code = 'ERR_INVALID_ARG_TYPE'; + } +} + +class ERR_INVALID_ARG_VALUE extends TypeError { + constructor(arg1, arg2, expected) { + super(`The property ${arg1} ${expected}. Received '${arg2}'`); + this.code = 'ERR_INVALID_ARG_VALUE'; + } +} + +class ERR_PARSE_ARGS_INVALID_OPTION_VALUE extends Error { + constructor(message) { + super(message); + this.code = 'ERR_PARSE_ARGS_INVALID_OPTION_VALUE'; + } +} + +class ERR_PARSE_ARGS_UNKNOWN_OPTION extends Error { + constructor(option, allowPositionals) { + const suggestDashDash = allowPositionals ? `. To specify a positional argument starting with a '-', place it at the end of the command after '--', as in '-- ${JSON.stringify(option)}` : ''; + super(`Unknown option '${option}'${suggestDashDash}`); + this.code = 'ERR_PARSE_ARGS_UNKNOWN_OPTION'; + } +} + +class ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL extends Error { + constructor(positional) { + super(`Unexpected argument '${positional}'. This command does not take positional arguments`); + this.code = 'ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL'; + } +} + +module.exports = { + codes: { + ERR_INVALID_ARG_TYPE, + ERR_INVALID_ARG_VALUE, + ERR_PARSE_ARGS_INVALID_OPTION_VALUE, + ERR_PARSE_ARGS_UNKNOWN_OPTION, + ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL, + } +}; diff --git a/node_modules/@pkgjs/parseargs/internal/primordials.js b/node_modules/@pkgjs/parseargs/internal/primordials.js new file mode 100644 index 0000000..63e23ab --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/primordials.js @@ -0,0 +1,393 @@ +/* +This file is copied from https://github.com/nodejs/node/blob/v14.19.3/lib/internal/per_context/primordials.js +under the following license: + +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +*/ + +'use strict'; + +/* eslint-disable node-core/prefer-primordials */ + +// This file subclasses and stores the JS builtins that come from the VM +// so that Node.js's builtin modules do not need to later look these up from +// the global proxy, which can be mutated by users. + +// Use of primordials have sometimes a dramatic impact on performance, please +// benchmark all changes made in performance-sensitive areas of the codebase. +// See: https://github.com/nodejs/node/pull/38248 + +const primordials = {}; + +const { + defineProperty: ReflectDefineProperty, + getOwnPropertyDescriptor: ReflectGetOwnPropertyDescriptor, + ownKeys: ReflectOwnKeys, +} = Reflect; + +// `uncurryThis` is equivalent to `func => Function.prototype.call.bind(func)`. +// It is using `bind.bind(call)` to avoid using `Function.prototype.bind` +// and `Function.prototype.call` after it may have been mutated by users. +const { apply, bind, call } = Function.prototype; +const uncurryThis = bind.bind(call); +primordials.uncurryThis = uncurryThis; + +// `applyBind` is equivalent to `func => Function.prototype.apply.bind(func)`. +// It is using `bind.bind(apply)` to avoid using `Function.prototype.bind` +// and `Function.prototype.apply` after it may have been mutated by users. +const applyBind = bind.bind(apply); +primordials.applyBind = applyBind; + +// Methods that accept a variable number of arguments, and thus it's useful to +// also create `${prefix}${key}Apply`, which uses `Function.prototype.apply`, +// instead of `Function.prototype.call`, and thus doesn't require iterator +// destructuring. +const varargsMethods = [ + // 'ArrayPrototypeConcat' is omitted, because it performs the spread + // on its own for arrays and array-likes with a truthy + // @@isConcatSpreadable symbol property. + 'ArrayOf', + 'ArrayPrototypePush', + 'ArrayPrototypeUnshift', + // 'FunctionPrototypeCall' is omitted, since there's 'ReflectApply' + // and 'FunctionPrototypeApply'. + 'MathHypot', + 'MathMax', + 'MathMin', + 'StringPrototypeConcat', + 'TypedArrayOf', +]; + +function getNewKey(key) { + return typeof key === 'symbol' ? + `Symbol${key.description[7].toUpperCase()}${key.description.slice(8)}` : + `${key[0].toUpperCase()}${key.slice(1)}`; +} + +function copyAccessor(dest, prefix, key, { enumerable, get, set }) { + ReflectDefineProperty(dest, `${prefix}Get${key}`, { + value: uncurryThis(get), + enumerable + }); + if (set !== undefined) { + ReflectDefineProperty(dest, `${prefix}Set${key}`, { + value: uncurryThis(set), + enumerable + }); + } +} + +function copyPropsRenamed(src, dest, prefix) { + for (const key of ReflectOwnKeys(src)) { + const newKey = getNewKey(key); + const desc = ReflectGetOwnPropertyDescriptor(src, key); + if ('get' in desc) { + copyAccessor(dest, prefix, newKey, desc); + } else { + const name = `${prefix}${newKey}`; + ReflectDefineProperty(dest, name, desc); + if (varargsMethods.includes(name)) { + ReflectDefineProperty(dest, `${name}Apply`, { + // `src` is bound as the `this` so that the static `this` points + // to the object it was defined on, + // e.g.: `ArrayOfApply` gets a `this` of `Array`: + value: applyBind(desc.value, src), + }); + } + } + } +} + +function copyPropsRenamedBound(src, dest, prefix) { + for (const key of ReflectOwnKeys(src)) { + const newKey = getNewKey(key); + const desc = ReflectGetOwnPropertyDescriptor(src, key); + if ('get' in desc) { + copyAccessor(dest, prefix, newKey, desc); + } else { + const { value } = desc; + if (typeof value === 'function') { + desc.value = value.bind(src); + } + + const name = `${prefix}${newKey}`; + ReflectDefineProperty(dest, name, desc); + if (varargsMethods.includes(name)) { + ReflectDefineProperty(dest, `${name}Apply`, { + value: applyBind(value, src), + }); + } + } + } +} + +function copyPrototype(src, dest, prefix) { + for (const key of ReflectOwnKeys(src)) { + const newKey = getNewKey(key); + const desc = ReflectGetOwnPropertyDescriptor(src, key); + if ('get' in desc) { + copyAccessor(dest, prefix, newKey, desc); + } else { + const { value } = desc; + if (typeof value === 'function') { + desc.value = uncurryThis(value); + } + + const name = `${prefix}${newKey}`; + ReflectDefineProperty(dest, name, desc); + if (varargsMethods.includes(name)) { + ReflectDefineProperty(dest, `${name}Apply`, { + value: applyBind(value), + }); + } + } + } +} + +// Create copies of configurable value properties of the global object +[ + 'Proxy', + 'globalThis', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + primordials[name] = globalThis[name]; +}); + +// Create copies of URI handling functions +[ + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, +].forEach((fn) => { + primordials[fn.name] = fn; +}); + +// Create copies of the namespace objects +[ + 'JSON', + 'Math', + 'Proxy', + 'Reflect', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + copyPropsRenamed(global[name], primordials, name); +}); + +// Create copies of intrinsic objects +[ + 'Array', + 'ArrayBuffer', + 'BigInt', + 'BigInt64Array', + 'BigUint64Array', + 'Boolean', + 'DataView', + 'Date', + 'Error', + 'EvalError', + 'Float32Array', + 'Float64Array', + 'Function', + 'Int16Array', + 'Int32Array', + 'Int8Array', + 'Map', + 'Number', + 'Object', + 'RangeError', + 'ReferenceError', + 'RegExp', + 'Set', + 'String', + 'Symbol', + 'SyntaxError', + 'TypeError', + 'URIError', + 'Uint16Array', + 'Uint32Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'WeakMap', + 'WeakSet', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + const original = global[name]; + primordials[name] = original; + copyPropsRenamed(original, primordials, name); + copyPrototype(original.prototype, primordials, `${name}Prototype`); +}); + +// Create copies of intrinsic objects that require a valid `this` to call +// static methods. +// Refs: https://www.ecma-international.org/ecma-262/#sec-promise.all +[ + 'Promise', +].forEach((name) => { + // eslint-disable-next-line no-restricted-globals + const original = global[name]; + primordials[name] = original; + copyPropsRenamedBound(original, primordials, name); + copyPrototype(original.prototype, primordials, `${name}Prototype`); +}); + +// Create copies of abstract intrinsic objects that are not directly exposed +// on the global object. +// Refs: https://tc39.es/ecma262/#sec-%typedarray%-intrinsic-object +[ + { name: 'TypedArray', original: Reflect.getPrototypeOf(Uint8Array) }, + { name: 'ArrayIterator', original: { + prototype: Reflect.getPrototypeOf(Array.prototype[Symbol.iterator]()), + } }, + { name: 'StringIterator', original: { + prototype: Reflect.getPrototypeOf(String.prototype[Symbol.iterator]()), + } }, +].forEach(({ name, original }) => { + primordials[name] = original; + // The static %TypedArray% methods require a valid `this`, but can't be bound, + // as they need a subclass constructor as the receiver: + copyPrototype(original, primordials, name); + copyPrototype(original.prototype, primordials, `${name}Prototype`); +}); + +/* eslint-enable node-core/prefer-primordials */ + +const { + ArrayPrototypeForEach, + FunctionPrototypeCall, + Map, + ObjectFreeze, + ObjectSetPrototypeOf, + Set, + SymbolIterator, + WeakMap, + WeakSet, +} = primordials; + +// Because these functions are used by `makeSafe`, which is exposed +// on the `primordials` object, it's important to use const references +// to the primordials that they use: +const createSafeIterator = (factory, next) => { + class SafeIterator { + constructor(iterable) { + this._iterator = factory(iterable); + } + next() { + return next(this._iterator); + } + [SymbolIterator]() { + return this; + } + } + ObjectSetPrototypeOf(SafeIterator.prototype, null); + ObjectFreeze(SafeIterator.prototype); + ObjectFreeze(SafeIterator); + return SafeIterator; +}; + +primordials.SafeArrayIterator = createSafeIterator( + primordials.ArrayPrototypeSymbolIterator, + primordials.ArrayIteratorPrototypeNext +); +primordials.SafeStringIterator = createSafeIterator( + primordials.StringPrototypeSymbolIterator, + primordials.StringIteratorPrototypeNext +); + +const copyProps = (src, dest) => { + ArrayPrototypeForEach(ReflectOwnKeys(src), (key) => { + if (!ReflectGetOwnPropertyDescriptor(dest, key)) { + ReflectDefineProperty( + dest, + key, + ReflectGetOwnPropertyDescriptor(src, key)); + } + }); +}; + +const makeSafe = (unsafe, safe) => { + if (SymbolIterator in unsafe.prototype) { + const dummy = new unsafe(); + let next; // We can reuse the same `next` method. + + ArrayPrototypeForEach(ReflectOwnKeys(unsafe.prototype), (key) => { + if (!ReflectGetOwnPropertyDescriptor(safe.prototype, key)) { + const desc = ReflectGetOwnPropertyDescriptor(unsafe.prototype, key); + if ( + typeof desc.value === 'function' && + desc.value.length === 0 && + SymbolIterator in (FunctionPrototypeCall(desc.value, dummy) ?? {}) + ) { + const createIterator = uncurryThis(desc.value); + next = next ?? uncurryThis(createIterator(dummy).next); + const SafeIterator = createSafeIterator(createIterator, next); + desc.value = function() { + return new SafeIterator(this); + }; + } + ReflectDefineProperty(safe.prototype, key, desc); + } + }); + } else { + copyProps(unsafe.prototype, safe.prototype); + } + copyProps(unsafe, safe); + + ObjectSetPrototypeOf(safe.prototype, null); + ObjectFreeze(safe.prototype); + ObjectFreeze(safe); + return safe; +}; +primordials.makeSafe = makeSafe; + +// Subclass the constructors because we need to use their prototype +// methods later. +// Defining the `constructor` is necessary here to avoid the default +// constructor which uses the user-mutable `%ArrayIteratorPrototype%.next`. +primordials.SafeMap = makeSafe( + Map, + class SafeMap extends Map { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); +primordials.SafeWeakMap = makeSafe( + WeakMap, + class SafeWeakMap extends WeakMap { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); +primordials.SafeSet = makeSafe( + Set, + class SafeSet extends Set { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); +primordials.SafeWeakSet = makeSafe( + WeakSet, + class SafeWeakSet extends WeakSet { + constructor(i) { super(i); } // eslint-disable-line no-useless-constructor + } +); + +ObjectSetPrototypeOf(primordials, null); +ObjectFreeze(primordials); + +module.exports = primordials; diff --git a/node_modules/@pkgjs/parseargs/internal/util.js b/node_modules/@pkgjs/parseargs/internal/util.js new file mode 100644 index 0000000..b9b8fe5 --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/util.js @@ -0,0 +1,14 @@ +'use strict'; + +// This is a placeholder for util.js in node.js land. + +const { + ObjectCreate, + ObjectFreeze, +} = require('./primordials'); + +const kEmptyObject = ObjectFreeze(ObjectCreate(null)); + +module.exports = { + kEmptyObject, +}; diff --git a/node_modules/@pkgjs/parseargs/internal/validators.js b/node_modules/@pkgjs/parseargs/internal/validators.js new file mode 100644 index 0000000..b5ac4fb --- /dev/null +++ b/node_modules/@pkgjs/parseargs/internal/validators.js @@ -0,0 +1,89 @@ +'use strict'; + +// This file is a proxy of the original file located at: +// https://github.com/nodejs/node/blob/main/lib/internal/validators.js +// Every addition or modification to this file must be evaluated +// during the PR review. + +const { + ArrayIsArray, + ArrayPrototypeIncludes, + ArrayPrototypeJoin, +} = require('./primordials'); + +const { + codes: { + ERR_INVALID_ARG_TYPE + } +} = require('./errors'); + +function validateString(value, name) { + if (typeof value !== 'string') { + throw new ERR_INVALID_ARG_TYPE(name, 'String', value); + } +} + +function validateUnion(value, name, union) { + if (!ArrayPrototypeIncludes(union, value)) { + throw new ERR_INVALID_ARG_TYPE(name, `('${ArrayPrototypeJoin(union, '|')}')`, value); + } +} + +function validateBoolean(value, name) { + if (typeof value !== 'boolean') { + throw new ERR_INVALID_ARG_TYPE(name, 'Boolean', value); + } +} + +function validateArray(value, name) { + if (!ArrayIsArray(value)) { + throw new ERR_INVALID_ARG_TYPE(name, 'Array', value); + } +} + +function validateStringArray(value, name) { + validateArray(value, name); + for (let i = 0; i < value.length; i++) { + validateString(value[i], `${name}[${i}]`); + } +} + +function validateBooleanArray(value, name) { + validateArray(value, name); + for (let i = 0; i < value.length; i++) { + validateBoolean(value[i], `${name}[${i}]`); + } +} + +/** + * @param {unknown} value + * @param {string} name + * @param {{ + * allowArray?: boolean, + * allowFunction?: boolean, + * nullable?: boolean + * }} [options] + */ +function validateObject(value, name, options) { + const useDefaultOptions = options == null; + const allowArray = useDefaultOptions ? false : options.allowArray; + const allowFunction = useDefaultOptions ? false : options.allowFunction; + const nullable = useDefaultOptions ? false : options.nullable; + if ((!nullable && value === null) || + (!allowArray && ArrayIsArray(value)) || + (typeof value !== 'object' && ( + !allowFunction || typeof value !== 'function' + ))) { + throw new ERR_INVALID_ARG_TYPE(name, 'Object', value); + } +} + +module.exports = { + validateArray, + validateObject, + validateString, + validateStringArray, + validateUnion, + validateBoolean, + validateBooleanArray, +}; diff --git a/node_modules/@pkgjs/parseargs/package.json b/node_modules/@pkgjs/parseargs/package.json new file mode 100644 index 0000000..0bcc05c --- /dev/null +++ b/node_modules/@pkgjs/parseargs/package.json @@ -0,0 +1,36 @@ +{ + "name": "@pkgjs/parseargs", + "version": "0.11.0", + "description": "Polyfill of future proposal for `util.parseArgs()`", + "engines": { + "node": ">=14" + }, + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "scripts": { + "coverage": "c8 --check-coverage tape 'test/*.js'", + "test": "c8 tape 'test/*.js'", + "posttest": "eslint .", + "fix": "npm run posttest -- --fix" + }, + "repository": { + "type": "git", + "url": "git@github.com:pkgjs/parseargs.git" + }, + "keywords": [], + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/pkgjs/parseargs/issues" + }, + "homepage": "https://github.com/pkgjs/parseargs#readme", + "devDependencies": { + "c8": "^7.10.0", + "eslint": "^8.2.0", + "eslint-plugin-node-core": "iansu/eslint-plugin-node-core", + "tape": "^5.2.2" + } +} diff --git a/node_modules/@pkgjs/parseargs/utils.js b/node_modules/@pkgjs/parseargs/utils.js new file mode 100644 index 0000000..d7f420a --- /dev/null +++ b/node_modules/@pkgjs/parseargs/utils.js @@ -0,0 +1,198 @@ +'use strict'; + +const { + ArrayPrototypeFind, + ObjectEntries, + ObjectPrototypeHasOwnProperty: ObjectHasOwn, + StringPrototypeCharAt, + StringPrototypeIncludes, + StringPrototypeStartsWith, +} = require('./internal/primordials'); + +const { + validateObject, +} = require('./internal/validators'); + +// These are internal utilities to make the parsing logic easier to read, and +// add lots of detail for the curious. They are in a separate file to allow +// unit testing, although that is not essential (this could be rolled into +// main file and just tested implicitly via API). +// +// These routines are for internal use, not for export to client. + +/** + * Return the named property, but only if it is an own property. + */ +function objectGetOwn(obj, prop) { + if (ObjectHasOwn(obj, prop)) + return obj[prop]; +} + +/** + * Return the named options property, but only if it is an own property. + */ +function optionsGetOwn(options, longOption, prop) { + if (ObjectHasOwn(options, longOption)) + return objectGetOwn(options[longOption], prop); +} + +/** + * Determines if the argument may be used as an option value. + * @example + * isOptionValue('V') // returns true + * isOptionValue('-v') // returns true (greedy) + * isOptionValue('--foo') // returns true (greedy) + * isOptionValue(undefined) // returns false + */ +function isOptionValue(value) { + if (value == null) return false; + + // Open Group Utility Conventions are that an option-argument + // is the argument after the option, and may start with a dash. + return true; // greedy! +} + +/** + * Detect whether there is possible confusion and user may have omitted + * the option argument, like `--port --verbose` when `port` of type:string. + * In strict mode we throw errors if value is option-like. + */ +function isOptionLikeValue(value) { + if (value == null) return false; + + return value.length > 1 && StringPrototypeCharAt(value, 0) === '-'; +} + +/** + * Determines if `arg` is just a short option. + * @example '-f' + */ +function isLoneShortOption(arg) { + return arg.length === 2 && + StringPrototypeCharAt(arg, 0) === '-' && + StringPrototypeCharAt(arg, 1) !== '-'; +} + +/** + * Determines if `arg` is a lone long option. + * @example + * isLoneLongOption('a') // returns false + * isLoneLongOption('-a') // returns false + * isLoneLongOption('--foo') // returns true + * isLoneLongOption('--foo=bar') // returns false + */ +function isLoneLongOption(arg) { + return arg.length > 2 && + StringPrototypeStartsWith(arg, '--') && + !StringPrototypeIncludes(arg, '=', 3); +} + +/** + * Determines if `arg` is a long option and value in the same argument. + * @example + * isLongOptionAndValue('--foo') // returns false + * isLongOptionAndValue('--foo=bar') // returns true + */ +function isLongOptionAndValue(arg) { + return arg.length > 2 && + StringPrototypeStartsWith(arg, '--') && + StringPrototypeIncludes(arg, '=', 3); +} + +/** + * Determines if `arg` is a short option group. + * + * See Guideline 5 of the [Open Group Utility Conventions](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html). + * One or more options without option-arguments, followed by at most one + * option that takes an option-argument, should be accepted when grouped + * behind one '-' delimiter. + * @example + * isShortOptionGroup('-a', {}) // returns false + * isShortOptionGroup('-ab', {}) // returns true + * // -fb is an option and a value, not a short option group + * isShortOptionGroup('-fb', { + * options: { f: { type: 'string' } } + * }) // returns false + * isShortOptionGroup('-bf', { + * options: { f: { type: 'string' } } + * }) // returns true + * // -bfb is an edge case, return true and caller sorts it out + * isShortOptionGroup('-bfb', { + * options: { f: { type: 'string' } } + * }) // returns true + */ +function isShortOptionGroup(arg, options) { + if (arg.length <= 2) return false; + if (StringPrototypeCharAt(arg, 0) !== '-') return false; + if (StringPrototypeCharAt(arg, 1) === '-') return false; + + const firstShort = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(firstShort, options); + return optionsGetOwn(options, longOption, 'type') !== 'string'; +} + +/** + * Determine if arg is a short string option followed by its value. + * @example + * isShortOptionAndValue('-a', {}); // returns false + * isShortOptionAndValue('-ab', {}); // returns false + * isShortOptionAndValue('-fFILE', { + * options: { foo: { short: 'f', type: 'string' }} + * }) // returns true + */ +function isShortOptionAndValue(arg, options) { + validateObject(options, 'options'); + + if (arg.length <= 2) return false; + if (StringPrototypeCharAt(arg, 0) !== '-') return false; + if (StringPrototypeCharAt(arg, 1) === '-') return false; + + const shortOption = StringPrototypeCharAt(arg, 1); + const longOption = findLongOptionForShort(shortOption, options); + return optionsGetOwn(options, longOption, 'type') === 'string'; +} + +/** + * Find the long option associated with a short option. Looks for a configured + * `short` and returns the short option itself if a long option is not found. + * @example + * findLongOptionForShort('a', {}) // returns 'a' + * findLongOptionForShort('b', { + * options: { bar: { short: 'b' } } + * }) // returns 'bar' + */ +function findLongOptionForShort(shortOption, options) { + validateObject(options, 'options'); + const longOptionEntry = ArrayPrototypeFind( + ObjectEntries(options), + ({ 1: optionConfig }) => objectGetOwn(optionConfig, 'short') === shortOption + ); + return longOptionEntry?.[0] ?? shortOption; +} + +/** + * Check if the given option includes a default value + * and that option has not been set by the input args. + * + * @param {string} longOption - long option name e.g. 'foo' + * @param {object} optionConfig - the option configuration properties + * @param {object} values - option values returned in `values` by parseArgs + */ +function useDefaultValueOption(longOption, optionConfig, values) { + return objectGetOwn(optionConfig, 'default') !== undefined && + values[longOption] === undefined; +} + +module.exports = { + findLongOptionForShort, + isLoneLongOption, + isLoneShortOption, + isLongOptionAndValue, + isOptionValue, + isOptionLikeValue, + isShortOptionAndValue, + isShortOptionGroup, + useDefaultValueOption, + objectGetOwn, + optionsGetOwn, +}; diff --git a/node_modules/@sinonjs/commons/LICENSE b/node_modules/@sinonjs/commons/LICENSE new file mode 100644 index 0000000..5a77f0a --- /dev/null +++ b/node_modules/@sinonjs/commons/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018, Sinon.JS +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@sinonjs/commons/README.md b/node_modules/@sinonjs/commons/README.md new file mode 100644 index 0000000..9c420ba --- /dev/null +++ b/node_modules/@sinonjs/commons/README.md @@ -0,0 +1,16 @@ +# commons + +[![CircleCI](https://circleci.com/gh/sinonjs/commons.svg?style=svg)](https://circleci.com/gh/sinonjs/commons) +[![codecov](https://codecov.io/gh/sinonjs/commons/branch/master/graph/badge.svg)](https://codecov.io/gh/sinonjs/commons) +Contributor Covenant + +Simple functions shared among the sinon end user libraries + +## Rules + +- Follows the [Sinon.JS compatibility](https://github.com/sinonjs/sinon/blob/master/CONTRIBUTING.md#compatibility) +- 100% test coverage +- Code formatted using [Prettier](https://prettier.io) +- No side effects welcome! (only pure functions) +- No platform specific functions +- One export per file (any bundler can do tree shaking) diff --git a/node_modules/@sinonjs/commons/lib/called-in-order.js b/node_modules/@sinonjs/commons/lib/called-in-order.js new file mode 100644 index 0000000..cdbbb3f --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/called-in-order.js @@ -0,0 +1,55 @@ +"use strict"; + +var every = require("./prototypes/array").every; + +/** + * @private + */ +function hasCallsLeft(callMap, spy) { + if (callMap[spy.id] === undefined) { + callMap[spy.id] = 0; + } + + return callMap[spy.id] < spy.callCount; +} + +/** + * @private + */ +function checkAdjacentCalls(callMap, spy, index, spies) { + var calledBeforeNext = true; + + if (index !== spies.length - 1) { + calledBeforeNext = spy.calledBefore(spies[index + 1]); + } + + if (hasCallsLeft(callMap, spy) && calledBeforeNext) { + callMap[spy.id] += 1; + return true; + } + + return false; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} calledBefore - A method that determines if this proxy was called before another one + * @property {string} id - Some id + * @property {number} callCount - Number of times this proxy has been called + */ + +/** + * Returns true when the spies have been called in the order they were supplied in + * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments + * @returns {boolean} true when spies are called in order, false otherwise + */ +function calledInOrder(spies) { + var callMap = {}; + // eslint-disable-next-line no-underscore-dangle + var _spies = arguments.length > 1 ? arguments : spies; + + return every(_spies, checkAdjacentCalls.bind(null, callMap)); +} + +module.exports = calledInOrder; diff --git a/node_modules/@sinonjs/commons/lib/called-in-order.test.js b/node_modules/@sinonjs/commons/lib/called-in-order.test.js new file mode 100644 index 0000000..5fe6611 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/called-in-order.test.js @@ -0,0 +1,121 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var calledInOrder = require("./called-in-order"); +var sinon = require("@sinonjs/referee-sinon").sinon; + +var testObject1 = { + someFunction: function () { + return; + }, +}; +var testObject2 = { + otherFunction: function () { + return; + }, +}; +var testObject3 = { + thirdFunction: function () { + return; + }, +}; + +function testMethod() { + testObject1.someFunction(); + testObject2.otherFunction(); + testObject2.otherFunction(); + testObject2.otherFunction(); + testObject3.thirdFunction(); +} + +describe("calledInOrder", function () { + beforeEach(function () { + sinon.stub(testObject1, "someFunction"); + sinon.stub(testObject2, "otherFunction"); + sinon.stub(testObject3, "thirdFunction"); + testMethod(); + }); + afterEach(function () { + testObject1.someFunction.restore(); + testObject2.otherFunction.restore(); + testObject3.thirdFunction.restore(); + }); + + describe("given single array argument", function () { + describe("when stubs were called in expected order", function () { + it("returns true", function () { + assert.isTrue( + calledInOrder([ + testObject1.someFunction, + testObject2.otherFunction, + ]) + ); + assert.isTrue( + calledInOrder([ + testObject1.someFunction, + testObject2.otherFunction, + testObject2.otherFunction, + testObject3.thirdFunction, + ]) + ); + }); + }); + + describe("when stubs were called in unexpected order", function () { + it("returns false", function () { + assert.isFalse( + calledInOrder([ + testObject2.otherFunction, + testObject1.someFunction, + ]) + ); + assert.isFalse( + calledInOrder([ + testObject2.otherFunction, + testObject1.someFunction, + testObject1.someFunction, + testObject3.thirdFunction, + ]) + ); + }); + }); + }); + + describe("given multiple arguments", function () { + describe("when stubs were called in expected order", function () { + it("returns true", function () { + assert.isTrue( + calledInOrder( + testObject1.someFunction, + testObject2.otherFunction + ) + ); + assert.isTrue( + calledInOrder( + testObject1.someFunction, + testObject2.otherFunction, + testObject3.thirdFunction + ) + ); + }); + }); + + describe("when stubs were called in unexpected order", function () { + it("returns false", function () { + assert.isFalse( + calledInOrder( + testObject2.otherFunction, + testObject1.someFunction + ) + ); + assert.isFalse( + calledInOrder( + testObject2.otherFunction, + testObject1.someFunction, + testObject3.thirdFunction + ) + ); + }); + }); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/class-name.js b/node_modules/@sinonjs/commons/lib/class-name.js new file mode 100644 index 0000000..a125e53 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/class-name.js @@ -0,0 +1,13 @@ +"use strict"; + +/** + * Returns a display name for a value from a constructor + * @param {object} value A value to examine + * @returns {(string|null)} A string or null + */ +function className(value) { + const name = value.constructor && value.constructor.name; + return name || null; +} + +module.exports = className; diff --git a/node_modules/@sinonjs/commons/lib/class-name.test.js b/node_modules/@sinonjs/commons/lib/class-name.test.js new file mode 100644 index 0000000..994f21b --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/class-name.test.js @@ -0,0 +1,37 @@ +"use strict"; +/* eslint-disable no-empty-function */ + +var assert = require("@sinonjs/referee").assert; +var className = require("./class-name"); + +describe("className", function () { + it("returns the class name of an instance", function () { + // Because eslint-config-sinon disables es6, we can't + // use a class definition here + // https://github.com/sinonjs/eslint-config-sinon/blob/master/index.js + // var instance = new (class TestClass {})(); + var instance = new (function TestClass() {})(); + var name = className(instance); + assert.equals(name, "TestClass"); + }); + + it("returns 'Object' for {}", function () { + var name = className({}); + assert.equals(name, "Object"); + }); + + it("returns null for an object that has no prototype", function () { + var obj = Object.create(null); + var name = className(obj); + assert.equals(name, null); + }); + + it("returns null for an object whose prototype was mangled", function () { + // This is what Node v6 and v7 do for objects returned by querystring.parse() + function MangledObject() {} + MangledObject.prototype = Object.create(null); + var obj = new MangledObject(); + var name = className(obj); + assert.equals(name, null); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/deprecated.js b/node_modules/@sinonjs/commons/lib/deprecated.js new file mode 100644 index 0000000..9957f79 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/deprecated.js @@ -0,0 +1,48 @@ +/* eslint-disable no-console */ +"use strict"; + +/** + * Returns a function that will invoke the supplied function and print a + * deprecation warning to the console each time it is called. + * @param {Function} func + * @param {string} msg + * @returns {Function} + */ +exports.wrap = function (func, msg) { + var wrapped = function () { + exports.printWarning(msg); + return func.apply(this, arguments); + }; + if (func.prototype) { + wrapped.prototype = func.prototype; + } + return wrapped; +}; + +/** + * Returns a string which can be supplied to `wrap()` to notify the user that a + * particular part of the sinon API has been deprecated. + * @param {string} packageName + * @param {string} funcName + * @returns {string} + */ +exports.defaultMsg = function (packageName, funcName) { + return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`; +}; + +/** + * Prints a warning on the console, when it exists + * @param {string} msg + * @returns {undefined} + */ +exports.printWarning = function (msg) { + /* istanbul ignore next */ + if (typeof process === "object" && process.emitWarning) { + // Emit Warnings in Node + process.emitWarning(msg); + } else if (console.info) { + console.info(msg); + } else { + console.log(msg); + } +}; diff --git a/node_modules/@sinonjs/commons/lib/deprecated.test.js b/node_modules/@sinonjs/commons/lib/deprecated.test.js new file mode 100644 index 0000000..275d8b1 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/deprecated.test.js @@ -0,0 +1,101 @@ +/* eslint-disable no-console */ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var sinon = require("@sinonjs/referee-sinon").sinon; + +var deprecated = require("./deprecated"); + +var msg = "test"; + +describe("deprecated", function () { + describe("defaultMsg", function () { + it("should return a string", function () { + assert.equals( + deprecated.defaultMsg("sinon", "someFunc"), + "sinon.someFunc is deprecated and will be removed from the public API in a future version of sinon." + ); + }); + }); + + describe("printWarning", function () { + beforeEach(function () { + sinon.replace(process, "emitWarning", sinon.fake()); + }); + + afterEach(sinon.restore); + + describe("when `process.emitWarning` is defined", function () { + it("should call process.emitWarning with a msg", function () { + deprecated.printWarning(msg); + assert.calledOnceWith(process.emitWarning, msg); + }); + }); + + describe("when `process.emitWarning` is undefined", function () { + beforeEach(function () { + sinon.replace(console, "info", sinon.fake()); + sinon.replace(console, "log", sinon.fake()); + process.emitWarning = undefined; + }); + + afterEach(sinon.restore); + + describe("when `console.info` is defined", function () { + it("should call `console.info` with a message", function () { + deprecated.printWarning(msg); + assert.calledOnceWith(console.info, msg); + }); + }); + + describe("when `console.info` is undefined", function () { + it("should call `console.log` with a message", function () { + console.info = undefined; + deprecated.printWarning(msg); + assert.calledOnceWith(console.log, msg); + }); + }); + }); + }); + + describe("wrap", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + var method = sinon.fake(); + var wrapped; + + beforeEach(function () { + wrapped = deprecated.wrap(method, msg); + }); + + it("should return a wrapper function", function () { + assert.match(wrapped, sinon.match.func); + }); + + it("should assign the prototype of the passed method", function () { + assert.equals(method.prototype, wrapped.prototype); + }); + + context("when the passed method has falsy prototype", function () { + it("should not be assigned to the wrapped method", function () { + method.prototype = null; + wrapped = deprecated.wrap(method, msg); + assert.match(wrapped.prototype, sinon.match.object); + }); + }); + + context("when invoking the wrapped function", function () { + before(function () { + sinon.replace(deprecated, "printWarning", sinon.fake()); + wrapped({}); + }); + + it("should call `printWarning` before invoking", function () { + assert.calledOnceWith(deprecated.printWarning, msg); + }); + + it("should invoke the passed method with the given arguments", function () { + assert.calledOnceWith(method, {}); + }); + }); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/every.js b/node_modules/@sinonjs/commons/lib/every.js new file mode 100644 index 0000000..91b8419 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/every.js @@ -0,0 +1,26 @@ +"use strict"; + +/** + * Returns true when fn returns true for all members of obj. + * This is an every implementation that works for all iterables + * @param {object} obj + * @param {Function} fn + * @returns {boolean} + */ +module.exports = function every(obj, fn) { + var pass = true; + + try { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + obj.forEach(function () { + if (!fn.apply(this, arguments)) { + // Throwing an error is the only way to break `forEach` + throw new Error(); + } + }); + } catch (e) { + pass = false; + } + + return pass; +}; diff --git a/node_modules/@sinonjs/commons/lib/every.test.js b/node_modules/@sinonjs/commons/lib/every.test.js new file mode 100644 index 0000000..e054a14 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/every.test.js @@ -0,0 +1,41 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var sinon = require("@sinonjs/referee-sinon").sinon; +var every = require("./every"); + +describe("util/core/every", function () { + it("returns true when the callback function returns true for every element in an iterable", function () { + var obj = [true, true, true, true]; + var allTrue = every(obj, function (val) { + return val; + }); + + assert(allTrue); + }); + + it("returns false when the callback function returns false for any element in an iterable", function () { + var obj = [true, true, true, false]; + var result = every(obj, function (val) { + return val; + }); + + assert.isFalse(result); + }); + + it("calls the given callback once for each item in an iterable until it returns false", function () { + var iterableOne = [true, true, true, true]; + var iterableTwo = [true, true, false, true]; + var callback = sinon.spy(function (val) { + return val; + }); + + every(iterableOne, callback); + assert.equals(callback.callCount, 4); + + callback.resetHistory(); + + every(iterableTwo, callback); + assert.equals(callback.callCount, 3); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/function-name.js b/node_modules/@sinonjs/commons/lib/function-name.js new file mode 100644 index 0000000..2ecf981 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/function-name.js @@ -0,0 +1,28 @@ +"use strict"; + +/** + * Returns a display name for a function + * @param {Function} func + * @returns {string} + */ +module.exports = function functionName(func) { + if (!func) { + return ""; + } + + try { + return ( + func.displayName || + func.name || + // Use function decomposition as a last resort to get function + // name. Does not rely on function decomposition to work - if it + // doesn't debugging will be slightly less informative + // (i.e. toString will say 'spy' rather than 'myFunc'). + (String(func).match(/function ([^\s(]+)/) || [])[1] + ); + } catch (e) { + // Stringify may fail and we might get an exception, as a last-last + // resort fall back to empty string. + return ""; + } +}; diff --git a/node_modules/@sinonjs/commons/lib/function-name.test.js b/node_modules/@sinonjs/commons/lib/function-name.test.js new file mode 100644 index 0000000..0798b4e --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/function-name.test.js @@ -0,0 +1,76 @@ +"use strict"; + +var jsc = require("jsverify"); +var refute = require("@sinonjs/referee-sinon").refute; + +var functionName = require("./function-name"); + +describe("function-name", function () { + it("should return empty string if func is falsy", function () { + jsc.assertForall("falsy", function (fn) { + return functionName(fn) === ""; + }); + }); + + it("should use displayName by default", function () { + jsc.assertForall("nestring", function (displayName) { + var fn = { displayName: displayName }; + + return functionName(fn) === fn.displayName; + }); + }); + + it("should use name if displayName is not available", function () { + jsc.assertForall("nestring", function (name) { + var fn = { name: name }; + + return functionName(fn) === fn.name; + }); + }); + + it("should fallback to string parsing", function () { + jsc.assertForall("nat", function (naturalNumber) { + var name = `fn${naturalNumber}`; + var fn = { + toString: function () { + return `\nfunction ${name}`; + }, + }; + + return functionName(fn) === name; + }); + }); + + it("should not fail when a name cannot be found", function () { + refute.exception(function () { + var fn = { + toString: function () { + return "\nfunction ("; + }, + }; + + functionName(fn); + }); + }); + + it("should not fail when toString is undefined", function () { + refute.exception(function () { + functionName(Object.create(null)); + }); + }); + + it("should not fail when toString throws", function () { + refute.exception(function () { + var fn; + try { + // eslint-disable-next-line no-eval + fn = eval("(function*() {})")().constructor; + } catch (e) { + // env doesn't support generators + return; + } + + functionName(fn); + }); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/global.js b/node_modules/@sinonjs/commons/lib/global.js new file mode 100644 index 0000000..ac5edb3 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/global.js @@ -0,0 +1,21 @@ +"use strict"; + +/** + * A reference to the global object + * @type {object} globalObject + */ +var globalObject; + +/* istanbul ignore else */ +if (typeof global !== "undefined") { + // Node + globalObject = global; +} else if (typeof window !== "undefined") { + // Browser + globalObject = window; +} else { + // WebWorker + globalObject = self; +} + +module.exports = globalObject; diff --git a/node_modules/@sinonjs/commons/lib/global.test.js b/node_modules/@sinonjs/commons/lib/global.test.js new file mode 100644 index 0000000..4fa73eb --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/global.test.js @@ -0,0 +1,16 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var globalObject = require("./global"); + +describe("global", function () { + before(function () { + if (typeof global === "undefined") { + this.skip(); + } + }); + + it("is same as global", function () { + assert.same(globalObject, global); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/index.js b/node_modules/@sinonjs/commons/lib/index.js new file mode 100644 index 0000000..870df32 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/index.js @@ -0,0 +1,14 @@ +"use strict"; + +module.exports = { + global: require("./global"), + calledInOrder: require("./called-in-order"), + className: require("./class-name"), + deprecated: require("./deprecated"), + every: require("./every"), + functionName: require("./function-name"), + orderByFirstCall: require("./order-by-first-call"), + prototypes: require("./prototypes"), + typeOf: require("./type-of"), + valueToString: require("./value-to-string"), +}; diff --git a/node_modules/@sinonjs/commons/lib/index.test.js b/node_modules/@sinonjs/commons/lib/index.test.js new file mode 100644 index 0000000..e79aa7e --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/index.test.js @@ -0,0 +1,31 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var index = require("./index"); + +var expectedMethods = [ + "calledInOrder", + "className", + "every", + "functionName", + "orderByFirstCall", + "typeOf", + "valueToString", +]; +var expectedObjectProperties = ["deprecated", "prototypes"]; + +describe("package", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + expectedMethods.forEach(function (name) { + it(`should export a method named ${name}`, function () { + assert.isFunction(index[name]); + }); + }); + + // eslint-disable-next-line mocha/no-setup-in-describe + expectedObjectProperties.forEach(function (name) { + it(`should export an object property named ${name}`, function () { + assert.isObject(index[name]); + }); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/order-by-first-call.js b/node_modules/@sinonjs/commons/lib/order-by-first-call.js new file mode 100644 index 0000000..26826cb --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/order-by-first-call.js @@ -0,0 +1,34 @@ +"use strict"; + +var sort = require("./prototypes/array").sort; +var slice = require("./prototypes/array").slice; + +/** + * @private + */ +function comparator(a, b) { + // uuid, won't ever be equal + var aCall = a.getCall(0); + var bCall = b.getCall(0); + var aId = (aCall && aCall.callId) || -1; + var bId = (bCall && bCall.callId) || -1; + + return aId < bId ? -1 : 1; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} getCall - A method that can return the first call + */ + +/** + * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call + * @param {SinonProxy[] | SinonProxy} spies + * @returns {SinonProxy[]} + */ +function orderByFirstCall(spies) { + return sort(slice(spies), comparator); +} + +module.exports = orderByFirstCall; diff --git a/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js b/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js new file mode 100644 index 0000000..cbc71be --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/order-by-first-call.test.js @@ -0,0 +1,52 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var knuthShuffle = require("knuth-shuffle").knuthShuffle; +var sinon = require("@sinonjs/referee-sinon").sinon; +var orderByFirstCall = require("./order-by-first-call"); + +describe("orderByFirstCall", function () { + it("should order an Array of spies by the callId of the first call, ascending", function () { + // create an array of spies + var spies = [ + sinon.spy(), + sinon.spy(), + sinon.spy(), + sinon.spy(), + sinon.spy(), + sinon.spy(), + ]; + + // call all the spies + spies.forEach(function (spy) { + spy(); + }); + + // add a few uncalled spies + spies.push(sinon.spy()); + spies.push(sinon.spy()); + + // randomise the order of the spies + knuthShuffle(spies); + + var sortedSpies = orderByFirstCall(spies); + + assert.equals(sortedSpies.length, spies.length); + + var orderedByFirstCall = sortedSpies.every(function (spy, index) { + if (index + 1 === sortedSpies.length) { + return true; + } + var nextSpy = sortedSpies[index + 1]; + + // uncalled spies should be ordered first + if (!spy.called) { + return true; + } + + return spy.calledImmediatelyBefore(nextSpy); + }); + + assert.isTrue(orderedByFirstCall); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/README.md b/node_modules/@sinonjs/commons/lib/prototypes/README.md new file mode 100644 index 0000000..c3d92fe --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/README.md @@ -0,0 +1,43 @@ +# Prototypes + +The functions in this folder are to be use for keeping cached references to the built-in prototypes, so that people can't inadvertently break the library by making mistakes in userland. + +See https://github.com/sinonjs/sinon/pull/1523 + +## Without cached references + +```js +// in userland, the library user needs to replace the filter method on +// Array.prototype +var array = [1, 2, 3]; +sinon.replace(array, "filter", sinon.fake.returns(2)); + +// in a sinon module, the library author needs to use the filter method +var someArray = ["a", "b", 42, "c"]; +var answer = filter(someArray, function (v) { + return v === 42; +}); + +console.log(answer); +// => 2 +``` + +## With cached references + +```js +// in userland, the library user needs to replace the filter method on +// Array.prototype +var array = [1, 2, 3]; +sinon.replace(array, "filter", sinon.fake.returns(2)); + +// in a sinon module, the library author needs to use the filter method +// get a reference to the original Array.prototype.filter +var filter = require("@sinonjs/commons").prototypes.array.filter; +var someArray = ["a", "b", 42, "c"]; +var answer = filter(someArray, function (v) { + return v === 42; +}); + +console.log(answer); +// => 42 +``` diff --git a/node_modules/@sinonjs/commons/lib/prototypes/array.js b/node_modules/@sinonjs/commons/lib/prototypes/array.js new file mode 100644 index 0000000..381a032 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/array.js @@ -0,0 +1,5 @@ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Array.prototype); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js b/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js new file mode 100644 index 0000000..38549c1 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js @@ -0,0 +1,40 @@ +"use strict"; + +var call = Function.call; +var throwsOnProto = require("./throws-on-proto"); + +var disallowedProperties = [ + // ignore size because it throws from Map + "size", + "caller", + "callee", + "arguments", +]; + +// This branch is covered when tests are run with `--disable-proto=throw`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */ +if (throwsOnProto) { + disallowedProperties.push("__proto__"); +} + +module.exports = function copyPrototypeMethods(prototype) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return Object.getOwnPropertyNames(prototype).reduce(function ( + result, + name + ) { + if (disallowedProperties.includes(name)) { + return result; + } + + if (typeof prototype[name] !== "function") { + return result; + } + + result[name] = call.bind(prototype[name]); + + return result; + }, + Object.create(null)); +}; diff --git a/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js b/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js new file mode 100644 index 0000000..31de7cd --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js @@ -0,0 +1,12 @@ +"use strict"; + +var refute = require("@sinonjs/referee-sinon").refute; +var copyPrototypeMethods = require("./copy-prototype-methods"); + +describe("copyPrototypeMethods", function () { + it("does not throw for Map", function () { + refute.exception(function () { + copyPrototypeMethods(Map.prototype); + }); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/function.js b/node_modules/@sinonjs/commons/lib/prototypes/function.js new file mode 100644 index 0000000..a75c25d --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/function.js @@ -0,0 +1,5 @@ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Function.prototype); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/index.js b/node_modules/@sinonjs/commons/lib/prototypes/index.js new file mode 100644 index 0000000..ab766bf --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/index.js @@ -0,0 +1,10 @@ +"use strict"; + +module.exports = { + array: require("./array"), + function: require("./function"), + map: require("./map"), + object: require("./object"), + set: require("./set"), + string: require("./string"), +}; diff --git a/node_modules/@sinonjs/commons/lib/prototypes/index.test.js b/node_modules/@sinonjs/commons/lib/prototypes/index.test.js new file mode 100644 index 0000000..2b3c262 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/index.test.js @@ -0,0 +1,61 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; + +var arrayProto = require("./index").array; +var functionProto = require("./index").function; +var mapProto = require("./index").map; +var objectProto = require("./index").object; +var setProto = require("./index").set; +var stringProto = require("./index").string; +var throwsOnProto = require("./throws-on-proto"); + +describe("prototypes", function () { + describe(".array", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + verifyProperties(arrayProto, Array); + }); + describe(".function", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + verifyProperties(functionProto, Function); + }); + describe(".map", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + verifyProperties(mapProto, Map); + }); + describe(".object", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + verifyProperties(objectProto, Object); + }); + describe(".set", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + verifyProperties(setProto, Set); + }); + describe(".string", function () { + // eslint-disable-next-line mocha/no-setup-in-describe + verifyProperties(stringProto, String); + }); +}); + +function verifyProperties(p, origin) { + var disallowedProperties = ["size", "caller", "callee", "arguments"]; + if (throwsOnProto) { + disallowedProperties.push("__proto__"); + } + + it("should have all the methods of the origin prototype", function () { + var methodNames = Object.getOwnPropertyNames(origin.prototype).filter( + function (name) { + if (disallowedProperties.includes(name)) { + return false; + } + + return typeof origin.prototype[name] === "function"; + } + ); + + methodNames.forEach(function (name) { + assert.isTrue(Object.prototype.hasOwnProperty.call(p, name), name); + }); + }); +} diff --git a/node_modules/@sinonjs/commons/lib/prototypes/map.js b/node_modules/@sinonjs/commons/lib/prototypes/map.js new file mode 100644 index 0000000..91ec65e --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/map.js @@ -0,0 +1,5 @@ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Map.prototype); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/object.js b/node_modules/@sinonjs/commons/lib/prototypes/object.js new file mode 100644 index 0000000..eab7faa --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/object.js @@ -0,0 +1,5 @@ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Object.prototype); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/set.js b/node_modules/@sinonjs/commons/lib/prototypes/set.js new file mode 100644 index 0000000..7495c3b --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/set.js @@ -0,0 +1,5 @@ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Set.prototype); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/string.js b/node_modules/@sinonjs/commons/lib/prototypes/string.js new file mode 100644 index 0000000..3917fe9 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/string.js @@ -0,0 +1,5 @@ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(String.prototype); diff --git a/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js b/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js new file mode 100644 index 0000000..d77ab4a --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js @@ -0,0 +1,24 @@ +"use strict"; + +/** + * Is true when the environment causes an error to be thrown for accessing the + * __proto__ property. + * This is necessary in order to support `node --disable-proto=throw`. + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto + * @type {boolean} + */ +let throwsOnProto; +try { + const object = {}; + // eslint-disable-next-line no-proto, no-unused-expressions + object.__proto__; + throwsOnProto = false; +} catch (_) { + // This branch is covered when tests are run with `--disable-proto=throw`, + // however we can test both branches at the same time, so this is ignored + /* istanbul ignore next */ + throwsOnProto = true; +} + +module.exports = throwsOnProto; diff --git a/node_modules/@sinonjs/commons/lib/type-of.js b/node_modules/@sinonjs/commons/lib/type-of.js new file mode 100644 index 0000000..40b9215 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/type-of.js @@ -0,0 +1,12 @@ +"use strict"; + +var type = require("type-detect"); + +/** + * Returns the lower-case result of running type from type-detect on the value + * @param {*} value + * @returns {string} + */ +module.exports = function typeOf(value) { + return type(value).toLowerCase(); +}; diff --git a/node_modules/@sinonjs/commons/lib/type-of.test.js b/node_modules/@sinonjs/commons/lib/type-of.test.js new file mode 100644 index 0000000..ba377b9 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/type-of.test.js @@ -0,0 +1,51 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var typeOf = require("./type-of"); + +describe("typeOf", function () { + it("returns boolean", function () { + assert.equals(typeOf(false), "boolean"); + }); + + it("returns string", function () { + assert.equals(typeOf("Sinon.JS"), "string"); + }); + + it("returns number", function () { + assert.equals(typeOf(123), "number"); + }); + + it("returns object", function () { + assert.equals(typeOf({}), "object"); + }); + + it("returns function", function () { + assert.equals( + typeOf(function () { + return undefined; + }), + "function" + ); + }); + + it("returns undefined", function () { + assert.equals(typeOf(undefined), "undefined"); + }); + + it("returns null", function () { + assert.equals(typeOf(null), "null"); + }); + + it("returns array", function () { + assert.equals(typeOf([]), "array"); + }); + + it("returns regexp", function () { + assert.equals(typeOf(/.*/), "regexp"); + }); + + it("returns date", function () { + assert.equals(typeOf(new Date()), "date"); + }); +}); diff --git a/node_modules/@sinonjs/commons/lib/value-to-string.js b/node_modules/@sinonjs/commons/lib/value-to-string.js new file mode 100644 index 0000000..303f657 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/value-to-string.js @@ -0,0 +1,16 @@ +"use strict"; + +/** + * Returns a string representation of the value + * @param {*} value + * @returns {string} + */ +function valueToString(value) { + if (value && value.toString) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return value.toString(); + } + return String(value); +} + +module.exports = valueToString; diff --git a/node_modules/@sinonjs/commons/lib/value-to-string.test.js b/node_modules/@sinonjs/commons/lib/value-to-string.test.js new file mode 100644 index 0000000..6456447 --- /dev/null +++ b/node_modules/@sinonjs/commons/lib/value-to-string.test.js @@ -0,0 +1,20 @@ +"use strict"; + +var assert = require("@sinonjs/referee-sinon").assert; +var valueToString = require("./value-to-string"); + +describe("util/core/valueToString", function () { + it("returns string representation of an object", function () { + var obj = {}; + + assert.equals(valueToString(obj), obj.toString()); + }); + + it("returns 'null' for literal null'", function () { + assert.equals(valueToString(null), "null"); + }); + + it("returns 'undefined' for literal undefined", function () { + assert.equals(valueToString(undefined), "undefined"); + }); +}); diff --git a/node_modules/@sinonjs/commons/package.json b/node_modules/@sinonjs/commons/package.json new file mode 100644 index 0000000..9761045 --- /dev/null +++ b/node_modules/@sinonjs/commons/package.json @@ -0,0 +1,57 @@ +{ + "name": "@sinonjs/commons", + "version": "3.0.1", + "description": "Simple functions shared among the sinon end user libraries", + "main": "lib/index.js", + "types": "./types/index.d.ts", + "scripts": { + "build": "rm -rf types && tsc", + "lint": "eslint .", + "precommit": "lint-staged", + "test": "mocha --recursive -R dot \"lib/**/*.test.js\"", + "test-check-coverage": "npm run test-coverage && nyc check-coverage --branches 100 --functions 100 --lines 100", + "test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test", + "prepublishOnly": "npm run build", + "prettier:check": "prettier --check '**/*.{js,css,md}'", + "prettier:write": "prettier --write '**/*.{js,css,md}'", + "preversion": "npm run test-check-coverage", + "version": "changes --commits --footer", + "postversion": "git push --follow-tags && npm publish", + "prepare": "husky install" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sinonjs/commons.git" + }, + "files": [ + "lib", + "types" + ], + "author": "", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/sinonjs/commons/issues" + }, + "homepage": "https://github.com/sinonjs/commons#readme", + "lint-staged": { + "*.{js,css,md}": "prettier --check", + "*.js": "eslint" + }, + "devDependencies": { + "@sinonjs/eslint-config": "^4.0.6", + "@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.0", + "@sinonjs/referee-sinon": "^10.1.0", + "@studio/changes": "^2.2.0", + "husky": "^6.0.0", + "jsverify": "0.8.4", + "knuth-shuffle": "^1.0.8", + "lint-staged": "^13.0.3", + "mocha": "^10.1.0", + "nyc": "^15.1.0", + "prettier": "^2.7.1", + "typescript": "^4.8.4" + }, + "dependencies": { + "type-detect": "4.0.8" + } +} diff --git a/node_modules/@sinonjs/commons/types/called-in-order.d.ts b/node_modules/@sinonjs/commons/types/called-in-order.d.ts new file mode 100644 index 0000000..ad52887 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/called-in-order.d.ts @@ -0,0 +1,34 @@ +export = calledInOrder; +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} calledBefore - A method that determines if this proxy was called before another one + * @property {string} id - Some id + * @property {number} callCount - Number of times this proxy has been called + */ +/** + * Returns true when the spies have been called in the order they were supplied in + * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments + * @returns {boolean} true when spies are called in order, false otherwise + */ +declare function calledInOrder(spies: SinonProxy[] | SinonProxy, ...args: any[]): boolean; +declare namespace calledInOrder { + export { SinonProxy }; +} +/** + * A Sinon proxy object (fake, spy, stub) + */ +type SinonProxy = { + /** + * - A method that determines if this proxy was called before another one + */ + calledBefore: Function; + /** + * - Some id + */ + id: string; + /** + * - Number of times this proxy has been called + */ + callCount: number; +}; diff --git a/node_modules/@sinonjs/commons/types/class-name.d.ts b/node_modules/@sinonjs/commons/types/class-name.d.ts new file mode 100644 index 0000000..58d8284 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/class-name.d.ts @@ -0,0 +1,7 @@ +export = className; +/** + * Returns a display name for a value from a constructor + * @param {object} value A value to examine + * @returns {(string|null)} A string or null + */ +declare function className(value: object): (string | null); diff --git a/node_modules/@sinonjs/commons/types/deprecated.d.ts b/node_modules/@sinonjs/commons/types/deprecated.d.ts new file mode 100644 index 0000000..81a35bf --- /dev/null +++ b/node_modules/@sinonjs/commons/types/deprecated.d.ts @@ -0,0 +1,3 @@ +export function wrap(func: Function, msg: string): Function; +export function defaultMsg(packageName: string, funcName: string): string; +export function printWarning(msg: string): undefined; diff --git a/node_modules/@sinonjs/commons/types/every.d.ts b/node_modules/@sinonjs/commons/types/every.d.ts new file mode 100644 index 0000000..bcfa64e --- /dev/null +++ b/node_modules/@sinonjs/commons/types/every.d.ts @@ -0,0 +1,2 @@ +declare function _exports(obj: object, fn: Function): boolean; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/function-name.d.ts b/node_modules/@sinonjs/commons/types/function-name.d.ts new file mode 100644 index 0000000..f27d519 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/function-name.d.ts @@ -0,0 +1,2 @@ +declare function _exports(func: Function): string; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/global.d.ts b/node_modules/@sinonjs/commons/types/global.d.ts new file mode 100644 index 0000000..20c6784 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/global.d.ts @@ -0,0 +1,6 @@ +export = globalObject; +/** + * A reference to the global object + * @type {object} globalObject + */ +declare var globalObject: object; diff --git a/node_modules/@sinonjs/commons/types/index.d.ts b/node_modules/@sinonjs/commons/types/index.d.ts new file mode 100644 index 0000000..7d675b1 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/index.d.ts @@ -0,0 +1,17 @@ +export const global: any; +export const calledInOrder: typeof import("./called-in-order"); +export const className: typeof import("./class-name"); +export const deprecated: typeof import("./deprecated"); +export const every: (obj: any, fn: Function) => boolean; +export const functionName: (func: Function) => string; +export const orderByFirstCall: typeof import("./order-by-first-call"); +export const prototypes: { + array: any; + function: any; + map: any; + object: any; + set: any; + string: any; +}; +export const typeOf: (value: any) => string; +export const valueToString: typeof import("./value-to-string"); diff --git a/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts b/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts new file mode 100644 index 0000000..834c7a5 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/order-by-first-call.d.ts @@ -0,0 +1,24 @@ +export = orderByFirstCall; +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} getCall - A method that can return the first call + */ +/** + * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call + * @param {SinonProxy[] | SinonProxy} spies + * @returns {SinonProxy[]} + */ +declare function orderByFirstCall(spies: SinonProxy[] | SinonProxy): SinonProxy[]; +declare namespace orderByFirstCall { + export { SinonProxy }; +} +/** + * A Sinon proxy object (fake, spy, stub) + */ +type SinonProxy = { + /** + * - A method that can return the first call + */ + getCall: Function; +}; diff --git a/node_modules/@sinonjs/commons/types/prototypes/array.d.ts b/node_modules/@sinonjs/commons/types/prototypes/array.d.ts new file mode 100644 index 0000000..1cce635 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/array.d.ts @@ -0,0 +1,2 @@ +declare const _exports: any; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts b/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts new file mode 100644 index 0000000..1479b93 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts @@ -0,0 +1,2 @@ +declare function _exports(prototype: any): any; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/prototypes/function.d.ts b/node_modules/@sinonjs/commons/types/prototypes/function.d.ts new file mode 100644 index 0000000..1cce635 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/function.d.ts @@ -0,0 +1,2 @@ +declare const _exports: any; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/prototypes/index.d.ts b/node_modules/@sinonjs/commons/types/prototypes/index.d.ts new file mode 100644 index 0000000..0026d6c --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/index.d.ts @@ -0,0 +1,7 @@ +export declare const array: any; +declare const _function: any; +export { _function as function }; +export declare const map: any; +export declare const object: any; +export declare const set: any; +export declare const string: any; diff --git a/node_modules/@sinonjs/commons/types/prototypes/map.d.ts b/node_modules/@sinonjs/commons/types/prototypes/map.d.ts new file mode 100644 index 0000000..1cce635 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/map.d.ts @@ -0,0 +1,2 @@ +declare const _exports: any; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/prototypes/object.d.ts b/node_modules/@sinonjs/commons/types/prototypes/object.d.ts new file mode 100644 index 0000000..1cce635 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/object.d.ts @@ -0,0 +1,2 @@ +declare const _exports: any; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/prototypes/set.d.ts b/node_modules/@sinonjs/commons/types/prototypes/set.d.ts new file mode 100644 index 0000000..1cce635 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/set.d.ts @@ -0,0 +1,2 @@ +declare const _exports: any; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/prototypes/string.d.ts b/node_modules/@sinonjs/commons/types/prototypes/string.d.ts new file mode 100644 index 0000000..1cce635 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/string.d.ts @@ -0,0 +1,2 @@ +declare const _exports: any; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts b/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts new file mode 100644 index 0000000..2ec7145 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts @@ -0,0 +1,10 @@ +export = throwsOnProto; +/** + * Is true when the environment causes an error to be thrown for accessing the + * __proto__ property. + * This is necessary in order to support `node --disable-proto=throw`. + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto + * @type {boolean} + */ +declare let throwsOnProto: boolean; diff --git a/node_modules/@sinonjs/commons/types/type-of.d.ts b/node_modules/@sinonjs/commons/types/type-of.d.ts new file mode 100644 index 0000000..fc72887 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/type-of.d.ts @@ -0,0 +1,2 @@ +declare function _exports(value: any): string; +export = _exports; diff --git a/node_modules/@sinonjs/commons/types/value-to-string.d.ts b/node_modules/@sinonjs/commons/types/value-to-string.d.ts new file mode 100644 index 0000000..827caf8 --- /dev/null +++ b/node_modules/@sinonjs/commons/types/value-to-string.d.ts @@ -0,0 +1,7 @@ +export = valueToString; +/** + * Returns a string representation of the value + * @param {*} value + * @returns {string} + */ +declare function valueToString(value: any): string; diff --git a/node_modules/@sinonjs/fake-timers/LICENSE b/node_modules/@sinonjs/fake-timers/LICENSE new file mode 100644 index 0000000..eb84755 --- /dev/null +++ b/node_modules/@sinonjs/fake-timers/LICENSE @@ -0,0 +1,11 @@ +Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/node_modules/@sinonjs/fake-timers/README.md b/node_modules/@sinonjs/fake-timers/README.md new file mode 100644 index 0000000..a7f5ab6 --- /dev/null +++ b/node_modules/@sinonjs/fake-timers/README.md @@ -0,0 +1,394 @@ +# `@sinonjs/fake-timers` + +[![codecov](https://codecov.io/gh/sinonjs/fake-timers/branch/main/graph/badge.svg)](https://codecov.io/gh/sinonjs/fake-timers) +Contributor Covenant + +JavaScript implementation of the timer +APIs; `setTimeout`, `clearTimeout`, `setImmediate`, `clearImmediate`, `setInterval`, `clearInterval`, `requestAnimationFrame`, `cancelAnimationFrame`, `requestIdleCallback`, +and `cancelIdleCallback`, along with a clock instance that controls the flow of time. FakeTimers also provides a `Date` +implementation that gets its time from the clock. + +In addition in browser environment `@sinonjs/fake-timers` provides a `performance` implementation that gets its time +from the clock. In Node environments FakeTimers provides a `nextTick` implementation that is synchronized with the +clock - and a `process.hrtime` shim that works with the clock. + +`@sinonjs/fake-timers` can be used to simulate passing time in automated tests and other +situations where you want the scheduling semantics, but don't want to actually +wait. + +`@sinonjs/fake-timers` is extracted from [Sinon.JS](https://github.com/sinonjs/sinon.js) and targets +the [same runtimes](https://sinonjs.org/releases/latest/#supported-runtimes). + +## Autocomplete, IntelliSense and TypeScript definitions + +Version 7 introduced JSDoc to the codebase. This should provide autocomplete and type suggestions in supporting IDEs. If +you need more elaborate type support, TypeScript definitions for the Sinon projects are independently maintained by the +Definitely Types community: + +``` +npm install -D @types/sinonjs__fake-timers +``` + +## Installation + +`@sinonjs/fake-timers` can be used in both Node and browser environments. Installation is as easy as + +```sh +npm install @sinonjs/fake-timers +``` + +If you want to use `@sinonjs/fake-timers` in a browser you can either build your own bundle or +use [Skypack](https://www.skypack.dev). + +## Usage + +To use `@sinonjs/fake-timers`, create a new clock, schedule events on it using the timer +functions and pass time using the `tick` method. + +```js +// In the browser distribution, a global `FakeTimers` is already available +var FakeTimers = require("@sinonjs/fake-timers"); +var clock = FakeTimers.createClock(); + +clock.setTimeout(function () { + console.log( + "The poblano is a mild chili pepper originating in the state of Puebla, Mexico.", + ); +}, 15); + +// ... + +clock.tick(15); +``` + +Upon executing the last line, an interesting fact about the +[Poblano](https://en.wikipedia.org/wiki/Poblano) will be printed synchronously to +the screen. If you want to simulate asynchronous behavior, please see the `async` function variants ( +eg `clock.tick(time)` vs `await clock.tickAsync(time)`). + +The `next`, `runAll`, `runToFrame`, and `runToLast` methods are available to advance the clock. See the +API Reference for more details. + +### Faking the native timers + +When using `@sinonjs/fake-timers` to test timers, you will most likely want to replace the native +timers such that calling `setTimeout` actually schedules a callback with your +clock instance, not the browser's internals. + +Calling `install` with no arguments achieves this. You can call `uninstall` +later to restore things as they were again. +Note that in NodeJS the [timers](https://nodejs.org/api/timers.html) +and [timers/promises](https://nodejs.org/api/timers.html#timers-promises-api) modules will also receive fake timers when +using global scope. + +```js +// In the browser distribution, a global `FakeTimers` is already available +var FakeTimers = require("@sinonjs/fake-timers"); + +var clock = FakeTimers.install(); +// Equivalent to +// var clock = FakeTimers.install(typeof global !== "undefined" ? global : window); + +setTimeout(fn, 15); // Schedules with clock.setTimeout + +clock.uninstall(); +// setTimeout is restored to the native implementation +``` + +To hijack timers in another context pass it to the `install` method. + +```js +var FakeTimers = require("@sinonjs/fake-timers"); +var context = { + setTimeout: setTimeout, // By default context.setTimeout uses the global setTimeout +}; +var clock = FakeTimers.withGlobal(context).install(); + +context.setTimeout(fn, 15); // Schedules with clock.setTimeout + +clock.uninstall(); +// context.setTimeout is restored to the original implementation +``` + +Usually you want to install the timers onto the global object, so call `install` +without arguments. + +#### Automatically incrementing mocked time + +FakeTimers supports the possibility to attach the faked timers to any change +in the real system time. This means that there is no need to `tick()` the +clock in a situation where you won't know **when** to call `tick()`. + +Please note that this is achieved using the original setImmediate() API at a certain +configurable interval `config.advanceTimeDelta` (default: 20ms). Meaning time would +be incremented every 20ms, not in real time. + +An example would be: + +```js +var FakeTimers = require("@sinonjs/fake-timers"); +var clock = FakeTimers.install({ + shouldAdvanceTime: true, + advanceTimeDelta: 40, +}); + +setTimeout(() => { + console.log("this just timed out"); //executed after 40ms +}, 30); + +setImmediate(() => { + console.log("not so immediate"); //executed after 40ms +}); + +setTimeout(() => { + console.log("this timed out after"); //executed after 80ms + clock.uninstall(); +}, 50); +``` + +## API Reference + +### `var clock = FakeTimers.createClock([now[, loopLimit]])` + +Creates a clock. The default +[epoch](https://en.wikipedia.org/wiki/Epoch_%28reference_date%29) is `0`. + +The `now` argument may be a number (in milliseconds) or a Date object. + +The `loopLimit` argument sets the maximum number of timers that will be run when calling `runAll()` before assuming that +we have an infinite loop and throwing an error. The default is `1000`. + +### `var clock = FakeTimers.install([config])` + +Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). +Note that in NodeJS the [timers](https://nodejs.org/api/timers.html) +and [timers/promises](https://nodejs.org/api/timers.html#timers-promises-api) modules will also receive fake timers when +using global scope. +The following configuration options are available + +| Parameter | Type | Default | Description | +| -------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `config.now` | Number/Date | 0 | installs FakeTimers with the specified unix epoch | +| `config.toFake` | String[] | ["setTimeout", "clearTimeout", "setImmediate", "clearImmediate","setInterval", "clearInterval", "Date", "requestAnimationFrame", "cancelAnimationFrame", "requestIdleCallback", "cancelIdleCallback", "hrtime", "performance"] | an array with explicit function names (or objects, in the case of "performance") to hijack. \_When not set, FakeTimers will automatically fake all methods e.g., `FakeTimers.install({ toFake: ["setTimeout","nextTick"]})` will fake only `setTimeout` and `nextTick` | +| `config.loopLimit` | Number | 1000 | the maximum number of timers that will be run when calling runAll() | +| `config.shouldAdvanceTime` | Boolean | false | tells FakeTimers to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by 20ms for every 20ms change in the real system time) | +| `config.advanceTimeDelta` | Number | 20 | relevant only when using with `shouldAdvanceTime: true`. increment mocked time by `advanceTimeDelta` ms every `advanceTimeDelta` ms change in the real system time. | +| `config.shouldClearNativeTimers` | Boolean | false | tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by default, leading to potentially unexpected behavior if timers existed prior to installing FakeTimers. | +| `config.ignoreMissingTimers` | Boolean | false | tells FakeTimers to ignore missing timers that might not exist in the given environment | + +### `var id = clock.setTimeout(callback, timeout)` + +Schedules the callback to be fired once `timeout` milliseconds have ticked by. + +In Node.js `setTimeout` returns a timer object. FakeTimers will do the same, however +its `ref()` and `unref()` methods have no effect. + +In browsers a timer ID is returned. + +### `clock.clearTimeout(id)` + +Clears the timer given the ID or timer object, as long as it was created using +`setTimeout`. + +### `var id = clock.setInterval(callback, timeout)` + +Schedules the callback to be fired every time `timeout` milliseconds have ticked +by. + +In Node.js `setInterval` returns a timer object. FakeTimers will do the same, however +its `ref()` and `unref()` methods have no effect. + +In browsers a timer ID is returned. + +### `clock.clearInterval(id)` + +Clears the timer given the ID or timer object, as long as it was created using +`setInterval`. + +### `var id = clock.setImmediate(callback)` + +Schedules the callback to be fired once `0` milliseconds have ticked by. Note +that you'll still have to call `clock.tick()` for the callback to fire. If +called during a tick the callback won't fire until `1` millisecond has ticked +by. + +In Node.js `setImmediate` returns a timer object. FakeTimers will do the same, +however its `ref()` and `unref()` methods have no effect. + +In browsers a timer ID is returned. + +### `clock.clearImmediate(id)` + +Clears the timer given the ID or timer object, as long as it was created using +`setImmediate`. + +### `clock.requestAnimationFrame(callback)` + +Schedules the callback to be fired on the next animation frame, which runs every +16 ticks. Returns an `id` which can be used to cancel the callback. This is +available in both browser & node environments. + +### `clock.cancelAnimationFrame(id)` + +Cancels the callback scheduled by the provided id. + +### `clock.requestIdleCallback(callback[, timeout])` + +Queued the callback to be fired during idle periods to perform background and low priority work on the main event loop. +Callbacks which have a timeout option will be fired no later than time in milliseconds. Returns an `id` which can be +used to cancel the callback. + +### `clock.cancelIdleCallback(id)` + +Cancels the callback scheduled by the provided id. + +### `clock.countTimers()` + +Returns the number of waiting timers. This can be used to assert that a test +finishes without leaking any timers. + +### `clock.hrtime(prevTime?)` + +Only available in Node.js, mimicks process.hrtime(). + +### `clock.nextTick(callback)` + +Only available in Node.js, mimics `process.nextTick` to enable completely synchronous testing flows. + +### `clock.performance.now()` + +Only available in browser environments, mimicks performance.now(). + +### `clock.tick(time)` / `await clock.tickAsync(time)` + +Advance the clock, firing callbacks if necessary. `time` may be the number of +milliseconds to advance the clock by or a human-readable string. Valid string +formats are `"08"` for eight seconds, `"01:00"` for one minute and `"02:34:10"` +for two hours, 34 minutes and ten seconds. + +The `tickAsync()` will also break the event loop, allowing any scheduled promise +callbacks to execute _before_ running the timers. + +### `clock.next()` / `await clock.nextAsync()` + +Advances the clock to the the moment of the first scheduled timer, firing it. + +The `nextAsync()` will also break the event loop, allowing any scheduled promise +callbacks to execute _before_ running the timers. + +### `clock.jump(time)` + +Advance the clock by jumping forward in time, firing callbacks at most once. +`time` takes the same formats as [`clock.tick`](#clockticktime--await-clocktickasynctime). + +This can be used to simulate the JS engine (such as a browser) being put to sleep and resumed later, skipping +intermediary timers. + +### `clock.reset()` + +Removes all timers and ticks without firing them, and sets `now` to `config.now` +that was provided to `FakeTimers.install` or to `0` if `config.now` was not provided. +Useful to reset the state of the clock without having to `uninstall` and `install` it. + +### `clock.runAll()` / `await clock.runAllAsync()` + +This runs all pending timers until there are none remaining. If new timers are added while it is executing they will be +run as well. + +This makes it easier to run asynchronous tests to completion without worrying about the number of timers they use, or +the delays in those timers. + +It runs a maximum of `loopLimit` times after which it assumes there is an infinite loop of timers and throws an error. + +The `runAllAsync()` will also break the event loop, allowing any scheduled promise +callbacks to execute _before_ running the timers. + +### `clock.runMicrotasks()` + +This runs all pending microtasks scheduled with `nextTick` but none of the timers and is mostly useful for libraries +using FakeTimers underneath and for running `nextTick` items without any timers. + +### `clock.runToFrame()` + +Advances the clock to the next frame, firing all scheduled animation frame callbacks, +if any, for that frame as well as any other timers scheduled along the way. + +### `clock.runToLast()` / `await clock.runToLastAsync()` + +This takes note of the last scheduled timer when it is run, and advances the +clock to that time firing callbacks as necessary. + +If new timers are added while it is executing they will be run only if they +would occur before this time. + +This is useful when you want to run a test to completion, but the test recursively +sets timers that would cause `runAll` to trigger an infinite loop warning. + +The `runToLastAsync()` will also break the event loop, allowing any scheduled promise +callbacks to execute _before_ running the timers. + +### `clock.setSystemTime([now])` + +This simulates a user changing the system clock while your program is running. +It affects the current time but it does not in itself cause e.g. timers to fire; +they will fire exactly as they would have done without the call to +setSystemTime(). + +### `clock.uninstall()` + +Restores the original methods of the native timers or the methods on the object +that was passed to `FakeTimers.withGlobal` + +### `Date` + +Implements the `Date` object but using the clock to provide the correct time. + +### `Performance` + +Implements the `now` method of the [`Performance`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) +object but using the clock to provide the correct time. Only available in environments that support the Performance +object (browsers mostly). + +### `FakeTimers.withGlobal` + +In order to support creating clocks based on separate or sandboxed environments (such as JSDOM), FakeTimers exports a +factory method which takes single argument `global`, which it inspects to figure out what to mock and what features to +support. When invoking this function with a global, you will get back an object with `timers`, `createClock` +and `install` - same as the regular FakeTimers exports only based on the passed in global instead of the global +environment. + +## Promises and fake time + +If you use a Promise library like Bluebird, note that you should either call `clock.runMicrotasks()` or make sure to +_not_ mock `nextTick`. + +## Running tests + +FakeTimers has a comprehensive test suite. If you're thinking of contributing bug +fixes or suggesting new features, you need to make sure you have not broken any +tests. You are also expected to add tests for any new behavior. + +### On node: + +```sh +npm test +``` + +Or, if you prefer more verbose output: + +``` +$(npm bin)/mocha ./test/fake-timers-test.js +``` + +### In the browser + +[Mochify](https://github.com/mochify-js) is used to run the tests in headless +Chrome. + +```sh +npm test-headless +``` + +## License + +BSD 3-clause "New" or "Revised" License (see LICENSE file) diff --git a/node_modules/@sinonjs/fake-timers/package.json b/node_modules/@sinonjs/fake-timers/package.json new file mode 100644 index 0000000..e59405e --- /dev/null +++ b/node_modules/@sinonjs/fake-timers/package.json @@ -0,0 +1,78 @@ +{ + "name": "@sinonjs/fake-timers", + "description": "Fake JavaScript timers", + "version": "13.0.5", + "homepage": "https://github.com/sinonjs/fake-timers", + "author": "Christian Johansen", + "repository": { + "type": "git", + "url": "git+https://github.com/sinonjs/fake-timers.git" + }, + "bugs": { + "mail": "christian@cjohansen.no", + "url": "https://github.com/sinonjs/fake-timers/issues" + }, + "license": "BSD-3-Clause", + "scripts": { + "lint": "eslint .", + "test-node": "mocha --timeout 200 test/ integration-test/ -R dot --check-leaks", + "test-headless": "mochify --driver puppeteer", + "test-check-coverage": "npm run test-coverage && nyc check-coverage", + "test-cloud": "npm run test-edge && npm run test-firefox && npm run test-safari", + "test-edge": "BROWSER_NAME=MicrosoftEdge mochify --config mochify.webdriver.js", + "test-firefox": "BROWSER_NAME=firefox mochify --config mochify.webdriver.js", + "test-safari": "BROWSER_NAME=safari mochify --config mochify.webdriver.js", + "test-coverage": "nyc -x mochify.webdriver.js -x coverage --all --reporter text --reporter html --reporter lcovonly npm run test-node", + "test": "npm run test-node && npm run test-headless", + "prettier:check": "prettier --check '**/*.{js,css,md}'", + "prettier:write": "prettier --write '**/*.{js,css,md}'", + "preversion": "./scripts/preversion.sh", + "version": "./scripts/version.sh", + "postversion": "./scripts/postversion.sh", + "prepare": "husky" + }, + "lint-staged": { + "*.{js,css,md}": "prettier --check", + "*.js": "eslint" + }, + "mochify": { + "reporter": "dot", + "timeout": 10000, + "bundle": "esbuild --bundle --sourcemap=inline --define:process.env.NODE_DEBUG=\"\"", + "bundle_stdin": "require", + "spec": "test/**/*-test.js" + }, + "files": [ + "src/" + ], + "devDependencies": { + "@mochify/cli": "^0.4.1", + "@mochify/driver-puppeteer": "^0.4.0", + "@mochify/driver-webdriver": "^0.2.1", + "@sinonjs/eslint-config": "^5.0.3", + "@sinonjs/referee-sinon": "12.0.0", + "esbuild": "^0.23.1", + "husky": "^9.1.5", + "jsdom": "24.1.1", + "lint-staged": "15.2.9", + "mocha": "10.7.3", + "nyc": "17.0.0", + "prettier": "3.3.3" + }, + "main": "./src/fake-timers-src.js", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + }, + "nyc": { + "branches": 85, + "lines": 92, + "functions": 92, + "statements": 92, + "exclude": [ + "**/*-test.js", + "coverage/**", + "types/**", + "fake-timers.js" + ] + } +} diff --git a/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js b/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js new file mode 100644 index 0000000..b9a8a8d --- /dev/null +++ b/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js @@ -0,0 +1,2163 @@ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +let timersModule, timersPromisesModule; +if (typeof require === "function" && typeof module === "object") { + try { + timersModule = require("timers"); + } catch (e) { + // ignored + } + try { + timersPromisesModule = require("timers/promises"); + } catch (e) { + // ignored + } +} + +/** + * @typedef {object} IdleDeadline + * @property {boolean} didTimeout - whether or not the callback was called before reaching the optional timeout + * @property {function():number} timeRemaining - a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period + */ + +/** + * Queues a function to be called during a browser's idle periods + * + * @callback RequestIdleCallback + * @param {function(IdleDeadline)} callback + * @param {{timeout: number}} options - an options object + * @returns {number} the id + */ + +/** + * @callback NextTick + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {void} + */ + +/** + * @callback SetImmediate + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {NodeImmediate} + */ + +/** + * @callback VoidVarArgsFunc + * @param {...*} callback - the callback to run + * @returns {void} + */ + +/** + * @typedef RequestAnimationFrame + * @property {function(number):void} requestAnimationFrame + * @returns {number} - the id + */ + +/** + * @typedef Performance + * @property {function(): number} now + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * @typedef {object} Clock + * @property {number} now - the current time + * @property {Date} Date - the Date constructor + * @property {number} loopLimit - the maximum number of timers before assuming an infinite loop + * @property {RequestIdleCallback} requestIdleCallback + * @property {function(number):void} cancelIdleCallback + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {NextTick} nextTick + * @property {queueMicrotask} queueMicrotask + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {SetImmediate} setImmediate + * @property {function(NodeImmediate):void} clearImmediate + * @property {function():number} countTimers + * @property {RequestAnimationFrame} requestAnimationFrame + * @property {function(number):void} cancelAnimationFrame + * @property {function():void} runMicrotasks + * @property {function(string | number): number} tick + * @property {function(string | number): Promise} tickAsync + * @property {function(): number} next + * @property {function(): Promise} nextAsync + * @property {function(): number} runAll + * @property {function(): number} runToFrame + * @property {function(): Promise} runAllAsync + * @property {function(): number} runToLast + * @property {function(): Promise} runToLastAsync + * @property {function(): void} reset + * @property {function(number | Date): void} setSystemTime + * @property {function(number): void} jump + * @property {Performance} performance + * @property {function(number[]): number[]} hrtime - process.hrtime (legacy) + * @property {function(): void} uninstall Uninstall the clock. + * @property {Function[]} methods - the methods that are faked + * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods + * @property {{methodName:string, original:any}[] | undefined} timersPromisesModuleMethods + * @property {Map} abortListenerMap + */ +/* eslint-enable jsdoc/require-property-description */ + +/** + * Configuration object for the `install` method. + * + * @typedef {object} Config + * @property {number|Date} [now] a number (in milliseconds) or a Date object (default epoch) + * @property {string[]} [toFake] names of the methods that should be faked. + * @property {number} [loopLimit] the maximum number of timers that will be run when calling runAll() + * @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false) + * @property {number} [advanceTimeDelta] increment mocked time every <> ms (default: 20ms) + * @property {boolean} [shouldClearNativeTimers] forwards clear timer calls to native functions if they are not fakes (default: false) + * @property {boolean} [ignoreMissingTimers] default is false, meaning asking to fake timers that are not present will throw an error + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * The internal structure to describe a scheduled fake timer + * + * @typedef {object} Timer + * @property {Function} func + * @property {*[]} args + * @property {number} delay + * @property {number} callAt + * @property {number} createdAt + * @property {boolean} immediate + * @property {number} id + * @property {Error} [error] + */ + +/** + * A Node timer + * + * @typedef {object} NodeImmediate + * @property {function(): boolean} hasRef + * @property {function(): NodeImmediate} ref + * @property {function(): NodeImmediate} unref + */ +/* eslint-enable jsdoc/require-property-description */ + +/* eslint-disable complexity */ + +/** + * Mocks available features in the specified global namespace. + * + * @param {*} _global Namespace to mock (e.g. `window`) + * @returns {FakeTimers} + */ +function withGlobal(_global) { + const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint + const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs + const NOOP = function () { + return undefined; + }; + const NOOP_ARRAY = function () { + return []; + }; + const isPresent = {}; + let timeoutResult, + addTimerReturnsObject = false; + + if (_global.setTimeout) { + isPresent.setTimeout = true; + timeoutResult = _global.setTimeout(NOOP, 0); + addTimerReturnsObject = typeof timeoutResult === "object"; + } + isPresent.clearTimeout = Boolean(_global.clearTimeout); + isPresent.setInterval = Boolean(_global.setInterval); + isPresent.clearInterval = Boolean(_global.clearInterval); + isPresent.hrtime = + _global.process && typeof _global.process.hrtime === "function"; + isPresent.hrtimeBigint = + isPresent.hrtime && typeof _global.process.hrtime.bigint === "function"; + isPresent.nextTick = + _global.process && typeof _global.process.nextTick === "function"; + const utilPromisify = _global.process && require("util").promisify; + isPresent.performance = + _global.performance && typeof _global.performance.now === "function"; + const hasPerformancePrototype = + _global.Performance && + (typeof _global.Performance).match(/^(function|object)$/); + const hasPerformanceConstructorPrototype = + _global.performance && + _global.performance.constructor && + _global.performance.constructor.prototype; + isPresent.queueMicrotask = _global.hasOwnProperty("queueMicrotask"); + isPresent.requestAnimationFrame = + _global.requestAnimationFrame && + typeof _global.requestAnimationFrame === "function"; + isPresent.cancelAnimationFrame = + _global.cancelAnimationFrame && + typeof _global.cancelAnimationFrame === "function"; + isPresent.requestIdleCallback = + _global.requestIdleCallback && + typeof _global.requestIdleCallback === "function"; + isPresent.cancelIdleCallbackPresent = + _global.cancelIdleCallback && + typeof _global.cancelIdleCallback === "function"; + isPresent.setImmediate = + _global.setImmediate && typeof _global.setImmediate === "function"; + isPresent.clearImmediate = + _global.clearImmediate && typeof _global.clearImmediate === "function"; + isPresent.Intl = _global.Intl && typeof _global.Intl === "object"; + + if (_global.clearTimeout) { + _global.clearTimeout(timeoutResult); + } + + const NativeDate = _global.Date; + const NativeIntl = _global.Intl; + let uniqueTimerId = idCounterStart; + + if (NativeDate === undefined) { + throw new Error( + "The global scope doesn't have a `Date` object" + + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)", + ); + } + isPresent.Date = true; + + /** + * The PerformanceEntry object encapsulates a single performance metric + * that is part of the browser's performance timeline. + * + * This is an object returned by the `mark` and `measure` methods on the Performance prototype + */ + class FakePerformanceEntry { + constructor(name, entryType, startTime, duration) { + this.name = name; + this.entryType = entryType; + this.startTime = startTime; + this.duration = duration; + } + + toJSON() { + return JSON.stringify({ ...this }); + } + } + + /** + * @param {number} num + * @returns {boolean} + */ + function isNumberFinite(num) { + if (Number.isFinite) { + return Number.isFinite(num); + } + + return isFinite(num); + } + + let isNearInfiniteLimit = false; + + /** + * @param {Clock} clock + * @param {number} i + */ + function checkIsNearInfiniteLimit(clock, i) { + if (clock.loopLimit && i === clock.loopLimit - 1) { + isNearInfiniteLimit = true; + } + } + + /** + * + */ + function resetIsNearInfiniteLimit() { + isNearInfiniteLimit = false; + } + + /** + * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into + * number of milliseconds. This is used to support human-readable strings passed + * to clock.tick() + * + * @param {string} str + * @returns {number} + */ + function parseTime(str) { + if (!str) { + return 0; + } + + const strings = str.split(":"); + const l = strings.length; + let i = l; + let ms = 0; + let parsed; + + if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { + throw new Error( + "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits", + ); + } + + while (i--) { + parsed = parseInt(strings[i], 10); + + if (parsed >= 60) { + throw new Error(`Invalid time ${str}`); + } + + ms += parsed * Math.pow(60, l - i - 1); + } + + return ms * 1000; + } + + /** + * Get the decimal part of the millisecond value as nanoseconds + * + * @param {number} msFloat the number of milliseconds + * @returns {number} an integer number of nanoseconds in the range [0,1e6) + * + * Example: nanoRemainer(123.456789) -> 456789 + */ + function nanoRemainder(msFloat) { + const modulo = 1e6; + const remainder = (msFloat * 1e6) % modulo; + const positiveRemainder = + remainder < 0 ? remainder + modulo : remainder; + + return Math.floor(positiveRemainder); + } + + /** + * Used to grok the `now` parameter to createClock. + * + * @param {Date|number} epoch the system time + * @returns {number} + */ + function getEpoch(epoch) { + if (!epoch) { + return 0; + } + if (typeof epoch.getTime === "function") { + return epoch.getTime(); + } + if (typeof epoch === "number") { + return epoch; + } + throw new TypeError("now should be milliseconds since UNIX epoch"); + } + + /** + * @param {number} from + * @param {number} to + * @param {Timer} timer + * @returns {boolean} + */ + function inRange(from, to, timer) { + return timer && timer.callAt >= from && timer.callAt <= to; + } + + /** + * @param {Clock} clock + * @param {Timer} job + */ + function getInfiniteLoopError(clock, job) { + const infiniteLoopError = new Error( + `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`, + ); + + if (!job.error) { + return infiniteLoopError; + } + + // pattern never matched in Node + const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/; + let clockMethodPattern = new RegExp( + String(Object.keys(clock).join("|")), + ); + + if (addTimerReturnsObject) { + // node.js environment + clockMethodPattern = new RegExp( + `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`, + ); + } + + let matchedLineIndex = -1; + job.error.stack.split("\n").some(function (line, i) { + // If we've matched a computed target line (e.g. setTimeout) then we + // don't need to look any further. Return true to stop iterating. + const matchedComputedTarget = line.match(computedTargetPattern); + /* istanbul ignore if */ + if (matchedComputedTarget) { + matchedLineIndex = i; + return true; + } + + // If we've matched a clock method line, then there may still be + // others further down the trace. Return false to keep iterating. + const matchedClockMethod = line.match(clockMethodPattern); + if (matchedClockMethod) { + matchedLineIndex = i; + return false; + } + + // If we haven't matched anything on this line, but we matched + // previously and set the matched line index, then we can stop. + // If we haven't matched previously, then we should keep iterating. + return matchedLineIndex >= 0; + }); + + const stack = `${infiniteLoopError}\n${job.type || "Microtask"} - ${ + job.func.name || "anonymous" + }\n${job.error.stack + .split("\n") + .slice(matchedLineIndex + 1) + .join("\n")}`; + + try { + Object.defineProperty(infiniteLoopError, "stack", { + value: stack, + }); + } catch (e) { + // noop + } + + return infiniteLoopError; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function createDate() { + class ClockDate extends NativeDate { + /** + * @param {number} year + * @param {number} month + * @param {number} date + * @param {number} hour + * @param {number} minute + * @param {number} second + * @param {number} ms + * @returns void + */ + // eslint-disable-next-line no-unused-vars + constructor(year, month, date, hour, minute, second, ms) { + // Defensive and verbose to avoid potential harm in passing + // explicit undefined when user does not pass argument + if (arguments.length === 0) { + super(ClockDate.clock.now); + } else { + super(...arguments); + } + + // ensures identity checks using the constructor prop still works + // this should have no other functional effect + Object.defineProperty(this, "constructor", { + value: NativeDate, + enumerable: false, + }); + } + + static [Symbol.hasInstance](instance) { + return instance instanceof NativeDate; + } + } + + ClockDate.isFake = true; + + if (NativeDate.now) { + ClockDate.now = function now() { + return ClockDate.clock.now; + }; + } + + if (NativeDate.toSource) { + ClockDate.toSource = function toSource() { + return NativeDate.toSource(); + }; + } + + ClockDate.toString = function toString() { + return NativeDate.toString(); + }; + + // noinspection UnnecessaryLocalVariableJS + /** + * A normal Class constructor cannot be called without `new`, but Date can, so we need + * to wrap it in a Proxy in order to ensure this functionality of Date is kept intact + * + * @type {ClockDate} + */ + const ClockDateProxy = new Proxy(ClockDate, { + // handler for [[Call]] invocations (i.e. not using `new`) + apply() { + // the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. + // This remains so in the 10th edition of 2019 as well. + if (this instanceof ClockDate) { + throw new TypeError( + "A Proxy should only capture `new` calls with the `construct` handler. This is not supposed to be possible, so check the logic.", + ); + } + + return new NativeDate(ClockDate.clock.now).toString(); + }, + }); + + return ClockDateProxy; + } + + /** + * Mirror Intl by default on our fake implementation + * + * Most of the properties are the original native ones, + * but we need to take control of those that have a + * dependency on the current clock. + * + * @returns {object} the partly fake Intl implementation + */ + function createIntl() { + const ClockIntl = {}; + /* + * All properties of Intl are non-enumerable, so we need + * to do a bit of work to get them out. + */ + Object.getOwnPropertyNames(NativeIntl).forEach( + (property) => (ClockIntl[property] = NativeIntl[property]), + ); + + ClockIntl.DateTimeFormat = function (...args) { + const realFormatter = new NativeIntl.DateTimeFormat(...args); + const formatter = {}; + + ["formatRange", "formatRangeToParts", "resolvedOptions"].forEach( + (method) => { + formatter[method] = + realFormatter[method].bind(realFormatter); + }, + ); + + ["format", "formatToParts"].forEach((method) => { + formatter[method] = function (date) { + return realFormatter[method](date || ClockIntl.clock.now); + }; + }); + + return formatter; + }; + + ClockIntl.DateTimeFormat.prototype = Object.create( + NativeIntl.DateTimeFormat.prototype, + ); + + ClockIntl.DateTimeFormat.supportedLocalesOf = + NativeIntl.DateTimeFormat.supportedLocalesOf; + + return ClockIntl; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function enqueueJob(clock, job) { + // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob + if (!clock.jobs) { + clock.jobs = []; + } + clock.jobs.push(job); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function runJobs(clock) { + // runs all microtick-deferred tasks - ecma262/#sec-runjobs + if (!clock.jobs) { + return; + } + for (let i = 0; i < clock.jobs.length; i++) { + const job = clock.jobs[i]; + job.func.apply(null, job.args); + + checkIsNearInfiniteLimit(clock, i); + if (clock.loopLimit && i > clock.loopLimit) { + throw getInfiniteLoopError(clock, job); + } + } + resetIsNearInfiniteLimit(); + clock.jobs = []; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + * @returns {number} id of the created timer + */ + function addTimer(clock, timer) { + if (timer.func === undefined) { + throw new Error("Callback must be provided to timer calls"); + } + + if (addTimerReturnsObject) { + // Node.js environment + if (typeof timer.func !== "function") { + throw new TypeError( + `[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${ + timer.func + } of type ${typeof timer.func}`, + ); + } + } + + if (isNearInfiniteLimit) { + timer.error = new Error(); + } + + timer.type = timer.immediate ? "Immediate" : "Timeout"; + + if (timer.hasOwnProperty("delay")) { + if (typeof timer.delay !== "number") { + timer.delay = parseInt(timer.delay, 10); + } + + if (!isNumberFinite(timer.delay)) { + timer.delay = 0; + } + timer.delay = timer.delay > maxTimeout ? 1 : timer.delay; + timer.delay = Math.max(0, timer.delay); + } + + if (timer.hasOwnProperty("interval")) { + timer.type = "Interval"; + timer.interval = timer.interval > maxTimeout ? 1 : timer.interval; + } + + if (timer.hasOwnProperty("animation")) { + timer.type = "AnimationFrame"; + timer.animation = true; + } + + if (timer.hasOwnProperty("idleCallback")) { + timer.type = "IdleCallback"; + timer.idleCallback = true; + } + + if (!clock.timers) { + clock.timers = {}; + } + + timer.id = uniqueTimerId++; + timer.createdAt = clock.now; + timer.callAt = + clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + clock.timers[timer.id] = timer; + + if (addTimerReturnsObject) { + const res = { + refed: true, + ref: function () { + this.refed = true; + return res; + }, + unref: function () { + this.refed = false; + return res; + }, + hasRef: function () { + return this.refed; + }, + refresh: function () { + timer.callAt = + clock.now + + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + // it _might_ have been removed, but if not the assignment is perfectly fine + clock.timers[timer.id] = timer; + + return res; + }, + [Symbol.toPrimitive]: function () { + return timer.id; + }, + }; + return res; + } + + return timer.id; + } + + /* eslint consistent-return: "off" */ + /** + * Timer comparitor + * + * @param {Timer} a + * @param {Timer} b + * @returns {number} + */ + function compareTimers(a, b) { + // Sort first by absolute timing + if (a.callAt < b.callAt) { + return -1; + } + if (a.callAt > b.callAt) { + return 1; + } + + // Sort next by immediate, immediate timers take precedence + if (a.immediate && !b.immediate) { + return -1; + } + if (!a.immediate && b.immediate) { + return 1; + } + + // Sort next by creation time, earlier-created timers take precedence + if (a.createdAt < b.createdAt) { + return -1; + } + if (a.createdAt > b.createdAt) { + return 1; + } + + // Sort next by id, lower-id timers take precedence + if (a.id < b.id) { + return -1; + } + if (a.id > b.id) { + return 1; + } + + // As timer ids are unique, no fallback `0` is necessary + } + + /** + * @param {Clock} clock + * @param {number} from + * @param {number} to + * @returns {Timer} + */ + function firstTimerInRange(clock, from, to) { + const timers = clock.timers; + let timer = null; + let id, isInRange; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + isInRange = inRange(from, to, timers[id]); + + if ( + isInRange && + (!timer || compareTimers(timer, timers[id]) === 1) + ) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function firstTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === 1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function lastTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === -1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + */ + function callTimer(clock, timer) { + if (typeof timer.interval === "number") { + clock.timers[timer.id].callAt += timer.interval; + } else { + delete clock.timers[timer.id]; + } + + if (typeof timer.func === "function") { + timer.func.apply(null, timer.args); + } else { + /* eslint no-eval: "off" */ + const eval2 = eval; + (function () { + eval2(timer.func); + })(); + } + } + + /** + * Gets clear handler name for a given timer type + * + * @param {string} ttype + */ + function getClearHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `cancel${ttype}`; + } + return `clear${ttype}`; + } + + /** + * Gets schedule handler name for a given timer type + * + * @param {string} ttype + */ + function getScheduleHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `request${ttype}`; + } + return `set${ttype}`; + } + + /** + * Creates an anonymous function to warn only once + */ + function createWarnOnce() { + let calls = 0; + return function (msg) { + // eslint-disable-next-line + !calls++ && console.warn(msg); + }; + } + const warnOnce = createWarnOnce(); + + /** + * @param {Clock} clock + * @param {number} timerId + * @param {string} ttype + */ + function clearTimer(clock, timerId, ttype) { + if (!timerId) { + // null appears to be allowed in most browsers, and appears to be + // relied upon by some libraries, like Bootstrap carousel + return; + } + + if (!clock.timers) { + clock.timers = {}; + } + + // in Node, the ID is stored as the primitive value for `Timeout` objects + // for `Immediate` objects, no ID exists, so it gets coerced to NaN + const id = Number(timerId); + + if (Number.isNaN(id) || id < idCounterStart) { + const handlerName = getClearHandler(ttype); + + if (clock.shouldClearNativeTimers === true) { + const nativeHandler = clock[`_${handlerName}`]; + return typeof nativeHandler === "function" + ? nativeHandler(timerId) + : undefined; + } + warnOnce( + `FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.` + + "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`.", + ); + } + + if (clock.timers.hasOwnProperty(id)) { + // check that the ID matches a timer of the correct type + const timer = clock.timers[id]; + if ( + timer.type === ttype || + (timer.type === "Timeout" && ttype === "Interval") || + (timer.type === "Interval" && ttype === "Timeout") + ) { + delete clock.timers[id]; + } else { + const clear = getClearHandler(ttype); + const schedule = getScheduleHandler(timer.type); + throw new Error( + `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`, + ); + } + } + } + + /** + * @param {Clock} clock + * @param {Config} config + * @returns {Timer[]} + */ + function uninstall(clock, config) { + let method, i, l; + const installedHrTime = "_hrtime"; + const installedNextTick = "_nextTick"; + + for (i = 0, l = clock.methods.length; i < l; i++) { + method = clock.methods[i]; + if (method === "hrtime" && _global.process) { + _global.process.hrtime = clock[installedHrTime]; + } else if (method === "nextTick" && _global.process) { + _global.process.nextTick = clock[installedNextTick]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + clock, + `_${method}`, + ); + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + _global, + method, + originalPerfDescriptor, + ); + } else if (originalPerfDescriptor.configurable) { + _global[method] = clock[`_${method}`]; + } + } else { + if (_global[method] && _global[method].hadOwnProperty) { + _global[method] = clock[`_${method}`]; + } else { + try { + delete _global[method]; + } catch (ignore) { + /* eslint no-empty: "off" */ + } + } + } + if (clock.timersModuleMethods !== undefined) { + for (let j = 0; j < clock.timersModuleMethods.length; j++) { + const entry = clock.timersModuleMethods[j]; + timersModule[entry.methodName] = entry.original; + } + } + if (clock.timersPromisesModuleMethods !== undefined) { + for ( + let j = 0; + j < clock.timersPromisesModuleMethods.length; + j++ + ) { + const entry = clock.timersPromisesModuleMethods[j]; + timersPromisesModule[entry.methodName] = entry.original; + } + } + } + + if (config.shouldAdvanceTime === true) { + _global.clearInterval(clock.attachedInterval); + } + + // Prevent multiple executions which will completely remove these props + clock.methods = []; + + for (const [listener, signal] of clock.abortListenerMap.entries()) { + signal.removeEventListener("abort", listener); + clock.abortListenerMap.delete(listener); + } + + // return pending timers, to enable checking what timers remained on uninstall + if (!clock.timers) { + return []; + } + return Object.keys(clock.timers).map(function mapper(key) { + return clock.timers[key]; + }); + } + + /** + * @param {object} target the target containing the method to replace + * @param {string} method the keyname of the method on the target + * @param {Clock} clock + */ + function hijackMethod(target, method, clock) { + clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call( + target, + method, + ); + clock[`_${method}`] = target[method]; + + if (method === "Date") { + target[method] = clock[method]; + } else if (method === "Intl") { + target[method] = clock[method]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + target, + method, + ); + // JSDOM has a read only performance field so we have to save/copy it differently + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + clock, + `_${method}`, + originalPerfDescriptor, + ); + + const perfDescriptor = Object.getOwnPropertyDescriptor( + clock, + method, + ); + Object.defineProperty(target, method, perfDescriptor); + } else { + target[method] = clock[method]; + } + } else { + target[method] = function () { + return clock[method].apply(clock, arguments); + }; + + Object.defineProperties( + target[method], + Object.getOwnPropertyDescriptors(clock[method]), + ); + } + + target[method].clock = clock; + } + + /** + * @param {Clock} clock + * @param {number} advanceTimeDelta + */ + function doIntervalTick(clock, advanceTimeDelta) { + clock.tick(advanceTimeDelta); + } + + /** + * @typedef {object} Timers + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {Date} Date + * @property {Intl} Intl + * @property {SetImmediate=} setImmediate + * @property {function(NodeImmediate): void=} clearImmediate + * @property {function(number[]):number[]=} hrtime + * @property {NextTick=} nextTick + * @property {Performance=} performance + * @property {RequestAnimationFrame=} requestAnimationFrame + * @property {boolean=} queueMicrotask + * @property {function(number): void=} cancelAnimationFrame + * @property {RequestIdleCallback=} requestIdleCallback + * @property {function(number): void=} cancelIdleCallback + */ + + /** @type {Timers} */ + const timers = { + setTimeout: _global.setTimeout, + clearTimeout: _global.clearTimeout, + setInterval: _global.setInterval, + clearInterval: _global.clearInterval, + Date: _global.Date, + }; + + if (isPresent.setImmediate) { + timers.setImmediate = _global.setImmediate; + } + + if (isPresent.clearImmediate) { + timers.clearImmediate = _global.clearImmediate; + } + + if (isPresent.hrtime) { + timers.hrtime = _global.process.hrtime; + } + + if (isPresent.nextTick) { + timers.nextTick = _global.process.nextTick; + } + + if (isPresent.performance) { + timers.performance = _global.performance; + } + + if (isPresent.requestAnimationFrame) { + timers.requestAnimationFrame = _global.requestAnimationFrame; + } + + if (isPresent.queueMicrotask) { + timers.queueMicrotask = _global.queueMicrotask; + } + + if (isPresent.cancelAnimationFrame) { + timers.cancelAnimationFrame = _global.cancelAnimationFrame; + } + + if (isPresent.requestIdleCallback) { + timers.requestIdleCallback = _global.requestIdleCallback; + } + + if (isPresent.cancelIdleCallback) { + timers.cancelIdleCallback = _global.cancelIdleCallback; + } + + if (isPresent.Intl) { + timers.Intl = _global.Intl; + } + + const originalSetTimeout = _global.setImmediate || _global.setTimeout; + + /** + * @param {Date|number} [start] the system time - non-integer values are floored + * @param {number} [loopLimit] maximum number of timers that will be run when calling runAll() + * @returns {Clock} + */ + function createClock(start, loopLimit) { + // eslint-disable-next-line no-param-reassign + start = Math.floor(getEpoch(start)); + // eslint-disable-next-line no-param-reassign + loopLimit = loopLimit || 1000; + let nanos = 0; + const adjustedSystemTime = [0, 0]; // [millis, nanoremainder] + + const clock = { + now: start, + Date: createDate(), + loopLimit: loopLimit, + }; + + clock.Date.clock = clock; + + //eslint-disable-next-line jsdoc/require-jsdoc + function getTimeToNextFrame() { + return 16 - ((clock.now - start) % 16); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function hrtime(prev) { + const millisSinceStart = clock.now - adjustedSystemTime[0] - start; + const secsSinceStart = Math.floor(millisSinceStart / 1000); + const remainderInNanos = + (millisSinceStart - secsSinceStart * 1e3) * 1e6 + + nanos - + adjustedSystemTime[1]; + + if (Array.isArray(prev)) { + if (prev[1] > 1e9) { + throw new TypeError( + "Number of nanoseconds can't exceed a billion", + ); + } + + const oldSecs = prev[0]; + let nanoDiff = remainderInNanos - prev[1]; + let secDiff = secsSinceStart - oldSecs; + + if (nanoDiff < 0) { + nanoDiff += 1e9; + secDiff -= 1; + } + + return [secDiff, nanoDiff]; + } + return [secsSinceStart, remainderInNanos]; + } + + /** + * A high resolution timestamp in milliseconds. + * + * @typedef {number} DOMHighResTimeStamp + */ + + /** + * performance.now() + * + * @returns {DOMHighResTimeStamp} + */ + function fakePerformanceNow() { + const hrt = hrtime(); + const millis = hrt[0] * 1000 + hrt[1] / 1e6; + return millis; + } + + if (isPresent.hrtimeBigint) { + hrtime.bigint = function () { + const parts = hrtime(); + return BigInt(parts[0]) * BigInt(1e9) + BigInt(parts[1]); // eslint-disable-line + }; + } + + if (isPresent.Intl) { + clock.Intl = createIntl(); + clock.Intl.clock = clock; + } + + clock.requestIdleCallback = function requestIdleCallback( + func, + timeout, + ) { + let timeToNextIdlePeriod = 0; + + if (clock.countTimers() > 0) { + timeToNextIdlePeriod = 50; // const for now + } + + const result = addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: + typeof timeout === "undefined" + ? timeToNextIdlePeriod + : Math.min(timeout, timeToNextIdlePeriod), + idleCallback: true, + }); + + return Number(result); + }; + + clock.cancelIdleCallback = function cancelIdleCallback(timerId) { + return clearTimer(clock, timerId, "IdleCallback"); + }; + + clock.setTimeout = function setTimeout(func, timeout) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + }); + }; + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setTimeout[utilPromisify.custom] = + function promisifiedSetTimeout(timeout, arg) { + return new _global.Promise(function setTimeoutExecutor( + resolve, + ) { + addTimer(clock, { + func: resolve, + args: [arg], + delay: timeout, + }); + }); + }; + } + + clock.clearTimeout = function clearTimeout(timerId) { + return clearTimer(clock, timerId, "Timeout"); + }; + + clock.nextTick = function nextTick(func) { + return enqueueJob(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + error: isNearInfiniteLimit ? new Error() : null, + }); + }; + + clock.queueMicrotask = function queueMicrotask(func) { + return clock.nextTick(func); // explicitly drop additional arguments + }; + + clock.setInterval = function setInterval(func, timeout) { + // eslint-disable-next-line no-param-reassign + timeout = parseInt(timeout, 10); + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + interval: timeout, + }); + }; + + clock.clearInterval = function clearInterval(timerId) { + return clearTimer(clock, timerId, "Interval"); + }; + + if (isPresent.setImmediate) { + clock.setImmediate = function setImmediate(func) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + immediate: true, + }); + }; + + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setImmediate[utilPromisify.custom] = + function promisifiedSetImmediate(arg) { + return new _global.Promise( + function setImmediateExecutor(resolve) { + addTimer(clock, { + func: resolve, + args: [arg], + immediate: true, + }); + }, + ); + }; + } + + clock.clearImmediate = function clearImmediate(timerId) { + return clearTimer(clock, timerId, "Immediate"); + }; + } + + clock.countTimers = function countTimers() { + return ( + Object.keys(clock.timers || {}).length + + (clock.jobs || []).length + ); + }; + + clock.requestAnimationFrame = function requestAnimationFrame(func) { + const result = addTimer(clock, { + func: func, + delay: getTimeToNextFrame(), + get args() { + return [fakePerformanceNow()]; + }, + animation: true, + }); + + return Number(result); + }; + + clock.cancelAnimationFrame = function cancelAnimationFrame(timerId) { + return clearTimer(clock, timerId, "AnimationFrame"); + }; + + clock.runMicrotasks = function runMicrotasks() { + runJobs(clock); + }; + + /** + * @param {number|string} tickValue milliseconds or a string parseable by parseTime + * @param {boolean} isAsync + * @param {Function} resolve + * @param {Function} reject + * @returns {number|undefined} will return the new `now` value or nothing for async + */ + function doTick(tickValue, isAsync, resolve, reject) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + const remainder = nanoRemainder(msFloat); + let nanosTotal = nanos + remainder; + let tickTo = clock.now + ms; + + if (msFloat < 0) { + throw new TypeError("Negative ticks are not supported"); + } + + // adjust for positive overflow + if (nanosTotal >= 1e6) { + tickTo += 1; + nanosTotal -= 1e6; + } + + nanos = nanosTotal; + let tickFrom = clock.now; + let previous = clock.now; + // ESLint fails to detect this correctly + /* eslint-disable prefer-const */ + let timer, + firstException, + oldNow, + nextPromiseTick, + compensationCheck, + postTimerCall; + /* eslint-enable prefer-const */ + + clock.duringTick = true; + + // perform microtasks + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during microtask callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function doTickInner() { + // perform each timer in the requested range + timer = firstTimerInRange(clock, tickFrom, tickTo); + // eslint-disable-next-line no-unmodified-loop-condition + while (timer && tickFrom <= tickTo) { + if (clock.timers[timer.id]) { + tickFrom = timer.callAt; + clock.now = timer.callAt; + oldNow = clock.now; + try { + runJobs(clock); + callTimer(clock, timer); + } catch (e) { + firstException = firstException || e; + } + + if (isAsync) { + // finish up after native setImmediate callback to allow + // all native es6 promises to process their callbacks after + // each timer fires. + originalSetTimeout(nextPromiseTick); + return; + } + + compensationCheck(); + } + + postTimerCall(); + } + + // perform process.nextTick()s again + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during process.nextTick() callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + clock.duringTick = false; + + // corner case: during runJobs new timers were scheduled which could be in the range [clock.now, tickTo] + timer = firstTimerInRange(clock, tickFrom, tickTo); + if (timer) { + try { + clock.tick(tickTo - clock.now); // do it all again - for the remainder of the requested range + } catch (e) { + firstException = firstException || e; + } + } else { + // no timers remaining in the requested range: move the clock all the way to the end + clock.now = tickTo; + + // update nanos + nanos = nanosTotal; + } + if (firstException) { + throw firstException; + } + + if (isAsync) { + resolve(clock.now); + } else { + return clock.now; + } + } + + nextPromiseTick = + isAsync && + function () { + try { + compensationCheck(); + postTimerCall(); + doTickInner(); + } catch (e) { + reject(e); + } + }; + + compensationCheck = function () { + // compensate for any setSystemTime() call during timer callback + if (oldNow !== clock.now) { + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + previous += clock.now - oldNow; + } + }; + + postTimerCall = function () { + timer = firstTimerInRange(clock, previous, tickTo); + previous = tickFrom; + }; + + return doTickInner(); + } + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.tick = function tick(tickValue) { + return doTick(tickValue, false); + }; + + if (typeof _global.Promise !== "undefined") { + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {Promise} + */ + clock.tickAsync = function tickAsync(tickValue) { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + doTick(tickValue, true, resolve, reject); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.next = function next() { + runJobs(clock); + const timer = firstTimer(clock); + if (!timer) { + return clock.now; + } + + clock.duringTick = true; + try { + clock.now = timer.callAt; + callTimer(clock, timer); + runJobs(clock); + return clock.now; + } finally { + clock.duringTick = false; + } + }; + + if (typeof _global.Promise !== "undefined") { + clock.nextAsync = function nextAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = firstTimer(clock); + if (!timer) { + resolve(clock.now); + return; + } + + let err; + clock.duringTick = true; + clock.now = timer.callAt; + try { + callTimer(clock, timer); + } catch (e) { + err = e; + } + clock.duringTick = false; + + originalSetTimeout(function () { + if (err) { + reject(err); + } else { + resolve(clock.now); + } + }); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.runAll = function runAll() { + let numTimers, i; + runJobs(clock); + for (i = 0; i < clock.loopLimit; i++) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + numTimers = Object.keys(clock.timers).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + clock.next(); + checkIsNearInfiniteLimit(clock, i); + } + + const excessJob = firstTimer(clock); + throw getInfiniteLoopError(clock, excessJob); + }; + + clock.runToFrame = function runToFrame() { + return clock.tick(getTimeToNextFrame()); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runAllAsync = function runAllAsync() { + return new _global.Promise(function (resolve, reject) { + let i = 0; + /** + * + */ + function doRun() { + originalSetTimeout(function () { + try { + runJobs(clock); + + let numTimers; + if (i < clock.loopLimit) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + numTimers = Object.keys( + clock.timers, + ).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + clock.next(); + + i++; + + doRun(); + checkIsNearInfiniteLimit(clock, i); + return; + } + + const excessJob = firstTimer(clock); + reject(getInfiniteLoopError(clock, excessJob)); + } catch (e) { + reject(e); + } + }); + } + doRun(); + }); + }; + } + + clock.runToLast = function runToLast() { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + return clock.now; + } + + return clock.tick(timer.callAt - clock.now); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runToLastAsync = function runToLastAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + resolve(clock.now); + } + + resolve(clock.tickAsync(timer.callAt - clock.now)); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.reset = function reset() { + nanos = 0; + clock.timers = {}; + clock.jobs = []; + clock.now = start; + }; + + clock.setSystemTime = function setSystemTime(systemTime) { + // determine time difference + const newNow = getEpoch(systemTime); + const difference = newNow - clock.now; + let id, timer; + + adjustedSystemTime[0] = adjustedSystemTime[0] + difference; + adjustedSystemTime[1] = adjustedSystemTime[1] + nanos; + // update 'system clock' + clock.now = newNow; + nanos = 0; + + // update timers and intervals to keep them stable + for (id in clock.timers) { + if (clock.timers.hasOwnProperty(id)) { + timer = clock.timers[id]; + timer.createdAt += difference; + timer.callAt += difference; + } + } + }; + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.jump = function jump(tickValue) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + + for (const timer of Object.values(clock.timers)) { + if (clock.now + ms > timer.callAt) { + timer.callAt = clock.now + ms; + } + } + clock.tick(ms); + }; + + if (isPresent.performance) { + clock.performance = Object.create(null); + clock.performance.now = fakePerformanceNow; + } + + if (isPresent.hrtime) { + clock.hrtime = hrtime; + } + + return clock; + } + + /* eslint-disable complexity */ + + /** + * @param {Config=} [config] Optional config + * @returns {Clock} + */ + function install(config) { + if ( + arguments.length > 1 || + config instanceof Date || + Array.isArray(config) || + typeof config === "number" + ) { + throw new TypeError( + `FakeTimers.install called with ${String( + config, + )} install requires an object parameter`, + ); + } + + if (_global.Date.isFake === true) { + // Timers are already faked; this is a problem. + // Make the user reset timers before continuing. + throw new TypeError( + "Can't install fake timers twice on the same global object.", + ); + } + + // eslint-disable-next-line no-param-reassign + config = typeof config !== "undefined" ? config : {}; + config.shouldAdvanceTime = config.shouldAdvanceTime || false; + config.advanceTimeDelta = config.advanceTimeDelta || 20; + config.shouldClearNativeTimers = + config.shouldClearNativeTimers || false; + + if (config.target) { + throw new TypeError( + "config.target is no longer supported. Use `withGlobal(target)` instead.", + ); + } + + /** + * @param {string} timer/object the name of the thing that is not present + * @param timer + */ + function handleMissingTimer(timer) { + if (config.ignoreMissingTimers) { + return; + } + + throw new ReferenceError( + `non-existent timers and/or objects cannot be faked: '${timer}'`, + ); + } + + let i, l; + const clock = createClock(config.now, config.loopLimit); + clock.shouldClearNativeTimers = config.shouldClearNativeTimers; + + clock.uninstall = function () { + return uninstall(clock, config); + }; + + clock.abortListenerMap = new Map(); + + clock.methods = config.toFake || []; + + if (clock.methods.length === 0) { + clock.methods = Object.keys(timers); + } + + if (config.shouldAdvanceTime === true) { + const intervalTick = doIntervalTick.bind( + null, + clock, + config.advanceTimeDelta, + ); + const intervalId = _global.setInterval( + intervalTick, + config.advanceTimeDelta, + ); + clock.attachedInterval = intervalId; + } + + if (clock.methods.includes("performance")) { + const proto = (() => { + if (hasPerformanceConstructorPrototype) { + return _global.performance.constructor.prototype; + } + if (hasPerformancePrototype) { + return _global.Performance.prototype; + } + })(); + if (proto) { + Object.getOwnPropertyNames(proto).forEach(function (name) { + if (name !== "now") { + clock.performance[name] = + name.indexOf("getEntries") === 0 + ? NOOP_ARRAY + : NOOP; + } + }); + // ensure `mark` returns a value that is valid + clock.performance.mark = (name) => + new FakePerformanceEntry(name, "mark", 0, 0); + clock.performance.measure = (name) => + new FakePerformanceEntry(name, "measure", 0, 100); + } else if ((config.toFake || []).includes("performance")) { + return handleMissingTimer("performance"); + } + } + if (_global === globalObject && timersModule) { + clock.timersModuleMethods = []; + } + if (_global === globalObject && timersPromisesModule) { + clock.timersPromisesModuleMethods = []; + } + for (i = 0, l = clock.methods.length; i < l; i++) { + const nameOfMethodToReplace = clock.methods[i]; + + if (!isPresent[nameOfMethodToReplace]) { + handleMissingTimer(nameOfMethodToReplace); + // eslint-disable-next-line + continue; + } + + if (nameOfMethodToReplace === "hrtime") { + if ( + _global.process && + typeof _global.process.hrtime === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else if (nameOfMethodToReplace === "nextTick") { + if ( + _global.process && + typeof _global.process.nextTick === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else { + hijackMethod(_global, nameOfMethodToReplace, clock); + } + if ( + clock.timersModuleMethods !== undefined && + timersModule[nameOfMethodToReplace] + ) { + const original = timersModule[nameOfMethodToReplace]; + clock.timersModuleMethods.push({ + methodName: nameOfMethodToReplace, + original: original, + }); + timersModule[nameOfMethodToReplace] = + _global[nameOfMethodToReplace]; + } + if (clock.timersPromisesModuleMethods !== undefined) { + if (nameOfMethodToReplace === "setTimeout") { + clock.timersPromisesModuleMethods.push({ + methodName: "setTimeout", + original: timersPromisesModule.setTimeout, + }); + + timersPromisesModule.setTimeout = ( + delay, + value, + options = {}, + ) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearTimeout(handle); + reject(options.signal.reason); + }; + + const handle = clock.setTimeout(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }, delay); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setImmediate") { + clock.timersPromisesModuleMethods.push({ + methodName: "setImmediate", + original: timersPromisesModule.setImmediate, + }); + + timersPromisesModule.setImmediate = (value, options = {}) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearImmediate(handle); + reject(options.signal.reason); + }; + + const handle = clock.setImmediate(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setInterval") { + clock.timersPromisesModuleMethods.push({ + methodName: "setInterval", + original: timersPromisesModule.setInterval, + }); + + timersPromisesModule.setInterval = ( + delay, + value, + options = {}, + ) => ({ + [Symbol.asyncIterator]: () => { + const createResolvable = () => { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + promise.resolve = resolve; + promise.reject = reject; + return promise; + }; + + let done = false; + let hasThrown = false; + let returnCall; + let nextAvailable = 0; + const nextQueue = []; + + const handle = clock.setInterval(() => { + if (nextQueue.length > 0) { + nextQueue.shift().resolve(); + } else { + nextAvailable++; + } + }, delay); + + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + clock.clearInterval(handle); + done = true; + for (const resolvable of nextQueue) { + resolvable.resolve(); + } + }; + + if (options.signal) { + if (options.signal.aborted) { + done = true; + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + + return { + next: async () => { + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + if (nextAvailable > 0) { + nextAvailable--; + return { done: false, value: value }; + } + + const resolvable = createResolvable(); + nextQueue.push(resolvable); + + await resolvable; + + if (returnCall && nextQueue.length === 0) { + returnCall.resolve(); + } + + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + return { done: false, value: value }; + }, + return: async () => { + if (done) { + return { done: true, value: undefined }; + } + + if (nextQueue.length > 0) { + returnCall = createResolvable(); + await returnCall; + } + + clock.clearInterval(handle); + done = true; + + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + return { done: true, value: undefined }; + }, + }; + }, + }); + } + } + } + + return clock; + } + + /* eslint-enable complexity */ + + return { + timers: timers, + createClock: createClock, + install: install, + withGlobal: withGlobal, + }; +} + +/** + * @typedef {object} FakeTimers + * @property {Timers} timers + * @property {createClock} createClock + * @property {Function} install + * @property {withGlobal} withGlobal + */ + +/* eslint-enable complexity */ + +/** @type {FakeTimers} */ +const defaultImplementation = withGlobal(globalObject); + +exports.timers = defaultImplementation.timers; +exports.createClock = defaultImplementation.createClock; +exports.install = defaultImplementation.install; +exports.withGlobal = withGlobal; diff --git a/node_modules/@sinonjs/samsam/LICENSE b/node_modules/@sinonjs/samsam/LICENSE new file mode 100644 index 0000000..f00310b --- /dev/null +++ b/node_modules/@sinonjs/samsam/LICENSE @@ -0,0 +1,27 @@ +(The BSD License) + +Copyright (c) 2010-2012, Christian Johansen, christian@cjohansen.no and +August Lilleaas, august.lilleaas@gmail.com. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Christian Johansen nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/@sinonjs/samsam/README.md b/node_modules/@sinonjs/samsam/README.md new file mode 100644 index 0000000..1015995 --- /dev/null +++ b/node_modules/@sinonjs/samsam/README.md @@ -0,0 +1,83 @@ +# samsam + +[![CircleCI](https://circleci.com/gh/sinonjs/samsam.svg?style=svg)](https://circleci.com/gh/sinonjs/samsam) +[![Coverage status](https://codecov.io/gh/sinonjs/samsam/branch/main/graph/badge.svg)](https://codecov.io/gh/sinonjs/samsam) +Contributor Covenant + +Value identification and comparison functions + +Documentation: http://sinonjs.github.io/samsam/ + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/sinon#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/sinon#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Licence + +samsam was released under [BSD-3](LICENSE) diff --git a/node_modules/@sinonjs/samsam/docs/index.md b/node_modules/@sinonjs/samsam/docs/index.md new file mode 100644 index 0000000..da09d22 --- /dev/null +++ b/node_modules/@sinonjs/samsam/docs/index.md @@ -0,0 +1,390 @@ +# samsam + +> Same same, but different + +`samsam` is a collection of predicate and comparison functions useful for +identifiying the type of values and to compare values with varying degrees of +strictness. + +`samsam` is a general-purpose library. It works in browsers and Node. It will +define itself as an AMD module if you want it to (i.e. if there's a `define` +function available). + +## Predicate functions + +### `isArguments(value)` + +Returns `true` if `value` is an `arguments` object, `false` otherwise. + +### `isNegZero(value)` + +Returns `true` if `value` is `-0`. + +### `isElement(value)` + +Returns `true` if `value` is a DOM element node. Unlike +Underscore.js/lodash, this function will return `false` if `value` is an +_element-like_ object, i.e. a regular object with a `nodeType` property that +holds the value `1`. + +### `isSet(value)` + +Returns `true` if `value` is a [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set). + +## Comparison functions + +### `identical(x, y)` + +Strict equality check according to EcmaScript Harmony's `egal`. + +**From the Harmony wiki:** + +> An egal function simply makes available the internal `SameValue` function +> from section 9.12 of the ES5 spec. If two values are egal, then they are not +> observably distinguishable. + +`identical` returns `true` when `===` is `true`, except for `-0` and +`+0`, where it returns `false`. Additionally, it returns `true` when +`NaN` is compared to itself. + +### `deepEqual(actual, expectation)` + +Deep equal comparison. Two values are "deep equal" if: + +- They are identical +- They are both date objects representing the same time +- They are both arrays containing elements that are all deepEqual +- They are objects with the same set of properties, and each property + in `actual` is deepEqual to the corresponding property in `expectation` + + - `actual` can have [symbolic properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that are missing from `expectation` + +### Matcher + +Match values and objects by type or or other fuzzy criteria. `samsam` ships +with these built in matchers: + +#### `sinon.match.any` + +Matches anything. + +#### `sinon.match.defined` + +Requires the value to be defined. + +#### `sinon.match.truthy` + +Requires the value to be truthy. + +#### `sinon.match.falsy` + +Requires the value to be falsy. + +#### `sinon.match.bool` + +Requires the value to be a `Boolean` + +#### `sinon.match.number` + +Requires the value to be a `Number`. + +#### `sinon.match.string` + +Requires the value to be a `String`. + +#### `sinon.match.object` + +Requires the value to be an `Object`. + +#### `sinon.match.func` + +Requires the value to be a `Function`. + +#### `sinon.match.array` + +Requires the value to be an `Array`. + +#### `sinon.match.array.deepEquals(arr)` + +Requires an `Array` to be deep equal another one. + +#### `sinon.match.array.startsWith(arr)` + +Requires an `Array` to start with the same values as another one. + +#### `sinon.match.array.endsWith(arr)` + +Requires an `Array` to end with the same values as another one. + +#### `sinon.match.array.contains(arr)` + +Requires an `Array` to contain each one of the values the given array has. + +#### `sinon.match.map` + +Requires the value to be a `Map`. + +#### `sinon.match.map.deepEquals(map)` + +Requires a `Map` to be deep equal another one. + +#### `sinon.match.map.contains(map)` + +Requires a `Map` to contain each one of the items the given map has. + +#### `sinon.match.set` + +Requires the value to be a `Set`. + +#### `sinon.match.set.deepEquals(set)` + +Requires a `Set` to be deep equal another one. + +#### `sinon.match.set.contains(set)` + +Requires a `Set` to contain each one of the items the given set has. + +#### `sinon.match.regexp` + +Requires the value to be a regular expression. + +#### `sinon.match.date` + +Requires the value to be a `Date` object. + +#### `sinon.match.symbol` + +Requires the value to be a `Symbol`. + +#### `sinon.match.in(array)` + +Requires the value to be in the `array`. + +#### `sinon.match.same(ref)` + +Requires the value to strictly equal `ref`. + +#### `sinon.match.typeOf(type)` + +Requires the value to be of the given type, where `type` can be one of +`"undefined"`, +`"null"`, +`"boolean"`, +`"number"`, +`"string"`, +`"object"`, +`"function"`, +`"array"`, +`"regexp"`, +`"date"` or +`"symbol"`. + +#### `sinon.match.instanceOf(type)` + +Requires the value to be an instance of the given `type`. + +#### `sinon.match.has(property[, expectation])` + +Requires the value to define the given `property`. + +The property might be inherited via the prototype chain. If the optional expectation is given, the value of the property is deeply compared with the expectation. The expectation can be another matcher. + +#### `sinon.match.hasOwn(property[, expectation])` + +Same as `sinon.match.has` but the property must be defined by the value itself. Inherited properties are ignored. + +#### `sinon.match.hasNested(propertyPath[, expectation])` + +Requires the value to define the given `propertyPath`. Dot (`prop.prop`) and bracket (`prop[0]`) notations are supported as in [Lodash.get](https://lodash.com/docs/4.4.2#get). + +The propertyPath might be inherited via the prototype chain. If the optional expectation is given, the value at the propertyPath is deeply compared with the expectation. The expectation can be another matcher. + +```javascript +sinon.match.hasNested("a[0].b.c"); + +// Where actual is something like +var actual = { a: [{ b: { c: 3 } }] }; + +sinon.match.hasNested("a.b.c"); + +// Where actual is something like +var actual = { a: { b: { c: 3 } } }; +``` + +#### `sinon.match.every(matcher)` + +Requires **every** element of an `Array`, `Set` or `Map`, or alternatively **every** value of an `Object` to match the given `matcher`. + +#### `sinon.match.some(matcher)` + +Requires **any** element of an `Array`, `Set` or `Map`, or alternatively **any** value of an `Object` to match the given `matcher`. + +## Combining matchers + +All matchers implement `and` and `or`. This allows to logically combine mutliple matchers. The result is a new matchers that requires both (and) or one of the matchers (or) to return `true`. + +```javascript +var stringOrNumber = sinon.match.string.or(sinon.match.number); +var bookWithPages = sinon.match.instanceOf(Book).and(sinon.match.has("pages")); +``` + +### `match(object, matcher)` + +Creates a custom matcher to perform partial equality check. Compares `object` +with matcher according a wide set of rules: + +#### String matcher + +In its simplest form, `match` performs a case insensitive substring match. +When the matcher is a string, `object` is converted to a string, and the +function returns `true` if the matcher is a case-insensitive substring of +`object` as a string. + +```javascript +samsam.match("Give me something", "Give"); //true +samsam.match("Give me something", "sumptn"); // false +samsam.match( + { + toString: function () { + return "yeah"; + }, + }, + "Yeah!", +); // true +``` + +The last example is not symmetric. When the matcher is a string, the `object` +is coerced to a string - in this case using `toString`. Changing the order of +the arguments would cause the matcher to be an object, in which case different +rules apply (see below). + +#### Boolean matcher + +Performs a strict (i.e. `===`) match with the object. So, only `true` +matches `true`, and only `false` matches `false`. + +#### Regular expression matcher + +When the matcher is a regular expression, the function will pass if +`object.test(matcher)` is `true`. `match` is written in a generic way, so +any object with a `test` method will be used as a matcher this way. + +```javascript +samsam.match("Give me something", /^[a-z\s]$/i); // true +samsam.match("Give me something", /[0-9]/); // false +samsam.match( + { + toString: function () { + return "yeah!"; + }, + }, + /yeah/, +); // true +samsam.match(234, /[a-z]/); // false +``` + +#### Number matcher + +When the matcher is a number, the assertion will pass if `object == matcher`. + +```javascript +samsam.match("123", 123); // true +samsam.match("Give me something", 425); // false +samsam.match( + { + toString: function () { + return "42"; + }, + }, + 42, +); // true +samsam.match(234, 1234); // false +``` + +#### Function matcher + +When the matcher is a function, it is called with `object` as its only +argument. `match` returns `true` if the function returns `true`. A strict +match is performed against the return value, so a boolean `true` is required, +truthy is not enough. + +```javascript +// true +samsam.match("123", function (exp) { + return exp == "123"; +}); + +// false +samsam.match("Give me something", function () { + return "ok"; +}); + +// true +samsam.match( + { + toString: function () { + return "42"; + }, + }, + function () { + return true; + }, +); + +// false +samsam.match(234, function () {}); +``` + +#### Object matcher + +As mentioned above, if an object matcher defines a `test` method, `match` +will return `true` if `matcher.test(object)` returns truthy. + +If the matcher does not have a test method, a recursive match is performed. If +all properties of `matcher` matches corresponding properties in `object`, +`match` returns `true`. Note that the object matcher does not care if the +number of properties in the two objects are the same - only if all properties in +the matcher recursively matches ones in `object`. If supported, this object matchers +include [symbolic properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +in the comparison. + +```javascript +// true +samsam.match("123", { + test: function (arg) { + return arg == 123; + }, +}); + +// false +samsam.match({}, { prop: 42 }); + +// true +samsam.match( + { + name: "Chris", + profession: "Programmer", + }, + { + name: "Chris", + }, +); + +// false +samsam.match(234, { name: "Chris" }); +``` + +#### DOM elements + +`match` can be very helpful when comparing DOM elements, because it allows +you to compare several properties with one call: + +```javascript +var el = document.getElementById("myEl"); + +samsam.match(el, { + tagName: "h2", + className: "item", + innerHTML: "Howdy", +}); +``` diff --git a/node_modules/@sinonjs/samsam/lib/array-types.js b/node_modules/@sinonjs/samsam/lib/array-types.js new file mode 100644 index 0000000..0cb471a --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/array-types.js @@ -0,0 +1,16 @@ +"use strict"; + +var ARRAY_TYPES = [ + Array, + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, +]; + +module.exports = ARRAY_TYPES; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher.js b/node_modules/@sinonjs/samsam/lib/create-matcher.js new file mode 100644 index 0000000..da78937 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher.js @@ -0,0 +1,413 @@ +"use strict"; + +var arrayProto = require("@sinonjs/commons").prototypes.array; +var deepEqual = require("./deep-equal").use(createMatcher); // eslint-disable-line no-use-before-define +var every = require("@sinonjs/commons").every; +var functionName = require("@sinonjs/commons").functionName; +var iterableToString = require("./iterable-to-string"); +var objectProto = require("@sinonjs/commons").prototypes.object; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var assertMatcher = require("./create-matcher/assert-matcher"); +var assertMethodExists = require("./create-matcher/assert-method-exists"); +var assertType = require("./create-matcher/assert-type"); +var isIterable = require("./create-matcher/is-iterable"); +var isMatcher = require("./create-matcher/is-matcher"); + +var matcherPrototype = require("./create-matcher/matcher-prototype"); + +var arrayIndexOf = arrayProto.indexOf; +var some = arrayProto.some; + +var hasOwnProperty = objectProto.hasOwnProperty; +var objectToString = objectProto.toString; + +var TYPE_MAP = require("./create-matcher/type-map")(createMatcher); // eslint-disable-line no-use-before-define + +/** + * Creates a matcher object for the passed expectation + * + * @alias module:samsam.createMatcher + * @param {*} expectation An expecttation + * @param {string} message A message for the expectation + * @returns {object} A matcher object + */ +function createMatcher(expectation, message) { + var m = Object.create(matcherPrototype); + var type = typeOf(expectation); + + if (message !== undefined && typeof message !== "string") { + throw new TypeError("Message should be a string"); + } + + if (arguments.length > 2) { + throw new TypeError( + `Expected 1 or 2 arguments, received ${arguments.length}`, + ); + } + + if (type in TYPE_MAP) { + TYPE_MAP[type](m, expectation, message); + } else { + m.test = function (actual) { + return deepEqual(actual, expectation); + }; + } + + if (!m.message) { + m.message = `match(${valueToString(expectation)})`; + } + + // ensure that nothing mutates the exported message value, ref https://github.com/sinonjs/sinon/issues/2502 + Object.defineProperty(m, "message", { + configurable: false, + writable: false, + value: m.message, + }); + + return m; +} + +createMatcher.isMatcher = isMatcher; + +createMatcher.any = createMatcher(function () { + return true; +}, "any"); + +createMatcher.defined = createMatcher(function (actual) { + return actual !== null && actual !== undefined; +}, "defined"); + +createMatcher.truthy = createMatcher(function (actual) { + return Boolean(actual); +}, "truthy"); + +createMatcher.falsy = createMatcher(function (actual) { + return !actual; +}, "falsy"); + +createMatcher.same = function (expectation) { + return createMatcher( + function (actual) { + return expectation === actual; + }, + `same(${valueToString(expectation)})`, + ); +}; + +createMatcher.in = function (arrayOfExpectations) { + if (typeOf(arrayOfExpectations) !== "array") { + throw new TypeError("array expected"); + } + + return createMatcher( + function (actual) { + return some(arrayOfExpectations, function (expectation) { + return expectation === actual; + }); + }, + `in(${valueToString(arrayOfExpectations)})`, + ); +}; + +createMatcher.typeOf = function (type) { + assertType(type, "string", "type"); + return createMatcher(function (actual) { + return typeOf(actual) === type; + }, `typeOf("${type}")`); +}; + +createMatcher.instanceOf = function (type) { + /* istanbul ignore if */ + if ( + typeof Symbol === "undefined" || + typeof Symbol.hasInstance === "undefined" + ) { + assertType(type, "function", "type"); + } else { + assertMethodExists( + type, + Symbol.hasInstance, + "type", + "[Symbol.hasInstance]", + ); + } + return createMatcher( + function (actual) { + return actual instanceof type; + }, + `instanceOf(${functionName(type) || objectToString(type)})`, + ); +}; + +/** + * Creates a property matcher + * + * @private + * @param {Function} propertyTest A function to test the property against a value + * @param {string} messagePrefix A prefix to use for messages generated by the matcher + * @returns {object} A matcher + */ +function createPropertyMatcher(propertyTest, messagePrefix) { + return function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `${messagePrefix}("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + if ( + actual === undefined || + actual === null || + !propertyTest(actual, property) + ) { + return false; + } + return onlyProperty || deepEqual(actual[property], value); + }, message); + }; +} + +createMatcher.has = createPropertyMatcher(function (actual, property) { + if (typeof actual === "object") { + return property in actual; + } + return actual[property] !== undefined; +}, "has"); + +createMatcher.hasOwn = createPropertyMatcher(function (actual, property) { + return hasOwnProperty(actual, property); +}, "hasOwn"); + +createMatcher.hasNested = function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `hasNested("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + const parts = property.split(/(?:\.|\[|\])+?/).filter(Boolean); + let current = actual; + for (const part of parts) { + current = current?.[part]; + if (current === undefined) { + return false; + } + } + return onlyProperty || deepEqual(current, value); + }, message); +}; + +var jsonParseResultTypes = { + null: true, + boolean: true, + number: true, + string: true, + object: true, + array: true, +}; +createMatcher.json = function (value) { + if (!jsonParseResultTypes[typeOf(value)]) { + throw new TypeError("Value cannot be the result of JSON.parse"); + } + var message = `json(${JSON.stringify(value, null, " ")})`; + return createMatcher(function (actual) { + var parsed; + try { + parsed = JSON.parse(actual); + } catch (e) { + return false; + } + return deepEqual(parsed, value); + }, message); +}; + +createMatcher.every = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return every(Object.keys(actual), function (key) { + return predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + every(actual, function (element) { + return predicate.test(element); + }) + ); + }, `every(${predicate.message})`); +}; + +createMatcher.some = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return !every(Object.keys(actual), function (key) { + return !predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + !every(actual, function (element) { + return !predicate.test(element); + }) + ); + }, `some(${predicate.message})`); +}; + +createMatcher.array = createMatcher.typeOf("array"); + +createMatcher.array.deepEquals = function (expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.length === expectation.length; + return ( + typeOf(actual) === "array" && + sameLength && + every(actual, function (element, index) { + var expected = expectation[index]; + return typeOf(expected) === "array" && + typeOf(element) === "array" + ? createMatcher.array.deepEquals(expected).test(element) + : deepEqual(expected, element); + }) + ); + }, + `deepEquals([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.startsWith = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[index] === expectedElement; + }) + ); + }, + `startsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.endsWith = function (expectation) { + return createMatcher( + function (actual) { + // This indicates the index in which we should start matching + var offset = actual.length - expectation.length; + + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[offset + index] === expectedElement; + }) + ); + }, + `endsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.contains = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement) { + return arrayIndexOf(actual, expectedElement) !== -1; + }) + ); + }, + `contains([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map = createMatcher.typeOf("map"); + +createMatcher.map.deepEquals = function mapDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "map" && + sameLength && + every(actual, function (element, key) { + return ( + expectation.has(key) && expectation.get(key) === element + ); + }) + ); + }, + `deepEquals(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map.contains = function mapContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "map" && + every(expectation, function (element, key) { + return actual.has(key) && actual.get(key) === element; + }) + ); + }, + `contains(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set = createMatcher.typeOf("set"); + +createMatcher.set.deepEquals = function setDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "set" && + sameLength && + every(actual, function (element) { + return expectation.has(element); + }) + ); + }, + `deepEquals(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set.contains = function setContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "set" && + every(expectation, function (element) { + return actual.has(element); + }) + ); + }, + `contains(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.bool = createMatcher.typeOf("boolean"); +createMatcher.number = createMatcher.typeOf("number"); +createMatcher.string = createMatcher.typeOf("string"); +createMatcher.object = createMatcher.typeOf("object"); +createMatcher.func = createMatcher.typeOf("function"); +createMatcher.regexp = createMatcher.typeOf("regexp"); +createMatcher.date = createMatcher.typeOf("date"); +createMatcher.symbol = createMatcher.typeOf("symbol"); + +module.exports = createMatcher; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/assert-matcher.js b/node_modules/@sinonjs/samsam/lib/create-matcher/assert-matcher.js new file mode 100644 index 0000000..a4abd48 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/assert-matcher.js @@ -0,0 +1,17 @@ +"use strict"; + +var isMatcher = require("./is-matcher"); + +/** + * Throws a TypeError when `value` is not a matcher + * + * @private + * @param {*} value The value to examine + */ +function assertMatcher(value) { + if (!isMatcher(value)) { + throw new TypeError("Matcher expected"); + } +} + +module.exports = assertMatcher; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/assert-method-exists.js b/node_modules/@sinonjs/samsam/lib/create-matcher/assert-method-exists.js new file mode 100644 index 0000000..5150cf9 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/assert-method-exists.js @@ -0,0 +1,19 @@ +"use strict"; + +/** + * Throws a TypeError when expected method doesn't exist + * + * @private + * @param {*} value A value to examine + * @param {string} method The name of the method to look for + * @param {name} name A name to use for the error message + * @param {string} methodPath The name of the method to use for error messages + * @throws {TypeError} When the method doesn't exist + */ +function assertMethodExists(value, method, name, methodPath) { + if (value[method] === null || value[method] === undefined) { + throw new TypeError(`Expected ${name} to have method ${methodPath}`); + } +} + +module.exports = assertMethodExists; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/assert-type.js b/node_modules/@sinonjs/samsam/lib/create-matcher/assert-type.js new file mode 100644 index 0000000..20b4d4c --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/assert-type.js @@ -0,0 +1,24 @@ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Ensures that value is of type + * + * @private + * @param {*} value A value to examine + * @param {string} type A basic JavaScript type to compare to, e.g. "object", "string" + * @param {string} name A string to use for the error message + * @throws {TypeError} If value is not of the expected type + * @returns {undefined} + */ +function assertType(value, type, name) { + var actual = typeOf(value); + if (actual !== type) { + throw new TypeError( + `Expected type of ${name} to be ${type}, but was ${actual}`, + ); + } +} + +module.exports = assertType; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/is-iterable.js b/node_modules/@sinonjs/samsam/lib/create-matcher/is-iterable.js new file mode 100644 index 0000000..d9180ae --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/is-iterable.js @@ -0,0 +1,16 @@ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Returns `true` for iterables + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` looks like an iterable + */ +function isIterable(value) { + return Boolean(value) && typeOf(value.forEach) === "function"; +} + +module.exports = isIterable; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/is-matcher.js b/node_modules/@sinonjs/samsam/lib/create-matcher/is-matcher.js new file mode 100644 index 0000000..60c487c --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/is-matcher.js @@ -0,0 +1,18 @@ +"use strict"; + +var isPrototypeOf = require("@sinonjs/commons").prototypes.object.isPrototypeOf; + +var matcherPrototype = require("./matcher-prototype"); + +/** + * Returns `true` when `object` is a matcher + * + * @private + * @param {*} object A value to examine + * @returns {boolean} Returns `true` when `object` is a matcher + */ +function isMatcher(object) { + return isPrototypeOf(matcherPrototype, object); +} + +module.exports = isMatcher; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/match-object.js b/node_modules/@sinonjs/samsam/lib/create-matcher/match-object.js new file mode 100644 index 0000000..b25391c --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/match-object.js @@ -0,0 +1,59 @@ +"use strict"; + +var every = require("@sinonjs/commons").prototypes.array.every; +var concat = require("@sinonjs/commons").prototypes.array.concat; +var typeOf = require("@sinonjs/commons").typeOf; + +var deepEqualFactory = require("../deep-equal").use; + +var identical = require("../identical"); +var isMatcher = require("./is-matcher"); + +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Matches `actual` with `expectation` + * + * @private + * @param {*} actual A value to examine + * @param {object} expectation An object with properties to match on + * @param {object} matcher A matcher to use for comparison + * @returns {boolean} Returns true when `actual` matches all properties in `expectation` + */ +function matchObject(actual, expectation, matcher) { + var deepEqual = deepEqualFactory(matcher); + if (actual === null || actual === undefined) { + return false; + } + + var expectedKeys = keys(expectation); + /* istanbul ignore else: cannot collect coverage for engine that doesn't support Symbol */ + if (typeOf(getOwnPropertySymbols) === "function") { + expectedKeys = concat(expectedKeys, getOwnPropertySymbols(expectation)); + } + + return every(expectedKeys, function (key) { + var exp = expectation[key]; + var act = actual[key]; + + if (isMatcher(exp)) { + if (!exp.test(act)) { + return false; + } + } else if (typeOf(exp) === "object") { + if (identical(exp, act)) { + return true; + } + if (!matchObject(act, exp, matcher)) { + return false; + } + } else if (!deepEqual(act, exp)) { + return false; + } + + return true; + }); +} + +module.exports = matchObject; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/matcher-prototype.js b/node_modules/@sinonjs/samsam/lib/create-matcher/matcher-prototype.js new file mode 100644 index 0000000..a3d024e --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/matcher-prototype.js @@ -0,0 +1,49 @@ +"use strict"; + +var matcherPrototype = { + toString: function () { + return this.message; + }, +}; + +matcherPrototype.or = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var or = Object.create(matcherPrototype); + or.test = function (actual) { + return m1.test(actual) || m2.test(actual); + }; + or.message = `${m1.message}.or(${m2.message})`; + return or; +}; + +matcherPrototype.and = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var and = Object.create(matcherPrototype); + and.test = function (actual) { + return m1.test(actual) && m2.test(actual); + }; + and.message = `${m1.message}.and(${m2.message})`; + return and; +}; + +module.exports = matcherPrototype; diff --git a/node_modules/@sinonjs/samsam/lib/create-matcher/type-map.js b/node_modules/@sinonjs/samsam/lib/create-matcher/type-map.js new file mode 100644 index 0000000..abd3626 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-matcher/type-map.js @@ -0,0 +1,62 @@ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var join = require("@sinonjs/commons").prototypes.array.join; +var map = require("@sinonjs/commons").prototypes.array.map; +var stringIndexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var matchObject = require("./match-object"); + +var createTypeMap = function (match) { + return { + function: function (m, expectation, message) { + m.test = expectation; + m.message = message || `match(${functionName(expectation)})`; + }, + number: function (m, expectation) { + m.test = function (actual) { + // we need type coercion here + return expectation == actual; // eslint-disable-line eqeqeq + }; + }, + object: function (m, expectation) { + var array = []; + + if (typeof expectation.test === "function") { + m.test = function (actual) { + return expectation.test(actual) === true; + }; + m.message = `match(${functionName(expectation.test)})`; + return m; + } + + array = map(Object.keys(expectation), function (key) { + return `${key}: ${valueToString(expectation[key])}`; + }); + + m.test = function (actual) { + return matchObject(actual, expectation, match); + }; + m.message = `match(${join(array, ", ")})`; + + return m; + }, + regexp: function (m, expectation) { + m.test = function (actual) { + return typeof actual === "string" && expectation.test(actual); + }; + }, + string: function (m, expectation) { + m.test = function (actual) { + return ( + typeof actual === "string" && + stringIndexOf(actual, expectation) !== -1 + ); + }; + m.message = `match("${expectation}")`; + }, + }; +}; + +module.exports = createTypeMap; diff --git a/node_modules/@sinonjs/samsam/lib/create-set.js b/node_modules/@sinonjs/samsam/lib/create-set.js new file mode 100644 index 0000000..e03f4c4 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/create-set.js @@ -0,0 +1,34 @@ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; +var forEach = require("@sinonjs/commons").prototypes.array.forEach; + +/** + * This helper makes it convenient to create Set instances from a + * collection, an overcomes the shortcoming that IE11 doesn't support + * collection arguments + * + * @private + * @param {Array} array An array to create a set from + * @returns {Set} A set (unique) containing the members from array + * + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set + */ +function createSet(array) { + if (arguments.length > 0 && !Array.isArray(array)) { + throw new TypeError( + "createSet can be called with either no arguments or an Array", + ); + } + + var items = typeOf(array) === "array" ? array : []; + var set = new Set(); + + forEach(items, function (item) { + set.add(item); + }); + + return set; +} + +module.exports = createSet; diff --git a/node_modules/@sinonjs/samsam/lib/deep-equal-benchmark.js b/node_modules/@sinonjs/samsam/lib/deep-equal-benchmark.js new file mode 100644 index 0000000..1f39b15 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/deep-equal-benchmark.js @@ -0,0 +1,74 @@ +"use strict"; + +var Benchmark = require("benchmark"); +var deepEqual = require("./deep-equal"); + +var suite = new Benchmark.Suite(); +var complex1 = { + "1e116061-59bf-433a-8ab0-017b67a51d26": + "a7fd22ab-e809-414f-ad55-9c97598395d8", + "3824e8b7-22f5-489c-9919-43b432e3af6b": + "548baefd-f43c-4dc9-9df5-f7c9c96223b0", + "123e5750-eb66-45e5-a770-310879203b33": + "89ff817d-65a2-4598-b190-21c128096e6a", + "1d66be95-8aaa-4167-9a47-e7ee19bb0735": + "64349492-56e8-4100-9552-a89fb4a9aef4", + "f5538565-dc92-4ee4-a762-1ba5fe0528f6": { + "53631f78-2f2a-448f-89c7-ed3585e8e6f0": + "2cce00ee-f5ee-43ef-878f-958597b23225", + "73e8298b-72fd-4969-afc1-d891b61e744f": + "4e57aa30-af51-4d78-887c-019755e5d117", + "85439907-5b0e-4a08-8cfa-902a68dc3cc0": + "9639add9-6897-4cf0-b3d3-2ebf9c214f01", + "d4ae9d87-bd6c-47e0-95a1-6f4eb4211549": + "41fd3dd2-43ce-47f2-b92e-462474d07a6f", + "f70345a2-0ea3-45a6-bafa-8c7a72379277": { + "1bce714b-cd0a-417d-9a0c-bf4b7d35c0c4": + "3b8b0dde-e2ed-4b34-ac8d-729ba3c9667e", + "13e05c60-97d1-43f0-a6ef-d5247f4dd11f": + "60f685a4-6558-4ade-9d4b-28281c3989db", + "925b2609-e7b7-42f5-82cf-2d995697cec5": + "79115261-8161-4a6c-9487-47847276a717", + "52d644ac-7b33-4b79-b5b3-5afe7fd4ec2c": [ + "3c2ae716-92f1-4a3d-b98f-50ea49f51c45", + "de76b822-71b3-4b5a-a041-4140378b70e2", + "0302a405-1d58-44fa-a0c6-dd07bb0ca26e", + new Date(), + new Error(), + new RegExp(), + // eslint-disable-next-line no-undef + new Map(), + new Set(), + // eslint-disable-next-line no-undef + new WeakMap(), + // eslint-disable-next-line no-undef + new WeakSet(), + ], + }, + }, +}; +var complex2 = Object.create(complex1); + +var cyclic1 = { + "4a092cd1-225e-4739-8331-d6564aafb702": + "d0cebbe0-23fb-4cc4-8fa0-ef11ceedf12e", +}; +cyclic1.cyclicRef = cyclic1; + +var cyclic2 = Object.create(cyclic1); + +// add tests +suite + .add("complex objects", function () { + return deepEqual(complex1, complex2); + }) + .add("cyclic references", function () { + return deepEqual(cyclic1, cyclic2); + }) + // add listeners + .on("cycle", function (event) { + // eslint-disable-next-line no-console + console.log(String(event.target)); + }) + // run async + .run({ async: true }); diff --git a/node_modules/@sinonjs/samsam/lib/deep-equal.js b/node_modules/@sinonjs/samsam/lib/deep-equal.js new file mode 100644 index 0000000..6d438bf --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/deep-equal.js @@ -0,0 +1,304 @@ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var className = require("@sinonjs/commons").className; +var typeOf = require("@sinonjs/commons").typeOf; +var arrayProto = require("@sinonjs/commons").prototypes.array; +var objectProto = require("@sinonjs/commons").prototypes.object; +var mapForEach = require("@sinonjs/commons").prototypes.map.forEach; + +var getClass = require("./get-class"); +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isArrayType = require("./is-array-type"); +var isDate = require("./is-date"); +var isElement = require("./is-element"); +var isIterable = require("./is-iterable"); +var isMap = require("./is-map"); +var isNaN = require("./is-nan"); +var isObject = require("./is-object"); +var isSet = require("./is-set"); +var isSubset = require("./is-subset"); + +var concat = arrayProto.concat; +var every = arrayProto.every; +var push = arrayProto.push; + +var getTime = Date.prototype.getTime; +var hasOwnProperty = objectProto.hasOwnProperty; +var indexOf = arrayProto.indexOf; +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Deep equal comparison. Two values are "deep equal" when: + * + * - They are equal, according to samsam.identical + * - They are both date objects representing the same time + * - They are both arrays containing elements that are all deepEqual + * - They are objects with the same set of properties, and each property + * in ``actual`` is deepEqual to the corresponding property in ``expectation`` + * + * Supports cyclic objects. + * + * @alias module:samsam.deepEqual + * @param {*} actual The object to examine + * @param {*} expectation The object actual is expected to be equal to + * @param {object} match A value to match on + * @returns {boolean} Returns true when actual and expectation are considered equal + */ +function deepEqualCyclic(actual, expectation, match) { + // used for cyclic comparison + // contain already visited objects + var actualObjects = []; + var expectationObjects = []; + // contain pathes (position in the object structure) + // of the already visited objects + // indexes same as in objects arrays + var actualPaths = []; + var expectationPaths = []; + // contains combinations of already compared objects + // in the manner: { "$1['ref']$2['ref']": true } + var compared = {}; + + // does the recursion for the deep equal check + // eslint-disable-next-line complexity + return (function deepEqual( + actualObj, + expectationObj, + actualPath, + expectationPath, + ) { + // If both are matchers they must be the same instance in order to be + // considered equal If we didn't do that we would end up running one + // matcher against the other + if (match && match.isMatcher(expectationObj)) { + if (match.isMatcher(actualObj)) { + return actualObj === expectationObj; + } + return expectationObj.test(actualObj); + } + + var actualType = typeof actualObj; + var expectationType = typeof expectationObj; + + if ( + actualObj === expectationObj || + isNaN(actualObj) || + isNaN(expectationObj) || + actualObj === null || + expectationObj === null || + actualObj === undefined || + expectationObj === undefined || + actualType !== "object" || + expectationType !== "object" + ) { + return identical(actualObj, expectationObj); + } + + // Elements are only equal if identical(expected, actual) + if (isElement(actualObj) || isElement(expectationObj)) { + return false; + } + + var isActualDate = isDate(actualObj); + var isExpectationDate = isDate(expectationObj); + if (isActualDate || isExpectationDate) { + if ( + !isActualDate || + !isExpectationDate || + getTime.call(actualObj) !== getTime.call(expectationObj) + ) { + return false; + } + } + + if (actualObj instanceof RegExp && expectationObj instanceof RegExp) { + if (valueToString(actualObj) !== valueToString(expectationObj)) { + return false; + } + } + + if (actualObj instanceof Promise && expectationObj instanceof Promise) { + return actualObj === expectationObj; + } + + if (actualObj instanceof Error && expectationObj instanceof Error) { + return actualObj === expectationObj; + } + + var actualClass = getClass(actualObj); + var expectationClass = getClass(expectationObj); + var actualKeys = keys(actualObj); + var expectationKeys = keys(expectationObj); + var actualName = className(actualObj); + var expectationName = className(expectationObj); + var expectationSymbols = + typeOf(getOwnPropertySymbols) === "function" + ? getOwnPropertySymbols(expectationObj) + : /* istanbul ignore next: cannot collect coverage for engine that doesn't support Symbol */ + []; + var expectationKeysAndSymbols = concat( + expectationKeys, + expectationSymbols, + ); + + if (isArguments(actualObj) || isArguments(expectationObj)) { + if (actualObj.length !== expectationObj.length) { + return false; + } + } else { + if ( + actualType !== expectationType || + actualClass !== expectationClass || + actualKeys.length !== expectationKeys.length || + (actualName && + expectationName && + actualName !== expectationName) + ) { + return false; + } + } + + if (isSet(actualObj) || isSet(expectationObj)) { + if ( + !isSet(actualObj) || + !isSet(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + return isSubset(actualObj, expectationObj, deepEqual); + } + + if (isMap(actualObj) || isMap(expectationObj)) { + if ( + !isMap(actualObj) || + !isMap(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + var mapsDeeplyEqual = true; + mapForEach(actualObj, function (value, key) { + mapsDeeplyEqual = + mapsDeeplyEqual && + deepEqualCyclic(value, expectationObj.get(key)); + }); + + return mapsDeeplyEqual; + } + + // jQuery objects have iteration protocols + // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + // But, they don't work well with the implementation concerning iterables below, + // so we will detect them and use jQuery's own equality function + /* istanbul ignore next -- this can only be tested in the `test-headless` script */ + if ( + actualObj.constructor && + actualObj.constructor.name === "jQuery" && + typeof actualObj.is === "function" + ) { + return actualObj.is(expectationObj); + } + + var isActualNonArrayIterable = + isIterable(actualObj) && + !isArrayType(actualObj) && + !isArguments(actualObj); + var isExpectationNonArrayIterable = + isIterable(expectationObj) && + !isArrayType(expectationObj) && + !isArguments(expectationObj); + if (isActualNonArrayIterable || isExpectationNonArrayIterable) { + var actualArray = Array.from(actualObj); + var expectationArray = Array.from(expectationObj); + if (actualArray.length !== expectationArray.length) { + return false; + } + + var arrayDeeplyEquals = true; + every(actualArray, function (key) { + arrayDeeplyEquals = + arrayDeeplyEquals && + deepEqualCyclic(actualArray[key], expectationArray[key]); + }); + + return arrayDeeplyEquals; + } + + return every(expectationKeysAndSymbols, function (key) { + if (!hasOwnProperty(actualObj, key)) { + return false; + } + + var actualValue = actualObj[key]; + var expectationValue = expectationObj[key]; + var actualObject = isObject(actualValue); + var expectationObject = isObject(expectationValue); + // determines, if the objects were already visited + // (it's faster to check for isObject first, than to + // get -1 from getIndex for non objects) + var actualIndex = actualObject + ? indexOf(actualObjects, actualValue) + : -1; + var expectationIndex = expectationObject + ? indexOf(expectationObjects, expectationValue) + : -1; + // determines the new paths of the objects + // - for non cyclic objects the current path will be extended + // by current property name + // - for cyclic objects the stored path is taken + var newActualPath = + actualIndex !== -1 + ? actualPaths[actualIndex] + : `${actualPath}[${JSON.stringify(key)}]`; + var newExpectationPath = + expectationIndex !== -1 + ? expectationPaths[expectationIndex] + : `${expectationPath}[${JSON.stringify(key)}]`; + var combinedPath = newActualPath + newExpectationPath; + + // stop recursion if current objects are already compared + if (compared[combinedPath]) { + return true; + } + + // remember the current objects and their paths + if (actualIndex === -1 && actualObject) { + push(actualObjects, actualValue); + push(actualPaths, newActualPath); + } + if (expectationIndex === -1 && expectationObject) { + push(expectationObjects, expectationValue); + push(expectationPaths, newExpectationPath); + } + + // remember that the current objects are already compared + if (actualObject && expectationObject) { + compared[combinedPath] = true; + } + + // End of cyclic logic + + // neither actualValue nor expectationValue is a cycle + // continue with next level + return deepEqual( + actualValue, + expectationValue, + newActualPath, + newExpectationPath, + ); + }); + })(actual, expectation, "$1", "$2"); +} + +deepEqualCyclic.use = function (match) { + return function deepEqual(a, b) { + return deepEqualCyclic(a, b, match); + }; +}; + +module.exports = deepEqualCyclic; diff --git a/node_modules/@sinonjs/samsam/lib/get-class.js b/node_modules/@sinonjs/samsam/lib/get-class.js new file mode 100644 index 0000000..5b1b58d --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/get-class.js @@ -0,0 +1,18 @@ +"use strict"; + +var toString = require("@sinonjs/commons").prototypes.object.toString; + +/** + * Returns the internal `Class` by calling `Object.prototype.toString` + * with the provided value as `this`. Return value is a `String`, naming the + * internal class, e.g. "Array" + * + * @private + * @param {*} value - Any value + * @returns {string} - A string representation of the `Class` of `value` + */ +function getClass(value) { + return toString(value).split(/[ \]]/)[1]; +} + +module.exports = getClass; diff --git a/node_modules/@sinonjs/samsam/lib/identical.js b/node_modules/@sinonjs/samsam/lib/identical.js new file mode 100644 index 0000000..e183f09 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/identical.js @@ -0,0 +1,31 @@ +"use strict"; + +var isNaN = require("./is-nan"); +var isNegZero = require("./is-neg-zero"); + +/** + * Strict equality check according to EcmaScript Harmony's `egal`. + * + * **From the Harmony wiki:** + * > An `egal` function simply makes available the internal `SameValue` function + * > from section 9.12 of the ES5 spec. If two values are egal, then they are not + * > observably distinguishable. + * + * `identical` returns `true` when `===` is `true`, except for `-0` and + * `+0`, where it returns `false`. Additionally, it returns `true` when + * `NaN` is compared to itself. + * + * @alias module:samsam.identical + * @param {*} obj1 The first value to compare + * @param {*} obj2 The second value to compare + * @returns {boolean} Returns `true` when the objects are *egal*, `false` otherwise + */ +function identical(obj1, obj2) { + if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) { + return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2); + } + + return false; +} + +module.exports = identical; diff --git a/node_modules/@sinonjs/samsam/lib/is-arguments.js b/node_modules/@sinonjs/samsam/lib/is-arguments.js new file mode 100644 index 0000000..dde8c42 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-arguments.js @@ -0,0 +1,16 @@ +"use strict"; + +var getClass = require("./get-class"); + +/** + * Returns `true` when `object` is an `arguments` object, `false` otherwise + * + * @alias module:samsam.isArguments + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an `arguments` object + */ +function isArguments(object) { + return getClass(object) === "Arguments"; +} + +module.exports = isArguments; diff --git a/node_modules/@sinonjs/samsam/lib/is-array-type.js b/node_modules/@sinonjs/samsam/lib/is-array-type.js new file mode 100644 index 0000000..4ddc495 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-array-type.js @@ -0,0 +1,20 @@ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var indexOf = require("@sinonjs/commons").prototypes.array.indexOf; +var map = require("@sinonjs/commons").prototypes.array.map; +var ARRAY_TYPES = require("./array-types"); +var type = require("type-detect"); + +/** + * Returns `true` when `object` is an array type, `false` otherwise + * + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an array type + * @private + */ +function isArrayType(object) { + return indexOf(map(ARRAY_TYPES, functionName), type(object)) !== -1; +} + +module.exports = isArrayType; diff --git a/node_modules/@sinonjs/samsam/lib/is-date.js b/node_modules/@sinonjs/samsam/lib/is-date.js new file mode 100644 index 0000000..053d2ce --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-date.js @@ -0,0 +1,14 @@ +"use strict"; + +/** + * Returns `true` when `value` is an instance of Date + * + * @private + * @param {Date} value The value to examine + * @returns {boolean} `true` when `value` is an instance of Date + */ +function isDate(value) { + return value instanceof Date; +} + +module.exports = isDate; diff --git a/node_modules/@sinonjs/samsam/lib/is-element.js b/node_modules/@sinonjs/samsam/lib/is-element.js new file mode 100644 index 0000000..6bd7cbd --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-element.js @@ -0,0 +1,29 @@ +"use strict"; + +var div = typeof document !== "undefined" && document.createElement("div"); + +/** + * Returns `true` when `object` is a DOM element node. + * + * Unlike Underscore.js/lodash, this function will return `false` if `object` + * is an *element-like* object, i.e. a regular object with a `nodeType` + * property that holds the value `1`. + * + * @alias module:samsam.isElement + * @param {object} object The object to examine + * @returns {boolean} Returns `true` for DOM element nodes + */ +function isElement(object) { + if (!object || object.nodeType !== 1 || !div) { + return false; + } + try { + object.appendChild(div); + object.removeChild(div); + } catch (e) { + return false; + } + return true; +} + +module.exports = isElement; diff --git a/node_modules/@sinonjs/samsam/lib/is-iterable.js b/node_modules/@sinonjs/samsam/lib/is-iterable.js new file mode 100644 index 0000000..0b47238 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-iterable.js @@ -0,0 +1,18 @@ +"use strict"; + +/** + * Returns `true` when the argument is an iterable, `false` otherwise + * + * @alias module:samsam.isIterable + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an iterable, `false` otherwise + */ +function isIterable(val) { + // checks for null and undefined + if (typeof val !== "object") { + return false; + } + return typeof val[Symbol.iterator] === "function"; +} + +module.exports = isIterable; diff --git a/node_modules/@sinonjs/samsam/lib/is-map.js b/node_modules/@sinonjs/samsam/lib/is-map.js new file mode 100644 index 0000000..fc1d5af --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-map.js @@ -0,0 +1,14 @@ +"use strict"; + +/** + * Returns `true` when `value` is a Map + * + * @param {*} value A value to examine + * @returns {boolean} `true` when `value` is an instance of `Map`, `false` otherwise + * @private + */ +function isMap(value) { + return typeof Map !== "undefined" && value instanceof Map; +} + +module.exports = isMap; diff --git a/node_modules/@sinonjs/samsam/lib/is-nan.js b/node_modules/@sinonjs/samsam/lib/is-nan.js new file mode 100644 index 0000000..7461141 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-nan.js @@ -0,0 +1,19 @@ +"use strict"; + +/** + * Compares a `value` to `NaN` + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `NaN` + */ +function isNaN(value) { + // Unlike global `isNaN`, this function avoids type coercion + // `typeof` check avoids IE host object issues, hat tip to + // lodash + + // eslint-disable-next-line no-self-compare + return typeof value === "number" && value !== value; +} + +module.exports = isNaN; diff --git a/node_modules/@sinonjs/samsam/lib/is-neg-zero.js b/node_modules/@sinonjs/samsam/lib/is-neg-zero.js new file mode 100644 index 0000000..847e515 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-neg-zero.js @@ -0,0 +1,14 @@ +"use strict"; + +/** + * Returns `true` when `value` is `-0` + * + * @alias module:samsam.isNegZero + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `-0` + */ +function isNegZero(value) { + return value === 0 && 1 / value === -Infinity; +} + +module.exports = isNegZero; diff --git a/node_modules/@sinonjs/samsam/lib/is-object.js b/node_modules/@sinonjs/samsam/lib/is-object.js new file mode 100644 index 0000000..ed8b643 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-object.js @@ -0,0 +1,31 @@ +"use strict"; + +/** + * Returns `true` when the value is a regular Object and not a specialized Object + * + * This helps speed up deepEqual cyclic checks + * + * The premise is that only Objects are stored in the visited array. + * So if this function returns false, we don't have to do the + * expensive operation of searching for the value in the the array of already + * visited objects + * + * @private + * @param {object} value The object to examine + * @returns {boolean} `true` when the object is a non-specialised object + */ +function isObject(value) { + return ( + typeof value === "object" && + value !== null && + // none of these are collection objects, so we can return false + !(value instanceof Boolean) && + !(value instanceof Date) && + !(value instanceof Error) && + !(value instanceof Number) && + !(value instanceof RegExp) && + !(value instanceof String) + ); +} + +module.exports = isObject; diff --git a/node_modules/@sinonjs/samsam/lib/is-set.js b/node_modules/@sinonjs/samsam/lib/is-set.js new file mode 100644 index 0000000..fa5a3ca --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-set.js @@ -0,0 +1,14 @@ +"use strict"; + +/** + * Returns `true` when the argument is an instance of Set, `false` otherwise + * + * @alias module:samsam.isSet + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an instance of Set, `false` otherwise + */ +function isSet(val) { + return (typeof Set !== "undefined" && val instanceof Set) || false; +} + +module.exports = isSet; diff --git a/node_modules/@sinonjs/samsam/lib/is-subset.js b/node_modules/@sinonjs/samsam/lib/is-subset.js new file mode 100644 index 0000000..63672c6 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/is-subset.js @@ -0,0 +1,30 @@ +"use strict"; + +var forEach = require("@sinonjs/commons").prototypes.set.forEach; + +/** + * Returns `true` when `s1` is a subset of `s2`, `false` otherwise + * + * @private + * @param {Array|Set} s1 The target value + * @param {Array|Set} s2 The containing value + * @param {Function} compare A comparison function, should return `true` when + * values are considered equal + * @returns {boolean} Returns `true` when `s1` is a subset of `s2`, `false`` otherwise + */ +function isSubset(s1, s2, compare) { + var allContained = true; + forEach(s1, function (v1) { + var includes = false; + forEach(s2, function (v2) { + if (compare(v2, v1)) { + includes = true; + } + }); + allContained = allContained && includes; + }); + + return allContained; +} + +module.exports = isSubset; diff --git a/node_modules/@sinonjs/samsam/lib/iterable-to-string.js b/node_modules/@sinonjs/samsam/lib/iterable-to-string.js new file mode 100644 index 0000000..0018268 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/iterable-to-string.js @@ -0,0 +1,71 @@ +"use strict"; + +var slice = require("@sinonjs/commons").prototypes.string.slice; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +/** + * Creates a string represenation of an iterable object + * + * @private + * @param {object} obj The iterable object to stringify + * @returns {string} A string representation + */ +function iterableToString(obj) { + if (typeOf(obj) === "map") { + return mapToString(obj); + } + + return genericIterableToString(obj); +} + +/** + * Creates a string representation of a Map + * + * @private + * @param {Map} map The map to stringify + * @returns {string} A string representation + */ +function mapToString(map) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + map.forEach(function (value, key) { + representation += `[${stringify(key)},${stringify(value)}],`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Create a string represenation for an iterable + * + * @private + * @param {object} iterable The iterable to stringify + * @returns {string} A string representation + */ +function genericIterableToString(iterable) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + iterable.forEach(function (value) { + representation += `${stringify(value)},`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Creates a string representation of the passed `item` + * + * @private + * @param {object} item The item to stringify + * @returns {string} A string representation of `item` + */ +function stringify(item) { + return typeof item === "string" ? `'${item}'` : valueToString(item); +} + +module.exports = iterableToString; diff --git a/node_modules/@sinonjs/samsam/lib/match.js b/node_modules/@sinonjs/samsam/lib/match.js new file mode 100644 index 0000000..468bab1 --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/match.js @@ -0,0 +1,174 @@ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var indexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var forEach = require("@sinonjs/commons").prototypes.array.forEach; +var type = require("type-detect"); + +var engineCanCompareMaps = typeof Array.from === "function"; +var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define +var isArrayType = require("./is-array-type"); +var isSubset = require("./is-subset"); +var createMatcher = require("./create-matcher"); + +/** + * Returns true when `array` contains all of `subset` as defined by the `compare` + * argument + * + * @param {Array} array An array to search for a subset + * @param {Array} subset The subset to find in the array + * @param {Function} compare A comparison function + * @returns {boolean} [description] + * @private + */ +function arrayContains(array, subset, compare) { + if (subset.length === 0) { + return true; + } + var i, l, j, k; + for (i = 0, l = array.length; i < l; ++i) { + if (compare(array[i], subset[0])) { + for (j = 0, k = subset.length; j < k; ++j) { + if (i + j >= l) { + return false; + } + if (!compare(array[i + j], subset[j])) { + return false; + } + } + return true; + } + } + return false; +} + +/* eslint-disable complexity */ +/** + * Matches an object with a matcher (or value) + * + * @alias module:samsam.match + * @param {object} object The object candidate to match + * @param {object} matcherOrValue A matcher or value to match against + * @returns {boolean} true when `object` matches `matcherOrValue` + */ +function match(object, matcherOrValue) { + if (matcherOrValue && typeof matcherOrValue.test === "function") { + return matcherOrValue.test(object); + } + + switch (type(matcherOrValue)) { + case "bigint": + case "boolean": + case "number": + case "symbol": + return matcherOrValue === object; + case "function": + return matcherOrValue(object) === true; + case "string": + var notNull = typeof object === "string" || Boolean(object); + return ( + notNull && + indexOf( + valueToString(object).toLowerCase(), + matcherOrValue.toLowerCase(), + ) >= 0 + ); + case "null": + return object === null; + case "undefined": + return typeof object === "undefined"; + case "Date": + /* istanbul ignore else */ + if (type(object) === "Date") { + return object.getTime() === matcherOrValue.getTime(); + } + /* istanbul ignore next: this is basically the rest of the function, which is covered */ + break; + case "Array": + case "Int8Array": + case "Uint8Array": + case "Uint8ClampedArray": + case "Int16Array": + case "Uint16Array": + case "Int32Array": + case "Uint32Array": + case "Float32Array": + case "Float64Array": + return ( + isArrayType(matcherOrValue) && + arrayContains(object, matcherOrValue, match) + ); + case "Map": + /* istanbul ignore next: this is covered by a test, that is only run in IE, but we collect coverage information in node*/ + if (!engineCanCompareMaps) { + throw new Error( + "The JavaScript engine does not support Array.from and cannot reliably do value comparison of Map instances", + ); + } + + return ( + type(object) === "Map" && + arrayContains( + Array.from(object), + Array.from(matcherOrValue), + match, + ) + ); + default: + break; + } + + switch (type(object)) { + case "null": + return false; + case "Set": + return isSubset(matcherOrValue, object, match); + default: + break; + } + + /* istanbul ignore else */ + if (matcherOrValue && typeof matcherOrValue === "object") { + if (matcherOrValue === object) { + return true; + } + if (typeof object !== "object") { + return false; + } + var prop; + // eslint-disable-next-line guard-for-in + for (prop in matcherOrValue) { + var value = object[prop]; + if ( + typeof value === "undefined" && + typeof object.getAttribute === "function" + ) { + value = object.getAttribute(prop); + } + if ( + matcherOrValue[prop] === null || + typeof matcherOrValue[prop] === "undefined" + ) { + if (value !== matcherOrValue[prop]) { + return false; + } + } else if ( + typeof value === "undefined" || + !deepEqual(value, matcherOrValue[prop]) + ) { + return false; + } + } + return true; + } + + /* istanbul ignore next */ + throw new Error("Matcher was an unknown or unsupported type"); +} +/* eslint-enable complexity */ + +forEach(Object.keys(createMatcher), function (key) { + match[key] = createMatcher[key]; +}); + +module.exports = match; diff --git a/node_modules/@sinonjs/samsam/lib/samsam.js b/node_modules/@sinonjs/samsam/lib/samsam.js new file mode 100644 index 0000000..249246b --- /dev/null +++ b/node_modules/@sinonjs/samsam/lib/samsam.js @@ -0,0 +1,26 @@ +"use strict"; + +/** + * @module samsam + */ +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isElement = require("./is-element"); +var isNegZero = require("./is-neg-zero"); +var isSet = require("./is-set"); +var isMap = require("./is-map"); +var match = require("./match"); +var deepEqualCyclic = require("./deep-equal").use(match); +var createMatcher = require("./create-matcher"); + +module.exports = { + createMatcher: createMatcher, + deepEqual: deepEqualCyclic, + identical: identical, + isArguments: isArguments, + isElement: isElement, + isMap: isMap, + isNegZero: isNegZero, + isSet: isSet, + match: match, +}; diff --git a/node_modules/@sinonjs/samsam/node_modules/type-detect/LICENSE b/node_modules/@sinonjs/samsam/node_modules/type-detect/LICENSE new file mode 100644 index 0000000..7ea799f --- /dev/null +++ b/node_modules/@sinonjs/samsam/node_modules/type-detect/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2013 Jake Luer (http://alogicalparadox.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@sinonjs/samsam/node_modules/type-detect/README.md b/node_modules/@sinonjs/samsam/node_modules/type-detect/README.md new file mode 100644 index 0000000..beb645e --- /dev/null +++ b/node_modules/@sinonjs/samsam/node_modules/type-detect/README.md @@ -0,0 +1,235 @@ +

+ + type-detect + +

+
+

+ Improved typeof detection for node, Deno, and the browser. +

+ +

+ + license:mit + + + npm:? + + + build:? + + + coverage:? + + + dependencies:? + + + devDependencies:? + +
+ + Join the Slack chat + + + Join the Gitter chat + +

+
+ + + + + + + + + + + + + + +
Supported Browsers
Chrome Edge Firefox Safari IE
9, 10, 11
+
+ +## What is Type-Detect? + +Type Detect is a module which you can use to detect the type of a given object. It returns a string representation of the object's type, either using [`typeof`](http://www.ecma-international.org/ecma-262/6.0/index.html#sec-typeof-operator) or [`@@toStringTag`](http://www.ecma-international.org/ecma-262/6.0/index.html#sec-symbol.tostringtag). It also normalizes some object names for consistency among browsers. + +## Why? + +The `typeof` operator will only specify primitive values; everything else is `"object"` (including `null`, arrays, regexps, etc). Many developers use `Object.prototype.toString()` - which is a fine alternative and returns many more types (null returns `[object Null]`, Arrays as `[object Array]`, regexps as `[object RegExp]` etc). + +Sadly, `Object.prototype.toString` is slow, and buggy. By slow - we mean it is slower than `typeof`. By buggy - we mean that some values (like Promises, the global object, iterators, dataviews, a bunch of HTML elements) all report different things in different browsers. + +`type-detect` fixes all of the shortcomings with `Object.prototype.toString`. We have extra code to speed up checks of JS and DOM objects, as much as 20-30x faster for some values. `type-detect` also fixes any consistencies with these objects. + +## Installation + +### Node.js + +`type-detect` is available on [npm](http://npmjs.org). To install it, type: + + $ npm install type-detect + +### Deno + +`type-detect` can be imported with the following line: + +```js +import type from 'https://deno.land/x/type_detect@v4.1.0/index.ts' +``` + +### Browsers + +You can also use it within the browser; install via npm and use the `type-detect.js` file found within the download. For example: + +```html + +``` + +## Usage + +The primary export of `type-detect` is function that can serve as a replacement for `typeof`. The results of this function will be more specific than that of native `typeof`. + +```js +var type = require('type-detect'); +``` +Or, in the browser use case, after the + + + + +``` + +The full sample can be found [here][browser-sample]. + +### How to build + +```bash +npm run build-dist +``` + +And see the build artifacts under `dist/`. + +## Data Regions + +[OSS current data regions](https://help.aliyun.com/document_detail/31837.html). + +| region | country | city | endpoint | internal endpoint | +| ------------------ | --------- | -------------- | ------------------------------- | ---------------------------------------- | +| oss-cn-hangzhou | China | HangZhou | oss-cn-hangzhou.aliyuncs.com | oss-cn-hangzhou-internal.aliyuncs.com | +| oss-cn-shanghai | China | ShangHai | oss-cn-shanghai.aliyuncs.com | oss-cn-shanghai-internal.aliyuncs.com | +| oss-cn-qingdao | China | QingDao | oss-cn-qingdao.aliyuncs.com | oss-cn-qingdao-internal.aliyuncs.com | +| oss-cn-beijing | China | BeiJing | oss-cn-beijing.aliyuncs.com | oss-cn-beijing-internal.aliyuncs.com | +| oss-cn-shenzhen | China | ShenZhen | oss-cn-shenzhen.aliyuncs.com | oss-cn-shenzhen-internal.aliyuncs.com | +| oss-cn-hongkong | China | HongKong | oss-cn-hongkong.aliyuncs.com | oss-cn-hongkong-internal.aliyuncs.com | +| oss-us-west-1 | US | Silicon Valley | oss-us-west-1.aliyuncs.com | oss-us-west-1-internal.aliyuncs.com | +| oss-ap-southeast-1 | Singapore | Singapore | oss-ap-southeast-1.aliyuncs.com | oss-ap-southeast-1-internal.aliyuncs.com | + +## Create Account + +Go to [OSS website](http://www.aliyun.com/product/oss/?lang=en), create a new account for new user. + +After account created, you can create the OSS instance and get the `accessKeyId` and `accessKeySecret`. + +## Create A Bucket Instance + +Each OSS instance required `accessKeyId`, `accessKeySecret` and `bucket`. + +## oss(options) + +Create a Bucket store instance. + +options: + +- accessKeyId {String} access key you create on aliyun console website +- accessKeySecret {String} access secret you create +- [stsToken] {String} used by temporary authorization, detail [see](https://www.alibabacloud.com/help/doc-detail/32077.htm) +- [refreshSTSToken] {Function} used by auto set `stsToken`、`accessKeyId`、`accessKeySecret` when sts info expires. return value must be object contains `stsToken`、`accessKeyId`、`accessKeySecret` +- [refreshSTSTokenInterval] {number} use time (ms) of refresh STSToken interval it should be less than sts info expire interval, default is 300000ms(5min) +- [bucket] {String} the default bucket you want to access + If you don't have any bucket, please use `putBucket()` create one first. +- [endpoint] {String} oss region domain. It takes priority over `region`. Set as extranet domain name, intranet domain name, accelerated domain name, etc. according to different needs. please see [endpoints](https://www.alibabacloud.com/help/doc-detail/31837.htm) +- [region] {String} the bucket data region location, please see [Data Regions](#data-regions), + default is `oss-cn-hangzhou`. +- [internal] {Boolean} access OSS with aliyun internal network or not, default is `false`. + If your servers are running on aliyun too, you can set `true` to save a lot of money. +- [secure] {Boolean} instruct OSS client to use HTTPS (secure: true) or HTTP (secure: false) protocol. +- [timeout] {String|Number} instance level timeout for all operations, default is `60s`. +- [cname] {Boolean}, default false, access oss with custom domain name. if true, you can fill `endpoint` field with your custom domain name, +- [isRequestPay] {Boolean}, default false, whether request payer function of the bucket is open, if true, will send headers `'x-oss-request-payer': 'requester'` to oss server. + the details you can see [requestPay](https://help.aliyun.com/document_detail/91337.htm) +- [useFetch] {Boolean}, default false, it just work in Browser, if true,it means upload object with + `fetch` mode ,else `XMLHttpRequest` +- [enableProxy] {Boolean}, Enable proxy request, default is false. **_NOTE:_** When enabling proxy request, please ensure that proxy-agent is installed. +- [proxy] {String | Object}, proxy agent uri or options, default is null. +- [retryMax] {Number}, used by auto retry send request count when request error is net error or timeout. **_NOTE:_** Not support `put` with stream, `putStream`, `append` with stream because the stream can only be consumed once +- [maxSockets] {Number} Maximum number of sockets to allow per host. Default is infinity +- [authorizationV4] {Boolean} Use V4 signature. Default is false. +- [cloudBoxId] {String} the CloudBox ID you want to access. When configuring this option, please set the endpoint option to the CloudBox endpoint and set the authorizationV4 option to true. + +example: + +1. basic usage + +```js +const OSS = require('ali-oss'); + +const store = new OSS({ + accessKeyId: 'your access key', + accessKeySecret: 'your access secret', + bucket: 'your bucket name', + region: 'oss-cn-hangzhou' +}); +``` + +2. use accelerate endpoint + +- Global accelerate endpoint: oss-accelerate.aliyuncs.com +- Accelerate endpoint of regions outside mainland China: oss-accelerate-overseas.aliyuncs.com + +```js +const OSS = require('ali-oss'); + +const store = new OSS({ + accessKeyId: 'your access key', + accessKeySecret: 'your access secret', + bucket: 'your bucket name', + endpoint: 'oss-accelerate.aliyuncs.com' +}); +``` + +3. use custom domain + +```js +const OSS = require('ali-oss'); + +const store = new OSS({ + accessKeyId: 'your access key', + accessKeySecret: 'your access secret', + cname: true, + endpoint: 'your custome domain' +}); +``` + +4. use STS and refreshSTSToken + +```js +const OSS = require('ali-oss'); + +const store = new OSS({ + accessKeyId: 'your STS key', + accessKeySecret: 'your STS secret', + stsToken: 'your STS token', + refreshSTSToken: async () => { + const info = await fetch('you sts server'); + return { + accessKeyId: info.accessKeyId, + accessKeySecret: info.accessKeySecret, + stsToken: info.stsToken + }; + }, + refreshSTSTokenInterval: 300000 +}); +``` + +5. retry request with stream + +```js +for (let i = 0; i <= store.options.retryMax; i++) { + try { + const result = await store.putStream('', fs.createReadStream('')); + console.log(result); + break; // break if success + } catch (e) { + console.log(e); + } +} +``` + +6. use V4 signature, and use optional additionalHeaders option which type is a string array, and the values inside need to be included in the header. + +```js +const OSS = require('ali-oss'); + +const store = new OSS({ + accessKeyId: 'your access key', + accessKeySecret: 'your access secret', + bucket: 'your bucket name', + region: 'oss-cn-hangzhou', + authorizationV4: true +}); + +try { + const bucketInfo = await store.getBucketInfo('your bucket name'); + console.log(bucketInfo); +} catch (e) { + console.log(e); +} + +try { + const putObjectResult = await store.put('your bucket name', 'your object name', { + headers: { + // The headers of this request + header1: 'value1', + header2: 'value2' + }, + // The keys of the request headers that need to be calculated into the V4 signature. Please ensure that these additional headers are included in the request headers. + additionalHeaders: ['additional header1', 'additional header2'] + }); + console.log(putObjectResult); +} catch (e) { + console.log(e); +} +``` + +## Bucket Operations + +### .listBuckets(query[, options]) + +List buckets in this account. + +parameters: + +- [query] {Object} query parameters, default is `null` + - [prefix] {String} search buckets using `prefix` key + - [marker] {String} search start from `marker`, including `marker` key + - [max-keys] {String|Number} max buckets, default is `100`, limit to `1000` +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return buckets list on `buckets` properties. + +- buckets {Array} bucket meta info list + Each `BucketMeta` will contains blow properties: + - name {String} bucket name + - region {String} bucket store data region, e.g.: `oss-cn-hangzhou-a` + - creationDate {String} bucket create GMT date, e.g.: `2015-02-19T08:39:44.000Z` + - storageClass {String} e.g.: `Standard`, `IA`, `Archive` +- owner {Object} object owner, including `id` and `displayName` +- isTruncated {Boolean} truncate or not +- nextMarker {String} next marker string +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- List top 10 buckets + +```js +store + .listBuckets({ + 'max-keys': 10 + }) + .then(result => { + console.log(result); + }); +``` + +### .putBucket(name[, options]) + +Create a new bucket. + +parameters: + +- name {String} bucket name + If bucket exists and not belong to current account, will throw BucketAlreadyExistsError. + If bucket not exists, will create a new bucket and set it's ACL. +- [options] {Object} optional parameters + - [acl] {String} include `private`,`public-read`,`public-read-write` + - [storageClass] {String} the storage type include (Standard,IA,Archive) + - [dataRedundancyType] {String} default `LRS`, include `LRS`,`ZRS` + - [timeout] {Number} the operation timeout + +Success will return the bucket name on `bucket` properties. + +- bucket {String} bucket name +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Create a bucket name `helloworld` location on HongKong + +```js +store.putBucket('helloworld').then(result => { + // use it by default + store.useBucket('helloworld'); +}); +``` + +- Create a bucket name `helloworld` location on HongKong StorageClass `Archive` + +```js +await store.putBucket('helloworld', { StorageClass: 'Archive' }); +// use it by default +store.useBucket('helloworld'); +``` + +### .deleteBucket(name[, options]) + +Delete an empty bucket. + +parameters: + +- name {String} bucket name + If bucket is not empty, will throw BucketNotEmptyError. + If bucket is not exists, will throw NoSuchBucketError. +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Delete the exists 'helloworld' bucket on 'oss-cn-hongkong' + +```js +store.deleteBucket('helloworld').then(result => {}); +``` + +### .useBucket(name) + +Use the bucket. + +parameters: + +- name {String} bucket name + +example: + +- Use `helloworld` as the default bucket + +```js +store.useBucket('helloworld'); +``` + +### .getBucketInfo(name) + +Get bucket information,include CreationDate、ExtranetEndpoint、IntranetEndpoint、Location、Name、StorageClass、 +Owner、AccessControlList、Versioning + +parameters: + +- name {String} bucket name + +example: + +- Use `helloworld` as the default bucket + +```js +store.getBucketInfo('helloworld').then(res => { + console.log(res.bucket); +}); +``` + +### .getBucketStat(name) + +Call the GetBucketStat interface to get the storage capacity of the specified storage space (Bucket) and the number of files (Object). + +Calling this interface requires the oss:GetBucketStat permission. +The data obtained by calling this interface is not real-time data and may be delayed for more than an hour. +The point in time of the stored information obtained by calling this interface is not guaranteed to be up-to-date, i.e. the LastModifiedTime field returned by a later call to this interface may be smaller than the LastModifiedTime field returned by a previous call to this interface. + +parameters: + +- name {String} bucket name + +Success will return: + +- stat {Object} container for the BucketStat structure: + + - Storage {String} the total storage capacity of the Bucket, in bytes. + - ObjectCount {String} total number of Objects in the Bucket。 + - MultipartUploadCount {String} the number of Multipart Uploads in the Bucket that have been initialized but not yet completed (Complete) or not yet aborted (Abort). + - LiveChannelCount {String} the number of Live Channels in the Bucket. + - LastModifiedTime {String} the point in time, in timestamps, when the storage information was retrieved. + - StandardStorage {String} the amount of storage of the standard storage type, in bytes. + - StandardObjectCount {String} the number of objects of the standard storage type. + - InfrequentAccessStorage {String} the amount of billed storage for the low-frequency storage type, in bytes. + - InfrequentAccessRealStorage {String} the actual storage amount of the low-frequency storage type, in bytes. + - InfrequentAccessObjectCount {String} the number of Objects of the low-frequency storage type. + - ArchiveStorage {String} the amount of billed storage for the archive storage type, in bytes. + - ArchiveRealStorage {String} the actual storage amount of the archive storage type, in bytes. + - ArchiveObjectCount {String} the number of objects of the archive storage type. + - ColdArchiveStorage {String} the amount of billed storage for the cold archive storage type, in bytes. + - ColdArchiveRealStorage {String} the actual storage amount in bytes for the cold archive storage type. + - ColdArchiveObjectCount {String} the number of objects of the cold archive storage type. + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- If you don't fill in the name, the default is the bucket defined during initialization. + +```js +store.getBucketStat().then(res => console.log(res)); +``` + +### .getBucketLocation(name) + +Get bucket location + +parameters: + +- name {String} bucket name + +example: + +- Use `helloworld` as the default bucket + +```js +store.getBucketLocation('helloworld').then(res => { + console.log(res.location); +}); +``` + +--- + +### .putBucketACL(name, acl[, options]) + +Update the bucket ACL. + +parameters: + +- name {String} bucket name +- acl {String} access control list, current available: `public-read-write`, `public-read` and `private` +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Set bucket `helloworld` to `public-read-write` + +```js +store.putBucketACL('helloworld', 'public-read-write').then(result => {}); +``` + +### .getBucketACL(name[, options]) + +Get the bucket ACL. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- acl {String} acl settiongs string +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Get bucket `helloworld` + +```js +store.getBucketACL('helloworld').then(result => { + console.log(result.acl); +}); +``` + +--- + +### .putBucketLogging(name, prefix[, options]) + +Update the bucket logging settings. +Log file will create every one hour and name format: `-YYYY-mm-DD-HH-MM-SS-UniqueString`. + +parameters: + +- name {String} bucket name +- [prefix] {String} prefix path name to store the log files +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Enable bucket `helloworld` logging and save with prefix `logs/` + +```js +store.putBucketLogging('helloworld', 'logs/').then(result => {}); +``` + +### .getBucketLogging(name[, options]) + +Get the bucket logging settings. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- enable {Boolean} enable logging or not +- prefix {String} prefix path name to store the log files, maybe `null` +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Get bucket `helloworld` logging settings + +```js +store.getBucketLogging('helloworld').then(result => { + console.log(result.enable, result.prefix); +}); +``` + +### .deleteBucketLogging(name[, options]) + +Delete the bucket logging settings. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +--- + +### .putBucketWebsite(name, config[, options]) + +Set the bucket as a static website. + +parameters: + +- name {String} bucket name +- config {Object} website config, contains blow properties: + - index {String} default page, e.g.: `index.html` + - [error] {String} error page, e.g.: 'error.html' + - [supportSubDir] {String} default vaule false + - [type] {String} default value 0 + - [routingRules] {Array} RoutingRules +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +```js +store + .putBucketWebsite('hello', { + index: 'index.html' + }) + .then(result => {}); +``` + +### .getBucketWebsite(name[, options]) + +Get the bucket website config. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- index {String} index page +- error {String} error page, maybe `null` +- supportSubDir {String} +- type {String} +- routingRules {Array} +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +### .deleteBucketWebsite(name[, options]) + +Delete the bucket website config. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +--- + +### .putBucketReferer(name, allowEmpty, referers[, options]) + +Set the bucket request `Referer` white list. + +parameters: + +- name {String} bucket name +- allowEmpty {Boolean} allow empty request referer or not +- referers {Array} `Referer` white list, e.g.: + ```js + ['https://npm.taobao.org', 'http://cnpmjs.org']; + ``` +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +```js +store.putBucketReferer('hello', false, ['https://npm.taobao.org', 'http://cnpmjs.org']).then(result => {}); +``` + +### .getBucketReferer(name[, options]) + +Get the bucket request `Referer` white list. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- allowEmpty {Boolean} allow empty request referer or not +- referers {Array} `Referer` white list +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +### .deleteBucketReferer(name[, options]) + +Delete the bucket request `Referer` white list. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +--- + +### .putBucketLifecycle(name, rules[, options]) + +Set the bucket object lifecycle. + +parameters: + +- name {String} bucket name +- rules {Array} rule config list, each `Rule` will contains blow properties: + - [id] {String} rule id, if not set, OSS will auto create it with random string. + - prefix {String} store prefix + - status {String} rule status, allow values: `Enabled` or `Disabled` + - [expiration] {Object} specifies the expiration attribute of the lifecycle rules for the object. + - [days] {Number|String} expire after the `days` + - [createdBeforeDate] {String} expire date, e.g.: `2022-10-11T00:00:00.000Z` + - [expiredObjectDeleteMarker] {String} value `true` + `createdBeforeDate` and `days` and `expiredObjectDeleteMarker` must have one. + - [abortMultipartUpload] {Object} Specifies the expiration attribute of the multipart upload tasks that are not complete. + - [days] {Number|String} expire after the `days` + - [createdBeforeDate] {String} expire date, e.g.: `2022-10-11T00:00:00.000Z` + `createdBeforeDate` and `days` must have one. + - [transition] {Object} Specifies the time when an object is converted to the IA or archive storage class during a valid life cycle. + - storageClass {String} Specifies the storage class that objects that conform to the rule are converted into. allow values: `IA` or `Archive` or `ColdArchive` or `DeepColdArchive` + - [days] {Number|String} expire after the `days` + - [createdBeforeDate] {String} expire date, e.g.: `2022-10-11T00:00:00.000Z` + `createdBeforeDate` and `days` must have one. + - [noncurrentVersionTransition] {Object} Specifies the time when an object is converted to the IA or archive storage class during a valid life cycle. + - storageClass {String} Specifies the storage class that history objects that conform to the rule are converted into. allow values: `IA` or `Archive` or `ColdArchive` or `DeepColdArchive` + - noncurrentDays {String} expire after the `noncurrentDays` + `expiration`、 `abortMultipartUpload`、 `transition`、 `noncurrentVersionTransition` must have one. + - [noncurrentVersionExpiration] {Object} specifies the expiration attribute of the lifecycle rules for the history object. + - noncurrentDays {String} expire after the `noncurrentDays` + - [tag] {Object} Specifies the object tag applicable to a rule. Multiple tags are supported. + - key {String} Indicates the tag key. + - value {String} Indicates the tag value. + `tag` cannot be used with `abortMultipartUpload` +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +```js +store + .putBucketLifecycle('hello', [ + { + id: 'delete after one day', + prefix: 'logs/', + status: 'Enabled', + days: 1 + }, + { + prefix: 'logs2/', + status: 'Disabled', + date: '2022-10-11T00:00:00.000Z' + } + ]) + .then(result => {}); +``` + +example: for history with noncurrentVersionExpiration + +```js +const result = await store.putBucketLifecycle(bucket, [ + { + id: 'expiration1', + prefix: 'logs/', + status: 'Enabled', + expiration: { + days: '1' + }, + noncurrentVersionExpiration: { + noncurrentDays: '1' + } + } +]); +console.log(result); +``` + +example: for history with expiredObjectDeleteMarker + +```js +const result = await store.putBucketLifecycle(bucket, [ + { + id: 'expiration1', + prefix: 'logs/', + status: 'Enabled', + expiration: { + expiredObjectDeleteMarker: 'true' + }, + noncurrentVersionExpiration: { + noncurrentDays: '1' + } + } +]); +console.log(result); +``` + +example: for history with noncurrentVersionTransition + +```js +const result = await store.putBucketLifecycle(bucket, [ + { + id: 'expiration1', + prefix: 'logs/', + status: 'Enabled', + noncurrentVersionTransition: { + noncurrentDays: '10', + storageClass: 'IA' + } + } +]); +console.log(result); +``` + +### .getBucketLifecycle(name[, options]) + +Get the bucket object lifecycle. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- rules {Array} the lifecycle rule list +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +### .deleteBucketLifecycle(name[, options]) + +Delete the bucket object lifecycle. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +--- + +### .putBucketCORS(name, rules[, options]) + +Set CORS rules of the bucket object + +parameters: + +- name {String} bucket name +- rules {Array} rule config list, each `Rule` will contains below properties: + - allowedOrigin {String/Array} configure for Access-Control-Allow-Origin header + - allowedMethod {String/Array} configure for Access-Control-Allow-Methods header + - [allowedHeader] {String/Array} configure for Access-Control-Allow-Headers header + - [exposeHeader] {String/Array} configure for Access-Control-Expose-Headers header + - [maxAgeSeconds] {String} configure for Access-Control-Max-Age header +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +```js +store + .putBucketCORS('hello', [ + { + allowedOrigin: '*', + allowedMethod: ['GET', 'HEAD'] + } + ]) + .then(result => {}); +``` + +### .getBucketCORS(name[, options]) + +Get CORS rules of the bucket object. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- rules {Array} the CORS rule list +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +### .deleteBucketCORS(name[, options]) + +Delete CORS rules of the bucket object. + +parameters: + +- name {String} bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +### .getBucketRequestPayment(bucketName[, options]) + +get RequestPayment value of the bucket object. + +parameters: + +- bucketName {String} bucket name +- [options] {Object} optional parameters + +Success will return: + +- status {Number} response status +- payer {String} payer, BucketOwner or Requester +- res {Object} response info, including + - data {Buffer} xml + +--- + +### .putBucketRequestPayment(bucketName, payer[, options]) + +put RequestPayment value of the bucket object. + +parameters: + +- bucketName {String} +- payer {String} payer +- [options] {Object} optional parameters + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .putBucketEncryption(name, rules) + +put BucketEncryption value of the bucket object. + +parameters: + +- name {String} bucket name +- [rules] {Object} parameters + - SSEAlgorithm {String} encryption type, expect AES256 or KMS + - {KMSMasterKeyID} {String} needed when encryption type is KMS + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .getBucketEncryption(name) + +get BucketEncryption rule value of the bucket object. + +parameters: + +- name {String} bucket name + +Success will return: + +- status {Number} response status +- res {Object} response info +- encryption {Object} rules + - SSEAlgorithm {String} encryption type, AES256 or KMS + - {KMSMasterKeyID} {String} will be return when encryption type is KMS + +--- + +### .deleteBucketEncryption(name) + +delete BucketEncryption rule value of the bucket object. + +parameters: + +- name {String} bucket name + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .putBucketTags(name, tag[, options]) + +Adds tags for a bucket or modify the tags for a bucket. + +parameters: + +- name {String} the object name +- tag {Object} tag, eg. `{var1: value1,var2:value2}` +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .getBucketTags(name[, options]) + +Obtains the tags for a bucket. + +parameters: + +- name {String} the object name +- [options] {Object} optional args + +Success will return: + +- tag {Object} the tag of object +- res {Object} response info + +--- + +### .deleteBucketTags(name[, options]) + +Deletes the tags added for a bucket. + +parameters: + +- name {String} the object name +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .putBucketPolicy(name, policy[, options]) + +Adds or modify policy for a bucket. + +parameters: + +- name {String} the bucket name +- policy {Object} bucket policy +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +example: + +```js +const policy = { + Version: '1', + Statement: [ + { + Action: ['oss:PutObject', 'oss:GetObject'], + Effect: 'Deny', + Principal: ['1234567890'], + Resource: ['acs:oss:*:1234567890:*/*'] + } + ] +}; +const result = await store.putBucketPolicy(bucket, policy); +console.log(result); +``` + +--- + +### .getBucketPolicy(name[, options]) + +Obtains the policy for a bucket. + +parameters: + +- name {String} the bucket name +- [options] {Object} optional args + +Success will return: + +- policy {Object} the policy of bucket, if not exist, the value is null +- res {Object} response info +- status {Number} response status + +--- + +### .deleteBucketPolicy(name[, options]) + +Deletes the policy added for a bucket. + +parameters: + +- name {String} the bucket name +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .getBucketVersioning(name[, options]) + +Obtains the version status of an object + +parameters: + +- name {String} the bucket name +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- versionStatus {String | undefined} version status, `Suspended` or `Enabled`. default value: `undefined` +- res {Object} response info + +--- + +### .putBucketVersioning(name, status[, options]) + +set the version status of an object + +parameters: + +- name {String} the bucket name +- status {String} version status, allow values: `Enabled` or `Suspended` +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .getBucketInventory(name, inventoryId[, options]) + +get bucket inventory by inventory-id + +parameters: + +- name {String} the bucket name +- inventoryId {String} inventory-id +- [options] {Object} optional args + +Success will return: + +- inventory {Inventory} +- status {Number} response status +- res {Object} response info + +```js +async function getBucketInventoryById() { + try { + const result = await store.getBucketInventory('bucket', 'inventoryid'); + console.log(result.inventory); + } catch (err) { + console.log(err); + } +} + +getBucketInventoryById(); +``` + +### putBucketInventory(name, inventory[, options]) + +set bucket inventory + +parameters: + +- name {String} the bucket name +- inventory {Inventory} inventory config +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +```ts +type Field = + 'Size | LastModifiedDate | ETag | StorageClass | IsMultipartUploaded | EncryptionStatus | ObjectAcl | TaggingCount | ObjectType | Crc64'; +interface Inventory { + id: string; + isEnabled: true | false; + prefix?: string; + OSSBucketDestination: { + format: 'CSV'; + accountId: string; + rolename: string; + bucket: string; + prefix?: string; + encryption?: + | { 'SSE-OSS': '' } + | { + 'SSE-KMS': { + keyId: string; + }; + }; + }; + frequency: 'Daily' | 'Weekly'; + includedObjectVersions: 'Current' | 'All'; + optionalFields?: { + field?: Field[]; + }; +} +``` + +```js +const inventory = { + id: 'default', + isEnabled: false, // `true` | `false` + prefix: 'ttt', // filter prefix + OSSBucketDestination: { + format: 'CSV', + accountId: '1817184078010220', + rolename: 'AliyunOSSRole', + bucket: 'your bucket', + prefix: 'test' + //encryption: {'SSE-OSS': ''}, + /* + encryption: { + 'SSE-KMS': { + keyId: 'test-kms-id'; + };, + */ + }, + frequency: 'Daily', // `WEEKLY` | `Daily` + includedObjectVersions: 'All', // `All` | `Current` + optionalFields: { + field: [ + 'Size', + 'LastModifiedDate', + 'ETag', + 'StorageClass', + 'IsMultipartUploaded', + 'EncryptionStatus', + 'ObjectAcl', + 'TaggingCount', + 'ObjectType', + 'Crc64' + ] + } +}; + +async function putInventory() { + const bucket = 'Your Bucket Name'; + try { + await store.putBucketInventory(bucket, inventory); + } catch (err) { + console.log(err); + } +} + +putInventory(); +``` + +### deleteBucketInventory(name, inventoryId[, options]) + +delete bucket inventory by inventory-id + +parameters: + +- name {String} the bucket name +- inventoryId {String} inventory-id +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +### listBucketInventory(name[, options]) + +list bucket inventory + +parameters: + +- name {String} the bucket name +- [options] {Object} optional args + - continuationToken used by search next page + +Success will return: + +- status {Number} response status +- res {Object} response info + +example: + +```js +async function listBucketInventory() { + const bucket = 'Your Bucket Name'; + let nextContinuationToken; + // list all inventory of the bucket + do { + const result = await store.listBucketInventory(bucket, nextContinuationToken); + console.log(result.inventoryList); + nextContinuationToken = result.nextContinuationToken; + } while (nextContinuationToken); +} + +listBucketInventory(); +``` + +### .abortBucketWorm(name[, options]) + +used to delete an unlocked retention policy. + +parameters: + +- name {String} the bucket name +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .completeBucketWorm(name, wormId[, options]) + +used to lock a retention policy. + +parameters: + +- name {String} the bucket name +- wormId {String} worm id +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .extendBucketWorm(name, wormId, days[, options]) + +used to extend the retention period of objects in a bucket whose retention policy is locked. + +parameters: + +- name {String} the bucket name +- wormId {String} worm id +- days {String | Number} retention days +- [options] {Object} optional args + +Success will return: + +- status {Number} response status +- res {Object} response info + +--- + +### .getBucketWorm(name[, options]) + +used to query the retention policy information of the specified bucket. + +parameters: + +- name {String} the bucket name +- [options] {Object} optional args + +Success will return: + +- wormId {String} worm id +- state {String} `Locked` or `InProgress` +- days {String} retention days +- creationDate {String} +- status {Number} response status +- res {Object} response info + +--- + +### .initiateBucketWorm(name, days[, options]) + +create a retention policy. + +parameters: + +- name {String} the bucket name +- days {String | Number}} set retention days +- [options] {Object} optional args + +Success will return: + +- wormId {String} worm id +- status {Number} response status +- res {Object} response info + +--- + +## Object Operations + +All operations function return Promise, except `signatureUrl`. + +### .put(name, file[, options]) + +Add an object to the bucket. + +parameters: + +- name {String} object name store on OSS +- file {String|Buffer|ReadStream|File(only support Browser)|Blob(only support Browser)} object local path, content buffer or ReadStream content instance use in Node, Blob and html5 File +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout (ms) + - [mime] {String} custom mime, will send with `Content-Type` entity header + - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string + e.g.: `{ uid: 123, pid: 110 }` + - [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)
+ - url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL. + - [host] {String} The host header value for initiating callback requests. + - body {String} The value of the request body when a callback is initiated, for example, `key=${key}&etag=${etag}&my_var=${x:my_var}`. + - [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value. + - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client. + - [customValue] {Object} Custom parameters are a map of key-values
+ e.g.: + ```js + var customValue = { var1: 'value1', var2: 'value2' }; + ``` + - [headers] {Object} extra headers + - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache` + - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename` + - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip` + - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT` + - See more: [PutObject](https://help.aliyun.com/document_detail/31978.html#title-yxe-96d-x61) + - [disabledMD5] {Boolean} default true, it just work in Browser. if false,it means that MD5 is automatically calculated for uploaded files. **_NOTE:_** Synchronous computing tasks will block the main process + +Success will return the object information. + +object: + +- name {String} object name +- data {Object} callback server response data, sdk use JSON.parse() return +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Add an object through local file path + +```js +const filepath = '/home/ossdemo/demo.txt'; +store.put('ossdemo/demo.txt', filepath).then((result) => { + console.log(result); +}); + +// { +// name: 'ossdemo/demo.txt', +// res: { +// status: 200, +// headers: { +// date: 'Tue, 17 Feb 2015 13:28:17 GMT', +// 'content-length': '0', +// connection: 'close', +// etag: '"BF7A03DA01440845BC5D487B369BC168"', +// server: 'AliyunOSS', +// 'x-oss-request-id': '54E341F1707AA0275E829244' +// }, +// size: 0, +// rt: 92 +// } +// } +``` + +- Add an object through content buffer + +```js +store.put('ossdemo/buffer', Buffer.from('foo content')).then((result) => { + console.log(result); +}); + +// { +// name: 'ossdemo/buffer', +// url: 'http://demo.oss-cn-hangzhou.aliyuncs.com/ossdemo/buffer', +// res: { +// status: 200, +// headers: { +// date: 'Tue, 17 Feb 2015 13:28:17 GMT', +// 'content-length': '0', +// connection: 'close', +// etag: '"xxx"', +// server: 'AliyunOSS', +// 'x-oss-request-id': '54E341F1707AA0275E829243' +// }, +// size: 0, +// rt: 92 +// } +// } +``` + +- Add an object through readstream + +```js +const filepath = '/home/ossdemo/demo.txt'; +store.put('ossdemo/readstream.txt', fs.createReadStream(filepath)).then((result) => { + console.log(result); +}); + +// { +// name: 'ossdemo/readstream.txt', +// url: 'http://demo.oss-cn-hangzhou.aliyuncs.com/ossdemo/readstream.txt', +// res: { +// status: 200, +// headers: { +// date: 'Tue, 17 Feb 2015 13:28:17 GMT', +// 'content-length': '0', +// connection: 'close', +// etag: '"BF7A03DA01440845BC5D487B369BC168"', +// server: 'AliyunOSS', +// 'x-oss-request-id': '54E341F1707AA0275E829242' +// }, +// size: 0, +// rt: 92 +// } +// } +``` + +### .putStream(name, stream[, options]) + +Add a stream object to the bucket. + +parameters: + +- name {String} object name store on OSS +- stream {ReadStream} object ReadStream content instance +- [options] {Object} optional parameters + - [contentLength] {Number} the stream length, `chunked encoding` will be used if absent + - [timeout] {Number} the operation timeout + - [mime] {String} custom mime, will send with `Content-Type` entity header + - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string + e.g.: `{ uid: 123, pid: 110 }` + - [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)
+ - url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL. + - [host] {String} The host header value for initiating callback requests. + - body {String} The value of the request body when a callback is initiated, for example, key=${key}&etag=${etag}&my_var=${x:my_var}. + - [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value. + - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client. + - [customValue] {Object} Custom parameters are a map of key-values
+ e.g.: + ```js + var customValue = { var1: 'value1', var2: 'value2' }; + ``` + - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html) + - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache` + - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename` + - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip` + - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT` + +Success will return the object information. + +object: + +- name {String} object name +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Add an object through readstream + +```js +const filepath = '/home/ossdemo/demo.txt'; +store.putStream('ossdemo/readstream.txt', fs.createReadStream(filepath)).then((result) => { + console.log(result); +}); + +// { +// name: 'ossdemo/readstream.txt', +// url: 'http://demo.oss-cn-hangzhou.aliyuncs.com/ossdemo/readstream.txt', +// res: { +// status: 200, +// headers: { +// date: 'Tue, 17 Feb 2015 13:28:17 GMT', +// 'content-length': '0', +// connection: 'close', +// etag: '"BF7A03DA01440845BC5D487B369BC168"', +// server: 'AliyunOSS', +// 'x-oss-request-id': '54E341F1707AA0275E829242' +// }, +// size: 0, +// rt: 92 +// } +// } +``` + +### .append(name, file[, options]) + +Append an object to the bucket, it's almost same as put, but it can add content to existing object rather than override it. + +All parameters are same as put except for options.position + +- name {String} object name store on OSS +- file {String|Buffer|ReadStream} object local path, content buffer or ReadStream content instance +- [options] {Object} optional parameters + - [position] {String} specify the position which is the content length of the latest object + - [timeout] {Number} the operation timeout + - [mime] {String} custom mime, will send with `Content-Type` entity header + - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string + e.g.: `{ uid: 123, pid: 110 }` + - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html) + - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache` + - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename` + - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip` + - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT` + +object: + +- name {String} object name +- url {String} the url of oss +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- nextAppendPosition {String} the next position(The browser needs to set cross domain and expose the x-oss-next-append-position header) + +example: + +```js +let object = await store.append('ossdemo/buffer', Buffer.from('foo')); + +// append content to the existing object +object = await store.append('ossdemo/buffer', Buffer.from('bar'), { + position: object.nextAppendPosition +}); +``` + +### .getObjectUrl(name[, baseUrl]) + +Get the Object url. +If provide `baseUrl`, will use `baseUrl` instead the default `endpoint`. + +e.g.: + +```js +const cdnUrl = store.getObjectUrl('foo/bar.jpg', 'https://mycdn.domian.com'); +// cdnUrl should be `https://mycdn.domian.com/foo/bar.jpg` +``` + +### .generateObjectUrl(name[, baseUrl]) + +Get the Object url. +If provide `baseUrl`, will use `baseUrl` instead the default `bucket and endpoint `. +Suggest use generateObjectUrl instead of getObjectUrl. + +e.g.: + +```js +const url = store.generateObjectUrl('foo/bar.jpg'); +// cdnUrl should be `https://${bucketname}.${endpotint}foo/bar.jpg` + +const cdnUrl = store.generateObjectUrl('foo/bar.jpg', 'https://mycdn.domian.com'); +// cdnUrl should be `https://mycdn.domian.com/foo/bar.jpg` +``` + +### .head(name[, options]) + +Head an object and get the meta info. + +parameters: + +- name {String} object name store on OSS +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [versionId] {String} the version id of history object + - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html) + - 'If-Modified-Since' object modified after this time will return 200 and object meta, + otherwise return 304 not modified + - 'If-Unmodified-Since' object modified before this time will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-Match' object etag equal this will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-None-Match' object etag not equal this will return 200 and object meta, + otherwise return 304 not modified + +Success will return the object's meta information. + +object: + +- status {Number} response status, maybe 200 or 304 +- meta {Object} object user meta, if not set on `put()`, will return null. + If return status 304, meta will be null too +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - [x-oss-version-id] return in multiversion + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Head an exists object and get user meta + +```js +await this.store.put('ossdemo/head-meta', Buffer.from('foo'), { + meta: { + uid: 1, + path: 'foo/demo.txt' + } +}); +const object = await this.store.head('ossdemo/head-meta'); +console.log(object); + +// { +// status: 200, +// meta: { +// uid: '1', +// path: 'foo/demo.txt' +// }, +// res: { ... } +// } +``` + +- Head a not exists object + +```js +const object = await this.store.head('ossdemo/head-meta'); +// will throw NoSuchKeyError +``` + +### .getObjectMeta(name[, options]) + +Get an object meta info include ETag、Size、LastModified and so on, not return object content. + +parameters: + +- name {String} object name store on OSS +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [versionId] {String} the version id of history object + +Success will return the object's meta information. + +object: + +- status {Number} response status +- res {Object} response info, including + - headers {Object} response headers + +example: + +- Head an exists object and get object meta info + +```js +await this.store.put('ossdemo/object-meta', Buffer.from('foo')); +const object = await this.store.getObjectMeta('ossdemo/object-meta'); +console.log(object); + +// { +// status: 200, +// res: { ... } +// } +``` + +### .get(name[, file, options]) + +Get an object from the bucket. + +parameters: + +- name {String} object name store on OSS +- [file] {String|WriteStream|Object} file path or WriteStream instance to store the content + If `file` is null or ignore this parameter, function will return info contains `content` property. + If `file` is Object, it will be treated as options. +- [options] {Object} optional parameters + - [versionId] {String} the version id of history object + - [timeout] {Number} the operation timeout + - [process] {String} image process params, will send with `x-oss-process` + e.g.: `{process: 'image/resize,w_200'}` + - [responseCacheControl] {String} default `no-cache`, (only support Browser). response-cache-control, will response with HTTP Header `Cache-Control` + - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html) + - 'Range' get specifying range bytes content, e.g.: `Range: bytes=0-9` + - 'If-Modified-Since' object modified after this time will return 200 and object meta, + otherwise return 304 not modified + - 'If-Unmodified-Since' object modified before this time will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-Match' object etag equal this will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-None-Match' object etag not equal this will return 200 and object meta, + otherwise return 304 not modified + +Success will return the info contains response. + +object: + +- [content] {Buffer} file content buffer if `file` parameter is null or ignore +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +If object not exists, will throw NoSuchKeyError. + +example: + +- Get an exists object and store it to the local file + +```js +const filepath = '/home/ossdemo/demo.txt'; +await store.get('ossdemo/demo.txt', filepath); +``` + +\_ Store object to a writestream + +```js +await store.get('ossdemo/demo.txt', somestream); +``` + +- Get an object content buffer + +```js +const result = await store.get('ossdemo/demo.txt'); +console.log(Buffer.isBuffer(result.content)); +``` + +- Get a processed image and store it to the local file + +```js +const filepath = '/home/ossdemo/demo.png'; +await store.get('ossdemo/demo.png', filepath, { process: 'image/resize,w_200' }); +``` + +- Get a not exists object + +```js +const filepath = '/home/ossdemo/demo.txt'; +await store.get('ossdemo/not-exists-demo.txt', filepath); +// will throw NoSuchKeyError +``` + +- Get a historic version object + +```js +const filepath = '/home/ossdemo/demo.txt'; +const versionId = 'versionId string'; +await store.get('ossdemo/not-exists-demo.txt', filepath, { + versionId +}); +``` + +- If `file` is Object, it will be treated as options. + +```js +const versionId = 'versionId string'; +await store.get('ossdemo/not-exists-demo.txt', { versionId }); +``` + +### .getStream(name[, options]) + +Get an object read stream. + +parameters: + +- name {String} object name store on OSS +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [process] {String} image process params, will send with `x-oss-process` + - [headers] {Object} extra headers + - 'If-Modified-Since' object modified after this time will return 200 and object meta, + otherwise return 304 not modified + - 'If-Unmodified-Since' object modified before this time will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-Match' object etag equal this will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-None-Match' object etag not equal this will return 200 and object meta, + otherwise return 304 not modified + +Success will return the stream instance and response info. + +object: + +- stream {ReadStream} readable stream instance. If response status is not `200`, stream will be `null`. +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +If object not exists, will throw NoSuchKeyError. + +example: + +- Get an exists object stream + +```js +const result = await store.getStream('ossdemo/demo.txt'); +result.stream.pipe(fs.createWriteStream('some file.txt')); +``` + +### .delete(name[, options]) + +Delete an object from the bucket. + +parameters: + +- name {String} object name store on OSS +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [versionId] {String} the version id of history object + +Success will return the info contains response. + +object: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +If delete object not exists, will also delete success. + +example: + +- Delete an exists object + +```js +await store.delete('ossdemo/someobject'); +``` + +- Delete a not exists object + +```js +await store.delete('ossdemo/some-not-exists-object'); +``` + +- Delete a history object or deleteMarker + +```js +const versionId = 'versionId'; +await store.delete('ossdemo/some-not-exists-object', { versionId }); +``` + +### .copy(name, sourceName[, sourceBucket, options]) + +Copy an object from `sourceName` to `name`. + +parameters: + +- name {String} object name store on OSS +- sourceName {String} source object name +- [sourceBucket] {String} source Bucket. if doesn't exist,`sourceBucket` is same bucket. +- [options] {Object} optional parameters + - [versionId] {String} the version id of history object + - [timeout] {Number} the operation timeout + - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string + e.g.: `{ uid: 123, pid: 110 }` + If the `meta` set, will override the source object meta. + - [headers] {Object} extra headers + - 'If-Match' do copy if source object etag equal this, + otherwise throw PreconditionFailedError + - 'If-None-Match' do copy if source object etag not equal this, + otherwise throw PreconditionFailedError + - 'If-Modified-Since' do copy if source object modified after this time, + otherwise throw PreconditionFailedError + - 'If-Unmodified-Since' do copy if source object modified before this time, + otherwise throw PreconditionFailedError + - See more: [CopyObject](https://help.aliyun.com/document_detail/31979.html?#title-tzy-vxc-ncx) + +Success will return the copy result in `data` property. + +object: + +- data {Object} copy result + - lastModified {String} object last modified GMT string + - etag {String} object etag contains `"`, e.g.: `"5B3C1A2E053D763E1B002CC607C5A0FE"` +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +If source object not exists, will throw NoSuchKeyError. + +example: + +- Copy same bucket object + +```js +store.copy('newName', 'oldName').then(result => { + console.log(result); +}); +``` + +- Copy other bucket object + +```js +store.copy('logo.png', 'logo.png', 'other-bucket').then(result => { + console.log(result); +}); +``` + +- Copy historic object + +```js +const versionId = 'your verisonId'; +store.copy('logo.png', 'logo.png', 'other-bucket', { versionId }).then(result => { + console.log(result); +}); +``` + +### .putMeta(name, meta[, options]) + +Set an exists object meta. + +parameters: + +- name {String} object name store on OSS +- meta {Object} user meta, will send with `x-oss-meta-` prefix string + e.g.: `{ uid: 123, pid: 110 }` + If `meta: null`, will clean up the exists meta +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the putMeta result in `data` property. + +- data {Object} copy result + - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z` + - etag {String} object etag contains `"`, e.g.: `"5B3C1A2E053D763E1B002CC607C5A0FE"` +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +If object not exists, will throw NoSuchKeyError. + +example: + +- Update exists object meta + +```js +const result = await store.putMeta('ossdemo.txt', { + uid: 1, + pid: 'p123' +}); +console.log(result); +``` + +- Clean up object meta + +```js +await store.putMeta('ossdemo.txt', null); +``` + +### .deleteMulti(names[, options]) + +Delete multi objects in one request. + +parameters: + +- names {Array} object names, max 1000 objects in once. + - key {String} object name + - [versionId] {String} the version id of history object or deleteMarker +- [options] {Object} optional parameters + - [quiet] {Boolean} quiet mode or verbose mode, default is `false`, verbose mode + quiet mode: if all objects delete succes, return emtpy response. + otherwise return delete error object results. + verbose mode: return all object delete results. + - [timeout] {Number} the operation timeout + +Success will return delete success objects in `deleted` property. + +- [deleted] {Array} deleted object or deleteMarker info list + - [Key] {String} object name + - [VersionId] {String} object versionId + - [DeleteMarker] {String} generate or delete marker + - [DeleteMarkerVersionId] {String} marker versionId +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Delete multi objects in quiet mode + +```js +const result = await store.deleteMulti(['obj1', 'obj2', 'obj3'], { + quiet: true +}); +``` + +- Delete multi objects in verbose mode + +```js +const result = await store.deleteMulti(['obj1', 'obj2', 'obj3']); +``` + +- Delete multi objects in multiversion + +```js +const obj1 = { + key: 'key1', + versionId: 'versionId1' +}; +const obj2 = { + key: 'key2', + versionId: 'versionId2' +}; +const result = await store.deleteMulti([obj1, obj2]); +``` + +### .list(query[, options]) + +List objects in the bucket. + +parameters: + +- [query] {Object} query parameters, default is `null` + - [prefix] {String} search object using `prefix` key + - [marker] {String} search start from `marker`, including `marker` key + - [delimiter] {String} delimiter search scope + e.g. `/` only search current dir, not including subdir + - [max-keys] {String|Number} max objects, default is `100`, limit to `1000` +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return objects list on `objects` properties. + +- objects {Array} object meta info list + Each `ObjectMeta` will contains blow properties: + - name {String} object name on oss + - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z` + - etag {String} object etag contains `"`, e.g.: `"5B3C1A2E053D763E1B002CC607C5A0FE"` + - type {String} object type, e.g.: `Normal` + - size {Number} object size, e.g.: `344606` + - storageClass {String} storage class type, e.g.: `Standard` + - owner {Object} object owner, including `id` and `displayName` + - restoreInfo {Object|undefined} The restoration status of the object + - ongoingRequest {Boolean} Whether the restoration is ongoing + - expireDate {Date|undefined} The time before which the restored object can be read +- prefixes {Array} prefix list +- isTruncated {Boolean} truncate or not +- nextMarker {String} next marker string +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- List top 10 objects + +```js +const result = await store.list(); +console.log(result.objects); +``` + +- List `fun/` dir including subdirs objects + +```js +const result = await store.list({ + prefix: 'fun/' +}); +console.log(result.objects); +``` + +- List `fun/` dir objects, not including subdirs + +```js +const result = await store.list({ + prefix: 'fun/', + delimiter: '/' +}); +console.log(result.objects); +``` + +### .listV2(query[, options]) + +List objects in the bucket.(recommended) + +parameters: + +- [query] {Object} query parameters, default is `null` + - [prefix] {String} search object using `prefix` key + - [continuation-token] (continuationToken) {String} search start from `continuationToken`, including `continuationToken` key + - [delimiter] {String} delimiter search scope + e.g. `/` only search current dir, not including subdir + - [max-keys] {String|Number} max objects, default is `100`, limit to `1000` + - [start-after] {String} specifies the Start-after value from which to start the list. The names of objects are returned in alphabetical order. + - [fetch-owner] {Boolean} specifies whether to include the owner information in the response. +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return objects list on `objects` properties. + +- objects {Array} object meta info list + Each `ObjectMeta` will contains blow properties: + - name {String} object name on oss + - url {String} resource url + - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z` + - etag {String} object etag contains `"`, e.g.: `"5B3C1A2E053D763E1B002CC607C5A0FE"` + - type {String} object type, e.g.: `Normal` + - size {Number} object size, e.g.: `344606` + - storageClass {String} storage class type, e.g.: `Standard` + - owner {Object|null} object owner, including `id` and `displayName` + - restoreInfo {Object|undefined} The restoration status of the object + - ongoingRequest {Boolean} Whether the restoration is ongoing + - expireDate {Date|undefined} The time before which the restored object can be read +- prefixes {Array} prefix list +- isTruncated {Boolean} truncate or not +- nextContinuationToken {String} next continuation-token string +- keyCount {Number} The number of keys returned for this request. If Delimiter is specified, KeyCount is the sum of the elements in Key and CommonPrefixes. +- res {Object} response info, including + + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +- List top 10 objects + +```js +const result = await store.listV2({ + 'max-keys': 10 +}); +console.log(result.objects); +``` + +- List `fun/` dir including subdirs objects + +```js +const result = await store.listV2({ + prefix: 'fun/' +}); +console.log(result.objects); +``` + +- List `fun/` dir objects, not including subdirs + +```js +const result = await store.listV2({ + prefix: 'fun/', + delimiter: '/' +}); +console.log(result.objects); +``` + +- List `a/` dir objects, after `a/b` and not include `a/b` + +```js +const result = await store.listV2({ + delimiter: '/', + prefix: 'a/', + 'start-after': 'a/b' +}); +console.log(result.objects); +``` + +### .getBucketVersions(query[, options]) + +List the version information of all objects in the bucket, including the delete marker (Delete Marker). + +parameters: + +- [query] {Object} query parameters, default is `null` + - [prefix] {String} search object using `prefix` key + - [versionIdMarker] {String} set the result to return from the version ID marker of the key marker object and sort by the versions + - [keyMarker] {String} search start from `keyMarker`, including `keyMarker` key + - [encodingType] {String} specifies that the returned content is encoded, and specifies the type of encoding + - [delimiter] {String} delimiter search scope + e.g. `/` only search current dir, not including subdir + - [maxKeys] {String|Number} max objects, default is `100`, limit to `1000` +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return objects list on `objects` properties. + +- objects {Array} object meta info list + Each `ObjectMeta` will contains blow properties: + - name {String} object name on oss + - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z` + - etag {String} object etag contains `"`, e.g.: `"5B3C1A2E053D763E1B002CC607C5A0FE"` + - type {String} object type, e.g.: `Normal` + - size {Number} object size, e.g.: `344606` + - isLatest {Boolean} + - versionId {String} object versionId + - storageClass {String} storage class type, e.g.: `Standard` + - owner {Object} object owner, including `id` and `displayName` + - restoreInfo {Object|undefined} The restoration status of the object + - ongoingRequest {Boolean} Whether the restoration is ongoing + - expireDate {Date|undefined} The time before which the restored object can be read +- deleteMarker {Array} object delete marker info list + Each `ObjectDeleteMarker` + - name {String} object name on oss + - lastModified {String} object last modified GMT date, e.g.: `2015-02-19T08:39:44.000Z` + - versionId {String} object versionId +- isTruncated {Boolean} truncate or not +- nextKeyMarker (nextMarker) {String} next marker string +- nextVersionIdMarker (NextVersionIdMarker) {String} next version ID marker string +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- View all versions of objects and deleteMarker of bucket + +```js +const result = await store.getBucketVersions(); +console.log(result.objects); +console.log(result.deleteMarker); +``` + +- List from key-marker + +```js +const result = await store.getBucketVersions({ + keyMarker: 'keyMarker' +}); +console.log(result.objects); +``` + +- List from the version-id-marker of key-marker + +```js +const result = await store.getBucketVersions({ + versionIdMarker: 'versionIdMarker', + keyMarker: 'keyMarker' +}); +console.log(result.objects); +console.log(result.deleteMarker); +``` + +### .signatureUrl(name[, options, strictObjectNameValidation]) + +Create a signature url for download or upload object. When you put object with signatureUrl ,you need to pass `Content-Type`.Please look at the example. + +parameters: + +- name {String} object name store on OSS +- [options] {Object} optional parameters + - [expires] {Number} after expires seconds, the url will become invalid, default is `1800` + - [method] {String} the HTTP method, default is 'GET' + - [Content-Type] {String} set the request content type + - [process] {String} image process params, will send with `x-oss-process` + e.g.: `{process: 'image/resize,w_200'}` + - [trafficLimit] {Number} traffic limit, range: `819200`~`838860800`. + - [subResource] {Object} additional signature parameters in url. + - [response] {Object} set the response headers for download + - [content-type] {String} set the response content type + - [content-disposition] {String} set the response content disposition + - [cache-control] {String} set the response cache control + - See more: + - [callback] {Object} set the callback for the operation + - url {String} set the url for callback + - [host] {String} set the host for callback + - body {String} set the body for callback + - [contentType] {String} set the type for body + - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client + - [customValue] {Object} set the custom value for callback,eg. {var1: value1,var2:value2} +- [strictObjectNameValidation] {boolean} the flag of verifying object name strictly, default is true + +Success will return signature url. + +example: + +- Get signature url for object + +```js +const url = store.signatureUrl('ossdemo.txt'); +console.log(url); +// -------------------------------------------------- +const url = store.signatureUrl('ossdemo.txt', { + expires: 3600, + method: 'PUT' +}); +console.log(url); + +// put object with signatureUrl +// ------------------------------------------------- + +const url = store.signatureUrl('ossdemo.txt', { + expires: 3600, + method: 'PUT', + 'Content-Type': 'text/plain; charset=UTF-8' +}); +console.log(url); + +// -------------------------------------------------- +const url = store.signatureUrl( + 'ossdemo.txt', + { + expires: 3600, + response: { + 'content-type': 'text/custom', + 'content-disposition': 'attachment' + } + }, + false +); +console.log(url); + +// put operation +``` + +- Get a signature url for a processed image + +```js +const url = store.signatureUrl('ossdemo.png', { + process: 'image/resize,w_200' +}); +console.log(url); +// -------------------------------------------------- +const url = store.signatureUrl('ossdemo.png', { + expires: 3600, + process: 'image/resize,w_200' +}); +console.log(url); +``` + +### .asyncSignatureUrl(name[, options, strictObjectNameValidation]) + +Basically the same as signatureUrl, if refreshSTSToken is configured asyncSignatureUrl will refresh stsToken + +parameters: + +- name {String} object name store on OSS +- [options] {Object} optional parameters + - [expires] {Number} after expires seconds, the url will become invalid, default is `1800` + - [method] {String} the HTTP method, default is 'GET' + - [Content-Type] {String} set the request content type + - [process] {String} image process params, will send with `x-oss-process` + e.g.: `{process: 'image/resize,w_200'}` + - [trafficLimit] {Number} traffic limit, range: `819200`~`838860800`. + - [subResource] {Object} additional signature parameters in url. + - [response] {Object} set the response headers for download + - [content-type] {String} set the response content type + - [content-disposition] {String} set the response content disposition + - [cache-control] {String} set the response cache control + - See more: + - [callback] {Object} set the callback for the operation + - url {String} set the url for callback + - [host] {String} set the host for callback + - body {String} set the body for callback + - [contentType] {String} set the type for body + - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client + - [customValue] {Object} set the custom value for callback,eg. {var1: value1,var2:value2} +- [strictObjectNameValidation] {boolean} the flag of verifying object name strictly, default is true + +Success will return signature url. + +example: + +- Get signature url for object + +```js +const url = await store.asyncSignatureUrl('ossdemo.txt'); +console.log(url); +// -------------------------------------------------- +const url = await store.asyncSignatureUrl('ossdemo.txt', { + expires: 3600, + method: 'PUT' +}); +console.log(url); +// put object with signatureUrl +// ------------------------------------------------- +const url = await store.asyncSignatureUrl('ossdemo.txt', { + expires: 3600, + method: 'PUT', + 'Content-Type': 'text/plain; charset=UTF-8' +}); +console.log(url); +// -------------------------------------------------- +const url = await store.asyncSignatureUrl( + 'ossdemo.txt', + { + expires: 3600, + response: { + 'content-type': 'text/custom', + 'content-disposition': 'attachment' + } + }, + false +); +console.log(url); +// put operation +``` + +- Get a signature url for a processed image + +```js +const url = await store.asyncSignatureUrl('ossdemo.png', { + process: 'image/resize,w_200' +}); +console.log(url); +// -------------------------------------------------- +const url = await store.asyncSignatureUrl('ossdemo.png', { + expires: 3600, + process: 'image/resize,w_200' +}); +console.log(url); +``` + +### .signatureUrlV4(method, expires[, request, objectName, additionalHeaders]) + +Generate a signed URL for V4 of an OSS resource and share the URL to allow authorized third-party users to access the resource. + +parameters: + +- method {string} the HTTP method +- expires {number} the signed URL will expire after the set number of seconds +- [request] {Object} optional request parameters + - [headers] {Object} headers of http requests, please make sure these request headers are set during the actual request + - [queries] {Object} queries of the signed URL, please ensure that if the query only has key, the value is set to null +- [objectName] {string} object name +- [additionalHeaders] {string[]} the keys of the request headers that need to be calculated into the V4 signature, please ensure that these additional headers are included in the request headers + +Success will return signature url. + +example: + +```js +// GetObject +const getObjectUrl = await store.signatureUrlV4('GET', 60, undefined, 'your obejct name'); +console.log(getObjectUrl); +// -------------------------------------------------- +const getObjectUrl = await store.signatureUrlV4( + 'GET', + 60, + { + headers: { + 'Cache-Control': 'no-cache' + }, + queries: { + versionId: 'version ID of your object' + } + }, + 'your obejct name', + ['Cache-Control'] +); +console.log(getObjectUrl); + +// ------------------------------------------------- +// PutObject +const putObejctUrl = await store.signatureUrlV4('PUT', 60, undefined, 'your obejct name'); +console.log(putObejctUrl); +// -------------------------------------------------- +const putObejctUrl = await store.signatureUrlV4( + 'PUT', + 60, + { + headers: { + 'Content-Type': 'text/plain', + 'Content-MD5': 'xxx', + 'Content-Length': 1 + } + }, + 'your obejct name', + ['Content-Length'] +); +console.log(putObejctUrl); +``` + +### .putACL(name, acl[, options]) + +Set object's ACL. + +parameters: + +- name {String} object name +- acl {String} acl (private/public-read/public-read-write) +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [versionId] {String} the version id of history object + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Set an object's ACL + +```js +await store.putACL('ossdemo.txt', 'public-read'); +``` + +- Set an history object's ACL + +```js +const versionId = 'object versionId'; +await store.putACL('ossdemo.txt', 'public-read', { + versionId +}); +``` + +### .getACL(name[, options]) + +Get object's ACL. + +parameters: + +- name {String} object name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [versionId] {String} the version id of history object + +Success will return: + +- acl {String} acl settiongs string +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Get an object's ACL + +```js +const result = await store.getACL('ossdemo.txt'); +console.log(result.acl); +``` + +- Get an history object's ACL + +```js +const versionId = 'object versionId'; +const result = await store.getACL('ossdemo.txt', { versionId }); +console.log(result.acl); +``` + +### .restore(name[, options]) + +Restore Object. + +parameters: + +- name {String} object name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [versionId] {String} the version id of history object + - [type] {String} the default type is Archive + - [Days] {number} The duration within which the object remains in the restored state. The default value is 2. + - [JobParameters] {string} The container that stores the restoration priority. This parameter is valid only when you restore Cold Archive or Deep Cold Archive objects. The default value is Standard. + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +- Restore an Archive object + +```js +const result = await store.restore('ossdemo.txt'); +console.log(result.status); +``` + +- Restore a Cold Archive object + +```js +const result = await store.restore('ossdemo.txt', { type: 'ColdArchive' }); +console.log(result.status); +``` + +- Restore a Cold Archive object with Days + +```js +const result = await store.restore('ossdemo.txt', { type: 'ColdArchive', Days: 2 }); +console.log(result.status); +``` + +- Restore a Cold Archive object with Days and JobParameters +```js +const result = await store.restore('ossdemo.txt', { type: 'ColdArchive', Days: 2, JobParameters: 'Standard' }); +console.log(result.status); +``` + +- Restore a Deep Cold Archive object + +```js +const result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive' }); +console.log(result.status); +``` + +- Restore a Deep Cold Archive object with Days + +```js +const result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive', Days: 2 }); +console.log(result.status); +``` + +- Restore a Deep Cold Archive object with Days and JobParameters + +```js +const result = await store.restore('ossdemo.txt', { type: 'DeepColdArchive', Days: 2, JobParameters: 'Standard' }); +console.log(result.status); +``` + +- Restore an history object + +```js +const versionId = 'object versionId'; +const result = await store.restore('ossdemo.txt', { versionId }); +console.log(result.status); +``` + +### .putSymlink(name, targetName[, options]) + +PutSymlink + +parameters: + +- name {String} object name +- targetName {String} target object name +- [options] {Object} optional parameters + + - [storageClass] {String} the storage type include (Standard,IA,Archive) + - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string + - [headers] {Object} extra headers, detail see [PutSymlink](https://help.aliyun.com/document_detail/45126.html#title-x71-l2b-7i8) + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +```js +const options = { + storageClass: 'IA', + meta: { + uid: '1', + slus: 'test.html' + } +}; +const result = await store.putSymlink('ossdemo.txt', 'targetName', options); +console.log(result.res); +``` + +putSymlink multiversion + +```js +const options = { + storageClass: 'IA', + meta: { + uid: '1', + slus: 'test.html' + } +}; +const result = await store.putSymlink('ossdemo.txt', 'targetName', options); +console.log(result.res.headers['x-oss-version-id']); +``` + +### .getSymlink(name[, options]) + +GetSymlink + +parameters: + +- name {String} object name +- [options] {Object} optional parameters +- [versionId] {String} the version id of history object + +Success will return + +- targetName {String} target object name +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +example: + +```js +const result = await store.getSymlink('ossdemo.txt'); +console.log(result.targetName); +``` + +for history object + +```js +const versionId = 'object versionId'; +const result = await store.getSymlink('ossdemo.txt', { versionId }); +console.log(result.targetName); +``` + +### .initMultipartUpload(name[, options]) + +Before transmitting data in the Multipart Upload mode, +you must call the Initiate Multipart Upload interface to notify the OSS to initiate a Multipart Upload event. +The Initiate Multipart Upload interface returns a globally unique Upload ID created by the OSS server to identify this Multipart Upload event. + +parameters: + +- name {String} object name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [mime] Mime file type e.g.: application/octet-stream + - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string + - [headers] {Object} extra headers + - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache` + - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename` + - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip` + - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT` + - [x-oss-server-side-encryption] + Specify the server-side encryption algorithm used to upload each part of this object,Type: string, Valid value: AES256 `x-oss-server-side-encryption: AES256`
+ if use in browser you should be set cors expose header x-oss-server-side-encryption + - See more: [InitiateMultipartUpload](https://help.aliyun.com/document_detail/31992.html?#title-wh0-a2h-rur) + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - [x-oss-server-side-encryption] if set request header x-oss-server-side-encryption, will return + - size {Number} response size + - rt {Number} request total use time (ms) +- bucket {String} bucket name +- name {String} object name store on OSS +- uploadId {String} upload id, use for uploadPart, completeMultipart + +example: + +```js +const result = await store.initMultipartUpload('object'); +console.log(result); +``` + +### .uploadPart(name, uploadId, partNo, file, start, end[, options]) + +After initiating a Multipart Upload event, you can upload data in parts based on the specified object name and Upload ID. + +parameters: + +- name {String} object name +- uploadId {String} get by initMultipartUpload api +- partNo {Number} range is 1-10000, If this range is exceeded, OSS returns the InvalidArgument's error code. +- file {File|String} is File or FileName, the whole file
+ Multipart Upload requires that the size of any Part other than the last Part is greater than 100KB.
+ In Node you can use File or FileName, but in browser you only can use File. +- start {Number} part start bytes e.g: 102400 +- end {Number} part end bytes e.g: 204800 +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- name {String} object name store on OSS +- etag {String} object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" + +example: + +```js + const name = 'object'; + const result = await store.initMultipartUpload(name); + const uploadId = result.uploadId; + const file; //the data you want to upload, is a File or FileName(only in node) + //if file part is 10 + const partSize = 100 * 1024; + const fileSize = 10 * partSize;//you need to calculate + const dones = []; + for (let i = 1; i <= 10; i++) { + const start = partSize * (i -1); + const end = Math.min(start + partSize, fileSize); + const part = await store.uploadPart(name, uploadId, i, file, start, end); + dones.push({ + number: i, + etag: part.etag + }); + console.log(part); + } + + //end need to call completeMultipartUpload api +``` + +### .uploadPartCopy(name, uploadId, partNo, range, sourceData[, options]) + +Using Upload Part Copy, you can copy data from an existing object and upload a part of the data. +When copying a file larger than 1 GB, you must use the Upload Part Copy method. If you want to copy a file smaller than 1 GB, see Copy Object. + +parameters: + +- name {String} object name +- uploadId {String} get by initMultipartUpload api +- partNo {Number} range is 1-10000, If this range is exceeded, OSS returns the InvalidArgument's error code. +- range {String} Multipart Upload requires that the size of any Part other than the last Part is greater than 100KB, range value like `0-102400` +- sourceData {Object} + - sourceKey {String} the source object name + - sourceBucketName {String} the source bucket name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [versionId] {String} the version id of history object + - [headers] {Object} The following request header is used for the source objects specified by x-oss-copy-source. + - [x-oss-copy-source-if-match] default none
+ If the ETAG value of the source object is equal to the ETAG value provided by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message. + - [x-oss-copy-source-if-none-match] default none
+ If the source object has not been modified since the time specified by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message. + - [x-oss-copy-source-if-unmodified-since] default none
+ If the time specified by the received parameter is the same as or later than the modification time of the file, the system transfers the file normally, and returns 200 OK; otherwise, the system returns 412 Precondition Failed. + - [x-oss-copy-source-if-modified-since] default none
+ If the source object has been modified since the time specified by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message. + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- name {String} object name store on OSS +- etag {String} object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" + +example: + +```js +const name = 'object'; +const result = await store.initMultipartUpload(name); + +const partSize = 100 * 1024; //100kb +//if file part is 10 +for (let i = 1; i <= 10; i++) { + const start = partSize * (i - 1); + const end = Math.min(start + partSize, fileSize); + const range = start + '-' + (end - 1); + const part = await store.uploadPartCopy(name, result.uploadId, i, range, { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' + }); + console.log(part); +} + +//end need complete api +``` + +- use history object to uploadPartCopy + +```js +const versionId = 'object versionId'; +const name = 'object'; +const result = await store.initMultipartUpload(name); +const partSize = 100 * 1024; //100kb +//if file part is 10 +for (let i = 1; i <= 10; i++) { + const start = partSize * (i - 1); + const end = Math.min(start + partSize, fileSize); + const range = start + '-' + (end - 1); + const part = await store.uploadPartCopy( + name, + result.uploadId, + i, + range, + { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' + }, + { + versionId + } + ); + console.log(part); +} + +//end need complete api +``` + +### .completeMultipartUpload(name, uploadId, parts[, options]) + +After uploading all data parts, you must call the Complete Multipart Upload API to complete Multipart Upload for the entire file. + +parameters: + +- name {String} object name +- uploadId {String} get by initMultipartUpload api +- parts {Array} more part {Object} from uploadPartCopy, , each in the structure: + - number {Number} partNo + - etag {String} object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)
+ - url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL. + - [host] {String} The host header value for initiating callback requests. + - body {String} The value of the request body when a callback is initiated, for example, key=${key}&etag=${etag}&my_var=${x:my_var}. + - [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value. + - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client. + - [customValue] {Object} Custom parameters are a map of key-values
+ e.g.: + ```js + var customValue = { var1: 'value1', var2: 'value2' }; + ``` + - [headers] {Object} extra headers, detail see [CompleteMultipartUpload](https://help.aliyun.com/document_detail/31995.html?#title-nan-5y3-rjd) + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- bucket {String} bucket name +- name {String} object name store on OSS +- etag {String} object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" +- data {Object} callback server response data , sdk use JSON.parse() return + +example: + +```js + + //init multipart + const name = 'object'; + const result = await store.initMultipartUpload(name); + + //upload part + const file; //the data you want to upload, this example size is 10 * 100 * 1024 + const fileSize;//you need to calculate + const partSize = 100 * 1024;//100kb + const done = []; + //if file part is 10 + for (let i = 1; i <= 10; i++) { + const start = partSize * (i -1); + const end = Math.min(start + partSize, fileSize); + const data = file.slice(start, end); + const part = store.uploadPart(name, result.uploadId, i, data, 0, data.length); + console.log(part); + done.push({ + number: i, + etag: part.res.headers.etag + }); + } + + //complete + const completeData = await store.completeMultipartUpload(name, result.uploadId, done); + console.log(completeData); +``` + +### .multipartUpload(name, file[, options]) + +Upload file with [OSS multipart][oss-multipart].
+this function contains initMultipartUpload, uploadPart, completeMultipartUpload. +When you use multipartUpload api,if you encounter problems with ConnectionTimeoutError, you should handle ConnectionTimeoutError in your business code. How to resolve ConnectionTimeoutError, you can decrease `partSize` size 、 Increase `timeout` 、Retry request , +or give tips in your business code; + +parameters: + +- name {String} object name +- file {String|File(only support Browser)|Blob(only support Browser)|Buffer} file path or HTML5 Web File or web Blob or content buffer +- [options] {Object} optional args + - [parallel] {Number} the number of parts to be uploaded in parallel + - [partSize] {Number} the suggested size for each part, default `1024 * 1024`(1MB), minimum `100 * 1024`(100KB) + - [progress] {Function} function | async | Promise, the progress callback called after each + successful upload of one part, it will be given three parameters: + (percentage {Number}, checkpoint {Object}, res {Object}) + - [checkpoint] {Object} the checkpoint to resume upload, if this is + provided, it will continue the upload from where interrupted, + otherwise a new multipart upload will be created. + - file {File} The file object selected by the user, if the browser is restarted, it needs the user to manually trigger the settings + - name {String} object key + - fileSize {Number} file size + - partSize {Number} part size + - uploadId {String} upload id + - doneParts {Array} An array of pieces that have been completed, including the object structure as follows + - number {Number} part number + - etag {String} part etag + - [meta] {Object} user meta, will send with `x-oss-meta-` prefix string + - [mime] {String} custom mime , will send with `Content-Type` entity header + - [callback] {Object} The callback parameter is composed of a JSON string encoded in Base64,detail [see](https://www.alibabacloud.com/help/doc-detail/31989.htm)
+ - url {String} After a file is uploaded successfully, the OSS sends a callback request to this URL. + - [host] {String} The host header value for initiating callback requests. + - body {String} The value of the request body when a callback is initiated, for example, key=${key}&etag=${etag}&my_var=${x:my_var}. + - [contentType] {String} The Content-Type of the callback requests initiatiated, It supports application/x-www-form-urlencoded and application/json, and the former is the default value. + - [callbackSNI] {Boolean} Specifies whether OSS sends Server Name Indication (SNI) to the origin address specified by callbackUrl when a callback request is initiated from the client. + - [customValue] {Object} Custom parameters are a map of key-values
+ e.g.: + ```js + var customValue = { var1: 'value1', var2: 'value2' }; + ``` + - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html) + - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache` + - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename` + - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip` + - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT` + - **NOTE**: Some headers are [disabled in browser][disabled-browser-headers] + - [timeout] {Number} Milliseconds before a request is considered to be timed out + - [disabledMD5] {Boolean} default true, it just work in Browser. if false,it means that MD5 is automatically calculated for uploaded files. **_NOTE:_** Synchronous computing tasks will block the main process + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- bucket {String} bucket name +- name name {String} object name store on OSS +- etag {String} object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" +- data {Object} callback server response data, sdk use JSON.parse() return + +example: + +- Upload using multipart + +```js +const result = await store.multipartUpload('object', '/tmp/file'); +let savedCpt; +console.log(result); + +const result = await store.multipartUpload('object', '/tmp/file', { + parallel: 4, + partSize: 1024 * 1024, + progress: function (p, cpt, res) { + console.log(p); + savedCpt = cpt; + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + } +}); + +const result = await store.multipartUpload('object', '/tmp/file', { + checkpoint: savedCpt, + progress: function (p, cpt, res) { + //progress is generator + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + } +}); +``` + +- multipartUpload progress example + +```js +//async function +async function asyncProgress(p, cpt, res) { + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); +} + +const result1 = await store.multipartUpload('object', '/tmp/file', { + progress: asyncProgress +}); + +//function +function progress(p, cpt, res) { + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); +} + +const result2 = await store.multipartUpload('object', '/tmp/file', { + progress: progress +}); +``` + +- multipartUpload with abort + +> tips: abort multipartUpload support on node and browser + +```js +//start upload +let abortCheckpoint; +store.multipartUpload('object', '/tmp/file', { + progress: function (p, cpt, res) { + abortCheckpoint = cpt; + } +}).then(res => { + // do something +}).catch(err => { + //if abort will catch abort event + if (err.name === 'abort') { + // handle abort + console.log('error: ', err.message) + } +}); + +// abort +store.abortMultipartUpload(abortCheckpoint.name, abortCheckpoint.uploadId); +``` + +- multipartUpload with cancel + +> tips: cancel multipartUpload support on node and browser + +```js +//start upload +try { + const result = await store.multipartUpload('object', '/tmp/file', { + checkpoint: savedCpt, + progress: function (p, cpt, res) { + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + } + }); +} catch (err) { + //if cancel will catch cancel event + if (store.isCancel()) { + //do something + } +} + +//the other event to cancel, for example: click event +//to cancel upload must use the same client instance +store.cancel(); +``` + +- multipartUpload with capture `ConnectionTimeoutError` error + +```js +//start upload +try { + const result = await store.multipartUpload('object', '/tmp/file', { + checkpoint: savedCpt, + progress: function (p, cpt, res) { + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + } + }); +} catch (err) { + if (err.code === 'ConnectionTimeoutError') { + console.log('Woops,Woops ,timeout error!!!'); + // do ConnectionTimeoutError operation + } +} +``` + +### .multipartUploadCopy(name, sourceData[, options]) + +Copy file with [OSS multipart][oss-multipart].
+this function contains head, initMultipartUpload, uploadPartCopy, completeMultipartUpload.
+When copying a file larger than 1 GB, you should use the Upload Part Copy method. If you want to copy a file smaller than 1 GB, see Copy Object. + +parameters: + +- name {String} object name +- file {String|File} file path or HTML5 Web File +- [options] {Object} optional args + - [timeout] {Number} Milliseconds before a request is considered to be timed out + - [parallel] {Number} the number of parts to be uploaded in parallel + - [partSize] {Number} the suggested size for each part, defalut `1024 * 1024`(1MB), minimum `100 * 1024`(100KB) + - [versionId] {String} the version id of history object + - [progress] {Function} function | async | Promise, the progress callback called after each + successful upload of one part, it will be given three parameters: + (percentage {Number}, checkpoint {Object}, res {Object}) + - [checkpoint] {Object} the checkpoint to resume upload, if this is + provided, it will continue the upload from where interrupted, + otherwise a new multipart upload will be created. + - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html) + - 'Cache-Control' cache control for download, e.g.: `Cache-Control: public, no-cache` + - 'Content-Disposition' object name for download, e.g.: `Content-Disposition: somename` + - 'Content-Encoding' object content encoding for download, e.g.: `Content-Encoding: gzip` + - 'Expires' expires time for download, an absolute date and time. e.g.: `Tue, 08 Dec 2020 13:49:43 GMT` + - **NOTE**: Some headers are [disabled in browser][disabled-browser-headers] + - [copyheaders] {Object} only uploadPartCopy api used, detail [see](https://www.alibabacloud.com/help/doc-detail/31994.htm) + - [x-oss-copy-source-if-match] only uploadPartCopy api used, default none
+ If the ETAG value of the source object is equal to the ETAG value provided by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message. + - [x-oss-copy-source-if-none-match] only uploadPartCopy api used, default none
+ If the source object has not been modified since the time specified by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message. + - [x-oss-copy-source-if-unmodified-since] only uploadPartCopy api used, default none
+ If the time specified by the received parameter is the same as or later than the modification time of the file, the system transfers the file normally, and returns 200 OK; otherwise, the system returns 412 Precondition Failed. + - [x-oss-copy-source-if-modified-since] only uploadPartCopy api used, default none
+ If the source object has been modified since the time specified by the user, the system performs the Copy Object operation; otherwise, the system returns the 412 Precondition Failed message. + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- bucket {String} bucket name +- name name {String} object name store on OSS +- etag {String} object etag contains ", e.g.: "5B3C1A2E053D763E1B002CC607C5A0FE" + +example: + +- Copy using multipart + +```js +const result = await store.multipartUploadCopy('object', { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' +}); +let savedCpt; +console.log(result); + +const result = await store.multipartUploadCopy( + 'object', + { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' + }, + { + parallel: 4, + partSize: 1024 * 1024, + progress: function (p, cpt, res) { + console.log(p); + savedCpt = cpt; + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + } + } +); + +console.log(result); + +const result = await store.multipartUploadCopy( + 'object', + { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' + }, + { + checkpoint: savedCpt, + progress: function (p, cpt, res) { + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + } + } +); + +console.log(result); +``` + +- multipartUploadCopy with abort + +```js +// start upload +let abortCheckpoint; +store.multipartUploadCopy('object', { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' + }, { + progress: function (p, cpt, res) { + abortCheckpoint = cpt; + } +}).then(res => { + // do something +}).catch(err => { + //if abort will catch abort event + if (err.name === 'abort') { + // handle abort + console.log('error: ', err.message) + } +}); + +// the other event to abort, for example: click event +// to abort upload must use the same client instance +store.abortMultipartUpload(abortCheckpoint.name, abortCheckpoint.uploadId); +``` + +- multipartUploadCopy with cancel + +```js +//start upload +try { + const result = await store.multipartUploadCopy( + 'object', + { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' + }, + { + checkpoint: savedCpt, + progress: function (p, cpt, res) { + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + } + } + ); +} catch (err) { + //if cancel will catch cancel event + if (store.isCancel()) { + //do something + } +} + +//the other event to cancel, for example: click event +//to cancel upload must use the same client instance +store.cancel(); +``` + +- multipartUploadCopy with versionId + +```js +const versionId = 'object versionId'; +//start upload +const result = await store.multipartUploadCopy( + 'object', + { + sourceKey: 'sourceKey', + sourceBucketName: 'sourceBucketName' + }, + { + checkpoint: savedCpt, + progress: function (p, cpt, res) { + console.log(p); + console.log(cpt); + console.log(res.headers['x-oss-request-id']); + }, + versionId + } +); +``` + +### .listParts(name, uploadId[, query, options]) + +The ListParts command can be used to list all successfully uploaded parts mapped to a specific upload ID, i.e.: those not completed and not +aborted. + +parameters: + +- name {String} object key +- uploadId {String} upload ID from initMultipartUpload api +- [query] {Object} query parameters + - [max-parts] {Number} The maximum part number in the response of the OSS. default value: 1000. + - [part-number-marker] {Number} Starting position of a specific list. A part is listed only when the part number is greater than the value of this parameter. + - [encoding-type] {String} Specify the encoding of the returned content and the encoding type. Optional value: url +- [options] {Object} optional args + - [timeout] {Number} the operation timeout + +Success will return: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- uploadId {String} upload ID +- bucket {String} Specify the bucket name. +- name {String} object name +- PartNumberMarker {Number} Starting position of the part numbers in the listing result. +- nextPartNumberMarker {Number} If not all results are returned this time, the response request includes the NextPartNumberMarker element to indicate the value of PartNumberMarker in the next request. +- maxParts {Number} upload ID +- isTruncated {Boolean} Whether the returned result list for List Parts is truncated. The “true” indicates that not all results are returned; “false” indicates that all results are returned. +- parts {Array} The container that saves part information, each in the structure: + - PartNumber {Number} Part number. + - LastModified {Date} Time when a part is uploaded. + - ETag {String} ETag value in the content of the uploaded part. + - Size {Number} Size of the uploaded part. + +example: + +- List uploaded part + +```js +const result = await store.listParts('objcet', 'uploadId', { + 'max-parts': 1000 +}); +console.log(result); +``` + +### .listUploads(query[, options]) + +List on-going multipart uploads, i.e.: those not completed and not +aborted. + +parameters: + +- query {Object} query parameters + - [prefix] {String} the object key prefix + - [max-uploads] {Number} the max uploads to return + - [key-marker] {String} the object key marker, if `upload-id-marker` + is not provided, return uploads with `key > marker`, otherwise + return uploads with `key >= marker && uploadId > id-marker` + - [upload-id-marker] {String} the upload id marker, must be used + **WITH** `key-marker` +- [options] {Object} optional args + - [timeout] {Number} the operation timeout + +example: + +- List on-going multipart uploads + +```js +const result = await store.listUploads({ + 'max-uploads': 100, + 'key-marker': 'my-object', + 'upload-id-marker': 'upload-id' +}); +console.log(result); +``` + +### .abortMultipartUpload(name, uploadId[, options]) + +Abort a multipart upload for object. + +parameters: + +- name {String} the object name +- uploadId {String} the upload id +- [options] {Object} optional args + - [timeout] {Number} the operation timeout + +example: + +- Abort a multipart upload + +```js +const result = await store.abortMultipartUpload('object', 'upload-id'); +console.log(result); +``` + +### .calculatePostSignature(policy) + +get postObject params + +parameters: + +- policy {JSON or Object} policy must contain expiration and conditions. + +Success will return postObject Api params. + +Object: + +- OSSAccessKeyId {String} +- Signature {String} +- policy {Object} response info + +### .signPostObjectPolicyV4(policy, date) + +Get a V4 signature of the PostObject request. + +parameters: + +- policy {string | Object} The policy form field in a PostObject request is used to specify the expiration time and conditions of the PostObject request that you initiate to upload an object by using an HTML form. The value of the policy form field is a JSON string or an object. +- date {Date} The time when the request was initiated. + +Success will return a V4 signature of the PostObject request. + +example: + +```js +const axios = require('axios'); +const dateFormat = require('dateformat'); +const FormData = require('form-data'); +const { getCredential } = require('ali-oss/lib/common/signUtils'); +const { getStandardRegion } = require('ali-oss/lib/common/utils/getStandardRegion'); +const { policy2Str } = require('ali-oss/lib/common/utils/policy2Str'); +const OSS = require('ali-oss'); + +const client = new OSS({ + accessKeyId: 'yourAccessKeyId', + accessKeySecret: 'yourAccessKeySecret', + stsToken: 'yourSecurityToken', + bucket: 'yourBucket', + region: 'oss-cn-hangzhou' +}); +const name = 'yourObjectName'; +const formData = new FormData(); +formData.append('key', name); +formData.append('Content-Type', 'yourObjectContentType'); +// your object cache control +formData.append('Cache-Control', 'max-age=30'); +const url = client.generateObjectUrl(name).replace(name, ''); +const date = new Date(); +// The expiration parameter specifies the expiration time of the request. +const expirationDate = new Date(date); +expirationDate.setMinutes(date.getMinutes() + 1); +// The time must follow the ISO 8601 standard +const formattedDate = dateFormat(date, "UTC:yyyymmdd'T'HHMMss'Z'"); +const credential = getCredential(formattedDate.split('T')[0], getStandardRegion(client.options.region), client.options.accessKeyId); +formData.append('x-oss-date', formattedDate); +formData.append('x-oss-credential', credential); +formData.append('x-oss-signature-version', 'OSS4-HMAC-SHA256'); +const policy = { + expiration: expirationDate.toISOString(), + conditions: [ + { bucket: client.options.bucket }, + {'x-oss-credential': credential}, + {'x-oss-date': formattedDate}, + {'x-oss-signature-version': 'OSS4-HMAC-SHA256'}, + ['content-length-range', 1, 10], + ['eq', '$success_action_status', '200'], + ['starts-with', '$key', 'yourObjectName'], + ['in', '$content-type', ['image/jpg', 'text/plain']], + ['not-in', '$cache-control', ['no-cache']] + ] +}; + +if (client.options.stsToken) { + policy.conditions.push({'x-oss-security-token': client.options.stsToken}); + formData.append('x-oss-security-token', client.options.stsToken); +} + +const signature = client.signPostObjectPolicyV4(policy, date); +formData.append('policy', Buffer.from(policy2Str(policy), 'utf8').toString('base64')); +formData.append('x-oss-signature', signature); +formData.append('success_action_status', '200'); +formData.append('file', 'yourFileContent'); + +axios.post(url, formData, { + headers: { + 'Content-Type': 'multipart/form-data' + } +}).then((result) => { + console.log(result.status); +}).catch((e) => { + console.log(e); +}); +``` + +### .getObjectTagging(name[, options]) + +Obtains the tags of an object. + +parameters: + +- name {String} the object name +- [options] {Object} optional args + - [versionId] {String} the version id of history object + +Success will return the channel information. + +object: + +- tag {Object} the tag of object +- res {Object} response info + +### .putObjectTagging(name, tag[, options]) + +Configures or updates the tags of an object. + +parameters: + +- name {String} the object name +- tag {Object} tag, eg. `{var1: value1,var2:value2}` +- [options] {Object} optional args + - [versionId] {String} the version id of history object + +Success will return the channel information. + +object: + +- status {Number} response status +- res {Object} response info + +### .deleteObjectTagging(name[, options]) + +Deletes the tag of a specified object. + +parameters: + +- name {String} the object name +- tag {Object} tag, eg. `{var1: value1,var2:value2}` +- [options] {Object} optional args + - [versionId] {String} the version id of history object + +Success will return the channel information. + +object: + +- status {Number} response status +- res {Object} response info + +### .processObjectSave(sourceObject, targetObject, process[, targetBucket]) + +Persistency indicates that images are asynchronously stored in the specified Bucket + +parameters: + +- sourceObject {String} source object name +- targetObject {String} target object name +- process {String} process string +- [targetBucket] {String} target bucket + +Success will return the channel information. + +object: + +- status {Number} response status +- res {Object} response info + +```js +const sourceObject = 'a.png'; +const targetObject = 'b.png'; +const process = 'image/watermark,text_aGVsbG8g5Zu+54mH5pyN5Yqh77yB,color_ff6a00'; + +await this.store.processObjectSave(sourceObject, targetObject, process); +``` + +## RTMP Operations + +All operations function is [async], except `getRtmpUrl`. + +async function format: `async functionName(...)`. + +### .putChannel(id, conf[, options]) + +Create a live channel. + +parameters: + +- id {String} the channel id +- conf {Object} the channel config + - [Description] {String} the channel description + - [Status] {String} the channel status: 'enabled' or 'disabled' + - [Target] {Object} + - [Type] {String} the data type for the channel, only 'HLS' is supported now + - [FragDuration] {Number} duration of a 'ts' segment + - [FragCount] {Number} the number of 'ts' segments in a 'm3u8' + - [PlaylistName] {String} the 'm3u8' name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the channel information. + +object: + +- publishUrls {Array} the publish urls +- playUrls {Array} the play urls +- res {Object} response info + +example: + +- Create a live channel + +```js +const cid = 'my-channel'; +const conf = { + Description: 'this is channel 1', + Status: 'enabled', + Target: { + Type: 'HLS', + FragDuration: '10', + FragCount: '5', + PlaylistName: 'playlist.m3u8' + } +}; + +const r = await this.store.putChannel(cid, conf); +console.log(r); +``` + +### .getChannel(id[, options]) + +Get live channel info. + +parameters: + +- id {String} the channel id +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the channel information. + +object: + +- data {Object} channel info, same as conf in [.putChannel](#putchannelid-conf-options) +- res {Object} response info + +example: + +- Get live channel info + +```js +const cid = 'my-channel'; + +const r = await this.store.getChannel(cid); +console.log(r); +``` + +### .deleteChannel(id[, options]) + +Delete a live channel. + +parameters: + +- id {String} the channel id +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the response infomation. + +object: + +- res {Object} response info + +example: + +- Delete a live channel + +```js +const cid = 'my-channel'; + +const r = await this.store.deleteChannel(cid); +console.log(r); +``` + +### .putChannelStatus(id, status[, options]) + +Change the live channel status. + +parameters: + +- id {String} the channel id +- status {String} the status: 'enabled' or 'disabled' +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the response information. + +object: + +- res {Object} response info + +example: + +- Disable a live channel + +```js +const cid = 'my-channel'; + +const r = await this.store.putChannelStatus(cid, 'disabled'); +console.log(r); +``` + +### .getChannelStatus(id[, options]) + +Get the live channel status. + +parameters: + +- id {String} the channel id +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the channel status information. + +object: + +- data {Object} + - Status {String} the channel status: 'Live' or 'Idle' + - [ConnectedTime] {String} the connected time of rtmp pushing + - [RemoteAddr] {String} the remote addr of rtmp pushing + - [Video] {Object} the video parameters (Width/Height/FrameRate/Bandwidth/Codec) + - [Audio] {Object} the audio parameters (Bandwidth/SampleRate/Codec) +- res {Object} response info + +example: + +- Get a live channel status + +```js +const cid = 'my-channel'; + +const r = await this.store.getChannelStatus(cid); +console.log(r); + +// { Status: 'Live', +// ConnectedTime: '2016-04-12T11:51:03.000Z', +// RemoteAddr: '42.120.74.98:53931', +// Video: +// { Width: '672', +// Height: '378', +// FrameRate: '29', +// Bandwidth: '60951', +// Codec: 'H264' }, +// Audio: { Bandwidth: '5959', SampleRate: '22050', Codec: 'AAC' } +// } +``` + +### .listChannels(query[, options]) + +List channels. + +parameters: + +- query {Object} parameters for list + - prefix {String}: the channel id prefix (returns channels with this prefix) + - marker {String}: the channle id marker (returns channels after this id) + - max-keys {Number}: max number of channels to return +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the channel list. + +object: + +- channels {Array} the channels, each in the structure: + - Name {String} the channel id + - Description {String} the channel description + - Status {String} the channel status + - LastModified {String} the last modification time of the channel + - PublishUrls {Array} the publish urls for the channel + - PlayUrls {Array} the play urls for the channel +- nextMarker: result.data.NextMarker || null, +- isTruncated: result.data.IsTruncated === 'true' +- res {Object} response info + +example: + +- List live channels + +```js +const r = await this.store.listChannels({ + prefix: 'my-channel', + 'max-keys': 3 +}); +console.log(r); +``` + +### .getChannelHistory(id[, options]) + +Get the live channel history. + +parameters: + +- id {String} the channel id +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the history information. + +object: + +- records {Object} the pushing records, each in the structure: + - StartTime {String} the start time + - EndTime {String} the end time + - RemoteAddr {String} the remote addr +- res {Object} response info + +example: + +- Get the live channel history + +```js +const cid = 'my-channel'; + +const r = await this.store.getChannelHistory(cid); +console.log(r); +``` + +### .createVod(id, name, time[, options]) + +Create a VOD playlist for the channel. + +parameters: + +- id {String} the channel id +- name {String} the playlist name +- time {Object} the duration time + - startTime {Number} the start time in epoch seconds + - endTime {Number} the end time in epoch seconds +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the response information. + +object: + +- res {Object} response info + +example: + +- Create a vod playlist of a live channel + +```js +const cid = 'my-channel'; + +const r = await this.store.createVod(cid, 're-play', { + startTime: 1460464870, + endTime: 1460465877 +}); +console.log(r); +``` + +### .getRtmpUrl(channelId[, options]) + +Get signatured rtmp url for publishing. + +parameters: + +- channelId {String} the channel id +- [options] {Object} optional parameters + - [expires] {Number} the expire time in seconds of the url + - [params] {Object} the additional paramters for url, e.g.: {playlistName: 'play.m3u8'} + - [timeout] {Number} the operation timeout + +Success will return the rtmp url. + +example: + +- Get a rtmp url. + +```js +const cid = 'my-channel'; + +const url = this.store.getRtmpUrl(this.cid, { + params: { + playlistName: 'play.m3u8' + }, + expires: 3600 +}); +console.log(url); +// rtmp://ossliveshow.oss-cn-hangzhou.aliyuncs.com/live/tl-channel?OSSAccessKeyId=T0cqQWBk2ThfRS6m&Expires=1460466188&Signature=%2BnzTtpyxUWDuQn924jdS6b51vT8%3D +``` + +## Create A Image Service Instance + +Each Image Service instance required `accessKeyId`, `accessKeySecret`, `bucket` and `imageHost`. + +### oss.ImageClient(options) + +Create a Image service instance. + +options: + +- imageHost {String} your image service domain that binding to a OSS bucket +- accessKeyId {String} access key you create on aliyun console website +- accessKeySecret {String} access secret you create +- bucket {String} the default bucket you want to access + If you don't have any bucket, please use `putBucket()` create one first. +- [region] {String} the bucket data region location, please see [Data Regions](#data-regions), + default is `oss-cn-hangzhou` + Current available: `oss-cn-hangzhou`, `oss-cn-qingdao`, `oss-cn-beijing`, `oss-cn-hongkong` and `oss-cn-shenzhen` +- [internal] {Boolean} access OSS with aliyun internal network or not, default is `false` + If your servers are running on aliyun too, you can set `true` to save lot of money. +- [timeout] {String|Number} instance level timeout for all operations, default is `60s` + +example: + +```js +const oss = require('ali-oss'); + +const imgClient = oss.ImageClient({ + accessKeyId: 'your access key', + accessKeySecret: 'your access secret', + bucket: 'my_image_bucket', + imageHost: 'thumbnail.myimageservice.com' +}); +``` + +## Image Operations + +All operations function is [async], except `imgClient.signatureUrl`. + +async function format: `async functionName(...)`. + +### imgClient.get(name, file[, options]) + +Get an image from the image channel. + +parameters: + +- name {String} image object name with operation style store on OSS +- [file] {String|WriteStream} file path or WriteStream instance to store the image + If `file` is null or ignore this parameter, function will return info contains `content` property. +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [headers] {Object} extra headers, detail see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616.html) + - 'If-Modified-Since' object modified after this time will return 200 and object meta, + otherwise return 304 not modified + - 'If-Unmodified-Since' object modified before this time will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-Match' object etag equal this will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-None-Match' object etag not equal this will return 200 and object meta, + otherwise return 304 not modified + +Success will return the info contains response. + +object: + +- [content] {Buffer} file content buffer if `file` parameter is null or ignore +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +If object not exists, will throw NoSuchKeyError. + +example: + +- Get an exists image with a style and store it to the local file + +```js +const imagepath = '/home/ossdemo/demo.jpg'; +await imgClient.get('ossdemo/demo.jpg@200w_200h', filepath); +``` + +\_ Store image to a writestream + +```js +await imgClient.get('ossdemo/demo.jpg@200w_200h', somestream); +``` + +- Get an image content buffer + +```js +const result = await imgClient.get('ossdemo/demo.jpg@200w_200h'); +console.log(Buffer.isBuffer(result.content)); +``` + +- Get a not exists object or a not image object + +```js +const imagepath = '/home/ossdemo/demo.jpg'; +await imgClient.get('ossdemo/not-exists-demo.jpg@200w_200h', filepath); +// will throw NoSuchKeyError +``` + +### imgClient.getStream(name[, options]) + +Get an image read stream. + +parameters: + +- name {String} image object name with operation style store on OSS +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + - [headers] {Object} extra headers + - 'If-Modified-Since' object modified after this time will return 200 and object meta, + otherwise return 304 not modified + - 'If-Unmodified-Since' object modified before this time will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-Match' object etag equal this will return 200 and object meta, + otherwise throw PreconditionFailedError + - 'If-None-Match' object etag not equal this will return 200 and object meta, + otherwise return 304 not modified + +Success will return the stream instance and response info. + +object: + +- stream {ReadStream} readable stream instance. If response status is not `200`, stream will be `null`. +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) + +If object not exists, will throw NoSuchKeyError. + +example: + +- Get an exists image object stream + +```js +const result = await imgClient.getStream('ossdemo/demo.jpg@200w_200h'); +result.stream.pipe(fs.createWriteStream('some demo.jpg')); +``` + +### imgClient.getExif(name[, options]) + +Get a image exif info by image object name from the image channel. + +parameters: + +- name {String} image object name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the info contains response. + +object: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- data {Object} image exif object + +If object don't have exif, will throw 400 BadRequest. + +example: + +```js +const result = await imgClient.getExif('demo.jpg'); +// resut: +// { +// res: { +// status: 200, +// statusCode: 200, +// headers: { +// server: "Tengine", +// content - type: "application/json", +// content - length: "148", +// connection: "keep-alive", +// date: "Tue, 31 Mar 2015 11:06:32 GMT", +// "last-modified": "Mon, 30 Mar 2015 10:46:35 GMT" +// }, +// size: 148, +// aborted: false, +// rt: 461, +// keepAliveSocket: false +// }, +// data: { +// FileSize: 343683, +// ImageHeight: 1200, +// ImageWidth: 1600, +// Orientation: 1 +// } +// } +``` + +### imgClient.getInfo(name[, options]) + +Get a image info and exif info by image object name from the image channel. + +parameters: + +- name {String} image object name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the info contains response. + +object: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- data {Object} image exif object + +example: + +```js +const result = await imgClient.getInfo('demo.jpg'); +// resut: +// { +// res: { +// status: 200, +// statusCode: 200, +// headers: { +// server: "Tengine", +// content - type: "application/json", +// content - length: "148", +// connection: "keep-alive", +// date: "Tue, 31 Mar 2015 11:06:32 GMT", +// "last-modified": "Mon, 30 Mar 2015 10:46:35 GMT" +// }, +// size: 148, +// aborted: false, +// rt: 461, +// keepAliveSocket: false +// }, +// data: { +// FileSize: 343683, +// Format: "jpg", +// ImageHeight: 1200, +// ImageWidth: 1600, +// Orientation: 1 +// } +// } +``` + +### imgClient.putStyle(name, style[, options]) + +// TODO + +### imgClient.getStyle(name[, options]) + +Get a style by name from the image channel. + +parameters: + +- name {String} image style name +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the info contains response. + +object: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- data {Object} styles object + - Name {String} style name + - Content {String} style content + - CreateTime {String} style create time + - LastModifyTime {String} style last modify time + +example: + +```js +const result = await imgClient.getStyle('400'); +// resut: +// { +// res: { +// status: 200, +// statusCode: 200, +// headers: { +// server: "Tengine", +// content - type: "application/xml", +// content - length: "234", +// connection: "keep-alive", +// date: "Tue, 31 Mar 2015 10:58:20 GMT" +// }, +// size: 234, +// aborted: false, +// rt: 398, +// keepAliveSocket: false +// }, +// data: { +// Name: "400", +// Content: "400w_90Q_1x.jpg", +// CreateTime: "Thu, 19 Mar 2015 08:34:21 GMT", +// LastModifyTime: "Thu, 19 Mar 2015 08:34:21 GMT" +// } +// } +``` + +### imgClient.listStyle([options]) + +Get all styles from the image channel. + +parameters: + +- [options] {Object} optional parameters + - [timeout] {Number} the operation timeout + +Success will return the info contains response. + +object: + +- res {Object} response info, including + - status {Number} response status + - headers {Object} response headers + - size {Number} response size + - rt {Number} request total use time (ms) +- data {Array} styles array, a style object: + - Name {String} style name + - Content {String} style content + - CreateTime {String} style create time + - LastModifyTime {String} style last modify time + +example: + +```js +const result = await imgClient.listStyle(); +// resut: +// { +// res: { +// status: 200, +// statusCode: 200, +// headers: { +// server: "Tengine", +// content - type: "application/xml", +// content - length: "913", +// connection: "keep-alive", +// date: "Tue, 31 Mar 2015 10:47:32 GMT" +// }, +// size: 913, +// aborted: false, +// rt: 1911, +// keepAliveSocket: false +// }, +// data: [{ +// Name: "200-200", +// Content: "0e_200w_200h_0c_0i_0o_90Q_1x.jpg", +// CreateTime: "Thu, 19 Mar 2015 08:28:08 GMT", +// LastModifyTime: "Thu, 19 Mar 2015 08:28:08 GMT" +// }, { +// Name: "800", +// Content: "800w_90Q_1x.jpg", +// CreateTime: "Thu, 19 Mar 2015 08:29:15 GMT", +// LastModifyTime: "Thu, 19 Mar 2015 08:29:15 GMT" +// }, { +// Name: "400", +// Content: "400w_90Q_1x.jpg", +// CreateTime: "Thu, 19 Mar 2015 08:34:21 GMT", +// LastModifyTime: "Thu, 19 Mar 2015 08:34:21 GMT" +// }, { +// Name: "600", +// Content: "600w_90Q_1x.jpg", +// CreateTime: "Thu, 19 Mar 2015 08:35:02 GMT", +// LastModifyTime: "Thu, 19 Mar 2015 08:35:02 GMT" +// }] +// } +``` + +### imgClient.deleteStyle(name[, options]) + +// TODO + +### imgClient.signatureUrl(name) + +Create a signature url for directly download. + +parameters: + +- name {String} image object name with operation style store on OSS +- [options] {Object} optional parameters + - [expires] {Number} after expires seconds, the url will become invalid, default is `1800` + - [timeout] {Number} the operation timeout + +Success will return full signature url. + +example: + +```js +const url = imgClient.signatureUrl('name'); +``` + +## Cluster Mode + +Cluster mode now only support object operations. + +```js +const Cluster = require('ali-oss').ClusterClient; + +const client = Cluster({ + cluster: [ + { + host: 'host1', + accessKeyId: 'id1', + accessKeySecret: 'secret1' + }, + { + host: 'host2', + accessKeyId: 'id2', + accessKeySecret: 'secret2' + } + ], + schedule: 'masterSlave' //default is `roundRobin` +}); + +// listen error event to logging error +client.on('error', function (err) { + console.error(err.stack); +}); + +// client init ready +client.ready(function () { + console.log('cluster client init ready, go ahead!'); +}); +``` + +### Get Methods + +Will choose an alive client by schedule(`masterSlave` or `roundRobin`). + +- `client.get()` +- `client.head()` +- `client.getStream()` +- `client.list()` +- `client.signatureUrl()` +- `client.chooseAvailable()` - choose an available client by schedule. +- `client.getACL()` + +### Put Methods + +Will put to all clients. + +- `client.put()` +- `client.putStream()` +- `client.delete()` +- `client.deleteMulti()` +- `client.copy()` +- `client.putMeta()` +- `client.putACL()` +- `client.restore()` + +## Known Errors + +Each error return by OSS server will contains these properties: + +- name {String} error name +- message {String} error message +- requestId {String} uuid for this request, if you meet some unhandled problem, + you can send this request id to OSS engineer to find out what's happend. +- hostId {String} OSS cluster name for this request + +### ResponseTimeoutError + +The default timeout is 60 seconds. Please set the timeout as needed. The timeout unit is milliseconds. + +```javascript +client.get('example.txt', { timeout: 60000 * 2 }); + +client.get('example.txt', { headers: { Range: `bytes=0-${1024 * 1024 * 100}` } }); // Download the first 100MB +``` + +### ConnectionTimeoutError + +The network link timed out. Please check the network status. If there is no problem with the network, please reduce the partSize or increase the timeout. + +```javascript +const client = new OSS({ ak, sk, retryMax: 10 }); + +client.multipartUpload('example.txt', { timeout: 60000 * 2 }); + +client.multipartUpload('example.txt', { partSize: 1024 * 512 }); // partSize 512KB +``` + +### The following table lists the OSS error codes: + +[More code info](https://help.aliyun.com/knowledge_detail/32005.html) + +| name | code | status | message | message in Chinese | +| ---------------------------------------- | ----------------------------------- | ------ | ------------------------------------------------ | -------------------------------------- | +| AccessDeniedError | AccessDenied | 403 | Access Denied | 拒绝访问 | +| BucketAlreadyExistsError | BucketAlreadyExists | 409 | Bucket already exists | Bucket 已经存在 | +| BucketNotEmptyError | BucketNotEmpty | 409 | Bucket is not empty | Bucket 不为空 | +| RestoreAlreadyInProgressError | RestoreAlreadyInProgress | 409 | The restore operation is in progress. | restore 操作正在进行中 | +| OperationNotSupportedError | OperationNotSupported | 400 | The operation is not supported for this resource | 该资源暂不支持restore操作 | +| EntityTooLargeError | EntityTooLarge | 400 | Entity too large | 实体过大 | +| EntityTooSmallError | EntityTooSmall | 400 | Entity too small | 实体过小 | +| FileGroupTooLargeError | FileGroupTooLarge | 400 | File group too large | 文件组过大 | +| InvalidLinkNameError | InvalidLinkName | 400 | Link name can't be the same as the object name | Object Link 与指向的 Object 同名 | +| LinkPartNotExistError | LinkPartNotExist | 400 | Can't link to not exists object | Object Link 中指向的 Object 不存在 | +| ObjectLinkTooLargeError | ObjectLinkTooLarge | 400 | Too many links to this object | Object Link 中 Object 个数过多 | +| FieldItemTooLongError | FieldItemTooLong | 400 | Post form fields items too large | Post 请求中表单域过大 | +| FilePartInterityError | FilePartInterity | 400 | File part has changed | 文件 Part 已改变 | +| FilePartNotExistError | FilePartNotExist | 400 | File part not exists | 文件 Part 不存在 | +| FilePartStaleError | FilePartStale | 400 | File part stale | 文件 Part 过时 | +| IncorrectNumberOfFilesInPOSTRequestError | IncorrectNumberOfFilesInPOSTRequest | 400 | Post request contains invalid number of files | Post 请求中文件个数非法 | +| InvalidArgumentError | InvalidArgument | 400 | Invalid format argument | 参数格式错误 | +| InvalidAccessKeyIdError | InvalidAccessKeyId | 400 | Access key id not exists | Access Key ID 不存在 | +| InvalidBucketNameError | InvalidBucketName | 400 | Invalid bucket name | 无效的 Bucket 名字 | +| InvalidDigestError | InvalidDigest | 400 | Invalid digest | 无效的摘要 | +| InvalidEncryptionAlgorithmError | InvalidEncryptionAlgorithm | 400 | Invalid encryption algorithm | 指定的熵编码加密算法错误 | +| InvalidObjectNameError | InvalidObjectName | 400 | Invalid object name | 无效的 Object 名字 | +| InvalidPartError | InvalidPart | 400 | Invalid part | 无效的 Part | +| InvalidPartOrderError | InvalidPartOrder | 400 | Invalid part order | 无效的 part 顺序 | +| InvalidPolicyDocumentError | InvalidPolicyDocument | 400 | Invalid policy document | 无效的 Policy 文档 | +| InvalidTargetBucketForLoggingError | InvalidTargetBucketForLogging | 400 | Invalid bucket on logging operation | Logging 操作中有无效的目标 bucket | +| InternalError | Internal | 500 | OSS server internal error | OSS 内部发生错误 | +| MalformedXMLError | MalformedXML | 400 | Malformed XML format | XML 格式非法 | +| MalformedPOSTRequestError | MalformedPOSTRequest | 400 | Invalid post body format | Post 请求的 body 格式非法 | +| MaxPOSTPreDataLengthExceededError | MaxPOSTPreDataLengthExceeded | 400 | Post extra data too large | Post 请求上传文件内容之外的 body 过大 | +| MethodNotAllowedError | MethodNotAllowed | 405 | Not allowed method | 不支持的方法 | +| MissingArgumentError | MissingArgument | 411 | Missing argument | 缺少参数 | +| MissingContentLengthError | MissingContentLength | 411 | Missing `Content-Length` header | 缺少内容长度 | +| NoSuchBucketError | NoSuchBucket | 404 | Bucket not exists | Bucket 不存在 | +| NoSuchKeyError | NoSuchKey | 404 | Object not exists | 文件不存在 | +| NoSuchUploadError | NoSuchUpload | 404 | Multipart upload id not exists | Multipart Upload ID 不存在 | +| NotImplementedError | NotImplemented | 501 | Not implemented | 无法处理的方法 | +| PreconditionFailedError | PreconditionFailed | 412 | Pre condition failed | 预处理错误 | +| RequestTimeTooSkewedError | RequestTimeTooSkewed | 403 | Request time exceeds 15 minutes to server time | 发起请求的时间和服务器时间超出 15 分钟 | +| RequestTimeoutError | RequestTimeout | 400 | Request timeout | 请求超时 | +| RequestIsNotMultiPartContentError | RequestIsNotMultiPartContent | 400 | Invalid post content-type | Post 请求 content-type 非法 | +| SignatureDoesNotMatchError | SignatureDoesNotMatch | 403 | Invalid signature | 签名错误 | +| TooManyBucketsError | TooManyBuckets | 400 | Too many buckets on this user | 用户的 Bucket 数目超过限制 | +| RequestError | RequestError | -1 | network error | 网络出现中断或异常 | +| ConnectionTimeoutError | ConnectionTimeoutError | -2 | request connect timeout | 请求连接超时 | +| SecurityTokenExpiredError | SecurityTokenExpired | 403 | sts Security Token Expired | sts Security Token 超时失效 | + +[generator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function* +[oss-sts]: https://help.aliyun.com/document_detail/oss/practice/ram_guide.html +[browser-sample]: https://github.com/rockuw/oss-in-browser +[oss-multipart]: https://help.aliyun.com/document_detail/31992.html +[disabled-browser-headers]: https://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method diff --git a/node_modules/ali-oss/dist/aliyun-oss-sdk.js b/node_modules/ali-oss/dist/aliyun-oss-sdk.js new file mode 100644 index 0000000..93c2323 --- /dev/null +++ b/node_modules/ali-oss/dist/aliyun-oss-sdk.js @@ -0,0 +1,44130 @@ +// Aliyun OSS SDK for JavaScript v6.23.0 +// Copyright Aliyun.com, Inc. or its affiliates. All Rights Reserved. +// License at https://github.com/ali-sdk/ali-oss/blob/master/LICENSE +(function(global){(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.OSS = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i\n"); + if (prefix) { + xml += "".concat(prefix, "\n"); + } + xml += '\n'; + params.content = xml; + params.mime = 'xml'; + params.successStatuses = [200]; + _context4.next = 9; + return this.request(params); + case 9: + result = _context4.sent; + return _context4.abrupt("return", { + res: result.res + }); + case 11: + case "end": + return _context4.stop(); + } + }, _callee4, this); + })); + function putBucketLogging(_x8, _x9, _x10) { + return _putBucketLogging.apply(this, arguments); + } + return putBucketLogging; +}(); +proto.getBucketLogging = /*#__PURE__*/function () { + var _getBucketLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(name, options) { + var params, result, enable; + return _regenerator.default.wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + params = this._bucketRequestParams('GET', name, 'logging', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context5.next = 5; + return this.request(params); + case 5: + result = _context5.sent; + enable = result.data.LoggingEnabled; + return _context5.abrupt("return", { + enable: !!enable, + prefix: enable && enable.TargetPrefix || null, + res: result.res + }); + case 8: + case "end": + return _context5.stop(); + } + }, _callee5, this); + })); + function getBucketLogging(_x11, _x12) { + return _getBucketLogging.apply(this, arguments); + } + return getBucketLogging; +}(); +proto.deleteBucketLogging = /*#__PURE__*/function () { + var _deleteBucketLogging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(name, options) { + var params, result; + return _regenerator.default.wrap(function _callee6$(_context6) { + while (1) switch (_context6.prev = _context6.next) { + case 0: + params = this._bucketRequestParams('DELETE', name, 'logging', options); + params.successStatuses = [204, 200]; + _context6.next = 4; + return this.request(params); + case 4: + result = _context6.sent; + return _context6.abrupt("return", { + res: result.res + }); + case 6: + case "end": + return _context6.stop(); + } + }, _callee6, this); + })); + function deleteBucketLogging(_x13, _x14) { + return _deleteBucketLogging.apply(this, arguments); + } + return deleteBucketLogging; +}(); +proto.putBucketCORS = /*#__PURE__*/function () { + var _putBucketCORS = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(name, rules, options) { + var params, xml, parseOrigin, parseMethod, parseHeader, parseExposeHeader, i, l, rule, result; + return _regenerator.default.wrap(function _callee7$(_context7) { + while (1) switch (_context7.prev = _context7.next) { + case 0: + rules = rules || []; + assert(rules.length, 'rules is required'); + rules.forEach(function (rule) { + assert(rule.allowedOrigin, 'allowedOrigin is required'); + assert(rule.allowedMethod, 'allowedMethod is required'); + }); + params = this._bucketRequestParams('PUT', name, 'cors', options); + xml = '\n'; + parseOrigin = function parseOrigin(val) { + xml += "".concat(val, ""); + }; + parseMethod = function parseMethod(val) { + xml += "".concat(val, ""); + }; + parseHeader = function parseHeader(val) { + xml += "".concat(val, ""); + }; + parseExposeHeader = function parseExposeHeader(val) { + xml += "".concat(val, ""); + }; + for (i = 0, l = rules.length; i < l; i++) { + rule = rules[i]; + xml += ''; + toArray(rule.allowedOrigin).forEach(parseOrigin); + toArray(rule.allowedMethod).forEach(parseMethod); + toArray(rule.allowedHeader).forEach(parseHeader); + toArray(rule.exposeHeader).forEach(parseExposeHeader); + if (rule.maxAgeSeconds) { + xml += "".concat(rule.maxAgeSeconds, ""); + } + xml += ''; + } + xml += ''; + params.content = xml; + params.mime = 'xml'; + params.successStatuses = [200]; + _context7.next = 16; + return this.request(params); + case 16: + result = _context7.sent; + return _context7.abrupt("return", { + res: result.res + }); + case 18: + case "end": + return _context7.stop(); + } + }, _callee7, this); + })); + function putBucketCORS(_x15, _x16, _x17) { + return _putBucketCORS.apply(this, arguments); + } + return putBucketCORS; +}(); +proto.getBucketCORS = /*#__PURE__*/function () { + var _getBucketCORS = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(name, options) { + var params, result, rules, CORSRule; + return _regenerator.default.wrap(function _callee8$(_context8) { + while (1) switch (_context8.prev = _context8.next) { + case 0: + params = this._bucketRequestParams('GET', name, 'cors', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context8.next = 5; + return this.request(params); + case 5: + result = _context8.sent; + rules = []; + if (result.data && result.data.CORSRule) { + CORSRule = result.data.CORSRule; + if (!isArray(CORSRule)) CORSRule = [CORSRule]; + CORSRule.forEach(function (rule) { + var r = {}; + Object.keys(rule).forEach(function (key) { + r[key.slice(0, 1).toLowerCase() + key.slice(1, key.length)] = rule[key]; + }); + rules.push(r); + }); + } + return _context8.abrupt("return", { + rules: rules, + res: result.res + }); + case 9: + case "end": + return _context8.stop(); + } + }, _callee8, this); + })); + function getBucketCORS(_x18, _x19) { + return _getBucketCORS.apply(this, arguments); + } + return getBucketCORS; +}(); +proto.deleteBucketCORS = /*#__PURE__*/function () { + var _deleteBucketCORS = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(name, options) { + var params, result; + return _regenerator.default.wrap(function _callee9$(_context9) { + while (1) switch (_context9.prev = _context9.next) { + case 0: + params = this._bucketRequestParams('DELETE', name, 'cors', options); + params.successStatuses = [204]; + _context9.next = 4; + return this.request(params); + case 4: + result = _context9.sent; + return _context9.abrupt("return", { + res: result.res + }); + case 6: + case "end": + return _context9.stop(); + } + }, _callee9, this); + })); + function deleteBucketCORS(_x20, _x21) { + return _deleteBucketCORS.apply(this, arguments); + } + return deleteBucketCORS; +}(); + +// referer + +proto.putBucketReferer = /*#__PURE__*/function () { + var _putBucketReferer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(name, allowEmpty, referers, options) { + var params, xml, i, result; + return _regenerator.default.wrap(function _callee10$(_context10) { + while (1) switch (_context10.prev = _context10.next) { + case 0: + params = this._bucketRequestParams('PUT', name, 'referer', options); + xml = '\n\n'; + xml += " ".concat(allowEmpty ? 'true' : 'false', "\n"); + if (referers && referers.length > 0) { + xml += ' \n'; + for (i = 0; i < referers.length; i++) { + xml += " ".concat(referers[i], "\n"); + } + xml += ' \n'; + } else { + xml += ' \n'; + } + xml += ''; + params.content = xml; + params.mime = 'xml'; + params.successStatuses = [200]; + _context10.next = 10; + return this.request(params); + case 10: + result = _context10.sent; + return _context10.abrupt("return", { + res: result.res + }); + case 12: + case "end": + return _context10.stop(); + } + }, _callee10, this); + })); + function putBucketReferer(_x22, _x23, _x24, _x25) { + return _putBucketReferer.apply(this, arguments); + } + return putBucketReferer; +}(); +proto.getBucketReferer = /*#__PURE__*/function () { + var _getBucketReferer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(name, options) { + var params, result, referers; + return _regenerator.default.wrap(function _callee11$(_context11) { + while (1) switch (_context11.prev = _context11.next) { + case 0: + params = this._bucketRequestParams('GET', name, 'referer', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context11.next = 5; + return this.request(params); + case 5: + result = _context11.sent; + referers = result.data.RefererList.Referer || null; + if (referers) { + if (!isArray(referers)) { + referers = [referers]; + } + } + return _context11.abrupt("return", { + allowEmpty: result.data.AllowEmptyReferer === 'true', + referers: referers, + res: result.res + }); + case 9: + case "end": + return _context11.stop(); + } + }, _callee11, this); + })); + function getBucketReferer(_x26, _x27) { + return _getBucketReferer.apply(this, arguments); + } + return getBucketReferer; +}(); +proto.deleteBucketReferer = /*#__PURE__*/function () { + var _deleteBucketReferer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(name, options) { + return _regenerator.default.wrap(function _callee12$(_context12) { + while (1) switch (_context12.prev = _context12.next) { + case 0: + _context12.next = 2; + return this.putBucketReferer(name, true, null, options); + case 2: + return _context12.abrupt("return", _context12.sent); + case 3: + case "end": + return _context12.stop(); + } + }, _callee12, this); + })); + function deleteBucketReferer(_x28, _x29) { + return _deleteBucketReferer.apply(this, arguments); + } + return deleteBucketReferer; +}(); + +// private apis + +proto._bucketRequestParams = function _bucketRequestParams(method, bucket, subres, options) { + return { + method: method, + bucket: bucket, + subres: subres, + additionalHeaders: options && options.additionalHeaders, + timeout: options && options.timeout, + ctx: options && options.ctx + }; +}; + +},{"../common/utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"assert":95,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/web.dom-collections.for-each.js":380}],3:[function(require,module,exports){ +(function (Buffer,process){(function (){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +require("core-js/modules/es.function.name.js"); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.symbol.js"); +require("core-js/modules/es.symbol.description.js"); +require("core-js/modules/es.array.slice.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.promise.js"); +require("core-js/modules/es.regexp.to-string.js"); +var debug = require('debug')('ali-oss'); +var xml = require('xml2js'); +var AgentKeepalive = require('agentkeepalive'); +var merge = require('merge-descriptors'); +var platform = require('platform'); +var utility = require('utility'); +var urllib = require('urllib'); +var pkg = require('./version'); +var bowser = require('bowser'); +var signUtils = require('../common/signUtils'); +var _initOptions = require('../common/client/initOptions'); +var _require = require('../common/utils/createRequest'), + createRequest = _require.createRequest; +var _require2 = require('../common/utils/encoder'), + encoder = _require2.encoder; +var _require3 = require('../common/client/getReqUrl'), + getReqUrl = _require3.getReqUrl; +var _require4 = require('../common/utils/setSTSToken'), + setSTSToken = _require4.setSTSToken; +var _require5 = require('../common/utils/retry'), + retry = _require5.retry; +var _require6 = require('../common/utils/isFunction'), + isFunction = _require6.isFunction; +var _require7 = require('../common/utils/getStandardRegion'), + getStandardRegion = _require7.getStandardRegion; +var globalHttpAgent = new AgentKeepalive(); +function _unSupportBrowserTip() { + var name = platform.name, + version = platform.version; + if (name && name.toLowerCase && name.toLowerCase() === 'ie' && version.split('.')[0] < 10) { + // eslint-disable-next-line no-console + console.warn('ali-oss does not support the current browser'); + } +} +// check local web protocol,if https secure default set true , if http secure default set false +function isHttpsWebProtocol() { + // for web worker not use window.location. + // eslint-disable-next-line no-restricted-globals + return location && location.protocol === 'https:'; +} +function Client(options, ctx) { + _unSupportBrowserTip(); + if (!(this instanceof Client)) { + return new Client(options, ctx); + } + if (options && options.inited) { + this.options = options; + } else { + this.options = Client.initOptions(options); + } + this.options.cancelFlag = false; // cancel flag: if true need to be cancelled, default false + + // support custom agent and urllib client + if (this.options.urllib) { + this.urllib = this.options.urllib; + } else { + this.urllib = urllib; + this.agent = this.options.agent || globalHttpAgent; + } + this.ctx = ctx; + this.userAgent = this._getUserAgent(); + this.stsTokenFreshTime = new Date(); + + // record the time difference between client and server + this.options.amendTimeSkewed = 0; +} + +/** + * Expose `Client` + */ + +module.exports = Client; +Client.initOptions = function initOptions(options) { + if (!options.stsToken) { + console.warn('Please use STS Token for safety, see more details at https://help.aliyun.com/document_detail/32077.html'); + } + var opts = Object.assign({ + secure: isHttpsWebProtocol(), + // for browser compatibility disable fetch. + useFetch: false + }, options); + return _initOptions(opts); +}; + +/** + * prototype + */ + +var proto = Client.prototype; + +// mount debug on proto +proto.debug = debug; + +/** + * Object operations + */ +merge(proto, require('./object')); +/** + * Bucket operations + */ +merge(proto, require('./bucket')); +merge(proto, require('../common/bucket/getBucketWebsite')); +merge(proto, require('../common/bucket/putBucketWebsite')); +merge(proto, require('../common/bucket/deleteBucketWebsite')); + +// lifecycle +merge(proto, require('../common/bucket/getBucketLifecycle')); +merge(proto, require('../common/bucket/putBucketLifecycle')); +merge(proto, require('../common/bucket/deleteBucketLifecycle')); + +// multiversion +merge(proto, require('../common/bucket/putBucketVersioning')); +merge(proto, require('../common/bucket/getBucketVersioning')); + +// inventory +merge(proto, require('../common/bucket/getBucketInventory')); +merge(proto, require('../common/bucket/deleteBucketInventory')); +merge(proto, require('../common/bucket/listBucketInventory')); +merge(proto, require('../common/bucket/putBucketInventory')); + +// worm +merge(proto, require('../common/bucket/abortBucketWorm')); +merge(proto, require('../common/bucket/completeBucketWorm')); +merge(proto, require('../common/bucket/extendBucketWorm')); +merge(proto, require('../common/bucket/getBucketWorm')); +merge(proto, require('../common/bucket/initiateBucketWorm')); + +// multipart upload +merge(proto, require('./managed-upload')); +/** + * common multipart-copy support node and browser + */ +merge(proto, require('../common/multipart-copy')); +/** + * Multipart operations + */ +merge(proto, require('../common/multipart')); + +/** + * Common module parallel + */ +merge(proto, require('../common/parallel')); + +/** + * get OSS signature + * @param {String} stringToSign + * @return {String} the signature + */ +proto.signature = function signature(stringToSign) { + this.debug('authorization stringToSign: %s', stringToSign, 'info'); + return signUtils.computeSignature(this.options.accessKeySecret, stringToSign, this.options.headerEncoding); +}; +proto._getReqUrl = getReqUrl; + +/** + * get author header + * + * "Authorization: OSS " + Access Key Id + ":" + Signature + * + * Signature = base64(hmac-sha1(Access Key Secret + "\n" + * + VERB + "\n" + * + CONTENT-MD5 + "\n" + * + CONTENT-TYPE + "\n" + * + DATE + "\n" + * + CanonicalizedOSSHeaders + * + CanonicalizedResource)) + * + * @param {String} method + * @param {String} resource + * @param {Object} header + * @return {String} + * + * @api private + */ + +proto.authorization = function authorization(method, resource, subres, headers) { + var stringToSign = signUtils.buildCanonicalString(method.toUpperCase(), resource, { + headers: headers, + parameters: subres + }); + return signUtils.authorization(this.options.accessKeyId, this.options.accessKeySecret, stringToSign, this.options.headerEncoding); +}; + +/** + * get authorization header v4 + * + * @param {string} method + * @param {Object} requestParams + * @param {Object} requestParams.headers + * @param {(string|string[]|Object)} [requestParams.queries] + * @param {string} [bucketName] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] + * @return {string} + * + * @api private + */ +proto.authorizationV4 = function authorizationV4(method, requestParams, bucketName, objectName, additionalHeaders) { + return signUtils.authorizationV4(this.options.accessKeyId, this.options.accessKeySecret, getStandardRegion(this.options.region), method, requestParams, bucketName, objectName, additionalHeaders, this.options.headerEncoding); +}; + +/** + * request oss server + * @param {Object} params + * - {String} object + * - {String} bucket + * - {Object} [headers] + * - {Object} [query] + * - {Buffer} [content] + * - {Stream} [stream] + * - {Stream} [writeStream] + * - {String} [mime] + * - {Boolean} [xmlResponse] + * - {Boolean} [customResponse] + * - {Number} [timeout] + * - {Object} [ctx] request context, default is `this.ctx` + * + * @api private + */ + +proto.request = /*#__PURE__*/function () { + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(params) { + var _this = this; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + if (!this.options.retryMax) { + _context.next = 6; + break; + } + _context.next = 3; + return retry(request.bind(this), this.options.retryMax, { + errorHandler: function errorHandler(err) { + var _errHandle = function _errHandle(_err) { + if (params.stream) return false; + var statusErr = [-1, -2].includes(_err.status); + var requestErrorRetryHandle = _this.options.requestErrorRetryHandle || function () { + return true; + }; + return statusErr && requestErrorRetryHandle(_err); + }; + if (_errHandle(err)) return true; + return false; + } + })(params); + case 3: + return _context.abrupt("return", _context.sent); + case 6: + return _context.abrupt("return", request.call(this, params)); + case 7: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return function (_x) { + return _ref.apply(this, arguments); + }; +}(); +function request(_x2) { + return _request.apply(this, arguments); +} +function _request() { + _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(params) { + var reqParams, result, reqErr, useStream, err, parseData; + return _regenerator.default.wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { + _context4.next = 3; + break; + } + _context4.next = 3; + return setSTSToken.call(this); + case 3: + reqParams = createRequest.call(this, params); + if (!this.options.useFetch) { + reqParams.params.mode = 'disable-fetch'; + } + useStream = !!params.stream; + _context4.prev = 6; + _context4.next = 9; + return this.urllib.request(reqParams.url, reqParams.params); + case 9: + result = _context4.sent; + this.debug('response %s %s, got %s, headers: %j', params.method, reqParams.url, result.status, result.headers, 'info'); + _context4.next = 16; + break; + case 13: + _context4.prev = 13; + _context4.t0 = _context4["catch"](6); + reqErr = _context4.t0; + case 16: + if (!(result && params.successStatuses && params.successStatuses.indexOf(result.status) === -1)) { + _context4.next = 28; + break; + } + _context4.next = 19; + return this.requestError(result); + case 19: + err = _context4.sent; + if (!(err.code === 'RequestTimeTooSkewed' && !useStream)) { + _context4.next = 25; + break; + } + this.options.amendTimeSkewed = +new Date(err.serverTime) - new Date(); + _context4.next = 24; + return this.request(params); + case 24: + return _context4.abrupt("return", _context4.sent); + case 25: + err.params = params; + _context4.next = 32; + break; + case 28: + if (!reqErr) { + _context4.next = 32; + break; + } + _context4.next = 31; + return this.requestError(reqErr); + case 31: + err = _context4.sent; + case 32: + if (!err) { + _context4.next = 34; + break; + } + throw err; + case 34: + if (!params.xmlResponse) { + _context4.next = 39; + break; + } + _context4.next = 37; + return this.parseXML(result.data); + case 37: + parseData = _context4.sent; + result.data = parseData; + case 39: + return _context4.abrupt("return", result); + case 40: + case "end": + return _context4.stop(); + } + }, _callee4, this, [[6, 13]]); + })); + return _request.apply(this, arguments); +} +proto._getResource = function _getResource(params) { + var resource = '/'; + if (params.bucket) resource += "".concat(params.bucket, "/"); + if (params.object) resource += encoder(params.object, this.options.headerEncoding); + return resource; +}; +proto._escape = function _escape(name) { + return utility.encodeURIComponent(name).replace(/%2F/g, '/'); +}; + +/* + * Get User-Agent for browser & node.js + * @example + * aliyun-sdk-nodejs/4.1.2 Node.js 5.3.0 on Darwin 64-bit + * aliyun-sdk-js/4.1.2 Safari 9.0 on Apple iPhone(iOS 9.2.1) + * aliyun-sdk-js/4.1.2 Chrome 43.0.2357.134 32-bit on Windows Server 2008 R2 / 7 64-bit + */ + +proto._getUserAgent = function _getUserAgent() { + var agent = process && process.browser ? 'js' : 'nodejs'; + var sdk = "aliyun-sdk-".concat(agent, "/").concat(pkg.version); + var plat = platform.description; + if (!plat && process) { + plat = "Node.js ".concat(process.version.slice(1), " on ").concat(process.platform, " ").concat(process.arch); + } + return this._checkUserAgent("".concat(sdk, " ").concat(plat)); +}; +proto._checkUserAgent = function _checkUserAgent(ua) { + var userAgent = ua.replace(/\u03b1/, 'alpha').replace(/\u03b2/, 'beta'); + return userAgent; +}; + +/* + * Check Browser And Version + * @param {String} [name] browser name: like IE, Chrome, Firefox + * @param {String} [version] browser major version: like 10(IE 10.x), 55(Chrome 55.x), 50(Firefox 50.x) + * @return {Bool} true or false + * @api private + */ + +proto.checkBrowserAndVersion = function checkBrowserAndVersion(name, version) { + return bowser.name === name && bowser.version.split('.')[0] === version; +}; + +/** + * thunkify xml.parseString + * @param {String|Buffer} str + * + * @api private + */ + +proto.parseXML = function parseXMLThunk(str) { + return new Promise(function (resolve, reject) { + if (Buffer.isBuffer(str)) { + str = str.toString(); + } + xml.parseString(str, { + explicitRoot: false, + explicitArray: false + }, function (err, result) { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); +}; + +/** + * generater a request error with request response + * @param {Object} result + * + * @api private + */ + +proto.requestError = /*#__PURE__*/function () { + var _requestError = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(result) { + var _this2 = this; + var err, setError, ossErr, message, _message; + return _regenerator.default.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + err = null; + setError = /*#__PURE__*/function () { + var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(message) { + var info, msg; + return _regenerator.default.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + _context2.next = 3; + return _this2.parseXML(message); + case 3: + _context2.t0 = _context2.sent; + if (_context2.t0) { + _context2.next = 6; + break; + } + _context2.t0 = {}; + case 6: + info = _context2.t0; + _context2.next = 16; + break; + case 9: + _context2.prev = 9; + _context2.t1 = _context2["catch"](0); + _this2.debug(message, 'error'); + _context2.t1.message += "\nraw xml: ".concat(message); + _context2.t1.status = result.status; + _context2.t1.requestId = result.headers && result.headers['x-oss-request-id']; + return _context2.abrupt("return", _context2.t1); + case 16: + msg = info.Message || "unknow request error, status: ".concat(result.status); + if (info.Condition) { + msg += " (condition: ".concat(info.Condition, ")"); + } + err = new Error(msg); + err.name = info.Code ? "".concat(info.Code, "Error") : 'UnknownError'; + err.status = result.status; + err.code = info.Code; + err.ecCode = info.EC; + err.requestId = info.RequestId; + err.hostId = info.HostId; + err.serverTime = info.ServerTime; + return _context2.abrupt("return", err); + case 27: + case "end": + return _context2.stop(); + } + }, _callee2, null, [[0, 9]]); + })); + return function setError(_x4) { + return _ref2.apply(this, arguments); + }; + }(); + if (!(!result.data || !result.data.length)) { + _context3.next = 38; + break; + } + if (!(result.status === -1 || result.status === -2)) { + _context3.next = 10; + break; + } + // -1 is net error , -2 is timeout + err = new Error(result.message); + err.name = result.name; + err.status = result.status; + err.code = result.name; + _context3.next = 36; + break; + case 10: + if (!(result.status === 404)) { + _context3.next = 17; + break; + } + err = new Error('Object not exists'); + err.name = 'NoSuchKeyError'; + err.status = 404; + err.code = 'NoSuchKey'; + _context3.next = 34; + break; + case 17: + if (!(result.status === 412)) { + _context3.next = 24; + break; + } + err = new Error('Pre condition failed'); + err.name = 'PreconditionFailedError'; + err.status = 412; + err.code = 'PreconditionFailed'; + _context3.next = 34; + break; + case 24: + err = new Error("Unknow error, status: ".concat(result.status)); + err.name = 'UnknownError'; + err.status = result.status; + err.res = result; + ossErr = result.headers && result.headers['x-oss-err']; + if (!ossErr) { + _context3.next = 34; + break; + } + message = atob(ossErr); + _context3.next = 33; + return setError(message); + case 33: + err = _context3.sent; + case 34: + err.requestId = result.headers && result.headers['x-oss-request-id']; + err.host = ''; + case 36: + _context3.next = 43; + break; + case 38: + _message = String(result.data); + this.debug('request response error data: %s', _message, 'error'); + _context3.next = 42; + return setError(_message); + case 42: + err = _context3.sent; + case 43: + this.debug('generate error %j', err, 'error'); + return _context3.abrupt("return", err); + case 45: + case "end": + return _context3.stop(); + } + }, _callee3, this); + })); + function requestError(_x3) { + return _requestError.apply(this, arguments); + } + return requestError; +}(); + +}).call(this)}).call(this,{"isBuffer":require("../../node_modules/is-buffer/index.js")},require('_process')) +},{"../../node_modules/is-buffer/index.js":409,"../common/bucket/abortBucketWorm":7,"../common/bucket/completeBucketWorm":8,"../common/bucket/deleteBucketInventory":9,"../common/bucket/deleteBucketLifecycle":10,"../common/bucket/deleteBucketWebsite":11,"../common/bucket/extendBucketWorm":12,"../common/bucket/getBucketInventory":13,"../common/bucket/getBucketLifecycle":14,"../common/bucket/getBucketVersioning":15,"../common/bucket/getBucketWebsite":16,"../common/bucket/getBucketWorm":17,"../common/bucket/initiateBucketWorm":18,"../common/bucket/listBucketInventory":19,"../common/bucket/putBucketInventory":20,"../common/bucket/putBucketLifecycle":21,"../common/bucket/putBucketVersioning":22,"../common/bucket/putBucketWebsite":23,"../common/client/getReqUrl":25,"../common/client/initOptions":26,"../common/multipart":30,"../common/multipart-copy":29,"../common/parallel":51,"../common/signUtils":52,"../common/utils/createRequest":58,"../common/utils/encoder":62,"../common/utils/getStandardRegion":65,"../common/utils/isFunction":72,"../common/utils/retry":80,"../common/utils/setSTSToken":82,"./bucket":2,"./managed-upload":4,"./object":5,"./version":6,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"_process":538,"agentkeepalive":94,"bowser":101,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.promise.js":333,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.string.replace.js":345,"core-js/modules/es.symbol.description.js":351,"core-js/modules/es.symbol.js":354,"debug":536,"merge-descriptors":428,"platform":440,"urllib":546,"utility":545,"xml2js":496}],4:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.function.name.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.promise.js"); +require("core-js/modules/es.array.from.js"); +require("core-js/modules/es.string.iterator.js"); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.array.filter.js"); +require("core-js/modules/es.array.find.js"); +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.regexp.to-string.js"); +require("core-js/modules/es.array.slice.js"); +require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.array-buffer.slice.js"); +require("core-js/modules/es.typed-array.uint8-array.js"); +require("core-js/modules/es.typed-array.copy-within.js"); +require("core-js/modules/es.typed-array.every.js"); +require("core-js/modules/es.typed-array.fill.js"); +require("core-js/modules/es.typed-array.filter.js"); +require("core-js/modules/es.typed-array.find.js"); +require("core-js/modules/es.typed-array.find-index.js"); +require("core-js/modules/es.typed-array.for-each.js"); +require("core-js/modules/es.typed-array.includes.js"); +require("core-js/modules/es.typed-array.index-of.js"); +require("core-js/modules/es.typed-array.iterator.js"); +require("core-js/modules/es.typed-array.join.js"); +require("core-js/modules/es.typed-array.last-index-of.js"); +require("core-js/modules/es.typed-array.map.js"); +require("core-js/modules/es.typed-array.reduce.js"); +require("core-js/modules/es.typed-array.reduce-right.js"); +require("core-js/modules/es.typed-array.reverse.js"); +require("core-js/modules/es.typed-array.set.js"); +require("core-js/modules/es.typed-array.slice.js"); +require("core-js/modules/es.typed-array.some.js"); +require("core-js/modules/es.typed-array.sort.js"); +require("core-js/modules/es.typed-array.subarray.js"); +require("core-js/modules/es.typed-array.to-locale-string.js"); +require("core-js/modules/es.typed-array.to-string.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +// var debug = require('debug')('ali-oss:multipart'); +var util = require('util'); +var path = require('path'); +var mime = require('mime'); +var copy = require('copy-to'); +var _require = require('../common/utils/isBlob'), + isBlob = _require.isBlob; +var _require2 = require('../common/utils/isFile'), + isFile = _require2.isFile; +var _require3 = require('../common/utils/isBuffer'), + isBuffer = _require3.isBuffer; +var proto = exports; + +/** + * Multipart operations + */ + +/** + * Upload a file to OSS using multipart uploads + * @param {String} name + * @param {String|File|Buffer} file + * @param {Object} options + * {Object} [options.callback] The callback parameter is composed of a JSON string encoded in Base64 + * {String} options.callback.url the OSS sends a callback request to this URL + * {String} [options.callback.host] The host header value for initiating callback requests + * {String} options.callback.body The value of the request body when a callback is initiated + * {String} [options.callback.contentType] The Content-Type of the callback requests initiated + * {Boolean} [options.callback.callbackSNI] Whether OSS sends SNI to the origin address specified by callbackUrl when a callback request is initiated from the client + * {Object} [options.callback.customValue] Custom parameters are a map of key-values, e.g: + * customValue = { + * key1: 'value1', + * key2: 'value2' + * } + */ +proto.multipartUpload = /*#__PURE__*/function () { + var _multipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, file) { + var options, + minPartSize, + fileSize, + result, + ret, + initResult, + uploadId, + partSize, + checkpoint, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + this.resetCancelFlag(); + options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; + if (!(options.checkpoint && options.checkpoint.uploadId)) { + _context.next = 8; + break; + } + if (file && isFile(file)) options.checkpoint.file = file; + _context.next = 7; + return this._resumeMultipart(options.checkpoint, options); + case 7: + return _context.abrupt("return", _context.sent); + case 8: + minPartSize = 100 * 1024; + if (!options.mime) { + if (isFile(file)) { + options.mime = mime.getType(path.extname(file.name)); + } else if (isBlob(file)) { + options.mime = file.type; + } else if (isBuffer(file)) { + options.mime = ''; + } else { + options.mime = mime.getType(path.extname(file)); + } + } + options.headers = options.headers || {}; + this._convertMetaToHeaders(options.meta, options.headers); + _context.next = 14; + return this._getFileSize(file); + case 14: + fileSize = _context.sent; + if (!(fileSize < minPartSize)) { + _context.next = 26; + break; + } + options.contentLength = fileSize; + _context.next = 19; + return this.put(name, file, options); + case 19: + result = _context.sent; + if (!(options && options.progress)) { + _context.next = 23; + break; + } + _context.next = 23; + return options.progress(1); + case 23: + ret = { + res: result.res, + bucket: this.options.bucket, + name: name, + etag: result.res.headers.etag + }; + if (options.headers && options.headers['x-oss-callback'] || options.callback) { + ret.data = result.data; + } + return _context.abrupt("return", ret); + case 26: + if (!(options.partSize && !(parseInt(options.partSize, 10) === options.partSize))) { + _context.next = 28; + break; + } + throw new Error('partSize must be int number'); + case 28: + if (!(options.partSize && options.partSize < minPartSize)) { + _context.next = 30; + break; + } + throw new Error("partSize must not be smaller than ".concat(minPartSize)); + case 30: + _context.next = 32; + return this.initMultipartUpload(name, options); + case 32: + initResult = _context.sent; + uploadId = initResult.uploadId; + partSize = this._getPartSize(fileSize, options.partSize); + checkpoint = { + file: file, + name: name, + fileSize: fileSize, + partSize: partSize, + uploadId: uploadId, + doneParts: [] + }; + if (!(options && options.progress)) { + _context.next = 39; + break; + } + _context.next = 39; + return options.progress(0, checkpoint, initResult.res); + case 39: + _context.next = 41; + return this._resumeMultipart(checkpoint, options); + case 41: + return _context.abrupt("return", _context.sent); + case 42: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function multipartUpload(_x, _x2) { + return _multipartUpload.apply(this, arguments); + } + return multipartUpload; +}(); + +/* + * Resume multipart upload from checkpoint. The checkpoint will be + * updated after each successful part upload. + * @param {Object} checkpoint the checkpoint + * @param {Object} options + */ +proto._resumeMultipart = /*#__PURE__*/function () { + var _resumeMultipart2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(checkpoint, options) { + var that, file, fileSize, partSize, uploadId, doneParts, name, internalDoneParts, partOffs, numParts, multipartFinish, uploadPartJob, all, done, todo, defaultParallel, parallel, jobErr, abortEvent; + return _regenerator.default.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + that = this; + if (!this.isCancel()) { + _context3.next = 3; + break; + } + throw this._makeCancelEvent(); + case 3: + file = checkpoint.file, fileSize = checkpoint.fileSize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name; + internalDoneParts = []; + if (doneParts.length > 0) { + copy(doneParts).to(internalDoneParts); + } + partOffs = this._divideParts(fileSize, partSize); + numParts = partOffs.length; + multipartFinish = false; + uploadPartJob = function uploadPartJob(self, partNo) { + // eslint-disable-next-line no-async-promise-executor + return new Promise( /*#__PURE__*/function () { + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) { + var pi, content, data, result, tempErr; + return _regenerator.default.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + if (self.isCancel()) { + _context2.next = 29; + break; + } + pi = partOffs[partNo - 1]; + _context2.next = 5; + return self._createBuffer(file, pi.start, pi.end); + case 5: + content = _context2.sent; + data = { + content: content, + size: pi.end - pi.start + }; + _context2.prev = 7; + _context2.next = 10; + return self._uploadPart(name, uploadId, partNo, data, options); + case 10: + result = _context2.sent; + _context2.next = 18; + break; + case 13: + _context2.prev = 13; + _context2.t0 = _context2["catch"](7); + if (!(_context2.t0.status === 404)) { + _context2.next = 17; + break; + } + throw self._makeAbortEvent(); + case 17: + throw _context2.t0; + case 18: + if (!(!self.isCancel() && !multipartFinish)) { + _context2.next = 26; + break; + } + checkpoint.doneParts.push({ + number: partNo, + etag: result.res.headers.etag + }); + if (!options.progress) { + _context2.next = 23; + break; + } + _context2.next = 23; + return options.progress(doneParts.length / (numParts + 1), checkpoint, result.res); + case 23: + resolve({ + number: partNo, + etag: result.res.headers.etag + }); + _context2.next = 27; + break; + case 26: + resolve(); + case 27: + _context2.next = 30; + break; + case 29: + resolve(); + case 30: + _context2.next = 41; + break; + case 32: + _context2.prev = 32; + _context2.t1 = _context2["catch"](0); + tempErr = new Error(); + tempErr.name = _context2.t1.name; + tempErr.message = _context2.t1.message; + tempErr.stack = _context2.t1.stack; + tempErr.partNum = partNo; + copy(_context2.t1).to(tempErr); + reject(tempErr); + case 41: + case "end": + return _context2.stop(); + } + }, _callee2, null, [[0, 32], [7, 13]]); + })); + return function (_x5, _x6) { + return _ref.apply(this, arguments); + }; + }()); + }; + all = Array.from(new Array(numParts), function (x, i) { + return i + 1; + }); + done = internalDoneParts.map(function (p) { + return p.number; + }); + todo = all.filter(function (p) { + return done.indexOf(p) < 0; + }); + defaultParallel = 5; + parallel = options.parallel || defaultParallel; // upload in parallel + _context3.next = 17; + return this._parallel(todo, parallel, function (value) { + return new Promise(function (resolve, reject) { + uploadPartJob(that, value).then(function (result) { + if (result) { + internalDoneParts.push(result); + } + resolve(); + }).catch(function (err) { + reject(err); + }); + }); + }); + case 17: + jobErr = _context3.sent; + multipartFinish = true; + abortEvent = jobErr.find(function (err) { + return err.name === 'abort'; + }); + if (!abortEvent) { + _context3.next = 22; + break; + } + throw abortEvent; + case 22: + if (!this.isCancel()) { + _context3.next = 25; + break; + } + uploadPartJob = null; + throw this._makeCancelEvent(); + case 25: + if (!(jobErr && jobErr.length > 0)) { + _context3.next = 28; + break; + } + jobErr[0].message = "Failed to upload some parts with error: ".concat(jobErr[0].toString(), " part_num: ").concat(jobErr[0].partNum); + throw jobErr[0]; + case 28: + _context3.next = 30; + return this.completeMultipartUpload(name, uploadId, internalDoneParts, options); + case 30: + return _context3.abrupt("return", _context3.sent); + case 31: + case "end": + return _context3.stop(); + } + }, _callee3, this); + })); + function _resumeMultipart(_x3, _x4) { + return _resumeMultipart2.apply(this, arguments); + } + return _resumeMultipart; +}(); + +/** + * Get file size + */ +proto._getFileSize = /*#__PURE__*/function () { + var _getFileSize2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(file) { + return _regenerator.default.wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!isBuffer(file)) { + _context4.next = 4; + break; + } + return _context4.abrupt("return", file.length); + case 4: + if (!(isBlob(file) || isFile(file))) { + _context4.next = 6; + break; + } + return _context4.abrupt("return", file.size); + case 6: + throw new Error('_getFileSize requires Buffer/File/Blob.'); + case 7: + case "end": + return _context4.stop(); + } + }, _callee4); + })); + function _getFileSize(_x7) { + return _getFileSize2.apply(this, arguments); + } + return _getFileSize; +}(); + +/* + * Readable stream for Web File + */ +var _require4 = require('stream'), + Readable = _require4.Readable; +function WebFileReadStream(file, options) { + if (!(this instanceof WebFileReadStream)) { + return new WebFileReadStream(file, options); + } + Readable.call(this, options); + this.file = file; + this.reader = new FileReader(); + this.start = 0; + this.finish = false; + this.fileBuffer = null; +} +util.inherits(WebFileReadStream, Readable); +WebFileReadStream.prototype.readFileAndPush = function readFileAndPush(size) { + if (this.fileBuffer) { + var pushRet = true; + while (pushRet && this.fileBuffer && this.start < this.fileBuffer.length) { + var start = this.start; + var end = start + size; + end = end > this.fileBuffer.length ? this.fileBuffer.length : end; + this.start = end; + pushRet = this.push(this.fileBuffer.slice(start, end)); + } + } +}; +WebFileReadStream.prototype._read = function _read(size) { + if (this.file && this.start >= this.file.size || this.fileBuffer && this.start >= this.fileBuffer.length || this.finish || this.start === 0 && !this.file) { + if (!this.finish) { + this.fileBuffer = null; + this.finish = true; + } + this.push(null); + return; + } + var defaultReadSize = 16 * 1024; + size = size || defaultReadSize; + var that = this; + this.reader.onload = function onload(e) { + that.fileBuffer = Buffer.from(new Uint8Array(e.target.result)); + that.file = null; + that.readFileAndPush(size); + }; + if (this.start === 0) { + this.reader.readAsArrayBuffer(this.file); + } else { + this.readFileAndPush(size); + } +}; +function getBuffer(file) { + // Some browsers do not support Blob.prototype.arrayBuffer, such as IE + if (file.arrayBuffer) return file.arrayBuffer(); + return new Promise(function (resolve, reject) { + var reader = new FileReader(); + reader.onload = function (e) { + resolve(e.target.result); + }; + reader.onerror = function (e) { + reject(e); + }; + reader.readAsArrayBuffer(file); + }); +} +proto._createBuffer = /*#__PURE__*/function () { + var _createBuffer2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(file, start, end) { + var _file, fileContent; + return _regenerator.default.wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + if (!(isBlob(file) || isFile(file))) { + _context5.next = 8; + break; + } + _file = file.slice(start, end); + _context5.next = 4; + return getBuffer(_file); + case 4: + fileContent = _context5.sent; + return _context5.abrupt("return", Buffer.from(fileContent)); + case 8: + if (!isBuffer(file)) { + _context5.next = 12; + break; + } + return _context5.abrupt("return", file.subarray(start, end)); + case 12: + throw new Error('_createBuffer requires File/Blob/Buffer.'); + case 13: + case "end": + return _context5.stop(); + } + }, _callee5); + })); + function _createBuffer(_x8, _x9, _x10) { + return _createBuffer2.apply(this, arguments); + } + return _createBuffer; +}(); +proto._getPartSize = function _getPartSize(fileSize, partSize) { + var maxNumParts = 10 * 1000; + var defaultPartSize = 1 * 1024 * 1024; + if (!partSize) partSize = defaultPartSize; + var safeSize = Math.ceil(fileSize / maxNumParts); + if (partSize < safeSize) { + partSize = safeSize; + console.warn("partSize has been set to ".concat(partSize, ", because the partSize you provided causes partNumber to be greater than 10,000")); + } + return partSize; +}; +proto._divideParts = function _divideParts(fileSize, partSize) { + var numParts = Math.ceil(fileSize / partSize); + var partOffs = []; + for (var i = 0; i < numParts; i++) { + var start = partSize * i; + var end = Math.min(start + partSize, fileSize); + partOffs.push({ + start: start, + end: end + }); + } + return partOffs; +}; + +}).call(this)}).call(this,require("buffer").Buffer) +},{"../common/utils/isBlob":68,"../common/utils/isBuffer":69,"../common/utils/isFile":71,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"buffer":103,"copy-to":107,"core-js/modules/es.array-buffer.slice.js":309,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.find.js":313,"core-js/modules/es.array.from.js":314,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.map.js":318,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.promise.js":333,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.string.iterator.js":343,"core-js/modules/es.typed-array.copy-within.js":356,"core-js/modules/es.typed-array.every.js":357,"core-js/modules/es.typed-array.fill.js":358,"core-js/modules/es.typed-array.filter.js":359,"core-js/modules/es.typed-array.find-index.js":360,"core-js/modules/es.typed-array.find.js":361,"core-js/modules/es.typed-array.for-each.js":362,"core-js/modules/es.typed-array.includes.js":363,"core-js/modules/es.typed-array.index-of.js":364,"core-js/modules/es.typed-array.iterator.js":365,"core-js/modules/es.typed-array.join.js":366,"core-js/modules/es.typed-array.last-index-of.js":367,"core-js/modules/es.typed-array.map.js":368,"core-js/modules/es.typed-array.reduce-right.js":369,"core-js/modules/es.typed-array.reduce.js":370,"core-js/modules/es.typed-array.reverse.js":371,"core-js/modules/es.typed-array.set.js":372,"core-js/modules/es.typed-array.slice.js":373,"core-js/modules/es.typed-array.some.js":374,"core-js/modules/es.typed-array.sort.js":375,"core-js/modules/es.typed-array.subarray.js":376,"core-js/modules/es.typed-array.to-locale-string.js":377,"core-js/modules/es.typed-array.to-string.js":378,"core-js/modules/es.typed-array.uint8-array.js":379,"mime":430,"path":439,"stream":468,"util":489}],5:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +require("core-js/modules/es.function.name.js"); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.number.constructor.js"); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.promise.js"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +// const debug = require('debug')('ali-oss:object'); +var fs = require('fs'); +var copy = require('copy-to'); +var path = require('path'); +var mime = require('mime'); +var callback = require('../common/callback'); +var merge = require('merge-descriptors'); +var _require = require('../common/utils/isBlob'), + isBlob = _require.isBlob; +var _require2 = require('../common/utils/isFile'), + isFile = _require2.isFile; +var _require3 = require('../common/utils/isBuffer'), + isBuffer = _require3.isBuffer; +var _require4 = require('../common/utils/obj2xml'), + obj2xml = _require4.obj2xml; +var _require5 = require('../common/utils/parseRestoreInfo'), + parseRestoreInfo = _require5.parseRestoreInfo; + +// var assert = require('assert'); + +var proto = exports; + +/** + * Object operations + */ + +/** + * append an object from String(file path)/Buffer/ReadableStream + * @param {String} name the object key + * @param {Mixed} file String(file path)/Buffer/ReadableStream + * @param {Object} options + * @return {Object} + */ +proto.append = /*#__PURE__*/function () { + var _append = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, file, options) { + var result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + if (options.position === undefined) options.position = '0'; + options.subres = { + append: '', + position: options.position + }; + options.method = 'POST'; + _context.next = 6; + return this.put(name, file, options); + case 6: + result = _context.sent; + result.nextAppendPosition = result.res.headers['x-oss-next-append-position']; + return _context.abrupt("return", result); + case 9: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function append(_x, _x2, _x3) { + return _append.apply(this, arguments); + } + return append; +}(); + +/** + * put an object from String(file path)/Buffer/ReadableStream + * @param {String} name the object key + * @param {Mixed} file String(file path)/Buffer/ReadableStream + * @param {Object} options + * {Object} [options.callback] The callback parameter is composed of a JSON string encoded in Base64 + * {String} options.callback.url the OSS sends a callback request to this URL + * {String} [options.callback.host] The host header value for initiating callback requests + * {String} options.callback.body The value of the request body when a callback is initiated + * {String} [options.callback.contentType] The Content-Type of the callback requests initiated + * {Boolean} [options.callback.callbackSNI] Whether OSS sends SNI to the origin address specified by callbackUrl when a callback request is initiated from the client + * {Object} [options.callback.customValue] Custom parameters are a map of key-values, e.g: + * customValue = { + * key1: 'value1', + * key2: 'value2' + * } + * @return {Object} + */ +proto.put = /*#__PURE__*/function () { + var _put = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name, file, options) { + var content, method, params, result, ret; + return _regenerator.default.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + options = options || {}; + options.disabledMD5 = options.disabledMD5 === undefined ? true : !!options.disabledMD5; + options.headers = options.headers || {}; + name = this._objectName(name); + if (!isBuffer(file)) { + _context2.next = 8; + break; + } + content = file; + _context2.next = 19; + break; + case 8: + if (!(isBlob(file) || isFile(file))) { + _context2.next = 18; + break; + } + if (!options.mime) { + if (isFile(file)) { + options.mime = mime.getType(path.extname(file.name)); + } else { + options.mime = file.type; + } + } + _context2.next = 12; + return this._createBuffer(file, 0, file.size); + case 12: + content = _context2.sent; + _context2.next = 15; + return this._getFileSize(file); + case 15: + options.contentLength = _context2.sent; + _context2.next = 19; + break; + case 18: + throw new TypeError('Must provide Buffer/Blob/File for put.'); + case 19: + this._convertMetaToHeaders(options.meta, options.headers); + method = options.method || 'PUT'; + params = this._objectRequestParams(method, name, options); + callback.encodeCallback(params, options); + params.mime = options.mime; + params.disabledMD5 = options.disabledMD5; + params.content = content; + params.successStatuses = [200]; + _context2.next = 29; + return this.request(params); + case 29: + result = _context2.sent; + ret = { + name: name, + url: this._objectUrl(name), + res: result.res + }; + if (params.headers && params.headers['x-oss-callback']) { + ret.data = JSON.parse(result.data.toString()); + } + return _context2.abrupt("return", ret); + case 33: + case "end": + return _context2.stop(); + } + }, _callee2, this); + })); + function put(_x4, _x5, _x6) { + return _put.apply(this, arguments); + } + return put; +}(); + +/** + * put an object from ReadableStream. If `options.contentLength` is + * not provided, chunked encoding is used. + * @param {String} name the object key + * @param {Readable} stream the ReadableStream + * @param {Object} options + * @return {Object} + */ +proto.putStream = /*#__PURE__*/function () { + var _putStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(name, stream, options) { + var method, params, result, ret; + return _regenerator.default.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + options = options || {}; + options.headers = options.headers || {}; + name = this._objectName(name); + if (options.contentLength) { + options.headers['Content-Length'] = options.contentLength; + } else { + options.headers['Transfer-Encoding'] = 'chunked'; + } + this._convertMetaToHeaders(options.meta, options.headers); + method = options.method || 'PUT'; + params = this._objectRequestParams(method, name, options); + callback.encodeCallback(params, options); + params.mime = options.mime; + params.stream = stream; + params.successStatuses = [200]; + _context3.next = 13; + return this.request(params); + case 13: + result = _context3.sent; + ret = { + name: name, + url: this._objectUrl(name), + res: result.res + }; + if (params.headers && params.headers['x-oss-callback']) { + ret.data = JSON.parse(result.data.toString()); + } + return _context3.abrupt("return", ret); + case 17: + case "end": + return _context3.stop(); + } + }, _callee3, this); + })); + function putStream(_x7, _x8, _x9) { + return _putStream.apply(this, arguments); + } + return putStream; +}(); +merge(proto, require('../common/object/copyObject')); +merge(proto, require('../common/object/getObjectTagging')); +merge(proto, require('../common/object/putObjectTagging')); +merge(proto, require('../common/object/deleteObjectTagging')); +merge(proto, require('../common/image')); +merge(proto, require('../common/object/getBucketVersions')); +merge(proto, require('../common/object/getACL')); +merge(proto, require('../common/object/putACL')); +merge(proto, require('../common/object/head')); +merge(proto, require('../common/object/delete')); +merge(proto, require('../common/object/get')); +merge(proto, require('../common/object/putSymlink')); +merge(proto, require('../common/object/getSymlink')); +merge(proto, require('../common/object/deleteMulti')); +merge(proto, require('../common/object/getObjectMeta')); +merge(proto, require('../common/object/getObjectUrl')); +merge(proto, require('../common/object/generateObjectUrl')); +merge(proto, require('../common/object/signatureUrl')); +merge(proto, require('../common/object/asyncSignatureUrl')); +merge(proto, require('../common/object/signatureUrlV4')); +merge(proto, require('../common/object/signPostObjectPolicyV4')); +proto.putMeta = /*#__PURE__*/function () { + var _putMeta = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(name, meta, options) { + var copyResult; + return _regenerator.default.wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + _context4.next = 2; + return this.copy(name, name, { + meta: meta || {}, + timeout: options && options.timeout, + ctx: options && options.ctx + }); + case 2: + copyResult = _context4.sent; + return _context4.abrupt("return", copyResult); + case 4: + case "end": + return _context4.stop(); + } + }, _callee4, this); + })); + function putMeta(_x10, _x11, _x12) { + return _putMeta.apply(this, arguments); + } + return putMeta; +}(); +proto.list = /*#__PURE__*/function () { + var _list = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(query, options) { + var params, result, objects, that, prefixes; + return _regenerator.default.wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + // prefix, marker, max-keys, delimiter + params = this._objectRequestParams('GET', '', options); + params.query = query; + params.xmlResponse = true; + params.successStatuses = [200]; + _context5.next = 6; + return this.request(params); + case 6: + result = _context5.sent; + objects = result.data.Contents || []; + that = this; + if (objects) { + if (!Array.isArray(objects)) { + objects = [objects]; + } + objects = objects.map(function (obj) { + return { + name: obj.Key, + url: that._objectUrl(obj.Key), + lastModified: obj.LastModified, + etag: obj.ETag, + type: obj.Type, + size: Number(obj.Size), + storageClass: obj.StorageClass, + owner: { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName + }, + restoreInfo: parseRestoreInfo(obj.RestoreInfo) + }; + }); + } + prefixes = result.data.CommonPrefixes || null; + if (prefixes) { + if (!Array.isArray(prefixes)) { + prefixes = [prefixes]; + } + prefixes = prefixes.map(function (item) { + return item.Prefix; + }); + } + return _context5.abrupt("return", { + res: result.res, + objects: objects, + prefixes: prefixes, + nextMarker: result.data.NextMarker || null, + isTruncated: result.data.IsTruncated === 'true' + }); + case 13: + case "end": + return _context5.stop(); + } + }, _callee5, this); + })); + function list(_x13, _x14) { + return _list.apply(this, arguments); + } + return list; +}(); +proto.listV2 = /*#__PURE__*/function () { + var _listV = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(query) { + var options, + continuation_token, + params, + result, + objects, + that, + prefixes, + _args6 = arguments; + return _regenerator.default.wrap(function _callee6$(_context6) { + while (1) switch (_context6.prev = _context6.next) { + case 0: + options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {}; + continuation_token = query['continuation-token'] || query.continuationToken; + if (continuation_token) { + options.subres = Object.assign({ + 'continuation-token': continuation_token + }, options.subres); + } + params = this._objectRequestParams('GET', '', options); + params.query = Object.assign({ + 'list-type': 2 + }, query); + delete params.query['continuation-token']; + delete params.query.continuationToken; + params.xmlResponse = true; + params.successStatuses = [200]; + _context6.next = 11; + return this.request(params); + case 11: + result = _context6.sent; + objects = result.data.Contents || []; + that = this; + if (objects) { + if (!Array.isArray(objects)) { + objects = [objects]; + } + objects = objects.map(function (obj) { + var owner = null; + if (obj.Owner) { + owner = { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName + }; + } + return { + name: obj.Key, + url: that._objectUrl(obj.Key), + lastModified: obj.LastModified, + etag: obj.ETag, + type: obj.Type, + size: Number(obj.Size), + storageClass: obj.StorageClass, + owner: owner, + restoreInfo: parseRestoreInfo(obj.RestoreInfo) + }; + }); + } + prefixes = result.data.CommonPrefixes || null; + if (prefixes) { + if (!Array.isArray(prefixes)) { + prefixes = [prefixes]; + } + prefixes = prefixes.map(function (item) { + return item.Prefix; + }); + } + return _context6.abrupt("return", { + res: result.res, + objects: objects, + prefixes: prefixes, + isTruncated: result.data.IsTruncated === 'true', + keyCount: +result.data.KeyCount, + continuationToken: result.data.ContinuationToken || null, + nextContinuationToken: result.data.NextContinuationToken || null + }); + case 18: + case "end": + return _context6.stop(); + } + }, _callee6, this); + })); + function listV2(_x15) { + return _listV.apply(this, arguments); + } + return listV2; +}(); + +/** + * Restore Object + * @param {String} name the object key + * @param {Object} options + * @returns {{res}} + */ +proto.restore = /*#__PURE__*/function () { + var _restore = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(name) { + var options, + params, + paramsXMLObj, + result, + _args7 = arguments; + return _regenerator.default.wrap(function _callee7$(_context7) { + while (1) switch (_context7.prev = _context7.next) { + case 0: + options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : { + type: 'Archive' + }; + options = options || {}; + options.subres = Object.assign({ + restore: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('POST', name, options); + paramsXMLObj = { + RestoreRequest: { + Days: options.Days ? options.Days : 2 + } + }; + if (options.type === 'ColdArchive' || options.type === 'DeepColdArchive') { + paramsXMLObj.RestoreRequest.JobParameters = { + Tier: options.JobParameters ? options.JobParameters : 'Standard' + }; + } + params.content = obj2xml(paramsXMLObj, { + headers: true + }); + params.mime = 'xml'; + params.successStatuses = [202]; + _context7.next = 12; + return this.request(params); + case 12: + result = _context7.sent; + return _context7.abrupt("return", { + res: result.res + }); + case 14: + case "end": + return _context7.stop(); + } + }, _callee7, this); + })); + function restore(_x16) { + return _restore.apply(this, arguments); + } + return restore; +}(); +proto._objectUrl = function _objectUrl(name) { + return this._getReqUrl({ + bucket: this.options.bucket, + object: name + }); +}; + +/** + * generator request params + * @return {Object} params + * + * @api private + */ + +proto._objectRequestParams = function _objectRequestParams(method, name, options) { + if (!this.options.bucket && !this.options.cname) { + throw new Error('Please create a bucket first'); + } + options = options || {}; + name = this._objectName(name); + var params = { + object: name, + bucket: this.options.bucket, + method: method, + subres: options && options.subres, + additionalHeaders: options && options.additionalHeaders, + timeout: options && options.timeout, + ctx: options && options.ctx + }; + if (options.headers) { + params.headers = {}; + copy(options.headers).to(params.headers); + } + return params; +}; +proto._objectName = function _objectName(name) { + return name.replace(/^\/+/, ''); +}; +proto._convertMetaToHeaders = function _convertMetaToHeaders(meta, headers) { + if (!meta) { + return; + } + Object.keys(meta).forEach(function (k) { + headers["x-oss-meta-".concat(k)] = meta[k]; + }); +}; +proto._deleteFileSafe = function _deleteFileSafe(filepath) { + var _this = this; + return new Promise(function (resolve) { + fs.exists(filepath, function (exists) { + if (!exists) { + resolve(); + } else { + fs.unlink(filepath, function (err) { + if (err) { + _this.debug('unlink %j error: %s', filepath, err, 'error'); + } + resolve(); + }); + } + }); + }); +}; + +},{"../common/callback":24,"../common/image":27,"../common/object/asyncSignatureUrl":31,"../common/object/copyObject":32,"../common/object/delete":33,"../common/object/deleteMulti":34,"../common/object/deleteObjectTagging":35,"../common/object/generateObjectUrl":36,"../common/object/get":37,"../common/object/getACL":38,"../common/object/getBucketVersions":39,"../common/object/getObjectMeta":40,"../common/object/getObjectTagging":41,"../common/object/getObjectUrl":42,"../common/object/getSymlink":43,"../common/object/head":44,"../common/object/putACL":45,"../common/object/putObjectTagging":46,"../common/object/putSymlink":47,"../common/object/signPostObjectPolicyV4":48,"../common/object/signatureUrl":49,"../common/object/signatureUrlV4":50,"../common/utils/isBlob":68,"../common/utils/isBuffer":69,"../common/utils/isFile":71,"../common/utils/obj2xml":76,"../common/utils/parseRestoreInfo":78,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"copy-to":107,"core-js/modules/es.array.map.js":318,"core-js/modules/es.function.name.js":322,"core-js/modules/es.number.constructor.js":324,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.promise.js":333,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.string.replace.js":345,"core-js/modules/web.dom-collections.for-each.js":380,"fs":102,"merge-descriptors":428,"mime":430,"path":439}],6:[function(require,module,exports){ +"use strict"; + +exports.version = '6.23.0'; + +},{}],7:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.abortBucketWorm = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +function abortBucketWorm(_x, _x2) { + return _abortBucketWorm.apply(this, arguments); +} +function _abortBucketWorm() { + _abortBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('DELETE', name, 'worm', options); + _context.next = 4; + return this.request(params); + case 4: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 6: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _abortBucketWorm.apply(this, arguments); +} +exports.abortBucketWorm = abortBucketWorm; + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],8:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.completeBucketWorm = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +function completeBucketWorm(_x, _x2, _x3) { + return _completeBucketWorm.apply(this, arguments); +} +function _completeBucketWorm() { + _completeBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, wormId, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('POST', name, { + wormId: wormId + }, options); + _context.next = 4; + return this.request(params); + case 4: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 6: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _completeBucketWorm.apply(this, arguments); +} +exports.completeBucketWorm = completeBucketWorm; + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],9:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.deleteBucketInventory = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +/** + * deleteBucketInventory + * @param {String} bucketName - bucket name + * @param {String} inventoryId + * @param {Object} options + */ +function deleteBucketInventory(_x, _x2) { + return _deleteBucketInventory.apply(this, arguments); +} +function _deleteBucketInventory() { + _deleteBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, inventoryId) { + var options, + subres, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + subres = Object.assign({ + inventory: '', + inventoryId: inventoryId + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + params = this._bucketRequestParams('DELETE', bucketName, subres, options); + params.successStatuses = [204]; + _context.next = 7; + return this.request(params); + case 7: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 9: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _deleteBucketInventory.apply(this, arguments); +} +exports.deleteBucketInventory = deleteBucketInventory; + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],10:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var proto = exports; +proto.deleteBucketLifecycle = /*#__PURE__*/function () { + var _deleteBucketLifecycle = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('DELETE', name, 'lifecycle', options); + params.successStatuses = [204]; + _context.next = 5; + return this.request(params); + case 5: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 7: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function deleteBucketLifecycle(_x, _x2) { + return _deleteBucketLifecycle.apply(this, arguments); + } + return deleteBucketLifecycle; +}(); + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],11:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var proto = exports; +proto.deleteBucketWebsite = /*#__PURE__*/function () { + var _deleteBucketWebsite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('DELETE', name, 'website', options); + params.successStatuses = [204]; + _context.next = 5; + return this.request(params); + case 5: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 7: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function deleteBucketWebsite(_x, _x2) { + return _deleteBucketWebsite.apply(this, arguments); + } + return deleteBucketWebsite; +}(); + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],12:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.extendBucketWorm = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +var obj2xml_1 = require("../utils/obj2xml"); +function extendBucketWorm(_x, _x2, _x3, _x4) { + return _extendBucketWorm.apply(this, arguments); +} +function _extendBucketWorm() { + _extendBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, wormId, days, options) { + var params, paramlXMLObJ, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('POST', name, { + wormExtend: '', + wormId: wormId + }, options); + paramlXMLObJ = { + ExtendWormConfiguration: { + RetentionPeriodInDays: days + } + }; + params.mime = 'xml'; + params.content = obj2xml_1.obj2xml(paramlXMLObJ, { + headers: true + }); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 10: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _extendBucketWorm.apply(this, arguments); +} +exports.extendBucketWorm = extendBucketWorm; + +},{"../utils/checkBucketName":53,"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],13:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getBucketInventory = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +var formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); +/** + * getBucketInventory + * @param {String} bucketName - bucket name + * @param {String} inventoryId + * @param {Object} options + */ +function getBucketInventory(_x, _x2) { + return _getBucketInventory.apply(this, arguments); +} +function _getBucketInventory() { + _getBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, inventoryId) { + var options, + subres, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + subres = Object.assign({ + inventory: '', + inventoryId: inventoryId + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + params = this._bucketRequestParams('GET', bucketName, subres, options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res, + inventory: formatInventoryConfig_1.formatInventoryConfig(result.data) + }); + case 10: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _getBucketInventory.apply(this, arguments); +} +exports.getBucketInventory = getBucketInventory; + +},{"../utils/checkBucketName":53,"../utils/formatInventoryConfig":63,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],14:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.map.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var _require2 = require('../utils/isArray'), + isArray = _require2.isArray; +var _require3 = require('../utils/formatObjKey'), + formatObjKey = _require3.formatObjKey; +var proto = exports; +proto.getBucketLifecycle = /*#__PURE__*/function () { + var _getBucketLifecycle = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, result, rules; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('GET', name, 'lifecycle', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + rules = result.data.Rule || null; + if (rules) { + if (!isArray(rules)) { + rules = [rules]; + } + rules = rules.map(function (_) { + if (_.ID) { + _.id = _.ID; + delete _.ID; + } + if (_.Tag && !isArray(_.Tag)) { + _.Tag = [_.Tag]; + } + return formatObjKey(_, 'firstLowerCase'); + }); + } + return _context.abrupt("return", { + rules: rules, + res: result.res + }); + case 10: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function getBucketLifecycle(_x, _x2) { + return _getBucketLifecycle.apply(this, arguments); + } + return getBucketLifecycle; +}(); + +},{"../utils/checkBucketName":53,"../utils/formatObjKey":64,"../utils/isArray":67,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.map.js":318}],15:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var proto = exports; +/** + * getBucketVersioning + * @param {String} bucketName - bucket name + */ + +proto.getBucketVersioning = /*#__PURE__*/function () { + var _getBucketVersioning = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, options) { + var params, result, versionStatus; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(bucketName); + params = this._bucketRequestParams('GET', bucketName, 'versioning', options); + params.xmlResponse = true; + params.successStatuses = [200]; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + versionStatus = result.data.Status; + return _context.abrupt("return", { + status: result.status, + versionStatus: versionStatus, + res: result.res + }); + case 9: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function getBucketVersioning(_x, _x2) { + return _getBucketVersioning.apply(this, arguments); + } + return getBucketVersioning; +}(); + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],16:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var _require2 = require('../utils/isObject'), + isObject = _require2.isObject; +var proto = exports; +proto.getBucketWebsite = /*#__PURE__*/function () { + var _getBucketWebsite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, result, routingRules; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + params = this._bucketRequestParams('GET', name, 'website', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + routingRules = []; + if (result.data.RoutingRules && result.data.RoutingRules.RoutingRule) { + if (isObject(result.data.RoutingRules.RoutingRule)) { + routingRules = [result.data.RoutingRules.RoutingRule]; + } else { + routingRules = result.data.RoutingRules.RoutingRule; + } + } + return _context.abrupt("return", { + index: result.data.IndexDocument && result.data.IndexDocument.Suffix || '', + supportSubDir: result.data.IndexDocument && result.data.IndexDocument.SupportSubDir || 'false', + type: result.data.IndexDocument && result.data.IndexDocument.Type, + routingRules: routingRules, + error: result.data.ErrorDocument && result.data.ErrorDocument.Key || null, + res: result.res + }); + case 10: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function getBucketWebsite(_x, _x2) { + return _getBucketWebsite.apply(this, arguments); + } + return getBucketWebsite; +}(); + +},{"../utils/checkBucketName":53,"../utils/isObject":74,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],17:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getBucketWorm = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +var dataFix_1 = require("../utils/dataFix"); +function getBucketWorm(_x, _x2) { + return _getBucketWorm.apply(this, arguments); +} +function _getBucketWorm() { + _getBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('GET', name, 'worm', options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 6; + return this.request(params); + case 6: + result = _context.sent; + dataFix_1.dataFix(result.data, { + lowerFirst: true, + rename: { + RetentionPeriodInDays: 'days' + } + }); + return _context.abrupt("return", Object.assign(Object.assign({}, result.data), { + res: result.res, + status: result.status + })); + case 9: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _getBucketWorm.apply(this, arguments); +} +exports.getBucketWorm = getBucketWorm; + +},{"../utils/checkBucketName":53,"../utils/dataFix":59,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],18:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.initiateBucketWorm = void 0; +var obj2xml_1 = require("../utils/obj2xml"); +var checkBucketName_1 = require("../utils/checkBucketName"); +function initiateBucketWorm(_x, _x2, _x3) { + return _initiateBucketWorm.apply(this, arguments); +} +function _initiateBucketWorm() { + _initiateBucketWorm = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, days, options) { + var params, paramlXMLObJ, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + checkBucketName_1.checkBucketName(name); + params = this._bucketRequestParams('POST', name, 'worm', options); + paramlXMLObJ = { + InitiateWormConfiguration: { + RetentionPeriodInDays: days + } + }; + params.mime = 'xml'; + params.content = obj2xml_1.obj2xml(paramlXMLObJ, { + headers: true + }); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + wormId: result.res.headers['x-oss-worm-id'], + status: result.status + }); + case 10: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _initiateBucketWorm.apply(this, arguments); +} +exports.initiateBucketWorm = initiateBucketWorm; + +},{"../utils/checkBucketName":53,"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],19:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.listBucketInventory = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +var formatInventoryConfig_1 = require("../utils/formatInventoryConfig"); +/** + * listBucketInventory + * @param {String} bucketName - bucket name + * @param {String} inventoryId + * @param {Object} options + */ +function listBucketInventory(_x) { + return _listBucketInventory.apply(this, arguments); +} +function _listBucketInventory() { + _listBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName) { + var options, + continuationToken, + subres, + params, + result, + data, + res, + status, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + continuationToken = options.continuationToken; + subres = Object.assign({ + inventory: '' + }, continuationToken && { + 'continuation-token': continuationToken + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + params = this._bucketRequestParams('GET', bucketName, subres, options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 9; + return this.request(params); + case 9: + result = _context.sent; + data = result.data, res = result.res, status = result.status; + return _context.abrupt("return", { + isTruncated: data.IsTruncated === 'true', + nextContinuationToken: data.NextContinuationToken, + inventoryList: formatInventoryConfig_1.formatInventoryConfig(data.InventoryConfiguration, true), + status: status, + res: res + }); + case 12: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _listBucketInventory.apply(this, arguments); +} +exports.listBucketInventory = listBucketInventory; + +},{"../utils/checkBucketName":53,"../utils/formatInventoryConfig":63,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],20:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.array.concat.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.putBucketInventory = void 0; +var checkBucketName_1 = require("../utils/checkBucketName"); +var obj2xml_1 = require("../utils/obj2xml"); +/** + * putBucketInventory + * @param {String} bucketName - bucket name + * @param {Inventory} inventory + * @param {Object} options + */ +function putBucketInventory(_x, _x2) { + return _putBucketInventory.apply(this, arguments); +} +function _putBucketInventory() { + _putBucketInventory = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(bucketName, inventory) { + var options, + subres, + OSSBucketDestination, + optionalFields, + includedObjectVersions, + destinationBucketPrefix, + rolePrefix, + paramXMLObj, + paramXML, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + subres = Object.assign({ + inventory: '', + inventoryId: inventory.id + }, options.subres); + checkBucketName_1.checkBucketName(bucketName); + OSSBucketDestination = inventory.OSSBucketDestination, optionalFields = inventory.optionalFields, includedObjectVersions = inventory.includedObjectVersions; + destinationBucketPrefix = 'acs:oss:::'; + rolePrefix = "acs:ram::".concat(OSSBucketDestination.accountId, ":role/"); + paramXMLObj = { + InventoryConfiguration: { + Id: inventory.id, + IsEnabled: inventory.isEnabled, + Filter: { + Prefix: inventory.prefix || '' + }, + Destination: { + OSSBucketDestination: { + Format: OSSBucketDestination.format, + AccountId: OSSBucketDestination.accountId, + RoleArn: "".concat(rolePrefix).concat(OSSBucketDestination.rolename), + Bucket: "".concat(destinationBucketPrefix).concat(OSSBucketDestination.bucket), + Prefix: OSSBucketDestination.prefix || '', + Encryption: OSSBucketDestination.encryption || '' + } + }, + Schedule: { + Frequency: inventory.frequency + }, + IncludedObjectVersions: includedObjectVersions, + OptionalFields: { + Field: (optionalFields === null || optionalFields === void 0 ? void 0 : optionalFields.field) || [] + } + } + }; + paramXML = obj2xml_1.obj2xml(paramXMLObj, { + headers: true, + firstUpperCase: true + }); + params = this._bucketRequestParams('PUT', bucketName, subres, options); + params.successStatuses = [200]; + params.mime = 'xml'; + params.content = paramXML; + _context.next = 14; + return this.request(params); + case 14: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 16: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _putBucketInventory.apply(this, arguments); +} +exports.putBucketInventory = putBucketInventory; + +},{"../utils/checkBucketName":53,"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.assign.js":325}],21:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.array.includes.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +/* eslint-disable no-use-before-define */ +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var _require2 = require('../utils/isArray'), + isArray = _require2.isArray; +var _require3 = require('../utils/deepCopy'), + deepCopy = _require3.deepCopy; +var _require4 = require('../utils/isObject'), + isObject = _require4.isObject; +var _require5 = require('../utils/obj2xml'), + obj2xml = _require5.obj2xml; +var _require6 = require('../utils/checkObjectTag'), + checkObjectTag = _require6.checkObjectTag; +var _require7 = require('../utils/getStrBytesCount'), + getStrBytesCount = _require7.getStrBytesCount; +var proto = exports; +proto.putBucketLifecycle = /*#__PURE__*/function () { + var _putBucketLifecycle = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, rules, options) { + var params, Rule, paramXMLObj, paramXML, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _checkBucketName(name); + if (isArray(rules)) { + _context.next = 3; + break; + } + throw new Error('rules must be Array'); + case 3: + params = this._bucketRequestParams('PUT', name, 'lifecycle', options); + Rule = []; + paramXMLObj = { + LifecycleConfiguration: { + Rule: Rule + } + }; + rules.forEach(function (_) { + defaultDaysAndDate2Expiration(_); // todo delete, 兼容旧版本 + checkRule(_); + if (_.id) { + _.ID = _.id; + delete _.id; + } + Rule.push(_); + }); + paramXML = obj2xml(paramXMLObj, { + headers: true, + firstUpperCase: true + }); + params.content = paramXML; + params.mime = 'xml'; + params.successStatuses = [200]; + _context.next = 13; + return this.request(params); + case 13: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 15: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function putBucketLifecycle(_x, _x2, _x3) { + return _putBucketLifecycle.apply(this, arguments); + } + return putBucketLifecycle; +}(); + +// todo delete, 兼容旧版本 +function defaultDaysAndDate2Expiration(obj) { + if (obj.days) { + obj.expiration = { + days: obj.days + }; + } + if (obj.date) { + obj.expiration = { + createdBeforeDate: obj.date + }; + } +} +function checkDaysAndDate(obj, key) { + var days = obj.days, + createdBeforeDate = obj.createdBeforeDate; + if (!days && !createdBeforeDate) { + throw new Error("".concat(key, " must includes days or createdBeforeDate")); + } else if (days && (isArray(days) || !/^[1-9][0-9]*$/.test(days))) { + throw new Error('days must be a positive integer'); + } else if (createdBeforeDate && !/\d{4}-\d{2}-\d{2}T00:00:00.000Z/.test(createdBeforeDate)) { + throw new Error('createdBeforeDate must be date and conform to iso8601 format'); + } +} +function checkNoncurrentDays(obj, key) { + var noncurrentDays = obj.noncurrentDays; + if (!noncurrentDays) { + throw new Error("".concat(key, " must includes noncurrentDays")); + } else if (noncurrentDays && (isArray(noncurrentDays) || !/^[1-9][0-9]*$/.test(noncurrentDays))) { + throw new Error('noncurrentDays must be a positive integer'); + } +} +function handleCheckTag(tag) { + if (!isArray(tag) && !isObject(tag)) { + throw new Error('tag must be Object or Array'); + } + tag = isObject(tag) ? [tag] : tag; + var tagObj = {}; + var tagClone = deepCopy(tag); + tagClone.forEach(function (v) { + tagObj[v.key] = v.value; + }); + checkObjectTag(tagObj); +} +function checkStorageClass(storageClass) { + if (!['IA', 'Archive', 'ColdArchive', 'DeepColdArchive'].includes(storageClass)) throw new Error("StorageClass must be IA or Archive or ColdArchive or DeepColdArchive"); +} +function checkRule(rule) { + if (rule.id && getStrBytesCount(rule.id) > 255) throw new Error('ID is composed of 255 bytes at most'); + if (rule.prefix === undefined) throw new Error('Rule must includes prefix'); + if (!['Enabled', 'Disabled'].includes(rule.status)) throw new Error('Status must be Enabled or Disabled'); + if (!rule.expiration && !rule.noncurrentVersionExpiration && !rule.abortMultipartUpload && !rule.transition && !rule.noncurrentVersionTransition) { + throw new Error('Rule must includes expiration or noncurrentVersionExpiration or abortMultipartUpload or transition or noncurrentVersionTransition'); + } + if (rule.transition) { + checkStorageClass(rule.transition.storageClass); + checkDaysAndDate(rule.transition, 'Transition'); + } + if (rule.expiration) { + if (!rule.expiration.expiredObjectDeleteMarker) { + checkDaysAndDate(rule.expiration, 'Expiration'); + } else if (rule.expiration.days || rule.expiration.createdBeforeDate) { + throw new Error('expiredObjectDeleteMarker cannot be used with days or createdBeforeDate'); + } + } + if (rule.abortMultipartUpload) { + checkDaysAndDate(rule.abortMultipartUpload, 'AbortMultipartUpload'); + } + if (rule.noncurrentVersionTransition) { + checkStorageClass(rule.noncurrentVersionTransition.storageClass); + checkNoncurrentDays(rule.noncurrentVersionTransition, 'NoncurrentVersionTransition'); + } + if (rule.noncurrentVersionExpiration) { + checkNoncurrentDays(rule.noncurrentVersionExpiration, 'NoncurrentVersionExpiration'); + } + if (rule.tag) { + if (rule.abortMultipartUpload) { + throw new Error('Tag cannot be used with abortMultipartUpload'); + } + handleCheckTag(rule.tag); + } +} + +},{"../utils/checkBucketName":53,"../utils/checkObjectTag":56,"../utils/deepCopy":60,"../utils/getStrBytesCount":66,"../utils/isArray":67,"../utils/isObject":74,"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/web.dom-collections.for-each.js":380}],22:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.includes.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var _require2 = require('../utils/obj2xml'), + obj2xml = _require2.obj2xml; +var proto = exports; +/** + * putBucketVersioning + * @param {String} name - bucket name + * @param {String} status + * @param {Object} options + */ + +proto.putBucketVersioning = /*#__PURE__*/function () { + var _putBucketVersioning = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, status) { + var options, + params, + paramXMLObj, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + _checkBucketName(name); + if (['Enabled', 'Suspended'].includes(status)) { + _context.next = 4; + break; + } + throw new Error('status must be Enabled or Suspended'); + case 4: + params = this._bucketRequestParams('PUT', name, 'versioning', options); + paramXMLObj = { + VersioningConfiguration: { + Status: status + } + }; + params.mime = 'xml'; + params.content = obj2xml(paramXMLObj, { + headers: true + }); + _context.next = 10; + return this.request(params); + case 10: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 12: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function putBucketVersioning(_x, _x2) { + return _putBucketVersioning.apply(this, arguments); + } + return putBucketVersioning; +}(); + +},{"../utils/checkBucketName":53,"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.includes.js":315}],23:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var _require2 = require('../utils/obj2xml'), + obj2xml = _require2.obj2xml; +var _require3 = require('../utils/isArray'), + isArray = _require3.isArray; +var proto = exports; +proto.putBucketWebsite = /*#__PURE__*/function () { + var _putBucketWebsite = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var config, + options, + params, + IndexDocument, + WebsiteConfiguration, + website, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + config = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options = _args.length > 2 ? _args[2] : undefined; + _checkBucketName(name); + params = this._bucketRequestParams('PUT', name, 'website', options); + IndexDocument = { + Suffix: config.index || 'index.html' + }; + WebsiteConfiguration = { + IndexDocument: IndexDocument + }; + website = { + WebsiteConfiguration: WebsiteConfiguration + }; + if (config.supportSubDir) { + IndexDocument.SupportSubDir = config.supportSubDir; + } + if (config.type) { + IndexDocument.Type = config.type; + } + if (config.error) { + WebsiteConfiguration.ErrorDocument = { + Key: config.error + }; + } + if (!(config.routingRules !== undefined)) { + _context.next = 14; + break; + } + if (isArray(config.routingRules)) { + _context.next = 13; + break; + } + throw new Error('RoutingRules must be Array'); + case 13: + WebsiteConfiguration.RoutingRules = { + RoutingRule: config.routingRules + }; + case 14: + website = obj2xml(website); + params.content = website; + params.mime = 'xml'; + params.successStatuses = [200]; + _context.next = 20; + return this.request(params); + case 20: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 22: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function putBucketWebsite(_x) { + return _putBucketWebsite.apply(this, arguments); + } + return putBucketWebsite; +}(); + +},{"../utils/checkBucketName":53,"../utils/isArray":67,"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93}],24:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +exports.encodeCallback = function encodeCallback(reqParams, options) { + reqParams.headers = reqParams.headers || {}; + if (!Object.prototype.hasOwnProperty.call(reqParams.headers, 'x-oss-callback')) { + if (options.callback) { + var json = { + callbackUrl: encodeURI(options.callback.url), + callbackBody: options.callback.body + }; + if (options.callback.host) { + json.callbackHost = options.callback.host; + } + if (options.callback.contentType) { + json.callbackBodyType = options.callback.contentType; + } + if (options.callback.callbackSNI) { + json.callbackSNI = options.callback.callbackSNI; + } + var callback = Buffer.from(JSON.stringify(json)).toString('base64'); + reqParams.headers['x-oss-callback'] = callback; + if (options.callback.customValue) { + var callbackVar = {}; + Object.keys(options.callback.customValue).forEach(function (key) { + callbackVar["x:".concat(key)] = options.callback.customValue[key].toString(); + }); + reqParams.headers['x-oss-callback-var'] = Buffer.from(JSON.stringify(callbackVar)).toString('base64'); + } + } + } +}; + +}).call(this)}).call(this,require("buffer").Buffer) +},{"buffer":103,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/web.dom-collections.for-each.js":380}],25:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getReqUrl = void 0; +var copy_to_1 = __importDefault(require("copy-to")); +var url_1 = __importDefault(require("url")); +var merge_descriptors_1 = __importDefault(require("merge-descriptors")); +var is_type_of_1 = __importDefault(require("is-type-of")); +var isIP_1 = require("../utils/isIP"); +var checkConfigValid_1 = require("../utils/checkConfigValid"); +function getReqUrl(params) { + var ep = {}; + var isCname = this.options.cname; + checkConfigValid_1.checkConfigValid(this.options.endpoint, 'endpoint'); + copy_to_1.default(this.options.endpoint, false).to(ep); + if (params.bucket && !isCname && !isIP_1.isIP(ep.hostname) && !this.options.sldEnable) { + ep.host = "".concat(params.bucket, ".").concat(ep.host); + } + var resourcePath = '/'; + if (params.bucket && this.options.sldEnable) { + resourcePath += "".concat(params.bucket, "/"); + } + if (params.object) { + // Preserve '/' in result url + resourcePath += this._escape(params.object).replace(/\+/g, '%2B'); + } + ep.pathname = resourcePath; + var query = {}; + if (params.query) { + merge_descriptors_1.default(query, params.query); + } + if (params.subres) { + var subresAsQuery = {}; + if (is_type_of_1.default.string(params.subres)) { + subresAsQuery[params.subres] = ''; + } else if (is_type_of_1.default.array(params.subres)) { + params.subres.forEach(function (k) { + subresAsQuery[k] = ''; + }); + } else { + subresAsQuery = params.subres; + } + merge_descriptors_1.default(query, subresAsQuery); + } + ep.query = query; + return url_1.default.format(ep); +} +exports.getReqUrl = getReqUrl; + +},{"../utils/checkConfigValid":54,"../utils/isIP":73,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.replace.js":345,"core-js/modules/web.dom-collections.for-each.js":380,"is-type-of":537,"merge-descriptors":428,"url":543}],26:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.string.trim.js"); +var ms = require('humanize-ms'); +var urlutil = require('url'); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var _require2 = require('../utils/setRegion'), + setRegion = _require2.setRegion; +var _require3 = require('../utils/checkConfigValid'), + checkConfigValid = _require3.checkConfigValid; +function setEndpoint(endpoint, secure) { + checkConfigValid(endpoint, 'endpoint'); + var url = urlutil.parse(endpoint); + if (!url.protocol) { + url = urlutil.parse("http".concat(secure ? 's' : '', "://").concat(endpoint)); + } + if (url.protocol !== 'http:' && url.protocol !== 'https:') { + throw new Error('Endpoint protocol must be http or https.'); + } + return url; +} +module.exports = function (options) { + if (!options || !options.accessKeyId || !options.accessKeySecret) { + throw new Error('require accessKeyId, accessKeySecret'); + } + if (options.stsToken && !options.refreshSTSToken && !options.refreshSTSTokenInterval) { + console.warn("It's recommended to set 'refreshSTSToken' and 'refreshSTSTokenInterval' to refresh" + ' stsToken、accessKeyId、accessKeySecret automatically when sts token has expired'); + } + if (options.bucket) { + _checkBucketName(options.bucket); + } + var opts = Object.assign({ + region: 'oss-cn-hangzhou', + internal: false, + secure: false, + timeout: 60000, + bucket: null, + endpoint: null, + cname: false, + isRequestPay: false, + sldEnable: false, + headerEncoding: 'utf-8', + refreshSTSToken: null, + refreshSTSTokenInterval: 60000 * 5, + retryMax: 0, + authorizationV4: false // 启用v4签名,默认关闭 + }, options); + opts.accessKeyId = opts.accessKeyId.trim(); + opts.accessKeySecret = opts.accessKeySecret.trim(); + if (opts.timeout) { + opts.timeout = ms(opts.timeout); + } + if (opts.endpoint) { + opts.endpoint = setEndpoint(opts.endpoint, opts.secure); + } else if (opts.region) { + opts.endpoint = setRegion(opts.region, opts.internal, opts.secure); + } else { + throw new Error('require options.endpoint or options.region'); + } + opts.inited = true; + return opts; +}; + +},{"../utils/checkBucketName":53,"../utils/checkConfigValid":54,"../utils/setRegion":81,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.string.trim.js":349,"humanize-ms":399,"url":543}],27:[function(require,module,exports){ +"use strict"; + +var merge = require('merge-descriptors'); +var proto = exports; +merge(proto, require('./processObjectSave')); + +},{"./processObjectSave":28,"merge-descriptors":428}],28:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.concat.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +/* eslint-disable no-use-before-define */ +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var querystring = require('querystring'); +var _require2 = require('js-base64'), + str2Base64 = _require2.Base64.encode; +var proto = exports; +proto.processObjectSave = /*#__PURE__*/function () { + var _processObjectSave = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(sourceObject, targetObject, process, targetBucket) { + var params, bucketParam, content, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + checkArgs(sourceObject, 'sourceObject'); + checkArgs(targetObject, 'targetObject'); + checkArgs(process, 'process'); + targetObject = this._objectName(targetObject); + if (targetBucket) { + _checkBucketName(targetBucket); + } + params = this._objectRequestParams('POST', sourceObject, { + subres: 'x-oss-process' + }); + bucketParam = targetBucket ? ",b_".concat(str2Base64(targetBucket)) : ''; + targetObject = str2Base64(targetObject); + content = { + 'x-oss-process': "".concat(process, "|sys/saveas,o_").concat(targetObject).concat(bucketParam) + }; + params.content = querystring.stringify(content); + _context.next = 12; + return this.request(params); + case 12: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.res.status + }); + case 14: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function processObjectSave(_x, _x2, _x3, _x4) { + return _processObjectSave.apply(this, arguments); + } + return processObjectSave; +}(); +function checkArgs(name, key) { + if (!name) { + throw new Error("".concat(key, " is required")); + } + if (typeof name !== 'string') { + throw new Error("".concat(key, " must be String")); + } +} + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.concat.js":310,"js-base64":413,"querystring":451}],29:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.function.name.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.promise.js"); +require("core-js/modules/es.array.from.js"); +require("core-js/modules/es.string.iterator.js"); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.array.filter.js"); +require("core-js/modules/es.array.find.js"); +require("core-js/modules/es.regexp.to-string.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +/* eslint-disable no-async-promise-executor */ + +var debug = require('debug')('ali-oss:multipart-copy'); +var copy = require('copy-to'); +var proto = exports; + +/** + * Upload a part copy in a multipart from the source bucket/object + * used with initMultipartUpload and completeMultipartUpload. + * @param {String} name copy object name + * @param {String} uploadId the upload id + * @param {Number} partNo the part number + * @param {String} range like 0-102400 part size need to copy + * @param {Object} sourceData + * {String} sourceData.sourceKey the source object name + * {String} sourceData.sourceBucketName the source bucket name + * @param {Object} options + */ +/* eslint max-len: [0] */ +proto.uploadPartCopy = /*#__PURE__*/function () { + var _uploadPartCopy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, uploadId, partNo, range, sourceData) { + var options, + versionId, + copySource, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 5 && _args[5] !== undefined ? _args[5] : {}; + options.headers = options.headers || {}; + versionId = options.versionId || options.subres && options.subres.versionId || null; + if (versionId) { + copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey), "?versionId=").concat(versionId); + } else { + copySource = "/".concat(sourceData.sourceBucketName, "/").concat(encodeURIComponent(sourceData.sourceKey)); + } + options.headers['x-oss-copy-source'] = copySource; + if (range) { + options.headers['x-oss-copy-source-range'] = "bytes=".concat(range); + } + options.subres = { + partNumber: partNo, + uploadId: uploadId + }; + params = this._objectRequestParams('PUT', name, options); + params.mime = options.mime; + params.successStatuses = [200]; + _context.next = 12; + return this.request(params); + case 12: + result = _context.sent; + return _context.abrupt("return", { + name: name, + etag: result.res.headers.etag, + res: result.res + }); + case 14: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function uploadPartCopy(_x, _x2, _x3, _x4, _x5) { + return _uploadPartCopy.apply(this, arguments); + } + return uploadPartCopy; +}(); + +/** + * @param {String} name copy object name + * @param {Object} sourceData + * {String} sourceData.sourceKey the source object name + * {String} sourceData.sourceBucketName the source bucket name + * {Number} sourceData.startOffset data copy start byte offset, e.g: 0 + * {Number} sourceData.endOffset data copy end byte offset, e.g: 102400 + * @param {Object} options + * {Number} options.partSize + */ +proto.multipartUploadCopy = /*#__PURE__*/function () { + var _multipartUploadCopy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name, sourceData) { + var options, + _options$versionId, + versionId, + metaOpt, + objectMeta, + fileSize, + minPartSize, + copySize, + init, + uploadId, + partSize, + checkpoint, + _args2 = arguments; + return _regenerator.default.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {}; + this.resetCancelFlag(); + _options$versionId = options.versionId, versionId = _options$versionId === void 0 ? null : _options$versionId; + metaOpt = { + versionId: versionId + }; + _context2.next = 6; + return this._getObjectMeta(sourceData.sourceBucketName, sourceData.sourceKey, metaOpt); + case 6: + objectMeta = _context2.sent; + fileSize = objectMeta.res.headers['content-length']; + sourceData.startOffset = sourceData.startOffset || 0; + sourceData.endOffset = sourceData.endOffset || fileSize; + if (!(options.checkpoint && options.checkpoint.uploadId)) { + _context2.next = 14; + break; + } + _context2.next = 13; + return this._resumeMultipartCopy(options.checkpoint, sourceData, options); + case 13: + return _context2.abrupt("return", _context2.sent); + case 14: + minPartSize = 100 * 1024; + copySize = sourceData.endOffset - sourceData.startOffset; + if (!(copySize < minPartSize)) { + _context2.next = 18; + break; + } + throw new Error("copySize must not be smaller than ".concat(minPartSize)); + case 18: + if (!(options.partSize && options.partSize < minPartSize)) { + _context2.next = 20; + break; + } + throw new Error("partSize must not be smaller than ".concat(minPartSize)); + case 20: + _context2.next = 22; + return this.initMultipartUpload(name, options); + case 22: + init = _context2.sent; + uploadId = init.uploadId; + partSize = this._getPartSize(copySize, options.partSize); + checkpoint = { + name: name, + copySize: copySize, + partSize: partSize, + uploadId: uploadId, + doneParts: [] + }; + if (!(options && options.progress)) { + _context2.next = 29; + break; + } + _context2.next = 29; + return options.progress(0, checkpoint, init.res); + case 29: + _context2.next = 31; + return this._resumeMultipartCopy(checkpoint, sourceData, options); + case 31: + return _context2.abrupt("return", _context2.sent); + case 32: + case "end": + return _context2.stop(); + } + }, _callee2, this); + })); + function multipartUploadCopy(_x6, _x7) { + return _multipartUploadCopy.apply(this, arguments); + } + return multipartUploadCopy; +}(); + +/* + * Resume multipart copy from checkpoint. The checkpoint will be + * updated after each successful part copy. + * @param {Object} checkpoint the checkpoint + * @param {Object} options + */ +proto._resumeMultipartCopy = /*#__PURE__*/function () { + var _resumeMultipartCopy2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(checkpoint, sourceData, options) { + var _options$versionId2, versionId, metaOpt, copySize, partSize, uploadId, doneParts, name, partOffs, numParts, uploadPartCopyOptions, uploadPartJob, all, done, todo, defaultParallel, parallel, i, errors, abortEvent, err; + return _regenerator.default.wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + if (!this.isCancel()) { + _context4.next = 2; + break; + } + throw this._makeCancelEvent(); + case 2: + _options$versionId2 = options.versionId, versionId = _options$versionId2 === void 0 ? null : _options$versionId2; + metaOpt = { + versionId: versionId + }; + copySize = checkpoint.copySize, partSize = checkpoint.partSize, uploadId = checkpoint.uploadId, doneParts = checkpoint.doneParts, name = checkpoint.name; + partOffs = this._divideMultipartCopyParts(copySize, partSize, sourceData.startOffset); + numParts = partOffs.length; + uploadPartCopyOptions = { + headers: {} + }; + if (options.copyheaders) { + copy(options.copyheaders).to(uploadPartCopyOptions.headers); + } + if (versionId) { + copy(metaOpt).to(uploadPartCopyOptions); + } + uploadPartJob = function uploadPartJob(self, partNo, source) { + return new Promise( /*#__PURE__*/function () { + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resolve, reject) { + var pi, range, result; + return _regenerator.default.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + if (self.isCancel()) { + _context3.next = 22; + break; + } + pi = partOffs[partNo - 1]; + range = "".concat(pi.start, "-").concat(pi.end - 1); + _context3.prev = 4; + _context3.next = 7; + return self.uploadPartCopy(name, uploadId, partNo, range, source, uploadPartCopyOptions); + case 7: + result = _context3.sent; + _context3.next = 15; + break; + case 10: + _context3.prev = 10; + _context3.t0 = _context3["catch"](4); + if (!(_context3.t0.status === 404)) { + _context3.next = 14; + break; + } + throw self._makeAbortEvent(); + case 14: + throw _context3.t0; + case 15: + if (self.isCancel()) { + _context3.next = 22; + break; + } + debug("content-range ".concat(result.res.headers['content-range'])); + doneParts.push({ + number: partNo, + etag: result.res.headers.etag + }); + checkpoint.doneParts = doneParts; + if (!(options && options.progress)) { + _context3.next = 22; + break; + } + _context3.next = 22; + return options.progress(doneParts.length / numParts, checkpoint, result.res); + case 22: + resolve(); + _context3.next = 29; + break; + case 25: + _context3.prev = 25; + _context3.t1 = _context3["catch"](0); + _context3.t1.partNum = partNo; + reject(_context3.t1); + case 29: + case "end": + return _context3.stop(); + } + }, _callee3, null, [[0, 25], [4, 10]]); + })); + return function (_x11, _x12) { + return _ref.apply(this, arguments); + }; + }()); + }; + all = Array.from(new Array(numParts), function (x, i) { + return i + 1; + }); + done = doneParts.map(function (p) { + return p.number; + }); + todo = all.filter(function (p) { + return done.indexOf(p) < 0; + }); + defaultParallel = 5; + parallel = options.parallel || defaultParallel; + if (!(this.checkBrowserAndVersion('Internet Explorer', '10') || parallel === 1)) { + _context4.next = 28; + break; + } + i = 0; + case 18: + if (!(i < todo.length)) { + _context4.next = 26; + break; + } + if (!this.isCancel()) { + _context4.next = 21; + break; + } + throw this._makeCancelEvent(); + case 21: + _context4.next = 23; + return uploadPartJob(this, todo[i], sourceData); + case 23: + i++; + _context4.next = 18; + break; + case 26: + _context4.next = 40; + break; + case 28: + _context4.next = 30; + return this._parallelNode(todo, parallel, uploadPartJob, sourceData); + case 30: + errors = _context4.sent; + abortEvent = errors.find(function (err) { + return err.name === 'abort'; + }); + if (!abortEvent) { + _context4.next = 34; + break; + } + throw abortEvent; + case 34: + if (!this.isCancel()) { + _context4.next = 36; + break; + } + throw this._makeCancelEvent(); + case 36: + if (!(errors && errors.length > 0)) { + _context4.next = 40; + break; + } + err = errors[0]; + err.message = "Failed to copy some parts with error: ".concat(err.toString(), " part_num: ").concat(err.partNum); + throw err; + case 40: + _context4.next = 42; + return this.completeMultipartUpload(name, uploadId, doneParts, options); + case 42: + return _context4.abrupt("return", _context4.sent); + case 43: + case "end": + return _context4.stop(); + } + }, _callee4, this); + })); + function _resumeMultipartCopy(_x8, _x9, _x10) { + return _resumeMultipartCopy2.apply(this, arguments); + } + return _resumeMultipartCopy; +}(); +proto._divideMultipartCopyParts = function _divideMultipartCopyParts(fileSize, partSize, startOffset) { + var numParts = Math.ceil(fileSize / partSize); + var partOffs = []; + for (var i = 0; i < numParts; i++) { + var start = partSize * i + startOffset; + var end = Math.min(start + partSize, fileSize + startOffset); + partOffs.push({ + start: start, + end: end + }); + } + return partOffs; +}; + +/** + * Get Object Meta + * @param {String} bucket bucket name + * @param {String} name object name + * @param {Object} options + */ +proto._getObjectMeta = /*#__PURE__*/function () { + var _getObjectMeta2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(bucket, name, options) { + var currentBucket, data; + return _regenerator.default.wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + currentBucket = this.getBucket(); + this.setBucket(bucket); + _context5.next = 4; + return this.head(name, options); + case 4: + data = _context5.sent; + this.setBucket(currentBucket); + return _context5.abrupt("return", data); + case 7: + case "end": + return _context5.stop(); + } + }, _callee5, this); + })); + function _getObjectMeta(_x13, _x14, _x15) { + return _getObjectMeta2.apply(this, arguments); + } + return _getObjectMeta; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.find.js":313,"core-js/modules/es.array.from.js":314,"core-js/modules/es.array.map.js":318,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.promise.js":333,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.string.iterator.js":343,"debug":536}],30:[function(require,module,exports){ +(function (process){(function (){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.array.filter.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.array.sort.js"); +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.regexp.to-string.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var copy = require('copy-to'); +var callback = require('./callback'); +var _require = require('./utils/deepCopy'), + deepCopyWith = _require.deepCopyWith; +var _require2 = require('./utils/isBuffer'), + isBuffer = _require2.isBuffer; +var _require3 = require('./utils/omit'), + omit = _require3.omit; +var proto = exports; + +/** + * List the on-going multipart uploads + * https://help.aliyun.com/document_detail/31997.html + * @param {Object} options + * @return {Array} the multipart uploads + */ +proto.listUploads = /*#__PURE__*/function () { + var _listUploads = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(query, options) { + var opt, params, result, uploads; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.subres = 'uploads'; + params = this._objectRequestParams('GET', '', opt); + params.query = query; + params.xmlResponse = true; + params.successStatuses = [200]; + _context.next = 10; + return this.request(params); + case 10: + result = _context.sent; + uploads = result.data.Upload || []; + if (!Array.isArray(uploads)) { + uploads = [uploads]; + } + uploads = uploads.map(function (up) { + return { + name: up.Key, + uploadId: up.UploadId, + initiated: up.Initiated + }; + }); + return _context.abrupt("return", { + res: result.res, + uploads: uploads, + bucket: result.data.Bucket, + nextKeyMarker: result.data.NextKeyMarker, + nextUploadIdMarker: result.data.NextUploadIdMarker, + isTruncated: result.data.IsTruncated === 'true' + }); + case 15: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function listUploads(_x, _x2) { + return _listUploads.apply(this, arguments); + } + return listUploads; +}(); + +/** + * List the done uploadPart parts + * @param {String} name object name + * @param {String} uploadId multipart upload id + * @param {Object} query + * {Number} query.max-parts The maximum part number in the response of the OSS. Default value: 1000 + * {Number} query.part-number-marker Starting position of a specific list. + * {String} query.encoding-type Specify the encoding of the returned content and the encoding type. + * @param {Object} options + * @return {Object} result + */ +proto.listParts = /*#__PURE__*/function () { + var _listParts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(name, uploadId, query, options) { + var opt, params, result; + return _regenerator.default.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.subres = { + uploadId: uploadId + }; + params = this._objectRequestParams('GET', name, opt); + params.query = query; + params.xmlResponse = true; + params.successStatuses = [200]; + _context2.next = 10; + return this.request(params); + case 10: + result = _context2.sent; + return _context2.abrupt("return", { + res: result.res, + uploadId: result.data.UploadId, + bucket: result.data.Bucket, + name: result.data.Key, + partNumberMarker: result.data.PartNumberMarker, + nextPartNumberMarker: result.data.NextPartNumberMarker, + maxParts: result.data.MaxParts, + isTruncated: result.data.IsTruncated, + parts: result.data.Part || [] + }); + case 12: + case "end": + return _context2.stop(); + } + }, _callee2, this); + })); + function listParts(_x3, _x4, _x5, _x6) { + return _listParts.apply(this, arguments); + } + return listParts; +}(); + +/** + * Abort a multipart upload transaction + * @param {String} name the object name + * @param {String} uploadId the upload id + * @param {Object} options + */ +proto.abortMultipartUpload = /*#__PURE__*/function () { + var _abortMultipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(name, uploadId, options) { + var opt, params, result; + return _regenerator.default.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + this._stop(); + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.subres = { + uploadId: uploadId + }; + params = this._objectRequestParams('DELETE', name, opt); + params.successStatuses = [204]; + _context3.next = 9; + return this.request(params); + case 9: + result = _context3.sent; + return _context3.abrupt("return", { + res: result.res + }); + case 11: + case "end": + return _context3.stop(); + } + }, _callee3, this); + })); + function abortMultipartUpload(_x7, _x8, _x9) { + return _abortMultipartUpload.apply(this, arguments); + } + return abortMultipartUpload; +}(); + +/** + * Initiate a multipart upload transaction + * @param {String} name the object name + * @param {Object} options + * @return {String} upload id + */ +proto.initMultipartUpload = /*#__PURE__*/function () { + var _initMultipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(name, options) { + var opt, params, result; + return _regenerator.default.wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.headers = opt.headers || {}; + this._convertMetaToHeaders(options.meta, opt.headers); + opt.subres = 'uploads'; + params = this._objectRequestParams('POST', name, opt); + params.mime = options.mime; + params.xmlResponse = true; + params.successStatuses = [200]; + _context4.next = 12; + return this.request(params); + case 12: + result = _context4.sent; + return _context4.abrupt("return", { + res: result.res, + bucket: result.data.Bucket, + name: result.data.Key, + uploadId: result.data.UploadId + }); + case 14: + case "end": + return _context4.stop(); + } + }, _callee4, this); + })); + function initMultipartUpload(_x10, _x11) { + return _initMultipartUpload.apply(this, arguments); + } + return initMultipartUpload; +}(); + +/** + * Upload a part in a multipart upload transaction + * @param {String} name the object name + * @param {String} uploadId the upload id + * @param {Integer} partNo the part number + * @param {File} file upload File, whole File + * @param {Integer} start part start bytes e.g: 102400 + * @param {Integer} end part end bytes e.g: 204800 + * @param {Object} options + */ +proto.uploadPart = /*#__PURE__*/function () { + var _uploadPart2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(name, uploadId, partNo, file, start, end, options) { + var data, isBrowserEnv; + return _regenerator.default.wrap(function _callee5$(_context5) { + while (1) switch (_context5.prev = _context5.next) { + case 0: + data = { + size: end - start + }; + isBrowserEnv = process && process.browser; + if (!isBrowserEnv) { + _context5.next = 8; + break; + } + _context5.next = 5; + return this._createBuffer(file, start, end); + case 5: + data.content = _context5.sent; + _context5.next = 11; + break; + case 8: + _context5.next = 10; + return this._createStream(file, start, end); + case 10: + data.stream = _context5.sent; + case 11: + _context5.next = 13; + return this._uploadPart(name, uploadId, partNo, data, options); + case 13: + return _context5.abrupt("return", _context5.sent); + case 14: + case "end": + return _context5.stop(); + } + }, _callee5, this); + })); + function uploadPart(_x12, _x13, _x14, _x15, _x16, _x17, _x18) { + return _uploadPart2.apply(this, arguments); + } + return uploadPart; +}(); + +/** + * Complete a multipart upload transaction + * @param {String} name the object name + * @param {String} uploadId the upload id + * @param {Array} parts the uploaded parts, each in the structure: + * {Integer} number partNo + * {String} etag part etag uploadPartCopy result.res.header.etag + * @param {Object} options + * {Object} [options.callback] The callback parameter is composed of a JSON string encoded in Base64 + * {String} options.callback.url the OSS sends a callback request to this URL + * {String} [options.callback.host] The host header value for initiating callback requests + * {String} options.callback.body The value of the request body when a callback is initiated + * {String} [options.callback.contentType] The Content-Type of the callback requests initiated + * {Boolean} [options.callback.callbackSNI] Whether OSS sends SNI to the origin address specified by callbackUrl when a callback request is initiated from the client + * {Object} [options.callback.customValue] Custom parameters are a map of key-values, e.g: + * customValue = { + * key1: 'value1', + * key2: 'value2' + * } + */ +proto.completeMultipartUpload = /*#__PURE__*/function () { + var _completeMultipartUpload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(name, uploadId, parts, options) { + var completeParts, xml, i, p, opt, params, result, ret; + return _regenerator.default.wrap(function _callee6$(_context6) { + while (1) switch (_context6.prev = _context6.next) { + case 0: + completeParts = parts.concat().sort(function (a, b) { + return a.number - b.number; + }).filter(function (item, index, arr) { + return !index || item.number !== arr[index - 1].number; + }); + xml = '\n\n'; + for (i = 0; i < completeParts.length; i++) { + p = completeParts[i]; + xml += '\n'; + xml += "".concat(p.number, "\n"); + xml += "".concat(p.etag, "\n"); + xml += '\n'; + } + xml += ''; + options = options || {}; + opt = {}; + opt = deepCopyWith(options, function (_) { + if (isBuffer(_)) return null; + }); + opt.subres = { + uploadId: uploadId + }; + opt.headers = omit(opt.headers, ['x-oss-server-side-encryption', 'x-oss-storage-class']); + params = this._objectRequestParams('POST', name, opt); + callback.encodeCallback(params, opt); + params.mime = 'xml'; + params.content = xml; + if (!(params.headers && params.headers['x-oss-callback'])) { + params.xmlResponse = true; + } + params.successStatuses = [200]; + _context6.next = 17; + return this.request(params); + case 17: + result = _context6.sent; + if (!options.progress) { + _context6.next = 21; + break; + } + _context6.next = 21; + return options.progress(1, null, result.res); + case 21: + ret = { + res: result.res, + bucket: params.bucket, + name: name, + etag: result.res.headers.etag + }; + if (params.headers && params.headers['x-oss-callback']) { + ret.data = JSON.parse(result.data.toString()); + } + return _context6.abrupt("return", ret); + case 24: + case "end": + return _context6.stop(); + } + }, _callee6, this); + })); + function completeMultipartUpload(_x19, _x20, _x21, _x22) { + return _completeMultipartUpload.apply(this, arguments); + } + return completeMultipartUpload; +}(); + +/** + * Upload a part in a multipart upload transaction + * @param {String} name the object name + * @param {String} uploadId the upload id + * @param {Integer} partNo the part number + * @param {Object} data the body data + * @param {Object} options + */ +proto._uploadPart = /*#__PURE__*/function () { + var _uploadPart3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(name, uploadId, partNo, data, options) { + var opt, params, isBrowserEnv, result; + return _regenerator.default.wrap(function _callee7$(_context7) { + while (1) switch (_context7.prev = _context7.next) { + case 0: + options = options || {}; + opt = {}; + copy(options).to(opt); + opt.headers = opt.headers || {}; + opt.headers['Content-Length'] = data.size; + + // Uploading shards does not require x-oss headers. + opt.headers = omit(opt.headers, ['x-oss-server-side-encryption', 'x-oss-storage-class']); + opt.subres = { + partNumber: partNo, + uploadId: uploadId + }; + params = this._objectRequestParams('PUT', name, opt); + params.mime = opt.mime; + isBrowserEnv = process && process.browser; + isBrowserEnv ? params.content = data.content : params.stream = data.stream; + params.successStatuses = [200]; + params.disabledMD5 = options.disabledMD5; + _context7.next = 15; + return this.request(params); + case 15: + result = _context7.sent; + if (result.res.headers.etag) { + _context7.next = 18; + break; + } + throw new Error('Please set the etag of expose-headers in OSS \n https://help.aliyun.com/document_detail/32069.html'); + case 18: + if (data.stream) { + data.stream = null; + params.stream = null; + } + return _context7.abrupt("return", { + name: name, + etag: result.res.headers.etag, + res: result.res + }); + case 20: + case "end": + return _context7.stop(); + } + }, _callee7, this); + })); + function _uploadPart(_x23, _x24, _x25, _x26, _x27) { + return _uploadPart3.apply(this, arguments); + } + return _uploadPart; +}(); + +}).call(this)}).call(this,require('_process')) +},{"./callback":24,"./utils/deepCopy":60,"./utils/isBuffer":69,"./utils/omit":77,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"_process":538,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.map.js":318,"core-js/modules/es.array.sort.js":320,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.to-string.js":339}],31:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.regexp.exec.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var urlutil = require('url'); +var utility = require('utility'); +var copy = require('copy-to'); +var signHelper = require('../../common/signUtils'); +var _require = require('../utils/isIP'), + isIP = _require.isIP; +var _require2 = require('../utils/setSTSToken'), + setSTSToken = _require2.setSTSToken; +var _require3 = require('../utils/isFunction'), + isFunction = _require3.isFunction; +var proto = exports; + +/** + * asyncSignatureUrl + * @param {String} name object name + * @param {Object} options options + * @param {boolean} [strictObjectNameValidation=true] the flag of verifying object name strictly + */ +proto.asyncSignatureUrl = /*#__PURE__*/function () { + var _asyncSignatureUrl = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var strictObjectNameValidation, + expires, + params, + resource, + signRes, + url, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + strictObjectNameValidation = _args.length > 2 && _args[2] !== undefined ? _args[2] : true; + if (!isIP(this.options.endpoint.hostname)) { + _context.next = 3; + break; + } + throw new Error('can not get the object URL when endpoint is IP'); + case 3: + if (!(strictObjectNameValidation && /^\?/.test(name))) { + _context.next = 5; + break; + } + throw new Error("Invalid object name ".concat(name)); + case 5: + options = options || {}; + name = this._objectName(name); + options.method = options.method || 'GET'; + expires = utility.timestamp() + (options.expires || 1800); + params = { + bucket: this.options.bucket, + object: name + }; + resource = this._getResource(params); + if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { + _context.next = 14; + break; + } + _context.next = 14; + return setSTSToken.call(this); + case 14: + if (this.options.stsToken) { + options['security-token'] = this.options.stsToken; + } + signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires); + url = urlutil.parse(this._getReqUrl(params)); + url.query = { + OSSAccessKeyId: this.options.accessKeyId, + Expires: expires, + Signature: signRes.Signature + }; + copy(signRes.subResource).to(url.query); + return _context.abrupt("return", url.format()); + case 20: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function asyncSignatureUrl(_x, _x2) { + return _asyncSignatureUrl.apply(this, arguments); + } + return asyncSignatureUrl; +}(); + +},{"../../common/signUtils":52,"../utils/isFunction":72,"../utils/isIP":73,"../utils/setSTSToken":82,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"copy-to":107,"core-js/modules/es.regexp.exec.js":338,"url":543,"utility":545}],32:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.array.find.js"); +require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkBucketName'), + _checkBucketName = _require.checkBucketName; +var proto = exports; +var REPLACE_HEDERS = ['content-type', 'content-encoding', 'content-language', 'content-disposition', 'cache-control', 'expires']; +proto.copy = /*#__PURE__*/function () { + var _copy = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, sourceName, bucketName, options) { + var params, result, data; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + if ((0, _typeof2.default)(bucketName) === 'object') { + options = bucketName; // 兼容旧版本,旧版本第三个参数为options + } + options = options || {}; + options.headers = options.headers || {}; + Object.keys(options.headers).forEach(function (key) { + options.headers["x-oss-copy-source-".concat(key.toLowerCase())] = options.headers[key]; + }); + if (options.meta || Object.keys(options.headers).find(function (_) { + return REPLACE_HEDERS.includes(_.toLowerCase()); + })) { + options.headers['x-oss-metadata-directive'] = 'REPLACE'; + } + this._convertMetaToHeaders(options.meta, options.headers); + sourceName = this._getSourceName(sourceName, bucketName); + if (options.versionId) { + sourceName = "".concat(sourceName, "?versionId=").concat(options.versionId); + } + options.headers['x-oss-copy-source'] = sourceName; + params = this._objectRequestParams('PUT', name, options); + params.xmlResponse = true; + params.successStatuses = [200, 304]; + _context.next = 14; + return this.request(params); + case 14: + result = _context.sent; + data = result.data; + if (data) { + data = { + etag: data.ETag, + lastModified: data.LastModified + }; + } + return _context.abrupt("return", { + data: data, + res: result.res + }); + case 18: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function copy(_x, _x2, _x3, _x4) { + return _copy.apply(this, arguments); + } + return copy; +}(); + +// todo delete +proto._getSourceName = function _getSourceName(sourceName, bucketName) { + if (typeof bucketName === 'string') { + sourceName = this._objectName(sourceName); + } else if (sourceName[0] !== '/') { + bucketName = this.options.bucket; + } else { + bucketName = sourceName.replace(/\/(.+?)(\/.*)/, '$1'); + sourceName = sourceName.replace(/(\/.+?\/)(.*)/, '$2'); + } + _checkBucketName(bucketName); + sourceName = encodeURIComponent(sourceName); + sourceName = "/".concat(bucketName, "/").concat(sourceName); + return sourceName; +}; + +},{"../utils/checkBucketName":53,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/helpers/typeof":91,"@babel/runtime/regenerator":93,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.find.js":313,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.replace.js":345,"core-js/modules/web.dom-collections.for-each.js":380}],33:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; +/** + * delete + * @param {String} name - object name + * @param {Object} options + * @param {{res}} + */ + +proto.delete = /*#__PURE__*/function () { + var _delete2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({}, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('DELETE', name, options); + params.successStatuses = [204]; + _context.next = 7; + return this.request(params); + case 7: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 9: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function _delete(_x) { + return _delete2.apply(this, arguments); + } + return _delete; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],34:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +/* eslint-disable object-curly-newline */ +var utility = require('utility'); +var _require = require('../utils/obj2xml'), + obj2xml = _require.obj2xml; +var proto = exports; +proto.deleteMulti = /*#__PURE__*/function () { + var _deleteMulti = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(names) { + var options, + objects, + i, + object, + _names$i, + key, + versionId, + paramXMLObj, + paramXML, + params, + result, + r, + deleted, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + objects = []; + if (!(!names || !names.length)) { + _context.next = 4; + break; + } + throw new Error('names is required'); + case 4: + for (i = 0; i < names.length; i++) { + object = {}; + if (typeof names[i] === 'string') { + object.Key = utility.escape(this._objectName(names[i])); + } else { + _names$i = names[i], key = _names$i.key, versionId = _names$i.versionId; + object.Key = utility.escape(this._objectName(key)); + object.VersionId = versionId; + } + objects.push(object); + } + paramXMLObj = { + Delete: { + Quiet: !!options.quiet, + Object: objects + } + }; + paramXML = obj2xml(paramXMLObj, { + headers: true + }); + options.subres = Object.assign({ + delete: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('POST', '', options); + params.mime = 'xml'; + params.content = paramXML; + params.xmlResponse = true; + params.successStatuses = [200]; + _context.next = 16; + return this.request(params); + case 16: + result = _context.sent; + r = result.data; + deleted = r && r.Deleted || null; + if (deleted) { + if (!Array.isArray(deleted)) { + deleted = [deleted]; + } + } + return _context.abrupt("return", { + res: result.res, + deleted: deleted || [] + }); + case 21: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function deleteMulti(_x) { + return _deleteMulti.apply(this, arguments); + } + return deleteMulti; +}(); + +},{"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325,"utility":545}],35:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; +/** + * deleteObjectTagging + * @param {String} name - object name + * @param {Object} options + */ + +proto.deleteObjectTagging = /*#__PURE__*/function () { + var _deleteObjectTagging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + tagging: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('DELETE', name, options); + params.successStatuses = [204]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 10: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function deleteObjectTagging(_x) { + return _deleteObjectTagging.apply(this, arguments); + } + return deleteObjectTagging; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],36:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.concat.js"); +var urlutil = require('url'); +var _require = require('../utils/isIP'), + isIP = _require.isIP; +var proto = exports; + +/** + * Get Object url by name + * @param {String} name - object name + * @param {String} [baseUrl] - If provide `baseUrl`, will use `baseUrl` instead the default `endpoint and bucket`. + * @return {String} object url include bucket + */ +proto.generateObjectUrl = function generateObjectUrl(name, baseUrl) { + if (isIP(this.options.endpoint.hostname)) { + throw new Error('can not get the object URL when endpoint is IP'); + } + if (!baseUrl) { + baseUrl = this.options.endpoint.format(); + var copyUrl = urlutil.parse(baseUrl); + var bucket = this.options.bucket; + copyUrl.hostname = "".concat(bucket, ".").concat(copyUrl.hostname); + copyUrl.host = "".concat(bucket, ".").concat(copyUrl.host); + baseUrl = copyUrl.format(); + } else if (baseUrl[baseUrl.length - 1] !== '/') { + baseUrl += '/'; + } + return baseUrl + this._escape(this._objectName(name)); +}; + +},{"../utils/isIP":73,"core-js/modules/es.array.concat.js":310,"url":543}],37:[function(require,module,exports){ +(function (process){(function (){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var fs = require('fs'); +var is = require('is-type-of'); +var _require = require('../utils/isObject'), + isObject = _require.isObject; +var proto = exports; +/** + * get + * @param {String} name - object name + * @param {String | Stream | Object} file - file path or file stream or options + * @param {Object} options + * @param {{res}} + */ +proto.get = /*#__PURE__*/function () { + var _get = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, file) { + var options, + writeStream, + needDestroy, + isBrowserEnv, + responseCacheControl, + defaultSubresOptions, + result, + params, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + writeStream = null; + needDestroy = false; + if (is.writableStream(file)) { + writeStream = file; + } else if (is.string(file)) { + writeStream = fs.createWriteStream(file); + needDestroy = true; + } else if (isObject(file)) { + // get(name, options) + options = file; + } + options = options || {}; + isBrowserEnv = process && process.browser; + responseCacheControl = options.responseCacheControl === null ? '' : 'no-cache'; + defaultSubresOptions = isBrowserEnv && responseCacheControl ? { + 'response-cache-control': responseCacheControl + } : {}; + options.subres = Object.assign(defaultSubresOptions, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + if (options.process) { + options.subres['x-oss-process'] = options.process; + } + _context.prev = 11; + params = this._objectRequestParams('GET', name, options); + params.writeStream = writeStream; + params.successStatuses = [200, 206, 304]; + _context.next = 17; + return this.request(params); + case 17: + result = _context.sent; + if (needDestroy) { + writeStream.destroy(); + } + _context.next = 28; + break; + case 21: + _context.prev = 21; + _context.t0 = _context["catch"](11); + if (!needDestroy) { + _context.next = 27; + break; + } + writeStream.destroy(); + // should delete the exists file before throw error + _context.next = 27; + return this._deleteFileSafe(file); + case 27: + throw _context.t0; + case 28: + return _context.abrupt("return", { + res: result.res, + content: result.data + }); + case 29: + case "end": + return _context.stop(); + } + }, _callee, this, [[11, 21]]); + })); + function get(_x, _x2) { + return _get.apply(this, arguments); + } + return get; +}(); + +}).call(this)}).call(this,require('_process')) +},{"../utils/isObject":74,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"_process":538,"core-js/modules/es.object.assign.js":325,"fs":102,"is-type-of":537}],38:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; + +/* + * Get object's ACL + * @param {String} name the object key + * @param {Object} options + * @return {Object} + */ +proto.getACL = /*#__PURE__*/function () { + var _getACL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + params, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + acl: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('GET', name, options); + params.successStatuses = [200]; + params.xmlResponse = true; + _context.next = 9; + return this.request(params); + case 9: + result = _context.sent; + return _context.abrupt("return", { + acl: result.data.AccessControlList.Grant, + owner: { + id: result.data.Owner.ID, + displayName: result.data.Owner.DisplayName + }, + res: result.res + }); + case 11: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function getACL(_x) { + return _getACL.apply(this, arguments); + } + return getACL; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],39:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.number.constructor.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +/* eslint-disable no-use-before-define */ +var proto = exports; +var _require = require('../utils/isObject'), + isObject = _require.isObject; +var _require2 = require('../utils/isArray'), + isArray = _require2.isArray; +var _require3 = require('../utils/parseRestoreInfo'), + parseRestoreInfo = _require3.parseRestoreInfo; +proto.getBucketVersions = getBucketVersions; +proto.listObjectVersions = getBucketVersions; +function getBucketVersions() { + return _getBucketVersions.apply(this, arguments); +} +function _getBucketVersions() { + _getBucketVersions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { + var query, + options, + params, + result, + objects, + deleteMarker, + that, + prefixes, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + query = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + if (!(query.versionIdMarker && query.keyMarker === undefined)) { + _context.next = 4; + break; + } + throw new Error('A version-id marker cannot be specified without a key marker'); + case 4: + options.subres = Object.assign({ + versions: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('GET', '', options); + params.xmlResponse = true; + params.successStatuses = [200]; + params.query = formatQuery(query); + _context.next = 12; + return this.request(params); + case 12: + result = _context.sent; + objects = result.data.Version || []; + deleteMarker = result.data.DeleteMarker || []; + that = this; + if (objects) { + if (!Array.isArray(objects)) { + objects = [objects]; + } + objects = objects.map(function (obj) { + return { + name: obj.Key, + url: that._objectUrl(obj.Key), + lastModified: obj.LastModified, + isLatest: obj.IsLatest === 'true', + versionId: obj.VersionId, + etag: obj.ETag, + type: obj.Type, + size: Number(obj.Size), + storageClass: obj.StorageClass, + owner: { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName + }, + restoreInfo: parseRestoreInfo(obj.RestoreInfo) + }; + }); + } + if (deleteMarker) { + if (!isArray(deleteMarker)) { + deleteMarker = [deleteMarker]; + } + deleteMarker = deleteMarker.map(function (obj) { + return { + name: obj.Key, + lastModified: obj.LastModified, + versionId: obj.VersionId, + owner: { + id: obj.Owner.ID, + displayName: obj.Owner.DisplayName + } + }; + }); + } + prefixes = result.data.CommonPrefixes || null; + if (prefixes) { + if (!isArray(prefixes)) { + prefixes = [prefixes]; + } + prefixes = prefixes.map(function (item) { + return item.Prefix; + }); + } + return _context.abrupt("return", { + res: result.res, + objects: objects, + deleteMarker: deleteMarker, + prefixes: prefixes, + // attirbute of legacy error + nextMarker: result.data.NextKeyMarker || null, + // attirbute of legacy error + NextVersionIdMarker: result.data.NextVersionIdMarker || null, + nextKeyMarker: result.data.NextKeyMarker || null, + nextVersionIdMarker: result.data.NextVersionIdMarker || null, + isTruncated: result.data.IsTruncated === 'true' + }); + case 21: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _getBucketVersions.apply(this, arguments); +} +function camel2Line(name) { + return name.replace(/([A-Z])/g, '-$1').toLowerCase(); +} +function formatQuery() { + var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var obj = {}; + if (isObject(query)) { + Object.keys(query).forEach(function (key) { + obj[camel2Line(key)] = query[key]; + }); + } + return obj; +} + +},{"../utils/isArray":67,"../utils/isObject":74,"../utils/parseRestoreInfo":78,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.map.js":318,"core-js/modules/es.number.constructor.js":324,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.replace.js":345,"core-js/modules/web.dom-collections.for-each.js":380}],40:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; +/** + * getObjectMeta + * @param {String} name - object name + * @param {Object} options + * @param {{res}} + */ + +proto.getObjectMeta = /*#__PURE__*/function () { + var _getObjectMeta = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + name = this._objectName(name); + options.subres = Object.assign({ + objectMeta: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('HEAD', name, options); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + return _context.abrupt("return", { + status: result.status, + res: result.res + }); + case 10: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function getObjectMeta(_x, _x2) { + return _getObjectMeta.apply(this, arguments); + } + return getObjectMeta; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],41:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; +var _require = require('../utils/isObject'), + isObject = _require.isObject; +/** + * getObjectTagging + * @param {String} name - object name + * @param {Object} options + * @return {Object} + */ + +proto.getObjectTagging = /*#__PURE__*/function () { + var _getObjectTagging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + params, + result, + Tagging, + Tag, + tag, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + tagging: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('GET', name, options); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + _context.next = 11; + return this.parseXML(result.data); + case 11: + Tagging = _context.sent; + Tag = Tagging.TagSet.Tag; + Tag = Tag && isObject(Tag) ? [Tag] : Tag || []; + tag = {}; + Tag.forEach(function (item) { + tag[item.Key] = item.Value; + }); + return _context.abrupt("return", { + status: result.status, + res: result.res, + tag: tag + }); + case 17: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function getObjectTagging(_x) { + return _getObjectTagging.apply(this, arguments); + } + return getObjectTagging; +}(); + +},{"../utils/isObject":74,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.to-string.js":329,"core-js/modules/web.dom-collections.for-each.js":380}],42:[function(require,module,exports){ +"use strict"; + +var _require = require('../utils/isIP'), + isIP = _require.isIP; +var proto = exports; +/** + * Get Object url by name + * @param {String} name - object name + * @param {String} [baseUrl] - If provide `baseUrl`, + * will use `baseUrl` instead the default `endpoint`. + * @return {String} object url + */ +proto.getObjectUrl = function getObjectUrl(name, baseUrl) { + if (isIP(this.options.endpoint.hostname)) { + throw new Error('can not get the object URL when endpoint is IP'); + } + if (!baseUrl) { + baseUrl = this.options.endpoint.format(); + } else if (baseUrl[baseUrl.length - 1] !== '/') { + baseUrl += '/'; + } + return baseUrl + this._escape(this._objectName(name)); +}; + +},{"../utils/isIP":73}],43:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; +/** + * getSymlink + * @param {String} name - object name + * @param {Object} options + * @param {{res}} + */ + +proto.getSymlink = /*#__PURE__*/function () { + var _getSymlink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + params, + result, + target, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + options.subres = Object.assign({ + symlink: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('GET', name, options); + params.successStatuses = [200]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + target = result.res.headers['x-oss-symlink-target']; + return _context.abrupt("return", { + targetName: decodeURIComponent(target), + res: result.res + }); + case 11: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function getSymlink(_x) { + return _getSymlink.apply(this, arguments); + } + return getSymlink; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],44:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/checkEnv'), + checkEnv = _require.checkEnv; +var proto = exports; +/** + * head + * @param {String} name - object name + * @param {Object} options + * @param {{res}} + */ + +proto.head = /*#__PURE__*/function () { + var _head = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name) { + var options, + params, + result, + data, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + checkEnv('Because HeadObject has gzip enabled, head cannot get the file size correctly. If you need to get the file size, please use getObjectMeta'); + options.subres = Object.assign({}, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + params = this._objectRequestParams('HEAD', name, options); + params.successStatuses = [200, 304]; + _context.next = 8; + return this.request(params); + case 8: + result = _context.sent; + data = { + meta: null, + res: result.res, + status: result.status + }; + if (result.status === 200) { + Object.keys(result.headers).forEach(function (k) { + if (k.indexOf('x-oss-meta-') === 0) { + if (!data.meta) { + data.meta = {}; + } + data.meta[k.substring(11)] = result.headers[k]; + } + }); + } + return _context.abrupt("return", data); + case 12: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function head(_x) { + return _head.apply(this, arguments); + } + return head; +}(); + +},{"../utils/checkEnv":55,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/web.dom-collections.for-each.js":380}],45:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; + +/* + * Set object's ACL + * @param {String} name the object key + * @param {String} acl the object ACL + * @param {Object} options + */ +proto.putACL = /*#__PURE__*/function () { + var _putACL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, acl, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + options.subres = Object.assign({ + acl: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + options.headers = options.headers || {}; + options.headers['x-oss-object-acl'] = acl; + name = this._objectName(name); + params = this._objectRequestParams('PUT', name, options); + params.successStatuses = [200]; + _context.next = 10; + return this.request(params); + case 10: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 12: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function putACL(_x, _x2, _x3) { + return _putACL.apply(this, arguments); + } + return putACL; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],46:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.object.keys.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('../utils/obj2xml'), + obj2xml = _require.obj2xml; +var _require2 = require('../utils/checkObjectTag'), + checkObjectTag = _require2.checkObjectTag; +var proto = exports; +/** + * putObjectTagging + * @param {String} name - object name + * @param {Object} tag - object tag, eg: `{a: "1", b: "2"}` + * @param {Object} options + */ + +proto.putObjectTagging = /*#__PURE__*/function () { + var _putObjectTagging = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, tag) { + var options, + params, + paramXMLObj, + result, + _args = arguments; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + checkObjectTag(tag); + options.subres = Object.assign({ + tagging: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + name = this._objectName(name); + params = this._objectRequestParams('PUT', name, options); + params.successStatuses = [200]; + tag = Object.keys(tag).map(function (key) { + return { + Key: key, + Value: tag[key] + }; + }); + paramXMLObj = { + Tagging: { + TagSet: { + Tag: tag + } + } + }; + params.mime = 'xml'; + params.content = obj2xml(paramXMLObj); + _context.next = 13; + return this.request(params); + case 13: + result = _context.sent; + return _context.abrupt("return", { + res: result.res, + status: result.status + }); + case 15: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function putObjectTagging(_x, _x2) { + return _putObjectTagging.apply(this, arguments); + } + return putObjectTagging; +}(); + +},{"../utils/checkObjectTag":56,"../utils/obj2xml":76,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.map.js":318,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":328}],47:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var proto = exports; +/** + * putSymlink + * @param {String} name - object name + * @param {String} targetName - target name + * @param {Object} options + * @param {{res}} + */ + +proto.putSymlink = /*#__PURE__*/function () { + var _putSymlink = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(name, targetName, options) { + var params, result; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + options = options || {}; + options.headers = options.headers || {}; + targetName = this._escape(this._objectName(targetName)); + this._convertMetaToHeaders(options.meta, options.headers); + options.headers['x-oss-symlink-target'] = targetName; + options.subres = Object.assign({ + symlink: '' + }, options.subres); + if (options.versionId) { + options.subres.versionId = options.versionId; + } + if (options.storageClass) { + options.headers['x-oss-storage-class'] = options.storageClass; + } + name = this._objectName(name); + params = this._objectRequestParams('PUT', name, options); + params.successStatuses = [200]; + _context.next = 13; + return this.request(params); + case 13: + result = _context.sent; + return _context.abrupt("return", { + res: result.res + }); + case 15: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function putSymlink(_x, _x2, _x3) { + return _putSymlink.apply(this, arguments); + } + return putSymlink; +}(); + +},{"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.object.assign.js":325}],48:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.signPostObjectPolicyV4 = void 0; +var dateformat_1 = __importDefault(require("dateformat")); +var getStandardRegion_1 = require("../utils/getStandardRegion"); +var policy2Str_1 = require("../utils/policy2Str"); +var signUtils_1 = require("../signUtils"); +function signPostObjectPolicyV4(policy, date) { + var policyStr = Buffer.from(policy2Str_1.policy2Str(policy), 'utf8').toString('base64'); + var formattedDate = dateformat_1.default(date, "UTC:yyyymmdd'T'HHMMss'Z'"); + var onlyDate = formattedDate.split('T')[0]; + var signature = signUtils_1.getSignatureV4(this.options.accessKeySecret, onlyDate, getStandardRegion_1.getStandardRegion(this.options.region), policyStr); + return signature; +} +exports.signPostObjectPolicyV4 = signPostObjectPolicyV4; + +}).call(this)}).call(this,require("buffer").Buffer) +},{"../signUtils":52,"../utils/getStandardRegion":65,"../utils/policy2Str":79,"buffer":103,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.to-string.js":339,"dateformat":383}],49:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +var urlutil = require('url'); +var utility = require('utility'); +var copy = require('copy-to'); +var signHelper = require('../../common/signUtils'); +var _require = require('../utils/isIP'), + isIP = _require.isIP; +var proto = exports; + +/** + * signatureUrl + * @deprecated will be deprecated in 7.x + * @param {String} name object name + * @param {Object} options options + * @param {boolean} [strictObjectNameValidation=true] the flag of verifying object name strictly + */ +proto.signatureUrl = function signatureUrl(name, options) { + var strictObjectNameValidation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + if (isIP(this.options.endpoint.hostname)) { + throw new Error('can not get the object URL when endpoint is IP'); + } + if (strictObjectNameValidation && /^\?/.test(name)) { + throw new Error("Invalid object name ".concat(name)); + } + options = options || {}; + name = this._objectName(name); + options.method = options.method || 'GET'; + var expires = utility.timestamp() + (options.expires || 1800); + var params = { + bucket: this.options.bucket, + object: name + }; + var resource = this._getResource(params); + if (this.options.stsToken) { + options['security-token'] = this.options.stsToken; + } + var signRes = signHelper._signatureForURL(this.options.accessKeySecret, options, resource, expires); + var url = urlutil.parse(this._getReqUrl(params)); + url.query = { + OSSAccessKeyId: this.options.accessKeyId, + Expires: expires, + Signature: signRes.Signature + }; + copy(signRes.subResource).to(url.query); + return url.format(); +}; + +},{"../../common/signUtils":52,"../utils/isIP":73,"copy-to":107,"core-js/modules/es.regexp.exec.js":338,"url":543,"utility":545}],50:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.array.join.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var dateFormat = require('dateformat'); +var urlUtil = require('url'); +var signHelper = require('../../common/signUtils'); +var _require = require('../utils/setSTSToken'), + setSTSToken = _require.setSTSToken; +var _require2 = require('../utils/isFunction'), + isFunction = _require2.isFunction; +var _require3 = require('../utils/getStandardRegion'), + getStandardRegion = _require3.getStandardRegion; +var proto = exports; + +/** + * signatureUrlV4 + * + * @param {string} method + * @param {number} expires + * @param {Object} [request] + * @param {Object} [request.headers] + * @param {Object} [request.queries] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] + */ +proto.signatureUrlV4 = /*#__PURE__*/function () { + var _signatureUrlV = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(method, expires, request, objectName, additionalHeaders) { + var cloudBoxId, product, signRegion, headers, queries, date, formattedDate, onlyDate, fixedAdditionalHeaders, canonicalRequest, stringToSign, signedUrl; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + cloudBoxId = this.options.cloudBoxId; + product = signHelper.getProduct(cloudBoxId); + signRegion = signHelper.getSignRegion(getStandardRegion(this.options.region), cloudBoxId); + headers = request && request.headers || {}; + queries = Object.assign({}, request && request.queries || {}); + date = new Date(); + formattedDate = dateFormat(date, "UTC:yyyymmdd'T'HHMMss'Z'"); + onlyDate = formattedDate.split('T')[0]; + fixedAdditionalHeaders = signHelper.fixAdditionalHeaders(additionalHeaders); + if (fixedAdditionalHeaders.length > 0) { + queries['x-oss-additional-headers'] = fixedAdditionalHeaders.join(';'); + } + queries['x-oss-credential'] = signHelper.getCredential(onlyDate, signRegion, this.options.accessKeyId, product); + queries['x-oss-date'] = formattedDate; + queries['x-oss-expires'] = expires; + queries['x-oss-signature-version'] = 'OSS4-HMAC-SHA256'; + if (!(this.options.stsToken && isFunction(this.options.refreshSTSToken))) { + _context.next = 17; + break; + } + _context.next = 17; + return setSTSToken.call(this); + case 17: + if (this.options.stsToken) { + queries['x-oss-security-token'] = this.options.stsToken; + } + canonicalRequest = signHelper.getCanonicalRequest(method, { + headers: headers, + queries: queries + }, this.options.bucket, objectName, fixedAdditionalHeaders); + stringToSign = signHelper.getStringToSign(signRegion, formattedDate, canonicalRequest, product); + queries['x-oss-signature'] = signHelper.getSignatureV4(this.options.accessKeySecret, onlyDate, signRegion, stringToSign, product); + signedUrl = urlUtil.parse(this._getReqUrl({ + bucket: this.options.bucket, + object: objectName + })); + signedUrl.query = Object.assign({}, queries); + return _context.abrupt("return", signedUrl.format()); + case 24: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + function signatureUrlV4(_x, _x2, _x3, _x4, _x5) { + return _signatureUrlV.apply(this, arguments); + } + return signatureUrlV4; +}(); + +},{"../../common/signUtils":52,"../utils/getStandardRegion":65,"../utils/isFunction":72,"../utils/setSTSToken":82,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.join.js":317,"core-js/modules/es.object.assign.js":325,"dateformat":383,"url":543}],51:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.promise.js"); +require("core-js/modules/es.string.iterator.js"); +require("core-js/modules/web.dom-collections.iterator.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.function.name.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +var _require = require('./utils/isArray'), + isArray = _require.isArray; +var proto = exports; +proto._parallelNode = /*#__PURE__*/function () { + var _parallelNode2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(todo, parallel, fn, sourceData) { + var that, jobErr, jobs, tempBatch, remainder, batch, taskIndex, i; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + that = this; // upload in parallel + jobErr = []; + jobs = []; + tempBatch = todo.length / parallel; + remainder = todo.length % parallel; + batch = remainder === 0 ? tempBatch : (todo.length - remainder) / parallel + 1; + taskIndex = 1; + i = 0; + case 8: + if (!(i < todo.length)) { + _context.next = 26; + break; + } + if (!that.isCancel()) { + _context.next = 11; + break; + } + return _context.abrupt("break", 26); + case 11: + if (sourceData) { + jobs.push(fn(that, todo[i], sourceData)); + } else { + jobs.push(fn(that, todo[i])); + } + if (!(jobs.length === parallel || taskIndex === batch && i === todo.length - 1)) { + _context.next = 23; + break; + } + _context.prev = 13; + taskIndex += 1; + /* eslint no-await-in-loop: [0] */ + _context.next = 17; + return Promise.all(jobs); + case 17: + _context.next = 22; + break; + case 19: + _context.prev = 19; + _context.t0 = _context["catch"](13); + jobErr.push(_context.t0); + case 22: + jobs = []; + case 23: + i++; + _context.next = 8; + break; + case 26: + return _context.abrupt("return", jobErr); + case 27: + case "end": + return _context.stop(); + } + }, _callee, this, [[13, 19]]); + })); + function _parallelNode(_x, _x2, _x3, _x4) { + return _parallelNode2.apply(this, arguments); + } + return _parallelNode; +}(); +proto._parallel = function _parallel(todo, parallel, jobPromise) { + var that = this; + return new Promise(function (resolve) { + var _jobErr = []; + if (parallel <= 0 || !todo) { + resolve(_jobErr); + return; + } + function onlyOnce(fn) { + return function () { + if (fn === null) throw new Error('Callback was already called.'); + var callFn = fn; + fn = null; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callFn.apply(this, args); + }; + } + function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len && !that.isCancel() ? { + value: coll[i], + key: i + } : null; + }; + } + var nextElem = createArrayIterator(todo); + var done = false; + var running = 0; + var looping = false; + function iterateeCallback(err) { + running -= 1; + if (err) { + done = true; + _jobErr.push(err); + resolve(_jobErr); + } else if (done && running <= 0) { + done = true; + resolve(_jobErr); + } else if (!looping) { + /* eslint no-use-before-define: [0] */ + if (that.isCancel()) { + resolve(_jobErr); + } else { + replenish(); + } + } + } + function iteratee(value, callback) { + jobPromise(value).then(function (result) { + callback(null, result); + }).catch(function (err) { + callback(err); + }); + } + function replenish() { + looping = true; + while (running < parallel && !done && !that.isCancel()) { + var elem = nextElem(); + if (elem === null || _jobErr.length > 0) { + done = true; + if (running <= 0) { + resolve(_jobErr); + } + return; + } + running += 1; + iteratee(elem.value, onlyOnce(iterateeCallback)); + } + looping = false; + } + replenish(); + }); +}; + +/** + * cancel operation, now can use with multipartUpload + * @param {Object} abort + * {String} anort.name object key + * {String} anort.uploadId upload id + * {String} anort.options timeout + */ +proto.cancel = function cancel(abort) { + this.options.cancelFlag = true; + if (isArray(this.multipartUploadStreams)) { + this.multipartUploadStreams.forEach(function (_) { + if (_.destroyed === false) { + var err = { + name: 'cancel', + message: 'cancel' + }; + _.destroy(err); + } + }); + } + this.multipartUploadStreams = []; + if (abort) { + this.abortMultipartUpload(abort.name, abort.uploadId, abort.options); + } +}; +proto.isCancel = function isCancel() { + return this.options.cancelFlag; +}; +proto.resetCancelFlag = function resetCancelFlag() { + this.options.cancelFlag = false; +}; +proto._stop = function _stop() { + this.options.cancelFlag = true; +}; + +// cancel is not error , so create an object +proto._makeCancelEvent = function _makeCancelEvent() { + var cancelEvent = { + status: 0, + name: 'cancel' + }; + return cancelEvent; +}; + +// abort is not error , so create an object +proto._makeAbortEvent = function _makeAbortEvent() { + var abortEvent = { + status: 0, + name: 'abort', + message: 'upload task has been abort' + }; + return abortEvent; +}; + +},{"./utils/isArray":67,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.promise.js":333,"core-js/modules/es.string.iterator.js":343,"core-js/modules/web.dom-collections.for-each.js":380,"core-js/modules/web.dom-collections.iterator.js":381}],52:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); +require("core-js/modules/es.string.trim.js"); +require("core-js/modules/es.array.sort.js"); +require("core-js/modules/es.array.join.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.array.filter.js"); +require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.set.js"); +require("core-js/modules/es.string.iterator.js"); +require("core-js/modules/web.dom-collections.iterator.js"); +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.string.starts-with.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.object.entries.js"); +require("core-js/modules/es.regexp.to-string.js"); +var crypto = require('./../../shims/crypto/crypto.js'); +var is = require('is-type-of'); +var qs = require('qs'); +var _require = require('./utils/lowercaseKeyHeader'), + lowercaseKeyHeader = _require.lowercaseKeyHeader; +var _require2 = require('./utils/encodeString'), + encodeString = _require2.encodeString; + +/** + * + * @param {string} [cloudBoxId] + * @return {string} + */ +exports.getProduct = function getProduct(cloudBoxId) { + if (cloudBoxId === undefined) return 'oss'; + return 'oss-cloudbox'; +}; +/** + * + * @param {string} region + * @param {string} [cloudBoxId] + * @return {string} + */ +exports.getSignRegion = function getSignRegion(region, cloudBoxId) { + if (cloudBoxId === undefined) return region; + return cloudBoxId; +}; + +/** + * + * @param {String} resourcePath + * @param {Object} parameters + * @return + */ +exports.buildCanonicalizedResource = function buildCanonicalizedResource(resourcePath, parameters) { + var canonicalizedResource = "".concat(resourcePath); + var separatorString = '?'; + if (is.string(parameters) && parameters.trim() !== '') { + canonicalizedResource += separatorString + parameters; + } else if (is.array(parameters)) { + parameters.sort(); + canonicalizedResource += separatorString + parameters.join('&'); + } else if (parameters) { + var processFunc = function processFunc(key) { + canonicalizedResource += separatorString + key; + if (parameters[key] || parameters[key] === 0) { + canonicalizedResource += "=".concat(parameters[key]); + } + separatorString = '&'; + }; + Object.keys(parameters).sort().forEach(processFunc); + } + return canonicalizedResource; +}; + +/** + * @param {String} method + * @param {String} resourcePath + * @param {Object} request + * @param {String} expires + * @return {String} canonicalString + */ +exports.buildCanonicalString = function canonicalString(method, resourcePath, request, expires) { + request = request || {}; + var headers = lowercaseKeyHeader(request.headers); + var OSS_PREFIX = 'x-oss-'; + var ossHeaders = []; + var headersToSign = {}; + var signContent = [method.toUpperCase(), headers['content-md5'] || '', headers['content-type'], expires || headers['x-oss-date']]; + Object.keys(headers).forEach(function (key) { + var lowerKey = key.toLowerCase(); + if (lowerKey.indexOf(OSS_PREFIX) === 0) { + headersToSign[lowerKey] = String(headers[key]).trim(); + } + }); + Object.keys(headersToSign).sort().forEach(function (key) { + ossHeaders.push("".concat(key, ":").concat(headersToSign[key])); + }); + signContent = signContent.concat(ossHeaders); + signContent.push(this.buildCanonicalizedResource(resourcePath, request.parameters)); + return signContent.join('\n'); +}; + +/** + * @param {String} accessKeySecret + * @param {String} canonicalString + */ +exports.computeSignature = function computeSignature(accessKeySecret, canonicalString) { + var headerEncoding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'utf-8'; + var signature = crypto.createHmac('sha1', accessKeySecret); + return signature.update(Buffer.from(canonicalString, headerEncoding)).digest('base64'); +}; + +/** + * @param {String} accessKeyId + * @param {String} accessKeySecret + * @param {String} canonicalString + */ +exports.authorization = function authorization(accessKeyId, accessKeySecret, canonicalString, headerEncoding) { + return "OSS ".concat(accessKeyId, ":").concat(this.computeSignature(accessKeySecret, canonicalString, headerEncoding)); +}; + +/** + * @param {string[]} [additionalHeaders] + * @returns {string[]} + */ +exports.fixAdditionalHeaders = function (additionalHeaders) { + if (!additionalHeaders) { + return []; + } + var OSS_PREFIX = 'x-oss-'; + return (0, _toConsumableArray2.default)(new Set(additionalHeaders.map(function (v) { + return v.toLowerCase(); + }))).filter(function (v) { + return v !== 'content-type' && v !== 'content-md5' && !v.startsWith(OSS_PREFIX); + }).sort(); +}; + +/** + * @param {string} method + * @param {Object} request + * @param {Object} request.headers + * @param {Object} [request.queries] + * @param {string} [bucketName] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] additional headers after deduplication, lowercase and sorting + * @returns {string} + */ +exports.getCanonicalRequest = function getCanonicalRequest(method, request, bucketName, objectName, additionalHeaders) { + var headers = lowercaseKeyHeader(request.headers); + var queries = request.queries || {}; + var OSS_PREFIX = 'x-oss-'; + if (objectName && !bucketName) { + throw Error('Please ensure that bucketName is passed into getCanonicalRequest.'); + } + var signContent = [method.toUpperCase(), + // HTTP Verb + encodeString("/".concat(bucketName ? "".concat(bucketName, "/") : '').concat(objectName || '')).replace(/%2F/g, '/') // Canonical URI + ]; + + // Canonical Query String + signContent.push(qs.stringify(queries, { + encoder: encodeString, + sort: function sort(a, b) { + return a.localeCompare(b); + }, + strictNullHandling: true + })); + + // Canonical Headers + if (additionalHeaders) { + additionalHeaders.forEach(function (v) { + if (!Object.prototype.hasOwnProperty.call(headers, v)) { + throw Error("Can't find additional header ".concat(v, " in request headers.")); + } + }); + } + var tempHeaders = new Set(additionalHeaders); + Object.keys(headers).forEach(function (v) { + if (v === 'content-type' || v === 'content-md5' || v.startsWith(OSS_PREFIX)) { + tempHeaders.add(v); + } + }); + var canonicalHeaders = "".concat((0, _toConsumableArray2.default)(tempHeaders).sort().map(function (v) { + return "".concat(v, ":").concat(is.string(headers[v]) ? headers[v].trim() : headers[v], "\n"); + }).join('')); + signContent.push(canonicalHeaders); + + // Additional Headers + if (additionalHeaders && additionalHeaders.length > 0) { + signContent.push(additionalHeaders.join(';')); + } else { + signContent.push(''); + } + + // Hashed Payload + signContent.push(headers['x-oss-content-sha256'] || 'UNSIGNED-PAYLOAD'); + return signContent.join('\n'); +}; + +/** + * @param {string} date yyyymmdd + * @param {string} region Standard region, e.g. cn-hangzhou + * @param {string} [accessKeyId] Access Key ID + * @param {string} [product] Product name, default is oss + * @returns {string} + */ +exports.getCredential = function getCredential(date, region, accessKeyId) { + var product = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'oss'; + var tempCredential = "".concat(date, "/").concat(region, "/").concat(product, "/aliyun_v4_request"); + if (accessKeyId) { + return "".concat(accessKeyId, "/").concat(tempCredential); + } + return tempCredential; +}; + +/** + * @param {string} region Standard region, e.g. cn-hangzhou + * @param {string} date ISO8601 UTC:yyyymmdd'T'HHMMss'Z' + * @param {string} canonicalRequest + * @param {string} [product] + * @returns {string} + */ +exports.getStringToSign = function getStringToSign(region, date, canonicalRequest) { + var product = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'oss'; + var stringToSign = ['OSS4-HMAC-SHA256', date, + // TimeStamp + this.getCredential(date.split('T')[0], region, undefined, product), + // Scope + crypto.createHash('sha256').update(canonicalRequest).digest('hex') // Hashed Canonical Request + ]; + return stringToSign.join('\n'); +}; + +/** + * @param {String} accessKeySecret + * @param {string} date yyyymmdd + * @param {string} region Standard region, e.g. cn-hangzhou + * @param {string} stringToSign + * @param {string} [product] + * @returns {string} + */ +exports.getSignatureV4 = function getSignatureV4(accessKeySecret, date, region, stringToSign) { + var product = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'oss'; + var signingDate = crypto.createHmac('sha256', "aliyun_v4".concat(accessKeySecret)).update(date).digest(); + var signingRegion = crypto.createHmac('sha256', signingDate).update(region).digest(); + var signingOss = crypto.createHmac('sha256', signingRegion).update(product).digest(); + var signingKey = crypto.createHmac('sha256', signingOss).update('aliyun_v4_request').digest(); + var signatureValue = crypto.createHmac('sha256', signingKey).update(stringToSign).digest('hex'); + return signatureValue; +}; + +/** + * @param {String} accessKeyId + * @param {String} accessKeySecret + * @param {string} region Standard region, e.g. cn-hangzhou + * @param {string} method + * @param {Object} request + * @param {Object} request.headers + * @param {Object} [request.queries] + * @param {string} [bucketName] + * @param {string} [objectName] + * @param {string[]} [additionalHeaders] + * @param {string} [headerEncoding='utf-8'] + * @param {string} [cloudBoxId] + * @returns {string} + */ +exports.authorizationV4 = function authorizationV4(accessKeyId, accessKeySecret, region, method, request, bucketName, objectName, additionalHeaders) { + var headerEncoding = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 'utf-8'; + var cloudBoxId = arguments.length > 9 ? arguments[9] : undefined; + var product = this.getProduct(cloudBoxId); + var fixedAdditionalHeaders = this.fixAdditionalHeaders(additionalHeaders); + var fixedHeaders = {}; + Object.entries(request.headers).forEach(function (v) { + fixedHeaders[v[0]] = is.string(v[1]) ? Buffer.from(v[1], headerEncoding).toString() : v[1]; + }); + var date = fixedHeaders['x-oss-date'] || request.queries && request.queries['x-oss-date']; + var canonicalRequest = this.getCanonicalRequest(method, { + headers: fixedHeaders, + queries: request.queries + }, bucketName, objectName, fixedAdditionalHeaders); + var stringToSign = this.getStringToSign(region, date, canonicalRequest, product); + var onlyDate = date.split('T')[0]; + var signatureValue = this.getSignatureV4(accessKeySecret, onlyDate, region, stringToSign, product); + var additionalHeadersValue = fixedAdditionalHeaders.length > 0 ? "AdditionalHeaders=".concat(fixedAdditionalHeaders.join(';'), ",") : ''; + return "OSS4-HMAC-SHA256 Credential=".concat(this.getCredential(onlyDate, region, accessKeyId, product), ",").concat(additionalHeadersValue, "Signature=").concat(signatureValue); +}; + +/** + * + * @param {String} accessKeySecret + * @param {Object} options + * @param {String} resource + * @param {Number} expires + */ +exports._signatureForURL = function _signatureForURL(accessKeySecret) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var resource = arguments.length > 2 ? arguments[2] : undefined; + var expires = arguments.length > 3 ? arguments[3] : undefined; + var headerEncoding = arguments.length > 4 ? arguments[4] : undefined; + var headers = {}; + var _options$subResource = options.subResource, + subResource = _options$subResource === void 0 ? {} : _options$subResource; + if (options.process) { + var processKeyword = 'x-oss-process'; + subResource[processKeyword] = options.process; + } + if (options.trafficLimit) { + var trafficLimitKey = 'x-oss-traffic-limit'; + subResource[trafficLimitKey] = options.trafficLimit; + } + if (options.response) { + Object.keys(options.response).forEach(function (k) { + var key = "response-".concat(k.toLowerCase()); + subResource[key] = options.response[k]; + }); + } + Object.keys(options).forEach(function (key) { + var lowerKey = key.toLowerCase(); + var value = options[key]; + if (lowerKey.indexOf('x-oss-') === 0) { + headers[lowerKey] = value; + } else if (lowerKey.indexOf('content-md5') === 0) { + headers[key] = value; + } else if (lowerKey.indexOf('content-type') === 0) { + headers[key] = value; + } + }); + if (Object.prototype.hasOwnProperty.call(options, 'security-token')) { + subResource['security-token'] = options['security-token']; + } + if (Object.prototype.hasOwnProperty.call(options, 'callback')) { + var json = { + callbackUrl: encodeURI(options.callback.url), + callbackBody: options.callback.body + }; + if (options.callback.host) { + json.callbackHost = options.callback.host; + } + if (options.callback.contentType) { + json.callbackBodyType = options.callback.contentType; + } + if (options.callback.callbackSNI) { + json.callbackSNI = options.callback.callbackSNI; + } + subResource.callback = Buffer.from(JSON.stringify(json)).toString('base64'); + if (options.callback.customValue) { + var callbackVar = {}; + Object.keys(options.callback.customValue).forEach(function (key) { + callbackVar["x:".concat(key)] = options.callback.customValue[key]; + }); + subResource['callback-var'] = Buffer.from(JSON.stringify(callbackVar)).toString('base64'); + } + } + var canonicalString = this.buildCanonicalString(options.method, resource, { + headers: headers, + parameters: subResource + }, expires.toString()); + return { + Signature: this.computeSignature(accessKeySecret, canonicalString, headerEncoding), + subResource: subResource + }; +}; + +}).call(this)}).call(this,require("buffer").Buffer) +},{"./../../shims/crypto/crypto.js":531,"./utils/encodeString":61,"./utils/lowercaseKeyHeader":75,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/helpers/toConsumableArray":90,"buffer":103,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.filter.js":312,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.join.js":317,"core-js/modules/es.array.map.js":318,"core-js/modules/es.array.sort.js":320,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.set.js":341,"core-js/modules/es.string.iterator.js":343,"core-js/modules/es.string.replace.js":345,"core-js/modules/es.string.starts-with.js":348,"core-js/modules/es.string.trim.js":349,"core-js/modules/web.dom-collections.for-each.js":380,"core-js/modules/web.dom-collections.iterator.js":381,"is-type-of":537,"qs":445}],53:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.checkBucketName = void 0; +exports.checkBucketName = function (name) { + var createBucket = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var bucketRegex = createBucket ? /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/ : /^[a-z0-9_][a-z0-9-_]{1,61}[a-z0-9_]$/; + if (!bucketRegex.test(name)) { + throw new Error('The bucket must be conform to the specifications'); + } +}; + +},{"core-js/modules/es.regexp.exec.js":338}],54:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.checkConfigValid = void 0; +var checkConfigMap = { + endpoint: checkEndpoint, + region: /^[a-zA-Z0-9\-_]+$/ +}; +function checkEndpoint(endpoint) { + if (typeof endpoint === 'string') { + return /^[a-zA-Z0-9._:/-]+$/.test(endpoint); + } else if (endpoint.host) { + return /^[a-zA-Z0-9._:/-]+$/.test(endpoint.host); + } + return false; +} +exports.checkConfigValid = function (conf, key) { + if (checkConfigMap[key]) { + var isConfigValid = true; + if (checkConfigMap[key] instanceof Function) { + isConfigValid = checkConfigMap[key](conf); + } else { + isConfigValid = checkConfigMap[key].test(conf); + } + if (!isConfigValid) { + throw new Error("The ".concat(key, " must be conform to the specifications")); + } + } +}; + +},{"core-js/modules/es.regexp.exec.js":338}],55:[function(require,module,exports){ +(function (process){(function (){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.checkEnv = void 0; +function checkEnv(msg) { + if (process.browser) { + console.warn(msg); + } +} +exports.checkEnv = checkEnv; + +}).call(this)}).call(this,require('_process')) +},{"_process":538}],56:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.object.entries.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.checkObjectTag = void 0; +var _require = require('./checkValid'), + checkValid = _require.checkValid; +var _require2 = require('./isObject'), + isObject = _require2.isObject; +var commonRules = [{ + validator: function validator(value) { + if (typeof value !== 'string') { + throw new Error('the key and value of the tag must be String'); + } + } +}, { + pattern: /^[a-zA-Z0-9 +-=._:/]+$/, + msg: 'tag can contain letters, numbers, spaces, and the following symbols: plus sign (+), hyphen (-), equal sign (=), period (.), underscore (_), colon (:), and forward slash (/)' +}]; +var rules = { + key: [].concat(commonRules, [{ + pattern: /^.{1,128}$/, + msg: 'tag key can be a maximum of 128 bytes in length' + }]), + value: [].concat(commonRules, [{ + pattern: /^.{0,256}$/, + msg: 'tag value can be a maximum of 256 bytes in length' + }]) +}; +function checkObjectTag(tag) { + if (!isObject(tag)) { + throw new Error('tag must be Object'); + } + var entries = Object.entries(tag); + if (entries.length > 10) { + throw new Error('maximum of 10 tags for a object'); + } + var rulesIndexKey = ['key', 'value']; + entries.forEach(function (keyValue) { + keyValue.forEach(function (item, index) { + checkValid(item, rules[rulesIndexKey[index]]); + }); + }); +} +exports.checkObjectTag = checkObjectTag; + +},{"./checkValid":57,"./isObject":74,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.to-string.js":329,"core-js/modules/web.dom-collections.for-each.js":380}],57:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.regexp.exec.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.checkValid = void 0; +function checkValid(_value, _rules) { + _rules.forEach(function (rule) { + if (rule.validator) { + rule.validator(_value); + } else if (rule.pattern && !rule.pattern.test(_value)) { + throw new Error(rule.msg); + } + }); +} +exports.checkValid = checkValid; + +},{"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/web.dom-collections.for-each.js":380}],58:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; + +require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.string.includes.js"); +require("core-js/modules/es.object.assign.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.entries.js"); +require("core-js/modules/es.array.concat.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.createRequest = void 0; +var crypto = require('./../../../shims/crypto/crypto.js'); +var debug = require('debug')('ali-oss'); +var _isString = require('lodash/isString'); +var _isArray = require('lodash/isArray'); +var _isObject = require('lodash/isObject'); +var mime = require('mime'); +var dateFormat = require('dateformat'); +var copy = require('copy-to'); +var path = require('path'); +var _require = require('./encoder'), + encoder = _require.encoder; +var _require2 = require('./isIP'), + isIP = _require2.isIP; +var _require3 = require('./setRegion'), + setRegion = _require3.setRegion; +var _require4 = require('../client/getReqUrl'), + getReqUrl = _require4.getReqUrl; +var _require5 = require('./isDingTalk'), + isDingTalk = _require5.isDingTalk; +function getHeader(headers, name) { + return headers[name] || headers[name.toLowerCase()]; +} +function delHeader(headers, name) { + delete headers[name]; + delete headers[name.toLowerCase()]; +} +function createRequest(params) { + var date = new Date(); + if (this.options.amendTimeSkewed) { + date = +new Date() + this.options.amendTimeSkewed; + } + var headers = { + 'x-oss-date': dateFormat(date, this.options.authorizationV4 ? "UTC:yyyymmdd'T'HHMMss'Z'" : "UTC:ddd, dd mmm yyyy HH:MM:ss 'GMT'") + }; + if (this.options.authorizationV4) { + headers['x-oss-content-sha256'] = 'UNSIGNED-PAYLOAD'; + } + if (typeof window !== 'undefined') { + headers['x-oss-user-agent'] = this.userAgent; + } + if (this.userAgent.includes('nodejs')) { + headers['User-Agent'] = this.userAgent; + } + if (this.options.isRequestPay) { + Object.assign(headers, { + 'x-oss-request-payer': 'requester' + }); + } + if (this.options.stsToken) { + headers['x-oss-security-token'] = this.options.stsToken; + } + copy(params.headers).to(headers); + if (!getHeader(headers, 'Content-Type')) { + if (params.mime && params.mime.indexOf('/') > 0) { + headers['Content-Type'] = params.mime; + } else if (isDingTalk()) { + headers['Content-Type'] = 'application/octet-stream'; + } else { + headers['Content-Type'] = mime.getType(params.mime || path.extname(params.object || '')); + } + } + if (!getHeader(headers, 'Content-Type')) { + delHeader(headers, 'Content-Type'); + } + if (params.content) { + if (!params.disabledMD5) { + if (!params.headers || !params.headers['Content-MD5']) { + headers['Content-MD5'] = crypto.createHash('md5').update(Buffer.from(params.content, 'utf8')).digest('base64'); + } else { + headers['Content-MD5'] = params.headers['Content-MD5']; + } + } + if (!headers['Content-Length']) { + headers['Content-Length'] = params.content.length; + } + } + var hasOwnProperty = Object.prototype.hasOwnProperty; + for (var k in headers) { + if (headers[k] && hasOwnProperty.call(headers, k)) { + headers[k] = encoder(String(headers[k]), this.options.headerEncoding); + } + } + var queries = {}; + if (_isString(params.subres)) { + queries[params.subres] = null; + } else if (_isArray(params.subres)) { + params.subres.forEach(function (v) { + queries[v] = null; + }); + } else if (_isObject(params.subres)) { + Object.entries(params.subres).forEach(function (v) { + queries[v[0]] = v[1] === '' ? null : v[1]; + }); + } + if (_isObject(params.query)) { + Object.entries(params.query).forEach(function (v) { + queries[v[0]] = v[1]; + }); + } + headers.authorization = this.options.authorizationV4 ? this.authorizationV4(params.method, { + headers: headers, + queries: queries + }, params.bucket, params.object, params.additionalHeaders) : this.authorization(params.method, this._getResource(params), params.subres, headers, this.options.headerEncoding); + // const url = this._getReqUrl(params); + if (isIP(this.options.endpoint.hostname)) { + var _this$options = this.options, + region = _this$options.region, + internal = _this$options.internal, + secure = _this$options.secure; + var hostInfo = setRegion(region, internal, secure); + headers.host = "".concat(params.bucket, ".").concat(hostInfo.host); + } + var url = getReqUrl.bind(this)(params); + debug('request %s %s, with headers %j, !!stream: %s', params.method, url, headers, !!params.stream); + var timeout = params.timeout || this.options.timeout; + var reqParams = { + method: params.method, + content: params.content, + stream: params.stream, + headers: headers, + timeout: timeout, + writeStream: params.writeStream, + customResponse: params.customResponse, + ctx: params.ctx || this.ctx + }; + if (this.agent) { + reqParams.agent = this.agent; + } + if (this.httpsAgent) { + reqParams.httpsAgent = this.httpsAgent; + } + reqParams.enableProxy = !!this.options.enableProxy; + reqParams.proxy = this.options.proxy ? this.options.proxy : null; + return { + url: url, + params: reqParams + }; +} +exports.createRequest = createRequest; + +}).call(this)}).call(this,require("buffer").Buffer) +},{"../client/getReqUrl":25,"./../../../shims/crypto/crypto.js":531,"./encoder":62,"./isDingTalk":70,"./isIP":73,"./setRegion":81,"buffer":103,"copy-to":107,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.string.includes.js":342,"core-js/modules/web.dom-collections.for-each.js":380,"dateformat":383,"debug":536,"lodash/isArray":422,"lodash/isObject":423,"lodash/isString":425,"mime":430,"path":439}],59:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.entries.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.object.keys.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.dataFix = void 0; +var isObject_1 = require("./isObject"); +var TRUE = ['true', 'TRUE', '1', 1]; +var FALSE = ['false', 'FALSE', '0', 0]; +function dataFix(o, conf, finalKill) { + if (!isObject_1.isObject(o)) return; + var _conf$remove = conf.remove, + remove = _conf$remove === void 0 ? [] : _conf$remove, + _conf$rename = conf.rename, + rename = _conf$rename === void 0 ? {} : _conf$rename, + _conf$camel = conf.camel, + camel = _conf$camel === void 0 ? [] : _conf$camel, + _conf$bool = conf.bool, + bool = _conf$bool === void 0 ? [] : _conf$bool, + _conf$lowerFirst = conf.lowerFirst, + lowerFirst = _conf$lowerFirst === void 0 ? false : _conf$lowerFirst; + // 删除不需要的数据 + remove.forEach(function (v) { + return delete o[v]; + }); + // 重命名 + Object.entries(rename).forEach(function (v) { + if (!o[v[0]]) return; + if (o[v[1]]) return; + o[v[1]] = o[v[0]]; + delete o[v[0]]; + }); + // 驼峰化 + camel.forEach(function (v) { + if (!o[v]) return; + var afterKey = v.replace(/^(.)/, function ($0) { + return $0.toLowerCase(); + }).replace(/-(\w)/g, function (_, $1) { + return $1.toUpperCase(); + }); + if (o[afterKey]) return; + o[afterKey] = o[v]; + // todo 暂时兼容以前数据,不做删除 + // delete o[v]; + }); + // 转换值为布尔值 + bool.forEach(function (v) { + o[v] = fixBool(o[v]); + }); + // finalKill + if (typeof finalKill === 'function') { + finalKill(o); + } + // 首字母转小写 + fixLowerFirst(o, lowerFirst); + return dataFix; +} +exports.dataFix = dataFix; +function fixBool(value) { + if (!value) return false; + if (TRUE.includes(value)) return true; + return FALSE.includes(value) ? false : value; +} +function fixLowerFirst(o, lowerFirst) { + if (lowerFirst) { + Object.keys(o).forEach(function (key) { + var lowerK = key.replace(/^\w/, function (match) { + return match.toLowerCase(); + }); + if (typeof o[lowerK] === 'undefined') { + o[lowerK] = o[key]; + delete o[key]; + } + }); + } +} + +},{"./isObject":74,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.entries.js":326,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.replace.js":345,"core-js/modules/web.dom-collections.for-each.js":380}],60:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +require("core-js/modules/es.array.slice.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.deepCopyWith = exports.deepCopy = void 0; +var isBuffer_1 = require("./isBuffer"); +exports.deepCopy = function (obj) { + if (obj === null || (0, _typeof2.default)(obj) !== 'object') { + return obj; + } + if (isBuffer_1.isBuffer(obj)) { + return obj.slice(); + } + var copy = Array.isArray(obj) ? [] : {}; + Object.keys(obj).forEach(function (key) { + copy[key] = exports.deepCopy(obj[key]); + }); + return copy; +}; +exports.deepCopyWith = function (obj, customizer) { + function deepCopyWithHelper(value, innerKey, innerObject) { + var result = customizer(value, innerKey, innerObject); + if (result !== undefined) return result; + if (value === null || (0, _typeof2.default)(value) !== 'object') { + return value; + } + if (isBuffer_1.isBuffer(value)) { + return value.slice(); + } + var copy = Array.isArray(value) ? [] : {}; + Object.keys(value).forEach(function (k) { + copy[k] = deepCopyWithHelper(value[k], k, value); + }); + return copy; + } + if (customizer) { + return deepCopyWithHelper(obj, '', null); + } else { + return exports.deepCopy(obj); + } +}; + +},{"./isBuffer":69,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/helpers/typeof":91,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/web.dom-collections.for-each.js":380}],61:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.encodeString = void 0; +var toString_1 = __importDefault(require("lodash/toString")); +function encodeString(str) { + var tempStr = toString_1.default(str); + return encodeURIComponent(tempStr).replace(/[!'()*]/g, function (c) { + return "%".concat(c.charCodeAt(0).toString(16).toUpperCase()); + }); +} +exports.encodeString = encodeString; + +},{"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.string.replace.js":345,"lodash/toString":427}],62:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.encoder = void 0; +function encoder(str) { + var encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'utf-8'; + if (encoding === 'utf-8') return str; + return Buffer.from(str).toString('latin1'); +} +exports.encoder = encoder; + +}).call(this)}).call(this,require("buffer").Buffer) +},{"buffer":103,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.to-string.js":339}],63:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.map.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.formatInventoryConfig = void 0; +var dataFix_1 = require("../utils/dataFix"); +var isObject_1 = require("../utils/isObject"); +var isArray_1 = require("../utils/isArray"); +var formatObjKey_1 = require("../utils/formatObjKey"); +function formatInventoryConfig(inventoryConfig) { + var toArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (toArray && isObject_1.isObject(inventoryConfig)) inventoryConfig = [inventoryConfig]; + if (isArray_1.isArray(inventoryConfig)) { + inventoryConfig = inventoryConfig.map(formatFn); + } else { + inventoryConfig = formatFn(inventoryConfig); + } + return inventoryConfig; +} +exports.formatInventoryConfig = formatInventoryConfig; +function formatFn(_) { + dataFix_1.dataFix(_, { + bool: ['IsEnabled'] + }, function (conf) { + var _a, _b; + // prefix + conf.prefix = conf.Filter.Prefix; + delete conf.Filter; + // OSSBucketDestination + conf.OSSBucketDestination = conf.Destination.OSSBucketDestination; + // OSSBucketDestination.rolename + conf.OSSBucketDestination.rolename = conf.OSSBucketDestination.RoleArn.replace(/.*\//, ''); + delete conf.OSSBucketDestination.RoleArn; + // OSSBucketDestination.bucket + conf.OSSBucketDestination.bucket = conf.OSSBucketDestination.Bucket.replace(/.*:::/, ''); + delete conf.OSSBucketDestination.Bucket; + delete conf.Destination; + // frequency + conf.frequency = conf.Schedule.Frequency; + delete conf.Schedule.Frequency; + // optionalFields + if (((_a = conf === null || conf === void 0 ? void 0 : conf.OptionalFields) === null || _a === void 0 ? void 0 : _a.Field) && !isArray_1.isArray((_b = conf.OptionalFields) === null || _b === void 0 ? void 0 : _b.Field)) conf.OptionalFields.Field = [conf.OptionalFields.Field]; + }); + // firstLowerCase + _ = formatObjKey_1.formatObjKey(_, 'firstLowerCase', { + exclude: ['OSSBucketDestination', 'SSE-OSS', 'SSE-KMS'] + }); + return _; +} + +},{"../utils/dataFix":59,"../utils/formatObjKey":64,"../utils/isArray":67,"../utils/isObject":74,"core-js/modules/es.array.map.js":318,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.replace.js":345}],64:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.string.includes.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.formatObjKey = void 0; +function formatObjKey(obj, type, options) { + if (obj === null || (0, _typeof2.default)(obj) !== 'object') { + return obj; + } + var o; + if (Array.isArray(obj)) { + o = []; + for (var i = 0; i < obj.length; i++) { + o.push(formatObjKey(obj[i], type, options)); + } + } else { + o = {}; + Object.keys(obj).forEach(function (key) { + o[handelFormat(key, type, options)] = formatObjKey(obj[key], type, options); + }); + } + return o; +} +exports.formatObjKey = formatObjKey; +function handelFormat(key, type, options) { + if (options && options.exclude && options.exclude.includes(key)) return key; + if (type === 'firstUpperCase') { + key = key.replace(/^./, function (_) { + return _.toUpperCase(); + }); + } else if (type === 'firstLowerCase') { + key = key.replace(/^./, function (_) { + return _.toLowerCase(); + }); + } + return key; +} + +},{"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/helpers/typeof":91,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.includes.js":342,"core-js/modules/es.string.replace.js":345,"core-js/modules/web.dom-collections.for-each.js":380}],65:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getStandardRegion = void 0; +function getStandardRegion(str) { + return str.replace(/^oss-/g, ''); +} +exports.getStandardRegion = getStandardRegion; + +},{"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.replace.js":345}],66:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getStrBytesCount = void 0; +function getStrBytesCount(str) { + var bytesCount = 0; + for (var i = 0; i < str.length; i++) { + var c = str.charAt(i); + if (/^[\u00-\uff]$/.test(c)) { + bytesCount += 1; + } else { + bytesCount += 2; + } + } + return bytesCount; +} +exports.getStrBytesCount = getStrBytesCount; + +},{"core-js/modules/es.regexp.exec.js":338}],67:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isArray = void 0; +exports.isArray = function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; +}; + +},{"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.to-string.js":339}],68:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isBlob = void 0; +function isBlob(blob) { + return typeof Blob !== 'undefined' && blob instanceof Blob; +} +exports.isBlob = isBlob; + +},{}],69:[function(require,module,exports){ +(function (Buffer){(function (){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isBuffer = void 0; +function isBuffer(obj) { + return Buffer.isBuffer(obj); +} +exports.isBuffer = isBuffer; + +}).call(this)}).call(this,{"isBuffer":require("../../../node_modules/is-buffer/index.js")}) +},{"../../../node_modules/is-buffer/index.js":409}],70:[function(require,module,exports){ +(function (process){(function (){ +"use strict"; + +require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.string.includes.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isDingTalk = void 0; +function isDingTalk() { + if (process.browser && window.navigator.userAgent.toLowerCase().includes('aliapp(dingtalk')) { + return true; + } + return false; +} +exports.isDingTalk = isDingTalk; + +}).call(this)}).call(this,require('_process')) +},{"_process":538,"core-js/modules/es.array.includes.js":315,"core-js/modules/es.string.includes.js":342}],71:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isFile = void 0; +exports.isFile = function (obj) { + return typeof File !== 'undefined' && obj instanceof File; +}; + +},{}],72:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isFunction = void 0; +exports.isFunction = function (v) { + return typeof v === 'function'; +}; + +},{}],73:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIP = void 0; +// it provide commont methods for node and browser , we will add more solutions later in this file +/** + * Judge isIP include ipv4 or ipv6 + * @param {String} options + * @return {Array} the multipart uploads + */ +exports.isIP = function (host) { + var ipv4Regex = /^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/; + var ipv6Regex = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/; + return ipv4Regex.test(host) || ipv6Regex.test(host); +}; + +},{"core-js/modules/es.regexp.exec.js":338}],74:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isObject = void 0; +exports.isObject = function (obj) { + return Object.prototype.toString.call(obj) === '[object Object]'; +}; + +},{"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.to-string.js":339}],75:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.lowercaseKeyHeader = void 0; +var isObject_1 = require("./isObject"); +function lowercaseKeyHeader(headers) { + var lowercaseHeader = {}; + if (isObject_1.isObject(headers)) { + Object.keys(headers).forEach(function (key) { + lowercaseHeader[key.toLowerCase()] = headers[key]; + }); + } + return lowercaseHeader; +} +exports.lowercaseKeyHeader = lowercaseKeyHeader; + +},{"./isObject":74,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/web.dom-collections.for-each.js":380}],76:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.array.concat.js"); +require("core-js/modules/es.array.join.js"); +require("core-js/modules/es.array.map.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.obj2xml = void 0; +var formatObjKey_1 = require("./formatObjKey"); +function type(params) { + return Object.prototype.toString.call(params).replace(/(.*? |])/g, '').toLowerCase(); +} +function obj2xml(obj, options) { + var s = ''; + if (options && options.headers) { + s = '\n'; + } + if (options && options.firstUpperCase) { + obj = formatObjKey_1.formatObjKey(obj, 'firstUpperCase'); + } + if (type(obj) === 'object') { + Object.keys(obj).forEach(function (key) { + // filter undefined or null + if (type(obj[key]) !== 'undefined' && type(obj[key]) !== 'null') { + if (type(obj[key]) === 'string' || type(obj[key]) === 'number') { + s += "<".concat(key, ">").concat(obj[key], ""); + } else if (type(obj[key]) === 'object') { + s += "<".concat(key, ">").concat(obj2xml(obj[key]), ""); + } else if (type(obj[key]) === 'array') { + s += obj[key].map(function (keyChild) { + return "<".concat(key, ">").concat(obj2xml(keyChild), ""); + }).join(''); + } else { + s += "<".concat(key, ">").concat(obj[key].toString(), ""); + } + } + }); + } else { + s += obj.toString(); + } + return s; +} +exports.obj2xml = obj2xml; + +},{"./formatObjKey":64,"core-js/modules/es.array.concat.js":310,"core-js/modules/es.array.join.js":317,"core-js/modules/es.array.map.js":318,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.string.replace.js":345,"core-js/modules/web.dom-collections.for-each.js":380}],77:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.slice.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.regexp.to-string.js"); +require("core-js/modules/es.function.name.js"); +require("core-js/modules/es.array.from.js"); +require("core-js/modules/es.string.iterator.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.symbol.js"); +require("core-js/modules/es.symbol.description.js"); +require("core-js/modules/es.symbol.iterator.js"); +require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/web.dom-collections.iterator.js"); +require("core-js/modules/es.object.assign.js"); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.omit = void 0; +function omit(originalObject, keysToOmit) { + var cloneObject = Object.assign({}, originalObject); + var _iterator = _createForOfIteratorHelper(keysToOmit), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var path = _step.value; + delete cloneObject[path]; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + return cloneObject; +} +exports.omit = omit; + +},{"core-js/modules/es.array.from.js":314,"core-js/modules/es.array.iterator.js":316,"core-js/modules/es.array.slice.js":319,"core-js/modules/es.function.name.js":322,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.regexp.to-string.js":339,"core-js/modules/es.string.iterator.js":343,"core-js/modules/es.symbol.description.js":351,"core-js/modules/es.symbol.iterator.js":353,"core-js/modules/es.symbol.js":354,"core-js/modules/web.dom-collections.iterator.js":381}],78:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.string.includes.js"); +require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.string.match.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parseRestoreInfo = void 0; +exports.parseRestoreInfo = function (originalRestoreInfo) { + var tempRestoreInfo; + if (originalRestoreInfo) { + tempRestoreInfo = { + ongoingRequest: originalRestoreInfo.includes('true') + }; + if (!tempRestoreInfo.ongoingRequest) { + var matchArray = originalRestoreInfo.match(/expiry-date="(.*)"/); + if (matchArray && matchArray[1]) { + tempRestoreInfo.expiryDate = new Date(matchArray[1]); + } + } + } + return tempRestoreInfo; +}; + +},{"core-js/modules/es.array.includes.js":315,"core-js/modules/es.regexp.exec.js":338,"core-js/modules/es.string.includes.js":342,"core-js/modules/es.string.match.js":344}],79:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.keys.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.policy2Str = void 0; +function policy2Str(policy) { + var policyStr; + if (policy) { + if (typeof policy === 'string') { + try { + policyStr = JSON.stringify(JSON.parse(policy)); + } catch (err) { + throw new Error("Policy string is not a valid JSON: ".concat(err.message)); + } + } else { + policyStr = JSON.stringify(policy); + } + } + return policyStr; +} +exports.policy2Str = policy2Str; + +},{"core-js/modules/es.object.keys.js":328}],80:[function(require,module,exports){ +"use strict"; + +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.promise.js"); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.retry = void 0; +function retry(func, retryMax) { + var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var retryNum = 0; + var _config$retryDelay = config.retryDelay, + retryDelay = _config$retryDelay === void 0 ? 500 : _config$retryDelay, + _config$errorHandler = config.errorHandler, + errorHandler = _config$errorHandler === void 0 ? function () { + return true; + } : _config$errorHandler; + var funcR = function funcR() { + for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) { + arg[_key] = arguments[_key]; + } + return new Promise(function (resolve, reject) { + func.apply(void 0, arg).then(function (result) { + retryNum = 0; + resolve(result); + }).catch(function (err) { + if (retryNum < retryMax && errorHandler(err)) { + retryNum++; + setTimeout(function () { + resolve(funcR.apply(void 0, arg)); + }, retryDelay); + } else { + retryNum = 0; + reject(err); + } + }); + }); + }; + return funcR; +} +exports.retry = retry; + +},{"core-js/modules/es.object.to-string.js":329,"core-js/modules/es.promise.js":333}],81:[function(require,module,exports){ +"use strict"; + +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.setRegion = void 0; +var url_1 = __importDefault(require("url")); +var checkConfigValid_1 = require("./checkConfigValid"); +function setRegion(region) { + var internal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var secure = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + checkConfigValid_1.checkConfigValid(region, 'region'); + var protocol = secure ? 'https://' : 'http://'; + var suffix = internal ? '-internal.aliyuncs.com' : '.aliyuncs.com'; + var prefix = 'vpc100-oss-cn-'; + // aliyun VPC region: https://help.aliyun.com/knowledge_detail/38740.html + if (region.substr(0, prefix.length) === prefix) { + suffix = '.aliyuncs.com'; + } + return url_1.default.parse(protocol + region + suffix); +} +exports.setRegion = setRegion; + +},{"./checkConfigValid":54,"url":543}],82:[function(require,module,exports){ +"use strict"; + +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); +require("core-js/modules/es.object.keys.js"); +require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.array.find.js"); +require("core-js/modules/es.object.assign.js"); +var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.checkCredentials = exports.setSTSToken = void 0; +var formatObjKey_1 = require("./formatObjKey"); +function setSTSToken() { + return _setSTSToken.apply(this, arguments); +} +function _setSTSToken() { + _setSTSToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { + var now, credentials; + return _regenerator.default.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + if (!this.options) this.options = {}; + now = new Date(); + if (!this.stsTokenFreshTime) { + _context.next = 14; + break; + } + if (!(+now - this.stsTokenFreshTime >= this.options.refreshSTSTokenInterval)) { + _context.next = 12; + break; + } + this.stsTokenFreshTime = now; + _context.next = 7; + return this.options.refreshSTSToken(); + case 7: + credentials = _context.sent; + credentials = formatObjKey_1.formatObjKey(credentials, 'firstLowerCase'); + if (credentials.securityToken) { + credentials.stsToken = credentials.securityToken; + } + checkCredentials(credentials); + Object.assign(this.options, credentials); + case 12: + _context.next = 15; + break; + case 14: + this.stsTokenFreshTime = now; + case 15: + return _context.abrupt("return", null); + case 16: + case "end": + return _context.stop(); + } + }, _callee, this); + })); + return _setSTSToken.apply(this, arguments); +} +exports.setSTSToken = setSTSToken; +function checkCredentials(obj) { + var stsTokenKey = ['accessKeySecret', 'accessKeyId', 'stsToken']; + var objKeys = Object.keys(obj); + stsTokenKey.forEach(function (_) { + if (!objKeys.find(function (key) { + return key === _; + })) { + throw Error("refreshSTSToken must return contains ".concat(_)); + } + }); +} +exports.checkCredentials = checkCredentials; + +},{"./formatObjKey":64,"@babel/runtime/helpers/asyncToGenerator":85,"@babel/runtime/helpers/interopRequireDefault":86,"@babel/runtime/regenerator":93,"core-js/modules/es.array.find.js":313,"core-js/modules/es.object.assign.js":325,"core-js/modules/es.object.keys.js":328,"core-js/modules/es.object.to-string.js":329}],83:[function(require,module,exports){ +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],84:[function(require,module,exports){ +var arrayLikeToArray = require("./arrayLikeToArray.js"); +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return arrayLikeToArray(arr); +} +module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./arrayLikeToArray.js":83}],85:[function(require,module,exports){ +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; +} +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],86:[function(require,module,exports){ +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],87:[function(require,module,exports){ +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); +} +module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],88:[function(require,module,exports){ +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],89:[function(require,module,exports){ +var _typeof = require("./typeof.js")["default"]; +function _regeneratorRuntime() { + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ + module.exports = _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw new Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(_typeof(e) + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function stop() { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; +} +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./typeof.js":91}],90:[function(require,module,exports){ +var arrayWithoutHoles = require("./arrayWithoutHoles.js"); +var iterableToArray = require("./iterableToArray.js"); +var unsupportedIterableToArray = require("./unsupportedIterableToArray.js"); +var nonIterableSpread = require("./nonIterableSpread.js"); +function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); +} +module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./arrayWithoutHoles.js":84,"./iterableToArray.js":87,"./nonIterableSpread.js":88,"./unsupportedIterableToArray.js":92}],91:[function(require,module,exports){ +function _typeof(o) { + "@babel/helpers - typeof"; + + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); +} +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{}],92:[function(require,module,exports){ +var arrayLikeToArray = require("./arrayLikeToArray.js"); +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); +} +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},{"./arrayLikeToArray.js":83}],93:[function(require,module,exports){ +// TODO(Babel 8): Remove this file. + +var runtime = require("../helpers/regeneratorRuntime")(); +module.exports = runtime; + +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } +} + +},{"../helpers/regeneratorRuntime":89}],94:[function(require,module,exports){ +module.exports = noop; +module.exports.HttpsAgent = noop; + +// Noop function for browser since native api's don't use agents. +function noop () {} + +},{}],95:[function(require,module,exports){ +(function (global){(function (){ +'use strict'; + +var objectAssign = require('object.assign/polyfill')(); + +// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js +// original notice: + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +function compare(a, b) { + if (a === b) { + return 0; + } + + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) { + return -1; + } + if (y < x) { + return 1; + } + return 0; +} +function isBuffer(b) { + if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { + return global.Buffer.isBuffer(b); + } + return !!(b != null && b._isBuffer); +} + +// based on node assert, original notice: +// NB: The URL to the CommonJS spec is kept just for tradition. +// node-assert has evolved a lot since then, both in API and behavior. + +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +var util = require('util/'); +var hasOwn = Object.prototype.hasOwnProperty; +var pSlice = Array.prototype.slice; +var functionsHaveNames = (function () { + return function foo() {}.name === 'foo'; +}()); +function pToString (obj) { + return Object.prototype.toString.call(obj); +} +function isView(arrbuf) { + if (isBuffer(arrbuf)) { + return false; + } + if (typeof global.ArrayBuffer !== 'function') { + return false; + } + if (typeof ArrayBuffer.isView === 'function') { + return ArrayBuffer.isView(arrbuf); + } + if (!arrbuf) { + return false; + } + if (arrbuf instanceof DataView) { + return true; + } + if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { + return true; + } + return false; +} +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + +var assert = module.exports = ok; + +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +var regex = /\s*function\s+([^\(\s]*)\s*/; +// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js +function getName(func) { + if (!util.isFunction(func)) { + return; + } + if (functionsHaveNames) { + return func.name; + } + var str = func.toString(); + var match = str.match(regex); + return match && match[1]; +} +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; + + // try to strip useless frames + var fn_name = getName(stackStartFunction); + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; + +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); + +function truncate(s, n) { + if (typeof s === 'string') { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} +function inspect(something) { + if (functionsHaveNames || !util.isFunction(something)) { + return util.inspect(something); + } + var rawname = getName(something); + var name = rawname ? ': ' + rawname : ''; + return '[Function' + name + ']'; +} +function getMessage(self) { + return truncate(inspect(self.actual), 128) + ' ' + + self.operator + ' ' + + truncate(inspect(self.expected), 128); +} + +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. + +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. + +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} + +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; + +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; + +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; + +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; + +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + } +}; + +function _deepEqual(actual, expected, strict, memos) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + } else if (isBuffer(actual) && isBuffer(expected)) { + return compare(actual, expected) === 0; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if ((actual === null || typeof actual !== 'object') && + (expected === null || typeof expected !== 'object')) { + return strict ? actual === expected : actual == expected; + + // If both values are instances of typed arrays, wrap their underlying + // ArrayBuffers in a Buffer each to increase performance + // This optimization requires the arrays to have the same type as checked by + // Object.prototype.toString (aka pToString). Never perform binary + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their + // bit patterns are not identical. + } else if (isView(actual) && isView(expected) && + pToString(actual) === pToString(expected) && + !(actual instanceof Float32Array || + actual instanceof Float64Array)) { + return compare(new Uint8Array(actual.buffer), + new Uint8Array(expected.buffer)) === 0; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else if (isBuffer(actual) !== isBuffer(expected)) { + return false; + } else { + memos = memos || {actual: [], expected: []}; + + var actualIndex = memos.actual.indexOf(actual); + if (actualIndex !== -1) { + if (actualIndex === memos.expected.indexOf(expected)) { + return true; + } + } + + memos.actual.push(actual); + memos.expected.push(expected); + + return objEquiv(actual, expected, strict, memos); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b, strict, actualVisitedObjects) { + if (a === null || a === undefined || b === null || b === undefined) + return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) + return a === b; + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) + return false; + var aIsArgs = isArguments(a); + var bIsArgs = isArguments(b); + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) + return false; + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b, strict); + } + var ka = objectKeys(a); + var kb = objectKeys(b); + var key, i; + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length !== kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] !== kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) + return false; + } + return true; +} + +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +assert.notDeepStrictEqual = notDeepStrictEqual; +function notDeepStrictEqual(actual, expected, message) { + if (_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); + } +} + + +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; + +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } + + try { + if (actual instanceof expected) { + return true; + } + } catch (e) { + // Ignore. The instanceof check doesn't work for arrow functions. + } + + if (Error.isPrototypeOf(expected)) { + return false; + } + + return expected.call({}, actual) === true; +} + +function _tryBlock(block) { + var error; + try { + block(); + } catch (e) { + error = e; + } + return error; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (typeof block !== 'function') { + throw new TypeError('"block" argument must be a function'); + } + + if (typeof expected === 'string') { + message = expected; + expected = null; + } + + actual = _tryBlock(block); + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + var userProvidedMessage = typeof message === 'string'; + var isUnwantedException = !shouldThrow && util.isError(actual); + var isUnexpectedException = !shouldThrow && actual && !expected; + + if ((isUnwantedException && + userProvidedMessage && + expectedException(actual, expected)) || + isUnexpectedException) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } +} + +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws(true, block, error, message); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { + _throws(false, block, error, message); +}; + +assert.ifError = function(err) { if (err) throw err; }; + +// Expose a strict only variant of assert +function strict(value, message) { + if (!value) fail(value, true, message, '==', strict); +} +assert.strict = objectAssign(strict, assert, { + equal: assert.strictEqual, + deepEqual: assert.deepStrictEqual, + notEqual: assert.notStrictEqual, + notDeepEqual: assert.notDeepStrictEqual +}); +assert.strict.strict = assert.strict; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + return keys; +}; + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"object.assign/polyfill":438,"util/":98}],96:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],97:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],98:[function(require,module,exports){ +(function (process,global){(function (){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +}).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":97,"_process":538,"inherits":96}],99:[function(require,module,exports){ +(function (global){(function (){ +'use strict'; + +var possibleNames = [ + 'BigInt64Array', + 'BigUint64Array', + 'Float32Array', + 'Float64Array', + 'Int16Array', + 'Int32Array', + 'Int8Array', + 'Uint16Array', + 'Uint32Array', + 'Uint8Array', + 'Uint8ClampedArray' +]; + +var g = typeof globalThis === 'undefined' ? global : globalThis; + +module.exports = function availableTypedArrays() { + var out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === 'function') { + out[out.length] = possibleNames[i]; + } + } + return out; +}; + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],100:[function(require,module,exports){ +'use strict' + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function getLens (b64) { + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} + +},{}],101:[function(require,module,exports){ +/*! + * Bowser - a browser detector + * https://github.com/ded/bowser + * MIT License | (c) Dustin Diaz 2015 + */ + +!function (root, name, definition) { + if (typeof module != 'undefined' && module.exports) module.exports = definition() + else if (typeof define == 'function' && define.amd) define(name, definition) + else root[name] = definition() +}(this, 'bowser', function () { + /** + * See useragents.js for examples of navigator.userAgent + */ + + var t = true + + function detect(ua) { + + function getFirstMatch(regex) { + var match = ua.match(regex); + return (match && match.length > 1 && match[1]) || ''; + } + + function getSecondMatch(regex) { + var match = ua.match(regex); + return (match && match.length > 1 && match[2]) || ''; + } + + var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase() + , likeAndroid = /like android/i.test(ua) + , android = !likeAndroid && /android/i.test(ua) + , nexusMobile = /nexus\s*[0-6]\s*/i.test(ua) + , nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua) + , chromeos = /CrOS/.test(ua) + , silk = /silk/i.test(ua) + , sailfish = /sailfish/i.test(ua) + , tizen = /tizen/i.test(ua) + , webos = /(web|hpw)(o|0)s/i.test(ua) + , windowsphone = /windows phone/i.test(ua) + , samsungBrowser = /SamsungBrowser/i.test(ua) + , windows = !windowsphone && /windows/i.test(ua) + , mac = !iosdevice && !silk && /macintosh/i.test(ua) + , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua) + , edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i) + , versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i) + , tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua) + , mobile = !tablet && /[^-]mobi/i.test(ua) + , xbox = /xbox/i.test(ua) + , result + + if (/opera/i.test(ua)) { + // an old Opera + result = { + name: 'Opera' + , opera: t + , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) + } + } else if (/opr\/|opios/i.test(ua)) { + // a new Opera + result = { + name: 'Opera' + , opera: t + , version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier + } + } + else if (/SamsungBrowser/i.test(ua)) { + result = { + name: 'Samsung Internet for Android' + , samsungBrowser: t + , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) + } + } + else if (/Whale/i.test(ua)) { + result = { + name: 'NAVER Whale browser' + , whale: t + , version: getFirstMatch(/(?:whale)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (/MZBrowser/i.test(ua)) { + result = { + name: 'MZ Browser' + , mzbrowser: t + , version: getFirstMatch(/(?:MZBrowser)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (/coast/i.test(ua)) { + result = { + name: 'Opera Coast' + , coast: t + , version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i) + } + } + else if (/focus/i.test(ua)) { + result = { + name: 'Focus' + , focus: t + , version: getFirstMatch(/(?:focus)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (/yabrowser/i.test(ua)) { + result = { + name: 'Yandex Browser' + , yandexbrowser: t + , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) + } + } + else if (/ucbrowser/i.test(ua)) { + result = { + name: 'UC Browser' + , ucbrowser: t + , version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (/mxios/i.test(ua)) { + result = { + name: 'Maxthon' + , maxthon: t + , version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (/epiphany/i.test(ua)) { + result = { + name: 'Epiphany' + , epiphany: t + , version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (/puffin/i.test(ua)) { + result = { + name: 'Puffin' + , puffin: t + , version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) + } + } + else if (/sleipnir/i.test(ua)) { + result = { + name: 'Sleipnir' + , sleipnir: t + , version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (/k-meleon/i.test(ua)) { + result = { + name: 'K-Meleon' + , kMeleon: t + , version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) + } + } + else if (windowsphone) { + result = { + name: 'Windows Phone' + , osname: 'Windows Phone' + , windowsphone: t + } + if (edgeVersion) { + result.msedge = t + result.version = edgeVersion + } + else { + result.msie = t + result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i) + } + } + else if (/msie|trident/i.test(ua)) { + result = { + name: 'Internet Explorer' + , msie: t + , version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i) + } + } else if (chromeos) { + result = { + name: 'Chrome' + , osname: 'Chrome OS' + , chromeos: t + , chromeBook: t + , chrome: t + , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) + } + } else if (/edg([ea]|ios)/i.test(ua)) { + result = { + name: 'Microsoft Edge' + , msedge: t + , version: edgeVersion + } + } + else if (/vivaldi/i.test(ua)) { + result = { + name: 'Vivaldi' + , vivaldi: t + , version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier + } + } + else if (sailfish) { + result = { + name: 'Sailfish' + , osname: 'Sailfish OS' + , sailfish: t + , version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i) + } + } + else if (/seamonkey\//i.test(ua)) { + result = { + name: 'SeaMonkey' + , seamonkey: t + , version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i) + } + } + else if (/firefox|iceweasel|fxios/i.test(ua)) { + result = { + name: 'Firefox' + , firefox: t + , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) + } + if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { + result.firefoxos = t + result.osname = 'Firefox OS' + } + } + else if (silk) { + result = { + name: 'Amazon Silk' + , silk: t + , version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i) + } + } + else if (/phantom/i.test(ua)) { + result = { + name: 'PhantomJS' + , phantom: t + , version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i) + } + } + else if (/slimerjs/i.test(ua)) { + result = { + name: 'SlimerJS' + , slimer: t + , version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i) + } + } + else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) { + result = { + name: 'BlackBerry' + , osname: 'BlackBerry OS' + , blackberry: t + , version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i) + } + } + else if (webos) { + result = { + name: 'WebOS' + , osname: 'WebOS' + , webos: t + , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) + }; + /touchpad\//i.test(ua) && (result.touchpad = t) + } + else if (/bada/i.test(ua)) { + result = { + name: 'Bada' + , osname: 'Bada' + , bada: t + , version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i) + }; + } + else if (tizen) { + result = { + name: 'Tizen' + , osname: 'Tizen' + , tizen: t + , version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier + }; + } + else if (/qupzilla/i.test(ua)) { + result = { + name: 'QupZilla' + , qupzilla: t + , version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier + } + } + else if (/chromium/i.test(ua)) { + result = { + name: 'Chromium' + , chromium: t + , version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier + } + } + else if (/chrome|crios|crmo/i.test(ua)) { + result = { + name: 'Chrome' + , chrome: t + , version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) + } + } + else if (android) { + result = { + name: 'Android' + , version: versionIdentifier + } + } + else if (/safari|applewebkit/i.test(ua)) { + result = { + name: 'Safari' + , safari: t + } + if (versionIdentifier) { + result.version = versionIdentifier + } + } + else if (iosdevice) { + result = { + name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod' + } + // WTF: version is not part of user agent in web apps + if (versionIdentifier) { + result.version = versionIdentifier + } + } + else if(/googlebot/i.test(ua)) { + result = { + name: 'Googlebot' + , googlebot: t + , version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier + } + } + else { + result = { + name: getFirstMatch(/^(.*)\/(.*) /), + version: getSecondMatch(/^(.*)\/(.*) /) + }; + } + + // set webkit or gecko flag for browsers based on these engines + if (!result.msedge && /(apple)?webkit/i.test(ua)) { + if (/(apple)?webkit\/537\.36/i.test(ua)) { + result.name = result.name || "Blink" + result.blink = t + } else { + result.name = result.name || "Webkit" + result.webkit = t + } + if (!result.version && versionIdentifier) { + result.version = versionIdentifier + } + } else if (!result.opera && /gecko\//i.test(ua)) { + result.name = result.name || "Gecko" + result.gecko = t + result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i) + } + + // set OS flags for platforms that have multiple browsers + if (!result.windowsphone && (android || result.silk)) { + result.android = t + result.osname = 'Android' + } else if (!result.windowsphone && iosdevice) { + result[iosdevice] = t + result.ios = t + result.osname = 'iOS' + } else if (mac) { + result.mac = t + result.osname = 'macOS' + } else if (xbox) { + result.xbox = t + result.osname = 'Xbox' + } else if (windows) { + result.windows = t + result.osname = 'Windows' + } else if (linux) { + result.linux = t + result.osname = 'Linux' + } + + function getWindowsVersion (s) { + switch (s) { + case 'NT': return 'NT' + case 'XP': return 'XP' + case 'NT 5.0': return '2000' + case 'NT 5.1': return 'XP' + case 'NT 5.2': return '2003' + case 'NT 6.0': return 'Vista' + case 'NT 6.1': return '7' + case 'NT 6.2': return '8' + case 'NT 6.3': return '8.1' + case 'NT 10.0': return '10' + default: return undefined + } + } + + // OS version extraction + var osVersion = ''; + if (result.windows) { + osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i)) + } else if (result.windowsphone) { + osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); + } else if (result.mac) { + osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i); + osVersion = osVersion.replace(/[_\s]/g, '.'); + } else if (iosdevice) { + osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i); + osVersion = osVersion.replace(/[_\s]/g, '.'); + } else if (android) { + osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i); + } else if (result.webos) { + osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); + } else if (result.blackberry) { + osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); + } else if (result.bada) { + osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i); + } else if (result.tizen) { + osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i); + } + if (osVersion) { + result.osversion = osVersion; + } + + // device type extraction + var osMajorVersion = !result.windows && osVersion.split('.')[0]; + if ( + tablet + || nexusTablet + || iosdevice == 'ipad' + || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile))) + || result.silk + ) { + result.tablet = t + } else if ( + mobile + || iosdevice == 'iphone' + || iosdevice == 'ipod' + || android + || nexusMobile + || result.blackberry + || result.webos + || result.bada + ) { + result.mobile = t + } + + // Graded Browser Support + // http://developer.yahoo.com/yui/articles/gbs + if (result.msedge || + (result.msie && result.version >= 10) || + (result.yandexbrowser && result.version >= 15) || + (result.vivaldi && result.version >= 1.0) || + (result.chrome && result.version >= 20) || + (result.samsungBrowser && result.version >= 4) || + (result.whale && compareVersions([result.version, '1.0']) === 1) || + (result.mzbrowser && compareVersions([result.version, '6.0']) === 1) || + (result.focus && compareVersions([result.version, '1.0']) === 1) || + (result.firefox && result.version >= 20.0) || + (result.safari && result.version >= 6) || + (result.opera && result.version >= 10.0) || + (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) || + (result.blackberry && result.version >= 10.1) + || (result.chromium && result.version >= 20) + ) { + result.a = t; + } + else if ((result.msie && result.version < 10) || + (result.chrome && result.version < 20) || + (result.firefox && result.version < 20.0) || + (result.safari && result.version < 6) || + (result.opera && result.version < 10.0) || + (result.ios && result.osversion && result.osversion.split(".")[0] < 6) + || (result.chromium && result.version < 20) + ) { + result.c = t + } else result.x = t + + return result + } + + var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '') + + bowser.test = function (browserList) { + for (var i = 0; i < browserList.length; ++i) { + var browserItem = browserList[i]; + if (typeof browserItem=== 'string') { + if (browserItem in bowser) { + return true; + } + } + } + return false; + } + + /** + * Get version precisions count + * + * @example + * getVersionPrecision("1.10.3") // 3 + * + * @param {string} version + * @return {number} + */ + function getVersionPrecision(version) { + return version.split(".").length; + } + + /** + * Array::map polyfill + * + * @param {Array} arr + * @param {Function} iterator + * @return {Array} + */ + function map(arr, iterator) { + var result = [], i; + if (Array.prototype.map) { + return Array.prototype.map.call(arr, iterator); + } + for (i = 0; i < arr.length; i++) { + result.push(iterator(arr[i])); + } + return result; + } + + /** + * Calculate browser version weight + * + * @example + * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1 + * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1 + * compareVersions(['1.10.2.1', '1.10.2.1']); // 0 + * compareVersions(['1.10.2.1', '1.0800.2']); // -1 + * + * @param {Array} versions versions to compare + * @return {Number} comparison result + */ + function compareVersions(versions) { + // 1) get common precision for both versions, for example for "10.0" and "9" it should be 2 + var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1])); + var chunks = map(versions, function (version) { + var delta = precision - getVersionPrecision(version); + + // 2) "9" -> "9.0" (for precision = 2) + version = version + new Array(delta + 1).join(".0"); + + // 3) "9.0" -> ["000000000"", "000000009"] + return map(version.split("."), function (chunk) { + return new Array(20 - chunk.length).join("0") + chunk; + }).reverse(); + }); + + // iterate in reverse order by reversed chunks array + while (--precision >= 0) { + // 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true) + if (chunks[0][precision] > chunks[1][precision]) { + return 1; + } + else if (chunks[0][precision] === chunks[1][precision]) { + if (precision === 0) { + // all version chunks are same + return 0; + } + } + else { + return -1; + } + } + } + + /** + * Check if browser is unsupported + * + * @example + * bowser.isUnsupportedBrowser({ + * msie: "10", + * firefox: "23", + * chrome: "29", + * safari: "5.1", + * opera: "16", + * phantom: "534" + * }); + * + * @param {Object} minVersions map of minimal version to browser + * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map + * @param {String} [ua] user agent string + * @return {Boolean} + */ + function isUnsupportedBrowser(minVersions, strictMode, ua) { + var _bowser = bowser; + + // make strictMode param optional with ua param usage + if (typeof strictMode === 'string') { + ua = strictMode; + strictMode = void(0); + } + + if (strictMode === void(0)) { + strictMode = false; + } + if (ua) { + _bowser = detect(ua); + } + + var version = "" + _bowser.version; + for (var browser in minVersions) { + if (minVersions.hasOwnProperty(browser)) { + if (_bowser[browser]) { + if (typeof minVersions[browser] !== 'string') { + throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions)); + } + + // browser version and min supported version. + return compareVersions([version, minVersions[browser]]) < 0; + } + } + } + + return strictMode; // not found + } + + /** + * Check if browser is supported + * + * @param {Object} minVersions map of minimal version to browser + * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map + * @param {String} [ua] user agent string + * @return {Boolean} + */ + function check(minVersions, strictMode, ua) { + return !isUnsupportedBrowser(minVersions, strictMode, ua); + } + + bowser.isUnsupportedBrowser = isUnsupportedBrowser; + bowser.compareVersions = compareVersions; + bowser.check = check; + + /* + * Set our detect method to the main bowser object so we can + * reuse it to test other user agents. + * This is needed to implement future tests. + */ + bowser._detect = detect; + + /* + * Set our detect public method to the main bowser object + * This is needed to implement bowser in server side + */ + bowser.detect = detect; + return bowser +}); + +},{}],102:[function(require,module,exports){ + +},{}],103:[function(require,module,exports){ +(function (Buffer){(function (){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + +'use strict' + +var base64 = require('base64-js') +var ieee754 = require('ieee754') + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +var K_MAX_LENGTH = 0x7fffffff +exports.kMaxLength = K_MAX_LENGTH + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ +Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() + +if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ) +} + +function typedArraySupport () { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1) + arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function () { return 42 } } + return arr.foo() === 42 + } catch (e) { + return false + } +} + +Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } +}) + +Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } +}) + +function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + var buf = new Uint8Array(length) + buf.__proto__ = Buffer.prototype + return buf +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) +} + +// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 +if (typeof Symbol !== 'undefined' && Symbol.species != null && + Buffer[Symbol.species] === Buffer) { + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true, + enumerable: false, + writable: false + }) +} + +Buffer.poolSize = 8192 // not used by this implementation + +function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayLike(value) + } + + if (value == null) { + throw TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + var valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + var b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from( + value[Symbol.toPrimitive]('string'), encodingOrOffset, length + ) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) +} + +// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: +// https://github.com/feross/buffer/pull/148 +Buffer.prototype.__proto__ = Uint8Array.prototype +Buffer.__proto__ = Uint8Array + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } +} + +function alloc (size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) +} + +function allocUnsafe (size) { + assertSize(size) + return createBuffer(size < 0 ? 0 : checked(size) | 0) +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + var length = byteLength(string, encoding) | 0 + var buf = createBuffer(length) + + var actual = buf.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual) + } + + return buf +} + +function fromArrayLike (array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + var buf = createBuffer(length) + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255 + } + return buf +} + +function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + var buf + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array) + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset) + } else { + buf = new Uint8Array(array, byteOffset, length) + } + + // Return an augmented `Uint8Array` instance + buf.__proto__ = Buffer.prototype + return buf +} + +function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + var buf = createBuffer(len) + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len) + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } +} + +function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false +} + +Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (isInstance(buf, Uint8Array)) { + buf = Buffer.from(buf) + } + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + var len = string.length + var mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) +// to detect a Buffer instance. It's not possible to use `instanceof Buffer` +// reliably in a browserify context because there could be multiple different +// copies of the 'buffer' package in use. This method works even for Buffer +// instances that were created from another copy of the `buffer` package. +// See: https://github.com/feross/buffer/issues/154 +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + var length = this.length + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.toLocaleString = Buffer.prototype.toString + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' + return '' +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + var strLen = string.length + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0 + if (isFinite(length)) { + length = length >>> 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf = this.subarray(start, end) + // Return an augmented `Uint8Array` instance + newBuf.__proto__ = Buffer.prototype + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + var limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end) + } else if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (var i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code + } + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding) + var len = bytes.length + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0] + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) +} +function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare +} + +}).call(this)}).call(this,require("buffer").Buffer) +},{"base64-js":100,"buffer":103,"ieee754":400}],104:[function(require,module,exports){ +module.exports = { + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Unordered Collection", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" +} + +},{}],105:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; + +},{"./":106,"get-intrinsic":390}],106:[function(require,module,exports){ +'use strict'; + +var bind = require('function-bind'); +var GetIntrinsic = require('get-intrinsic'); +var setFunctionLength = require('set-function-length'); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); +var $max = GetIntrinsic('%Math.max%'); + +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = null; + } +} + +module.exports = function callBind(originalFunction) { + if (typeof originalFunction !== 'function') { + throw new $TypeError('a function is required'); + } + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} + +},{"function-bind":389,"get-intrinsic":390,"set-function-length":466}],107:[function(require,module,exports){ +/*! + * copy-to - index.js + * Copyright(c) 2014 dead_horse + * MIT Licensed + */ + +'use strict'; + +/** + * slice() reference. + */ + +var slice = Array.prototype.slice; + +/** + * Expose copy + * + * ``` + * copy({foo: 'nar', hello: 'copy'}).to({hello: 'world'}); + * copy({foo: 'nar', hello: 'copy'}).toCover({hello: 'world'}); + * ``` + * + * @param {Object} src + * @return {Copy} + */ + +module.exports = Copy; + + +/** + * Copy + * @param {Object} src + * @param {Boolean} withAccess + */ + +function Copy(src, withAccess) { + if (!(this instanceof Copy)) return new Copy(src, withAccess); + this.src = src; + this._withAccess = withAccess; +} + +/** + * copy properties include getter and setter + * @param {[type]} val [description] + * @return {[type]} [description] + */ + +Copy.prototype.withAccess = function (w) { + this._withAccess = w !== false; + return this; +}; + +/** + * pick keys in src + * + * @api: public + */ + +Copy.prototype.pick = function(keys) { + if (!Array.isArray(keys)) { + keys = slice.call(arguments); + } + if (keys.length) { + this.keys = keys; + } + return this; +}; + +/** + * copy src to target, + * do not cover any property target has + * @param {Object} to + * + * @api: public + */ + +Copy.prototype.to = function(to) { + to = to || {}; + + if (!this.src) return to; + var keys = this.keys || Object.keys(this.src); + + if (!this._withAccess) { + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + if (to[key] !== undefined) continue; + to[key] = this.src[key]; + } + return to; + } + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!notDefined(to, key)) continue; + var getter = this.src.__lookupGetter__(key); + var setter = this.src.__lookupSetter__(key); + if (getter) to.__defineGetter__(key, getter); + if (setter) to.__defineSetter__(key, setter); + + if (!getter && !setter) { + to[key] = this.src[key]; + } + } + return to; +}; + +/** + * copy src to target, + * override any property target has + * @param {Object} to + * + * @api: public + */ + +Copy.prototype.toCover = function(to) { + var keys = this.keys || Object.keys(this.src); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + delete to[key]; + var getter = this.src.__lookupGetter__(key); + var setter = this.src.__lookupSetter__(key); + if (getter) to.__defineGetter__(key, getter); + if (setter) to.__defineSetter__(key, setter); + + if (!getter && !setter) { + to[key] = this.src[key]; + } + } +}; + +Copy.prototype.override = Copy.prototype.toCover; + +/** + * append another object to src + * @param {Obj} obj + * @return {Copy} + */ + +Copy.prototype.and = function (obj) { + var src = {}; + this.to(src); + this.src = obj; + this.to(src); + this.src = src; + + return this; +}; + +/** + * check obj[key] if not defiend + * @param {Object} obj + * @param {String} key + * @return {Boolean} + */ + +function notDefined(obj, key) { + return obj[key] === undefined + && obj.__lookupGetter__(key) === undefined + && obj.__lookupSetter__(key) === undefined; +} + +},{}],108:[function(require,module,exports){ +'use strict'; +var isCallable = require('../internals/is-callable'); +var tryToString = require('../internals/try-to-string'); + +var $TypeError = TypeError; + +// `Assert: IsCallable(argument) is true` +module.exports = function (argument) { + if (isCallable(argument)) return argument; + throw new $TypeError(tryToString(argument) + ' is not a function'); +}; + +},{"../internals/is-callable":203,"../internals/try-to-string":293}],109:[function(require,module,exports){ +'use strict'; +var isConstructor = require('../internals/is-constructor'); +var tryToString = require('../internals/try-to-string'); + +var $TypeError = TypeError; + +// `Assert: IsConstructor(argument) is true` +module.exports = function (argument) { + if (isConstructor(argument)) return argument; + throw new $TypeError(tryToString(argument) + ' is not a constructor'); +}; + +},{"../internals/is-constructor":204,"../internals/try-to-string":293}],110:[function(require,module,exports){ +'use strict'; +var isPossiblePrototype = require('../internals/is-possible-prototype'); + +var $String = String; +var $TypeError = TypeError; + +module.exports = function (argument) { + if (isPossiblePrototype(argument)) return argument; + throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); +}; + +},{"../internals/is-possible-prototype":209}],111:[function(require,module,exports){ +'use strict'; +var wellKnownSymbol = require('../internals/well-known-symbol'); +var create = require('../internals/object-create'); +var defineProperty = require('../internals/object-define-property').f; + +var UNSCOPABLES = wellKnownSymbol('unscopables'); +var ArrayPrototype = Array.prototype; + +// Array.prototype[@@unscopables] +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +if (ArrayPrototype[UNSCOPABLES] === undefined) { + defineProperty(ArrayPrototype, UNSCOPABLES, { + configurable: true, + value: create(null) + }); +} + +// add a key to Array.prototype[@@unscopables] +module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; +}; + +},{"../internals/object-create":229,"../internals/object-define-property":231,"../internals/well-known-symbol":306}],112:[function(require,module,exports){ +'use strict'; +var charAt = require('../internals/string-multibyte').charAt; + +// `AdvanceStringIndex` abstract operation +// https://tc39.es/ecma262/#sec-advancestringindex +module.exports = function (S, index, unicode) { + return index + (unicode ? charAt(S, index).length : 1); +}; + +},{"../internals/string-multibyte":271}],113:[function(require,module,exports){ +'use strict'; +var isPrototypeOf = require('../internals/object-is-prototype-of'); + +var $TypeError = TypeError; + +module.exports = function (it, Prototype) { + if (isPrototypeOf(Prototype, it)) return it; + throw new $TypeError('Incorrect invocation'); +}; + +},{"../internals/object-is-prototype-of":238}],114:[function(require,module,exports){ +'use strict'; +var isObject = require('../internals/is-object'); + +var $String = String; +var $TypeError = TypeError; + +// `Assert: Type(argument) is Object` +module.exports = function (argument) { + if (isObject(argument)) return argument; + throw new $TypeError($String(argument) + ' is not an object'); +}; + +},{"../internals/is-object":208}],115:[function(require,module,exports){ +'use strict'; +// eslint-disable-next-line es/no-typed-arrays -- safe +module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; + +},{}],116:[function(require,module,exports){ +'use strict'; +// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it +var fails = require('../internals/fails'); + +module.exports = fails(function () { + if (typeof ArrayBuffer == 'function') { + var buffer = new ArrayBuffer(8); + // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe + if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 }); + } +}); + +},{"../internals/fails":171}],117:[function(require,module,exports){ +'use strict'; +var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection'); +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var hasOwn = require('../internals/has-own-property'); +var classof = require('../internals/classof'); +var tryToString = require('../internals/try-to-string'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltIn = require('../internals/define-built-in'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var uid = require('../internals/uid'); +var InternalStateModule = require('../internals/internal-state'); + +var enforceInternalState = InternalStateModule.enforce; +var getInternalState = InternalStateModule.get; +var Int8Array = global.Int8Array; +var Int8ArrayPrototype = Int8Array && Int8Array.prototype; +var Uint8ClampedArray = global.Uint8ClampedArray; +var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; +var TypedArray = Int8Array && getPrototypeOf(Int8Array); +var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); +var ObjectPrototype = Object.prototype; +var TypeError = global.TypeError; + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); +var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; +// Fixing native typed arrays in Opera Presto crashes the browser, see #595 +var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; +var TYPED_ARRAY_TAG_REQUIRED = false; +var NAME, Constructor, Prototype; + +var TypedArrayConstructorsList = { + Int8Array: 1, + Uint8Array: 1, + Uint8ClampedArray: 1, + Int16Array: 2, + Uint16Array: 2, + Int32Array: 4, + Uint32Array: 4, + Float32Array: 4, + Float64Array: 8 +}; + +var BigIntArrayConstructorsList = { + BigInt64Array: 8, + BigUint64Array: 8 +}; + +var isView = function isView(it) { + if (!isObject(it)) return false; + var klass = classof(it); + return klass === 'DataView' + || hasOwn(TypedArrayConstructorsList, klass) + || hasOwn(BigIntArrayConstructorsList, klass); +}; + +var getTypedArrayConstructor = function (it) { + var proto = getPrototypeOf(it); + if (!isObject(proto)) return; + var state = getInternalState(proto); + return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto); +}; + +var isTypedArray = function (it) { + if (!isObject(it)) return false; + var klass = classof(it); + return hasOwn(TypedArrayConstructorsList, klass) + || hasOwn(BigIntArrayConstructorsList, klass); +}; + +var aTypedArray = function (it) { + if (isTypedArray(it)) return it; + throw new TypeError('Target is not a typed array'); +}; + +var aTypedArrayConstructor = function (C) { + if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C; + throw new TypeError(tryToString(C) + ' is not a typed array constructor'); +}; + +var exportTypedArrayMethod = function (KEY, property, forced, options) { + if (!DESCRIPTORS) return; + if (forced) for (var ARRAY in TypedArrayConstructorsList) { + var TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try { + delete TypedArrayConstructor.prototype[KEY]; + } catch (error) { + // old WebKit bug - some methods are non-configurable + try { + TypedArrayConstructor.prototype[KEY] = property; + } catch (error2) { /* empty */ } + } + } + if (!TypedArrayPrototype[KEY] || forced) { + defineBuiltIn(TypedArrayPrototype, KEY, forced ? property + : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options); + } +}; + +var exportTypedArrayStaticMethod = function (KEY, property, forced) { + var ARRAY, TypedArrayConstructor; + if (!DESCRIPTORS) return; + if (setPrototypeOf) { + if (forced) for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try { + delete TypedArrayConstructor[KEY]; + } catch (error) { /* empty */ } + } + if (!TypedArray[KEY] || forced) { + // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable + try { + return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property); + } catch (error) { /* empty */ } + } else return; + } + for (ARRAY in TypedArrayConstructorsList) { + TypedArrayConstructor = global[ARRAY]; + if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { + defineBuiltIn(TypedArrayConstructor, KEY, property); + } + } +}; + +for (NAME in TypedArrayConstructorsList) { + Constructor = global[NAME]; + Prototype = Constructor && Constructor.prototype; + if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; + else NATIVE_ARRAY_BUFFER_VIEWS = false; +} + +for (NAME in BigIntArrayConstructorsList) { + Constructor = global[NAME]; + Prototype = Constructor && Constructor.prototype; + if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; +} + +// WebKit bug - typed arrays constructors prototype is Object.prototype +if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) { + // eslint-disable-next-line no-shadow -- safe + TypedArray = function TypedArray() { + throw new TypeError('Incorrect invocation'); + }; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME], TypedArray); + } +} + +if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { + TypedArrayPrototype = TypedArray.prototype; + if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { + if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype); + } +} + +// WebKit bug - one more object in Uint8ClampedArray prototype chain +if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { + setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); +} + +if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { + TYPED_ARRAY_TAG_REQUIRED = true; + defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, { + configurable: true, + get: function () { + return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; + } + }); + for (NAME in TypedArrayConstructorsList) if (global[NAME]) { + createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME); + } +} + +module.exports = { + NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG, + aTypedArray: aTypedArray, + aTypedArrayConstructor: aTypedArrayConstructor, + exportTypedArrayMethod: exportTypedArrayMethod, + exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, + getTypedArrayConstructor: getTypedArrayConstructor, + isView: isView, + isTypedArray: isTypedArray, + TypedArray: TypedArray, + TypedArrayPrototype: TypedArrayPrototype +}; + +},{"../internals/array-buffer-basic-detection":115,"../internals/classof":138,"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/global":188,"../internals/has-own-property":189,"../internals/internal-state":199,"../internals/is-callable":203,"../internals/is-object":208,"../internals/object-get-prototype-of":236,"../internals/object-is-prototype-of":238,"../internals/object-set-prototype-of":242,"../internals/try-to-string":293,"../internals/uid":299,"../internals/well-known-symbol":306}],118:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var DESCRIPTORS = require('../internals/descriptors'); +var NATIVE_ARRAY_BUFFER = require('../internals/array-buffer-basic-detection'); +var FunctionName = require('../internals/function-name'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var defineBuiltIns = require('../internals/define-built-ins'); +var fails = require('../internals/fails'); +var anInstance = require('../internals/an-instance'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toLength = require('../internals/to-length'); +var toIndex = require('../internals/to-index'); +var fround = require('../internals/math-fround'); +var IEEE754 = require('../internals/ieee754'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var arrayFill = require('../internals/array-fill'); +var arraySlice = require('../internals/array-slice'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var copyConstructorProperties = require('../internals/copy-constructor-properties'); +var setToStringTag = require('../internals/set-to-string-tag'); +var InternalStateModule = require('../internals/internal-state'); + +var PROPER_FUNCTION_NAME = FunctionName.PROPER; +var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length'; +var WRONG_INDEX = 'Wrong index'; +var getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER); +var getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW); +var setInternalState = InternalStateModule.set; +var NativeArrayBuffer = global[ARRAY_BUFFER]; +var $ArrayBuffer = NativeArrayBuffer; +var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; +var $DataView = global[DATA_VIEW]; +var DataViewPrototype = $DataView && $DataView[PROTOTYPE]; +var ObjectPrototype = Object.prototype; +var Array = global.Array; +var RangeError = global.RangeError; +var fill = uncurryThis(arrayFill); +var reverse = uncurryThis([].reverse); + +var packIEEE754 = IEEE754.pack; +var unpackIEEE754 = IEEE754.unpack; + +var packInt8 = function (number) { + return [number & 0xFF]; +}; + +var packInt16 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF]; +}; + +var packInt32 = function (number) { + return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF]; +}; + +var unpackInt32 = function (buffer) { + return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]; +}; + +var packFloat32 = function (number) { + return packIEEE754(fround(number), 23, 4); +}; + +var packFloat64 = function (number) { + return packIEEE754(number, 52, 8); +}; + +var addGetter = function (Constructor, key, getInternalState) { + defineBuiltInAccessor(Constructor[PROTOTYPE], key, { + configurable: true, + get: function () { + return getInternalState(this)[key]; + } + }); +}; + +var get = function (view, count, index, isLittleEndian) { + var store = getInternalDataViewState(view); + var intIndex = toIndex(index); + var boolIsLittleEndian = !!isLittleEndian; + if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX); + var bytes = store.bytes; + var start = intIndex + store.byteOffset; + var pack = arraySlice(bytes, start, start + count); + return boolIsLittleEndian ? pack : reverse(pack); +}; + +var set = function (view, count, index, conversion, value, isLittleEndian) { + var store = getInternalDataViewState(view); + var intIndex = toIndex(index); + var pack = conversion(+value); + var boolIsLittleEndian = !!isLittleEndian; + if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX); + var bytes = store.bytes; + var start = intIndex + store.byteOffset; + for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1]; +}; + +if (!NATIVE_ARRAY_BUFFER) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, ArrayBufferPrototype); + var byteLength = toIndex(length); + setInternalState(this, { + type: ARRAY_BUFFER, + bytes: fill(Array(byteLength), 0), + byteLength: byteLength + }); + if (!DESCRIPTORS) { + this.byteLength = byteLength; + this.detached = false; + } + }; + + ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE]; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, DataViewPrototype); + anInstance(buffer, ArrayBufferPrototype); + var bufferState = getInternalArrayBufferState(buffer); + var bufferLength = bufferState.byteLength; + var offset = toIntegerOrInfinity(byteOffset); + if (offset < 0 || offset > bufferLength) throw new RangeError('Wrong offset'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw new RangeError(WRONG_LENGTH); + setInternalState(this, { + type: DATA_VIEW, + buffer: buffer, + byteLength: byteLength, + byteOffset: offset, + bytes: bufferState.bytes + }); + if (!DESCRIPTORS) { + this.buffer = buffer; + this.byteLength = byteLength; + this.byteOffset = offset; + } + }; + + DataViewPrototype = $DataView[PROTOTYPE]; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, 'byteLength', getInternalArrayBufferState); + addGetter($DataView, 'buffer', getInternalDataViewState); + addGetter($DataView, 'byteLength', getInternalDataViewState); + addGetter($DataView, 'byteOffset', getInternalDataViewState); + } + + defineBuiltIns(DataViewPrototype, { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packInt8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false); + } + }); +} else { + var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER; + /* eslint-disable no-new -- required for testing */ + if (!fails(function () { + NativeArrayBuffer(1); + }) || !fails(function () { + new NativeArrayBuffer(-1); + }) || fails(function () { + new NativeArrayBuffer(); + new NativeArrayBuffer(1.5); + new NativeArrayBuffer(NaN); + return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; + })) { + /* eslint-enable no-new -- required for testing */ + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, ArrayBufferPrototype); + return inheritIfRequired(new NativeArrayBuffer(toIndex(length)), this, $ArrayBuffer); + }; + + $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype; + + ArrayBufferPrototype.constructor = $ArrayBuffer; + + copyConstructorProperties($ArrayBuffer, NativeArrayBuffer); + } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { + createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER); + } + + // WebKit bug - the same parent prototype for typed arrays and data view + if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) { + setPrototypeOf(DataViewPrototype, ObjectPrototype); + } + + // iOS Safari 7.x bug + var testView = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = uncurryThis(DataViewPrototype.setInt8); + testView.setInt8(0, 2147483648); + testView.setInt8(1, 2147483649); + if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns(DataViewPrototype, { + setInt8: function setInt8(byteOffset, value) { + $setInt8(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8(this, byteOffset, value << 24 >> 24); + } + }, { unsafe: true }); +} + +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); + +module.exports = { + ArrayBuffer: $ArrayBuffer, + DataView: $DataView +}; + +},{"../internals/an-instance":113,"../internals/array-buffer-basic-detection":115,"../internals/array-fill":120,"../internals/array-slice":131,"../internals/copy-constructor-properties":141,"../internals/create-non-enumerable-property":145,"../internals/define-built-in-accessor":148,"../internals/define-built-ins":150,"../internals/descriptors":153,"../internals/fails":171,"../internals/function-name":178,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/ieee754":194,"../internals/inherit-if-required":196,"../internals/internal-state":199,"../internals/math-fround":222,"../internals/object-get-prototype-of":236,"../internals/object-set-prototype-of":242,"../internals/set-to-string-tag":266,"../internals/to-index":281,"../internals/to-integer-or-infinity":283,"../internals/to-length":284}],119:[function(require,module,exports){ +'use strict'; +var toObject = require('../internals/to-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var deletePropertyOrThrow = require('../internals/delete-property-or-throw'); + +var min = Math.min; + +// `Array.prototype.copyWithin` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.copywithin +// eslint-disable-next-line es/no-array-prototype-copywithin -- safe +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = lengthOfArrayLike(O); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else deletePropertyOrThrow(O, to); + to += inc; + from += inc; + } return O; +}; + +},{"../internals/delete-property-or-throw":152,"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-object":285}],120:[function(require,module,exports){ +'use strict'; +var toObject = require('../internals/to-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); + +// `Array.prototype.fill` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.fill +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = lengthOfArrayLike(O); + var argumentsLength = arguments.length; + var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length); + var end = argumentsLength > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; + +},{"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-object":285}],121:[function(require,module,exports){ +'use strict'; +var $forEach = require('../internals/array-iteration').forEach; +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); + +var STRICT_METHOD = arrayMethodIsStrict('forEach'); + +// `Array.prototype.forEach` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.foreach +module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); +// eslint-disable-next-line es/no-array-prototype-foreach -- safe +} : [].forEach; + +},{"../internals/array-iteration":125,"../internals/array-method-is-strict":128}],122:[function(require,module,exports){ +'use strict'; +var lengthOfArrayLike = require('../internals/length-of-array-like'); + +module.exports = function (Constructor, list, $length) { + var index = 0; + var length = arguments.length > 2 ? $length : lengthOfArrayLike(list); + var result = new Constructor(length); + while (length > index) result[index] = list[index++]; + return result; +}; + +},{"../internals/length-of-array-like":219}],123:[function(require,module,exports){ +'use strict'; +var bind = require('../internals/function-bind-context'); +var call = require('../internals/function-call'); +var toObject = require('../internals/to-object'); +var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var isConstructor = require('../internals/is-constructor'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var createProperty = require('../internals/create-property'); +var getIterator = require('../internals/get-iterator'); +var getIteratorMethod = require('../internals/get-iterator-method'); + +var $Array = Array; + +// `Array.from` method implementation +// https://tc39.es/ecma262/#sec-array.from +module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var IS_CONSTRUCTOR = isConstructor(this); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined); + var iteratorMethod = getIteratorMethod(O); + var index = 0; + var length, result, step, iterator, next, value; + // if the target is not iterable or it's an array with the default iterator - use a simple case + if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = getIterator(O, iteratorMethod); + next = iterator.next; + result = IS_CONSTRUCTOR ? new this() : []; + for (;!(step = call(next, iterator)).done; index++) { + value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; + createProperty(result, index, value); + } + } else { + length = lengthOfArrayLike(O); + result = IS_CONSTRUCTOR ? new this(length) : $Array(length); + for (;length > index; index++) { + value = mapping ? mapfn(O[index], index) : O[index]; + createProperty(result, index, value); + } + } + result.length = index; + return result; +}; + +},{"../internals/call-with-safe-iteration-closing":135,"../internals/create-property":147,"../internals/function-bind-context":175,"../internals/function-call":177,"../internals/get-iterator":184,"../internals/get-iterator-method":183,"../internals/is-array-iterator-method":200,"../internals/is-constructor":204,"../internals/length-of-array-like":219,"../internals/to-object":285}],124:[function(require,module,exports){ +'use strict'; +var toIndexedObject = require('../internals/to-indexed-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); + +// `Array.prototype.{ indexOf, includes }` methods implementation +var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = lengthOfArrayLike(O); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare -- NaN check + if (IS_INCLUDES && el !== el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare -- NaN check + if (value !== value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +module.exports = { + // `Array.prototype.includes` method + // https://tc39.es/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.es/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) +}; + +},{"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-indexed-object":282}],125:[function(require,module,exports){ +'use strict'; +var bind = require('../internals/function-bind-context'); +var uncurryThis = require('../internals/function-uncurry-this'); +var IndexedObject = require('../internals/indexed-object'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var arraySpeciesCreate = require('../internals/array-species-create'); + +var push = uncurryThis([].push); + +// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation +var createMethod = function (TYPE) { + var IS_MAP = TYPE === 1; + var IS_FILTER = TYPE === 2; + var IS_SOME = TYPE === 3; + var IS_EVERY = TYPE === 4; + var IS_FIND_INDEX = TYPE === 6; + var IS_FILTER_REJECT = TYPE === 7; + var NO_HOLES = TYPE === 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = IndexedObject(O); + var length = lengthOfArrayLike(self); + var boundFunction = bind(callbackfn, that); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined; + var value, result; + for (;length > index; index++) if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) switch (TYPE) { + case 3: return true; // some + case 5: return value; // find + case 6: return index; // findIndex + case 2: push(target, value); // filter + } else switch (TYPE) { + case 4: return false; // every + case 7: push(target, value); // filterReject + } + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; + }; +}; + +module.exports = { + // `Array.prototype.forEach` method + // https://tc39.es/ecma262/#sec-array.prototype.foreach + forEach: createMethod(0), + // `Array.prototype.map` method + // https://tc39.es/ecma262/#sec-array.prototype.map + map: createMethod(1), + // `Array.prototype.filter` method + // https://tc39.es/ecma262/#sec-array.prototype.filter + filter: createMethod(2), + // `Array.prototype.some` method + // https://tc39.es/ecma262/#sec-array.prototype.some + some: createMethod(3), + // `Array.prototype.every` method + // https://tc39.es/ecma262/#sec-array.prototype.every + every: createMethod(4), + // `Array.prototype.find` method + // https://tc39.es/ecma262/#sec-array.prototype.find + find: createMethod(5), + // `Array.prototype.findIndex` method + // https://tc39.es/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod(6), + // `Array.prototype.filterReject` method + // https://github.com/tc39/proposal-array-filtering + filterReject: createMethod(7) +}; + +},{"../internals/array-species-create":134,"../internals/function-bind-context":175,"../internals/function-uncurry-this":181,"../internals/indexed-object":195,"../internals/length-of-array-like":219,"../internals/to-object":285}],126:[function(require,module,exports){ +'use strict'; +/* eslint-disable es/no-array-prototype-lastindexof -- safe */ +var apply = require('../internals/function-apply'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); + +var min = Math.min; +var $lastIndexOf = [].lastIndexOf; +var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0; +var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf'); +var FORCED = NEGATIVE_ZERO || !STRICT_METHOD; + +// `Array.prototype.lastIndexOf` method implementation +// https://tc39.es/ecma262/#sec-array.prototype.lastindexof +module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0; + var O = toIndexedObject(this); + var length = lengthOfArrayLike(O); + var index = length - 1; + if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0; + return -1; +} : $lastIndexOf; + +},{"../internals/array-method-is-strict":128,"../internals/function-apply":174,"../internals/length-of-array-like":219,"../internals/to-indexed-object":282,"../internals/to-integer-or-infinity":283}],127:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var V8_VERSION = require('../internals/engine-v8-version'); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; + +},{"../internals/engine-v8-version":167,"../internals/fails":171,"../internals/well-known-symbol":306}],128:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); + +module.exports = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call -- required for testing + method.call(null, argument || function () { return 1; }, 1); + }); +}; + +},{"../internals/fails":171}],129:[function(require,module,exports){ +'use strict'; +var aCallable = require('../internals/a-callable'); +var toObject = require('../internals/to-object'); +var IndexedObject = require('../internals/indexed-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); + +var $TypeError = TypeError; + +// `Array.prototype.{ reduce, reduceRight }` methods implementation +var createMethod = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + var O = toObject(that); + var self = IndexedObject(O); + var length = lengthOfArrayLike(O); + aCallable(callbackfn); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw new $TypeError('Reduce of empty array with no initial value'); + } + } + for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; +}; + +module.exports = { + // `Array.prototype.reduce` method + // https://tc39.es/ecma262/#sec-array.prototype.reduce + left: createMethod(false), + // `Array.prototype.reduceRight` method + // https://tc39.es/ecma262/#sec-array.prototype.reduceright + right: createMethod(true) +}; + +},{"../internals/a-callable":108,"../internals/indexed-object":195,"../internals/length-of-array-like":219,"../internals/to-object":285}],130:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var isArray = require('../internals/is-array'); + +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// Safari < 13 does not throw an error in this case +var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () { + // makes no sense without proper strict mode support + if (this !== undefined) return true; + try { + // eslint-disable-next-line es/no-object-defineproperty -- safe + Object.defineProperty([], 'length', { writable: false }).length = 1; + } catch (error) { + return error instanceof TypeError; + } +}(); + +module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { + if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) { + throw new $TypeError('Cannot set read only .length'); + } return O.length = length; +} : function (O, length) { + return O.length = length; +}; + +},{"../internals/descriptors":153,"../internals/is-array":201}],131:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); + +module.exports = uncurryThis([].slice); + +},{"../internals/function-uncurry-this":181}],132:[function(require,module,exports){ +'use strict'; +var arraySlice = require('../internals/array-slice'); + +var floor = Math.floor; + +var sort = function (array, comparefn) { + var length = array.length; + + if (length < 8) { + // insertion sort + var i = 1; + var element, j; + + while (i < length) { + j = i; + element = array[i]; + while (j && comparefn(array[j - 1], element) > 0) { + array[j] = array[--j]; + } + if (j !== i++) array[j] = element; + } + } else { + // merge sort + var middle = floor(length / 2); + var left = sort(arraySlice(array, 0, middle), comparefn); + var right = sort(arraySlice(array, middle), comparefn); + var llength = left.length; + var rlength = right.length; + var lindex = 0; + var rindex = 0; + + while (lindex < llength || rindex < rlength) { + array[lindex + rindex] = (lindex < llength && rindex < rlength) + ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] + : lindex < llength ? left[lindex++] : right[rindex++]; + } + } + + return array; +}; + +module.exports = sort; + +},{"../internals/array-slice":131}],133:[function(require,module,exports){ +'use strict'; +var isArray = require('../internals/is-array'); +var isConstructor = require('../internals/is-constructor'); +var isObject = require('../internals/is-object'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); +var $Array = Array; + +// a part of `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return C === undefined ? $Array : C; +}; + +},{"../internals/is-array":201,"../internals/is-constructor":204,"../internals/is-object":208,"../internals/well-known-symbol":306}],134:[function(require,module,exports){ +'use strict'; +var arraySpeciesConstructor = require('../internals/array-species-constructor'); + +// `ArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length); +}; + +},{"../internals/array-species-constructor":133}],135:[function(require,module,exports){ +'use strict'; +var anObject = require('../internals/an-object'); +var iteratorClose = require('../internals/iterator-close'); + +// call something on iterator step with safe closing on error +module.exports = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + } catch (error) { + iteratorClose(iterator, 'throw', error); + } +}; + +},{"../internals/an-object":114,"../internals/iterator-close":214}],136:[function(require,module,exports){ +'use strict'; +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); +var SAFE_CLOSING = false; + +try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { done: !!called++ }; + }, + 'return': function () { + SAFE_CLOSING = true; + } + }; + iteratorWithReturn[ITERATOR] = function () { + return this; + }; + // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing + Array.from(iteratorWithReturn, function () { throw 2; }); +} catch (error) { /* empty */ } + +module.exports = function (exec, SKIP_CLOSING) { + try { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + } catch (error) { return false; } // workaround of old WebKit + `eval` bug + var ITERATION_SUPPORT = false; + try { + var object = {}; + object[ITERATOR] = function () { + return { + next: function () { + return { done: ITERATION_SUPPORT = true }; + } + }; + }; + exec(object); + } catch (error) { /* empty */ } + return ITERATION_SUPPORT; +}; + +},{"../internals/well-known-symbol":306}],137:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); + +var toString = uncurryThis({}.toString); +var stringSlice = uncurryThis(''.slice); + +module.exports = function (it) { + return stringSlice(toString(it), 8, -1); +}; + +},{"../internals/function-uncurry-this":181}],138:[function(require,module,exports){ +'use strict'; +var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); +var isCallable = require('../internals/is-callable'); +var classofRaw = require('../internals/classof-raw'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var $Object = Object; + +// ES3 wrong here +var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { /* empty */ } +}; + +// getting tag from ES6+ `Object.prototype.toString` +module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { + var O, tag, result; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag + // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) + // ES3 arguments fallback + : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; +}; + +},{"../internals/classof-raw":137,"../internals/is-callable":203,"../internals/to-string-tag-support":290,"../internals/well-known-symbol":306}],139:[function(require,module,exports){ +'use strict'; +var create = require('../internals/object-create'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var defineBuiltIns = require('../internals/define-built-ins'); +var bind = require('../internals/function-bind-context'); +var anInstance = require('../internals/an-instance'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var iterate = require('../internals/iterate'); +var defineIterator = require('../internals/iterator-define'); +var createIterResultObject = require('../internals/create-iter-result-object'); +var setSpecies = require('../internals/set-species'); +var DESCRIPTORS = require('../internals/descriptors'); +var fastKey = require('../internals/internal-metadata').fastKey; +var InternalStateModule = require('../internals/internal-state'); + +var setInternalState = InternalStateModule.set; +var internalStateGetterFor = InternalStateModule.getterFor; + +module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var Constructor = wrapper(function (that, iterable) { + anInstance(that, Prototype); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + index: create(null), + first: undefined, + last: undefined, + size: 0 + }); + if (!DESCRIPTORS) that.size = 0; + if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); + }); + + var Prototype = Constructor.prototype; + + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + + var define = function (that, key, value) { + var state = getInternalState(that); + var entry = getEntry(that, key); + var previous, index; + // change existing entry + if (entry) { + entry.value = value; + // create new entry + } else { + state.last = entry = { + index: index = fastKey(key, true), + key: key, + value: value, + previous: previous = state.last, + next: undefined, + removed: false + }; + if (!state.first) state.first = entry; + if (previous) previous.next = entry; + if (DESCRIPTORS) state.size++; + else that.size++; + // add to index + if (index !== 'F') state.index[index] = entry; + } return that; + }; + + var getEntry = function (that, key) { + var state = getInternalState(that); + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return state.index[index]; + // frozen object case + for (entry = state.first; entry; entry = entry.next) { + if (entry.key === key) return entry; + } + }; + + defineBuiltIns(Prototype, { + // `{ Map, Set }.prototype.clear()` methods + // https://tc39.es/ecma262/#sec-map.prototype.clear + // https://tc39.es/ecma262/#sec-set.prototype.clear + clear: function clear() { + var that = this; + var state = getInternalState(that); + var entry = state.first; + while (entry) { + entry.removed = true; + if (entry.previous) entry.previous = entry.previous.next = undefined; + entry = entry.next; + } + state.first = state.last = undefined; + state.index = create(null); + if (DESCRIPTORS) state.size = 0; + else that.size = 0; + }, + // `{ Map, Set }.prototype.delete(key)` methods + // https://tc39.es/ecma262/#sec-map.prototype.delete + // https://tc39.es/ecma262/#sec-set.prototype.delete + 'delete': function (key) { + var that = this; + var state = getInternalState(that); + var entry = getEntry(that, key); + if (entry) { + var next = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) prev.next = next; + if (next) next.previous = prev; + if (state.first === entry) state.first = next; + if (state.last === entry) state.last = prev; + if (DESCRIPTORS) state.size--; + else that.size--; + } return !!entry; + }, + // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods + // https://tc39.es/ecma262/#sec-map.prototype.foreach + // https://tc39.es/ecma262/#sec-set.prototype.foreach + forEach: function forEach(callbackfn /* , that = undefined */) { + var state = getInternalState(this); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); + var entry; + while (entry = entry ? entry.next : state.first) { + boundFunction(entry.value, entry.key, this); + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + } + }, + // `{ Map, Set}.prototype.has(key)` methods + // https://tc39.es/ecma262/#sec-map.prototype.has + // https://tc39.es/ecma262/#sec-set.prototype.has + has: function has(key) { + return !!getEntry(this, key); + } + }); + + defineBuiltIns(Prototype, IS_MAP ? { + // `Map.prototype.get(key)` method + // https://tc39.es/ecma262/#sec-map.prototype.get + get: function get(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + // `Map.prototype.set(key, value)` method + // https://tc39.es/ecma262/#sec-map.prototype.set + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + } + } : { + // `Set.prototype.add(value)` method + // https://tc39.es/ecma262/#sec-set.prototype.add + add: function add(value) { + return define(this, value = value === 0 ? 0 : value, value); + } + }); + if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', { + configurable: true, + get: function () { + return getInternalState(this).size; + } + }); + return Constructor; + }, + setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; + var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); + var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); + // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods + // https://tc39.es/ecma262/#sec-map.prototype.entries + // https://tc39.es/ecma262/#sec-map.prototype.keys + // https://tc39.es/ecma262/#sec-map.prototype.values + // https://tc39.es/ecma262/#sec-map.prototype-@@iterator + // https://tc39.es/ecma262/#sec-set.prototype.entries + // https://tc39.es/ecma262/#sec-set.prototype.keys + // https://tc39.es/ecma262/#sec-set.prototype.values + // https://tc39.es/ecma262/#sec-set.prototype-@@iterator + defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { + setInternalState(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: undefined + }); + }, function () { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + // get next entry + if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { + // or finish the iteration + state.target = undefined; + return createIterResultObject(undefined, true); + } + // return step by kind + if (kind === 'keys') return createIterResultObject(entry.key, false); + if (kind === 'values') return createIterResultObject(entry.value, false); + return createIterResultObject([entry.key, entry.value], false); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // `{ Map, Set }.prototype[@@species]` accessors + // https://tc39.es/ecma262/#sec-get-map-@@species + // https://tc39.es/ecma262/#sec-get-set-@@species + setSpecies(CONSTRUCTOR_NAME); + } +}; + +},{"../internals/an-instance":113,"../internals/create-iter-result-object":144,"../internals/define-built-in-accessor":148,"../internals/define-built-ins":150,"../internals/descriptors":153,"../internals/function-bind-context":175,"../internals/internal-metadata":198,"../internals/internal-state":199,"../internals/is-null-or-undefined":207,"../internals/iterate":213,"../internals/iterator-define":216,"../internals/object-create":229,"../internals/set-species":265}],140:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var isForced = require('../internals/is-forced'); +var defineBuiltIn = require('../internals/define-built-in'); +var InternalMetadataModule = require('../internals/internal-metadata'); +var iterate = require('../internals/iterate'); +var anInstance = require('../internals/an-instance'); +var isCallable = require('../internals/is-callable'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var isObject = require('../internals/is-object'); +var fails = require('../internals/fails'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var setToStringTag = require('../internals/set-to-string-tag'); +var inheritIfRequired = require('../internals/inherit-if-required'); + +module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; + var ADDER = IS_MAP ? 'set' : 'add'; + var NativeConstructor = global[CONSTRUCTOR_NAME]; + var NativePrototype = NativeConstructor && NativeConstructor.prototype; + var Constructor = NativeConstructor; + var exported = {}; + + var fixMethod = function (KEY) { + var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]); + defineBuiltIn(NativePrototype, KEY, + KEY === 'add' ? function add(value) { + uncurriedNativeMethod(this, value === 0 ? 0 : value); + return this; + } : KEY === 'delete' ? function (key) { + return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); + } : KEY === 'get' ? function get(key) { + return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); + } : KEY === 'has' ? function has(key) { + return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); + } : function set(key, value) { + uncurriedNativeMethod(this, key === 0 ? 0 : key, value); + return this; + } + ); + }; + + var REPLACE = isForced( + CONSTRUCTOR_NAME, + !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () { + new NativeConstructor().entries().next(); + })) + ); + + if (REPLACE) { + // create collection constructor + Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); + InternalMetadataModule.enable(); + } else if (isForced(CONSTRUCTOR_NAME, true)) { + var instance = new Constructor(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + // eslint-disable-next-line no-new -- required for testing + var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new NativeConstructor(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + + if (!ACCEPT_ITERABLES) { + Constructor = wrapper(function (dummy, iterable) { + anInstance(dummy, NativePrototype); + var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); + if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); + return that; + }); + Constructor.prototype = NativePrototype; + NativePrototype.constructor = Constructor; + } + + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + + // weak collections should not contains .clear method + if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; + } + + exported[CONSTRUCTOR_NAME] = Constructor; + $({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); + + setToStringTag(Constructor, CONSTRUCTOR_NAME); + + if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); + + return Constructor; +}; + +},{"../internals/an-instance":113,"../internals/check-correctness-of-iteration":136,"../internals/define-built-in":149,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/inherit-if-required":196,"../internals/internal-metadata":198,"../internals/is-callable":203,"../internals/is-forced":205,"../internals/is-null-or-undefined":207,"../internals/is-object":208,"../internals/iterate":213,"../internals/set-to-string-tag":266}],141:[function(require,module,exports){ +'use strict'; +var hasOwn = require('../internals/has-own-property'); +var ownKeys = require('../internals/own-keys'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var definePropertyModule = require('../internals/object-define-property'); + +module.exports = function (target, source, exceptions) { + var keys = ownKeys(source); + var defineProperty = definePropertyModule.f; + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { + defineProperty(target, key, getOwnPropertyDescriptor(source, key)); + } + } +}; + +},{"../internals/has-own-property":189,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/own-keys":246}],142:[function(require,module,exports){ +'use strict'; +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var MATCH = wellKnownSymbol('match'); + +module.exports = function (METHOD_NAME) { + var regexp = /./; + try { + '/./'[METHOD_NAME](regexp); + } catch (error1) { + try { + regexp[MATCH] = false; + return '/./'[METHOD_NAME](regexp); + } catch (error2) { /* empty */ } + } return false; +}; + +},{"../internals/well-known-symbol":306}],143:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); + +module.exports = !fails(function () { + function F() { /* empty */ } + F.prototype.constructor = null; + // eslint-disable-next-line es/no-object-getprototypeof -- required for testing + return Object.getPrototypeOf(new F()) !== F.prototype; +}); + +},{"../internals/fails":171}],144:[function(require,module,exports){ +'use strict'; +// `CreateIterResultObject` abstract operation +// https://tc39.es/ecma262/#sec-createiterresultobject +module.exports = function (value, done) { + return { value: value, done: done }; +}; + +},{}],145:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var definePropertyModule = require('../internals/object-define-property'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); + +module.exports = DESCRIPTORS ? function (object, key, value) { + return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + +},{"../internals/create-property-descriptor":146,"../internals/descriptors":153,"../internals/object-define-property":231}],146:[function(require,module,exports){ +'use strict'; +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + +},{}],147:[function(require,module,exports){ +'use strict'; +var toPropertyKey = require('../internals/to-property-key'); +var definePropertyModule = require('../internals/object-define-property'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); + +module.exports = function (object, key, value) { + var propertyKey = toPropertyKey(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; +}; + +},{"../internals/create-property-descriptor":146,"../internals/object-define-property":231,"../internals/to-property-key":289}],148:[function(require,module,exports){ +'use strict'; +var makeBuiltIn = require('../internals/make-built-in'); +var defineProperty = require('../internals/object-define-property'); + +module.exports = function (target, name, descriptor) { + if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); + if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); + return defineProperty.f(target, name, descriptor); +}; + +},{"../internals/make-built-in":220,"../internals/object-define-property":231}],149:[function(require,module,exports){ +'use strict'; +var isCallable = require('../internals/is-callable'); +var definePropertyModule = require('../internals/object-define-property'); +var makeBuiltIn = require('../internals/make-built-in'); +var defineGlobalProperty = require('../internals/define-global-property'); + +module.exports = function (O, key, value, options) { + if (!options) options = {}; + var simple = options.enumerable; + var name = options.name !== undefined ? options.name : key; + if (isCallable(value)) makeBuiltIn(value, name, options); + if (options.global) { + if (simple) O[key] = value; + else defineGlobalProperty(key, value); + } else { + try { + if (!options.unsafe) delete O[key]; + else if (O[key]) simple = true; + } catch (error) { /* empty */ } + if (simple) O[key] = value; + else definePropertyModule.f(O, key, { + value: value, + enumerable: false, + configurable: !options.nonConfigurable, + writable: !options.nonWritable + }); + } return O; +}; + +},{"../internals/define-global-property":151,"../internals/is-callable":203,"../internals/make-built-in":220,"../internals/object-define-property":231}],150:[function(require,module,exports){ +'use strict'; +var defineBuiltIn = require('../internals/define-built-in'); + +module.exports = function (target, src, options) { + for (var key in src) defineBuiltIn(target, key, src[key], options); + return target; +}; + +},{"../internals/define-built-in":149}],151:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); + +// eslint-disable-next-line es/no-object-defineproperty -- safe +var defineProperty = Object.defineProperty; + +module.exports = function (key, value) { + try { + defineProperty(global, key, { value: value, configurable: true, writable: true }); + } catch (error) { + global[key] = value; + } return value; +}; + +},{"../internals/global":188}],152:[function(require,module,exports){ +'use strict'; +var tryToString = require('../internals/try-to-string'); + +var $TypeError = TypeError; + +module.exports = function (O, P) { + if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O)); +}; + +},{"../internals/try-to-string":293}],153:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); + +// Detect IE8's incomplete defineProperty implementation +module.exports = !fails(function () { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; +}); + +},{"../internals/fails":171}],154:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var isObject = require('../internals/is-object'); + +var document = global.document; +// typeof document.createElement is 'object' in old IE +var EXISTS = isObject(document) && isObject(document.createElement); + +module.exports = function (it) { + return EXISTS ? document.createElement(it) : {}; +}; + +},{"../internals/global":188,"../internals/is-object":208}],155:[function(require,module,exports){ +'use strict'; +var $TypeError = TypeError; +var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991 + +module.exports = function (it) { + if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded'); + return it; +}; + +},{}],156:[function(require,module,exports){ +'use strict'; +// iterable DOM collections +// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods +module.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0 +}; + +},{}],157:[function(require,module,exports){ +'use strict'; +// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` +var documentCreateElement = require('../internals/document-create-element'); + +var classList = documentCreateElement('span').classList; +var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype; + +module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype; + +},{"../internals/document-create-element":154}],158:[function(require,module,exports){ +'use strict'; +var userAgent = require('../internals/engine-user-agent'); + +var firefox = userAgent.match(/firefox\/(\d+)/i); + +module.exports = !!firefox && +firefox[1]; + +},{"../internals/engine-user-agent":166}],159:[function(require,module,exports){ +'use strict'; +var IS_DENO = require('../internals/engine-is-deno'); +var IS_NODE = require('../internals/engine-is-node'); + +module.exports = !IS_DENO && !IS_NODE + && typeof window == 'object' + && typeof document == 'object'; + +},{"../internals/engine-is-deno":160,"../internals/engine-is-node":164}],160:[function(require,module,exports){ +'use strict'; +/* global Deno -- Deno case */ +module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object'; + +},{}],161:[function(require,module,exports){ +'use strict'; +var UA = require('../internals/engine-user-agent'); + +module.exports = /MSIE|Trident/.test(UA); + +},{"../internals/engine-user-agent":166}],162:[function(require,module,exports){ +'use strict'; +var userAgent = require('../internals/engine-user-agent'); + +module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined'; + +},{"../internals/engine-user-agent":166}],163:[function(require,module,exports){ +'use strict'; +var userAgent = require('../internals/engine-user-agent'); + +// eslint-disable-next-line redos/no-vulnerable -- safe +module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent); + +},{"../internals/engine-user-agent":166}],164:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var classof = require('../internals/classof-raw'); + +module.exports = classof(global.process) === 'process'; + +},{"../internals/classof-raw":137,"../internals/global":188}],165:[function(require,module,exports){ +'use strict'; +var userAgent = require('../internals/engine-user-agent'); + +module.exports = /web0s(?!.*chrome)/i.test(userAgent); + +},{"../internals/engine-user-agent":166}],166:[function(require,module,exports){ +'use strict'; +module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; + +},{}],167:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var userAgent = require('../internals/engine-user-agent'); + +var process = global.process; +var Deno = global.Deno; +var versions = process && process.versions || Deno && Deno.version; +var v8 = versions && versions.v8; +var match, version; + +if (v8) { + match = v8.split('.'); + // in old Chrome, versions of V8 isn't V8 = Chrome / 10 + // but their correct versions are not interesting for us + version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); +} + +// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` +// so check `userAgent` even if `.v8` exists, but 0 +if (!version && userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = +match[1]; + } +} + +module.exports = version; + +},{"../internals/engine-user-agent":166,"../internals/global":188}],168:[function(require,module,exports){ +'use strict'; +var userAgent = require('../internals/engine-user-agent'); + +var webkit = userAgent.match(/AppleWebKit\/(\d+)\./); + +module.exports = !!webkit && +webkit[1]; + +},{"../internals/engine-user-agent":166}],169:[function(require,module,exports){ +'use strict'; +// IE8- don't enum bug keys +module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' +]; + +},{}],170:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltIn = require('../internals/define-built-in'); +var defineGlobalProperty = require('../internals/define-global-property'); +var copyConstructorProperties = require('../internals/copy-constructor-properties'); +var isForced = require('../internals/is-forced'); + +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.dontCallGetSet - prevent calling a getter on target + options.name - the .name of the function if it does not match the key +*/ +module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || defineGlobalProperty(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.dontCallGetSet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty == typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } + // add a flag to not completely full polyfills + if (options.sham || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(sourceProperty, 'sham', true); + } + defineBuiltIn(target, key, sourceProperty, options); + } +}; + +},{"../internals/copy-constructor-properties":141,"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/define-global-property":151,"../internals/global":188,"../internals/is-forced":205,"../internals/object-get-own-property-descriptor":232}],171:[function(require,module,exports){ +'use strict'; +module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } +}; + +},{}],172:[function(require,module,exports){ +'use strict'; +// TODO: Remove from `core-js@4` since it's moved to entry points +require('../modules/es.regexp.exec'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); +var defineBuiltIn = require('../internals/define-built-in'); +var regexpExec = require('../internals/regexp-exec'); +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); + +var SPECIES = wellKnownSymbol('species'); +var RegExpPrototype = RegExp.prototype; + +module.exports = function (KEY, exec, FORCED, SHAM) { + var SYMBOL = wellKnownSymbol(KEY); + + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) !== 7; + }); + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + + if (KEY === 'split') { + // We can't use real regex here since it causes deoptimization + // and serious performance degradation in V8 + // https://github.com/zloirock/core-js/issues/306 + re = {}; + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { return re; }; + re.flags = ''; + re[SYMBOL] = /./[SYMBOL]; + } + + re.exec = function () { + execCalled = true; + return null; + }; + + re[SYMBOL](''); + return !execCalled; + }); + + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + FORCED + ) { + var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]); + var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { + var uncurriedNativeMethod = uncurryThis(nativeMethod); + var $exec = regexp.exec; + if ($exec === regexpExec || $exec === RegExpPrototype.exec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) }; + } + return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) }; + } + return { done: false }; + }); + + defineBuiltIn(String.prototype, KEY, methods[0]); + defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]); + } + + if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true); +}; + +},{"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/fails":171,"../internals/function-uncurry-this-clause":180,"../internals/regexp-exec":256,"../internals/well-known-symbol":306,"../modules/es.regexp.exec":338}],173:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); + +module.exports = !fails(function () { + // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing + return Object.isExtensible(Object.preventExtensions({})); +}); + +},{"../internals/fails":171}],174:[function(require,module,exports){ +'use strict'; +var NATIVE_BIND = require('../internals/function-bind-native'); + +var FunctionPrototype = Function.prototype; +var apply = FunctionPrototype.apply; +var call = FunctionPrototype.call; + +// eslint-disable-next-line es/no-reflect -- safe +module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { + return call.apply(apply, arguments); +}); + +},{"../internals/function-bind-native":176}],175:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this-clause'); +var aCallable = require('../internals/a-callable'); +var NATIVE_BIND = require('../internals/function-bind-native'); + +var bind = uncurryThis(uncurryThis.bind); + +// optional / simple context binding +module.exports = function (fn, that) { + aCallable(fn); + return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + +},{"../internals/a-callable":108,"../internals/function-bind-native":176,"../internals/function-uncurry-this-clause":180}],176:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); + +module.exports = !fails(function () { + // eslint-disable-next-line es/no-function-prototype-bind -- safe + var test = (function () { /* empty */ }).bind(); + // eslint-disable-next-line no-prototype-builtins -- safe + return typeof test != 'function' || test.hasOwnProperty('prototype'); +}); + +},{"../internals/fails":171}],177:[function(require,module,exports){ +'use strict'; +var NATIVE_BIND = require('../internals/function-bind-native'); + +var call = Function.prototype.call; + +module.exports = NATIVE_BIND ? call.bind(call) : function () { + return call.apply(call, arguments); +}; + +},{"../internals/function-bind-native":176}],178:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var hasOwn = require('../internals/has-own-property'); + +var FunctionPrototype = Function.prototype; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; + +var EXISTS = hasOwn(FunctionPrototype, 'name'); +// additional protection from minified / mangled / dropped function names +var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; +var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); + +module.exports = { + EXISTS: EXISTS, + PROPER: PROPER, + CONFIGURABLE: CONFIGURABLE +}; + +},{"../internals/descriptors":153,"../internals/has-own-property":189}],179:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var aCallable = require('../internals/a-callable'); + +module.exports = function (object, key, method) { + try { + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); + } catch (error) { /* empty */ } +}; + +},{"../internals/a-callable":108,"../internals/function-uncurry-this":181}],180:[function(require,module,exports){ +'use strict'; +var classofRaw = require('../internals/classof-raw'); +var uncurryThis = require('../internals/function-uncurry-this'); + +module.exports = function (fn) { + // Nashorn bug: + // https://github.com/zloirock/core-js/issues/1128 + // https://github.com/zloirock/core-js/issues/1130 + if (classofRaw(fn) === 'Function') return uncurryThis(fn); +}; + +},{"../internals/classof-raw":137,"../internals/function-uncurry-this":181}],181:[function(require,module,exports){ +'use strict'; +var NATIVE_BIND = require('../internals/function-bind-native'); + +var FunctionPrototype = Function.prototype; +var call = FunctionPrototype.call; +var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); + +module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { + return function () { + return call.apply(fn, arguments); + }; +}; + +},{"../internals/function-bind-native":176}],182:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var isCallable = require('../internals/is-callable'); + +var aFunction = function (argument) { + return isCallable(argument) ? argument : undefined; +}; + +module.exports = function (namespace, method) { + return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method]; +}; + +},{"../internals/global":188,"../internals/is-callable":203}],183:[function(require,module,exports){ +'use strict'; +var classof = require('../internals/classof'); +var getMethod = require('../internals/get-method'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var Iterators = require('../internals/iterators'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); + +module.exports = function (it) { + if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) + || getMethod(it, '@@iterator') + || Iterators[classof(it)]; +}; + +},{"../internals/classof":138,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/iterators":218,"../internals/well-known-symbol":306}],184:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var aCallable = require('../internals/a-callable'); +var anObject = require('../internals/an-object'); +var tryToString = require('../internals/try-to-string'); +var getIteratorMethod = require('../internals/get-iterator-method'); + +var $TypeError = TypeError; + +module.exports = function (argument, usingIterator) { + var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; + if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); + throw new $TypeError(tryToString(argument) + ' is not iterable'); +}; + +},{"../internals/a-callable":108,"../internals/an-object":114,"../internals/function-call":177,"../internals/get-iterator-method":183,"../internals/try-to-string":293}],185:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var isArray = require('../internals/is-array'); +var isCallable = require('../internals/is-callable'); +var classof = require('../internals/classof-raw'); +var toString = require('../internals/to-string'); + +var push = uncurryThis([].push); + +module.exports = function (replacer) { + if (isCallable(replacer)) return replacer; + if (!isArray(replacer)) return; + var rawLength = replacer.length; + var keys = []; + for (var i = 0; i < rawLength; i++) { + var element = replacer[i]; + if (typeof element == 'string') push(keys, element); + else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element)); + } + var keysLength = keys.length; + var root = true; + return function (key, value) { + if (root) { + root = false; + return value; + } + if (isArray(this)) return value; + for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value; + }; +}; + +},{"../internals/classof-raw":137,"../internals/function-uncurry-this":181,"../internals/is-array":201,"../internals/is-callable":203,"../internals/to-string":291}],186:[function(require,module,exports){ +'use strict'; +var aCallable = require('../internals/a-callable'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); + +// `GetMethod` abstract operation +// https://tc39.es/ecma262/#sec-getmethod +module.exports = function (V, P) { + var func = V[P]; + return isNullOrUndefined(func) ? undefined : aCallable(func); +}; + +},{"../internals/a-callable":108,"../internals/is-null-or-undefined":207}],187:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var toObject = require('../internals/to-object'); + +var floor = Math.floor; +var charAt = uncurryThis(''.charAt); +var replace = uncurryThis(''.replace); +var stringSlice = uncurryThis(''.slice); +// eslint-disable-next-line redos/no-vulnerable -- safe +var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; +var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g; + +// `GetSubstitution` abstract operation +// https://tc39.es/ecma262/#sec-getsubstitution +module.exports = function (matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return replace(replacement, symbols, function (match, ch) { + var capture; + switch (charAt(ch, 0)) { + case '$': return '$'; + case '&': return matched; + case '`': return stringSlice(str, 0, position); + case "'": return stringSlice(str, tailPos); + case '<': + capture = namedCaptures[stringSlice(ch, 1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1); + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? '' : capture; + }); +}; + +},{"../internals/function-uncurry-this":181,"../internals/to-object":285}],188:[function(require,module,exports){ +(function (global){(function (){ +'use strict'; +var check = function (it) { + return it && it.Math === Math && it; +}; + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +module.exports = + // eslint-disable-next-line es/no-global-this -- safe + check(typeof globalThis == 'object' && globalThis) || + check(typeof window == 'object' && window) || + // eslint-disable-next-line no-restricted-globals -- safe + check(typeof self == 'object' && self) || + check(typeof global == 'object' && global) || + check(typeof this == 'object' && this) || + // eslint-disable-next-line no-new-func -- fallback + (function () { return this; })() || Function('return this')(); + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],189:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var toObject = require('../internals/to-object'); + +var hasOwnProperty = uncurryThis({}.hasOwnProperty); + +// `HasOwnProperty` abstract operation +// https://tc39.es/ecma262/#sec-hasownproperty +// eslint-disable-next-line es/no-object-hasown -- safe +module.exports = Object.hasOwn || function hasOwn(it, key) { + return hasOwnProperty(toObject(it), key); +}; + +},{"../internals/function-uncurry-this":181,"../internals/to-object":285}],190:[function(require,module,exports){ +'use strict'; +module.exports = {}; + +},{}],191:[function(require,module,exports){ +'use strict'; +module.exports = function (a, b) { + try { + // eslint-disable-next-line no-console -- safe + arguments.length === 1 ? console.error(a) : console.error(a, b); + } catch (error) { /* empty */ } +}; + +},{}],192:[function(require,module,exports){ +'use strict'; +var getBuiltIn = require('../internals/get-built-in'); + +module.exports = getBuiltIn('document', 'documentElement'); + +},{"../internals/get-built-in":182}],193:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); +var createElement = require('../internals/document-create-element'); + +// Thanks to IE8 for its funny defineProperty +module.exports = !DESCRIPTORS && !fails(function () { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty(createElement('div'), 'a', { + get: function () { return 7; } + }).a !== 7; +}); + +},{"../internals/descriptors":153,"../internals/document-create-element":154,"../internals/fails":171}],194:[function(require,module,exports){ +'use strict'; +// IEEE754 conversions based on https://github.com/feross/ieee754 +var $Array = Array; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; + +var pack = function (number, mantissaLength, bytes) { + var buffer = $Array(bytes); + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0; + var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; + var index = 0; + var exponent, mantissa, c; + number = abs(number); + // eslint-disable-next-line no-self-compare -- NaN check + if (number !== number || number === Infinity) { + // eslint-disable-next-line no-self-compare -- NaN check + mantissa = number !== number ? 1 : 0; + exponent = eMax; + } else { + exponent = floor(log(number) / LN2); + c = pow(2, -exponent); + if (number * c < 1) { + exponent--; + c *= 2; + } + if (exponent + eBias >= 1) { + number += rt / c; + } else { + number += rt * pow(2, 1 - eBias); + } + if (number * c >= 2) { + exponent++; + c /= 2; + } + if (exponent + eBias >= eMax) { + mantissa = 0; + exponent = eMax; + } else if (exponent + eBias >= 1) { + mantissa = (number * c - 1) * pow(2, mantissaLength); + exponent += eBias; + } else { + mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength); + exponent = 0; + } + } + while (mantissaLength >= 8) { + buffer[index++] = mantissa & 255; + mantissa /= 256; + mantissaLength -= 8; + } + exponent = exponent << mantissaLength | mantissa; + exponentLength += mantissaLength; + while (exponentLength > 0) { + buffer[index++] = exponent & 255; + exponent /= 256; + exponentLength -= 8; + } + buffer[--index] |= sign * 128; + return buffer; +}; + +var unpack = function (buffer, mantissaLength) { + var bytes = buffer.length; + var exponentLength = bytes * 8 - mantissaLength - 1; + var eMax = (1 << exponentLength) - 1; + var eBias = eMax >> 1; + var nBits = exponentLength - 7; + var index = bytes - 1; + var sign = buffer[index--]; + var exponent = sign & 127; + var mantissa; + sign >>= 7; + while (nBits > 0) { + exponent = exponent * 256 + buffer[index--]; + nBits -= 8; + } + mantissa = exponent & (1 << -nBits) - 1; + exponent >>= -nBits; + nBits += mantissaLength; + while (nBits > 0) { + mantissa = mantissa * 256 + buffer[index--]; + nBits -= 8; + } + if (exponent === 0) { + exponent = 1 - eBias; + } else if (exponent === eMax) { + return mantissa ? NaN : sign ? -Infinity : Infinity; + } else { + mantissa += pow(2, mantissaLength); + exponent -= eBias; + } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength); +}; + +module.exports = { + pack: pack, + unpack: unpack +}; + +},{}],195:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var classof = require('../internals/classof-raw'); + +var $Object = Object; +var split = uncurryThis(''.split); + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins -- safe + return !$Object('z').propertyIsEnumerable(0); +}) ? function (it) { + return classof(it) === 'String' ? split(it, '') : $Object(it); +} : $Object; + +},{"../internals/classof-raw":137,"../internals/fails":171,"../internals/function-uncurry-this":181}],196:[function(require,module,exports){ +'use strict'; +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); + +// makes subclassing work correct for wrapped built-ins +module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + isCallable(NewTarget = dummy.constructor) && + NewTarget !== Wrapper && + isObject(NewTargetPrototype = NewTarget.prototype) && + NewTargetPrototype !== Wrapper.prototype + ) setPrototypeOf($this, NewTargetPrototype); + return $this; +}; + +},{"../internals/is-callable":203,"../internals/is-object":208,"../internals/object-set-prototype-of":242}],197:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var isCallable = require('../internals/is-callable'); +var store = require('../internals/shared-store'); + +var functionToString = uncurryThis(Function.toString); + +// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper +if (!isCallable(store.inspectSource)) { + store.inspectSource = function (it) { + return functionToString(it); + }; +} + +module.exports = store.inspectSource; + +},{"../internals/function-uncurry-this":181,"../internals/is-callable":203,"../internals/shared-store":268}],198:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var hiddenKeys = require('../internals/hidden-keys'); +var isObject = require('../internals/is-object'); +var hasOwn = require('../internals/has-own-property'); +var defineProperty = require('../internals/object-define-property').f; +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external'); +var isExtensible = require('../internals/object-is-extensible'); +var uid = require('../internals/uid'); +var FREEZING = require('../internals/freezing'); + +var REQUIRED = false; +var METADATA = uid('meta'); +var id = 0; + +var setMetadata = function (it) { + defineProperty(it, METADATA, { value: { + objectID: 'O' + id++, // object ID + weakData: {} // weak collections IDs + } }); +}; + +var fastKey = function (it, create) { + // return a primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!hasOwn(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMetadata(it); + // return object ID + } return it[METADATA].objectID; +}; + +var getWeakData = function (it, create) { + if (!hasOwn(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMetadata(it); + // return the store of weak collections IDs + } return it[METADATA].weakData; +}; + +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it); + return it; +}; + +var enable = function () { + meta.enable = function () { /* empty */ }; + REQUIRED = true; + var getOwnPropertyNames = getOwnPropertyNamesModule.f; + var splice = uncurryThis([].splice); + var test = {}; + test[METADATA] = 1; + + // prevent exposing of metadata key + if (getOwnPropertyNames(test).length) { + getOwnPropertyNamesModule.f = function (it) { + var result = getOwnPropertyNames(it); + for (var i = 0, length = result.length; i < length; i++) { + if (result[i] === METADATA) { + splice(result, i, 1); + break; + } + } return result; + }; + + $({ target: 'Object', stat: true, forced: true }, { + getOwnPropertyNames: getOwnPropertyNamesExternalModule.f + }); + } +}; + +var meta = module.exports = { + enable: enable, + fastKey: fastKey, + getWeakData: getWeakData, + onFreeze: onFreeze +}; + +hiddenKeys[METADATA] = true; + +},{"../internals/export":170,"../internals/freezing":173,"../internals/function-uncurry-this":181,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/is-object":208,"../internals/object-define-property":231,"../internals/object-get-own-property-names":234,"../internals/object-get-own-property-names-external":233,"../internals/object-is-extensible":237,"../internals/uid":299}],199:[function(require,module,exports){ +'use strict'; +var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection'); +var global = require('../internals/global'); +var isObject = require('../internals/is-object'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var hasOwn = require('../internals/has-own-property'); +var shared = require('../internals/shared-store'); +var sharedKey = require('../internals/shared-key'); +var hiddenKeys = require('../internals/hidden-keys'); + +var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; +var TypeError = global.TypeError; +var WeakMap = global.WeakMap; +var set, get, has; + +var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); +}; + +var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw new TypeError('Incompatible receiver, ' + TYPE + ' required'); + } return state; + }; +}; + +if (NATIVE_WEAK_MAP || shared.state) { + var store = shared.state || (shared.state = new WeakMap()); + /* eslint-disable no-self-assign -- prototype methods protection */ + store.get = store.get; + store.has = store.has; + store.set = store.set; + /* eslint-enable no-self-assign -- prototype methods protection */ + set = function (it, metadata) { + if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); + metadata.facade = it; + store.set(it, metadata); + return metadata; + }; + get = function (it) { + return store.get(it) || {}; + }; + has = function (it) { + return store.has(it); + }; +} else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); + metadata.facade = it; + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return hasOwn(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return hasOwn(it, STATE); + }; +} + +module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor +}; + +},{"../internals/create-non-enumerable-property":145,"../internals/global":188,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/is-object":208,"../internals/shared-key":267,"../internals/shared-store":268,"../internals/weak-map-basic-detection":303}],200:[function(require,module,exports){ +'use strict'; +var wellKnownSymbol = require('../internals/well-known-symbol'); +var Iterators = require('../internals/iterators'); + +var ITERATOR = wellKnownSymbol('iterator'); +var ArrayPrototype = Array.prototype; + +// check on default Array iterator +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); +}; + +},{"../internals/iterators":218,"../internals/well-known-symbol":306}],201:[function(require,module,exports){ +'use strict'; +var classof = require('../internals/classof-raw'); + +// `IsArray` abstract operation +// https://tc39.es/ecma262/#sec-isarray +// eslint-disable-next-line es/no-array-isarray -- safe +module.exports = Array.isArray || function isArray(argument) { + return classof(argument) === 'Array'; +}; + +},{"../internals/classof-raw":137}],202:[function(require,module,exports){ +'use strict'; +var classof = require('../internals/classof'); + +module.exports = function (it) { + var klass = classof(it); + return klass === 'BigInt64Array' || klass === 'BigUint64Array'; +}; + +},{"../internals/classof":138}],203:[function(require,module,exports){ +'use strict'; +// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot +var documentAll = typeof document == 'object' && document.all; + +// `IsCallable` abstract operation +// https://tc39.es/ecma262/#sec-iscallable +// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing +module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { + return typeof argument == 'function' || argument === documentAll; +} : function (argument) { + return typeof argument == 'function'; +}; + +},{}],204:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); +var classof = require('../internals/classof'); +var getBuiltIn = require('../internals/get-built-in'); +var inspectSource = require('../internals/inspect-source'); + +var noop = function () { /* empty */ }; +var empty = []; +var construct = getBuiltIn('Reflect', 'construct'); +var constructorRegExp = /^\s*(?:class|function)\b/; +var exec = uncurryThis(constructorRegExp.exec); +var INCORRECT_TO_STRING = !constructorRegExp.test(noop); + +var isConstructorModern = function isConstructor(argument) { + if (!isCallable(argument)) return false; + try { + construct(noop, empty, argument); + return true; + } catch (error) { + return false; + } +}; + +var isConstructorLegacy = function isConstructor(argument) { + if (!isCallable(argument)) return false; + switch (classof(argument)) { + case 'AsyncFunction': + case 'GeneratorFunction': + case 'AsyncGeneratorFunction': return false; + } + try { + // we can't check .prototype since constructors produced by .bind haven't it + // `Function#toString` throws on some built-it function in some legacy engines + // (for example, `DOMQuad` and similar in FF41-) + return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)); + } catch (error) { + return true; + } +}; + +isConstructorLegacy.sham = true; + +// `IsConstructor` abstract operation +// https://tc39.es/ecma262/#sec-isconstructor +module.exports = !construct || fails(function () { + var called; + return isConstructorModern(isConstructorModern.call) + || !isConstructorModern(Object) + || !isConstructorModern(function () { called = true; }) + || called; +}) ? isConstructorLegacy : isConstructorModern; + +},{"../internals/classof":138,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/get-built-in":182,"../internals/inspect-source":197,"../internals/is-callable":203}],205:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); + +var replacement = /#|\.prototype\./; + +var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value === POLYFILL ? true + : value === NATIVE ? false + : isCallable(detection) ? fails(detection) + : !!detection; +}; + +var normalize = isForced.normalize = function (string) { + return String(string).replace(replacement, '.').toLowerCase(); +}; + +var data = isForced.data = {}; +var NATIVE = isForced.NATIVE = 'N'; +var POLYFILL = isForced.POLYFILL = 'P'; + +module.exports = isForced; + +},{"../internals/fails":171,"../internals/is-callable":203}],206:[function(require,module,exports){ +'use strict'; +var isObject = require('../internals/is-object'); + +var floor = Math.floor; + +// `IsIntegralNumber` abstract operation +// https://tc39.es/ecma262/#sec-isintegralnumber +// eslint-disable-next-line es/no-number-isinteger -- safe +module.exports = Number.isInteger || function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + +},{"../internals/is-object":208}],207:[function(require,module,exports){ +'use strict'; +// we can't use just `it == null` since of `document.all` special case +// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec +module.exports = function (it) { + return it === null || it === undefined; +}; + +},{}],208:[function(require,module,exports){ +'use strict'; +var isCallable = require('../internals/is-callable'); + +module.exports = function (it) { + return typeof it == 'object' ? it !== null : isCallable(it); +}; + +},{"../internals/is-callable":203}],209:[function(require,module,exports){ +'use strict'; +var isObject = require('../internals/is-object'); + +module.exports = function (argument) { + return isObject(argument) || argument === null; +}; + +},{"../internals/is-object":208}],210:[function(require,module,exports){ +'use strict'; +module.exports = false; + +},{}],211:[function(require,module,exports){ +'use strict'; +var isObject = require('../internals/is-object'); +var classof = require('../internals/classof-raw'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var MATCH = wellKnownSymbol('match'); + +// `IsRegExp` abstract operation +// https://tc39.es/ecma262/#sec-isregexp +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp'); +}; + +},{"../internals/classof-raw":137,"../internals/is-object":208,"../internals/well-known-symbol":306}],212:[function(require,module,exports){ +'use strict'; +var getBuiltIn = require('../internals/get-built-in'); +var isCallable = require('../internals/is-callable'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); + +var $Object = Object; + +module.exports = USE_SYMBOL_AS_UID ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + var $Symbol = getBuiltIn('Symbol'); + return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); +}; + +},{"../internals/get-built-in":182,"../internals/is-callable":203,"../internals/object-is-prototype-of":238,"../internals/use-symbol-as-uid":300}],213:[function(require,module,exports){ +'use strict'; +var bind = require('../internals/function-bind-context'); +var call = require('../internals/function-call'); +var anObject = require('../internals/an-object'); +var tryToString = require('../internals/try-to-string'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var getIterator = require('../internals/get-iterator'); +var getIteratorMethod = require('../internals/get-iterator-method'); +var iteratorClose = require('../internals/iterator-close'); + +var $TypeError = TypeError; + +var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; +}; + +var ResultPrototype = Result.prototype; + +module.exports = function (iterable, unboundFunction, options) { + var that = options && options.that; + var AS_ENTRIES = !!(options && options.AS_ENTRIES); + var IS_RECORD = !!(options && options.IS_RECORD); + var IS_ITERATOR = !!(options && options.IS_ITERATOR); + var INTERRUPTED = !!(options && options.INTERRUPTED); + var fn = bind(unboundFunction, that); + var iterator, iterFn, index, length, result, next, step; + + var stop = function (condition) { + if (iterator) iteratorClose(iterator, 'normal', condition); + return new Result(true, condition); + }; + + var callFn = function (value) { + if (AS_ENTRIES) { + anObject(value); + return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); + } return INTERRUPTED ? fn(value, stop) : fn(value); + }; + + if (IS_RECORD) { + iterator = iterable.iterator; + } else if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable'); + // optimisation for array iterators + if (isArrayIteratorMethod(iterFn)) { + for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { + result = callFn(iterable[index]); + if (result && isPrototypeOf(ResultPrototype, result)) return result; + } return new Result(false); + } + iterator = getIterator(iterable, iterFn); + } + + next = IS_RECORD ? iterable.next : iterator.next; + while (!(step = call(next, iterator)).done) { + try { + result = callFn(step.value); + } catch (error) { + iteratorClose(iterator, 'throw', error); + } + if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; + } return new Result(false); +}; + +},{"../internals/an-object":114,"../internals/function-bind-context":175,"../internals/function-call":177,"../internals/get-iterator":184,"../internals/get-iterator-method":183,"../internals/is-array-iterator-method":200,"../internals/iterator-close":214,"../internals/length-of-array-like":219,"../internals/object-is-prototype-of":238,"../internals/try-to-string":293}],214:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var anObject = require('../internals/an-object'); +var getMethod = require('../internals/get-method'); + +module.exports = function (iterator, kind, value) { + var innerResult, innerError; + anObject(iterator); + try { + innerResult = getMethod(iterator, 'return'); + if (!innerResult) { + if (kind === 'throw') throw value; + return value; + } + innerResult = call(innerResult, iterator); + } catch (error) { + innerError = true; + innerResult = error; + } + if (kind === 'throw') throw value; + if (innerError) throw innerResult; + anObject(innerResult); + return value; +}; + +},{"../internals/an-object":114,"../internals/function-call":177,"../internals/get-method":186}],215:[function(require,module,exports){ +'use strict'; +var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; +var create = require('../internals/object-create'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var setToStringTag = require('../internals/set-to-string-tag'); +var Iterators = require('../internals/iterators'); + +var returnThis = function () { return this; }; + +module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + Iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; +}; + +},{"../internals/create-property-descriptor":146,"../internals/iterators":218,"../internals/iterators-core":217,"../internals/object-create":229,"../internals/set-to-string-tag":266}],216:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var call = require('../internals/function-call'); +var IS_PURE = require('../internals/is-pure'); +var FunctionName = require('../internals/function-name'); +var isCallable = require('../internals/is-callable'); +var createIteratorConstructor = require('../internals/iterator-create-constructor'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var setToStringTag = require('../internals/set-to-string-tag'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var defineBuiltIn = require('../internals/define-built-in'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var Iterators = require('../internals/iterators'); +var IteratorsCore = require('../internals/iterators-core'); + +var PROPER_FUNCTION_NAME = FunctionName.PROPER; +var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; +var IteratorPrototype = IteratorsCore.IteratorPrototype; +var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; +var ITERATOR = wellKnownSymbol('iterator'); +var KEYS = 'keys'; +var VALUES = 'values'; +var ENTRIES = 'entries'; + +var returnThis = function () { return this; }; + +module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND]; + + switch (KIND) { + case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; + case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; + case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; + } + + return function () { return new IteratorConstructor(this); }; + }; + + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR] + || IterablePrototype['@@iterator'] + || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; + + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); + if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { + if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { + if (setPrototypeOf) { + setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); + } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { + defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis); + } + } + // Set @@toStringTag to native iterators + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); + if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; + } + } + + // fix Array.prototype.{ values, @@iterator }.name in V8 / FF + if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) { + if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { + createNonEnumerableProperty(IterablePrototype, 'name', VALUES); + } else { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { return call(nativeIterator, this); }; + } + } + + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + defineBuiltIn(IterablePrototype, KEY, methods[KEY]); + } + } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } + + // define iterator + if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { + defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }); + } + Iterators[NAME] = defaultIterator; + + return methods; +}; + +},{"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/export":170,"../internals/function-call":177,"../internals/function-name":178,"../internals/is-callable":203,"../internals/is-pure":210,"../internals/iterator-create-constructor":215,"../internals/iterators":218,"../internals/iterators-core":217,"../internals/object-get-prototype-of":236,"../internals/object-set-prototype-of":242,"../internals/set-to-string-tag":266,"../internals/well-known-symbol":306}],217:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var create = require('../internals/object-create'); +var getPrototypeOf = require('../internals/object-get-prototype-of'); +var defineBuiltIn = require('../internals/define-built-in'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_PURE = require('../internals/is-pure'); + +var ITERATOR = wellKnownSymbol('iterator'); +var BUGGY_SAFARI_ITERATORS = false; + +// `%IteratorPrototype%` object +// https://tc39.es/ecma262/#sec-%iteratorprototype%-object +var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; + +/* eslint-disable es/no-array-prototype-keys -- safe */ +if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } +} + +var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () { + var test = {}; + // FF44- legacy iterators case + return IteratorPrototype[ITERATOR].call(test) !== test; +}); + +if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {}; +else if (IS_PURE) IteratorPrototype = create(IteratorPrototype); + +// `%IteratorPrototype%[@@iterator]()` method +// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator +if (!isCallable(IteratorPrototype[ITERATOR])) { + defineBuiltIn(IteratorPrototype, ITERATOR, function () { + return this; + }); +} + +module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS +}; + +},{"../internals/define-built-in":149,"../internals/fails":171,"../internals/is-callable":203,"../internals/is-object":208,"../internals/is-pure":210,"../internals/object-create":229,"../internals/object-get-prototype-of":236,"../internals/well-known-symbol":306}],218:[function(require,module,exports){ +arguments[4][190][0].apply(exports,arguments) +},{"dup":190}],219:[function(require,module,exports){ +'use strict'; +var toLength = require('../internals/to-length'); + +// `LengthOfArrayLike` abstract operation +// https://tc39.es/ecma262/#sec-lengthofarraylike +module.exports = function (obj) { + return toLength(obj.length); +}; + +},{"../internals/to-length":284}],220:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); +var hasOwn = require('../internals/has-own-property'); +var DESCRIPTORS = require('../internals/descriptors'); +var CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE; +var inspectSource = require('../internals/inspect-source'); +var InternalStateModule = require('../internals/internal-state'); + +var enforceInternalState = InternalStateModule.enforce; +var getInternalState = InternalStateModule.get; +var $String = String; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var defineProperty = Object.defineProperty; +var stringSlice = uncurryThis(''.slice); +var replace = uncurryThis(''.replace); +var join = uncurryThis([].join); + +var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { + return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; +}); + +var TEMPLATE = String(String).split('String'); + +var makeBuiltIn = module.exports = function (value, name, options) { + if (stringSlice($String(name), 0, 7) === 'Symbol(') { + name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']'; + } + if (options && options.getter) name = 'get ' + name; + if (options && options.setter) name = 'set ' + name; + if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { + if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); + else value.name = name; + } + if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { + defineProperty(value, 'length', { value: options.arity }); + } + try { + if (options && hasOwn(options, 'constructor') && options.constructor) { + if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); + // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable + } else if (value.prototype) value.prototype = undefined; + } catch (error) { /* empty */ } + var state = enforceInternalState(value); + if (!hasOwn(state, 'source')) { + state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); + } return value; +}; + +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +// eslint-disable-next-line no-extend-native -- required +Function.prototype.toString = makeBuiltIn(function toString() { + return isCallable(this) && getInternalState(this).source || inspectSource(this); +}, 'toString'); + +},{"../internals/descriptors":153,"../internals/fails":171,"../internals/function-name":178,"../internals/function-uncurry-this":181,"../internals/has-own-property":189,"../internals/inspect-source":197,"../internals/internal-state":199,"../internals/is-callable":203}],221:[function(require,module,exports){ +'use strict'; +var sign = require('../internals/math-sign'); + +var abs = Math.abs; + +var EPSILON = 2.220446049250313e-16; // Number.EPSILON +var INVERSE_EPSILON = 1 / EPSILON; + +var roundTiesToEven = function (n) { + return n + INVERSE_EPSILON - INVERSE_EPSILON; +}; + +module.exports = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) { + var n = +x; + var absolute = abs(n); + var s = sign(n); + if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON; + var a = (1 + FLOAT_EPSILON / EPSILON) * absolute; + var result = a - (a - absolute); + // eslint-disable-next-line no-self-compare -- NaN check + if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity; + return s * result; +}; + +},{"../internals/math-sign":223}],222:[function(require,module,exports){ +'use strict'; +var floatRound = require('../internals/math-float-round'); + +var FLOAT32_EPSILON = 1.1920928955078125e-7; // 2 ** -23; +var FLOAT32_MAX_VALUE = 3.4028234663852886e+38; // 2 ** 128 - 2 ** 104 +var FLOAT32_MIN_VALUE = 1.1754943508222875e-38; // 2 ** -126; + +// `Math.fround` method implementation +// https://tc39.es/ecma262/#sec-math.fround +// eslint-disable-next-line es/no-math-fround -- safe +module.exports = Math.fround || function fround(x) { + return floatRound(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE); +}; + +},{"../internals/math-float-round":221}],223:[function(require,module,exports){ +'use strict'; +// `Math.sign` method implementation +// https://tc39.es/ecma262/#sec-math.sign +// eslint-disable-next-line es/no-math-sign -- safe +module.exports = Math.sign || function sign(x) { + var n = +x; + // eslint-disable-next-line no-self-compare -- NaN check + return n === 0 || n !== n ? n : n < 0 ? -1 : 1; +}; + +},{}],224:[function(require,module,exports){ +'use strict'; +var ceil = Math.ceil; +var floor = Math.floor; + +// `Math.trunc` method +// https://tc39.es/ecma262/#sec-math.trunc +// eslint-disable-next-line es/no-math-trunc -- safe +module.exports = Math.trunc || function trunc(x) { + var n = +x; + return (n > 0 ? floor : ceil)(n); +}; + +},{}],225:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var safeGetBuiltIn = require('../internals/safe-get-built-in'); +var bind = require('../internals/function-bind-context'); +var macrotask = require('../internals/task').set; +var Queue = require('../internals/queue'); +var IS_IOS = require('../internals/engine-is-ios'); +var IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble'); +var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit'); +var IS_NODE = require('../internals/engine-is-node'); + +var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; +var document = global.document; +var process = global.process; +var Promise = global.Promise; +var microtask = safeGetBuiltIn('queueMicrotask'); +var notify, toggle, node, promise, then; + +// modern engines have queueMicrotask method +if (!microtask) { + var queue = new Queue(); + + var flush = function () { + var parent, fn; + if (IS_NODE && (parent = process.domain)) parent.exit(); + while (fn = queue.get()) try { + fn(); + } catch (error) { + if (queue.head) notify(); + throw error; + } + if (parent) parent.enter(); + }; + + // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 + // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898 + if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) { + toggle = true; + node = document.createTextNode(''); + new MutationObserver(flush).observe(node, { characterData: true }); + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + promise = Promise.resolve(undefined); + // workaround of WebKit ~ iOS Safari 10.1 bug + promise.constructor = Promise; + then = bind(promise.then, promise); + notify = function () { + then(flush); + }; + // Node.js without promises + } else if (IS_NODE) { + notify = function () { + process.nextTick(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessage + // - onreadystatechange + // - setTimeout + } else { + // `webpack` dev server bug on IE global methods - use bind(fn, global) + macrotask = bind(macrotask, global); + notify = function () { + macrotask(flush); + }; + } + + microtask = function (fn) { + if (!queue.head) notify(); + queue.add(fn); + }; +} + +module.exports = microtask; + +},{"../internals/engine-is-ios":163,"../internals/engine-is-ios-pebble":162,"../internals/engine-is-node":164,"../internals/engine-is-webos-webkit":165,"../internals/function-bind-context":175,"../internals/global":188,"../internals/queue":254,"../internals/safe-get-built-in":263,"../internals/task":277}],226:[function(require,module,exports){ +'use strict'; +var aCallable = require('../internals/a-callable'); + +var $TypeError = TypeError; + +var PromiseCapability = function (C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aCallable(resolve); + this.reject = aCallable(reject); +}; + +// `NewPromiseCapability` abstract operation +// https://tc39.es/ecma262/#sec-newpromisecapability +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + +},{"../internals/a-callable":108}],227:[function(require,module,exports){ +'use strict'; +var isRegExp = require('../internals/is-regexp'); + +var $TypeError = TypeError; + +module.exports = function (it) { + if (isRegExp(it)) { + throw new $TypeError("The method doesn't accept regular expressions"); + } return it; +}; + +},{"../internals/is-regexp":211}],228:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var uncurryThis = require('../internals/function-uncurry-this'); +var call = require('../internals/function-call'); +var fails = require('../internals/fails'); +var objectKeys = require('../internals/object-keys'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var toObject = require('../internals/to-object'); +var IndexedObject = require('../internals/indexed-object'); + +// eslint-disable-next-line es/no-object-assign -- safe +var $assign = Object.assign; +// eslint-disable-next-line es/no-object-defineproperty -- required for testing +var defineProperty = Object.defineProperty; +var concat = uncurryThis([].concat); + +// `Object.assign` method +// https://tc39.es/ecma262/#sec-object.assign +module.exports = !$assign || fails(function () { + // should have correct order of operations (Edge bug) + if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', { + enumerable: true, + get: function () { + defineProperty(this, 'b', { + value: 3, + enumerable: false + }); + } + }), { b: 2 })).b !== 1) return true; + // should work with symbols and should have deterministic property order (V8 bug) + var A = {}; + var B = {}; + // eslint-disable-next-line es/no-symbol -- safe + var symbol = Symbol('assign detection'); + var alphabet = 'abcdefghijklmnopqrst'; + A[symbol] = 7; + alphabet.split('').forEach(function (chr) { B[chr] = chr; }); + return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + var propertyIsEnumerable = propertyIsEnumerableModule.f; + while (argumentsLength > index) { + var S = IndexedObject(arguments[index++]); + var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key]; + } + } return T; +} : $assign; + +},{"../internals/descriptors":153,"../internals/fails":171,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/indexed-object":195,"../internals/object-get-own-property-symbols":235,"../internals/object-keys":240,"../internals/object-property-is-enumerable":241,"../internals/to-object":285}],229:[function(require,module,exports){ +'use strict'; +/* global ActiveXObject -- old IE, WSH */ +var anObject = require('../internals/an-object'); +var definePropertiesModule = require('../internals/object-define-properties'); +var enumBugKeys = require('../internals/enum-bug-keys'); +var hiddenKeys = require('../internals/hidden-keys'); +var html = require('../internals/html'); +var documentCreateElement = require('../internals/document-create-element'); +var sharedKey = require('../internals/shared-key'); + +var GT = '>'; +var LT = '<'; +var PROTOTYPE = 'prototype'; +var SCRIPT = 'script'; +var IE_PROTO = sharedKey('IE_PROTO'); + +var EmptyConstructor = function () { /* empty */ }; + +var scriptTag = function (content) { + return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; +}; + +// Create object with fake `null` prototype: use ActiveX Object with cleared prototype +var NullProtoObjectViaActiveX = function (activeXDocument) { + activeXDocument.write(scriptTag('')); + activeXDocument.close(); + var temp = activeXDocument.parentWindow.Object; + activeXDocument = null; // avoid memory leak + return temp; +}; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var NullProtoObjectViaIFrame = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var JS = 'java' + SCRIPT + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + // https://github.com/zloirock/core-js/issues/475 + iframe.src = String(JS); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(scriptTag('document.F=Object')); + iframeDocument.close(); + return iframeDocument.F; +}; + +// Check for document.domain and active x support +// No need to use active x approach when document.domain is not set +// see https://github.com/es-shims/es5-shim/issues/150 +// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 +// avoid IE GC bug +var activeXDocument; +var NullProtoObject = function () { + try { + activeXDocument = new ActiveXObject('htmlfile'); + } catch (error) { /* ignore */ } + NullProtoObject = typeof document != 'undefined' + ? document.domain && activeXDocument + ? NullProtoObjectViaActiveX(activeXDocument) // old IE + : NullProtoObjectViaIFrame() + : NullProtoObjectViaActiveX(activeXDocument); // WSH + var length = enumBugKeys.length; + while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); +}; + +hiddenKeys[IE_PROTO] = true; + +// `Object.create` method +// https://tc39.es/ecma262/#sec-object.create +// eslint-disable-next-line es/no-object-create -- safe +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + EmptyConstructor[PROTOTYPE] = anObject(O); + result = new EmptyConstructor(); + EmptyConstructor[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = NullProtoObject(); + return Properties === undefined ? result : definePropertiesModule.f(result, Properties); +}; + +},{"../internals/an-object":114,"../internals/document-create-element":154,"../internals/enum-bug-keys":169,"../internals/hidden-keys":190,"../internals/html":192,"../internals/object-define-properties":230,"../internals/shared-key":267}],230:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); +var definePropertyModule = require('../internals/object-define-property'); +var anObject = require('../internals/an-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var objectKeys = require('../internals/object-keys'); + +// `Object.defineProperties` method +// https://tc39.es/ecma262/#sec-object.defineproperties +// eslint-disable-next-line es/no-object-defineproperties -- safe +exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var props = toIndexedObject(Properties); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); + return O; +}; + +},{"../internals/an-object":114,"../internals/descriptors":153,"../internals/object-define-property":231,"../internals/object-keys":240,"../internals/to-indexed-object":282,"../internals/v8-prototype-define-bug":301}],231:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); +var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug'); +var anObject = require('../internals/an-object'); +var toPropertyKey = require('../internals/to-property-key'); + +var $TypeError = TypeError; +// eslint-disable-next-line es/no-object-defineproperty -- safe +var $defineProperty = Object.defineProperty; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var ENUMERABLE = 'enumerable'; +var CONFIGURABLE = 'configurable'; +var WRITABLE = 'writable'; + +// `Object.defineProperty` method +// https://tc39.es/ecma262/#sec-object.defineproperty +exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { + anObject(O); + P = toPropertyKey(P); + anObject(Attributes); + if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { + var current = $getOwnPropertyDescriptor(O, P); + if (current && current[WRITABLE]) { + O[P] = Attributes.value; + Attributes = { + configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], + enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], + writable: false + }; + } + } return $defineProperty(O, P, Attributes); +} : $defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPropertyKey(P); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return $defineProperty(O, P, Attributes); + } catch (error) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + +},{"../internals/an-object":114,"../internals/descriptors":153,"../internals/ie8-dom-define":193,"../internals/to-property-key":289,"../internals/v8-prototype-define-bug":301}],232:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var call = require('../internals/function-call'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toPropertyKey = require('../internals/to-property-key'); +var hasOwn = require('../internals/has-own-property'); +var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); + +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor +exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPropertyKey(P); + if (IE8_DOM_DEFINE) try { + return $getOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ } + if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); +}; + +},{"../internals/create-property-descriptor":146,"../internals/descriptors":153,"../internals/function-call":177,"../internals/has-own-property":189,"../internals/ie8-dom-define":193,"../internals/object-property-is-enumerable":241,"../internals/to-indexed-object":282,"../internals/to-property-key":289}],233:[function(require,module,exports){ +'use strict'; +/* eslint-disable es/no-object-getownpropertynames -- safe */ +var classof = require('../internals/classof-raw'); +var toIndexedObject = require('../internals/to-indexed-object'); +var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var arraySlice = require('../internals/array-slice'); + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return $getOwnPropertyNames(it); + } catch (error) { + return arraySlice(windowNames); + } +}; + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && classof(it) === 'Window' + ? getWindowNames(it) + : $getOwnPropertyNames(toIndexedObject(it)); +}; + +},{"../internals/array-slice":131,"../internals/classof-raw":137,"../internals/object-get-own-property-names":234,"../internals/to-indexed-object":282}],234:[function(require,module,exports){ +'use strict'; +var internalObjectKeys = require('../internals/object-keys-internal'); +var enumBugKeys = require('../internals/enum-bug-keys'); + +var hiddenKeys = enumBugKeys.concat('length', 'prototype'); + +// `Object.getOwnPropertyNames` method +// https://tc39.es/ecma262/#sec-object.getownpropertynames +// eslint-disable-next-line es/no-object-getownpropertynames -- safe +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); +}; + +},{"../internals/enum-bug-keys":169,"../internals/object-keys-internal":239}],235:[function(require,module,exports){ +'use strict'; +// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe +exports.f = Object.getOwnPropertySymbols; + +},{}],236:[function(require,module,exports){ +'use strict'; +var hasOwn = require('../internals/has-own-property'); +var isCallable = require('../internals/is-callable'); +var toObject = require('../internals/to-object'); +var sharedKey = require('../internals/shared-key'); +var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); + +var IE_PROTO = sharedKey('IE_PROTO'); +var $Object = Object; +var ObjectPrototype = $Object.prototype; + +// `Object.getPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.getprototypeof +// eslint-disable-next-line es/no-object-getprototypeof -- safe +module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { + var object = toObject(O); + if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; + var constructor = object.constructor; + if (isCallable(constructor) && object instanceof constructor) { + return constructor.prototype; + } return object instanceof $Object ? ObjectPrototype : null; +}; + +},{"../internals/correct-prototype-getter":143,"../internals/has-own-property":189,"../internals/is-callable":203,"../internals/shared-key":267,"../internals/to-object":285}],237:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var isObject = require('../internals/is-object'); +var classof = require('../internals/classof-raw'); +var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible'); + +// eslint-disable-next-line es/no-object-isextensible -- safe +var $isExtensible = Object.isExtensible; +var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); }); + +// `Object.isExtensible` method +// https://tc39.es/ecma262/#sec-object.isextensible +module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) { + if (!isObject(it)) return false; + if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false; + return $isExtensible ? $isExtensible(it) : true; +} : $isExtensible; + +},{"../internals/array-buffer-non-extensible":116,"../internals/classof-raw":137,"../internals/fails":171,"../internals/is-object":208}],238:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); + +module.exports = uncurryThis({}.isPrototypeOf); + +},{"../internals/function-uncurry-this":181}],239:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var hasOwn = require('../internals/has-own-property'); +var toIndexedObject = require('../internals/to-indexed-object'); +var indexOf = require('../internals/array-includes').indexOf; +var hiddenKeys = require('../internals/hidden-keys'); + +var push = uncurryThis([].push); + +module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); + // Don't enum bug & hidden keys + while (names.length > i) if (hasOwn(O, key = names[i++])) { + ~indexOf(result, key) || push(result, key); + } + return result; +}; + +},{"../internals/array-includes":124,"../internals/function-uncurry-this":181,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/to-indexed-object":282}],240:[function(require,module,exports){ +'use strict'; +var internalObjectKeys = require('../internals/object-keys-internal'); +var enumBugKeys = require('../internals/enum-bug-keys'); + +// `Object.keys` method +// https://tc39.es/ecma262/#sec-object.keys +// eslint-disable-next-line es/no-object-keys -- safe +module.exports = Object.keys || function keys(O) { + return internalObjectKeys(O, enumBugKeys); +}; + +},{"../internals/enum-bug-keys":169,"../internals/object-keys-internal":239}],241:[function(require,module,exports){ +'use strict'; +var $propertyIsEnumerable = {}.propertyIsEnumerable; +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// Nashorn ~ JDK8 bug +var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); + +// `Object.prototype.propertyIsEnumerable` method implementation +// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable +exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; +} : $propertyIsEnumerable; + +},{}],242:[function(require,module,exports){ +'use strict'; +/* eslint-disable no-proto -- safe */ +var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor'); +var anObject = require('../internals/an-object'); +var aPossiblePrototype = require('../internals/a-possible-prototype'); + +// `Object.setPrototypeOf` method +// https://tc39.es/ecma262/#sec-object.setprototypeof +// Works with __proto__ only. Old v8 can't work with null proto objects. +// eslint-disable-next-line es/no-object-setprototypeof -- safe +module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + try { + setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); + setter(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { /* empty */ } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter(O, proto); + else O.__proto__ = proto; + return O; + }; +}() : undefined); + +},{"../internals/a-possible-prototype":110,"../internals/an-object":114,"../internals/function-uncurry-this-accessor":179}],243:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); +var uncurryThis = require('../internals/function-uncurry-this'); +var objectGetPrototypeOf = require('../internals/object-get-prototype-of'); +var objectKeys = require('../internals/object-keys'); +var toIndexedObject = require('../internals/to-indexed-object'); +var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f; + +var propertyIsEnumerable = uncurryThis($propertyIsEnumerable); +var push = uncurryThis([].push); + +// in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys +// of `null` prototype objects +var IE_BUG = DESCRIPTORS && fails(function () { + // eslint-disable-next-line es/no-object-create -- safe + var O = Object.create(null); + O[2] = 2; + return !propertyIsEnumerable(O, 2); +}); + +// `Object.{ entries, values }` methods implementation +var createMethod = function (TO_ENTRIES) { + return function (it) { + var O = toIndexedObject(it); + var keys = objectKeys(O); + var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null; + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) { + push(result, TO_ENTRIES ? [key, O[key]] : O[key]); + } + } + return result; + }; +}; + +module.exports = { + // `Object.entries` method + // https://tc39.es/ecma262/#sec-object.entries + entries: createMethod(true), + // `Object.values` method + // https://tc39.es/ecma262/#sec-object.values + values: createMethod(false) +}; + +},{"../internals/descriptors":153,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/object-get-prototype-of":236,"../internals/object-keys":240,"../internals/object-property-is-enumerable":241,"../internals/to-indexed-object":282}],244:[function(require,module,exports){ +'use strict'; +var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); +var classof = require('../internals/classof'); + +// `Object.prototype.toString` method implementation +// https://tc39.es/ecma262/#sec-object.prototype.tostring +module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { + return '[object ' + classof(this) + ']'; +}; + +},{"../internals/classof":138,"../internals/to-string-tag-support":290}],245:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); + +var $TypeError = TypeError; + +// `OrdinaryToPrimitive` abstract operation +// https://tc39.es/ecma262/#sec-ordinarytoprimitive +module.exports = function (input, pref) { + var fn, val; + if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; + if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; + if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; + throw new $TypeError("Can't convert object to primitive value"); +}; + +},{"../internals/function-call":177,"../internals/is-callable":203,"../internals/is-object":208}],246:[function(require,module,exports){ +'use strict'; +var getBuiltIn = require('../internals/get-built-in'); +var uncurryThis = require('../internals/function-uncurry-this'); +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var anObject = require('../internals/an-object'); + +var concat = uncurryThis([].concat); + +// all object keys, includes non-enumerable and symbols +module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; +}; + +},{"../internals/an-object":114,"../internals/function-uncurry-this":181,"../internals/get-built-in":182,"../internals/object-get-own-property-names":234,"../internals/object-get-own-property-symbols":235}],247:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); + +module.exports = global; + +},{"../internals/global":188}],248:[function(require,module,exports){ +'use strict'; +module.exports = function (exec) { + try { + return { error: false, value: exec() }; + } catch (error) { + return { error: true, value: error }; + } +}; + +},{}],249:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var isCallable = require('../internals/is-callable'); +var isForced = require('../internals/is-forced'); +var inspectSource = require('../internals/inspect-source'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var IS_BROWSER = require('../internals/engine-is-browser'); +var IS_DENO = require('../internals/engine-is-deno'); +var IS_PURE = require('../internals/is-pure'); +var V8_VERSION = require('../internals/engine-v8-version'); + +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; +var SPECIES = wellKnownSymbol('species'); +var SUBCLASSING = false; +var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent); + +var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () { + var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor); + var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor); + // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // We can't detect it synchronously, so just check versions + if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true; + // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution + if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true; + // We can't use @@species feature detection in V8 since it causes + // deoptimization and performance degradation + // https://github.com/zloirock/core-js/issues/679 + if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) { + // Detect correctness of subclassing with @@species support + var promise = new NativePromiseConstructor(function (resolve) { resolve(1); }); + var FakePromise = function (exec) { + exec(function () { /* empty */ }, function () { /* empty */ }); + }; + var constructor = promise.constructor = {}; + constructor[SPECIES] = FakePromise; + SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise; + if (!SUBCLASSING) return true; + // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test + } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT; +}); + +module.exports = { + CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR, + REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT, + SUBCLASSING: SUBCLASSING +}; + +},{"../internals/engine-is-browser":159,"../internals/engine-is-deno":160,"../internals/engine-v8-version":167,"../internals/global":188,"../internals/inspect-source":197,"../internals/is-callable":203,"../internals/is-forced":205,"../internals/is-pure":210,"../internals/promise-native-constructor":250,"../internals/well-known-symbol":306}],250:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); + +module.exports = global.Promise; + +},{"../internals/global":188}],251:[function(require,module,exports){ +'use strict'; +var anObject = require('../internals/an-object'); +var isObject = require('../internals/is-object'); +var newPromiseCapability = require('../internals/new-promise-capability'); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + +},{"../internals/an-object":114,"../internals/is-object":208,"../internals/new-promise-capability":226}],252:[function(require,module,exports){ +'use strict'; +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; + +module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) { + NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ }); +}); + +},{"../internals/check-correctness-of-iteration":136,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250}],253:[function(require,module,exports){ +'use strict'; +var defineProperty = require('../internals/object-define-property').f; + +module.exports = function (Target, Source, key) { + key in Target || defineProperty(Target, key, { + configurable: true, + get: function () { return Source[key]; }, + set: function (it) { Source[key] = it; } + }); +}; + +},{"../internals/object-define-property":231}],254:[function(require,module,exports){ +'use strict'; +var Queue = function () { + this.head = null; + this.tail = null; +}; + +Queue.prototype = { + add: function (item) { + var entry = { item: item, next: null }; + var tail = this.tail; + if (tail) tail.next = entry; + else this.head = entry; + this.tail = entry; + }, + get: function () { + var entry = this.head; + if (entry) { + var next = this.head = entry.next; + if (next === null) this.tail = null; + return entry.item; + } + } +}; + +module.exports = Queue; + +},{}],255:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var anObject = require('../internals/an-object'); +var isCallable = require('../internals/is-callable'); +var classof = require('../internals/classof-raw'); +var regexpExec = require('../internals/regexp-exec'); + +var $TypeError = TypeError; + +// `RegExpExec` abstract operation +// https://tc39.es/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (isCallable(exec)) { + var result = call(exec, R, S); + if (result !== null) anObject(result); + return result; + } + if (classof(R) === 'RegExp') return call(regexpExec, R, S); + throw new $TypeError('RegExp#exec called on incompatible receiver'); +}; + +},{"../internals/an-object":114,"../internals/classof-raw":137,"../internals/function-call":177,"../internals/is-callable":203,"../internals/regexp-exec":256}],256:[function(require,module,exports){ +'use strict'; +/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ +/* eslint-disable regexp/no-useless-quantifier -- testing */ +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var toString = require('../internals/to-string'); +var regexpFlags = require('../internals/regexp-flags'); +var stickyHelpers = require('../internals/regexp-sticky-helpers'); +var shared = require('../internals/shared'); +var create = require('../internals/object-create'); +var getInternalState = require('../internals/internal-state').get; +var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all'); +var UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg'); + +var nativeReplace = shared('native-string-replace', String.prototype.replace); +var nativeExec = RegExp.prototype.exec; +var patchedExec = nativeExec; +var charAt = uncurryThis(''.charAt); +var indexOf = uncurryThis(''.indexOf); +var replace = uncurryThis(''.replace); +var stringSlice = uncurryThis(''.slice); + +var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/; + var re2 = /b*/g; + call(nativeExec, re1, 'a'); + call(nativeExec, re2, 'a'); + return re1.lastIndex !== 0 || re2.lastIndex !== 0; +})(); + +var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET; + +// nonparticipating capturing group, copied from es5-shim's String#split patch. +var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; + +var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; + +if (PATCH) { + patchedExec = function exec(string) { + var re = this; + var state = getInternalState(re); + var str = toString(string); + var raw = state.raw; + var result, reCopy, lastIndex, match, i, object, group; + + if (raw) { + raw.lastIndex = re.lastIndex; + result = call(patchedExec, raw, str); + re.lastIndex = raw.lastIndex; + return result; + } + + var groups = state.groups; + var sticky = UNSUPPORTED_Y && re.sticky; + var flags = call(regexpFlags, re); + var source = re.source; + var charsAdded = 0; + var strCopy = str; + + if (sticky) { + flags = replace(flags, 'y', ''); + if (indexOf(flags, 'g') === -1) { + flags += 'g'; + } + + strCopy = stringSlice(str, re.lastIndex); + // Support anchored sticky behavior. + if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) { + source = '(?: ' + source + ')'; + strCopy = ' ' + strCopy; + charsAdded++; + } + // ^(? + rx + ) is needed, in combination with some str slicing, to + // simulate the 'y' flag. + reCopy = new RegExp('^(?:' + source + ')', flags); + } + + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + source + '$(?!\\s)', flags); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; + + match = call(nativeExec, sticky ? reCopy : re, strCopy); + + if (sticky) { + if (match) { + match.input = stringSlice(match.input, charsAdded); + match[0] = stringSlice(match[0], charsAdded); + match.index = re.lastIndex; + re.lastIndex += match[0].length; + } else re.lastIndex = 0; + } else if (UPDATES_LAST_INDEX_WRONG && match) { + re.lastIndex = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/ + call(nativeReplace, match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + + if (match && groups) { + match.groups = object = create(null); + for (i = 0; i < groups.length; i++) { + group = groups[i]; + object[group[0]] = match[group[1]]; + } + } + + return match; + }; +} + +module.exports = patchedExec; + +},{"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/internal-state":199,"../internals/object-create":229,"../internals/regexp-flags":257,"../internals/regexp-sticky-helpers":259,"../internals/regexp-unsupported-dot-all":260,"../internals/regexp-unsupported-ncg":261,"../internals/shared":269,"../internals/to-string":291}],257:[function(require,module,exports){ +'use strict'; +var anObject = require('../internals/an-object'); + +// `RegExp.prototype.flags` getter implementation +// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.hasIndices) result += 'd'; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.dotAll) result += 's'; + if (that.unicode) result += 'u'; + if (that.unicodeSets) result += 'v'; + if (that.sticky) result += 'y'; + return result; +}; + +},{"../internals/an-object":114}],258:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var hasOwn = require('../internals/has-own-property'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var regExpFlags = require('../internals/regexp-flags'); + +var RegExpPrototype = RegExp.prototype; + +module.exports = function (R) { + var flags = R.flags; + return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) + ? call(regExpFlags, R) : flags; +}; + +},{"../internals/function-call":177,"../internals/has-own-property":189,"../internals/object-is-prototype-of":238,"../internals/regexp-flags":257}],259:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var global = require('../internals/global'); + +// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError +var $RegExp = global.RegExp; + +var UNSUPPORTED_Y = fails(function () { + var re = $RegExp('a', 'y'); + re.lastIndex = 2; + return re.exec('abcd') !== null; +}); + +// UC Browser bug +// https://github.com/zloirock/core-js/issues/1008 +var MISSED_STICKY = UNSUPPORTED_Y || fails(function () { + return !$RegExp('a', 'y').sticky; +}); + +var BROKEN_CARET = UNSUPPORTED_Y || fails(function () { + // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 + var re = $RegExp('^r', 'gy'); + re.lastIndex = 2; + return re.exec('str') !== null; +}); + +module.exports = { + BROKEN_CARET: BROKEN_CARET, + MISSED_STICKY: MISSED_STICKY, + UNSUPPORTED_Y: UNSUPPORTED_Y +}; + +},{"../internals/fails":171,"../internals/global":188}],260:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var global = require('../internals/global'); + +// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError +var $RegExp = global.RegExp; + +module.exports = fails(function () { + var re = $RegExp('.', 's'); + return !(re.dotAll && re.test('\n') && re.flags === 's'); +}); + +},{"../internals/fails":171,"../internals/global":188}],261:[function(require,module,exports){ +'use strict'; +var fails = require('../internals/fails'); +var global = require('../internals/global'); + +// babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError +var $RegExp = global.RegExp; + +module.exports = fails(function () { + var re = $RegExp('(?b)', 'g'); + return re.exec('b').groups.a !== 'b' || + 'b'.replace(re, '$c') !== 'bc'; +}); + +},{"../internals/fails":171,"../internals/global":188}],262:[function(require,module,exports){ +'use strict'; +var isNullOrUndefined = require('../internals/is-null-or-undefined'); + +var $TypeError = TypeError; + +// `RequireObjectCoercible` abstract operation +// https://tc39.es/ecma262/#sec-requireobjectcoercible +module.exports = function (it) { + if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); + return it; +}; + +},{"../internals/is-null-or-undefined":207}],263:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var DESCRIPTORS = require('../internals/descriptors'); + +// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// Avoid NodeJS experimental warning +module.exports = function (name) { + if (!DESCRIPTORS) return global[name]; + var descriptor = getOwnPropertyDescriptor(global, name); + return descriptor && descriptor.value; +}; + +},{"../internals/descriptors":153,"../internals/global":188}],264:[function(require,module,exports){ +'use strict'; +// `SameValue` abstract operation +// https://tc39.es/ecma262/#sec-samevalue +// eslint-disable-next-line es/no-object-is -- safe +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare -- NaN check + return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y; +}; + +},{}],265:[function(require,module,exports){ +'use strict'; +var getBuiltIn = require('../internals/get-built-in'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var DESCRIPTORS = require('../internals/descriptors'); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + + if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { + defineBuiltInAccessor(Constructor, SPECIES, { + configurable: true, + get: function () { return this; } + }); + } +}; + +},{"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/get-built-in":182,"../internals/well-known-symbol":306}],266:[function(require,module,exports){ +'use strict'; +var defineProperty = require('../internals/object-define-property').f; +var hasOwn = require('../internals/has-own-property'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + +module.exports = function (target, TAG, STATIC) { + if (target && !STATIC) target = target.prototype; + if (target && !hasOwn(target, TO_STRING_TAG)) { + defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG }); + } +}; + +},{"../internals/has-own-property":189,"../internals/object-define-property":231,"../internals/well-known-symbol":306}],267:[function(require,module,exports){ +'use strict'; +var shared = require('../internals/shared'); +var uid = require('../internals/uid'); + +var keys = shared('keys'); + +module.exports = function (key) { + return keys[key] || (keys[key] = uid(key)); +}; + +},{"../internals/shared":269,"../internals/uid":299}],268:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var defineGlobalProperty = require('../internals/define-global-property'); + +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || defineGlobalProperty(SHARED, {}); + +module.exports = store; + +},{"../internals/define-global-property":151,"../internals/global":188}],269:[function(require,module,exports){ +'use strict'; +var IS_PURE = require('../internals/is-pure'); +var store = require('../internals/shared-store'); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: '3.35.0', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)', + license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE', + source: 'https://github.com/zloirock/core-js' +}); + +},{"../internals/is-pure":210,"../internals/shared-store":268}],270:[function(require,module,exports){ +'use strict'; +var anObject = require('../internals/an-object'); +var aConstructor = require('../internals/a-constructor'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); + +// `SpeciesConstructor` abstract operation +// https://tc39.es/ecma262/#sec-speciesconstructor +module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S); +}; + +},{"../internals/a-constructor":109,"../internals/an-object":114,"../internals/is-null-or-undefined":207,"../internals/well-known-symbol":306}],271:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toString = require('../internals/to-string'); +var requireObjectCoercible = require('../internals/require-object-coercible'); + +var charAt = uncurryThis(''.charAt); +var charCodeAt = uncurryThis(''.charCodeAt); +var stringSlice = uncurryThis(''.slice); + +var createMethod = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = toString(requireObjectCoercible($this)); + var position = toIntegerOrInfinity(pos); + var size = S.length; + var first, second; + if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; + first = charCodeAt(S, position); + return first < 0xD800 || first > 0xDBFF || position + 1 === size + || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF + ? CONVERT_TO_STRING + ? charAt(S, position) + : first + : CONVERT_TO_STRING + ? stringSlice(S, position, position + 2) + : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; + }; +}; + +module.exports = { + // `String.prototype.codePointAt` method + // https://tc39.es/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod(true) +}; + +},{"../internals/function-uncurry-this":181,"../internals/require-object-coercible":262,"../internals/to-integer-or-infinity":283,"../internals/to-string":291}],272:[function(require,module,exports){ +'use strict'; +var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER; +var fails = require('../internals/fails'); +var whitespaces = require('../internals/whitespaces'); + +var non = '\u200B\u0085\u180E'; + +// check that a method works with the correct list +// of whitespaces and has a correct name +module.exports = function (METHOD_NAME) { + return fails(function () { + return !!whitespaces[METHOD_NAME]() + || non[METHOD_NAME]() !== non + || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME); + }); +}; + +},{"../internals/fails":171,"../internals/function-name":178,"../internals/whitespaces":307}],273:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var toString = require('../internals/to-string'); +var whitespaces = require('../internals/whitespaces'); + +var replace = uncurryThis(''.replace); +var ltrim = RegExp('^[' + whitespaces + ']+'); +var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$'); + +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation +var createMethod = function (TYPE) { + return function ($this) { + var string = toString(requireObjectCoercible($this)); + if (TYPE & 1) string = replace(string, ltrim, ''); + if (TYPE & 2) string = replace(string, rtrim, '$1'); + return string; + }; +}; + +module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.es/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.es/ecma262/#sec-string.prototype.trim + trim: createMethod(3) +}; + +},{"../internals/function-uncurry-this":181,"../internals/require-object-coercible":262,"../internals/to-string":291,"../internals/whitespaces":307}],274:[function(require,module,exports){ +'use strict'; +/* eslint-disable es/no-symbol -- required for testing */ +var V8_VERSION = require('../internals/engine-v8-version'); +var fails = require('../internals/fails'); +var global = require('../internals/global'); + +var $String = global.String; + +// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + var symbol = Symbol('symbol detection'); + // Chrome 38 Symbol has incorrect toString conversion + // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances + // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, + // of course, fail. + return !$String(symbol) || !(Object(symbol) instanceof Symbol) || + // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances + !Symbol.sham && V8_VERSION && V8_VERSION < 41; +}); + +},{"../internals/engine-v8-version":167,"../internals/fails":171,"../internals/global":188}],275:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var getBuiltIn = require('../internals/get-built-in'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var defineBuiltIn = require('../internals/define-built-in'); + +module.exports = function () { + var Symbol = getBuiltIn('Symbol'); + var SymbolPrototype = Symbol && Symbol.prototype; + var valueOf = SymbolPrototype && SymbolPrototype.valueOf; + var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); + + if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) { + // `Symbol.prototype[@@toPrimitive]` method + // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive + // eslint-disable-next-line no-unused-vars -- required for .length + defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) { + return call(valueOf, this); + }, { arity: 1 }); + } +}; + +},{"../internals/define-built-in":149,"../internals/function-call":177,"../internals/get-built-in":182,"../internals/well-known-symbol":306}],276:[function(require,module,exports){ +'use strict'; +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); + +/* eslint-disable es/no-symbol -- safe */ +module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor; + +},{"../internals/symbol-constructor-detection":274}],277:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var apply = require('../internals/function-apply'); +var bind = require('../internals/function-bind-context'); +var isCallable = require('../internals/is-callable'); +var hasOwn = require('../internals/has-own-property'); +var fails = require('../internals/fails'); +var html = require('../internals/html'); +var arraySlice = require('../internals/array-slice'); +var createElement = require('../internals/document-create-element'); +var validateArgumentsLength = require('../internals/validate-arguments-length'); +var IS_IOS = require('../internals/engine-is-ios'); +var IS_NODE = require('../internals/engine-is-node'); + +var set = global.setImmediate; +var clear = global.clearImmediate; +var process = global.process; +var Dispatch = global.Dispatch; +var Function = global.Function; +var MessageChannel = global.MessageChannel; +var String = global.String; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var $location, defer, channel, port; + +fails(function () { + // Deno throws a ReferenceError on `location` access without `--location` flag + $location = global.location; +}); + +var run = function (id) { + if (hasOwn(queue, id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; + +var runner = function (id) { + return function () { + run(id); + }; +}; + +var eventListener = function (event) { + run(event.data); +}; + +var globalPostMessageDefer = function (id) { + // old engines have not location.origin + global.postMessage(String(id), $location.protocol + '//' + $location.host); +}; + +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!set || !clear) { + set = function setImmediate(handler) { + validateArgumentsLength(arguments.length, 1); + var fn = isCallable(handler) ? handler : Function(handler); + var args = arraySlice(arguments, 1); + queue[++counter] = function () { + apply(fn, undefined, args); + }; + defer(counter); + return counter; + }; + clear = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (IS_NODE) { + defer = function (id) { + process.nextTick(runner(id)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(runner(id)); + }; + // Browsers with MessageChannel, includes WebWorkers + // except iOS - https://github.com/zloirock/core-js/issues/624 + } else if (MessageChannel && !IS_IOS) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = eventListener; + defer = bind(port.postMessage, port); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if ( + global.addEventListener && + isCallable(global.postMessage) && + !global.importScripts && + $location && $location.protocol !== 'file:' && + !fails(globalPostMessageDefer) + ) { + defer = globalPostMessageDefer; + global.addEventListener('message', eventListener, false); + // IE8- + } else if (ONREADYSTATECHANGE in createElement('script')) { + defer = function (id) { + html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(runner(id), 0); + }; + } +} + +module.exports = { + set: set, + clear: clear +}; + +},{"../internals/array-slice":131,"../internals/document-create-element":154,"../internals/engine-is-ios":163,"../internals/engine-is-node":164,"../internals/fails":171,"../internals/function-apply":174,"../internals/function-bind-context":175,"../internals/global":188,"../internals/has-own-property":189,"../internals/html":192,"../internals/is-callable":203,"../internals/validate-arguments-length":302}],278:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); + +// `thisNumberValue` abstract operation +// https://tc39.es/ecma262/#sec-thisnumbervalue +module.exports = uncurryThis(1.0.valueOf); + +},{"../internals/function-uncurry-this":181}],279:[function(require,module,exports){ +'use strict'; +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); + +var max = Math.max; +var min = Math.min; + +// Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). +module.exports = function (index, length) { + var integer = toIntegerOrInfinity(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); +}; + +},{"../internals/to-integer-or-infinity":283}],280:[function(require,module,exports){ +'use strict'; +var toPrimitive = require('../internals/to-primitive'); + +var $TypeError = TypeError; + +// `ToBigInt` abstract operation +// https://tc39.es/ecma262/#sec-tobigint +module.exports = function (argument) { + var prim = toPrimitive(argument, 'number'); + if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint"); + // eslint-disable-next-line es/no-bigint -- safe + return BigInt(prim); +}; + +},{"../internals/to-primitive":288}],281:[function(require,module,exports){ +'use strict'; +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toLength = require('../internals/to-length'); + +var $RangeError = RangeError; + +// `ToIndex` abstract operation +// https://tc39.es/ecma262/#sec-toindex +module.exports = function (it) { + if (it === undefined) return 0; + var number = toIntegerOrInfinity(it); + var length = toLength(number); + if (number !== length) throw new $RangeError('Wrong length or index'); + return length; +}; + +},{"../internals/to-integer-or-infinity":283,"../internals/to-length":284}],282:[function(require,module,exports){ +'use strict'; +// toObject with fallback for non-array-like ES3 strings +var IndexedObject = require('../internals/indexed-object'); +var requireObjectCoercible = require('../internals/require-object-coercible'); + +module.exports = function (it) { + return IndexedObject(requireObjectCoercible(it)); +}; + +},{"../internals/indexed-object":195,"../internals/require-object-coercible":262}],283:[function(require,module,exports){ +'use strict'; +var trunc = require('../internals/math-trunc'); + +// `ToIntegerOrInfinity` abstract operation +// https://tc39.es/ecma262/#sec-tointegerorinfinity +module.exports = function (argument) { + var number = +argument; + // eslint-disable-next-line no-self-compare -- NaN check + return number !== number || number === 0 ? 0 : trunc(number); +}; + +},{"../internals/math-trunc":224}],284:[function(require,module,exports){ +'use strict'; +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); + +var min = Math.min; + +// `ToLength` abstract operation +// https://tc39.es/ecma262/#sec-tolength +module.exports = function (argument) { + return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 +}; + +},{"../internals/to-integer-or-infinity":283}],285:[function(require,module,exports){ +'use strict'; +var requireObjectCoercible = require('../internals/require-object-coercible'); + +var $Object = Object; + +// `ToObject` abstract operation +// https://tc39.es/ecma262/#sec-toobject +module.exports = function (argument) { + return $Object(requireObjectCoercible(argument)); +}; + +},{"../internals/require-object-coercible":262}],286:[function(require,module,exports){ +'use strict'; +var toPositiveInteger = require('../internals/to-positive-integer'); + +var $RangeError = RangeError; + +module.exports = function (it, BYTES) { + var offset = toPositiveInteger(it); + if (offset % BYTES) throw new $RangeError('Wrong offset'); + return offset; +}; + +},{"../internals/to-positive-integer":287}],287:[function(require,module,exports){ +'use strict'; +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); + +var $RangeError = RangeError; + +module.exports = function (it) { + var result = toIntegerOrInfinity(it); + if (result < 0) throw new $RangeError("The argument can't be less than 0"); + return result; +}; + +},{"../internals/to-integer-or-infinity":283}],288:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var isObject = require('../internals/is-object'); +var isSymbol = require('../internals/is-symbol'); +var getMethod = require('../internals/get-method'); +var ordinaryToPrimitive = require('../internals/ordinary-to-primitive'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var $TypeError = TypeError; +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); + +// `ToPrimitive` abstract operation +// https://tc39.es/ecma262/#sec-toprimitive +module.exports = function (input, pref) { + if (!isObject(input) || isSymbol(input)) return input; + var exoticToPrim = getMethod(input, TO_PRIMITIVE); + var result; + if (exoticToPrim) { + if (pref === undefined) pref = 'default'; + result = call(exoticToPrim, input, pref); + if (!isObject(result) || isSymbol(result)) return result; + throw new $TypeError("Can't convert object to primitive value"); + } + if (pref === undefined) pref = 'number'; + return ordinaryToPrimitive(input, pref); +}; + +},{"../internals/function-call":177,"../internals/get-method":186,"../internals/is-object":208,"../internals/is-symbol":212,"../internals/ordinary-to-primitive":245,"../internals/well-known-symbol":306}],289:[function(require,module,exports){ +'use strict'; +var toPrimitive = require('../internals/to-primitive'); +var isSymbol = require('../internals/is-symbol'); + +// `ToPropertyKey` abstract operation +// https://tc39.es/ecma262/#sec-topropertykey +module.exports = function (argument) { + var key = toPrimitive(argument, 'string'); + return isSymbol(key) ? key : key + ''; +}; + +},{"../internals/is-symbol":212,"../internals/to-primitive":288}],290:[function(require,module,exports){ +'use strict'; +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var test = {}; + +test[TO_STRING_TAG] = 'z'; + +module.exports = String(test) === '[object z]'; + +},{"../internals/well-known-symbol":306}],291:[function(require,module,exports){ +'use strict'; +var classof = require('../internals/classof'); + +var $String = String; + +module.exports = function (argument) { + if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); + return $String(argument); +}; + +},{"../internals/classof":138}],292:[function(require,module,exports){ +'use strict'; +var round = Math.round; + +module.exports = function (it) { + var value = round(it); + return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; +}; + +},{}],293:[function(require,module,exports){ +'use strict'; +var $String = String; + +module.exports = function (argument) { + try { + return $String(argument); + } catch (error) { + return 'Object'; + } +}; + +},{}],294:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var DESCRIPTORS = require('../internals/descriptors'); +var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var ArrayBufferModule = require('../internals/array-buffer'); +var anInstance = require('../internals/an-instance'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var isIntegralNumber = require('../internals/is-integral-number'); +var toLength = require('../internals/to-length'); +var toIndex = require('../internals/to-index'); +var toOffset = require('../internals/to-offset'); +var toUint8Clamped = require('../internals/to-uint8-clamped'); +var toPropertyKey = require('../internals/to-property-key'); +var hasOwn = require('../internals/has-own-property'); +var classof = require('../internals/classof'); +var isObject = require('../internals/is-object'); +var isSymbol = require('../internals/is-symbol'); +var create = require('../internals/object-create'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var typedArrayFrom = require('../internals/typed-array-from'); +var forEach = require('../internals/array-iteration').forEach; +var setSpecies = require('../internals/set-species'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var definePropertyModule = require('../internals/object-define-property'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list'); +var InternalStateModule = require('../internals/internal-state'); +var inheritIfRequired = require('../internals/inherit-if-required'); + +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; +var enforceInternalState = InternalStateModule.enforce; +var nativeDefineProperty = definePropertyModule.f; +var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; +var RangeError = global.RangeError; +var ArrayBuffer = ArrayBufferModule.ArrayBuffer; +var ArrayBufferPrototype = ArrayBuffer.prototype; +var DataView = ArrayBufferModule.DataView; +var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; +var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG; +var TypedArray = ArrayBufferViewCore.TypedArray; +var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype; +var isTypedArray = ArrayBufferViewCore.isTypedArray; +var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; +var WRONG_LENGTH = 'Wrong length'; + +var addGetter = function (it, key) { + defineBuiltInAccessor(it, key, { + configurable: true, + get: function () { + return getInternalState(this)[key]; + } + }); +}; + +var isArrayBuffer = function (it) { + var klass; + return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) === 'ArrayBuffer' || klass === 'SharedArrayBuffer'; +}; + +var isTypedArrayIndex = function (target, key) { + return isTypedArray(target) + && !isSymbol(key) + && key in target + && isIntegralNumber(+key) + && key >= 0; +}; + +var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { + key = toPropertyKey(key); + return isTypedArrayIndex(target, key) + ? createPropertyDescriptor(2, target[key]) + : nativeGetOwnPropertyDescriptor(target, key); +}; + +var wrappedDefineProperty = function defineProperty(target, key, descriptor) { + key = toPropertyKey(key); + if (isTypedArrayIndex(target, key) + && isObject(descriptor) + && hasOwn(descriptor, 'value') + && !hasOwn(descriptor, 'get') + && !hasOwn(descriptor, 'set') + // TODO: add validation descriptor w/o calling accessors + && !descriptor.configurable + && (!hasOwn(descriptor, 'writable') || descriptor.writable) + && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable) + ) { + target[key] = descriptor.value; + return target; + } return nativeDefineProperty(target, key, descriptor); +}; + +if (DESCRIPTORS) { + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; + definePropertyModule.f = wrappedDefineProperty; + addGetter(TypedArrayPrototype, 'buffer'); + addGetter(TypedArrayPrototype, 'byteOffset'); + addGetter(TypedArrayPrototype, 'byteLength'); + addGetter(TypedArrayPrototype, 'length'); + } + + $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { + getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, + defineProperty: wrappedDefineProperty + }); + + module.exports = function (TYPE, wrapper, CLAMPED) { + var BYTES = TYPE.match(/\d+/)[0] / 8; + var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + TYPE; + var SETTER = 'set' + TYPE; + var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME]; + var TypedArrayConstructor = NativeTypedArrayConstructor; + var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; + var exported = {}; + + var getter = function (that, index) { + var data = getInternalState(that); + return data.view[GETTER](index * BYTES + data.byteOffset, true); + }; + + var setter = function (that, index, value) { + var data = getInternalState(that); + data.view[SETTER](index * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true); + }; + + var addElement = function (that, index) { + nativeDefineProperty(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + + if (!NATIVE_ARRAY_BUFFER_VIEWS) { + TypedArrayConstructor = wrapper(function (that, data, offset, $length) { + anInstance(that, TypedArrayConstructorPrototype); + var index = 0; + var byteOffset = 0; + var buffer, byteLength, length; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new ArrayBuffer(byteLength); + } else if (isArrayBuffer(data)) { + buffer = data; + byteOffset = toOffset(offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw new RangeError(WRONG_LENGTH); + byteLength = $len - byteOffset; + if (byteLength < 0) throw new RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + byteOffset > $len) throw new RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (isTypedArray(data)) { + return arrayFromConstructorAndList(TypedArrayConstructor, data); + } else { + return call(typedArrayFrom, TypedArrayConstructor, data); + } + setInternalState(that, { + buffer: buffer, + byteOffset: byteOffset, + byteLength: byteLength, + length: length, + view: new DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype); + } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { + TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { + anInstance(dummy, TypedArrayConstructorPrototype); + return inheritIfRequired(function () { + if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)); + if (isArrayBuffer(data)) return $length !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) + : typedArrayOffset !== undefined + ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) + : new NativeTypedArrayConstructor(data); + if (isTypedArray(data)) return arrayFromConstructorAndList(TypedArrayConstructor, data); + return call(typedArrayFrom, TypedArrayConstructor, data); + }(), dummy, TypedArrayConstructor); + }); + + if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); + forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { + if (!(key in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); + } + }); + TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; + } + + if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); + } + + enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor; + + if (TYPED_ARRAY_TAG) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); + } + + var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor; + + exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; + + $({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); + + if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { + createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); + } + + if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { + createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); + } + + setSpecies(CONSTRUCTOR_NAME); + }; +} else module.exports = function () { /* empty */ }; + +},{"../internals/an-instance":113,"../internals/array-buffer":118,"../internals/array-buffer-view-core":117,"../internals/array-from-constructor-and-list":122,"../internals/array-iteration":125,"../internals/classof":138,"../internals/create-non-enumerable-property":145,"../internals/create-property-descriptor":146,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/export":170,"../internals/function-call":177,"../internals/global":188,"../internals/has-own-property":189,"../internals/inherit-if-required":196,"../internals/internal-state":199,"../internals/is-integral-number":206,"../internals/is-object":208,"../internals/is-symbol":212,"../internals/object-create":229,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/object-get-own-property-names":234,"../internals/object-is-prototype-of":238,"../internals/object-set-prototype-of":242,"../internals/set-species":265,"../internals/to-index":281,"../internals/to-length":284,"../internals/to-offset":286,"../internals/to-property-key":289,"../internals/to-uint8-clamped":292,"../internals/typed-array-constructors-require-wrappers":295,"../internals/typed-array-from":297}],295:[function(require,module,exports){ +'use strict'; +/* eslint-disable no-new -- required for testing */ +var global = require('../internals/global'); +var fails = require('../internals/fails'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); +var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS; + +var ArrayBuffer = global.ArrayBuffer; +var Int8Array = global.Int8Array; + +module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { + Int8Array(1); +}) || !fails(function () { + new Int8Array(-1); +}) || !checkCorrectnessOfIteration(function (iterable) { + new Int8Array(); + new Int8Array(null); + new Int8Array(1.5); + new Int8Array(iterable); +}, true) || fails(function () { + // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill + return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1; +}); + +},{"../internals/array-buffer-view-core":117,"../internals/check-correctness-of-iteration":136,"../internals/fails":171,"../internals/global":188}],296:[function(require,module,exports){ +'use strict'; +var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list'); +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); + +module.exports = function (instance, list) { + return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list); +}; + +},{"../internals/array-from-constructor-and-list":122,"../internals/typed-array-species-constructor":298}],297:[function(require,module,exports){ +'use strict'; +var bind = require('../internals/function-bind-context'); +var call = require('../internals/function-call'); +var aConstructor = require('../internals/a-constructor'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var getIterator = require('../internals/get-iterator'); +var getIteratorMethod = require('../internals/get-iterator-method'); +var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); +var isBigIntArray = require('../internals/is-big-int-array'); +var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor; +var toBigInt = require('../internals/to-big-int'); + +module.exports = function from(source /* , mapfn, thisArg */) { + var C = aConstructor(this); + var O = toObject(source); + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iteratorMethod = getIteratorMethod(O); + var i, length, result, thisIsBigIntArray, value, step, iterator, next; + if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { + iterator = getIterator(O, iteratorMethod); + next = iterator.next; + O = []; + while (!(step = call(next, iterator)).done) { + O.push(step.value); + } + } + if (mapping && argumentsLength > 2) { + mapfn = bind(mapfn, arguments[2]); + } + length = lengthOfArrayLike(O); + result = new (aTypedArrayConstructor(C))(length); + thisIsBigIntArray = isBigIntArray(result); + for (i = 0; length > i; i++) { + value = mapping ? mapfn(O[i], i) : O[i]; + // FF30- typed arrays doesn't properly convert objects to typed array values + result[i] = thisIsBigIntArray ? toBigInt(value) : +value; + } + return result; +}; + +},{"../internals/a-constructor":109,"../internals/array-buffer-view-core":117,"../internals/function-bind-context":175,"../internals/function-call":177,"../internals/get-iterator":184,"../internals/get-iterator-method":183,"../internals/is-array-iterator-method":200,"../internals/is-big-int-array":202,"../internals/length-of-array-like":219,"../internals/to-big-int":280,"../internals/to-object":285}],298:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var speciesConstructor = require('../internals/species-constructor'); + +var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor; +var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; + +// a part of `TypedArraySpeciesCreate` abstract operation +// https://tc39.es/ecma262/#typedarray-species-create +module.exports = function (originalArray) { + return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray))); +}; + +},{"../internals/array-buffer-view-core":117,"../internals/species-constructor":270}],299:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); + +var id = 0; +var postfix = Math.random(); +var toString = uncurryThis(1.0.toString); + +module.exports = function (key) { + return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); +}; + +},{"../internals/function-uncurry-this":181}],300:[function(require,module,exports){ +'use strict'; +/* eslint-disable es/no-symbol -- required for testing */ +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); + +module.exports = NATIVE_SYMBOL + && !Symbol.sham + && typeof Symbol.iterator == 'symbol'; + +},{"../internals/symbol-constructor-detection":274}],301:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var fails = require('../internals/fails'); + +// V8 ~ Chrome 36- +// https://bugs.chromium.org/p/v8/issues/detail?id=3334 +module.exports = DESCRIPTORS && fails(function () { + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + return Object.defineProperty(function () { /* empty */ }, 'prototype', { + value: 42, + writable: false + }).prototype !== 42; +}); + +},{"../internals/descriptors":153,"../internals/fails":171}],302:[function(require,module,exports){ +'use strict'; +var $TypeError = TypeError; + +module.exports = function (passed, required) { + if (passed < required) throw new $TypeError('Not enough arguments'); + return passed; +}; + +},{}],303:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var isCallable = require('../internals/is-callable'); + +var WeakMap = global.WeakMap; + +module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); + +},{"../internals/global":188,"../internals/is-callable":203}],304:[function(require,module,exports){ +'use strict'; +var path = require('../internals/path'); +var hasOwn = require('../internals/has-own-property'); +var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); +var defineProperty = require('../internals/object-define-property').f; + +module.exports = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME) + }); +}; + +},{"../internals/has-own-property":189,"../internals/object-define-property":231,"../internals/path":247,"../internals/well-known-symbol-wrapped":305}],305:[function(require,module,exports){ +'use strict'; +var wellKnownSymbol = require('../internals/well-known-symbol'); + +exports.f = wellKnownSymbol; + +},{"../internals/well-known-symbol":306}],306:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var shared = require('../internals/shared'); +var hasOwn = require('../internals/has-own-property'); +var uid = require('../internals/uid'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); +var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); + +var Symbol = global.Symbol; +var WellKnownSymbolsStore = shared('wks'); +var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; + +module.exports = function (name) { + if (!hasOwn(WellKnownSymbolsStore, name)) { + WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) + ? Symbol[name] + : createWellKnownSymbol('Symbol.' + name); + } return WellKnownSymbolsStore[name]; +}; + +},{"../internals/global":188,"../internals/has-own-property":189,"../internals/shared":269,"../internals/symbol-constructor-detection":274,"../internals/uid":299,"../internals/use-symbol-as-uid":300}],307:[function(require,module,exports){ +'use strict'; +// a string of all valid unicode whitespaces +module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + +},{}],308:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var arrayBufferModule = require('../internals/array-buffer'); +var setSpecies = require('../internals/set-species'); + +var ARRAY_BUFFER = 'ArrayBuffer'; +var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER]; +var NativeArrayBuffer = global[ARRAY_BUFFER]; + +// `ArrayBuffer` constructor +// https://tc39.es/ecma262/#sec-arraybuffer-constructor +$({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer }, { + ArrayBuffer: ArrayBuffer +}); + +setSpecies(ARRAY_BUFFER); + +},{"../internals/array-buffer":118,"../internals/export":170,"../internals/global":188,"../internals/set-species":265}],309:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); +var fails = require('../internals/fails'); +var ArrayBufferModule = require('../internals/array-buffer'); +var anObject = require('../internals/an-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toLength = require('../internals/to-length'); +var speciesConstructor = require('../internals/species-constructor'); + +var ArrayBuffer = ArrayBufferModule.ArrayBuffer; +var DataView = ArrayBufferModule.DataView; +var DataViewPrototype = DataView.prototype; +var nativeArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice); +var getUint8 = uncurryThis(DataViewPrototype.getUint8); +var setUint8 = uncurryThis(DataViewPrototype.setUint8); + +var INCORRECT_SLICE = fails(function () { + return !new ArrayBuffer(2).slice(1, undefined).byteLength; +}); + +// `ArrayBuffer.prototype.slice` method +// https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice +$({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { + slice: function slice(start, end) { + if (nativeArrayBufferSlice && end === undefined) { + return nativeArrayBufferSlice(anObject(this), start); // FF fix + } + var length = anObject(this).byteLength; + var first = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first)); + var viewSource = new DataView(this); + var viewTarget = new DataView(result); + var index = 0; + while (first < fin) { + setUint8(viewTarget, index++, getUint8(viewSource, first++)); + } return result; + } +}); + +},{"../internals/an-object":114,"../internals/array-buffer":118,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this-clause":180,"../internals/species-constructor":270,"../internals/to-absolute-index":279,"../internals/to-length":284}],310:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var fails = require('../internals/fails'); +var isArray = require('../internals/is-array'); +var isObject = require('../internals/is-object'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer'); +var createProperty = require('../internals/create-property'); +var arraySpeciesCreate = require('../internals/array-species-create'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var V8_VERSION = require('../internals/engine-v8-version'); + +var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); + +// We can't use this feature detection in V8 since it causes +// deoptimization and serious performance degradation +// https://github.com/zloirock/core-js/issues/679 +var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; +}); + +var isConcatSpreadable = function (O) { + if (!isObject(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); +}; + +var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport('concat'); + +// `Array.prototype.concat` method +// https://tc39.es/ecma262/#sec-array.prototype.concat +// with adding support of @@isConcatSpreadable and @@species +$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` + concat: function concat(arg) { + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments[i]; + if (isConcatSpreadable(E)) { + len = lengthOfArrayLike(E); + doesNotExceedSafeInteger(n + len); + for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); + } else { + doesNotExceedSafeInteger(n + 1); + createProperty(A, n++, E); + } + } + A.length = n; + return A; + } +}); + +},{"../internals/array-method-has-species-support":127,"../internals/array-species-create":134,"../internals/create-property":147,"../internals/does-not-exceed-safe-integer":155,"../internals/engine-v8-version":167,"../internals/export":170,"../internals/fails":171,"../internals/is-array":201,"../internals/is-object":208,"../internals/length-of-array-like":219,"../internals/to-object":285,"../internals/well-known-symbol":306}],311:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var fill = require('../internals/array-fill'); +var addToUnscopables = require('../internals/add-to-unscopables'); + +// `Array.prototype.fill` method +// https://tc39.es/ecma262/#sec-array.prototype.fill +$({ target: 'Array', proto: true }, { + fill: fill +}); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('fill'); + +},{"../internals/add-to-unscopables":111,"../internals/array-fill":120,"../internals/export":170}],312:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $filter = require('../internals/array-iteration').filter; +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); + +// `Array.prototype.filter` method +// https://tc39.es/ecma262/#sec-array.prototype.filter +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +},{"../internals/array-iteration":125,"../internals/array-method-has-species-support":127,"../internals/export":170}],313:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $find = require('../internals/array-iteration').find; +var addToUnscopables = require('../internals/add-to-unscopables'); + +var FIND = 'find'; +var SKIPS_HOLES = true; + +// Shouldn't skip holes +// eslint-disable-next-line es/no-array-prototype-find -- testing +if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); + +// `Array.prototype.find` method +// https://tc39.es/ecma262/#sec-array.prototype.find +$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables(FIND); + +},{"../internals/add-to-unscopables":111,"../internals/array-iteration":125,"../internals/export":170}],314:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var from = require('../internals/array-from'); +var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration'); + +var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { + // eslint-disable-next-line es/no-array-from -- required for testing + Array.from(iterable); +}); + +// `Array.from` method +// https://tc39.es/ecma262/#sec-array.from +$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { + from: from +}); + +},{"../internals/array-from":123,"../internals/check-correctness-of-iteration":136,"../internals/export":170}],315:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $includes = require('../internals/array-includes').includes; +var fails = require('../internals/fails'); +var addToUnscopables = require('../internals/add-to-unscopables'); + +// FF99+ bug +var BROKEN_ON_SPARSE = fails(function () { + // eslint-disable-next-line es/no-array-prototype-includes -- detection + return !Array(1).includes(); +}); + +// `Array.prototype.includes` method +// https://tc39.es/ecma262/#sec-array.prototype.includes +$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('includes'); + +},{"../internals/add-to-unscopables":111,"../internals/array-includes":124,"../internals/export":170,"../internals/fails":171}],316:[function(require,module,exports){ +'use strict'; +var toIndexedObject = require('../internals/to-indexed-object'); +var addToUnscopables = require('../internals/add-to-unscopables'); +var Iterators = require('../internals/iterators'); +var InternalStateModule = require('../internals/internal-state'); +var defineProperty = require('../internals/object-define-property').f; +var defineIterator = require('../internals/iterator-define'); +var createIterResultObject = require('../internals/create-iter-result-object'); +var IS_PURE = require('../internals/is-pure'); +var DESCRIPTORS = require('../internals/descriptors'); + +var ARRAY_ITERATOR = 'Array Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); + +// `Array.prototype.entries` method +// https://tc39.es/ecma262/#sec-array.prototype.entries +// `Array.prototype.keys` method +// https://tc39.es/ecma262/#sec-array.prototype.keys +// `Array.prototype.values` method +// https://tc39.es/ecma262/#sec-array.prototype.values +// `Array.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-array.prototype-@@iterator +// `CreateArrayIterator` internal method +// https://tc39.es/ecma262/#sec-createarrayiterator +module.exports = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), // target + index: 0, // next index + kind: kind // kind + }); +// `%ArrayIteratorPrototype%.next` method +// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next +}, function () { + var state = getInternalState(this); + var target = state.target; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return createIterResultObject(undefined, true); + } + switch (state.kind) { + case 'keys': return createIterResultObject(index, false); + case 'values': return createIterResultObject(target[index], false); + } return createIterResultObject([index, target[index]], false); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% +// https://tc39.es/ecma262/#sec-createunmappedargumentsobject +// https://tc39.es/ecma262/#sec-createmappedargumentsobject +var values = Iterators.Arguments = Iterators.Array; + +// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + +// V8 ~ Chrome 45- bug +if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try { + defineProperty(values, 'name', { value: 'values' }); +} catch (error) { /* empty */ } + +},{"../internals/add-to-unscopables":111,"../internals/create-iter-result-object":144,"../internals/descriptors":153,"../internals/internal-state":199,"../internals/is-pure":210,"../internals/iterator-define":216,"../internals/iterators":218,"../internals/object-define-property":231,"../internals/to-indexed-object":282}],317:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var IndexedObject = require('../internals/indexed-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); + +var nativeJoin = uncurryThis([].join); + +var ES3_STRINGS = IndexedObject !== Object; +var FORCED = ES3_STRINGS || !arrayMethodIsStrict('join', ','); + +// `Array.prototype.join` method +// https://tc39.es/ecma262/#sec-array.prototype.join +$({ target: 'Array', proto: true, forced: FORCED }, { + join: function join(separator) { + return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator); + } +}); + +},{"../internals/array-method-is-strict":128,"../internals/export":170,"../internals/function-uncurry-this":181,"../internals/indexed-object":195,"../internals/to-indexed-object":282}],318:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $map = require('../internals/array-iteration').map; +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); + +// `Array.prototype.map` method +// https://tc39.es/ecma262/#sec-array.prototype.map +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +},{"../internals/array-iteration":125,"../internals/array-method-has-species-support":127,"../internals/export":170}],319:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var isArray = require('../internals/is-array'); +var isConstructor = require('../internals/is-constructor'); +var isObject = require('../internals/is-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var toIndexedObject = require('../internals/to-indexed-object'); +var createProperty = require('../internals/create-property'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); +var nativeSlice = require('../internals/array-slice'); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); + +var SPECIES = wellKnownSymbol('species'); +var $Array = Array; +var max = Math.max; + +// `Array.prototype.slice` method +// https://tc39.es/ecma262/#sec-array.prototype.slice +// fallback for not array-like ES3 strings and DOM objects +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = lengthOfArrayLike(O); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, result, n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES]; + if (Constructor === null) Constructor = undefined; + } + if (Constructor === $Array || Constructor === undefined) { + return nativeSlice(O, k, fin); + } + } + result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0)); + for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); + result.length = n; + return result; + } +}); + +},{"../internals/array-method-has-species-support":127,"../internals/array-slice":131,"../internals/create-property":147,"../internals/export":170,"../internals/is-array":201,"../internals/is-constructor":204,"../internals/is-object":208,"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-indexed-object":282,"../internals/well-known-symbol":306}],320:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var aCallable = require('../internals/a-callable'); +var toObject = require('../internals/to-object'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var deletePropertyOrThrow = require('../internals/delete-property-or-throw'); +var toString = require('../internals/to-string'); +var fails = require('../internals/fails'); +var internalSort = require('../internals/array-sort'); +var arrayMethodIsStrict = require('../internals/array-method-is-strict'); +var FF = require('../internals/engine-ff-version'); +var IE_OR_EDGE = require('../internals/engine-is-ie-or-edge'); +var V8 = require('../internals/engine-v8-version'); +var WEBKIT = require('../internals/engine-webkit-version'); + +var test = []; +var nativeSort = uncurryThis(test.sort); +var push = uncurryThis(test.push); + +// IE8- +var FAILS_ON_UNDEFINED = fails(function () { + test.sort(undefined); +}); +// V8 bug +var FAILS_ON_NULL = fails(function () { + test.sort(null); +}); +// Old WebKit +var STRICT_METHOD = arrayMethodIsStrict('sort'); + +var STABLE_SORT = !fails(function () { + // feature detection can be too slow, so check engines versions + if (V8) return V8 < 70; + if (FF && FF > 3) return; + if (IE_OR_EDGE) return true; + if (WEBKIT) return WEBKIT < 603; + + var result = ''; + var code, chr, value, index; + + // generate an array with more 512 elements (Chakra and old V8 fails only in this case) + for (code = 65; code < 76; code++) { + chr = String.fromCharCode(code); + + switch (code) { + case 66: case 69: case 70: case 72: value = 3; break; + case 68: case 71: value = 4; break; + default: value = 2; + } + + for (index = 0; index < 47; index++) { + test.push({ k: chr + index, v: value }); + } + } + + test.sort(function (a, b) { return b.v - a.v; }); + + for (index = 0; index < test.length; index++) { + chr = test[index].k.charAt(0); + if (result.charAt(result.length - 1) !== chr) result += chr; + } + + return result !== 'DGBEFHACIJK'; +}); + +var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT; + +var getSortCompare = function (comparefn) { + return function (x, y) { + if (y === undefined) return -1; + if (x === undefined) return 1; + if (comparefn !== undefined) return +comparefn(x, y) || 0; + return toString(x) > toString(y) ? 1 : -1; + }; +}; + +// `Array.prototype.sort` method +// https://tc39.es/ecma262/#sec-array.prototype.sort +$({ target: 'Array', proto: true, forced: FORCED }, { + sort: function sort(comparefn) { + if (comparefn !== undefined) aCallable(comparefn); + + var array = toObject(this); + + if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn); + + var items = []; + var arrayLength = lengthOfArrayLike(array); + var itemsLength, index; + + for (index = 0; index < arrayLength; index++) { + if (index in array) push(items, array[index]); + } + + internalSort(items, getSortCompare(comparefn)); + + itemsLength = lengthOfArrayLike(items); + index = 0; + + while (index < itemsLength) array[index] = items[index++]; + while (index < arrayLength) deletePropertyOrThrow(array, index++); + + return array; + } +}); + +},{"../internals/a-callable":108,"../internals/array-method-is-strict":128,"../internals/array-sort":132,"../internals/delete-property-or-throw":152,"../internals/engine-ff-version":158,"../internals/engine-is-ie-or-edge":161,"../internals/engine-v8-version":167,"../internals/engine-webkit-version":168,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/length-of-array-like":219,"../internals/to-object":285,"../internals/to-string":291}],321:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var toObject = require('../internals/to-object'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var setArrayLength = require('../internals/array-set-length'); +var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer'); +var arraySpeciesCreate = require('../internals/array-species-create'); +var createProperty = require('../internals/create-property'); +var deletePropertyOrThrow = require('../internals/delete-property-or-throw'); +var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); + +var max = Math.max; +var min = Math.min; + +// `Array.prototype.splice` method +// https://tc39.es/ecma262/#sec-array.prototype.splice +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { + splice: function splice(start, deleteCount /* , ...items */) { + var O = toObject(this); + var len = lengthOfArrayLike(O); + var actualStart = toAbsoluteIndex(start, len); + var argumentsLength = arguments.length; + var insertCount, actualDeleteCount, A, k, from, to; + if (argumentsLength === 0) { + insertCount = actualDeleteCount = 0; + } else if (argumentsLength === 1) { + insertCount = 0; + actualDeleteCount = len - actualStart; + } else { + insertCount = argumentsLength - 2; + actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); + } + doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); + A = arraySpeciesCreate(O, actualDeleteCount); + for (k = 0; k < actualDeleteCount; k++) { + from = actualStart + k; + if (from in O) createProperty(A, k, O[from]); + } + A.length = actualDeleteCount; + if (insertCount < actualDeleteCount) { + for (k = actualStart; k < len - actualDeleteCount; k++) { + from = k + actualDeleteCount; + to = k + insertCount; + if (from in O) O[to] = O[from]; + else deletePropertyOrThrow(O, to); + } + for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1); + } else if (insertCount > actualDeleteCount) { + for (k = len - actualDeleteCount; k > actualStart; k--) { + from = k + actualDeleteCount - 1; + to = k + insertCount - 1; + if (from in O) O[to] = O[from]; + else deletePropertyOrThrow(O, to); + } + } + for (k = 0; k < insertCount; k++) { + O[k + actualStart] = arguments[k + 2]; + } + setArrayLength(O, len - actualDeleteCount + insertCount); + return A; + } +}); + +},{"../internals/array-method-has-species-support":127,"../internals/array-set-length":130,"../internals/array-species-create":134,"../internals/create-property":147,"../internals/delete-property-or-throw":152,"../internals/does-not-exceed-safe-integer":155,"../internals/export":170,"../internals/length-of-array-like":219,"../internals/to-absolute-index":279,"../internals/to-integer-or-infinity":283,"../internals/to-object":285}],322:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var FUNCTION_NAME_EXISTS = require('../internals/function-name').EXISTS; +var uncurryThis = require('../internals/function-uncurry-this'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); + +var FunctionPrototype = Function.prototype; +var functionToString = uncurryThis(FunctionPrototype.toString); +var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/; +var regExpExec = uncurryThis(nameRE.exec); +var NAME = 'name'; + +// Function instances `.name` property +// https://tc39.es/ecma262/#sec-function-instances-name +if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { + defineBuiltInAccessor(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return regExpExec(nameRE, functionToString(this))[1]; + } catch (error) { + return ''; + } + } + }); +} + +},{"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/function-name":178,"../internals/function-uncurry-this":181}],323:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var apply = require('../internals/function-apply'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); +var isCallable = require('../internals/is-callable'); +var isSymbol = require('../internals/is-symbol'); +var arraySlice = require('../internals/array-slice'); +var getReplacerFunction = require('../internals/get-json-replacer-function'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); + +var $String = String; +var $stringify = getBuiltIn('JSON', 'stringify'); +var exec = uncurryThis(/./.exec); +var charAt = uncurryThis(''.charAt); +var charCodeAt = uncurryThis(''.charCodeAt); +var replace = uncurryThis(''.replace); +var numberToString = uncurryThis(1.0.toString); + +var tester = /[\uD800-\uDFFF]/g; +var low = /^[\uD800-\uDBFF]$/; +var hi = /^[\uDC00-\uDFFF]$/; + +var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () { + var symbol = getBuiltIn('Symbol')('stringify detection'); + // MS Edge converts symbol values to JSON as {} + return $stringify([symbol]) !== '[null]' + // WebKit converts symbol values to JSON as null + || $stringify({ a: symbol }) !== '{}' + // V8 throws on boxed symbols + || $stringify(Object(symbol)) !== '{}'; +}); + +// https://github.com/tc39/proposal-well-formed-stringify +var ILL_FORMED_UNICODE = fails(function () { + return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' + || $stringify('\uDEAD') !== '"\\udead"'; +}); + +var stringifyWithSymbolsFix = function (it, replacer) { + var args = arraySlice(arguments); + var $replacer = getReplacerFunction(replacer); + if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined + args[1] = function (key, value) { + // some old implementations (like WebKit) could pass numbers as keys + if (isCallable($replacer)) value = call($replacer, this, $String(key), value); + if (!isSymbol(value)) return value; + }; + return apply($stringify, null, args); +}; + +var fixIllFormed = function (match, offset, string) { + var prev = charAt(string, offset - 1); + var next = charAt(string, offset + 1); + if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) { + return '\\u' + numberToString(charCodeAt(match, 0), 16); + } return match; +}; + +if ($stringify) { + // `JSON.stringify` method + // https://tc39.es/ecma262/#sec-json.stringify + $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, { + // eslint-disable-next-line no-unused-vars -- required for `.length` + stringify: function stringify(it, replacer, space) { + var args = arraySlice(arguments); + var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args); + return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result; + } + }); +} + +},{"../internals/array-slice":131,"../internals/export":170,"../internals/fails":171,"../internals/function-apply":174,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/get-built-in":182,"../internals/get-json-replacer-function":185,"../internals/is-callable":203,"../internals/is-symbol":212,"../internals/symbol-constructor-detection":274}],324:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var path = require('../internals/path'); +var uncurryThis = require('../internals/function-uncurry-this'); +var isForced = require('../internals/is-forced'); +var hasOwn = require('../internals/has-own-property'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var isSymbol = require('../internals/is-symbol'); +var toPrimitive = require('../internals/to-primitive'); +var fails = require('../internals/fails'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var defineProperty = require('../internals/object-define-property').f; +var thisNumberValue = require('../internals/this-number-value'); +var trim = require('../internals/string-trim').trim; + +var NUMBER = 'Number'; +var NativeNumber = global[NUMBER]; +var PureNumberNamespace = path[NUMBER]; +var NumberPrototype = NativeNumber.prototype; +var TypeError = global.TypeError; +var stringSlice = uncurryThis(''.slice); +var charCodeAt = uncurryThis(''.charCodeAt); + +// `ToNumeric` abstract operation +// https://tc39.es/ecma262/#sec-tonumeric +var toNumeric = function (value) { + var primValue = toPrimitive(value, 'number'); + return typeof primValue == 'bigint' ? primValue : toNumber(primValue); +}; + +// `ToNumber` abstract operation +// https://tc39.es/ecma262/#sec-tonumber +var toNumber = function (argument) { + var it = toPrimitive(argument, 'number'); + var first, third, radix, maxCode, digits, length, index, code; + if (isSymbol(it)) throw new TypeError('Cannot convert a Symbol value to a number'); + if (typeof it == 'string' && it.length > 2) { + it = trim(it); + first = charCodeAt(it, 0); + if (first === 43 || first === 45) { + third = charCodeAt(it, 2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (charCodeAt(it, 1)) { + // fast equal of /^0b[01]+$/i + case 66: + case 98: + radix = 2; + maxCode = 49; + break; + // fast equal of /^0o[0-7]+$/i + case 79: + case 111: + radix = 8; + maxCode = 55; + break; + default: + return +it; + } + digits = stringSlice(it, 2); + length = digits.length; + for (index = 0; index < length; index++) { + code = charCodeAt(digits, index); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +var FORCED = isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1')); + +var calledWithNew = function (dummy) { + // includes check on 1..constructor(foo) case + return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); }); +}; + +// `Number` constructor +// https://tc39.es/ecma262/#sec-number-constructor +var NumberWrapper = function Number(value) { + var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); + return calledWithNew(this) ? inheritIfRequired(Object(n), this, NumberWrapper) : n; +}; + +NumberWrapper.prototype = NumberPrototype; +if (FORCED && !IS_PURE) NumberPrototype.constructor = NumberWrapper; + +$({ global: true, constructor: true, wrap: true, forced: FORCED }, { + Number: NumberWrapper +}); + +// Use `internal/copy-constructor-properties` helper in `core-js@4` +var copyConstructorProperties = function (target, source) { + for (var keys = DESCRIPTORS ? getOwnPropertyNames(source) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES2015 (in case, if modules with ES2015 Number statics required before): + 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + + // ESNext + 'fromString,range' + ).split(','), j = 0, key; keys.length > j; j++) { + if (hasOwn(source, key = keys[j]) && !hasOwn(target, key)) { + defineProperty(target, key, getOwnPropertyDescriptor(source, key)); + } + } +}; + +if (IS_PURE && PureNumberNamespace) copyConstructorProperties(path[NUMBER], PureNumberNamespace); +if (FORCED || IS_PURE) copyConstructorProperties(path[NUMBER], NativeNumber); + +},{"../internals/descriptors":153,"../internals/export":170,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/inherit-if-required":196,"../internals/is-forced":205,"../internals/is-pure":210,"../internals/is-symbol":212,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/object-get-own-property-names":234,"../internals/object-is-prototype-of":238,"../internals/path":247,"../internals/string-trim":273,"../internals/this-number-value":278,"../internals/to-primitive":288}],325:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var assign = require('../internals/object-assign'); + +// `Object.assign` method +// https://tc39.es/ecma262/#sec-object.assign +// eslint-disable-next-line es/no-object-assign -- required for testing +$({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, { + assign: assign +}); + +},{"../internals/export":170,"../internals/object-assign":228}],326:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $entries = require('../internals/object-to-array').entries; + +// `Object.entries` method +// https://tc39.es/ecma262/#sec-object.entries +$({ target: 'Object', stat: true }, { + entries: function entries(O) { + return $entries(O); + } +}); + +},{"../internals/export":170,"../internals/object-to-array":243}],327:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); +var fails = require('../internals/fails'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var toObject = require('../internals/to-object'); + +// V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 +var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); }); + +// `Object.getOwnPropertySymbols` method +// https://tc39.es/ecma262/#sec-object.getownpropertysymbols +$({ target: 'Object', stat: true, forced: FORCED }, { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : []; + } +}); + +},{"../internals/export":170,"../internals/fails":171,"../internals/object-get-own-property-symbols":235,"../internals/symbol-constructor-detection":274,"../internals/to-object":285}],328:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var toObject = require('../internals/to-object'); +var nativeKeys = require('../internals/object-keys'); +var fails = require('../internals/fails'); + +var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); + +// `Object.keys` method +// https://tc39.es/ecma262/#sec-object.keys +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + keys: function keys(it) { + return nativeKeys(toObject(it)); + } +}); + +},{"../internals/export":170,"../internals/fails":171,"../internals/object-keys":240,"../internals/to-object":285}],329:[function(require,module,exports){ +'use strict'; +var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); +var defineBuiltIn = require('../internals/define-built-in'); +var toString = require('../internals/object-to-string'); + +// `Object.prototype.toString` method +// https://tc39.es/ecma262/#sec-object.prototype.tostring +if (!TO_STRING_TAG_SUPPORT) { + defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true }); +} + +},{"../internals/define-built-in":149,"../internals/object-to-string":244,"../internals/to-string-tag-support":290}],330:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var call = require('../internals/function-call'); +var aCallable = require('../internals/a-callable'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); +var iterate = require('../internals/iterate'); +var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); + +// `Promise.all` method +// https://tc39.es/ecma262/#sec-promise.all +$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { + all: function all(iterable) { + var C = this; + var capability = newPromiseCapabilityModule.f(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aCallable(C.resolve); + var values = []; + var counter = 0; + var remaining = 1; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyCalled = false; + remaining++; + call($promiseResolve, C, promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.error) reject(result.value); + return capability.promise; + } +}); + +},{"../internals/a-callable":108,"../internals/export":170,"../internals/function-call":177,"../internals/iterate":213,"../internals/new-promise-capability":226,"../internals/perform":248,"../internals/promise-statics-incorrect-iteration":252}],331:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var getBuiltIn = require('../internals/get-built-in'); +var isCallable = require('../internals/is-callable'); +var defineBuiltIn = require('../internals/define-built-in'); + +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; + +// `Promise.prototype.catch` method +// https://tc39.es/ecma262/#sec-promise.prototype.catch +$({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, { + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } +}); + +// makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` +if (!IS_PURE && isCallable(NativePromiseConstructor)) { + var method = getBuiltIn('Promise').prototype['catch']; + if (NativePromisePrototype['catch'] !== method) { + defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true }); + } +} + +},{"../internals/define-built-in":149,"../internals/export":170,"../internals/get-built-in":182,"../internals/is-callable":203,"../internals/is-pure":210,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250}],332:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var IS_PURE = require('../internals/is-pure'); +var IS_NODE = require('../internals/engine-is-node'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var defineBuiltIn = require('../internals/define-built-in'); +var setPrototypeOf = require('../internals/object-set-prototype-of'); +var setToStringTag = require('../internals/set-to-string-tag'); +var setSpecies = require('../internals/set-species'); +var aCallable = require('../internals/a-callable'); +var isCallable = require('../internals/is-callable'); +var isObject = require('../internals/is-object'); +var anInstance = require('../internals/an-instance'); +var speciesConstructor = require('../internals/species-constructor'); +var task = require('../internals/task').set; +var microtask = require('../internals/microtask'); +var hostReportErrors = require('../internals/host-report-errors'); +var perform = require('../internals/perform'); +var Queue = require('../internals/queue'); +var InternalStateModule = require('../internals/internal-state'); +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var PromiseConstructorDetection = require('../internals/promise-constructor-detection'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); + +var PROMISE = 'Promise'; +var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR; +var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT; +var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING; +var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); +var setInternalState = InternalStateModule.set; +var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype; +var PromiseConstructor = NativePromiseConstructor; +var PromisePrototype = NativePromisePrototype; +var TypeError = global.TypeError; +var document = global.document; +var process = global.process; +var newPromiseCapability = newPromiseCapabilityModule.f; +var newGenericPromiseCapability = newPromiseCapability; + +var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); +var UNHANDLED_REJECTION = 'unhandledrejection'; +var REJECTION_HANDLED = 'rejectionhandled'; +var PENDING = 0; +var FULFILLED = 1; +var REJECTED = 2; +var HANDLED = 1; +var UNHANDLED = 2; + +var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && isCallable(then = it.then) ? then : false; +}; + +var callReaction = function (reaction, state) { + var value = state.value; + var ok = state.state === FULFILLED; + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (state.rejection === UNHANDLED) onHandleUnhandled(state); + state.rejection = HANDLED; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // can throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(new TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + call(then, result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (error) { + if (domain && !exited) domain.exit(); + reject(error); + } +}; + +var notify = function (state, isReject) { + if (state.notified) return; + state.notified = true; + microtask(function () { + var reactions = state.reactions; + var reaction; + while (reaction = reactions.get()) { + callReaction(reaction, state); + } + state.notified = false; + if (isReject && !state.rejection) onUnhandled(state); + }); +}; + +var dispatchEvent = function (name, promise, reason) { + var event, handler; + if (DISPATCH_EVENT) { + event = document.createEvent('Event'); + event.promise = promise; + event.reason = reason; + event.initEvent(name, false, true); + global.dispatchEvent(event); + } else event = { promise: promise, reason: reason }; + if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event); + else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); +}; + +var onUnhandled = function (state) { + call(task, global, function () { + var promise = state.facade; + var value = state.value; + var IS_UNHANDLED = isUnhandled(state); + var result; + if (IS_UNHANDLED) { + result = perform(function () { + if (IS_NODE) { + process.emit('unhandledRejection', value, promise); + } else dispatchEvent(UNHANDLED_REJECTION, promise, value); + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; + if (result.error) throw result.value; + } + }); +}; + +var isUnhandled = function (state) { + return state.rejection !== HANDLED && !state.parent; +}; + +var onHandleUnhandled = function (state) { + call(task, global, function () { + var promise = state.facade; + if (IS_NODE) { + process.emit('rejectionHandled', promise); + } else dispatchEvent(REJECTION_HANDLED, promise, state.value); + }); +}; + +var bind = function (fn, state, unwrap) { + return function (value) { + fn(state, value, unwrap); + }; +}; + +var internalReject = function (state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + state.value = value; + state.state = REJECTED; + notify(state, true); +}; + +var internalResolve = function (state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + try { + if (state.facade === value) throw new TypeError("Promise can't be resolved itself"); + var then = isThenable(value); + if (then) { + microtask(function () { + var wrapper = { done: false }; + try { + call(then, value, + bind(internalResolve, wrapper, state), + bind(internalReject, wrapper, state) + ); + } catch (error) { + internalReject(wrapper, error, state); + } + }); + } else { + state.value = value; + state.state = FULFILLED; + notify(state, false); + } + } catch (error) { + internalReject({ done: false }, error, state); + } +}; + +// constructor polyfill +if (FORCED_PROMISE_CONSTRUCTOR) { + // 25.4.3.1 Promise(executor) + PromiseConstructor = function Promise(executor) { + anInstance(this, PromisePrototype); + aCallable(executor); + call(Internal, this); + var state = getInternalPromiseState(this); + try { + executor(bind(internalResolve, state), bind(internalReject, state)); + } catch (error) { + internalReject(state, error); + } + }; + + PromisePrototype = PromiseConstructor.prototype; + + // eslint-disable-next-line no-unused-vars -- required for `.length` + Internal = function Promise(executor) { + setInternalState(this, { + type: PROMISE, + done: false, + notified: false, + parent: false, + reactions: new Queue(), + rejection: false, + state: PENDING, + value: undefined + }); + }; + + // `Promise.prototype.then` method + // https://tc39.es/ecma262/#sec-promise.prototype.then + Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) { + var state = getInternalPromiseState(this); + var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); + state.parent = true; + reaction.ok = isCallable(onFulfilled) ? onFulfilled : true; + reaction.fail = isCallable(onRejected) && onRejected; + reaction.domain = IS_NODE ? process.domain : undefined; + if (state.state === PENDING) state.reactions.add(reaction); + else microtask(function () { + callReaction(reaction, state); + }); + return reaction.promise; + }); + + OwnPromiseCapability = function () { + var promise = new Internal(); + var state = getInternalPromiseState(promise); + this.promise = promise; + this.resolve = bind(internalResolve, state); + this.reject = bind(internalReject, state); + }; + + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === PromiseConstructor || C === PromiseWrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; + + if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) { + nativeThen = NativePromisePrototype.then; + + if (!NATIVE_PROMISE_SUBCLASSING) { + // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs + defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { + var that = this; + return new PromiseConstructor(function (resolve, reject) { + call(nativeThen, that, resolve, reject); + }).then(onFulfilled, onRejected); + // https://github.com/zloirock/core-js/issues/640 + }, { unsafe: true }); + } + + // make `.constructor === Promise` work for native promise-based APIs + try { + delete NativePromisePrototype.constructor; + } catch (error) { /* empty */ } + + // make `instanceof Promise` work for native promise-based APIs + if (setPrototypeOf) { + setPrototypeOf(NativePromisePrototype, PromisePrototype); + } + } +} + +$({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { + Promise: PromiseConstructor +}); + +setToStringTag(PromiseConstructor, PROMISE, false, true); +setSpecies(PROMISE); + +},{"../internals/a-callable":108,"../internals/an-instance":113,"../internals/define-built-in":149,"../internals/engine-is-node":164,"../internals/export":170,"../internals/function-call":177,"../internals/global":188,"../internals/host-report-errors":191,"../internals/internal-state":199,"../internals/is-callable":203,"../internals/is-object":208,"../internals/is-pure":210,"../internals/microtask":225,"../internals/new-promise-capability":226,"../internals/object-set-prototype-of":242,"../internals/perform":248,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250,"../internals/queue":254,"../internals/set-species":265,"../internals/set-to-string-tag":266,"../internals/species-constructor":270,"../internals/task":277}],333:[function(require,module,exports){ +'use strict'; +// TODO: Remove this module from `core-js@4` since it's split to modules listed below +require('../modules/es.promise.constructor'); +require('../modules/es.promise.all'); +require('../modules/es.promise.catch'); +require('../modules/es.promise.race'); +require('../modules/es.promise.reject'); +require('../modules/es.promise.resolve'); + +},{"../modules/es.promise.all":330,"../modules/es.promise.catch":331,"../modules/es.promise.constructor":332,"../modules/es.promise.race":334,"../modules/es.promise.reject":335,"../modules/es.promise.resolve":336}],334:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var call = require('../internals/function-call'); +var aCallable = require('../internals/a-callable'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var perform = require('../internals/perform'); +var iterate = require('../internals/iterate'); +var PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration'); + +// `Promise.race` method +// https://tc39.es/ecma262/#sec-promise.race +$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, { + race: function race(iterable) { + var C = this; + var capability = newPromiseCapabilityModule.f(C); + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aCallable(C.resolve); + iterate(iterable, function (promise) { + call($promiseResolve, C, promise).then(capability.resolve, reject); + }); + }); + if (result.error) reject(result.value); + return capability.promise; + } +}); + +},{"../internals/a-callable":108,"../internals/export":170,"../internals/function-call":177,"../internals/iterate":213,"../internals/new-promise-capability":226,"../internals/perform":248,"../internals/promise-statics-incorrect-iteration":252}],335:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var newPromiseCapabilityModule = require('../internals/new-promise-capability'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; + +// `Promise.reject` method +// https://tc39.es/ecma262/#sec-promise.reject +$({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, { + reject: function reject(r) { + var capability = newPromiseCapabilityModule.f(this); + var capabilityReject = capability.reject; + capabilityReject(r); + return capability.promise; + } +}); + +},{"../internals/export":170,"../internals/new-promise-capability":226,"../internals/promise-constructor-detection":249}],336:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var IS_PURE = require('../internals/is-pure'); +var NativePromiseConstructor = require('../internals/promise-native-constructor'); +var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR; +var promiseResolve = require('../internals/promise-resolve'); + +var PromiseConstructorWrapper = getBuiltIn('Promise'); +var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR; + +// `Promise.resolve` method +// https://tc39.es/ecma262/#sec-promise.resolve +$({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, { + resolve: function resolve(x) { + return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x); + } +}); + +},{"../internals/export":170,"../internals/get-built-in":182,"../internals/is-pure":210,"../internals/promise-constructor-detection":249,"../internals/promise-native-constructor":250,"../internals/promise-resolve":251}],337:[function(require,module,exports){ +'use strict'; +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var isForced = require('../internals/is-forced'); +var inheritIfRequired = require('../internals/inherit-if-required'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var create = require('../internals/object-create'); +var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var isRegExp = require('../internals/is-regexp'); +var toString = require('../internals/to-string'); +var getRegExpFlags = require('../internals/regexp-get-flags'); +var stickyHelpers = require('../internals/regexp-sticky-helpers'); +var proxyAccessor = require('../internals/proxy-accessor'); +var defineBuiltIn = require('../internals/define-built-in'); +var fails = require('../internals/fails'); +var hasOwn = require('../internals/has-own-property'); +var enforceInternalState = require('../internals/internal-state').enforce; +var setSpecies = require('../internals/set-species'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var UNSUPPORTED_DOT_ALL = require('../internals/regexp-unsupported-dot-all'); +var UNSUPPORTED_NCG = require('../internals/regexp-unsupported-ncg'); + +var MATCH = wellKnownSymbol('match'); +var NativeRegExp = global.RegExp; +var RegExpPrototype = NativeRegExp.prototype; +var SyntaxError = global.SyntaxError; +var exec = uncurryThis(RegExpPrototype.exec); +var charAt = uncurryThis(''.charAt); +var replace = uncurryThis(''.replace); +var stringIndexOf = uncurryThis(''.indexOf); +var stringSlice = uncurryThis(''.slice); +// TODO: Use only proper RegExpIdentifierName +var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/; +var re1 = /a/g; +var re2 = /a/g; + +// "new" should create a new object, old webkit bug +var CORRECT_NEW = new NativeRegExp(re1) !== re1; + +var MISSED_STICKY = stickyHelpers.MISSED_STICKY; +var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; + +var BASE_FORCED = DESCRIPTORS && + (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function () { + re2[MATCH] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, 'i')) !== '/a/i'; + })); + +var handleDotAll = function (string) { + var length = string.length; + var index = 0; + var result = ''; + var brackets = false; + var chr; + for (; index <= length; index++) { + chr = charAt(string, index); + if (chr === '\\') { + result += chr + charAt(string, ++index); + continue; + } + if (!brackets && chr === '.') { + result += '[\\s\\S]'; + } else { + if (chr === '[') { + brackets = true; + } else if (chr === ']') { + brackets = false; + } result += chr; + } + } return result; +}; + +var handleNCG = function (string) { + var length = string.length; + var index = 0; + var result = ''; + var named = []; + var names = create(null); + var brackets = false; + var ncg = false; + var groupid = 0; + var groupname = ''; + var chr; + for (; index <= length; index++) { + chr = charAt(string, index); + if (chr === '\\') { + chr += charAt(string, ++index); + } else if (chr === ']') { + brackets = false; + } else if (!brackets) switch (true) { + case chr === '[': + brackets = true; + break; + case chr === '(': + if (exec(IS_NCG, stringSlice(string, index + 1))) { + index += 2; + ncg = true; + } + result += chr; + groupid++; + continue; + case chr === '>' && ncg: + if (groupname === '' || hasOwn(names, groupname)) { + throw new SyntaxError('Invalid capture group name'); + } + names[groupname] = true; + named[named.length] = [groupname, groupid]; + ncg = false; + groupname = ''; + continue; + } + if (ncg) groupname += chr; + else result += chr; + } return [result, named]; +}; + +// `RegExp` constructor +// https://tc39.es/ecma262/#sec-regexp-constructor +if (isForced('RegExp', BASE_FORCED)) { + var RegExpWrapper = function RegExp(pattern, flags) { + var thisIsRegExp = isPrototypeOf(RegExpPrototype, this); + var patternIsRegExp = isRegExp(pattern); + var flagsAreUndefined = flags === undefined; + var groups = []; + var rawPattern = pattern; + var rawFlags, dotAll, sticky, handled, result, state; + + if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) { + return pattern; + } + + if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) { + pattern = pattern.source; + if (flagsAreUndefined) flags = getRegExpFlags(rawPattern); + } + + pattern = pattern === undefined ? '' : toString(pattern); + flags = flags === undefined ? '' : toString(flags); + rawPattern = pattern; + + if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) { + dotAll = !!flags && stringIndexOf(flags, 's') > -1; + if (dotAll) flags = replace(flags, /s/g, ''); + } + + rawFlags = flags; + + if (MISSED_STICKY && 'sticky' in re1) { + sticky = !!flags && stringIndexOf(flags, 'y') > -1; + if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, ''); + } + + if (UNSUPPORTED_NCG) { + handled = handleNCG(pattern); + pattern = handled[0]; + groups = handled[1]; + } + + result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); + + if (dotAll || sticky || groups.length) { + state = enforceInternalState(result); + if (dotAll) { + state.dotAll = true; + state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags); + } + if (sticky) state.sticky = true; + if (groups.length) state.groups = groups; + } + + if (pattern !== rawPattern) try { + // fails in old engines, but we have no alternatives for unsupported regex syntax + createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern); + } catch (error) { /* empty */ } + + return result; + }; + + for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) { + proxyAccessor(RegExpWrapper, NativeRegExp, keys[index++]); + } + + RegExpPrototype.constructor = RegExpWrapper; + RegExpWrapper.prototype = RegExpPrototype; + defineBuiltIn(global, 'RegExp', RegExpWrapper, { constructor: true }); +} + +// https://tc39.es/ecma262/#sec-get-regexp-@@species +setSpecies('RegExp'); + +},{"../internals/create-non-enumerable-property":145,"../internals/define-built-in":149,"../internals/descriptors":153,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/inherit-if-required":196,"../internals/internal-state":199,"../internals/is-forced":205,"../internals/is-regexp":211,"../internals/object-create":229,"../internals/object-get-own-property-names":234,"../internals/object-is-prototype-of":238,"../internals/proxy-accessor":253,"../internals/regexp-get-flags":258,"../internals/regexp-sticky-helpers":259,"../internals/regexp-unsupported-dot-all":260,"../internals/regexp-unsupported-ncg":261,"../internals/set-species":265,"../internals/to-string":291,"../internals/well-known-symbol":306}],338:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var exec = require('../internals/regexp-exec'); + +// `RegExp.prototype.exec` method +// https://tc39.es/ecma262/#sec-regexp.prototype.exec +$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { + exec: exec +}); + +},{"../internals/export":170,"../internals/regexp-exec":256}],339:[function(require,module,exports){ +'use strict'; +var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER; +var defineBuiltIn = require('../internals/define-built-in'); +var anObject = require('../internals/an-object'); +var $toString = require('../internals/to-string'); +var fails = require('../internals/fails'); +var getRegExpFlags = require('../internals/regexp-get-flags'); + +var TO_STRING = 'toString'; +var RegExpPrototype = RegExp.prototype; +var nativeToString = RegExpPrototype[TO_STRING]; + +var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; }); +// FF44- RegExp#toString has a wrong name +var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING; + +// `RegExp.prototype.toString` method +// https://tc39.es/ecma262/#sec-regexp.prototype.tostring +if (NOT_GENERIC || INCORRECT_NAME) { + defineBuiltIn(RegExpPrototype, TO_STRING, function toString() { + var R = anObject(this); + var pattern = $toString(R.source); + var flags = $toString(getRegExpFlags(R)); + return '/' + pattern + '/' + flags; + }, { unsafe: true }); +} + +},{"../internals/an-object":114,"../internals/define-built-in":149,"../internals/fails":171,"../internals/function-name":178,"../internals/regexp-get-flags":258,"../internals/to-string":291}],340:[function(require,module,exports){ +'use strict'; +var collection = require('../internals/collection'); +var collectionStrong = require('../internals/collection-strong'); + +// `Set` constructor +// https://tc39.es/ecma262/#sec-set-objects +collection('Set', function (init) { + return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong); + +},{"../internals/collection":140,"../internals/collection-strong":139}],341:[function(require,module,exports){ +'use strict'; +// TODO: Remove this module from `core-js@4` since it's replaced to module below +require('../modules/es.set.constructor'); + +},{"../modules/es.set.constructor":340}],342:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this'); +var notARegExp = require('../internals/not-a-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var toString = require('../internals/to-string'); +var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); + +var stringIndexOf = uncurryThis(''.indexOf); + +// `String.prototype.includes` method +// https://tc39.es/ecma262/#sec-string.prototype.includes +$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { + includes: function includes(searchString /* , position = 0 */) { + return !!~stringIndexOf( + toString(requireObjectCoercible(this)), + toString(notARegExp(searchString)), + arguments.length > 1 ? arguments[1] : undefined + ); + } +}); + +},{"../internals/correct-is-regexp-logic":142,"../internals/export":170,"../internals/function-uncurry-this":181,"../internals/not-a-regexp":227,"../internals/require-object-coercible":262,"../internals/to-string":291}],343:[function(require,module,exports){ +'use strict'; +var charAt = require('../internals/string-multibyte').charAt; +var toString = require('../internals/to-string'); +var InternalStateModule = require('../internals/internal-state'); +var defineIterator = require('../internals/iterator-define'); +var createIterResultObject = require('../internals/create-iter-result-object'); + +var STRING_ITERATOR = 'String Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); + +// `String.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-string.prototype-@@iterator +defineIterator(String, 'String', function (iterated) { + setInternalState(this, { + type: STRING_ITERATOR, + string: toString(iterated), + index: 0 + }); +// `%StringIteratorPrototype%.next` method +// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next +}, function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return createIterResultObject(undefined, true); + point = charAt(string, index); + state.index += point.length; + return createIterResultObject(point, false); +}); + +},{"../internals/create-iter-result-object":144,"../internals/internal-state":199,"../internals/iterator-define":216,"../internals/string-multibyte":271,"../internals/to-string":291}],344:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var getMethod = require('../internals/get-method'); +var advanceStringIndex = require('../internals/advance-string-index'); +var regExpExec = require('../internals/regexp-exec-abstract'); + +// @@match logic +fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.es/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = requireObjectCoercible(this); + var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH); + return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@match + function (string) { + var rx = anObject(this); + var S = toString(string); + var res = maybeCallNative(nativeMatch, rx, S); + + if (res.done) return res.value; + + if (!rx.global) return regExpExec(rx, S); + + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = toString(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; + } + return n === 0 ? null : A; + } + ]; +}); + +},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-call":177,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/to-length":284,"../internals/to-string":291}],345:[function(require,module,exports){ +'use strict'; +var apply = require('../internals/function-apply'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var fails = require('../internals/fails'); +var anObject = require('../internals/an-object'); +var isCallable = require('../internals/is-callable'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); +var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var advanceStringIndex = require('../internals/advance-string-index'); +var getMethod = require('../internals/get-method'); +var getSubstitution = require('../internals/get-substitution'); +var regExpExec = require('../internals/regexp-exec-abstract'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var REPLACE = wellKnownSymbol('replace'); +var max = Math.max; +var min = Math.min; +var concat = uncurryThis([].concat); +var push = uncurryThis([].push); +var stringIndexOf = uncurryThis(''.indexOf); +var stringSlice = uncurryThis(''.slice); + +var maybeToString = function (it) { + return it === undefined ? it : String(it); +}; + +// IE <= 11 replaces $0 with the whole match, as if it was $& +// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 +var REPLACE_KEEPS_$0 = (function () { + // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing + return 'a'.replace(/./, '$0') === '$0'; +})(); + +// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string +var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { + if (/./[REPLACE]) { + return /./[REPLACE]('a', '$0') === ''; + } + return false; +})(); + +var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive + return ''.replace(re, '$') !== '7'; +}); + +// @@replace logic +fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) { + var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0'; + + return [ + // `String.prototype.replace` method + // https://tc39.es/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE); + return replacer + ? call(replacer, searchValue, O, replaceValue) + : call(nativeReplace, toString(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace + function (string, replaceValue) { + var rx = anObject(this); + var S = toString(string); + + if ( + typeof replaceValue == 'string' && + stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && + stringIndexOf(replaceValue, '$<') === -1 + ) { + var res = maybeCallNative(nativeReplace, rx, S, replaceValue); + if (res.done) return res.value; + } + + var functionalReplace = isCallable(replaceValue); + if (!functionalReplace) replaceValue = toString(replaceValue); + + var global = rx.global; + var fullUnicode; + if (global) { + fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + + var results = []; + var result; + while (true) { + result = regExpExec(rx, S); + if (result === null) break; + + push(results, result); + if (!global) break; + + var matchStr = toString(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } + + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + + var matched = toString(result[0]); + var position = max(min(toIntegerOrInfinity(result.index), S.length), 0); + var captures = []; + var replacement; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = concat([matched], captures, position, S); + if (namedCaptures !== undefined) push(replacerArgs, namedCaptures); + replacement = toString(apply(replaceValue, undefined, replacerArgs)); + } else { + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + + return accumulatedResult + stringSlice(S, nextSourcePosition); + } + ]; +}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); + +},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/fails":171,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-apply":174,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/get-method":186,"../internals/get-substitution":187,"../internals/is-callable":203,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/to-integer-or-infinity":283,"../internals/to-length":284,"../internals/to-string":291,"../internals/well-known-symbol":306}],346:[function(require,module,exports){ +'use strict'; +var call = require('../internals/function-call'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var sameValue = require('../internals/same-value'); +var toString = require('../internals/to-string'); +var getMethod = require('../internals/get-method'); +var regExpExec = require('../internals/regexp-exec-abstract'); + +// @@search logic +fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.es/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, SEARCH); + return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@search + function (string) { + var rx = anObject(this); + var S = toString(string); + var res = maybeCallNative(nativeSearch, rx, S); + + if (res.done) return res.value; + + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + } + ]; +}); + +},{"../internals/an-object":114,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-call":177,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/regexp-exec-abstract":255,"../internals/require-object-coercible":262,"../internals/same-value":264,"../internals/to-string":291}],347:[function(require,module,exports){ +'use strict'; +var apply = require('../internals/function-apply'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); +var anObject = require('../internals/an-object'); +var isNullOrUndefined = require('../internals/is-null-or-undefined'); +var isRegExp = require('../internals/is-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var speciesConstructor = require('../internals/species-constructor'); +var advanceStringIndex = require('../internals/advance-string-index'); +var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); +var getMethod = require('../internals/get-method'); +var arraySlice = require('../internals/array-slice'); +var callRegExpExec = require('../internals/regexp-exec-abstract'); +var regexpExec = require('../internals/regexp-exec'); +var stickyHelpers = require('../internals/regexp-sticky-helpers'); +var fails = require('../internals/fails'); + +var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; +var MAX_UINT32 = 0xFFFFFFFF; +var min = Math.min; +var $push = [].push; +var exec = uncurryThis(/./.exec); +var push = uncurryThis($push); +var stringSlice = uncurryThis(''.slice); + +// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec +// Weex JS has frozen built-in prototypes, so use try / catch wrapper +var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + // eslint-disable-next-line regexp/no-empty-group -- required for testing + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; +}); + +// @@split logic +fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) { + var internalSplit; + if ( + 'abbc'.split(/(b)*/)[1] === 'c' || + // eslint-disable-next-line regexp/no-empty-group -- required for testing + 'test'.split(/(?:)/, -1).length !== 4 || + 'ab'.split(/(?:ab)*/).length !== 2 || + '.'.split(/(.?)(.?)/).length !== 4 || + // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing + '.'.split(/()()/).length > 1 || + ''.split(/.?/).length + ) { + // based on es5-shim implementation, need to rework it + internalSplit = function (separator, limit) { + var string = toString(requireObjectCoercible(this)); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (separator === undefined) return [string]; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) { + return call(nativeSplit, string, separator, lim); + } + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var match, lastIndex, lastLength; + while (match = call(regexpExec, separatorCopy, string)) { + lastIndex = separatorCopy.lastIndex; + if (lastIndex > lastLastIndex) { + push(output, stringSlice(string, lastLastIndex, match.index)); + if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1)); + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= lim) break; + } + if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop + } + if (lastLastIndex === string.length) { + if (lastLength || !exec(separatorCopy, '')) push(output, ''); + } else push(output, stringSlice(string, lastLastIndex)); + return output.length > lim ? arraySlice(output, 0, lim) : output; + }; + // Chakra, V8 + } else if ('0'.split(undefined, 0).length) { + internalSplit = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit); + }; + } else internalSplit = nativeSplit; + + return [ + // `String.prototype.split` method + // https://tc39.es/ecma262/#sec-string.prototype.split + function split(separator, limit) { + var O = requireObjectCoercible(this); + var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT); + return splitter + ? call(splitter, separator, O, limit) + : call(internalSplit, toString(O), separator, limit); + }, + // `RegExp.prototype[@@split]` method + // https://tc39.es/ecma262/#sec-regexp.prototype-@@split + // + // NOTE: This cannot be properly polyfilled in engines that don't support + // the 'y' flag. + function (string, limit) { + var rx = anObject(this); + var S = toString(string); + var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); + + if (res.done) return res.value; + + var C = speciesConstructor(rx, RegExp); + + var unicodeMatching = rx.unicode; + var flags = (rx.ignoreCase ? 'i' : '') + + (rx.multiline ? 'm' : '') + + (rx.unicode ? 'u' : '') + + (UNSUPPORTED_Y ? 'g' : 'y'); + + // ^(? + rx + ) is needed, in combination with some S slicing, to + // simulate the 'y' flag. + var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags); + var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; + if (lim === 0) return []; + if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; + var p = 0; + var q = 0; + var A = []; + while (q < S.length) { + splitter.lastIndex = UNSUPPORTED_Y ? 0 : q; + var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S); + var e; + if ( + z === null || + (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p + ) { + q = advanceStringIndex(S, q, unicodeMatching); + } else { + push(A, stringSlice(S, p, q)); + if (A.length === lim) return A; + for (var i = 1; i <= z.length - 1; i++) { + push(A, z[i]); + if (A.length === lim) return A; + } + q = p = e; + } + } + push(A, stringSlice(S, p)); + return A; + } + ]; +}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); + +},{"../internals/advance-string-index":112,"../internals/an-object":114,"../internals/array-slice":131,"../internals/fails":171,"../internals/fix-regexp-well-known-symbol-logic":172,"../internals/function-apply":174,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/get-method":186,"../internals/is-null-or-undefined":207,"../internals/is-regexp":211,"../internals/regexp-exec":256,"../internals/regexp-exec-abstract":255,"../internals/regexp-sticky-helpers":259,"../internals/require-object-coercible":262,"../internals/species-constructor":270,"../internals/to-length":284,"../internals/to-string":291}],348:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); +var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; +var toLength = require('../internals/to-length'); +var toString = require('../internals/to-string'); +var notARegExp = require('../internals/not-a-regexp'); +var requireObjectCoercible = require('../internals/require-object-coercible'); +var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); +var IS_PURE = require('../internals/is-pure'); + +var stringSlice = uncurryThis(''.slice); +var min = Math.min; + +var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith'); +// https://github.com/zloirock/core-js/pull/702 +var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () { + var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith'); + return descriptor && !descriptor.writable; +}(); + +// `String.prototype.startsWith` method +// https://tc39.es/ecma262/#sec-string.prototype.startswith +$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = toString(requireObjectCoercible(this)); + notARegExp(searchString); + var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = toString(searchString); + return stringSlice(that, index, index + search.length) === search; + } +}); + +},{"../internals/correct-is-regexp-logic":142,"../internals/export":170,"../internals/function-uncurry-this-clause":180,"../internals/is-pure":210,"../internals/not-a-regexp":227,"../internals/object-get-own-property-descriptor":232,"../internals/require-object-coercible":262,"../internals/to-length":284,"../internals/to-string":291}],349:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var $trim = require('../internals/string-trim').trim; +var forcedStringTrimMethod = require('../internals/string-trim-forced'); + +// `String.prototype.trim` method +// https://tc39.es/ecma262/#sec-string.prototype.trim +$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { + trim: function trim() { + return $trim(this); + } +}); + +},{"../internals/export":170,"../internals/string-trim":273,"../internals/string-trim-forced":272}],350:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var IS_PURE = require('../internals/is-pure'); +var DESCRIPTORS = require('../internals/descriptors'); +var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection'); +var fails = require('../internals/fails'); +var hasOwn = require('../internals/has-own-property'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var anObject = require('../internals/an-object'); +var toIndexedObject = require('../internals/to-indexed-object'); +var toPropertyKey = require('../internals/to-property-key'); +var $toString = require('../internals/to-string'); +var createPropertyDescriptor = require('../internals/create-property-descriptor'); +var nativeObjectCreate = require('../internals/object-create'); +var objectKeys = require('../internals/object-keys'); +var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); +var getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external'); +var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); +var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); +var definePropertyModule = require('../internals/object-define-property'); +var definePropertiesModule = require('../internals/object-define-properties'); +var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); +var defineBuiltIn = require('../internals/define-built-in'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var shared = require('../internals/shared'); +var sharedKey = require('../internals/shared-key'); +var hiddenKeys = require('../internals/hidden-keys'); +var uid = require('../internals/uid'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped'); +var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); +var defineSymbolToPrimitive = require('../internals/symbol-define-to-primitive'); +var setToStringTag = require('../internals/set-to-string-tag'); +var InternalStateModule = require('../internals/internal-state'); +var $forEach = require('../internals/array-iteration').forEach; + +var HIDDEN = sharedKey('hidden'); +var SYMBOL = 'Symbol'; +var PROTOTYPE = 'prototype'; + +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(SYMBOL); + +var ObjectPrototype = Object[PROTOTYPE]; +var $Symbol = global.Symbol; +var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE]; +var RangeError = global.RangeError; +var TypeError = global.TypeError; +var QObject = global.QObject; +var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; +var nativeDefineProperty = definePropertyModule.f; +var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; +var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; +var push = uncurryThis([].push); + +var AllSymbols = shared('symbols'); +var ObjectPrototypeSymbols = shared('op-symbols'); +var WellKnownSymbolsStore = shared('wks'); + +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var fallbackDefineProperty = function (O, P, Attributes) { + var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); + if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; + nativeDefineProperty(O, P, Attributes); + if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { + nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); + } +}; + +var setSymbolDescriptor = DESCRIPTORS && fails(function () { + return nativeObjectCreate(nativeDefineProperty({}, 'a', { + get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } + })).a !== 7; +}) ? fallbackDefineProperty : nativeDefineProperty; + +var wrap = function (tag, description) { + var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype); + setInternalState(symbol, { + type: SYMBOL, + tag: tag, + description: description + }); + if (!DESCRIPTORS) symbol.description = description; + return symbol; +}; + +var $defineProperty = function defineProperty(O, P, Attributes) { + if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); + anObject(O); + var key = toPropertyKey(P); + anObject(Attributes); + if (hasOwn(AllSymbols, key)) { + if (!Attributes.enumerable) { + if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null))); + O[HIDDEN][key] = true; + } else { + if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; + Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); + } return setSymbolDescriptor(O, key, Attributes); + } return nativeDefineProperty(O, key, Attributes); +}; + +var $defineProperties = function defineProperties(O, Properties) { + anObject(O); + var properties = toIndexedObject(Properties); + var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); + $forEach(keys, function (key) { + if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]); + }); + return O; +}; + +var $create = function create(O, Properties) { + return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); +}; + +var $propertyIsEnumerable = function propertyIsEnumerable(V) { + var P = toPropertyKey(V); + var enumerable = call(nativePropertyIsEnumerable, this, P); + if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false; + return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] + ? enumerable : true; +}; + +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { + var it = toIndexedObject(O); + var key = toPropertyKey(P); + if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return; + var descriptor = nativeGetOwnPropertyDescriptor(it, key); + if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) { + descriptor.enumerable = true; + } + return descriptor; +}; + +var $getOwnPropertyNames = function getOwnPropertyNames(O) { + var names = nativeGetOwnPropertyNames(toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key); + }); + return result; +}; + +var $getOwnPropertySymbols = function (O) { + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; + var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) { + push(result, AllSymbols[key]); + } + }); + return result; +}; + +// `Symbol` constructor +// https://tc39.es/ecma262/#sec-symbol-constructor +if (!NATIVE_SYMBOL) { + $Symbol = function Symbol() { + if (isPrototypeOf(SymbolPrototype, this)) throw new TypeError('Symbol is not a constructor'); + var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]); + var tag = uid(description); + var setter = function (value) { + var $this = this === undefined ? global : this; + if ($this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value); + if (hasOwn($this, HIDDEN) && hasOwn($this[HIDDEN], tag)) $this[HIDDEN][tag] = false; + var descriptor = createPropertyDescriptor(1, value); + try { + setSymbolDescriptor($this, tag, descriptor); + } catch (error) { + if (!(error instanceof RangeError)) throw error; + fallbackDefineProperty($this, tag, descriptor); + } + }; + if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); + return wrap(tag, description); + }; + + SymbolPrototype = $Symbol[PROTOTYPE]; + + defineBuiltIn(SymbolPrototype, 'toString', function toString() { + return getInternalState(this).tag; + }); + + defineBuiltIn($Symbol, 'withoutSetter', function (description) { + return wrap(uid(description), description); + }); + + propertyIsEnumerableModule.f = $propertyIsEnumerable; + definePropertyModule.f = $defineProperty; + definePropertiesModule.f = $defineProperties; + getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; + getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; + getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; + + wrappedWellKnownSymbolModule.f = function (name) { + return wrap(wellKnownSymbol(name), name); + }; + + if (DESCRIPTORS) { + // https://github.com/tc39/proposal-Symbol-description + defineBuiltInAccessor(SymbolPrototype, 'description', { + configurable: true, + get: function description() { + return getInternalState(this).description; + } + }); + if (!IS_PURE) { + defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); + } + } +} + +$({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { + Symbol: $Symbol +}); + +$forEach(objectKeys(WellKnownSymbolsStore), function (name) { + defineWellKnownSymbol(name); +}); + +$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { + useSetter: function () { USE_SETTER = true; }, + useSimple: function () { USE_SETTER = false; } +}); + +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { + // `Object.create` method + // https://tc39.es/ecma262/#sec-object.create + create: $create, + // `Object.defineProperty` method + // https://tc39.es/ecma262/#sec-object.defineproperty + defineProperty: $defineProperty, + // `Object.defineProperties` method + // https://tc39.es/ecma262/#sec-object.defineproperties + defineProperties: $defineProperties, + // `Object.getOwnPropertyDescriptor` method + // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors + getOwnPropertyDescriptor: $getOwnPropertyDescriptor +}); + +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { + // `Object.getOwnPropertyNames` method + // https://tc39.es/ecma262/#sec-object.getownpropertynames + getOwnPropertyNames: $getOwnPropertyNames +}); + +// `Symbol.prototype[@@toPrimitive]` method +// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive +defineSymbolToPrimitive(); + +// `Symbol.prototype[@@toStringTag]` property +// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag +setToStringTag($Symbol, SYMBOL); + +hiddenKeys[HIDDEN] = true; + +},{"../internals/an-object":114,"../internals/array-iteration":125,"../internals/create-property-descriptor":146,"../internals/define-built-in":149,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/export":170,"../internals/fails":171,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/hidden-keys":190,"../internals/internal-state":199,"../internals/is-pure":210,"../internals/object-create":229,"../internals/object-define-properties":230,"../internals/object-define-property":231,"../internals/object-get-own-property-descriptor":232,"../internals/object-get-own-property-names":234,"../internals/object-get-own-property-names-external":233,"../internals/object-get-own-property-symbols":235,"../internals/object-is-prototype-of":238,"../internals/object-keys":240,"../internals/object-property-is-enumerable":241,"../internals/set-to-string-tag":266,"../internals/shared":269,"../internals/shared-key":267,"../internals/symbol-constructor-detection":274,"../internals/symbol-define-to-primitive":275,"../internals/to-indexed-object":282,"../internals/to-property-key":289,"../internals/to-string":291,"../internals/uid":299,"../internals/well-known-symbol":306,"../internals/well-known-symbol-define":304,"../internals/well-known-symbol-wrapped":305}],351:[function(require,module,exports){ +// `Symbol.prototype.description` getter +// https://tc39.es/ecma262/#sec-symbol.prototype.description +'use strict'; +var $ = require('../internals/export'); +var DESCRIPTORS = require('../internals/descriptors'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); +var hasOwn = require('../internals/has-own-property'); +var isCallable = require('../internals/is-callable'); +var isPrototypeOf = require('../internals/object-is-prototype-of'); +var toString = require('../internals/to-string'); +var defineBuiltInAccessor = require('../internals/define-built-in-accessor'); +var copyConstructorProperties = require('../internals/copy-constructor-properties'); + +var NativeSymbol = global.Symbol; +var SymbolPrototype = NativeSymbol && NativeSymbol.prototype; + +if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || + // Safari 12 bug + NativeSymbol().description !== undefined +)) { + var EmptyStringDescriptionStore = {}; + // wrap Symbol constructor for correct work with undefined description + var SymbolWrapper = function Symbol() { + var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]); + var result = isPrototypeOf(SymbolPrototype, this) + ? new NativeSymbol(description) + // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' + : description === undefined ? NativeSymbol() : NativeSymbol(description); + if (description === '') EmptyStringDescriptionStore[result] = true; + return result; + }; + + copyConstructorProperties(SymbolWrapper, NativeSymbol); + SymbolWrapper.prototype = SymbolPrototype; + SymbolPrototype.constructor = SymbolWrapper; + + var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)'; + var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf); + var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString); + var regexp = /^Symbol\((.*)\)[^)]+$/; + var replace = uncurryThis(''.replace); + var stringSlice = uncurryThis(''.slice); + + defineBuiltInAccessor(SymbolPrototype, 'description', { + configurable: true, + get: function description() { + var symbol = thisSymbolValue(this); + if (hasOwn(EmptyStringDescriptionStore, symbol)) return ''; + var string = symbolDescriptiveString(symbol); + var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1'); + return desc === '' ? undefined : desc; + } + }); + + $({ global: true, constructor: true, forced: true }, { + Symbol: SymbolWrapper + }); +} + +},{"../internals/copy-constructor-properties":141,"../internals/define-built-in-accessor":148,"../internals/descriptors":153,"../internals/export":170,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/has-own-property":189,"../internals/is-callable":203,"../internals/object-is-prototype-of":238,"../internals/to-string":291}],352:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var getBuiltIn = require('../internals/get-built-in'); +var hasOwn = require('../internals/has-own-property'); +var toString = require('../internals/to-string'); +var shared = require('../internals/shared'); +var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); + +var StringToSymbolRegistry = shared('string-to-symbol-registry'); +var SymbolToStringRegistry = shared('symbol-to-string-registry'); + +// `Symbol.for` method +// https://tc39.es/ecma262/#sec-symbol.for +$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { + 'for': function (key) { + var string = toString(key); + if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; + var symbol = getBuiltIn('Symbol')(string); + StringToSymbolRegistry[string] = symbol; + SymbolToStringRegistry[symbol] = string; + return symbol; + } +}); + +},{"../internals/export":170,"../internals/get-built-in":182,"../internals/has-own-property":189,"../internals/shared":269,"../internals/symbol-registry-detection":276,"../internals/to-string":291}],353:[function(require,module,exports){ +'use strict'; +var defineWellKnownSymbol = require('../internals/well-known-symbol-define'); + +// `Symbol.iterator` well-known symbol +// https://tc39.es/ecma262/#sec-symbol.iterator +defineWellKnownSymbol('iterator'); + +},{"../internals/well-known-symbol-define":304}],354:[function(require,module,exports){ +'use strict'; +// TODO: Remove this module from `core-js@4` since it's split to modules listed below +require('../modules/es.symbol.constructor'); +require('../modules/es.symbol.for'); +require('../modules/es.symbol.key-for'); +require('../modules/es.json.stringify'); +require('../modules/es.object.get-own-property-symbols'); + +},{"../modules/es.json.stringify":323,"../modules/es.object.get-own-property-symbols":327,"../modules/es.symbol.constructor":350,"../modules/es.symbol.for":352,"../modules/es.symbol.key-for":355}],355:[function(require,module,exports){ +'use strict'; +var $ = require('../internals/export'); +var hasOwn = require('../internals/has-own-property'); +var isSymbol = require('../internals/is-symbol'); +var tryToString = require('../internals/try-to-string'); +var shared = require('../internals/shared'); +var NATIVE_SYMBOL_REGISTRY = require('../internals/symbol-registry-detection'); + +var SymbolToStringRegistry = shared('symbol-to-string-registry'); + +// `Symbol.keyFor` method +// https://tc39.es/ecma262/#sec-symbol.keyfor +$({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, { + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw new TypeError(tryToString(sym) + ' is not a symbol'); + if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; + } +}); + +},{"../internals/export":170,"../internals/has-own-property":189,"../internals/is-symbol":212,"../internals/shared":269,"../internals/symbol-registry-detection":276,"../internals/try-to-string":293}],356:[function(require,module,exports){ +'use strict'; +var uncurryThis = require('../internals/function-uncurry-this'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $ArrayCopyWithin = require('../internals/array-copy-within'); + +var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.copyWithin` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin +exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) { + return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-copy-within":119,"../internals/function-uncurry-this":181}],357:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $every = require('../internals/array-iteration').every; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.every` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.every +exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) { + return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],358:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $fill = require('../internals/array-fill'); +var toBigInt = require('../internals/to-big-int'); +var classof = require('../internals/classof'); +var call = require('../internals/function-call'); +var uncurryThis = require('../internals/function-uncurry-this'); +var fails = require('../internals/fails'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var slice = uncurryThis(''.slice); + +// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18 +var CONVERSION_BUG = fails(function () { + var count = 0; + // eslint-disable-next-line es/no-typed-arrays -- safe + new Int8Array(2).fill({ valueOf: function () { return count++; } }); + return count !== 1; +}); + +// `%TypedArray%.prototype.fill` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill +exportTypedArrayMethod('fill', function fill(value /* , start, end */) { + var length = arguments.length; + aTypedArray(this); + var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value; + return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined); +}, CONVERSION_BUG); + +},{"../internals/array-buffer-view-core":117,"../internals/array-fill":120,"../internals/classof":138,"../internals/fails":171,"../internals/function-call":177,"../internals/function-uncurry-this":181,"../internals/to-big-int":280}],359:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $filter = require('../internals/array-iteration').filter; +var fromSpeciesAndList = require('../internals/typed-array-from-species-and-list'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.filter` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter +exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) { + var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + return fromSpeciesAndList(this, list); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125,"../internals/typed-array-from-species-and-list":296}],360:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $findIndex = require('../internals/array-iteration').findIndex; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.findIndex` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex +exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) { + return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],361:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $find = require('../internals/array-iteration').find; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.find` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.find +exportTypedArrayMethod('find', function find(predicate /* , thisArg */) { + return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],362:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $forEach = require('../internals/array-iteration').forEach; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.forEach` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach +exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) { + $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],363:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $includes = require('../internals/array-includes').includes; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.includes` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes +exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) { + return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-includes":124}],364:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $indexOf = require('../internals/array-includes').indexOf; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.indexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof +exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) { + return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-includes":124}],365:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var fails = require('../internals/fails'); +var uncurryThis = require('../internals/function-uncurry-this'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var ArrayIterators = require('../modules/es.array.iterator'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); +var Uint8Array = global.Uint8Array; +var arrayValues = uncurryThis(ArrayIterators.values); +var arrayKeys = uncurryThis(ArrayIterators.keys); +var arrayEntries = uncurryThis(ArrayIterators.entries); +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var TypedArrayPrototype = Uint8Array && Uint8Array.prototype; + +var GENERIC = !fails(function () { + TypedArrayPrototype[ITERATOR].call([1]); +}); + +var ITERATOR_IS_VALUES = !!TypedArrayPrototype + && TypedArrayPrototype.values + && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values + && TypedArrayPrototype.values.name === 'values'; + +var typedArrayValues = function values() { + return arrayValues(aTypedArray(this)); +}; + +// `%TypedArray%.prototype.entries` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries +exportTypedArrayMethod('entries', function entries() { + return arrayEntries(aTypedArray(this)); +}, GENERIC); +// `%TypedArray%.prototype.keys` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys +exportTypedArrayMethod('keys', function keys() { + return arrayKeys(aTypedArray(this)); +}, GENERIC); +// `%TypedArray%.prototype.values` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.values +exportTypedArrayMethod('values', typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); +// `%TypedArray%.prototype[@@iterator]` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator +exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: 'values' }); + +},{"../internals/array-buffer-view-core":117,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188,"../internals/well-known-symbol":306,"../modules/es.array.iterator":316}],366:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var uncurryThis = require('../internals/function-uncurry-this'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var $join = uncurryThis([].join); + +// `%TypedArray%.prototype.join` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.join +exportTypedArrayMethod('join', function join(separator) { + return $join(aTypedArray(this), separator); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/function-uncurry-this":181}],367:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var apply = require('../internals/function-apply'); +var $lastIndexOf = require('../internals/array-last-index-of'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.lastIndexOf` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof +exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { + var length = arguments.length; + return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-last-index-of":126,"../internals/function-apply":174}],368:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $map = require('../internals/array-iteration').map; +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.map` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.map +exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) { + return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { + return new (typedArraySpeciesConstructor(O))(length); + }); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125,"../internals/typed-array-species-constructor":298}],369:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $reduceRight = require('../internals/array-reduce').right; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.reduceRight` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright +exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) { + var length = arguments.length; + return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-reduce":129}],370:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $reduce = require('../internals/array-reduce').left; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.reduce` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce +exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) { + var length = arguments.length; + return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-reduce":129}],371:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var floor = Math.floor; + +// `%TypedArray%.prototype.reverse` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse +exportTypedArrayMethod('reverse', function reverse() { + var that = this; + var length = aTypedArray(that).length; + var middle = floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; +}); + +},{"../internals/array-buffer-view-core":117}],372:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var call = require('../internals/function-call'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var lengthOfArrayLike = require('../internals/length-of-array-like'); +var toOffset = require('../internals/to-offset'); +var toIndexedObject = require('../internals/to-object'); +var fails = require('../internals/fails'); + +var RangeError = global.RangeError; +var Int8Array = global.Int8Array; +var Int8ArrayPrototype = Int8Array && Int8Array.prototype; +var $set = Int8ArrayPrototype && Int8ArrayPrototype.set; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () { + // eslint-disable-next-line es/no-typed-arrays -- required for testing + var array = new Uint8ClampedArray(2); + call($set, array, { length: 1, 0: 3 }, 1); + return array[1] !== 3; +}); + +// https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other +var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () { + var array = new Int8Array(2); + array.set(1); + array.set('2', 1); + return array[0] !== 0 || array[1] !== 2; +}); + +// `%TypedArray%.prototype.set` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set +exportTypedArrayMethod('set', function set(arrayLike /* , offset */) { + aTypedArray(this); + var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); + var src = toIndexedObject(arrayLike); + if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset); + var length = this.length; + var len = lengthOfArrayLike(src); + var index = 0; + if (len + offset > length) throw new RangeError('Wrong length'); + while (index < len) this[offset + index] = src[index++]; +}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG); + +},{"../internals/array-buffer-view-core":117,"../internals/fails":171,"../internals/function-call":177,"../internals/global":188,"../internals/length-of-array-like":219,"../internals/to-object":285,"../internals/to-offset":286}],373:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); +var fails = require('../internals/fails'); +var arraySlice = require('../internals/array-slice'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +var FORCED = fails(function () { + // eslint-disable-next-line es/no-typed-arrays -- required for testing + new Int8Array(1).slice(); +}); + +// `%TypedArray%.prototype.slice` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice +exportTypedArrayMethod('slice', function slice(start, end) { + var list = arraySlice(aTypedArray(this), start, end); + var C = typedArraySpeciesConstructor(this); + var index = 0; + var length = list.length; + var result = new C(length); + while (length > index) result[index] = list[index++]; + return result; +}, FORCED); + +},{"../internals/array-buffer-view-core":117,"../internals/array-slice":131,"../internals/fails":171,"../internals/typed-array-species-constructor":298}],374:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var $some = require('../internals/array-iteration').some; + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.some` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.some +exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) { + return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/array-iteration":125}],375:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this-clause'); +var fails = require('../internals/fails'); +var aCallable = require('../internals/a-callable'); +var internalSort = require('../internals/array-sort'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var FF = require('../internals/engine-ff-version'); +var IE_OR_EDGE = require('../internals/engine-is-ie-or-edge'); +var V8 = require('../internals/engine-v8-version'); +var WEBKIT = require('../internals/engine-webkit-version'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var Uint16Array = global.Uint16Array; +var nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort); + +// WebKit +var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () { + nativeSort(new Uint16Array(2), null); +}) && fails(function () { + nativeSort(new Uint16Array(2), {}); +})); + +var STABLE_SORT = !!nativeSort && !fails(function () { + // feature detection can be too slow, so check engines versions + if (V8) return V8 < 74; + if (FF) return FF < 67; + if (IE_OR_EDGE) return true; + if (WEBKIT) return WEBKIT < 602; + + var array = new Uint16Array(516); + var expected = Array(516); + var index, mod; + + for (index = 0; index < 516; index++) { + mod = index % 4; + array[index] = 515 - index; + expected[index] = index - 2 * mod + 3; + } + + nativeSort(array, function (a, b) { + return (a / 4 | 0) - (b / 4 | 0); + }); + + for (index = 0; index < 516; index++) { + if (array[index] !== expected[index]) return true; + } +}); + +var getSortCompare = function (comparefn) { + return function (x, y) { + if (comparefn !== undefined) return +comparefn(x, y) || 0; + // eslint-disable-next-line no-self-compare -- NaN check + if (y !== y) return -1; + // eslint-disable-next-line no-self-compare -- NaN check + if (x !== x) return 1; + if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1; + return x > y; + }; +}; + +// `%TypedArray%.prototype.sort` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort +exportTypedArrayMethod('sort', function sort(comparefn) { + if (comparefn !== undefined) aCallable(comparefn); + if (STABLE_SORT) return nativeSort(this, comparefn); + + return internalSort(aTypedArray(this), getSortCompare(comparefn)); +}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); + +},{"../internals/a-callable":108,"../internals/array-buffer-view-core":117,"../internals/array-sort":132,"../internals/engine-ff-version":158,"../internals/engine-is-ie-or-edge":161,"../internals/engine-v8-version":167,"../internals/engine-webkit-version":168,"../internals/fails":171,"../internals/function-uncurry-this-clause":180,"../internals/global":188}],376:[function(require,module,exports){ +'use strict'; +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var toLength = require('../internals/to-length'); +var toAbsoluteIndex = require('../internals/to-absolute-index'); +var typedArraySpeciesConstructor = require('../internals/typed-array-species-constructor'); + +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; + +// `%TypedArray%.prototype.subarray` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray +exportTypedArrayMethod('subarray', function subarray(begin, end) { + var O = aTypedArray(this); + var length = O.length; + var beginIndex = toAbsoluteIndex(begin, length); + var C = typedArraySpeciesConstructor(O); + return new C( + O.buffer, + O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) + ); +}); + +},{"../internals/array-buffer-view-core":117,"../internals/to-absolute-index":279,"../internals/to-length":284,"../internals/typed-array-species-constructor":298}],377:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var apply = require('../internals/function-apply'); +var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); +var fails = require('../internals/fails'); +var arraySlice = require('../internals/array-slice'); + +var Int8Array = global.Int8Array; +var aTypedArray = ArrayBufferViewCore.aTypedArray; +var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; +var $toLocaleString = [].toLocaleString; + +// iOS Safari 6.x fails here +var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { + $toLocaleString.call(new Int8Array(1)); +}); + +var FORCED = fails(function () { + return [1, 2].toLocaleString() !== new Int8Array([1, 2]).toLocaleString(); +}) || !fails(function () { + Int8Array.prototype.toLocaleString.call([1, 2]); +}); + +// `%TypedArray%.prototype.toLocaleString` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring +exportTypedArrayMethod('toLocaleString', function toLocaleString() { + return apply( + $toLocaleString, + TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this), + arraySlice(arguments) + ); +}, FORCED); + +},{"../internals/array-buffer-view-core":117,"../internals/array-slice":131,"../internals/fails":171,"../internals/function-apply":174,"../internals/global":188}],378:[function(require,module,exports){ +'use strict'; +var exportTypedArrayMethod = require('../internals/array-buffer-view-core').exportTypedArrayMethod; +var fails = require('../internals/fails'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); + +var Uint8Array = global.Uint8Array; +var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; +var arrayToString = [].toString; +var join = uncurryThis([].join); + +if (fails(function () { arrayToString.call({}); })) { + arrayToString = function toString() { + return join(this); + }; +} + +var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString; + +// `%TypedArray%.prototype.toString` method +// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring +exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD); + +},{"../internals/array-buffer-view-core":117,"../internals/fails":171,"../internals/function-uncurry-this":181,"../internals/global":188}],379:[function(require,module,exports){ +'use strict'; +var createTypedArrayConstructor = require('../internals/typed-array-constructor'); + +// `Uint8Array` constructor +// https://tc39.es/ecma262/#sec-typedarray-objects +createTypedArrayConstructor('Uint8', function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + +},{"../internals/typed-array-constructor":294}],380:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var DOMIterables = require('../internals/dom-iterables'); +var DOMTokenListPrototype = require('../internals/dom-token-list-prototype'); +var forEach = require('../internals/array-for-each'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); + +var handlePrototype = function (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { + createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); + } catch (error) { + CollectionPrototype.forEach = forEach; + } +}; + +for (var COLLECTION_NAME in DOMIterables) { + if (DOMIterables[COLLECTION_NAME]) { + handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype); + } +} + +handlePrototype(DOMTokenListPrototype); + +},{"../internals/array-for-each":121,"../internals/create-non-enumerable-property":145,"../internals/dom-iterables":156,"../internals/dom-token-list-prototype":157,"../internals/global":188}],381:[function(require,module,exports){ +'use strict'; +var global = require('../internals/global'); +var DOMIterables = require('../internals/dom-iterables'); +var DOMTokenListPrototype = require('../internals/dom-token-list-prototype'); +var ArrayIteratorMethods = require('../modules/es.array.iterator'); +var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); +var setToStringTag = require('../internals/set-to-string-tag'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var ITERATOR = wellKnownSymbol('iterator'); +var ArrayValues = ArrayIteratorMethods.values; + +var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { + if (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[ITERATOR] !== ArrayValues) try { + createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); + } catch (error) { + CollectionPrototype[ITERATOR] = ArrayValues; + } + setToStringTag(CollectionPrototype, COLLECTION_NAME, true); + if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { + createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); + } catch (error) { + CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; + } + } + } +}; + +for (var COLLECTION_NAME in DOMIterables) { + handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME); +} + +handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); + +},{"../internals/create-non-enumerable-property":145,"../internals/dom-iterables":156,"../internals/dom-token-list-prototype":157,"../internals/global":188,"../internals/set-to-string-tag":266,"../internals/well-known-symbol":306,"../modules/es.array.iterator":316}],382:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('buffer').Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + +},{"buffer":103}],383:[function(require,module,exports){ +/* + * Date Format 1.2.3 + * (c) 2007-2009 Steven Levithan + * MIT license + * + * Includes enhancements by Scott Trenda + * and Kris Kowal + * + * Accepts a date, a mask, or a date and a mask. + * Returns a formatted version of the given date. + * The date defaults to the current date/time. + * The mask defaults to dateFormat.masks.default. + */ + +(function(global) { + 'use strict'; + + var dateFormat = (function() { + var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g; + var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g; + var timezoneClip = /[^-+\dA-Z]/g; + + // Regexes and supporting functions are cached through closure + return function (date, mask, utc, gmt) { + + // You can't provide utc if you skip other args (use the 'UTC:' mask prefix) + if (arguments.length === 1 && kindOf(date) === 'string' && !/\d/.test(date)) { + mask = date; + date = undefined; + } + + date = date || new Date; + + if(!(date instanceof Date)) { + date = new Date(date); + } + + if (isNaN(date)) { + throw TypeError('Invalid date'); + } + + mask = String(dateFormat.masks[mask] || mask || dateFormat.masks['default']); + + // Allow setting the utc/gmt argument via the mask + var maskSlice = mask.slice(0, 4); + if (maskSlice === 'UTC:' || maskSlice === 'GMT:') { + mask = mask.slice(4); + utc = true; + if (maskSlice === 'GMT:') { + gmt = true; + } + } + + var _ = utc ? 'getUTC' : 'get'; + var d = date[_ + 'Date'](); + var D = date[_ + 'Day'](); + var m = date[_ + 'Month'](); + var y = date[_ + 'FullYear'](); + var H = date[_ + 'Hours'](); + var M = date[_ + 'Minutes'](); + var s = date[_ + 'Seconds'](); + var L = date[_ + 'Milliseconds'](); + var o = utc ? 0 : date.getTimezoneOffset(); + var W = getWeek(date); + var N = getDayOfWeek(date); + var flags = { + d: d, + dd: pad(d), + ddd: dateFormat.i18n.dayNames[D], + dddd: dateFormat.i18n.dayNames[D + 7], + m: m + 1, + mm: pad(m + 1), + mmm: dateFormat.i18n.monthNames[m], + mmmm: dateFormat.i18n.monthNames[m + 12], + yy: String(y).slice(2), + yyyy: y, + h: H % 12 || 12, + hh: pad(H % 12 || 12), + H: H, + HH: pad(H), + M: M, + MM: pad(M), + s: s, + ss: pad(s), + l: pad(L, 3), + L: pad(Math.round(L / 10)), + t: H < 12 ? 'a' : 'p', + tt: H < 12 ? 'am' : 'pm', + T: H < 12 ? 'A' : 'P', + TT: H < 12 ? 'AM' : 'PM', + Z: gmt ? 'GMT' : utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''), + o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), + S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10], + W: W, + N: N + }; + + return mask.replace(token, function (match) { + if (match in flags) { + return flags[match]; + } + return match.slice(1, match.length - 1); + }); + }; + })(); + + dateFormat.masks = { + 'default': 'ddd mmm dd yyyy HH:MM:ss', + 'shortDate': 'm/d/yy', + 'mediumDate': 'mmm d, yyyy', + 'longDate': 'mmmm d, yyyy', + 'fullDate': 'dddd, mmmm d, yyyy', + 'shortTime': 'h:MM TT', + 'mediumTime': 'h:MM:ss TT', + 'longTime': 'h:MM:ss TT Z', + 'isoDate': 'yyyy-mm-dd', + 'isoTime': 'HH:MM:ss', + 'isoDateTime': 'yyyy-mm-dd\'T\'HH:MM:sso', + 'isoUtcDateTime': 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'', + 'expiresHeaderFormat': 'ddd, dd mmm yyyy HH:MM:ss Z' + }; + + // Internationalization strings + dateFormat.i18n = { + dayNames: [ + 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + ], + monthNames: [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', + 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' + ] + }; + +function pad(val, len) { + val = String(val); + len = len || 2; + while (val.length < len) { + val = '0' + val; + } + return val; +} + +/** + * Get the ISO 8601 week number + * Based on comments from + * http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html + * + * @param {Object} `date` + * @return {Number} + */ +function getWeek(date) { + // Remove time components of date + var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); + + // Change date to Thursday same week + targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3); + + // Take January 4th as it is always in week 1 (see ISO 8601) + var firstThursday = new Date(targetThursday.getFullYear(), 0, 4); + + // Change date to Thursday same week + firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3); + + // Check if daylight-saving-time-switch occurred and correct for it + var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset(); + targetThursday.setHours(targetThursday.getHours() - ds); + + // Number of weeks between target Thursday and first Thursday + var weekDiff = (targetThursday - firstThursday) / (86400000*7); + return 1 + Math.floor(weekDiff); +} + +/** + * Get ISO-8601 numeric representation of the day of the week + * 1 (for Monday) through 7 (for Sunday) + * + * @param {Object} `date` + * @return {Number} + */ +function getDayOfWeek(date) { + var dow = date.getDay(); + if(dow === 0) { + dow = 7; + } + return dow; +} + +/** + * kind-of shortcut + * @param {*} val + * @return {String} + */ +function kindOf(val) { + if (val === null) { + return 'null'; + } + + if (val === undefined) { + return 'undefined'; + } + + if (typeof val !== 'object') { + return typeof val; + } + + if (Array.isArray(val)) { + return 'array'; + } + + return {}.toString.call(val) + .slice(8, -1).toLowerCase(); +}; + + + + if (typeof define === 'function' && define.amd) { + define(function () { + return dateFormat; + }); + } else if (typeof exports === 'object') { + module.exports = dateFormat; + } else { + global.dateFormat = dateFormat; + } +})(this); + +},{}],384:[function(require,module,exports){ +'use strict'; + +var hasPropertyDescriptors = require('has-property-descriptors')(); + +var GetIntrinsic = require('get-intrinsic'); + +var $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true); +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } +} + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var gopd = require('gopd'); + +/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */ +module.exports = function defineDataProperty( + obj, + property, + value +) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new $TypeError('`obj` must be an object or a function`'); + } + if (typeof property !== 'string' && typeof property !== 'symbol') { + throw new $TypeError('`property` must be a string or a symbol`'); + } + if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { + throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); + } + if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { + throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); + } + if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { + throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); + } + if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { + throw new $TypeError('`loose`, if provided, must be a boolean'); + } + + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + + /* @type {false | TypedPropertyDescriptor} */ + var desc = !!gopd && gopd(obj, property); + + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value: value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { + // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable + obj[property] = value; // eslint-disable-line no-param-reassign + } else { + throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); + } +}; + +},{"get-intrinsic":390,"gopd":391,"has-property-descriptors":392}],385:[function(require,module,exports){ +/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */ + +'use strict'; + +/** + * Module variables. + * @private + */ + +var matchHtmlRegExp = /["'&<>]/; + +/** + * Module exports. + * @public + */ + +module.exports = escapeHtml; + +/** + * Escape special characters in the given string of html. + * + * @param {string} string The string to escape for inserting into HTML + * @return {string} + * @public + */ + +function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; + } + + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; + + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } + + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; + } + + return lastIndex !== index + ? html + str.substring(lastIndex, index) + : html; +} + +},{}],386:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var R = typeof Reflect === 'object' ? Reflect : null +var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + } + +var ReflectOwnKeys +if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); + }; +} else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; +} + +function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); +} + +var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; +} + +function EventEmitter() { + EventEmitter.init.call(this); +} +module.exports = EventEmitter; +module.exports.once = once; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._eventsCount = 0; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; + +function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } +} + +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + defaultMaxListeners = arg; + } +}); + +EventEmitter.init = function() { + + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; +}; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; +}; + +function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} + +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); +}; + +EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); + + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) + return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + checkListener(listener); + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + checkListener(listener); + + events = this._events; + if (events === undefined) + return this; + + list = events[type]; + if (list === undefined) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (events === undefined) + return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) + return []; + + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +}; + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} + +function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === 'function') { + emitter.removeListener('error', errorListener); + } + resolve([].slice.call(arguments)); + }; + + eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); + } + }); +} + +function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } +} + +function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } +} + +},{}],387:[function(require,module,exports){ +'use strict'; + +var isCallable = require('is-callable'); + +var toStr = Object.prototype.toString; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var forEachArray = function forEachArray(array, iterator, receiver) { + for (var i = 0, len = array.length; i < len; i++) { + if (hasOwnProperty.call(array, i)) { + if (receiver == null) { + iterator(array[i], i, array); + } else { + iterator.call(receiver, array[i], i, array); + } + } + } +}; + +var forEachString = function forEachString(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + // no such thing as a sparse string. + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); + } + } +}; + +var forEachObject = function forEachObject(object, iterator, receiver) { + for (var k in object) { + if (hasOwnProperty.call(object, k)) { + if (receiver == null) { + iterator(object[k], k, object); + } else { + iterator.call(receiver, object[k], k, object); + } + } + } +}; + +var forEach = function forEach(list, iterator, thisArg) { + if (!isCallable(iterator)) { + throw new TypeError('iterator must be a function'); + } + + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + + if (toStr.call(list) === '[object Array]') { + forEachArray(list, iterator, receiver); + } else if (typeof list === 'string') { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } +}; + +module.exports = forEach; + +},{"is-callable":410}],388:[function(require,module,exports){ +'use strict'; + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var toStr = Object.prototype.toString; +var max = Math.max; +var funcType = '[object Function]'; + +var concatty = function concatty(a, b) { + var arr = []; + + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + + return arr; +}; + +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; + +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); + + }; + + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs[i] = '$' + i; + } + + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; + +},{}],389:[function(require,module,exports){ +'use strict'; + +var implementation = require('./implementation'); + +module.exports = Function.prototype.bind || implementation; + +},{"./implementation":388}],390:[function(require,module,exports){ +'use strict'; + +var undefined; + +var $SyntaxError = SyntaxError; +var $Function = Function; +var $TypeError = TypeError; + +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = Object.getOwnPropertyDescriptor; +if ($gOPD) { + try { + $gOPD({}, ''); + } catch (e) { + $gOPD = null; // this is IE 8, which has a broken gOPD + } +} + +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = require('has-symbols')(); +var hasProto = require('has-proto')(); + +var getProto = Object.getPrototypeOf || ( + hasProto + ? function (x) { return x.__proto__; } // eslint-disable-line no-proto + : null +); + +var needsEval = {}; + +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, + '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': Error, + '%eval%': eval, // eslint-disable-line no-eval + '%EvalError%': EvalError, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': Object, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': RangeError, + '%ReferenceError%': ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet +}; + +if (getProto) { + try { + null.error; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } +} + +var doEval = function doEval(name) { + var value; + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + + INTRINSICS[name] = value; + + return value; +}; + +var LEGACY_ALIASES = { + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; + +var bind = require('function-bind'); +var hasOwn = require('hasown'); +var $concat = bind.call(Function.call, Array.prototype.concat); +var $spliceApply = bind.call(Function.apply, Array.prototype.splice); +var $replace = bind.call(Function.call, String.prototype.replace); +var $strSlice = bind.call(Function.call, String.prototype.slice); +var $exec = bind.call(Function.call, RegExp.prototype.exec); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ( + ( + (first === '"' || first === "'" || first === '`') + || (last === '"' || last === "'" || last === '`') + ) + && first !== last + ) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + return void undefined; + } + if ($gOPD && (i + 1) >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; + +},{"function-bind":389,"has-proto":393,"has-symbols":394,"hasown":397}],391:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; + +},{"get-intrinsic":390}],392:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +var hasPropertyDescriptors = function hasPropertyDescriptors() { + if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + return true; + } catch (e) { + // IE 8 has a broken defineProperty + return false; + } + } + return false; +}; + +hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + // node v0.6 has a bug where array lengths can be Set but not Defined + if (!hasPropertyDescriptors()) { + return null; + } + try { + return $defineProperty([], 'length', { value: 1 }).length !== 1; + } catch (e) { + // In Firefox 4-22, defining length on an array throws an exception. + return true; + } +}; + +module.exports = hasPropertyDescriptors; + +},{"get-intrinsic":390}],393:[function(require,module,exports){ +'use strict'; + +var test = { + foo: {} +}; + +var $Object = Object; + +module.exports = function hasProto() { + return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object); +}; + +},{}],394:[function(require,module,exports){ +'use strict'; + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = require('./shams'); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + +},{"./shams":395}],395:[function(require,module,exports){ +'use strict'; + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + +},{}],396:[function(require,module,exports){ +'use strict'; + +var hasSymbols = require('has-symbols/shams'); + +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; +}; + +},{"has-symbols/shams":395}],397:[function(require,module,exports){ +'use strict'; + +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = require('function-bind'); + +/** @type {(o: {}, p: PropertyKey) => p is keyof o} */ +module.exports = bind.call(call, $hasOwn); + +},{"function-bind":389}],398:[function(require,module,exports){ +var http = require('http') +var url = require('url') + +var https = module.exports + +for (var key in http) { + if (http.hasOwnProperty(key)) https[key] = http[key] +} + +https.request = function (params, cb) { + params = validateParams(params) + return http.request.call(this, params, cb) +} + +https.get = function (params, cb) { + params = validateParams(params) + return http.get.call(this, params, cb) +} + +function validateParams (params) { + if (typeof params === 'string') { + params = url.parse(params) + } + if (!params.protocol) { + params.protocol = 'https:' + } + if (params.protocol !== 'https:') { + throw new Error('Protocol "' + params.protocol + '" not supported. Expected "https:"') + } + return params +} + +},{"http":539,"url":543}],399:[function(require,module,exports){ +/*! + * humanize-ms - index.js + * Copyright(c) 2014 dead_horse + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var util = require('util'); +var ms = require('ms'); + +module.exports = function (t) { + if (typeof t === 'number') return t; + var r = ms(t); + if (r === undefined) { + var err = new Error(util.format('humanize-ms(%j) result undefined', t)); + console.warn(err.stack); + } + return r; +}; + +},{"ms":432,"util":489}],400:[function(require,module,exports){ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + +},{}],401:[function(require,module,exports){ +'use strict'; +var types = [ + require('./nextTick'), + require('./queueMicrotask'), + require('./mutation.js'), + require('./messageChannel'), + require('./stateChange'), + require('./timeout') +]; +var draining; +var currentQueue; +var queueIndex = -1; +var queue = []; +var scheduled = false; +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + nextTick(); + } +} + +//named nextTick for less confusing stack traces +function nextTick() { + if (draining) { + return; + } + scheduled = false; + draining = true; + var len = queue.length; + var timeout = setTimeout(cleanUpNextTick); + while (len) { + currentQueue = queue; + queue = []; + while (currentQueue && ++queueIndex < len) { + currentQueue[queueIndex].run(); + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + queueIndex = -1; + draining = false; + clearTimeout(timeout); +} +var scheduleDrain; +var i = -1; +var len = types.length; +while (++i < len) { + if (types[i] && types[i].test && types[i].test()) { + scheduleDrain = types[i].install(nextTick); + break; + } +} +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + var fun = this.fun; + var array = this.array; + switch (array.length) { + case 0: + return fun(); + case 1: + return fun(array[0]); + case 2: + return fun(array[0], array[1]); + case 3: + return fun(array[0], array[1], array[2]); + default: + return fun.apply(null, array); + } + +}; +module.exports = immediate; +function immediate(task) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(task, args)); + if (!scheduled && !draining) { + scheduled = true; + scheduleDrain(); + } +} + +},{"./messageChannel":402,"./mutation.js":403,"./nextTick":102,"./queueMicrotask":404,"./stateChange":405,"./timeout":406}],402:[function(require,module,exports){ +(function (global){(function (){ +'use strict'; + +exports.test = function () { + if (global.setImmediate) { + // we can only get here in IE10 + // which doesn't handel postMessage well + return false; + } + return typeof global.MessageChannel !== 'undefined'; +}; + +exports.install = function (func) { + var channel = new global.MessageChannel(); + channel.port1.onmessage = func; + return function () { + channel.port2.postMessage(0); + }; +}; +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],403:[function(require,module,exports){ +(function (global){(function (){ +'use strict'; +//based off rsvp https://github.com/tildeio/rsvp.js +//license https://github.com/tildeio/rsvp.js/blob/master/LICENSE +//https://github.com/tildeio/rsvp.js/blob/master/lib/rsvp/asap.js + +var Mutation = global.MutationObserver || global.WebKitMutationObserver; + +exports.test = function () { + return Mutation; +}; + +exports.install = function (handle) { + var called = 0; + var observer = new Mutation(handle); + var element = global.document.createTextNode(''); + observer.observe(element, { + characterData: true + }); + return function () { + element.data = (called = ++called % 2); + }; +}; +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],404:[function(require,module,exports){ +(function (global){(function (){ +'use strict'; +exports.test = function () { + return typeof global.queueMicrotask === 'function'; +}; + +exports.install = function (func) { + return function () { + global.queueMicrotask(func); + }; +}; + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],405:[function(require,module,exports){ +(function (global){(function (){ +'use strict'; + +exports.test = function () { + return 'document' in global && 'onreadystatechange' in global.document.createElement('script'); +}; + +exports.install = function (handle) { + return function () { + + // Create a +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +> **Note**: CommonJS usage +> In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()`, use the following approach: + +```js +import axios from 'axios'; +//const axios = require('axios'); // legacy way + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .finally(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .finally(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **Note**: `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'https://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience, aliases have been provided for all common request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute and option `allowAbsoluteUrls` is set to true. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `allowAbsoluteUrls` determines whether or not absolute URLs will override a configured `baseUrl`. + // When set to true (default), absolute values for `url` will override `baseUrl`. + // When set to false, absolute values for `url` will always be prepended by `baseUrl`. + allowAbsoluteUrls: true, + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional config that allows you to customize serializing `params`. + paramsSerializer: { + + // Custom encoder function which sends key/value pairs in an iterative fashion. + encode?: (param: string): string => { /* Do custom operations here and return transformed string */ }, + + // Custom serializer function for the entire parameter. Allows user to mimic pre 1.x behaviour. + serialize?: (params: Record, options?: ParamsSerializerOptions ), + + // Configuration for formatting array indexes in the params. + indexes: false // Three available options: (1) indexes: null (leads to no brackets), (2) (default) indexes: false (leads to empty brackets), (3) indexes: true (leads to brackets with indexes). + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer, FormData (form-data package) + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md) + adapter: function (config) { + /* ... */ + }, + // Also, you can set the name of the built-in adapter, or provide an array with their names + // to choose the first available in the environment + adapter: 'xhr', // 'fetch' | 'http' | ['xhr', 'http', 'fetch'] + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + // options are: 'ascii', 'ASCII', 'ansi', 'ANSI', 'binary', 'BINARY', 'base64', 'BASE64', 'base64url', + // 'BASE64URL', 'hex', 'HEX', 'latin1', 'LATIN1', 'ucs-2', 'UCS-2', 'ucs2', 'UCS2', 'utf-8', 'UTF-8', + // 'utf8', 'UTF8', 'utf16le', 'UTF16LE' + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `undefined` (default) - set XSRF header only for the same origin requests + withXSRFToken: boolean | undefined | ((config: InternalAxiosRequestConfig) => boolean | undefined), + + // `onUploadProgress` allows handling of progress events for uploads + // browser & node.js + onUploadProgress: function ({loaded, total, progress, bytes, estimated, rate, upload = true}) { + // Do whatever you want with the Axios progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser & node.js + onDownloadProgress: function ({loaded, total, progress, bytes, estimated, rate, download = true}) { + // Do whatever you want with the Axios progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 21, // default + + // `beforeRedirect` defines a function that will be called before redirect. + // Use this to adjust the request options upon redirecting, + // to inspect the latest response headers, + // or to cancel the request by throwing an error + // If maxRedirects is set to 0, `beforeRedirect` is not used. + beforeRedirect: (options, { headers }) => { + if (options.hostname === "example.com") { + options.auth = "user:password"; + } + }, + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `transport` determines the transport method that will be used to make the request. + // If defined, it will be used. Otherwise, if `maxRedirects` is 0, + // the default `http` or `https` library will be used, depending on the protocol specified in `protocol`. + // Otherwise, the `httpFollow` or `httpsFollow` library will be used, again depending on the protocol, + // which can handle redirects. + transport: undefined, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default before Node.js v19.0.0. After Node.js + // v19.0.0, you no longer need to customize the agent to enable `keepAlive` because + // `http.globalAgent` has `keepAlive` enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + // hostname: '127.0.0.1' // Takes precedence over 'host' if both are defined + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // an alternative way to cancel Axios requests using AbortController + signal: new AbortController().signal, + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // `insecureHTTPParser` boolean. + // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers. + // This may allow interoperability with non-conformant HTTP implementations. + // Using the insecure parser should be avoided. + // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback + // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none + insecureHTTPParser: undefined, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + }, + + env: { + // The FormData class to be used to automatically serialize the payload into a FormData object + FormData: window?.FormData || global?.FormData + }, + + formSerializer: { + visitor: (value, key, path, helpers) => {}; // custom visitor function to serialize form values + dots: boolean; // use dots instead of brackets format + metaTokens: boolean; // keep special endings like {} in parameter key + indexes: boolean; // array indexes format null - no brackets, false - empty brackets, true - brackets with indexes + }, + + // http adapter only (node.js) + maxRate: [ + 100 * 1024, // 100KB/s upload limit, + 100 * 1024 // 100KB/s download limit + ] +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lowercase and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults/index.js](https://github.com/axios/axios/blob/main/lib/defaults/index.js#L49), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js + +const instance = axios.create(); + +// Add a request interceptor +instance.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +instance.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const instance = axios.create(); +const myInterceptor = instance.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can also clear all interceptors for requests or responses. +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +instance.interceptors.request.clear(); // Removes interceptors from requests +instance.interceptors.response.use(function () {/*...*/}); +instance.interceptors.response.clear(); // Removes interceptors from responses +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The request interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +> **Note:** options parameter(having `synchronous` and `runWhen` properties) is only supported for request interceptors at the moment. + +### Multiple Interceptors + +Given you add multiple response interceptors +and when the response was fulfilled +- then each interceptor is executed +- then they are executed in the order they were added +- then only the last interceptor's result is returned +- then every interceptor receives the result of its predecessor +- and when the fulfillment-interceptor throws + - then the following fulfillment-interceptor is not called + - then the following rejection-interceptor is called + - once caught, another following fulfill-interceptor is called again (just like in a promise chain). + +Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all this in code. + +## Error Types + +There are many different axios error messages that can appear that can provide basic information about the specifics of the error and where opportunities may lie in debugging. + +The general structure of axios errors is as follows: +| Property | Definition | +| -------- | ---------- | +| message | A quick summary of the error message and the status it failed with. | +| name | This defines where the error originated from. For axios, it will always be an 'AxiosError'. | +| stack | Provides the stack trace of the error. | +| config | An axios config object with specific instance configurations defined by the user from when the request was made | +| code | Represents an axios identified error. The table below lists out specific definitions for internal axios error. | +| status | HTTP response status code. See [here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) for common HTTP response status code meanings. + +Below is a list of potential axios identified error: + +| Code | Definition | +| --- | --- | +| ERR_BAD_OPTION_VALUE | Invalid value provided in axios configuration. | +| ERR_BAD_OPTION | Invalid option provided in axios configuration. | +| ERR_NOT_SUPPORT | Feature or method not supported in the current axios environment. | +| ERR_DEPRECATED | Deprecated feature or method used in axios. | +| ERR_INVALID_URL | Invalid URL provided for axios request. | +| ECONNABORTED | Typically indicates that the request has been timed out (unless `transitional.clarifyTimeoutError` is set) or aborted by the browser or its plugin. | +| ERR_CANCELED | Feature or method is canceled explicitly by the user using an AbortSignal (or a CancelToken). | +| ETIMEDOUT | Request timed out due to exceeding default axios timelimit. `transitional.clarifyTimeoutError` must be set to `true`, otherwise a generic `ECONNABORTED` error will be thrown instead. | +| ERR_NETWORK | Network-related issue. In the browser, this error can also be caused by a [CORS](https://developer.mozilla.org/ru/docs/Web/HTTP/Guides/CORS) or [Mixed Content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) policy violation. The browser does not allow the JS code to clarify the real reason for the error caused by security issues, so please check the console. | +| ERR_FR_TOO_MANY_REDIRECTS | Request is redirected too many times; exceeds max redirects specified in axios configuration. | +| ERR_BAD_RESPONSE | Response cannot be parsed properly or is in an unexpected format. Usually related to a response with `5xx` status code. | +| ERR_BAD_REQUEST | The request has an unexpected format or is missing required parameters. Usually related to a response with `4xx` status code. | + +## Handling Errors + +the default behavior is to reject every response that returns with a status code that falls out of the range of 2xx and treat it as an error. + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can override the default condition (status >= 200 && status < 300) and define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +### AbortController + +Starting from `v0.22.0` Axios supports AbortController to cancel requests in fetch API way: + +```js +const controller = new AbortController(); + +axios.get('/foo/bar', { + signal: controller.signal +}).then(function(response) { + //... +}); +// cancel the request +controller.abort() +``` + +### CancelToken `👎deprecated` + +You can also cancel a request using a *CancelToken*. + +> The axios cancel token API is based on the withdrawn [cancellable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +> This API is deprecated since v0.22.0 and shouldn't be used in new projects + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> **Note:** you can cancel several requests with the same cancel token/abort controller. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make a real request. + +> During the transition period, you can use both cancellation APIs, even for the same request: + +## Using `application/x-www-form-urlencoded` format + +### URLSearchParams + +By default, axios serializes JavaScript objects to `JSON`. To send data in the [`application/x-www-form-urlencoded` format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) instead, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API, which is [supported](http://www.caniuse.com/#feat=urlsearchparams) in the vast majority of browsers,and [ Node](https://nodejs.org/api/url.html#url_class_urlsearchparams) starting with v10 (released in 2018). + +```js +const params = new URLSearchParams({ foo: 'bar' }); +params.append('extraparam', 'value'); +axios.post('/foo', params); +``` + +### Query string (Older browsers) + +For compatibility with very old browsers, there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Older Node.js versions + +For older Node.js engines, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('https://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +> **Note**: The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has [known issues](https://github.com/nodejs/node-v0.x-archive/issues/1665) with that use case. + +### 🆕 Automatic serialization to URLSearchParams + +Axios will automatically serialize the data object to urlencoded format if the content-type header is set to "application/x-www-form-urlencoded". + +```js +const data = { + x: 1, + arr: [1, 2, 3], + arr2: [1, [2], 3], + users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}], +}; + +await axios.postForm('https://postman-echo.com/post', data, + {headers: {'content-type': 'application/x-www-form-urlencoded'}} +); +``` + +The server will handle it as: + +```js + { + x: '1', + 'arr[]': [ '1', '2', '3' ], + 'arr2[0]': '1', + 'arr2[1][0]': '2', + 'arr2[2]': '3', + 'arr3[]': [ '1', '2', '3' ], + 'users[0][name]': 'Peter', + 'users[0][surname]': 'griffin', + 'users[1][name]': 'Thomas', + 'users[1][surname]': 'Anderson' + } +```` + +If your backend body-parser (like `body-parser` of `express.js`) supports nested objects decoding, you will get the same object on the server-side automatically + +```js + var app = express(); + + app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies + + app.post('/', function (req, res, next) { + // echo body as JSON + res.send(JSON.stringify(req.body)); + }); + + server = app.listen(3000); +``` + +## Using `multipart/form-data` format + +### FormData + +To send the data as a `multipart/formdata` you need to pass a formData instance as a payload. +Setting the `Content-Type` header is not required as Axios guesses it based on the payload type. + +```js +const formData = new FormData(); +formData.append('foo', 'bar'); + +axios.post('https://httpbin.org/post', formData); +``` + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form) +``` + +### 🆕 Automatic serialization to FormData + +Starting from `v0.27.0`, Axios supports automatic object serialization to a FormData object if the request `Content-Type` +header is set to `multipart/form-data`. + +The following request will submit the data in a FormData format (Browser & Node.js): + +```js +import axios from 'axios'; + +axios.post('https://httpbin.org/post', {x: 1}, { + headers: { + 'Content-Type': 'multipart/form-data' + } +}).then(({data}) => console.log(data)); +``` + +In the `node.js` build, the ([`form-data`](https://github.com/form-data/form-data)) polyfill is used by default. + +You can overload the FormData class by setting the `env.FormData` config variable, +but you probably won't need it in most cases: + +```js +const axios = require('axios'); +var FormData = require('form-data'); + +axios.post('https://httpbin.org/post', {x: 1, buf: new Buffer(10)}, { + headers: { + 'Content-Type': 'multipart/form-data' + } +}).then(({data}) => console.log(data)); +``` + +Axios FormData serializer supports some special endings to perform the following operations: + +- `{}` - serialize the value with JSON.stringify +- `[]` - unwrap the array-like object as separate fields with the same key + +> **Note**: unwrap/expand operation will be used by default on arrays and FileList objects + +FormData serializer supports additional options via `config.formSerializer: object` property to handle rare cases: + +- `visitor: Function` - user-defined visitor function that will be called recursively to serialize the data object +to a `FormData` object by following custom rules. + +- `dots: boolean = false` - use dot notation instead of brackets to serialize arrays and objects; + +- `metaTokens: boolean = true` - add the special ending (e.g `user{}: '{"name": "John"}'`) in the FormData key. +The back-end body-parser could potentially use this meta-information to automatically parse the value as JSON. + +- `indexes: null|false|true = false` - controls how indexes will be added to unwrapped keys of `flat` array-like objects. + + - `null` - don't add brackets (`arr: 1`, `arr: 2`, `arr: 3`) + - `false`(default) - add empty brackets (`arr[]: 1`, `arr[]: 2`, `arr[]: 3`) + - `true` - add brackets with indexes (`arr[0]: 1`, `arr[1]: 2`, `arr[2]: 3`) + +Let's say we have an object like this one: + +```js +const obj = { + x: 1, + arr: [1, 2, 3], + arr2: [1, [2], 3], + users: [{name: 'Peter', surname: 'Griffin'}, {name: 'Thomas', surname: 'Anderson'}], + 'obj2{}': [{x:1}] +}; +``` + +The following steps will be executed by the Axios serializer internally: + +```js +const formData = new FormData(); +formData.append('x', '1'); +formData.append('arr[]', '1'); +formData.append('arr[]', '2'); +formData.append('arr[]', '3'); +formData.append('arr2[0]', '1'); +formData.append('arr2[1][0]', '2'); +formData.append('arr2[2]', '3'); +formData.append('users[0][name]', 'Peter'); +formData.append('users[0][surname]', 'Griffin'); +formData.append('users[1][name]', 'Thomas'); +formData.append('users[1][surname]', 'Anderson'); +formData.append('obj2{}', '[{"x":1}]'); +``` + +Axios supports the following shortcut methods: `postForm`, `putForm`, `patchForm` +which are just the corresponding http methods with the `Content-Type` header preset to `multipart/form-data`. + +## Files Posting + +You can easily submit a single file: + +```js +await axios.postForm('https://httpbin.org/post', { + 'myVar' : 'foo', + 'file': document.querySelector('#fileInput').files[0] +}); +``` + +or multiple files as `multipart/form-data`: + +```js +await axios.postForm('https://httpbin.org/post', { + 'files[]': document.querySelector('#fileInput').files +}); +``` + +`FileList` object can be passed directly: + +```js +await axios.postForm('https://httpbin.org/post', document.querySelector('#fileInput').files) +``` + +All files will be sent with the same field names: `files[]`. + +## 🆕 HTML Form Posting (browser) + +Pass HTML Form element as a payload to submit it as `multipart/form-data` content. + +```js +await axios.postForm('https://httpbin.org/post', document.querySelector('#htmlForm')); +``` + +`FormData` and `HTMLForm` objects can also be posted as `JSON` by explicitly setting the `Content-Type` header to `application/json`: + +```js +await axios.post('https://httpbin.org/post', document.querySelector('#htmlForm'), { + headers: { + 'Content-Type': 'application/json' + } +}) +``` + +For example, the Form + +```html +
+ + + + + + + + + +
+``` + +will be submitted as the following JSON object: + +```js +{ + "foo": "1", + "deep": { + "prop": { + "spaced": "3" + } + }, + "baz": [ + "4", + "5" + ], + "user": { + "age": "value2" + } +} +```` + +Sending `Blobs`/`Files` as JSON (`base64`) is not currently supported. + +## 🆕 Progress capturing + +Axios supports both browser and node environments to capture request upload/download progress. +The frequency of progress events is forced to be limited to `3` times per second. + +```js +await axios.post(url, data, { + onUploadProgress: function (axiosProgressEvent) { + /*{ + loaded: number; + total?: number; + progress?: number; // in range [0..1] + bytes: number; // how many bytes have been transferred since the last trigger (delta) + estimated?: number; // estimated time in seconds + rate?: number; // upload speed in bytes + upload: true; // upload sign + }*/ + }, + + onDownloadProgress: function (axiosProgressEvent) { + /*{ + loaded: number; + total?: number; + progress?: number; + bytes: number; + estimated?: number; + rate?: number; // download speed in bytes + download: true; // download sign + }*/ + } +}); +``` + +You can also track stream upload/download progress in node.js: + +```js +const {data} = await axios.post(SERVER_URL, readableStream, { + onUploadProgress: ({progress}) => { + console.log((progress * 100).toFixed(2)); + }, + + headers: { + 'Content-Length': contentLength + }, + + maxRedirects: 0 // avoid buffering the entire stream +}); +```` + +> **Note:** +> Capturing FormData upload progress is not currently supported in node.js environments. + +> **⚠️ Warning** +> It is recommended to disable redirects by setting maxRedirects: 0 to upload the stream in the **node.js** environment, +> as follow-redirects package will buffer the entire stream in RAM without following the "backpressure" algorithm. + + +## 🆕 Rate limiting + +Download and upload rate limits can only be set for the http adapter (node.js): + +```js +const {data} = await axios.post(LOCAL_SERVER_URL, myBuffer, { + onUploadProgress: ({progress, rate}) => { + console.log(`Upload [${(progress*100).toFixed(2)}%]: ${(rate / 1024).toFixed(2)}KB/s`) + }, + + maxRate: [100 * 1024], // 100KB/s limit +}); +``` + +## 🆕 AxiosHeaders + +Axios has its own `AxiosHeaders` class to manipulate headers using a Map-like API that guarantees caseless work. +Although HTTP is case-insensitive in headers, Axios will retain the case of the original header for stylistic reasons +and for a workaround when servers mistakenly consider the header's case. +The old approach of directly manipulating headers object is still available, but deprecated and not recommended for future usage. + +### Working with headers + +An AxiosHeaders object instance can contain different types of internal values. that control setting and merging logic. +The final headers object with string values is obtained by Axios by calling the `toJSON` method. + +> Note: By JSON here we mean an object consisting only of string values intended to be sent over the network. + +The header value can be one of the following types: +- `string` - normal string value that will be sent to the server +- `null` - skip header when rendering to JSON +- `false` - skip header when rendering to JSON, additionally indicates that `set` method must be called with `rewrite` option set to `true` + to overwrite this value (Axios uses this internally to allow users to opt out of installing certain headers like `User-Agent` or `Content-Type`) +- `undefined` - value is not set + +> Note: The header value is considered set if it is not equal to undefined. + +The headers object is always initialized inside interceptors and transformers: + +```ts + axios.interceptors.request.use((request: InternalAxiosRequestConfig) => { + request.headers.set('My-header', 'value'); + + request.headers.set({ + "My-set-header1": "my-set-value1", + "My-set-header2": "my-set-value2" + }); + + request.headers.set('User-Agent', false); // disable subsequent setting the header by Axios + + request.headers.setContentType('text/plain'); + + request.headers['My-set-header2'] = 'newValue' // direct access is deprecated + + return request; + } + ); +```` + +You can iterate over an `AxiosHeaders` instance using a `for...of` statement: + +````js +const headers = new AxiosHeaders({ + foo: '1', + bar: '2', + baz: '3' +}); + +for(const [header, value] of headers) { + console.log(header, value); +} + +// foo 1 +// bar 2 +// baz 3 +```` + +### new AxiosHeaders(headers?) + +Constructs a new `AxiosHeaders` instance. + +``` +constructor(headers?: RawAxiosHeaders | AxiosHeaders | string); +``` + +If the headers object is a string, it will be parsed as RAW HTTP headers. + +````js +const headers = new AxiosHeaders(` +Host: www.bing.com +User-Agent: curl/7.54.0 +Accept: */*`); + +console.log(headers); + +// Object [AxiosHeaders] { +// host: 'www.bing.com', +// 'user-agent': 'curl/7.54.0', +// accept: '*/*' +// } +```` + +### AxiosHeaders#set + +```ts +set(headerName, value: Axios, rewrite?: boolean); +set(headerName, value, rewrite?: (this: AxiosHeaders, value: string, name: string, headers: RawAxiosHeaders) => boolean); +set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean); +``` + +The `rewrite` argument controls the overwriting behavior: +- `false` - do not overwrite if header's value is set (is not `undefined`) +- `undefined` (default) - overwrite the header unless its value is set to `false` +- `true` - rewrite anyway + +The option can also accept a user-defined function that determines whether the value should be overwritten or not. + +Returns `this`. + +### AxiosHeaders#get(header) + +``` + get(headerName: string, matcher?: true | AxiosHeaderMatcher): AxiosHeaderValue; + get(headerName: string, parser: RegExp): RegExpExecArray | null; +```` + +Returns the internal value of the header. It can take an extra argument to parse the header's value with `RegExp.exec`, +matcher function or internal key-value parser. + +```ts +const headers = new AxiosHeaders({ + 'Content-Type': 'multipart/form-data; boundary=Asrf456BGe4h' +}); + +console.log(headers.get('Content-Type')); +// multipart/form-data; boundary=Asrf456BGe4h + +console.log(headers.get('Content-Type', true)); // parse key-value pairs from a string separated with \s,;= delimiters: +// [Object: null prototype] { +// 'multipart/form-data': undefined, +// boundary: 'Asrf456BGe4h' +// } + + +console.log(headers.get('Content-Type', (value, name, headers) => { + return String(value).replace(/a/g, 'ZZZ'); +})); +// multipZZZrt/form-dZZZtZZZ; boundZZZry=Asrf456BGe4h + +console.log(headers.get('Content-Type', /boundary=(\w+)/)?.[0]); +// boundary=Asrf456BGe4h + +``` + +Returns the value of the header. + +### AxiosHeaders#has(header, matcher?) + +``` +has(header: string, matcher?: AxiosHeaderMatcher): boolean; +``` + +Returns `true` if the header is set (has no `undefined` value). + +### AxiosHeaders#delete(header, matcher?) + +``` +delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; +``` + +Returns `true` if at least one header has been removed. + +### AxiosHeaders#clear(matcher?) + +``` +clear(matcher?: AxiosHeaderMatcher): boolean; +``` + +Removes all headers. +Unlike the `delete` method matcher, this optional matcher will be used to match against the header name rather than the value. + +```ts +const headers = new AxiosHeaders({ + 'foo': '1', + 'x-foo': '2', + 'x-bar': '3', +}); + +console.log(headers.clear(/^x-/)); // true + +console.log(headers.toJSON()); // [Object: null prototype] { foo: '1' } +``` + +Returns `true` if at least one header has been cleared. + +### AxiosHeaders#normalize(format); + +If the headers object was changed directly, it can have duplicates with the same name but in different cases. +This method normalizes the headers object by combining duplicate keys into one. +Axios uses this method internally after calling each interceptor. +Set `format` to true for converting headers name to lowercase and capitalize the initial letters (`cOntEnt-type` => `Content-Type`) + +```js +const headers = new AxiosHeaders({ + 'foo': '1', +}); + +headers.Foo = '2'; +headers.FOO = '3'; + +console.log(headers.toJSON()); // [Object: null prototype] { foo: '1', Foo: '2', FOO: '3' } +console.log(headers.normalize().toJSON()); // [Object: null prototype] { foo: '3' } +console.log(headers.normalize(true).toJSON()); // [Object: null prototype] { Foo: '3' } +``` + +Returns `this`. + +### AxiosHeaders#concat(...targets) + +``` +concat(...targets: Array): AxiosHeaders; +``` + +Merges the instance with targets into a new `AxiosHeaders` instance. If the target is a string, it will be parsed as RAW HTTP headers. + +Returns a new `AxiosHeaders` instance. + +### AxiosHeaders#toJSON(asStrings?) + +```` +toJSON(asStrings?: boolean): RawAxiosHeaders; +```` + +Resolve all internal headers values into a new null prototype object. +Set `asStrings` to true to resolve arrays as a string containing all elements, separated by commas. + +### AxiosHeaders.from(thing?) + +```` +from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; +```` + +Returns a new `AxiosHeaders` instance created from the raw headers passed in, +or simply returns the given headers object if it's an `AxiosHeaders` instance. + +### AxiosHeaders.concat(...targets) + +```` +concat(...targets: Array): AxiosHeaders; +```` + +Returns a new `AxiosHeaders` instance created by merging the target objects. + +### Shortcuts + +The following shortcuts are available: + +- `setContentType`, `getContentType`, `hasContentType` + +- `setContentLength`, `getContentLength`, `hasContentLength` + +- `setAccept`, `getAccept`, `hasAccept` + +- `setUserAgent`, `getUserAgent`, `hasUserAgent` + +- `setContentEncoding`, `getContentEncoding`, `hasContentEncoding` + +## 🔥 Fetch adapter + +Fetch adapter was introduced in `v1.7.0`. By default, it will be used if `xhr` and `http` adapters are not available in the build, +or not supported by the environment. +To use it by default, it must be selected explicitly: + +```js +const {data} = axios.get(url, { + adapter: 'fetch' // by default ['xhr', 'http', 'fetch'] +}) +``` + +You can create a separate instance for this: + +```js +const fetchAxios = axios.create({ + adapter: 'fetch' +}); + +const {data} = fetchAxios.get(url); +``` + +The adapter supports the same functionality as `xhr` adapter, **including upload and download progress capturing**. +Also, it supports additional response types such as `stream` and `formdata` (if supported by the environment). + +### 🔥 Custom fetch + +Starting from `v1.12.0`, you can customize the fetch adapter to use a custom fetch API instead of environment globals. +You can pass a custom `fetch` function, `Request`, and `Response` constructors via env config. +This can be helpful in case of custom environments & app frameworks. + +Also, when using a custom fetch, you may need to set custom Request and Response too. If you don't set them, global objects will be used. +If your custom fetch api does not have these objects, and the globals are incompatible with a custom fetch, +you must disable their use inside the fetch adapter by passing null. + +> Note: Setting `Request` & `Response` to `null` will make it impossible for the fetch adapter to capture the upload & download progress. + +Basic example: + +```js +import customFetchFunction from 'customFetchModule'; + +const instance = axios.create({ + adapter: 'fetch', + onDownloadProgress(e) { + console.log('downloadProgress', e); + }, + env: { + fetch: customFetchFunction, + Request: null, // undefined -> use the global constructor + Response: null + } +}); +``` + +#### 🔥 Using with Tauri + +A minimal example of setting up Axios for use in a [Tauri](https://tauri.app/plugin/http-client/) app with a platform fetch function that ignores CORS policy for requests. + +```js +import { fetch } from "@tauri-apps/plugin-http"; +import axios from "axios"; + +const instance = axios.create({ + adapter: 'fetch', + onDownloadProgress(e) { + console.log('downloadProgress', e); + }, + env: { + fetch + } +}); + + const {data} = await instance.get("https://google.com"); +``` + +#### 🔥 Using with SvelteKit + +[SvelteKit](https://svelte.dev/docs/kit/web-standards#Fetch-APIs) framework has a custom implementation of the fetch function for server rendering (so called `load` functions), and also uses relative paths, +which makes it incompatible with the standard URL API. So, Axios must be configured to use the custom fetch API: + +```js +export async function load({ fetch }) { + const {data: post} = await axios.get('https://jsonplaceholder.typicode.com/posts/1', { + adapter: 'fetch', + env: { + fetch, + Request: null, + Response: null + } + }); + + return { post }; +} +``` + +## 🔥 HTTP2 + +In version `1.13.0`, experimental `HTTP2` support was added to the `http` adapter. +The `httpVersion` option is now available to select the protocol version used. +Additional native options for the internal `session.request()` call can be passed via the `http2Options` config. +This config also includes the custom `sessionTimeout` parameter, which defaults to `1000ms`. + +```js +const form = new FormData(); + + form.append('foo', '123'); + + const {data, headers, status} = await axios.post('https://httpbin.org/post', form, { + httpVersion: 2, + http2Options: { + // rejectUnauthorized: false, + // sessionTimeout: 1000 + }, + onUploadProgress(e) { + console.log('upload progress', e); + }, + onDownloadProgress(e) { + console.log('download progress', e); + }, + responseType: 'arraybuffer' + }); +``` + +## Semver + +Since Axios has reached a `v.1.0.0` we will fully embrace semver as per the spec [here](https://semver.org/) + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](https://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](https://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +Because axios dual publishes with an ESM default export and a CJS `module.exports`, there are some caveats. +The recommended setting is to use `"moduleResolution": "node16"` (this is implied by `"module": "node16"`). Note that this requires TypeScript 4.7 or greater. +If use ESM, your settings should be fine. +If you compile TypeScript to CJS and you can’t use `"moduleResolution": "node 16"`, you have to enable `esModuleInterop`. +If you use TypeScript to type check CJS JavaScript code, your only option is to use `"moduleResolution": "node16"`. + +## Online one-click setup + +You can use Gitpod, an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/main/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) +* [Ecosystem](https://github.com/axios/axios/blob/v1.x/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/v1.x/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/v1.x/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [AngularJS](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of AngularJS. + +## License + +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) diff --git a/node_modules/axios/dist/axios.js b/node_modules/axios/dist/axios.js new file mode 100644 index 0000000..17606d6 --- /dev/null +++ b/node_modules/axios/dist/axios.js @@ -0,0 +1,4471 @@ +/*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory()); +})(this, (function () { 'use strict'; + + function _AsyncGenerator(e) { + var r, t; + function resume(r, t) { + try { + var n = e[r](t), + o = n.value, + u = o instanceof _OverloadYield; + Promise.resolve(u ? o.v : o).then(function (t) { + if (u) { + var i = "return" === r ? "return" : "next"; + if (!o.k || t.done) return resume(i, t); + t = e[i](t).value; + } + settle(n.done ? "return" : "normal", t); + }, function (e) { + resume("throw", e); + }); + } catch (e) { + settle("throw", e); + } + } + function settle(e, n) { + switch (e) { + case "return": + r.resolve({ + value: n, + done: !0 + }); + break; + case "throw": + r.reject(n); + break; + default: + r.resolve({ + value: n, + done: !1 + }); + } + (r = r.next) ? resume(r.key, r.arg) : t = null; + } + this._invoke = function (e, n) { + return new Promise(function (o, u) { + var i = { + key: e, + arg: n, + resolve: o, + reject: u, + next: null + }; + t ? t = t.next = i : (r = t = i, resume(e, n)); + }); + }, "function" != typeof e.return && (this.return = void 0); + } + _AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () { + return this; + }, _AsyncGenerator.prototype.next = function (e) { + return this._invoke("next", e); + }, _AsyncGenerator.prototype.throw = function (e) { + return this._invoke("throw", e); + }, _AsyncGenerator.prototype.return = function (e) { + return this._invoke("return", e); + }; + function _OverloadYield(t, e) { + this.v = t, this.k = e; + } + function _asyncGeneratorDelegate(t) { + var e = {}, + n = !1; + function pump(e, r) { + return n = !0, r = new Promise(function (n) { + n(t[e](r)); + }), { + done: !1, + value: new _OverloadYield(r, 1) + }; + } + return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () { + return this; + }, e.next = function (t) { + return n ? (n = !1, t) : pump("next", t); + }, "function" == typeof t.throw && (e.throw = function (t) { + if (n) throw n = !1, t; + return pump("throw", t); + }), "function" == typeof t.return && (e.return = function (t) { + return n ? (n = !1, t) : pump("return", t); + }), e; + } + function _asyncIterator(r) { + var n, + t, + o, + e = 2; + for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { + if (t && null != (n = r[t])) return n.call(r); + if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); + t = "@@asyncIterator", o = "@@iterator"; + } + throw new TypeError("Object is not async iterable"); + } + function AsyncFromSyncIterator(r) { + function AsyncFromSyncIteratorContinuation(r) { + if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); + var n = r.done; + return Promise.resolve(r.value).then(function (r) { + return { + value: r, + done: n + }; + }); + } + return AsyncFromSyncIterator = function (r) { + this.s = r, this.n = r.next; + }, AsyncFromSyncIterator.prototype = { + s: null, + n: null, + next: function () { + return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); + }, + return: function (r) { + var n = this.s.return; + return void 0 === n ? Promise.resolve({ + value: r, + done: !0 + }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + }, + throw: function (r) { + var n = this.s.return; + return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); + } + }, new AsyncFromSyncIterator(r); + } + function _awaitAsyncGenerator(e) { + return new _OverloadYield(e, 0); + } + function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (null != t) { + var e, + n, + i, + u, + a = [], + f = !0, + o = !1; + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = !1; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); + } catch (r) { + o = !0, n = r; + } finally { + try { + if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + return a; + } + } + function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; + } + function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; + } + function _regeneratorRuntime() { + _regeneratorRuntime = function () { + return e; + }; + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: !0, + configurable: !0, + writable: !0 + }), t[e]; + } + try { + define({}, ""); + } catch (t) { + define = function (t, e, r) { + return t[e] = r; + }; + } + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + a(c.arg); + } + var r; + o(this, "_invoke", { + value: function (t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw new Error("Generator is already running"); + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: !0 + }; + } + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + if (c) { + var u = maybeInvokeDelegate(c, n); + if (u) { + if (u === y) continue; + return u; + } + } + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(!0); + } + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; + return next.value = t, next.done = !0, next; + }; + return i.next = i; + } + } + throw new TypeError(typeof e + " is not iterable"); + } + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: !0 + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: !0 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + void 0 === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + for (var n in e) r.push(n); + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = !1, next; + } + return next.done = !0, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function (e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + }, + stop: function () { + this.done = !0; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function (e) { + if (this.done) throw e; + var r = this; + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); + } else { + if (!u) throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function (t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function (t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function (t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + catch: function (t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.tryLoc === t) { + var n = r.completion; + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + return o; + } + } + throw new Error("illegal catch attempt"); + }, + delegateYield: function (e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : String(i); + } + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + function _wrapAsyncGenerator(fn) { + return function () { + return new _AsyncGenerator(fn.apply(this, arguments)); + }; + } + function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _createForOfIteratorHelper(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (!it) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + var F = function () {}; + return { + s: F, + n: function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }, + e: function (e) { + throw e; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var normalCompletion = true, + didErr = false, + err; + return { + s: function () { + it = it.call(o); + }, + n: function () { + var step = it.next(); + normalCompletion = step.done; + return step; + }, + e: function (e) { + didErr = true; + err = e; + }, + f: function () { + try { + if (!normalCompletion && it.return != null) it.return(); + } finally { + if (didErr) throw err; + } + } + }; + } + + /** + * Create a bound version of a function with a specified `this` context + * + * @param {Function} fn - The function to bind + * @param {*} thisArg - The value to be passed as the `this` parameter + * @returns {Function} A new function that will call the original function with the specified `this` context + */ + function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; + } + + // utils is a library of generic helper functions non-specific to axios + + var toString = Object.prototype.toString; + var getPrototypeOf = Object.getPrototypeOf; + var iterator = Symbol.iterator, + toStringTag = Symbol.toStringTag; + var kindOf = function (cache) { + return function (thing) { + var str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); + }; + }(Object.create(null)); + var kindOfTest = function kindOfTest(type) { + type = type.toLowerCase(); + return function (thing) { + return kindOf(thing) === type; + }; + }; + var typeOfTest = function typeOfTest(type) { + return function (thing) { + return _typeof(thing) === type; + }; + }; + + /** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ + var isArray = Array.isArray; + + /** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ + var isUndefined = typeOfTest('undefined'); + + /** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ + function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); + } + + /** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ + var isArrayBuffer = kindOfTest('ArrayBuffer'); + + /** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ + function isArrayBufferView(val) { + var result; + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && isArrayBuffer(val.buffer); + } + return result; + } + + /** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ + var isString = typeOfTest('string'); + + /** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ + var isFunction$1 = typeOfTest('function'); + + /** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ + var isNumber = typeOfTest('number'); + + /** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ + var isObject = function isObject(thing) { + return thing !== null && _typeof(thing) === 'object'; + }; + + /** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ + var isBoolean = function isBoolean(thing) { + return thing === true || thing === false; + }; + + /** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ + var isPlainObject = function isPlainObject(val) { + if (kindOf(val) !== 'object') { + return false; + } + var prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); + }; + + /** + * Determine if a value is an empty object (safely handles Buffers) + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an empty object, otherwise false + */ + var isEmptyObject = function isEmptyObject(val) { + // Early return for non-objects or Buffers to prevent RangeError + if (!isObject(val) || isBuffer(val)) { + return false; + } + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + // Fallback for any other objects that might cause RangeError with Object.keys() + return false; + } + }; + + /** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ + var isDate = kindOfTest('Date'); + + /** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ + var isFile = kindOfTest('File'); + + /** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ + var isBlob = kindOfTest('Blob'); + + /** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ + var isFileList = kindOfTest('FileList'); + + /** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ + var isStream = function isStream(val) { + return isObject(val) && isFunction$1(val.pipe); + }; + + /** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ + var isFormData = function isFormData(thing) { + var kind; + return thing && (typeof FormData === 'function' && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')); + }; + + /** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ + var isURLSearchParams = kindOfTest('URLSearchParams'); + var _map = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest), + _map2 = _slicedToArray(_map, 4), + isReadableStream = _map2[0], + isRequest = _map2[1], + isResponse = _map2[2], + isHeaders = _map2[3]; + + /** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ + var trim = function trim(str) { + return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + }; + + /** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ + function forEach(obj, fn) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref$allOwnKeys = _ref.allOwnKeys, + allOwnKeys = _ref$allOwnKeys === void 0 ? false : _ref$allOwnKeys; + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + var i; + var l; + + // Force an array if not already something iterable + if (_typeof(obj) !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Buffer check + if (isBuffer(obj)) { + return; + } + + // Iterate over object keys + var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + var len = keys.length; + var key; + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } + } + function findKey(obj, key) { + if (isBuffer(obj)) { + return null; + } + key = key.toLowerCase(); + var keys = Object.keys(obj); + var i = keys.length; + var _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; + } + var _global = function () { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : typeof window !== 'undefined' ? window : global; + }(); + var isContextDefined = function isContextDefined(context) { + return !isUndefined(context) && context !== _global; + }; + + /** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ + function merge( /* obj1, obj2, obj3, ... */ + ) { + var _ref2 = isContextDefined(this) && this || {}, + caseless = _ref2.caseless, + skipUndefined = _ref2.skipUndefined; + var result = {}; + var assignValue = function assignValue(val, key) { + var targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else if (!skipUndefined || !isUndefined(val)) { + result[targetKey] = val; + } + }; + for (var i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; + } + + /** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ + var extend = function extend(a, b, thisArg) { + var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, + allOwnKeys = _ref3.allOwnKeys; + forEach(b, function (val, key) { + if (thisArg && isFunction$1(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, { + allOwnKeys: allOwnKeys + }); + return a; + }; + + /** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ + var stripBOM = function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; + }; + + /** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ + var inherits = function inherits(constructor, superConstructor, props, descriptors) { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); + }; + + /** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ + var toFlatObject = function toFlatObject(sourceObj, destObj, filter, propFilter) { + var props; + var i; + var prop; + var merged = {}; + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + return destObj; + }; + + /** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ + var endsWith = function endsWith(str, searchString, position) { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + var lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; + + /** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ + var toArray = function toArray(thing) { + if (!thing) return null; + if (isArray(thing)) return thing; + var i = thing.length; + if (!isNumber(i)) return null; + var arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; + }; + + /** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ + // eslint-disable-next-line func-names + var isTypedArray = function (TypedArray) { + // eslint-disable-next-line func-names + return function (thing) { + return TypedArray && thing instanceof TypedArray; + }; + }(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + + /** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ + var forEachEntry = function forEachEntry(obj, fn) { + var generator = obj && obj[iterator]; + var _iterator = generator.call(obj); + var result; + while ((result = _iterator.next()) && !result.done) { + var pair = result.value; + fn.call(obj, pair[0], pair[1]); + } + }; + + /** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ + var matchAll = function matchAll(regExp, str) { + var matches; + var arr = []; + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + return arr; + }; + + /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ + var isHTMLForm = kindOfTest('HTMLFormElement'); + var toCamelCase = function toCamelCase(str) { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + }); + }; + + /* Creating a function that will check if an object has a property. */ + var hasOwnProperty = function (_ref4) { + var hasOwnProperty = _ref4.hasOwnProperty; + return function (obj, prop) { + return hasOwnProperty.call(obj, prop); + }; + }(Object.prototype); + + /** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ + var isRegExp = kindOfTest('RegExp'); + var reduceDescriptors = function reduceDescriptors(obj, reducer) { + var descriptors = Object.getOwnPropertyDescriptors(obj); + var reducedDescriptors = {}; + forEach(descriptors, function (descriptor, name) { + var ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + Object.defineProperties(obj, reducedDescriptors); + }; + + /** + * Makes all methods read-only + * @param {Object} obj + */ + + var freezeMethods = function freezeMethods(obj) { + reduceDescriptors(obj, function (descriptor, name) { + // skip restricted props in strict mode + if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + var value = obj[name]; + if (!isFunction$1(value)) return; + descriptor.enumerable = false; + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + if (!descriptor.set) { + descriptor.set = function () { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); + }; + var toObjectSet = function toObjectSet(arrayOrString, delimiter) { + var obj = {}; + var define = function define(arr) { + arr.forEach(function (value) { + obj[value] = true; + }); + }; + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + return obj; + }; + var noop = function noop() {}; + var toFiniteNumber = function toFiniteNumber(value, defaultValue) { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; + }; + + /** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ + function isSpecCompliantForm(thing) { + return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); + } + var toJSONObject = function toJSONObject(obj) { + var stack = new Array(10); + var visit = function visit(source, i) { + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + //Buffer check + if (isBuffer(source)) { + return source; + } + if (!('toJSON' in source)) { + stack[i] = source; + var target = isArray(source) ? [] : {}; + forEach(source, function (value, key) { + var reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + stack[i] = undefined; + return target; + } + } + return source; + }; + return visit(obj, 0); + }; + var isAsyncFn = kindOfTest('AsyncFunction'); + var isThenable = function isThenable(thing) { + return thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing["catch"]); + }; + + // original code + // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 + + var _setImmediate = function (setImmediateSupported, postMessageSupported) { + if (setImmediateSupported) { + return setImmediate; + } + return postMessageSupported ? function (token, callbacks) { + _global.addEventListener("message", function (_ref5) { + var source = _ref5.source, + data = _ref5.data; + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + return function (cb) { + callbacks.push(cb); + _global.postMessage(token, "*"); + }; + }("axios@".concat(Math.random()), []) : function (cb) { + return setTimeout(cb); + }; + }(typeof setImmediate === 'function', isFunction$1(_global.postMessage)); + var asap = typeof queueMicrotask !== 'undefined' ? queueMicrotask.bind(_global) : typeof process !== 'undefined' && process.nextTick || _setImmediate; + + // ********************* + + var isIterable = function isIterable(thing) { + return thing != null && isFunction$1(thing[iterator]); + }; + var utils$1 = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isBoolean: isBoolean, + isObject: isObject, + isPlainObject: isPlainObject, + isEmptyObject: isEmptyObject, + isReadableStream: isReadableStream, + isRequest: isRequest, + isResponse: isResponse, + isHeaders: isHeaders, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isRegExp: isRegExp, + isFunction: isFunction$1, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isTypedArray: isTypedArray, + isFileList: isFileList, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM, + inherits: inherits, + toFlatObject: toFlatObject, + kindOf: kindOf, + kindOfTest: kindOfTest, + endsWith: endsWith, + toArray: toArray, + forEachEntry: forEachEntry, + matchAll: matchAll, + isHTMLForm: isHTMLForm, + hasOwnProperty: hasOwnProperty, + hasOwnProp: hasOwnProperty, + // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors: reduceDescriptors, + freezeMethods: freezeMethods, + toObjectSet: toObjectSet, + toCamelCase: toCamelCase, + noop: noop, + toFiniteNumber: toFiniteNumber, + findKey: findKey, + global: _global, + isContextDefined: isContextDefined, + isSpecCompliantForm: isSpecCompliantForm, + toJSONObject: toJSONObject, + isAsyncFn: isAsyncFn, + isThenable: isThenable, + setImmediate: _setImmediate, + asap: asap, + isIterable: isIterable + }; + + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ + function AxiosError(message, code, config, request, response) { + Error.call(this); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack; + } + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } + } + utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.status + }; + } + }); + var prototype$1 = AxiosError.prototype; + var descriptors = {}; + ['ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED', 'ERR_NOT_SUPPORT', 'ERR_INVALID_URL' + // eslint-disable-next-line func-names + ].forEach(function (code) { + descriptors[code] = { + value: code + }; + }); + Object.defineProperties(AxiosError, descriptors); + Object.defineProperty(prototype$1, 'isAxiosError', { + value: true + }); + + // eslint-disable-next-line func-names + AxiosError.from = function (error, code, config, request, response, customProps) { + var axiosError = Object.create(prototype$1); + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, function (prop) { + return prop !== 'isAxiosError'; + }); + var msg = error && error.message ? error.message : 'Error'; + + // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) + var errCode = code == null && error ? error.code : code; + AxiosError.call(axiosError, msg, errCode, config, request, response); + + // Chain the original error on the standard field; non-enumerable to avoid JSON noise + if (error && axiosError.cause == null) { + Object.defineProperty(axiosError, 'cause', { + value: error, + configurable: true + }); + } + axiosError.name = error && error.name || 'Error'; + customProps && Object.assign(axiosError, customProps); + return axiosError; + }; + + // eslint-disable-next-line strict + var httpAdapter = null; + + /** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ + function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); + } + + /** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ + function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; + } + + /** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ + function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); + } + + /** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ + function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); + } + var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); + }); + + /** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + + /** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ + function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + var metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + var visitor = options.visitor || defaultVisitor; + var dots = options.dots; + var indexes = options.indexes; + var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + var useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + function convertValue(value) { + if (value === null) return ''; + if (utils$1.isDate(value)) { + return value.toISOString(); + } + if (utils$1.isBoolean(value)) { + return value.toString(); + } + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + var arr = value; + if (value && !path && _typeof(value) === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el)); + }); + return false; + } + } + if (isVisitable(value)) { + return true; + } + formData.append(renderKey(path, key, dots), convertValue(value)); + return false; + } + var stack = []; + var exposedHelpers = Object.assign(predicates, { + defaultVisitor: defaultVisitor, + convertValue: convertValue, + isVisitable: isVisitable + }); + function build(value, path) { + if (utils$1.isUndefined(value)) return; + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + stack.push(value); + utils$1.forEach(value, function each(el, key) { + var result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers); + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + stack.pop(); + } + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + build(obj); + return formData; + } + + /** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ + function encode$1(str) { + var charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); + } + + /** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ + function AxiosURLSearchParams(params, options) { + this._pairs = []; + params && toFormData(params, this, options); + } + var prototype = AxiosURLSearchParams.prototype; + prototype.append = function append(name, value) { + this._pairs.push([name, value]); + }; + prototype.toString = function toString(encoder) { + var _encode = encoder ? function (value) { + return encoder.call(this, value, encode$1); + } : encode$1; + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); + }; + + /** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ + function encode(val) { + return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+'); + } + + /** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?(object|Function)} options + * + * @returns {string} The formatted url + */ + function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + var _encode = options && options.encode || encode; + if (utils$1.isFunction(options)) { + options = { + serialize: options + }; + } + var serializeFn = options && options.serialize; + var serializedParams; + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode); + } + if (serializedParams) { + var hashmarkIndex = url.indexOf("#"); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + return url; + } + + var InterceptorManager = /*#__PURE__*/function () { + function InterceptorManager() { + _classCallCheck(this, InterceptorManager); + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + _createClass(InterceptorManager, [{ + key: "use", + value: function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + }, { + key: "eject", + value: function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + }, { + key: "clear", + value: function clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + }, { + key: "forEach", + value: function forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } + }]); + return InterceptorManager; + }(); + var InterceptorManager$1 = InterceptorManager; + + var transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }; + + var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; + + var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; + + var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; + + var platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] + }; + + var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + var _navigator = (typeof navigator === "undefined" ? "undefined" : _typeof(navigator)) === 'object' && navigator || undefined; + + /** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ + var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); + + /** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ + var hasStandardBrowserWebWorkerEnv = function () { + return typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && typeof self.importScripts === 'function'; + }(); + var origin = hasBrowserEnv && window.location.href || 'http://localhost'; + + var utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv, + navigator: _navigator, + origin: origin + }); + + var platform = _objectSpread2(_objectSpread2({}, utils), platform$1); + + function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), _objectSpread2({ + visitor: function visitor(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + return helpers.defaultVisitor.apply(this, arguments); + } + }, options)); + } + + /** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ + function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(function (match) { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); + } + + /** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ + function arrayToObject(arr) { + var obj = {}; + var keys = Object.keys(arr); + var i; + var len = keys.length; + var key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; + } + + /** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ + function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + var name = path[index++]; + if (name === '__proto__') return true; + var isNumericKey = Number.isFinite(+name); + var isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + return !isNumericKey; + } + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + var result = buildPath(path, value, target[name], index); + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + return !isNumericKey; + } + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + var obj = {}; + utils$1.forEachEntry(formData, function (name, value) { + buildPath(parsePropPath(name), value, obj, 0); + }); + return obj; + } + return null; + } + + /** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ + function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + return (encoder || JSON.stringify)(rawValue); + } + var defaults = { + transitional: transitionalDefaults, + adapter: ['xhr', 'http', 'fetch'], + transformRequest: [function transformRequest(data, headers) { + var contentType = headers.getContentType() || ''; + var hasJSONContentType = contentType.indexOf('application/json') > -1; + var isObjectPayload = utils$1.isObject(data); + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + var isFormData = utils$1.isFormData(data); + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + var isFileList; + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + var _FormData = this.env && this.env.FormData; + return toFormData(isFileList ? { + 'files[]': data + } : data, _FormData && new _FormData(), this.formSerializer); + } + } + if (isObjectPayload || hasJSONContentType) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + return data; + }], + transformResponse: [function transformResponse(data) { + var transitional = this.transitional || defaults.transitional; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var JSONRequested = this.responseType === 'json'; + if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { + return data; + } + if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var strictJSONParsing = !silentJSONParsing && JSONRequested; + try { + return JSON.parse(data, this.parseReviver); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + return data; + }], + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + maxContentLength: -1, + maxBodyLength: -1, + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } + }; + utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (method) { + defaults.headers[method] = {}; + }); + var defaults$1 = defaults; + + // RawAxiosHeaders whose duplicates are ignored by node + // c.f. https://nodejs.org/api/http.html#http_message_headers + var ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']); + + /** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ + var parseHeaders = (function (rawHeaders) { + var parsed = {}; + var key; + var val; + var i; + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + if (!key || parsed[key] && ignoreDuplicateOf[key]) { + return; + } + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + return parsed; + }); + + var $internals = Symbol('internals'); + function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); + } + function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); + } + function parseTokens(str) { + var tokens = Object.create(null); + var tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + var match; + while (match = tokensRE.exec(str)) { + tokens[match[1]] = match[2]; + } + return tokens; + } + var isValidHeaderName = function isValidHeaderName(str) { + return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + }; + function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + if (isHeaderNameFilter) { + value = header; + } + if (!utils$1.isString(value)) return; + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } + } + function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, function (w, _char, str) { + return _char.toUpperCase() + str; + }); + } + function buildAccessors(obj, header) { + var accessorName = utils$1.toCamelCase(' ' + header); + ['get', 'set', 'has'].forEach(function (methodName) { + Object.defineProperty(obj, methodName + accessorName, { + value: function value(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); + } + var AxiosHeaders = /*#__PURE__*/function (_Symbol$iterator, _Symbol$toStringTag) { + function AxiosHeaders(headers) { + _classCallCheck(this, AxiosHeaders); + headers && this.set(headers); + } + _createClass(AxiosHeaders, [{ + key: "set", + value: function set(header, valueOrRewrite, rewrite) { + var self = this; + function setHeader(_value, _header, _rewrite) { + var lHeader = normalizeHeader(_header); + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + var key = utils$1.findKey(self, lHeader); + if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) { + self[key || _header] = normalizeValue(_value); + } + } + var setHeaders = function setHeaders(headers, _rewrite) { + return utils$1.forEach(headers, function (_value, _header) { + return setHeader(_value, _header, _rewrite); + }); + }; + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { + var obj = {}, + dest, + key; + var _iterator = _createForOfIteratorHelper(header), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var entry = _step.value; + if (!utils$1.isArray(entry)) { + throw TypeError('Object iterator must return a key-value pair'); + } + obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]] : entry[1]; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + setHeaders(obj, valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + return this; + } + }, { + key: "get", + value: function get(header, parser) { + header = normalizeHeader(header); + if (header) { + var key = utils$1.findKey(this, header); + if (key) { + var value = this[key]; + if (!parser) { + return value; + } + if (parser === true) { + return parseTokens(value); + } + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + }, { + key: "has", + value: function has(header, matcher) { + header = normalizeHeader(header); + if (header) { + var key = utils$1.findKey(this, header); + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + return false; + } + }, { + key: "delete", + value: function _delete(header, matcher) { + var self = this; + var deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + var key = utils$1.findKey(self, _header); + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + deleted = true; + } + } + } + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + return deleted; + } + }, { + key: "clear", + value: function clear(matcher) { + var keys = Object.keys(this); + var i = keys.length; + var deleted = false; + while (i--) { + var key = keys[i]; + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + return deleted; + } + }, { + key: "normalize", + value: function normalize(format) { + var self = this; + var headers = {}; + utils$1.forEach(this, function (value, header) { + var key = utils$1.findKey(headers, header); + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + var normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) { + delete self[header]; + } + self[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + }, { + key: "concat", + value: function concat() { + var _this$constructor; + for (var _len = arguments.length, targets = new Array(_len), _key = 0; _key < _len; _key++) { + targets[_key] = arguments[_key]; + } + return (_this$constructor = this.constructor).concat.apply(_this$constructor, [this].concat(targets)); + } + }, { + key: "toJSON", + value: function toJSON(asStrings) { + var obj = Object.create(null); + utils$1.forEach(this, function (value, header) { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + return obj; + } + }, { + key: _Symbol$iterator, + value: function value() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + }, { + key: "toString", + value: function toString() { + return Object.entries(this.toJSON()).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + header = _ref2[0], + value = _ref2[1]; + return header + ': ' + value; + }).join('\n'); + } + }, { + key: "getSetCookie", + value: function getSetCookie() { + return this.get("set-cookie") || []; + } + }, { + key: _Symbol$toStringTag, + get: function get() { + return 'AxiosHeaders'; + } + }], [{ + key: "from", + value: function from(thing) { + return thing instanceof this ? thing : new this(thing); + } + }, { + key: "concat", + value: function concat(first) { + var computed = new this(first); + for (var _len2 = arguments.length, targets = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + targets[_key2 - 1] = arguments[_key2]; + } + targets.forEach(function (target) { + return computed.set(target); + }); + return computed; + } + }, { + key: "accessor", + value: function accessor(header) { + var internals = this[$internals] = this[$internals] = { + accessors: {} + }; + var accessors = internals.accessors; + var prototype = this.prototype; + function defineAccessor(_header) { + var lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } + }]); + return AxiosHeaders; + }(Symbol.iterator, Symbol.toStringTag); + AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + + // reserved names hotfix + utils$1.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) { + var value = _ref3.value; + var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: function get() { + return value; + }, + set: function set(headerValue) { + this[mapped] = headerValue; + } + }; + }); + utils$1.freezeMethods(AxiosHeaders); + var AxiosHeaders$1 = AxiosHeaders; + + /** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ + function transformData(fns, response) { + var config = this || defaults$1; + var context = response || config; + var headers = AxiosHeaders$1.from(context.headers); + var data = context.data; + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + headers.normalize(); + return data; + } + + function isCancel(value) { + return !!(value && value.__CANCEL__); + } + + /** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ + function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; + } + utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true + }); + + /** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ + function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError('Request failed with status code ' + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response)); + } + } + + function parseProtocol(url) { + var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; + } + + /** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ + function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + var bytes = new Array(samplesCount); + var timestamps = new Array(samplesCount); + var head = 0; + var tail = 0; + var firstSampleTS; + min = min !== undefined ? min : 1000; + return function push(chunkLength) { + var now = Date.now(); + var startedAt = timestamps[tail]; + if (!firstSampleTS) { + firstSampleTS = now; + } + bytes[head] = chunkLength; + timestamps[head] = now; + var i = tail; + var bytesCount = 0; + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + head = (head + 1) % samplesCount; + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + if (now - firstSampleTS < min) { + return; + } + var passed = startedAt && now - startedAt; + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; + } + + /** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ + function throttle(fn, freq) { + var timestamp = 0; + var threshold = 1000 / freq; + var lastArgs; + var timer; + var invoke = function invoke(args) { + var now = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Date.now(); + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn.apply(void 0, _toConsumableArray(args)); + }; + var throttled = function throttled() { + var now = Date.now(); + var passed = now - timestamp; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + if (passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(function () { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + var flush = function flush() { + return lastArgs && invoke(lastArgs); + }; + return [throttled, flush]; + } + + var progressEventReducer = function progressEventReducer(listener, isDownloadStream) { + var freq = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3; + var bytesNotified = 0; + var _speedometer = speedometer(50, 250); + return throttle(function (e) { + var loaded = e.loaded; + var total = e.lengthComputable ? e.total : undefined; + var progressBytes = loaded - bytesNotified; + var rate = _speedometer(progressBytes); + var inRange = loaded <= total; + bytesNotified = loaded; + var data = _defineProperty({ + loaded: loaded, + total: total, + progress: total ? loaded / total : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e, + lengthComputable: total != null + }, isDownloadStream ? 'download' : 'upload', true); + listener(data); + }, freq); + }; + var progressEventDecorator = function progressEventDecorator(total, throttled) { + var lengthComputable = total != null; + return [function (loaded) { + return throttled[0]({ + lengthComputable: lengthComputable, + total: total, + loaded: loaded + }); + }, throttled[1]]; + }; + var asyncDecorator = function asyncDecorator(fn) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + return utils$1.asap(function () { + return fn.apply(void 0, args); + }); + }; + }; + + var isURLSameOrigin = platform.hasStandardBrowserEnv ? function (origin, isMSIE) { + return function (url) { + url = new URL(url, platform.origin); + return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port); + }; + }(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : function () { + return true; + }; + + var cookies = platform.hasStandardBrowserEnv ? + // Standard browser envs support document.cookie + { + write: function write(name, value, expires, path, domain, secure, sameSite) { + if (typeof document === 'undefined') return; + var cookie = ["".concat(name, "=").concat(encodeURIComponent(value))]; + if (utils$1.isNumber(expires)) { + cookie.push("expires=".concat(new Date(expires).toUTCString())); + } + if (utils$1.isString(path)) { + cookie.push("path=".concat(path)); + } + if (utils$1.isString(domain)) { + cookie.push("domain=".concat(domain)); + } + if (secure === true) { + cookie.push('secure'); + } + if (utils$1.isString(sameSite)) { + cookie.push("SameSite=".concat(sameSite)); + } + document.cookie = cookie.join('; '); + }, + read: function read(name) { + if (typeof document === 'undefined') return null; + var match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); + return match ? decodeURIComponent(match[1]) : null; + }, + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000, '/'); + } + } : + // Non-standard browser env (web workers, react-native) lack needed support. + { + write: function write() {}, + read: function read() { + return null; + }, + remove: function remove() {} + }; + + /** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ + function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); + } + + /** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ + function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; + } + + /** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ + function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { + var isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; + } + + var headersToObject = function headersToObject(thing) { + return thing instanceof AxiosHeaders$1 ? _objectSpread2({}, thing) : thing; + }; + + /** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ + function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + function getMergedValue(target, source, prop, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({ + caseless: caseless + }, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, prop, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, prop, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + var mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: function headers(a, b, prop) { + return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true); + } + }; + utils$1.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) { + var merge = mergeMap[prop] || mergeDeepProperties; + var configValue = merge(config1[prop], config2[prop], prop); + utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); + }); + return config; + } + + var resolveConfig = (function (config) { + var newConfig = mergeConfig({}, config); + var data = newConfig.data, + withXSRFToken = newConfig.withXSRFToken, + xsrfHeaderName = newConfig.xsrfHeaderName, + xsrfCookieName = newConfig.xsrfCookieName, + headers = newConfig.headers, + auth = newConfig.auth; + newConfig.headers = headers = AxiosHeaders$1.from(headers); + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + + // HTTP basic authentication + if (auth) { + headers.set('Authorization', 'Basic ' + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))); + } + if (utils$1.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(undefined); // browser handles it + } else if (utils$1.isFunction(data.getHeaders)) { + // Node.js FormData (like form-data package) + var formHeaders = data.getHeaders(); + // Only set safe headers to avoid overwriting security headers + var allowedHeaders = ['content-type', 'content-length']; + Object.entries(formHeaders).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + val = _ref2[1]; + if (allowedHeaders.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + } + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) { + // Add xsrf header + var xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + return newConfig; + }); + + var isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + var xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var _config = resolveConfig(config); + var requestData = _config.data; + var requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); + var responseType = _config.responseType, + onUploadProgress = _config.onUploadProgress, + onDownloadProgress = _config.onDownloadProgress; + var onCanceled; + var uploadThrottled, downloadThrottled; + var flushUpload, flushDownload; + function done() { + flushUpload && flushUpload(); // flush events + flushDownload && flushDownload(); // flush events + + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + _config.signal && _config.signal.removeEventListener('abort', onCanceled); + } + var request = new XMLHttpRequest(); + request.open(_config.method.toUpperCase(), _config.url, true); + + // Set the request timeout in MS + request.timeout = _config.timeout; + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = AxiosHeaders$1.from('getAllResponseHeaders' in request && request.getAllResponseHeaders()); + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError(event) { + // Browsers deliver a ProgressEvent in XHR onerror + // (message may be empty; when present, surface it) + // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event + var msg = event && event.message ? event.message : 'Network Error'; + var err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); + // attach the underlying event for consumers who want details + err.event = event || null; + reject(err); + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; + var transitional = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = _config.responseType; + } + + // Handle progress if needed + if (onDownloadProgress) { + var _progressEventReducer = progressEventReducer(onDownloadProgress, true); + var _progressEventReducer2 = _slicedToArray(_progressEventReducer, 2); + downloadThrottled = _progressEventReducer2[0]; + flushDownload = _progressEventReducer2[1]; + request.addEventListener('progress', downloadThrottled); + } + + // Not all browsers support upload events + if (onUploadProgress && request.upload) { + var _progressEventReducer3 = progressEventReducer(onUploadProgress); + var _progressEventReducer4 = _slicedToArray(_progressEventReducer3, 2); + uploadThrottled = _progressEventReducer4[0]; + flushUpload = _progressEventReducer4[1]; + request.upload.addEventListener('progress', uploadThrottled); + request.upload.addEventListener('loadend', flushUpload); + } + if (_config.cancelToken || _config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function onCanceled(cancel) { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); + } + } + var protocol = parseProtocol(_config.url); + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + // Send the request + request.send(requestData || null); + }); + }; + + var composeSignals = function composeSignals(signals, timeout) { + var _signals = signals = signals ? signals.filter(Boolean) : [], + length = _signals.length; + if (timeout || length) { + var controller = new AbortController(); + var aborted; + var onabort = function onabort(reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + var err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + var timer = timeout && setTimeout(function () { + timer = null; + onabort(new AxiosError("timeout ".concat(timeout, " of ms exceeded"), AxiosError.ETIMEDOUT)); + }, timeout); + var unsubscribe = function unsubscribe() { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach(function (signal) { + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); + }); + signals = null; + } + }; + signals.forEach(function (signal) { + return signal.addEventListener('abort', onabort); + }); + var signal = controller.signal; + signal.unsubscribe = function () { + return utils$1.asap(unsubscribe); + }; + return signal; + } + }; + var composeSignals$1 = composeSignals; + + var streamChunk = /*#__PURE__*/_regeneratorRuntime().mark(function streamChunk(chunk, chunkSize) { + var len, pos, end; + return _regeneratorRuntime().wrap(function streamChunk$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + len = chunk.byteLength; + if (!(!chunkSize || len < chunkSize)) { + _context.next = 5; + break; + } + _context.next = 4; + return chunk; + case 4: + return _context.abrupt("return"); + case 5: + pos = 0; + case 6: + if (!(pos < len)) { + _context.next = 13; + break; + } + end = pos + chunkSize; + _context.next = 10; + return chunk.slice(pos, end); + case 10: + pos = end; + _context.next = 6; + break; + case 13: + case "end": + return _context.stop(); + } + }, streamChunk); + }); + var readBytes = /*#__PURE__*/function () { + var _ref = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(iterable, chunkSize) { + var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk; + return _regeneratorRuntime().wrap(function _callee$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + _iteratorAbruptCompletion = false; + _didIteratorError = false; + _context2.prev = 2; + _iterator = _asyncIterator(readStream(iterable)); + case 4: + _context2.next = 6; + return _awaitAsyncGenerator(_iterator.next()); + case 6: + if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) { + _context2.next = 12; + break; + } + chunk = _step.value; + return _context2.delegateYield(_asyncGeneratorDelegate(_asyncIterator(streamChunk(chunk, chunkSize))), "t0", 9); + case 9: + _iteratorAbruptCompletion = false; + _context2.next = 4; + break; + case 12: + _context2.next = 18; + break; + case 14: + _context2.prev = 14; + _context2.t1 = _context2["catch"](2); + _didIteratorError = true; + _iteratorError = _context2.t1; + case 18: + _context2.prev = 18; + _context2.prev = 19; + if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) { + _context2.next = 23; + break; + } + _context2.next = 23; + return _awaitAsyncGenerator(_iterator["return"]()); + case 23: + _context2.prev = 23; + if (!_didIteratorError) { + _context2.next = 26; + break; + } + throw _iteratorError; + case 26: + return _context2.finish(23); + case 27: + return _context2.finish(18); + case 28: + case "end": + return _context2.stop(); + } + }, _callee, null, [[2, 14, 18, 28], [19,, 23, 27]]); + })); + return function readBytes(_x, _x2) { + return _ref.apply(this, arguments); + }; + }(); + var readStream = /*#__PURE__*/function () { + var _ref2 = _wrapAsyncGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(stream) { + var reader, _yield$_awaitAsyncGen, done, value; + return _regeneratorRuntime().wrap(function _callee2$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + if (!stream[Symbol.asyncIterator]) { + _context3.next = 3; + break; + } + return _context3.delegateYield(_asyncGeneratorDelegate(_asyncIterator(stream)), "t0", 2); + case 2: + return _context3.abrupt("return"); + case 3: + reader = stream.getReader(); + _context3.prev = 4; + case 5: + _context3.next = 7; + return _awaitAsyncGenerator(reader.read()); + case 7: + _yield$_awaitAsyncGen = _context3.sent; + done = _yield$_awaitAsyncGen.done; + value = _yield$_awaitAsyncGen.value; + if (!done) { + _context3.next = 12; + break; + } + return _context3.abrupt("break", 16); + case 12: + _context3.next = 14; + return value; + case 14: + _context3.next = 5; + break; + case 16: + _context3.prev = 16; + _context3.next = 19; + return _awaitAsyncGenerator(reader.cancel()); + case 19: + return _context3.finish(16); + case 20: + case "end": + return _context3.stop(); + } + }, _callee2, null, [[4,, 16, 20]]); + })); + return function readStream(_x3) { + return _ref2.apply(this, arguments); + }; + }(); + var trackStream = function trackStream(stream, chunkSize, onProgress, onFinish) { + var iterator = readBytes(stream, chunkSize); + var bytes = 0; + var done; + var _onFinish = function _onFinish(e) { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + return new ReadableStream({ + pull: function pull(controller) { + return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { + var _yield$iterator$next, _done, value, len, loadedBytes; + return _regeneratorRuntime().wrap(function _callee3$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + _context4.prev = 0; + _context4.next = 3; + return iterator.next(); + case 3: + _yield$iterator$next = _context4.sent; + _done = _yield$iterator$next.done; + value = _yield$iterator$next.value; + if (!_done) { + _context4.next = 10; + break; + } + _onFinish(); + controller.close(); + return _context4.abrupt("return"); + case 10: + len = value.byteLength; + if (onProgress) { + loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + _context4.next = 19; + break; + case 15: + _context4.prev = 15; + _context4.t0 = _context4["catch"](0); + _onFinish(_context4.t0); + throw _context4.t0; + case 19: + case "end": + return _context4.stop(); + } + }, _callee3, null, [[0, 15]]); + }))(); + }, + cancel: function cancel(reason) { + _onFinish(reason); + return iterator["return"](); + } + }, { + highWaterMark: 2 + }); + }; + + var DEFAULT_CHUNK_SIZE = 64 * 1024; + var isFunction = utils$1.isFunction; + var globalFetchAPI = function (_ref) { + var Request = _ref.Request, + Response = _ref.Response; + return { + Request: Request, + Response: Response + }; + }(utils$1.global); + var _utils$global = utils$1.global, + ReadableStream$1 = _utils$global.ReadableStream, + TextEncoder = _utils$global.TextEncoder; + var test = function test(fn) { + try { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + return !!fn.apply(void 0, args); + } catch (e) { + return false; + } + }; + var factory = function factory(env) { + env = utils$1.merge.call({ + skipUndefined: true + }, globalFetchAPI, env); + var _env = env, + envFetch = _env.fetch, + Request = _env.Request, + Response = _env.Response; + var isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; + var isRequestSupported = isFunction(Request); + var isResponseSupported = isFunction(Response); + if (!isFetchSupported) { + return false; + } + var isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); + var encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? function (encoder) { + return function (str) { + return encoder.encode(str); + }; + }(new TextEncoder()) : ( /*#__PURE__*/function () { + var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(str) { + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _context.t0 = Uint8Array; + _context.next = 3; + return new Request(str).arrayBuffer(); + case 3: + _context.t1 = _context.sent; + return _context.abrupt("return", new _context.t0(_context.t1)); + case 5: + case "end": + return _context.stop(); + } + }, _callee); + })); + return function (_x) { + return _ref2.apply(this, arguments); + }; + }())); + var supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(function () { + var duplexAccessed = false; + var hasContentType = new Request(platform.origin, { + body: new ReadableStream$1(), + method: 'POST', + get duplex() { + duplexAccessed = true; + return 'half'; + } + }).headers.has('Content-Type'); + return duplexAccessed && !hasContentType; + }); + var supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(function () { + return utils$1.isReadableStream(new Response('').body); + }); + var resolvers = { + stream: supportsResponseStream && function (res) { + return res.body; + } + }; + isFetchSupported && function () { + ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(function (type) { + !resolvers[type] && (resolvers[type] = function (res, config) { + var method = res && res[type]; + if (method) { + return method.call(res); + } + throw new AxiosError("Response type '".concat(type, "' is not supported"), AxiosError.ERR_NOT_SUPPORT, config); + }); + }); + }(); + var getBodyLength = /*#__PURE__*/function () { + var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(body) { + var _request; + return _regeneratorRuntime().wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (!(body == null)) { + _context2.next = 2; + break; + } + return _context2.abrupt("return", 0); + case 2: + if (!utils$1.isBlob(body)) { + _context2.next = 4; + break; + } + return _context2.abrupt("return", body.size); + case 4: + if (!utils$1.isSpecCompliantForm(body)) { + _context2.next = 9; + break; + } + _request = new Request(platform.origin, { + method: 'POST', + body: body + }); + _context2.next = 8; + return _request.arrayBuffer(); + case 8: + return _context2.abrupt("return", _context2.sent.byteLength); + case 9: + if (!(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body))) { + _context2.next = 11; + break; + } + return _context2.abrupt("return", body.byteLength); + case 11: + if (utils$1.isURLSearchParams(body)) { + body = body + ''; + } + if (!utils$1.isString(body)) { + _context2.next = 16; + break; + } + _context2.next = 15; + return encodeText(body); + case 15: + return _context2.abrupt("return", _context2.sent.byteLength); + case 16: + case "end": + return _context2.stop(); + } + }, _callee2); + })); + return function getBodyLength(_x2) { + return _ref3.apply(this, arguments); + }; + }(); + var resolveBodyLength = /*#__PURE__*/function () { + var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(headers, body) { + var length; + return _regeneratorRuntime().wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + length = utils$1.toFiniteNumber(headers.getContentLength()); + return _context3.abrupt("return", length == null ? getBodyLength(body) : length); + case 2: + case "end": + return _context3.stop(); + } + }, _callee3); + })); + return function resolveBodyLength(_x3, _x4) { + return _ref4.apply(this, arguments); + }; + }(); + return /*#__PURE__*/function () { + var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(config) { + var _resolveConfig, url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, _resolveConfig$withCr, withCredentials, fetchOptions, _fetch, composedSignal, request, unsubscribe, requestContentLength, _request, contentTypeHeader, _progressEventDecorat, _progressEventDecorat2, onProgress, flush, isCredentialsSupported, resolvedOptions, response, isStreamResponse, options, responseContentLength, _ref6, _ref7, _onProgress, _flush, responseData; + return _regeneratorRuntime().wrap(function _callee4$(_context4) { + while (1) switch (_context4.prev = _context4.next) { + case 0: + _resolveConfig = resolveConfig(config), url = _resolveConfig.url, method = _resolveConfig.method, data = _resolveConfig.data, signal = _resolveConfig.signal, cancelToken = _resolveConfig.cancelToken, timeout = _resolveConfig.timeout, onDownloadProgress = _resolveConfig.onDownloadProgress, onUploadProgress = _resolveConfig.onUploadProgress, responseType = _resolveConfig.responseType, headers = _resolveConfig.headers, _resolveConfig$withCr = _resolveConfig.withCredentials, withCredentials = _resolveConfig$withCr === void 0 ? 'same-origin' : _resolveConfig$withCr, fetchOptions = _resolveConfig.fetchOptions; + _fetch = envFetch || fetch; + responseType = responseType ? (responseType + '').toLowerCase() : 'text'; + composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + request = null; + unsubscribe = composedSignal && composedSignal.unsubscribe && function () { + composedSignal.unsubscribe(); + }; + _context4.prev = 6; + _context4.t0 = onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head'; + if (!_context4.t0) { + _context4.next = 13; + break; + } + _context4.next = 11; + return resolveBodyLength(headers, data); + case 11: + _context4.t1 = requestContentLength = _context4.sent; + _context4.t0 = _context4.t1 !== 0; + case 13: + if (!_context4.t0) { + _context4.next = 17; + break; + } + _request = new Request(url, { + method: 'POST', + body: data, + duplex: "half" + }); + if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { + headers.setContentType(contentTypeHeader); + } + if (_request.body) { + _progressEventDecorat = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))), _progressEventDecorat2 = _slicedToArray(_progressEventDecorat, 2), onProgress = _progressEventDecorat2[0], flush = _progressEventDecorat2[1]; + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + case 17: + if (!utils$1.isString(withCredentials)) { + withCredentials = withCredentials ? 'include' : 'omit'; + } + + // Cloudflare Workers throws when credentials are defined + // see https://github.com/cloudflare/workerd/issues/902 + isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + resolvedOptions = _objectSpread2(_objectSpread2({}, fetchOptions), {}, { + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : undefined + }); + request = isRequestSupported && new Request(url, resolvedOptions); + _context4.next = 23; + return isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions); + case 23: + response = _context4.sent; + isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); + if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { + options = {}; + ['status', 'statusText', 'headers'].forEach(function (prop) { + options[prop] = response[prop]; + }); + responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length')); + _ref6 = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [], _ref7 = _slicedToArray(_ref6, 2), _onProgress = _ref7[0], _flush = _ref7[1]; + response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, _onProgress, function () { + _flush && _flush(); + unsubscribe && unsubscribe(); + }), options); + } + responseType = responseType || 'text'; + _context4.next = 29; + return resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config); + case 29: + responseData = _context4.sent; + !isStreamResponse && unsubscribe && unsubscribe(); + _context4.next = 33; + return new Promise(function (resolve, reject) { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders$1.from(response.headers), + status: response.status, + statusText: response.statusText, + config: config, + request: request + }); + }); + case 33: + return _context4.abrupt("return", _context4.sent); + case 36: + _context4.prev = 36; + _context4.t2 = _context4["catch"](6); + unsubscribe && unsubscribe(); + if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context4.t2.message))) { + _context4.next = 41; + break; + } + throw Object.assign(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), { + cause: _context4.t2.cause || _context4.t2 + }); + case 41: + throw AxiosError.from(_context4.t2, _context4.t2 && _context4.t2.code, config, request); + case 42: + case "end": + return _context4.stop(); + } + }, _callee4, null, [[6, 36]]); + })); + return function (_x5) { + return _ref5.apply(this, arguments); + }; + }(); + }; + var seedCache = new Map(); + var getFetch = function getFetch(config) { + var env = config && config.env || {}; + var fetch = env.fetch, + Request = env.Request, + Response = env.Response; + var seeds = [Request, Response, fetch]; + var len = seeds.length, + i = len, + seed, + target, + map = seedCache; + while (i--) { + seed = seeds[i]; + target = map.get(seed); + target === undefined && map.set(seed, target = i ? new Map() : factory(env)); + map = target; + } + return target; + }; + getFetch(); + + /** + * Known adapters mapping. + * Provides environment-specific adapters for Axios: + * - `http` for Node.js + * - `xhr` for browsers + * - `fetch` for fetch API-based requests + * + * @type {Object} + */ + var knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter, + fetch: { + get: getFetch + } + }; + + // Assign adapter names for easier debugging and identification + utils$1.forEach(knownAdapters, function (fn, value) { + if (fn) { + try { + Object.defineProperty(fn, 'name', { + value: value + }); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', { + value: value + }); + } + }); + + /** + * Render a rejection reason string for unknown or unsupported adapters + * + * @param {string} reason + * @returns {string} + */ + var renderReason = function renderReason(reason) { + return "- ".concat(reason); + }; + + /** + * Check if the adapter is resolved (function, null, or false) + * + * @param {Function|null|false} adapter + * @returns {boolean} + */ + var isResolvedHandle = function isResolvedHandle(adapter) { + return utils$1.isFunction(adapter) || adapter === null || adapter === false; + }; + + /** + * Get the first suitable adapter from the provided list. + * Tries each adapter in order until a supported one is found. + * Throws an AxiosError if no adapter is suitable. + * + * @param {Array|string|Function} adapters - Adapter(s) by name or function. + * @param {Object} config - Axios request configuration + * @throws {AxiosError} If no suitable adapter is available + * @returns {Function} The resolved adapter function + */ + function getAdapter(adapters, config) { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + var _adapters = adapters, + length = _adapters.length; + var nameOrAdapter; + var adapter; + var rejectedReasons = {}; + for (var i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + var id = void 0; + adapter = nameOrAdapter; + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + if (adapter === undefined) { + throw new AxiosError("Unknown adapter '".concat(id, "'")); + } + } + if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { + break; + } + rejectedReasons[id || '#' + i] = adapter; + } + if (!adapter) { + var reasons = Object.entries(rejectedReasons).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + id = _ref2[0], + state = _ref2[1]; + return "adapter ".concat(id, " ") + (state === false ? 'is not supported by the environment' : 'is not available in the build'); + }); + var s = length ? reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0]) : 'as no adapter specified'; + throw new AxiosError("There is no suitable adapter to dispatch the request " + s, 'ERR_NOT_SUPPORT'); + } + return adapter; + } + + /** + * Exports Axios adapters and utility to resolve an adapter + */ + var adapters = { + /** + * Resolve an adapter from a list of adapter names or functions. + * @type {Function} + */ + getAdapter: getAdapter, + /** + * Exposes all known adapters + * @type {Object} + */ + adapters: knownAdapters + }; + + /** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } + } + + /** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ + function dispatchRequest(config) { + throwIfCancellationRequested(config); + config.headers = AxiosHeaders$1.from(config.headers); + + // Transform request data + config.data = transformData.call(config, config.transformRequest); + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + var adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call(config, config.transformResponse, response); + response.headers = AxiosHeaders$1.from(response.headers); + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call(config, config.transformResponse, reason.response); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + return Promise.reject(reason); + }); + } + + var VERSION = "1.13.2"; + + var validators$1 = {}; + + // eslint-disable-next-line func-names + ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function (type, i) { + validators$1[type] = function validator(thing) { + return _typeof(thing) === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; + }); + var deprecatedWarnings = {}; + + /** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ + validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function (value, opt, opts) { + if (validator === false) { + throw new AxiosError(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), AxiosError.ERR_DEPRECATED); + } + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn(formatMessage(opt, ' has been deprecated since v' + version + ' and will be removed in the near future')); + } + return validator ? validator(value, opt, opts) : true; + }; + }; + validators$1.spelling = function spelling(correctSpelling) { + return function (value, opt) { + // eslint-disable-next-line no-console + console.warn("".concat(opt, " is likely a misspelling of ").concat(correctSpelling)); + return true; + }; + }; + + /** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + + function assertOptions(options, schema, allowUnknown) { + if (_typeof(options) !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } + } + var validator = { + assertOptions: assertOptions, + validators: validators$1 + }; + + var validators = validator.validators; + + /** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ + var Axios = /*#__PURE__*/function () { + function Axios(instanceConfig) { + _classCallCheck(this, Axios); + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + _createClass(Axios, [{ + key: "request", + value: (function () { + var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(configOrUrl, config) { + var dummy, stack; + return _regeneratorRuntime().wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return this._request(configOrUrl, config); + case 3: + return _context.abrupt("return", _context.sent); + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](0); + if (_context.t0 instanceof Error) { + dummy = {}; + Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); + + // slice off the Error: ... line + stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + try { + if (!_context.t0.stack) { + _context.t0.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(_context.t0.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + _context.t0.stack += '\n' + stack; + } + } catch (e) { + // ignore the case where "stack" is an un-writable property + } + } + throw _context.t0; + case 10: + case "end": + return _context.stop(); + } + }, _callee, this, [[0, 6]]); + })); + function request(_x, _x2) { + return _request2.apply(this, arguments); + } + return request; + }()) + }, { + key: "_request", + value: function _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + config = mergeConfig(this.defaults, config); + var _config = config, + transitional = _config.transitional, + paramsSerializer = _config.paramsSerializer, + headers = _config.headers; + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators["boolean"]), + forcedJSONParsing: validators.transitional(validators["boolean"]), + clarifyTimeoutError: validators.transitional(validators["boolean"]) + }, false); + } + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators["function"], + serialize: validators["function"] + }, true); + } + } + + // Set config.allowAbsoluteUrls + if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { + config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + } else { + config.allowAbsoluteUrls = true; + } + validator.assertOptions(config, { + baseUrl: validators.spelling('baseURL'), + withXsrfToken: validators.spelling('withXSRFToken') + }, true); + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]); + headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) { + delete headers[method]; + }); + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + var promise; + var i = 0; + var len; + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest.bind(this), undefined]; + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); + len = chain.length; + promise = Promise.resolve(config); + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + return promise; + } + len = requestInterceptorChain.length; + var newConfig = config; + while (i < len) { + var onFulfilled = requestInterceptorChain[i++]; + var onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + i = 0; + len = responseInterceptorChain.length; + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + return promise; + } + }, { + key: "getUri", + value: function getUri(config) { + config = mergeConfig(this.defaults, config); + var fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + return buildURL(fullPath, config.params, config.paramsSerializer); + } + }]); + return Axios; + }(); // Provide aliases for supported request methods + utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function (url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; + }); + utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url: url, + data: data + })); + }; + } + Axios.prototype[method] = generateHTTPMethod(); + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); + }); + var Axios$1 = Axios; + + /** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ + var CancelToken = /*#__PURE__*/function () { + function CancelToken(executor) { + _classCallCheck(this, CancelToken); + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + var token = this; + + // eslint-disable-next-line func-names + this.promise.then(function (cancel) { + if (!token._listeners) return; + var i = token._listeners.length; + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = function (onfulfilled) { + var _resolve; + // eslint-disable-next-line func-names + var promise = new Promise(function (resolve) { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + return promise; + }; + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + _createClass(CancelToken, [{ + key: "throwIfRequested", + value: function throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + }, { + key: "subscribe", + value: function subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + }, { + key: "unsubscribe", + value: function unsubscribe(listener) { + if (!this._listeners) { + return; + } + var index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + }, { + key: "toAbortSignal", + value: function toAbortSignal() { + var _this = this; + var controller = new AbortController(); + var abort = function abort(err) { + controller.abort(err); + }; + this.subscribe(abort); + controller.signal.unsubscribe = function () { + return _this.unsubscribe(abort); + }; + return controller.signal; + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + }], [{ + key: "source", + value: function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; + } + }]); + return CancelToken; + }(); + var CancelToken$1 = CancelToken; + + /** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ + function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + } + + /** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ + function isAxiosError(payload) { + return utils$1.isObject(payload) && payload.isAxiosError === true; + } + + var HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, + WebServerIsDown: 521, + ConnectionTimedOut: 522, + OriginIsUnreachable: 523, + TimeoutOccurred: 524, + SslHandshakeFailed: 525, + InvalidSslCertificate: 526 + }; + Object.entries(HttpStatusCode).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + HttpStatusCode[value] = key; + }); + var HttpStatusCode$1 = HttpStatusCode; + + /** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ + function createInstance(defaultConfig) { + var context = new Axios$1(defaultConfig); + var instance = bind(Axios$1.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$1.prototype, context, { + allOwnKeys: true + }); + + // Copy context to instance + utils$1.extend(instance, context, null, { + allOwnKeys: true + }); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + return instance; + } + + // Create the default instance to be exported + var axios = createInstance(defaults$1); + + // Expose Axios class to allow class inheritance + axios.Axios = Axios$1; + + // Expose Cancel & CancelToken + axios.CanceledError = CanceledError; + axios.CancelToken = CancelToken$1; + axios.isCancel = isCancel; + axios.VERSION = VERSION; + axios.toFormData = toFormData; + + // Expose AxiosError class + axios.AxiosError = AxiosError; + + // alias for CanceledError for backward compatibility + axios.Cancel = axios.CanceledError; + + // Expose all/spread + axios.all = function all(promises) { + return Promise.all(promises); + }; + axios.spread = spread; + + // Expose isAxiosError + axios.isAxiosError = isAxiosError; + + // Expose mergeConfig + axios.mergeConfig = mergeConfig; + axios.AxiosHeaders = AxiosHeaders$1; + axios.formToJSON = function (thing) { + return formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + }; + axios.getAdapter = adapters.getAdapter; + axios.HttpStatusCode = HttpStatusCode$1; + axios["default"] = axios; + + return axios; + +})); +//# sourceMappingURL=axios.js.map diff --git a/node_modules/axios/dist/axios.js.map b/node_modules/axios/dist/axios.js.map new file mode 100644 index 0000000..53f39b7 --- /dev/null +++ b/node_modules/axios/dist/axios.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/null.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/defaults/transitional.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/browser/index.js","../lib/platform/common/utils.js","../lib/platform/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/core/settle.js","../lib/helpers/parseProtocol.js","../lib/helpers/speedometer.js","../lib/helpers/throttle.js","../lib/helpers/progressEventReducer.js","../lib/helpers/isURLSameOrigin.js","../lib/helpers/cookies.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/core/buildFullPath.js","../lib/core/mergeConfig.js","../lib/helpers/resolveConfig.js","../lib/adapters/xhr.js","../lib/helpers/composeSignals.js","../lib/helpers/trackStream.js","../lib/adapters/fetch.js","../lib/adapters/adapters.js","../lib/core/dispatchRequest.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n if (isBuffer(obj)){\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless, skipUndefined} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n const msg = error && error.message ? error.message : 'Error';\n\n // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)\n const errCode = code == null && error ? error.code : code;\n AxiosError.call(axiosError, msg, errCode, config, request, response);\n\n // Chain the original error on the standard field; non-enumerable to avoid JSON noise\n if (error && axiosError.cause == null) {\n Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });\n }\n\n axiosError.name = (error && error.name) || 'Error';\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, this.parseReviver);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));\n return match ? decodeURIComponent(match[1]) : null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)\n };\n\n utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n request = null;\n };\n \n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst {isFunction} = utils;\n\nconst globalFetchAPI = (({Request, Response}) => ({\n Request, Response\n}))(utils.global);\n\nconst {\n ReadableStream, TextEncoder\n} = utils.global;\n\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst factory = (env) => {\n env = utils.merge.call({\n skipUndefined: true\n }, globalFetchAPI, env);\n\n const {fetch: envFetch, Request, Response} = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Request(str).arrayBuffer())\n );\n\n const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n };\n\n isFetchSupported && ((() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n })());\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n }\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n }\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request = null;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && \"credentials\" in Request.prototype;\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n }\n}\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const {fetch, Request, Response} = env;\n const seeds = [\n Request, Response, fetch\n ];\n\n let len = seeds.length, i = len,\n seed, target, map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n * \n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n }\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', { value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n * \n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n * \n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n * \n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters\n};\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.13.2\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["bind","fn","thisArg","wrap","apply","arguments","toString","Object","prototype","getPrototypeOf","iterator","Symbol","toStringTag","kindOf","cache","thing","str","call","slice","toLowerCase","create","kindOfTest","type","typeOfTest","_typeof","isArray","Array","isUndefined","isBuffer","val","constructor","isFunction","isArrayBuffer","isArrayBufferView","result","ArrayBuffer","isView","buffer","isString","isNumber","isObject","isBoolean","isPlainObject","isEmptyObject","keys","length","e","isDate","isFile","isBlob","isFileList","isStream","pipe","isFormData","kind","FormData","append","isURLSearchParams","_map","map","_map2","_slicedToArray","isReadableStream","isRequest","isResponse","isHeaders","trim","replace","forEach","obj","_ref","undefined","_ref$allOwnKeys","allOwnKeys","i","l","getOwnPropertyNames","len","key","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","merge","_ref2","caseless","skipUndefined","assignValue","targetKey","extend","a","b","_ref3","stripBOM","content","charCodeAt","inherits","superConstructor","props","descriptors","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","prop","merged","endsWith","searchString","position","String","lastIndex","indexOf","toArray","arr","isTypedArray","TypedArray","Uint8Array","forEachEntry","generator","_iterator","next","done","pair","matchAll","regExp","matches","exec","push","isHTMLForm","toCamelCase","replacer","m","p1","p2","toUpperCase","hasOwnProperty","_ref4","isRegExp","reduceDescriptors","reducer","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","noop","toFiniteNumber","defaultValue","Number","isFinite","isSpecCompliantForm","toJSONObject","stack","visit","source","target","reducedValue","isAsyncFn","isThenable","then","_setImmediate","setImmediateSupported","postMessageSupported","setImmediate","token","callbacks","addEventListener","_ref5","data","shift","cb","postMessage","concat","Math","random","setTimeout","asap","queueMicrotask","process","nextTick","isIterable","hasOwnProp","AxiosError","message","code","config","request","response","captureStackTrace","status","utils","toJSON","description","number","fileName","lineNumber","columnNumber","from","error","customProps","axiosError","msg","errCode","cause","configurable","isVisitable","removeBrackets","renderKey","path","dots","each","join","isFlatArray","some","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","defined","option","visitor","defaultVisitor","_Blob","Blob","useBlob","convertValue","toISOString","Buffer","JSON","stringify","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","encoder","_encode","buildURL","url","serialize","serializeFn","serializedParams","hashmarkIndex","InterceptorManager","_classCallCheck","handlers","_createClass","use","fulfilled","rejected","synchronous","runWhen","eject","id","clear","forEachHandler","h","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","URLSearchParams","isBrowser","classes","protocols","hasBrowserEnv","document","_navigator","navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","origin","location","href","_objectSpread","platform","toURLEncodedForm","helpers","isNode","parsePropPath","arrayToObject","formDataToJSON","buildPath","isNumericKey","isLast","entries","stringifySafely","rawValue","parser","parse","defaults","transitional","transitionalDefaults","adapter","transformRequest","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","formSerializer","_FormData","env","transformResponse","JSONRequested","responseType","strictJSONParsing","parseReviver","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","method","ignoreDuplicateOf","rawHeaders","parsed","line","substring","$internals","normalizeHeader","header","normalizeValue","parseTokens","tokens","tokensRE","isValidHeaderName","matchHeaderValue","isHeaderNameFilter","formatHeader","w","char","buildAccessors","accessorName","methodName","arg1","arg2","arg3","AxiosHeaders","_Symbol$iterator","_Symbol$toStringTag","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","parseHeaders","dest","_createForOfIteratorHelper","_step","s","n","entry","_toConsumableArray","err","f","get","has","matcher","_delete","deleted","deleteHeader","normalize","format","normalized","_this$constructor","_len","targets","asStrings","getSetCookie","first","computed","_len2","_key2","accessor","internals","accessors","defineAccessor","mapped","headerValue","transformData","fns","transform","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","settle","resolve","reject","ERR_BAD_REQUEST","floor","parseProtocol","speedometer","samplesCount","min","bytes","timestamps","head","tail","firstSampleTS","chunkLength","now","Date","startedAt","bytesCount","passed","round","throttle","freq","timestamp","threshold","lastArgs","timer","invoke","args","clearTimeout","throttled","flush","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","loaded","total","lengthComputable","progressBytes","rate","inRange","_defineProperty","progress","estimated","event","progressEventDecorator","asyncDecorator","isMSIE","URL","protocol","host","port","userAgent","write","expires","domain","secure","sameSite","cookie","toUTCString","read","RegExp","decodeURIComponent","remove","isAbsoluteURL","combineURLs","baseURL","relativeURL","buildFullPath","requestedURL","allowAbsoluteUrls","isRelativeUrl","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding","computeConfigValue","configValue","newConfig","auth","btoa","username","password","unescape","getHeaders","formHeaders","allowedHeaders","includes","isURLSameOrigin","xsrfValue","cookies","isXHRAdapterSupported","XMLHttpRequest","Promise","dispatchXhrRequest","_config","resolveConfig","requestData","requestHeaders","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","unsubscribe","signal","removeEventListener","open","onloadend","responseHeaders","getAllResponseHeaders","responseData","responseText","statusText","_resolve","_reject","onreadystatechange","handleLoad","readyState","responseURL","onabort","handleAbort","ECONNABORTED","onerror","handleError","ERR_NETWORK","ontimeout","handleTimeout","timeoutErrorMessage","ETIMEDOUT","setRequestHeader","_progressEventReducer","_progressEventReducer2","upload","_progressEventReducer3","_progressEventReducer4","cancel","abort","subscribe","aborted","send","composeSignals","signals","_signals","Boolean","controller","AbortController","reason","streamChunk","_regeneratorRuntime","mark","chunk","chunkSize","pos","end","streamChunk$","_context","prev","byteLength","abrupt","stop","readBytes","_wrapAsyncGenerator","_callee","iterable","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_callee$","_context2","_asyncIterator","readStream","_awaitAsyncGenerator","sent","delegateYield","_asyncGeneratorDelegate","t1","finish","_x","_x2","_callee2","stream","reader","_yield$_awaitAsyncGen","_callee2$","_context3","asyncIterator","getReader","_x3","trackStream","onProgress","onFinish","_onFinish","ReadableStream","pull","_asyncToGenerator","_callee3","_yield$iterator$next","_done","loadedBytes","_callee3$","_context4","close","enqueue","t0","highWaterMark","DEFAULT_CHUNK_SIZE","globalFetchAPI","Request","Response","_utils$global","TextEncoder","factory","_env","envFetch","fetch","isFetchSupported","isRequestSupported","isResponseSupported","isReadableStreamSupported","encodeText","arrayBuffer","supportsRequestStream","duplexAccessed","hasContentType","body","duplex","supportsResponseStream","resolvers","res","ERR_NOT_SUPPORT","getBodyLength","_request","size","resolveBodyLength","getContentLength","_x4","_callee4","_resolveConfig","_resolveConfig$withCr","fetchOptions","_fetch","composedSignal","requestContentLength","contentTypeHeader","_progressEventDecorat","_progressEventDecorat2","isCredentialsSupported","resolvedOptions","isStreamResponse","responseContentLength","_ref6","_ref7","_onProgress","_flush","_callee4$","toAbortSignal","credentials","t2","_x5","seedCache","Map","getFetch","seeds","seed","knownAdapters","http","httpAdapter","xhr","xhrAdapter","fetchAdapter","renderReason","isResolvedHandle","getAdapter","adapters","_adapters","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","onAdapterResolution","onAdapterRejection","VERSION","validators","validator","deprecatedWarnings","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","spelling","correctSpelling","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","_request2","configOrUrl","dummy","baseUrl","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","unshiftRequestInterceptors","interceptor","unshift","responseInterceptorChain","pushResponseInterceptors","promise","chain","onFulfilled","onRejected","getUri","fullPath","forEachMethodNoData","forEachMethodWithData","generateHTTPMethod","isForm","httpMethod","CancelToken","executor","resolvePromise","promiseExecutor","_listeners","onfulfilled","splice","_this","c","spread","callback","isAxiosError","payload","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","WebServerIsDown","ConnectionTimedOut","OriginIsUnreachable","TimeoutOccurred","SslHandshakeFailed","InvalidSslCertificate","createInstance","defaultConfig","instance","axios","Cancel","all","promises","formToJSON"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,GAAG,SAASA,GAAGA,CAACC,QAAQ,EAAE;EACjC,EAAA,OAAOvU,OAAO,CAACsU,GAAG,CAACC,QAAQ,CAAC,CAAA;EAC9B,CAAC,CAAA;EAEDH,KAAK,CAAC7E,MAAM,GAAGA,MAAM,CAAA;;EAErB;EACA6E,KAAK,CAAC3E,YAAY,GAAGA,YAAY,CAAA;;EAEjC;EACA2E,KAAK,CAAC5W,WAAW,GAAGA,WAAW,CAAA;EAE/B4W,KAAK,CAAC3e,YAAY,GAAGA,cAAY,CAAA;EAEjC2e,KAAK,CAACI,UAAU,GAAG,UAAAv1B,KAAK,EAAA;EAAA,EAAA,OAAI2S,cAAc,CAACxG,OAAK,CAACzE,UAAU,CAAC1H,KAAK,CAAC,GAAG,IAAIwC,QAAQ,CAACxC,KAAK,CAAC,GAAGA,KAAK,CAAC,CAAA;EAAA,CAAA,CAAA;EAEjGm1B,KAAK,CAAChJ,UAAU,GAAGC,QAAQ,CAACD,UAAU,CAAA;EAEtCgJ,KAAK,CAACzE,cAAc,GAAGA,gBAAc,CAAA;EAErCyE,KAAK,CAAA,SAAA,CAAQ,GAAGA,KAAK;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/axios/dist/axios.min.js b/node_modules/axios/dist/axios.min.js new file mode 100644 index 0000000..2b482fa --- /dev/null +++ b/node_modules/axios/dist/axios.min.js @@ -0,0 +1,3 @@ +/*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,(function(){"use strict";function e(e){var r,n;function o(r,n){try{var a=e[r](n),u=a.value,s=u instanceof t;Promise.resolve(s?u.v:u).then((function(t){if(s){var n="return"===r?"return":"next";if(!u.k||t.done)return o(n,t);t=e[n](t).value}i(a.done?"return":"normal",t)}),(function(e){o("throw",e)}))}catch(e){i("throw",e)}}function i(e,t){switch(e){case"return":r.resolve({value:t,done:!0});break;case"throw":r.reject(t);break;default:r.resolve({value:t,done:!1})}(r=r.next)?o(r.key,r.arg):n=null}this._invoke=function(e,t){return new Promise((function(i,a){var u={key:e,arg:t,resolve:i,reject:a,next:null};n?n=n.next=u:(r=n=u,o(e,t))}))},"function"!=typeof e.return&&(this.return=void 0)}function t(e,t){this.v=e,this.k=t}function r(e){var r={},n=!1;function o(r,o){return n=!0,o=new Promise((function(t){t(e[r](o))})),{done:!1,value:new t(o,1)}}return r["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},r.next=function(e){return n?(n=!1,e):o("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e;return o("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return n?(n=!1,e):o("return",e)}),r}function n(e){var t,r,n,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e);if(n&&null!=(t=e[n]))return new o(t.call(e));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function o(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return o=function(e){this.s=e,this.n=e.next},o.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new o(e)}function i(e){return new t(e,0)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function c(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function l(t){return function(){return new e(t.apply(this,arguments))}}function p(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){p(i,n,o,a,u,"next",e)}function u(e){p(i,n,o,a,u,"throw",e)}a(void 0)}))}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&void 0!==arguments[2]?arguments[2]:{},i=o.allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==f(e)&&(e=[e]),L(e))for(r=0,n=e.length;r0;)if(t===(r=n[o]).toLowerCase())return r;return null}var Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Z=function(e){return!N(e)&&e!==Q};var ee,te=(ee="undefined"!=typeof Uint8Array&&R(Uint8Array),function(e){return ee&&e instanceof ee}),re=A("HTMLFormElement"),ne=function(e){var t=Object.prototype.hasOwnProperty;return function(e,r){return t.call(e,r)}}(),oe=A("RegExp"),ie=function(e,t){var r=Object.getOwnPropertyDescriptors(e),n={};$(r,(function(r,o){var i;!1!==(i=t(r,o,e))&&(n[o]=i||r)})),Object.defineProperties(e,n)};var ae,ue,se,ce,fe=A("AsyncFunction"),le=(ae="function"==typeof setImmediate,ue=F(Q.postMessage),ae?setImmediate:ue?(se="axios@".concat(Math.random()),ce=[],Q.addEventListener("message",(function(e){var t=e.source,r=e.data;t===Q&&r===se&&ce.length&&ce.shift()()}),!1),function(e){ce.push(e),Q.postMessage(se,"*")}):function(e){return setTimeout(e)}),pe="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Q):"undefined"!=typeof process&&process.nextTick||le,de={isArray:L,isArrayBuffer:_,isBuffer:C,isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||F(e.append)&&("formdata"===(t=j(e))||"object"===t&&F(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&_(e.buffer)},isString:U,isNumber:B,isBoolean:function(e){return!0===e||!1===e},isObject:D,isPlainObject:I,isEmptyObject:function(e){if(!D(e)||C(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:K,isRequest:V,isResponse:G,isHeaders:X,isUndefined:N,isDate:q,isFile:M,isBlob:z,isRegExp:oe,isFunction:F,isStream:function(e){return D(e)&&F(e.pipe)},isURLSearchParams:J,isTypedArray:te,isFileList:H,forEach:$,merge:function e(){for(var t=Z(this)&&this||{},r=t.caseless,n=t.skipUndefined,o={},i=function(t,i){var a=r&&Y(o,i)||i;I(o[a])&&I(t)?o[a]=e(o[a],t):I(t)?o[a]=e({},t):L(t)?o[a]=t.slice():n&&N(t)||(o[a]=t)},a=0,u=arguments.length;a3&&void 0!==arguments[3]?arguments[3]:{},o=n.allOwnKeys;return $(t,(function(t,n){r&&F(t)?e[n]=O(t,r):e[n]=t}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r,n){var o,i,a,u={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],n&&!n(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==r&&R(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:j,kindOfTest:A,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;if(L(e))return e;var t=e.length;if(!B(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},forEachEntry:function(e,t){for(var r,n=(e&&e[k]).call(e);(r=n.next())&&!r.done;){var o=r.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var r,n=[];null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:re,hasOwnProperty:ne,hasOwnProp:ne,reduceDescriptors:ie,freezeMethods:function(e){ie(e,(function(t,r){if(F(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;var n=e[r];F(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:function(e,t){var r={},n=function(e){e.forEach((function(e){r[e]=!0}))};return L(e)?n(e):n(String(e).split(t)),r},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:Y,global:Q,isContextDefined:Z,isSpecCompliantForm:function(e){return!!(e&&F(e.append)&&"FormData"===e[T]&&e[k])},toJSONObject:function(e){var t=new Array(10);return function e(r,n){if(D(r)){if(t.indexOf(r)>=0)return;if(C(r))return r;if(!("toJSON"in r)){t[n]=r;var o=L(r)?[]:{};return $(r,(function(t,r){var i=e(t,n+1);!N(i)&&(o[r]=i)})),t[n]=void 0,o}}return r}(e,0)},isAsyncFn:fe,isThenable:function(e){return e&&(D(e)||F(e))&&F(e.then)&&F(e.catch)},setImmediate:le,asap:pe,isIterable:function(e){return null!=e&&F(e[k])}};function he(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}de.inherits(he,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:de.toJSONObject(this.config),code:this.code,status:this.status}}});var ve=he.prototype,ye={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){ye[e]={value:e}})),Object.defineProperties(he,ye),Object.defineProperty(ve,"isAxiosError",{value:!0}),he.from=function(e,t,r,n,o,i){var a=Object.create(ve);de.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e}));var u=e&&e.message?e.message:"Error",s=null==t&&e?e.code:t;return he.call(a,u,s,r,n,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};function me(e){return de.isPlainObject(e)||de.isArray(e)}function be(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function ge(e,t,r){return e?e.concat(t).map((function(e,t){return e=be(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}var we=de.toFlatObject(de,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Ee(e,t,r){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var n=(r=de.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!de.isUndefined(t[e])}))).metaTokens,o=r.visitor||c,i=r.dots,a=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(o))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(de.isDate(e))return e.toISOString();if(de.isBoolean(e))return e.toString();if(!u&&de.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(e)||de.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,o){var u=e;if(e&&!o&&"object"===f(e))if(de.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(de.isArray(e)&&function(e){return de.isArray(e)&&!e.some(me)}(e)||(de.isFileList(e)||de.endsWith(r,"[]"))&&(u=de.toArray(e)))return r=be(r),u.forEach((function(e,n){!de.isUndefined(e)&&null!==e&&t.append(!0===a?ge([r],n,i):null===a?r:r+"[]",s(e))})),!1;return!!me(e)||(t.append(ge(o,r,i),s(e)),!1)}var l=[],p=Object.assign(we,{defaultVisitor:c,convertValue:s,isVisitable:me});if(!de.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!de.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),de.forEach(r,(function(r,i){!0===(!(de.isUndefined(r)||null===r)&&o.call(t,r,de.isString(i)?i.trim():i,n,p))&&e(r,n?n.concat(i):[i])})),l.pop()}}(e),t}function Oe(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Se(e,t){this._pairs=[],e&&Ee(e,this,t)}var xe=Se.prototype;function Re(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ke(e,t,r){if(!t)return e;var n=r&&r.encode||Re;de.isFunction(r)&&(r={serialize:r});var o,i=r&&r.serialize;if(o=i?i(t,r):de.isURLSearchParams(t)?t.toString():new Se(t,r).toString(n)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}xe.append=function(e,t){this._pairs.push([e,t])},xe.toString=function(e){var t=e?function(t){return e.call(this,t,Oe)}:Oe;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Te=function(){function e(){h(this,e),this.handlers=[]}return y(e,[{key:"use",value:function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){de.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),je={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ae={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Se,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Pe="undefined"!=typeof window&&"undefined"!=typeof document,Le="object"===("undefined"==typeof navigator?"undefined":f(navigator))&&navigator||void 0,Ne=Pe&&(!Le||["ReactNative","NativeScript","NS"].indexOf(Le.product)<0),Ce="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,_e=Pe&&window.location.href||"http://localhost",Ue=u(u({},Object.freeze({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserWebWorkerEnv:Ce,hasStandardBrowserEnv:Ne,navigator:Le,origin:_e})),Ae);function Fe(e){function t(e,r,n,o){var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),u=o>=e.length;return i=!i&&de.isArray(n)?n.length:i,u?(de.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&de.isObject(n[i])||(n[i]=[]),t(e,r,n[i],o)&&de.isArray(n[i])&&(n[i]=function(e){var t,r,n={},o=Object.keys(e),i=o.length;for(t=0;t-1,i=de.isObject(e);if(i&&de.isHTMLForm(e)&&(e=new FormData(e)),de.isFormData(e))return o?JSON.stringify(Fe(e)):e;if(de.isArrayBuffer(e)||de.isBuffer(e)||de.isStream(e)||de.isFile(e)||de.isBlob(e)||de.isReadableStream(e))return e;if(de.isArrayBufferView(e))return e.buffer;if(de.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ee(e,new Ue.classes.URLSearchParams,u({visitor:function(e,t,r,n){return Ue.isNode&&de.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((r=de.isFileList(e))||n.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return Ee(r?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,r){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Be.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(de.isResponse(e)||de.isReadableStream(e))return e;if(e&&de.isString(e)&&(r&&!this.responseType||n)){var o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(o){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ue.classes.FormData,Blob:Ue.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],(function(e){Be.headers[e]={}}));var De=Be,Ie=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qe=Symbol("internals");function Me(e){return e&&String(e).trim().toLowerCase()}function ze(e){return!1===e||null==e?e:de.isArray(e)?e.map(ze):String(e)}function He(e,t,r,n,o){return de.isFunction(n)?n.call(this,t,r):(o&&(t=r),de.isString(t)?de.isString(n)?-1!==t.indexOf(n):de.isRegExp(n)?n.test(t):void 0:void 0)}var Je=function(e,t){function r(e){h(this,r),e&&this.set(e)}return y(r,[{key:"set",value:function(e,t,r){var n=this;function o(e,t,r){var o=Me(t);if(!o)throw new Error("header name must be a non-empty string");var i=de.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=ze(e))}var i=function(e,t){return de.forEach(e,(function(e,r){return o(e,r,t)}))};if(de.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(de.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,r,n,o={};return e&&e.split("\n").forEach((function(e){n=e.indexOf(":"),t=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!t||o[t]&&Ie[t]||("set-cookie"===t?o[t]?o[t].push(r):o[t]=[r]:o[t]=o[t]?o[t]+", "+r:r)})),o}(e),t);else if(de.isObject(e)&&de.isIterable(e)){var a,u,s,c={},f=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=w(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(f.s();!(s=f.n()).done;){var l=s.value;if(!de.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(a=c[u])?de.isArray(a)?[].concat(g(a),[l[1]]):[a,l[1]]:l[1]}}catch(e){f.e(e)}finally{f.f()}i(c,t)}else null!=e&&o(t,e,r);return this}},{key:"get",value:function(e,t){if(e=Me(e)){var r=de.findKey(this,e);if(r){var n=this[r];if(!t)return n;if(!0===t)return function(e){for(var t,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=n.exec(e);)r[t[1]]=t[2];return r}(n);if(de.isFunction(t))return t.call(this,n,r);if(de.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Me(e)){var r=de.findKey(this,e);return!(!r||void 0===this[r]||t&&!He(0,this[r],r,t))}return!1}},{key:"delete",value:function(e,t){var r=this,n=!1;function o(e){if(e=Me(e)){var o=de.findKey(r,e);!o||t&&!He(0,r[o],o,t)||(delete r[o],n=!0)}}return de.isArray(e)?e.forEach(o):o(e),n}},{key:"clear",value:function(e){for(var t=Object.keys(this),r=t.length,n=!1;r--;){var o=t[r];e&&!He(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}},{key:"normalize",value:function(e){var t=this,r={};return de.forEach(this,(function(n,o){var i=de.findKey(r,o);if(i)return t[i]=ze(n),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=ze(n),r[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n1?r-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,r=null,n&&(clearTimeout(n),n=null),e.apply(void 0,g(t))};return[function(){for(var e=Date.now(),t=e-o,u=arguments.length,s=new Array(u),c=0;c=i?a(s,e):(r=s,n||(n=setTimeout((function(){n=null,a(r)}),i-t)))},function(){return r&&a(r)}]}de.inherits(Ge,he,{__CANCEL__:!0});var Qe=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,n=0,o=$e(50,250);return Ye((function(r){var i=r.loaded,a=r.lengthComputable?r.total:void 0,u=i-n,s=o(u);n=i;var c=m({loaded:i,total:a,progress:a?i/a:void 0,bytes:u,rate:s||void 0,estimated:s&&a&&i<=a?(a-i)/s:void 0,event:r,lengthComputable:null!=a},t?"download":"upload",!0);e(c)}),r)},Ze=function(e,t){var r=null!=e;return[function(n){return t[0]({lengthComputable:r,total:e,loaded:n})},t[1]]},et=function(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n1?t-1:0),n=1;n1?"since :\n"+s.map(xt).join("\n"):" "+xt(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n},adapters:St};function Tt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ge(null,e)}function jt(e){return Tt(e),e.headers=We.from(e.headers),e.data=Ke.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),kt.getAdapter(e.adapter||De.adapter,e)(e).then((function(t){return Tt(e),t.data=Ke.call(e,e.transformResponse,t),t.headers=We.from(t.headers),t}),(function(t){return Ve(t)||(Tt(e),t&&t.response&&(t.response.data=Ke.call(e,e.transformResponse,t.response),t.response.headers=We.from(t.response.headers))),Promise.reject(t)}))}var At="1.13.2",Pt={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Pt[e]=function(r){return f(r)===e||"a"+(t<1?"n ":" ")+e}}));var Lt={};Pt.transitional=function(e,t,r){function n(e,t){return"[Axios v1.13.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,o,i){if(!1===e)throw new he(n(o," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!Lt[o]&&(Lt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},Pt.spelling=function(e){return function(t,r){return console.warn("".concat(r," is likely a misspelling of ").concat(e)),!0}};var Nt={assertOptions:function(e,t,r){if("object"!==f(e))throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var u=e[i],s=void 0===u||a(u,i,e);if(!0!==s)throw new he("option "+i+" must be "+s,he.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new he("Unknown option "+i,he.ERR_BAD_OPTION)}},validators:Pt},Ct=Nt.validators,_t=function(){function e(t){h(this,e),this.defaults=t||{},this.interceptors={request:new Te,response:new Te}}var t;return y(e,[{key:"request",value:(t=d(s().mark((function e(t,r){var n,o;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,r);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error){n={},Error.captureStackTrace?Error.captureStackTrace(n):n=new Error,o=n.stack?n.stack.replace(/^.+\n/,""):"";try{e.t0.stack?o&&!String(e.t0.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(e.t0.stack+="\n"+o):e.t0.stack=o}catch(e){}}throw e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,r){return t.apply(this,arguments)})},{key:"_request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=it(this.defaults,t),n=r.transitional,o=r.paramsSerializer,i=r.headers;void 0!==n&&Nt.assertOptions(n,{silentJSONParsing:Ct.transitional(Ct.boolean),forcedJSONParsing:Ct.transitional(Ct.boolean),clarifyTimeoutError:Ct.transitional(Ct.boolean)},!1),null!=o&&(de.isFunction(o)?t.paramsSerializer={serialize:o}:Nt.assertOptions(o,{encode:Ct.function,serialize:Ct.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Nt.assertOptions(t,{baseUrl:Ct.spelling("baseURL"),withXsrfToken:Ct.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();var a=i&&de.merge(i.common,i[t.method]);i&&de.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]})),t.headers=We.concat(a,i);var u=[],s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,u.unshift(e.fulfilled,e.rejected))}));var c,f=[];this.interceptors.response.forEach((function(e){f.push(e.fulfilled,e.rejected)}));var l,p=0;if(!s){var d=[jt.bind(this),void 0];for(d.unshift.apply(d,u),d.push.apply(d,f),l=d.length,c=Promise.resolve(t);p0;)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(e,t,o){n.reason||(n.reason=new Ge(e,t,o),r(n.reason))}))}return y(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,r=function(e){t.abort(e)};return this.subscribe(r),t.signal.unsubscribe=function(){return e.unsubscribe(r)},t.signal}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}(),Bt=Ft;var Dt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Dt).forEach((function(e){var t=b(e,2),r=t[0],n=t[1];Dt[n]=r}));var It=Dt;var qt=function e(t){var r=new Ut(t),n=O(Ut.prototype.request,r);return de.extend(n,Ut.prototype,r,{allOwnKeys:!0}),de.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(it(t,r))},n}(De);return qt.Axios=Ut,qt.CanceledError=Ge,qt.CancelToken=Bt,qt.isCancel=Ve,qt.VERSION=At,qt.toFormData=Ee,qt.AxiosError=he,qt.Cancel=qt.CanceledError,qt.all=function(e){return Promise.all(e)},qt.spread=function(e){return function(t){return e.apply(null,t)}},qt.isAxiosError=function(e){return de.isObject(e)&&!0===e.isAxiosError},qt.mergeConfig=it,qt.AxiosHeaders=We,qt.formToJSON=function(e){return Fe(de.isHTMLForm(e)?new FormData(e):e)},qt.getAdapter=kt.getAdapter,qt.HttpStatusCode=It,qt.default=qt,qt})); +//# sourceMappingURL=axios.min.js.map diff --git a/node_modules/axios/dist/axios.min.js.map b/node_modules/axios/dist/axios.min.js.map new file mode 100644 index 0000000..4e1bf48 --- /dev/null +++ b/node_modules/axios/dist/axios.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.min.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/defaults/transitional.js","../lib/platform/browser/index.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/common/utils.js","../lib/platform/index.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/core/settle.js","../lib/helpers/speedometer.js","../lib/helpers/throttle.js","../lib/helpers/progressEventReducer.js","../lib/helpers/isURLSameOrigin.js","../lib/helpers/cookies.js","../lib/core/buildFullPath.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/core/mergeConfig.js","../lib/helpers/resolveConfig.js","../lib/adapters/fetch.js","../lib/adapters/xhr.js","../lib/helpers/parseProtocol.js","../lib/helpers/composeSignals.js","../lib/helpers/trackStream.js","../lib/adapters/adapters.js","../lib/helpers/null.js","../lib/core/dispatchRequest.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n if (isBuffer(obj)){\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless, skipUndefined} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n const msg = error && error.message ? error.message : 'Error';\n\n // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)\n const errCode = code == null && error ? error.code : code;\n AxiosError.call(axiosError, msg, errCode, config, request, response);\n\n // Chain the original error on the standard field; non-enumerable to avoid JSON noise\n if (error && axiosError.cause == null) {\n Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });\n }\n\n axiosError.name = (error && error.name) || 'Error';\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, this.parseReviver);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));\n return match ? decodeURIComponent(match[1]) : null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)\n };\n\n utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst {isFunction} = utils;\n\nconst globalFetchAPI = (({Request, Response}) => ({\n Request, Response\n}))(utils.global);\n\nconst {\n ReadableStream, TextEncoder\n} = utils.global;\n\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst factory = (env) => {\n env = utils.merge.call({\n skipUndefined: true\n }, globalFetchAPI, env);\n\n const {fetch: envFetch, Request, Response} = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Request(str).arrayBuffer())\n );\n\n const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n };\n\n isFetchSupported && ((() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n })());\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n }\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n }\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request = null;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && \"credentials\" in Request.prototype;\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n }\n}\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const {fetch, Request, Response} = env;\n const seeds = [\n Request, Response, fetch\n ];\n\n let len = seeds.length, i = len,\n seed, target, map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n request = null;\n };\n \n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n * \n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n }\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', { value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n * \n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n * \n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n * \n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters\n};\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.13.2\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n"],"names":["bind","fn","thisArg","apply","arguments","cache","toString","Object","prototype","getPrototypeOf","iterator","Symbol","toStringTag","kindOf","create","thing","str","call","slice","toLowerCase","kindOfTest","type","typeOfTest","_typeof","isArray","Array","isUndefined","isBuffer","val","constructor","isFunction","isArrayBuffer","isString","isNumber","isObject","isPlainObject","isDate","isFile","isBlob","isFileList","isURLSearchParams","_map2","_slicedToArray","map","isReadableStream","isRequest","isResponse","isHeaders","forEach","obj","i","l","_ref","length","undefined","_ref$allOwnKeys","allOwnKeys","key","keys","getOwnPropertyNames","len","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","TypedArray","isTypedArray","Uint8Array","isHTMLForm","hasOwnProperty","_ref4","prop","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","setImmediateSupported","postMessageSupported","token","callbacks","isAsyncFn","_setImmediate","setImmediate","postMessage","concat","Math","random","addEventListener","_ref5","source","data","shift","cb","push","setTimeout","asap","queueMicrotask","process","nextTick","utils$1","isFormData","kind","FormData","append","isArrayBufferView","ArrayBuffer","isView","buffer","isBoolean","isEmptyObject","e","isStream","pipe","merge","_ref2","this","caseless","skipUndefined","result","assignValue","targetKey","extend","a","b","_ref3","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","lastIndex","indexOf","toArray","arr","forEachEntry","_iterator","next","done","pair","matchAll","regExp","matches","exec","hasOwnProp","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","toUpperCase","noop","toFiniteNumber","defaultValue","Number","isFinite","isSpecCompliantForm","toJSONObject","stack","visit","target","reducedValue","isThenable","then","isIterable","AxiosError","message","code","config","request","response","captureStackTrace","status","utils","toJSON","description","number","fileName","lineNumber","columnNumber","from","error","customProps","axiosError","msg","errCode","cause","configurable","isVisitable","removeBrackets","renderKey","path","dots","join","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","JSON","stringify","some","isFlatArray","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","buildURL","url","_encode","serialize","serializedParams","serializeFn","hashmarkIndex","encoder","InterceptorManager$1","InterceptorManager","_classCallCheck","handlers","_createClass","fulfilled","rejected","synchronous","runWhen","id","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","_navigator","navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","origin","location","href","_objectSpread","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","entries","parsePropPath","defaults","transitional","adapter","transformRequest","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","parse","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","parseReviver","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","method","defaults$1","ignoreDuplicateOf","$internals","normalizeHeader","header","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders","_Symbol$iterator","_Symbol$toStringTag","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","parsed","line","substring","parseHeaders","dest","_step","_createForOfIteratorHelper","s","n","entry","_toConsumableArray","err","f","tokens","tokensRE","parseTokens","matcher","deleted","deleteHeader","format","normalized","w","char","formatHeader","_this$constructor","_len","targets","asStrings","get","first","computed","_len2","_key2","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","buildAccessors","accessor","mapped","headerValue","AxiosHeaders$1","transformData","fns","normalize","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","settle","resolve","reject","ERR_BAD_REQUEST","floor","speedometer","samplesCount","min","firstSampleTS","bytes","timestamps","head","tail","chunkLength","now","Date","startedAt","bytesCount","passed","round","throttle","freq","lastArgs","timer","timestamp","threshold","invoke","args","clearTimeout","progressEventReducer","listener","isDownloadStream","bytesNotified","_speedometer","loaded","total","lengthComputable","progressBytes","rate","_defineProperty","progress","estimated","event","progressEventDecorator","throttled","asyncDecorator","isMSIE","URL","protocol","host","port","userAgent","write","expires","domain","secure","sameSite","cookie","toUTCString","read","RegExp","decodeURIComponent","remove","buildFullPath","baseURL","requestedURL","allowAbsoluteUrls","isRelativeUrl","relativeURL","combineURLs","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding","configValue","resolveConfig","newConfig","auth","btoa","username","password","unescape","getHeaders","formHeaders","allowedHeaders","includes","isURLSameOrigin","xsrfValue","cookies","xhrAdapter","XMLHttpRequest","Promise","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","_config","requestData","requestHeaders","unsubscribe","signal","removeEventListener","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","onreadystatechange","readyState","responseURL","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","setRequestHeader","_progressEventReducer2","upload","_progressEventReducer4","cancel","abort","subscribe","aborted","send","composeSignals$1","signals","Boolean","controller","AbortController","reason","streamChunk","_regeneratorRuntime","mark","chunk","chunkSize","pos","end","wrap","_context","prev","byteLength","abrupt","stop","readBytes","_wrapAsyncGenerator","_callee","iterable","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_context2","_asyncIterator","readStream","_awaitAsyncGenerator","sent","delegateYield","_asyncGeneratorDelegate","t1","finish","_x","_x2","_callee2","stream","reader","_yield$_awaitAsyncGen","_context3","asyncIterator","getReader","_x3","trackStream","onProgress","onFinish","_onFinish","ReadableStream","pull","_asyncToGenerator","_callee3","_yield$iterator$next","_done","loadedBytes","_context4","close","enqueue","t0","highWaterMark","globalFetchAPI","Request","Response","_utils$global","TextEncoder","factory","_env","envFetch","fetch","isFetchSupported","isRequestSupported","isResponseSupported","isReadableStreamSupported","encodeText","arrayBuffer","supportsRequestStream","duplexAccessed","hasContentType","body","duplex","has","supportsResponseStream","resolvers","res","ERR_NOT_SUPPORT","getBodyLength","_request","size","resolveBodyLength","getContentLength","_x4","_callee4","_resolveConfig","_resolveConfig$withCr","fetchOptions","_fetch","composedSignal","requestContentLength","contentTypeHeader","_progressEventDecorat","_progressEventDecorat2","flush","isCredentialsSupported","resolvedOptions","isStreamResponse","responseContentLength","_ref6","_ref7","_onProgress","_flush","responseData","composeSignals","toAbortSignal","credentials","t2","_x5","seedCache","Map","getFetch","seed","seeds","knownAdapters","http","xhr","fetchAdapter","renderReason","isResolvedHandle","adapters","getAdapter","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","VERSION","validators","deprecatedWarnings","validators$1","validator","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","spelling","correctSpelling","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","_request2","configOrUrl","dummy","baseUrl","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","promise","responseInterceptorChain","chain","onFulfilled","onRejected","generateHTTPMethod","isForm","Axios$1","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","_this","c","CancelToken$1","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","WebServerIsDown","ConnectionTimedOut","OriginIsUnreachable","TimeoutOccurred","SslHandshakeFailed","InvalidSslCertificate","HttpStatusCode$1","axios","createInstance","defaultConfig","instance","Cancel","all","promises","spread","callback","isAxiosError","payload","formToJSON"],"mappings":";+4XASe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE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rvB,EAAU,IAAI6oB,GAAMwG,GACpBC,EAAW3zB,EAAKktB,GAAM1sB,UAAUoM,QAASvI,GAa/C,OAVA2I,GAAM5E,OAAOurB,EAAUzG,GAAM1sB,UAAW6D,EAAS,CAACb,YAAY,IAG9DwJ,GAAM5E,OAAOurB,EAAUtvB,EAAS,KAAM,CAACb,YAAY,IAGnDmwB,EAAS7yB,OAAS,SAAgBqsB,GAChC,OAAOsG,EAAejV,GAAYkV,EAAevG,KAG5CwG,CACT,CAGcF,CAAengB,WAG7BkgB,GAAMtG,MAAQA,GAGdsG,GAAMzZ,cAAgBA,GACtByZ,GAAMjF,YAAcA,GACpBiF,GAAM3Z,SAAWA,GACjB2Z,GAAM1H,QAAUA,GAChB0H,GAAMjlB,WAAaA,GAGnBilB,GAAMhnB,WAAaA,GAGnBgnB,GAAMI,OAASJ,GAAMzZ,cAGrByZ,GAAMK,IAAM,SAAaC,GACvB,OAAO9S,QAAQ6S,IAAIC,EACrB,EAEAN,GAAMO,OC9CS,SAAgBC,GAC7B,OAAO,SAAchqB,GACnB,OAAOgqB,EAAS7zB,MAAM,KAAM6J,GAEhC,ED6CAwpB,GAAMS,aE7DS,SAAsBC,GACnC,OAAOlnB,GAAM9K,SAASgyB,KAAsC,IAAzBA,EAAQD,YAC7C,EF8DAT,GAAMhV,YAAcA,GAEpBgV,GAAMvd,aAAeA,GAErBud,GAAMW,WAAa,SAAApzB,GAAK,OAAIgS,GAAe/F,GAAMvI,WAAW1D,GAAS,IAAIkG,SAASlG,GAASA,EAAM,EAEjGyyB,GAAMlI,WAAaD,GAASC,WAE5BkI,GAAMvE,eAAiBA,GAEvBuE,GAAK,QAAWA"} \ No newline at end of file diff --git a/node_modules/axios/dist/browser/axios.cjs b/node_modules/axios/dist/browser/axios.cjs new file mode 100644 index 0000000..bf34e71 --- /dev/null +++ b/node_modules/axios/dist/browser/axios.cjs @@ -0,0 +1,3909 @@ +/*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */ +'use strict'; + +/** + * Create a bound version of a function with a specified `this` context + * + * @param {Function} fn - The function to bind + * @param {*} thisArg - The value to be passed as the `this` parameter + * @returns {Function} A new function that will call the original function with the specified `this` context + */ +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; +const {iterator, toStringTag} = Symbol; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +}; + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction$1 = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); +}; + +/** + * Determine if a value is an empty object (safely handles Buffers) + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an empty object, otherwise false + */ +const isEmptyObject = (val) => { + // Early return for non-objects or Buffers to prevent RangeError + if (!isObject(val) || isBuffer(val)) { + return false; + } + + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + // Fallback for any other objects that might cause RangeError with Object.keys() + return false; + } +}; + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction$1(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction$1(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +}; + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Buffer check + if (isBuffer(obj)) { + return; + } + + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + if (isBuffer(obj)){ + return null; + } + + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless, skipUndefined} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else if (!skipUndefined || !isUndefined(val)) { + result[targetKey] = val; + } + }; + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction$1(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +}; + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +}; + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +}; + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[iterator]; + + const _iterator = generator.call(obj); + + let result; + + while ((result = _iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +}; + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +}; + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction$1(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +}; + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + }; + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +}; + +const noop = () => {}; + +const toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; +}; + + + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + //Buffer check + if (isBuffer(source)) { + return source; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + }; + + return visit(obj, 0); +}; + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); + +// original code +// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 + +const _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({source, data}) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + } + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})( + typeof setImmediate === 'function', + isFunction$1(_global.postMessage) +); + +const asap = typeof queueMicrotask !== 'undefined' ? + queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); + +// ********************* + + +const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); + + +var utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isEmptyObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction: isFunction$1, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap, + isIterable +}; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } +} + +utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.status + }; + } +}); + +const prototype$1 = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + const msg = error && error.message ? error.message : 'Error'; + + // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) + const errCode = code == null && error ? error.code : code; + AxiosError.call(axiosError, msg, errCode, config, request, response); + + // Chain the original error on the standard field; non-enumerable to avoid JSON noise + if (error && axiosError.cause == null) { + Object.defineProperty(axiosError, 'cause', { value: error, configurable: true }); + } + + axiosError.name = (error && error.name) || 'Error'; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +// eslint-disable-next-line strict +var httpAdapter = null; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils$1.isDate(value)) { + return value.toISOString(); + } + + if (utils$1.isBoolean(value)) { + return value.toString(); + } + + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils$1.isArray(value) && isFlatArray(value)) || + ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils$1.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode$1(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?(object|Function)} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + if (utils$1.isFunction(options)) { + options = { + serialize: options + }; + } + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +var InterceptorManager$1 = InterceptorManager; + +var transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; + +var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; + +var FormData$1 = typeof FormData !== 'undefined' ? FormData : null; + +var Blob$1 = typeof Blob !== 'undefined' ? Blob : null; + +var platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; + +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +const _navigator = typeof navigator === 'object' && navigator || undefined; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = hasBrowserEnv && + (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +const origin = hasBrowserEnv && window.location.href || 'http://localhost'; + +var utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv, + navigator: _navigator, + origin: origin +}); + +var platform = { + ...utils, + ...platform$1 +}; + +function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), { + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + }, + ...options + }); +} + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http', 'fetch'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils$1.isObject(data); + + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils$1.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils$1.isArrayBuffer(data) || + utils$1.isBuffer(data) || + utils$1.isStream(data) || + utils$1.isFile(data) || + utils$1.isBlob(data) || + utils$1.isReadableStream(data) + ) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { + return data; + } + + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data, this.parseReviver); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +var defaults$1 = defaults; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils$1.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +var parseHeaders = rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils$1.isString(value)) return; + + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils$1.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils$1.isArray(entry)) { + throw TypeError('Object iterator must return a key-value pair'); + } + + obj[key = entry[0]] = (dest = obj[key]) ? + (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1]; + } + + setHeaders(obj, valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils$1.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + getSetCookie() { + return this.get("set-cookie") || []; + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils$1.freezeMethods(AxiosHeaders); + +var AxiosHeaders$1 = AxiosHeaders; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$1.from(context.headers); + let data = context.data; + + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1000 / freq; + let lastArgs; + let timer; + + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn(...args); + }; + + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if ( passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + + const flush = () => lastArgs && invoke(lastArgs); + + return [throttled, flush]; +} + +const progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return throttle(e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e, + lengthComputable: total != null, + [isDownloadStream ? 'download' : 'upload']: true + }; + + listener(data); + }, freq); +}; + +const progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +}; + +const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); + +var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { + url = new URL(url, platform.origin); + + return ( + origin.protocol === url.protocol && + origin.host === url.host && + (isMSIE || origin.port === url.port) + ); +})( + new URL(platform.origin), + platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) +) : () => true; + +var cookies = platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure, sameSite) { + if (typeof document === 'undefined') return; + + const cookie = [`${name}=${encodeURIComponent(value)}`]; + + if (utils$1.isNumber(expires)) { + cookie.push(`expires=${new Date(expires).toUTCString()}`); + } + if (utils$1.isString(path)) { + cookie.push(`path=${path}`); + } + if (utils$1.isString(domain)) { + cookie.push(`domain=${domain}`); + } + if (secure === true) { + cookie.push('secure'); + } + if (utils$1.isString(sameSite)) { + cookie.push(`SameSite=${sameSite}`); + } + + document.cookie = cookie.join('; '); + }, + + read(name) { + if (typeof document === 'undefined') return null; + const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); + return match ? decodeURIComponent(match[1]) : null; + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000, '/'); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { + let isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, prop, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, prop, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, prop, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + }; + + utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + +var resolveConfig = (config) => { + const newConfig = mergeConfig({}, config); + + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + + newConfig.headers = headers = AxiosHeaders$1.from(headers); + + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + + // HTTP basic authentication + if (auth) { + headers.set('Authorization', 'Basic ' + + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) + ); + } + + if (utils$1.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(undefined); // browser handles it + } else if (utils$1.isFunction(data.getHeaders)) { + // Node.js FormData (like form-data package) + const formHeaders = data.getHeaders(); + // Only set safe headers to avoid overwriting security headers + const allowedHeaders = ['content-type', 'content-length']; + Object.entries(formHeaders).forEach(([key, val]) => { + if (allowedHeaders.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + } + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) { + // Add xsrf header + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); + + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + + return newConfig; +}; + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +var xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); + let {responseType, onUploadProgress, onDownloadProgress} = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + + function done() { + flushUpload && flushUpload(); // flush events + flushDownload && flushDownload(); // flush events + + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + + _config.signal && _config.signal.removeEventListener('abort', onCanceled); + } + + let request = new XMLHttpRequest(); + + request.open(_config.method.toUpperCase(), _config.url, true); + + // Set the request timeout in MS + request.timeout = _config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders$1.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError(event) { + // Browsers deliver a ProgressEvent in XHR onerror + // (message may be empty; when present, surface it) + // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event + const msg = event && event.message ? event.message : 'Network Error'; + const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); + // attach the underlying event for consumers who want details + err.event = event || null; + reject(err); + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = _config.responseType; + } + + // Handle progress if needed + if (onDownloadProgress) { + ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); + request.addEventListener('progress', downloadThrottled); + } + + // Not all browsers support upload events + if (onUploadProgress && request.upload) { + ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); + + request.upload.addEventListener('progress', uploadThrottled); + + request.upload.addEventListener('loadend', flushUpload); + } + + if (_config.cancelToken || _config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(_config.url); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}; + +const composeSignals = (signals, timeout) => { + const {length} = (signals = signals ? signals.filter(Boolean) : []); + + if (timeout || length) { + let controller = new AbortController(); + + let aborted; + + const onabort = function (reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); + }, timeout); + + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach(signal => { + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); + }); + signals = null; + } + }; + + signals.forEach((signal) => signal.addEventListener('abort', onabort)); + + const {signal} = controller; + + signal.unsubscribe = () => utils$1.asap(unsubscribe); + + return signal; + } +}; + +var composeSignals$1 = composeSignals; + +const streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + + let pos = 0; + let end; + + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; + +const readBytes = async function* (iterable, chunkSize) { + for await (const chunk of readStream(iterable)) { + yield* streamChunk(chunk, chunkSize); + } +}; + +const readStream = async function* (stream) { + if (stream[Symbol.asyncIterator]) { + yield* stream; + return; + } + + const reader = stream.getReader(); + try { + for (;;) { + const {done, value} = await reader.read(); + if (done) { + break; + } + yield value; + } + } finally { + await reader.cancel(); + } +}; + +const trackStream = (stream, chunkSize, onProgress, onFinish) => { + const iterator = readBytes(stream, chunkSize); + + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + + return new ReadableStream({ + async pull(controller) { + try { + const {done, value} = await iterator.next(); + + if (done) { + _onFinish(); + controller.close(); + return; + } + + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { + highWaterMark: 2 + }) +}; + +const DEFAULT_CHUNK_SIZE = 64 * 1024; + +const {isFunction} = utils$1; + +const globalFetchAPI = (({Request, Response}) => ({ + Request, Response +}))(utils$1.global); + +const { + ReadableStream: ReadableStream$1, TextEncoder +} = utils$1.global; + + +const test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false + } +}; + +const factory = (env) => { + env = utils$1.merge.call({ + skipUndefined: true + }, globalFetchAPI, env); + + const {fetch: envFetch, Request, Response} = env; + const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; + const isRequestSupported = isFunction(Request); + const isResponseSupported = isFunction(Response); + + if (!isFetchSupported) { + return false; + } + + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); + + const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? + ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : + async (str) => new Uint8Array(await new Request(str).arrayBuffer()) + ); + + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { + let duplexAccessed = false; + + const hasContentType = new Request(platform.origin, { + body: new ReadableStream$1(), + method: 'POST', + get duplex() { + duplexAccessed = true; + return 'half'; + }, + }).headers.has('Content-Type'); + + return duplexAccessed && !hasContentType; + }); + + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && + test(() => utils$1.isReadableStream(new Response('').body)); + + const resolvers = { + stream: supportsResponseStream && ((res) => res.body) + }; + + isFetchSupported && ((() => { + ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { + !resolvers[type] && (resolvers[type] = (res, config) => { + let method = res && res[type]; + + if (method) { + return method.call(res); + } + + throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); + }); + }); + })()); + + const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + + if (utils$1.isBlob(body)) { + return body.size; + } + + if (utils$1.isSpecCompliantForm(body)) { + const _request = new Request(platform.origin, { + method: 'POST', + body, + }); + return (await _request.arrayBuffer()).byteLength; + } + + if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { + return body.byteLength; + } + + if (utils$1.isURLSearchParams(body)) { + body = body + ''; + } + + if (utils$1.isString(body)) { + return (await encodeText(body)).byteLength; + } + }; + + const resolveBodyLength = async (headers, body) => { + const length = utils$1.toFiniteNumber(headers.getContentLength()); + + return length == null ? getBodyLength(body) : length; + }; + + return async (config) => { + let { + url, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = 'same-origin', + fetchOptions + } = resolveConfig(config); + + let _fetch = envFetch || fetch; + + responseType = responseType ? (responseType + '').toLowerCase() : 'text'; + + let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + + let request = null; + + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + + let requestContentLength; + + try { + if ( + onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && + (requestContentLength = await resolveBodyLength(headers, data)) !== 0 + ) { + let _request = new Request(url, { + method: 'POST', + body: data, + duplex: "half" + }); + + let contentTypeHeader; + + if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { + headers.setContentType(contentTypeHeader); + } + + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + } + + if (!utils$1.isString(withCredentials)) { + withCredentials = withCredentials ? 'include' : 'omit'; + } + + // Cloudflare Workers throws when credentials are defined + // see https://github.com/cloudflare/workerd/issues/902 + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + + const resolvedOptions = { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : undefined + }; + + request = isRequestSupported && new Request(url, resolvedOptions); + + let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); + + const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); + + if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { + const options = {}; + + ['status', 'statusText', 'headers'].forEach(prop => { + options[prop] = response[prop]; + }); + + const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length')); + + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), + options + ); + } + + responseType = responseType || 'text'; + + let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config); + + !isStreamResponse && unsubscribe && unsubscribe(); + + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders$1.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }) + } catch (err) { + unsubscribe && unsubscribe(); + + if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), + { + cause: err.cause || err + } + ) + } + + throw AxiosError.from(err, err && err.code, config, request); + } + } +}; + +const seedCache = new Map(); + +const getFetch = (config) => { + let env = (config && config.env) || {}; + const {fetch, Request, Response} = env; + const seeds = [ + Request, Response, fetch + ]; + + let len = seeds.length, i = len, + seed, target, map = seedCache; + + while (i--) { + seed = seeds[i]; + target = map.get(seed); + + target === undefined && map.set(seed, target = (i ? new Map() : factory(env))); + + map = target; + } + + return target; +}; + +getFetch(); + +/** + * Known adapters mapping. + * Provides environment-specific adapters for Axios: + * - `http` for Node.js + * - `xhr` for browsers + * - `fetch` for fetch API-based requests + * + * @type {Object} + */ +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter, + fetch: { + get: getFetch, + } +}; + +// Assign adapter names for easier debugging and identification +utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', { value }); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', { value }); + } +}); + +/** + * Render a rejection reason string for unknown or unsupported adapters + * + * @param {string} reason + * @returns {string} + */ +const renderReason = (reason) => `- ${reason}`; + +/** + * Check if the adapter is resolved (function, null, or false) + * + * @param {Function|null|false} adapter + * @returns {boolean} + */ +const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; + +/** + * Get the first suitable adapter from the provided list. + * Tries each adapter in order until a supported one is found. + * Throws an AxiosError if no adapter is suitable. + * + * @param {Array|string|Function} adapters - Adapter(s) by name or function. + * @param {Object} config - Axios request configuration + * @throws {AxiosError} If no suitable adapter is available + * @returns {Function} The resolved adapter function + */ +function getAdapter(adapters, config) { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + + const { length } = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; +} + +/** + * Exports Axios adapters and utility to resolve an adapter + */ +var adapters = { + /** + * Resolve an adapter from a list of adapter names or functions. + * @type {Function} + */ + getAdapter, + + /** + * Exposes all known adapters + * @type {Object} + */ + adapters: knownAdapters +}; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders$1.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders$1.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + +const VERSION = "1.13.2"; + +const validators$1 = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +validators$1.spelling = function spelling(correctSpelling) { + return (value, opt) => { + // eslint-disable-next-line no-console + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + } +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} + +var validator = { + assertOptions, + validators: validators$1 +}; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy = {}; + + Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + try { + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack; + } + } catch (e) { + // ignore the case where "stack" is an un-writable property + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.allowAbsoluteUrls + if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { + config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + } else { + config.allowAbsoluteUrls = true; + } + + validator.assertOptions(config, { + baseUrl: validators.spelling('baseURL'), + withXsrfToken: validators.spelling('withXSRFToken') + }, true); + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + + headers && utils$1.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift(...requestInterceptorChain); + chain.push(...responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +var Axios$1 = Axios; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + toAbortSignal() { + const controller = new AbortController(); + + const abort = (err) => { + controller.abort(err); + }; + + this.subscribe(abort); + + controller.signal.unsubscribe = () => this.unsubscribe(abort); + + return controller.signal; + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +var CancelToken$1 = CancelToken; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return utils$1.isObject(payload) && (payload.isAxiosError === true); +} + +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, + WebServerIsDown: 521, + ConnectionTimedOut: 522, + OriginIsUnreachable: 523, + TimeoutOccurred: 524, + SslHandshakeFailed: 525, + InvalidSslCertificate: 526, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +var HttpStatusCode$1 = HttpStatusCode; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios$1(defaultConfig); + const instance = bind(Axios$1.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils$1.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults$1); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios$1; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken$1; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders$1; + +axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode$1; + +axios.default = axios; + +module.exports = axios; +//# sourceMappingURL=axios.cjs.map diff --git a/node_modules/axios/dist/browser/axios.cjs.map b/node_modules/axios/dist/browser/axios.cjs.map new file mode 100644 index 0000000..c950101 --- /dev/null +++ b/node_modules/axios/dist/browser/axios.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.cjs","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/null.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/browser/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/speedometer.js","../../lib/helpers/throttle.js","../../lib/helpers/progressEventReducer.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/cookies.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/core/mergeConfig.js","../../lib/helpers/resolveConfig.js","../../lib/adapters/xhr.js","../../lib/helpers/composeSignals.js","../../lib/helpers/trackStream.js","../../lib/adapters/fetch.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n if (isBuffer(obj)){\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless, skipUndefined} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n const msg = error && error.message ? error.message : 'Error';\n\n // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)\n const errCode = code == null && error ? error.code : code;\n AxiosError.call(axiosError, msg, errCode, config, request, response);\n\n // Chain the original error on the standard field; non-enumerable to avoid JSON noise\n if (error && axiosError.cause == null) {\n Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });\n }\n\n axiosError.name = (error && error.name) || 'Error';\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, this.parseReviver);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));\n return match ? decodeURIComponent(match[1]) : null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)\n };\n\n utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n request = null;\n };\n \n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst {isFunction} = utils;\n\nconst globalFetchAPI = (({Request, Response}) => ({\n Request, Response\n}))(utils.global);\n\nconst {\n ReadableStream, TextEncoder\n} = utils.global;\n\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst factory = (env) => {\n env = utils.merge.call({\n skipUndefined: true\n }, globalFetchAPI, env);\n\n const {fetch: envFetch, Request, Response} = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Request(str).arrayBuffer())\n );\n\n const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n };\n\n isFetchSupported && ((() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n })());\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n }\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n }\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request = null;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && \"credentials\" in Request.prototype;\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n }\n}\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const {fetch, Request, Response} = env;\n const seeds = [\n Request, Response, fetch\n ];\n\n let len = seeds.length, i = len,\n seed, target, map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n * \n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n }\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', { value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n * \n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n * \n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n * \n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters\n};\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.13.2\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["isFunction","utils","prototype","encode","URLSearchParams","FormData","Blob","platform","defaults","AxiosHeaders","ReadableStream","composeSignals","fetchAdapter.getFetch","validators","InterceptorManager","Axios","CancelToken","HttpStatusCode"],"mappings":";;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACTA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC;AACvC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAA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AACA,KAAK,CAAC,cAAc,GAAGgB,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/axios/dist/esm/axios.js b/node_modules/axios/dist/esm/axios.js new file mode 100644 index 0000000..f2943c7 --- /dev/null +++ b/node_modules/axios/dist/esm/axios.js @@ -0,0 +1,3932 @@ +/*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */ +/** + * Create a bound version of a function with a specified `this` context + * + * @param {Function} fn - The function to bind + * @param {*} thisArg - The value to be passed as the `this` parameter + * @returns {Function} A new function that will call the original function with the specified `this` context + */ +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; +const {iterator, toStringTag} = Symbol; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +}; + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction$1 = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); +}; + +/** + * Determine if a value is an empty object (safely handles Buffers) + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an empty object, otherwise false + */ +const isEmptyObject = (val) => { + // Early return for non-objects or Buffers to prevent RangeError + if (!isObject(val) || isBuffer(val)) { + return false; + } + + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + // Fallback for any other objects that might cause RangeError with Object.keys() + return false; + } +}; + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction$1(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction$1(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +}; + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Buffer check + if (isBuffer(obj)) { + return; + } + + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + if (isBuffer(obj)){ + return null; + } + + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless, skipUndefined} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else if (!skipUndefined || !isUndefined(val)) { + result[targetKey] = val; + } + }; + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction$1(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +}; + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +}; + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +}; + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[iterator]; + + const _iterator = generator.call(obj); + + let result; + + while ((result = _iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +}; + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +}; + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction$1(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +}; + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + }; + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +}; + +const noop = () => {}; + +const toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; +}; + + + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + //Buffer check + if (isBuffer(source)) { + return source; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + }; + + return visit(obj, 0); +}; + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); + +// original code +// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 + +const _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({source, data}) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + } + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})( + typeof setImmediate === 'function', + isFunction$1(_global.postMessage) +); + +const asap = typeof queueMicrotask !== 'undefined' ? + queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); + +// ********************* + + +const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); + + +const utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isEmptyObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction: isFunction$1, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap, + isIterable +}; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError$1(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } +} + +utils$1.inherits(AxiosError$1, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.status + }; + } +}); + +const prototype$1 = AxiosError$1.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError$1, descriptors); +Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError$1.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + const msg = error && error.message ? error.message : 'Error'; + + // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) + const errCode = code == null && error ? error.code : code; + AxiosError$1.call(axiosError, msg, errCode, config, request, response); + + // Chain the original error on the standard field; non-enumerable to avoid JSON noise + if (error && axiosError.cause == null) { + Object.defineProperty(axiosError, 'cause', { value: error, configurable: true }); + } + + axiosError.name = (error && error.name) || 'Error'; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +// eslint-disable-next-line strict +const httpAdapter = null; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData$1(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils$1.isDate(value)) { + return value.toISOString(); + } + + if (utils$1.isBoolean(value)) { + return value.toString(); + } + + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError$1('Blob is not supported. Use a Buffer instead.'); + } + + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils$1.isArray(value) && isFlatArray(value)) || + ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils$1.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode$1(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData$1(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?(object|Function)} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + if (utils$1.isFunction(options)) { + options = { + serialize: options + }; + } + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +const InterceptorManager$1 = InterceptorManager; + +const transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; + +const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; + +const FormData$1 = typeof FormData !== 'undefined' ? FormData : null; + +const Blob$1 = typeof Blob !== 'undefined' ? Blob : null; + +const platform$1 = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams$1, + FormData: FormData$1, + Blob: Blob$1 + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; + +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +const _navigator = typeof navigator === 'object' && navigator || undefined; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = hasBrowserEnv && + (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +const origin = hasBrowserEnv && window.location.href || 'http://localhost'; + +const utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv, + navigator: _navigator, + origin: origin +}); + +const platform = { + ...utils, + ...platform$1 +}; + +function toURLEncodedForm(data, options) { + return toFormData$1(data, new platform.classes.URLSearchParams(), { + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + }, + ...options + }); +} + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http', 'fetch'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils$1.isObject(data); + + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils$1.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils$1.isArrayBuffer(data) || + utils$1.isBuffer(data) || + utils$1.isStream(data) || + utils$1.isFile(data) || + utils$1.isBlob(data) || + utils$1.isReadableStream(data) + ) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData$1( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { + return data; + } + + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data, this.parseReviver); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +const defaults$1 = defaults; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils$1.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +const parseHeaders = rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils$1.isString(value)) return; + + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders$1 { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils$1.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils$1.isArray(entry)) { + throw TypeError('Object iterator must return a key-value pair'); + } + + obj[key = entry[0]] = (dest = obj[key]) ? + (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1]; + } + + setHeaders(obj, valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils$1.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + getSetCookie() { + return this.get("set-cookie") || []; + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils$1.freezeMethods(AxiosHeaders$1); + +const AxiosHeaders$2 = AxiosHeaders$1; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$2.from(context.headers); + let data = context.data; + + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + +function isCancel$1(value) { + return !!(value && value.__CANCEL__); +} + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError$1(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError$1.call(this, message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils$1.inherits(CanceledError$1, AxiosError$1, { + __CANCEL__: true +}); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError$1( + 'Request failed with status code ' + response.status, + [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1000 / freq; + let lastArgs; + let timer; + + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn(...args); + }; + + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if ( passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + + const flush = () => lastArgs && invoke(lastArgs); + + return [throttled, flush]; +} + +const progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return throttle(e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e, + lengthComputable: total != null, + [isDownloadStream ? 'download' : 'upload']: true + }; + + listener(data); + }, freq); +}; + +const progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +}; + +const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); + +const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { + url = new URL(url, platform.origin); + + return ( + origin.protocol === url.protocol && + origin.host === url.host && + (isMSIE || origin.port === url.port) + ); +})( + new URL(platform.origin), + platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) +) : () => true; + +const cookies = platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure, sameSite) { + if (typeof document === 'undefined') return; + + const cookie = [`${name}=${encodeURIComponent(value)}`]; + + if (utils$1.isNumber(expires)) { + cookie.push(`expires=${new Date(expires).toUTCString()}`); + } + if (utils$1.isString(path)) { + cookie.push(`path=${path}`); + } + if (utils$1.isString(domain)) { + cookie.push(`domain=${domain}`); + } + if (secure === true) { + cookie.push('secure'); + } + if (utils$1.isString(sameSite)) { + cookie.push(`SameSite=${sameSite}`); + } + + document.cookie = cookie.join('; '); + }, + + read(name) { + if (typeof document === 'undefined') return null; + const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); + return match ? decodeURIComponent(match[1]) : null; + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000, '/'); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { + let isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +const headersToObject = (thing) => thing instanceof AxiosHeaders$2 ? { ...thing } : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig$1(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, prop, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, prop, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, prop, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + }; + + utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + +const resolveConfig = (config) => { + const newConfig = mergeConfig$1({}, config); + + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + + newConfig.headers = headers = AxiosHeaders$2.from(headers); + + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + + // HTTP basic authentication + if (auth) { + headers.set('Authorization', 'Basic ' + + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) + ); + } + + if (utils$1.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(undefined); // browser handles it + } else if (utils$1.isFunction(data.getHeaders)) { + // Node.js FormData (like form-data package) + const formHeaders = data.getHeaders(); + // Only set safe headers to avoid overwriting security headers + const allowedHeaders = ['content-type', 'content-length']; + Object.entries(formHeaders).forEach(([key, val]) => { + if (allowedHeaders.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + } + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) { + // Add xsrf header + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); + + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + + return newConfig; +}; + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +const xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders$2.from(_config.headers).normalize(); + let {responseType, onUploadProgress, onDownloadProgress} = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + + function done() { + flushUpload && flushUpload(); // flush events + flushDownload && flushDownload(); // flush events + + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + + _config.signal && _config.signal.removeEventListener('abort', onCanceled); + } + + let request = new XMLHttpRequest(); + + request.open(_config.method.toUpperCase(), _config.url, true); + + // Set the request timeout in MS + request.timeout = _config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders$2.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError(event) { + // Browsers deliver a ProgressEvent in XHR onerror + // (message may be empty; when present, surface it) + // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event + const msg = event && event.message ? event.message : 'Network Error'; + const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request); + // attach the underlying event for consumers who want details + err.event = event || null; + reject(err); + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject(new AxiosError$1( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = _config.responseType; + } + + // Handle progress if needed + if (onDownloadProgress) { + ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); + request.addEventListener('progress', downloadThrottled); + } + + // Not all browsers support upload events + if (onUploadProgress && request.upload) { + ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); + + request.upload.addEventListener('progress', uploadThrottled); + + request.upload.addEventListener('loadend', flushUpload); + } + + if (_config.cancelToken || _config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel); + request.abort(); + request = null; + }; + + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(_config.url); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}; + +const composeSignals = (signals, timeout) => { + const {length} = (signals = signals ? signals.filter(Boolean) : []); + + if (timeout || length) { + let controller = new AbortController(); + + let aborted; + + const onabort = function (reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)); + } + }; + + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT)); + }, timeout); + + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach(signal => { + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); + }); + signals = null; + } + }; + + signals.forEach((signal) => signal.addEventListener('abort', onabort)); + + const {signal} = controller; + + signal.unsubscribe = () => utils$1.asap(unsubscribe); + + return signal; + } +}; + +const composeSignals$1 = composeSignals; + +const streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + + let pos = 0; + let end; + + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; + +const readBytes = async function* (iterable, chunkSize) { + for await (const chunk of readStream(iterable)) { + yield* streamChunk(chunk, chunkSize); + } +}; + +const readStream = async function* (stream) { + if (stream[Symbol.asyncIterator]) { + yield* stream; + return; + } + + const reader = stream.getReader(); + try { + for (;;) { + const {done, value} = await reader.read(); + if (done) { + break; + } + yield value; + } + } finally { + await reader.cancel(); + } +}; + +const trackStream = (stream, chunkSize, onProgress, onFinish) => { + const iterator = readBytes(stream, chunkSize); + + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + + return new ReadableStream({ + async pull(controller) { + try { + const {done, value} = await iterator.next(); + + if (done) { + _onFinish(); + controller.close(); + return; + } + + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { + highWaterMark: 2 + }) +}; + +const DEFAULT_CHUNK_SIZE = 64 * 1024; + +const {isFunction} = utils$1; + +const globalFetchAPI = (({Request, Response}) => ({ + Request, Response +}))(utils$1.global); + +const { + ReadableStream: ReadableStream$1, TextEncoder +} = utils$1.global; + + +const test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false + } +}; + +const factory = (env) => { + env = utils$1.merge.call({ + skipUndefined: true + }, globalFetchAPI, env); + + const {fetch: envFetch, Request, Response} = env; + const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; + const isRequestSupported = isFunction(Request); + const isResponseSupported = isFunction(Response); + + if (!isFetchSupported) { + return false; + } + + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); + + const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? + ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : + async (str) => new Uint8Array(await new Request(str).arrayBuffer()) + ); + + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { + let duplexAccessed = false; + + const hasContentType = new Request(platform.origin, { + body: new ReadableStream$1(), + method: 'POST', + get duplex() { + duplexAccessed = true; + return 'half'; + }, + }).headers.has('Content-Type'); + + return duplexAccessed && !hasContentType; + }); + + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && + test(() => utils$1.isReadableStream(new Response('').body)); + + const resolvers = { + stream: supportsResponseStream && ((res) => res.body) + }; + + isFetchSupported && ((() => { + ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { + !resolvers[type] && (resolvers[type] = (res, config) => { + let method = res && res[type]; + + if (method) { + return method.call(res); + } + + throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config); + }); + }); + })()); + + const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + + if (utils$1.isBlob(body)) { + return body.size; + } + + if (utils$1.isSpecCompliantForm(body)) { + const _request = new Request(platform.origin, { + method: 'POST', + body, + }); + return (await _request.arrayBuffer()).byteLength; + } + + if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { + return body.byteLength; + } + + if (utils$1.isURLSearchParams(body)) { + body = body + ''; + } + + if (utils$1.isString(body)) { + return (await encodeText(body)).byteLength; + } + }; + + const resolveBodyLength = async (headers, body) => { + const length = utils$1.toFiniteNumber(headers.getContentLength()); + + return length == null ? getBodyLength(body) : length; + }; + + return async (config) => { + let { + url, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = 'same-origin', + fetchOptions + } = resolveConfig(config); + + let _fetch = envFetch || fetch; + + responseType = responseType ? (responseType + '').toLowerCase() : 'text'; + + let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + + let request = null; + + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + + let requestContentLength; + + try { + if ( + onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && + (requestContentLength = await resolveBodyLength(headers, data)) !== 0 + ) { + let _request = new Request(url, { + method: 'POST', + body: data, + duplex: "half" + }); + + let contentTypeHeader; + + if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { + headers.setContentType(contentTypeHeader); + } + + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + } + + if (!utils$1.isString(withCredentials)) { + withCredentials = withCredentials ? 'include' : 'omit'; + } + + // Cloudflare Workers throws when credentials are defined + // see https://github.com/cloudflare/workerd/issues/902 + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + + const resolvedOptions = { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : undefined + }; + + request = isRequestSupported && new Request(url, resolvedOptions); + + let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); + + const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); + + if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { + const options = {}; + + ['status', 'statusText', 'headers'].forEach(prop => { + options[prop] = response[prop]; + }); + + const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length')); + + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), + options + ); + } + + responseType = responseType || 'text'; + + let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config); + + !isStreamResponse && unsubscribe && unsubscribe(); + + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders$2.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }) + } catch (err) { + unsubscribe && unsubscribe(); + + if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request), + { + cause: err.cause || err + } + ) + } + + throw AxiosError$1.from(err, err && err.code, config, request); + } + } +}; + +const seedCache = new Map(); + +const getFetch = (config) => { + let env = (config && config.env) || {}; + const {fetch, Request, Response} = env; + const seeds = [ + Request, Response, fetch + ]; + + let len = seeds.length, i = len, + seed, target, map = seedCache; + + while (i--) { + seed = seeds[i]; + target = map.get(seed); + + target === undefined && map.set(seed, target = (i ? new Map() : factory(env))); + + map = target; + } + + return target; +}; + +getFetch(); + +/** + * Known adapters mapping. + * Provides environment-specific adapters for Axios: + * - `http` for Node.js + * - `xhr` for browsers + * - `fetch` for fetch API-based requests + * + * @type {Object} + */ +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter, + fetch: { + get: getFetch, + } +}; + +// Assign adapter names for easier debugging and identification +utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', { value }); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', { value }); + } +}); + +/** + * Render a rejection reason string for unknown or unsupported adapters + * + * @param {string} reason + * @returns {string} + */ +const renderReason = (reason) => `- ${reason}`; + +/** + * Check if the adapter is resolved (function, null, or false) + * + * @param {Function|null|false} adapter + * @returns {boolean} + */ +const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; + +/** + * Get the first suitable adapter from the provided list. + * Tries each adapter in order until a supported one is found. + * Throws an AxiosError if no adapter is suitable. + * + * @param {Array|string|Function} adapters - Adapter(s) by name or function. + * @param {Object} config - Axios request configuration + * @throws {AxiosError} If no suitable adapter is available + * @returns {Function} The resolved adapter function + */ +function getAdapter$1(adapters, config) { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + + const { length } = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError$1(`Unknown adapter '${id}'`); + } + } + + if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError$1( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; +} + +/** + * Exports Axios adapters and utility to resolve an adapter + */ +const adapters = { + /** + * Resolve an adapter from a list of adapter names or functions. + * @type {Function} + */ + getAdapter: getAdapter$1, + + /** + * Exposes all known adapters + * @type {Object} + */ + adapters: knownAdapters +}; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError$1(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders$2.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders$2.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel$1(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$2.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + +const VERSION$1 = "1.13.2"; + +const validators$1 = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError$1( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError$1.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +validators$1.spelling = function spelling(correctSpelling) { + return (value, opt) => { + // eslint-disable-next-line no-console + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + } +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION); + } + } +} + +const validator = { + assertOptions, + validators: validators$1 +}; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios$1 { + constructor(instanceConfig) { + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy = {}; + + Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + try { + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack; + } + } catch (e) { + // ignore the case where "stack" is an un-writable property + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig$1(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.allowAbsoluteUrls + if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { + config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + } else { + config.allowAbsoluteUrls = true; + } + + validator.assertOptions(config, { + baseUrl: validators.spelling('baseURL'), + withXsrfToken: validators.spelling('withXSRFToken') + }, true); + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + + headers && utils$1.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders$2.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift(...requestInterceptorChain); + chain.push(...responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig$1(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios$1.prototype[method] = function(url, config) { + return this.request(mergeConfig$1(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig$1(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios$1.prototype[method] = generateHTTPMethod(); + + Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +const Axios$2 = Axios$1; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken$1 { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError$1(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + toAbortSignal() { + const controller = new AbortController(); + + const abort = (err) => { + controller.abort(err); + }; + + this.subscribe(abort); + + controller.signal.unsubscribe = () => this.unsubscribe(abort); + + return controller.signal; + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken$1(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +const CancelToken$2 = CancelToken$1; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread$1(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError$1(payload) { + return utils$1.isObject(payload) && (payload.isAxiosError === true); +} + +const HttpStatusCode$1 = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, + WebServerIsDown: 521, + ConnectionTimedOut: 522, + OriginIsUnreachable: 523, + TimeoutOccurred: 524, + SslHandshakeFailed: 525, + InvalidSslCertificate: 526, +}; + +Object.entries(HttpStatusCode$1).forEach(([key, value]) => { + HttpStatusCode$1[value] = key; +}); + +const HttpStatusCode$2 = HttpStatusCode$1; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios$2(defaultConfig); + const instance = bind(Axios$2.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$2.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils$1.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig$1(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults$1); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios$2; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError$1; +axios.CancelToken = CancelToken$2; +axios.isCancel = isCancel$1; +axios.VERSION = VERSION$1; +axios.toFormData = toFormData$1; + +// Expose AxiosError class +axios.AxiosError = AxiosError$1; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread$1; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError$1; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig$1; + +axios.AxiosHeaders = AxiosHeaders$2; + +axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode$2; + +axios.default = axios; + +// this module should only have a default export +const axios$1 = axios; + +// This module is intended to unwrap Axios default export as named. +// Keep top-level export same with static properties +// so that it can keep same with es module or cjs +const { + Axios, + AxiosError, + CanceledError, + isCancel, + CancelToken, + VERSION, + all, + Cancel, + isAxiosError, + spread, + toFormData, + AxiosHeaders, + HttpStatusCode, + formToJSON, + getAdapter, + mergeConfig +} = axios$1; + +export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, axios$1 as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData }; +//# sourceMappingURL=axios.js.map diff --git a/node_modules/axios/dist/esm/axios.js.map b/node_modules/axios/dist/esm/axios.js.map new file mode 100644 index 0000000..d525b7a --- /dev/null +++ b/node_modules/axios/dist/esm/axios.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.js","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/null.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/browser/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/speedometer.js","../../lib/helpers/throttle.js","../../lib/helpers/progressEventReducer.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/cookies.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/core/mergeConfig.js","../../lib/helpers/resolveConfig.js","../../lib/adapters/xhr.js","../../lib/helpers/composeSignals.js","../../lib/helpers/trackStream.js","../../lib/adapters/fetch.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js","../../index.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n if (isBuffer(obj)){\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless, skipUndefined} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n const msg = error && error.message ? error.message : 'Error';\n\n // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)\n const errCode = code == null && error ? error.code : code;\n AxiosError.call(axiosError, msg, errCode, config, request, response);\n\n // Chain the original error on the standard field; non-enumerable to avoid JSON noise\n if (error && axiosError.cause == null) {\n Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });\n }\n\n axiosError.name = (error && error.name) || 'Error';\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, this.parseReviver);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));\n return match ? decodeURIComponent(match[1]) : null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)\n };\n\n utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n request = null;\n };\n \n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst {isFunction} = utils;\n\nconst globalFetchAPI = (({Request, Response}) => ({\n Request, Response\n}))(utils.global);\n\nconst {\n ReadableStream, TextEncoder\n} = utils.global;\n\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst factory = (env) => {\n env = utils.merge.call({\n skipUndefined: true\n }, globalFetchAPI, env);\n\n const {fetch: envFetch, Request, Response} = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Request(str).arrayBuffer())\n );\n\n const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n };\n\n isFetchSupported && ((() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n })());\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n }\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n }\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request = null;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && \"credentials\" in Request.prototype;\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n }\n}\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const {fetch, Request, Response} = env;\n const seeds = [\n Request, Response, fetch\n ];\n\n let len = seeds.length, i = len,\n seed, target, map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n * \n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n }\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', { value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n * \n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n * \n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n * \n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters\n};\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.13.2\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n"],"names":["isFunction","AxiosError","utils","prototype","toFormData","encode","URLSearchParams","FormData","Blob","platform","AxiosHeaders","defaults","isCancel","CanceledError","mergeConfig","ReadableStream","composeSignals","fetchAdapter.getFetch","getAdapter","VERSION","validators","Axios","InterceptorManager","CancelToken","spread","isAxiosError","HttpStatusCode","axios"],"mappings":";AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACTA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC;AACvC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB;AACA,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK;AAC7B,EAAE,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,EAAE,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI;AAC1C,EAAC;AACD;AACA,MAAM,UAAU,GAAG,IAAI,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;AACxB;AACA;AACA;AACA;AACA;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node_modules/axios/dist/esm/axios.min.js new file mode 100644 index 0000000..c974069 --- /dev/null +++ b/node_modules/axios/dist/esm/axios.min.js @@ -0,0 +1,3 @@ +/*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */ +function e(e,t){return function(){return e.apply(t,arguments)}}const{toString:t}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:r,toStringTag:o}=Symbol,s=(i=Object.create(null),e=>{const n=t.call(e);return i[n]||(i[n]=n.slice(8,-1).toLowerCase())});var i;const a=e=>(e=e.toLowerCase(),t=>s(t)===e),c=e=>t=>typeof t===e,{isArray:l}=Array,u=c("undefined");function f(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&h(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const d=a("ArrayBuffer");const p=c("string"),h=c("function"),m=c("number"),b=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==s(e))return!1;const t=n(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||o in e||r in e)},g=a("Date"),w=a("File"),E=a("Blob"),O=a("FileList"),R=a("URLSearchParams"),[S,T,A,v]=["ReadableStream","Request","Response","Headers"].map(a);function C(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,o=e.length;r0;)if(r=n[o],t===r.toLowerCase())return r;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,N=e=>!u(e)&&e!==j;const U=(P="undefined"!=typeof Uint8Array&&n(Uint8Array),e=>P&&e instanceof P);var P;const F=a("HTMLFormElement"),_=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),L=a("RegExp"),k=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};C(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)};const B=a("AsyncFunction"),D=(q="function"==typeof setImmediate,I=h(j.postMessage),q?setImmediate:I?(M=`axios@${Math.random()}`,z=[],j.addEventListener("message",(({source:e,data:t})=>{e===j&&t===M&&z.length&&z.shift()()}),!1),e=>{z.push(e),j.postMessage(M,"*")}):e=>setTimeout(e));var q,I,M,z;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(j):"undefined"!=typeof process&&process.nextTick||D,J={isArray:l,isArrayBuffer:d,isBuffer:f,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||h(e.append)&&("formdata"===(t=s(e))||"object"===t&&h(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer),t},isString:p,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:y,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:S,isRequest:T,isResponse:A,isHeaders:v,isUndefined:u,isDate:g,isFile:w,isBlob:E,isRegExp:L,isFunction:h,isStream:e=>b(e)&&h(e.pipe),isURLSearchParams:R,isTypedArray:U,isFileList:O,forEach:C,merge:function e(){const{caseless:t,skipUndefined:n}=N(this)&&this||{},r={},o=(o,s)=>{const i=t&&x(r,s)||s;y(r[i])&&y(o)?r[i]=e(r[i],o):y(o)?r[i]=e({},o):l(o)?r[i]=o.slice():n&&u(o)||(r[i]=o)};for(let e=0,t=arguments.length;e(C(n,((n,o)=>{r&&h(n)?t[o]=e(n,r):t[o]=n}),{allOwnKeys:o}),t),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,r,o)=>{let s,i,a;const c={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],o&&!o(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==r&&n(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:a,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:F,hasOwnProperty:_,hasOwnProp:_,reduceDescriptors:k,freezeMethods:e=>{k(e,((t,n)=>{if(h(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];h(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:j,isContextDefined:N,isSpecCompliantForm:function(e){return!!(e&&h(e.append)&&"FormData"===e[o]&&e[r])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(f(e))return e;if(!("toJSON"in e)){t[r]=e;const o=l(e)?[]:{};return C(e,((e,t)=>{const s=n(e,r+1);!u(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(b(e)||h(e))&&h(e.then)&&h(e.catch),setImmediate:D,asap:H,isIterable:e=>null!=e&&h(e[r])};function W(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}J.inherits(W,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:J.toJSONObject(this.config),code:this.code,status:this.status}}});const $=W.prototype,K={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{K[e]={value:e}})),Object.defineProperties(W,K),Object.defineProperty($,"isAxiosError",{value:!0}),W.from=(e,t,n,r,o,s)=>{const i=Object.create($);J.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return W.call(i,a,c,n,r,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};function V(e){return J.isPlainObject(e)||J.isArray(e)}function X(e){return J.endsWith(e,"[]")?e.slice(0,-2):e}function G(e,t,n){return e?e.concat(t).map((function(e,t){return e=X(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Q=J.toFlatObject(J,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Z(e,t,n){if(!J.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=J.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!J.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&J.isSpecCompliantForm(t);if(!J.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(J.isDate(e))return e.toISOString();if(J.isBoolean(e))return e.toString();if(!a&&J.isBlob(e))throw new W("Blob is not supported. Use a Buffer instead.");return J.isArrayBuffer(e)||J.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(J.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(J.isArray(e)&&function(e){return J.isArray(e)&&!e.some(V)}(e)||(J.isFileList(e)||J.endsWith(n,"[]"))&&(a=J.toArray(e)))return n=X(n),a.forEach((function(e,r){!J.isUndefined(e)&&null!==e&&t.append(!0===i?G([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!V(e)||(t.append(G(o,n,s),c(e)),!1)}const u=[],f=Object.assign(Q,{defaultVisitor:l,convertValue:c,isVisitable:V});if(!J.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!J.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),J.forEach(n,(function(n,s){!0===(!(J.isUndefined(n)||null===n)&&o.call(t,n,J.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])})),u.pop()}}(e),t}function Y(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ee(e,t){this._pairs=[],e&&Z(e,this,t)}const te=ee.prototype;function ne(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function re(e,t,n){if(!t)return e;const r=n&&n.encode||ne;J.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(t,n):J.isURLSearchParams(t)?t.toString():new ee(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}te.append=function(e,t){this._pairs.push([e,t])},te.toString=function(e){const t=e?function(t){return e.call(this,t,Y)}:Y;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const oe=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){J.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},se={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ee,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ae="undefined"!=typeof window&&"undefined"!=typeof document,ce="object"==typeof navigator&&navigator||void 0,le=ae&&(!ce||["ReactNative","NativeScript","NS"].indexOf(ce.product)<0),ue="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fe=ae&&window.location.href||"http://localhost",de={...Object.freeze({__proto__:null,hasBrowserEnv:ae,hasStandardBrowserWebWorkerEnv:ue,hasStandardBrowserEnv:le,navigator:ce,origin:fe}),...ie};function pe(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&J.isArray(r)?r.length:s,a)return J.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&J.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&J.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r{t(function(e){return J.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const he={transitional:se,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=J.isObject(e);o&&J.isHTMLForm(e)&&(e=new FormData(e));if(J.isFormData(e))return r?JSON.stringify(pe(e)):e;if(J.isArrayBuffer(e)||J.isBuffer(e)||J.isStream(e)||J.isFile(e)||J.isBlob(e)||J.isReadableStream(e))return e;if(J.isArrayBufferView(e))return e.buffer;if(J.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Z(e,new de.classes.URLSearchParams,{visitor:function(e,t,n,r){return de.isNode&&J.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=J.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Z(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(J.isString(e))try{return(t||JSON.parse)(e),J.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||he.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(J.isResponse(e)||J.isReadableStream(e))return e;if(e&&J.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw W.from(e,W.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:de.classes.FormData,Blob:de.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};J.forEach(["delete","get","head","post","put","patch"],(e=>{he.headers[e]={}}));const me=he,be=J.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ye=Symbol("internals");function ge(e){return e&&String(e).trim().toLowerCase()}function we(e){return!1===e||null==e?e:J.isArray(e)?e.map(we):String(e)}function Ee(e,t,n,r,o){return J.isFunction(r)?r.call(this,t,n):(o&&(t=n),J.isString(t)?J.isString(r)?-1!==t.indexOf(r):J.isRegExp(r)?r.test(t):void 0:void 0)}class Oe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ge(t);if(!o)throw new Error("header name must be a non-empty string");const s=J.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=we(e))}const s=(e,t)=>J.forEach(e,((e,n)=>o(e,n,t)));if(J.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(J.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&be[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(J.isObject(e)&&J.isIterable(e)){let n,r,o={};for(const t of e){if(!J.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?J.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ge(e)){const n=J.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(J.isFunction(t))return t.call(this,e,n);if(J.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ge(e)){const n=J.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ee(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ge(e)){const o=J.findKey(n,e);!o||t&&!Ee(0,n[o],o,t)||(delete n[o],r=!0)}}return J.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ee(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return J.forEach(this,((r,o)=>{const s=J.findKey(n,o);if(s)return t[s]=we(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=we(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return J.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&J.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ye]=this[ye]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ge(e);t[r]||(!function(e,t){const n=J.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return J.isArray(e)?e.forEach(r):r(e),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),J.reduceDescriptors(Oe.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),J.freezeMethods(Oe);const Re=Oe;function Se(e,t){const n=this||me,r=t||n,o=Re.from(r.headers);let s=r.data;return J.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Te(e){return!(!e||!e.__CANCEL__)}function Ae(e,t,n){W.call(this,null==e?"canceled":e,W.ERR_CANCELED,t,n),this.name="CanceledError"}function ve(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new W("Request failed with status code "+n.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}J.inherits(Ae,W,{__CANCEL__:!0});const Ce=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[i];o||(o=c),n[s]=a,r[s]=c;let u=i,f=0;for(;u!==s;)f+=n[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o{o=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(n=e,r||(r=setTimeout((()=>{r=null,i(n)}),s-a)))},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-r,c=o(a);r=s;e({loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},xe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},je=e=>(...t)=>J.asap((()=>e(...t))),Ne=de.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,de.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(de.origin),de.navigator&&/(msie|trident)/i.test(de.navigator.userAgent)):()=>!0,Ue=de.hasStandardBrowserEnv?{write(e,t,n,r,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];J.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),J.isString(r)&&a.push(`path=${r}`),J.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),J.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function Pe(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Fe=e=>e instanceof Re?{...e}:e;function _e(e,t){t=t||{};const n={};function r(e,t,n,r){return J.isPlainObject(e)&&J.isPlainObject(t)?J.merge.call({caseless:r},e,t):J.isPlainObject(t)?J.merge({},t):J.isArray(t)?t.slice():t}function o(e,t,n,o){return J.isUndefined(t)?J.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function s(e,t){if(!J.isUndefined(t))return r(void 0,t)}function i(e,t){return J.isUndefined(t)?J.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>o(Fe(e),Fe(t),0,!0)};return J.forEach(Object.keys({...e,...t}),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);J.isUndefined(i)&&s!==a||(n[r]=i)})),n}const Le=e=>{const t=_e({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Re.from(i),t.url=re(Pe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),J.isFormData(n))if(de.hasStandardBrowserEnv||de.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(J.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)}))}if(de.hasStandardBrowserEnv&&(r&&J.isFunction(r)&&(r=r(t)),r||!1!==r&&Ne(t.url))){const e=o&&s&&Ue.read(s);e&&i.set(o,e)}return t},ke="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Le(e);let o=r.data;const s=Re.from(r.headers).normalize();let i,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function b(){if(!m)return;const r=Re.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());ve((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=b:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(b)},m.onabort=function(){m&&(n(new W("Request aborted",W.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new W(t&&t.message?t.message:"Network Error",W.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||se;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new W(t,o.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&J.forEach(s.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),J.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=Ce(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=Ce(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new Ae(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===de.protocols.indexOf(y)?n(new W("Unsupported protocol "+y+":",W.ERR_BAD_REQUEST,e)):m.send(o||null)}))},Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof W?t:new Ae(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new W(`timeout ${t} of ms exceeded`,W.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>J.asap(i),a}},De=function*(e,t){let n=e.byteLength;if(!t||n{const o=async function*(e,t){for await(const n of qe(e))yield*De(n,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=i+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Me}=J,ze=(({Request:e,Response:t})=>({Request:e,Response:t}))(J.global),{ReadableStream:He,TextEncoder:Je}=J.global,We=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},$e=e=>{e=J.merge.call({skipUndefined:!0},ze,e);const{fetch:t,Request:n,Response:r}=e,o=t?Me(t):"function"==typeof fetch,s=Me(n),i=Me(r);if(!o)return!1;const a=o&&Me(He),c=o&&("function"==typeof Je?(l=new Je,e=>l.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var l;const u=s&&a&&We((()=>{let e=!1;const t=new n(de.origin,{body:new He,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),f=i&&a&&We((()=>J.isReadableStream(new r("").body))),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new W(`Response type '${e}' is not supported`,W.ERR_NOT_SUPPORT,n)})}));const p=async(e,t)=>{const r=J.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(J.isBlob(e))return e.size;if(J.isSpecCompliantForm(e)){const t=new n(de.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return J.isArrayBufferView(e)||J.isArrayBuffer(e)?e.byteLength:(J.isURLSearchParams(e)&&(e+=""),J.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:i,data:a,signal:c,cancelToken:l,timeout:h,onDownloadProgress:m,onUploadProgress:b,responseType:y,headers:g,withCredentials:w="same-origin",fetchOptions:E}=Le(e),O=t||fetch;y=y?(y+"").toLowerCase():"text";let R=Be([c,l&&l.toAbortSignal()],h),S=null;const T=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let A;try{if(b&&u&&"get"!==i&&"head"!==i&&0!==(A=await p(g,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(J.isFormData(a)&&(e=t.headers.get("content-type"))&&g.setContentType(e),t.body){const[e,n]=xe(A,Ce(je(b)));a=Ie(t.body,65536,e,n)}}J.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in n.prototype,c={...E,signal:R,method:i.toUpperCase(),headers:g.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};S=s&&new n(o,c);let l=await(s?O(S,E):O(o,c));const h=f&&("stream"===y||"response"===y);if(f&&(m||h&&T)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=l[t]}));const t=J.toFiniteNumber(l.headers.get("content-length")),[n,o]=m&&xe(t,Ce(je(m),!0))||[];l=new r(Ie(l.body,65536,n,(()=>{o&&o(),T&&T()})),e)}y=y||"text";let v=await d[J.findKey(d,y)||"text"](l,e);return!h&&T&&T(),await new Promise(((t,n)=>{ve(t,n,{data:v,headers:Re.from(l.headers),status:l.status,statusText:l.statusText,config:e,request:S})}))}catch(t){if(T&&T(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new W("Network Error",W.ERR_NETWORK,e,S),{cause:t.cause||t});throw W.from(t,t&&t.code,e,S)}}},Ke=new Map,Ve=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,s=[r,o,n];let i,a,c=s.length,l=Ke;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:$e(t)),l=a;return a};Ve();const Xe={http:null,xhr:ke,fetch:{get:Ve}};J.forEach(Xe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ge=e=>`- ${e}`,Qe=e=>J.isFunction(e)||null===e||!1===e;const Ze={getAdapter:function(e,t){e=J.isArray(e)?e:[e];const{length:n}=e;let r,o;const s={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new W("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ge).join("\n"):" "+Ge(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o},adapters:Xe};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ae(null,e)}function et(e){Ye(e),e.headers=Re.from(e.headers),e.data=Se.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ze.getAdapter(e.adapter||me.adapter,e)(e).then((function(t){return Ye(e),t.data=Se.call(e,e.transformResponse,t),t.headers=Re.from(t.headers),t}),(function(t){return Te(t)||(Ye(e),t&&t.response&&(t.response.data=Se.call(e,e.transformResponse,t.response),t.response.headers=Re.from(t.response.headers))),Promise.reject(t)}))}const tt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{tt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const nt={};tt.transitional=function(e,t,n){function r(e,t){return"[Axios v1.13.2] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new W(r(o," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!nt[o]&&(nt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}},tt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const rt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new W("option "+s+" must be "+n,W.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new W("Unknown option "+s,W.ERR_BAD_OPTION)}},validators:tt},ot=rt.validators;class st{constructor(e){this.defaults=e||{},this.interceptors={request:new oe,response:new oe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=_e(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&rt.assertOptions(n,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean)},!1),null!=r&&(J.isFunction(r)?t.paramsSerializer={serialize:r}:rt.assertOptions(r,{encode:ot.function,serialize:ot.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),rt.assertOptions(t,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&J.merge(o.common,o[t.method]);o&&J.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Re.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,f=0;if(!a){const e=[et.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Ae(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new at((function(t){e=t})),cancel:e}}}const ct=at;const lt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(lt).forEach((([e,t])=>{lt[t]=e}));const ut=lt;const ft=function t(n){const r=new it(n),o=e(it.prototype.request,r);return J.extend(o,it.prototype,r,{allOwnKeys:!0}),J.extend(o,r,null,{allOwnKeys:!0}),o.create=function(e){return t(_e(n,e))},o}(me);ft.Axios=it,ft.CanceledError=Ae,ft.CancelToken=ct,ft.isCancel=Te,ft.VERSION="1.13.2",ft.toFormData=Z,ft.AxiosError=W,ft.Cancel=ft.CanceledError,ft.all=function(e){return Promise.all(e)},ft.spread=function(e){return function(t){return e.apply(null,t)}},ft.isAxiosError=function(e){return J.isObject(e)&&!0===e.isAxiosError},ft.mergeConfig=_e,ft.AxiosHeaders=Re,ft.formToJSON=e=>pe(J.isHTMLForm(e)?new FormData(e):e),ft.getAdapter=Ze.getAdapter,ft.HttpStatusCode=ut,ft.default=ft;const dt=ft,{Axios:pt,AxiosError:ht,CanceledError:mt,isCancel:bt,CancelToken:yt,VERSION:gt,all:wt,Cancel:Et,isAxiosError:Ot,spread:Rt,toFormData:St,AxiosHeaders:Tt,HttpStatusCode:At,formToJSON:vt,getAdapter:Ct,mergeConfig:xt}=dt;export{pt as Axios,ht as AxiosError,Tt as AxiosHeaders,Et as Cancel,yt as CancelToken,mt as CanceledError,At as HttpStatusCode,gt as VERSION,wt as all,dt as default,vt as formToJSON,Ct as getAdapter,Ot as isAxiosError,bt as isCancel,xt as mergeConfig,Rt as spread,St as toFormData}; +//# sourceMappingURL=axios.min.js.map diff --git a/node_modules/axios/dist/esm/axios.min.js.map b/node_modules/axios/dist/esm/axios.min.js.map new file mode 100644 index 0000000..9638201 --- /dev/null +++ b/node_modules/axios/dist/esm/axios.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.min.js","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/browser/index.js","../../lib/platform/browser/classes/URLSearchParams.js","../../lib/platform/browser/classes/FormData.js","../../lib/platform/browser/classes/Blob.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/progressEventReducer.js","../../lib/helpers/speedometer.js","../../lib/helpers/throttle.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/cookies.js","../../lib/core/buildFullPath.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/mergeConfig.js","../../lib/helpers/resolveConfig.js","../../lib/adapters/xhr.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/composeSignals.js","../../lib/helpers/trackStream.js","../../lib/adapters/fetch.js","../../lib/adapters/adapters.js","../../lib/helpers/null.js","../../lib/core/dispatchRequest.js","../../lib/env/data.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../index.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n if (isBuffer(obj)){\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless, skipUndefined} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n const msg = error && error.message ? error.message : 'Error';\n\n // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)\n const errCode = code == null && error ? error.code : code;\n AxiosError.call(axiosError, msg, errCode, config, request, response);\n\n // Chain the original error on the standard field; non-enumerable to avoid JSON noise\n if (error && axiosError.cause == null) {\n Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });\n }\n\n axiosError.name = (error && error.name) || 'Error';\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, this.parseReviver);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));\n return match ? decodeURIComponent(match[1]) : null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)\n };\n\n utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n request = null;\n };\n \n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst {isFunction} = utils;\n\nconst globalFetchAPI = (({Request, Response}) => ({\n Request, Response\n}))(utils.global);\n\nconst {\n ReadableStream, TextEncoder\n} = utils.global;\n\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst factory = (env) => {\n env = utils.merge.call({\n skipUndefined: true\n }, globalFetchAPI, env);\n\n const {fetch: envFetch, Request, Response} = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Request(str).arrayBuffer())\n );\n\n const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n };\n\n isFetchSupported && ((() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n })());\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n }\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n }\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request = null;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && \"credentials\" in Request.prototype;\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n }\n}\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const {fetch, Request, Response} = env;\n const seeds = [\n Request, Response, fetch\n ];\n\n let len = seeds.length, i = len,\n seed, target, map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n * \n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n }\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', { value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n * \n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n * \n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n * \n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters\n};\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.13.2\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n} = axios;\n\nexport {\n axios as default,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig\n}\n"],"names":["bind","fn","thisArg","apply","arguments","toString","Object","prototype","getPrototypeOf","iterator","toStringTag","Symbol","kindOf","cache","create","thing","str","call","slice","toLowerCase","kindOfTest","type","typeOfTest","isArray","Array","isUndefined","isBuffer","val","constructor","isFunction","isArrayBuffer","isString","isNumber","isObject","isPlainObject","isDate","isFile","isBlob","isFileList","isURLSearchParams","isReadableStream","isRequest","isResponse","isHeaders","map","forEach","obj","allOwnKeys","i","l","length","keys","getOwnPropertyNames","len","key","findKey","_key","_global","globalThis","self","window","global","isContextDefined","context","isTypedArray","TypedArray","Uint8Array","isHTMLForm","hasOwnProperty","prop","isRegExp","reduceDescriptors","reducer","descriptors","getOwnPropertyDescriptors","reducedDescriptors","descriptor","name","ret","defineProperties","isAsyncFn","_setImmediate","setImmediateSupported","setImmediate","postMessageSupported","postMessage","token","Math","random","callbacks","addEventListener","source","data","shift","cb","push","setTimeout","asap","queueMicrotask","process","nextTick","utils$1","isFormData","kind","FormData","append","isArrayBufferView","result","ArrayBuffer","isView","buffer","isBoolean","isEmptyObject","e","isStream","pipe","merge","caseless","skipUndefined","this","assignValue","targetKey","extend","a","b","trim","replace","stripBOM","content","charCodeAt","inherits","superConstructor","props","defineProperty","value","assign","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","String","undefined","lastIndex","indexOf","toArray","arr","forEachEntry","_iterator","next","done","pair","matchAll","regExp","matches","exec","hasOwnProp","freezeMethods","enumerable","writable","set","Error","toObjectSet","arrayOrString","delimiter","define","split","toCamelCase","m","p1","p2","toUpperCase","noop","toFiniteNumber","defaultValue","Number","isFinite","isSpecCompliantForm","toJSONObject","stack","visit","target","reducedValue","isThenable","then","catch","isIterable","AxiosError","message","code","config","request","response","captureStackTrace","status","utils","toJSON","description","number","fileName","lineNumber","columnNumber","from","error","customProps","axiosError","msg","errCode","cause","configurable","isVisitable","removeBrackets","renderKey","path","dots","concat","join","predicates","test","toFormData","formData","options","TypeError","metaTokens","indexes","option","visitor","defaultVisitor","useBlob","Blob","convertValue","toISOString","Buffer","JSON","stringify","some","isFlatArray","el","index","exposedHelpers","build","pop","encode","charMap","encodeURIComponent","match","AxiosURLSearchParams","params","_pairs","buildURL","url","_encode","serialize","serializeFn","serializedParams","hashmarkIndex","encoder","InterceptorManager$1","handlers","use","fulfilled","rejected","synchronous","runWhen","eject","id","clear","h","transitionalDefaults","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","platform$1","isBrowser","classes","URLSearchParams","protocols","hasBrowserEnv","document","_navigator","navigator","hasStandardBrowserEnv","product","hasStandardBrowserWebWorkerEnv","WorkerGlobalScope","importScripts","origin","location","href","platform","formDataToJSON","buildPath","isNumericKey","isLast","arrayToObject","entries","parsePropPath","defaults","transitional","adapter","transformRequest","headers","contentType","getContentType","hasJSONContentType","isObjectPayload","setContentType","helpers","isNode","toURLEncodedForm","formSerializer","_FormData","env","rawValue","parser","parse","stringifySafely","transformResponse","JSONRequested","responseType","strictJSONParsing","parseReviver","ERR_BAD_RESPONSE","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","common","Accept","method","defaults$1","ignoreDuplicateOf","$internals","normalizeHeader","header","normalizeValue","matchHeaderValue","isHeaderNameFilter","AxiosHeaders","valueOrRewrite","rewrite","setHeader","_value","_header","_rewrite","lHeader","setHeaders","rawHeaders","parsed","line","substring","parseHeaders","dest","entry","get","tokens","tokensRE","parseTokens","has","matcher","delete","deleted","deleteHeader","normalize","format","normalized","w","char","formatHeader","targets","asStrings","getSetCookie","static","first","computed","accessors","defineAccessor","accessorName","methodName","arg1","arg2","arg3","buildAccessors","accessor","mapped","headerValue","AxiosHeaders$2","transformData","fns","isCancel","__CANCEL__","CanceledError","ERR_CANCELED","settle","resolve","reject","ERR_BAD_REQUEST","floor","progressEventReducer","listener","isDownloadStream","freq","bytesNotified","_speedometer","samplesCount","min","bytes","timestamps","firstSampleTS","head","tail","chunkLength","now","Date","startedAt","bytesCount","passed","round","speedometer","lastArgs","timer","timestamp","threshold","invoke","args","clearTimeout","throttle","loaded","total","lengthComputable","progressBytes","rate","progress","estimated","event","progressEventDecorator","throttled","asyncDecorator","isURLSameOrigin","isMSIE","URL","protocol","host","port","userAgent","cookies","write","expires","domain","secure","sameSite","cookie","toUTCString","read","RegExp","decodeURIComponent","remove","buildFullPath","baseURL","requestedURL","allowAbsoluteUrls","isRelativeUrl","relativeURL","combineURLs","headersToObject","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","paramsSerializer","timeoutMessage","withCredentials","withXSRFToken","onUploadProgress","onDownloadProgress","decompress","beforeRedirect","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding","configValue","resolveConfig","newConfig","auth","btoa","username","password","unescape","getHeaders","formHeaders","allowedHeaders","includes","xsrfValue","xhrAdapter","XMLHttpRequest","Promise","_config","requestData","requestHeaders","onCanceled","uploadThrottled","downloadThrottled","flushUpload","flushDownload","unsubscribe","signal","removeEventListener","onloadend","responseHeaders","getAllResponseHeaders","err","responseText","statusText","open","onreadystatechange","readyState","responseURL","onabort","ECONNABORTED","onerror","ERR_NETWORK","ontimeout","timeoutErrorMessage","ETIMEDOUT","setRequestHeader","upload","cancel","abort","subscribe","aborted","parseProtocol","send","composeSignals$1","signals","Boolean","controller","AbortController","reason","streamChunk","chunk","chunkSize","byteLength","end","pos","readStream","async","stream","asyncIterator","reader","getReader","trackStream","onProgress","onFinish","iterable","readBytes","_onFinish","ReadableStream","close","loadedBytes","enqueue","return","highWaterMark","globalFetchAPI","Request","Response","TextEncoder","factory","fetch","envFetch","isFetchSupported","isRequestSupported","isResponseSupported","isReadableStreamSupported","encodeText","arrayBuffer","supportsRequestStream","duplexAccessed","hasContentType","body","duplex","supportsResponseStream","resolvers","res","ERR_NOT_SUPPORT","resolveBodyLength","getContentLength","size","_request","getBodyLength","fetchOptions","_fetch","composedSignal","composeSignals","toAbortSignal","requestContentLength","contentTypeHeader","flush","isCredentialsSupported","resolvedOptions","credentials","isStreamResponse","responseContentLength","responseData","seedCache","Map","getFetch","seeds","seed","knownAdapters","http","xhr","fetchAdapter.getFetch","renderReason","isResolvedHandle","adapters","getAdapter","nameOrAdapter","rejectedReasons","reasons","state","throwIfCancellationRequested","throwIfRequested","dispatchRequest","validators","deprecatedWarnings","validator","version","formatMessage","opt","desc","opts","ERR_DEPRECATED","console","warn","spelling","correctSpelling","assertOptions","schema","allowUnknown","ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","Axios","instanceConfig","interceptors","InterceptorManager","configOrUrl","dummy","boolean","function","baseUrl","withXsrfToken","contextHeaders","requestInterceptorChain","synchronousRequestInterceptors","interceptor","unshift","responseInterceptorChain","promise","chain","onFulfilled","onRejected","getUri","generateHTTPMethod","isForm","Axios$2","CancelToken","executor","resolvePromise","_listeners","onfulfilled","_resolve","splice","c","CancelToken$2","HttpStatusCode","Continue","SwitchingProtocols","Processing","EarlyHints","Ok","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","AlreadyReported","ImUsed","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","Unused","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","UriTooLong","UnsupportedMediaType","RangeNotSatisfiable","ExpectationFailed","ImATeapot","MisdirectedRequest","UnprocessableEntity","Locked","FailedDependency","TooEarly","UpgradeRequired","PreconditionRequired","TooManyRequests","RequestHeaderFieldsTooLarge","UnavailableForLegalReasons","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","HttpVersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","LoopDetected","NotExtended","NetworkAuthenticationRequired","WebServerIsDown","ConnectionTimedOut","OriginIsUnreachable","TimeoutOccurred","SslHandshakeFailed","InvalidSslCertificate","HttpStatusCode$2","axios","createInstance","defaultConfig","instance","VERSION","Cancel","all","promises","spread","callback","isAxiosError","payload","formToJSON","default","axios$1"],"mappings":";AASe,SAASA,EAAKC,EAAIC,GAC/B,OAAO,WACL,OAAOD,EAAGE,MAAMD,EAASE,UAC7B,CACA,CCPA,MAAMC,SAACA,GAAYC,OAAOC,WACpBC,eAACA,GAAkBF,QACnBG,SAACA,EAAQC,YAAEA,GAAeC,OAE1BC,GAAUC,EAGbP,OAAOQ,OAAO,MAHQC,IACrB,MAAMC,EAAMX,EAASY,KAAKF,GAC1B,OAAOF,EAAMG,KAASH,EAAMG,GAAOA,EAAIE,MAAM,GAAI,GAAGC,cAAc,GAFvD,IAACN,EAKhB,MAAMO,EAAcC,IAClBA,EAAOA,EAAKF,cACJJ,GAAUH,EAAOG,KAAWM,GAGhCC,EAAaD,GAAQN,UAAgBA,IAAUM,GAS/CE,QAACA,GAAWC,MASZC,EAAcH,EAAW,aAS/B,SAASI,EAASC,GAChB,OAAe,OAARA,IAAiBF,EAAYE,IAA4B,OAApBA,EAAIC,cAAyBH,EAAYE,EAAIC,cACpFC,EAAWF,EAAIC,YAAYF,WAAaC,EAAIC,YAAYF,SAASC,EACxE,CASA,MAAMG,EAAgBV,EAAW,eA2BjC,MAAMW,EAAWT,EAAW,UAQtBO,EAAaP,EAAW,YASxBU,EAAWV,EAAW,UAStBW,EAAYlB,GAAoB,OAAVA,GAAmC,iBAAVA,EAiB/CmB,EAAiBP,IACrB,GAAoB,WAAhBf,EAAOe,GACT,OAAO,EAGT,MAAMpB,EAAYC,EAAemB,GACjC,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M1W,cAGrB0W,GAAMM,IAAM,SAAaC,GACvB,OAAOjQ,QAAQgQ,IAAIC,EACrB,EAEAP,GAAMQ,OC9CS,SAAgBC,GAC7B,OAAO,SAAc1mB,GACnB,OAAO0mB,EAAS7vB,MAAM,KAAMmJ,EAChC,CACA,ED6CAimB,GAAMU,aE7DS,SAAsBC,GACnC,OAAO3jB,EAAMtK,SAASiuB,KAAsC,IAAzBA,EAAQD,YAC7C,EF8DAV,GAAMhS,YAAcA,GAEpBgS,GAAM/Z,aAAeA,GAErB+Z,GAAMY,WAAapvB,GAASuR,GAAe/F,EAAMpI,WAAWpD,GAAS,IAAIyF,SAASzF,GAASA,GAE3FwuB,GAAMlI,WAAaD,GAASC,WAE5BkI,GAAMvE,eAAiBA,GAEvBuE,GAAMa,QAAUb,GAGhB,MAAec,GAAAd,IGnFTxG,MACJA,GAAKhd,WACLA,GAAU8M,cACVA,GAAaF,SACbA,GAAQ4R,YACRA,GAAWoF,QACXA,GAAOE,IACPA,GAAGD,OACHA,GAAMK,aACNA,GAAYF,OACZA,GAAMhiB,WACNA,GAAUyH,aACVA,GAAYwV,eACZA,GAAcmF,WACdA,GAAU9I,WACVA,GAAU9J,YACVA,IACEgS"} \ No newline at end of file diff --git a/node_modules/axios/dist/node/axios.cjs b/node_modules/axios/dist/node/axios.cjs new file mode 100644 index 0000000..984a81e --- /dev/null +++ b/node_modules/axios/dist/node/axios.cjs @@ -0,0 +1,5242 @@ +/*! Axios v1.13.2 Copyright (c) 2025 Matt Zabriskie and contributors */ +'use strict'; + +const FormData$1 = require('form-data'); +const crypto = require('crypto'); +const url = require('url'); +const proxyFromEnv = require('proxy-from-env'); +const http = require('http'); +const https = require('https'); +const http2 = require('http2'); +const util = require('util'); +const followRedirects = require('follow-redirects'); +const zlib = require('zlib'); +const stream = require('stream'); +const events = require('events'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +const FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData$1); +const crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto); +const url__default = /*#__PURE__*/_interopDefaultLegacy(url); +const proxyFromEnv__default = /*#__PURE__*/_interopDefaultLegacy(proxyFromEnv); +const http__default = /*#__PURE__*/_interopDefaultLegacy(http); +const https__default = /*#__PURE__*/_interopDefaultLegacy(https); +const http2__default = /*#__PURE__*/_interopDefaultLegacy(http2); +const util__default = /*#__PURE__*/_interopDefaultLegacy(util); +const followRedirects__default = /*#__PURE__*/_interopDefaultLegacy(followRedirects); +const zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib); +const stream__default = /*#__PURE__*/_interopDefaultLegacy(stream); + +/** + * Create a bound version of a function with a specified `this` context + * + * @param {Function} fn - The function to bind + * @param {*} thisArg - The value to be passed as the `this` parameter + * @returns {Function} A new function that will call the original function with the specified `this` context + */ +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; +const {iterator, toStringTag} = Symbol; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +}; + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction$1 = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); +}; + +/** + * Determine if a value is an empty object (safely handles Buffers) + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an empty object, otherwise false + */ +const isEmptyObject = (val) => { + // Early return for non-objects or Buffers to prevent RangeError + if (!isObject(val) || isBuffer(val)) { + return false; + } + + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + // Fallback for any other objects that might cause RangeError with Object.keys() + return false; + } +}; + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction$1(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction$1(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +}; + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Buffer check + if (isBuffer(obj)) { + return; + } + + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + if (isBuffer(obj)){ + return null; + } + + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless, skipUndefined} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else if (!skipUndefined || !isUndefined(val)) { + result[targetKey] = val; + } + }; + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction$1(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +}; + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +}; + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +}; + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[iterator]; + + const _iterator = generator.call(obj); + + let result; + + while ((result = _iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +}; + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +}; + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction$1(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +}; + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + }; + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +}; + +const noop = () => {}; + +const toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; +}; + + + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + //Buffer check + if (isBuffer(source)) { + return source; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + }; + + return visit(obj, 0); +}; + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch); + +// original code +// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 + +const _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({source, data}) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + } + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})( + typeof setImmediate === 'function', + isFunction$1(_global.postMessage) +); + +const asap = typeof queueMicrotask !== 'undefined' ? + queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); + +// ********************* + + +const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]); + + +const utils$1 = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isEmptyObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction: isFunction$1, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap, + isIterable +}; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } +} + +utils$1.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils$1.toJSONObject(this.config), + code: this.code, + status: this.status + }; + } +}); + +const prototype$1 = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype$1, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype$1); + + utils$1.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + const msg = error && error.message ? error.message : 'Error'; + + // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) + const errCode = code == null && error ? error.code : code; + AxiosError.call(axiosError, msg, errCode, config, request, response); + + // Chain the original error on the standard field; non-enumerable to avoid JSON noise + if (error && axiosError.cause == null) { + Object.defineProperty(axiosError, 'cause', { value: error, configurable: true }); + } + + axiosError.name = (error && error.name) || 'Error'; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils$1.isPlainObject(thing) || utils$1.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils$1.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils$1.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (FormData__default["default"] || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils$1.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils$1.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils$1.isSpecCompliantForm(formData); + + if (!utils$1.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils$1.isDate(value)) { + return value.toISOString(); + } + + if (utils$1.isBoolean(value)) { + return value.toString(); + } + + if (!useBlob && utils$1.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils$1.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils$1.isArray(value) && isFlatArray(value)) || + ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils$1.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils$1.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils$1.forEach(value, function each(el, key) { + const result = !(utils$1.isUndefined(el) || el === null) && visitor.call( + formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils$1.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode$1(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode$1); + } : encode$1; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?(object|Function)} options + * + * @returns {string} The formatted url + */ +function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + if (utils$1.isFunction(options)) { + options = { + serialize: options + }; + } + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils$1.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils$1.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +const InterceptorManager$1 = InterceptorManager; + +const transitionalDefaults = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; + +const URLSearchParams = url__default["default"].URLSearchParams; + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz'; + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +}; + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + const randomValues = new Uint32Array(size); + crypto__default["default"].randomFillSync(randomValues); + for (let i = 0; i < size; i++) { + str += alphabet[randomValues[i] % length]; + } + + return str; +}; + + +const platform$1 = { + isNode: true, + classes: { + URLSearchParams, + FormData: FormData__default["default"], + Blob: typeof Blob !== 'undefined' && Blob || null + }, + ALPHABET, + generateString, + protocols: [ 'http', 'https', 'file', 'data' ] +}; + +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +const _navigator = typeof navigator === 'object' && navigator || undefined; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = hasBrowserEnv && + (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +const origin = hasBrowserEnv && window.location.href || 'http://localhost'; + +const utils = /*#__PURE__*/Object.freeze({ + __proto__: null, + hasBrowserEnv: hasBrowserEnv, + hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv: hasStandardBrowserEnv, + navigator: _navigator, + origin: origin +}); + +const platform = { + ...utils, + ...platform$1 +}; + +function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), { + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils$1.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + }, + ...options + }); +} + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils$1.isArray(target) ? target.length : name; + + if (isLast) { + if (utils$1.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils$1.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils$1.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) { + const obj = {}; + + utils$1.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils$1.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils$1.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http', 'fetch'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils$1.isObject(data); + + if (isObjectPayload && utils$1.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils$1.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils$1.isArrayBuffer(data) || + utils$1.isBuffer(data) || + utils$1.isStream(data) || + utils$1.isFile(data) || + utils$1.isBlob(data) || + utils$1.isReadableStream(data) + ) { + return data; + } + if (utils$1.isArrayBufferView(data)) { + return data.buffer; + } + if (utils$1.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) { + return data; + } + + if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data, this.parseReviver); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +const defaults$1 = defaults; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils$1.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +const parseHeaders = rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils$1.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils$1.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils$1.isString(value)) return; + + if (utils$1.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils$1.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils$1.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils$1.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils$1.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils$1.isObject(header) && utils$1.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils$1.isArray(entry)) { + throw TypeError('Object iterator must return a key-value pair'); + } + + obj[key = entry[0]] = (dest = obj[key]) ? + (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1]; + } + + setHeaders(obj, valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils$1.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils$1.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils$1.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils$1.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils$1.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils$1.forEach(this, (value, header) => { + const key = utils$1.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils$1.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + getSetCookie() { + return this.get("set-cookie") || []; + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils$1.freezeMethods(AxiosHeaders); + +const AxiosHeaders$1 = AxiosHeaders; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +function transformData(fns, response) { + const config = this || defaults$1; + const context = response || config; + const headers = AxiosHeaders$1.from(context.headers); + let data = context.data; + + utils$1.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} + +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils$1.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { + let isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +const VERSION = "1.13.2"; + +function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} + +const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; + +/** + * Parse data uri to a Buffer or Blob + * + * @param {String} uri + * @param {?Boolean} asBlob + * @param {?Object} options + * @param {?Function} options.Blob + * + * @returns {Buffer|Blob} + */ +function fromDataURI(uri, asBlob, options) { + const _Blob = options && options.Blob || platform.classes.Blob; + const protocol = parseProtocol(uri); + + if (asBlob === undefined && _Blob) { + asBlob = true; + } + + if (protocol === 'data') { + uri = protocol.length ? uri.slice(protocol.length + 1) : uri; + + const match = DATA_URL_PATTERN.exec(uri); + + if (!match) { + throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL); + } + + const mime = match[1]; + const isBase64 = match[2]; + const body = match[3]; + const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8'); + + if (asBlob) { + if (!_Blob) { + throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); + } + + return new _Blob([buffer], {type: mime}); + } + + return buffer; + } + + throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); +} + +const kInternals = Symbol('internals'); + +class AxiosTransformStream extends stream__default["default"].Transform{ + constructor(options) { + options = utils$1.toFlatObject(options, { + maxRate: 0, + chunkSize: 64 * 1024, + minChunkSize: 100, + timeWindow: 500, + ticksRate: 2, + samplesCount: 15 + }, null, (prop, source) => { + return !utils$1.isUndefined(source[prop]); + }); + + super({ + readableHighWaterMark: options.chunkSize + }); + + const internals = this[kInternals] = { + timeWindow: options.timeWindow, + chunkSize: options.chunkSize, + maxRate: options.maxRate, + minChunkSize: options.minChunkSize, + bytesSeen: 0, + isCaptured: false, + notifiedBytesLoaded: 0, + ts: Date.now(), + bytes: 0, + onReadCallback: null + }; + + this.on('newListener', event => { + if (event === 'progress') { + if (!internals.isCaptured) { + internals.isCaptured = true; + } + } + }); + } + + _read(size) { + const internals = this[kInternals]; + + if (internals.onReadCallback) { + internals.onReadCallback(); + } + + return super._read(size); + } + + _transform(chunk, encoding, callback) { + const internals = this[kInternals]; + const maxRate = internals.maxRate; + + const readableHighWaterMark = this.readableHighWaterMark; + + const timeWindow = internals.timeWindow; + + const divider = 1000 / timeWindow; + const bytesThreshold = (maxRate / divider); + const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; + + const pushChunk = (_chunk, _callback) => { + const bytes = Buffer.byteLength(_chunk); + internals.bytesSeen += bytes; + internals.bytes += bytes; + + internals.isCaptured && this.emit('progress', internals.bytesSeen); + + if (this.push(_chunk)) { + process.nextTick(_callback); + } else { + internals.onReadCallback = () => { + internals.onReadCallback = null; + process.nextTick(_callback); + }; + } + }; + + const transformChunk = (_chunk, _callback) => { + const chunkSize = Buffer.byteLength(_chunk); + let chunkRemainder = null; + let maxChunkSize = readableHighWaterMark; + let bytesLeft; + let passed = 0; + + if (maxRate) { + const now = Date.now(); + + if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) { + internals.ts = now; + bytesLeft = bytesThreshold - internals.bytes; + internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; + passed = 0; + } + + bytesLeft = bytesThreshold - internals.bytes; + } + + if (maxRate) { + if (bytesLeft <= 0) { + // next time window + return setTimeout(() => { + _callback(null, _chunk); + }, timeWindow - passed); + } + + if (bytesLeft < maxChunkSize) { + maxChunkSize = bytesLeft; + } + } + + if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) { + chunkRemainder = _chunk.subarray(maxChunkSize); + _chunk = _chunk.subarray(0, maxChunkSize); + } + + pushChunk(_chunk, chunkRemainder ? () => { + process.nextTick(_callback, null, chunkRemainder); + } : _callback); + }; + + transformChunk(chunk, function transformNextChunk(err, _chunk) { + if (err) { + return callback(err); + } + + if (_chunk) { + transformChunk(_chunk, transformNextChunk); + } else { + callback(null); + } + }); + } +} + +const AxiosTransformStream$1 = AxiosTransformStream; + +const {asyncIterator} = Symbol; + +const readBlob = async function* (blob) { + if (blob.stream) { + yield* blob.stream(); + } else if (blob.arrayBuffer) { + yield await blob.arrayBuffer(); + } else if (blob[asyncIterator]) { + yield* blob[asyncIterator](); + } else { + yield blob; + } +}; + +const readBlob$1 = readBlob; + +const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_'; + +const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default["default"].TextEncoder(); + +const CRLF = '\r\n'; +const CRLF_BYTES = textEncoder.encode(CRLF); +const CRLF_BYTES_COUNT = 2; + +class FormDataPart { + constructor(name, value) { + const {escapeName} = this.constructor; + const isStringValue = utils$1.isString(value); + + let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${ + !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : '' + }${CRLF}`; + + if (isStringValue) { + value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + } else { + headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; + } + + this.headers = textEncoder.encode(headers + CRLF); + + this.contentLength = isStringValue ? value.byteLength : value.size; + + this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; + + this.name = name; + this.value = value; + } + + async *encode(){ + yield this.headers; + + const {value} = this; + + if(utils$1.isTypedArray(value)) { + yield value; + } else { + yield* readBlob$1(value); + } + + yield CRLF_BYTES; + } + + static escapeName(name) { + return String(name).replace(/[\r\n"]/g, (match) => ({ + '\r' : '%0D', + '\n' : '%0A', + '"' : '%22', + }[match])); + } +} + +const formDataToStream = (form, headersHandler, options) => { + const { + tag = 'form-data-boundary', + size = 25, + boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET) + } = options || {}; + + if(!utils$1.isFormData(form)) { + throw TypeError('FormData instance required'); + } + + if (boundary.length < 1 || boundary.length > 70) { + throw Error('boundary must be 10-70 characters long') + } + + const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); + const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF); + let contentLength = footerBytes.byteLength; + + const parts = Array.from(form.entries()).map(([name, value]) => { + const part = new FormDataPart(name, value); + contentLength += part.size; + return part; + }); + + contentLength += boundaryBytes.byteLength * parts.length; + + contentLength = utils$1.toFiniteNumber(contentLength); + + const computedHeaders = { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + }; + + if (Number.isFinite(contentLength)) { + computedHeaders['Content-Length'] = contentLength; + } + + headersHandler && headersHandler(computedHeaders); + + return stream.Readable.from((async function *() { + for(const part of parts) { + yield boundaryBytes; + yield* part.encode(); + } + + yield footerBytes; + })()); +}; + +const formDataToStream$1 = formDataToStream; + +class ZlibHeaderTransformStream extends stream__default["default"].Transform { + __transform(chunk, encoding, callback) { + this.push(chunk); + callback(); + } + + _transform(chunk, encoding, callback) { + if (chunk.length !== 0) { + this._transform = this.__transform; + + // Add Default Compression headers if no zlib headers are present + if (chunk[0] !== 120) { // Hex: 78 + const header = Buffer.alloc(2); + header[0] = 120; // Hex: 78 + header[1] = 156; // Hex: 9C + this.push(header, encoding); + } + } + + this.__transform(chunk, encoding, callback); + } +} + +const ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream; + +const callbackify = (fn, reducer) => { + return utils$1.isAsyncFn(fn) ? function (...args) { + const cb = args.pop(); + fn.apply(this, args).then((value) => { + try { + reducer ? cb(null, ...reducer(value)) : cb(null, value); + } catch (err) { + cb(err); + } + }, cb); + } : fn; +}; + +const callbackify$1 = callbackify; + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1000 / freq; + let lastArgs; + let timer; + + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn(...args); + }; + + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if ( passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + + const flush = () => lastArgs && invoke(lastArgs); + + return [throttled, flush]; +} + +const progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return throttle(e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e, + lengthComputable: total != null, + [isDownloadStream ? 'download' : 'upload']: true + }; + + listener(data); + }, freq); +}; + +const progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +}; + +const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args)); + +/** + * Estimate decoded byte length of a data:// URL *without* allocating large buffers. + * - For base64: compute exact decoded size using length and padding; + * handle %XX at the character-count level (no string allocation). + * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound. + * + * @param {string} url + * @returns {number} + */ +function estimateDataURLDecodedBytes(url) { + if (!url || typeof url !== 'string') return 0; + if (!url.startsWith('data:')) return 0; + + const comma = url.indexOf(','); + if (comma < 0) return 0; + + const meta = url.slice(5, comma); + const body = url.slice(comma + 1); + const isBase64 = /;base64/i.test(meta); + + if (isBase64) { + let effectiveLen = body.length; + const len = body.length; // cache length + + for (let i = 0; i < len; i++) { + if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) { + const a = body.charCodeAt(i + 1); + const b = body.charCodeAt(i + 2); + const isHex = + ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) && + ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102)); + + if (isHex) { + effectiveLen -= 2; + i += 2; + } + } + } + + let pad = 0; + let idx = len - 1; + + const tailIsPct3D = (j) => + j >= 2 && + body.charCodeAt(j - 2) === 37 && // '%' + body.charCodeAt(j - 1) === 51 && // '3' + (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd' + + if (idx >= 0) { + if (body.charCodeAt(idx) === 61 /* '=' */) { + pad++; + idx--; + } else if (tailIsPct3D(idx)) { + pad++; + idx -= 3; + } + } + + if (pad === 1 && idx >= 0) { + if (body.charCodeAt(idx) === 61 /* '=' */) { + pad++; + } else if (tailIsPct3D(idx)) { + pad++; + } + } + + const groups = Math.floor(effectiveLen / 4); + const bytes = groups * 3 - (pad || 0); + return bytes > 0 ? bytes : 0; + } + + return Buffer.byteLength(body, 'utf8'); +} + +const zlibOptions = { + flush: zlib__default["default"].constants.Z_SYNC_FLUSH, + finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH +}; + +const brotliOptions = { + flush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib__default["default"].constants.BROTLI_OPERATION_FLUSH +}; + +const isBrotliSupported = utils$1.isFunction(zlib__default["default"].createBrotliDecompress); + +const {http: httpFollow, https: httpsFollow} = followRedirects__default["default"]; + +const isHttps = /https:?/; + +const supportedProtocols = platform.protocols.map(protocol => { + return protocol + ':'; +}); + + +const flushOnFinish = (stream, [throttled, flush]) => { + stream + .on('end', flush) + .on('error', flush); + + return throttled; +}; + +class Http2Sessions { + constructor() { + this.sessions = Object.create(null); + } + + getSession(authority, options) { + options = Object.assign({ + sessionTimeout: 1000 + }, options); + + let authoritySessions = this.sessions[authority]; + + if (authoritySessions) { + let len = authoritySessions.length; + + for (let i = 0; i < len; i++) { + const [sessionHandle, sessionOptions] = authoritySessions[i]; + if (!sessionHandle.destroyed && !sessionHandle.closed && util__default["default"].isDeepStrictEqual(sessionOptions, options)) { + return sessionHandle; + } + } + } + + const session = http2__default["default"].connect(authority, options); + + let removed; + + const removeSession = () => { + if (removed) { + return; + } + + removed = true; + + let entries = authoritySessions, len = entries.length, i = len; + + while (i--) { + if (entries[i][0] === session) { + if (len === 1) { + delete this.sessions[authority]; + } else { + entries.splice(i, 1); + } + return; + } + } + }; + + const originalRequestFn = session.request; + + const {sessionTimeout} = options; + + if(sessionTimeout != null) { + + let timer; + let streamsCount = 0; + + session.request = function () { + const stream = originalRequestFn.apply(this, arguments); + + streamsCount++; + + if (timer) { + clearTimeout(timer); + timer = null; + } + + stream.once('close', () => { + if (!--streamsCount) { + timer = setTimeout(() => { + timer = null; + removeSession(); + }, sessionTimeout); + } + }); + + return stream; + }; + } + + session.once('close', removeSession); + + let entry = [ + session, + options + ]; + + authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; + + return session; + } +} + +const http2Sessions = new Http2Sessions(); + + +/** + * If the proxy or config beforeRedirects functions are defined, call them with the options + * object. + * + * @param {Object} options - The options object that was passed to the request. + * + * @returns {Object} + */ +function dispatchBeforeRedirect(options, responseDetails) { + if (options.beforeRedirects.proxy) { + options.beforeRedirects.proxy(options); + } + if (options.beforeRedirects.config) { + options.beforeRedirects.config(options, responseDetails); + } +} + +/** + * If the proxy or config afterRedirects functions are defined, call them with the options + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} configProxy configuration from Axios options object + * @param {string} location + * + * @returns {http.ClientRequestArgs} + */ +function setProxy(options, configProxy, location) { + let proxy = configProxy; + if (!proxy && proxy !== false) { + const proxyUrl = proxyFromEnv__default["default"].getProxyForUrl(location); + if (proxyUrl) { + proxy = new URL(proxyUrl); + } + } + if (proxy) { + // Basic proxy authorization + if (proxy.username) { + proxy.auth = (proxy.username || '') + ':' + (proxy.password || ''); + } + + if (proxy.auth) { + // Support proxy auth object form + if (proxy.auth.username || proxy.auth.password) { + proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); + } + const base64 = Buffer + .from(proxy.auth, 'utf8') + .toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); + const proxyHost = proxy.hostname || proxy.host; + options.hostname = proxyHost; + // Replace 'host' since options is not a URL object + options.host = proxyHost; + options.port = proxy.port; + options.path = location; + if (proxy.protocol) { + options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`; + } + } + + options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { + // Configure proxy for redirected request, passing the original config proxy to apply + // the exact same logic as if the redirected request was performed by axios directly. + setProxy(redirectOptions, configProxy, redirectOptions.href); + }; +} + +const isHttpAdapterSupported = typeof process !== 'undefined' && utils$1.kindOf(process) === 'process'; + +// temporary hotfix + +const wrapAsync = (asyncExecutor) => { + return new Promise((resolve, reject) => { + let onDone; + let isDone; + + const done = (value, isRejected) => { + if (isDone) return; + isDone = true; + onDone && onDone(value, isRejected); + }; + + const _resolve = (value) => { + done(value); + resolve(value); + }; + + const _reject = (reason) => { + done(reason, true); + reject(reason); + }; + + asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); + }) +}; + +const resolveFamily = ({address, family}) => { + if (!utils$1.isString(address)) { + throw TypeError('address must be a string'); + } + return ({ + address, + family: family || (address.indexOf('.') < 0 ? 6 : 4) + }); +}; + +const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family}); + +const http2Transport = { + request(options, cb) { + const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80); + + const {http2Options, headers} = options; + + const session = http2Sessions.getSession(authority, http2Options); + + const { + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_STATUS + } = http2__default["default"].constants; + + const http2Headers = { + [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''), + [HTTP2_HEADER_METHOD]: options.method, + [HTTP2_HEADER_PATH]: options.path, + }; + + utils$1.forEach(headers, (header, name) => { + name.charAt(0) !== ':' && (http2Headers[name] = header); + }); + + const req = session.request(http2Headers); + + req.once('response', (responseHeaders) => { + const response = req; //duplex + + responseHeaders = Object.assign({}, responseHeaders); + + const status = responseHeaders[HTTP2_HEADER_STATUS]; + + delete responseHeaders[HTTP2_HEADER_STATUS]; + + response.headers = responseHeaders; + + response.statusCode = +status; + + cb(response); + }); + + return req; + } +}; + +/*eslint consistent-return:0*/ +const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) { + return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { + let {data, lookup, family, httpVersion = 1, http2Options} = config; + const {responseType, responseEncoding} = config; + const method = config.method.toUpperCase(); + let isDone; + let rejected = false; + let req; + + httpVersion = +httpVersion; + + if (Number.isNaN(httpVersion)) { + throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); + } + + if (httpVersion !== 1 && httpVersion !== 2) { + throw TypeError(`Unsupported protocol version '${httpVersion}'`); + } + + const isHttp2 = httpVersion === 2; + + if (lookup) { + const _lookup = callbackify$1(lookup, (value) => utils$1.isArray(value) ? value : [value]); + // hotfix to support opt.all option which is required for node 20.x + lookup = (hostname, opt, cb) => { + _lookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + + const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; + + opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); + }); + }; + } + + const abortEmitter = new events.EventEmitter(); + + function abort(reason) { + try { + abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); + } catch(err) { + console.warn('emit error', err); + } + } + + abortEmitter.once('abort', reject); + + const onFinished = () => { + if (config.cancelToken) { + config.cancelToken.unsubscribe(abort); + } + + if (config.signal) { + config.signal.removeEventListener('abort', abort); + } + + abortEmitter.removeAllListeners(); + }; + + if (config.cancelToken || config.signal) { + config.cancelToken && config.cancelToken.subscribe(abort); + if (config.signal) { + config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); + } + } + + onDone((response, isRejected) => { + isDone = true; + + if (isRejected) { + rejected = true; + onFinished(); + return; + } + + const {data} = response; + + if (data instanceof stream__default["default"].Readable || data instanceof stream__default["default"].Duplex) { + const offListeners = stream__default["default"].finished(data, () => { + offListeners(); + onFinished(); + }); + } else { + onFinished(); + } + }); + + + + + + // Parse url + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined); + const protocol = parsed.protocol || supportedProtocols[0]; + + if (protocol === 'data:') { + // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set. + if (config.maxContentLength > -1) { + // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed. + const dataUrl = String(config.url || fullPath || ''); + const estimated = estimateDataURLDecodedBytes(dataUrl); + + if (estimated > config.maxContentLength) { + return reject(new AxiosError( + 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, + config + )); + } + } + + let convertedData; + + if (method !== 'GET') { + return settle(resolve, reject, { + status: 405, + statusText: 'method not allowed', + headers: {}, + config + }); + } + + try { + convertedData = fromDataURI(config.url, responseType === 'blob', { + Blob: config.env && config.env.Blob + }); + } catch (err) { + throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); + } + + if (responseType === 'text') { + convertedData = convertedData.toString(responseEncoding); + + if (!responseEncoding || responseEncoding === 'utf8') { + convertedData = utils$1.stripBOM(convertedData); + } + } else if (responseType === 'stream') { + convertedData = stream__default["default"].Readable.from(convertedData); + } + + return settle(resolve, reject, { + data: convertedData, + status: 200, + statusText: 'OK', + headers: new AxiosHeaders$1(), + config + }); + } + + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new AxiosError( + 'Unsupported protocol ' + protocol, + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + const headers = AxiosHeaders$1.from(config.headers).normalize(); + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + // User-Agent is specified; handle case where no UA header is desired + // Only set header if it hasn't been set in config + headers.set('User-Agent', 'axios/' + VERSION, false); + + const {onUploadProgress, onDownloadProgress} = config; + const maxRate = config.maxRate; + let maxUploadRate = undefined; + let maxDownloadRate = undefined; + + // support for spec compliant FormData objects + if (utils$1.isSpecCompliantForm(data)) { + const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); + + data = formDataToStream$1(data, (formHeaders) => { + headers.set(formHeaders); + }, { + tag: `axios-${VERSION}-boundary`, + boundary: userBoundary && userBoundary[1] || undefined + }); + // support for https://www.npmjs.com/package/form-data api + } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) { + headers.set(data.getHeaders()); + + if (!headers.hasContentLength()) { + try { + const knownLength = await util__default["default"].promisify(data.getLength).call(data); + Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); + /*eslint no-empty:0*/ + } catch (e) { + } + } + } else if (utils$1.isBlob(data) || utils$1.isFile(data)) { + data.size && headers.setContentType(data.type || 'application/octet-stream'); + headers.setContentLength(data.size || 0); + data = stream__default["default"].Readable.from(readBlob$1(data)); + } else if (data && !utils$1.isStream(data)) { + if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils$1.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(new AxiosError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + // Add Content-Length header if data exists + headers.setContentLength(data.length, false); + + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new AxiosError( + 'Request body larger than maxBodyLength limit', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + } + + const contentLength = utils$1.toFiniteNumber(headers.getContentLength()); + + if (utils$1.isArray(maxRate)) { + maxUploadRate = maxRate[0]; + maxDownloadRate = maxRate[1]; + } else { + maxUploadRate = maxDownloadRate = maxRate; + } + + if (data && (onUploadProgress || maxUploadRate)) { + if (!utils$1.isStream(data)) { + data = stream__default["default"].Readable.from(data, {objectMode: false}); + } + + data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({ + maxRate: utils$1.toFiniteNumber(maxUploadRate) + })], utils$1.noop); + + onUploadProgress && data.on('progress', flushOnFinish( + data, + progressEventDecorator( + contentLength, + progressEventReducer(asyncDecorator(onUploadProgress), false, 3) + ) + )); + } + + // HTTP basic authentication + let auth = undefined; + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password || ''; + auth = username + ':' + password; + } + + if (!auth && parsed.username) { + const urlUsername = parsed.username; + const urlPassword = parsed.password; + auth = urlUsername + ':' + urlPassword; + } + + auth && headers.delete('authorization'); + + let path; + + try { + path = buildURL( + parsed.pathname + parsed.search, + config.params, + config.paramsSerializer + ).replace(/^\?/, ''); + } catch (err) { + const customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + return reject(customErr); + } + + headers.set( + 'Accept-Encoding', + 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false + ); + + const options = { + path, + method: method, + headers: headers.toJSON(), + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth, + protocol, + family, + beforeRedirect: dispatchBeforeRedirect, + beforeRedirects: {}, + http2Options + }; + + // cacheable-lookup integration hotfix + !utils$1.isUndefined(lookup) && (options.lookup = lookup); + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; + options.port = parsed.port; + setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + let transport; + const isHttpsRequest = isHttps.test(options.protocol); + options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + if (isHttp2) { + transport = http2Transport; + } else { + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsRequest ? https__default["default"] : http__default["default"]; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirects.config = config.beforeRedirect; + } + transport = isHttpsRequest ? httpsFollow : httpFollow; + } + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } else { + // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited + options.maxBodyLength = Infinity; + } + + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + + // Create the request + req = transport.request(options, function handleResponse(res) { + if (req.destroyed) return; + + const streams = [res]; + + const responseLength = utils$1.toFiniteNumber(res.headers['content-length']); + + if (onDownloadProgress || maxDownloadRate) { + const transformStream = new AxiosTransformStream$1({ + maxRate: utils$1.toFiniteNumber(maxDownloadRate) + }); + + onDownloadProgress && transformStream.on('progress', flushOnFinish( + transformStream, + progressEventDecorator( + responseLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) + ) + )); + + streams.push(transformStream); + } + + // decompress the response body transparently if required + let responseStream = res; + + // return the last request in case of redirects + const lastRequest = res.req || req; + + // if decompress disabled we should not decompress + if (config.decompress !== false && res.headers['content-encoding']) { + // if no content, but headers still say that it is encoded, + // remove the header not confuse downstream operations + if (method === 'HEAD' || res.statusCode === 204) { + delete res.headers['content-encoding']; + } + + switch ((res.headers['content-encoding'] || '').toLowerCase()) { + /*eslint default-case:0*/ + case 'gzip': + case 'x-gzip': + case 'compress': + case 'x-compress': + // add the unzipper to the body stream processing pipeline + streams.push(zlib__default["default"].createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'deflate': + streams.push(new ZlibHeaderTransformStream$1()); + + // add the unzipper to the body stream processing pipeline + streams.push(zlib__default["default"].createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'br': + if (isBrotliSupported) { + streams.push(zlib__default["default"].createBrotliDecompress(brotliOptions)); + delete res.headers['content-encoding']; + } + } + } + + responseStream = streams.length > 1 ? stream__default["default"].pipeline(streams, utils$1.noop) : streams[0]; + + + + const response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: new AxiosHeaders$1(res.headers), + config, + request: lastRequest + }; + + if (responseType === 'stream') { + response.data = responseStream; + settle(resolve, reject, response); + } else { + const responseBuffer = []; + let totalResponseBytes = 0; + + responseStream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destroy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + responseStream.destroy(); + abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + } + }); + + responseStream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + + const err = new AxiosError( + 'stream has been aborted', + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + ); + responseStream.destroy(err); + reject(err); + }); + + responseStream.on('error', function handleStreamError(err) { + if (req.destroyed) return; + reject(AxiosError.from(err, null, config, lastRequest)); + }); + + responseStream.on('end', function handleStreamEnd() { + try { + let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (responseType !== 'arraybuffer') { + responseData = responseData.toString(responseEncoding); + if (!responseEncoding || responseEncoding === 'utf8') { + responseData = utils$1.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + return reject(AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve, reject, response); + }); + } + + abortEmitter.once('abort', err => { + if (!responseStream.destroyed) { + responseStream.emit('error', err); + responseStream.destroy(); + } + }); + }); + + abortEmitter.once('abort', err => { + if (req.close) { + req.close(); + } else { + req.destroy(err); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + // @todo remove + // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; + reject(AxiosError.from(err, null, config, req)); + }); + + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + const timeout = parseInt(config.timeout, 10); + + if (Number.isNaN(timeout)) { + abort(new AxiosError( + 'error trying to parse `config.timeout` to int', + AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devouring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + if (isDone) return; + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + abort(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + req + )); + }); + } else { + // explicitly reset the socket timeout value for a possible `keep-alive` request + req.setTimeout(0); + } + + + // Send the request + if (utils$1.isStream(data)) { + let ended = false; + let errored = false; + + data.on('end', () => { + ended = true; + }); + + data.once('error', err => { + errored = true; + req.destroy(err); + }); + + data.on('close', () => { + if (!ended && !errored) { + abort(new CanceledError('Request stream has been aborted', config, req)); + } + }); + + data.pipe(req); + } else { + data && req.write(data); + req.end(); + } + }); +}; + +const isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { + url = new URL(url, platform.origin); + + return ( + origin.protocol === url.protocol && + origin.host === url.host && + (isMSIE || origin.port === url.port) + ); +})( + new URL(platform.origin), + platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) +) : () => true; + +const cookies = platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure, sameSite) { + if (typeof document === 'undefined') return; + + const cookie = [`${name}=${encodeURIComponent(value)}`]; + + if (utils$1.isNumber(expires)) { + cookie.push(`expires=${new Date(expires).toUTCString()}`); + } + if (utils$1.isString(path)) { + cookie.push(`path=${path}`); + } + if (utils$1.isString(domain)) { + cookie.push(`domain=${domain}`); + } + if (secure === true) { + cookie.push('secure'); + } + if (utils$1.isString(sameSite)) { + cookie.push(`SameSite=${sameSite}`); + } + + document.cookie = cookie.join('; '); + }, + + read(name) { + if (typeof document === 'undefined') return null; + const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); + return match ? decodeURIComponent(match[1]) : null; + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000, '/'); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + +const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, prop, caseless) { + if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) { + return utils$1.merge.call({caseless}, target, source); + } else if (utils$1.isPlainObject(source)) { + return utils$1.merge({}, source); + } else if (utils$1.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(a, b, prop, caseless); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a, prop, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils$1.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils$1.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + }; + + utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} + +const resolveConfig = (config) => { + const newConfig = mergeConfig({}, config); + + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + + newConfig.headers = headers = AxiosHeaders$1.from(headers); + + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + + // HTTP basic authentication + if (auth) { + headers.set('Authorization', 'Basic ' + + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) + ); + } + + if (utils$1.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(undefined); // browser handles it + } else if (utils$1.isFunction(data.getHeaders)) { + // Node.js FormData (like form-data package) + const formHeaders = data.getHeaders(); + // Only set safe headers to avoid overwriting security headers + const allowedHeaders = ['content-type', 'content-length']; + Object.entries(formHeaders).forEach(([key, val]) => { + if (allowedHeaders.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + } + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) { + // Add xsrf header + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); + + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + + return newConfig; +}; + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +const xhrAdapter = isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize(); + let {responseType, onUploadProgress, onDownloadProgress} = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + + function done() { + flushUpload && flushUpload(); // flush events + flushDownload && flushDownload(); // flush events + + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + + _config.signal && _config.signal.removeEventListener('abort', onCanceled); + } + + let request = new XMLHttpRequest(); + + request.open(_config.method.toUpperCase(), _config.url, true); + + // Set the request timeout in MS + request.timeout = _config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders$1.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError(event) { + // Browsers deliver a ProgressEvent in XHR onerror + // (message may be empty; when present, surface it) + // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event + const msg = event && event.message ? event.message : 'Network Error'; + const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); + // attach the underlying event for consumers who want details + err.event = event || null; + reject(err); + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils$1.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = _config.responseType; + } + + // Handle progress if needed + if (onDownloadProgress) { + ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); + request.addEventListener('progress', downloadThrottled); + } + + // Not all browsers support upload events + if (onUploadProgress && request.upload) { + ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); + + request.upload.addEventListener('progress', uploadThrottled); + + request.upload.addEventListener('loadend', flushUpload); + } + + if (_config.cancelToken || _config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(_config.url); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +}; + +const composeSignals = (signals, timeout) => { + const {length} = (signals = signals ? signals.filter(Boolean) : []); + + if (timeout || length) { + let controller = new AbortController(); + + let aborted; + + const onabort = function (reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + }; + + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)); + }, timeout); + + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach(signal => { + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); + }); + signals = null; + } + }; + + signals.forEach((signal) => signal.addEventListener('abort', onabort)); + + const {signal} = controller; + + signal.unsubscribe = () => utils$1.asap(unsubscribe); + + return signal; + } +}; + +const composeSignals$1 = composeSignals; + +const streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + + let pos = 0; + let end; + + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; + +const readBytes = async function* (iterable, chunkSize) { + for await (const chunk of readStream(iterable)) { + yield* streamChunk(chunk, chunkSize); + } +}; + +const readStream = async function* (stream) { + if (stream[Symbol.asyncIterator]) { + yield* stream; + return; + } + + const reader = stream.getReader(); + try { + for (;;) { + const {done, value} = await reader.read(); + if (done) { + break; + } + yield value; + } + } finally { + await reader.cancel(); + } +}; + +const trackStream = (stream, chunkSize, onProgress, onFinish) => { + const iterator = readBytes(stream, chunkSize); + + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + + return new ReadableStream({ + async pull(controller) { + try { + const {done, value} = await iterator.next(); + + if (done) { + _onFinish(); + controller.close(); + return; + } + + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { + highWaterMark: 2 + }) +}; + +const DEFAULT_CHUNK_SIZE = 64 * 1024; + +const {isFunction} = utils$1; + +const globalFetchAPI = (({Request, Response}) => ({ + Request, Response +}))(utils$1.global); + +const { + ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1 +} = utils$1.global; + + +const test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false + } +}; + +const factory = (env) => { + env = utils$1.merge.call({ + skipUndefined: true + }, globalFetchAPI, env); + + const {fetch: envFetch, Request, Response} = env; + const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; + const isRequestSupported = isFunction(Request); + const isResponseSupported = isFunction(Response); + + if (!isFetchSupported) { + return false; + } + + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); + + const encodeText = isFetchSupported && (typeof TextEncoder$1 === 'function' ? + ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : + async (str) => new Uint8Array(await new Request(str).arrayBuffer()) + ); + + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { + let duplexAccessed = false; + + const hasContentType = new Request(platform.origin, { + body: new ReadableStream$1(), + method: 'POST', + get duplex() { + duplexAccessed = true; + return 'half'; + }, + }).headers.has('Content-Type'); + + return duplexAccessed && !hasContentType; + }); + + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && + test(() => utils$1.isReadableStream(new Response('').body)); + + const resolvers = { + stream: supportsResponseStream && ((res) => res.body) + }; + + isFetchSupported && ((() => { + ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { + !resolvers[type] && (resolvers[type] = (res, config) => { + let method = res && res[type]; + + if (method) { + return method.call(res); + } + + throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); + }); + }); + })()); + + const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + + if (utils$1.isBlob(body)) { + return body.size; + } + + if (utils$1.isSpecCompliantForm(body)) { + const _request = new Request(platform.origin, { + method: 'POST', + body, + }); + return (await _request.arrayBuffer()).byteLength; + } + + if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) { + return body.byteLength; + } + + if (utils$1.isURLSearchParams(body)) { + body = body + ''; + } + + if (utils$1.isString(body)) { + return (await encodeText(body)).byteLength; + } + }; + + const resolveBodyLength = async (headers, body) => { + const length = utils$1.toFiniteNumber(headers.getContentLength()); + + return length == null ? getBodyLength(body) : length; + }; + + return async (config) => { + let { + url, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = 'same-origin', + fetchOptions + } = resolveConfig(config); + + let _fetch = envFetch || fetch; + + responseType = responseType ? (responseType + '').toLowerCase() : 'text'; + + let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + + let request = null; + + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + + let requestContentLength; + + try { + if ( + onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && + (requestContentLength = await resolveBodyLength(headers, data)) !== 0 + ) { + let _request = new Request(url, { + method: 'POST', + body: data, + duplex: "half" + }); + + let contentTypeHeader; + + if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { + headers.setContentType(contentTypeHeader); + } + + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + } + + if (!utils$1.isString(withCredentials)) { + withCredentials = withCredentials ? 'include' : 'omit'; + } + + // Cloudflare Workers throws when credentials are defined + // see https://github.com/cloudflare/workerd/issues/902 + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + + const resolvedOptions = { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : undefined + }; + + request = isRequestSupported && new Request(url, resolvedOptions); + + let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); + + const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); + + if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { + const options = {}; + + ['status', 'statusText', 'headers'].forEach(prop => { + options[prop] = response[prop]; + }); + + const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length')); + + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), + options + ); + } + + responseType = responseType || 'text'; + + let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config); + + !isStreamResponse && unsubscribe && unsubscribe(); + + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders$1.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }) + } catch (err) { + unsubscribe && unsubscribe(); + + if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), + { + cause: err.cause || err + } + ) + } + + throw AxiosError.from(err, err && err.code, config, request); + } + } +}; + +const seedCache = new Map(); + +const getFetch = (config) => { + let env = (config && config.env) || {}; + const {fetch, Request, Response} = env; + const seeds = [ + Request, Response, fetch + ]; + + let len = seeds.length, i = len, + seed, target, map = seedCache; + + while (i--) { + seed = seeds[i]; + target = map.get(seed); + + target === undefined && map.set(seed, target = (i ? new Map() : factory(env))); + + map = target; + } + + return target; +}; + +getFetch(); + +/** + * Known adapters mapping. + * Provides environment-specific adapters for Axios: + * - `http` for Node.js + * - `xhr` for browsers + * - `fetch` for fetch API-based requests + * + * @type {Object} + */ +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter, + fetch: { + get: getFetch, + } +}; + +// Assign adapter names for easier debugging and identification +utils$1.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', { value }); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', { value }); + } +}); + +/** + * Render a rejection reason string for unknown or unsupported adapters + * + * @param {string} reason + * @returns {string} + */ +const renderReason = (reason) => `- ${reason}`; + +/** + * Check if the adapter is resolved (function, null, or false) + * + * @param {Function|null|false} adapter + * @returns {boolean} + */ +const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false; + +/** + * Get the first suitable adapter from the provided list. + * Tries each adapter in order until a supported one is found. + * Throws an AxiosError if no adapter is suitable. + * + * @param {Array|string|Function} adapters - Adapter(s) by name or function. + * @param {Object} config - Axios request configuration + * @throws {AxiosError} If no suitable adapter is available + * @returns {Function} The resolved adapter function + */ +function getAdapter(adapters, config) { + adapters = utils$1.isArray(adapters) ? adapters : [adapters]; + + const { length } = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; +} + +/** + * Exports Axios adapters and utility to resolve an adapter + */ +const adapters = { + /** + * Resolve an adapter from a list of adapter names or functions. + * @type {Function} + */ + getAdapter, + + /** + * Exposes all known adapters + * @type {Object} + */ + adapters: knownAdapters +}; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders$1.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders$1.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders$1.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} + +const validators$1 = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators$1[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators$1.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +validators$1.spelling = function spelling(correctSpelling) { + return (value, opt) => { + // eslint-disable-next-line no-console + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + } +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} + +const validator = { + assertOptions, + validators: validators$1 +}; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager$1(), + response: new InterceptorManager$1() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy = {}; + + Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + try { + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack; + } + } catch (e) { + // ignore the case where "stack" is an un-writable property + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils$1.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.allowAbsoluteUrls + if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) { + config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + } else { + config.allowAbsoluteUrls = true; + } + + validator.assertOptions(config, { + baseUrl: validators.spelling('baseURL'), + withXsrfToken: validators.spelling('withXSRFToken') + }, true); + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils$1.merge( + headers.common, + headers[config.method] + ); + + headers && utils$1.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders$1.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift(...requestInterceptorChain); + chain.push(...responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +const Axios$1 = Axios; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + toAbortSignal() { + const controller = new AbortController(); + + const abort = (err) => { + controller.abort(err); + }; + + this.subscribe(abort); + + controller.signal.unsubscribe = () => this.unsubscribe(abort); + + return controller.signal; + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +const CancelToken$1 = CancelToken; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +function isAxiosError(payload) { + return utils$1.isObject(payload) && (payload.isAxiosError === true); +} + +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, + WebServerIsDown: 521, + ConnectionTimedOut: 522, + OriginIsUnreachable: 523, + TimeoutOccurred: 524, + SslHandshakeFailed: 525, + InvalidSslCertificate: 526, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +const HttpStatusCode$1 = HttpStatusCode; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios$1(defaultConfig); + const instance = bind(Axios$1.prototype.request, context); + + // Copy axios.prototype to instance + utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils$1.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults$1); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios$1; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken$1; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders$1; + +axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode$1; + +axios.default = axios; + +module.exports = axios; +//# sourceMappingURL=axios.cjs.map diff --git a/node_modules/axios/dist/node/axios.cjs.map b/node_modules/axios/dist/node/axios.cjs.map new file mode 100644 index 0000000..86eccb2 --- /dev/null +++ b/node_modules/axios/dist/node/axios.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"axios.cjs","sources":["../../lib/helpers/bind.js","../../lib/utils.js","../../lib/core/AxiosError.js","../../lib/helpers/toFormData.js","../../lib/helpers/AxiosURLSearchParams.js","../../lib/helpers/buildURL.js","../../lib/core/InterceptorManager.js","../../lib/defaults/transitional.js","../../lib/platform/node/classes/URLSearchParams.js","../../lib/platform/node/index.js","../../lib/platform/common/utils.js","../../lib/platform/index.js","../../lib/helpers/toURLEncodedForm.js","../../lib/helpers/formDataToJSON.js","../../lib/defaults/index.js","../../lib/helpers/parseHeaders.js","../../lib/core/AxiosHeaders.js","../../lib/core/transformData.js","../../lib/cancel/isCancel.js","../../lib/cancel/CanceledError.js","../../lib/core/settle.js","../../lib/helpers/isAbsoluteURL.js","../../lib/helpers/combineURLs.js","../../lib/core/buildFullPath.js","../../lib/env/data.js","../../lib/helpers/parseProtocol.js","../../lib/helpers/fromDataURI.js","../../lib/helpers/AxiosTransformStream.js","../../lib/helpers/readBlob.js","../../lib/helpers/formDataToStream.js","../../lib/helpers/ZlibHeaderTransformStream.js","../../lib/helpers/callbackify.js","../../lib/helpers/speedometer.js","../../lib/helpers/throttle.js","../../lib/helpers/progressEventReducer.js","../../lib/helpers/estimateDataURLDecodedBytes.js","../../lib/adapters/http.js","../../lib/helpers/isURLSameOrigin.js","../../lib/helpers/cookies.js","../../lib/core/mergeConfig.js","../../lib/helpers/resolveConfig.js","../../lib/adapters/xhr.js","../../lib/helpers/composeSignals.js","../../lib/helpers/trackStream.js","../../lib/adapters/fetch.js","../../lib/adapters/adapters.js","../../lib/core/dispatchRequest.js","../../lib/helpers/validator.js","../../lib/core/Axios.js","../../lib/cancel/CancelToken.js","../../lib/helpers/spread.js","../../lib/helpers/isAxiosError.js","../../lib/helpers/HttpStatusCode.js","../../lib/axios.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);\n}\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n if (isBuffer(obj)){\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless, skipUndefined} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\n\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n const msg = error && error.message ? error.message : 'Error';\n\n // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)\n const errCode = code == null && error ? error.code : code;\n AxiosError.call(axiosError, msg, errCode, config, request, response);\n\n // Chain the original error on the standard field; non-enumerable to avoid JSON noise\n if (error && axiosError.cause == null) {\n Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });\n }\n\n axiosError.name = (error && error.name) || 'Error';\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport url from 'url';\nexport default url.URLSearchParams;\n","import crypto from 'crypto';\nimport URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n const randomValues = new Uint32Array(size);\n crypto.randomFillSync(randomValues);\n for (let i = 0; i < size; i++) {\n str += alphabet[randomValues[i] % length];\n }\n\n return str;\n}\n\n\nexport default {\n isNode: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob: typeof Blob !== 'undefined' && Blob || null\n },\n ALPHABET,\n generateString,\n protocols: [ 'http', 'https', 'file', 'data' ]\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, this.parseReviver);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isIterable(header)) {\n let obj = {}, dest, key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw TypeError('Object iterator must return a key-value pair');\n }\n\n obj[key = entry[0]] = (dest = obj[key]) ?\n (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];\n }\n\n setHeaders(obj, valueOrRewrite)\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n getSetCookie() {\n return this.get(\"set-cookie\") || [];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","export const VERSION = \"1.13.2\";","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport parseProtocol from './parseProtocol.js';\nimport platform from '../platform/index.js';\n\nconst DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\\s\\S]*)$/;\n\n/**\n * Parse data uri to a Buffer or Blob\n *\n * @param {String} uri\n * @param {?Boolean} asBlob\n * @param {?Object} options\n * @param {?Function} options.Blob\n *\n * @returns {Buffer|Blob}\n */\nexport default function fromDataURI(uri, asBlob, options) {\n const _Blob = options && options.Blob || platform.classes.Blob;\n const protocol = parseProtocol(uri);\n\n if (asBlob === undefined && _Blob) {\n asBlob = true;\n }\n\n if (protocol === 'data') {\n uri = protocol.length ? uri.slice(protocol.length + 1) : uri;\n\n const match = DATA_URL_PATTERN.exec(uri);\n\n if (!match) {\n throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL);\n }\n\n const mime = match[1];\n const isBase64 = match[2];\n const body = match[3];\n const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');\n\n if (asBlob) {\n if (!_Blob) {\n throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);\n }\n\n return new _Blob([buffer], {type: mime});\n }\n\n return buffer;\n }\n\n throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);\n}\n","'use strict';\n\nimport stream from 'stream';\nimport utils from '../utils.js';\n\nconst kInternals = Symbol('internals');\n\nclass AxiosTransformStream extends stream.Transform{\n constructor(options) {\n options = utils.toFlatObject(options, {\n maxRate: 0,\n chunkSize: 64 * 1024,\n minChunkSize: 100,\n timeWindow: 500,\n ticksRate: 2,\n samplesCount: 15\n }, null, (prop, source) => {\n return !utils.isUndefined(source[prop]);\n });\n\n super({\n readableHighWaterMark: options.chunkSize\n });\n\n const internals = this[kInternals] = {\n timeWindow: options.timeWindow,\n chunkSize: options.chunkSize,\n maxRate: options.maxRate,\n minChunkSize: options.minChunkSize,\n bytesSeen: 0,\n isCaptured: false,\n notifiedBytesLoaded: 0,\n ts: Date.now(),\n bytes: 0,\n onReadCallback: null\n };\n\n this.on('newListener', event => {\n if (event === 'progress') {\n if (!internals.isCaptured) {\n internals.isCaptured = true;\n }\n }\n });\n }\n\n _read(size) {\n const internals = this[kInternals];\n\n if (internals.onReadCallback) {\n internals.onReadCallback();\n }\n\n return super._read(size);\n }\n\n _transform(chunk, encoding, callback) {\n const internals = this[kInternals];\n const maxRate = internals.maxRate;\n\n const readableHighWaterMark = this.readableHighWaterMark;\n\n const timeWindow = internals.timeWindow;\n\n const divider = 1000 / timeWindow;\n const bytesThreshold = (maxRate / divider);\n const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;\n\n const pushChunk = (_chunk, _callback) => {\n const bytes = Buffer.byteLength(_chunk);\n internals.bytesSeen += bytes;\n internals.bytes += bytes;\n\n internals.isCaptured && this.emit('progress', internals.bytesSeen);\n\n if (this.push(_chunk)) {\n process.nextTick(_callback);\n } else {\n internals.onReadCallback = () => {\n internals.onReadCallback = null;\n process.nextTick(_callback);\n };\n }\n }\n\n const transformChunk = (_chunk, _callback) => {\n const chunkSize = Buffer.byteLength(_chunk);\n let chunkRemainder = null;\n let maxChunkSize = readableHighWaterMark;\n let bytesLeft;\n let passed = 0;\n\n if (maxRate) {\n const now = Date.now();\n\n if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {\n internals.ts = now;\n bytesLeft = bytesThreshold - internals.bytes;\n internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;\n passed = 0;\n }\n\n bytesLeft = bytesThreshold - internals.bytes;\n }\n\n if (maxRate) {\n if (bytesLeft <= 0) {\n // next time window\n return setTimeout(() => {\n _callback(null, _chunk);\n }, timeWindow - passed);\n }\n\n if (bytesLeft < maxChunkSize) {\n maxChunkSize = bytesLeft;\n }\n }\n\n if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {\n chunkRemainder = _chunk.subarray(maxChunkSize);\n _chunk = _chunk.subarray(0, maxChunkSize);\n }\n\n pushChunk(_chunk, chunkRemainder ? () => {\n process.nextTick(_callback, null, chunkRemainder);\n } : _callback);\n };\n\n transformChunk(chunk, function transformNextChunk(err, _chunk) {\n if (err) {\n return callback(err);\n }\n\n if (_chunk) {\n transformChunk(_chunk, transformNextChunk);\n } else {\n callback(null);\n }\n });\n }\n}\n\nexport default AxiosTransformStream;\n","const {asyncIterator} = Symbol;\n\nconst readBlob = async function* (blob) {\n if (blob.stream) {\n yield* blob.stream()\n } else if (blob.arrayBuffer) {\n yield await blob.arrayBuffer()\n } else if (blob[asyncIterator]) {\n yield* blob[asyncIterator]();\n } else {\n yield blob;\n }\n}\n\nexport default readBlob;\n","import util from 'util';\nimport {Readable} from 'stream';\nimport utils from \"../utils.js\";\nimport readBlob from \"./readBlob.js\";\nimport platform from \"../platform/index.js\";\n\nconst BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_';\n\nconst textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();\n\nconst CRLF = '\\r\\n';\nconst CRLF_BYTES = textEncoder.encode(CRLF);\nconst CRLF_BYTES_COUNT = 2;\n\nclass FormDataPart {\n constructor(name, value) {\n const {escapeName} = this.constructor;\n const isStringValue = utils.isString(value);\n\n let headers = `Content-Disposition: form-data; name=\"${escapeName(name)}\"${\n !isStringValue && value.name ? `; filename=\"${escapeName(value.name)}\"` : ''\n }${CRLF}`;\n\n if (isStringValue) {\n value = textEncoder.encode(String(value).replace(/\\r?\\n|\\r\\n?/g, CRLF));\n } else {\n headers += `Content-Type: ${value.type || \"application/octet-stream\"}${CRLF}`\n }\n\n this.headers = textEncoder.encode(headers + CRLF);\n\n this.contentLength = isStringValue ? value.byteLength : value.size;\n\n this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;\n\n this.name = name;\n this.value = value;\n }\n\n async *encode(){\n yield this.headers;\n\n const {value} = this;\n\n if(utils.isTypedArray(value)) {\n yield value;\n } else {\n yield* readBlob(value);\n }\n\n yield CRLF_BYTES;\n }\n\n static escapeName(name) {\n return String(name).replace(/[\\r\\n\"]/g, (match) => ({\n '\\r' : '%0D',\n '\\n' : '%0A',\n '\"' : '%22',\n }[match]));\n }\n}\n\nconst formDataToStream = (form, headersHandler, options) => {\n const {\n tag = 'form-data-boundary',\n size = 25,\n boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)\n } = options || {};\n\n if(!utils.isFormData(form)) {\n throw TypeError('FormData instance required');\n }\n\n if (boundary.length < 1 || boundary.length > 70) {\n throw Error('boundary must be 10-70 characters long')\n }\n\n const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);\n const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);\n let contentLength = footerBytes.byteLength;\n\n const parts = Array.from(form.entries()).map(([name, value]) => {\n const part = new FormDataPart(name, value);\n contentLength += part.size;\n return part;\n });\n\n contentLength += boundaryBytes.byteLength * parts.length;\n\n contentLength = utils.toFiniteNumber(contentLength);\n\n const computedHeaders = {\n 'Content-Type': `multipart/form-data; boundary=${boundary}`\n }\n\n if (Number.isFinite(contentLength)) {\n computedHeaders['Content-Length'] = contentLength;\n }\n\n headersHandler && headersHandler(computedHeaders);\n\n return Readable.from((async function *() {\n for(const part of parts) {\n yield boundaryBytes;\n yield* part.encode();\n }\n\n yield footerBytes;\n })());\n};\n\nexport default formDataToStream;\n","\"use strict\";\n\nimport stream from \"stream\";\n\nclass ZlibHeaderTransformStream extends stream.Transform {\n __transform(chunk, encoding, callback) {\n this.push(chunk);\n callback();\n }\n\n _transform(chunk, encoding, callback) {\n if (chunk.length !== 0) {\n this._transform = this.__transform;\n\n // Add Default Compression headers if no zlib headers are present\n if (chunk[0] !== 120) { // Hex: 78\n const header = Buffer.alloc(2);\n header[0] = 120; // Hex: 78\n header[1] = 156; // Hex: 9C \n this.push(header, encoding);\n }\n }\n\n this.__transform(chunk, encoding, callback);\n }\n}\n\nexport default ZlibHeaderTransformStream;\n","import utils from \"../utils.js\";\n\nconst callbackify = (fn, reducer) => {\n return utils.isAsyncFn(fn) ? function (...args) {\n const cb = args.pop();\n fn.apply(this, args).then((value) => {\n try {\n reducer ? cb(null, ...reducer(value)) : cb(null, value);\n } catch (err) {\n cb(err);\n }\n }, cb);\n } : fn;\n}\n\nexport default callbackify;\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","/**\n * Estimate decoded byte length of a data:// URL *without* allocating large buffers.\n * - For base64: compute exact decoded size using length and padding;\n * handle %XX at the character-count level (no string allocation).\n * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.\n *\n * @param {string} url\n * @returns {number}\n */\nexport default function estimateDataURLDecodedBytes(url) {\n if (!url || typeof url !== 'string') return 0;\n if (!url.startsWith('data:')) return 0;\n\n const comma = url.indexOf(',');\n if (comma < 0) return 0;\n\n const meta = url.slice(5, comma);\n const body = url.slice(comma + 1);\n const isBase64 = /;base64/i.test(meta);\n\n if (isBase64) {\n let effectiveLen = body.length;\n const len = body.length; // cache length\n\n for (let i = 0; i < len; i++) {\n if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {\n const a = body.charCodeAt(i + 1);\n const b = body.charCodeAt(i + 2);\n const isHex =\n ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&\n ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));\n\n if (isHex) {\n effectiveLen -= 2;\n i += 2;\n }\n }\n }\n\n let pad = 0;\n let idx = len - 1;\n\n const tailIsPct3D = (j) =>\n j >= 2 &&\n body.charCodeAt(j - 2) === 37 && // '%'\n body.charCodeAt(j - 1) === 51 && // '3'\n (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'\n\n if (idx >= 0) {\n if (body.charCodeAt(idx) === 61 /* '=' */) {\n pad++;\n idx--;\n } else if (tailIsPct3D(idx)) {\n pad++;\n idx -= 3;\n }\n }\n\n if (pad === 1 && idx >= 0) {\n if (body.charCodeAt(idx) === 61 /* '=' */) {\n pad++;\n } else if (tailIsPct3D(idx)) {\n pad++;\n }\n }\n\n const groups = Math.floor(effectiveLen / 4);\n const bytes = groups * 3 - (pad || 0);\n return bytes > 0 ? bytes : 0;\n }\n\n return Buffer.byteLength(body, 'utf8');\n}\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport buildURL from './../helpers/buildURL.js';\nimport proxyFromEnv from 'proxy-from-env';\nimport http from 'http';\nimport https from 'https';\nimport http2 from 'http2';\nimport util from 'util';\nimport followRedirects from 'follow-redirects';\nimport zlib from 'zlib';\nimport {VERSION} from '../env/data.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport platform from '../platform/index.js';\nimport fromDataURI from '../helpers/fromDataURI.js';\nimport stream from 'stream';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport AxiosTransformStream from '../helpers/AxiosTransformStream.js';\nimport {EventEmitter} from 'events';\nimport formDataToStream from \"../helpers/formDataToStream.js\";\nimport readBlob from \"../helpers/readBlob.js\";\nimport ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';\nimport callbackify from \"../helpers/callbackify.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js';\n\nconst zlibOptions = {\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n};\n\nconst brotliOptions = {\n flush: zlib.constants.BROTLI_OPERATION_FLUSH,\n finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH\n}\n\nconst isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);\n\nconst {http: httpFollow, https: httpsFollow} = followRedirects;\n\nconst isHttps = /https:?/;\n\nconst supportedProtocols = platform.protocols.map(protocol => {\n return protocol + ':';\n});\n\n\nconst flushOnFinish = (stream, [throttled, flush]) => {\n stream\n .on('end', flush)\n .on('error', flush);\n\n return throttled;\n}\n\nclass Http2Sessions {\n constructor() {\n this.sessions = Object.create(null);\n }\n\n getSession(authority, options) {\n options = Object.assign({\n sessionTimeout: 1000\n }, options);\n\n let authoritySessions = this.sessions[authority];\n\n if (authoritySessions) {\n let len = authoritySessions.length;\n\n for (let i = 0; i < len; i++) {\n const [sessionHandle, sessionOptions] = authoritySessions[i];\n if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {\n return sessionHandle;\n }\n }\n }\n\n const session = http2.connect(authority, options);\n\n let removed;\n\n const removeSession = () => {\n if (removed) {\n return;\n }\n\n removed = true;\n\n let entries = authoritySessions, len = entries.length, i = len;\n\n while (i--) {\n if (entries[i][0] === session) {\n if (len === 1) {\n delete this.sessions[authority];\n } else {\n entries.splice(i, 1);\n }\n return;\n }\n }\n };\n\n const originalRequestFn = session.request;\n\n const {sessionTimeout} = options;\n\n if(sessionTimeout != null) {\n\n let timer;\n let streamsCount = 0;\n\n session.request = function () {\n const stream = originalRequestFn.apply(this, arguments);\n\n streamsCount++;\n\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n\n stream.once('close', () => {\n if (!--streamsCount) {\n timer = setTimeout(() => {\n timer = null;\n removeSession();\n }, sessionTimeout);\n }\n });\n\n return stream;\n }\n }\n\n session.once('close', removeSession);\n\n let entry = [\n session,\n options\n ];\n\n authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];\n\n return session;\n }\n}\n\nconst http2Sessions = new Http2Sessions();\n\n\n/**\n * If the proxy or config beforeRedirects functions are defined, call them with the options\n * object.\n *\n * @param {Object} options - The options object that was passed to the request.\n *\n * @returns {Object}\n */\nfunction dispatchBeforeRedirect(options, responseDetails) {\n if (options.beforeRedirects.proxy) {\n options.beforeRedirects.proxy(options);\n }\n if (options.beforeRedirects.config) {\n options.beforeRedirects.config(options, responseDetails);\n }\n}\n\n/**\n * If the proxy or config afterRedirects functions are defined, call them with the options\n *\n * @param {http.ClientRequestArgs} options\n * @param {AxiosProxyConfig} configProxy configuration from Axios options object\n * @param {string} location\n *\n * @returns {http.ClientRequestArgs}\n */\nfunction setProxy(options, configProxy, location) {\n let proxy = configProxy;\n if (!proxy && proxy !== false) {\n const proxyUrl = proxyFromEnv.getProxyForUrl(location);\n if (proxyUrl) {\n proxy = new URL(proxyUrl);\n }\n }\n if (proxy) {\n // Basic proxy authorization\n if (proxy.username) {\n proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');\n }\n\n if (proxy.auth) {\n // Support proxy auth object form\n if (proxy.auth.username || proxy.auth.password) {\n proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');\n }\n const base64 = Buffer\n .from(proxy.auth, 'utf8')\n .toString('base64');\n options.headers['Proxy-Authorization'] = 'Basic ' + base64;\n }\n\n options.headers.host = options.hostname + (options.port ? ':' + options.port : '');\n const proxyHost = proxy.hostname || proxy.host;\n options.hostname = proxyHost;\n // Replace 'host' since options is not a URL object\n options.host = proxyHost;\n options.port = proxy.port;\n options.path = location;\n if (proxy.protocol) {\n options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;\n }\n }\n\n options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {\n // Configure proxy for redirected request, passing the original config proxy to apply\n // the exact same logic as if the redirected request was performed by axios directly.\n setProxy(redirectOptions, configProxy, redirectOptions.href);\n };\n}\n\nconst isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';\n\n// temporary hotfix\n\nconst wrapAsync = (asyncExecutor) => {\n return new Promise((resolve, reject) => {\n let onDone;\n let isDone;\n\n const done = (value, isRejected) => {\n if (isDone) return;\n isDone = true;\n onDone && onDone(value, isRejected);\n }\n\n const _resolve = (value) => {\n done(value);\n resolve(value);\n };\n\n const _reject = (reason) => {\n done(reason, true);\n reject(reason);\n }\n\n asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);\n })\n};\n\nconst resolveFamily = ({address, family}) => {\n if (!utils.isString(address)) {\n throw TypeError('address must be a string');\n }\n return ({\n address,\n family: family || (address.indexOf('.') < 0 ? 6 : 4)\n });\n}\n\nconst buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});\n\nconst http2Transport = {\n request(options, cb) {\n const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80);\n\n const {http2Options, headers} = options;\n\n const session = http2Sessions.getSession(authority, http2Options);\n\n const {\n HTTP2_HEADER_SCHEME,\n HTTP2_HEADER_METHOD,\n HTTP2_HEADER_PATH,\n HTTP2_HEADER_STATUS\n } = http2.constants;\n\n const http2Headers = {\n [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),\n [HTTP2_HEADER_METHOD]: options.method,\n [HTTP2_HEADER_PATH]: options.path,\n }\n\n utils.forEach(headers, (header, name) => {\n name.charAt(0) !== ':' && (http2Headers[name] = header);\n });\n\n const req = session.request(http2Headers);\n\n req.once('response', (responseHeaders) => {\n const response = req; //duplex\n\n responseHeaders = Object.assign({}, responseHeaders);\n\n const status = responseHeaders[HTTP2_HEADER_STATUS];\n\n delete responseHeaders[HTTP2_HEADER_STATUS];\n\n response.headers = responseHeaders;\n\n response.statusCode = +status;\n\n cb(response);\n })\n\n return req;\n }\n}\n\n/*eslint consistent-return:0*/\nexport default isHttpAdapterSupported && function httpAdapter(config) {\n return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {\n let {data, lookup, family, httpVersion = 1, http2Options} = config;\n const {responseType, responseEncoding} = config;\n const method = config.method.toUpperCase();\n let isDone;\n let rejected = false;\n let req;\n\n httpVersion = +httpVersion;\n\n if (Number.isNaN(httpVersion)) {\n throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);\n }\n\n if (httpVersion !== 1 && httpVersion !== 2) {\n throw TypeError(`Unsupported protocol version '${httpVersion}'`);\n }\n\n const isHttp2 = httpVersion === 2;\n\n if (lookup) {\n const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);\n // hotfix to support opt.all option which is required for node 20.x\n lookup = (hostname, opt, cb) => {\n _lookup(hostname, opt, (err, arg0, arg1) => {\n if (err) {\n return cb(err);\n }\n\n const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];\n\n opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);\n });\n }\n }\n\n const abortEmitter = new EventEmitter();\n\n function abort(reason) {\n try {\n abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);\n } catch(err) {\n console.warn('emit error', err);\n }\n }\n\n abortEmitter.once('abort', reject);\n\n const onFinished = () => {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(abort);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', abort);\n }\n\n abortEmitter.removeAllListeners();\n }\n\n if (config.cancelToken || config.signal) {\n config.cancelToken && config.cancelToken.subscribe(abort);\n if (config.signal) {\n config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);\n }\n }\n\n onDone((response, isRejected) => {\n isDone = true;\n\n if (isRejected) {\n rejected = true;\n onFinished();\n return;\n }\n\n const {data} = response;\n\n if (data instanceof stream.Readable || data instanceof stream.Duplex) {\n const offListeners = stream.finished(data, () => {\n offListeners();\n onFinished();\n });\n } else {\n onFinished();\n }\n });\n\n\n\n\n\n // Parse url\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);\n const protocol = parsed.protocol || supportedProtocols[0];\n\n if (protocol === 'data:') {\n // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.\n if (config.maxContentLength > -1) {\n // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.\n const dataUrl = String(config.url || fullPath || '');\n const estimated = estimateDataURLDecodedBytes(dataUrl);\n\n if (estimated > config.maxContentLength) {\n return reject(new AxiosError(\n 'maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config\n ));\n }\n }\n\n let convertedData;\n\n if (method !== 'GET') {\n return settle(resolve, reject, {\n status: 405,\n statusText: 'method not allowed',\n headers: {},\n config\n });\n }\n\n try {\n convertedData = fromDataURI(config.url, responseType === 'blob', {\n Blob: config.env && config.env.Blob\n });\n } catch (err) {\n throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);\n }\n\n if (responseType === 'text') {\n convertedData = convertedData.toString(responseEncoding);\n\n if (!responseEncoding || responseEncoding === 'utf8') {\n convertedData = utils.stripBOM(convertedData);\n }\n } else if (responseType === 'stream') {\n convertedData = stream.Readable.from(convertedData);\n }\n\n return settle(resolve, reject, {\n data: convertedData,\n status: 200,\n statusText: 'OK',\n headers: new AxiosHeaders(),\n config\n });\n }\n\n if (supportedProtocols.indexOf(protocol) === -1) {\n return reject(new AxiosError(\n 'Unsupported protocol ' + protocol,\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n const headers = AxiosHeaders.from(config.headers).normalize();\n\n // Set User-Agent (required by some servers)\n // See https://github.com/axios/axios/issues/69\n // User-Agent is specified; handle case where no UA header is desired\n // Only set header if it hasn't been set in config\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const {onUploadProgress, onDownloadProgress} = config;\n const maxRate = config.maxRate;\n let maxUploadRate = undefined;\n let maxDownloadRate = undefined;\n\n // support for spec compliant FormData objects\n if (utils.isSpecCompliantForm(data)) {\n const userBoundary = headers.getContentType(/boundary=([-_\\w\\d]{10,70})/i);\n\n data = formDataToStream(data, (formHeaders) => {\n headers.set(formHeaders);\n }, {\n tag: `axios-${VERSION}-boundary`,\n boundary: userBoundary && userBoundary[1] || undefined\n });\n // support for https://www.npmjs.com/package/form-data api\n } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {\n headers.set(data.getHeaders());\n\n if (!headers.hasContentLength()) {\n try {\n const knownLength = await util.promisify(data.getLength).call(data);\n Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);\n /*eslint no-empty:0*/\n } catch (e) {\n }\n }\n } else if (utils.isBlob(data) || utils.isFile(data)) {\n data.size && headers.setContentType(data.type || 'application/octet-stream');\n headers.setContentLength(data.size || 0);\n data = stream.Readable.from(readBlob(data));\n } else if (data && !utils.isStream(data)) {\n if (Buffer.isBuffer(data)) {\n // Nothing to do...\n } else if (utils.isArrayBuffer(data)) {\n data = Buffer.from(new Uint8Array(data));\n } else if (utils.isString(data)) {\n data = Buffer.from(data, 'utf-8');\n } else {\n return reject(new AxiosError(\n 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n\n // Add Content-Length header if data exists\n headers.setContentLength(data.length, false);\n\n if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {\n return reject(new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config\n ));\n }\n }\n\n const contentLength = utils.toFiniteNumber(headers.getContentLength());\n\n if (utils.isArray(maxRate)) {\n maxUploadRate = maxRate[0];\n maxDownloadRate = maxRate[1];\n } else {\n maxUploadRate = maxDownloadRate = maxRate;\n }\n\n if (data && (onUploadProgress || maxUploadRate)) {\n if (!utils.isStream(data)) {\n data = stream.Readable.from(data, {objectMode: false});\n }\n\n data = stream.pipeline([data, new AxiosTransformStream({\n maxRate: utils.toFiniteNumber(maxUploadRate)\n })], utils.noop);\n\n onUploadProgress && data.on('progress', flushOnFinish(\n data,\n progressEventDecorator(\n contentLength,\n progressEventReducer(asyncDecorator(onUploadProgress), false, 3)\n )\n ));\n }\n\n // HTTP basic authentication\n let auth = undefined;\n if (config.auth) {\n const username = config.auth.username || '';\n const password = config.auth.password || '';\n auth = username + ':' + password;\n }\n\n if (!auth && parsed.username) {\n const urlUsername = parsed.username;\n const urlPassword = parsed.password;\n auth = urlUsername + ':' + urlPassword;\n }\n\n auth && headers.delete('authorization');\n\n let path;\n\n try {\n path = buildURL(\n parsed.pathname + parsed.search,\n config.params,\n config.paramsSerializer\n ).replace(/^\\?/, '');\n } catch (err) {\n const customErr = new Error(err.message);\n customErr.config = config;\n customErr.url = config.url;\n customErr.exists = true;\n return reject(customErr);\n }\n\n headers.set(\n 'Accept-Encoding',\n 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false\n );\n\n const options = {\n path,\n method: method,\n headers: headers.toJSON(),\n agents: { http: config.httpAgent, https: config.httpsAgent },\n auth,\n protocol,\n family,\n beforeRedirect: dispatchBeforeRedirect,\n beforeRedirects: {},\n http2Options\n };\n\n // cacheable-lookup integration hotfix\n !utils.isUndefined(lookup) && (options.lookup = lookup);\n\n if (config.socketPath) {\n options.socketPath = config.socketPath;\n } else {\n options.hostname = parsed.hostname.startsWith(\"[\") ? parsed.hostname.slice(1, -1) : parsed.hostname;\n options.port = parsed.port;\n setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);\n }\n\n let transport;\n const isHttpsRequest = isHttps.test(options.protocol);\n options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;\n\n if (isHttp2) {\n transport = http2Transport;\n } else {\n if (config.transport) {\n transport = config.transport;\n } else if (config.maxRedirects === 0) {\n transport = isHttpsRequest ? https : http;\n } else {\n if (config.maxRedirects) {\n options.maxRedirects = config.maxRedirects;\n }\n if (config.beforeRedirect) {\n options.beforeRedirects.config = config.beforeRedirect;\n }\n transport = isHttpsRequest ? httpsFollow : httpFollow;\n }\n }\n\n if (config.maxBodyLength > -1) {\n options.maxBodyLength = config.maxBodyLength;\n } else {\n // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited\n options.maxBodyLength = Infinity;\n }\n\n if (config.insecureHTTPParser) {\n options.insecureHTTPParser = config.insecureHTTPParser;\n }\n\n // Create the request\n req = transport.request(options, function handleResponse(res) {\n if (req.destroyed) return;\n\n const streams = [res];\n\n const responseLength = utils.toFiniteNumber(res.headers['content-length']);\n\n if (onDownloadProgress || maxDownloadRate) {\n const transformStream = new AxiosTransformStream({\n maxRate: utils.toFiniteNumber(maxDownloadRate)\n });\n\n onDownloadProgress && transformStream.on('progress', flushOnFinish(\n transformStream,\n progressEventDecorator(\n responseLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)\n )\n ));\n\n streams.push(transformStream);\n }\n\n // decompress the response body transparently if required\n let responseStream = res;\n\n // return the last request in case of redirects\n const lastRequest = res.req || req;\n\n // if decompress disabled we should not decompress\n if (config.decompress !== false && res.headers['content-encoding']) {\n // if no content, but headers still say that it is encoded,\n // remove the header not confuse downstream operations\n if (method === 'HEAD' || res.statusCode === 204) {\n delete res.headers['content-encoding'];\n }\n\n switch ((res.headers['content-encoding'] || '').toLowerCase()) {\n /*eslint default-case:0*/\n case 'gzip':\n case 'x-gzip':\n case 'compress':\n case 'x-compress':\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib.createUnzip(zlibOptions));\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'deflate':\n streams.push(new ZlibHeaderTransformStream());\n\n // add the unzipper to the body stream processing pipeline\n streams.push(zlib.createUnzip(zlibOptions));\n\n // remove the content-encoding in order to not confuse downstream operations\n delete res.headers['content-encoding'];\n break;\n case 'br':\n if (isBrotliSupported) {\n streams.push(zlib.createBrotliDecompress(brotliOptions));\n delete res.headers['content-encoding'];\n }\n }\n }\n\n responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0];\n\n\n\n const response = {\n status: res.statusCode,\n statusText: res.statusMessage,\n headers: new AxiosHeaders(res.headers),\n config,\n request: lastRequest\n };\n\n if (responseType === 'stream') {\n response.data = responseStream;\n settle(resolve, reject, response);\n } else {\n const responseBuffer = [];\n let totalResponseBytes = 0;\n\n responseStream.on('data', function handleStreamData(chunk) {\n responseBuffer.push(chunk);\n totalResponseBytes += chunk.length;\n\n // make sure the content length is not over the maxContentLength if specified\n if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {\n // stream.destroy() emit aborted event before calling reject() on Node.js v16\n rejected = true;\n responseStream.destroy();\n abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE, config, lastRequest));\n }\n });\n\n responseStream.on('aborted', function handlerStreamAborted() {\n if (rejected) {\n return;\n }\n\n const err = new AxiosError(\n 'stream has been aborted',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n lastRequest\n );\n responseStream.destroy(err);\n reject(err);\n });\n\n responseStream.on('error', function handleStreamError(err) {\n if (req.destroyed) return;\n reject(AxiosError.from(err, null, config, lastRequest));\n });\n\n responseStream.on('end', function handleStreamEnd() {\n try {\n let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);\n if (responseType !== 'arraybuffer') {\n responseData = responseData.toString(responseEncoding);\n if (!responseEncoding || responseEncoding === 'utf8') {\n responseData = utils.stripBOM(responseData);\n }\n }\n response.data = responseData;\n } catch (err) {\n return reject(AxiosError.from(err, null, config, response.request, response));\n }\n settle(resolve, reject, response);\n });\n }\n\n abortEmitter.once('abort', err => {\n if (!responseStream.destroyed) {\n responseStream.emit('error', err);\n responseStream.destroy();\n }\n });\n });\n\n abortEmitter.once('abort', err => {\n if (req.close) {\n req.close();\n } else {\n req.destroy(err);\n }\n });\n\n // Handle errors\n req.on('error', function handleRequestError(err) {\n // @todo remove\n // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;\n reject(AxiosError.from(err, null, config, req));\n });\n\n // set tcp keep alive to prevent drop connection by peer\n req.on('socket', function handleRequestSocket(socket) {\n // default interval of sending ack packet is 1 minute\n socket.setKeepAlive(true, 1000 * 60);\n });\n\n // Handle request timeout\n if (config.timeout) {\n // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.\n const timeout = parseInt(config.timeout, 10);\n\n if (Number.isNaN(timeout)) {\n abort(new AxiosError(\n 'error trying to parse `config.timeout` to int',\n AxiosError.ERR_BAD_OPTION_VALUE,\n config,\n req\n ));\n\n return;\n }\n\n // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.\n // And timer callback will be fired, and abort() will be invoked before connection, then get \"socket hang up\" and code ECONNRESET.\n // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.\n // And then these socket which be hang up will devouring CPU little by little.\n // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.\n req.setTimeout(timeout, function handleRequestTimeout() {\n if (isDone) return;\n let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n abort(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n req\n ));\n });\n } else {\n // explicitly reset the socket timeout value for a possible `keep-alive` request\n req.setTimeout(0);\n }\n\n\n // Send the request\n if (utils.isStream(data)) {\n let ended = false;\n let errored = false;\n\n data.on('end', () => {\n ended = true;\n });\n\n data.once('error', err => {\n errored = true;\n req.destroy(err);\n });\n\n data.on('close', () => {\n if (!ended && !errored) {\n abort(new CanceledError('Request stream has been aborted', config, req));\n }\n });\n\n data.pipe(req);\n } else {\n data && req.write(data);\n req.end();\n }\n });\n}\n\nexport const __setProxy = setProxy;\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));\n return match ? decodeURIComponent(match[1]) : null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)\n };\n\n utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // browser handles it\n } else if (utils.isFunction(data.getHeaders)) {\n // Node.js FormData (like form-data package)\n const formHeaders = data.getHeaders();\n // Only set safe headers to avoid overwriting security headers\n const allowedHeaders = ['content-type', 'content-length'];\n Object.entries(formHeaders).forEach(([key, val]) => {\n if (allowedHeaders.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n }\n } \n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n request = null;\n };\n \n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst {isFunction} = utils;\n\nconst globalFetchAPI = (({Request, Response}) => ({\n Request, Response\n}))(utils.global);\n\nconst {\n ReadableStream, TextEncoder\n} = utils.global;\n\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst factory = (env) => {\n env = utils.merge.call({\n skipUndefined: true\n }, globalFetchAPI, env);\n\n const {fetch: envFetch, Request, Response} = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Request(str).arrayBuffer())\n );\n\n const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n };\n\n isFetchSupported && ((() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n })());\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n }\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n }\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request = null;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && \"credentials\" in Request.prototype;\n\n const resolvedOptions = {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n };\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n }\n}\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const {fetch, Request, Response} = env;\n const seeds = [\n Request, Response, fetch\n ];\n\n let len = seeds.length, i = len,\n seed, target, map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, target = (i ? new Map() : factory(env)))\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n * \n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n }\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', { value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n * \n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n * \n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n * \n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters\n};\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n"],"names":["isFunction","utils","prototype","PlatformFormData","encode","url","crypto","FormData","platform","defaults","AxiosHeaders","stream","util","readBlob","Readable","zlib","followRedirects","http2","proxyFromEnv","callbackify","EventEmitter","formDataToStream","AxiosTransformStream","https","http","ZlibHeaderTransformStream","ReadableStream","TextEncoder","composeSignals","fetchAdapter.getFetch","validators","InterceptorManager","Axios","CancelToken","HttpStatusCode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AAC1C,EAAE,OAAO,SAAS,IAAI,GAAG;AACzB,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACxC,GAAG,CAAC;AACJ;;ACTA;AACA;AACA,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;AACpC,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;AAChC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC;AACvC;AACA,MAAM,MAAM,GAAG,CAAC,KAAK,IAAI,KAAK,IAAI;AAClC,IAAI,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AACxB;AACA,MAAM,UAAU,GAAG,CAAC,IAAI,KAAK;AAC7B,EAAE,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,EAAE,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK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B,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,UAAU,GAAG,UAAU,CAAC;AAC9B;AACA;AACA,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;AACnC;AACA;AACA,KAAK,CAAC,GAAG,GAAG,SAAS,GAAG,CAAC,QAAQ,EAAE;AACnC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AACtB;AACA;AACA,KAAK,CAAC,YAAY,GAAG,YAAY,CAAC;AAClC;AACA;AACA,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC;AAChC;AACA,KAAK,CAAC,YAAY,GAAGvB,cAAY,CAAC;AAClC;AACA,KAAK,CAAC,UAAU,GAAG,KAAK,IAAI,cAAc,CAACT,OAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC;AAClG;AACA,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;AACvC;AACA,KAAK,CAAC,cAAc,GAAGiC,gBAAc,CAAC;AACtC;AACA,KAAK,CAAC,OAAO,GAAG,KAAK;;;;"} \ No newline at end of file diff --git a/node_modules/axios/index.d.cts b/node_modules/axios/index.d.cts new file mode 100644 index 0000000..e3a06a3 --- /dev/null +++ b/node_modules/axios/index.d.cts @@ -0,0 +1,572 @@ +interface RawAxiosHeaders { + [key: string]: axios.AxiosHeaderValue; +} + +type MethodsHeaders = Partial<{ + [Key in axios.Method as Lowercase]: AxiosHeaders; +} & {common: AxiosHeaders}>; + +type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean); + +type AxiosHeaderParser = (this: AxiosHeaders, value: axios.AxiosHeaderValue, header: string) => any; + +type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent'| 'Content-Encoding' | 'Authorization'; + +type ContentType = axios.AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream'; + +type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding'; + +type BrowserProgressEvent = any; + +declare class AxiosHeaders { + constructor( + headers?: RawAxiosHeaders | AxiosHeaders | string + ); + + [key: string]: any; + + set(headerName?: string, value?: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; + + get(headerName: string, parser: RegExp): RegExpExecArray | null; + get(headerName: string, matcher?: true | AxiosHeaderParser): axios.AxiosHeaderValue; + + has(header: string, matcher?: AxiosHeaderMatcher): boolean; + + delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; + + clear(matcher?: AxiosHeaderMatcher): boolean; + + normalize(format: boolean): AxiosHeaders; + + concat(...targets: Array): AxiosHeaders; + + toJSON(asStrings?: boolean): RawAxiosHeaders; + + static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; + + static accessor(header: string | string[]): AxiosHeaders; + + static concat(...targets: Array): AxiosHeaders; + + setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentType(parser?: RegExp): RegExpExecArray | null; + getContentType(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasContentType(matcher?: AxiosHeaderMatcher): boolean; + + setContentLength(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentLength(parser?: RegExp): RegExpExecArray | null; + getContentLength(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasContentLength(matcher?: AxiosHeaderMatcher): boolean; + + setAccept(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAccept(parser?: RegExp): RegExpExecArray | null; + getAccept(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasAccept(matcher?: AxiosHeaderMatcher): boolean; + + setUserAgent(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getUserAgent(parser?: RegExp): RegExpExecArray | null; + getUserAgent(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; + + setContentEncoding(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentEncoding(parser?: RegExp): RegExpExecArray | null; + getContentEncoding(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; + + setAuthorization(value: axios.AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAuthorization(parser?: RegExp): RegExpExecArray | null; + getAuthorization(matcher?: AxiosHeaderMatcher): axios.AxiosHeaderValue; + hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; + + getSetCookie(): string[]; + + [Symbol.iterator](): IterableIterator<[string, axios.AxiosHeaderValue]>; +} + +declare class AxiosError extends Error { + constructor( + message?: string, + code?: string, + config?: axios.InternalAxiosRequestConfig, + request?: any, + response?: axios.AxiosResponse + ); + + config?: axios.InternalAxiosRequestConfig; + code?: string; + request?: any; + response?: axios.AxiosResponse; + isAxiosError: boolean; + status?: number; + toJSON: () => object; + cause?: unknown; + event?: BrowserProgressEvent; + static from( + error: Error | unknown, + code?: string, + config?: axios.InternalAxiosRequestConfig, + request?: any, + response?: axios.AxiosResponse, + customProps?: object, +): AxiosError; + static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; + static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; + static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION"; + static readonly ERR_NETWORK = "ERR_NETWORK"; + static readonly ERR_DEPRECATED = "ERR_DEPRECATED"; + static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; + static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; + static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; + static readonly ERR_INVALID_URL = "ERR_INVALID_URL"; + static readonly ERR_CANCELED = "ERR_CANCELED"; + static readonly ECONNABORTED = "ECONNABORTED"; + static readonly ETIMEDOUT = "ETIMEDOUT"; +} + +declare class CanceledError extends AxiosError { +} + +declare class Axios { + constructor(config?: axios.AxiosRequestConfig); + defaults: axios.AxiosDefaults; + interceptors: { + request: axios.AxiosInterceptorManager; + response: axios.AxiosInterceptorManager; + }; + getUri(config?: axios.AxiosRequestConfig): string; + request, D = any>(config: axios.AxiosRequestConfig): Promise; + get, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + delete, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + head, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + options, D = any>(url: string, config?: axios.AxiosRequestConfig): Promise; + post, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + put, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + patch, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + postForm, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + putForm, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; + patchForm, D = any>(url: string, data?: D, config?: axios.AxiosRequestConfig): Promise; +} + +declare enum HttpStatusCode { + Continue = 100, + SwitchingProtocols = 101, + Processing = 102, + EarlyHints = 103, + Ok = 200, + Created = 201, + Accepted = 202, + NonAuthoritativeInformation = 203, + NoContent = 204, + ResetContent = 205, + PartialContent = 206, + MultiStatus = 207, + AlreadyReported = 208, + ImUsed = 226, + MultipleChoices = 300, + MovedPermanently = 301, + Found = 302, + SeeOther = 303, + NotModified = 304, + UseProxy = 305, + Unused = 306, + TemporaryRedirect = 307, + PermanentRedirect = 308, + BadRequest = 400, + Unauthorized = 401, + PaymentRequired = 402, + Forbidden = 403, + NotFound = 404, + MethodNotAllowed = 405, + NotAcceptable = 406, + ProxyAuthenticationRequired = 407, + RequestTimeout = 408, + Conflict = 409, + Gone = 410, + LengthRequired = 411, + PreconditionFailed = 412, + PayloadTooLarge = 413, + UriTooLong = 414, + UnsupportedMediaType = 415, + RangeNotSatisfiable = 416, + ExpectationFailed = 417, + ImATeapot = 418, + MisdirectedRequest = 421, + UnprocessableEntity = 422, + Locked = 423, + FailedDependency = 424, + TooEarly = 425, + UpgradeRequired = 426, + PreconditionRequired = 428, + TooManyRequests = 429, + RequestHeaderFieldsTooLarge = 431, + UnavailableForLegalReasons = 451, + InternalServerError = 500, + NotImplemented = 501, + BadGateway = 502, + ServiceUnavailable = 503, + GatewayTimeout = 504, + HttpVersionNotSupported = 505, + VariantAlsoNegotiates = 506, + InsufficientStorage = 507, + LoopDetected = 508, + NotExtended = 510, + NetworkAuthenticationRequired = 511, +} + +type InternalAxiosError = AxiosError; + +declare namespace axios { + type AxiosError = InternalAxiosError; + + type RawAxiosRequestHeaders = Partial; + + type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; + + type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; + + type RawCommonResponseHeaders = { + [Key in CommonResponseHeadersList]: AxiosHeaderValue; + } & { + "set-cookie": string[]; + }; + + type RawAxiosResponseHeaders = Partial; + + type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders; + + interface AxiosRequestTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any; + } + + interface AxiosResponseTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any; + } + + interface AxiosAdapter { + (config: InternalAxiosRequestConfig): AxiosPromise; + } + + interface AxiosBasicCredentials { + username: string; + password: string; + } + + interface AxiosProxyConfig { + host: string; + port: number; + auth?: AxiosBasicCredentials; + protocol?: string; + } + + type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK'; + + type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + | 'formdata'; + + type responseEncoding = + | 'ascii' | 'ASCII' + | 'ansi' | 'ANSI' + | 'binary' | 'BINARY' + | 'base64' | 'BASE64' + | 'base64url' | 'BASE64URL' + | 'hex' | 'HEX' + | 'latin1' | 'LATIN1' + | 'ucs-2' | 'UCS-2' + | 'ucs2' | 'UCS2' + | 'utf-8' | 'UTF-8' + | 'utf8' | 'UTF8' + | 'utf16le' | 'UTF16LE'; + + interface TransitionalOptions { + silentJSONParsing?: boolean; + forcedJSONParsing?: boolean; + clarifyTimeoutError?: boolean; + } + + interface GenericAbortSignal { + readonly aborted: boolean; + onabort?: ((...args: any) => any) | null; + addEventListener?: (...args: any) => any; + removeEventListener?: (...args: any) => any; + } + + interface FormDataVisitorHelpers { + defaultVisitor: SerializerVisitor; + convertValue: (value: any) => any; + isVisitable: (value: any) => boolean; + } + + interface SerializerVisitor { + ( + this: GenericFormData, + value: any, + key: string | number, + path: null | Array, + helpers: FormDataVisitorHelpers + ): boolean; + } + + interface SerializerOptions { + visitor?: SerializerVisitor; + dots?: boolean; + metaTokens?: boolean; + indexes?: boolean | null; + } + + // tslint:disable-next-line + interface FormSerializerOptions extends SerializerOptions { + } + + interface ParamEncoder { + (value: any, defaultEncoder: (value: any) => any): any; + } + + interface CustomParamsSerializer { + (params: Record, options?: ParamsSerializerOptions): string; + } + + interface ParamsSerializerOptions extends SerializerOptions { + encode?: ParamEncoder; + serialize?: CustomParamsSerializer; + } + + type MaxUploadRate = number; + + type MaxDownloadRate = number; + + interface AxiosProgressEvent { + loaded: number; + total?: number; + progress?: number; + bytes: number; + rate?: number; + estimated?: number; + upload?: boolean; + download?: boolean; + event?: BrowserProgressEvent; + lengthComputable: boolean; + } + + type Milliseconds = number; + + type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {}); + + type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; + + type AddressFamily = 4 | 6 | undefined; + + interface LookupAddressEntry { + address: string; + family?: AddressFamily; + } + + type LookupAddress = string | LookupAddressEntry; + + interface AxiosRequestConfig { + url?: string; + method?: Method | string; + baseURL?: string; + allowAbsoluteUrls?: boolean; + transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; + transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; + headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders; + params?: any; + paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer; + data?: D; + timeout?: Milliseconds; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + responseEncoding?: responseEncoding | string; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: AxiosProgressEvent) => void; + onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + maxRate?: number | [MaxUploadRate, MaxDownloadRate]; + beforeRedirect?: (options: Record, responseDetails: {headers: Record, statusCode: HttpStatusCode}) => void; + socketPath?: string | null; + transport?: any; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions; + signal?: GenericAbortSignal; + insecureHTTPParser?: boolean; + env?: { + FormData?: new (...args: any[]) => object; + fetch?: (input: URL | Request | string, init?: RequestInit) => Promise; + Request?: new (input: URL | Request | string, init?: RequestInit) => Request; + Response?: new ( + body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null, + init?: ResponseInit + ) => Response; + }; + formSerializer?: FormSerializerOptions; + family?: AddressFamily; + lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) | + ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>); + withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); + fetchOptions?: Omit | Record; + httpVersion?: 1 | 2; + http2Options?: Record & { + sessionTimeout?: number; + }; + } + + // Alias + type RawAxiosRequestConfig = AxiosRequestConfig; + + interface InternalAxiosRequestConfig extends AxiosRequestConfig { + headers: AxiosRequestHeaders; + } + + interface HeadersDefaults { + common: RawAxiosRequestHeaders; + delete: RawAxiosRequestHeaders; + get: RawAxiosRequestHeaders; + head: RawAxiosRequestHeaders; + post: RawAxiosRequestHeaders; + put: RawAxiosRequestHeaders; + patch: RawAxiosRequestHeaders; + options?: RawAxiosRequestHeaders; + purge?: RawAxiosRequestHeaders; + link?: RawAxiosRequestHeaders; + unlink?: RawAxiosRequestHeaders; + } + + interface AxiosDefaults extends Omit, 'headers'> { + headers: HeadersDefaults; + } + + interface CreateAxiosDefaults extends Omit, 'headers'> { + headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial; + } + + interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: H & RawAxiosResponseHeaders | AxiosResponseHeaders; + config: InternalAxiosRequestConfig; + request?: any; + } + + type AxiosPromise = Promise>; + + interface CancelStatic { + new (message?: string): Cancel; + } + + interface Cancel { + message: string | undefined; + } + + interface Canceler { + (message?: string, config?: AxiosRequestConfig, request?: any): void; + } + + interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; + } + + interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; + } + + interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; + } + + interface AxiosInterceptorOptions { + synchronous?: boolean; + runWhen?: (config: InternalAxiosRequestConfig) => boolean; + } + + type AxiosRequestInterceptorUse = (onFulfilled?: ((value: T) => T | Promise) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions) => number; + + type AxiosResponseInterceptorUse = (onFulfilled?: ((value: T) => T | Promise) | null, onRejected?: ((error: any) => any) | null) => number; + + interface AxiosInterceptorManager { + use: V extends AxiosResponse ? AxiosResponseInterceptorUse : AxiosRequestInterceptorUse; + eject(id: number): void; + clear(): void; + } + + interface AxiosInstance extends Axios { + , D = any>(config: AxiosRequestConfig): Promise; + , D = any>(url: string, config?: AxiosRequestConfig): Promise; + + create(config?: CreateAxiosDefaults): AxiosInstance; + defaults: Omit & { + headers: HeadersDefaults & { + [key: string]: AxiosHeaderValue + } + }; + } + + interface GenericFormData { + append(name: string, value: any, options?: any): any; + } + + interface GenericHTMLFormElement { + name: string; + method: string; + submit(): void; + } + + interface AxiosStatic extends AxiosInstance { + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + Axios: typeof Axios; + AxiosError: typeof AxiosError; + CanceledError: typeof CanceledError; + HttpStatusCode: typeof HttpStatusCode; + readonly VERSION: string; + isCancel(value: any): value is Cancel; + all(values: Array>): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; + toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData; + formToJSON(form: GenericFormData|GenericHTMLFormElement): object; + getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; + AxiosHeaders: typeof AxiosHeaders; + mergeConfig(config1: AxiosRequestConfig, config2: AxiosRequestConfig): AxiosRequestConfig; + } +} + +declare const axios: axios.AxiosStatic; + +export = axios; diff --git a/node_modules/axios/index.d.ts b/node_modules/axios/index.d.ts new file mode 100644 index 0000000..a97882a --- /dev/null +++ b/node_modules/axios/index.d.ts @@ -0,0 +1,585 @@ +// TypeScript Version: 4.7 +export type AxiosHeaderValue = AxiosHeaders | string | string[] | number | boolean | null; + +interface RawAxiosHeaders { + [key: string]: AxiosHeaderValue; +} + +type MethodsHeaders = Partial<{ + [Key in Method as Lowercase]: AxiosHeaders; +} & {common: AxiosHeaders}>; + +type AxiosHeaderMatcher = string | RegExp | ((this: AxiosHeaders, value: string, name: string) => boolean); + +type AxiosHeaderParser = (this: AxiosHeaders, value: AxiosHeaderValue, header: string) => any; + +export class AxiosHeaders { + constructor( + headers?: RawAxiosHeaders | AxiosHeaders | string + ); + + [key: string]: any; + + set(headerName?: string, value?: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + set(headers?: RawAxiosHeaders | AxiosHeaders | string, rewrite?: boolean): AxiosHeaders; + + get(headerName: string, parser: RegExp): RegExpExecArray | null; + get(headerName: string, matcher?: true | AxiosHeaderParser): AxiosHeaderValue; + + has(header: string, matcher?: AxiosHeaderMatcher): boolean; + + delete(header: string | string[], matcher?: AxiosHeaderMatcher): boolean; + + clear(matcher?: AxiosHeaderMatcher): boolean; + + normalize(format: boolean): AxiosHeaders; + + concat(...targets: Array): AxiosHeaders; + + toJSON(asStrings?: boolean): RawAxiosHeaders; + + static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders; + + static accessor(header: string | string[]): AxiosHeaders; + + static concat(...targets: Array): AxiosHeaders; + + setContentType(value: ContentType, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentType(parser?: RegExp): RegExpExecArray | null; + getContentType(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasContentType(matcher?: AxiosHeaderMatcher): boolean; + + setContentLength(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentLength(parser?: RegExp): RegExpExecArray | null; + getContentLength(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasContentLength(matcher?: AxiosHeaderMatcher): boolean; + + setAccept(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAccept(parser?: RegExp): RegExpExecArray | null; + getAccept(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasAccept(matcher?: AxiosHeaderMatcher): boolean; + + setUserAgent(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getUserAgent(parser?: RegExp): RegExpExecArray | null; + getUserAgent(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasUserAgent(matcher?: AxiosHeaderMatcher): boolean; + + setContentEncoding(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getContentEncoding(parser?: RegExp): RegExpExecArray | null; + getContentEncoding(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasContentEncoding(matcher?: AxiosHeaderMatcher): boolean; + + setAuthorization(value: AxiosHeaderValue, rewrite?: boolean | AxiosHeaderMatcher): AxiosHeaders; + getAuthorization(parser?: RegExp): RegExpExecArray | null; + getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; + hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; + + getSetCookie(): string[]; + + [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>; +} + +type CommonRequestHeadersList = 'Accept' | 'Content-Length' | 'User-Agent' | 'Content-Encoding' | 'Authorization'; + +type ContentType = AxiosHeaderValue | 'text/html' | 'text/plain' | 'multipart/form-data' | 'application/json' | 'application/x-www-form-urlencoded' | 'application/octet-stream'; + +export type RawAxiosRequestHeaders = Partial; + +export type AxiosRequestHeaders = RawAxiosRequestHeaders & AxiosHeaders; + +type CommonResponseHeadersList = 'Server' | 'Content-Type' | 'Content-Length' | 'Cache-Control'| 'Content-Encoding'; + +type RawCommonResponseHeaders = { + [Key in CommonResponseHeadersList]: AxiosHeaderValue; +} & { + "set-cookie": string[]; +}; + +export type RawAxiosResponseHeaders = Partial; + +export type AxiosResponseHeaders = RawAxiosResponseHeaders & AxiosHeaders; + +export interface AxiosRequestTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosRequestHeaders): any; +} + +export interface AxiosResponseTransformer { + (this: InternalAxiosRequestConfig, data: any, headers: AxiosResponseHeaders, status?: number): any; +} + +export interface AxiosAdapter { + (config: InternalAxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: AxiosBasicCredentials; + protocol?: string; +} + +export enum HttpStatusCode { + Continue = 100, + SwitchingProtocols = 101, + Processing = 102, + EarlyHints = 103, + Ok = 200, + Created = 201, + Accepted = 202, + NonAuthoritativeInformation = 203, + NoContent = 204, + ResetContent = 205, + PartialContent = 206, + MultiStatus = 207, + AlreadyReported = 208, + ImUsed = 226, + MultipleChoices = 300, + MovedPermanently = 301, + Found = 302, + SeeOther = 303, + NotModified = 304, + UseProxy = 305, + Unused = 306, + TemporaryRedirect = 307, + PermanentRedirect = 308, + BadRequest = 400, + Unauthorized = 401, + PaymentRequired = 402, + Forbidden = 403, + NotFound = 404, + MethodNotAllowed = 405, + NotAcceptable = 406, + ProxyAuthenticationRequired = 407, + RequestTimeout = 408, + Conflict = 409, + Gone = 410, + LengthRequired = 411, + PreconditionFailed = 412, + PayloadTooLarge = 413, + UriTooLong = 414, + UnsupportedMediaType = 415, + RangeNotSatisfiable = 416, + ExpectationFailed = 417, + ImATeapot = 418, + MisdirectedRequest = 421, + UnprocessableEntity = 422, + Locked = 423, + FailedDependency = 424, + TooEarly = 425, + UpgradeRequired = 426, + PreconditionRequired = 428, + TooManyRequests = 429, + RequestHeaderFieldsTooLarge = 431, + UnavailableForLegalReasons = 451, + InternalServerError = 500, + NotImplemented = 501, + BadGateway = 502, + ServiceUnavailable = 503, + GatewayTimeout = 504, + HttpVersionNotSupported = 505, + VariantAlsoNegotiates = 506, + InsufficientStorage = 507, + LoopDetected = 508, + NotExtended = 510, + NetworkAuthenticationRequired = 511, +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK'; + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + | 'formdata'; + +export type responseEncoding = + | 'ascii' | 'ASCII' + | 'ansi' | 'ANSI' + | 'binary' | 'BINARY' + | 'base64' | 'BASE64' + | 'base64url' | 'BASE64URL' + | 'hex' | 'HEX' + | 'latin1' | 'LATIN1' + | 'ucs-2' | 'UCS-2' + | 'ucs2' | 'UCS2' + | 'utf-8' | 'UTF-8' + | 'utf8' | 'UTF8' + | 'utf16le' | 'UTF16LE'; + +export interface TransitionalOptions { + silentJSONParsing?: boolean; + forcedJSONParsing?: boolean; + clarifyTimeoutError?: boolean; +} + +export interface GenericAbortSignal { + readonly aborted: boolean; + onabort?: ((...args: any) => any) | null; + addEventListener?: (...args: any) => any; + removeEventListener?: (...args: any) => any; +} + +export interface FormDataVisitorHelpers { + defaultVisitor: SerializerVisitor; + convertValue: (value: any) => any; + isVisitable: (value: any) => boolean; +} + +export interface SerializerVisitor { + ( + this: GenericFormData, + value: any, + key: string | number, + path: null | Array, + helpers: FormDataVisitorHelpers + ): boolean; +} + +export interface SerializerOptions { + visitor?: SerializerVisitor; + dots?: boolean; + metaTokens?: boolean; + indexes?: boolean | null; +} + +// tslint:disable-next-line +export interface FormSerializerOptions extends SerializerOptions { +} + +export interface ParamEncoder { + (value: any, defaultEncoder: (value: any) => any): any; +} + +export interface CustomParamsSerializer { + (params: Record, options?: ParamsSerializerOptions): string; +} + +export interface ParamsSerializerOptions extends SerializerOptions { + encode?: ParamEncoder; + serialize?: CustomParamsSerializer; +} + +type MaxUploadRate = number; + +type MaxDownloadRate = number; + +type BrowserProgressEvent = any; + +export interface AxiosProgressEvent { + loaded: number; + total?: number; + progress?: number; + bytes: number; + rate?: number; + estimated?: number; + upload?: boolean; + download?: boolean; + event?: BrowserProgressEvent; + lengthComputable: boolean; +} + +type Milliseconds = number; + +type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {}); + +type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; + +export type AddressFamily = 4 | 6 | undefined; + +export interface LookupAddressEntry { + address: string; + family?: AddressFamily; +} + +export type LookupAddress = string | LookupAddressEntry; + +export interface AxiosRequestConfig { + url?: string; + method?: Method | string; + baseURL?: string; + allowAbsoluteUrls?: boolean; + transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; + transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; + headers?: (RawAxiosRequestHeaders & MethodsHeaders) | AxiosHeaders; + params?: any; + paramsSerializer?: ParamsSerializerOptions | CustomParamsSerializer; + data?: D; + timeout?: Milliseconds; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapterConfig | AxiosAdapterConfig[]; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + responseEncoding?: responseEncoding | string; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: AxiosProgressEvent) => void; + onDownloadProgress?: (progressEvent: AxiosProgressEvent) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + maxRate?: number | [MaxUploadRate, MaxDownloadRate]; + beforeRedirect?: (options: Record, responseDetails: {headers: Record, statusCode: HttpStatusCode}) => void; + socketPath?: string | null; + transport?: any; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions; + signal?: GenericAbortSignal; + insecureHTTPParser?: boolean; + env?: { + FormData?: new (...args: any[]) => object; + fetch?: (input: URL | Request | string, init?: RequestInit) => Promise; + Request?: new (input: URL | Request | string, init?: RequestInit) => Request; + Response?: new ( + body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null, + init?: ResponseInit + ) => Response; + }; + formSerializer?: FormSerializerOptions; + family?: AddressFamily; + lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) | + ((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>); + withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined); + parseReviver?: (this: any, key: string, value: any) => any; + fetchOptions?: Omit | Record; + httpVersion?: 1 | 2; + http2Options?: Record & { + sessionTimeout?: number; + }; +} + +// Alias +export type RawAxiosRequestConfig = AxiosRequestConfig; + +export interface InternalAxiosRequestConfig extends AxiosRequestConfig { + headers: AxiosRequestHeaders; +} + +export interface HeadersDefaults { + common: RawAxiosRequestHeaders; + delete: RawAxiosRequestHeaders; + get: RawAxiosRequestHeaders; + head: RawAxiosRequestHeaders; + post: RawAxiosRequestHeaders; + put: RawAxiosRequestHeaders; + patch: RawAxiosRequestHeaders; + options?: RawAxiosRequestHeaders; + purge?: RawAxiosRequestHeaders; + link?: RawAxiosRequestHeaders; + unlink?: RawAxiosRequestHeaders; +} + +export interface AxiosDefaults extends Omit, 'headers'> { + headers: HeadersDefaults; +} + +export interface CreateAxiosDefaults extends Omit, 'headers'> { + headers?: RawAxiosRequestHeaders | AxiosHeaders | Partial; +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: H & RawAxiosResponseHeaders | AxiosResponseHeaders; + config: InternalAxiosRequestConfig; + request?: any; +} + +export class AxiosError extends Error { + constructor( + message?: string, + code?: string, + config?: InternalAxiosRequestConfig, + request?: any, + response?: AxiosResponse + ); + + config?: InternalAxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + status?: number; + toJSON: () => object; + cause?: unknown; + event?: BrowserProgressEvent; + static from( + error: Error | unknown, + code?: string, + config?: InternalAxiosRequestConfig, + request?: any, + response?: AxiosResponse, + customProps?: object, +): AxiosError; + static readonly ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; + static readonly ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; + static readonly ERR_BAD_OPTION = "ERR_BAD_OPTION"; + static readonly ERR_NETWORK = "ERR_NETWORK"; + static readonly ERR_DEPRECATED = "ERR_DEPRECATED"; + static readonly ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; + static readonly ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; + static readonly ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; + static readonly ERR_INVALID_URL = "ERR_INVALID_URL"; + static readonly ERR_CANCELED = "ERR_CANCELED"; + static readonly ECONNABORTED = "ECONNABORTED"; + static readonly ETIMEDOUT = "ETIMEDOUT"; +} + +export class CanceledError extends AxiosError { + readonly name: "CanceledError"; +} + +export type AxiosPromise = Promise>; + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string | undefined; +} + +export interface Canceler { + (message?: string, config?: AxiosRequestConfig, request?: any): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorOptions { + synchronous?: boolean; + runWhen?: (config: InternalAxiosRequestConfig) => boolean; +} + +type AxiosRequestInterceptorUse = (onFulfilled?: ((value: T) => T | Promise) | null, onRejected?: ((error: any) => any) | null, options?: AxiosInterceptorOptions) => number; + +type AxiosResponseInterceptorUse = (onFulfilled?: ((value: T) => T | Promise) | null, onRejected?: ((error: any) => any) | null) => number; + +export interface AxiosInterceptorManager { + use: V extends AxiosResponse ? AxiosResponseInterceptorUse : AxiosRequestInterceptorUse; + eject(id: number): void; + clear(): void; +} + +export class Axios { + constructor(config?: AxiosRequestConfig); + defaults: AxiosDefaults; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request, D = any>(config: AxiosRequestConfig): Promise; + get, D = any>(url: string, config?: AxiosRequestConfig): Promise; + delete, D = any>(url: string, config?: AxiosRequestConfig): Promise; + head, D = any>(url: string, config?: AxiosRequestConfig): Promise; + options, D = any>(url: string, config?: AxiosRequestConfig): Promise; + post, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + put, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + patch, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + postForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + putForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + patchForm, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosInstance extends Axios { + , D = any>(config: AxiosRequestConfig): Promise; + , D = any>(url: string, config?: AxiosRequestConfig): Promise; + + create(config?: CreateAxiosDefaults): AxiosInstance; + defaults: Omit & { + headers: HeadersDefaults & { + [key: string]: AxiosHeaderValue + } + }; +} + +export interface GenericFormData { + append(name: string, value: any, options?: any): any; +} + +export interface GenericHTMLFormElement { + name: string; + method: string; + submit(): void; +} + +export function getAdapter(adapters: AxiosAdapterConfig | AxiosAdapterConfig[] | undefined): AxiosAdapter; + +export function toFormData(sourceObj: object, targetFormData?: GenericFormData, options?: FormSerializerOptions): GenericFormData; + +export function formToJSON(form: GenericFormData|GenericHTMLFormElement): object; + +export function isAxiosError(payload: any): payload is AxiosError; + +export function spread(callback: (...args: T[]) => R): (array: T[]) => R; + +export function isCancel(value: any): value is CanceledError; + +export function all(values: Array>): Promise; + +export function mergeConfig(config1: AxiosRequestConfig, config2: AxiosRequestConfig): AxiosRequestConfig; + +export interface AxiosStatic extends AxiosInstance { + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + Axios: typeof Axios; + AxiosError: typeof AxiosError; + HttpStatusCode: typeof HttpStatusCode; + readonly VERSION: string; + isCancel: typeof isCancel; + all: typeof all; + spread: typeof spread; + isAxiosError: typeof isAxiosError; + toFormData: typeof toFormData; + formToJSON: typeof formToJSON; + getAdapter: typeof getAdapter; + CanceledError: typeof CanceledError; + AxiosHeaders: typeof AxiosHeaders; + mergeConfig: typeof mergeConfig; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/axios/index.js b/node_modules/axios/index.js new file mode 100644 index 0000000..fba3990 --- /dev/null +++ b/node_modules/axios/index.js @@ -0,0 +1,43 @@ +import axios from './lib/axios.js'; + +// This module is intended to unwrap Axios default export as named. +// Keep top-level export same with static properties +// so that it can keep same with es module or cjs +const { + Axios, + AxiosError, + CanceledError, + isCancel, + CancelToken, + VERSION, + all, + Cancel, + isAxiosError, + spread, + toFormData, + AxiosHeaders, + HttpStatusCode, + formToJSON, + getAdapter, + mergeConfig +} = axios; + +export { + axios as default, + Axios, + AxiosError, + CanceledError, + isCancel, + CancelToken, + VERSION, + all, + Cancel, + isAxiosError, + spread, + toFormData, + AxiosHeaders, + HttpStatusCode, + formToJSON, + getAdapter, + mergeConfig +} diff --git a/node_modules/axios/lib/adapters/README.md b/node_modules/axios/lib/adapters/README.md new file mode 100644 index 0000000..68f1118 --- /dev/null +++ b/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/axios/lib/adapters/adapters.js b/node_modules/axios/lib/adapters/adapters.js new file mode 100644 index 0000000..2e117db --- /dev/null +++ b/node_modules/axios/lib/adapters/adapters.js @@ -0,0 +1,126 @@ +import utils from '../utils.js'; +import httpAdapter from './http.js'; +import xhrAdapter from './xhr.js'; +import * as fetchAdapter from './fetch.js'; +import AxiosError from "../core/AxiosError.js"; + +/** + * Known adapters mapping. + * Provides environment-specific adapters for Axios: + * - `http` for Node.js + * - `xhr` for browsers + * - `fetch` for fetch API-based requests + * + * @type {Object} + */ +const knownAdapters = { + http: httpAdapter, + xhr: xhrAdapter, + fetch: { + get: fetchAdapter.getFetch, + } +}; + +// Assign adapter names for easier debugging and identification +utils.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, 'name', { value }); + } catch (e) { + // eslint-disable-next-line no-empty + } + Object.defineProperty(fn, 'adapterName', { value }); + } +}); + +/** + * Render a rejection reason string for unknown or unsupported adapters + * + * @param {string} reason + * @returns {string} + */ +const renderReason = (reason) => `- ${reason}`; + +/** + * Check if the adapter is resolved (function, null, or false) + * + * @param {Function|null|false} adapter + * @returns {boolean} + */ +const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false; + +/** + * Get the first suitable adapter from the provided list. + * Tries each adapter in order until a supported one is found. + * Throws an AxiosError if no adapter is suitable. + * + * @param {Array|string|Function} adapters - Adapter(s) by name or function. + * @param {Object} config - Axios request configuration + * @throws {AxiosError} If no suitable adapter is available + * @returns {Function} The resolved adapter function + */ +function getAdapter(adapters, config) { + adapters = utils.isArray(adapters) ? adapters : [adapters]; + + const { length } = adapters; + let nameOrAdapter; + let adapter; + + const rejectedReasons = {}; + + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + + adapter = nameOrAdapter; + + if (!isResolvedHandle(nameOrAdapter)) { + adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + + if (adapter === undefined) { + throw new AxiosError(`Unknown adapter '${id}'`); + } + } + + if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) { + break; + } + + rejectedReasons[id || '#' + i] = adapter; + } + + if (!adapter) { + const reasons = Object.entries(rejectedReasons) + .map(([id, state]) => `adapter ${id} ` + + (state === false ? 'is not supported by the environment' : 'is not available in the build') + ); + + let s = length ? + (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : + 'as no adapter specified'; + + throw new AxiosError( + `There is no suitable adapter to dispatch the request ` + s, + 'ERR_NOT_SUPPORT' + ); + } + + return adapter; +} + +/** + * Exports Axios adapters and utility to resolve an adapter + */ +export default { + /** + * Resolve an adapter from a list of adapter names or functions. + * @type {Function} + */ + getAdapter, + + /** + * Exposes all known adapters + * @type {Object} + */ + adapters: knownAdapters +}; diff --git a/node_modules/axios/lib/adapters/fetch.js b/node_modules/axios/lib/adapters/fetch.js new file mode 100644 index 0000000..e2e90f6 --- /dev/null +++ b/node_modules/axios/lib/adapters/fetch.js @@ -0,0 +1,288 @@ +import platform from "../platform/index.js"; +import utils from "../utils.js"; +import AxiosError from "../core/AxiosError.js"; +import composeSignals from "../helpers/composeSignals.js"; +import {trackStream} from "../helpers/trackStream.js"; +import AxiosHeaders from "../core/AxiosHeaders.js"; +import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js"; +import resolveConfig from "../helpers/resolveConfig.js"; +import settle from "../core/settle.js"; + +const DEFAULT_CHUNK_SIZE = 64 * 1024; + +const {isFunction} = utils; + +const globalFetchAPI = (({Request, Response}) => ({ + Request, Response +}))(utils.global); + +const { + ReadableStream, TextEncoder +} = utils.global; + + +const test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false + } +} + +const factory = (env) => { + env = utils.merge.call({ + skipUndefined: true + }, globalFetchAPI, env); + + const {fetch: envFetch, Request, Response} = env; + const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function'; + const isRequestSupported = isFunction(Request); + const isResponseSupported = isFunction(Response); + + if (!isFetchSupported) { + return false; + } + + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); + + const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ? + ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : + async (str) => new Uint8Array(await new Request(str).arrayBuffer()) + ); + + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { + let duplexAccessed = false; + + const hasContentType = new Request(platform.origin, { + body: new ReadableStream(), + method: 'POST', + get duplex() { + duplexAccessed = true; + return 'half'; + }, + }).headers.has('Content-Type'); + + return duplexAccessed && !hasContentType; + }); + + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && + test(() => utils.isReadableStream(new Response('').body)); + + const resolvers = { + stream: supportsResponseStream && ((res) => res.body) + }; + + isFetchSupported && ((() => { + ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => { + !resolvers[type] && (resolvers[type] = (res, config) => { + let method = res && res[type]; + + if (method) { + return method.call(res); + } + + throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config); + }) + }); + })()); + + const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + + if (utils.isBlob(body)) { + return body.size; + } + + if (utils.isSpecCompliantForm(body)) { + const _request = new Request(platform.origin, { + method: 'POST', + body, + }); + return (await _request.arrayBuffer()).byteLength; + } + + if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) { + return body.byteLength; + } + + if (utils.isURLSearchParams(body)) { + body = body + ''; + } + + if (utils.isString(body)) { + return (await encodeText(body)).byteLength; + } + } + + const resolveBodyLength = async (headers, body) => { + const length = utils.toFiniteNumber(headers.getContentLength()); + + return length == null ? getBodyLength(body) : length; + } + + return async (config) => { + let { + url, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = 'same-origin', + fetchOptions + } = resolveConfig(config); + + let _fetch = envFetch || fetch; + + responseType = responseType ? (responseType + '').toLowerCase() : 'text'; + + let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); + + let request = null; + + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + + let requestContentLength; + + try { + if ( + onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' && + (requestContentLength = await resolveBodyLength(headers, data)) !== 0 + ) { + let _request = new Request(url, { + method: 'POST', + body: data, + duplex: "half" + }); + + let contentTypeHeader; + + if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) { + headers.setContentType(contentTypeHeader) + } + + if (_request.body) { + const [onProgress, flush] = progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ); + + data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush); + } + } + + if (!utils.isString(withCredentials)) { + withCredentials = withCredentials ? 'include' : 'omit'; + } + + // Cloudflare Workers throws when credentials are defined + // see https://github.com/cloudflare/workerd/issues/902 + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + + const resolvedOptions = { + ...fetchOptions, + signal: composedSignal, + method: method.toUpperCase(), + headers: headers.normalize().toJSON(), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : undefined + }; + + request = isRequestSupported && new Request(url, resolvedOptions); + + let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions)); + + const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response'); + + if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) { + const options = {}; + + ['status', 'statusText', 'headers'].forEach(prop => { + options[prop] = response[prop]; + }); + + const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length')); + + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), + options + ); + } + + responseType = responseType || 'text'; + + let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config); + + !isStreamResponse && unsubscribe && unsubscribe(); + + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }) + }) + } catch (err) { + unsubscribe && unsubscribe(); + + if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) { + throw Object.assign( + new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), + { + cause: err.cause || err + } + ) + } + + throw AxiosError.from(err, err && err.code, config, request); + } + } +} + +const seedCache = new Map(); + +export const getFetch = (config) => { + let env = (config && config.env) || {}; + const {fetch, Request, Response} = env; + const seeds = [ + Request, Response, fetch + ]; + + let len = seeds.length, i = len, + seed, target, map = seedCache; + + while (i--) { + seed = seeds[i]; + target = map.get(seed); + + target === undefined && map.set(seed, target = (i ? new Map() : factory(env))) + + map = target; + } + + return target; +}; + +const adapter = getFetch(); + +export default adapter; diff --git a/node_modules/axios/lib/adapters/http.js b/node_modules/axios/lib/adapters/http.js new file mode 100644 index 0000000..ccc89be --- /dev/null +++ b/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,895 @@ +import utils from './../utils.js'; +import settle from './../core/settle.js'; +import buildFullPath from '../core/buildFullPath.js'; +import buildURL from './../helpers/buildURL.js'; +import proxyFromEnv from 'proxy-from-env'; +import http from 'http'; +import https from 'https'; +import http2 from 'http2'; +import util from 'util'; +import followRedirects from 'follow-redirects'; +import zlib from 'zlib'; +import {VERSION} from '../env/data.js'; +import transitionalDefaults from '../defaults/transitional.js'; +import AxiosError from '../core/AxiosError.js'; +import CanceledError from '../cancel/CanceledError.js'; +import platform from '../platform/index.js'; +import fromDataURI from '../helpers/fromDataURI.js'; +import stream from 'stream'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import AxiosTransformStream from '../helpers/AxiosTransformStream.js'; +import {EventEmitter} from 'events'; +import formDataToStream from "../helpers/formDataToStream.js"; +import readBlob from "../helpers/readBlob.js"; +import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js'; +import callbackify from "../helpers/callbackify.js"; +import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js"; +import estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js'; + +const zlibOptions = { + flush: zlib.constants.Z_SYNC_FLUSH, + finishFlush: zlib.constants.Z_SYNC_FLUSH +}; + +const brotliOptions = { + flush: zlib.constants.BROTLI_OPERATION_FLUSH, + finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH +} + +const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress); + +const {http: httpFollow, https: httpsFollow} = followRedirects; + +const isHttps = /https:?/; + +const supportedProtocols = platform.protocols.map(protocol => { + return protocol + ':'; +}); + + +const flushOnFinish = (stream, [throttled, flush]) => { + stream + .on('end', flush) + .on('error', flush); + + return throttled; +} + +class Http2Sessions { + constructor() { + this.sessions = Object.create(null); + } + + getSession(authority, options) { + options = Object.assign({ + sessionTimeout: 1000 + }, options); + + let authoritySessions = this.sessions[authority]; + + if (authoritySessions) { + let len = authoritySessions.length; + + for (let i = 0; i < len; i++) { + const [sessionHandle, sessionOptions] = authoritySessions[i]; + if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) { + return sessionHandle; + } + } + } + + const session = http2.connect(authority, options); + + let removed; + + const removeSession = () => { + if (removed) { + return; + } + + removed = true; + + let entries = authoritySessions, len = entries.length, i = len; + + while (i--) { + if (entries[i][0] === session) { + if (len === 1) { + delete this.sessions[authority]; + } else { + entries.splice(i, 1); + } + return; + } + } + }; + + const originalRequestFn = session.request; + + const {sessionTimeout} = options; + + if(sessionTimeout != null) { + + let timer; + let streamsCount = 0; + + session.request = function () { + const stream = originalRequestFn.apply(this, arguments); + + streamsCount++; + + if (timer) { + clearTimeout(timer); + timer = null; + } + + stream.once('close', () => { + if (!--streamsCount) { + timer = setTimeout(() => { + timer = null; + removeSession(); + }, sessionTimeout); + } + }); + + return stream; + } + } + + session.once('close', removeSession); + + let entry = [ + session, + options + ]; + + authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry]; + + return session; + } +} + +const http2Sessions = new Http2Sessions(); + + +/** + * If the proxy or config beforeRedirects functions are defined, call them with the options + * object. + * + * @param {Object} options - The options object that was passed to the request. + * + * @returns {Object} + */ +function dispatchBeforeRedirect(options, responseDetails) { + if (options.beforeRedirects.proxy) { + options.beforeRedirects.proxy(options); + } + if (options.beforeRedirects.config) { + options.beforeRedirects.config(options, responseDetails); + } +} + +/** + * If the proxy or config afterRedirects functions are defined, call them with the options + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} configProxy configuration from Axios options object + * @param {string} location + * + * @returns {http.ClientRequestArgs} + */ +function setProxy(options, configProxy, location) { + let proxy = configProxy; + if (!proxy && proxy !== false) { + const proxyUrl = proxyFromEnv.getProxyForUrl(location); + if (proxyUrl) { + proxy = new URL(proxyUrl); + } + } + if (proxy) { + // Basic proxy authorization + if (proxy.username) { + proxy.auth = (proxy.username || '') + ':' + (proxy.password || ''); + } + + if (proxy.auth) { + // Support proxy auth object form + if (proxy.auth.username || proxy.auth.password) { + proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || ''); + } + const base64 = Buffer + .from(proxy.auth, 'utf8') + .toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + options.headers.host = options.hostname + (options.port ? ':' + options.port : ''); + const proxyHost = proxy.hostname || proxy.host; + options.hostname = proxyHost; + // Replace 'host' since options is not a URL object + options.host = proxyHost; + options.port = proxy.port; + options.path = location; + if (proxy.protocol) { + options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`; + } + } + + options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) { + // Configure proxy for redirected request, passing the original config proxy to apply + // the exact same logic as if the redirected request was performed by axios directly. + setProxy(redirectOptions, configProxy, redirectOptions.href); + }; +} + +const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process'; + +// temporary hotfix + +const wrapAsync = (asyncExecutor) => { + return new Promise((resolve, reject) => { + let onDone; + let isDone; + + const done = (value, isRejected) => { + if (isDone) return; + isDone = true; + onDone && onDone(value, isRejected); + } + + const _resolve = (value) => { + done(value); + resolve(value); + }; + + const _reject = (reason) => { + done(reason, true); + reject(reason); + } + + asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject); + }) +}; + +const resolveFamily = ({address, family}) => { + if (!utils.isString(address)) { + throw TypeError('address must be a string'); + } + return ({ + address, + family: family || (address.indexOf('.') < 0 ? 6 : 4) + }); +} + +const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family}); + +const http2Transport = { + request(options, cb) { + const authority = options.protocol + '//' + options.hostname + ':' + (options.port || 80); + + const {http2Options, headers} = options; + + const session = http2Sessions.getSession(authority, http2Options); + + const { + HTTP2_HEADER_SCHEME, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_PATH, + HTTP2_HEADER_STATUS + } = http2.constants; + + const http2Headers = { + [HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''), + [HTTP2_HEADER_METHOD]: options.method, + [HTTP2_HEADER_PATH]: options.path, + } + + utils.forEach(headers, (header, name) => { + name.charAt(0) !== ':' && (http2Headers[name] = header); + }); + + const req = session.request(http2Headers); + + req.once('response', (responseHeaders) => { + const response = req; //duplex + + responseHeaders = Object.assign({}, responseHeaders); + + const status = responseHeaders[HTTP2_HEADER_STATUS]; + + delete responseHeaders[HTTP2_HEADER_STATUS]; + + response.headers = responseHeaders; + + response.statusCode = +status; + + cb(response); + }) + + return req; + } +} + +/*eslint consistent-return:0*/ +export default isHttpAdapterSupported && function httpAdapter(config) { + return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) { + let {data, lookup, family, httpVersion = 1, http2Options} = config; + const {responseType, responseEncoding} = config; + const method = config.method.toUpperCase(); + let isDone; + let rejected = false; + let req; + + httpVersion = +httpVersion; + + if (Number.isNaN(httpVersion)) { + throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`); + } + + if (httpVersion !== 1 && httpVersion !== 2) { + throw TypeError(`Unsupported protocol version '${httpVersion}'`); + } + + const isHttp2 = httpVersion === 2; + + if (lookup) { + const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]); + // hotfix to support opt.all option which is required for node 20.x + lookup = (hostname, opt, cb) => { + _lookup(hostname, opt, (err, arg0, arg1) => { + if (err) { + return cb(err); + } + + const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)]; + + opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family); + }); + } + } + + const abortEmitter = new EventEmitter(); + + function abort(reason) { + try { + abortEmitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason); + } catch(err) { + console.warn('emit error', err); + } + } + + abortEmitter.once('abort', reject); + + const onFinished = () => { + if (config.cancelToken) { + config.cancelToken.unsubscribe(abort); + } + + if (config.signal) { + config.signal.removeEventListener('abort', abort); + } + + abortEmitter.removeAllListeners(); + } + + if (config.cancelToken || config.signal) { + config.cancelToken && config.cancelToken.subscribe(abort); + if (config.signal) { + config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort); + } + } + + onDone((response, isRejected) => { + isDone = true; + + if (isRejected) { + rejected = true; + onFinished(); + return; + } + + const {data} = response; + + if (data instanceof stream.Readable || data instanceof stream.Duplex) { + const offListeners = stream.finished(data, () => { + offListeners(); + onFinished(); + }); + } else { + onFinished(); + } + }); + + + + + + // Parse url + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined); + const protocol = parsed.protocol || supportedProtocols[0]; + + if (protocol === 'data:') { + // Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set. + if (config.maxContentLength > -1) { + // Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed. + const dataUrl = String(config.url || fullPath || ''); + const estimated = estimateDataURLDecodedBytes(dataUrl); + + if (estimated > config.maxContentLength) { + return reject(new AxiosError( + 'maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, + config + )); + } + } + + let convertedData; + + if (method !== 'GET') { + return settle(resolve, reject, { + status: 405, + statusText: 'method not allowed', + headers: {}, + config + }); + } + + try { + convertedData = fromDataURI(config.url, responseType === 'blob', { + Blob: config.env && config.env.Blob + }); + } catch (err) { + throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config); + } + + if (responseType === 'text') { + convertedData = convertedData.toString(responseEncoding); + + if (!responseEncoding || responseEncoding === 'utf8') { + convertedData = utils.stripBOM(convertedData); + } + } else if (responseType === 'stream') { + convertedData = stream.Readable.from(convertedData); + } + + return settle(resolve, reject, { + data: convertedData, + status: 200, + statusText: 'OK', + headers: new AxiosHeaders(), + config + }); + } + + if (supportedProtocols.indexOf(protocol) === -1) { + return reject(new AxiosError( + 'Unsupported protocol ' + protocol, + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + const headers = AxiosHeaders.from(config.headers).normalize(); + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + // User-Agent is specified; handle case where no UA header is desired + // Only set header if it hasn't been set in config + headers.set('User-Agent', 'axios/' + VERSION, false); + + const {onUploadProgress, onDownloadProgress} = config; + const maxRate = config.maxRate; + let maxUploadRate = undefined; + let maxDownloadRate = undefined; + + // support for spec compliant FormData objects + if (utils.isSpecCompliantForm(data)) { + const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i); + + data = formDataToStream(data, (formHeaders) => { + headers.set(formHeaders); + }, { + tag: `axios-${VERSION}-boundary`, + boundary: userBoundary && userBoundary[1] || undefined + }); + // support for https://www.npmjs.com/package/form-data api + } else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) { + headers.set(data.getHeaders()); + + if (!headers.hasContentLength()) { + try { + const knownLength = await util.promisify(data.getLength).call(data); + Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength); + /*eslint no-empty:0*/ + } catch (e) { + } + } + } else if (utils.isBlob(data) || utils.isFile(data)) { + data.size && headers.setContentType(data.type || 'application/octet-stream'); + headers.setContentLength(data.size || 0); + data = stream.Readable.from(readBlob(data)); + } else if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(new AxiosError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + + // Add Content-Length header if data exists + headers.setContentLength(data.length, false); + + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(new AxiosError( + 'Request body larger than maxBodyLength limit', + AxiosError.ERR_BAD_REQUEST, + config + )); + } + } + + const contentLength = utils.toFiniteNumber(headers.getContentLength()); + + if (utils.isArray(maxRate)) { + maxUploadRate = maxRate[0]; + maxDownloadRate = maxRate[1]; + } else { + maxUploadRate = maxDownloadRate = maxRate; + } + + if (data && (onUploadProgress || maxUploadRate)) { + if (!utils.isStream(data)) { + data = stream.Readable.from(data, {objectMode: false}); + } + + data = stream.pipeline([data, new AxiosTransformStream({ + maxRate: utils.toFiniteNumber(maxUploadRate) + })], utils.noop); + + onUploadProgress && data.on('progress', flushOnFinish( + data, + progressEventDecorator( + contentLength, + progressEventReducer(asyncDecorator(onUploadProgress), false, 3) + ) + )); + } + + // HTTP basic authentication + let auth = undefined; + if (config.auth) { + const username = config.auth.username || ''; + const password = config.auth.password || ''; + auth = username + ':' + password; + } + + if (!auth && parsed.username) { + const urlUsername = parsed.username; + const urlPassword = parsed.password; + auth = urlUsername + ':' + urlPassword; + } + + auth && headers.delete('authorization'); + + let path; + + try { + path = buildURL( + parsed.pathname + parsed.search, + config.params, + config.paramsSerializer + ).replace(/^\?/, ''); + } catch (err) { + const customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + return reject(customErr); + } + + headers.set( + 'Accept-Encoding', + 'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false + ); + + const options = { + path, + method: method, + headers: headers.toJSON(), + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth, + protocol, + family, + beforeRedirect: dispatchBeforeRedirect, + beforeRedirects: {}, + http2Options + }; + + // cacheable-lookup integration hotfix + !utils.isUndefined(lookup) && (options.lookup = lookup); + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname; + options.port = parsed.port; + setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + let transport; + const isHttpsRequest = isHttps.test(options.protocol); + options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + if (isHttp2) { + transport = http2Transport; + } else { + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsRequest ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + if (config.beforeRedirect) { + options.beforeRedirects.config = config.beforeRedirect; + } + transport = isHttpsRequest ? httpsFollow : httpFollow; + } + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } else { + // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited + options.maxBodyLength = Infinity; + } + + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + + // Create the request + req = transport.request(options, function handleResponse(res) { + if (req.destroyed) return; + + const streams = [res]; + + const responseLength = utils.toFiniteNumber(res.headers['content-length']); + + if (onDownloadProgress || maxDownloadRate) { + const transformStream = new AxiosTransformStream({ + maxRate: utils.toFiniteNumber(maxDownloadRate) + }); + + onDownloadProgress && transformStream.on('progress', flushOnFinish( + transformStream, + progressEventDecorator( + responseLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true, 3) + ) + )); + + streams.push(transformStream); + } + + // decompress the response body transparently if required + let responseStream = res; + + // return the last request in case of redirects + const lastRequest = res.req || req; + + // if decompress disabled we should not decompress + if (config.decompress !== false && res.headers['content-encoding']) { + // if no content, but headers still say that it is encoded, + // remove the header not confuse downstream operations + if (method === 'HEAD' || res.statusCode === 204) { + delete res.headers['content-encoding']; + } + + switch ((res.headers['content-encoding'] || '').toLowerCase()) { + /*eslint default-case:0*/ + case 'gzip': + case 'x-gzip': + case 'compress': + case 'x-compress': + // add the unzipper to the body stream processing pipeline + streams.push(zlib.createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'deflate': + streams.push(new ZlibHeaderTransformStream()); + + // add the unzipper to the body stream processing pipeline + streams.push(zlib.createUnzip(zlibOptions)); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + case 'br': + if (isBrotliSupported) { + streams.push(zlib.createBrotliDecompress(brotliOptions)); + delete res.headers['content-encoding']; + } + } + } + + responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0]; + + + + const response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: new AxiosHeaders(res.headers), + config, + request: lastRequest + }; + + if (responseType === 'stream') { + response.data = responseStream; + settle(resolve, reject, response); + } else { + const responseBuffer = []; + let totalResponseBytes = 0; + + responseStream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destroy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + responseStream.destroy(); + abort(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + AxiosError.ERR_BAD_RESPONSE, config, lastRequest)); + } + }); + + responseStream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + + const err = new AxiosError( + 'stream has been aborted', + AxiosError.ERR_BAD_RESPONSE, + config, + lastRequest + ); + responseStream.destroy(err); + reject(err); + }); + + responseStream.on('error', function handleStreamError(err) { + if (req.destroyed) return; + reject(AxiosError.from(err, null, config, lastRequest)); + }); + + responseStream.on('end', function handleStreamEnd() { + try { + let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (responseType !== 'arraybuffer') { + responseData = responseData.toString(responseEncoding); + if (!responseEncoding || responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + return reject(AxiosError.from(err, null, config, response.request, response)); + } + settle(resolve, reject, response); + }); + } + + abortEmitter.once('abort', err => { + if (!responseStream.destroyed) { + responseStream.emit('error', err); + responseStream.destroy(); + } + }); + }); + + abortEmitter.once('abort', err => { + if (req.close) { + req.close(); + } else { + req.destroy(err); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + // @todo remove + // if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return; + reject(AxiosError.from(err, null, config, req)); + }); + + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + const timeout = parseInt(config.timeout, 10); + + if (Number.isNaN(timeout)) { + abort(new AxiosError( + 'error trying to parse `config.timeout` to int', + AxiosError.ERR_BAD_OPTION_VALUE, + config, + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devouring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + if (isDone) return; + let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + abort(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + req + )); + }); + } else { + // explicitly reset the socket timeout value for a possible `keep-alive` request + req.setTimeout(0); + } + + + // Send the request + if (utils.isStream(data)) { + let ended = false; + let errored = false; + + data.on('end', () => { + ended = true; + }); + + data.once('error', err => { + errored = true; + req.destroy(err); + }); + + data.on('close', () => { + if (!ended && !errored) { + abort(new CanceledError('Request stream has been aborted', config, req)); + } + }); + + data.pipe(req); + } else { + data && req.write(data); + req.end(); + } + }); +} + +export const __setProxy = setProxy; diff --git a/node_modules/axios/lib/adapters/xhr.js b/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 0000000..0223618 --- /dev/null +++ b/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,200 @@ +import utils from './../utils.js'; +import settle from './../core/settle.js'; +import transitionalDefaults from '../defaults/transitional.js'; +import AxiosError from '../core/AxiosError.js'; +import CanceledError from '../cancel/CanceledError.js'; +import parseProtocol from '../helpers/parseProtocol.js'; +import platform from '../platform/index.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import {progressEventReducer} from '../helpers/progressEventReducer.js'; +import resolveConfig from "../helpers/resolveConfig.js"; + +const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; + +export default isXHRAdapterSupported && function (config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders.from(_config.headers).normalize(); + let {responseType, onUploadProgress, onDownloadProgress} = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload; + + function done() { + flushUpload && flushUpload(); // flush events + flushDownload && flushDownload(); // flush events + + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + + _config.signal && _config.signal.removeEventListener('abort', onCanceled); + } + + let request = new XMLHttpRequest(); + + request.open(_config.method.toUpperCase(), _config.url, true); + + // Set the request timeout in MS + request.timeout = _config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + const responseHeaders = AxiosHeaders.from( + 'getAllResponseHeaders' in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError(event) { + // Browsers deliver a ProgressEvent in XHR onerror + // (message may be empty; when present, surface it) + // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event + const msg = event && event.message ? event.message : 'Network Error'; + const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request); + // attach the underlying event for consumers who want details + err.event = event || null; + reject(err); + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded'; + const transitional = _config.transitional || transitionalDefaults; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject(new AxiosError( + timeoutErrorMessage, + transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, + config, + request)); + + // Clean up request + request = null; + }; + + // Remove Content-Type if data is undefined + requestData === undefined && requestHeaders.setContentType(null); + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = _config.responseType; + } + + // Handle progress if needed + if (onDownloadProgress) { + ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true)); + request.addEventListener('progress', downloadThrottled); + } + + // Not all browsers support upload events + if (onUploadProgress && request.upload) { + ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress)); + + request.upload.addEventListener('progress', uploadThrottled); + + request.upload.addEventListener('loadend', flushUpload); + } + + if (_config.cancelToken || _config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = cancel => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); + request.abort(); + request = null; + }; + + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled); + } + } + + const protocol = parseProtocol(_config.url); + + if (protocol && platform.protocols.indexOf(protocol) === -1) { + reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config)); + return; + } + + + // Send the request + request.send(requestData || null); + }); +} diff --git a/node_modules/axios/lib/axios.js b/node_modules/axios/lib/axios.js new file mode 100644 index 0000000..873f246 --- /dev/null +++ b/node_modules/axios/lib/axios.js @@ -0,0 +1,89 @@ +'use strict'; + +import utils from './utils.js'; +import bind from './helpers/bind.js'; +import Axios from './core/Axios.js'; +import mergeConfig from './core/mergeConfig.js'; +import defaults from './defaults/index.js'; +import formDataToJSON from './helpers/formDataToJSON.js'; +import CanceledError from './cancel/CanceledError.js'; +import CancelToken from './cancel/CancelToken.js'; +import isCancel from './cancel/isCancel.js'; +import {VERSION} from './env/data.js'; +import toFormData from './helpers/toFormData.js'; +import AxiosError from './core/AxiosError.js'; +import spread from './helpers/spread.js'; +import isAxiosError from './helpers/isAxiosError.js'; +import AxiosHeaders from "./core/AxiosHeaders.js"; +import adapters from './adapters/adapters.js'; +import HttpStatusCode from './helpers/HttpStatusCode.js'; + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * + * @returns {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + const context = new Axios(defaultConfig); + const instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context, {allOwnKeys: true}); + + // Copy context to instance + utils.extend(instance, context, null, {allOwnKeys: true}); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +const axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Expose Cancel & CancelToken +axios.CanceledError = CanceledError; +axios.CancelToken = CancelToken; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData; + +// Expose AxiosError class +axios.AxiosError = AxiosError; + +// alias for CanceledError for backward compatibility +axios.Cancel = axios.CanceledError; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; + +axios.spread = spread; + +// Expose isAxiosError +axios.isAxiosError = isAxiosError; + +// Expose mergeConfig +axios.mergeConfig = mergeConfig; + +axios.AxiosHeaders = AxiosHeaders; + +axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing); + +axios.getAdapter = adapters.getAdapter; + +axios.HttpStatusCode = HttpStatusCode; + +axios.default = axios; + +// this module should only have a default export +export default axios diff --git a/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 0000000..0fc2025 --- /dev/null +++ b/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,135 @@ +'use strict'; + +import CanceledError from './CanceledError.js'; + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @param {Function} executor The executor function. + * + * @returns {CancelToken} + */ +class CancelToken { + constructor(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + let resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + const token = this; + + // eslint-disable-next-line func-names + this.promise.then(cancel => { + if (!token._listeners) return; + + let i = token._listeners.length; + + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = onfulfilled => { + let _resolve; + // eslint-disable-next-line func-names + const promise = new Promise(resolve => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message, config, request) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new CanceledError(message, config, request); + resolvePromise(token.reason); + }); + } + + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + + /** + * Subscribe to the cancel signal + */ + + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + + /** + * Unsubscribe from the cancel signal + */ + + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + + toAbortSignal() { + const controller = new AbortController(); + + const abort = (err) => { + controller.abort(err); + }; + + this.subscribe(abort); + + controller.signal.unsubscribe = () => this.unsubscribe(abort); + + return controller.signal; + } + + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +} + +export default CancelToken; diff --git a/node_modules/axios/lib/cancel/CanceledError.js b/node_modules/axios/lib/cancel/CanceledError.js new file mode 100644 index 0000000..880066e --- /dev/null +++ b/node_modules/axios/lib/cancel/CanceledError.js @@ -0,0 +1,25 @@ +'use strict'; + +import AxiosError from '../core/AxiosError.js'; +import utils from '../utils.js'; + +/** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ +function CanceledError(message, config, request) { + // eslint-disable-next-line no-eq-null,eqeqeq + AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request); + this.name = 'CanceledError'; +} + +utils.inherits(CanceledError, AxiosError, { + __CANCEL__: true +}); + +export default CanceledError; diff --git a/node_modules/axios/lib/cancel/isCancel.js b/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 0000000..a444a12 --- /dev/null +++ b/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +export default function isCancel(value) { + return !!(value && value.__CANCEL__); +} diff --git a/node_modules/axios/lib/core/Axios.js b/node_modules/axios/lib/core/Axios.js new file mode 100644 index 0000000..a564927 --- /dev/null +++ b/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,240 @@ +'use strict'; + +import utils from './../utils.js'; +import buildURL from '../helpers/buildURL.js'; +import InterceptorManager from './InterceptorManager.js'; +import dispatchRequest from './dispatchRequest.js'; +import mergeConfig from './mergeConfig.js'; +import buildFullPath from './buildFullPath.js'; +import validator from '../helpers/validator.js'; +import AxiosHeaders from './AxiosHeaders.js'; + +const validators = validator.validators; + +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + * + * @return {Axios} A new instance of Axios + */ +class Axios { + constructor(instanceConfig) { + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; + } + + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + let dummy = {}; + + Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); + + // slice off the Error: ... line + const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : ''; + try { + if (!err.stack) { + err.stack = stack; + // match without the 2 top stack lines + } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) { + err.stack += '\n' + stack + } + } catch (e) { + // ignore the case where "stack" is an un-writable property + } + } + + throw err; + } + } + + _request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + const {transitional, paramsSerializer, headers} = config; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + if (paramsSerializer != null) { + if (utils.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + } + } else { + validator.assertOptions(paramsSerializer, { + encode: validators.function, + serialize: validators.function + }, true); + } + } + + // Set config.allowAbsoluteUrls + if (config.allowAbsoluteUrls !== undefined) { + // do nothing + } else if (this.defaults.allowAbsoluteUrls !== undefined) { + config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + } else { + config.allowAbsoluteUrls = true; + } + + validator.assertOptions(config, { + baseUrl: validators.spelling('baseURL'), + withXsrfToken: validators.spelling('withXSRFToken') + }, true); + + // Set config.method + config.method = (config.method || this.defaults.method || 'get').toLowerCase(); + + // Flatten headers + let contextHeaders = headers && utils.merge( + headers.common, + headers[config.method] + ); + + headers && utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + (method) => { + delete headers[method]; + } + ); + + config.headers = AxiosHeaders.concat(contextHeaders, headers); + + // filter out skipped interceptors + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + let promise; + let i = 0; + let len; + + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), undefined]; + chain.unshift(...requestInterceptorChain); + chain.push(...responseInterceptorChain); + len = chain.length; + + promise = Promise.resolve(config); + + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + + return promise; + } + + len = requestInterceptorChain.length; + + let newConfig = config; + + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected.call(this, error); + break; + } + } + + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + return Promise.reject(error); + } + + i = 0; + len = responseInterceptorChain.length; + + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + + return promise; + } + + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +} + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method, + url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request(mergeConfig(config || {}, { + method, + headers: isForm ? { + 'Content-Type': 'multipart/form-data' + } : {}, + url, + data + })); + }; + } + + Axios.prototype[method] = generateHTTPMethod(); + + Axios.prototype[method + 'Form'] = generateHTTPMethod(true); +}); + +export default Axios; diff --git a/node_modules/axios/lib/core/AxiosError.js b/node_modules/axios/lib/core/AxiosError.js new file mode 100644 index 0000000..3d118cb --- /dev/null +++ b/node_modules/axios/lib/core/AxiosError.js @@ -0,0 +1,110 @@ +'use strict'; + +import utils from '../utils.js'; + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ +function AxiosError(message, code, config, request, response) { + Error.call(this); + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = (new Error()).stack; + } + + this.message = message; + this.name = 'AxiosError'; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status ? response.status : null; + } +} + +utils.inherits(AxiosError, Error, { + toJSON: function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: utils.toJSONObject(this.config), + code: this.code, + status: this.status + }; + } +}); + +const prototype = AxiosError.prototype; +const descriptors = {}; + +[ + 'ERR_BAD_OPTION_VALUE', + 'ERR_BAD_OPTION', + 'ECONNABORTED', + 'ETIMEDOUT', + 'ERR_NETWORK', + 'ERR_FR_TOO_MANY_REDIRECTS', + 'ERR_DEPRECATED', + 'ERR_BAD_RESPONSE', + 'ERR_BAD_REQUEST', + 'ERR_CANCELED', + 'ERR_NOT_SUPPORT', + 'ERR_INVALID_URL' +// eslint-disable-next-line func-names +].forEach(code => { + descriptors[code] = {value: code}; +}); + +Object.defineProperties(AxiosError, descriptors); +Object.defineProperty(prototype, 'isAxiosError', {value: true}); + +// eslint-disable-next-line func-names +AxiosError.from = (error, code, config, request, response, customProps) => { + const axiosError = Object.create(prototype); + + utils.toFlatObject(error, axiosError, function filter(obj) { + return obj !== Error.prototype; + }, prop => { + return prop !== 'isAxiosError'; + }); + + const msg = error && error.message ? error.message : 'Error'; + + // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED) + const errCode = code == null && error ? error.code : code; + AxiosError.call(axiosError, msg, errCode, config, request, response); + + // Chain the original error on the standard field; non-enumerable to avoid JSON noise + if (error && axiosError.cause == null) { + Object.defineProperty(axiosError, 'cause', { value: error, configurable: true }); + } + + axiosError.name = (error && error.name) || 'Error'; + + customProps && Object.assign(axiosError, customProps); + + return axiosError; +}; + +export default AxiosError; diff --git a/node_modules/axios/lib/core/AxiosHeaders.js b/node_modules/axios/lib/core/AxiosHeaders.js new file mode 100644 index 0000000..6744581 --- /dev/null +++ b/node_modules/axios/lib/core/AxiosHeaders.js @@ -0,0 +1,314 @@ +'use strict'; + +import utils from '../utils.js'; +import parseHeaders from '../helpers/parseHeaders.js'; + +const $internals = Symbol('internals'); + +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} + +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + + return utils.isArray(value) ? value.map(normalizeValue) : String(value); +} + +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + + while ((match = tokensRE.exec(str))) { + tokens[match[1]] = match[2]; + } + + return tokens; +} + +const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); + +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils.isFunction(filter)) { + return filter.call(this, value, header); + } + + if (isHeaderNameFilter) { + value = header; + } + + if (!utils.isString(value)) return; + + if (utils.isString(filter)) { + return value.indexOf(filter) !== -1; + } + + if (utils.isRegExp(filter)) { + return filter.test(value); + } +} + +function formatHeader(header) { + return header.trim() + .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} + +function buildAccessors(obj, header) { + const accessorName = utils.toCamelCase(' ' + header); + + ['get', 'set', 'has'].forEach(methodName => { + Object.defineProperty(obj, methodName + accessorName, { + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} + +class AxiosHeaders { + constructor(headers) { + headers && this.set(headers); + } + + set(header, valueOrRewrite, rewrite) { + const self = this; + + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + + if (!lHeader) { + throw new Error('header name must be a non-empty string'); + } + + const key = utils.findKey(self, lHeader); + + if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { + self[key || _header] = normalizeValue(_value); + } + } + + const setHeaders = (headers, _rewrite) => + utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + + if (utils.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite) + } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders(header), valueOrRewrite); + } else if (utils.isObject(header) && utils.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils.isArray(entry)) { + throw TypeError('Object iterator must return a key-value pair'); + } + + obj[key = entry[0]] = (dest = obj[key]) ? + (utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1]; + } + + setHeaders(obj, valueOrRewrite) + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + + return this; + } + + get(header, parser) { + header = normalizeHeader(header); + + if (header) { + const key = utils.findKey(this, header); + + if (key) { + const value = this[key]; + + if (!parser) { + return value; + } + + if (parser === true) { + return parseTokens(value); + } + + if (utils.isFunction(parser)) { + return parser.call(this, value, key); + } + + if (utils.isRegExp(parser)) { + return parser.exec(value); + } + + throw new TypeError('parser must be boolean|regexp|function'); + } + } + } + + has(header, matcher) { + header = normalizeHeader(header); + + if (header) { + const key = utils.findKey(this, header); + + return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + + return false; + } + + delete(header, matcher) { + const self = this; + let deleted = false; + + function deleteHeader(_header) { + _header = normalizeHeader(_header); + + if (_header) { + const key = utils.findKey(self, _header); + + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + + deleted = true; + } + } + } + + if (utils.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + + return deleted; + } + + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + + while (i--) { + const key = keys[i]; + if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + + return deleted; + } + + normalize(format) { + const self = this; + const headers = {}; + + utils.forEach(this, (value, header) => { + const key = utils.findKey(headers, header); + + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + + const normalized = format ? formatHeader(header) : String(header).trim(); + + if (normalized !== header) { + delete self[header]; + } + + self[normalized] = normalizeValue(value); + + headers[normalized] = true; + }); + + return this; + } + + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + + toJSON(asStrings) { + const obj = Object.create(null); + + utils.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value); + }); + + return obj; + } + + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); + } + + getSetCookie() { + return this.get("set-cookie") || []; + } + + get [Symbol.toStringTag]() { + return 'AxiosHeaders'; + } + + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + + static concat(first, ...targets) { + const computed = new this(first); + + targets.forEach((target) => computed.set(target)); + + return computed; + } + + static accessor(header) { + const internals = this[$internals] = (this[$internals] = { + accessors: {} + }); + + const accessors = internals.accessors; + const prototype = this.prototype; + + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + + utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + + return this; + } +} + +AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); + +// reserved names hotfix +utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + } +}); + +utils.freezeMethods(AxiosHeaders); + +export default AxiosHeaders; diff --git a/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 0000000..ac1b61b --- /dev/null +++ b/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,71 @@ +'use strict'; + +import utils from './../utils.js'; + +class InterceptorManager { + constructor() { + this.handlers = []; + } + + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; + } + + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + } + + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + } + } + + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } +} + +export default InterceptorManager; diff --git a/node_modules/axios/lib/core/README.md b/node_modules/axios/lib/core/README.md new file mode 100644 index 0000000..84559ce --- /dev/null +++ b/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/axios/lib/core/buildFullPath.js b/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 0000000..3050bd6 --- /dev/null +++ b/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,22 @@ +'use strict'; + +import isAbsoluteURL from '../helpers/isAbsoluteURL.js'; +import combineURLs from '../helpers/combineURLs.js'; + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * + * @returns {string} The combined full path + */ +export default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { + let isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} diff --git a/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 0000000..bdd07f8 --- /dev/null +++ b/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,81 @@ +'use strict'; + +import transformData from './transformData.js'; +import isCancel from '../cancel/isCancel.js'; +import defaults from '../defaults/index.js'; +import CanceledError from '../cancel/CanceledError.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; +import adapters from "../adapters/adapters.js"; + +/** + * Throws a `CanceledError` if cancellation has been requested. + * + * @param {Object} config The config that is to be used for the request + * + * @returns {void} + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new CanceledError(null, config); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * + * @returns {Promise} The Promise to be fulfilled + */ +export default function dispatchRequest(config) { + throwIfCancellationRequested(config); + + config.headers = AxiosHeaders.from(config.headers); + + // Transform request data + config.data = transformData.call( + config, + config.transformRequest + ); + + if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { + config.headers.setContentType('application/x-www-form-urlencoded', false); + } + + const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config); + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + config.transformResponse, + response + ); + + response.headers = AxiosHeaders.from(response.headers); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + reason.response.headers = AxiosHeaders.from(reason.response.headers); + } + } + + return Promise.reject(reason); + }); +} diff --git a/node_modules/axios/lib/core/mergeConfig.js b/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 0000000..b1b50f0 --- /dev/null +++ b/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,106 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosHeaders from "./AxiosHeaders.js"; + +const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing; + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * + * @returns {Object} New object resulting from merging config2 to config1 + */ +export default function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + const config = {}; + + function getMergedValue(target, source, prop, caseless) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge.call({caseless}, target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils.isUndefined(b)) { + return getMergedValue(a, b, prop, caseless); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a, prop, caseless); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(a, b) { + if (!utils.isUndefined(b)) { + return getMergedValue(undefined, b); + } else if (!utils.isUndefined(a)) { + return getMergedValue(undefined, a); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(undefined, a); + } + } + + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + }; + + utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) { + const merge = mergeMap[prop] || mergeDeepProperties; + const configValue = merge(config1[prop], config2[prop], prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +} diff --git a/node_modules/axios/lib/core/settle.js b/node_modules/axios/lib/core/settle.js new file mode 100644 index 0000000..ac905c4 --- /dev/null +++ b/node_modules/axios/lib/core/settle.js @@ -0,0 +1,27 @@ +'use strict'; + +import AxiosError from './AxiosError.js'; + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + * + * @returns {object} The response. + */ +export default function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(new AxiosError( + 'Request failed with status code ' + response.status, + [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], + response.config, + response.request, + response + )); + } +} diff --git a/node_modules/axios/lib/core/transformData.js b/node_modules/axios/lib/core/transformData.js new file mode 100644 index 0000000..eeb5a8a --- /dev/null +++ b/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,28 @@ +'use strict'; + +import utils from './../utils.js'; +import defaults from '../defaults/index.js'; +import AxiosHeaders from '../core/AxiosHeaders.js'; + +/** + * Transform the data for a request or a response + * + * @param {Array|Function} fns A single function or Array of functions + * @param {?Object} response The response object + * + * @returns {*} The resulting transformed data + */ +export default function transformData(fns, response) { + const config = this || defaults; + const context = response || config; + const headers = AxiosHeaders.from(context.headers); + let data = context.data; + + utils.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); + }); + + headers.normalize(); + + return data; +} diff --git a/node_modules/axios/lib/defaults/index.js b/node_modules/axios/lib/defaults/index.js new file mode 100644 index 0000000..cc14a8b --- /dev/null +++ b/node_modules/axios/lib/defaults/index.js @@ -0,0 +1,161 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosError from '../core/AxiosError.js'; +import transitionalDefaults from './transitional.js'; +import toFormData from '../helpers/toFormData.js'; +import toURLEncodedForm from '../helpers/toURLEncodedForm.js'; +import platform from '../platform/index.js'; +import formDataToJSON from '../helpers/formDataToJSON.js'; + +/** + * It takes a string, tries to parse it, and if it fails, it returns the stringified version + * of the input + * + * @param {any} rawValue - The value to be stringified. + * @param {Function} parser - A function that parses a string into a JavaScript object. + * @param {Function} encoder - A function that takes a value and returns a string. + * + * @returns {string} A stringified version of the rawValue. + */ +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +const defaults = { + + transitional: transitionalDefaults, + + adapter: ['xhr', 'http', 'fetch'], + + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ''; + const hasJSONContentType = contentType.indexOf('application/json') > -1; + const isObjectPayload = utils.isObject(data); + + if (isObjectPayload && utils.isHTMLForm(data)) { + data = new FormData(data); + } + + const isFormData = utils.isFormData(data); + + if (isFormData) { + return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + } + + if (utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) || + utils.isReadableStream(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); + return data.toString(); + } + + let isFileList; + + if (isObjectPayload) { + if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { + return toURLEncodedForm(data, this.formSerializer).toString(); + } + + if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { + const _FormData = this.env && this.env.FormData; + + return toFormData( + isFileList ? {'files[]': data} : data, + _FormData && new _FormData(), + this.formSerializer + ); + } + } + + if (isObjectPayload || hasJSONContentType ) { + headers.setContentType('application/json', false); + return stringifySafely(data); + } + + return data; + }], + + transformResponse: [function transformResponse(data) { + const transitional = this.transitional || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const JSONRequested = this.responseType === 'json'; + + if (utils.isResponse(data) || utils.isReadableStream(data)) { + return data; + } + + if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { + const silentJSONParsing = transitional && transitional.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + + try { + return JSON.parse(data, this.parseReviver); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + env: { + FormData: platform.classes.FormData, + Blob: platform.classes.Blob + }, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': undefined + } + } +}; + +utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { + defaults.headers[method] = {}; +}); + +export default defaults; diff --git a/node_modules/axios/lib/defaults/transitional.js b/node_modules/axios/lib/defaults/transitional.js new file mode 100644 index 0000000..f891331 --- /dev/null +++ b/node_modules/axios/lib/defaults/transitional.js @@ -0,0 +1,7 @@ +'use strict'; + +export default { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; diff --git a/node_modules/axios/lib/env/README.md b/node_modules/axios/lib/env/README.md new file mode 100644 index 0000000..b41baff --- /dev/null +++ b/node_modules/axios/lib/env/README.md @@ -0,0 +1,3 @@ +# axios // env + +The `data.js` file is updated automatically when the package version is upgrading. Please do not edit it manually. diff --git a/node_modules/axios/lib/env/classes/FormData.js b/node_modules/axios/lib/env/classes/FormData.js new file mode 100644 index 0000000..862adb9 --- /dev/null +++ b/node_modules/axios/lib/env/classes/FormData.js @@ -0,0 +1,2 @@ +import _FormData from 'form-data'; +export default typeof FormData !== 'undefined' ? FormData : _FormData; diff --git a/node_modules/axios/lib/env/data.js b/node_modules/axios/lib/env/data.js new file mode 100644 index 0000000..38dd6aa --- /dev/null +++ b/node_modules/axios/lib/env/data.js @@ -0,0 +1 @@ +export const VERSION = "1.13.2"; \ No newline at end of file diff --git a/node_modules/axios/lib/helpers/AxiosTransformStream.js b/node_modules/axios/lib/helpers/AxiosTransformStream.js new file mode 100644 index 0000000..4140071 --- /dev/null +++ b/node_modules/axios/lib/helpers/AxiosTransformStream.js @@ -0,0 +1,143 @@ +'use strict'; + +import stream from 'stream'; +import utils from '../utils.js'; + +const kInternals = Symbol('internals'); + +class AxiosTransformStream extends stream.Transform{ + constructor(options) { + options = utils.toFlatObject(options, { + maxRate: 0, + chunkSize: 64 * 1024, + minChunkSize: 100, + timeWindow: 500, + ticksRate: 2, + samplesCount: 15 + }, null, (prop, source) => { + return !utils.isUndefined(source[prop]); + }); + + super({ + readableHighWaterMark: options.chunkSize + }); + + const internals = this[kInternals] = { + timeWindow: options.timeWindow, + chunkSize: options.chunkSize, + maxRate: options.maxRate, + minChunkSize: options.minChunkSize, + bytesSeen: 0, + isCaptured: false, + notifiedBytesLoaded: 0, + ts: Date.now(), + bytes: 0, + onReadCallback: null + }; + + this.on('newListener', event => { + if (event === 'progress') { + if (!internals.isCaptured) { + internals.isCaptured = true; + } + } + }); + } + + _read(size) { + const internals = this[kInternals]; + + if (internals.onReadCallback) { + internals.onReadCallback(); + } + + return super._read(size); + } + + _transform(chunk, encoding, callback) { + const internals = this[kInternals]; + const maxRate = internals.maxRate; + + const readableHighWaterMark = this.readableHighWaterMark; + + const timeWindow = internals.timeWindow; + + const divider = 1000 / timeWindow; + const bytesThreshold = (maxRate / divider); + const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0; + + const pushChunk = (_chunk, _callback) => { + const bytes = Buffer.byteLength(_chunk); + internals.bytesSeen += bytes; + internals.bytes += bytes; + + internals.isCaptured && this.emit('progress', internals.bytesSeen); + + if (this.push(_chunk)) { + process.nextTick(_callback); + } else { + internals.onReadCallback = () => { + internals.onReadCallback = null; + process.nextTick(_callback); + }; + } + } + + const transformChunk = (_chunk, _callback) => { + const chunkSize = Buffer.byteLength(_chunk); + let chunkRemainder = null; + let maxChunkSize = readableHighWaterMark; + let bytesLeft; + let passed = 0; + + if (maxRate) { + const now = Date.now(); + + if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) { + internals.ts = now; + bytesLeft = bytesThreshold - internals.bytes; + internals.bytes = bytesLeft < 0 ? -bytesLeft : 0; + passed = 0; + } + + bytesLeft = bytesThreshold - internals.bytes; + } + + if (maxRate) { + if (bytesLeft <= 0) { + // next time window + return setTimeout(() => { + _callback(null, _chunk); + }, timeWindow - passed); + } + + if (bytesLeft < maxChunkSize) { + maxChunkSize = bytesLeft; + } + } + + if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) { + chunkRemainder = _chunk.subarray(maxChunkSize); + _chunk = _chunk.subarray(0, maxChunkSize); + } + + pushChunk(_chunk, chunkRemainder ? () => { + process.nextTick(_callback, null, chunkRemainder); + } : _callback); + }; + + transformChunk(chunk, function transformNextChunk(err, _chunk) { + if (err) { + return callback(err); + } + + if (_chunk) { + transformChunk(_chunk, transformNextChunk); + } else { + callback(null); + } + }); + } +} + +export default AxiosTransformStream; diff --git a/node_modules/axios/lib/helpers/AxiosURLSearchParams.js b/node_modules/axios/lib/helpers/AxiosURLSearchParams.js new file mode 100644 index 0000000..b9aa9f0 --- /dev/null +++ b/node_modules/axios/lib/helpers/AxiosURLSearchParams.js @@ -0,0 +1,58 @@ +'use strict'; + +import toFormData from './toFormData.js'; + +/** + * It encodes a string by replacing all characters that are not in the unreserved set with + * their percent-encoded equivalents + * + * @param {string} str - The string to encode. + * + * @returns {string} The encoded string. + */ +function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; + }); +} + +/** + * It takes a params object and converts it to a FormData object + * + * @param {Object} params - The parameters to be converted to a FormData object. + * @param {Object} options - The options object passed to the Axios constructor. + * + * @returns {void} + */ +function AxiosURLSearchParams(params, options) { + this._pairs = []; + + params && toFormData(params, this, options); +} + +const prototype = AxiosURLSearchParams.prototype; + +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; + +prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); +}; + +export default AxiosURLSearchParams; diff --git a/node_modules/axios/lib/helpers/HttpStatusCode.js b/node_modules/axios/lib/helpers/HttpStatusCode.js new file mode 100644 index 0000000..b68d08e --- /dev/null +++ b/node_modules/axios/lib/helpers/HttpStatusCode.js @@ -0,0 +1,77 @@ +const HttpStatusCode = { + Continue: 100, + SwitchingProtocols: 101, + Processing: 102, + EarlyHints: 103, + Ok: 200, + Created: 201, + Accepted: 202, + NonAuthoritativeInformation: 203, + NoContent: 204, + ResetContent: 205, + PartialContent: 206, + MultiStatus: 207, + AlreadyReported: 208, + ImUsed: 226, + MultipleChoices: 300, + MovedPermanently: 301, + Found: 302, + SeeOther: 303, + NotModified: 304, + UseProxy: 305, + Unused: 306, + TemporaryRedirect: 307, + PermanentRedirect: 308, + BadRequest: 400, + Unauthorized: 401, + PaymentRequired: 402, + Forbidden: 403, + NotFound: 404, + MethodNotAllowed: 405, + NotAcceptable: 406, + ProxyAuthenticationRequired: 407, + RequestTimeout: 408, + Conflict: 409, + Gone: 410, + LengthRequired: 411, + PreconditionFailed: 412, + PayloadTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + UnprocessableEntity: 422, + Locked: 423, + FailedDependency: 424, + TooEarly: 425, + UpgradeRequired: 426, + PreconditionRequired: 428, + TooManyRequests: 429, + RequestHeaderFieldsTooLarge: 431, + UnavailableForLegalReasons: 451, + InternalServerError: 500, + NotImplemented: 501, + BadGateway: 502, + ServiceUnavailable: 503, + GatewayTimeout: 504, + HttpVersionNotSupported: 505, + VariantAlsoNegotiates: 506, + InsufficientStorage: 507, + LoopDetected: 508, + NotExtended: 510, + NetworkAuthenticationRequired: 511, + WebServerIsDown: 521, + ConnectionTimedOut: 522, + OriginIsUnreachable: 523, + TimeoutOccurred: 524, + SslHandshakeFailed: 525, + InvalidSslCertificate: 526, +}; + +Object.entries(HttpStatusCode).forEach(([key, value]) => { + HttpStatusCode[value] = key; +}); + +export default HttpStatusCode; diff --git a/node_modules/axios/lib/helpers/README.md b/node_modules/axios/lib/helpers/README.md new file mode 100644 index 0000000..4ae3419 --- /dev/null +++ b/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js b/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js new file mode 100644 index 0000000..d1791f0 --- /dev/null +++ b/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js @@ -0,0 +1,28 @@ +"use strict"; + +import stream from "stream"; + +class ZlibHeaderTransformStream extends stream.Transform { + __transform(chunk, encoding, callback) { + this.push(chunk); + callback(); + } + + _transform(chunk, encoding, callback) { + if (chunk.length !== 0) { + this._transform = this.__transform; + + // Add Default Compression headers if no zlib headers are present + if (chunk[0] !== 120) { // Hex: 78 + const header = Buffer.alloc(2); + header[0] = 120; // Hex: 78 + header[1] = 156; // Hex: 9C + this.push(header, encoding); + } + } + + this.__transform(chunk, encoding, callback); + } +} + +export default ZlibHeaderTransformStream; diff --git a/node_modules/axios/lib/helpers/bind.js b/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 0000000..938da5c --- /dev/null +++ b/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Create a bound version of a function with a specified `this` context + * + * @param {Function} fn - The function to bind + * @param {*} thisArg - The value to be passed as the `this` parameter + * @returns {Function} A new function that will call the original function with the specified `this` context + */ +export default function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} diff --git a/node_modules/axios/lib/helpers/buildURL.js b/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 0000000..4f9c0d1 --- /dev/null +++ b/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,67 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js'; + +/** + * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their + * URI encoded counterparts + * + * @param {string} val The value to be encoded. + * + * @returns {string} The encoded value. + */ +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @param {?(object|Function)} options + * + * @returns {string} The formatted url + */ +export default function buildURL(url, params, options) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + const _encode = options && options.encode || encode; + + if (utils.isFunction(options)) { + options = { + serialize: options + }; + } + + const serializeFn = options && options.serialize; + + let serializedParams; + + if (serializeFn) { + serializedParams = serializeFn(params, options); + } else { + serializedParams = utils.isURLSearchParams(params) ? + params.toString() : + new AxiosURLSearchParams(params, options).toString(_encode); + } + + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +} diff --git a/node_modules/axios/lib/helpers/callbackify.js b/node_modules/axios/lib/helpers/callbackify.js new file mode 100644 index 0000000..4603bad --- /dev/null +++ b/node_modules/axios/lib/helpers/callbackify.js @@ -0,0 +1,16 @@ +import utils from "../utils.js"; + +const callbackify = (fn, reducer) => { + return utils.isAsyncFn(fn) ? function (...args) { + const cb = args.pop(); + fn.apply(this, args).then((value) => { + try { + reducer ? cb(null, ...reducer(value)) : cb(null, value); + } catch (err) { + cb(err); + } + }, cb); + } : fn; +} + +export default callbackify; diff --git a/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 0000000..9f04f02 --- /dev/null +++ b/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * + * @returns {string} The combined URL + */ +export default function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +} diff --git a/node_modules/axios/lib/helpers/composeSignals.js b/node_modules/axios/lib/helpers/composeSignals.js new file mode 100644 index 0000000..84087c8 --- /dev/null +++ b/node_modules/axios/lib/helpers/composeSignals.js @@ -0,0 +1,48 @@ +import CanceledError from "../cancel/CanceledError.js"; +import AxiosError from "../core/AxiosError.js"; +import utils from '../utils.js'; + +const composeSignals = (signals, timeout) => { + const {length} = (signals = signals ? signals.filter(Boolean) : []); + + if (timeout || length) { + let controller = new AbortController(); + + let aborted; + + const onabort = function (reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err)); + } + } + + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT)) + }, timeout) + + const unsubscribe = () => { + if (signals) { + timer && clearTimeout(timer); + timer = null; + signals.forEach(signal => { + signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort); + }); + signals = null; + } + } + + signals.forEach((signal) => signal.addEventListener('abort', onabort)); + + const {signal} = controller; + + signal.unsubscribe = () => utils.asap(unsubscribe); + + return signal; + } +} + +export default composeSignals; diff --git a/node_modules/axios/lib/helpers/cookies.js b/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 0000000..266f09d --- /dev/null +++ b/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +import utils from './../utils.js'; +import platform from '../platform/index.js'; + +export default platform.hasStandardBrowserEnv ? + + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure, sameSite) { + if (typeof document === 'undefined') return; + + const cookie = [`${name}=${encodeURIComponent(value)}`]; + + if (utils.isNumber(expires)) { + cookie.push(`expires=${new Date(expires).toUTCString()}`); + } + if (utils.isString(path)) { + cookie.push(`path=${path}`); + } + if (utils.isString(domain)) { + cookie.push(`domain=${domain}`); + } + if (secure === true) { + cookie.push('secure'); + } + if (utils.isString(sameSite)) { + cookie.push(`SameSite=${sameSite}`); + } + + document.cookie = cookie.join('; '); + }, + + read(name) { + if (typeof document === 'undefined') return null; + const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); + return match ? decodeURIComponent(match[1]) : null; + }, + + remove(name) { + this.write(name, '', Date.now() - 86400000, '/'); + } + } + + : + + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() {}, + read() { + return null; + }, + remove() {} + }; + diff --git a/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 0000000..9e8fae6 --- /dev/null +++ b/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,26 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + * + * @returns {void} + */ +export default function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +} diff --git a/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js b/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js new file mode 100644 index 0000000..f29a817 --- /dev/null +++ b/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js @@ -0,0 +1,73 @@ +/** + * Estimate decoded byte length of a data:// URL *without* allocating large buffers. + * - For base64: compute exact decoded size using length and padding; + * handle %XX at the character-count level (no string allocation). + * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound. + * + * @param {string} url + * @returns {number} + */ +export default function estimateDataURLDecodedBytes(url) { + if (!url || typeof url !== 'string') return 0; + if (!url.startsWith('data:')) return 0; + + const comma = url.indexOf(','); + if (comma < 0) return 0; + + const meta = url.slice(5, comma); + const body = url.slice(comma + 1); + const isBase64 = /;base64/i.test(meta); + + if (isBase64) { + let effectiveLen = body.length; + const len = body.length; // cache length + + for (let i = 0; i < len; i++) { + if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) { + const a = body.charCodeAt(i + 1); + const b = body.charCodeAt(i + 2); + const isHex = + ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) && + ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102)); + + if (isHex) { + effectiveLen -= 2; + i += 2; + } + } + } + + let pad = 0; + let idx = len - 1; + + const tailIsPct3D = (j) => + j >= 2 && + body.charCodeAt(j - 2) === 37 && // '%' + body.charCodeAt(j - 1) === 51 && // '3' + (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd' + + if (idx >= 0) { + if (body.charCodeAt(idx) === 61 /* '=' */) { + pad++; + idx--; + } else if (tailIsPct3D(idx)) { + pad++; + idx -= 3; + } + } + + if (pad === 1 && idx >= 0) { + if (body.charCodeAt(idx) === 61 /* '=' */) { + pad++; + } else if (tailIsPct3D(idx)) { + pad++; + } + } + + const groups = Math.floor(effectiveLen / 4); + const bytes = groups * 3 - (pad || 0); + return bytes > 0 ? bytes : 0; + } + + return Buffer.byteLength(body, 'utf8'); +} diff --git a/node_modules/axios/lib/helpers/formDataToJSON.js b/node_modules/axios/lib/helpers/formDataToJSON.js new file mode 100644 index 0000000..906ce60 --- /dev/null +++ b/node_modules/axios/lib/helpers/formDataToJSON.js @@ -0,0 +1,95 @@ +'use strict'; + +import utils from '../utils.js'; + +/** + * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] + * + * @param {string} name - The name of the property to get. + * + * @returns An array of strings. + */ +function parsePropPath(name) { + // foo[x][y][z] + // foo.x.y.z + // foo-x-y-z + // foo x y z + return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => { + return match[0] === '[]' ? '' : match[1] || match[0]; + }); +} + +/** + * Convert an array to an object. + * + * @param {Array} arr - The array to convert to an object. + * + * @returns An object with the same keys and values as the array. + */ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} + +/** + * It takes a FormData object and returns a JavaScript object + * + * @param {string} formData The FormData object to convert to JSON. + * + * @returns {Object | null} The converted object. + */ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + + if (name === '__proto__') return true; + + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils.isArray(target) ? target.length : name; + + if (isLast) { + if (utils.hasOwnProp(target, name)) { + target[name] = [target[name], value]; + } else { + target[name] = value; + } + + return !isNumericKey; + } + + if (!target[name] || !utils.isObject(target[name])) { + target[name] = []; + } + + const result = buildPath(path, value, target[name], index); + + if (result && utils.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + + return !isNumericKey; + } + + if (utils.isFormData(formData) && utils.isFunction(formData.entries)) { + const obj = {}; + + utils.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + + return obj; + } + + return null; +} + +export default formDataToJSON; diff --git a/node_modules/axios/lib/helpers/formDataToStream.js b/node_modules/axios/lib/helpers/formDataToStream.js new file mode 100644 index 0000000..afc6174 --- /dev/null +++ b/node_modules/axios/lib/helpers/formDataToStream.js @@ -0,0 +1,112 @@ +import util from 'util'; +import {Readable} from 'stream'; +import utils from "../utils.js"; +import readBlob from "./readBlob.js"; +import platform from "../platform/index.js"; + +const BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + '-_'; + +const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder(); + +const CRLF = '\r\n'; +const CRLF_BYTES = textEncoder.encode(CRLF); +const CRLF_BYTES_COUNT = 2; + +class FormDataPart { + constructor(name, value) { + const {escapeName} = this.constructor; + const isStringValue = utils.isString(value); + + let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${ + !isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : '' + }${CRLF}`; + + if (isStringValue) { + value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + } else { + headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}` + } + + this.headers = textEncoder.encode(headers + CRLF); + + this.contentLength = isStringValue ? value.byteLength : value.size; + + this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; + + this.name = name; + this.value = value; + } + + async *encode(){ + yield this.headers; + + const {value} = this; + + if(utils.isTypedArray(value)) { + yield value; + } else { + yield* readBlob(value); + } + + yield CRLF_BYTES; + } + + static escapeName(name) { + return String(name).replace(/[\r\n"]/g, (match) => ({ + '\r' : '%0D', + '\n' : '%0A', + '"' : '%22', + }[match])); + } +} + +const formDataToStream = (form, headersHandler, options) => { + const { + tag = 'form-data-boundary', + size = 25, + boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET) + } = options || {}; + + if(!utils.isFormData(form)) { + throw TypeError('FormData instance required'); + } + + if (boundary.length < 1 || boundary.length > 70) { + throw Error('boundary must be 10-70 characters long') + } + + const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); + const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF); + let contentLength = footerBytes.byteLength; + + const parts = Array.from(form.entries()).map(([name, value]) => { + const part = new FormDataPart(name, value); + contentLength += part.size; + return part; + }); + + contentLength += boundaryBytes.byteLength * parts.length; + + contentLength = utils.toFiniteNumber(contentLength); + + const computedHeaders = { + 'Content-Type': `multipart/form-data; boundary=${boundary}` + } + + if (Number.isFinite(contentLength)) { + computedHeaders['Content-Length'] = contentLength; + } + + headersHandler && headersHandler(computedHeaders); + + return Readable.from((async function *() { + for(const part of parts) { + yield boundaryBytes; + yield* part.encode(); + } + + yield footerBytes; + })()); +}; + +export default formDataToStream; diff --git a/node_modules/axios/lib/helpers/fromDataURI.js b/node_modules/axios/lib/helpers/fromDataURI.js new file mode 100644 index 0000000..eb71d3f --- /dev/null +++ b/node_modules/axios/lib/helpers/fromDataURI.js @@ -0,0 +1,53 @@ +'use strict'; + +import AxiosError from '../core/AxiosError.js'; +import parseProtocol from './parseProtocol.js'; +import platform from '../platform/index.js'; + +const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/; + +/** + * Parse data uri to a Buffer or Blob + * + * @param {String} uri + * @param {?Boolean} asBlob + * @param {?Object} options + * @param {?Function} options.Blob + * + * @returns {Buffer|Blob} + */ +export default function fromDataURI(uri, asBlob, options) { + const _Blob = options && options.Blob || platform.classes.Blob; + const protocol = parseProtocol(uri); + + if (asBlob === undefined && _Blob) { + asBlob = true; + } + + if (protocol === 'data') { + uri = protocol.length ? uri.slice(protocol.length + 1) : uri; + + const match = DATA_URL_PATTERN.exec(uri); + + if (!match) { + throw new AxiosError('Invalid URL', AxiosError.ERR_INVALID_URL); + } + + const mime = match[1]; + const isBase64 = match[2]; + const body = match[3]; + const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8'); + + if (asBlob) { + if (!_Blob) { + throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT); + } + + return new _Blob([buffer], {type: mime}); + } + + return buffer; + } + + throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT); +} diff --git a/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 0000000..4747a45 --- /dev/null +++ b/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +export default function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} diff --git a/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 0000000..da6cd63 --- /dev/null +++ b/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,14 @@ +'use strict'; + +import utils from './../utils.js'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +export default function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +} diff --git a/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 0000000..6a92aa1 --- /dev/null +++ b/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,14 @@ +import platform from '../platform/index.js'; + +export default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => { + url = new URL(url, platform.origin); + + return ( + origin.protocol === url.protocol && + origin.host === url.host && + (isMSIE || origin.port === url.port) + ); +})( + new URL(platform.origin), + platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent) +) : () => true; diff --git a/node_modules/axios/lib/helpers/null.js b/node_modules/axios/lib/helpers/null.js new file mode 100644 index 0000000..b9f82c4 --- /dev/null +++ b/node_modules/axios/lib/helpers/null.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line strict +export default null; diff --git a/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 0000000..50af948 --- /dev/null +++ b/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,55 @@ +'use strict'; + +import utils from './../utils.js'; + +// RawAxiosHeaders whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +const ignoreDuplicateOf = utils.toObjectSet([ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]); + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} rawHeaders Headers needing to be parsed + * + * @returns {Object} Headers parsed into an object + */ +export default rawHeaders => { + const parsed = {}; + let key; + let val; + let i; + + rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { + i = line.indexOf(':'); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + + if (!key || (parsed[key] && ignoreDuplicateOf[key])) { + return; + } + + if (key === 'set-cookie') { + if (parsed[key]) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + }); + + return parsed; +}; diff --git a/node_modules/axios/lib/helpers/parseProtocol.js b/node_modules/axios/lib/helpers/parseProtocol.js new file mode 100644 index 0000000..586ec96 --- /dev/null +++ b/node_modules/axios/lib/helpers/parseProtocol.js @@ -0,0 +1,6 @@ +'use strict'; + +export default function parseProtocol(url) { + const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + return match && match[1] || ''; +} diff --git a/node_modules/axios/lib/helpers/progressEventReducer.js b/node_modules/axios/lib/helpers/progressEventReducer.js new file mode 100644 index 0000000..ff601cc --- /dev/null +++ b/node_modules/axios/lib/helpers/progressEventReducer.js @@ -0,0 +1,44 @@ +import speedometer from "./speedometer.js"; +import throttle from "./throttle.js"; +import utils from "../utils.js"; + +export const progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer(50, 250); + + return throttle(e => { + const loaded = e.loaded; + const total = e.lengthComputable ? e.total : undefined; + const progressBytes = loaded - bytesNotified; + const rate = _speedometer(progressBytes); + const inRange = loaded <= total; + + bytesNotified = loaded; + + const data = { + loaded, + total, + progress: total ? (loaded / total) : undefined, + bytes: progressBytes, + rate: rate ? rate : undefined, + estimated: rate && total && inRange ? (total - loaded) / rate : undefined, + event: e, + lengthComputable: total != null, + [isDownloadStream ? 'download' : 'upload']: true + }; + + listener(data); + }, freq); +} + +export const progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + + return [(loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), throttled[1]]; +} + +export const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args)); diff --git a/node_modules/axios/lib/helpers/readBlob.js b/node_modules/axios/lib/helpers/readBlob.js new file mode 100644 index 0000000..6de748e --- /dev/null +++ b/node_modules/axios/lib/helpers/readBlob.js @@ -0,0 +1,15 @@ +const {asyncIterator} = Symbol; + +const readBlob = async function* (blob) { + if (blob.stream) { + yield* blob.stream() + } else if (blob.arrayBuffer) { + yield await blob.arrayBuffer() + } else if (blob[asyncIterator]) { + yield* blob[asyncIterator](); + } else { + yield blob; + } +} + +export default readBlob; diff --git a/node_modules/axios/lib/helpers/resolveConfig.js b/node_modules/axios/lib/helpers/resolveConfig.js new file mode 100644 index 0000000..26bce9d --- /dev/null +++ b/node_modules/axios/lib/helpers/resolveConfig.js @@ -0,0 +1,61 @@ +import platform from "../platform/index.js"; +import utils from "../utils.js"; +import isURLSameOrigin from "./isURLSameOrigin.js"; +import cookies from "./cookies.js"; +import buildFullPath from "../core/buildFullPath.js"; +import mergeConfig from "../core/mergeConfig.js"; +import AxiosHeaders from "../core/AxiosHeaders.js"; +import buildURL from "./buildURL.js"; + +export default (config) => { + const newConfig = mergeConfig({}, config); + + let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + + newConfig.headers = headers = AxiosHeaders.from(headers); + + newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); + + // HTTP basic authentication + if (auth) { + headers.set('Authorization', 'Basic ' + + btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : '')) + ); + } + + if (utils.isFormData(data)) { + if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) { + headers.setContentType(undefined); // browser handles it + } else if (utils.isFunction(data.getHeaders)) { + // Node.js FormData (like form-data package) + const formHeaders = data.getHeaders(); + // Only set safe headers to avoid overwriting security headers + const allowedHeaders = ['content-type', 'content-length']; + Object.entries(formHeaders).forEach(([key, val]) => { + if (allowedHeaders.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); + } + } + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + + if (platform.hasStandardBrowserEnv) { + withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); + + if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) { + // Add xsrf header + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName); + + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + + return newConfig; +} + diff --git a/node_modules/axios/lib/helpers/speedometer.js b/node_modules/axios/lib/helpers/speedometer.js new file mode 100644 index 0000000..3b3c666 --- /dev/null +++ b/node_modules/axios/lib/helpers/speedometer.js @@ -0,0 +1,55 @@ +'use strict'; + +/** + * Calculate data maxRate + * @param {Number} [samplesCount= 10] + * @param {Number} [min= 1000] + * @returns {Function} + */ +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + + min = min !== undefined ? min : 1000; + + return function push(chunkLength) { + const now = Date.now(); + + const startedAt = timestamps[tail]; + + if (!firstSampleTS) { + firstSampleTS = now; + } + + bytes[head] = chunkLength; + timestamps[head] = now; + + let i = tail; + let bytesCount = 0; + + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + + head = (head + 1) % samplesCount; + + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + + if (now - firstSampleTS < min) { + return; + } + + const passed = startedAt && now - startedAt; + + return passed ? Math.round(bytesCount * 1000 / passed) : undefined; + }; +} + +export default speedometer; diff --git a/node_modules/axios/lib/helpers/spread.js b/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 0000000..13479cb --- /dev/null +++ b/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,28 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * + * @returns {Function} + */ +export default function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} diff --git a/node_modules/axios/lib/helpers/throttle.js b/node_modules/axios/lib/helpers/throttle.js new file mode 100644 index 0000000..73e263d --- /dev/null +++ b/node_modules/axios/lib/helpers/throttle.js @@ -0,0 +1,44 @@ +/** + * Throttle decorator + * @param {Function} fn + * @param {Number} freq + * @return {Function} + */ +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1000 / freq; + let lastArgs; + let timer; + + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn(...args); + } + + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if ( passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs) + }, threshold - passed); + } + } + } + + const flush = () => lastArgs && invoke(lastArgs); + + return [throttled, flush]; +} + +export default throttle; diff --git a/node_modules/axios/lib/helpers/toFormData.js b/node_modules/axios/lib/helpers/toFormData.js new file mode 100644 index 0000000..ec47d8c --- /dev/null +++ b/node_modules/axios/lib/helpers/toFormData.js @@ -0,0 +1,223 @@ +'use strict'; + +import utils from '../utils.js'; +import AxiosError from '../core/AxiosError.js'; +// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored +import PlatformFormData from '../platform/node/classes/FormData.js'; + +/** + * Determines if the given thing is a array or js object. + * + * @param {string} thing - The object or array to be visited. + * + * @returns {boolean} + */ +function isVisitable(thing) { + return utils.isPlainObject(thing) || utils.isArray(thing); +} + +/** + * It removes the brackets from the end of a string + * + * @param {string} key - The key of the parameter. + * + * @returns {string} the key without the brackets. + */ +function removeBrackets(key) { + return utils.endsWith(key, '[]') ? key.slice(0, -2) : key; +} + +/** + * It takes a path, a key, and a boolean, and returns a string + * + * @param {string} path - The path to the current key. + * @param {string} key - The key of the current object being iterated over. + * @param {string} dots - If true, the key will be rendered with dots instead of brackets. + * + * @returns {string} The path to the current key. + */ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + // eslint-disable-next-line no-param-reassign + token = removeBrackets(token); + return !dots && i ? '[' + token + ']' : token; + }).join(dots ? '.' : ''); +} + +/** + * If the array is an array and none of its elements are visitable, then it's a flat array. + * + * @param {Array} arr - The array to check + * + * @returns {boolean} + */ +function isFlatArray(arr) { + return utils.isArray(arr) && !arr.some(isVisitable); +} + +const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); + +/** + * Convert a data object to FormData + * + * @param {Object} obj + * @param {?Object} [formData] + * @param {?Object} [options] + * @param {Function} [options.visitor] + * @param {Boolean} [options.metaTokens = true] + * @param {Boolean} [options.dots = false] + * @param {?Boolean} [options.indexes = false] + * + * @returns {Object} + **/ + +/** + * It converts an object into a FormData object + * + * @param {Object} obj - The object to convert to form data. + * @param {string} formData - The FormData object to append to. + * @param {Object} options + * + * @returns + */ +function toFormData(obj, formData, options) { + if (!utils.isObject(obj)) { + throw new TypeError('target must be an object'); + } + + // eslint-disable-next-line no-param-reassign + formData = formData || new (PlatformFormData || FormData)(); + + // eslint-disable-next-line no-param-reassign + options = utils.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + // eslint-disable-next-line no-eq-null,eqeqeq + return !utils.isUndefined(source[option]); + }); + + const metaTokens = options.metaTokens; + // eslint-disable-next-line no-use-before-define + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; + const useBlob = _Blob && utils.isSpecCompliantForm(formData); + + if (!utils.isFunction(visitor)) { + throw new TypeError('visitor must be a function'); + } + + function convertValue(value) { + if (value === null) return ''; + + if (utils.isDate(value)) { + return value.toISOString(); + } + + if (utils.isBoolean(value)) { + return value.toString(); + } + + if (!useBlob && utils.isBlob(value)) { + throw new AxiosError('Blob is not supported. Use a Buffer instead.'); + } + + if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) { + return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); + } + + return value; + } + + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key + * @param {Array} path + * @this {FormData} + * + * @returns {boolean} return true to visit the each prop of the value recursively + */ + function defaultVisitor(value, key, path) { + let arr = value; + + if (value && !path && typeof value === 'object') { + if (utils.endsWith(key, '{}')) { + // eslint-disable-next-line no-param-reassign + key = metaTokens ? key : key.slice(0, -2); + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if ( + (utils.isArray(value) && isFlatArray(value)) || + ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)) + )) { + // eslint-disable-next-line no-param-reassign + key = removeBrackets(key); + + arr.forEach(function each(el, index) { + !(utils.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), + convertValue(el) + ); + }); + return false; + } + } + + if (isVisitable(value)) { + return true; + } + + formData.append(renderKey(path, key, dots), convertValue(value)); + + return false; + } + + const stack = []; + + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + + function build(value, path) { + if (utils.isUndefined(value)) return; + + if (stack.indexOf(value) !== -1) { + throw Error('Circular reference detected in ' + path.join('.')); + } + + stack.push(value); + + utils.forEach(value, function each(el, key) { + const result = !(utils.isUndefined(el) || el === null) && visitor.call( + formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers + ); + + if (result === true) { + build(el, path ? path.concat(key) : [key]); + } + }); + + stack.pop(); + } + + if (!utils.isObject(obj)) { + throw new TypeError('data must be an object'); + } + + build(obj); + + return formData; +} + +export default toFormData; diff --git a/node_modules/axios/lib/helpers/toURLEncodedForm.js b/node_modules/axios/lib/helpers/toURLEncodedForm.js new file mode 100644 index 0000000..ffa95ec --- /dev/null +++ b/node_modules/axios/lib/helpers/toURLEncodedForm.js @@ -0,0 +1,19 @@ +'use strict'; + +import utils from '../utils.js'; +import toFormData from './toFormData.js'; +import platform from '../platform/index.js'; + +export default function toURLEncodedForm(data, options) { + return toFormData(data, new platform.classes.URLSearchParams(), { + visitor: function(value, key, path, helpers) { + if (platform.isNode && utils.isBuffer(value)) { + this.append(key, value.toString('base64')); + return false; + } + + return helpers.defaultVisitor.apply(this, arguments); + }, + ...options + }); +} diff --git a/node_modules/axios/lib/helpers/trackStream.js b/node_modules/axios/lib/helpers/trackStream.js new file mode 100644 index 0000000..95d6008 --- /dev/null +++ b/node_modules/axios/lib/helpers/trackStream.js @@ -0,0 +1,87 @@ + +export const streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + + let pos = 0; + let end; + + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +} + +export const readBytes = async function* (iterable, chunkSize) { + for await (const chunk of readStream(iterable)) { + yield* streamChunk(chunk, chunkSize); + } +} + +const readStream = async function* (stream) { + if (stream[Symbol.asyncIterator]) { + yield* stream; + return; + } + + const reader = stream.getReader(); + try { + for (;;) { + const {done, value} = await reader.read(); + if (done) { + break; + } + yield value; + } + } finally { + await reader.cancel(); + } +} + +export const trackStream = (stream, chunkSize, onProgress, onFinish) => { + const iterator = readBytes(stream, chunkSize); + + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + } + + return new ReadableStream({ + async pull(controller) { + try { + const {done, value} = await iterator.next(); + + if (done) { + _onFinish(); + controller.close(); + return; + } + + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator.return(); + } + }, { + highWaterMark: 2 + }) +} diff --git a/node_modules/axios/lib/helpers/validator.js b/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 0000000..1270568 --- /dev/null +++ b/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,99 @@ +'use strict'; + +import {VERSION} from '../env/data.js'; +import AxiosError from '../core/AxiosError.js'; + +const validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +const deprecatedWarnings = {}; + +/** + * Transitional option validator + * + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError( + formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), + AxiosError.ERR_DEPRECATED + ); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +validators.spelling = function spelling(correctSpelling) { + return (value, opt) => { + // eslint-disable-next-line no-console + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + } +}; + +/** + * Assert object's properties type + * + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + * + * @returns {object} + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = schema[opt]; + if (validator) { + const value = options[opt]; + const result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION); + } + } +} + +export default { + assertOptions, + validators +}; diff --git a/node_modules/axios/lib/platform/browser/classes/Blob.js b/node_modules/axios/lib/platform/browser/classes/Blob.js new file mode 100644 index 0000000..6c506c4 --- /dev/null +++ b/node_modules/axios/lib/platform/browser/classes/Blob.js @@ -0,0 +1,3 @@ +'use strict' + +export default typeof Blob !== 'undefined' ? Blob : null diff --git a/node_modules/axios/lib/platform/browser/classes/FormData.js b/node_modules/axios/lib/platform/browser/classes/FormData.js new file mode 100644 index 0000000..f36d31b --- /dev/null +++ b/node_modules/axios/lib/platform/browser/classes/FormData.js @@ -0,0 +1,3 @@ +'use strict'; + +export default typeof FormData !== 'undefined' ? FormData : null; diff --git a/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js b/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js new file mode 100644 index 0000000..b7dae95 --- /dev/null +++ b/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js @@ -0,0 +1,4 @@ +'use strict'; + +import AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js'; +export default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams; diff --git a/node_modules/axios/lib/platform/browser/index.js b/node_modules/axios/lib/platform/browser/index.js new file mode 100644 index 0000000..08c206f --- /dev/null +++ b/node_modules/axios/lib/platform/browser/index.js @@ -0,0 +1,13 @@ +import URLSearchParams from './classes/URLSearchParams.js' +import FormData from './classes/FormData.js' +import Blob from './classes/Blob.js' + +export default { + isBrowser: true, + classes: { + URLSearchParams, + FormData, + Blob + }, + protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] +}; diff --git a/node_modules/axios/lib/platform/common/utils.js b/node_modules/axios/lib/platform/common/utils.js new file mode 100644 index 0000000..52a3186 --- /dev/null +++ b/node_modules/axios/lib/platform/common/utils.js @@ -0,0 +1,51 @@ +const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; + +const _navigator = typeof navigator === 'object' && navigator || undefined; + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + * + * @returns {boolean} + */ +const hasStandardBrowserEnv = hasBrowserEnv && + (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0); + +/** + * Determine if we're running in a standard browser webWorker environment + * + * Although the `isStandardBrowserEnv` method indicates that + * `allows axios to run in a web worker`, the WebWorker will still be + * filtered out due to its judgment standard + * `typeof window !== 'undefined' && typeof document !== 'undefined'`. + * This leads to a problem when axios post `FormData` in webWorker + */ +const hasStandardBrowserWebWorkerEnv = (() => { + return ( + typeof WorkerGlobalScope !== 'undefined' && + // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && + typeof self.importScripts === 'function' + ); +})(); + +const origin = hasBrowserEnv && window.location.href || 'http://localhost'; + +export { + hasBrowserEnv, + hasStandardBrowserWebWorkerEnv, + hasStandardBrowserEnv, + _navigator as navigator, + origin +} diff --git a/node_modules/axios/lib/platform/index.js b/node_modules/axios/lib/platform/index.js new file mode 100644 index 0000000..860ba21 --- /dev/null +++ b/node_modules/axios/lib/platform/index.js @@ -0,0 +1,7 @@ +import platform from './node/index.js'; +import * as utils from './common/utils.js'; + +export default { + ...utils, + ...platform +} diff --git a/node_modules/axios/lib/platform/node/classes/FormData.js b/node_modules/axios/lib/platform/node/classes/FormData.js new file mode 100644 index 0000000..b07f947 --- /dev/null +++ b/node_modules/axios/lib/platform/node/classes/FormData.js @@ -0,0 +1,3 @@ +import FormData from 'form-data'; + +export default FormData; diff --git a/node_modules/axios/lib/platform/node/classes/URLSearchParams.js b/node_modules/axios/lib/platform/node/classes/URLSearchParams.js new file mode 100644 index 0000000..fba5842 --- /dev/null +++ b/node_modules/axios/lib/platform/node/classes/URLSearchParams.js @@ -0,0 +1,4 @@ +'use strict'; + +import url from 'url'; +export default url.URLSearchParams; diff --git a/node_modules/axios/lib/platform/node/index.js b/node_modules/axios/lib/platform/node/index.js new file mode 100644 index 0000000..cd1ca0c --- /dev/null +++ b/node_modules/axios/lib/platform/node/index.js @@ -0,0 +1,38 @@ +import crypto from 'crypto'; +import URLSearchParams from './classes/URLSearchParams.js' +import FormData from './classes/FormData.js' + +const ALPHA = 'abcdefghijklmnopqrstuvwxyz' + +const DIGIT = '0123456789'; + +const ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +} + +const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ''; + const {length} = alphabet; + const randomValues = new Uint32Array(size); + crypto.randomFillSync(randomValues); + for (let i = 0; i < size; i++) { + str += alphabet[randomValues[i] % length]; + } + + return str; +} + + +export default { + isNode: true, + classes: { + URLSearchParams, + FormData, + Blob: typeof Blob !== 'undefined' && Blob || null + }, + ALPHABET, + generateString, + protocols: [ 'http', 'https', 'file', 'data' ] +}; diff --git a/node_modules/axios/lib/utils.js b/node_modules/axios/lib/utils.js new file mode 100644 index 0000000..ade8309 --- /dev/null +++ b/node_modules/axios/lib/utils.js @@ -0,0 +1,782 @@ +'use strict'; + +import bind from './helpers/bind.js'; + +// utils is a library of generic helper functions non-specific to axios + +const {toString} = Object.prototype; +const {getPrototypeOf} = Object; +const {iterator, toStringTag} = Symbol; + +const kindOf = (cache => thing => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(Object.create(null)); + +const kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type +} + +const typeOfTest = type => thing => typeof thing === type; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * + * @returns {boolean} True if value is an Array, otherwise false + */ +const {isArray} = Array; + +/** + * Determine if a value is undefined + * + * @param {*} val The value to test + * + * @returns {boolean} True if the value is undefined, otherwise false + */ +const isUndefined = typeOfTest('undefined'); + +/** + * Determine if a value is a Buffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +const isArrayBuffer = kindOfTest('ArrayBuffer'); + + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + let result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a String, otherwise false + */ +const isString = typeOfTest('string'); + +/** + * Determine if a value is a Function + * + * @param {*} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +const isFunction = typeOfTest('function'); + +/** + * Determine if a value is a Number + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Number, otherwise false + */ +const isNumber = typeOfTest('number'); + +/** + * Determine if a value is an Object + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an Object, otherwise false + */ +const isObject = (thing) => thing !== null && typeof thing === 'object'; + +/** + * Determine if a value is a Boolean + * + * @param {*} thing The value to test + * @returns {boolean} True if value is a Boolean, otherwise false + */ +const isBoolean = thing => thing === true || thing === false; + +/** + * Determine if a value is a plain Object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a plain Object, otherwise false + */ +const isPlainObject = (val) => { + if (kindOf(val) !== 'object') { + return false; + } + + const prototype = getPrototypeOf(val); + return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val); +} + +/** + * Determine if a value is an empty object (safely handles Buffers) + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is an empty object, otherwise false + */ +const isEmptyObject = (val) => { + // Early return for non-objects or Buffers to prevent RangeError + if (!isObject(val) || isBuffer(val)) { + return false; + } + + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + // Fallback for any other objects that might cause RangeError with Object.keys() + return false; + } +} + +/** + * Determine if a value is a Date + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Date, otherwise false + */ +const isDate = kindOfTest('Date'); + +/** + * Determine if a value is a File + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFile = kindOfTest('File'); + +/** + * Determine if a value is a Blob + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Blob, otherwise false + */ +const isBlob = kindOfTest('Blob'); + +/** + * Determine if a value is a FileList + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a File, otherwise false + */ +const isFileList = kindOfTest('FileList'); + +/** + * Determine if a value is a Stream + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a Stream, otherwise false + */ +const isStream = (val) => isObject(val) && isFunction(val.pipe); + +/** + * Determine if a value is a FormData + * + * @param {*} thing The value to test + * + * @returns {boolean} True if value is an FormData, otherwise false + */ +const isFormData = (thing) => { + let kind; + return thing && ( + (typeof FormData === 'function' && thing instanceof FormData) || ( + isFunction(thing.append) && ( + (kind = kindOf(thing)) === 'formdata' || + // detect form-data instance + (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') + ) + ) + ) +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +const isURLSearchParams = kindOfTest('URLSearchParams'); + +const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest); + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * + * @returns {String} The String freed of excess whitespace + */ +const trim = (str) => str.trim ? + str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + * + * @param {Boolean} [allOwnKeys = false] + * @returns {any} + */ +function forEach(obj, fn, {allOwnKeys = false} = {}) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + let i; + let l; + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Buffer check + if (isBuffer(obj)) { + return; + } + + // Iterate over object keys + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} + +function findKey(obj, key) { + if (isBuffer(obj)){ + return null; + } + + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} + +const _global = (() => { + /*eslint no-undef:0*/ + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) +})(); + +const isContextDefined = (context) => !isUndefined(context) && context !== _global; + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + const {caseless, skipUndefined} = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + const targetKey = caseless && findKey(result, key) || key; + if (isPlainObject(result[targetKey]) && isPlainObject(val)) { + result[targetKey] = merge(result[targetKey], val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else if (!skipUndefined || !isUndefined(val)) { + result[targetKey] = val; + } + } + + for (let i = 0, l = arguments.length; i < l; i++) { + arguments[i] && forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * + * @param {Boolean} [allOwnKeys] + * @returns {Object} The resulting value of object a + */ +const extend = (a, b, thisArg, {allOwnKeys}= {}) => { + forEach(b, (val, key) => { + if (thisArg && isFunction(val)) { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }, {allOwnKeys}); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * + * @returns {string} content value without BOM + */ +const stripBOM = (content) => { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +/** + * Inherit the prototype methods from one constructor into another + * @param {function} constructor + * @param {function} superConstructor + * @param {object} [props] + * @param {object} [descriptors] + * + * @returns {void} + */ +const inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + constructor.prototype.constructor = constructor; + Object.defineProperty(constructor, 'super', { + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +} + +/** + * Resolve object with deep prototype chain to a flat object + * @param {Object} sourceObj source object + * @param {Object} [destObj] + * @param {Function|Boolean} [filter] + * @param {Function} [propFilter] + * + * @returns {Object} + */ +const toFlatObject = (sourceObj, destObj, filter, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + + destObj = destObj || {}; + // eslint-disable-next-line no-eq-null,eqeqeq + if (sourceObj == null) return destObj; + + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); + + return destObj; +} + +/** + * Determines whether a string ends with the characters of a specified string + * + * @param {String} str + * @param {String} searchString + * @param {Number} [position= 0] + * + * @returns {boolean} + */ +const endsWith = (str, searchString, position) => { + str = String(str); + if (position === undefined || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +} + + +/** + * Returns new array from array like object or null if failed + * + * @param {*} [thing] + * + * @returns {?Array} + */ +const toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +} + +/** + * Checking if the Uint8Array exists and if it does, it returns a function that checks if the + * thing passed in is an instance of Uint8Array + * + * @param {TypedArray} + * + * @returns {Array} + */ +// eslint-disable-next-line func-names +const isTypedArray = (TypedArray => { + // eslint-disable-next-line func-names + return thing => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); + +/** + * For each entry in the object, call the function with the key and value. + * + * @param {Object} obj - The object to iterate over. + * @param {Function} fn - The function to call for each entry. + * + * @returns {void} + */ +const forEachEntry = (obj, fn) => { + const generator = obj && obj[iterator]; + + const _iterator = generator.call(obj); + + let result; + + while ((result = _iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +} + +/** + * It takes a regular expression and a string, and returns an array of all the matches + * + * @param {string} regExp - The regular expression to match against. + * @param {string} str - The string to search. + * + * @returns {Array} + */ +const matchAll = (regExp, str) => { + let matches; + const arr = []; + + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + + return arr; +} + +/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ +const isHTMLForm = kindOfTest('HTMLFormElement'); + +const toCamelCase = str => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, + function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + } + ); +}; + +/* Creating a function that will check if an object has a property. */ +const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); + +/** + * Determine if a value is a RegExp object + * + * @param {*} val The value to test + * + * @returns {boolean} True if value is a RegExp object, otherwise false + */ +const isRegExp = kindOfTest('RegExp'); + +const reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + + Object.defineProperties(obj, reducedDescriptors); +} + +/** + * Makes all methods read-only + * @param {Object} obj + */ + +const freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + // skip restricted props in strict mode + if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { + return false; + } + + const value = obj[name]; + + if (!isFunction(value)) return; + + descriptor.enumerable = false; + + if ('writable' in descriptor) { + descriptor.writable = false; + return; + } + + if (!descriptor.set) { + descriptor.set = () => { + throw Error('Can not rewrite read-only method \'' + name + '\''); + }; + } + }); +} + +const toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + + const define = (arr) => { + arr.forEach(value => { + obj[value] = true; + }); + } + + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + + return obj; +} + +const noop = () => {} + +const toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; +} + + + +/** + * If the thing is a FormData object, return true, otherwise return false. + * + * @param {unknown} thing - The thing to check. + * + * @returns {boolean} + */ +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]); +} + +const toJSONObject = (obj) => { + const stack = new Array(10); + + const visit = (source, i) => { + + if (isObject(source)) { + if (stack.indexOf(source) >= 0) { + return; + } + + //Buffer check + if (isBuffer(source)) { + return source; + } + + if(!('toJSON' in source)) { + stack[i] = source; + const target = isArray(source) ? [] : {}; + + forEach(source, (value, key) => { + const reducedValue = visit(value, i + 1); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + + stack[i] = undefined; + + return target; + } + } + + return source; + } + + return visit(obj, 0); +} + +const isAsyncFn = kindOfTest('AsyncFunction'); + +const isThenable = (thing) => + thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); + +// original code +// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34 + +const _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener("message", ({source, data}) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, false); + + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + } + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})( + typeof setImmediate === 'function', + isFunction(_global.postMessage) +); + +const asap = typeof queueMicrotask !== 'undefined' ? + queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate); + +// ********************* + + +const isIterable = (thing) => thing != null && isFunction(thing[iterator]); + + +export default { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isEmptyObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap, + isIterable +}; diff --git a/node_modules/axios/package.json b/node_modules/axios/package.json new file mode 100644 index 0000000..f85fdb4 --- /dev/null +++ b/node_modules/axios/package.json @@ -0,0 +1,239 @@ +{ + "name": "axios", + "version": "1.13.2", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "exports": { + ".": { + "types": { + "require": "./index.d.cts", + "default": "./index.d.ts" + }, + "react-native": { + "require": "./dist/browser/axios.cjs", + "default": "./dist/esm/axios.js" + }, + "browser": { + "require": "./dist/browser/axios.cjs", + "default": "./index.js" + }, + "default": { + "require": "./dist/node/axios.cjs", + "default": "./index.js" + } + }, + "./lib/adapters/http.js": "./lib/adapters/http.js", + "./lib/adapters/xhr.js": "./lib/adapters/xhr.js", + "./unsafe/*": "./lib/*", + "./unsafe/core/settle.js": "./lib/core/settle.js", + "./unsafe/core/buildFullPath.js": "./lib/core/buildFullPath.js", + "./unsafe/helpers/isAbsoluteURL.js": "./lib/helpers/isAbsoluteURL.js", + "./unsafe/helpers/buildURL.js": "./lib/helpers/buildURL.js", + "./unsafe/helpers/combineURLs.js": "./lib/helpers/combineURLs.js", + "./unsafe/adapters/http.js": "./lib/adapters/http.js", + "./unsafe/adapters/xhr.js": "./lib/adapters/xhr.js", + "./unsafe/utils.js": "./lib/utils.js", + "./package.json": "./package.json", + "./dist/browser/axios.cjs": "./dist/browser/axios.cjs", + "./dist/node/axios.cjs": "./dist/node/axios.cjs" + }, + "type": "module", + "types": "index.d.ts", + "scripts": { + "test": "npm run test:node && npm run test:browser && npm run test:package", + "test:node": "npm run test:mocha", + "test:browser": "npm run test:karma", + "test:package": "npm run test:eslint && npm run test:dtslint && npm run test:exports", + "test:eslint": "node bin/ssl_hotfix.js eslint lib/**/*.js", + "test:dtslint": "dtslint --localTs node_modules/typescript/lib", + "test:mocha": "node bin/ssl_hotfix.js mocha test/unit/**/*.js --timeout 30000 --exit", + "test:exports": "node bin/ssl_hotfix.js mocha test/module/test.js --timeout 30000 --exit", + "test:karma": "node ./bin/run-karma-tests.js", + "test:karma:firefox": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: Browsers=Firefox karma start karma.conf.cjs --single-run", + "test:karma:server": "node bin/ssl_hotfix.js cross-env karma start karma.conf.cjs", + "test:build:version": "node ./bin/check-build-version.js", + "start": "node ./sandbox/server.js", + "preversion": "gulp version", + "version": "npm run build && git add package.json", + "prepublishOnly": "npm run test:build:version", + "postpublish": "git push && git push --tags", + "build": "gulp clear && cross-env NODE_ENV=production rollup -c -m", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js", + "prepare": "husky install && npm run prepare:hooks", + "prepare:hooks": "npx husky set .husky/commit-msg \"npx commitlint --edit $1\"", + "release:dry": "release-it --dry-run --no-npm", + "release:info": "release-it --release-version", + "release:beta:no-npm": "release-it --preRelease=beta --no-npm", + "release:beta": "release-it --preRelease=beta", + "release:no-npm": "release-it --no-npm", + "release:changelog:fix": "node ./bin/injectContributorsList.js && git add CHANGELOG.md", + "release": "release-it" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node", + "browser", + "fetch", + "rest", + "api", + "client" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "@babel/core": "^7.23.9", + "@babel/preset-env": "^7.23.9", + "@commitlint/cli": "^17.8.1", + "@commitlint/config-conventional": "^17.8.1", + "@release-it/conventional-changelog": "^5.1.1", + "@rollup/plugin-alias": "^5.1.0", + "@rollup/plugin-babel": "^5.3.1", + "@rollup/plugin-commonjs": "^15.1.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "abortcontroller-polyfill": "^1.7.5", + "auto-changelog": "^2.4.0", + "body-parser": "^1.20.2", + "chalk": "^5.3.0", + "coveralls": "^3.1.1", + "cross-env": "^7.0.3", + "dev-null": "^0.1.1", + "dtslint": "^4.2.1", + "es6-promise": "^4.2.8", + "eslint": "^8.56.0", + "express": "^4.18.2", + "formdata-node": "^5.0.1", + "formidable": "^2.1.2", + "fs-extra": "^10.1.0", + "get-stream": "^3.0.0", + "gulp": "^4.0.2", + "handlebars": "^4.7.8", + "husky": "^8.0.3", + "istanbul-instrumenter-loader": "^3.0.1", + "jasmine-core": "^2.99.1", + "karma": "^6.3.17", + "karma-chrome-launcher": "^3.2.0", + "karma-firefox-launcher": "^2.1.2", + "karma-jasmine": "^1.1.2", + "karma-jasmine-ajax": "^0.1.13", + "karma-rollup-preprocessor": "^7.0.8", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "memoizee": "^0.4.15", + "minimist": "^1.2.8", + "mocha": "^10.3.0", + "multer": "^1.4.4", + "pacote": "^20.0.0", + "pretty-bytes": "^6.1.1", + "release-it": "^15.11.0", + "rollup": "^2.79.1", + "rollup-plugin-auto-external": "^2.0.0", + "rollup-plugin-bundle-size": "^1.0.3", + "rollup-plugin-terser": "^7.0.2", + "selfsigned": "^3.0.1", + "sinon": "^4.5.0", + "stream-throttle": "^0.1.3", + "string-replace-async": "^3.0.2", + "tar-stream": "^3.1.7", + "typescript": "^4.9.5" + }, + "browser": { + "./lib/adapters/http.js": "./lib/helpers/null.js", + "./lib/platform/node/index.js": "./lib/platform/browser/index.js", + "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js" + }, + "react-native": { + "./lib/adapters/http.js": "./lib/helpers/null.js", + "./lib/platform/node/index.js": "./lib/platform/browser/index.js", + "./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ], + "contributors": [ + "Matt Zabriskie (https://github.com/mzabriskie)", + "Dmitriy Mozgovoy (https://github.com/DigitalBrainJS)", + "Nick Uraltsev (https://github.com/nickuraltsev)", + "Jay (https://github.com/jasonsaayman)", + "Emily Morehouse (https://github.com/emilyemorehouse)", + "Rubén Norte (https://github.com/rubennorte)", + "Justin Beckwith (https://github.com/JustinBeckwith)", + "Martti Laine (https://github.com/codeclown)", + "Xianming Zhong (https://github.com/chinesedfan)", + "Remco Haszing (https://github.com/remcohaszing)", + "Rikki Gibson (https://github.com/RikkiGibson)", + "Willian Agostini (https://github.com/WillianAgostini)", + "Ben Carp (https://github.com/carpben)" + ], + "sideEffects": false, + "release-it": { + "git": { + "commitMessage": "chore(release): v${version}", + "push": true, + "commit": true, + "tag": true, + "requireCommits": false, + "requireCleanWorkingDir": false + }, + "github": { + "release": true, + "draft": true + }, + "npm": { + "publish": false, + "ignoreVersion": false + }, + "plugins": { + "@release-it/conventional-changelog": { + "preset": "angular", + "infile": "CHANGELOG.md", + "header": "# Changelog" + } + }, + "hooks": { + "before:init": "npm test", + "after:bump": "gulp version --bump ${version} && npm run build && npm run test:build:version", + "before:release": "npm run release:changelog:fix && git add ./package-lock.json", + "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}." + } + }, + "commitlint": { + "rules": { + "header-max-length": [ + 2, + "always", + 130 + ] + }, + "extends": [ + "@commitlint/config-conventional" + ] + } +} \ No newline at end of file diff --git a/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/balanced-match/.github/FUNDING.yml new file mode 100644 index 0000000..cea8b16 --- /dev/null +++ b/node_modules/balanced-match/.github/FUNDING.yml @@ -0,0 +1,2 @@ +tidelift: "npm/balanced-match" +patreon: juliangruber diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000..2cdc8e4 --- /dev/null +++ b/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md new file mode 100644 index 0000000..d2a48b6 --- /dev/null +++ b/node_modules/balanced-match/README.md @@ -0,0 +1,97 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[
, ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/index.js b/node_modules/balanced-match/index.js new file mode 100644 index 0000000..c67a646 --- /dev/null +++ b/node_modules/balanced-match/index.js @@ -0,0 +1,62 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json new file mode 100644 index 0000000..ce6073e --- /dev/null +++ b/node_modules/balanced-match/package.json @@ -0,0 +1,48 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "1.0.2", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "tape test/test.js", + "bench": "matcha test/bench.js" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + } +} diff --git a/node_modules/baseline-browser-mapping/LICENSE.txt b/node_modules/baseline-browser-mapping/LICENSE.txt new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/node_modules/baseline-browser-mapping/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/baseline-browser-mapping/README.md b/node_modules/baseline-browser-mapping/README.md new file mode 100644 index 0000000..3011363 --- /dev/null +++ b/node_modules/baseline-browser-mapping/README.md @@ -0,0 +1,463 @@ +# [`baseline-browser-mapping`](https://github.com/web-platform-dx/web-features/packages/baseline-browser-mapping) + +By the [W3C WebDX Community Group](https://www.w3.org/community/webdx/) and contributors. + +`baseline-browser-mapping` provides: + +- An `Array` of browsers compatible with Baseline Widely available and Baseline year feature sets via the [`getCompatibleVersions()` function](#get-baseline-widely-available-browser-versions-or-baseline-year-browser-versions). +- An `Array`, `Object` or `CSV` as a string describing the Baseline feature set support of all browser versions included in the module's data set via the [`getAllVersions()` function](#get-data-for-all-browser-versions). + +You can use `baseline-browser-mapping` to help you determine minimum browser version support for your chosen Baseline feature set; or to analyse the level of support for different Baseline feature sets in your site's traffic by joining the data with your analytics data. + +## Install for local development + +To install the package, run: + +`npm install --save-dev baseline-browser-mapping` + +`baseline-browser-mapping` depends on `web-features` and `@mdn/browser-compat-data` for core browser version selection, but the data is pre-packaged and minified. This package checks for updates to those modules and the supported [downstream browsers](#downstream-browsers) on a daily basis and is updated frequently. Consider adding a script to your `package.json` to update `baseline-browser-mapping` and using it as part of your build process to ensure your data is as up to date as possible: + +```javascript +"scripts": [ + "refresh-baseline-browser-mapping": "npm i --save-dev baseline-browser-mapping@latest" +] +``` + +The minimum supported NodeJS version for `baseline-browser-mapping` is v8 in alignment with `browserslist`. For NodeJS versions earlier than v13.2, the [`require('baseline-browser-mapping')`](https://nodejs.org/api/modules.html#requireid) syntax should be used to import the module. + +## Keeping `baseline-browser-mapping` up to date + +If you are only using this module to generate minimum browser versions for Baseline Widely available or Baseline year feature sets, you don't need to update this module frequently, as the backward looking data is reasonably stable. + +However, if you are targeting Newly available, using the [`getAllVersions()`](#get-data-for-all-browser-versions) function or heavily relying on the data for downstream browsers, you should update this module more frequently. If you target a feature cut off date within the last two months and your installed version of `baseline-browser-mapping` has data that is more than 2 months old, you will receive a console warning advising you to update to the latest version when you call `getCompatibleVersions()` or `getAllVersions()`. + +If you want to suppress these warnings you can use the `suppressWarnings: true` option in the configuration object passed to `getCompatibleVersions()` or `getAllVersions()`. Alternatively, you can use the `BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA=true` environment variable when running your build process. This module also respects the `BROWSERSLIST_IGNORE_OLD_DATA=true` environment variable. Environment variables can also be provided in a `.env` file from Node 20 onwards; however, this module does not load .env files automatically to avoid conflicts with other libraries with different requirements. You will need to use `process.loadEnvFile()` or a library like `dotenv` to load .env files before `baseline-browser-mapping` is called. + +If you want to ensure [reproducible builds](https://www.wikiwand.com/en/articles/Reproducible_builds), we strongly recommend using the `widelyAvailableOnDate` option to fix the Widely available date on a per build basis to ensure dependent tools provide the same output and you do not produce data staleness warnings. If you are using [`browserslist`](https://github.com/browserslist/browserslist) to target Baseline Widely available, consider automatically updating your `browserslist` configuration in `package.json` or `.browserslistrc` to `baseline widely available on {YYYY-MM-DD}` as part of your build process to ensure the same or sufficiently similar list of minimum browsers is reproduced for historical builds. + +## Importing `baseline-browser-mapping` + +This module exposes two functions: `getCompatibleVersions()` and `getAllVersions()`, both which can be imported directly from `baseline-browser-mapping`: + +```javascript +import { + getCompatibleVersions, + getAllVersions, +} from "baseline-browser-mapping"; +``` + +If you want to load the script and data directly in a web page without hosting it yourself, consider using a CDN: + +```html + +``` + +## Get Baseline Widely available browser versions or Baseline year browser versions + +To get the current list of minimum browser versions compatible with Baseline Widely available features from the core browser set, call the `getCompatibleVersions()` function: + +```javascript +getCompatibleVersions(); +``` + +Executed on 7th March 2025, the above code returns the following browser versions: + +```javascript +[ + { browser: "chrome", version: "105", release_date: "2022-09-02" }, + { + browser: "chrome_android", + version: "105", + release_date: "2022-09-02", + }, + { browser: "edge", version: "105", release_date: "2022-09-02" }, + { browser: "firefox", version: "104", release_date: "2022-08-23" }, + { + browser: "firefox_android", + version: "104", + release_date: "2022-08-23", + }, + { browser: "safari", version: "15.6", release_date: "2022-09-02" }, + { + browser: "safari_ios", + version: "15.6", + release_date: "2022-09-02", + }, +]; +``` + +> [!NOTE] +> The minimum versions of each browser are not necessarily the final release before the Widely available cutoff date of `TODAY - 30 MONTHS`. Some earlier versions will have supported the full Widely available feature set. + +### `getCompatibleVersions()` configuration options + +`getCompatibleVersions()` accepts an `Object` as an argument with configuration options. The defaults are as follows: + +```javascript +{ + targetYear: undefined, + widelyAvailableOnDate: undefined, + includeDownstreamBrowsers: false, + listAllCompatibleVersions: false, + suppressWarnings: false +} +``` + +#### `targetYear` + +The `targetYear` option returns the minimum browser versions compatible with all **Baseline Newly available** features at the end of the specified calendar year. For example, calling: + +```javascript +getCompatibleVersions({ + targetYear: 2020, +}); +``` + +Returns the following versions: + +```javascript +[ + { browser: "chrome", version: "87", release_date: "2020-11-19" }, + { + browser: "chrome_android", + version: "87", + release_date: "2020-11-19", + }, + { browser: "edge", version: "87", release_date: "2020-11-19" }, + { browser: "firefox", version: "83", release_date: "2020-11-17" }, + { + browser: "firefox_android", + version: "83", + release_date: "2020-11-17", + }, + { browser: "safari", version: "14", release_date: "2020-09-16" }, + { browser: "safari_ios", version: "14", release_date: "2020-09-16" }, +]; +``` + +> [!NOTE] +> The minimum version of each browser is not necessarily the final version released in that calendar year. In the above example, Firefox 84 was the final version released in 2020; however Firefox 83 supported all of the features that were interoperable at the end of 2020. +> [!WARNING] +> You cannot use `targetYear` and `widelyAavailableDate` together. Please only use one of these options at a time. + +#### `widelyAvailableOnDate` + +The `widelyAvailableOnDate` option returns the minimum versions compatible with Baseline Widely available on a specified date in the format `YYYY-MM-DD`: + +```javascript +getCompatibleVersions({ + widelyAvailableOnDate: `2023-04-05`, +}); +``` + +> [!TIP] +> This option is useful if you provide a versioned library that targets Baseline Widely available on each version's release date and you need to provide a statement on minimum supported browser versions in your documentation. + +#### `includeDownstreamBrowsers` + +Setting `includeDownstreamBrowsers` to `true` will include browsers outside of the Baseline core browser set where it is possible to map those browsers to an upstream Chromium or Gecko version: + +```javascript +getCompatibleVersions({ + includeDownstreamBrowsers: true, +}); +``` + +For more information on downstream browsers, see [the section on downstream browsers](#downstream-browsers) below. + +#### `includeKaiOS` + +KaiOS is an operating system and app framework based on the Gecko engine from Firefox. KaiOS is based on the Gecko engine and feature support can be derived from the upstream Gecko version that each KaiOS version implements. However KaiOS requires other considerations beyond feature compatibility to ensure a good user experience as it runs on device types that do not have either mouse and keyboard or touch screen input in the way that all the other browsers supported by this module do. + +```javascript +getCompatibleVersions({ + includeDownstreamBrowsers: true, + includeKaiOS: true, +}); +``` + +> [!NOTE] +> Including KaiOS requires you to include all downstream browsers using the `includeDownstreamBrowsers` option. + +#### `listAllCompatibleVersions` + +Setting `listAllCompatibleVersions` to true will include the minimum versions of each compatible browser, and all the subsequent versions: + +```javascript +getCompatibleVersions({ + listAllCompatibleVersions: true, +}); +``` + +#### `suppressWarnings` + +Setting `suppressWarnings` to `true` will suppress the console warning about old data: + +```javascript +getCompatibleVersions({ + suppressWarnings: true, +}); +``` + +## Get data for all browser versions + +You may want to obtain data on all the browser versions available in this module for use in an analytics solution or dashboard. To get details of each browser version's level of Baseline support, call the `getAllVersions()` function: + +```javascript +import { getAllVersions } from "baseline-browser-mapping"; + +getAllVersions(); +``` + +By default, this function returns an `Array` of `Objects` and excludes downstream browsers: + +```javascript +[ + ... + { + browser: "firefox_android", // Browser name + version: "125", // Browser version + release_date: "2024-04-16", // Release date + year: 2023, // Baseline year feature set the version supports + wa_compatible: true // Whether the browser version supports Widely available + }, + ... +] +``` + +For browser versions in `@mdn/browser-compat-data` that were released before Baseline can be defined, i.e. Baseline 2015, the `year` property is always the string: `"pre_baseline"`. + +### Understanding which browsers support Newly available features + +You may want to understand which recent browser versions support all Newly available features. You can replace the `wa_compatible` property with a `supports` property using the `useSupport` option: + +```javascript +getAllVersions({ + useSupports: true, +}); +``` + +The `supports` property is optional and has two possible values: + +- `widely` for browser versions that support all Widely available features. +- `newly` for browser versions that support all Newly available features. + +Browser versions that do not support Widely or Newly available will not include the `support` property in the `array` or `object` outputs, and in the CSV output, the `support` column will contain an empty string. Browser versions that support all Newly available features also support all Widely available features. + +### `getAllVersions()` Configuration options + +`getAllVersions()` accepts an `Object` as an argument with configuration options. The defaults are as follows: + +```javascript +{ + includeDownstreamBrowsers: false, + outputFormat: "array", + suppressWarnings: false +} +``` + +#### `includeDownstreamBrowsers` (in `getAllVersions()` output) + +As with `getCompatibleVersions()`, you can set `includeDownstreamBrowsers` to `true` to include the Chromium and Gecko downstream browsers [listed below](#list-of-downstream-browsers). + +```javascript +getAllVersions({ + includeDownstreamBrowsers: true, +}); +``` + +Downstream browsers include the same properties as core browsers, as well as the `engine`they use and `engine_version`, for example: + +```javascript +[ + ... + { + browser: "samsunginternet_android", + version: "27.0", + release_date: "2024-11-06", + engine: "Blink", + engine_version: "125", + year: 2023, + supports: "widely" + }, + ... +] +``` + +#### `includeKaiOS` (in `getAllVersions()` output) + +As with `getCompatibleVersions()` you can include KaiOS in your output. The same requirement to have `includeDownstreamBrowsers: true` applies. + +```javascript +getAllVersions({ + includeDownstreamBrowsers: true, + includeKaiOS: true, +}); +``` + +#### `suppressWarnings` (in `getAllVersions()` output) + +As with `getCompatibleVersions()`, you can set `suppressWarnings` to `true` to suppress the console warning about old data: + +```javascript +getAllVersions({ + suppressWarnings: true, +}); +``` + +#### `outputFormat` + +By default, this function returns an `Array` of `Objects` which can be manipulated in Javascript or output to JSON. + +To return an `Object` that nests keys , set `outputFormat` to `object`: + +```javascript +getAllVersions({ + outputFormat: "object", +}); +``` + +In thise case, `getAllVersions()` returns a nested object with the browser [IDs listed below](#list-of-downstream-browsers) as keys, and versions as keys within them: + +```javascript +{ + "chrome": { + "53": { + "year": 2016, + "release_date": "2016-09-07" + }, + ... +} +``` + +Downstream browsers will include extra fields for `engine` and `engine_versions` + +```javascript +{ + ... + "webview_android": { + "53": { + "year": 2016, + "release_date": "2016-09-07", + "engine": "Blink", + "engine_version": "53" + }, + ... +} +``` + +To return a `String` in CSV format, set `outputFormat` to `csv`: + +```javascript +getAllVersions({ + outputFormat: "csv", +}); +``` + +`getAllVersions` returns a `String` with a header row and comma-separated values for each browser version that you can write to a file or pass to another service. Core browsers will have "NULL" as the value for their `engine` and `engine_version`: + +```csv +"browser","version","year","supports","release_date","engine","engine_version" +... +"chrome","24","pre_baseline","","2013-01-10","NULL","NULL" +... +"chrome","53","2016","","2016-09-07","NULL","NULL" +... +"firefox","135","2024","widely","2025-02-04","NULL","NULL" +"firefox","136","2024","newly","2025-03-04","NULL","NULL" +... +"ya_android","20.12","2020","year_only","2020-12-20","Blink","87" +... +``` + +> [!NOTE] +> The above example uses `"includeDownstreamBrowsers": true` + +### Static resources + +The outputs of `getAllVersions()` are available as JSON or CSV files generated on a daily basis and hosted on GitHub pages: + +- Core browsers only + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_array.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_object.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions.csv) +- Core browsers only, with `supports` property + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_array_with_supports.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_object_with_supports.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/all_versions_with_supports.csv) +- Including downstream browsers + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_array.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_object.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions.csv) +- Including downstream browsers with `supports` property + - [Array](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_array_with_supports.json) + - [Object](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_object_with_supports.json) + - [CSV](https://web-platform-dx.github.io/baseline-browser-mapping/with_downstream/all_versions_with_supports.csv) + +These files are updated on a daily basis. + +## CLI + +`baseline-browser-mapping` includes a command line interface that exposes the same data and options as the `getCompatibleVersions()` function. To learn more about using the CLI, run: + +```sh +npx baseline-browser-mapping --help +``` + +## Downstream browsers + +### Limitations + +The browser versions in this module come from two different sources: + +- MDN's `browser-compat-data` module. +- Parsed user agent strings provided by [useragents.io](https://useragents.io/) + +MDN `browser-compat-data` is an authoritative source of information for the browsers it contains. The release dates for the Baseline core browser set and the mapping of downstream browsers to Chromium versions should be considered accurate. + +Browser mappings from useragents.io are provided on a best effort basis. They assume that browser vendors are accurately stating the Chromium version they have implemented. The initial set of version mappings was derived from a bulk export in November 2024. This version was iterated over with a Regex match looking for a major Chrome version and a corresponding version of the browser in question, e.g.: + +`Mozilla/5.0 (Linux; U; Android 10; en-US; STK-L21 Build/HUAWEISTK-L21) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.58 UCBrowser/13.8.2.1324 Mobile Safari/537.36` + +Shows UC Browser Mobile 13.8 implementing Chromium 100, and: + +`Mozilla/5.0 (Linux; arm_64; Android 11; Redmi Note 8 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.6613.123 YaBrowser/24.10.2.123.00 SA/3 Mobile Safari/537.36` + +Shows Yandex Browser Mobile 24.10 implementing Chromium 128. The Chromium version from this string is mapped to the corresponding Chrome version from MDN `browser-compat-data`. + +> [!NOTE] +> Where possible, approximate release dates have been included based on useragents.io "first seen" data. useragents.io does not have "first seen" dates prior to June 2020. However, these browsers' Baseline compatibility is determined by their Chromium or Gecko version, so their release dates are more informative than critical. + +This data is updated on a daily basis using a [script](https://github.com/web-platform-dx/web-features/tree/main/scripts/refresh-downstream.ts) triggered by a GitHub [action](https://github.com/web-platform-dx/web-features/tree/main/.github/workflows/refresh_downstream.yml). Useragents.io provides a private API for this module which exposes the last 7 days of newly seen user agents for the currently tracked browsers. If a new major version of one of the tracked browsers is encountered with a Chromium version that meets or exceeds the previous latest version of that browser, it is added to the [src/data/downstream-browsers.json](src/data/downstream-browsers.json) file with the date it was first seen by useragents.io as its release date. + +KaiOS is an exception - its upstream version mappings are handled separately from the other browsers because they happen very infrequently. + +### List of downstream browsers + +| Browser | ID | Core | Source | +| --------------------- | ------------------------- | ------- | ------------------------- | +| Chrome | `chrome` | `true` | MDN `browser-compat-data` | +| Chrome for Android | `chrome_android` | `true` | MDN `browser-compat-data` | +| Edge | `edge` | `true` | MDN `browser-compat-data` | +| Firefox | `firefox` | `true` | MDN `browser-compat-data` | +| Firefox for Android | `firefox_android` | `true` | MDN `browser-compat-data` | +| Safari | `safari` | `true` | MDN `browser-compat-data` | +| Safari on iOS | `safari_ios` | `true` | MDN `browser-compat-data` | +| Opera | `opera` | `false` | MDN `browser-compat-data` | +| Opera Android | `opera_android` | `false` | MDN `browser-compat-data` | +| Samsung Internet | `samsunginternet_android` | `false` | MDN `browser-compat-data` | +| WebView Android | `webview_android` | `false` | MDN `browser-compat-data` | +| QQ Browser Mobile | `qq_android` | `false` | useragents.io | +| UC Browser Mobile | `uc_android` | `false` | useragents.io | +| Yandex Browser Mobile | `ya_android` | `false` | useragents.io | +| KaiOS | `kai_os` | `false` | Manual | +| Facebook for Android | `facebook_android` | `false` | useragents.io | +| Instagram for Android | `instagram_android` | `false` | useragents.io | + +> [!NOTE] +> All the non-core browsers currently included implement Chromium or Gecko. Their inclusion in any of the above methods is based on the Baseline feature set supported by the Chromium or Gecko version they implement, not their release date. diff --git a/node_modules/baseline-browser-mapping/dist/cli.js b/node_modules/baseline-browser-mapping/dist/cli.js new file mode 100644 index 0000000..7e49fd4 --- /dev/null +++ b/node_modules/baseline-browser-mapping/dist/cli.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +import{parseArgs as e}from"node:util";import{exit as s}from"node:process";import{getCompatibleVersions as a}from"./index.js";const r=process.argv.slice(2),{values:n}=e({args:r,options:{"target-year":{type:"string"},"widely-available-on-date":{type:"string"},"include-downstream-browsers":{type:"boolean"},"list-all-compatible-versions":{type:"boolean"},"include-kaios":{type:"boolean"},"suppress-warnings":{type:"boolean"},"override-last-updated":{type:"string"},help:{type:"boolean",short:"h"}},strict:!0});n.help&&(console.log("\nGet Baseline Widely available browser versions or Baseline year browser versions.\n\nUsage: baseline-browser-mapping [options]\n\nOptions:\n --target-year Pass a year between 2015 and the current year to get browser versions compatible \n with all Newly Available features as of the end of the year specified.\n --widely-available-on-date Pass a date in the format 'YYYY-MM-DD' to get versions compatible with Widely \n available on the specified date.\n --include-downstream-browsers Whether to include browsers that use the same engines as a core Baseline browser.\n --include-kaios Whether to include KaiOS in downstream browsers. Requires --include-downstream-browsers.\n --list-all-compatible-versions Whether to include only the minimum compatible browser versions or all compatible versions.\n --suppress-warnings Supress potential warnings about data staleness when using a very recent feature cut off date.\n --override-last-updated Override the last updated date for the baseline data for debugging purposes.\n -h, --help Show help\n\nExamples:\n npx baseline-browser-mapping --target-year 2020\n npx baseline-browser-mapping --widely-available-on-date 2023-04-05\n npx baseline-browser-mapping --include-downstream-browsers\n npx baseline-browser-mapping --list-all-compatible-versions\n".trim()),s(0)),console.log(a({targetYear:n["target-year"]?Number.parseInt(n["target-year"]):void 0,widelyAvailableOnDate:n["widely-available-on-date"],includeDownstreamBrowsers:n["include-downstream-browsers"],listAllCompatibleVersions:n["list-all-compatible-versions"],includeKaiOS:n["include-kaios"],suppressWarnings:n["suppress-warnings"],overrideLastUpdated:n["override-last-updated"]?Number.parseInt(n["override-last-updated"]):void 0})); diff --git a/node_modules/baseline-browser-mapping/dist/index.cjs b/node_modules/baseline-browser-mapping/dist/index.cjs new file mode 100644 index 0000000..fee4cbb --- /dev/null +++ b/node_modules/baseline-browser-mapping/dist/index.cjs @@ -0,0 +1 @@ +"use strict";const s={chrome:{releases:[["1","2008-12-11","r","w","528"],["2","2009-05-21","r","w","530"],["3","2009-09-15","r","w","532"],["4","2010-01-25","r","w","532.5"],["5","2010-05-25","r","w","533"],["6","2010-09-02","r","w","534.3"],["7","2010-10-19","r","w","534.7"],["8","2010-12-02","r","w","534.10"],["9","2011-02-03","r","w","534.13"],["10","2011-03-08","r","w","534.16"],["11","2011-04-27","r","w","534.24"],["12","2011-06-07","r","w","534.30"],["13","2011-08-02","r","w","535.1"],["14","2011-09-16","r","w","535.1"],["15","2011-10-25","r","w","535.2"],["16","2011-12-13","r","w","535.7"],["17","2012-02-08","r","w","535.11"],["18","2012-03-28","r","w","535.19"],["19","2012-05-15","r","w","536.5"],["20","2012-06-26","r","w","536.10"],["21","2012-07-31","r","w","537.1"],["22","2012-09-25","r","w","537.4"],["23","2012-11-06","r","w","537.11"],["24","2013-01-10","r","w","537.17"],["25","2013-02-21","r","w","537.22"],["26","2013-03-26","r","w","537.31"],["27","2013-05-21","r","w","537.36"],["28","2013-07-09","r","b","28"],["29","2013-08-20","r","b","29"],["30","2013-10-01","r","b","30"],["31","2013-11-12","r","b","31"],["32","2014-01-14","r","b","32"],["33","2014-02-20","r","b","33"],["34","2014-04-08","r","b","34"],["35","2014-05-20","r","b","35"],["36","2014-07-16","r","b","36"],["37","2014-08-26","r","b","37"],["38","2014-10-07","r","b","38"],["39","2014-11-18","r","b","39"],["40","2015-01-21","r","b","40"],["41","2015-03-03","r","b","41"],["42","2015-04-14","r","b","42"],["43","2015-05-19","r","b","43"],["44","2015-07-21","r","b","44"],["45","2015-09-01","r","b","45"],["46","2015-10-13","r","b","46"],["47","2015-12-01","r","b","47"],["48","2016-01-20","r","b","48"],["49","2016-03-02","r","b","49"],["50","2016-04-13","r","b","50"],["51","2016-05-25","r","b","51"],["52","2016-07-20","r","b","52"],["53","2016-08-31","r","b","53"],["54","2016-10-12","r","b","54"],["55","2016-12-01","r","b","55"],["56","2017-01-25","r","b","56"],["57","2017-03-09","r","b","57"],["58","2017-04-19","r","b","58"],["59","2017-06-05","r","b","59"],["60","2017-07-25","r","b","60"],["61","2017-09-05","r","b","61"],["62","2017-10-17","r","b","62"],["63","2017-12-06","r","b","63"],["64","2018-01-23","r","b","64"],["65","2018-03-06","r","b","65"],["66","2018-04-17","r","b","66"],["67","2018-05-29","r","b","67"],["68","2018-07-24","r","b","68"],["69","2018-09-04","r","b","69"],["70","2018-10-16","r","b","70"],["71","2018-12-04","r","b","71"],["72","2019-01-29","r","b","72"],["73","2019-03-12","r","b","73"],["74","2019-04-23","r","b","74"],["75","2019-06-04","r","b","75"],["76","2019-07-30","r","b","76"],["77","2019-09-10","r","b","77"],["78","2019-10-22","r","b","78"],["79","2019-12-10","r","b","79"],["80","2020-02-04","r","b","80"],["81","2020-04-07","r","b","81"],["83","2020-05-19","r","b","83"],["84","2020-07-27","r","b","84"],["85","2020-08-25","r","b","85"],["86","2020-10-20","r","b","86"],["87","2020-11-17","r","b","87"],["88","2021-01-19","r","b","88"],["89","2021-03-02","r","b","89"],["90","2021-04-13","r","b","90"],["91","2021-05-25","r","b","91"],["92","2021-07-20","r","b","92"],["93","2021-08-31","r","b","93"],["94","2021-09-21","r","b","94"],["95","2021-10-19","r","b","95"],["96","2021-11-15","r","b","96"],["97","2022-01-04","r","b","97"],["98","2022-02-01","r","b","98"],["99","2022-03-01","r","b","99"],["100","2022-03-29","r","b","100"],["101","2022-04-26","r","b","101"],["102","2022-05-24","r","b","102"],["103","2022-06-21","r","b","103"],["104","2022-08-02","r","b","104"],["105","2022-09-02","r","b","105"],["106","2022-09-27","r","b","106"],["107","2022-10-25","r","b","107"],["108","2022-11-29","r","b","108"],["109","2023-01-10","r","b","109"],["110","2023-02-07","r","b","110"],["111","2023-03-07","r","b","111"],["112","2023-04-04","r","b","112"],["113","2023-05-02","r","b","113"],["114","2023-05-30","r","b","114"],["115","2023-07-18","r","b","115"],["116","2023-08-15","r","b","116"],["117","2023-09-12","r","b","117"],["118","2023-10-10","r","b","118"],["119","2023-10-31","r","b","119"],["120","2023-12-05","r","b","120"],["121","2024-01-23","r","b","121"],["122","2024-02-20","r","b","122"],["123","2024-03-19","r","b","123"],["124","2024-04-16","r","b","124"],["125","2024-05-14","r","b","125"],["126","2024-06-11","r","b","126"],["127","2024-07-23","r","b","127"],["128","2024-08-20","r","b","128"],["129","2024-09-17","r","b","129"],["130","2024-10-15","r","b","130"],["131","2024-11-12","r","b","131"],["132","2025-01-14","r","b","132"],["133","2025-02-04","r","b","133"],["134","2025-03-04","r","b","134"],["135","2025-04-01","r","b","135"],["136","2025-04-29","r","b","136"],["137","2025-05-27","r","b","137"],["138","2025-06-24","r","b","138"],["139","2025-08-05","r","b","139"],["140","2025-09-02","r","b","140"],["141","2025-09-30","r","b","141"],["142","2025-10-28","c","b","142"],["143","2025-12-02","b","b","143"],["144","2026-01-13","n","b","144"],["145",null,"p","b","145"]]},chrome_android:{releases:[["18","2012-06-27","r","w","535.19"],["25","2013-02-27","r","w","537.22"],["26","2013-04-03","r","w","537.31"],["27","2013-05-22","r","w","537.36"],["28","2013-07-10","r","b","28"],["29","2013-08-21","r","b","29"],["30","2013-10-02","r","b","30"],["31","2013-11-14","r","b","31"],["32","2014-01-15","r","b","32"],["33","2014-02-26","r","b","33"],["34","2014-04-02","r","b","34"],["35","2014-05-20","r","b","35"],["36","2014-07-16","r","b","36"],["37","2014-09-03","r","b","37"],["38","2014-10-08","r","b","38"],["39","2014-11-12","r","b","39"],["40","2015-01-21","r","b","40"],["41","2015-03-11","r","b","41"],["42","2015-04-15","r","b","42"],["43","2015-05-27","r","b","43"],["44","2015-07-29","r","b","44"],["45","2015-09-01","r","b","45"],["46","2015-10-14","r","b","46"],["47","2015-12-02","r","b","47"],["48","2016-01-26","r","b","48"],["49","2016-03-09","r","b","49"],["50","2016-04-13","r","b","50"],["51","2016-06-08","r","b","51"],["52","2016-07-27","r","b","52"],["53","2016-09-07","r","b","53"],["54","2016-10-19","r","b","54"],["55","2016-12-06","r","b","55"],["56","2017-02-01","r","b","56"],["57","2017-03-16","r","b","57"],["58","2017-04-25","r","b","58"],["59","2017-06-06","r","b","59"],["60","2017-08-01","r","b","60"],["61","2017-09-05","r","b","61"],["62","2017-10-24","r","b","62"],["63","2017-12-05","r","b","63"],["64","2018-01-23","r","b","64"],["65","2018-03-06","r","b","65"],["66","2018-04-17","r","b","66"],["67","2018-05-31","r","b","67"],["68","2018-07-24","r","b","68"],["69","2018-09-04","r","b","69"],["70","2018-10-17","r","b","70"],["71","2018-12-04","r","b","71"],["72","2019-01-29","r","b","72"],["73","2019-03-12","r","b","73"],["74","2019-04-24","r","b","74"],["75","2019-06-04","r","b","75"],["76","2019-07-30","r","b","76"],["77","2019-09-10","r","b","77"],["78","2019-10-22","r","b","78"],["79","2019-12-17","r","b","79"],["80","2020-02-04","r","b","80"],["81","2020-04-07","r","b","81"],["83","2020-05-19","r","b","83"],["84","2020-07-27","r","b","84"],["85","2020-08-25","r","b","85"],["86","2020-10-20","r","b","86"],["87","2020-11-17","r","b","87"],["88","2021-01-19","r","b","88"],["89","2021-03-02","r","b","89"],["90","2021-04-13","r","b","90"],["91","2021-05-25","r","b","91"],["92","2021-07-20","r","b","92"],["93","2021-08-31","r","b","93"],["94","2021-09-21","r","b","94"],["95","2021-10-19","r","b","95"],["96","2021-11-15","r","b","96"],["97","2022-01-04","r","b","97"],["98","2022-02-01","r","b","98"],["99","2022-03-01","r","b","99"],["100","2022-03-29","r","b","100"],["101","2022-04-26","r","b","101"],["102","2022-05-24","r","b","102"],["103","2022-06-21","r","b","103"],["104","2022-08-02","r","b","104"],["105","2022-09-02","r","b","105"],["106","2022-09-27","r","b","106"],["107","2022-10-25","r","b","107"],["108","2022-11-29","r","b","108"],["109","2023-01-10","r","b","109"],["110","2023-02-07","r","b","110"],["111","2023-03-07","r","b","111"],["112","2023-04-04","r","b","112"],["113","2023-05-02","r","b","113"],["114","2023-05-30","r","b","114"],["115","2023-07-21","r","b","115"],["116","2023-08-15","r","b","116"],["117","2023-09-12","r","b","117"],["118","2023-10-10","r","b","118"],["119","2023-10-31","r","b","119"],["120","2023-12-05","r","b","120"],["121","2024-01-23","r","b","121"],["122","2024-02-20","r","b","122"],["123","2024-03-19","r","b","123"],["124","2024-04-16","r","b","124"],["125","2024-05-14","r","b","125"],["126","2024-06-11","r","b","126"],["127","2024-07-23","r","b","127"],["128","2024-08-20","r","b","128"],["129","2024-09-17","r","b","129"],["130","2024-10-15","r","b","130"],["131","2024-11-12","r","b","131"],["132","2025-01-14","r","b","132"],["133","2025-02-04","r","b","133"],["134","2025-03-04","r","b","134"],["135","2025-04-01","r","b","135"],["136","2025-04-29","r","b","136"],["137","2025-05-27","r","b","137"],["138","2025-06-24","r","b","138"],["139","2025-08-05","r","b","139"],["140","2025-09-02","r","b","140"],["141","2025-09-30","r","b","141"],["142","2025-10-28","c","b","142"],["143","2025-12-02","b","b","143"],["144","2026-01-13","n","b","144"],["145",null,"p","b","145"]]},edge:{releases:[["12","2015-07-29","r",null,"12"],["13","2015-11-12","r",null,"13"],["14","2016-08-02","r",null,"14"],["15","2017-04-05","r",null,"15"],["16","2017-10-17","r",null,"16"],["17","2018-04-30","r",null,"17"],["18","2018-10-02","r",null,"18"],["79","2020-01-15","r","b","79"],["80","2020-02-07","r","b","80"],["81","2020-04-13","r","b","81"],["83","2020-05-21","r","b","83"],["84","2020-07-16","r","b","84"],["85","2020-08-27","r","b","85"],["86","2020-10-09","r","b","86"],["87","2020-11-19","r","b","87"],["88","2021-01-21","r","b","88"],["89","2021-03-04","r","b","89"],["90","2021-04-15","r","b","90"],["91","2021-05-27","r","b","91"],["92","2021-07-22","r","b","92"],["93","2021-09-02","r","b","93"],["94","2021-09-24","r","b","94"],["95","2021-10-21","r","b","95"],["96","2021-11-19","r","b","96"],["97","2022-01-06","r","b","97"],["98","2022-02-03","r","b","98"],["99","2022-03-03","r","b","99"],["100","2022-04-01","r","b","100"],["101","2022-04-28","r","b","101"],["102","2022-05-31","r","b","102"],["103","2022-06-23","r","b","103"],["104","2022-08-05","r","b","104"],["105","2022-09-01","r","b","105"],["106","2022-10-03","r","b","106"],["107","2022-10-27","r","b","107"],["108","2022-12-05","r","b","108"],["109","2023-01-12","r","b","109"],["110","2023-02-09","r","b","110"],["111","2023-03-13","r","b","111"],["112","2023-04-06","r","b","112"],["113","2023-05-05","r","b","113"],["114","2023-06-02","r","b","114"],["115","2023-07-21","r","b","115"],["116","2023-08-21","r","b","116"],["117","2023-09-15","r","b","117"],["118","2023-10-13","r","b","118"],["119","2023-11-02","r","b","119"],["120","2023-12-07","r","b","120"],["121","2024-01-25","r","b","121"],["122","2024-02-23","r","b","122"],["123","2024-03-22","r","b","123"],["124","2024-04-18","r","b","124"],["125","2024-05-17","r","b","125"],["126","2024-06-13","r","b","126"],["127","2024-07-25","r","b","127"],["128","2024-08-22","r","b","128"],["129","2024-09-19","r","b","129"],["130","2024-10-17","r","b","130"],["131","2024-11-14","r","b","131"],["132","2025-01-17","r","b","132"],["133","2025-02-06","r","b","133"],["134","2025-03-06","r","b","134"],["135","2025-04-04","r","b","135"],["136","2025-05-01","r","b","136"],["137","2025-05-29","r","b","137"],["138","2025-06-26","r","b","138"],["139","2025-08-07","r","b","139"],["140","2025-09-05","r","b","140"],["141","2025-10-03","r","b","141"],["142","2025-10-31","c","b","142"],["143","2025-12-04","b","b","143"],["144","2026-01-15","n","b","144"],["145","2026-02-12","p","b","145"]]},firefox:{releases:[["1","2004-11-09","r","g","1.7"],["2","2006-10-24","r","g","1.8.1"],["3","2008-06-17","r","g","1.9"],["4","2011-03-22","r","g","2"],["5","2011-06-21","r","g","5"],["6","2011-08-16","r","g","6"],["7","2011-09-27","r","g","7"],["8","2011-11-08","r","g","8"],["9","2011-12-20","r","g","9"],["10","2012-01-31","r","g","10"],["11","2012-03-13","r","g","11"],["12","2012-04-24","r","g","12"],["13","2012-06-05","r","g","13"],["14","2012-07-17","r","g","14"],["15","2012-08-28","r","g","15"],["16","2012-10-09","r","g","16"],["17","2012-11-20","r","g","17"],["18","2013-01-08","r","g","18"],["19","2013-02-19","r","g","19"],["20","2013-04-02","r","g","20"],["21","2013-05-14","r","g","21"],["22","2013-06-25","r","g","22"],["23","2013-08-06","r","g","23"],["24","2013-09-17","r","g","24"],["25","2013-10-29","r","g","25"],["26","2013-12-10","r","g","26"],["27","2014-02-04","r","g","27"],["28","2014-03-18","r","g","28"],["29","2014-04-29","r","g","29"],["30","2014-06-10","r","g","30"],["31","2014-07-22","r","g","31"],["32","2014-09-02","r","g","32"],["33","2014-10-14","r","g","33"],["34","2014-12-01","r","g","34"],["35","2015-01-13","r","g","35"],["36","2015-02-24","r","g","36"],["37","2015-03-31","r","g","37"],["38","2015-05-12","r","g","38"],["39","2015-07-02","r","g","39"],["40","2015-08-11","r","g","40"],["41","2015-09-22","r","g","41"],["42","2015-11-03","r","g","42"],["43","2015-12-15","r","g","43"],["44","2016-01-26","r","g","44"],["45","2016-03-08","r","g","45"],["46","2016-04-26","r","g","46"],["47","2016-06-07","r","g","47"],["48","2016-08-02","r","g","48"],["49","2016-09-20","r","g","49"],["50","2016-11-15","r","g","50"],["51","2017-01-24","r","g","51"],["52","2017-03-07","r","g","52"],["53","2017-04-19","r","g","53"],["54","2017-06-13","r","g","54"],["55","2017-08-08","r","g","55"],["56","2017-09-28","r","g","56"],["57","2017-11-14","r","g","57"],["58","2018-01-23","r","g","58"],["59","2018-03-13","r","g","59"],["60","2018-05-09","r","g","60"],["61","2018-06-26","r","g","61"],["62","2018-09-05","r","g","62"],["63","2018-10-23","r","g","63"],["64","2018-12-11","r","g","64"],["65","2019-01-29","r","g","65"],["66","2019-03-19","r","g","66"],["67","2019-05-21","r","g","67"],["68","2019-07-09","r","g","68"],["69","2019-09-03","r","g","69"],["70","2019-10-22","r","g","70"],["71","2019-12-10","r","g","71"],["72","2020-01-07","r","g","72"],["73","2020-02-11","r","g","73"],["74","2020-03-10","r","g","74"],["75","2020-04-07","r","g","75"],["76","2020-05-05","r","g","76"],["77","2020-06-02","r","g","77"],["78","2020-06-30","r","g","78"],["79","2020-07-28","r","g","79"],["80","2020-08-25","r","g","80"],["81","2020-09-22","r","g","81"],["82","2020-10-20","r","g","82"],["83","2020-11-17","r","g","83"],["84","2020-12-15","r","g","84"],["85","2021-01-26","r","g","85"],["86","2021-02-23","r","g","86"],["87","2021-03-23","r","g","87"],["88","2021-04-19","r","g","88"],["89","2021-06-01","r","g","89"],["90","2021-07-13","r","g","90"],["91","2021-08-10","r","g","91"],["92","2021-09-07","r","g","92"],["93","2021-10-05","r","g","93"],["94","2021-11-02","r","g","94"],["95","2021-12-07","r","g","95"],["96","2022-01-11","r","g","96"],["97","2022-02-08","r","g","97"],["98","2022-03-08","r","g","98"],["99","2022-04-05","r","g","99"],["100","2022-05-03","r","g","100"],["101","2022-05-31","r","g","101"],["102","2022-06-28","r","g","102"],["103","2022-07-26","r","g","103"],["104","2022-08-23","r","g","104"],["105","2022-09-20","r","g","105"],["106","2022-10-18","r","g","106"],["107","2022-11-15","r","g","107"],["108","2022-12-13","r","g","108"],["109","2023-01-17","r","g","109"],["110","2023-02-14","r","g","110"],["111","2023-03-14","r","g","111"],["112","2023-04-11","r","g","112"],["113","2023-05-09","r","g","113"],["114","2023-06-06","r","g","114"],["115","2023-07-04","r","g","115"],["116","2023-08-01","r","g","116"],["117","2023-08-29","r","g","117"],["118","2023-09-26","r","g","118"],["119","2023-10-24","r","g","119"],["120","2023-11-21","r","g","120"],["121","2023-12-19","r","g","121"],["122","2024-01-23","r","g","122"],["123","2024-02-20","r","g","123"],["124","2024-03-19","r","g","124"],["125","2024-04-16","r","g","125"],["126","2024-05-14","r","g","126"],["127","2024-06-11","r","g","127"],["128","2024-07-09","r","g","128"],["129","2024-08-06","r","g","129"],["130","2024-09-03","r","g","130"],["131","2024-10-01","r","g","131"],["132","2024-10-29","r","g","132"],["133","2024-11-26","r","g","133"],["134","2025-01-07","r","g","134"],["135","2025-02-04","r","g","135"],["136","2025-03-04","r","g","136"],["137","2025-04-01","r","g","137"],["138","2025-04-29","r","g","138"],["139","2025-05-27","r","g","139"],["140","2025-06-24","e","g","140"],["141","2025-07-22","r","g","141"],["142","2025-08-19","r","g","142"],["143","2025-09-16","r","g","143"],["144","2025-10-14","r","g","144"],["145","2025-11-11","c","g","145"],["146","2025-12-09","b","g","146"],["147","2026-01-13","n","g","147"],["148","2026-02-24","p","g","148"],["1.5","2005-11-29","r","g","1.8"],["3.5","2009-06-30","r","g","1.9.1"],["3.6","2010-01-21","r","g","1.9.2"]]},firefox_android:{releases:[["4","2011-03-29","r","g","2"],["5","2011-06-21","r","g","5"],["6","2011-08-16","r","g","6"],["7","2011-09-27","r","g","7"],["8","2011-11-08","r","g","8"],["9","2011-12-21","r","g","9"],["10","2012-01-31","r","g","10"],["14","2012-06-26","r","g","14"],["15","2012-08-28","r","g","15"],["16","2012-10-09","r","g","16"],["17","2012-11-20","r","g","17"],["18","2013-01-08","r","g","18"],["19","2013-02-19","r","g","19"],["20","2013-04-02","r","g","20"],["21","2013-05-14","r","g","21"],["22","2013-06-25","r","g","22"],["23","2013-08-06","r","g","23"],["24","2013-09-17","r","g","24"],["25","2013-10-29","r","g","25"],["26","2013-12-10","r","g","26"],["27","2014-02-04","r","g","27"],["28","2014-03-18","r","g","28"],["29","2014-04-29","r","g","29"],["30","2014-06-10","r","g","30"],["31","2014-07-22","r","g","31"],["32","2014-09-02","r","g","32"],["33","2014-10-14","r","g","33"],["34","2014-12-01","r","g","34"],["35","2015-01-13","r","g","35"],["36","2015-02-27","r","g","36"],["37","2015-03-31","r","g","37"],["38","2015-05-12","r","g","38"],["39","2015-07-02","r","g","39"],["40","2015-08-11","r","g","40"],["41","2015-09-22","r","g","41"],["42","2015-11-03","r","g","42"],["43","2015-12-15","r","g","43"],["44","2016-01-26","r","g","44"],["45","2016-03-08","r","g","45"],["46","2016-04-26","r","g","46"],["47","2016-06-07","r","g","47"],["48","2016-08-02","r","g","48"],["49","2016-09-20","r","g","49"],["50","2016-11-15","r","g","50"],["51","2017-01-24","r","g","51"],["52","2017-03-07","r","g","52"],["53","2017-04-19","r","g","53"],["54","2017-06-13","r","g","54"],["55","2017-08-08","r","g","55"],["56","2017-09-28","r","g","56"],["57","2017-11-28","r","g","57"],["58","2018-01-22","r","g","58"],["59","2018-03-13","r","g","59"],["60","2018-05-09","r","g","60"],["61","2018-06-26","r","g","61"],["62","2018-09-05","r","g","62"],["63","2018-10-23","r","g","63"],["64","2018-12-11","r","g","64"],["65","2019-01-29","r","g","65"],["66","2019-03-19","r","g","66"],["67","2019-05-21","r","g","67"],["68","2019-07-09","r","g","68"],["79","2020-07-28","r","g","79"],["80","2020-08-31","r","g","80"],["81","2020-09-22","r","g","81"],["82","2020-10-20","r","g","82"],["83","2020-11-17","r","g","83"],["84","2020-12-15","r","g","84"],["85","2021-01-26","r","g","85"],["86","2021-02-23","r","g","86"],["87","2021-03-23","r","g","87"],["88","2021-04-19","r","g","88"],["89","2021-06-01","r","g","89"],["90","2021-07-13","r","g","90"],["91","2021-08-10","r","g","91"],["92","2021-09-07","r","g","92"],["93","2021-10-05","r","g","93"],["94","2021-11-02","r","g","94"],["95","2021-12-07","r","g","95"],["96","2022-01-11","r","g","96"],["97","2022-02-08","r","g","97"],["98","2022-03-08","r","g","98"],["99","2022-04-05","r","g","99"],["100","2022-05-03","r","g","100"],["101","2022-05-31","r","g","101"],["102","2022-06-28","r","g","102"],["103","2022-07-26","r","g","103"],["104","2022-08-23","r","g","104"],["105","2022-09-20","r","g","105"],["106","2022-10-18","r","g","106"],["107","2022-11-15","r","g","107"],["108","2022-12-13","r","g","108"],["109","2023-01-17","r","g","109"],["110","2023-02-14","r","g","110"],["111","2023-03-14","r","g","111"],["112","2023-04-11","r","g","112"],["113","2023-05-09","r","g","113"],["114","2023-06-06","r","g","114"],["115","2023-07-04","r","g","115"],["116","2023-08-01","r","g","116"],["117","2023-08-29","r","g","117"],["118","2023-09-26","r","g","118"],["119","2023-10-24","r","g","119"],["120","2023-11-21","r","g","120"],["121","2023-12-19","r","g","121"],["122","2024-01-23","r","g","122"],["123","2024-02-20","r","g","123"],["124","2024-03-19","r","g","124"],["125","2024-04-16","r","g","125"],["126","2024-05-14","r","g","126"],["127","2024-06-11","r","g","127"],["128","2024-07-09","r","g","128"],["129","2024-08-06","r","g","129"],["130","2024-09-03","r","g","130"],["131","2024-10-01","r","g","131"],["132","2024-10-29","r","g","132"],["133","2024-11-26","r","g","133"],["134","2025-01-07","r","g","134"],["135","2025-02-04","r","g","135"],["136","2025-03-04","r","g","136"],["137","2025-04-01","r","g","137"],["138","2025-04-29","r","g","138"],["139","2025-05-27","r","g","139"],["140","2025-06-24","e","g","140"],["141","2025-07-22","r","g","141"],["142","2025-08-19","r","g","142"],["143","2025-09-16","r","g","143"],["144","2025-10-14","r","g","144"],["145","2025-11-11","c","g","145"],["146","2025-12-09","b","g","146"],["147","2026-01-13","n","g","147"],["148","2026-02-24","p","g","148"]]},opera:{releases:[["2","1996-07-14","r",null,null],["3","1997-12-01","r",null,null],["4","2000-06-28","r",null,null],["5","2000-12-06","r",null,null],["6","2001-12-18","r",null,null],["7","2003-01-28","r","p","1"],["8","2005-04-19","r","p","1"],["9","2006-06-20","r","p","2"],["10","2009-09-01","r","p","2.2"],["11","2010-12-16","r","p","2.7"],["12","2012-06-14","r","p","2.10"],["15","2013-07-02","r","b","28"],["16","2013-08-27","r","b","29"],["17","2013-10-08","r","b","30"],["18","2013-11-19","r","b","31"],["19","2014-01-28","r","b","32"],["20","2014-03-04","r","b","33"],["21","2014-05-06","r","b","34"],["22","2014-06-03","r","b","35"],["23","2014-07-22","r","b","36"],["24","2014-09-02","r","b","37"],["25","2014-10-15","r","b","38"],["26","2014-12-03","r","b","39"],["27","2015-01-27","r","b","40"],["28","2015-03-10","r","b","41"],["29","2015-04-28","r","b","42"],["30","2015-06-09","r","b","43"],["31","2015-08-04","r","b","44"],["32","2015-09-15","r","b","45"],["33","2015-10-27","r","b","46"],["34","2015-12-08","r","b","47"],["35","2016-02-02","r","b","48"],["36","2016-03-15","r","b","49"],["37","2016-05-04","r","b","50"],["38","2016-06-08","r","b","51"],["39","2016-08-02","r","b","52"],["40","2016-09-20","r","b","53"],["41","2016-10-25","r","b","54"],["42","2016-12-13","r","b","55"],["43","2017-02-07","r","b","56"],["44","2017-03-21","r","b","57"],["45","2017-05-10","r","b","58"],["46","2017-06-22","r","b","59"],["47","2017-08-09","r","b","60"],["48","2017-09-27","r","b","61"],["49","2017-11-08","r","b","62"],["50","2018-01-04","r","b","63"],["51","2018-02-07","r","b","64"],["52","2018-03-22","r","b","65"],["53","2018-05-10","r","b","66"],["54","2018-06-28","r","b","67"],["55","2018-08-16","r","b","68"],["56","2018-09-25","r","b","69"],["57","2018-11-28","r","b","70"],["58","2019-01-23","r","b","71"],["60","2019-04-09","r","b","73"],["62","2019-06-27","r","b","75"],["63","2019-08-20","r","b","76"],["64","2019-10-07","r","b","77"],["65","2019-11-13","r","b","78"],["66","2020-01-07","r","b","79"],["67","2020-03-03","r","b","80"],["68","2020-04-22","r","b","81"],["69","2020-06-24","r","b","83"],["70","2020-07-27","r","b","84"],["71","2020-09-15","r","b","85"],["72","2020-10-21","r","b","86"],["73","2020-12-09","r","b","87"],["74","2021-02-02","r","b","88"],["75","2021-03-24","r","b","89"],["76","2021-04-28","r","b","90"],["77","2021-06-09","r","b","91"],["78","2021-08-03","r","b","92"],["79","2021-09-14","r","b","93"],["80","2021-10-05","r","b","94"],["81","2021-11-04","r","b","95"],["82","2021-12-02","r","b","96"],["83","2022-01-19","r","b","97"],["84","2022-02-16","r","b","98"],["85","2022-03-23","r","b","99"],["86","2022-04-20","r","b","100"],["87","2022-05-17","r","b","101"],["88","2022-06-08","r","b","102"],["89","2022-07-07","r","b","103"],["90","2022-08-18","r","b","104"],["91","2022-09-14","r","b","105"],["92","2022-10-19","r","b","106"],["93","2022-11-17","r","b","107"],["94","2022-12-15","r","b","108"],["95","2023-02-01","r","b","109"],["96","2023-02-22","r","b","110"],["97","2023-03-22","r","b","111"],["98","2023-04-20","r","b","112"],["99","2023-05-16","r","b","113"],["100","2023-06-29","r","b","114"],["101","2023-07-26","r","b","115"],["102","2023-08-23","r","b","116"],["103","2023-10-03","r","b","117"],["104","2023-10-23","r","b","118"],["105","2023-11-14","r","b","119"],["106","2023-12-19","r","b","120"],["107","2024-02-07","r","b","121"],["108","2024-03-05","r","b","122"],["109","2024-03-27","r","b","123"],["110","2024-05-14","r","b","124"],["111","2024-06-12","r","b","125"],["112","2024-07-11","r","b","126"],["113","2024-08-22","r","b","127"],["114","2024-09-25","r","b","128"],["115","2024-11-27","r","b","130"],["116","2025-01-08","r","b","131"],["117","2025-02-13","r","b","132"],["118","2025-04-15","r","b","133"],["119","2025-05-13","r","b","134"],["120","2025-07-02","r","b","135"],["121","2025-08-27","r","b","137"],["122","2025-09-11","r","b","138"],["123","2025-10-28","c","b","139"],["124",null,"b","b","140"],["125",null,"n","b","141"],["10.1","2009-11-23","r","p","2.2"],["10.5","2010-03-02","r","p","2.5"],["10.6","2010-07-01","r","p","2.6"],["11.1","2011-04-12","r","p","2.8"],["11.5","2011-06-28","r","p","2.9"],["11.6","2011-12-06","r","p","2.10"],["12.1","2012-11-20","r","p","2.12"],["3.5","1998-11-18","r",null,null],["3.6","1999-05-06","r",null,null],["5.1","2001-04-10","r",null,null],["7.1","2003-04-11","r","p","1"],["7.2","2003-09-23","r","p","1"],["7.5","2004-05-12","r","p","1"],["8.5","2005-09-20","r","p","1"],["9.1","2006-12-18","r","p","2"],["9.2","2007-04-11","r","p","2"],["9.5","2008-06-12","r","p","2.1"],["9.6","2008-10-08","r","p","2.1"]]},opera_android:{releases:[["11","2011-03-22","r","p","2.7"],["12","2012-02-25","r","p","2.10"],["14","2013-05-21","r","w","537.31"],["15","2013-07-08","r","b","28"],["16","2013-09-18","r","b","29"],["18","2013-11-20","r","b","31"],["19","2014-01-28","r","b","32"],["20","2014-03-06","r","b","33"],["21","2014-04-22","r","b","34"],["22","2014-06-17","r","b","35"],["24","2014-09-10","r","b","37"],["25","2014-10-16","r","b","38"],["26","2014-12-02","r","b","39"],["27","2015-01-29","r","b","40"],["28","2015-03-10","r","b","41"],["29","2015-04-28","r","b","42"],["30","2015-06-10","r","b","43"],["32","2015-09-23","r","b","45"],["33","2015-11-03","r","b","46"],["34","2015-12-16","r","b","47"],["35","2016-02-04","r","b","48"],["36","2016-03-31","r","b","49"],["37","2016-06-16","r","b","50"],["41","2016-10-25","r","b","54"],["42","2017-01-21","r","b","55"],["43","2017-09-27","r","b","59"],["44","2017-12-11","r","b","60"],["45","2018-02-15","r","b","61"],["46","2018-05-14","r","b","63"],["47","2018-07-23","r","b","66"],["48","2018-11-08","r","b","69"],["49","2018-12-07","r","b","70"],["50","2019-02-18","r","b","71"],["51","2019-03-21","r","b","72"],["52","2019-05-17","r","b","73"],["53","2019-07-11","r","b","74"],["54","2019-10-18","r","b","76"],["55","2019-12-03","r","b","77"],["56","2020-02-06","r","b","78"],["57","2020-03-30","r","b","80"],["58","2020-05-13","r","b","81"],["59","2020-06-30","r","b","83"],["60","2020-09-23","r","b","85"],["61","2020-12-07","r","b","86"],["62","2021-02-16","r","b","87"],["63","2021-04-16","r","b","89"],["64","2021-05-25","r","b","91"],["65","2021-10-20","r","b","92"],["66","2021-12-15","r","b","94"],["67","2022-01-31","r","b","96"],["68","2022-03-30","r","b","99"],["69","2022-05-09","r","b","100"],["70","2022-06-29","r","b","102"],["71","2022-09-16","r","b","104"],["72","2022-10-21","r","b","106"],["73","2023-01-17","r","b","108"],["74","2023-03-13","r","b","110"],["75","2023-05-17","r","b","112"],["76","2023-06-26","r","b","114"],["77","2023-08-31","r","b","115"],["78","2023-10-23","r","b","117"],["79","2023-12-06","r","b","119"],["80","2024-01-25","r","b","120"],["81","2024-03-14","r","b","122"],["82","2024-05-02","r","b","124"],["83","2024-06-25","r","b","126"],["84","2024-08-26","r","b","127"],["85","2024-10-29","r","b","128"],["86","2024-12-02","r","b","130"],["87","2025-01-22","r","b","132"],["88","2025-03-19","r","b","134"],["89","2025-04-29","r","b","135"],["90","2025-06-18","r","b","137"],["91","2025-08-19","r","b","139"],["92","2025-10-08","c","b","140"],["10.1","2010-11-09","r","p","2.5"],["11.1","2011-06-30","r","p","2.8"],["11.5","2011-10-12","r","p","2.9"],["12.1","2012-10-09","r","p","2.11"]]},safari:{releases:[["1","2003-06-23","r","w","85"],["2","2005-04-29","r","w","412"],["3","2007-10-26","r","w","523.10"],["4","2009-06-08","r","w","530.17"],["5","2010-06-07","r","w","533.16"],["6","2012-07-25","r","w","536.25"],["7","2013-10-22","r","w","537.71"],["8","2014-10-16","r","w","538.35"],["9","2015-09-30","r","w","601.1.56"],["10","2016-09-20","r","w","602.1.50"],["11","2017-09-19","r","w","604.2.4"],["12","2018-09-17","r","w","606.1.36"],["13","2019-09-19","r","w","608.2.11"],["14","2020-09-16","r","w","610.1.28"],["15","2021-09-20","r","w","612.1.27"],["16","2022-09-12","r","w","614.1.25"],["17","2023-09-18","r","w","616.1.27"],["18","2024-09-16","r","w","619.1.26"],["26","2025-09-15","r","w","622.1.22"],["1.1","2003-10-24","r","w","100"],["1.2","2004-02-02","r","w","125"],["1.3","2005-04-15","r","w","312"],["10.1","2017-03-27","r","w","603.2.1"],["11.1","2018-04-12","r","w","605.1.33"],["12.1","2019-03-25","r","w","607.1.40"],["13.1","2020-03-24","r","w","609.1.20"],["14.1","2021-04-26","r","w","611.1.21"],["15.1","2021-10-25","r","w","612.2.9"],["15.2","2021-12-13","r","w","612.3.6"],["15.3","2022-01-26","r","w","612.4.9"],["15.4","2022-03-14","r","w","613.1.17"],["15.5","2022-05-16","r","w","613.2.7"],["15.6","2022-07-20","r","w","613.3.9"],["16.1","2022-10-24","r","w","614.2.9"],["16.2","2022-12-13","r","w","614.3.7"],["16.3","2023-01-23","r","w","614.4.6"],["16.4","2023-03-27","r","w","615.1.26"],["16.5","2023-05-18","r","w","615.2.9"],["16.6","2023-07-24","r","w","615.3.12"],["17.1","2023-10-25","r","w","616.2.9"],["17.2","2023-12-11","r","w","617.1.17"],["17.3","2024-01-22","r","w","617.2.4"],["17.4","2024-03-05","r","w","618.1.15"],["17.5","2024-05-13","r","w","618.2.12"],["17.6","2024-07-29","r","w","618.3.11"],["18.1","2024-10-28","r","w","619.2.8"],["18.2","2024-12-11","r","w","620.1.16"],["18.3","2025-01-27","r","w","620.2.4"],["18.4","2025-03-31","r","w","621.1.15"],["18.5","2025-05-12","r","w","621.2.5"],["18.6","2025-07-29","r","w","621.3.11"],["26.1","2025-11-03","c","w","622.2.11"],["26.2",null,"b","w","623.1.12"],["3.1","2008-03-18","r","w","525.13"],["5.1","2011-07-20","r","w","534.48"],["9.1","2016-03-21","r","w","601.5.17"]]},safari_ios:{releases:[["1","2007-06-29","r","w","522.11"],["2","2008-07-11","r","w","525.18"],["3","2009-06-17","r","w","528.18"],["4","2010-06-21","r","w","532.9"],["5","2011-10-12","r","w","534.46"],["6","2012-09-10","r","w","536.26"],["7","2013-09-18","r","w","537.51"],["8","2014-09-17","r","w","600.1.4"],["9","2015-09-16","r","w","601.1.56"],["10","2016-09-13","r","w","602.1.50"],["11","2017-09-19","r","w","604.2.4"],["12","2018-09-17","r","w","606.1.36"],["13","2019-09-19","r","w","608.2.11"],["14","2020-09-16","r","w","610.1.28"],["15","2021-09-20","r","w","612.1.27"],["16","2022-09-12","r","w","614.1.25"],["17","2023-09-18","r","w","616.1.27"],["18","2024-09-16","r","w","619.1.26"],["26","2025-09-15","r","w","622.1.22"],["10.3","2017-03-27","r","w","603.2.1"],["11.3","2018-03-29","r","w","605.1.33"],["12.2","2019-03-25","r","w","607.1.40"],["13.4","2020-03-24","r","w","609.1.20"],["14.5","2021-04-26","r","w","611.1.21"],["15.1","2021-10-25","r","w","612.2.9"],["15.2","2021-12-13","r","w","612.3.6"],["15.3","2022-01-26","r","w","612.4.9"],["15.4","2022-03-14","r","w","613.1.17"],["15.5","2022-05-16","r","w","613.2.7"],["15.6","2022-07-20","r","w","613.3.9"],["16.1","2022-10-24","r","w","614.2.9"],["16.2","2022-12-13","r","w","614.3.7"],["16.3","2023-01-23","r","w","614.4.6"],["16.4","2023-03-27","r","w","615.1.26"],["16.5","2023-05-18","r","w","615.2.9"],["16.6","2023-07-24","r","w","615.3.12"],["17.1","2023-10-25","r","w","616.2.9"],["17.2","2023-12-11","r","w","617.1.17"],["17.3","2024-01-22","r","w","617.2.4"],["17.4","2024-03-05","r","w","618.1.15"],["17.5","2024-05-13","r","w","618.2.12"],["17.6","2024-07-29","r","w","618.3.11"],["18.1","2024-10-28","r","w","619.2.8"],["18.2","2024-12-11","r","w","620.1.16"],["18.3","2025-01-27","r","w","620.2.4"],["18.4","2025-03-31","r","w","621.1.15"],["18.5","2025-05-12","r","w","621.2.5"],["18.6","2025-07-29","r","w","621.3.11"],["26.1","2025-11-03","c","w","622.2.11"],["26.2",null,"b","w","623.1.12"],["3.2","2010-04-03","r","w","531.21"],["4.2","2010-11-22","r","w","533.17"],["9.3","2016-03-21","r","w","601.5.17"]]},samsunginternet_android:{releases:[["1.0","2013-04-27","r","w","535.19"],["1.5","2013-09-25","r","b","28"],["1.6","2014-04-11","r","b","28"],["10.0","2019-08-22","r","b","71"],["10.2","2019-10-09","r","b","71"],["11.0","2019-12-05","r","b","75"],["11.2","2020-03-22","r","b","75"],["12.0","2020-06-19","r","b","79"],["12.1","2020-07-07","r","b","79"],["13.0","2020-12-02","r","b","83"],["13.2","2021-01-20","r","b","83"],["14.0","2021-04-17","r","b","87"],["14.2","2021-06-25","r","b","87"],["15.0","2021-08-13","r","b","90"],["16.0","2021-11-25","r","b","92"],["16.2","2022-03-06","r","b","92"],["17.0","2022-05-04","r","b","96"],["18.0","2022-08-08","r","b","99"],["18.1","2022-09-09","r","b","99"],["19.0","2022-11-01","r","b","102"],["19.1","2022-11-08","r","b","102"],["2.0","2014-10-17","r","b","34"],["2.1","2015-01-07","r","b","34"],["20.0","2023-02-10","r","b","106"],["21.0","2023-05-19","r","b","110"],["22.0","2023-07-14","r","b","111"],["23.0","2023-10-18","r","b","115"],["24.0","2024-01-25","r","b","117"],["25.0","2024-04-24","r","b","121"],["26.0","2024-06-07","r","b","122"],["27.0","2024-11-06","r","b","125"],["28.0","2025-04-02","c","b","130"],["29.0",null,"b","b","136"],["3.0","2015-04-10","r","b","38"],["3.2","2015-08-24","r","b","38"],["4.0","2016-03-11","r","b","44"],["4.2","2016-08-02","r","b","44"],["5.0","2016-12-15","r","b","51"],["5.2","2017-04-21","r","b","51"],["5.4","2017-05-17","r","b","51"],["6.0","2017-08-23","r","b","56"],["6.2","2017-10-26","r","b","56"],["6.4","2018-02-19","r","b","56"],["7.0","2018-03-16","r","b","59"],["7.2","2018-06-20","r","b","59"],["7.4","2018-09-12","r","b","59"],["8.0","2018-07-18","r","b","63"],["8.2","2018-12-21","r","b","63"],["9.0","2018-09-15","r","b","67"],["9.2","2019-04-02","r","b","67"],["9.4","2019-07-25","r","b","67"]]},webview_android:{releases:[["1","2008-09-23","r","w","523.12"],["2","2009-10-26","r","w","530.17"],["3","2011-02-22","r","w","534.13"],["4","2011-10-18","r","w","534.30"],["37","2014-09-03","r","b","37"],["38","2014-10-08","r","b","38"],["39","2014-11-12","r","b","39"],["40","2015-01-21","r","b","40"],["41","2015-03-11","r","b","41"],["42","2015-04-15","r","b","42"],["43","2015-05-27","r","b","43"],["44","2015-07-29","r","b","44"],["45","2015-09-01","r","b","45"],["46","2015-10-14","r","b","46"],["47","2015-12-02","r","b","47"],["48","2016-01-26","r","b","48"],["49","2016-03-09","r","b","49"],["50","2016-04-13","r","b","50"],["51","2016-06-08","r","b","51"],["52","2016-07-27","r","b","52"],["53","2016-09-07","r","b","53"],["54","2016-10-19","r","b","54"],["55","2016-12-06","r","b","55"],["56","2017-02-01","r","b","56"],["57","2017-03-16","r","b","57"],["58","2017-04-25","r","b","58"],["59","2017-06-06","r","b","59"],["60","2017-08-01","r","b","60"],["61","2017-09-05","r","b","61"],["62","2017-10-24","r","b","62"],["63","2017-12-05","r","b","63"],["64","2018-01-23","r","b","64"],["65","2018-03-06","r","b","65"],["66","2018-04-17","r","b","66"],["67","2018-05-31","r","b","67"],["68","2018-07-24","r","b","68"],["69","2018-09-04","r","b","69"],["70","2018-10-17","r","b","70"],["71","2018-12-04","r","b","71"],["72","2019-01-29","r","b","72"],["73","2019-03-12","r","b","73"],["74","2019-04-24","r","b","74"],["75","2019-06-04","r","b","75"],["76","2019-07-30","r","b","76"],["77","2019-09-10","r","b","77"],["78","2019-10-22","r","b","78"],["79","2019-12-17","r","b","79"],["80","2020-02-04","r","b","80"],["81","2020-04-07","r","b","81"],["83","2020-05-19","r","b","83"],["84","2020-07-27","r","b","84"],["85","2020-08-25","r","b","85"],["86","2020-10-20","r","b","86"],["87","2020-11-17","r","b","87"],["88","2021-01-19","r","b","88"],["89","2021-03-02","r","b","89"],["90","2021-04-13","r","b","90"],["91","2021-05-25","r","b","91"],["92","2021-07-20","r","b","92"],["93","2021-08-31","r","b","93"],["94","2021-09-21","r","b","94"],["95","2021-10-19","r","b","95"],["96","2021-11-15","r","b","96"],["97","2022-01-04","r","b","97"],["98","2022-02-01","r","b","98"],["99","2022-03-01","r","b","99"],["100","2022-03-29","r","b","100"],["101","2022-04-26","r","b","101"],["102","2022-05-24","r","b","102"],["103","2022-06-21","r","b","103"],["104","2022-08-02","r","b","104"],["105","2022-09-02","r","b","105"],["106","2022-09-27","r","b","106"],["107","2022-10-25","r","b","107"],["108","2022-11-29","r","b","108"],["109","2023-01-10","r","b","109"],["110","2023-02-07","r","b","110"],["111","2023-03-01","r","b","111"],["112","2023-04-04","r","b","112"],["113","2023-05-02","r","b","113"],["114","2023-05-30","r","b","114"],["115","2023-07-21","r","b","115"],["116","2023-08-15","r","b","116"],["117","2023-09-12","r","b","117"],["118","2023-10-10","r","b","118"],["119","2023-10-31","r","b","119"],["120","2023-12-05","r","b","120"],["121","2024-01-23","r","b","121"],["122","2024-02-20","r","b","122"],["123","2024-03-19","r","b","123"],["124","2024-04-16","r","b","124"],["125","2024-05-14","r","b","125"],["126","2024-06-11","r","b","126"],["127","2024-07-23","r","b","127"],["128","2024-08-20","r","b","128"],["129","2024-09-17","r","b","129"],["130","2024-10-15","r","b","130"],["131","2024-11-12","r","b","131"],["132","2025-01-14","r","b","132"],["133","2025-02-04","r","b","133"],["134","2025-03-04","r","b","134"],["135","2025-04-01","r","b","135"],["136","2025-04-29","r","b","136"],["137","2025-05-27","r","b","137"],["138","2025-06-24","r","b","138"],["139","2025-08-05","r","b","139"],["140","2025-09-02","r","b","140"],["141","2025-09-30","r","b","141"],["142","2025-10-28","c","b","142"],["143","2025-12-02","b","b","143"],["144","2026-01-13","n","b","144"],["145",null,"p","b","145"],["1.5","2009-04-27","r","w","525.20"],["2.2","2010-05-20","r","w","533.1"],["4.4","2013-12-09","r","b","30"],["4.4.3","2014-06-02","r","b","33"]]}},a={ya_android:{releases:[["1.0","u","u","b","25"],["1.5","u","u","b","22"],["1.6","u","u","b","25"],["1.7","u","u","b","25"],["1.20","u","u","b","25"],["2.5","u","u","b","25"],["3.2","u","u","b","25"],["4.6","u","u","b","25"],["5.3","u","u","b","25"],["5.4","u","u","b","25"],["7.4","u","u","b","25"],["9.6","u","u","b","25"],["10.5","u","u","b","25"],["11.4","u","u","b","25"],["11.5","u","u","b","25"],["12.7","u","u","b","25"],["13.9","u","u","b","28"],["13.10","u","u","b","28"],["13.11","u","u","b","28"],["13.12","u","u","b","30"],["14.2","u","u","b","32"],["14.4","u","u","b","33"],["14.5","u","u","b","34"],["14.7","u","u","b","35"],["14.8","u","u","b","36"],["14.10","u","u","b","37"],["14.12","u","u","b","38"],["15.2","u","u","b","40"],["15.4","u","u","b","41"],["15.6","u","u","b","42"],["15.7","u","u","b","43"],["15.9","u","u","b","44"],["15.10","u","u","b","45"],["15.12","u","u","b","46"],["16.2","u","u","b","47"],["16.3","u","u","b","47"],["16.4","u","u","b","49"],["16.6","u","u","b","50"],["16.7","u","u","b","51"],["16.9","u","u","b","52"],["16.10","u","u","b","53"],["16.11","u","u","b","54"],["17.1","u","u","b","55"],["17.3","u","u","b","56"],["17.4","u","u","b","57"],["17.6","u","u","b","58"],["17.7","u","u","b","59"],["17.9","u","u","b","60"],["17.10","u","u","b","61"],["17.11","u","u","b","62"],["18.1","u","u","b","63"],["18.2","u","u","b","63"],["18.3","u","u","b","64"],["18.4","u","u","b","65"],["18.6","u","u","b","66"],["18.7","u","u","b","67"],["18.9","u","u","b","68"],["18.10","u","u","b","69"],["18.11","u","u","b","70"],["19.1","u","u","b","71"],["19.3","u","u","b","72"],["19.4","u","u","b","73"],["19.5","u","u","b","75"],["19.6","u","u","b","75"],["19.7","u","u","b","75"],["19.9","u","u","b","76"],["19.10","u","u","b","77"],["19.11","u","u","b","78"],["19.12","u","u","b","78"],["20.2","u","u","b","79"],["20.3","u","u","b","80"],["20.4","u","u","b","81"],["20.6","u","u","b","81"],["20.7","u","u","b","83"],["20.8","2020-09-02","u","b","84"],["20.9","2020-09-27","u","b","85"],["20.11","2020-11-11","u","b","86"],["20.12","2020-12-20","u","b","87"],["21.1","2021-12-31","u","b","88"],["21.2","u","u","b","88"],["21.3","2021-04-04","u","b","89"],["21.5","u","u","b","90"],["21.6","2021-09-28","u","b","91"],["21.8","2021-09-28","u","b","92"],["21.9","2021-09-29","u","b","93"],["21.11","2021-10-29","u","b","94"],["22.1","2021-12-31","u","b","96"],["22.3","2022-03-25","u","b","98"],["22.4","u","u","b","92"],["22.5","2022-05-20","u","b","100"],["22.7","2022-07-07","u","b","102"],["22.8","u","u","b","104"],["22.9","2022-08-27","u","b","104"],["22.11","2022-11-11","u","b","106"],["23.1","2023-01-10","u","b","108"],["23.3","2023-03-26","u","b","110"],["23.5","2023-05-19","u","b","112"],["23.7","2023-07-06","u","b","114"],["23.9","2023-09-13","u","b","116"],["23.11","2023-11-15","u","b","118"],["24.1","2024-01-18","u","b","120"],["24.2","2024-03-25","u","b","120"],["24.4","2024-03-27","u","b","122"],["24.6","2024-06-04","u","b","124"],["24.7","2024-07-18","u","b","126"],["24.9","2024-10-01","u","b","126"],["24.10","2024-10-11","u","b","128"],["24.12","2024-11-30","u","b","130"],["25.2","2025-04-24","u","b","132"],["25.3","2025-04-23","u","b","132"],["25.4","2025-04-23","u","b","134"],["25.6","2025-09-04","u","b","136"],["25.8","2025-08-30","u","b","138"],["25.10","2025-10-09","u","b","140"]]},uc_android:{releases:[["10.5","u","u","b","31"],["10.7","u","u","b","31"],["10.8","u","u","b","31"],["10.10","u","u","b","31"],["11.0","u","u","b","31"],["11.1","u","u","b","40"],["11.2","u","u","b","40"],["11.3","u","u","b","40"],["11.4","u","u","b","40"],["11.5","u","u","b","40"],["11.6","u","u","b","57"],["11.8","u","u","b","57"],["11.9","u","u","b","57"],["12.0","u","u","b","57"],["12.1","u","u","b","57"],["12.2","u","u","b","57"],["12.3","u","u","b","57"],["12.4","u","u","b","57"],["12.5","u","u","b","57"],["12.6","u","u","b","57"],["12.7","u","u","b","57"],["12.8","u","u","b","57"],["12.9","u","u","b","57"],["12.10","u","u","b","57"],["12.11","u","u","b","57"],["12.12","u","u","b","57"],["12.13","u","u","b","57"],["12.14","u","u","b","57"],["13.0","u","u","b","57"],["13.1","u","u","b","57"],["13.2","u","u","b","57"],["13.3","2020-09-09","u","b","78"],["13.4","2021-09-28","u","b","78"],["13.5","2023-08-25","u","b","78"],["13.6","2023-12-17","u","b","78"],["13.7","2023-06-24","u","b","78"],["13.8","2022-04-30","u","b","78"],["13.9","2022-05-18","u","b","78"],["15.0","2022-08-24","u","b","78"],["15.1","2022-11-11","u","b","78"],["15.2","2023-04-23","u","b","78"],["15.3","2023-03-17","u","b","100"],["15.4","2023-10-25","u","b","100"],["15.5","2023-08-22","u","b","100"],["16.0","2023-08-24","u","b","100"],["16.1","2023-10-15","u","b","100"],["16.2","2023-12-09","u","b","100"],["16.3","2024-03-08","u","b","100"],["16.4","2024-10-03","u","b","100"],["16.5","2024-05-30","u","b","100"],["16.6","2024-07-23","u","b","100"],["17.0","2024-08-24","u","b","100"],["17.1","2024-09-26","u","b","100"],["17.2","2024-11-29","u","b","100"],["17.3","2025-01-07","u","b","100"],["17.4","2025-02-26","u","b","100"],["17.5","2025-04-08","u","b","100"],["17.6","2025-05-15","u","b","123"],["17.7","2025-06-11","u","b","123"],["17.8","2025-07-30","u","b","123"],["18.0","2025-08-17","u","b","123"],["18.1","2025-10-04","u","b","123"],["18.2","2025-11-04","u","b","123"]]},qq_android:{releases:[["6.0","u","u","b","37"],["6.1","u","u","b","37"],["6.2","u","u","b","37"],["6.3","u","u","b","37"],["6.4","u","u","b","37"],["6.6","u","u","b","37"],["6.7","u","u","b","37"],["6.8","u","u","b","37"],["6.9","u","u","b","37"],["7.0","u","u","b","37"],["7.1","u","u","b","37"],["7.2","u","u","b","37"],["7.3","u","u","b","37"],["7.4","u","u","b","37"],["7.5","u","u","b","37"],["7.6","u","u","b","37"],["7.7","u","u","b","37"],["7.8","u","u","b","37"],["7.9","u","u","b","37"],["8.0","u","u","b","37"],["8.1","u","u","b","57"],["8.2","u","u","b","57"],["8.3","u","u","b","57"],["8.4","u","u","b","57"],["8.5","u","u","b","57"],["8.6","u","u","b","57"],["8.7","u","u","b","57"],["8.8","u","u","b","57"],["8.9","u","u","b","57"],["9.1","u","u","b","57"],["9.6","u","u","b","66"],["9.7","u","u","b","66"],["9.8","u","u","b","66"],["10.0","u","u","b","66"],["10.1","u","u","b","66"],["10.2","u","u","b","66"],["10.3","u","u","b","66"],["10.4","u","u","b","66"],["10.5","u","u","b","66"],["10.7","2020-09-09","u","b","66"],["10.9","2020-11-22","u","b","77"],["11.0","u","u","b","77"],["11.2","2021-01-30","u","b","77"],["11.3","2021-03-31","u","b","77"],["11.7","2021-11-02","u","b","89"],["11.9","u","u","b","89"],["12.0","2021-11-04","u","b","89"],["12.1","2021-11-05","u","b","89"],["12.2","2021-12-07","u","b","89"],["12.5","2022-04-07","u","b","89"],["12.7","2022-05-21","u","b","89"],["12.8","2022-06-30","u","b","89"],["12.9","2022-07-26","u","b","89"],["13.0","2022-08-15","u","b","89"],["13.1","2022-09-10","u","b","89"],["13.2","2022-10-26","u","b","89"],["13.3","2022-11-09","u","b","89"],["13.4","2023-04-26","u","b","98"],["13.5","2023-02-06","u","b","98"],["13.6","2023-02-09","u","b","98"],["13.7","2023-04-21","u","b","98"],["13.8","2023-04-21","u","b","98"],["14.0","2023-12-12","u","b","98"],["14.1","2023-07-16","u","b","98"],["14.2","2023-10-14","u","b","109"],["14.3","2023-09-13","u","b","109"],["14.4","2023-10-31","u","b","109"],["14.5","2023-11-12","u","b","109"],["14.6","2023-12-24","u","b","109"],["14.7","2024-01-18","u","b","109"],["14.8","2024-03-04","u","b","109"],["14.9","2024-04-09","u","b","109"],["15.0","2024-04-17","u","b","109"],["15.1","2024-05-18","u","b","109"],["15.2","2024-10-24","u","b","109"],["15.3","2024-07-28","u","b","109"],["15.4","2024-09-07","u","b","109"],["15.5","2024-09-24","u","b","109"],["15.6","2024-10-24","u","b","109"],["15.7","2024-12-03","u","b","109"],["15.8","2024-12-11","u","b","109"],["15.9","2025-02-01","u","b","109"],["19.1","2025-07-08","u","b","121"],["19.2","2025-07-15","u","b","121"],["19.3","2025-08-31","u","b","121"],["19.4","2025-09-20","u","b","121"],["19.5","2025-10-23","u","b","121"],["19.6","2025-11-17","u","b","121"]]},kai_os:{releases:[["1.0","2017-03-01","u","g","37"],["2.0","2017-07-01","u","g","48"],["2.5","2017-07-01","u","g","48"],["3.0","2021-09-01","u","g","84"],["3.1","2022-03-01","u","g","84"],["4.0","2025-05-01","u","g","123"]]},facebook_android:{releases:[["66","u","u","b","48"],["68","u","u","b","48"],["74","u","u","b","50"],["75","u","u","b","50"],["76","u","u","b","50"],["77","u","u","b","50"],["78","u","u","b","50"],["79","u","u","b","50"],["80","u","u","b","51"],["81","u","u","b","51"],["82","u","u","b","51"],["83","u","u","b","51"],["84","u","u","b","51"],["86","u","u","b","51"],["87","u","u","b","52"],["88","u","u","b","52"],["89","u","u","b","52"],["90","u","u","b","52"],["91","u","u","b","52"],["92","u","u","b","52"],["93","u","u","b","52"],["94","u","u","b","52"],["95","u","u","b","53"],["96","u","u","b","53"],["97","u","u","b","53"],["98","u","u","b","53"],["99","u","u","b","53"],["100","u","u","b","54"],["101","u","u","b","54"],["103","u","u","b","54"],["104","u","u","b","54"],["105","u","u","b","54"],["106","u","u","b","55"],["107","u","u","b","55"],["108","u","u","b","55"],["109","u","u","b","55"],["110","u","u","b","55"],["111","u","u","b","55"],["112","u","u","b","56"],["113","u","u","b","56"],["114","u","u","b","56"],["115","u","u","b","56"],["116","u","u","b","56"],["117","u","u","b","57"],["118","u","u","b","57"],["119","u","u","b","57"],["120","u","u","b","57"],["121","u","u","b","57"],["122","u","u","b","58"],["123","u","u","b","58"],["124","u","u","b","58"],["125","u","u","b","58"],["126","u","u","b","58"],["127","u","u","b","58"],["128","u","u","b","58"],["129","u","u","b","58"],["130","u","u","b","59"],["131","u","u","b","59"],["132","u","u","b","59"],["133","u","u","b","59"],["134","u","u","b","59"],["135","u","u","b","59"],["136","u","u","b","59"],["137","u","u","b","59"],["138","u","u","b","60"],["140","u","u","b","60"],["142","u","u","b","61"],["143","u","u","b","61"],["144","u","u","b","61"],["145","u","u","b","61"],["146","u","u","b","61"],["147","u","u","b","61"],["148","u","u","b","61"],["149","u","u","b","62"],["150","u","u","b","62"],["151","u","u","b","62"],["152","u","u","b","62"],["153","u","u","b","63"],["154","u","u","b","63"],["155","u","u","b","63"],["156","u","u","b","63"],["157","u","u","b","64"],["158","u","u","b","64"],["159","u","u","b","64"],["160","u","u","b","64"],["161","u","u","b","64"],["162","u","u","b","64"],["163","u","u","b","65"],["164","u","u","b","65"],["165","u","u","b","65"],["166","u","u","b","65"],["167","u","u","b","65"],["168","u","u","b","65"],["169","u","u","b","66"],["170","u","u","b","66"],["171","u","u","b","66"],["172","u","u","b","66"],["173","u","u","b","66"],["174","u","u","b","66"],["175","u","u","b","67"],["176","u","u","b","67"],["177","u","u","b","67"],["178","u","u","b","67"],["180","u","u","b","67"],["181","u","u","b","67"],["182","u","u","b","67"],["183","u","u","b","68"],["184","u","u","b","68"],["185","u","u","b","68"],["186","u","u","b","68"],["187","u","u","b","68"],["188","u","u","b","68"],["202","u","u","b","71"],["227","u","u","b","75"],["228","u","u","b","75"],["229","u","u","b","75"],["230","u","u","b","75"],["231","u","u","b","75"],["233","u","u","b","76"],["235","u","u","b","76"],["236","u","u","b","76"],["237","u","u","b","76"],["238","u","u","b","76"],["240","u","u","b","77"],["241","u","u","b","77"],["242","u","u","b","77"],["243","u","u","b","77"],["244","u","u","b","78"],["245","u","u","b","78"],["246","u","u","b","78"],["247","u","u","b","78"],["248","u","u","b","78"],["249","u","u","b","78"],["250","u","u","b","78"],["251","u","u","b","79"],["252","u","u","b","79"],["253","u","u","b","79"],["254","u","u","b","79"],["255","u","u","b","79"],["256","u","u","b","80"],["257","u","u","b","80"],["258","u","u","b","80"],["259","u","u","b","80"],["260","u","u","b","80"],["261","u","u","b","80"],["262","u","u","b","80"],["263","u","u","b","80"],["264","u","u","b","80"],["265","u","u","b","80"],["266","u","u","b","81"],["267","u","u","b","81"],["268","u","u","b","81"],["269","u","u","b","81"],["270","u","u","b","81"],["271","u","u","b","81"],["272","u","u","b","83"],["273","u","u","b","83"],["274","u","u","b","83"],["275","u","u","b","83"],["297","2020-12-02","u","b","86"],["348","2021-12-19","u","b","96"],["399","2023-02-04","u","b","109"],["400","2023-02-10","u","b","109"],["420","2023-06-28","u","b","114"],["430","2023-09-03","u","b","116"],["434","2023-10-05","u","b","117"],["436","2023-10-13","u","b","117"],["437","u","u","b","118"],["438","2023-10-28","u","b","118"],["439","2023-11-11","u","b","119"],["440","2023-11-12","u","b","119"],["441","2023-11-20","u","b","119"],["442","2023-11-29","u","b","119"],["443","2023-12-07","u","b","120"],["444","2023-12-13","u","b","120"],["445","2023-12-21","u","b","120"],["446","2024-01-06","u","b","120"],["447","2024-01-12","u","b","120"],["448","2024-01-29","u","b","121"],["449","2024-02-02","u","b","121"],["450","2024-02-05","u","b","121"],["451","2024-02-17","u","b","121"],["452","2024-02-25","u","b","122"],["453","2024-02-28","u","b","122"],["454","2024-03-04","u","b","122"],["465","2024-07-07","u","b","126"],["466","u","u","b","126"],["469","u","u","b","126"],["471","2024-07-10","u","b","126"],["472","2024-07-11","u","b","126"],["474","2024-07-30","u","b","127"],["475","2024-08-01","u","b","127"],["476","2024-08-09","u","b","127"],["477","2024-08-16","u","b","127"],["478","2024-08-21","u","b","128"],["479","2024-08-31","u","b","128"],["480","2024-09-07","u","b","128"],["481","2024-09-14","u","b","128"],["482","2024-09-20","u","b","129"],["483","2024-09-27","u","b","129"],["484","2024-10-04","u","b","129"],["485","2024-10-11","u","b","129"],["486","2024-10-18","u","b","130"],["487","2024-10-26","u","b","130"],["488","2024-11-02","u","b","130"],["489","2024-11-09","u","b","130"],["494","2024-12-26","u","b","131"],["497","2025-01-26","u","b","132"],["503","2025-03-12","u","b","134"],["514","2025-05-28","u","b","136"],["515","2025-05-31","u","b","137"]]},instagram_android:{releases:[["23","u","u","b","62"],["24","u","u","b","62"],["25","u","u","b","62"],["26","u","u","b","63"],["27","u","u","b","63"],["28","u","u","b","63"],["29","u","u","b","63"],["30","u","u","b","63"],["31","u","u","b","64"],["32","u","u","b","64"],["33","u","u","b","64"],["34","u","u","b","64"],["35","u","u","b","65"],["36","u","u","b","65"],["37","u","u","b","65"],["38","u","u","b","65"],["39","u","u","b","65"],["40","u","u","b","65"],["41","u","u","b","65"],["42","u","u","b","66"],["43","u","u","b","66"],["44","u","u","b","66"],["45","u","u","b","66"],["46","u","u","b","66"],["47","u","u","b","66"],["48","u","u","b","67"],["49","u","u","b","67"],["50","u","u","b","67"],["51","u","u","b","67"],["52","u","u","b","67"],["53","u","u","b","67"],["54","u","u","b","67"],["55","u","u","b","67"],["56","u","u","b","68"],["57","u","u","b","68"],["58","u","u","b","68"],["59","u","u","b","68"],["60","u","u","b","68"],["61","u","u","b","68"],["65","u","u","b","69"],["66","u","u","b","69"],["68","u","u","b","69"],["72","u","u","b","70"],["74","u","u","b","71"],["75","u","u","b","71"],["79","u","u","b","71"],["81","u","u","b","72"],["82","u","u","b","72"],["83","u","u","b","72"],["84","u","u","b","73"],["86","u","u","b","73"],["95","u","u","b","74"],["96","u","u","b","80"],["97","u","u","b","80"],["98","u","u","b","80"],["103","u","u","b","80"],["104","u","u","b","80"],["117","u","u","b","80"],["118","u","u","b","80"],["119","u","u","b","80"],["120","u","u","b","80"],["121","u","u","b","80"],["127","u","u","b","80"],["128","u","u","b","80"],["129","u","u","b","80"],["130","u","u","b","80"],["131","u","u","b","80"],["132","u","u","b","80"],["133","u","u","b","80"],["134","u","u","b","80"],["135","u","u","b","80"],["136","u","u","b","80"],["137","u","u","b","81"],["138","u","u","b","81"],["139","u","u","b","81"],["140","u","u","b","81"],["141","u","u","b","81"],["142","u","u","b","81"],["143","u","u","b","83"],["144","u","u","b","83"],["145","u","u","b","83"],["146","u","u","b","83"],["153","u","u","b","84"],["163","u","u","b","92"],["164","u","u","b","92"],["230","u","u","b","92"],["258","2022-11-04","u","b","106"],["259","2022-11-04","u","b","106"],["279","2023-12-31","u","b","109"],["281","u","u","b","109"],["288","u","u","b","114"],["289","2023-12-21","u","b","114"],["290","2023-12-30","u","b","114"],["292","u","u","b","115"],["295","u","u","b","115"],["296","u","u","b","115"],["297","u","u","b","115"],["298","2024-01-11","u","b","115"],["299","u","u","b","115"],["300","u","u","b","116"],["301","2024-01-12","u","b","116"],["302","u","u","b","117"],["303","u","u","b","117"],["304","u","u","b","117"],["305","u","u","b","117"],["306","2024-01-17","u","b","118"],["307","u","u","b","118"],["308","2024-01-19","u","b","118"],["309","u","u","b","119"],["310","u","u","b","119"],["311","u","u","b","120"],["312","u","u","b","120"],["313","u","u","b","120"],["314","u","u","b","120"],["315","2024-01-19","u","b","120"],["316","2024-01-25","u","b","120"],["317","2024-02-03","u","b","121"],["318","2024-02-16","u","b","121"],["320","2024-03-04","u","b","121"],["321","2024-03-07","u","b","122"],["338","2024-07-06","u","b","126"],["346","2024-09-01","u","b","127"],["347","2024-09-11","u","b","127"],["349","2024-09-20","u","b","128"],["355","2024-11-06","u","b","130"],["366","u","u","b","132"],["367","2025-02-15","u","b","132"],["378","2025-05-03","u","b","135"],["381","2025-06-19","u","b","137"],["382","2025-06-19","u","b","137"],["383","2025-06-18","u","b","137"],["384","2025-06-16","u","b","137"],["385","2025-06-27","u","b","137"],["387","2025-07-09","u","b","137"],["390","2025-07-26","u","b","138"],["392","2025-08-12","u","b","138"],["394","2025-08-26","u","b","139"],["395","2025-09-13","u","b","139"],["396","2025-09-20","u","b","139"],["397","2025-09-19","u","b","139"],["399","2025-09-28","u","b","140"],["400","2025-10-06","u","b","141"],["401","2025-10-08","u","b","141"],["404","2025-10-31","u","b","141"],["406","2025-11-16","u","b","141"],["407","2025-11-23","u","b","142"],["408","2025-11-28","u","b","142"]]}},r=[["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"4",s:"4",si:"3.2"}],["2019-03-25",{c:"66",ca:"66",e:"16",f:"57",fa:"57",s:"12.1",si:"12.2"}],["2019-03-25",{c:"66",ca:"66",e:"16",f:"57",fa:"57",s:"12.1",si:"12.2"}],["2024-03-19",{c:"116",ca:"116",e:"116",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2025-06-26",{c:"138",ca:"138",e:"138",f:"118",fa:"118",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"17",ca:"18",e:"12",f:"5",fa:"5",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-04-16",{c:"123",ca:"123",e:"123",f:"125",fa:"125",s:"17.4",si:"17.4"}],["2020-01-15",{c:"37",ca:"37",e:"79",f:"27",fa:"27",s:"9.1",si:"9.3"}],["2024-07-09",{c:"77",ca:"77",e:"79",f:"128",fa:"128",s:"17.4",si:"17.4"}],["2016-06-07",{c:"32",ca:"30",e:"12",f:"47",fa:"47",s:"8",si:"8"}],["2023-07-04",{c:"112",ca:"112",e:"112",f:"115",fa:"115",s:"16",si:"16"}],["2015-09-30",{c:"43",ca:"43",e:"12",f:"16",fa:"16",s:"9",si:"9"}],["2022-03-14",{c:"84",ca:"84",e:"84",f:"80",fa:"80",s:"15.4",si:"15.4"}],["2023-10-24",{c:"103",ca:"103",e:"103",f:"119",fa:"119",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-03-14",{c:"92",ca:"92",e:"92",f:"90",fa:"90",s:"15.4",si:"15.4"}],["2023-07-04",{c:"110",ca:"110",e:"110",f:"115",fa:"115",s:"16",si:"16"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"34",fa:"34",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"37",fa:"37",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"37",fa:"37",s:"10",si:"10"}],["2022-08-23",{c:"97",ca:"97",e:"97",f:"104",fa:"104",s:"15.4",si:"15.4"}],["2020-01-15",{c:"69",ca:"69",e:"79",f:"62",fa:"62",s:"12",si:"12"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"38",fa:"38",s:"10",si:"10"}],["2024-01-25",{c:"121",ca:"121",e:"121",f:"115",fa:"115",s:"16.4",si:"16.4"}],["2024-03-05",{c:"117",ca:"117",e:"117",f:"119",fa:"119",s:"17.4",si:"17.4"}],["2016-09-20",{c:"47",ca:"47",e:"14",f:"43",fa:"43",s:"10",si:"10"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"5"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3",fa:"4",s:"4",si:"3.2"}],["2018-05-09",{c:"66",ca:"66",e:"14",f:"60",fa:"60",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"38",fa:"38",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2021-09-20",{c:"88",ca:"88",e:"88",f:"89",fa:"89",s:"15",si:"15"}],["2017-04-05",{c:"55",ca:"55",e:"15",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2024-06-11",{c:"76",ca:"76",e:"79",f:"127",fa:"127",s:"13.1",si:"13.4"}],["2020-01-15",{c:"63",ca:"63",e:"79",f:"57",fa:"57",s:"12",si:"12"}],["2020-01-15",{c:"63",ca:"63",e:"79",f:"57",fa:"57",s:"12",si:"12"}],["2025-04-01",{c:"133",ca:"133",e:"133",f:"137",fa:"137",s:"18.4",si:"18.4"}],["2025-11-11",{c:"90",ca:"90",e:"90",f:"145",fa:"145",s:"16.4",si:"16.4"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"3"}],["2021-04-26",{c:"66",ca:"66",e:"79",f:"76",fa:"79",s:"14.1",si:"14.5"}],["2023-02-09",{c:"110",ca:"110",e:"110",f:"86",fa:"86",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"4",si:"3.2"}],["2020-01-15",{c:"54",ca:"54",e:"79",f:"63",fa:"63",s:"10.1",si:"10.3"}],["2024-01-26",{c:"85",ca:"85",e:"121",f:"93",fa:"93",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-03-14",{c:"37",ca:"37",e:"79",f:"47",fa:"47",s:"15.4",si:"15.4"}],["2024-09-16",{c:"76",ca:"76",e:"79",f:"103",fa:"103",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.6",fa:"4",s:"1.3",si:"1"}],["2022-03-14",{c:"1",ca:"18",e:"12",f:"25",fa:"25",s:"15.4",si:"15.4"}],["2020-01-15",{c:"35",ca:"59",e:"79",f:"30",fa:"54",s:"8",si:"8"}],["2015-07-29",{c:"21",ca:"25",e:"12",f:"22",fa:"22",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.6",fa:"4",s:"1.3",si:"1"}],["2015-07-29",{c:"21",ca:"25",e:"12",f:"22",fa:"22",s:"5.1",si:"4"}],["2015-07-29",{c:"25",ca:"25",e:"12",f:"13",fa:"14",s:"7",si:"7"}],["2016-09-20",{c:"30",ca:"30",e:"12",f:"49",fa:"49",s:"8",si:"8"}],["2015-07-29",{c:"21",ca:"25",e:"12",f:"9",fa:"18",s:"5.1",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2016-09-20",{c:"30",ca:"30",e:"12",f:"4",fa:"4",s:"10",si:"10"}],["2020-01-15",{c:"16",ca:"18",e:"79",f:"10",fa:"10",s:"6",si:"6"}],["2015-07-29",{c:"≤15",ca:"18",e:"12",f:"10",fa:"10",s:"≤4",si:"≤3.2"}],["2018-04-12",{c:"39",ca:"42",e:"14",f:"31",fa:"31",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"3.2"}],["2020-09-16",{c:"67",ca:"67",e:"79",f:"68",fa:"68",s:"14",si:"14"}],["2021-09-20",{c:"67",ca:"67",e:"79",f:"68",fa:"68",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2017-02-01",{c:"56",ca:"56",e:"12",f:"50",fa:"50",s:"9.1",si:"9.3"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"14",s:"1",si:"3"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"5"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"29",fa:"29",s:"5.1",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2022-03-14",{c:"54",ca:"54",e:"79",f:"38",fa:"38",s:"15.4",si:"15.4"}],["2017-09-19",{c:"50",ca:"51",e:"15",f:"44",fa:"44",s:"11",si:"11"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"26",ca:"28",e:"12",f:"16",fa:"16",s:"7",si:"7"}],["2023-06-06",{c:"110",ca:"110",e:"110",f:"114",fa:"114",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"2",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"2",si:"1"}],["2024-09-16",{c:"99",ca:"99",e:"99",f:"28",fa:"28",s:"18",si:"18"}],["2023-04-11",{c:"99",ca:"99",e:"99",f:"112",fa:"112",s:"16.4",si:"16.4"}],["2023-12-11",{c:"99",ca:"99",e:"99",f:"113",fa:"113",s:"17.2",si:"17.2"}],["2023-04-11",{c:"99",ca:"99",e:"99",f:"112",fa:"112",s:"16.4",si:"16.4"}],["2023-12-11",{c:"118",ca:"118",e:"118",f:"97",fa:"97",s:"17.2",si:"17.2"}],["2020-01-15",{c:"51",ca:"51",e:"79",f:"43",fa:"43",s:"11",si:"11"}],["2020-01-15",{c:"57",ca:"57",e:"79",f:"53",fa:"53",s:"11.1",si:"11.3"}],["2022-03-14",{c:"99",ca:"99",e:"99",f:"97",fa:"97",s:"15.4",si:"15.4"}],["2020-01-15",{c:"49",ca:"49",e:"79",f:"47",fa:"47",s:"9",si:"9"}],["2015-07-29",{c:"27",ca:"27",e:"12",f:"1",fa:"4",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2015-09-22",{c:"4",ca:"18",e:"12",f:"41",fa:"41",s:"5",si:"4.2"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"4"}],["2024-03-05",{c:"105",ca:"105",e:"105",f:"106",fa:"106",s:"17.4",si:"17.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2016-03-08",{c:"42",ca:"42",e:"13",f:"45",fa:"45",s:"9",si:"9"}],["2023-09-18",{c:"117",ca:"117",e:"117",f:"63",fa:"63",s:"17",si:"17"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"71",fa:"79",s:"13.1",si:"13"}],["2020-01-15",{c:"55",ca:"55",e:"79",f:"49",fa:"49",s:"12.1",si:"12.2"}],["2023-11-02",{c:"119",ca:"119",e:"119",f:"54",fa:"54",s:"13.1",si:"13.4"}],["2017-03-27",{c:"41",ca:"41",e:"12",f:"22",fa:"22",s:"10.1",si:"10.3"}],["2025-03-31",{c:"121",ca:"121",e:"121",f:"127",fa:"127",s:"18.4",si:"18.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"15",si:"15"}],["2023-02-14",{c:"58",ca:"58",e:"79",f:"110",fa:"110",s:"10",si:"10"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"16.2",si:"16.2"}],["2022-02-03",{c:"98",ca:"98",e:"98",f:"96",fa:"96",s:"13",si:"13"}],["2020-01-15",{c:"53",ca:"53",e:"79",f:"31",fa:"31",s:"11.1",si:"11.3"}],["2017-03-07",{c:"50",ca:"50",e:"12",f:"52",fa:"52",s:"9",si:"9"}],["2020-07-28",{c:"50",ca:"50",e:"12",f:"71",fa:"79",s:"9",si:"9"}],["2025-08-19",{c:"137",ca:"137",e:"137",f:"142",fa:"142",s:"17",si:"17"}],["2017-04-19",{c:"26",ca:"26",e:"12",f:"53",fa:"53",s:"7",si:"7"}],["2023-05-09",{c:"80",ca:"80",e:"80",f:"113",fa:"113",s:"16.4",si:"16.4"}],["2020-11-17",{c:"69",ca:"69",e:"79",f:"83",fa:"83",s:"12.1",si:"12.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"4",fa:"4",s:"3",si:"1"}],["2018-12-11",{c:"40",ca:"40",e:"18",f:"51",fa:"64",s:"10.1",si:"10.3"}],["2023-03-27",{c:"73",ca:"73",e:"79",f:"101",fa:"101",s:"16.4",si:"16.4"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-09-12",{c:"105",ca:"105",e:"105",f:"101",fa:"101",s:"16",si:"16"}],["2023-09-18",{c:"83",ca:"83",e:"83",f:"107",fa:"107",s:"17",si:"17"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-07-26",{c:"52",ca:"52",e:"79",f:"103",fa:"103",s:"15.4",si:"15.4"}],["2023-02-14",{c:"105",ca:"105",e:"105",f:"110",fa:"110",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-09-15",{c:"108",ca:"108",e:"108",f:"130",fa:"130",s:"26",si:"26"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"4",fa:"4",s:"≤4",si:"≤3.2"}],["2025-03-04",{c:"51",ca:"51",e:"12",f:"136",fa:"136",s:"5.1",si:"5"}],["2024-09-16",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"3.2"}],["2023-12-11",{c:"85",ca:"85",e:"85",f:"68",fa:"68",s:"17.2",si:"17.2"}],["2023-09-18",{c:"91",ca:"91",e:"91",f:"33",fa:"33",s:"17",si:"17"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"25",s:"3",si:"1"}],["2023-12-11",{c:"59",ca:"59",e:"79",f:"98",fa:"98",s:"17.2",si:"17.2"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"60",fa:"60",s:"13",si:"13"}],["2016-08-02",{c:"25",ca:"25",e:"14",f:"23",fa:"23",s:"7",si:"7"}],["2020-01-15",{c:"46",ca:"46",e:"79",f:"31",fa:"31",s:"10.1",si:"10.3"}],["2015-09-30",{c:"28",ca:"28",e:"12",f:"22",fa:"22",s:"9",si:"9"}],["2020-01-15",{c:"61",ca:"61",e:"79",f:"55",fa:"55",s:"11",si:"11"}],["2015-07-29",{c:"16",ca:"18",e:"12",f:"4",fa:"4",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"3.2"}],["2017-04-05",{c:"49",ca:"49",e:"15",f:"31",fa:"31",s:"9.1",si:"9.3"}],["2017-10-24",{c:"62",ca:"62",e:"14",f:"22",fa:"22",s:"10",si:"10"}],["2015-07-29",{c:"≤4",ca:"18",e:"12",f:"≤2",fa:"4",s:"≤3.1",si:"≤2"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"6",fa:"6",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-02-20",{c:"111",ca:"111",e:"111",f:"123",fa:"123",s:"16.4",si:"16.4"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"4",si:"5"}],["2020-01-15",{c:"10",ca:"18",e:"79",f:"4",fa:"4",s:"5",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"55",fa:"55",s:"11.1",si:"11.3"}],["2020-01-15",{c:"12",ca:"18",e:"79",f:"49",fa:"49",s:"6",si:"6"}],["2025-09-16",{c:"131",ca:"131",e:"131",f:"143",fa:"143",s:"18.4",si:"18.4"}],["2024-09-03",{c:"120",ca:"120",e:"120",f:"130",fa:"130",s:"17.2",si:"17.2"}],["2023-09-18",{c:"31",ca:"31",e:"12",f:"6",fa:"6",s:"17",si:"4.2"}],["2015-07-29",{c:"15",ca:"18",e:"12",f:"1",fa:"4",s:"6",si:"6"}],["2022-03-14",{c:"37",ca:"37",e:"79",f:"98",fa:"98",s:"15.4",si:"15.4"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"49",fa:"49",s:"16.4",si:"16.4"}],["2023-08-01",{c:"17",ca:"18",e:"79",f:"116",fa:"116",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"58",ca:"58",e:"79",f:"53",fa:"53",s:"13",si:"13"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["≤2017-04-05",{c:"1",ca:"18",e:"≤15",f:"3",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"61",ca:"61",e:"79",f:"33",fa:"33",s:"11",si:"11"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"1",fa:"4",s:"4",si:"3.2"}],["2016-03-21",{c:"31",ca:"31",e:"12",f:"12",fa:"14",s:"9.1",si:"9.3"}],["2019-09-19",{c:"14",ca:"18",e:"18",f:"20",fa:"20",s:"10.1",si:"13"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"3.2"}],["2022-05-03",{c:"98",ca:"98",e:"98",f:"100",fa:"100",s:"13.1",si:"13.4"}],["2020-01-15",{c:"43",ca:"43",e:"79",f:"46",fa:"46",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"1.5",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2019-03-25",{c:"42",ca:"42",e:"13",f:"38",fa:"38",s:"12.1",si:"12.2"}],["2021-11-02",{c:"77",ca:"77",e:"79",f:"94",fa:"94",s:"13.1",si:"13.4"}],["2021-09-20",{c:"93",ca:"93",e:"93",f:"91",fa:"91",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"118",fa:"118",s:"15.4",si:"15.4"}],["2017-03-27",{c:"52",ca:"52",e:"14",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2018-04-30",{c:"38",ca:"38",e:"17",f:"47",fa:"35",s:"9",si:"9"}],["2021-09-20",{c:"56",ca:"56",e:"79",f:"51",fa:"51",s:"15",si:"15"}],["2020-09-16",{c:"63",ca:"63",e:"17",f:"47",fa:"36",s:"14",si:"14"}],["2020-02-07",{c:"40",ca:"40",e:"80",f:"58",fa:"28",s:"9",si:"9"}],["2016-06-07",{c:"34",ca:"34",e:"12",f:"47",fa:"47",s:"9.1",si:"9.3"}],["2017-03-27",{c:"42",ca:"42",e:"14",f:"39",fa:"39",s:"10.1",si:"10.3"}],["2024-10-29",{c:"103",ca:"103",e:"103",f:"132",fa:"132",s:"17.2",si:"17.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"8",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"5"}],["2020-01-15",{c:"38",ca:"38",e:"79",f:"28",fa:"28",s:"10.1",si:"10.3"}],["2021-04-26",{c:"89",ca:"89",e:"89",f:"82",fa:"82",s:"14.1",si:"14.5"}],["2016-09-07",{c:"53",ca:"53",e:"12",f:"35",fa:"35",s:"9.1",si:"9.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-11-02",{c:"46",ca:"46",e:"79",f:"94",fa:"94",s:"11",si:"11"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-09-30",{c:"29",ca:"29",e:"12",f:"20",fa:"20",s:"9",si:"9"}],["2021-04-26",{c:"84",ca:"84",e:"84",f:"63",fa:"63",s:"14.1",si:"14.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-04-04",{c:"135",ca:"135",e:"135",f:"129",fa:"129",s:"18.2",si:"18.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"24",fa:"24",s:"3.1",si:"2"}],["2022-03-14",{c:"86",ca:"86",e:"86",f:"85",fa:"85",s:"15.4",si:"15.4"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"58",fa:"58",s:"11.1",si:"11.3"}],["2016-09-20",{c:"36",ca:"36",e:"14",f:"39",fa:"39",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-09-07",{c:"56",ca:"56",e:"79",f:"92",fa:"92",s:"11",si:"11"}],["2017-04-05",{c:"48",ca:"48",e:"15",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"33",ca:"33",e:"79",f:"32",fa:"32",s:"9",si:"9"}],["2020-01-15",{c:"35",ca:"35",e:"79",f:"41",fa:"41",s:"10",si:"10"}],["2020-03-24",{c:"79",ca:"79",e:"17",f:"62",fa:"62",s:"13.1",si:"13.4"}],["2022-11-15",{c:"101",ca:"101",e:"101",f:"107",fa:"107",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-07-25",{c:"127",ca:"127",e:"127",f:"118",fa:"118",s:"17",si:"17"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-01-06",{c:"97",ca:"97",e:"97",f:"34",fa:"34",s:"9",si:"9"}],["2023-03-27",{c:"97",ca:"97",e:"97",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2023-03-27",{c:"97",ca:"97",e:"97",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2023-03-27",{c:"97",ca:"97",e:"97",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-03-13",{c:"111",ca:"111",e:"111",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"52",ca:"52",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"63",ca:"63",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"34",ca:"34",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"52",ca:"52",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2018-09-05",{c:"62",ca:"62",e:"17",f:"62",fa:"62",s:"11",si:"11"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-09-12",{c:"89",ca:"89",e:"79",f:"89",fa:"89",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2023-03-27",{c:"77",ca:"77",e:"79",f:"98",fa:"98",s:"16.4",si:"16.4"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-27",{c:"35",ca:"35",e:"12",f:"29",fa:"32",s:"10.1",si:"10.3"}],["2016-09-20",{c:"39",ca:"39",e:"13",f:"26",fa:"26",s:"10",si:"10"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"3.5",fa:"4",s:"5",si:"≤3"}],["2015-07-29",{c:"11",ca:"18",e:"12",f:"3.5",fa:"4",s:"5.1",si:"5"}],["2024-09-16",{c:"125",ca:"125",e:"125",f:"128",fa:"128",s:"18",si:"18"}],["2020-01-15",{c:"71",ca:"71",e:"79",f:"65",fa:"65",s:"12.1",si:"12.2"}],["2024-06-11",{c:"111",ca:"111",e:"111",f:"127",fa:"127",s:"16.2",si:"16.2"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"3.6",fa:"4",s:"7",si:"7"}],["2017-10-17",{c:"57",ca:"57",e:"16",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2022-10-27",{c:"107",ca:"107",e:"107",f:"66",fa:"66",s:"16",si:"16"}],["2022-03-14",{c:"37",ca:"37",e:"15",f:"48",fa:"48",s:"15.4",si:"15.4"}],["2023-12-19",{c:"105",ca:"105",e:"105",f:"121",fa:"121",s:"15.4",si:"15.4"}],["2020-03-24",{c:"74",ca:"74",e:"79",f:"67",fa:"67",s:"13.1",si:"13.4"}],["2015-07-29",{c:"16",ca:"18",e:"12",f:"11",fa:"14",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4"}],["2020-01-15",{c:"54",ca:"54",e:"79",f:"63",fa:"63",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2020-01-15",{c:"65",ca:"65",e:"79",f:"52",fa:"52",s:"12.1",si:"12.2"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"36",fa:"36",s:"9",si:"9"}],["2024-09-16",{c:"87",ca:"87",e:"87",f:"88",fa:"88",s:"18",si:"18"}],["2022-04-28",{c:"101",ca:"101",e:"101",f:"96",fa:"96",s:"15",si:"15"}],["2023-09-18",{c:"106",ca:"106",e:"106",f:"98",fa:"98",s:"17",si:"17"}],["2023-09-18",{c:"88",ca:"55",e:"88",f:"43",fa:"43",s:"17",si:"17"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-10-03",{c:"106",ca:"106",e:"106",f:"97",fa:"97",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"17",fa:"17",s:"5",si:"4"}],["2020-01-15",{c:"20",ca:"25",e:"79",f:"25",fa:"25",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-04-13",{c:"81",ca:"81",e:"81",f:"26",fa:"26",s:"13.1",si:"13.4"}],["2021-10-05",{c:"41",ca:"41",e:"79",f:"93",fa:"93",s:"10",si:"10"}],["2023-09-18",{c:"113",ca:"113",e:"113",f:"89",fa:"89",s:"17",si:"17"}],["2020-01-15",{c:"66",ca:"66",e:"79",f:"50",fa:"50",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-03-27",{c:"89",ca:"89",e:"89",f:"108",fa:"108",s:"16.4",si:"16.4"}],["2020-01-15",{c:"39",ca:"39",e:"79",f:"51",fa:"51",s:"10",si:"10"}],["2021-09-20",{c:"58",ca:"58",e:"79",f:"51",fa:"51",s:"15",si:"15"}],["2022-08-05",{c:"104",ca:"104",e:"104",f:"72",fa:"79",s:"14.1",si:"14.5"}],["2023-04-11",{c:"102",ca:"102",e:"102",f:"112",fa:"112",s:"15.5",si:"15.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-11-12",{c:"1",ca:"18",e:"13",f:"19",fa:"19",s:"1.2",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.6",fa:"4",s:"3",si:"1"}],["2021-04-26",{c:"20",ca:"25",e:"12",f:"57",fa:"57",s:"14.1",si:"5"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"3"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"6",fa:"6",s:"3.1",si:"2"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3",fa:"4",s:"4",si:"3"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3.6",fa:"4",s:"4",si:"3.2"}],["2025-08-19",{c:"13",ca:"132",e:"13",f:"50",fa:"142",s:"11.1",si:"18.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"29",fa:"29",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-16",{c:"4",ca:"57",e:"12",f:"23",fa:"52",s:"3.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-12-07",{c:"66",ca:"66",e:"79",f:"95",fa:"79",s:"12.1",si:"12.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2018-12-11",{c:"41",ca:"41",e:"12",f:"64",fa:"64",s:"9",si:"9"}],["2019-03-25",{c:"58",ca:"58",e:"16",f:"55",fa:"55",s:"12.1",si:"12.2"}],["2017-09-28",{c:"24",ca:"25",e:"12",f:"29",fa:"56",s:"10",si:"10"}],["2021-04-26",{c:"81",ca:"81",e:"81",f:"86",fa:"86",s:"14.1",si:"14.5"}],["2025-03-04",{c:"129",ca:"129",e:"129",f:"136",fa:"136",s:"16.4",si:"16.4"}],["2021-04-26",{c:"72",ca:"72",e:"79",f:"78",fa:"79",s:"14.1",si:"14.5"}],["2020-09-16",{c:"74",ca:"74",e:"79",f:"75",fa:"79",s:"14",si:"14"}],["2019-09-19",{c:"63",ca:"63",e:"18",f:"58",fa:"58",s:"13",si:"13"}],["2020-09-16",{c:"71",ca:"71",e:"79",f:"76",fa:"79",s:"14",si:"14"}],["2024-04-16",{c:"87",ca:"87",e:"87",f:"125",fa:"125",s:"14.1",si:"14.5"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"82",fa:"82",s:"14",si:"14"}],["2018-04-12",{c:"55",ca:"55",e:"15",f:"52",fa:"52",s:"11.1",si:"11.3"}],["2020-01-15",{c:"41",ca:"41",e:"79",f:"36",fa:"36",s:"8",si:"8"}],["2025-03-31",{c:"122",ca:"122",e:"122",f:"131",fa:"131",s:"18.4",si:"18.4"}],["2015-07-29",{c:"38",ca:"38",e:"12",f:"13",fa:"14",s:"7",si:"7"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"1",fa:"4",s:"5",si:"4.2"}],["2018-05-09",{c:"61",ca:"61",e:"16",f:"60",fa:"60",s:"11",si:"11"}],["2023-06-06",{c:"80",ca:"80",e:"80",f:"114",fa:"114",s:"15",si:"15"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"4"}],["2025-04-29",{c:"123",ca:"123",e:"123",f:"138",fa:"138",s:"17.2",si:"17.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"6",fa:"6",s:"1.2",si:"1"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"48",ca:"48",e:"79",f:"50",fa:"50",s:"11",si:"11"}],["2016-09-20",{c:"49",ca:"49",e:"14",f:"44",fa:"44",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-11-21",{c:"109",ca:"109",e:"109",f:"120",fa:"120",s:"16.4",si:"16.4"}],["2024-05-13",{c:"123",ca:"123",e:"123",f:"120",fa:"120",s:"17.5",si:"17.5"}],["2020-07-28",{c:"83",ca:"83",e:"83",f:"69",fa:"79",s:"13",si:"13"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-11",{c:"113",ca:"113",e:"113",f:"112",fa:"112",s:"17.2",si:"17.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2025-09-15",{c:"46",ca:"46",e:"79",f:"127",fa:"127",s:"5",si:"26"}],["2020-01-15",{c:"46",ca:"46",e:"79",f:"39",fa:"39",s:"11.1",si:"11.3"}],["2021-01-26",{c:"50",ca:"50",e:"79",f:"85",fa:"85",s:"11.1",si:"11.3"}],["2020-01-15",{c:"65",ca:"65",e:"79",f:"50",fa:"50",s:"9",si:"9"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-19",{c:"77",ca:"77",e:"79",f:"121",fa:"121",s:"16.4",si:"16.4"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"6",s:"4",si:"3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-09-16",{c:"85",ca:"85",e:"85",f:"79",fa:"79",s:"14",si:"14"}],["2021-09-20",{c:"89",ca:"89",e:"89",f:"66",fa:"66",s:"15",si:"15"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"21",fa:"21",s:"7",si:"7"}],["2015-07-29",{c:"38",ca:"38",e:"12",f:"13",fa:"14",s:"8",si:"8"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"5"}],["2020-01-15",{c:"24",ca:"25",e:"79",f:"35",fa:"35",s:"7",si:"7"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"53",fa:"53",s:"15.4",si:"15.4"}],["2015-07-29",{c:"9",ca:"18",e:"12",f:"6",fa:"6",s:"5.1",si:"5"}],["2023-01-12",{c:"109",ca:"109",e:"109",f:"4",fa:"4",s:"5.1",si:"5"}],["2022-04-28",{c:"101",ca:"101",e:"101",f:"63",fa:"63",s:"15.4",si:"15.4"}],["2017-09-19",{c:"53",ca:"53",e:"12",f:"36",fa:"36",s:"11",si:"11"}],["2020-02-04",{c:"80",ca:"80",e:"12",f:"42",fa:"42",s:"8",si:"12.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2023-03-27",{c:"104",ca:"104",e:"104",f:"102",fa:"102",s:"16.4",si:"16.4"}],["2021-04-26",{c:"49",ca:"49",e:"79",f:"25",fa:"25",s:"14.1",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2023-03-27",{c:"60",ca:"60",e:"18",f:"57",fa:"57",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2018-10-02",{c:"6",ca:"18",e:"18",f:"56",fa:"56",s:"6",si:"10.3"}],["2020-07-28",{c:"79",ca:"79",e:"79",f:"75",fa:"79",s:"13.1",si:"13.4"}],["2020-01-15",{c:"46",ca:"46",e:"79",f:"66",fa:"66",s:"11",si:"11"}],["2015-07-29",{c:"18",ca:"18",e:"12",f:"1",fa:"4",s:"1.3",si:"1"}],["2020-01-15",{c:"41",ca:"41",e:"79",f:"32",fa:"32",s:"8",si:"8"}],["2020-01-15",{c:"≤79",ca:"≤79",e:"79",f:"≤23",fa:"≤23",s:"≤9.1",si:"≤9.3"}],["2022-09-02",{c:"105",ca:"105",e:"105",f:"103",fa:"103",s:"15.6",si:"15.6"}],["2023-09-18",{c:"66",ca:"66",e:"79",f:"115",fa:"115",s:"17",si:"17"}],["2022-09-12",{c:"55",ca:"55",e:"79",f:"72",fa:"79",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-07",{c:"50",ca:"50",e:"12",f:"52",fa:"52",s:"9",si:"9"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"14",fa:"14",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2021-10-25",{c:"57",ca:"57",e:"12",f:"58",fa:"58",s:"15",si:"15.1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-11",{c:"120",ca:"120",e:"120",f:"117",fa:"117",s:"17.2",si:"17.2"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"84",fa:"84",s:"9",si:"9"}],["2023-03-27",{c:"20",ca:"42",e:"14",f:"22",fa:"22",s:"7",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"2"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"9",si:"9"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"2"}],["2020-09-16",{c:"85",ca:"85",e:"85",f:"79",fa:"79",s:"14",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-07-28",{c:"75",ca:"75",e:"79",f:"70",fa:"79",s:"13",si:"13"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2020-01-15",{c:"32",ca:"32",e:"79",f:"36",fa:"36",s:"10",si:"10"}],["2022-03-14",{c:"93",ca:"93",e:"93",f:"92",fa:"92",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"32",ca:"32",e:"79",f:"36",fa:"36",s:"10",si:"10"}],["2015-07-29",{c:"24",ca:"25",e:"12",f:"24",fa:"24",s:"8",si:"8"}],["2021-04-26",{c:"80",ca:"80",e:"80",f:"71",fa:"79",s:"14.1",si:"14.5"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"10",fa:"10",s:"8",si:"8"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"6",fa:"6",s:"8",si:"8"}],["2015-07-29",{c:"29",ca:"29",e:"12",f:"24",fa:"24",s:"8",si:"8"}],["2016-08-02",{c:"27",ca:"27",e:"14",f:"29",fa:"29",s:"8",si:"8"}],["2018-04-30",{c:"24",ca:"25",e:"17",f:"25",fa:"25",s:"8",si:"9"}],["2021-04-26",{c:"35",ca:"35",e:"12",f:"25",fa:"25",s:"14.1",si:"14.5"}],["2023-03-27",{c:"69",ca:"69",e:"79",f:"105",fa:"105",s:"16.4",si:"16.4"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"15.4",si:"15.4"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"2",si:"1"}],["≤2020-03-24",{c:"≤80",ca:"≤80",e:"≤80",f:"1.5",fa:"4",s:"≤13.1",si:"≤13.4"}],["2020-01-15",{c:"66",ca:"66",e:"79",f:"58",fa:"58",s:"11.1",si:"11.3"}],["2023-03-27",{c:"108",ca:"109",e:"108",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2023-03-27",{c:"94",ca:"94",e:"94",f:"88",fa:"88",s:"16.4",si:"16.4"}],["2017-04-05",{c:"1",ca:"18",e:"15",f:"1.5",fa:"4",s:"1.2",si:"1"}],["≤2018-10-02",{c:"10",ca:"18",e:"≤18",f:"4",fa:"4",s:"7",si:"7"}],["2023-09-18",{c:"113",ca:"113",e:"113",f:"66",fa:"66",s:"17",si:"17"}],["2022-09-12",{c:"90",ca:"90",e:"90",f:"81",fa:"81",s:"16",si:"16"}],["2020-03-24",{c:"68",ca:"68",e:"79",f:"61",fa:"61",s:"13.1",si:"13.4"}],["2018-10-02",{c:"23",ca:"25",e:"18",f:"49",fa:"49",s:"7",si:"7"}],["2022-09-12",{c:"63",ca:"63",e:"18",f:"59",fa:"59",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2019-01-29",{c:"50",ca:"50",e:"12",f:"65",fa:"65",s:"10",si:"10"}],["2024-12-11",{c:"15",ca:"18",e:"79",f:"95",fa:"95",s:"18.2",si:"18.2"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"1.5",fa:"4",s:"5",si:"4"}],["2015-07-29",{c:"33",ca:"33",e:"12",f:"18",fa:"18",s:"7",si:"7"}],["2021-04-26",{c:"60",ca:"60",e:"79",f:"84",fa:"84",s:"14.1",si:"14.5"}],["2025-09-15",{c:"124",ca:"124",e:"124",f:"128",fa:"128",s:"26",si:"26"}],["2023-03-27",{c:"94",ca:"94",e:"94",f:"99",fa:"99",s:"16.4",si:"16.4"}],["2015-09-16",{c:"6",ca:"18",e:"12",f:"7",fa:"7",s:"8",si:"9"}],["2022-09-12",{c:"44",ca:"44",e:"79",f:"46",fa:"46",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2016-03-21",{c:"38",ca:"38",e:"13",f:"38",fa:"38",s:"9.1",si:"9.3"}],["2020-01-15",{c:"57",ca:"57",e:"79",f:"51",fa:"51",s:"10.1",si:"10.3"}],["2020-01-15",{c:"47",ca:"47",e:"79",f:"51",fa:"51",s:"9",si:"9"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3.6",fa:"4",s:"4",si:"3.2"}],["2020-07-28",{c:"55",ca:"55",e:"12",f:"59",fa:"79",s:"13",si:"13"}],["2025-01-27",{c:"116",ca:"116",e:"116",f:"125",fa:"125",s:"17",si:"18.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3",fa:"4",s:"4",si:"3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"76",ca:"76",e:"79",f:"67",fa:"67",s:"12.1",si:"13"}],["2022-05-31",{c:"96",ca:"96",e:"96",f:"101",fa:"101",s:"14.1",si:"14.5"}],["2020-01-15",{c:"74",ca:"74",e:"79",f:"63",fa:"64",s:"10.1",si:"10.3"}],["2023-12-11",{c:"73",ca:"73",e:"79",f:"78",fa:"79",s:"17.2",si:"17.2"}],["2023-12-11",{c:"86",ca:"86",e:"86",f:"101",fa:"101",s:"17.2",si:"17.2"}],["2023-06-06",{c:"1",ca:"18",e:"12",f:"1",fa:"114",s:"1.1",si:"1"}],["2025-05-01",{c:"136",ca:"136",e:"136",f:"97",fa:"97",s:"15.4",si:"15.4"}],["2019-09-19",{c:"63",ca:"63",e:"12",f:"6",fa:"6",s:"13",si:"13"}],["2015-07-29",{c:"6",ca:"18",e:"12",f:"6",fa:"6",s:"6",si:"7"}],["2015-07-29",{c:"32",ca:"32",e:"12",f:"29",fa:"29",s:"8",si:"8"}],["2020-07-28",{c:"76",ca:"76",e:"79",f:"71",fa:"79",s:"13",si:"13"}],["2020-09-16",{c:"85",ca:"85",e:"85",f:"79",fa:"79",s:"14",si:"14"}],["2018-10-02",{c:"63",ca:"63",e:"18",f:"58",fa:"58",s:"11.1",si:"11.3"}],["2025-01-07",{c:"128",ca:"128",e:"128",f:"134",fa:"134",s:"18.2",si:"18.2"}],["2024-03-05",{c:"119",ca:"119",e:"119",f:"121",fa:"121",s:"17.4",si:"17.4"}],["2016-09-20",{c:"49",ca:"49",e:"12",f:"18",fa:"18",s:"10",si:"10"}],["2023-03-27",{c:"50",ca:"50",e:"17",f:"44",fa:"48",s:"16",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2020-03-24",{c:"63",ca:"63",e:"79",f:"49",fa:"49",s:"13.1",si:"13.4"}],["2020-07-28",{c:"71",ca:"71",e:"79",f:"69",fa:"79",s:"12.1",si:"12.2"}],["2021-04-26",{c:"87",ca:"87",e:"87",f:"70",fa:"79",s:"14.1",si:"14.5"}],["2020-07-28",{c:"1",ca:"18",e:"13",f:"78",fa:"79",s:"4",si:"3.2"}],["2024-01-23",{c:"119",ca:"119",e:"119",f:"122",fa:"122",s:"17.2",si:"17.2"}],["2021-09-20",{c:"85",ca:"85",e:"85",f:"87",fa:"87",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-05-01",{c:"136",ca:"136",e:"136",f:"134",fa:"134",s:"18.2",si:"18.2"}],["2024-07-09",{c:"85",ca:"85",e:"85",f:"128",fa:"128",s:"16.4",si:"16.4"}],["2024-09-16",{c:"125",ca:"125",e:"125",f:"128",fa:"128",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.6",fa:"4",s:"5",si:"4"}],["2015-07-29",{c:"24",ca:"25",e:"12",f:"23",fa:"23",s:"7",si:"7"}],["2023-03-27",{c:"69",ca:"69",e:"79",f:"99",fa:"99",s:"16.4",si:"16.4"}],["2024-10-29",{c:"83",ca:"83",e:"83",f:"132",fa:"132",s:"15.4",si:"15.4"}],["2025-05-27",{c:"134",ca:"134",e:"134",f:"139",fa:"139",s:"18.4",si:"18.4"}],["2024-07-09",{c:"111",ca:"111",e:"111",f:"128",fa:"128",s:"16.4",si:"16.4"}],["2020-07-28",{c:"64",ca:"64",e:"79",f:"69",fa:"79",s:"13.1",si:"13.4"}],["2022-09-12",{c:"68",ca:"68",e:"79",f:"62",fa:"62",s:"16",si:"16"}],["2018-10-23",{c:"1",ca:"18",e:"12",f:"63",fa:"63",s:"3",si:"1"}],["2023-03-27",{c:"54",ca:"54",e:"17",f:"45",fa:"45",s:"16.4",si:"16.4"}],["2017-09-19",{c:"29",ca:"29",e:"12",f:"35",fa:"35",s:"11",si:"11"}],["2020-07-27",{c:"84",ca:"84",e:"84",f:"67",fa:"67",s:"9.1",si:"9.3"}],["2020-01-15",{c:"65",ca:"65",e:"79",f:"52",fa:"52",s:"12.1",si:"12.2"}],["2023-11-21",{c:"111",ca:"111",e:"111",f:"120",fa:"120",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-05-17",{c:"125",ca:"125",e:"125",f:"118",fa:"118",s:"17.2",si:"17.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"38",fa:"38",s:"5",si:"4.2"}],["2024-12-11",{c:"128",ca:"128",e:"128",f:"38",fa:"38",s:"18.2",si:"18.2"}],["2024-12-11",{c:"84",ca:"84",e:"84",f:"38",fa:"38",s:"18.2",si:"18.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"69",ca:"69",e:"79",f:"65",fa:"65",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"27",ca:"27",e:"79",f:"32",fa:"32",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-03-27",{c:"38",ca:"39",e:"79",f:"43",fa:"43",s:"16.4",si:"16.4"}],["2025-03-31",{c:"84",ca:"84",e:"84",f:"126",fa:"126",s:"16.4",si:"18.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"113",fa:"113",s:"17",si:"17"}],["2022-03-14",{c:"61",ca:"61",e:"79",f:"36",fa:"36",s:"15.4",si:"15.4"}],["2020-09-16",{c:"61",ca:"61",e:"79",f:"36",fa:"36",s:"14",si:"14"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"1",fa:"4",s:"3",si:"1"}],["2020-01-15",{c:"69",ca:"69",e:"79",f:"68",fa:"68",s:"11",si:"11"}],["2024-10-01",{c:"80",ca:"80",e:"80",f:"131",fa:"131",s:"16.1",si:"16.1"}],["2024-12-11",{c:"94",ca:"94",e:"94",f:"97",fa:"97",s:"18.2",si:"18.2"}],["2024-12-11",{c:"121",ca:"121",e:"121",f:"64",fa:"64",s:"18.2",si:"18.2"}],["2023-10-13",{c:"118",ca:"118",e:"118",f:"118",fa:"118",s:"17",si:"17"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-07",{c:"11",ca:"18",e:"12",f:"52",fa:"52",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2020-01-15",{c:"6",ca:"18",e:"79",f:"6",fa:"45",s:"5",si:"5"}],["2023-03-27",{c:"65",ca:"65",e:"79",f:"61",fa:"61",s:"16.4",si:"16.4"}],["2018-04-30",{c:"45",ca:"45",e:"17",f:"44",fa:"44",s:"11.1",si:"11.3"}],["2015-07-29",{c:"38",ca:"38",e:"12",f:"13",fa:"14",s:"8",si:"8"}],["2024-06-11",{c:"122",ca:"122",e:"122",f:"127",fa:"127",s:"17",si:"17"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"5"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"5"}],["2020-01-15",{c:"53",ca:"53",e:"79",f:"63",fa:"63",s:"10",si:"10"}],["2020-07-28",{c:"73",ca:"73",e:"79",f:"72",fa:"79",s:"13.1",si:"13.4"}],["2020-01-15",{c:"37",ca:"37",e:"79",f:"62",fa:"62",s:"10.1",si:"10.3"}],["2020-01-15",{c:"37",ca:"37",e:"79",f:"54",fa:"54",s:"10.1",si:"10.3"}],["2021-12-13",{c:"68",ca:"89",e:"79",f:"79",fa:"79",s:"15.2",si:"15.2"}],["2020-01-15",{c:"53",ca:"53",e:"79",f:"63",fa:"63",s:"10",si:"10"}],["2023-03-27",{c:"92",ca:"92",e:"92",f:"92",fa:"92",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"19",ca:"25",e:"79",f:"4",fa:"4",s:"6",si:"6"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"2"}],["2020-01-15",{c:"18",ca:"18",e:"79",f:"55",fa:"55",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2018-09-05",{c:"33",ca:"33",e:"14",f:"49",fa:"62",s:"7",si:"7"}],["2017-11-28",{c:"9",ca:"47",e:"12",f:"2",fa:"57",s:"5.1",si:"5"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"55",fa:"55",s:"11.1",si:"11.3"}],["2017-03-27",{c:"38",ca:"38",e:"13",f:"38",fa:"38",s:"10.1",si:"10.3"}],["2020-01-15",{c:"70",ca:"70",e:"79",f:"3",fa:"4",s:"10.1",si:"10.3"}],["2024-08-06",{c:"117",ca:"117",e:"117",f:"129",fa:"129",s:"17.5",si:"17.5"}],["2024-05-17",{c:"125",ca:"125",e:"125",f:"126",fa:"126",s:"17.4",si:"17.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-09-16",{c:"77",ca:"77",e:"79",f:"65",fa:"65",s:"14",si:"14"}],["2019-09-19",{c:"56",ca:"56",e:"16",f:"59",fa:"59",s:"13",si:"13"}],["2023-12-05",{c:"119",ca:"120",e:"85",f:"65",fa:"65",s:"11.1",si:"11.3"}],["2023-09-18",{c:"61",ca:"61",e:"79",f:"57",fa:"57",s:"17",si:"17"}],["2022-06-28",{c:"67",ca:"67",e:"79",f:"102",fa:"102",s:"14.1",si:"14.5"}],["2022-03-14",{c:"92",ca:"92",e:"92",f:"90",fa:"90",s:"15.4",si:"15.4"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"29",fa:"29",s:"9",si:"9"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"40",fa:"40",s:"9",si:"9"}],["2020-01-15",{c:"73",ca:"73",e:"79",f:"67",fa:"67",s:"13",si:"13"}],["2016-09-20",{c:"34",ca:"34",e:"12",f:"31",fa:"31",s:"10",si:"10"}],["2017-04-05",{c:"57",ca:"57",e:"15",f:"48",fa:"48",s:"10",si:"10"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"34",fa:"34",s:"9",si:"9"}],["2015-09-30",{c:"41",ca:"36",e:"12",f:"24",fa:"24",s:"9",si:"9"}],["2020-08-27",{c:"85",ca:"85",e:"85",f:"77",fa:"79",s:"13.1",si:"13.4"}],["2015-09-30",{c:"41",ca:"36",e:"12",f:"17",fa:"17",s:"9",si:"9"}],["2020-01-15",{c:"66",ca:"66",e:"79",f:"61",fa:"61",s:"12",si:"12"}],["2023-10-24",{c:"111",ca:"111",e:"111",f:"119",fa:"119",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2022-03-14",{c:"98",ca:"98",e:"98",f:"94",fa:"94",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2023-09-15",{c:"117",ca:"117",e:"117",f:"71",fa:"79",s:"16",si:"16"}],["2015-09-30",{c:"28",ca:"28",e:"12",f:"22",fa:"22",s:"9",si:"9"}],["2016-09-20",{c:"2",ca:"18",e:"12",f:"49",fa:"49",s:"4",si:"3.2"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"3",fa:"4",s:"3",si:"2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"3",fa:"4",s:"6",si:"6"}],["2015-09-30",{c:"38",ca:"38",e:"12",f:"36",fa:"36",s:"9",si:"9"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-08-10",{c:"42",ca:"42",e:"79",f:"91",fa:"91",s:"13.1",si:"13.4"}],["2018-10-02",{c:"1",ca:"18",e:"18",f:"1.5",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1.3",si:"2"}],["2024-12-11",{c:"89",ca:"89",e:"89",f:"131",fa:"131",s:"18.2",si:"18.2"}],["2015-11-12",{c:"26",ca:"26",e:"13",f:"22",fa:"22",s:"8",si:"8"}],["2020-01-15",{c:"62",ca:"62",e:"79",f:"53",fa:"53",s:"11",si:"11"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-09-12",{c:"47",ca:"47",e:"12",f:"49",fa:"49",s:"16",si:"16"}],["2022-03-14",{c:"48",ca:"48",e:"79",f:"48",fa:"48",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-03-03",{c:"99",ca:"99",e:"99",f:"46",fa:"46",s:"7",si:"7"}],["2020-01-15",{c:"38",ca:"38",e:"79",f:"19",fa:"19",s:"10.1",si:"10.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-09-16",{c:"48",ca:"48",e:"79",f:"41",fa:"41",s:"14",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"7",fa:"7",s:"1.3",si:"1"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3.5",fa:"4",s:"1.1",si:"1"}],["2017-04-05",{c:"4",ca:"18",e:"15",f:"49",fa:"49",s:"3",si:"2"}],["2015-07-29",{c:"23",ca:"25",e:"12",f:"31",fa:"31",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-11-19",{c:"87",ca:"87",e:"87",f:"70",fa:"79",s:"12.1",si:"12.2"}],["2020-07-28",{c:"33",ca:"33",e:"12",f:"74",fa:"79",s:"12.1",si:"12.2"}],["2024-03-19",{c:"114",ca:"114",e:"114",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2024-05-13",{c:"114",ca:"114",e:"114",f:"121",fa:"121",s:"17.5",si:"17.5"}],["2024-10-17",{c:"130",ca:"130",e:"130",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2024-03-19",{c:"114",ca:"114",e:"114",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2024-10-17",{c:"130",ca:"130",e:"130",f:"121",fa:"121",s:"17.5",si:"17.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3"}],["2017-10-24",{c:"62",ca:"62",e:"14",f:"22",fa:"22",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2019-09-19",{c:"36",ca:"36",e:"12",f:"52",fa:"52",s:"13",si:"9.3"}],["2024-03-05",{c:"114",ca:"114",e:"114",f:"122",fa:"122",s:"17.4",si:"17.4"}],["2024-04-16",{c:"118",ca:"118",e:"118",f:"125",fa:"125",s:"13.1",si:"13.4"}],["2015-09-30",{c:"36",ca:"36",e:"12",f:"16",fa:"16",s:"9",si:"9"}],["2022-03-14",{c:"36",ca:"36",e:"12",f:"16",fa:"16",s:"15.4",si:"15.4"}],["2024-08-06",{c:"117",ca:"117",e:"117",f:"129",fa:"129",s:"17.4",si:"17.4"}],["2015-09-30",{c:"26",ca:"26",e:"12",f:"16",fa:"16",s:"9",si:"9"}],["2023-03-14",{c:"19",ca:"25",e:"79",f:"111",fa:"111",s:"6",si:"6"}],["2023-03-13",{c:"111",ca:"111",e:"111",f:"108",fa:"108",s:"15.4",si:"15.4"}],["2023-07-21",{c:"115",ca:"115",e:"115",f:"70",fa:"79",s:"15",si:"15"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"38",fa:"38",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"37",fa:"37",s:"10",si:"10"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-09-05",{c:"140",ca:"140",e:"140",f:"133",fa:"133",s:"18.2",si:"18.2"}],["2015-09-30",{c:"44",ca:"44",e:"12",f:"40",fa:"40",s:"9",si:"9"}],["2016-03-21",{c:"41",ca:"41",e:"13",f:"27",fa:"27",s:"9.1",si:"9.3"}],["2023-09-18",{c:"113",ca:"113",e:"113",f:"102",fa:"102",s:"17",si:"17"}],["2018-04-30",{c:"44",ca:"44",e:"17",f:"48",fa:"48",s:"10.1",si:"10.3"}],["2015-07-29",{c:"32",ca:"32",e:"12",f:"19",fa:"19",s:"7",si:"7"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"115",fa:"115",s:"17",si:"17"}],["2025-09-15",{c:"95",ca:"95",e:"95",f:"142",fa:"142",s:"26",si:"26"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"2",si:"1"}],["2023-11-21",{c:"72",ca:"72",e:"79",f:"120",fa:"120",s:"16.4",si:"16.4"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"5"}],["2023-11-02",{c:"119",ca:"119",e:"119",f:"88",fa:"88",s:"16.5",si:"16.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-04-18",{c:"124",ca:"124",e:"124",f:"120",fa:"120",s:"17.4",si:"17.4"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"3"}],["2025-10-14",{c:"125",ca:"125",e:"125",f:"144",fa:"144",s:"18.2",si:"18.2"}],["2025-10-14",{c:"111",ca:"111",e:"111",f:"144",fa:"144",s:"18",si:"18"}],["2022-12-05",{c:"108",ca:"108",e:"108",f:"101",fa:"101",s:"15.4",si:"15.4"}],["2017-10-17",{c:"26",ca:"26",e:"16",f:"19",fa:"19",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1.3",si:"1"}],["2021-08-10",{c:"61",ca:"61",e:"79",f:"91",fa:"68",s:"13",si:"13"}],["2017-10-17",{c:"57",ca:"57",e:"16",f:"52",fa:"52",s:"11",si:"11"}],["2021-04-26",{c:"85",ca:"85",e:"85",f:"78",fa:"79",s:"14.1",si:"14.5"}],["2021-10-25",{c:"75",ca:"75",e:"79",f:"78",fa:"79",s:"15.1",si:"15.1"}],["2022-05-03",{c:"95",ca:"95",e:"95",f:"100",fa:"100",s:"15.2",si:"15.2"}],["2024-03-05",{c:"114",ca:"114",e:"114",f:"112",fa:"112",s:"17.4",si:"17.4"}],["2024-12-11",{c:"119",ca:"119",e:"119",f:"120",fa:"120",s:"18.2",si:"18.2"}],["2020-10-20",{c:"86",ca:"86",e:"86",f:"78",fa:"79",s:"13.1",si:"13.4"}],["2020-03-24",{c:"69",ca:"69",e:"79",f:"62",fa:"62",s:"13.1",si:"13.4"}],["2021-10-25",{c:"75",ca:"75",e:"18",f:"64",fa:"64",s:"15.1",si:"15.1"}],["2021-11-19",{c:"96",ca:"96",e:"96",f:"79",fa:"79",s:"15.1",si:"15.1"}],["2021-04-26",{c:"69",ca:"69",e:"18",f:"62",fa:"62",s:"14.1",si:"14.5"}],["2023-03-27",{c:"91",ca:"91",e:"91",f:"89",fa:"89",s:"16.4",si:"16.4"}],["2024-12-11",{c:"112",ca:"112",e:"112",f:"121",fa:"121",s:"18.2",si:"18.2"}],["2021-12-13",{c:"74",ca:"88",e:"79",f:"79",fa:"79",s:"15.2",si:"15.2"}],["2024-09-16",{c:"119",ca:"119",e:"119",f:"120",fa:"120",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"4",si:"3.2"}],["2021-04-26",{c:"84",ca:"84",e:"84",f:"79",fa:"79",s:"14.1",si:"14.5"}],["2015-07-29",{c:"36",ca:"36",e:"12",f:"6",fa:"6",s:"8",si:"8"}],["2015-09-30",{c:"36",ca:"36",e:"12",f:"34",fa:"34",s:"9",si:"9"}],["2020-09-16",{c:"84",ca:"84",e:"84",f:"75",fa:"79",s:"14",si:"14"}],["2021-04-26",{c:"35",ca:"35",e:"12",f:"25",fa:"25",s:"14.1",si:"14.5"}],["2015-07-29",{c:"37",ca:"37",e:"12",f:"34",fa:"34",s:"11",si:"11"}],["2022-03-14",{c:"69",ca:"69",e:"79",f:"96",fa:"96",s:"15.4",si:"15.4"}],["2021-09-07",{c:"67",ca:"70",e:"18",f:"60",fa:"92",s:"13",si:"13"}],["2023-10-24",{c:"85",ca:"85",e:"85",f:"119",fa:"119",s:"16",si:"16"}],["2015-07-29",{c:"9",ca:"25",e:"12",f:"4",fa:"4",s:"5.1",si:"8"}],["2021-09-20",{c:"63",ca:"63",e:"17",f:"30",fa:"30",s:"14",si:"15"}],["2024-10-29",{c:"104",ca:"104",e:"104",f:"132",fa:"132",s:"16.4",si:"16.4"}],["2020-01-15",{c:"47",ca:"47",e:"79",f:"53",fa:"53",s:"12",si:"12"}],["2017-04-19",{c:"33",ca:"33",e:"12",f:"53",fa:"53",s:"9.1",si:"9.3"}],["2020-09-16",{c:"47",ca:"47",e:"79",f:"56",fa:"56",s:"14",si:"14"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"22",fa:"22",s:"8",si:"8"}],["2018-04-30",{c:"26",ca:"26",e:"17",f:"22",fa:"22",s:"8",si:"8"}],["2022-12-13",{c:"100",ca:"100",e:"100",f:"108",fa:"108",s:"16",si:"16"}],["2021-09-20",{c:"56",ca:"58",e:"79",f:"51",fa:"51",s:"15",si:"15"}],["2024-10-29",{c:"104",ca:"104",e:"104",f:"132",fa:"132",s:"16.4",si:"16.4"}],["2020-09-16",{c:"9",ca:"18",e:"18",f:"65",fa:"65",s:"14",si:"14"}],["2020-01-15",{c:"56",ca:"56",e:"79",f:"22",fa:"24",s:"11",si:"11"}],["2025-10-03",{c:"141",ca:"141",e:"141",f:"117",fa:"117",s:"15.4",si:"15.4"}],["2023-05-09",{c:"76",ca:"76",e:"79",f:"113",fa:"113",s:"15.4",si:"15.4"}],["2020-01-15",{c:"58",ca:"58",e:"79",f:"44",fa:"44",s:"11",si:"11"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"11",fa:"14",s:"5",si:"4.2"}],["2015-07-29",{c:"23",ca:"25",e:"12",f:"31",fa:"31",s:"6",si:"8"}],["2020-01-15",{c:"23",ca:"25",e:"79",f:"31",fa:"31",s:"6",si:"8"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"82",fa:"82",s:"14",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-03-19",{c:"114",ca:"114",e:"114",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"36",ca:"36",e:"79",f:"36",fa:"36",s:"9.1",si:"9.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-09-30",{c:"44",ca:"44",e:"12",f:"15",fa:"15",s:"9",si:"9"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-27",{c:"48",ca:"48",e:"12",f:"41",fa:"41",s:"10.1",si:"10.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3",fa:"4",s:"1",si:"1"}],["2024-05-14",{c:"1",ca:"18",e:"12",f:"126",fa:"126",s:"3.1",si:"3"}]],c={w:"WebKit",g:"Gecko",p:"Presto",b:"Blink"},e={r:"retired",c:"current",b:"beta",n:"nightly",p:"planned",u:"unknown",e:"esr"},f=s=>{const a={};return Object.entries(s).forEach(([s,r])=>{if(r.releases){a[s]||(a[s]={releases:{}});const f=a[s].releases;r.releases.forEach(s=>{f[s[0]]={version:s[0],release_date:"u"==s[1]?"unknown":s[1],status:e[s[2]],engine:s[3]?c[s[3]]:void 0,engine_version:s[4]}})}}),a},b=(()=>{const s=[];return r.forEach(a=>{var r;s.push({status:{baseline_low_date:a[0],support:(r=a[1],{chrome:r.c,chrome_android:r.ca,edge:r.e,firefox:r.f,firefox_android:r.fa,safari:r.s,safari_ios:r.si})}})}),s})(),u=f(s),i=f(a);let n=!1;const o=["chrome","chrome_android","edge","firefox","firefox_android","safari","safari_ios"],g=Object.entries(u).filter(([s])=>o.includes(s)),t=["webview_android","samsunginternet_android","opera_android","opera"],l=[...Object.entries(u).filter(([s])=>t.includes(s)),...Object.entries(i)],w=["current","esr","retired","unknown","beta","nightly"];let p=!1;const d=s=>{if(!1===s.includeDownstreamBrowsers&&!0===s.includeKaiOS){if(console.log(new Error("KaiOS is a downstream browser and can only be included if you include other downstream browsers. Please ensure you use `includeDownstreamBrowsers: true`.")),"undefined"==typeof process||!process.exit)throw new Error("KaiOS configuration error: process.exit is not available");process.exit(1)}},v=s=>s&&s.startsWith("≤")?s.slice(1):s,_=(s,a)=>{if(s===a)return 0;const[r=0,c=0]=s.split(".",2).map(Number),[e=0,f=0]=a.split(".",2).map(Number);if(isNaN(r)||isNaN(c))throw new Error(`Invalid version: ${s}`);if(isNaN(e)||isNaN(f))throw new Error(`Invalid version: ${a}`);return r!==e?r>e?1:-1:c!==f?c>f?1:-1:0},h=s=>{let a=[];return s.forEach(s=>{let r=g.find(a=>a[0]===s.browser);if(r){Object.entries(r[1].releases).filter(([,s])=>w.includes(s.status)).sort((s,a)=>_(s[0],a[0])).forEach(([r,c])=>!!w.includes(c.status)&&(1===_(r,s.version)&&(a.push({browser:s.browser,version:r,release_date:c.release_date?c.release_date:"unknown"}),!0)))}}),a},m=(s,a=!1)=>{if(s.getFullYear()<2015&&!p&&console.warn(new Error("There are no browser versions compatible with Baseline before 2015. You may receive unexpected results.")),s.getFullYear()<2002)throw new Error("None of the browsers in the core set were released before 2002. Please use a date after 2002.");if(s.getFullYear()>(new Date).getFullYear())throw new Error("There are no browser versions compatible with Baseline in the future");const r=(s=>b.filter(a=>a.status.baseline_low_date&&new Date(a.status.baseline_low_date)<=s).map(s=>({baseline_low_date:s.status.baseline_low_date,support:s.status.support})))(s),c=(s=>{let a={};return Object.entries(g).forEach(([,s])=>{a[s[0]]={browser:s[0],version:"0",release_date:""}}),s.forEach(s=>{Object.entries(s.support).forEach(r=>{const c=r[0],e=v(r[1]);a[c]&&1===_(e,v(a[c].version))&&(a[c]={browser:c,version:e,release_date:s.baseline_low_date})})}),Object.values(a)})(r);return a?[...c,...h(c)].sort((s,a)=>s.browsera.browser?1:_(s.version,a.version)):c},O=(s=[],a=!0,r=!1)=>{const c=a=>{var r;return s&&s.length>0?null===(r=s.filter(s=>s.browser===a).sort((s,a)=>_(s.version,a.version))[0])||void 0===r?void 0:r.version:void 0},e=c("chrome"),f=c("firefox");if(!e&&!f)throw new Error("There are no browser versions compatible with Baseline before Chrome and Firefox");let b=[];return l.filter(([s])=>!("kai_os"===s&&!r)).forEach(([s,r])=>{var c;if(!r.releases)return;let u=Object.entries(r.releases).filter(([,s])=>{const{engine:a,engine_version:r}=s;return!(!a||!r)&&("Blink"===a&&e?_(r,e)>=0:!("Gecko"!==a||!f)&&_(r,f)>=0)}).sort((s,a)=>_(s[0],a[0]));for(let r=0;r{if(n||"undefined"!=typeof process&&process.env&&(process.env.BROWSERSLIST_IGNORE_OLD_DATA||process.env.BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA))return;const r=new Date;r.setMonth(r.getMonth()-2),s>r&&(null!=a?a:1764418039385){g[s]={},y({targetYear:s,suppressWarnings:u.suppressWarnings}).forEach(a=>{g[s]&&(g[s][a.browser]=a)})});const t=y({suppressWarnings:u.suppressWarnings}),l={};t.forEach(s=>{l[s.browser]=s});const w=new Date;w.setMonth(w.getMonth()+30);const v=y({widelyAvailableOnDate:w.toISOString().slice(0,10),suppressWarnings:u.suppressWarnings}),h={};v.forEach(s=>{h[s.browser]=s});const m=y({targetYear:2002,listAllCompatibleVersions:!0,suppressWarnings:u.suppressWarnings}),E=[];if(o.forEach(s=>{var a,r,c,e;let f=m.filter(a=>a.browser==s).sort((s,a)=>_(s.version,a.version)),b=null!==(r=null===(a=l[s])||void 0===a?void 0:a.version)&&void 0!==r?r:"0",o=null!==(e=null===(c=h[s])||void 0===c?void 0:c.version)&&void 0!==e?e:"0";n.forEach(a=>{var r;if(g[a]){let c=(null!==(r=g[a][s])&&void 0!==r?r:{version:"0"}).version,e=f.findIndex(s=>0===_(s.version,c));(a===i-1?f:f.slice(0,e)).forEach(s=>{let r=_(s.version,b)>=0,c=_(s.version,o)>=0,e=Object.assign(Object.assign({},s),{year:a<=2015?"pre_baseline":a-1});u.useSupports?(r&&(e.supports="widely"),c&&(e.supports="newly")):e=Object.assign(Object.assign({},e),{wa_compatible:r}),E.push(e)}),f=f.slice(e,f.length)}})}),u.includeDownstreamBrowsers){O(E,!0,u.includeKaiOS).forEach(s=>{let a=E.find(a=>"chrome"===a.browser&&a.version===s.engine_version);a&&(u.useSupports?E.push(Object.assign(Object.assign({},s),{year:a.year,supports:a.supports})):E.push(Object.assign(Object.assign({},s),{year:a.year,wa_compatible:a.wa_compatible})))})}if(E.sort((s,a)=>{if("pre_baseline"===s.year&&"pre_baseline"!==a.year)return-1;if("pre_baseline"===a.year&&"pre_baseline"!==s.year)return 1;if("pre_baseline"!==s.year&&"pre_baseline"!==a.year){if(s.yeara.year)return 1}return s.browsera.browser?1:_(s.version,a.version)}),"object"===u.outputFormat){const s={};return E.forEach(a=>{s[a.browser]||(s[a.browser]={});let r={year:a.year,release_date:a.release_date,engine:a.engine,engine_version:a.engine_version};s[a.browser][a.version]=u.useSupports?a.supports?Object.assign(Object.assign({},r),{supports:a.supports}):r:Object.assign(Object.assign({},r),{wa_compatible:a.wa_compatible})}),null!=s?s:{}}if("csv"===u.outputFormat){let s=`"browser","version","year","${u.useSupports?"supports":"wa_compatible"}","release_date","engine","engine_version"`;return E.forEach(a=>{var r,c,e,f;let b={browser:a.browser,version:a.version,year:a.year,release_date:null!==(r=a.release_date)&&void 0!==r?r:"NULL",engine:null!==(c=a.engine)&&void 0!==c?c:"NULL",engine_version:null!==(e=a.engine_version)&&void 0!==e?e:"NULL"};b=u.useSupports?Object.assign(Object.assign({},b),{supports:null!==(f=a.supports)&&void 0!==f?f:""}):Object.assign(Object.assign({},b),{wa_compatible:a.wa_compatible}),s+=`\n"${b.browser}","${b.version}","${b.year}","${u.useSupports?b.supports:b.wa_compatible}","${b.release_date}","${b.engine}","${b.engine_version}"`}),s}return E},exports.getCompatibleVersions=y; diff --git a/node_modules/baseline-browser-mapping/dist/index.d.ts b/node_modules/baseline-browser-mapping/dist/index.d.ts new file mode 100644 index 0000000..64764ee --- /dev/null +++ b/node_modules/baseline-browser-mapping/dist/index.d.ts @@ -0,0 +1,102 @@ +export declare function _resetHasWarned(): void; +type BrowserVersion = { + browser: string; + version: string; + release_date?: string; + engine?: string; + engine_version?: string; +}; +interface AllBrowsersBrowserVersion extends BrowserVersion { + year: number | string; + supports?: string; + wa_compatible?: boolean; +} +type NestedBrowserVersions = { + [browser: string]: { + [version: string]: AllBrowsersBrowserVersion; + }; +}; +type Options = { + /** + * Whether to include only the minimum compatible browser versions or all compatible versions. + * Defaults to `false`. + */ + listAllCompatibleVersions?: boolean; + /** + * Whether to include browsers that use the same engines as a core Baseline browser. + * Defaults to `false`. + */ + includeDownstreamBrowsers?: boolean; + /** + * Pass a date in the format 'YYYY-MM-DD' to get versions compatible with Widely available on the specified date. + * If left undefined and a `targetYear` is not passed, defaults to Widely available as of the current date. + * > NOTE: cannot be used with `targetYear`. + */ + widelyAvailableOnDate?: string | number; + /** + * Pass a year between 2015 and the current year to get browser versions compatible with all + * Newly Available features as of the end of the year specified. + * > NOTE: cannot be used with `widelyAvailableOnDate`. + */ + targetYear?: number; + /** + * Pass a boolean that determines whether KaiOS is included in browser mappings. KaiOS implements + * the Gecko engine used in Firefox. However, KaiOS also has a different interaction paradigm to + * other browsers and requires extra consideration beyond simple feature compatibility to provide + * an optimal user experience. Defaults to `false`. + */ + includeKaiOS?: boolean; + overrideLastUpdated?: number; + /** + * Pass a boolean to suppress the warning about stale data. + * Defaults to `false`. + */ + suppressWarnings?: boolean; +}; +/** + * Returns browser versions compatible with specified Baseline targets. + * Defaults to returning the minimum versions of the core browser set that support Baseline Widely available. + * Takes an optional configuration `Object` with four optional properties: + * - `listAllCompatibleVersions`: `false` (default) or `false` + * - `includeDownstreamBrowsers`: `false` (default) or `false` + * - `widelyAvailableOnDate`: date in format `YYYY-MM-DD` + * - `targetYear`: year in format `YYYY` + */ +export declare function getCompatibleVersions(userOptions?: Options): BrowserVersion[]; +type AllVersionsOptions = { + /** + * Whether to return the output as a JavaScript `Array` (`"array"`), `Object` (`"object"`) or a CSV string (`"csv"`). + * Defaults to `"array"`. + */ + outputFormat?: string; + /** + * Whether to include browsers that use the same engines as a core Baseline browser. + * Defaults to `false`. + */ + includeDownstreamBrowsers?: boolean; + /** + * Whether to use the new "supports" property in place of "wa_compatible" + * Defaults to `false` + */ + useSupports?: boolean; + /** + * Whether to include KaiOS in the output. KaiOS implements the Gecko engine used in Firefox. + * However, KaiOS also has a different interaction paradigm to other browsers and requires extra + * consideration beyond simple feature compatibility to provide an optimal user experience. + */ + includeKaiOS?: boolean; + /** + * Pass a boolean to suppress the warning about old data. + * Defaults to `false`. + */ + suppressWarnings?: boolean; +}; +/** + * Returns all browser versions known to this module with their level of Baseline support as a JavaScript `Array` (`"array"`), `Object` (`"object"`) or a CSV string (`"csv"`). + * Takes an optional configuration `Object` with three optional properties: + * - `includeDownstreamBrowsers`: `true` (default) or `false` + * - `outputFormat`: `"array"` (default), `"object"` or `"csv"` + * - `useSupports`: `false` (default) or `true`, replaces `wa_compatible` property with optional `supports` property which returns `widely` or `newly` available when present. + */ +export declare function getAllVersions(userOptions?: AllVersionsOptions): AllBrowsersBrowserVersion[] | NestedBrowserVersions | string; +export {}; diff --git a/node_modules/baseline-browser-mapping/dist/index.js b/node_modules/baseline-browser-mapping/dist/index.js new file mode 100644 index 0000000..aa75731 --- /dev/null +++ b/node_modules/baseline-browser-mapping/dist/index.js @@ -0,0 +1 @@ +const s={chrome:{releases:[["1","2008-12-11","r","w","528"],["2","2009-05-21","r","w","530"],["3","2009-09-15","r","w","532"],["4","2010-01-25","r","w","532.5"],["5","2010-05-25","r","w","533"],["6","2010-09-02","r","w","534.3"],["7","2010-10-19","r","w","534.7"],["8","2010-12-02","r","w","534.10"],["9","2011-02-03","r","w","534.13"],["10","2011-03-08","r","w","534.16"],["11","2011-04-27","r","w","534.24"],["12","2011-06-07","r","w","534.30"],["13","2011-08-02","r","w","535.1"],["14","2011-09-16","r","w","535.1"],["15","2011-10-25","r","w","535.2"],["16","2011-12-13","r","w","535.7"],["17","2012-02-08","r","w","535.11"],["18","2012-03-28","r","w","535.19"],["19","2012-05-15","r","w","536.5"],["20","2012-06-26","r","w","536.10"],["21","2012-07-31","r","w","537.1"],["22","2012-09-25","r","w","537.4"],["23","2012-11-06","r","w","537.11"],["24","2013-01-10","r","w","537.17"],["25","2013-02-21","r","w","537.22"],["26","2013-03-26","r","w","537.31"],["27","2013-05-21","r","w","537.36"],["28","2013-07-09","r","b","28"],["29","2013-08-20","r","b","29"],["30","2013-10-01","r","b","30"],["31","2013-11-12","r","b","31"],["32","2014-01-14","r","b","32"],["33","2014-02-20","r","b","33"],["34","2014-04-08","r","b","34"],["35","2014-05-20","r","b","35"],["36","2014-07-16","r","b","36"],["37","2014-08-26","r","b","37"],["38","2014-10-07","r","b","38"],["39","2014-11-18","r","b","39"],["40","2015-01-21","r","b","40"],["41","2015-03-03","r","b","41"],["42","2015-04-14","r","b","42"],["43","2015-05-19","r","b","43"],["44","2015-07-21","r","b","44"],["45","2015-09-01","r","b","45"],["46","2015-10-13","r","b","46"],["47","2015-12-01","r","b","47"],["48","2016-01-20","r","b","48"],["49","2016-03-02","r","b","49"],["50","2016-04-13","r","b","50"],["51","2016-05-25","r","b","51"],["52","2016-07-20","r","b","52"],["53","2016-08-31","r","b","53"],["54","2016-10-12","r","b","54"],["55","2016-12-01","r","b","55"],["56","2017-01-25","r","b","56"],["57","2017-03-09","r","b","57"],["58","2017-04-19","r","b","58"],["59","2017-06-05","r","b","59"],["60","2017-07-25","r","b","60"],["61","2017-09-05","r","b","61"],["62","2017-10-17","r","b","62"],["63","2017-12-06","r","b","63"],["64","2018-01-23","r","b","64"],["65","2018-03-06","r","b","65"],["66","2018-04-17","r","b","66"],["67","2018-05-29","r","b","67"],["68","2018-07-24","r","b","68"],["69","2018-09-04","r","b","69"],["70","2018-10-16","r","b","70"],["71","2018-12-04","r","b","71"],["72","2019-01-29","r","b","72"],["73","2019-03-12","r","b","73"],["74","2019-04-23","r","b","74"],["75","2019-06-04","r","b","75"],["76","2019-07-30","r","b","76"],["77","2019-09-10","r","b","77"],["78","2019-10-22","r","b","78"],["79","2019-12-10","r","b","79"],["80","2020-02-04","r","b","80"],["81","2020-04-07","r","b","81"],["83","2020-05-19","r","b","83"],["84","2020-07-27","r","b","84"],["85","2020-08-25","r","b","85"],["86","2020-10-20","r","b","86"],["87","2020-11-17","r","b","87"],["88","2021-01-19","r","b","88"],["89","2021-03-02","r","b","89"],["90","2021-04-13","r","b","90"],["91","2021-05-25","r","b","91"],["92","2021-07-20","r","b","92"],["93","2021-08-31","r","b","93"],["94","2021-09-21","r","b","94"],["95","2021-10-19","r","b","95"],["96","2021-11-15","r","b","96"],["97","2022-01-04","r","b","97"],["98","2022-02-01","r","b","98"],["99","2022-03-01","r","b","99"],["100","2022-03-29","r","b","100"],["101","2022-04-26","r","b","101"],["102","2022-05-24","r","b","102"],["103","2022-06-21","r","b","103"],["104","2022-08-02","r","b","104"],["105","2022-09-02","r","b","105"],["106","2022-09-27","r","b","106"],["107","2022-10-25","r","b","107"],["108","2022-11-29","r","b","108"],["109","2023-01-10","r","b","109"],["110","2023-02-07","r","b","110"],["111","2023-03-07","r","b","111"],["112","2023-04-04","r","b","112"],["113","2023-05-02","r","b","113"],["114","2023-05-30","r","b","114"],["115","2023-07-18","r","b","115"],["116","2023-08-15","r","b","116"],["117","2023-09-12","r","b","117"],["118","2023-10-10","r","b","118"],["119","2023-10-31","r","b","119"],["120","2023-12-05","r","b","120"],["121","2024-01-23","r","b","121"],["122","2024-02-20","r","b","122"],["123","2024-03-19","r","b","123"],["124","2024-04-16","r","b","124"],["125","2024-05-14","r","b","125"],["126","2024-06-11","r","b","126"],["127","2024-07-23","r","b","127"],["128","2024-08-20","r","b","128"],["129","2024-09-17","r","b","129"],["130","2024-10-15","r","b","130"],["131","2024-11-12","r","b","131"],["132","2025-01-14","r","b","132"],["133","2025-02-04","r","b","133"],["134","2025-03-04","r","b","134"],["135","2025-04-01","r","b","135"],["136","2025-04-29","r","b","136"],["137","2025-05-27","r","b","137"],["138","2025-06-24","r","b","138"],["139","2025-08-05","r","b","139"],["140","2025-09-02","r","b","140"],["141","2025-09-30","r","b","141"],["142","2025-10-28","c","b","142"],["143","2025-12-02","b","b","143"],["144","2026-01-13","n","b","144"],["145",null,"p","b","145"]]},chrome_android:{releases:[["18","2012-06-27","r","w","535.19"],["25","2013-02-27","r","w","537.22"],["26","2013-04-03","r","w","537.31"],["27","2013-05-22","r","w","537.36"],["28","2013-07-10","r","b","28"],["29","2013-08-21","r","b","29"],["30","2013-10-02","r","b","30"],["31","2013-11-14","r","b","31"],["32","2014-01-15","r","b","32"],["33","2014-02-26","r","b","33"],["34","2014-04-02","r","b","34"],["35","2014-05-20","r","b","35"],["36","2014-07-16","r","b","36"],["37","2014-09-03","r","b","37"],["38","2014-10-08","r","b","38"],["39","2014-11-12","r","b","39"],["40","2015-01-21","r","b","40"],["41","2015-03-11","r","b","41"],["42","2015-04-15","r","b","42"],["43","2015-05-27","r","b","43"],["44","2015-07-29","r","b","44"],["45","2015-09-01","r","b","45"],["46","2015-10-14","r","b","46"],["47","2015-12-02","r","b","47"],["48","2016-01-26","r","b","48"],["49","2016-03-09","r","b","49"],["50","2016-04-13","r","b","50"],["51","2016-06-08","r","b","51"],["52","2016-07-27","r","b","52"],["53","2016-09-07","r","b","53"],["54","2016-10-19","r","b","54"],["55","2016-12-06","r","b","55"],["56","2017-02-01","r","b","56"],["57","2017-03-16","r","b","57"],["58","2017-04-25","r","b","58"],["59","2017-06-06","r","b","59"],["60","2017-08-01","r","b","60"],["61","2017-09-05","r","b","61"],["62","2017-10-24","r","b","62"],["63","2017-12-05","r","b","63"],["64","2018-01-23","r","b","64"],["65","2018-03-06","r","b","65"],["66","2018-04-17","r","b","66"],["67","2018-05-31","r","b","67"],["68","2018-07-24","r","b","68"],["69","2018-09-04","r","b","69"],["70","2018-10-17","r","b","70"],["71","2018-12-04","r","b","71"],["72","2019-01-29","r","b","72"],["73","2019-03-12","r","b","73"],["74","2019-04-24","r","b","74"],["75","2019-06-04","r","b","75"],["76","2019-07-30","r","b","76"],["77","2019-09-10","r","b","77"],["78","2019-10-22","r","b","78"],["79","2019-12-17","r","b","79"],["80","2020-02-04","r","b","80"],["81","2020-04-07","r","b","81"],["83","2020-05-19","r","b","83"],["84","2020-07-27","r","b","84"],["85","2020-08-25","r","b","85"],["86","2020-10-20","r","b","86"],["87","2020-11-17","r","b","87"],["88","2021-01-19","r","b","88"],["89","2021-03-02","r","b","89"],["90","2021-04-13","r","b","90"],["91","2021-05-25","r","b","91"],["92","2021-07-20","r","b","92"],["93","2021-08-31","r","b","93"],["94","2021-09-21","r","b","94"],["95","2021-10-19","r","b","95"],["96","2021-11-15","r","b","96"],["97","2022-01-04","r","b","97"],["98","2022-02-01","r","b","98"],["99","2022-03-01","r","b","99"],["100","2022-03-29","r","b","100"],["101","2022-04-26","r","b","101"],["102","2022-05-24","r","b","102"],["103","2022-06-21","r","b","103"],["104","2022-08-02","r","b","104"],["105","2022-09-02","r","b","105"],["106","2022-09-27","r","b","106"],["107","2022-10-25","r","b","107"],["108","2022-11-29","r","b","108"],["109","2023-01-10","r","b","109"],["110","2023-02-07","r","b","110"],["111","2023-03-07","r","b","111"],["112","2023-04-04","r","b","112"],["113","2023-05-02","r","b","113"],["114","2023-05-30","r","b","114"],["115","2023-07-21","r","b","115"],["116","2023-08-15","r","b","116"],["117","2023-09-12","r","b","117"],["118","2023-10-10","r","b","118"],["119","2023-10-31","r","b","119"],["120","2023-12-05","r","b","120"],["121","2024-01-23","r","b","121"],["122","2024-02-20","r","b","122"],["123","2024-03-19","r","b","123"],["124","2024-04-16","r","b","124"],["125","2024-05-14","r","b","125"],["126","2024-06-11","r","b","126"],["127","2024-07-23","r","b","127"],["128","2024-08-20","r","b","128"],["129","2024-09-17","r","b","129"],["130","2024-10-15","r","b","130"],["131","2024-11-12","r","b","131"],["132","2025-01-14","r","b","132"],["133","2025-02-04","r","b","133"],["134","2025-03-04","r","b","134"],["135","2025-04-01","r","b","135"],["136","2025-04-29","r","b","136"],["137","2025-05-27","r","b","137"],["138","2025-06-24","r","b","138"],["139","2025-08-05","r","b","139"],["140","2025-09-02","r","b","140"],["141","2025-09-30","r","b","141"],["142","2025-10-28","c","b","142"],["143","2025-12-02","b","b","143"],["144","2026-01-13","n","b","144"],["145",null,"p","b","145"]]},edge:{releases:[["12","2015-07-29","r",null,"12"],["13","2015-11-12","r",null,"13"],["14","2016-08-02","r",null,"14"],["15","2017-04-05","r",null,"15"],["16","2017-10-17","r",null,"16"],["17","2018-04-30","r",null,"17"],["18","2018-10-02","r",null,"18"],["79","2020-01-15","r","b","79"],["80","2020-02-07","r","b","80"],["81","2020-04-13","r","b","81"],["83","2020-05-21","r","b","83"],["84","2020-07-16","r","b","84"],["85","2020-08-27","r","b","85"],["86","2020-10-09","r","b","86"],["87","2020-11-19","r","b","87"],["88","2021-01-21","r","b","88"],["89","2021-03-04","r","b","89"],["90","2021-04-15","r","b","90"],["91","2021-05-27","r","b","91"],["92","2021-07-22","r","b","92"],["93","2021-09-02","r","b","93"],["94","2021-09-24","r","b","94"],["95","2021-10-21","r","b","95"],["96","2021-11-19","r","b","96"],["97","2022-01-06","r","b","97"],["98","2022-02-03","r","b","98"],["99","2022-03-03","r","b","99"],["100","2022-04-01","r","b","100"],["101","2022-04-28","r","b","101"],["102","2022-05-31","r","b","102"],["103","2022-06-23","r","b","103"],["104","2022-08-05","r","b","104"],["105","2022-09-01","r","b","105"],["106","2022-10-03","r","b","106"],["107","2022-10-27","r","b","107"],["108","2022-12-05","r","b","108"],["109","2023-01-12","r","b","109"],["110","2023-02-09","r","b","110"],["111","2023-03-13","r","b","111"],["112","2023-04-06","r","b","112"],["113","2023-05-05","r","b","113"],["114","2023-06-02","r","b","114"],["115","2023-07-21","r","b","115"],["116","2023-08-21","r","b","116"],["117","2023-09-15","r","b","117"],["118","2023-10-13","r","b","118"],["119","2023-11-02","r","b","119"],["120","2023-12-07","r","b","120"],["121","2024-01-25","r","b","121"],["122","2024-02-23","r","b","122"],["123","2024-03-22","r","b","123"],["124","2024-04-18","r","b","124"],["125","2024-05-17","r","b","125"],["126","2024-06-13","r","b","126"],["127","2024-07-25","r","b","127"],["128","2024-08-22","r","b","128"],["129","2024-09-19","r","b","129"],["130","2024-10-17","r","b","130"],["131","2024-11-14","r","b","131"],["132","2025-01-17","r","b","132"],["133","2025-02-06","r","b","133"],["134","2025-03-06","r","b","134"],["135","2025-04-04","r","b","135"],["136","2025-05-01","r","b","136"],["137","2025-05-29","r","b","137"],["138","2025-06-26","r","b","138"],["139","2025-08-07","r","b","139"],["140","2025-09-05","r","b","140"],["141","2025-10-03","r","b","141"],["142","2025-10-31","c","b","142"],["143","2025-12-04","b","b","143"],["144","2026-01-15","n","b","144"],["145","2026-02-12","p","b","145"]]},firefox:{releases:[["1","2004-11-09","r","g","1.7"],["2","2006-10-24","r","g","1.8.1"],["3","2008-06-17","r","g","1.9"],["4","2011-03-22","r","g","2"],["5","2011-06-21","r","g","5"],["6","2011-08-16","r","g","6"],["7","2011-09-27","r","g","7"],["8","2011-11-08","r","g","8"],["9","2011-12-20","r","g","9"],["10","2012-01-31","r","g","10"],["11","2012-03-13","r","g","11"],["12","2012-04-24","r","g","12"],["13","2012-06-05","r","g","13"],["14","2012-07-17","r","g","14"],["15","2012-08-28","r","g","15"],["16","2012-10-09","r","g","16"],["17","2012-11-20","r","g","17"],["18","2013-01-08","r","g","18"],["19","2013-02-19","r","g","19"],["20","2013-04-02","r","g","20"],["21","2013-05-14","r","g","21"],["22","2013-06-25","r","g","22"],["23","2013-08-06","r","g","23"],["24","2013-09-17","r","g","24"],["25","2013-10-29","r","g","25"],["26","2013-12-10","r","g","26"],["27","2014-02-04","r","g","27"],["28","2014-03-18","r","g","28"],["29","2014-04-29","r","g","29"],["30","2014-06-10","r","g","30"],["31","2014-07-22","r","g","31"],["32","2014-09-02","r","g","32"],["33","2014-10-14","r","g","33"],["34","2014-12-01","r","g","34"],["35","2015-01-13","r","g","35"],["36","2015-02-24","r","g","36"],["37","2015-03-31","r","g","37"],["38","2015-05-12","r","g","38"],["39","2015-07-02","r","g","39"],["40","2015-08-11","r","g","40"],["41","2015-09-22","r","g","41"],["42","2015-11-03","r","g","42"],["43","2015-12-15","r","g","43"],["44","2016-01-26","r","g","44"],["45","2016-03-08","r","g","45"],["46","2016-04-26","r","g","46"],["47","2016-06-07","r","g","47"],["48","2016-08-02","r","g","48"],["49","2016-09-20","r","g","49"],["50","2016-11-15","r","g","50"],["51","2017-01-24","r","g","51"],["52","2017-03-07","r","g","52"],["53","2017-04-19","r","g","53"],["54","2017-06-13","r","g","54"],["55","2017-08-08","r","g","55"],["56","2017-09-28","r","g","56"],["57","2017-11-14","r","g","57"],["58","2018-01-23","r","g","58"],["59","2018-03-13","r","g","59"],["60","2018-05-09","r","g","60"],["61","2018-06-26","r","g","61"],["62","2018-09-05","r","g","62"],["63","2018-10-23","r","g","63"],["64","2018-12-11","r","g","64"],["65","2019-01-29","r","g","65"],["66","2019-03-19","r","g","66"],["67","2019-05-21","r","g","67"],["68","2019-07-09","r","g","68"],["69","2019-09-03","r","g","69"],["70","2019-10-22","r","g","70"],["71","2019-12-10","r","g","71"],["72","2020-01-07","r","g","72"],["73","2020-02-11","r","g","73"],["74","2020-03-10","r","g","74"],["75","2020-04-07","r","g","75"],["76","2020-05-05","r","g","76"],["77","2020-06-02","r","g","77"],["78","2020-06-30","r","g","78"],["79","2020-07-28","r","g","79"],["80","2020-08-25","r","g","80"],["81","2020-09-22","r","g","81"],["82","2020-10-20","r","g","82"],["83","2020-11-17","r","g","83"],["84","2020-12-15","r","g","84"],["85","2021-01-26","r","g","85"],["86","2021-02-23","r","g","86"],["87","2021-03-23","r","g","87"],["88","2021-04-19","r","g","88"],["89","2021-06-01","r","g","89"],["90","2021-07-13","r","g","90"],["91","2021-08-10","r","g","91"],["92","2021-09-07","r","g","92"],["93","2021-10-05","r","g","93"],["94","2021-11-02","r","g","94"],["95","2021-12-07","r","g","95"],["96","2022-01-11","r","g","96"],["97","2022-02-08","r","g","97"],["98","2022-03-08","r","g","98"],["99","2022-04-05","r","g","99"],["100","2022-05-03","r","g","100"],["101","2022-05-31","r","g","101"],["102","2022-06-28","r","g","102"],["103","2022-07-26","r","g","103"],["104","2022-08-23","r","g","104"],["105","2022-09-20","r","g","105"],["106","2022-10-18","r","g","106"],["107","2022-11-15","r","g","107"],["108","2022-12-13","r","g","108"],["109","2023-01-17","r","g","109"],["110","2023-02-14","r","g","110"],["111","2023-03-14","r","g","111"],["112","2023-04-11","r","g","112"],["113","2023-05-09","r","g","113"],["114","2023-06-06","r","g","114"],["115","2023-07-04","r","g","115"],["116","2023-08-01","r","g","116"],["117","2023-08-29","r","g","117"],["118","2023-09-26","r","g","118"],["119","2023-10-24","r","g","119"],["120","2023-11-21","r","g","120"],["121","2023-12-19","r","g","121"],["122","2024-01-23","r","g","122"],["123","2024-02-20","r","g","123"],["124","2024-03-19","r","g","124"],["125","2024-04-16","r","g","125"],["126","2024-05-14","r","g","126"],["127","2024-06-11","r","g","127"],["128","2024-07-09","r","g","128"],["129","2024-08-06","r","g","129"],["130","2024-09-03","r","g","130"],["131","2024-10-01","r","g","131"],["132","2024-10-29","r","g","132"],["133","2024-11-26","r","g","133"],["134","2025-01-07","r","g","134"],["135","2025-02-04","r","g","135"],["136","2025-03-04","r","g","136"],["137","2025-04-01","r","g","137"],["138","2025-04-29","r","g","138"],["139","2025-05-27","r","g","139"],["140","2025-06-24","e","g","140"],["141","2025-07-22","r","g","141"],["142","2025-08-19","r","g","142"],["143","2025-09-16","r","g","143"],["144","2025-10-14","r","g","144"],["145","2025-11-11","c","g","145"],["146","2025-12-09","b","g","146"],["147","2026-01-13","n","g","147"],["148","2026-02-24","p","g","148"],["1.5","2005-11-29","r","g","1.8"],["3.5","2009-06-30","r","g","1.9.1"],["3.6","2010-01-21","r","g","1.9.2"]]},firefox_android:{releases:[["4","2011-03-29","r","g","2"],["5","2011-06-21","r","g","5"],["6","2011-08-16","r","g","6"],["7","2011-09-27","r","g","7"],["8","2011-11-08","r","g","8"],["9","2011-12-21","r","g","9"],["10","2012-01-31","r","g","10"],["14","2012-06-26","r","g","14"],["15","2012-08-28","r","g","15"],["16","2012-10-09","r","g","16"],["17","2012-11-20","r","g","17"],["18","2013-01-08","r","g","18"],["19","2013-02-19","r","g","19"],["20","2013-04-02","r","g","20"],["21","2013-05-14","r","g","21"],["22","2013-06-25","r","g","22"],["23","2013-08-06","r","g","23"],["24","2013-09-17","r","g","24"],["25","2013-10-29","r","g","25"],["26","2013-12-10","r","g","26"],["27","2014-02-04","r","g","27"],["28","2014-03-18","r","g","28"],["29","2014-04-29","r","g","29"],["30","2014-06-10","r","g","30"],["31","2014-07-22","r","g","31"],["32","2014-09-02","r","g","32"],["33","2014-10-14","r","g","33"],["34","2014-12-01","r","g","34"],["35","2015-01-13","r","g","35"],["36","2015-02-27","r","g","36"],["37","2015-03-31","r","g","37"],["38","2015-05-12","r","g","38"],["39","2015-07-02","r","g","39"],["40","2015-08-11","r","g","40"],["41","2015-09-22","r","g","41"],["42","2015-11-03","r","g","42"],["43","2015-12-15","r","g","43"],["44","2016-01-26","r","g","44"],["45","2016-03-08","r","g","45"],["46","2016-04-26","r","g","46"],["47","2016-06-07","r","g","47"],["48","2016-08-02","r","g","48"],["49","2016-09-20","r","g","49"],["50","2016-11-15","r","g","50"],["51","2017-01-24","r","g","51"],["52","2017-03-07","r","g","52"],["53","2017-04-19","r","g","53"],["54","2017-06-13","r","g","54"],["55","2017-08-08","r","g","55"],["56","2017-09-28","r","g","56"],["57","2017-11-28","r","g","57"],["58","2018-01-22","r","g","58"],["59","2018-03-13","r","g","59"],["60","2018-05-09","r","g","60"],["61","2018-06-26","r","g","61"],["62","2018-09-05","r","g","62"],["63","2018-10-23","r","g","63"],["64","2018-12-11","r","g","64"],["65","2019-01-29","r","g","65"],["66","2019-03-19","r","g","66"],["67","2019-05-21","r","g","67"],["68","2019-07-09","r","g","68"],["79","2020-07-28","r","g","79"],["80","2020-08-31","r","g","80"],["81","2020-09-22","r","g","81"],["82","2020-10-20","r","g","82"],["83","2020-11-17","r","g","83"],["84","2020-12-15","r","g","84"],["85","2021-01-26","r","g","85"],["86","2021-02-23","r","g","86"],["87","2021-03-23","r","g","87"],["88","2021-04-19","r","g","88"],["89","2021-06-01","r","g","89"],["90","2021-07-13","r","g","90"],["91","2021-08-10","r","g","91"],["92","2021-09-07","r","g","92"],["93","2021-10-05","r","g","93"],["94","2021-11-02","r","g","94"],["95","2021-12-07","r","g","95"],["96","2022-01-11","r","g","96"],["97","2022-02-08","r","g","97"],["98","2022-03-08","r","g","98"],["99","2022-04-05","r","g","99"],["100","2022-05-03","r","g","100"],["101","2022-05-31","r","g","101"],["102","2022-06-28","r","g","102"],["103","2022-07-26","r","g","103"],["104","2022-08-23","r","g","104"],["105","2022-09-20","r","g","105"],["106","2022-10-18","r","g","106"],["107","2022-11-15","r","g","107"],["108","2022-12-13","r","g","108"],["109","2023-01-17","r","g","109"],["110","2023-02-14","r","g","110"],["111","2023-03-14","r","g","111"],["112","2023-04-11","r","g","112"],["113","2023-05-09","r","g","113"],["114","2023-06-06","r","g","114"],["115","2023-07-04","r","g","115"],["116","2023-08-01","r","g","116"],["117","2023-08-29","r","g","117"],["118","2023-09-26","r","g","118"],["119","2023-10-24","r","g","119"],["120","2023-11-21","r","g","120"],["121","2023-12-19","r","g","121"],["122","2024-01-23","r","g","122"],["123","2024-02-20","r","g","123"],["124","2024-03-19","r","g","124"],["125","2024-04-16","r","g","125"],["126","2024-05-14","r","g","126"],["127","2024-06-11","r","g","127"],["128","2024-07-09","r","g","128"],["129","2024-08-06","r","g","129"],["130","2024-09-03","r","g","130"],["131","2024-10-01","r","g","131"],["132","2024-10-29","r","g","132"],["133","2024-11-26","r","g","133"],["134","2025-01-07","r","g","134"],["135","2025-02-04","r","g","135"],["136","2025-03-04","r","g","136"],["137","2025-04-01","r","g","137"],["138","2025-04-29","r","g","138"],["139","2025-05-27","r","g","139"],["140","2025-06-24","e","g","140"],["141","2025-07-22","r","g","141"],["142","2025-08-19","r","g","142"],["143","2025-09-16","r","g","143"],["144","2025-10-14","r","g","144"],["145","2025-11-11","c","g","145"],["146","2025-12-09","b","g","146"],["147","2026-01-13","n","g","147"],["148","2026-02-24","p","g","148"]]},opera:{releases:[["2","1996-07-14","r",null,null],["3","1997-12-01","r",null,null],["4","2000-06-28","r",null,null],["5","2000-12-06","r",null,null],["6","2001-12-18","r",null,null],["7","2003-01-28","r","p","1"],["8","2005-04-19","r","p","1"],["9","2006-06-20","r","p","2"],["10","2009-09-01","r","p","2.2"],["11","2010-12-16","r","p","2.7"],["12","2012-06-14","r","p","2.10"],["15","2013-07-02","r","b","28"],["16","2013-08-27","r","b","29"],["17","2013-10-08","r","b","30"],["18","2013-11-19","r","b","31"],["19","2014-01-28","r","b","32"],["20","2014-03-04","r","b","33"],["21","2014-05-06","r","b","34"],["22","2014-06-03","r","b","35"],["23","2014-07-22","r","b","36"],["24","2014-09-02","r","b","37"],["25","2014-10-15","r","b","38"],["26","2014-12-03","r","b","39"],["27","2015-01-27","r","b","40"],["28","2015-03-10","r","b","41"],["29","2015-04-28","r","b","42"],["30","2015-06-09","r","b","43"],["31","2015-08-04","r","b","44"],["32","2015-09-15","r","b","45"],["33","2015-10-27","r","b","46"],["34","2015-12-08","r","b","47"],["35","2016-02-02","r","b","48"],["36","2016-03-15","r","b","49"],["37","2016-05-04","r","b","50"],["38","2016-06-08","r","b","51"],["39","2016-08-02","r","b","52"],["40","2016-09-20","r","b","53"],["41","2016-10-25","r","b","54"],["42","2016-12-13","r","b","55"],["43","2017-02-07","r","b","56"],["44","2017-03-21","r","b","57"],["45","2017-05-10","r","b","58"],["46","2017-06-22","r","b","59"],["47","2017-08-09","r","b","60"],["48","2017-09-27","r","b","61"],["49","2017-11-08","r","b","62"],["50","2018-01-04","r","b","63"],["51","2018-02-07","r","b","64"],["52","2018-03-22","r","b","65"],["53","2018-05-10","r","b","66"],["54","2018-06-28","r","b","67"],["55","2018-08-16","r","b","68"],["56","2018-09-25","r","b","69"],["57","2018-11-28","r","b","70"],["58","2019-01-23","r","b","71"],["60","2019-04-09","r","b","73"],["62","2019-06-27","r","b","75"],["63","2019-08-20","r","b","76"],["64","2019-10-07","r","b","77"],["65","2019-11-13","r","b","78"],["66","2020-01-07","r","b","79"],["67","2020-03-03","r","b","80"],["68","2020-04-22","r","b","81"],["69","2020-06-24","r","b","83"],["70","2020-07-27","r","b","84"],["71","2020-09-15","r","b","85"],["72","2020-10-21","r","b","86"],["73","2020-12-09","r","b","87"],["74","2021-02-02","r","b","88"],["75","2021-03-24","r","b","89"],["76","2021-04-28","r","b","90"],["77","2021-06-09","r","b","91"],["78","2021-08-03","r","b","92"],["79","2021-09-14","r","b","93"],["80","2021-10-05","r","b","94"],["81","2021-11-04","r","b","95"],["82","2021-12-02","r","b","96"],["83","2022-01-19","r","b","97"],["84","2022-02-16","r","b","98"],["85","2022-03-23","r","b","99"],["86","2022-04-20","r","b","100"],["87","2022-05-17","r","b","101"],["88","2022-06-08","r","b","102"],["89","2022-07-07","r","b","103"],["90","2022-08-18","r","b","104"],["91","2022-09-14","r","b","105"],["92","2022-10-19","r","b","106"],["93","2022-11-17","r","b","107"],["94","2022-12-15","r","b","108"],["95","2023-02-01","r","b","109"],["96","2023-02-22","r","b","110"],["97","2023-03-22","r","b","111"],["98","2023-04-20","r","b","112"],["99","2023-05-16","r","b","113"],["100","2023-06-29","r","b","114"],["101","2023-07-26","r","b","115"],["102","2023-08-23","r","b","116"],["103","2023-10-03","r","b","117"],["104","2023-10-23","r","b","118"],["105","2023-11-14","r","b","119"],["106","2023-12-19","r","b","120"],["107","2024-02-07","r","b","121"],["108","2024-03-05","r","b","122"],["109","2024-03-27","r","b","123"],["110","2024-05-14","r","b","124"],["111","2024-06-12","r","b","125"],["112","2024-07-11","r","b","126"],["113","2024-08-22","r","b","127"],["114","2024-09-25","r","b","128"],["115","2024-11-27","r","b","130"],["116","2025-01-08","r","b","131"],["117","2025-02-13","r","b","132"],["118","2025-04-15","r","b","133"],["119","2025-05-13","r","b","134"],["120","2025-07-02","r","b","135"],["121","2025-08-27","r","b","137"],["122","2025-09-11","r","b","138"],["123","2025-10-28","c","b","139"],["124",null,"b","b","140"],["125",null,"n","b","141"],["10.1","2009-11-23","r","p","2.2"],["10.5","2010-03-02","r","p","2.5"],["10.6","2010-07-01","r","p","2.6"],["11.1","2011-04-12","r","p","2.8"],["11.5","2011-06-28","r","p","2.9"],["11.6","2011-12-06","r","p","2.10"],["12.1","2012-11-20","r","p","2.12"],["3.5","1998-11-18","r",null,null],["3.6","1999-05-06","r",null,null],["5.1","2001-04-10","r",null,null],["7.1","2003-04-11","r","p","1"],["7.2","2003-09-23","r","p","1"],["7.5","2004-05-12","r","p","1"],["8.5","2005-09-20","r","p","1"],["9.1","2006-12-18","r","p","2"],["9.2","2007-04-11","r","p","2"],["9.5","2008-06-12","r","p","2.1"],["9.6","2008-10-08","r","p","2.1"]]},opera_android:{releases:[["11","2011-03-22","r","p","2.7"],["12","2012-02-25","r","p","2.10"],["14","2013-05-21","r","w","537.31"],["15","2013-07-08","r","b","28"],["16","2013-09-18","r","b","29"],["18","2013-11-20","r","b","31"],["19","2014-01-28","r","b","32"],["20","2014-03-06","r","b","33"],["21","2014-04-22","r","b","34"],["22","2014-06-17","r","b","35"],["24","2014-09-10","r","b","37"],["25","2014-10-16","r","b","38"],["26","2014-12-02","r","b","39"],["27","2015-01-29","r","b","40"],["28","2015-03-10","r","b","41"],["29","2015-04-28","r","b","42"],["30","2015-06-10","r","b","43"],["32","2015-09-23","r","b","45"],["33","2015-11-03","r","b","46"],["34","2015-12-16","r","b","47"],["35","2016-02-04","r","b","48"],["36","2016-03-31","r","b","49"],["37","2016-06-16","r","b","50"],["41","2016-10-25","r","b","54"],["42","2017-01-21","r","b","55"],["43","2017-09-27","r","b","59"],["44","2017-12-11","r","b","60"],["45","2018-02-15","r","b","61"],["46","2018-05-14","r","b","63"],["47","2018-07-23","r","b","66"],["48","2018-11-08","r","b","69"],["49","2018-12-07","r","b","70"],["50","2019-02-18","r","b","71"],["51","2019-03-21","r","b","72"],["52","2019-05-17","r","b","73"],["53","2019-07-11","r","b","74"],["54","2019-10-18","r","b","76"],["55","2019-12-03","r","b","77"],["56","2020-02-06","r","b","78"],["57","2020-03-30","r","b","80"],["58","2020-05-13","r","b","81"],["59","2020-06-30","r","b","83"],["60","2020-09-23","r","b","85"],["61","2020-12-07","r","b","86"],["62","2021-02-16","r","b","87"],["63","2021-04-16","r","b","89"],["64","2021-05-25","r","b","91"],["65","2021-10-20","r","b","92"],["66","2021-12-15","r","b","94"],["67","2022-01-31","r","b","96"],["68","2022-03-30","r","b","99"],["69","2022-05-09","r","b","100"],["70","2022-06-29","r","b","102"],["71","2022-09-16","r","b","104"],["72","2022-10-21","r","b","106"],["73","2023-01-17","r","b","108"],["74","2023-03-13","r","b","110"],["75","2023-05-17","r","b","112"],["76","2023-06-26","r","b","114"],["77","2023-08-31","r","b","115"],["78","2023-10-23","r","b","117"],["79","2023-12-06","r","b","119"],["80","2024-01-25","r","b","120"],["81","2024-03-14","r","b","122"],["82","2024-05-02","r","b","124"],["83","2024-06-25","r","b","126"],["84","2024-08-26","r","b","127"],["85","2024-10-29","r","b","128"],["86","2024-12-02","r","b","130"],["87","2025-01-22","r","b","132"],["88","2025-03-19","r","b","134"],["89","2025-04-29","r","b","135"],["90","2025-06-18","r","b","137"],["91","2025-08-19","r","b","139"],["92","2025-10-08","c","b","140"],["10.1","2010-11-09","r","p","2.5"],["11.1","2011-06-30","r","p","2.8"],["11.5","2011-10-12","r","p","2.9"],["12.1","2012-10-09","r","p","2.11"]]},safari:{releases:[["1","2003-06-23","r","w","85"],["2","2005-04-29","r","w","412"],["3","2007-10-26","r","w","523.10"],["4","2009-06-08","r","w","530.17"],["5","2010-06-07","r","w","533.16"],["6","2012-07-25","r","w","536.25"],["7","2013-10-22","r","w","537.71"],["8","2014-10-16","r","w","538.35"],["9","2015-09-30","r","w","601.1.56"],["10","2016-09-20","r","w","602.1.50"],["11","2017-09-19","r","w","604.2.4"],["12","2018-09-17","r","w","606.1.36"],["13","2019-09-19","r","w","608.2.11"],["14","2020-09-16","r","w","610.1.28"],["15","2021-09-20","r","w","612.1.27"],["16","2022-09-12","r","w","614.1.25"],["17","2023-09-18","r","w","616.1.27"],["18","2024-09-16","r","w","619.1.26"],["26","2025-09-15","r","w","622.1.22"],["1.1","2003-10-24","r","w","100"],["1.2","2004-02-02","r","w","125"],["1.3","2005-04-15","r","w","312"],["10.1","2017-03-27","r","w","603.2.1"],["11.1","2018-04-12","r","w","605.1.33"],["12.1","2019-03-25","r","w","607.1.40"],["13.1","2020-03-24","r","w","609.1.20"],["14.1","2021-04-26","r","w","611.1.21"],["15.1","2021-10-25","r","w","612.2.9"],["15.2","2021-12-13","r","w","612.3.6"],["15.3","2022-01-26","r","w","612.4.9"],["15.4","2022-03-14","r","w","613.1.17"],["15.5","2022-05-16","r","w","613.2.7"],["15.6","2022-07-20","r","w","613.3.9"],["16.1","2022-10-24","r","w","614.2.9"],["16.2","2022-12-13","r","w","614.3.7"],["16.3","2023-01-23","r","w","614.4.6"],["16.4","2023-03-27","r","w","615.1.26"],["16.5","2023-05-18","r","w","615.2.9"],["16.6","2023-07-24","r","w","615.3.12"],["17.1","2023-10-25","r","w","616.2.9"],["17.2","2023-12-11","r","w","617.1.17"],["17.3","2024-01-22","r","w","617.2.4"],["17.4","2024-03-05","r","w","618.1.15"],["17.5","2024-05-13","r","w","618.2.12"],["17.6","2024-07-29","r","w","618.3.11"],["18.1","2024-10-28","r","w","619.2.8"],["18.2","2024-12-11","r","w","620.1.16"],["18.3","2025-01-27","r","w","620.2.4"],["18.4","2025-03-31","r","w","621.1.15"],["18.5","2025-05-12","r","w","621.2.5"],["18.6","2025-07-29","r","w","621.3.11"],["26.1","2025-11-03","c","w","622.2.11"],["26.2",null,"b","w","623.1.12"],["3.1","2008-03-18","r","w","525.13"],["5.1","2011-07-20","r","w","534.48"],["9.1","2016-03-21","r","w","601.5.17"]]},safari_ios:{releases:[["1","2007-06-29","r","w","522.11"],["2","2008-07-11","r","w","525.18"],["3","2009-06-17","r","w","528.18"],["4","2010-06-21","r","w","532.9"],["5","2011-10-12","r","w","534.46"],["6","2012-09-10","r","w","536.26"],["7","2013-09-18","r","w","537.51"],["8","2014-09-17","r","w","600.1.4"],["9","2015-09-16","r","w","601.1.56"],["10","2016-09-13","r","w","602.1.50"],["11","2017-09-19","r","w","604.2.4"],["12","2018-09-17","r","w","606.1.36"],["13","2019-09-19","r","w","608.2.11"],["14","2020-09-16","r","w","610.1.28"],["15","2021-09-20","r","w","612.1.27"],["16","2022-09-12","r","w","614.1.25"],["17","2023-09-18","r","w","616.1.27"],["18","2024-09-16","r","w","619.1.26"],["26","2025-09-15","r","w","622.1.22"],["10.3","2017-03-27","r","w","603.2.1"],["11.3","2018-03-29","r","w","605.1.33"],["12.2","2019-03-25","r","w","607.1.40"],["13.4","2020-03-24","r","w","609.1.20"],["14.5","2021-04-26","r","w","611.1.21"],["15.1","2021-10-25","r","w","612.2.9"],["15.2","2021-12-13","r","w","612.3.6"],["15.3","2022-01-26","r","w","612.4.9"],["15.4","2022-03-14","r","w","613.1.17"],["15.5","2022-05-16","r","w","613.2.7"],["15.6","2022-07-20","r","w","613.3.9"],["16.1","2022-10-24","r","w","614.2.9"],["16.2","2022-12-13","r","w","614.3.7"],["16.3","2023-01-23","r","w","614.4.6"],["16.4","2023-03-27","r","w","615.1.26"],["16.5","2023-05-18","r","w","615.2.9"],["16.6","2023-07-24","r","w","615.3.12"],["17.1","2023-10-25","r","w","616.2.9"],["17.2","2023-12-11","r","w","617.1.17"],["17.3","2024-01-22","r","w","617.2.4"],["17.4","2024-03-05","r","w","618.1.15"],["17.5","2024-05-13","r","w","618.2.12"],["17.6","2024-07-29","r","w","618.3.11"],["18.1","2024-10-28","r","w","619.2.8"],["18.2","2024-12-11","r","w","620.1.16"],["18.3","2025-01-27","r","w","620.2.4"],["18.4","2025-03-31","r","w","621.1.15"],["18.5","2025-05-12","r","w","621.2.5"],["18.6","2025-07-29","r","w","621.3.11"],["26.1","2025-11-03","c","w","622.2.11"],["26.2",null,"b","w","623.1.12"],["3.2","2010-04-03","r","w","531.21"],["4.2","2010-11-22","r","w","533.17"],["9.3","2016-03-21","r","w","601.5.17"]]},samsunginternet_android:{releases:[["1.0","2013-04-27","r","w","535.19"],["1.5","2013-09-25","r","b","28"],["1.6","2014-04-11","r","b","28"],["10.0","2019-08-22","r","b","71"],["10.2","2019-10-09","r","b","71"],["11.0","2019-12-05","r","b","75"],["11.2","2020-03-22","r","b","75"],["12.0","2020-06-19","r","b","79"],["12.1","2020-07-07","r","b","79"],["13.0","2020-12-02","r","b","83"],["13.2","2021-01-20","r","b","83"],["14.0","2021-04-17","r","b","87"],["14.2","2021-06-25","r","b","87"],["15.0","2021-08-13","r","b","90"],["16.0","2021-11-25","r","b","92"],["16.2","2022-03-06","r","b","92"],["17.0","2022-05-04","r","b","96"],["18.0","2022-08-08","r","b","99"],["18.1","2022-09-09","r","b","99"],["19.0","2022-11-01","r","b","102"],["19.1","2022-11-08","r","b","102"],["2.0","2014-10-17","r","b","34"],["2.1","2015-01-07","r","b","34"],["20.0","2023-02-10","r","b","106"],["21.0","2023-05-19","r","b","110"],["22.0","2023-07-14","r","b","111"],["23.0","2023-10-18","r","b","115"],["24.0","2024-01-25","r","b","117"],["25.0","2024-04-24","r","b","121"],["26.0","2024-06-07","r","b","122"],["27.0","2024-11-06","r","b","125"],["28.0","2025-04-02","c","b","130"],["29.0",null,"b","b","136"],["3.0","2015-04-10","r","b","38"],["3.2","2015-08-24","r","b","38"],["4.0","2016-03-11","r","b","44"],["4.2","2016-08-02","r","b","44"],["5.0","2016-12-15","r","b","51"],["5.2","2017-04-21","r","b","51"],["5.4","2017-05-17","r","b","51"],["6.0","2017-08-23","r","b","56"],["6.2","2017-10-26","r","b","56"],["6.4","2018-02-19","r","b","56"],["7.0","2018-03-16","r","b","59"],["7.2","2018-06-20","r","b","59"],["7.4","2018-09-12","r","b","59"],["8.0","2018-07-18","r","b","63"],["8.2","2018-12-21","r","b","63"],["9.0","2018-09-15","r","b","67"],["9.2","2019-04-02","r","b","67"],["9.4","2019-07-25","r","b","67"]]},webview_android:{releases:[["1","2008-09-23","r","w","523.12"],["2","2009-10-26","r","w","530.17"],["3","2011-02-22","r","w","534.13"],["4","2011-10-18","r","w","534.30"],["37","2014-09-03","r","b","37"],["38","2014-10-08","r","b","38"],["39","2014-11-12","r","b","39"],["40","2015-01-21","r","b","40"],["41","2015-03-11","r","b","41"],["42","2015-04-15","r","b","42"],["43","2015-05-27","r","b","43"],["44","2015-07-29","r","b","44"],["45","2015-09-01","r","b","45"],["46","2015-10-14","r","b","46"],["47","2015-12-02","r","b","47"],["48","2016-01-26","r","b","48"],["49","2016-03-09","r","b","49"],["50","2016-04-13","r","b","50"],["51","2016-06-08","r","b","51"],["52","2016-07-27","r","b","52"],["53","2016-09-07","r","b","53"],["54","2016-10-19","r","b","54"],["55","2016-12-06","r","b","55"],["56","2017-02-01","r","b","56"],["57","2017-03-16","r","b","57"],["58","2017-04-25","r","b","58"],["59","2017-06-06","r","b","59"],["60","2017-08-01","r","b","60"],["61","2017-09-05","r","b","61"],["62","2017-10-24","r","b","62"],["63","2017-12-05","r","b","63"],["64","2018-01-23","r","b","64"],["65","2018-03-06","r","b","65"],["66","2018-04-17","r","b","66"],["67","2018-05-31","r","b","67"],["68","2018-07-24","r","b","68"],["69","2018-09-04","r","b","69"],["70","2018-10-17","r","b","70"],["71","2018-12-04","r","b","71"],["72","2019-01-29","r","b","72"],["73","2019-03-12","r","b","73"],["74","2019-04-24","r","b","74"],["75","2019-06-04","r","b","75"],["76","2019-07-30","r","b","76"],["77","2019-09-10","r","b","77"],["78","2019-10-22","r","b","78"],["79","2019-12-17","r","b","79"],["80","2020-02-04","r","b","80"],["81","2020-04-07","r","b","81"],["83","2020-05-19","r","b","83"],["84","2020-07-27","r","b","84"],["85","2020-08-25","r","b","85"],["86","2020-10-20","r","b","86"],["87","2020-11-17","r","b","87"],["88","2021-01-19","r","b","88"],["89","2021-03-02","r","b","89"],["90","2021-04-13","r","b","90"],["91","2021-05-25","r","b","91"],["92","2021-07-20","r","b","92"],["93","2021-08-31","r","b","93"],["94","2021-09-21","r","b","94"],["95","2021-10-19","r","b","95"],["96","2021-11-15","r","b","96"],["97","2022-01-04","r","b","97"],["98","2022-02-01","r","b","98"],["99","2022-03-01","r","b","99"],["100","2022-03-29","r","b","100"],["101","2022-04-26","r","b","101"],["102","2022-05-24","r","b","102"],["103","2022-06-21","r","b","103"],["104","2022-08-02","r","b","104"],["105","2022-09-02","r","b","105"],["106","2022-09-27","r","b","106"],["107","2022-10-25","r","b","107"],["108","2022-11-29","r","b","108"],["109","2023-01-10","r","b","109"],["110","2023-02-07","r","b","110"],["111","2023-03-01","r","b","111"],["112","2023-04-04","r","b","112"],["113","2023-05-02","r","b","113"],["114","2023-05-30","r","b","114"],["115","2023-07-21","r","b","115"],["116","2023-08-15","r","b","116"],["117","2023-09-12","r","b","117"],["118","2023-10-10","r","b","118"],["119","2023-10-31","r","b","119"],["120","2023-12-05","r","b","120"],["121","2024-01-23","r","b","121"],["122","2024-02-20","r","b","122"],["123","2024-03-19","r","b","123"],["124","2024-04-16","r","b","124"],["125","2024-05-14","r","b","125"],["126","2024-06-11","r","b","126"],["127","2024-07-23","r","b","127"],["128","2024-08-20","r","b","128"],["129","2024-09-17","r","b","129"],["130","2024-10-15","r","b","130"],["131","2024-11-12","r","b","131"],["132","2025-01-14","r","b","132"],["133","2025-02-04","r","b","133"],["134","2025-03-04","r","b","134"],["135","2025-04-01","r","b","135"],["136","2025-04-29","r","b","136"],["137","2025-05-27","r","b","137"],["138","2025-06-24","r","b","138"],["139","2025-08-05","r","b","139"],["140","2025-09-02","r","b","140"],["141","2025-09-30","r","b","141"],["142","2025-10-28","c","b","142"],["143","2025-12-02","b","b","143"],["144","2026-01-13","n","b","144"],["145",null,"p","b","145"],["1.5","2009-04-27","r","w","525.20"],["2.2","2010-05-20","r","w","533.1"],["4.4","2013-12-09","r","b","30"],["4.4.3","2014-06-02","r","b","33"]]}},a={ya_android:{releases:[["1.0","u","u","b","25"],["1.5","u","u","b","22"],["1.6","u","u","b","25"],["1.7","u","u","b","25"],["1.20","u","u","b","25"],["2.5","u","u","b","25"],["3.2","u","u","b","25"],["4.6","u","u","b","25"],["5.3","u","u","b","25"],["5.4","u","u","b","25"],["7.4","u","u","b","25"],["9.6","u","u","b","25"],["10.5","u","u","b","25"],["11.4","u","u","b","25"],["11.5","u","u","b","25"],["12.7","u","u","b","25"],["13.9","u","u","b","28"],["13.10","u","u","b","28"],["13.11","u","u","b","28"],["13.12","u","u","b","30"],["14.2","u","u","b","32"],["14.4","u","u","b","33"],["14.5","u","u","b","34"],["14.7","u","u","b","35"],["14.8","u","u","b","36"],["14.10","u","u","b","37"],["14.12","u","u","b","38"],["15.2","u","u","b","40"],["15.4","u","u","b","41"],["15.6","u","u","b","42"],["15.7","u","u","b","43"],["15.9","u","u","b","44"],["15.10","u","u","b","45"],["15.12","u","u","b","46"],["16.2","u","u","b","47"],["16.3","u","u","b","47"],["16.4","u","u","b","49"],["16.6","u","u","b","50"],["16.7","u","u","b","51"],["16.9","u","u","b","52"],["16.10","u","u","b","53"],["16.11","u","u","b","54"],["17.1","u","u","b","55"],["17.3","u","u","b","56"],["17.4","u","u","b","57"],["17.6","u","u","b","58"],["17.7","u","u","b","59"],["17.9","u","u","b","60"],["17.10","u","u","b","61"],["17.11","u","u","b","62"],["18.1","u","u","b","63"],["18.2","u","u","b","63"],["18.3","u","u","b","64"],["18.4","u","u","b","65"],["18.6","u","u","b","66"],["18.7","u","u","b","67"],["18.9","u","u","b","68"],["18.10","u","u","b","69"],["18.11","u","u","b","70"],["19.1","u","u","b","71"],["19.3","u","u","b","72"],["19.4","u","u","b","73"],["19.5","u","u","b","75"],["19.6","u","u","b","75"],["19.7","u","u","b","75"],["19.9","u","u","b","76"],["19.10","u","u","b","77"],["19.11","u","u","b","78"],["19.12","u","u","b","78"],["20.2","u","u","b","79"],["20.3","u","u","b","80"],["20.4","u","u","b","81"],["20.6","u","u","b","81"],["20.7","u","u","b","83"],["20.8","2020-09-02","u","b","84"],["20.9","2020-09-27","u","b","85"],["20.11","2020-11-11","u","b","86"],["20.12","2020-12-20","u","b","87"],["21.1","2021-12-31","u","b","88"],["21.2","u","u","b","88"],["21.3","2021-04-04","u","b","89"],["21.5","u","u","b","90"],["21.6","2021-09-28","u","b","91"],["21.8","2021-09-28","u","b","92"],["21.9","2021-09-29","u","b","93"],["21.11","2021-10-29","u","b","94"],["22.1","2021-12-31","u","b","96"],["22.3","2022-03-25","u","b","98"],["22.4","u","u","b","92"],["22.5","2022-05-20","u","b","100"],["22.7","2022-07-07","u","b","102"],["22.8","u","u","b","104"],["22.9","2022-08-27","u","b","104"],["22.11","2022-11-11","u","b","106"],["23.1","2023-01-10","u","b","108"],["23.3","2023-03-26","u","b","110"],["23.5","2023-05-19","u","b","112"],["23.7","2023-07-06","u","b","114"],["23.9","2023-09-13","u","b","116"],["23.11","2023-11-15","u","b","118"],["24.1","2024-01-18","u","b","120"],["24.2","2024-03-25","u","b","120"],["24.4","2024-03-27","u","b","122"],["24.6","2024-06-04","u","b","124"],["24.7","2024-07-18","u","b","126"],["24.9","2024-10-01","u","b","126"],["24.10","2024-10-11","u","b","128"],["24.12","2024-11-30","u","b","130"],["25.2","2025-04-24","u","b","132"],["25.3","2025-04-23","u","b","132"],["25.4","2025-04-23","u","b","134"],["25.6","2025-09-04","u","b","136"],["25.8","2025-08-30","u","b","138"],["25.10","2025-10-09","u","b","140"]]},uc_android:{releases:[["10.5","u","u","b","31"],["10.7","u","u","b","31"],["10.8","u","u","b","31"],["10.10","u","u","b","31"],["11.0","u","u","b","31"],["11.1","u","u","b","40"],["11.2","u","u","b","40"],["11.3","u","u","b","40"],["11.4","u","u","b","40"],["11.5","u","u","b","40"],["11.6","u","u","b","57"],["11.8","u","u","b","57"],["11.9","u","u","b","57"],["12.0","u","u","b","57"],["12.1","u","u","b","57"],["12.2","u","u","b","57"],["12.3","u","u","b","57"],["12.4","u","u","b","57"],["12.5","u","u","b","57"],["12.6","u","u","b","57"],["12.7","u","u","b","57"],["12.8","u","u","b","57"],["12.9","u","u","b","57"],["12.10","u","u","b","57"],["12.11","u","u","b","57"],["12.12","u","u","b","57"],["12.13","u","u","b","57"],["12.14","u","u","b","57"],["13.0","u","u","b","57"],["13.1","u","u","b","57"],["13.2","u","u","b","57"],["13.3","2020-09-09","u","b","78"],["13.4","2021-09-28","u","b","78"],["13.5","2023-08-25","u","b","78"],["13.6","2023-12-17","u","b","78"],["13.7","2023-06-24","u","b","78"],["13.8","2022-04-30","u","b","78"],["13.9","2022-05-18","u","b","78"],["15.0","2022-08-24","u","b","78"],["15.1","2022-11-11","u","b","78"],["15.2","2023-04-23","u","b","78"],["15.3","2023-03-17","u","b","100"],["15.4","2023-10-25","u","b","100"],["15.5","2023-08-22","u","b","100"],["16.0","2023-08-24","u","b","100"],["16.1","2023-10-15","u","b","100"],["16.2","2023-12-09","u","b","100"],["16.3","2024-03-08","u","b","100"],["16.4","2024-10-03","u","b","100"],["16.5","2024-05-30","u","b","100"],["16.6","2024-07-23","u","b","100"],["17.0","2024-08-24","u","b","100"],["17.1","2024-09-26","u","b","100"],["17.2","2024-11-29","u","b","100"],["17.3","2025-01-07","u","b","100"],["17.4","2025-02-26","u","b","100"],["17.5","2025-04-08","u","b","100"],["17.6","2025-05-15","u","b","123"],["17.7","2025-06-11","u","b","123"],["17.8","2025-07-30","u","b","123"],["18.0","2025-08-17","u","b","123"],["18.1","2025-10-04","u","b","123"],["18.2","2025-11-04","u","b","123"]]},qq_android:{releases:[["6.0","u","u","b","37"],["6.1","u","u","b","37"],["6.2","u","u","b","37"],["6.3","u","u","b","37"],["6.4","u","u","b","37"],["6.6","u","u","b","37"],["6.7","u","u","b","37"],["6.8","u","u","b","37"],["6.9","u","u","b","37"],["7.0","u","u","b","37"],["7.1","u","u","b","37"],["7.2","u","u","b","37"],["7.3","u","u","b","37"],["7.4","u","u","b","37"],["7.5","u","u","b","37"],["7.6","u","u","b","37"],["7.7","u","u","b","37"],["7.8","u","u","b","37"],["7.9","u","u","b","37"],["8.0","u","u","b","37"],["8.1","u","u","b","57"],["8.2","u","u","b","57"],["8.3","u","u","b","57"],["8.4","u","u","b","57"],["8.5","u","u","b","57"],["8.6","u","u","b","57"],["8.7","u","u","b","57"],["8.8","u","u","b","57"],["8.9","u","u","b","57"],["9.1","u","u","b","57"],["9.6","u","u","b","66"],["9.7","u","u","b","66"],["9.8","u","u","b","66"],["10.0","u","u","b","66"],["10.1","u","u","b","66"],["10.2","u","u","b","66"],["10.3","u","u","b","66"],["10.4","u","u","b","66"],["10.5","u","u","b","66"],["10.7","2020-09-09","u","b","66"],["10.9","2020-11-22","u","b","77"],["11.0","u","u","b","77"],["11.2","2021-01-30","u","b","77"],["11.3","2021-03-31","u","b","77"],["11.7","2021-11-02","u","b","89"],["11.9","u","u","b","89"],["12.0","2021-11-04","u","b","89"],["12.1","2021-11-05","u","b","89"],["12.2","2021-12-07","u","b","89"],["12.5","2022-04-07","u","b","89"],["12.7","2022-05-21","u","b","89"],["12.8","2022-06-30","u","b","89"],["12.9","2022-07-26","u","b","89"],["13.0","2022-08-15","u","b","89"],["13.1","2022-09-10","u","b","89"],["13.2","2022-10-26","u","b","89"],["13.3","2022-11-09","u","b","89"],["13.4","2023-04-26","u","b","98"],["13.5","2023-02-06","u","b","98"],["13.6","2023-02-09","u","b","98"],["13.7","2023-04-21","u","b","98"],["13.8","2023-04-21","u","b","98"],["14.0","2023-12-12","u","b","98"],["14.1","2023-07-16","u","b","98"],["14.2","2023-10-14","u","b","109"],["14.3","2023-09-13","u","b","109"],["14.4","2023-10-31","u","b","109"],["14.5","2023-11-12","u","b","109"],["14.6","2023-12-24","u","b","109"],["14.7","2024-01-18","u","b","109"],["14.8","2024-03-04","u","b","109"],["14.9","2024-04-09","u","b","109"],["15.0","2024-04-17","u","b","109"],["15.1","2024-05-18","u","b","109"],["15.2","2024-10-24","u","b","109"],["15.3","2024-07-28","u","b","109"],["15.4","2024-09-07","u","b","109"],["15.5","2024-09-24","u","b","109"],["15.6","2024-10-24","u","b","109"],["15.7","2024-12-03","u","b","109"],["15.8","2024-12-11","u","b","109"],["15.9","2025-02-01","u","b","109"],["19.1","2025-07-08","u","b","121"],["19.2","2025-07-15","u","b","121"],["19.3","2025-08-31","u","b","121"],["19.4","2025-09-20","u","b","121"],["19.5","2025-10-23","u","b","121"],["19.6","2025-11-17","u","b","121"]]},kai_os:{releases:[["1.0","2017-03-01","u","g","37"],["2.0","2017-07-01","u","g","48"],["2.5","2017-07-01","u","g","48"],["3.0","2021-09-01","u","g","84"],["3.1","2022-03-01","u","g","84"],["4.0","2025-05-01","u","g","123"]]},facebook_android:{releases:[["66","u","u","b","48"],["68","u","u","b","48"],["74","u","u","b","50"],["75","u","u","b","50"],["76","u","u","b","50"],["77","u","u","b","50"],["78","u","u","b","50"],["79","u","u","b","50"],["80","u","u","b","51"],["81","u","u","b","51"],["82","u","u","b","51"],["83","u","u","b","51"],["84","u","u","b","51"],["86","u","u","b","51"],["87","u","u","b","52"],["88","u","u","b","52"],["89","u","u","b","52"],["90","u","u","b","52"],["91","u","u","b","52"],["92","u","u","b","52"],["93","u","u","b","52"],["94","u","u","b","52"],["95","u","u","b","53"],["96","u","u","b","53"],["97","u","u","b","53"],["98","u","u","b","53"],["99","u","u","b","53"],["100","u","u","b","54"],["101","u","u","b","54"],["103","u","u","b","54"],["104","u","u","b","54"],["105","u","u","b","54"],["106","u","u","b","55"],["107","u","u","b","55"],["108","u","u","b","55"],["109","u","u","b","55"],["110","u","u","b","55"],["111","u","u","b","55"],["112","u","u","b","56"],["113","u","u","b","56"],["114","u","u","b","56"],["115","u","u","b","56"],["116","u","u","b","56"],["117","u","u","b","57"],["118","u","u","b","57"],["119","u","u","b","57"],["120","u","u","b","57"],["121","u","u","b","57"],["122","u","u","b","58"],["123","u","u","b","58"],["124","u","u","b","58"],["125","u","u","b","58"],["126","u","u","b","58"],["127","u","u","b","58"],["128","u","u","b","58"],["129","u","u","b","58"],["130","u","u","b","59"],["131","u","u","b","59"],["132","u","u","b","59"],["133","u","u","b","59"],["134","u","u","b","59"],["135","u","u","b","59"],["136","u","u","b","59"],["137","u","u","b","59"],["138","u","u","b","60"],["140","u","u","b","60"],["142","u","u","b","61"],["143","u","u","b","61"],["144","u","u","b","61"],["145","u","u","b","61"],["146","u","u","b","61"],["147","u","u","b","61"],["148","u","u","b","61"],["149","u","u","b","62"],["150","u","u","b","62"],["151","u","u","b","62"],["152","u","u","b","62"],["153","u","u","b","63"],["154","u","u","b","63"],["155","u","u","b","63"],["156","u","u","b","63"],["157","u","u","b","64"],["158","u","u","b","64"],["159","u","u","b","64"],["160","u","u","b","64"],["161","u","u","b","64"],["162","u","u","b","64"],["163","u","u","b","65"],["164","u","u","b","65"],["165","u","u","b","65"],["166","u","u","b","65"],["167","u","u","b","65"],["168","u","u","b","65"],["169","u","u","b","66"],["170","u","u","b","66"],["171","u","u","b","66"],["172","u","u","b","66"],["173","u","u","b","66"],["174","u","u","b","66"],["175","u","u","b","67"],["176","u","u","b","67"],["177","u","u","b","67"],["178","u","u","b","67"],["180","u","u","b","67"],["181","u","u","b","67"],["182","u","u","b","67"],["183","u","u","b","68"],["184","u","u","b","68"],["185","u","u","b","68"],["186","u","u","b","68"],["187","u","u","b","68"],["188","u","u","b","68"],["202","u","u","b","71"],["227","u","u","b","75"],["228","u","u","b","75"],["229","u","u","b","75"],["230","u","u","b","75"],["231","u","u","b","75"],["233","u","u","b","76"],["235","u","u","b","76"],["236","u","u","b","76"],["237","u","u","b","76"],["238","u","u","b","76"],["240","u","u","b","77"],["241","u","u","b","77"],["242","u","u","b","77"],["243","u","u","b","77"],["244","u","u","b","78"],["245","u","u","b","78"],["246","u","u","b","78"],["247","u","u","b","78"],["248","u","u","b","78"],["249","u","u","b","78"],["250","u","u","b","78"],["251","u","u","b","79"],["252","u","u","b","79"],["253","u","u","b","79"],["254","u","u","b","79"],["255","u","u","b","79"],["256","u","u","b","80"],["257","u","u","b","80"],["258","u","u","b","80"],["259","u","u","b","80"],["260","u","u","b","80"],["261","u","u","b","80"],["262","u","u","b","80"],["263","u","u","b","80"],["264","u","u","b","80"],["265","u","u","b","80"],["266","u","u","b","81"],["267","u","u","b","81"],["268","u","u","b","81"],["269","u","u","b","81"],["270","u","u","b","81"],["271","u","u","b","81"],["272","u","u","b","83"],["273","u","u","b","83"],["274","u","u","b","83"],["275","u","u","b","83"],["297","2020-12-02","u","b","86"],["348","2021-12-19","u","b","96"],["399","2023-02-04","u","b","109"],["400","2023-02-10","u","b","109"],["420","2023-06-28","u","b","114"],["430","2023-09-03","u","b","116"],["434","2023-10-05","u","b","117"],["436","2023-10-13","u","b","117"],["437","u","u","b","118"],["438","2023-10-28","u","b","118"],["439","2023-11-11","u","b","119"],["440","2023-11-12","u","b","119"],["441","2023-11-20","u","b","119"],["442","2023-11-29","u","b","119"],["443","2023-12-07","u","b","120"],["444","2023-12-13","u","b","120"],["445","2023-12-21","u","b","120"],["446","2024-01-06","u","b","120"],["447","2024-01-12","u","b","120"],["448","2024-01-29","u","b","121"],["449","2024-02-02","u","b","121"],["450","2024-02-05","u","b","121"],["451","2024-02-17","u","b","121"],["452","2024-02-25","u","b","122"],["453","2024-02-28","u","b","122"],["454","2024-03-04","u","b","122"],["465","2024-07-07","u","b","126"],["466","u","u","b","126"],["469","u","u","b","126"],["471","2024-07-10","u","b","126"],["472","2024-07-11","u","b","126"],["474","2024-07-30","u","b","127"],["475","2024-08-01","u","b","127"],["476","2024-08-09","u","b","127"],["477","2024-08-16","u","b","127"],["478","2024-08-21","u","b","128"],["479","2024-08-31","u","b","128"],["480","2024-09-07","u","b","128"],["481","2024-09-14","u","b","128"],["482","2024-09-20","u","b","129"],["483","2024-09-27","u","b","129"],["484","2024-10-04","u","b","129"],["485","2024-10-11","u","b","129"],["486","2024-10-18","u","b","130"],["487","2024-10-26","u","b","130"],["488","2024-11-02","u","b","130"],["489","2024-11-09","u","b","130"],["494","2024-12-26","u","b","131"],["497","2025-01-26","u","b","132"],["503","2025-03-12","u","b","134"],["514","2025-05-28","u","b","136"],["515","2025-05-31","u","b","137"]]},instagram_android:{releases:[["23","u","u","b","62"],["24","u","u","b","62"],["25","u","u","b","62"],["26","u","u","b","63"],["27","u","u","b","63"],["28","u","u","b","63"],["29","u","u","b","63"],["30","u","u","b","63"],["31","u","u","b","64"],["32","u","u","b","64"],["33","u","u","b","64"],["34","u","u","b","64"],["35","u","u","b","65"],["36","u","u","b","65"],["37","u","u","b","65"],["38","u","u","b","65"],["39","u","u","b","65"],["40","u","u","b","65"],["41","u","u","b","65"],["42","u","u","b","66"],["43","u","u","b","66"],["44","u","u","b","66"],["45","u","u","b","66"],["46","u","u","b","66"],["47","u","u","b","66"],["48","u","u","b","67"],["49","u","u","b","67"],["50","u","u","b","67"],["51","u","u","b","67"],["52","u","u","b","67"],["53","u","u","b","67"],["54","u","u","b","67"],["55","u","u","b","67"],["56","u","u","b","68"],["57","u","u","b","68"],["58","u","u","b","68"],["59","u","u","b","68"],["60","u","u","b","68"],["61","u","u","b","68"],["65","u","u","b","69"],["66","u","u","b","69"],["68","u","u","b","69"],["72","u","u","b","70"],["74","u","u","b","71"],["75","u","u","b","71"],["79","u","u","b","71"],["81","u","u","b","72"],["82","u","u","b","72"],["83","u","u","b","72"],["84","u","u","b","73"],["86","u","u","b","73"],["95","u","u","b","74"],["96","u","u","b","80"],["97","u","u","b","80"],["98","u","u","b","80"],["103","u","u","b","80"],["104","u","u","b","80"],["117","u","u","b","80"],["118","u","u","b","80"],["119","u","u","b","80"],["120","u","u","b","80"],["121","u","u","b","80"],["127","u","u","b","80"],["128","u","u","b","80"],["129","u","u","b","80"],["130","u","u","b","80"],["131","u","u","b","80"],["132","u","u","b","80"],["133","u","u","b","80"],["134","u","u","b","80"],["135","u","u","b","80"],["136","u","u","b","80"],["137","u","u","b","81"],["138","u","u","b","81"],["139","u","u","b","81"],["140","u","u","b","81"],["141","u","u","b","81"],["142","u","u","b","81"],["143","u","u","b","83"],["144","u","u","b","83"],["145","u","u","b","83"],["146","u","u","b","83"],["153","u","u","b","84"],["163","u","u","b","92"],["164","u","u","b","92"],["230","u","u","b","92"],["258","2022-11-04","u","b","106"],["259","2022-11-04","u","b","106"],["279","2023-12-31","u","b","109"],["281","u","u","b","109"],["288","u","u","b","114"],["289","2023-12-21","u","b","114"],["290","2023-12-30","u","b","114"],["292","u","u","b","115"],["295","u","u","b","115"],["296","u","u","b","115"],["297","u","u","b","115"],["298","2024-01-11","u","b","115"],["299","u","u","b","115"],["300","u","u","b","116"],["301","2024-01-12","u","b","116"],["302","u","u","b","117"],["303","u","u","b","117"],["304","u","u","b","117"],["305","u","u","b","117"],["306","2024-01-17","u","b","118"],["307","u","u","b","118"],["308","2024-01-19","u","b","118"],["309","u","u","b","119"],["310","u","u","b","119"],["311","u","u","b","120"],["312","u","u","b","120"],["313","u","u","b","120"],["314","u","u","b","120"],["315","2024-01-19","u","b","120"],["316","2024-01-25","u","b","120"],["317","2024-02-03","u","b","121"],["318","2024-02-16","u","b","121"],["320","2024-03-04","u","b","121"],["321","2024-03-07","u","b","122"],["338","2024-07-06","u","b","126"],["346","2024-09-01","u","b","127"],["347","2024-09-11","u","b","127"],["349","2024-09-20","u","b","128"],["355","2024-11-06","u","b","130"],["366","u","u","b","132"],["367","2025-02-15","u","b","132"],["378","2025-05-03","u","b","135"],["381","2025-06-19","u","b","137"],["382","2025-06-19","u","b","137"],["383","2025-06-18","u","b","137"],["384","2025-06-16","u","b","137"],["385","2025-06-27","u","b","137"],["387","2025-07-09","u","b","137"],["390","2025-07-26","u","b","138"],["392","2025-08-12","u","b","138"],["394","2025-08-26","u","b","139"],["395","2025-09-13","u","b","139"],["396","2025-09-20","u","b","139"],["397","2025-09-19","u","b","139"],["399","2025-09-28","u","b","140"],["400","2025-10-06","u","b","141"],["401","2025-10-08","u","b","141"],["404","2025-10-31","u","b","141"],["406","2025-11-16","u","b","141"],["407","2025-11-23","u","b","142"],["408","2025-11-28","u","b","142"]]}},r=[["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"4",s:"4",si:"3.2"}],["2019-03-25",{c:"66",ca:"66",e:"16",f:"57",fa:"57",s:"12.1",si:"12.2"}],["2019-03-25",{c:"66",ca:"66",e:"16",f:"57",fa:"57",s:"12.1",si:"12.2"}],["2024-03-19",{c:"116",ca:"116",e:"116",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2025-06-26",{c:"138",ca:"138",e:"138",f:"118",fa:"118",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"17",ca:"18",e:"12",f:"5",fa:"5",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-04-16",{c:"123",ca:"123",e:"123",f:"125",fa:"125",s:"17.4",si:"17.4"}],["2020-01-15",{c:"37",ca:"37",e:"79",f:"27",fa:"27",s:"9.1",si:"9.3"}],["2024-07-09",{c:"77",ca:"77",e:"79",f:"128",fa:"128",s:"17.4",si:"17.4"}],["2016-06-07",{c:"32",ca:"30",e:"12",f:"47",fa:"47",s:"8",si:"8"}],["2023-07-04",{c:"112",ca:"112",e:"112",f:"115",fa:"115",s:"16",si:"16"}],["2015-09-30",{c:"43",ca:"43",e:"12",f:"16",fa:"16",s:"9",si:"9"}],["2022-03-14",{c:"84",ca:"84",e:"84",f:"80",fa:"80",s:"15.4",si:"15.4"}],["2023-10-24",{c:"103",ca:"103",e:"103",f:"119",fa:"119",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-03-14",{c:"92",ca:"92",e:"92",f:"90",fa:"90",s:"15.4",si:"15.4"}],["2023-07-04",{c:"110",ca:"110",e:"110",f:"115",fa:"115",s:"16",si:"16"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"34",fa:"34",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"37",fa:"37",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"37",fa:"37",s:"10",si:"10"}],["2022-08-23",{c:"97",ca:"97",e:"97",f:"104",fa:"104",s:"15.4",si:"15.4"}],["2020-01-15",{c:"69",ca:"69",e:"79",f:"62",fa:"62",s:"12",si:"12"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"38",fa:"38",s:"10",si:"10"}],["2024-01-25",{c:"121",ca:"121",e:"121",f:"115",fa:"115",s:"16.4",si:"16.4"}],["2024-03-05",{c:"117",ca:"117",e:"117",f:"119",fa:"119",s:"17.4",si:"17.4"}],["2016-09-20",{c:"47",ca:"47",e:"14",f:"43",fa:"43",s:"10",si:"10"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"5"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3",fa:"4",s:"4",si:"3.2"}],["2018-05-09",{c:"66",ca:"66",e:"14",f:"60",fa:"60",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"38",fa:"38",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2021-09-20",{c:"88",ca:"88",e:"88",f:"89",fa:"89",s:"15",si:"15"}],["2017-04-05",{c:"55",ca:"55",e:"15",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2024-06-11",{c:"76",ca:"76",e:"79",f:"127",fa:"127",s:"13.1",si:"13.4"}],["2020-01-15",{c:"63",ca:"63",e:"79",f:"57",fa:"57",s:"12",si:"12"}],["2020-01-15",{c:"63",ca:"63",e:"79",f:"57",fa:"57",s:"12",si:"12"}],["2025-04-01",{c:"133",ca:"133",e:"133",f:"137",fa:"137",s:"18.4",si:"18.4"}],["2025-11-11",{c:"90",ca:"90",e:"90",f:"145",fa:"145",s:"16.4",si:"16.4"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"3"}],["2021-04-26",{c:"66",ca:"66",e:"79",f:"76",fa:"79",s:"14.1",si:"14.5"}],["2023-02-09",{c:"110",ca:"110",e:"110",f:"86",fa:"86",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"4",si:"3.2"}],["2020-01-15",{c:"54",ca:"54",e:"79",f:"63",fa:"63",s:"10.1",si:"10.3"}],["2024-01-26",{c:"85",ca:"85",e:"121",f:"93",fa:"93",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-03-14",{c:"37",ca:"37",e:"79",f:"47",fa:"47",s:"15.4",si:"15.4"}],["2024-09-16",{c:"76",ca:"76",e:"79",f:"103",fa:"103",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.6",fa:"4",s:"1.3",si:"1"}],["2022-03-14",{c:"1",ca:"18",e:"12",f:"25",fa:"25",s:"15.4",si:"15.4"}],["2020-01-15",{c:"35",ca:"59",e:"79",f:"30",fa:"54",s:"8",si:"8"}],["2015-07-29",{c:"21",ca:"25",e:"12",f:"22",fa:"22",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.6",fa:"4",s:"1.3",si:"1"}],["2015-07-29",{c:"21",ca:"25",e:"12",f:"22",fa:"22",s:"5.1",si:"4"}],["2015-07-29",{c:"25",ca:"25",e:"12",f:"13",fa:"14",s:"7",si:"7"}],["2016-09-20",{c:"30",ca:"30",e:"12",f:"49",fa:"49",s:"8",si:"8"}],["2015-07-29",{c:"21",ca:"25",e:"12",f:"9",fa:"18",s:"5.1",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2016-09-20",{c:"30",ca:"30",e:"12",f:"4",fa:"4",s:"10",si:"10"}],["2020-01-15",{c:"16",ca:"18",e:"79",f:"10",fa:"10",s:"6",si:"6"}],["2015-07-29",{c:"≤15",ca:"18",e:"12",f:"10",fa:"10",s:"≤4",si:"≤3.2"}],["2018-04-12",{c:"39",ca:"42",e:"14",f:"31",fa:"31",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"3.2"}],["2020-09-16",{c:"67",ca:"67",e:"79",f:"68",fa:"68",s:"14",si:"14"}],["2021-09-20",{c:"67",ca:"67",e:"79",f:"68",fa:"68",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2017-02-01",{c:"56",ca:"56",e:"12",f:"50",fa:"50",s:"9.1",si:"9.3"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"14",s:"1",si:"3"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"5"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"29",fa:"29",s:"5.1",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2022-03-14",{c:"54",ca:"54",e:"79",f:"38",fa:"38",s:"15.4",si:"15.4"}],["2017-09-19",{c:"50",ca:"51",e:"15",f:"44",fa:"44",s:"11",si:"11"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"26",ca:"28",e:"12",f:"16",fa:"16",s:"7",si:"7"}],["2023-06-06",{c:"110",ca:"110",e:"110",f:"114",fa:"114",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"2",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"2",si:"1"}],["2024-09-16",{c:"99",ca:"99",e:"99",f:"28",fa:"28",s:"18",si:"18"}],["2023-04-11",{c:"99",ca:"99",e:"99",f:"112",fa:"112",s:"16.4",si:"16.4"}],["2023-12-11",{c:"99",ca:"99",e:"99",f:"113",fa:"113",s:"17.2",si:"17.2"}],["2023-04-11",{c:"99",ca:"99",e:"99",f:"112",fa:"112",s:"16.4",si:"16.4"}],["2023-12-11",{c:"118",ca:"118",e:"118",f:"97",fa:"97",s:"17.2",si:"17.2"}],["2020-01-15",{c:"51",ca:"51",e:"79",f:"43",fa:"43",s:"11",si:"11"}],["2020-01-15",{c:"57",ca:"57",e:"79",f:"53",fa:"53",s:"11.1",si:"11.3"}],["2022-03-14",{c:"99",ca:"99",e:"99",f:"97",fa:"97",s:"15.4",si:"15.4"}],["2020-01-15",{c:"49",ca:"49",e:"79",f:"47",fa:"47",s:"9",si:"9"}],["2015-07-29",{c:"27",ca:"27",e:"12",f:"1",fa:"4",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2015-09-22",{c:"4",ca:"18",e:"12",f:"41",fa:"41",s:"5",si:"4.2"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"4"}],["2024-03-05",{c:"105",ca:"105",e:"105",f:"106",fa:"106",s:"17.4",si:"17.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2016-03-08",{c:"42",ca:"42",e:"13",f:"45",fa:"45",s:"9",si:"9"}],["2023-09-18",{c:"117",ca:"117",e:"117",f:"63",fa:"63",s:"17",si:"17"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"71",fa:"79",s:"13.1",si:"13"}],["2020-01-15",{c:"55",ca:"55",e:"79",f:"49",fa:"49",s:"12.1",si:"12.2"}],["2023-11-02",{c:"119",ca:"119",e:"119",f:"54",fa:"54",s:"13.1",si:"13.4"}],["2017-03-27",{c:"41",ca:"41",e:"12",f:"22",fa:"22",s:"10.1",si:"10.3"}],["2025-03-31",{c:"121",ca:"121",e:"121",f:"127",fa:"127",s:"18.4",si:"18.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"15",si:"15"}],["2023-02-14",{c:"58",ca:"58",e:"79",f:"110",fa:"110",s:"10",si:"10"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"16.2",si:"16.2"}],["2022-02-03",{c:"98",ca:"98",e:"98",f:"96",fa:"96",s:"13",si:"13"}],["2020-01-15",{c:"53",ca:"53",e:"79",f:"31",fa:"31",s:"11.1",si:"11.3"}],["2017-03-07",{c:"50",ca:"50",e:"12",f:"52",fa:"52",s:"9",si:"9"}],["2020-07-28",{c:"50",ca:"50",e:"12",f:"71",fa:"79",s:"9",si:"9"}],["2025-08-19",{c:"137",ca:"137",e:"137",f:"142",fa:"142",s:"17",si:"17"}],["2017-04-19",{c:"26",ca:"26",e:"12",f:"53",fa:"53",s:"7",si:"7"}],["2023-05-09",{c:"80",ca:"80",e:"80",f:"113",fa:"113",s:"16.4",si:"16.4"}],["2020-11-17",{c:"69",ca:"69",e:"79",f:"83",fa:"83",s:"12.1",si:"12.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"4",fa:"4",s:"3",si:"1"}],["2018-12-11",{c:"40",ca:"40",e:"18",f:"51",fa:"64",s:"10.1",si:"10.3"}],["2023-03-27",{c:"73",ca:"73",e:"79",f:"101",fa:"101",s:"16.4",si:"16.4"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-09-12",{c:"105",ca:"105",e:"105",f:"101",fa:"101",s:"16",si:"16"}],["2023-09-18",{c:"83",ca:"83",e:"83",f:"107",fa:"107",s:"17",si:"17"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-03-14",{c:"52",ca:"52",e:"79",f:"69",fa:"79",s:"15.4",si:"15.4"}],["2022-07-26",{c:"52",ca:"52",e:"79",f:"103",fa:"103",s:"15.4",si:"15.4"}],["2023-02-14",{c:"105",ca:"105",e:"105",f:"110",fa:"110",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-09-15",{c:"108",ca:"108",e:"108",f:"130",fa:"130",s:"26",si:"26"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"4",fa:"4",s:"≤4",si:"≤3.2"}],["2025-03-04",{c:"51",ca:"51",e:"12",f:"136",fa:"136",s:"5.1",si:"5"}],["2024-09-16",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"3.2"}],["2023-12-11",{c:"85",ca:"85",e:"85",f:"68",fa:"68",s:"17.2",si:"17.2"}],["2023-09-18",{c:"91",ca:"91",e:"91",f:"33",fa:"33",s:"17",si:"17"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"25",s:"3",si:"1"}],["2023-12-11",{c:"59",ca:"59",e:"79",f:"98",fa:"98",s:"17.2",si:"17.2"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"60",fa:"60",s:"13",si:"13"}],["2016-08-02",{c:"25",ca:"25",e:"14",f:"23",fa:"23",s:"7",si:"7"}],["2020-01-15",{c:"46",ca:"46",e:"79",f:"31",fa:"31",s:"10.1",si:"10.3"}],["2015-09-30",{c:"28",ca:"28",e:"12",f:"22",fa:"22",s:"9",si:"9"}],["2020-01-15",{c:"61",ca:"61",e:"79",f:"55",fa:"55",s:"11",si:"11"}],["2015-07-29",{c:"16",ca:"18",e:"12",f:"4",fa:"4",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"3.2"}],["2017-04-05",{c:"49",ca:"49",e:"15",f:"31",fa:"31",s:"9.1",si:"9.3"}],["2017-10-24",{c:"62",ca:"62",e:"14",f:"22",fa:"22",s:"10",si:"10"}],["2015-07-29",{c:"≤4",ca:"18",e:"12",f:"≤2",fa:"4",s:"≤3.1",si:"≤2"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"6",fa:"6",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-02-20",{c:"111",ca:"111",e:"111",f:"123",fa:"123",s:"16.4",si:"16.4"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"4",si:"5"}],["2020-01-15",{c:"10",ca:"18",e:"79",f:"4",fa:"4",s:"5",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"55",fa:"55",s:"11.1",si:"11.3"}],["2020-01-15",{c:"12",ca:"18",e:"79",f:"49",fa:"49",s:"6",si:"6"}],["2025-09-16",{c:"131",ca:"131",e:"131",f:"143",fa:"143",s:"18.4",si:"18.4"}],["2024-09-03",{c:"120",ca:"120",e:"120",f:"130",fa:"130",s:"17.2",si:"17.2"}],["2023-09-18",{c:"31",ca:"31",e:"12",f:"6",fa:"6",s:"17",si:"4.2"}],["2015-07-29",{c:"15",ca:"18",e:"12",f:"1",fa:"4",s:"6",si:"6"}],["2022-03-14",{c:"37",ca:"37",e:"79",f:"98",fa:"98",s:"15.4",si:"15.4"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"49",fa:"49",s:"16.4",si:"16.4"}],["2023-08-01",{c:"17",ca:"18",e:"79",f:"116",fa:"116",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"58",ca:"58",e:"79",f:"53",fa:"53",s:"13",si:"13"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["≤2017-04-05",{c:"1",ca:"18",e:"≤15",f:"3",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"61",ca:"61",e:"79",f:"33",fa:"33",s:"11",si:"11"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"1",fa:"4",s:"4",si:"3.2"}],["2016-03-21",{c:"31",ca:"31",e:"12",f:"12",fa:"14",s:"9.1",si:"9.3"}],["2019-09-19",{c:"14",ca:"18",e:"18",f:"20",fa:"20",s:"10.1",si:"13"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"3.2"}],["2022-05-03",{c:"98",ca:"98",e:"98",f:"100",fa:"100",s:"13.1",si:"13.4"}],["2020-01-15",{c:"43",ca:"43",e:"79",f:"46",fa:"46",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"1.5",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2019-03-25",{c:"42",ca:"42",e:"13",f:"38",fa:"38",s:"12.1",si:"12.2"}],["2021-11-02",{c:"77",ca:"77",e:"79",f:"94",fa:"94",s:"13.1",si:"13.4"}],["2021-09-20",{c:"93",ca:"93",e:"93",f:"91",fa:"91",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"118",fa:"118",s:"15.4",si:"15.4"}],["2017-03-27",{c:"52",ca:"52",e:"14",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2018-04-30",{c:"38",ca:"38",e:"17",f:"47",fa:"35",s:"9",si:"9"}],["2021-09-20",{c:"56",ca:"56",e:"79",f:"51",fa:"51",s:"15",si:"15"}],["2020-09-16",{c:"63",ca:"63",e:"17",f:"47",fa:"36",s:"14",si:"14"}],["2020-02-07",{c:"40",ca:"40",e:"80",f:"58",fa:"28",s:"9",si:"9"}],["2016-06-07",{c:"34",ca:"34",e:"12",f:"47",fa:"47",s:"9.1",si:"9.3"}],["2017-03-27",{c:"42",ca:"42",e:"14",f:"39",fa:"39",s:"10.1",si:"10.3"}],["2024-10-29",{c:"103",ca:"103",e:"103",f:"132",fa:"132",s:"17.2",si:"17.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"8",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"5"}],["2020-01-15",{c:"38",ca:"38",e:"79",f:"28",fa:"28",s:"10.1",si:"10.3"}],["2021-04-26",{c:"89",ca:"89",e:"89",f:"82",fa:"82",s:"14.1",si:"14.5"}],["2016-09-07",{c:"53",ca:"53",e:"12",f:"35",fa:"35",s:"9.1",si:"9.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-11-02",{c:"46",ca:"46",e:"79",f:"94",fa:"94",s:"11",si:"11"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-09-30",{c:"29",ca:"29",e:"12",f:"20",fa:"20",s:"9",si:"9"}],["2021-04-26",{c:"84",ca:"84",e:"84",f:"63",fa:"63",s:"14.1",si:"14.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-04-04",{c:"135",ca:"135",e:"135",f:"129",fa:"129",s:"18.2",si:"18.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"24",fa:"24",s:"3.1",si:"2"}],["2022-03-14",{c:"86",ca:"86",e:"86",f:"85",fa:"85",s:"15.4",si:"15.4"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"58",fa:"58",s:"11.1",si:"11.3"}],["2016-09-20",{c:"36",ca:"36",e:"14",f:"39",fa:"39",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-09-07",{c:"56",ca:"56",e:"79",f:"92",fa:"92",s:"11",si:"11"}],["2017-04-05",{c:"48",ca:"48",e:"15",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"33",ca:"33",e:"79",f:"32",fa:"32",s:"9",si:"9"}],["2020-01-15",{c:"35",ca:"35",e:"79",f:"41",fa:"41",s:"10",si:"10"}],["2020-03-24",{c:"79",ca:"79",e:"17",f:"62",fa:"62",s:"13.1",si:"13.4"}],["2022-11-15",{c:"101",ca:"101",e:"101",f:"107",fa:"107",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-07-25",{c:"127",ca:"127",e:"127",f:"118",fa:"118",s:"17",si:"17"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-01-06",{c:"97",ca:"97",e:"97",f:"34",fa:"34",s:"9",si:"9"}],["2023-03-27",{c:"97",ca:"97",e:"97",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2023-03-27",{c:"97",ca:"97",e:"97",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2023-03-27",{c:"97",ca:"97",e:"97",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-03-13",{c:"111",ca:"111",e:"111",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"52",ca:"52",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"63",ca:"63",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"34",ca:"34",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2020-01-15",{c:"52",ca:"52",e:"79",f:"34",fa:"34",s:"9.1",si:"9.3"}],["2018-09-05",{c:"62",ca:"62",e:"17",f:"62",fa:"62",s:"11",si:"11"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-09-12",{c:"89",ca:"89",e:"79",f:"89",fa:"89",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2023-03-27",{c:"77",ca:"77",e:"79",f:"98",fa:"98",s:"16.4",si:"16.4"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-27",{c:"35",ca:"35",e:"12",f:"29",fa:"32",s:"10.1",si:"10.3"}],["2016-09-20",{c:"39",ca:"39",e:"13",f:"26",fa:"26",s:"10",si:"10"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"3.5",fa:"4",s:"5",si:"≤3"}],["2015-07-29",{c:"11",ca:"18",e:"12",f:"3.5",fa:"4",s:"5.1",si:"5"}],["2024-09-16",{c:"125",ca:"125",e:"125",f:"128",fa:"128",s:"18",si:"18"}],["2020-01-15",{c:"71",ca:"71",e:"79",f:"65",fa:"65",s:"12.1",si:"12.2"}],["2024-06-11",{c:"111",ca:"111",e:"111",f:"127",fa:"127",s:"16.2",si:"16.2"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"3.6",fa:"4",s:"7",si:"7"}],["2017-10-17",{c:"57",ca:"57",e:"16",f:"52",fa:"52",s:"10.1",si:"10.3"}],["2022-10-27",{c:"107",ca:"107",e:"107",f:"66",fa:"66",s:"16",si:"16"}],["2022-03-14",{c:"37",ca:"37",e:"15",f:"48",fa:"48",s:"15.4",si:"15.4"}],["2023-12-19",{c:"105",ca:"105",e:"105",f:"121",fa:"121",s:"15.4",si:"15.4"}],["2020-03-24",{c:"74",ca:"74",e:"79",f:"67",fa:"67",s:"13.1",si:"13.4"}],["2015-07-29",{c:"16",ca:"18",e:"12",f:"11",fa:"14",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4"}],["2020-01-15",{c:"54",ca:"54",e:"79",f:"63",fa:"63",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2020-01-15",{c:"65",ca:"65",e:"79",f:"52",fa:"52",s:"12.1",si:"12.2"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"4",fa:"4",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"36",fa:"36",s:"9",si:"9"}],["2024-09-16",{c:"87",ca:"87",e:"87",f:"88",fa:"88",s:"18",si:"18"}],["2022-04-28",{c:"101",ca:"101",e:"101",f:"96",fa:"96",s:"15",si:"15"}],["2023-09-18",{c:"106",ca:"106",e:"106",f:"98",fa:"98",s:"17",si:"17"}],["2023-09-18",{c:"88",ca:"55",e:"88",f:"43",fa:"43",s:"17",si:"17"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-10-03",{c:"106",ca:"106",e:"106",f:"97",fa:"97",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"17",fa:"17",s:"5",si:"4"}],["2020-01-15",{c:"20",ca:"25",e:"79",f:"25",fa:"25",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-04-13",{c:"81",ca:"81",e:"81",f:"26",fa:"26",s:"13.1",si:"13.4"}],["2021-10-05",{c:"41",ca:"41",e:"79",f:"93",fa:"93",s:"10",si:"10"}],["2023-09-18",{c:"113",ca:"113",e:"113",f:"89",fa:"89",s:"17",si:"17"}],["2020-01-15",{c:"66",ca:"66",e:"79",f:"50",fa:"50",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-03-27",{c:"89",ca:"89",e:"89",f:"108",fa:"108",s:"16.4",si:"16.4"}],["2020-01-15",{c:"39",ca:"39",e:"79",f:"51",fa:"51",s:"10",si:"10"}],["2021-09-20",{c:"58",ca:"58",e:"79",f:"51",fa:"51",s:"15",si:"15"}],["2022-08-05",{c:"104",ca:"104",e:"104",f:"72",fa:"79",s:"14.1",si:"14.5"}],["2023-04-11",{c:"102",ca:"102",e:"102",f:"112",fa:"112",s:"15.5",si:"15.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-11-12",{c:"1",ca:"18",e:"13",f:"19",fa:"19",s:"1.2",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.6",fa:"4",s:"3",si:"1"}],["2021-04-26",{c:"20",ca:"25",e:"12",f:"57",fa:"57",s:"14.1",si:"5"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"3"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"6",fa:"6",s:"3.1",si:"2"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3",fa:"4",s:"4",si:"3"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3.6",fa:"4",s:"4",si:"3.2"}],["2025-08-19",{c:"13",ca:"132",e:"13",f:"50",fa:"142",s:"11.1",si:"18.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"29",fa:"29",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-16",{c:"4",ca:"57",e:"12",f:"23",fa:"52",s:"3.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-12-07",{c:"66",ca:"66",e:"79",f:"95",fa:"79",s:"12.1",si:"12.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2018-12-11",{c:"41",ca:"41",e:"12",f:"64",fa:"64",s:"9",si:"9"}],["2019-03-25",{c:"58",ca:"58",e:"16",f:"55",fa:"55",s:"12.1",si:"12.2"}],["2017-09-28",{c:"24",ca:"25",e:"12",f:"29",fa:"56",s:"10",si:"10"}],["2021-04-26",{c:"81",ca:"81",e:"81",f:"86",fa:"86",s:"14.1",si:"14.5"}],["2025-03-04",{c:"129",ca:"129",e:"129",f:"136",fa:"136",s:"16.4",si:"16.4"}],["2021-04-26",{c:"72",ca:"72",e:"79",f:"78",fa:"79",s:"14.1",si:"14.5"}],["2020-09-16",{c:"74",ca:"74",e:"79",f:"75",fa:"79",s:"14",si:"14"}],["2019-09-19",{c:"63",ca:"63",e:"18",f:"58",fa:"58",s:"13",si:"13"}],["2020-09-16",{c:"71",ca:"71",e:"79",f:"76",fa:"79",s:"14",si:"14"}],["2024-04-16",{c:"87",ca:"87",e:"87",f:"125",fa:"125",s:"14.1",si:"14.5"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"82",fa:"82",s:"14",si:"14"}],["2018-04-12",{c:"55",ca:"55",e:"15",f:"52",fa:"52",s:"11.1",si:"11.3"}],["2020-01-15",{c:"41",ca:"41",e:"79",f:"36",fa:"36",s:"8",si:"8"}],["2025-03-31",{c:"122",ca:"122",e:"122",f:"131",fa:"131",s:"18.4",si:"18.4"}],["2015-07-29",{c:"38",ca:"38",e:"12",f:"13",fa:"14",s:"7",si:"7"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"1",fa:"4",s:"5",si:"4.2"}],["2018-05-09",{c:"61",ca:"61",e:"16",f:"60",fa:"60",s:"11",si:"11"}],["2023-06-06",{c:"80",ca:"80",e:"80",f:"114",fa:"114",s:"15",si:"15"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"4"}],["2025-04-29",{c:"123",ca:"123",e:"123",f:"138",fa:"138",s:"17.2",si:"17.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"6",fa:"6",s:"1.2",si:"1"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"48",ca:"48",e:"79",f:"50",fa:"50",s:"11",si:"11"}],["2016-09-20",{c:"49",ca:"49",e:"14",f:"44",fa:"44",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-11-21",{c:"109",ca:"109",e:"109",f:"120",fa:"120",s:"16.4",si:"16.4"}],["2024-05-13",{c:"123",ca:"123",e:"123",f:"120",fa:"120",s:"17.5",si:"17.5"}],["2020-07-28",{c:"83",ca:"83",e:"83",f:"69",fa:"79",s:"13",si:"13"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-11",{c:"113",ca:"113",e:"113",f:"112",fa:"112",s:"17.2",si:"17.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2025-09-15",{c:"46",ca:"46",e:"79",f:"127",fa:"127",s:"5",si:"26"}],["2020-01-15",{c:"46",ca:"46",e:"79",f:"39",fa:"39",s:"11.1",si:"11.3"}],["2021-01-26",{c:"50",ca:"50",e:"79",f:"85",fa:"85",s:"11.1",si:"11.3"}],["2020-01-15",{c:"65",ca:"65",e:"79",f:"50",fa:"50",s:"9",si:"9"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-19",{c:"77",ca:"77",e:"79",f:"121",fa:"121",s:"16.4",si:"16.4"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"6",s:"4",si:"3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-09-16",{c:"85",ca:"85",e:"85",f:"79",fa:"79",s:"14",si:"14"}],["2021-09-20",{c:"89",ca:"89",e:"89",f:"66",fa:"66",s:"15",si:"15"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"21",fa:"21",s:"7",si:"7"}],["2015-07-29",{c:"38",ca:"38",e:"12",f:"13",fa:"14",s:"8",si:"8"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"5"}],["2020-01-15",{c:"24",ca:"25",e:"79",f:"35",fa:"35",s:"7",si:"7"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"53",fa:"53",s:"15.4",si:"15.4"}],["2015-07-29",{c:"9",ca:"18",e:"12",f:"6",fa:"6",s:"5.1",si:"5"}],["2023-01-12",{c:"109",ca:"109",e:"109",f:"4",fa:"4",s:"5.1",si:"5"}],["2022-04-28",{c:"101",ca:"101",e:"101",f:"63",fa:"63",s:"15.4",si:"15.4"}],["2017-09-19",{c:"53",ca:"53",e:"12",f:"36",fa:"36",s:"11",si:"11"}],["2020-02-04",{c:"80",ca:"80",e:"12",f:"42",fa:"42",s:"8",si:"12.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2023-03-27",{c:"104",ca:"104",e:"104",f:"102",fa:"102",s:"16.4",si:"16.4"}],["2021-04-26",{c:"49",ca:"49",e:"79",f:"25",fa:"25",s:"14.1",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2023-03-27",{c:"60",ca:"60",e:"18",f:"57",fa:"57",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2018-10-02",{c:"6",ca:"18",e:"18",f:"56",fa:"56",s:"6",si:"10.3"}],["2020-07-28",{c:"79",ca:"79",e:"79",f:"75",fa:"79",s:"13.1",si:"13.4"}],["2020-01-15",{c:"46",ca:"46",e:"79",f:"66",fa:"66",s:"11",si:"11"}],["2015-07-29",{c:"18",ca:"18",e:"12",f:"1",fa:"4",s:"1.3",si:"1"}],["2020-01-15",{c:"41",ca:"41",e:"79",f:"32",fa:"32",s:"8",si:"8"}],["2020-01-15",{c:"≤79",ca:"≤79",e:"79",f:"≤23",fa:"≤23",s:"≤9.1",si:"≤9.3"}],["2022-09-02",{c:"105",ca:"105",e:"105",f:"103",fa:"103",s:"15.6",si:"15.6"}],["2023-09-18",{c:"66",ca:"66",e:"79",f:"115",fa:"115",s:"17",si:"17"}],["2022-09-12",{c:"55",ca:"55",e:"79",f:"72",fa:"79",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-07",{c:"50",ca:"50",e:"12",f:"52",fa:"52",s:"9",si:"9"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"14",fa:"14",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2021-10-25",{c:"57",ca:"57",e:"12",f:"58",fa:"58",s:"15",si:"15.1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-12-11",{c:"120",ca:"120",e:"120",f:"117",fa:"117",s:"17.2",si:"17.2"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"84",fa:"84",s:"9",si:"9"}],["2023-03-27",{c:"20",ca:"42",e:"14",f:"22",fa:"22",s:"7",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"2"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"9",si:"9"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"2"}],["2020-09-16",{c:"85",ca:"85",e:"85",f:"79",fa:"79",s:"14",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-07-28",{c:"75",ca:"75",e:"79",f:"70",fa:"79",s:"13",si:"13"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2020-01-15",{c:"32",ca:"32",e:"79",f:"36",fa:"36",s:"10",si:"10"}],["2022-03-14",{c:"93",ca:"93",e:"93",f:"92",fa:"92",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"32",ca:"32",e:"79",f:"36",fa:"36",s:"10",si:"10"}],["2015-07-29",{c:"24",ca:"25",e:"12",f:"24",fa:"24",s:"8",si:"8"}],["2021-04-26",{c:"80",ca:"80",e:"80",f:"71",fa:"79",s:"14.1",si:"14.5"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"10",fa:"10",s:"8",si:"8"}],["2015-07-29",{c:"10",ca:"18",e:"12",f:"6",fa:"6",s:"8",si:"8"}],["2015-07-29",{c:"29",ca:"29",e:"12",f:"24",fa:"24",s:"8",si:"8"}],["2016-08-02",{c:"27",ca:"27",e:"14",f:"29",fa:"29",s:"8",si:"8"}],["2018-04-30",{c:"24",ca:"25",e:"17",f:"25",fa:"25",s:"8",si:"9"}],["2021-04-26",{c:"35",ca:"35",e:"12",f:"25",fa:"25",s:"14.1",si:"14.5"}],["2023-03-27",{c:"69",ca:"69",e:"79",f:"105",fa:"105",s:"16.4",si:"16.4"}],["2023-05-09",{c:"111",ca:"111",e:"111",f:"113",fa:"113",s:"15.4",si:"15.4"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"1.5",fa:"4",s:"4",si:"3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"2",si:"1"}],["≤2020-03-24",{c:"≤80",ca:"≤80",e:"≤80",f:"1.5",fa:"4",s:"≤13.1",si:"≤13.4"}],["2020-01-15",{c:"66",ca:"66",e:"79",f:"58",fa:"58",s:"11.1",si:"11.3"}],["2023-03-27",{c:"108",ca:"109",e:"108",f:"111",fa:"111",s:"16.4",si:"16.4"}],["2023-03-27",{c:"94",ca:"94",e:"94",f:"88",fa:"88",s:"16.4",si:"16.4"}],["2017-04-05",{c:"1",ca:"18",e:"15",f:"1.5",fa:"4",s:"1.2",si:"1"}],["≤2018-10-02",{c:"10",ca:"18",e:"≤18",f:"4",fa:"4",s:"7",si:"7"}],["2023-09-18",{c:"113",ca:"113",e:"113",f:"66",fa:"66",s:"17",si:"17"}],["2022-09-12",{c:"90",ca:"90",e:"90",f:"81",fa:"81",s:"16",si:"16"}],["2020-03-24",{c:"68",ca:"68",e:"79",f:"61",fa:"61",s:"13.1",si:"13.4"}],["2018-10-02",{c:"23",ca:"25",e:"18",f:"49",fa:"49",s:"7",si:"7"}],["2022-09-12",{c:"63",ca:"63",e:"18",f:"59",fa:"59",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2019-01-29",{c:"50",ca:"50",e:"12",f:"65",fa:"65",s:"10",si:"10"}],["2024-12-11",{c:"15",ca:"18",e:"79",f:"95",fa:"95",s:"18.2",si:"18.2"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"1.5",fa:"4",s:"5",si:"4"}],["2015-07-29",{c:"33",ca:"33",e:"12",f:"18",fa:"18",s:"7",si:"7"}],["2021-04-26",{c:"60",ca:"60",e:"79",f:"84",fa:"84",s:"14.1",si:"14.5"}],["2025-09-15",{c:"124",ca:"124",e:"124",f:"128",fa:"128",s:"26",si:"26"}],["2023-03-27",{c:"94",ca:"94",e:"94",f:"99",fa:"99",s:"16.4",si:"16.4"}],["2015-09-16",{c:"6",ca:"18",e:"12",f:"7",fa:"7",s:"8",si:"9"}],["2022-09-12",{c:"44",ca:"44",e:"79",f:"46",fa:"46",s:"16",si:"16"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2016-03-21",{c:"38",ca:"38",e:"13",f:"38",fa:"38",s:"9.1",si:"9.3"}],["2020-01-15",{c:"57",ca:"57",e:"79",f:"51",fa:"51",s:"10.1",si:"10.3"}],["2020-01-15",{c:"47",ca:"47",e:"79",f:"51",fa:"51",s:"9",si:"9"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3.6",fa:"4",s:"4",si:"3.2"}],["2020-07-28",{c:"55",ca:"55",e:"12",f:"59",fa:"79",s:"13",si:"13"}],["2025-01-27",{c:"116",ca:"116",e:"116",f:"125",fa:"125",s:"17",si:"18.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3",fa:"4",s:"4",si:"3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"76",ca:"76",e:"79",f:"67",fa:"67",s:"12.1",si:"13"}],["2022-05-31",{c:"96",ca:"96",e:"96",f:"101",fa:"101",s:"14.1",si:"14.5"}],["2020-01-15",{c:"74",ca:"74",e:"79",f:"63",fa:"64",s:"10.1",si:"10.3"}],["2023-12-11",{c:"73",ca:"73",e:"79",f:"78",fa:"79",s:"17.2",si:"17.2"}],["2023-12-11",{c:"86",ca:"86",e:"86",f:"101",fa:"101",s:"17.2",si:"17.2"}],["2023-06-06",{c:"1",ca:"18",e:"12",f:"1",fa:"114",s:"1.1",si:"1"}],["2025-05-01",{c:"136",ca:"136",e:"136",f:"97",fa:"97",s:"15.4",si:"15.4"}],["2019-09-19",{c:"63",ca:"63",e:"12",f:"6",fa:"6",s:"13",si:"13"}],["2015-07-29",{c:"6",ca:"18",e:"12",f:"6",fa:"6",s:"6",si:"7"}],["2015-07-29",{c:"32",ca:"32",e:"12",f:"29",fa:"29",s:"8",si:"8"}],["2020-07-28",{c:"76",ca:"76",e:"79",f:"71",fa:"79",s:"13",si:"13"}],["2020-09-16",{c:"85",ca:"85",e:"85",f:"79",fa:"79",s:"14",si:"14"}],["2018-10-02",{c:"63",ca:"63",e:"18",f:"58",fa:"58",s:"11.1",si:"11.3"}],["2025-01-07",{c:"128",ca:"128",e:"128",f:"134",fa:"134",s:"18.2",si:"18.2"}],["2024-03-05",{c:"119",ca:"119",e:"119",f:"121",fa:"121",s:"17.4",si:"17.4"}],["2016-09-20",{c:"49",ca:"49",e:"12",f:"18",fa:"18",s:"10",si:"10"}],["2023-03-27",{c:"50",ca:"50",e:"17",f:"44",fa:"48",s:"16",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2020-03-24",{c:"63",ca:"63",e:"79",f:"49",fa:"49",s:"13.1",si:"13.4"}],["2020-07-28",{c:"71",ca:"71",e:"79",f:"69",fa:"79",s:"12.1",si:"12.2"}],["2021-04-26",{c:"87",ca:"87",e:"87",f:"70",fa:"79",s:"14.1",si:"14.5"}],["2020-07-28",{c:"1",ca:"18",e:"13",f:"78",fa:"79",s:"4",si:"3.2"}],["2024-01-23",{c:"119",ca:"119",e:"119",f:"122",fa:"122",s:"17.2",si:"17.2"}],["2021-09-20",{c:"85",ca:"85",e:"85",f:"87",fa:"87",s:"15",si:"15"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-05-01",{c:"136",ca:"136",e:"136",f:"134",fa:"134",s:"18.2",si:"18.2"}],["2024-07-09",{c:"85",ca:"85",e:"85",f:"128",fa:"128",s:"16.4",si:"16.4"}],["2024-09-16",{c:"125",ca:"125",e:"125",f:"128",fa:"128",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.6",fa:"4",s:"5",si:"4"}],["2015-07-29",{c:"24",ca:"25",e:"12",f:"23",fa:"23",s:"7",si:"7"}],["2023-03-27",{c:"69",ca:"69",e:"79",f:"99",fa:"99",s:"16.4",si:"16.4"}],["2024-10-29",{c:"83",ca:"83",e:"83",f:"132",fa:"132",s:"15.4",si:"15.4"}],["2025-05-27",{c:"134",ca:"134",e:"134",f:"139",fa:"139",s:"18.4",si:"18.4"}],["2024-07-09",{c:"111",ca:"111",e:"111",f:"128",fa:"128",s:"16.4",si:"16.4"}],["2020-07-28",{c:"64",ca:"64",e:"79",f:"69",fa:"79",s:"13.1",si:"13.4"}],["2022-09-12",{c:"68",ca:"68",e:"79",f:"62",fa:"62",s:"16",si:"16"}],["2018-10-23",{c:"1",ca:"18",e:"12",f:"63",fa:"63",s:"3",si:"1"}],["2023-03-27",{c:"54",ca:"54",e:"17",f:"45",fa:"45",s:"16.4",si:"16.4"}],["2017-09-19",{c:"29",ca:"29",e:"12",f:"35",fa:"35",s:"11",si:"11"}],["2020-07-27",{c:"84",ca:"84",e:"84",f:"67",fa:"67",s:"9.1",si:"9.3"}],["2020-01-15",{c:"65",ca:"65",e:"79",f:"52",fa:"52",s:"12.1",si:"12.2"}],["2023-11-21",{c:"111",ca:"111",e:"111",f:"120",fa:"120",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-05-17",{c:"125",ca:"125",e:"125",f:"118",fa:"118",s:"17.2",si:"17.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"38",fa:"38",s:"5",si:"4.2"}],["2024-12-11",{c:"128",ca:"128",e:"128",f:"38",fa:"38",s:"18.2",si:"18.2"}],["2024-12-11",{c:"84",ca:"84",e:"84",f:"38",fa:"38",s:"18.2",si:"18.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"69",ca:"69",e:"79",f:"65",fa:"65",s:"11.1",si:"11.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"27",ca:"27",e:"79",f:"32",fa:"32",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2023-03-27",{c:"38",ca:"39",e:"79",f:"43",fa:"43",s:"16.4",si:"16.4"}],["2025-03-31",{c:"84",ca:"84",e:"84",f:"126",fa:"126",s:"16.4",si:"18.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"2"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"113",fa:"113",s:"17",si:"17"}],["2022-03-14",{c:"61",ca:"61",e:"79",f:"36",fa:"36",s:"15.4",si:"15.4"}],["2020-09-16",{c:"61",ca:"61",e:"79",f:"36",fa:"36",s:"14",si:"14"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"1",fa:"4",s:"3",si:"1"}],["2020-01-15",{c:"69",ca:"69",e:"79",f:"68",fa:"68",s:"11",si:"11"}],["2024-10-01",{c:"80",ca:"80",e:"80",f:"131",fa:"131",s:"16.1",si:"16.1"}],["2024-12-11",{c:"94",ca:"94",e:"94",f:"97",fa:"97",s:"18.2",si:"18.2"}],["2024-12-11",{c:"121",ca:"121",e:"121",f:"64",fa:"64",s:"18.2",si:"18.2"}],["2023-10-13",{c:"118",ca:"118",e:"118",f:"118",fa:"118",s:"17",si:"17"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"4",fa:"4",s:"5",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-07",{c:"11",ca:"18",e:"12",f:"52",fa:"52",s:"5.1",si:"5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2020-01-15",{c:"6",ca:"18",e:"79",f:"6",fa:"45",s:"5",si:"5"}],["2023-03-27",{c:"65",ca:"65",e:"79",f:"61",fa:"61",s:"16.4",si:"16.4"}],["2018-04-30",{c:"45",ca:"45",e:"17",f:"44",fa:"44",s:"11.1",si:"11.3"}],["2015-07-29",{c:"38",ca:"38",e:"12",f:"13",fa:"14",s:"8",si:"8"}],["2024-06-11",{c:"122",ca:"122",e:"122",f:"127",fa:"127",s:"17",si:"17"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"5"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"5"}],["2020-01-15",{c:"53",ca:"53",e:"79",f:"63",fa:"63",s:"10",si:"10"}],["2020-07-28",{c:"73",ca:"73",e:"79",f:"72",fa:"79",s:"13.1",si:"13.4"}],["2020-01-15",{c:"37",ca:"37",e:"79",f:"62",fa:"62",s:"10.1",si:"10.3"}],["2020-01-15",{c:"37",ca:"37",e:"79",f:"54",fa:"54",s:"10.1",si:"10.3"}],["2021-12-13",{c:"68",ca:"89",e:"79",f:"79",fa:"79",s:"15.2",si:"15.2"}],["2020-01-15",{c:"53",ca:"53",e:"79",f:"63",fa:"63",s:"10",si:"10"}],["2023-03-27",{c:"92",ca:"92",e:"92",f:"92",fa:"92",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2020-01-15",{c:"19",ca:"25",e:"79",f:"4",fa:"4",s:"6",si:"6"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"2"}],["2020-01-15",{c:"18",ca:"18",e:"79",f:"55",fa:"55",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2018-09-05",{c:"33",ca:"33",e:"14",f:"49",fa:"62",s:"7",si:"7"}],["2017-11-28",{c:"9",ca:"47",e:"12",f:"2",fa:"57",s:"5.1",si:"5"}],["2020-01-15",{c:"60",ca:"60",e:"79",f:"55",fa:"55",s:"11.1",si:"11.3"}],["2017-03-27",{c:"38",ca:"38",e:"13",f:"38",fa:"38",s:"10.1",si:"10.3"}],["2020-01-15",{c:"70",ca:"70",e:"79",f:"3",fa:"4",s:"10.1",si:"10.3"}],["2024-08-06",{c:"117",ca:"117",e:"117",f:"129",fa:"129",s:"17.5",si:"17.5"}],["2024-05-17",{c:"125",ca:"125",e:"125",f:"126",fa:"126",s:"17.4",si:"17.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-09-16",{c:"77",ca:"77",e:"79",f:"65",fa:"65",s:"14",si:"14"}],["2019-09-19",{c:"56",ca:"56",e:"16",f:"59",fa:"59",s:"13",si:"13"}],["2023-12-05",{c:"119",ca:"120",e:"85",f:"65",fa:"65",s:"11.1",si:"11.3"}],["2023-09-18",{c:"61",ca:"61",e:"79",f:"57",fa:"57",s:"17",si:"17"}],["2022-06-28",{c:"67",ca:"67",e:"79",f:"102",fa:"102",s:"14.1",si:"14.5"}],["2022-03-14",{c:"92",ca:"92",e:"92",f:"90",fa:"90",s:"15.4",si:"15.4"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"29",fa:"29",s:"9",si:"9"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"40",fa:"40",s:"9",si:"9"}],["2020-01-15",{c:"73",ca:"73",e:"79",f:"67",fa:"67",s:"13",si:"13"}],["2016-09-20",{c:"34",ca:"34",e:"12",f:"31",fa:"31",s:"10",si:"10"}],["2017-04-05",{c:"57",ca:"57",e:"15",f:"48",fa:"48",s:"10",si:"10"}],["2015-09-30",{c:"41",ca:"41",e:"12",f:"34",fa:"34",s:"9",si:"9"}],["2015-09-30",{c:"41",ca:"36",e:"12",f:"24",fa:"24",s:"9",si:"9"}],["2020-08-27",{c:"85",ca:"85",e:"85",f:"77",fa:"79",s:"13.1",si:"13.4"}],["2015-09-30",{c:"41",ca:"36",e:"12",f:"17",fa:"17",s:"9",si:"9"}],["2020-01-15",{c:"66",ca:"66",e:"79",f:"61",fa:"61",s:"12",si:"12"}],["2023-10-24",{c:"111",ca:"111",e:"111",f:"119",fa:"119",s:"16.4",si:"16.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2022-03-14",{c:"98",ca:"98",e:"98",f:"94",fa:"94",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2023-09-15",{c:"117",ca:"117",e:"117",f:"71",fa:"79",s:"16",si:"16"}],["2015-09-30",{c:"28",ca:"28",e:"12",f:"22",fa:"22",s:"9",si:"9"}],["2016-09-20",{c:"2",ca:"18",e:"12",f:"49",fa:"49",s:"4",si:"3.2"}],["2020-01-15",{c:"1",ca:"18",e:"79",f:"3",fa:"4",s:"3",si:"2"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"3",fa:"4",s:"6",si:"6"}],["2015-09-30",{c:"38",ca:"38",e:"12",f:"36",fa:"36",s:"9",si:"9"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2021-08-10",{c:"42",ca:"42",e:"79",f:"91",fa:"91",s:"13.1",si:"13.4"}],["2018-10-02",{c:"1",ca:"18",e:"18",f:"1.5",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1.3",si:"2"}],["2024-12-11",{c:"89",ca:"89",e:"89",f:"131",fa:"131",s:"18.2",si:"18.2"}],["2015-11-12",{c:"26",ca:"26",e:"13",f:"22",fa:"22",s:"8",si:"8"}],["2020-01-15",{c:"62",ca:"62",e:"79",f:"53",fa:"53",s:"11",si:"11"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-09-12",{c:"47",ca:"47",e:"12",f:"49",fa:"49",s:"16",si:"16"}],["2022-03-14",{c:"48",ca:"48",e:"79",f:"48",fa:"48",s:"15.4",si:"15.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2022-03-03",{c:"99",ca:"99",e:"99",f:"46",fa:"46",s:"7",si:"7"}],["2020-01-15",{c:"38",ca:"38",e:"79",f:"19",fa:"19",s:"10.1",si:"10.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-09-16",{c:"48",ca:"48",e:"79",f:"41",fa:"41",s:"14",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"7",fa:"7",s:"1.3",si:"1"}],["2015-07-29",{c:"2",ca:"18",e:"12",f:"3.5",fa:"4",s:"1.1",si:"1"}],["2017-04-05",{c:"4",ca:"18",e:"15",f:"49",fa:"49",s:"3",si:"2"}],["2015-07-29",{c:"23",ca:"25",e:"12",f:"31",fa:"31",s:"6",si:"6"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-11-19",{c:"87",ca:"87",e:"87",f:"70",fa:"79",s:"12.1",si:"12.2"}],["2020-07-28",{c:"33",ca:"33",e:"12",f:"74",fa:"79",s:"12.1",si:"12.2"}],["2024-03-19",{c:"114",ca:"114",e:"114",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2024-05-13",{c:"114",ca:"114",e:"114",f:"121",fa:"121",s:"17.5",si:"17.5"}],["2024-10-17",{c:"130",ca:"130",e:"130",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2024-03-19",{c:"114",ca:"114",e:"114",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2024-10-17",{c:"130",ca:"130",e:"130",f:"121",fa:"121",s:"17.5",si:"17.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3"}],["2017-10-24",{c:"62",ca:"62",e:"14",f:"22",fa:"22",s:"10",si:"10"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2019-09-19",{c:"36",ca:"36",e:"12",f:"52",fa:"52",s:"13",si:"9.3"}],["2024-03-05",{c:"114",ca:"114",e:"114",f:"122",fa:"122",s:"17.4",si:"17.4"}],["2024-04-16",{c:"118",ca:"118",e:"118",f:"125",fa:"125",s:"13.1",si:"13.4"}],["2015-09-30",{c:"36",ca:"36",e:"12",f:"16",fa:"16",s:"9",si:"9"}],["2022-03-14",{c:"36",ca:"36",e:"12",f:"16",fa:"16",s:"15.4",si:"15.4"}],["2024-08-06",{c:"117",ca:"117",e:"117",f:"129",fa:"129",s:"17.4",si:"17.4"}],["2015-09-30",{c:"26",ca:"26",e:"12",f:"16",fa:"16",s:"9",si:"9"}],["2023-03-14",{c:"19",ca:"25",e:"79",f:"111",fa:"111",s:"6",si:"6"}],["2023-03-13",{c:"111",ca:"111",e:"111",f:"108",fa:"108",s:"15.4",si:"15.4"}],["2023-07-21",{c:"115",ca:"115",e:"115",f:"70",fa:"79",s:"15",si:"15"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"38",fa:"38",s:"10",si:"10"}],["2016-09-20",{c:"45",ca:"45",e:"12",f:"37",fa:"37",s:"10",si:"10"}],["2015-07-29",{c:"7",ca:"18",e:"12",f:"4",fa:"4",s:"5.1",si:"4.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2025-09-05",{c:"140",ca:"140",e:"140",f:"133",fa:"133",s:"18.2",si:"18.2"}],["2015-09-30",{c:"44",ca:"44",e:"12",f:"40",fa:"40",s:"9",si:"9"}],["2016-03-21",{c:"41",ca:"41",e:"13",f:"27",fa:"27",s:"9.1",si:"9.3"}],["2023-09-18",{c:"113",ca:"113",e:"113",f:"102",fa:"102",s:"17",si:"17"}],["2018-04-30",{c:"44",ca:"44",e:"17",f:"48",fa:"48",s:"10.1",si:"10.3"}],["2015-07-29",{c:"32",ca:"32",e:"12",f:"19",fa:"19",s:"7",si:"7"}],["2023-12-07",{c:"120",ca:"120",e:"120",f:"115",fa:"115",s:"17",si:"17"}],["2025-09-15",{c:"95",ca:"95",e:"95",f:"142",fa:"142",s:"26",si:"26"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"2",si:"1"}],["2023-11-21",{c:"72",ca:"72",e:"79",f:"120",fa:"120",s:"16.4",si:"16.4"}],["2015-07-29",{c:"4",ca:"18",e:"12",f:"3.5",fa:"4",s:"4",si:"5"}],["2023-11-02",{c:"119",ca:"119",e:"119",f:"88",fa:"88",s:"16.5",si:"16.5"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"≤4",si:"≤3.2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-04-18",{c:"124",ca:"124",e:"124",f:"120",fa:"120",s:"17.4",si:"17.4"}],["2015-07-29",{c:"3",ca:"18",e:"12",f:"3.5",fa:"4",s:"3.1",si:"3"}],["2025-10-14",{c:"125",ca:"125",e:"125",f:"144",fa:"144",s:"18.2",si:"18.2"}],["2025-10-14",{c:"111",ca:"111",e:"111",f:"144",fa:"144",s:"18",si:"18"}],["2022-12-05",{c:"108",ca:"108",e:"108",f:"101",fa:"101",s:"15.4",si:"15.4"}],["2017-10-17",{c:"26",ca:"26",e:"16",f:"19",fa:"19",s:"7",si:"7"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1.3",si:"1"}],["2021-08-10",{c:"61",ca:"61",e:"79",f:"91",fa:"68",s:"13",si:"13"}],["2017-10-17",{c:"57",ca:"57",e:"16",f:"52",fa:"52",s:"11",si:"11"}],["2021-04-26",{c:"85",ca:"85",e:"85",f:"78",fa:"79",s:"14.1",si:"14.5"}],["2021-10-25",{c:"75",ca:"75",e:"79",f:"78",fa:"79",s:"15.1",si:"15.1"}],["2022-05-03",{c:"95",ca:"95",e:"95",f:"100",fa:"100",s:"15.2",si:"15.2"}],["2024-03-05",{c:"114",ca:"114",e:"114",f:"112",fa:"112",s:"17.4",si:"17.4"}],["2024-12-11",{c:"119",ca:"119",e:"119",f:"120",fa:"120",s:"18.2",si:"18.2"}],["2020-10-20",{c:"86",ca:"86",e:"86",f:"78",fa:"79",s:"13.1",si:"13.4"}],["2020-03-24",{c:"69",ca:"69",e:"79",f:"62",fa:"62",s:"13.1",si:"13.4"}],["2021-10-25",{c:"75",ca:"75",e:"18",f:"64",fa:"64",s:"15.1",si:"15.1"}],["2021-11-19",{c:"96",ca:"96",e:"96",f:"79",fa:"79",s:"15.1",si:"15.1"}],["2021-04-26",{c:"69",ca:"69",e:"18",f:"62",fa:"62",s:"14.1",si:"14.5"}],["2023-03-27",{c:"91",ca:"91",e:"91",f:"89",fa:"89",s:"16.4",si:"16.4"}],["2024-12-11",{c:"112",ca:"112",e:"112",f:"121",fa:"121",s:"18.2",si:"18.2"}],["2021-12-13",{c:"74",ca:"88",e:"79",f:"79",fa:"79",s:"15.2",si:"15.2"}],["2024-09-16",{c:"119",ca:"119",e:"119",f:"120",fa:"120",s:"18",si:"18"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"4",si:"3.2"}],["2021-04-26",{c:"84",ca:"84",e:"84",f:"79",fa:"79",s:"14.1",si:"14.5"}],["2015-07-29",{c:"36",ca:"36",e:"12",f:"6",fa:"6",s:"8",si:"8"}],["2015-09-30",{c:"36",ca:"36",e:"12",f:"34",fa:"34",s:"9",si:"9"}],["2020-09-16",{c:"84",ca:"84",e:"84",f:"75",fa:"79",s:"14",si:"14"}],["2021-04-26",{c:"35",ca:"35",e:"12",f:"25",fa:"25",s:"14.1",si:"14.5"}],["2015-07-29",{c:"37",ca:"37",e:"12",f:"34",fa:"34",s:"11",si:"11"}],["2022-03-14",{c:"69",ca:"69",e:"79",f:"96",fa:"96",s:"15.4",si:"15.4"}],["2021-09-07",{c:"67",ca:"70",e:"18",f:"60",fa:"92",s:"13",si:"13"}],["2023-10-24",{c:"85",ca:"85",e:"85",f:"119",fa:"119",s:"16",si:"16"}],["2015-07-29",{c:"9",ca:"25",e:"12",f:"4",fa:"4",s:"5.1",si:"8"}],["2021-09-20",{c:"63",ca:"63",e:"17",f:"30",fa:"30",s:"14",si:"15"}],["2024-10-29",{c:"104",ca:"104",e:"104",f:"132",fa:"132",s:"16.4",si:"16.4"}],["2020-01-15",{c:"47",ca:"47",e:"79",f:"53",fa:"53",s:"12",si:"12"}],["2017-04-19",{c:"33",ca:"33",e:"12",f:"53",fa:"53",s:"9.1",si:"9.3"}],["2020-09-16",{c:"47",ca:"47",e:"79",f:"56",fa:"56",s:"14",si:"14"}],["2015-07-29",{c:"26",ca:"26",e:"12",f:"22",fa:"22",s:"8",si:"8"}],["2018-04-30",{c:"26",ca:"26",e:"17",f:"22",fa:"22",s:"8",si:"8"}],["2022-12-13",{c:"100",ca:"100",e:"100",f:"108",fa:"108",s:"16",si:"16"}],["2021-09-20",{c:"56",ca:"58",e:"79",f:"51",fa:"51",s:"15",si:"15"}],["2024-10-29",{c:"104",ca:"104",e:"104",f:"132",fa:"132",s:"16.4",si:"16.4"}],["2020-09-16",{c:"9",ca:"18",e:"18",f:"65",fa:"65",s:"14",si:"14"}],["2020-01-15",{c:"56",ca:"56",e:"79",f:"22",fa:"24",s:"11",si:"11"}],["2025-10-03",{c:"141",ca:"141",e:"141",f:"117",fa:"117",s:"15.4",si:"15.4"}],["2023-05-09",{c:"76",ca:"76",e:"79",f:"113",fa:"113",s:"15.4",si:"15.4"}],["2020-01-15",{c:"58",ca:"58",e:"79",f:"44",fa:"44",s:"11",si:"11"}],["2015-07-29",{c:"5",ca:"18",e:"12",f:"11",fa:"14",s:"5",si:"4.2"}],["2015-07-29",{c:"23",ca:"25",e:"12",f:"31",fa:"31",s:"6",si:"8"}],["2020-01-15",{c:"23",ca:"25",e:"79",f:"31",fa:"31",s:"6",si:"8"}],["2021-01-21",{c:"88",ca:"88",e:"88",f:"82",fa:"82",s:"14",si:"14"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2024-03-19",{c:"114",ca:"114",e:"114",f:"124",fa:"124",s:"17.4",si:"17.4"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2020-01-15",{c:"36",ca:"36",e:"79",f:"36",fa:"36",s:"9.1",si:"9.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2015-09-30",{c:"44",ca:"44",e:"12",f:"15",fa:"15",s:"9",si:"9"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"1",si:"1"}],["2017-03-27",{c:"48",ca:"48",e:"12",f:"41",fa:"41",s:"10.1",si:"10.3"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3",si:"1"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"1",fa:"4",s:"3.1",si:"2"}],["2015-07-29",{c:"1",ca:"18",e:"12",f:"3",fa:"4",s:"1",si:"1"}],["2024-05-14",{c:"1",ca:"18",e:"12",f:"126",fa:"126",s:"3.1",si:"3"}]],c={w:"WebKit",g:"Gecko",p:"Presto",b:"Blink"},e={r:"retired",c:"current",b:"beta",n:"nightly",p:"planned",u:"unknown",e:"esr"},f=s=>{const a={};return Object.entries(s).forEach(([s,r])=>{if(r.releases){a[s]||(a[s]={releases:{}});const f=a[s].releases;r.releases.forEach(s=>{f[s[0]]={version:s[0],release_date:"u"==s[1]?"unknown":s[1],status:e[s[2]],engine:s[3]?c[s[3]]:void 0,engine_version:s[4]}})}}),a},b=(()=>{const s=[];return r.forEach(a=>{var r;s.push({status:{baseline_low_date:a[0],support:(r=a[1],{chrome:r.c,chrome_android:r.ca,edge:r.e,firefox:r.f,firefox_android:r.fa,safari:r.s,safari_ios:r.si})}})}),s})(),u=f(s),i=f(a);let n=!1;function o(){n=!1}const g=["chrome","chrome_android","edge","firefox","firefox_android","safari","safari_ios"],t=Object.entries(u).filter(([s])=>g.includes(s)),l=["webview_android","samsunginternet_android","opera_android","opera"],w=[...Object.entries(u).filter(([s])=>l.includes(s)),...Object.entries(i)],p=["current","esr","retired","unknown","beta","nightly"];let d=!1;const v=s=>{if(!1===s.includeDownstreamBrowsers&&!0===s.includeKaiOS){if(console.log(new Error("KaiOS is a downstream browser and can only be included if you include other downstream browsers. Please ensure you use `includeDownstreamBrowsers: true`.")),"undefined"==typeof process||!process.exit)throw new Error("KaiOS configuration error: process.exit is not available");process.exit(1)}},_=s=>s&&s.startsWith("≤")?s.slice(1):s,h=(s,a)=>{if(s===a)return 0;const[r=0,c=0]=s.split(".",2).map(Number),[e=0,f=0]=a.split(".",2).map(Number);if(isNaN(r)||isNaN(c))throw new Error(`Invalid version: ${s}`);if(isNaN(e)||isNaN(f))throw new Error(`Invalid version: ${a}`);return r!==e?r>e?1:-1:c!==f?c>f?1:-1:0},m=s=>{let a=[];return s.forEach(s=>{let r=t.find(a=>a[0]===s.browser);if(r){Object.entries(r[1].releases).filter(([,s])=>p.includes(s.status)).sort((s,a)=>h(s[0],a[0])).forEach(([r,c])=>!!p.includes(c.status)&&(1===h(r,s.version)&&(a.push({browser:s.browser,version:r,release_date:c.release_date?c.release_date:"unknown"}),!0)))}}),a},O=(s,a=!1)=>{if(s.getFullYear()<2015&&!d&&console.warn(new Error("There are no browser versions compatible with Baseline before 2015. You may receive unexpected results.")),s.getFullYear()<2002)throw new Error("None of the browsers in the core set were released before 2002. Please use a date after 2002.");if(s.getFullYear()>(new Date).getFullYear())throw new Error("There are no browser versions compatible with Baseline in the future");const r=(s=>b.filter(a=>a.status.baseline_low_date&&new Date(a.status.baseline_low_date)<=s).map(s=>({baseline_low_date:s.status.baseline_low_date,support:s.status.support})))(s),c=(s=>{let a={};return Object.entries(t).forEach(([,s])=>{a[s[0]]={browser:s[0],version:"0",release_date:""}}),s.forEach(s=>{Object.entries(s.support).forEach(r=>{const c=r[0],e=_(r[1]);a[c]&&1===h(e,_(a[c].version))&&(a[c]={browser:c,version:e,release_date:s.baseline_low_date})})}),Object.values(a)})(r);return a?[...c,...m(c)].sort((s,a)=>s.browsera.browser?1:h(s.version,a.version)):c},y=(s=[],a=!0,r=!1)=>{const c=a=>{var r;return s&&s.length>0?null===(r=s.filter(s=>s.browser===a).sort((s,a)=>h(s.version,a.version))[0])||void 0===r?void 0:r.version:void 0},e=c("chrome"),f=c("firefox");if(!e&&!f)throw new Error("There are no browser versions compatible with Baseline before Chrome and Firefox");let b=[];return w.filter(([s])=>!("kai_os"===s&&!r)).forEach(([s,r])=>{var c;if(!r.releases)return;let u=Object.entries(r.releases).filter(([,s])=>{const{engine:a,engine_version:r}=s;return!(!a||!r)&&("Blink"===a&&e?h(r,e)>=0:!("Gecko"!==a||!f)&&h(r,f)>=0)}).sort((s,a)=>h(s[0],a[0]));for(let r=0;r{if(n||"undefined"!=typeof process&&process.env&&(process.env.BROWSERSLIST_IGNORE_OLD_DATA||process.env.BASELINE_BROWSER_MAPPING_IGNORE_OLD_DATA))return;const r=new Date;r.setMonth(r.getMonth()-2),s>r&&(null!=a?a:1764418039385){o[s]={},E({targetYear:s,suppressWarnings:u.suppressWarnings}).forEach(a=>{o[s]&&(o[s][a.browser]=a)})});const t=E({suppressWarnings:u.suppressWarnings}),l={};t.forEach(s=>{l[s.browser]=s});const w=new Date;w.setMonth(w.getMonth()+30);const p=E({widelyAvailableOnDate:w.toISOString().slice(0,10),suppressWarnings:u.suppressWarnings}),_={};p.forEach(s=>{_[s.browser]=s});const m=E({targetYear:2002,listAllCompatibleVersions:!0,suppressWarnings:u.suppressWarnings}),O=[];if(g.forEach(s=>{var a,r,c,e;let f=m.filter(a=>a.browser==s).sort((s,a)=>h(s.version,a.version)),b=null!==(r=null===(a=l[s])||void 0===a?void 0:a.version)&&void 0!==r?r:"0",g=null!==(e=null===(c=_[s])||void 0===c?void 0:c.version)&&void 0!==e?e:"0";n.forEach(a=>{var r;if(o[a]){let c=(null!==(r=o[a][s])&&void 0!==r?r:{version:"0"}).version,e=f.findIndex(s=>0===h(s.version,c));(a===i-1?f:f.slice(0,e)).forEach(s=>{let r=h(s.version,b)>=0,c=h(s.version,g)>=0,e=Object.assign(Object.assign({},s),{year:a<=2015?"pre_baseline":a-1});u.useSupports?(r&&(e.supports="widely"),c&&(e.supports="newly")):e=Object.assign(Object.assign({},e),{wa_compatible:r}),O.push(e)}),f=f.slice(e,f.length)}})}),u.includeDownstreamBrowsers){y(O,!0,u.includeKaiOS).forEach(s=>{let a=O.find(a=>"chrome"===a.browser&&a.version===s.engine_version);a&&(u.useSupports?O.push(Object.assign(Object.assign({},s),{year:a.year,supports:a.supports})):O.push(Object.assign(Object.assign({},s),{year:a.year,wa_compatible:a.wa_compatible})))})}if(O.sort((s,a)=>{if("pre_baseline"===s.year&&"pre_baseline"!==a.year)return-1;if("pre_baseline"===a.year&&"pre_baseline"!==s.year)return 1;if("pre_baseline"!==s.year&&"pre_baseline"!==a.year){if(s.yeara.year)return 1}return s.browsera.browser?1:h(s.version,a.version)}),"object"===u.outputFormat){const s={};return O.forEach(a=>{s[a.browser]||(s[a.browser]={});let r={year:a.year,release_date:a.release_date,engine:a.engine,engine_version:a.engine_version};s[a.browser][a.version]=u.useSupports?a.supports?Object.assign(Object.assign({},r),{supports:a.supports}):r:Object.assign(Object.assign({},r),{wa_compatible:a.wa_compatible})}),null!=s?s:{}}if("csv"===u.outputFormat){let s=`"browser","version","year","${u.useSupports?"supports":"wa_compatible"}","release_date","engine","engine_version"`;return O.forEach(a=>{var r,c,e,f;let b={browser:a.browser,version:a.version,year:a.year,release_date:null!==(r=a.release_date)&&void 0!==r?r:"NULL",engine:null!==(c=a.engine)&&void 0!==c?c:"NULL",engine_version:null!==(e=a.engine_version)&&void 0!==e?e:"NULL"};b=u.useSupports?Object.assign(Object.assign({},b),{supports:null!==(f=a.supports)&&void 0!==f?f:""}):Object.assign(Object.assign({},b),{wa_compatible:a.wa_compatible}),s+=`\n"${b.browser}","${b.version}","${b.year}","${u.useSupports?b.supports:b.wa_compatible}","${b.release_date}","${b.engine}","${b.engine_version}"`}),s}return O}export{o as _resetHasWarned,D as getAllVersions,E as getCompatibleVersions}; diff --git a/node_modules/baseline-browser-mapping/package.json b/node_modules/baseline-browser-mapping/package.json new file mode 100644 index 0000000..271ade8 --- /dev/null +++ b/node_modules/baseline-browser-mapping/package.json @@ -0,0 +1,64 @@ +{ + "name": "baseline-browser-mapping", + "main": "./dist/index.cjs", + "version": "2.9.3", + "description": "A library for obtaining browser versions with their maximum supported Baseline feature set and Widely Available status.", + "exports": { + ".": { + "require": "./dist/index.cjs", + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./legacy": { + "require": "./dist/index.cjs", + "types": "./dist/index.d.ts" + } + }, + "jsdelivr": "./dist/index.js", + "files": [ + "dist/*", + "!dist/scripts/*", + "LICENSE.txt", + "README.md" + ], + "types": "./dist/index.d.ts", + "type": "module", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + }, + "scripts": { + "fix-cli-permissions": "output=$(npx baseline-browser-mapping 2>&1); path=$(printf '%s\n' \"$output\" | sed -n 's/^.*: \\(.*\\): Permission denied$/\\1/p; t; s/^\\(.*\\): Permission denied$/\\1/p'); if [ -n \"$path\" ]; then echo \"Permission denied for: $path\"; echo \"Removing $path ...\"; rm -rf \"$path\"; else echo \"$output\"; fi", + "test:format": "npx prettier --check .", + "test:lint": "npx eslint .", + "test:jasmine": "npx jasmine", + "test:jasmine-browser": "npx jasmine-browser-runner runSpecs --config ./spec/support/jasmine-browser.js", + "test": "npm run build && npm run fix-cli-permissions && npm run test:format && npm run test:lint && npm run test:jasmine && npm run test:jasmine-browser", + "build": "rm -rf dist; npx prettier . --write; rollup -c; rm -rf ./dist/scripts/expose-data.d.ts ./dist/cli.d.ts", + "refresh-downstream": "npx tsx scripts/refresh-downstream.ts", + "refresh-static": "npx tsx scripts/refresh-static.ts", + "update-data-file": "npx tsx scripts/update-data-file.ts; npx prettier ./src/data/data.js --write", + "update-data-dependencies": "npm i @mdn/browser-compat-data@latest web-features@latest -D", + "check-data-changes": "git diff --name-only | grep -q '^src/data/data.js$' && echo 'changes-available=TRUE' || echo 'changes-available=FALSE'" + }, + "license": "Apache-2.0", + "devDependencies": { + "@mdn/browser-compat-data": "^7.1.23", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.3", + "@types/node": "^22.15.17", + "eslint-plugin-new-with-error": "^5.0.0", + "jasmine": "^5.8.0", + "jasmine-browser-runner": "^3.0.0", + "jasmine-spec-reporter": "^7.0.0", + "prettier": "^3.5.3", + "rollup": "^4.44.0", + "tslib": "^2.8.1", + "typescript": "^5.7.2", + "typescript-eslint": "^8.35.0", + "web-features": "^3.10.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/web-platform-dx/baseline-browser-mapping.git" + } +} diff --git a/node_modules/body-parser/LICENSE b/node_modules/body-parser/LICENSE new file mode 100644 index 0000000..386b7b6 --- /dev/null +++ b/node_modules/body-parser/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md new file mode 100644 index 0000000..31b66ce --- /dev/null +++ b/node_modules/body-parser/README.md @@ -0,0 +1,494 @@ +# body-parser + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +Node.js body parsing middleware. + +Parse incoming request bodies in a middleware before your handlers, available +under the `req.body` property. + +**Note** As `req.body`'s shape is based on user-controlled input, all +properties and values in this object are untrusted and should be validated +before trusting. For example, `req.body.foo.toString()` may fail in multiple +ways, for example the `foo` property may not be there or may not be a string, +and `toString` may not be a function and instead a string or other user input. + +[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). + +_This does not handle multipart bodies_, due to their complex and typically +large nature. For multipart bodies, you may be interested in the following +modules: + + * [busboy](https://www.npmjs.org/package/busboy#readme) and + [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) + * [multiparty](https://www.npmjs.org/package/multiparty#readme) and + [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) + * [formidable](https://www.npmjs.org/package/formidable#readme) + * [multer](https://www.npmjs.org/package/multer#readme) + +This module provides the following parsers: + + * [JSON body parser](#bodyparserjsonoptions) + * [Raw body parser](#bodyparserrawoptions) + * [Text body parser](#bodyparsertextoptions) + * [URL-encoded form body parser](#bodyparserurlencodedoptions) + +Other body parsers you might be interested in: + +- [body](https://www.npmjs.org/package/body#readme) +- [co-body](https://www.npmjs.org/package/co-body#readme) + +## Installation + +```sh +$ npm install body-parser +``` + +## API + +```js +const bodyParser = require('body-parser') +``` + +The `bodyParser` object exposes various factories to create middlewares. All +middlewares will populate the `req.body` property with the parsed body when +the `Content-Type` request header matches the `type` option. + +The various errors returned by this module are described in the +[errors section](#errors). + +### bodyParser.json([options]) + +Returns middleware that only parses `json` and only looks at requests where +the `Content-Type` header matches the `type` option. This parser accepts any +Unicode encoding of the body and supports automatic inflation of `gzip`, +`br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). + +#### Options + +The `json` function takes an optional `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the json content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### reviver + +The `reviver` option is passed directly to `JSON.parse` as the second +argument. You can find more information on this argument +[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). + +##### strict + +When set to `true`, will only accept arrays and objects; when `false` will +accept anything `JSON.parse` accepts. Defaults to `true`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not a +function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can +be an extension name (like `json`), a mime type (like `application/json`), or +a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a truthy +value. Defaults to `application/json`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.raw([options]) + +Returns middleware that parses all bodies as a `Buffer` and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a `Buffer` object +of the body. + +#### Options + +The `raw` function takes an optional `options` object that may contain any of +the following keys: + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. +If not a function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this +can be an extension name (like `bin`), a mime type (like +`application/octet-stream`), or a mime type with a wildcard (like `*/*` or +`application/*`). If a function, the `type` option is called as `fn(req)` +and the request is parsed if it returns a truthy value. Defaults to +`application/octet-stream`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.text([options]) + +Returns middleware that parses all bodies as a string and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate` +encodings. + +A new `body` string containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This will be a string of the +body. + +#### Options + +The `text` function takes an optional `options` object that may contain any of +the following keys: + +##### defaultCharset + +Specify the default character set for the text content if the charset is not +specified in the `Content-Type` header of the request. Defaults to `utf-8`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can +be an extension name (like `txt`), a mime type (like `text/plain`), or a mime +type with a wildcard (like `*/*` or `text/*`). If a function, the `type` +option is called as `fn(req)` and the request is parsed if it returns a +truthy value. Defaults to `text/plain`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +### bodyParser.urlencoded([options]) + +Returns middleware that only parses `urlencoded` bodies and only looks at +requests where the `Content-Type` header matches the `type` option. This +parser accepts only UTF-8 encoding of the body and supports automatic +inflation of `gzip`, `br` (brotli) and `deflate` encodings. + +A new `body` object containing the parsed data is populated on the `request` +object after the middleware (i.e. `req.body`). This object will contain +key-value pairs, where the value can be a string or array (when `extended` is +`false`), or any type (when `extended` is `true`). + +#### Options + +The `urlencoded` function takes an optional `options` object that may contain +any of the following keys: + +##### extended + +The "extended" syntax allows for rich objects and arrays to be encoded into the +URL-encoded format, allowing for a JSON-like experience with URL-encoded. For +more information, please [see the qs +library](https://www.npmjs.org/package/qs#readme). + +Defaults to `false`. + +##### inflate + +When set to `true`, then deflated (compressed) bodies will be inflated; when +`false`, deflated bodies are rejected. Defaults to `true`. + +##### limit + +Controls the maximum request body size. If this is a number, then the value +specifies the number of bytes; if it is a string, the value is passed to the +[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults +to `'100kb'`. + +##### parameterLimit + +The `parameterLimit` option controls the maximum number of parameters that +are allowed in the URL-encoded data. If a request contains more parameters +than this value, a 413 will be returned to the client. Defaults to `1000`. + +##### type + +The `type` option is used to determine what media type the middleware will +parse. This option can be a string, array of strings, or a function. If not +a function, `type` option is passed directly to the +[type-is](https://www.npmjs.org/package/type-is#readme) library and this can +be an extension name (like `urlencoded`), a mime type (like +`application/x-www-form-urlencoded`), or a mime type with a wildcard (like +`*/x-www-form-urlencoded`). If a function, the `type` option is called as +`fn(req)` and the request is parsed if it returns a truthy value. Defaults +to `application/x-www-form-urlencoded`. + +##### verify + +The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, +where `buf` is a `Buffer` of the raw request body and `encoding` is the +encoding of the request. The parsing can be aborted by throwing an error. + +##### defaultCharset + +The default charset to parse as, if not specified in content-type. Must be +either `utf-8` or `iso-8859-1`. Defaults to `utf-8`. + +##### charsetSentinel + +Whether to let the value of the `utf8` parameter take precedence as the charset +selector. It requires the form to contain a parameter named `utf8` with a value +of `✓`. Defaults to `false`. + +##### interpretNumericEntities + +Whether to decode numeric entities such as `☺` when parsing an iso-8859-1 +form. Defaults to `false`. + + +##### depth + +The `depth` option is used to configure the maximum depth of the `qs` library when `extended` is `true`. This allows you to limit the amount of keys that are parsed and can be useful to prevent certain types of abuse. Defaults to `32`. It is recommended to keep this value as low as possible. + +## Errors + +The middlewares provided by this module create errors using the +[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors +will typically have a `status`/`statusCode` property that contains the suggested +HTTP response code, an `expose` property to determine if the `message` property +should be displayed to the client, a `type` property to determine the type of +error without matching against the `message`, and a `body` property containing +the read body, if available. + +The following are the common errors created, though any error can come through +for various reasons. + +### content encoding unsupported + +This error will occur when the request had a `Content-Encoding` header that +contained an encoding but the "inflation" option was set to `false`. The +`status` property is set to `415`, the `type` property is set to +`'encoding.unsupported'`, and the `charset` property will be set to the +encoding that is unsupported. + +### entity parse failed + +This error will occur when the request contained an entity that could not be +parsed by the middleware. The `status` property is set to `400`, the `type` +property is set to `'entity.parse.failed'`, and the `body` property is set to +the entity value that failed parsing. + +### entity verify failed + +This error will occur when the request contained an entity that could not be +failed verification by the defined `verify` option. The `status` property is +set to `403`, the `type` property is set to `'entity.verify.failed'`, and the +`body` property is set to the entity value that failed verification. + +### request aborted + +This error will occur when the request is aborted by the client before reading +the body has finished. The `received` property will be set to the number of +bytes received before the request was aborted and the `expected` property is +set to the number of expected bytes. The `status` property is set to `400` +and `type` property is set to `'request.aborted'`. + +### request entity too large + +This error will occur when the request body's size is larger than the "limit" +option. The `limit` property will be set to the byte limit and the `length` +property will be set to the request body's length. The `status` property is +set to `413` and the `type` property is set to `'entity.too.large'`. + +### request size did not match content length + +This error will occur when the request's length did not match the length from +the `Content-Length` header. This typically occurs when the request is malformed, +typically when the `Content-Length` header was calculated based on characters +instead of bytes. The `status` property is set to `400` and the `type` property +is set to `'request.size.invalid'`. + +### stream encoding should not be set + +This error will occur when something called the `req.setEncoding` method prior +to this middleware. This module operates directly on bytes only and you cannot +call `req.setEncoding` when using this module. The `status` property is set to +`500` and the `type` property is set to `'stream.encoding.set'`. + +### stream is not readable + +This error will occur when the request is no longer readable when this middleware +attempts to read it. This typically means something other than a middleware from +this module read the request body already and the middleware was also configured to +read the same request. The `status` property is set to `500` and the `type` +property is set to `'stream.not.readable'`. + +### too many parameters + +This error will occur when the content of the request exceeds the configured +`parameterLimit` for the `urlencoded` parser. The `status` property is set to +`413` and the `type` property is set to `'parameters.too.many'`. + +### unsupported charset "BOGUS" + +This error will occur when the request had a charset parameter in the +`Content-Type` header, but the `iconv-lite` module does not support it OR the +parser does not support it. The charset is contained in the message as well +as in the `charset` property. The `status` property is set to `415`, the +`type` property is set to `'charset.unsupported'`, and the `charset` property +is set to the charset that is unsupported. + +### unsupported content encoding "bogus" + +This error will occur when the request had a `Content-Encoding` header that +contained an unsupported encoding. The encoding is contained in the message +as well as in the `encoding` property. The `status` property is set to `415`, +the `type` property is set to `'encoding.unsupported'`, and the `encoding` +property is set to the encoding that is unsupported. + +### The input exceeded the depth + +This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown. + +## Examples + +### Express/Connect top-level generic + +This example demonstrates adding a generic JSON and URL-encoded parser as a +top-level middleware, which will parse the bodies of all incoming requests. +This is the simplest setup. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse application/x-www-form-urlencoded +app.use(bodyParser.urlencoded()) + +// parse application/json +app.use(bodyParser.json()) + +app.use(function (req, res) { + res.setHeader('Content-Type', 'text/plain') + res.write('you posted:\n') + res.end(String(JSON.stringify(req.body, null, 2))) +}) +``` + +### Express route-specific + +This example demonstrates adding body parsers specifically to the routes that +need them. In general, this is the most recommended way to use body-parser with +Express. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// create application/json parser +const jsonParser = bodyParser.json() + +// create application/x-www-form-urlencoded parser +const urlencodedParser = bodyParser.urlencoded() + +// POST /login gets urlencoded bodies +app.post('/login', urlencodedParser, function (req, res) { + if (!req.body || !req.body.username) res.sendStatus(400) + res.send('welcome, ' + req.body.username) +}) + +// POST /api/users gets JSON bodies +app.post('/api/users', jsonParser, function (req, res) { + if (!req.body) res.sendStatus(400) + // create user in req.body +}) +``` + +### Change accepted type for parsers + +All the parsers accept a `type` option which allows you to change the +`Content-Type` that the middleware will parse. + +```js +const express = require('express') +const bodyParser = require('body-parser') + +const app = express() + +// parse various different custom JSON types as JSON +app.use(bodyParser.json({ type: 'application/*+json' })) + +// parse some custom thing into a Buffer +app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) + +// parse an HTML body into a string +app.use(bodyParser.text({ type: 'text/html' })) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://img.shields.io/github/actions/workflow/status/expressjs/body-parser/ci.yml?branch=master&label=ci +[ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml +[coveralls-image]: https://img.shields.io/coverallsCoverage/github/expressjs/body-parser?branch=master +[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master +[npm-downloads-image]: https://img.shields.io/npm/dm/body-parser +[npm-url]: https://npmjs.org/package/body-parser +[npm-version-image]: https://img.shields.io/npm/v/body-parser +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/body-parser/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/body-parser \ No newline at end of file diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js new file mode 100644 index 0000000..d722d0b --- /dev/null +++ b/node_modules/body-parser/index.js @@ -0,0 +1,80 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * @typedef Parsers + * @type {function} + * @property {function} json + * @property {function} raw + * @property {function} text + * @property {function} urlencoded + */ + +/** + * Module exports. + * @type {Parsers} + */ + +exports = module.exports = bodyParser + +/** + * JSON parser. + * @public + */ + +Object.defineProperty(exports, 'json', { + configurable: true, + enumerable: true, + get: () => require('./lib/types/json') +}) + +/** + * Raw parser. + * @public + */ + +Object.defineProperty(exports, 'raw', { + configurable: true, + enumerable: true, + get: () => require('./lib/types/raw') +}) + +/** + * Text parser. + * @public + */ + +Object.defineProperty(exports, 'text', { + configurable: true, + enumerable: true, + get: () => require('./lib/types/text') +}) + +/** + * URL-encoded parser. + * @public + */ + +Object.defineProperty(exports, 'urlencoded', { + configurable: true, + enumerable: true, + get: () => require('./lib/types/urlencoded') +}) + +/** + * Create a middleware to parse json and urlencoded bodies. + * + * @param {object} [options] + * @return {function} + * @deprecated + * @public + */ + +function bodyParser () { + throw new Error('The bodyParser() generic has been split into individual middleware to use instead.') +} diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js new file mode 100644 index 0000000..b3f2345 --- /dev/null +++ b/node_modules/body-parser/lib/read.js @@ -0,0 +1,250 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var getBody = require('raw-body') +var iconv = require('iconv-lite') +var onFinished = require('on-finished') +var zlib = require('node:zlib') +var hasBody = require('type-is').hasBody +var { getCharset } = require('./utils') + +/** + * Module exports. + */ + +module.exports = read + +/** + * Read a request into a buffer and parse. + * + * @param {object} req + * @param {object} res + * @param {function} next + * @param {function} parse + * @param {function} debug + * @param {object} options + * @private + */ + +function read (req, res, next, parse, debug, options) { + if (onFinished.isFinished(req)) { + debug('body already parsed') + next() + return + } + + if (!('body' in req)) { + req.body = undefined + } + + // skip requests without bodies + if (!hasBody(req)) { + debug('skip empty body') + next() + return + } + + debug('content-type %j', req.headers['content-type']) + + // determine if request should be parsed + if (!options.shouldParse(req)) { + debug('skip parsing') + next() + return + } + + var encoding = null + if (options?.skipCharset !== true) { + encoding = getCharset(req) || options.defaultCharset + + // validate charset + if (!!options?.isValidCharset && !options.isValidCharset(encoding)) { + debug('invalid charset') + next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding, + type: 'charset.unsupported' + })) + return + } + } + + var length + var opts = options + var stream + + // read options + var verify = opts.verify + + try { + // get the content stream + stream = contentstream(req, debug, opts.inflate) + length = stream.length + stream.length = undefined + } catch (err) { + return next(err) + } + + // set raw-body options + opts.length = length + opts.encoding = verify + ? null + : encoding + + // assert charset is supported + if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { + return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + })) + } + + // read body + debug('read body') + getBody(stream, opts, function (error, body) { + if (error) { + var _error + + if (error.type === 'encoding.unsupported') { + // echo back charset + _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { + charset: encoding.toLowerCase(), + type: 'charset.unsupported' + }) + } else { + // set status code on error + _error = createError(400, error) + } + + // unpipe from stream and destroy + if (stream !== req) { + req.unpipe() + stream.destroy() + } + + // read off entire request + dump(req, function onfinished () { + next(createError(400, _error)) + }) + return + } + + // verify + if (verify) { + try { + debug('verify body') + verify(req, res, body, encoding) + } catch (err) { + next(createError(403, err, { + body: body, + type: err.type || 'entity.verify.failed' + })) + return + } + } + + // parse + var str = body + try { + debug('parse body') + str = typeof body !== 'string' && encoding !== null + ? iconv.decode(body, encoding) + : body + req.body = parse(str, encoding) + } catch (err) { + next(createError(400, err, { + body: str, + type: err.type || 'entity.parse.failed' + })) + return + } + + next() + }) +} + +/** + * Get the content stream of the request. + * + * @param {object} req + * @param {function} debug + * @param {boolean} [inflate=true] + * @return {object} + * @api private + */ + +function contentstream (req, debug, inflate) { + var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() + var length = req.headers['content-length'] + + debug('content-encoding "%s"', encoding) + + if (inflate === false && encoding !== 'identity') { + throw createError(415, 'content encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } + + if (encoding === 'identity') { + req.length = length + return req + } + + var stream = createDecompressionStream(encoding, debug) + req.pipe(stream) + return stream +} + +/** + * Create a decompression stream for the given encoding. + * @param {string} encoding + * @param {function} debug + * @return {object} + * @api private + */ +function createDecompressionStream (encoding, debug) { + switch (encoding) { + case 'deflate': + debug('inflate body') + return zlib.createInflate() + case 'gzip': + debug('gunzip body') + return zlib.createGunzip() + case 'br': + debug('brotli decompress body') + return zlib.createBrotliDecompress() + default: + throw createError(415, 'unsupported content encoding "' + encoding + '"', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } +} + +/** + * Dump the contents of a request. + * + * @param {object} req + * @param {function} callback + * @api private + */ + +function dump (req, callback) { + if (onFinished.isFinished(req)) { + callback(null) + } else { + onFinished(req, callback) + req.resume() + } +} diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js new file mode 100644 index 0000000..15c54bb --- /dev/null +++ b/node_modules/body-parser/lib/types/json.js @@ -0,0 +1,166 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('body-parser:json') +var read = require('../read') +var { normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = json + +/** + * RegExp to match the first non-space in a string. + * + * Allowed whitespace is defined in RFC 7159: + * + * ws = *( + * %x20 / ; Space + * %x09 / ; Horizontal tab + * %x0A / ; Line feed or New line + * %x0D ) ; Carriage return + */ + +var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex + +var JSON_SYNTAX_CHAR = '#' +var JSON_SYNTAX_REGEXP = /#+/g + +/** + * Create a middleware to parse JSON bodies. + * + * @param {object} [options] + * @return {function} + * @public + */ + +function json (options) { + const normalizedOptions = normalizeOptions(options, 'application/json') + + var reviver = options?.reviver + var strict = options?.strict !== false + + function parse (body) { + if (body.length === 0) { + // special-case empty json body, as it's a common client-side mistake + // TODO: maybe make this configurable or part of "strict" option + return {} + } + + if (strict) { + var first = firstchar(body) + + if (first !== '{' && first !== '[') { + debug('strict violation') + throw createStrictSyntaxError(body, first) + } + } + + try { + debug('parse json') + return JSON.parse(body, reviver) + } catch (e) { + throw normalizeJsonSyntaxError(e, { + message: e.message, + stack: e.stack + }) + } + } + + const readOptions = { + ...normalizedOptions, + // assert charset per RFC 7159 sec 8.1 + isValidCharset: (charset) => charset.slice(0, 4) === 'utf-' + } + + return function jsonParser (req, res, next) { + read(req, res, next, parse, debug, readOptions) + } +} + +/** + * Create strict violation syntax error matching native error. + * + * @param {string} str + * @param {string} char + * @return {Error} + * @private + */ + +function createStrictSyntaxError (str, char) { + var index = str.indexOf(char) + var partial = '' + + if (index !== -1) { + partial = str.substring(0, index) + JSON_SYNTAX_CHAR + + for (var i = index + 1; i < str.length; i++) { + partial += JSON_SYNTAX_CHAR + } + } + + try { + JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') + } catch (e) { + return normalizeJsonSyntaxError(e, { + message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) { + return str.substring(index, index + placeholder.length) + }), + stack: e.stack + }) + } +} + +/** + * Get the first non-whitespace character in a string. + * + * @param {string} str + * @return {function} + * @private + */ + +function firstchar (str) { + var match = FIRST_CHAR_REGEXP.exec(str) + + return match + ? match[1] + : undefined +} + +/** + * Normalize a SyntaxError for JSON.parse. + * + * @param {SyntaxError} error + * @param {object} obj + * @return {SyntaxError} + */ + +function normalizeJsonSyntaxError (error, obj) { + var keys = Object.getOwnPropertyNames(error) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + if (key !== 'stack' && key !== 'message') { + delete error[key] + } + } + + // replace stack before message for Node.js 0.10 and below + error.stack = obj.stack.replace(error.message, obj.message) + error.message = obj.message + + return error +} diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js new file mode 100644 index 0000000..04b1b88 --- /dev/null +++ b/node_modules/body-parser/lib/types/raw.js @@ -0,0 +1,43 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + */ + +var debug = require('debug')('body-parser:raw') +var read = require('../read') +var { normalizeOptions, passthrough } = require('../utils') + +/** + * Module exports. + */ + +module.exports = raw + +/** + * Create a middleware to parse raw bodies. + * + * @param {object} [options] + * @return {function} + * @api public + */ + +function raw (options) { + const normalizedOptions = normalizeOptions(options, 'application/octet-stream') + + const readOptions = { + ...normalizedOptions, + // Skip charset validation and parse the body as is + skipCharset: true + } + + return function rawParser (req, res, next) { + read(req, res, next, passthrough, debug, readOptions) + } +} diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js new file mode 100644 index 0000000..d4c7e3b --- /dev/null +++ b/node_modules/body-parser/lib/types/text.js @@ -0,0 +1,37 @@ +/*! + * body-parser + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + */ + +var debug = require('debug')('body-parser:text') +var read = require('../read') +var { normalizeOptions, passthrough } = require('../utils') + +/** + * Module exports. + */ + +module.exports = text + +/** + * Create a middleware to parse text bodies. + * + * @param {object} [options] + * @return {function} + * @api public + */ + +function text (options) { + const normalizedOptions = normalizeOptions(options, 'text/plain') + + return function textParser (req, res, next) { + read(req, res, next, passthrough, debug, normalizedOptions) + } +} diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js new file mode 100644 index 0000000..9240937 --- /dev/null +++ b/node_modules/body-parser/lib/types/urlencoded.js @@ -0,0 +1,142 @@ +/*! + * body-parser + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var createError = require('http-errors') +var debug = require('debug')('body-parser:urlencoded') +var read = require('../read') +var qs = require('qs') +var { normalizeOptions } = require('../utils') + +/** + * Module exports. + */ + +module.exports = urlencoded + +/** + * Create a middleware to parse urlencoded bodies. + * + * @param {object} [options] + * @return {function} + * @public + */ + +function urlencoded (options) { + const normalizedOptions = normalizeOptions(options, 'application/x-www-form-urlencoded') + + if (normalizedOptions.defaultCharset !== 'utf-8' && normalizedOptions.defaultCharset !== 'iso-8859-1') { + throw new TypeError('option defaultCharset must be either utf-8 or iso-8859-1') + } + + // create the appropriate query parser + var queryparse = createQueryParser(options) + + function parse (body, encoding) { + return body.length + ? queryparse(body, encoding) + : {} + } + + const readOptions = { + ...normalizedOptions, + // assert charset + isValidCharset: (charset) => charset === 'utf-8' || charset === 'iso-8859-1' + } + + return function urlencodedParser (req, res, next) { + read(req, res, next, parse, debug, readOptions) + } +} + +/** + * Get the extended query parser. + * + * @param {object} options + */ + +function createQueryParser (options) { + var extended = Boolean(options?.extended) + var parameterLimit = options?.parameterLimit !== undefined + ? options?.parameterLimit + : 1000 + var charsetSentinel = options?.charsetSentinel + var interpretNumericEntities = options?.interpretNumericEntities + var depth = extended ? (options?.depth !== undefined ? options?.depth : 32) : 0 + + if (isNaN(parameterLimit) || parameterLimit < 1) { + throw new TypeError('option parameterLimit must be a positive number') + } + + if (isNaN(depth) || depth < 0) { + throw new TypeError('option depth must be a zero or a positive number') + } + + if (isFinite(parameterLimit)) { + parameterLimit = parameterLimit | 0 + } + + return function queryparse (body, encoding) { + var paramCount = parameterCount(body, parameterLimit) + + if (paramCount === undefined) { + debug('too many parameters') + throw createError(413, 'too many parameters', { + type: 'parameters.too.many' + }) + } + + var arrayLimit = extended ? Math.max(100, paramCount) : 0 + + debug('parse ' + (extended ? 'extended ' : '') + 'urlencoding') + try { + return qs.parse(body, { + allowPrototypes: true, + arrayLimit: arrayLimit, + depth: depth, + charsetSentinel: charsetSentinel, + interpretNumericEntities: interpretNumericEntities, + charset: encoding, + parameterLimit: parameterLimit, + strictDepth: true + }) + } catch (err) { + if (err instanceof RangeError) { + throw createError(400, 'The input exceeded the depth', { + type: 'querystring.parse.rangeError' + }) + } else { + throw err + } + } + } +} + +/** + * Count the number of parameters, stopping once limit reached + * + * @param {string} body + * @param {number} limit + * @return {number|undefined} Returns undefined if limit exceeded + * @api private + */ +function parameterCount (body, limit) { + let count = 0 + let index = -1 + do { + count++ + if (count > limit) return undefined // Early exit if limit exceeded + index = body.indexOf('&', index + 1) + } while (index !== -1) + return count +} diff --git a/node_modules/body-parser/lib/utils.js b/node_modules/body-parser/lib/utils.js new file mode 100644 index 0000000..5634005 --- /dev/null +++ b/node_modules/body-parser/lib/utils.js @@ -0,0 +1,96 @@ +'use strict' + +/** + * Module dependencies. + */ + +var bytes = require('bytes') +var contentType = require('content-type') +var typeis = require('type-is') + +/** + * Module exports. + */ +module.exports = { + getCharset, + normalizeOptions, + passthrough +} + +/** + * Get the charset of a request. + * + * @param {object} req + * @api private + */ + +function getCharset (req) { + try { + return (contentType.parse(req).parameters.charset || '').toLowerCase() + } catch { + return undefined + } +} + +/** + * Get the simple type checker. + * + * @param {string | string[]} type + * @return {function} + */ + +function typeChecker (type) { + return function checkType (req) { + return Boolean(typeis(req, type)) + } +} + +/** + * Normalizes the common options for all parsers. + * + * @param {object} options options to normalize + * @param {string | string[] | function} defaultType default content type(s) or a function to determine it + * @returns {object} + */ +function normalizeOptions (options, defaultType) { + if (!defaultType) { + // Parsers must define a default content type + throw new TypeError('defaultType must be provided') + } + + var inflate = options?.inflate !== false + var limit = typeof options?.limit !== 'number' + ? bytes.parse(options?.limit || '100kb') + : options?.limit + var type = options?.type || defaultType + var verify = options?.verify || false + var defaultCharset = options?.defaultCharset || 'utf-8' + + if (verify !== false && typeof verify !== 'function') { + throw new TypeError('option verify must be function') + } + + // create the appropriate type checking function + var shouldParse = typeof type !== 'function' + ? typeChecker(type) + : type + + return { + inflate, + limit, + verify, + defaultCharset, + shouldParse + } +} + +/** + * Passthrough function that returns input unchanged. + * Used by parsers that don't need to transform the data. + * + * @param {*} value + * @return {*} + */ +function passthrough (value) { + return value +} diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json new file mode 100644 index 0000000..596133c --- /dev/null +++ b/node_modules/body-parser/package.json @@ -0,0 +1,52 @@ +{ + "name": "body-parser", + "description": "Node.js body parsing middleware", + "version": "2.2.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "expressjs/body-parser", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "devDependencies": { + "eslint": "^8.57.1", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-markdown": "^3.0.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.6.0", + "eslint-plugin-standard": "^4.1.0", + "mocha": "^11.1.0", + "nyc": "^17.1.0", + "supertest": "^7.0.0" + }, + "files": [ + "lib/", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">=18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/bowser/.editorconfig b/node_modules/bowser/.editorconfig new file mode 100644 index 0000000..a11eb44 --- /dev/null +++ b/node_modules/bowser/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true + +[{*.js,*.md}] +charset = utf-8 +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[{package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/node_modules/bowser/.idea/.name b/node_modules/bowser/.idea/.name new file mode 100644 index 0000000..3e2e403 --- /dev/null +++ b/node_modules/bowser/.idea/.name @@ -0,0 +1 @@ +bowser \ No newline at end of file diff --git a/node_modules/bowser/.idea/bowser.iml b/node_modules/bowser/.idea/bowser.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/node_modules/bowser/.idea/bowser.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/encodings.xml b/node_modules/bowser/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/node_modules/bowser/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/inspectionProfiles/Project_Default.xml b/node_modules/bowser/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..c6cc8c8 --- /dev/null +++ b/node_modules/bowser/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/jsLibraryMappings.xml b/node_modules/bowser/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..9bd3e33 --- /dev/null +++ b/node_modules/bowser/.idea/jsLibraryMappings.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/markdown-exported-files.xml b/node_modules/bowser/.idea/markdown-exported-files.xml new file mode 100644 index 0000000..5d1f129 --- /dev/null +++ b/node_modules/bowser/.idea/markdown-exported-files.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/markdown-navigator.xml b/node_modules/bowser/.idea/markdown-navigator.xml new file mode 100644 index 0000000..05e6c4b --- /dev/null +++ b/node_modules/bowser/.idea/markdown-navigator.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/markdown-navigator/profiles_settings.xml b/node_modules/bowser/.idea/markdown-navigator/profiles_settings.xml new file mode 100644 index 0000000..57927c5 --- /dev/null +++ b/node_modules/bowser/.idea/markdown-navigator/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/misc.xml b/node_modules/bowser/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/node_modules/bowser/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/modules.xml b/node_modules/bowser/.idea/modules.xml new file mode 100644 index 0000000..d90ae6d --- /dev/null +++ b/node_modules/bowser/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/vcs.xml b/node_modules/bowser/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/node_modules/bowser/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/watcherTasks.xml b/node_modules/bowser/.idea/watcherTasks.xml new file mode 100644 index 0000000..9338ba6 --- /dev/null +++ b/node_modules/bowser/.idea/watcherTasks.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/node_modules/bowser/.idea/workspace.xml b/node_modules/bowser/.idea/workspace.xml new file mode 100644 index 0000000..06355d4 --- /dev/null +++ b/node_modules/bowser/.idea/workspace.xml @@ -0,0 +1,696 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + chromium: true + flag + msedge + edge + Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1 + version: "" + Mozilla/5.0 (iPod touch; CPU iPhone OS 9_3_4 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) OPiOS/14.0.0.104835 Mobile/13G35 Safari/9537.53 + undefi + ios + mobi + husky + safari + w + x + tablet + we + webos + parse + parseBrowser + @priva + parsedResult + Parser + spy + ge + parseEngine + engin + ava + getWindowsVersionName + android + _parsed + + + descript + describe + (\d+(\.?_?\d+)+) + + + + + + + + + + + + + true + + true + true + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + '); + res.end(''); +} + +http.createServer(onRequest).listen(3000); +``` + +## Testing + +```sh +$ npm test +``` + +## Benchmark + +``` +$ npm run bench + +> cookie@0.5.0 bench +> node benchmark/index.js + + node@18.18.2 + acorn@8.10.0 + ada@2.6.0 + ares@1.19.1 + brotli@1.0.9 + cldr@43.1 + icu@73.2 + llhttp@6.0.11 + modules@108 + napi@9 + nghttp2@1.57.0 + nghttp3@0.7.0 + ngtcp2@0.8.1 + openssl@3.0.10+quic + simdutf@3.2.14 + tz@2023c + undici@5.26.3 + unicode@15.0 + uv@1.44.2 + uvwasi@0.0.18 + v8@10.2.154.26-node.26 + zlib@1.2.13.1-motley + +> node benchmark/parse-top.js + + cookie.parse - top sites + + 14 tests completed. + + parse accounts.google.com x 2,588,913 ops/sec ±0.74% (186 runs sampled) + parse apple.com x 2,370,002 ops/sec ±0.69% (186 runs sampled) + parse cloudflare.com x 2,213,102 ops/sec ±0.88% (188 runs sampled) + parse docs.google.com x 2,194,157 ops/sec ±1.03% (184 runs sampled) + parse drive.google.com x 2,265,084 ops/sec ±0.79% (187 runs sampled) + parse en.wikipedia.org x 457,099 ops/sec ±0.81% (186 runs sampled) + parse linkedin.com x 504,407 ops/sec ±0.89% (186 runs sampled) + parse maps.google.com x 1,230,959 ops/sec ±0.98% (186 runs sampled) + parse microsoft.com x 926,294 ops/sec ±0.88% (184 runs sampled) + parse play.google.com x 2,311,338 ops/sec ±0.83% (185 runs sampled) + parse support.google.com x 1,508,850 ops/sec ±0.86% (186 runs sampled) + parse www.google.com x 1,022,582 ops/sec ±1.32% (182 runs sampled) + parse youtu.be x 332,136 ops/sec ±1.02% (185 runs sampled) + parse youtube.com x 323,833 ops/sec ±0.77% (183 runs sampled) + +> node benchmark/parse.js + + cookie.parse - generic + + 6 tests completed. + + simple x 3,214,032 ops/sec ±1.61% (183 runs sampled) + decode x 587,237 ops/sec ±1.16% (187 runs sampled) + unquote x 2,954,618 ops/sec ±1.35% (183 runs sampled) + duplicates x 857,008 ops/sec ±0.89% (187 runs sampled) + 10 cookies x 292,133 ops/sec ±0.89% (187 runs sampled) + 100 cookies x 22,610 ops/sec ±0.68% (187 runs sampled) +``` + +## References + +- [RFC 6265: HTTP State Management Mechanism][rfc-6265] +- [Same-site Cookies][rfc-6265bis-09-5.4.7] + +[rfc-cutler-httpbis-partitioned-cookies]: https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/ +[rfc-west-cookie-priority-00-4.1]: https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1 +[rfc-6265bis-09-5.4.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7 +[rfc-6265]: https://tools.ietf.org/html/rfc6265 +[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4 +[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1 +[rfc-6265-5.2.2]: https://tools.ietf.org/html/rfc6265#section-5.2.2 +[rfc-6265-5.2.3]: https://tools.ietf.org/html/rfc6265#section-5.2.3 +[rfc-6265-5.2.4]: https://tools.ietf.org/html/rfc6265#section-5.2.4 +[rfc-6265-5.2.5]: https://tools.ietf.org/html/rfc6265#section-5.2.5 +[rfc-6265-5.2.6]: https://tools.ietf.org/html/rfc6265#section-5.2.6 +[rfc-6265-5.3]: https://tools.ietf.org/html/rfc6265#section-5.3 + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/cookie/master?label=ci +[ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master +[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master +[node-image]: https://badgen.net/npm/node/cookie +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/cookie +[npm-url]: https://npmjs.org/package/cookie +[npm-version-image]: https://badgen.net/npm/v/cookie diff --git a/node_modules/cookie/SECURITY.md b/node_modules/cookie/SECURITY.md new file mode 100644 index 0000000..fd4a6c5 --- /dev/null +++ b/node_modules/cookie/SECURITY.md @@ -0,0 +1,25 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `cookie` team and community take all security bugs seriously. Thank +you for improving the security of the project. We appreciate your efforts and +responsible disclosure and will make every effort to acknowledge your +contributions. + +Report security bugs by emailing the current owner(s) of `cookie`. This +information can be found in the npm registry using the command +`npm owner ls cookie`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/jshttp/cookie/issues) +asking for the current contact information. + +To ensure the timely response to your report, please ensure that the entirety +of the report is contained within the email body and not solely behind a web +link or an attachment. + +At least one owner will acknowledge your email within 48 hours, and will send a +more detailed response within 48 hours indicating the next steps in handling +your report. After the initial reply to your report, the owners will +endeavor to keep you informed of the progress towards a fix and full +announcement, and may ask for additional information or guidance. diff --git a/node_modules/cookie/index.js b/node_modules/cookie/index.js new file mode 100644 index 0000000..acd5acd --- /dev/null +++ b/node_modules/cookie/index.js @@ -0,0 +1,335 @@ +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +exports.parse = parse; +exports.serialize = serialize; + +/** + * Module variables. + * @private + */ + +var __toString = Object.prototype.toString +var __hasOwnProperty = Object.prototype.hasOwnProperty + +/** + * RegExp to match cookie-name in RFC 6265 sec 4.1.1 + * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2 + * which has been replaced by the token definition in RFC 7230 appendix B. + * + * cookie-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / + * "*" / "+" / "-" / "." / "^" / "_" / + * "`" / "|" / "~" / DIGIT / ALPHA + */ + +var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; + +/** + * RegExp to match cookie-value in RFC 6265 sec 4.1.1 + * + * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) + * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E + * ; US-ASCII characters excluding CTLs, + * ; whitespace DQUOTE, comma, semicolon, + * ; and backslash + */ + +var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/; + +/** + * RegExp to match domain-value in RFC 6265 sec 4.1.1 + * + * domain-value = + * ; defined in [RFC1034], Section 3.5, as + * ; enhanced by [RFC1123], Section 2.1 + * =
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/node_modules/dateformat/.vs/node-dateformat/v15/.suo b/node_modules/dateformat/.vs/node-dateformat/v15/.suo new file mode 100644 index 0000000..645dc3d Binary files /dev/null and b/node_modules/dateformat/.vs/node-dateformat/v15/.suo differ diff --git a/node_modules/dateformat/.vs/slnx.sqlite b/node_modules/dateformat/.vs/slnx.sqlite new file mode 100644 index 0000000..96a2204 Binary files /dev/null and b/node_modules/dateformat/.vs/slnx.sqlite differ diff --git a/node_modules/dateformat/LICENSE b/node_modules/dateformat/LICENSE new file mode 100644 index 0000000..57d44e2 --- /dev/null +++ b/node_modules/dateformat/LICENSE @@ -0,0 +1,20 @@ +(c) 2007-2009 Steven Levithan + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/dateformat/Readme.md b/node_modules/dateformat/Readme.md new file mode 100644 index 0000000..f16f789 --- /dev/null +++ b/node_modules/dateformat/Readme.md @@ -0,0 +1,134 @@ +# dateformat + +A node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function. + +[![Build Status](https://travis-ci.org/felixge/node-dateformat.svg)](https://travis-ci.org/felixge/node-dateformat) + +## Modifications + +* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers. +* Added a `module.exports = dateFormat;` statement at the bottom +* Added the placeholder `N` to get the ISO 8601 numeric representation of the day of the week + +## Installation + +```bash +$ npm install dateformat +$ dateformat --help +``` + +## Usage + +As taken from Steven's post, modified to match the Modifications listed above: +```js +var dateFormat = require('dateformat'); +var now = new Date(); + +// Basic usage +dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT"); +// Saturday, June 9th, 2007, 5:46:21 PM + +// You can use one of several named masks +dateFormat(now, "isoDateTime"); +// 2007-06-09T17:46:21 + +// ...Or add your own +dateFormat.masks.hammerTime = 'HH:MM! "Can\'t touch this!"'; +dateFormat(now, "hammerTime"); +// 17:46! Can't touch this! + +// You can also provide the date as a string +dateFormat("Jun 9 2007", "fullDate"); +// Saturday, June 9, 2007 + +// Note that if you don't include the mask argument, +// dateFormat.masks.default is used +dateFormat(now); +// Sat Jun 09 2007 17:46:21 + +// And if you don't include the date argument, +// the current date and time is used +dateFormat(); +// Sat Jun 09 2007 17:46:22 + +// You can also skip the date argument (as long as your mask doesn't +// contain any numbers), in which case the current date/time is used +dateFormat("longTime"); +// 5:46:22 PM EST + +// And finally, you can convert local time to UTC time. Simply pass in +// true as an additional argument (no argument skipping allowed in this case): +dateFormat(now, "longTime", true); +// 10:46:21 PM UTC + +// ...Or add the prefix "UTC:" or "GMT:" to your mask. +dateFormat(now, "UTC:h:MM:ss TT Z"); +// 10:46:21 PM UTC + +// You can also get the ISO 8601 week of the year: +dateFormat(now, "W"); +// 42 + +// and also get the ISO 8601 numeric representation of the day of the week: +dateFormat(now,"N"); +// 6 +``` + +### Mask options + +Mask | Description +---- | ----------- +`d` | Day of the month as digits; no leading zero for single-digit days. +`dd` | Day of the month as digits; leading zero for single-digit days. +`ddd` | Day of the week as a three-letter abbreviation. +`dddd` | Day of the week as its full name. +`m` | Month as digits; no leading zero for single-digit months. +`mm` | Month as digits; leading zero for single-digit months. +`mmm` | Month as a three-letter abbreviation. +`mmmm` | Month as its full name. +`yy` | Year as last two digits; leading zero for years less than 10. +`yyyy` | Year represented by four digits. +`h` | Hours; no leading zero for single-digit hours (12-hour clock). +`hh` | Hours; leading zero for single-digit hours (12-hour clock). +`H` | Hours; no leading zero for single-digit hours (24-hour clock). +`HH` | Hours; leading zero for single-digit hours (24-hour clock). +`M` | Minutes; no leading zero for single-digit minutes. +`MM` | Minutes; leading zero for single-digit minutes. +`N` | ISO 8601 numeric representation of the day of the week. +`o` | GMT/UTC timezone offset, e.g. -0500 or +0230. +`s` | Seconds; no leading zero for single-digit seconds. +`ss` | Seconds; leading zero for single-digit seconds. +`S` | The date's ordinal suffix (st, nd, rd, or th). Works well with `d`. +`l` | Milliseconds; gives 3 digits. +`L` | Milliseconds; gives 2 digits. +`t` | Lowercase, single-character time marker string: a or p. +`tt` | Lowercase, two-character time marker string: am or pm. +`T` | Uppercase, single-character time marker string: A or P. +`TT` | Uppercase, two-character time marker string: AM or PM. +`W` | ISO 8601 week number of the year, e.g. 42 +`Z` | US timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the +`'...'`, `"..."` | Literal character sequence. Surrounding quotes are removed. +`UTC:` | Must be the first four characters of the mask. Converts the date from local time to UTC/GMT/Zulu time before applying the mask. The "UTC:" prefix is removed. + +### Named Formats + +Name | Mask | Example +---- | ---- | ------- +`default` | `ddd mmm dd yyyy HH:MM:ss` | Sat Jun 09 2007 17:46:21 +`shortDate` | `m/d/yy` | 6/9/07 +`mediumDate` | `mmm d, yyyy` | Jun 9, 2007 +`longDate` | `mmmm d, yyyy` | June 9, 2007 +`fullDate` | `dddd, mmmm d, yyyy` | Saturday, June 9, 2007 +`shortTime` | `h:MM TT` | 5:46 PM +`mediumTime` | `h:MM:ss TT` | 5:46:21 PM +`longTime` | `h:MM:ss TT Z` | 5:46:21 PM EST +`isoDate` | `yyyy-mm-dd` | 2007-06-09 +`isoTime` | `HH:MM:ss` | 17:46:21 +`isoDateTime` | `yyyy-mm-dd'T'HH:MM:ss` | 2007-06-09T17:46:21 +`isoUtcDateTime` | `UTC:yyyy-mm-dd'T'HH:MM:ss'Z'` | 2007-06-09T22:46:21Z +## License + +(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license. + +[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format +[stevenlevithan]: http://stevenlevithan.com/ diff --git a/node_modules/dateformat/lib/dateformat.js b/node_modules/dateformat/lib/dateformat.js new file mode 100644 index 0000000..77cfb1f --- /dev/null +++ b/node_modules/dateformat/lib/dateformat.js @@ -0,0 +1,226 @@ +/* + * Date Format 1.2.3 + * (c) 2007-2009 Steven Levithan + * MIT license + * + * Includes enhancements by Scott Trenda + * and Kris Kowal + * + * Accepts a date, a mask, or a date and a mask. + * Returns a formatted version of the given date. + * The date defaults to the current date/time. + * The mask defaults to dateFormat.masks.default. + */ + +(function(global) { + 'use strict'; + + var dateFormat = (function() { + var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g; + var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g; + var timezoneClip = /[^-+\dA-Z]/g; + + // Regexes and supporting functions are cached through closure + return function (date, mask, utc, gmt) { + + // You can't provide utc if you skip other args (use the 'UTC:' mask prefix) + if (arguments.length === 1 && kindOf(date) === 'string' && !/\d/.test(date)) { + mask = date; + date = undefined; + } + + date = date || new Date; + + if(!(date instanceof Date)) { + date = new Date(date); + } + + if (isNaN(date)) { + throw TypeError('Invalid date'); + } + + mask = String(dateFormat.masks[mask] || mask || dateFormat.masks['default']); + + // Allow setting the utc/gmt argument via the mask + var maskSlice = mask.slice(0, 4); + if (maskSlice === 'UTC:' || maskSlice === 'GMT:') { + mask = mask.slice(4); + utc = true; + if (maskSlice === 'GMT:') { + gmt = true; + } + } + + var _ = utc ? 'getUTC' : 'get'; + var d = date[_ + 'Date'](); + var D = date[_ + 'Day'](); + var m = date[_ + 'Month'](); + var y = date[_ + 'FullYear'](); + var H = date[_ + 'Hours'](); + var M = date[_ + 'Minutes'](); + var s = date[_ + 'Seconds'](); + var L = date[_ + 'Milliseconds'](); + var o = utc ? 0 : date.getTimezoneOffset(); + var W = getWeek(date); + var N = getDayOfWeek(date); + var flags = { + d: d, + dd: pad(d), + ddd: dateFormat.i18n.dayNames[D], + dddd: dateFormat.i18n.dayNames[D + 7], + m: m + 1, + mm: pad(m + 1), + mmm: dateFormat.i18n.monthNames[m], + mmmm: dateFormat.i18n.monthNames[m + 12], + yy: String(y).slice(2), + yyyy: y, + h: H % 12 || 12, + hh: pad(H % 12 || 12), + H: H, + HH: pad(H), + M: M, + MM: pad(M), + s: s, + ss: pad(s), + l: pad(L, 3), + L: pad(Math.round(L / 10)), + t: H < 12 ? 'a' : 'p', + tt: H < 12 ? 'am' : 'pm', + T: H < 12 ? 'A' : 'P', + TT: H < 12 ? 'AM' : 'PM', + Z: gmt ? 'GMT' : utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''), + o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), + S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10], + W: W, + N: N + }; + + return mask.replace(token, function (match) { + if (match in flags) { + return flags[match]; + } + return match.slice(1, match.length - 1); + }); + }; + })(); + + dateFormat.masks = { + 'default': 'ddd mmm dd yyyy HH:MM:ss', + 'shortDate': 'm/d/yy', + 'mediumDate': 'mmm d, yyyy', + 'longDate': 'mmmm d, yyyy', + 'fullDate': 'dddd, mmmm d, yyyy', + 'shortTime': 'h:MM TT', + 'mediumTime': 'h:MM:ss TT', + 'longTime': 'h:MM:ss TT Z', + 'isoDate': 'yyyy-mm-dd', + 'isoTime': 'HH:MM:ss', + 'isoDateTime': 'yyyy-mm-dd\'T\'HH:MM:sso', + 'isoUtcDateTime': 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'', + 'expiresHeaderFormat': 'ddd, dd mmm yyyy HH:MM:ss Z' + }; + + // Internationalization strings + dateFormat.i18n = { + dayNames: [ + 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' + ], + monthNames: [ + 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', + 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' + ] + }; + +function pad(val, len) { + val = String(val); + len = len || 2; + while (val.length < len) { + val = '0' + val; + } + return val; +} + +/** + * Get the ISO 8601 week number + * Based on comments from + * http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html + * + * @param {Object} `date` + * @return {Number} + */ +function getWeek(date) { + // Remove time components of date + var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); + + // Change date to Thursday same week + targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3); + + // Take January 4th as it is always in week 1 (see ISO 8601) + var firstThursday = new Date(targetThursday.getFullYear(), 0, 4); + + // Change date to Thursday same week + firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3); + + // Check if daylight-saving-time-switch occurred and correct for it + var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset(); + targetThursday.setHours(targetThursday.getHours() - ds); + + // Number of weeks between target Thursday and first Thursday + var weekDiff = (targetThursday - firstThursday) / (86400000*7); + return 1 + Math.floor(weekDiff); +} + +/** + * Get ISO-8601 numeric representation of the day of the week + * 1 (for Monday) through 7 (for Sunday) + * + * @param {Object} `date` + * @return {Number} + */ +function getDayOfWeek(date) { + var dow = date.getDay(); + if(dow === 0) { + dow = 7; + } + return dow; +} + +/** + * kind-of shortcut + * @param {*} val + * @return {String} + */ +function kindOf(val) { + if (val === null) { + return 'null'; + } + + if (val === undefined) { + return 'undefined'; + } + + if (typeof val !== 'object') { + return typeof val; + } + + if (Array.isArray(val)) { + return 'array'; + } + + return {}.toString.call(val) + .slice(8, -1).toLowerCase(); +}; + + + + if (typeof define === 'function' && define.amd) { + define(function () { + return dateFormat; + }); + } else if (typeof exports === 'object') { + module.exports = dateFormat; + } else { + global.dateFormat = dateFormat; + } +})(this); diff --git a/node_modules/dateformat/package.json b/node_modules/dateformat/package.json new file mode 100644 index 0000000..44f44f2 --- /dev/null +++ b/node_modules/dateformat/package.json @@ -0,0 +1,30 @@ +{ + "name": "dateformat", + "description": "A node.js package for Steven Levithan's excellent dateFormat() function.", + "maintainers": "Felix Geisendörfer ", + "homepage": "https://github.com/felixge/node-dateformat", + "author": "Steven Levithan", + "contributors": [ + "Steven Levithan", + "Felix Geisendörfer ", + "Christoph Tavan ", + "Jon Schlinkert (https://github.com/jonschlinkert)" + ], + "version": "2.2.0", + "license": "MIT", + "main": "lib/dateformat", + "devDependencies": { + "underscore": "1.7.0", + "mocha": "2.0.1" + }, + "engines": { + "node": "*" + }, + "scripts": { + "test": "mocha" + }, + "repository": { + "type": "git", + "url": "https://github.com/felixge/node-dateformat.git" + } +} diff --git a/node_modules/debug/LICENSE b/node_modules/debug/LICENSE new file mode 100644 index 0000000..1a9820e --- /dev/null +++ b/node_modules/debug/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the 'Software'), to deal in the Software without restriction, +including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/debug/README.md b/node_modules/debug/README.md new file mode 100644 index 0000000..9ebdfbf --- /dev/null +++ b/node_modules/debug/README.md @@ -0,0 +1,481 @@ +# debug +[![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) +[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors) + + + +A tiny JavaScript debugging utility modelled after Node.js core's debugging +technique. Works in Node.js and web browsers. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + +`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole. + +Example [_app.js_](./examples/node/app.js): + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %o', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example [_worker.js_](./examples/node/worker.js): + +```js +var a = require('debug')('worker:a') + , b = require('debug')('worker:b'); + +function work() { + a('doing lots of uninteresting work'); + setTimeout(work, Math.random() * 1000); +} + +work(); + +function workb() { + b('doing some work'); + setTimeout(workb, Math.random() * 2000); +} + +workb(); +``` + +The `DEBUG` environment variable is then used to enable these based on space or +comma-delimited names. + +Here are some examples: + +screen shot 2017-08-08 at 12 53 04 pm +screen shot 2017-08-08 at 12 53 38 pm +screen shot 2017-08-08 at 12 53 25 pm + +#### Windows command prompt notes + +##### CMD + +On Windows the environment variable is set using the `set` command. + +```cmd +set DEBUG=*,-not_this +``` + +Example: + +```cmd +set DEBUG=* & node app.js +``` + +##### PowerShell (VS Code default) + +PowerShell uses different syntax to set environment variables. + +```cmd +$env:DEBUG = "*,-not_this" +``` + +Example: + +```cmd +$env:DEBUG='app';node app.js +``` + +Then, run the program to be debugged as usual. + +npm script example: +```js + "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js", +``` + +## Namespace Colors + +Every debug instance has a color generated for it based on its namespace name. +This helps when visually parsing the debug output to identify which debug instance +a debug line belongs to. + +#### Node.js + +In Node.js, colors are enabled when stderr is a TTY. You also _should_ install +the [`supports-color`](https://npmjs.org/supports-color) module alongside debug, +otherwise debug will only use a small handful of basic colors. + + + +#### Web Browser + +Colors are also enabled on "Web Inspectors" that understand the `%c` formatting +option. These are WebKit web inspectors, Firefox ([since version +31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) +and the Firebug plugin for Firefox (any version). + + + + +## Millisecond diff + +When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + + +When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below: + + + + +## Conventions + +If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output. + +## Wildcards + +The `*` character may be used as a wildcard. Suppose for example your library has +debuggers named "connect:bodyParser", "connect:compress", "connect:session", +instead of listing all three with +`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do +`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + +You can also exclude specific debuggers by prefixing them with a "-" character. +For example, `DEBUG=*,-connect:*` would include all debuggers except those +starting with "connect:". + +## Environment Variables + +When running through Node.js, you can set a few environment variables that will +change the behavior of the debug logging: + +| Name | Purpose | +|-----------|-------------------------------------------------| +| `DEBUG` | Enables/disables specific debugging namespaces. | +| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). | +| `DEBUG_COLORS`| Whether or not to use colors in the debug output. | +| `DEBUG_DEPTH` | Object inspection depth. | +| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. | + + +__Note:__ The environment variables beginning with `DEBUG_` end up being +converted into an Options object that gets used with `%o`/`%O` formatters. +See the Node.js documentation for +[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options) +for the complete list. + +## Formatters + +Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. +Below are the officially supported formatters: + +| Formatter | Representation | +|-----------|----------------| +| `%O` | Pretty-print an Object on multiple lines. | +| `%o` | Pretty-print an Object all on a single line. | +| `%s` | String. | +| `%d` | Number (both integer and float). | +| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. | +| `%%` | Single percent sign ('%'). This does not consume an argument. | + + +### Custom formatters + +You can add custom formatters by extending the `debug.formatters` object. +For example, if you wanted to add support for rendering a Buffer as hex with +`%h`, you could do something like: + +```js +const createDebug = require('debug') +createDebug.formatters.h = (v) => { + return v.toString('hex') +} + +// …elsewhere +const debug = createDebug('foo') +debug('this is hex: %h', new Buffer('hello world')) +// foo this is hex: 68656c6c6f20776f726c6421 +0ms +``` + + +## Browser Support + +You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify), +or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest), +if you don't want to build it yourself. + +Debug's enable state is currently persisted by `localStorage`. +Consider the situation shown below where you have `worker:a` and `worker:b`, +and wish to debug both. You can enable this using `localStorage.debug`: + +```js +localStorage.debug = 'worker:*' +``` + +And then refresh the page. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_. + + + +## Output streams + + By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method: + +Example [_stdout.js_](./examples/node/stdout.js): + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +## Extend +You can simply extend debugger +```js +const log = require('debug')('auth'); + +//creates new debug instance with extended namespace +const logSign = log.extend('sign'); +const logLogin = log.extend('login'); + +log('hello'); // auth hello +logSign('hello'); //auth:sign hello +logLogin('hello'); //auth:login hello +``` + +## Set dynamically + +You can also enable debug dynamically by calling the `enable()` method : + +```js +let debug = require('debug'); + +console.log(1, debug.enabled('test')); + +debug.enable('test'); +console.log(2, debug.enabled('test')); + +debug.disable(); +console.log(3, debug.enabled('test')); + +``` + +print : +``` +1 false +2 true +3 false +``` + +Usage : +`enable(namespaces)` +`namespaces` can include modes separated by a colon and wildcards. + +Note that calling `enable()` completely overrides previously set DEBUG variable : + +``` +$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))' +=> false +``` + +`disable()` + +Will disable all namespaces. The functions returns the namespaces currently +enabled (and skipped). This can be useful if you want to disable debugging +temporarily without knowing what was enabled to begin with. + +For example: + +```js +let debug = require('debug'); +debug.enable('foo:*,-foo:bar'); +let namespaces = debug.disable(); +debug.enable(namespaces); +``` + +Note: There is no guarantee that the string will be identical to the initial +enable string, but semantically they will be identical. + +## Checking whether a debug target is enabled + +After you've created a debug instance, you can determine whether or not it is +enabled by checking the `enabled` property: + +```javascript +const debug = require('debug')('http'); + +if (debug.enabled) { + // do stuff... +} +``` + +You can also manually toggle this property to force the debug instance to be +enabled or disabled. + +## Usage in child processes + +Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process. +For example: + +```javascript +worker = fork(WORKER_WRAP_PATH, [workerPath], { + stdio: [ + /* stdin: */ 0, + /* stdout: */ 'pipe', + /* stderr: */ 'pipe', + 'ipc', + ], + env: Object.assign({}, process.env, { + DEBUG_COLORS: 1 // without this settings, colors won't be shown + }), +}); + +worker.stderr.pipe(process.stderr, { end: false }); +``` + + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + - Andrew Rhyne + - Josh Junon + +## Backers + +Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Sponsors + +Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## License + +(The MIT License) + +Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca> +Copyright (c) 2018-2021 Josh Junon + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/debug/package.json b/node_modules/debug/package.json new file mode 100644 index 0000000..ee8abb5 --- /dev/null +++ b/node_modules/debug/package.json @@ -0,0 +1,64 @@ +{ + "name": "debug", + "version": "4.4.3", + "repository": { + "type": "git", + "url": "git://github.com/debug-js/debug.git" + }, + "description": "Lightweight debugging utility for Node.js and the browser", + "keywords": [ + "debug", + "log", + "debugger" + ], + "files": [ + "src", + "LICENSE", + "README.md" + ], + "author": "Josh Junon (https://github.com/qix-)", + "contributors": [ + "TJ Holowaychuk ", + "Nathan Rajlich (http://n8.io)", + "Andrew Rhyne " + ], + "license": "MIT", + "scripts": { + "lint": "xo", + "test": "npm run test:node && npm run test:browser && npm run lint", + "test:node": "mocha test.js test.node.js", + "test:browser": "karma start --single-run", + "test:coverage": "cat ./coverage/lcov.info | coveralls" + }, + "dependencies": { + "ms": "^2.1.3" + }, + "devDependencies": { + "brfs": "^2.0.1", + "browserify": "^16.2.3", + "coveralls": "^3.0.2", + "karma": "^3.1.4", + "karma-browserify": "^6.0.0", + "karma-chrome-launcher": "^2.2.0", + "karma-mocha": "^1.3.0", + "mocha": "^5.2.0", + "mocha-lcov-reporter": "^1.2.0", + "sinon": "^14.0.0", + "xo": "^0.23.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + }, + "main": "./src/index.js", + "browser": "./src/browser.js", + "engines": { + "node": ">=6.0" + }, + "xo": { + "rules": { + "import/extensions": "off" + } + } +} diff --git a/node_modules/debug/src/browser.js b/node_modules/debug/src/browser.js new file mode 100644 index 0000000..5993451 --- /dev/null +++ b/node_modules/debug/src/browser.js @@ -0,0 +1,272 @@ +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + let m; + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + // eslint-disable-next-line no-return-assign + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; diff --git a/node_modules/debug/src/common.js b/node_modules/debug/src/common.js new file mode 100644 index 0000000..141cb57 --- /dev/null +++ b/node_modules/debug/src/common.js @@ -0,0 +1,292 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + const split = (typeof namespaces === 'string' ? namespaces : '') + .trim() + .replace(/\s+/g, ',') + .split(',') + .filter(Boolean); + + for (const ns of split) { + if (ns[0] === '-') { + createDebug.skips.push(ns.slice(1)); + } else { + createDebug.names.push(ns); + } + } + } + + /** + * Checks if the given string matches a namespace template, honoring + * asterisks as wildcards. + * + * @param {String} search + * @param {String} template + * @return {Boolean} + */ + function matchesTemplate(search, template) { + let searchIndex = 0; + let templateIndex = 0; + let starIndex = -1; + let matchIndex = 0; + + while (searchIndex < search.length) { + if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { + // Match character or proceed with wildcard + if (template[templateIndex] === '*') { + starIndex = templateIndex; + matchIndex = searchIndex; + templateIndex++; // Skip the '*' + } else { + searchIndex++; + templateIndex++; + } + } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition + // Backtrack to the last '*' and try to match more characters + templateIndex = starIndex + 1; + matchIndex++; + searchIndex = matchIndex; + } else { + return false; // No match + } + } + + // Handle trailing '*' in template + while (templateIndex < template.length && template[templateIndex] === '*') { + templateIndex++; + } + + return templateIndex === template.length; + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } + } + + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + + return false; + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; diff --git a/node_modules/debug/src/index.js b/node_modules/debug/src/index.js new file mode 100644 index 0000000..bf4c57f --- /dev/null +++ b/node_modules/debug/src/index.js @@ -0,0 +1,10 @@ +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = require('./browser.js'); +} else { + module.exports = require('./node.js'); +} diff --git a/node_modules/debug/src/node.js b/node_modules/debug/src/node.js new file mode 100644 index 0000000..715560a --- /dev/null +++ b/node_modules/debug/src/node.js @@ -0,0 +1,263 @@ +/** + * Module dependencies. + */ + +const tty = require('tty'); +const util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + */ + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.destroy = util.deprecate( + () => {}, + 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' +); + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = require('supports-color'); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .split('\n') + .map(str => str.trim()) + .join(' '); +}; + +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; diff --git a/node_modules/decamelize/index.js b/node_modules/decamelize/index.js new file mode 100644 index 0000000..8d5bab7 --- /dev/null +++ b/node_modules/decamelize/index.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = function (str, sep) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + sep = typeof sep === 'undefined' ? '_' : sep; + + return str + .replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2') + .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2') + .toLowerCase(); +}; diff --git a/node_modules/decamelize/license b/node_modules/decamelize/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/decamelize/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/decamelize/package.json b/node_modules/decamelize/package.json new file mode 100644 index 0000000..ca35790 --- /dev/null +++ b/node_modules/decamelize/package.json @@ -0,0 +1,38 @@ +{ + "name": "decamelize", + "version": "1.2.0", + "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow", + "license": "MIT", + "repository": "sindresorhus/decamelize", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "decamelize", + "decamelcase", + "camelcase", + "lowercase", + "case", + "dash", + "hyphen", + "string", + "str", + "text", + "convert" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/node_modules/decamelize/readme.md b/node_modules/decamelize/readme.md new file mode 100644 index 0000000..624c7ee --- /dev/null +++ b/node_modules/decamelize/readme.md @@ -0,0 +1,48 @@ +# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize) + +> Convert a camelized string into a lowercased one with a custom separator
+> Example: `unicornRainbow` → `unicorn_rainbow` + + +## Install + +``` +$ npm install --save decamelize +``` + + +## Usage + +```js +const decamelize = require('decamelize'); + +decamelize('unicornRainbow'); +//=> 'unicorn_rainbow' + +decamelize('unicornRainbow', '-'); +//=> 'unicorn-rainbow' +``` + + +## API + +### decamelize(input, [separator]) + +#### input + +Type: `string` + +#### separator + +Type: `string`
+Default: `_` + + +## Related + +See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/default-require-extensions/js.js b/node_modules/default-require-extensions/js.js new file mode 100644 index 0000000..5101f2e --- /dev/null +++ b/node_modules/default-require-extensions/js.js @@ -0,0 +1,8 @@ +'use strict'; +const fs = require('fs'); +const stripBom = require('strip-bom'); + +module.exports = (module, filename) => { + const content = fs.readFileSync(filename, 'utf8'); + module._compile(stripBom(content), filename); +}; diff --git a/node_modules/default-require-extensions/json.js b/node_modules/default-require-extensions/json.js new file mode 100644 index 0000000..46130c3 --- /dev/null +++ b/node_modules/default-require-extensions/json.js @@ -0,0 +1,14 @@ +'use strict'; +const fs = require('fs'); +const stripBom = require('strip-bom'); + +module.exports = (module, filename) => { + const content = fs.readFileSync(filename, 'utf8'); + + try { + module.exports = JSON.parse(stripBom(content)); + } catch (error) { + error.message = `${filename}: ${error.message}`; + throw error; + } +}; diff --git a/node_modules/default-require-extensions/license b/node_modules/default-require-extensions/license new file mode 100644 index 0000000..445135c --- /dev/null +++ b/node_modules/default-require-extensions/license @@ -0,0 +1,11 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) +Copyright (c) James Talmage (https://github.com/jamestalmage) +Copyright (c) Node.js contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/default-require-extensions/package.json b/node_modules/default-require-extensions/package.json new file mode 100644 index 0000000..1625081 --- /dev/null +++ b/node_modules/default-require-extensions/package.json @@ -0,0 +1,43 @@ +{ + "name": "default-require-extensions", + "version": "3.0.1", + "description": "Node's default require extensions as a separate module", + "license": "MIT", + "repository": "avajs/default-require-extensions", + "funding": "https://github.com/sponsors/sindresorhus", + "main": "js.js", + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "files": [ + "js.js", + "json.js" + ], + "keywords": [ + "require", + "extension", + "default", + "node" + ], + "dependencies": { + "strip-bom": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.3.0", + "nyc": "^14.1.1", + "xo": "^0.24.0" + }, + "nyc": { + "exclude": [ + "fixture" + ] + }, + "xo": { + "rules": { + "import/extensions": "off" + } + } +} diff --git a/node_modules/default-require-extensions/readme.md b/node_modules/default-require-extensions/readme.md new file mode 100644 index 0000000..6826b81 --- /dev/null +++ b/node_modules/default-require-extensions/readme.md @@ -0,0 +1,27 @@ +# default-require-extensions + +> Node's default require extensions as a separate module + +Handy for require extension authors that want reliable access to the default extension implementations. + +By the time your extension is loaded, the default extension may have already been replaced. This provides extensions functionally identical to the default ones, which you know you can access reliably, no matter what extensions have been installed previously. + +**This package is not compatible with ESM.** + +## Install + +```sh +npm install default-require-extensions +``` + +## Usage + +```js +const js = require('default-require-extensions/js'); +const json = require('default-require-extensions/json'); + +require.extensions['.js'] = js; +require.extensions['.js'] = json; +``` + +*Note:* You would never actually do the above. Use these in your custom require extensions instead. diff --git a/node_modules/default-user-agent/History.md b/node_modules/default-user-agent/History.md new file mode 100644 index 0000000..68f9ee9 --- /dev/null +++ b/node_modules/default-user-agent/History.md @@ -0,0 +1,11 @@ + +1.0.0 / 2015-08-06 +================== + + * use npm scripts + * added os-name package + +0.0.1 / 2014-03-13 +================== + + * first commit diff --git a/node_modules/default-user-agent/LICENSE.txt b/node_modules/default-user-agent/LICENSE.txt new file mode 100644 index 0000000..e379174 --- /dev/null +++ b/node_modules/default-user-agent/LICENSE.txt @@ -0,0 +1,22 @@ +This software is licensed under the MIT License. + +Copyright (C) 2014 fengmk2 and other contributors +Copyright (C) 2015 node-modules + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/default-user-agent/README.md b/node_modules/default-user-agent/README.md new file mode 100644 index 0000000..f268621 --- /dev/null +++ b/node_modules/default-user-agent/README.md @@ -0,0 +1,47 @@ +default-user-agent +======= + +[![NPM version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Gittip][gittip-image]][gittip-url] +[![David deps][david-image]][david-url] +[![npm download][download-image]][download-url] + +[npm-image]: https://img.shields.io/npm/v/default-user-agent.svg?style=flat-square +[npm-url]: https://npmjs.org/package/default-user-agent +[travis-image]: https://img.shields.io/travis/node-modules/default-user-agent.svg?style=flat-square +[travis-url]: https://travis-ci.org/node-modules/default-user-agent +[coveralls-image]: https://img.shields.io/coveralls/node-modules/default-user-agent.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/node-modules/default-user-agent?branch=master +[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square +[gittip-url]: https://www.gittip.com/fengmk2/ +[david-image]: https://img.shields.io/david/node-modules/default-user-agent.svg?style=flat-square +[david-url]: https://david-dm.org/node-modules/default-user-agent +[download-image]: https://img.shields.io/npm/dm/default-user-agent.svg?style=flat-square +[download-url]: https://npmjs.org/package/default-user-agent + +Default user agent string for Node.js http request + +## Install + +```bash +$ npm install default-user-agent +``` + +## Usage + +```js +var ua = require('default-user-agent'); + +// darwin +console.log(ua()); // 'Node.js/0.11.15 (OS X Yosemite; x64)' +console.log(ua('urllib', '0.0.1')); // 'urllib/0.0.1 Node.js/0.11.15 (OS X Yosemite; x64)' + +// linux +// 'Node.js/0.11.15 (Linux 3.13; x64)' +``` + +## License + +[MIT](LICENSE.txt) diff --git a/node_modules/default-user-agent/index.js b/node_modules/default-user-agent/index.js new file mode 100644 index 0000000..1080375 --- /dev/null +++ b/node_modules/default-user-agent/index.js @@ -0,0 +1,27 @@ +/**! + * default-user-agent - index.js + * + * Copyright(c) fengmk2 and other contributors. + * MIT Licensed + * + * Authors: + * fengmk2 (http://fengmk2.com) + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var osName = require('os-name'); + +var USER_AGENT = 'Node.js/' + process.version.slice(1) + + ' (' + osName() + '; ' + process.arch + ')'; + +module.exports = function ua(name, version) { + if (arguments.length !== 2) { + return USER_AGENT; + } + return name + '/' + version + ' ' + USER_AGENT; +}; diff --git a/node_modules/default-user-agent/package.json b/node_modules/default-user-agent/package.json new file mode 100644 index 0000000..7eb5767 --- /dev/null +++ b/node_modules/default-user-agent/package.json @@ -0,0 +1,52 @@ +{ + "name": "default-user-agent", + "version": "1.0.0", + "description": "Default user agent string for nodejs http request", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "mocha --check-leaks -R spec -t 5000 test/*.test.js", + "test-cov": "istanbul cover node_modules/.bin/_mocha -- --check-leaks -t 5000 test/*.test.js", + "test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --check-leaks -t 5000 test/*.test.js", + "lint": "jshint .", + "autod": "autod -w --prefix '~'", + "cnpm": "npm install --registry=https://registry.npm.taobao.org", + "contributors": "contributors -f plain -o AUTHORS" + }, + "dependencies": { + "os-name": "~1.0.3" + }, + "devDependencies": { + "autod": "*", + "contributors": "*", + "should": "*", + "jshint": "*", + "cov": "*", + "istanbul": "*", + "mocha": "*" + }, + "homepage": "https://github.com/node-modules/default-user-agent", + "repository": { + "type": "git", + "url": "git://github.com/node-modules/default-user-agent.git", + "web": "https://github.com/node-modules/default-user-agent" + }, + "bugs": { + "url": "https://github.com/node-modules/default-user-agent/issues", + "email": "fengmk2@gmail.com" + }, + "keywords": [ + "user-agent", + "ua", + "useragent", + "request", + "http" + ], + "engines": { + "node": ">= 0.10.0" + }, + "author": "fengmk2 (http://fengmk2.com)", + "license": "MIT" +} diff --git a/node_modules/delayed-stream/.npmignore b/node_modules/delayed-stream/.npmignore new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/node_modules/delayed-stream/.npmignore @@ -0,0 +1 @@ +test diff --git a/node_modules/delayed-stream/License b/node_modules/delayed-stream/License new file mode 100644 index 0000000..4804b7a --- /dev/null +++ b/node_modules/delayed-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/delayed-stream/Makefile b/node_modules/delayed-stream/Makefile new file mode 100644 index 0000000..b4ff85a --- /dev/null +++ b/node_modules/delayed-stream/Makefile @@ -0,0 +1,7 @@ +SHELL := /bin/bash + +test: + @./test/run.js + +.PHONY: test + diff --git a/node_modules/delayed-stream/Readme.md b/node_modules/delayed-stream/Readme.md new file mode 100644 index 0000000..aca36f9 --- /dev/null +++ b/node_modules/delayed-stream/Readme.md @@ -0,0 +1,141 @@ +# delayed-stream + +Buffers events from a stream until you are ready to handle them. + +## Installation + +``` bash +npm install delayed-stream +``` + +## Usage + +The following example shows how to write a http echo server that delays its +response by 1000 ms. + +``` javascript +var DelayedStream = require('delayed-stream'); +var http = require('http'); + +http.createServer(function(req, res) { + var delayed = DelayedStream.create(req); + + setTimeout(function() { + res.writeHead(200); + delayed.pipe(res); + }, 1000); +}); +``` + +If you are not using `Stream#pipe`, you can also manually release the buffered +events by calling `delayedStream.resume()`: + +``` javascript +var delayed = DelayedStream.create(req); + +setTimeout(function() { + // Emit all buffered events and resume underlaying source + delayed.resume(); +}, 1000); +``` + +## Implementation + +In order to use this meta stream properly, here are a few things you should +know about the implementation. + +### Event Buffering / Proxying + +All events of the `source` stream are hijacked by overwriting the `source.emit` +method. Until node implements a catch-all event listener, this is the only way. + +However, delayed-stream still continues to emit all events it captures on the +`source`, regardless of whether you have released the delayed stream yet or +not. + +Upon creation, delayed-stream captures all `source` events and stores them in +an internal event buffer. Once `delayedStream.release()` is called, all +buffered events are emitted on the `delayedStream`, and the event buffer is +cleared. After that, delayed-stream merely acts as a proxy for the underlaying +source. + +### Error handling + +Error events on `source` are buffered / proxied just like any other events. +However, `delayedStream.create` attaches a no-op `'error'` listener to the +`source`. This way you only have to handle errors on the `delayedStream` +object, rather than in two places. + +### Buffer limits + +delayed-stream provides a `maxDataSize` property that can be used to limit +the amount of data being buffered. In order to protect you from bad `source` +streams that don't react to `source.pause()`, this feature is enabled by +default. + +## API + +### DelayedStream.create(source, [options]) + +Returns a new `delayedStream`. Available options are: + +* `pauseStream` +* `maxDataSize` + +The description for those properties can be found below. + +### delayedStream.source + +The `source` stream managed by this object. This is useful if you are +passing your `delayedStream` around, and you still want to access properties +on the `source` object. + +### delayedStream.pauseStream = true + +Whether to pause the underlaying `source` when calling +`DelayedStream.create()`. Modifying this property afterwards has no effect. + +### delayedStream.maxDataSize = 1024 * 1024 + +The amount of data to buffer before emitting an `error`. + +If the underlaying source is emitting `Buffer` objects, the `maxDataSize` +refers to bytes. + +If the underlaying source is emitting JavaScript strings, the size refers to +characters. + +If you know what you are doing, you can set this property to `Infinity` to +disable this feature. You can also modify this property during runtime. + +### delayedStream.dataSize = 0 + +The amount of data buffered so far. + +### delayedStream.readable + +An ECMA5 getter that returns the value of `source.readable`. + +### delayedStream.resume() + +If the `delayedStream` has not been released so far, `delayedStream.release()` +is called. + +In either case, `source.resume()` is called. + +### delayedStream.pause() + +Calls `source.pause()`. + +### delayedStream.pipe(dest) + +Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. + +### delayedStream.release() + +Emits and clears all events that have been buffered up so far. This does not +resume the underlaying source, use `delayedStream.resume()` instead. + +## License + +delayed-stream is licensed under the MIT license. diff --git a/node_modules/delayed-stream/lib/delayed_stream.js b/node_modules/delayed-stream/lib/delayed_stream.js new file mode 100644 index 0000000..b38fc85 --- /dev/null +++ b/node_modules/delayed-stream/lib/delayed_stream.js @@ -0,0 +1,107 @@ +var Stream = require('stream').Stream; +var util = require('util'); + +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util.inherits(DelayedStream, Stream); + +DelayedStream.create = function(source, options) { + var delayedStream = new this(); + + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } + + delayedStream.source = source; + + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; + + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } + + return delayedStream; +}; + +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); + +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; + +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } + + this.source.resume(); +}; + +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; + +DelayedStream.prototype.release = function() { + this._released = true; + + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; + +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; + +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } + + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } + + this._bufferedEvents.push(args); +}; + +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + + if (this.dataSize <= this.maxDataSize) { + return; + } + + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; diff --git a/node_modules/delayed-stream/package.json b/node_modules/delayed-stream/package.json new file mode 100644 index 0000000..eea3291 --- /dev/null +++ b/node_modules/delayed-stream/package.json @@ -0,0 +1,27 @@ +{ + "author": "Felix Geisendörfer (http://debuggable.com/)", + "contributors": [ + "Mike Atkins " + ], + "name": "delayed-stream", + "description": "Buffers events from a stream until you are ready to handle them.", + "license": "MIT", + "version": "1.0.0", + "homepage": "https://github.com/felixge/node-delayed-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-delayed-stream.git" + }, + "main": "./lib/delayed_stream", + "engines": { + "node": ">=0.4.0" + }, + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + } +} diff --git a/node_modules/denque/CHANGELOG.md b/node_modules/denque/CHANGELOG.md new file mode 100644 index 0000000..391a1f5 --- /dev/null +++ b/node_modules/denque/CHANGELOG.md @@ -0,0 +1,29 @@ +## 2.1.0 + + - fix: issue where `clear()` is still keeping references to the elements (#47) + - refactor: performance optimizations for growth and array copy (#43) + - refactor: performance optimizations for toArray and fromArray (#46) + - test: add additional benchmarks for queue growth and `toArray` (#45) + +## 2.0.1 + + - fix(types): incorrect return type on `size()` + +## 2.0.0 + + - fix!: `push` & `unshift` now accept `undefined` values to match behaviour of `Array` (fixes #25) (#35) + - This is only a **BREAKING** change if you are currently expecting `push(undefined)` and `unshift(undefined)` to do + nothing - the new behaviour now correctly adds undefined values to the queue. + - **Note**: behaviour of `push()` & `unshift()` (no arguments) remains unchanged (nothing gets added to the queue). + - **Note**: If you need to differentiate between `undefined` values in the queue and the return value of `pop()` then + check the queue `.length` before popping. + - fix: incorrect methods in types definition file + +## 1.5.1 + + - perf: minor performance tweak when growing queue size (#29) + +## 1.5.0 + + - feat: adds capacity option for circular buffers (#27) + diff --git a/node_modules/denque/LICENSE b/node_modules/denque/LICENSE new file mode 100644 index 0000000..c9cde92 --- /dev/null +++ b/node_modules/denque/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-present Invertase Limited + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/denque/README.md b/node_modules/denque/README.md new file mode 100644 index 0000000..3c645d3 --- /dev/null +++ b/node_modules/denque/README.md @@ -0,0 +1,77 @@ +

+

Denque

+

+ +

+ NPM downloads + NPM version + Tests status + Coverage + License + Follow on Twitter +

+ +Denque is a well tested, extremely fast and lightweight [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) +implementation with zero dependencies and includes TypeScript types. + +Double-ended queues can also be used as a: + +- [Stack](http://en.wikipedia.org/wiki/Stack_\(abstract_data_type\)) +- [Queue](http://en.wikipedia.org/wiki/Queue_\(data_structure\)) + +This implementation is currently the fastest available, even faster than `double-ended-queue`, see the [benchmarks](https://docs.page/invertase/denque/benchmarks). + +Every queue operation is done at a constant `O(1)` - including random access from `.peekAt(index)`. + +**Works on all node versions >= v0.10** + +## Quick Start + +Install the package: + +```bash +npm install denque +``` + +Create and consume a queue: + +```js +const Denque = require("denque"); + +const denque = new Denque([1,2,3,4]); +denque.shift(); // 1 +denque.pop(); // 4 +``` + + +See the [API reference documentation](https://docs.page/invertase/denque/api) for more examples. + +--- + +## Who's using it? + +- [Kafka Node.js client](https://www.npmjs.com/package/kafka-node) +- [MariaDB Node.js client](https://www.npmjs.com/package/mariadb) +- [MongoDB Node.js client](https://www.npmjs.com/package/mongodb) +- [MySQL Node.js client](https://www.npmjs.com/package/mysql2) +- [Redis Node.js clients](https://www.npmjs.com/package/redis) + +... and [many more](https://www.npmjs.com/browse/depended/denque). + + +--- + +## License + +- See [LICENSE](/LICENSE) + +--- + +

+ + + +

+ Built and maintained by Invertase. +

+

diff --git a/node_modules/denque/index.d.ts b/node_modules/denque/index.d.ts new file mode 100644 index 0000000..e125dd4 --- /dev/null +++ b/node_modules/denque/index.d.ts @@ -0,0 +1,47 @@ +declare class Denque { + length: number; + + constructor(); + + constructor(array: T[]); + + constructor(array: T[], options: IDenqueOptions); + + push(item: T): number; + + unshift(item: T): number; + + pop(): T | undefined; + + shift(): T | undefined; + + peekBack(): T | undefined; + + peekFront(): T | undefined; + + peekAt(index: number): T | undefined; + + get(index: number): T | undefined; + + remove(index: number, count: number): T[]; + + removeOne(index: number): T | undefined; + + splice(index: number, count: number, ...item: T[]): T[] | undefined; + + isEmpty(): boolean; + + clear(): void; + + size(): number; + + toString(): string; + + toArray(): T[]; +} + +interface IDenqueOptions { + capacity?: number +} + +export = Denque; diff --git a/node_modules/denque/index.js b/node_modules/denque/index.js new file mode 100644 index 0000000..6b2e9d8 --- /dev/null +++ b/node_modules/denque/index.js @@ -0,0 +1,481 @@ +'use strict'; + +/** + * Custom implementation of a double ended queue. + */ +function Denque(array, options) { + var options = options || {}; + this._capacity = options.capacity; + + this._head = 0; + this._tail = 0; + + if (Array.isArray(array)) { + this._fromArray(array); + } else { + this._capacityMask = 0x3; + this._list = new Array(4); + } +} + +/** + * -------------- + * PUBLIC API + * ------------- + */ + +/** + * Returns the item at the specified index from the list. + * 0 is the first element, 1 is the second, and so on... + * Elements at negative values are that many from the end: -1 is one before the end + * (the last element), -2 is two before the end (one before last), etc. + * @param index + * @returns {*} + */ +Denque.prototype.peekAt = function peekAt(index) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + var len = this.size(); + if (i >= len || i < -len) return undefined; + if (i < 0) i += len; + i = (this._head + i) & this._capacityMask; + return this._list[i]; +}; + +/** + * Alias for peekAt() + * @param i + * @returns {*} + */ +Denque.prototype.get = function get(i) { + return this.peekAt(i); +}; + +/** + * Returns the first item in the list without removing it. + * @returns {*} + */ +Denque.prototype.peek = function peek() { + if (this._head === this._tail) return undefined; + return this._list[this._head]; +}; + +/** + * Alias for peek() + * @returns {*} + */ +Denque.prototype.peekFront = function peekFront() { + return this.peek(); +}; + +/** + * Returns the item that is at the back of the queue without removing it. + * Uses peekAt(-1) + */ +Denque.prototype.peekBack = function peekBack() { + return this.peekAt(-1); +}; + +/** + * Returns the current length of the queue + * @return {Number} + */ +Object.defineProperty(Denque.prototype, 'length', { + get: function length() { + return this.size(); + } +}); + +/** + * Return the number of items on the list, or 0 if empty. + * @returns {number} + */ +Denque.prototype.size = function size() { + if (this._head === this._tail) return 0; + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Add an item at the beginning of the list. + * @param item + */ +Denque.prototype.unshift = function unshift(item) { + if (arguments.length === 0) return this.size(); + var len = this._list.length; + this._head = (this._head - 1 + len) & this._capacityMask; + this._list[this._head] = item; + if (this._tail === this._head) this._growArray(); + if (this._capacity && this.size() > this._capacity) this.pop(); + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Remove and return the first item on the list, + * Returns undefined if the list is empty. + * @returns {*} + */ +Denque.prototype.shift = function shift() { + var head = this._head; + if (head === this._tail) return undefined; + var item = this._list[head]; + this._list[head] = undefined; + this._head = (head + 1) & this._capacityMask; + if (head < 2 && this._tail > 10000 && this._tail <= this._list.length >>> 2) this._shrinkArray(); + return item; +}; + +/** + * Add an item to the bottom of the list. + * @param item + */ +Denque.prototype.push = function push(item) { + if (arguments.length === 0) return this.size(); + var tail = this._tail; + this._list[tail] = item; + this._tail = (tail + 1) & this._capacityMask; + if (this._tail === this._head) { + this._growArray(); + } + if (this._capacity && this.size() > this._capacity) { + this.shift(); + } + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Remove and return the last item on the list. + * Returns undefined if the list is empty. + * @returns {*} + */ +Denque.prototype.pop = function pop() { + var tail = this._tail; + if (tail === this._head) return undefined; + var len = this._list.length; + this._tail = (tail - 1 + len) & this._capacityMask; + var item = this._list[this._tail]; + this._list[this._tail] = undefined; + if (this._head < 2 && tail > 10000 && tail <= len >>> 2) this._shrinkArray(); + return item; +}; + +/** + * Remove and return the item at the specified index from the list. + * Returns undefined if the list is empty. + * @param index + * @returns {*} + */ +Denque.prototype.removeOne = function removeOne(index) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size) return void 0; + if (i < 0) i += size; + i = (this._head + i) & this._capacityMask; + var item = this._list[i]; + var k; + if (index < size / 2) { + for (k = index; k > 0; k--) { + this._list[i] = this._list[i = (i - 1 + len) & this._capacityMask]; + } + this._list[i] = void 0; + this._head = (this._head + 1 + len) & this._capacityMask; + } else { + for (k = size - 1 - index; k > 0; k--) { + this._list[i] = this._list[i = (i + 1 + len) & this._capacityMask]; + } + this._list[i] = void 0; + this._tail = (this._tail - 1 + len) & this._capacityMask; + } + return item; +}; + +/** + * Remove number of items from the specified index from the list. + * Returns array of removed items. + * Returns undefined if the list is empty. + * @param index + * @param count + * @returns {array} + */ +Denque.prototype.remove = function remove(index, count) { + var i = index; + var removed; + var del_count = count; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size || count < 1) return void 0; + if (i < 0) i += size; + if (count === 1 || !count) { + removed = new Array(1); + removed[0] = this.removeOne(i); + return removed; + } + if (i === 0 && i + count >= size) { + removed = this.toArray(); + this.clear(); + return removed; + } + if (i + count > size) count = size - i; + var k; + removed = new Array(count); + for (k = 0; k < count; k++) { + removed[k] = this._list[(this._head + i + k) & this._capacityMask]; + } + i = (this._head + i) & this._capacityMask; + if (index + count === size) { + this._tail = (this._tail - count + len) & this._capacityMask; + for (k = count; k > 0; k--) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + } + return removed; + } + if (index === 0) { + this._head = (this._head + count + len) & this._capacityMask; + for (k = count - 1; k > 0; k--) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + } + return removed; + } + if (i < size / 2) { + this._head = (this._head + index + count + len) & this._capacityMask; + for (k = index; k > 0; k--) { + this.unshift(this._list[i = (i - 1 + len) & this._capacityMask]); + } + i = (this._head - 1 + len) & this._capacityMask; + while (del_count > 0) { + this._list[i = (i - 1 + len) & this._capacityMask] = void 0; + del_count--; + } + if (index < 0) this._tail = i; + } else { + this._tail = i; + i = (i + count + len) & this._capacityMask; + for (k = size - (count + index); k > 0; k--) { + this.push(this._list[i++]); + } + i = this._tail; + while (del_count > 0) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + del_count--; + } + } + if (this._head < 2 && this._tail > 10000 && this._tail <= len >>> 2) this._shrinkArray(); + return removed; +}; + +/** + * Native splice implementation. + * Remove number of items from the specified index from the list and/or add new elements. + * Returns array of removed items or empty array if count == 0. + * Returns undefined if the list is empty. + * + * @param index + * @param count + * @param {...*} [elements] + * @returns {array} + */ +Denque.prototype.splice = function splice(index, count) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + var size = this.size(); + if (i < 0) i += size; + if (i > size) return void 0; + if (arguments.length > 2) { + var k; + var temp; + var removed; + var arg_len = arguments.length; + var len = this._list.length; + var arguments_index = 2; + if (!size || i < size / 2) { + temp = new Array(i); + for (k = 0; k < i; k++) { + temp[k] = this._list[(this._head + k) & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i > 0) { + this._head = (this._head + i + len) & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._head = (this._head + i + len) & this._capacityMask; + } + while (arg_len > arguments_index) { + this.unshift(arguments[--arg_len]); + } + for (k = i; k > 0; k--) { + this.unshift(temp[k - 1]); + } + } else { + temp = new Array(size - (i + count)); + var leng = temp.length; + for (k = 0; k < leng; k++) { + temp[k] = this._list[(this._head + i + count + k) & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i != size) { + this._tail = (this._head + i + len) & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._tail = (this._tail - leng + len) & this._capacityMask; + } + while (arguments_index < arg_len) { + this.push(arguments[arguments_index++]); + } + for (k = 0; k < leng; k++) { + this.push(temp[k]); + } + } + return removed; + } else { + return this.remove(i, count); + } +}; + +/** + * Soft clear - does not reset capacity. + */ +Denque.prototype.clear = function clear() { + this._list = new Array(this._list.length); + this._head = 0; + this._tail = 0; +}; + +/** + * Returns true or false whether the list is empty. + * @returns {boolean} + */ +Denque.prototype.isEmpty = function isEmpty() { + return this._head === this._tail; +}; + +/** + * Returns an array of all queue items. + * @returns {Array} + */ +Denque.prototype.toArray = function toArray() { + return this._copyArray(false); +}; + +/** + * ------------- + * INTERNALS + * ------------- + */ + +/** + * Fills the queue with items from an array + * For use in the constructor + * @param array + * @private + */ +Denque.prototype._fromArray = function _fromArray(array) { + var length = array.length; + var capacity = this._nextPowerOf2(length); + + this._list = new Array(capacity); + this._capacityMask = capacity - 1; + this._tail = length; + + for (var i = 0; i < length; i++) this._list[i] = array[i]; +}; + +/** + * + * @param fullCopy + * @param size Initialize the array with a specific size. Will default to the current list size + * @returns {Array} + * @private + */ +Denque.prototype._copyArray = function _copyArray(fullCopy, size) { + var src = this._list; + var capacity = src.length; + var length = this.length; + size = size | length; + + // No prealloc requested and the buffer is contiguous + if (size == length && this._head < this._tail) { + // Simply do a fast slice copy + return this._list.slice(this._head, this._tail); + } + + var dest = new Array(size); + + var k = 0; + var i; + if (fullCopy || this._head > this._tail) { + for (i = this._head; i < capacity; i++) dest[k++] = src[i]; + for (i = 0; i < this._tail; i++) dest[k++] = src[i]; + } else { + for (i = this._head; i < this._tail; i++) dest[k++] = src[i]; + } + + return dest; +} + +/** + * Grows the internal list array. + * @private + */ +Denque.prototype._growArray = function _growArray() { + if (this._head != 0) { + // double array size and copy existing data, head to end, then beginning to tail. + var newList = this._copyArray(true, this._list.length << 1); + + this._tail = this._list.length; + this._head = 0; + + this._list = newList; + } else { + this._tail = this._list.length; + this._list.length <<= 1; + } + + this._capacityMask = (this._capacityMask << 1) | 1; +}; + +/** + * Shrinks the internal list array. + * @private + */ +Denque.prototype._shrinkArray = function _shrinkArray() { + this._list.length >>>= 1; + this._capacityMask >>>= 1; +}; + +/** + * Find the next power of 2, at least 4 + * @private + * @param {number} num + * @returns {number} + */ +Denque.prototype._nextPowerOf2 = function _nextPowerOf2(num) { + var log2 = Math.log(num) / Math.log(2); + var nextPow2 = 1 << (log2 + 1); + + return Math.max(nextPow2, 4); +} + +module.exports = Denque; diff --git a/node_modules/denque/package.json b/node_modules/denque/package.json new file mode 100644 index 0000000..a635910 --- /dev/null +++ b/node_modules/denque/package.json @@ -0,0 +1,58 @@ +{ + "name": "denque", + "version": "2.1.0", + "description": "The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries. Maintains compatability with deque.", + "main": "index.js", + "engines": { + "node": ">=0.10" + }, + "keywords": [ + "data-structure", + "data-structures", + "queue", + "double", + "end", + "ended", + "deque", + "denque", + "double-ended-queue" + ], + "scripts": { + "test": "istanbul cover --report lcov _mocha && npm run typescript", + "coveralls": "cat ./coverage/lcov.info | coveralls", + "typescript": "tsc --project ./test/type/tsconfig.json", + "benchmark_thousand": "node benchmark/thousand", + "benchmark_2mil": "node benchmark/two_million", + "benchmark_splice": "node benchmark/splice", + "benchmark_remove": "node benchmark/remove", + "benchmark_removeOne": "node benchmark/removeOne", + "benchmark_growth": "node benchmark/growth", + "benchmark_toArray": "node benchmark/toArray", + "benchmark_fromArray": "node benchmark/fromArray" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/invertase/denque.git" + }, + "license": "Apache-2.0", + "author": { + "name": "Invertase", + "email": "oss@invertase.io", + "url": "http://github.com/invertase/" + }, + "contributors": [ + "Mike Diarmid (Salakar) " + ], + "bugs": { + "url": "https://github.com/invertase/denque/issues" + }, + "homepage": "https://docs.page/invertase/denque", + "devDependencies": { + "benchmark": "^2.1.4", + "codecov": "^3.8.3", + "double-ended-queue": "^2.1.0-0", + "istanbul": "^0.4.5", + "mocha": "^3.5.3", + "typescript": "^3.4.1" + } +} diff --git a/node_modules/depd/History.md b/node_modules/depd/History.md new file mode 100644 index 0000000..cd9ebaa --- /dev/null +++ b/node_modules/depd/History.md @@ -0,0 +1,103 @@ +2.0.0 / 2018-10-26 +================== + + * Drop support for Node.js 0.6 + * Replace internal `eval` usage with `Function` constructor + * Use instance methods on `process` to check for listeners + +1.1.2 / 2018-01-11 +================== + + * perf: remove argument reassignment + * Support Node.js 0.6 to 9.x + +1.1.1 / 2017-07-27 +================== + + * Remove unnecessary `Buffer` loading + * Support Node.js 0.6 to 8.x + +1.1.0 / 2015-09-14 +================== + + * Enable strict mode in more places + * Support io.js 3.x + * Support io.js 2.x + * Support web browser loading + - Requires bundler like Browserify or webpack + +1.0.1 / 2015-04-07 +================== + + * Fix `TypeError`s when under `'use strict'` code + * Fix useless type name on auto-generated messages + * Support io.js 1.x + * Support Node.js 0.12 + +1.0.0 / 2014-09-17 +================== + + * No changes + +0.4.5 / 2014-09-09 +================== + + * Improve call speed to functions using the function wrapper + * Support Node.js 0.6 + +0.4.4 / 2014-07-27 +================== + + * Work-around v8 generating empty stack traces + +0.4.3 / 2014-07-26 +================== + + * Fix exception when global `Error.stackTraceLimit` is too low + +0.4.2 / 2014-07-19 +================== + + * Correct call site for wrapped functions and properties + +0.4.1 / 2014-07-19 +================== + + * Improve automatic message generation for function properties + +0.4.0 / 2014-07-19 +================== + + * Add `TRACE_DEPRECATION` environment variable + * Remove non-standard grey color from color output + * Support `--no-deprecation` argument + * Support `--trace-deprecation` argument + * Support `deprecate.property(fn, prop, message)` + +0.3.0 / 2014-06-16 +================== + + * Add `NO_DEPRECATION` environment variable + +0.2.0 / 2014-06-15 +================== + + * Add `deprecate.property(obj, prop, message)` + * Remove `supports-color` dependency for node.js 0.8 + +0.1.0 / 2014-06-15 +================== + + * Add `deprecate.function(fn, message)` + * Add `process.on('deprecation', fn)` emitter + * Automatically generate message when omitted from `deprecate()` + +0.0.1 / 2014-06-15 +================== + + * Fix warning for dynamic calls at singe call site + +0.0.0 / 2014-06-15 +================== + + * Initial implementation diff --git a/node_modules/depd/LICENSE b/node_modules/depd/LICENSE new file mode 100644 index 0000000..248de7a --- /dev/null +++ b/node_modules/depd/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2018 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/depd/Readme.md b/node_modules/depd/Readme.md new file mode 100644 index 0000000..043d1ca --- /dev/null +++ b/node_modules/depd/Readme.md @@ -0,0 +1,280 @@ +# depd + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Linux Build][travis-image]][travis-url] +[![Windows Build][appveyor-image]][appveyor-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Deprecate all the things + +> With great modules comes great responsibility; mark things deprecated! + +## Install + +This module is installed directly using `npm`: + +```sh +$ npm install depd +``` + +This module can also be bundled with systems like +[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/), +though by default this module will alter it's API to no longer display or +track deprecations. + +## API + + + +```js +var deprecate = require('depd')('my-module') +``` + +This library allows you to display deprecation messages to your users. +This library goes above and beyond with deprecation warnings by +introspection of the call stack (but only the bits that it is interested +in). + +Instead of just warning on the first invocation of a deprecated +function and never again, this module will warn on the first invocation +of a deprecated function per unique call site, making it ideal to alert +users of all deprecated uses across the code base, rather than just +whatever happens to execute first. + +The deprecation warnings from this module also include the file and line +information for the call into the module that the deprecated function was +in. + +**NOTE** this library has a similar interface to the `debug` module, and +this module uses the calling file to get the boundary for the call stacks, +so you should always create a new `deprecate` object in each file and not +within some central file. + +### depd(namespace) + +Create a new deprecate function that uses the given namespace name in the +messages and will display the call site prior to the stack entering the +file this function was called from. It is highly suggested you use the +name of your module as the namespace. + +### deprecate(message) + +Call this function from deprecated code to display a deprecation message. +This message will appear once per unique caller site. Caller site is the +first call site in the stack in a different file from the caller of this +function. + +If the message is omitted, a message is generated for you based on the site +of the `deprecate()` call and will display the name of the function called, +similar to the name displayed in a stack trace. + +### deprecate.function(fn, message) + +Call this function to wrap a given function in a deprecation message on any +call to the function. An optional message can be supplied to provide a custom +message. + +### deprecate.property(obj, prop, message) + +Call this function to wrap a given property on object in a deprecation message +on any accessing or setting of the property. An optional message can be supplied +to provide a custom message. + +The method must be called on the object where the property belongs (not +inherited from the prototype). + +If the property is a data descriptor, it will be converted to an accessor +descriptor in order to display the deprecation message. + +### process.on('deprecation', fn) + +This module will allow easy capturing of deprecation errors by emitting the +errors as the type "deprecation" on the global `process`. If there are no +listeners for this type, the errors are written to STDERR as normal, but if +there are any listeners, nothing will be written to STDERR and instead only +emitted. From there, you can write the errors in a different format or to a +logging source. + +The error represents the deprecation and is emitted only once with the same +rules as writing to STDERR. The error has the following properties: + + - `message` - This is the message given by the library + - `name` - This is always `'DeprecationError'` + - `namespace` - This is the namespace the deprecation came from + - `stack` - This is the stack of the call to the deprecated thing + +Example `error.stack` output: + +``` +DeprecationError: my-cool-module deprecated oldfunction + at Object. ([eval]-wrapper:6:22) + at Module._compile (module.js:456:26) + at evalScript (node.js:532:25) + at startup (node.js:80:7) + at node.js:902:3 +``` + +### process.env.NO_DEPRECATION + +As a user of modules that are deprecated, the environment variable `NO_DEPRECATION` +is provided as a quick solution to silencing deprecation warnings from being +output. The format of this is similar to that of `DEBUG`: + +```sh +$ NO_DEPRECATION=my-module,othermod node app.js +``` + +This will suppress deprecations from being output for "my-module" and "othermod". +The value is a list of comma-separated namespaces. To suppress every warning +across all namespaces, use the value `*` for a namespace. + +Providing the argument `--no-deprecation` to the `node` executable will suppress +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not suppress the deperecations given to any "deprecation" +event listeners, just the output to STDERR. + +### process.env.TRACE_DEPRECATION + +As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION` +is provided as a solution to getting more detailed location information in deprecation +warnings by including the entire stack trace. The format of this is the same as +`NO_DEPRECATION`: + +```sh +$ TRACE_DEPRECATION=my-module,othermod node app.js +``` + +This will include stack traces for deprecations being output for "my-module" and +"othermod". The value is a list of comma-separated namespaces. To trace every +warning across all namespaces, use the value `*` for a namespace. + +Providing the argument `--trace-deprecation` to the `node` executable will trace +all deprecations (only available in Node.js 0.8 or higher). + +**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`. + +## Display + +![message](files/message.png) + +When a user calls a function in your library that you mark deprecated, they +will see the following written to STDERR (in the given colors, similar colors +and layout to the `debug` module): + +``` +bright cyan bright yellow +| | reset cyan +| | | | +▼ ▼ ▼ ▼ +my-cool-module deprecated oldfunction [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ +| | | | +namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +If the user redirects their STDERR to a file or somewhere that does not support +colors, they see (similar layout to the `debug` module): + +``` +Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22 +▲ ▲ ▲ ▲ ▲ +| | | | | +timestamp of message namespace | | location of mycoolmod.oldfunction() call + | deprecation message + the word "deprecated" +``` + +## Examples + +### Deprecating all calls to a function + +This will display a deprecated message about "oldfunction" being deprecated +from "my-module" on STDERR. + +```js +var deprecate = require('depd')('my-cool-module') + +// message automatically derived from function name +// Object.oldfunction +exports.oldfunction = deprecate.function(function oldfunction () { + // all calls to function are deprecated +}) + +// specific message +exports.oldfunction = deprecate.function(function () { + // all calls to function are deprecated +}, 'oldfunction') +``` + +### Conditionally deprecating a function call + +This will display a deprecated message about "weirdfunction" being deprecated +from "my-module" on STDERR when called with less than 2 arguments. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } +} +``` + +When calling `deprecate` as a function, the warning is counted per call site +within your own module, so you can display different deprecations depending +on different situations and the users will still get all the warnings: + +```js +var deprecate = require('depd')('my-cool-module') + +exports.weirdfunction = function () { + if (arguments.length < 2) { + // calls with 0 or 1 args are deprecated + deprecate('weirdfunction args < 2') + } else if (typeof arguments[0] !== 'string') { + // calls with non-string first argument are deprecated + deprecate('weirdfunction non-string first arg') + } +} +``` + +### Deprecating property access + +This will display a deprecated message about "oldprop" being deprecated +from "my-module" on STDERR when accessed. A deprecation will be displayed +when setting the value and when getting the value. + +```js +var deprecate = require('depd')('my-cool-module') + +exports.oldprop = 'something' + +// message automatically derives from property name +deprecate.property(exports, 'oldprop') + +// explicit message +deprecate.property(exports, 'oldprop', 'oldprop >= 0.10') +``` + +## License + +[MIT](LICENSE) + +[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/nodejs-depd/master?label=windows +[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd +[coveralls-image]: https://badgen.net/coveralls/c/github/dougwilson/nodejs-depd/master +[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master +[node-image]: https://badgen.net/npm/node/depd +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/depd +[npm-url]: https://npmjs.org/package/depd +[npm-version-image]: https://badgen.net/npm/v/depd +[travis-image]: https://badgen.net/travis/dougwilson/nodejs-depd/master?label=linux +[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd diff --git a/node_modules/depd/index.js b/node_modules/depd/index.js new file mode 100644 index 0000000..1bf2fcf --- /dev/null +++ b/node_modules/depd/index.js @@ -0,0 +1,538 @@ +/*! + * depd + * Copyright(c) 2014-2018 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var relative = require('path').relative + +/** + * Module exports. + */ + +module.exports = depd + +/** + * Get the path to base files on. + */ + +var basePath = process.cwd() + +/** + * Determine if namespace is contained in the string. + */ + +function containsNamespace (str, namespace) { + var vals = str.split(/[ ,]+/) + var ns = String(namespace).toLowerCase() + + for (var i = 0; i < vals.length; i++) { + var val = vals[i] + + // namespace contained + if (val && (val === '*' || val.toLowerCase() === ns)) { + return true + } + } + + return false +} + +/** + * Convert a data descriptor to accessor descriptor. + */ + +function convertDataDescriptorToAccessor (obj, prop, message) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + var value = descriptor.value + + descriptor.get = function getter () { return value } + + if (descriptor.writable) { + descriptor.set = function setter (val) { return (value = val) } + } + + delete descriptor.value + delete descriptor.writable + + Object.defineProperty(obj, prop, descriptor) + + return descriptor +} + +/** + * Create arguments string to keep arity. + */ + +function createArgumentsString (arity) { + var str = '' + + for (var i = 0; i < arity; i++) { + str += ', arg' + i + } + + return str.substr(2) +} + +/** + * Create stack string from stack. + */ + +function createStackString (stack) { + var str = this.name + ': ' + this.namespace + + if (this.message) { + str += ' deprecated ' + this.message + } + + for (var i = 0; i < stack.length; i++) { + str += '\n at ' + stack[i].toString() + } + + return str +} + +/** + * Create deprecate for namespace in caller. + */ + +function depd (namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + var stack = getStack() + var site = callSiteLocation(stack[1]) + var file = site[0] + + function deprecate (message) { + // call to self as log + log.call(deprecate, message) + } + + deprecate._file = file + deprecate._ignored = isignored(namespace) + deprecate._namespace = namespace + deprecate._traced = istraced(namespace) + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Determine if event emitter has listeners of a given type. + * + * The way to do this check is done three different ways in Node.js >= 0.8 + * so this consolidates them into a minimal set using instance methods. + * + * @param {EventEmitter} emitter + * @param {string} type + * @returns {boolean} + * @private + */ + +function eehaslisteners (emitter, type) { + var count = typeof emitter.listenerCount !== 'function' + ? emitter.listeners(type).length + : emitter.listenerCount(type) + + return count > 0 +} + +/** + * Determine if namespace is ignored. + */ + +function isignored (namespace) { + if (process.noDeprecation) { + // --no-deprecation support + return true + } + + var str = process.env.NO_DEPRECATION || '' + + // namespace ignored + return containsNamespace(str, namespace) +} + +/** + * Determine if namespace is traced. + */ + +function istraced (namespace) { + if (process.traceDeprecation) { + // --trace-deprecation support + return true + } + + var str = process.env.TRACE_DEPRECATION || '' + + // namespace traced + return containsNamespace(str, namespace) +} + +/** + * Display deprecation message. + */ + +function log (message, site) { + var haslisteners = eehaslisteners(process, 'deprecation') + + // abort early if no destination + if (!haslisteners && this._ignored) { + return + } + + var caller + var callFile + var callSite + var depSite + var i = 0 + var seen = false + var stack = getStack() + var file = this._file + + if (site) { + // provided site + depSite = site + callSite = callSiteLocation(stack[1]) + callSite.name = depSite.name + file = callSite[0] + } else { + // get call site + i = 2 + depSite = callSiteLocation(stack[i]) + callSite = depSite + } + + // get caller of deprecated thing in relation to file + for (; i < stack.length; i++) { + caller = callSiteLocation(stack[i]) + callFile = caller[0] + + if (callFile === file) { + seen = true + } else if (callFile === this._file) { + file = this._file + } else if (seen) { + break + } + } + + var key = caller + ? depSite.join(':') + '__' + caller.join(':') + : undefined + + if (key !== undefined && key in this._warned) { + // already warned + return + } + + this._warned[key] = true + + // generate automatic message from call site + var msg = message + if (!msg) { + msg = callSite === depSite || !callSite.name + ? defaultMessage(depSite) + : defaultMessage(callSite) + } + + // emit deprecation if listeners exist + if (haslisteners) { + var err = DeprecationError(this._namespace, msg, stack.slice(i)) + process.emit('deprecation', err) + return + } + + // format and write message + var format = process.stderr.isTTY + ? formatColor + : formatPlain + var output = format.call(this, msg, caller, stack.slice(i)) + process.stderr.write(output + '\n', 'utf8') +} + +/** + * Get call site location as array. + */ + +function callSiteLocation (callSite) { + var file = callSite.getFileName() || '' + var line = callSite.getLineNumber() + var colm = callSite.getColumnNumber() + + if (callSite.isEval()) { + file = callSite.getEvalOrigin() + ', ' + file + } + + var site = [file, line, colm] + + site.callSite = callSite + site.name = callSite.getFunctionName() + + return site +} + +/** + * Generate a default message from the site. + */ + +function defaultMessage (site) { + var callSite = site.callSite + var funcName = site.name + + // make useful anonymous name + if (!funcName) { + funcName = '' + } + + var context = callSite.getThis() + var typeName = context && callSite.getTypeName() + + // ignore useless type name + if (typeName === 'Object') { + typeName = undefined + } + + // make useful type name + if (typeName === 'Function') { + typeName = context.name || typeName + } + + return typeName && callSite.getMethodName() + ? typeName + '.' + funcName + : funcName +} + +/** + * Format deprecation message without color. + */ + +function formatPlain (msg, caller, stack) { + var timestamp = new Date().toUTCString() + + var formatted = timestamp + + ' ' + this._namespace + + ' deprecated ' + msg + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n at ' + stack[i].toString() + } + + return formatted + } + + if (caller) { + formatted += ' at ' + formatLocation(caller) + } + + return formatted +} + +/** + * Format deprecation message with color. + */ + +function formatColor (msg, caller, stack) { + var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan + ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow + ' \x1b[0m' + msg + '\x1b[39m' // reset + + // add stack trace + if (this._traced) { + for (var i = 0; i < stack.length; i++) { + formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m' // cyan + } + + return formatted + } + + if (caller) { + formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan + } + + return formatted +} + +/** + * Format call site location. + */ + +function formatLocation (callSite) { + return relative(basePath, callSite[0]) + + ':' + callSite[1] + + ':' + callSite[2] +} + +/** + * Get the stack as array of call sites. + */ + +function getStack () { + var limit = Error.stackTraceLimit + var obj = {} + var prep = Error.prepareStackTrace + + Error.prepareStackTrace = prepareObjectStackTrace + Error.stackTraceLimit = Math.max(10, limit) + + // capture the stack + Error.captureStackTrace(obj) + + // slice this function off the top + var stack = obj.stack.slice(1) + + Error.prepareStackTrace = prep + Error.stackTraceLimit = limit + + return stack +} + +/** + * Capture call site stack from v8. + */ + +function prepareObjectStackTrace (obj, stack) { + return stack +} + +/** + * Return a wrapped function in a deprecation message. + */ + +function wrapfunction (fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + var args = createArgumentsString(fn.length) + var stack = getStack() + var site = callSiteLocation(stack[1]) + + site.name = fn.name + + // eslint-disable-next-line no-new-func + var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site', + '"use strict"\n' + + 'return function (' + args + ') {' + + 'log.call(deprecate, message, site)\n' + + 'return fn.apply(this, arguments)\n' + + '}')(fn, log, this, message, site) + + return deprecatedfn +} + +/** + * Wrap property in a deprecation message. + */ + +function wrapproperty (obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + var deprecate = this + var stack = getStack() + var site = callSiteLocation(stack[1]) + + // set site name + site.name = prop + + // convert data descriptor + if ('value' in descriptor) { + descriptor = convertDataDescriptorToAccessor(obj, prop, message) + } + + var get = descriptor.get + var set = descriptor.set + + // wrap getter + if (typeof get === 'function') { + descriptor.get = function getter () { + log.call(deprecate, message, site) + return get.apply(this, arguments) + } + } + + // wrap setter + if (typeof set === 'function') { + descriptor.set = function setter () { + log.call(deprecate, message, site) + return set.apply(this, arguments) + } + } + + Object.defineProperty(obj, prop, descriptor) +} + +/** + * Create DeprecationError for deprecation + */ + +function DeprecationError (namespace, message, stack) { + var error = new Error() + var stackString + + Object.defineProperty(error, 'constructor', { + value: DeprecationError + }) + + Object.defineProperty(error, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }) + + Object.defineProperty(error, 'name', { + enumerable: false, + configurable: true, + value: 'DeprecationError', + writable: true + }) + + Object.defineProperty(error, 'namespace', { + configurable: true, + enumerable: false, + value: namespace, + writable: true + }) + + Object.defineProperty(error, 'stack', { + configurable: true, + enumerable: false, + get: function () { + if (stackString !== undefined) { + return stackString + } + + // prepare stack trace + return (stackString = createStackString.call(this, stack)) + }, + set: function setter (val) { + stackString = val + } + }) + + return error +} diff --git a/node_modules/depd/lib/browser/index.js b/node_modules/depd/lib/browser/index.js new file mode 100644 index 0000000..6be45cc --- /dev/null +++ b/node_modules/depd/lib/browser/index.js @@ -0,0 +1,77 @@ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = depd + +/** + * Create deprecate for namespace in caller. + */ + +function depd (namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + function deprecate (message) { + // no-op in browser + } + + deprecate._file = undefined + deprecate._ignored = true + deprecate._namespace = namespace + deprecate._traced = false + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Return a wrapped function in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapfunction (fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + return fn +} + +/** + * Wrap property in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapproperty (obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } +} diff --git a/node_modules/depd/package.json b/node_modules/depd/package.json new file mode 100644 index 0000000..3857e19 --- /dev/null +++ b/node_modules/depd/package.json @@ -0,0 +1,45 @@ +{ + "name": "depd", + "description": "Deprecate all the things", + "version": "2.0.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "deprecate", + "deprecated" + ], + "repository": "dougwilson/nodejs-depd", + "browser": "lib/browser/index.js", + "devDependencies": { + "benchmark": "2.1.4", + "beautify-benchmark": "0.2.4", + "eslint": "5.7.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-markdown": "1.0.0-beta.7", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "istanbul": "0.4.5", + "mocha": "5.2.0", + "safe-buffer": "5.1.2", + "uid-safe": "2.1.5" + }, + "files": [ + "lib/", + "History.md", + "LICENSE", + "index.js", + "Readme.md" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail test/", + "test-ci": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter spec test/ && istanbul report lcovonly text-summary", + "test-cov": "istanbul cover --print=none node_modules/mocha/bin/_mocha -- --reporter dot test/ && istanbul report lcov text-summary" + } +} diff --git a/node_modules/destroy/LICENSE b/node_modules/destroy/LICENSE new file mode 100644 index 0000000..0e2c35f --- /dev/null +++ b/node_modules/destroy/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com +Copyright (c) 2015-2022 Douglas Christopher Wilson doug@somethingdoug.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/destroy/README.md b/node_modules/destroy/README.md new file mode 100644 index 0000000..e7701ae --- /dev/null +++ b/node_modules/destroy/README.md @@ -0,0 +1,63 @@ +# destroy + +[![NPM version][npm-image]][npm-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +Destroy a stream. + +This module is meant to ensure a stream gets destroyed, handling different APIs +and Node.js bugs. + +## API + +```js +var destroy = require('destroy') +``` + +### destroy(stream [, suppress]) + +Destroy the given stream, and optionally suppress any future `error` events. + +In most cases, this is identical to a simple `stream.destroy()` call. The rules +are as follows for a given stream: + + 1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()` + and add a listener to the `open` event to call `stream.close()` if it is + fired. This is for a Node.js bug that will leak a file descriptor if + `.destroy()` is called before `open`. + 2. If the `stream` is an instance of a zlib stream, then call `stream.destroy()` + and close the underlying zlib handle if open, otherwise call `stream.close()`. + This is for consistency across Node.js versions and a Node.js bug that will + leak a native zlib handle. + 3. If the `stream` is not an instance of `Stream`, then nothing happens. + 4. If the `stream` has a `.destroy()` method, then call it. + +The function returns the `stream` passed in as the argument. + +## Example + +```js +var destroy = require('destroy') + +var fs = require('fs') +var stream = fs.createReadStream('package.json') + +// ... and later +destroy(stream) +``` + +[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square +[npm-url]: https://npmjs.org/package/destroy +[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square +[github-url]: https://github.com/stream-utils/destroy/tags +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master +[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/destroy +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/stream-utils/destroy/ci/master?label=ci&style=flat-square +[github-actions-ci-url]: https://github.com/stream-utils/destroy/actions/workflows/ci.yml diff --git a/node_modules/destroy/index.js b/node_modules/destroy/index.js new file mode 100644 index 0000000..7fd5c09 --- /dev/null +++ b/node_modules/destroy/index.js @@ -0,0 +1,209 @@ +/*! + * destroy + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var EventEmitter = require('events').EventEmitter +var ReadStream = require('fs').ReadStream +var Stream = require('stream') +var Zlib = require('zlib') + +/** + * Module exports. + * @public + */ + +module.exports = destroy + +/** + * Destroy the given stream, and optionally suppress any future `error` events. + * + * @param {object} stream + * @param {boolean} suppress + * @public + */ + +function destroy (stream, suppress) { + if (isFsReadStream(stream)) { + destroyReadStream(stream) + } else if (isZlibStream(stream)) { + destroyZlibStream(stream) + } else if (hasDestroy(stream)) { + stream.destroy() + } + + if (isEventEmitter(stream) && suppress) { + stream.removeAllListeners('error') + stream.addListener('error', noop) + } + + return stream +} + +/** + * Destroy a ReadStream. + * + * @param {object} stream + * @private + */ + +function destroyReadStream (stream) { + stream.destroy() + + if (typeof stream.close === 'function') { + // node.js core bug work-around + stream.on('open', onOpenClose) + } +} + +/** + * Close a Zlib stream. + * + * Zlib streams below Node.js 4.5.5 have a buggy implementation + * of .close() when zlib encountered an error. + * + * @param {object} stream + * @private + */ + +function closeZlibStream (stream) { + if (stream._hadError === true) { + var prop = stream._binding === null + ? '_binding' + : '_handle' + + stream[prop] = { + close: function () { this[prop] = null } + } + } + + stream.close() +} + +/** + * Destroy a Zlib stream. + * + * Zlib streams don't have a destroy function in Node.js 6. On top of that + * simply calling destroy on a zlib stream in Node.js 8+ will result in a + * memory leak. So until that is fixed, we need to call both close AND destroy. + * + * PR to fix memory leak: https://github.com/nodejs/node/pull/23734 + * + * In Node.js 6+8, it's important that destroy is called before close as the + * stream would otherwise emit the error 'zlib binding closed'. + * + * @param {object} stream + * @private + */ + +function destroyZlibStream (stream) { + if (typeof stream.destroy === 'function') { + // node.js core bug work-around + // istanbul ignore if: node.js 0.8 + if (stream._binding) { + // node.js < 0.10.0 + stream.destroy() + if (stream._processing) { + stream._needDrain = true + stream.once('drain', onDrainClearBinding) + } else { + stream._binding.clear() + } + } else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) { + // node.js >= 12, ^11.1.0, ^10.15.1 + stream.destroy() + } else if (stream._destroy && typeof stream.close === 'function') { + // node.js 7, 8 + stream.destroyed = true + stream.close() + } else { + // fallback + // istanbul ignore next + stream.destroy() + } + } else if (typeof stream.close === 'function') { + // node.js < 8 fallback + closeZlibStream(stream) + } +} + +/** + * Determine if stream has destroy. + * @private + */ + +function hasDestroy (stream) { + return stream instanceof Stream && + typeof stream.destroy === 'function' +} + +/** + * Determine if val is EventEmitter. + * @private + */ + +function isEventEmitter (val) { + return val instanceof EventEmitter +} + +/** + * Determine if stream is fs.ReadStream stream. + * @private + */ + +function isFsReadStream (stream) { + return stream instanceof ReadStream +} + +/** + * Determine if stream is Zlib stream. + * @private + */ + +function isZlibStream (stream) { + return stream instanceof Zlib.Gzip || + stream instanceof Zlib.Gunzip || + stream instanceof Zlib.Deflate || + stream instanceof Zlib.DeflateRaw || + stream instanceof Zlib.Inflate || + stream instanceof Zlib.InflateRaw || + stream instanceof Zlib.Unzip +} + +/** + * No-op function. + * @private + */ + +function noop () {} + +/** + * On drain handler to clear binding. + * @private + */ + +// istanbul ignore next: node.js 0.8 +function onDrainClearBinding () { + this._binding.clear() +} + +/** + * On open handler to close stream. + * @private + */ + +function onOpenClose () { + if (typeof this.fd === 'number') { + // actually close down the fd + this.close() + } +} diff --git a/node_modules/destroy/package.json b/node_modules/destroy/package.json new file mode 100644 index 0000000..c85e438 --- /dev/null +++ b/node_modules/destroy/package.json @@ -0,0 +1,48 @@ +{ + "name": "destroy", + "description": "destroy a stream if possible", + "version": "1.2.0", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com", + "twitter": "https://twitter.com/jongleberry" + }, + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "repository": "stream-utils/destroy", + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "files": [ + "index.js", + "LICENSE" + ], + "keywords": [ + "stream", + "streams", + "destroy", + "cleanup", + "leak", + "fd" + ] +} diff --git a/node_modules/detect-libc/LICENSE b/node_modules/detect-libc/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/node_modules/detect-libc/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/detect-libc/README.md b/node_modules/detect-libc/README.md new file mode 100644 index 0000000..23212fd --- /dev/null +++ b/node_modules/detect-libc/README.md @@ -0,0 +1,163 @@ +# detect-libc + +Node.js module to detect details of the C standard library (libc) +implementation provided by a given Linux system. + +Currently supports detection of GNU glibc and MUSL libc. + +Provides asychronous and synchronous functions for the +family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`). + +The version numbers of libc implementations +are not guaranteed to be semver-compliant. + +For previous v1.x releases, please see the +[v1](https://github.com/lovell/detect-libc/tree/v1) branch. + +## Install + +```sh +npm install detect-libc +``` + +## API + +### GLIBC + +```ts +const GLIBC: string = 'glibc'; +``` + +A String constant containing the value `glibc`. + +### MUSL + +```ts +const MUSL: string = 'musl'; +``` + +A String constant containing the value `musl`. + +### family + +```ts +function family(): Promise; +``` + +Resolves asychronously with: + +* `glibc` or `musl` when the libc family can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { family, GLIBC, MUSL } = require('detect-libc'); + +switch (await family()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### familySync + +```ts +function familySync(): string | null; +``` + +Synchronous version of `family()`. + +```js +const { familySync, GLIBC, MUSL } = require('detect-libc'); + +switch (familySync()) { + case GLIBC: ... + case MUSL: ... + case null: ... +} +``` + +### version + +```ts +function version(): Promise; +``` + +Resolves asychronously with: + +* The version when it can be determined +* `null` when the libc family cannot be determined +* `null` when run on a non-Linux platform + +```js +const { version } = require('detect-libc'); + +const v = await version(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### versionSync + +```ts +function versionSync(): string | null; +``` + +Synchronous version of `version()`. + +```js +const { versionSync } = require('detect-libc'); + +const v = versionSync(); +if (v) { + const [major, minor, patch] = v.split('.'); +} +``` + +### isNonGlibcLinux + +```ts +function isNonGlibcLinux(): Promise; +``` + +Resolves asychronously with: + +* `false` when the libc family is `glibc` +* `true` when the libc family is not `glibc` +* `false` when run on a non-Linux platform + +```js +const { isNonGlibcLinux } = require('detect-libc'); + +if (await isNonGlibcLinux()) { ... } +``` + +### isNonGlibcLinuxSync + +```ts +function isNonGlibcLinuxSync(): boolean; +``` + +Synchronous version of `isNonGlibcLinux()`. + +```js +const { isNonGlibcLinuxSync } = require('detect-libc'); + +if (isNonGlibcLinuxSync()) { ... } +``` + +## Licensing + +Copyright 2017 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/detect-libc/index.d.ts b/node_modules/detect-libc/index.d.ts new file mode 100644 index 0000000..4c0fb2b --- /dev/null +++ b/node_modules/detect-libc/index.d.ts @@ -0,0 +1,14 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +export const GLIBC: 'glibc'; +export const MUSL: 'musl'; + +export function family(): Promise; +export function familySync(): string | null; + +export function isNonGlibcLinux(): Promise; +export function isNonGlibcLinuxSync(): boolean; + +export function version(): Promise; +export function versionSync(): string | null; diff --git a/node_modules/detect-libc/lib/detect-libc.js b/node_modules/detect-libc/lib/detect-libc.js new file mode 100644 index 0000000..01299b4 --- /dev/null +++ b/node_modules/detect-libc/lib/detect-libc.js @@ -0,0 +1,313 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const childProcess = require('child_process'); +const { isLinux, getReport } = require('./process'); +const { LDD_PATH, SELF_PATH, readFile, readFileSync } = require('./filesystem'); +const { interpreterPath } = require('./elf'); + +let cachedFamilyInterpreter; +let cachedFamilyFilesystem; +let cachedVersionFilesystem; + +const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true'; +let commandOut = ''; + +const safeCommand = () => { + if (!commandOut) { + return new Promise((resolve) => { + childProcess.exec(command, (err, out) => { + commandOut = err ? ' ' : out; + resolve(commandOut); + }); + }); + } + return commandOut; +}; + +const safeCommandSync = () => { + if (!commandOut) { + try { + commandOut = childProcess.execSync(command, { encoding: 'utf8' }); + } catch (_err) { + commandOut = ' '; + } + } + return commandOut; +}; + +/** + * A String constant containing the value `glibc`. + * @type {string} + * @public + */ +const GLIBC = 'glibc'; + +/** + * A Regexp constant to get the GLIBC Version. + * @type {string} + */ +const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i; + +/** + * A String constant containing the value `musl`. + * @type {string} + * @public + */ +const MUSL = 'musl'; + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-'); + +const familyFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return GLIBC; + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return MUSL; + } + } + return null; +}; + +const familyFromCommand = (out) => { + const [getconf, ldd1] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return GLIBC; + } + if (ldd1 && ldd1.includes(MUSL)) { + return MUSL; + } + return null; +}; + +const familyFromInterpreterPath = (path) => { + if (path) { + if (path.includes('/ld-musl-')) { + return MUSL; + } else if (path.includes('/ld-linux-')) { + return GLIBC; + } + } + return null; +}; + +const getFamilyFromLddContent = (content) => { + content = content.toString(); + if (content.includes('musl')) { + return MUSL; + } + if (content.includes('GNU C Library')) { + return GLIBC; + } + return null; +}; + +const familyFromFilesystem = async () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +const familyFromFilesystemSync = () => { + if (cachedFamilyFilesystem !== undefined) { + return cachedFamilyFilesystem; + } + cachedFamilyFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + cachedFamilyFilesystem = getFamilyFromLddContent(lddContent); + } catch (e) {} + return cachedFamilyFilesystem; +}; + +const familyFromInterpreter = async () => { + if (cachedFamilyInterpreter !== undefined) { + return cachedFamilyInterpreter; + } + cachedFamilyInterpreter = null; + try { + const selfContent = await readFile(SELF_PATH); + const path = interpreterPath(selfContent); + cachedFamilyInterpreter = familyFromInterpreterPath(path); + } catch (e) {} + return cachedFamilyInterpreter; +}; + +const familyFromInterpreterSync = () => { + if (cachedFamilyInterpreter !== undefined) { + return cachedFamilyInterpreter; + } + cachedFamilyInterpreter = null; + try { + const selfContent = readFileSync(SELF_PATH); + const path = interpreterPath(selfContent); + cachedFamilyInterpreter = familyFromInterpreterPath(path); + } catch (e) {} + return cachedFamilyInterpreter; +}; + +/** + * Resolves with the libc family when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const family = async () => { + let family = null; + if (isLinux()) { + family = await familyFromInterpreter(); + if (!family) { + family = await familyFromFilesystem(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = await safeCommand(); + family = familyFromCommand(out); + } + } + } + return family; +}; + +/** + * Returns the libc family when it can be determined, `null` otherwise. + * @returns {?string} + */ +const familySync = () => { + let family = null; + if (isLinux()) { + family = familyFromInterpreterSync(); + if (!family) { + family = familyFromFilesystemSync(); + if (!family) { + family = familyFromReport(); + } + if (!family) { + const out = safeCommandSync(); + family = familyFromCommand(out); + } + } + } + return family; +}; + +/** + * Resolves `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {Promise} + */ +const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC; + +/** + * Returns `true` only when the platform is Linux and the libc family is not `glibc`. + * @returns {boolean} + */ +const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC; + +const versionFromFilesystem = async () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = await readFile(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromFilesystemSync = () => { + if (cachedVersionFilesystem !== undefined) { + return cachedVersionFilesystem; + } + cachedVersionFilesystem = null; + try { + const lddContent = readFileSync(LDD_PATH); + const versionMatch = lddContent.match(RE_GLIBC_VERSION); + if (versionMatch) { + cachedVersionFilesystem = versionMatch[1]; + } + } catch (e) {} + return cachedVersionFilesystem; +}; + +const versionFromReport = () => { + const report = getReport(); + if (report.header && report.header.glibcVersionRuntime) { + return report.header.glibcVersionRuntime; + } + return null; +}; + +const versionSuffix = (s) => s.trim().split(/\s+/)[1]; + +const versionFromCommand = (out) => { + const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/); + if (getconf && getconf.includes(GLIBC)) { + return versionSuffix(getconf); + } + if (ldd1 && ldd2 && ldd1.includes(MUSL)) { + return versionSuffix(ldd2); + } + return null; +}; + +/** + * Resolves with the libc version when it can be determined, `null` otherwise. + * @returns {Promise} + */ +const version = async () => { + let version = null; + if (isLinux()) { + version = await versionFromFilesystem(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = await safeCommand(); + version = versionFromCommand(out); + } + } + return version; +}; + +/** + * Returns the libc version when it can be determined, `null` otherwise. + * @returns {?string} + */ +const versionSync = () => { + let version = null; + if (isLinux()) { + version = versionFromFilesystemSync(); + if (!version) { + version = versionFromReport(); + } + if (!version) { + const out = safeCommandSync(); + version = versionFromCommand(out); + } + } + return version; +}; + +module.exports = { + GLIBC, + MUSL, + family, + familySync, + isNonGlibcLinux, + isNonGlibcLinuxSync, + version, + versionSync +}; diff --git a/node_modules/detect-libc/lib/elf.js b/node_modules/detect-libc/lib/elf.js new file mode 100644 index 0000000..aa166aa --- /dev/null +++ b/node_modules/detect-libc/lib/elf.js @@ -0,0 +1,39 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const interpreterPath = (elf) => { + if (elf.length < 64) { + return null; + } + if (elf.readUInt32BE(0) !== 0x7F454C46) { + // Unexpected magic bytes + return null; + } + if (elf.readUInt8(4) !== 2) { + // Not a 64-bit ELF + return null; + } + if (elf.readUInt8(5) !== 1) { + // Not little-endian + return null; + } + const offset = elf.readUInt32LE(32); + const size = elf.readUInt16LE(54); + const count = elf.readUInt16LE(56); + for (let i = 0; i < count; i++) { + const headerOffset = offset + (i * size); + const type = elf.readUInt32LE(headerOffset); + if (type === 3) { + const fileOffset = elf.readUInt32LE(headerOffset + 8); + const fileSize = elf.readUInt32LE(headerOffset + 32); + return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, ''); + } + } + return null; +}; + +module.exports = { + interpreterPath +}; diff --git a/node_modules/detect-libc/lib/filesystem.js b/node_modules/detect-libc/lib/filesystem.js new file mode 100644 index 0000000..4c2443c --- /dev/null +++ b/node_modules/detect-libc/lib/filesystem.js @@ -0,0 +1,51 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const fs = require('fs'); + +const LDD_PATH = '/usr/bin/ldd'; +const SELF_PATH = '/proc/self/exe'; +const MAX_LENGTH = 2048; + +/** + * Read the content of a file synchronous + * + * @param {string} path + * @returns {Buffer} + */ +const readFileSync = (path) => { + const fd = fs.openSync(path, 'r'); + const buffer = Buffer.alloc(MAX_LENGTH); + const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0); + fs.close(fd, () => {}); + return buffer.subarray(0, bytesRead); +}; + +/** + * Read the content of a file + * + * @param {string} path + * @returns {Promise} + */ +const readFile = (path) => new Promise((resolve, reject) => { + fs.open(path, 'r', (err, fd) => { + if (err) { + reject(err); + } else { + const buffer = Buffer.alloc(MAX_LENGTH); + fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => { + resolve(buffer.subarray(0, bytesRead)); + fs.close(fd, () => {}); + }); + } + }); +}); + +module.exports = { + LDD_PATH, + SELF_PATH, + readFileSync, + readFile +}; diff --git a/node_modules/detect-libc/lib/process.js b/node_modules/detect-libc/lib/process.js new file mode 100644 index 0000000..ee78ad2 --- /dev/null +++ b/node_modules/detect-libc/lib/process.js @@ -0,0 +1,24 @@ +// Copyright 2017 Lovell Fuller and others. +// SPDX-License-Identifier: Apache-2.0 + +'use strict'; + +const isLinux = () => process.platform === 'linux'; + +let report = null; +const getReport = () => { + if (!report) { + /* istanbul ignore next */ + if (isLinux() && process.report) { + const orig = process.report.excludeNetwork; + process.report.excludeNetwork = true; + report = process.report.getReport(); + process.report.excludeNetwork = orig; + } else { + report = {}; + } + } + return report; +}; + +module.exports = { isLinux, getReport }; diff --git a/node_modules/detect-libc/package.json b/node_modules/detect-libc/package.json new file mode 100644 index 0000000..36d0f2b --- /dev/null +++ b/node_modules/detect-libc/package.json @@ -0,0 +1,44 @@ +{ + "name": "detect-libc", + "version": "2.1.2", + "description": "Node.js module to detect the C standard library (libc) implementation family and version", + "main": "lib/detect-libc.js", + "files": [ + "lib/", + "index.d.ts" + ], + "scripts": { + "test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js", + "changelog": "conventional-changelog -i CHANGELOG.md -s", + "bench": "node benchmark/detect-libc", + "bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/lovell/detect-libc.git" + }, + "keywords": [ + "libc", + "glibc", + "musl" + ], + "author": "Lovell Fuller ", + "contributors": [ + "Niklas Salmoukas ", + "Vinícius Lourenço " + ], + "license": "Apache-2.0", + "devDependencies": { + "ava": "^2.4.0", + "benchmark": "^2.1.4", + "conventional-changelog-cli": "^5.0.0", + "eslint-config-standard": "^13.0.1", + "nyc": "^15.1.0", + "proxyquire": "^2.1.3", + "semistandard": "^14.2.3" + }, + "engines": { + "node": ">=8" + }, + "types": "index.d.ts" +} diff --git a/node_modules/dezalgo/LICENSE b/node_modules/dezalgo/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/dezalgo/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/dezalgo/README.md b/node_modules/dezalgo/README.md new file mode 100644 index 0000000..bdfc8ba --- /dev/null +++ b/node_modules/dezalgo/README.md @@ -0,0 +1,29 @@ +# dezalgo + +Contain async insanity so that the dark pony lord doesn't eat souls + +See [this blog +post](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). + +## USAGE + +Pass a callback to `dezalgo` and it will ensure that it is *always* +called in a future tick, and never in this tick. + +```javascript +var dz = require('dezalgo') + +var cache = {} +function maybeSync(arg, cb) { + cb = dz(cb) + + // this will actually defer to nextTick + if (cache[arg]) cb(null, cache[arg]) + + fs.readFile(arg, function (er, data) { + // since this is *already* defered, it will call immediately + if (er) cb(er) + cb(null, cache[arg] = data) + }) +} +``` diff --git a/node_modules/dezalgo/dezalgo.js b/node_modules/dezalgo/dezalgo.js new file mode 100644 index 0000000..04fd3ba --- /dev/null +++ b/node_modules/dezalgo/dezalgo.js @@ -0,0 +1,22 @@ +var wrappy = require('wrappy') +module.exports = wrappy(dezalgo) + +var asap = require('asap') + +function dezalgo (cb) { + var sync = true + asap(function () { + sync = false + }) + + return function zalgoSafe() { + var args = arguments + var me = this + if (sync) + asap(function() { + cb.apply(me, args) + }) + else + cb.apply(me, args) + } +} diff --git a/node_modules/dezalgo/package.json b/node_modules/dezalgo/package.json new file mode 100644 index 0000000..f8ba8ec --- /dev/null +++ b/node_modules/dezalgo/package.json @@ -0,0 +1,46 @@ +{ + "name": "dezalgo", + "version": "1.0.4", + "description": "Contain async insanity so that the dark pony lord doesn't eat souls", + "main": "dezalgo.js", + "files": [ + "dezalgo.js" + ], + "directories": { + "test": "test" + }, + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + }, + "devDependencies": { + "tap": "^12.4.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/dezalgo" + }, + "keywords": [ + "async", + "zalgo", + "the dark pony", + "he comes", + "asynchrony of all holy and good", + "To invoke the hive mind representing chaos", + "Invoking the feeling of chaos. /Without order", + "The Nezperdian Hive Mind of Chaos, (zalgo………………)", + "He who waits beyond the wall", + "ZALGO", + "HE COMES", + "there used to be some funky unicode keywords here, but it broke the npm website on chrome, so they were removed, sorry" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/dezalgo/issues" + }, + "homepage": "https://github.com/npm/dezalgo" +} diff --git a/node_modules/diff/CONTRIBUTING.md b/node_modules/diff/CONTRIBUTING.md new file mode 100644 index 0000000..199c556 --- /dev/null +++ b/node_modules/diff/CONTRIBUTING.md @@ -0,0 +1,40 @@ +# How to Contribute + +## Pull Requests + +We also accept [pull requests][pull-request]! + +Generally we like to see pull requests that + +- Maintain the existing code style +- Are focused on a single change (i.e. avoid large refactoring or style adjustments in untouched code if not the primary goal of the pull request) +- Have [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) +- Have tests +- Don't decrease the current code coverage (see coverage/lcov-report/index.html) + +## Building + +``` +yarn +yarn test +``` + +Running `yarn test -- dev` will watch for tests within Node and `karma start` may be used for manual testing in browsers. + +If you notice any problems, please report them to the GitHub issue tracker at +[http://github.com/kpdecker/jsdiff/issues](http://github.com/kpdecker/jsdiff/issues). + +## Releasing + +A full release may be completed by first updating the `"version"` property in package.json, then running the following: + +``` +yarn clean +yarn grunt release +yarn publish +``` + +After releasing, remember to: +* commit the `package.json` change and push it to GitHub +* create a new version tag on GitHub +* update `diff.js` on the `gh-pages` branch to the latest built version from the `dist/` folder. diff --git a/node_modules/diff/LICENSE b/node_modules/diff/LICENSE new file mode 100644 index 0000000..2d48b19 --- /dev/null +++ b/node_modules/diff/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2009-2015, Kevin Decker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/diff/README.md b/node_modules/diff/README.md new file mode 100644 index 0000000..33f0c94 --- /dev/null +++ b/node_modules/diff/README.md @@ -0,0 +1,346 @@ +# jsdiff + +A JavaScript text differencing implementation. Try it out in the **[online demo](https://kpdecker.github.io/jsdiff)**. + +Based on the algorithm proposed in +["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://www.xmailserver.org/diff2.pdf). + +## Installation +```bash +npm install diff --save +``` + +## Usage + +Broadly, jsdiff's diff functions all take an old text and a new text and perform three steps: + +1. Split both texts into arrays of "tokens". What constitutes a token varies; in `diffChars`, each character is a token, while in `diffLines`, each line is a token. + +2. Find the smallest set of single-token *insertions* and *deletions* needed to transform the first array of tokens into the second. + + This step depends upon having some notion of a token from the old array being "equal" to one from the new array, and this notion of equality affects the results. Usually two tokens are equal if `===` considers them equal, but some of the diff functions use an alternative notion of equality or have options to configure it. For instance, by default `diffChars("Foo", "FOOD")` will require two deletions (`o`, `o`) and three insertions (`O`, `O`, `D`), but `diffChars("Foo", "FOOD", {ignoreCase: true})` will require just one insertion (of a `D`), since `ignoreCase` causes `o` and `O` to be considered equal. + +3. Return an array representing the transformation computed in the previous step as a series of [change objects](#change-objects). The array is ordered from the start of the input to the end, and each change object represents *inserting* one or more tokens, *deleting* one or more tokens, or *keeping* one or more tokens. + +### API + +* `Diff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, treating each character as a token. + + ("Characters" here means Unicode code points - the elements you get when you loop over a string with a `for ... of ...` loop.) + + Returns a list of [change objects](#change-objects). + + Options + * `ignoreCase`: If `true`, the uppercase and lowercase forms of a character are considered equal. Defaults to `false`. + +* `Diff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, treating each word and each punctuation mark as a token. Whitespace is ignored when computing the diff (but preserved as far as possible in the final change objects). + + Returns a list of [change objects](#change-objects). + + Options + * `ignoreCase`: Same as in `diffChars`. Defaults to false. + * `intlSegmenter`: An optional [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) object (which must have a `granularity` of `'word'`) for `diffWords` to use to split the text into words. + + By default, `diffWords` does not use an `Intl.Segmenter`, just some regexes for splitting text into words. This will tend to give worse results than `Intl.Segmenter` would, but ensures the results are consistent across environments; `Intl.Segmenter` behaviour is only loosely specced and the implementations in browsers could in principle change dramatically in future. If you want to use `diffWords` with an `Intl.Segmenter` but ensure it behaves the same whatever environment you run it in, use an `Intl.Segmenter` polyfill instead of the JavaScript engine's native `Intl.Segmenter` implementation. + + Using an `Intl.Segmenter` should allow better word-level diffing of non-English text than the default behaviour. For instance, `Intl.Segmenter`s can generally identify via built-in dictionaries which sequences of adjacent Chinese characters form words, allowing word-level diffing of Chinese. By specifying a language when instantiating the segmenter (e.g. `new Intl.Segmenter('sv', {granularity: 'word'})`) you can also support language-specific rules, like treating Swedish's colon separated contractions (like *k:a* for *kyrka*) as single words; by default this would be seen as two words separated by a colon. + +* `Diff.diffWordsWithSpace(oldStr, newStr[, options])` - diffs two blocks of text, treating each word, punctuation mark, newline, or run of (non-newline) whitespace as a token. + +* `Diff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, treating each line as a token. + + Options + * `ignoreWhitespace`: `true` to ignore leading and trailing whitespace characters when checking if two lines are equal. Defaults to `false`. + * `ignoreNewlineAtEof`: `true` to ignore a missing newline character at the end of the last line when comparing it to other lines. (By default, the line `'b\n'` in text `'a\nb\nc'` is not considered equal to the line `'b'` in text `'a\nb'`; this option makes them be considered equal.) Ignored if `ignoreWhitespace` or `newlineIsToken` are also true. + * `stripTrailingCr`: `true` to remove all trailing CR (`\r`) characters before performing the diff. Defaults to `false`. + This helps to get a useful diff when diffing UNIX text files against Windows text files. + * `newlineIsToken`: `true` to treat the newline character at the end of each line as its own token. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines`; the default behavior with this option turned off is better suited for patches and other computer friendly output. Defaults to `false`. + + Note that while using `ignoreWhitespace` in combination with `newlineIsToken` is not an error, results may not be as expected. With `ignoreWhitespace: true` and `newlineIsToken: false`, changing a completely empty line to contain some spaces is treated as a non-change, but with `ignoreWhitespace: true` and `newlineIsToken: true`, it is treated as an insertion. This is because the content of a completely blank line is not a token at all in `newlineIsToken` mode. + + Returns a list of [change objects](#change-objects). + +* `Diff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, treating each sentence as a token. The characters `.`, `!`, and `?`, when followed by whitespace, are treated as marking the end of a sentence; nothing else is considered to mark a sentence end. + + (For more sophisticated detection of sentence breaks, including support for non-English punctuation, consider instead tokenizing with an [`Intl.Segmenter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) with `granularity: 'sentence'` and passing the result to `Diff.diffArrays`.) + + Returns a list of [change objects](#change-objects). + +* `Diff.diffCss(oldStr, newStr[, options])` - diffs two blocks of text, comparing CSS tokens. + + Returns a list of [change objects](#change-objects). + +* `Diff.diffJson(oldObj, newObj[, options])` - diffs two JSON-serializable objects by first serializing them to prettily-formatted JSON and then treating each line of the JSON as a token. Object properties are ordered alphabetically in the serialized JSON, so the order of properties in the objects being compared doesn't affect the result. + + Returns a list of [change objects](#change-objects). + + Options + * `stringifyReplacer`: A custom replacer function. Operates similarly to the `replacer` parameter to [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#the_replacer_parameter), but must be a function. + * `undefinedReplacement`: A value to replace `undefined` with. Ignored if a `stringifyReplacer` is provided. + +* `Diff.diffArrays(oldArr, newArr[, options])` - diffs two arrays of tokens, comparing each item for strict equality (===). + + Options + * `comparator`: `function(left, right)` for custom equality checks + + Returns a list of [change objects](#change-objects). + +* `Diff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr[, oldHeader[, newHeader[, options]]])` - creates a unified diff patch by first computing a diff with `diffLines` and then serializing it to unified diff format. + + Parameters: + * `oldFileName` : String to be output in the filename section of the patch for the removals + * `newFileName` : String to be output in the filename section of the patch for the additions + * `oldStr` : Original string value + * `newStr` : New string value + * `oldHeader` : Optional additional information to include in the old file header. Default: `undefined`. + * `newHeader` : Optional additional information to include in the new file header. Default: `undefined`. + * `options` : An object with options. + - `context` describes how many lines of context should be included. You can set this to `Number.MAX_SAFE_INTEGER` or `Infinity` to include the entire file content in one hunk. + - `ignoreWhitespace`: Same as in `diffLines`. Defaults to `false`. + - `stripTrailingCr`: Same as in `diffLines`. Defaults to `false`. + +* `Diff.createPatch(fileName, oldStr, newStr[, oldHeader[, newHeader[, options]]])` - creates a unified diff patch. + + Just like Diff.createTwoFilesPatch, but with oldFileName being equal to newFileName. + +* `Diff.formatPatch(patch)` - creates a unified diff patch. + + `patch` may be either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`). + +* `Diff.structuredPatch(oldFileName, newFileName, oldStr, newStr[, oldHeader[, newHeader[, options]]])` - returns an object with an array of hunk objects. + + This method is similar to createTwoFilesPatch, but returns a data structure + suitable for further processing. Parameters are the same as createTwoFilesPatch. The data structure returned may look like this: + + ```js + { + oldFileName: 'oldfile', newFileName: 'newfile', + oldHeader: 'header1', newHeader: 'header2', + hunks: [{ + oldStart: 1, oldLines: 3, newStart: 1, newLines: 3, + lines: [' line2', ' line3', '-line4', '+line5', '\\ No newline at end of file'], + }] + } + ``` + +* `Diff.applyPatch(source, patch[, options])` - attempts to apply a unified diff patch. + + Hunks are applied first to last. `applyPatch` first tries to apply the first hunk at the line number specified in the hunk header, and with all context lines matching exactly. If that fails, it tries scanning backwards and forwards, one line at a time, to find a place to apply the hunk where the context lines match exactly. If that still fails, and `fuzzFactor` is greater than zero, it increments the maximum number of mismatches (missing, extra, or changed context lines) that there can be between the hunk context and a region where we are trying to apply the patch such that the hunk will still be considered to match. Regardless of `fuzzFactor`, lines to be deleted in the hunk *must* be present for a hunk to match, and the context lines *immediately* before and after an insertion must match exactly. + + Once a hunk is successfully fitted, the process begins again with the next hunk. Regardless of `fuzzFactor`, later hunks must be applied later in the file than earlier hunks. + + If a hunk cannot be successfully fitted *anywhere* with fewer than `fuzzFactor` mismatches, `applyPatch` fails and returns `false`. + + If a hunk is successfully fitted but not at the line number specified by the hunk header, all subsequent hunks have their target line number adjusted accordingly. (e.g. if the first hunk is applied 10 lines below where the hunk header said it should fit, `applyPatch` will *start* looking for somewhere to apply the second hunk 10 lines below where its hunk header says it goes.) + + If the patch was applied successfully, returns a string containing the patched text. If the patch could not be applied (because some hunks in the patch couldn't be fitted to the text in `source`), `applyPatch` returns false. + + `patch` may be a string diff or the output from the `parsePatch` or `structuredPatch` methods. + + The optional `options` object may have the following keys: + + - `fuzzFactor`: Maximum Levenshtein distance (in lines deleted, added, or subtituted) between the context shown in a patch hunk and the lines found in the file. Defaults to 0. + - `autoConvertLineEndings`: If `true`, and if the file to be patched consistently uses different line endings to the patch (i.e. either the file always uses Unix line endings while the patch uses Windows ones, or vice versa), then `applyPatch` will behave as if the line endings in the patch were the same as those in the source file. (If `false`, the patch will usually fail to apply in such circumstances since lines deleted in the patch won't be considered to match those in the source file.) Defaults to `true`. + - `compareLine(lineNumber, line, operation, patchContent)`: Callback used to compare to given lines to determine if they should be considered equal when patching. Defaults to strict equality but may be overridden to provide fuzzier comparison. Should return false if the lines should be rejected. + +* `Diff.applyPatches(patch, options)` - applies one or more patches. + + `patch` may be either an array of structured patch objects, or a string representing a patch in unified diff format (which may patch one or more files). + + This method will iterate over the contents of the patch and apply to data provided through callbacks. The general flow for each patch index is: + + - `options.loadFile(index, callback)` is called. The caller should then load the contents of the file and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution. + - `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be the return value from `applyPatch`. When it's ready, the caller should call `callback(err)` callback. Passing an `err` will terminate further patch execution. + + Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made. + +* `Diff.parsePatch(diffStr)` - Parses a patch into structured data + + Return a JSON object representation of the a patch, suitable for use with the `applyPatch` method. This parses to the same structure returned by `Diff.structuredPatch`. + +* `Diff.reversePatch(patch)` - Returns a new structured patch which when applied will undo the original `patch`. + + `patch` may be either a single structured patch object (as returned by `structuredPatch`) or an array of them (as returned by `parsePatch`). + +* `Diff.convertChangesToXML(changes)` - converts a list of change objects to a serialized XML format + +* `Diff.convertChangesToDMP(changes)` - converts a list of change objects to the format returned by Google's [diff-match-patch](https://github.com/google/diff-match-patch) library + +#### Universal `options` + +Certain options can be provided in the `options` object of *any* method that calculates a diff (including `diffChars`, `diffLines` etc. as well as `structuredPatch`, `createPatch`, and `createTwoFilesPatch`): + +* `callback`: if provided, the diff will be computed in async mode to avoid blocking the event loop while the diff is calculated. The value of the `callback` option should be a function and will be passed the computed diff or patch as its first argument. + + (Note that if the ONLY option you want to provide is a callback, you can pass the callback function directly as the `options` parameter instead of passing an object with a `callback` property.) + +* `maxEditLength`: a number specifying the maximum edit distance to consider between the old and new texts. You can use this to limit the computational cost of diffing large, very different texts by giving up early if the cost will be huge. This option can be passed either to diffing functions (`diffLines`, `diffChars`, etc) or to patch-creation function (`structuredPatch`, `createPatch`, etc), all of which will indicate that the max edit length was reached by returning `undefined` instead of whatever they'd normally return. + +* `timeout`: a number of milliseconds after which the diffing algorithm will abort and return `undefined`. Supported by the same functions as `maxEditLength`. + +* `oneChangePerToken`: if `true`, the array of change objects returned will contain one change object per token (e.g. one per line if calling `diffLines`), instead of runs of consecutive tokens that are all added / all removed / all conserved being combined into a single change object. + +### Defining custom diffing behaviors + +If you need behavior a little different to what any of the text diffing functions above offer, you can roll your own by customizing both the tokenization behavior used and the notion of equality used to determine if two tokens are equal. + +The simplest way to customize tokenization behavior is to simply tokenize the texts you want to diff yourself, with your own code, then pass the arrays of tokens to `diffArrays`. For instance, if you wanted a semantically-aware diff of some code, you could try tokenizing it using a parser specific to the programming language the code is in, then passing the arrays of tokens to `diffArrays`. + +To customize the notion of token equality used, use the `comparator` option to `diffArrays`. + +For even more customisation of the diffing behavior, you can create a `new Diff.Diff()` object, overwrite its `castInput`, `tokenize`, `removeEmpty`, `equals`, and `join` properties with your own functions, then call its `diff(oldString, newString[, options])` method. The methods you can overwrite are used as follows: + +* `castInput(value, options)`: used to transform the `oldString` and `newString` before any other steps in the diffing algorithm happen. For instance, `diffJson` uses `castInput` to serialize the objects being diffed to JSON. Defaults to a no-op. +* `tokenize(value, options)`: used to convert each of `oldString` and `newString` (after they've gone through `castInput`) to an array of tokens. Defaults to returning `value.split('')` (returning an array of individual characters). +* `removeEmpty(array)`: called on the arrays of tokens returned by `tokenize` and can be used to modify them. Defaults to stripping out falsey tokens, such as empty strings. `diffArrays` overrides this to simply return the `array`, which means that falsey values like empty strings can be handled like any other token by `diffArrays`. +* `equals(left, right, options)`: called to determine if two tokens (one from the old string, one from the new string) should be considered equal. Defaults to comparing them with `===`. +* `join(tokens)`: gets called with an array of consecutive tokens that have either all been added, all been removed, or are all common. Needs to join them into a single value that can be used as the `value` property of the [change object](#change-objects) for these tokens. Defaults to simply returning `tokens.join('')`. +* `postProcess(changeObjects)`: gets called at the end of the algorithm with the [change objects](#change-objects) produced, and can do final cleanups on them. Defaults to simply returning `changeObjects` unchanged. + +### Change Objects +Many of the methods above return change objects. These objects consist of the following fields: + +* `value`: The concatenated content of all the tokens represented by this change object - i.e. generally the text that is either added, deleted, or common, as a single string. In cases where tokens are considered common but are non-identical (e.g. because an option like `ignoreCase` or a custom `comparator` was used), the value from the *new* string will be provided here. +* `added`: true if the value was inserted into the new string, otherwise false +* `removed`: true if the value was removed from the old string, otherwise false +* `count`: How many tokens (e.g. chars for `diffChars`, lines for `diffLines`) the value in the change object consists of + +(Change objects where `added` and `removed` are both false represent content that is common to the old and new strings.) + +## Examples + +#### Basic example in Node + +```js +require('colors'); +const Diff = require('diff'); + +const one = 'beep boop'; +const other = 'beep boob blah'; + +const diff = Diff.diffChars(one, other); + +diff.forEach((part) => { + // green for additions, red for deletions + let text = part.added ? part.value.bgGreen : + part.removed ? part.value.bgRed : + part.value; + process.stderr.write(text); +}); + +console.log(); +``` +Running the above program should yield + +Node Example + +#### Basic example in a web page + +```html +

+
+
+```
+
+Open the above .html file in a browser and you should see
+
+Node Example
+
+#### Example of generating a patch from Node
+
+The code below is roughly equivalent to the Unix command `diff -u file1.txt file2.txt > mydiff.patch`:
+
+```
+const Diff = require('diff');
+const file1Contents = fs.readFileSync("file1.txt").toString();
+const file2Contents = fs.readFileSync("file2.txt").toString();
+const patch = Diff.createTwoFilesPatch("file1.txt", "file2.txt", file1Contents, file2Contents);
+fs.writeFileSync("mydiff.patch", patch);
+```
+
+#### Examples of parsing and applying a patch from Node
+
+##### Applying a patch to a specified file
+
+The code below is roughly equivalent to the Unix command `patch file1.txt mydiff.patch`:
+
+```
+const Diff = require('diff');
+const file1Contents = fs.readFileSync("file1.txt").toString();
+const patch = fs.readFileSync("mydiff.patch").toString();
+const patchedFile = Diff.applyPatch(file1Contents, patch);
+fs.writeFileSync("file1.txt", patchedFile);
+```
+
+##### Applying a multi-file patch to the files specified by the patch file itself
+
+The code below is roughly equivalent to the Unix command `patch < mydiff.patch`:
+
+```
+const Diff = require('diff');
+const patch = fs.readFileSync("mydiff.patch").toString();
+Diff.applyPatches(patch, {
+    loadFile: (patch, callback) => {
+        let fileContents;
+        try {
+            fileContents = fs.readFileSync(patch.oldFileName).toString();
+        } catch (e) {
+            callback(`No such file: ${patch.oldFileName}`);
+            return;
+        }
+        callback(undefined, fileContents);
+    },
+    patched: (patch, patchedContent, callback) => {
+        if (patchedContent === false) {
+            callback(`Failed to apply patch to ${patch.oldFileName}`)
+            return;
+        }
+        fs.writeFileSync(patch.oldFileName, patchedContent);
+        callback();
+    },
+    complete: (err) => {
+        if (err) {
+            console.log("Failed with error:", err);
+        }
+    }
+});
+```
+
+## Compatibility
+
+jsdiff supports all ES3 environments with some known issues on IE8 and below. Under these browsers some diff algorithms such as word diff and others may fail due to lack of support for capturing groups in the `split` operation.
+
+## License
+
+See [LICENSE](https://github.com/kpdecker/jsdiff/blob/master/LICENSE).
+
+## Deviations from the published Myers diff algorithm
+
+jsdiff deviates from the published algorithm in a couple of ways that don't affect results but do affect performance:
+
+* jsdiff keeps track of the diff for each diagonal using a linked list of change objects for each diagonal, rather than the historical array of furthest-reaching D-paths on each diagonal contemplated on page 8 of Myers's paper.
+* jsdiff skips considering diagonals where the furthest-reaching D-path would go off the edge of the edit graph. This dramatically reduces the time cost (from quadratic to linear) in cases where the new text just appends or truncates content at the end of the old text.
diff --git a/node_modules/diff/dist/diff.js b/node_modules/diff/dist/diff.js
new file mode 100644
index 0000000..2c2c333
--- /dev/null
+++ b/node_modules/diff/dist/diff.js
@@ -0,0 +1,2106 @@
+/*!
+
+ diff v7.0.0
+
+BSD 3-Clause License
+
+Copyright (c) 2009-2015, Kevin Decker 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+@license
+*/
+(function (global, factory) {
+  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+  typeof define === 'function' && define.amd ? define(['exports'], factory) :
+  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Diff = {}));
+})(this, (function (exports) { 'use strict';
+
+  function Diff() {}
+  Diff.prototype = {
+    diff: function diff(oldString, newString) {
+      var _options$timeout;
+      var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+      var callback = options.callback;
+      if (typeof options === 'function') {
+        callback = options;
+        options = {};
+      }
+      var self = this;
+      function done(value) {
+        value = self.postProcess(value, options);
+        if (callback) {
+          setTimeout(function () {
+            callback(value);
+          }, 0);
+          return true;
+        } else {
+          return value;
+        }
+      }
+
+      // Allow subclasses to massage the input prior to running
+      oldString = this.castInput(oldString, options);
+      newString = this.castInput(newString, options);
+      oldString = this.removeEmpty(this.tokenize(oldString, options));
+      newString = this.removeEmpty(this.tokenize(newString, options));
+      var newLen = newString.length,
+        oldLen = oldString.length;
+      var editLength = 1;
+      var maxEditLength = newLen + oldLen;
+      if (options.maxEditLength != null) {
+        maxEditLength = Math.min(maxEditLength, options.maxEditLength);
+      }
+      var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
+      var abortAfterTimestamp = Date.now() + maxExecutionTime;
+      var bestPath = [{
+        oldPos: -1,
+        lastComponent: undefined
+      }];
+
+      // Seed editLength = 0, i.e. the content starts with the same values
+      var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options);
+      if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+        // Identity per the equality and tokenizer
+        return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken));
+      }
+
+      // Once we hit the right edge of the edit graph on some diagonal k, we can
+      // definitely reach the end of the edit graph in no more than k edits, so
+      // there's no point in considering any moves to diagonal k+1 any more (from
+      // which we're guaranteed to need at least k+1 more edits).
+      // Similarly, once we've reached the bottom of the edit graph, there's no
+      // point considering moves to lower diagonals.
+      // We record this fact by setting minDiagonalToConsider and
+      // maxDiagonalToConsider to some finite value once we've hit the edge of
+      // the edit graph.
+      // This optimization is not faithful to the original algorithm presented in
+      // Myers's paper, which instead pointlessly extends D-paths off the end of
+      // the edit graph - see page 7 of Myers's paper which notes this point
+      // explicitly and illustrates it with a diagram. This has major performance
+      // implications for some common scenarios. For instance, to compute a diff
+      // where the new text simply appends d characters on the end of the
+      // original text of length n, the true Myers algorithm will take O(n+d^2)
+      // time while this optimization needs only O(n+d) time.
+      var minDiagonalToConsider = -Infinity,
+        maxDiagonalToConsider = Infinity;
+
+      // Main worker method. checks all permutations of a given edit length for acceptance.
+      function execEditLength() {
+        for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
+          var basePath = void 0;
+          var removePath = bestPath[diagonalPath - 1],
+            addPath = bestPath[diagonalPath + 1];
+          if (removePath) {
+            // No one else is going to attempt to use this value, clear it
+            bestPath[diagonalPath - 1] = undefined;
+          }
+          var canAdd = false;
+          if (addPath) {
+            // what newPos will be after we do an insertion:
+            var addPathNewPos = addPath.oldPos - diagonalPath;
+            canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
+          }
+          var canRemove = removePath && removePath.oldPos + 1 < oldLen;
+          if (!canAdd && !canRemove) {
+            // If this path is a terminal then prune
+            bestPath[diagonalPath] = undefined;
+            continue;
+          }
+
+          // Select the diagonal that we want to branch from. We select the prior
+          // path whose position in the old string is the farthest from the origin
+          // and does not pass the bounds of the diff graph
+          if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
+            basePath = self.addToPath(addPath, true, false, 0, options);
+          } else {
+            basePath = self.addToPath(removePath, false, true, 1, options);
+          }
+          newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options);
+          if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+            // If we have hit the end of both strings, then we are done
+            return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
+          } else {
+            bestPath[diagonalPath] = basePath;
+            if (basePath.oldPos + 1 >= oldLen) {
+              maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
+            }
+            if (newPos + 1 >= newLen) {
+              minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
+            }
+          }
+        }
+        editLength++;
+      }
+
+      // Performs the length of edit iteration. Is a bit fugly as this has to support the
+      // sync and async mode which is never fun. Loops over execEditLength until a value
+      // is produced, or until the edit length exceeds options.maxEditLength (if given),
+      // in which case it will return undefined.
+      if (callback) {
+        (function exec() {
+          setTimeout(function () {
+            if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
+              return callback();
+            }
+            if (!execEditLength()) {
+              exec();
+            }
+          }, 0);
+        })();
+      } else {
+        while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
+          var ret = execEditLength();
+          if (ret) {
+            return ret;
+          }
+        }
+      }
+    },
+    addToPath: function addToPath(path, added, removed, oldPosInc, options) {
+      var last = path.lastComponent;
+      if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
+        return {
+          oldPos: path.oldPos + oldPosInc,
+          lastComponent: {
+            count: last.count + 1,
+            added: added,
+            removed: removed,
+            previousComponent: last.previousComponent
+          }
+        };
+      } else {
+        return {
+          oldPos: path.oldPos + oldPosInc,
+          lastComponent: {
+            count: 1,
+            added: added,
+            removed: removed,
+            previousComponent: last
+          }
+        };
+      }
+    },
+    extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) {
+      var newLen = newString.length,
+        oldLen = oldString.length,
+        oldPos = basePath.oldPos,
+        newPos = oldPos - diagonalPath,
+        commonCount = 0;
+      while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) {
+        newPos++;
+        oldPos++;
+        commonCount++;
+        if (options.oneChangePerToken) {
+          basePath.lastComponent = {
+            count: 1,
+            previousComponent: basePath.lastComponent,
+            added: false,
+            removed: false
+          };
+        }
+      }
+      if (commonCount && !options.oneChangePerToken) {
+        basePath.lastComponent = {
+          count: commonCount,
+          previousComponent: basePath.lastComponent,
+          added: false,
+          removed: false
+        };
+      }
+      basePath.oldPos = oldPos;
+      return newPos;
+    },
+    equals: function equals(left, right, options) {
+      if (options.comparator) {
+        return options.comparator(left, right);
+      } else {
+        return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase();
+      }
+    },
+    removeEmpty: function removeEmpty(array) {
+      var ret = [];
+      for (var i = 0; i < array.length; i++) {
+        if (array[i]) {
+          ret.push(array[i]);
+        }
+      }
+      return ret;
+    },
+    castInput: function castInput(value) {
+      return value;
+    },
+    tokenize: function tokenize(value) {
+      return Array.from(value);
+    },
+    join: function join(chars) {
+      return chars.join('');
+    },
+    postProcess: function postProcess(changeObjects) {
+      return changeObjects;
+    }
+  };
+  function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
+    // First we convert our linked list of components in reverse order to an
+    // array in the right order:
+    var components = [];
+    var nextComponent;
+    while (lastComponent) {
+      components.push(lastComponent);
+      nextComponent = lastComponent.previousComponent;
+      delete lastComponent.previousComponent;
+      lastComponent = nextComponent;
+    }
+    components.reverse();
+    var componentPos = 0,
+      componentLen = components.length,
+      newPos = 0,
+      oldPos = 0;
+    for (; componentPos < componentLen; componentPos++) {
+      var component = components[componentPos];
+      if (!component.removed) {
+        if (!component.added && useLongestToken) {
+          var value = newString.slice(newPos, newPos + component.count);
+          value = value.map(function (value, i) {
+            var oldValue = oldString[oldPos + i];
+            return oldValue.length > value.length ? oldValue : value;
+          });
+          component.value = diff.join(value);
+        } else {
+          component.value = diff.join(newString.slice(newPos, newPos + component.count));
+        }
+        newPos += component.count;
+
+        // Common case
+        if (!component.added) {
+          oldPos += component.count;
+        }
+      } else {
+        component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
+        oldPos += component.count;
+      }
+    }
+    return components;
+  }
+
+  var characterDiff = new Diff();
+  function diffChars(oldStr, newStr, options) {
+    return characterDiff.diff(oldStr, newStr, options);
+  }
+
+  function longestCommonPrefix(str1, str2) {
+    var i;
+    for (i = 0; i < str1.length && i < str2.length; i++) {
+      if (str1[i] != str2[i]) {
+        return str1.slice(0, i);
+      }
+    }
+    return str1.slice(0, i);
+  }
+  function longestCommonSuffix(str1, str2) {
+    var i;
+
+    // Unlike longestCommonPrefix, we need a special case to handle all scenarios
+    // where we return the empty string since str1.slice(-0) will return the
+    // entire string.
+    if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
+      return '';
+    }
+    for (i = 0; i < str1.length && i < str2.length; i++) {
+      if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
+        return str1.slice(-i);
+      }
+    }
+    return str1.slice(-i);
+  }
+  function replacePrefix(string, oldPrefix, newPrefix) {
+    if (string.slice(0, oldPrefix.length) != oldPrefix) {
+      throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug"));
+    }
+    return newPrefix + string.slice(oldPrefix.length);
+  }
+  function replaceSuffix(string, oldSuffix, newSuffix) {
+    if (!oldSuffix) {
+      return string + newSuffix;
+    }
+    if (string.slice(-oldSuffix.length) != oldSuffix) {
+      throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug"));
+    }
+    return string.slice(0, -oldSuffix.length) + newSuffix;
+  }
+  function removePrefix(string, oldPrefix) {
+    return replacePrefix(string, oldPrefix, '');
+  }
+  function removeSuffix(string, oldSuffix) {
+    return replaceSuffix(string, oldSuffix, '');
+  }
+  function maximumOverlap(string1, string2) {
+    return string2.slice(0, overlapCount(string1, string2));
+  }
+
+  // Nicked from https://stackoverflow.com/a/60422853/1709587
+  function overlapCount(a, b) {
+    // Deal with cases where the strings differ in length
+    var startA = 0;
+    if (a.length > b.length) {
+      startA = a.length - b.length;
+    }
+    var endB = b.length;
+    if (a.length < b.length) {
+      endB = a.length;
+    }
+    // Create a back-reference for each index
+    //   that should be followed in case of a mismatch.
+    //   We only need B to make these references:
+    var map = Array(endB);
+    var k = 0; // Index that lags behind j
+    map[0] = 0;
+    for (var j = 1; j < endB; j++) {
+      if (b[j] == b[k]) {
+        map[j] = map[k]; // skip over the same character (optional optimisation)
+      } else {
+        map[j] = k;
+      }
+      while (k > 0 && b[j] != b[k]) {
+        k = map[k];
+      }
+      if (b[j] == b[k]) {
+        k++;
+      }
+    }
+    // Phase 2: use these references while iterating over A
+    k = 0;
+    for (var i = startA; i < a.length; i++) {
+      while (k > 0 && a[i] != b[k]) {
+        k = map[k];
+      }
+      if (a[i] == b[k]) {
+        k++;
+      }
+    }
+    return k;
+  }
+
+  /**
+   * Returns true if the string consistently uses Windows line endings.
+   */
+  function hasOnlyWinLineEndings(string) {
+    return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/);
+  }
+
+  /**
+   * Returns true if the string consistently uses Unix line endings.
+   */
+  function hasOnlyUnixLineEndings(string) {
+    return !string.includes('\r\n') && string.includes('\n');
+  }
+
+  // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
+  //
+  // Ranges and exceptions:
+  // Latin-1 Supplement, 0080–00FF
+  //  - U+00D7  × Multiplication sign
+  //  - U+00F7  ÷ Division sign
+  // Latin Extended-A, 0100–017F
+  // Latin Extended-B, 0180–024F
+  // IPA Extensions, 0250–02AF
+  // Spacing Modifier Letters, 02B0–02FF
+  //  - U+02C7  ˇ ˇ  Caron
+  //  - U+02D8  ˘ ˘  Breve
+  //  - U+02D9  ˙ ˙  Dot Above
+  //  - U+02DA  ˚ ˚  Ring Above
+  //  - U+02DB  ˛ ˛  Ogonek
+  //  - U+02DC  ˜ ˜  Small Tilde
+  //  - U+02DD  ˝ ˝  Double Acute Accent
+  // Latin Extended Additional, 1E00–1EFF
+  var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
+
+  // Each token is one of the following:
+  // - A punctuation mark plus the surrounding whitespace
+  // - A word plus the surrounding whitespace
+  // - Pure whitespace (but only in the special case where this the entire text
+  //   is just whitespace)
+  //
+  // We have to include surrounding whitespace in the tokens because the two
+  // alternative approaches produce horribly broken results:
+  // * If we just discard the whitespace, we can't fully reproduce the original
+  //   text from the sequence of tokens and any attempt to render the diff will
+  //   get the whitespace wrong.
+  // * If we have separate tokens for whitespace, then in a typical text every
+  //   second token will be a single space character. But this often results in
+  //   the optimal diff between two texts being a perverse one that preserves
+  //   the spaces between words but deletes and reinserts actual common words.
+  //   See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640
+  //   for an example.
+  //
+  // Keeping the surrounding whitespace of course has implications for .equals
+  // and .join, not just .tokenize.
+
+  // This regex does NOT fully implement the tokenization rules described above.
+  // Instead, it gives runs of whitespace their own "token". The tokenize method
+  // then handles stitching whitespace tokens onto adjacent word or punctuation
+  // tokens.
+  var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), 'ug');
+  var wordDiff = new Diff();
+  wordDiff.equals = function (left, right, options) {
+    if (options.ignoreCase) {
+      left = left.toLowerCase();
+      right = right.toLowerCase();
+    }
+    return left.trim() === right.trim();
+  };
+  wordDiff.tokenize = function (value) {
+    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+    var parts;
+    if (options.intlSegmenter) {
+      if (options.intlSegmenter.resolvedOptions().granularity != 'word') {
+        throw new Error('The segmenter passed must have a granularity of "word"');
+      }
+      parts = Array.from(options.intlSegmenter.segment(value), function (segment) {
+        return segment.segment;
+      });
+    } else {
+      parts = value.match(tokenizeIncludingWhitespace) || [];
+    }
+    var tokens = [];
+    var prevPart = null;
+    parts.forEach(function (part) {
+      if (/\s/.test(part)) {
+        if (prevPart == null) {
+          tokens.push(part);
+        } else {
+          tokens.push(tokens.pop() + part);
+        }
+      } else if (/\s/.test(prevPart)) {
+        if (tokens[tokens.length - 1] == prevPart) {
+          tokens.push(tokens.pop() + part);
+        } else {
+          tokens.push(prevPart + part);
+        }
+      } else {
+        tokens.push(part);
+      }
+      prevPart = part;
+    });
+    return tokens;
+  };
+  wordDiff.join = function (tokens) {
+    // Tokens being joined here will always have appeared consecutively in the
+    // same text, so we can simply strip off the leading whitespace from all the
+    // tokens except the first (and except any whitespace-only tokens - but such
+    // a token will always be the first and only token anyway) and then join them
+    // and the whitespace around words and punctuation will end up correct.
+    return tokens.map(function (token, i) {
+      if (i == 0) {
+        return token;
+      } else {
+        return token.replace(/^\s+/, '');
+      }
+    }).join('');
+  };
+  wordDiff.postProcess = function (changes, options) {
+    if (!changes || options.oneChangePerToken) {
+      return changes;
+    }
+    var lastKeep = null;
+    // Change objects representing any insertion or deletion since the last
+    // "keep" change object. There can be at most one of each.
+    var insertion = null;
+    var deletion = null;
+    changes.forEach(function (change) {
+      if (change.added) {
+        insertion = change;
+      } else if (change.removed) {
+        deletion = change;
+      } else {
+        if (insertion || deletion) {
+          // May be false at start of text
+          dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
+        }
+        lastKeep = change;
+        insertion = null;
+        deletion = null;
+      }
+    });
+    if (insertion || deletion) {
+      dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
+    }
+    return changes;
+  };
+  function diffWords(oldStr, newStr, options) {
+    // This option has never been documented and never will be (it's clearer to
+    // just call `diffWordsWithSpace` directly if you need that behavior), but
+    // has existed in jsdiff for a long time, so we retain support for it here
+    // for the sake of backwards compatibility.
+    if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) {
+      return diffWordsWithSpace(oldStr, newStr, options);
+    }
+    return wordDiff.diff(oldStr, newStr, options);
+  }
+  function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
+    // Before returning, we tidy up the leading and trailing whitespace of the
+    // change objects to eliminate cases where trailing whitespace in one object
+    // is repeated as leading whitespace in the next.
+    // Below are examples of the outcomes we want here to explain the code.
+    // I=insert, K=keep, D=delete
+    // 1. diffing 'foo bar baz' vs 'foo baz'
+    //    Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'
+    //    After cleanup, we want:   K:'foo ' D:'bar ' K:'baz'
+    //
+    // 2. Diffing 'foo bar baz' vs 'foo qux baz'
+    //    Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz'
+    //    After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz'
+    //
+    // 3. Diffing 'foo\nbar baz' vs 'foo baz'
+    //    Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz'
+    //    After cleanup, we want K'foo' D:'\nbar' K:' baz'
+    //
+    // 4. Diffing 'foo baz' vs 'foo\nbar baz'
+    //    Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz'
+    //    After cleanup, we ideally want K'foo' I:'\nbar' K:' baz'
+    //    but don't actually manage this currently (the pre-cleanup change
+    //    objects don't contain enough information to make it possible).
+    //
+    // 5. Diffing 'foo   bar baz' vs 'foo  baz'
+    //    Prior to cleanup, we have K:'foo  ' D:'   bar ' K:'  baz'
+    //    After cleanup, we want K:'foo  ' D:' bar ' K:'baz'
+    //
+    // Our handling is unavoidably imperfect in the case where there's a single
+    // indel between keeps and the whitespace has changed. For instance, consider
+    // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change
+    // object to represent the insertion of the space character (which isn't even
+    // a token), we have no way to avoid losing information about the texts'
+    // original whitespace in the result we return. Still, we do our best to
+    // output something that will look sensible if we e.g. print it with
+    // insertions in green and deletions in red.
+
+    // Between two "keep" change objects (or before the first or after the last
+    // change object), we can have either:
+    // * A "delete" followed by an "insert"
+    // * Just an "insert"
+    // * Just a "delete"
+    // We handle the three cases separately.
+    if (deletion && insertion) {
+      var oldWsPrefix = deletion.value.match(/^\s*/)[0];
+      var oldWsSuffix = deletion.value.match(/\s*$/)[0];
+      var newWsPrefix = insertion.value.match(/^\s*/)[0];
+      var newWsSuffix = insertion.value.match(/\s*$/)[0];
+      if (startKeep) {
+        var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
+        startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
+        deletion.value = removePrefix(deletion.value, commonWsPrefix);
+        insertion.value = removePrefix(insertion.value, commonWsPrefix);
+      }
+      if (endKeep) {
+        var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
+        endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
+        deletion.value = removeSuffix(deletion.value, commonWsSuffix);
+        insertion.value = removeSuffix(insertion.value, commonWsSuffix);
+      }
+    } else if (insertion) {
+      // The whitespaces all reflect what was in the new text rather than
+      // the old, so we essentially have no information about whitespace
+      // insertion or deletion. We just want to dedupe the whitespace.
+      // We do that by having each change object keep its trailing
+      // whitespace and deleting duplicate leading whitespace where
+      // present.
+      if (startKeep) {
+        insertion.value = insertion.value.replace(/^\s*/, '');
+      }
+      if (endKeep) {
+        endKeep.value = endKeep.value.replace(/^\s*/, '');
+      }
+      // otherwise we've got a deletion and no insertion
+    } else if (startKeep && endKeep) {
+      var newWsFull = endKeep.value.match(/^\s*/)[0],
+        delWsStart = deletion.value.match(/^\s*/)[0],
+        delWsEnd = deletion.value.match(/\s*$/)[0];
+
+      // Any whitespace that comes straight after startKeep in both the old and
+      // new texts, assign to startKeep and remove from the deletion.
+      var newWsStart = longestCommonPrefix(newWsFull, delWsStart);
+      deletion.value = removePrefix(deletion.value, newWsStart);
+
+      // Any whitespace that comes straight before endKeep in both the old and
+      // new texts, and hasn't already been assigned to startKeep, assign to
+      // endKeep and remove from the deletion.
+      var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
+      deletion.value = removeSuffix(deletion.value, newWsEnd);
+      endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
+
+      // If there's any whitespace from the new text that HASN'T already been
+      // assigned, assign it to the start:
+      startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
+    } else if (endKeep) {
+      // We are at the start of the text. Preserve all the whitespace on
+      // endKeep, and just remove whitespace from the end of deletion to the
+      // extent that it overlaps with the start of endKeep.
+      var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0];
+      var deletionWsSuffix = deletion.value.match(/\s*$/)[0];
+      var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
+      deletion.value = removeSuffix(deletion.value, overlap);
+    } else if (startKeep) {
+      // We are at the END of the text. Preserve all the whitespace on
+      // startKeep, and just remove whitespace from the start of deletion to
+      // the extent that it overlaps with the end of startKeep.
+      var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0];
+      var deletionWsPrefix = deletion.value.match(/^\s*/)[0];
+      var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
+      deletion.value = removePrefix(deletion.value, _overlap);
+    }
+  }
+  var wordWithSpaceDiff = new Diff();
+  wordWithSpaceDiff.tokenize = function (value) {
+    // Slightly different to the tokenizeIncludingWhitespace regex used above in
+    // that this one treats each individual newline as a distinct tokens, rather
+    // than merging them into other surrounding whitespace. This was requested
+    // in https://github.com/kpdecker/jsdiff/issues/180 &
+    //    https://github.com/kpdecker/jsdiff/issues/211
+    var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), 'ug');
+    return value.match(regex) || [];
+  };
+  function diffWordsWithSpace(oldStr, newStr, options) {
+    return wordWithSpaceDiff.diff(oldStr, newStr, options);
+  }
+
+  function generateOptions(options, defaults) {
+    if (typeof options === 'function') {
+      defaults.callback = options;
+    } else if (options) {
+      for (var name in options) {
+        /* istanbul ignore else */
+        if (options.hasOwnProperty(name)) {
+          defaults[name] = options[name];
+        }
+      }
+    }
+    return defaults;
+  }
+
+  var lineDiff = new Diff();
+  lineDiff.tokenize = function (value, options) {
+    if (options.stripTrailingCr) {
+      // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
+      value = value.replace(/\r\n/g, '\n');
+    }
+    var retLines = [],
+      linesAndNewlines = value.split(/(\n|\r\n)/);
+
+    // Ignore the final empty token that occurs if the string ends with a new line
+    if (!linesAndNewlines[linesAndNewlines.length - 1]) {
+      linesAndNewlines.pop();
+    }
+
+    // Merge the content and line separators into single tokens
+    for (var i = 0; i < linesAndNewlines.length; i++) {
+      var line = linesAndNewlines[i];
+      if (i % 2 && !options.newlineIsToken) {
+        retLines[retLines.length - 1] += line;
+      } else {
+        retLines.push(line);
+      }
+    }
+    return retLines;
+  };
+  lineDiff.equals = function (left, right, options) {
+    // If we're ignoring whitespace, we need to normalise lines by stripping
+    // whitespace before checking equality. (This has an annoying interaction
+    // with newlineIsToken that requires special handling: if newlines get their
+    // own token, then we DON'T want to trim the *newline* tokens down to empty
+    // strings, since this would cause us to treat whitespace-only line content
+    // as equal to a separator between lines, which would be weird and
+    // inconsistent with the documented behavior of the options.)
+    if (options.ignoreWhitespace) {
+      if (!options.newlineIsToken || !left.includes('\n')) {
+        left = left.trim();
+      }
+      if (!options.newlineIsToken || !right.includes('\n')) {
+        right = right.trim();
+      }
+    } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
+      if (left.endsWith('\n')) {
+        left = left.slice(0, -1);
+      }
+      if (right.endsWith('\n')) {
+        right = right.slice(0, -1);
+      }
+    }
+    return Diff.prototype.equals.call(this, left, right, options);
+  };
+  function diffLines(oldStr, newStr, callback) {
+    return lineDiff.diff(oldStr, newStr, callback);
+  }
+
+  // Kept for backwards compatibility. This is a rather arbitrary wrapper method
+  // that just calls `diffLines` with `ignoreWhitespace: true`. It's confusing to
+  // have two ways to do exactly the same thing in the API, so we no longer
+  // document this one (library users should explicitly use `diffLines` with
+  // `ignoreWhitespace: true` instead) but we keep it around to maintain
+  // compatibility with code that used old versions.
+  function diffTrimmedLines(oldStr, newStr, callback) {
+    var options = generateOptions(callback, {
+      ignoreWhitespace: true
+    });
+    return lineDiff.diff(oldStr, newStr, options);
+  }
+
+  var sentenceDiff = new Diff();
+  sentenceDiff.tokenize = function (value) {
+    return value.split(/(\S.+?[.!?])(?=\s+|$)/);
+  };
+  function diffSentences(oldStr, newStr, callback) {
+    return sentenceDiff.diff(oldStr, newStr, callback);
+  }
+
+  var cssDiff = new Diff();
+  cssDiff.tokenize = function (value) {
+    return value.split(/([{}:;,]|\s+)/);
+  };
+  function diffCss(oldStr, newStr, callback) {
+    return cssDiff.diff(oldStr, newStr, callback);
+  }
+
+  function ownKeys(e, r) {
+    var t = Object.keys(e);
+    if (Object.getOwnPropertySymbols) {
+      var o = Object.getOwnPropertySymbols(e);
+      r && (o = o.filter(function (r) {
+        return Object.getOwnPropertyDescriptor(e, r).enumerable;
+      })), t.push.apply(t, o);
+    }
+    return t;
+  }
+  function _objectSpread2(e) {
+    for (var r = 1; r < arguments.length; r++) {
+      var t = null != arguments[r] ? arguments[r] : {};
+      r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
+        _defineProperty(e, r, t[r]);
+      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
+        Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
+      });
+    }
+    return e;
+  }
+  function _toPrimitive(t, r) {
+    if ("object" != typeof t || !t) return t;
+    var e = t[Symbol.toPrimitive];
+    if (void 0 !== e) {
+      var i = e.call(t, r || "default");
+      if ("object" != typeof i) return i;
+      throw new TypeError("@@toPrimitive must return a primitive value.");
+    }
+    return ("string" === r ? String : Number)(t);
+  }
+  function _toPropertyKey(t) {
+    var i = _toPrimitive(t, "string");
+    return "symbol" == typeof i ? i : i + "";
+  }
+  function _typeof(o) {
+    "@babel/helpers - typeof";
+
+    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
+      return typeof o;
+    } : function (o) {
+      return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
+    }, _typeof(o);
+  }
+  function _defineProperty(obj, key, value) {
+    key = _toPropertyKey(key);
+    if (key in obj) {
+      Object.defineProperty(obj, key, {
+        value: value,
+        enumerable: true,
+        configurable: true,
+        writable: true
+      });
+    } else {
+      obj[key] = value;
+    }
+    return obj;
+  }
+  function _toConsumableArray(arr) {
+    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+  }
+  function _arrayWithoutHoles(arr) {
+    if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+  }
+  function _iterableToArray(iter) {
+    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+  }
+  function _unsupportedIterableToArray(o, minLen) {
+    if (!o) return;
+    if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+    var n = Object.prototype.toString.call(o).slice(8, -1);
+    if (n === "Object" && o.constructor) n = o.constructor.name;
+    if (n === "Map" || n === "Set") return Array.from(o);
+    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+  }
+  function _arrayLikeToArray(arr, len) {
+    if (len == null || len > arr.length) len = arr.length;
+    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+    return arr2;
+  }
+  function _nonIterableSpread() {
+    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+  }
+
+  var jsonDiff = new Diff();
+  // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
+  // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
+  jsonDiff.useLongestToken = true;
+  jsonDiff.tokenize = lineDiff.tokenize;
+  jsonDiff.castInput = function (value, options) {
+    var undefinedReplacement = options.undefinedReplacement,
+      _options$stringifyRep = options.stringifyReplacer,
+      stringifyReplacer = _options$stringifyRep === void 0 ? function (k, v) {
+        return typeof v === 'undefined' ? undefinedReplacement : v;
+      } : _options$stringifyRep;
+    return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, '  ');
+  };
+  jsonDiff.equals = function (left, right, options) {
+    return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options);
+  };
+  function diffJson(oldObj, newObj, options) {
+    return jsonDiff.diff(oldObj, newObj, options);
+  }
+
+  // This function handles the presence of circular references by bailing out when encountering an
+  // object that is already on the "stack" of items being processed. Accepts an optional replacer
+  function canonicalize(obj, stack, replacementStack, replacer, key) {
+    stack = stack || [];
+    replacementStack = replacementStack || [];
+    if (replacer) {
+      obj = replacer(key, obj);
+    }
+    var i;
+    for (i = 0; i < stack.length; i += 1) {
+      if (stack[i] === obj) {
+        return replacementStack[i];
+      }
+    }
+    var canonicalizedObj;
+    if ('[object Array]' === Object.prototype.toString.call(obj)) {
+      stack.push(obj);
+      canonicalizedObj = new Array(obj.length);
+      replacementStack.push(canonicalizedObj);
+      for (i = 0; i < obj.length; i += 1) {
+        canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
+      }
+      stack.pop();
+      replacementStack.pop();
+      return canonicalizedObj;
+    }
+    if (obj && obj.toJSON) {
+      obj = obj.toJSON();
+    }
+    if (_typeof(obj) === 'object' && obj !== null) {
+      stack.push(obj);
+      canonicalizedObj = {};
+      replacementStack.push(canonicalizedObj);
+      var sortedKeys = [],
+        _key;
+      for (_key in obj) {
+        /* istanbul ignore else */
+        if (Object.prototype.hasOwnProperty.call(obj, _key)) {
+          sortedKeys.push(_key);
+        }
+      }
+      sortedKeys.sort();
+      for (i = 0; i < sortedKeys.length; i += 1) {
+        _key = sortedKeys[i];
+        canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
+      }
+      stack.pop();
+      replacementStack.pop();
+    } else {
+      canonicalizedObj = obj;
+    }
+    return canonicalizedObj;
+  }
+
+  var arrayDiff = new Diff();
+  arrayDiff.tokenize = function (value) {
+    return value.slice();
+  };
+  arrayDiff.join = arrayDiff.removeEmpty = function (value) {
+    return value;
+  };
+  function diffArrays(oldArr, newArr, callback) {
+    return arrayDiff.diff(oldArr, newArr, callback);
+  }
+
+  function unixToWin(patch) {
+    if (Array.isArray(patch)) {
+      return patch.map(unixToWin);
+    }
+    return _objectSpread2(_objectSpread2({}, patch), {}, {
+      hunks: patch.hunks.map(function (hunk) {
+        return _objectSpread2(_objectSpread2({}, hunk), {}, {
+          lines: hunk.lines.map(function (line, i) {
+            var _hunk$lines;
+            return line.startsWith('\\') || line.endsWith('\r') || (_hunk$lines = hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 && _hunk$lines.startsWith('\\') ? line : line + '\r';
+          })
+        });
+      })
+    });
+  }
+  function winToUnix(patch) {
+    if (Array.isArray(patch)) {
+      return patch.map(winToUnix);
+    }
+    return _objectSpread2(_objectSpread2({}, patch), {}, {
+      hunks: patch.hunks.map(function (hunk) {
+        return _objectSpread2(_objectSpread2({}, hunk), {}, {
+          lines: hunk.lines.map(function (line) {
+            return line.endsWith('\r') ? line.substring(0, line.length - 1) : line;
+          })
+        });
+      })
+    });
+  }
+
+  /**
+   * Returns true if the patch consistently uses Unix line endings (or only involves one line and has
+   * no line endings).
+   */
+  function isUnix(patch) {
+    if (!Array.isArray(patch)) {
+      patch = [patch];
+    }
+    return !patch.some(function (index) {
+      return index.hunks.some(function (hunk) {
+        return hunk.lines.some(function (line) {
+          return !line.startsWith('\\') && line.endsWith('\r');
+        });
+      });
+    });
+  }
+
+  /**
+   * Returns true if the patch uses Windows line endings and only Windows line endings.
+   */
+  function isWin(patch) {
+    if (!Array.isArray(patch)) {
+      patch = [patch];
+    }
+    return patch.some(function (index) {
+      return index.hunks.some(function (hunk) {
+        return hunk.lines.some(function (line) {
+          return line.endsWith('\r');
+        });
+      });
+    }) && patch.every(function (index) {
+      return index.hunks.every(function (hunk) {
+        return hunk.lines.every(function (line, i) {
+          var _hunk$lines2;
+          return line.startsWith('\\') || line.endsWith('\r') || ((_hunk$lines2 = hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 : _hunk$lines2.startsWith('\\'));
+        });
+      });
+    });
+  }
+
+  function parsePatch(uniDiff) {
+    var diffstr = uniDiff.split(/\n/),
+      list = [],
+      i = 0;
+    function parseIndex() {
+      var index = {};
+      list.push(index);
+
+      // Parse diff metadata
+      while (i < diffstr.length) {
+        var line = diffstr[i];
+
+        // File header found, end parsing diff metadata
+        if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
+          break;
+        }
+
+        // Diff index
+        var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
+        if (header) {
+          index.index = header[1];
+        }
+        i++;
+      }
+
+      // Parse file headers if they are defined. Unified diff requires them, but
+      // there's no technical issues to have an isolated hunk without file header
+      parseFileHeader(index);
+      parseFileHeader(index);
+
+      // Parse hunks
+      index.hunks = [];
+      while (i < diffstr.length) {
+        var _line = diffstr[i];
+        if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) {
+          break;
+        } else if (/^@@/.test(_line)) {
+          index.hunks.push(parseHunk());
+        } else if (_line) {
+          throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
+        } else {
+          i++;
+        }
+      }
+    }
+
+    // Parses the --- and +++ headers, if none are found, no lines
+    // are consumed.
+    function parseFileHeader(index) {
+      var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]);
+      if (fileHeader) {
+        var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
+        var data = fileHeader[2].split('\t', 2);
+        var fileName = data[0].replace(/\\\\/g, '\\');
+        if (/^".*"$/.test(fileName)) {
+          fileName = fileName.substr(1, fileName.length - 2);
+        }
+        index[keyPrefix + 'FileName'] = fileName;
+        index[keyPrefix + 'Header'] = (data[1] || '').trim();
+        i++;
+      }
+    }
+
+    // Parses a hunk
+    // This assumes that we are at the start of a hunk.
+    function parseHunk() {
+      var chunkHeaderIndex = i,
+        chunkHeaderLine = diffstr[i++],
+        chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
+      var hunk = {
+        oldStart: +chunkHeader[1],
+        oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
+        newStart: +chunkHeader[3],
+        newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
+        lines: []
+      };
+
+      // Unified Diff Format quirk: If the chunk size is 0,
+      // the first number is one lower than one would expect.
+      // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+      if (hunk.oldLines === 0) {
+        hunk.oldStart += 1;
+      }
+      if (hunk.newLines === 0) {
+        hunk.newStart += 1;
+      }
+      var addCount = 0,
+        removeCount = 0;
+      for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || (_diffstr$i = diffstr[i]) !== null && _diffstr$i !== void 0 && _diffstr$i.startsWith('\\')); i++) {
+        var _diffstr$i;
+        var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
+        if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
+          hunk.lines.push(diffstr[i]);
+          if (operation === '+') {
+            addCount++;
+          } else if (operation === '-') {
+            removeCount++;
+          } else if (operation === ' ') {
+            addCount++;
+            removeCount++;
+          }
+        } else {
+          throw new Error("Hunk at line ".concat(chunkHeaderIndex + 1, " contained invalid line ").concat(diffstr[i]));
+        }
+      }
+
+      // Handle the empty block count case
+      if (!addCount && hunk.newLines === 1) {
+        hunk.newLines = 0;
+      }
+      if (!removeCount && hunk.oldLines === 1) {
+        hunk.oldLines = 0;
+      }
+
+      // Perform sanity checking
+      if (addCount !== hunk.newLines) {
+        throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+      }
+      if (removeCount !== hunk.oldLines) {
+        throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+      }
+      return hunk;
+    }
+    while (i < diffstr.length) {
+      parseIndex();
+    }
+    return list;
+  }
+
+  // Iterator that traverses in the range of [min, max], stepping
+  // by distance from a given start position. I.e. for [0, 4], with
+  // start of 2, this will iterate 2, 3, 1, 4, 0.
+  function distanceIterator (start, minLine, maxLine) {
+    var wantForward = true,
+      backwardExhausted = false,
+      forwardExhausted = false,
+      localOffset = 1;
+    return function iterator() {
+      if (wantForward && !forwardExhausted) {
+        if (backwardExhausted) {
+          localOffset++;
+        } else {
+          wantForward = false;
+        }
+
+        // Check if trying to fit beyond text length, and if not, check it fits
+        // after offset location (or desired location on first iteration)
+        if (start + localOffset <= maxLine) {
+          return start + localOffset;
+        }
+        forwardExhausted = true;
+      }
+      if (!backwardExhausted) {
+        if (!forwardExhausted) {
+          wantForward = true;
+        }
+
+        // Check if trying to fit before text beginning, and if not, check it fits
+        // before offset location
+        if (minLine <= start - localOffset) {
+          return start - localOffset++;
+        }
+        backwardExhausted = true;
+        return iterator();
+      }
+
+      // We tried to fit hunk before text beginning and beyond text length, then
+      // hunk can't fit on the text. Return undefined
+    };
+  }
+
+  function applyPatch(source, uniDiff) {
+    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+    if (typeof uniDiff === 'string') {
+      uniDiff = parsePatch(uniDiff);
+    }
+    if (Array.isArray(uniDiff)) {
+      if (uniDiff.length > 1) {
+        throw new Error('applyPatch only works with a single input.');
+      }
+      uniDiff = uniDiff[0];
+    }
+    if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) {
+      if (hasOnlyWinLineEndings(source) && isUnix(uniDiff)) {
+        uniDiff = unixToWin(uniDiff);
+      } else if (hasOnlyUnixLineEndings(source) && isWin(uniDiff)) {
+        uniDiff = winToUnix(uniDiff);
+      }
+    }
+
+    // Apply the diff to the input
+    var lines = source.split('\n'),
+      hunks = uniDiff.hunks,
+      compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) {
+        return line === patchContent;
+      },
+      fuzzFactor = options.fuzzFactor || 0,
+      minLine = 0;
+    if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) {
+      throw new Error('fuzzFactor must be a non-negative integer');
+    }
+
+    // Special case for empty patch.
+    if (!hunks.length) {
+      return source;
+    }
+
+    // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change
+    // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a
+    // newline that already exists - then we either return false and fail to apply the patch (if
+    // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0).
+    // If we do need to remove/add a newline at EOF, this will always be in the final hunk:
+    var prevLine = '',
+      removeEOFNL = false,
+      addEOFNL = false;
+    for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) {
+      var line = hunks[hunks.length - 1].lines[i];
+      if (line[0] == '\\') {
+        if (prevLine[0] == '+') {
+          removeEOFNL = true;
+        } else if (prevLine[0] == '-') {
+          addEOFNL = true;
+        }
+      }
+      prevLine = line;
+    }
+    if (removeEOFNL) {
+      if (addEOFNL) {
+        // This means the final line gets changed but doesn't have a trailing newline in either the
+        // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if
+        // fuzzFactor is 0, we simply validate that the source file has no trailing newline.
+        if (!fuzzFactor && lines[lines.length - 1] == '') {
+          return false;
+        }
+      } else if (lines[lines.length - 1] == '') {
+        lines.pop();
+      } else if (!fuzzFactor) {
+        return false;
+      }
+    } else if (addEOFNL) {
+      if (lines[lines.length - 1] != '') {
+        lines.push('');
+      } else if (!fuzzFactor) {
+        return false;
+      }
+    }
+
+    /**
+     * Checks if the hunk can be made to fit at the provided location with at most `maxErrors`
+     * insertions, substitutions, or deletions, while ensuring also that:
+     * - lines deleted in the hunk match exactly, and
+     * - wherever an insertion operation or block of insertion operations appears in the hunk, the
+     *   immediately preceding and following lines of context match exactly
+     *
+     * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0].
+     *
+     * If the hunk can be applied, returns an object with properties `oldLineLastI` and
+     * `replacementLines`. Otherwise, returns null.
+     */
+    function applyHunk(hunkLines, toPos, maxErrors) {
+      var hunkLinesI = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
+      var lastContextLineMatched = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
+      var patchedLines = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
+      var patchedLinesLength = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
+      var nConsecutiveOldContextLines = 0;
+      var nextContextLineMustMatch = false;
+      for (; hunkLinesI < hunkLines.length; hunkLinesI++) {
+        var hunkLine = hunkLines[hunkLinesI],
+          operation = hunkLine.length > 0 ? hunkLine[0] : ' ',
+          content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine;
+        if (operation === '-') {
+          if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+            toPos++;
+            nConsecutiveOldContextLines = 0;
+          } else {
+            if (!maxErrors || lines[toPos] == null) {
+              return null;
+            }
+            patchedLines[patchedLinesLength] = lines[toPos];
+            return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1);
+          }
+        }
+        if (operation === '+') {
+          if (!lastContextLineMatched) {
+            return null;
+          }
+          patchedLines[patchedLinesLength] = content;
+          patchedLinesLength++;
+          nConsecutiveOldContextLines = 0;
+          nextContextLineMustMatch = true;
+        }
+        if (operation === ' ') {
+          nConsecutiveOldContextLines++;
+          patchedLines[patchedLinesLength] = lines[toPos];
+          if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+            patchedLinesLength++;
+            lastContextLineMatched = true;
+            nextContextLineMustMatch = false;
+            toPos++;
+          } else {
+            if (nextContextLineMustMatch || !maxErrors) {
+              return null;
+            }
+
+            // Consider 3 possibilities in sequence:
+            // 1. lines contains a *substitution* not included in the patch context, or
+            // 2. lines contains an *insertion* not included in the patch context, or
+            // 3. lines contains a *deletion* not included in the patch context
+            // The first two options are of course only possible if the line from lines is non-null -
+            // i.e. only option 3 is possible if we've overrun the end of the old file.
+            return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength);
+          }
+        }
+      }
+
+      // Before returning, trim any unmodified context lines off the end of patchedLines and reduce
+      // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region
+      // that starts in this hunk's trailing context.
+      patchedLinesLength -= nConsecutiveOldContextLines;
+      toPos -= nConsecutiveOldContextLines;
+      patchedLines.length = patchedLinesLength;
+      return {
+        patchedLines: patchedLines,
+        oldLineLastI: toPos - 1
+      };
+    }
+    var resultLines = [];
+
+    // Search best fit offsets for each hunk based on the previous ones
+    var prevHunkOffset = 0;
+    for (var _i = 0; _i < hunks.length; _i++) {
+      var hunk = hunks[_i];
+      var hunkResult = void 0;
+      var maxLine = lines.length - hunk.oldLines + fuzzFactor;
+      var toPos = void 0;
+      for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) {
+        toPos = hunk.oldStart + prevHunkOffset - 1;
+        var iterator = distanceIterator(toPos, minLine, maxLine);
+        for (; toPos !== undefined; toPos = iterator()) {
+          hunkResult = applyHunk(hunk.lines, toPos, maxErrors);
+          if (hunkResult) {
+            break;
+          }
+        }
+        if (hunkResult) {
+          break;
+        }
+      }
+      if (!hunkResult) {
+        return false;
+      }
+
+      // Copy everything from the end of where we applied the last hunk to the start of this hunk
+      for (var _i2 = minLine; _i2 < toPos; _i2++) {
+        resultLines.push(lines[_i2]);
+      }
+
+      // Add the lines produced by applying the hunk:
+      for (var _i3 = 0; _i3 < hunkResult.patchedLines.length; _i3++) {
+        var _line = hunkResult.patchedLines[_i3];
+        resultLines.push(_line);
+      }
+
+      // Set lower text limit to end of the current hunk, so next ones don't try
+      // to fit over already patched text
+      minLine = hunkResult.oldLineLastI + 1;
+
+      // Note the offset between where the patch said the hunk should've applied and where we
+      // applied it, so we can adjust future hunks accordingly:
+      prevHunkOffset = toPos + 1 - hunk.oldStart;
+    }
+
+    // Copy over the rest of the lines from the old text
+    for (var _i4 = minLine; _i4 < lines.length; _i4++) {
+      resultLines.push(lines[_i4]);
+    }
+    return resultLines.join('\n');
+  }
+
+  // Wrapper that supports multiple file patches via callbacks.
+  function applyPatches(uniDiff, options) {
+    if (typeof uniDiff === 'string') {
+      uniDiff = parsePatch(uniDiff);
+    }
+    var currentIndex = 0;
+    function processIndex() {
+      var index = uniDiff[currentIndex++];
+      if (!index) {
+        return options.complete();
+      }
+      options.loadFile(index, function (err, data) {
+        if (err) {
+          return options.complete(err);
+        }
+        var updatedContent = applyPatch(data, index, options);
+        options.patched(index, updatedContent, function (err) {
+          if (err) {
+            return options.complete(err);
+          }
+          processIndex();
+        });
+      });
+    }
+    processIndex();
+  }
+
+  function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+    if (!options) {
+      options = {};
+    }
+    if (typeof options === 'function') {
+      options = {
+        callback: options
+      };
+    }
+    if (typeof options.context === 'undefined') {
+      options.context = 4;
+    }
+    if (options.newlineIsToken) {
+      throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions');
+    }
+    if (!options.callback) {
+      return diffLinesResultToPatch(diffLines(oldStr, newStr, options));
+    } else {
+      var _options = options,
+        _callback = _options.callback;
+      diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options), {}, {
+        callback: function callback(diff) {
+          var patch = diffLinesResultToPatch(diff);
+          _callback(patch);
+        }
+      }));
+    }
+    function diffLinesResultToPatch(diff) {
+      // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays
+      //         of lines containing trailing newline characters. We'll tidy up later...
+
+      if (!diff) {
+        return;
+      }
+      diff.push({
+        value: '',
+        lines: []
+      }); // Append an empty value to make cleanup easier
+
+      function contextLines(lines) {
+        return lines.map(function (entry) {
+          return ' ' + entry;
+        });
+      }
+      var hunks = [];
+      var oldRangeStart = 0,
+        newRangeStart = 0,
+        curRange = [],
+        oldLine = 1,
+        newLine = 1;
+      var _loop = function _loop() {
+        var current = diff[i],
+          lines = current.lines || splitLines(current.value);
+        current.lines = lines;
+        if (current.added || current.removed) {
+          var _curRange;
+          // If we have previous context, start with that
+          if (!oldRangeStart) {
+            var prev = diff[i - 1];
+            oldRangeStart = oldLine;
+            newRangeStart = newLine;
+            if (prev) {
+              curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
+              oldRangeStart -= curRange.length;
+              newRangeStart -= curRange.length;
+            }
+          }
+
+          // Output our changes
+          (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) {
+            return (current.added ? '+' : '-') + entry;
+          })));
+
+          // Track the updated file position
+          if (current.added) {
+            newLine += lines.length;
+          } else {
+            oldLine += lines.length;
+          }
+        } else {
+          // Identical context lines. Track line changes
+          if (oldRangeStart) {
+            // Close out any changes that have been output (or join overlapping)
+            if (lines.length <= options.context * 2 && i < diff.length - 2) {
+              var _curRange2;
+              // Overlapping
+              (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
+            } else {
+              var _curRange3;
+              // end the range and output
+              var contextSize = Math.min(lines.length, options.context);
+              (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
+              var _hunk = {
+                oldStart: oldRangeStart,
+                oldLines: oldLine - oldRangeStart + contextSize,
+                newStart: newRangeStart,
+                newLines: newLine - newRangeStart + contextSize,
+                lines: curRange
+              };
+              hunks.push(_hunk);
+              oldRangeStart = 0;
+              newRangeStart = 0;
+              curRange = [];
+            }
+          }
+          oldLine += lines.length;
+          newLine += lines.length;
+        }
+      };
+      for (var i = 0; i < diff.length; i++) {
+        _loop();
+      }
+
+      // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add
+      //         "\ No newline at end of file".
+      for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) {
+        var hunk = _hunks[_i];
+        for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) {
+          if (hunk.lines[_i2].endsWith('\n')) {
+            hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1);
+          } else {
+            hunk.lines.splice(_i2 + 1, 0, '\\ No newline at end of file');
+            _i2++; // Skip the line we just added, then continue iterating
+          }
+        }
+      }
+      return {
+        oldFileName: oldFileName,
+        newFileName: newFileName,
+        oldHeader: oldHeader,
+        newHeader: newHeader,
+        hunks: hunks
+      };
+    }
+  }
+  function formatPatch(diff) {
+    if (Array.isArray(diff)) {
+      return diff.map(formatPatch).join('\n');
+    }
+    var ret = [];
+    if (diff.oldFileName == diff.newFileName) {
+      ret.push('Index: ' + diff.oldFileName);
+    }
+    ret.push('===================================================================');
+    ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
+    ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
+    for (var i = 0; i < diff.hunks.length; i++) {
+      var hunk = diff.hunks[i];
+      // Unified Diff Format quirk: If the chunk size is 0,
+      // the first number is one lower than one would expect.
+      // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+      if (hunk.oldLines === 0) {
+        hunk.oldStart -= 1;
+      }
+      if (hunk.newLines === 0) {
+        hunk.newStart -= 1;
+      }
+      ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
+      ret.push.apply(ret, hunk.lines);
+    }
+    return ret.join('\n') + '\n';
+  }
+  function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+    var _options2;
+    if (typeof options === 'function') {
+      options = {
+        callback: options
+      };
+    }
+    if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.callback)) {
+      var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
+      if (!patchObj) {
+        return;
+      }
+      return formatPatch(patchObj);
+    } else {
+      var _options3 = options,
+        _callback2 = _options3.callback;
+      structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options), {}, {
+        callback: function callback(patchObj) {
+          if (!patchObj) {
+            _callback2();
+          } else {
+            _callback2(formatPatch(patchObj));
+          }
+        }
+      }));
+    }
+  }
+  function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
+    return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
+  }
+
+  /**
+   * Split `text` into an array of lines, including the trailing newline character (where present)
+   */
+  function splitLines(text) {
+    var hasTrailingNl = text.endsWith('\n');
+    var result = text.split('\n').map(function (line) {
+      return line + '\n';
+    });
+    if (hasTrailingNl) {
+      result.pop();
+    } else {
+      result.push(result.pop().slice(0, -1));
+    }
+    return result;
+  }
+
+  function arrayEqual(a, b) {
+    if (a.length !== b.length) {
+      return false;
+    }
+    return arrayStartsWith(a, b);
+  }
+  function arrayStartsWith(array, start) {
+    if (start.length > array.length) {
+      return false;
+    }
+    for (var i = 0; i < start.length; i++) {
+      if (start[i] !== array[i]) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  function calcLineCount(hunk) {
+    var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines),
+      oldLines = _calcOldNewLineCount.oldLines,
+      newLines = _calcOldNewLineCount.newLines;
+    if (oldLines !== undefined) {
+      hunk.oldLines = oldLines;
+    } else {
+      delete hunk.oldLines;
+    }
+    if (newLines !== undefined) {
+      hunk.newLines = newLines;
+    } else {
+      delete hunk.newLines;
+    }
+  }
+  function merge(mine, theirs, base) {
+    mine = loadPatch(mine, base);
+    theirs = loadPatch(theirs, base);
+    var ret = {};
+
+    // For index we just let it pass through as it doesn't have any necessary meaning.
+    // Leaving sanity checks on this to the API consumer that may know more about the
+    // meaning in their own context.
+    if (mine.index || theirs.index) {
+      ret.index = mine.index || theirs.index;
+    }
+    if (mine.newFileName || theirs.newFileName) {
+      if (!fileNameChanged(mine)) {
+        // No header or no change in ours, use theirs (and ours if theirs does not exist)
+        ret.oldFileName = theirs.oldFileName || mine.oldFileName;
+        ret.newFileName = theirs.newFileName || mine.newFileName;
+        ret.oldHeader = theirs.oldHeader || mine.oldHeader;
+        ret.newHeader = theirs.newHeader || mine.newHeader;
+      } else if (!fileNameChanged(theirs)) {
+        // No header or no change in theirs, use ours
+        ret.oldFileName = mine.oldFileName;
+        ret.newFileName = mine.newFileName;
+        ret.oldHeader = mine.oldHeader;
+        ret.newHeader = mine.newHeader;
+      } else {
+        // Both changed... figure it out
+        ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
+        ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
+        ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
+        ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
+      }
+    }
+    ret.hunks = [];
+    var mineIndex = 0,
+      theirsIndex = 0,
+      mineOffset = 0,
+      theirsOffset = 0;
+    while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
+      var mineCurrent = mine.hunks[mineIndex] || {
+          oldStart: Infinity
+        },
+        theirsCurrent = theirs.hunks[theirsIndex] || {
+          oldStart: Infinity
+        };
+      if (hunkBefore(mineCurrent, theirsCurrent)) {
+        // This patch does not overlap with any of the others, yay.
+        ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
+        mineIndex++;
+        theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
+      } else if (hunkBefore(theirsCurrent, mineCurrent)) {
+        // This patch does not overlap with any of the others, yay.
+        ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
+        theirsIndex++;
+        mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
+      } else {
+        // Overlap, merge as best we can
+        var mergedHunk = {
+          oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
+          oldLines: 0,
+          newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
+          newLines: 0,
+          lines: []
+        };
+        mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
+        theirsIndex++;
+        mineIndex++;
+        ret.hunks.push(mergedHunk);
+      }
+    }
+    return ret;
+  }
+  function loadPatch(param, base) {
+    if (typeof param === 'string') {
+      if (/^@@/m.test(param) || /^Index:/m.test(param)) {
+        return parsePatch(param)[0];
+      }
+      if (!base) {
+        throw new Error('Must provide a base reference or pass in a patch');
+      }
+      return structuredPatch(undefined, undefined, base, param);
+    }
+    return param;
+  }
+  function fileNameChanged(patch) {
+    return patch.newFileName && patch.newFileName !== patch.oldFileName;
+  }
+  function selectField(index, mine, theirs) {
+    if (mine === theirs) {
+      return mine;
+    } else {
+      index.conflict = true;
+      return {
+        mine: mine,
+        theirs: theirs
+      };
+    }
+  }
+  function hunkBefore(test, check) {
+    return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
+  }
+  function cloneHunk(hunk, offset) {
+    return {
+      oldStart: hunk.oldStart,
+      oldLines: hunk.oldLines,
+      newStart: hunk.newStart + offset,
+      newLines: hunk.newLines,
+      lines: hunk.lines
+    };
+  }
+  function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
+    // This will generally result in a conflicted hunk, but there are cases where the context
+    // is the only overlap where we can successfully merge the content here.
+    var mine = {
+        offset: mineOffset,
+        lines: mineLines,
+        index: 0
+      },
+      their = {
+        offset: theirOffset,
+        lines: theirLines,
+        index: 0
+      };
+
+    // Handle any leading content
+    insertLeading(hunk, mine, their);
+    insertLeading(hunk, their, mine);
+
+    // Now in the overlap content. Scan through and select the best changes from each.
+    while (mine.index < mine.lines.length && their.index < their.lines.length) {
+      var mineCurrent = mine.lines[mine.index],
+        theirCurrent = their.lines[their.index];
+      if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
+        // Both modified ...
+        mutualChange(hunk, mine, their);
+      } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
+        var _hunk$lines;
+        // Mine inserted
+        (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine)));
+      } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
+        var _hunk$lines2;
+        // Theirs inserted
+        (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their)));
+      } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
+        // Mine removed or edited
+        removal(hunk, mine, their);
+      } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
+        // Their removed or edited
+        removal(hunk, their, mine, true);
+      } else if (mineCurrent === theirCurrent) {
+        // Context identity
+        hunk.lines.push(mineCurrent);
+        mine.index++;
+        their.index++;
+      } else {
+        // Context mismatch
+        conflict(hunk, collectChange(mine), collectChange(their));
+      }
+    }
+
+    // Now push anything that may be remaining
+    insertTrailing(hunk, mine);
+    insertTrailing(hunk, their);
+    calcLineCount(hunk);
+  }
+  function mutualChange(hunk, mine, their) {
+    var myChanges = collectChange(mine),
+      theirChanges = collectChange(their);
+    if (allRemoves(myChanges) && allRemoves(theirChanges)) {
+      // Special case for remove changes that are supersets of one another
+      if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
+        var _hunk$lines3;
+        (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges));
+        return;
+      } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
+        var _hunk$lines4;
+        (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges));
+        return;
+      }
+    } else if (arrayEqual(myChanges, theirChanges)) {
+      var _hunk$lines5;
+      (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges));
+      return;
+    }
+    conflict(hunk, myChanges, theirChanges);
+  }
+  function removal(hunk, mine, their, swap) {
+    var myChanges = collectChange(mine),
+      theirChanges = collectContext(their, myChanges);
+    if (theirChanges.merged) {
+      var _hunk$lines6;
+      (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged));
+    } else {
+      conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
+    }
+  }
+  function conflict(hunk, mine, their) {
+    hunk.conflict = true;
+    hunk.lines.push({
+      conflict: true,
+      mine: mine,
+      theirs: their
+    });
+  }
+  function insertLeading(hunk, insert, their) {
+    while (insert.offset < their.offset && insert.index < insert.lines.length) {
+      var line = insert.lines[insert.index++];
+      hunk.lines.push(line);
+      insert.offset++;
+    }
+  }
+  function insertTrailing(hunk, insert) {
+    while (insert.index < insert.lines.length) {
+      var line = insert.lines[insert.index++];
+      hunk.lines.push(line);
+    }
+  }
+  function collectChange(state) {
+    var ret = [],
+      operation = state.lines[state.index][0];
+    while (state.index < state.lines.length) {
+      var line = state.lines[state.index];
+
+      // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
+      if (operation === '-' && line[0] === '+') {
+        operation = '+';
+      }
+      if (operation === line[0]) {
+        ret.push(line);
+        state.index++;
+      } else {
+        break;
+      }
+    }
+    return ret;
+  }
+  function collectContext(state, matchChanges) {
+    var changes = [],
+      merged = [],
+      matchIndex = 0,
+      contextChanges = false,
+      conflicted = false;
+    while (matchIndex < matchChanges.length && state.index < state.lines.length) {
+      var change = state.lines[state.index],
+        match = matchChanges[matchIndex];
+
+      // Once we've hit our add, then we are done
+      if (match[0] === '+') {
+        break;
+      }
+      contextChanges = contextChanges || change[0] !== ' ';
+      merged.push(match);
+      matchIndex++;
+
+      // Consume any additions in the other block as a conflict to attempt
+      // to pull in the remaining context after this
+      if (change[0] === '+') {
+        conflicted = true;
+        while (change[0] === '+') {
+          changes.push(change);
+          change = state.lines[++state.index];
+        }
+      }
+      if (match.substr(1) === change.substr(1)) {
+        changes.push(change);
+        state.index++;
+      } else {
+        conflicted = true;
+      }
+    }
+    if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
+      conflicted = true;
+    }
+    if (conflicted) {
+      return changes;
+    }
+    while (matchIndex < matchChanges.length) {
+      merged.push(matchChanges[matchIndex++]);
+    }
+    return {
+      merged: merged,
+      changes: changes
+    };
+  }
+  function allRemoves(changes) {
+    return changes.reduce(function (prev, change) {
+      return prev && change[0] === '-';
+    }, true);
+  }
+  function skipRemoveSuperset(state, removeChanges, delta) {
+    for (var i = 0; i < delta; i++) {
+      var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
+      if (state.lines[state.index + i] !== ' ' + changeContent) {
+        return false;
+      }
+    }
+    state.index += delta;
+    return true;
+  }
+  function calcOldNewLineCount(lines) {
+    var oldLines = 0;
+    var newLines = 0;
+    lines.forEach(function (line) {
+      if (typeof line !== 'string') {
+        var myCount = calcOldNewLineCount(line.mine);
+        var theirCount = calcOldNewLineCount(line.theirs);
+        if (oldLines !== undefined) {
+          if (myCount.oldLines === theirCount.oldLines) {
+            oldLines += myCount.oldLines;
+          } else {
+            oldLines = undefined;
+          }
+        }
+        if (newLines !== undefined) {
+          if (myCount.newLines === theirCount.newLines) {
+            newLines += myCount.newLines;
+          } else {
+            newLines = undefined;
+          }
+        }
+      } else {
+        if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
+          newLines++;
+        }
+        if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
+          oldLines++;
+        }
+      }
+    });
+    return {
+      oldLines: oldLines,
+      newLines: newLines
+    };
+  }
+
+  function reversePatch(structuredPatch) {
+    if (Array.isArray(structuredPatch)) {
+      return structuredPatch.map(reversePatch).reverse();
+    }
+    return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {
+      oldFileName: structuredPatch.newFileName,
+      oldHeader: structuredPatch.newHeader,
+      newFileName: structuredPatch.oldFileName,
+      newHeader: structuredPatch.oldHeader,
+      hunks: structuredPatch.hunks.map(function (hunk) {
+        return {
+          oldLines: hunk.newLines,
+          oldStart: hunk.newStart,
+          newLines: hunk.oldLines,
+          newStart: hunk.oldStart,
+          lines: hunk.lines.map(function (l) {
+            if (l.startsWith('-')) {
+              return "+".concat(l.slice(1));
+            }
+            if (l.startsWith('+')) {
+              return "-".concat(l.slice(1));
+            }
+            return l;
+          })
+        };
+      })
+    });
+  }
+
+  // See: http://code.google.com/p/google-diff-match-patch/wiki/API
+  function convertChangesToDMP(changes) {
+    var ret = [],
+      change,
+      operation;
+    for (var i = 0; i < changes.length; i++) {
+      change = changes[i];
+      if (change.added) {
+        operation = 1;
+      } else if (change.removed) {
+        operation = -1;
+      } else {
+        operation = 0;
+      }
+      ret.push([operation, change.value]);
+    }
+    return ret;
+  }
+
+  function convertChangesToXML(changes) {
+    var ret = [];
+    for (var i = 0; i < changes.length; i++) {
+      var change = changes[i];
+      if (change.added) {
+        ret.push('');
+      } else if (change.removed) {
+        ret.push('');
+      }
+      ret.push(escapeHTML(change.value));
+      if (change.added) {
+        ret.push('');
+      } else if (change.removed) {
+        ret.push('');
+      }
+    }
+    return ret.join('');
+  }
+  function escapeHTML(s) {
+    var n = s;
+    n = n.replace(/&/g, '&');
+    n = n.replace(//g, '>');
+    n = n.replace(/"/g, '"');
+    return n;
+  }
+
+  exports.Diff = Diff;
+  exports.applyPatch = applyPatch;
+  exports.applyPatches = applyPatches;
+  exports.canonicalize = canonicalize;
+  exports.convertChangesToDMP = convertChangesToDMP;
+  exports.convertChangesToXML = convertChangesToXML;
+  exports.createPatch = createPatch;
+  exports.createTwoFilesPatch = createTwoFilesPatch;
+  exports.diffArrays = diffArrays;
+  exports.diffChars = diffChars;
+  exports.diffCss = diffCss;
+  exports.diffJson = diffJson;
+  exports.diffLines = diffLines;
+  exports.diffSentences = diffSentences;
+  exports.diffTrimmedLines = diffTrimmedLines;
+  exports.diffWords = diffWords;
+  exports.diffWordsWithSpace = diffWordsWithSpace;
+  exports.formatPatch = formatPatch;
+  exports.merge = merge;
+  exports.parsePatch = parsePatch;
+  exports.reversePatch = reversePatch;
+  exports.structuredPatch = structuredPatch;
+
+}));
diff --git a/node_modules/diff/dist/diff.min.js b/node_modules/diff/dist/diff.min.js
new file mode 100644
index 0000000..4d96b76
--- /dev/null
+++ b/node_modules/diff/dist/diff.min.js
@@ -0,0 +1,37 @@
+/*!
+
+ diff v7.0.0
+
+BSD 3-Clause License
+
+Copyright (c) 2009-2015, Kevin Decker 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+@license
+*/
+!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).Diff={})}(this,function(e){"use strict";function r(){}function w(e,n,t,r,i){for(var o,l=[];n;)l.push(n),o=n.previousComponent,delete n.previousComponent,n=o;l.reverse();for(var a=0,u=l.length,s=0,f=0;ae.length?n:e}),d.value=e.join(c)):d.value=e.join(t.slice(s,s+d.count)),s+=d.count,d.added||(f+=d.count))}return l}r.prototype={diff:function(l,a){var u=2=d&&c<=v+1)return f(w(s,p[0].lastComponent,a,l,s.useLongestToken));var g=-1/0,m=1/0;function i(){for(var e=Math.max(g,-h);e<=Math.min(m,h);e+=2){var n=void 0,t=p[e-1],r=p[e+1],i=(t&&(p[e-1]=void 0),!1),o=(r&&(o=r.oldPos-e,i=r&&0<=o&&o=d&&c<=v+1)return f(w(s,n.lastComponent,a,l,s.useLongestToken));(p[e]=n).oldPos+1>=d&&(m=Math.min(m,e-1)),c<=v+1&&(g=Math.max(g,e+1))}else p[e]=void 0}h++}if(n)!function e(){setTimeout(function(){if(tr)return n();i()||e()},0)}();else for(;h<=t&&Date.now()<=r;){var o=i();if(o)return o}},addToPath:function(e,n,t,r,i){var o=e.lastComponent;return o&&!i.oneChangePerToken&&o.added===n&&o.removed===t?{oldPos:e.oldPos+r,lastComponent:{count:o.count+1,added:n,removed:t,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:n,removed:t,previousComponent:o}}},extractCommon:function(e,n,t,r,i){for(var o=n.length,l=t.length,a=e.oldPos,u=a-r,s=0;u+1n.length&&(t=e.length-n.length);var r=n.length;e.lengthe.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)return!1;for(var t=0;t"):r.removed&&n.push(""),n.push(r.value.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")),r.added?n.push(""):r.removed&&n.push("")}return n.join("")},e.createPatch=function(e,n,t,r,i,o){return M(e,e,n,t,r,i,o)},e.createTwoFilesPatch=M,e.diffArrays=function(e,n,t){return F.diff(e,n,t)},e.diffChars=function(e,n,t){return I.diff(e,n,t)},e.diffCss=function(e,n,t){return m.diff(e,n,t)},e.diffJson=function(e,n,t){return x.diff(e,n,t)},e.diffLines=y,e.diffSentences=function(e,n,t){return g.diff(e,n,t)},e.diffTrimmedLines=function(e,n,t){return t=function(e,n){if("function"==typeof e)n.callback=e;else if(e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t,{ignoreWhitespace:!0}),v.diff(e,n,t)},e.diffWords=function(e,n,t){return null==(null==t?void 0:t.ignoreWhitespace)||t.ignoreWhitespace?i.diff(e,n,t):a(e,n,t)},e.diffWordsWithSpace=a,e.formatPatch=E,e.merge=function(e,n,t){e=J(e,t),n=J(n,t);for(var r={},i=((e.index||n.index)&&(r.index=e.index||n.index),(e.newFileName||n.newFileName)&&(q(e)?q(n)?(r.oldFileName=H(r,e.oldFileName,n.oldFileName),r.newFileName=H(r,e.newFileName,n.newFileName),r.oldHeader=H(r,e.oldHeader,n.oldHeader),r.newHeader=H(r,e.newHeader,n.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=n.oldFileName||e.oldFileName,r.newFileName=n.newFileName||e.newFileName,r.oldHeader=n.oldHeader||e.oldHeader,r.newHeader=n.newHeader||e.newHeader)),r.hunks=[],0),o=0,l=0,a=0;i');
+    } else if (change.removed) {
+      ret.push('');
+    }
+    ret.push(escapeHTML(change.value));
+    if (change.added) {
+      ret.push('');
+    } else if (change.removed) {
+      ret.push('');
+    }
+  }
+  return ret.join('');
+}
+function escapeHTML(s) {
+  var n = s;
+  n = n.replace(/&/g, '&');
+  n = n.replace(//g, '>');
+  n = n.replace(/"/g, '"');
+  return n;
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJjb252ZXJ0Q2hhbmdlc1RvWE1MIiwiY2hhbmdlcyIsInJldCIsImkiLCJsZW5ndGgiLCJjaGFuZ2UiLCJhZGRlZCIsInB1c2giLCJyZW1vdmVkIiwiZXNjYXBlSFRNTCIsInZhbHVlIiwiam9pbiIsInMiLCJuIiwicmVwbGFjZSJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gY29udmVydENoYW5nZXNUb1hNTChjaGFuZ2VzKSB7XG4gIGxldCByZXQgPSBbXTtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFuZ2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgcmV0LnB1c2goJzxpbnM+Jyk7XG4gICAgfSBlbHNlIGlmIChjaGFuZ2UucmVtb3ZlZCkge1xuICAgICAgcmV0LnB1c2goJzxkZWw+Jyk7XG4gICAgfVxuXG4gICAgcmV0LnB1c2goZXNjYXBlSFRNTChjaGFuZ2UudmFsdWUpKTtcblxuICAgIGlmIChjaGFuZ2UuYWRkZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8L2lucz4nKTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICByZXQucHVzaCgnPC9kZWw+Jyk7XG4gICAgfVxuICB9XG4gIHJldHVybiByZXQuam9pbignJyk7XG59XG5cbmZ1bmN0aW9uIGVzY2FwZUhUTUwocykge1xuICBsZXQgbiA9IHM7XG4gIG4gPSBuLnJlcGxhY2UoLyYvZywgJ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BLFNBQVNGLFVBQVVBLENBQUNHLENBQUMsRUFBRTtFQUNyQixJQUFJQyxDQUFDLEdBQUdELENBQUM7RUFDVEMsQ0FBQyxHQUFHQSxDQUFDLENBQUNDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDO0VBQzVCRCxDQUFDLEdBQUdBLENBQUMsQ0FBQ0MsT0FBTyxDQUFDLElBQUksRUFBRSxNQUFNLENBQUM7RUFDM0JELENBQUMsR0FBR0EsQ0FBQyxDQUFDQyxPQUFPLENBQUMsSUFBSSxFQUFFLE1BQU0sQ0FBQztFQUMzQkQsQ0FBQyxHQUFHQSxDQUFDLENBQUNDLE9BQU8sQ0FBQyxJQUFJLEVBQUUsUUFBUSxDQUFDO0VBRTdCLE9BQU9ELENBQUM7QUFDViIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/diff/array.js b/node_modules/diff/lib/diff/array.js
new file mode 100644
index 0000000..bd0802d
--- /dev/null
+++ b/node_modules/diff/lib/diff/array.js
@@ -0,0 +1,39 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.arrayDiff = void 0;
+exports.diffArrays = diffArrays;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./base"))
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+var arrayDiff =
+/*istanbul ignore start*/
+exports.arrayDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+arrayDiff.tokenize = function (value) {
+  return value.slice();
+};
+arrayDiff.join = arrayDiff.removeEmpty = function (value) {
+  return value;
+};
+function diffArrays(oldArr, newArr, callback) {
+  return arrayDiff.diff(oldArr, newArr, callback);
+}
+//# sourceMapping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UFDLE9BQUEsQ0FBQUQsU0FBQTtBQUFBO0FBQUc7QUFBSUU7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUEsQ0FBSSxDQUFDLENBQUM7QUFDbkNGLFNBQVMsQ0FBQ0csUUFBUSxHQUFHLFVBQVNDLEtBQUssRUFBRTtFQUNuQyxPQUFPQSxLQUFLLENBQUNDLEtBQUssQ0FBQyxDQUFDO0FBQ3RCLENBQUM7QUFDREwsU0FBUyxDQUFDTSxJQUFJLEdBQUdOLFNBQVMsQ0FBQ08sV0FBVyxHQUFHLFVBQVNILEtBQUssRUFBRTtFQUN2RCxPQUFPQSxLQUFLO0FBQ2QsQ0FBQztBQUVNLFNBQVNJLFVBQVVBLENBQUNDLE1BQU0sRUFBRUMsTUFBTSxFQUFFQyxRQUFRLEVBQUU7RUFBRSxPQUFPWCxTQUFTLENBQUNZLElBQUksQ0FBQ0gsTUFBTSxFQUFFQyxNQUFNLEVBQUVDLFFBQVEsQ0FBQztBQUFFIiwiaWdub3JlTGlzdCI6W119
diff --git a/node_modules/diff/lib/diff/base.js b/node_modules/diff/lib/diff/base.js
new file mode 100644
index 0000000..d2b4b44
--- /dev/null
+++ b/node_modules/diff/lib/diff/base.js
@@ -0,0 +1,304 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports["default"] = Diff;
+/*istanbul ignore end*/
+function Diff() {}
+Diff.prototype = {
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  diff: function diff(oldString, newString) {
+    /*istanbul ignore start*/
+    var _options$timeout;
+    var
+    /*istanbul ignore end*/
+    options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+    var callback = options.callback;
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+    var self = this;
+    function done(value) {
+      value = self.postProcess(value, options);
+      if (callback) {
+        setTimeout(function () {
+          callback(value);
+        }, 0);
+        return true;
+      } else {
+        return value;
+      }
+    }
+
+    // Allow subclasses to massage the input prior to running
+    oldString = this.castInput(oldString, options);
+    newString = this.castInput(newString, options);
+    oldString = this.removeEmpty(this.tokenize(oldString, options));
+    newString = this.removeEmpty(this.tokenize(newString, options));
+    var newLen = newString.length,
+      oldLen = oldString.length;
+    var editLength = 1;
+    var maxEditLength = newLen + oldLen;
+    if (options.maxEditLength != null) {
+      maxEditLength = Math.min(maxEditLength, options.maxEditLength);
+    }
+    var maxExecutionTime =
+    /*istanbul ignore start*/
+    (_options$timeout =
+    /*istanbul ignore end*/
+    options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
+    var abortAfterTimestamp = Date.now() + maxExecutionTime;
+    var bestPath = [{
+      oldPos: -1,
+      lastComponent: undefined
+    }];
+
+    // Seed editLength = 0, i.e. the content starts with the same values
+    var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options);
+    if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+      // Identity per the equality and tokenizer
+      return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken));
+    }
+
+    // Once we hit the right edge of the edit graph on some diagonal k, we can
+    // definitely reach the end of the edit graph in no more than k edits, so
+    // there's no point in considering any moves to diagonal k+1 any more (from
+    // which we're guaranteed to need at least k+1 more edits).
+    // Similarly, once we've reached the bottom of the edit graph, there's no
+    // point considering moves to lower diagonals.
+    // We record this fact by setting minDiagonalToConsider and
+    // maxDiagonalToConsider to some finite value once we've hit the edge of
+    // the edit graph.
+    // This optimization is not faithful to the original algorithm presented in
+    // Myers's paper, which instead pointlessly extends D-paths off the end of
+    // the edit graph - see page 7 of Myers's paper which notes this point
+    // explicitly and illustrates it with a diagram. This has major performance
+    // implications for some common scenarios. For instance, to compute a diff
+    // where the new text simply appends d characters on the end of the
+    // original text of length n, the true Myers algorithm will take O(n+d^2)
+    // time while this optimization needs only O(n+d) time.
+    var minDiagonalToConsider = -Infinity,
+      maxDiagonalToConsider = Infinity;
+
+    // Main worker method. checks all permutations of a given edit length for acceptance.
+    function execEditLength() {
+      for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
+        var basePath =
+        /*istanbul ignore start*/
+        void 0
+        /*istanbul ignore end*/
+        ;
+        var removePath = bestPath[diagonalPath - 1],
+          addPath = bestPath[diagonalPath + 1];
+        if (removePath) {
+          // No one else is going to attempt to use this value, clear it
+          bestPath[diagonalPath - 1] = undefined;
+        }
+        var canAdd = false;
+        if (addPath) {
+          // what newPos will be after we do an insertion:
+          var addPathNewPos = addPath.oldPos - diagonalPath;
+          canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
+        }
+        var canRemove = removePath && removePath.oldPos + 1 < oldLen;
+        if (!canAdd && !canRemove) {
+          // If this path is a terminal then prune
+          bestPath[diagonalPath] = undefined;
+          continue;
+        }
+
+        // Select the diagonal that we want to branch from. We select the prior
+        // path whose position in the old string is the farthest from the origin
+        // and does not pass the bounds of the diff graph
+        if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
+          basePath = self.addToPath(addPath, true, false, 0, options);
+        } else {
+          basePath = self.addToPath(removePath, false, true, 1, options);
+        }
+        newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options);
+        if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+          // If we have hit the end of both strings, then we are done
+          return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
+        } else {
+          bestPath[diagonalPath] = basePath;
+          if (basePath.oldPos + 1 >= oldLen) {
+            maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
+          }
+          if (newPos + 1 >= newLen) {
+            minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
+          }
+        }
+      }
+      editLength++;
+    }
+
+    // Performs the length of edit iteration. Is a bit fugly as this has to support the
+    // sync and async mode which is never fun. Loops over execEditLength until a value
+    // is produced, or until the edit length exceeds options.maxEditLength (if given),
+    // in which case it will return undefined.
+    if (callback) {
+      (function exec() {
+        setTimeout(function () {
+          if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
+            return callback();
+          }
+          if (!execEditLength()) {
+            exec();
+          }
+        }, 0);
+      })();
+    } else {
+      while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
+        var ret = execEditLength();
+        if (ret) {
+          return ret;
+        }
+      }
+    }
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  addToPath: function addToPath(path, added, removed, oldPosInc, options) {
+    var last = path.lastComponent;
+    if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
+      return {
+        oldPos: path.oldPos + oldPosInc,
+        lastComponent: {
+          count: last.count + 1,
+          added: added,
+          removed: removed,
+          previousComponent: last.previousComponent
+        }
+      };
+    } else {
+      return {
+        oldPos: path.oldPos + oldPosInc,
+        lastComponent: {
+          count: 1,
+          added: added,
+          removed: removed,
+          previousComponent: last
+        }
+      };
+    }
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) {
+    var newLen = newString.length,
+      oldLen = oldString.length,
+      oldPos = basePath.oldPos,
+      newPos = oldPos - diagonalPath,
+      commonCount = 0;
+    while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) {
+      newPos++;
+      oldPos++;
+      commonCount++;
+      if (options.oneChangePerToken) {
+        basePath.lastComponent = {
+          count: 1,
+          previousComponent: basePath.lastComponent,
+          added: false,
+          removed: false
+        };
+      }
+    }
+    if (commonCount && !options.oneChangePerToken) {
+      basePath.lastComponent = {
+        count: commonCount,
+        previousComponent: basePath.lastComponent,
+        added: false,
+        removed: false
+      };
+    }
+    basePath.oldPos = oldPos;
+    return newPos;
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  equals: function equals(left, right, options) {
+    if (options.comparator) {
+      return options.comparator(left, right);
+    } else {
+      return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase();
+    }
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  removeEmpty: function removeEmpty(array) {
+    var ret = [];
+    for (var i = 0; i < array.length; i++) {
+      if (array[i]) {
+        ret.push(array[i]);
+      }
+    }
+    return ret;
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  castInput: function castInput(value) {
+    return value;
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  tokenize: function tokenize(value) {
+    return Array.from(value);
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  join: function join(chars) {
+    return chars.join('');
+  },
+  /*istanbul ignore start*/
+  /*istanbul ignore end*/
+  postProcess: function postProcess(changeObjects) {
+    return changeObjects;
+  }
+};
+function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
+  // First we convert our linked list of components in reverse order to an
+  // array in the right order:
+  var components = [];
+  var nextComponent;
+  while (lastComponent) {
+    components.push(lastComponent);
+    nextComponent = lastComponent.previousComponent;
+    delete lastComponent.previousComponent;
+    lastComponent = nextComponent;
+  }
+  components.reverse();
+  var componentPos = 0,
+    componentLen = components.length,
+    newPos = 0,
+    oldPos = 0;
+  for (; componentPos < componentLen; componentPos++) {
+    var component = components[componentPos];
+    if (!component.removed) {
+      if (!component.added && useLongestToken) {
+        var value = newString.slice(newPos, newPos + component.count);
+        value = value.map(function (value, i) {
+          var oldValue = oldString[oldPos + i];
+          return oldValue.length > value.length ? oldValue : value;
+        });
+        component.value = diff.join(value);
+      } else {
+        component.value = diff.join(newString.slice(newPos, newPos + component.count));
+      }
+      newPos += component.count;
+
+      // Common case
+      if (!component.added) {
+        oldPos += component.count;
+      }
+    } else {
+      component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
+      oldPos += component.count;
+    }
+  }
+  return components;
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJEaWZmIiwicHJvdG90eXB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FDcEMsQ0FBQyxNQUFNO1FBQ0xtRSxTQUFTLENBQUNuRSxLQUFLLEdBQUdYLElBQUksQ0FBQ3NFLElBQUksQ0FBQ3BFLFNBQVMsQ0FBQzZFLEtBQUssQ0FBQy9DLE1BQU0sRUFBRUEsTUFBTSxHQUFHOEMsU0FBUyxDQUFDdEIsS0FBSyxDQUFDLENBQUM7TUFDaEY7TUFDQXhCLE1BQU0sSUFBSThDLFNBQVMsQ0FBQ3RCLEtBQUs7O01BRXpCO01BQ0EsSUFBSSxDQUFDc0IsU0FBUyxDQUFDM0IsS0FBSyxFQUFFO1FBQ3BCckIsTUFBTSxJQUFJZ0QsU0FBUyxDQUFDdEIsS0FBSztNQUMzQjtJQUNGLENBQUMsTUFBTTtNQUNMc0IsU0FBUyxDQUFDbkUsS0FBSyxHQUFHWCxJQUFJLENBQUNzRSxJQUFJLENBQUNyRSxTQUFTLENBQUM4RSxLQUFLLENBQUNqRCxNQUFNLEVBQUVBLE1BQU0sR0FBR2dELFNBQVMsQ0FBQ3RCLEtBQUssQ0FBQyxDQUFDO01BQzlFMUIsTUFBTSxJQUFJZ0QsU0FBUyxDQUFDdEIsS0FBSztJQUMzQjtFQUNGO0VBRUEsT0FBT2lCLFVBQVU7QUFDbkIiLCJpZ25vcmVMaXN0IjpbXX0=
diff --git a/node_modules/diff/lib/diff/character.js b/node_modules/diff/lib/diff/character.js
new file mode 100644
index 0000000..6a3cf1c
--- /dev/null
+++ b/node_modules/diff/lib/diff/character.js
@@ -0,0 +1,33 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.characterDiff = void 0;
+exports.diffChars = diffChars;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./base"))
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+var characterDiff =
+/*istanbul ignore start*/
+exports.characterDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+function diffChars(oldStr, newStr, options) {
+  return characterDiff.diff(oldStr, newStr, options);
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfYmFzZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwib2JqIiwiX19lc01vZHVsZSIsImNoYXJhY3RlckRpZmYiLCJleHBvcnRzIiwiRGlmZiIsImRpZmZDaGFycyIsIm9sZFN0ciIsIm5ld1N0ciIsIm9wdGlvbnMiLCJkaWZmIl0sInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RpZmYvY2hhcmFjdGVyLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBjaGFyYWN0ZXJEaWZmID0gbmV3IERpZmYoKTtcbmV4cG9ydCBmdW5jdGlvbiBkaWZmQ2hhcnMob2xkU3RyLCBuZXdTdHIsIG9wdGlvbnMpIHsgcmV0dXJuIGNoYXJhY3RlckRpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7IH1cbiJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBQSxLQUFBLEdBQUFDLHNCQUFBLENBQUFDLE9BQUE7QUFBQTtBQUFBO0FBQTBCLG1DQUFBRCx1QkFBQUUsR0FBQSxXQUFBQSxHQUFBLElBQUFBLEdBQUEsQ0FBQUMsVUFBQSxHQUFBRCxHQUFBLGdCQUFBQSxHQUFBO0FBQUE7QUFFbkIsSUFBTUUsYUFBYTtBQUFBO0FBQUFDLE9BQUEsQ0FBQUQsYUFBQTtBQUFBO0FBQUc7QUFBSUU7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUEsQ0FBSSxDQUFDLENBQUM7QUFDaEMsU0FBU0MsU0FBU0EsQ0FBQ0MsTUFBTSxFQUFFQyxNQUFNLEVBQUVDLE9BQU8sRUFBRTtFQUFFLE9BQU9OLGFBQWEsQ0FBQ08sSUFBSSxDQUFDSCxNQUFNLEVBQUVDLE1BQU0sRUFBRUMsT0FBTyxDQUFDO0FBQUUiLCJpZ25vcmVMaXN0IjpbXX0=
diff --git a/node_modules/diff/lib/diff/css.js b/node_modules/diff/lib/diff/css.js
new file mode 100644
index 0000000..6321827
--- /dev/null
+++ b/node_modules/diff/lib/diff/css.js
@@ -0,0 +1,36 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.cssDiff = void 0;
+exports.diffCss = diffCss;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./base"))
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+var cssDiff =
+/*istanbul ignore start*/
+exports.cssDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+cssDiff.tokenize = function (value) {
+  return value.split(/([{}:;,]|\s+)/);
+};
+function diffCss(oldStr, newStr, callback) {
+  return cssDiff.diff(oldStr, newStr, callback);
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfYmFzZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwib2JqIiwiX19lc01vZHVsZSIsImNzc0RpZmYiLCJleHBvcnRzIiwiRGlmZiIsInRva2VuaXplIiwidmFsdWUiLCJzcGxpdCIsImRpZmZDc3MiLCJvbGRTdHIiL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PLENBQUNVLElBQUksQ0FBQ0gsTUFBTSxFQUFFQyxNQUFNLEVBQUVDLFFBQVEsQ0FBQztBQUFFIiwiaWdub3JlTGlzdCI6W119
diff --git a/node_modules/diff/lib/diff/json.js b/node_modules/diff/lib/diff/json.js
new file mode 100644
index 0000000..a3f0748
--- /dev/null
+++ b/node_modules/diff/lib/diff/json.js
@@ -0,0 +1,143 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.canonicalize = canonicalize;
+exports.diffJson = diffJson;
+exports.jsonDiff = void 0;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./base"))
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_line = require("./line")
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
+/*istanbul ignore end*/
+var jsonDiff =
+/*istanbul ignore start*/
+exports.jsonDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+// Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
+// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
+jsonDiff.useLongestToken = true;
+jsonDiff.tokenize =
+/*istanbul ignore start*/
+_line
+/*istanbul ignore end*/
+.
+/*istanbul ignore start*/
+lineDiff
+/*istanbul ignore end*/
+.tokenize;
+jsonDiff.castInput = function (value, options) {
+  var
+    /*istanbul ignore start*/
+    /*istanbul ignore end*/
+    undefinedReplacement = options.undefinedReplacement,
+    /*istanbul ignore start*/
+    _options$stringifyRep =
+    /*istanbul ignore end*/
+    options.stringifyReplacer,
+    /*istanbul ignore start*/
+    /*istanbul ignore end*/
+    stringifyReplacer = _options$stringifyRep === void 0 ? function (k, v)
+    /*istanbul ignore start*/
+    {
+      return (
+        /*istanbul ignore end*/
+        typeof v === 'undefined' ? undefinedReplacement : v
+      );
+    } : _options$stringifyRep;
+  return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, '  ');
+};
+jsonDiff.equals = function (left, right, options) {
+  return (
+    /*istanbul ignore start*/
+    _base
+    /*istanbul ignore end*/
+    [
+    /*istanbul ignore start*/
+    "default"
+    /*istanbul ignore end*/
+    ].prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options)
+  );
+};
+function diffJson(oldObj, newObj, options) {
+  return jsonDiff.diff(oldObj, newObj, options);
+}
+
+// This function handles the presence of circular references by bailing out when encountering an
+// object that is already on the "stack" of items being processed. Accepts an optional replacer
+function canonicalize(obj, stack, replacementStack, replacer, key) {
+  stack = stack || [];
+  replacementStack = replacementStack || [];
+  if (replacer) {
+    obj = replacer(key, obj);
+  }
+  var i;
+  for (i = 0; i < stack.length; i += 1) {
+    if (stack[i] === obj) {
+      return replacementStack[i];
+    }
+  }
+  var canonicalizedObj;
+  if ('[object Array]' === Object.prototype.toString.call(obj)) {
+    stack.push(obj);
+    canonicalizedObj = new Array(obj.length);
+    replacementStack.push(canonicalizedObj);
+    for (i = 0; i < obj.length; i += 1) {
+      canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
+    }
+    stack.pop();
+    replacementStack.pop();
+    return canonicalizedObj;
+  }
+  if (obj && obj.toJSON) {
+    obj = obj.toJSON();
+  }
+  if (
+  /*istanbul ignore start*/
+  _typeof(
+  /*istanbul ignore end*/
+  obj) === 'object' && obj !== null) {
+    stack.push(obj);
+    canonicalizedObj = {};
+    replacementStack.push(canonicalizedObj);
+    var sortedKeys = [],
+      _key;
+    for (_key in obj) {
+      /* istanbul ignore else */
+      if (Object.prototype.hasOwnProperty.call(obj, _key)) {
+        sortedKeys.push(_key);
+      }
+    }
+    sortedKeys.sort();
+    for (i = 0; i < sortedKeys.length; i += 1) {
+      _key = sortedKeys[i];
+      canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
+    }
+    stack.pop();
+    replacementStack.pop();
+  } else {
+    canonicalizedObj = obj;
+  }
+  return canonicalizedObj;
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfYmFzZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwiX2xpbmUiLCJvYmoiLCJfX2VzTW9kdWxlIiwiX3R5cGVvZiIsIm8iLCJTeW1ib2wiLCJpdGVyYXRvciIsImNvbnN0cnVjdG9yIiwicHJvdG90eXBlIiwianNvbkRpZmYiLCJleHBvcnRzIiwiRGlmZiIsInVzZUxvbmdlc3RUb2tlbiIsInRva2VuaXplIiwibGluZURpZmYiLCJjYXN0SW5wdXQiLCJ2YWx1ZSIsIm9wdGlvbnMiLCJ1bmRlZmluZWRSZXBsYWNlbWVudCIsIl9vcHRpb25zJHN0cmluZ2lmeVJlcCIsInN0cmluZ2lmeVJlcGxhY2VyIiwiayIsInYiLCJKU09OIiwic3RyaW5naWZ5IiwiY2Fub25pY2FsaXplIiwiZXF1YWxzIiwibGVmdCIsInJpZ2h0IiwiY2FsbCIsInJlcGxhY2UiLCJkaWZmSnNvbiIsIm9sZE9iaiIsIm5ld09iaiIsImRpZmYiLCJzdGFjayIsInJlcGxhY2VtZW50U3RhY2siLCJyZXBsYWNlciIsImtleSIsImkiLCJsZW5ndGgiLCJjYW5vbmljYWxpemVkT2JqIiwiT2JqZWN0IiwidG9TdHJpbmciLCJwdXNoIiwiQXJyYXkiLCJwb3AiLCJ0b0pTT04iLCJzb3J0ZWRLZXlzIiwiaGFzT3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QUFDLENBQUM7SUFDckJMLGdCQUFnQixDQUFDUSxJQUFJLENBQUNILGdCQUFnQixDQUFDO0lBQ3ZDLElBQUlPLFVBQVUsR0FBRyxFQUFFO01BQ2ZWLElBQUc7SUFDUCxLQUFLQSxJQUFHLElBQUlyQyxHQUFHLEVBQUU7TUFDZjtNQUNBLElBQUl5QyxNQUFNLENBQUNsQyxTQUFTLENBQUN5QyxjQUFjLENBQUNwQixJQUFJLENBQUM1QixHQUFHLEVBQUVxQyxJQUFHLENBQUMsRUFBRTtRQUNsRFUsVUFBVSxDQUFDSixJQUFJLENBQUNOLElBQUcsQ0FBQztNQUN0QjtJQUNGO0lBQ0FVLFVBQVUsQ0FBQ0UsSUFBSSxDQUFDLENBQUM7SUFDakIsS0FBS1gsQ0FBQyxHQUFHLENBQUMsRUFBRUEsQ0FBQyxHQUFHUyxVQUFVLENBQUNSLE1BQU0sRUFBRUQsQ0FBQyxJQUFJLENBQUMsRUFBRTtNQUN6Q0QsSUFBRyxHQUFHVSxVQUFVLENBQUNULENBQUMsQ0FBQztNQUNuQkUsZ0JBQWdCLENBQUNILElBQUcsQ0FBQyxHQUFHYixZQUFZLENBQUN4QixHQUFHLENBQUNxQyxJQUFHLENBQUMsRUFBRUgsS0FBSyxFQUFFQyxnQkFBZ0IsRUFBRUMsUUFBUSxFQUFFQyxJQUFHLENBQUM7SUFDeEY7SUFDQUgsS0FBSyxDQUFDVyxHQUFHLENBQUMsQ0FBQztJQUNYVixnQkFBZ0IsQ0FBQ1UsR0FBRyxDQUFDLENBQUM7RUFDeEIsQ0FBQyxNQUFNO0lBQ0xMLGdCQUFnQixHQUFHeEMsR0FBRztFQUN4QjtFQUNBLE9BQU93QyxnQkFBZ0I7QUFDekIiLCJpZ25vcmVMaXN0IjpbXX0=
diff --git a/node_modules/diff/lib/diff/line.js b/node_modules/diff/lib/diff/line.js
new file mode 100644
index 0000000..71f3f24
--- /dev/null
+++ b/node_modules/diff/lib/diff/line.js
@@ -0,0 +1,121 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.diffLines = diffLines;
+exports.diffTrimmedLines = diffTrimmedLines;
+exports.lineDiff = void 0;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./base"))
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_params = require("../util/params")
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+var lineDiff =
+/*istanbul ignore start*/
+exports.lineDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+lineDiff.tokenize = function (value, options) {
+  if (options.stripTrailingCr) {
+    // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
+    value = value.replace(/\r\n/g, '\n');
+  }
+  var retLines = [],
+    linesAndNewlines = value.split(/(\n|\r\n)/);
+
+  // Ignore the final empty token that occurs if the string ends with a new line
+  if (!linesAndNewlines[linesAndNewlines.length - 1]) {
+    linesAndNewlines.pop();
+  }
+
+  // Merge the content and line separators into single tokens
+  for (var i = 0; i < linesAndNewlines.length; i++) {
+    var line = linesAndNewlines[i];
+    if (i % 2 && !options.newlineIsToken) {
+      retLines[retLines.length - 1] += line;
+    } else {
+      retLines.push(line);
+    }
+  }
+  return retLines;
+};
+lineDiff.equals = function (left, right, options) {
+  // If we're ignoring whitespace, we need to normalise lines by stripping
+  // whitespace before checking equality. (This has an annoying interaction
+  // with newlineIsToken that requires special handling: if newlines get their
+  // own token, then we DON'T want to trim the *newline* tokens down to empty
+  // strings, since this would cause us to treat whitespace-only line content
+  // as equal to a separator between lines, which would be weird and
+  // inconsistent with the documented behavior of the options.)
+  if (options.ignoreWhitespace) {
+    if (!options.newlineIsToken || !left.includes('\n')) {
+      left = left.trim();
+    }
+    if (!options.newlineIsToken || !right.includes('\n')) {
+      right = right.trim();
+    }
+  } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
+    if (left.endsWith('\n')) {
+      left = left.slice(0, -1);
+    }
+    if (right.endsWith('\n')) {
+      right = right.slice(0, -1);
+    }
+  }
+  return (
+    /*istanbul ignore start*/
+    _base
+    /*istanbul ignore end*/
+    [
+    /*istanbul ignore start*/
+    "default"
+    /*istanbul ignore end*/
+    ].prototype.equals.call(this, left, right, options)
+  );
+};
+function diffLines(oldStr, newStr, callback) {
+  return lineDiff.diff(oldStr, newStr, callback);
+}
+
+// Kept for backwards compatibility. This is a rather arbitrary wrapper method
+// that just calls `diffLines` with `ignoreWhitespace: true`. It's confusing to
+// have two ways to do exactly the same thing in the API, so we no longer
+// document this one (library users should explicitly use `diffLines` with
+// `ignoreWhitespace: true` instead) but we keep it around to maintain
+// compatibility with code that used old versions.
+function diffTrimmedLines(oldStr, newStr, callback) {
+  var options =
+  /*istanbul ignore start*/
+  (0,
+  /*istanbul ignore end*/
+  /*istanbul ignore start*/
+  _params
+  /*istanbul ignore end*/
+  .
+  /*istanbul ignore start*/
+  generateOptions)
+  /*istanbul ignore end*/
+  (callback, {
+    ignoreWhitespace: true
+  });
+  return lineDiff.diff(oldStr, newStr, options);
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfYmFzZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwiX3BhcmFtcyIsIm9iaiIsIl9fZXNNb2R1bGUiLCJsaW5lRGlmZiIsImV4cG9ydHMiLCJEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsIm9wdGlvbnMiLCJzdHJpcFRyYWlsaW5nQ3IiLCJyZXBsYWNlIiwicmV0TGluZXMiLCJsaW5lc0FuZE5ld2xpbmVzIiwic3BsaXQiLCJsZW5ndGgiLCJwb3AiLCJpIiwibGluZSIsIm5ld2xpbmVJ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7SUFBQUE7SUFBQUE7SUFBQUE7SUFBQUE7SUFBQUE7SUFBQUE7SUFBQUEsQ0FBSSxDQUFDd0IsU0FBUyxDQUFDVCxNQUFNLENBQUNVLElBQUksQ0FBQyxJQUFJLEVBQUVULElBQUksRUFBRUMsS0FBSyxFQUFFZCxPQUFPO0VBQUM7QUFDL0QsQ0FBQztBQUVNLFNBQVN1QixTQUFTQSxDQUFDQyxNQUFNLEVBQUVDLE1BQU0sRUFBRUMsUUFBUSxFQUFFO0VBQUUsT0FBTy9CLFFBQVEsQ0FBQ2dDLElBQUksQ0FBQ0gsTUFBTSxFQUFFQyxNQUFNLEVBQUVDLFFBQVEsQ0FBQztBQUFFOztBQUV0RztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDTyxTQUFTRSxnQkFBZ0JBLENBQUNKLE1BQU0sRUFBRUMsTUFBTSxFQUFFQyxRQUFRLEVBQUU7RUFDekQsSUFBSTFCLE9BQU87RUFBRztFQUFBO0VBQUE7RUFBQTZCO0VBQUFBO0VBQUFBO0VBQUFBO0VBQUFBO0VBQUFBLGVBQWU7RUFBQTtFQUFBLENBQUNILFFBQVEsRUFBRTtJQUFDWCxnQkFBZ0IsRUFBRTtFQUFJLENBQUMsQ0FBQztFQUNqRSxPQUFPcEIsUUFBUSxDQUFDZ0MsSUFBSSxDQUFDSCxNQUFNLEVBQUVDLE1BQU0sRUFBRXpCLE9BQU8sQ0FBQztBQUMvQyIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/diff/sentence.js b/node_modules/diff/lib/diff/sentence.js
new file mode 100644
index 0000000..66d8ece
--- /dev/null
+++ b/node_modules/diff/lib/diff/sentence.js
@@ -0,0 +1,36 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.diffSentences = diffSentences;
+exports.sentenceDiff = void 0;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./base"))
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+var sentenceDiff =
+/*istanbul ignore start*/
+exports.sentenceDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+sentenceDiff.tokenize = function (value) {
+  return value.split(/(\S.+?[.!?])(?=\s+|$)/);
+};
+function diffSentences(oldStr, newStr, callback) {
+  return sentenceDiff.diff(oldStr, newStr, callback);
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfYmFzZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwib2JqIiwiX19lc01vZHVsZSIsInNlbnRlbmNlRGlmZiIsImV4cG9ydHMiLCJEaWZmIiwidG9rZW5pemUiLCJ2YWx1ZSIsInNwbGl0IiwiZGlmZlNlbnRlbmNlcyIsIm9sZFN0ciIsIm5ld1N0ciIsImNhbGxiYWNrIiwiZGlmZiJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cblxuZXhwb3J0IGNvbnN0IHNlbnRlbmNlRGlmZiA9IG5ldyBEaWZmKCk7XG5zZW50ZW5jZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhcXFMuKz9bLiE/XSkoPz1cXHMrfCQpLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZlNlbnRlbmNlcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIHNlbnRlbmNlRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUE7QUFBQTtBQUFBQSxLQUFBLEdBQUFDLHNCQUFBLENBQUFDLE9BQUE7QUFBQTtBQUFBO0FBQTBCLG1DQUFBRCx1QkFBQUUsR0FBQSxXQUFBQSxHQUFBLElBQUFBLEdBQUEsQ0FBQUMsVUFBQSxHQUFBRCxHQUFBLGdCQUFBQSxHQUFBO0FBQUE7QUFHbkIsSUFBTUUsWUFBWTtBQUFBO0FBQUFDLE9BQUEsQ0FBQUQsWUFBQTtBQUFBO0FBQUc7QUFBSUU7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUE7QUFBQUEsQ0FBSSxDQUFDLENBQUM7QUFDdENGLFlBQVksQ0FBQ0csUUFBUSxHQUFHLFVBQVNDLEtBQUssRUFBRTtFQUN0QyxPQUFPQSxLQUFLLENBQUNDLEtBQUssQ0FBQyx1QkFBdUIsQ0FBQztBQUM3QyxDQUFDO0FBRU0sU0FBU0MsYUFBYUEsQ0FBQ0MsTUFBTSxFQUFFQyxNQUFNLEVBQUVDLFFBQVEsRUFBRTtFQUFFLE9BQU9ULFlBQVksQ0FBQ1UsSUFBSSxDQUFDSCxNQUFNLEVBQUVDLE1BQU0sRUFBRUMsUUFBUSxDQUFDO0FBQUUiLCJpZ25vcmVMaXN0IjpbXX0=
diff --git a/node_modules/diff/lib/diff/word.js b/node_modules/diff/lib/diff/word.js
new file mode 100644
index 0000000..64919db
--- /dev/null
+++ b/node_modules/diff/lib/diff/word.js
@@ -0,0 +1,543 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.diffWords = diffWords;
+exports.diffWordsWithSpace = diffWordsWithSpace;
+exports.wordWithSpaceDiff = exports.wordDiff = void 0;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./base"))
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_string = require("../util/string")
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
+//
+// Ranges and exceptions:
+// Latin-1 Supplement, 0080–00FF
+//  - U+00D7  × Multiplication sign
+//  - U+00F7  ÷ Division sign
+// Latin Extended-A, 0100–017F
+// Latin Extended-B, 0180–024F
+// IPA Extensions, 0250–02AF
+// Spacing Modifier Letters, 02B0–02FF
+//  - U+02C7  ˇ ˇ  Caron
+//  - U+02D8  ˘ ˘  Breve
+//  - U+02D9  ˙ ˙  Dot Above
+//  - U+02DA  ˚ ˚  Ring Above
+//  - U+02DB  ˛ ˛  Ogonek
+//  - U+02DC  ˜ ˜  Small Tilde
+//  - U+02DD  ˝ ˝  Double Acute Accent
+// Latin Extended Additional, 1E00–1EFF
+var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
+
+// Each token is one of the following:
+// - A punctuation mark plus the surrounding whitespace
+// - A word plus the surrounding whitespace
+// - Pure whitespace (but only in the special case where this the entire text
+//   is just whitespace)
+//
+// We have to include surrounding whitespace in the tokens because the two
+// alternative approaches produce horribly broken results:
+// * If we just discard the whitespace, we can't fully reproduce the original
+//   text from the sequence of tokens and any attempt to render the diff will
+//   get the whitespace wrong.
+// * If we have separate tokens for whitespace, then in a typical text every
+//   second token will be a single space character. But this often results in
+//   the optimal diff between two texts being a perverse one that preserves
+//   the spaces between words but deletes and reinserts actual common words.
+//   See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640
+//   for an example.
+//
+// Keeping the surrounding whitespace of course has implications for .equals
+// and .join, not just .tokenize.
+
+// This regex does NOT fully implement the tokenization rules described above.
+// Instead, it gives runs of whitespace their own "token". The tokenize method
+// then handles stitching whitespace tokens onto adjacent word or punctuation
+// tokens.
+var tokenizeIncludingWhitespace = new RegExp(
+/*istanbul ignore start*/
+"[".concat(
+/*istanbul ignore end*/
+extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), 'ug');
+var wordDiff =
+/*istanbul ignore start*/
+exports.wordDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+wordDiff.equals = function (left, right, options) {
+  if (options.ignoreCase) {
+    left = left.toLowerCase();
+    right = right.toLowerCase();
+  }
+  return left.trim() === right.trim();
+};
+wordDiff.tokenize = function (value) {
+  /*istanbul ignore start*/
+  var
+  /*istanbul ignore end*/
+  options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+  var parts;
+  if (options.intlSegmenter) {
+    if (options.intlSegmenter.resolvedOptions().granularity != 'word') {
+      throw new Error('The segmenter passed must have a granularity of "word"');
+    }
+    parts = Array.from(options.intlSegmenter.segment(value), function (segment)
+    /*istanbul ignore start*/
+    {
+      return (
+        /*istanbul ignore end*/
+        segment.segment
+      );
+    });
+  } else {
+    parts = value.match(tokenizeIncludingWhitespace) || [];
+  }
+  var tokens = [];
+  var prevPart = null;
+  parts.forEach(function (part) {
+    if (/\s/.test(part)) {
+      if (prevPart == null) {
+        tokens.push(part);
+      } else {
+        tokens.push(tokens.pop() + part);
+      }
+    } else if (/\s/.test(prevPart)) {
+      if (tokens[tokens.length - 1] == prevPart) {
+        tokens.push(tokens.pop() + part);
+      } else {
+        tokens.push(prevPart + part);
+      }
+    } else {
+      tokens.push(part);
+    }
+    prevPart = part;
+  });
+  return tokens;
+};
+wordDiff.join = function (tokens) {
+  // Tokens being joined here will always have appeared consecutively in the
+  // same text, so we can simply strip off the leading whitespace from all the
+  // tokens except the first (and except any whitespace-only tokens - but such
+  // a token will always be the first and only token anyway) and then join them
+  // and the whitespace around words and punctuation will end up correct.
+  return tokens.map(function (token, i) {
+    if (i == 0) {
+      return token;
+    } else {
+      return token.replace(/^\s+/, '');
+    }
+  }).join('');
+};
+wordDiff.postProcess = function (changes, options) {
+  if (!changes || options.oneChangePerToken) {
+    return changes;
+  }
+  var lastKeep = null;
+  // Change objects representing any insertion or deletion since the last
+  // "keep" change object. There can be at most one of each.
+  var insertion = null;
+  var deletion = null;
+  changes.forEach(function (change) {
+    if (change.added) {
+      insertion = change;
+    } else if (change.removed) {
+      deletion = change;
+    } else {
+      if (insertion || deletion) {
+        // May be false at start of text
+        dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
+      }
+      lastKeep = change;
+      insertion = null;
+      deletion = null;
+    }
+  });
+  if (insertion || deletion) {
+    dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
+  }
+  return changes;
+};
+function diffWords(oldStr, newStr, options) {
+  // This option has never been documented and never will be (it's clearer to
+  // just call `diffWordsWithSpace` directly if you need that behavior), but
+  // has existed in jsdiff for a long time, so we retain support for it here
+  // for the sake of backwards compatibility.
+  if (
+  /*istanbul ignore start*/
+  (
+  /*istanbul ignore end*/
+  options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) {
+    return diffWordsWithSpace(oldStr, newStr, options);
+  }
+  return wordDiff.diff(oldStr, newStr, options);
+}
+function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
+  // Before returning, we tidy up the leading and trailing whitespace of the
+  // change objects to eliminate cases where trailing whitespace in one object
+  // is repeated as leading whitespace in the next.
+  // Below are examples of the outcomes we want here to explain the code.
+  // I=insert, K=keep, D=delete
+  // 1. diffing 'foo bar baz' vs 'foo baz'
+  //    Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'
+  //    After cleanup, we want:   K:'foo ' D:'bar ' K:'baz'
+  //
+  // 2. Diffing 'foo bar baz' vs 'foo qux baz'
+  //    Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz'
+  //    After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz'
+  //
+  // 3. Diffing 'foo\nbar baz' vs 'foo baz'
+  //    Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz'
+  //    After cleanup, we want K'foo' D:'\nbar' K:' baz'
+  //
+  // 4. Diffing 'foo baz' vs 'foo\nbar baz'
+  //    Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz'
+  //    After cleanup, we ideally want K'foo' I:'\nbar' K:' baz'
+  //    but don't actually manage this currently (the pre-cleanup change
+  //    objects don't contain enough information to make it possible).
+  //
+  // 5. Diffing 'foo   bar baz' vs 'foo  baz'
+  //    Prior to cleanup, we have K:'foo  ' D:'   bar ' K:'  baz'
+  //    After cleanup, we want K:'foo  ' D:' bar ' K:'baz'
+  //
+  // Our handling is unavoidably imperfect in the case where there's a single
+  // indel between keeps and the whitespace has changed. For instance, consider
+  // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change
+  // object to represent the insertion of the space character (which isn't even
+  // a token), we have no way to avoid losing information about the texts'
+  // original whitespace in the result we return. Still, we do our best to
+  // output something that will look sensible if we e.g. print it with
+  // insertions in green and deletions in red.
+
+  // Between two "keep" change objects (or before the first or after the last
+  // change object), we can have either:
+  // * A "delete" followed by an "insert"
+  // * Just an "insert"
+  // * Just a "delete"
+  // We handle the three cases separately.
+  if (deletion && insertion) {
+    var oldWsPrefix = deletion.value.match(/^\s*/)[0];
+    var oldWsSuffix = deletion.value.match(/\s*$/)[0];
+    var newWsPrefix = insertion.value.match(/^\s*/)[0];
+    var newWsSuffix = insertion.value.match(/\s*$/)[0];
+    if (startKeep) {
+      var commonWsPrefix =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      longestCommonPrefix)
+      /*istanbul ignore end*/
+      (oldWsPrefix, newWsPrefix);
+      startKeep.value =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      replaceSuffix)
+      /*istanbul ignore end*/
+      (startKeep.value, newWsPrefix, commonWsPrefix);
+      deletion.value =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      removePrefix)
+      /*istanbul ignore end*/
+      (deletion.value, commonWsPrefix);
+      insertion.value =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      removePrefix)
+      /*istanbul ignore end*/
+      (insertion.value, commonWsPrefix);
+    }
+    if (endKeep) {
+      var commonWsSuffix =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      longestCommonSuffix)
+      /*istanbul ignore end*/
+      (oldWsSuffix, newWsSuffix);
+      endKeep.value =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      replacePrefix)
+      /*istanbul ignore end*/
+      (endKeep.value, newWsSuffix, commonWsSuffix);
+      deletion.value =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      removeSuffix)
+      /*istanbul ignore end*/
+      (deletion.value, commonWsSuffix);
+      insertion.value =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _string
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      removeSuffix)
+      /*istanbul ignore end*/
+      (insertion.value, commonWsSuffix);
+    }
+  } else if (insertion) {
+    // The whitespaces all reflect what was in the new text rather than
+    // the old, so we essentially have no information about whitespace
+    // insertion or deletion. We just want to dedupe the whitespace.
+    // We do that by having each change object keep its trailing
+    // whitespace and deleting duplicate leading whitespace where
+    // present.
+    if (startKeep) {
+      insertion.value = insertion.value.replace(/^\s*/, '');
+    }
+    if (endKeep) {
+      endKeep.value = endKeep.value.replace(/^\s*/, '');
+    }
+    // otherwise we've got a deletion and no insertion
+  } else if (startKeep && endKeep) {
+    var newWsFull = endKeep.value.match(/^\s*/)[0],
+      delWsStart = deletion.value.match(/^\s*/)[0],
+      delWsEnd = deletion.value.match(/\s*$/)[0];
+
+    // Any whitespace that comes straight after startKeep in both the old and
+    // new texts, assign to startKeep and remove from the deletion.
+    var newWsStart =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    longestCommonPrefix)
+    /*istanbul ignore end*/
+    (newWsFull, delWsStart);
+    deletion.value =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    removePrefix)
+    /*istanbul ignore end*/
+    (deletion.value, newWsStart);
+
+    // Any whitespace that comes straight before endKeep in both the old and
+    // new texts, and hasn't already been assigned to startKeep, assign to
+    // endKeep and remove from the deletion.
+    var newWsEnd =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    longestCommonSuffix)
+    /*istanbul ignore end*/
+    (
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    removePrefix)
+    /*istanbul ignore end*/
+    (newWsFull, newWsStart), delWsEnd);
+    deletion.value =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    removeSuffix)
+    /*istanbul ignore end*/
+    (deletion.value, newWsEnd);
+    endKeep.value =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    replacePrefix)
+    /*istanbul ignore end*/
+    (endKeep.value, newWsFull, newWsEnd);
+
+    // If there's any whitespace from the new text that HASN'T already been
+    // assigned, assign it to the start:
+    startKeep.value =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    replaceSuffix)
+    /*istanbul ignore end*/
+    (startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
+  } else if (endKeep) {
+    // We are at the start of the text. Preserve all the whitespace on
+    // endKeep, and just remove whitespace from the end of deletion to the
+    // extent that it overlaps with the start of endKeep.
+    var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0];
+    var deletionWsSuffix = deletion.value.match(/\s*$/)[0];
+    var overlap =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    maximumOverlap)
+    /*istanbul ignore end*/
+    (deletionWsSuffix, endKeepWsPrefix);
+    deletion.value =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    removeSuffix)
+    /*istanbul ignore end*/
+    (deletion.value, overlap);
+  } else if (startKeep) {
+    // We are at the END of the text. Preserve all the whitespace on
+    // startKeep, and just remove whitespace from the start of deletion to
+    // the extent that it overlaps with the end of startKeep.
+    var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0];
+    var deletionWsPrefix = deletion.value.match(/^\s*/)[0];
+    var _overlap =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    maximumOverlap)
+    /*istanbul ignore end*/
+    (startKeepWsSuffix, deletionWsPrefix);
+    deletion.value =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    removePrefix)
+    /*istanbul ignore end*/
+    (deletion.value, _overlap);
+  }
+}
+var wordWithSpaceDiff =
+/*istanbul ignore start*/
+exports.wordWithSpaceDiff =
+/*istanbul ignore end*/
+new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+[
+/*istanbul ignore start*/
+"default"
+/*istanbul ignore end*/
+]();
+wordWithSpaceDiff.tokenize = function (value) {
+  // Slightly different to the tokenizeIncludingWhitespace regex used above in
+  // that this one treats each individual newline as a distinct tokens, rather
+  // than merging them into other surrounding whitespace. This was requested
+  // in https://github.com/kpdecker/jsdiff/issues/180 &
+  //    https://github.com/kpdecker/jsdiff/issues/211
+  var regex = new RegExp(
+  /*istanbul ignore start*/
+  "(\\r?\\n)|[".concat(
+  /*istanbul ignore end*/
+  extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), 'ug');
+  return value.match(regex) || [];
+};
+function diffWordsWithSpace(oldStr, newStr, options) {
+  return wordWithSpaceDiff.diff(oldStr, newStr, options);
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfYmFzZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwiX3N0cmluZyIsIm9iaiIsIl9fZXNNb2R1bGUiLCJleHRlbmRlZFdvcmRDaGFycy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UFBQUE7QUFBQUE7QUFBQUEsQ0FBSSxDQUFDLENBQUM7QUFDM0M0RSxpQkFBaUIsQ0FBQ3BFLFFBQVEsR0FBRyxVQUFTQyxLQUFLLEVBQUU7RUFDM0M7RUFDQTtFQUNBO0VBQ0E7RUFDQTtFQUNBLElBQU1vRSxLQUFLLEdBQUcsSUFBSWpGLE1BQU07RUFBQTtFQUFBLGNBQUFDLE1BQUE7RUFBQTtFQUFlSCxpQkFBaUIseUJBQUFHLE1BQUEsQ0FBc0JILGlCQUFpQixRQUFLLElBQUksQ0FBQztFQUN6RyxPQUFPZSxLQUFLLENBQUNZLEtBQUssQ0FBQ3dELEtBQUssQ0FBQyxJQUFJLEVBQUU7QUFDakMsQ0FBQztBQUNNLFNBQVM3QixrQkFBa0JBLENBQUNILE1BQU0sRUFBRUMsTUFBTSxFQUFFMUMsT0FBTyxFQUFFO0VBQzFELE9BQU93RSxpQkFBaUIsQ0FBQzNCLElBQUksQ0FBQ0osTUFBTSxFQUFFQyxNQUFNLEVBQUUxQyxPQUFPLENBQUM7QUFDeEQiLCJpZ25vcmVMaXN0IjpbXX0=
diff --git a/node_modules/diff/lib/index.es6.js b/node_modules/diff/lib/index.es6.js
new file mode 100644
index 0000000..6e87272
--- /dev/null
+++ b/node_modules/diff/lib/index.es6.js
@@ -0,0 +1,2041 @@
+function Diff() {}
+Diff.prototype = {
+  diff: function diff(oldString, newString) {
+    var _options$timeout;
+    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+    var callback = options.callback;
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+    var self = this;
+    function done(value) {
+      value = self.postProcess(value, options);
+      if (callback) {
+        setTimeout(function () {
+          callback(value);
+        }, 0);
+        return true;
+      } else {
+        return value;
+      }
+    }
+
+    // Allow subclasses to massage the input prior to running
+    oldString = this.castInput(oldString, options);
+    newString = this.castInput(newString, options);
+    oldString = this.removeEmpty(this.tokenize(oldString, options));
+    newString = this.removeEmpty(this.tokenize(newString, options));
+    var newLen = newString.length,
+      oldLen = oldString.length;
+    var editLength = 1;
+    var maxEditLength = newLen + oldLen;
+    if (options.maxEditLength != null) {
+      maxEditLength = Math.min(maxEditLength, options.maxEditLength);
+    }
+    var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
+    var abortAfterTimestamp = Date.now() + maxExecutionTime;
+    var bestPath = [{
+      oldPos: -1,
+      lastComponent: undefined
+    }];
+
+    // Seed editLength = 0, i.e. the content starts with the same values
+    var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options);
+    if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+      // Identity per the equality and tokenizer
+      return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken));
+    }
+
+    // Once we hit the right edge of the edit graph on some diagonal k, we can
+    // definitely reach the end of the edit graph in no more than k edits, so
+    // there's no point in considering any moves to diagonal k+1 any more (from
+    // which we're guaranteed to need at least k+1 more edits).
+    // Similarly, once we've reached the bottom of the edit graph, there's no
+    // point considering moves to lower diagonals.
+    // We record this fact by setting minDiagonalToConsider and
+    // maxDiagonalToConsider to some finite value once we've hit the edge of
+    // the edit graph.
+    // This optimization is not faithful to the original algorithm presented in
+    // Myers's paper, which instead pointlessly extends D-paths off the end of
+    // the edit graph - see page 7 of Myers's paper which notes this point
+    // explicitly and illustrates it with a diagram. This has major performance
+    // implications for some common scenarios. For instance, to compute a diff
+    // where the new text simply appends d characters on the end of the
+    // original text of length n, the true Myers algorithm will take O(n+d^2)
+    // time while this optimization needs only O(n+d) time.
+    var minDiagonalToConsider = -Infinity,
+      maxDiagonalToConsider = Infinity;
+
+    // Main worker method. checks all permutations of a given edit length for acceptance.
+    function execEditLength() {
+      for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
+        var basePath = void 0;
+        var removePath = bestPath[diagonalPath - 1],
+          addPath = bestPath[diagonalPath + 1];
+        if (removePath) {
+          // No one else is going to attempt to use this value, clear it
+          bestPath[diagonalPath - 1] = undefined;
+        }
+        var canAdd = false;
+        if (addPath) {
+          // what newPos will be after we do an insertion:
+          var addPathNewPos = addPath.oldPos - diagonalPath;
+          canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
+        }
+        var canRemove = removePath && removePath.oldPos + 1 < oldLen;
+        if (!canAdd && !canRemove) {
+          // If this path is a terminal then prune
+          bestPath[diagonalPath] = undefined;
+          continue;
+        }
+
+        // Select the diagonal that we want to branch from. We select the prior
+        // path whose position in the old string is the farthest from the origin
+        // and does not pass the bounds of the diff graph
+        if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
+          basePath = self.addToPath(addPath, true, false, 0, options);
+        } else {
+          basePath = self.addToPath(removePath, false, true, 1, options);
+        }
+        newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options);
+        if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+          // If we have hit the end of both strings, then we are done
+          return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
+        } else {
+          bestPath[diagonalPath] = basePath;
+          if (basePath.oldPos + 1 >= oldLen) {
+            maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
+          }
+          if (newPos + 1 >= newLen) {
+            minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
+          }
+        }
+      }
+      editLength++;
+    }
+
+    // Performs the length of edit iteration. Is a bit fugly as this has to support the
+    // sync and async mode which is never fun. Loops over execEditLength until a value
+    // is produced, or until the edit length exceeds options.maxEditLength (if given),
+    // in which case it will return undefined.
+    if (callback) {
+      (function exec() {
+        setTimeout(function () {
+          if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
+            return callback();
+          }
+          if (!execEditLength()) {
+            exec();
+          }
+        }, 0);
+      })();
+    } else {
+      while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
+        var ret = execEditLength();
+        if (ret) {
+          return ret;
+        }
+      }
+    }
+  },
+  addToPath: function addToPath(path, added, removed, oldPosInc, options) {
+    var last = path.lastComponent;
+    if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
+      return {
+        oldPos: path.oldPos + oldPosInc,
+        lastComponent: {
+          count: last.count + 1,
+          added: added,
+          removed: removed,
+          previousComponent: last.previousComponent
+        }
+      };
+    } else {
+      return {
+        oldPos: path.oldPos + oldPosInc,
+        lastComponent: {
+          count: 1,
+          added: added,
+          removed: removed,
+          previousComponent: last
+        }
+      };
+    }
+  },
+  extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) {
+    var newLen = newString.length,
+      oldLen = oldString.length,
+      oldPos = basePath.oldPos,
+      newPos = oldPos - diagonalPath,
+      commonCount = 0;
+    while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) {
+      newPos++;
+      oldPos++;
+      commonCount++;
+      if (options.oneChangePerToken) {
+        basePath.lastComponent = {
+          count: 1,
+          previousComponent: basePath.lastComponent,
+          added: false,
+          removed: false
+        };
+      }
+    }
+    if (commonCount && !options.oneChangePerToken) {
+      basePath.lastComponent = {
+        count: commonCount,
+        previousComponent: basePath.lastComponent,
+        added: false,
+        removed: false
+      };
+    }
+    basePath.oldPos = oldPos;
+    return newPos;
+  },
+  equals: function equals(left, right, options) {
+    if (options.comparator) {
+      return options.comparator(left, right);
+    } else {
+      return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase();
+    }
+  },
+  removeEmpty: function removeEmpty(array) {
+    var ret = [];
+    for (var i = 0; i < array.length; i++) {
+      if (array[i]) {
+        ret.push(array[i]);
+      }
+    }
+    return ret;
+  },
+  castInput: function castInput(value) {
+    return value;
+  },
+  tokenize: function tokenize(value) {
+    return Array.from(value);
+  },
+  join: function join(chars) {
+    return chars.join('');
+  },
+  postProcess: function postProcess(changeObjects) {
+    return changeObjects;
+  }
+};
+function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
+  // First we convert our linked list of components in reverse order to an
+  // array in the right order:
+  var components = [];
+  var nextComponent;
+  while (lastComponent) {
+    components.push(lastComponent);
+    nextComponent = lastComponent.previousComponent;
+    delete lastComponent.previousComponent;
+    lastComponent = nextComponent;
+  }
+  components.reverse();
+  var componentPos = 0,
+    componentLen = components.length,
+    newPos = 0,
+    oldPos = 0;
+  for (; componentPos < componentLen; componentPos++) {
+    var component = components[componentPos];
+    if (!component.removed) {
+      if (!component.added && useLongestToken) {
+        var value = newString.slice(newPos, newPos + component.count);
+        value = value.map(function (value, i) {
+          var oldValue = oldString[oldPos + i];
+          return oldValue.length > value.length ? oldValue : value;
+        });
+        component.value = diff.join(value);
+      } else {
+        component.value = diff.join(newString.slice(newPos, newPos + component.count));
+      }
+      newPos += component.count;
+
+      // Common case
+      if (!component.added) {
+        oldPos += component.count;
+      }
+    } else {
+      component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
+      oldPos += component.count;
+    }
+  }
+  return components;
+}
+
+var characterDiff = new Diff();
+function diffChars(oldStr, newStr, options) {
+  return characterDiff.diff(oldStr, newStr, options);
+}
+
+function longestCommonPrefix(str1, str2) {
+  var i;
+  for (i = 0; i < str1.length && i < str2.length; i++) {
+    if (str1[i] != str2[i]) {
+      return str1.slice(0, i);
+    }
+  }
+  return str1.slice(0, i);
+}
+function longestCommonSuffix(str1, str2) {
+  var i;
+
+  // Unlike longestCommonPrefix, we need a special case to handle all scenarios
+  // where we return the empty string since str1.slice(-0) will return the
+  // entire string.
+  if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
+    return '';
+  }
+  for (i = 0; i < str1.length && i < str2.length; i++) {
+    if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
+      return str1.slice(-i);
+    }
+  }
+  return str1.slice(-i);
+}
+function replacePrefix(string, oldPrefix, newPrefix) {
+  if (string.slice(0, oldPrefix.length) != oldPrefix) {
+    throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug"));
+  }
+  return newPrefix + string.slice(oldPrefix.length);
+}
+function replaceSuffix(string, oldSuffix, newSuffix) {
+  if (!oldSuffix) {
+    return string + newSuffix;
+  }
+  if (string.slice(-oldSuffix.length) != oldSuffix) {
+    throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug"));
+  }
+  return string.slice(0, -oldSuffix.length) + newSuffix;
+}
+function removePrefix(string, oldPrefix) {
+  return replacePrefix(string, oldPrefix, '');
+}
+function removeSuffix(string, oldSuffix) {
+  return replaceSuffix(string, oldSuffix, '');
+}
+function maximumOverlap(string1, string2) {
+  return string2.slice(0, overlapCount(string1, string2));
+}
+
+// Nicked from https://stackoverflow.com/a/60422853/1709587
+function overlapCount(a, b) {
+  // Deal with cases where the strings differ in length
+  var startA = 0;
+  if (a.length > b.length) {
+    startA = a.length - b.length;
+  }
+  var endB = b.length;
+  if (a.length < b.length) {
+    endB = a.length;
+  }
+  // Create a back-reference for each index
+  //   that should be followed in case of a mismatch.
+  //   We only need B to make these references:
+  var map = Array(endB);
+  var k = 0; // Index that lags behind j
+  map[0] = 0;
+  for (var j = 1; j < endB; j++) {
+    if (b[j] == b[k]) {
+      map[j] = map[k]; // skip over the same character (optional optimisation)
+    } else {
+      map[j] = k;
+    }
+    while (k > 0 && b[j] != b[k]) {
+      k = map[k];
+    }
+    if (b[j] == b[k]) {
+      k++;
+    }
+  }
+  // Phase 2: use these references while iterating over A
+  k = 0;
+  for (var i = startA; i < a.length; i++) {
+    while (k > 0 && a[i] != b[k]) {
+      k = map[k];
+    }
+    if (a[i] == b[k]) {
+      k++;
+    }
+  }
+  return k;
+}
+
+/**
+ * Returns true if the string consistently uses Windows line endings.
+ */
+function hasOnlyWinLineEndings(string) {
+  return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/);
+}
+
+/**
+ * Returns true if the string consistently uses Unix line endings.
+ */
+function hasOnlyUnixLineEndings(string) {
+  return !string.includes('\r\n') && string.includes('\n');
+}
+
+// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
+//
+// Ranges and exceptions:
+// Latin-1 Supplement, 0080–00FF
+//  - U+00D7  × Multiplication sign
+//  - U+00F7  ÷ Division sign
+// Latin Extended-A, 0100–017F
+// Latin Extended-B, 0180–024F
+// IPA Extensions, 0250–02AF
+// Spacing Modifier Letters, 02B0–02FF
+//  - U+02C7  ˇ ˇ  Caron
+//  - U+02D8  ˘ ˘  Breve
+//  - U+02D9  ˙ ˙  Dot Above
+//  - U+02DA  ˚ ˚  Ring Above
+//  - U+02DB  ˛ ˛  Ogonek
+//  - U+02DC  ˜ ˜  Small Tilde
+//  - U+02DD  ˝ ˝  Double Acute Accent
+// Latin Extended Additional, 1E00–1EFF
+var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
+
+// Each token is one of the following:
+// - A punctuation mark plus the surrounding whitespace
+// - A word plus the surrounding whitespace
+// - Pure whitespace (but only in the special case where this the entire text
+//   is just whitespace)
+//
+// We have to include surrounding whitespace in the tokens because the two
+// alternative approaches produce horribly broken results:
+// * If we just discard the whitespace, we can't fully reproduce the original
+//   text from the sequence of tokens and any attempt to render the diff will
+//   get the whitespace wrong.
+// * If we have separate tokens for whitespace, then in a typical text every
+//   second token will be a single space character. But this often results in
+//   the optimal diff between two texts being a perverse one that preserves
+//   the spaces between words but deletes and reinserts actual common words.
+//   See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640
+//   for an example.
+//
+// Keeping the surrounding whitespace of course has implications for .equals
+// and .join, not just .tokenize.
+
+// This regex does NOT fully implement the tokenization rules described above.
+// Instead, it gives runs of whitespace their own "token". The tokenize method
+// then handles stitching whitespace tokens onto adjacent word or punctuation
+// tokens.
+var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), 'ug');
+var wordDiff = new Diff();
+wordDiff.equals = function (left, right, options) {
+  if (options.ignoreCase) {
+    left = left.toLowerCase();
+    right = right.toLowerCase();
+  }
+  return left.trim() === right.trim();
+};
+wordDiff.tokenize = function (value) {
+  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+  var parts;
+  if (options.intlSegmenter) {
+    if (options.intlSegmenter.resolvedOptions().granularity != 'word') {
+      throw new Error('The segmenter passed must have a granularity of "word"');
+    }
+    parts = Array.from(options.intlSegmenter.segment(value), function (segment) {
+      return segment.segment;
+    });
+  } else {
+    parts = value.match(tokenizeIncludingWhitespace) || [];
+  }
+  var tokens = [];
+  var prevPart = null;
+  parts.forEach(function (part) {
+    if (/\s/.test(part)) {
+      if (prevPart == null) {
+        tokens.push(part);
+      } else {
+        tokens.push(tokens.pop() + part);
+      }
+    } else if (/\s/.test(prevPart)) {
+      if (tokens[tokens.length - 1] == prevPart) {
+        tokens.push(tokens.pop() + part);
+      } else {
+        tokens.push(prevPart + part);
+      }
+    } else {
+      tokens.push(part);
+    }
+    prevPart = part;
+  });
+  return tokens;
+};
+wordDiff.join = function (tokens) {
+  // Tokens being joined here will always have appeared consecutively in the
+  // same text, so we can simply strip off the leading whitespace from all the
+  // tokens except the first (and except any whitespace-only tokens - but such
+  // a token will always be the first and only token anyway) and then join them
+  // and the whitespace around words and punctuation will end up correct.
+  return tokens.map(function (token, i) {
+    if (i == 0) {
+      return token;
+    } else {
+      return token.replace(/^\s+/, '');
+    }
+  }).join('');
+};
+wordDiff.postProcess = function (changes, options) {
+  if (!changes || options.oneChangePerToken) {
+    return changes;
+  }
+  var lastKeep = null;
+  // Change objects representing any insertion or deletion since the last
+  // "keep" change object. There can be at most one of each.
+  var insertion = null;
+  var deletion = null;
+  changes.forEach(function (change) {
+    if (change.added) {
+      insertion = change;
+    } else if (change.removed) {
+      deletion = change;
+    } else {
+      if (insertion || deletion) {
+        // May be false at start of text
+        dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
+      }
+      lastKeep = change;
+      insertion = null;
+      deletion = null;
+    }
+  });
+  if (insertion || deletion) {
+    dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
+  }
+  return changes;
+};
+function diffWords(oldStr, newStr, options) {
+  // This option has never been documented and never will be (it's clearer to
+  // just call `diffWordsWithSpace` directly if you need that behavior), but
+  // has existed in jsdiff for a long time, so we retain support for it here
+  // for the sake of backwards compatibility.
+  if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) {
+    return diffWordsWithSpace(oldStr, newStr, options);
+  }
+  return wordDiff.diff(oldStr, newStr, options);
+}
+function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
+  // Before returning, we tidy up the leading and trailing whitespace of the
+  // change objects to eliminate cases where trailing whitespace in one object
+  // is repeated as leading whitespace in the next.
+  // Below are examples of the outcomes we want here to explain the code.
+  // I=insert, K=keep, D=delete
+  // 1. diffing 'foo bar baz' vs 'foo baz'
+  //    Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'
+  //    After cleanup, we want:   K:'foo ' D:'bar ' K:'baz'
+  //
+  // 2. Diffing 'foo bar baz' vs 'foo qux baz'
+  //    Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz'
+  //    After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz'
+  //
+  // 3. Diffing 'foo\nbar baz' vs 'foo baz'
+  //    Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz'
+  //    After cleanup, we want K'foo' D:'\nbar' K:' baz'
+  //
+  // 4. Diffing 'foo baz' vs 'foo\nbar baz'
+  //    Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz'
+  //    After cleanup, we ideally want K'foo' I:'\nbar' K:' baz'
+  //    but don't actually manage this currently (the pre-cleanup change
+  //    objects don't contain enough information to make it possible).
+  //
+  // 5. Diffing 'foo   bar baz' vs 'foo  baz'
+  //    Prior to cleanup, we have K:'foo  ' D:'   bar ' K:'  baz'
+  //    After cleanup, we want K:'foo  ' D:' bar ' K:'baz'
+  //
+  // Our handling is unavoidably imperfect in the case where there's a single
+  // indel between keeps and the whitespace has changed. For instance, consider
+  // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change
+  // object to represent the insertion of the space character (which isn't even
+  // a token), we have no way to avoid losing information about the texts'
+  // original whitespace in the result we return. Still, we do our best to
+  // output something that will look sensible if we e.g. print it with
+  // insertions in green and deletions in red.
+
+  // Between two "keep" change objects (or before the first or after the last
+  // change object), we can have either:
+  // * A "delete" followed by an "insert"
+  // * Just an "insert"
+  // * Just a "delete"
+  // We handle the three cases separately.
+  if (deletion && insertion) {
+    var oldWsPrefix = deletion.value.match(/^\s*/)[0];
+    var oldWsSuffix = deletion.value.match(/\s*$/)[0];
+    var newWsPrefix = insertion.value.match(/^\s*/)[0];
+    var newWsSuffix = insertion.value.match(/\s*$/)[0];
+    if (startKeep) {
+      var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
+      startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
+      deletion.value = removePrefix(deletion.value, commonWsPrefix);
+      insertion.value = removePrefix(insertion.value, commonWsPrefix);
+    }
+    if (endKeep) {
+      var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
+      endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
+      deletion.value = removeSuffix(deletion.value, commonWsSuffix);
+      insertion.value = removeSuffix(insertion.value, commonWsSuffix);
+    }
+  } else if (insertion) {
+    // The whitespaces all reflect what was in the new text rather than
+    // the old, so we essentially have no information about whitespace
+    // insertion or deletion. We just want to dedupe the whitespace.
+    // We do that by having each change object keep its trailing
+    // whitespace and deleting duplicate leading whitespace where
+    // present.
+    if (startKeep) {
+      insertion.value = insertion.value.replace(/^\s*/, '');
+    }
+    if (endKeep) {
+      endKeep.value = endKeep.value.replace(/^\s*/, '');
+    }
+    // otherwise we've got a deletion and no insertion
+  } else if (startKeep && endKeep) {
+    var newWsFull = endKeep.value.match(/^\s*/)[0],
+      delWsStart = deletion.value.match(/^\s*/)[0],
+      delWsEnd = deletion.value.match(/\s*$/)[0];
+
+    // Any whitespace that comes straight after startKeep in both the old and
+    // new texts, assign to startKeep and remove from the deletion.
+    var newWsStart = longestCommonPrefix(newWsFull, delWsStart);
+    deletion.value = removePrefix(deletion.value, newWsStart);
+
+    // Any whitespace that comes straight before endKeep in both the old and
+    // new texts, and hasn't already been assigned to startKeep, assign to
+    // endKeep and remove from the deletion.
+    var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
+    deletion.value = removeSuffix(deletion.value, newWsEnd);
+    endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
+
+    // If there's any whitespace from the new text that HASN'T already been
+    // assigned, assign it to the start:
+    startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
+  } else if (endKeep) {
+    // We are at the start of the text. Preserve all the whitespace on
+    // endKeep, and just remove whitespace from the end of deletion to the
+    // extent that it overlaps with the start of endKeep.
+    var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0];
+    var deletionWsSuffix = deletion.value.match(/\s*$/)[0];
+    var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
+    deletion.value = removeSuffix(deletion.value, overlap);
+  } else if (startKeep) {
+    // We are at the END of the text. Preserve all the whitespace on
+    // startKeep, and just remove whitespace from the start of deletion to
+    // the extent that it overlaps with the end of startKeep.
+    var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0];
+    var deletionWsPrefix = deletion.value.match(/^\s*/)[0];
+    var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
+    deletion.value = removePrefix(deletion.value, _overlap);
+  }
+}
+var wordWithSpaceDiff = new Diff();
+wordWithSpaceDiff.tokenize = function (value) {
+  // Slightly different to the tokenizeIncludingWhitespace regex used above in
+  // that this one treats each individual newline as a distinct tokens, rather
+  // than merging them into other surrounding whitespace. This was requested
+  // in https://github.com/kpdecker/jsdiff/issues/180 &
+  //    https://github.com/kpdecker/jsdiff/issues/211
+  var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), 'ug');
+  return value.match(regex) || [];
+};
+function diffWordsWithSpace(oldStr, newStr, options) {
+  return wordWithSpaceDiff.diff(oldStr, newStr, options);
+}
+
+function generateOptions(options, defaults) {
+  if (typeof options === 'function') {
+    defaults.callback = options;
+  } else if (options) {
+    for (var name in options) {
+      /* istanbul ignore else */
+      if (options.hasOwnProperty(name)) {
+        defaults[name] = options[name];
+      }
+    }
+  }
+  return defaults;
+}
+
+var lineDiff = new Diff();
+lineDiff.tokenize = function (value, options) {
+  if (options.stripTrailingCr) {
+    // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
+    value = value.replace(/\r\n/g, '\n');
+  }
+  var retLines = [],
+    linesAndNewlines = value.split(/(\n|\r\n)/);
+
+  // Ignore the final empty token that occurs if the string ends with a new line
+  if (!linesAndNewlines[linesAndNewlines.length - 1]) {
+    linesAndNewlines.pop();
+  }
+
+  // Merge the content and line separators into single tokens
+  for (var i = 0; i < linesAndNewlines.length; i++) {
+    var line = linesAndNewlines[i];
+    if (i % 2 && !options.newlineIsToken) {
+      retLines[retLines.length - 1] += line;
+    } else {
+      retLines.push(line);
+    }
+  }
+  return retLines;
+};
+lineDiff.equals = function (left, right, options) {
+  // If we're ignoring whitespace, we need to normalise lines by stripping
+  // whitespace before checking equality. (This has an annoying interaction
+  // with newlineIsToken that requires special handling: if newlines get their
+  // own token, then we DON'T want to trim the *newline* tokens down to empty
+  // strings, since this would cause us to treat whitespace-only line content
+  // as equal to a separator between lines, which would be weird and
+  // inconsistent with the documented behavior of the options.)
+  if (options.ignoreWhitespace) {
+    if (!options.newlineIsToken || !left.includes('\n')) {
+      left = left.trim();
+    }
+    if (!options.newlineIsToken || !right.includes('\n')) {
+      right = right.trim();
+    }
+  } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
+    if (left.endsWith('\n')) {
+      left = left.slice(0, -1);
+    }
+    if (right.endsWith('\n')) {
+      right = right.slice(0, -1);
+    }
+  }
+  return Diff.prototype.equals.call(this, left, right, options);
+};
+function diffLines(oldStr, newStr, callback) {
+  return lineDiff.diff(oldStr, newStr, callback);
+}
+
+// Kept for backwards compatibility. This is a rather arbitrary wrapper method
+// that just calls `diffLines` with `ignoreWhitespace: true`. It's confusing to
+// have two ways to do exactly the same thing in the API, so we no longer
+// document this one (library users should explicitly use `diffLines` with
+// `ignoreWhitespace: true` instead) but we keep it around to maintain
+// compatibility with code that used old versions.
+function diffTrimmedLines(oldStr, newStr, callback) {
+  var options = generateOptions(callback, {
+    ignoreWhitespace: true
+  });
+  return lineDiff.diff(oldStr, newStr, options);
+}
+
+var sentenceDiff = new Diff();
+sentenceDiff.tokenize = function (value) {
+  return value.split(/(\S.+?[.!?])(?=\s+|$)/);
+};
+function diffSentences(oldStr, newStr, callback) {
+  return sentenceDiff.diff(oldStr, newStr, callback);
+}
+
+var cssDiff = new Diff();
+cssDiff.tokenize = function (value) {
+  return value.split(/([{}:;,]|\s+)/);
+};
+function diffCss(oldStr, newStr, callback) {
+  return cssDiff.diff(oldStr, newStr, callback);
+}
+
+function ownKeys(e, r) {
+  var t = Object.keys(e);
+  if (Object.getOwnPropertySymbols) {
+    var o = Object.getOwnPropertySymbols(e);
+    r && (o = o.filter(function (r) {
+      return Object.getOwnPropertyDescriptor(e, r).enumerable;
+    })), t.push.apply(t, o);
+  }
+  return t;
+}
+function _objectSpread2(e) {
+  for (var r = 1; r < arguments.length; r++) {
+    var t = null != arguments[r] ? arguments[r] : {};
+    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
+      _defineProperty(e, r, t[r]);
+    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
+      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
+    });
+  }
+  return e;
+}
+function _toPrimitive(t, r) {
+  if ("object" != typeof t || !t) return t;
+  var e = t[Symbol.toPrimitive];
+  if (void 0 !== e) {
+    var i = e.call(t, r || "default");
+    if ("object" != typeof i) return i;
+    throw new TypeError("@@toPrimitive must return a primitive value.");
+  }
+  return ("string" === r ? String : Number)(t);
+}
+function _toPropertyKey(t) {
+  var i = _toPrimitive(t, "string");
+  return "symbol" == typeof i ? i : i + "";
+}
+function _typeof(o) {
+  "@babel/helpers - typeof";
+
+  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
+    return typeof o;
+  } : function (o) {
+    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
+  }, _typeof(o);
+}
+function _defineProperty(obj, key, value) {
+  key = _toPropertyKey(key);
+  if (key in obj) {
+    Object.defineProperty(obj, key, {
+      value: value,
+      enumerable: true,
+      configurable: true,
+      writable: true
+    });
+  } else {
+    obj[key] = value;
+  }
+  return obj;
+}
+function _toConsumableArray(arr) {
+  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+}
+function _arrayWithoutHoles(arr) {
+  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+}
+function _iterableToArray(iter) {
+  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+}
+function _unsupportedIterableToArray(o, minLen) {
+  if (!o) return;
+  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+  var n = Object.prototype.toString.call(o).slice(8, -1);
+  if (n === "Object" && o.constructor) n = o.constructor.name;
+  if (n === "Map" || n === "Set") return Array.from(o);
+  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+}
+function _arrayLikeToArray(arr, len) {
+  if (len == null || len > arr.length) len = arr.length;
+  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+  return arr2;
+}
+function _nonIterableSpread() {
+  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+}
+
+var jsonDiff = new Diff();
+// Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
+// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
+jsonDiff.useLongestToken = true;
+jsonDiff.tokenize = lineDiff.tokenize;
+jsonDiff.castInput = function (value, options) {
+  var undefinedReplacement = options.undefinedReplacement,
+    _options$stringifyRep = options.stringifyReplacer,
+    stringifyReplacer = _options$stringifyRep === void 0 ? function (k, v) {
+      return typeof v === 'undefined' ? undefinedReplacement : v;
+    } : _options$stringifyRep;
+  return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, '  ');
+};
+jsonDiff.equals = function (left, right, options) {
+  return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options);
+};
+function diffJson(oldObj, newObj, options) {
+  return jsonDiff.diff(oldObj, newObj, options);
+}
+
+// This function handles the presence of circular references by bailing out when encountering an
+// object that is already on the "stack" of items being processed. Accepts an optional replacer
+function canonicalize(obj, stack, replacementStack, replacer, key) {
+  stack = stack || [];
+  replacementStack = replacementStack || [];
+  if (replacer) {
+    obj = replacer(key, obj);
+  }
+  var i;
+  for (i = 0; i < stack.length; i += 1) {
+    if (stack[i] === obj) {
+      return replacementStack[i];
+    }
+  }
+  var canonicalizedObj;
+  if ('[object Array]' === Object.prototype.toString.call(obj)) {
+    stack.push(obj);
+    canonicalizedObj = new Array(obj.length);
+    replacementStack.push(canonicalizedObj);
+    for (i = 0; i < obj.length; i += 1) {
+      canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
+    }
+    stack.pop();
+    replacementStack.pop();
+    return canonicalizedObj;
+  }
+  if (obj && obj.toJSON) {
+    obj = obj.toJSON();
+  }
+  if (_typeof(obj) === 'object' && obj !== null) {
+    stack.push(obj);
+    canonicalizedObj = {};
+    replacementStack.push(canonicalizedObj);
+    var sortedKeys = [],
+      _key;
+    for (_key in obj) {
+      /* istanbul ignore else */
+      if (Object.prototype.hasOwnProperty.call(obj, _key)) {
+        sortedKeys.push(_key);
+      }
+    }
+    sortedKeys.sort();
+    for (i = 0; i < sortedKeys.length; i += 1) {
+      _key = sortedKeys[i];
+      canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
+    }
+    stack.pop();
+    replacementStack.pop();
+  } else {
+    canonicalizedObj = obj;
+  }
+  return canonicalizedObj;
+}
+
+var arrayDiff = new Diff();
+arrayDiff.tokenize = function (value) {
+  return value.slice();
+};
+arrayDiff.join = arrayDiff.removeEmpty = function (value) {
+  return value;
+};
+function diffArrays(oldArr, newArr, callback) {
+  return arrayDiff.diff(oldArr, newArr, callback);
+}
+
+function unixToWin(patch) {
+  if (Array.isArray(patch)) {
+    return patch.map(unixToWin);
+  }
+  return _objectSpread2(_objectSpread2({}, patch), {}, {
+    hunks: patch.hunks.map(function (hunk) {
+      return _objectSpread2(_objectSpread2({}, hunk), {}, {
+        lines: hunk.lines.map(function (line, i) {
+          var _hunk$lines;
+          return line.startsWith('\\') || line.endsWith('\r') || (_hunk$lines = hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 && _hunk$lines.startsWith('\\') ? line : line + '\r';
+        })
+      });
+    })
+  });
+}
+function winToUnix(patch) {
+  if (Array.isArray(patch)) {
+    return patch.map(winToUnix);
+  }
+  return _objectSpread2(_objectSpread2({}, patch), {}, {
+    hunks: patch.hunks.map(function (hunk) {
+      return _objectSpread2(_objectSpread2({}, hunk), {}, {
+        lines: hunk.lines.map(function (line) {
+          return line.endsWith('\r') ? line.substring(0, line.length - 1) : line;
+        })
+      });
+    })
+  });
+}
+
+/**
+ * Returns true if the patch consistently uses Unix line endings (or only involves one line and has
+ * no line endings).
+ */
+function isUnix(patch) {
+  if (!Array.isArray(patch)) {
+    patch = [patch];
+  }
+  return !patch.some(function (index) {
+    return index.hunks.some(function (hunk) {
+      return hunk.lines.some(function (line) {
+        return !line.startsWith('\\') && line.endsWith('\r');
+      });
+    });
+  });
+}
+
+/**
+ * Returns true if the patch uses Windows line endings and only Windows line endings.
+ */
+function isWin(patch) {
+  if (!Array.isArray(patch)) {
+    patch = [patch];
+  }
+  return patch.some(function (index) {
+    return index.hunks.some(function (hunk) {
+      return hunk.lines.some(function (line) {
+        return line.endsWith('\r');
+      });
+    });
+  }) && patch.every(function (index) {
+    return index.hunks.every(function (hunk) {
+      return hunk.lines.every(function (line, i) {
+        var _hunk$lines2;
+        return line.startsWith('\\') || line.endsWith('\r') || ((_hunk$lines2 = hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 : _hunk$lines2.startsWith('\\'));
+      });
+    });
+  });
+}
+
+function parsePatch(uniDiff) {
+  var diffstr = uniDiff.split(/\n/),
+    list = [],
+    i = 0;
+  function parseIndex() {
+    var index = {};
+    list.push(index);
+
+    // Parse diff metadata
+    while (i < diffstr.length) {
+      var line = diffstr[i];
+
+      // File header found, end parsing diff metadata
+      if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
+        break;
+      }
+
+      // Diff index
+      var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
+      if (header) {
+        index.index = header[1];
+      }
+      i++;
+    }
+
+    // Parse file headers if they are defined. Unified diff requires them, but
+    // there's no technical issues to have an isolated hunk without file header
+    parseFileHeader(index);
+    parseFileHeader(index);
+
+    // Parse hunks
+    index.hunks = [];
+    while (i < diffstr.length) {
+      var _line = diffstr[i];
+      if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) {
+        break;
+      } else if (/^@@/.test(_line)) {
+        index.hunks.push(parseHunk());
+      } else if (_line) {
+        throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
+      } else {
+        i++;
+      }
+    }
+  }
+
+  // Parses the --- and +++ headers, if none are found, no lines
+  // are consumed.
+  function parseFileHeader(index) {
+    var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]);
+    if (fileHeader) {
+      var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
+      var data = fileHeader[2].split('\t', 2);
+      var fileName = data[0].replace(/\\\\/g, '\\');
+      if (/^".*"$/.test(fileName)) {
+        fileName = fileName.substr(1, fileName.length - 2);
+      }
+      index[keyPrefix + 'FileName'] = fileName;
+      index[keyPrefix + 'Header'] = (data[1] || '').trim();
+      i++;
+    }
+  }
+
+  // Parses a hunk
+  // This assumes that we are at the start of a hunk.
+  function parseHunk() {
+    var chunkHeaderIndex = i,
+      chunkHeaderLine = diffstr[i++],
+      chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
+    var hunk = {
+      oldStart: +chunkHeader[1],
+      oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
+      newStart: +chunkHeader[3],
+      newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
+      lines: []
+    };
+
+    // Unified Diff Format quirk: If the chunk size is 0,
+    // the first number is one lower than one would expect.
+    // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+    if (hunk.oldLines === 0) {
+      hunk.oldStart += 1;
+    }
+    if (hunk.newLines === 0) {
+      hunk.newStart += 1;
+    }
+    var addCount = 0,
+      removeCount = 0;
+    for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || (_diffstr$i = diffstr[i]) !== null && _diffstr$i !== void 0 && _diffstr$i.startsWith('\\')); i++) {
+      var _diffstr$i;
+      var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
+      if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
+        hunk.lines.push(diffstr[i]);
+        if (operation === '+') {
+          addCount++;
+        } else if (operation === '-') {
+          removeCount++;
+        } else if (operation === ' ') {
+          addCount++;
+          removeCount++;
+        }
+      } else {
+        throw new Error("Hunk at line ".concat(chunkHeaderIndex + 1, " contained invalid line ").concat(diffstr[i]));
+      }
+    }
+
+    // Handle the empty block count case
+    if (!addCount && hunk.newLines === 1) {
+      hunk.newLines = 0;
+    }
+    if (!removeCount && hunk.oldLines === 1) {
+      hunk.oldLines = 0;
+    }
+
+    // Perform sanity checking
+    if (addCount !== hunk.newLines) {
+      throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+    }
+    if (removeCount !== hunk.oldLines) {
+      throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+    }
+    return hunk;
+  }
+  while (i < diffstr.length) {
+    parseIndex();
+  }
+  return list;
+}
+
+// Iterator that traverses in the range of [min, max], stepping
+// by distance from a given start position. I.e. for [0, 4], with
+// start of 2, this will iterate 2, 3, 1, 4, 0.
+function distanceIterator (start, minLine, maxLine) {
+  var wantForward = true,
+    backwardExhausted = false,
+    forwardExhausted = false,
+    localOffset = 1;
+  return function iterator() {
+    if (wantForward && !forwardExhausted) {
+      if (backwardExhausted) {
+        localOffset++;
+      } else {
+        wantForward = false;
+      }
+
+      // Check if trying to fit beyond text length, and if not, check it fits
+      // after offset location (or desired location on first iteration)
+      if (start + localOffset <= maxLine) {
+        return start + localOffset;
+      }
+      forwardExhausted = true;
+    }
+    if (!backwardExhausted) {
+      if (!forwardExhausted) {
+        wantForward = true;
+      }
+
+      // Check if trying to fit before text beginning, and if not, check it fits
+      // before offset location
+      if (minLine <= start - localOffset) {
+        return start - localOffset++;
+      }
+      backwardExhausted = true;
+      return iterator();
+    }
+
+    // We tried to fit hunk before text beginning and beyond text length, then
+    // hunk can't fit on the text. Return undefined
+  };
+}
+
+function applyPatch(source, uniDiff) {
+  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+  if (typeof uniDiff === 'string') {
+    uniDiff = parsePatch(uniDiff);
+  }
+  if (Array.isArray(uniDiff)) {
+    if (uniDiff.length > 1) {
+      throw new Error('applyPatch only works with a single input.');
+    }
+    uniDiff = uniDiff[0];
+  }
+  if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) {
+    if (hasOnlyWinLineEndings(source) && isUnix(uniDiff)) {
+      uniDiff = unixToWin(uniDiff);
+    } else if (hasOnlyUnixLineEndings(source) && isWin(uniDiff)) {
+      uniDiff = winToUnix(uniDiff);
+    }
+  }
+
+  // Apply the diff to the input
+  var lines = source.split('\n'),
+    hunks = uniDiff.hunks,
+    compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) {
+      return line === patchContent;
+    },
+    fuzzFactor = options.fuzzFactor || 0,
+    minLine = 0;
+  if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) {
+    throw new Error('fuzzFactor must be a non-negative integer');
+  }
+
+  // Special case for empty patch.
+  if (!hunks.length) {
+    return source;
+  }
+
+  // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change
+  // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a
+  // newline that already exists - then we either return false and fail to apply the patch (if
+  // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0).
+  // If we do need to remove/add a newline at EOF, this will always be in the final hunk:
+  var prevLine = '',
+    removeEOFNL = false,
+    addEOFNL = false;
+  for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) {
+    var line = hunks[hunks.length - 1].lines[i];
+    if (line[0] == '\\') {
+      if (prevLine[0] == '+') {
+        removeEOFNL = true;
+      } else if (prevLine[0] == '-') {
+        addEOFNL = true;
+      }
+    }
+    prevLine = line;
+  }
+  if (removeEOFNL) {
+    if (addEOFNL) {
+      // This means the final line gets changed but doesn't have a trailing newline in either the
+      // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if
+      // fuzzFactor is 0, we simply validate that the source file has no trailing newline.
+      if (!fuzzFactor && lines[lines.length - 1] == '') {
+        return false;
+      }
+    } else if (lines[lines.length - 1] == '') {
+      lines.pop();
+    } else if (!fuzzFactor) {
+      return false;
+    }
+  } else if (addEOFNL) {
+    if (lines[lines.length - 1] != '') {
+      lines.push('');
+    } else if (!fuzzFactor) {
+      return false;
+    }
+  }
+
+  /**
+   * Checks if the hunk can be made to fit at the provided location with at most `maxErrors`
+   * insertions, substitutions, or deletions, while ensuring also that:
+   * - lines deleted in the hunk match exactly, and
+   * - wherever an insertion operation or block of insertion operations appears in the hunk, the
+   *   immediately preceding and following lines of context match exactly
+   *
+   * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0].
+   *
+   * If the hunk can be applied, returns an object with properties `oldLineLastI` and
+   * `replacementLines`. Otherwise, returns null.
+   */
+  function applyHunk(hunkLines, toPos, maxErrors) {
+    var hunkLinesI = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
+    var lastContextLineMatched = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
+    var patchedLines = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
+    var patchedLinesLength = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
+    var nConsecutiveOldContextLines = 0;
+    var nextContextLineMustMatch = false;
+    for (; hunkLinesI < hunkLines.length; hunkLinesI++) {
+      var hunkLine = hunkLines[hunkLinesI],
+        operation = hunkLine.length > 0 ? hunkLine[0] : ' ',
+        content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine;
+      if (operation === '-') {
+        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+          toPos++;
+          nConsecutiveOldContextLines = 0;
+        } else {
+          if (!maxErrors || lines[toPos] == null) {
+            return null;
+          }
+          patchedLines[patchedLinesLength] = lines[toPos];
+          return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1);
+        }
+      }
+      if (operation === '+') {
+        if (!lastContextLineMatched) {
+          return null;
+        }
+        patchedLines[patchedLinesLength] = content;
+        patchedLinesLength++;
+        nConsecutiveOldContextLines = 0;
+        nextContextLineMustMatch = true;
+      }
+      if (operation === ' ') {
+        nConsecutiveOldContextLines++;
+        patchedLines[patchedLinesLength] = lines[toPos];
+        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+          patchedLinesLength++;
+          lastContextLineMatched = true;
+          nextContextLineMustMatch = false;
+          toPos++;
+        } else {
+          if (nextContextLineMustMatch || !maxErrors) {
+            return null;
+          }
+
+          // Consider 3 possibilities in sequence:
+          // 1. lines contains a *substitution* not included in the patch context, or
+          // 2. lines contains an *insertion* not included in the patch context, or
+          // 3. lines contains a *deletion* not included in the patch context
+          // The first two options are of course only possible if the line from lines is non-null -
+          // i.e. only option 3 is possible if we've overrun the end of the old file.
+          return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength);
+        }
+      }
+    }
+
+    // Before returning, trim any unmodified context lines off the end of patchedLines and reduce
+    // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region
+    // that starts in this hunk's trailing context.
+    patchedLinesLength -= nConsecutiveOldContextLines;
+    toPos -= nConsecutiveOldContextLines;
+    patchedLines.length = patchedLinesLength;
+    return {
+      patchedLines: patchedLines,
+      oldLineLastI: toPos - 1
+    };
+  }
+  var resultLines = [];
+
+  // Search best fit offsets for each hunk based on the previous ones
+  var prevHunkOffset = 0;
+  for (var _i = 0; _i < hunks.length; _i++) {
+    var hunk = hunks[_i];
+    var hunkResult = void 0;
+    var maxLine = lines.length - hunk.oldLines + fuzzFactor;
+    var toPos = void 0;
+    for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) {
+      toPos = hunk.oldStart + prevHunkOffset - 1;
+      var iterator = distanceIterator(toPos, minLine, maxLine);
+      for (; toPos !== undefined; toPos = iterator()) {
+        hunkResult = applyHunk(hunk.lines, toPos, maxErrors);
+        if (hunkResult) {
+          break;
+        }
+      }
+      if (hunkResult) {
+        break;
+      }
+    }
+    if (!hunkResult) {
+      return false;
+    }
+
+    // Copy everything from the end of where we applied the last hunk to the start of this hunk
+    for (var _i2 = minLine; _i2 < toPos; _i2++) {
+      resultLines.push(lines[_i2]);
+    }
+
+    // Add the lines produced by applying the hunk:
+    for (var _i3 = 0; _i3 < hunkResult.patchedLines.length; _i3++) {
+      var _line = hunkResult.patchedLines[_i3];
+      resultLines.push(_line);
+    }
+
+    // Set lower text limit to end of the current hunk, so next ones don't try
+    // to fit over already patched text
+    minLine = hunkResult.oldLineLastI + 1;
+
+    // Note the offset between where the patch said the hunk should've applied and where we
+    // applied it, so we can adjust future hunks accordingly:
+    prevHunkOffset = toPos + 1 - hunk.oldStart;
+  }
+
+  // Copy over the rest of the lines from the old text
+  for (var _i4 = minLine; _i4 < lines.length; _i4++) {
+    resultLines.push(lines[_i4]);
+  }
+  return resultLines.join('\n');
+}
+
+// Wrapper that supports multiple file patches via callbacks.
+function applyPatches(uniDiff, options) {
+  if (typeof uniDiff === 'string') {
+    uniDiff = parsePatch(uniDiff);
+  }
+  var currentIndex = 0;
+  function processIndex() {
+    var index = uniDiff[currentIndex++];
+    if (!index) {
+      return options.complete();
+    }
+    options.loadFile(index, function (err, data) {
+      if (err) {
+        return options.complete(err);
+      }
+      var updatedContent = applyPatch(data, index, options);
+      options.patched(index, updatedContent, function (err) {
+        if (err) {
+          return options.complete(err);
+        }
+        processIndex();
+      });
+    });
+  }
+  processIndex();
+}
+
+function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+  if (!options) {
+    options = {};
+  }
+  if (typeof options === 'function') {
+    options = {
+      callback: options
+    };
+  }
+  if (typeof options.context === 'undefined') {
+    options.context = 4;
+  }
+  if (options.newlineIsToken) {
+    throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions');
+  }
+  if (!options.callback) {
+    return diffLinesResultToPatch(diffLines(oldStr, newStr, options));
+  } else {
+    var _options = options,
+      _callback = _options.callback;
+    diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options), {}, {
+      callback: function callback(diff) {
+        var patch = diffLinesResultToPatch(diff);
+        _callback(patch);
+      }
+    }));
+  }
+  function diffLinesResultToPatch(diff) {
+    // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays
+    //         of lines containing trailing newline characters. We'll tidy up later...
+
+    if (!diff) {
+      return;
+    }
+    diff.push({
+      value: '',
+      lines: []
+    }); // Append an empty value to make cleanup easier
+
+    function contextLines(lines) {
+      return lines.map(function (entry) {
+        return ' ' + entry;
+      });
+    }
+    var hunks = [];
+    var oldRangeStart = 0,
+      newRangeStart = 0,
+      curRange = [],
+      oldLine = 1,
+      newLine = 1;
+    var _loop = function _loop() {
+      var current = diff[i],
+        lines = current.lines || splitLines(current.value);
+      current.lines = lines;
+      if (current.added || current.removed) {
+        var _curRange;
+        // If we have previous context, start with that
+        if (!oldRangeStart) {
+          var prev = diff[i - 1];
+          oldRangeStart = oldLine;
+          newRangeStart = newLine;
+          if (prev) {
+            curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
+            oldRangeStart -= curRange.length;
+            newRangeStart -= curRange.length;
+          }
+        }
+
+        // Output our changes
+        (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) {
+          return (current.added ? '+' : '-') + entry;
+        })));
+
+        // Track the updated file position
+        if (current.added) {
+          newLine += lines.length;
+        } else {
+          oldLine += lines.length;
+        }
+      } else {
+        // Identical context lines. Track line changes
+        if (oldRangeStart) {
+          // Close out any changes that have been output (or join overlapping)
+          if (lines.length <= options.context * 2 && i < diff.length - 2) {
+            var _curRange2;
+            // Overlapping
+            (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
+          } else {
+            var _curRange3;
+            // end the range and output
+            var contextSize = Math.min(lines.length, options.context);
+            (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
+            var _hunk = {
+              oldStart: oldRangeStart,
+              oldLines: oldLine - oldRangeStart + contextSize,
+              newStart: newRangeStart,
+              newLines: newLine - newRangeStart + contextSize,
+              lines: curRange
+            };
+            hunks.push(_hunk);
+            oldRangeStart = 0;
+            newRangeStart = 0;
+            curRange = [];
+          }
+        }
+        oldLine += lines.length;
+        newLine += lines.length;
+      }
+    };
+    for (var i = 0; i < diff.length; i++) {
+      _loop();
+    }
+
+    // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add
+    //         "\ No newline at end of file".
+    for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) {
+      var hunk = _hunks[_i];
+      for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) {
+        if (hunk.lines[_i2].endsWith('\n')) {
+          hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1);
+        } else {
+          hunk.lines.splice(_i2 + 1, 0, '\\ No newline at end of file');
+          _i2++; // Skip the line we just added, then continue iterating
+        }
+      }
+    }
+    return {
+      oldFileName: oldFileName,
+      newFileName: newFileName,
+      oldHeader: oldHeader,
+      newHeader: newHeader,
+      hunks: hunks
+    };
+  }
+}
+function formatPatch(diff) {
+  if (Array.isArray(diff)) {
+    return diff.map(formatPatch).join('\n');
+  }
+  var ret = [];
+  if (diff.oldFileName == diff.newFileName) {
+    ret.push('Index: ' + diff.oldFileName);
+  }
+  ret.push('===================================================================');
+  ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
+  ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
+  for (var i = 0; i < diff.hunks.length; i++) {
+    var hunk = diff.hunks[i];
+    // Unified Diff Format quirk: If the chunk size is 0,
+    // the first number is one lower than one would expect.
+    // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+    if (hunk.oldLines === 0) {
+      hunk.oldStart -= 1;
+    }
+    if (hunk.newLines === 0) {
+      hunk.newStart -= 1;
+    }
+    ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
+    ret.push.apply(ret, hunk.lines);
+  }
+  return ret.join('\n') + '\n';
+}
+function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+  var _options2;
+  if (typeof options === 'function') {
+    options = {
+      callback: options
+    };
+  }
+  if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.callback)) {
+    var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
+    if (!patchObj) {
+      return;
+    }
+    return formatPatch(patchObj);
+  } else {
+    var _options3 = options,
+      _callback2 = _options3.callback;
+    structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options), {}, {
+      callback: function callback(patchObj) {
+        if (!patchObj) {
+          _callback2();
+        } else {
+          _callback2(formatPatch(patchObj));
+        }
+      }
+    }));
+  }
+}
+function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
+  return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
+}
+
+/**
+ * Split `text` into an array of lines, including the trailing newline character (where present)
+ */
+function splitLines(text) {
+  var hasTrailingNl = text.endsWith('\n');
+  var result = text.split('\n').map(function (line) {
+    return line + '\n';
+  });
+  if (hasTrailingNl) {
+    result.pop();
+  } else {
+    result.push(result.pop().slice(0, -1));
+  }
+  return result;
+}
+
+function arrayEqual(a, b) {
+  if (a.length !== b.length) {
+    return false;
+  }
+  return arrayStartsWith(a, b);
+}
+function arrayStartsWith(array, start) {
+  if (start.length > array.length) {
+    return false;
+  }
+  for (var i = 0; i < start.length; i++) {
+    if (start[i] !== array[i]) {
+      return false;
+    }
+  }
+  return true;
+}
+
+function calcLineCount(hunk) {
+  var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines),
+    oldLines = _calcOldNewLineCount.oldLines,
+    newLines = _calcOldNewLineCount.newLines;
+  if (oldLines !== undefined) {
+    hunk.oldLines = oldLines;
+  } else {
+    delete hunk.oldLines;
+  }
+  if (newLines !== undefined) {
+    hunk.newLines = newLines;
+  } else {
+    delete hunk.newLines;
+  }
+}
+function merge(mine, theirs, base) {
+  mine = loadPatch(mine, base);
+  theirs = loadPatch(theirs, base);
+  var ret = {};
+
+  // For index we just let it pass through as it doesn't have any necessary meaning.
+  // Leaving sanity checks on this to the API consumer that may know more about the
+  // meaning in their own context.
+  if (mine.index || theirs.index) {
+    ret.index = mine.index || theirs.index;
+  }
+  if (mine.newFileName || theirs.newFileName) {
+    if (!fileNameChanged(mine)) {
+      // No header or no change in ours, use theirs (and ours if theirs does not exist)
+      ret.oldFileName = theirs.oldFileName || mine.oldFileName;
+      ret.newFileName = theirs.newFileName || mine.newFileName;
+      ret.oldHeader = theirs.oldHeader || mine.oldHeader;
+      ret.newHeader = theirs.newHeader || mine.newHeader;
+    } else if (!fileNameChanged(theirs)) {
+      // No header or no change in theirs, use ours
+      ret.oldFileName = mine.oldFileName;
+      ret.newFileName = mine.newFileName;
+      ret.oldHeader = mine.oldHeader;
+      ret.newHeader = mine.newHeader;
+    } else {
+      // Both changed... figure it out
+      ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
+      ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
+      ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
+      ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
+    }
+  }
+  ret.hunks = [];
+  var mineIndex = 0,
+    theirsIndex = 0,
+    mineOffset = 0,
+    theirsOffset = 0;
+  while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
+    var mineCurrent = mine.hunks[mineIndex] || {
+        oldStart: Infinity
+      },
+      theirsCurrent = theirs.hunks[theirsIndex] || {
+        oldStart: Infinity
+      };
+    if (hunkBefore(mineCurrent, theirsCurrent)) {
+      // This patch does not overlap with any of the others, yay.
+      ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
+      mineIndex++;
+      theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
+    } else if (hunkBefore(theirsCurrent, mineCurrent)) {
+      // This patch does not overlap with any of the others, yay.
+      ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
+      theirsIndex++;
+      mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
+    } else {
+      // Overlap, merge as best we can
+      var mergedHunk = {
+        oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
+        oldLines: 0,
+        newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
+        newLines: 0,
+        lines: []
+      };
+      mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
+      theirsIndex++;
+      mineIndex++;
+      ret.hunks.push(mergedHunk);
+    }
+  }
+  return ret;
+}
+function loadPatch(param, base) {
+  if (typeof param === 'string') {
+    if (/^@@/m.test(param) || /^Index:/m.test(param)) {
+      return parsePatch(param)[0];
+    }
+    if (!base) {
+      throw new Error('Must provide a base reference or pass in a patch');
+    }
+    return structuredPatch(undefined, undefined, base, param);
+  }
+  return param;
+}
+function fileNameChanged(patch) {
+  return patch.newFileName && patch.newFileName !== patch.oldFileName;
+}
+function selectField(index, mine, theirs) {
+  if (mine === theirs) {
+    return mine;
+  } else {
+    index.conflict = true;
+    return {
+      mine: mine,
+      theirs: theirs
+    };
+  }
+}
+function hunkBefore(test, check) {
+  return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
+}
+function cloneHunk(hunk, offset) {
+  return {
+    oldStart: hunk.oldStart,
+    oldLines: hunk.oldLines,
+    newStart: hunk.newStart + offset,
+    newLines: hunk.newLines,
+    lines: hunk.lines
+  };
+}
+function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
+  // This will generally result in a conflicted hunk, but there are cases where the context
+  // is the only overlap where we can successfully merge the content here.
+  var mine = {
+      offset: mineOffset,
+      lines: mineLines,
+      index: 0
+    },
+    their = {
+      offset: theirOffset,
+      lines: theirLines,
+      index: 0
+    };
+
+  // Handle any leading content
+  insertLeading(hunk, mine, their);
+  insertLeading(hunk, their, mine);
+
+  // Now in the overlap content. Scan through and select the best changes from each.
+  while (mine.index < mine.lines.length && their.index < their.lines.length) {
+    var mineCurrent = mine.lines[mine.index],
+      theirCurrent = their.lines[their.index];
+    if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
+      // Both modified ...
+      mutualChange(hunk, mine, their);
+    } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
+      var _hunk$lines;
+      // Mine inserted
+      (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine)));
+    } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
+      var _hunk$lines2;
+      // Theirs inserted
+      (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their)));
+    } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
+      // Mine removed or edited
+      removal(hunk, mine, their);
+    } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
+      // Their removed or edited
+      removal(hunk, their, mine, true);
+    } else if (mineCurrent === theirCurrent) {
+      // Context identity
+      hunk.lines.push(mineCurrent);
+      mine.index++;
+      their.index++;
+    } else {
+      // Context mismatch
+      conflict(hunk, collectChange(mine), collectChange(their));
+    }
+  }
+
+  // Now push anything that may be remaining
+  insertTrailing(hunk, mine);
+  insertTrailing(hunk, their);
+  calcLineCount(hunk);
+}
+function mutualChange(hunk, mine, their) {
+  var myChanges = collectChange(mine),
+    theirChanges = collectChange(their);
+  if (allRemoves(myChanges) && allRemoves(theirChanges)) {
+    // Special case for remove changes that are supersets of one another
+    if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
+      var _hunk$lines3;
+      (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges));
+      return;
+    } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
+      var _hunk$lines4;
+      (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges));
+      return;
+    }
+  } else if (arrayEqual(myChanges, theirChanges)) {
+    var _hunk$lines5;
+    (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges));
+    return;
+  }
+  conflict(hunk, myChanges, theirChanges);
+}
+function removal(hunk, mine, their, swap) {
+  var myChanges = collectChange(mine),
+    theirChanges = collectContext(their, myChanges);
+  if (theirChanges.merged) {
+    var _hunk$lines6;
+    (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged));
+  } else {
+    conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
+  }
+}
+function conflict(hunk, mine, their) {
+  hunk.conflict = true;
+  hunk.lines.push({
+    conflict: true,
+    mine: mine,
+    theirs: their
+  });
+}
+function insertLeading(hunk, insert, their) {
+  while (insert.offset < their.offset && insert.index < insert.lines.length) {
+    var line = insert.lines[insert.index++];
+    hunk.lines.push(line);
+    insert.offset++;
+  }
+}
+function insertTrailing(hunk, insert) {
+  while (insert.index < insert.lines.length) {
+    var line = insert.lines[insert.index++];
+    hunk.lines.push(line);
+  }
+}
+function collectChange(state) {
+  var ret = [],
+    operation = state.lines[state.index][0];
+  while (state.index < state.lines.length) {
+    var line = state.lines[state.index];
+
+    // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
+    if (operation === '-' && line[0] === '+') {
+      operation = '+';
+    }
+    if (operation === line[0]) {
+      ret.push(line);
+      state.index++;
+    } else {
+      break;
+    }
+  }
+  return ret;
+}
+function collectContext(state, matchChanges) {
+  var changes = [],
+    merged = [],
+    matchIndex = 0,
+    contextChanges = false,
+    conflicted = false;
+  while (matchIndex < matchChanges.length && state.index < state.lines.length) {
+    var change = state.lines[state.index],
+      match = matchChanges[matchIndex];
+
+    // Once we've hit our add, then we are done
+    if (match[0] === '+') {
+      break;
+    }
+    contextChanges = contextChanges || change[0] !== ' ';
+    merged.push(match);
+    matchIndex++;
+
+    // Consume any additions in the other block as a conflict to attempt
+    // to pull in the remaining context after this
+    if (change[0] === '+') {
+      conflicted = true;
+      while (change[0] === '+') {
+        changes.push(change);
+        change = state.lines[++state.index];
+      }
+    }
+    if (match.substr(1) === change.substr(1)) {
+      changes.push(change);
+      state.index++;
+    } else {
+      conflicted = true;
+    }
+  }
+  if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
+    conflicted = true;
+  }
+  if (conflicted) {
+    return changes;
+  }
+  while (matchIndex < matchChanges.length) {
+    merged.push(matchChanges[matchIndex++]);
+  }
+  return {
+    merged: merged,
+    changes: changes
+  };
+}
+function allRemoves(changes) {
+  return changes.reduce(function (prev, change) {
+    return prev && change[0] === '-';
+  }, true);
+}
+function skipRemoveSuperset(state, removeChanges, delta) {
+  for (var i = 0; i < delta; i++) {
+    var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
+    if (state.lines[state.index + i] !== ' ' + changeContent) {
+      return false;
+    }
+  }
+  state.index += delta;
+  return true;
+}
+function calcOldNewLineCount(lines) {
+  var oldLines = 0;
+  var newLines = 0;
+  lines.forEach(function (line) {
+    if (typeof line !== 'string') {
+      var myCount = calcOldNewLineCount(line.mine);
+      var theirCount = calcOldNewLineCount(line.theirs);
+      if (oldLines !== undefined) {
+        if (myCount.oldLines === theirCount.oldLines) {
+          oldLines += myCount.oldLines;
+        } else {
+          oldLines = undefined;
+        }
+      }
+      if (newLines !== undefined) {
+        if (myCount.newLines === theirCount.newLines) {
+          newLines += myCount.newLines;
+        } else {
+          newLines = undefined;
+        }
+      }
+    } else {
+      if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
+        newLines++;
+      }
+      if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
+        oldLines++;
+      }
+    }
+  });
+  return {
+    oldLines: oldLines,
+    newLines: newLines
+  };
+}
+
+function reversePatch(structuredPatch) {
+  if (Array.isArray(structuredPatch)) {
+    return structuredPatch.map(reversePatch).reverse();
+  }
+  return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {
+    oldFileName: structuredPatch.newFileName,
+    oldHeader: structuredPatch.newHeader,
+    newFileName: structuredPatch.oldFileName,
+    newHeader: structuredPatch.oldHeader,
+    hunks: structuredPatch.hunks.map(function (hunk) {
+      return {
+        oldLines: hunk.newLines,
+        oldStart: hunk.newStart,
+        newLines: hunk.oldLines,
+        newStart: hunk.oldStart,
+        lines: hunk.lines.map(function (l) {
+          if (l.startsWith('-')) {
+            return "+".concat(l.slice(1));
+          }
+          if (l.startsWith('+')) {
+            return "-".concat(l.slice(1));
+          }
+          return l;
+        })
+      };
+    })
+  });
+}
+
+// See: http://code.google.com/p/google-diff-match-patch/wiki/API
+function convertChangesToDMP(changes) {
+  var ret = [],
+    change,
+    operation;
+  for (var i = 0; i < changes.length; i++) {
+    change = changes[i];
+    if (change.added) {
+      operation = 1;
+    } else if (change.removed) {
+      operation = -1;
+    } else {
+      operation = 0;
+    }
+    ret.push([operation, change.value]);
+  }
+  return ret;
+}
+
+function convertChangesToXML(changes) {
+  var ret = [];
+  for (var i = 0; i < changes.length; i++) {
+    var change = changes[i];
+    if (change.added) {
+      ret.push('');
+    } else if (change.removed) {
+      ret.push('');
+    }
+    ret.push(escapeHTML(change.value));
+    if (change.added) {
+      ret.push('');
+    } else if (change.removed) {
+      ret.push('');
+    }
+  }
+  return ret.join('');
+}
+function escapeHTML(s) {
+  var n = s;
+  n = n.replace(/&/g, '&');
+  n = n.replace(//g, '>');
+  n = n.replace(/"/g, '"');
+  return n;
+}
+
+export { Diff, applyPatch, applyPatches, canonicalize, convertChangesToDMP, convertChangesToXML, createPatch, createTwoFilesPatch, diffArrays, diffChars, diffCss, diffJson, diffLines, diffSentences, diffTrimmedLines, diffWords, diffWordsWithSpace, formatPatch, merge, parsePatch, reversePatch, structuredPatch };
diff --git a/node_modules/diff/lib/index.js b/node_modules/diff/lib/index.js
new file mode 100644
index 0000000..518b3de
--- /dev/null
+++ b/node_modules/diff/lib/index.js
@@ -0,0 +1,217 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+Object.defineProperty(exports, "Diff", {
+  enumerable: true,
+  get: function get() {
+    return _base["default"];
+  }
+});
+Object.defineProperty(exports, "applyPatch", {
+  enumerable: true,
+  get: function get() {
+    return _apply.applyPatch;
+  }
+});
+Object.defineProperty(exports, "applyPatches", {
+  enumerable: true,
+  get: function get() {
+    return _apply.applyPatches;
+  }
+});
+Object.defineProperty(exports, "canonicalize", {
+  enumerable: true,
+  get: function get() {
+    return _json.canonicalize;
+  }
+});
+Object.defineProperty(exports, "convertChangesToDMP", {
+  enumerable: true,
+  get: function get() {
+    return _dmp.convertChangesToDMP;
+  }
+});
+Object.defineProperty(exports, "convertChangesToXML", {
+  enumerable: true,
+  get: function get() {
+    return _xml.convertChangesToXML;
+  }
+});
+Object.defineProperty(exports, "createPatch", {
+  enumerable: true,
+  get: function get() {
+    return _create.createPatch;
+  }
+});
+Object.defineProperty(exports, "createTwoFilesPatch", {
+  enumerable: true,
+  get: function get() {
+    return _create.createTwoFilesPatch;
+  }
+});
+Object.defineProperty(exports, "diffArrays", {
+  enumerable: true,
+  get: function get() {
+    return _array.diffArrays;
+  }
+});
+Object.defineProperty(exports, "diffChars", {
+  enumerable: true,
+  get: function get() {
+    return _character.diffChars;
+  }
+});
+Object.defineProperty(exports, "diffCss", {
+  enumerable: true,
+  get: function get() {
+    return _css.diffCss;
+  }
+});
+Object.defineProperty(exports, "diffJson", {
+  enumerable: true,
+  get: function get() {
+    return _json.diffJson;
+  }
+});
+Object.defineProperty(exports, "diffLines", {
+  enumerable: true,
+  get: function get() {
+    return _line.diffLines;
+  }
+});
+Object.defineProperty(exports, "diffSentences", {
+  enumerable: true,
+  get: function get() {
+    return _sentence.diffSentences;
+  }
+});
+Object.defineProperty(exports, "diffTrimmedLines", {
+  enumerable: true,
+  get: function get() {
+    return _line.diffTrimmedLines;
+  }
+});
+Object.defineProperty(exports, "diffWords", {
+  enumerable: true,
+  get: function get() {
+    return _word.diffWords;
+  }
+});
+Object.defineProperty(exports, "diffWordsWithSpace", {
+  enumerable: true,
+  get: function get() {
+    return _word.diffWordsWithSpace;
+  }
+});
+Object.defineProperty(exports, "formatPatch", {
+  enumerable: true,
+  get: function get() {
+    return _create.formatPatch;
+  }
+});
+Object.defineProperty(exports, "merge", {
+  enumerable: true,
+  get: function get() {
+    return _merge.merge;
+  }
+});
+Object.defineProperty(exports, "parsePatch", {
+  enumerable: true,
+  get: function get() {
+    return _parse.parsePatch;
+  }
+});
+Object.defineProperty(exports, "reversePatch", {
+  enumerable: true,
+  get: function get() {
+    return _reverse.reversePatch;
+  }
+});
+Object.defineProperty(exports, "structuredPatch", {
+  enumerable: true,
+  get: function get() {
+    return _create.structuredPatch;
+  }
+});
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(require("./diff/base"))
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_character = require("./diff/character")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_word = require("./diff/word")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_line = require("./diff/line")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_sentence = require("./diff/sentence")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_css = require("./diff/css")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_json = require("./diff/json")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_array = require("./diff/array")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_apply = require("./patch/apply")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_parse = require("./patch/parse")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_merge = require("./patch/merge")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_reverse = require("./patch/reverse")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_create = require("./patch/create")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_dmp = require("./convert/dmp")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_xml = require("./convert/xml")
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfYmFzZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwiX2NoYXJhY3RlciIsIl93b3JkIiwiX2xpbmUiLCJfc2VudGVuY2UiLCJfY3NzIiwiX2pzb24iLCJfYXJyYXkiLCJfYXBwbHkiLCJfcGFyc2UiLCJfbWVyZ2UiLCJfcmV2ZXJzZSIsIl9jcmVhdGUiLCJfZG1wIiwiX3htbCIsIm9iaiIsIl9fZXNNb2R1bGUiXSwic291cmNlcyI6WyIuLi9zcmMvaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogU2VlIExJQ0VOU0UgZmlsZSBmb3IgdGVybXMgb2YgdXNlICovXG5cbi8qXG4gKiBUZXh0IGRpZmYgaW1wbGVtZW50YXRpb24uXG4gKlxuICogVGhpcyBsaWJyYXJ5IHN1cHBvcnRzIHRoZSBmb2xsb3dpbmcgQVBJczpcbiAqIERpZmYuZGlmZkNoYXJzOiBDaGFyYWN0ZXIgYnkgY2hhcmFjdGVyIGRpZmZcbiAqIERpZmYuZGlmZldvcmRzOiBXb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UJBQUFnQixHQUFBLFdBQUFBLEdBQUEsSUFBQUEsR0FBQSxDQUFBQyxVQUFBLEdBQUFELEdBQUEsZ0JBQUFBLEdBQUE7QUFBQSIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/index.mjs b/node_modules/diff/lib/index.mjs
new file mode 100644
index 0000000..6e87272
--- /dev/null
+++ b/node_modules/diff/lib/index.mjs
@@ -0,0 +1,2041 @@
+function Diff() {}
+Diff.prototype = {
+  diff: function diff(oldString, newString) {
+    var _options$timeout;
+    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+    var callback = options.callback;
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+    var self = this;
+    function done(value) {
+      value = self.postProcess(value, options);
+      if (callback) {
+        setTimeout(function () {
+          callback(value);
+        }, 0);
+        return true;
+      } else {
+        return value;
+      }
+    }
+
+    // Allow subclasses to massage the input prior to running
+    oldString = this.castInput(oldString, options);
+    newString = this.castInput(newString, options);
+    oldString = this.removeEmpty(this.tokenize(oldString, options));
+    newString = this.removeEmpty(this.tokenize(newString, options));
+    var newLen = newString.length,
+      oldLen = oldString.length;
+    var editLength = 1;
+    var maxEditLength = newLen + oldLen;
+    if (options.maxEditLength != null) {
+      maxEditLength = Math.min(maxEditLength, options.maxEditLength);
+    }
+    var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
+    var abortAfterTimestamp = Date.now() + maxExecutionTime;
+    var bestPath = [{
+      oldPos: -1,
+      lastComponent: undefined
+    }];
+
+    // Seed editLength = 0, i.e. the content starts with the same values
+    var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options);
+    if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+      // Identity per the equality and tokenizer
+      return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken));
+    }
+
+    // Once we hit the right edge of the edit graph on some diagonal k, we can
+    // definitely reach the end of the edit graph in no more than k edits, so
+    // there's no point in considering any moves to diagonal k+1 any more (from
+    // which we're guaranteed to need at least k+1 more edits).
+    // Similarly, once we've reached the bottom of the edit graph, there's no
+    // point considering moves to lower diagonals.
+    // We record this fact by setting minDiagonalToConsider and
+    // maxDiagonalToConsider to some finite value once we've hit the edge of
+    // the edit graph.
+    // This optimization is not faithful to the original algorithm presented in
+    // Myers's paper, which instead pointlessly extends D-paths off the end of
+    // the edit graph - see page 7 of Myers's paper which notes this point
+    // explicitly and illustrates it with a diagram. This has major performance
+    // implications for some common scenarios. For instance, to compute a diff
+    // where the new text simply appends d characters on the end of the
+    // original text of length n, the true Myers algorithm will take O(n+d^2)
+    // time while this optimization needs only O(n+d) time.
+    var minDiagonalToConsider = -Infinity,
+      maxDiagonalToConsider = Infinity;
+
+    // Main worker method. checks all permutations of a given edit length for acceptance.
+    function execEditLength() {
+      for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
+        var basePath = void 0;
+        var removePath = bestPath[diagonalPath - 1],
+          addPath = bestPath[diagonalPath + 1];
+        if (removePath) {
+          // No one else is going to attempt to use this value, clear it
+          bestPath[diagonalPath - 1] = undefined;
+        }
+        var canAdd = false;
+        if (addPath) {
+          // what newPos will be after we do an insertion:
+          var addPathNewPos = addPath.oldPos - diagonalPath;
+          canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
+        }
+        var canRemove = removePath && removePath.oldPos + 1 < oldLen;
+        if (!canAdd && !canRemove) {
+          // If this path is a terminal then prune
+          bestPath[diagonalPath] = undefined;
+          continue;
+        }
+
+        // Select the diagonal that we want to branch from. We select the prior
+        // path whose position in the old string is the farthest from the origin
+        // and does not pass the bounds of the diff graph
+        if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
+          basePath = self.addToPath(addPath, true, false, 0, options);
+        } else {
+          basePath = self.addToPath(removePath, false, true, 1, options);
+        }
+        newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options);
+        if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
+          // If we have hit the end of both strings, then we are done
+          return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
+        } else {
+          bestPath[diagonalPath] = basePath;
+          if (basePath.oldPos + 1 >= oldLen) {
+            maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
+          }
+          if (newPos + 1 >= newLen) {
+            minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
+          }
+        }
+      }
+      editLength++;
+    }
+
+    // Performs the length of edit iteration. Is a bit fugly as this has to support the
+    // sync and async mode which is never fun. Loops over execEditLength until a value
+    // is produced, or until the edit length exceeds options.maxEditLength (if given),
+    // in which case it will return undefined.
+    if (callback) {
+      (function exec() {
+        setTimeout(function () {
+          if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
+            return callback();
+          }
+          if (!execEditLength()) {
+            exec();
+          }
+        }, 0);
+      })();
+    } else {
+      while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
+        var ret = execEditLength();
+        if (ret) {
+          return ret;
+        }
+      }
+    }
+  },
+  addToPath: function addToPath(path, added, removed, oldPosInc, options) {
+    var last = path.lastComponent;
+    if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
+      return {
+        oldPos: path.oldPos + oldPosInc,
+        lastComponent: {
+          count: last.count + 1,
+          added: added,
+          removed: removed,
+          previousComponent: last.previousComponent
+        }
+      };
+    } else {
+      return {
+        oldPos: path.oldPos + oldPosInc,
+        lastComponent: {
+          count: 1,
+          added: added,
+          removed: removed,
+          previousComponent: last
+        }
+      };
+    }
+  },
+  extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) {
+    var newLen = newString.length,
+      oldLen = oldString.length,
+      oldPos = basePath.oldPos,
+      newPos = oldPos - diagonalPath,
+      commonCount = 0;
+    while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) {
+      newPos++;
+      oldPos++;
+      commonCount++;
+      if (options.oneChangePerToken) {
+        basePath.lastComponent = {
+          count: 1,
+          previousComponent: basePath.lastComponent,
+          added: false,
+          removed: false
+        };
+      }
+    }
+    if (commonCount && !options.oneChangePerToken) {
+      basePath.lastComponent = {
+        count: commonCount,
+        previousComponent: basePath.lastComponent,
+        added: false,
+        removed: false
+      };
+    }
+    basePath.oldPos = oldPos;
+    return newPos;
+  },
+  equals: function equals(left, right, options) {
+    if (options.comparator) {
+      return options.comparator(left, right);
+    } else {
+      return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase();
+    }
+  },
+  removeEmpty: function removeEmpty(array) {
+    var ret = [];
+    for (var i = 0; i < array.length; i++) {
+      if (array[i]) {
+        ret.push(array[i]);
+      }
+    }
+    return ret;
+  },
+  castInput: function castInput(value) {
+    return value;
+  },
+  tokenize: function tokenize(value) {
+    return Array.from(value);
+  },
+  join: function join(chars) {
+    return chars.join('');
+  },
+  postProcess: function postProcess(changeObjects) {
+    return changeObjects;
+  }
+};
+function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
+  // First we convert our linked list of components in reverse order to an
+  // array in the right order:
+  var components = [];
+  var nextComponent;
+  while (lastComponent) {
+    components.push(lastComponent);
+    nextComponent = lastComponent.previousComponent;
+    delete lastComponent.previousComponent;
+    lastComponent = nextComponent;
+  }
+  components.reverse();
+  var componentPos = 0,
+    componentLen = components.length,
+    newPos = 0,
+    oldPos = 0;
+  for (; componentPos < componentLen; componentPos++) {
+    var component = components[componentPos];
+    if (!component.removed) {
+      if (!component.added && useLongestToken) {
+        var value = newString.slice(newPos, newPos + component.count);
+        value = value.map(function (value, i) {
+          var oldValue = oldString[oldPos + i];
+          return oldValue.length > value.length ? oldValue : value;
+        });
+        component.value = diff.join(value);
+      } else {
+        component.value = diff.join(newString.slice(newPos, newPos + component.count));
+      }
+      newPos += component.count;
+
+      // Common case
+      if (!component.added) {
+        oldPos += component.count;
+      }
+    } else {
+      component.value = diff.join(oldString.slice(oldPos, oldPos + component.count));
+      oldPos += component.count;
+    }
+  }
+  return components;
+}
+
+var characterDiff = new Diff();
+function diffChars(oldStr, newStr, options) {
+  return characterDiff.diff(oldStr, newStr, options);
+}
+
+function longestCommonPrefix(str1, str2) {
+  var i;
+  for (i = 0; i < str1.length && i < str2.length; i++) {
+    if (str1[i] != str2[i]) {
+      return str1.slice(0, i);
+    }
+  }
+  return str1.slice(0, i);
+}
+function longestCommonSuffix(str1, str2) {
+  var i;
+
+  // Unlike longestCommonPrefix, we need a special case to handle all scenarios
+  // where we return the empty string since str1.slice(-0) will return the
+  // entire string.
+  if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
+    return '';
+  }
+  for (i = 0; i < str1.length && i < str2.length; i++) {
+    if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
+      return str1.slice(-i);
+    }
+  }
+  return str1.slice(-i);
+}
+function replacePrefix(string, oldPrefix, newPrefix) {
+  if (string.slice(0, oldPrefix.length) != oldPrefix) {
+    throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug"));
+  }
+  return newPrefix + string.slice(oldPrefix.length);
+}
+function replaceSuffix(string, oldSuffix, newSuffix) {
+  if (!oldSuffix) {
+    return string + newSuffix;
+  }
+  if (string.slice(-oldSuffix.length) != oldSuffix) {
+    throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug"));
+  }
+  return string.slice(0, -oldSuffix.length) + newSuffix;
+}
+function removePrefix(string, oldPrefix) {
+  return replacePrefix(string, oldPrefix, '');
+}
+function removeSuffix(string, oldSuffix) {
+  return replaceSuffix(string, oldSuffix, '');
+}
+function maximumOverlap(string1, string2) {
+  return string2.slice(0, overlapCount(string1, string2));
+}
+
+// Nicked from https://stackoverflow.com/a/60422853/1709587
+function overlapCount(a, b) {
+  // Deal with cases where the strings differ in length
+  var startA = 0;
+  if (a.length > b.length) {
+    startA = a.length - b.length;
+  }
+  var endB = b.length;
+  if (a.length < b.length) {
+    endB = a.length;
+  }
+  // Create a back-reference for each index
+  //   that should be followed in case of a mismatch.
+  //   We only need B to make these references:
+  var map = Array(endB);
+  var k = 0; // Index that lags behind j
+  map[0] = 0;
+  for (var j = 1; j < endB; j++) {
+    if (b[j] == b[k]) {
+      map[j] = map[k]; // skip over the same character (optional optimisation)
+    } else {
+      map[j] = k;
+    }
+    while (k > 0 && b[j] != b[k]) {
+      k = map[k];
+    }
+    if (b[j] == b[k]) {
+      k++;
+    }
+  }
+  // Phase 2: use these references while iterating over A
+  k = 0;
+  for (var i = startA; i < a.length; i++) {
+    while (k > 0 && a[i] != b[k]) {
+      k = map[k];
+    }
+    if (a[i] == b[k]) {
+      k++;
+    }
+  }
+  return k;
+}
+
+/**
+ * Returns true if the string consistently uses Windows line endings.
+ */
+function hasOnlyWinLineEndings(string) {
+  return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/);
+}
+
+/**
+ * Returns true if the string consistently uses Unix line endings.
+ */
+function hasOnlyUnixLineEndings(string) {
+  return !string.includes('\r\n') && string.includes('\n');
+}
+
+// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
+//
+// Ranges and exceptions:
+// Latin-1 Supplement, 0080–00FF
+//  - U+00D7  × Multiplication sign
+//  - U+00F7  ÷ Division sign
+// Latin Extended-A, 0100–017F
+// Latin Extended-B, 0180–024F
+// IPA Extensions, 0250–02AF
+// Spacing Modifier Letters, 02B0–02FF
+//  - U+02C7  ˇ ˇ  Caron
+//  - U+02D8  ˘ ˘  Breve
+//  - U+02D9  ˙ ˙  Dot Above
+//  - U+02DA  ˚ ˚  Ring Above
+//  - U+02DB  ˛ ˛  Ogonek
+//  - U+02DC  ˜ ˜  Small Tilde
+//  - U+02DD  ˝ ˝  Double Acute Accent
+// Latin Extended Additional, 1E00–1EFF
+var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
+
+// Each token is one of the following:
+// - A punctuation mark plus the surrounding whitespace
+// - A word plus the surrounding whitespace
+// - Pure whitespace (but only in the special case where this the entire text
+//   is just whitespace)
+//
+// We have to include surrounding whitespace in the tokens because the two
+// alternative approaches produce horribly broken results:
+// * If we just discard the whitespace, we can't fully reproduce the original
+//   text from the sequence of tokens and any attempt to render the diff will
+//   get the whitespace wrong.
+// * If we have separate tokens for whitespace, then in a typical text every
+//   second token will be a single space character. But this often results in
+//   the optimal diff between two texts being a perverse one that preserves
+//   the spaces between words but deletes and reinserts actual common words.
+//   See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640
+//   for an example.
+//
+// Keeping the surrounding whitespace of course has implications for .equals
+// and .join, not just .tokenize.
+
+// This regex does NOT fully implement the tokenization rules described above.
+// Instead, it gives runs of whitespace their own "token". The tokenize method
+// then handles stitching whitespace tokens onto adjacent word or punctuation
+// tokens.
+var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), 'ug');
+var wordDiff = new Diff();
+wordDiff.equals = function (left, right, options) {
+  if (options.ignoreCase) {
+    left = left.toLowerCase();
+    right = right.toLowerCase();
+  }
+  return left.trim() === right.trim();
+};
+wordDiff.tokenize = function (value) {
+  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+  var parts;
+  if (options.intlSegmenter) {
+    if (options.intlSegmenter.resolvedOptions().granularity != 'word') {
+      throw new Error('The segmenter passed must have a granularity of "word"');
+    }
+    parts = Array.from(options.intlSegmenter.segment(value), function (segment) {
+      return segment.segment;
+    });
+  } else {
+    parts = value.match(tokenizeIncludingWhitespace) || [];
+  }
+  var tokens = [];
+  var prevPart = null;
+  parts.forEach(function (part) {
+    if (/\s/.test(part)) {
+      if (prevPart == null) {
+        tokens.push(part);
+      } else {
+        tokens.push(tokens.pop() + part);
+      }
+    } else if (/\s/.test(prevPart)) {
+      if (tokens[tokens.length - 1] == prevPart) {
+        tokens.push(tokens.pop() + part);
+      } else {
+        tokens.push(prevPart + part);
+      }
+    } else {
+      tokens.push(part);
+    }
+    prevPart = part;
+  });
+  return tokens;
+};
+wordDiff.join = function (tokens) {
+  // Tokens being joined here will always have appeared consecutively in the
+  // same text, so we can simply strip off the leading whitespace from all the
+  // tokens except the first (and except any whitespace-only tokens - but such
+  // a token will always be the first and only token anyway) and then join them
+  // and the whitespace around words and punctuation will end up correct.
+  return tokens.map(function (token, i) {
+    if (i == 0) {
+      return token;
+    } else {
+      return token.replace(/^\s+/, '');
+    }
+  }).join('');
+};
+wordDiff.postProcess = function (changes, options) {
+  if (!changes || options.oneChangePerToken) {
+    return changes;
+  }
+  var lastKeep = null;
+  // Change objects representing any insertion or deletion since the last
+  // "keep" change object. There can be at most one of each.
+  var insertion = null;
+  var deletion = null;
+  changes.forEach(function (change) {
+    if (change.added) {
+      insertion = change;
+    } else if (change.removed) {
+      deletion = change;
+    } else {
+      if (insertion || deletion) {
+        // May be false at start of text
+        dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
+      }
+      lastKeep = change;
+      insertion = null;
+      deletion = null;
+    }
+  });
+  if (insertion || deletion) {
+    dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
+  }
+  return changes;
+};
+function diffWords(oldStr, newStr, options) {
+  // This option has never been documented and never will be (it's clearer to
+  // just call `diffWordsWithSpace` directly if you need that behavior), but
+  // has existed in jsdiff for a long time, so we retain support for it here
+  // for the sake of backwards compatibility.
+  if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) {
+    return diffWordsWithSpace(oldStr, newStr, options);
+  }
+  return wordDiff.diff(oldStr, newStr, options);
+}
+function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
+  // Before returning, we tidy up the leading and trailing whitespace of the
+  // change objects to eliminate cases where trailing whitespace in one object
+  // is repeated as leading whitespace in the next.
+  // Below are examples of the outcomes we want here to explain the code.
+  // I=insert, K=keep, D=delete
+  // 1. diffing 'foo bar baz' vs 'foo baz'
+  //    Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz'
+  //    After cleanup, we want:   K:'foo ' D:'bar ' K:'baz'
+  //
+  // 2. Diffing 'foo bar baz' vs 'foo qux baz'
+  //    Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz'
+  //    After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz'
+  //
+  // 3. Diffing 'foo\nbar baz' vs 'foo baz'
+  //    Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz'
+  //    After cleanup, we want K'foo' D:'\nbar' K:' baz'
+  //
+  // 4. Diffing 'foo baz' vs 'foo\nbar baz'
+  //    Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz'
+  //    After cleanup, we ideally want K'foo' I:'\nbar' K:' baz'
+  //    but don't actually manage this currently (the pre-cleanup change
+  //    objects don't contain enough information to make it possible).
+  //
+  // 5. Diffing 'foo   bar baz' vs 'foo  baz'
+  //    Prior to cleanup, we have K:'foo  ' D:'   bar ' K:'  baz'
+  //    After cleanup, we want K:'foo  ' D:' bar ' K:'baz'
+  //
+  // Our handling is unavoidably imperfect in the case where there's a single
+  // indel between keeps and the whitespace has changed. For instance, consider
+  // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change
+  // object to represent the insertion of the space character (which isn't even
+  // a token), we have no way to avoid losing information about the texts'
+  // original whitespace in the result we return. Still, we do our best to
+  // output something that will look sensible if we e.g. print it with
+  // insertions in green and deletions in red.
+
+  // Between two "keep" change objects (or before the first or after the last
+  // change object), we can have either:
+  // * A "delete" followed by an "insert"
+  // * Just an "insert"
+  // * Just a "delete"
+  // We handle the three cases separately.
+  if (deletion && insertion) {
+    var oldWsPrefix = deletion.value.match(/^\s*/)[0];
+    var oldWsSuffix = deletion.value.match(/\s*$/)[0];
+    var newWsPrefix = insertion.value.match(/^\s*/)[0];
+    var newWsSuffix = insertion.value.match(/\s*$/)[0];
+    if (startKeep) {
+      var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
+      startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
+      deletion.value = removePrefix(deletion.value, commonWsPrefix);
+      insertion.value = removePrefix(insertion.value, commonWsPrefix);
+    }
+    if (endKeep) {
+      var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
+      endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
+      deletion.value = removeSuffix(deletion.value, commonWsSuffix);
+      insertion.value = removeSuffix(insertion.value, commonWsSuffix);
+    }
+  } else if (insertion) {
+    // The whitespaces all reflect what was in the new text rather than
+    // the old, so we essentially have no information about whitespace
+    // insertion or deletion. We just want to dedupe the whitespace.
+    // We do that by having each change object keep its trailing
+    // whitespace and deleting duplicate leading whitespace where
+    // present.
+    if (startKeep) {
+      insertion.value = insertion.value.replace(/^\s*/, '');
+    }
+    if (endKeep) {
+      endKeep.value = endKeep.value.replace(/^\s*/, '');
+    }
+    // otherwise we've got a deletion and no insertion
+  } else if (startKeep && endKeep) {
+    var newWsFull = endKeep.value.match(/^\s*/)[0],
+      delWsStart = deletion.value.match(/^\s*/)[0],
+      delWsEnd = deletion.value.match(/\s*$/)[0];
+
+    // Any whitespace that comes straight after startKeep in both the old and
+    // new texts, assign to startKeep and remove from the deletion.
+    var newWsStart = longestCommonPrefix(newWsFull, delWsStart);
+    deletion.value = removePrefix(deletion.value, newWsStart);
+
+    // Any whitespace that comes straight before endKeep in both the old and
+    // new texts, and hasn't already been assigned to startKeep, assign to
+    // endKeep and remove from the deletion.
+    var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
+    deletion.value = removeSuffix(deletion.value, newWsEnd);
+    endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
+
+    // If there's any whitespace from the new text that HASN'T already been
+    // assigned, assign it to the start:
+    startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
+  } else if (endKeep) {
+    // We are at the start of the text. Preserve all the whitespace on
+    // endKeep, and just remove whitespace from the end of deletion to the
+    // extent that it overlaps with the start of endKeep.
+    var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0];
+    var deletionWsSuffix = deletion.value.match(/\s*$/)[0];
+    var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
+    deletion.value = removeSuffix(deletion.value, overlap);
+  } else if (startKeep) {
+    // We are at the END of the text. Preserve all the whitespace on
+    // startKeep, and just remove whitespace from the start of deletion to
+    // the extent that it overlaps with the end of startKeep.
+    var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0];
+    var deletionWsPrefix = deletion.value.match(/^\s*/)[0];
+    var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
+    deletion.value = removePrefix(deletion.value, _overlap);
+  }
+}
+var wordWithSpaceDiff = new Diff();
+wordWithSpaceDiff.tokenize = function (value) {
+  // Slightly different to the tokenizeIncludingWhitespace regex used above in
+  // that this one treats each individual newline as a distinct tokens, rather
+  // than merging them into other surrounding whitespace. This was requested
+  // in https://github.com/kpdecker/jsdiff/issues/180 &
+  //    https://github.com/kpdecker/jsdiff/issues/211
+  var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), 'ug');
+  return value.match(regex) || [];
+};
+function diffWordsWithSpace(oldStr, newStr, options) {
+  return wordWithSpaceDiff.diff(oldStr, newStr, options);
+}
+
+function generateOptions(options, defaults) {
+  if (typeof options === 'function') {
+    defaults.callback = options;
+  } else if (options) {
+    for (var name in options) {
+      /* istanbul ignore else */
+      if (options.hasOwnProperty(name)) {
+        defaults[name] = options[name];
+      }
+    }
+  }
+  return defaults;
+}
+
+var lineDiff = new Diff();
+lineDiff.tokenize = function (value, options) {
+  if (options.stripTrailingCr) {
+    // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
+    value = value.replace(/\r\n/g, '\n');
+  }
+  var retLines = [],
+    linesAndNewlines = value.split(/(\n|\r\n)/);
+
+  // Ignore the final empty token that occurs if the string ends with a new line
+  if (!linesAndNewlines[linesAndNewlines.length - 1]) {
+    linesAndNewlines.pop();
+  }
+
+  // Merge the content and line separators into single tokens
+  for (var i = 0; i < linesAndNewlines.length; i++) {
+    var line = linesAndNewlines[i];
+    if (i % 2 && !options.newlineIsToken) {
+      retLines[retLines.length - 1] += line;
+    } else {
+      retLines.push(line);
+    }
+  }
+  return retLines;
+};
+lineDiff.equals = function (left, right, options) {
+  // If we're ignoring whitespace, we need to normalise lines by stripping
+  // whitespace before checking equality. (This has an annoying interaction
+  // with newlineIsToken that requires special handling: if newlines get their
+  // own token, then we DON'T want to trim the *newline* tokens down to empty
+  // strings, since this would cause us to treat whitespace-only line content
+  // as equal to a separator between lines, which would be weird and
+  // inconsistent with the documented behavior of the options.)
+  if (options.ignoreWhitespace) {
+    if (!options.newlineIsToken || !left.includes('\n')) {
+      left = left.trim();
+    }
+    if (!options.newlineIsToken || !right.includes('\n')) {
+      right = right.trim();
+    }
+  } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
+    if (left.endsWith('\n')) {
+      left = left.slice(0, -1);
+    }
+    if (right.endsWith('\n')) {
+      right = right.slice(0, -1);
+    }
+  }
+  return Diff.prototype.equals.call(this, left, right, options);
+};
+function diffLines(oldStr, newStr, callback) {
+  return lineDiff.diff(oldStr, newStr, callback);
+}
+
+// Kept for backwards compatibility. This is a rather arbitrary wrapper method
+// that just calls `diffLines` with `ignoreWhitespace: true`. It's confusing to
+// have two ways to do exactly the same thing in the API, so we no longer
+// document this one (library users should explicitly use `diffLines` with
+// `ignoreWhitespace: true` instead) but we keep it around to maintain
+// compatibility with code that used old versions.
+function diffTrimmedLines(oldStr, newStr, callback) {
+  var options = generateOptions(callback, {
+    ignoreWhitespace: true
+  });
+  return lineDiff.diff(oldStr, newStr, options);
+}
+
+var sentenceDiff = new Diff();
+sentenceDiff.tokenize = function (value) {
+  return value.split(/(\S.+?[.!?])(?=\s+|$)/);
+};
+function diffSentences(oldStr, newStr, callback) {
+  return sentenceDiff.diff(oldStr, newStr, callback);
+}
+
+var cssDiff = new Diff();
+cssDiff.tokenize = function (value) {
+  return value.split(/([{}:;,]|\s+)/);
+};
+function diffCss(oldStr, newStr, callback) {
+  return cssDiff.diff(oldStr, newStr, callback);
+}
+
+function ownKeys(e, r) {
+  var t = Object.keys(e);
+  if (Object.getOwnPropertySymbols) {
+    var o = Object.getOwnPropertySymbols(e);
+    r && (o = o.filter(function (r) {
+      return Object.getOwnPropertyDescriptor(e, r).enumerable;
+    })), t.push.apply(t, o);
+  }
+  return t;
+}
+function _objectSpread2(e) {
+  for (var r = 1; r < arguments.length; r++) {
+    var t = null != arguments[r] ? arguments[r] : {};
+    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
+      _defineProperty(e, r, t[r]);
+    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
+      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
+    });
+  }
+  return e;
+}
+function _toPrimitive(t, r) {
+  if ("object" != typeof t || !t) return t;
+  var e = t[Symbol.toPrimitive];
+  if (void 0 !== e) {
+    var i = e.call(t, r || "default");
+    if ("object" != typeof i) return i;
+    throw new TypeError("@@toPrimitive must return a primitive value.");
+  }
+  return ("string" === r ? String : Number)(t);
+}
+function _toPropertyKey(t) {
+  var i = _toPrimitive(t, "string");
+  return "symbol" == typeof i ? i : i + "";
+}
+function _typeof(o) {
+  "@babel/helpers - typeof";
+
+  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
+    return typeof o;
+  } : function (o) {
+    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
+  }, _typeof(o);
+}
+function _defineProperty(obj, key, value) {
+  key = _toPropertyKey(key);
+  if (key in obj) {
+    Object.defineProperty(obj, key, {
+      value: value,
+      enumerable: true,
+      configurable: true,
+      writable: true
+    });
+  } else {
+    obj[key] = value;
+  }
+  return obj;
+}
+function _toConsumableArray(arr) {
+  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+}
+function _arrayWithoutHoles(arr) {
+  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+}
+function _iterableToArray(iter) {
+  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+}
+function _unsupportedIterableToArray(o, minLen) {
+  if (!o) return;
+  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+  var n = Object.prototype.toString.call(o).slice(8, -1);
+  if (n === "Object" && o.constructor) n = o.constructor.name;
+  if (n === "Map" || n === "Set") return Array.from(o);
+  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+}
+function _arrayLikeToArray(arr, len) {
+  if (len == null || len > arr.length) len = arr.length;
+  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+  return arr2;
+}
+function _nonIterableSpread() {
+  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+}
+
+var jsonDiff = new Diff();
+// Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
+// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
+jsonDiff.useLongestToken = true;
+jsonDiff.tokenize = lineDiff.tokenize;
+jsonDiff.castInput = function (value, options) {
+  var undefinedReplacement = options.undefinedReplacement,
+    _options$stringifyRep = options.stringifyReplacer,
+    stringifyReplacer = _options$stringifyRep === void 0 ? function (k, v) {
+      return typeof v === 'undefined' ? undefinedReplacement : v;
+    } : _options$stringifyRep;
+  return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, '  ');
+};
+jsonDiff.equals = function (left, right, options) {
+  return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options);
+};
+function diffJson(oldObj, newObj, options) {
+  return jsonDiff.diff(oldObj, newObj, options);
+}
+
+// This function handles the presence of circular references by bailing out when encountering an
+// object that is already on the "stack" of items being processed. Accepts an optional replacer
+function canonicalize(obj, stack, replacementStack, replacer, key) {
+  stack = stack || [];
+  replacementStack = replacementStack || [];
+  if (replacer) {
+    obj = replacer(key, obj);
+  }
+  var i;
+  for (i = 0; i < stack.length; i += 1) {
+    if (stack[i] === obj) {
+      return replacementStack[i];
+    }
+  }
+  var canonicalizedObj;
+  if ('[object Array]' === Object.prototype.toString.call(obj)) {
+    stack.push(obj);
+    canonicalizedObj = new Array(obj.length);
+    replacementStack.push(canonicalizedObj);
+    for (i = 0; i < obj.length; i += 1) {
+      canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key);
+    }
+    stack.pop();
+    replacementStack.pop();
+    return canonicalizedObj;
+  }
+  if (obj && obj.toJSON) {
+    obj = obj.toJSON();
+  }
+  if (_typeof(obj) === 'object' && obj !== null) {
+    stack.push(obj);
+    canonicalizedObj = {};
+    replacementStack.push(canonicalizedObj);
+    var sortedKeys = [],
+      _key;
+    for (_key in obj) {
+      /* istanbul ignore else */
+      if (Object.prototype.hasOwnProperty.call(obj, _key)) {
+        sortedKeys.push(_key);
+      }
+    }
+    sortedKeys.sort();
+    for (i = 0; i < sortedKeys.length; i += 1) {
+      _key = sortedKeys[i];
+      canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key);
+    }
+    stack.pop();
+    replacementStack.pop();
+  } else {
+    canonicalizedObj = obj;
+  }
+  return canonicalizedObj;
+}
+
+var arrayDiff = new Diff();
+arrayDiff.tokenize = function (value) {
+  return value.slice();
+};
+arrayDiff.join = arrayDiff.removeEmpty = function (value) {
+  return value;
+};
+function diffArrays(oldArr, newArr, callback) {
+  return arrayDiff.diff(oldArr, newArr, callback);
+}
+
+function unixToWin(patch) {
+  if (Array.isArray(patch)) {
+    return patch.map(unixToWin);
+  }
+  return _objectSpread2(_objectSpread2({}, patch), {}, {
+    hunks: patch.hunks.map(function (hunk) {
+      return _objectSpread2(_objectSpread2({}, hunk), {}, {
+        lines: hunk.lines.map(function (line, i) {
+          var _hunk$lines;
+          return line.startsWith('\\') || line.endsWith('\r') || (_hunk$lines = hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 && _hunk$lines.startsWith('\\') ? line : line + '\r';
+        })
+      });
+    })
+  });
+}
+function winToUnix(patch) {
+  if (Array.isArray(patch)) {
+    return patch.map(winToUnix);
+  }
+  return _objectSpread2(_objectSpread2({}, patch), {}, {
+    hunks: patch.hunks.map(function (hunk) {
+      return _objectSpread2(_objectSpread2({}, hunk), {}, {
+        lines: hunk.lines.map(function (line) {
+          return line.endsWith('\r') ? line.substring(0, line.length - 1) : line;
+        })
+      });
+    })
+  });
+}
+
+/**
+ * Returns true if the patch consistently uses Unix line endings (or only involves one line and has
+ * no line endings).
+ */
+function isUnix(patch) {
+  if (!Array.isArray(patch)) {
+    patch = [patch];
+  }
+  return !patch.some(function (index) {
+    return index.hunks.some(function (hunk) {
+      return hunk.lines.some(function (line) {
+        return !line.startsWith('\\') && line.endsWith('\r');
+      });
+    });
+  });
+}
+
+/**
+ * Returns true if the patch uses Windows line endings and only Windows line endings.
+ */
+function isWin(patch) {
+  if (!Array.isArray(patch)) {
+    patch = [patch];
+  }
+  return patch.some(function (index) {
+    return index.hunks.some(function (hunk) {
+      return hunk.lines.some(function (line) {
+        return line.endsWith('\r');
+      });
+    });
+  }) && patch.every(function (index) {
+    return index.hunks.every(function (hunk) {
+      return hunk.lines.every(function (line, i) {
+        var _hunk$lines2;
+        return line.startsWith('\\') || line.endsWith('\r') || ((_hunk$lines2 = hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 : _hunk$lines2.startsWith('\\'));
+      });
+    });
+  });
+}
+
+function parsePatch(uniDiff) {
+  var diffstr = uniDiff.split(/\n/),
+    list = [],
+    i = 0;
+  function parseIndex() {
+    var index = {};
+    list.push(index);
+
+    // Parse diff metadata
+    while (i < diffstr.length) {
+      var line = diffstr[i];
+
+      // File header found, end parsing diff metadata
+      if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
+        break;
+      }
+
+      // Diff index
+      var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
+      if (header) {
+        index.index = header[1];
+      }
+      i++;
+    }
+
+    // Parse file headers if they are defined. Unified diff requires them, but
+    // there's no technical issues to have an isolated hunk without file header
+    parseFileHeader(index);
+    parseFileHeader(index);
+
+    // Parse hunks
+    index.hunks = [];
+    while (i < diffstr.length) {
+      var _line = diffstr[i];
+      if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) {
+        break;
+      } else if (/^@@/.test(_line)) {
+        index.hunks.push(parseHunk());
+      } else if (_line) {
+        throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
+      } else {
+        i++;
+      }
+    }
+  }
+
+  // Parses the --- and +++ headers, if none are found, no lines
+  // are consumed.
+  function parseFileHeader(index) {
+    var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]);
+    if (fileHeader) {
+      var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
+      var data = fileHeader[2].split('\t', 2);
+      var fileName = data[0].replace(/\\\\/g, '\\');
+      if (/^".*"$/.test(fileName)) {
+        fileName = fileName.substr(1, fileName.length - 2);
+      }
+      index[keyPrefix + 'FileName'] = fileName;
+      index[keyPrefix + 'Header'] = (data[1] || '').trim();
+      i++;
+    }
+  }
+
+  // Parses a hunk
+  // This assumes that we are at the start of a hunk.
+  function parseHunk() {
+    var chunkHeaderIndex = i,
+      chunkHeaderLine = diffstr[i++],
+      chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
+    var hunk = {
+      oldStart: +chunkHeader[1],
+      oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
+      newStart: +chunkHeader[3],
+      newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
+      lines: []
+    };
+
+    // Unified Diff Format quirk: If the chunk size is 0,
+    // the first number is one lower than one would expect.
+    // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+    if (hunk.oldLines === 0) {
+      hunk.oldStart += 1;
+    }
+    if (hunk.newLines === 0) {
+      hunk.newStart += 1;
+    }
+    var addCount = 0,
+      removeCount = 0;
+    for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || (_diffstr$i = diffstr[i]) !== null && _diffstr$i !== void 0 && _diffstr$i.startsWith('\\')); i++) {
+      var _diffstr$i;
+      var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
+      if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
+        hunk.lines.push(diffstr[i]);
+        if (operation === '+') {
+          addCount++;
+        } else if (operation === '-') {
+          removeCount++;
+        } else if (operation === ' ') {
+          addCount++;
+          removeCount++;
+        }
+      } else {
+        throw new Error("Hunk at line ".concat(chunkHeaderIndex + 1, " contained invalid line ").concat(diffstr[i]));
+      }
+    }
+
+    // Handle the empty block count case
+    if (!addCount && hunk.newLines === 1) {
+      hunk.newLines = 0;
+    }
+    if (!removeCount && hunk.oldLines === 1) {
+      hunk.oldLines = 0;
+    }
+
+    // Perform sanity checking
+    if (addCount !== hunk.newLines) {
+      throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+    }
+    if (removeCount !== hunk.oldLines) {
+      throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+    }
+    return hunk;
+  }
+  while (i < diffstr.length) {
+    parseIndex();
+  }
+  return list;
+}
+
+// Iterator that traverses in the range of [min, max], stepping
+// by distance from a given start position. I.e. for [0, 4], with
+// start of 2, this will iterate 2, 3, 1, 4, 0.
+function distanceIterator (start, minLine, maxLine) {
+  var wantForward = true,
+    backwardExhausted = false,
+    forwardExhausted = false,
+    localOffset = 1;
+  return function iterator() {
+    if (wantForward && !forwardExhausted) {
+      if (backwardExhausted) {
+        localOffset++;
+      } else {
+        wantForward = false;
+      }
+
+      // Check if trying to fit beyond text length, and if not, check it fits
+      // after offset location (or desired location on first iteration)
+      if (start + localOffset <= maxLine) {
+        return start + localOffset;
+      }
+      forwardExhausted = true;
+    }
+    if (!backwardExhausted) {
+      if (!forwardExhausted) {
+        wantForward = true;
+      }
+
+      // Check if trying to fit before text beginning, and if not, check it fits
+      // before offset location
+      if (minLine <= start - localOffset) {
+        return start - localOffset++;
+      }
+      backwardExhausted = true;
+      return iterator();
+    }
+
+    // We tried to fit hunk before text beginning and beyond text length, then
+    // hunk can't fit on the text. Return undefined
+  };
+}
+
+function applyPatch(source, uniDiff) {
+  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+  if (typeof uniDiff === 'string') {
+    uniDiff = parsePatch(uniDiff);
+  }
+  if (Array.isArray(uniDiff)) {
+    if (uniDiff.length > 1) {
+      throw new Error('applyPatch only works with a single input.');
+    }
+    uniDiff = uniDiff[0];
+  }
+  if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) {
+    if (hasOnlyWinLineEndings(source) && isUnix(uniDiff)) {
+      uniDiff = unixToWin(uniDiff);
+    } else if (hasOnlyUnixLineEndings(source) && isWin(uniDiff)) {
+      uniDiff = winToUnix(uniDiff);
+    }
+  }
+
+  // Apply the diff to the input
+  var lines = source.split('\n'),
+    hunks = uniDiff.hunks,
+    compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) {
+      return line === patchContent;
+    },
+    fuzzFactor = options.fuzzFactor || 0,
+    minLine = 0;
+  if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) {
+    throw new Error('fuzzFactor must be a non-negative integer');
+  }
+
+  // Special case for empty patch.
+  if (!hunks.length) {
+    return source;
+  }
+
+  // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change
+  // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a
+  // newline that already exists - then we either return false and fail to apply the patch (if
+  // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0).
+  // If we do need to remove/add a newline at EOF, this will always be in the final hunk:
+  var prevLine = '',
+    removeEOFNL = false,
+    addEOFNL = false;
+  for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) {
+    var line = hunks[hunks.length - 1].lines[i];
+    if (line[0] == '\\') {
+      if (prevLine[0] == '+') {
+        removeEOFNL = true;
+      } else if (prevLine[0] == '-') {
+        addEOFNL = true;
+      }
+    }
+    prevLine = line;
+  }
+  if (removeEOFNL) {
+    if (addEOFNL) {
+      // This means the final line gets changed but doesn't have a trailing newline in either the
+      // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if
+      // fuzzFactor is 0, we simply validate that the source file has no trailing newline.
+      if (!fuzzFactor && lines[lines.length - 1] == '') {
+        return false;
+      }
+    } else if (lines[lines.length - 1] == '') {
+      lines.pop();
+    } else if (!fuzzFactor) {
+      return false;
+    }
+  } else if (addEOFNL) {
+    if (lines[lines.length - 1] != '') {
+      lines.push('');
+    } else if (!fuzzFactor) {
+      return false;
+    }
+  }
+
+  /**
+   * Checks if the hunk can be made to fit at the provided location with at most `maxErrors`
+   * insertions, substitutions, or deletions, while ensuring also that:
+   * - lines deleted in the hunk match exactly, and
+   * - wherever an insertion operation or block of insertion operations appears in the hunk, the
+   *   immediately preceding and following lines of context match exactly
+   *
+   * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0].
+   *
+   * If the hunk can be applied, returns an object with properties `oldLineLastI` and
+   * `replacementLines`. Otherwise, returns null.
+   */
+  function applyHunk(hunkLines, toPos, maxErrors) {
+    var hunkLinesI = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
+    var lastContextLineMatched = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
+    var patchedLines = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
+    var patchedLinesLength = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
+    var nConsecutiveOldContextLines = 0;
+    var nextContextLineMustMatch = false;
+    for (; hunkLinesI < hunkLines.length; hunkLinesI++) {
+      var hunkLine = hunkLines[hunkLinesI],
+        operation = hunkLine.length > 0 ? hunkLine[0] : ' ',
+        content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine;
+      if (operation === '-') {
+        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+          toPos++;
+          nConsecutiveOldContextLines = 0;
+        } else {
+          if (!maxErrors || lines[toPos] == null) {
+            return null;
+          }
+          patchedLines[patchedLinesLength] = lines[toPos];
+          return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1);
+        }
+      }
+      if (operation === '+') {
+        if (!lastContextLineMatched) {
+          return null;
+        }
+        patchedLines[patchedLinesLength] = content;
+        patchedLinesLength++;
+        nConsecutiveOldContextLines = 0;
+        nextContextLineMustMatch = true;
+      }
+      if (operation === ' ') {
+        nConsecutiveOldContextLines++;
+        patchedLines[patchedLinesLength] = lines[toPos];
+        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+          patchedLinesLength++;
+          lastContextLineMatched = true;
+          nextContextLineMustMatch = false;
+          toPos++;
+        } else {
+          if (nextContextLineMustMatch || !maxErrors) {
+            return null;
+          }
+
+          // Consider 3 possibilities in sequence:
+          // 1. lines contains a *substitution* not included in the patch context, or
+          // 2. lines contains an *insertion* not included in the patch context, or
+          // 3. lines contains a *deletion* not included in the patch context
+          // The first two options are of course only possible if the line from lines is non-null -
+          // i.e. only option 3 is possible if we've overrun the end of the old file.
+          return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength);
+        }
+      }
+    }
+
+    // Before returning, trim any unmodified context lines off the end of patchedLines and reduce
+    // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region
+    // that starts in this hunk's trailing context.
+    patchedLinesLength -= nConsecutiveOldContextLines;
+    toPos -= nConsecutiveOldContextLines;
+    patchedLines.length = patchedLinesLength;
+    return {
+      patchedLines: patchedLines,
+      oldLineLastI: toPos - 1
+    };
+  }
+  var resultLines = [];
+
+  // Search best fit offsets for each hunk based on the previous ones
+  var prevHunkOffset = 0;
+  for (var _i = 0; _i < hunks.length; _i++) {
+    var hunk = hunks[_i];
+    var hunkResult = void 0;
+    var maxLine = lines.length - hunk.oldLines + fuzzFactor;
+    var toPos = void 0;
+    for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) {
+      toPos = hunk.oldStart + prevHunkOffset - 1;
+      var iterator = distanceIterator(toPos, minLine, maxLine);
+      for (; toPos !== undefined; toPos = iterator()) {
+        hunkResult = applyHunk(hunk.lines, toPos, maxErrors);
+        if (hunkResult) {
+          break;
+        }
+      }
+      if (hunkResult) {
+        break;
+      }
+    }
+    if (!hunkResult) {
+      return false;
+    }
+
+    // Copy everything from the end of where we applied the last hunk to the start of this hunk
+    for (var _i2 = minLine; _i2 < toPos; _i2++) {
+      resultLines.push(lines[_i2]);
+    }
+
+    // Add the lines produced by applying the hunk:
+    for (var _i3 = 0; _i3 < hunkResult.patchedLines.length; _i3++) {
+      var _line = hunkResult.patchedLines[_i3];
+      resultLines.push(_line);
+    }
+
+    // Set lower text limit to end of the current hunk, so next ones don't try
+    // to fit over already patched text
+    minLine = hunkResult.oldLineLastI + 1;
+
+    // Note the offset between where the patch said the hunk should've applied and where we
+    // applied it, so we can adjust future hunks accordingly:
+    prevHunkOffset = toPos + 1 - hunk.oldStart;
+  }
+
+  // Copy over the rest of the lines from the old text
+  for (var _i4 = minLine; _i4 < lines.length; _i4++) {
+    resultLines.push(lines[_i4]);
+  }
+  return resultLines.join('\n');
+}
+
+// Wrapper that supports multiple file patches via callbacks.
+function applyPatches(uniDiff, options) {
+  if (typeof uniDiff === 'string') {
+    uniDiff = parsePatch(uniDiff);
+  }
+  var currentIndex = 0;
+  function processIndex() {
+    var index = uniDiff[currentIndex++];
+    if (!index) {
+      return options.complete();
+    }
+    options.loadFile(index, function (err, data) {
+      if (err) {
+        return options.complete(err);
+      }
+      var updatedContent = applyPatch(data, index, options);
+      options.patched(index, updatedContent, function (err) {
+        if (err) {
+          return options.complete(err);
+        }
+        processIndex();
+      });
+    });
+  }
+  processIndex();
+}
+
+function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+  if (!options) {
+    options = {};
+  }
+  if (typeof options === 'function') {
+    options = {
+      callback: options
+    };
+  }
+  if (typeof options.context === 'undefined') {
+    options.context = 4;
+  }
+  if (options.newlineIsToken) {
+    throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions');
+  }
+  if (!options.callback) {
+    return diffLinesResultToPatch(diffLines(oldStr, newStr, options));
+  } else {
+    var _options = options,
+      _callback = _options.callback;
+    diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options), {}, {
+      callback: function callback(diff) {
+        var patch = diffLinesResultToPatch(diff);
+        _callback(patch);
+      }
+    }));
+  }
+  function diffLinesResultToPatch(diff) {
+    // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays
+    //         of lines containing trailing newline characters. We'll tidy up later...
+
+    if (!diff) {
+      return;
+    }
+    diff.push({
+      value: '',
+      lines: []
+    }); // Append an empty value to make cleanup easier
+
+    function contextLines(lines) {
+      return lines.map(function (entry) {
+        return ' ' + entry;
+      });
+    }
+    var hunks = [];
+    var oldRangeStart = 0,
+      newRangeStart = 0,
+      curRange = [],
+      oldLine = 1,
+      newLine = 1;
+    var _loop = function _loop() {
+      var current = diff[i],
+        lines = current.lines || splitLines(current.value);
+      current.lines = lines;
+      if (current.added || current.removed) {
+        var _curRange;
+        // If we have previous context, start with that
+        if (!oldRangeStart) {
+          var prev = diff[i - 1];
+          oldRangeStart = oldLine;
+          newRangeStart = newLine;
+          if (prev) {
+            curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
+            oldRangeStart -= curRange.length;
+            newRangeStart -= curRange.length;
+          }
+        }
+
+        // Output our changes
+        (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) {
+          return (current.added ? '+' : '-') + entry;
+        })));
+
+        // Track the updated file position
+        if (current.added) {
+          newLine += lines.length;
+        } else {
+          oldLine += lines.length;
+        }
+      } else {
+        // Identical context lines. Track line changes
+        if (oldRangeStart) {
+          // Close out any changes that have been output (or join overlapping)
+          if (lines.length <= options.context * 2 && i < diff.length - 2) {
+            var _curRange2;
+            // Overlapping
+            (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines)));
+          } else {
+            var _curRange3;
+            // end the range and output
+            var contextSize = Math.min(lines.length, options.context);
+            (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize))));
+            var _hunk = {
+              oldStart: oldRangeStart,
+              oldLines: oldLine - oldRangeStart + contextSize,
+              newStart: newRangeStart,
+              newLines: newLine - newRangeStart + contextSize,
+              lines: curRange
+            };
+            hunks.push(_hunk);
+            oldRangeStart = 0;
+            newRangeStart = 0;
+            curRange = [];
+          }
+        }
+        oldLine += lines.length;
+        newLine += lines.length;
+      }
+    };
+    for (var i = 0; i < diff.length; i++) {
+      _loop();
+    }
+
+    // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add
+    //         "\ No newline at end of file".
+    for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) {
+      var hunk = _hunks[_i];
+      for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) {
+        if (hunk.lines[_i2].endsWith('\n')) {
+          hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1);
+        } else {
+          hunk.lines.splice(_i2 + 1, 0, '\\ No newline at end of file');
+          _i2++; // Skip the line we just added, then continue iterating
+        }
+      }
+    }
+    return {
+      oldFileName: oldFileName,
+      newFileName: newFileName,
+      oldHeader: oldHeader,
+      newHeader: newHeader,
+      hunks: hunks
+    };
+  }
+}
+function formatPatch(diff) {
+  if (Array.isArray(diff)) {
+    return diff.map(formatPatch).join('\n');
+  }
+  var ret = [];
+  if (diff.oldFileName == diff.newFileName) {
+    ret.push('Index: ' + diff.oldFileName);
+  }
+  ret.push('===================================================================');
+  ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
+  ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
+  for (var i = 0; i < diff.hunks.length; i++) {
+    var hunk = diff.hunks[i];
+    // Unified Diff Format quirk: If the chunk size is 0,
+    // the first number is one lower than one would expect.
+    // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+    if (hunk.oldLines === 0) {
+      hunk.oldStart -= 1;
+    }
+    if (hunk.newLines === 0) {
+      hunk.newStart -= 1;
+    }
+    ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
+    ret.push.apply(ret, hunk.lines);
+  }
+  return ret.join('\n') + '\n';
+}
+function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+  var _options2;
+  if (typeof options === 'function') {
+    options = {
+      callback: options
+    };
+  }
+  if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.callback)) {
+    var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
+    if (!patchObj) {
+      return;
+    }
+    return formatPatch(patchObj);
+  } else {
+    var _options3 = options,
+      _callback2 = _options3.callback;
+    structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options), {}, {
+      callback: function callback(patchObj) {
+        if (!patchObj) {
+          _callback2();
+        } else {
+          _callback2(formatPatch(patchObj));
+        }
+      }
+    }));
+  }
+}
+function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
+  return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
+}
+
+/**
+ * Split `text` into an array of lines, including the trailing newline character (where present)
+ */
+function splitLines(text) {
+  var hasTrailingNl = text.endsWith('\n');
+  var result = text.split('\n').map(function (line) {
+    return line + '\n';
+  });
+  if (hasTrailingNl) {
+    result.pop();
+  } else {
+    result.push(result.pop().slice(0, -1));
+  }
+  return result;
+}
+
+function arrayEqual(a, b) {
+  if (a.length !== b.length) {
+    return false;
+  }
+  return arrayStartsWith(a, b);
+}
+function arrayStartsWith(array, start) {
+  if (start.length > array.length) {
+    return false;
+  }
+  for (var i = 0; i < start.length; i++) {
+    if (start[i] !== array[i]) {
+      return false;
+    }
+  }
+  return true;
+}
+
+function calcLineCount(hunk) {
+  var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines),
+    oldLines = _calcOldNewLineCount.oldLines,
+    newLines = _calcOldNewLineCount.newLines;
+  if (oldLines !== undefined) {
+    hunk.oldLines = oldLines;
+  } else {
+    delete hunk.oldLines;
+  }
+  if (newLines !== undefined) {
+    hunk.newLines = newLines;
+  } else {
+    delete hunk.newLines;
+  }
+}
+function merge(mine, theirs, base) {
+  mine = loadPatch(mine, base);
+  theirs = loadPatch(theirs, base);
+  var ret = {};
+
+  // For index we just let it pass through as it doesn't have any necessary meaning.
+  // Leaving sanity checks on this to the API consumer that may know more about the
+  // meaning in their own context.
+  if (mine.index || theirs.index) {
+    ret.index = mine.index || theirs.index;
+  }
+  if (mine.newFileName || theirs.newFileName) {
+    if (!fileNameChanged(mine)) {
+      // No header or no change in ours, use theirs (and ours if theirs does not exist)
+      ret.oldFileName = theirs.oldFileName || mine.oldFileName;
+      ret.newFileName = theirs.newFileName || mine.newFileName;
+      ret.oldHeader = theirs.oldHeader || mine.oldHeader;
+      ret.newHeader = theirs.newHeader || mine.newHeader;
+    } else if (!fileNameChanged(theirs)) {
+      // No header or no change in theirs, use ours
+      ret.oldFileName = mine.oldFileName;
+      ret.newFileName = mine.newFileName;
+      ret.oldHeader = mine.oldHeader;
+      ret.newHeader = mine.newHeader;
+    } else {
+      // Both changed... figure it out
+      ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
+      ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
+      ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
+      ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
+    }
+  }
+  ret.hunks = [];
+  var mineIndex = 0,
+    theirsIndex = 0,
+    mineOffset = 0,
+    theirsOffset = 0;
+  while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
+    var mineCurrent = mine.hunks[mineIndex] || {
+        oldStart: Infinity
+      },
+      theirsCurrent = theirs.hunks[theirsIndex] || {
+        oldStart: Infinity
+      };
+    if (hunkBefore(mineCurrent, theirsCurrent)) {
+      // This patch does not overlap with any of the others, yay.
+      ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
+      mineIndex++;
+      theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
+    } else if (hunkBefore(theirsCurrent, mineCurrent)) {
+      // This patch does not overlap with any of the others, yay.
+      ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
+      theirsIndex++;
+      mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
+    } else {
+      // Overlap, merge as best we can
+      var mergedHunk = {
+        oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
+        oldLines: 0,
+        newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
+        newLines: 0,
+        lines: []
+      };
+      mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
+      theirsIndex++;
+      mineIndex++;
+      ret.hunks.push(mergedHunk);
+    }
+  }
+  return ret;
+}
+function loadPatch(param, base) {
+  if (typeof param === 'string') {
+    if (/^@@/m.test(param) || /^Index:/m.test(param)) {
+      return parsePatch(param)[0];
+    }
+    if (!base) {
+      throw new Error('Must provide a base reference or pass in a patch');
+    }
+    return structuredPatch(undefined, undefined, base, param);
+  }
+  return param;
+}
+function fileNameChanged(patch) {
+  return patch.newFileName && patch.newFileName !== patch.oldFileName;
+}
+function selectField(index, mine, theirs) {
+  if (mine === theirs) {
+    return mine;
+  } else {
+    index.conflict = true;
+    return {
+      mine: mine,
+      theirs: theirs
+    };
+  }
+}
+function hunkBefore(test, check) {
+  return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
+}
+function cloneHunk(hunk, offset) {
+  return {
+    oldStart: hunk.oldStart,
+    oldLines: hunk.oldLines,
+    newStart: hunk.newStart + offset,
+    newLines: hunk.newLines,
+    lines: hunk.lines
+  };
+}
+function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
+  // This will generally result in a conflicted hunk, but there are cases where the context
+  // is the only overlap where we can successfully merge the content here.
+  var mine = {
+      offset: mineOffset,
+      lines: mineLines,
+      index: 0
+    },
+    their = {
+      offset: theirOffset,
+      lines: theirLines,
+      index: 0
+    };
+
+  // Handle any leading content
+  insertLeading(hunk, mine, their);
+  insertLeading(hunk, their, mine);
+
+  // Now in the overlap content. Scan through and select the best changes from each.
+  while (mine.index < mine.lines.length && their.index < their.lines.length) {
+    var mineCurrent = mine.lines[mine.index],
+      theirCurrent = their.lines[their.index];
+    if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
+      // Both modified ...
+      mutualChange(hunk, mine, their);
+    } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
+      var _hunk$lines;
+      // Mine inserted
+      (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine)));
+    } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
+      var _hunk$lines2;
+      // Theirs inserted
+      (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their)));
+    } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
+      // Mine removed or edited
+      removal(hunk, mine, their);
+    } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
+      // Their removed or edited
+      removal(hunk, their, mine, true);
+    } else if (mineCurrent === theirCurrent) {
+      // Context identity
+      hunk.lines.push(mineCurrent);
+      mine.index++;
+      their.index++;
+    } else {
+      // Context mismatch
+      conflict(hunk, collectChange(mine), collectChange(their));
+    }
+  }
+
+  // Now push anything that may be remaining
+  insertTrailing(hunk, mine);
+  insertTrailing(hunk, their);
+  calcLineCount(hunk);
+}
+function mutualChange(hunk, mine, their) {
+  var myChanges = collectChange(mine),
+    theirChanges = collectChange(their);
+  if (allRemoves(myChanges) && allRemoves(theirChanges)) {
+    // Special case for remove changes that are supersets of one another
+    if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
+      var _hunk$lines3;
+      (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges));
+      return;
+    } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
+      var _hunk$lines4;
+      (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges));
+      return;
+    }
+  } else if (arrayEqual(myChanges, theirChanges)) {
+    var _hunk$lines5;
+    (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges));
+    return;
+  }
+  conflict(hunk, myChanges, theirChanges);
+}
+function removal(hunk, mine, their, swap) {
+  var myChanges = collectChange(mine),
+    theirChanges = collectContext(their, myChanges);
+  if (theirChanges.merged) {
+    var _hunk$lines6;
+    (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged));
+  } else {
+    conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
+  }
+}
+function conflict(hunk, mine, their) {
+  hunk.conflict = true;
+  hunk.lines.push({
+    conflict: true,
+    mine: mine,
+    theirs: their
+  });
+}
+function insertLeading(hunk, insert, their) {
+  while (insert.offset < their.offset && insert.index < insert.lines.length) {
+    var line = insert.lines[insert.index++];
+    hunk.lines.push(line);
+    insert.offset++;
+  }
+}
+function insertTrailing(hunk, insert) {
+  while (insert.index < insert.lines.length) {
+    var line = insert.lines[insert.index++];
+    hunk.lines.push(line);
+  }
+}
+function collectChange(state) {
+  var ret = [],
+    operation = state.lines[state.index][0];
+  while (state.index < state.lines.length) {
+    var line = state.lines[state.index];
+
+    // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
+    if (operation === '-' && line[0] === '+') {
+      operation = '+';
+    }
+    if (operation === line[0]) {
+      ret.push(line);
+      state.index++;
+    } else {
+      break;
+    }
+  }
+  return ret;
+}
+function collectContext(state, matchChanges) {
+  var changes = [],
+    merged = [],
+    matchIndex = 0,
+    contextChanges = false,
+    conflicted = false;
+  while (matchIndex < matchChanges.length && state.index < state.lines.length) {
+    var change = state.lines[state.index],
+      match = matchChanges[matchIndex];
+
+    // Once we've hit our add, then we are done
+    if (match[0] === '+') {
+      break;
+    }
+    contextChanges = contextChanges || change[0] !== ' ';
+    merged.push(match);
+    matchIndex++;
+
+    // Consume any additions in the other block as a conflict to attempt
+    // to pull in the remaining context after this
+    if (change[0] === '+') {
+      conflicted = true;
+      while (change[0] === '+') {
+        changes.push(change);
+        change = state.lines[++state.index];
+      }
+    }
+    if (match.substr(1) === change.substr(1)) {
+      changes.push(change);
+      state.index++;
+    } else {
+      conflicted = true;
+    }
+  }
+  if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
+    conflicted = true;
+  }
+  if (conflicted) {
+    return changes;
+  }
+  while (matchIndex < matchChanges.length) {
+    merged.push(matchChanges[matchIndex++]);
+  }
+  return {
+    merged: merged,
+    changes: changes
+  };
+}
+function allRemoves(changes) {
+  return changes.reduce(function (prev, change) {
+    return prev && change[0] === '-';
+  }, true);
+}
+function skipRemoveSuperset(state, removeChanges, delta) {
+  for (var i = 0; i < delta; i++) {
+    var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
+    if (state.lines[state.index + i] !== ' ' + changeContent) {
+      return false;
+    }
+  }
+  state.index += delta;
+  return true;
+}
+function calcOldNewLineCount(lines) {
+  var oldLines = 0;
+  var newLines = 0;
+  lines.forEach(function (line) {
+    if (typeof line !== 'string') {
+      var myCount = calcOldNewLineCount(line.mine);
+      var theirCount = calcOldNewLineCount(line.theirs);
+      if (oldLines !== undefined) {
+        if (myCount.oldLines === theirCount.oldLines) {
+          oldLines += myCount.oldLines;
+        } else {
+          oldLines = undefined;
+        }
+      }
+      if (newLines !== undefined) {
+        if (myCount.newLines === theirCount.newLines) {
+          newLines += myCount.newLines;
+        } else {
+          newLines = undefined;
+        }
+      }
+    } else {
+      if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
+        newLines++;
+      }
+      if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
+        oldLines++;
+      }
+    }
+  });
+  return {
+    oldLines: oldLines,
+    newLines: newLines
+  };
+}
+
+function reversePatch(structuredPatch) {
+  if (Array.isArray(structuredPatch)) {
+    return structuredPatch.map(reversePatch).reverse();
+  }
+  return _objectSpread2(_objectSpread2({}, structuredPatch), {}, {
+    oldFileName: structuredPatch.newFileName,
+    oldHeader: structuredPatch.newHeader,
+    newFileName: structuredPatch.oldFileName,
+    newHeader: structuredPatch.oldHeader,
+    hunks: structuredPatch.hunks.map(function (hunk) {
+      return {
+        oldLines: hunk.newLines,
+        oldStart: hunk.newStart,
+        newLines: hunk.oldLines,
+        newStart: hunk.oldStart,
+        lines: hunk.lines.map(function (l) {
+          if (l.startsWith('-')) {
+            return "+".concat(l.slice(1));
+          }
+          if (l.startsWith('+')) {
+            return "-".concat(l.slice(1));
+          }
+          return l;
+        })
+      };
+    })
+  });
+}
+
+// See: http://code.google.com/p/google-diff-match-patch/wiki/API
+function convertChangesToDMP(changes) {
+  var ret = [],
+    change,
+    operation;
+  for (var i = 0; i < changes.length; i++) {
+    change = changes[i];
+    if (change.added) {
+      operation = 1;
+    } else if (change.removed) {
+      operation = -1;
+    } else {
+      operation = 0;
+    }
+    ret.push([operation, change.value]);
+  }
+  return ret;
+}
+
+function convertChangesToXML(changes) {
+  var ret = [];
+  for (var i = 0; i < changes.length; i++) {
+    var change = changes[i];
+    if (change.added) {
+      ret.push('');
+    } else if (change.removed) {
+      ret.push('');
+    }
+    ret.push(escapeHTML(change.value));
+    if (change.added) {
+      ret.push('');
+    } else if (change.removed) {
+      ret.push('');
+    }
+  }
+  return ret.join('');
+}
+function escapeHTML(s) {
+  var n = s;
+  n = n.replace(/&/g, '&');
+  n = n.replace(//g, '>');
+  n = n.replace(/"/g, '"');
+  return n;
+}
+
+export { Diff, applyPatch, applyPatches, canonicalize, convertChangesToDMP, convertChangesToXML, createPatch, createTwoFilesPatch, diffArrays, diffChars, diffCss, diffJson, diffLines, diffSentences, diffTrimmedLines, diffWords, diffWordsWithSpace, formatPatch, merge, parsePatch, reversePatch, structuredPatch };
diff --git a/node_modules/diff/lib/patch/apply.js b/node_modules/diff/lib/patch/apply.js
new file mode 100644
index 0000000..619def1
--- /dev/null
+++ b/node_modules/diff/lib/patch/apply.js
@@ -0,0 +1,393 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.applyPatch = applyPatch;
+exports.applyPatches = applyPatches;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_string = require("../util/string")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_lineEndings = require("./line-endings")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_parse = require("./parse")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_distanceIterator = _interopRequireDefault(require("../util/distance-iterator"))
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
+/*istanbul ignore end*/
+function applyPatch(source, uniDiff) {
+  /*istanbul ignore start*/
+  var
+  /*istanbul ignore end*/
+  options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+  if (typeof uniDiff === 'string') {
+    uniDiff =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _parse
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    parsePatch)
+    /*istanbul ignore end*/
+    (uniDiff);
+  }
+  if (Array.isArray(uniDiff)) {
+    if (uniDiff.length > 1) {
+      throw new Error('applyPatch only works with a single input.');
+    }
+    uniDiff = uniDiff[0];
+  }
+  if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) {
+    if (
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    hasOnlyWinLineEndings)
+    /*istanbul ignore end*/
+    (source) &&
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _lineEndings
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    isUnix)
+    /*istanbul ignore end*/
+    (uniDiff)) {
+      uniDiff =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _lineEndings
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      unixToWin)
+      /*istanbul ignore end*/
+      (uniDiff);
+    } else if (
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _string
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    hasOnlyUnixLineEndings)
+    /*istanbul ignore end*/
+    (source) &&
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _lineEndings
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    isWin)
+    /*istanbul ignore end*/
+    (uniDiff)) {
+      uniDiff =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _lineEndings
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      winToUnix)
+      /*istanbul ignore end*/
+      (uniDiff);
+    }
+  }
+
+  // Apply the diff to the input
+  var lines = source.split('\n'),
+    hunks = uniDiff.hunks,
+    compareLine = options.compareLine || function (lineNumber, line, operation, patchContent)
+    /*istanbul ignore start*/
+    {
+      return (
+        /*istanbul ignore end*/
+        line === patchContent
+      );
+    },
+    fuzzFactor = options.fuzzFactor || 0,
+    minLine = 0;
+  if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) {
+    throw new Error('fuzzFactor must be a non-negative integer');
+  }
+
+  // Special case for empty patch.
+  if (!hunks.length) {
+    return source;
+  }
+
+  // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change
+  // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a
+  // newline that already exists - then we either return false and fail to apply the patch (if
+  // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0).
+  // If we do need to remove/add a newline at EOF, this will always be in the final hunk:
+  var prevLine = '',
+    removeEOFNL = false,
+    addEOFNL = false;
+  for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) {
+    var line = hunks[hunks.length - 1].lines[i];
+    if (line[0] == '\\') {
+      if (prevLine[0] == '+') {
+        removeEOFNL = true;
+      } else if (prevLine[0] == '-') {
+        addEOFNL = true;
+      }
+    }
+    prevLine = line;
+  }
+  if (removeEOFNL) {
+    if (addEOFNL) {
+      // This means the final line gets changed but doesn't have a trailing newline in either the
+      // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if
+      // fuzzFactor is 0, we simply validate that the source file has no trailing newline.
+      if (!fuzzFactor && lines[lines.length - 1] == '') {
+        return false;
+      }
+    } else if (lines[lines.length - 1] == '') {
+      lines.pop();
+    } else if (!fuzzFactor) {
+      return false;
+    }
+  } else if (addEOFNL) {
+    if (lines[lines.length - 1] != '') {
+      lines.push('');
+    } else if (!fuzzFactor) {
+      return false;
+    }
+  }
+
+  /**
+   * Checks if the hunk can be made to fit at the provided location with at most `maxErrors`
+   * insertions, substitutions, or deletions, while ensuring also that:
+   * - lines deleted in the hunk match exactly, and
+   * - wherever an insertion operation or block of insertion operations appears in the hunk, the
+   *   immediately preceding and following lines of context match exactly
+   *
+   * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0].
+   *
+   * If the hunk can be applied, returns an object with properties `oldLineLastI` and
+   * `replacementLines`. Otherwise, returns null.
+   */
+  function applyHunk(hunkLines, toPos, maxErrors) {
+    /*istanbul ignore start*/
+    var
+    /*istanbul ignore end*/
+    hunkLinesI = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
+    /*istanbul ignore start*/
+    var
+    /*istanbul ignore end*/
+    lastContextLineMatched = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
+    /*istanbul ignore start*/
+    var
+    /*istanbul ignore end*/
+    patchedLines = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : [];
+    /*istanbul ignore start*/
+    var
+    /*istanbul ignore end*/
+    patchedLinesLength = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
+    var nConsecutiveOldContextLines = 0;
+    var nextContextLineMustMatch = false;
+    for (; hunkLinesI < hunkLines.length; hunkLinesI++) {
+      var hunkLine = hunkLines[hunkLinesI],
+        operation = hunkLine.length > 0 ? hunkLine[0] : ' ',
+        content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine;
+      if (operation === '-') {
+        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+          toPos++;
+          nConsecutiveOldContextLines = 0;
+        } else {
+          if (!maxErrors || lines[toPos] == null) {
+            return null;
+          }
+          patchedLines[patchedLinesLength] = lines[toPos];
+          return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1);
+        }
+      }
+      if (operation === '+') {
+        if (!lastContextLineMatched) {
+          return null;
+        }
+        patchedLines[patchedLinesLength] = content;
+        patchedLinesLength++;
+        nConsecutiveOldContextLines = 0;
+        nextContextLineMustMatch = true;
+      }
+      if (operation === ' ') {
+        nConsecutiveOldContextLines++;
+        patchedLines[patchedLinesLength] = lines[toPos];
+        if (compareLine(toPos + 1, lines[toPos], operation, content)) {
+          patchedLinesLength++;
+          lastContextLineMatched = true;
+          nextContextLineMustMatch = false;
+          toPos++;
+        } else {
+          if (nextContextLineMustMatch || !maxErrors) {
+            return null;
+          }
+
+          // Consider 3 possibilities in sequence:
+          // 1. lines contains a *substitution* not included in the patch context, or
+          // 2. lines contains an *insertion* not included in the patch context, or
+          // 3. lines contains a *deletion* not included in the patch context
+          // The first two options are of course only possible if the line from lines is non-null -
+          // i.e. only option 3 is possible if we've overrun the end of the old file.
+          return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength);
+        }
+      }
+    }
+
+    // Before returning, trim any unmodified context lines off the end of patchedLines and reduce
+    // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region
+    // that starts in this hunk's trailing context.
+    patchedLinesLength -= nConsecutiveOldContextLines;
+    toPos -= nConsecutiveOldContextLines;
+    patchedLines.length = patchedLinesLength;
+    return {
+      patchedLines: patchedLines,
+      oldLineLastI: toPos - 1
+    };
+  }
+  var resultLines = [];
+
+  // Search best fit offsets for each hunk based on the previous ones
+  var prevHunkOffset = 0;
+  for (var _i = 0; _i < hunks.length; _i++) {
+    var hunk = hunks[_i];
+    var hunkResult =
+    /*istanbul ignore start*/
+    void 0
+    /*istanbul ignore end*/
+    ;
+    var maxLine = lines.length - hunk.oldLines + fuzzFactor;
+    var toPos =
+    /*istanbul ignore start*/
+    void 0
+    /*istanbul ignore end*/
+    ;
+    for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) {
+      toPos = hunk.oldStart + prevHunkOffset - 1;
+      var iterator =
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _distanceIterator
+      /*istanbul ignore end*/
+      [
+      /*istanbul ignore start*/
+      "default"
+      /*istanbul ignore end*/
+      ])(toPos, minLine, maxLine);
+      for (; toPos !== undefined; toPos = iterator()) {
+        hunkResult = applyHunk(hunk.lines, toPos, maxErrors);
+        if (hunkResult) {
+          break;
+        }
+      }
+      if (hunkResult) {
+        break;
+      }
+    }
+    if (!hunkResult) {
+      return false;
+    }
+
+    // Copy everything from the end of where we applied the last hunk to the start of this hunk
+    for (var _i2 = minLine; _i2 < toPos; _i2++) {
+      resultLines.push(lines[_i2]);
+    }
+
+    // Add the lines produced by applying the hunk:
+    for (var _i3 = 0; _i3 < hunkResult.patchedLines.length; _i3++) {
+      var _line = hunkResult.patchedLines[_i3];
+      resultLines.push(_line);
+    }
+
+    // Set lower text limit to end of the current hunk, so next ones don't try
+    // to fit over already patched text
+    minLine = hunkResult.oldLineLastI + 1;
+
+    // Note the offset between where the patch said the hunk should've applied and where we
+    // applied it, so we can adjust future hunks accordingly:
+    prevHunkOffset = toPos + 1 - hunk.oldStart;
+  }
+
+  // Copy over the rest of the lines from the old text
+  for (var _i4 = minLine; _i4 < lines.length; _i4++) {
+    resultLines.push(lines[_i4]);
+  }
+  return resultLines.join('\n');
+}
+
+// Wrapper that supports multiple file patches via callbacks.
+function applyPatches(uniDiff, options) {
+  if (typeof uniDiff === 'string') {
+    uniDiff =
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _parse
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    parsePatch)
+    /*istanbul ignore end*/
+    (uniDiff);
+  }
+  var currentIndex = 0;
+  function processIndex() {
+    var index = uniDiff[currentIndex++];
+    if (!index) {
+      return options.complete();
+    }
+    options.loadFile(index, function (err, data) {
+      if (err) {
+        return options.complete(err);
+      }
+      var updatedContent = applyPatch(data, index, options);
+      options.patched(index, updatedContent, function (err) {
+        if (err) {
+          return options.complete(err);
+        }
+        processIndex();
+      });
+    });
+  }
+  processIndex();
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfc3RyaW5nIiwicmVxdWlyZSIsIl9saW5lRW5kaW5ncyIsIl9wYXJzZSIsIl9kaXN0YW5jZUl0ZXJhdG9yIiwiX2ludGVyb3BSZXF1aXJlRGVmYXVsdCIsIm9iaiIsIl9fZXNNb2R1bGUiLCJhcHBseVBhdGNoIiwic291cmNlIiwidW5pRGlmZiIsIm9wdGlvbnMiLCJhcmd1bWVudHMiLCJsZW5ndGgiLCJ1bmRlZmluZWQiLCJwYXJzZVBhdGNoIiwiQXJyYXkiLCJpc0FycmF5IiwiRXJyb3IiLCJhdXRvQ29udmVydExpbmVFbmRpbmdzIiwiaGFzT25seVdpbkxpbmVFbmRpbmdzIiwiaXNVbml4IiwidW5peFRvV2luIiwiaGFzT25seVVuaXhMaW5lRW5kaW5ncyIsImlzV2luIiwid2luVG9Vbml4IiwibGluZXMiLCJzcGxpdCIsImh1bmtzIiwiY29tcGFyZUxpbmUiLCJsaW5lTnVtYmVyIiwibGluZSIsIm9wZXJhdGlvbiIsInBhdGNoQ29udGVudCIsImZ1enpGYWN0b3IiLCJtaW5MaW5lIiwiTnVtYmVyIiwiaXNJbnRlZ2VyIiwicHJldkxpbmUiLCJyZW1vdmVFT0ZOTCIsImFkZEVPRk5MIiwiaSIsInBvcCIsInB1c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G51bGwuXG4gICAqL1xuICBmdW5jdGlvbiBhcHBseUh1bmsoXG4gICAgaHVua0xpbmVzLFxuICAgIHRvUG9zLFxuICAgIG1heEVycm9ycyxcbiAgICBodW5rTGluZXNJID0gMCxcbiAgICBsYXN0Q29udGV4dExpbmVNYXRjaGVkID0gdHJ1ZSxcbiAgICBwYXRjaGVkTGluZXMgPSBbXSxcbiAgICBwYXRjaGVkTGluZXNMZW5ndGggPSAwLFxuICApIHtcbiAgICBsZXQgbkNvbnNlY3V0aXZlT2xkQ29udGV4dExpbmVzID0gMDtcbiAgICBsZXQgbmV4dENvbnRleHRMaW5lTXVzdE1hdGNoID0gZmFsc2U7XG4gICAgZm9yICg7IGh1bmtMaW5lc0kgPCBodW5rTGluZXMubGVuZ3RoOyBodW5rTGluZXNJKyspIHtcbiAgICAgIGxldCBodW5rTGluZSA9IGh1bmtMaW5lc1todW5rTGluZXNJXSxcbiAgICAgICAgICBvcGVyYXRpb24gPSAoaHVua0xpbmUubGVuZ3RoID4gMCA/IGh1bmtMaW5lWzBdIDogJyAnKSxcbiAgICAgICAgICBjb250ZW50ID0gKGh1bmtMaW5lLmxlbmd0aCA+IDAgPyBodW5rTGluZS5zdWJzdHIoMSkgOiBodW5rTGluZSk7XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICBpZiAoY29tcGFyZUxpbmUodG9Qb3MgKyAxLCBsaW5lc1t0b1Bvc10sIG9wZXJhdGlvbiwgY29udGVudCkpIHtcbiAgICAgICAgICB0b1BvcysrO1xuICAgICAgICAgIG5Db25zZWN1dGl2ZU9sZENvbnRleHRMaW5lcyA9IDA7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKCFtYXhFcnJvcnMgfHwgbGluZXNbdG9Qb3NdID09IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBwYXRjaGVkTGluZXNbcGF0Y2hlZExpbmVzTG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gICAgICAgICAgaHVua0xpbmVzSSArIDEsXG4gICAgICAgICAgICAgICAgZmFsc2UsXG4gICAgICAgICAgICAgICAgcGF0Y2hlZExpbmVzLFxuICAgICAgICAgICAgICAgIHBhdGNoZWRMaW5lc0xlbmd0aCArIDFcbiAgICAgICAgICAgICAgKSB8fCBhcHBseUh1bmsoXG4gICAgICAgICAgICAgICAgaHVua0xpbmVzLFxuICAgICAgICAgICAgICAgIHRvUG9zICsgMSxcbiAgICAgICAgICAgICAgICBtYXhFcnJvcnMgLSAxLFxuICAgICAgICAgICAgICAgIGh1bmtMaW5lc0ksXG4gICAgICAgICAgICAgICAgZmFsc2UsXG4gICAgICAgICAgICAgICAgcGF0Y2hlZExpbmVzLFxuICAgICAgICAgICAgICAgIHBhdGNoZWRMaW5lc0xlbmd0aCArIDFcbiAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKSB8fCBhcHBseUh1bmsoXG4gICAgICAgICAgICAgIGh1bmtMaW5lcyxcbiAgICAgICAgICAgICAgdG9Qb3MsXG4gICAgICAgICAgICAgIG1heEVycm9ycyAtIDEsXG4gICAgICAgICAgICAgIGh1bmtMaW5lc0kgKyAxLFxuICAgICAgICAgICAgICBmYWxzZSxcbiAgICAgICAgICAgICAgcGF0Y2hlZExpbmVzLFxuICAgICAgICAgICAgICBwYXRjaGVkTGluZXNMZW5ndGhcbiAgICAgICAgICAgIClcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gQmVmb3JlIHJldHVybmluZywgdHJpbSBhbnkgdW5tb2RpZmllZCBjb250ZXh0IGxpbmVzIG9mZiB0aGUgZW5kIG9mIHBhdGNoZWRMaW5lcyBhbmQgcmVkdWNlXG4gICAgLy8gdG9Qb3MgKGFuZCB0aHVzIG9sZExpbmVMYXN0SSkgYWNjb3JkaW5nbHkuIFRoaXMgYWxsb3dzIGxhdGVyIGh1bmtzIHRvIGJlIGFwcGxpZWQgdG8gYSByZWdpb25cbiAg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0FBQzZELFFBQVEsQ0FBQ0UsR0FBRyxDQUFDO01BQzlCO01BRUEsSUFBSUUsY0FBYyxHQUFHcEUsVUFBVSxDQUFDbUUsSUFBSSxFQUFFSixLQUFLLEVBQUU1RCxPQUFPLENBQUM7TUFDckRBLE9BQU8sQ0FBQ2tFLE9BQU8sQ0FBQ04sS0FBSyxFQUFFSyxjQUFjLEVBQUUsVUFBU0YsR0FBRyxFQUFFO1FBQ25ELElBQUlBLEdBQUcsRUFBRTtVQUNQLE9BQU8vRCxPQUFPLENBQUM2RCxRQUFRLENBQUNFLEdBQUcsQ0FBQztRQUM5QjtRQUVBSixZQUFZLENBQUMsQ0FBQztNQUNoQixDQUFDLENBQUM7SUFDSixDQUFDLENBQUM7RUFDSjtFQUNBQSxZQUFZLENBQUMsQ0FBQztBQUNoQiIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/patch/create.js b/node_modules/diff/lib/patch/create.js
new file mode 100644
index 0000000..10ec2d4
--- /dev/null
+++ b/node_modules/diff/lib/patch/create.js
@@ -0,0 +1,369 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.createPatch = createPatch;
+exports.createTwoFilesPatch = createTwoFilesPatch;
+exports.formatPatch = formatPatch;
+exports.structuredPatch = structuredPatch;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_line = require("../diff/line")
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
+function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
+function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
+function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
+function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
+function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
+function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
+function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
+function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
+function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
+function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
+/*istanbul ignore end*/
+function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+  if (!options) {
+    options = {};
+  }
+  if (typeof options === 'function') {
+    options = {
+      callback: options
+    };
+  }
+  if (typeof options.context === 'undefined') {
+    options.context = 4;
+  }
+  if (options.newlineIsToken) {
+    throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions');
+  }
+  if (!options.callback) {
+    return diffLinesResultToPatch(
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _line
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    diffLines)
+    /*istanbul ignore end*/
+    (oldStr, newStr, options));
+  } else {
+    var
+      /*istanbul ignore start*/
+      _options =
+      /*istanbul ignore end*/
+      options,
+      /*istanbul ignore start*/
+      /*istanbul ignore end*/
+      _callback = _options.callback;
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _line
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    diffLines)
+    /*istanbul ignore end*/
+    (oldStr, newStr,
+    /*istanbul ignore start*/
+    _objectSpread(_objectSpread({},
+    /*istanbul ignore end*/
+    options), {}, {
+      callback: function
+      /*istanbul ignore start*/
+      callback
+      /*istanbul ignore end*/
+      (diff) {
+        var patch = diffLinesResultToPatch(diff);
+        _callback(patch);
+      }
+    }));
+  }
+  function diffLinesResultToPatch(diff) {
+    // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays
+    //         of lines containing trailing newline characters. We'll tidy up later...
+
+    if (!diff) {
+      return;
+    }
+    diff.push({
+      value: '',
+      lines: []
+    }); // Append an empty value to make cleanup easier
+
+    function contextLines(lines) {
+      return lines.map(function (entry) {
+        return ' ' + entry;
+      });
+    }
+    var hunks = [];
+    var oldRangeStart = 0,
+      newRangeStart = 0,
+      curRange = [],
+      oldLine = 1,
+      newLine = 1;
+    /*istanbul ignore start*/
+    var _loop = function _loop()
+    /*istanbul ignore end*/
+    {
+      var current = diff[i],
+        lines = current.lines || splitLines(current.value);
+      current.lines = lines;
+      if (current.added || current.removed) {
+        /*istanbul ignore start*/
+        var _curRange;
+        /*istanbul ignore end*/
+        // If we have previous context, start with that
+        if (!oldRangeStart) {
+          var prev = diff[i - 1];
+          oldRangeStart = oldLine;
+          newRangeStart = newLine;
+          if (prev) {
+            curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
+            oldRangeStart -= curRange.length;
+            newRangeStart -= curRange.length;
+          }
+        }
+
+        // Output our changes
+        /*istanbul ignore start*/
+        /*istanbul ignore end*/
+        /*istanbul ignore start*/
+        (_curRange =
+        /*istanbul ignore end*/
+        curRange).push.apply(
+        /*istanbul ignore start*/
+        _curRange
+        /*istanbul ignore end*/
+        ,
+        /*istanbul ignore start*/
+        _toConsumableArray(
+        /*istanbul ignore end*/
+        lines.map(function (entry) {
+          return (current.added ? '+' : '-') + entry;
+        })));
+
+        // Track the updated file position
+        if (current.added) {
+          newLine += lines.length;
+        } else {
+          oldLine += lines.length;
+        }
+      } else {
+        // Identical context lines. Track line changes
+        if (oldRangeStart) {
+          // Close out any changes that have been output (or join overlapping)
+          if (lines.length <= options.context * 2 && i < diff.length - 2) {
+            /*istanbul ignore start*/
+            var _curRange2;
+            /*istanbul ignore end*/
+            // Overlapping
+            /*istanbul ignore start*/
+            /*istanbul ignore end*/
+            /*istanbul ignore start*/
+            (_curRange2 =
+            /*istanbul ignore end*/
+            curRange).push.apply(
+            /*istanbul ignore start*/
+            _curRange2
+            /*istanbul ignore end*/
+            ,
+            /*istanbul ignore start*/
+            _toConsumableArray(
+            /*istanbul ignore end*/
+            contextLines(lines)));
+          } else {
+            /*istanbul ignore start*/
+            var _curRange3;
+            /*istanbul ignore end*/
+            // end the range and output
+            var contextSize = Math.min(lines.length, options.context);
+            /*istanbul ignore start*/
+            /*istanbul ignore end*/
+            /*istanbul ignore start*/
+            (_curRange3 =
+            /*istanbul ignore end*/
+            curRange).push.apply(
+            /*istanbul ignore start*/
+            _curRange3
+            /*istanbul ignore end*/
+            ,
+            /*istanbul ignore start*/
+            _toConsumableArray(
+            /*istanbul ignore end*/
+            contextLines(lines.slice(0, contextSize))));
+            var _hunk = {
+              oldStart: oldRangeStart,
+              oldLines: oldLine - oldRangeStart + contextSize,
+              newStart: newRangeStart,
+              newLines: newLine - newRangeStart + contextSize,
+              lines: curRange
+            };
+            hunks.push(_hunk);
+            oldRangeStart = 0;
+            newRangeStart = 0;
+            curRange = [];
+          }
+        }
+        oldLine += lines.length;
+        newLine += lines.length;
+      }
+    };
+    for (var i = 0; i < diff.length; i++)
+    /*istanbul ignore start*/
+    {
+      _loop();
+    }
+
+    // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add
+    //         "\ No newline at end of file".
+    /*istanbul ignore end*/
+    for (
+    /*istanbul ignore start*/
+    var _i = 0, _hunks =
+      /*istanbul ignore end*/
+      hunks;
+    /*istanbul ignore start*/
+    _i < _hunks.length
+    /*istanbul ignore end*/
+    ;
+    /*istanbul ignore start*/
+    _i++
+    /*istanbul ignore end*/
+    ) {
+      var hunk =
+      /*istanbul ignore start*/
+      _hunks[_i]
+      /*istanbul ignore end*/
+      ;
+      for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) {
+        if (hunk.lines[_i2].endsWith('\n')) {
+          hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1);
+        } else {
+          hunk.lines.splice(_i2 + 1, 0, '\\ No newline at end of file');
+          _i2++; // Skip the line we just added, then continue iterating
+        }
+      }
+    }
+    return {
+      oldFileName: oldFileName,
+      newFileName: newFileName,
+      oldHeader: oldHeader,
+      newHeader: newHeader,
+      hunks: hunks
+    };
+  }
+}
+function formatPatch(diff) {
+  if (Array.isArray(diff)) {
+    return diff.map(formatPatch).join('\n');
+  }
+  var ret = [];
+  if (diff.oldFileName == diff.newFileName) {
+    ret.push('Index: ' + diff.oldFileName);
+  }
+  ret.push('===================================================================');
+  ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
+  ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
+  for (var i = 0; i < diff.hunks.length; i++) {
+    var hunk = diff.hunks[i];
+    // Unified Diff Format quirk: If the chunk size is 0,
+    // the first number is one lower than one would expect.
+    // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+    if (hunk.oldLines === 0) {
+      hunk.oldStart -= 1;
+    }
+    if (hunk.newLines === 0) {
+      hunk.newStart -= 1;
+    }
+    ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
+    ret.push.apply(ret, hunk.lines);
+  }
+  return ret.join('\n') + '\n';
+}
+function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
+  /*istanbul ignore start*/
+  var _options2;
+  /*istanbul ignore end*/
+  if (typeof options === 'function') {
+    options = {
+      callback: options
+    };
+  }
+  if (!
+  /*istanbul ignore start*/
+  ((_options2 =
+  /*istanbul ignore end*/
+  options) !== null && _options2 !== void 0 &&
+  /*istanbul ignore start*/
+  _options2
+  /*istanbul ignore end*/
+  .callback)) {
+    var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
+    if (!patchObj) {
+      return;
+    }
+    return formatPatch(patchObj);
+  } else {
+    var
+      /*istanbul ignore start*/
+      _options3 =
+      /*istanbul ignore end*/
+      options,
+      /*istanbul ignore start*/
+      /*istanbul ignore end*/
+      _callback2 = _options3.callback;
+    structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader,
+    /*istanbul ignore start*/
+    _objectSpread(_objectSpread({},
+    /*istanbul ignore end*/
+    options), {}, {
+      callback: function
+      /*istanbul ignore start*/
+      callback
+      /*istanbul ignore end*/
+      (patchObj) {
+        if (!patchObj) {
+          _callback2();
+        } else {
+          _callback2(formatPatch(patchObj));
+        }
+      }
+    }));
+  }
+}
+function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
+  return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
+}
+
+/**
+ * Split `text` into an array of lines, including the trailing newline character (where present)
+ */
+function splitLines(text) {
+  var hasTrailingNl = text.endsWith('\n');
+  var result = text.split('\n').map(function (line)
+  /*istanbul ignore start*/
+  {
+    return (
+      /*istanbul ignore end*/
+      line + '\n'
+    );
+  });
+  if (hasTrailingNl) {
+    result.pop();
+  } else {
+    result.push(result.pop().slice(0, -1));
+  }
+  return result;
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbGluZSIsInJlcXVpcmUiLCJfdHlwZW9mIiwibyIsIlN5bWJvbCIsIml0ZXJhdG9yIiwiY29uc3RydWN0b3IiLCJwcm90b3R5cGUiLCJfdG9Db25zdW1hYmxlQXJyYXkiLCJhcnIiLCJfYXJyYXlXaXRob3V0SG9sZXMiLCJfaXRlcmFibGVUb0FycmF5IiwiX3Vuc3VwcG9ydGVkSXRlcmFibGVUb0FycmF5IiwiX25vbkl0ZXJhYmxlU3ByZWFkIiwiVHlwZUVycm9yIiwibWluTGVuIiwiX2FycmF5TGlrZVRvQXJyYXkiLCJuIiwiT2JqZWN0IiwidG9TdHJpbmciLCJjYWxsIiwic2xpY2UiLCJuYW1lIiwiQXJyYXkiLCJmcm9tIiwidGVzdCIsIml0ZXIiLCJpc0FycmF5IiwibGVuIiwibGVuZ3RoIiwiaSIsImFycjIiLCJvd25LZXlzIiwiZSIsInIiLCJ0Iiwia2V5cyIsImdldE93blByb3BlcnR5U3ltYm9scyIsImZpbHRlciIsImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsImVudW1lcmFibGUiLCJwdXNoIiwiYXBwbHkiLCJfb2JqZWN0U3ByZWFkIiwiYXJndW1lbnRzIi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QUFNLENBQUNHLEdBQUcsQ0FBQyxDQUFDO0VBQ2QsQ0FBQyxNQUFNO0lBQ0xILE1BQU0sQ0FBQzlFLElBQUksQ0FBQzhFLE1BQU0sQ0FBQ0csR0FBRyxDQUFDLENBQUMsQ0FBQ3JHLEtBQUssQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztFQUN4QztFQUNBLE9BQU9rRyxNQUFNO0FBQ2YiLCJpZ25vcmVMaXN0IjpbXX0=
diff --git a/node_modules/diff/lib/patch/line-endings.js b/node_modules/diff/lib/patch/line-endings.js
new file mode 100644
index 0000000..8d00bd2
--- /dev/null
+++ b/node_modules/diff/lib/patch/line-endings.js
@@ -0,0 +1,176 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.isUnix = isUnix;
+exports.isWin = isWin;
+exports.unixToWin = unixToWin;
+exports.winToUnix = winToUnix;
+function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
+function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
+function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
+function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
+function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
+/*istanbul ignore end*/
+function unixToWin(patch) {
+  if (Array.isArray(patch)) {
+    return patch.map(unixToWin);
+  }
+  return (
+    /*istanbul ignore start*/
+    _objectSpread(_objectSpread({},
+    /*istanbul ignore end*/
+    patch), {}, {
+      hunks: patch.hunks.map(function (hunk)
+      /*istanbul ignore start*/
+      {
+        return _objectSpread(_objectSpread({},
+        /*istanbul ignore end*/
+        hunk), {}, {
+          lines: hunk.lines.map(function (line, i)
+          /*istanbul ignore start*/
+          {
+            var _hunk$lines;
+            return (
+              /*istanbul ignore end*/
+              line.startsWith('\\') || line.endsWith('\r') ||
+              /*istanbul ignore start*/
+              (_hunk$lines =
+              /*istanbul ignore end*/
+              hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 &&
+              /*istanbul ignore start*/
+              _hunk$lines
+              /*istanbul ignore end*/
+              .startsWith('\\') ? line : line + '\r'
+            );
+          })
+        });
+      })
+    })
+  );
+}
+function winToUnix(patch) {
+  if (Array.isArray(patch)) {
+    return patch.map(winToUnix);
+  }
+  return (
+    /*istanbul ignore start*/
+    _objectSpread(_objectSpread({},
+    /*istanbul ignore end*/
+    patch), {}, {
+      hunks: patch.hunks.map(function (hunk)
+      /*istanbul ignore start*/
+      {
+        return _objectSpread(_objectSpread({},
+        /*istanbul ignore end*/
+        hunk), {}, {
+          lines: hunk.lines.map(function (line)
+          /*istanbul ignore start*/
+          {
+            return (
+              /*istanbul ignore end*/
+              line.endsWith('\r') ? line.substring(0, line.length - 1) : line
+            );
+          })
+        });
+      })
+    })
+  );
+}
+
+/**
+ * Returns true if the patch consistently uses Unix line endings (or only involves one line and has
+ * no line endings).
+ */
+function isUnix(patch) {
+  if (!Array.isArray(patch)) {
+    patch = [patch];
+  }
+  return !patch.some(function (index)
+  /*istanbul ignore start*/
+  {
+    return (
+      /*istanbul ignore end*/
+      index.hunks.some(function (hunk)
+      /*istanbul ignore start*/
+      {
+        return (
+          /*istanbul ignore end*/
+          hunk.lines.some(function (line)
+          /*istanbul ignore start*/
+          {
+            return (
+              /*istanbul ignore end*/
+              !line.startsWith('\\') && line.endsWith('\r')
+            );
+          })
+        );
+      })
+    );
+  });
+}
+
+/**
+ * Returns true if the patch uses Windows line endings and only Windows line endings.
+ */
+function isWin(patch) {
+  if (!Array.isArray(patch)) {
+    patch = [patch];
+  }
+  return patch.some(function (index)
+  /*istanbul ignore start*/
+  {
+    return (
+      /*istanbul ignore end*/
+      index.hunks.some(function (hunk)
+      /*istanbul ignore start*/
+      {
+        return (
+          /*istanbul ignore end*/
+          hunk.lines.some(function (line)
+          /*istanbul ignore start*/
+          {
+            return (
+              /*istanbul ignore end*/
+              line.endsWith('\r')
+            );
+          })
+        );
+      })
+    );
+  }) && patch.every(function (index)
+  /*istanbul ignore start*/
+  {
+    return (
+      /*istanbul ignore end*/
+      index.hunks.every(function (hunk)
+      /*istanbul ignore start*/
+      {
+        return (
+          /*istanbul ignore end*/
+          hunk.lines.every(function (line, i)
+          /*istanbul ignore start*/
+          {
+            var _hunk$lines2;
+            return (
+              /*istanbul ignore end*/
+              line.startsWith('\\') || line.endsWith('\r') ||
+              /*istanbul ignore start*/
+              ((_hunk$lines2 =
+              /*istanbul ignore end*/
+              hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 :
+              /*istanbul ignore start*/
+              _hunk$lines2
+              /*istanbul ignore end*/
+              .startsWith('\\'))
+            );
+          })
+        );
+      })
+    );
+  });
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI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BO1lBQUE7Y0FBQTtjQUFJQSxJQUFJLENBQUNJLFFBQVEsQ0FBQyxJQUFJO1lBQUM7VUFBQTtRQUFDO01BQUE7SUFBQztFQUFBLEVBQUMsSUFDN0ZaLEtBQUssQ0FBQ29CLEtBQUssQ0FDWixVQUFBRixLQUFLO0VBQUE7RUFBQTtJQUFBO01BQUE7TUFBSUEsS0FBSyxDQUFDYixLQUFLLENBQUNlLEtBQUssQ0FDeEIsVUFBQWQsSUFBSTtNQUFBO01BQUE7UUFBQTtVQUFBO1VBQUlBLElBQUksQ0FBQ0MsS0FBSyxDQUFDYSxLQUFLLENBQ3RCLFVBQUNaLElBQUksRUFBRUMsQ0FBQztVQUFBO1VBQUE7WUFBQSxJQUFBWSxZQUFBO1lBQUE7Y0FBQTtjQUFLYixJQUFJLENBQUNHLFVBQVUsQ0FBQyxJQUFJLENBQUMsSUFBSUgsSUFBSSxDQUFDSSxRQUFRLENBQUMsSUFBSSxDQUFDO2NBQUE7Y0FBQSxFQUFBUyxZQUFBO2NBQUE7Y0FBSWYsSUFBSSxDQUFDQyxLQUFLLENBQUNFLENBQUMsR0FBRyxDQUFDLENBQUMsY0FBQVksWUFBQTtjQUFqQjtjQUFBQTtjQUFBO2NBQUEsQ0FBbUJWLFVBQVUsQ0FBQyxJQUFJLENBQUM7WUFBQTtVQUFBLENBQ2xHO1FBQUM7TUFBQSxDQUNIO0lBQUM7RUFBQSxDQUNILENBQUM7QUFDTCIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/patch/merge.js b/node_modules/diff/lib/patch/merge.js
new file mode 100644
index 0000000..fead4e0
--- /dev/null
+++ b/node_modules/diff/lib/patch/merge.js
@@ -0,0 +1,535 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.calcLineCount = calcLineCount;
+exports.merge = merge;
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_create = require("./create")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_parse = require("./parse")
+/*istanbul ignore end*/
+;
+var
+/*istanbul ignore start*/
+_array = require("../util/array")
+/*istanbul ignore end*/
+;
+/*istanbul ignore start*/ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
+function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
+function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
+function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
+function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
+function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
+/*istanbul ignore end*/
+function calcLineCount(hunk) {
+  var
+    /*istanbul ignore start*/
+    _calcOldNewLineCount =
+    /*istanbul ignore end*/
+    calcOldNewLineCount(hunk.lines),
+    /*istanbul ignore start*/
+    /*istanbul ignore end*/
+    oldLines = _calcOldNewLineCount.oldLines,
+    /*istanbul ignore start*/
+    /*istanbul ignore end*/
+    newLines = _calcOldNewLineCount.newLines;
+  if (oldLines !== undefined) {
+    hunk.oldLines = oldLines;
+  } else {
+    delete hunk.oldLines;
+  }
+  if (newLines !== undefined) {
+    hunk.newLines = newLines;
+  } else {
+    delete hunk.newLines;
+  }
+}
+function merge(mine, theirs, base) {
+  mine = loadPatch(mine, base);
+  theirs = loadPatch(theirs, base);
+  var ret = {};
+
+  // For index we just let it pass through as it doesn't have any necessary meaning.
+  // Leaving sanity checks on this to the API consumer that may know more about the
+  // meaning in their own context.
+  if (mine.index || theirs.index) {
+    ret.index = mine.index || theirs.index;
+  }
+  if (mine.newFileName || theirs.newFileName) {
+    if (!fileNameChanged(mine)) {
+      // No header or no change in ours, use theirs (and ours if theirs does not exist)
+      ret.oldFileName = theirs.oldFileName || mine.oldFileName;
+      ret.newFileName = theirs.newFileName || mine.newFileName;
+      ret.oldHeader = theirs.oldHeader || mine.oldHeader;
+      ret.newHeader = theirs.newHeader || mine.newHeader;
+    } else if (!fileNameChanged(theirs)) {
+      // No header or no change in theirs, use ours
+      ret.oldFileName = mine.oldFileName;
+      ret.newFileName = mine.newFileName;
+      ret.oldHeader = mine.oldHeader;
+      ret.newHeader = mine.newHeader;
+    } else {
+      // Both changed... figure it out
+      ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName);
+      ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName);
+      ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader);
+      ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader);
+    }
+  }
+  ret.hunks = [];
+  var mineIndex = 0,
+    theirsIndex = 0,
+    mineOffset = 0,
+    theirsOffset = 0;
+  while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) {
+    var mineCurrent = mine.hunks[mineIndex] || {
+        oldStart: Infinity
+      },
+      theirsCurrent = theirs.hunks[theirsIndex] || {
+        oldStart: Infinity
+      };
+    if (hunkBefore(mineCurrent, theirsCurrent)) {
+      // This patch does not overlap with any of the others, yay.
+      ret.hunks.push(cloneHunk(mineCurrent, mineOffset));
+      mineIndex++;
+      theirsOffset += mineCurrent.newLines - mineCurrent.oldLines;
+    } else if (hunkBefore(theirsCurrent, mineCurrent)) {
+      // This patch does not overlap with any of the others, yay.
+      ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset));
+      theirsIndex++;
+      mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines;
+    } else {
+      // Overlap, merge as best we can
+      var mergedHunk = {
+        oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart),
+        oldLines: 0,
+        newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset),
+        newLines: 0,
+        lines: []
+      };
+      mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines);
+      theirsIndex++;
+      mineIndex++;
+      ret.hunks.push(mergedHunk);
+    }
+  }
+  return ret;
+}
+function loadPatch(param, base) {
+  if (typeof param === 'string') {
+    if (/^@@/m.test(param) || /^Index:/m.test(param)) {
+      return (
+        /*istanbul ignore start*/
+        (0,
+        /*istanbul ignore end*/
+        /*istanbul ignore start*/
+        _parse
+        /*istanbul ignore end*/
+        .
+        /*istanbul ignore start*/
+        parsePatch)
+        /*istanbul ignore end*/
+        (param)[0]
+      );
+    }
+    if (!base) {
+      throw new Error('Must provide a base reference or pass in a patch');
+    }
+    return (
+      /*istanbul ignore start*/
+      (0,
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      _create
+      /*istanbul ignore end*/
+      .
+      /*istanbul ignore start*/
+      structuredPatch)
+      /*istanbul ignore end*/
+      (undefined, undefined, base, param)
+    );
+  }
+  return param;
+}
+function fileNameChanged(patch) {
+  return patch.newFileName && patch.newFileName !== patch.oldFileName;
+}
+function selectField(index, mine, theirs) {
+  if (mine === theirs) {
+    return mine;
+  } else {
+    index.conflict = true;
+    return {
+      mine: mine,
+      theirs: theirs
+    };
+  }
+}
+function hunkBefore(test, check) {
+  return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart;
+}
+function cloneHunk(hunk, offset) {
+  return {
+    oldStart: hunk.oldStart,
+    oldLines: hunk.oldLines,
+    newStart: hunk.newStart + offset,
+    newLines: hunk.newLines,
+    lines: hunk.lines
+  };
+}
+function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) {
+  // This will generally result in a conflicted hunk, but there are cases where the context
+  // is the only overlap where we can successfully merge the content here.
+  var mine = {
+      offset: mineOffset,
+      lines: mineLines,
+      index: 0
+    },
+    their = {
+      offset: theirOffset,
+      lines: theirLines,
+      index: 0
+    };
+
+  // Handle any leading content
+  insertLeading(hunk, mine, their);
+  insertLeading(hunk, their, mine);
+
+  // Now in the overlap content. Scan through and select the best changes from each.
+  while (mine.index < mine.lines.length && their.index < their.lines.length) {
+    var mineCurrent = mine.lines[mine.index],
+      theirCurrent = their.lines[their.index];
+    if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) {
+      // Both modified ...
+      mutualChange(hunk, mine, their);
+    } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') {
+      /*istanbul ignore start*/
+      var _hunk$lines;
+      /*istanbul ignore end*/
+      // Mine inserted
+      /*istanbul ignore start*/
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      (_hunk$lines =
+      /*istanbul ignore end*/
+      hunk.lines).push.apply(
+      /*istanbul ignore start*/
+      _hunk$lines
+      /*istanbul ignore end*/
+      ,
+      /*istanbul ignore start*/
+      _toConsumableArray(
+      /*istanbul ignore end*/
+      collectChange(mine)));
+    } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') {
+      /*istanbul ignore start*/
+      var _hunk$lines2;
+      /*istanbul ignore end*/
+      // Theirs inserted
+      /*istanbul ignore start*/
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      (_hunk$lines2 =
+      /*istanbul ignore end*/
+      hunk.lines).push.apply(
+      /*istanbul ignore start*/
+      _hunk$lines2
+      /*istanbul ignore end*/
+      ,
+      /*istanbul ignore start*/
+      _toConsumableArray(
+      /*istanbul ignore end*/
+      collectChange(their)));
+    } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') {
+      // Mine removed or edited
+      removal(hunk, mine, their);
+    } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') {
+      // Their removed or edited
+      removal(hunk, their, mine, true);
+    } else if (mineCurrent === theirCurrent) {
+      // Context identity
+      hunk.lines.push(mineCurrent);
+      mine.index++;
+      their.index++;
+    } else {
+      // Context mismatch
+      conflict(hunk, collectChange(mine), collectChange(their));
+    }
+  }
+
+  // Now push anything that may be remaining
+  insertTrailing(hunk, mine);
+  insertTrailing(hunk, their);
+  calcLineCount(hunk);
+}
+function mutualChange(hunk, mine, their) {
+  var myChanges = collectChange(mine),
+    theirChanges = collectChange(their);
+  if (allRemoves(myChanges) && allRemoves(theirChanges)) {
+    // Special case for remove changes that are supersets of one another
+    if (
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _array
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    arrayStartsWith)
+    /*istanbul ignore end*/
+    (myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) {
+      /*istanbul ignore start*/
+      var _hunk$lines3;
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      (_hunk$lines3 =
+      /*istanbul ignore end*/
+      hunk.lines).push.apply(
+      /*istanbul ignore start*/
+      _hunk$lines3
+      /*istanbul ignore end*/
+      ,
+      /*istanbul ignore start*/
+      _toConsumableArray(
+      /*istanbul ignore end*/
+      myChanges));
+      return;
+    } else if (
+    /*istanbul ignore start*/
+    (0,
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    _array
+    /*istanbul ignore end*/
+    .
+    /*istanbul ignore start*/
+    arrayStartsWith)
+    /*istanbul ignore end*/
+    (theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) {
+      /*istanbul ignore start*/
+      var _hunk$lines4;
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      /*istanbul ignore end*/
+      /*istanbul ignore start*/
+      (_hunk$lines4 =
+      /*istanbul ignore end*/
+      hunk.lines).push.apply(
+      /*istanbul ignore start*/
+      _hunk$lines4
+      /*istanbul ignore end*/
+      ,
+      /*istanbul ignore start*/
+      _toConsumableArray(
+      /*istanbul ignore end*/
+      theirChanges));
+      return;
+    }
+  } else if (
+  /*istanbul ignore start*/
+  (0,
+  /*istanbul ignore end*/
+  /*istanbul ignore start*/
+  _array
+  /*istanbul ignore end*/
+  .
+  /*istanbul ignore start*/
+  arrayEqual)
+  /*istanbul ignore end*/
+  (myChanges, theirChanges)) {
+    /*istanbul ignore start*/
+    var _hunk$lines5;
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    (_hunk$lines5 =
+    /*istanbul ignore end*/
+    hunk.lines).push.apply(
+    /*istanbul ignore start*/
+    _hunk$lines5
+    /*istanbul ignore end*/
+    ,
+    /*istanbul ignore start*/
+    _toConsumableArray(
+    /*istanbul ignore end*/
+    myChanges));
+    return;
+  }
+  conflict(hunk, myChanges, theirChanges);
+}
+function removal(hunk, mine, their, swap) {
+  var myChanges = collectChange(mine),
+    theirChanges = collectContext(their, myChanges);
+  if (theirChanges.merged) {
+    /*istanbul ignore start*/
+    var _hunk$lines6;
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    /*istanbul ignore end*/
+    /*istanbul ignore start*/
+    (_hunk$lines6 =
+    /*istanbul ignore end*/
+    hunk.lines).push.apply(
+    /*istanbul ignore start*/
+    _hunk$lines6
+    /*istanbul ignore end*/
+    ,
+    /*istanbul ignore start*/
+    _toConsumableArray(
+    /*istanbul ignore end*/
+    theirChanges.merged));
+  } else {
+    conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges);
+  }
+}
+function conflict(hunk, mine, their) {
+  hunk.conflict = true;
+  hunk.lines.push({
+    conflict: true,
+    mine: mine,
+    theirs: their
+  });
+}
+function insertLeading(hunk, insert, their) {
+  while (insert.offset < their.offset && insert.index < insert.lines.length) {
+    var line = insert.lines[insert.index++];
+    hunk.lines.push(line);
+    insert.offset++;
+  }
+}
+function insertTrailing(hunk, insert) {
+  while (insert.index < insert.lines.length) {
+    var line = insert.lines[insert.index++];
+    hunk.lines.push(line);
+  }
+}
+function collectChange(state) {
+  var ret = [],
+    operation = state.lines[state.index][0];
+  while (state.index < state.lines.length) {
+    var line = state.lines[state.index];
+
+    // Group additions that are immediately after subtractions and treat them as one "atomic" modify change.
+    if (operation === '-' && line[0] === '+') {
+      operation = '+';
+    }
+    if (operation === line[0]) {
+      ret.push(line);
+      state.index++;
+    } else {
+      break;
+    }
+  }
+  return ret;
+}
+function collectContext(state, matchChanges) {
+  var changes = [],
+    merged = [],
+    matchIndex = 0,
+    contextChanges = false,
+    conflicted = false;
+  while (matchIndex < matchChanges.length && state.index < state.lines.length) {
+    var change = state.lines[state.index],
+      match = matchChanges[matchIndex];
+
+    // Once we've hit our add, then we are done
+    if (match[0] === '+') {
+      break;
+    }
+    contextChanges = contextChanges || change[0] !== ' ';
+    merged.push(match);
+    matchIndex++;
+
+    // Consume any additions in the other block as a conflict to attempt
+    // to pull in the remaining context after this
+    if (change[0] === '+') {
+      conflicted = true;
+      while (change[0] === '+') {
+        changes.push(change);
+        change = state.lines[++state.index];
+      }
+    }
+    if (match.substr(1) === change.substr(1)) {
+      changes.push(change);
+      state.index++;
+    } else {
+      conflicted = true;
+    }
+  }
+  if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) {
+    conflicted = true;
+  }
+  if (conflicted) {
+    return changes;
+  }
+  while (matchIndex < matchChanges.length) {
+    merged.push(matchChanges[matchIndex++]);
+  }
+  return {
+    merged: merged,
+    changes: changes
+  };
+}
+function allRemoves(changes) {
+  return changes.reduce(function (prev, change) {
+    return prev && change[0] === '-';
+  }, true);
+}
+function skipRemoveSuperset(state, removeChanges, delta) {
+  for (var i = 0; i < delta; i++) {
+    var changeContent = removeChanges[removeChanges.length - delta + i].substr(1);
+    if (state.lines[state.index + i] !== ' ' + changeContent) {
+      return false;
+    }
+  }
+  state.index += delta;
+  return true;
+}
+function calcOldNewLineCount(lines) {
+  var oldLines = 0;
+  var newLines = 0;
+  lines.forEach(function (line) {
+    if (typeof line !== 'string') {
+      var myCount = calcOldNewLineCount(line.mine);
+      var theirCount = calcOldNewLineCount(line.theirs);
+      if (oldLines !== undefined) {
+        if (myCount.oldLines === theirCount.oldLines) {
+          oldLines += myCount.oldLines;
+        } else {
+          oldLines = undefined;
+        }
+      }
+      if (newLines !== undefined) {
+        if (myCount.newLines === theirCount.newLines) {
+          newLines += myCount.newLines;
+        } else {
+          newLines = undefined;
+        }
+      }
+    } else {
+      if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) {
+        newLines++;
+      }
+      if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) {
+        oldLines++;
+      }
+    }
+  });
+  return {
+    oldLines: oldLines,
+    newLines: newLines
+  };
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfY3JlYXRlIiwicmVxdWlyZSIsIl9wYXJzZSIsIl9hcnJheSIsIl90b0NvbnN1bWFibGVBcnJheSIsImFyciIsIl9hcnJheVdpdGhvdXRIb2xlcyIsIl9pdGVyYWJsZVRvQXJyYXkiLCJfdW5zdXBwb3J0ZWRJdGVyYWJsZVRvQXJyYXkiLCJfbm9uSXRlcmFibGVTcHJlYWQiLCJUeXBlRXJyb3IiLCJvIiwibWluTGVuIiwiX2FycmF5TGlrZVRvQXJyYXkiLCJuIiwiT2JqZWN0IiwicHJvdG90eXBlIiwidG9TdHJpbmciLCJjYWxsIiwic2xpY2UiLCJjb25zdHJ1Y3RvciIsIm5hbWUiLCJBcnJheSIsImZyb20iLCJ0ZXN0IiwiaXRlciIsIlN5bWJvbCIsIml0ZXJhdG9yIiwiaXNBcnJheSIsImxlbiIsImxlbmd0aCIsImkiLCJhcnIyIiwiY2FsY0xpbmVDb3VudCIsImh1bmsiLCJfY2FsY09sZE5ld0xpbmVDb3VudCIsImNhbGNPbGROZXdMaW5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AgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxuXG4gIHN0YXRlLmluZGV4ICs9IGRlbHRhO1xuICByZXR1cm4gdHJ1ZTtcbn1cblxuZnVuY3Rpb24gY2FsY09sZE5ld0xpbmVDb3VudChsaW5lcykge1xuICBsZXQgb2xkTGluZXMgPSAwO1xuICBsZXQgbmV3TGluZXMgPSAwO1xuXG4gIGxpbmVzLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgIGlmICh0eXBlb2YgbGluZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgIGxldCBteUNvdW50ID0gY2FsY09sZE5ld0xpbmVDb3VudChsaW5lLm1pbmUpO1xuICAgICAgbGV0IHRoZWlyQ291bnQgPSBjYWxjT2xkTmV3TGluZUNvdW50KGxpbmUudGhlaXJzKTtcblxuICAgICAgaWYgKG9sZExpbmVzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKG15Q291bnQub2xkTGluZXMgPT09IHRoZWlyQ291bnQub2xkTGluZXMpIHtcbiAgICAgICAgICBvbGRMaW5lcyArPSBteUNvdW50Lm9sZExpbmVzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG9sZExpbmVzID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChuZXdMaW5lcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmIChteUNvdW50Lm5ld0xpbmVzID09PSB0aGVpckNvdW50Lm5ld0xpbmVzKSB7XG4gICAgICAgICAgbmV3TGluZXMgKz0gbXlDb3VudC5uZXdMaW5lcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBuZXdMaW5lcyA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAobmV3TGluZXMgIT09IHVuZGVmaW5lZCAmJiAobGluZVswXSA9PT0gJysnIHx8IGxpbmVbMF0gPT09ICcgJykp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new file mode 100644
index 0000000..15acdd9
--- /dev/null
+++ b/node_modules/diff/lib/patch/parse.js
@@ -0,0 +1,151 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.parsePatch = parsePatch;
+/*istanbul ignore end*/
+function parsePatch(uniDiff) {
+  var diffstr = uniDiff.split(/\n/),
+    list = [],
+    i = 0;
+  function parseIndex() {
+    var index = {};
+    list.push(index);
+
+    // Parse diff metadata
+    while (i < diffstr.length) {
+      var line = diffstr[i];
+
+      // File header found, end parsing diff metadata
+      if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
+        break;
+      }
+
+      // Diff index
+      var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
+      if (header) {
+        index.index = header[1];
+      }
+      i++;
+    }
+
+    // Parse file headers if they are defined. Unified diff requires them, but
+    // there's no technical issues to have an isolated hunk without file header
+    parseFileHeader(index);
+    parseFileHeader(index);
+
+    // Parse hunks
+    index.hunks = [];
+    while (i < diffstr.length) {
+      var _line = diffstr[i];
+      if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) {
+        break;
+      } else if (/^@@/.test(_line)) {
+        index.hunks.push(parseHunk());
+      } else if (_line) {
+        throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
+      } else {
+        i++;
+      }
+    }
+  }
+
+  // Parses the --- and +++ headers, if none are found, no lines
+  // are consumed.
+  function parseFileHeader(index) {
+    var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]);
+    if (fileHeader) {
+      var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
+      var data = fileHeader[2].split('\t', 2);
+      var fileName = data[0].replace(/\\\\/g, '\\');
+      if (/^".*"$/.test(fileName)) {
+        fileName = fileName.substr(1, fileName.length - 2);
+      }
+      index[keyPrefix + 'FileName'] = fileName;
+      index[keyPrefix + 'Header'] = (data[1] || '').trim();
+      i++;
+    }
+  }
+
+  // Parses a hunk
+  // This assumes that we are at the start of a hunk.
+  function parseHunk() {
+    var chunkHeaderIndex = i,
+      chunkHeaderLine = diffstr[i++],
+      chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
+    var hunk = {
+      oldStart: +chunkHeader[1],
+      oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2],
+      newStart: +chunkHeader[3],
+      newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4],
+      lines: []
+    };
+
+    // Unified Diff Format quirk: If the chunk size is 0,
+    // the first number is one lower than one would expect.
+    // https://www.artima.com/weblogs/viewpost.jsp?thread=164293
+    if (hunk.oldLines === 0) {
+      hunk.oldStart += 1;
+    }
+    if (hunk.newLines === 0) {
+      hunk.newStart += 1;
+    }
+    var addCount = 0,
+      removeCount = 0;
+    for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines ||
+    /*istanbul ignore start*/
+    (_diffstr$i =
+    /*istanbul ignore end*/
+    diffstr[i]) !== null && _diffstr$i !== void 0 &&
+    /*istanbul ignore start*/
+    _diffstr$i
+    /*istanbul ignore end*/
+    .startsWith('\\')); i++) {
+      /*istanbul ignore start*/
+      var _diffstr$i;
+      /*istanbul ignore end*/
+      var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0];
+      if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
+        hunk.lines.push(diffstr[i]);
+        if (operation === '+') {
+          addCount++;
+        } else if (operation === '-') {
+          removeCount++;
+        } else if (operation === ' ') {
+          addCount++;
+          removeCount++;
+        }
+      } else {
+        throw new Error(
+        /*istanbul ignore start*/
+        "Hunk at line ".concat(
+        /*istanbul ignore end*/
+        chunkHeaderIndex + 1, " contained invalid line ").concat(diffstr[i]));
+      }
+    }
+
+    // Handle the empty block count case
+    if (!addCount && hunk.newLines === 1) {
+      hunk.newLines = 0;
+    }
+    if (!removeCount && hunk.oldLines === 1) {
+      hunk.oldLines = 0;
+    }
+
+    // Perform sanity checking
+    if (addCount !== hunk.newLines) {
+      throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+    }
+    if (removeCount !== hunk.oldLines) {
+      throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
+    }
+    return hunk;
+  }
+  while (i < diffstr.length) {
+    parseIndex();
+  }
+  return list;
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJwYXJzZVBhdGNoIiwidW5pRGlmZiIsImRpZmZzdHIiLCJzcGxpdCIsImxpc3QiLCJpIiwicGFyc2VJbmRleCIsImluZGV4IiwicHVzaCIsImxlbmd0aCIsImxpbmUiLCJ0ZXN0IiwiaGVhZGVyIiwiZXhlYyIsInBhcnNlRmlsZUhlYWRlciIsImh1bmtzIiwicGFyc2VIdW5rIiwiRXJyb3IiLCJKU09OIiwic3RyaW5naWZ5IiwiZmlsZUhlYWRlciIsImtleVByZWZpeCIsImRhdGEiLCJmaWxlTmFtZSIsInJlcGxhY2UiLCJzdWJzdHIiLCJ0cmltIiwiY2h1bmtIZWFkZXJJbmRleCIsImNodW5rSGVhZGVyTGluZSIsImNodW5rSGVhZGVyIiwiaHVuayIsIm9sZFN0YXJ0Iiwib2xkTGluZXMiLCJuZXdTdGFydCIsIm5ld0xpbmVzIiwibGluZXMiLCJhZGRDb3VudCIsInJlbW92ZUNvdW50IiwiX2RpZmZzdHIkaSIsInN0YXJ0c1dpdGgiLCJvcGVyYXRpb24iLCJjb25jYXQiXSwic291cmNlcyI6WyIuLi8uLi9zcmMvcGF0Y2gvcGFyc2UuanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIHBhcnNlUGF0Y2godW5pRGlmZikge1xuICBsZXQgZGlmZnN0ciA9IHVuaURpZmYuc3BsaXQoL1xcbi8pLFxuICAgICAgbGlzdC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QUcsQ0FBQyxDQUFDLENBQUM7SUFDaEc7SUFFQSxPQUFPRyxJQUFJO0VBQ2I7RUFFQSxPQUFPekIsQ0FBQyxHQUFHSCxPQUFPLENBQUNPLE1BQU0sRUFBRTtJQUN6QkgsVUFBVSxDQUFDLENBQUM7RUFDZDtFQUVBLE9BQU9GLElBQUk7QUFDYiIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/patch/reverse.js b/node_modules/diff/lib/patch/reverse.js
new file mode 100644
index 0000000..3c8723e
--- /dev/null
+++ b/node_modules/diff/lib/patch/reverse.js
@@ -0,0 +1,58 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.reversePatch = reversePatch;
+function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
+function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
+function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
+function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
+function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
+/*istanbul ignore end*/
+function reversePatch(structuredPatch) {
+  if (Array.isArray(structuredPatch)) {
+    return structuredPatch.map(reversePatch).reverse();
+  }
+  return (
+    /*istanbul ignore start*/
+    _objectSpread(_objectSpread({},
+    /*istanbul ignore end*/
+    structuredPatch), {}, {
+      oldFileName: structuredPatch.newFileName,
+      oldHeader: structuredPatch.newHeader,
+      newFileName: structuredPatch.oldFileName,
+      newHeader: structuredPatch.oldHeader,
+      hunks: structuredPatch.hunks.map(function (hunk) {
+        return {
+          oldLines: hunk.newLines,
+          oldStart: hunk.newStart,
+          newLines: hunk.oldLines,
+          newStart: hunk.oldStart,
+          lines: hunk.lines.map(function (l) {
+            if (l.startsWith('-')) {
+              return (
+                /*istanbul ignore start*/
+                "+".concat(
+                /*istanbul ignore end*/
+                l.slice(1))
+              );
+            }
+            if (l.startsWith('+')) {
+              return (
+                /*istanbul ignore start*/
+                "-".concat(
+                /*istanbul ignore end*/
+                l.slice(1))
+              );
+            }
+            return l;
+          })
+        };
+      })
+    })
+  );
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyZXZlcnNlUGF0Y2giLCJzdHJ1Y3R1cmVkUGF0Y2giLCJBcnJheSIsImlzQXJyYXkiLCJtYXAiLCJyZXZlcnNlIiwiX29iamVjdFNwcmVhZCIsIm9sZEZpbGVOYW1lIiwibmV3RmlsZU5hbWUiLCJvbGRIZWFkZXIiLCJuZXdIZWFkZXIiLCJodW5rcyIsImh1bmsiLCJvbGRMaW5lcyIsIm5ld0xpbmVzIiwib2xkU3RhcnQiLCJuZXdTdGFydCIsImxpbmVzIiwibCIsInN0YXJ0c1dpdGgiLCJjb25jYXQiLC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QUFBQyxNQUFBO2dCQUFBO2dCQUFXRixDQUFDLENBQUNHLEtBQUssQ0FBQyxDQUFDLENBQUM7Y0FBQTtZQUFJO1lBQ2xELElBQUlILENBQUMsQ0FBQ0MsVUFBVSxDQUFDLEdBQUcsQ0FBQyxFQUFFO2NBQUU7Z0JBQUE7Z0JBQUEsSUFBQUMsTUFBQTtnQkFBQTtnQkFBV0YsQ0FBQyxDQUFDRyxLQUFLLENBQUMsQ0FBQyxDQUFDO2NBQUE7WUFBSTtZQUNsRCxPQUFPSCxDQUFDO1VBQ1YsQ0FBQztRQUNILENBQUM7TUFDSCxDQUFDO0lBQUM7RUFBQTtBQUVOIiwiaWdub3JlTGlzdCI6W119
diff --git a/node_modules/diff/lib/util/array.js b/node_modules/diff/lib/util/array.js
new file mode 100644
index 0000000..af10977
--- /dev/null
+++ b/node_modules/diff/lib/util/array.js
@@ -0,0 +1,27 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.arrayEqual = arrayEqual;
+exports.arrayStartsWith = arrayStartsWith;
+/*istanbul ignore end*/
+function arrayEqual(a, b) {
+  if (a.length !== b.length) {
+    return false;
+  }
+  return arrayStartsWith(a, b);
+}
+function arrayStartsWith(array, start) {
+  if (start.length > array.length) {
+    return false;
+  }
+  for (var i = 0; i < start.length; i++) {
+    if (start[i] !== array[i]) {
+      return false;
+    }
+  }
+  return true;
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJhcnJheUVxdWFsIiwiYSIsImIiLCJsZW5ndGgiLCJhcnJheVN0YXJ0c1dpdGgiLCJhcnJheSIsInN0YXJ0IiwiaSJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2FycmF5LmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBhcnJheUVxdWFsKGEsIGIpIHtcbiAgaWYgKGEubGVuZ3RoICE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01BQ3pCLE9BQU8sS0FBSztJQUNkO0VBQ0Y7RUFFQSxPQUFPLElBQUk7QUFDYiIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/util/distance-iterator.js b/node_modules/diff/lib/util/distance-iterator.js
new file mode 100644
index 0000000..6389373
--- /dev/null
+++ b/node_modules/diff/lib/util/distance-iterator.js
@@ -0,0 +1,54 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports["default"] = _default;
+/*istanbul ignore end*/
+// Iterator that traverses in the range of [min, max], stepping
+// by distance from a given start position. I.e. for [0, 4], with
+// start of 2, this will iterate 2, 3, 1, 4, 0.
+function
+/*istanbul ignore start*/
+_default
+/*istanbul ignore end*/
+(start, minLine, maxLine) {
+  var wantForward = true,
+    backwardExhausted = false,
+    forwardExhausted = false,
+    localOffset = 1;
+  return function iterator() {
+    if (wantForward && !forwardExhausted) {
+      if (backwardExhausted) {
+        localOffset++;
+      } else {
+        wantForward = false;
+      }
+
+      // Check if trying to fit beyond text length, and if not, check it fits
+      // after offset location (or desired location on first iteration)
+      if (start + localOffset <= maxLine) {
+        return start + localOffset;
+      }
+      forwardExhausted = true;
+    }
+    if (!backwardExhausted) {
+      if (!forwardExhausted) {
+        wantForward = true;
+      }
+
+      // Check if trying to fit before text beginning, and if not, check it fits
+      // before offset location
+      if (minLine <= start - localOffset) {
+        return start - localOffset++;
+      }
+      backwardExhausted = true;
+      return iterator();
+    }
+
+    // We tried to fit hunk before text beginning and beyond text length, then
+    // hunk can't fit on the text. Return undefined
+  };
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfZGVmYXVsdCIsInN0YXJ0IiwibWluTGluZSIsIm1heExpbmUiLCJ3YW50Rm9yd2FyZCIsImJhY2t3YXJkRXhoYXVzdGVkIiwiZm9yd2FyZEV4aGF1c3RlZCIsImxvY2FsT2Zmc2V0IiwiaXRl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sS0FBSztJQUN4QkMsV0FBVyxHQUFHLENBQUM7RUFFbkIsT0FBTyxTQUFTQyxRQUFRQSxDQUFBLEVBQUc7SUFDekIsSUFBSUosV0FBVyxJQUFJLENBQUNFLGdCQUFnQixFQUFFO01BQ3BDLElBQUlELGlCQUFpQixFQUFFO1FBQ3JCRSxXQUFXLEVBQUU7TUFDZixDQUFDLE1BQU07UUFDTEgsV0FBVyxHQUFHLEtBQUs7TUFDckI7O01BRUE7TUFDQTtNQUNBLElBQUlILEtBQUssR0FBR00sV0FBVyxJQUFJSixPQUFPLEVBQUU7UUFDbEMsT0FBT0YsS0FBSyxHQUFHTSxXQUFXO01BQzVCO01BRUFELGdCQUFnQixHQUFHLElBQUk7SUFDekI7SUFFQSxJQUFJLENBQUNELGlCQUFpQixFQUFFO01BQ3RCLElBQUksQ0FBQ0MsZ0JBQWdCLEVBQUU7UUFDckJGLFdBQVcsR0FBRyxJQUFJO01BQ3BCOztNQUVBO01BQ0E7TUFDQSxJQUFJRixPQUFPLElBQUlELEtBQUssR0FBR00sV0FBVyxFQUFFO1FBQ2xDLE9BQU9OLEtBQUssR0FBR00sV0FBVyxFQUFFO01BQzlCO01BRUFGLGlCQUFpQixHQUFHLElBQUk7TUFDeEIsT0FBT0csUUFBUSxDQUFDLENBQUM7SUFDbkI7O0lBRUE7SUFDQTtFQUNGLENBQUM7QUFDSCIsImlnbm9yZUxpc3QiOltdfQ==
diff --git a/node_modules/diff/lib/util/params.js b/node_modules/diff/lib/util/params.js
new file mode 100644
index 0000000..283c247
--- /dev/null
+++ b/node_modules/diff/lib/util/params.js
@@ -0,0 +1,22 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.generateOptions = generateOptions;
+/*istanbul ignore end*/
+function generateOptions(options, defaults) {
+  if (typeof options === 'function') {
+    defaults.callback = options;
+  } else if (options) {
+    for (var name in options) {
+      /* istanbul ignore else */
+      if (options.hasOwnProperty(name)) {
+        defaults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Q0FBQ0QsSUFBSSxDQUFDLEVBQUU7UUFDaENGLFFBQVEsQ0FBQ0UsSUFBSSxDQUFDLEdBQUdILE9BQU8sQ0FBQ0csSUFBSSxDQUFDO01BQ2hDO0lBQ0Y7RUFDRjtFQUNBLE9BQU9GLFFBQVE7QUFDakIiLCJpZ25vcmVMaXN0IjpbXX0=
diff --git a/node_modules/diff/lib/util/string.js b/node_modules/diff/lib/util/string.js
new file mode 100644
index 0000000..f81c682
--- /dev/null
+++ b/node_modules/diff/lib/util/string.js
@@ -0,0 +1,131 @@
+/*istanbul ignore start*/
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports.hasOnlyUnixLineEndings = hasOnlyUnixLineEndings;
+exports.hasOnlyWinLineEndings = hasOnlyWinLineEndings;
+exports.longestCommonPrefix = longestCommonPrefix;
+exports.longestCommonSuffix = longestCommonSuffix;
+exports.maximumOverlap = maximumOverlap;
+exports.removePrefix = removePrefix;
+exports.removeSuffix = removeSuffix;
+exports.replacePrefix = replacePrefix;
+exports.replaceSuffix = replaceSuffix;
+/*istanbul ignore end*/
+function longestCommonPrefix(str1, str2) {
+  var i;
+  for (i = 0; i < str1.length && i < str2.length; i++) {
+    if (str1[i] != str2[i]) {
+      return str1.slice(0, i);
+    }
+  }
+  return str1.slice(0, i);
+}
+function longestCommonSuffix(str1, str2) {
+  var i;
+
+  // Unlike longestCommonPrefix, we need a special case to handle all scenarios
+  // where we return the empty string since str1.slice(-0) will return the
+  // entire string.
+  if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
+    return '';
+  }
+  for (i = 0; i < str1.length && i < str2.length; i++) {
+    if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
+      return str1.slice(-i);
+    }
+  }
+  return str1.slice(-i);
+}
+function replacePrefix(string, oldPrefix, newPrefix) {
+  if (string.slice(0, oldPrefix.length) != oldPrefix) {
+    throw Error(
+    /*istanbul ignore start*/
+    "string ".concat(
+    /*istanbul ignore end*/
+    JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug"));
+  }
+  return newPrefix + string.slice(oldPrefix.length);
+}
+function replaceSuffix(string, oldSuffix, newSuffix) {
+  if (!oldSuffix) {
+    return string + newSuffix;
+  }
+  if (string.slice(-oldSuffix.length) != oldSuffix) {
+    throw Error(
+    /*istanbul ignore start*/
+    "string ".concat(
+    /*istanbul ignore end*/
+    JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug"));
+  }
+  return string.slice(0, -oldSuffix.length) + newSuffix;
+}
+function removePrefix(string, oldPrefix) {
+  return replacePrefix(string, oldPrefix, '');
+}
+function removeSuffix(string, oldSuffix) {
+  return replaceSuffix(string, oldSuffix, '');
+}
+function maximumOverlap(string1, string2) {
+  return string2.slice(0, overlapCount(string1, string2));
+}
+
+// Nicked from https://stackoverflow.com/a/60422853/1709587
+function overlapCount(a, b) {
+  // Deal with cases where the strings differ in length
+  var startA = 0;
+  if (a.length > b.length) {
+    startA = a.length - b.length;
+  }
+  var endB = b.length;
+  if (a.length < b.length) {
+    endB = a.length;
+  }
+  // Create a back-reference for each index
+  //   that should be followed in case of a mismatch.
+  //   We only need B to make these references:
+  var map = Array(endB);
+  var k = 0; // Index that lags behind j
+  map[0] = 0;
+  for (var j = 1; j < endB; j++) {
+    if (b[j] == b[k]) {
+      map[j] = map[k]; // skip over the same character (optional optimisation)
+    } else {
+      map[j] = k;
+    }
+    while (k > 0 && b[j] != b[k]) {
+      k = map[k];
+    }
+    if (b[j] == b[k]) {
+      k++;
+    }
+  }
+  // Phase 2: use these references while iterating over A
+  k = 0;
+  for (var i = startA; i < a.length; i++) {
+    while (k > 0 && a[i] != b[k]) {
+      k = map[k];
+    }
+    if (a[i] == b[k]) {
+      k++;
+    }
+  }
+  return k;
+}
+
+/**
+ * Returns true if the string consistently uses Windows line endings.
+ */
+function hasOnlyWinLineEndings(string) {
+  return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/);
+}
+
+/**
+ * Returns true if the string consistently uses Unix line endings.
+ */
+function hasOnlyUnixLineEndings(string) {
+  return !string.includes('\r\n') && string.includes('\n');
+}
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJsb25nZXN0Q29tbW9uUHJlZml4Iiwic3RyMSIsInN0cjIiLCJpIiwibGVuZ3RoIiwic2xpY2UiLCJsb25nZXN0Q29tbW9uU3VmZml4IiwicmVwbGFjZVByZWZpeCIsInN0cmluZyIsIm9sZFByZWZpeCIsIm5ld1ByZWZpeCIsIkVycm9yIiwiY29uY2F0IiwiSlNPTiIsInN0cmluZ2lmeSIsInJlcGxhY2VTdWZmaXgiLCJvbGRTdWZmaXgiLCJuZXdTdWZmaXgiLCJyZW1vdmVQcmVmaXgiLCJyZW1vdmVTdWZmaXgiLCJtYXhpbXVtT3ZlcmxhcCIsInN0cmluZzEiLCJzdHJpbmcyIiwib3ZlcmxhcENvdW50IiwiYSIsImIiLCJzdGFydEEiLCJlbmRCIiwibWFwIiwiQXJyYXkiLCJrIiwiaiIsImhhc09ubHlXaW5MaW5lRW5kaW5ncyIsImluY2x1ZGVzIiwic3RhcnRzV2l0aCIsIm1hdGNoIiwiaGFzT25seVVuaXhMaW5lRW5kaW5ncyJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3N0cmluZy5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gbG9uZ2VzdENvbW1vblByZWZpeChzdHIxLCBzdHIyKSB7XG4gIGxldCBpO1xuICBmb3IgKGkgPSAwOyBpIDwgc3RyMS5sZW5ndGggJiYgaSA8IHN0cjIubGVuZ3RoOyBpKyspIHtcbiAgICBpZiAoc3RyMVtpXSAhPSBzdHIyW2ldKSB7XG4gICAgICByZXR1cm4gc3RyMS5zbGljZSgwLCBpKTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHN0cjEuc2x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xDQUFDLEdBQUdGLEdBQUcsQ0FBQ0UsQ0FBQyxDQUFDO0lBQUU7SUFDNUMsSUFBSU4sQ0FBQyxDQUFDckIsQ0FBQyxDQUFDLElBQUlzQixDQUFDLENBQUNLLENBQUMsQ0FBQyxFQUFFO01BQUVBLENBQUMsRUFBRTtJQUFFO0VBQzdCO0VBQ0EsT0FBT0EsQ0FBQztBQUNWOztBQUdBO0FBQ0E7QUFDQTtBQUNPLFNBQVNFLHFCQUFxQkEsQ0FBQ3hCLE1BQU0sRUFBRTtFQUM1QyxPQUFPQSxNQUFNLENBQUN5QixRQUFRLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQ3pCLE1BQU0sQ0FBQzBCLFVBQVUsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDMUIsTUFBTSxDQUFDMkIsS0FBSyxDQUFDLFNBQVMsQ0FBQztBQUN4Rjs7QUFFQTtBQUNBO0FBQ0E7QUFDTyxTQUFTQyxzQkFBc0JBLENBQUM1QixNQUFNLEVBQUU7RUFDN0MsT0FBTyxDQUFDQSxNQUFNLENBQUN5QixRQUFRLENBQUMsTUFBTSxDQUFDLElBQUl6QixNQUFNLENBQUN5QixRQUFRLENBQUMsSUFBSSxDQUFDO0FBQzFEIiwiaWdub3JlTGlzdCI6W119
diff --git a/node_modules/diff/package.json b/node_modules/diff/package.json
new file mode 100644
index 0000000..400c8dd
--- /dev/null
+++ b/node_modules/diff/package.json
@@ -0,0 +1,88 @@
+{
+  "name": "diff",
+  "version": "7.0.0",
+  "description": "A JavaScript text diff implementation.",
+  "keywords": [
+    "diff",
+    "jsdiff",
+    "compare",
+    "patch",
+    "text",
+    "json",
+    "css",
+    "javascript"
+  ],
+  "maintainers": [
+    "Kevin Decker  (http://incaseofstairs.com)",
+    "Mark Amery "
+  ],
+  "bugs": {
+    "email": "kpdecker@gmail.com",
+    "url": "http://github.com/kpdecker/jsdiff/issues"
+  },
+  "license": "BSD-3-Clause",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/kpdecker/jsdiff.git"
+  },
+  "engines": {
+    "node": ">=0.3.1"
+  },
+  "main": "./lib/index.js",
+  "module": "./lib/index.es6.js",
+  "browser": "./dist/diff.js",
+  "unpkg": "./dist/diff.js",
+  "exports": {
+    ".": {
+      "import": "./lib/index.mjs",
+      "require": "./lib/index.js"
+    },
+    "./package.json": "./package.json",
+    "./": "./",
+    "./*": "./*"
+  },
+  "scripts": {
+    "clean": "rm -rf lib/ dist/",
+    "build:node": "yarn babel --out-dir lib  --source-maps=inline src",
+    "test": "grunt"
+  },
+  "devDependencies": {
+    "@babel/cli": "^7.24.1",
+    "@babel/core": "^7.24.1",
+    "@babel/plugin-transform-modules-commonjs": "^7.24.1",
+    "@babel/preset-env": "^7.24.1",
+    "@babel/register": "^7.23.7",
+    "@colors/colors": "^1.6.0",
+    "babel-eslint": "^10.0.1",
+    "babel-loader": "^9.1.3",
+    "chai": "^4.2.0",
+    "eslint": "^5.12.0",
+    "grunt": "^1.6.1",
+    "grunt-babel": "^8.0.0",
+    "grunt-cli": "^1.4.3",
+    "grunt-contrib-clean": "^2.0.1",
+    "grunt-contrib-copy": "^1.0.0",
+    "grunt-contrib-uglify": "^5.2.2",
+    "grunt-contrib-watch": "^1.1.0",
+    "grunt-eslint": "^24.3.0",
+    "grunt-exec": "^3.0.0",
+    "grunt-karma": "^4.0.2",
+    "grunt-mocha-istanbul": "^5.0.2",
+    "grunt-mocha-test": "^0.13.3",
+    "grunt-webpack": "^6.0.0",
+    "istanbul": "github:kpdecker/istanbul",
+    "karma": "^6.4.3",
+    "karma-chrome-launcher": "^3.2.0",
+    "karma-mocha": "^2.0.1",
+    "karma-mocha-reporter": "^2.2.5",
+    "karma-sourcemap-loader": "^0.4.0",
+    "karma-webpack": "^5.0.1",
+    "mocha": "^7.0.0",
+    "rollup": "^4.13.0",
+    "rollup-plugin-babel": "^4.2.0",
+    "semver": "^7.6.0",
+    "webpack": "^5.90.3",
+    "webpack-dev-server": "^5.0.3"
+  },
+  "optionalDependencies": {}
+}
diff --git a/node_modules/diff/release-notes.md b/node_modules/diff/release-notes.md
new file mode 100644
index 0000000..21b5d41
--- /dev/null
+++ b/node_modules/diff/release-notes.md
@@ -0,0 +1,361 @@
+# Release Notes
+
+## 7.0.0
+
+Just a single (breaking) bugfix, undoing a behaviour change introduced accidentally in 6.0.0:
+
+- [#554](https://github.com/kpdecker/jsdiff/pull/554) **`diffWords` treats numbers and underscores as word characters again.** This behaviour was broken in v6.0.0.
+
+## 6.0.0
+
+This is a release containing many, *many* breaking changes. The objective of this release was to carry out a mass fix, in one go, of all the open bugs and design problems that required breaking changes to fix. A substantial, but exhaustive, changelog is below.
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v5.2.0...v6.0.0)
+
+- [#497](https://github.com/kpdecker/jsdiff/pull/497) **`diffWords` behavior has been radically changed.** Previously, even with `ignoreWhitespace: true`, runs of whitespace were tokens, which led to unhelpful and unintuitive diffing behavior in typical texts. Specifically, even when two texts contained overlapping passages, `diffWords` would sometimes choose to delete all the words from the old text and insert them anew in their new positions in order to avoid having to delete or insert whitespace tokens. Whitespace sequences are no longer tokens as of this release, which affects both the generated diffs and the `count`s.
+
+  Runs of whitespace are still tokens in `diffWordsWithSpace`.
+
+  As part of the changes to `diffWords`, **a new `.postProcess` method has been added on the base `Diff` type**, which can be overridden in custom `Diff` implementations.
+
+  **`diffLines` with `ignoreWhitespace: true` will no longer ignore the insertion or deletion of entire extra lines of whitespace at the end of the text**. Previously, these would not show up as insertions or deletions, as a side effect of a hack in the base diffing algorithm meant to help ignore whitespace in `diffWords`. More generally, **the undocumented special handling in the core algorithm for ignored terminals has been removed entirely.** (This special case behavior used to rewrite the final two change objects in a scenario where the final change object was an addition or deletion and its `value` was treated as equal to the empty string when compared using the diff object's `.equals` method.)
+
+- [#500](https://github.com/kpdecker/jsdiff/pull/500) **`diffChars` now diffs Unicode code points** instead of UTF-16 code units.
+- [#508](https://github.com/kpdecker/jsdiff/pull/508) **`parsePatch` now always runs in what was previously "strict" mode; the undocumented `strict` option has been removed.** Previously, by default, `parsePatch` (and other patch functions that use it under the hood to parse patches) would accept a patch where the line counts in the headers were inconsistent with the actual patch content - e.g. where a hunk started with the header `@@ -1,3 +1,6 @@`, indicating that the content below spanned 3 lines in the old file and 6 lines in the new file, but then the actual content below the header consisted of some different number of lines, say 10 lines of context, 5 deletions, and 1 insertion. Actually trying to work with these patches using `applyPatch` or `merge`, however, would produce incorrect results instead of just ignoring the incorrect headers, making this "feature" more of a trap than something actually useful. It's been ripped out, and now we are always "strict" and will reject patches where the line counts in the headers aren't consistent with the actual patch content.
+- [#435](https://github.com/kpdecker/jsdiff/pull/435) **Fix `parsePatch` handling of control characters.** `parsePatch` used to interpret various unusual control characters - namely vertical tabs, form feeds, lone carriage returns without a line feed, and EBCDIC NELs - as line breaks when parsing a patch file. This was inconsistent with the behavior of both JsDiff's own `diffLines` method and also the Unix `diff` and `patch` utils, which all simply treat those control characters as ordinary characters. The result of this discrepancy was that some well-formed patches - produced either by `diff` or by JsDiff itself and handled properly by the `patch` util - would be wrongly parsed by `parsePatch`, with the effect that it would disregard the remainder of a hunk after encountering one of these control characters.
+- [#439](https://github.com/kpdecker/jsdiff/pull/439) **Prefer diffs that order deletions before insertions.** When faced with a choice between two diffs with an equal total edit distance, the Myers diff algorithm generally prefers one that does deletions before insertions rather than insertions before deletions. For instance, when diffing `abcd` against `acbd`, it will prefer a diff that says to delete the `b` and then insert a new `b` after the `c`, over a diff that says to insert a `c` before the `b` and then delete the existing `c`. JsDiff deviated from the published Myers algorithm in a way that led to it having the opposite preference in many cases, including that example. This is now fixed, meaning diffs output by JsDiff will more accurately reflect what the published Myers diff algorithm would output.
+- [#455](https://github.com/kpdecker/jsdiff/pull/455) **The `added` and `removed` properties of change objects are now guaranteed to be set to a boolean value.** (Previously, they would be set to `undefined` or omitted entirely instead of setting them to false.)
+- [#464](https://github.com/kpdecker/jsdiff/pull/464) Specifying `{maxEditLength: 0}` now sets a max edit length of 0 instead of no maximum.
+- [#460](https://github.com/kpdecker/jsdiff/pull/460) **Added `oneChangePerToken` option.**
+- [#467](https://github.com/kpdecker/jsdiff/pull/467) **Consistent ordering of arguments to `comparator(left, right)`.** Values from the old array will now consistently be passed as the first argument (`left`) and values from the new array as the second argument (`right`). Previously this was almost (but not quite) always the other way round.
+- [#480](https://github.com/kpdecker/jsdiff/pull/480) **Passing `maxEditLength` to `createPatch` & `createTwoFilesPatch` now works properly** (i.e. returns undefined if the max edit distance is exceeded; previous behavior was to crash with a `TypeError` if the edit distance was exceeded).
+- [#486](https://github.com/kpdecker/jsdiff/pull/486) **The `ignoreWhitespace` option of `diffLines` behaves more sensibly now.** `value`s in returned change objects now include leading/trailing whitespace even when `ignoreWhitespace` is used, just like how with `ignoreCase` the `value`s still reflect the case of one of the original texts instead of being all-lowercase. `ignoreWhitespace` is also now compatible with `newlineIsToken`. Finally, **`diffTrimmedLines` is deprecated** (and removed from the docs) in favour of using `diffLines` with `ignoreWhitespace: true`; the two are, and always have been, equivalent.
+- [#490](https://github.com/kpdecker/jsdiff/pull/490) **When calling diffing functions in async mode by passing a `callback` option, the diff result will now be passed as the *first* argument to the callback instead of the second.** (Previously, the first argument was never used at all and would always have value `undefined`.)
+- [#489](github.com/kpdecker/jsdiff/pull/489) **`this.options` no longer exists on `Diff` objects.** Instead, `options` is now passed as an argument to methods that rely on options, like `equals(left, right, options)`. This fixes a race condition in async mode, where diffing behaviour could be changed mid-execution if a concurrent usage of the same `Diff` instances overwrote its `options`.
+- [#518](https://github.com/kpdecker/jsdiff/pull/518) **`linedelimiters` no longer exists** on patch objects; instead, when a patch with Windows-style CRLF line endings is parsed, **the lines in `lines` will end with `\r`**. There is now a **new `autoConvertLineEndings` option, on by default**, which makes it so that when a patch with Windows-style line endings is applied to a source file with Unix style line endings, the patch gets autoconverted to use Unix-style line endings, and when a patch with Unix-style line endings is applied to a source file with Windows-style line endings, it gets autoconverted to use Windows-style line endings.
+- [#521](https://github.com/kpdecker/jsdiff/pull/521) **the `callback` option is now supported by `structuredPatch`, `createPatch
+- [#529](https://github.com/kpdecker/jsdiff/pull/529) **`parsePatch` can now parse patches where lines starting with `--` or `++` are deleted/inserted**; previously, there were edge cases where the parser would choke on valid patches or give wrong results.
+- [#530](https://github.com/kpdecker/jsdiff/pull/530) **Added `ignoreNewlineAtEof` option` to `diffLines`**
+- [#533](https://github.com/kpdecker/jsdiff/pull/533) **`applyPatch` uses an entirely new algorithm for fuzzy matching.** Differences between the old and new algorithm are as follows:
+  * The `fuzzFactor` now indicates the maximum [*Levenshtein* distance](https://en.wikipedia.org/wiki/Levenshtein_distance) that there can be between the context shown in a hunk and the actual file content at a location where we try to apply the hunk. (Previously, it represented a maximum [*Hamming* distance](https://en.wikipedia.org/wiki/Hamming_distance), meaning that a single insertion or deletion in the source file could stop a hunk from applying even with a high `fuzzFactor`.)
+  * A hunk containing a deletion can now only be applied in a context where the line to be deleted actually appears verbatim. (Previously, as long as enough context lines in the hunk matched, `applyPatch` would apply the hunk anyway and delete a completely different line.)
+  * The context line immediately before and immediately after an insertion must match exactly between the hunk and the file for a hunk to apply. (Previously this was not required.)
+- [#535](https://github.com/kpdecker/jsdiff/pull/535) **A bug in patch generation functions is now fixed** that would sometimes previously cause `\ No newline at end of file` to appear in the wrong place in the generated patch, resulting in the patch being invalid.
+- [#535](https://github.com/kpdecker/jsdiff/pull/535) **Passing `newlineIsToken: true` to *patch*-generation functions is no longer allowed.** (Passing it to `diffLines` is still supported - it's only functions like `createPatch` where passing `newlineIsToken` is now an error.) Allowing it to be passed never really made sense, since in cases where the option had any effect on the output at all, the effect tended to be causing a garbled patch to be created that couldn't actually be applied to the source file.
+- [#539](https://github.com/kpdecker/jsdiff/pull/539) **`diffWords` now takes an optional `intlSegmenter` option** which should be an `Intl.Segmenter` with word-level granularity. This provides better tokenization of text into words than the default behaviour, even for English but especially for some other languages for which the default behaviour is poor.
+
+## v5.2.0
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v5.1.0...v5.2.0)
+
+- [#411](https://github.com/kpdecker/jsdiff/pull/411) Big performance improvement. Previously an O(n) array-copying operation inside the innermost loop of jsdiff's base diffing code increased the overall worst-case time complexity of computing a diff from O(n²) to O(n³). This is now fixed, bringing the worst-case time complexity down to what it theoretically should be for a Myers diff implementation.
+- [#448](https://github.com/kpdecker/jsdiff/pull/411) Performance improvement. Diagonals whose furthest-reaching D-path would go off the edge of the edit graph are now skipped, rather than being pointlessly considered as called for by the original Myers diff algorithm. This dramatically speeds up computing diffs where the new text just appends or truncates content at the end of the old text.
+- [#351](https://github.com/kpdecker/jsdiff/issues/351) Importing from the lib folder - e.g. `require("diff/lib/diff/word.js")` - will work again now. This had been broken for users on the latest version of Node since Node 17.5.0, which changed how Node interprets the `exports` property in jsdiff's `package.json` file.
+- [#344](https://github.com/kpdecker/jsdiff/issues/344) `diffLines`, `createTwoFilesPatch`, and other patch-creation methods now take an optional `stripTrailingCr: true` option which causes Windows-style `\r\n` line endings to be replaced with Unix-style `\n` line endings before calculating the diff, just like GNU `diff`'s `--strip-trailing-cr` flag.
+- [#451](https://github.com/kpdecker/jsdiff/pull/451) Added `diff.formatPatch`.
+- [#450](https://github.com/kpdecker/jsdiff/pull/450) Added `diff.reversePatch`.
+- [#478](https://github.com/kpdecker/jsdiff/pull/478) Added `timeout` option.
+
+## v5.1.0
+
+- [#365](https://github.com/kpdecker/jsdiff/issues/365) Allow early termination to limit execution time with degenerate cases
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v5.0.0...v5.1.0)
+
+## v5.0.0
+
+- Breaking: UMD export renamed from `JsDiff` to `Diff`.
+- Breaking: Newlines separated into separate tokens for word diff.
+- Breaking: Unified diffs now match ["quirks"](https://www.artima.com/weblogs/viewpost.jsp?thread=164293)
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v4.0.1...v5.0.0)
+
+## v4.0.1 - January 6th, 2019
+
+- Fix main reference path - b826104
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v4.0.0...v4.0.1)
+
+## v4.0.0 - January 5th, 2019
+
+- [#94](https://github.com/kpdecker/jsdiff/issues/94) - Missing "No newline at end of file" when comparing two texts that do not end in newlines ([@federicotdn](https://api.github.com/users/federicotdn))
+- [#227](https://github.com/kpdecker/jsdiff/issues/227) - Licence
+- [#199](https://github.com/kpdecker/jsdiff/issues/199) - Import statement for jsdiff
+- [#159](https://github.com/kpdecker/jsdiff/issues/159) - applyPatch affecting wrong line number with with new lines
+- [#8](https://github.com/kpdecker/jsdiff/issues/8) - A new state "replace"
+- Drop ie9 from karma targets - 79c31bd
+- Upgrade deps. Convert from webpack to rollup - 2c1a29c
+- Make ()[]"' as word boundaries between each other - f27b899
+- jsdiff: Replaced phantomJS by chrome - ec3114e
+- Add yarn.lock to .npmignore - 29466d8
+
+Compatibility notes:
+
+- Bower and Component packages no longer supported
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.5.0...v4.0.0)
+
+## v3.5.0 - March 4th, 2018
+
+- Omit redundant slice in join method of diffArrays - 1023590
+- Support patches with empty lines - fb0f208
+- Accept a custom JSON replacer function for JSON diffing - 69c7f0a
+- Optimize parch header parser - 2aec429
+- Fix typos - e89c832
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.4.0...v3.5.0)
+
+## v3.4.0 - October 7th, 2017
+
+- [#183](https://github.com/kpdecker/jsdiff/issues/183) - Feature request: ability to specify a custom equality checker for `diffArrays`
+- [#173](https://github.com/kpdecker/jsdiff/issues/173) - Bug: diffArrays gives wrong result on array of booleans
+- [#158](https://github.com/kpdecker/jsdiff/issues/158) - diffArrays will not compare the empty string in array?
+- comparator for custom equality checks - 30e141e
+- count oldLines and newLines when there are conflicts - 53bf384
+- Fix: diffArrays can compare falsey items - 9e24284
+- Docs: Replace grunt with npm test - 00e2f94
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.3.1...v3.4.0)
+
+## v3.3.1 - September 3rd, 2017
+
+- [#141](https://github.com/kpdecker/jsdiff/issues/141) - Cannot apply patch because my file delimiter is "/r/n" instead of "/n"
+- [#192](https://github.com/kpdecker/jsdiff/pull/192) - Fix: Bad merge when adding new files (#189)
+- correct spelling mistake - 21fa478
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.3.0...v3.3.1)
+
+## v3.3.0 - July 5th, 2017
+
+- [#114](https://github.com/kpdecker/jsdiff/issues/114) - /patch/merge not exported
+- Gracefully accept invalid newStart in hunks, same as patch(1) does. - d8a3635
+- Use regex rather than starts/ends with for parsePatch - 6cab62c
+- Add browser flag - e64f674
+- refactor: simplified code a bit more - 8f8e0f2
+- refactor: simplified code a bit - b094a6f
+- fix: some corrections re ignoreCase option - 3c78fd0
+- ignoreCase option - 3cbfbb5
+- Sanitize filename while parsing patches - 2fe8129
+- Added better installation methods - aced50b
+- Simple export of functionality - 8690f31
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.2.0...v3.3.0)
+
+## v3.2.0 - December 26th, 2016
+
+- [#156](https://github.com/kpdecker/jsdiff/pull/156) - Add `undefinedReplacement` option to `diffJson` ([@ewnd9](https://api.github.com/users/ewnd9))
+- [#154](https://github.com/kpdecker/jsdiff/pull/154) - Add `examples` and `images` to `.npmignore`. ([@wtgtybhertgeghgtwtg](https://api.github.com/users/wtgtybhertgeghgtwtg))
+- [#153](https://github.com/kpdecker/jsdiff/pull/153) - feat(structuredPatch): Pass options to diffLines ([@Kiougar](https://api.github.com/users/Kiougar))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.1.0...v3.2.0)
+
+## v3.1.0 - November 27th, 2016
+
+- [#146](https://github.com/kpdecker/jsdiff/pull/146) - JsDiff.diffArrays to compare arrays ([@wvanderdeijl](https://api.github.com/users/wvanderdeijl))
+- [#144](https://github.com/kpdecker/jsdiff/pull/144) - Split file using all possible line delimiter instead of hard-coded "/n" and join lines back using the original delimiters ([@soulbeing](https://api.github.com/users/soulbeing))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.0.1...v3.1.0)
+
+## v3.0.1 - October 9th, 2016
+
+- [#139](https://github.com/kpdecker/jsdiff/pull/139) - Make README.md look nicer in npmjs.com ([@takenspc](https://api.github.com/users/takenspc))
+- [#135](https://github.com/kpdecker/jsdiff/issues/135) - parsePatch combines patches from multiple files into a single IUniDiff when there is no "Index" line ([@ramya-rao-a](https://api.github.com/users/ramya-rao-a))
+- [#124](https://github.com/kpdecker/jsdiff/issues/124) - IE7/IE8 failure since 2.0.0 ([@boneskull](https://api.github.com/users/boneskull))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v3.0.0...v3.0.1)
+
+## v3.0.0 - August 23rd, 2016
+
+- [#130](https://github.com/kpdecker/jsdiff/pull/130) - Add callback argument to applyPatches `patched` option ([@piranna](https://api.github.com/users/piranna))
+- [#120](https://github.com/kpdecker/jsdiff/pull/120) - Correctly handle file names containing spaces ([@adius](https://api.github.com/users/adius))
+- [#119](https://github.com/kpdecker/jsdiff/pull/119) - Do single reflow ([@wifiextender](https://api.github.com/users/wifiextender))
+- [#117](https://github.com/kpdecker/jsdiff/pull/117) - Make more usable with long strings. ([@abnbgist](https://api.github.com/users/abnbgist))
+
+Compatibility notes:
+
+- applyPatches patch callback now is async and requires the callback be called to continue operation
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.3...v3.0.0)
+
+## v2.2.3 - May 31st, 2016
+
+- [#118](https://github.com/kpdecker/jsdiff/pull/118) - Add a fix for applying 0-length destination patches ([@chaaz](https://api.github.com/users/chaaz))
+- [#115](https://github.com/kpdecker/jsdiff/pull/115) - Fixed grammar in README ([@krizalys](https://api.github.com/users/krizalys))
+- [#113](https://github.com/kpdecker/jsdiff/pull/113) - fix typo ([@vmazare](https://api.github.com/users/vmazare))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.2...v2.2.3)
+
+## v2.2.2 - March 13th, 2016
+
+- [#102](https://github.com/kpdecker/jsdiff/issues/102) - diffJson with dates, returns empty curly braces ([@dr-dimitru](https://api.github.com/users/dr-dimitru))
+- [#97](https://github.com/kpdecker/jsdiff/issues/97) - Whitespaces & diffWords ([@faiwer](https://api.github.com/users/faiwer))
+- [#92](https://github.com/kpdecker/jsdiff/pull/92) - Fixes typo in the readme ([@bg451](https://api.github.com/users/bg451))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.1...v2.2.2)
+
+## v2.2.1 - November 12th, 2015
+
+- [#89](https://github.com/kpdecker/jsdiff/pull/89) - add in display selector to readme ([@FranDias](https://api.github.com/users/FranDias))
+- [#88](https://github.com/kpdecker/jsdiff/pull/88) - Split diffs based on file headers instead of 'Index:' metadata ([@piranna](https://api.github.com/users/piranna))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.0...v2.2.1)
+
+## v2.2.0 - October 29th, 2015
+
+- [#80](https://github.com/kpdecker/jsdiff/pull/80) - Fix a typo: applyPath -> applyPatch ([@fluxxu](https://api.github.com/users/fluxxu))
+- [#83](https://github.com/kpdecker/jsdiff/pull/83) - Add basic fuzzy matching to applyPatch ([@piranna](https://github.com/piranna))
+  [Commits](https://github.com/kpdecker/jsdiff/compare/v2.2.0...v2.2.0)
+
+## v2.2.0 - October 29th, 2015
+
+- [#80](https://github.com/kpdecker/jsdiff/pull/80) - Fix a typo: applyPath -> applyPatch ([@fluxxu](https://api.github.com/users/fluxxu))
+- [#83](https://github.com/kpdecker/jsdiff/pull/83) - Add basic fuzzy matching to applyPatch ([@piranna](https://github.com/piranna))
+  [Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.3...v2.2.0)
+
+## v2.1.3 - September 30th, 2015
+
+- [#78](https://github.com/kpdecker/jsdiff/pull/78) - fix: error throwing when apply patch to empty string ([@21paradox](https://api.github.com/users/21paradox))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.2...v2.1.3)
+
+## v2.1.2 - September 23rd, 2015
+
+- [#76](https://github.com/kpdecker/jsdiff/issues/76) - diff headers give error ([@piranna](https://api.github.com/users/piranna))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.1...v2.1.2)
+
+## v2.1.1 - September 9th, 2015
+
+- [#73](https://github.com/kpdecker/jsdiff/issues/73) - Is applyPatches() exposed in the API? ([@davidparsson](https://api.github.com/users/davidparsson))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.1.0...v2.1.1)
+
+## v2.1.0 - August 27th, 2015
+
+- [#72](https://github.com/kpdecker/jsdiff/issues/72) - Consider using options object API for flag permutations ([@kpdecker](https://api.github.com/users/kpdecker))
+- [#70](https://github.com/kpdecker/jsdiff/issues/70) - diffWords treats \n at the end as significant whitespace ([@nesQuick](https://api.github.com/users/nesQuick))
+- [#69](https://github.com/kpdecker/jsdiff/issues/69) - Missing count ([@wfalkwallace](https://api.github.com/users/wfalkwallace))
+- [#68](https://github.com/kpdecker/jsdiff/issues/68) - diffLines seems broken ([@wfalkwallace](https://api.github.com/users/wfalkwallace))
+- [#60](https://github.com/kpdecker/jsdiff/issues/60) - Support multiple diff hunks ([@piranna](https://api.github.com/users/piranna))
+- [#54](https://github.com/kpdecker/jsdiff/issues/54) - Feature Request: 3-way merge ([@mog422](https://api.github.com/users/mog422))
+- [#42](https://github.com/kpdecker/jsdiff/issues/42) - Fuzz factor for applyPatch ([@stuartpb](https://api.github.com/users/stuartpb))
+- Move whitespace ignore out of equals method - 542063c
+- Include source maps in babel output - 7f7ab21
+- Merge diff/line and diff/patch implementations - 1597705
+- Drop map utility method - 1ddc939
+- Documentation for parsePatch and applyPatches - 27c4b77
+
+Compatibility notes:
+
+- The undocumented ignoreWhitespace flag has been removed from the Diff equality check directly. This implementation may be copied to diff utilities if dependencies existed on this functionality.
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.2...v2.1.0)
+
+## v2.0.2 - August 8th, 2015
+
+- [#67](https://github.com/kpdecker/jsdiff/issues/67) - cannot require from npm module in node ([@commenthol](https://api.github.com/users/commenthol))
+- Convert to chai since we don’t support IE8 - a96bbad
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.1...v2.0.2)
+
+## v2.0.1 - August 7th, 2015
+
+- Add release build at proper step - 57542fd
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v2.0.0...v2.0.1)
+
+## v2.0.0 - August 7th, 2015
+
+- [#66](https://github.com/kpdecker/jsdiff/issues/66) - Add karma and sauce tests ([@kpdecker](https://api.github.com/users/kpdecker))
+- [#65](https://github.com/kpdecker/jsdiff/issues/65) - Create component repository for bower ([@kpdecker](https://api.github.com/users/kpdecker))
+- [#64](https://github.com/kpdecker/jsdiff/issues/64) - Automatically call removeEmpty for all tokenizer calls ([@kpdecker](https://api.github.com/users/kpdecker))
+- [#62](https://github.com/kpdecker/jsdiff/pull/62) - Allow access to structured object representation of patch data ([@bittrance](https://api.github.com/users/bittrance))
+- [#61](https://github.com/kpdecker/jsdiff/pull/61) - Use svg instead of png to get better image quality ([@PeterDaveHello](https://api.github.com/users/PeterDaveHello))
+- [#29](https://github.com/kpdecker/jsdiff/issues/29) - word tokenizer works only for 7 bit ascii ([@plasmagunman](https://api.github.com/users/plasmagunman))
+
+Compatibility notes:
+
+- `this.removeEmpty` is now called automatically for all instances. If this is not desired, this may be overridden on a per instance basis.
+- The library has been refactored to use some ES6 features. The external APIs should remain the same, but bower projects that directly referenced the repository will now have to point to the [components/jsdiff](https://github.com/components/jsdiff) repository.
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.4.0...v2.0.0)
+
+## v1.4.0 - May 6th, 2015
+
+- [#57](https://github.com/kpdecker/jsdiff/issues/57) - createPatch -> applyPatch failed. ([@mog422](https://api.github.com/users/mog422))
+- [#56](https://github.com/kpdecker/jsdiff/pull/56) - Two files patch ([@rgeissert](https://api.github.com/users/rgeissert))
+- [#14](https://github.com/kpdecker/jsdiff/issues/14) - Flip added and removed order? ([@jakesandlund](https://api.github.com/users/jakesandlund))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.2...v1.4.0)
+
+## v1.3.2 - March 30th, 2015
+
+- [#53](https://github.com/kpdecker/jsdiff/pull/53) - Updated README.MD with Bower installation instructions ([@ofbriggs](https://api.github.com/users/ofbriggs))
+- [#49](https://github.com/kpdecker/jsdiff/issues/49) - Cannot read property 'oldlines' of undefined ([@nwtn](https://api.github.com/users/nwtn))
+- [#44](https://github.com/kpdecker/jsdiff/issues/44) - invalid-meta jsdiff is missing "main" entry in bower.json
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.1...v1.3.2)
+
+## v1.3.1 - March 13th, 2015
+
+- [#52](https://github.com/kpdecker/jsdiff/pull/52) - Fix for #51 Wrong result of JsDiff.diffLines ([@felicienfrancois](https://api.github.com/users/felicienfrancois))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.3.0...v1.3.1)
+
+## v1.3.0 - March 2nd, 2015
+
+- [#47](https://github.com/kpdecker/jsdiff/pull/47) - Adding Diff Trimmed Lines ([@JamesGould123](https://api.github.com/users/JamesGould123))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.2...v1.3.0)
+
+## v1.2.2 - January 26th, 2015
+
+- [#45](https://github.com/kpdecker/jsdiff/pull/45) - Fix AMD module loading ([@pedrocarrico](https://api.github.com/users/pedrocarrico))
+- [#43](https://github.com/kpdecker/jsdiff/pull/43) - added a bower file ([@nbrustein](https://api.github.com/users/nbrustein))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.1...v1.2.2)
+
+## v1.2.1 - December 26th, 2014
+
+- [#41](https://github.com/kpdecker/jsdiff/pull/41) - change condition of using node export system. ([@ironhee](https://api.github.com/users/ironhee))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.2.0...v1.2.1)
+
+## v1.2.0 - November 29th, 2014
+
+- [#37](https://github.com/kpdecker/jsdiff/pull/37) - Add support for sentences. ([@vmariano](https://api.github.com/users/vmariano))
+- [#28](https://github.com/kpdecker/jsdiff/pull/28) - Implemented diffJson ([@papandreou](https://api.github.com/users/papandreou))
+- [#27](https://github.com/kpdecker/jsdiff/issues/27) - Slow to execute over diffs with a large number of changes ([@termi](https://api.github.com/users/termi))
+- Allow for optional async diffing - 19385b9
+- Fix diffChars implementation - eaa44ed
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.1.0...v1.2.0)
+
+## v1.1.0 - November 25th, 2014
+
+- [#33](https://github.com/kpdecker/jsdiff/pull/33) - AMD and global exports ([@ovcharik](https://api.github.com/users/ovcharik))
+- [#32](https://github.com/kpdecker/jsdiff/pull/32) - Add support for component ([@vmariano](https://api.github.com/users/vmariano))
+- [#31](https://github.com/kpdecker/jsdiff/pull/31) - Don't rely on Array.prototype.map ([@papandreou](https://api.github.com/users/papandreou))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.8...v1.1.0)
+
+## v1.0.8 - December 22nd, 2013
+
+- [#24](https://github.com/kpdecker/jsdiff/pull/24) - Handle windows newlines on non windows machines. ([@benogle](https://api.github.com/users/benogle))
+- [#23](https://github.com/kpdecker/jsdiff/pull/23) - Prettied up the API formatting a little, and added basic node and web examples ([@airportyh](https://api.github.com/users/airportyh))
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.7...v1.0.8)
+
+## v1.0.7 - September 11th, 2013
+
+- [#22](https://github.com/kpdecker/jsdiff/pull/22) - Added variant of WordDiff that doesn't ignore whitespace differences ([@papandreou](https://api.github.com/users/papandreou)
+
+- Add 0.10 to travis tests - 243a526
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.6...v1.0.7)
+
+## v1.0.6 - August 30th, 2013
+
+- [#19](https://github.com/kpdecker/jsdiff/pull/19) - Explicitly define contents of npm package ([@sindresorhus](https://api.github.com/users/sindresorhus)
+
+[Commits](https://github.com/kpdecker/jsdiff/compare/v1.0.5...v1.0.6)
diff --git a/node_modules/diff/runtime.js b/node_modules/diff/runtime.js
new file mode 100644
index 0000000..82ea7e6
--- /dev/null
+++ b/node_modules/diff/runtime.js
@@ -0,0 +1,3 @@
+require('@babel/register')({
+  ignore: ['lib', 'node_modules']
+});
diff --git a/node_modules/digest-header/LICENSE.txt b/node_modules/digest-header/LICENSE.txt
new file mode 100644
index 0000000..ccc16a5
--- /dev/null
+++ b/node_modules/digest-header/LICENSE.txt
@@ -0,0 +1,21 @@
+This software is licensed under the MIT License.
+
+Copyright (C) 2014 fengmk2  and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/digest-header/README.md b/node_modules/digest-header/README.md
new file mode 100644
index 0000000..31a67de
--- /dev/null
+++ b/node_modules/digest-header/README.md
@@ -0,0 +1,49 @@
+digest-header
+=======
+
+[![Node.js CI](https://github.com/node-modules/digest-header/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/digest-header/actions/workflows/nodejs.yml)
+
+Digest access authentication header helper.
+
+## Install
+
+```bash
+npm install digest-header
+```
+
+## Usage
+
+```js
+var digest = require('digest-header');
+
+var method = 'GET';
+var uri = '/admin';
+var wwwAuthenticate = res.headers['WWW-Authenticate'];
+var userpass = 'user:pass';
+var auth = digest(method, uri, wwwAuthenticate, userpass);
+```
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 fengmk2 <fengmk2@gmail.com> and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/digest-header/index.js b/node_modules/digest-header/index.js
new file mode 100644
index 0000000..e12f656
--- /dev/null
+++ b/node_modules/digest-header/index.js
@@ -0,0 +1,78 @@
+const crypto = require('crypto');
+
+const AUTH_KEY_VALUE_RE = /(\w+)=["']?([^'"]{1,10000})["']?/;
+let NC = 0;
+const NC_PAD = '00000000';
+
+function md5(text) {
+  return crypto.createHash('md5').update(text).digest('hex');
+}
+
+function digestAuthHeader(method, uri, wwwAuthenticate, userpass) {
+  const parts = wwwAuthenticate.split(',');
+  const opts = {};
+  for (let i = 0; i < parts.length; i++) {
+    const m = AUTH_KEY_VALUE_RE.exec(parts[i]);
+    if (m) {
+      opts[m[1]] = m[2].replace(/["']/g, '');
+    }
+  }
+
+  if (!opts.realm || !opts.nonce) {
+    return '';
+  }
+
+  let qop = opts.qop || '';
+
+  // WWW-Authenticate: Digest realm="testrealm@host.com",
+  //                       qop="auth,auth-int",
+  //                       nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
+  //                       opaque="5ccc069c403ebaf9f0171e9517f40e41"
+  // Authorization: Digest username="Mufasa",
+  //                    realm="testrealm@host.com",
+  //                    nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093",
+  //                    uri="/dir/index.html",
+  //                    qop=auth,
+  //                    nc=00000001,
+  //                    cnonce="0a4f113b",
+  //                    response="6629fae49393a05397450978507c4ef1",
+  //                    opaque="5ccc069c403ebaf9f0171e9517f40e41"
+  // HA1 = MD5( "Mufasa:testrealm@host.com:Circle Of Life" )
+  //      = 939e7578ed9e3c518a452acee763bce9
+  //
+  //  HA2 = MD5( "GET:/dir/index.html" )
+  //      = 39aff3a2bab6126f332b942af96d3366
+  //
+  //  Response = MD5( "939e7578ed9e3c518a452acee763bce9:\
+  //                   dcd98b7102dd2f0e8b11d0f600bfb0c093:\
+  //                   00000001:0a4f113b:auth:\
+  //                   39aff3a2bab6126f332b942af96d3366" )
+  //           = 6629fae49393a05397450978507c4ef1
+  userpass = userpass.split(':');
+
+  let nc = String(++NC);
+  nc = NC_PAD.substring(nc.length) + nc;
+  const cnonce = crypto.randomBytes(8).toString('hex');
+
+  const ha1 = md5(userpass[0] + ':' + opts.realm + ':' + userpass[1]);
+  const ha2 = md5(method.toUpperCase() + ':' + uri);
+  let s = ha1 + ':' + opts.nonce;
+  if (qop) {
+    qop = qop.split(',')[0];
+    s += ':' + nc + ':' + cnonce + ':' + qop;
+  }
+  s += ':' + ha2;
+  const response = md5(s);
+  let authstring = 'Digest username="' + userpass[0] + '", realm="' + opts.realm
+    + '", nonce="' + opts.nonce + '", uri="' + uri
+    + '", response="' + response + '"';
+  if (opts.opaque) {
+    authstring += ', opaque="' + opts.opaque + '"';
+  }
+  if (qop) {
+    authstring +=', qop=' + qop + ', nc=' + nc + ', cnonce="' + cnonce + '"';
+  }
+  return authstring;
+}
+
+module.exports = digestAuthHeader;
diff --git a/node_modules/digest-header/package.json b/node_modules/digest-header/package.json
new file mode 100644
index 0000000..7cd43f1
--- /dev/null
+++ b/node_modules/digest-header/package.json
@@ -0,0 +1,44 @@
+{
+  "name": "digest-header",
+  "version": "1.1.0",
+  "description": "Digest access authentication header helper",
+  "main": "index.js",
+  "files": [
+    "index.js"
+  ],
+  "scripts": {
+    "lint": "echo 'ignore'",
+    "test": "egg-bin test",
+    "ci": "egg-bin cov"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "contributors": "*",
+    "egg-bin": "^4.20.0",
+    "should": "3.2.0"
+  },
+  "homepage": "https://github.com/node-modules/digest-header",
+  "repository": {
+    "type": "git",
+    "url": "git@github.com:node-modules/digest-header.git"
+  },
+  "bugs": {
+    "url": "https://github.com/node-modules/digest-header/issues"
+  },
+  "keywords": [
+    "digest",
+    "http-digest",
+    "baseauth",
+    "www-authenticate",
+    "authentication",
+    "http-authentication",
+    "digestauth",
+    "digest-auth",
+    "digest-header"
+  ],
+  "engines": {
+    "node": ">= 8.0.0"
+  },
+  "author": "fengmk2  (https://github.com/fengmk2)",
+  "license": "MIT"
+}
diff --git a/node_modules/dunder-proto/.eslintrc b/node_modules/dunder-proto/.eslintrc
new file mode 100644
index 0000000..3b5d9e9
--- /dev/null
+++ b/node_modules/dunder-proto/.eslintrc
@@ -0,0 +1,5 @@
+{
+	"root": true,
+
+	"extends": "@ljharb",
+}
diff --git a/node_modules/dunder-proto/.github/FUNDING.yml b/node_modules/dunder-proto/.github/FUNDING.yml
new file mode 100644
index 0000000..8a1d7b0
--- /dev/null
+++ b/node_modules/dunder-proto/.github/FUNDING.yml
@@ -0,0 +1,12 @@
+# These are supported funding model platforms
+
+github: [ljharb]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: npm/dunder-proto
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/node_modules/dunder-proto/.nycrc b/node_modules/dunder-proto/.nycrc
new file mode 100644
index 0000000..1826526
--- /dev/null
+++ b/node_modules/dunder-proto/.nycrc
@@ -0,0 +1,13 @@
+{
+	"all": true,
+	"check-coverage": false,
+	"reporter": ["text-summary", "text", "html", "json"],
+	"lines": 86,
+	"statements": 85.93,
+	"functions": 82.43,
+	"branches": 76.06,
+	"exclude": [
+		"coverage",
+		"test"
+	]
+}
diff --git a/node_modules/dunder-proto/CHANGELOG.md b/node_modules/dunder-proto/CHANGELOG.md
new file mode 100644
index 0000000..9b8b2f8
--- /dev/null
+++ b/node_modules/dunder-proto/CHANGELOG.md
@@ -0,0 +1,24 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v1.0.1](https://github.com/es-shims/dunder-proto/compare/v1.0.0...v1.0.1) - 2024-12-16
+
+### Commits
+
+- [Fix] do not crash when `--disable-proto=throw` [`6c367d9`](https://github.com/es-shims/dunder-proto/commit/6c367d919bc1604778689a297bbdbfea65752847)
+- [Tests] ensure noproto tests only use the current version of dunder-proto [`b02365b`](https://github.com/es-shims/dunder-proto/commit/b02365b9cf889c4a2cac7be0c3cfc90a789af36c)
+- [Dev Deps] update `@arethetypeswrong/cli`, `@types/tape` [`e3c5c3b`](https://github.com/es-shims/dunder-proto/commit/e3c5c3bd81cf8cef7dff2eca19e558f0e307f666)
+- [Deps] update `call-bind-apply-helpers` [`19f1da0`](https://github.com/es-shims/dunder-proto/commit/19f1da028b8dd0d05c85bfd8f7eed2819b686450)
+
+## v1.0.0 - 2024-12-06
+
+### Commits
+
+- Initial implementation, tests, readme, types [`a5b74b0`](https://github.com/es-shims/dunder-proto/commit/a5b74b0082f5270cb0905cd9a2e533cee7498373)
+- Initial commit [`73fb5a3`](https://github.com/es-shims/dunder-proto/commit/73fb5a353b51ac2ab00c9fdeb0114daffd4c07a8)
+- npm init [`80152dc`](https://github.com/es-shims/dunder-proto/commit/80152dc98155da4eb046d9f67a87ed96e8280a1d)
+- Only apps should have lockfiles [`03e6660`](https://github.com/es-shims/dunder-proto/commit/03e6660a1d70dc401f3e217a031475ec537243dd)
diff --git a/node_modules/dunder-proto/LICENSE b/node_modules/dunder-proto/LICENSE
new file mode 100644
index 0000000..34995e7
--- /dev/null
+++ b/node_modules/dunder-proto/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 ECMAScript Shims
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/dunder-proto/README.md b/node_modules/dunder-proto/README.md
new file mode 100644
index 0000000..44b80a2
--- /dev/null
+++ b/node_modules/dunder-proto/README.md
@@ -0,0 +1,54 @@
+# dunder-proto [![Version Badge][npm-version-svg]][package-url]
+
+[![github actions][actions-image]][actions-url]
+[![coverage][codecov-image]][codecov-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][npm-badge-png]][package-url]
+
+If available, the `Object.prototype.__proto__` accessor and mutator, call-bound.
+
+## Getting started
+
+```sh
+npm install --save dunder-proto
+```
+
+## Usage/Examples
+
+```js
+const assert = require('assert');
+const getDunder = require('dunder-proto/get');
+const setDunder = require('dunder-proto/set');
+
+const obj = {};
+
+assert.equal('toString' in obj, true);
+assert.equal(getDunder(obj), Object.prototype);
+
+setDunder(obj, null);
+
+assert.equal('toString' in obj, false);
+assert.equal(getDunder(obj), null);
+```
+
+## Tests
+
+Clone the repo, `npm install`, and run `npm test`
+
+[package-url]: https://npmjs.org/package/dunder-proto
+[npm-version-svg]: https://versionbadg.es/es-shims/dunder-proto.svg
+[deps-svg]: https://david-dm.org/es-shims/dunder-proto.svg
+[deps-url]: https://david-dm.org/es-shims/dunder-proto
+[dev-deps-svg]: https://david-dm.org/es-shims/dunder-proto/dev-status.svg
+[dev-deps-url]: https://david-dm.org/es-shims/dunder-proto#info=devDependencies
+[npm-badge-png]: https://nodei.co/npm/dunder-proto.png?downloads=true&stars=true
+[license-image]: https://img.shields.io/npm/l/dunder-proto.svg
+[license-url]: LICENSE
+[downloads-image]: https://img.shields.io/npm/dm/dunder-proto.svg
+[downloads-url]: https://npm-stat.com/charts.html?package=dunder-proto
+[codecov-image]: https://codecov.io/gh/es-shims/dunder-proto/branch/main/graphs/badge.svg
+[codecov-url]: https://app.codecov.io/gh/es-shims/dunder-proto/
+[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/dunder-proto
+[actions-url]: https://github.com/es-shims/dunder-proto/actions
diff --git a/node_modules/dunder-proto/get.d.ts b/node_modules/dunder-proto/get.d.ts
new file mode 100644
index 0000000..c7e14d2
--- /dev/null
+++ b/node_modules/dunder-proto/get.d.ts
@@ -0,0 +1,5 @@
+declare function getDunderProto(target: {}): object | null;
+
+declare const x: false | typeof getDunderProto;
+
+export = x;
\ No newline at end of file
diff --git a/node_modules/dunder-proto/get.js b/node_modules/dunder-proto/get.js
new file mode 100644
index 0000000..45093df
--- /dev/null
+++ b/node_modules/dunder-proto/get.js
@@ -0,0 +1,30 @@
+'use strict';
+
+var callBind = require('call-bind-apply-helpers');
+var gOPD = require('gopd');
+
+var hasProtoAccessor;
+try {
+	// eslint-disable-next-line no-extra-parens, no-proto
+	hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
+} catch (e) {
+	if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
+		throw e;
+	}
+}
+
+// eslint-disable-next-line no-extra-parens
+var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
+
+var $Object = Object;
+var $getPrototypeOf = $Object.getPrototypeOf;
+
+/** @type {import('./get')} */
+module.exports = desc && typeof desc.get === 'function'
+	? callBind([desc.get])
+	: typeof $getPrototypeOf === 'function'
+		? /** @type {import('./get')} */ function getDunder(value) {
+			// eslint-disable-next-line eqeqeq
+			return $getPrototypeOf(value == null ? value : $Object(value));
+		}
+		: false;
diff --git a/node_modules/dunder-proto/package.json b/node_modules/dunder-proto/package.json
new file mode 100644
index 0000000..04a4036
--- /dev/null
+++ b/node_modules/dunder-proto/package.json
@@ -0,0 +1,76 @@
+{
+	"name": "dunder-proto",
+	"version": "1.0.1",
+	"description": "If available, the `Object.prototype.__proto__` accessor and mutator, call-bound",
+	"main": false,
+	"exports": {
+		"./get": "./get.js",
+		"./set": "./set.js",
+		"./package.json": "./package.json"
+	},
+	"sideEffects": false,
+	"scripts": {
+		"prepack": "npmignore --auto --commentLines=autogenerated",
+		"prepublish": "not-in-publish || npm run prepublishOnly",
+		"prepublishOnly": "safe-publish-latest",
+		"prelint": "evalmd README.md",
+		"lint": "eslint --ext=.js,.mjs .",
+		"postlint": "tsc -p . && attw -P",
+		"pretest": "npm run lint",
+		"tests-only": "nyc tape 'test/**/*.js'",
+		"test": "npm run tests-only",
+		"posttest": "npx npm@'>= 10.2' audit --production",
+		"version": "auto-changelog && git add CHANGELOG.md",
+		"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
+	},
+	"repository": {
+		"type": "git",
+		"url": "git+https://github.com/es-shims/dunder-proto.git"
+	},
+	"author": "Jordan Harband ",
+	"license": "MIT",
+	"bugs": {
+		"url": "https://github.com/es-shims/dunder-proto/issues"
+	},
+	"homepage": "https://github.com/es-shims/dunder-proto#readme",
+	"dependencies": {
+		"call-bind-apply-helpers": "^1.0.1",
+		"es-errors": "^1.3.0",
+		"gopd": "^1.2.0"
+	},
+	"devDependencies": {
+		"@arethetypeswrong/cli": "^0.17.1",
+		"@ljharb/eslint-config": "^21.1.1",
+		"@ljharb/tsconfig": "^0.2.2",
+		"@types/tape": "^5.7.0",
+		"auto-changelog": "^2.5.0",
+		"encoding": "^0.1.13",
+		"eslint": "=8.8.0",
+		"evalmd": "^0.0.19",
+		"in-publish": "^2.0.1",
+		"npmignore": "^0.3.1",
+		"nyc": "^10.3.2",
+		"safe-publish-latest": "^2.0.0",
+		"tape": "^5.9.0",
+		"typescript": "next"
+	},
+	"auto-changelog": {
+		"output": "CHANGELOG.md",
+		"template": "keepachangelog",
+		"unreleased": false,
+		"commitLimit": false,
+		"backfillLimit": false,
+		"hideCredit": true
+	},
+	"testling": {
+		"files": "test/index.js"
+	},
+	"publishConfig": {
+		"ignore": [
+			".github/workflows"
+		]
+	},
+	"engines": {
+		"node": ">= 0.4"
+	}
+}
diff --git a/node_modules/dunder-proto/set.d.ts b/node_modules/dunder-proto/set.d.ts
new file mode 100644
index 0000000..16bfdfe
--- /dev/null
+++ b/node_modules/dunder-proto/set.d.ts
@@ -0,0 +1,5 @@
+declare function setDunderProto

(target: {}, proto: P): P; + +declare const x: false | typeof setDunderProto; + +export = x; \ No newline at end of file diff --git a/node_modules/dunder-proto/set.js b/node_modules/dunder-proto/set.js new file mode 100644 index 0000000..6085b6e --- /dev/null +++ b/node_modules/dunder-proto/set.js @@ -0,0 +1,35 @@ +'use strict'; + +var callBind = require('call-bind-apply-helpers'); +var gOPD = require('gopd'); +var $TypeError = require('es-errors/type'); + +/** @type {{ __proto__?: object | null }} */ +var obj = {}; +try { + obj.__proto__ = null; // eslint-disable-line no-proto +} catch (e) { + if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { + throw e; + } +} + +var hasProtoMutator = !('toString' in obj); + +// eslint-disable-next-line no-extra-parens +var desc = gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); + +/** @type {import('./set')} */ +module.exports = hasProtoMutator && ( +// eslint-disable-next-line no-extra-parens + (!!desc && typeof desc.set === 'function' && /** @type {import('./set')} */ (callBind([desc.set]))) + || /** @type {import('./set')} */ function setDunder(object, proto) { + // this is node v0.10 or older, which doesn't have Object.setPrototypeOf and has undeniable __proto__ + if (object == null) { // eslint-disable-line eqeqeq + throw new $TypeError('set Object.prototype.__proto__ called on null or undefined'); + } + // eslint-disable-next-line no-proto, no-param-reassign, no-extra-parens + /** @type {{ __proto__?: object | null }} */ (object).__proto__ = proto; + return proto; + } +); diff --git a/node_modules/dunder-proto/test/get.js b/node_modules/dunder-proto/test/get.js new file mode 100644 index 0000000..253f183 --- /dev/null +++ b/node_modules/dunder-proto/test/get.js @@ -0,0 +1,34 @@ +'use strict'; + +var test = require('tape'); + +var getDunderProto = require('../get'); + +test('getDunderProto', { skip: !getDunderProto }, function (t) { + if (!getDunderProto) { + throw 'should never happen; this is just for type narrowing'; // eslint-disable-line no-throw-literal + } + + // @ts-expect-error + t['throws'](function () { getDunderProto(); }, TypeError, 'throws if no argument'); + // @ts-expect-error + t['throws'](function () { getDunderProto(undefined); }, TypeError, 'throws with undefined'); + // @ts-expect-error + t['throws'](function () { getDunderProto(null); }, TypeError, 'throws with null'); + + t.equal(getDunderProto({}), Object.prototype); + t.equal(getDunderProto([]), Array.prototype); + t.equal(getDunderProto(function () {}), Function.prototype); + t.equal(getDunderProto(/./g), RegExp.prototype); + t.equal(getDunderProto(42), Number.prototype); + t.equal(getDunderProto(true), Boolean.prototype); + t.equal(getDunderProto('foo'), String.prototype); + + t.end(); +}); + +test('no dunder proto', { skip: !!getDunderProto }, function (t) { + t.notOk('__proto__' in Object.prototype, 'no __proto__ in Object.prototype'); + + t.end(); +}); diff --git a/node_modules/dunder-proto/test/index.js b/node_modules/dunder-proto/test/index.js new file mode 100644 index 0000000..08ff36f --- /dev/null +++ b/node_modules/dunder-proto/test/index.js @@ -0,0 +1,4 @@ +'use strict'; + +require('./get'); +require('./set'); diff --git a/node_modules/dunder-proto/test/set.js b/node_modules/dunder-proto/test/set.js new file mode 100644 index 0000000..c3bfe4d --- /dev/null +++ b/node_modules/dunder-proto/test/set.js @@ -0,0 +1,50 @@ +'use strict'; + +var test = require('tape'); + +var setDunderProto = require('../set'); + +test('setDunderProto', { skip: !setDunderProto }, function (t) { + if (!setDunderProto) { + throw 'should never happen; this is just for type narrowing'; // eslint-disable-line no-throw-literal + } + + // @ts-expect-error + t['throws'](function () { setDunderProto(); }, TypeError, 'throws if no arguments'); + // @ts-expect-error + t['throws'](function () { setDunderProto(undefined); }, TypeError, 'throws with undefined and nothing'); + // @ts-expect-error + t['throws'](function () { setDunderProto(undefined, undefined); }, TypeError, 'throws with undefined and undefined'); + // @ts-expect-error + t['throws'](function () { setDunderProto(null); }, TypeError, 'throws with null and undefined'); + // @ts-expect-error + t['throws'](function () { setDunderProto(null, undefined); }, TypeError, 'throws with null and undefined'); + + /** @type {{ inherited?: boolean }} */ + var obj = {}; + t.ok('toString' in obj, 'object initially has toString'); + + setDunderProto(obj, null); + t.notOk('toString' in obj, 'object no longer has toString'); + + t.notOk('inherited' in obj, 'object lacks inherited property'); + setDunderProto(obj, { inherited: true }); + t.equal(obj.inherited, true, 'object has inherited property'); + + t.end(); +}); + +test('no dunder proto', { skip: !!setDunderProto }, function (t) { + if ('__proto__' in Object.prototype) { + t['throws']( + // @ts-expect-error + function () { ({}).__proto__ = null; }, // eslint-disable-line no-proto + Error, + 'throws when setting Object.prototype.__proto__' + ); + } else { + t.notOk('__proto__' in Object.prototype, 'no __proto__ in Object.prototype'); + } + + t.end(); +}); diff --git a/node_modules/dunder-proto/tsconfig.json b/node_modules/dunder-proto/tsconfig.json new file mode 100644 index 0000000..dabbe23 --- /dev/null +++ b/node_modules/dunder-proto/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ES2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/eastasianwidth/README.md b/node_modules/eastasianwidth/README.md new file mode 100644 index 0000000..a8b71ee --- /dev/null +++ b/node_modules/eastasianwidth/README.md @@ -0,0 +1,32 @@ +# East Asian Width + +Get [East Asian Width](http://www.unicode.org/reports/tr11/) from a character. + +'F'(Fullwidth), 'H'(Halfwidth), 'W'(Wide), 'Na'(Narrow), 'A'(Ambiguous) or 'N'(Natural). + +Original Code is [東アジアの文字幅 (East Asian Width) の判定 - 中途](http://d.hatena.ne.jp/takenspc/20111126#1322252878). + +## Install + + $ npm install eastasianwidth + +## Usage + + var eaw = require('eastasianwidth'); + console.log(eaw.eastAsianWidth('₩')) // 'F' + console.log(eaw.eastAsianWidth('。')) // 'H' + console.log(eaw.eastAsianWidth('뀀')) // 'W' + console.log(eaw.eastAsianWidth('a')) // 'Na' + console.log(eaw.eastAsianWidth('①')) // 'A' + console.log(eaw.eastAsianWidth('ف')) // 'N' + + console.log(eaw.characterLength('₩')) // 2 + console.log(eaw.characterLength('。')) // 1 + console.log(eaw.characterLength('뀀')) // 2 + console.log(eaw.characterLength('a')) // 1 + console.log(eaw.characterLength('①')) // 2 + console.log(eaw.characterLength('ف')) // 1 + + console.log(eaw.length('あいうえお')) // 10 + console.log(eaw.length('abcdefg')) // 7 + console.log(eaw.length('¢₩。ᅵㄅ뀀¢⟭a⊙①بف')) // 19 diff --git a/node_modules/eastasianwidth/eastasianwidth.js b/node_modules/eastasianwidth/eastasianwidth.js new file mode 100644 index 0000000..7d0aa0f --- /dev/null +++ b/node_modules/eastasianwidth/eastasianwidth.js @@ -0,0 +1,311 @@ +var eaw = {}; + +if ('undefined' == typeof module) { + window.eastasianwidth = eaw; +} else { + module.exports = eaw; +} + +eaw.eastAsianWidth = function(character) { + var x = character.charCodeAt(0); + var y = (character.length == 2) ? character.charCodeAt(1) : 0; + var codePoint = x; + if ((0xD800 <= x && x <= 0xDBFF) && (0xDC00 <= y && y <= 0xDFFF)) { + x &= 0x3FF; + y &= 0x3FF; + codePoint = (x << 10) | y; + codePoint += 0x10000; + } + + if ((0x3000 == codePoint) || + (0xFF01 <= codePoint && codePoint <= 0xFF60) || + (0xFFE0 <= codePoint && codePoint <= 0xFFE6)) { + return 'F'; + } + if ((0x20A9 == codePoint) || + (0xFF61 <= codePoint && codePoint <= 0xFFBE) || + (0xFFC2 <= codePoint && codePoint <= 0xFFC7) || + (0xFFCA <= codePoint && codePoint <= 0xFFCF) || + (0xFFD2 <= codePoint && codePoint <= 0xFFD7) || + (0xFFDA <= codePoint && codePoint <= 0xFFDC) || + (0xFFE8 <= codePoint && codePoint <= 0xFFEE)) { + return 'H'; + } + if ((0x1100 <= codePoint && codePoint <= 0x115F) || + (0x11A3 <= codePoint && codePoint <= 0x11A7) || + (0x11FA <= codePoint && codePoint <= 0x11FF) || + (0x2329 <= codePoint && codePoint <= 0x232A) || + (0x2E80 <= codePoint && codePoint <= 0x2E99) || + (0x2E9B <= codePoint && codePoint <= 0x2EF3) || + (0x2F00 <= codePoint && codePoint <= 0x2FD5) || + (0x2FF0 <= codePoint && codePoint <= 0x2FFB) || + (0x3001 <= codePoint && codePoint <= 0x303E) || + (0x3041 <= codePoint && codePoint <= 0x3096) || + (0x3099 <= codePoint && codePoint <= 0x30FF) || + (0x3105 <= codePoint && codePoint <= 0x312D) || + (0x3131 <= codePoint && codePoint <= 0x318E) || + (0x3190 <= codePoint && codePoint <= 0x31BA) || + (0x31C0 <= codePoint && codePoint <= 0x31E3) || + (0x31F0 <= codePoint && codePoint <= 0x321E) || + (0x3220 <= codePoint && codePoint <= 0x3247) || + (0x3250 <= codePoint && codePoint <= 0x32FE) || + (0x3300 <= codePoint && codePoint <= 0x4DBF) || + (0x4E00 <= codePoint && codePoint <= 0xA48C) || + (0xA490 <= codePoint && codePoint <= 0xA4C6) || + (0xA960 <= codePoint && codePoint <= 0xA97C) || + (0xAC00 <= codePoint && codePoint <= 0xD7A3) || + (0xD7B0 <= codePoint && codePoint <= 0xD7C6) || + (0xD7CB <= codePoint && codePoint <= 0xD7FB) || + (0xF900 <= codePoint && codePoint <= 0xFAFF) || + (0xFE10 <= codePoint && codePoint <= 0xFE19) || + (0xFE30 <= codePoint && codePoint <= 0xFE52) || + (0xFE54 <= codePoint && codePoint <= 0xFE66) || + (0xFE68 <= codePoint && codePoint <= 0xFE6B) || + (0x1B000 <= codePoint && codePoint <= 0x1B001) || + (0x1F200 <= codePoint && codePoint <= 0x1F202) || + (0x1F210 <= codePoint && codePoint <= 0x1F23A) || + (0x1F240 <= codePoint && codePoint <= 0x1F248) || + (0x1F250 <= codePoint && codePoint <= 0x1F251) || + (0x20000 <= codePoint && codePoint <= 0x2F73F) || + (0x2B740 <= codePoint && codePoint <= 0x2FFFD) || + (0x30000 <= codePoint && codePoint <= 0x3FFFD)) { + return 'W'; + } + if ((0x0020 <= codePoint && codePoint <= 0x007E) || + (0x00A2 <= codePoint && codePoint <= 0x00A3) || + (0x00A5 <= codePoint && codePoint <= 0x00A6) || + (0x00AC == codePoint) || + (0x00AF == codePoint) || + (0x27E6 <= codePoint && codePoint <= 0x27ED) || + (0x2985 <= codePoint && codePoint <= 0x2986)) { + return 'Na'; + } + if ((0x00A1 == codePoint) || + (0x00A4 == codePoint) || + (0x00A7 <= codePoint && codePoint <= 0x00A8) || + (0x00AA == codePoint) || + (0x00AD <= codePoint && codePoint <= 0x00AE) || + (0x00B0 <= codePoint && codePoint <= 0x00B4) || + (0x00B6 <= codePoint && codePoint <= 0x00BA) || + (0x00BC <= codePoint && codePoint <= 0x00BF) || + (0x00C6 == codePoint) || + (0x00D0 == codePoint) || + (0x00D7 <= codePoint && codePoint <= 0x00D8) || + (0x00DE <= codePoint && codePoint <= 0x00E1) || + (0x00E6 == codePoint) || + (0x00E8 <= codePoint && codePoint <= 0x00EA) || + (0x00EC <= codePoint && codePoint <= 0x00ED) || + (0x00F0 == codePoint) || + (0x00F2 <= codePoint && codePoint <= 0x00F3) || + (0x00F7 <= codePoint && codePoint <= 0x00FA) || + (0x00FC == codePoint) || + (0x00FE == codePoint) || + (0x0101 == codePoint) || + (0x0111 == codePoint) || + (0x0113 == codePoint) || + (0x011B == codePoint) || + (0x0126 <= codePoint && codePoint <= 0x0127) || + (0x012B == codePoint) || + (0x0131 <= codePoint && codePoint <= 0x0133) || + (0x0138 == codePoint) || + (0x013F <= codePoint && codePoint <= 0x0142) || + (0x0144 == codePoint) || + (0x0148 <= codePoint && codePoint <= 0x014B) || + (0x014D == codePoint) || + (0x0152 <= codePoint && codePoint <= 0x0153) || + (0x0166 <= codePoint && codePoint <= 0x0167) || + (0x016B == codePoint) || + (0x01CE == codePoint) || + (0x01D0 == codePoint) || + (0x01D2 == codePoint) || + (0x01D4 == codePoint) || + (0x01D6 == codePoint) || + (0x01D8 == codePoint) || + (0x01DA == codePoint) || + (0x01DC == codePoint) || + (0x0251 == codePoint) || + (0x0261 == codePoint) || + (0x02C4 == codePoint) || + (0x02C7 == codePoint) || + (0x02C9 <= codePoint && codePoint <= 0x02CB) || + (0x02CD == codePoint) || + (0x02D0 == codePoint) || + (0x02D8 <= codePoint && codePoint <= 0x02DB) || + (0x02DD == codePoint) || + (0x02DF == codePoint) || + (0x0300 <= codePoint && codePoint <= 0x036F) || + (0x0391 <= codePoint && codePoint <= 0x03A1) || + (0x03A3 <= codePoint && codePoint <= 0x03A9) || + (0x03B1 <= codePoint && codePoint <= 0x03C1) || + (0x03C3 <= codePoint && codePoint <= 0x03C9) || + (0x0401 == codePoint) || + (0x0410 <= codePoint && codePoint <= 0x044F) || + (0x0451 == codePoint) || + (0x2010 == codePoint) || + (0x2013 <= codePoint && codePoint <= 0x2016) || + (0x2018 <= codePoint && codePoint <= 0x2019) || + (0x201C <= codePoint && codePoint <= 0x201D) || + (0x2020 <= codePoint && codePoint <= 0x2022) || + (0x2024 <= codePoint && codePoint <= 0x2027) || + (0x2030 == codePoint) || + (0x2032 <= codePoint && codePoint <= 0x2033) || + (0x2035 == codePoint) || + (0x203B == codePoint) || + (0x203E == codePoint) || + (0x2074 == codePoint) || + (0x207F == codePoint) || + (0x2081 <= codePoint && codePoint <= 0x2084) || + (0x20AC == codePoint) || + (0x2103 == codePoint) || + (0x2105 == codePoint) || + (0x2109 == codePoint) || + (0x2113 == codePoint) || + (0x2116 == codePoint) || + (0x2121 <= codePoint && codePoint <= 0x2122) || + (0x2126 == codePoint) || + (0x212B == codePoint) || + (0x2153 <= codePoint && codePoint <= 0x2154) || + (0x215B <= codePoint && codePoint <= 0x215E) || + (0x2160 <= codePoint && codePoint <= 0x216B) || + (0x2170 <= codePoint && codePoint <= 0x2179) || + (0x2189 == codePoint) || + (0x2190 <= codePoint && codePoint <= 0x2199) || + (0x21B8 <= codePoint && codePoint <= 0x21B9) || + (0x21D2 == codePoint) || + (0x21D4 == codePoint) || + (0x21E7 == codePoint) || + (0x2200 == codePoint) || + (0x2202 <= codePoint && codePoint <= 0x2203) || + (0x2207 <= codePoint && codePoint <= 0x2208) || + (0x220B == codePoint) || + (0x220F == codePoint) || + (0x2211 == codePoint) || + (0x2215 == codePoint) || + (0x221A == codePoint) || + (0x221D <= codePoint && codePoint <= 0x2220) || + (0x2223 == codePoint) || + (0x2225 == codePoint) || + (0x2227 <= codePoint && codePoint <= 0x222C) || + (0x222E == codePoint) || + (0x2234 <= codePoint && codePoint <= 0x2237) || + (0x223C <= codePoint && codePoint <= 0x223D) || + (0x2248 == codePoint) || + (0x224C == codePoint) || + (0x2252 == codePoint) || + (0x2260 <= codePoint && codePoint <= 0x2261) || + (0x2264 <= codePoint && codePoint <= 0x2267) || + (0x226A <= codePoint && codePoint <= 0x226B) || + (0x226E <= codePoint && codePoint <= 0x226F) || + (0x2282 <= codePoint && codePoint <= 0x2283) || + (0x2286 <= codePoint && codePoint <= 0x2287) || + (0x2295 == codePoint) || + (0x2299 == codePoint) || + (0x22A5 == codePoint) || + (0x22BF == codePoint) || + (0x2312 == codePoint) || + (0x2460 <= codePoint && codePoint <= 0x24E9) || + (0x24EB <= codePoint && codePoint <= 0x254B) || + (0x2550 <= codePoint && codePoint <= 0x2573) || + (0x2580 <= codePoint && codePoint <= 0x258F) || + (0x2592 <= codePoint && codePoint <= 0x2595) || + (0x25A0 <= codePoint && codePoint <= 0x25A1) || + (0x25A3 <= codePoint && codePoint <= 0x25A9) || + (0x25B2 <= codePoint && codePoint <= 0x25B3) || + (0x25B6 <= codePoint && codePoint <= 0x25B7) || + (0x25BC <= codePoint && codePoint <= 0x25BD) || + (0x25C0 <= codePoint && codePoint <= 0x25C1) || + (0x25C6 <= codePoint && codePoint <= 0x25C8) || + (0x25CB == codePoint) || + (0x25CE <= codePoint && codePoint <= 0x25D1) || + (0x25E2 <= codePoint && codePoint <= 0x25E5) || + (0x25EF == codePoint) || + (0x2605 <= codePoint && codePoint <= 0x2606) || + (0x2609 == codePoint) || + (0x260E <= codePoint && codePoint <= 0x260F) || + (0x2614 <= codePoint && codePoint <= 0x2615) || + (0x261C == codePoint) || + (0x261E == codePoint) || + (0x2640 == codePoint) || + (0x2642 == codePoint) || + (0x2660 <= codePoint && codePoint <= 0x2661) || + (0x2663 <= codePoint && codePoint <= 0x2665) || + (0x2667 <= codePoint && codePoint <= 0x266A) || + (0x266C <= codePoint && codePoint <= 0x266D) || + (0x266F == codePoint) || + (0x269E <= codePoint && codePoint <= 0x269F) || + (0x26BE <= codePoint && codePoint <= 0x26BF) || + (0x26C4 <= codePoint && codePoint <= 0x26CD) || + (0x26CF <= codePoint && codePoint <= 0x26E1) || + (0x26E3 == codePoint) || + (0x26E8 <= codePoint && codePoint <= 0x26FF) || + (0x273D == codePoint) || + (0x2757 == codePoint) || + (0x2776 <= codePoint && codePoint <= 0x277F) || + (0x2B55 <= codePoint && codePoint <= 0x2B59) || + (0x3248 <= codePoint && codePoint <= 0x324F) || + (0xE000 <= codePoint && codePoint <= 0xF8FF) || + (0xFE00 <= codePoint && codePoint <= 0xFE0F) || + (0xFFFD == codePoint) || + (0x1F100 <= codePoint && codePoint <= 0x1F10A) || + (0x1F110 <= codePoint && codePoint <= 0x1F12D) || + (0x1F130 <= codePoint && codePoint <= 0x1F169) || + (0x1F170 <= codePoint && codePoint <= 0x1F19A) || + (0xE0100 <= codePoint && codePoint <= 0xE01EF) || + (0xF0000 <= codePoint && codePoint <= 0xFFFFD) || + (0x100000 <= codePoint && codePoint <= 0x10FFFD)) { + return 'A'; + } + + return 'N'; +}; + +eaw.characterLength = function(character) { + var code = this.eastAsianWidth(character); + if (code == 'F' || code == 'W' || code == 'A') { + return 2; + } else { + return 1; + } +}; + +// Split a string considering surrogate-pairs. +function stringToArray(string) { + return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; +} + +eaw.length = function(string) { + var characters = stringToArray(string); + var len = 0; + for (var i = 0; i < characters.length; i++) { + len = len + this.characterLength(characters[i]); + } + return len; +}; + +eaw.slice = function(text, start, end) { + textLen = eaw.length(text) + start = start ? start : 0; + end = end ? end : 1; + if (start < 0) { + start = textLen + start; + } + if (end < 0) { + end = textLen + end; + } + var result = ''; + var eawLen = 0; + var chars = stringToArray(text); + for (var i = 0; i < chars.length; i++) { + var char = chars[i]; + var charLen = eaw.length(char); + if (eawLen >= start - (charLen == 2 ? 1 : 0)) { + if (eawLen + charLen <= end) { + result += char; + } else { + break; + } + } + eawLen += charLen; + } + return result; +}; diff --git a/node_modules/eastasianwidth/package.json b/node_modules/eastasianwidth/package.json new file mode 100644 index 0000000..cb7ac6a --- /dev/null +++ b/node_modules/eastasianwidth/package.json @@ -0,0 +1,18 @@ +{ + "name": "eastasianwidth", + "version": "0.2.0", + "description": "Get East Asian Width from a character.", + "main": "eastasianwidth.js", + "files": [ + "eastasianwidth.js" + ], + "scripts": { + "test": "mocha" + }, + "repository": "git://github.com/komagata/eastasianwidth.git", + "author": "Masaki Komagata", + "license": "MIT", + "devDependencies": { + "mocha": "~1.9.0" + } +} diff --git a/node_modules/ee-first/LICENSE b/node_modules/ee-first/LICENSE new file mode 100644 index 0000000..a7ae8ee --- /dev/null +++ b/node_modules/ee-first/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/ee-first/README.md b/node_modules/ee-first/README.md new file mode 100644 index 0000000..cbd2478 --- /dev/null +++ b/node_modules/ee-first/README.md @@ -0,0 +1,80 @@ +# EE First + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Get the first event in a set of event emitters and event pairs, +then clean up after itself. + +## Install + +```sh +$ npm install ee-first +``` + +## API + +```js +var first = require('ee-first') +``` + +### first(arr, listener) + +Invoke `listener` on the first event from the list specified in `arr`. `arr` is +an array of arrays, with each array in the format `[ee, ...event]`. `listener` +will be called only once, the first time any of the given events are emitted. If +`error` is one of the listened events, then if that fires first, the `listener` +will be given the `err` argument. + +The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the +first argument emitted from an `error` event, if applicable; `ee` is the event +emitter that fired; `event` is the string event name that fired; and `args` is an +array of the arguments that were emitted on the event. + +```js +var ee1 = new EventEmitter() +var ee2 = new EventEmitter() + +first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) +``` + +#### .cancel() + +The group of listeners can be cancelled before being invoked and have all the event +listeners removed from the underlying event emitters. + +```js +var thunk = first([ + [ee1, 'close', 'end', 'error'], + [ee2, 'error'] +], function (err, ee, event, args) { + // listener invoked +}) + +// cancel and clean up +thunk.cancel() +``` + +[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square +[npm-url]: https://npmjs.org/package/ee-first +[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square +[github-url]: https://github.com/jonathanong/ee-first/tags +[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square +[travis-url]: https://travis-ci.org/jonathanong/ee-first +[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master +[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/ee-first +[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square +[gittip-url]: https://www.gittip.com/jonathanong/ diff --git a/node_modules/ee-first/index.js b/node_modules/ee-first/index.js new file mode 100644 index 0000000..501287c --- /dev/null +++ b/node_modules/ee-first/index.js @@ -0,0 +1,95 @@ +/*! + * ee-first + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = first + +/** + * Get the first event in a set of event emitters and event pairs. + * + * @param {array} stuff + * @param {function} done + * @public + */ + +function first(stuff, done) { + if (!Array.isArray(stuff)) + throw new TypeError('arg must be an array of [ee, events...] arrays') + + var cleanups = [] + + for (var i = 0; i < stuff.length; i++) { + var arr = stuff[i] + + if (!Array.isArray(arr) || arr.length < 2) + throw new TypeError('each array member must be [ee, events...]') + + var ee = arr[0] + + for (var j = 1; j < arr.length; j++) { + var event = arr[j] + var fn = listener(event, callback) + + // listen to the event + ee.on(event, fn) + // push this listener to the list of cleanups + cleanups.push({ + ee: ee, + event: event, + fn: fn, + }) + } + } + + function callback() { + cleanup() + done.apply(null, arguments) + } + + function cleanup() { + var x + for (var i = 0; i < cleanups.length; i++) { + x = cleanups[i] + x.ee.removeListener(x.event, x.fn) + } + } + + function thunk(fn) { + done = fn + } + + thunk.cancel = cleanup + + return thunk +} + +/** + * Create the event listener. + * @private + */ + +function listener(event, done) { + return function onevent(arg1) { + var args = new Array(arguments.length) + var ee = this + var err = event === 'error' + ? arg1 + : null + + // copy args to prevent arguments escaping scope + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + done(err, ee, event, args) + } +} diff --git a/node_modules/ee-first/package.json b/node_modules/ee-first/package.json new file mode 100644 index 0000000..b6d0b7d --- /dev/null +++ b/node_modules/ee-first/package.json @@ -0,0 +1,29 @@ +{ + "name": "ee-first", + "description": "return the first event in a set of ee/event pairs", + "version": "1.1.1", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com", + "twitter": "https://twitter.com/jongleberry" + }, + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "repository": "jonathanong/ee-first", + "devDependencies": { + "istanbul": "0.3.9", + "mocha": "2.2.5" + }, + "files": [ + "index.js", + "LICENSE" + ], + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/node_modules/electron-to-chromium/LICENSE b/node_modules/electron-to-chromium/LICENSE new file mode 100644 index 0000000..6c7b614 --- /dev/null +++ b/node_modules/electron-to-chromium/LICENSE @@ -0,0 +1,5 @@ +Copyright 2018 Kilian Valkhof + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/electron-to-chromium/README.md b/node_modules/electron-to-chromium/README.md new file mode 100644 index 0000000..a96ddf1 --- /dev/null +++ b/node_modules/electron-to-chromium/README.md @@ -0,0 +1,186 @@ +### Made by [@kilianvalkhof](https://twitter.com/kilianvalkhof) + +#### Other projects: + +- 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once +- 🖌️ [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website +- 🗒️ [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad + +--- + +# Electron-to-Chromium [![npm](https://img.shields.io/npm/v/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![travis](https://img.shields.io/travis/Kilian/electron-to-chromium/master.svg)](https://travis-ci.org/Kilian/electron-to-chromium) [![npm-downloads](https://img.shields.io/npm/dm/electron-to-chromium.svg)](https://www.npmjs.com/package/electron-to-chromium) [![codecov](https://codecov.io/gh/Kilian/electron-to-chromium/branch/master/graph/badge.svg)](https://codecov.io/gh/Kilian/electron-to-chromium)[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_shield) + +This repository provides a mapping of Electron versions to the Chromium version that it uses. + +This package is used in [Browserslist](https://github.com/ai/browserslist), so you can use e.g. `electron >= 1.4` in [Autoprefixer](https://github.com/postcss/autoprefixer), [Stylelint](https://github.com/stylelint/stylelint), [babel-preset-env](https://github.com/babel/babel-preset-env) and [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat). + +**Supported by:** + + + + + + +## Install +Install using `npm install electron-to-chromium`. + +## Usage +To include Electron-to-Chromium, require it: + +```js +var e2c = require('electron-to-chromium'); +``` + +### Properties +The Electron-to-Chromium object has 4 properties to use: + +#### `versions` +An object of key-value pairs with a _major_ Electron version as the key, and the corresponding major Chromium version as the value. + +```js +var versions = e2c.versions; +console.log(versions['1.4']); +// returns "53" +``` + +#### `fullVersions` +An object of key-value pairs with a Electron version as the key, and the corresponding full Chromium version as the value. + +```js +var versions = e2c.fullVersions; +console.log(versions['1.4.11']); +// returns "53.0.2785.143" +``` + +#### `chromiumVersions` +An object of key-value pairs with a _major_ Chromium version as the key, and the corresponding major Electron version as the value. + +```js +var versions = e2c.chromiumVersions; +console.log(versions['54']); +// returns "1.4" +``` + +#### `fullChromiumVersions` +An object of key-value pairs with a Chromium version as the key, and an array of the corresponding major Electron versions as the value. + +```js +var versions = e2c.fullChromiumVersions; +console.log(versions['54.0.2840.101']); +// returns ["1.5.1", "1.5.0"] +``` +### Functions + +#### `electronToChromium(query)` +Arguments: +* Query: string or number, required. A major or full Electron version. + +A function that returns the corresponding Chromium version for a given Electron function. Returns a string. + +If you provide it with a major Electron version, it will return a major Chromium version: + +```js +var chromeVersion = e2c.electronToChromium('1.4'); +// chromeVersion is "53" +``` + +If you provide it with a full Electron version, it will return the full Chromium version. + +```js +var chromeVersion = e2c.electronToChromium('1.4.11'); +// chromeVersion is "53.0.2785.143" +``` + +If a query does not match a Chromium version, it will return `undefined`. + +```js +var chromeVersion = e2c.electronToChromium('9000'); +// chromeVersion is undefined +``` + +#### `chromiumToElectron(query)` +Arguments: +* Query: string or number, required. A major or full Chromium version. + +Returns a string with the corresponding Electron version for a given Chromium query. + +If you provide it with a major Chromium version, it will return a major Electron version: + +```js +var electronVersion = e2c.chromiumToElectron('54'); +// electronVersion is "1.4" +``` + +If you provide it with a full Chrome version, it will return an array of full Electron versions. + +```js +var electronVersions = e2c.chromiumToElectron('56.0.2924.87'); +// electronVersions is ["1.6.3", "1.6.2", "1.6.1", "1.6.0"] +``` + +If a query does not match an Electron version, it will return `undefined`. + +```js +var electronVersion = e2c.chromiumToElectron('10'); +// electronVersion is undefined +``` + +#### `electronToBrowserList(query)` **DEPRECATED** +Arguments: +* Query: string or number, required. A major Electron version. + +_**Deprecated**: Browserlist already includes electron-to-chromium._ + +A function that returns a [Browserslist](https://github.com/ai/browserslist) query that matches the given major Electron version. Returns a string. + +If you provide it with a major Electron version, it will return a Browserlist query string that matches the Chromium capabilities: + +```js +var query = e2c.electronToBrowserList('1.4'); +// query is "Chrome >= 53" +``` + +If a query does not match a Chromium version, it will return `undefined`. + +```js +var query = e2c.electronToBrowserList('9000'); +// query is undefined +``` + +### Importing just versions, fullVersions, chromiumVersions and fullChromiumVersions +All lists can be imported on their own, if file size is a concern. + +#### `versions` + +```js +var versions = require('electron-to-chromium/versions'); +``` + +#### `fullVersions` + +```js +var fullVersions = require('electron-to-chromium/full-versions'); +``` + +#### `chromiumVersions` + +```js +var chromiumVersions = require('electron-to-chromium/chromium-versions'); +``` + +#### `fullChromiumVersions` + +```js +var fullChromiumVersions = require('electron-to-chromium/full-chromium-versions'); +``` + +## Updating +This package will be updated with each new Electron release. + +To update the list, run `npm run build.js`. Requires internet access as it downloads from the canonical list of Electron versions. + +To verify correct behaviour, run `npm test`. + + +## License +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-to-chromium?ref=badge_large) diff --git a/node_modules/electron-to-chromium/chromium-versions.js b/node_modules/electron-to-chromium/chromium-versions.js new file mode 100644 index 0000000..d7eec6e --- /dev/null +++ b/node_modules/electron-to-chromium/chromium-versions.js @@ -0,0 +1,84 @@ +module.exports = { + "39": "0.20", + "40": "0.21", + "41": "0.21", + "42": "0.25", + "43": "0.27", + "44": "0.30", + "45": "0.31", + "47": "0.36", + "49": "0.37", + "50": "1.1", + "51": "1.2", + "52": "1.3", + "53": "1.4", + "54": "1.4", + "56": "1.6", + "58": "1.7", + "59": "1.8", + "61": "2.0", + "66": "3.0", + "69": "4.0", + "72": "5.0", + "73": "5.0", + "76": "6.0", + "78": "7.0", + "79": "8.0", + "80": "8.0", + "82": "9.0", + "83": "9.0", + "84": "10.0", + "85": "10.0", + "86": "11.0", + "87": "11.0", + "89": "12.0", + "90": "13.0", + "91": "13.0", + "92": "14.0", + "93": "14.0", + "94": "15.0", + "95": "16.0", + "96": "16.0", + "98": "17.0", + "99": "18.0", + "100": "18.0", + "102": "19.0", + "103": "20.0", + "104": "20.0", + "105": "21.0", + "106": "21.0", + "107": "22.0", + "108": "22.0", + "110": "23.0", + "111": "24.0", + "112": "24.0", + "114": "25.0", + "116": "26.0", + "118": "27.0", + "119": "28.0", + "120": "28.0", + "121": "29.0", + "122": "29.0", + "123": "30.0", + "124": "30.0", + "125": "31.0", + "126": "31.0", + "127": "32.0", + "128": "32.0", + "129": "33.0", + "130": "33.0", + "131": "34.0", + "132": "34.0", + "133": "35.0", + "134": "35.0", + "135": "36.0", + "136": "36.0", + "137": "37.0", + "138": "37.0", + "139": "38.0", + "140": "38.0", + "141": "39.0", + "142": "39.0", + "143": "40.0", + "144": "40.0" +}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/chromium-versions.json b/node_modules/electron-to-chromium/chromium-versions.json new file mode 100644 index 0000000..06efeab --- /dev/null +++ b/node_modules/electron-to-chromium/chromium-versions.json @@ -0,0 +1 @@ +{"39":"0.20","40":"0.21","41":"0.21","42":"0.25","43":"0.27","44":"0.30","45":"0.31","47":"0.36","49":"0.37","50":"1.1","51":"1.2","52":"1.3","53":"1.4","54":"1.4","56":"1.6","58":"1.7","59":"1.8","61":"2.0","66":"3.0","69":"4.0","72":"5.0","73":"5.0","76":"6.0","78":"7.0","79":"8.0","80":"8.0","82":"9.0","83":"9.0","84":"10.0","85":"10.0","86":"11.0","87":"11.0","89":"12.0","90":"13.0","91":"13.0","92":"14.0","93":"14.0","94":"15.0","95":"16.0","96":"16.0","98":"17.0","99":"18.0","100":"18.0","102":"19.0","103":"20.0","104":"20.0","105":"21.0","106":"21.0","107":"22.0","108":"22.0","110":"23.0","111":"24.0","112":"24.0","114":"25.0","116":"26.0","118":"27.0","119":"28.0","120":"28.0","121":"29.0","122":"29.0","123":"30.0","124":"30.0","125":"31.0","126":"31.0","127":"32.0","128":"32.0","129":"33.0","130":"33.0","131":"34.0","132":"34.0","133":"35.0","134":"35.0","135":"36.0","136":"36.0","137":"37.0","138":"37.0","139":"38.0","140":"38.0","141":"39.0","142":"39.0","143":"40.0","144":"40.0"} \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-chromium-versions.js b/node_modules/electron-to-chromium/full-chromium-versions.js new file mode 100644 index 0000000..5e1d417 --- /dev/null +++ b/node_modules/electron-to-chromium/full-chromium-versions.js @@ -0,0 +1,2629 @@ +module.exports = { + "39.0.2171.65": [ + "0.20.0", + "0.20.1", + "0.20.2", + "0.20.3", + "0.20.4", + "0.20.5", + "0.20.6", + "0.20.7", + "0.20.8" + ], + "40.0.2214.91": [ + "0.21.0", + "0.21.1", + "0.21.2" + ], + "41.0.2272.76": [ + "0.21.3", + "0.22.1", + "0.22.2", + "0.22.3", + "0.23.0", + "0.24.0" + ], + "42.0.2311.107": [ + "0.25.0", + "0.25.1", + "0.25.2", + "0.25.3", + "0.26.0", + "0.26.1", + "0.27.0", + "0.27.1" + ], + "43.0.2357.65": [ + "0.27.2", + "0.27.3", + "0.28.0", + "0.28.1", + "0.28.2", + "0.28.3", + "0.29.1", + "0.29.2" + ], + "44.0.2403.125": [ + "0.30.4", + "0.31.0" + ], + "45.0.2454.85": [ + "0.31.2", + "0.32.2", + "0.32.3", + "0.33.0", + "0.33.1", + "0.33.2", + "0.33.3", + "0.33.4", + "0.33.6", + "0.33.7", + "0.33.8", + "0.33.9", + "0.34.0", + "0.34.1", + "0.34.2", + "0.34.3", + "0.34.4", + "0.35.1", + "0.35.2", + "0.35.3", + "0.35.4", + "0.35.5" + ], + "47.0.2526.73": [ + "0.36.0", + "0.36.2", + "0.36.3", + "0.36.4" + ], + "47.0.2526.110": [ + "0.36.5", + "0.36.6", + "0.36.7", + "0.36.8", + "0.36.9", + "0.36.10", + "0.36.11", + "0.36.12" + ], + "49.0.2623.75": [ + "0.37.0", + "0.37.1", + "0.37.3", + "0.37.4", + "0.37.5", + "0.37.6", + "0.37.7", + "0.37.8", + "1.0.0", + "1.0.1", + "1.0.2" + ], + "50.0.2661.102": [ + "1.1.0", + "1.1.1", + "1.1.2", + "1.1.3" + ], + "51.0.2704.63": [ + "1.2.0", + "1.2.1" + ], + "51.0.2704.84": [ + "1.2.2", + "1.2.3" + ], + "51.0.2704.103": [ + "1.2.4", + "1.2.5" + ], + "51.0.2704.106": [ + "1.2.6", + "1.2.7", + "1.2.8" + ], + "52.0.2743.82": [ + "1.3.0", + "1.3.1", + "1.3.2", + "1.3.3", + "1.3.4", + "1.3.5", + "1.3.6", + "1.3.7", + "1.3.9", + "1.3.10", + "1.3.13", + "1.3.14", + "1.3.15" + ], + "53.0.2785.113": [ + "1.4.0", + "1.4.1", + "1.4.2", + "1.4.3", + "1.4.4", + "1.4.5" + ], + "53.0.2785.143": [ + "1.4.6", + "1.4.7", + "1.4.8", + "1.4.10", + "1.4.11", + "1.4.13", + "1.4.14", + "1.4.15", + "1.4.16" + ], + "54.0.2840.51": [ + "1.4.12" + ], + "54.0.2840.101": [ + "1.5.0", + "1.5.1" + ], + "56.0.2924.87": [ + "1.6.0", + "1.6.1", + "1.6.2", + "1.6.3", + "1.6.4", + "1.6.5", + "1.6.6", + "1.6.7", + "1.6.8", + "1.6.9", + "1.6.10", + "1.6.11", + "1.6.12", + "1.6.13", + "1.6.14", + "1.6.15", + "1.6.16", + "1.6.17", + "1.6.18" + ], + "58.0.3029.110": [ + "1.7.0", + "1.7.1", + "1.7.2", + "1.7.3", + "1.7.4", + "1.7.5", + "1.7.6", + "1.7.7", + "1.7.8", + "1.7.9", + "1.7.10", + "1.7.11", + "1.7.12", + "1.7.13", + "1.7.14", + "1.7.15", + "1.7.16" + ], + "59.0.3071.115": [ + "1.8.0", + "1.8.1", + "1.8.2-beta.1", + "1.8.2-beta.2", + "1.8.2-beta.3", + "1.8.2-beta.4", + "1.8.2-beta.5", + "1.8.2", + "1.8.3", + "1.8.4", + "1.8.5", + "1.8.6", + "1.8.7", + "1.8.8" + ], + "61.0.3163.100": [ + "2.0.0-beta.1", + "2.0.0-beta.2", + "2.0.0-beta.3", + "2.0.0-beta.4", + "2.0.0-beta.5", + "2.0.0-beta.6", + "2.0.0-beta.7", + "2.0.0-beta.8", + "2.0.0", + "2.0.1", + "2.0.2", + "2.0.3", + "2.0.4", + "2.0.5", + "2.0.6", + "2.0.7", + "2.0.8", + "2.0.9", + "2.0.10", + "2.0.11", + "2.0.12", + "2.0.13", + "2.0.14", + "2.0.15", + "2.0.16", + "2.0.17", + "2.0.18", + "2.1.0-unsupported.20180809" + ], + "66.0.3359.181": [ + "3.0.0-beta.1", + "3.0.0-beta.2", + "3.0.0-beta.3", + "3.0.0-beta.4", + "3.0.0-beta.5", + "3.0.0-beta.6", + "3.0.0-beta.7", + "3.0.0-beta.8", + "3.0.0-beta.9", + "3.0.0-beta.10", + "3.0.0-beta.11", + "3.0.0-beta.12", + "3.0.0-beta.13", + "3.0.0", + "3.0.1", + "3.0.2", + "3.0.3", + "3.0.4", + "3.0.5", + "3.0.6", + "3.0.7", + "3.0.8", + "3.0.9", + "3.0.10", + "3.0.11", + "3.0.12", + "3.0.13", + "3.0.14", + "3.0.15", + "3.0.16", + "3.1.0-beta.1", + "3.1.0-beta.2", + "3.1.0-beta.3", + "3.1.0-beta.4", + "3.1.0-beta.5", + "3.1.0", + "3.1.1", + "3.1.2", + "3.1.3", + "3.1.4", + "3.1.5", + "3.1.6", + "3.1.7", + "3.1.8", + "3.1.9", + "3.1.10", + "3.1.11", + "3.1.12", + "3.1.13" + ], + "69.0.3497.106": [ + "4.0.0-beta.1", + "4.0.0-beta.2", + "4.0.0-beta.3", + "4.0.0-beta.4", + "4.0.0-beta.5", + "4.0.0-beta.6", + "4.0.0-beta.7", + "4.0.0-beta.8", + "4.0.0-beta.9", + "4.0.0-beta.10", + "4.0.0-beta.11", + "4.0.0", + "4.0.1", + "4.0.2", + "4.0.3", + "4.0.4", + "4.0.5", + "4.0.6" + ], + "69.0.3497.128": [ + "4.0.7", + "4.0.8", + "4.1.0", + "4.1.1", + "4.1.2", + "4.1.3", + "4.1.4", + "4.1.5", + "4.2.0", + "4.2.1", + "4.2.2", + "4.2.3", + "4.2.4", + "4.2.5", + "4.2.6", + "4.2.7", + "4.2.8", + "4.2.9", + "4.2.10", + "4.2.11", + "4.2.12" + ], + "72.0.3626.52": [ + "5.0.0-beta.1", + "5.0.0-beta.2" + ], + "73.0.3683.27": [ + "5.0.0-beta.3" + ], + "73.0.3683.54": [ + "5.0.0-beta.4" + ], + "73.0.3683.61": [ + "5.0.0-beta.5" + ], + "73.0.3683.84": [ + "5.0.0-beta.6" + ], + "73.0.3683.94": [ + "5.0.0-beta.7" + ], + "73.0.3683.104": [ + "5.0.0-beta.8" + ], + "73.0.3683.117": [ + "5.0.0-beta.9" + ], + "73.0.3683.119": [ + "5.0.0" + ], + "73.0.3683.121": [ + "5.0.1", + "5.0.2", + "5.0.3", + "5.0.4", + "5.0.5", + "5.0.6", + "5.0.7", + "5.0.8", + "5.0.9", + "5.0.10", + "5.0.11", + "5.0.12", + "5.0.13" + ], + "76.0.3774.1": [ + "6.0.0-beta.1" + ], + "76.0.3783.1": [ + "6.0.0-beta.2", + "6.0.0-beta.3", + "6.0.0-beta.4" + ], + "76.0.3805.4": [ + "6.0.0-beta.5" + ], + "76.0.3809.3": [ + "6.0.0-beta.6" + ], + "76.0.3809.22": [ + "6.0.0-beta.7" + ], + "76.0.3809.26": [ + "6.0.0-beta.8", + "6.0.0-beta.9" + ], + "76.0.3809.37": [ + "6.0.0-beta.10" + ], + "76.0.3809.42": [ + "6.0.0-beta.11" + ], + "76.0.3809.54": [ + "6.0.0-beta.12" + ], + "76.0.3809.60": [ + "6.0.0-beta.13" + ], + "76.0.3809.68": [ + "6.0.0-beta.14" + ], + "76.0.3809.74": [ + "6.0.0-beta.15" + ], + "76.0.3809.88": [ + "6.0.0" + ], + "76.0.3809.102": [ + "6.0.1" + ], + "76.0.3809.110": [ + "6.0.2" + ], + "76.0.3809.126": [ + "6.0.3" + ], + "76.0.3809.131": [ + "6.0.4" + ], + "76.0.3809.136": [ + "6.0.5" + ], + "76.0.3809.138": [ + "6.0.6" + ], + "76.0.3809.139": [ + "6.0.7" + ], + "76.0.3809.146": [ + "6.0.8", + "6.0.9", + "6.0.10", + "6.0.11", + "6.0.12", + "6.1.0", + "6.1.1", + "6.1.2", + "6.1.3", + "6.1.4", + "6.1.5", + "6.1.6", + "6.1.7", + "6.1.8", + "6.1.9", + "6.1.10", + "6.1.11", + "6.1.12" + ], + "78.0.3866.0": [ + "7.0.0-beta.1", + "7.0.0-beta.2", + "7.0.0-beta.3" + ], + "78.0.3896.6": [ + "7.0.0-beta.4" + ], + "78.0.3905.1": [ + "7.0.0-beta.5", + "7.0.0-beta.6", + "7.0.0-beta.7", + "7.0.0" + ], + "78.0.3904.92": [ + "7.0.1" + ], + "78.0.3904.94": [ + "7.1.0" + ], + "78.0.3904.99": [ + "7.1.1" + ], + "78.0.3904.113": [ + "7.1.2" + ], + "78.0.3904.126": [ + "7.1.3" + ], + "78.0.3904.130": [ + "7.1.4", + "7.1.5", + "7.1.6", + "7.1.7", + "7.1.8", + "7.1.9", + "7.1.10", + "7.1.11", + "7.1.12", + "7.1.13", + "7.1.14", + "7.2.0", + "7.2.1", + "7.2.2", + "7.2.3", + "7.2.4", + "7.3.0", + "7.3.1", + "7.3.2", + "7.3.3" + ], + "79.0.3931.0": [ + "8.0.0-beta.1", + "8.0.0-beta.2" + ], + "80.0.3955.0": [ + "8.0.0-beta.3", + "8.0.0-beta.4" + ], + "80.0.3987.14": [ + "8.0.0-beta.5" + ], + "80.0.3987.51": [ + "8.0.0-beta.6" + ], + "80.0.3987.59": [ + "8.0.0-beta.7" + ], + "80.0.3987.75": [ + "8.0.0-beta.8", + "8.0.0-beta.9" + ], + "80.0.3987.86": [ + "8.0.0", + "8.0.1", + "8.0.2" + ], + "80.0.3987.134": [ + "8.0.3" + ], + "80.0.3987.137": [ + "8.1.0" + ], + "80.0.3987.141": [ + "8.1.1" + ], + "80.0.3987.158": [ + "8.2.0" + ], + "80.0.3987.163": [ + "8.2.1", + "8.2.2", + "8.2.3", + "8.5.3", + "8.5.4", + "8.5.5" + ], + "80.0.3987.165": [ + "8.2.4", + "8.2.5", + "8.3.0", + "8.3.1", + "8.3.2", + "8.3.3", + "8.3.4", + "8.4.0", + "8.4.1", + "8.5.0", + "8.5.1", + "8.5.2" + ], + "82.0.4048.0": [ + "9.0.0-beta.1", + "9.0.0-beta.2", + "9.0.0-beta.3", + "9.0.0-beta.4", + "9.0.0-beta.5" + ], + "82.0.4058.2": [ + "9.0.0-beta.6", + "9.0.0-beta.7", + "9.0.0-beta.9" + ], + "82.0.4085.10": [ + "9.0.0-beta.10" + ], + "82.0.4085.14": [ + "9.0.0-beta.11", + "9.0.0-beta.12", + "9.0.0-beta.13" + ], + "82.0.4085.27": [ + "9.0.0-beta.14" + ], + "83.0.4102.3": [ + "9.0.0-beta.15", + "9.0.0-beta.16" + ], + "83.0.4103.14": [ + "9.0.0-beta.17" + ], + "83.0.4103.16": [ + "9.0.0-beta.18" + ], + "83.0.4103.24": [ + "9.0.0-beta.19" + ], + "83.0.4103.26": [ + "9.0.0-beta.20", + "9.0.0-beta.21" + ], + "83.0.4103.34": [ + "9.0.0-beta.22" + ], + "83.0.4103.44": [ + "9.0.0-beta.23" + ], + "83.0.4103.45": [ + "9.0.0-beta.24" + ], + "83.0.4103.64": [ + "9.0.0" + ], + "83.0.4103.94": [ + "9.0.1", + "9.0.2" + ], + "83.0.4103.100": [ + "9.0.3" + ], + "83.0.4103.104": [ + "9.0.4" + ], + "83.0.4103.119": [ + "9.0.5" + ], + "83.0.4103.122": [ + "9.1.0", + "9.1.1", + "9.1.2", + "9.2.0", + "9.2.1", + "9.3.0", + "9.3.1", + "9.3.2", + "9.3.3", + "9.3.4", + "9.3.5", + "9.4.0", + "9.4.1", + "9.4.2", + "9.4.3", + "9.4.4" + ], + "84.0.4129.0": [ + "10.0.0-beta.1", + "10.0.0-beta.2" + ], + "85.0.4161.2": [ + "10.0.0-beta.3", + "10.0.0-beta.4" + ], + "85.0.4181.1": [ + "10.0.0-beta.8", + "10.0.0-beta.9" + ], + "85.0.4183.19": [ + "10.0.0-beta.10" + ], + "85.0.4183.20": [ + "10.0.0-beta.11" + ], + "85.0.4183.26": [ + "10.0.0-beta.12" + ], + "85.0.4183.39": [ + "10.0.0-beta.13", + "10.0.0-beta.14", + "10.0.0-beta.15", + "10.0.0-beta.17", + "10.0.0-beta.19", + "10.0.0-beta.20", + "10.0.0-beta.21" + ], + "85.0.4183.70": [ + "10.0.0-beta.23" + ], + "85.0.4183.78": [ + "10.0.0-beta.24" + ], + "85.0.4183.80": [ + "10.0.0-beta.25" + ], + "85.0.4183.84": [ + "10.0.0" + ], + "85.0.4183.86": [ + "10.0.1" + ], + "85.0.4183.87": [ + "10.1.0" + ], + "85.0.4183.93": [ + "10.1.1" + ], + "85.0.4183.98": [ + "10.1.2" + ], + "85.0.4183.121": [ + "10.1.3", + "10.1.4", + "10.1.5", + "10.1.6", + "10.1.7", + "10.2.0", + "10.3.0", + "10.3.1", + "10.3.2", + "10.4.0", + "10.4.1", + "10.4.2", + "10.4.3", + "10.4.4", + "10.4.5", + "10.4.6", + "10.4.7" + ], + "86.0.4234.0": [ + "11.0.0-beta.1", + "11.0.0-beta.3", + "11.0.0-beta.4", + "11.0.0-beta.5", + "11.0.0-beta.6", + "11.0.0-beta.7" + ], + "87.0.4251.1": [ + "11.0.0-beta.8", + "11.0.0-beta.9", + "11.0.0-beta.11" + ], + "87.0.4280.11": [ + "11.0.0-beta.12", + "11.0.0-beta.13" + ], + "87.0.4280.27": [ + "11.0.0-beta.16", + "11.0.0-beta.17", + "11.0.0-beta.18", + "11.0.0-beta.19" + ], + "87.0.4280.40": [ + "11.0.0-beta.20" + ], + "87.0.4280.47": [ + "11.0.0-beta.22", + "11.0.0-beta.23" + ], + "87.0.4280.60": [ + "11.0.0", + "11.0.1" + ], + "87.0.4280.67": [ + "11.0.2", + "11.0.3", + "11.0.4" + ], + "87.0.4280.88": [ + "11.0.5", + "11.1.0", + "11.1.1" + ], + "87.0.4280.141": [ + "11.2.0", + "11.2.1", + "11.2.2", + "11.2.3", + "11.3.0", + "11.4.0", + "11.4.1", + "11.4.2", + "11.4.3", + "11.4.4", + "11.4.5", + "11.4.6", + "11.4.7", + "11.4.8", + "11.4.9", + "11.4.10", + "11.4.11", + "11.4.12", + "11.5.0" + ], + "89.0.4328.0": [ + "12.0.0-beta.1", + "12.0.0-beta.3", + "12.0.0-beta.4", + "12.0.0-beta.5", + "12.0.0-beta.6", + "12.0.0-beta.7", + "12.0.0-beta.8", + "12.0.0-beta.9", + "12.0.0-beta.10", + "12.0.0-beta.11", + "12.0.0-beta.12", + "12.0.0-beta.14" + ], + "89.0.4348.1": [ + "12.0.0-beta.16", + "12.0.0-beta.18", + "12.0.0-beta.19", + "12.0.0-beta.20" + ], + "89.0.4388.2": [ + "12.0.0-beta.21", + "12.0.0-beta.22", + "12.0.0-beta.23", + "12.0.0-beta.24", + "12.0.0-beta.25", + "12.0.0-beta.26" + ], + "89.0.4389.23": [ + "12.0.0-beta.27", + "12.0.0-beta.28", + "12.0.0-beta.29" + ], + "89.0.4389.58": [ + "12.0.0-beta.30", + "12.0.0-beta.31" + ], + "89.0.4389.69": [ + "12.0.0" + ], + "89.0.4389.82": [ + "12.0.1" + ], + "89.0.4389.90": [ + "12.0.2" + ], + "89.0.4389.114": [ + "12.0.3", + "12.0.4" + ], + "89.0.4389.128": [ + "12.0.5", + "12.0.6", + "12.0.7", + "12.0.8", + "12.0.9", + "12.0.10", + "12.0.11", + "12.0.12", + "12.0.13", + "12.0.14", + "12.0.15", + "12.0.16", + "12.0.17", + "12.0.18", + "12.1.0", + "12.1.1", + "12.1.2", + "12.2.0", + "12.2.1", + "12.2.2", + "12.2.3" + ], + "90.0.4402.0": [ + "13.0.0-beta.2", + "13.0.0-beta.3" + ], + "90.0.4415.0": [ + "13.0.0-beta.4", + "13.0.0-beta.5", + "13.0.0-beta.6", + "13.0.0-beta.7", + "13.0.0-beta.8", + "13.0.0-beta.9", + "13.0.0-beta.10", + "13.0.0-beta.11", + "13.0.0-beta.12", + "13.0.0-beta.13" + ], + "91.0.4448.0": [ + "13.0.0-beta.14", + "13.0.0-beta.16", + "13.0.0-beta.17", + "13.0.0-beta.18", + "13.0.0-beta.20" + ], + "91.0.4472.33": [ + "13.0.0-beta.21", + "13.0.0-beta.22", + "13.0.0-beta.23" + ], + "91.0.4472.38": [ + "13.0.0-beta.24", + "13.0.0-beta.25", + "13.0.0-beta.26", + "13.0.0-beta.27", + "13.0.0-beta.28" + ], + "91.0.4472.69": [ + "13.0.0", + "13.0.1" + ], + "91.0.4472.77": [ + "13.1.0", + "13.1.1", + "13.1.2" + ], + "91.0.4472.106": [ + "13.1.3", + "13.1.4" + ], + "91.0.4472.124": [ + "13.1.5", + "13.1.6", + "13.1.7" + ], + "91.0.4472.164": [ + "13.1.8", + "13.1.9", + "13.2.0", + "13.2.1", + "13.2.2", + "13.2.3", + "13.3.0", + "13.4.0", + "13.5.0", + "13.5.1", + "13.5.2", + "13.6.0", + "13.6.1", + "13.6.2", + "13.6.3", + "13.6.6", + "13.6.7", + "13.6.8", + "13.6.9" + ], + "92.0.4511.0": [ + "14.0.0-beta.1", + "14.0.0-beta.2", + "14.0.0-beta.3" + ], + "93.0.4536.0": [ + "14.0.0-beta.5", + "14.0.0-beta.6", + "14.0.0-beta.7", + "14.0.0-beta.8" + ], + "93.0.4539.0": [ + "14.0.0-beta.9", + "14.0.0-beta.10" + ], + "93.0.4557.4": [ + "14.0.0-beta.11", + "14.0.0-beta.12" + ], + "93.0.4566.0": [ + "14.0.0-beta.13", + "14.0.0-beta.14", + "14.0.0-beta.15", + "14.0.0-beta.16", + "14.0.0-beta.17", + "15.0.0-alpha.1", + "15.0.0-alpha.2" + ], + "93.0.4577.15": [ + "14.0.0-beta.18", + "14.0.0-beta.19", + "14.0.0-beta.20", + "14.0.0-beta.21" + ], + "93.0.4577.25": [ + "14.0.0-beta.22", + "14.0.0-beta.23" + ], + "93.0.4577.51": [ + "14.0.0-beta.24", + "14.0.0-beta.25" + ], + "93.0.4577.58": [ + "14.0.0" + ], + "93.0.4577.63": [ + "14.0.1" + ], + "93.0.4577.82": [ + "14.0.2", + "14.1.0", + "14.1.1", + "14.2.0", + "14.2.1", + "14.2.2", + "14.2.3", + "14.2.4", + "14.2.5", + "14.2.6", + "14.2.7", + "14.2.8", + "14.2.9" + ], + "94.0.4584.0": [ + "15.0.0-alpha.3", + "15.0.0-alpha.4", + "15.0.0-alpha.5", + "15.0.0-alpha.6" + ], + "94.0.4590.2": [ + "15.0.0-alpha.7", + "15.0.0-alpha.8", + "15.0.0-alpha.9" + ], + "94.0.4606.12": [ + "15.0.0-alpha.10" + ], + "94.0.4606.20": [ + "15.0.0-beta.1", + "15.0.0-beta.2" + ], + "94.0.4606.31": [ + "15.0.0-beta.3", + "15.0.0-beta.4", + "15.0.0-beta.5", + "15.0.0-beta.6", + "15.0.0-beta.7" + ], + "94.0.4606.51": [ + "15.0.0" + ], + "94.0.4606.61": [ + "15.1.0", + "15.1.1" + ], + "94.0.4606.71": [ + "15.1.2" + ], + "94.0.4606.81": [ + "15.2.0", + "15.3.0", + "15.3.1", + "15.3.2", + "15.3.3", + "15.3.4", + "15.3.5", + "15.3.6", + "15.3.7", + "15.4.0", + "15.4.1", + "15.4.2", + "15.5.0", + "15.5.1", + "15.5.2", + "15.5.3", + "15.5.4", + "15.5.5", + "15.5.6", + "15.5.7" + ], + "95.0.4629.0": [ + "16.0.0-alpha.1", + "16.0.0-alpha.2", + "16.0.0-alpha.3", + "16.0.0-alpha.4", + "16.0.0-alpha.5", + "16.0.0-alpha.6", + "16.0.0-alpha.7" + ], + "96.0.4647.0": [ + "16.0.0-alpha.8", + "16.0.0-alpha.9", + "16.0.0-beta.1", + "16.0.0-beta.2", + "16.0.0-beta.3" + ], + "96.0.4664.18": [ + "16.0.0-beta.4", + "16.0.0-beta.5" + ], + "96.0.4664.27": [ + "16.0.0-beta.6", + "16.0.0-beta.7" + ], + "96.0.4664.35": [ + "16.0.0-beta.8", + "16.0.0-beta.9" + ], + "96.0.4664.45": [ + "16.0.0", + "16.0.1" + ], + "96.0.4664.55": [ + "16.0.2", + "16.0.3", + "16.0.4", + "16.0.5" + ], + "96.0.4664.110": [ + "16.0.6", + "16.0.7", + "16.0.8" + ], + "96.0.4664.174": [ + "16.0.9", + "16.0.10", + "16.1.0", + "16.1.1", + "16.2.0", + "16.2.1", + "16.2.2", + "16.2.3", + "16.2.4", + "16.2.5", + "16.2.6", + "16.2.7", + "16.2.8" + ], + "96.0.4664.4": [ + "17.0.0-alpha.1", + "17.0.0-alpha.2", + "17.0.0-alpha.3" + ], + "98.0.4706.0": [ + "17.0.0-alpha.4", + "17.0.0-alpha.5", + "17.0.0-alpha.6", + "17.0.0-beta.1", + "17.0.0-beta.2" + ], + "98.0.4758.9": [ + "17.0.0-beta.3" + ], + "98.0.4758.11": [ + "17.0.0-beta.4", + "17.0.0-beta.5", + "17.0.0-beta.6", + "17.0.0-beta.7", + "17.0.0-beta.8", + "17.0.0-beta.9" + ], + "98.0.4758.74": [ + "17.0.0" + ], + "98.0.4758.82": [ + "17.0.1" + ], + "98.0.4758.102": [ + "17.1.0" + ], + "98.0.4758.109": [ + "17.1.1", + "17.1.2", + "17.2.0" + ], + "98.0.4758.141": [ + "17.3.0", + "17.3.1", + "17.4.0", + "17.4.1", + "17.4.2", + "17.4.3", + "17.4.4", + "17.4.5", + "17.4.6", + "17.4.7", + "17.4.8", + "17.4.9", + "17.4.10", + "17.4.11" + ], + "99.0.4767.0": [ + "18.0.0-alpha.1", + "18.0.0-alpha.2", + "18.0.0-alpha.3", + "18.0.0-alpha.4", + "18.0.0-alpha.5" + ], + "100.0.4894.0": [ + "18.0.0-beta.1", + "18.0.0-beta.2", + "18.0.0-beta.3", + "18.0.0-beta.4", + "18.0.0-beta.5", + "18.0.0-beta.6" + ], + "100.0.4896.56": [ + "18.0.0" + ], + "100.0.4896.60": [ + "18.0.1", + "18.0.2" + ], + "100.0.4896.75": [ + "18.0.3", + "18.0.4" + ], + "100.0.4896.127": [ + "18.1.0" + ], + "100.0.4896.143": [ + "18.2.0", + "18.2.1", + "18.2.2", + "18.2.3" + ], + "100.0.4896.160": [ + "18.2.4", + "18.3.0", + "18.3.1", + "18.3.2", + "18.3.3", + "18.3.4", + "18.3.5", + "18.3.6", + "18.3.7", + "18.3.8", + "18.3.9", + "18.3.11", + "18.3.12", + "18.3.13", + "18.3.14", + "18.3.15" + ], + "102.0.4962.3": [ + "19.0.0-alpha.1" + ], + "102.0.4971.0": [ + "19.0.0-alpha.2", + "19.0.0-alpha.3" + ], + "102.0.4989.0": [ + "19.0.0-alpha.4", + "19.0.0-alpha.5" + ], + "102.0.4999.0": [ + "19.0.0-beta.1", + "19.0.0-beta.2", + "19.0.0-beta.3" + ], + "102.0.5005.27": [ + "19.0.0-beta.4" + ], + "102.0.5005.40": [ + "19.0.0-beta.5", + "19.0.0-beta.6", + "19.0.0-beta.7" + ], + "102.0.5005.49": [ + "19.0.0-beta.8" + ], + "102.0.5005.61": [ + "19.0.0", + "19.0.1" + ], + "102.0.5005.63": [ + "19.0.2", + "19.0.3", + "19.0.4" + ], + "102.0.5005.115": [ + "19.0.5", + "19.0.6" + ], + "102.0.5005.134": [ + "19.0.7" + ], + "102.0.5005.148": [ + "19.0.8" + ], + "102.0.5005.167": [ + "19.0.9", + "19.0.10", + "19.0.11", + "19.0.12", + "19.0.13", + "19.0.14", + "19.0.15", + "19.0.16", + "19.0.17", + "19.1.0", + "19.1.1", + "19.1.2", + "19.1.3", + "19.1.4", + "19.1.5", + "19.1.6", + "19.1.7", + "19.1.8", + "19.1.9" + ], + "103.0.5044.0": [ + "20.0.0-alpha.1" + ], + "104.0.5073.0": [ + "20.0.0-alpha.2", + "20.0.0-alpha.3", + "20.0.0-alpha.4", + "20.0.0-alpha.5", + "20.0.0-alpha.6", + "20.0.0-alpha.7", + "20.0.0-beta.1", + "20.0.0-beta.2", + "20.0.0-beta.3", + "20.0.0-beta.4", + "20.0.0-beta.5", + "20.0.0-beta.6", + "20.0.0-beta.7", + "20.0.0-beta.8" + ], + "104.0.5112.39": [ + "20.0.0-beta.9" + ], + "104.0.5112.48": [ + "20.0.0-beta.10", + "20.0.0-beta.11", + "20.0.0-beta.12" + ], + "104.0.5112.57": [ + "20.0.0-beta.13" + ], + "104.0.5112.65": [ + "20.0.0" + ], + "104.0.5112.81": [ + "20.0.1", + "20.0.2", + "20.0.3" + ], + "104.0.5112.102": [ + "20.1.0", + "20.1.1" + ], + "104.0.5112.114": [ + "20.1.2", + "20.1.3", + "20.1.4" + ], + "104.0.5112.124": [ + "20.2.0", + "20.3.0", + "20.3.1", + "20.3.2", + "20.3.3", + "20.3.4", + "20.3.5", + "20.3.6", + "20.3.7", + "20.3.8", + "20.3.9", + "20.3.10", + "20.3.11", + "20.3.12" + ], + "105.0.5187.0": [ + "21.0.0-alpha.1", + "21.0.0-alpha.2", + "21.0.0-alpha.3", + "21.0.0-alpha.4", + "21.0.0-alpha.5" + ], + "106.0.5216.0": [ + "21.0.0-alpha.6", + "21.0.0-beta.1", + "21.0.0-beta.2", + "21.0.0-beta.3", + "21.0.0-beta.4", + "21.0.0-beta.5" + ], + "106.0.5249.40": [ + "21.0.0-beta.6", + "21.0.0-beta.7", + "21.0.0-beta.8" + ], + "106.0.5249.51": [ + "21.0.0" + ], + "106.0.5249.61": [ + "21.0.1" + ], + "106.0.5249.91": [ + "21.1.0" + ], + "106.0.5249.103": [ + "21.1.1" + ], + "106.0.5249.119": [ + "21.2.0" + ], + "106.0.5249.165": [ + "21.2.1" + ], + "106.0.5249.168": [ + "21.2.2", + "21.2.3" + ], + "106.0.5249.181": [ + "21.3.0", + "21.3.1" + ], + "106.0.5249.199": [ + "21.3.3", + "21.3.4", + "21.3.5", + "21.4.0", + "21.4.1", + "21.4.2", + "21.4.3", + "21.4.4" + ], + "107.0.5286.0": [ + "22.0.0-alpha.1" + ], + "108.0.5329.0": [ + "22.0.0-alpha.3", + "22.0.0-alpha.4", + "22.0.0-alpha.5", + "22.0.0-alpha.6" + ], + "108.0.5355.0": [ + "22.0.0-alpha.7" + ], + "108.0.5359.10": [ + "22.0.0-alpha.8", + "22.0.0-beta.1", + "22.0.0-beta.2", + "22.0.0-beta.3" + ], + "108.0.5359.29": [ + "22.0.0-beta.4" + ], + "108.0.5359.40": [ + "22.0.0-beta.5", + "22.0.0-beta.6" + ], + "108.0.5359.48": [ + "22.0.0-beta.7", + "22.0.0-beta.8" + ], + "108.0.5359.62": [ + "22.0.0" + ], + "108.0.5359.125": [ + "22.0.1" + ], + "108.0.5359.179": [ + "22.0.2", + "22.0.3", + "22.1.0" + ], + "108.0.5359.215": [ + "22.2.0", + "22.2.1", + "22.3.0", + "22.3.1", + "22.3.2", + "22.3.3", + "22.3.4", + "22.3.5", + "22.3.6", + "22.3.7", + "22.3.8", + "22.3.9", + "22.3.10", + "22.3.11", + "22.3.12", + "22.3.13", + "22.3.14", + "22.3.15", + "22.3.16", + "22.3.17", + "22.3.18", + "22.3.20", + "22.3.21", + "22.3.22", + "22.3.23", + "22.3.24", + "22.3.25", + "22.3.26", + "22.3.27" + ], + "110.0.5415.0": [ + "23.0.0-alpha.1" + ], + "110.0.5451.0": [ + "23.0.0-alpha.2", + "23.0.0-alpha.3" + ], + "110.0.5478.5": [ + "23.0.0-beta.1", + "23.0.0-beta.2", + "23.0.0-beta.3" + ], + "110.0.5481.30": [ + "23.0.0-beta.4" + ], + "110.0.5481.38": [ + "23.0.0-beta.5" + ], + "110.0.5481.52": [ + "23.0.0-beta.6", + "23.0.0-beta.8" + ], + "110.0.5481.77": [ + "23.0.0" + ], + "110.0.5481.100": [ + "23.1.0" + ], + "110.0.5481.104": [ + "23.1.1" + ], + "110.0.5481.177": [ + "23.1.2" + ], + "110.0.5481.179": [ + "23.1.3" + ], + "110.0.5481.192": [ + "23.1.4", + "23.2.0" + ], + "110.0.5481.208": [ + "23.2.1", + "23.2.2", + "23.2.3", + "23.2.4", + "23.3.0", + "23.3.1", + "23.3.2", + "23.3.3", + "23.3.4", + "23.3.5", + "23.3.6", + "23.3.7", + "23.3.8", + "23.3.9", + "23.3.10", + "23.3.11", + "23.3.12", + "23.3.13" + ], + "111.0.5560.0": [ + "24.0.0-alpha.1", + "24.0.0-alpha.2", + "24.0.0-alpha.3", + "24.0.0-alpha.4", + "24.0.0-alpha.5", + "24.0.0-alpha.6", + "24.0.0-alpha.7" + ], + "111.0.5563.50": [ + "24.0.0-beta.1", + "24.0.0-beta.2" + ], + "112.0.5615.20": [ + "24.0.0-beta.3", + "24.0.0-beta.4" + ], + "112.0.5615.29": [ + "24.0.0-beta.5" + ], + "112.0.5615.39": [ + "24.0.0-beta.6", + "24.0.0-beta.7" + ], + "112.0.5615.49": [ + "24.0.0" + ], + "112.0.5615.50": [ + "24.1.0", + "24.1.1" + ], + "112.0.5615.87": [ + "24.1.2" + ], + "112.0.5615.165": [ + "24.1.3", + "24.2.0", + "24.3.0" + ], + "112.0.5615.183": [ + "24.3.1" + ], + "112.0.5615.204": [ + "24.4.0", + "24.4.1", + "24.5.0", + "24.5.1", + "24.6.0", + "24.6.1", + "24.6.2", + "24.6.3", + "24.6.4", + "24.6.5", + "24.7.0", + "24.7.1", + "24.8.0", + "24.8.1", + "24.8.2", + "24.8.3", + "24.8.4", + "24.8.5", + "24.8.6", + "24.8.7", + "24.8.8" + ], + "114.0.5694.0": [ + "25.0.0-alpha.1", + "25.0.0-alpha.2" + ], + "114.0.5710.0": [ + "25.0.0-alpha.3", + "25.0.0-alpha.4" + ], + "114.0.5719.0": [ + "25.0.0-alpha.5", + "25.0.0-alpha.6", + "25.0.0-beta.1", + "25.0.0-beta.2", + "25.0.0-beta.3" + ], + "114.0.5735.16": [ + "25.0.0-beta.4", + "25.0.0-beta.5", + "25.0.0-beta.6", + "25.0.0-beta.7" + ], + "114.0.5735.35": [ + "25.0.0-beta.8" + ], + "114.0.5735.45": [ + "25.0.0-beta.9", + "25.0.0", + "25.0.1" + ], + "114.0.5735.106": [ + "25.1.0", + "25.1.1" + ], + "114.0.5735.134": [ + "25.2.0" + ], + "114.0.5735.199": [ + "25.3.0" + ], + "114.0.5735.243": [ + "25.3.1" + ], + "114.0.5735.248": [ + "25.3.2", + "25.4.0" + ], + "114.0.5735.289": [ + "25.5.0", + "25.6.0", + "25.7.0", + "25.8.0", + "25.8.1", + "25.8.2", + "25.8.3", + "25.8.4", + "25.9.0", + "25.9.1", + "25.9.2", + "25.9.3", + "25.9.4", + "25.9.5", + "25.9.6", + "25.9.7", + "25.9.8" + ], + "116.0.5791.0": [ + "26.0.0-alpha.1", + "26.0.0-alpha.2", + "26.0.0-alpha.3", + "26.0.0-alpha.4", + "26.0.0-alpha.5" + ], + "116.0.5815.0": [ + "26.0.0-alpha.6" + ], + "116.0.5831.0": [ + "26.0.0-alpha.7" + ], + "116.0.5845.0": [ + "26.0.0-alpha.8", + "26.0.0-beta.1" + ], + "116.0.5845.14": [ + "26.0.0-beta.2", + "26.0.0-beta.3", + "26.0.0-beta.4", + "26.0.0-beta.5", + "26.0.0-beta.6", + "26.0.0-beta.7" + ], + "116.0.5845.42": [ + "26.0.0-beta.8", + "26.0.0-beta.9" + ], + "116.0.5845.49": [ + "26.0.0-beta.10", + "26.0.0-beta.11" + ], + "116.0.5845.62": [ + "26.0.0-beta.12" + ], + "116.0.5845.82": [ + "26.0.0" + ], + "116.0.5845.97": [ + "26.1.0" + ], + "116.0.5845.179": [ + "26.2.0" + ], + "116.0.5845.188": [ + "26.2.1" + ], + "116.0.5845.190": [ + "26.2.2", + "26.2.3", + "26.2.4" + ], + "116.0.5845.228": [ + "26.3.0", + "26.4.0", + "26.4.1", + "26.4.2", + "26.4.3", + "26.5.0", + "26.6.0", + "26.6.1", + "26.6.2", + "26.6.3", + "26.6.4", + "26.6.5", + "26.6.6", + "26.6.7", + "26.6.8", + "26.6.9", + "26.6.10" + ], + "118.0.5949.0": [ + "27.0.0-alpha.1", + "27.0.0-alpha.2", + "27.0.0-alpha.3", + "27.0.0-alpha.4", + "27.0.0-alpha.5", + "27.0.0-alpha.6" + ], + "118.0.5993.5": [ + "27.0.0-beta.1", + "27.0.0-beta.2", + "27.0.0-beta.3" + ], + "118.0.5993.11": [ + "27.0.0-beta.4" + ], + "118.0.5993.18": [ + "27.0.0-beta.5", + "27.0.0-beta.6", + "27.0.0-beta.7", + "27.0.0-beta.8", + "27.0.0-beta.9" + ], + "118.0.5993.54": [ + "27.0.0" + ], + "118.0.5993.89": [ + "27.0.1", + "27.0.2" + ], + "118.0.5993.120": [ + "27.0.3" + ], + "118.0.5993.129": [ + "27.0.4" + ], + "118.0.5993.144": [ + "27.1.0", + "27.1.2" + ], + "118.0.5993.159": [ + "27.1.3", + "27.2.0", + "27.2.1", + "27.2.2", + "27.2.3", + "27.2.4", + "27.3.0", + "27.3.1", + "27.3.2", + "27.3.3", + "27.3.4", + "27.3.5", + "27.3.6", + "27.3.7", + "27.3.8", + "27.3.9", + "27.3.10", + "27.3.11" + ], + "119.0.6045.0": [ + "28.0.0-alpha.1", + "28.0.0-alpha.2" + ], + "119.0.6045.21": [ + "28.0.0-alpha.3", + "28.0.0-alpha.4" + ], + "119.0.6045.33": [ + "28.0.0-alpha.5", + "28.0.0-alpha.6", + "28.0.0-alpha.7", + "28.0.0-beta.1" + ], + "120.0.6099.0": [ + "28.0.0-beta.2" + ], + "120.0.6099.5": [ + "28.0.0-beta.3", + "28.0.0-beta.4" + ], + "120.0.6099.18": [ + "28.0.0-beta.5", + "28.0.0-beta.6", + "28.0.0-beta.7", + "28.0.0-beta.8", + "28.0.0-beta.9", + "28.0.0-beta.10" + ], + "120.0.6099.35": [ + "28.0.0-beta.11" + ], + "120.0.6099.56": [ + "28.0.0" + ], + "120.0.6099.109": [ + "28.1.0", + "28.1.1" + ], + "120.0.6099.199": [ + "28.1.2", + "28.1.3" + ], + "120.0.6099.216": [ + "28.1.4" + ], + "120.0.6099.227": [ + "28.2.0" + ], + "120.0.6099.268": [ + "28.2.1" + ], + "120.0.6099.276": [ + "28.2.2" + ], + "120.0.6099.283": [ + "28.2.3" + ], + "120.0.6099.291": [ + "28.2.4", + "28.2.5", + "28.2.6", + "28.2.7", + "28.2.8", + "28.2.9", + "28.2.10", + "28.3.0", + "28.3.1", + "28.3.2", + "28.3.3" + ], + "121.0.6147.0": [ + "29.0.0-alpha.1", + "29.0.0-alpha.2", + "29.0.0-alpha.3" + ], + "121.0.6159.0": [ + "29.0.0-alpha.4", + "29.0.0-alpha.5", + "29.0.0-alpha.6", + "29.0.0-alpha.7" + ], + "122.0.6194.0": [ + "29.0.0-alpha.8" + ], + "122.0.6236.2": [ + "29.0.0-alpha.9", + "29.0.0-alpha.10", + "29.0.0-alpha.11", + "29.0.0-beta.1", + "29.0.0-beta.2" + ], + "122.0.6261.6": [ + "29.0.0-beta.3", + "29.0.0-beta.4" + ], + "122.0.6261.18": [ + "29.0.0-beta.5", + "29.0.0-beta.6", + "29.0.0-beta.7", + "29.0.0-beta.8", + "29.0.0-beta.9", + "29.0.0-beta.10", + "29.0.0-beta.11" + ], + "122.0.6261.29": [ + "29.0.0-beta.12" + ], + "122.0.6261.39": [ + "29.0.0" + ], + "122.0.6261.57": [ + "29.0.1" + ], + "122.0.6261.70": [ + "29.1.0" + ], + "122.0.6261.111": [ + "29.1.1" + ], + "122.0.6261.112": [ + "29.1.2", + "29.1.3" + ], + "122.0.6261.129": [ + "29.1.4" + ], + "122.0.6261.130": [ + "29.1.5" + ], + "122.0.6261.139": [ + "29.1.6" + ], + "122.0.6261.156": [ + "29.2.0", + "29.3.0", + "29.3.1", + "29.3.2", + "29.3.3", + "29.4.0", + "29.4.1", + "29.4.2", + "29.4.3", + "29.4.4", + "29.4.5", + "29.4.6" + ], + "123.0.6296.0": [ + "30.0.0-alpha.1" + ], + "123.0.6312.5": [ + "30.0.0-alpha.2" + ], + "124.0.6323.0": [ + "30.0.0-alpha.3", + "30.0.0-alpha.4" + ], + "124.0.6331.0": [ + "30.0.0-alpha.5", + "30.0.0-alpha.6" + ], + "124.0.6353.0": [ + "30.0.0-alpha.7" + ], + "124.0.6359.0": [ + "30.0.0-beta.1", + "30.0.0-beta.2" + ], + "124.0.6367.9": [ + "30.0.0-beta.3", + "30.0.0-beta.4", + "30.0.0-beta.5" + ], + "124.0.6367.18": [ + "30.0.0-beta.6" + ], + "124.0.6367.29": [ + "30.0.0-beta.7", + "30.0.0-beta.8" + ], + "124.0.6367.49": [ + "30.0.0" + ], + "124.0.6367.60": [ + "30.0.1" + ], + "124.0.6367.91": [ + "30.0.2" + ], + "124.0.6367.119": [ + "30.0.3" + ], + "124.0.6367.201": [ + "30.0.4" + ], + "124.0.6367.207": [ + "30.0.5", + "30.0.6" + ], + "124.0.6367.221": [ + "30.0.7" + ], + "124.0.6367.230": [ + "30.0.8" + ], + "124.0.6367.233": [ + "30.0.9" + ], + "124.0.6367.243": [ + "30.1.0", + "30.1.1", + "30.1.2", + "30.2.0", + "30.3.0", + "30.3.1", + "30.4.0", + "30.5.0", + "30.5.1" + ], + "125.0.6412.0": [ + "31.0.0-alpha.1", + "31.0.0-alpha.2", + "31.0.0-alpha.3", + "31.0.0-alpha.4", + "31.0.0-alpha.5" + ], + "126.0.6445.0": [ + "31.0.0-beta.1", + "31.0.0-beta.2", + "31.0.0-beta.3", + "31.0.0-beta.4", + "31.0.0-beta.5", + "31.0.0-beta.6", + "31.0.0-beta.7", + "31.0.0-beta.8", + "31.0.0-beta.9" + ], + "126.0.6478.36": [ + "31.0.0-beta.10", + "31.0.0", + "31.0.1" + ], + "126.0.6478.61": [ + "31.0.2" + ], + "126.0.6478.114": [ + "31.1.0" + ], + "126.0.6478.127": [ + "31.2.0", + "31.2.1" + ], + "126.0.6478.183": [ + "31.3.0" + ], + "126.0.6478.185": [ + "31.3.1" + ], + "126.0.6478.234": [ + "31.4.0", + "31.5.0", + "31.6.0", + "31.7.0", + "31.7.1", + "31.7.2", + "31.7.3", + "31.7.4", + "31.7.5", + "31.7.6", + "31.7.7" + ], + "127.0.6521.0": [ + "32.0.0-alpha.1", + "32.0.0-alpha.2", + "32.0.0-alpha.3", + "32.0.0-alpha.4", + "32.0.0-alpha.5" + ], + "128.0.6571.0": [ + "32.0.0-alpha.6", + "32.0.0-alpha.7" + ], + "128.0.6573.0": [ + "32.0.0-alpha.8", + "32.0.0-alpha.9", + "32.0.0-alpha.10", + "32.0.0-beta.1" + ], + "128.0.6611.0": [ + "32.0.0-beta.2" + ], + "128.0.6613.7": [ + "32.0.0-beta.3" + ], + "128.0.6613.18": [ + "32.0.0-beta.4" + ], + "128.0.6613.27": [ + "32.0.0-beta.5", + "32.0.0-beta.6", + "32.0.0-beta.7" + ], + "128.0.6613.36": [ + "32.0.0", + "32.0.1" + ], + "128.0.6613.84": [ + "32.0.2" + ], + "128.0.6613.120": [ + "32.1.0" + ], + "128.0.6613.137": [ + "32.1.1" + ], + "128.0.6613.162": [ + "32.1.2" + ], + "128.0.6613.178": [ + "32.2.0" + ], + "128.0.6613.186": [ + "32.2.1", + "32.2.2", + "32.2.3", + "32.2.4", + "32.2.5", + "32.2.6", + "32.2.7", + "32.2.8", + "32.3.0", + "32.3.1", + "32.3.2", + "32.3.3" + ], + "129.0.6668.0": [ + "33.0.0-alpha.1" + ], + "130.0.6672.0": [ + "33.0.0-alpha.2", + "33.0.0-alpha.3", + "33.0.0-alpha.4", + "33.0.0-alpha.5", + "33.0.0-alpha.6", + "33.0.0-beta.1", + "33.0.0-beta.2", + "33.0.0-beta.3", + "33.0.0-beta.4" + ], + "130.0.6723.19": [ + "33.0.0-beta.5", + "33.0.0-beta.6", + "33.0.0-beta.7" + ], + "130.0.6723.31": [ + "33.0.0-beta.8", + "33.0.0-beta.9", + "33.0.0-beta.10" + ], + "130.0.6723.44": [ + "33.0.0-beta.11", + "33.0.0" + ], + "130.0.6723.59": [ + "33.0.1", + "33.0.2" + ], + "130.0.6723.91": [ + "33.1.0" + ], + "130.0.6723.118": [ + "33.2.0" + ], + "130.0.6723.137": [ + "33.2.1" + ], + "130.0.6723.152": [ + "33.3.0" + ], + "130.0.6723.170": [ + "33.3.1" + ], + "130.0.6723.191": [ + "33.3.2", + "33.4.0", + "33.4.1", + "33.4.2", + "33.4.3", + "33.4.4", + "33.4.5", + "33.4.6", + "33.4.7", + "33.4.8", + "33.4.9", + "33.4.10", + "33.4.11" + ], + "131.0.6776.0": [ + "34.0.0-alpha.1" + ], + "132.0.6779.0": [ + "34.0.0-alpha.2" + ], + "132.0.6789.1": [ + "34.0.0-alpha.3", + "34.0.0-alpha.4", + "34.0.0-alpha.5", + "34.0.0-alpha.6", + "34.0.0-alpha.7" + ], + "132.0.6820.0": [ + "34.0.0-alpha.8" + ], + "132.0.6824.0": [ + "34.0.0-alpha.9", + "34.0.0-beta.1", + "34.0.0-beta.2", + "34.0.0-beta.3" + ], + "132.0.6834.6": [ + "34.0.0-beta.4", + "34.0.0-beta.5" + ], + "132.0.6834.15": [ + "34.0.0-beta.6", + "34.0.0-beta.7", + "34.0.0-beta.8" + ], + "132.0.6834.32": [ + "34.0.0-beta.9", + "34.0.0-beta.10", + "34.0.0-beta.11" + ], + "132.0.6834.46": [ + "34.0.0-beta.12", + "34.0.0-beta.13" + ], + "132.0.6834.57": [ + "34.0.0-beta.14", + "34.0.0-beta.15", + "34.0.0-beta.16" + ], + "132.0.6834.83": [ + "34.0.0", + "34.0.1" + ], + "132.0.6834.159": [ + "34.0.2" + ], + "132.0.6834.194": [ + "34.1.0", + "34.1.1" + ], + "132.0.6834.196": [ + "34.2.0" + ], + "132.0.6834.210": [ + "34.3.0", + "34.3.1", + "34.3.2", + "34.3.3", + "34.3.4", + "34.4.0", + "34.4.1", + "34.5.0", + "34.5.1", + "34.5.2", + "34.5.3", + "34.5.4", + "34.5.5", + "34.5.6", + "34.5.7", + "34.5.8" + ], + "133.0.6920.0": [ + "35.0.0-alpha.1", + "35.0.0-alpha.2", + "35.0.0-alpha.3", + "35.0.0-alpha.4", + "35.0.0-alpha.5", + "35.0.0-beta.1" + ], + "134.0.6968.0": [ + "35.0.0-beta.2", + "35.0.0-beta.3", + "35.0.0-beta.4" + ], + "134.0.6989.0": [ + "35.0.0-beta.5" + ], + "134.0.6990.0": [ + "35.0.0-beta.6", + "35.0.0-beta.7" + ], + "134.0.6998.10": [ + "35.0.0-beta.8", + "35.0.0-beta.9" + ], + "134.0.6998.23": [ + "35.0.0-beta.10", + "35.0.0-beta.11", + "35.0.0-beta.12" + ], + "134.0.6998.44": [ + "35.0.0-beta.13", + "35.0.0", + "35.0.1" + ], + "134.0.6998.88": [ + "35.0.2", + "35.0.3" + ], + "134.0.6998.165": [ + "35.1.0", + "35.1.1" + ], + "134.0.6998.178": [ + "35.1.2" + ], + "134.0.6998.179": [ + "35.1.3", + "35.1.4", + "35.1.5" + ], + "134.0.6998.205": [ + "35.2.0", + "35.2.1", + "35.2.2", + "35.3.0", + "35.4.0", + "35.5.0", + "35.5.1", + "35.6.0", + "35.7.0", + "35.7.1", + "35.7.2", + "35.7.4", + "35.7.5" + ], + "135.0.7049.5": [ + "36.0.0-alpha.1" + ], + "136.0.7062.0": [ + "36.0.0-alpha.2", + "36.0.0-alpha.3", + "36.0.0-alpha.4" + ], + "136.0.7067.0": [ + "36.0.0-alpha.5", + "36.0.0-alpha.6", + "36.0.0-beta.1", + "36.0.0-beta.2", + "36.0.0-beta.3", + "36.0.0-beta.4" + ], + "136.0.7103.17": [ + "36.0.0-beta.5" + ], + "136.0.7103.25": [ + "36.0.0-beta.6", + "36.0.0-beta.7" + ], + "136.0.7103.33": [ + "36.0.0-beta.8", + "36.0.0-beta.9" + ], + "136.0.7103.48": [ + "36.0.0", + "36.0.1" + ], + "136.0.7103.49": [ + "36.1.0", + "36.2.0" + ], + "136.0.7103.93": [ + "36.2.1" + ], + "136.0.7103.113": [ + "36.3.0", + "36.3.1" + ], + "136.0.7103.115": [ + "36.3.2" + ], + "136.0.7103.149": [ + "36.4.0" + ], + "136.0.7103.168": [ + "36.5.0" + ], + "136.0.7103.177": [ + "36.6.0", + "36.7.0", + "36.7.1", + "36.7.3", + "36.7.4", + "36.8.0", + "36.8.1", + "36.9.0", + "36.9.1", + "36.9.2", + "36.9.3", + "36.9.4", + "36.9.5" + ], + "137.0.7151.0": [ + "37.0.0-alpha.1", + "37.0.0-alpha.2" + ], + "138.0.7156.0": [ + "37.0.0-alpha.3" + ], + "138.0.7165.0": [ + "37.0.0-alpha.4" + ], + "138.0.7177.0": [ + "37.0.0-alpha.5" + ], + "138.0.7178.0": [ + "37.0.0-alpha.6", + "37.0.0-alpha.7", + "37.0.0-beta.1", + "37.0.0-beta.2" + ], + "138.0.7190.0": [ + "37.0.0-beta.3" + ], + "138.0.7204.15": [ + "37.0.0-beta.4", + "37.0.0-beta.5", + "37.0.0-beta.6", + "37.0.0-beta.7" + ], + "138.0.7204.23": [ + "37.0.0-beta.8" + ], + "138.0.7204.35": [ + "37.0.0-beta.9", + "37.0.0", + "37.1.0" + ], + "138.0.7204.97": [ + "37.2.0", + "37.2.1" + ], + "138.0.7204.100": [ + "37.2.2", + "37.2.3" + ], + "138.0.7204.157": [ + "37.2.4" + ], + "138.0.7204.168": [ + "37.2.5" + ], + "138.0.7204.185": [ + "37.2.6" + ], + "138.0.7204.224": [ + "37.3.0" + ], + "138.0.7204.235": [ + "37.3.1" + ], + "138.0.7204.243": [ + "37.4.0" + ], + "138.0.7204.251": [ + "37.5.0", + "37.5.1", + "37.6.0", + "37.6.1", + "37.7.0", + "37.7.1", + "37.8.0", + "37.9.0", + "37.10.0", + "37.10.1", + "37.10.2", + "37.10.3" + ], + "139.0.7219.0": [ + "38.0.0-alpha.1", + "38.0.0-alpha.2", + "38.0.0-alpha.3" + ], + "140.0.7261.0": [ + "38.0.0-alpha.4", + "38.0.0-alpha.5", + "38.0.0-alpha.6" + ], + "140.0.7281.0": [ + "38.0.0-alpha.7", + "38.0.0-alpha.8" + ], + "140.0.7301.0": [ + "38.0.0-alpha.9" + ], + "140.0.7309.0": [ + "38.0.0-alpha.10" + ], + "140.0.7312.0": [ + "38.0.0-alpha.11" + ], + "140.0.7314.0": [ + "38.0.0-alpha.12", + "38.0.0-alpha.13", + "38.0.0-beta.1" + ], + "140.0.7327.0": [ + "38.0.0-beta.2", + "38.0.0-beta.3" + ], + "140.0.7339.2": [ + "38.0.0-beta.4", + "38.0.0-beta.5", + "38.0.0-beta.6" + ], + "140.0.7339.16": [ + "38.0.0-beta.7" + ], + "140.0.7339.24": [ + "38.0.0-beta.8", + "38.0.0-beta.9" + ], + "140.0.7339.41": [ + "38.0.0-beta.11", + "38.0.0" + ], + "140.0.7339.80": [ + "38.1.0" + ], + "140.0.7339.133": [ + "38.1.1", + "38.1.2", + "38.2.0", + "38.2.1", + "38.2.2" + ], + "140.0.7339.240": [ + "38.3.0", + "38.4.0" + ], + "140.0.7339.249": [ + "38.5.0", + "38.6.0", + "38.7.0", + "38.7.1", + "38.7.2" + ], + "141.0.7361.0": [ + "39.0.0-alpha.1", + "39.0.0-alpha.2" + ], + "141.0.7390.7": [ + "39.0.0-alpha.3", + "39.0.0-alpha.4", + "39.0.0-alpha.5" + ], + "142.0.7417.0": [ + "39.0.0-alpha.6", + "39.0.0-alpha.7", + "39.0.0-alpha.8", + "39.0.0-alpha.9", + "39.0.0-beta.1", + "39.0.0-beta.2", + "39.0.0-beta.3" + ], + "142.0.7444.34": [ + "39.0.0-beta.4", + "39.0.0-beta.5" + ], + "142.0.7444.52": [ + "39.0.0" + ], + "142.0.7444.59": [ + "39.1.0", + "39.1.1" + ], + "142.0.7444.134": [ + "39.1.2" + ], + "142.0.7444.162": [ + "39.2.0", + "39.2.1", + "39.2.2" + ], + "142.0.7444.175": [ + "39.2.3" + ], + "142.0.7444.177": [ + "39.2.4", + "39.2.5" + ], + "142.0.7444.226": [ + "39.2.6" + ], + "143.0.7499.0": [ + "40.0.0-alpha.2" + ], + "144.0.7506.0": [ + "40.0.0-alpha.4" + ], + "144.0.7526.0": [ + "40.0.0-alpha.5", + "40.0.0-alpha.6", + "40.0.0-alpha.7", + "40.0.0-alpha.8" + ], + "144.0.7527.0": [ + "40.0.0-beta.1", + "40.0.0-beta.2" + ] +}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-chromium-versions.json b/node_modules/electron-to-chromium/full-chromium-versions.json new file mode 100644 index 0000000..934d137 --- /dev/null +++ b/node_modules/electron-to-chromium/full-chromium-versions.json @@ -0,0 +1 @@ +{"39.0.2171.65":["0.20.0","0.20.1","0.20.2","0.20.3","0.20.4","0.20.5","0.20.6","0.20.7","0.20.8"],"40.0.2214.91":["0.21.0","0.21.1","0.21.2"],"41.0.2272.76":["0.21.3","0.22.1","0.22.2","0.22.3","0.23.0","0.24.0"],"42.0.2311.107":["0.25.0","0.25.1","0.25.2","0.25.3","0.26.0","0.26.1","0.27.0","0.27.1"],"43.0.2357.65":["0.27.2","0.27.3","0.28.0","0.28.1","0.28.2","0.28.3","0.29.1","0.29.2"],"44.0.2403.125":["0.30.4","0.31.0"],"45.0.2454.85":["0.31.2","0.32.2","0.32.3","0.33.0","0.33.1","0.33.2","0.33.3","0.33.4","0.33.6","0.33.7","0.33.8","0.33.9","0.34.0","0.34.1","0.34.2","0.34.3","0.34.4","0.35.1","0.35.2","0.35.3","0.35.4","0.35.5"],"47.0.2526.73":["0.36.0","0.36.2","0.36.3","0.36.4"],"47.0.2526.110":["0.36.5","0.36.6","0.36.7","0.36.8","0.36.9","0.36.10","0.36.11","0.36.12"],"49.0.2623.75":["0.37.0","0.37.1","0.37.3","0.37.4","0.37.5","0.37.6","0.37.7","0.37.8","1.0.0","1.0.1","1.0.2"],"50.0.2661.102":["1.1.0","1.1.1","1.1.2","1.1.3"],"51.0.2704.63":["1.2.0","1.2.1"],"51.0.2704.84":["1.2.2","1.2.3"],"51.0.2704.103":["1.2.4","1.2.5"],"51.0.2704.106":["1.2.6","1.2.7","1.2.8"],"52.0.2743.82":["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.9","1.3.10","1.3.13","1.3.14","1.3.15"],"53.0.2785.113":["1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5"],"53.0.2785.143":["1.4.6","1.4.7","1.4.8","1.4.10","1.4.11","1.4.13","1.4.14","1.4.15","1.4.16"],"54.0.2840.51":["1.4.12"],"54.0.2840.101":["1.5.0","1.5.1"],"56.0.2924.87":["1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","1.6.10","1.6.11","1.6.12","1.6.13","1.6.14","1.6.15","1.6.16","1.6.17","1.6.18"],"58.0.3029.110":["1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16"],"59.0.3071.115":["1.8.0","1.8.1","1.8.2-beta.1","1.8.2-beta.2","1.8.2-beta.3","1.8.2-beta.4","1.8.2-beta.5","1.8.2","1.8.3","1.8.4","1.8.5","1.8.6","1.8.7","1.8.8"],"61.0.3163.100":["2.0.0-beta.1","2.0.0-beta.2","2.0.0-beta.3","2.0.0-beta.4","2.0.0-beta.5","2.0.0-beta.6","2.0.0-beta.7","2.0.0-beta.8","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.0.10","2.0.11","2.0.12","2.0.13","2.0.14","2.0.15","2.0.16","2.0.17","2.0.18","2.1.0-unsupported.20180809"],"66.0.3359.181":["3.0.0-beta.1","3.0.0-beta.2","3.0.0-beta.3","3.0.0-beta.4","3.0.0-beta.5","3.0.0-beta.6","3.0.0-beta.7","3.0.0-beta.8","3.0.0-beta.9","3.0.0-beta.10","3.0.0-beta.11","3.0.0-beta.12","3.0.0-beta.13","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.0.7","3.0.8","3.0.9","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.1.0-beta.1","3.1.0-beta.2","3.1.0-beta.3","3.1.0-beta.4","3.1.0-beta.5","3.1.0","3.1.1","3.1.2","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9","3.1.10","3.1.11","3.1.12","3.1.13"],"69.0.3497.106":["4.0.0-beta.1","4.0.0-beta.2","4.0.0-beta.3","4.0.0-beta.4","4.0.0-beta.5","4.0.0-beta.6","4.0.0-beta.7","4.0.0-beta.8","4.0.0-beta.9","4.0.0-beta.10","4.0.0-beta.11","4.0.0","4.0.1","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6"],"69.0.3497.128":["4.0.7","4.0.8","4.1.0","4.1.1","4.1.2","4.1.3","4.1.4","4.1.5","4.2.0","4.2.1","4.2.2","4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.2.10","4.2.11","4.2.12"],"72.0.3626.52":["5.0.0-beta.1","5.0.0-beta.2"],"73.0.3683.27":["5.0.0-beta.3"],"73.0.3683.54":["5.0.0-beta.4"],"73.0.3683.61":["5.0.0-beta.5"],"73.0.3683.84":["5.0.0-beta.6"],"73.0.3683.94":["5.0.0-beta.7"],"73.0.3683.104":["5.0.0-beta.8"],"73.0.3683.117":["5.0.0-beta.9"],"73.0.3683.119":["5.0.0"],"73.0.3683.121":["5.0.1","5.0.2","5.0.3","5.0.4","5.0.5","5.0.6","5.0.7","5.0.8","5.0.9","5.0.10","5.0.11","5.0.12","5.0.13"],"76.0.3774.1":["6.0.0-beta.1"],"76.0.3783.1":["6.0.0-beta.2","6.0.0-beta.3","6.0.0-beta.4"],"76.0.3805.4":["6.0.0-beta.5"],"76.0.3809.3":["6.0.0-beta.6"],"76.0.3809.22":["6.0.0-beta.7"],"76.0.3809.26":["6.0.0-beta.8","6.0.0-beta.9"],"76.0.3809.37":["6.0.0-beta.10"],"76.0.3809.42":["6.0.0-beta.11"],"76.0.3809.54":["6.0.0-beta.12"],"76.0.3809.60":["6.0.0-beta.13"],"76.0.3809.68":["6.0.0-beta.14"],"76.0.3809.74":["6.0.0-beta.15"],"76.0.3809.88":["6.0.0"],"76.0.3809.102":["6.0.1"],"76.0.3809.110":["6.0.2"],"76.0.3809.126":["6.0.3"],"76.0.3809.131":["6.0.4"],"76.0.3809.136":["6.0.5"],"76.0.3809.138":["6.0.6"],"76.0.3809.139":["6.0.7"],"76.0.3809.146":["6.0.8","6.0.9","6.0.10","6.0.11","6.0.12","6.1.0","6.1.1","6.1.2","6.1.3","6.1.4","6.1.5","6.1.6","6.1.7","6.1.8","6.1.9","6.1.10","6.1.11","6.1.12"],"78.0.3866.0":["7.0.0-beta.1","7.0.0-beta.2","7.0.0-beta.3"],"78.0.3896.6":["7.0.0-beta.4"],"78.0.3905.1":["7.0.0-beta.5","7.0.0-beta.6","7.0.0-beta.7","7.0.0"],"78.0.3904.92":["7.0.1"],"78.0.3904.94":["7.1.0"],"78.0.3904.99":["7.1.1"],"78.0.3904.113":["7.1.2"],"78.0.3904.126":["7.1.3"],"78.0.3904.130":["7.1.4","7.1.5","7.1.6","7.1.7","7.1.8","7.1.9","7.1.10","7.1.11","7.1.12","7.1.13","7.1.14","7.2.0","7.2.1","7.2.2","7.2.3","7.2.4","7.3.0","7.3.1","7.3.2","7.3.3"],"79.0.3931.0":["8.0.0-beta.1","8.0.0-beta.2"],"80.0.3955.0":["8.0.0-beta.3","8.0.0-beta.4"],"80.0.3987.14":["8.0.0-beta.5"],"80.0.3987.51":["8.0.0-beta.6"],"80.0.3987.59":["8.0.0-beta.7"],"80.0.3987.75":["8.0.0-beta.8","8.0.0-beta.9"],"80.0.3987.86":["8.0.0","8.0.1","8.0.2"],"80.0.3987.134":["8.0.3"],"80.0.3987.137":["8.1.0"],"80.0.3987.141":["8.1.1"],"80.0.3987.158":["8.2.0"],"80.0.3987.163":["8.2.1","8.2.2","8.2.3","8.5.3","8.5.4","8.5.5"],"80.0.3987.165":["8.2.4","8.2.5","8.3.0","8.3.1","8.3.2","8.3.3","8.3.4","8.4.0","8.4.1","8.5.0","8.5.1","8.5.2"],"82.0.4048.0":["9.0.0-beta.1","9.0.0-beta.2","9.0.0-beta.3","9.0.0-beta.4","9.0.0-beta.5"],"82.0.4058.2":["9.0.0-beta.6","9.0.0-beta.7","9.0.0-beta.9"],"82.0.4085.10":["9.0.0-beta.10"],"82.0.4085.14":["9.0.0-beta.11","9.0.0-beta.12","9.0.0-beta.13"],"82.0.4085.27":["9.0.0-beta.14"],"83.0.4102.3":["9.0.0-beta.15","9.0.0-beta.16"],"83.0.4103.14":["9.0.0-beta.17"],"83.0.4103.16":["9.0.0-beta.18"],"83.0.4103.24":["9.0.0-beta.19"],"83.0.4103.26":["9.0.0-beta.20","9.0.0-beta.21"],"83.0.4103.34":["9.0.0-beta.22"],"83.0.4103.44":["9.0.0-beta.23"],"83.0.4103.45":["9.0.0-beta.24"],"83.0.4103.64":["9.0.0"],"83.0.4103.94":["9.0.1","9.0.2"],"83.0.4103.100":["9.0.3"],"83.0.4103.104":["9.0.4"],"83.0.4103.119":["9.0.5"],"83.0.4103.122":["9.1.0","9.1.1","9.1.2","9.2.0","9.2.1","9.3.0","9.3.1","9.3.2","9.3.3","9.3.4","9.3.5","9.4.0","9.4.1","9.4.2","9.4.3","9.4.4"],"84.0.4129.0":["10.0.0-beta.1","10.0.0-beta.2"],"85.0.4161.2":["10.0.0-beta.3","10.0.0-beta.4"],"85.0.4181.1":["10.0.0-beta.8","10.0.0-beta.9"],"85.0.4183.19":["10.0.0-beta.10"],"85.0.4183.20":["10.0.0-beta.11"],"85.0.4183.26":["10.0.0-beta.12"],"85.0.4183.39":["10.0.0-beta.13","10.0.0-beta.14","10.0.0-beta.15","10.0.0-beta.17","10.0.0-beta.19","10.0.0-beta.20","10.0.0-beta.21"],"85.0.4183.70":["10.0.0-beta.23"],"85.0.4183.78":["10.0.0-beta.24"],"85.0.4183.80":["10.0.0-beta.25"],"85.0.4183.84":["10.0.0"],"85.0.4183.86":["10.0.1"],"85.0.4183.87":["10.1.0"],"85.0.4183.93":["10.1.1"],"85.0.4183.98":["10.1.2"],"85.0.4183.121":["10.1.3","10.1.4","10.1.5","10.1.6","10.1.7","10.2.0","10.3.0","10.3.1","10.3.2","10.4.0","10.4.1","10.4.2","10.4.3","10.4.4","10.4.5","10.4.6","10.4.7"],"86.0.4234.0":["11.0.0-beta.1","11.0.0-beta.3","11.0.0-beta.4","11.0.0-beta.5","11.0.0-beta.6","11.0.0-beta.7"],"87.0.4251.1":["11.0.0-beta.8","11.0.0-beta.9","11.0.0-beta.11"],"87.0.4280.11":["11.0.0-beta.12","11.0.0-beta.13"],"87.0.4280.27":["11.0.0-beta.16","11.0.0-beta.17","11.0.0-beta.18","11.0.0-beta.19"],"87.0.4280.40":["11.0.0-beta.20"],"87.0.4280.47":["11.0.0-beta.22","11.0.0-beta.23"],"87.0.4280.60":["11.0.0","11.0.1"],"87.0.4280.67":["11.0.2","11.0.3","11.0.4"],"87.0.4280.88":["11.0.5","11.1.0","11.1.1"],"87.0.4280.141":["11.2.0","11.2.1","11.2.2","11.2.3","11.3.0","11.4.0","11.4.1","11.4.2","11.4.3","11.4.4","11.4.5","11.4.6","11.4.7","11.4.8","11.4.9","11.4.10","11.4.11","11.4.12","11.5.0"],"89.0.4328.0":["12.0.0-beta.1","12.0.0-beta.3","12.0.0-beta.4","12.0.0-beta.5","12.0.0-beta.6","12.0.0-beta.7","12.0.0-beta.8","12.0.0-beta.9","12.0.0-beta.10","12.0.0-beta.11","12.0.0-beta.12","12.0.0-beta.14"],"89.0.4348.1":["12.0.0-beta.16","12.0.0-beta.18","12.0.0-beta.19","12.0.0-beta.20"],"89.0.4388.2":["12.0.0-beta.21","12.0.0-beta.22","12.0.0-beta.23","12.0.0-beta.24","12.0.0-beta.25","12.0.0-beta.26"],"89.0.4389.23":["12.0.0-beta.27","12.0.0-beta.28","12.0.0-beta.29"],"89.0.4389.58":["12.0.0-beta.30","12.0.0-beta.31"],"89.0.4389.69":["12.0.0"],"89.0.4389.82":["12.0.1"],"89.0.4389.90":["12.0.2"],"89.0.4389.114":["12.0.3","12.0.4"],"89.0.4389.128":["12.0.5","12.0.6","12.0.7","12.0.8","12.0.9","12.0.10","12.0.11","12.0.12","12.0.13","12.0.14","12.0.15","12.0.16","12.0.17","12.0.18","12.1.0","12.1.1","12.1.2","12.2.0","12.2.1","12.2.2","12.2.3"],"90.0.4402.0":["13.0.0-beta.2","13.0.0-beta.3"],"90.0.4415.0":["13.0.0-beta.4","13.0.0-beta.5","13.0.0-beta.6","13.0.0-beta.7","13.0.0-beta.8","13.0.0-beta.9","13.0.0-beta.10","13.0.0-beta.11","13.0.0-beta.12","13.0.0-beta.13"],"91.0.4448.0":["13.0.0-beta.14","13.0.0-beta.16","13.0.0-beta.17","13.0.0-beta.18","13.0.0-beta.20"],"91.0.4472.33":["13.0.0-beta.21","13.0.0-beta.22","13.0.0-beta.23"],"91.0.4472.38":["13.0.0-beta.24","13.0.0-beta.25","13.0.0-beta.26","13.0.0-beta.27","13.0.0-beta.28"],"91.0.4472.69":["13.0.0","13.0.1"],"91.0.4472.77":["13.1.0","13.1.1","13.1.2"],"91.0.4472.106":["13.1.3","13.1.4"],"91.0.4472.124":["13.1.5","13.1.6","13.1.7"],"91.0.4472.164":["13.1.8","13.1.9","13.2.0","13.2.1","13.2.2","13.2.3","13.3.0","13.4.0","13.5.0","13.5.1","13.5.2","13.6.0","13.6.1","13.6.2","13.6.3","13.6.6","13.6.7","13.6.8","13.6.9"],"92.0.4511.0":["14.0.0-beta.1","14.0.0-beta.2","14.0.0-beta.3"],"93.0.4536.0":["14.0.0-beta.5","14.0.0-beta.6","14.0.0-beta.7","14.0.0-beta.8"],"93.0.4539.0":["14.0.0-beta.9","14.0.0-beta.10"],"93.0.4557.4":["14.0.0-beta.11","14.0.0-beta.12"],"93.0.4566.0":["14.0.0-beta.13","14.0.0-beta.14","14.0.0-beta.15","14.0.0-beta.16","14.0.0-beta.17","15.0.0-alpha.1","15.0.0-alpha.2"],"93.0.4577.15":["14.0.0-beta.18","14.0.0-beta.19","14.0.0-beta.20","14.0.0-beta.21"],"93.0.4577.25":["14.0.0-beta.22","14.0.0-beta.23"],"93.0.4577.51":["14.0.0-beta.24","14.0.0-beta.25"],"93.0.4577.58":["14.0.0"],"93.0.4577.63":["14.0.1"],"93.0.4577.82":["14.0.2","14.1.0","14.1.1","14.2.0","14.2.1","14.2.2","14.2.3","14.2.4","14.2.5","14.2.6","14.2.7","14.2.8","14.2.9"],"94.0.4584.0":["15.0.0-alpha.3","15.0.0-alpha.4","15.0.0-alpha.5","15.0.0-alpha.6"],"94.0.4590.2":["15.0.0-alpha.7","15.0.0-alpha.8","15.0.0-alpha.9"],"94.0.4606.12":["15.0.0-alpha.10"],"94.0.4606.20":["15.0.0-beta.1","15.0.0-beta.2"],"94.0.4606.31":["15.0.0-beta.3","15.0.0-beta.4","15.0.0-beta.5","15.0.0-beta.6","15.0.0-beta.7"],"94.0.4606.51":["15.0.0"],"94.0.4606.61":["15.1.0","15.1.1"],"94.0.4606.71":["15.1.2"],"94.0.4606.81":["15.2.0","15.3.0","15.3.1","15.3.2","15.3.3","15.3.4","15.3.5","15.3.6","15.3.7","15.4.0","15.4.1","15.4.2","15.5.0","15.5.1","15.5.2","15.5.3","15.5.4","15.5.5","15.5.6","15.5.7"],"95.0.4629.0":["16.0.0-alpha.1","16.0.0-alpha.2","16.0.0-alpha.3","16.0.0-alpha.4","16.0.0-alpha.5","16.0.0-alpha.6","16.0.0-alpha.7"],"96.0.4647.0":["16.0.0-alpha.8","16.0.0-alpha.9","16.0.0-beta.1","16.0.0-beta.2","16.0.0-beta.3"],"96.0.4664.18":["16.0.0-beta.4","16.0.0-beta.5"],"96.0.4664.27":["16.0.0-beta.6","16.0.0-beta.7"],"96.0.4664.35":["16.0.0-beta.8","16.0.0-beta.9"],"96.0.4664.45":["16.0.0","16.0.1"],"96.0.4664.55":["16.0.2","16.0.3","16.0.4","16.0.5"],"96.0.4664.110":["16.0.6","16.0.7","16.0.8"],"96.0.4664.174":["16.0.9","16.0.10","16.1.0","16.1.1","16.2.0","16.2.1","16.2.2","16.2.3","16.2.4","16.2.5","16.2.6","16.2.7","16.2.8"],"96.0.4664.4":["17.0.0-alpha.1","17.0.0-alpha.2","17.0.0-alpha.3"],"98.0.4706.0":["17.0.0-alpha.4","17.0.0-alpha.5","17.0.0-alpha.6","17.0.0-beta.1","17.0.0-beta.2"],"98.0.4758.9":["17.0.0-beta.3"],"98.0.4758.11":["17.0.0-beta.4","17.0.0-beta.5","17.0.0-beta.6","17.0.0-beta.7","17.0.0-beta.8","17.0.0-beta.9"],"98.0.4758.74":["17.0.0"],"98.0.4758.82":["17.0.1"],"98.0.4758.102":["17.1.0"],"98.0.4758.109":["17.1.1","17.1.2","17.2.0"],"98.0.4758.141":["17.3.0","17.3.1","17.4.0","17.4.1","17.4.2","17.4.3","17.4.4","17.4.5","17.4.6","17.4.7","17.4.8","17.4.9","17.4.10","17.4.11"],"99.0.4767.0":["18.0.0-alpha.1","18.0.0-alpha.2","18.0.0-alpha.3","18.0.0-alpha.4","18.0.0-alpha.5"],"100.0.4894.0":["18.0.0-beta.1","18.0.0-beta.2","18.0.0-beta.3","18.0.0-beta.4","18.0.0-beta.5","18.0.0-beta.6"],"100.0.4896.56":["18.0.0"],"100.0.4896.60":["18.0.1","18.0.2"],"100.0.4896.75":["18.0.3","18.0.4"],"100.0.4896.127":["18.1.0"],"100.0.4896.143":["18.2.0","18.2.1","18.2.2","18.2.3"],"100.0.4896.160":["18.2.4","18.3.0","18.3.1","18.3.2","18.3.3","18.3.4","18.3.5","18.3.6","18.3.7","18.3.8","18.3.9","18.3.11","18.3.12","18.3.13","18.3.14","18.3.15"],"102.0.4962.3":["19.0.0-alpha.1"],"102.0.4971.0":["19.0.0-alpha.2","19.0.0-alpha.3"],"102.0.4989.0":["19.0.0-alpha.4","19.0.0-alpha.5"],"102.0.4999.0":["19.0.0-beta.1","19.0.0-beta.2","19.0.0-beta.3"],"102.0.5005.27":["19.0.0-beta.4"],"102.0.5005.40":["19.0.0-beta.5","19.0.0-beta.6","19.0.0-beta.7"],"102.0.5005.49":["19.0.0-beta.8"],"102.0.5005.61":["19.0.0","19.0.1"],"102.0.5005.63":["19.0.2","19.0.3","19.0.4"],"102.0.5005.115":["19.0.5","19.0.6"],"102.0.5005.134":["19.0.7"],"102.0.5005.148":["19.0.8"],"102.0.5005.167":["19.0.9","19.0.10","19.0.11","19.0.12","19.0.13","19.0.14","19.0.15","19.0.16","19.0.17","19.1.0","19.1.1","19.1.2","19.1.3","19.1.4","19.1.5","19.1.6","19.1.7","19.1.8","19.1.9"],"103.0.5044.0":["20.0.0-alpha.1"],"104.0.5073.0":["20.0.0-alpha.2","20.0.0-alpha.3","20.0.0-alpha.4","20.0.0-alpha.5","20.0.0-alpha.6","20.0.0-alpha.7","20.0.0-beta.1","20.0.0-beta.2","20.0.0-beta.3","20.0.0-beta.4","20.0.0-beta.5","20.0.0-beta.6","20.0.0-beta.7","20.0.0-beta.8"],"104.0.5112.39":["20.0.0-beta.9"],"104.0.5112.48":["20.0.0-beta.10","20.0.0-beta.11","20.0.0-beta.12"],"104.0.5112.57":["20.0.0-beta.13"],"104.0.5112.65":["20.0.0"],"104.0.5112.81":["20.0.1","20.0.2","20.0.3"],"104.0.5112.102":["20.1.0","20.1.1"],"104.0.5112.114":["20.1.2","20.1.3","20.1.4"],"104.0.5112.124":["20.2.0","20.3.0","20.3.1","20.3.2","20.3.3","20.3.4","20.3.5","20.3.6","20.3.7","20.3.8","20.3.9","20.3.10","20.3.11","20.3.12"],"105.0.5187.0":["21.0.0-alpha.1","21.0.0-alpha.2","21.0.0-alpha.3","21.0.0-alpha.4","21.0.0-alpha.5"],"106.0.5216.0":["21.0.0-alpha.6","21.0.0-beta.1","21.0.0-beta.2","21.0.0-beta.3","21.0.0-beta.4","21.0.0-beta.5"],"106.0.5249.40":["21.0.0-beta.6","21.0.0-beta.7","21.0.0-beta.8"],"106.0.5249.51":["21.0.0"],"106.0.5249.61":["21.0.1"],"106.0.5249.91":["21.1.0"],"106.0.5249.103":["21.1.1"],"106.0.5249.119":["21.2.0"],"106.0.5249.165":["21.2.1"],"106.0.5249.168":["21.2.2","21.2.3"],"106.0.5249.181":["21.3.0","21.3.1"],"106.0.5249.199":["21.3.3","21.3.4","21.3.5","21.4.0","21.4.1","21.4.2","21.4.3","21.4.4"],"107.0.5286.0":["22.0.0-alpha.1"],"108.0.5329.0":["22.0.0-alpha.3","22.0.0-alpha.4","22.0.0-alpha.5","22.0.0-alpha.6"],"108.0.5355.0":["22.0.0-alpha.7"],"108.0.5359.10":["22.0.0-alpha.8","22.0.0-beta.1","22.0.0-beta.2","22.0.0-beta.3"],"108.0.5359.29":["22.0.0-beta.4"],"108.0.5359.40":["22.0.0-beta.5","22.0.0-beta.6"],"108.0.5359.48":["22.0.0-beta.7","22.0.0-beta.8"],"108.0.5359.62":["22.0.0"],"108.0.5359.125":["22.0.1"],"108.0.5359.179":["22.0.2","22.0.3","22.1.0"],"108.0.5359.215":["22.2.0","22.2.1","22.3.0","22.3.1","22.3.2","22.3.3","22.3.4","22.3.5","22.3.6","22.3.7","22.3.8","22.3.9","22.3.10","22.3.11","22.3.12","22.3.13","22.3.14","22.3.15","22.3.16","22.3.17","22.3.18","22.3.20","22.3.21","22.3.22","22.3.23","22.3.24","22.3.25","22.3.26","22.3.27"],"110.0.5415.0":["23.0.0-alpha.1"],"110.0.5451.0":["23.0.0-alpha.2","23.0.0-alpha.3"],"110.0.5478.5":["23.0.0-beta.1","23.0.0-beta.2","23.0.0-beta.3"],"110.0.5481.30":["23.0.0-beta.4"],"110.0.5481.38":["23.0.0-beta.5"],"110.0.5481.52":["23.0.0-beta.6","23.0.0-beta.8"],"110.0.5481.77":["23.0.0"],"110.0.5481.100":["23.1.0"],"110.0.5481.104":["23.1.1"],"110.0.5481.177":["23.1.2"],"110.0.5481.179":["23.1.3"],"110.0.5481.192":["23.1.4","23.2.0"],"110.0.5481.208":["23.2.1","23.2.2","23.2.3","23.2.4","23.3.0","23.3.1","23.3.2","23.3.3","23.3.4","23.3.5","23.3.6","23.3.7","23.3.8","23.3.9","23.3.10","23.3.11","23.3.12","23.3.13"],"111.0.5560.0":["24.0.0-alpha.1","24.0.0-alpha.2","24.0.0-alpha.3","24.0.0-alpha.4","24.0.0-alpha.5","24.0.0-alpha.6","24.0.0-alpha.7"],"111.0.5563.50":["24.0.0-beta.1","24.0.0-beta.2"],"112.0.5615.20":["24.0.0-beta.3","24.0.0-beta.4"],"112.0.5615.29":["24.0.0-beta.5"],"112.0.5615.39":["24.0.0-beta.6","24.0.0-beta.7"],"112.0.5615.49":["24.0.0"],"112.0.5615.50":["24.1.0","24.1.1"],"112.0.5615.87":["24.1.2"],"112.0.5615.165":["24.1.3","24.2.0","24.3.0"],"112.0.5615.183":["24.3.1"],"112.0.5615.204":["24.4.0","24.4.1","24.5.0","24.5.1","24.6.0","24.6.1","24.6.2","24.6.3","24.6.4","24.6.5","24.7.0","24.7.1","24.8.0","24.8.1","24.8.2","24.8.3","24.8.4","24.8.5","24.8.6","24.8.7","24.8.8"],"114.0.5694.0":["25.0.0-alpha.1","25.0.0-alpha.2"],"114.0.5710.0":["25.0.0-alpha.3","25.0.0-alpha.4"],"114.0.5719.0":["25.0.0-alpha.5","25.0.0-alpha.6","25.0.0-beta.1","25.0.0-beta.2","25.0.0-beta.3"],"114.0.5735.16":["25.0.0-beta.4","25.0.0-beta.5","25.0.0-beta.6","25.0.0-beta.7"],"114.0.5735.35":["25.0.0-beta.8"],"114.0.5735.45":["25.0.0-beta.9","25.0.0","25.0.1"],"114.0.5735.106":["25.1.0","25.1.1"],"114.0.5735.134":["25.2.0"],"114.0.5735.199":["25.3.0"],"114.0.5735.243":["25.3.1"],"114.0.5735.248":["25.3.2","25.4.0"],"114.0.5735.289":["25.5.0","25.6.0","25.7.0","25.8.0","25.8.1","25.8.2","25.8.3","25.8.4","25.9.0","25.9.1","25.9.2","25.9.3","25.9.4","25.9.5","25.9.6","25.9.7","25.9.8"],"116.0.5791.0":["26.0.0-alpha.1","26.0.0-alpha.2","26.0.0-alpha.3","26.0.0-alpha.4","26.0.0-alpha.5"],"116.0.5815.0":["26.0.0-alpha.6"],"116.0.5831.0":["26.0.0-alpha.7"],"116.0.5845.0":["26.0.0-alpha.8","26.0.0-beta.1"],"116.0.5845.14":["26.0.0-beta.2","26.0.0-beta.3","26.0.0-beta.4","26.0.0-beta.5","26.0.0-beta.6","26.0.0-beta.7"],"116.0.5845.42":["26.0.0-beta.8","26.0.0-beta.9"],"116.0.5845.49":["26.0.0-beta.10","26.0.0-beta.11"],"116.0.5845.62":["26.0.0-beta.12"],"116.0.5845.82":["26.0.0"],"116.0.5845.97":["26.1.0"],"116.0.5845.179":["26.2.0"],"116.0.5845.188":["26.2.1"],"116.0.5845.190":["26.2.2","26.2.3","26.2.4"],"116.0.5845.228":["26.3.0","26.4.0","26.4.1","26.4.2","26.4.3","26.5.0","26.6.0","26.6.1","26.6.2","26.6.3","26.6.4","26.6.5","26.6.6","26.6.7","26.6.8","26.6.9","26.6.10"],"118.0.5949.0":["27.0.0-alpha.1","27.0.0-alpha.2","27.0.0-alpha.3","27.0.0-alpha.4","27.0.0-alpha.5","27.0.0-alpha.6"],"118.0.5993.5":["27.0.0-beta.1","27.0.0-beta.2","27.0.0-beta.3"],"118.0.5993.11":["27.0.0-beta.4"],"118.0.5993.18":["27.0.0-beta.5","27.0.0-beta.6","27.0.0-beta.7","27.0.0-beta.8","27.0.0-beta.9"],"118.0.5993.54":["27.0.0"],"118.0.5993.89":["27.0.1","27.0.2"],"118.0.5993.120":["27.0.3"],"118.0.5993.129":["27.0.4"],"118.0.5993.144":["27.1.0","27.1.2"],"118.0.5993.159":["27.1.3","27.2.0","27.2.1","27.2.2","27.2.3","27.2.4","27.3.0","27.3.1","27.3.2","27.3.3","27.3.4","27.3.5","27.3.6","27.3.7","27.3.8","27.3.9","27.3.10","27.3.11"],"119.0.6045.0":["28.0.0-alpha.1","28.0.0-alpha.2"],"119.0.6045.21":["28.0.0-alpha.3","28.0.0-alpha.4"],"119.0.6045.33":["28.0.0-alpha.5","28.0.0-alpha.6","28.0.0-alpha.7","28.0.0-beta.1"],"120.0.6099.0":["28.0.0-beta.2"],"120.0.6099.5":["28.0.0-beta.3","28.0.0-beta.4"],"120.0.6099.18":["28.0.0-beta.5","28.0.0-beta.6","28.0.0-beta.7","28.0.0-beta.8","28.0.0-beta.9","28.0.0-beta.10"],"120.0.6099.35":["28.0.0-beta.11"],"120.0.6099.56":["28.0.0"],"120.0.6099.109":["28.1.0","28.1.1"],"120.0.6099.199":["28.1.2","28.1.3"],"120.0.6099.216":["28.1.4"],"120.0.6099.227":["28.2.0"],"120.0.6099.268":["28.2.1"],"120.0.6099.276":["28.2.2"],"120.0.6099.283":["28.2.3"],"120.0.6099.291":["28.2.4","28.2.5","28.2.6","28.2.7","28.2.8","28.2.9","28.2.10","28.3.0","28.3.1","28.3.2","28.3.3"],"121.0.6147.0":["29.0.0-alpha.1","29.0.0-alpha.2","29.0.0-alpha.3"],"121.0.6159.0":["29.0.0-alpha.4","29.0.0-alpha.5","29.0.0-alpha.6","29.0.0-alpha.7"],"122.0.6194.0":["29.0.0-alpha.8"],"122.0.6236.2":["29.0.0-alpha.9","29.0.0-alpha.10","29.0.0-alpha.11","29.0.0-beta.1","29.0.0-beta.2"],"122.0.6261.6":["29.0.0-beta.3","29.0.0-beta.4"],"122.0.6261.18":["29.0.0-beta.5","29.0.0-beta.6","29.0.0-beta.7","29.0.0-beta.8","29.0.0-beta.9","29.0.0-beta.10","29.0.0-beta.11"],"122.0.6261.29":["29.0.0-beta.12"],"122.0.6261.39":["29.0.0"],"122.0.6261.57":["29.0.1"],"122.0.6261.70":["29.1.0"],"122.0.6261.111":["29.1.1"],"122.0.6261.112":["29.1.2","29.1.3"],"122.0.6261.129":["29.1.4"],"122.0.6261.130":["29.1.5"],"122.0.6261.139":["29.1.6"],"122.0.6261.156":["29.2.0","29.3.0","29.3.1","29.3.2","29.3.3","29.4.0","29.4.1","29.4.2","29.4.3","29.4.4","29.4.5","29.4.6"],"123.0.6296.0":["30.0.0-alpha.1"],"123.0.6312.5":["30.0.0-alpha.2"],"124.0.6323.0":["30.0.0-alpha.3","30.0.0-alpha.4"],"124.0.6331.0":["30.0.0-alpha.5","30.0.0-alpha.6"],"124.0.6353.0":["30.0.0-alpha.7"],"124.0.6359.0":["30.0.0-beta.1","30.0.0-beta.2"],"124.0.6367.9":["30.0.0-beta.3","30.0.0-beta.4","30.0.0-beta.5"],"124.0.6367.18":["30.0.0-beta.6"],"124.0.6367.29":["30.0.0-beta.7","30.0.0-beta.8"],"124.0.6367.49":["30.0.0"],"124.0.6367.60":["30.0.1"],"124.0.6367.91":["30.0.2"],"124.0.6367.119":["30.0.3"],"124.0.6367.201":["30.0.4"],"124.0.6367.207":["30.0.5","30.0.6"],"124.0.6367.221":["30.0.7"],"124.0.6367.230":["30.0.8"],"124.0.6367.233":["30.0.9"],"124.0.6367.243":["30.1.0","30.1.1","30.1.2","30.2.0","30.3.0","30.3.1","30.4.0","30.5.0","30.5.1"],"125.0.6412.0":["31.0.0-alpha.1","31.0.0-alpha.2","31.0.0-alpha.3","31.0.0-alpha.4","31.0.0-alpha.5"],"126.0.6445.0":["31.0.0-beta.1","31.0.0-beta.2","31.0.0-beta.3","31.0.0-beta.4","31.0.0-beta.5","31.0.0-beta.6","31.0.0-beta.7","31.0.0-beta.8","31.0.0-beta.9"],"126.0.6478.36":["31.0.0-beta.10","31.0.0","31.0.1"],"126.0.6478.61":["31.0.2"],"126.0.6478.114":["31.1.0"],"126.0.6478.127":["31.2.0","31.2.1"],"126.0.6478.183":["31.3.0"],"126.0.6478.185":["31.3.1"],"126.0.6478.234":["31.4.0","31.5.0","31.6.0","31.7.0","31.7.1","31.7.2","31.7.3","31.7.4","31.7.5","31.7.6","31.7.7"],"127.0.6521.0":["32.0.0-alpha.1","32.0.0-alpha.2","32.0.0-alpha.3","32.0.0-alpha.4","32.0.0-alpha.5"],"128.0.6571.0":["32.0.0-alpha.6","32.0.0-alpha.7"],"128.0.6573.0":["32.0.0-alpha.8","32.0.0-alpha.9","32.0.0-alpha.10","32.0.0-beta.1"],"128.0.6611.0":["32.0.0-beta.2"],"128.0.6613.7":["32.0.0-beta.3"],"128.0.6613.18":["32.0.0-beta.4"],"128.0.6613.27":["32.0.0-beta.5","32.0.0-beta.6","32.0.0-beta.7"],"128.0.6613.36":["32.0.0","32.0.1"],"128.0.6613.84":["32.0.2"],"128.0.6613.120":["32.1.0"],"128.0.6613.137":["32.1.1"],"128.0.6613.162":["32.1.2"],"128.0.6613.178":["32.2.0"],"128.0.6613.186":["32.2.1","32.2.2","32.2.3","32.2.4","32.2.5","32.2.6","32.2.7","32.2.8","32.3.0","32.3.1","32.3.2","32.3.3"],"129.0.6668.0":["33.0.0-alpha.1"],"130.0.6672.0":["33.0.0-alpha.2","33.0.0-alpha.3","33.0.0-alpha.4","33.0.0-alpha.5","33.0.0-alpha.6","33.0.0-beta.1","33.0.0-beta.2","33.0.0-beta.3","33.0.0-beta.4"],"130.0.6723.19":["33.0.0-beta.5","33.0.0-beta.6","33.0.0-beta.7"],"130.0.6723.31":["33.0.0-beta.8","33.0.0-beta.9","33.0.0-beta.10"],"130.0.6723.44":["33.0.0-beta.11","33.0.0"],"130.0.6723.59":["33.0.1","33.0.2"],"130.0.6723.91":["33.1.0"],"130.0.6723.118":["33.2.0"],"130.0.6723.137":["33.2.1"],"130.0.6723.152":["33.3.0"],"130.0.6723.170":["33.3.1"],"130.0.6723.191":["33.3.2","33.4.0","33.4.1","33.4.2","33.4.3","33.4.4","33.4.5","33.4.6","33.4.7","33.4.8","33.4.9","33.4.10","33.4.11"],"131.0.6776.0":["34.0.0-alpha.1"],"132.0.6779.0":["34.0.0-alpha.2"],"132.0.6789.1":["34.0.0-alpha.3","34.0.0-alpha.4","34.0.0-alpha.5","34.0.0-alpha.6","34.0.0-alpha.7"],"132.0.6820.0":["34.0.0-alpha.8"],"132.0.6824.0":["34.0.0-alpha.9","34.0.0-beta.1","34.0.0-beta.2","34.0.0-beta.3"],"132.0.6834.6":["34.0.0-beta.4","34.0.0-beta.5"],"132.0.6834.15":["34.0.0-beta.6","34.0.0-beta.7","34.0.0-beta.8"],"132.0.6834.32":["34.0.0-beta.9","34.0.0-beta.10","34.0.0-beta.11"],"132.0.6834.46":["34.0.0-beta.12","34.0.0-beta.13"],"132.0.6834.57":["34.0.0-beta.14","34.0.0-beta.15","34.0.0-beta.16"],"132.0.6834.83":["34.0.0","34.0.1"],"132.0.6834.159":["34.0.2"],"132.0.6834.194":["34.1.0","34.1.1"],"132.0.6834.196":["34.2.0"],"132.0.6834.210":["34.3.0","34.3.1","34.3.2","34.3.3","34.3.4","34.4.0","34.4.1","34.5.0","34.5.1","34.5.2","34.5.3","34.5.4","34.5.5","34.5.6","34.5.7","34.5.8"],"133.0.6920.0":["35.0.0-alpha.1","35.0.0-alpha.2","35.0.0-alpha.3","35.0.0-alpha.4","35.0.0-alpha.5","35.0.0-beta.1"],"134.0.6968.0":["35.0.0-beta.2","35.0.0-beta.3","35.0.0-beta.4"],"134.0.6989.0":["35.0.0-beta.5"],"134.0.6990.0":["35.0.0-beta.6","35.0.0-beta.7"],"134.0.6998.10":["35.0.0-beta.8","35.0.0-beta.9"],"134.0.6998.23":["35.0.0-beta.10","35.0.0-beta.11","35.0.0-beta.12"],"134.0.6998.44":["35.0.0-beta.13","35.0.0","35.0.1"],"134.0.6998.88":["35.0.2","35.0.3"],"134.0.6998.165":["35.1.0","35.1.1"],"134.0.6998.178":["35.1.2"],"134.0.6998.179":["35.1.3","35.1.4","35.1.5"],"134.0.6998.205":["35.2.0","35.2.1","35.2.2","35.3.0","35.4.0","35.5.0","35.5.1","35.6.0","35.7.0","35.7.1","35.7.2","35.7.4","35.7.5"],"135.0.7049.5":["36.0.0-alpha.1"],"136.0.7062.0":["36.0.0-alpha.2","36.0.0-alpha.3","36.0.0-alpha.4"],"136.0.7067.0":["36.0.0-alpha.5","36.0.0-alpha.6","36.0.0-beta.1","36.0.0-beta.2","36.0.0-beta.3","36.0.0-beta.4"],"136.0.7103.17":["36.0.0-beta.5"],"136.0.7103.25":["36.0.0-beta.6","36.0.0-beta.7"],"136.0.7103.33":["36.0.0-beta.8","36.0.0-beta.9"],"136.0.7103.48":["36.0.0","36.0.1"],"136.0.7103.49":["36.1.0","36.2.0"],"136.0.7103.93":["36.2.1"],"136.0.7103.113":["36.3.0","36.3.1"],"136.0.7103.115":["36.3.2"],"136.0.7103.149":["36.4.0"],"136.0.7103.168":["36.5.0"],"136.0.7103.177":["36.6.0","36.7.0","36.7.1","36.7.3","36.7.4","36.8.0","36.8.1","36.9.0","36.9.1","36.9.2","36.9.3","36.9.4","36.9.5"],"137.0.7151.0":["37.0.0-alpha.1","37.0.0-alpha.2"],"138.0.7156.0":["37.0.0-alpha.3"],"138.0.7165.0":["37.0.0-alpha.4"],"138.0.7177.0":["37.0.0-alpha.5"],"138.0.7178.0":["37.0.0-alpha.6","37.0.0-alpha.7","37.0.0-beta.1","37.0.0-beta.2"],"138.0.7190.0":["37.0.0-beta.3"],"138.0.7204.15":["37.0.0-beta.4","37.0.0-beta.5","37.0.0-beta.6","37.0.0-beta.7"],"138.0.7204.23":["37.0.0-beta.8"],"138.0.7204.35":["37.0.0-beta.9","37.0.0","37.1.0"],"138.0.7204.97":["37.2.0","37.2.1"],"138.0.7204.100":["37.2.2","37.2.3"],"138.0.7204.157":["37.2.4"],"138.0.7204.168":["37.2.5"],"138.0.7204.185":["37.2.6"],"138.0.7204.224":["37.3.0"],"138.0.7204.235":["37.3.1"],"138.0.7204.243":["37.4.0"],"138.0.7204.251":["37.5.0","37.5.1","37.6.0","37.6.1","37.7.0","37.7.1","37.8.0","37.9.0","37.10.0","37.10.1","37.10.2","37.10.3"],"139.0.7219.0":["38.0.0-alpha.1","38.0.0-alpha.2","38.0.0-alpha.3"],"140.0.7261.0":["38.0.0-alpha.4","38.0.0-alpha.5","38.0.0-alpha.6"],"140.0.7281.0":["38.0.0-alpha.7","38.0.0-alpha.8"],"140.0.7301.0":["38.0.0-alpha.9"],"140.0.7309.0":["38.0.0-alpha.10"],"140.0.7312.0":["38.0.0-alpha.11"],"140.0.7314.0":["38.0.0-alpha.12","38.0.0-alpha.13","38.0.0-beta.1"],"140.0.7327.0":["38.0.0-beta.2","38.0.0-beta.3"],"140.0.7339.2":["38.0.0-beta.4","38.0.0-beta.5","38.0.0-beta.6"],"140.0.7339.16":["38.0.0-beta.7"],"140.0.7339.24":["38.0.0-beta.8","38.0.0-beta.9"],"140.0.7339.41":["38.0.0-beta.11","38.0.0"],"140.0.7339.80":["38.1.0"],"140.0.7339.133":["38.1.1","38.1.2","38.2.0","38.2.1","38.2.2"],"140.0.7339.240":["38.3.0","38.4.0"],"140.0.7339.249":["38.5.0","38.6.0","38.7.0","38.7.1","38.7.2"],"141.0.7361.0":["39.0.0-alpha.1","39.0.0-alpha.2"],"141.0.7390.7":["39.0.0-alpha.3","39.0.0-alpha.4","39.0.0-alpha.5"],"142.0.7417.0":["39.0.0-alpha.6","39.0.0-alpha.7","39.0.0-alpha.8","39.0.0-alpha.9","39.0.0-beta.1","39.0.0-beta.2","39.0.0-beta.3"],"142.0.7444.34":["39.0.0-beta.4","39.0.0-beta.5"],"142.0.7444.52":["39.0.0"],"142.0.7444.59":["39.1.0","39.1.1"],"142.0.7444.134":["39.1.2"],"142.0.7444.162":["39.2.0","39.2.1","39.2.2"],"142.0.7444.175":["39.2.3"],"142.0.7444.177":["39.2.4","39.2.5"],"142.0.7444.226":["39.2.6"],"143.0.7499.0":["40.0.0-alpha.2"],"144.0.7506.0":["40.0.0-alpha.4"],"144.0.7526.0":["40.0.0-alpha.5","40.0.0-alpha.6","40.0.0-alpha.7","40.0.0-alpha.8"],"144.0.7527.0":["40.0.0-beta.1","40.0.0-beta.2"]} \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-versions.js b/node_modules/electron-to-chromium/full-versions.js new file mode 100644 index 0000000..a33b4eb --- /dev/null +++ b/node_modules/electron-to-chromium/full-versions.js @@ -0,0 +1,1683 @@ +module.exports = { + "0.20.0": "39.0.2171.65", + "0.20.1": "39.0.2171.65", + "0.20.2": "39.0.2171.65", + "0.20.3": "39.0.2171.65", + "0.20.4": "39.0.2171.65", + "0.20.5": "39.0.2171.65", + "0.20.6": "39.0.2171.65", + "0.20.7": "39.0.2171.65", + "0.20.8": "39.0.2171.65", + "0.21.0": "40.0.2214.91", + "0.21.1": "40.0.2214.91", + "0.21.2": "40.0.2214.91", + "0.21.3": "41.0.2272.76", + "0.22.1": "41.0.2272.76", + "0.22.2": "41.0.2272.76", + "0.22.3": "41.0.2272.76", + "0.23.0": "41.0.2272.76", + "0.24.0": "41.0.2272.76", + "0.25.0": "42.0.2311.107", + "0.25.1": "42.0.2311.107", + "0.25.2": "42.0.2311.107", + "0.25.3": "42.0.2311.107", + "0.26.0": "42.0.2311.107", + "0.26.1": "42.0.2311.107", + "0.27.0": "42.0.2311.107", + "0.27.1": "42.0.2311.107", + "0.27.2": "43.0.2357.65", + "0.27.3": "43.0.2357.65", + "0.28.0": "43.0.2357.65", + "0.28.1": "43.0.2357.65", + "0.28.2": "43.0.2357.65", + "0.28.3": "43.0.2357.65", + "0.29.1": "43.0.2357.65", + "0.29.2": "43.0.2357.65", + "0.30.4": "44.0.2403.125", + "0.31.0": "44.0.2403.125", + "0.31.2": "45.0.2454.85", + "0.32.2": "45.0.2454.85", + "0.32.3": "45.0.2454.85", + "0.33.0": "45.0.2454.85", + "0.33.1": "45.0.2454.85", + "0.33.2": "45.0.2454.85", + "0.33.3": "45.0.2454.85", + "0.33.4": "45.0.2454.85", + "0.33.6": "45.0.2454.85", + "0.33.7": "45.0.2454.85", + "0.33.8": "45.0.2454.85", + "0.33.9": "45.0.2454.85", + "0.34.0": "45.0.2454.85", + "0.34.1": "45.0.2454.85", + "0.34.2": "45.0.2454.85", + "0.34.3": "45.0.2454.85", + "0.34.4": "45.0.2454.85", + "0.35.1": "45.0.2454.85", + "0.35.2": "45.0.2454.85", + "0.35.3": "45.0.2454.85", + "0.35.4": "45.0.2454.85", + "0.35.5": "45.0.2454.85", + "0.36.0": "47.0.2526.73", + "0.36.2": "47.0.2526.73", + "0.36.3": "47.0.2526.73", + "0.36.4": "47.0.2526.73", + "0.36.5": "47.0.2526.110", + "0.36.6": "47.0.2526.110", + "0.36.7": "47.0.2526.110", + "0.36.8": "47.0.2526.110", + "0.36.9": "47.0.2526.110", + "0.36.10": "47.0.2526.110", + "0.36.11": "47.0.2526.110", + "0.36.12": "47.0.2526.110", + "0.37.0": "49.0.2623.75", + "0.37.1": "49.0.2623.75", + "0.37.3": "49.0.2623.75", + "0.37.4": "49.0.2623.75", + "0.37.5": "49.0.2623.75", + "0.37.6": "49.0.2623.75", + "0.37.7": "49.0.2623.75", + "0.37.8": "49.0.2623.75", + "1.0.0": "49.0.2623.75", + "1.0.1": "49.0.2623.75", + "1.0.2": "49.0.2623.75", + "1.1.0": "50.0.2661.102", + "1.1.1": "50.0.2661.102", + "1.1.2": "50.0.2661.102", + "1.1.3": "50.0.2661.102", + "1.2.0": "51.0.2704.63", + "1.2.1": "51.0.2704.63", + "1.2.2": "51.0.2704.84", + "1.2.3": "51.0.2704.84", + "1.2.4": "51.0.2704.103", + "1.2.5": "51.0.2704.103", + "1.2.6": "51.0.2704.106", + "1.2.7": "51.0.2704.106", + "1.2.8": "51.0.2704.106", + "1.3.0": "52.0.2743.82", + "1.3.1": "52.0.2743.82", + "1.3.2": "52.0.2743.82", + "1.3.3": "52.0.2743.82", + "1.3.4": "52.0.2743.82", + "1.3.5": "52.0.2743.82", + "1.3.6": "52.0.2743.82", + "1.3.7": "52.0.2743.82", + "1.3.9": "52.0.2743.82", + "1.3.10": "52.0.2743.82", + "1.3.13": "52.0.2743.82", + "1.3.14": "52.0.2743.82", + "1.3.15": "52.0.2743.82", + "1.4.0": "53.0.2785.113", + "1.4.1": "53.0.2785.113", + "1.4.2": "53.0.2785.113", + "1.4.3": "53.0.2785.113", + "1.4.4": "53.0.2785.113", + "1.4.5": "53.0.2785.113", + "1.4.6": "53.0.2785.143", + "1.4.7": "53.0.2785.143", + "1.4.8": "53.0.2785.143", + "1.4.10": "53.0.2785.143", + "1.4.11": "53.0.2785.143", + "1.4.12": "54.0.2840.51", + "1.4.13": "53.0.2785.143", + "1.4.14": "53.0.2785.143", + "1.4.15": "53.0.2785.143", + "1.4.16": "53.0.2785.143", + "1.5.0": "54.0.2840.101", + "1.5.1": "54.0.2840.101", + "1.6.0": "56.0.2924.87", + "1.6.1": "56.0.2924.87", + "1.6.2": "56.0.2924.87", + "1.6.3": "56.0.2924.87", + "1.6.4": "56.0.2924.87", + "1.6.5": "56.0.2924.87", + "1.6.6": "56.0.2924.87", + "1.6.7": "56.0.2924.87", + "1.6.8": "56.0.2924.87", + "1.6.9": "56.0.2924.87", + "1.6.10": "56.0.2924.87", + "1.6.11": "56.0.2924.87", + "1.6.12": "56.0.2924.87", + "1.6.13": "56.0.2924.87", + "1.6.14": "56.0.2924.87", + "1.6.15": "56.0.2924.87", + "1.6.16": "56.0.2924.87", + "1.6.17": "56.0.2924.87", + "1.6.18": "56.0.2924.87", + "1.7.0": "58.0.3029.110", + "1.7.1": "58.0.3029.110", + "1.7.2": "58.0.3029.110", + "1.7.3": "58.0.3029.110", + "1.7.4": "58.0.3029.110", + "1.7.5": "58.0.3029.110", + "1.7.6": "58.0.3029.110", + "1.7.7": "58.0.3029.110", + "1.7.8": "58.0.3029.110", + "1.7.9": "58.0.3029.110", + "1.7.10": "58.0.3029.110", + "1.7.11": "58.0.3029.110", + "1.7.12": "58.0.3029.110", + "1.7.13": "58.0.3029.110", + "1.7.14": "58.0.3029.110", + "1.7.15": "58.0.3029.110", + "1.7.16": "58.0.3029.110", + "1.8.0": "59.0.3071.115", + "1.8.1": "59.0.3071.115", + "1.8.2-beta.1": "59.0.3071.115", + "1.8.2-beta.2": "59.0.3071.115", + "1.8.2-beta.3": "59.0.3071.115", + "1.8.2-beta.4": "59.0.3071.115", + "1.8.2-beta.5": "59.0.3071.115", + "1.8.2": "59.0.3071.115", + "1.8.3": "59.0.3071.115", + "1.8.4": "59.0.3071.115", + "1.8.5": "59.0.3071.115", + "1.8.6": "59.0.3071.115", + "1.8.7": "59.0.3071.115", + "1.8.8": "59.0.3071.115", + "2.0.0-beta.1": "61.0.3163.100", + "2.0.0-beta.2": "61.0.3163.100", + "2.0.0-beta.3": "61.0.3163.100", + "2.0.0-beta.4": "61.0.3163.100", + "2.0.0-beta.5": "61.0.3163.100", + "2.0.0-beta.6": "61.0.3163.100", + "2.0.0-beta.7": "61.0.3163.100", + "2.0.0-beta.8": "61.0.3163.100", + "2.0.0": "61.0.3163.100", + "2.0.1": "61.0.3163.100", + "2.0.2": "61.0.3163.100", + "2.0.3": "61.0.3163.100", + "2.0.4": "61.0.3163.100", + "2.0.5": "61.0.3163.100", + "2.0.6": "61.0.3163.100", + "2.0.7": "61.0.3163.100", + "2.0.8": "61.0.3163.100", + "2.0.9": "61.0.3163.100", + "2.0.10": "61.0.3163.100", + "2.0.11": "61.0.3163.100", + "2.0.12": "61.0.3163.100", + "2.0.13": "61.0.3163.100", + "2.0.14": "61.0.3163.100", + "2.0.15": "61.0.3163.100", + "2.0.16": "61.0.3163.100", + "2.0.17": "61.0.3163.100", + "2.0.18": "61.0.3163.100", + "2.1.0-unsupported.20180809": "61.0.3163.100", + "3.0.0-beta.1": "66.0.3359.181", + "3.0.0-beta.2": "66.0.3359.181", + "3.0.0-beta.3": "66.0.3359.181", + "3.0.0-beta.4": "66.0.3359.181", + "3.0.0-beta.5": "66.0.3359.181", + "3.0.0-beta.6": "66.0.3359.181", + "3.0.0-beta.7": "66.0.3359.181", + "3.0.0-beta.8": "66.0.3359.181", + "3.0.0-beta.9": "66.0.3359.181", + "3.0.0-beta.10": "66.0.3359.181", + "3.0.0-beta.11": "66.0.3359.181", + "3.0.0-beta.12": "66.0.3359.181", + "3.0.0-beta.13": "66.0.3359.181", + "3.0.0": "66.0.3359.181", + "3.0.1": "66.0.3359.181", + "3.0.2": "66.0.3359.181", + "3.0.3": "66.0.3359.181", + "3.0.4": "66.0.3359.181", + "3.0.5": "66.0.3359.181", + "3.0.6": "66.0.3359.181", + "3.0.7": "66.0.3359.181", + "3.0.8": "66.0.3359.181", + "3.0.9": "66.0.3359.181", + "3.0.10": "66.0.3359.181", + "3.0.11": "66.0.3359.181", + "3.0.12": "66.0.3359.181", + "3.0.13": "66.0.3359.181", + "3.0.14": "66.0.3359.181", + "3.0.15": "66.0.3359.181", + "3.0.16": "66.0.3359.181", + "3.1.0-beta.1": "66.0.3359.181", + "3.1.0-beta.2": "66.0.3359.181", + "3.1.0-beta.3": "66.0.3359.181", + "3.1.0-beta.4": "66.0.3359.181", + "3.1.0-beta.5": "66.0.3359.181", + "3.1.0": "66.0.3359.181", + "3.1.1": "66.0.3359.181", + "3.1.2": "66.0.3359.181", + "3.1.3": "66.0.3359.181", + "3.1.4": "66.0.3359.181", + "3.1.5": "66.0.3359.181", + "3.1.6": "66.0.3359.181", + "3.1.7": "66.0.3359.181", + "3.1.8": "66.0.3359.181", + "3.1.9": "66.0.3359.181", + "3.1.10": "66.0.3359.181", + "3.1.11": "66.0.3359.181", + "3.1.12": "66.0.3359.181", + "3.1.13": "66.0.3359.181", + "4.0.0-beta.1": "69.0.3497.106", + "4.0.0-beta.2": "69.0.3497.106", + "4.0.0-beta.3": "69.0.3497.106", + "4.0.0-beta.4": "69.0.3497.106", + "4.0.0-beta.5": "69.0.3497.106", + "4.0.0-beta.6": "69.0.3497.106", + "4.0.0-beta.7": "69.0.3497.106", + "4.0.0-beta.8": "69.0.3497.106", + "4.0.0-beta.9": "69.0.3497.106", + "4.0.0-beta.10": "69.0.3497.106", + "4.0.0-beta.11": "69.0.3497.106", + "4.0.0": "69.0.3497.106", + "4.0.1": "69.0.3497.106", + "4.0.2": "69.0.3497.106", + "4.0.3": "69.0.3497.106", + "4.0.4": "69.0.3497.106", + "4.0.5": "69.0.3497.106", + "4.0.6": "69.0.3497.106", + "4.0.7": "69.0.3497.128", + "4.0.8": "69.0.3497.128", + "4.1.0": "69.0.3497.128", + "4.1.1": "69.0.3497.128", + "4.1.2": "69.0.3497.128", + "4.1.3": "69.0.3497.128", + "4.1.4": "69.0.3497.128", + "4.1.5": "69.0.3497.128", + "4.2.0": "69.0.3497.128", + "4.2.1": "69.0.3497.128", + "4.2.2": "69.0.3497.128", + "4.2.3": "69.0.3497.128", + "4.2.4": "69.0.3497.128", + "4.2.5": "69.0.3497.128", + "4.2.6": "69.0.3497.128", + "4.2.7": "69.0.3497.128", + "4.2.8": "69.0.3497.128", + "4.2.9": "69.0.3497.128", + "4.2.10": "69.0.3497.128", + "4.2.11": "69.0.3497.128", + "4.2.12": "69.0.3497.128", + "5.0.0-beta.1": "72.0.3626.52", + "5.0.0-beta.2": "72.0.3626.52", + "5.0.0-beta.3": "73.0.3683.27", + "5.0.0-beta.4": "73.0.3683.54", + "5.0.0-beta.5": "73.0.3683.61", + "5.0.0-beta.6": "73.0.3683.84", + "5.0.0-beta.7": "73.0.3683.94", + "5.0.0-beta.8": "73.0.3683.104", + "5.0.0-beta.9": "73.0.3683.117", + "5.0.0": "73.0.3683.119", + "5.0.1": "73.0.3683.121", + "5.0.2": "73.0.3683.121", + "5.0.3": "73.0.3683.121", + "5.0.4": "73.0.3683.121", + "5.0.5": "73.0.3683.121", + "5.0.6": "73.0.3683.121", + "5.0.7": "73.0.3683.121", + "5.0.8": "73.0.3683.121", + "5.0.9": "73.0.3683.121", + "5.0.10": "73.0.3683.121", + "5.0.11": "73.0.3683.121", + "5.0.12": "73.0.3683.121", + "5.0.13": "73.0.3683.121", + "6.0.0-beta.1": "76.0.3774.1", + "6.0.0-beta.2": "76.0.3783.1", + "6.0.0-beta.3": "76.0.3783.1", + "6.0.0-beta.4": "76.0.3783.1", + "6.0.0-beta.5": "76.0.3805.4", + "6.0.0-beta.6": "76.0.3809.3", + "6.0.0-beta.7": "76.0.3809.22", + "6.0.0-beta.8": "76.0.3809.26", + "6.0.0-beta.9": "76.0.3809.26", + "6.0.0-beta.10": "76.0.3809.37", + "6.0.0-beta.11": "76.0.3809.42", + "6.0.0-beta.12": "76.0.3809.54", + "6.0.0-beta.13": "76.0.3809.60", + "6.0.0-beta.14": "76.0.3809.68", + "6.0.0-beta.15": "76.0.3809.74", + "6.0.0": "76.0.3809.88", + "6.0.1": "76.0.3809.102", + "6.0.2": "76.0.3809.110", + "6.0.3": "76.0.3809.126", + "6.0.4": "76.0.3809.131", + "6.0.5": "76.0.3809.136", + "6.0.6": "76.0.3809.138", + "6.0.7": "76.0.3809.139", + "6.0.8": "76.0.3809.146", + "6.0.9": "76.0.3809.146", + "6.0.10": "76.0.3809.146", + "6.0.11": "76.0.3809.146", + "6.0.12": "76.0.3809.146", + "6.1.0": "76.0.3809.146", + "6.1.1": "76.0.3809.146", + "6.1.2": "76.0.3809.146", + "6.1.3": "76.0.3809.146", + "6.1.4": "76.0.3809.146", + "6.1.5": "76.0.3809.146", + "6.1.6": "76.0.3809.146", + "6.1.7": "76.0.3809.146", + "6.1.8": "76.0.3809.146", + "6.1.9": "76.0.3809.146", + "6.1.10": "76.0.3809.146", + "6.1.11": "76.0.3809.146", + "6.1.12": "76.0.3809.146", + "7.0.0-beta.1": "78.0.3866.0", + "7.0.0-beta.2": "78.0.3866.0", + "7.0.0-beta.3": "78.0.3866.0", + "7.0.0-beta.4": "78.0.3896.6", + "7.0.0-beta.5": "78.0.3905.1", + "7.0.0-beta.6": "78.0.3905.1", + "7.0.0-beta.7": "78.0.3905.1", + "7.0.0": "78.0.3905.1", + "7.0.1": "78.0.3904.92", + "7.1.0": "78.0.3904.94", + "7.1.1": "78.0.3904.99", + "7.1.2": "78.0.3904.113", + "7.1.3": "78.0.3904.126", + "7.1.4": "78.0.3904.130", + "7.1.5": "78.0.3904.130", + "7.1.6": "78.0.3904.130", + "7.1.7": "78.0.3904.130", + "7.1.8": "78.0.3904.130", + "7.1.9": "78.0.3904.130", + "7.1.10": "78.0.3904.130", + "7.1.11": "78.0.3904.130", + "7.1.12": "78.0.3904.130", + "7.1.13": "78.0.3904.130", + "7.1.14": "78.0.3904.130", + "7.2.0": "78.0.3904.130", + "7.2.1": "78.0.3904.130", + "7.2.2": "78.0.3904.130", + "7.2.3": "78.0.3904.130", + "7.2.4": "78.0.3904.130", + "7.3.0": "78.0.3904.130", + "7.3.1": "78.0.3904.130", + "7.3.2": "78.0.3904.130", + "7.3.3": "78.0.3904.130", + "8.0.0-beta.1": "79.0.3931.0", + "8.0.0-beta.2": "79.0.3931.0", + "8.0.0-beta.3": "80.0.3955.0", + "8.0.0-beta.4": "80.0.3955.0", + "8.0.0-beta.5": "80.0.3987.14", + "8.0.0-beta.6": "80.0.3987.51", + "8.0.0-beta.7": "80.0.3987.59", + "8.0.0-beta.8": "80.0.3987.75", + "8.0.0-beta.9": "80.0.3987.75", + "8.0.0": "80.0.3987.86", + "8.0.1": "80.0.3987.86", + "8.0.2": "80.0.3987.86", + "8.0.3": "80.0.3987.134", + "8.1.0": "80.0.3987.137", + "8.1.1": "80.0.3987.141", + "8.2.0": "80.0.3987.158", + "8.2.1": "80.0.3987.163", + "8.2.2": "80.0.3987.163", + "8.2.3": "80.0.3987.163", + "8.2.4": "80.0.3987.165", + "8.2.5": "80.0.3987.165", + "8.3.0": "80.0.3987.165", + "8.3.1": "80.0.3987.165", + "8.3.2": "80.0.3987.165", + "8.3.3": "80.0.3987.165", + "8.3.4": "80.0.3987.165", + "8.4.0": "80.0.3987.165", + "8.4.1": "80.0.3987.165", + "8.5.0": "80.0.3987.165", + "8.5.1": "80.0.3987.165", + "8.5.2": "80.0.3987.165", + "8.5.3": "80.0.3987.163", + "8.5.4": "80.0.3987.163", + "8.5.5": "80.0.3987.163", + "9.0.0-beta.1": "82.0.4048.0", + "9.0.0-beta.2": "82.0.4048.0", + "9.0.0-beta.3": "82.0.4048.0", + "9.0.0-beta.4": "82.0.4048.0", + "9.0.0-beta.5": "82.0.4048.0", + "9.0.0-beta.6": "82.0.4058.2", + "9.0.0-beta.7": "82.0.4058.2", + "9.0.0-beta.9": "82.0.4058.2", + "9.0.0-beta.10": "82.0.4085.10", + "9.0.0-beta.11": "82.0.4085.14", + "9.0.0-beta.12": "82.0.4085.14", + "9.0.0-beta.13": "82.0.4085.14", + "9.0.0-beta.14": "82.0.4085.27", + "9.0.0-beta.15": "83.0.4102.3", + "9.0.0-beta.16": "83.0.4102.3", + "9.0.0-beta.17": "83.0.4103.14", + "9.0.0-beta.18": "83.0.4103.16", + "9.0.0-beta.19": "83.0.4103.24", + "9.0.0-beta.20": "83.0.4103.26", + "9.0.0-beta.21": "83.0.4103.26", + "9.0.0-beta.22": "83.0.4103.34", + "9.0.0-beta.23": "83.0.4103.44", + "9.0.0-beta.24": "83.0.4103.45", + "9.0.0": "83.0.4103.64", + "9.0.1": "83.0.4103.94", + "9.0.2": "83.0.4103.94", + "9.0.3": "83.0.4103.100", + "9.0.4": "83.0.4103.104", + "9.0.5": "83.0.4103.119", + "9.1.0": "83.0.4103.122", + "9.1.1": "83.0.4103.122", + "9.1.2": "83.0.4103.122", + "9.2.0": "83.0.4103.122", + "9.2.1": "83.0.4103.122", + "9.3.0": "83.0.4103.122", + "9.3.1": "83.0.4103.122", + "9.3.2": "83.0.4103.122", + "9.3.3": "83.0.4103.122", + "9.3.4": "83.0.4103.122", + "9.3.5": "83.0.4103.122", + "9.4.0": "83.0.4103.122", + "9.4.1": "83.0.4103.122", + "9.4.2": "83.0.4103.122", + "9.4.3": "83.0.4103.122", + "9.4.4": "83.0.4103.122", + "10.0.0-beta.1": "84.0.4129.0", + "10.0.0-beta.2": "84.0.4129.0", + "10.0.0-beta.3": "85.0.4161.2", + "10.0.0-beta.4": "85.0.4161.2", + "10.0.0-beta.8": "85.0.4181.1", + "10.0.0-beta.9": "85.0.4181.1", + "10.0.0-beta.10": "85.0.4183.19", + "10.0.0-beta.11": "85.0.4183.20", + "10.0.0-beta.12": "85.0.4183.26", + "10.0.0-beta.13": "85.0.4183.39", + "10.0.0-beta.14": "85.0.4183.39", + "10.0.0-beta.15": "85.0.4183.39", + "10.0.0-beta.17": "85.0.4183.39", + "10.0.0-beta.19": "85.0.4183.39", + "10.0.0-beta.20": "85.0.4183.39", + "10.0.0-beta.21": "85.0.4183.39", + "10.0.0-beta.23": "85.0.4183.70", + "10.0.0-beta.24": "85.0.4183.78", + "10.0.0-beta.25": "85.0.4183.80", + "10.0.0": "85.0.4183.84", + "10.0.1": "85.0.4183.86", + "10.1.0": "85.0.4183.87", + "10.1.1": "85.0.4183.93", + "10.1.2": "85.0.4183.98", + "10.1.3": "85.0.4183.121", + "10.1.4": "85.0.4183.121", + "10.1.5": "85.0.4183.121", + "10.1.6": "85.0.4183.121", + "10.1.7": "85.0.4183.121", + "10.2.0": "85.0.4183.121", + "10.3.0": "85.0.4183.121", + "10.3.1": "85.0.4183.121", + "10.3.2": "85.0.4183.121", + "10.4.0": "85.0.4183.121", + "10.4.1": "85.0.4183.121", + "10.4.2": "85.0.4183.121", + "10.4.3": "85.0.4183.121", + "10.4.4": "85.0.4183.121", + "10.4.5": "85.0.4183.121", + "10.4.6": "85.0.4183.121", + "10.4.7": "85.0.4183.121", + "11.0.0-beta.1": "86.0.4234.0", + "11.0.0-beta.3": "86.0.4234.0", + "11.0.0-beta.4": "86.0.4234.0", + "11.0.0-beta.5": "86.0.4234.0", + "11.0.0-beta.6": "86.0.4234.0", + "11.0.0-beta.7": "86.0.4234.0", + "11.0.0-beta.8": "87.0.4251.1", + "11.0.0-beta.9": "87.0.4251.1", + "11.0.0-beta.11": "87.0.4251.1", + "11.0.0-beta.12": "87.0.4280.11", + "11.0.0-beta.13": "87.0.4280.11", + "11.0.0-beta.16": "87.0.4280.27", + "11.0.0-beta.17": "87.0.4280.27", + "11.0.0-beta.18": "87.0.4280.27", + "11.0.0-beta.19": "87.0.4280.27", + "11.0.0-beta.20": "87.0.4280.40", + "11.0.0-beta.22": "87.0.4280.47", + "11.0.0-beta.23": "87.0.4280.47", + "11.0.0": "87.0.4280.60", + "11.0.1": "87.0.4280.60", + "11.0.2": "87.0.4280.67", + "11.0.3": "87.0.4280.67", + "11.0.4": "87.0.4280.67", + "11.0.5": "87.0.4280.88", + "11.1.0": "87.0.4280.88", + "11.1.1": "87.0.4280.88", + "11.2.0": "87.0.4280.141", + "11.2.1": "87.0.4280.141", + "11.2.2": "87.0.4280.141", + "11.2.3": "87.0.4280.141", + "11.3.0": "87.0.4280.141", + "11.4.0": "87.0.4280.141", + "11.4.1": "87.0.4280.141", + "11.4.2": "87.0.4280.141", + "11.4.3": "87.0.4280.141", + "11.4.4": "87.0.4280.141", + "11.4.5": "87.0.4280.141", + "11.4.6": "87.0.4280.141", + "11.4.7": "87.0.4280.141", + "11.4.8": "87.0.4280.141", + "11.4.9": "87.0.4280.141", + "11.4.10": "87.0.4280.141", + "11.4.11": "87.0.4280.141", + "11.4.12": "87.0.4280.141", + "11.5.0": "87.0.4280.141", + "12.0.0-beta.1": "89.0.4328.0", + "12.0.0-beta.3": "89.0.4328.0", + "12.0.0-beta.4": "89.0.4328.0", + "12.0.0-beta.5": "89.0.4328.0", + "12.0.0-beta.6": "89.0.4328.0", + "12.0.0-beta.7": "89.0.4328.0", + "12.0.0-beta.8": "89.0.4328.0", + "12.0.0-beta.9": "89.0.4328.0", + "12.0.0-beta.10": "89.0.4328.0", + "12.0.0-beta.11": "89.0.4328.0", + "12.0.0-beta.12": "89.0.4328.0", + "12.0.0-beta.14": "89.0.4328.0", + "12.0.0-beta.16": "89.0.4348.1", + "12.0.0-beta.18": "89.0.4348.1", + "12.0.0-beta.19": "89.0.4348.1", + "12.0.0-beta.20": "89.0.4348.1", + "12.0.0-beta.21": "89.0.4388.2", + "12.0.0-beta.22": "89.0.4388.2", + "12.0.0-beta.23": "89.0.4388.2", + "12.0.0-beta.24": "89.0.4388.2", + "12.0.0-beta.25": "89.0.4388.2", + "12.0.0-beta.26": "89.0.4388.2", + "12.0.0-beta.27": "89.0.4389.23", + "12.0.0-beta.28": "89.0.4389.23", + "12.0.0-beta.29": "89.0.4389.23", + "12.0.0-beta.30": "89.0.4389.58", + "12.0.0-beta.31": "89.0.4389.58", + "12.0.0": "89.0.4389.69", + "12.0.1": "89.0.4389.82", + "12.0.2": "89.0.4389.90", + "12.0.3": "89.0.4389.114", + "12.0.4": "89.0.4389.114", + "12.0.5": "89.0.4389.128", + "12.0.6": "89.0.4389.128", + "12.0.7": "89.0.4389.128", + "12.0.8": "89.0.4389.128", + "12.0.9": "89.0.4389.128", + "12.0.10": "89.0.4389.128", + "12.0.11": "89.0.4389.128", + "12.0.12": "89.0.4389.128", + "12.0.13": "89.0.4389.128", + "12.0.14": "89.0.4389.128", + "12.0.15": "89.0.4389.128", + "12.0.16": "89.0.4389.128", + "12.0.17": "89.0.4389.128", + "12.0.18": "89.0.4389.128", + "12.1.0": "89.0.4389.128", + "12.1.1": "89.0.4389.128", + "12.1.2": "89.0.4389.128", + "12.2.0": "89.0.4389.128", + "12.2.1": "89.0.4389.128", + "12.2.2": "89.0.4389.128", + "12.2.3": "89.0.4389.128", + "13.0.0-beta.2": "90.0.4402.0", + "13.0.0-beta.3": "90.0.4402.0", + "13.0.0-beta.4": "90.0.4415.0", + "13.0.0-beta.5": "90.0.4415.0", + "13.0.0-beta.6": "90.0.4415.0", + "13.0.0-beta.7": "90.0.4415.0", + "13.0.0-beta.8": "90.0.4415.0", + "13.0.0-beta.9": "90.0.4415.0", + "13.0.0-beta.10": "90.0.4415.0", + "13.0.0-beta.11": "90.0.4415.0", + "13.0.0-beta.12": "90.0.4415.0", + "13.0.0-beta.13": "90.0.4415.0", + "13.0.0-beta.14": "91.0.4448.0", + "13.0.0-beta.16": "91.0.4448.0", + "13.0.0-beta.17": "91.0.4448.0", + "13.0.0-beta.18": "91.0.4448.0", + "13.0.0-beta.20": "91.0.4448.0", + "13.0.0-beta.21": "91.0.4472.33", + "13.0.0-beta.22": "91.0.4472.33", + "13.0.0-beta.23": "91.0.4472.33", + "13.0.0-beta.24": "91.0.4472.38", + "13.0.0-beta.25": "91.0.4472.38", + "13.0.0-beta.26": "91.0.4472.38", + "13.0.0-beta.27": "91.0.4472.38", + "13.0.0-beta.28": "91.0.4472.38", + "13.0.0": "91.0.4472.69", + "13.0.1": "91.0.4472.69", + "13.1.0": "91.0.4472.77", + "13.1.1": "91.0.4472.77", + "13.1.2": "91.0.4472.77", + "13.1.3": "91.0.4472.106", + "13.1.4": "91.0.4472.106", + "13.1.5": "91.0.4472.124", + "13.1.6": "91.0.4472.124", + "13.1.7": "91.0.4472.124", + "13.1.8": "91.0.4472.164", + "13.1.9": "91.0.4472.164", + "13.2.0": "91.0.4472.164", + "13.2.1": "91.0.4472.164", + "13.2.2": "91.0.4472.164", + "13.2.3": "91.0.4472.164", + "13.3.0": "91.0.4472.164", + "13.4.0": "91.0.4472.164", + "13.5.0": "91.0.4472.164", + "13.5.1": "91.0.4472.164", + "13.5.2": "91.0.4472.164", + "13.6.0": "91.0.4472.164", + "13.6.1": "91.0.4472.164", + "13.6.2": "91.0.4472.164", + "13.6.3": "91.0.4472.164", + "13.6.6": "91.0.4472.164", + "13.6.7": "91.0.4472.164", + "13.6.8": "91.0.4472.164", + "13.6.9": "91.0.4472.164", + "14.0.0-beta.1": "92.0.4511.0", + "14.0.0-beta.2": "92.0.4511.0", + "14.0.0-beta.3": "92.0.4511.0", + "14.0.0-beta.5": "93.0.4536.0", + "14.0.0-beta.6": "93.0.4536.0", + "14.0.0-beta.7": "93.0.4536.0", + "14.0.0-beta.8": "93.0.4536.0", + "14.0.0-beta.9": "93.0.4539.0", + "14.0.0-beta.10": "93.0.4539.0", + "14.0.0-beta.11": "93.0.4557.4", + "14.0.0-beta.12": "93.0.4557.4", + "14.0.0-beta.13": "93.0.4566.0", + "14.0.0-beta.14": "93.0.4566.0", + "14.0.0-beta.15": "93.0.4566.0", + "14.0.0-beta.16": "93.0.4566.0", + "14.0.0-beta.17": "93.0.4566.0", + "14.0.0-beta.18": "93.0.4577.15", + "14.0.0-beta.19": "93.0.4577.15", + "14.0.0-beta.20": "93.0.4577.15", + "14.0.0-beta.21": "93.0.4577.15", + "14.0.0-beta.22": "93.0.4577.25", + "14.0.0-beta.23": "93.0.4577.25", + "14.0.0-beta.24": "93.0.4577.51", + "14.0.0-beta.25": "93.0.4577.51", + "14.0.0": "93.0.4577.58", + "14.0.1": "93.0.4577.63", + "14.0.2": "93.0.4577.82", + "14.1.0": "93.0.4577.82", + "14.1.1": "93.0.4577.82", + "14.2.0": "93.0.4577.82", + "14.2.1": "93.0.4577.82", + "14.2.2": "93.0.4577.82", + "14.2.3": "93.0.4577.82", + "14.2.4": "93.0.4577.82", + "14.2.5": "93.0.4577.82", + "14.2.6": "93.0.4577.82", + "14.2.7": "93.0.4577.82", + "14.2.8": "93.0.4577.82", + "14.2.9": "93.0.4577.82", + "15.0.0-alpha.1": "93.0.4566.0", + "15.0.0-alpha.2": "93.0.4566.0", + "15.0.0-alpha.3": "94.0.4584.0", + "15.0.0-alpha.4": "94.0.4584.0", + "15.0.0-alpha.5": "94.0.4584.0", + "15.0.0-alpha.6": "94.0.4584.0", + "15.0.0-alpha.7": "94.0.4590.2", + "15.0.0-alpha.8": "94.0.4590.2", + "15.0.0-alpha.9": "94.0.4590.2", + "15.0.0-alpha.10": "94.0.4606.12", + "15.0.0-beta.1": "94.0.4606.20", + "15.0.0-beta.2": "94.0.4606.20", + "15.0.0-beta.3": "94.0.4606.31", + "15.0.0-beta.4": "94.0.4606.31", + "15.0.0-beta.5": "94.0.4606.31", + "15.0.0-beta.6": "94.0.4606.31", + "15.0.0-beta.7": "94.0.4606.31", + "15.0.0": "94.0.4606.51", + "15.1.0": "94.0.4606.61", + "15.1.1": "94.0.4606.61", + "15.1.2": "94.0.4606.71", + "15.2.0": "94.0.4606.81", + "15.3.0": "94.0.4606.81", + "15.3.1": "94.0.4606.81", + "15.3.2": "94.0.4606.81", + "15.3.3": "94.0.4606.81", + "15.3.4": "94.0.4606.81", + "15.3.5": "94.0.4606.81", + "15.3.6": "94.0.4606.81", + "15.3.7": "94.0.4606.81", + "15.4.0": "94.0.4606.81", + "15.4.1": "94.0.4606.81", + "15.4.2": "94.0.4606.81", + "15.5.0": "94.0.4606.81", + "15.5.1": "94.0.4606.81", + "15.5.2": "94.0.4606.81", + "15.5.3": "94.0.4606.81", + "15.5.4": "94.0.4606.81", + "15.5.5": "94.0.4606.81", + "15.5.6": "94.0.4606.81", + "15.5.7": "94.0.4606.81", + "16.0.0-alpha.1": "95.0.4629.0", + "16.0.0-alpha.2": "95.0.4629.0", + "16.0.0-alpha.3": "95.0.4629.0", + "16.0.0-alpha.4": "95.0.4629.0", + "16.0.0-alpha.5": "95.0.4629.0", + "16.0.0-alpha.6": "95.0.4629.0", + "16.0.0-alpha.7": "95.0.4629.0", + "16.0.0-alpha.8": "96.0.4647.0", + "16.0.0-alpha.9": "96.0.4647.0", + "16.0.0-beta.1": "96.0.4647.0", + "16.0.0-beta.2": "96.0.4647.0", + "16.0.0-beta.3": "96.0.4647.0", + "16.0.0-beta.4": "96.0.4664.18", + "16.0.0-beta.5": "96.0.4664.18", + "16.0.0-beta.6": "96.0.4664.27", + "16.0.0-beta.7": "96.0.4664.27", + "16.0.0-beta.8": "96.0.4664.35", + "16.0.0-beta.9": "96.0.4664.35", + "16.0.0": "96.0.4664.45", + "16.0.1": "96.0.4664.45", + "16.0.2": "96.0.4664.55", + "16.0.3": "96.0.4664.55", + "16.0.4": "96.0.4664.55", + "16.0.5": "96.0.4664.55", + "16.0.6": "96.0.4664.110", + "16.0.7": "96.0.4664.110", + "16.0.8": "96.0.4664.110", + "16.0.9": "96.0.4664.174", + "16.0.10": "96.0.4664.174", + "16.1.0": "96.0.4664.174", + "16.1.1": "96.0.4664.174", + "16.2.0": "96.0.4664.174", + "16.2.1": "96.0.4664.174", + "16.2.2": "96.0.4664.174", + "16.2.3": "96.0.4664.174", + "16.2.4": "96.0.4664.174", + "16.2.5": "96.0.4664.174", + "16.2.6": "96.0.4664.174", + "16.2.7": "96.0.4664.174", + "16.2.8": "96.0.4664.174", + "17.0.0-alpha.1": "96.0.4664.4", + "17.0.0-alpha.2": "96.0.4664.4", + "17.0.0-alpha.3": "96.0.4664.4", + "17.0.0-alpha.4": "98.0.4706.0", + "17.0.0-alpha.5": "98.0.4706.0", + "17.0.0-alpha.6": "98.0.4706.0", + "17.0.0-beta.1": "98.0.4706.0", + "17.0.0-beta.2": "98.0.4706.0", + "17.0.0-beta.3": "98.0.4758.9", + "17.0.0-beta.4": "98.0.4758.11", + "17.0.0-beta.5": "98.0.4758.11", + "17.0.0-beta.6": "98.0.4758.11", + "17.0.0-beta.7": "98.0.4758.11", + "17.0.0-beta.8": "98.0.4758.11", + "17.0.0-beta.9": "98.0.4758.11", + "17.0.0": "98.0.4758.74", + "17.0.1": "98.0.4758.82", + "17.1.0": "98.0.4758.102", + "17.1.1": "98.0.4758.109", + "17.1.2": "98.0.4758.109", + "17.2.0": "98.0.4758.109", + "17.3.0": "98.0.4758.141", + "17.3.1": "98.0.4758.141", + "17.4.0": "98.0.4758.141", + "17.4.1": "98.0.4758.141", + "17.4.2": "98.0.4758.141", + "17.4.3": "98.0.4758.141", + "17.4.4": "98.0.4758.141", + "17.4.5": "98.0.4758.141", + "17.4.6": "98.0.4758.141", + "17.4.7": "98.0.4758.141", + "17.4.8": "98.0.4758.141", + "17.4.9": "98.0.4758.141", + "17.4.10": "98.0.4758.141", + "17.4.11": "98.0.4758.141", + "18.0.0-alpha.1": "99.0.4767.0", + "18.0.0-alpha.2": "99.0.4767.0", + "18.0.0-alpha.3": "99.0.4767.0", + "18.0.0-alpha.4": "99.0.4767.0", + "18.0.0-alpha.5": "99.0.4767.0", + "18.0.0-beta.1": "100.0.4894.0", + "18.0.0-beta.2": "100.0.4894.0", + "18.0.0-beta.3": "100.0.4894.0", + "18.0.0-beta.4": "100.0.4894.0", + "18.0.0-beta.5": "100.0.4894.0", + "18.0.0-beta.6": "100.0.4894.0", + "18.0.0": "100.0.4896.56", + "18.0.1": "100.0.4896.60", + "18.0.2": "100.0.4896.60", + "18.0.3": "100.0.4896.75", + "18.0.4": "100.0.4896.75", + "18.1.0": "100.0.4896.127", + "18.2.0": "100.0.4896.143", + "18.2.1": "100.0.4896.143", + "18.2.2": "100.0.4896.143", + "18.2.3": "100.0.4896.143", + "18.2.4": "100.0.4896.160", + "18.3.0": "100.0.4896.160", + "18.3.1": "100.0.4896.160", + "18.3.2": "100.0.4896.160", + "18.3.3": "100.0.4896.160", + "18.3.4": "100.0.4896.160", + "18.3.5": "100.0.4896.160", + "18.3.6": "100.0.4896.160", + "18.3.7": "100.0.4896.160", + "18.3.8": "100.0.4896.160", + "18.3.9": "100.0.4896.160", + "18.3.11": "100.0.4896.160", + "18.3.12": "100.0.4896.160", + "18.3.13": "100.0.4896.160", + "18.3.14": "100.0.4896.160", + "18.3.15": "100.0.4896.160", + "19.0.0-alpha.1": "102.0.4962.3", + "19.0.0-alpha.2": "102.0.4971.0", + "19.0.0-alpha.3": "102.0.4971.0", + "19.0.0-alpha.4": "102.0.4989.0", + "19.0.0-alpha.5": "102.0.4989.0", + "19.0.0-beta.1": "102.0.4999.0", + "19.0.0-beta.2": "102.0.4999.0", + "19.0.0-beta.3": "102.0.4999.0", + "19.0.0-beta.4": "102.0.5005.27", + "19.0.0-beta.5": "102.0.5005.40", + "19.0.0-beta.6": "102.0.5005.40", + "19.0.0-beta.7": "102.0.5005.40", + "19.0.0-beta.8": "102.0.5005.49", + "19.0.0": "102.0.5005.61", + "19.0.1": "102.0.5005.61", + "19.0.2": "102.0.5005.63", + "19.0.3": "102.0.5005.63", + "19.0.4": "102.0.5005.63", + "19.0.5": "102.0.5005.115", + "19.0.6": "102.0.5005.115", + "19.0.7": "102.0.5005.134", + "19.0.8": "102.0.5005.148", + "19.0.9": "102.0.5005.167", + "19.0.10": "102.0.5005.167", + "19.0.11": "102.0.5005.167", + "19.0.12": "102.0.5005.167", + "19.0.13": "102.0.5005.167", + "19.0.14": "102.0.5005.167", + "19.0.15": "102.0.5005.167", + "19.0.16": "102.0.5005.167", + "19.0.17": "102.0.5005.167", + "19.1.0": "102.0.5005.167", + "19.1.1": "102.0.5005.167", + "19.1.2": "102.0.5005.167", + "19.1.3": "102.0.5005.167", + "19.1.4": "102.0.5005.167", + "19.1.5": "102.0.5005.167", + "19.1.6": "102.0.5005.167", + "19.1.7": "102.0.5005.167", + "19.1.8": "102.0.5005.167", + "19.1.9": "102.0.5005.167", + "20.0.0-alpha.1": "103.0.5044.0", + "20.0.0-alpha.2": "104.0.5073.0", + "20.0.0-alpha.3": "104.0.5073.0", + "20.0.0-alpha.4": "104.0.5073.0", + "20.0.0-alpha.5": "104.0.5073.0", + "20.0.0-alpha.6": "104.0.5073.0", + "20.0.0-alpha.7": "104.0.5073.0", + "20.0.0-beta.1": "104.0.5073.0", + "20.0.0-beta.2": "104.0.5073.0", + "20.0.0-beta.3": "104.0.5073.0", + "20.0.0-beta.4": "104.0.5073.0", + "20.0.0-beta.5": "104.0.5073.0", + "20.0.0-beta.6": "104.0.5073.0", + "20.0.0-beta.7": "104.0.5073.0", + "20.0.0-beta.8": "104.0.5073.0", + "20.0.0-beta.9": "104.0.5112.39", + "20.0.0-beta.10": "104.0.5112.48", + "20.0.0-beta.11": "104.0.5112.48", + "20.0.0-beta.12": "104.0.5112.48", + "20.0.0-beta.13": "104.0.5112.57", + "20.0.0": "104.0.5112.65", + "20.0.1": "104.0.5112.81", + "20.0.2": "104.0.5112.81", + "20.0.3": "104.0.5112.81", + "20.1.0": "104.0.5112.102", + "20.1.1": "104.0.5112.102", + "20.1.2": "104.0.5112.114", + "20.1.3": "104.0.5112.114", + "20.1.4": "104.0.5112.114", + "20.2.0": "104.0.5112.124", + "20.3.0": "104.0.5112.124", + "20.3.1": "104.0.5112.124", + "20.3.2": "104.0.5112.124", + "20.3.3": "104.0.5112.124", + "20.3.4": "104.0.5112.124", + "20.3.5": "104.0.5112.124", + "20.3.6": "104.0.5112.124", + "20.3.7": "104.0.5112.124", + "20.3.8": "104.0.5112.124", + "20.3.9": "104.0.5112.124", + "20.3.10": "104.0.5112.124", + "20.3.11": "104.0.5112.124", + "20.3.12": "104.0.5112.124", + "21.0.0-alpha.1": "105.0.5187.0", + "21.0.0-alpha.2": "105.0.5187.0", + "21.0.0-alpha.3": "105.0.5187.0", + "21.0.0-alpha.4": "105.0.5187.0", + "21.0.0-alpha.5": "105.0.5187.0", + "21.0.0-alpha.6": "106.0.5216.0", + "21.0.0-beta.1": "106.0.5216.0", + "21.0.0-beta.2": "106.0.5216.0", + "21.0.0-beta.3": "106.0.5216.0", + "21.0.0-beta.4": "106.0.5216.0", + "21.0.0-beta.5": "106.0.5216.0", + "21.0.0-beta.6": "106.0.5249.40", + "21.0.0-beta.7": "106.0.5249.40", + "21.0.0-beta.8": "106.0.5249.40", + "21.0.0": "106.0.5249.51", + "21.0.1": "106.0.5249.61", + "21.1.0": "106.0.5249.91", + "21.1.1": "106.0.5249.103", + "21.2.0": "106.0.5249.119", + "21.2.1": "106.0.5249.165", + "21.2.2": "106.0.5249.168", + "21.2.3": "106.0.5249.168", + "21.3.0": "106.0.5249.181", + "21.3.1": "106.0.5249.181", + "21.3.3": "106.0.5249.199", + "21.3.4": "106.0.5249.199", + "21.3.5": "106.0.5249.199", + "21.4.0": "106.0.5249.199", + "21.4.1": "106.0.5249.199", + "21.4.2": "106.0.5249.199", + "21.4.3": "106.0.5249.199", + "21.4.4": "106.0.5249.199", + "22.0.0-alpha.1": "107.0.5286.0", + "22.0.0-alpha.3": "108.0.5329.0", + "22.0.0-alpha.4": "108.0.5329.0", + "22.0.0-alpha.5": "108.0.5329.0", + "22.0.0-alpha.6": "108.0.5329.0", + "22.0.0-alpha.7": "108.0.5355.0", + "22.0.0-alpha.8": "108.0.5359.10", + "22.0.0-beta.1": "108.0.5359.10", + "22.0.0-beta.2": "108.0.5359.10", + "22.0.0-beta.3": "108.0.5359.10", + "22.0.0-beta.4": "108.0.5359.29", + "22.0.0-beta.5": "108.0.5359.40", + "22.0.0-beta.6": "108.0.5359.40", + "22.0.0-beta.7": "108.0.5359.48", + "22.0.0-beta.8": "108.0.5359.48", + "22.0.0": "108.0.5359.62", + "22.0.1": "108.0.5359.125", + "22.0.2": "108.0.5359.179", + "22.0.3": "108.0.5359.179", + "22.1.0": "108.0.5359.179", + "22.2.0": "108.0.5359.215", + "22.2.1": "108.0.5359.215", + "22.3.0": "108.0.5359.215", + "22.3.1": "108.0.5359.215", + "22.3.2": "108.0.5359.215", + "22.3.3": "108.0.5359.215", + "22.3.4": "108.0.5359.215", + "22.3.5": "108.0.5359.215", + "22.3.6": "108.0.5359.215", + "22.3.7": "108.0.5359.215", + "22.3.8": "108.0.5359.215", + "22.3.9": "108.0.5359.215", + "22.3.10": "108.0.5359.215", + "22.3.11": "108.0.5359.215", + "22.3.12": "108.0.5359.215", + "22.3.13": "108.0.5359.215", + "22.3.14": "108.0.5359.215", + "22.3.15": "108.0.5359.215", + "22.3.16": "108.0.5359.215", + "22.3.17": "108.0.5359.215", + "22.3.18": "108.0.5359.215", + "22.3.20": "108.0.5359.215", + "22.3.21": "108.0.5359.215", + "22.3.22": "108.0.5359.215", + "22.3.23": "108.0.5359.215", + "22.3.24": "108.0.5359.215", + "22.3.25": "108.0.5359.215", + "22.3.26": "108.0.5359.215", + "22.3.27": "108.0.5359.215", + "23.0.0-alpha.1": "110.0.5415.0", + "23.0.0-alpha.2": "110.0.5451.0", + "23.0.0-alpha.3": "110.0.5451.0", + "23.0.0-beta.1": "110.0.5478.5", + "23.0.0-beta.2": "110.0.5478.5", + "23.0.0-beta.3": "110.0.5478.5", + "23.0.0-beta.4": "110.0.5481.30", + "23.0.0-beta.5": "110.0.5481.38", + "23.0.0-beta.6": "110.0.5481.52", + "23.0.0-beta.8": "110.0.5481.52", + "23.0.0": "110.0.5481.77", + "23.1.0": "110.0.5481.100", + "23.1.1": "110.0.5481.104", + "23.1.2": "110.0.5481.177", + "23.1.3": "110.0.5481.179", + "23.1.4": "110.0.5481.192", + "23.2.0": "110.0.5481.192", + "23.2.1": "110.0.5481.208", + "23.2.2": "110.0.5481.208", + "23.2.3": "110.0.5481.208", + "23.2.4": "110.0.5481.208", + "23.3.0": "110.0.5481.208", + "23.3.1": "110.0.5481.208", + "23.3.2": "110.0.5481.208", + "23.3.3": "110.0.5481.208", + "23.3.4": "110.0.5481.208", + "23.3.5": "110.0.5481.208", + "23.3.6": "110.0.5481.208", + "23.3.7": "110.0.5481.208", + "23.3.8": "110.0.5481.208", + "23.3.9": "110.0.5481.208", + "23.3.10": "110.0.5481.208", + "23.3.11": "110.0.5481.208", + "23.3.12": "110.0.5481.208", + "23.3.13": "110.0.5481.208", + "24.0.0-alpha.1": "111.0.5560.0", + "24.0.0-alpha.2": "111.0.5560.0", + "24.0.0-alpha.3": "111.0.5560.0", + "24.0.0-alpha.4": "111.0.5560.0", + "24.0.0-alpha.5": "111.0.5560.0", + "24.0.0-alpha.6": "111.0.5560.0", + "24.0.0-alpha.7": "111.0.5560.0", + "24.0.0-beta.1": "111.0.5563.50", + "24.0.0-beta.2": "111.0.5563.50", + "24.0.0-beta.3": "112.0.5615.20", + "24.0.0-beta.4": "112.0.5615.20", + "24.0.0-beta.5": "112.0.5615.29", + "24.0.0-beta.6": "112.0.5615.39", + "24.0.0-beta.7": "112.0.5615.39", + "24.0.0": "112.0.5615.49", + "24.1.0": "112.0.5615.50", + "24.1.1": "112.0.5615.50", + "24.1.2": "112.0.5615.87", + "24.1.3": "112.0.5615.165", + "24.2.0": "112.0.5615.165", + "24.3.0": "112.0.5615.165", + "24.3.1": "112.0.5615.183", + "24.4.0": "112.0.5615.204", + "24.4.1": "112.0.5615.204", + "24.5.0": "112.0.5615.204", + "24.5.1": "112.0.5615.204", + "24.6.0": "112.0.5615.204", + "24.6.1": "112.0.5615.204", + "24.6.2": "112.0.5615.204", + "24.6.3": "112.0.5615.204", + "24.6.4": "112.0.5615.204", + "24.6.5": "112.0.5615.204", + "24.7.0": "112.0.5615.204", + "24.7.1": "112.0.5615.204", + "24.8.0": "112.0.5615.204", + "24.8.1": "112.0.5615.204", + "24.8.2": "112.0.5615.204", + "24.8.3": "112.0.5615.204", + "24.8.4": "112.0.5615.204", + "24.8.5": "112.0.5615.204", + "24.8.6": "112.0.5615.204", + "24.8.7": "112.0.5615.204", + "24.8.8": "112.0.5615.204", + "25.0.0-alpha.1": "114.0.5694.0", + "25.0.0-alpha.2": "114.0.5694.0", + "25.0.0-alpha.3": "114.0.5710.0", + "25.0.0-alpha.4": "114.0.5710.0", + "25.0.0-alpha.5": "114.0.5719.0", + "25.0.0-alpha.6": "114.0.5719.0", + "25.0.0-beta.1": "114.0.5719.0", + "25.0.0-beta.2": "114.0.5719.0", + "25.0.0-beta.3": "114.0.5719.0", + "25.0.0-beta.4": "114.0.5735.16", + "25.0.0-beta.5": "114.0.5735.16", + "25.0.0-beta.6": "114.0.5735.16", + "25.0.0-beta.7": "114.0.5735.16", + "25.0.0-beta.8": "114.0.5735.35", + "25.0.0-beta.9": "114.0.5735.45", + "25.0.0": "114.0.5735.45", + "25.0.1": "114.0.5735.45", + "25.1.0": "114.0.5735.106", + "25.1.1": "114.0.5735.106", + "25.2.0": "114.0.5735.134", + "25.3.0": "114.0.5735.199", + "25.3.1": "114.0.5735.243", + "25.3.2": "114.0.5735.248", + "25.4.0": "114.0.5735.248", + "25.5.0": "114.0.5735.289", + "25.6.0": "114.0.5735.289", + "25.7.0": "114.0.5735.289", + "25.8.0": "114.0.5735.289", + "25.8.1": "114.0.5735.289", + "25.8.2": "114.0.5735.289", + "25.8.3": "114.0.5735.289", + "25.8.4": "114.0.5735.289", + "25.9.0": "114.0.5735.289", + "25.9.1": "114.0.5735.289", + "25.9.2": "114.0.5735.289", + "25.9.3": "114.0.5735.289", + "25.9.4": "114.0.5735.289", + "25.9.5": "114.0.5735.289", + "25.9.6": "114.0.5735.289", + "25.9.7": "114.0.5735.289", + "25.9.8": "114.0.5735.289", + "26.0.0-alpha.1": "116.0.5791.0", + "26.0.0-alpha.2": "116.0.5791.0", + "26.0.0-alpha.3": "116.0.5791.0", + "26.0.0-alpha.4": "116.0.5791.0", + "26.0.0-alpha.5": "116.0.5791.0", + "26.0.0-alpha.6": "116.0.5815.0", + "26.0.0-alpha.7": "116.0.5831.0", + "26.0.0-alpha.8": "116.0.5845.0", + "26.0.0-beta.1": "116.0.5845.0", + "26.0.0-beta.2": "116.0.5845.14", + "26.0.0-beta.3": "116.0.5845.14", + "26.0.0-beta.4": "116.0.5845.14", + "26.0.0-beta.5": "116.0.5845.14", + "26.0.0-beta.6": "116.0.5845.14", + "26.0.0-beta.7": "116.0.5845.14", + "26.0.0-beta.8": "116.0.5845.42", + "26.0.0-beta.9": "116.0.5845.42", + "26.0.0-beta.10": "116.0.5845.49", + "26.0.0-beta.11": "116.0.5845.49", + "26.0.0-beta.12": "116.0.5845.62", + "26.0.0": "116.0.5845.82", + "26.1.0": "116.0.5845.97", + "26.2.0": "116.0.5845.179", + "26.2.1": "116.0.5845.188", + "26.2.2": "116.0.5845.190", + "26.2.3": "116.0.5845.190", + "26.2.4": "116.0.5845.190", + "26.3.0": "116.0.5845.228", + "26.4.0": "116.0.5845.228", + "26.4.1": "116.0.5845.228", + "26.4.2": "116.0.5845.228", + "26.4.3": "116.0.5845.228", + "26.5.0": "116.0.5845.228", + "26.6.0": "116.0.5845.228", + "26.6.1": "116.0.5845.228", + "26.6.2": "116.0.5845.228", + "26.6.3": "116.0.5845.228", + "26.6.4": "116.0.5845.228", + "26.6.5": "116.0.5845.228", + "26.6.6": "116.0.5845.228", + "26.6.7": "116.0.5845.228", + "26.6.8": "116.0.5845.228", + "26.6.9": "116.0.5845.228", + "26.6.10": "116.0.5845.228", + "27.0.0-alpha.1": "118.0.5949.0", + "27.0.0-alpha.2": "118.0.5949.0", + "27.0.0-alpha.3": "118.0.5949.0", + "27.0.0-alpha.4": "118.0.5949.0", + "27.0.0-alpha.5": "118.0.5949.0", + "27.0.0-alpha.6": "118.0.5949.0", + "27.0.0-beta.1": "118.0.5993.5", + "27.0.0-beta.2": "118.0.5993.5", + "27.0.0-beta.3": "118.0.5993.5", + "27.0.0-beta.4": "118.0.5993.11", + "27.0.0-beta.5": "118.0.5993.18", + "27.0.0-beta.6": "118.0.5993.18", + "27.0.0-beta.7": "118.0.5993.18", + "27.0.0-beta.8": "118.0.5993.18", + "27.0.0-beta.9": "118.0.5993.18", + "27.0.0": "118.0.5993.54", + "27.0.1": "118.0.5993.89", + "27.0.2": "118.0.5993.89", + "27.0.3": "118.0.5993.120", + "27.0.4": "118.0.5993.129", + "27.1.0": "118.0.5993.144", + "27.1.2": "118.0.5993.144", + "27.1.3": "118.0.5993.159", + "27.2.0": "118.0.5993.159", + "27.2.1": "118.0.5993.159", + "27.2.2": "118.0.5993.159", + "27.2.3": "118.0.5993.159", + "27.2.4": "118.0.5993.159", + "27.3.0": "118.0.5993.159", + "27.3.1": "118.0.5993.159", + "27.3.2": "118.0.5993.159", + "27.3.3": "118.0.5993.159", + "27.3.4": "118.0.5993.159", + "27.3.5": "118.0.5993.159", + "27.3.6": "118.0.5993.159", + "27.3.7": "118.0.5993.159", + "27.3.8": "118.0.5993.159", + "27.3.9": "118.0.5993.159", + "27.3.10": "118.0.5993.159", + "27.3.11": "118.0.5993.159", + "28.0.0-alpha.1": "119.0.6045.0", + "28.0.0-alpha.2": "119.0.6045.0", + "28.0.0-alpha.3": "119.0.6045.21", + "28.0.0-alpha.4": "119.0.6045.21", + "28.0.0-alpha.5": "119.0.6045.33", + "28.0.0-alpha.6": "119.0.6045.33", + "28.0.0-alpha.7": "119.0.6045.33", + "28.0.0-beta.1": "119.0.6045.33", + "28.0.0-beta.2": "120.0.6099.0", + "28.0.0-beta.3": "120.0.6099.5", + "28.0.0-beta.4": "120.0.6099.5", + "28.0.0-beta.5": "120.0.6099.18", + "28.0.0-beta.6": "120.0.6099.18", + "28.0.0-beta.7": "120.0.6099.18", + "28.0.0-beta.8": "120.0.6099.18", + "28.0.0-beta.9": "120.0.6099.18", + "28.0.0-beta.10": "120.0.6099.18", + "28.0.0-beta.11": "120.0.6099.35", + "28.0.0": "120.0.6099.56", + "28.1.0": "120.0.6099.109", + "28.1.1": "120.0.6099.109", + "28.1.2": "120.0.6099.199", + "28.1.3": "120.0.6099.199", + "28.1.4": "120.0.6099.216", + "28.2.0": "120.0.6099.227", + "28.2.1": "120.0.6099.268", + "28.2.2": "120.0.6099.276", + "28.2.3": "120.0.6099.283", + "28.2.4": "120.0.6099.291", + "28.2.5": "120.0.6099.291", + "28.2.6": "120.0.6099.291", + "28.2.7": "120.0.6099.291", + "28.2.8": "120.0.6099.291", + "28.2.9": "120.0.6099.291", + "28.2.10": "120.0.6099.291", + "28.3.0": "120.0.6099.291", + "28.3.1": "120.0.6099.291", + "28.3.2": "120.0.6099.291", + "28.3.3": "120.0.6099.291", + "29.0.0-alpha.1": "121.0.6147.0", + "29.0.0-alpha.2": "121.0.6147.0", + "29.0.0-alpha.3": "121.0.6147.0", + "29.0.0-alpha.4": "121.0.6159.0", + "29.0.0-alpha.5": "121.0.6159.0", + "29.0.0-alpha.6": "121.0.6159.0", + "29.0.0-alpha.7": "121.0.6159.0", + "29.0.0-alpha.8": "122.0.6194.0", + "29.0.0-alpha.9": "122.0.6236.2", + "29.0.0-alpha.10": "122.0.6236.2", + "29.0.0-alpha.11": "122.0.6236.2", + "29.0.0-beta.1": "122.0.6236.2", + "29.0.0-beta.2": "122.0.6236.2", + "29.0.0-beta.3": "122.0.6261.6", + "29.0.0-beta.4": "122.0.6261.6", + "29.0.0-beta.5": "122.0.6261.18", + "29.0.0-beta.6": "122.0.6261.18", + "29.0.0-beta.7": "122.0.6261.18", + "29.0.0-beta.8": "122.0.6261.18", + "29.0.0-beta.9": "122.0.6261.18", + "29.0.0-beta.10": "122.0.6261.18", + "29.0.0-beta.11": "122.0.6261.18", + "29.0.0-beta.12": "122.0.6261.29", + "29.0.0": "122.0.6261.39", + "29.0.1": "122.0.6261.57", + "29.1.0": "122.0.6261.70", + "29.1.1": "122.0.6261.111", + "29.1.2": "122.0.6261.112", + "29.1.3": "122.0.6261.112", + "29.1.4": "122.0.6261.129", + "29.1.5": "122.0.6261.130", + "29.1.6": "122.0.6261.139", + "29.2.0": "122.0.6261.156", + "29.3.0": "122.0.6261.156", + "29.3.1": "122.0.6261.156", + "29.3.2": "122.0.6261.156", + "29.3.3": "122.0.6261.156", + "29.4.0": "122.0.6261.156", + "29.4.1": "122.0.6261.156", + "29.4.2": "122.0.6261.156", + "29.4.3": "122.0.6261.156", + "29.4.4": "122.0.6261.156", + "29.4.5": "122.0.6261.156", + "29.4.6": "122.0.6261.156", + "30.0.0-alpha.1": "123.0.6296.0", + "30.0.0-alpha.2": "123.0.6312.5", + "30.0.0-alpha.3": "124.0.6323.0", + "30.0.0-alpha.4": "124.0.6323.0", + "30.0.0-alpha.5": "124.0.6331.0", + "30.0.0-alpha.6": "124.0.6331.0", + "30.0.0-alpha.7": "124.0.6353.0", + "30.0.0-beta.1": "124.0.6359.0", + "30.0.0-beta.2": "124.0.6359.0", + "30.0.0-beta.3": "124.0.6367.9", + "30.0.0-beta.4": "124.0.6367.9", + "30.0.0-beta.5": "124.0.6367.9", + "30.0.0-beta.6": "124.0.6367.18", + "30.0.0-beta.7": "124.0.6367.29", + "30.0.0-beta.8": "124.0.6367.29", + "30.0.0": "124.0.6367.49", + "30.0.1": "124.0.6367.60", + "30.0.2": "124.0.6367.91", + "30.0.3": "124.0.6367.119", + "30.0.4": "124.0.6367.201", + "30.0.5": "124.0.6367.207", + "30.0.6": "124.0.6367.207", + "30.0.7": "124.0.6367.221", + "30.0.8": "124.0.6367.230", + "30.0.9": "124.0.6367.233", + "30.1.0": "124.0.6367.243", + "30.1.1": "124.0.6367.243", + "30.1.2": "124.0.6367.243", + "30.2.0": "124.0.6367.243", + "30.3.0": "124.0.6367.243", + "30.3.1": "124.0.6367.243", + "30.4.0": "124.0.6367.243", + "30.5.0": "124.0.6367.243", + "30.5.1": "124.0.6367.243", + "31.0.0-alpha.1": "125.0.6412.0", + "31.0.0-alpha.2": "125.0.6412.0", + "31.0.0-alpha.3": "125.0.6412.0", + "31.0.0-alpha.4": "125.0.6412.0", + "31.0.0-alpha.5": "125.0.6412.0", + "31.0.0-beta.1": "126.0.6445.0", + "31.0.0-beta.2": "126.0.6445.0", + "31.0.0-beta.3": "126.0.6445.0", + "31.0.0-beta.4": "126.0.6445.0", + "31.0.0-beta.5": "126.0.6445.0", + "31.0.0-beta.6": "126.0.6445.0", + "31.0.0-beta.7": "126.0.6445.0", + "31.0.0-beta.8": "126.0.6445.0", + "31.0.0-beta.9": "126.0.6445.0", + "31.0.0-beta.10": "126.0.6478.36", + "31.0.0": "126.0.6478.36", + "31.0.1": "126.0.6478.36", + "31.0.2": "126.0.6478.61", + "31.1.0": "126.0.6478.114", + "31.2.0": "126.0.6478.127", + "31.2.1": "126.0.6478.127", + "31.3.0": "126.0.6478.183", + "31.3.1": "126.0.6478.185", + "31.4.0": "126.0.6478.234", + "31.5.0": "126.0.6478.234", + "31.6.0": "126.0.6478.234", + "31.7.0": "126.0.6478.234", + "31.7.1": "126.0.6478.234", + "31.7.2": "126.0.6478.234", + "31.7.3": "126.0.6478.234", + "31.7.4": "126.0.6478.234", + "31.7.5": "126.0.6478.234", + "31.7.6": "126.0.6478.234", + "31.7.7": "126.0.6478.234", + "32.0.0-alpha.1": "127.0.6521.0", + "32.0.0-alpha.2": "127.0.6521.0", + "32.0.0-alpha.3": "127.0.6521.0", + "32.0.0-alpha.4": "127.0.6521.0", + "32.0.0-alpha.5": "127.0.6521.0", + "32.0.0-alpha.6": "128.0.6571.0", + "32.0.0-alpha.7": "128.0.6571.0", + "32.0.0-alpha.8": "128.0.6573.0", + "32.0.0-alpha.9": "128.0.6573.0", + "32.0.0-alpha.10": "128.0.6573.0", + "32.0.0-beta.1": "128.0.6573.0", + "32.0.0-beta.2": "128.0.6611.0", + "32.0.0-beta.3": "128.0.6613.7", + "32.0.0-beta.4": "128.0.6613.18", + "32.0.0-beta.5": "128.0.6613.27", + "32.0.0-beta.6": "128.0.6613.27", + "32.0.0-beta.7": "128.0.6613.27", + "32.0.0": "128.0.6613.36", + "32.0.1": "128.0.6613.36", + "32.0.2": "128.0.6613.84", + "32.1.0": "128.0.6613.120", + "32.1.1": "128.0.6613.137", + "32.1.2": "128.0.6613.162", + "32.2.0": "128.0.6613.178", + "32.2.1": "128.0.6613.186", + "32.2.2": "128.0.6613.186", + "32.2.3": "128.0.6613.186", + "32.2.4": "128.0.6613.186", + "32.2.5": "128.0.6613.186", + "32.2.6": "128.0.6613.186", + "32.2.7": "128.0.6613.186", + "32.2.8": "128.0.6613.186", + "32.3.0": "128.0.6613.186", + "32.3.1": "128.0.6613.186", + "32.3.2": "128.0.6613.186", + "32.3.3": "128.0.6613.186", + "33.0.0-alpha.1": "129.0.6668.0", + "33.0.0-alpha.2": "130.0.6672.0", + "33.0.0-alpha.3": "130.0.6672.0", + "33.0.0-alpha.4": "130.0.6672.0", + "33.0.0-alpha.5": "130.0.6672.0", + "33.0.0-alpha.6": "130.0.6672.0", + "33.0.0-beta.1": "130.0.6672.0", + "33.0.0-beta.2": "130.0.6672.0", + "33.0.0-beta.3": "130.0.6672.0", + "33.0.0-beta.4": "130.0.6672.0", + "33.0.0-beta.5": "130.0.6723.19", + "33.0.0-beta.6": "130.0.6723.19", + "33.0.0-beta.7": "130.0.6723.19", + "33.0.0-beta.8": "130.0.6723.31", + "33.0.0-beta.9": "130.0.6723.31", + "33.0.0-beta.10": "130.0.6723.31", + "33.0.0-beta.11": "130.0.6723.44", + "33.0.0": "130.0.6723.44", + "33.0.1": "130.0.6723.59", + "33.0.2": "130.0.6723.59", + "33.1.0": "130.0.6723.91", + "33.2.0": "130.0.6723.118", + "33.2.1": "130.0.6723.137", + "33.3.0": "130.0.6723.152", + "33.3.1": "130.0.6723.170", + "33.3.2": "130.0.6723.191", + "33.4.0": "130.0.6723.191", + "33.4.1": "130.0.6723.191", + "33.4.2": "130.0.6723.191", + "33.4.3": "130.0.6723.191", + "33.4.4": "130.0.6723.191", + "33.4.5": "130.0.6723.191", + "33.4.6": "130.0.6723.191", + "33.4.7": "130.0.6723.191", + "33.4.8": "130.0.6723.191", + "33.4.9": "130.0.6723.191", + "33.4.10": "130.0.6723.191", + "33.4.11": "130.0.6723.191", + "34.0.0-alpha.1": "131.0.6776.0", + "34.0.0-alpha.2": "132.0.6779.0", + "34.0.0-alpha.3": "132.0.6789.1", + "34.0.0-alpha.4": "132.0.6789.1", + "34.0.0-alpha.5": "132.0.6789.1", + "34.0.0-alpha.6": "132.0.6789.1", + "34.0.0-alpha.7": "132.0.6789.1", + "34.0.0-alpha.8": "132.0.6820.0", + "34.0.0-alpha.9": "132.0.6824.0", + "34.0.0-beta.1": "132.0.6824.0", + "34.0.0-beta.2": "132.0.6824.0", + "34.0.0-beta.3": "132.0.6824.0", + "34.0.0-beta.4": "132.0.6834.6", + "34.0.0-beta.5": "132.0.6834.6", + "34.0.0-beta.6": "132.0.6834.15", + "34.0.0-beta.7": "132.0.6834.15", + "34.0.0-beta.8": "132.0.6834.15", + "34.0.0-beta.9": "132.0.6834.32", + "34.0.0-beta.10": "132.0.6834.32", + "34.0.0-beta.11": "132.0.6834.32", + "34.0.0-beta.12": "132.0.6834.46", + "34.0.0-beta.13": "132.0.6834.46", + "34.0.0-beta.14": "132.0.6834.57", + "34.0.0-beta.15": "132.0.6834.57", + "34.0.0-beta.16": "132.0.6834.57", + "34.0.0": "132.0.6834.83", + "34.0.1": "132.0.6834.83", + "34.0.2": "132.0.6834.159", + "34.1.0": "132.0.6834.194", + "34.1.1": "132.0.6834.194", + "34.2.0": "132.0.6834.196", + "34.3.0": "132.0.6834.210", + "34.3.1": "132.0.6834.210", + "34.3.2": "132.0.6834.210", + "34.3.3": "132.0.6834.210", + "34.3.4": "132.0.6834.210", + "34.4.0": "132.0.6834.210", + "34.4.1": "132.0.6834.210", + "34.5.0": "132.0.6834.210", + "34.5.1": "132.0.6834.210", + "34.5.2": "132.0.6834.210", + "34.5.3": "132.0.6834.210", + "34.5.4": "132.0.6834.210", + "34.5.5": "132.0.6834.210", + "34.5.6": "132.0.6834.210", + "34.5.7": "132.0.6834.210", + "34.5.8": "132.0.6834.210", + "35.0.0-alpha.1": "133.0.6920.0", + "35.0.0-alpha.2": "133.0.6920.0", + "35.0.0-alpha.3": "133.0.6920.0", + "35.0.0-alpha.4": "133.0.6920.0", + "35.0.0-alpha.5": "133.0.6920.0", + "35.0.0-beta.1": "133.0.6920.0", + "35.0.0-beta.2": "134.0.6968.0", + "35.0.0-beta.3": "134.0.6968.0", + "35.0.0-beta.4": "134.0.6968.0", + "35.0.0-beta.5": "134.0.6989.0", + "35.0.0-beta.6": "134.0.6990.0", + "35.0.0-beta.7": "134.0.6990.0", + "35.0.0-beta.8": "134.0.6998.10", + "35.0.0-beta.9": "134.0.6998.10", + "35.0.0-beta.10": "134.0.6998.23", + "35.0.0-beta.11": "134.0.6998.23", + "35.0.0-beta.12": "134.0.6998.23", + "35.0.0-beta.13": "134.0.6998.44", + "35.0.0": "134.0.6998.44", + "35.0.1": "134.0.6998.44", + "35.0.2": "134.0.6998.88", + "35.0.3": "134.0.6998.88", + "35.1.0": "134.0.6998.165", + "35.1.1": "134.0.6998.165", + "35.1.2": "134.0.6998.178", + "35.1.3": "134.0.6998.179", + "35.1.4": "134.0.6998.179", + "35.1.5": "134.0.6998.179", + "35.2.0": "134.0.6998.205", + "35.2.1": "134.0.6998.205", + "35.2.2": "134.0.6998.205", + "35.3.0": "134.0.6998.205", + "35.4.0": "134.0.6998.205", + "35.5.0": "134.0.6998.205", + "35.5.1": "134.0.6998.205", + "35.6.0": "134.0.6998.205", + "35.7.0": "134.0.6998.205", + "35.7.1": "134.0.6998.205", + "35.7.2": "134.0.6998.205", + "35.7.4": "134.0.6998.205", + "35.7.5": "134.0.6998.205", + "36.0.0-alpha.1": "135.0.7049.5", + "36.0.0-alpha.2": "136.0.7062.0", + "36.0.0-alpha.3": "136.0.7062.0", + "36.0.0-alpha.4": "136.0.7062.0", + "36.0.0-alpha.5": "136.0.7067.0", + "36.0.0-alpha.6": "136.0.7067.0", + "36.0.0-beta.1": "136.0.7067.0", + "36.0.0-beta.2": "136.0.7067.0", + "36.0.0-beta.3": "136.0.7067.0", + "36.0.0-beta.4": "136.0.7067.0", + "36.0.0-beta.5": "136.0.7103.17", + "36.0.0-beta.6": "136.0.7103.25", + "36.0.0-beta.7": "136.0.7103.25", + "36.0.0-beta.8": "136.0.7103.33", + "36.0.0-beta.9": "136.0.7103.33", + "36.0.0": "136.0.7103.48", + "36.0.1": "136.0.7103.48", + "36.1.0": "136.0.7103.49", + "36.2.0": "136.0.7103.49", + "36.2.1": "136.0.7103.93", + "36.3.0": "136.0.7103.113", + "36.3.1": "136.0.7103.113", + "36.3.2": "136.0.7103.115", + "36.4.0": "136.0.7103.149", + "36.5.0": "136.0.7103.168", + "36.6.0": "136.0.7103.177", + "36.7.0": "136.0.7103.177", + "36.7.1": "136.0.7103.177", + "36.7.3": "136.0.7103.177", + "36.7.4": "136.0.7103.177", + "36.8.0": "136.0.7103.177", + "36.8.1": "136.0.7103.177", + "36.9.0": "136.0.7103.177", + "36.9.1": "136.0.7103.177", + "36.9.2": "136.0.7103.177", + "36.9.3": "136.0.7103.177", + "36.9.4": "136.0.7103.177", + "36.9.5": "136.0.7103.177", + "37.0.0-alpha.1": "137.0.7151.0", + "37.0.0-alpha.2": "137.0.7151.0", + "37.0.0-alpha.3": "138.0.7156.0", + "37.0.0-alpha.4": "138.0.7165.0", + "37.0.0-alpha.5": "138.0.7177.0", + "37.0.0-alpha.6": "138.0.7178.0", + "37.0.0-alpha.7": "138.0.7178.0", + "37.0.0-beta.1": "138.0.7178.0", + "37.0.0-beta.2": "138.0.7178.0", + "37.0.0-beta.3": "138.0.7190.0", + "37.0.0-beta.4": "138.0.7204.15", + "37.0.0-beta.5": "138.0.7204.15", + "37.0.0-beta.6": "138.0.7204.15", + "37.0.0-beta.7": "138.0.7204.15", + "37.0.0-beta.8": "138.0.7204.23", + "37.0.0-beta.9": "138.0.7204.35", + "37.0.0": "138.0.7204.35", + "37.1.0": "138.0.7204.35", + "37.2.0": "138.0.7204.97", + "37.2.1": "138.0.7204.97", + "37.2.2": "138.0.7204.100", + "37.2.3": "138.0.7204.100", + "37.2.4": "138.0.7204.157", + "37.2.5": "138.0.7204.168", + "37.2.6": "138.0.7204.185", + "37.3.0": "138.0.7204.224", + "37.3.1": "138.0.7204.235", + "37.4.0": "138.0.7204.243", + "37.5.0": "138.0.7204.251", + "37.5.1": "138.0.7204.251", + "37.6.0": "138.0.7204.251", + "37.6.1": "138.0.7204.251", + "37.7.0": "138.0.7204.251", + "37.7.1": "138.0.7204.251", + "37.8.0": "138.0.7204.251", + "37.9.0": "138.0.7204.251", + "37.10.0": "138.0.7204.251", + "37.10.1": "138.0.7204.251", + "37.10.2": "138.0.7204.251", + "37.10.3": "138.0.7204.251", + "38.0.0-alpha.1": "139.0.7219.0", + "38.0.0-alpha.2": "139.0.7219.0", + "38.0.0-alpha.3": "139.0.7219.0", + "38.0.0-alpha.4": "140.0.7261.0", + "38.0.0-alpha.5": "140.0.7261.0", + "38.0.0-alpha.6": "140.0.7261.0", + "38.0.0-alpha.7": "140.0.7281.0", + "38.0.0-alpha.8": "140.0.7281.0", + "38.0.0-alpha.9": "140.0.7301.0", + "38.0.0-alpha.10": "140.0.7309.0", + "38.0.0-alpha.11": "140.0.7312.0", + "38.0.0-alpha.12": "140.0.7314.0", + "38.0.0-alpha.13": "140.0.7314.0", + "38.0.0-beta.1": "140.0.7314.0", + "38.0.0-beta.2": "140.0.7327.0", + "38.0.0-beta.3": "140.0.7327.0", + "38.0.0-beta.4": "140.0.7339.2", + "38.0.0-beta.5": "140.0.7339.2", + "38.0.0-beta.6": "140.0.7339.2", + "38.0.0-beta.7": "140.0.7339.16", + "38.0.0-beta.8": "140.0.7339.24", + "38.0.0-beta.9": "140.0.7339.24", + "38.0.0-beta.11": "140.0.7339.41", + "38.0.0": "140.0.7339.41", + "38.1.0": "140.0.7339.80", + "38.1.1": "140.0.7339.133", + "38.1.2": "140.0.7339.133", + "38.2.0": "140.0.7339.133", + "38.2.1": "140.0.7339.133", + "38.2.2": "140.0.7339.133", + "38.3.0": "140.0.7339.240", + "38.4.0": "140.0.7339.240", + "38.5.0": "140.0.7339.249", + "38.6.0": "140.0.7339.249", + "38.7.0": "140.0.7339.249", + "38.7.1": "140.0.7339.249", + "38.7.2": "140.0.7339.249", + "39.0.0-alpha.1": "141.0.7361.0", + "39.0.0-alpha.2": "141.0.7361.0", + "39.0.0-alpha.3": "141.0.7390.7", + "39.0.0-alpha.4": "141.0.7390.7", + "39.0.0-alpha.5": "141.0.7390.7", + "39.0.0-alpha.6": "142.0.7417.0", + "39.0.0-alpha.7": "142.0.7417.0", + "39.0.0-alpha.8": "142.0.7417.0", + "39.0.0-alpha.9": "142.0.7417.0", + "39.0.0-beta.1": "142.0.7417.0", + "39.0.0-beta.2": "142.0.7417.0", + "39.0.0-beta.3": "142.0.7417.0", + "39.0.0-beta.4": "142.0.7444.34", + "39.0.0-beta.5": "142.0.7444.34", + "39.0.0": "142.0.7444.52", + "39.1.0": "142.0.7444.59", + "39.1.1": "142.0.7444.59", + "39.1.2": "142.0.7444.134", + "39.2.0": "142.0.7444.162", + "39.2.1": "142.0.7444.162", + "39.2.2": "142.0.7444.162", + "39.2.3": "142.0.7444.175", + "39.2.4": "142.0.7444.177", + "39.2.5": "142.0.7444.177", + "39.2.6": "142.0.7444.226", + "40.0.0-alpha.2": "143.0.7499.0", + "40.0.0-alpha.4": "144.0.7506.0", + "40.0.0-alpha.5": "144.0.7526.0", + "40.0.0-alpha.6": "144.0.7526.0", + "40.0.0-alpha.7": "144.0.7526.0", + "40.0.0-alpha.8": "144.0.7526.0", + "40.0.0-beta.1": "144.0.7527.0", + "40.0.0-beta.2": "144.0.7527.0" +}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/full-versions.json b/node_modules/electron-to-chromium/full-versions.json new file mode 100644 index 0000000..9bc093d --- /dev/null +++ b/node_modules/electron-to-chromium/full-versions.json @@ -0,0 +1 @@ +{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.100","3.0.0-beta.1":"66.0.3359.181","3.0.0-beta.2":"66.0.3359.181","3.0.0-beta.3":"66.0.3359.181","3.0.0-beta.4":"66.0.3359.181","3.0.0-beta.5":"66.0.3359.181","3.0.0-beta.6":"66.0.3359.181","3.0.0-beta.7":"66.0.3359.181","3.0.0-beta.8":"66.0.3359.181","3.0.0-beta.9":"66.0.3359.181","3.0.0-beta.10":"66.0.3359.181","3.0.0-beta.11":"66.0.3359.181","3.0.0-beta.12":"66.0.3359.181","3.0.0-beta.13":"66.0.3359.181","3.0.0":"66.0.3359.181","3.0.1":"66.0.3359.181","3.0.2":"66.0.3359.181","3.0.3":"66.0.3359.181","3.0.4":"66.0.3359.181","3.0.5":"66.0.3359.181","3.0.6":"66.0.3359.181","3.0.7":"66.0.3359.181","3.0.8":"66.0.3359.181","3.0.9":"66.0.3359.181","3.0.10":"66.0.3359.181","3.0.11":"66.0.3359.181","3.0.12":"66.0.3359.181","3.0.13":"66.0.3359.181","3.0.14":"66.0.3359.181","3.0.15":"66.0.3359.181","3.0.16":"66.0.3359.181","3.1.0-beta.1":"66.0.3359.181","3.1.0-beta.2":"66.0.3359.181","3.1.0-beta.3":"66.0.3359.181","3.1.0-beta.4":"66.0.3359.181","3.1.0-beta.5":"66.0.3359.181","3.1.0":"66.0.3359.181","3.1.1":"66.0.3359.181","3.1.2":"66.0.3359.181","3.1.3":"66.0.3359.181","3.1.4":"66.0.3359.181","3.1.5":"66.0.3359.181","3.1.6":"66.0.3359.181","3.1.7":"66.0.3359.181","3.1.8":"66.0.3359.181","3.1.9":"66.0.3359.181","3.1.10":"66.0.3359.181","3.1.11":"66.0.3359.181","3.1.12":"66.0.3359.181","3.1.13":"66.0.3359.181","4.0.0-beta.1":"69.0.3497.106","4.0.0-beta.2":"69.0.3497.106","4.0.0-beta.3":"69.0.3497.106","4.0.0-beta.4":"69.0.3497.106","4.0.0-beta.5":"69.0.3497.106","4.0.0-beta.6":"69.0.3497.106","4.0.0-beta.7":"69.0.3497.106","4.0.0-beta.8":"69.0.3497.106","4.0.0-beta.9":"69.0.3497.106","4.0.0-beta.10":"69.0.3497.106","4.0.0-beta.11":"69.0.3497.106","4.0.0":"69.0.3497.106","4.0.1":"69.0.3497.106","4.0.2":"69.0.3497.106","4.0.3":"69.0.3497.106","4.0.4":"69.0.3497.106","4.0.5":"69.0.3497.106","4.0.6":"69.0.3497.106","4.0.7":"69.0.3497.128","4.0.8":"69.0.3497.128","4.1.0":"69.0.3497.128","4.1.1":"69.0.3497.128","4.1.2":"69.0.3497.128","4.1.3":"69.0.3497.128","4.1.4":"69.0.3497.128","4.1.5":"69.0.3497.128","4.2.0":"69.0.3497.128","4.2.1":"69.0.3497.128","4.2.2":"69.0.3497.128","4.2.3":"69.0.3497.128","4.2.4":"69.0.3497.128","4.2.5":"69.0.3497.128","4.2.6":"69.0.3497.128","4.2.7":"69.0.3497.128","4.2.8":"69.0.3497.128","4.2.9":"69.0.3497.128","4.2.10":"69.0.3497.128","4.2.11":"69.0.3497.128","4.2.12":"69.0.3497.128","5.0.0-beta.1":"72.0.3626.52","5.0.0-beta.2":"72.0.3626.52","5.0.0-beta.3":"73.0.3683.27","5.0.0-beta.4":"73.0.3683.54","5.0.0-beta.5":"73.0.3683.61","5.0.0-beta.6":"73.0.3683.84","5.0.0-beta.7":"73.0.3683.94","5.0.0-beta.8":"73.0.3683.104","5.0.0-beta.9":"73.0.3683.117","5.0.0":"73.0.3683.119","5.0.1":"73.0.3683.121","5.0.2":"73.0.3683.121","5.0.3":"73.0.3683.121","5.0.4":"73.0.3683.121","5.0.5":"73.0.3683.121","5.0.6":"73.0.3683.121","5.0.7":"73.0.3683.121","5.0.8":"73.0.3683.121","5.0.9":"73.0.3683.121","5.0.10":"73.0.3683.121","5.0.11":"73.0.3683.121","5.0.12":"73.0.3683.121","5.0.13":"73.0.3683.121","6.0.0-beta.1":"76.0.3774.1","6.0.0-beta.2":"76.0.3783.1","6.0.0-beta.3":"76.0.3783.1","6.0.0-beta.4":"76.0.3783.1","6.0.0-beta.5":"76.0.3805.4","6.0.0-beta.6":"76.0.3809.3","6.0.0-beta.7":"76.0.3809.22","6.0.0-beta.8":"76.0.3809.26","6.0.0-beta.9":"76.0.3809.26","6.0.0-beta.10":"76.0.3809.37","6.0.0-beta.11":"76.0.3809.42","6.0.0-beta.12":"76.0.3809.54","6.0.0-beta.13":"76.0.3809.60","6.0.0-beta.14":"76.0.3809.68","6.0.0-beta.15":"76.0.3809.74","6.0.0":"76.0.3809.88","6.0.1":"76.0.3809.102","6.0.2":"76.0.3809.110","6.0.3":"76.0.3809.126","6.0.4":"76.0.3809.131","6.0.5":"76.0.3809.136","6.0.6":"76.0.3809.138","6.0.7":"76.0.3809.139","6.0.8":"76.0.3809.146","6.0.9":"76.0.3809.146","6.0.10":"76.0.3809.146","6.0.11":"76.0.3809.146","6.0.12":"76.0.3809.146","6.1.0":"76.0.3809.146","6.1.1":"76.0.3809.146","6.1.2":"76.0.3809.146","6.1.3":"76.0.3809.146","6.1.4":"76.0.3809.146","6.1.5":"76.0.3809.146","6.1.6":"76.0.3809.146","6.1.7":"76.0.3809.146","6.1.8":"76.0.3809.146","6.1.9":"76.0.3809.146","6.1.10":"76.0.3809.146","6.1.11":"76.0.3809.146","6.1.12":"76.0.3809.146","7.0.0-beta.1":"78.0.3866.0","7.0.0-beta.2":"78.0.3866.0","7.0.0-beta.3":"78.0.3866.0","7.0.0-beta.4":"78.0.3896.6","7.0.0-beta.5":"78.0.3905.1","7.0.0-beta.6":"78.0.3905.1","7.0.0-beta.7":"78.0.3905.1","7.0.0":"78.0.3905.1","7.0.1":"78.0.3904.92","7.1.0":"78.0.3904.94","7.1.1":"78.0.3904.99","7.1.2":"78.0.3904.113","7.1.3":"78.0.3904.126","7.1.4":"78.0.3904.130","7.1.5":"78.0.3904.130","7.1.6":"78.0.3904.130","7.1.7":"78.0.3904.130","7.1.8":"78.0.3904.130","7.1.9":"78.0.3904.130","7.1.10":"78.0.3904.130","7.1.11":"78.0.3904.130","7.1.12":"78.0.3904.130","7.1.13":"78.0.3904.130","7.1.14":"78.0.3904.130","7.2.0":"78.0.3904.130","7.2.1":"78.0.3904.130","7.2.2":"78.0.3904.130","7.2.3":"78.0.3904.130","7.2.4":"78.0.3904.130","7.3.0":"78.0.3904.130","7.3.1":"78.0.3904.130","7.3.2":"78.0.3904.130","7.3.3":"78.0.3904.130","8.0.0-beta.1":"79.0.3931.0","8.0.0-beta.2":"79.0.3931.0","8.0.0-beta.3":"80.0.3955.0","8.0.0-beta.4":"80.0.3955.0","8.0.0-beta.5":"80.0.3987.14","8.0.0-beta.6":"80.0.3987.51","8.0.0-beta.7":"80.0.3987.59","8.0.0-beta.8":"80.0.3987.75","8.0.0-beta.9":"80.0.3987.75","8.0.0":"80.0.3987.86","8.0.1":"80.0.3987.86","8.0.2":"80.0.3987.86","8.0.3":"80.0.3987.134","8.1.0":"80.0.3987.137","8.1.1":"80.0.3987.141","8.2.0":"80.0.3987.158","8.2.1":"80.0.3987.163","8.2.2":"80.0.3987.163","8.2.3":"80.0.3987.163","8.2.4":"80.0.3987.165","8.2.5":"80.0.3987.165","8.3.0":"80.0.3987.165","8.3.1":"80.0.3987.165","8.3.2":"80.0.3987.165","8.3.3":"80.0.3987.165","8.3.4":"80.0.3987.165","8.4.0":"80.0.3987.165","8.4.1":"80.0.3987.165","8.5.0":"80.0.3987.165","8.5.1":"80.0.3987.165","8.5.2":"80.0.3987.165","8.5.3":"80.0.3987.163","8.5.4":"80.0.3987.163","8.5.5":"80.0.3987.163","9.0.0-beta.1":"82.0.4048.0","9.0.0-beta.2":"82.0.4048.0","9.0.0-beta.3":"82.0.4048.0","9.0.0-beta.4":"82.0.4048.0","9.0.0-beta.5":"82.0.4048.0","9.0.0-beta.6":"82.0.4058.2","9.0.0-beta.7":"82.0.4058.2","9.0.0-beta.9":"82.0.4058.2","9.0.0-beta.10":"82.0.4085.10","9.0.0-beta.11":"82.0.4085.14","9.0.0-beta.12":"82.0.4085.14","9.0.0-beta.13":"82.0.4085.14","9.0.0-beta.14":"82.0.4085.27","9.0.0-beta.15":"83.0.4102.3","9.0.0-beta.16":"83.0.4102.3","9.0.0-beta.17":"83.0.4103.14","9.0.0-beta.18":"83.0.4103.16","9.0.0-beta.19":"83.0.4103.24","9.0.0-beta.20":"83.0.4103.26","9.0.0-beta.21":"83.0.4103.26","9.0.0-beta.22":"83.0.4103.34","9.0.0-beta.23":"83.0.4103.44","9.0.0-beta.24":"83.0.4103.45","9.0.0":"83.0.4103.64","9.0.1":"83.0.4103.94","9.0.2":"83.0.4103.94","9.0.3":"83.0.4103.100","9.0.4":"83.0.4103.104","9.0.5":"83.0.4103.119","9.1.0":"83.0.4103.122","9.1.1":"83.0.4103.122","9.1.2":"83.0.4103.122","9.2.0":"83.0.4103.122","9.2.1":"83.0.4103.122","9.3.0":"83.0.4103.122","9.3.1":"83.0.4103.122","9.3.2":"83.0.4103.122","9.3.3":"83.0.4103.122","9.3.4":"83.0.4103.122","9.3.5":"83.0.4103.122","9.4.0":"83.0.4103.122","9.4.1":"83.0.4103.122","9.4.2":"83.0.4103.122","9.4.3":"83.0.4103.122","9.4.4":"83.0.4103.122","10.0.0-beta.1":"84.0.4129.0","10.0.0-beta.2":"84.0.4129.0","10.0.0-beta.3":"85.0.4161.2","10.0.0-beta.4":"85.0.4161.2","10.0.0-beta.8":"85.0.4181.1","10.0.0-beta.9":"85.0.4181.1","10.0.0-beta.10":"85.0.4183.19","10.0.0-beta.11":"85.0.4183.20","10.0.0-beta.12":"85.0.4183.26","10.0.0-beta.13":"85.0.4183.39","10.0.0-beta.14":"85.0.4183.39","10.0.0-beta.15":"85.0.4183.39","10.0.0-beta.17":"85.0.4183.39","10.0.0-beta.19":"85.0.4183.39","10.0.0-beta.20":"85.0.4183.39","10.0.0-beta.21":"85.0.4183.39","10.0.0-beta.23":"85.0.4183.70","10.0.0-beta.24":"85.0.4183.78","10.0.0-beta.25":"85.0.4183.80","10.0.0":"85.0.4183.84","10.0.1":"85.0.4183.86","10.1.0":"85.0.4183.87","10.1.1":"85.0.4183.93","10.1.2":"85.0.4183.98","10.1.3":"85.0.4183.121","10.1.4":"85.0.4183.121","10.1.5":"85.0.4183.121","10.1.6":"85.0.4183.121","10.1.7":"85.0.4183.121","10.2.0":"85.0.4183.121","10.3.0":"85.0.4183.121","10.3.1":"85.0.4183.121","10.3.2":"85.0.4183.121","10.4.0":"85.0.4183.121","10.4.1":"85.0.4183.121","10.4.2":"85.0.4183.121","10.4.3":"85.0.4183.121","10.4.4":"85.0.4183.121","10.4.5":"85.0.4183.121","10.4.6":"85.0.4183.121","10.4.7":"85.0.4183.121","11.0.0-beta.1":"86.0.4234.0","11.0.0-beta.3":"86.0.4234.0","11.0.0-beta.4":"86.0.4234.0","11.0.0-beta.5":"86.0.4234.0","11.0.0-beta.6":"86.0.4234.0","11.0.0-beta.7":"86.0.4234.0","11.0.0-beta.8":"87.0.4251.1","11.0.0-beta.9":"87.0.4251.1","11.0.0-beta.11":"87.0.4251.1","11.0.0-beta.12":"87.0.4280.11","11.0.0-beta.13":"87.0.4280.11","11.0.0-beta.16":"87.0.4280.27","11.0.0-beta.17":"87.0.4280.27","11.0.0-beta.18":"87.0.4280.27","11.0.0-beta.19":"87.0.4280.27","11.0.0-beta.20":"87.0.4280.40","11.0.0-beta.22":"87.0.4280.47","11.0.0-beta.23":"87.0.4280.47","11.0.0":"87.0.4280.60","11.0.1":"87.0.4280.60","11.0.2":"87.0.4280.67","11.0.3":"87.0.4280.67","11.0.4":"87.0.4280.67","11.0.5":"87.0.4280.88","11.1.0":"87.0.4280.88","11.1.1":"87.0.4280.88","11.2.0":"87.0.4280.141","11.2.1":"87.0.4280.141","11.2.2":"87.0.4280.141","11.2.3":"87.0.4280.141","11.3.0":"87.0.4280.141","11.4.0":"87.0.4280.141","11.4.1":"87.0.4280.141","11.4.2":"87.0.4280.141","11.4.3":"87.0.4280.141","11.4.4":"87.0.4280.141","11.4.5":"87.0.4280.141","11.4.6":"87.0.4280.141","11.4.7":"87.0.4280.141","11.4.8":"87.0.4280.141","11.4.9":"87.0.4280.141","11.4.10":"87.0.4280.141","11.4.11":"87.0.4280.141","11.4.12":"87.0.4280.141","11.5.0":"87.0.4280.141","12.0.0-beta.1":"89.0.4328.0","12.0.0-beta.3":"89.0.4328.0","12.0.0-beta.4":"89.0.4328.0","12.0.0-beta.5":"89.0.4328.0","12.0.0-beta.6":"89.0.4328.0","12.0.0-beta.7":"89.0.4328.0","12.0.0-beta.8":"89.0.4328.0","12.0.0-beta.9":"89.0.4328.0","12.0.0-beta.10":"89.0.4328.0","12.0.0-beta.11":"89.0.4328.0","12.0.0-beta.12":"89.0.4328.0","12.0.0-beta.14":"89.0.4328.0","12.0.0-beta.16":"89.0.4348.1","12.0.0-beta.18":"89.0.4348.1","12.0.0-beta.19":"89.0.4348.1","12.0.0-beta.20":"89.0.4348.1","12.0.0-beta.21":"89.0.4388.2","12.0.0-beta.22":"89.0.4388.2","12.0.0-beta.23":"89.0.4388.2","12.0.0-beta.24":"89.0.4388.2","12.0.0-beta.25":"89.0.4388.2","12.0.0-beta.26":"89.0.4388.2","12.0.0-beta.27":"89.0.4389.23","12.0.0-beta.28":"89.0.4389.23","12.0.0-beta.29":"89.0.4389.23","12.0.0-beta.30":"89.0.4389.58","12.0.0-beta.31":"89.0.4389.58","12.0.0":"89.0.4389.69","12.0.1":"89.0.4389.82","12.0.2":"89.0.4389.90","12.0.3":"89.0.4389.114","12.0.4":"89.0.4389.114","12.0.5":"89.0.4389.128","12.0.6":"89.0.4389.128","12.0.7":"89.0.4389.128","12.0.8":"89.0.4389.128","12.0.9":"89.0.4389.128","12.0.10":"89.0.4389.128","12.0.11":"89.0.4389.128","12.0.12":"89.0.4389.128","12.0.13":"89.0.4389.128","12.0.14":"89.0.4389.128","12.0.15":"89.0.4389.128","12.0.16":"89.0.4389.128","12.0.17":"89.0.4389.128","12.0.18":"89.0.4389.128","12.1.0":"89.0.4389.128","12.1.1":"89.0.4389.128","12.1.2":"89.0.4389.128","12.2.0":"89.0.4389.128","12.2.1":"89.0.4389.128","12.2.2":"89.0.4389.128","12.2.3":"89.0.4389.128","13.0.0-beta.2":"90.0.4402.0","13.0.0-beta.3":"90.0.4402.0","13.0.0-beta.4":"90.0.4415.0","13.0.0-beta.5":"90.0.4415.0","13.0.0-beta.6":"90.0.4415.0","13.0.0-beta.7":"90.0.4415.0","13.0.0-beta.8":"90.0.4415.0","13.0.0-beta.9":"90.0.4415.0","13.0.0-beta.10":"90.0.4415.0","13.0.0-beta.11":"90.0.4415.0","13.0.0-beta.12":"90.0.4415.0","13.0.0-beta.13":"90.0.4415.0","13.0.0-beta.14":"91.0.4448.0","13.0.0-beta.16":"91.0.4448.0","13.0.0-beta.17":"91.0.4448.0","13.0.0-beta.18":"91.0.4448.0","13.0.0-beta.20":"91.0.4448.0","13.0.0-beta.21":"91.0.4472.33","13.0.0-beta.22":"91.0.4472.33","13.0.0-beta.23":"91.0.4472.33","13.0.0-beta.24":"91.0.4472.38","13.0.0-beta.25":"91.0.4472.38","13.0.0-beta.26":"91.0.4472.38","13.0.0-beta.27":"91.0.4472.38","13.0.0-beta.28":"91.0.4472.38","13.0.0":"91.0.4472.69","13.0.1":"91.0.4472.69","13.1.0":"91.0.4472.77","13.1.1":"91.0.4472.77","13.1.2":"91.0.4472.77","13.1.3":"91.0.4472.106","13.1.4":"91.0.4472.106","13.1.5":"91.0.4472.124","13.1.6":"91.0.4472.124","13.1.7":"91.0.4472.124","13.1.8":"91.0.4472.164","13.1.9":"91.0.4472.164","13.2.0":"91.0.4472.164","13.2.1":"91.0.4472.164","13.2.2":"91.0.4472.164","13.2.3":"91.0.4472.164","13.3.0":"91.0.4472.164","13.4.0":"91.0.4472.164","13.5.0":"91.0.4472.164","13.5.1":"91.0.4472.164","13.5.2":"91.0.4472.164","13.6.0":"91.0.4472.164","13.6.1":"91.0.4472.164","13.6.2":"91.0.4472.164","13.6.3":"91.0.4472.164","13.6.6":"91.0.4472.164","13.6.7":"91.0.4472.164","13.6.8":"91.0.4472.164","13.6.9":"91.0.4472.164","14.0.0-beta.1":"92.0.4511.0","14.0.0-beta.2":"92.0.4511.0","14.0.0-beta.3":"92.0.4511.0","14.0.0-beta.5":"93.0.4536.0","14.0.0-beta.6":"93.0.4536.0","14.0.0-beta.7":"93.0.4536.0","14.0.0-beta.8":"93.0.4536.0","14.0.0-beta.9":"93.0.4539.0","14.0.0-beta.10":"93.0.4539.0","14.0.0-beta.11":"93.0.4557.4","14.0.0-beta.12":"93.0.4557.4","14.0.0-beta.13":"93.0.4566.0","14.0.0-beta.14":"93.0.4566.0","14.0.0-beta.15":"93.0.4566.0","14.0.0-beta.16":"93.0.4566.0","14.0.0-beta.17":"93.0.4566.0","14.0.0-beta.18":"93.0.4577.15","14.0.0-beta.19":"93.0.4577.15","14.0.0-beta.20":"93.0.4577.15","14.0.0-beta.21":"93.0.4577.15","14.0.0-beta.22":"93.0.4577.25","14.0.0-beta.23":"93.0.4577.25","14.0.0-beta.24":"93.0.4577.51","14.0.0-beta.25":"93.0.4577.51","14.0.0":"93.0.4577.58","14.0.1":"93.0.4577.63","14.0.2":"93.0.4577.82","14.1.0":"93.0.4577.82","14.1.1":"93.0.4577.82","14.2.0":"93.0.4577.82","14.2.1":"93.0.4577.82","14.2.2":"93.0.4577.82","14.2.3":"93.0.4577.82","14.2.4":"93.0.4577.82","14.2.5":"93.0.4577.82","14.2.6":"93.0.4577.82","14.2.7":"93.0.4577.82","14.2.8":"93.0.4577.82","14.2.9":"93.0.4577.82","15.0.0-alpha.1":"93.0.4566.0","15.0.0-alpha.2":"93.0.4566.0","15.0.0-alpha.3":"94.0.4584.0","15.0.0-alpha.4":"94.0.4584.0","15.0.0-alpha.5":"94.0.4584.0","15.0.0-alpha.6":"94.0.4584.0","15.0.0-alpha.7":"94.0.4590.2","15.0.0-alpha.8":"94.0.4590.2","15.0.0-alpha.9":"94.0.4590.2","15.0.0-alpha.10":"94.0.4606.12","15.0.0-beta.1":"94.0.4606.20","15.0.0-beta.2":"94.0.4606.20","15.0.0-beta.3":"94.0.4606.31","15.0.0-beta.4":"94.0.4606.31","15.0.0-beta.5":"94.0.4606.31","15.0.0-beta.6":"94.0.4606.31","15.0.0-beta.7":"94.0.4606.31","15.0.0":"94.0.4606.51","15.1.0":"94.0.4606.61","15.1.1":"94.0.4606.61","15.1.2":"94.0.4606.71","15.2.0":"94.0.4606.81","15.3.0":"94.0.4606.81","15.3.1":"94.0.4606.81","15.3.2":"94.0.4606.81","15.3.3":"94.0.4606.81","15.3.4":"94.0.4606.81","15.3.5":"94.0.4606.81","15.3.6":"94.0.4606.81","15.3.7":"94.0.4606.81","15.4.0":"94.0.4606.81","15.4.1":"94.0.4606.81","15.4.2":"94.0.4606.81","15.5.0":"94.0.4606.81","15.5.1":"94.0.4606.81","15.5.2":"94.0.4606.81","15.5.3":"94.0.4606.81","15.5.4":"94.0.4606.81","15.5.5":"94.0.4606.81","15.5.6":"94.0.4606.81","15.5.7":"94.0.4606.81","16.0.0-alpha.1":"95.0.4629.0","16.0.0-alpha.2":"95.0.4629.0","16.0.0-alpha.3":"95.0.4629.0","16.0.0-alpha.4":"95.0.4629.0","16.0.0-alpha.5":"95.0.4629.0","16.0.0-alpha.6":"95.0.4629.0","16.0.0-alpha.7":"95.0.4629.0","16.0.0-alpha.8":"96.0.4647.0","16.0.0-alpha.9":"96.0.4647.0","16.0.0-beta.1":"96.0.4647.0","16.0.0-beta.2":"96.0.4647.0","16.0.0-beta.3":"96.0.4647.0","16.0.0-beta.4":"96.0.4664.18","16.0.0-beta.5":"96.0.4664.18","16.0.0-beta.6":"96.0.4664.27","16.0.0-beta.7":"96.0.4664.27","16.0.0-beta.8":"96.0.4664.35","16.0.0-beta.9":"96.0.4664.35","16.0.0":"96.0.4664.45","16.0.1":"96.0.4664.45","16.0.2":"96.0.4664.55","16.0.3":"96.0.4664.55","16.0.4":"96.0.4664.55","16.0.5":"96.0.4664.55","16.0.6":"96.0.4664.110","16.0.7":"96.0.4664.110","16.0.8":"96.0.4664.110","16.0.9":"96.0.4664.174","16.0.10":"96.0.4664.174","16.1.0":"96.0.4664.174","16.1.1":"96.0.4664.174","16.2.0":"96.0.4664.174","16.2.1":"96.0.4664.174","16.2.2":"96.0.4664.174","16.2.3":"96.0.4664.174","16.2.4":"96.0.4664.174","16.2.5":"96.0.4664.174","16.2.6":"96.0.4664.174","16.2.7":"96.0.4664.174","16.2.8":"96.0.4664.174","17.0.0-alpha.1":"96.0.4664.4","17.0.0-alpha.2":"96.0.4664.4","17.0.0-alpha.3":"96.0.4664.4","17.0.0-alpha.4":"98.0.4706.0","17.0.0-alpha.5":"98.0.4706.0","17.0.0-alpha.6":"98.0.4706.0","17.0.0-beta.1":"98.0.4706.0","17.0.0-beta.2":"98.0.4706.0","17.0.0-beta.3":"98.0.4758.9","17.0.0-beta.4":"98.0.4758.11","17.0.0-beta.5":"98.0.4758.11","17.0.0-beta.6":"98.0.4758.11","17.0.0-beta.7":"98.0.4758.11","17.0.0-beta.8":"98.0.4758.11","17.0.0-beta.9":"98.0.4758.11","17.0.0":"98.0.4758.74","17.0.1":"98.0.4758.82","17.1.0":"98.0.4758.102","17.1.1":"98.0.4758.109","17.1.2":"98.0.4758.109","17.2.0":"98.0.4758.109","17.3.0":"98.0.4758.141","17.3.1":"98.0.4758.141","17.4.0":"98.0.4758.141","17.4.1":"98.0.4758.141","17.4.2":"98.0.4758.141","17.4.3":"98.0.4758.141","17.4.4":"98.0.4758.141","17.4.5":"98.0.4758.141","17.4.6":"98.0.4758.141","17.4.7":"98.0.4758.141","17.4.8":"98.0.4758.141","17.4.9":"98.0.4758.141","17.4.10":"98.0.4758.141","17.4.11":"98.0.4758.141","18.0.0-alpha.1":"99.0.4767.0","18.0.0-alpha.2":"99.0.4767.0","18.0.0-alpha.3":"99.0.4767.0","18.0.0-alpha.4":"99.0.4767.0","18.0.0-alpha.5":"99.0.4767.0","18.0.0-beta.1":"100.0.4894.0","18.0.0-beta.2":"100.0.4894.0","18.0.0-beta.3":"100.0.4894.0","18.0.0-beta.4":"100.0.4894.0","18.0.0-beta.5":"100.0.4894.0","18.0.0-beta.6":"100.0.4894.0","18.0.0":"100.0.4896.56","18.0.1":"100.0.4896.60","18.0.2":"100.0.4896.60","18.0.3":"100.0.4896.75","18.0.4":"100.0.4896.75","18.1.0":"100.0.4896.127","18.2.0":"100.0.4896.143","18.2.1":"100.0.4896.143","18.2.2":"100.0.4896.143","18.2.3":"100.0.4896.143","18.2.4":"100.0.4896.160","18.3.0":"100.0.4896.160","18.3.1":"100.0.4896.160","18.3.2":"100.0.4896.160","18.3.3":"100.0.4896.160","18.3.4":"100.0.4896.160","18.3.5":"100.0.4896.160","18.3.6":"100.0.4896.160","18.3.7":"100.0.4896.160","18.3.8":"100.0.4896.160","18.3.9":"100.0.4896.160","18.3.11":"100.0.4896.160","18.3.12":"100.0.4896.160","18.3.13":"100.0.4896.160","18.3.14":"100.0.4896.160","18.3.15":"100.0.4896.160","19.0.0-alpha.1":"102.0.4962.3","19.0.0-alpha.2":"102.0.4971.0","19.0.0-alpha.3":"102.0.4971.0","19.0.0-alpha.4":"102.0.4989.0","19.0.0-alpha.5":"102.0.4989.0","19.0.0-beta.1":"102.0.4999.0","19.0.0-beta.2":"102.0.4999.0","19.0.0-beta.3":"102.0.4999.0","19.0.0-beta.4":"102.0.5005.27","19.0.0-beta.5":"102.0.5005.40","19.0.0-beta.6":"102.0.5005.40","19.0.0-beta.7":"102.0.5005.40","19.0.0-beta.8":"102.0.5005.49","19.0.0":"102.0.5005.61","19.0.1":"102.0.5005.61","19.0.2":"102.0.5005.63","19.0.3":"102.0.5005.63","19.0.4":"102.0.5005.63","19.0.5":"102.0.5005.115","19.0.6":"102.0.5005.115","19.0.7":"102.0.5005.134","19.0.8":"102.0.5005.148","19.0.9":"102.0.5005.167","19.0.10":"102.0.5005.167","19.0.11":"102.0.5005.167","19.0.12":"102.0.5005.167","19.0.13":"102.0.5005.167","19.0.14":"102.0.5005.167","19.0.15":"102.0.5005.167","19.0.16":"102.0.5005.167","19.0.17":"102.0.5005.167","19.1.0":"102.0.5005.167","19.1.1":"102.0.5005.167","19.1.2":"102.0.5005.167","19.1.3":"102.0.5005.167","19.1.4":"102.0.5005.167","19.1.5":"102.0.5005.167","19.1.6":"102.0.5005.167","19.1.7":"102.0.5005.167","19.1.8":"102.0.5005.167","19.1.9":"102.0.5005.167","20.0.0-alpha.1":"103.0.5044.0","20.0.0-alpha.2":"104.0.5073.0","20.0.0-alpha.3":"104.0.5073.0","20.0.0-alpha.4":"104.0.5073.0","20.0.0-alpha.5":"104.0.5073.0","20.0.0-alpha.6":"104.0.5073.0","20.0.0-alpha.7":"104.0.5073.0","20.0.0-beta.1":"104.0.5073.0","20.0.0-beta.2":"104.0.5073.0","20.0.0-beta.3":"104.0.5073.0","20.0.0-beta.4":"104.0.5073.0","20.0.0-beta.5":"104.0.5073.0","20.0.0-beta.6":"104.0.5073.0","20.0.0-beta.7":"104.0.5073.0","20.0.0-beta.8":"104.0.5073.0","20.0.0-beta.9":"104.0.5112.39","20.0.0-beta.10":"104.0.5112.48","20.0.0-beta.11":"104.0.5112.48","20.0.0-beta.12":"104.0.5112.48","20.0.0-beta.13":"104.0.5112.57","20.0.0":"104.0.5112.65","20.0.1":"104.0.5112.81","20.0.2":"104.0.5112.81","20.0.3":"104.0.5112.81","20.1.0":"104.0.5112.102","20.1.1":"104.0.5112.102","20.1.2":"104.0.5112.114","20.1.3":"104.0.5112.114","20.1.4":"104.0.5112.114","20.2.0":"104.0.5112.124","20.3.0":"104.0.5112.124","20.3.1":"104.0.5112.124","20.3.2":"104.0.5112.124","20.3.3":"104.0.5112.124","20.3.4":"104.0.5112.124","20.3.5":"104.0.5112.124","20.3.6":"104.0.5112.124","20.3.7":"104.0.5112.124","20.3.8":"104.0.5112.124","20.3.9":"104.0.5112.124","20.3.10":"104.0.5112.124","20.3.11":"104.0.5112.124","20.3.12":"104.0.5112.124","21.0.0-alpha.1":"105.0.5187.0","21.0.0-alpha.2":"105.0.5187.0","21.0.0-alpha.3":"105.0.5187.0","21.0.0-alpha.4":"105.0.5187.0","21.0.0-alpha.5":"105.0.5187.0","21.0.0-alpha.6":"106.0.5216.0","21.0.0-beta.1":"106.0.5216.0","21.0.0-beta.2":"106.0.5216.0","21.0.0-beta.3":"106.0.5216.0","21.0.0-beta.4":"106.0.5216.0","21.0.0-beta.5":"106.0.5216.0","21.0.0-beta.6":"106.0.5249.40","21.0.0-beta.7":"106.0.5249.40","21.0.0-beta.8":"106.0.5249.40","21.0.0":"106.0.5249.51","21.0.1":"106.0.5249.61","21.1.0":"106.0.5249.91","21.1.1":"106.0.5249.103","21.2.0":"106.0.5249.119","21.2.1":"106.0.5249.165","21.2.2":"106.0.5249.168","21.2.3":"106.0.5249.168","21.3.0":"106.0.5249.181","21.3.1":"106.0.5249.181","21.3.3":"106.0.5249.199","21.3.4":"106.0.5249.199","21.3.5":"106.0.5249.199","21.4.0":"106.0.5249.199","21.4.1":"106.0.5249.199","21.4.2":"106.0.5249.199","21.4.3":"106.0.5249.199","21.4.4":"106.0.5249.199","22.0.0-alpha.1":"107.0.5286.0","22.0.0-alpha.3":"108.0.5329.0","22.0.0-alpha.4":"108.0.5329.0","22.0.0-alpha.5":"108.0.5329.0","22.0.0-alpha.6":"108.0.5329.0","22.0.0-alpha.7":"108.0.5355.0","22.0.0-alpha.8":"108.0.5359.10","22.0.0-beta.1":"108.0.5359.10","22.0.0-beta.2":"108.0.5359.10","22.0.0-beta.3":"108.0.5359.10","22.0.0-beta.4":"108.0.5359.29","22.0.0-beta.5":"108.0.5359.40","22.0.0-beta.6":"108.0.5359.40","22.0.0-beta.7":"108.0.5359.48","22.0.0-beta.8":"108.0.5359.48","22.0.0":"108.0.5359.62","22.0.1":"108.0.5359.125","22.0.2":"108.0.5359.179","22.0.3":"108.0.5359.179","22.1.0":"108.0.5359.179","22.2.0":"108.0.5359.215","22.2.1":"108.0.5359.215","22.3.0":"108.0.5359.215","22.3.1":"108.0.5359.215","22.3.2":"108.0.5359.215","22.3.3":"108.0.5359.215","22.3.4":"108.0.5359.215","22.3.5":"108.0.5359.215","22.3.6":"108.0.5359.215","22.3.7":"108.0.5359.215","22.3.8":"108.0.5359.215","22.3.9":"108.0.5359.215","22.3.10":"108.0.5359.215","22.3.11":"108.0.5359.215","22.3.12":"108.0.5359.215","22.3.13":"108.0.5359.215","22.3.14":"108.0.5359.215","22.3.15":"108.0.5359.215","22.3.16":"108.0.5359.215","22.3.17":"108.0.5359.215","22.3.18":"108.0.5359.215","22.3.20":"108.0.5359.215","22.3.21":"108.0.5359.215","22.3.22":"108.0.5359.215","22.3.23":"108.0.5359.215","22.3.24":"108.0.5359.215","22.3.25":"108.0.5359.215","22.3.26":"108.0.5359.215","22.3.27":"108.0.5359.215","23.0.0-alpha.1":"110.0.5415.0","23.0.0-alpha.2":"110.0.5451.0","23.0.0-alpha.3":"110.0.5451.0","23.0.0-beta.1":"110.0.5478.5","23.0.0-beta.2":"110.0.5478.5","23.0.0-beta.3":"110.0.5478.5","23.0.0-beta.4":"110.0.5481.30","23.0.0-beta.5":"110.0.5481.38","23.0.0-beta.6":"110.0.5481.52","23.0.0-beta.8":"110.0.5481.52","23.0.0":"110.0.5481.77","23.1.0":"110.0.5481.100","23.1.1":"110.0.5481.104","23.1.2":"110.0.5481.177","23.1.3":"110.0.5481.179","23.1.4":"110.0.5481.192","23.2.0":"110.0.5481.192","23.2.1":"110.0.5481.208","23.2.2":"110.0.5481.208","23.2.3":"110.0.5481.208","23.2.4":"110.0.5481.208","23.3.0":"110.0.5481.208","23.3.1":"110.0.5481.208","23.3.2":"110.0.5481.208","23.3.3":"110.0.5481.208","23.3.4":"110.0.5481.208","23.3.5":"110.0.5481.208","23.3.6":"110.0.5481.208","23.3.7":"110.0.5481.208","23.3.8":"110.0.5481.208","23.3.9":"110.0.5481.208","23.3.10":"110.0.5481.208","23.3.11":"110.0.5481.208","23.3.12":"110.0.5481.208","23.3.13":"110.0.5481.208","24.0.0-alpha.1":"111.0.5560.0","24.0.0-alpha.2":"111.0.5560.0","24.0.0-alpha.3":"111.0.5560.0","24.0.0-alpha.4":"111.0.5560.0","24.0.0-alpha.5":"111.0.5560.0","24.0.0-alpha.6":"111.0.5560.0","24.0.0-alpha.7":"111.0.5560.0","24.0.0-beta.1":"111.0.5563.50","24.0.0-beta.2":"111.0.5563.50","24.0.0-beta.3":"112.0.5615.20","24.0.0-beta.4":"112.0.5615.20","24.0.0-beta.5":"112.0.5615.29","24.0.0-beta.6":"112.0.5615.39","24.0.0-beta.7":"112.0.5615.39","24.0.0":"112.0.5615.49","24.1.0":"112.0.5615.50","24.1.1":"112.0.5615.50","24.1.2":"112.0.5615.87","24.1.3":"112.0.5615.165","24.2.0":"112.0.5615.165","24.3.0":"112.0.5615.165","24.3.1":"112.0.5615.183","24.4.0":"112.0.5615.204","24.4.1":"112.0.5615.204","24.5.0":"112.0.5615.204","24.5.1":"112.0.5615.204","24.6.0":"112.0.5615.204","24.6.1":"112.0.5615.204","24.6.2":"112.0.5615.204","24.6.3":"112.0.5615.204","24.6.4":"112.0.5615.204","24.6.5":"112.0.5615.204","24.7.0":"112.0.5615.204","24.7.1":"112.0.5615.204","24.8.0":"112.0.5615.204","24.8.1":"112.0.5615.204","24.8.2":"112.0.5615.204","24.8.3":"112.0.5615.204","24.8.4":"112.0.5615.204","24.8.5":"112.0.5615.204","24.8.6":"112.0.5615.204","24.8.7":"112.0.5615.204","24.8.8":"112.0.5615.204","25.0.0-alpha.1":"114.0.5694.0","25.0.0-alpha.2":"114.0.5694.0","25.0.0-alpha.3":"114.0.5710.0","25.0.0-alpha.4":"114.0.5710.0","25.0.0-alpha.5":"114.0.5719.0","25.0.0-alpha.6":"114.0.5719.0","25.0.0-beta.1":"114.0.5719.0","25.0.0-beta.2":"114.0.5719.0","25.0.0-beta.3":"114.0.5719.0","25.0.0-beta.4":"114.0.5735.16","25.0.0-beta.5":"114.0.5735.16","25.0.0-beta.6":"114.0.5735.16","25.0.0-beta.7":"114.0.5735.16","25.0.0-beta.8":"114.0.5735.35","25.0.0-beta.9":"114.0.5735.45","25.0.0":"114.0.5735.45","25.0.1":"114.0.5735.45","25.1.0":"114.0.5735.106","25.1.1":"114.0.5735.106","25.2.0":"114.0.5735.134","25.3.0":"114.0.5735.199","25.3.1":"114.0.5735.243","25.3.2":"114.0.5735.248","25.4.0":"114.0.5735.248","25.5.0":"114.0.5735.289","25.6.0":"114.0.5735.289","25.7.0":"114.0.5735.289","25.8.0":"114.0.5735.289","25.8.1":"114.0.5735.289","25.8.2":"114.0.5735.289","25.8.3":"114.0.5735.289","25.8.4":"114.0.5735.289","25.9.0":"114.0.5735.289","25.9.1":"114.0.5735.289","25.9.2":"114.0.5735.289","25.9.3":"114.0.5735.289","25.9.4":"114.0.5735.289","25.9.5":"114.0.5735.289","25.9.6":"114.0.5735.289","25.9.7":"114.0.5735.289","25.9.8":"114.0.5735.289","26.0.0-alpha.1":"116.0.5791.0","26.0.0-alpha.2":"116.0.5791.0","26.0.0-alpha.3":"116.0.5791.0","26.0.0-alpha.4":"116.0.5791.0","26.0.0-alpha.5":"116.0.5791.0","26.0.0-alpha.6":"116.0.5815.0","26.0.0-alpha.7":"116.0.5831.0","26.0.0-alpha.8":"116.0.5845.0","26.0.0-beta.1":"116.0.5845.0","26.0.0-beta.2":"116.0.5845.14","26.0.0-beta.3":"116.0.5845.14","26.0.0-beta.4":"116.0.5845.14","26.0.0-beta.5":"116.0.5845.14","26.0.0-beta.6":"116.0.5845.14","26.0.0-beta.7":"116.0.5845.14","26.0.0-beta.8":"116.0.5845.42","26.0.0-beta.9":"116.0.5845.42","26.0.0-beta.10":"116.0.5845.49","26.0.0-beta.11":"116.0.5845.49","26.0.0-beta.12":"116.0.5845.62","26.0.0":"116.0.5845.82","26.1.0":"116.0.5845.97","26.2.0":"116.0.5845.179","26.2.1":"116.0.5845.188","26.2.2":"116.0.5845.190","26.2.3":"116.0.5845.190","26.2.4":"116.0.5845.190","26.3.0":"116.0.5845.228","26.4.0":"116.0.5845.228","26.4.1":"116.0.5845.228","26.4.2":"116.0.5845.228","26.4.3":"116.0.5845.228","26.5.0":"116.0.5845.228","26.6.0":"116.0.5845.228","26.6.1":"116.0.5845.228","26.6.2":"116.0.5845.228","26.6.3":"116.0.5845.228","26.6.4":"116.0.5845.228","26.6.5":"116.0.5845.228","26.6.6":"116.0.5845.228","26.6.7":"116.0.5845.228","26.6.8":"116.0.5845.228","26.6.9":"116.0.5845.228","26.6.10":"116.0.5845.228","27.0.0-alpha.1":"118.0.5949.0","27.0.0-alpha.2":"118.0.5949.0","27.0.0-alpha.3":"118.0.5949.0","27.0.0-alpha.4":"118.0.5949.0","27.0.0-alpha.5":"118.0.5949.0","27.0.0-alpha.6":"118.0.5949.0","27.0.0-beta.1":"118.0.5993.5","27.0.0-beta.2":"118.0.5993.5","27.0.0-beta.3":"118.0.5993.5","27.0.0-beta.4":"118.0.5993.11","27.0.0-beta.5":"118.0.5993.18","27.0.0-beta.6":"118.0.5993.18","27.0.0-beta.7":"118.0.5993.18","27.0.0-beta.8":"118.0.5993.18","27.0.0-beta.9":"118.0.5993.18","27.0.0":"118.0.5993.54","27.0.1":"118.0.5993.89","27.0.2":"118.0.5993.89","27.0.3":"118.0.5993.120","27.0.4":"118.0.5993.129","27.1.0":"118.0.5993.144","27.1.2":"118.0.5993.144","27.1.3":"118.0.5993.159","27.2.0":"118.0.5993.159","27.2.1":"118.0.5993.159","27.2.2":"118.0.5993.159","27.2.3":"118.0.5993.159","27.2.4":"118.0.5993.159","27.3.0":"118.0.5993.159","27.3.1":"118.0.5993.159","27.3.2":"118.0.5993.159","27.3.3":"118.0.5993.159","27.3.4":"118.0.5993.159","27.3.5":"118.0.5993.159","27.3.6":"118.0.5993.159","27.3.7":"118.0.5993.159","27.3.8":"118.0.5993.159","27.3.9":"118.0.5993.159","27.3.10":"118.0.5993.159","27.3.11":"118.0.5993.159","28.0.0-alpha.1":"119.0.6045.0","28.0.0-alpha.2":"119.0.6045.0","28.0.0-alpha.3":"119.0.6045.21","28.0.0-alpha.4":"119.0.6045.21","28.0.0-alpha.5":"119.0.6045.33","28.0.0-alpha.6":"119.0.6045.33","28.0.0-alpha.7":"119.0.6045.33","28.0.0-beta.1":"119.0.6045.33","28.0.0-beta.2":"120.0.6099.0","28.0.0-beta.3":"120.0.6099.5","28.0.0-beta.4":"120.0.6099.5","28.0.0-beta.5":"120.0.6099.18","28.0.0-beta.6":"120.0.6099.18","28.0.0-beta.7":"120.0.6099.18","28.0.0-beta.8":"120.0.6099.18","28.0.0-beta.9":"120.0.6099.18","28.0.0-beta.10":"120.0.6099.18","28.0.0-beta.11":"120.0.6099.35","28.0.0":"120.0.6099.56","28.1.0":"120.0.6099.109","28.1.1":"120.0.6099.109","28.1.2":"120.0.6099.199","28.1.3":"120.0.6099.199","28.1.4":"120.0.6099.216","28.2.0":"120.0.6099.227","28.2.1":"120.0.6099.268","28.2.2":"120.0.6099.276","28.2.3":"120.0.6099.283","28.2.4":"120.0.6099.291","28.2.5":"120.0.6099.291","28.2.6":"120.0.6099.291","28.2.7":"120.0.6099.291","28.2.8":"120.0.6099.291","28.2.9":"120.0.6099.291","28.2.10":"120.0.6099.291","28.3.0":"120.0.6099.291","28.3.1":"120.0.6099.291","28.3.2":"120.0.6099.291","28.3.3":"120.0.6099.291","29.0.0-alpha.1":"121.0.6147.0","29.0.0-alpha.2":"121.0.6147.0","29.0.0-alpha.3":"121.0.6147.0","29.0.0-alpha.4":"121.0.6159.0","29.0.0-alpha.5":"121.0.6159.0","29.0.0-alpha.6":"121.0.6159.0","29.0.0-alpha.7":"121.0.6159.0","29.0.0-alpha.8":"122.0.6194.0","29.0.0-alpha.9":"122.0.6236.2","29.0.0-alpha.10":"122.0.6236.2","29.0.0-alpha.11":"122.0.6236.2","29.0.0-beta.1":"122.0.6236.2","29.0.0-beta.2":"122.0.6236.2","29.0.0-beta.3":"122.0.6261.6","29.0.0-beta.4":"122.0.6261.6","29.0.0-beta.5":"122.0.6261.18","29.0.0-beta.6":"122.0.6261.18","29.0.0-beta.7":"122.0.6261.18","29.0.0-beta.8":"122.0.6261.18","29.0.0-beta.9":"122.0.6261.18","29.0.0-beta.10":"122.0.6261.18","29.0.0-beta.11":"122.0.6261.18","29.0.0-beta.12":"122.0.6261.29","29.0.0":"122.0.6261.39","29.0.1":"122.0.6261.57","29.1.0":"122.0.6261.70","29.1.1":"122.0.6261.111","29.1.2":"122.0.6261.112","29.1.3":"122.0.6261.112","29.1.4":"122.0.6261.129","29.1.5":"122.0.6261.130","29.1.6":"122.0.6261.139","29.2.0":"122.0.6261.156","29.3.0":"122.0.6261.156","29.3.1":"122.0.6261.156","29.3.2":"122.0.6261.156","29.3.3":"122.0.6261.156","29.4.0":"122.0.6261.156","29.4.1":"122.0.6261.156","29.4.2":"122.0.6261.156","29.4.3":"122.0.6261.156","29.4.4":"122.0.6261.156","29.4.5":"122.0.6261.156","29.4.6":"122.0.6261.156","30.0.0-alpha.1":"123.0.6296.0","30.0.0-alpha.2":"123.0.6312.5","30.0.0-alpha.3":"124.0.6323.0","30.0.0-alpha.4":"124.0.6323.0","30.0.0-alpha.5":"124.0.6331.0","30.0.0-alpha.6":"124.0.6331.0","30.0.0-alpha.7":"124.0.6353.0","30.0.0-beta.1":"124.0.6359.0","30.0.0-beta.2":"124.0.6359.0","30.0.0-beta.3":"124.0.6367.9","30.0.0-beta.4":"124.0.6367.9","30.0.0-beta.5":"124.0.6367.9","30.0.0-beta.6":"124.0.6367.18","30.0.0-beta.7":"124.0.6367.29","30.0.0-beta.8":"124.0.6367.29","30.0.0":"124.0.6367.49","30.0.1":"124.0.6367.60","30.0.2":"124.0.6367.91","30.0.3":"124.0.6367.119","30.0.4":"124.0.6367.201","30.0.5":"124.0.6367.207","30.0.6":"124.0.6367.207","30.0.7":"124.0.6367.221","30.0.8":"124.0.6367.230","30.0.9":"124.0.6367.233","30.1.0":"124.0.6367.243","30.1.1":"124.0.6367.243","30.1.2":"124.0.6367.243","30.2.0":"124.0.6367.243","30.3.0":"124.0.6367.243","30.3.1":"124.0.6367.243","30.4.0":"124.0.6367.243","30.5.0":"124.0.6367.243","30.5.1":"124.0.6367.243","31.0.0-alpha.1":"125.0.6412.0","31.0.0-alpha.2":"125.0.6412.0","31.0.0-alpha.3":"125.0.6412.0","31.0.0-alpha.4":"125.0.6412.0","31.0.0-alpha.5":"125.0.6412.0","31.0.0-beta.1":"126.0.6445.0","31.0.0-beta.2":"126.0.6445.0","31.0.0-beta.3":"126.0.6445.0","31.0.0-beta.4":"126.0.6445.0","31.0.0-beta.5":"126.0.6445.0","31.0.0-beta.6":"126.0.6445.0","31.0.0-beta.7":"126.0.6445.0","31.0.0-beta.8":"126.0.6445.0","31.0.0-beta.9":"126.0.6445.0","31.0.0-beta.10":"126.0.6478.36","31.0.0":"126.0.6478.36","31.0.1":"126.0.6478.36","31.0.2":"126.0.6478.61","31.1.0":"126.0.6478.114","31.2.0":"126.0.6478.127","31.2.1":"126.0.6478.127","31.3.0":"126.0.6478.183","31.3.1":"126.0.6478.185","31.4.0":"126.0.6478.234","31.5.0":"126.0.6478.234","31.6.0":"126.0.6478.234","31.7.0":"126.0.6478.234","31.7.1":"126.0.6478.234","31.7.2":"126.0.6478.234","31.7.3":"126.0.6478.234","31.7.4":"126.0.6478.234","31.7.5":"126.0.6478.234","31.7.6":"126.0.6478.234","31.7.7":"126.0.6478.234","32.0.0-alpha.1":"127.0.6521.0","32.0.0-alpha.2":"127.0.6521.0","32.0.0-alpha.3":"127.0.6521.0","32.0.0-alpha.4":"127.0.6521.0","32.0.0-alpha.5":"127.0.6521.0","32.0.0-alpha.6":"128.0.6571.0","32.0.0-alpha.7":"128.0.6571.0","32.0.0-alpha.8":"128.0.6573.0","32.0.0-alpha.9":"128.0.6573.0","32.0.0-alpha.10":"128.0.6573.0","32.0.0-beta.1":"128.0.6573.0","32.0.0-beta.2":"128.0.6611.0","32.0.0-beta.3":"128.0.6613.7","32.0.0-beta.4":"128.0.6613.18","32.0.0-beta.5":"128.0.6613.27","32.0.0-beta.6":"128.0.6613.27","32.0.0-beta.7":"128.0.6613.27","32.0.0":"128.0.6613.36","32.0.1":"128.0.6613.36","32.0.2":"128.0.6613.84","32.1.0":"128.0.6613.120","32.1.1":"128.0.6613.137","32.1.2":"128.0.6613.162","32.2.0":"128.0.6613.178","32.2.1":"128.0.6613.186","32.2.2":"128.0.6613.186","32.2.3":"128.0.6613.186","32.2.4":"128.0.6613.186","32.2.5":"128.0.6613.186","32.2.6":"128.0.6613.186","32.2.7":"128.0.6613.186","32.2.8":"128.0.6613.186","32.3.0":"128.0.6613.186","32.3.1":"128.0.6613.186","32.3.2":"128.0.6613.186","32.3.3":"128.0.6613.186","33.0.0-alpha.1":"129.0.6668.0","33.0.0-alpha.2":"130.0.6672.0","33.0.0-alpha.3":"130.0.6672.0","33.0.0-alpha.4":"130.0.6672.0","33.0.0-alpha.5":"130.0.6672.0","33.0.0-alpha.6":"130.0.6672.0","33.0.0-beta.1":"130.0.6672.0","33.0.0-beta.2":"130.0.6672.0","33.0.0-beta.3":"130.0.6672.0","33.0.0-beta.4":"130.0.6672.0","33.0.0-beta.5":"130.0.6723.19","33.0.0-beta.6":"130.0.6723.19","33.0.0-beta.7":"130.0.6723.19","33.0.0-beta.8":"130.0.6723.31","33.0.0-beta.9":"130.0.6723.31","33.0.0-beta.10":"130.0.6723.31","33.0.0-beta.11":"130.0.6723.44","33.0.0":"130.0.6723.44","33.0.1":"130.0.6723.59","33.0.2":"130.0.6723.59","33.1.0":"130.0.6723.91","33.2.0":"130.0.6723.118","33.2.1":"130.0.6723.137","33.3.0":"130.0.6723.152","33.3.1":"130.0.6723.170","33.3.2":"130.0.6723.191","33.4.0":"130.0.6723.191","33.4.1":"130.0.6723.191","33.4.2":"130.0.6723.191","33.4.3":"130.0.6723.191","33.4.4":"130.0.6723.191","33.4.5":"130.0.6723.191","33.4.6":"130.0.6723.191","33.4.7":"130.0.6723.191","33.4.8":"130.0.6723.191","33.4.9":"130.0.6723.191","33.4.10":"130.0.6723.191","33.4.11":"130.0.6723.191","34.0.0-alpha.1":"131.0.6776.0","34.0.0-alpha.2":"132.0.6779.0","34.0.0-alpha.3":"132.0.6789.1","34.0.0-alpha.4":"132.0.6789.1","34.0.0-alpha.5":"132.0.6789.1","34.0.0-alpha.6":"132.0.6789.1","34.0.0-alpha.7":"132.0.6789.1","34.0.0-alpha.8":"132.0.6820.0","34.0.0-alpha.9":"132.0.6824.0","34.0.0-beta.1":"132.0.6824.0","34.0.0-beta.2":"132.0.6824.0","34.0.0-beta.3":"132.0.6824.0","34.0.0-beta.4":"132.0.6834.6","34.0.0-beta.5":"132.0.6834.6","34.0.0-beta.6":"132.0.6834.15","34.0.0-beta.7":"132.0.6834.15","34.0.0-beta.8":"132.0.6834.15","34.0.0-beta.9":"132.0.6834.32","34.0.0-beta.10":"132.0.6834.32","34.0.0-beta.11":"132.0.6834.32","34.0.0-beta.12":"132.0.6834.46","34.0.0-beta.13":"132.0.6834.46","34.0.0-beta.14":"132.0.6834.57","34.0.0-beta.15":"132.0.6834.57","34.0.0-beta.16":"132.0.6834.57","34.0.0":"132.0.6834.83","34.0.1":"132.0.6834.83","34.0.2":"132.0.6834.159","34.1.0":"132.0.6834.194","34.1.1":"132.0.6834.194","34.2.0":"132.0.6834.196","34.3.0":"132.0.6834.210","34.3.1":"132.0.6834.210","34.3.2":"132.0.6834.210","34.3.3":"132.0.6834.210","34.3.4":"132.0.6834.210","34.4.0":"132.0.6834.210","34.4.1":"132.0.6834.210","34.5.0":"132.0.6834.210","34.5.1":"132.0.6834.210","34.5.2":"132.0.6834.210","34.5.3":"132.0.6834.210","34.5.4":"132.0.6834.210","34.5.5":"132.0.6834.210","34.5.6":"132.0.6834.210","34.5.7":"132.0.6834.210","34.5.8":"132.0.6834.210","35.0.0-alpha.1":"133.0.6920.0","35.0.0-alpha.2":"133.0.6920.0","35.0.0-alpha.3":"133.0.6920.0","35.0.0-alpha.4":"133.0.6920.0","35.0.0-alpha.5":"133.0.6920.0","35.0.0-beta.1":"133.0.6920.0","35.0.0-beta.2":"134.0.6968.0","35.0.0-beta.3":"134.0.6968.0","35.0.0-beta.4":"134.0.6968.0","35.0.0-beta.5":"134.0.6989.0","35.0.0-beta.6":"134.0.6990.0","35.0.0-beta.7":"134.0.6990.0","35.0.0-beta.8":"134.0.6998.10","35.0.0-beta.9":"134.0.6998.10","35.0.0-beta.10":"134.0.6998.23","35.0.0-beta.11":"134.0.6998.23","35.0.0-beta.12":"134.0.6998.23","35.0.0-beta.13":"134.0.6998.44","35.0.0":"134.0.6998.44","35.0.1":"134.0.6998.44","35.0.2":"134.0.6998.88","35.0.3":"134.0.6998.88","35.1.0":"134.0.6998.165","35.1.1":"134.0.6998.165","35.1.2":"134.0.6998.178","35.1.3":"134.0.6998.179","35.1.4":"134.0.6998.179","35.1.5":"134.0.6998.179","35.2.0":"134.0.6998.205","35.2.1":"134.0.6998.205","35.2.2":"134.0.6998.205","35.3.0":"134.0.6998.205","35.4.0":"134.0.6998.205","35.5.0":"134.0.6998.205","35.5.1":"134.0.6998.205","35.6.0":"134.0.6998.205","35.7.0":"134.0.6998.205","35.7.1":"134.0.6998.205","35.7.2":"134.0.6998.205","35.7.4":"134.0.6998.205","35.7.5":"134.0.6998.205","36.0.0-alpha.1":"135.0.7049.5","36.0.0-alpha.2":"136.0.7062.0","36.0.0-alpha.3":"136.0.7062.0","36.0.0-alpha.4":"136.0.7062.0","36.0.0-alpha.5":"136.0.7067.0","36.0.0-alpha.6":"136.0.7067.0","36.0.0-beta.1":"136.0.7067.0","36.0.0-beta.2":"136.0.7067.0","36.0.0-beta.3":"136.0.7067.0","36.0.0-beta.4":"136.0.7067.0","36.0.0-beta.5":"136.0.7103.17","36.0.0-beta.6":"136.0.7103.25","36.0.0-beta.7":"136.0.7103.25","36.0.0-beta.8":"136.0.7103.33","36.0.0-beta.9":"136.0.7103.33","36.0.0":"136.0.7103.48","36.0.1":"136.0.7103.48","36.1.0":"136.0.7103.49","36.2.0":"136.0.7103.49","36.2.1":"136.0.7103.93","36.3.0":"136.0.7103.113","36.3.1":"136.0.7103.113","36.3.2":"136.0.7103.115","36.4.0":"136.0.7103.149","36.5.0":"136.0.7103.168","36.6.0":"136.0.7103.177","36.7.0":"136.0.7103.177","36.7.1":"136.0.7103.177","36.7.3":"136.0.7103.177","36.7.4":"136.0.7103.177","36.8.0":"136.0.7103.177","36.8.1":"136.0.7103.177","36.9.0":"136.0.7103.177","36.9.1":"136.0.7103.177","36.9.2":"136.0.7103.177","36.9.3":"136.0.7103.177","36.9.4":"136.0.7103.177","36.9.5":"136.0.7103.177","37.0.0-alpha.1":"137.0.7151.0","37.0.0-alpha.2":"137.0.7151.0","37.0.0-alpha.3":"138.0.7156.0","37.0.0-alpha.4":"138.0.7165.0","37.0.0-alpha.5":"138.0.7177.0","37.0.0-alpha.6":"138.0.7178.0","37.0.0-alpha.7":"138.0.7178.0","37.0.0-beta.1":"138.0.7178.0","37.0.0-beta.2":"138.0.7178.0","37.0.0-beta.3":"138.0.7190.0","37.0.0-beta.4":"138.0.7204.15","37.0.0-beta.5":"138.0.7204.15","37.0.0-beta.6":"138.0.7204.15","37.0.0-beta.7":"138.0.7204.15","37.0.0-beta.8":"138.0.7204.23","37.0.0-beta.9":"138.0.7204.35","37.0.0":"138.0.7204.35","37.1.0":"138.0.7204.35","37.2.0":"138.0.7204.97","37.2.1":"138.0.7204.97","37.2.2":"138.0.7204.100","37.2.3":"138.0.7204.100","37.2.4":"138.0.7204.157","37.2.5":"138.0.7204.168","37.2.6":"138.0.7204.185","37.3.0":"138.0.7204.224","37.3.1":"138.0.7204.235","37.4.0":"138.0.7204.243","37.5.0":"138.0.7204.251","37.5.1":"138.0.7204.251","37.6.0":"138.0.7204.251","37.6.1":"138.0.7204.251","37.7.0":"138.0.7204.251","37.7.1":"138.0.7204.251","37.8.0":"138.0.7204.251","37.9.0":"138.0.7204.251","37.10.0":"138.0.7204.251","37.10.1":"138.0.7204.251","37.10.2":"138.0.7204.251","37.10.3":"138.0.7204.251","38.0.0-alpha.1":"139.0.7219.0","38.0.0-alpha.2":"139.0.7219.0","38.0.0-alpha.3":"139.0.7219.0","38.0.0-alpha.4":"140.0.7261.0","38.0.0-alpha.5":"140.0.7261.0","38.0.0-alpha.6":"140.0.7261.0","38.0.0-alpha.7":"140.0.7281.0","38.0.0-alpha.8":"140.0.7281.0","38.0.0-alpha.9":"140.0.7301.0","38.0.0-alpha.10":"140.0.7309.0","38.0.0-alpha.11":"140.0.7312.0","38.0.0-alpha.12":"140.0.7314.0","38.0.0-alpha.13":"140.0.7314.0","38.0.0-beta.1":"140.0.7314.0","38.0.0-beta.2":"140.0.7327.0","38.0.0-beta.3":"140.0.7327.0","38.0.0-beta.4":"140.0.7339.2","38.0.0-beta.5":"140.0.7339.2","38.0.0-beta.6":"140.0.7339.2","38.0.0-beta.7":"140.0.7339.16","38.0.0-beta.8":"140.0.7339.24","38.0.0-beta.9":"140.0.7339.24","38.0.0-beta.11":"140.0.7339.41","38.0.0":"140.0.7339.41","38.1.0":"140.0.7339.80","38.1.1":"140.0.7339.133","38.1.2":"140.0.7339.133","38.2.0":"140.0.7339.133","38.2.1":"140.0.7339.133","38.2.2":"140.0.7339.133","38.3.0":"140.0.7339.240","38.4.0":"140.0.7339.240","38.5.0":"140.0.7339.249","38.6.0":"140.0.7339.249","38.7.0":"140.0.7339.249","38.7.1":"140.0.7339.249","38.7.2":"140.0.7339.249","39.0.0-alpha.1":"141.0.7361.0","39.0.0-alpha.2":"141.0.7361.0","39.0.0-alpha.3":"141.0.7390.7","39.0.0-alpha.4":"141.0.7390.7","39.0.0-alpha.5":"141.0.7390.7","39.0.0-alpha.6":"142.0.7417.0","39.0.0-alpha.7":"142.0.7417.0","39.0.0-alpha.8":"142.0.7417.0","39.0.0-alpha.9":"142.0.7417.0","39.0.0-beta.1":"142.0.7417.0","39.0.0-beta.2":"142.0.7417.0","39.0.0-beta.3":"142.0.7417.0","39.0.0-beta.4":"142.0.7444.34","39.0.0-beta.5":"142.0.7444.34","39.0.0":"142.0.7444.52","39.1.0":"142.0.7444.59","39.1.1":"142.0.7444.59","39.1.2":"142.0.7444.134","39.2.0":"142.0.7444.162","39.2.1":"142.0.7444.162","39.2.2":"142.0.7444.162","39.2.3":"142.0.7444.175","39.2.4":"142.0.7444.177","39.2.5":"142.0.7444.177","39.2.6":"142.0.7444.226","40.0.0-alpha.2":"143.0.7499.0","40.0.0-alpha.4":"144.0.7506.0","40.0.0-alpha.5":"144.0.7526.0","40.0.0-alpha.6":"144.0.7526.0","40.0.0-alpha.7":"144.0.7526.0","40.0.0-alpha.8":"144.0.7526.0","40.0.0-beta.1":"144.0.7527.0","40.0.0-beta.2":"144.0.7527.0"} \ No newline at end of file diff --git a/node_modules/electron-to-chromium/index.js b/node_modules/electron-to-chromium/index.js new file mode 100644 index 0000000..1818281 --- /dev/null +++ b/node_modules/electron-to-chromium/index.js @@ -0,0 +1,36 @@ +var versions = require('./versions'); +var fullVersions = require('./full-versions'); +var chromiumVersions = require('./chromium-versions'); +var fullChromiumVersions = require('./full-chromium-versions'); + +var electronToChromium = function (query) { + var number = getQueryString(query); + return number.split('.').length > 2 ? fullVersions[number] : versions[number] || undefined; +}; + +var chromiumToElectron = function (query) { + var number = getQueryString(query); + return number.split('.').length > 2 ? fullChromiumVersions[number] : chromiumVersions[number] || undefined; +}; + +var electronToBrowserList = function (query) { + var number = getQueryString(query); + return versions[number] ? "Chrome >= " + versions[number] : undefined; +}; + +var getQueryString = function (query) { + var number = query; + if (query === 1) { number = "1.0" } + if (typeof query === 'number') { number += ''; } + return number; +}; + +module.exports = { + versions: versions, + fullVersions: fullVersions, + chromiumVersions: chromiumVersions, + fullChromiumVersions: fullChromiumVersions, + electronToChromium: electronToChromium, + electronToBrowserList: electronToBrowserList, + chromiumToElectron: chromiumToElectron +}; diff --git a/node_modules/electron-to-chromium/package.json b/node_modules/electron-to-chromium/package.json new file mode 100644 index 0000000..3f53cf7 --- /dev/null +++ b/node_modules/electron-to-chromium/package.json @@ -0,0 +1,44 @@ +{ + "name": "electron-to-chromium", + "version": "1.5.266", + "description": "Provides a list of electron-to-chromium version mappings", + "main": "index.js", + "files": [ + "versions.js", + "full-versions.js", + "chromium-versions.js", + "full-chromium-versions.js", + "versions.json", + "full-versions.json", + "chromium-versions.json", + "full-chromium-versions.json", + "LICENSE" + ], + "scripts": { + "build": "node build.mjs", + "update": "node automated-update.js", + "test": "nyc ava --verbose", + "report": "nyc report --reporter=text-lcov > coverage.lcov && codecov" + }, + "repository": { + "type": "git", + "url": "https://github.com/kilian/electron-to-chromium/" + }, + "keywords": [ + "electron", + "chrome", + "chromium", + "browserslist", + "browserlist" + ], + "author": "Kilian Valkhof", + "license": "ISC", + "devDependencies": { + "ava": "^5.1.1", + "codecov": "^3.8.2", + "compare-versions": "^6.0.0-rc.1", + "node-fetch": "^3.3.0", + "nyc": "^15.1.0", + "shelljs": "^0.8.5" + } +} diff --git a/node_modules/electron-to-chromium/versions.js b/node_modules/electron-to-chromium/versions.js new file mode 100644 index 0000000..9313b3d --- /dev/null +++ b/node_modules/electron-to-chromium/versions.js @@ -0,0 +1,224 @@ +module.exports = { + "0.20": "39", + "0.21": "41", + "0.22": "41", + "0.23": "41", + "0.24": "41", + "0.25": "42", + "0.26": "42", + "0.27": "43", + "0.28": "43", + "0.29": "43", + "0.30": "44", + "0.31": "45", + "0.32": "45", + "0.33": "45", + "0.34": "45", + "0.35": "45", + "0.36": "47", + "0.37": "49", + "1.0": "49", + "1.1": "50", + "1.2": "51", + "1.3": "52", + "1.4": "53", + "1.5": "54", + "1.6": "56", + "1.7": "58", + "1.8": "59", + "2.0": "61", + "2.1": "61", + "3.0": "66", + "3.1": "66", + "4.0": "69", + "4.1": "69", + "4.2": "69", + "5.0": "73", + "6.0": "76", + "6.1": "76", + "7.0": "78", + "7.1": "78", + "7.2": "78", + "7.3": "78", + "8.0": "80", + "8.1": "80", + "8.2": "80", + "8.3": "80", + "8.4": "80", + "8.5": "80", + "9.0": "83", + "9.1": "83", + "9.2": "83", + "9.3": "83", + "9.4": "83", + "10.0": "85", + "10.1": "85", + "10.2": "85", + "10.3": "85", + "10.4": "85", + "11.0": "87", + "11.1": "87", + "11.2": "87", + "11.3": "87", + "11.4": "87", + "11.5": "87", + "12.0": "89", + "12.1": "89", + "12.2": "89", + "13.0": "91", + "13.1": "91", + "13.2": "91", + "13.3": "91", + "13.4": "91", + "13.5": "91", + "13.6": "91", + "14.0": "93", + "14.1": "93", + "14.2": "93", + "15.0": "94", + "15.1": "94", + "15.2": "94", + "15.3": "94", + "15.4": "94", + "15.5": "94", + "16.0": "96", + "16.1": "96", + "16.2": "96", + "17.0": "98", + "17.1": "98", + "17.2": "98", + "17.3": "98", + "17.4": "98", + "18.0": "100", + "18.1": "100", + "18.2": "100", + "18.3": "100", + "19.0": "102", + "19.1": "102", + "20.0": "104", + "20.1": "104", + "20.2": "104", + "20.3": "104", + "21.0": "106", + "21.1": "106", + "21.2": "106", + "21.3": "106", + "21.4": "106", + "22.0": "108", + "22.1": "108", + "22.2": "108", + "22.3": "108", + "23.0": "110", + "23.1": "110", + "23.2": "110", + "23.3": "110", + "24.0": "112", + "24.1": "112", + "24.2": "112", + "24.3": "112", + "24.4": "112", + "24.5": "112", + "24.6": "112", + "24.7": "112", + "24.8": "112", + "25.0": "114", + "25.1": "114", + "25.2": "114", + "25.3": "114", + "25.4": "114", + "25.5": "114", + "25.6": "114", + "25.7": "114", + "25.8": "114", + "25.9": "114", + "26.0": "116", + "26.1": "116", + "26.2": "116", + "26.3": "116", + "26.4": "116", + "26.5": "116", + "26.6": "116", + "27.0": "118", + "27.1": "118", + "27.2": "118", + "27.3": "118", + "28.0": "120", + "28.1": "120", + "28.2": "120", + "28.3": "120", + "29.0": "122", + "29.1": "122", + "29.2": "122", + "29.3": "122", + "29.4": "122", + "30.0": "124", + "30.1": "124", + "30.2": "124", + "30.3": "124", + "30.4": "124", + "30.5": "124", + "31.0": "126", + "31.1": "126", + "31.2": "126", + "31.3": "126", + "31.4": "126", + "31.5": "126", + "31.6": "126", + "31.7": "126", + "32.0": "128", + "32.1": "128", + "32.2": "128", + "32.3": "128", + "33.0": "130", + "33.1": "130", + "33.2": "130", + "33.3": "130", + "33.4": "130", + "34.0": "132", + "34.1": "132", + "34.2": "132", + "34.3": "132", + "34.4": "132", + "34.5": "132", + "35.0": "134", + "35.1": "134", + "35.2": "134", + "35.3": "134", + "35.4": "134", + "35.5": "134", + "35.6": "134", + "35.7": "134", + "36.0": "136", + "36.1": "136", + "36.2": "136", + "36.3": "136", + "36.4": "136", + "36.5": "136", + "36.6": "136", + "36.7": "136", + "36.8": "136", + "36.9": "136", + "37.0": "138", + "37.1": "138", + "37.2": "138", + "37.3": "138", + "37.4": "138", + "37.5": "138", + "37.6": "138", + "37.7": "138", + "37.8": "138", + "37.9": "138", + "37.10": "138", + "38.0": "140", + "38.1": "140", + "38.2": "140", + "38.3": "140", + "38.4": "140", + "38.5": "140", + "38.6": "140", + "38.7": "140", + "39.0": "142", + "39.1": "142", + "39.2": "142", + "40.0": "144" +}; \ No newline at end of file diff --git a/node_modules/electron-to-chromium/versions.json b/node_modules/electron-to-chromium/versions.json new file mode 100644 index 0000000..56b2421 --- /dev/null +++ b/node_modules/electron-to-chromium/versions.json @@ -0,0 +1 @@ +{"0.20":"39","0.21":"41","0.22":"41","0.23":"41","0.24":"41","0.25":"42","0.26":"42","0.27":"43","0.28":"43","0.29":"43","0.30":"44","0.31":"45","0.32":"45","0.33":"45","0.34":"45","0.35":"45","0.36":"47","0.37":"49","1.0":"49","1.1":"50","1.2":"51","1.3":"52","1.4":"53","1.5":"54","1.6":"56","1.7":"58","1.8":"59","2.0":"61","2.1":"61","3.0":"66","3.1":"66","4.0":"69","4.1":"69","4.2":"69","5.0":"73","6.0":"76","6.1":"76","7.0":"78","7.1":"78","7.2":"78","7.3":"78","8.0":"80","8.1":"80","8.2":"80","8.3":"80","8.4":"80","8.5":"80","9.0":"83","9.1":"83","9.2":"83","9.3":"83","9.4":"83","10.0":"85","10.1":"85","10.2":"85","10.3":"85","10.4":"85","11.0":"87","11.1":"87","11.2":"87","11.3":"87","11.4":"87","11.5":"87","12.0":"89","12.1":"89","12.2":"89","13.0":"91","13.1":"91","13.2":"91","13.3":"91","13.4":"91","13.5":"91","13.6":"91","14.0":"93","14.1":"93","14.2":"93","15.0":"94","15.1":"94","15.2":"94","15.3":"94","15.4":"94","15.5":"94","16.0":"96","16.1":"96","16.2":"96","17.0":"98","17.1":"98","17.2":"98","17.3":"98","17.4":"98","18.0":"100","18.1":"100","18.2":"100","18.3":"100","19.0":"102","19.1":"102","20.0":"104","20.1":"104","20.2":"104","20.3":"104","21.0":"106","21.1":"106","21.2":"106","21.3":"106","21.4":"106","22.0":"108","22.1":"108","22.2":"108","22.3":"108","23.0":"110","23.1":"110","23.2":"110","23.3":"110","24.0":"112","24.1":"112","24.2":"112","24.3":"112","24.4":"112","24.5":"112","24.6":"112","24.7":"112","24.8":"112","25.0":"114","25.1":"114","25.2":"114","25.3":"114","25.4":"114","25.5":"114","25.6":"114","25.7":"114","25.8":"114","25.9":"114","26.0":"116","26.1":"116","26.2":"116","26.3":"116","26.4":"116","26.5":"116","26.6":"116","27.0":"118","27.1":"118","27.2":"118","27.3":"118","28.0":"120","28.1":"120","28.2":"120","28.3":"120","29.0":"122","29.1":"122","29.2":"122","29.3":"122","29.4":"122","30.0":"124","30.1":"124","30.2":"124","30.3":"124","30.4":"124","30.5":"124","31.0":"126","31.1":"126","31.2":"126","31.3":"126","31.4":"126","31.5":"126","31.6":"126","31.7":"126","32.0":"128","32.1":"128","32.2":"128","32.3":"128","33.0":"130","33.1":"130","33.2":"130","33.3":"130","33.4":"130","34.0":"132","34.1":"132","34.2":"132","34.3":"132","34.4":"132","34.5":"132","35.0":"134","35.1":"134","35.2":"134","35.3":"134","35.4":"134","35.5":"134","35.6":"134","35.7":"134","36.0":"136","36.1":"136","36.2":"136","36.3":"136","36.4":"136","36.5":"136","36.6":"136","36.7":"136","36.8":"136","36.9":"136","37.0":"138","37.1":"138","37.2":"138","37.3":"138","37.4":"138","37.5":"138","37.6":"138","37.7":"138","37.8":"138","37.9":"138","37.10":"138","38.0":"140","38.1":"140","38.2":"140","38.3":"140","38.4":"140","38.5":"140","38.6":"140","38.7":"140","39.0":"142","39.1":"142","39.2":"142","40.0":"144"} \ No newline at end of file diff --git a/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/emoji-regex/README.md b/node_modules/emoji-regex/README.md new file mode 100644 index 0000000..6d63082 --- /dev/null +++ b/node_modules/emoji-regex/README.md @@ -0,0 +1,137 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=main)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols and sequences (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [Unicode data](https://github.com/node-unicode/node-unicode-data). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex/RGI_Emoji.js'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +## Regular expression flavors + +The package comes with three distinct regular expressions: + +```js +// This is the recommended regular expression to use. It matches all +// emoji recommended for general interchange, as defined via the +// `RGI_Emoji` property in the Unicode Standard. +// https://unicode.org/reports/tr51/#def_rgi_set +// When in doubt, use this! +const emojiRegexRGI = require('emoji-regex/RGI_Emoji.js'); + +// This is the old regular expression, prior to `RGI_Emoji` being +// standardized. In addition to all `RGI_Emoji` sequences, it matches +// some emoji you probably don’t want to match (such as emoji component +// symbols that are not meant to be used separately). +const emojiRegex = require('emoji-regex/index.js'); + +// This regular expression matches even more emoji than the previous +// one, including emoji that render as text instead of icons (i.e. +// emoji that are not `Emoji_Presentation` symbols and that aren’t +// forced to render as emoji by a variation selector). +const emojiRegexText = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegexRGI = require('emoji-regex/es2015/RGI_Emoji.js'); +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## For maintainers + +### How to update emoji-regex after new Unicode Standard releases + +1. Update the Unicode data dependency in `package.json` by running the following commands: + + ```sh + # Example: updating from Unicode v12 to Unicode v13. + npm uninstall @unicode/unicode-12.0.0 + npm install @unicode/unicode-13.0.0 --save-dev + ```` + +1. Generate the new output: + + ```sh + npm run build + ``` + +1. Verify that tests still pass: + + ```sh + npm test + ``` + +1. Send a pull request with the changes, and get it reviewed & merged. + +1. On the `main` branch, bump the emoji-regex version number in `package.json`: + + ```sh + npm version patch -m 'Release v%s' + ``` + + Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/). + + Note that this produces a Git commit + tag. + +1. Push the release commit and tag: + + ```sh + git push + ``` + + Our CI then automatically publishes the new release to npm. + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/emoji-regex/RGI_Emoji.d.ts b/node_modules/emoji-regex/RGI_Emoji.d.ts new file mode 100644 index 0000000..89a651f --- /dev/null +++ b/node_modules/emoji-regex/RGI_Emoji.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex/RGI_Emoji' { + function emojiRegex(): RegExp; + + export = emojiRegex; +} diff --git a/node_modules/emoji-regex/RGI_Emoji.js b/node_modules/emoji-regex/RGI_Emoji.js new file mode 100644 index 0000000..3fbe924 --- /dev/null +++ b/node_modules/emoji-regex/RGI_Emoji.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uD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D83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\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D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]/g; +}; diff --git a/node_modules/emoji-regex/es2015/RGI_Emoji.d.ts b/node_modules/emoji-regex/es2015/RGI_Emoji.d.ts new file mode 100644 index 0000000..bf0f154 --- /dev/null +++ b/node_modules/emoji-regex/es2015/RGI_Emoji.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex/es2015/RGI_Emoji' { + function emojiRegex(): RegExp; + + export = emojiRegex; +} diff --git a/node_modules/emoji-regex/es2015/RGI_Emoji.js b/node_modules/emoji-regex/es2015/RGI_Emoji.js new file mode 100644 index 0000000..ecf32f1 --- /dev/null +++ b/node_modules/emoji-regex/es2015/RGI_Emoji.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074}|\u{E0065}\u{E006E}\u{E0067})\u{E007F}|(?:\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FC}-\u{1F3FF}]|\u{1F468}(?:\u{1F3FB}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FF}]|\u{1F468}[\u{1F3FB}-\u{1F3FF}])|\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]))?|[\u{1F3FC}-\u{1F3FF}]\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FF}]|\u{1F468}[\u{1F3FB}-\u{1F3FF}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}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\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|\u{1F3FF}|\u{1F3FE}|\u{1F3FD}|\u{1F3FC})?|(?:\u{1F469}(?:\u{1F3FB}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F3FC}-\u{1F3FF}]\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}]))|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]\u200D\u{1F91D}\u200D\u{1F9D1})[\u{1F3FB}-\u{1F3FF}]|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F469}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FE}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{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\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FD}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F384}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FC}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F384}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F384}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F9D1}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\u{1F636}\u200D\u{1F32B}|\u{1F3F3}\uFE0F\u200D\u26A7|\u{1F43B}\u200D\u2744|(?:[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\uFE0F\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u{1F3F4}\u200D\u2620|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}]\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F202}\u{1F237}\u{1F321}\u{1F324}-\u{1F32C}\u{1F336}\u{1F37D}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}\u{1F39F}\u{1F3CD}\u{1F3CE}\u{1F3D4}-\u{1F3DF}\u{1F3F5}\u{1F3F7}\u{1F43F}\u{1F4FD}\u{1F549}\u{1F54A}\u{1F56F}\u{1F570}\u{1F573}\u{1F576}-\u{1F579}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}\u{1F6CB}\u{1F6CD}-\u{1F6CF}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6F0}\u{1F6F3}])\uFE0F|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}\u200D\u{1F466}|\u{1F635}\u200D\u{1F4AB}|\u{1F62E}\u200D\u{1F4A8}|\u{1F415}\u200D\u{1F9BA}|\u{1F9D1}(?:\u{1F3FF}|\u{1F3FE}|\u{1F3FD}|\u{1F3FC}|\u{1F3FB})?|\u{1F469}(?:\u{1F3FF}|\u{1F3FE}|\u{1F3FD}|\u{1F3FC}|\u{1F3FB})?|\u{1F1FD}\u{1F1F0}|\u{1F1F6}\u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\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\uFE0F\u{1F3FB}-\u{1F3FF}]|\u{1F3F4}|[\u270A\u270B\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F57A}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90C}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F934}\u{1F936}\u{1F977}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}\u{1F9D3}\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270C\u270D\u{1F574}\u{1F590}][\uFE0F\u{1F3FB}-\u{1F3FF}]|[\u270A\u270B\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F408}\u{1F415}\u{1F43B}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F57A}\u{1F595}\u{1F596}\u{1F62E}\u{1F635}\u{1F636}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90C}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F934}\u{1F936}\u{1F977}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}\u{1F9D3}\u{1F9D5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}]|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F384}\u{1F386}-\u{1F393}\u{1F3A0}-\u{1F3C1}\u{1F3C5}\u{1F3C6}\u{1F3C8}\u{1F3C9}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F8}-\u{1F407}\u{1F409}-\u{1F414}\u{1F416}-\u{1F43A}\u{1F43C}-\u{1F43E}\u{1F440}\u{1F444}\u{1F445}\u{1F451}-\u{1F465}\u{1F46A}\u{1F479}-\u{1F47B}\u{1F47D}-\u{1F480}\u{1F484}\u{1F488}-\u{1F48E}\u{1F490}\u{1F492}-\u{1F4A9}\u{1F4AB}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F5A4}\u{1F5FB}-\u{1F62D}\u{1F62F}-\u{1F634}\u{1F637}-\u{1F644}\u{1F648}-\u{1F64A}\u{1F680}-\u{1F6A2}\u{1F6A4}-\u{1F6B3}\u{1F6B7}-\u{1F6BF}\u{1F6C1}-\u{1F6C5}\u{1F6D0}-\u{1F6D2}\u{1F6D5}-\u{1F6D7}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FC}\u{1F7E0}-\u{1F7EB}\u{1F90D}\u{1F90E}\u{1F910}-\u{1F917}\u{1F91D}\u{1F920}-\u{1F925}\u{1F927}-\u{1F92F}\u{1F93A}\u{1F93F}-\u{1F945}\u{1F947}-\u{1F976}\u{1F978}\u{1F97A}-\u{1F9B4}\u{1F9B7}\u{1F9BA}\u{1F9BC}-\u{1F9CB}\u{1F9D0}\u{1F9E0}-\u{1F9FF}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAA8}\u{1FAB0}-\u{1FAB6}\u{1FAC0}-\u{1FAC2}\u{1FAD0}-\u{1FAD6}]/gu; +}; diff --git a/node_modules/emoji-regex/es2015/index.d.ts b/node_modules/emoji-regex/es2015/index.d.ts new file mode 100644 index 0000000..823dfa6 --- /dev/null +++ b/node_modules/emoji-regex/es2015/index.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex/es2015' { + function emojiRegex(): RegExp; + + export = emojiRegex; +} diff --git a/node_modules/emoji-regex/es2015/index.js b/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 0000000..1a4fc8d --- /dev/null +++ b/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074}|\u{E0065}\u{E006E}\u{E0067})\u{E007F}|(?:\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FC}-\u{1F3FF}]|\u{1F468}(?:\u{1F3FB}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FF}]|\u{1F468}[\u{1F3FB}-\u{1F3FF}])|\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]))?|[\u{1F3FC}-\u{1F3FF}]\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FF}]|\u{1F468}[\u{1F3FB}-\u{1F3FF}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|\u{1F3FF}|\u{1F3FE}|\u{1F3FD}|\u{1F3FC})?|(?:\u{1F469}(?:\u{1F3FB}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F3FC}-\u{1F3FF}]\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}]))|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]\u200D\u{1F91D}\u200D\u{1F9D1})[\u{1F3FB}-\u{1F3FF}]|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F469}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F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469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F9D1}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\u{1F636}\u200D\u{1F32B}|\u{1F3F3}\uFE0F\u200D\u26A7|\u{1F43B}\u200D\u2744|(?:[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\uFE0F\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u{1F3F4}\u200D\u2620|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}]\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F202}\u{1F237}\u{1F321}\u{1F324}-\u{1F32C}\u{1F336}\u{1F37D}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}\u{1F39F}\u{1F3CD}\u{1F3CE}\u{1F3D4}-\u{1F3DF}\u{1F3F5}\u{1F3F7}\u{1F43F}\u{1F4FD}\u{1F549}\u{1F54A}\u{1F56F}\u{1F570}\u{1F573}\u{1F576}-\u{1F579}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F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1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270C\u270D\u{1F574}\u{1F590}][\uFE0F\u{1F3FB}-\u{1F3FF}]|[\u270A\u270B\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F408}\u{1F415}\u{1F43B}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F57A}\u{1F595}\u{1F596}\u{1F62E}\u{1F635}\u{1F636}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90C}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F934}\u{1F936}\u{1F977}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}\u{1F9D3}\u{1F9D5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}]|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F384}\u{1F386}-\u{1F393}\u{1F3A0}-\u{1F3C1}\u{1F3C5}\u{1F3C6}\u{1F3C8}\u{1F3C9}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F8}-\u{1F407}\u{1F409}-\u{1F414}\u{1F416}-\u{1F43A}\u{1F43C}-\u{1F43E}\u{1F440}\u{1F444}\u{1F445}\u{1F451}-\u{1F465}\u{1F46A}\u{1F479}-\u{1F47B}\u{1F47D}-\u{1F480}\u{1F484}\u{1F488}-\u{1F48E}\u{1F490}\u{1F492}-\u{1F4A9}\u{1F4AB}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F5A4}\u{1F5FB}-\u{1F62D}\u{1F62F}-\u{1F634}\u{1F637}-\u{1F644}\u{1F648}-\u{1F64A}\u{1F680}-\u{1F6A2}\u{1F6A4}-\u{1F6B3}\u{1F6B7}-\u{1F6BF}\u{1F6C1}-\u{1F6C5}\u{1F6D0}-\u{1F6D2}\u{1F6D5}-\u{1F6D7}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FC}\u{1F7E0}-\u{1F7EB}\u{1F90D}\u{1F90E}\u{1F910}-\u{1F917}\u{1F91D}\u{1F920}-\u{1F925}\u{1F927}-\u{1F92F}\u{1F93A}\u{1F93F}-\u{1F945}\u{1F947}-\u{1F976}\u{1F978}\u{1F97A}-\u{1F9B4}\u{1F9B7}\u{1F9BA}\u{1F9BC}-\u{1F9CB}\u{1F9D0}\u{1F9E0}-\u{1F9FF}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAA8}\u{1FAB0}-\u{1FAB6}\u{1FAC0}-\u{1FAC2}\u{1FAD0}-\u{1FAD6}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}-\u{1F6D7}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FC}\u{1F7E0}-\u{1F7EB}\u{1F90C}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F978}\u{1F97A}-\u{1F9CB}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAA8}\u{1FAB0}-\u{1FAB6}\u{1FAC0}-\u{1FAC2}\u{1FAD0}-\u{1FAD6}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}-\u{1F6D7}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FC}\u{1F7E0}-\u{1F7EB}\u{1F90C}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F978}\u{1F97A}-\u{1F9CB}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAA8}\u{1FAB0}-\u{1FAB6}\u{1FAC0}-\u{1FAC2}\u{1FAD0}-\u{1FAD6}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90C}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F977}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/emoji-regex/es2015/text.d.ts b/node_modules/emoji-regex/es2015/text.d.ts new file mode 100644 index 0000000..ccc2f9a --- /dev/null +++ b/node_modules/emoji-regex/es2015/text.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex/es2015/text' { + function emojiRegex(): RegExp; + + export = emojiRegex; +} diff --git a/node_modules/emoji-regex/es2015/text.js b/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 0000000..8e9f985 --- /dev/null +++ b/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074}|\u{E0065}\u{E006E}\u{E0067})\u{E007F}|(?:\u{1F9D1}\u{1F3FF}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FE}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FD}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|(?:\u{1F9D1}\u{1F3FB}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F9D1}|\u{1F469}\u{1F3FB}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FC}-\u{1F3FF}]|\u{1F468}(?:\u{1F3FB}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FF}]|\u{1F468}[\u{1F3FB}-\u{1F3FF}])|\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]))?|[\u{1F3FC}-\u{1F3FF}]\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FF}]|\u{1F468}[\u{1F3FB}-\u{1F3FF}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|\u{1F3FF}|\u{1F3FE}|\u{1F3FD}|\u{1F3FC})?|(?:\u{1F469}(?:\u{1F3FB}\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F3FC}-\u{1F3FF}]\u200D\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}]))|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]\u200D\u{1F91D}\u200D\u{1F9D1})[\u{1F3FB}-\u{1F3FF}]|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F469}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FE}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FD}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FC}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u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4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F37C}\u{1F384}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F9D1}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\u{1F636}\u200D\u{1F32B}|\u{1F3F3}\uFE0F\u200D\u26A7|\u{1F43B}\u200D\u2744|(?:[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\uFE0F\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u{1F3F4}\u200D\u2620|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}]\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F202}\u{1F237}\u{1F321}\u{1F324}-\u{1F32C}\u{1F336}\u{1F37D}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}\u{1F39F}\u{1F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}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F57A}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90C}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F934}\u{1F936}\u{1F977}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}\u{1F9D3}\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270C\u270D\u{1F574}\u{1F590}][\uFE0F\u{1F3FB}-\u{1F3FF}]|[\u270A\u270B\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F408}\u{1F415}\u{1F43B}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F57A}\u{1F595}\u{1F596}\u{1F62E}\u{1F635}\u{1F636}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90C}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F934}\u{1F936}\u{1F977}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}\u{1F9D3}\u{1F9D5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F470}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F935}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D4}\u{1F9D6}-\u{1F9DD}]|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F384}\u{1F386}-\u{1F393}\u{1F3A0}-\u{1F3C1}\u{1F3C5}\u{1F3C6}\u{1F3C8}\u{1F3C9}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F8}-\u{1F407}\u{1F409}-\u{1F414}\u{1F416}-\u{1F43A}\u{1F43C}-\u{1F43E}\u{1F440}\u{1F444}\u{1F445}\u{1F451}-\u{1F465}\u{1F46A}\u{1F479}-\u{1F47B}\u{1F47D}-\u{1F480}\u{1F484}\u{1F488}-\u{1F48E}\u{1F490}\u{1F492}-\u{1F4A9}\u{1F4AB}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F5A4}\u{1F5FB}-\u{1F62D}\u{1F62F}-\u{1F634}\u{1F637}-\u{1F644}\u{1F648}-\u{1F64A}\u{1F680}-\u{1F6A2}\u{1F6A4}-\u{1F6B3}\u{1F6B7}-\u{1F6BF}\u{1F6C1}-\u{1F6C5}\u{1F6D0}-\u{1F6D2}\u{1F6D5}-\u{1F6D7}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FC}\u{1F7E0}-\u{1F7EB}\u{1F90D}\u{1F90E}\u{1F910}-\u{1F917}\u{1F91D}\u{1F920}-\u{1F925}\u{1F927}-\u{1F92F}\u{1F93A}\u{1F93F}-\u{1F945}\u{1F947}-\u{1F976}\u{1F978}\u{1F97A}-\u{1F9B4}\u{1F9B7}\u{1F9BA}\u{1F9BC}-\u{1F9CB}\u{1F9D0}\u{1F9E0}-\u{1F9FF}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAA8}\u{1FAB0}-\u{1FAB6}\u{1FAC0}-\u{1FAC2}\u{1FAD0}-\u{1FAD6}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}-\u{1F6D7}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FC}\u{1F7E0}-\u{1F7EB}\u{1F90C}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F978}\u{1F97A}-\u{1F9CB}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAA8}\u{1FAB0}-\u{1FAB6}\u{1FAC0}-\u{1FAC2}\u{1FAD0}-\u{1FAD6}]\uFE0F?/gu; +}; diff --git a/node_modules/emoji-regex/index.d.ts b/node_modules/emoji-regex/index.d.ts new file mode 100644 index 0000000..8f235c9 --- /dev/null +++ b/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export = emojiRegex; +} diff --git a/node_modules/emoji-regex/index.js b/node_modules/emoji-regex/index.js new file mode 100644 index 0000000..c0490d4 --- /dev/null +++ b/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\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DBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u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CA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/emoji-regex/package.json b/node_modules/emoji-regex/package.json new file mode 100644 index 0000000..eac892a --- /dev/null +++ b/node_modules/emoji-regex/package.json @@ -0,0 +1,52 @@ +{ + "name": "emoji-regex", + "version": "9.2.2", + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/emoji-regex.git" + }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "RGI_Emoji.js", + "RGI_Emoji.d.ts", + "text.js", + "text.d.ts", + "es2015" + ], + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src es2015_types -D -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "devDependencies": { + "@babel/cli": "^7.4.4", + "@babel/core": "^7.4.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/preset-env": "^7.4.4", + "@unicode/unicode-13.0.0": "^1.0.3", + "mocha": "^6.1.4", + "regexgen": "^1.3.0" + } +} diff --git a/node_modules/emoji-regex/text.d.ts b/node_modules/emoji-regex/text.d.ts new file mode 100644 index 0000000..c3a0125 --- /dev/null +++ b/node_modules/emoji-regex/text.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex/text' { + function emojiRegex(): RegExp; + + export = emojiRegex; +} diff --git a/node_modules/emoji-regex/text.js b/node_modules/emoji-regex/text.js new file mode 100644 index 0000000..9bc63ce --- /dev/null +++ b/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC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\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\u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\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F?/g; +}; diff --git a/node_modules/encodeurl/LICENSE b/node_modules/encodeurl/LICENSE new file mode 100644 index 0000000..8812229 --- /dev/null +++ b/node_modules/encodeurl/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/encodeurl/README.md b/node_modules/encodeurl/README.md new file mode 100644 index 0000000..3842493 --- /dev/null +++ b/node_modules/encodeurl/README.md @@ -0,0 +1,109 @@ +# Encode URL + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +## Installation + +```sh +npm install encodeurl +``` + +## API + +```js +var encodeUrl = require('encodeurl') +``` + +### encodeUrl(url) + +Encode a URL to a percent-encoded form, excluding already-encoded sequences. + +This function accepts a URL and encodes all the non-URL code points (as UTF-8 byte sequences). It will not encode the "%" character unless it is not part of a valid sequence (`%20` will be left as-is, but `%foo` will be encoded as `%25foo`). + +This encode is meant to be "safe" and does not throw errors. It will try as hard as it can to properly encode the given URL, including replacing any raw, unpaired surrogate pairs with the Unicode replacement character prior to encoding. + +## Examples + +### Encode a URL containing user-controlled data + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') + +http.createServer(function onRequest (req, res) { + // get encoded form of inbound url + var url = encodeUrl(req.url) + + // create html message + var body = '

Location ' + escapeHtml(url) + ' not found

' + + // send a 404 + res.statusCode = 404 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.end(body, 'utf-8') +}) +``` + +### Encode a URL for use in a header field + +```js +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var url = require('url') + +http.createServer(function onRequest (req, res) { + // parse inbound url + var href = url.parse(req) + + // set new host for redirect + href.host = 'localhost' + href.protocol = 'https:' + href.slashes = true + + // create location header + var location = encodeUrl(url.format(href)) + + // create html message + var body = '

Redirecting to new site: ' + escapeHtml(location) + '

' + + // send a 301 + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) + res.setHeader('Location', location) + res.end(body, 'utf-8') +}) +``` + +## Similarities + +This function is _similar_ to the intrinsic function `encodeURI`. However, it will not encode: + +* The `\`, `^`, or `|` characters +* The `%` character when it's part of a valid sequence +* `[` and `]` (for IPv6 hostnames) +* Replaces raw, unpaired surrogate pairs with the Unicode replacement character + +As a result, the encoding aligns closely with the behavior in the [WHATWG URL specification][whatwg-url]. However, this package only encodes strings and does not do any URL parsing or formatting. + +It is expected that any output from `new URL(url)` will not change when used with this package, as the output has already been encoded. Additionally, if we were to encode before `new URL(url)`, we do not expect the before and after encoded formats to be parsed any differently. + +## Testing + +```sh +$ npm test +$ npm run lint +``` + +## References + +- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] +- [WHATWG URL Living Standard][whatwg-url] + +[rfc-3986]: https://tools.ietf.org/html/rfc3986 +[whatwg-url]: https://url.spec.whatwg.org/ + +## License + +[MIT](LICENSE) diff --git a/node_modules/encodeurl/index.js b/node_modules/encodeurl/index.js new file mode 100644 index 0000000..a49ee5a --- /dev/null +++ b/node_modules/encodeurl/index.js @@ -0,0 +1,60 @@ +/*! + * encodeurl + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = encodeUrl + +/** + * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") + * and including invalid escape sequences. + * @private + */ + +var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g + +/** + * RegExp to match unmatched surrogate pair. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g + +/** + * String to replace unmatched surrogate pair with. + * @private + */ + +var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' + +/** + * Encode a URL to a percent-encoded form, excluding already-encoded sequences. + * + * This function will take an already-encoded URL and encode all the non-URL + * code points. This function will not encode the "%" character unless it is + * not part of a valid sequence (`%20` will be left as-is, but `%foo` will + * be encoded as `%25foo`). + * + * This encode is meant to be "safe" and does not throw errors. It will try as + * hard as it can to properly encode the given URL, including replacing any raw, + * unpaired surrogate pairs with the Unicode replacement character prior to + * encoding. + * + * @param {string} url + * @return {string} + * @public + */ + +function encodeUrl (url) { + return String(url) + .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) + .replace(ENCODE_CHARS_REGEXP, encodeURI) +} diff --git a/node_modules/encodeurl/package.json b/node_modules/encodeurl/package.json new file mode 100644 index 0000000..3133822 --- /dev/null +++ b/node_modules/encodeurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "encodeurl", + "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", + "version": "2.0.0", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "encode", + "encodeurl", + "url" + ], + "repository": "pillarjs/encodeurl", + "devDependencies": { + "eslint": "5.11.1", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.14.0", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.0.1", + "eslint-plugin-standard": "4.0.0", + "istanbul": "0.4.5", + "mocha": "2.5.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/node_modules/end-of-stream/LICENSE b/node_modules/end-of-stream/LICENSE new file mode 100644 index 0000000..757562e --- /dev/null +++ b/node_modules/end-of-stream/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/end-of-stream/README.md b/node_modules/end-of-stream/README.md new file mode 100644 index 0000000..857b14b --- /dev/null +++ b/node_modules/end-of-stream/README.md @@ -0,0 +1,54 @@ +# end-of-stream + +A node module that calls a callback when a readable/writable/duplex stream has completed or failed. + + npm install end-of-stream + +[![Build status](https://travis-ci.org/mafintosh/end-of-stream.svg?branch=master)](https://travis-ci.org/mafintosh/end-of-stream) + +## Usage + +Simply pass a stream and a callback to the `eos`. +Both legacy streams, streams2 and stream3 are supported. + +``` js +var eos = require('end-of-stream'); + +eos(readableStream, function(err) { + // this will be set to the stream instance + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended', this === readableStream); +}); + +eos(writableStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished', this === writableStream); +}); + +eos(duplexStream, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended and finished', this === duplexStream); +}); + +eos(duplexStream, {readable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has finished but might still be readable'); +}); + +eos(duplexStream, {writable:false}, function(err) { + if (err) return console.log('stream had an error or closed early'); + console.log('stream has ended but might still be writable'); +}); + +eos(readableStream, {error:false}, function(err) { + // do not treat emit('error', err) as a end-of-stream +}); +``` + +## License + +MIT + +## Related + +`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/node_modules/end-of-stream/index.js b/node_modules/end-of-stream/index.js new file mode 100644 index 0000000..7ce47e9 --- /dev/null +++ b/node_modules/end-of-stream/index.js @@ -0,0 +1,96 @@ +var once = require('once'); + +var noop = function() {}; + +var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process); + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; + + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; + + var onerror = function(err) { + callback.call(stream, err); + }; + + var onclose = function() { + qnt(onclosenexttick); + }; + + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; + + var onrequest = function() { + stream.req.on('finish', onfinish); + }; + + if (isRequest(stream)) { + stream.on('complete', onfinish); + stream.on('abort', onclose); + if (stream.req) onrequest(); + else stream.on('request', onrequest); + } else if (writable && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + if (isChildProcess(stream)) stream.on('exit', onexit); + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + + return function() { + cancelled = true; + stream.removeListener('complete', onfinish); + stream.removeListener('abort', onclose); + stream.removeListener('request', onrequest); + if (stream.req) stream.req.removeListener('finish', onfinish); + stream.removeListener('end', onlegacyfinish); + stream.removeListener('close', onlegacyfinish); + stream.removeListener('finish', onfinish); + stream.removeListener('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json new file mode 100644 index 0000000..0b530cd --- /dev/null +++ b/node_modules/end-of-stream/package.json @@ -0,0 +1,37 @@ +{ + "name": "end-of-stream", + "version": "1.4.5", + "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/end-of-stream.git" + }, + "dependencies": { + "once": "^1.4.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "stream", + "streams", + "callback", + "finish", + "close", + "end", + "wait" + ], + "bugs": { + "url": "https://github.com/mafintosh/end-of-stream/issues" + }, + "homepage": "https://github.com/mafintosh/end-of-stream", + "main": "index.js", + "author": "Mathias Buus ", + "license": "MIT", + "devDependencies": { + "tape": "^4.11.0" + } +} diff --git a/node_modules/end-or-error/History.md b/node_modules/end-or-error/History.md new file mode 100644 index 0000000..d7863fc --- /dev/null +++ b/node_modules/end-or-error/History.md @@ -0,0 +1,10 @@ + +1.0.1 / 2015-02-24 +================== + + * transfer to stream-utils + +1.0.0 / 2015-02-23 +================== + + * first release diff --git a/node_modules/end-or-error/LICENSE b/node_modules/end-or-error/LICENSE new file mode 100644 index 0000000..b69e8fe --- /dev/null +++ b/node_modules/end-or-error/LICENSE @@ -0,0 +1,21 @@ +This software is licensed under the MIT License. + +Copyright (c) stream-utils and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/end-or-error/README.md b/node_modules/end-or-error/README.md new file mode 100644 index 0000000..ec000a9 --- /dev/null +++ b/node_modules/end-or-error/README.md @@ -0,0 +1,46 @@ +end-or-error +======= + +[![NPM version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Gittip][gittip-image]][gittip-url] +[![David deps][david-image]][david-url] +[![npm download][download-image]][download-url] + +[npm-image]: https://img.shields.io/npm/v/end-or-error.svg?style=flat-square +[npm-url]: https://npmjs.org/package/end-or-error +[travis-image]: https://img.shields.io/travis/stream-utils/end-or-error.svg?style=flat-square +[travis-url]: https://travis-ci.org/stream-utils/end-or-error +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/end-or-error.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/stream-utils/end-or-error?branch=master +[gittip-image]: https://img.shields.io/gittip/fengmk2.svg?style=flat-square +[gittip-url]: https://www.gittip.com/fengmk2/ +[david-image]: https://img.shields.io/david/stream-utils/end-or-error.svg?style=flat-square +[david-url]: https://david-dm.org/stream-utils/end-or-error +[download-image]: https://img.shields.io/npm/dm/end-or-error.svg?style=flat-square +[download-url]: https://npmjs.org/package/end-or-error + +Listen readable stream `end` or `error` event once. + +## Install + +```bash +$ npm i end-or-error +``` + +## Usage + +```js +var eoe = require('end-or-error'); + +var stream = createReadStreamSomeHow(); + +eoe(stream, function (err) { + // err => stream emitted "error" event +}); +``` + +## License + +[MIT](LICENSE) diff --git a/node_modules/end-or-error/index.js b/node_modules/end-or-error/index.js new file mode 100644 index 0000000..e67f6ae --- /dev/null +++ b/node_modules/end-or-error/index.js @@ -0,0 +1,39 @@ +/**! + * end-or-error - index.js + * + * Copyright(c) stream-utils and other contributors. + * MIT Licensed + * + * Authors: + * fengmk2 (http://fengmk2.com) + */ + +'use strict'; + +/** + * Module dependencies. + */ + +module.exports = function eoe(stream, cb) { + if (!stream.readable) { + return cb(); + } + + stream.on('error', onerror); + stream.on('end', onend); + + function onerror(err) { + cleanup(); + cb(err); + } + + function onend(data) { + cleanup(); + cb(null, data); + } + + function cleanup() { + stream.removeListener('error', onerror); + stream.removeListener('end', onend); + } +}; diff --git a/node_modules/end-or-error/package.json b/node_modules/end-or-error/package.json new file mode 100644 index 0000000..5aa64ac --- /dev/null +++ b/node_modules/end-or-error/package.json @@ -0,0 +1,44 @@ +{ + "name": "end-or-error", + "version": "1.0.1", + "description": "Listen readable stream `end` or `error` event once", + "main": "index.js", + "files": ["index.js"], + "scripts": { + "test": "mocha --check-leaks -R spec -t 5000 test/*.test.js", + "test-cov": "node node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- --check-leaks -t 5000 test/*.test.js", + "test-travis": "node node_modules/.bin/istanbul cover node_modules/.bin/_mocha --report lcovonly -- --check-leaks -t 5000 test/*.test.js", + "jshint": "jshint .", + "autod": "autod -w --prefix '~'", + "cnpm": "npm install --registry=https://registry.npm.taobao.org", + "contributors": "contributors -f plain -o AUTHORS" + }, + "dependencies": { + + }, + "devDependencies": { + "autod": "*", + "contributors": "*", + "jshint": "*", + "istanbul": "*", + "mocha": "*" + }, + "homepage": "https://github.com/stream-utils/end-or-error", + "repository": { + "type": "git", + "url": "git://github.com/stream-utils/end-or-error.git", + "web": "https://github.com/stream-utils/end-or-error" + }, + "bugs": { + "url": "https://github.com/stream-utils/end-or-error/issues", + "email": "m@fengmk2.com" + }, + "keywords": [ + "end-or-error", "readstream", "readable", "stream", "end", "eoe", "stream-utils" + ], + "engines": { + "node": ">= 0.11.14" + }, + "author": "fengmk2 (http://fengmk2.com)", + "license": "MIT" +} diff --git a/node_modules/es-define-property/.eslintrc b/node_modules/es-define-property/.eslintrc new file mode 100644 index 0000000..46f3b12 --- /dev/null +++ b/node_modules/es-define-property/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": ["error", { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/node_modules/es-define-property/.github/FUNDING.yml b/node_modules/es-define-property/.github/FUNDING.yml new file mode 100644 index 0000000..4445451 --- /dev/null +++ b/node_modules/es-define-property/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-define-property +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/es-define-property/.nycrc b/node_modules/es-define-property/.nycrc new file mode 100644 index 0000000..bdd626c --- /dev/null +++ b/node_modules/es-define-property/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/es-define-property/CHANGELOG.md b/node_modules/es-define-property/CHANGELOG.md new file mode 100644 index 0000000..5f60cc0 --- /dev/null +++ b/node_modules/es-define-property/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/es-define-property/compare/v1.0.0...v1.0.1) - 2024-12-06 + +### Commits + +- [types] use shared tsconfig [`954a663`](https://github.com/ljharb/es-define-property/commit/954a66360326e508a0e5daa4b07493d58f5e110e) +- [actions] split out node 10-20, and 20+ [`3a8e84b`](https://github.com/ljharb/es-define-property/commit/3a8e84b23883f26ff37b3e82ff283834228e18c6) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/tape`, `auto-changelog`, `gopd`, `tape` [`86ae27b`](https://github.com/ljharb/es-define-property/commit/86ae27bb8cc857b23885136fad9cbe965ae36612) +- [Refactor] avoid using `get-intrinsic` [`02480c0`](https://github.com/ljharb/es-define-property/commit/02480c0353ef6118965282977c3864aff53d98b1) +- [Tests] replace `aud` with `npm audit` [`f6093ff`](https://github.com/ljharb/es-define-property/commit/f6093ff74ab51c98015c2592cd393bd42478e773) +- [Tests] configure testling [`7139e66`](https://github.com/ljharb/es-define-property/commit/7139e66959247a56086d9977359caef27c6849e7) +- [Dev Deps] update `tape` [`b901b51`](https://github.com/ljharb/es-define-property/commit/b901b511a75e001a40ce1a59fef7d9ffcfc87482) +- [Tests] fix types in tests [`469d269`](https://github.com/ljharb/es-define-property/commit/469d269fd141b1e773ec053a9fa35843493583e0) +- [Dev Deps] add missing peer dep [`733acfb`](https://github.com/ljharb/es-define-property/commit/733acfb0c4c96edf337e470b89a25a5b3724c352) + +## v1.0.0 - 2024-02-12 + +### Commits + +- Initial implementation, tests, readme, types [`3e154e1`](https://github.com/ljharb/es-define-property/commit/3e154e11a2fee09127220f5e503bf2c0a31dd480) +- Initial commit [`07d98de`](https://github.com/ljharb/es-define-property/commit/07d98de34a4dc31ff5e83a37c0c3f49e0d85cd50) +- npm init [`c4eb634`](https://github.com/ljharb/es-define-property/commit/c4eb6348b0d3886aac36cef34ad2ee0665ea6f3e) +- Only apps should have lockfiles [`7af86ec`](https://github.com/ljharb/es-define-property/commit/7af86ec1d311ec0b17fdfe616a25f64276903856) diff --git a/node_modules/es-define-property/LICENSE b/node_modules/es-define-property/LICENSE new file mode 100644 index 0000000..f82f389 --- /dev/null +++ b/node_modules/es-define-property/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/es-define-property/README.md b/node_modules/es-define-property/README.md new file mode 100644 index 0000000..9b291bd --- /dev/null +++ b/node_modules/es-define-property/README.md @@ -0,0 +1,49 @@ +# es-define-property [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +`Object.defineProperty`, but not IE 8's broken one. + +## Example + +```js +const assert = require('assert'); + +const $defineProperty = require('es-define-property'); + +if ($defineProperty) { + assert.equal($defineProperty, Object.defineProperty); +} else if (Object.defineProperty) { + assert.equal($defineProperty, false, 'this is IE 8'); +} else { + assert.equal($defineProperty, false, 'this is an ES3 engine'); +} +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-define-property +[npm-version-svg]: https://versionbadg.es/ljharb/es-define-property.svg +[deps-svg]: https://david-dm.org/ljharb/es-define-property.svg +[deps-url]: https://david-dm.org/ljharb/es-define-property +[dev-deps-svg]: https://david-dm.org/ljharb/es-define-property/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-define-property#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-define-property.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-define-property.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-define-property.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-define-property +[codecov-image]: https://codecov.io/gh/ljharb/es-define-property/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-define-property/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-define-property +[actions-url]: https://github.com/ljharb/es-define-property/actions diff --git a/node_modules/es-define-property/index.d.ts b/node_modules/es-define-property/index.d.ts new file mode 100644 index 0000000..6012247 --- /dev/null +++ b/node_modules/es-define-property/index.d.ts @@ -0,0 +1,3 @@ +declare const defineProperty: false | typeof Object.defineProperty; + +export = defineProperty; \ No newline at end of file diff --git a/node_modules/es-define-property/index.js b/node_modules/es-define-property/index.js new file mode 100644 index 0000000..e0a2925 --- /dev/null +++ b/node_modules/es-define-property/index.js @@ -0,0 +1,14 @@ +'use strict'; + +/** @type {import('.')} */ +var $defineProperty = Object.defineProperty || false; +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } +} + +module.exports = $defineProperty; diff --git a/node_modules/es-define-property/package.json b/node_modules/es-define-property/package.json new file mode 100644 index 0000000..fbed187 --- /dev/null +++ b/node_modules/es-define-property/package.json @@ -0,0 +1,81 @@ +{ + "name": "es-define-property", + "version": "1.0.1", + "description": "`Object.defineProperty`, but not IE 8's broken one.", + "main": "index.js", + "types": "./index.d.ts", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p .", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-define-property.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "object", + "define", + "property", + "defineProperty", + "Object.defineProperty" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-define-property/issues" + }, + "homepage": "https://github.com/ljharb/es-define-property#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/gopd": "^1.0.3", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "gopd": "^1.2.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/es-define-property/test/index.js b/node_modules/es-define-property/test/index.js new file mode 100644 index 0000000..b4b4688 --- /dev/null +++ b/node_modules/es-define-property/test/index.js @@ -0,0 +1,56 @@ +'use strict'; + +var $defineProperty = require('../'); + +var test = require('tape'); +var gOPD = require('gopd'); + +test('defineProperty: supported', { skip: !$defineProperty }, function (t) { + t.plan(4); + + t.equal(typeof $defineProperty, 'function', 'defineProperty is supported'); + if ($defineProperty && gOPD) { // this `if` check is just to shut TS up + /** @type {{ a: number, b?: number, c?: number }} */ + var o = { a: 1 }; + + $defineProperty(o, 'b', { enumerable: true, value: 2 }); + t.deepEqual( + gOPD(o, 'b'), + { + configurable: false, + enumerable: true, + value: 2, + writable: false + }, + 'property descriptor is as expected' + ); + + $defineProperty(o, 'c', { enumerable: false, value: 3, writable: true }); + t.deepEqual( + gOPD(o, 'c'), + { + configurable: false, + enumerable: false, + value: 3, + writable: true + }, + 'property descriptor is as expected' + ); + } + + t.equal($defineProperty, Object.defineProperty, 'defineProperty is Object.defineProperty'); + + t.end(); +}); + +test('defineProperty: not supported', { skip: !!$defineProperty }, function (t) { + t.notOk($defineProperty, 'defineProperty is not supported'); + + t.match( + typeof $defineProperty, + /^(?:undefined|boolean)$/, + '`typeof defineProperty` is `undefined` or `boolean`' + ); + + t.end(); +}); diff --git a/node_modules/es-define-property/tsconfig.json b/node_modules/es-define-property/tsconfig.json new file mode 100644 index 0000000..5a49992 --- /dev/null +++ b/node_modules/es-define-property/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2022", + }, + "exclude": [ + "coverage", + "test/list-exports" + ], +} diff --git a/node_modules/es-errors/.eslintrc b/node_modules/es-errors/.eslintrc new file mode 100644 index 0000000..3b5d9e9 --- /dev/null +++ b/node_modules/es-errors/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/node_modules/es-errors/.github/FUNDING.yml b/node_modules/es-errors/.github/FUNDING.yml new file mode 100644 index 0000000..f1b8805 --- /dev/null +++ b/node_modules/es-errors/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-errors +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/es-errors/CHANGELOG.md b/node_modules/es-errors/CHANGELOG.md new file mode 100644 index 0000000..204a9e9 --- /dev/null +++ b/node_modules/es-errors/CHANGELOG.md @@ -0,0 +1,40 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.3.0](https://github.com/ljharb/es-errors/compare/v1.2.1...v1.3.0) - 2024-02-05 + +### Commits + +- [New] add `EvalError` and `URIError` [`1927627`](https://github.com/ljharb/es-errors/commit/1927627ba68cb6c829d307231376c967db53acdf) + +## [v1.2.1](https://github.com/ljharb/es-errors/compare/v1.2.0...v1.2.1) - 2024-02-04 + +### Commits + +- [Fix] add missing `exports` entry [`5bb5f28`](https://github.com/ljharb/es-errors/commit/5bb5f280f98922701109d6ebb82eea2257cecc7e) + +## [v1.2.0](https://github.com/ljharb/es-errors/compare/v1.1.0...v1.2.0) - 2024-02-04 + +### Commits + +- [New] add `ReferenceError` [`6d8cf5b`](https://github.com/ljharb/es-errors/commit/6d8cf5bbb6f3f598d02cf6f30e468ba2caa8e143) + +## [v1.1.0](https://github.com/ljharb/es-errors/compare/v1.0.0...v1.1.0) - 2024-02-04 + +### Commits + +- [New] add base Error [`2983ab6`](https://github.com/ljharb/es-errors/commit/2983ab65f7bc5441276cb021dc3aa03c78881698) + +## v1.0.0 - 2024-02-03 + +### Commits + +- Initial implementation, tests, readme, type [`8f47631`](https://github.com/ljharb/es-errors/commit/8f476317e9ad76f40ad648081829b1a1a3a1288b) +- Initial commit [`ea5d099`](https://github.com/ljharb/es-errors/commit/ea5d099ef18e550509ab9e2be000526afd81c385) +- npm init [`6f5ebf9`](https://github.com/ljharb/es-errors/commit/6f5ebf9cead474dadd72b9e63dad315820a089ae) +- Only apps should have lockfiles [`e1a0aeb`](https://github.com/ljharb/es-errors/commit/e1a0aeb7b80f5cfc56be54d6b2100e915d47def8) +- [meta] add `sideEffects` flag [`a9c7d46`](https://github.com/ljharb/es-errors/commit/a9c7d460a492f1d8a241c836bc25a322a19cc043) diff --git a/node_modules/es-errors/LICENSE b/node_modules/es-errors/LICENSE new file mode 100644 index 0000000..f82f389 --- /dev/null +++ b/node_modules/es-errors/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/es-errors/README.md b/node_modules/es-errors/README.md new file mode 100644 index 0000000..8dbfacf --- /dev/null +++ b/node_modules/es-errors/README.md @@ -0,0 +1,55 @@ +# es-errors [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A simple cache for a few of the JS Error constructors. + +## Example + +```js +const assert = require('assert'); + +const Base = require('es-errors'); +const Eval = require('es-errors/eval'); +const Range = require('es-errors/range'); +const Ref = require('es-errors/ref'); +const Syntax = require('es-errors/syntax'); +const Type = require('es-errors/type'); +const URI = require('es-errors/uri'); + +assert.equal(Base, Error); +assert.equal(Eval, EvalError); +assert.equal(Range, RangeError); +assert.equal(Ref, ReferenceError); +assert.equal(Syntax, SyntaxError); +assert.equal(Type, TypeError); +assert.equal(URI, URIError); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-errors +[npm-version-svg]: https://versionbadg.es/ljharb/es-errors.svg +[deps-svg]: https://david-dm.org/ljharb/es-errors.svg +[deps-url]: https://david-dm.org/ljharb/es-errors +[dev-deps-svg]: https://david-dm.org/ljharb/es-errors/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-errors#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-errors.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-errors.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-errors.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-errors +[codecov-image]: https://codecov.io/gh/ljharb/es-errors/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-errors/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-errors +[actions-url]: https://github.com/ljharb/es-errors/actions diff --git a/node_modules/es-errors/eval.d.ts b/node_modules/es-errors/eval.d.ts new file mode 100644 index 0000000..e4210e0 --- /dev/null +++ b/node_modules/es-errors/eval.d.ts @@ -0,0 +1,3 @@ +declare const EvalError: EvalErrorConstructor; + +export = EvalError; diff --git a/node_modules/es-errors/eval.js b/node_modules/es-errors/eval.js new file mode 100644 index 0000000..725ccb6 --- /dev/null +++ b/node_modules/es-errors/eval.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./eval')} */ +module.exports = EvalError; diff --git a/node_modules/es-errors/index.d.ts b/node_modules/es-errors/index.d.ts new file mode 100644 index 0000000..69bdbc9 --- /dev/null +++ b/node_modules/es-errors/index.d.ts @@ -0,0 +1,3 @@ +declare const Error: ErrorConstructor; + +export = Error; diff --git a/node_modules/es-errors/index.js b/node_modules/es-errors/index.js new file mode 100644 index 0000000..cc0c521 --- /dev/null +++ b/node_modules/es-errors/index.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('.')} */ +module.exports = Error; diff --git a/node_modules/es-errors/package.json b/node_modules/es-errors/package.json new file mode 100644 index 0000000..ff8c2a5 --- /dev/null +++ b/node_modules/es-errors/package.json @@ -0,0 +1,80 @@ +{ + "name": "es-errors", + "version": "1.3.0", + "description": "A simple cache for a few of the JS Error constructors.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./eval": "./eval.js", + "./range": "./range.js", + "./ref": "./ref.js", + "./syntax": "./syntax.js", + "./type": "./type.js", + "./uri": "./uri.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "aud --production", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-errors.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "error", + "typeerror", + "syntaxerror", + "rangeerror" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-errors/issues" + }, + "homepage": "https://github.com/ljharb/es-errors#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eclint": "^2.8.1", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/es-errors/range.d.ts b/node_modules/es-errors/range.d.ts new file mode 100644 index 0000000..3a12e86 --- /dev/null +++ b/node_modules/es-errors/range.d.ts @@ -0,0 +1,3 @@ +declare const RangeError: RangeErrorConstructor; + +export = RangeError; diff --git a/node_modules/es-errors/range.js b/node_modules/es-errors/range.js new file mode 100644 index 0000000..2044fe0 --- /dev/null +++ b/node_modules/es-errors/range.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./range')} */ +module.exports = RangeError; diff --git a/node_modules/es-errors/ref.d.ts b/node_modules/es-errors/ref.d.ts new file mode 100644 index 0000000..a13107e --- /dev/null +++ b/node_modules/es-errors/ref.d.ts @@ -0,0 +1,3 @@ +declare const ReferenceError: ReferenceErrorConstructor; + +export = ReferenceError; diff --git a/node_modules/es-errors/ref.js b/node_modules/es-errors/ref.js new file mode 100644 index 0000000..d7c430f --- /dev/null +++ b/node_modules/es-errors/ref.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./ref')} */ +module.exports = ReferenceError; diff --git a/node_modules/es-errors/syntax.d.ts b/node_modules/es-errors/syntax.d.ts new file mode 100644 index 0000000..6a0c53c --- /dev/null +++ b/node_modules/es-errors/syntax.d.ts @@ -0,0 +1,3 @@ +declare const SyntaxError: SyntaxErrorConstructor; + +export = SyntaxError; diff --git a/node_modules/es-errors/syntax.js b/node_modules/es-errors/syntax.js new file mode 100644 index 0000000..5f5fdde --- /dev/null +++ b/node_modules/es-errors/syntax.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./syntax')} */ +module.exports = SyntaxError; diff --git a/node_modules/es-errors/test/index.js b/node_modules/es-errors/test/index.js new file mode 100644 index 0000000..1ff0277 --- /dev/null +++ b/node_modules/es-errors/test/index.js @@ -0,0 +1,19 @@ +'use strict'; + +var test = require('tape'); + +var E = require('../'); +var R = require('../range'); +var Ref = require('../ref'); +var S = require('../syntax'); +var T = require('../type'); + +test('errors', function (t) { + t.equal(E, Error); + t.equal(R, RangeError); + t.equal(Ref, ReferenceError); + t.equal(S, SyntaxError); + t.equal(T, TypeError); + + t.end(); +}); diff --git a/node_modules/es-errors/tsconfig.json b/node_modules/es-errors/tsconfig.json new file mode 100644 index 0000000..99dfeb6 --- /dev/null +++ b/node_modules/es-errors/tsconfig.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "es5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": ["types"], /* Specify multiple folders that act like `./node_modules/@types`. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow `import x from y` when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + + /* Completeness */ + // "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/es-errors/type.d.ts b/node_modules/es-errors/type.d.ts new file mode 100644 index 0000000..576fb51 --- /dev/null +++ b/node_modules/es-errors/type.d.ts @@ -0,0 +1,3 @@ +declare const TypeError: TypeErrorConstructor + +export = TypeError; diff --git a/node_modules/es-errors/type.js b/node_modules/es-errors/type.js new file mode 100644 index 0000000..9769e44 --- /dev/null +++ b/node_modules/es-errors/type.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./type')} */ +module.exports = TypeError; diff --git a/node_modules/es-errors/uri.d.ts b/node_modules/es-errors/uri.d.ts new file mode 100644 index 0000000..c3261c9 --- /dev/null +++ b/node_modules/es-errors/uri.d.ts @@ -0,0 +1,3 @@ +declare const URIError: URIErrorConstructor; + +export = URIError; diff --git a/node_modules/es-errors/uri.js b/node_modules/es-errors/uri.js new file mode 100644 index 0000000..e9cd1c7 --- /dev/null +++ b/node_modules/es-errors/uri.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('./uri')} */ +module.exports = URIError; diff --git a/node_modules/es-object-atoms/.eslintrc b/node_modules/es-object-atoms/.eslintrc new file mode 100644 index 0000000..d90a1bc --- /dev/null +++ b/node_modules/es-object-atoms/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "eqeqeq": ["error", "allow-null"], + "id-length": "off", + "new-cap": ["error", { + "capIsNewExceptions": [ + "RequireObjectCoercible", + "ToObject", + ], + }], + }, +} diff --git a/node_modules/es-object-atoms/.github/FUNDING.yml b/node_modules/es-object-atoms/.github/FUNDING.yml new file mode 100644 index 0000000..352bfda --- /dev/null +++ b/node_modules/es-object-atoms/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/es-object +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/es-object-atoms/CHANGELOG.md b/node_modules/es-object-atoms/CHANGELOG.md new file mode 100644 index 0000000..fdd2abe --- /dev/null +++ b/node_modules/es-object-atoms/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.1](https://github.com/ljharb/es-object-atoms/compare/v1.1.0...v1.1.1) - 2025-01-14 + +### Commits + +- [types] `ToObject`: improve types [`cfe8c8a`](https://github.com/ljharb/es-object-atoms/commit/cfe8c8a105c44820cb22e26f62d12ef0ad9715c8) + +## [v1.1.0](https://github.com/ljharb/es-object-atoms/compare/v1.0.1...v1.1.0) - 2025-01-14 + +### Commits + +- [New] add `isObject` [`51e4042`](https://github.com/ljharb/es-object-atoms/commit/51e4042df722eb3165f40dc5f4bf33d0197ecb07) + +## [v1.0.1](https://github.com/ljharb/es-object-atoms/compare/v1.0.0...v1.0.1) - 2025-01-13 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/tape`, `auto-changelog`, `tape` [`38ab9eb`](https://github.com/ljharb/es-object-atoms/commit/38ab9eb00b62c2f4668644f5e513d9b414ebd595) +- [types] improve types [`7d1beb8`](https://github.com/ljharb/es-object-atoms/commit/7d1beb887958b78b6a728a210a1c8370ab7e2aa1) +- [Tests] replace `aud` with `npm audit` [`25863ba`](https://github.com/ljharb/es-object-atoms/commit/25863baf99178f1d1ad33d1120498db28631907e) +- [Dev Deps] add missing peer dep [`c012309`](https://github.com/ljharb/es-object-atoms/commit/c0123091287e6132d6f4240496340c427433df28) + +## v1.0.0 - 2024-03-16 + +### Commits + +- Initial implementation, tests, readme, types [`f1499db`](https://github.com/ljharb/es-object-atoms/commit/f1499db7d3e1741e64979c61d645ab3137705e82) +- Initial commit [`99eedc7`](https://github.com/ljharb/es-object-atoms/commit/99eedc7b5fde38a50a28d3c8b724706e3e4c5f6a) +- [meta] rename repo [`fc851fa`](https://github.com/ljharb/es-object-atoms/commit/fc851fa70616d2d182aaf0bd02c2ed7084dea8fa) +- npm init [`b909377`](https://github.com/ljharb/es-object-atoms/commit/b909377c50049bd0ec575562d20b0f9ebae8947f) +- Only apps should have lockfiles [`7249edd`](https://github.com/ljharb/es-object-atoms/commit/7249edd2178c1b9ddfc66ffcc6d07fdf0d28efc1) diff --git a/node_modules/es-object-atoms/LICENSE b/node_modules/es-object-atoms/LICENSE new file mode 100644 index 0000000..f82f389 --- /dev/null +++ b/node_modules/es-object-atoms/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/es-object-atoms/README.md b/node_modules/es-object-atoms/README.md new file mode 100644 index 0000000..447695b --- /dev/null +++ b/node_modules/es-object-atoms/README.md @@ -0,0 +1,63 @@ +# es-object-atoms [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +ES Object-related atoms: Object, ToObject, RequireObjectCoercible. + +## Example + +```js +const assert = require('assert'); + +const $Object = require('es-object-atoms'); +const isObject = require('es-object-atoms/isObject'); +const ToObject = require('es-object-atoms/ToObject'); +const RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible'); + +assert.equal($Object, Object); +assert.throws(() => ToObject(null), TypeError); +assert.throws(() => ToObject(undefined), TypeError); +assert.throws(() => RequireObjectCoercible(null), TypeError); +assert.throws(() => RequireObjectCoercible(undefined), TypeError); + +assert.equal(isObject(undefined), false); +assert.equal(isObject(null), false); +assert.equal(isObject({}), true); +assert.equal(isObject([]), true); +assert.equal(isObject(function () {}), true); + +assert.deepEqual(RequireObjectCoercible(true), true); +assert.deepEqual(ToObject(true), Object(true)); + +const obj = {}; +assert.equal(RequireObjectCoercible(obj), obj); +assert.equal(ToObject(obj), obj); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +[package-url]: https://npmjs.org/package/es-object-atoms +[npm-version-svg]: https://versionbadg.es/ljharb/es-object-atoms.svg +[deps-svg]: https://david-dm.org/ljharb/es-object-atoms.svg +[deps-url]: https://david-dm.org/ljharb/es-object-atoms +[dev-deps-svg]: https://david-dm.org/ljharb/es-object-atoms/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/es-object-atoms#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-object-atoms.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-object-atoms.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-object.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-object-atoms +[codecov-image]: https://codecov.io/gh/ljharb/es-object-atoms/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/es-object-atoms/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-object-atoms +[actions-url]: https://github.com/ljharb/es-object-atoms/actions diff --git a/node_modules/es-object-atoms/RequireObjectCoercible.d.ts b/node_modules/es-object-atoms/RequireObjectCoercible.d.ts new file mode 100644 index 0000000..7e26c45 --- /dev/null +++ b/node_modules/es-object-atoms/RequireObjectCoercible.d.ts @@ -0,0 +1,3 @@ +declare function RequireObjectCoercible(value: T, optMessage?: string): T; + +export = RequireObjectCoercible; diff --git a/node_modules/es-object-atoms/RequireObjectCoercible.js b/node_modules/es-object-atoms/RequireObjectCoercible.js new file mode 100644 index 0000000..8e191c6 --- /dev/null +++ b/node_modules/es-object-atoms/RequireObjectCoercible.js @@ -0,0 +1,11 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); + +/** @type {import('./RequireObjectCoercible')} */ +module.exports = function RequireObjectCoercible(value) { + if (value == null) { + throw new $TypeError((arguments.length > 0 && arguments[1]) || ('Cannot call method on ' + value)); + } + return value; +}; diff --git a/node_modules/es-object-atoms/ToObject.d.ts b/node_modules/es-object-atoms/ToObject.d.ts new file mode 100644 index 0000000..d6dd302 --- /dev/null +++ b/node_modules/es-object-atoms/ToObject.d.ts @@ -0,0 +1,7 @@ +declare function ToObject(value: number): Number; +declare function ToObject(value: boolean): Boolean; +declare function ToObject(value: string): String; +declare function ToObject(value: bigint): BigInt; +declare function ToObject(value: T): T; + +export = ToObject; diff --git a/node_modules/es-object-atoms/ToObject.js b/node_modules/es-object-atoms/ToObject.js new file mode 100644 index 0000000..2b99a7d --- /dev/null +++ b/node_modules/es-object-atoms/ToObject.js @@ -0,0 +1,10 @@ +'use strict'; + +var $Object = require('./'); +var RequireObjectCoercible = require('./RequireObjectCoercible'); + +/** @type {import('./ToObject')} */ +module.exports = function ToObject(value) { + RequireObjectCoercible(value); + return $Object(value); +}; diff --git a/node_modules/es-object-atoms/index.d.ts b/node_modules/es-object-atoms/index.d.ts new file mode 100644 index 0000000..8bdbfc8 --- /dev/null +++ b/node_modules/es-object-atoms/index.d.ts @@ -0,0 +1,3 @@ +declare const Object: ObjectConstructor; + +export = Object; diff --git a/node_modules/es-object-atoms/index.js b/node_modules/es-object-atoms/index.js new file mode 100644 index 0000000..1d33cef --- /dev/null +++ b/node_modules/es-object-atoms/index.js @@ -0,0 +1,4 @@ +'use strict'; + +/** @type {import('.')} */ +module.exports = Object; diff --git a/node_modules/es-object-atoms/isObject.d.ts b/node_modules/es-object-atoms/isObject.d.ts new file mode 100644 index 0000000..43bee3b --- /dev/null +++ b/node_modules/es-object-atoms/isObject.d.ts @@ -0,0 +1,3 @@ +declare function isObject(x: unknown): x is object; + +export = isObject; diff --git a/node_modules/es-object-atoms/isObject.js b/node_modules/es-object-atoms/isObject.js new file mode 100644 index 0000000..ec49bf1 --- /dev/null +++ b/node_modules/es-object-atoms/isObject.js @@ -0,0 +1,6 @@ +'use strict'; + +/** @type {import('./isObject')} */ +module.exports = function isObject(x) { + return !!x && (typeof x === 'function' || typeof x === 'object'); +}; diff --git a/node_modules/es-object-atoms/package.json b/node_modules/es-object-atoms/package.json new file mode 100644 index 0000000..f4cec71 --- /dev/null +++ b/node_modules/es-object-atoms/package.json @@ -0,0 +1,80 @@ +{ + "name": "es-object-atoms", + "version": "1.1.1", + "description": "ES Object-related atoms: Object, ToObject, RequireObjectCoercible", + "main": "index.js", + "exports": { + ".": "./index.js", + "./RequireObjectCoercible": "./RequireObjectCoercible.js", + "./isObject": "./isObject.js", + "./ToObject": "./ToObject.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@\">= 10.2\" audit --production", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/es-object-atoms.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "object", + "toobject", + "coercible" + ], + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/es-object-atoms/issues" + }, + "homepage": "https://github.com/ljharb/es-object-atoms#readme", + "dependencies": { + "es-errors": "^1.3.0" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "^8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/es-object-atoms/test/index.js b/node_modules/es-object-atoms/test/index.js new file mode 100644 index 0000000..430b705 --- /dev/null +++ b/node_modules/es-object-atoms/test/index.js @@ -0,0 +1,38 @@ +'use strict'; + +var test = require('tape'); + +var $Object = require('../'); +var isObject = require('../isObject'); +var ToObject = require('../ToObject'); +var RequireObjectCoercible = require('..//RequireObjectCoercible'); + +test('errors', function (t) { + t.equal($Object, Object); + // @ts-expect-error + t['throws'](function () { ToObject(null); }, TypeError); + // @ts-expect-error + t['throws'](function () { ToObject(undefined); }, TypeError); + // @ts-expect-error + t['throws'](function () { RequireObjectCoercible(null); }, TypeError); + // @ts-expect-error + t['throws'](function () { RequireObjectCoercible(undefined); }, TypeError); + + t.deepEqual(RequireObjectCoercible(true), true); + t.deepEqual(ToObject(true), Object(true)); + t.deepEqual(ToObject(42), Object(42)); + var f = function () {}; + t.equal(ToObject(f), f); + + t.equal(isObject(undefined), false); + t.equal(isObject(null), false); + t.equal(isObject({}), true); + t.equal(isObject([]), true); + t.equal(isObject(function () {}), true); + + var obj = {}; + t.equal(RequireObjectCoercible(obj), obj); + t.equal(ToObject(obj), obj); + + t.end(); +}); diff --git a/node_modules/es-object-atoms/tsconfig.json b/node_modules/es-object-atoms/tsconfig.json new file mode 100644 index 0000000..1f73cb7 --- /dev/null +++ b/node_modules/es-object-atoms/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es5", + }, +} diff --git a/node_modules/es-set-tostringtag/.eslintrc b/node_modules/es-set-tostringtag/.eslintrc new file mode 100644 index 0000000..2612ed8 --- /dev/null +++ b/node_modules/es-set-tostringtag/.eslintrc @@ -0,0 +1,13 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + }, +} diff --git a/node_modules/es-set-tostringtag/.nycrc b/node_modules/es-set-tostringtag/.nycrc new file mode 100644 index 0000000..bdd626c --- /dev/null +++ b/node_modules/es-set-tostringtag/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/es-set-tostringtag/CHANGELOG.md b/node_modules/es-set-tostringtag/CHANGELOG.md new file mode 100644 index 0000000..00bdc03 --- /dev/null +++ b/node_modules/es-set-tostringtag/CHANGELOG.md @@ -0,0 +1,67 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v2.1.0](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.3...v2.1.0) - 2025-01-01 + +### Commits + +- [actions] split out node 10-20, and 20+ [`ede033c`](https://github.com/es-shims/es-set-tostringtag/commit/ede033cc4e506c3966d2d482d4ac5987e329162a) +- [types] use shared config [`28ef164`](https://github.com/es-shims/es-set-tostringtag/commit/28ef164ad7c5bc21837c79f7ef25542a1f258ade) +- [New] add `nonConfigurable` option [`3bee3f0`](https://github.com/es-shims/es-set-tostringtag/commit/3bee3f04caddd318f3932912212ed20b2d62aad7) +- [Fix] validate boolean option argument [`3c8a609`](https://github.com/es-shims/es-set-tostringtag/commit/3c8a609c795a305ccca163f0ff6956caa88cdc0e) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/tape`, `auto-changelog`, `tape` [`501a969`](https://github.com/es-shims/es-set-tostringtag/commit/501a96998484226e07f5ffd447e8f305a998f1d8) +- [Tests] add coverage [`18af289`](https://github.com/es-shims/es-set-tostringtag/commit/18af2897b4e937373c9b8c8831bc338932246470) +- [readme] document `force` option [`bd446a1`](https://github.com/es-shims/es-set-tostringtag/commit/bd446a107b71a2270278442e5124f45590d3ee64) +- [Tests] use `@arethetypeswrong/cli` [`7c2c2fa`](https://github.com/es-shims/es-set-tostringtag/commit/7c2c2fa3cca0f4d263603adb75426b239514598f) +- [Tests] replace `aud` with `npm audit` [`9e372d7`](https://github.com/es-shims/es-set-tostringtag/commit/9e372d7e6db3dab405599a14d9074a99a03b8242) +- [Deps] update `get-intrinsic` [`7df1216`](https://github.com/es-shims/es-set-tostringtag/commit/7df12167295385c2a547410e687cb0c04f3a34b9) +- [Deps] update `hasown` [`993a7d2`](https://github.com/es-shims/es-set-tostringtag/commit/993a7d200e2059fd857ec1a25d0a49c2c34ae6e2) +- [Dev Deps] add missing peer dep [`148ed8d`](https://github.com/es-shims/es-set-tostringtag/commit/148ed8db99a7a94f9af3823fd083e6e437fa1587) + +## [v2.0.3](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.2...v2.0.3) - 2024-02-20 + +### Commits + +- add types [`d538513`](https://github.com/es-shims/es-set-tostringtag/commit/d5385133592a32a0a416cb535327918af7fbc4ad) +- [Deps] update `get-intrinsic`, `has-tostringtag`, `hasown` [`d129b29`](https://github.com/es-shims/es-set-tostringtag/commit/d129b29536bccc8a9d03a47887ca4d1f7ad0c5b9) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`132ed23`](https://github.com/es-shims/es-set-tostringtag/commit/132ed23c964a41ed55e4ab4a5a2c3fe185e821c1) +- [Tests] fix hasOwn require [`f89c831`](https://github.com/es-shims/es-set-tostringtag/commit/f89c831fe5f3edf1f979c597b56fee1be6111f56) + +## [v2.0.2](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.1...v2.0.2) - 2023-10-20 + +### Commits + +- [Refactor] use `hasown` instead of `has` [`0cc6c4e`](https://github.com/es-shims/es-set-tostringtag/commit/0cc6c4e61fd13e8f00b85424ae6e541ebf289e74) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`70e447c`](https://github.com/es-shims/es-set-tostringtag/commit/70e447cf9f82b896ddf359fda0a0498c16cf3ed2) +- [Deps] update `get-intrinsic` [`826aab7`](https://github.com/es-shims/es-set-tostringtag/commit/826aab76180392871c8efa99acc0f0bbf775c64e) + +## [v2.0.1](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.0...v2.0.1) - 2023-01-05 + +### Fixed + +- [Fix] move `has` to prod deps [`#2`](https://github.com/es-shims/es-set-tostringtag/issues/2) + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config` [`b9eecd2`](https://github.com/es-shims/es-set-tostringtag/commit/b9eecd23c10b7b43ba75089ac8ff8cc6b295798b) + +## [v2.0.0](https://github.com/es-shims/es-set-tostringtag/compare/v1.0.0...v2.0.0) - 2022-12-21 + +### Commits + +- [Tests] refactor tests [`168dcfb`](https://github.com/es-shims/es-set-tostringtag/commit/168dcfbb535c279dc48ccdc89419155125aaec18) +- [Breaking] do not set toStringTag if it is already set [`226ab87`](https://github.com/es-shims/es-set-tostringtag/commit/226ab874192c625d9e5f0e599d3f60d2b2aa83b5) +- [New] add `force` option to set even if already set [`1abd4ec`](https://github.com/es-shims/es-set-tostringtag/commit/1abd4ecb282f19718c4518284b0293a343564505) + +## v1.0.0 - 2022-12-21 + +### Commits + +- Initial implementation, tests, readme [`a0e1147`](https://github.com/es-shims/es-set-tostringtag/commit/a0e11473f79a233b46374525c962ea1b4d42418a) +- Initial commit [`ffd4aff`](https://github.com/es-shims/es-set-tostringtag/commit/ffd4afffbeebf29aff0d87a7cfc3f7844e09fe68) +- npm init [`fffe5bd`](https://github.com/es-shims/es-set-tostringtag/commit/fffe5bd1d1146d084730a387a9c672371f4a8fff) +- Only apps should have lockfiles [`d363871`](https://github.com/es-shims/es-set-tostringtag/commit/d36387139465623e161a15dbd39120537f150c62) diff --git a/node_modules/es-set-tostringtag/LICENSE b/node_modules/es-set-tostringtag/LICENSE new file mode 100644 index 0000000..c2a8460 --- /dev/null +++ b/node_modules/es-set-tostringtag/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ECMAScript Shims + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/es-set-tostringtag/README.md b/node_modules/es-set-tostringtag/README.md new file mode 100644 index 0000000..c27bc9f --- /dev/null +++ b/node_modules/es-set-tostringtag/README.md @@ -0,0 +1,53 @@ +# es-set-tostringtag [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +A helper to optimistically set Symbol.toStringTag, when possible. + +## Example +Most common usage: +```js +var assert = require('assert'); +var setToStringTag = require('es-set-tostringtag'); + +var obj = {}; + +assert.equal(Object.prototype.toString.call(obj), '[object Object]'); + +setToStringTag(obj, 'tagged!'); + +assert.equal(Object.prototype.toString.call(obj), '[object tagged!]'); +``` + +## Options +An optional options argument can be provided as the third argument. The available options are: + +### `force` +If the `force` option is set to `true`, the toStringTag will be set even if it is already set. + +### `nonConfigurable` +If the `nonConfigurable` option is set to `true`, the toStringTag will be defined as non-configurable when possible. + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.com/package/es-set-tostringtag +[npm-version-svg]: https://versionbadg.es/es-shims/es-set-tostringtag.svg +[deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag.svg +[deps-url]: https://david-dm.org/es-shims/es-set-tostringtag +[dev-deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag/dev-status.svg +[dev-deps-url]: https://david-dm.org/es-shims/es-set-tostringtag#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/es-set-tostringtag.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/es-set-tostringtag.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/es-set-tostringtag.svg +[downloads-url]: https://npm-stat.com/charts.html?package=es-set-tostringtag +[codecov-image]: https://codecov.io/gh/es-shims/es-set-tostringtag/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/es-shims/es-set-tostringtag/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/es-set-tostringtag +[actions-url]: https://github.com/es-shims/es-set-tostringtag/actions diff --git a/node_modules/es-set-tostringtag/index.d.ts b/node_modules/es-set-tostringtag/index.d.ts new file mode 100644 index 0000000..c9a8fc4 --- /dev/null +++ b/node_modules/es-set-tostringtag/index.d.ts @@ -0,0 +1,10 @@ +declare function setToStringTag( + object: object & { [Symbol.toStringTag]?: unknown }, + value: string | unknown, + options?: { + force?: boolean; + nonConfigurable?: boolean; + }, +): void; + +export = setToStringTag; \ No newline at end of file diff --git a/node_modules/es-set-tostringtag/index.js b/node_modules/es-set-tostringtag/index.js new file mode 100644 index 0000000..6b6b49c --- /dev/null +++ b/node_modules/es-set-tostringtag/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); + +var hasToStringTag = require('has-tostringtag/shams')(); +var hasOwn = require('hasown'); +var $TypeError = require('es-errors/type'); + +var toStringTag = hasToStringTag ? Symbol.toStringTag : null; + +/** @type {import('.')} */ +module.exports = function setToStringTag(object, value) { + var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force; + var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable; + if ( + (typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean') + || (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean') + ) { + throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans'); + } + if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) { + if ($defineProperty) { + $defineProperty(object, toStringTag, { + configurable: !nonConfigurable, + enumerable: false, + value: value, + writable: false + }); + } else { + object[toStringTag] = value; // eslint-disable-line no-param-reassign + } + } +}; diff --git a/node_modules/es-set-tostringtag/package.json b/node_modules/es-set-tostringtag/package.json new file mode 100644 index 0000000..277c3e5 --- /dev/null +++ b/node_modules/es-set-tostringtag/package.json @@ -0,0 +1,78 @@ +{ + "name": "es-set-tostringtag", + "version": "2.1.0", + "description": "A helper to optimistically set Symbol.toStringTag, when possible.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@\">= 10.2\" audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/es-shims/es-set-tostringtag.git" + }, + "author": "Jordan Harband ", + "license": "MIT", + "bugs": { + "url": "https://github.com/es-shims/es-set-tostringtag/issues" + }, + "homepage": "https://github.com/es-shims/es-set-tostringtag#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.2", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.3", + "@types/get-intrinsic": "^1.2.3", + "@types/has-symbols": "^1.0.2", + "@types/tape": "^5.8.0", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "testling": { + "files": "./test/index.js" + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/es-set-tostringtag/test/index.js b/node_modules/es-set-tostringtag/test/index.js new file mode 100644 index 0000000..f1757b3 --- /dev/null +++ b/node_modules/es-set-tostringtag/test/index.js @@ -0,0 +1,85 @@ +'use strict'; + +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); +var hasOwn = require('hasown'); + +var setToStringTag = require('../'); + +test('setToStringTag', function (t) { + t.equal(typeof setToStringTag, 'function', 'is a function'); + + /** @type {{ [Symbol.toStringTag]?: typeof sentinel }} */ + var obj = {}; + var sentinel = {}; + + setToStringTag(obj, sentinel); + + t['throws']( + // @ts-expect-error + function () { setToStringTag(obj, sentinel, { force: 'yes' }); }, + TypeError, + 'throws if options is not an object' + ); + + t.test('has Symbol.toStringTag', { skip: !hasToStringTag }, function (st) { + st.ok(hasOwn(obj, Symbol.toStringTag), 'has toStringTag property'); + + st.equal(obj[Symbol.toStringTag], sentinel, 'toStringTag property is as expected'); + + st.equal(String(obj), '[object Object]', 'toStringTag works'); + + /** @type {{ [Symbol.toStringTag]?: string }} */ + var tagged = {}; + tagged[Symbol.toStringTag] = 'already tagged'; + st.equal(String(tagged), '[object already tagged]', 'toStringTag works'); + + setToStringTag(tagged, 'new tag'); + st.equal(String(tagged), '[object already tagged]', 'toStringTag is unchanged'); + + setToStringTag(tagged, 'new tag', { force: true }); + st.equal(String(tagged), '[object new tag]', 'toStringTag is changed with force: true'); + + st.deepEqual( + Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag), + { + configurable: true, + enumerable: false, + value: 'new tag', + writable: false + }, + 'has expected property descriptor' + ); + + setToStringTag(tagged, 'new tag', { force: true, nonConfigurable: true }); + st.deepEqual( + Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag), + { + configurable: false, + enumerable: false, + value: 'new tag', + writable: false + }, + 'is nonconfigurable' + ); + + st.end(); + }); + + t.test('does not have Symbol.toStringTag', { skip: hasToStringTag }, function (st) { + var passed = true; + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (hasOwn(obj, key)) { + st.fail('object has own key ' + key); + passed = false; + } + } + if (passed) { + st.ok(true, 'object has no enumerable own keys'); + } + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/es-set-tostringtag/tsconfig.json b/node_modules/es-set-tostringtag/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/node_modules/es-set-tostringtag/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/es6-error/CHANGELOG.md b/node_modules/es6-error/CHANGELOG.md new file mode 100644 index 0000000..9e82c81 --- /dev/null +++ b/node_modules/es6-error/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change Log + +## [v4.0.1] - 2017-01-04 +### Fixed + - jsnext build uses `babel-plugin-transform-builtin-extend` (#27) + +## [v4.0.0] - 2016-10-03 +### Added + - jsnext build (#26) + +## [v3.2.0] - 2016-09-29 +### Added + - TypeScript definitions (#24) + +## [v3.1.0] - 2016-09-08 +### Changed + - Point jsnext build to transpiled code (#23) + +## [v3.0.1] - 2016-07-14 +### Changed + - Move Babel config to `.babelrc` (#20) + +## [v3.0.0] - 2016-05-18 +### Changed + - Upgrade to Babel 6 (#16) + - Make `message`, `name`, and `stack` properties configurable (to match built-in `Error`) (#17) diff --git a/node_modules/es6-error/LICENSE.md b/node_modules/es6-error/LICENSE.md new file mode 100644 index 0000000..4737fd1 --- /dev/null +++ b/node_modules/es6-error/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Ben Youngblood + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/es6-error/README.md b/node_modules/es6-error/README.md new file mode 100644 index 0000000..8a8f130 --- /dev/null +++ b/node_modules/es6-error/README.md @@ -0,0 +1,59 @@ +# es6-error + +[![npm version](https://badge.fury.io/js/es6-error.svg)](https://www.npmjs.com/package/es6-error) +[![Build Status](https://travis-ci.org/bjyoungblood/es6-error.svg?branch=master)](https://travis-ci.org/bjyoungblood/es6-error) + +An easily-extendable error class for use with ES6 classes (or ES5, if you so +choose). + +Tested in Node 4.0, Chrome, and Firefox. + +## Why? + +I made this because I wanted to be able to extend Error for inheritance and type +checking, but can never remember to add +`Error.captureStackTrace(this, this.constructor.name)` to the constructor or how +to get the proper name to print from `console.log`. + +## ES6 Usage + +```javascript + +import ExtendableError from 'es6-error'; + +class MyError extends ExtendableError { + // constructor is optional; you should omit it if you just want a custom error + // type for inheritance and type checking + constructor(message = 'Default message') { + super(message); + } +} + +export default MyError; +``` + +## ES5 Usage + +```javascript + +var util = require('util'); +var ExtendableError = require('es6-error'); + +function MyError(message) { + message = message || 'Default message'; + ExtendableError.call(this, message); +} + +util.inherits(MyError, ExtendableError); + +module.exports = MyError; +``` + +### Known Issues + +- Uglification can obscure error class names ([#31](https://github.com/bjyoungblood/es6-error/issues/31#issuecomment-301128220)) + +#### Todo + +- Better browser compatibility +- Browser tests diff --git a/node_modules/es6-error/es6/index.js b/node_modules/es6-error/es6/index.js new file mode 100644 index 0000000..70fbfbc --- /dev/null +++ b/node_modules/es6-error/es6/index.js @@ -0,0 +1,72 @@ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _extendableBuiltin(cls) { + function ExtendableBuiltin() { + cls.apply(this, arguments); + } + + ExtendableBuiltin.prototype = Object.create(cls.prototype, { + constructor: { + value: cls, + enumerable: false, + writable: true, + configurable: true + } + }); + + if (Object.setPrototypeOf) { + Object.setPrototypeOf(ExtendableBuiltin, cls); + } else { + ExtendableBuiltin.__proto__ = cls; + } + + return ExtendableBuiltin; +} + +var ExtendableError = function (_extendableBuiltin2) { + _inherits(ExtendableError, _extendableBuiltin2); + + function ExtendableError() { + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + + _classCallCheck(this, ExtendableError); + + // extending Error is weird and does not propagate `message` + var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); + + Object.defineProperty(_this, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }); + + Object.defineProperty(_this, 'name', { + configurable: true, + enumerable: false, + value: _this.constructor.name, + writable: true + }); + + if (Error.hasOwnProperty('captureStackTrace')) { + Error.captureStackTrace(_this, _this.constructor); + return _possibleConstructorReturn(_this); + } + + Object.defineProperty(_this, 'stack', { + configurable: true, + enumerable: false, + value: new Error(message).stack, + writable: true + }); + return _this; + } + + return ExtendableError; +}(_extendableBuiltin(Error)); + +export default ExtendableError; diff --git a/node_modules/es6-error/lib/index.js b/node_modules/es6-error/lib/index.js new file mode 100644 index 0000000..617bef7 --- /dev/null +++ b/node_modules/es6-error/lib/index.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _extendableBuiltin(cls) { + function ExtendableBuiltin() { + cls.apply(this, arguments); + } + + ExtendableBuiltin.prototype = Object.create(cls.prototype, { + constructor: { + value: cls, + enumerable: false, + writable: true, + configurable: true + } + }); + + if (Object.setPrototypeOf) { + Object.setPrototypeOf(ExtendableBuiltin, cls); + } else { + ExtendableBuiltin.__proto__ = cls; + } + + return ExtendableBuiltin; +} + +var ExtendableError = function (_extendableBuiltin2) { + _inherits(ExtendableError, _extendableBuiltin2); + + function ExtendableError() { + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + + _classCallCheck(this, ExtendableError); + + // extending Error is weird and does not propagate `message` + var _this = _possibleConstructorReturn(this, (ExtendableError.__proto__ || Object.getPrototypeOf(ExtendableError)).call(this, message)); + + Object.defineProperty(_this, 'message', { + configurable: true, + enumerable: false, + value: message, + writable: true + }); + + Object.defineProperty(_this, 'name', { + configurable: true, + enumerable: false, + value: _this.constructor.name, + writable: true + }); + + if (Error.hasOwnProperty('captureStackTrace')) { + Error.captureStackTrace(_this, _this.constructor); + return _possibleConstructorReturn(_this); + } + + Object.defineProperty(_this, 'stack', { + configurable: true, + enumerable: false, + value: new Error(message).stack, + writable: true + }); + return _this; + } + + return ExtendableError; +}(_extendableBuiltin(Error)); + +exports.default = ExtendableError; +module.exports = exports['default']; diff --git a/node_modules/es6-error/package.json b/node_modules/es6-error/package.json new file mode 100644 index 0000000..c5782a5 --- /dev/null +++ b/node_modules/es6-error/package.json @@ -0,0 +1,48 @@ +{ + "name": "es6-error", + "version": "4.1.1", + "description": "Easily-extendable error for use with ES6 classes", + "main": "./lib/index", + "module": "./es6/index.js", + "typings": "./typings/index.d.ts", + "files": [ + "lib", + "es6", + "typings" + ], + "scripts": { + "test": "cross-env BABEL_ENV=test mocha --require babel-core/register --recursive", + "clean": "rimraf lib es6", + "build": "npm run clean && npm run build:cjs && npm run build:es6", + "build:cjs": "mkdir -p lib && cross-env BABEL_ENV=cjs babel src/index.js -o lib/index.js", + "build:es6": "mkdir -p es6 && cross-env BABEL_ENV=es6 babel src/index.js -o es6/index.js", + "prepublishOnly": "npm run build && npm run test" + }, + "repository": { + "type": "git", + "url": "https://github.com/bjyoungblood/es6-error.git" + }, + "keywords": [ + "es6", + "error", + "babel" + ], + "author": "Ben Youngblood", + "license": "MIT", + "bugs": { + "url": "https://github.com/bjyoungblood/es6-error/issues" + }, + "homepage": "https://github.com/bjyoungblood/es6-error", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-transform-builtin-extend": "^1.1.2", + "babel-preset-env": "^1.6.1", + "chai": "^4.1.2", + "cross-env": "^5.1.1", + "mocha": "^4.0.1", + "rimraf": "^2.6.2" + }, + "dependencies": {} +} diff --git a/node_modules/es6-error/typings/index.d.ts b/node_modules/es6-error/typings/index.d.ts new file mode 100644 index 0000000..c1b1f12 --- /dev/null +++ b/node_modules/es6-error/typings/index.d.ts @@ -0,0 +1 @@ +export default class ExtendableError extends Error { } diff --git a/node_modules/escalade/dist/index.js b/node_modules/escalade/dist/index.js new file mode 100644 index 0000000..ad236c4 --- /dev/null +++ b/node_modules/escalade/dist/index.js @@ -0,0 +1,22 @@ +const { dirname, resolve } = require('path'); +const { readdir, stat } = require('fs'); +const { promisify } = require('util'); + +const toStats = promisify(stat); +const toRead = promisify(readdir); + +module.exports = async function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = await toStats(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = await callback(dir, await toRead(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/node_modules/escalade/dist/index.mjs b/node_modules/escalade/dist/index.mjs new file mode 100644 index 0000000..bf95be0 --- /dev/null +++ b/node_modules/escalade/dist/index.mjs @@ -0,0 +1,22 @@ +import { dirname, resolve } from 'path'; +import { readdir, stat } from 'fs'; +import { promisify } from 'util'; + +const toStats = promisify(stat); +const toRead = promisify(readdir); + +export default async function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = await toStats(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = await callback(dir, await toRead(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/node_modules/escalade/index.d.mts b/node_modules/escalade/index.d.mts new file mode 100644 index 0000000..550699c --- /dev/null +++ b/node_modules/escalade/index.d.mts @@ -0,0 +1,11 @@ +type Promisable = T | Promise; + +export type Callback = ( + directory: string, + files: string[], +) => Promisable; + +export default function ( + directory: string, + callback: Callback, +): Promise; diff --git a/node_modules/escalade/index.d.ts b/node_modules/escalade/index.d.ts new file mode 100644 index 0000000..26c58f2 --- /dev/null +++ b/node_modules/escalade/index.d.ts @@ -0,0 +1,15 @@ +type Promisable = T | Promise; + +declare namespace escalade { + export type Callback = ( + directory: string, + files: string[], + ) => Promisable; +} + +declare function escalade( + directory: string, + callback: escalade.Callback, +): Promise; + +export = escalade; diff --git a/node_modules/escalade/license b/node_modules/escalade/license new file mode 100644 index 0000000..fa6089f --- /dev/null +++ b/node_modules/escalade/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Luke Edwards (lukeed.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/escalade/package.json b/node_modules/escalade/package.json new file mode 100644 index 0000000..1eed4f9 --- /dev/null +++ b/node_modules/escalade/package.json @@ -0,0 +1,74 @@ +{ + "name": "escalade", + "version": "3.2.0", + "repository": "lukeed/escalade", + "description": "A tiny (183B to 210B) and fast utility to ascend parent directories", + "module": "dist/index.mjs", + "main": "dist/index.js", + "types": "index.d.ts", + "license": "MIT", + "author": { + "name": "Luke Edwards", + "email": "luke.edwards05@gmail.com", + "url": "https://lukeed.com" + }, + "exports": { + ".": [ + { + "import": { + "types": "./index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./index.d.ts", + "default": "./dist/index.js" + } + }, + "./dist/index.js" + ], + "./sync": [ + { + "import": { + "types": "./sync/index.d.mts", + "default": "./sync/index.mjs" + }, + "require": { + "types": "./sync/index.d.ts", + "default": "./sync/index.js" + } + }, + "./sync/index.js" + ] + }, + "files": [ + "*.d.mts", + "*.d.ts", + "dist", + "sync" + ], + "modes": { + "sync": "src/sync.js", + "default": "src/async.js" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "build": "bundt", + "pretest": "npm run build", + "test": "uvu -r esm test -i fixtures" + }, + "keywords": [ + "find", + "parent", + "parents", + "directory", + "search", + "walk" + ], + "devDependencies": { + "bundt": "1.1.1", + "esm": "3.2.25", + "uvu": "0.3.3" + } +} diff --git a/node_modules/escalade/readme.md b/node_modules/escalade/readme.md new file mode 100644 index 0000000..e07ee0d --- /dev/null +++ b/node_modules/escalade/readme.md @@ -0,0 +1,211 @@ +# escalade [![CI](https://github.com/lukeed/escalade/workflows/CI/badge.svg)](https://github.com/lukeed/escalade/actions) [![licenses](https://licenses.dev/b/npm/escalade)](https://licenses.dev/npm/escalade) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/escalade)](https://codecov.io/gh/lukeed/escalade) + +> A tiny (183B to 210B) and [fast](#benchmarks) utility to ascend parent directories + +With [escalade](https://en.wikipedia.org/wiki/Escalade), you can scale parent directories until you've found what you're looking for.
Given an input file or directory, `escalade` will continue executing your callback function until either: + +1) the callback returns a truthy value +2) `escalade` has reached the system root directory (eg, `/`) + +> **Important:**
Please note that `escalade` only deals with direct ancestry – it will not dive into parents' sibling directories. + +--- + +**Notice:** As of v3.1.0, `escalade` now includes [Deno support](http://deno.land/x/escalade)! Please see [Deno Usage](#deno) below. + +--- + +## Install + +``` +$ npm install --save escalade +``` + + +## Modes + +There are two "versions" of `escalade` available: + +#### "async" +> **Node.js:** >= 8.x
+> **Size (gzip):** 210 bytes
+> **Availability:** [CommonJS](https://unpkg.com/escalade/dist/index.js), [ES Module](https://unpkg.com/escalade/dist/index.mjs) + +This is the primary/default mode. It makes use of `async`/`await` and [`util.promisify`](https://nodejs.org/api/util.html#util_util_promisify_original). + +#### "sync" +> **Node.js:** >= 6.x
+> **Size (gzip):** 183 bytes
+> **Availability:** [CommonJS](https://unpkg.com/escalade/sync/index.js), [ES Module](https://unpkg.com/escalade/sync/index.mjs) + +This is the opt-in mode, ideal for scenarios where `async` usage cannot be supported. + + +## Usage + +***Example Structure*** + +``` +/Users/lukeed + └── oss + ├── license + └── escalade + ├── package.json + └── test + └── fixtures + ├── index.js + └── foobar + └── demo.js +``` + +***Example Usage*** + +```js +//~> demo.js +import { join } from 'path'; +import escalade from 'escalade'; + +const input = join(__dirname, 'demo.js'); +// or: const input = __dirname; + +const pkg = await escalade(input, (dir, names) => { + console.log('~> dir:', dir); + console.log('~> names:', names); + console.log('---'); + + if (names.includes('package.json')) { + // will be resolved into absolute + return 'package.json'; + } +}); + +//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar +//~> names: ['demo.js'] +//--- +//~> dir: /Users/lukeed/oss/escalade/test/fixtures +//~> names: ['index.js', 'foobar'] +//--- +//~> dir: /Users/lukeed/oss/escalade/test +//~> names: ['fixtures'] +//--- +//~> dir: /Users/lukeed/oss/escalade +//~> names: ['package.json', 'test'] +//--- + +console.log(pkg); +//=> /Users/lukeed/oss/escalade/package.json + +// Now search for "missing123.txt" +// (Assume it doesn't exist anywhere!) +const missing = await escalade(input, (dir, names) => { + console.log('~> dir:', dir); + return names.includes('missing123.txt') && 'missing123.txt'; +}); + +//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar +//~> dir: /Users/lukeed/oss/escalade/test/fixtures +//~> dir: /Users/lukeed/oss/escalade/test +//~> dir: /Users/lukeed/oss/escalade +//~> dir: /Users/lukeed/oss +//~> dir: /Users/lukeed +//~> dir: /Users +//~> dir: / + +console.log(missing); +//=> undefined +``` + +> **Note:** To run the above example with "sync" mode, import from `escalade/sync` and remove the `await` keyword. + + +## API + +### escalade(input, callback) +Returns: `string|void` or `Promise` + +When your `callback` locates a file, `escalade` will resolve/return with an absolute path.
+If your `callback` was never satisfied, then `escalade` will resolve/return with nothing (undefined). + +> **Important:**
The `sync` and `async` versions share the same API.
The **only** difference is that `sync` is not Promise-based. + +#### input +Type: `string` + +The path from which to start ascending. + +This may be a file or a directory path.
However, when `input` is a file, `escalade` will begin with its parent directory. + +> **Important:** Unless given an absolute path, `input` will be resolved from `process.cwd()` location. + +#### callback +Type: `Function` + +The callback to execute for each ancestry level. It always is given two arguments: + +1) `dir` - an absolute path of the current parent directory +2) `names` - a list (`string[]`) of contents _relative to_ the `dir` parent + +> **Note:** The `names` list can contain names of files _and_ directories. + +When your callback returns a _falsey_ value, then `escalade` will continue with `dir`'s parent directory, re-invoking your callback with new argument values. + +When your callback returns a string, then `escalade` stops iteration immediately.
+If the string is an absolute path, then it's left as is. Otherwise, the string is resolved into an absolute path _from_ the `dir` that housed the satisfying condition. + +> **Important:** Your `callback` can be a `Promise/AsyncFunction` when using the "async" version of `escalade`. + +## Benchmarks + +> Running on Node.js v10.13.0 + +``` +# Load Time + find-up 3.891ms + escalade 0.485ms + escalade/sync 0.309ms + +# Levels: 6 (target = "foo.txt"): + find-up x 24,856 ops/sec ±6.46% (55 runs sampled) + escalade x 73,084 ops/sec ±4.23% (73 runs sampled) + find-up.sync x 3,663 ops/sec ±1.12% (83 runs sampled) + escalade/sync x 9,360 ops/sec ±0.62% (88 runs sampled) + +# Levels: 12 (target = "package.json"): + find-up x 29,300 ops/sec ±10.68% (70 runs sampled) + escalade x 73,685 ops/sec ± 5.66% (66 runs sampled) + find-up.sync x 1,707 ops/sec ± 0.58% (91 runs sampled) + escalade/sync x 4,667 ops/sec ± 0.68% (94 runs sampled) + +# Levels: 18 (target = "missing123.txt"): + find-up x 21,818 ops/sec ±17.37% (14 runs sampled) + escalade x 67,101 ops/sec ±21.60% (20 runs sampled) + find-up.sync x 1,037 ops/sec ± 2.86% (88 runs sampled) + escalade/sync x 1,248 ops/sec ± 0.50% (93 runs sampled) +``` + +## Deno + +As of v3.1.0, `escalade` is available on the Deno registry. + +Please note that the [API](#api) is identical and that there are still [two modes](#modes) from which to choose: + +```ts +// Choose "async" mode +import escalade from 'https://deno.land/escalade/async.ts'; + +// Choose "sync" mode +import escalade from 'https://deno.land/escalade/sync.ts'; +``` + +> **Important:** The `allow-read` permission is required! + + +## Related + +- [premove](https://github.com/lukeed/premove) - A tiny (247B) utility to remove items recursively +- [totalist](https://github.com/lukeed/totalist) - A tiny (195B to 224B) utility to recursively list all (total) files in a directory +- [mk-dirs](https://github.com/lukeed/mk-dirs) - A tiny (420B) utility to make a directory and its parents, recursively + +## License + +MIT © [Luke Edwards](https://lukeed.com) diff --git a/node_modules/escalade/sync/index.d.mts b/node_modules/escalade/sync/index.d.mts new file mode 100644 index 0000000..c023d37 --- /dev/null +++ b/node_modules/escalade/sync/index.d.mts @@ -0,0 +1,9 @@ +export type Callback = ( + directory: string, + files: string[], +) => string | false | void; + +export default function ( + directory: string, + callback: Callback, +): string | void; diff --git a/node_modules/escalade/sync/index.d.ts b/node_modules/escalade/sync/index.d.ts new file mode 100644 index 0000000..9d5b589 --- /dev/null +++ b/node_modules/escalade/sync/index.d.ts @@ -0,0 +1,13 @@ +declare namespace escalade { + export type Callback = ( + directory: string, + files: string[], + ) => string | false | void; +} + +declare function escalade( + directory: string, + callback: escalade.Callback, +): string | void; + +export = escalade; diff --git a/node_modules/escalade/sync/index.js b/node_modules/escalade/sync/index.js new file mode 100644 index 0000000..902cc46 --- /dev/null +++ b/node_modules/escalade/sync/index.js @@ -0,0 +1,18 @@ +const { dirname, resolve } = require('path'); +const { readdirSync, statSync } = require('fs'); + +module.exports = function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = statSync(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = callback(dir, readdirSync(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/node_modules/escalade/sync/index.mjs b/node_modules/escalade/sync/index.mjs new file mode 100644 index 0000000..3cdc5bd --- /dev/null +++ b/node_modules/escalade/sync/index.mjs @@ -0,0 +1,18 @@ +import { dirname, resolve } from 'path'; +import { readdirSync, statSync } from 'fs'; + +export default function (start, callback) { + let dir = resolve('.', start); + let tmp, stats = statSync(dir); + + if (!stats.isDirectory()) { + dir = dirname(dir); + } + + while (true) { + tmp = callback(dir, readdirSync(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname(tmp = dir); + if (tmp === dir) break; + } +} diff --git a/node_modules/escape-html/LICENSE b/node_modules/escape-html/LICENSE new file mode 100644 index 0000000..2e70de9 --- /dev/null +++ b/node_modules/escape-html/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2013 TJ Holowaychuk +Copyright (c) 2015 Andreas Lubbe +Copyright (c) 2015 Tiancheng "Timothy" Gu + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/escape-html/Readme.md b/node_modules/escape-html/Readme.md new file mode 100644 index 0000000..653d9ea --- /dev/null +++ b/node_modules/escape-html/Readme.md @@ -0,0 +1,43 @@ + +# escape-html + + Escape string for use in HTML + +## Example + +```js +var escape = require('escape-html'); +var html = escape('foo & bar'); +// -> foo & bar +``` + +## Benchmark + +``` +$ npm run-script bench + +> escape-html@1.0.3 bench nodejs-escape-html +> node benchmark/index.js + + + http_parser@1.0 + node@0.10.33 + v8@3.14.5.9 + ares@1.9.0-DEV + uv@0.10.29 + zlib@1.2.3 + modules@11 + openssl@1.0.1j + + 1 test completed. + 2 tests completed. + 3 tests completed. + + no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) + single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) + many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) +``` + +## License + + MIT \ No newline at end of file diff --git a/node_modules/escape-html/index.js b/node_modules/escape-html/index.js new file mode 100644 index 0000000..bf9e226 --- /dev/null +++ b/node_modules/escape-html/index.js @@ -0,0 +1,78 @@ +/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */ + +'use strict'; + +/** + * Module variables. + * @private + */ + +var matchHtmlRegExp = /["'&<>]/; + +/** + * Module exports. + * @public + */ + +module.exports = escapeHtml; + +/** + * Escape special characters in the given string of html. + * + * @param {string} string The string to escape for inserting into HTML + * @return {string} + * @public + */ + +function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; + } + + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; + + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } + + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; + } + + return lastIndex !== index + ? html + str.substring(lastIndex, index) + : html; +} diff --git a/node_modules/escape-html/package.json b/node_modules/escape-html/package.json new file mode 100644 index 0000000..57ec7bd --- /dev/null +++ b/node_modules/escape-html/package.json @@ -0,0 +1,24 @@ +{ + "name": "escape-html", + "description": "Escape string for use in HTML", + "version": "1.0.3", + "license": "MIT", + "keywords": [ + "escape", + "html", + "utility" + ], + "repository": "component/escape-html", + "devDependencies": { + "benchmark": "1.0.0", + "beautify-benchmark": "0.2.4" + }, + "files": [ + "LICENSE", + "Readme.md", + "index.js" + ], + "scripts": { + "bench": "node benchmark/index.js" + } +} diff --git a/node_modules/escape-string-regexp/index.d.ts b/node_modules/escape-string-regexp/index.d.ts new file mode 100644 index 0000000..7d34edc --- /dev/null +++ b/node_modules/escape-string-regexp/index.d.ts @@ -0,0 +1,18 @@ +/** +Escape RegExp special characters. + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +@example +``` +import escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` +*/ +declare const escapeStringRegexp: (string: string) => string; + +export = escapeStringRegexp; diff --git a/node_modules/escape-string-regexp/index.js b/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000..387c561 --- /dev/null +++ b/node_modules/escape-string-regexp/index.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = string => { + if (typeof string !== 'string') { + throw new TypeError('Expected a string'); + } + + // Escape characters with special meaning either inside or outside character sets. + // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar. + return string + .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&') + .replace(/-/g, '\\x2d'); +}; diff --git a/node_modules/escape-string-regexp/license b/node_modules/escape-string-regexp/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/escape-string-regexp/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/escape-string-regexp/package.json b/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000..c6eb4a9 --- /dev/null +++ b/node_modules/escape-string-regexp/package.json @@ -0,0 +1,38 @@ +{ + "name": "escape-string-regexp", + "version": "4.0.0", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": "sindresorhus/escape-string-regexp", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "escape", + "regex", + "regexp", + "regular", + "expression", + "string", + "special", + "characters" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.11.0", + "xo": "^0.28.3" + } +} diff --git a/node_modules/escape-string-regexp/readme.md b/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000..2945dfc --- /dev/null +++ b/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,34 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + +## Install + +``` +$ npm install escape-string-regexp +``` + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('How much $ for a 🦄?'); +//=> 'How much \\$ for a 🦄\\?' + +new RegExp(escapedString); +``` + +You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/esprima/ChangeLog b/node_modules/esprima/ChangeLog new file mode 100644 index 0000000..fafe1c9 --- /dev/null +++ b/node_modules/esprima/ChangeLog @@ -0,0 +1,235 @@ +2018-06-17: Version 4.0.1 + + * Fix parsing async get/set in a class (issue 1861, 1875) + * Account for different return statement argument (issue 1829, 1897, 1928) + * Correct the handling of HTML comment when parsing a module (issue 1841) + * Fix incorrect parse async with proto-identifier-shorthand (issue 1847) + * Fix negative column in binary expression (issue 1844) + * Fix incorrect YieldExpression in object methods (issue 1834) + * Various documentation fixes + +2017-06-10: Version 4.0.0 + + * Support ES2017 async function and await expression (issue 1079) + * Support ES2017 trailing commas in function parameters (issue 1550) + * Explicitly distinguish parsing a module vs a script (issue 1576) + * Fix JSX non-empty container (issue 1786) + * Allow JSX element in a yield expression (issue 1765) + * Allow `in` expression in a concise body with a function body (issue 1793) + * Setter function argument must not be a rest parameter (issue 1693) + * Limit strict mode directive to functions with a simple parameter list (issue 1677) + * Prohibit any escape sequence in a reserved word (issue 1612) + * Only permit hex digits in hex escape sequence (issue 1619) + * Prohibit labelled class/generator/function declaration (issue 1484) + * Limit function declaration as if statement clause only in non-strict mode (issue 1657) + * Tolerate missing ) in a with and do-while statement (issue 1481) + +2016-12-22: Version 3.1.3 + + * Support binding patterns as rest element (issue 1681) + * Account for different possible arguments of a yield expression (issue 1469) + +2016-11-24: Version 3.1.2 + + * Ensure that import specifier is more restrictive (issue 1615) + * Fix duplicated JSX tokens (issue 1613) + * Scan template literal in a JSX expression container (issue 1622) + * Improve XHTML entity scanning in JSX (issue 1629) + +2016-10-31: Version 3.1.1 + + * Fix assignment expression problem in an export declaration (issue 1596) + * Fix incorrect tokenization of hex digits (issue 1605) + +2016-10-09: Version 3.1.0 + + * Do not implicitly collect comments when comment attachment is specified (issue 1553) + * Fix incorrect handling of duplicated proto shorthand fields (issue 1485) + * Prohibit initialization in some variants of for statements (issue 1309, 1561) + * Fix incorrect parsing of export specifier (issue 1578) + * Fix ESTree compatibility for assignment pattern (issue 1575) + +2016-09-03: Version 3.0.0 + + * Support ES2016 exponentiation expression (issue 1490) + * Support JSX syntax (issue 1467) + * Use the latest Unicode 8.0 (issue 1475) + * Add the support for syntax node delegate (issue 1435) + * Fix ESTree compatibility on meta property (issue 1338) + * Fix ESTree compatibility on default parameter value (issue 1081) + * Fix ESTree compatibility on try handler (issue 1030) + +2016-08-23: Version 2.7.3 + + * Fix tokenizer confusion with a comment (issue 1493, 1516) + +2016-02-02: Version 2.7.2 + + * Fix out-of-bound error location in an invalid string literal (issue 1457) + * Fix shorthand object destructuring defaults in variable declarations (issue 1459) + +2015-12-10: Version 2.7.1 + + * Do not allow trailing comma in a variable declaration (issue 1360) + * Fix assignment to `let` in non-strict mode (issue 1376) + * Fix missing delegate property in YieldExpression (issue 1407) + +2015-10-22: Version 2.7.0 + + * Fix the handling of semicolon in a break statement (issue 1044) + * Run the test suite with major web browsers (issue 1259, 1317) + * Allow `let` as an identifier in non-strict mode (issue 1289) + * Attach orphaned comments as `innerComments` (issue 1328) + * Add the support for token delegator (issue 1332) + +2015-09-01: Version 2.6.0 + + * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) + * Add sourceType field for Program node (issue 1159) + * Ensure that strict mode reserved word binding throw an error (issue 1171) + * Run the test suite with Node.js and IE 11 on Windows (issue 1294) + * Allow binding pattern with no initializer in a for statement (issue 1301) + +2015-07-31: Version 2.5.0 + + * Run the test suite in a browser environment (issue 1004) + * Ensure a comma between imported default binding and named imports (issue 1046) + * Distinguish `yield` as a keyword vs an identifier (issue 1186) + * Support ES6 meta property `new.target` (issue 1203) + * Fix the syntax node for yield with expression (issue 1223) + * Fix the check of duplicated proto in property names (issue 1225) + * Fix ES6 Unicode escape in identifier name (issue 1229) + * Support ES6 IdentifierStart and IdentifierPart (issue 1232) + * Treat await as a reserved word when parsing as a module (issue 1234) + * Recognize identifier characters from Unicode SMP (issue 1244) + * Ensure that export and import can be followed by a comma (issue 1250) + * Fix yield operator precedence (issue 1262) + +2015-07-01: Version 2.4.1 + + * Fix some cases of comment attachment (issue 1071, 1175) + * Fix the handling of destructuring in function arguments (issue 1193) + * Fix invalid ranges in assignment expression (issue 1201) + +2015-06-26: Version 2.4.0 + + * Support ES6 for-of iteration (issue 1047) + * Support ES6 spread arguments (issue 1169) + * Minimize npm payload (issue 1191) + +2015-06-16: Version 2.3.0 + + * Support ES6 generator (issue 1033) + * Improve parsing of regular expressions with `u` flag (issue 1179) + +2015-04-17: Version 2.2.0 + + * Support ES6 import and export declarations (issue 1000) + * Fix line terminator before arrow not recognized as error (issue 1009) + * Support ES6 destructuring (issue 1045) + * Support ES6 template literal (issue 1074) + * Fix the handling of invalid/incomplete string escape sequences (issue 1106) + * Fix ES3 static member access restriction (issue 1120) + * Support for `super` in ES6 class (issue 1147) + +2015-03-09: Version 2.1.0 + + * Support ES6 class (issue 1001) + * Support ES6 rest parameter (issue 1011) + * Expand the location of property getter, setter, and methods (issue 1029) + * Enable TryStatement transition to a single handler (issue 1031) + * Support ES6 computed property name (issue 1037) + * Tolerate unclosed block comment (issue 1041) + * Support ES6 lexical declaration (issue 1065) + +2015-02-06: Version 2.0.0 + + * Support ES6 arrow function (issue 517) + * Support ES6 Unicode code point escape (issue 521) + * Improve the speed and accuracy of comment attachment (issue 522) + * Support ES6 default parameter (issue 519) + * Support ES6 regular expression flags (issue 557) + * Fix scanning of implicit octal literals (issue 565) + * Fix the handling of automatic semicolon insertion (issue 574) + * Support ES6 method definition (issue 620) + * Support ES6 octal integer literal (issue 621) + * Support ES6 binary integer literal (issue 622) + * Support ES6 object literal property value shorthand (issue 624) + +2015-03-03: Version 1.2.5 + + * Fix scanning of implicit octal literals (issue 565) + +2015-02-05: Version 1.2.4 + + * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) + * Fix the handling of automatic semicolon insertion (issue 574) + +2015-01-18: Version 1.2.3 + + * Fix division by this (issue 616) + +2014-05-18: Version 1.2.2 + + * Fix duplicated tokens when collecting comments (issue 537) + +2014-05-04: Version 1.2.1 + + * Ensure that Program node may still have leading comments (issue 536) + +2014-04-29: Version 1.2.0 + + * Fix semicolon handling for expression statement (issue 462, 533) + * Disallow escaped characters in regular expression flags (issue 503) + * Performance improvement for location tracking (issue 520) + * Improve the speed of comment attachment (issue 522) + +2014-03-26: Version 1.1.1 + + * Fix token handling of forward slash after an array literal (issue 512) + +2014-03-23: Version 1.1.0 + + * Optionally attach comments to the owning syntax nodes (issue 197) + * Simplify binary parsing with stack-based shift reduce (issue 352) + * Always include the raw source of literals (issue 376) + * Add optional input source information (issue 386) + * Tokenizer API for pure lexical scanning (issue 398) + * Improve the web site and its online demos (issue 337, 400, 404) + * Performance improvement for location tracking (issue 417, 424) + * Support HTML comment syntax (issue 451) + * Drop support for legacy browsers (issue 474) + +2013-08-27: Version 1.0.4 + + * Minimize the payload for packages (issue 362) + * Fix missing cases on an empty switch statement (issue 436) + * Support escaped ] in regexp literal character classes (issue 442) + * Tolerate invalid left-hand side expression (issue 130) + +2013-05-17: Version 1.0.3 + + * Variable declaration needs at least one declarator (issue 391) + * Fix benchmark's variance unit conversion (issue 397) + * IE < 9: \v should be treated as vertical tab (issue 405) + * Unary expressions should always have prefix: true (issue 418) + * Catch clause should only accept an identifier (issue 423) + * Tolerate setters without parameter (issue 426) + +2012-11-02: Version 1.0.2 + + Improvement: + + * Fix esvalidate JUnit output upon a syntax error (issue 374) + +2012-10-28: Version 1.0.1 + + Improvements: + + * esvalidate understands shebang in a Unix shell script (issue 361) + * esvalidate treats fatal parsing failure as an error (issue 361) + * Reduce Node.js package via .npmignore (issue 362) + +2012-10-22: Version 1.0.0 + + Initial release. diff --git a/node_modules/esprima/LICENSE.BSD b/node_modules/esprima/LICENSE.BSD new file mode 100644 index 0000000..7a55160 --- /dev/null +++ b/node_modules/esprima/LICENSE.BSD @@ -0,0 +1,21 @@ +Copyright JS Foundation and other contributors, https://js.foundation/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/esprima/README.md b/node_modules/esprima/README.md new file mode 100644 index 0000000..8fb25e6 --- /dev/null +++ b/node_modules/esprima/README.md @@ -0,0 +1,46 @@ +[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) +[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) +[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) +[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) + +**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, +standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +parser written in ECMAScript (also popularly known as +[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). +Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), +with the help of [many contributors](https://github.com/jquery/esprima/contributors). + +### Features + +- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) +- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) +- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) +- Optional tracking of syntax node location (index-based and line-column) +- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) + +### API + +Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. + +A simple example on Node.js REPL: + +```javascript +> var esprima = require('esprima'); +> var program = 'const answer = 42'; + +> esprima.tokenize(program); +[ { type: 'Keyword', value: 'const' }, + { type: 'Identifier', value: 'answer' }, + { type: 'Punctuator', value: '=' }, + { type: 'Numeric', value: '42' } ] + +> esprima.parseScript(program); +{ type: 'Program', + body: + [ { type: 'VariableDeclaration', + declarations: [Object], + kind: 'const' } ], + sourceType: 'script' } +``` + +For more information, please read the [complete documentation](http://esprima.org/doc). \ No newline at end of file diff --git a/node_modules/esprima/bin/esparse.js b/node_modules/esprima/bin/esparse.js new file mode 100644 index 0000000..45d05fb --- /dev/null +++ b/node_modules/esprima/bin/esparse.js @@ -0,0 +1,139 @@ +#!/usr/bin/env node +/* + Copyright JS Foundation and other contributors, https://js.foundation/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true node:true rhino:true */ + +var fs, esprima, fname, forceFile, content, options, syntax; + +if (typeof require === 'function') { + fs = require('fs'); + try { + esprima = require('esprima'); + } catch (e) { + esprima = require('../'); + } +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esparse.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esparse [options] [file.js]'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --comment Gather all line and block comments in an array'); + console.log(' --loc Include line-column location info for each syntax node'); + console.log(' --range Include index-based range for each syntax node'); + console.log(' --raw Display the raw value of literals'); + console.log(' --tokens List all tokens in an array'); + console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); + console.log(' -v, --version Shows program version'); + console.log(); + process.exit(1); +} + +options = {}; + +process.argv.splice(2).forEach(function (entry) { + + if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { + if (typeof fname === 'string') { + console.log('Error: more than one input file.'); + process.exit(1); + } else { + fname = entry; + } + } else if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry === '--comment') { + options.comment = true; + } else if (entry === '--loc') { + options.loc = true; + } else if (entry === '--range') { + options.range = true; + } else if (entry === '--raw') { + options.raw = true; + } else if (entry === '--tokens') { + options.tokens = true; + } else if (entry === '--tolerant') { + options.tolerant = true; + } else if (entry === '--') { + forceFile = true; + } else { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } +}); + +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + +function run(content) { + syntax = esprima.parse(content, options); + console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); +} + +try { + if (fname && (fname !== '-' || forceFile)) { + run(fs.readFileSync(fname, 'utf-8')); + } else { + var content = ''; + process.stdin.resume(); + process.stdin.on('data', function(chunk) { + content += chunk; + }); + process.stdin.on('end', function() { + run(content); + }); + } +} catch (e) { + console.log('Error: ' + e.message); + process.exit(1); +} diff --git a/node_modules/esprima/bin/esvalidate.js b/node_modules/esprima/bin/esvalidate.js new file mode 100644 index 0000000..d49a7e4 --- /dev/null +++ b/node_modules/esprima/bin/esvalidate.js @@ -0,0 +1,236 @@ +#!/usr/bin/env node +/* + Copyright JS Foundation and other contributors, https://js.foundation/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true plusplus:true node:true rhino:true */ +/*global phantom:true */ + +var fs, system, esprima, options, fnames, forceFile, count; + +if (typeof esprima === 'undefined') { + // PhantomJS can only require() relative files + if (typeof phantom === 'object') { + fs = require('fs'); + system = require('system'); + esprima = require('./esprima'); + } else if (typeof require === 'function') { + fs = require('fs'); + try { + esprima = require('esprima'); + } catch (e) { + esprima = require('../'); + } + } else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } + } +} + +// Shims to Node.js objects when running under PhantomJS 1.7+. +if (typeof phantom === 'object') { + fs.readFileSync = fs.read; + process = { + argv: [].slice.call(system.args), + exit: phantom.exit, + on: function (evt, callback) { + callback(); + } + }; + process.argv.unshift('phantomjs'); +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { + argv: arguments, + exit: quit, + on: function (evt, callback) { + callback(); + } + }; + process.argv.unshift('esvalidate.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esvalidate [options] [file.js...]'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --format=type Set the report format, plain (default) or junit'); + console.log(' -v, --version Print program version'); + console.log(); + process.exit(1); +} + +options = { + format: 'plain' +}; + +fnames = []; + +process.argv.splice(2).forEach(function (entry) { + + if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { + fnames.push(entry); + } else if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry.slice(0, 9) === '--format=') { + options.format = entry.slice(9); + if (options.format !== 'plain' && options.format !== 'junit') { + console.log('Error: unknown report format ' + options.format + '.'); + process.exit(1); + } + } else if (entry === '--') { + forceFile = true; + } else { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } +}); + +if (fnames.length === 0) { + fnames.push(''); +} + +if (options.format === 'junit') { + console.log(''); + console.log(''); +} + +count = 0; + +function run(fname, content) { + var timestamp, syntax, name; + try { + if (typeof content !== 'string') { + throw content; + } + + if (content[0] === '#' && content[1] === '!') { + content = '//' + content.substr(2, content.length); + } + + timestamp = Date.now(); + syntax = esprima.parse(content, { tolerant: true }); + + if (options.format === 'junit') { + + name = fname; + if (name.lastIndexOf('/') >= 0) { + name = name.slice(name.lastIndexOf('/') + 1); + } + + console.log(''); + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + console.log(' '); + console.log(' ' + + error.message + '(' + name + ':' + error.lineNumber + ')' + + ''); + console.log(' '); + }); + + console.log(''); + + } else if (options.format === 'plain') { + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + msg = fname + ':' + error.lineNumber + ': ' + msg; + console.log(msg); + ++count; + }); + + } + } catch (e) { + ++count; + if (options.format === 'junit') { + console.log(''); + console.log(' '); + console.log(' ' + + e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + + ')'); + console.log(' '); + console.log(''); + } else { + console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, '')); + } + } +} + +fnames.forEach(function (fname) { + var content = ''; + try { + if (fname && (fname !== '-' || forceFile)) { + content = fs.readFileSync(fname, 'utf-8'); + } else { + fname = ''; + process.stdin.resume(); + process.stdin.on('data', function(chunk) { + content += chunk; + }); + process.stdin.on('end', function() { + run(fname, content); + }); + return; + } + } catch (e) { + content = e; + } + run(fname, content); +}); + +process.on('exit', function () { + if (options.format === 'junit') { + console.log(''); + } + + if (count > 0) { + process.exit(1); + } + + if (count === 0 && typeof phantom === 'object') { + process.exit(0); + } +}); diff --git a/node_modules/esprima/dist/esprima.js b/node_modules/esprima/dist/esprima.js new file mode 100644 index 0000000..2af3eee --- /dev/null +++ b/node_modules/esprima/dist/esprima.js @@ -0,0 +1,6709 @@ +(function webpackUniversalModuleDefinition(root, factory) { +/* istanbul ignore next */ + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); +/* istanbul ignore next */ + else if(typeof exports === 'object') + exports["esprima"] = factory(); + else + root["esprima"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/* istanbul ignore if */ +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + /* + Copyright JS Foundation and other contributors, https://js.foundation/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + Object.defineProperty(exports, "__esModule", { value: true }); + var comment_handler_1 = __webpack_require__(1); + var jsx_parser_1 = __webpack_require__(3); + var parser_1 = __webpack_require__(8); + var tokenizer_1 = __webpack_require__(15); + function parse(code, options, delegate) { + var commentHandler = null; + var proxyDelegate = function (node, metadata) { + if (delegate) { + delegate(node, metadata); + } + if (commentHandler) { + commentHandler.visit(node, metadata); + } + }; + var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; + var collectComment = false; + if (options) { + collectComment = (typeof options.comment === 'boolean' && options.comment); + var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); + if (collectComment || attachComment) { + commentHandler = new comment_handler_1.CommentHandler(); + commentHandler.attach = attachComment; + options.comment = true; + parserDelegate = proxyDelegate; + } + } + var isModule = false; + if (options && typeof options.sourceType === 'string') { + isModule = (options.sourceType === 'module'); + } + var parser; + if (options && typeof options.jsx === 'boolean' && options.jsx) { + parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); + } + else { + parser = new parser_1.Parser(code, options, parserDelegate); + } + var program = isModule ? parser.parseModule() : parser.parseScript(); + var ast = program; + if (collectComment && commentHandler) { + ast.comments = commentHandler.comments; + } + if (parser.config.tokens) { + ast.tokens = parser.tokens; + } + if (parser.config.tolerant) { + ast.errors = parser.errorHandler.errors; + } + return ast; + } + exports.parse = parse; + function parseModule(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'module'; + return parse(code, parsingOptions, delegate); + } + exports.parseModule = parseModule; + function parseScript(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'script'; + return parse(code, parsingOptions, delegate); + } + exports.parseScript = parseScript; + function tokenize(code, options, delegate) { + var tokenizer = new tokenizer_1.Tokenizer(code, options); + var tokens; + tokens = []; + try { + while (true) { + var token = tokenizer.getNextToken(); + if (!token) { + break; + } + if (delegate) { + token = delegate(token); + } + tokens.push(token); + } + } + catch (e) { + tokenizer.errorHandler.tolerate(e); + } + if (tokenizer.errorHandler.tolerant) { + tokens.errors = tokenizer.errors(); + } + return tokens; + } + exports.tokenize = tokenize; + var syntax_1 = __webpack_require__(2); + exports.Syntax = syntax_1.Syntax; + // Sync with *.json manifests. + exports.version = '4.0.1'; + + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + var CommentHandler = (function () { + function CommentHandler() { + this.attach = false; + this.comments = []; + this.stack = []; + this.leading = []; + this.trailing = []; + } + CommentHandler.prototype.insertInnerComments = function (node, metadata) { + // innnerComments for properties empty block + // `function a() {/** comments **\/}` + if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { + var innerComments = []; + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (metadata.end.offset >= entry.start) { + innerComments.unshift(entry.comment); + this.leading.splice(i, 1); + this.trailing.splice(i, 1); + } + } + if (innerComments.length) { + node.innerComments = innerComments; + } + } + }; + CommentHandler.prototype.findTrailingComments = function (metadata) { + var trailingComments = []; + if (this.trailing.length > 0) { + for (var i = this.trailing.length - 1; i >= 0; --i) { + var entry_1 = this.trailing[i]; + if (entry_1.start >= metadata.end.offset) { + trailingComments.unshift(entry_1.comment); + } + } + this.trailing.length = 0; + return trailingComments; + } + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.node.trailingComments) { + var firstComment = entry.node.trailingComments[0]; + if (firstComment && firstComment.range[0] >= metadata.end.offset) { + trailingComments = entry.node.trailingComments; + delete entry.node.trailingComments; + } + } + return trailingComments; + }; + CommentHandler.prototype.findLeadingComments = function (metadata) { + var leadingComments = []; + var target; + while (this.stack.length > 0) { + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.start >= metadata.start.offset) { + target = entry.node; + this.stack.pop(); + } + else { + break; + } + } + if (target) { + var count = target.leadingComments ? target.leadingComments.length : 0; + for (var i = count - 1; i >= 0; --i) { + var comment = target.leadingComments[i]; + if (comment.range[1] <= metadata.start.offset) { + leadingComments.unshift(comment); + target.leadingComments.splice(i, 1); + } + } + if (target.leadingComments && target.leadingComments.length === 0) { + delete target.leadingComments; + } + return leadingComments; + } + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (entry.start <= metadata.start.offset) { + leadingComments.unshift(entry.comment); + this.leading.splice(i, 1); + } + } + return leadingComments; + }; + CommentHandler.prototype.visitNode = function (node, metadata) { + if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { + return; + } + this.insertInnerComments(node, metadata); + var trailingComments = this.findTrailingComments(metadata); + var leadingComments = this.findLeadingComments(metadata); + if (leadingComments.length > 0) { + node.leadingComments = leadingComments; + } + if (trailingComments.length > 0) { + node.trailingComments = trailingComments; + } + this.stack.push({ + node: node, + start: metadata.start.offset + }); + }; + CommentHandler.prototype.visitComment = function (node, metadata) { + var type = (node.type[0] === 'L') ? 'Line' : 'Block'; + var comment = { + type: type, + value: node.value + }; + if (node.range) { + comment.range = node.range; + } + if (node.loc) { + comment.loc = node.loc; + } + this.comments.push(comment); + if (this.attach) { + var entry = { + comment: { + type: type, + value: node.value, + range: [metadata.start.offset, metadata.end.offset] + }, + start: metadata.start.offset + }; + if (node.loc) { + entry.comment.loc = node.loc; + } + node.type = type; + this.leading.push(entry); + this.trailing.push(entry); + } + }; + CommentHandler.prototype.visit = function (node, metadata) { + if (node.type === 'LineComment') { + this.visitComment(node, metadata); + } + else if (node.type === 'BlockComment') { + this.visitComment(node, metadata); + } + else if (this.attach) { + this.visitNode(node, metadata); + } + }; + return CommentHandler; + }()); + exports.CommentHandler = CommentHandler; + + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForOfStatement: 'ForOfStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchCase: 'SwitchCase', + SwitchStatement: 'SwitchStatement', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; +/* istanbul ignore next */ + var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + var character_1 = __webpack_require__(4); + var JSXNode = __webpack_require__(5); + var jsx_syntax_1 = __webpack_require__(6); + var Node = __webpack_require__(7); + var parser_1 = __webpack_require__(8); + var token_1 = __webpack_require__(13); + var xhtml_entities_1 = __webpack_require__(14); + token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; + token_1.TokenName[101 /* Text */] = 'JSXText'; + // Fully qualified element name, e.g. returns "svg:path" + function getQualifiedElementName(elementName) { + var qualifiedName; + switch (elementName.type) { + case jsx_syntax_1.JSXSyntax.JSXIdentifier: + var id = elementName; + qualifiedName = id.name; + break; + case jsx_syntax_1.JSXSyntax.JSXNamespacedName: + var ns = elementName; + qualifiedName = getQualifiedElementName(ns.namespace) + ':' + + getQualifiedElementName(ns.name); + break; + case jsx_syntax_1.JSXSyntax.JSXMemberExpression: + var expr = elementName; + qualifiedName = getQualifiedElementName(expr.object) + '.' + + getQualifiedElementName(expr.property); + break; + /* istanbul ignore next */ + default: + break; + } + return qualifiedName; + } + var JSXParser = (function (_super) { + __extends(JSXParser, _super); + function JSXParser(code, options, delegate) { + return _super.call(this, code, options, delegate) || this; + } + JSXParser.prototype.parsePrimaryExpression = function () { + return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); + }; + JSXParser.prototype.startJSX = function () { + // Unwind the scanner before the lookahead token. + this.scanner.index = this.startMarker.index; + this.scanner.lineNumber = this.startMarker.line; + this.scanner.lineStart = this.startMarker.index - this.startMarker.column; + }; + JSXParser.prototype.finishJSX = function () { + // Prime the next lookahead. + this.nextToken(); + }; + JSXParser.prototype.reenterJSX = function () { + this.startJSX(); + this.expectJSX('}'); + // Pop the closing '}' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + }; + JSXParser.prototype.createJSXNode = function () { + this.collectComments(); + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.createJSXChildNode = function () { + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.scanXHTMLEntity = function (quote) { + var result = '&'; + var valid = true; + var terminated = false; + var numeric = false; + var hex = false; + while (!this.scanner.eof() && valid && !terminated) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === quote) { + break; + } + terminated = (ch === ';'); + result += ch; + ++this.scanner.index; + if (!terminated) { + switch (result.length) { + case 2: + // e.g. '{' + numeric = (ch === '#'); + break; + case 3: + if (numeric) { + // e.g. 'A' + hex = (ch === 'x'); + valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); + numeric = numeric && !hex; + } + break; + default: + valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); + valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); + break; + } + } + } + if (valid && terminated && result.length > 2) { + // e.g. 'A' becomes just '#x41' + var str = result.substr(1, result.length - 2); + if (numeric && str.length > 1) { + result = String.fromCharCode(parseInt(str.substr(1), 10)); + } + else if (hex && str.length > 2) { + result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); + } + else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { + result = xhtml_entities_1.XHTMLEntities[str]; + } + } + return result; + }; + // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. + JSXParser.prototype.lexJSX = function () { + var cp = this.scanner.source.charCodeAt(this.scanner.index); + // < > / : = { } + if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { + var value = this.scanner.source[this.scanner.index++]; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index - 1, + end: this.scanner.index + }; + } + // " ' + if (cp === 34 || cp === 39) { + var start = this.scanner.index; + var quote = this.scanner.source[this.scanner.index++]; + var str = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index++]; + if (ch === quote) { + break; + } + else if (ch === '&') { + str += this.scanXHTMLEntity(quote); + } + else { + str += ch; + } + } + return { + type: 8 /* StringLiteral */, + value: str, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ... or . + if (cp === 46) { + var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); + var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); + var value = (n1 === 46 && n2 === 46) ? '...' : '.'; + var start = this.scanner.index; + this.scanner.index += value.length; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ` + if (cp === 96) { + // Only placeholder, since it will be rescanned as a real assignment expression. + return { + type: 10 /* Template */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index, + end: this.scanner.index + }; + } + // Identifer can not contain backslash (char code 92). + if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { + var start = this.scanner.index; + ++this.scanner.index; + while (!this.scanner.eof()) { + var ch = this.scanner.source.charCodeAt(this.scanner.index); + if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { + ++this.scanner.index; + } + else if (ch === 45) { + // Hyphen (char code 45) can be part of an identifier. + ++this.scanner.index; + } + else { + break; + } + } + var id = this.scanner.source.slice(start, this.scanner.index); + return { + type: 100 /* Identifier */, + value: id, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + return this.scanner.lex(); + }; + JSXParser.prototype.nextJSXToken = function () { + this.collectComments(); + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var token = this.lexJSX(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + if (this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.nextJSXText = function () { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var start = this.scanner.index; + var text = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === '{' || ch === '<') { + break; + } + ++this.scanner.index; + text += ch; + if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + ++this.scanner.lineNumber; + if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { + ++this.scanner.index; + } + this.scanner.lineStart = this.scanner.index; + } + } + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + var token = { + type: 101 /* Text */, + value: text, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + if ((text.length > 0) && this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.peekJSXToken = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.lexJSX(); + this.scanner.restoreState(state); + return next; + }; + // Expect the next JSX token to match the specified punctuator. + // If not, an exception will be thrown. + JSXParser.prototype.expectJSX = function (value) { + var token = this.nextJSXToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next JSX token matches the specified punctuator. + JSXParser.prototype.matchJSX = function (value) { + var next = this.peekJSXToken(); + return next.type === 7 /* Punctuator */ && next.value === value; + }; + JSXParser.prototype.parseJSXIdentifier = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 100 /* Identifier */) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); + }; + JSXParser.prototype.parseJSXElementName = function () { + var node = this.createJSXNode(); + var elementName = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = elementName; + this.expectJSX(':'); + var name_1 = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); + } + else if (this.matchJSX('.')) { + while (this.matchJSX('.')) { + var object = elementName; + this.expectJSX('.'); + var property = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); + } + } + return elementName; + }; + JSXParser.prototype.parseJSXAttributeName = function () { + var node = this.createJSXNode(); + var attributeName; + var identifier = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = identifier; + this.expectJSX(':'); + var name_2 = this.parseJSXIdentifier(); + attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); + } + else { + attributeName = identifier; + } + return attributeName; + }; + JSXParser.prototype.parseJSXStringLiteralAttribute = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 8 /* StringLiteral */) { + this.throwUnexpectedToken(token); + } + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + JSXParser.prototype.parseJSXExpressionAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.finishJSX(); + if (this.match('}')) { + this.tolerateError('JSX attributes must only be assigned a non-empty expression'); + } + var expression = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXAttributeValue = function () { + return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : + this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); + }; + JSXParser.prototype.parseJSXNameValueAttribute = function () { + var node = this.createJSXNode(); + var name = this.parseJSXAttributeName(); + var value = null; + if (this.matchJSX('=')) { + this.expectJSX('='); + value = this.parseJSXAttributeValue(); + } + return this.finalize(node, new JSXNode.JSXAttribute(name, value)); + }; + JSXParser.prototype.parseJSXSpreadAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.expectJSX('...'); + this.finishJSX(); + var argument = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); + }; + JSXParser.prototype.parseJSXAttributes = function () { + var attributes = []; + while (!this.matchJSX('/') && !this.matchJSX('>')) { + var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : + this.parseJSXNameValueAttribute(); + attributes.push(attribute); + } + return attributes; + }; + JSXParser.prototype.parseJSXOpeningElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXBoundaryElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + if (this.matchJSX('/')) { + this.expectJSX('/'); + var name_3 = this.parseJSXElementName(); + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); + } + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXEmptyExpression = function () { + var node = this.createJSXChildNode(); + this.collectComments(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + return this.finalize(node, new JSXNode.JSXEmptyExpression()); + }; + JSXParser.prototype.parseJSXExpressionContainer = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + var expression; + if (this.matchJSX('}')) { + expression = this.parseJSXEmptyExpression(); + this.expectJSX('}'); + } + else { + this.finishJSX(); + expression = this.parseAssignmentExpression(); + this.reenterJSX(); + } + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXChildren = function () { + var children = []; + while (!this.scanner.eof()) { + var node = this.createJSXChildNode(); + var token = this.nextJSXText(); + if (token.start < token.end) { + var raw = this.getTokenRaw(token); + var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); + children.push(child); + } + if (this.scanner.source[this.scanner.index] === '{') { + var container = this.parseJSXExpressionContainer(); + children.push(container); + } + else { + break; + } + } + return children; + }; + JSXParser.prototype.parseComplexJSXElement = function (el) { + var stack = []; + while (!this.scanner.eof()) { + el.children = el.children.concat(this.parseJSXChildren()); + var node = this.createJSXChildNode(); + var element = this.parseJSXBoundaryElement(); + if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { + var opening = element; + if (opening.selfClosing) { + var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); + el.children.push(child); + } + else { + stack.push(el); + el = { node: node, opening: opening, closing: null, children: [] }; + } + } + if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { + el.closing = element; + var open_1 = getQualifiedElementName(el.opening.name); + var close_1 = getQualifiedElementName(el.closing.name); + if (open_1 !== close_1) { + this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); + } + if (stack.length > 0) { + var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); + el = stack[stack.length - 1]; + el.children.push(child); + stack.pop(); + } + else { + break; + } + } + } + return el; + }; + JSXParser.prototype.parseJSXElement = function () { + var node = this.createJSXNode(); + var opening = this.parseJSXOpeningElement(); + var children = []; + var closing = null; + if (!opening.selfClosing) { + var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); + children = el.children; + closing = el.closing; + } + return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); + }; + JSXParser.prototype.parseJSXRoot = function () { + // Pop the opening '<' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + this.startJSX(); + var element = this.parseJSXElement(); + this.finishJSX(); + return element; + }; + JSXParser.prototype.isStartOfExpression = function () { + return _super.prototype.isStartOfExpression.call(this) || this.match('<'); + }; + return JSXParser; + }(parser_1.Parser)); + exports.JSXParser = JSXParser; + + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // See also tools/generate-unicode-regex.js. + var Regex = { + // Unicode v8.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // Unicode v8.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0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\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD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CA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + exports.Character = { + /* tslint:disable:no-bitwise */ + fromCodePoint: function (cp) { + return (cp < 0x10000) ? String.fromCharCode(cp) : + String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + + String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); + }, + // https://tc39.github.io/ecma262/#sec-white-space + isWhiteSpace: function (cp) { + return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || + (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); + }, + // https://tc39.github.io/ecma262/#sec-line-terminators + isLineTerminator: function (cp) { + return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); + }, + // https://tc39.github.io/ecma262/#sec-names-and-keywords + isIdentifierStart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); + }, + isIdentifierPart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp >= 0x30 && cp <= 0x39) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); + }, + // https://tc39.github.io/ecma262/#sec-literals-numeric-literals + isDecimalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39); // 0..9 + }, + isHexDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39) || + (cp >= 0x41 && cp <= 0x46) || + (cp >= 0x61 && cp <= 0x66); // a..f + }, + isOctalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x37); // 0..7 + } + }; + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var jsx_syntax_1 = __webpack_require__(6); + /* tslint:disable:max-classes-per-file */ + var JSXClosingElement = (function () { + function JSXClosingElement(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; + this.name = name; + } + return JSXClosingElement; + }()); + exports.JSXClosingElement = JSXClosingElement; + var JSXElement = (function () { + function JSXElement(openingElement, children, closingElement) { + this.type = jsx_syntax_1.JSXSyntax.JSXElement; + this.openingElement = openingElement; + this.children = children; + this.closingElement = closingElement; + } + return JSXElement; + }()); + exports.JSXElement = JSXElement; + var JSXEmptyExpression = (function () { + function JSXEmptyExpression() { + this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; + } + return JSXEmptyExpression; + }()); + exports.JSXEmptyExpression = JSXEmptyExpression; + var JSXExpressionContainer = (function () { + function JSXExpressionContainer(expression) { + this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; + this.expression = expression; + } + return JSXExpressionContainer; + }()); + exports.JSXExpressionContainer = JSXExpressionContainer; + var JSXIdentifier = (function () { + function JSXIdentifier(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; + this.name = name; + } + return JSXIdentifier; + }()); + exports.JSXIdentifier = JSXIdentifier; + var JSXMemberExpression = (function () { + function JSXMemberExpression(object, property) { + this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; + this.object = object; + this.property = property; + } + return JSXMemberExpression; + }()); + exports.JSXMemberExpression = JSXMemberExpression; + var JSXAttribute = (function () { + function JSXAttribute(name, value) { + this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; + this.name = name; + this.value = value; + } + return JSXAttribute; + }()); + exports.JSXAttribute = JSXAttribute; + var JSXNamespacedName = (function () { + function JSXNamespacedName(namespace, name) { + this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; + this.namespace = namespace; + this.name = name; + } + return JSXNamespacedName; + }()); + exports.JSXNamespacedName = JSXNamespacedName; + var JSXOpeningElement = (function () { + function JSXOpeningElement(name, selfClosing, attributes) { + this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; + this.name = name; + this.selfClosing = selfClosing; + this.attributes = attributes; + } + return JSXOpeningElement; + }()); + exports.JSXOpeningElement = JSXOpeningElement; + var JSXSpreadAttribute = (function () { + function JSXSpreadAttribute(argument) { + this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; + this.argument = argument; + } + return JSXSpreadAttribute; + }()); + exports.JSXSpreadAttribute = JSXSpreadAttribute; + var JSXText = (function () { + function JSXText(value, raw) { + this.type = jsx_syntax_1.JSXSyntax.JSXText; + this.value = value; + this.raw = raw; + } + return JSXText; + }()); + exports.JSXText = JSXText; + + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JSXSyntax = { + JSXAttribute: 'JSXAttribute', + JSXClosingElement: 'JSXClosingElement', + JSXElement: 'JSXElement', + JSXEmptyExpression: 'JSXEmptyExpression', + JSXExpressionContainer: 'JSXExpressionContainer', + JSXIdentifier: 'JSXIdentifier', + JSXMemberExpression: 'JSXMemberExpression', + JSXNamespacedName: 'JSXNamespacedName', + JSXOpeningElement: 'JSXOpeningElement', + JSXSpreadAttribute: 'JSXSpreadAttribute', + JSXText: 'JSXText' + }; + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + /* tslint:disable:max-classes-per-file */ + var ArrayExpression = (function () { + function ArrayExpression(elements) { + this.type = syntax_1.Syntax.ArrayExpression; + this.elements = elements; + } + return ArrayExpression; + }()); + exports.ArrayExpression = ArrayExpression; + var ArrayPattern = (function () { + function ArrayPattern(elements) { + this.type = syntax_1.Syntax.ArrayPattern; + this.elements = elements; + } + return ArrayPattern; + }()); + exports.ArrayPattern = ArrayPattern; + var ArrowFunctionExpression = (function () { + function ArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = false; + } + return ArrowFunctionExpression; + }()); + exports.ArrowFunctionExpression = ArrowFunctionExpression; + var AssignmentExpression = (function () { + function AssignmentExpression(operator, left, right) { + this.type = syntax_1.Syntax.AssignmentExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return AssignmentExpression; + }()); + exports.AssignmentExpression = AssignmentExpression; + var AssignmentPattern = (function () { + function AssignmentPattern(left, right) { + this.type = syntax_1.Syntax.AssignmentPattern; + this.left = left; + this.right = right; + } + return AssignmentPattern; + }()); + exports.AssignmentPattern = AssignmentPattern; + var AsyncArrowFunctionExpression = (function () { + function AsyncArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = true; + } + return AsyncArrowFunctionExpression; + }()); + exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; + var AsyncFunctionDeclaration = (function () { + function AsyncFunctionDeclaration(id, params, body) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionDeclaration; + }()); + exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; + var AsyncFunctionExpression = (function () { + function AsyncFunctionExpression(id, params, body) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionExpression; + }()); + exports.AsyncFunctionExpression = AsyncFunctionExpression; + var AwaitExpression = (function () { + function AwaitExpression(argument) { + this.type = syntax_1.Syntax.AwaitExpression; + this.argument = argument; + } + return AwaitExpression; + }()); + exports.AwaitExpression = AwaitExpression; + var BinaryExpression = (function () { + function BinaryExpression(operator, left, right) { + var logical = (operator === '||' || operator === '&&'); + this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return BinaryExpression; + }()); + exports.BinaryExpression = BinaryExpression; + var BlockStatement = (function () { + function BlockStatement(body) { + this.type = syntax_1.Syntax.BlockStatement; + this.body = body; + } + return BlockStatement; + }()); + exports.BlockStatement = BlockStatement; + var BreakStatement = (function () { + function BreakStatement(label) { + this.type = syntax_1.Syntax.BreakStatement; + this.label = label; + } + return BreakStatement; + }()); + exports.BreakStatement = BreakStatement; + var CallExpression = (function () { + function CallExpression(callee, args) { + this.type = syntax_1.Syntax.CallExpression; + this.callee = callee; + this.arguments = args; + } + return CallExpression; + }()); + exports.CallExpression = CallExpression; + var CatchClause = (function () { + function CatchClause(param, body) { + this.type = syntax_1.Syntax.CatchClause; + this.param = param; + this.body = body; + } + return CatchClause; + }()); + exports.CatchClause = CatchClause; + var ClassBody = (function () { + function ClassBody(body) { + this.type = syntax_1.Syntax.ClassBody; + this.body = body; + } + return ClassBody; + }()); + exports.ClassBody = ClassBody; + var ClassDeclaration = (function () { + function ClassDeclaration(id, superClass, body) { + this.type = syntax_1.Syntax.ClassDeclaration; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassDeclaration; + }()); + exports.ClassDeclaration = ClassDeclaration; + var ClassExpression = (function () { + function ClassExpression(id, superClass, body) { + this.type = syntax_1.Syntax.ClassExpression; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassExpression; + }()); + exports.ClassExpression = ClassExpression; + var ComputedMemberExpression = (function () { + function ComputedMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = true; + this.object = object; + this.property = property; + } + return ComputedMemberExpression; + }()); + exports.ComputedMemberExpression = ComputedMemberExpression; + var ConditionalExpression = (function () { + function ConditionalExpression(test, consequent, alternate) { + this.type = syntax_1.Syntax.ConditionalExpression; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return ConditionalExpression; + }()); + exports.ConditionalExpression = ConditionalExpression; + var ContinueStatement = (function () { + function ContinueStatement(label) { + this.type = syntax_1.Syntax.ContinueStatement; + this.label = label; + } + return ContinueStatement; + }()); + exports.ContinueStatement = ContinueStatement; + var DebuggerStatement = (function () { + function DebuggerStatement() { + this.type = syntax_1.Syntax.DebuggerStatement; + } + return DebuggerStatement; + }()); + exports.DebuggerStatement = DebuggerStatement; + var Directive = (function () { + function Directive(expression, directive) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + this.directive = directive; + } + return Directive; + }()); + exports.Directive = Directive; + var DoWhileStatement = (function () { + function DoWhileStatement(body, test) { + this.type = syntax_1.Syntax.DoWhileStatement; + this.body = body; + this.test = test; + } + return DoWhileStatement; + }()); + exports.DoWhileStatement = DoWhileStatement; + var EmptyStatement = (function () { + function EmptyStatement() { + this.type = syntax_1.Syntax.EmptyStatement; + } + return EmptyStatement; + }()); + exports.EmptyStatement = EmptyStatement; + var ExportAllDeclaration = (function () { + function ExportAllDeclaration(source) { + this.type = syntax_1.Syntax.ExportAllDeclaration; + this.source = source; + } + return ExportAllDeclaration; + }()); + exports.ExportAllDeclaration = ExportAllDeclaration; + var ExportDefaultDeclaration = (function () { + function ExportDefaultDeclaration(declaration) { + this.type = syntax_1.Syntax.ExportDefaultDeclaration; + this.declaration = declaration; + } + return ExportDefaultDeclaration; + }()); + exports.ExportDefaultDeclaration = ExportDefaultDeclaration; + var ExportNamedDeclaration = (function () { + function ExportNamedDeclaration(declaration, specifiers, source) { + this.type = syntax_1.Syntax.ExportNamedDeclaration; + this.declaration = declaration; + this.specifiers = specifiers; + this.source = source; + } + return ExportNamedDeclaration; + }()); + exports.ExportNamedDeclaration = ExportNamedDeclaration; + var ExportSpecifier = (function () { + function ExportSpecifier(local, exported) { + this.type = syntax_1.Syntax.ExportSpecifier; + this.exported = exported; + this.local = local; + } + return ExportSpecifier; + }()); + exports.ExportSpecifier = ExportSpecifier; + var ExpressionStatement = (function () { + function ExpressionStatement(expression) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + } + return ExpressionStatement; + }()); + exports.ExpressionStatement = ExpressionStatement; + var ForInStatement = (function () { + function ForInStatement(left, right, body) { + this.type = syntax_1.Syntax.ForInStatement; + this.left = left; + this.right = right; + this.body = body; + this.each = false; + } + return ForInStatement; + }()); + exports.ForInStatement = ForInStatement; + var ForOfStatement = (function () { + function ForOfStatement(left, right, body) { + this.type = syntax_1.Syntax.ForOfStatement; + this.left = left; + this.right = right; + this.body = body; + } + return ForOfStatement; + }()); + exports.ForOfStatement = ForOfStatement; + var ForStatement = (function () { + function ForStatement(init, test, update, body) { + this.type = syntax_1.Syntax.ForStatement; + this.init = init; + this.test = test; + this.update = update; + this.body = body; + } + return ForStatement; + }()); + exports.ForStatement = ForStatement; + var FunctionDeclaration = (function () { + function FunctionDeclaration(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionDeclaration; + }()); + exports.FunctionDeclaration = FunctionDeclaration; + var FunctionExpression = (function () { + function FunctionExpression(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionExpression; + }()); + exports.FunctionExpression = FunctionExpression; + var Identifier = (function () { + function Identifier(name) { + this.type = syntax_1.Syntax.Identifier; + this.name = name; + } + return Identifier; + }()); + exports.Identifier = Identifier; + var IfStatement = (function () { + function IfStatement(test, consequent, alternate) { + this.type = syntax_1.Syntax.IfStatement; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return IfStatement; + }()); + exports.IfStatement = IfStatement; + var ImportDeclaration = (function () { + function ImportDeclaration(specifiers, source) { + this.type = syntax_1.Syntax.ImportDeclaration; + this.specifiers = specifiers; + this.source = source; + } + return ImportDeclaration; + }()); + exports.ImportDeclaration = ImportDeclaration; + var ImportDefaultSpecifier = (function () { + function ImportDefaultSpecifier(local) { + this.type = syntax_1.Syntax.ImportDefaultSpecifier; + this.local = local; + } + return ImportDefaultSpecifier; + }()); + exports.ImportDefaultSpecifier = ImportDefaultSpecifier; + var ImportNamespaceSpecifier = (function () { + function ImportNamespaceSpecifier(local) { + this.type = syntax_1.Syntax.ImportNamespaceSpecifier; + this.local = local; + } + return ImportNamespaceSpecifier; + }()); + exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; + var ImportSpecifier = (function () { + function ImportSpecifier(local, imported) { + this.type = syntax_1.Syntax.ImportSpecifier; + this.local = local; + this.imported = imported; + } + return ImportSpecifier; + }()); + exports.ImportSpecifier = ImportSpecifier; + var LabeledStatement = (function () { + function LabeledStatement(label, body) { + this.type = syntax_1.Syntax.LabeledStatement; + this.label = label; + this.body = body; + } + return LabeledStatement; + }()); + exports.LabeledStatement = LabeledStatement; + var Literal = (function () { + function Literal(value, raw) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + } + return Literal; + }()); + exports.Literal = Literal; + var MetaProperty = (function () { + function MetaProperty(meta, property) { + this.type = syntax_1.Syntax.MetaProperty; + this.meta = meta; + this.property = property; + } + return MetaProperty; + }()); + exports.MetaProperty = MetaProperty; + var MethodDefinition = (function () { + function MethodDefinition(key, computed, value, kind, isStatic) { + this.type = syntax_1.Syntax.MethodDefinition; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.static = isStatic; + } + return MethodDefinition; + }()); + exports.MethodDefinition = MethodDefinition; + var Module = (function () { + function Module(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'module'; + } + return Module; + }()); + exports.Module = Module; + var NewExpression = (function () { + function NewExpression(callee, args) { + this.type = syntax_1.Syntax.NewExpression; + this.callee = callee; + this.arguments = args; + } + return NewExpression; + }()); + exports.NewExpression = NewExpression; + var ObjectExpression = (function () { + function ObjectExpression(properties) { + this.type = syntax_1.Syntax.ObjectExpression; + this.properties = properties; + } + return ObjectExpression; + }()); + exports.ObjectExpression = ObjectExpression; + var ObjectPattern = (function () { + function ObjectPattern(properties) { + this.type = syntax_1.Syntax.ObjectPattern; + this.properties = properties; + } + return ObjectPattern; + }()); + exports.ObjectPattern = ObjectPattern; + var Property = (function () { + function Property(kind, key, computed, value, method, shorthand) { + this.type = syntax_1.Syntax.Property; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.method = method; + this.shorthand = shorthand; + } + return Property; + }()); + exports.Property = Property; + var RegexLiteral = (function () { + function RegexLiteral(value, raw, pattern, flags) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + this.regex = { pattern: pattern, flags: flags }; + } + return RegexLiteral; + }()); + exports.RegexLiteral = RegexLiteral; + var RestElement = (function () { + function RestElement(argument) { + this.type = syntax_1.Syntax.RestElement; + this.argument = argument; + } + return RestElement; + }()); + exports.RestElement = RestElement; + var ReturnStatement = (function () { + function ReturnStatement(argument) { + this.type = syntax_1.Syntax.ReturnStatement; + this.argument = argument; + } + return ReturnStatement; + }()); + exports.ReturnStatement = ReturnStatement; + var Script = (function () { + function Script(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'script'; + } + return Script; + }()); + exports.Script = Script; + var SequenceExpression = (function () { + function SequenceExpression(expressions) { + this.type = syntax_1.Syntax.SequenceExpression; + this.expressions = expressions; + } + return SequenceExpression; + }()); + exports.SequenceExpression = SequenceExpression; + var SpreadElement = (function () { + function SpreadElement(argument) { + this.type = syntax_1.Syntax.SpreadElement; + this.argument = argument; + } + return SpreadElement; + }()); + exports.SpreadElement = SpreadElement; + var StaticMemberExpression = (function () { + function StaticMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = false; + this.object = object; + this.property = property; + } + return StaticMemberExpression; + }()); + exports.StaticMemberExpression = StaticMemberExpression; + var Super = (function () { + function Super() { + this.type = syntax_1.Syntax.Super; + } + return Super; + }()); + exports.Super = Super; + var SwitchCase = (function () { + function SwitchCase(test, consequent) { + this.type = syntax_1.Syntax.SwitchCase; + this.test = test; + this.consequent = consequent; + } + return SwitchCase; + }()); + exports.SwitchCase = SwitchCase; + var SwitchStatement = (function () { + function SwitchStatement(discriminant, cases) { + this.type = syntax_1.Syntax.SwitchStatement; + this.discriminant = discriminant; + this.cases = cases; + } + return SwitchStatement; + }()); + exports.SwitchStatement = SwitchStatement; + var TaggedTemplateExpression = (function () { + function TaggedTemplateExpression(tag, quasi) { + this.type = syntax_1.Syntax.TaggedTemplateExpression; + this.tag = tag; + this.quasi = quasi; + } + return TaggedTemplateExpression; + }()); + exports.TaggedTemplateExpression = TaggedTemplateExpression; + var TemplateElement = (function () { + function TemplateElement(value, tail) { + this.type = syntax_1.Syntax.TemplateElement; + this.value = value; + this.tail = tail; + } + return TemplateElement; + }()); + exports.TemplateElement = TemplateElement; + var TemplateLiteral = (function () { + function TemplateLiteral(quasis, expressions) { + this.type = syntax_1.Syntax.TemplateLiteral; + this.quasis = quasis; + this.expressions = expressions; + } + return TemplateLiteral; + }()); + exports.TemplateLiteral = TemplateLiteral; + var ThisExpression = (function () { + function ThisExpression() { + this.type = syntax_1.Syntax.ThisExpression; + } + return ThisExpression; + }()); + exports.ThisExpression = ThisExpression; + var ThrowStatement = (function () { + function ThrowStatement(argument) { + this.type = syntax_1.Syntax.ThrowStatement; + this.argument = argument; + } + return ThrowStatement; + }()); + exports.ThrowStatement = ThrowStatement; + var TryStatement = (function () { + function TryStatement(block, handler, finalizer) { + this.type = syntax_1.Syntax.TryStatement; + this.block = block; + this.handler = handler; + this.finalizer = finalizer; + } + return TryStatement; + }()); + exports.TryStatement = TryStatement; + var UnaryExpression = (function () { + function UnaryExpression(operator, argument) { + this.type = syntax_1.Syntax.UnaryExpression; + this.operator = operator; + this.argument = argument; + this.prefix = true; + } + return UnaryExpression; + }()); + exports.UnaryExpression = UnaryExpression; + var UpdateExpression = (function () { + function UpdateExpression(operator, argument, prefix) { + this.type = syntax_1.Syntax.UpdateExpression; + this.operator = operator; + this.argument = argument; + this.prefix = prefix; + } + return UpdateExpression; + }()); + exports.UpdateExpression = UpdateExpression; + var VariableDeclaration = (function () { + function VariableDeclaration(declarations, kind) { + this.type = syntax_1.Syntax.VariableDeclaration; + this.declarations = declarations; + this.kind = kind; + } + return VariableDeclaration; + }()); + exports.VariableDeclaration = VariableDeclaration; + var VariableDeclarator = (function () { + function VariableDeclarator(id, init) { + this.type = syntax_1.Syntax.VariableDeclarator; + this.id = id; + this.init = init; + } + return VariableDeclarator; + }()); + exports.VariableDeclarator = VariableDeclarator; + var WhileStatement = (function () { + function WhileStatement(test, body) { + this.type = syntax_1.Syntax.WhileStatement; + this.test = test; + this.body = body; + } + return WhileStatement; + }()); + exports.WhileStatement = WhileStatement; + var WithStatement = (function () { + function WithStatement(object, body) { + this.type = syntax_1.Syntax.WithStatement; + this.object = object; + this.body = body; + } + return WithStatement; + }()); + exports.WithStatement = WithStatement; + var YieldExpression = (function () { + function YieldExpression(argument, delegate) { + this.type = syntax_1.Syntax.YieldExpression; + this.argument = argument; + this.delegate = delegate; + } + return YieldExpression; + }()); + exports.YieldExpression = YieldExpression; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var error_handler_1 = __webpack_require__(10); + var messages_1 = __webpack_require__(11); + var Node = __webpack_require__(7); + var scanner_1 = __webpack_require__(12); + var syntax_1 = __webpack_require__(2); + var token_1 = __webpack_require__(13); + var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; + var Parser = (function () { + function Parser(code, options, delegate) { + if (options === void 0) { options = {}; } + this.config = { + range: (typeof options.range === 'boolean') && options.range, + loc: (typeof options.loc === 'boolean') && options.loc, + source: null, + tokens: (typeof options.tokens === 'boolean') && options.tokens, + comment: (typeof options.comment === 'boolean') && options.comment, + tolerant: (typeof options.tolerant === 'boolean') && options.tolerant + }; + if (this.config.loc && options.source && options.source !== null) { + this.config.source = String(options.source); + } + this.delegate = delegate; + this.errorHandler = new error_handler_1.ErrorHandler(); + this.errorHandler.tolerant = this.config.tolerant; + this.scanner = new scanner_1.Scanner(code, this.errorHandler); + this.scanner.trackComment = this.config.comment; + this.operatorPrecedence = { + ')': 0, + ';': 0, + ',': 0, + '=': 0, + ']': 0, + '||': 1, + '&&': 2, + '|': 3, + '^': 4, + '&': 5, + '==': 6, + '!=': 6, + '===': 6, + '!==': 6, + '<': 7, + '>': 7, + '<=': 7, + '>=': 7, + '<<': 8, + '>>': 8, + '>>>': 8, + '+': 9, + '-': 9, + '*': 11, + '/': 11, + '%': 11 + }; + this.lookahead = { + type: 2 /* EOF */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: 0, + start: 0, + end: 0 + }; + this.hasLineTerminator = false; + this.context = { + isModule: false, + await: false, + allowIn: true, + allowStrictDirective: true, + allowYield: true, + firstCoverInitializedNameError: null, + isAssignmentTarget: false, + isBindingElement: false, + inFunctionBody: false, + inIteration: false, + inSwitch: false, + labelSet: {}, + strict: false + }; + this.tokens = []; + this.startMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.lastMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.nextToken(); + this.lastMarker = { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + } + Parser.prototype.throwError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + throw this.errorHandler.createError(index, line, column, msg); + }; + Parser.prototype.tolerateError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.scanner.lineNumber; + var column = this.lastMarker.column + 1; + this.errorHandler.tolerateError(index, line, column, msg); + }; + // Throw an exception because of the token. + Parser.prototype.unexpectedTokenError = function (token, message) { + var msg = message || messages_1.Messages.UnexpectedToken; + var value; + if (token) { + if (!message) { + msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : + (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : + (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : + (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : + (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : + messages_1.Messages.UnexpectedToken; + if (token.type === 4 /* Keyword */) { + if (this.scanner.isFutureReservedWord(token.value)) { + msg = messages_1.Messages.UnexpectedReserved; + } + else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { + msg = messages_1.Messages.StrictReservedWord; + } + } + } + value = token.value; + } + else { + value = 'ILLEGAL'; + } + msg = msg.replace('%0', value); + if (token && typeof token.lineNumber === 'number') { + var index = token.start; + var line = token.lineNumber; + var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; + var column = token.start - lastMarkerLineStart + 1; + return this.errorHandler.createError(index, line, column, msg); + } + else { + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + return this.errorHandler.createError(index, line, column, msg); + } + }; + Parser.prototype.throwUnexpectedToken = function (token, message) { + throw this.unexpectedTokenError(token, message); + }; + Parser.prototype.tolerateUnexpectedToken = function (token, message) { + this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); + }; + Parser.prototype.collectComments = function () { + if (!this.config.comment) { + this.scanner.scanComments(); + } + else { + var comments = this.scanner.scanComments(); + if (comments.length > 0 && this.delegate) { + for (var i = 0; i < comments.length; ++i) { + var e = comments[i]; + var node = void 0; + node = { + type: e.multiLine ? 'BlockComment' : 'LineComment', + value: this.scanner.source.slice(e.slice[0], e.slice[1]) + }; + if (this.config.range) { + node.range = e.range; + } + if (this.config.loc) { + node.loc = e.loc; + } + var metadata = { + start: { + line: e.loc.start.line, + column: e.loc.start.column, + offset: e.range[0] + }, + end: { + line: e.loc.end.line, + column: e.loc.end.column, + offset: e.range[1] + } + }; + this.delegate(node, metadata); + } + } + } + }; + // From internal representation to an external structure + Parser.prototype.getTokenRaw = function (token) { + return this.scanner.source.slice(token.start, token.end); + }; + Parser.prototype.convertToken = function (token) { + var t = { + type: token_1.TokenName[token.type], + value: this.getTokenRaw(token) + }; + if (this.config.range) { + t.range = [token.start, token.end]; + } + if (this.config.loc) { + t.loc = { + start: { + line: this.startMarker.line, + column: this.startMarker.column + }, + end: { + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + } + }; + } + if (token.type === 9 /* RegularExpression */) { + var pattern = token.pattern; + var flags = token.flags; + t.regex = { pattern: pattern, flags: flags }; + } + return t; + }; + Parser.prototype.nextToken = function () { + var token = this.lookahead; + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + this.collectComments(); + if (this.scanner.index !== this.startMarker.index) { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + } + var next = this.scanner.lex(); + this.hasLineTerminator = (token.lineNumber !== next.lineNumber); + if (next && this.context.strict && next.type === 3 /* Identifier */) { + if (this.scanner.isStrictModeReservedWord(next.value)) { + next.type = 4 /* Keyword */; + } + } + this.lookahead = next; + if (this.config.tokens && next.type !== 2 /* EOF */) { + this.tokens.push(this.convertToken(next)); + } + return token; + }; + Parser.prototype.nextRegexToken = function () { + this.collectComments(); + var token = this.scanner.scanRegExp(); + if (this.config.tokens) { + // Pop the previous token, '/' or '/=' + // This is added from the lookahead token. + this.tokens.pop(); + this.tokens.push(this.convertToken(token)); + } + // Prime the next lookahead. + this.lookahead = token; + this.nextToken(); + return token; + }; + Parser.prototype.createNode = function () { + return { + index: this.startMarker.index, + line: this.startMarker.line, + column: this.startMarker.column + }; + }; + Parser.prototype.startNode = function (token, lastLineStart) { + if (lastLineStart === void 0) { lastLineStart = 0; } + var column = token.start - token.lineStart; + var line = token.lineNumber; + if (column < 0) { + column += lastLineStart; + line--; + } + return { + index: token.start, + line: line, + column: column + }; + }; + Parser.prototype.finalize = function (marker, node) { + if (this.config.range) { + node.range = [marker.index, this.lastMarker.index]; + } + if (this.config.loc) { + node.loc = { + start: { + line: marker.line, + column: marker.column, + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column + } + }; + if (this.config.source) { + node.loc.source = this.config.source; + } + } + if (this.delegate) { + var metadata = { + start: { + line: marker.line, + column: marker.column, + offset: marker.index + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column, + offset: this.lastMarker.index + } + }; + this.delegate(node, metadata); + } + return node; + }; + // Expect the next token to match the specified punctuator. + // If not, an exception will be thrown. + Parser.prototype.expect = function (value) { + var token = this.nextToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). + Parser.prototype.expectCommaSeparator = function () { + if (this.config.tolerant) { + var token = this.lookahead; + if (token.type === 7 /* Punctuator */ && token.value === ',') { + this.nextToken(); + } + else if (token.type === 7 /* Punctuator */ && token.value === ';') { + this.nextToken(); + this.tolerateUnexpectedToken(token); + } + else { + this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); + } + } + else { + this.expect(','); + } + }; + // Expect the next token to match the specified keyword. + // If not, an exception will be thrown. + Parser.prototype.expectKeyword = function (keyword) { + var token = this.nextToken(); + if (token.type !== 4 /* Keyword */ || token.value !== keyword) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next token matches the specified punctuator. + Parser.prototype.match = function (value) { + return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; + }; + // Return true if the next token matches the specified keyword + Parser.prototype.matchKeyword = function (keyword) { + return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; + }; + // Return true if the next token matches the specified contextual keyword + // (where an identifier is sometimes a keyword depending on the context) + Parser.prototype.matchContextualKeyword = function (keyword) { + return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; + }; + // Return true if the next token is an assignment operator + Parser.prototype.matchAssign = function () { + if (this.lookahead.type !== 7 /* Punctuator */) { + return false; + } + var op = this.lookahead.value; + return op === '=' || + op === '*=' || + op === '**=' || + op === '/=' || + op === '%=' || + op === '+=' || + op === '-=' || + op === '<<=' || + op === '>>=' || + op === '>>>=' || + op === '&=' || + op === '^=' || + op === '|='; + }; + // Cover grammar support. + // + // When an assignment expression position starts with an left parenthesis, the determination of the type + // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) + // or the first comma. This situation also defers the determination of all the expressions nested in the pair. + // + // There are three productions that can be parsed in a parentheses pair that needs to be determined + // after the outermost pair is closed. They are: + // + // 1. AssignmentExpression + // 2. BindingElements + // 3. AssignmentTargets + // + // In order to avoid exponential backtracking, we use two flags to denote if the production can be + // binding element or assignment target. + // + // The three productions have the relationship: + // + // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression + // + // with a single exception that CoverInitializedName when used directly in an Expression, generates + // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the + // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. + // + // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not + // effect the current flags. This means the production the parser parses is only used as an expression. Therefore + // the CoverInitializedName check is conducted. + // + // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates + // the flags outside of the parser. This means the production the parser parses is used as a part of a potential + // pattern. The CoverInitializedName check is deferred. + Parser.prototype.isolateCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + if (this.context.firstCoverInitializedNameError !== null) { + this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); + } + this.context.isBindingElement = previousIsBindingElement; + this.context.isAssignmentTarget = previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; + return result; + }; + Parser.prototype.inheritCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; + this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; + return result; + }; + Parser.prototype.consumeSemicolon = function () { + if (this.match(';')) { + this.nextToken(); + } + else if (!this.hasLineTerminator) { + if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { + this.throwUnexpectedToken(this.lookahead); + } + this.lastMarker.index = this.startMarker.index; + this.lastMarker.line = this.startMarker.line; + this.lastMarker.column = this.startMarker.column; + } + }; + // https://tc39.github.io/ecma262/#sec-primary-expression + Parser.prototype.parsePrimaryExpression = function () { + var node = this.createNode(); + var expr; + var token, raw; + switch (this.lookahead.type) { + case 3 /* Identifier */: + if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { + this.tolerateUnexpectedToken(this.lookahead); + } + expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); + break; + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + if (this.context.strict && this.lookahead.octal) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 1 /* BooleanLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); + break; + case 5 /* NullLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(null, raw)); + break; + case 10 /* Template */: + expr = this.parseTemplateLiteral(); + break; + case 7 /* Punctuator */: + switch (this.lookahead.value) { + case '(': + this.context.isBindingElement = false; + expr = this.inheritCoverGrammar(this.parseGroupExpression); + break; + case '[': + expr = this.inheritCoverGrammar(this.parseArrayInitializer); + break; + case '{': + expr = this.inheritCoverGrammar(this.parseObjectInitializer); + break; + case '/': + case '/=': + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.scanner.index = this.startMarker.index; + token = this.nextRegexToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + break; + case 4 /* Keyword */: + if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseIdentifierName(); + } + else if (!this.context.strict && this.matchKeyword('let')) { + expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); + } + else { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + if (this.matchKeyword('function')) { + expr = this.parseFunctionExpression(); + } + else if (this.matchKeyword('this')) { + this.nextToken(); + expr = this.finalize(node, new Node.ThisExpression()); + } + else if (this.matchKeyword('class')) { + expr = this.parseClassExpression(); + } + else { + expr = this.throwUnexpectedToken(this.nextToken()); + } + } + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-array-initializer + Parser.prototype.parseSpreadElement = function () { + var node = this.createNode(); + this.expect('...'); + var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); + return this.finalize(node, new Node.SpreadElement(arg)); + }; + Parser.prototype.parseArrayInitializer = function () { + var node = this.createNode(); + var elements = []; + this.expect('['); + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else if (this.match('...')) { + var element = this.parseSpreadElement(); + if (!this.match(']')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.expect(','); + } + elements.push(element); + } + else { + elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayExpression(elements)); + }; + // https://tc39.github.io/ecma262/#sec-object-initializer + Parser.prototype.parsePropertyMethod = function (params) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = params.simple; + var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); + if (this.context.strict && params.firstRestricted) { + this.tolerateUnexpectedToken(params.firstRestricted, params.message); + } + if (this.context.strict && params.stricted) { + this.tolerateUnexpectedToken(params.stricted, params.message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + return body; + }; + Parser.prototype.parsePropertyMethodFunction = function () { + var isGenerator = false; + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + Parser.prototype.parsePropertyMethodAsyncFunction = function () { + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = false; + this.context.await = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); + }; + Parser.prototype.parseObjectPropertyKey = function () { + var node = this.createNode(); + var token = this.nextToken(); + var key; + switch (token.type) { + case 8 /* StringLiteral */: + case 6 /* NumericLiteral */: + if (this.context.strict && token.octal) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); + } + var raw = this.getTokenRaw(token); + key = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 3 /* Identifier */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 4 /* Keyword */: + key = this.finalize(node, new Node.Identifier(token.value)); + break; + case 7 /* Punctuator */: + if (token.value === '[') { + key = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.expect(']'); + } + else { + key = this.throwUnexpectedToken(token); + } + break; + default: + key = this.throwUnexpectedToken(token); + } + return key; + }; + Parser.prototype.isPropertyKey = function (key, value) { + return (key.type === syntax_1.Syntax.Identifier && key.name === value) || + (key.type === syntax_1.Syntax.Literal && key.value === value); + }; + Parser.prototype.parseObjectProperty = function (hasProto) { + var node = this.createNode(); + var token = this.lookahead; + var kind; + var key = null; + var value = null; + var computed = false; + var method = false; + var shorthand = false; + var isAsync = false; + if (token.type === 3 /* Identifier */) { + var id = token.value; + this.nextToken(); + computed = this.match('['); + isAsync = !this.hasLineTerminator && (id === 'async') && + !this.match(':') && !this.match('(') && !this.match('*') && !this.match(','); + key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); + } + else if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + else { + if (!key) { + this.throwUnexpectedToken(this.lookahead); + } + kind = 'init'; + if (this.match(':') && !isAsync) { + if (!computed && this.isPropertyKey(key, '__proto__')) { + if (hasProto.value) { + this.tolerateError(messages_1.Messages.DuplicateProtoProperty); + } + hasProto.value = true; + } + this.nextToken(); + value = this.inheritCoverGrammar(this.parseAssignmentExpression); + } + else if (this.match('(')) { + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + else if (token.type === 3 /* Identifier */) { + var id = this.finalize(node, new Node.Identifier(token.value)); + if (this.match('=')) { + this.context.firstCoverInitializedNameError = this.lookahead; + this.nextToken(); + shorthand = true; + var init = this.isolateCoverGrammar(this.parseAssignmentExpression); + value = this.finalize(node, new Node.AssignmentPattern(id, init)); + } + else { + shorthand = true; + value = id; + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectInitializer = function () { + var node = this.createNode(); + this.expect('{'); + var properties = []; + var hasProto = { value: false }; + while (!this.match('}')) { + properties.push(this.parseObjectProperty(hasProto)); + if (!this.match('}')) { + this.expectCommaSeparator(); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectExpression(properties)); + }; + // https://tc39.github.io/ecma262/#sec-template-literals + Parser.prototype.parseTemplateHead = function () { + assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateElement = function () { + if (this.lookahead.type !== 10 /* Template */) { + this.throwUnexpectedToken(); + } + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateLiteral = function () { + var node = this.createNode(); + var expressions = []; + var quasis = []; + var quasi = this.parseTemplateHead(); + quasis.push(quasi); + while (!quasi.tail) { + expressions.push(this.parseExpression()); + quasi = this.parseTemplateElement(); + quasis.push(quasi); + } + return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); + }; + // https://tc39.github.io/ecma262/#sec-grouping-operator + Parser.prototype.reinterpretExpressionAsPattern = function (expr) { + switch (expr.type) { + case syntax_1.Syntax.Identifier: + case syntax_1.Syntax.MemberExpression: + case syntax_1.Syntax.RestElement: + case syntax_1.Syntax.AssignmentPattern: + break; + case syntax_1.Syntax.SpreadElement: + expr.type = syntax_1.Syntax.RestElement; + this.reinterpretExpressionAsPattern(expr.argument); + break; + case syntax_1.Syntax.ArrayExpression: + expr.type = syntax_1.Syntax.ArrayPattern; + for (var i = 0; i < expr.elements.length; i++) { + if (expr.elements[i] !== null) { + this.reinterpretExpressionAsPattern(expr.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectExpression: + expr.type = syntax_1.Syntax.ObjectPattern; + for (var i = 0; i < expr.properties.length; i++) { + this.reinterpretExpressionAsPattern(expr.properties[i].value); + } + break; + case syntax_1.Syntax.AssignmentExpression: + expr.type = syntax_1.Syntax.AssignmentPattern; + delete expr.operator; + this.reinterpretExpressionAsPattern(expr.left); + break; + default: + // Allow other node type for tolerant parsing. + break; + } + }; + Parser.prototype.parseGroupExpression = function () { + var expr; + this.expect('('); + if (this.match(')')) { + this.nextToken(); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [], + async: false + }; + } + else { + var startToken = this.lookahead; + var params = []; + if (this.match('...')) { + expr = this.parseRestElement(params); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + else { + var arrow = false; + this.context.isBindingElement = true; + expr = this.inheritCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + this.context.isAssignmentTarget = false; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + if (this.match(')')) { + this.nextToken(); + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else if (this.match('...')) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + expressions.push(this.parseRestElement(params)); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + this.context.isBindingElement = false; + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else { + expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + } + if (arrow) { + break; + } + } + if (!arrow) { + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + } + if (!arrow) { + this.expect(')'); + if (this.match('=>')) { + if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + if (!arrow) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + if (expr.type === syntax_1.Syntax.SequenceExpression) { + for (var i = 0; i < expr.expressions.length; i++) { + this.reinterpretExpressionAsPattern(expr.expressions[i]); + } + } + else { + this.reinterpretExpressionAsPattern(expr); + } + var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); + expr = { + type: ArrowParameterPlaceHolder, + params: parameters, + async: false + }; + } + } + this.context.isBindingElement = false; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions + Parser.prototype.parseArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAssignmentExpression); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.isIdentifierName = function (token) { + return token.type === 3 /* Identifier */ || + token.type === 4 /* Keyword */ || + token.type === 1 /* BooleanLiteral */ || + token.type === 5 /* NullLiteral */; + }; + Parser.prototype.parseIdentifierName = function () { + var node = this.createNode(); + var token = this.nextToken(); + if (!this.isIdentifierName(token)) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseNewExpression = function () { + var node = this.createNode(); + var id = this.parseIdentifierName(); + assert_1.assert(id.name === 'new', 'New expression must start with `new`'); + var expr; + if (this.match('.')) { + this.nextToken(); + if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { + var property = this.parseIdentifierName(); + expr = new Node.MetaProperty(id, property); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); + var args = this.match('(') ? this.parseArguments() : []; + expr = new Node.NewExpression(callee, args); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return this.finalize(node, expr); + }; + Parser.prototype.parseAsyncArgument = function () { + var arg = this.parseAssignmentExpression(); + this.context.firstCoverInitializedNameError = null; + return arg; + }; + Parser.prototype.parseAsyncArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAsyncArgument); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { + var startToken = this.lookahead; + var maybeAsync = this.matchContextualKeyword('async'); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var expr; + if (this.matchKeyword('super') && this.context.inFunctionBody) { + expr = this.createNode(); + this.nextToken(); + expr = this.finalize(expr, new Node.Super()); + if (!this.match('(') && !this.match('.') && !this.match('[')) { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + } + while (true) { + if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); + } + else if (this.match('(')) { + var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); + this.context.isBindingElement = false; + this.context.isAssignmentTarget = false; + var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); + expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); + if (asyncArrow && this.match('=>')) { + for (var i = 0; i < args.length; ++i) { + this.reinterpretExpressionAsPattern(args[i]); + } + expr = { + type: ArrowParameterPlaceHolder, + params: args, + async: true + }; + } + } + else if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + this.context.allowIn = previousAllowIn; + return expr; + }; + Parser.prototype.parseSuper = function () { + var node = this.createNode(); + this.expectKeyword('super'); + if (!this.match('[') && !this.match('.')) { + this.throwUnexpectedToken(this.lookahead); + } + return this.finalize(node, new Node.Super()); + }; + Parser.prototype.parseLeftHandSideExpression = function () { + assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); + var node = this.startNode(this.lookahead); + var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : + this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + while (true) { + if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); + } + else if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-update-expressions + Parser.prototype.parseUpdateExpression = function () { + var expr; + var startToken = this.lookahead; + if (this.match('++') || this.match('--')) { + var node = this.startNode(startToken); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPrefix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + var prefix = true; + expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { + if (this.match('++') || this.match('--')) { + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPostfix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var operator = this.nextToken().value; + var prefix = false; + expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-unary-operators + Parser.prototype.parseAwaitExpression = function () { + var node = this.createNode(); + this.nextToken(); + var argument = this.parseUnaryExpression(); + return this.finalize(node, new Node.AwaitExpression(argument)); + }; + Parser.prototype.parseUnaryExpression = function () { + var expr; + if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || + this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { + var node = this.startNode(this.lookahead); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); + if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { + this.tolerateError(messages_1.Messages.StrictDelete); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else if (this.context.await && this.matchContextualKeyword('await')) { + expr = this.parseAwaitExpression(); + } + else { + expr = this.parseUpdateExpression(); + } + return expr; + }; + Parser.prototype.parseExponentiationExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-exp-operator + // https://tc39.github.io/ecma262/#sec-multiplicative-operators + // https://tc39.github.io/ecma262/#sec-additive-operators + // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators + // https://tc39.github.io/ecma262/#sec-relational-operators + // https://tc39.github.io/ecma262/#sec-equality-operators + // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators + // https://tc39.github.io/ecma262/#sec-binary-logical-operators + Parser.prototype.binaryPrecedence = function (token) { + var op = token.value; + var precedence; + if (token.type === 7 /* Punctuator */) { + precedence = this.operatorPrecedence[op] || 0; + } + else if (token.type === 4 /* Keyword */) { + precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; + } + else { + precedence = 0; + } + return precedence; + }; + Parser.prototype.parseBinaryExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); + var token = this.lookahead; + var prec = this.binaryPrecedence(token); + if (prec > 0) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var markers = [startToken, this.lookahead]; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + var stack = [left, token.value, right]; + var precedences = [prec]; + while (true) { + prec = this.binaryPrecedence(this.lookahead); + if (prec <= 0) { + break; + } + // Reduce: make a binary expression from the three topmost entries. + while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { + right = stack.pop(); + var operator = stack.pop(); + precedences.pop(); + left = stack.pop(); + markers.pop(); + var node = this.startNode(markers[markers.length - 1]); + stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); + } + // Shift. + stack.push(this.nextToken().value); + precedences.push(prec); + markers.push(this.lookahead); + stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); + } + // Final reduce to clean-up the stack. + var i = stack.length - 1; + expr = stack[i]; + var lastMarker = markers.pop(); + while (i > 1) { + var marker = markers.pop(); + var lastLineStart = lastMarker && lastMarker.lineStart; + var node = this.startNode(marker, lastLineStart); + var operator = stack[i - 1]; + expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); + i -= 2; + lastMarker = marker; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-conditional-operator + Parser.prototype.parseConditionalExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseBinaryExpression); + if (this.match('?')) { + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + this.expect(':'); + var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-assignment-operators + Parser.prototype.checkPatternParam = function (options, param) { + switch (param.type) { + case syntax_1.Syntax.Identifier: + this.validateParam(options, param, param.name); + break; + case syntax_1.Syntax.RestElement: + this.checkPatternParam(options, param.argument); + break; + case syntax_1.Syntax.AssignmentPattern: + this.checkPatternParam(options, param.left); + break; + case syntax_1.Syntax.ArrayPattern: + for (var i = 0; i < param.elements.length; i++) { + if (param.elements[i] !== null) { + this.checkPatternParam(options, param.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectPattern: + for (var i = 0; i < param.properties.length; i++) { + this.checkPatternParam(options, param.properties[i].value); + } + break; + default: + break; + } + options.simple = options.simple && (param instanceof Node.Identifier); + }; + Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { + var params = [expr]; + var options; + var asyncArrow = false; + switch (expr.type) { + case syntax_1.Syntax.Identifier: + break; + case ArrowParameterPlaceHolder: + params = expr.params; + asyncArrow = expr.async; + break; + default: + return null; + } + options = { + simple: true, + paramSet: {} + }; + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.AssignmentPattern) { + if (param.right.type === syntax_1.Syntax.YieldExpression) { + if (param.right.argument) { + this.throwUnexpectedToken(this.lookahead); + } + param.right.type = syntax_1.Syntax.Identifier; + param.right.name = 'yield'; + delete param.right.argument; + delete param.right.delegate; + } + } + else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { + this.throwUnexpectedToken(this.lookahead); + } + this.checkPatternParam(options, param); + params[i] = param; + } + if (this.context.strict || !this.context.allowYield) { + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.YieldExpression) { + this.throwUnexpectedToken(this.lookahead); + } + } + } + if (options.message === messages_1.Messages.StrictParamDupe) { + var token = this.context.strict ? options.stricted : options.firstRestricted; + this.throwUnexpectedToken(token, options.message); + } + return { + simple: options.simple, + params: params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.parseAssignmentExpression = function () { + var expr; + if (!this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseYieldExpression(); + } + else { + var startToken = this.lookahead; + var token = startToken; + expr = this.parseConditionalExpression(); + if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { + if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { + var arg = this.parsePrimaryExpression(); + this.reinterpretExpressionAsPattern(arg); + expr = { + type: ArrowParameterPlaceHolder, + params: [arg], + async: true + }; + } + } + if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { + // https://tc39.github.io/ecma262/#sec-arrow-function-definitions + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var isAsync = expr.async; + var list = this.reinterpretAsCoverFormalsList(expr); + if (list) { + if (this.hasLineTerminator) { + this.tolerateUnexpectedToken(this.lookahead); + } + this.context.firstCoverInitializedNameError = null; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = list.simple; + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = true; + this.context.await = isAsync; + var node = this.startNode(startToken); + this.expect('=>'); + var body = void 0; + if (this.match('{')) { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + body = this.parseFunctionSourceElements(); + this.context.allowIn = previousAllowIn; + } + else { + body = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + var expression = body.type !== syntax_1.Syntax.BlockStatement; + if (this.context.strict && list.firstRestricted) { + this.throwUnexpectedToken(list.firstRestricted, list.message); + } + if (this.context.strict && list.stricted) { + this.tolerateUnexpectedToken(list.stricted, list.message); + } + expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : + this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + } + } + else { + if (this.matchAssign()) { + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { + var id = expr; + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); + } + if (this.scanner.isStrictModeReservedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + } + if (!this.match('=')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + this.reinterpretExpressionAsPattern(expr); + } + token = this.nextToken(); + var operator = token.value; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); + this.context.firstCoverInitializedNameError = null; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-comma-operator + Parser.prototype.parseExpression = function () { + var startToken = this.lookahead; + var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-block + Parser.prototype.parseStatementListItem = function () { + var statement; + this.context.isAssignmentTarget = true; + this.context.isBindingElement = true; + if (this.lookahead.type === 4 /* Keyword */) { + switch (this.lookahead.value) { + case 'export': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); + } + statement = this.parseExportDeclaration(); + break; + case 'import': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); + } + statement = this.parseImportDeclaration(); + break; + case 'const': + statement = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'class': + statement = this.parseClassDeclaration(); + break; + case 'let': + statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); + break; + default: + statement = this.parseStatement(); + break; + } + } + else { + statement = this.parseStatement(); + } + return statement; + }; + Parser.prototype.parseBlock = function () { + var node = this.createNode(); + this.expect('{'); + var block = []; + while (true) { + if (this.match('}')) { + break; + } + block.push(this.parseStatementListItem()); + } + this.expect('}'); + return this.finalize(node, new Node.BlockStatement(block)); + }; + // https://tc39.github.io/ecma262/#sec-let-and-const-declarations + Parser.prototype.parseLexicalBinding = function (kind, options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, kind); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (kind === 'const') { + if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else { + this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); + } + } + } + else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { + this.expect('='); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseBindingList = function (kind, options) { + var list = [this.parseLexicalBinding(kind, options)]; + while (this.match(',')) { + this.nextToken(); + list.push(this.parseLexicalBinding(kind, options)); + } + return list; + }; + Parser.prototype.isLexicalDeclaration = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + return (next.type === 3 /* Identifier */) || + (next.type === 7 /* Punctuator */ && next.value === '[') || + (next.type === 7 /* Punctuator */ && next.value === '{') || + (next.type === 4 /* Keyword */ && next.value === 'let') || + (next.type === 4 /* Keyword */ && next.value === 'yield'); + }; + Parser.prototype.parseLexicalDeclaration = function (options) { + var node = this.createNode(); + var kind = this.nextToken().value; + assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); + var declarations = this.parseBindingList(kind, options); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); + }; + // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns + Parser.prototype.parseBindingRestElement = function (params, kind) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params, kind); + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseArrayPattern = function (params, kind) { + var node = this.createNode(); + this.expect('['); + var elements = []; + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else { + if (this.match('...')) { + elements.push(this.parseBindingRestElement(params, kind)); + break; + } + else { + elements.push(this.parsePatternWithDefault(params, kind)); + } + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayPattern(elements)); + }; + Parser.prototype.parsePropertyPattern = function (params, kind) { + var node = this.createNode(); + var computed = false; + var shorthand = false; + var method = false; + var key; + var value; + if (this.lookahead.type === 3 /* Identifier */) { + var keyToken = this.lookahead; + key = this.parseVariableIdentifier(); + var init = this.finalize(node, new Node.Identifier(keyToken.value)); + if (this.match('=')) { + params.push(keyToken); + shorthand = true; + this.nextToken(); + var expr = this.parseAssignmentExpression(); + value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); + } + else if (!this.match(':')) { + params.push(keyToken); + shorthand = true; + value = init; + } + else { + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectPattern = function (params, kind) { + var node = this.createNode(); + var properties = []; + this.expect('{'); + while (!this.match('}')) { + properties.push(this.parsePropertyPattern(params, kind)); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectPattern(properties)); + }; + Parser.prototype.parsePattern = function (params, kind) { + var pattern; + if (this.match('[')) { + pattern = this.parseArrayPattern(params, kind); + } + else if (this.match('{')) { + pattern = this.parseObjectPattern(params, kind); + } + else { + if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); + } + params.push(this.lookahead); + pattern = this.parseVariableIdentifier(kind); + } + return pattern; + }; + Parser.prototype.parsePatternWithDefault = function (params, kind) { + var startToken = this.lookahead; + var pattern = this.parsePattern(params, kind); + if (this.match('=')) { + this.nextToken(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowYield = previousAllowYield; + pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); + } + return pattern; + }; + // https://tc39.github.io/ecma262/#sec-variable-statement + Parser.prototype.parseVariableIdentifier = function (kind) { + var node = this.createNode(); + var token = this.nextToken(); + if (token.type === 4 /* Keyword */ && token.value === 'yield') { + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else if (!this.context.allowYield) { + this.throwUnexpectedToken(token); + } + } + else if (token.type !== 3 /* Identifier */) { + if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else { + if (this.context.strict || token.value !== 'let' || kind !== 'var') { + this.throwUnexpectedToken(token); + } + } + } + else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { + this.tolerateUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseVariableDeclaration = function (options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, 'var'); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { + this.expect('='); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseVariableDeclarationList = function (options) { + var opt = { inFor: options.inFor }; + var list = []; + list.push(this.parseVariableDeclaration(opt)); + while (this.match(',')) { + this.nextToken(); + list.push(this.parseVariableDeclaration(opt)); + } + return list; + }; + Parser.prototype.parseVariableStatement = function () { + var node = this.createNode(); + this.expectKeyword('var'); + var declarations = this.parseVariableDeclarationList({ inFor: false }); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); + }; + // https://tc39.github.io/ecma262/#sec-empty-statement + Parser.prototype.parseEmptyStatement = function () { + var node = this.createNode(); + this.expect(';'); + return this.finalize(node, new Node.EmptyStatement()); + }; + // https://tc39.github.io/ecma262/#sec-expression-statement + Parser.prototype.parseExpressionStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ExpressionStatement(expr)); + }; + // https://tc39.github.io/ecma262/#sec-if-statement + Parser.prototype.parseIfClause = function () { + if (this.context.strict && this.matchKeyword('function')) { + this.tolerateError(messages_1.Messages.StrictFunction); + } + return this.parseStatement(); + }; + Parser.prototype.parseIfStatement = function () { + var node = this.createNode(); + var consequent; + var alternate = null; + this.expectKeyword('if'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + consequent = this.parseIfClause(); + if (this.matchKeyword('else')) { + this.nextToken(); + alternate = this.parseIfClause(); + } + } + return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); + }; + // https://tc39.github.io/ecma262/#sec-do-while-statement + Parser.prototype.parseDoWhileStatement = function () { + var node = this.createNode(); + this.expectKeyword('do'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + var body = this.parseStatement(); + this.context.inIteration = previousInIteration; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + } + else { + this.expect(')'); + if (this.match(';')) { + this.nextToken(); + } + } + return this.finalize(node, new Node.DoWhileStatement(body, test)); + }; + // https://tc39.github.io/ecma262/#sec-while-statement + Parser.prototype.parseWhileStatement = function () { + var node = this.createNode(); + var body; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.parseStatement(); + this.context.inIteration = previousInIteration; + } + return this.finalize(node, new Node.WhileStatement(test, body)); + }; + // https://tc39.github.io/ecma262/#sec-for-statement + // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements + Parser.prototype.parseForStatement = function () { + var init = null; + var test = null; + var update = null; + var forIn = true; + var left, right; + var node = this.createNode(); + this.expectKeyword('for'); + this.expect('('); + if (this.match(';')) { + this.nextToken(); + } + else { + if (this.matchKeyword('var')) { + init = this.createNode(); + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseVariableDeclarationList({ inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && this.matchKeyword('in')) { + var decl = declarations[0]; + if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { + this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); + } + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.expect(';'); + } + } + else if (this.matchKeyword('const') || this.matchKeyword('let')) { + init = this.createNode(); + var kind = this.nextToken().value; + if (!this.context.strict && this.lookahead.value === 'in') { + init = this.finalize(init, new Node.Identifier(kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseBindingList(kind, { inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + this.consumeSemicolon(); + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + } + } + } + else { + var initStartToken = this.lookahead; + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + init = this.inheritCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + if (this.matchKeyword('in')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForIn); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseExpression(); + init = null; + } + else if (this.matchContextualKeyword('of')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + if (this.match(',')) { + var initSeq = [init]; + while (this.match(',')) { + this.nextToken(); + initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); + } + this.expect(';'); + } + } + } + if (typeof left === 'undefined') { + if (!this.match(';')) { + test = this.parseExpression(); + } + this.expect(';'); + if (!this.match(')')) { + update = this.parseExpression(); + } + } + var body; + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.isolateCoverGrammar(this.parseStatement); + this.context.inIteration = previousInIteration; + } + return (typeof left === 'undefined') ? + this.finalize(node, new Node.ForStatement(init, test, update, body)) : + forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : + this.finalize(node, new Node.ForOfStatement(left, right, body)); + }; + // https://tc39.github.io/ecma262/#sec-continue-statement + Parser.prototype.parseContinueStatement = function () { + var node = this.createNode(); + this.expectKeyword('continue'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + label = id; + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration) { + this.throwError(messages_1.Messages.IllegalContinue); + } + return this.finalize(node, new Node.ContinueStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-break-statement + Parser.prototype.parseBreakStatement = function () { + var node = this.createNode(); + this.expectKeyword('break'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + label = id; + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration && !this.context.inSwitch) { + this.throwError(messages_1.Messages.IllegalBreak); + } + return this.finalize(node, new Node.BreakStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-return-statement + Parser.prototype.parseReturnStatement = function () { + if (!this.context.inFunctionBody) { + this.tolerateError(messages_1.Messages.IllegalReturn); + } + var node = this.createNode(); + this.expectKeyword('return'); + var hasArgument = (!this.match(';') && !this.match('}') && + !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) || + this.lookahead.type === 8 /* StringLiteral */ || + this.lookahead.type === 10 /* Template */; + var argument = hasArgument ? this.parseExpression() : null; + this.consumeSemicolon(); + return this.finalize(node, new Node.ReturnStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-with-statement + Parser.prototype.parseWithStatement = function () { + if (this.context.strict) { + this.tolerateError(messages_1.Messages.StrictModeWith); + } + var node = this.createNode(); + var body; + this.expectKeyword('with'); + this.expect('('); + var object = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + body = this.parseStatement(); + } + return this.finalize(node, new Node.WithStatement(object, body)); + }; + // https://tc39.github.io/ecma262/#sec-switch-statement + Parser.prototype.parseSwitchCase = function () { + var node = this.createNode(); + var test; + if (this.matchKeyword('default')) { + this.nextToken(); + test = null; + } + else { + this.expectKeyword('case'); + test = this.parseExpression(); + } + this.expect(':'); + var consequent = []; + while (true) { + if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { + break; + } + consequent.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.SwitchCase(test, consequent)); + }; + Parser.prototype.parseSwitchStatement = function () { + var node = this.createNode(); + this.expectKeyword('switch'); + this.expect('('); + var discriminant = this.parseExpression(); + this.expect(')'); + var previousInSwitch = this.context.inSwitch; + this.context.inSwitch = true; + var cases = []; + var defaultFound = false; + this.expect('{'); + while (true) { + if (this.match('}')) { + break; + } + var clause = this.parseSwitchCase(); + if (clause.test === null) { + if (defaultFound) { + this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); + } + defaultFound = true; + } + cases.push(clause); + } + this.expect('}'); + this.context.inSwitch = previousInSwitch; + return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); + }; + // https://tc39.github.io/ecma262/#sec-labelled-statements + Parser.prototype.parseLabelledStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + var statement; + if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { + this.nextToken(); + var id = expr; + var key = '$' + id.name; + if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); + } + this.context.labelSet[key] = true; + var body = void 0; + if (this.matchKeyword('class')) { + this.tolerateUnexpectedToken(this.lookahead); + body = this.parseClassDeclaration(); + } + else if (this.matchKeyword('function')) { + var token = this.lookahead; + var declaration = this.parseFunctionDeclaration(); + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); + } + else if (declaration.generator) { + this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); + } + body = declaration; + } + else { + body = this.parseStatement(); + } + delete this.context.labelSet[key]; + statement = new Node.LabeledStatement(id, body); + } + else { + this.consumeSemicolon(); + statement = new Node.ExpressionStatement(expr); + } + return this.finalize(node, statement); + }; + // https://tc39.github.io/ecma262/#sec-throw-statement + Parser.prototype.parseThrowStatement = function () { + var node = this.createNode(); + this.expectKeyword('throw'); + if (this.hasLineTerminator) { + this.throwError(messages_1.Messages.NewlineAfterThrow); + } + var argument = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ThrowStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-try-statement + Parser.prototype.parseCatchClause = function () { + var node = this.createNode(); + this.expectKeyword('catch'); + this.expect('('); + if (this.match(')')) { + this.throwUnexpectedToken(this.lookahead); + } + var params = []; + var param = this.parsePattern(params); + var paramMap = {}; + for (var i = 0; i < params.length; i++) { + var key = '$' + params[i].value; + if (Object.prototype.hasOwnProperty.call(paramMap, key)) { + this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); + } + paramMap[key] = true; + } + if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(param.name)) { + this.tolerateError(messages_1.Messages.StrictCatchVariable); + } + } + this.expect(')'); + var body = this.parseBlock(); + return this.finalize(node, new Node.CatchClause(param, body)); + }; + Parser.prototype.parseFinallyClause = function () { + this.expectKeyword('finally'); + return this.parseBlock(); + }; + Parser.prototype.parseTryStatement = function () { + var node = this.createNode(); + this.expectKeyword('try'); + var block = this.parseBlock(); + var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; + var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; + if (!handler && !finalizer) { + this.throwError(messages_1.Messages.NoCatchOrFinally); + } + return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); + }; + // https://tc39.github.io/ecma262/#sec-debugger-statement + Parser.prototype.parseDebuggerStatement = function () { + var node = this.createNode(); + this.expectKeyword('debugger'); + this.consumeSemicolon(); + return this.finalize(node, new Node.DebuggerStatement()); + }; + // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations + Parser.prototype.parseStatement = function () { + var statement; + switch (this.lookahead.type) { + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* Template */: + case 9 /* RegularExpression */: + statement = this.parseExpressionStatement(); + break; + case 7 /* Punctuator */: + var value = this.lookahead.value; + if (value === '{') { + statement = this.parseBlock(); + } + else if (value === '(') { + statement = this.parseExpressionStatement(); + } + else if (value === ';') { + statement = this.parseEmptyStatement(); + } + else { + statement = this.parseExpressionStatement(); + } + break; + case 3 /* Identifier */: + statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); + break; + case 4 /* Keyword */: + switch (this.lookahead.value) { + case 'break': + statement = this.parseBreakStatement(); + break; + case 'continue': + statement = this.parseContinueStatement(); + break; + case 'debugger': + statement = this.parseDebuggerStatement(); + break; + case 'do': + statement = this.parseDoWhileStatement(); + break; + case 'for': + statement = this.parseForStatement(); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'if': + statement = this.parseIfStatement(); + break; + case 'return': + statement = this.parseReturnStatement(); + break; + case 'switch': + statement = this.parseSwitchStatement(); + break; + case 'throw': + statement = this.parseThrowStatement(); + break; + case 'try': + statement = this.parseTryStatement(); + break; + case 'var': + statement = this.parseVariableStatement(); + break; + case 'while': + statement = this.parseWhileStatement(); + break; + case 'with': + statement = this.parseWithStatement(); + break; + default: + statement = this.parseExpressionStatement(); + break; + } + break; + default: + statement = this.throwUnexpectedToken(this.lookahead); + } + return statement; + }; + // https://tc39.github.io/ecma262/#sec-function-definitions + Parser.prototype.parseFunctionSourceElements = function () { + var node = this.createNode(); + this.expect('{'); + var body = this.parseDirectivePrologues(); + var previousLabelSet = this.context.labelSet; + var previousInIteration = this.context.inIteration; + var previousInSwitch = this.context.inSwitch; + var previousInFunctionBody = this.context.inFunctionBody; + this.context.labelSet = {}; + this.context.inIteration = false; + this.context.inSwitch = false; + this.context.inFunctionBody = true; + while (this.lookahead.type !== 2 /* EOF */) { + if (this.match('}')) { + break; + } + body.push(this.parseStatementListItem()); + } + this.expect('}'); + this.context.labelSet = previousLabelSet; + this.context.inIteration = previousInIteration; + this.context.inSwitch = previousInSwitch; + this.context.inFunctionBody = previousInFunctionBody; + return this.finalize(node, new Node.BlockStatement(body)); + }; + Parser.prototype.validateParam = function (options, param, name) { + var key = '$' + name; + if (this.context.strict) { + if (this.scanner.isRestrictedWord(name)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + else if (!options.firstRestricted) { + if (this.scanner.isRestrictedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictParamName; + } + else if (this.scanner.isStrictModeReservedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictReservedWord; + } + else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + /* istanbul ignore next */ + if (typeof Object.defineProperty === 'function') { + Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); + } + else { + options.paramSet[key] = true; + } + }; + Parser.prototype.parseRestElement = function (params) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params); + if (this.match('=')) { + this.throwError(messages_1.Messages.DefaultRestParameter); + } + if (!this.match(')')) { + this.throwError(messages_1.Messages.ParameterAfterRestParameter); + } + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseFormalParameter = function (options) { + var params = []; + var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); + for (var i = 0; i < params.length; i++) { + this.validateParam(options, params[i], params[i].value); + } + options.simple = options.simple && (param instanceof Node.Identifier); + options.params.push(param); + }; + Parser.prototype.parseFormalParameters = function (firstRestricted) { + var options; + options = { + simple: true, + params: [], + firstRestricted: firstRestricted + }; + this.expect('('); + if (!this.match(')')) { + options.paramSet = {}; + while (this.lookahead.type !== 2 /* EOF */) { + this.parseFormalParameter(options); + if (this.match(')')) { + break; + } + this.expect(','); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return { + simple: options.simple, + params: options.params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.matchAsyncFunction = function () { + var match = this.matchContextualKeyword('async'); + if (match) { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); + } + return match; + }; + Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted = null; + if (!identifierIsOptional || !this.match('(')) { + var token = this.lookahead; + id = this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : + this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); + }; + Parser.prototype.parseFunctionExpression = function () { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted; + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + if (!this.match('(')) { + var token = this.lookahead; + id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : + this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive + Parser.prototype.parseDirective = function () { + var token = this.lookahead; + var node = this.createNode(); + var expr = this.parseExpression(); + var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; + this.consumeSemicolon(); + return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); + }; + Parser.prototype.parseDirectivePrologues = function () { + var firstRestricted = null; + var body = []; + while (true) { + var token = this.lookahead; + if (token.type !== 8 /* StringLiteral */) { + break; + } + var statement = this.parseDirective(); + body.push(statement); + var directive = statement.directive; + if (typeof directive !== 'string') { + break; + } + if (directive === 'use strict') { + this.context.strict = true; + if (firstRestricted) { + this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); + } + if (!this.context.allowStrictDirective) { + this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); + } + } + else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + return body; + }; + // https://tc39.github.io/ecma262/#sec-method-definitions + Parser.prototype.qualifiedPropertyName = function (token) { + switch (token.type) { + case 3 /* Identifier */: + case 8 /* StringLiteral */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 4 /* Keyword */: + return true; + case 7 /* Punctuator */: + return token.value === '['; + default: + break; + } + return false; + }; + Parser.prototype.parseGetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length > 0) { + this.tolerateError(messages_1.Messages.BadGetterArity); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseSetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length !== 1) { + this.tolerateError(messages_1.Messages.BadSetterArity); + } + else if (formalParameters.params[0] instanceof Node.RestElement) { + this.tolerateError(messages_1.Messages.BadSetterRestParameter); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseGeneratorMethod = function () { + var node = this.createNode(); + var isGenerator = true; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + this.context.allowYield = false; + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-generator-function-definitions + Parser.prototype.isStartOfExpression = function () { + var start = true; + var value = this.lookahead.value; + switch (this.lookahead.type) { + case 7 /* Punctuator */: + start = (value === '[') || (value === '(') || (value === '{') || + (value === '+') || (value === '-') || + (value === '!') || (value === '~') || + (value === '++') || (value === '--') || + (value === '/') || (value === '/='); // regular expression literal + break; + case 4 /* Keyword */: + start = (value === 'class') || (value === 'delete') || + (value === 'function') || (value === 'let') || (value === 'new') || + (value === 'super') || (value === 'this') || (value === 'typeof') || + (value === 'void') || (value === 'yield'); + break; + default: + break; + } + return start; + }; + Parser.prototype.parseYieldExpression = function () { + var node = this.createNode(); + this.expectKeyword('yield'); + var argument = null; + var delegate = false; + if (!this.hasLineTerminator) { + var previousAllowYield = this.context.allowYield; + this.context.allowYield = false; + delegate = this.match('*'); + if (delegate) { + this.nextToken(); + argument = this.parseAssignmentExpression(); + } + else if (this.isStartOfExpression()) { + argument = this.parseAssignmentExpression(); + } + this.context.allowYield = previousAllowYield; + } + return this.finalize(node, new Node.YieldExpression(argument, delegate)); + }; + // https://tc39.github.io/ecma262/#sec-class-definitions + Parser.prototype.parseClassElement = function (hasConstructor) { + var token = this.lookahead; + var node = this.createNode(); + var kind = ''; + var key = null; + var value = null; + var computed = false; + var method = false; + var isStatic = false; + var isAsync = false; + if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + var id = key; + if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { + token = this.lookahead; + isStatic = true; + computed = this.match('['); + if (this.match('*')) { + this.nextToken(); + } + else { + key = this.parseObjectPropertyKey(); + } + } + if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { + var punctuator = this.lookahead.value; + if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { + isAsync = true; + token = this.lookahead; + key = this.parseObjectPropertyKey(); + if (token.type === 3 /* Identifier */ && token.value === 'constructor') { + this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); + } + } + } + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */) { + if (token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + if (!kind && key && this.match('(')) { + kind = 'init'; + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + if (!kind) { + this.throwUnexpectedToken(this.lookahead); + } + if (kind === 'init') { + kind = 'method'; + } + if (!computed) { + if (isStatic && this.isPropertyKey(key, 'prototype')) { + this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); + } + if (!isStatic && this.isPropertyKey(key, 'constructor')) { + if (kind !== 'method' || !method || (value && value.generator)) { + this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); + } + if (hasConstructor.value) { + this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); + } + else { + hasConstructor.value = true; + } + kind = 'constructor'; + } + } + return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); + }; + Parser.prototype.parseClassElementList = function () { + var body = []; + var hasConstructor = { value: false }; + this.expect('{'); + while (!this.match('}')) { + if (this.match(';')) { + this.nextToken(); + } + else { + body.push(this.parseClassElement(hasConstructor)); + } + } + this.expect('}'); + return body; + }; + Parser.prototype.parseClassBody = function () { + var node = this.createNode(); + var elementList = this.parseClassElementList(); + return this.finalize(node, new Node.ClassBody(elementList)); + }; + Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); + }; + Parser.prototype.parseClassExpression = function () { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); + }; + // https://tc39.github.io/ecma262/#sec-scripts + // https://tc39.github.io/ecma262/#sec-modules + Parser.prototype.parseModule = function () { + this.context.strict = true; + this.context.isModule = true; + this.scanner.isModule = true; + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Module(body)); + }; + Parser.prototype.parseScript = function () { + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Script(body)); + }; + // https://tc39.github.io/ecma262/#sec-imports + Parser.prototype.parseModuleSpecifier = function () { + var node = this.createNode(); + if (this.lookahead.type !== 8 /* StringLiteral */) { + this.throwError(messages_1.Messages.InvalidModuleSpecifier); + } + var token = this.nextToken(); + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + // import {} ...; + Parser.prototype.parseImportSpecifier = function () { + var node = this.createNode(); + var imported; + var local; + if (this.lookahead.type === 3 /* Identifier */) { + imported = this.parseVariableIdentifier(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + } + else { + imported = this.parseIdentifierName(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.ImportSpecifier(local, imported)); + }; + // {foo, bar as bas} + Parser.prototype.parseNamedImports = function () { + this.expect('{'); + var specifiers = []; + while (!this.match('}')) { + specifiers.push(this.parseImportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return specifiers; + }; + // import ...; + Parser.prototype.parseImportDefaultSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportDefaultSpecifier(local)); + }; + // import <* as foo> ...; + Parser.prototype.parseImportNamespaceSpecifier = function () { + var node = this.createNode(); + this.expect('*'); + if (!this.matchContextualKeyword('as')) { + this.throwError(messages_1.Messages.NoAsAfterImportNamespace); + } + this.nextToken(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); + }; + Parser.prototype.parseImportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalImportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('import'); + var src; + var specifiers = []; + if (this.lookahead.type === 8 /* StringLiteral */) { + // import 'foo'; + src = this.parseModuleSpecifier(); + } + else { + if (this.match('{')) { + // import {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else if (this.match('*')) { + // import * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { + // import foo + specifiers.push(this.parseImportDefaultSpecifier()); + if (this.match(',')) { + this.nextToken(); + if (this.match('*')) { + // import foo, * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.match('{')) { + // import foo, {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + src = this.parseModuleSpecifier(); + } + this.consumeSemicolon(); + return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); + }; + // https://tc39.github.io/ecma262/#sec-exports + Parser.prototype.parseExportSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + var exported = local; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + exported = this.parseIdentifierName(); + } + return this.finalize(node, new Node.ExportSpecifier(local, exported)); + }; + Parser.prototype.parseExportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalExportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('export'); + var exportDeclaration; + if (this.matchKeyword('default')) { + // export default ... + this.nextToken(); + if (this.matchKeyword('function')) { + // export default function foo () {} + // export default function () {} + var declaration = this.parseFunctionDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchKeyword('class')) { + // export default class foo {} + var declaration = this.parseClassDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchContextualKeyword('async')) { + // export default async function f () {} + // export default async function () {} + // export default async x => x + var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else { + if (this.matchContextualKeyword('from')) { + this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); + } + // export default {}; + // export default []; + // export default (1 + 2); + var declaration = this.match('{') ? this.parseObjectInitializer() : + this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + } + else if (this.match('*')) { + // export * from 'foo'; + this.nextToken(); + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + var src = this.parseModuleSpecifier(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); + } + else if (this.lookahead.type === 4 /* Keyword */) { + // export var f = 1; + var declaration = void 0; + switch (this.lookahead.value) { + case 'let': + case 'const': + declaration = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'var': + case 'class': + case 'function': + declaration = this.parseStatementListItem(); + break; + default: + this.throwUnexpectedToken(this.lookahead); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else if (this.matchAsyncFunction()) { + var declaration = this.parseFunctionDeclaration(); + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else { + var specifiers = []; + var source = null; + var isExportFromIdentifier = false; + this.expect('{'); + while (!this.match('}')) { + isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); + specifiers.push(this.parseExportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + if (this.matchContextualKeyword('from')) { + // export {default} from 'foo'; + // export {foo} from 'foo'; + this.nextToken(); + source = this.parseModuleSpecifier(); + this.consumeSemicolon(); + } + else if (isExportFromIdentifier) { + // export {default}; // missing fromClause + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + else { + // export {foo}; + this.consumeSemicolon(); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); + } + return exportDeclaration; + }; + return Parser; + }()); + exports.Parser = Parser; + + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + "use strict"; + // Ensure the condition is true, otherwise throw an error. + // This is only to have a better contract semantic, i.e. another safety net + // to catch a logic error. The condition shall be fulfilled in normal case. + // Do NOT use this to enforce a certain condition on any user input. + Object.defineProperty(exports, "__esModule", { value: true }); + function assert(condition, message) { + /* istanbul ignore if */ + if (!condition) { + throw new Error('ASSERT: ' + message); + } + } + exports.assert = assert; + + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + "use strict"; + /* tslint:disable:max-classes-per-file */ + Object.defineProperty(exports, "__esModule", { value: true }); + var ErrorHandler = (function () { + function ErrorHandler() { + this.errors = []; + this.tolerant = false; + } + ErrorHandler.prototype.recordError = function (error) { + this.errors.push(error); + }; + ErrorHandler.prototype.tolerate = function (error) { + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + ErrorHandler.prototype.constructError = function (msg, column) { + var error = new Error(msg); + try { + throw error; + } + catch (base) { + /* istanbul ignore else */ + if (Object.create && Object.defineProperty) { + error = Object.create(base); + Object.defineProperty(error, 'column', { value: column }); + } + } + /* istanbul ignore next */ + return error; + }; + ErrorHandler.prototype.createError = function (index, line, col, description) { + var msg = 'Line ' + line + ': ' + description; + var error = this.constructError(msg, col); + error.index = index; + error.lineNumber = line; + error.description = description; + return error; + }; + ErrorHandler.prototype.throwError = function (index, line, col, description) { + throw this.createError(index, line, col, description); + }; + ErrorHandler.prototype.tolerateError = function (index, line, col, description) { + var error = this.createError(index, line, col, description); + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + return ErrorHandler; + }()); + exports.ErrorHandler = ErrorHandler; + + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // Error messages should be identical to V8. + exports.Messages = { + BadGetterArity: 'Getter must not have any formal parameters', + BadSetterArity: 'Setter must have exactly one formal parameter', + BadSetterRestParameter: 'Setter function argument must not be a rest parameter', + ConstructorIsAsync: 'Class constructor may not be an async method', + ConstructorSpecialMethod: 'Class constructor may not be an accessor', + DeclarationMissingInitializer: 'Missing initializer in %0 declaration', + DefaultRestParameter: 'Unexpected token =', + DuplicateBinding: 'Duplicate binding %0', + DuplicateConstructor: 'A class may only have one constructor', + DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', + ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', + GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', + IllegalBreak: 'Illegal break statement', + IllegalContinue: 'Illegal continue statement', + IllegalExportDeclaration: 'Unexpected token', + IllegalImportDeclaration: 'Unexpected token', + IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', + IllegalReturn: 'Illegal return statement', + InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', + InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', + InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', + InvalidModuleSpecifier: 'Unexpected token', + InvalidRegExp: 'Invalid regular expression', + LetInLexicalBinding: 'let is disallowed as a lexically bound name', + MissingFromClause: 'Unexpected token', + MultipleDefaultsInSwitch: 'More than one default clause in switch statement', + NewlineAfterThrow: 'Illegal newline after throw', + NoAsAfterImportNamespace: 'Unexpected token', + NoCatchOrFinally: 'Missing catch or finally after try', + ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', + Redeclaration: '%0 \'%1\' has already been declared', + StaticPrototype: 'Classes may not have static property named prototype', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictParamDupe: 'Strict mode function may not have duplicate parameter names', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', + UnexpectedEOS: 'Unexpected end of input', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedNumber: 'Unexpected number', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedString: 'Unexpected string', + UnexpectedTemplate: 'Unexpected quasi %0', + UnexpectedToken: 'Unexpected token %0', + UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', + UnknownLabel: 'Undefined label \'%0\'', + UnterminatedRegExp: 'Invalid regular expression: missing /' + }; + + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var character_1 = __webpack_require__(4); + var messages_1 = __webpack_require__(11); + function hexValue(ch) { + return '0123456789abcdef'.indexOf(ch.toLowerCase()); + } + function octalValue(ch) { + return '01234567'.indexOf(ch); + } + var Scanner = (function () { + function Scanner(code, handler) { + this.source = code; + this.errorHandler = handler; + this.trackComment = false; + this.isModule = false; + this.length = code.length; + this.index = 0; + this.lineNumber = (code.length > 0) ? 1 : 0; + this.lineStart = 0; + this.curlyStack = []; + } + Scanner.prototype.saveState = function () { + return { + index: this.index, + lineNumber: this.lineNumber, + lineStart: this.lineStart + }; + }; + Scanner.prototype.restoreState = function (state) { + this.index = state.index; + this.lineNumber = state.lineNumber; + this.lineStart = state.lineStart; + }; + Scanner.prototype.eof = function () { + return this.index >= this.length; + }; + Scanner.prototype.throwUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + Scanner.prototype.tolerateUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + // https://tc39.github.io/ecma262/#sec-comments + Scanner.prototype.skipSingleLineComment = function (offset) { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - offset; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - offset + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + ++this.index; + if (character_1.Character.isLineTerminator(ch)) { + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart - 1 + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index - 1], + range: [start, this.index - 1], + loc: loc + }; + comments.push(entry); + } + if (ch === 13 && this.source.charCodeAt(this.index) === 10) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + return comments; + } + } + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + }; + Scanner.prototype.skipMultiLineComment = function () { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - 2; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - 2 + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isLineTerminator(ch)) { + if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + ++this.index; + this.lineStart = this.index; + } + else if (ch === 0x2A) { + // Block comment ends with '*/'. + if (this.source.charCodeAt(this.index + 1) === 0x2F) { + this.index += 2; + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index - 2], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + } + ++this.index; + } + else { + ++this.index; + } + } + // Ran off the end of the file - the whole thing is a comment + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + this.tolerateUnexpectedToken(); + return comments; + }; + Scanner.prototype.scanComments = function () { + var comments; + if (this.trackComment) { + comments = []; + } + var start = (this.index === 0); + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isWhiteSpace(ch)) { + ++this.index; + } + else if (character_1.Character.isLineTerminator(ch)) { + ++this.index; + if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + start = true; + } + else if (ch === 0x2F) { + ch = this.source.charCodeAt(this.index + 1); + if (ch === 0x2F) { + this.index += 2; + var comment = this.skipSingleLineComment(2); + if (this.trackComment) { + comments = comments.concat(comment); + } + start = true; + } + else if (ch === 0x2A) { + this.index += 2; + var comment = this.skipMultiLineComment(); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (start && ch === 0x2D) { + // U+003E is '>' + if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { + // '-->' is a single-line comment + this.index += 3; + var comment = this.skipSingleLineComment(3); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (ch === 0x3C && !this.isModule) { + if (this.source.slice(this.index + 1, this.index + 4) === '!--') { + this.index += 4; // ` + +```js +var etag = require('etag') +``` + +### etag(entity, [options]) + +Generate a strong ETag for the given entity. This should be the complete +body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By +default, a strong ETag is generated except for `fs.Stats`, which will +generate a weak ETag (this can be overwritten by `options.weak`). + + + +```js +res.setHeader('ETag', etag(body)) +``` + +#### Options + +`etag` accepts these properties in the options object. + +##### weak + +Specifies if the generated ETag will include the weak validator mark (that +is, the leading `W/`). The actual entity tag is the same. The default value +is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`. + +## Testing + +```sh +$ npm test +``` + +## Benchmark + +```bash +$ npm run-script bench + +> etag@1.8.1 bench nodejs-etag +> node benchmark/index.js + + http_parser@2.7.0 + node@6.11.1 + v8@5.1.281.103 + uv@1.11.0 + zlib@1.2.11 + ares@1.10.1-DEV + icu@58.2 + modules@48 + openssl@1.0.2k + +> node benchmark/body0-100b.js + + 100B body + + 4 tests completed. + + buffer - strong x 258,647 ops/sec ±1.07% (180 runs sampled) + buffer - weak x 263,812 ops/sec ±0.61% (184 runs sampled) + string - strong x 259,955 ops/sec ±1.19% (185 runs sampled) + string - weak x 264,356 ops/sec ±1.09% (184 runs sampled) + +> node benchmark/body1-1kb.js + + 1KB body + + 4 tests completed. + + buffer - strong x 189,018 ops/sec ±1.12% (182 runs sampled) + buffer - weak x 190,586 ops/sec ±0.81% (186 runs sampled) + string - strong x 144,272 ops/sec ±0.96% (188 runs sampled) + string - weak x 145,380 ops/sec ±1.43% (187 runs sampled) + +> node benchmark/body2-5kb.js + + 5KB body + + 4 tests completed. + + buffer - strong x 92,435 ops/sec ±0.42% (188 runs sampled) + buffer - weak x 92,373 ops/sec ±0.58% (189 runs sampled) + string - strong x 48,850 ops/sec ±0.56% (186 runs sampled) + string - weak x 49,380 ops/sec ±0.56% (190 runs sampled) + +> node benchmark/body3-10kb.js + + 10KB body + + 4 tests completed. + + buffer - strong x 55,989 ops/sec ±0.93% (188 runs sampled) + buffer - weak x 56,148 ops/sec ±0.55% (190 runs sampled) + string - strong x 27,345 ops/sec ±0.43% (188 runs sampled) + string - weak x 27,496 ops/sec ±0.45% (190 runs sampled) + +> node benchmark/body4-100kb.js + + 100KB body + + 4 tests completed. + + buffer - strong x 7,083 ops/sec ±0.22% (190 runs sampled) + buffer - weak x 7,115 ops/sec ±0.26% (191 runs sampled) + string - strong x 3,068 ops/sec ±0.34% (190 runs sampled) + string - weak x 3,096 ops/sec ±0.35% (190 runs sampled) + +> node benchmark/stats.js + + stat + + 4 tests completed. + + real - strong x 871,642 ops/sec ±0.34% (189 runs sampled) + real - weak x 867,613 ops/sec ±0.39% (190 runs sampled) + fake - strong x 401,051 ops/sec ±0.40% (189 runs sampled) + fake - weak x 400,100 ops/sec ±0.47% (188 runs sampled) +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/etag.svg +[npm-url]: https://npmjs.org/package/etag +[node-version-image]: https://img.shields.io/node/v/etag.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg +[travis-url]: https://travis-ci.org/jshttp/etag +[coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/etag?branch=master +[downloads-image]: https://img.shields.io/npm/dm/etag.svg +[downloads-url]: https://npmjs.org/package/etag diff --git a/node_modules/etag/index.js b/node_modules/etag/index.js new file mode 100644 index 0000000..2a585c9 --- /dev/null +++ b/node_modules/etag/index.js @@ -0,0 +1,131 @@ +/*! + * etag + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = etag + +/** + * Module dependencies. + * @private + */ + +var crypto = require('crypto') +var Stats = require('fs').Stats + +/** + * Module variables. + * @private + */ + +var toString = Object.prototype.toString + +/** + * Generate an entity tag. + * + * @param {Buffer|string} entity + * @return {string} + * @private + */ + +function entitytag (entity) { + if (entity.length === 0) { + // fast-path empty + return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' + } + + // compute hash of entity + var hash = crypto + .createHash('sha1') + .update(entity, 'utf8') + .digest('base64') + .substring(0, 27) + + // compute length of entity + var len = typeof entity === 'string' + ? Buffer.byteLength(entity, 'utf8') + : entity.length + + return '"' + len.toString(16) + '-' + hash + '"' +} + +/** + * Create a simple ETag. + * + * @param {string|Buffer|Stats} entity + * @param {object} [options] + * @param {boolean} [options.weak] + * @return {String} + * @public + */ + +function etag (entity, options) { + if (entity == null) { + throw new TypeError('argument entity is required') + } + + // support fs.Stats object + var isStats = isstats(entity) + var weak = options && typeof options.weak === 'boolean' + ? options.weak + : isStats + + // validate argument + if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { + throw new TypeError('argument entity must be string, Buffer, or fs.Stats') + } + + // generate entity tag + var tag = isStats + ? stattag(entity) + : entitytag(entity) + + return weak + ? 'W/' + tag + : tag +} + +/** + * Determine if object is a Stats object. + * + * @param {object} obj + * @return {boolean} + * @api private + */ + +function isstats (obj) { + // genuine fs.Stats + if (typeof Stats === 'function' && obj instanceof Stats) { + return true + } + + // quack quack + return obj && typeof obj === 'object' && + 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && + 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && + 'ino' in obj && typeof obj.ino === 'number' && + 'size' in obj && typeof obj.size === 'number' +} + +/** + * Generate a tag for a stat. + * + * @param {object} stat + * @return {string} + * @private + */ + +function stattag (stat) { + var mtime = stat.mtime.getTime().toString(16) + var size = stat.size.toString(16) + + return '"' + size + '-' + mtime + '"' +} diff --git a/node_modules/etag/package.json b/node_modules/etag/package.json new file mode 100644 index 0000000..b06ab80 --- /dev/null +++ b/node_modules/etag/package.json @@ -0,0 +1,47 @@ +{ + "name": "etag", + "description": "Create simple HTTP ETags", + "version": "1.8.1", + "contributors": [ + "Douglas Christopher Wilson ", + "David Björklund " + ], + "license": "MIT", + "keywords": [ + "etag", + "http", + "res" + ], + "repository": "jshttp/etag", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5", + "safe-buffer": "5.1.1", + "seedrandom": "2.4.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/node_modules/express/History.md b/node_modules/express/History.md new file mode 100644 index 0000000..5b6cba5 --- /dev/null +++ b/node_modules/express/History.md @@ -0,0 +1,3858 @@ +5.1.0 / 2025-03-31 +======================== + +* Add support for `Uint8Array` in `res.send()` +* Add support for ETag option in `res.sendFile()` +* Add support for multiple links with the same rel in `res.links()` +* Add funding field to package.json +* perf: use loop for acceptParams +* refactor: prefix built-in node module imports +* deps: remove `setprototypeof` +* deps: remove `safe-buffer` +* deps: remove `utils-merge` +* deps: remove `methods` +* deps: remove `depd` +* deps: `debug@^4.4.0` +* deps: `body-parser@^2.2.0` +* deps: `router@^2.2.0` +* deps: `content-type@^1.0.5` +* deps: `finalhandler@^2.1.0` +* deps: `qs@^6.14.0` +* deps: `server-static@2.2.0` +* deps: `type-is@2.0.1` + +5.0.1 / 2024-10-08 +========== + +* Update `cookie` semver lock to address [CVE-2024-47764](https://nvd.nist.gov/vuln/detail/CVE-2024-47764) + +5.0.0 / 2024-09-10 +========================= +* remove: + - `path-is-absolute` dependency - use `path.isAbsolute` instead +* breaking: + * `res.status()` accepts only integers, and input must be greater than 99 and less than 1000 + * will throw a `RangeError: Invalid status code: ${code}. Status code must be greater than 99 and less than 1000.` for inputs outside this range + * will throw a `TypeError: Invalid status code: ${code}. Status code must be an integer.` for non integer inputs + * deps: send@1.0.0 + * `res.redirect('back')` and `res.location('back')` is no longer a supported magic string, explicitly use `req.get('Referrer') || '/'`. +* change: + - `res.clearCookie` will ignore user provided `maxAge` and `expires` options +* deps: cookie-signature@^1.2.1 +* deps: debug@4.3.6 +* deps: merge-descriptors@^2.0.0 +* deps: serve-static@^2.1.0 +* deps: qs@6.13.0 +* deps: accepts@^2.0.0 +* deps: mime-types@^3.0.0 + - `application/javascript` => `text/javascript` +* deps: type-is@^2.0.0 +* deps: content-disposition@^1.0.0 +* deps: finalhandler@^2.0.0 +* deps: fresh@^2.0.0 +* deps: body-parser@^2.0.1 +* deps: send@^1.1.0 + +5.0.0-beta.3 / 2024-03-25 +========================= + +This incorporates all changes after 4.19.1 up to 4.19.2. + +5.0.0-beta.2 / 2024-03-20 +========================= + +This incorporates all changes after 4.17.2 up to 4.19.1. + +5.0.0-beta.1 / 2022-02-14 +========================= + +This is the first Express 5.0 beta release, based off 4.17.2 and includes +changes from 5.0.0-alpha.8. + + * change: + - Default "query parser" setting to `'simple'` + - Requires Node.js 4+ + - Use `mime-types` for file to content type mapping + * deps: array-flatten@3.0.0 + * deps: body-parser@2.0.0-beta.1 + - `req.body` is no longer always initialized to `{}` + - `urlencoded` parser now defaults `extended` to `false` + - Use `on-finished` to determine when body read + * deps: router@2.0.0-beta.1 + - Add new `?`, `*`, and `+` parameter modifiers + - Internalize private `router.process_params` method + - Matching group expressions are only RegExp syntax + - Named matching groups no longer available by position in `req.params` + - Regular expressions can only be used in a matching group + - Remove `debug` dependency + - Special `*` path segment behavior removed + - deps: array-flatten@3.0.0 + - deps: parseurl@~1.3.3 + - deps: path-to-regexp@3.2.0 + - deps: setprototypeof@1.2.0 + * deps: send@1.0.0-beta.1 + - Change `dotfiles` option default to `'ignore'` + - Remove `hidden` option; use `dotfiles` option instead + - Use `mime-types` for file to content type mapping + - deps: debug@3.1.0 + * deps: serve-static@2.0.0-beta.1 + - Change `dotfiles` option default to `'ignore'` + - Remove `hidden` option; use `dotfiles` option instead + - Use `mime-types` for file to content type mapping + - Remove `express.static.mime` export; use `mime-types` package instead + - deps: send@1.0.0-beta.1 + +5.0.0-alpha.8 / 2020-03-25 +========================== + +This is the eighth Express 5.0 alpha release, based off 4.17.1 and includes +changes from 5.0.0-alpha.7. + +5.0.0-alpha.7 / 2018-10-26 +========================== + +This is the seventh Express 5.0 alpha release, based off 4.16.4 and includes +changes from 5.0.0-alpha.6. + +The major change with this alpha is the basic support for returned, rejected +Promises in the router. + + * remove: + - `path-to-regexp` dependency + * deps: debug@3.1.0 + - Add `DEBUG_HIDE_DATE` environment variable + - Change timer to per-namespace instead of global + - Change non-TTY date format + - Remove `DEBUG_FD` environment variable support + - Support 256 namespace colors + * deps: router@2.0.0-alpha.1 + - Add basic support for returned, rejected Promises + - Fix JSDoc for `Router` constructor + - deps: debug@3.1.0 + - deps: parseurl@~1.3.2 + - deps: setprototypeof@1.1.0 + - deps: utils-merge@1.0.1 + +5.0.0-alpha.6 / 2017-09-24 +========================== + +This is the sixth Express 5.0 alpha release, based off 4.15.5 and includes +changes from 5.0.0-alpha.5. + + * remove: + - `res.redirect(url, status)` signature - use `res.redirect(status, url)` + - `res.send(status, body)` signature - use `res.status(status).send(body)` + * deps: router@~1.3.1 + - deps: debug@2.6.8 + +5.0.0-alpha.5 / 2017-03-06 +========================== + +This is the fifth Express 5.0 alpha release, based off 4.15.2 and includes +changes from 5.0.0-alpha.4. + +5.0.0-alpha.4 / 2017-03-01 +========================== + +This is the fourth Express 5.0 alpha release, based off 4.15.0 and includes +changes from 5.0.0-alpha.3. + + * remove: + - Remove Express 3.x middleware error stubs + * deps: router@~1.3.0 + - Add `next("router")` to exit from router + - Fix case where `router.use` skipped requests routes did not + - Skip routing when `req.url` is not set + - Use `%o` in path debug to tell types apart + - deps: debug@2.6.1 + - deps: setprototypeof@1.0.3 + - perf: add fast match path for `*` route + +5.0.0-alpha.3 / 2017-01-28 +========================== + +This is the third Express 5.0 alpha release, based off 4.14.1 and includes +changes from 5.0.0-alpha.2. + + * remove: + - `res.json(status, obj)` signature - use `res.status(status).json(obj)` + - `res.jsonp(status, obj)` signature - use `res.status(status).jsonp(obj)` + - `res.vary()` (no arguments) -- provide a field name as an argument + * deps: array-flatten@2.1.1 + * deps: path-is-absolute@1.0.1 + * deps: router@~1.1.5 + - deps: array-flatten@2.0.1 + - deps: methods@~1.1.2 + - deps: parseurl@~1.3.1 + - deps: setprototypeof@1.0.2 + +5.0.0-alpha.2 / 2015-07-06 +========================== + +This is the second Express 5.0 alpha release, based off 4.13.1 and includes +changes from 5.0.0-alpha.1. + + * remove: + - `app.param(fn)` + - `req.param()` -- use `req.params`, `req.body`, or `req.query` instead + * change: + - `res.render` callback is always async, even for sync view engines + - The leading `:` character in `name` for `app.param(name, fn)` is no longer removed + - Use `router` module for routing + - Use `path-is-absolute` module for absolute path detection + +5.0.0-alpha.1 / 2014-11-06 +========================== + +This is the first Express 5.0 alpha release, based off 4.10.1. + + * remove: + - `app.del` - use `app.delete` + - `req.acceptsCharset` - use `req.acceptsCharsets` + - `req.acceptsEncoding` - use `req.acceptsEncodings` + - `req.acceptsLanguage` - use `req.acceptsLanguages` + - `res.json(obj, status)` signature - use `res.json(status, obj)` + - `res.jsonp(obj, status)` signature - use `res.jsonp(status, obj)` + - `res.send(body, status)` signature - use `res.send(status, body)` + - `res.send(status)` signature - use `res.sendStatus(status)` + - `res.sendfile` - use `res.sendFile` instead + - `express.query` middleware + * change: + - `req.host` now returns host (`hostname:port`) - use `req.hostname` for only hostname + - `req.query` is now a getter instead of a plain property + * add: + - `app.router` is a reference to the base router + +4.20.0 / 2024-09-10 +========== + * deps: serve-static@0.16.0 + * Remove link renderization in html while redirecting + * deps: send@0.19.0 + * Remove link renderization in html while redirecting + * deps: body-parser@0.6.0 + * add `depth` option to customize the depth level in the parser + * IMPORTANT: The default `depth` level for parsing URL-encoded data is now `32` (previously was `Infinity`) + * Remove link renderization in html while using `res.redirect` + * deps: path-to-regexp@0.1.10 + - Adds support for named matching groups in the routes using a regex + - Adds backtracking protection to parameters without regexes defined + * deps: encodeurl@~2.0.0 + - Removes encoding of `\`, `|`, and `^` to align better with URL spec + * Deprecate passing `options.maxAge` and `options.expires` to `res.clearCookie` + - Will be ignored in v5, clearCookie will set a cookie with an expires in the past to instruct clients to delete the cookie + +4.19.2 / 2024-03-25 +========== + + * Improved fix for open redirect allow list bypass + +4.19.1 / 2024-03-20 +========== + + * Allow passing non-strings to res.location with new encoding handling checks + +4.19.0 / 2024-03-20 +========== + + * Prevent open redirect allow list bypass due to encodeurl + * deps: cookie@0.6.0 + +4.18.3 / 2024-02-29 +========== + + * Fix routing requests without method + * deps: body-parser@1.20.2 + - Fix strict json error message on Node.js 19+ + - deps: content-type@~1.0.5 + - deps: raw-body@2.5.2 + * deps: cookie@0.6.0 + - Add `partitioned` option + +4.18.2 / 2022-10-08 +=================== + + * Fix regression routing a large stack in a single route + * deps: body-parser@1.20.1 + - deps: qs@6.11.0 + - perf: remove unnecessary object clone + * deps: qs@6.11.0 + +4.18.1 / 2022-04-29 +=================== + + * Fix hanging on large stack of sync routes + +4.18.0 / 2022-04-25 +=================== + + * Add "root" option to `res.download` + * Allow `options` without `filename` in `res.download` + * Deprecate string and non-integer arguments to `res.status` + * Fix behavior of `null`/`undefined` as `maxAge` in `res.cookie` + * Fix handling very large stacks of sync middleware + * Ignore `Object.prototype` values in settings through `app.set`/`app.get` + * Invoke `default` with same arguments as types in `res.format` + * Support proper 205 responses using `res.send` + * Use `http-errors` for `res.format` error + * deps: body-parser@1.20.0 + - Fix error message for json parse whitespace in `strict` + - Fix internal error when inflated body exceeds limit + - Prevent loss of async hooks context + - Prevent hanging when request already read + - deps: depd@2.0.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: qs@6.10.3 + - deps: raw-body@2.5.1 + * deps: cookie@0.5.0 + - Add `priority` option + - Fix `expires` option to reject invalid dates + * deps: depd@2.0.0 + - Replace internal `eval` usage with `Function` constructor + - Use instance methods on `process` to check for listeners + * deps: finalhandler@1.2.0 + - Remove set content headers that break response + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + * deps: on-finished@2.4.1 + - Prevent loss of async hooks context + * deps: qs@6.10.3 + * deps: send@0.18.0 + - Fix emitted 416 error missing headers property + - Limit the headers removed for 304 response + - deps: depd@2.0.0 + - deps: destroy@1.2.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + * deps: serve-static@1.15.0 + - deps: send@0.18.0 + * deps: statuses@2.0.1 + - Remove code 306 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +4.17.3 / 2022-02-16 +=================== + + * deps: accepts@~1.3.8 + - deps: mime-types@~2.1.34 + - deps: negotiator@0.6.3 + * deps: body-parser@1.19.2 + - deps: bytes@3.1.2 + - deps: qs@6.9.7 + - deps: raw-body@2.4.3 + * deps: cookie@0.4.2 + * deps: qs@6.9.7 + * Fix handling of `__proto__` keys + * pref: remove unnecessary regexp for trust proxy + +4.17.2 / 2021-12-16 +=================== + + * Fix handling of `undefined` in `res.jsonp` + * Fix handling of `undefined` when `"json escape"` is enabled + * Fix incorrect middleware execution with unanchored `RegExp`s + * Fix `res.jsonp(obj, status)` deprecation message + * Fix typo in `res.is` JSDoc + * deps: body-parser@1.19.1 + - deps: bytes@3.1.1 + - deps: http-errors@1.8.1 + - deps: qs@6.9.6 + - deps: raw-body@2.4.2 + - deps: safe-buffer@5.2.1 + - deps: type-is@~1.6.18 + * deps: content-disposition@0.5.4 + - deps: safe-buffer@5.2.1 + * deps: cookie@0.4.1 + - Fix `maxAge` option to reject invalid values + * deps: proxy-addr@~2.0.7 + - Use `req.socket` over deprecated `req.connection` + - deps: forwarded@0.2.0 + - deps: ipaddr.js@1.9.1 + * deps: qs@6.9.6 + * deps: safe-buffer@5.2.1 + * deps: send@0.17.2 + - deps: http-errors@1.8.1 + - deps: ms@2.1.3 + - pref: ignore empty http tokens + * deps: serve-static@1.14.2 + - deps: send@0.17.2 + * deps: setprototypeof@1.2.0 + +4.17.1 / 2019-05-25 +=================== + + * Revert "Improve error message for `null`/`undefined` to `res.status`" + +4.17.0 / 2019-05-16 +=================== + + * Add `express.raw` to parse bodies into `Buffer` + * Add `express.text` to parse bodies into string + * Improve error message for non-strings to `res.sendFile` + * Improve error message for `null`/`undefined` to `res.status` + * Support multiple hosts in `X-Forwarded-Host` + * deps: accepts@~1.3.7 + * deps: body-parser@1.19.0 + - Add encoding MIK + - Add petabyte (`pb`) support + - Fix parsing array brackets after index + - deps: bytes@3.1.0 + - deps: http-errors@1.7.2 + - deps: iconv-lite@0.4.24 + - deps: qs@6.7.0 + - deps: raw-body@2.4.0 + - deps: type-is@~1.6.17 + * deps: content-disposition@0.5.3 + * deps: cookie@0.4.0 + - Add `SameSite=None` support + * deps: finalhandler@~1.1.2 + - Set stricter `Content-Security-Policy` header + - deps: parseurl@~1.3.3 + - deps: statuses@~1.5.0 + * deps: parseurl@~1.3.3 + * deps: proxy-addr@~2.0.5 + - deps: ipaddr.js@1.9.0 + * deps: qs@6.7.0 + - Fix parsing array brackets after index + * deps: range-parser@~1.2.1 + * deps: send@0.17.1 + - Set stricter CSP header in redirect & error responses + - deps: http-errors@~1.7.2 + - deps: mime@1.6.0 + - deps: ms@2.1.1 + - deps: range-parser@~1.2.1 + - deps: statuses@~1.5.0 + - perf: remove redundant `path.normalize` call + * deps: serve-static@1.14.1 + - Set stricter CSP header in redirect response + - deps: parseurl@~1.3.3 + - deps: send@0.17.1 + * deps: setprototypeof@1.1.1 + * deps: statuses@~1.5.0 + - Add `103 Early Hints` + * deps: type-is@~1.6.18 + - deps: mime-types@~2.1.24 + - perf: prevent internal `throw` on invalid type + +4.16.4 / 2018-10-10 +=================== + + * Fix issue where `"Request aborted"` may be logged in `res.sendfile` + * Fix JSDoc for `Router` constructor + * deps: body-parser@1.18.3 + - Fix deprecation warnings on Node.js 10+ + - Fix stack trace for strict json parse error + - deps: depd@~1.1.2 + - deps: http-errors@~1.6.3 + - deps: iconv-lite@0.4.23 + - deps: qs@6.5.2 + - deps: raw-body@2.3.3 + - deps: type-is@~1.6.16 + * deps: proxy-addr@~2.0.4 + - deps: ipaddr.js@1.8.0 + * deps: qs@6.5.2 + * deps: safe-buffer@5.1.2 + +4.16.3 / 2018-03-12 +=================== + + * deps: accepts@~1.3.5 + - deps: mime-types@~2.1.18 + * deps: depd@~1.1.2 + - perf: remove argument reassignment + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: finalhandler@1.1.1 + - Fix 404 output for bad / missing pathnames + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + * deps: proxy-addr@~2.0.3 + - deps: ipaddr.js@1.6.0 + * deps: send@0.16.2 + - Fix incorrect end tag in default error & redirects + - deps: depd@~1.1.2 + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + * deps: serve-static@1.13.2 + - Fix incorrect end tag in redirects + - deps: encodeurl@~1.0.2 + - deps: send@0.16.2 + * deps: statuses@~1.4.0 + * deps: type-is@~1.6.16 + - deps: mime-types@~2.1.18 + +4.16.2 / 2017-10-09 +=================== + + * Fix `TypeError` in `res.send` when given `Buffer` and `ETag` header set + * perf: skip parsing of entire `X-Forwarded-Proto` header + +4.16.1 / 2017-09-29 +=================== + + * deps: send@0.16.1 + * deps: serve-static@1.13.1 + - Fix regression when `root` is incorrectly set to a file + - deps: send@0.16.1 + +4.16.0 / 2017-09-28 +=================== + + * Add `"json escape"` setting for `res.json` and `res.jsonp` + * Add `express.json` and `express.urlencoded` to parse bodies + * Add `options` argument to `res.download` + * Improve error message when autoloading invalid view engine + * Improve error messages when non-function provided as middleware + * Skip `Buffer` encoding when not generating ETag for small response + * Use `safe-buffer` for improved Buffer API + * deps: accepts@~1.3.4 + - deps: mime-types@~2.1.16 + * deps: content-type@~1.0.4 + - perf: remove argument reassignment + - perf: skip parameter parsing when no parameters + * deps: etag@~1.8.1 + - perf: replace regular expression with substring + * deps: finalhandler@1.1.0 + - Use `res.headersSent` when available + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: proxy-addr@~2.0.2 + - Fix trimming leading / trailing OWS in `X-Forwarded-For` + - deps: forwarded@~0.1.2 + - deps: ipaddr.js@1.5.2 + - perf: reduce overhead when no `X-Forwarded-For` header + * deps: qs@6.5.1 + - Fix parsing & compacting very deep objects + * deps: send@0.16.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Fix missing `` in default error & redirects + - Set charset as "UTF-8" for .js and .json + - Use instance methods on steam to check for listeners + - deps: mime@1.4.1 + - perf: improve path validation speed + * deps: serve-static@1.13.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Set charset as "UTF-8" for .js and .json + - deps: send@0.16.0 + * deps: setprototypeof@1.1.0 + * deps: utils-merge@1.0.1 + * deps: vary@~1.1.2 + - perf: improve header token parsing speed + * perf: re-use options object when generating ETags + * perf: remove dead `.charset` set in `res.jsonp` + +4.15.5 / 2017-09-24 +=================== + + * deps: debug@2.6.9 + * deps: finalhandler@~1.0.6 + - deps: debug@2.6.9 + - deps: parseurl@~1.3.2 + * deps: fresh@0.5.2 + - Fix handling of modified headers with invalid dates + - perf: improve ETag match loop + - perf: improve `If-None-Match` token parsing + * deps: send@0.15.6 + - Fix handling of modified headers with invalid dates + - deps: debug@2.6.9 + - deps: etag@~1.8.1 + - deps: fresh@0.5.2 + - perf: improve `If-Match` token parsing + * deps: serve-static@1.12.6 + - deps: parseurl@~1.3.2 + - deps: send@0.15.6 + - perf: improve slash collapsing + +4.15.4 / 2017-08-06 +=================== + + * deps: debug@2.6.8 + * deps: depd@~1.1.1 + - Remove unnecessary `Buffer` loading + * deps: finalhandler@~1.0.4 + - deps: debug@2.6.8 + * deps: proxy-addr@~1.1.5 + - Fix array argument being altered + - deps: ipaddr.js@1.4.0 + * deps: qs@6.5.0 + * deps: send@0.15.4 + - deps: debug@2.6.8 + - deps: depd@~1.1.1 + - deps: http-errors@~1.6.2 + * deps: serve-static@1.12.4 + - deps: send@0.15.4 + +4.15.3 / 2017-05-16 +=================== + + * Fix error when `res.set` cannot add charset to `Content-Type` + * deps: debug@2.6.7 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@2.0.0 + * deps: finalhandler@~1.0.3 + - Fix missing `` in HTML document + - deps: debug@2.6.7 + * deps: proxy-addr@~1.1.4 + - deps: ipaddr.js@1.3.0 + * deps: send@0.15.3 + - deps: debug@2.6.7 + - deps: ms@2.0.0 + * deps: serve-static@1.12.3 + - deps: send@0.15.3 + * deps: type-is@~1.6.15 + - deps: mime-types@~2.1.15 + * deps: vary@~1.1.1 + - perf: hoist regular expression + +4.15.2 / 2017-03-06 +=================== + + * deps: qs@6.4.0 + - Fix regression parsing keys starting with `[` + +4.15.1 / 2017-03-05 +=================== + + * deps: send@0.15.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - Fix strict violation in broken environments + * deps: serve-static@1.12.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - deps: send@0.15.1 + +4.15.0 / 2017-03-01 +=================== + + * Add debug message when loading view engine + * Add `next("router")` to exit from router + * Fix case where `router.use` skipped requests routes did not + * Remove usage of `res._headers` private field + - Improves compatibility with Node.js 8 nightly + * Skip routing when `req.url` is not set + * Use `%o` in path debug to tell types apart + * Use `Object.create` to setup request & response prototypes + * Use `setprototypeof` module to replace `__proto__` setting + * Use `statuses` instead of `http` module for status messages + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + * deps: etag@~1.8.0 + - Use SHA1 instead of MD5 for ETag hashing + - Works with FIPS 140-2 OpenSSL configuration + * deps: finalhandler@~1.0.0 + - Fix exception when `err` cannot be converted to a string + - Fully URL-encode the pathname in the 404 + - Only include the pathname in the 404 message + - Send complete HTML document + - Set `Content-Security-Policy: default-src 'self'` header + - deps: debug@2.6.1 + * deps: fresh@0.5.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - perf: delay reading header values until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove duplicate conditional + - perf: remove unnecessary boolean coercions + - perf: skip checking modified time if ETag check failed + - perf: skip parsing `If-None-Match` when no `ETag` header + - perf: use `Date.parse` instead of `new Date` + * deps: qs@6.3.1 + - Fix array parsing from skipping empty values + - Fix compacting nested arrays + * deps: send@0.15.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: debug@2.6.1 + - deps: etag@~1.8.0 + - deps: fresh@0.5.0 + - deps: http-errors@~1.6.1 + * deps: serve-static@1.12.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Send complete HTML document in redirect response + - Set default CSP header in redirect response + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: send@0.15.0 + * perf: add fast match path for `*` route + * perf: improve `req.ips` performance + +4.14.1 / 2017-01-28 +=================== + + * deps: content-disposition@0.5.2 + * deps: finalhandler@0.5.1 + - Fix exception when `err.headers` is not an object + - deps: statuses@~1.3.1 + - perf: hoist regular expressions + - perf: remove duplicate validation path + * deps: proxy-addr@~1.1.3 + - deps: ipaddr.js@1.2.0 + * deps: send@0.14.2 + - deps: http-errors@~1.5.1 + - deps: ms@0.7.2 + - deps: statuses@~1.3.1 + * deps: serve-static@~1.11.2 + - deps: send@0.14.2 + * deps: type-is@~1.6.14 + - deps: mime-types@~2.1.13 + +4.14.0 / 2016-06-16 +=================== + + * Add `acceptRanges` option to `res.sendFile`/`res.sendfile` + * Add `cacheControl` option to `res.sendFile`/`res.sendfile` + * Add `options` argument to `req.range` + - Includes the `combine` option + * Encode URL in `res.location`/`res.redirect` if not already encoded + * Fix some redirect handling in `res.sendFile`/`res.sendfile` + * Fix Windows absolute path check using forward slashes + * Improve error with invalid arguments to `req.get()` + * Improve performance for `res.json`/`res.jsonp` in most cases + * Improve `Range` header handling in `res.sendFile`/`res.sendfile` + * deps: accepts@~1.3.3 + - Fix including type extensions in parameters in `Accept` parsing + - Fix parsing `Accept` parameters with quoted equals + - Fix parsing `Accept` parameters with quoted semicolons + - Many performance improvements + - deps: mime-types@~2.1.11 + - deps: negotiator@0.6.1 + * deps: content-type@~1.0.2 + - perf: enable strict mode + * deps: cookie@0.3.1 + - Add `sameSite` option + - Fix cookie `Max-Age` to never be a floating point number + - Improve error message when `encode` is not a function + - Improve error message when `expires` is not a `Date` + - Throw better error for invalid argument to parse + - Throw on invalid values provided to `serialize` + - perf: enable strict mode + - perf: hoist regular expression + - perf: use for loop in parse + - perf: use string concatenation for serialization + * deps: finalhandler@0.5.0 + - Change invalid or non-numeric status code to 500 + - Overwrite status message to match set status code + - Prefer `err.statusCode` if `err.status` is invalid + - Set response headers from `err.headers` object + - Use `statuses` instead of `http` module for status messages + * deps: proxy-addr@~1.1.2 + - Fix accepting various invalid netmasks + - Fix IPv6-mapped IPv4 validation edge cases + - IPv4 netmasks must be contiguous + - IPv6 addresses cannot be used as a netmask + - deps: ipaddr.js@1.1.1 + * deps: qs@6.2.0 + - Add `decoder` option in `parse` function + * deps: range-parser@~1.2.0 + - Add `combine` option to combine overlapping ranges + - Fix incorrectly returning -1 when there is at least one valid range + - perf: remove internal function + * deps: send@0.14.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Correctly inherit from `Stream` class + - Fix `Content-Range` header in 416 responses when using `start`/`end` options + - Fix `Content-Range` header missing from default 416 responses + - Fix redirect error when `path` contains raw non-URL characters + - Fix redirect when `path` starts with multiple forward slashes + - Ignore non-byte `Range` headers + - deps: http-errors@~1.5.0 + - deps: range-parser@~1.2.0 + - deps: statuses@~1.3.0 + - perf: remove argument reassignment + * deps: serve-static@~1.11.1 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Fix redirect error when `req.url` contains raw non-URL characters + - Ignore non-byte `Range` headers + - Use status code 301 for redirects + - deps: send@0.14.1 + * deps: type-is@~1.6.13 + - Fix type error when given invalid type to match against + - deps: mime-types@~2.1.11 + * deps: vary@~1.1.0 + - Only accept valid field names in the `field` argument + * perf: use strict equality when possible + +4.13.4 / 2016-01-21 +=================== + + * deps: content-disposition@0.5.1 + - perf: enable strict mode + * deps: cookie@0.1.5 + - Throw on invalid values provided to `serialize` + * deps: depd@~1.1.0 + - Support web browser loading + - perf: enable strict mode + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: finalhandler@0.4.1 + - deps: escape-html@~1.0.3 + * deps: merge-descriptors@1.0.1 + - perf: enable strict mode + * deps: methods@~1.1.2 + - perf: enable strict mode + * deps: parseurl@~1.3.1 + - perf: enable strict mode + * deps: proxy-addr@~1.0.10 + - deps: ipaddr.js@1.0.5 + - perf: enable strict mode + * deps: range-parser@~1.0.3 + - perf: enable strict mode + * deps: send@0.13.1 + - deps: depd@~1.1.0 + - deps: destroy@~1.0.4 + - deps: escape-html@~1.0.3 + - deps: range-parser@~1.0.3 + * deps: serve-static@~1.10.2 + - deps: escape-html@~1.0.3 + - deps: parseurl@~1.3.0 + - deps: send@0.13.1 + +4.13.3 / 2015-08-02 +=================== + + * Fix infinite loop condition using `mergeParams: true` + * Fix inner numeric indices incorrectly altering parent `req.params` + +4.13.2 / 2015-07-31 +=================== + + * deps: accepts@~1.2.12 + - deps: mime-types@~2.1.4 + * deps: array-flatten@1.1.1 + - perf: enable strict mode + * deps: path-to-regexp@0.1.7 + - Fix regression with escaped round brackets and matching groups + * deps: type-is@~1.6.6 + - deps: mime-types@~2.1.4 + +4.13.1 / 2015-07-05 +=================== + + * deps: accepts@~1.2.10 + - deps: mime-types@~2.1.2 + * deps: qs@4.0.0 + - Fix dropping parameters like `hasOwnProperty` + - Fix various parsing edge cases + * deps: type-is@~1.6.4 + - deps: mime-types@~2.1.2 + - perf: enable strict mode + - perf: remove argument reassignment + +4.13.0 / 2015-06-20 +=================== + + * Add settings to debug output + * Fix `res.format` error when only `default` provided + * Fix issue where `next('route')` in `app.param` would incorrectly skip values + * Fix hiding platform issues with `decodeURIComponent` + - Only `URIError`s are a 400 + * Fix using `*` before params in routes + * Fix using capture groups before params in routes + * Simplify `res.cookie` to call `res.append` + * Use `array-flatten` module for flattening arrays + * deps: accepts@~1.2.9 + - deps: mime-types@~2.1.1 + - perf: avoid argument reassignment & argument slice + - perf: avoid negotiator recursive construction + - perf: enable strict mode + - perf: remove unnecessary bitwise operator + * deps: cookie@0.1.3 + - perf: deduce the scope of try-catch deopt + - perf: remove argument reassignments + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Always include entity length in ETags for hash length extensions + - Generate non-Stats ETags using MD5 only (no longer CRC32) + - Improve stat performance by removing hashing + - Improve support for JXcore + - Remove base64 padding in ETags to shorten + - Support "fake" stats objects in environments without fs + - Use MD5 instead of MD4 in weak ETags over 1KB + * deps: finalhandler@0.4.0 + - Fix a false-positive when unpiping in Node.js 0.8 + - Support `statusCode` property on `Error` objects + - Use `unpipe` module for unpiping requests + - deps: escape-html@1.0.2 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove argument reassignment + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * deps: path-to-regexp@0.1.6 + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + * deps: serve-static@~1.10.0 + - Add `fallthrough` option + - Fix reading options from options prototype + - Improve the default redirect response headers + - Malformed URLs now `next()` instead of 400 + - deps: escape-html@1.0.2 + - deps: send@0.13.0 + - perf: enable strict mode + - perf: remove argument reassignment + * deps: type-is@~1.6.3 + - deps: mime-types@~2.1.1 + - perf: reduce try block size + - perf: remove bitwise operations + * perf: enable strict mode + * perf: isolate `app.render` try block + * perf: remove argument reassignments in application + * perf: remove argument reassignments in request prototype + * perf: remove argument reassignments in response prototype + * perf: remove argument reassignments in routing + * perf: remove argument reassignments in `View` + * perf: skip attempting to decode zero length string + * perf: use saved reference to `http.STATUS_CODES` + +4.12.4 / 2015-05-17 +=================== + + * deps: accepts@~1.2.7 + - deps: mime-types@~2.0.11 + - deps: negotiator@0.5.3 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: etag@~1.6.0 + - Improve support for JXcore + - Support "fake" stats objects in environments without `fs` + * deps: finalhandler@0.3.6 + - deps: debug@~2.2.0 + - deps: on-finished@~2.2.1 + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + * deps: proxy-addr@~1.0.8 + - deps: ipaddr.js@1.0.1 + * deps: qs@2.4.2 + - Fix allowing parameters like `constructor` + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + * deps: serve-static@~1.9.3 + - deps: send@0.12.3 + * deps: type-is@~1.6.2 + - deps: mime-types@~2.0.11 + +4.12.3 / 2015-03-17 +=================== + + * deps: accepts@~1.2.5 + - deps: mime-types@~2.0.10 + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + * deps: finalhandler@0.3.4 + - deps: debug@~2.1.3 + * deps: proxy-addr@~1.0.7 + - deps: ipaddr.js@0.1.9 + * deps: qs@2.4.1 + - Fix error when parameter `hasOwnProperty` is present + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + * deps: serve-static@~1.9.2 + - deps: send@0.12.2 + * deps: type-is@~1.6.1 + - deps: mime-types@~2.0.10 + +4.12.2 / 2015-03-02 +=================== + + * Fix regression where `"Request aborted"` is logged using `res.sendFile` + +4.12.1 / 2015-03-01 +=================== + + * Fix constructing application with non-configurable prototype properties + * Fix `ECONNRESET` errors from `res.sendFile` usage + * Fix `req.host` when using "trust proxy" hops count + * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count + * Fix wrong `code` on aborted connections from `res.sendFile` + * deps: merge-descriptors@1.0.0 + +4.12.0 / 2015-02-23 +=================== + + * Fix `"trust proxy"` setting to inherit when app is mounted + * Generate `ETag`s for all request responses + - No longer restricted to only responses for `GET` and `HEAD` requests + * Use `content-type` to parse `Content-Type` headers + * deps: accepts@~1.2.4 + - Fix preference sorting to be stable for long acceptable lists + - deps: mime-types@~2.0.9 + - deps: negotiator@0.5.1 + * deps: cookie-signature@1.0.6 + * deps: send@0.12.1 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + * deps: serve-static@~1.9.1 + - deps: send@0.12.1 + * deps: type-is@~1.6.0 + - fix argument reassignment + - fix false-positives in `hasBody` `Transfer-Encoding` check + - support wildcard for both type and subtype (`*/*`) + - deps: mime-types@~2.0.9 + +4.11.2 / 2015-02-01 +=================== + + * Fix `res.redirect` double-calling `res.end` for `HEAD` requests + * deps: accepts@~1.2.3 + - deps: mime-types@~2.0.8 + * deps: proxy-addr@~1.0.6 + - deps: ipaddr.js@0.1.8 + * deps: type-is@~1.5.6 + - deps: mime-types@~2.0.8 + +4.11.1 / 2015-01-20 +=================== + + * deps: send@0.11.1 + - Fix root path disclosure + * deps: serve-static@~1.8.1 + - Fix redirect loop in Node.js 0.11.14 + - Fix root path disclosure + - deps: send@0.11.1 + +4.11.0 / 2015-01-13 +=================== + + * Add `res.append(field, val)` to append headers + * Deprecate leading `:` in `name` for `app.param(name, fn)` + * Deprecate `req.param()` -- use `req.params`, `req.body`, or `req.query` instead + * Deprecate `app.param(fn)` + * Fix `OPTIONS` responses to include the `HEAD` method properly + * Fix `res.sendFile` not always detecting aborted connection + * Match routes iteratively to prevent stack overflows + * deps: accepts@~1.2.2 + - deps: mime-types@~2.0.7 + - deps: negotiator@0.5.0 + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + * deps: serve-static@~1.8.0 + - deps: send@0.11.0 + +4.10.8 / 2015-01-13 +=================== + + * Fix crash from error within `OPTIONS` response handler + * deps: proxy-addr@~1.0.5 + - deps: ipaddr.js@0.1.6 + +4.10.7 / 2015-01-04 +=================== + + * Fix `Allow` header for `OPTIONS` to not contain duplicate methods + * Fix incorrect "Request aborted" for `res.sendFile` when `HEAD` or 304 + * deps: debug@~2.1.1 + * deps: finalhandler@0.3.3 + - deps: debug@~2.1.1 + - deps: on-finished@~2.2.0 + * deps: methods@~1.1.1 + * deps: on-finished@~2.2.0 + * deps: serve-static@~1.7.2 + - Fix potential open redirect when mounted at root + * deps: type-is@~1.5.5 + - deps: mime-types@~2.0.7 + +4.10.6 / 2014-12-12 +=================== + + * Fix exception in `req.fresh`/`req.stale` without response headers + +4.10.5 / 2014-12-10 +=================== + + * Fix `res.send` double-calling `res.end` for `HEAD` requests + * deps: accepts@~1.1.4 + - deps: mime-types@~2.0.4 + * deps: type-is@~1.5.4 + - deps: mime-types@~2.0.4 + +4.10.4 / 2014-11-24 +=================== + + * Fix `res.sendfile` logging standard write errors + +4.10.3 / 2014-11-23 +=================== + + * Fix `res.sendFile` logging standard write errors + * deps: etag@~1.5.1 + * deps: proxy-addr@~1.0.4 + - deps: ipaddr.js@0.1.5 + * deps: qs@2.3.3 + - Fix `arrayLimit` behavior + +4.10.2 / 2014-11-09 +=================== + + * Correctly invoke async router callback asynchronously + * deps: accepts@~1.1.3 + - deps: mime-types@~2.0.3 + * deps: type-is@~1.5.3 + - deps: mime-types@~2.0.3 + +4.10.1 / 2014-10-28 +=================== + + * Fix handling of URLs containing `://` in the path + * deps: qs@2.3.2 + - Fix parsing of mixed objects and values + +4.10.0 / 2014-10-23 +=================== + + * Add support for `app.set('views', array)` + - Views are looked up in sequence in array of directories + * Fix `res.send(status)` to mention `res.sendStatus(status)` + * Fix handling of invalid empty URLs + * Use `content-disposition` module for `res.attachment`/`res.download` + - Sends standards-compliant `Content-Disposition` header + - Full Unicode support + * Use `path.resolve` in view lookup + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: etag@~1.5.0 + - Improve string performance + - Slightly improve speed for weak ETags over 1KB + * deps: finalhandler@0.3.2 + - Terminate in progress response only on error + - Use `on-finished` to determine request status + - deps: debug@~2.1.0 + - deps: on-finished@~2.1.1 + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + * deps: qs@2.3.0 + - Fix parsing of mixed implicit and explicit arrays + * deps: send@0.10.1 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + - deps: on-finished@~2.1.1 + * deps: serve-static@~1.7.1 + - deps: send@0.10.1 + +4.9.8 / 2014-10-17 +================== + + * Fix `res.redirect` body when redirect status specified + * deps: accepts@~1.1.2 + - Fix error when media type has invalid parameter + - deps: negotiator@0.4.9 + +4.9.7 / 2014-10-10 +================== + + * Fix using same param name in array of paths + +4.9.6 / 2014-10-08 +================== + + * deps: accepts@~1.1.1 + - deps: mime-types@~2.0.2 + - deps: negotiator@0.4.8 + * deps: serve-static@~1.6.4 + - Fix redirect loop when index file serving disabled + * deps: type-is@~1.5.2 + - deps: mime-types@~2.0.2 + +4.9.5 / 2014-09-24 +================== + + * deps: etag@~1.4.0 + * deps: proxy-addr@~1.0.3 + - Use `forwarded` npm module + * deps: send@0.9.3 + - deps: etag@~1.4.0 + * deps: serve-static@~1.6.3 + - deps: send@0.9.3 + +4.9.4 / 2014-09-19 +================== + + * deps: qs@2.2.4 + - Fix issue with object keys starting with numbers truncated + +4.9.3 / 2014-09-18 +================== + + * deps: proxy-addr@~1.0.2 + - Fix a global leak when multiple subnets are trusted + - deps: ipaddr.js@0.1.3 + +4.9.2 / 2014-09-17 +================== + + * Fix regression for empty string `path` in `app.use` + * Fix `router.use` to accept array of middleware without path + * Improve error message for bad `app.use` arguments + +4.9.1 / 2014-09-16 +================== + + * Fix `app.use` to accept array of middleware without path + * deps: depd@0.4.5 + * deps: etag@~1.3.1 + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + * deps: serve-static@~1.6.2 + - deps: send@0.9.2 + +4.9.0 / 2014-09-08 +================== + + * Add `res.sendStatus` + * Invoke callback for sendfile when client aborts + - Applies to `res.sendFile`, `res.sendfile`, and `res.download` + - `err` will be populated with request aborted error + * Support IP address host in `req.subdomains` + * Use `etag` to generate `ETag` headers + * deps: accepts@~1.1.0 + - update `mime-types` + * deps: cookie-signature@1.0.5 + * deps: debug@~2.0.0 + * deps: finalhandler@0.2.0 + - Set `X-Content-Type-Options: nosniff` header + - deps: debug@~2.0.0 + * deps: fresh@0.2.4 + * deps: media-typer@0.3.0 + - Throw error when parameter format invalid on parse + * deps: qs@2.2.3 + - Fix issue where first empty value in array is discarded + * deps: range-parser@~1.0.2 + * deps: send@0.9.1 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + - deps: fresh@0.2.4 + * deps: serve-static@~1.6.1 + - Add `lastModified` option + - deps: send@0.9.1 + * deps: type-is@~1.5.1 + - fix `hasbody` to be true for `content-length: 0` + - deps: media-typer@0.3.0 + - deps: mime-types@~2.0.1 + * deps: vary@~1.0.0 + - Accept valid `Vary` header string as `field` + +4.8.8 / 2014-09-04 +================== + + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + * deps: serve-static@~1.5.4 + - deps: send@0.8.5 + +4.8.7 / 2014-08-29 +================== + + * deps: qs@2.2.2 + - Remove unnecessary cloning + +4.8.6 / 2014-08-27 +================== + + * deps: qs@2.2.0 + - Array parsing fix + - Performance improvements + +4.8.5 / 2014-08-18 +================== + + * deps: send@0.8.3 + - deps: destroy@1.0.3 + - deps: on-finished@2.1.0 + * deps: serve-static@~1.5.3 + - deps: send@0.8.3 + +4.8.4 / 2014-08-14 +================== + + * deps: qs@1.2.2 + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + * deps: serve-static@~1.5.2 + - deps: send@0.8.2 + +4.8.3 / 2014-08-10 +================== + + * deps: parseurl@~1.3.0 + * deps: qs@1.2.1 + * deps: serve-static@~1.5.1 + - Fix parsing of weird `req.originalUrl` values + - deps: parseurl@~1.3.0 + - deps: utils-merge@1.0.0 + +4.8.2 / 2014-08-07 +================== + + * deps: qs@1.2.0 + - Fix parsing array of objects + +4.8.1 / 2014-08-06 +================== + + * fix incorrect deprecation warnings on `res.download` + * deps: qs@1.1.0 + - Accept urlencoded square brackets + - Accept empty values in implicit array notation + +4.8.0 / 2014-08-05 +================== + + * add `res.sendFile` + - accepts a file system path instead of a URL + - requires an absolute path or `root` option specified + * deprecate `res.sendfile` -- use `res.sendFile` instead + * support mounted app as any argument to `app.use()` + * deps: qs@1.0.2 + - Complete rewrite + - Limits array length to 20 + - Limits object depth to 5 + - Limits parameters to 1,000 + * deps: send@0.8.1 + - Add `extensions` option + * deps: serve-static@~1.5.0 + - Add `extensions` option + - deps: send@0.8.1 + +4.7.4 / 2014-08-04 +================== + + * fix `res.sendfile` regression for serving directory index files + * deps: send@0.7.4 + - Fix incorrect 403 on Windows and Node.js 0.11 + - Fix serving index files without root dir + * deps: serve-static@~1.4.4 + - deps: send@0.7.4 + +4.7.3 / 2014-08-04 +================== + + * deps: send@0.7.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + * deps: serve-static@~1.4.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + - deps: send@0.7.3 + +4.7.2 / 2014-07-27 +================== + + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + * deps: send@0.7.2 + - deps: depd@0.4.4 + * deps: serve-static@~1.4.2 + +4.7.1 / 2014-07-26 +================== + + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + * deps: send@0.7.1 + - deps: depd@0.4.3 + * deps: serve-static@~1.4.1 + +4.7.0 / 2014-07-25 +================== + + * fix `req.protocol` for proxy-direct connections + * configurable query parser with `app.set('query parser', parser)` + - `app.set('query parser', 'extended')` parse with "qs" module + - `app.set('query parser', 'simple')` parse with "querystring" core module + - `app.set('query parser', false)` disable query string parsing + - `app.set('query parser', true)` enable simple parsing + * deprecate `res.json(status, obj)` -- use `res.status(status).json(obj)` instead + * deprecate `res.jsonp(status, obj)` -- use `res.status(status).jsonp(obj)` instead + * deprecate `res.send(status, body)` -- use `res.status(status).send(body)` instead + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + * deps: finalhandler@0.1.0 + - Respond after request fully read + - deps: debug@1.0.4 + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - Cap `maxAge` value to 1 year + - deps: debug@1.0.4 + - deps: depd@0.4.2 + * deps: serve-static@~1.4.0 + - deps: parseurl@~1.2.0 + - deps: send@0.7.0 + * perf: prevent multiple `Buffer` creation in `res.send` + +4.6.1 / 2014-07-12 +================== + + * fix `subapp.mountpath` regression for `app.use(subapp)` + +4.6.0 / 2014-07-11 +================== + + * accept multiple callbacks to `app.use()` + * add explicit "Rosetta Flash JSONP abuse" protection + - previous versions are not vulnerable; this is just explicit protection + * catch errors in multiple `req.param(name, fn)` handlers + * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead + * fix `res.send(status, num)` to send `num` as json (not error) + * remove unnecessary escaping when `res.jsonp` returns JSON response + * support non-string `path` in `app.use(path, fn)` + - supports array of paths + - supports `RegExp` + * router: fix optimization on router exit + * router: refactor location of `try` blocks + * router: speed up standard `app.use(fn)` + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + * deps: finalhandler@0.0.3 + - deps: debug@1.0.3 + * deps: methods@1.1.0 + - add `CONNECT` + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + * deps: path-to-regexp@0.1.3 + * deps: send@0.6.0 + - deps: debug@1.0.3 + * deps: serve-static@~1.3.2 + - deps: parseurl@~1.1.3 + - deps: send@0.6.0 + * perf: fix arguments reassign deopt in some `res` methods + +4.5.1 / 2014-07-06 +================== + + * fix routing regression when altering `req.method` + +4.5.0 / 2014-07-04 +================== + + * add deprecation message to non-plural `req.accepts*` + * add deprecation message to `res.send(body, status)` + * add deprecation message to `res.vary()` + * add `headers` option to `res.sendfile` + - use to set headers on successful file transfer + * add `mergeParams` option to `Router` + - merges `req.params` from parent routes + * add `req.hostname` -- correct name for what `req.host` returns + * deprecate things with `depd` module + * deprecate `req.host` -- use `req.hostname` instead + * fix behavior when handling request without routes + * fix handling when `route.all` is only route + * invoke `router.param()` only when route matches + * restore `req.params` after invoking router + * use `finalhandler` for final response handling + * use `media-typer` to alter content-type charset + * deps: accepts@~1.0.7 + * deps: send@0.5.0 + - Accept string for `maxage` (converted by `ms`) + - Include link in default redirect response + * deps: serve-static@~1.3.0 + - Accept string for `maxAge` (converted by `ms`) + - Add `setHeaders` option + - Include HTML link in redirect response + - deps: send@0.5.0 + * deps: type-is@~1.3.2 + +4.4.5 / 2014-06-26 +================== + + * deps: cookie-signature@1.0.4 + - fix for timing attacks + +4.4.4 / 2014-06-20 +================== + + * fix `res.attachment` Unicode filenames in Safari + * fix "trim prefix" debug message in `express:router` + * deps: accepts@~1.0.5 + * deps: buffer-crc32@0.2.3 + +4.4.3 / 2014-06-11 +================== + + * fix persistence of modified `req.params[name]` from `app.param()` + * deps: accepts@1.0.3 + - deps: negotiator@0.4.6 + * deps: debug@1.0.2 + * deps: send@0.4.3 + - Do not throw uncatchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + * deps: serve-static@1.2.3 + - Do not throw uncatchable error on file open race condition + - deps: send@0.4.3 + +4.4.2 / 2014-06-09 +================== + + * fix catching errors from top-level handlers + * use `vary` module for `res.vary` + * deps: debug@1.0.1 + * deps: proxy-addr@1.0.1 + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: debug@1.0.1 + - deps: finished@1.2.1 + * deps: serve-static@1.2.2 + - fix "event emitter leak" warnings + - deps: send@0.4.2 + * deps: type-is@1.2.1 + +4.4.1 / 2014-06-02 +================== + + * deps: methods@1.0.1 + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + * deps: serve-static@1.2.1 + - use `escape-html` for escaping + - deps: send@0.4.1 + +4.4.0 / 2014-05-30 +================== + + * custom etag control with `app.set('etag', val)` + - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation + - `app.set('etag', 'weak')` weak tag + - `app.set('etag', 'strong')` strong etag + - `app.set('etag', false)` turn off + - `app.set('etag', true)` standard etag + * mark `res.send` ETag as weak and reduce collisions + * update accepts to 1.0.2 + - Fix interpretation when header not in request + * update send to 0.4.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: debug@0.8.1 + * update serve-static to 1.2.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: send@0.4.0 + +4.3.2 / 2014-05-28 +================== + + * fix handling of errors from `router.param()` callbacks + +4.3.1 / 2014-05-23 +================== + + * revert "fix behavior of multiple `app.VERB` for the same path" + - this caused a regression in the order of route execution + +4.3.0 / 2014-05-21 +================== + + * add `req.baseUrl` to access the path stripped from `req.url` in routes + * fix behavior of multiple `app.VERB` for the same path + * fix issue routing requests among sub routers + * invoke `router.param()` only when necessary instead of every match + * proper proxy trust with `app.set('trust proxy', trust)` + - `app.set('trust proxy', 1)` trust first hop + - `app.set('trust proxy', 'loopback')` trust loopback addresses + - `app.set('trust proxy', '10.0.0.1')` trust single IP + - `app.set('trust proxy', '10.0.0.1/16')` trust subnet + - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list + - `app.set('trust proxy', false)` turn off + - `app.set('trust proxy', true)` trust everything + * set proper `charset` in `Content-Type` for `res.send` + * update type-is to 1.2.0 + - support suffix matching + +4.2.0 / 2014-05-11 +================== + + * deprecate `app.del()` -- use `app.delete()` instead + * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead + - the edge-case `res.json(status, num)` requires `res.status(status).json(num)` + * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead + - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)` + * fix `req.next` when inside router instance + * include `ETag` header in `HEAD` requests + * keep previous `Content-Type` for `res.jsonp` + * support PURGE method + - add `app.purge` + - add `router.purge` + - include PURGE in `app.all` + * update debug to 0.8.0 + - add `enable()` method + - change from stderr to stdout + * update methods to 1.0.0 + - add PURGE + +4.1.2 / 2014-05-08 +================== + + * fix `req.host` for IPv6 literals + * fix `res.jsonp` error if callback param is object + +4.1.1 / 2014-04-27 +================== + + * fix package.json to reflect supported node version + +4.1.0 / 2014-04-24 +================== + + * pass options from `res.sendfile` to `send` + * preserve casing of headers in `res.header` and `res.set` + * support unicode file names in `res.attachment` and `res.download` + * update accepts to 1.0.1 + - deps: negotiator@0.4.0 + * update cookie to 0.1.2 + - Fix for maxAge == 0 + - made compat with expires field + * update send to 0.3.0 + - Accept API options in options object + - Coerce option types + - Control whether to generate etags + - Default directory access to 403 when index disabled + - Fix sending files with dots without root set + - Include file path in etag + - Make "Can't set headers after they are sent." catchable + - Send full entity-body for multi range requests + - Set etags to "weak" + - Support "If-Range" header + - Support multiple index paths + - deps: mime@1.2.11 + * update serve-static to 1.1.0 + - Accept options directly to `send` module + - Resolve relative paths at middleware setup + - Use parseurl to parse the URL from request + - deps: send@0.3.0 + * update type-is to 1.1.0 + - add non-array values support + - add `multipart` as a shorthand + +4.0.0 / 2014-04-09 +================== + + * remove: + - node 0.8 support + - connect and connect's patches except for charset handling + - express(1) - moved to [express-generator](https://github.com/expressjs/generator) + - `express.createServer()` - it has been deprecated for a long time. Use `express()` + - `app.configure` - use logic in your own app code + - `app.router` - is removed + - `req.auth` - use `basic-auth` instead + - `req.accepted*` - use `req.accepts*()` instead + - `res.location` - relative URL resolution is removed + - `res.charset` - include the charset in the content type when using `res.set()` + - all bundled middleware except `static` + * change: + - `app.route` -> `app.mountpath` when mounting an express app in another express app + - `json spaces` no longer enabled by default in development + - `req.accepts*` -> `req.accepts*s` - i.e. `req.acceptsEncoding` -> `req.acceptsEncodings` + - `req.params` is now an object instead of an array + - `res.locals` is no longer a function. It is a plain js object. Treat it as such. + - `res.headerSent` -> `res.headersSent` to match node.js ServerResponse object + * refactor: + - `req.accepts*` with [accepts](https://github.com/expressjs/accepts) + - `req.is` with [type-is](https://github.com/expressjs/type-is) + - [path-to-regexp](https://github.com/component/path-to-regexp) + * add: + - `app.router()` - returns the app Router instance + - `app.route()` - Proxy to the app's `Router#route()` method to create a new route + - Router & Route - public API + +3.21.2 / 2015-07-31 +=================== + + * deps: connect@2.30.2 + - deps: body-parser@~1.13.3 + - deps: compression@~1.5.2 + - deps: errorhandler@~1.4.2 + - deps: method-override@~2.3.5 + - deps: serve-index@~1.7.2 + - deps: type-is@~1.6.6 + - deps: vhost@~3.0.1 + * deps: vary@~1.0.1 + - Fix setting empty header from empty `field` + - perf: enable strict mode + - perf: remove argument reassignments + +3.21.1 / 2015-07-05 +=================== + + * deps: basic-auth@~1.0.3 + * deps: connect@2.30.1 + - deps: body-parser@~1.13.2 + - deps: compression@~1.5.1 + - deps: errorhandler@~1.4.1 + - deps: morgan@~1.6.1 + - deps: pause@0.1.0 + - deps: qs@4.0.0 + - deps: serve-index@~1.7.1 + - deps: type-is@~1.6.4 + +3.21.0 / 2015-06-18 +=================== + + * deps: basic-auth@1.0.2 + - perf: enable strict mode + - perf: hoist regular expression + - perf: parse with regular expressions + - perf: remove argument reassignment + * deps: connect@2.30.0 + - deps: body-parser@~1.13.1 + - deps: bytes@2.1.0 + - deps: compression@~1.5.0 + - deps: cookie@0.1.3 + - deps: cookie-parser@~1.3.5 + - deps: csurf@~1.8.3 + - deps: errorhandler@~1.4.0 + - deps: express-session@~1.11.3 + - deps: finalhandler@0.4.0 + - deps: fresh@0.3.0 + - deps: morgan@~1.6.0 + - deps: serve-favicon@~2.3.0 + - deps: serve-index@~1.7.0 + - deps: serve-static@~1.10.0 + - deps: type-is@~1.6.3 + * deps: cookie@0.1.3 + - perf: deduce the scope of try-catch deopt + - perf: remove argument reassignments + * deps: escape-html@1.0.2 + * deps: etag@~1.7.0 + - Always include entity length in ETags for hash length extensions + - Generate non-Stats ETags using MD5 only (no longer CRC32) + - Improve stat performance by removing hashing + - Improve support for JXcore + - Remove base64 padding in ETags to shorten + - Support "fake" stats objects in environments without fs + - Use MD5 instead of MD4 in weak ETags over 1KB + * deps: fresh@0.3.0 + - Add weak `ETag` matching support + * deps: mkdirp@0.5.1 + - Work in global strict mode + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + +3.20.3 / 2015-05-17 +=================== + + * deps: connect@2.29.2 + - deps: body-parser@~1.12.4 + - deps: compression@~1.4.4 + - deps: connect-timeout@~1.6.2 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: errorhandler@~1.3.6 + - deps: finalhandler@0.3.6 + - deps: method-override@~2.3.3 + - deps: morgan@~1.5.3 + - deps: qs@2.4.2 + - deps: response-time@~2.3.1 + - deps: serve-favicon@~2.2.1 + - deps: serve-index@~1.6.4 + - deps: serve-static@~1.9.3 + - deps: type-is@~1.6.2 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + * deps: depd@~1.0.1 + * deps: proxy-addr@~1.0.8 + - deps: ipaddr.js@1.0.1 + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + +3.20.2 / 2015-03-16 +=================== + + * deps: connect@2.29.1 + - deps: body-parser@~1.12.2 + - deps: compression@~1.4.3 + - deps: connect-timeout@~1.6.1 + - deps: debug@~2.1.3 + - deps: errorhandler@~1.3.5 + - deps: express-session@~1.10.4 + - deps: finalhandler@0.3.4 + - deps: method-override@~2.3.2 + - deps: morgan@~1.5.2 + - deps: qs@2.4.1 + - deps: serve-index@~1.6.3 + - deps: serve-static@~1.9.2 + - deps: type-is@~1.6.1 + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + * deps: merge-descriptors@1.0.0 + * deps: proxy-addr@~1.0.7 + - deps: ipaddr.js@0.1.9 + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + +3.20.1 / 2015-02-28 +=================== + + * Fix `req.host` when using "trust proxy" hops count + * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count + +3.20.0 / 2015-02-18 +=================== + + * Fix `"trust proxy"` setting to inherit when app is mounted + * Generate `ETag`s for all request responses + - No longer restricted to only responses for `GET` and `HEAD` requests + * Use `content-type` to parse `Content-Type` headers + * deps: connect@2.29.0 + - Use `content-type` to parse `Content-Type` headers + - deps: body-parser@~1.12.0 + - deps: compression@~1.4.1 + - deps: connect-timeout@~1.6.0 + - deps: cookie-parser@~1.3.4 + - deps: cookie-signature@1.0.6 + - deps: csurf@~1.7.0 + - deps: errorhandler@~1.3.4 + - deps: express-session@~1.10.3 + - deps: http-errors@~1.3.1 + - deps: response-time@~2.3.0 + - deps: serve-index@~1.6.2 + - deps: serve-static@~1.9.1 + - deps: type-is@~1.6.0 + * deps: cookie-signature@1.0.6 + * deps: send@0.12.1 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + +3.19.2 / 2015-02-01 +=================== + + * deps: connect@2.28.3 + - deps: compression@~1.3.1 + - deps: csurf@~1.6.6 + - deps: errorhandler@~1.3.3 + - deps: express-session@~1.10.2 + - deps: serve-index@~1.6.1 + - deps: type-is@~1.5.6 + * deps: proxy-addr@~1.0.6 + - deps: ipaddr.js@0.1.8 + +3.19.1 / 2015-01-20 +=================== + + * deps: connect@2.28.2 + - deps: body-parser@~1.10.2 + - deps: serve-static@~1.8.1 + * deps: send@0.11.1 + - Fix root path disclosure + +3.19.0 / 2015-01-09 +=================== + + * Fix `OPTIONS` responses to include the `HEAD` method property + * Use `readline` for prompt in `express(1)` + * deps: commander@2.6.0 + * deps: connect@2.28.1 + - deps: body-parser@~1.10.1 + - deps: compression@~1.3.0 + - deps: connect-timeout@~1.5.0 + - deps: csurf@~1.6.4 + - deps: debug@~2.1.1 + - deps: errorhandler@~1.3.2 + - deps: express-session@~1.10.1 + - deps: finalhandler@0.3.3 + - deps: method-override@~2.3.1 + - deps: morgan@~1.5.1 + - deps: serve-favicon@~2.2.0 + - deps: serve-index@~1.6.0 + - deps: serve-static@~1.8.0 + - deps: type-is@~1.5.5 + * deps: debug@~2.1.1 + * deps: methods@~1.1.1 + * deps: proxy-addr@~1.0.5 + - deps: ipaddr.js@0.1.6 + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + +3.18.6 / 2014-12-12 +=================== + + * Fix exception in `req.fresh`/`req.stale` without response headers + +3.18.5 / 2014-12-11 +=================== + + * deps: connect@2.27.6 + - deps: compression@~1.2.2 + - deps: express-session@~1.9.3 + - deps: http-errors@~1.2.8 + - deps: serve-index@~1.5.3 + - deps: type-is@~1.5.4 + +3.18.4 / 2014-11-23 +=================== + + * deps: connect@2.27.4 + - deps: body-parser@~1.9.3 + - deps: compression@~1.2.1 + - deps: errorhandler@~1.2.3 + - deps: express-session@~1.9.2 + - deps: qs@2.3.3 + - deps: serve-favicon@~2.1.7 + - deps: serve-static@~1.5.1 + - deps: type-is@~1.5.3 + * deps: etag@~1.5.1 + * deps: proxy-addr@~1.0.4 + - deps: ipaddr.js@0.1.5 + +3.18.3 / 2014-11-09 +=================== + + * deps: connect@2.27.3 + - Correctly invoke async callback asynchronously + - deps: csurf@~1.6.3 + +3.18.2 / 2014-10-28 +=================== + + * deps: connect@2.27.2 + - Fix handling of URLs containing `://` in the path + - deps: body-parser@~1.9.2 + - deps: qs@2.3.2 + +3.18.1 / 2014-10-22 +=================== + + * Fix internal `utils.merge` deprecation warnings + * deps: connect@2.27.1 + - deps: body-parser@~1.9.1 + - deps: express-session@~1.9.1 + - deps: finalhandler@0.3.2 + - deps: morgan@~1.4.1 + - deps: qs@2.3.0 + - deps: serve-static@~1.7.1 + * deps: send@0.10.1 + - deps: on-finished@~2.1.1 + +3.18.0 / 2014-10-17 +=================== + + * Use `content-disposition` module for `res.attachment`/`res.download` + - Sends standards-compliant `Content-Disposition` header + - Full Unicode support + * Use `etag` module to generate `ETag` headers + * deps: connect@2.27.0 + - Use `http-errors` module for creating errors + - Use `utils-merge` module for merging objects + - deps: body-parser@~1.9.0 + - deps: compression@~1.2.0 + - deps: connect-timeout@~1.4.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: express-session@~1.9.0 + - deps: finalhandler@0.3.1 + - deps: method-override@~2.3.0 + - deps: morgan@~1.4.0 + - deps: response-time@~2.2.0 + - deps: serve-favicon@~2.1.6 + - deps: serve-index@~1.5.0 + - deps: serve-static@~1.7.0 + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + * deps: depd@~1.0.0 + * deps: send@0.10.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + +3.17.8 / 2014-10-15 +=================== + + * deps: connect@2.26.6 + - deps: compression@~1.1.2 + - deps: csurf@~1.6.2 + - deps: errorhandler@~1.2.2 + +3.17.7 / 2014-10-08 +=================== + + * deps: connect@2.26.5 + - Fix accepting non-object arguments to `logger` + - deps: serve-static@~1.6.4 + +3.17.6 / 2014-10-02 +=================== + + * deps: connect@2.26.4 + - deps: morgan@~1.3.2 + - deps: type-is@~1.5.2 + +3.17.5 / 2014-09-24 +=================== + + * deps: connect@2.26.3 + - deps: body-parser@~1.8.4 + - deps: serve-favicon@~2.1.5 + - deps: serve-static@~1.6.3 + * deps: proxy-addr@~1.0.3 + - Use `forwarded` npm module + * deps: send@0.9.3 + - deps: etag@~1.4.0 + +3.17.4 / 2014-09-19 +=================== + + * deps: connect@2.26.2 + - deps: body-parser@~1.8.3 + - deps: qs@2.2.4 + +3.17.3 / 2014-09-18 +=================== + + * deps: proxy-addr@~1.0.2 + - Fix a global leak when multiple subnets are trusted + - deps: ipaddr.js@0.1.3 + +3.17.2 / 2014-09-15 +=================== + + * Use `crc` instead of `buffer-crc32` for speed + * deps: connect@2.26.1 + - deps: body-parser@~1.8.2 + - deps: depd@0.4.5 + - deps: express-session@~1.8.2 + - deps: morgan@~1.3.1 + - deps: serve-favicon@~2.1.3 + - deps: serve-static@~1.6.2 + * deps: depd@0.4.5 + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + +3.17.1 / 2014-09-08 +=================== + + * Fix error in `req.subdomains` on empty host + +3.17.0 / 2014-09-08 +=================== + + * Support `X-Forwarded-Host` in `req.subdomains` + * Support IP address host in `req.subdomains` + * deps: connect@2.26.0 + - deps: body-parser@~1.8.1 + - deps: compression@~1.1.0 + - deps: connect-timeout@~1.3.0 + - deps: cookie-parser@~1.3.3 + - deps: cookie-signature@1.0.5 + - deps: csurf@~1.6.1 + - deps: debug@~2.0.0 + - deps: errorhandler@~1.2.0 + - deps: express-session@~1.8.1 + - deps: finalhandler@0.2.0 + - deps: fresh@0.2.4 + - deps: media-typer@0.3.0 + - deps: method-override@~2.2.0 + - deps: morgan@~1.3.0 + - deps: qs@2.2.3 + - deps: serve-favicon@~2.1.3 + - deps: serve-index@~1.2.1 + - deps: serve-static@~1.6.1 + - deps: type-is@~1.5.1 + - deps: vhost@~3.0.0 + * deps: cookie-signature@1.0.5 + * deps: debug@~2.0.0 + * deps: fresh@0.2.4 + * deps: media-typer@0.3.0 + - Throw error when parameter format invalid on parse + * deps: range-parser@~1.0.2 + * deps: send@0.9.1 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + - deps: fresh@0.2.4 + * deps: vary@~1.0.0 + - Accept valid `Vary` header string as `field` + +3.16.10 / 2014-09-04 +==================== + + * deps: connect@2.25.10 + - deps: serve-static@~1.5.4 + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + +3.16.9 / 2014-08-29 +=================== + + * deps: connect@2.25.9 + - deps: body-parser@~1.6.7 + - deps: qs@2.2.2 + +3.16.8 / 2014-08-27 +=================== + + * deps: connect@2.25.8 + - deps: body-parser@~1.6.6 + - deps: csurf@~1.4.1 + - deps: qs@2.2.0 + +3.16.7 / 2014-08-18 +=================== + + * deps: connect@2.25.7 + - deps: body-parser@~1.6.5 + - deps: express-session@~1.7.6 + - deps: morgan@~1.2.3 + - deps: serve-static@~1.5.3 + * deps: send@0.8.3 + - deps: destroy@1.0.3 + - deps: on-finished@2.1.0 + +3.16.6 / 2014-08-14 +=================== + + * deps: connect@2.25.6 + - deps: body-parser@~1.6.4 + - deps: qs@1.2.2 + - deps: serve-static@~1.5.2 + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + +3.16.5 / 2014-08-11 +=================== + + * deps: connect@2.25.5 + - Fix backwards compatibility in `logger` + +3.16.4 / 2014-08-10 +=================== + + * Fix original URL parsing in `res.location` + * deps: connect@2.25.4 + - Fix `query` middleware breaking with argument + - deps: body-parser@~1.6.3 + - deps: compression@~1.0.11 + - deps: connect-timeout@~1.2.2 + - deps: express-session@~1.7.5 + - deps: method-override@~2.1.3 + - deps: on-headers@~1.0.0 + - deps: parseurl@~1.3.0 + - deps: qs@1.2.1 + - deps: response-time@~2.0.1 + - deps: serve-index@~1.1.6 + - deps: serve-static@~1.5.1 + * deps: parseurl@~1.3.0 + +3.16.3 / 2014-08-07 +=================== + + * deps: connect@2.25.3 + - deps: multiparty@3.3.2 + +3.16.2 / 2014-08-07 +=================== + + * deps: connect@2.25.2 + - deps: body-parser@~1.6.2 + - deps: qs@1.2.0 + +3.16.1 / 2014-08-06 +=================== + + * deps: connect@2.25.1 + - deps: body-parser@~1.6.1 + - deps: qs@1.1.0 + +3.16.0 / 2014-08-05 +=================== + + * deps: connect@2.25.0 + - deps: body-parser@~1.6.0 + - deps: compression@~1.0.10 + - deps: csurf@~1.4.0 + - deps: express-session@~1.7.4 + - deps: qs@1.0.2 + - deps: serve-static@~1.5.0 + * deps: send@0.8.1 + - Add `extensions` option + +3.15.3 / 2014-08-04 +=================== + + * fix `res.sendfile` regression for serving directory index files + * deps: connect@2.24.3 + - deps: serve-index@~1.1.5 + - deps: serve-static@~1.4.4 + * deps: send@0.7.4 + - Fix incorrect 403 on Windows and Node.js 0.11 + - Fix serving index files without root dir + +3.15.2 / 2014-07-27 +=================== + + * deps: connect@2.24.2 + - deps: body-parser@~1.5.2 + - deps: depd@0.4.4 + - deps: express-session@~1.7.2 + - deps: morgan@~1.2.2 + - deps: serve-static@~1.4.2 + * deps: depd@0.4.4 + - Work-around v8 generating empty stack traces + * deps: send@0.7.2 + - deps: depd@0.4.4 + +3.15.1 / 2014-07-26 +=================== + + * deps: connect@2.24.1 + - deps: body-parser@~1.5.1 + - deps: depd@0.4.3 + - deps: express-session@~1.7.1 + - deps: morgan@~1.2.1 + - deps: serve-index@~1.1.4 + - deps: serve-static@~1.4.1 + * deps: depd@0.4.3 + - Fix exception when global `Error.stackTraceLimit` is too low + * deps: send@0.7.1 + - deps: depd@0.4.3 + +3.15.0 / 2014-07-22 +=================== + + * Fix `req.protocol` for proxy-direct connections + * Pass options from `res.sendfile` to `send` + * deps: connect@2.24.0 + - deps: body-parser@~1.5.0 + - deps: compression@~1.0.9 + - deps: connect-timeout@~1.2.1 + - deps: debug@1.0.4 + - deps: depd@0.4.2 + - deps: express-session@~1.7.0 + - deps: finalhandler@0.1.0 + - deps: method-override@~2.1.2 + - deps: morgan@~1.2.0 + - deps: multiparty@3.3.1 + - deps: parseurl@~1.2.0 + - deps: serve-static@~1.4.0 + * deps: debug@1.0.4 + * deps: depd@0.4.2 + - Add `TRACE_DEPRECATION` environment variable + - Remove non-standard grey color from color output + - Support `--no-deprecation` argument + - Support `--trace-deprecation` argument + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - Cap `maxAge` value to 1 year + - deps: debug@1.0.4 + - deps: depd@0.4.2 + +3.14.0 / 2014-07-11 +=================== + + * add explicit "Rosetta Flash JSONP abuse" protection + - previous versions are not vulnerable; this is just explicit protection + * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead + * fix `res.send(status, num)` to send `num` as json (not error) + * remove unnecessary escaping when `res.jsonp` returns JSON response + * deps: basic-auth@1.0.0 + - support empty password + - support empty username + * deps: connect@2.23.0 + - deps: debug@1.0.3 + - deps: express-session@~1.6.4 + - deps: method-override@~2.1.0 + - deps: parseurl@~1.1.3 + - deps: serve-static@~1.3.1 + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + * deps: methods@1.1.0 + - add `CONNECT` + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + +3.13.0 / 2014-07-03 +=================== + + * add deprecation message to `app.configure` + * add deprecation message to `req.auth` + * use `basic-auth` to parse `Authorization` header + * deps: connect@2.22.0 + - deps: csurf@~1.3.0 + - deps: express-session@~1.6.1 + - deps: multiparty@3.3.0 + - deps: serve-static@~1.3.0 + * deps: send@0.5.0 + - Accept string for `maxage` (converted by `ms`) + - Include link in default redirect response + +3.12.1 / 2014-06-26 +=================== + + * deps: connect@2.21.1 + - deps: cookie-parser@1.3.2 + - deps: cookie-signature@1.0.4 + - deps: express-session@~1.5.2 + - deps: type-is@~1.3.2 + * deps: cookie-signature@1.0.4 + - fix for timing attacks + +3.12.0 / 2014-06-21 +=================== + + * use `media-typer` to alter content-type charset + * deps: connect@2.21.0 + - deprecate `connect(middleware)` -- use `app.use(middleware)` instead + - deprecate `connect.createServer()` -- use `connect()` instead + - fix `res.setHeader()` patch to work with get -> append -> set pattern + - deps: compression@~1.0.8 + - deps: errorhandler@~1.1.1 + - deps: express-session@~1.5.0 + - deps: serve-index@~1.1.3 + +3.11.0 / 2014-06-19 +=================== + + * deprecate things with `depd` module + * deps: buffer-crc32@0.2.3 + * deps: connect@2.20.2 + - deprecate `verify` option to `json` -- use `body-parser` npm module instead + - deprecate `verify` option to `urlencoded` -- use `body-parser` npm module instead + - deprecate things with `depd` module + - use `finalhandler` for final response handling + - use `media-typer` to parse `content-type` for charset + - deps: body-parser@1.4.3 + - deps: connect-timeout@1.1.1 + - deps: cookie-parser@1.3.1 + - deps: csurf@1.2.2 + - deps: errorhandler@1.1.0 + - deps: express-session@1.4.0 + - deps: multiparty@3.2.9 + - deps: serve-index@1.1.2 + - deps: type-is@1.3.1 + - deps: vhost@2.0.0 + +3.10.5 / 2014-06-11 +=================== + + * deps: connect@2.19.6 + - deps: body-parser@1.3.1 + - deps: compression@1.0.7 + - deps: debug@1.0.2 + - deps: serve-index@1.1.1 + - deps: serve-static@1.2.3 + * deps: debug@1.0.2 + * deps: send@0.4.3 + - Do not throw uncatchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + +3.10.4 / 2014-06-09 +=================== + + * deps: connect@2.19.5 + - fix "event emitter leak" warnings + - deps: csurf@1.2.1 + - deps: debug@1.0.1 + - deps: serve-static@1.2.2 + - deps: type-is@1.2.1 + * deps: debug@1.0.1 + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: finished@1.2.1 + - deps: debug@1.0.1 + +3.10.3 / 2014-06-05 +=================== + + * use `vary` module for `res.vary` + * deps: connect@2.19.4 + - deps: errorhandler@1.0.2 + - deps: method-override@2.0.2 + - deps: serve-favicon@2.0.1 + * deps: debug@1.0.0 + +3.10.2 / 2014-06-03 +=================== + + * deps: connect@2.19.3 + - deps: compression@1.0.6 + +3.10.1 / 2014-06-03 +=================== + + * deps: connect@2.19.2 + - deps: compression@1.0.4 + * deps: proxy-addr@1.0.1 + +3.10.0 / 2014-06-02 +=================== + + * deps: connect@2.19.1 + - deprecate `methodOverride()` -- use `method-override` npm module instead + - deps: body-parser@1.3.0 + - deps: method-override@2.0.1 + - deps: multiparty@3.2.8 + - deps: response-time@2.0.0 + - deps: serve-static@1.2.1 + * deps: methods@1.0.1 + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + +3.9.0 / 2014-05-30 +================== + + * custom etag control with `app.set('etag', val)` + - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation + - `app.set('etag', 'weak')` weak tag + - `app.set('etag', 'strong')` strong etag + - `app.set('etag', false)` turn off + - `app.set('etag', true)` standard etag + * Include ETag in HEAD requests + * mark `res.send` ETag as weak and reduce collisions + * update connect to 2.18.0 + - deps: compression@1.0.3 + - deps: serve-index@1.1.0 + - deps: serve-static@1.2.0 + * update send to 0.4.0 + - Calculate ETag with md5 for reduced collisions + - Ignore stream errors after request ends + - deps: debug@0.8.1 + +3.8.1 / 2014-05-27 +================== + + * update connect to 2.17.3 + - deps: body-parser@1.2.2 + - deps: express-session@1.2.1 + - deps: method-override@1.0.2 + +3.8.0 / 2014-05-21 +================== + + * keep previous `Content-Type` for `res.jsonp` + * set proper `charset` in `Content-Type` for `res.send` + * update connect to 2.17.1 + - fix `res.charset` appending charset when `content-type` has one + - deps: express-session@1.2.0 + - deps: morgan@1.1.1 + - deps: serve-index@1.0.3 + +3.7.0 / 2014-05-18 +================== + + * proper proxy trust with `app.set('trust proxy', trust)` + - `app.set('trust proxy', 1)` trust first hop + - `app.set('trust proxy', 'loopback')` trust loopback addresses + - `app.set('trust proxy', '10.0.0.1')` trust single IP + - `app.set('trust proxy', '10.0.0.1/16')` trust subnet + - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list + - `app.set('trust proxy', false)` turn off + - `app.set('trust proxy', true)` trust everything + * update connect to 2.16.2 + - deprecate `res.headerSent` -- use `res.headersSent` + - deprecate `res.on("header")` -- use on-headers module instead + - fix edge-case in `res.appendHeader` that would append in wrong order + - json: use body-parser + - urlencoded: use body-parser + - dep: bytes@1.0.0 + - dep: cookie-parser@1.1.0 + - dep: csurf@1.2.0 + - dep: express-session@1.1.0 + - dep: method-override@1.0.1 + +3.6.0 / 2014-05-09 +================== + + * deprecate `app.del()` -- use `app.delete()` instead + * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead + - the edge-case `res.json(status, num)` requires `res.status(status).json(num)` + * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead + - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)` + * support PURGE method + - add `app.purge` + - add `router.purge` + - include PURGE in `app.all` + * update connect to 2.15.0 + * Add `res.appendHeader` + * Call error stack even when response has been sent + * Patch `res.headerSent` to return Boolean + * Patch `res.headersSent` for node.js 0.8 + * Prevent default 404 handler after response sent + * dep: compression@1.0.2 + * dep: connect-timeout@1.1.0 + * dep: debug@^0.8.0 + * dep: errorhandler@1.0.1 + * dep: express-session@1.0.4 + * dep: morgan@1.0.1 + * dep: serve-favicon@2.0.0 + * dep: serve-index@1.0.2 + * update debug to 0.8.0 + * add `enable()` method + * change from stderr to stdout + * update methods to 1.0.0 + - add PURGE + * update mkdirp to 0.5.0 + +3.5.3 / 2014-05-08 +================== + + * fix `req.host` for IPv6 literals + * fix `res.jsonp` error if callback param is object + +3.5.2 / 2014-04-24 +================== + + * update connect to 2.14.5 + * update cookie to 0.1.2 + * update mkdirp to 0.4.0 + * update send to 0.3.0 + +3.5.1 / 2014-03-25 +================== + + * pin less-middleware in generated app + +3.5.0 / 2014-03-06 +================== + + * bump deps + +3.4.8 / 2014-01-13 +================== + + * prevent incorrect automatic OPTIONS responses #1868 @dpatti + * update binary and examples for jade 1.0 #1876 @yossi, #1877 @reqshark, #1892 @matheusazzi + * throw 400 in case of malformed paths @rlidwka + +3.4.7 / 2013-12-10 +================== + + * update connect + +3.4.6 / 2013-12-01 +================== + + * update connect (raw-body) + +3.4.5 / 2013-11-27 +================== + + * update connect + * res.location: remove leading ./ #1802 @kapouer + * res.redirect: fix `res.redirect('toString') #1829 @michaelficarra + * res.send: always send ETag when content-length > 0 + * router: add Router.all() method + +3.4.4 / 2013-10-29 +================== + + * update connect + * update supertest + * update methods + * express(1): replace bodyParser() with urlencoded() and json() #1795 @chirag04 + +3.4.3 / 2013-10-23 +================== + + * update connect + +3.4.2 / 2013-10-18 +================== + + * update connect + * downgrade commander + +3.4.1 / 2013-10-15 +================== + + * update connect + * update commander + * jsonp: check if callback is a function + * router: wrap encodeURIComponent in a try/catch #1735 (@lxe) + * res.format: now includes charset @1747 (@sorribas) + * res.links: allow multiple calls @1746 (@sorribas) + +3.4.0 / 2013-09-07 +================== + + * add res.vary(). Closes #1682 + * update connect + +3.3.8 / 2013-09-02 +================== + + * update connect + +3.3.7 / 2013-08-28 +================== + + * update connect + +3.3.6 / 2013-08-27 +================== + + * Revert "remove charset from json responses. Closes #1631" (causes issues in some clients) + * add: req.accepts take an argument list + +3.3.4 / 2013-07-08 +================== + + * update send and connect + +3.3.3 / 2013-07-04 +================== + + * update connect + +3.3.2 / 2013-07-03 +================== + + * update connect + * update send + * remove .version export + +3.3.1 / 2013-06-27 +================== + + * update connect + +3.3.0 / 2013-06-26 +================== + + * update connect + * add support for multiple X-Forwarded-Proto values. Closes #1646 + * change: remove charset from json responses. Closes #1631 + * change: return actual booleans from req.accept* functions + * fix jsonp callback array throw + +3.2.6 / 2013-06-02 +================== + + * update connect + +3.2.5 / 2013-05-21 +================== + + * update connect + * update node-cookie + * add: throw a meaningful error when there is no default engine + * change generation of ETags with res.send() to GET requests only. Closes #1619 + +3.2.4 / 2013-05-09 +================== + + * fix `req.subdomains` when no Host is present + * fix `req.host` when no Host is present, return undefined + +3.2.3 / 2013-05-07 +================== + + * update connect / qs + +3.2.2 / 2013-05-03 +================== + + * update qs + +3.2.1 / 2013-04-29 +================== + + * add app.VERB() paths array deprecation warning + * update connect + * update qs and remove all ~ semver crap + * fix: accept number as value of Signed Cookie + +3.2.0 / 2013-04-15 +================== + + * add "view" constructor setting to override view behaviour + * add req.acceptsEncoding(name) + * add req.acceptedEncodings + * revert cookie signature change causing session race conditions + * fix sorting of Accept values of the same quality + +3.1.2 / 2013-04-12 +================== + + * add support for custom Accept parameters + * update cookie-signature + +3.1.1 / 2013-04-01 +================== + + * add X-Forwarded-Host support to `req.host` + * fix relative redirects + * update mkdirp + * update buffer-crc32 + * remove legacy app.configure() method from app template. + +3.1.0 / 2013-01-25 +================== + + * add support for leading "." in "view engine" setting + * add array support to `res.set()` + * add node 0.8.x to travis.yml + * add "subdomain offset" setting for tweaking `req.subdomains` + * add `res.location(url)` implementing `res.redirect()`-like setting of Location + * use app.get() for x-powered-by setting for inheritance + * fix colons in passwords for `req.auth` + +3.0.6 / 2013-01-04 +================== + + * add http verb methods to Router + * update connect + * fix mangling of the `res.cookie()` options object + * fix jsonp whitespace escape. Closes #1132 + +3.0.5 / 2012-12-19 +================== + + * add throwing when a non-function is passed to a route + * fix: explicitly remove Transfer-Encoding header from 204 and 304 responses + * revert "add 'etag' option" + +3.0.4 / 2012-12-05 +================== + + * add 'etag' option to disable `res.send()` Etags + * add escaping of urls in text/plain in `res.redirect()` + for old browsers interpreting as html + * change crc32 module for a more liberal license + * update connect + +3.0.3 / 2012-11-13 +================== + + * update connect + * update cookie module + * fix cookie max-age + +3.0.2 / 2012-11-08 +================== + + * add OPTIONS to cors example. Closes #1398 + * fix route chaining regression. Closes #1397 + +3.0.1 / 2012-11-01 +================== + + * update connect + +3.0.0 / 2012-10-23 +================== + + * add `make clean` + * add "Basic" check to req.auth + * add `req.auth` test coverage + * add cb && cb(payload) to `res.jsonp()`. Closes #1374 + * add backwards compat for `res.redirect()` status. Closes #1336 + * add support for `res.json()` to retain previously defined Content-Types. Closes #1349 + * update connect + * change `res.redirect()` to utilize a pathname-relative Location again. Closes #1382 + * remove non-primitive string support for `res.send()` + * fix view-locals example. Closes #1370 + * fix route-separation example + +3.0.0rc5 / 2012-09-18 +================== + + * update connect + * add redis search example + * add static-files example + * add "x-powered-by" setting (`app.disable('x-powered-by')`) + * add "application/octet-stream" redirect Accept test case. Closes #1317 + +3.0.0rc4 / 2012-08-30 +================== + + * add `res.jsonp()`. Closes #1307 + * add "verbose errors" option to error-pages example + * add another route example to express(1) so people are not so confused + * add redis online user activity tracking example + * update connect dep + * fix etag quoting. Closes #1310 + * fix error-pages 404 status + * fix jsonp callback char restrictions + * remove old OPTIONS default response + +3.0.0rc3 / 2012-08-13 +================== + + * update connect dep + * fix signed cookies to work with `connect.cookieParser()` ("s:" prefix was missing) [tnydwrds] + * fix `res.render()` clobbering of "locals" + +3.0.0rc2 / 2012-08-03 +================== + + * add CORS example + * update connect dep + * deprecate `.createServer()` & remove old stale examples + * fix: escape `res.redirect()` link + * fix vhost example + +3.0.0rc1 / 2012-07-24 +================== + + * add more examples to view-locals + * add scheme-relative redirects (`res.redirect("//foo.com")`) support + * update cookie dep + * update connect dep + * update send dep + * fix `express(1)` -h flag, use -H for hogan. Closes #1245 + * fix `res.sendfile()` socket error handling regression + +3.0.0beta7 / 2012-07-16 +================== + + * update connect dep for `send()` root normalization regression + +3.0.0beta6 / 2012-07-13 +================== + + * add `err.view` property for view errors. Closes #1226 + * add "jsonp callback name" setting + * add support for "/foo/:bar*" non-greedy matches + * change `res.sendfile()` to use `send()` module + * change `res.send` to use "response-send" module + * remove `app.locals.use` and `res.locals.use`, use regular middleware + +3.0.0beta5 / 2012-07-03 +================== + + * add "make check" support + * add route-map example + * add `res.json(obj, status)` support back for BC + * add "methods" dep, remove internal methods module + * update connect dep + * update auth example to utilize cores pbkdf2 + * updated tests to use "supertest" + +3.0.0beta4 / 2012-06-25 +================== + + * Added `req.auth` + * Added `req.range(size)` + * Added `res.links(obj)` + * Added `res.send(body, status)` support back for backwards compat + * Added `.default()` support to `res.format()` + * Added 2xx / 304 check to `req.fresh` + * Revert "Added + support to the router" + * Fixed `res.send()` freshness check, respect res.statusCode + +3.0.0beta3 / 2012-06-15 +================== + + * Added hogan `--hjs` to express(1) [nullfirm] + * Added another example to content-negotiation + * Added `fresh` dep + * Changed: `res.send()` always checks freshness + * Fixed: expose connects mime module. Closes #1165 + +3.0.0beta2 / 2012-06-06 +================== + + * Added `+` support to the router + * Added `req.host` + * Changed `req.param()` to check route first + * Update connect dep + +3.0.0beta1 / 2012-06-01 +================== + + * Added `res.format()` callback to override default 406 behaviour + * Fixed `res.redirect()` 406. Closes #1154 + +3.0.0alpha5 / 2012-05-30 +================== + + * Added `req.ip` + * Added `{ signed: true }` option to `res.cookie()` + * Removed `res.signedCookie()` + * Changed: dont reverse `req.ips` + * Fixed "trust proxy" setting check for `req.ips` + +3.0.0alpha4 / 2012-05-09 +================== + + * Added: allow `[]` in jsonp callback. Closes #1128 + * Added `PORT` env var support in generated template. Closes #1118 [benatkin] + * Updated: connect 2.2.2 + +3.0.0alpha3 / 2012-05-04 +================== + + * Added public `app.routes`. Closes #887 + * Added _view-locals_ example + * Added _mvc_ example + * Added `res.locals.use()`. Closes #1120 + * Added conditional-GET support to `res.send()` + * Added: coerce `res.set()` values to strings + * Changed: moved `static()` in generated apps below router + * Changed: `res.send()` only set ETag when not previously set + * Changed connect 2.2.1 dep + * Changed: `make test` now runs unit / acceptance tests + * Fixed req/res proto inheritance + +3.0.0alpha2 / 2012-04-26 +================== + + * Added `make benchmark` back + * Added `res.send()` support for `String` objects + * Added client-side data exposing example + * Added `res.header()` and `req.header()` aliases for BC + * Added `express.createServer()` for BC + * Perf: memoize parsed urls + * Perf: connect 2.2.0 dep + * Changed: make `expressInit()` middleware self-aware + * Fixed: use app.get() for all core settings + * Fixed redis session example + * Fixed session example. Closes #1105 + * Fixed generated express dep. Closes #1078 + +3.0.0alpha1 / 2012-04-15 +================== + + * Added `app.locals.use(callback)` + * Added `app.locals` object + * Added `app.locals(obj)` + * Added `res.locals` object + * Added `res.locals(obj)` + * Added `res.format()` for content-negotiation + * Added `app.engine()` + * Added `res.cookie()` JSON cookie support + * Added "trust proxy" setting + * Added `req.subdomains` + * Added `req.protocol` + * Added `req.secure` + * Added `req.path` + * Added `req.ips` + * Added `req.fresh` + * Added `req.stale` + * Added comma-delimited / array support for `req.accepts()` + * Added debug instrumentation + * Added `res.set(obj)` + * Added `res.set(field, value)` + * Added `res.get(field)` + * Added `app.get(setting)`. Closes #842 + * Added `req.acceptsLanguage()` + * Added `req.acceptsCharset()` + * Added `req.accepted` + * Added `req.acceptedLanguages` + * Added `req.acceptedCharsets` + * Added "json replacer" setting + * Added "json spaces" setting + * Added X-Forwarded-Proto support to `res.redirect()`. Closes #92 + * Added `--less` support to express(1) + * Added `express.response` prototype + * Added `express.request` prototype + * Added `express.application` prototype + * Added `app.path()` + * Added `app.render()` + * Added `res.type()` to replace `res.contentType()` + * Changed: `res.redirect()` to add relative support + * Changed: enable "jsonp callback" by default + * Changed: renamed "case sensitive routes" to "case sensitive routing" + * Rewrite of all tests with mocha + * Removed "root" setting + * Removed `res.redirect('home')` support + * Removed `req.notify()` + * Removed `app.register()` + * Removed `app.redirect()` + * Removed `app.is()` + * Removed `app.helpers()` + * Removed `app.dynamicHelpers()` + * Fixed `res.sendfile()` with non-GET. Closes #723 + * Fixed express(1) public dir for windows. Closes #866 + +2.5.9/ 2012-04-02 +================== + + * Added support for PURGE request method [pbuyle] + * Fixed `express(1)` generated app `app.address()` before `listening` [mmalecki] + +2.5.8 / 2012-02-08 +================== + + * Update mkdirp dep. Closes #991 + +2.5.7 / 2012-02-06 +================== + + * Fixed `app.all` duplicate DELETE requests [mscdex] + +2.5.6 / 2012-01-13 +================== + + * Updated hamljs dev dep. Closes #953 + +2.5.5 / 2012-01-08 +================== + + * Fixed: set `filename` on cached templates [matthewleon] + +2.5.4 / 2012-01-02 +================== + + * Fixed `express(1)` eol on 0.4.x. Closes #947 + +2.5.3 / 2011-12-30 +================== + + * Fixed `req.is()` when a charset is present + +2.5.2 / 2011-12-10 +================== + + * Fixed: express(1) LF -> CRLF for windows + +2.5.1 / 2011-11-17 +================== + + * Changed: updated connect to 1.8.x + * Removed sass.js support from express(1) + +2.5.0 / 2011-10-24 +================== + + * Added ./routes dir for generated app by default + * Added npm install reminder to express(1) app gen + * Added 0.5.x support + * Removed `make test-cov` since it wont work with node 0.5.x + * Fixed express(1) public dir for windows. Closes #866 + +2.4.7 / 2011-10-05 +================== + + * Added mkdirp to express(1). Closes #795 + * Added simple _json-config_ example + * Added shorthand for the parsed request's pathname via `req.path` + * Changed connect dep to 1.7.x to fix npm issue... + * Fixed `res.redirect()` __HEAD__ support. [reported by xerox] + * Fixed `req.flash()`, only escape args + * Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie] + +2.4.6 / 2011-08-22 +================== + + * Fixed multiple param callback regression. Closes #824 [reported by TroyGoode] + +2.4.5 / 2011-08-19 +================== + + * Added support for routes to handle errors. Closes #809 + * Added `app.routes.all()`. Closes #803 + * Added "basepath" setting to work in conjunction with reverse proxies etc. + * Refactored `Route` to use a single array of callbacks + * Added support for multiple callbacks for `app.param()`. Closes #801 +Closes #805 + * Changed: removed .call(self) for route callbacks + * Dependency: `qs >= 0.3.1` + * Fixed `res.redirect()` on windows due to `join()` usage. Closes #808 + +2.4.4 / 2011-08-05 +================== + + * Fixed `res.header()` intention of a set, even when `undefined` + * Fixed `*`, value no longer required + * Fixed `res.send(204)` support. Closes #771 + +2.4.3 / 2011-07-14 +================== + + * Added docs for `status` option special-case. Closes #739 + * Fixed `options.filename`, exposing the view path to template engines + +2.4.2. / 2011-07-06 +================== + + * Revert "removed jsonp stripping" for XSS + +2.4.1 / 2011-07-06 +================== + + * Added `res.json()` JSONP support. Closes #737 + * Added _extending-templates_ example. Closes #730 + * Added "strict routing" setting for trailing slashes + * Added support for multiple envs in `app.configure()` calls. Closes #735 + * Changed: `res.send()` using `res.json()` + * Changed: when cookie `path === null` don't default it + * Changed; default cookie path to "home" setting. Closes #731 + * Removed _pids/logs_ creation from express(1) + +2.4.0 / 2011-06-28 +================== + + * Added chainable `res.status(code)` + * Added `res.json()`, an explicit version of `res.send(obj)` + * Added simple web-service example + +2.3.12 / 2011-06-22 +================== + + * \#express is now on freenode! come join! + * Added `req.get(field, param)` + * Added links to Japanese documentation, thanks @hideyukisaito! + * Added; the `express(1)` generated app outputs the env + * Added `content-negotiation` example + * Dependency: connect >= 1.5.1 < 2.0.0 + * Fixed view layout bug. Closes #720 + * Fixed; ignore body on 304. Closes #701 + +2.3.11 / 2011-06-04 +================== + + * Added `npm test` + * Removed generation of dummy test file from `express(1)` + * Fixed; `express(1)` adds express as a dep + * Fixed; prune on `prepublish` + +2.3.10 / 2011-05-27 +================== + + * Added `req.route`, exposing the current route + * Added _package.json_ generation support to `express(1)` + * Fixed call to `app.param()` function for optional params. Closes #682 + +2.3.9 / 2011-05-25 +================== + + * Fixed bug-ish with `../' in `res.partial()` calls + +2.3.8 / 2011-05-24 +================== + + * Fixed `app.options()` + +2.3.7 / 2011-05-23 +================== + + * Added route `Collection`, ex: `app.get('/user/:id').remove();` + * Added support for `app.param(fn)` to define param logic + * Removed `app.param()` support for callback with return value + * Removed module.parent check from express(1) generated app. Closes #670 + * Refactored router. Closes #639 + +2.3.6 / 2011-05-20 +================== + + * Changed; using devDependencies instead of git submodules + * Fixed redis session example + * Fixed markdown example + * Fixed view caching, should not be enabled in development + +2.3.5 / 2011-05-20 +================== + + * Added export `.view` as alias for `.View` + +2.3.4 / 2011-05-08 +================== + + * Added `./examples/say` + * Fixed `res.sendfile()` bug preventing the transfer of files with spaces + +2.3.3 / 2011-05-03 +================== + + * Added "case sensitive routes" option. + * Changed; split methods supported per rfc [slaskis] + * Fixed route-specific middleware when using the same callback function several times + +2.3.2 / 2011-04-27 +================== + + * Fixed view hints + +2.3.1 / 2011-04-26 +================== + + * Added `app.match()` as `app.match.all()` + * Added `app.lookup()` as `app.lookup.all()` + * Added `app.remove()` for `app.remove.all()` + * Added `app.remove.VERB()` + * Fixed template caching collision issue. Closes #644 + * Moved router over from connect and started refactor + +2.3.0 / 2011-04-25 +================== + + * Added options support to `res.clearCookie()` + * Added `res.helpers()` as alias of `res.locals()` + * Added; json defaults to UTF-8 with `res.send()`. Closes #632. [Daniel * Dependency `connect >= 1.4.0` + * Changed; auto set Content-Type in res.attachement [Aaron Heckmann] + * Renamed "cache views" to "view cache". Closes #628 + * Fixed caching of views when using several apps. Closes #637 + * Fixed gotcha invoking `app.param()` callbacks once per route middleware. +Closes #638 + * Fixed partial lookup precedence. Closes #631 +Shaw] + +2.2.2 / 2011-04-12 +================== + + * Added second callback support for `res.download()` connection errors + * Fixed `filename` option passing to template engine + +2.2.1 / 2011-04-04 +================== + + * Added `layout(path)` helper to change the layout within a view. Closes #610 + * Fixed `partial()` collection object support. + Previously only anything with `.length` would work. + When `.length` is present one must still be aware of holes, + however now `{ collection: {foo: 'bar'}}` is valid, exposes + `keyInCollection` and `keysInCollection`. + + * Performance improved with better view caching + * Removed `request` and `response` locals + * Changed; errorHandler page title is now `Express` instead of `Connect` + +2.2.0 / 2011-03-30 +================== + + * Added `app.lookup.VERB()`, ex `app.lookup.put('/user/:id')`. Closes #606 + * Added `app.match.VERB()`, ex `app.match.put('/user/12')`. Closes #606 + * Added `app.VERB(path)` as alias of `app.lookup.VERB()`. + * Dependency `connect >= 1.2.0` + +2.1.1 / 2011-03-29 +================== + + * Added; expose `err.view` object when failing to locate a view + * Fixed `res.partial()` call `next(err)` when no callback is given [reported by aheckmann] + * Fixed; `res.send(undefined)` responds with 204 [aheckmann] + +2.1.0 / 2011-03-24 +================== + + * Added `/_?` partial lookup support. Closes #447 + * Added `request`, `response`, and `app` local variables + * Added `settings` local variable, containing the app's settings + * Added `req.flash()` exception if `req.session` is not available + * Added `res.send(bool)` support (json response) + * Fixed stylus example for latest version + * Fixed; wrap try/catch around `res.render()` + +2.0.0 / 2011-03-17 +================== + + * Fixed up index view path alternative. + * Changed; `res.locals()` without object returns the locals + +2.0.0rc3 / 2011-03-17 +================== + + * Added `res.locals(obj)` to compliment `res.local(key, val)` + * Added `res.partial()` callback support + * Fixed recursive error reporting issue in `res.render()` + +2.0.0rc2 / 2011-03-17 +================== + + * Changed; `partial()` "locals" are now optional + * Fixed `SlowBuffer` support. Closes #584 [reported by tyrda01] + * Fixed .filename view engine option [reported by drudge] + * Fixed blog example + * Fixed `{req,res}.app` reference when mounting [Ben Weaver] + +2.0.0rc / 2011-03-14 +================== + + * Fixed; expose `HTTPSServer` constructor + * Fixed express(1) default test charset. Closes #579 [reported by secoif] + * Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP] + +2.0.0beta3 / 2011-03-09 +================== + + * Added support for `res.contentType()` literal + The original `res.contentType('.json')`, + `res.contentType('application/json')`, and `res.contentType('json')` + will work now. + * Added `res.render()` status option support back + * Added charset option for `res.render()` + * Added `.charset` support (via connect 1.0.4) + * Added view resolution hints when in development and a lookup fails + * Added layout lookup support relative to the page view. + For example while rendering `./views/user/index.jade` if you create + `./views/user/layout.jade` it will be used in favour of the root layout. + * Fixed `res.redirect()`. RFC states absolute url [reported by unlink] + * Fixed; default `res.send()` string charset to utf8 + * Removed `Partial` constructor (not currently used) + +2.0.0beta2 / 2011-03-07 +================== + + * Added res.render() `.locals` support back to aid in migration process + * Fixed flash example + +2.0.0beta / 2011-03-03 +================== + + * Added HTTPS support + * Added `res.cookie()` maxAge support + * Added `req.header()` _Referrer_ / _Referer_ special-case, either works + * Added mount support for `res.redirect()`, now respects the mount-point + * Added `union()` util, taking place of `merge(clone())` combo + * Added stylus support to express(1) generated app + * Added secret to session middleware used in examples and generated app + * Added `res.local(name, val)` for progressive view locals + * Added default param support to `req.param(name, default)` + * Added `app.disabled()` and `app.enabled()` + * Added `app.register()` support for omitting leading ".", either works + * Added `res.partial()`, using the same interface as `partial()` within a view. Closes #539 + * Added `app.param()` to map route params to async/sync logic + * Added; aliased `app.helpers()` as `app.locals()`. Closes #481 + * Added extname with no leading "." support to `res.contentType()` + * Added `cache views` setting, defaulting to enabled in "production" env + * Added index file partial resolution, eg: partial('user') may try _views/user/index.jade_. + * Added `req.accepts()` support for extensions + * Changed; `res.download()` and `res.sendfile()` now utilize Connect's + static file server `connect.static.send()`. + * Changed; replaced `connect.utils.mime()` with npm _mime_ module + * Changed; allow `req.query` to be pre-defined (via middleware or other parent + * Changed view partial resolution, now relative to parent view + * Changed view engine signature. no longer `engine.render(str, options, callback)`, now `engine.compile(str, options) -> Function`, the returned function accepts `fn(locals)`. + * Fixed `req.param()` bug returning Array.prototype methods. Closes #552 + * Fixed; using `Stream#pipe()` instead of `sys.pump()` in `res.sendfile()` + * Fixed; using _qs_ module instead of _querystring_ + * Fixed; strip unsafe chars from jsonp callbacks + * Removed "stream threshold" setting + +1.0.8 / 2011-03-01 +================== + + * Allow `req.query` to be pre-defined (via middleware or other parent app) + * "connect": ">= 0.5.0 < 1.0.0". Closes #547 + * Removed the long deprecated __EXPRESS_ENV__ support + +1.0.7 / 2011-02-07 +================== + + * Fixed `render()` setting inheritance. + Mounted apps would not inherit "view engine" + +1.0.6 / 2011-02-07 +================== + + * Fixed `view engine` setting bug when period is in dirname + +1.0.5 / 2011-02-05 +================== + + * Added secret to generated app `session()` call + +1.0.4 / 2011-02-05 +================== + + * Added `qs` dependency to _package.json_ + * Fixed namespaced `require()`s for latest connect support + +1.0.3 / 2011-01-13 +================== + + * Remove unsafe characters from JSONP callback names [Ryan Grove] + +1.0.2 / 2011-01-10 +================== + + * Removed nested require, using `connect.router` + +1.0.1 / 2010-12-29 +================== + + * Fixed for middleware stacked via `createServer()` + previously the `foo` middleware passed to `createServer(foo)` + would not have access to Express methods such as `res.send()` + or props like `req.query` etc. + +1.0.0 / 2010-11-16 +================== + + * Added; deduce partial object names from the last segment. + For example by default `partial('forum/post', postObject)` will + give you the _post_ object, providing a meaningful default. + * Added http status code string representation to `res.redirect()` body + * Added; `res.redirect()` supporting _text/plain_ and _text/html_ via __Accept__. + * Added `req.is()` to aid in content negotiation + * Added partial local inheritance [suggested by masylum]. Closes #102 + providing access to parent template locals. + * Added _-s, --session[s]_ flag to express(1) to add session related middleware + * Added _--template_ flag to express(1) to specify the + template engine to use. + * Added _--css_ flag to express(1) to specify the + stylesheet engine to use (or just plain css by default). + * Added `app.all()` support [thanks aheckmann] + * Added partial direct object support. + You may now `partial('user', user)` providing the "user" local, + vs previously `partial('user', { object: user })`. + * Added _route-separation_ example since many people question ways + to do this with CommonJS modules. Also view the _blog_ example for + an alternative. + * Performance; caching view path derived partial object names + * Fixed partial local inheritance precedence. [reported by Nick Poulden] Closes #454 + * Fixed jsonp support; _text/javascript_ as per mailinglist discussion + +1.0.0rc4 / 2010-10-14 +================== + + * Added _NODE_ENV_ support, _EXPRESS_ENV_ is deprecated and will be removed in 1.0.0 + * Added route-middleware support (very helpful, see the [docs](http://expressjs.com/guide.html#Route-Middleware)) + * Added _jsonp callback_ setting to enable/disable jsonp autowrapping [Dav Glass] + * Added callback query check on response.send to autowrap JSON objects for simple webservice implementations [Dav Glass] + * Added `partial()` support for array-like collections. Closes #434 + * Added support for swappable querystring parsers + * Added session usage docs. Closes #443 + * Added dynamic helper caching. Closes #439 [suggested by maritz] + * Added authentication example + * Added basic Range support to `res.sendfile()` (and `res.download()` etc) + * Changed; `express(1)` generated app using 2 spaces instead of 4 + * Default env to "development" again [aheckmann] + * Removed _context_ option is no more, use "scope" + * Fixed; exposing _./support_ libs to examples so they can run without installs + * Fixed mvc example + +1.0.0rc3 / 2010-09-20 +================== + + * Added confirmation for `express(1)` app generation. Closes #391 + * Added extending of flash formatters via `app.flashFormatters` + * Added flash formatter support. Closes #411 + * Added streaming support to `res.sendfile()` using `sys.pump()` when >= "stream threshold" + * Added _stream threshold_ setting for `res.sendfile()` + * Added `res.send()` __HEAD__ support + * Added `res.clearCookie()` + * Added `res.cookie()` + * Added `res.render()` headers option + * Added `res.redirect()` response bodies + * Added `res.render()` status option support. Closes #425 [thanks aheckmann] + * Fixed `res.sendfile()` responding with 403 on malicious path + * Fixed `res.download()` bug; when an error occurs remove _Content-Disposition_ + * Fixed; mounted apps settings now inherit from parent app [aheckmann] + * Fixed; stripping Content-Length / Content-Type when 204 + * Fixed `res.send()` 204. Closes #419 + * Fixed multiple _Set-Cookie_ headers via `res.header()`. Closes #402 + * Fixed bug messing with error handlers when `listenFD()` is called instead of `listen()`. [thanks guillermo] + + +1.0.0rc2 / 2010-08-17 +================== + + * Added `app.register()` for template engine mapping. Closes #390 + * Added `res.render()` callback support as second argument (no options) + * Added callback support to `res.download()` + * Added callback support for `res.sendfile()` + * Added support for middleware access via `express.middlewareName()` vs `connect.middlewareName()` + * Added "partials" setting to docs + * Added default expresso tests to `express(1)` generated app. Closes #384 + * Fixed `res.sendfile()` error handling, defer via `next()` + * Fixed `res.render()` callback when a layout is used [thanks guillermo] + * Fixed; `make install` creating ~/.node_libraries when not present + * Fixed issue preventing error handlers from being defined anywhere. Closes #387 + +1.0.0rc / 2010-07-28 +================== + + * Added mounted hook. Closes #369 + * Added connect dependency to _package.json_ + + * Removed "reload views" setting and support code + development env never caches, production always caches. + + * Removed _param_ in route callbacks, signature is now + simply (req, res, next), previously (req, res, params, next). + Use _req.params_ for path captures, _req.query_ for GET params. + + * Fixed "home" setting + * Fixed middleware/router precedence issue. Closes #366 + * Fixed; _configure()_ callbacks called immediately. Closes #368 + +1.0.0beta2 / 2010-07-23 +================== + + * Added more examples + * Added; exporting `Server` constructor + * Added `Server#helpers()` for view locals + * Added `Server#dynamicHelpers()` for dynamic view locals. Closes #349 + * Added support for absolute view paths + * Added; _home_ setting defaults to `Server#route` for mounted apps. Closes #363 + * Added Guillermo Rauch to the contributor list + * Added support for "as" for non-collection partials. Closes #341 + * Fixed _install.sh_, ensuring _~/.node_libraries_ exists. Closes #362 [thanks jf] + * Fixed `res.render()` exceptions, now passed to `next()` when no callback is given [thanks guillermo] + * Fixed instanceof `Array` checks, now `Array.isArray()` + * Fixed express(1) expansion of public dirs. Closes #348 + * Fixed middleware precedence. Closes #345 + * Fixed view watcher, now async [thanks aheckmann] + +1.0.0beta / 2010-07-15 +================== + + * Re-write + - much faster + - much lighter + - Check [ExpressJS.com](http://expressjs.com) for migration guide and updated docs + +0.14.0 / 2010-06-15 +================== + + * Utilize relative requires + * Added Static bufferSize option [aheckmann] + * Fixed caching of view and partial subdirectories [aheckmann] + * Fixed mime.type() comments now that ".ext" is not supported + * Updated haml submodule + * Updated class submodule + * Removed bin/express + +0.13.0 / 2010-06-01 +================== + + * Added node v0.1.97 compatibility + * Added support for deleting cookies via Request#cookie('key', null) + * Updated haml submodule + * Fixed not-found page, now using charset utf-8 + * Fixed show-exceptions page, now using charset utf-8 + * Fixed view support due to fs.readFile Buffers + * Changed; mime.type() no longer accepts ".type" due to node extname() changes + +0.12.0 / 2010-05-22 +================== + + * Added node v0.1.96 compatibility + * Added view `helpers` export which act as additional local variables + * Updated haml submodule + * Changed ETag; removed inode, modified time only + * Fixed LF to CRLF for setting multiple cookies + * Fixed cookie compilation; values are now urlencoded + * Fixed cookies parsing; accepts quoted values and url escaped cookies + +0.11.0 / 2010-05-06 +================== + + * Added support for layouts using different engines + - this.render('page.html.haml', { layout: 'super-cool-layout.html.ejs' }) + - this.render('page.html.haml', { layout: 'foo' }) // assumes 'foo.html.haml' + - this.render('page.html.haml', { layout: false }) // no layout + * Updated ext submodule + * Updated haml submodule + * Fixed EJS partial support by passing along the context. Issue #307 + +0.10.1 / 2010-05-03 +================== + + * Fixed binary uploads. + +0.10.0 / 2010-04-30 +================== + + * Added charset support via Request#charset (automatically assigned to 'UTF-8' when respond()'s + encoding is set to 'utf8' or 'utf-8'). + * Added "encoding" option to Request#render(). Closes #299 + * Added "dump exceptions" setting, which is enabled by default. + * Added simple ejs template engine support + * Added error response support for text/plain, application/json. Closes #297 + * Added callback function param to Request#error() + * Added Request#sendHead() + * Added Request#stream() + * Added support for Request#respond(304, null) for empty response bodies + * Added ETag support to Request#sendfile() + * Added options to Request#sendfile(), passed to fs.createReadStream() + * Added filename arg to Request#download() + * Performance enhanced due to pre-reversing plugins so that plugins.reverse() is not called on each request + * Performance enhanced by preventing several calls to toLowerCase() in Router#match() + * Changed; Request#sendfile() now streams + * Changed; Renamed Request#halt() to Request#respond(). Closes #289 + * Changed; Using sys.inspect() instead of JSON.encode() for error output + * Changed; run() returns the http.Server instance. Closes #298 + * Changed; Defaulting Server#host to null (INADDR_ANY) + * Changed; Logger "common" format scale of 0.4f + * Removed Logger "request" format + * Fixed; Catching ENOENT in view caching, preventing error when "views/partials" is not found + * Fixed several issues with http client + * Fixed Logger Content-Length output + * Fixed bug preventing Opera from retaining the generated session id. Closes #292 + +0.9.0 / 2010-04-14 +================== + + * Added DSL level error() route support + * Added DSL level notFound() route support + * Added Request#error() + * Added Request#notFound() + * Added Request#render() callback function. Closes #258 + * Added "max upload size" setting + * Added "magic" variables to collection partials (\_\_index\_\_, \_\_length\_\_, \_\_isFirst\_\_, \_\_isLast\_\_). Closes #254 + * Added [haml.js](http://github.com/visionmedia/haml.js) submodule; removed haml-js + * Added callback function support to Request#halt() as 3rd/4th arg + * Added preprocessing of route param wildcards using param(). Closes #251 + * Added view partial support (with collections etc.) + * Fixed bug preventing falsey params (such as ?page=0). Closes #286 + * Fixed setting of multiple cookies. Closes #199 + * Changed; view naming convention is now NAME.TYPE.ENGINE (for example page.html.haml) + * Changed; session cookie is now httpOnly + * Changed; Request is no longer global + * Changed; Event is no longer global + * Changed; "sys" module is no longer global + * Changed; moved Request#download to Static plugin where it belongs + * Changed; Request instance created before body parsing. Closes #262 + * Changed; Pre-caching views in memory when "cache view contents" is enabled. Closes #253 + * Changed; Pre-caching view partials in memory when "cache view partials" is enabled + * Updated support to node --version 0.1.90 + * Updated dependencies + * Removed set("session cookie") in favour of use(Session, { cookie: { ... }}) + * Removed utils.mixin(); use Object#mergeDeep() + +0.8.0 / 2010-03-19 +================== + + * Added coffeescript example app. Closes #242 + * Changed; cache api now async friendly. Closes #240 + * Removed deprecated 'express/static' support. Use 'express/plugins/static' + +0.7.6 / 2010-03-19 +================== + + * Added Request#isXHR. Closes #229 + * Added `make install` (for the executable) + * Added `express` executable for setting up simple app templates + * Added "GET /public/*" to Static plugin, defaulting to /public + * Added Static plugin + * Fixed; Request#render() only calls cache.get() once + * Fixed; Namespacing View caches with "view:" + * Fixed; Namespacing Static caches with "static:" + * Fixed; Both example apps now use the Static plugin + * Fixed set("views"). Closes #239 + * Fixed missing space for combined log format + * Deprecated Request#sendfile() and 'express/static' + * Removed Server#running + +0.7.5 / 2010-03-16 +================== + + * Added Request#flash() support without args, now returns all flashes + * Updated ext submodule + +0.7.4 / 2010-03-16 +================== + + * Fixed session reaper + * Changed; class.js replacing js-oo Class implementation (quite a bit faster, no browser cruft) + +0.7.3 / 2010-03-16 +================== + + * Added package.json + * Fixed requiring of haml / sass due to kiwi removal + +0.7.2 / 2010-03-16 +================== + + * Fixed GIT submodules (HAH!) + +0.7.1 / 2010-03-16 +================== + + * Changed; Express now using submodules again until a PM is adopted + * Changed; chat example using millisecond conversions from ext + +0.7.0 / 2010-03-15 +================== + + * Added Request#pass() support (finds the next matching route, or the given path) + * Added Logger plugin (default "common" format replaces CommonLogger) + * Removed Profiler plugin + * Removed CommonLogger plugin + +0.6.0 / 2010-03-11 +================== + + * Added seed.yml for kiwi package management support + * Added HTTP client query string support when method is GET. Closes #205 + + * Added support for arbitrary view engines. + For example "foo.engine.html" will now require('engine'), + the exports from this module are cached after the first require(). + + * Added async plugin support + + * Removed usage of RESTful route funcs as http client + get() etc, use http.get() and friends + + * Removed custom exceptions + +0.5.0 / 2010-03-10 +================== + + * Added ext dependency (library of js extensions) + * Removed extname() / basename() utils. Use path module + * Removed toArray() util. Use arguments.values + * Removed escapeRegexp() util. Use RegExp.escape() + * Removed process.mixin() dependency. Use utils.mixin() + * Removed Collection + * Removed ElementCollection + * Shameless self promotion of ebook "Advanced JavaScript" (http://dev-mag.com) ;) + +0.4.0 / 2010-02-11 +================== + + * Added flash() example to sample upload app + * Added high level restful http client module (express/http) + * Changed; RESTful route functions double as HTTP clients. Closes #69 + * Changed; throwing error when routes are added at runtime + * Changed; defaulting render() context to the current Request. Closes #197 + * Updated haml submodule + +0.3.0 / 2010-02-11 +================== + + * Updated haml / sass submodules. Closes #200 + * Added flash message support. Closes #64 + * Added accepts() now allows multiple args. fixes #117 + * Added support for plugins to halt. Closes #189 + * Added alternate layout support. Closes #119 + * Removed Route#run(). Closes #188 + * Fixed broken specs due to use(Cookie) missing + +0.2.1 / 2010-02-05 +================== + + * Added "plot" format option for Profiler (for gnuplot processing) + * Added request number to Profiler plugin + * Fixed binary encoding for multipart file uploads, was previously defaulting to UTF8 + * Fixed issue with routes not firing when not files are present. Closes #184 + * Fixed process.Promise -> events.Promise + +0.2.0 / 2010-02-03 +================== + + * Added parseParam() support for name[] etc. (allows for file inputs with "multiple" attr) Closes #180 + * Added Both Cache and Session option "reapInterval" may be "reapEvery". Closes #174 + * Added expiration support to cache api with reaper. Closes #133 + * Added cache Store.Memory#reap() + * Added Cache; cache api now uses first class Cache instances + * Added abstract session Store. Closes #172 + * Changed; cache Memory.Store#get() utilizing Collection + * Renamed MemoryStore -> Store.Memory + * Fixed use() of the same plugin several time will always use latest options. Closes #176 + +0.1.0 / 2010-02-03 +================== + + * Changed; Hooks (before / after) pass request as arg as well as evaluated in their context + * Updated node support to 0.1.27 Closes #169 + * Updated dirname(__filename) -> __dirname + * Updated libxmljs support to v0.2.0 + * Added session support with memory store / reaping + * Added quick uid() helper + * Added multi-part upload support + * Added Sass.js support / submodule + * Added production env caching view contents and static files + * Added static file caching. Closes #136 + * Added cache plugin with memory stores + * Added support to StaticFile so that it works with non-textual files. + * Removed dirname() helper + * Removed several globals (now their modules must be required) + +0.0.2 / 2010-01-10 +================== + + * Added view benchmarks; currently haml vs ejs + * Added Request#attachment() specs. Closes #116 + * Added use of node's parseQuery() util. Closes #123 + * Added `make init` for submodules + * Updated Haml + * Updated sample chat app to show messages on load + * Updated libxmljs parseString -> parseHtmlString + * Fixed `make init` to work with older versions of git + * Fixed specs can now run independent specs for those who can't build deps. Closes #127 + * Fixed issues introduced by the node url module changes. Closes 126. + * Fixed two assertions failing due to Collection#keys() returning strings + * Fixed faulty Collection#toArray() spec due to keys() returning strings + * Fixed `make test` now builds libxmljs.node before testing + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/express/LICENSE b/node_modules/express/LICENSE new file mode 100644 index 0000000..aa927e4 --- /dev/null +++ b/node_modules/express/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2009-2014 TJ Holowaychuk +Copyright (c) 2013-2014 Roman Shtylman +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/express/Readme.md b/node_modules/express/Readme.md new file mode 100644 index 0000000..7443b81 --- /dev/null +++ b/node_modules/express/Readme.md @@ -0,0 +1,266 @@ +[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](https://expressjs.com/) + +**Fast, unopinionated, minimalist web framework for [Node.js](https://nodejs.org).** + +**This project has a [Code of Conduct][].** + +## Table of contents + +* [Installation](#Installation) +* [Features](#Features) +* [Docs & Community](#docs--community) +* [Quick Start](#Quick-Start) +* [Running Tests](#Running-Tests) +* [Philosophy](#Philosophy) +* [Examples](#Examples) +* [Contributing to Express](#Contributing) +* [TC (Technical Committee)](#tc-technical-committee) +* [Triagers](#triagers) +* [License](#license) + + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-downloads-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + + +```js +import express from 'express' + +const app = express() + +app.get('/', (req, res) => { + res.send('Hello World') +}) + +app.listen(3000) +``` + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). + +Before installing, [download and install Node.js](https://nodejs.org/en/download/). +Node.js 18 or higher is required. + +If this is a brand new project, make sure to create a `package.json` first with +the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file). + +Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +npm install express +``` + +Follow [our installing guide](https://expressjs.com/en/starter/installing.html) +for more information. + +## Features + + * Robust routing + * Focus on high performance + * Super-high test coverage + * HTTP helpers (redirection, caching, etc) + * View system supporting 14+ template engines + * Content negotiation + * Executable for generating applications quickly + +## Docs & Community + + * [Website and Documentation](https://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)] + * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules + * [Github Discussions](https://github.com/expressjs/discussions) for discussion on the development and usage of Express + +**PROTIP** Be sure to read the [migration guide to v5](https://expressjs.com/en/guide/migrating-5) + +## Quick Start + + The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below: + + Install the executable. The executable's major version will match Express's: + +```bash +npm install -g express-generator@4 +``` + + Create the app: + +```bash +express /tmp/foo && cd /tmp/foo +``` + + Install dependencies: + +```bash +npm install +``` + + Start the server: + +```bash +npm start +``` + + View the website at: http://localhost:3000 + +## Philosophy + + The Express philosophy is to provide small, robust tooling for HTTP servers, making + it a great solution for single page applications, websites, hybrids, or public + HTTP APIs. + + Express does not force you to use any specific ORM or template engine. With support for over + 14 template engines via [@ladjs/consolidate](https://github.com/ladjs/consolidate), + you can quickly craft your perfect framework. + +## Examples + + To view the examples, clone the Express repository: + +```bash +git clone https://github.com/expressjs/express.git --depth 1 && cd express +``` + + Then install the dependencies: + +```bash +npm install +``` + + Then run whichever example you want: + +```bash +node examples/content-negotiation +``` + +## Contributing + + [![Linux Build][github-actions-ci-image]][github-actions-ci-url] + [![Test Coverage][coveralls-image]][coveralls-url] + +The Express.js project welcomes all constructive contributions. Contributions take many forms, +from code for bug fixes and enhancements, to additions and fixes to documentation, additional +tests, triaging incoming pull requests and issues, and more! + +See the [Contributing Guide](Contributing.md) for more technical details on contributing. + +### Security Issues + +If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md). + +### Running Tests + +To run the test suite, first install the dependencies: + +```bash +npm install +``` + +Then run `npm test`: + +```bash +npm test +``` + +## People + +The original author of Express is [TJ Holowaychuk](https://github.com/tj) + +[List of all contributors](https://github.com/expressjs/express/graphs/contributors) + +### TC (Technical Committee) + +* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him) +* [jonchurch](https://github.com/jonchurch) - **Jon Church** +* [wesleytodd](https://github.com/wesleytodd) - **Wes Todd** +* [LinusU](https://github.com/LinusU) - **Linus Unnebäck** +* [blakeembrey](https://github.com/blakeembrey) - **Blake Embrey** +* [sheplu](https://github.com/sheplu) - **Jean Burellier** +* [crandmck](https://github.com/crandmck) - **Rand McKinney** +* [ctcpip](https://github.com/ctcpip) - **Chris de Almeida** + +
+TC emeriti members + +#### TC emeriti members + + * [dougwilson](https://github.com/dougwilson) - **Douglas Wilson** + * [hacksparrow](https://github.com/hacksparrow) - **Hage Yaapa** + * [jonathanong](https://github.com/jonathanong) - **jongleberry** + * [niftylettuce](https://github.com/niftylettuce) - **niftylettuce** + * [troygoode](https://github.com/troygoode) - **Troy Goode** +
+ + +### Triagers + +* [aravindvnair99](https://github.com/aravindvnair99) - **Aravind Nair** +* [bjohansebas](https://github.com/bjohansebas) - **Sebastian Beltran** +* [carpasse](https://github.com/carpasse) - **Carlos Serrano** +* [CBID2](https://github.com/CBID2) - **Christine Belzie** +* [dpopp07](https://github.com/dpopp07) - **Dustin Popp** +* [UlisesGascon](https://github.com/UlisesGascon) - **Ulises Gascón** (he/him) +* [3imed-jaberi](https://github.com/3imed-jaberi) - **Imed Jaberi** +* [IamLizu](https://github.com/IamLizu) - **S M Mahmudul Hasan** (he/him) +* [Phillip9587](https://github.com/Phillip9587) - **Phillip Barta** +* [Sushmeet](https://github.com/Sushmeet) - **Sushmeet Sunger** +* [rxmarbles](https://github.com/rxmarbles) **Rick Markins** (He/him) + +
+Triagers emeriti members + +#### Emeritus Triagers + + * [AuggieH](https://github.com/AuggieH) - **Auggie Hudak** + * [G-Rath](https://github.com/G-Rath) - **Gareth Jones** + * [MohammadXroid](https://github.com/MohammadXroid) - **Mohammad Ayashi** + * [NawafSwe](https://github.com/NawafSwe) - **Nawaf Alsharqi** + * [NotMoni](https://github.com/NotMoni) - **Moni** + * [VigneshMurugan](https://github.com/VigneshMurugan) - **Vignesh Murugan** + * [davidmashe](https://github.com/davidmashe) - **David Ashe** + * [digitaIfabric](https://github.com/digitaIfabric) - **David** + * [e-l-i-s-e](https://github.com/e-l-i-s-e) - **Elise Bonner** + * [fed135](https://github.com/fed135) - **Frederic Charette** + * [firmanJS](https://github.com/firmanJS) - **Firman Abdul Hakim** + * [getspooky](https://github.com/getspooky) - **Yasser Ameur** + * [ghinks](https://github.com/ghinks) - **Glenn** + * [ghousemohamed](https://github.com/ghousemohamed) - **Ghouse Mohamed** + * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** + * [jake32321](https://github.com/jake32321) - **Jake Reed** + * [jonchurch](https://github.com/jonchurch) - **Jon Church** + * [lekanikotun](https://github.com/lekanikotun) - **Troy Goode** + * [marsonya](https://github.com/marsonya) - **Lekan Ikotun** + * [mastermatt](https://github.com/mastermatt) - **Matt R. Wilson** + * [maxakuru](https://github.com/maxakuru) - **Max Edell** + * [mlrawlings](https://github.com/mlrawlings) - **Michael Rawlings** + * [rodion-arr](https://github.com/rodion-arr) - **Rodion Abdurakhimov** + * [sheplu](https://github.com/sheplu) - **Jean Burellier** + * [tarunyadav1](https://github.com/tarunyadav1) - **Tarun yadav** + * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** + * [enyoghasim](https://github.com/enyoghasim) - **David Enyoghasim** + * [0ss](https://github.com/0ss) - **Salah** + * [import-brain](https://github.com/import-brain) - **Eric Cheng** (he/him) + * [dakshkhetan](https://github.com/dakshkhetan) - **Daksh Khetan** (he/him) + * [lucasraziel](https://github.com/lucasraziel) - **Lucas Soares Do Rego** + * [mertcanaltin](https://github.com/mertcanaltin) - **Mert Can Altin** + +
+ + +## License + + [MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/express/master +[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/express/master?label=CI +[github-actions-ci-url]: https://github.com/expressjs/express/actions/workflows/ci.yml +[npm-downloads-image]: https://badgen.net/npm/dm/express +[npm-downloads-url]: https://npmcharts.com/compare/express?minimal=true +[npm-url]: https://npmjs.org/package/express +[npm-version-image]: https://badgen.net/npm/v/express +[ossf-scorecard-badge]: https://api.scorecard.dev/projects/github.com/expressjs/express/badge +[ossf-scorecard-visualizer]: https://ossf.github.io/scorecard-visualizer/#/projects/github.com/expressjs/express +[Code of Conduct]: https://github.com/expressjs/express/blob/master/Code-Of-Conduct.md diff --git a/node_modules/express/index.js b/node_modules/express/index.js new file mode 100644 index 0000000..d219b0c --- /dev/null +++ b/node_modules/express/index.js @@ -0,0 +1,11 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +module.exports = require('./lib/express'); diff --git a/node_modules/express/lib/application.js b/node_modules/express/lib/application.js new file mode 100644 index 0000000..cf6d78c --- /dev/null +++ b/node_modules/express/lib/application.js @@ -0,0 +1,631 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var finalhandler = require('finalhandler'); +var debug = require('debug')('express:application'); +var View = require('./view'); +var http = require('node:http'); +var methods = require('./utils').methods; +var compileETag = require('./utils').compileETag; +var compileQueryParser = require('./utils').compileQueryParser; +var compileTrust = require('./utils').compileTrust; +var resolve = require('node:path').resolve; +var once = require('once') +var Router = require('router'); + +/** + * Module variables. + * @private + */ + +var slice = Array.prototype.slice; +var flatten = Array.prototype.flat; + +/** + * Application prototype. + */ + +var app = exports = module.exports = {}; + +/** + * Variable for trust proxy inheritance back-compat + * @private + */ + +var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default'; + +/** + * Initialize the server. + * + * - setup default configuration + * - setup default middleware + * - setup route reflection methods + * + * @private + */ + +app.init = function init() { + var router = null; + + this.cache = Object.create(null); + this.engines = Object.create(null); + this.settings = Object.create(null); + + this.defaultConfiguration(); + + // Setup getting to lazily add base router + Object.defineProperty(this, 'router', { + configurable: true, + enumerable: true, + get: function getrouter() { + if (router === null) { + router = new Router({ + caseSensitive: this.enabled('case sensitive routing'), + strict: this.enabled('strict routing') + }); + } + + return router; + } + }); +}; + +/** + * Initialize application configuration. + * @private + */ + +app.defaultConfiguration = function defaultConfiguration() { + var env = process.env.NODE_ENV || 'development'; + + // default settings + this.enable('x-powered-by'); + this.set('etag', 'weak'); + this.set('env', env); + this.set('query parser', 'simple') + this.set('subdomain offset', 2); + this.set('trust proxy', false); + + // trust proxy inherit back-compat + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: true + }); + + debug('booting in %s mode', env); + + this.on('mount', function onmount(parent) { + // inherit trust proxy + if (this.settings[trustProxyDefaultSymbol] === true + && typeof parent.settings['trust proxy fn'] === 'function') { + delete this.settings['trust proxy']; + delete this.settings['trust proxy fn']; + } + + // inherit protos + Object.setPrototypeOf(this.request, parent.request) + Object.setPrototypeOf(this.response, parent.response) + Object.setPrototypeOf(this.engines, parent.engines) + Object.setPrototypeOf(this.settings, parent.settings) + }); + + // setup locals + this.locals = Object.create(null); + + // top-most app is mounted at / + this.mountpath = '/'; + + // default locals + this.locals.settings = this.settings; + + // default configuration + this.set('view', View); + this.set('views', resolve('views')); + this.set('jsonp callback name', 'callback'); + + if (env === 'production') { + this.enable('view cache'); + } +}; + +/** + * Dispatch a req, res pair into the application. Starts pipeline processing. + * + * If no callback is provided, then default error handlers will respond + * in the event of an error bubbling through the stack. + * + * @private + */ + +app.handle = function handle(req, res, callback) { + // final handler + var done = callback || finalhandler(req, res, { + env: this.get('env'), + onerror: logerror.bind(this) + }); + + // set powered by header + if (this.enabled('x-powered-by')) { + res.setHeader('X-Powered-By', 'Express'); + } + + // set circular references + req.res = res; + res.req = req; + + // alter the prototypes + Object.setPrototypeOf(req, this.request) + Object.setPrototypeOf(res, this.response) + + // setup locals + if (!res.locals) { + res.locals = Object.create(null); + } + + this.router.handle(req, res, done); +}; + +/** + * Proxy `Router#use()` to add middleware to the app router. + * See Router#use() documentation for details. + * + * If the _fn_ parameter is an express app, then it will be + * mounted at the _route_ specified. + * + * @public + */ + +app.use = function use(fn) { + var offset = 0; + var path = '/'; + + // default path to '/' + // disambiguate app.use([fn]) + if (typeof fn !== 'function') { + var arg = fn; + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0]; + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1; + path = fn; + } + } + + var fns = flatten.call(slice.call(arguments, offset), Infinity); + + if (fns.length === 0) { + throw new TypeError('app.use() requires a middleware function') + } + + // get router + var router = this.router; + + fns.forEach(function (fn) { + // non-express app + if (!fn || !fn.handle || !fn.set) { + return router.use(path, fn); + } + + debug('.use app under %s', path); + fn.mountpath = path; + fn.parent = this; + + // restore .app property on req and res + router.use(path, function mounted_app(req, res, next) { + var orig = req.app; + fn.handle(req, res, function (err) { + Object.setPrototypeOf(req, orig.request) + Object.setPrototypeOf(res, orig.response) + next(err); + }); + }); + + // mounted an app + fn.emit('mount', this); + }, this); + + return this; +}; + +/** + * Proxy to the app `Router#route()` + * Returns a new `Route` instance for the _path_. + * + * Routes are isolated middleware stacks for specific paths. + * See the Route api docs for details. + * + * @public + */ + +app.route = function route(path) { + return this.router.route(path); +}; + +/** + * Register the given template engine callback `fn` + * as `ext`. + * + * By default will `require()` the engine based on the + * file extension. For example if you try to render + * a "foo.ejs" file Express will invoke the following internally: + * + * app.engine('ejs', require('ejs').__express); + * + * For engines that do not provide `.__express` out of the box, + * or if you wish to "map" a different extension to the template engine + * you may use this method. For example mapping the EJS template engine to + * ".html" files: + * + * app.engine('html', require('ejs').renderFile); + * + * In this case EJS provides a `.renderFile()` method with + * the same signature that Express expects: `(path, options, callback)`, + * though note that it aliases this method as `ejs.__express` internally + * so if you're using ".ejs" extensions you don't need to do anything. + * + * Some template engines do not follow this convention, the + * [Consolidate.js](https://github.com/tj/consolidate.js) + * library was created to map all of node's popular template + * engines to follow this convention, thus allowing them to + * work seamlessly within Express. + * + * @param {String} ext + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +app.engine = function engine(ext, fn) { + if (typeof fn !== 'function') { + throw new Error('callback function required'); + } + + // get file extension + var extension = ext[0] !== '.' + ? '.' + ext + : ext; + + // store engine + this.engines[extension] = fn; + + return this; +}; + +/** + * Proxy to `Router#param()` with one added api feature. The _name_ parameter + * can be an array of names. + * + * See the Router#param() docs for more details. + * + * @param {String|Array} name + * @param {Function} fn + * @return {app} for chaining + * @public + */ + +app.param = function param(name, fn) { + if (Array.isArray(name)) { + for (var i = 0; i < name.length; i++) { + this.param(name[i], fn); + } + + return this; + } + + this.router.param(name, fn); + + return this; +}; + +/** + * Assign `setting` to `val`, or return `setting`'s value. + * + * app.set('foo', 'bar'); + * app.set('foo'); + * // => "bar" + * + * Mounted servers inherit their parent server's settings. + * + * @param {String} setting + * @param {*} [val] + * @return {Server} for chaining + * @public + */ + +app.set = function set(setting, val) { + if (arguments.length === 1) { + // app.get(setting) + return this.settings[setting]; + } + + debug('set "%s" to %o', setting, val); + + // set value + this.settings[setting] = val; + + // trigger matched settings + switch (setting) { + case 'etag': + this.set('etag fn', compileETag(val)); + break; + case 'query parser': + this.set('query parser fn', compileQueryParser(val)); + break; + case 'trust proxy': + this.set('trust proxy fn', compileTrust(val)); + + // trust proxy inherit back-compat + Object.defineProperty(this.settings, trustProxyDefaultSymbol, { + configurable: true, + value: false + }); + + break; + } + + return this; +}; + +/** + * Return the app's absolute pathname + * based on the parent(s) that have + * mounted it. + * + * For example if the application was + * mounted as "/admin", which itself + * was mounted as "/blog" then the + * return value would be "/blog/admin". + * + * @return {String} + * @private + */ + +app.path = function path() { + return this.parent + ? this.parent.path() + this.mountpath + : ''; +}; + +/** + * Check if `setting` is enabled (truthy). + * + * app.enabled('foo') + * // => false + * + * app.enable('foo') + * app.enabled('foo') + * // => true + * + * @param {String} setting + * @return {Boolean} + * @public + */ + +app.enabled = function enabled(setting) { + return Boolean(this.set(setting)); +}; + +/** + * Check if `setting` is disabled. + * + * app.disabled('foo') + * // => true + * + * app.enable('foo') + * app.disabled('foo') + * // => false + * + * @param {String} setting + * @return {Boolean} + * @public + */ + +app.disabled = function disabled(setting) { + return !this.set(setting); +}; + +/** + * Enable `setting`. + * + * @param {String} setting + * @return {app} for chaining + * @public + */ + +app.enable = function enable(setting) { + return this.set(setting, true); +}; + +/** + * Disable `setting`. + * + * @param {String} setting + * @return {app} for chaining + * @public + */ + +app.disable = function disable(setting) { + return this.set(setting, false); +}; + +/** + * Delegate `.VERB(...)` calls to `router.VERB(...)`. + */ + +methods.forEach(function (method) { + app[method] = function (path) { + if (method === 'get' && arguments.length === 1) { + // app.get(setting) + return this.set(path); + } + + var route = this.route(path); + route[method].apply(route, slice.call(arguments, 1)); + return this; + }; +}); + +/** + * Special-cased "all" method, applying the given route `path`, + * middleware, and callback to _every_ HTTP method. + * + * @param {String} path + * @param {Function} ... + * @return {app} for chaining + * @public + */ + +app.all = function all(path) { + var route = this.route(path); + var args = slice.call(arguments, 1); + + for (var i = 0; i < methods.length; i++) { + route[methods[i]].apply(route, args); + } + + return this; +}; + +/** + * Render the given view `name` name with `options` + * and a callback accepting an error and the + * rendered template string. + * + * Example: + * + * app.render('email', { name: 'Tobi' }, function(err, html){ + * // ... + * }) + * + * @param {String} name + * @param {Object|Function} options or fn + * @param {Function} callback + * @public + */ + +app.render = function render(name, options, callback) { + var cache = this.cache; + var done = callback; + var engines = this.engines; + var opts = options; + var view; + + // support callback function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // merge options + var renderOptions = { ...this.locals, ...opts._locals, ...opts }; + + // set .cache unless explicitly provided + if (renderOptions.cache == null) { + renderOptions.cache = this.enabled('view cache'); + } + + // primed cache + if (renderOptions.cache) { + view = cache[name]; + } + + // view + if (!view) { + var View = this.get('view'); + + view = new View(name, { + defaultEngine: this.get('view engine'), + root: this.get('views'), + engines: engines + }); + + if (!view.path) { + var dirs = Array.isArray(view.root) && view.root.length > 1 + ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"' + : 'directory "' + view.root + '"' + var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs); + err.view = view; + return done(err); + } + + // prime the cache + if (renderOptions.cache) { + cache[name] = view; + } + } + + // render + tryRender(view, renderOptions, done); +}; + +/** + * Listen for connections. + * + * A node `http.Server` is returned, with this + * application (which is a `Function`) as its + * callback. If you wish to create both an HTTP + * and HTTPS server you may do so with the "http" + * and "https" modules as shown here: + * + * var http = require('node:http') + * , https = require('node:https') + * , express = require('express') + * , app = express(); + * + * http.createServer(app).listen(80); + * https.createServer({ ... }, app).listen(443); + * + * @return {http.Server} + * @public + */ + +app.listen = function listen() { + var server = http.createServer(this) + var args = Array.prototype.slice.call(arguments) + if (typeof args[args.length - 1] === 'function') { + var done = args[args.length - 1] = once(args[args.length - 1]) + server.once('error', done) + } + return server.listen.apply(server, args) +} + +/** + * Log error using console.error. + * + * @param {Error} err + * @private + */ + +function logerror(err) { + /* istanbul ignore next */ + if (this.get('env') !== 'test') console.error(err.stack || err.toString()); +} + +/** + * Try rendering a view. + * @private + */ + +function tryRender(view, options, callback) { + try { + view.render(options, callback); + } catch (err) { + callback(err); + } +} diff --git a/node_modules/express/lib/express.js b/node_modules/express/lib/express.js new file mode 100644 index 0000000..2d502eb --- /dev/null +++ b/node_modules/express/lib/express.js @@ -0,0 +1,81 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + */ + +var bodyParser = require('body-parser') +var EventEmitter = require('node:events').EventEmitter; +var mixin = require('merge-descriptors'); +var proto = require('./application'); +var Router = require('router'); +var req = require('./request'); +var res = require('./response'); + +/** + * Expose `createApplication()`. + */ + +exports = module.exports = createApplication; + +/** + * Create an express application. + * + * @return {Function} + * @api public + */ + +function createApplication() { + var app = function(req, res, next) { + app.handle(req, res, next); + }; + + mixin(app, EventEmitter.prototype, false); + mixin(app, proto, false); + + // expose the prototype that will get set on requests + app.request = Object.create(req, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + + // expose the prototype that will get set on responses + app.response = Object.create(res, { + app: { configurable: true, enumerable: true, writable: true, value: app } + }) + + app.init(); + return app; +} + +/** + * Expose the prototypes. + */ + +exports.application = proto; +exports.request = req; +exports.response = res; + +/** + * Expose constructors. + */ + +exports.Route = Router.Route; +exports.Router = Router; + +/** + * Expose middleware + */ + +exports.json = bodyParser.json +exports.raw = bodyParser.raw +exports.static = require('serve-static'); +exports.text = bodyParser.text +exports.urlencoded = bodyParser.urlencoded diff --git a/node_modules/express/lib/request.js b/node_modules/express/lib/request.js new file mode 100644 index 0000000..d8e5263 --- /dev/null +++ b/node_modules/express/lib/request.js @@ -0,0 +1,515 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var accepts = require('accepts'); +var isIP = require('node:net').isIP; +var typeis = require('type-is'); +var http = require('node:http'); +var fresh = require('fresh'); +var parseRange = require('range-parser'); +var parse = require('parseurl'); +var proxyaddr = require('proxy-addr'); + +/** + * Request prototype. + * @public + */ + +var req = Object.create(http.IncomingMessage.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = req + +/** + * Return request header. + * + * The `Referrer` header field is special-cased, + * both `Referrer` and `Referer` are interchangeable. + * + * Examples: + * + * req.get('Content-Type'); + * // => "text/plain" + * + * req.get('content-type'); + * // => "text/plain" + * + * req.get('Something'); + * // => undefined + * + * Aliased as `req.header()`. + * + * @param {String} name + * @return {String} + * @public + */ + +req.get = +req.header = function header(name) { + if (!name) { + throw new TypeError('name argument is required to req.get'); + } + + if (typeof name !== 'string') { + throw new TypeError('name must be a string to req.get'); + } + + var lc = name.toLowerCase(); + + switch (lc) { + case 'referer': + case 'referrer': + return this.headers.referrer + || this.headers.referer; + default: + return this.headers[lc]; + } +}; + +/** + * To do: update docs. + * + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single MIME type string + * such as "application/json", an extension name + * such as "json", a comma-delimited list such as "json, html, text/plain", + * an argument list such as `"json", "html", "text/plain"`, + * or an array `["json", "html", "text/plain"]`. When a list + * or array is given, the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * req.accepts('html'); + * // => "html" + * + * // Accept: text/*, application/json + * req.accepts('html'); + * // => "html" + * req.accepts('text/html'); + * // => "text/html" + * req.accepts('json, text'); + * // => "json" + * req.accepts('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * req.accepts('image/png'); + * req.accepts('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * req.accepts(['html', 'json']); + * req.accepts('html', 'json'); + * req.accepts('html, json'); + * // => "json" + * + * @param {String|Array} type(s) + * @return {String|Array|Boolean} + * @public + */ + +req.accepts = function(){ + var accept = accepts(this); + return accept.types.apply(accept, arguments); +}; + +/** + * Check if the given `encoding`s are accepted. + * + * @param {String} ...encoding + * @return {String|Array} + * @public + */ + +req.acceptsEncodings = function(){ + var accept = accepts(this); + return accept.encodings.apply(accept, arguments); +}; + +/** + * Check if the given `charset`s are acceptable, + * otherwise you should respond with 406 "Not Acceptable". + * + * @param {String} ...charset + * @return {String|Array} + * @public + */ + +req.acceptsCharsets = function(){ + var accept = accepts(this); + return accept.charsets.apply(accept, arguments); +}; + +/** + * Check if the given `lang`s are acceptable, + * otherwise you should respond with 406 "Not Acceptable". + * + * @param {String} ...lang + * @return {String|Array} + * @public + */ + +req.acceptsLanguages = function(){ + var accept = accepts(this); + return accept.languages.apply(accept, arguments); +}; + +/** + * Parse Range header field, capping to the given `size`. + * + * Unspecified ranges such as "0-" require knowledge of your resource length. In + * the case of a byte range this is of course the total number of bytes. If the + * Range header field is not given `undefined` is returned, `-1` when unsatisfiable, + * and `-2` when syntactically invalid. + * + * When ranges are returned, the array has a "type" property which is the type of + * range that is required (most commonly, "bytes"). Each array element is an object + * with a "start" and "end" property for the portion of the range. + * + * The "combine" option can be set to `true` and overlapping & adjacent ranges + * will be combined into a single range. + * + * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" + * should respond with 4 users when available, not 3. + * + * @param {number} size + * @param {object} [options] + * @param {boolean} [options.combine=false] + * @return {number|array} + * @public + */ + +req.range = function range(size, options) { + var range = this.get('Range'); + if (!range) return; + return parseRange(size, range, options); +}; + +/** + * Parse the query string of `req.url`. + * + * This uses the "query parser" setting to parse the raw + * string into an object. + * + * @return {String} + * @api public + */ + +defineGetter(req, 'query', function query(){ + var queryparse = this.app.get('query parser fn'); + + if (!queryparse) { + // parsing is disabled + return Object.create(null); + } + + var querystring = parse(this).query; + + return queryparse(querystring); +}); + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains the given mime `type`. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * req.is('html'); + * req.is('text/html'); + * req.is('text/*'); + * // => true + * + * // When Content-Type is application/json + * req.is('json'); + * req.is('application/json'); + * req.is('application/*'); + * // => true + * + * req.is('html'); + * // => false + * + * @param {String|Array} types... + * @return {String|false|null} + * @public + */ + +req.is = function is(types) { + var arr = types; + + // support flattened arguments + if (!Array.isArray(types)) { + arr = new Array(arguments.length); + for (var i = 0; i < arr.length; i++) { + arr[i] = arguments[i]; + } + } + + return typeis(this, arr); +}; + +/** + * Return the protocol string "http" or "https" + * when requested with TLS. When the "trust proxy" + * setting trusts the socket address, the + * "X-Forwarded-Proto" header field will be trusted + * and used if present. + * + * If you're running behind a reverse proxy that + * supplies https for you this may be enabled. + * + * @return {String} + * @public + */ + +defineGetter(req, 'protocol', function protocol(){ + var proto = this.connection.encrypted + ? 'https' + : 'http'; + var trust = this.app.get('trust proxy fn'); + + if (!trust(this.connection.remoteAddress, 0)) { + return proto; + } + + // Note: X-Forwarded-Proto is normally only ever a + // single value, but this is to be safe. + var header = this.get('X-Forwarded-Proto') || proto + var index = header.indexOf(',') + + return index !== -1 + ? header.substring(0, index).trim() + : header.trim() +}); + +/** + * Short-hand for: + * + * req.protocol === 'https' + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'secure', function secure(){ + return this.protocol === 'https'; +}); + +/** + * Return the remote address from the trusted proxy. + * + * The is the remote address on the socket unless + * "trust proxy" is set. + * + * @return {String} + * @public + */ + +defineGetter(req, 'ip', function ip(){ + var trust = this.app.get('trust proxy fn'); + return proxyaddr(this, trust); +}); + +/** + * When "trust proxy" is set, trusted proxy addresses + client. + * + * For example if the value were "client, proxy1, proxy2" + * you would receive the array `["client", "proxy1", "proxy2"]` + * where "proxy2" is the furthest down-stream and "proxy1" and + * "proxy2" were trusted. + * + * @return {Array} + * @public + */ + +defineGetter(req, 'ips', function ips() { + var trust = this.app.get('trust proxy fn'); + var addrs = proxyaddr.all(this, trust); + + // reverse the order (to farthest -> closest) + // and remove socket address + addrs.reverse().pop() + + return addrs +}); + +/** + * Return subdomains as an array. + * + * Subdomains are the dot-separated parts of the host before the main domain of + * the app. By default, the domain of the app is assumed to be the last two + * parts of the host. This can be changed by setting "subdomain offset". + * + * For example, if the domain is "tobi.ferrets.example.com": + * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`. + * If "subdomain offset" is 3, req.subdomains is `["tobi"]`. + * + * @return {Array} + * @public + */ + +defineGetter(req, 'subdomains', function subdomains() { + var hostname = this.hostname; + + if (!hostname) return []; + + var offset = this.app.get('subdomain offset'); + var subdomains = !isIP(hostname) + ? hostname.split('.').reverse() + : [hostname]; + + return subdomains.slice(offset); +}); + +/** + * Short-hand for `url.parse(req.url).pathname`. + * + * @return {String} + * @public + */ + +defineGetter(req, 'path', function path() { + return parse(this).pathname; +}); + +/** + * Parse the "Host" header field to a host. + * + * When the "trust proxy" setting trusts the socket + * address, the "X-Forwarded-Host" header field will + * be trusted. + * + * @return {String} + * @public + */ + +defineGetter(req, 'host', function host(){ + var trust = this.app.get('trust proxy fn'); + var val = this.get('X-Forwarded-Host'); + + if (!val || !trust(this.connection.remoteAddress, 0)) { + val = this.get('Host'); + } else if (val.indexOf(',') !== -1) { + // Note: X-Forwarded-Host is normally only ever a + // single value, but this is to be safe. + val = val.substring(0, val.indexOf(',')).trimRight() + } + + return val || undefined; +}); + +/** + * Parse the "Host" header field to a hostname. + * + * When the "trust proxy" setting trusts the socket + * address, the "X-Forwarded-Host" header field will + * be trusted. + * + * @return {String} + * @api public + */ + +defineGetter(req, 'hostname', function hostname(){ + var host = this.host; + + if (!host) return; + + // IPv6 literal support + var offset = host[0] === '[' + ? host.indexOf(']') + 1 + : 0; + var index = host.indexOf(':', offset); + + return index !== -1 + ? host.substring(0, index) + : host; +}); + +/** + * Check if the request is fresh, aka + * Last-Modified or the ETag + * still match. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'fresh', function(){ + var method = this.method; + var res = this.res + var status = res.statusCode + + // GET or HEAD for weak freshness validation only + if ('GET' !== method && 'HEAD' !== method) return false; + + // 2xx or 304 as per rfc2616 14.26 + if ((status >= 200 && status < 300) || 304 === status) { + return fresh(this.headers, { + 'etag': res.get('ETag'), + 'last-modified': res.get('Last-Modified') + }) + } + + return false; +}); + +/** + * Check if the request is stale, aka + * "Last-Modified" and / or the "ETag" for the + * resource has changed. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'stale', function stale(){ + return !this.fresh; +}); + +/** + * Check if the request was an _XMLHttpRequest_. + * + * @return {Boolean} + * @public + */ + +defineGetter(req, 'xhr', function xhr(){ + var val = this.get('X-Requested-With') || ''; + return val.toLowerCase() === 'xmlhttprequest'; +}); + +/** + * Helper function for creating a getter on an object. + * + * @param {Object} obj + * @param {String} name + * @param {Function} getter + * @private + */ +function defineGetter(obj, name, getter) { + Object.defineProperty(obj, name, { + configurable: true, + enumerable: true, + get: getter + }); +} diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js new file mode 100644 index 0000000..9362d0e --- /dev/null +++ b/node_modules/express/lib/response.js @@ -0,0 +1,1039 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var contentDisposition = require('content-disposition'); +var createError = require('http-errors') +var encodeUrl = require('encodeurl'); +var escapeHtml = require('escape-html'); +var http = require('node:http'); +var onFinished = require('on-finished'); +var mime = require('mime-types') +var path = require('node:path'); +var pathIsAbsolute = require('node:path').isAbsolute; +var statuses = require('statuses') +var sign = require('cookie-signature').sign; +var normalizeType = require('./utils').normalizeType; +var normalizeTypes = require('./utils').normalizeTypes; +var setCharset = require('./utils').setCharset; +var cookie = require('cookie'); +var send = require('send'); +var extname = path.extname; +var resolve = path.resolve; +var vary = require('vary'); + +/** + * Response prototype. + * @public + */ + +var res = Object.create(http.ServerResponse.prototype) + +/** + * Module exports. + * @public + */ + +module.exports = res + +/** + * Set the HTTP status code for the response. + * + * Expects an integer value between 100 and 999 inclusive. + * Throws an error if the provided status code is not an integer or if it's outside the allowable range. + * + * @param {number} code - The HTTP status code to set. + * @return {ServerResponse} - Returns itself for chaining methods. + * @throws {TypeError} If `code` is not an integer. + * @throws {RangeError} If `code` is outside the range 100 to 999. + * @public + */ + +res.status = function status(code) { + // Check if the status code is not an integer + if (!Number.isInteger(code)) { + throw new TypeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be an integer.`); + } + // Check if the status code is outside of Node's valid range + if (code < 100 || code > 999) { + throw new RangeError(`Invalid status code: ${JSON.stringify(code)}. Status code must be greater than 99 and less than 1000.`); + } + + this.statusCode = code; + return this; +}; + +/** + * Set Link header field with the given `links`. + * + * Examples: + * + * res.links({ + * next: 'http://api.example.com/users?page=2', + * last: 'http://api.example.com/users?page=5', + * pages: [ + * 'http://api.example.com/users?page=1', + * 'http://api.example.com/users?page=2' + * ] + * }); + * + * @param {Object} links + * @return {ServerResponse} + * @public + */ + +res.links = function(links) { + var link = this.get('Link') || ''; + if (link) link += ', '; + return this.set('Link', link + Object.keys(links).map(function(rel) { + // Allow multiple links if links[rel] is an array + if (Array.isArray(links[rel])) { + return links[rel].map(function (singleLink) { + return `<${singleLink}>; rel="${rel}"`; + }).join(', '); + } else { + return `<${links[rel]}>; rel="${rel}"`; + } + }).join(', ')); +}; + +/** + * Send a response. + * + * Examples: + * + * res.send(Buffer.from('wahoo')); + * res.send({ some: 'json' }); + * res.send('

some html

'); + * + * @param {string|number|boolean|object|Buffer} body + * @public + */ + +res.send = function send(body) { + var chunk = body; + var encoding; + var req = this.req; + var type; + + // settings + var app = this.app; + + switch (typeof chunk) { + // string defaulting to html + case 'string': + if (!this.get('Content-Type')) { + this.type('html'); + } + break; + case 'boolean': + case 'number': + case 'object': + if (chunk === null) { + chunk = ''; + } else if (ArrayBuffer.isView(chunk)) { + if (!this.get('Content-Type')) { + this.type('bin'); + } + } else { + return this.json(chunk); + } + break; + } + + // write strings in utf-8 + if (typeof chunk === 'string') { + encoding = 'utf8'; + type = this.get('Content-Type'); + + // reflect this in content-type + if (typeof type === 'string') { + this.set('Content-Type', setCharset(type, 'utf-8')); + } + } + + // determine if ETag should be generated + var etagFn = app.get('etag fn') + var generateETag = !this.get('ETag') && typeof etagFn === 'function' + + // populate Content-Length + var len + if (chunk !== undefined) { + if (Buffer.isBuffer(chunk)) { + // get length of Buffer + len = chunk.length + } else if (!generateETag && chunk.length < 1000) { + // just calculate length when no ETag + small chunk + len = Buffer.byteLength(chunk, encoding) + } else { + // convert chunk to Buffer and calculate + chunk = Buffer.from(chunk, encoding) + encoding = undefined; + len = chunk.length + } + + this.set('Content-Length', len); + } + + // populate ETag + var etag; + if (generateETag && len !== undefined) { + if ((etag = etagFn(chunk, encoding))) { + this.set('ETag', etag); + } + } + + // freshness + if (req.fresh) this.status(304); + + // strip irrelevant headers + if (204 === this.statusCode || 304 === this.statusCode) { + this.removeHeader('Content-Type'); + this.removeHeader('Content-Length'); + this.removeHeader('Transfer-Encoding'); + chunk = ''; + } + + // alter headers for 205 + if (this.statusCode === 205) { + this.set('Content-Length', '0') + this.removeHeader('Transfer-Encoding') + chunk = '' + } + + if (req.method === 'HEAD') { + // skip body for HEAD + this.end(); + } else { + // respond + this.end(chunk, encoding); + } + + return this; +}; + +/** + * Send JSON response. + * + * Examples: + * + * res.json(null); + * res.json({ user: 'tj' }); + * + * @param {string|number|boolean|object} obj + * @public + */ + +res.json = function json(obj) { + // settings + var app = this.app; + var escape = app.get('json escape') + var replacer = app.get('json replacer'); + var spaces = app.get('json spaces'); + var body = stringify(obj, replacer, spaces, escape) + + // content-type + if (!this.get('Content-Type')) { + this.set('Content-Type', 'application/json'); + } + + return this.send(body); +}; + +/** + * Send JSON response with JSONP callback support. + * + * Examples: + * + * res.jsonp(null); + * res.jsonp({ user: 'tj' }); + * + * @param {string|number|boolean|object} obj + * @public + */ + +res.jsonp = function jsonp(obj) { + // settings + var app = this.app; + var escape = app.get('json escape') + var replacer = app.get('json replacer'); + var spaces = app.get('json spaces'); + var body = stringify(obj, replacer, spaces, escape) + var callback = this.req.query[app.get('jsonp callback name')]; + + // content-type + if (!this.get('Content-Type')) { + this.set('X-Content-Type-Options', 'nosniff'); + this.set('Content-Type', 'application/json'); + } + + // fixup callback + if (Array.isArray(callback)) { + callback = callback[0]; + } + + // jsonp + if (typeof callback === 'string' && callback.length !== 0) { + this.set('X-Content-Type-Options', 'nosniff'); + this.set('Content-Type', 'text/javascript'); + + // restrict callback charset + callback = callback.replace(/[^\[\]\w$.]/g, ''); + + if (body === undefined) { + // empty argument + body = '' + } else if (typeof body === 'string') { + // replace chars not allowed in JavaScript that are in JSON + body = body + .replace(/\u2028/g, '\\u2028') + .replace(/\u2029/g, '\\u2029') + } + + // the /**/ is a specific security mitigation for "Rosetta Flash JSONP abuse" + // the typeof check is just to reduce client error noise + body = '/**/ typeof ' + callback + ' === \'function\' && ' + callback + '(' + body + ');'; + } + + return this.send(body); +}; + +/** + * Send given HTTP status code. + * + * Sets the response status to `statusCode` and the body of the + * response to the standard description from node's http.STATUS_CODES + * or the statusCode number if no description. + * + * Examples: + * + * res.sendStatus(200); + * + * @param {number} statusCode + * @public + */ + +res.sendStatus = function sendStatus(statusCode) { + var body = statuses.message[statusCode] || String(statusCode) + + this.status(statusCode); + this.type('txt'); + + return this.send(body); +}; + +/** + * Transfer the file at the given `path`. + * + * Automatically sets the _Content-Type_ response header field. + * The callback `callback(err)` is invoked when the transfer is complete + * or when an error occurs. Be sure to check `res.headersSent` + * if you wish to attempt responding, as the header and some data + * may have already been transferred. + * + * Options: + * + * - `maxAge` defaulting to 0 (can be string converted by `ms`) + * - `root` root directory for relative filenames + * - `headers` object of headers to serve with file + * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them + * + * Other options are passed along to `send`. + * + * Examples: + * + * The following example illustrates how `res.sendFile()` may + * be used as an alternative for the `static()` middleware for + * dynamic situations. The code backing `res.sendFile()` is actually + * the same code, so HTTP cache support etc is identical. + * + * app.get('/user/:uid/photos/:file', function(req, res){ + * var uid = req.params.uid + * , file = req.params.file; + * + * req.user.mayViewFilesFrom(uid, function(yes){ + * if (yes) { + * res.sendFile('/uploads/' + uid + '/' + file); + * } else { + * res.send(403, 'Sorry! you cant see that.'); + * } + * }); + * }); + * + * @public + */ + +res.sendFile = function sendFile(path, options, callback) { + var done = callback; + var req = this.req; + var res = this; + var next = req.next; + var opts = options || {}; + + if (!path) { + throw new TypeError('path argument is required to res.sendFile'); + } + + if (typeof path !== 'string') { + throw new TypeError('path must be a string to res.sendFile') + } + + // support function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + if (!opts.root && !pathIsAbsolute(path)) { + throw new TypeError('path must be absolute or specify root to res.sendFile'); + } + + // create file stream + var pathname = encodeURI(path); + + // wire application etag option to send + opts.etag = this.app.enabled('etag'); + var file = send(req, pathname, opts); + + // transfer + sendfile(res, file, opts, function (err) { + if (done) return done(err); + if (err && err.code === 'EISDIR') return next(); + + // next() all but write errors + if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') { + next(err); + } + }); +}; + +/** + * Transfer the file at the given `path` as an attachment. + * + * Optionally providing an alternate attachment `filename`, + * and optional callback `callback(err)`. The callback is invoked + * when the data transfer is complete, or when an error has + * occurred. Be sure to check `res.headersSent` if you plan to respond. + * + * Optionally providing an `options` object to use with `res.sendFile()`. + * This function will set the `Content-Disposition` header, overriding + * any `Content-Disposition` header passed as header options in order + * to set the attachment and filename. + * + * This method uses `res.sendFile()`. + * + * @public + */ + +res.download = function download (path, filename, options, callback) { + var done = callback; + var name = filename; + var opts = options || null + + // support function as second or third arg + if (typeof filename === 'function') { + done = filename; + name = null; + opts = null + } else if (typeof options === 'function') { + done = options + opts = null + } + + // support optional filename, where options may be in it's place + if (typeof filename === 'object' && + (typeof options === 'function' || options === undefined)) { + name = null + opts = filename + } + + // set Content-Disposition when file is sent + var headers = { + 'Content-Disposition': contentDisposition(name || path) + }; + + // merge user-provided headers + if (opts && opts.headers) { + var keys = Object.keys(opts.headers) + for (var i = 0; i < keys.length; i++) { + var key = keys[i] + if (key.toLowerCase() !== 'content-disposition') { + headers[key] = opts.headers[key] + } + } + } + + // merge user-provided options + opts = Object.create(opts) + opts.headers = headers + + // Resolve the full path for sendFile + var fullPath = !opts.root + ? resolve(path) + : path + + // send file + return this.sendFile(fullPath, opts, done) +}; + +/** + * Set _Content-Type_ response header with `type` through `mime.contentType()` + * when it does not contain "/", or set the Content-Type to `type` otherwise. + * When no mapping is found though `mime.contentType()`, the type is set to + * "application/octet-stream". + * + * Examples: + * + * res.type('.html'); + * res.type('html'); + * res.type('json'); + * res.type('application/json'); + * res.type('png'); + * + * @param {String} type + * @return {ServerResponse} for chaining + * @public + */ + +res.contentType = +res.type = function contentType(type) { + var ct = type.indexOf('/') === -1 + ? (mime.contentType(type) || 'application/octet-stream') + : type; + + return this.set('Content-Type', ct); +}; + +/** + * Respond to the Acceptable formats using an `obj` + * of mime-type callbacks. + * + * This method uses `req.accepted`, an array of + * acceptable types ordered by their quality values. + * When "Accept" is not present the _first_ callback + * is invoked, otherwise the first match is used. When + * no match is performed the server responds with + * 406 "Not Acceptable". + * + * Content-Type is set for you, however if you choose + * you may alter this within the callback using `res.type()` + * or `res.set('Content-Type', ...)`. + * + * res.format({ + * 'text/plain': function(){ + * res.send('hey'); + * }, + * + * 'text/html': function(){ + * res.send('

hey

'); + * }, + * + * 'application/json': function () { + * res.send({ message: 'hey' }); + * } + * }); + * + * In addition to canonicalized MIME types you may + * also use extnames mapped to these types: + * + * res.format({ + * text: function(){ + * res.send('hey'); + * }, + * + * html: function(){ + * res.send('

hey

'); + * }, + * + * json: function(){ + * res.send({ message: 'hey' }); + * } + * }); + * + * By default Express passes an `Error` + * with a `.status` of 406 to `next(err)` + * if a match is not made. If you provide + * a `.default` callback it will be invoked + * instead. + * + * @param {Object} obj + * @return {ServerResponse} for chaining + * @public + */ + +res.format = function(obj){ + var req = this.req; + var next = req.next; + + var keys = Object.keys(obj) + .filter(function (v) { return v !== 'default' }) + + var key = keys.length > 0 + ? req.accepts(keys) + : false; + + this.vary("Accept"); + + if (key) { + this.set('Content-Type', normalizeType(key).value); + obj[key](req, this, next); + } else if (obj.default) { + obj.default(req, this, next) + } else { + next(createError(406, { + types: normalizeTypes(keys).map(function (o) { return o.value }) + })) + } + + return this; +}; + +/** + * Set _Content-Disposition_ header to _attachment_ with optional `filename`. + * + * @param {String} filename + * @return {ServerResponse} + * @public + */ + +res.attachment = function attachment(filename) { + if (filename) { + this.type(extname(filename)); + } + + this.set('Content-Disposition', contentDisposition(filename)); + + return this; +}; + +/** + * Append additional header `field` with value `val`. + * + * Example: + * + * res.append('Link', ['', '']); + * res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly'); + * res.append('Warning', '199 Miscellaneous warning'); + * + * @param {String} field + * @param {String|Array} val + * @return {ServerResponse} for chaining + * @public + */ + +res.append = function append(field, val) { + var prev = this.get(field); + var value = val; + + if (prev) { + // concat the new and prev vals + value = Array.isArray(prev) ? prev.concat(val) + : Array.isArray(val) ? [prev].concat(val) + : [prev, val] + } + + return this.set(field, value); +}; + +/** + * Set header `field` to `val`, or pass + * an object of header fields. + * + * Examples: + * + * res.set('Foo', ['bar', 'baz']); + * res.set('Accept', 'application/json'); + * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); + * + * Aliased as `res.header()`. + * + * When the set header is "Content-Type", the type is expanded to include + * the charset if not present using `mime.contentType()`. + * + * @param {String|Object} field + * @param {String|Array} val + * @return {ServerResponse} for chaining + * @public + */ + +res.set = +res.header = function header(field, val) { + if (arguments.length === 2) { + var value = Array.isArray(val) + ? val.map(String) + : String(val); + + // add charset to content-type + if (field.toLowerCase() === 'content-type') { + if (Array.isArray(value)) { + throw new TypeError('Content-Type cannot be set to an Array'); + } + value = mime.contentType(value) + } + + this.setHeader(field, value); + } else { + for (var key in field) { + this.set(key, field[key]); + } + } + return this; +}; + +/** + * Get value for header `field`. + * + * @param {String} field + * @return {String} + * @public + */ + +res.get = function(field){ + return this.getHeader(field); +}; + +/** + * Clear cookie `name`. + * + * @param {String} name + * @param {Object} [options] + * @return {ServerResponse} for chaining + * @public + */ + +res.clearCookie = function clearCookie(name, options) { + // Force cookie expiration by setting expires to the past + const opts = { path: '/', ...options, expires: new Date(1)}; + // ensure maxAge is not passed + delete opts.maxAge + + return this.cookie(name, '', opts); +}; + +/** + * Set cookie `name` to `value`, with the given `options`. + * + * Options: + * + * - `maxAge` max-age in milliseconds, converted to `expires` + * - `signed` sign the cookie + * - `path` defaults to "/" + * + * Examples: + * + * // "Remember Me" for 15 minutes + * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); + * + * // same as above + * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) + * + * @param {String} name + * @param {String|Object} value + * @param {Object} [options] + * @return {ServerResponse} for chaining + * @public + */ + +res.cookie = function (name, value, options) { + var opts = { ...options }; + var secret = this.req.secret; + var signed = opts.signed; + + if (signed && !secret) { + throw new Error('cookieParser("secret") required for signed cookies'); + } + + var val = typeof value === 'object' + ? 'j:' + JSON.stringify(value) + : String(value); + + if (signed) { + val = 's:' + sign(val, secret); + } + + if (opts.maxAge != null) { + var maxAge = opts.maxAge - 0 + + if (!isNaN(maxAge)) { + opts.expires = new Date(Date.now() + maxAge) + opts.maxAge = Math.floor(maxAge / 1000) + } + } + + if (opts.path == null) { + opts.path = '/'; + } + + this.append('Set-Cookie', cookie.serialize(name, String(val), opts)); + + return this; +}; + +/** + * Set the location header to `url`. + * + * The given `url` can also be "back", which redirects + * to the _Referrer_ or _Referer_ headers or "/". + * + * Examples: + * + * res.location('/foo/bar').; + * res.location('http://example.com'); + * res.location('../login'); + * + * @param {String} url + * @return {ServerResponse} for chaining + * @public + */ + +res.location = function location(url) { + return this.set('Location', encodeUrl(url)); +}; + +/** + * Redirect to the given `url` with optional response `status` + * defaulting to 302. + * + * Examples: + * + * res.redirect('/foo/bar'); + * res.redirect('http://example.com'); + * res.redirect(301, 'http://example.com'); + * res.redirect('../login'); // /blog/post/1 -> /blog/login + * + * @public + */ + +res.redirect = function redirect(url) { + var address = url; + var body; + var status = 302; + + // allow status / url + if (arguments.length === 2) { + status = arguments[0] + address = arguments[1] + } + + // Set location header + address = this.location(address).get('Location'); + + // Support text/{plain,html} by default + this.format({ + text: function(){ + body = statuses.message[status] + '. Redirecting to ' + address + }, + + html: function(){ + var u = escapeHtml(address); + body = '

' + statuses.message[status] + '. Redirecting to ' + u + '

' + }, + + default: function(){ + body = ''; + } + }); + + // Respond + this.status(status); + this.set('Content-Length', Buffer.byteLength(body)); + + if (this.req.method === 'HEAD') { + this.end(); + } else { + this.end(body); + } +}; + +/** + * Add `field` to Vary. If already present in the Vary set, then + * this call is simply ignored. + * + * @param {Array|String} field + * @return {ServerResponse} for chaining + * @public + */ + +res.vary = function(field){ + vary(this, field); + + return this; +}; + +/** + * Render `view` with the given `options` and optional callback `fn`. + * When a callback function is given a response will _not_ be made + * automatically, otherwise a response of _200_ and _text/html_ is given. + * + * Options: + * + * - `cache` boolean hinting to the engine it should cache + * - `filename` filename of the view being rendered + * + * @public + */ + +res.render = function render(view, options, callback) { + var app = this.req.app; + var done = callback; + var opts = options || {}; + var req = this.req; + var self = this; + + // support callback function as second arg + if (typeof options === 'function') { + done = options; + opts = {}; + } + + // merge res.locals + opts._locals = self.locals; + + // default callback to respond + done = done || function (err, str) { + if (err) return req.next(err); + self.send(str); + }; + + // render + app.render(view, opts, done); +}; + +// pipe the send file stream +function sendfile(res, file, options, callback) { + var done = false; + var streaming; + + // request aborted + function onaborted() { + if (done) return; + done = true; + + var err = new Error('Request aborted'); + err.code = 'ECONNABORTED'; + callback(err); + } + + // directory + function ondirectory() { + if (done) return; + done = true; + + var err = new Error('EISDIR, read'); + err.code = 'EISDIR'; + callback(err); + } + + // errors + function onerror(err) { + if (done) return; + done = true; + callback(err); + } + + // ended + function onend() { + if (done) return; + done = true; + callback(); + } + + // file + function onfile() { + streaming = false; + } + + // finished + function onfinish(err) { + if (err && err.code === 'ECONNRESET') return onaborted(); + if (err) return onerror(err); + if (done) return; + + setImmediate(function () { + if (streaming !== false && !done) { + onaborted(); + return; + } + + if (done) return; + done = true; + callback(); + }); + } + + // streaming + function onstream() { + streaming = true; + } + + file.on('directory', ondirectory); + file.on('end', onend); + file.on('error', onerror); + file.on('file', onfile); + file.on('stream', onstream); + onFinished(res, onfinish); + + if (options.headers) { + // set headers on successful transfer + file.on('headers', function headers(res) { + var obj = options.headers; + var keys = Object.keys(obj); + + for (var i = 0; i < keys.length; i++) { + var k = keys[i]; + res.setHeader(k, obj[k]); + } + }); + } + + // pipe + file.pipe(res); +} + +/** + * Stringify JSON, like JSON.stringify, but v8 optimized, with the + * ability to escape characters that can trigger HTML sniffing. + * + * @param {*} value + * @param {function} replacer + * @param {number} spaces + * @param {boolean} escape + * @returns {string} + * @private + */ + +function stringify (value, replacer, spaces, escape) { + // v8 checks arguments.length for optimizing simple call + // https://bugs.chromium.org/p/v8/issues/detail?id=4730 + var json = replacer || spaces + ? JSON.stringify(value, replacer, spaces) + : JSON.stringify(value); + + if (escape && typeof json === 'string') { + json = json.replace(/[<>&]/g, function (c) { + switch (c.charCodeAt(0)) { + case 0x3c: + return '\\u003c' + case 0x3e: + return '\\u003e' + case 0x26: + return '\\u0026' + /* istanbul ignore next: unreachable default */ + default: + return c + } + }) + } + + return json +} diff --git a/node_modules/express/lib/utils.js b/node_modules/express/lib/utils.js new file mode 100644 index 0000000..d53c5a1 --- /dev/null +++ b/node_modules/express/lib/utils.js @@ -0,0 +1,269 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @api private + */ + +var { METHODS } = require('node:http'); +var contentType = require('content-type'); +var etag = require('etag'); +var mime = require('mime-types') +var proxyaddr = require('proxy-addr'); +var qs = require('qs'); +var querystring = require('querystring'); + +/** + * A list of lowercased HTTP methods that are supported by Node.js. + * @api private + */ +exports.methods = METHODS.map((method) => method.toLowerCase()); + +/** + * Return strong ETag for `body`. + * + * @param {String|Buffer} body + * @param {String} [encoding] + * @return {String} + * @api private + */ + +exports.etag = createETagGenerator({ weak: false }) + +/** + * Return weak ETag for `body`. + * + * @param {String|Buffer} body + * @param {String} [encoding] + * @return {String} + * @api private + */ + +exports.wetag = createETagGenerator({ weak: true }) + +/** + * Normalize the given `type`, for example "html" becomes "text/html". + * + * @param {String} type + * @return {Object} + * @api private + */ + +exports.normalizeType = function(type){ + return ~type.indexOf('/') + ? acceptParams(type) + : { value: (mime.lookup(type) || 'application/octet-stream'), params: {} } +}; + +/** + * Normalize `types`, for example "html" becomes "text/html". + * + * @param {Array} types + * @return {Array} + * @api private + */ + +exports.normalizeTypes = function(types) { + return types.map(exports.normalizeType); +}; + + +/** + * Parse accept params `str` returning an + * object with `.value`, `.quality` and `.params`. + * + * @param {String} str + * @return {Object} + * @api private + */ + +function acceptParams (str) { + var length = str.length; + var colonIndex = str.indexOf(';'); + var index = colonIndex === -1 ? length : colonIndex; + var ret = { value: str.slice(0, index).trim(), quality: 1, params: {} }; + + while (index < length) { + var splitIndex = str.indexOf('=', index); + if (splitIndex === -1) break; + + var colonIndex = str.indexOf(';', index); + var endIndex = colonIndex === -1 ? length : colonIndex; + + if (splitIndex > endIndex) { + index = str.lastIndexOf(';', splitIndex - 1) + 1; + continue; + } + + var key = str.slice(index, splitIndex).trim(); + var value = str.slice(splitIndex + 1, endIndex).trim(); + + if (key === 'q') { + ret.quality = parseFloat(value); + } else { + ret.params[key] = value; + } + + index = endIndex + 1; + } + + return ret; +} + +/** + * Compile "etag" value to function. + * + * @param {Boolean|String|Function} val + * @return {Function} + * @api private + */ + +exports.compileETag = function(val) { + var fn; + + if (typeof val === 'function') { + return val; + } + + switch (val) { + case true: + case 'weak': + fn = exports.wetag; + break; + case false: + break; + case 'strong': + fn = exports.etag; + break; + default: + throw new TypeError('unknown value for etag function: ' + val); + } + + return fn; +} + +/** + * Compile "query parser" value to function. + * + * @param {String|Function} val + * @return {Function} + * @api private + */ + +exports.compileQueryParser = function compileQueryParser(val) { + var fn; + + if (typeof val === 'function') { + return val; + } + + switch (val) { + case true: + case 'simple': + fn = querystring.parse; + break; + case false: + break; + case 'extended': + fn = parseExtendedQueryString; + break; + default: + throw new TypeError('unknown value for query parser function: ' + val); + } + + return fn; +} + +/** + * Compile "proxy trust" value to function. + * + * @param {Boolean|String|Number|Array|Function} val + * @return {Function} + * @api private + */ + +exports.compileTrust = function(val) { + if (typeof val === 'function') return val; + + if (val === true) { + // Support plain true/false + return function(){ return true }; + } + + if (typeof val === 'number') { + // Support trusting hop count + return function(a, i){ return i < val }; + } + + if (typeof val === 'string') { + // Support comma-separated values + val = val.split(',') + .map(function (v) { return v.trim() }) + } + + return proxyaddr.compile(val || []); +} + +/** + * Set the charset in a given Content-Type string. + * + * @param {String} type + * @param {String} charset + * @return {String} + * @api private + */ + +exports.setCharset = function setCharset(type, charset) { + if (!type || !charset) { + return type; + } + + // parse type + var parsed = contentType.parse(type); + + // set charset + parsed.parameters.charset = charset; + + // format type + return contentType.format(parsed); +}; + +/** + * Create an ETag generator function, generating ETags with + * the given options. + * + * @param {object} options + * @return {function} + * @private + */ + +function createETagGenerator (options) { + return function generateETag (body, encoding) { + var buf = !Buffer.isBuffer(body) + ? Buffer.from(body, encoding) + : body + + return etag(buf, options) + } +} + +/** + * Parse an extended query string with qs. + * + * @param {String} str + * @return {Object} + * @private + */ + +function parseExtendedQueryString(str) { + return qs.parse(str, { + allowPrototypes: true + }); +} diff --git a/node_modules/express/lib/view.js b/node_modules/express/lib/view.js new file mode 100644 index 0000000..d66b4a2 --- /dev/null +++ b/node_modules/express/lib/view.js @@ -0,0 +1,205 @@ +/*! + * express + * Copyright(c) 2009-2013 TJ Holowaychuk + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('express:view'); +var path = require('node:path'); +var fs = require('node:fs'); + +/** + * Module variables. + * @private + */ + +var dirname = path.dirname; +var basename = path.basename; +var extname = path.extname; +var join = path.join; +var resolve = path.resolve; + +/** + * Module exports. + * @public + */ + +module.exports = View; + +/** + * Initialize a new `View` with the given `name`. + * + * Options: + * + * - `defaultEngine` the default template engine name + * - `engines` template engine require() cache + * - `root` root path for view lookup + * + * @param {string} name + * @param {object} options + * @public + */ + +function View(name, options) { + var opts = options || {}; + + this.defaultEngine = opts.defaultEngine; + this.ext = extname(name); + this.name = name; + this.root = opts.root; + + if (!this.ext && !this.defaultEngine) { + throw new Error('No default engine was specified and no extension was provided.'); + } + + var fileName = name; + + if (!this.ext) { + // get extension from default engine name + this.ext = this.defaultEngine[0] !== '.' + ? '.' + this.defaultEngine + : this.defaultEngine; + + fileName += this.ext; + } + + if (!opts.engines[this.ext]) { + // load engine + var mod = this.ext.slice(1) + debug('require "%s"', mod) + + // default engine export + var fn = require(mod).__express + + if (typeof fn !== 'function') { + throw new Error('Module "' + mod + '" does not provide a view engine.') + } + + opts.engines[this.ext] = fn + } + + // store loaded engine + this.engine = opts.engines[this.ext]; + + // lookup path + this.path = this.lookup(fileName); +} + +/** + * Lookup view by the given `name` + * + * @param {string} name + * @private + */ + +View.prototype.lookup = function lookup(name) { + var path; + var roots = [].concat(this.root); + + debug('lookup "%s"', name); + + for (var i = 0; i < roots.length && !path; i++) { + var root = roots[i]; + + // resolve the path + var loc = resolve(root, name); + var dir = dirname(loc); + var file = basename(loc); + + // resolve the file + path = this.resolve(dir, file); + } + + return path; +}; + +/** + * Render with the given options. + * + * @param {object} options + * @param {function} callback + * @private + */ + +View.prototype.render = function render(options, callback) { + var sync = true; + + debug('render "%s"', this.path); + + // render, normalizing sync callbacks + this.engine(this.path, options, function onRender() { + if (!sync) { + return callback.apply(this, arguments); + } + + // copy arguments + var args = new Array(arguments.length); + var cntx = this; + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + // force callback to be async + return process.nextTick(function renderTick() { + return callback.apply(cntx, args); + }); + }); + + sync = false; +}; + +/** + * Resolve the file within the given directory. + * + * @param {string} dir + * @param {string} file + * @private + */ + +View.prototype.resolve = function resolve(dir, file) { + var ext = this.ext; + + // . + var path = join(dir, file); + var stat = tryStat(path); + + if (stat && stat.isFile()) { + return path; + } + + // /index. + path = join(dir, basename(file, ext), 'index' + ext); + stat = tryStat(path); + + if (stat && stat.isFile()) { + return path; + } +}; + +/** + * Return a stat, maybe. + * + * @param {string} path + * @return {fs.Stats} + * @private + */ + +function tryStat(path) { + debug('stat "%s"', path); + + try { + return fs.statSync(path); + } catch (e) { + return undefined; + } +} diff --git a/node_modules/express/package.json b/node_modules/express/package.json new file mode 100644 index 0000000..bdcd25e --- /dev/null +++ b/node_modules/express/package.json @@ -0,0 +1,98 @@ +{ + "name": "express", + "description": "Fast, unopinionated, minimalist web framework", + "version": "5.1.0", + "author": "TJ Holowaychuk ", + "contributors": [ + "Aaron Heckmann ", + "Ciaran Jessup ", + "Douglas Christopher Wilson ", + "Guillermo Rauch ", + "Jonathan Ong ", + "Roman Shtylman ", + "Young Jae Sim " + ], + "license": "MIT", + "repository": "expressjs/express", + "homepage": "https://expressjs.com/", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "keywords": [ + "express", + "framework", + "sinatra", + "web", + "http", + "rest", + "restful", + "router", + "app", + "api" + ], + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "devDependencies": { + "after": "0.8.2", + "connect-redis": "^8.0.1", + "cookie-parser": "1.4.7", + "cookie-session": "2.1.0", + "ejs": "^3.1.10", + "eslint": "8.47.0", + "express-session": "^1.18.1", + "hbs": "4.2.0", + "marked": "^15.0.3", + "method-override": "3.0.0", + "mocha": "^10.7.3", + "morgan": "1.10.0", + "nyc": "^17.1.0", + "pbkdf2-password": "1.2.1", + "supertest": "^6.3.0", + "vhost": "~3.0.2" + }, + "engines": { + "node": ">= 18" + }, + "files": [ + "LICENSE", + "History.md", + "Readme.md", + "index.js", + "lib/" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/", + "test-ci": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --exclude examples --exclude test --exclude benchmarks --reporter=html --reporter=text npm test", + "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/" + } +} diff --git a/node_modules/extend-shallow/LICENSE b/node_modules/extend-shallow/LICENSE new file mode 100644 index 0000000..fa30c4c --- /dev/null +++ b/node_modules/extend-shallow/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/extend-shallow/README.md b/node_modules/extend-shallow/README.md new file mode 100644 index 0000000..cdc45d4 --- /dev/null +++ b/node_modules/extend-shallow/README.md @@ -0,0 +1,61 @@ +# extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow) + +> Extend an object with the properties of additional objects. node.js/javascript util. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i extend-shallow --save +``` + +## Usage + +```js +var extend = require('extend-shallow'); + +extend({a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +Pass an empty object to shallow clone: + +```js +var obj = {}; +extend(obj, {a: 'b'}, {c: 'd'}) +//=> {a: 'b', c: 'd'} +``` + +## Related + +* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. +* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) +* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in) +* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor. +* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null. +* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value. + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._ \ No newline at end of file diff --git a/node_modules/extend-shallow/index.js b/node_modules/extend-shallow/index.js new file mode 100644 index 0000000..92a067f --- /dev/null +++ b/node_modules/extend-shallow/index.js @@ -0,0 +1,33 @@ +'use strict'; + +var isObject = require('is-extendable'); + +module.exports = function extend(o/*, objects*/) { + if (!isObject(o)) { o = {}; } + + var len = arguments.length; + for (var i = 1; i < len; i++) { + var obj = arguments[i]; + + if (isObject(obj)) { + assign(o, obj); + } + } + return o; +}; + +function assign(a, b) { + for (var key in b) { + if (hasOwn(b, key)) { + a[key] = b[key]; + } + } +} + +/** + * Returns true if the given `key` is an own property of `obj`. + */ + +function hasOwn(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} diff --git a/node_modules/extend-shallow/package.json b/node_modules/extend-shallow/package.json new file mode 100644 index 0000000..b42e01c --- /dev/null +++ b/node_modules/extend-shallow/package.json @@ -0,0 +1,56 @@ +{ + "name": "extend-shallow", + "description": "Extend an object with the properties of additional objects. node.js/javascript util.", + "version": "2.0.1", + "homepage": "https://github.com/jonschlinkert/extend-shallow", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/extend-shallow", + "bugs": { + "url": "https://github.com/jonschlinkert/extend-shallow/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "devDependencies": { + "array-slice": "^0.2.3", + "benchmarked": "^0.1.4", + "chalk": "^1.0.0", + "for-own": "^0.1.3", + "glob": "^5.0.12", + "is-plain-object": "^2.0.1", + "kind-of": "^2.0.0", + "minimist": "^1.1.1", + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "keywords": [ + "assign", + "extend", + "javascript", + "js", + "keys", + "merge", + "obj", + "object", + "prop", + "properties", + "property", + "props", + "shallow", + "util", + "utility", + "utils", + "value" + ] +} \ No newline at end of file diff --git a/node_modules/fast-safe-stringify/.travis.yml b/node_modules/fast-safe-stringify/.travis.yml new file mode 100644 index 0000000..2b06d25 --- /dev/null +++ b/node_modules/fast-safe-stringify/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +sudo: false +node_js: +- '4' +- '6' +- '8' +- '9' +- '10' diff --git a/node_modules/fast-safe-stringify/CHANGELOG.md b/node_modules/fast-safe-stringify/CHANGELOG.md new file mode 100644 index 0000000..55f2d08 --- /dev/null +++ b/node_modules/fast-safe-stringify/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +## v.2.0.0 + +Features + +- Added stable-stringify (see documentation) +- Support replacer +- Support spacer +- toJSON support without forceDecirc property +- Improved performance + +Breaking changes + +- Manipulating the input value in a `toJSON` function is not possible anymore in + all cases (see documentation) +- Dropped support for e.g. IE8 and Node.js < 4 diff --git a/node_modules/fast-safe-stringify/LICENSE b/node_modules/fast-safe-stringify/LICENSE new file mode 100644 index 0000000..d310c2d --- /dev/null +++ b/node_modules/fast-safe-stringify/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2016 David Mark Clements +Copyright (c) 2017 David Mark Clements & Matteo Collina +Copyright (c) 2018 David Mark Clements, Matteo Collina & Ruben Bridgewater + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/fast-safe-stringify/benchmark.js b/node_modules/fast-safe-stringify/benchmark.js new file mode 100644 index 0000000..7ba5e9f --- /dev/null +++ b/node_modules/fast-safe-stringify/benchmark.js @@ -0,0 +1,137 @@ +const Benchmark = require('benchmark') +const suite = new Benchmark.Suite() +const { inspect } = require('util') +const jsonStringifySafe = require('json-stringify-safe') +const fastSafeStringify = require('./') + +const array = new Array(10).fill(0).map((_, i) => i) +const obj = { foo: array } +const circ = JSON.parse(JSON.stringify(obj)) +circ.o = { obj: circ, array } +const circGetters = JSON.parse(JSON.stringify(obj)) +Object.assign(circGetters, { get o () { return { obj: circGetters, array } } }) + +const deep = require('./package.json') +deep.deep = JSON.parse(JSON.stringify(deep)) +deep.deep.deep = JSON.parse(JSON.stringify(deep)) +deep.deep.deep.deep = JSON.parse(JSON.stringify(deep)) +deep.array = array + +const deepCirc = JSON.parse(JSON.stringify(deep)) +deepCirc.deep.deep.deep.circ = deepCirc +deepCirc.deep.deep.circ = deepCirc +deepCirc.deep.circ = deepCirc +deepCirc.array = array + +const deepCircGetters = JSON.parse(JSON.stringify(deep)) +for (let i = 0; i < 10; i++) { + deepCircGetters[i.toString()] = { + deep: { + deep: { + get circ () { return deep.deep }, + deep: { get circ () { return deep.deep.deep } } + }, + get circ () { return deep } + }, + get array () { return array } + } +} + +const deepCircNonCongifurableGetters = JSON.parse(JSON.stringify(deep)) +Object.defineProperty(deepCircNonCongifurableGetters.deep.deep.deep, 'circ', { + get: () => deepCircNonCongifurableGetters, + enumerable: true, + configurable: false +}) +Object.defineProperty(deepCircNonCongifurableGetters.deep.deep, 'circ', { + get: () => deepCircNonCongifurableGetters, + enumerable: true, + configurable: false +}) +Object.defineProperty(deepCircNonCongifurableGetters.deep, 'circ', { + get: () => deepCircNonCongifurableGetters, + enumerable: true, + configurable: false +}) +Object.defineProperty(deepCircNonCongifurableGetters, 'array', { + get: () => array, + enumerable: true, + configurable: false +}) + +suite.add('util.inspect: simple object ', function () { + inspect(obj, { showHidden: false, depth: null }) +}) +suite.add('util.inspect: circular ', function () { + inspect(circ, { showHidden: false, depth: null }) +}) +suite.add('util.inspect: circular getters ', function () { + inspect(circGetters, { showHidden: false, depth: null }) +}) +suite.add('util.inspect: deep ', function () { + inspect(deep, { showHidden: false, depth: null }) +}) +suite.add('util.inspect: deep circular ', function () { + inspect(deepCirc, { showHidden: false, depth: null }) +}) +suite.add('util.inspect: large deep circular getters ', function () { + inspect(deepCircGetters, { showHidden: false, depth: null }) +}) +suite.add('util.inspect: deep non-conf circular getters', function () { + inspect(deepCircNonCongifurableGetters, { showHidden: false, depth: null }) +}) + +suite.add('\njson-stringify-safe: simple object ', function () { + jsonStringifySafe(obj) +}) +suite.add('json-stringify-safe: circular ', function () { + jsonStringifySafe(circ) +}) +suite.add('json-stringify-safe: circular getters ', function () { + jsonStringifySafe(circGetters) +}) +suite.add('json-stringify-safe: deep ', function () { + jsonStringifySafe(deep) +}) +suite.add('json-stringify-safe: deep circular ', function () { + jsonStringifySafe(deepCirc) +}) +suite.add('json-stringify-safe: large deep circular getters ', function () { + jsonStringifySafe(deepCircGetters) +}) +suite.add('json-stringify-safe: deep non-conf circular getters', function () { + jsonStringifySafe(deepCircNonCongifurableGetters) +}) + +suite.add('\nfast-safe-stringify: simple object ', function () { + fastSafeStringify(obj) +}) +suite.add('fast-safe-stringify: circular ', function () { + fastSafeStringify(circ) +}) +suite.add('fast-safe-stringify: circular getters ', function () { + fastSafeStringify(circGetters) +}) +suite.add('fast-safe-stringify: deep ', function () { + fastSafeStringify(deep) +}) +suite.add('fast-safe-stringify: deep circular ', function () { + fastSafeStringify(deepCirc) +}) +suite.add('fast-safe-stringify: large deep circular getters ', function () { + fastSafeStringify(deepCircGetters) +}) +suite.add('fast-safe-stringify: deep non-conf circular getters', function () { + fastSafeStringify(deepCircNonCongifurableGetters) +}) + +// add listeners +suite.on('cycle', function (event) { + console.log(String(event.target)) +}) + +suite.on('complete', function () { + console.log('\nFastest is ' + this.filter('fastest').map('name')) +}) + +suite.run({ delay: 1, minSamples: 150 }) diff --git a/node_modules/fast-safe-stringify/index.d.ts b/node_modules/fast-safe-stringify/index.d.ts new file mode 100644 index 0000000..9a9b1f0 --- /dev/null +++ b/node_modules/fast-safe-stringify/index.d.ts @@ -0,0 +1,23 @@ +declare function stringify( + value: any, + replacer?: (key: string, value: any) => any, + space?: string | number, + options?: { depthLimit: number | undefined; edgesLimit: number | undefined } +): string; + +declare namespace stringify { + export function stable( + value: any, + replacer?: (key: string, value: any) => any, + space?: string | number, + options?: { depthLimit: number | undefined; edgesLimit: number | undefined } + ): string; + export function stableStringify( + value: any, + replacer?: (key: string, value: any) => any, + space?: string | number, + options?: { depthLimit: number | undefined; edgesLimit: number | undefined } + ): string; +} + +export default stringify; diff --git a/node_modules/fast-safe-stringify/index.js b/node_modules/fast-safe-stringify/index.js new file mode 100644 index 0000000..ecf7e51 --- /dev/null +++ b/node_modules/fast-safe-stringify/index.js @@ -0,0 +1,229 @@ +module.exports = stringify +stringify.default = stringify +stringify.stable = deterministicStringify +stringify.stableStringify = deterministicStringify + +var LIMIT_REPLACE_NODE = '[...]' +var CIRCULAR_REPLACE_NODE = '[Circular]' + +var arr = [] +var replacerStack = [] + +function defaultOptions () { + return { + depthLimit: Number.MAX_SAFE_INTEGER, + edgesLimit: Number.MAX_SAFE_INTEGER + } +} + +// Regular stringify +function stringify (obj, replacer, spacer, options) { + if (typeof options === 'undefined') { + options = defaultOptions() + } + + decirc(obj, '', 0, [], undefined, 0, options) + var res + try { + if (replacerStack.length === 0) { + res = JSON.stringify(obj, replacer, spacer) + } else { + res = JSON.stringify(obj, replaceGetterValues(replacer), spacer) + } + } catch (_) { + return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]') + } finally { + while (arr.length !== 0) { + var part = arr.pop() + if (part.length === 4) { + Object.defineProperty(part[0], part[1], part[3]) + } else { + part[0][part[1]] = part[2] + } + } + } + return res +} + +function setReplace (replace, val, k, parent) { + var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k) + if (propertyDescriptor.get !== undefined) { + if (propertyDescriptor.configurable) { + Object.defineProperty(parent, k, { value: replace }) + arr.push([parent, k, val, propertyDescriptor]) + } else { + replacerStack.push([val, k, replace]) + } + } else { + parent[k] = replace + arr.push([parent, k, val]) + } +} + +function decirc (val, k, edgeIndex, stack, parent, depth, options) { + depth += 1 + var i + if (typeof val === 'object' && val !== null) { + for (i = 0; i < stack.length; i++) { + if (stack[i] === val) { + setReplace(CIRCULAR_REPLACE_NODE, val, k, parent) + return + } + } + + if ( + typeof options.depthLimit !== 'undefined' && + depth > options.depthLimit + ) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent) + return + } + + if ( + typeof options.edgesLimit !== 'undefined' && + edgeIndex + 1 > options.edgesLimit + ) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent) + return + } + + stack.push(val) + // Optimize for Arrays. Big arrays could kill the performance otherwise! + if (Array.isArray(val)) { + for (i = 0; i < val.length; i++) { + decirc(val[i], i, i, stack, val, depth, options) + } + } else { + var keys = Object.keys(val) + for (i = 0; i < keys.length; i++) { + var key = keys[i] + decirc(val[key], key, i, stack, val, depth, options) + } + } + stack.pop() + } +} + +// Stable-stringify +function compareFunction (a, b) { + if (a < b) { + return -1 + } + if (a > b) { + return 1 + } + return 0 +} + +function deterministicStringify (obj, replacer, spacer, options) { + if (typeof options === 'undefined') { + options = defaultOptions() + } + + var tmp = deterministicDecirc(obj, '', 0, [], undefined, 0, options) || obj + var res + try { + if (replacerStack.length === 0) { + res = JSON.stringify(tmp, replacer, spacer) + } else { + res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer) + } + } catch (_) { + return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]') + } finally { + // Ensure that we restore the object as it was. + while (arr.length !== 0) { + var part = arr.pop() + if (part.length === 4) { + Object.defineProperty(part[0], part[1], part[3]) + } else { + part[0][part[1]] = part[2] + } + } + } + return res +} + +function deterministicDecirc (val, k, edgeIndex, stack, parent, depth, options) { + depth += 1 + var i + if (typeof val === 'object' && val !== null) { + for (i = 0; i < stack.length; i++) { + if (stack[i] === val) { + setReplace(CIRCULAR_REPLACE_NODE, val, k, parent) + return + } + } + try { + if (typeof val.toJSON === 'function') { + return + } + } catch (_) { + return + } + + if ( + typeof options.depthLimit !== 'undefined' && + depth > options.depthLimit + ) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent) + return + } + + if ( + typeof options.edgesLimit !== 'undefined' && + edgeIndex + 1 > options.edgesLimit + ) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent) + return + } + + stack.push(val) + // Optimize for Arrays. Big arrays could kill the performance otherwise! + if (Array.isArray(val)) { + for (i = 0; i < val.length; i++) { + deterministicDecirc(val[i], i, i, stack, val, depth, options) + } + } else { + // Create a temporary object in the required way + var tmp = {} + var keys = Object.keys(val).sort(compareFunction) + for (i = 0; i < keys.length; i++) { + var key = keys[i] + deterministicDecirc(val[key], key, i, stack, val, depth, options) + tmp[key] = val[key] + } + if (typeof parent !== 'undefined') { + arr.push([parent, k, val]) + parent[k] = tmp + } else { + return tmp + } + } + stack.pop() + } +} + +// wraps replacer function to handle values we couldn't replace +// and mark them as replaced value +function replaceGetterValues (replacer) { + replacer = + typeof replacer !== 'undefined' + ? replacer + : function (k, v) { + return v + } + return function (key, val) { + if (replacerStack.length > 0) { + for (var i = 0; i < replacerStack.length; i++) { + var part = replacerStack[i] + if (part[1] === key && part[0] === val) { + val = part[2] + replacerStack.splice(i, 1) + break + } + } + } + return replacer.call(this, key, val) + } +} diff --git a/node_modules/fast-safe-stringify/package.json b/node_modules/fast-safe-stringify/package.json new file mode 100644 index 0000000..206a591 --- /dev/null +++ b/node_modules/fast-safe-stringify/package.json @@ -0,0 +1,46 @@ +{ + "name": "fast-safe-stringify", + "version": "2.1.1", + "description": "Safely and quickly serialize JavaScript objects", + "keywords": [ + "stable", + "stringify", + "JSON", + "JSON.stringify", + "safe", + "serialize" + ], + "main": "index.js", + "scripts": { + "test": "standard && tap --no-esm test.js test-stable.js", + "benchmark": "node benchmark.js" + }, + "author": "David Mark Clements", + "contributors": [ + "Ruben Bridgewater", + "Matteo Collina", + "Ben Gourley", + "Gabriel Lesperance", + "Alex Liu", + "Christoph Walcher", + "Nicholas Young" + ], + "license": "MIT", + "typings": "index", + "devDependencies": { + "benchmark": "^2.1.4", + "clone": "^2.1.0", + "json-stringify-safe": "^5.0.1", + "standard": "^11.0.0", + "tap": "^12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/davidmarkclements/fast-safe-stringify.git" + }, + "bugs": { + "url": "https://github.com/davidmarkclements/fast-safe-stringify/issues" + }, + "homepage": "https://github.com/davidmarkclements/fast-safe-stringify#readme", + "dependencies": {} +} diff --git a/node_modules/fast-safe-stringify/readme.md b/node_modules/fast-safe-stringify/readme.md new file mode 100644 index 0000000..47179c9 --- /dev/null +++ b/node_modules/fast-safe-stringify/readme.md @@ -0,0 +1,170 @@ +# fast-safe-stringify + +Safe and fast serialization alternative to [JSON.stringify][]. + +Gracefully handles circular structures instead of throwing in most cases. +It could return an error string if the circular object is too complex to analyze, +e.g. in case there are proxies involved. + +Provides a deterministic ("stable") version as well that will also gracefully +handle circular structures. See the example below for further information. + +## Usage + +The same as [JSON.stringify][]. + +`stringify(value[, replacer[, space[, options]]])` + +```js +const safeStringify = require('fast-safe-stringify') +const o = { a: 1 } +o.o = o + +console.log(safeStringify(o)) +// '{"a":1,"o":"[Circular]"}' +console.log(JSON.stringify(o)) +// TypeError: Converting circular structure to JSON + +function replacer(key, value) { + console.log('Key:', JSON.stringify(key), 'Value:', JSON.stringify(value)) + // Remove the circular structure + if (value === '[Circular]') { + return + } + return value +} + +// those are also defaults limits when no options object is passed into safeStringify +// configure it to lower the limit. +const options = { + depthLimit: Number.MAX_SAFE_INTEGER, + edgesLimit: Number.MAX_SAFE_INTEGER +}; + +const serialized = safeStringify(o, replacer, 2, options) +// Key: "" Value: {"a":1,"o":"[Circular]"} +// Key: "a" Value: 1 +// Key: "o" Value: "[Circular]" +console.log(serialized) +// { +// "a": 1 +// } +``` + + +Using the deterministic version also works the same: + +```js +const safeStringify = require('fast-safe-stringify') +const o = { b: 1, a: 0 } +o.o = o + +console.log(safeStringify(o)) +// '{"b":1,"a":0,"o":"[Circular]"}' +console.log(safeStringify.stableStringify(o)) +// '{"a":0,"b":1,"o":"[Circular]"}' +console.log(JSON.stringify(o)) +// TypeError: Converting circular structure to JSON +``` + +A faster and side-effect free implementation is available in the +[safe-stable-stringify][] module. However it is still considered experimental +due to a new and more complex implementation. + +### Replace strings constants + +- `[Circular]` - when same reference is found +- `[...]` - when some limit from options object is reached + +## Differences to JSON.stringify + +In general the behavior is identical to [JSON.stringify][]. The [`replacer`][] +and [`space`][] options are also available. + +A few exceptions exist to [JSON.stringify][] while using [`toJSON`][] or +[`replacer`][]: + +### Regular safe stringify + +- Manipulating a circular structure of the passed in value in a `toJSON` or the + `replacer` is not possible! It is possible for any other value and property. + +- In case a circular structure is detected and the [`replacer`][] is used it + will receive the string `[Circular]` as the argument instead of the circular + object itself. + +### Deterministic ("stable") safe stringify + +- Manipulating the input object either in a [`toJSON`][] or the [`replacer`][] + function will not have any effect on the output. The output entirely relies on + the shape the input value had at the point passed to the stringify function! + +- In case a circular structure is detected and the [`replacer`][] is used it + will receive the string `[Circular]` as the argument instead of the circular + object itself. + +A side effect free variation without these limitations can be found as well +([`safe-stable-stringify`][]). It is also faster than the current +implementation. It is still considered experimental due to a new and more +complex implementation. + +## Benchmarks + +Although not JSON, the Node.js `util.inspect` method can be used for similar +purposes (e.g. logging) and also handles circular references. + +Here we compare `fast-safe-stringify` with some alternatives: +(Lenovo T450s with a i7-5600U CPU using Node.js 8.9.4) + +```md +fast-safe-stringify: simple object x 1,121,497 ops/sec ±0.75% (97 runs sampled) +fast-safe-stringify: circular x 560,126 ops/sec ±0.64% (96 runs sampled) +fast-safe-stringify: deep x 32,472 ops/sec ±0.57% (95 runs sampled) +fast-safe-stringify: deep circular x 32,513 ops/sec ±0.80% (92 runs sampled) + +util.inspect: simple object x 272,837 ops/sec ±1.48% (90 runs sampled) +util.inspect: circular x 116,896 ops/sec ±1.19% (95 runs sampled) +util.inspect: deep x 19,382 ops/sec ±0.66% (92 runs sampled) +util.inspect: deep circular x 18,717 ops/sec ±0.63% (96 runs sampled) + +json-stringify-safe: simple object x 233,621 ops/sec ±0.97% (94 runs sampled) +json-stringify-safe: circular x 110,409 ops/sec ±1.85% (95 runs sampled) +json-stringify-safe: deep x 8,705 ops/sec ±0.87% (96 runs sampled) +json-stringify-safe: deep circular x 8,336 ops/sec ±2.20% (93 runs sampled) +``` + +For stable stringify comparisons, see the performance benchmarks in the +[`safe-stable-stringify`][] readme. + +## Protip + +Whether `fast-safe-stringify` or alternatives are used: if the use case +consists of deeply nested objects without circular references the following +pattern will give best results. +Shallow or one level nested objects on the other hand will slow down with it. +It is entirely dependant on the use case. + +```js +const stringify = require('fast-safe-stringify') + +function tryJSONStringify (obj) { + try { return JSON.stringify(obj) } catch (_) {} +} + +const serializedString = tryJSONStringify(deep) || stringify(deep) +``` + +## Acknowledgements + +Sponsored by [nearForm](http://nearform.com) + +## License + +MIT + +[`replacer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The%20replacer%20parameter +[`safe-stable-stringify`]: https://github.com/BridgeAR/safe-stable-stringify +[`space`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The%20space%20argument +[`toJSON`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior +[benchmark]: https://github.com/epoberezkin/fast-json-stable-stringify/blob/67f688f7441010cfef91a6147280cc501701e83b/benchmark +[JSON.stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify diff --git a/node_modules/fast-safe-stringify/test-stable.js b/node_modules/fast-safe-stringify/test-stable.js new file mode 100644 index 0000000..c55b95c --- /dev/null +++ b/node_modules/fast-safe-stringify/test-stable.js @@ -0,0 +1,404 @@ +const test = require('tap').test +const fss = require('./').stable +const clone = require('clone') +const s = JSON.stringify +const stream = require('stream') + +test('circular reference to root', function (assert) { + const fixture = { name: 'Tywin Lannister' } + fixture.circle = fixture + const expected = s({ circle: '[Circular]', name: 'Tywin Lannister' }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('circular getter reference to root', function (assert) { + const fixture = { + name: 'Tywin Lannister', + get circle () { + return fixture + } + } + + const expected = s({ circle: '[Circular]', name: 'Tywin Lannister' }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested circular reference to root', function (assert) { + const fixture = { name: 'Tywin Lannister' } + fixture.id = { circle: fixture } + const expected = s({ id: { circle: '[Circular]' }, name: 'Tywin Lannister' }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('child circular reference', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { name: 'Tyrion Lannister' } + } + fixture.child.dinklage = fixture.child + const expected = s({ + child: { + dinklage: '[Circular]', + name: 'Tyrion Lannister' + }, + name: 'Tywin Lannister' + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested child circular reference', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { name: 'Tyrion Lannister' } + } + fixture.child.actor = { dinklage: fixture.child } + const expected = s({ + child: { + actor: { dinklage: '[Circular]' }, + name: 'Tyrion Lannister' + }, + name: 'Tywin Lannister' + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('circular objects in an array', function (assert) { + const fixture = { name: 'Tywin Lannister' } + fixture.hand = [fixture, fixture] + const expected = s({ + hand: ['[Circular]', '[Circular]'], + name: 'Tywin Lannister' + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested circular references in an array', function (assert) { + const fixture = { + name: 'Tywin Lannister', + offspring: [{ name: 'Tyrion Lannister' }, { name: 'Cersei Lannister' }] + } + fixture.offspring[0].dinklage = fixture.offspring[0] + fixture.offspring[1].headey = fixture.offspring[1] + + const expected = s({ + name: 'Tywin Lannister', + offspring: [ + { dinklage: '[Circular]', name: 'Tyrion Lannister' }, + { headey: '[Circular]', name: 'Cersei Lannister' } + ] + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('circular arrays', function (assert) { + const fixture = [] + fixture.push(fixture, fixture) + const expected = s(['[Circular]', '[Circular]']) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested circular arrays', function (assert) { + const fixture = [] + fixture.push( + { name: 'Jon Snow', bastards: fixture }, + { name: 'Ramsay Bolton', bastards: fixture } + ) + const expected = s([ + { bastards: '[Circular]', name: 'Jon Snow' }, + { bastards: '[Circular]', name: 'Ramsay Bolton' } + ]) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('repeated non-circular references in objects', function (assert) { + const daenerys = { name: 'Daenerys Targaryen' } + const fixture = { + motherOfDragons: daenerys, + queenOfMeereen: daenerys + } + const expected = s(fixture) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('repeated non-circular references in arrays', function (assert) { + const daenerys = { name: 'Daenerys Targaryen' } + const fixture = [daenerys, daenerys] + const expected = s(fixture) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('double child circular reference', function (assert) { + // create circular reference + const child = { name: 'Tyrion Lannister' } + child.dinklage = child + + // include it twice in the fixture + const fixture = { name: 'Tywin Lannister', childA: child, childB: child } + const cloned = clone(fixture) + const expected = s({ + childA: { + dinklage: '[Circular]', + name: 'Tyrion Lannister' + }, + childB: { + dinklage: '[Circular]', + name: 'Tyrion Lannister' + }, + name: 'Tywin Lannister' + }) + const actual = fss(fixture) + assert.equal(actual, expected) + + // check if the fixture has not been modified + assert.same(fixture, cloned) + assert.end() +}) + +test('child circular reference with toJSON', function (assert) { + // Create a test object that has an overridden `toJSON` property + TestObject.prototype.toJSON = function () { + return { special: 'case' } + } + function TestObject (content) {} + + // Creating a simple circular object structure + const parentObject = {} + parentObject.childObject = new TestObject() + parentObject.childObject.parentObject = parentObject + + // Creating a simple circular object structure + const otherParentObject = new TestObject() + otherParentObject.otherChildObject = {} + otherParentObject.otherChildObject.otherParentObject = otherParentObject + + // Making sure our original tests work + assert.same(parentObject.childObject.parentObject, parentObject) + assert.same( + otherParentObject.otherChildObject.otherParentObject, + otherParentObject + ) + + // Should both be idempotent + assert.equal(fss(parentObject), '{"childObject":{"special":"case"}}') + assert.equal(fss(otherParentObject), '{"special":"case"}') + + // Therefore the following assertion should be `true` + assert.same(parentObject.childObject.parentObject, parentObject) + assert.same( + otherParentObject.otherChildObject.otherParentObject, + otherParentObject + ) + + assert.end() +}) + +test('null object', function (assert) { + const expected = s(null) + const actual = fss(null) + assert.equal(actual, expected) + assert.end() +}) + +test('null property', function (assert) { + const expected = s({ f: null }) + const actual = fss({ f: null }) + assert.equal(actual, expected) + assert.end() +}) + +test('nested child circular reference in toJSON', function (assert) { + var circle = { some: 'data' } + circle.circle = circle + var a = { + b: { + toJSON: function () { + a.b = 2 + return '[Redacted]' + } + }, + baz: { + circle, + toJSON: function () { + a.baz = circle + return '[Redacted]' + } + } + } + var o = { + a, + bar: a + } + + const expected = s({ + a: { + b: '[Redacted]', + baz: '[Redacted]' + }, + bar: { + // TODO: This is a known limitation of the current implementation. + // The ideal result would be: + // + // b: 2, + // baz: { + // circle: '[Circular]', + // some: 'data' + // } + // + b: '[Redacted]', + baz: '[Redacted]' + } + }) + const actual = fss(o) + assert.equal(actual, expected) + assert.end() +}) + +test('circular getters are restored when stringified', function (assert) { + const fixture = { + name: 'Tywin Lannister', + get circle () { + return fixture + } + } + fss(fixture) + + assert.equal(fixture.circle, fixture) + assert.end() +}) + +test('non-configurable circular getters use a replacer instead of markers', function (assert) { + const fixture = { name: 'Tywin Lannister' } + Object.defineProperty(fixture, 'circle', { + configurable: false, + get: function () { + return fixture + }, + enumerable: true + }) + + fss(fixture) + + assert.equal(fixture.circle, fixture) + assert.end() +}) + +test('getter child circular reference', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { + name: 'Tyrion Lannister', + get dinklage () { + return fixture.child + } + }, + get self () { + return fixture + } + } + + const expected = s({ + child: { + dinklage: '[Circular]', + name: 'Tyrion Lannister' + }, + name: 'Tywin Lannister', + self: '[Circular]' + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('Proxy throwing', function (assert) { + assert.plan(1) + const s = new stream.PassThrough() + s.resume() + s.write('', () => { + assert.end() + }) + const actual = fss({ s, p: new Proxy({}, { get () { throw new Error('kaboom') } }) }) + assert.equal(actual, '"[unable to serialize, circular reference is too complex to analyze]"') +}) + +test('depthLimit option - will replace deep objects', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { + name: 'Tyrion Lannister' + }, + get self () { + return fixture + } + } + + const expected = s({ + child: '[...]', + name: 'Tywin Lannister', + self: '[Circular]' + }) + const actual = fss(fixture, undefined, undefined, { + depthLimit: 1, + edgesLimit: 1 + }) + assert.equal(actual, expected) + assert.end() +}) + +test('edgesLimit option - will replace deep objects', function (assert) { + const fixture = { + object: { + 1: { test: 'test' }, + 2: { test: 'test' }, + 3: { test: 'test' }, + 4: { test: 'test' } + }, + array: [ + { test: 'test' }, + { test: 'test' }, + { test: 'test' }, + { test: 'test' } + ], + get self () { + return fixture + } + } + + const expected = s({ + array: [{ test: 'test' }, { test: 'test' }, { test: 'test' }, '[...]'], + object: { + 1: { test: 'test' }, + 2: { test: 'test' }, + 3: { test: 'test' }, + 4: '[...]' + }, + self: '[Circular]' + }) + const actual = fss(fixture, undefined, undefined, { + depthLimit: 3, + edgesLimit: 3 + }) + assert.equal(actual, expected) + assert.end() +}) diff --git a/node_modules/fast-safe-stringify/test.js b/node_modules/fast-safe-stringify/test.js new file mode 100644 index 0000000..a4170e9 --- /dev/null +++ b/node_modules/fast-safe-stringify/test.js @@ -0,0 +1,397 @@ +const test = require('tap').test +const fss = require('./') +const clone = require('clone') +const s = JSON.stringify +const stream = require('stream') + +test('circular reference to root', function (assert) { + const fixture = { name: 'Tywin Lannister' } + fixture.circle = fixture + const expected = s({ name: 'Tywin Lannister', circle: '[Circular]' }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('circular getter reference to root', function (assert) { + const fixture = { + name: 'Tywin Lannister', + get circle () { + return fixture + } + } + const expected = s({ name: 'Tywin Lannister', circle: '[Circular]' }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested circular reference to root', function (assert) { + const fixture = { name: 'Tywin Lannister' } + fixture.id = { circle: fixture } + const expected = s({ name: 'Tywin Lannister', id: { circle: '[Circular]' } }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('child circular reference', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { name: 'Tyrion Lannister' } + } + fixture.child.dinklage = fixture.child + const expected = s({ + name: 'Tywin Lannister', + child: { + name: 'Tyrion Lannister', + dinklage: '[Circular]' + } + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested child circular reference', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { name: 'Tyrion Lannister' } + } + fixture.child.actor = { dinklage: fixture.child } + const expected = s({ + name: 'Tywin Lannister', + child: { + name: 'Tyrion Lannister', + actor: { dinklage: '[Circular]' } + } + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('circular objects in an array', function (assert) { + const fixture = { name: 'Tywin Lannister' } + fixture.hand = [fixture, fixture] + const expected = s({ + name: 'Tywin Lannister', + hand: ['[Circular]', '[Circular]'] + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested circular references in an array', function (assert) { + const fixture = { + name: 'Tywin Lannister', + offspring: [{ name: 'Tyrion Lannister' }, { name: 'Cersei Lannister' }] + } + fixture.offspring[0].dinklage = fixture.offspring[0] + fixture.offspring[1].headey = fixture.offspring[1] + + const expected = s({ + name: 'Tywin Lannister', + offspring: [ + { name: 'Tyrion Lannister', dinklage: '[Circular]' }, + { name: 'Cersei Lannister', headey: '[Circular]' } + ] + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('circular arrays', function (assert) { + const fixture = [] + fixture.push(fixture, fixture) + const expected = s(['[Circular]', '[Circular]']) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('nested circular arrays', function (assert) { + const fixture = [] + fixture.push( + { name: 'Jon Snow', bastards: fixture }, + { name: 'Ramsay Bolton', bastards: fixture } + ) + const expected = s([ + { name: 'Jon Snow', bastards: '[Circular]' }, + { name: 'Ramsay Bolton', bastards: '[Circular]' } + ]) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('repeated non-circular references in objects', function (assert) { + const daenerys = { name: 'Daenerys Targaryen' } + const fixture = { + motherOfDragons: daenerys, + queenOfMeereen: daenerys + } + const expected = s(fixture) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('repeated non-circular references in arrays', function (assert) { + const daenerys = { name: 'Daenerys Targaryen' } + const fixture = [daenerys, daenerys] + const expected = s(fixture) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('double child circular reference', function (assert) { + // create circular reference + const child = { name: 'Tyrion Lannister' } + child.dinklage = child + + // include it twice in the fixture + const fixture = { name: 'Tywin Lannister', childA: child, childB: child } + const cloned = clone(fixture) + const expected = s({ + name: 'Tywin Lannister', + childA: { + name: 'Tyrion Lannister', + dinklage: '[Circular]' + }, + childB: { + name: 'Tyrion Lannister', + dinklage: '[Circular]' + } + }) + const actual = fss(fixture) + assert.equal(actual, expected) + + // check if the fixture has not been modified + assert.same(fixture, cloned) + assert.end() +}) + +test('child circular reference with toJSON', function (assert) { + // Create a test object that has an overridden `toJSON` property + TestObject.prototype.toJSON = function () { + return { special: 'case' } + } + function TestObject (content) {} + + // Creating a simple circular object structure + const parentObject = {} + parentObject.childObject = new TestObject() + parentObject.childObject.parentObject = parentObject + + // Creating a simple circular object structure + const otherParentObject = new TestObject() + otherParentObject.otherChildObject = {} + otherParentObject.otherChildObject.otherParentObject = otherParentObject + + // Making sure our original tests work + assert.same(parentObject.childObject.parentObject, parentObject) + assert.same( + otherParentObject.otherChildObject.otherParentObject, + otherParentObject + ) + + // Should both be idempotent + assert.equal(fss(parentObject), '{"childObject":{"special":"case"}}') + assert.equal(fss(otherParentObject), '{"special":"case"}') + + // Therefore the following assertion should be `true` + assert.same(parentObject.childObject.parentObject, parentObject) + assert.same( + otherParentObject.otherChildObject.otherParentObject, + otherParentObject + ) + + assert.end() +}) + +test('null object', function (assert) { + const expected = s(null) + const actual = fss(null) + assert.equal(actual, expected) + assert.end() +}) + +test('null property', function (assert) { + const expected = s({ f: null }) + const actual = fss({ f: null }) + assert.equal(actual, expected) + assert.end() +}) + +test('nested child circular reference in toJSON', function (assert) { + const circle = { some: 'data' } + circle.circle = circle + const a = { + b: { + toJSON: function () { + a.b = 2 + return '[Redacted]' + } + }, + baz: { + circle, + toJSON: function () { + a.baz = circle + return '[Redacted]' + } + } + } + const o = { + a, + bar: a + } + + const expected = s({ + a: { + b: '[Redacted]', + baz: '[Redacted]' + }, + bar: { + b: 2, + baz: { + some: 'data', + circle: '[Circular]' + } + } + }) + const actual = fss(o) + assert.equal(actual, expected) + assert.end() +}) + +test('circular getters are restored when stringified', function (assert) { + const fixture = { + name: 'Tywin Lannister', + get circle () { + return fixture + } + } + fss(fixture) + + assert.equal(fixture.circle, fixture) + assert.end() +}) + +test('non-configurable circular getters use a replacer instead of markers', function (assert) { + const fixture = { name: 'Tywin Lannister' } + Object.defineProperty(fixture, 'circle', { + configurable: false, + get: function () { + return fixture + }, + enumerable: true + }) + + fss(fixture) + + assert.equal(fixture.circle, fixture) + assert.end() +}) + +test('getter child circular reference are replaced instead of marked', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { + name: 'Tyrion Lannister', + get dinklage () { + return fixture.child + } + }, + get self () { + return fixture + } + } + + const expected = s({ + name: 'Tywin Lannister', + child: { + name: 'Tyrion Lannister', + dinklage: '[Circular]' + }, + self: '[Circular]' + }) + const actual = fss(fixture) + assert.equal(actual, expected) + assert.end() +}) + +test('Proxy throwing', function (assert) { + assert.plan(1) + const s = new stream.PassThrough() + s.resume() + s.write('', () => { + assert.end() + }) + const actual = fss({ s, p: new Proxy({}, { get () { throw new Error('kaboom') } }) }) + assert.equal(actual, '"[unable to serialize, circular reference is too complex to analyze]"') +}) + +test('depthLimit option - will replace deep objects', function (assert) { + const fixture = { + name: 'Tywin Lannister', + child: { + name: 'Tyrion Lannister' + }, + get self () { + return fixture + } + } + + const expected = s({ + name: 'Tywin Lannister', + child: '[...]', + self: '[Circular]' + }) + const actual = fss(fixture, undefined, undefined, { + depthLimit: 1, + edgesLimit: 1 + }) + assert.equal(actual, expected) + assert.end() +}) + +test('edgesLimit option - will replace deep objects', function (assert) { + const fixture = { + object: { + 1: { test: 'test' }, + 2: { test: 'test' }, + 3: { test: 'test' }, + 4: { test: 'test' } + }, + array: [ + { test: 'test' }, + { test: 'test' }, + { test: 'test' }, + { test: 'test' } + ], + get self () { + return fixture + } + } + + const expected = s({ + object: { + 1: { test: 'test' }, + 2: { test: 'test' }, + 3: { test: 'test' }, + 4: '[...]' + }, + array: [{ test: 'test' }, { test: 'test' }, { test: 'test' }, '[...]'], + self: '[Circular]' + }) + const actual = fss(fixture, undefined, undefined, { + depthLimit: 3, + edgesLimit: 3 + }) + assert.equal(actual, expected) + assert.end() +}) diff --git a/node_modules/finalhandler/HISTORY.md b/node_modules/finalhandler/HISTORY.md new file mode 100644 index 0000000..4bc1850 --- /dev/null +++ b/node_modules/finalhandler/HISTORY.md @@ -0,0 +1,233 @@ +v2.1.0 / 2025-03-05 +================== + + * deps: + * use caret notation for dependency versions + * encodeurl@^2.0.0 + * debug@^4.4.0 + * remove `ServerResponse.headersSent` support check + * remove setImmediate support check + * update test dependencies + * remove unnecessary devDependency `safe-buffer` + * remove `unpipe` package and use native `unpipe()` method + * remove unnecessary devDependency `readable-stream` + * refactor: use object spread to copy error headers + * refactor: use replaceAll instead of replace with a regex + * refactor: replace setHeaders function with optimized inline header setting + +v2.0.0 / 2024-09-02 +================== + + * drop support for node <18 + * ignore status message for HTTP/2 (#53) + +v1.3.1 / 2024-09-11 +================== + + * deps: encodeurl@~2.0.0 + +v1.3.0 / 2024-09-03 +================== + + * ignore status message for HTTP/2 (#53) + +v1.2.1 / 2024-09-02 +================== + + * Gracefully handle when handling an error and socket is null + +1.2.0 / 2022-03-22 +================== + + * Remove set content headers that break response + * deps: on-finished@2.4.1 + * deps: statuses@2.0.1 + - Rename `425 Unordered Collection` to standard `425 Too Early` + +1.1.2 / 2019-05-09 +================== + + * Set stricter `Content-Security-Policy` header + * deps: parseurl@~1.3.3 + * deps: statuses@~1.5.0 + +1.1.1 / 2018-03-06 +================== + + * Fix 404 output for bad / missing pathnames + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: statuses@~1.4.0 + +1.1.0 / 2017-09-24 +================== + + * Use `res.headersSent` when available + +1.0.6 / 2017-09-22 +================== + + * deps: debug@2.6.9 + +1.0.5 / 2017-09-15 +================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + +1.0.4 / 2017-08-03 +================== + + * deps: debug@2.6.8 + +1.0.3 / 2017-05-16 +================== + + * deps: debug@2.6.7 + - deps: ms@2.0.0 + +1.0.2 / 2017-04-22 +================== + + * deps: debug@2.6.4 + - deps: ms@0.7.3 + +1.0.1 / 2017-03-21 +================== + + * Fix missing `` in HTML document + * deps: debug@2.6.3 + - Fix: `DEBUG_MAX_ARRAY_LENGTH` + +1.0.0 / 2017-02-15 +================== + + * Fix exception when `err` cannot be converted to a string + * Fully URL-encode the pathname in the 404 message + * Only include the pathname in the 404 message + * Send complete HTML document + * Set `Content-Security-Policy: default-src 'self'` header + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +0.5.1 / 2016-11-12 +================== + + * Fix exception when `err.headers` is not an object + * deps: statuses@~1.3.1 + * perf: hoist regular expressions + * perf: remove duplicate validation path + +0.5.0 / 2016-06-15 +================== + + * Change invalid or non-numeric status code to 500 + * Overwrite status message to match set status code + * Prefer `err.statusCode` if `err.status` is invalid + * Set response headers from `err.headers` object + * Use `statuses` instead of `http` module for status messages + - Includes all defined status messages + +0.4.1 / 2015-12-02 +================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + +0.4.0 / 2015-06-14 +================== + + * Fix a false-positive when unpiping in Node.js 0.8 + * Support `statusCode` property on `Error` objects + * Use `unpipe` module for unpiping requests + * deps: escape-html@1.0.2 + * deps: on-finished@~2.3.0 + - Add defined behavior for HTTP `CONNECT` requests + - Add defined behavior for HTTP `Upgrade` requests + - deps: ee-first@1.1.1 + * perf: enable strict mode + * perf: remove argument reassignment + +0.3.6 / 2015-05-11 +================== + + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +0.3.5 / 2015-04-22 +================== + + * deps: on-finished@~2.2.1 + - Fix `isFinished(req)` when data buffered + +0.3.4 / 2015-03-15 +================== + + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +0.3.3 / 2015-01-01 +================== + + * deps: debug@~2.1.1 + * deps: on-finished@~2.2.0 + +0.3.2 / 2014-10-22 +================== + + * deps: on-finished@~2.1.1 + - Fix handling of pipelined requests + +0.3.1 / 2014-10-16 +================== + + * deps: debug@~2.1.0 + - Implement `DEBUG_FD` env variable support + +0.3.0 / 2014-09-17 +================== + + * Terminate in progress response only on error + * Use `on-finished` to determine request status + +0.2.0 / 2014-09-03 +================== + + * Set `X-Content-Type-Options: nosniff` header + * deps: debug@~2.0.0 + +0.1.0 / 2014-07-16 +================== + + * Respond after request fully read + - prevents hung responses and socket hang ups + * deps: debug@1.0.4 + +0.0.3 / 2014-07-11 +================== + + * deps: debug@1.0.3 + - Add support for multiple wildcards in namespaces + +0.0.2 / 2014-06-19 +================== + + * Handle invalid status codes + +0.0.1 / 2014-06-05 +================== + + * deps: debug@1.0.2 + +0.0.0 / 2014-06-05 +================== + + * Extracted from connect/express diff --git a/node_modules/finalhandler/LICENSE b/node_modules/finalhandler/LICENSE new file mode 100644 index 0000000..6022106 --- /dev/null +++ b/node_modules/finalhandler/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/finalhandler/README.md b/node_modules/finalhandler/README.md new file mode 100644 index 0000000..6244a13 --- /dev/null +++ b/node_modules/finalhandler/README.md @@ -0,0 +1,147 @@ +# finalhandler + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Node.js function to invoke as the final step to respond to HTTP request. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install finalhandler +``` + +## API + +```js +var finalhandler = require('finalhandler') +``` + +### finalhandler(req, res, [options]) + +Returns function to be invoked as the final step for the given `req` and `res`. +This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will +write out a 404 response to the `res`. If it is truthy, an error response will +be written out to the `res` or `res` will be terminated if a response has already +started. + +When an error is written, the following information is added to the response: + + * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If + this value is outside the 4xx or 5xx range, it will be set to 500. + * The `res.statusMessage` is set according to the status code. + * The body will be the HTML of the status code message if `env` is + `'production'`, otherwise will be `err.stack`. + * Any headers specified in an `err.headers` object. + +The final handler will also unpipe anything from `req` when it is invoked. + +#### options.env + +By default, the environment is determined by `NODE_ENV` variable, but it can be +overridden by this option. + +#### options.onerror + +Provide a function to be called with the `err` when it exists. Can be used for +writing errors to a central location without excessive function generation. Called +as `onerror(err, req, res)`. + +## Examples + +### always 404 + +```js +var finalhandler = require('finalhandler') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + done() +}) + +server.listen(3000) +``` + +### perform simple action + +```js +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + + fs.readFile('index.html', function (err, buf) { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) +``` + +### use with middleware-style functions + +```js +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') + +var serve = serveStatic('public') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res) + serve(req, res, done) +}) + +server.listen(3000) +``` + +### keep log of all errors + +```js +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') + +var server = http.createServer(function (req, res) { + var done = finalhandler(req, res, { onerror: logerror }) + + fs.readFile('index.html', function (err, buf) { + if (err) return done(err) + res.setHeader('Content-Type', 'text/html') + res.end(buf) + }) +}) + +server.listen(3000) + +function logerror (err) { + console.error(err.stack || err.toString()) +} +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/finalhandler.svg +[npm-url]: https://npmjs.org/package/finalhandler +[node-image]: https://img.shields.io/node/v/finalhandler.svg +[node-url]: https://nodejs.org/en/download +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master +[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg +[downloads-url]: https://npmjs.org/package/finalhandler +[github-actions-ci-image]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml/badge.svg +[github-actions-ci-url]: https://github.com/pillarjs/finalhandler/actions/workflows/ci.yml diff --git a/node_modules/finalhandler/index.js b/node_modules/finalhandler/index.js new file mode 100644 index 0000000..bf15e48 --- /dev/null +++ b/node_modules/finalhandler/index.js @@ -0,0 +1,293 @@ +/*! + * finalhandler + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var debug = require('debug')('finalhandler') +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var onFinished = require('on-finished') +var parseUrl = require('parseurl') +var statuses = require('statuses') + +/** + * Module variables. + * @private + */ + +var isFinished = onFinished.isFinished + +/** + * Create a minimal HTML document. + * + * @param {string} message + * @private + */ + +function createHtmlDocument (message) { + var body = escapeHtml(message) + .replaceAll('\n', '
') + .replaceAll(' ', '  ') + + return '\n' + + '\n' + + '\n' + + '\n' + + 'Error\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Module exports. + * @public + */ + +module.exports = finalhandler + +/** + * Create a function to handle the final response. + * + * @param {Request} req + * @param {Response} res + * @param {Object} [options] + * @return {Function} + * @public + */ + +function finalhandler (req, res, options) { + var opts = options || {} + + // get environment + var env = opts.env || process.env.NODE_ENV || 'development' + + // get error callback + var onerror = opts.onerror + + return function (err) { + var headers + var msg + var status + + // ignore 404 on in-flight response + if (!err && res.headersSent) { + debug('cannot 404 after headers sent') + return + } + + // unhandled error + if (err) { + // respect status code from error + status = getErrorStatusCode(err) + + if (status === undefined) { + // fallback to status code on response + status = getResponseStatusCode(res) + } else { + // respect headers from error + headers = getErrorHeaders(err) + } + + // get error message + msg = getErrorMessage(err, status, env) + } else { + // not found + status = 404 + msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req)) + } + + debug('default %s', status) + + // schedule onerror callback + if (err && onerror) { + setImmediate(onerror, err, req, res) + } + + // cannot actually respond + if (res.headersSent) { + debug('cannot %d after headers sent', status) + if (req.socket) { + req.socket.destroy() + } + return + } + + // send response + send(req, res, status, headers, msg) + } +} + +/** + * Get headers from Error object. + * + * @param {Error} err + * @return {object} + * @private + */ + +function getErrorHeaders (err) { + if (!err.headers || typeof err.headers !== 'object') { + return undefined + } + + return { ...err.headers } +} + +/** + * Get message from Error object, fallback to status message. + * + * @param {Error} err + * @param {number} status + * @param {string} env + * @return {string} + * @private + */ + +function getErrorMessage (err, status, env) { + var msg + + if (env !== 'production') { + // use err.stack, which typically includes err.message + msg = err.stack + + // fallback to err.toString() when possible + if (!msg && typeof err.toString === 'function') { + msg = err.toString() + } + } + + return msg || statuses.message[status] +} + +/** + * Get status code from Error object. + * + * @param {Error} err + * @return {number} + * @private + */ + +function getErrorStatusCode (err) { + // check err.status + if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) { + return err.status + } + + // check err.statusCode + if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) { + return err.statusCode + } + + return undefined +} + +/** + * Get resource name for the request. + * + * This is typically just the original pathname of the request + * but will fallback to "resource" is that cannot be determined. + * + * @param {IncomingMessage} req + * @return {string} + * @private + */ + +function getResourceName (req) { + try { + return parseUrl.original(req).pathname + } catch (e) { + return 'resource' + } +} + +/** + * Get status code from response. + * + * @param {OutgoingMessage} res + * @return {number} + * @private + */ + +function getResponseStatusCode (res) { + var status = res.statusCode + + // default status code to 500 if outside valid range + if (typeof status !== 'number' || status < 400 || status > 599) { + status = 500 + } + + return status +} + +/** + * Send response. + * + * @param {IncomingMessage} req + * @param {OutgoingMessage} res + * @param {number} status + * @param {object} headers + * @param {string} message + * @private + */ + +function send (req, res, status, headers, message) { + function write () { + // response body + var body = createHtmlDocument(message) + + // response status + res.statusCode = status + + if (req.httpVersionMajor < 2) { + res.statusMessage = statuses.message[status] + } + + // remove any content headers + res.removeHeader('Content-Encoding') + res.removeHeader('Content-Language') + res.removeHeader('Content-Range') + + // response headers + for (const [key, value] of Object.entries(headers ?? {})) { + res.setHeader(key, value) + } + + // security headers + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + + // standard headers + res.setHeader('Content-Type', 'text/html; charset=utf-8') + res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')) + + if (req.method === 'HEAD') { + res.end() + return + } + + res.end(body, 'utf8') + } + + if (isFinished(req)) { + write() + return + } + + // unpipe everything from the request + req.unpipe() + + // flush the request + onFinished(req, write) + req.resume() +} diff --git a/node_modules/finalhandler/package.json b/node_modules/finalhandler/package.json new file mode 100644 index 0000000..992b306 --- /dev/null +++ b/node_modules/finalhandler/package.json @@ -0,0 +1,43 @@ +{ + "name": "finalhandler", + "description": "Node.js final http responder", + "version": "2.1.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "pillarjs/finalhandler", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.26.0", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "^11.0.1", + "nyc": "^17.1.0", + "supertest": "^7.0.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-inspect": "mocha --reporter spec --inspect --inspect-brk test/" + } +} diff --git a/node_modules/find-cache-dir/index.js b/node_modules/find-cache-dir/index.js new file mode 100644 index 0000000..4786590 --- /dev/null +++ b/node_modules/find-cache-dir/index.js @@ -0,0 +1,67 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const commonDir = require('commondir'); +const pkgDir = require('pkg-dir'); +const makeDir = require('make-dir'); + +const {env, cwd} = process; + +const isWritable = path => { + try { + fs.accessSync(path, fs.constants.W_OK); + return true; + } catch (_) { + return false; + } +}; + +function useDirectory(directory, options) { + if (options.create) { + makeDir.sync(directory); + } + + if (options.thunk) { + return (...arguments_) => path.join(directory, ...arguments_); + } + + return directory; +} + +function getNodeModuleDirectory(directory) { + const nodeModules = path.join(directory, 'node_modules'); + + if ( + !isWritable(nodeModules) && + (fs.existsSync(nodeModules) || !isWritable(path.join(directory))) + ) { + return; + } + + return nodeModules; +} + +module.exports = (options = {}) => { + if (env.CACHE_DIR && !['true', 'false', '1', '0'].includes(env.CACHE_DIR)) { + return useDirectory(path.join(env.CACHE_DIR, options.name), options); + } + + let {cwd: directory = cwd()} = options; + + if (options.files) { + directory = commonDir(directory, options.files); + } + + directory = pkgDir.sync(directory); + + if (!directory) { + return; + } + + const nodeModules = getNodeModuleDirectory(directory); + if (!nodeModules) { + return undefined; + } + + return useDirectory(path.join(directory, 'node_modules', '.cache', options.name), options); +}; diff --git a/node_modules/find-cache-dir/license b/node_modules/find-cache-dir/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/find-cache-dir/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/find-cache-dir/package.json b/node_modules/find-cache-dir/package.json new file mode 100644 index 0000000..4ca187a --- /dev/null +++ b/node_modules/find-cache-dir/package.json @@ -0,0 +1,44 @@ +{ + "name": "find-cache-dir", + "version": "3.3.2", + "description": "Finds the common standard cache directory", + "license": "MIT", + "repository": "avajs/find-cache-dir", + "funding": "https://github.com/avajs/find-cache-dir?sponsor=1", + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "cache", + "directory", + "dir", + "caching", + "find", + "search" + ], + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.9", + "del": "^4.0.0", + "nyc": "^15.0.0", + "tempy": "^0.4.0", + "xo": "^0.25.3" + }, + "nyc": { + "reporter": [ + "lcov", + "text" + ] + } +} diff --git a/node_modules/find-cache-dir/readme.md b/node_modules/find-cache-dir/readme.md new file mode 100644 index 0000000..3bc03a8 --- /dev/null +++ b/node_modules/find-cache-dir/readme.md @@ -0,0 +1,123 @@ +# find-cache-dir [![Coverage Status](https://codecov.io/gh/avajs/find-cache-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/avajs/find-cache-dir/branch/master) + +> Finds the common standard cache directory + +The [`nyc`](https://github.com/istanbuljs/nyc) and [`AVA`](https://ava.li) projects decided to standardize on a common directory structure for storing cache information: + +```sh +# nyc +./node_modules/.cache/nyc + +# ava +./node_modules/.cache/ava + +# your-module +./node_modules/.cache/your-module +``` + +This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent: + +``` +rm -rf ./node_modules/.cache +``` + +If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below. + +## Install + +``` +$ npm install find-cache-dir +``` + +## Usage + +```js +const findCacheDir = require('find-cache-dir'); + +findCacheDir({name: 'unicorns'}); +//=> '/user/path/node-modules/.cache/unicorns' +``` + +## API + +### findCacheDir(options?) + +Finds the cache directory using the supplied options. The algorithm checks for the `CACHE_DIR` environmental variable and uses it if it is not set to `true`, `false`, `1` or `0`. If one is not found, it tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `undefined` if `package.json` was never found or if the `node_modules` directory is unwritable. + +#### options + +Type: `object` + +##### name + +*Required*\ +Type: `string` + +Should be the same as your project name in `package.json`. + +##### files + +Type: `string[] | string` + +An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the `cwd` option below. + +##### cwd + +Type: `string`\ +Default `process.cwd()` + +Directory to start searching for a `package.json` from. + +##### create + +Type: `boolean`\ +Default `false` + +If `true`, the directory will be created synchronously before returning. + +##### thunk + +Type: `boolean`\ +Default `false` + +If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`. + +```js +const thunk = findCacheDir({name: 'foo', thunk: true}); + +thunk(); +//=> '/some/path/node_modules/.cache/foo' + +thunk('bar.js') +//=> '/some/path/node_modules/.cache/foo/bar.js' + +thunk('baz', 'quz.js') +//=> '/some/path/node_modules/.cache/foo/baz/quz.js' +``` + +This is helpful for actually putting actual files in the cache! + +## Tips + +- To test modules using `find-cache-dir`, set the `CACHE_DIR` environment variable to temporarily override the directory that is resolved. + +## Adopters + +- [`ava`](https://avajs.dev) +- [`nyc`](https://github.com/istanbuljs/nyc) +- [`storybook`](https://github.com/storybookjs/storybook) +- [`babel-loader`](https://github.com/babel/babel-loader) +- [`eslint-loader`](https://github.com/MoOx/eslint-loader) +- [More…](https://www.npmjs.com/browse/depended/find-cache-dir) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/find-up/index.d.ts b/node_modules/find-up/index.d.ts new file mode 100644 index 0000000..6746bb7 --- /dev/null +++ b/node_modules/find-up/index.d.ts @@ -0,0 +1,138 @@ +/* eslint-disable @typescript-eslint/unified-signatures */ +import {Options as LocatePathOptions} from 'locate-path'; + +declare const stop: unique symbol; + +declare namespace findUp { + interface Options extends LocatePathOptions {} + + type StopSymbol = typeof stop; + + type Match = string | StopSymbol | undefined; +} + +declare const findUp: { + sync: { + /** + Synchronously check if a path exists. + + @param path - Path to the file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png')); + //=> true + ``` + */ + exists: (path: string) => boolean; + + /** + Synchronously find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + */ + (name: string | readonly string[], options?: findUp.Options): string | undefined; + + /** + Synchronously find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + console.log(findUp.sync(directory => { + const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + ``` + */ + (matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined; + }; + + /** + Check if a path exists. + + @param path - Path to a file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + (async () => { + console.log(await findUp.exists('/Users/sindresorhus/unicorn.png')); + //=> true + })(); + ``` + */ + exists: (path: string) => Promise; + + /** + Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`. + */ + readonly stop: findUp.StopSymbol; + + /** + Find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + + @example + ``` + // / + // └── Users + // └── sindresorhus + // ├── unicorn.png + // └── foo + // └── bar + // ├── baz + // └── example.js + + // example.js + import findUp = require('find-up'); + + (async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + })(); + ``` + */ + (name: string | readonly string[], options?: findUp.Options): Promise; + + /** + Find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + (async () => { + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + })(); + ``` + */ + (matcher: (directory: string) => (findUp.Match | Promise), options?: findUp.Options): Promise; +}; + +export = findUp; diff --git a/node_modules/find-up/index.js b/node_modules/find-up/index.js new file mode 100644 index 0000000..ce564e5 --- /dev/null +++ b/node_modules/find-up/index.js @@ -0,0 +1,89 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); +const pathExists = require('path-exists'); + +const stop = Symbol('findUp.stop'); + +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } + + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } + + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.exists = pathExists; + +module.exports.sync.exists = pathExists.sync; + +module.exports.stop = stop; diff --git a/node_modules/find-up/license b/node_modules/find-up/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/find-up/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/find-up/package.json b/node_modules/find-up/package.json new file mode 100644 index 0000000..56db6dd --- /dev/null +++ b/node_modules/find-up/package.json @@ -0,0 +1,54 @@ +{ + "name": "find-up", + "version": "5.0.0", + "description": "Find a file or directory by walking up parent directories", + "license": "MIT", + "repository": "sindresorhus/find-up", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "walk", + "walking", + "path" + ], + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "is-path-inside": "^2.1.0", + "tempy": "^0.6.0", + "tsd": "^0.13.1", + "xo": "^0.33.0" + } +} diff --git a/node_modules/find-up/readme.md b/node_modules/find-up/readme.md new file mode 100644 index 0000000..7ad908a --- /dev/null +++ b/node_modules/find-up/readme.md @@ -0,0 +1,151 @@ +# find-up [![Build Status](https://travis-ci.com/sindresorhus/find-up.svg?branch=master)](https://travis-ci.com/github/sindresorhus/find-up) + +> Find a file or directory by walking up parent directories + +## Install + +``` +$ npm install find-up +``` + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +`example.js` + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' +})(); +``` + +## API + +### findUp(name, options?) +### findUp(matcher, options?) + +Returns a `Promise` for either the path or `undefined` if it couldn't be found. + +### findUp([...name], options?) + +Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found. + +### findUp.sync(name, options?) +### findUp.sync(matcher, options?) + +Returns a path or `undefined` if it couldn't be found. + +### findUp.sync([...name], options?) + +Returns the first path found (by respecting the order of the array) or `undefined` if none could be found. + +#### name + +Type: `string` + +Name of the file or directory to find. + +#### matcher + +Type: `Function` + +A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases. + +When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path. + +#### options + +Type: `object` + +##### cwd + +Type: `string`\ +Default: `process.cwd()` + +Directory to start from. + +##### type + +Type: `string`\ +Default: `'file'`\ +Values: `'file'` `'directory'` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`\ +Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### findUp.exists(path) + +Returns a `Promise` of whether the path exists. + +### findUp.sync.exists(path) + +Returns a `boolean` of whether the path exists. + +#### path + +Type: `string` + +Path to a file or directory. + +### findUp.stop + +A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem. + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + await findUp(directory => { + return path.basename(directory) === 'work' ? findUp.stop : 'logo.png'; + }); +})(); +``` + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path + +--- + +
+ + Get professional support for 'find-up' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/flat/.travis.yml b/node_modules/flat/.travis.yml new file mode 100644 index 0000000..f35768a --- /dev/null +++ b/node_modules/flat/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "6" + - "7" + - "8" + - "10" + - "12" + - "14" diff --git a/node_modules/flat/LICENSE b/node_modules/flat/LICENSE new file mode 100644 index 0000000..d99b655 --- /dev/null +++ b/node_modules/flat/LICENSE @@ -0,0 +1,12 @@ +Copyright (c) 2014, Hugh Kennedy +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/flat/README.md b/node_modules/flat/README.md new file mode 100644 index 0000000..a036a9f --- /dev/null +++ b/node_modules/flat/README.md @@ -0,0 +1,236 @@ +# flat [![Build Status](https://secure.travis-ci.org/hughsk/flat.png?branch=master)](http://travis-ci.org/hughsk/flat) + +Take a nested Javascript object and flatten it, or unflatten an object with +delimited keys. + +## Installation + +``` bash +$ npm install flat +``` + +## Methods + +### flatten(original, options) + +Flattens the object - it'll return an object one level deep, regardless of how +nested the original object was: + +``` javascript +var flatten = require('flat') + +flatten({ + key1: { + keyA: 'valueI' + }, + key2: { + keyB: 'valueII' + }, + key3: { a: { b: { c: 2 } } } +}) + +// { +// 'key1.keyA': 'valueI', +// 'key2.keyB': 'valueII', +// 'key3.a.b.c': 2 +// } +``` + +### unflatten(original, options) + +Flattening is reversible too, you can call `flatten.unflatten()` on an object: + +``` javascript +var unflatten = require('flat').unflatten + +unflatten({ + 'three.levels.deep': 42, + 'three.levels': { + nested: true + } +}) + +// { +// three: { +// levels: { +// deep: 42, +// nested: true +// } +// } +// } +``` + +## Options + +### delimiter + +Use a custom delimiter for (un)flattening your objects, instead of `.`. + +### safe + +When enabled, both `flat` and `unflatten` will preserve arrays and their +contents. This is disabled by default. + +``` javascript +var flatten = require('flat') + +flatten({ + this: [ + { contains: 'arrays' }, + { preserving: { + them: 'for you' + }} + ] +}, { + safe: true +}) + +// { +// 'this': [ +// { contains: 'arrays' }, +// { preserving: { +// them: 'for you' +// }} +// ] +// } +``` + +### object + +When enabled, arrays will not be created automatically when calling unflatten, like so: + +``` javascript +unflatten({ + 'hello.you.0': 'ipsum', + 'hello.you.1': 'lorem', + 'hello.other.world': 'foo' +}, { object: true }) + +// hello: { +// you: { +// 0: 'ipsum', +// 1: 'lorem', +// }, +// other: { world: 'foo' } +// } +``` + +### overwrite + +When enabled, existing keys in the unflattened object may be overwritten if they cannot hold a newly encountered nested value: + +```javascript +unflatten({ + 'TRAVIS': 'true', + 'TRAVIS.DIR': '/home/travis/build/kvz/environmental' +}, { overwrite: true }) + +// TRAVIS: { +// DIR: '/home/travis/build/kvz/environmental' +// } +``` + +Without `overwrite` set to `true`, the `TRAVIS` key would already have been set to a string, thus could not accept the nested `DIR` element. + +This only makes sense on ordered arrays, and since we're overwriting data, should be used with care. + + +### maxDepth + +Maximum number of nested objects to flatten. + +``` javascript +var flatten = require('flat') + +flatten({ + key1: { + keyA: 'valueI' + }, + key2: { + keyB: 'valueII' + }, + key3: { a: { b: { c: 2 } } } +}, { maxDepth: 2 }) + +// { +// 'key1.keyA': 'valueI', +// 'key2.keyB': 'valueII', +// 'key3.a': { b: { c: 2 } } +// } +``` + +### transformKey + +Transform each part of a flat key before and after flattening. + +```javascript +var flatten = require('flat') +var unflatten = require('flat').unflatten + +flatten({ + key1: { + keyA: 'valueI' + }, + key2: { + keyB: 'valueII' + }, + key3: { a: { b: { c: 2 } } } +}, { + transformKey: function(key){ + return '__' + key + '__'; + } +}) + +// { +// '__key1__.__keyA__': 'valueI', +// '__key2__.__keyB__': 'valueII', +// '__key3__.__a__.__b__.__c__': 2 +// } + +unflatten({ + '__key1__.__keyA__': 'valueI', + '__key2__.__keyB__': 'valueII', + '__key3__.__a__.__b__.__c__': 2 +}, { + transformKey: function(key){ + return key.substring(2, key.length - 2) + } +}) + +// { +// key1: { +// keyA: 'valueI' +// }, +// key2: { +// keyB: 'valueII' +// }, +// key3: { a: { b: { c: 2 } } } +// } +``` + +## Command Line Usage + +`flat` is also available as a command line tool. You can run it with +[`npx`](https://ghub.io/npx): + +```sh +npx flat foo.json +``` + +Or install the `flat` command globally: + +```sh +npm i -g flat && flat foo.json +``` + +Accepts a filename as an argument: + +```sh +flat foo.json +``` + +Also accepts JSON on stdin: + +```sh +cat foo.json | flat +``` diff --git a/node_modules/flat/cli.js b/node_modules/flat/cli.js new file mode 100644 index 0000000..e4f96b3 --- /dev/null +++ b/node_modules/flat/cli.js @@ -0,0 +1,42 @@ +#!/usr/bin/env node + +const fs = require('fs') +const path = require('path') +const readline = require('readline') + +const flat = require('./index') + +const filepath = process.argv.slice(2)[0] +if (filepath) { + // Read from file + const file = path.resolve(process.cwd(), filepath) + fs.accessSync(file, fs.constants.R_OK) // allow to throw if not readable + out(require(file)) +} else if (process.stdin.isTTY) { + usage(0) +} else { + // Read from newline-delimited STDIN + const lines = [] + readline.createInterface({ + input: process.stdin, + output: process.stdout, + terminal: false + }) + .on('line', line => lines.push(line)) + .on('close', () => out(JSON.parse(lines.join('\n')))) +} + +function out (data) { + process.stdout.write(JSON.stringify(flat(data), null, 2)) +} + +function usage (code) { + console.log(` +Usage: + +flat foo.json +cat foo.json | flat +`) + + process.exit(code || 0) +} diff --git a/node_modules/flat/index.js b/node_modules/flat/index.js new file mode 100644 index 0000000..2a5d7ca --- /dev/null +++ b/node_modules/flat/index.js @@ -0,0 +1,158 @@ +module.exports = flatten +flatten.flatten = flatten +flatten.unflatten = unflatten + +function isBuffer (obj) { + return obj && + obj.constructor && + (typeof obj.constructor.isBuffer === 'function') && + obj.constructor.isBuffer(obj) +} + +function keyIdentity (key) { + return key +} + +function flatten (target, opts) { + opts = opts || {} + + const delimiter = opts.delimiter || '.' + const maxDepth = opts.maxDepth + const transformKey = opts.transformKey || keyIdentity + const output = {} + + function step (object, prev, currentDepth) { + currentDepth = currentDepth || 1 + Object.keys(object).forEach(function (key) { + const value = object[key] + const isarray = opts.safe && Array.isArray(value) + const type = Object.prototype.toString.call(value) + const isbuffer = isBuffer(value) + const isobject = ( + type === '[object Object]' || + type === '[object Array]' + ) + + const newKey = prev + ? prev + delimiter + transformKey(key) + : transformKey(key) + + if (!isarray && !isbuffer && isobject && Object.keys(value).length && + (!opts.maxDepth || currentDepth < maxDepth)) { + return step(value, newKey, currentDepth + 1) + } + + output[newKey] = value + }) + } + + step(target) + + return output +} + +function unflatten (target, opts) { + opts = opts || {} + + const delimiter = opts.delimiter || '.' + const overwrite = opts.overwrite || false + const transformKey = opts.transformKey || keyIdentity + const result = {} + + const isbuffer = isBuffer(target) + if (isbuffer || Object.prototype.toString.call(target) !== '[object Object]') { + return target + } + + // safely ensure that the key is + // an integer. + function getkey (key) { + const parsedKey = Number(key) + + return ( + isNaN(parsedKey) || + key.indexOf('.') !== -1 || + opts.object + ) ? key + : parsedKey + } + + function addKeys (keyPrefix, recipient, target) { + return Object.keys(target).reduce(function (result, key) { + result[keyPrefix + delimiter + key] = target[key] + + return result + }, recipient) + } + + function isEmpty (val) { + const type = Object.prototype.toString.call(val) + const isArray = type === '[object Array]' + const isObject = type === '[object Object]' + + if (!val) { + return true + } else if (isArray) { + return !val.length + } else if (isObject) { + return !Object.keys(val).length + } + } + + target = Object.keys(target).reduce(function (result, key) { + const type = Object.prototype.toString.call(target[key]) + const isObject = (type === '[object Object]' || type === '[object Array]') + if (!isObject || isEmpty(target[key])) { + result[key] = target[key] + return result + } else { + return addKeys( + key, + result, + flatten(target[key], opts) + ) + } + }, {}) + + Object.keys(target).forEach(function (key) { + const split = key.split(delimiter).map(transformKey) + let key1 = getkey(split.shift()) + let key2 = getkey(split[0]) + let recipient = result + + while (key2 !== undefined) { + if (key1 === '__proto__') { + return + } + + const type = Object.prototype.toString.call(recipient[key1]) + const isobject = ( + type === '[object Object]' || + type === '[object Array]' + ) + + // do not write over falsey, non-undefined values if overwrite is false + if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') { + return + } + + if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) { + recipient[key1] = ( + typeof key2 === 'number' && + !opts.object ? [] : {} + ) + } + + recipient = recipient[key1] + if (split.length > 0) { + key1 = getkey(split.shift()) + key2 = getkey(split[0]) + } + } + + // unflatten again for 'messy objects' + recipient[key1] = unflatten(target[key], opts) + }) + + return result +} diff --git a/node_modules/flat/package.json b/node_modules/flat/package.json new file mode 100644 index 0000000..c2fbc96 --- /dev/null +++ b/node_modules/flat/package.json @@ -0,0 +1,37 @@ +{ + "name": "flat", + "version": "5.0.2", + "main": "index.js", + "bin": "cli.js", + "scripts": { + "test": "mocha -u tdd --reporter spec && standard cli.js index.js test/index.js" + }, + "license": "BSD-3-Clause", + "description": "Take a nested Javascript object and flatten it, or unflatten an object with delimited keys", + "devDependencies": { + "mocha": "~8.1.1", + "standard": "^14.3.4" + }, + "directories": { + "test": "test" + }, + "dependencies": {}, + "repository": { + "type": "git", + "url": "git://github.com/hughsk/flat.git" + }, + "keywords": [ + "flat", + "json", + "flatten", + "unflatten", + "split", + "object", + "nested" + ], + "author": "Hugh Kennedy (http://hughskennedy.com)", + "bugs": { + "url": "https://github.com/hughsk/flat/issues" + }, + "homepage": "https://github.com/hughsk/flat" +} diff --git a/node_modules/flat/test/test.js b/node_modules/flat/test/test.js new file mode 100644 index 0000000..7f4ee3d --- /dev/null +++ b/node_modules/flat/test/test.js @@ -0,0 +1,643 @@ +/* globals suite test */ + +const assert = require('assert') +const path = require('path') +const { exec } = require('child_process') +const pkg = require('../package.json') +const flat = require('../index') + +const flatten = flat.flatten +const unflatten = flat.unflatten + +const primitives = { + String: 'good morning', + Number: 1234.99, + Boolean: true, + Date: new Date(), + null: null, + undefined: undefined +} + +suite('Flatten Primitives', function () { + Object.keys(primitives).forEach(function (key) { + const value = primitives[key] + + test(key, function () { + assert.deepStrictEqual(flatten({ + hello: { + world: value + } + }), { + 'hello.world': value + }) + }) + }) +}) + +suite('Unflatten Primitives', function () { + Object.keys(primitives).forEach(function (key) { + const value = primitives[key] + + test(key, function () { + assert.deepStrictEqual(unflatten({ + 'hello.world': value + }), { + hello: { + world: value + } + }) + }) + }) +}) + +suite('Flatten', function () { + test('Nested once', function () { + assert.deepStrictEqual(flatten({ + hello: { + world: 'good morning' + } + }), { + 'hello.world': 'good morning' + }) + }) + + test('Nested twice', function () { + assert.deepStrictEqual(flatten({ + hello: { + world: { + again: 'good morning' + } + } + }), { + 'hello.world.again': 'good morning' + }) + }) + + test('Multiple Keys', function () { + assert.deepStrictEqual(flatten({ + hello: { + lorem: { + ipsum: 'again', + dolor: 'sit' + } + }, + world: { + lorem: { + ipsum: 'again', + dolor: 'sit' + } + } + }), { + 'hello.lorem.ipsum': 'again', + 'hello.lorem.dolor': 'sit', + 'world.lorem.ipsum': 'again', + 'world.lorem.dolor': 'sit' + }) + }) + + test('Custom Delimiter', function () { + assert.deepStrictEqual(flatten({ + hello: { + world: { + again: 'good morning' + } + } + }, { + delimiter: ':' + }), { + 'hello:world:again': 'good morning' + }) + }) + + test('Empty Objects', function () { + assert.deepStrictEqual(flatten({ + hello: { + empty: { + nested: {} + } + } + }), { + 'hello.empty.nested': {} + }) + }) + + if (typeof Buffer !== 'undefined') { + test('Buffer', function () { + assert.deepStrictEqual(flatten({ + hello: { + empty: { + nested: Buffer.from('test') + } + } + }), { + 'hello.empty.nested': Buffer.from('test') + }) + }) + } + + if (typeof Uint8Array !== 'undefined') { + test('typed arrays', function () { + assert.deepStrictEqual(flatten({ + hello: { + empty: { + nested: new Uint8Array([1, 2, 3, 4]) + } + } + }), { + 'hello.empty.nested': new Uint8Array([1, 2, 3, 4]) + }) + }) + } + + test('Custom Depth', function () { + assert.deepStrictEqual(flatten({ + hello: { + world: { + again: 'good morning' + } + }, + lorem: { + ipsum: { + dolor: 'good evening' + } + } + }, { + maxDepth: 2 + }), { + 'hello.world': { + again: 'good morning' + }, + 'lorem.ipsum': { + dolor: 'good evening' + } + }) + }) + + test('Transformed Keys', function () { + assert.deepStrictEqual(flatten({ + hello: { + world: { + again: 'good morning' + } + }, + lorem: { + ipsum: { + dolor: 'good evening' + } + } + }, { + transformKey: function (key) { + return '__' + key + '__' + } + }), { + '__hello__.__world__.__again__': 'good morning', + '__lorem__.__ipsum__.__dolor__': 'good evening' + }) + }) + + test('Should keep number in the left when object', function () { + assert.deepStrictEqual(flatten({ + hello: { + '0200': 'world', + '0500': 'darkness my old friend' + } + }), { + 'hello.0200': 'world', + 'hello.0500': 'darkness my old friend' + }) + }) +}) + +suite('Unflatten', function () { + test('Nested once', function () { + assert.deepStrictEqual({ + hello: { + world: 'good morning' + } + }, unflatten({ + 'hello.world': 'good morning' + })) + }) + + test('Nested twice', function () { + assert.deepStrictEqual({ + hello: { + world: { + again: 'good morning' + } + } + }, unflatten({ + 'hello.world.again': 'good morning' + })) + }) + + test('Multiple Keys', function () { + assert.deepStrictEqual({ + hello: { + lorem: { + ipsum: 'again', + dolor: 'sit' + } + }, + world: { + greet: 'hello', + lorem: { + ipsum: 'again', + dolor: 'sit' + } + } + }, unflatten({ + 'hello.lorem.ipsum': 'again', + 'hello.lorem.dolor': 'sit', + 'world.lorem.ipsum': 'again', + 'world.lorem.dolor': 'sit', + world: { greet: 'hello' } + })) + }) + + test('nested objects do not clobber each other when a.b inserted before a', function () { + const x = {} + x['foo.bar'] = { t: 123 } + x.foo = { p: 333 } + assert.deepStrictEqual(unflatten(x), { + foo: { + bar: { + t: 123 + }, + p: 333 + } + }) + }) + + test('Custom Delimiter', function () { + assert.deepStrictEqual({ + hello: { + world: { + again: 'good morning' + } + } + }, unflatten({ + 'hello world again': 'good morning' + }, { + delimiter: ' ' + })) + }) + + test('Overwrite', function () { + assert.deepStrictEqual({ + travis: { + build: { + dir: '/home/travis/build/kvz/environmental' + } + } + }, unflatten({ + travis: 'true', + travis_build_dir: '/home/travis/build/kvz/environmental' + }, { + delimiter: '_', + overwrite: true + })) + }) + + test('Transformed Keys', function () { + assert.deepStrictEqual(unflatten({ + '__hello__.__world__.__again__': 'good morning', + '__lorem__.__ipsum__.__dolor__': 'good evening' + }, { + transformKey: function (key) { + return key.substring(2, key.length - 2) + } + }), { + hello: { + world: { + again: 'good morning' + } + }, + lorem: { + ipsum: { + dolor: 'good evening' + } + } + }) + }) + + test('Messy', function () { + assert.deepStrictEqual({ + hello: { world: 'again' }, + lorem: { ipsum: 'another' }, + good: { + morning: { + hash: { + key: { + nested: { + deep: { + and: { + even: { + deeper: { still: 'hello' } + } + } + } + } + } + }, + again: { testing: { this: 'out' } } + } + } + }, unflatten({ + 'hello.world': 'again', + 'lorem.ipsum': 'another', + 'good.morning': { + 'hash.key': { + 'nested.deep': { + 'and.even.deeper.still': 'hello' + } + } + }, + 'good.morning.again': { + 'testing.this': 'out' + } + })) + }) + + suite('Overwrite + non-object values in key positions', function () { + test('non-object keys + overwrite should be overwritten', function () { + assert.deepStrictEqual(flat.unflatten({ a: null, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) + assert.deepStrictEqual(flat.unflatten({ a: 0, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) + assert.deepStrictEqual(flat.unflatten({ a: 1, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) + assert.deepStrictEqual(flat.unflatten({ a: '', 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) + }) + + test('overwrite value should not affect undefined keys', function () { + assert.deepStrictEqual(flat.unflatten({ a: undefined, 'a.b': 'c' }, { overwrite: true }), { a: { b: 'c' } }) + assert.deepStrictEqual(flat.unflatten({ a: undefined, 'a.b': 'c' }, { overwrite: false }), { a: { b: 'c' } }) + }) + + test('if no overwrite, should ignore nested values under non-object key', function () { + assert.deepStrictEqual(flat.unflatten({ a: null, 'a.b': 'c' }), { a: null }) + assert.deepStrictEqual(flat.unflatten({ a: 0, 'a.b': 'c' }), { a: 0 }) + assert.deepStrictEqual(flat.unflatten({ a: 1, 'a.b': 'c' }), { a: 1 }) + assert.deepStrictEqual(flat.unflatten({ a: '', 'a.b': 'c' }), { a: '' }) + }) + }) + + suite('.safe', function () { + test('Should protect arrays when true', function () { + assert.deepStrictEqual(flatten({ + hello: [ + { world: { again: 'foo' } }, + { lorem: 'ipsum' } + ], + another: { + nested: [{ array: { too: 'deep' } }] + }, + lorem: { + ipsum: 'whoop' + } + }, { + safe: true + }), { + hello: [ + { world: { again: 'foo' } }, + { lorem: 'ipsum' } + ], + 'lorem.ipsum': 'whoop', + 'another.nested': [{ array: { too: 'deep' } }] + }) + }) + + test('Should not protect arrays when false', function () { + assert.deepStrictEqual(flatten({ + hello: [ + { world: { again: 'foo' } }, + { lorem: 'ipsum' } + ] + }, { + safe: false + }), { + 'hello.0.world.again': 'foo', + 'hello.1.lorem': 'ipsum' + }) + }) + + test('Empty objects should not be removed', function () { + assert.deepStrictEqual(unflatten({ + foo: [], + bar: {} + }), { foo: [], bar: {} }) + }) + }) + + suite('.object', function () { + test('Should create object instead of array when true', function () { + const unflattened = unflatten({ + 'hello.you.0': 'ipsum', + 'hello.you.1': 'lorem', + 'hello.other.world': 'foo' + }, { + object: true + }) + assert.deepStrictEqual({ + hello: { + you: { + 0: 'ipsum', + 1: 'lorem' + }, + other: { world: 'foo' } + } + }, unflattened) + assert(!Array.isArray(unflattened.hello.you)) + }) + + test('Should create object instead of array when nested', function () { + const unflattened = unflatten({ + hello: { + 'you.0': 'ipsum', + 'you.1': 'lorem', + 'other.world': 'foo' + } + }, { + object: true + }) + assert.deepStrictEqual({ + hello: { + you: { + 0: 'ipsum', + 1: 'lorem' + }, + other: { world: 'foo' } + } + }, unflattened) + assert(!Array.isArray(unflattened.hello.you)) + }) + + test('Should keep the zero in the left when object is true', function () { + const unflattened = unflatten({ + 'hello.0200': 'world', + 'hello.0500': 'darkness my old friend' + }, { + object: true + }) + + assert.deepStrictEqual({ + hello: { + '0200': 'world', + '0500': 'darkness my old friend' + } + }, unflattened) + }) + + test('Should not create object when false', function () { + const unflattened = unflatten({ + 'hello.you.0': 'ipsum', + 'hello.you.1': 'lorem', + 'hello.other.world': 'foo' + }, { + object: false + }) + assert.deepStrictEqual({ + hello: { + you: ['ipsum', 'lorem'], + other: { world: 'foo' } + } + }, unflattened) + assert(Array.isArray(unflattened.hello.you)) + }) + }) + + if (typeof Buffer !== 'undefined') { + test('Buffer', function () { + assert.deepStrictEqual(unflatten({ + 'hello.empty.nested': Buffer.from('test') + }), { + hello: { + empty: { + nested: Buffer.from('test') + } + } + }) + }) + } + + if (typeof Uint8Array !== 'undefined') { + test('typed arrays', function () { + assert.deepStrictEqual(unflatten({ + 'hello.empty.nested': new Uint8Array([1, 2, 3, 4]) + }), { + hello: { + empty: { + nested: new Uint8Array([1, 2, 3, 4]) + } + } + }) + }) + } + + test('should not pollute prototype', function () { + unflatten({ + '__proto__.polluted': true + }) + unflatten({ + 'prefix.__proto__.polluted': true + }) + unflatten({ + 'prefix.0.__proto__.polluted': true + }) + + assert.notStrictEqual({}.polluted, true) + }) +}) + +suite('Arrays', function () { + test('Should be able to flatten arrays properly', function () { + assert.deepStrictEqual({ + 'a.0': 'foo', + 'a.1': 'bar' + }, flatten({ + a: ['foo', 'bar'] + })) + }) + + test('Should be able to revert and reverse array serialization via unflatten', function () { + assert.deepStrictEqual({ + a: ['foo', 'bar'] + }, unflatten({ + 'a.0': 'foo', + 'a.1': 'bar' + })) + }) + + test('Array typed objects should be restored by unflatten', function () { + assert.strictEqual( + Object.prototype.toString.call(['foo', 'bar']) + , Object.prototype.toString.call(unflatten({ + 'a.0': 'foo', + 'a.1': 'bar' + }).a) + ) + }) + + test('Do not include keys with numbers inside them', function () { + assert.deepStrictEqual(unflatten({ + '1key.2_key': 'ok' + }), { + '1key': { + '2_key': 'ok' + } + }) + }) +}) + +suite('Order of Keys', function () { + test('Order of keys should not be changed after round trip flatten/unflatten', function () { + const obj = { + b: 1, + abc: { + c: [{ + d: 1, + bca: 1, + a: 1 + }] + }, + a: 1 + } + const result = unflatten( + flatten(obj) + ) + + assert.deepStrictEqual(Object.keys(obj), Object.keys(result)) + assert.deepStrictEqual(Object.keys(obj.abc), Object.keys(result.abc)) + assert.deepStrictEqual(Object.keys(obj.abc.c[0]), Object.keys(result.abc.c[0])) + }) +}) + +suite('CLI', function () { + test('can take filename', function (done) { + const cli = path.resolve(__dirname, '..', pkg.bin) + const pkgJSON = path.resolve(__dirname, '..', 'package.json') + exec(`${cli} ${pkgJSON}`, (err, stdout, stderr) => { + assert.ifError(err) + assert.strictEqual(stdout.trim(), JSON.stringify(flatten(pkg), null, 2)) + done() + }) + }) + + test('exits with usage if no file', function (done) { + const cli = path.resolve(__dirname, '..', pkg.bin) + const pkgJSON = path.resolve(__dirname, '..', 'package.json') + exec(`${cli} ${pkgJSON}`, (err, stdout, stderr) => { + assert.ifError(err) + assert.strictEqual(stdout.trim(), JSON.stringify(flatten(pkg), null, 2)) + done() + }) + }) + + test('can take piped file', function (done) { + const cli = path.resolve(__dirname, '..', pkg.bin) + const pkgJSON = path.resolve(__dirname, '..', 'package.json') + exec(`cat ${pkgJSON} | ${cli}`, (err, stdout, stderr) => { + assert.ifError(err) + assert.strictEqual(stdout.trim(), JSON.stringify(flatten(pkg), null, 2)) + done() + }) + }) +}) diff --git a/node_modules/follow-redirects/LICENSE b/node_modules/follow-redirects/LICENSE new file mode 100644 index 0000000..742cbad --- /dev/null +++ b/node_modules/follow-redirects/LICENSE @@ -0,0 +1,18 @@ +Copyright 2014–present Olivier Lalonde , James Talmage , Ruben Verborgh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/follow-redirects/README.md b/node_modules/follow-redirects/README.md new file mode 100644 index 0000000..eb869a6 --- /dev/null +++ b/node_modules/follow-redirects/README.md @@ -0,0 +1,155 @@ +## Follow Redirects + +Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects. + +[![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) +[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions) +[![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master) +[![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects) +[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh) + +`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback) + methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback) + modules, with the exception that they will seamlessly follow redirects. + +```javascript +const { http, https } = require('follow-redirects'); + +http.get('http://bit.ly/900913', response => { + response.on('data', chunk => { + console.log(chunk); + }); +}).on('error', err => { + console.error(err); +}); +``` + +You can inspect the final redirected URL through the `responseUrl` property on the `response`. +If no redirection happened, `responseUrl` is the original request URL. + +```javascript +const request = https.request({ + host: 'bitly.com', + path: '/UHfDGO', +}, response => { + console.log(response.responseUrl); + // 'http://duckduckgo.com/robots.txt' +}); +request.end(); +``` + +## Options +### Global options +Global options are set directly on the `follow-redirects` module: + +```javascript +const followRedirects = require('follow-redirects'); +followRedirects.maxRedirects = 10; +followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB +``` + +The following global options are supported: + +- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. + +- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. + +### Per-request options +Per-request options are set by passing an `options` object: + +```javascript +const url = require('url'); +const { http, https } = require('follow-redirects'); + +const options = url.parse('http://bit.ly/900913'); +options.maxRedirects = 10; +options.beforeRedirect = (options, response, request) => { + // Use this to adjust the request options upon redirecting, + // to inspect the latest response headers, + // or to cancel the request by throwing an error + + // response.headers = the redirect response headers + // response.statusCode = the redirect response code (eg. 301, 307, etc.) + + // request.url = the requested URL that resulted in a redirect + // request.headers = the headers in the request that resulted in a redirect + // request.method = the method of the request that resulted in a redirect + if (options.hostname === "example.com") { + options.auth = "user:password"; + } +}; +http.request(options); +``` + +In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback), +the following per-request options are supported: +- `followRedirects` (default: `true`) – whether redirects should be followed. + +- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted. + +- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted. + +- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error. + +- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }` + +- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object. + + +### Advanced usage +By default, `follow-redirects` will use the Node.js default implementations +of [`http`](https://nodejs.org/api/http.html) +and [`https`](https://nodejs.org/api/https.html). +To enable features such as caching and/or intermediate request tracking, +you might instead want to wrap `follow-redirects` around custom protocol implementations: + +```javascript +const { http, https } = require('follow-redirects').wrap({ + http: require('your-custom-http'), + https: require('your-custom-https'), +}); +``` + +Such custom protocols only need an implementation of the `request` method. + +## Browser Usage + +Due to the way the browser works, +the `http` and `https` browser equivalents perform redirects by default. + +By requiring `follow-redirects` this way: +```javascript +const http = require('follow-redirects/http'); +const https = require('follow-redirects/https'); +``` +you can easily tell webpack and friends to replace +`follow-redirect` by the built-in versions: + +```json +{ + "follow-redirects/http" : "http", + "follow-redirects/https" : "https" +} +``` + +## Contributing + +Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues) + detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied + by tests. You can run the test suite locally with a simple `npm test` command. + +## Debug Logging + +`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging + set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test + suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well. + +## Authors + +- [Ruben Verborgh](https://ruben.verborgh.org/) +- [Olivier Lalonde](mailto:olalonde@gmail.com) +- [James Talmage](mailto:james@talmage.io) + +## License + +[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE) diff --git a/node_modules/follow-redirects/debug.js b/node_modules/follow-redirects/debug.js new file mode 100644 index 0000000..decb77d --- /dev/null +++ b/node_modules/follow-redirects/debug.js @@ -0,0 +1,15 @@ +var debug; + +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = require("debug")("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; + } + } + debug.apply(null, arguments); +}; diff --git a/node_modules/follow-redirects/http.js b/node_modules/follow-redirects/http.js new file mode 100644 index 0000000..695e356 --- /dev/null +++ b/node_modules/follow-redirects/http.js @@ -0,0 +1 @@ +module.exports = require("./").http; diff --git a/node_modules/follow-redirects/https.js b/node_modules/follow-redirects/https.js new file mode 100644 index 0000000..d21c921 --- /dev/null +++ b/node_modules/follow-redirects/https.js @@ -0,0 +1 @@ +module.exports = require("./").https; diff --git a/node_modules/follow-redirects/index.js b/node_modules/follow-redirects/index.js new file mode 100644 index 0000000..a30b32c --- /dev/null +++ b/node_modules/follow-redirects/index.js @@ -0,0 +1,686 @@ +var url = require("url"); +var URL = url.URL; +var http = require("http"); +var https = require("https"); +var Writable = require("stream").Writable; +var assert = require("assert"); +var debug = require("./debug"); + +// Preventive platform detection +// istanbul ignore next +(function detectUnsupportedEnvironment() { + var looksLikeNode = typeof process !== "undefined"; + var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var looksLikeV8 = isFunction(Error.captureStackTrace); + if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { + console.warn("The follow-redirects package should be excluded from browser builds."); + } +}()); + +// Whether to use the native URL object or the legacy url module +var useNativeURL = false; +try { + assert(new URL("")); +} +catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; +} + +// URL fields to preserve in copy operations +var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash", +]; + +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); + +// Error types with codes +var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError +); +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded", + RedirectionError +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); + +// istanbul ignore next +var destroy = Writable.prototype.destroy || noop; + +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; + + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); + } + + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + try { + self._processResponse(response); + } + catch (cause) { + self.emit("error", cause instanceof RedirectionError ? + cause : new RedirectionError({ cause: cause })); + } + }; + + // Perform the first request + this._performRequest(); +} +RedirectableRequest.prototype = Object.create(Writable.prototype); + +RedirectableRequest.prototype.abort = function () { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); +}; + +RedirectableRequest.prototype.destroy = function (error) { + destroyRequest(this._currentRequest, error); + destroy.call(this, error); + return this; +}; + +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); + } + + // Validate input and shift parameters if necessary + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); + } + return; + } + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); + } + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } +}; + +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (isFunction(data)) { + callback = data; + data = encoding = null; + } + else if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } +}; + +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; + +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; + +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; + + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } + + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; + } + + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + self.removeListener("close", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } + + // Attach callback if passed + if (callback) { + this.on("timeout", callback); + } + + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); + } + + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + this.on("close", clearTimer); + + return this; +}; + +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); + +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); + +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } + + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; + } + + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } +}; + + +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); + } + + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } + + // Create the native request and set up its event handlers + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } + + // RFC7230§5.3.1: When making a request directly to an origin server, […] + // a client MUST send only the absolute path […] as the request-target. + this._currentUrl = /^\//.test(this._options.path) ? + url.format(this._options) : + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._options.path; + + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + // istanbul ignore else + if (request === self._currentRequest) { + // Report any write errors + // istanbul ignore if + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + // istanbul ignore else + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } + } + }()); + } +}; + +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } + + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. + + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); + + // Clean up + this._requestBodyBuffers = []; + return; + } + + // The response is a redirect, so abort the current request + destroyRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); + + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); + } + + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); + } + + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } + + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); + + // Create the redirected request + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); + this._isRedirect = true; + spreadUrlObject(redirectUrl, this._options); + + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrl.protocol !== currentUrlParts.protocol && + redirectUrl.protocol !== "https:" || + redirectUrl.host !== currentHost && + !isSubdomain(redirectUrl.host, currentHost)) { + removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); + } + + // Evaluate the beforeRedirect callback + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + beforeRedirect(this._options, responseDetails, requestDetails); + this._sanitizeOptions(this._options); + } + + // Perform the redirected request + this._performRequest(); +}; + +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; + + // Wrap each protocol + var nativeProtocols = {}; + Object.keys(protocols).forEach(function (scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); + + // Executes a request, following redirects + function request(input, options, callback) { + // Parse parameters, ensuring that input is an object + if (isURL(input)) { + input = spreadUrlObject(input); + } + else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } + else { + callback = options; + options = validateUrl(input); + input = { protocol: protocol }; + } + if (isFunction(options)) { + callback = options; + options = null; + } + + // Set defaults + options = Object.assign({ + maxRedirects: exports.maxRedirects, + maxBodyLength: exports.maxBodyLength, + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; + } + + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } + + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } + + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; +} + +function noop() { /* empty */ } + +function parseUrl(input) { + var parsed; + // istanbul ignore else + if (useNativeURL) { + parsed = new URL(input); + } + else { + // Ensure the URL is valid and absolute + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } + } + return parsed; +} + +function resolveUrl(relative, base) { + // istanbul ignore next + return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); +} + +function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); + } + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; +} + +function spreadUrlObject(urlObject, target) { + var spread = target || {}; + for (var key of preservedUrlFields) { + spread[key] = urlObject[key]; + } + + // Fix IPv6 hostname + if (spread.hostname.startsWith("[")) { + spread.hostname = spread.hostname.slice(1, -1); + } + // Ensure port is a number + if (spread.port !== "") { + spread.port = Number(spread.port); + } + // Concatenate path + spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; + + return spread; +} + +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); +} + +function createErrorType(code, message, baseClass) { + // Create constructor + function CustomError(properties) { + // istanbul ignore else + if (isFunction(Error.captureStackTrace)) { + Error.captureStackTrace(this, this.constructor); + } + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; + } + + // Attach constructor and set default properties + CustomError.prototype = new (baseClass || Error)(); + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false, + }, + name: { + value: "Error [" + code + "]", + enumerable: false, + }, + }); + return CustomError; +} + +function destroyRequest(request, error) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error); +} + +function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} + +function isString(value) { + return typeof value === "string" || value instanceof String; +} + +function isFunction(value) { + return typeof value === "function"; +} + +function isBuffer(value) { + return typeof value === "object" && ("length" in value); +} + +function isURL(value) { + return URL && value instanceof URL; +} + +// Exports +module.exports = wrap({ http: http, https: https }); +module.exports.wrap = wrap; diff --git a/node_modules/follow-redirects/package.json b/node_modules/follow-redirects/package.json new file mode 100644 index 0000000..a2689fa --- /dev/null +++ b/node_modules/follow-redirects/package.json @@ -0,0 +1,58 @@ +{ + "name": "follow-redirects", + "version": "1.15.11", + "description": "HTTP and HTTPS modules that follow redirects.", + "license": "MIT", + "main": "index.js", + "files": [ + "*.js" + ], + "engines": { + "node": ">=4.0" + }, + "scripts": { + "lint": "eslint *.js test", + "test": "nyc mocha" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git" + }, + "homepage": "https://github.com/follow-redirects/follow-redirects", + "bugs": { + "url": "https://github.com/follow-redirects/follow-redirects/issues" + }, + "keywords": [ + "http", + "https", + "url", + "redirect", + "client", + "location", + "utility" + ], + "author": "Ruben Verborgh (https://ruben.verborgh.org/)", + "contributors": [ + "Olivier Lalonde (http://www.syskall.com)", + "James Talmage " + ], + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "peerDependenciesMeta": { + "debug": { + "optional": true + } + }, + "devDependencies": { + "concat-stream": "^2.0.0", + "eslint": "^5.16.0", + "express": "^4.16.4", + "lolex": "^3.1.0", + "mocha": "^6.0.2", + "nyc": "^14.1.1" + } +} diff --git a/node_modules/foreground-child/LICENSE b/node_modules/foreground-child/LICENSE new file mode 100644 index 0000000..2d80720 --- /dev/null +++ b/node_modules/foreground-child/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2015-2023 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/foreground-child/README.md b/node_modules/foreground-child/README.md new file mode 100644 index 0000000..477ca57 --- /dev/null +++ b/node_modules/foreground-child/README.md @@ -0,0 +1,128 @@ +# foreground-child + +Run a child as if it's the foreground process. Give it stdio. Exit +when it exits. + +Mostly this module is here to support some use cases around +wrapping child processes for test coverage and such. But it's +also generally useful any time you want one program to execute +another as if it's the "main" process, for example, if a program +takes a `--cmd` argument to execute in some way. + +## USAGE + +```js +import { foregroundChild } from 'foreground-child' +// hybrid module, this also works: +// const { foregroundChild } = require('foreground-child') + +// cats out this file +const child = foregroundChild('cat', [__filename]) + +// At this point, it's best to just do nothing else. +// return or whatever. +// If the child gets a signal, or just exits, then this +// parent process will exit in the same way. +``` + +You can provide custom spawn options by passing an object after +the program and arguments: + +```js +const child = foregroundChild(`cat ${__filename}`, { shell: true }) +``` + +A callback can optionally be provided, if you want to perform an +action before your foreground-child exits: + +```js +const child = foregroundChild('cat', [__filename], spawnOptions, () => { + doSomeActions() +}) +``` + +The callback can return a Promise in order to perform +asynchronous actions. If the callback does not return a promise, +then it must complete its actions within a single JavaScript +tick. + +```js +const child = foregroundChild('cat', [__filename], async () => { + await doSomeAsyncActions() +}) +``` + +If the callback throws or rejects, then it will be unhandled, and +node will exit in error. + +If the callback returns a string value, then that will be used as +the signal to exit the parent process. If it returns a number, +then that number will be used as the parent exit status code. If +it returns boolean `false`, then the parent process will not be +terminated. If it returns `undefined`, then it will exit with the +same signal/code as the child process. + +## Caveats + +The "normal" standard IO file descriptors (0, 1, and 2 for stdin, +stdout, and stderr respectively) are shared with the child process. +Additionally, if there is an IPC channel set up in the parent, then +messages are proxied to the child on file descriptor 3. + +In Node, it's possible to also map arbitrary file descriptors +into a child process. In these cases, foreground-child will not +map the file descriptors into the child. If file descriptors 0, +1, or 2 are used for the IPC channel, then strange behavior may +happen (like printing IPC messages to stderr, for example). + +Note that a SIGKILL will always kill the parent process, but +will not proxy the signal to the child process, because SIGKILL +cannot be caught. In order to address this, a special "watchdog" +child process is spawned which will send a SIGKILL to the child +process if it does not terminate within half a second after the +watchdog receives a SIGHUP due to its parent terminating. + +On Windows, issuing a `process.kill(process.pid, signal)` with a +fatal termination signal may cause the process to exit with a `1` +status code rather than reporting the signal properly. This +module tries to do the right thing, but on Windows systems, you +may see that incorrect result. There is as far as I'm aware no +workaround for this. + +## util: `foreground-child/proxy-signals` + +If you just want to proxy the signals to a child process that the +main process receives, you can use the `proxy-signals` export +from this package. + +```js +import { proxySignals } from 'foreground-child/proxy-signals' + +const childProcess = spawn('command', ['some', 'args']) +proxySignals(childProcess) +``` + +Now, any fatal signal received by the current process will be +proxied to the child process. + +It doesn't go in the other direction; ie, signals sent to the +child process will not affect the parent. For that, listen to the +child `exit` or `close` events, and handle them appropriately. + +## util: `foreground-child/watchdog` + +If you are spawning a child process, and want to ensure that it +isn't left dangling if the parent process exits, you can use the +watchdog utility exported by this module. + +```js +import { watchdog } from 'foreground-child/watchdog' + +const childProcess = spawn('command', ['some', 'args']) +const watchdogProcess = watchdog(childProcess) + +// watchdogProcess is a reference to the process monitoring the +// parent and child. There's usually no reason to do anything +// with it, as it's silent and will terminate +// automatically when it's no longer needed. +``` diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.d.ts b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts new file mode 100644 index 0000000..ecc0a62 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts @@ -0,0 +1,2 @@ +export declare const allSignals: NodeJS.Signals[]; +//# sourceMappingURL=all-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map new file mode 100644 index 0000000..cd1c161 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,EAShB,MAAM,CAAC,OAAO,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.js b/node_modules/foreground-child/dist/commonjs/all-signals.js new file mode 100644 index 0000000..1692af0 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.js @@ -0,0 +1,58 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.allSignals = void 0; +const node_constants_1 = __importDefault(require("node:constants")); +exports.allSignals = +// this is the full list of signals that Node will let us do anything with +Object.keys(node_constants_1.default).filter(k => k.startsWith('SIG') && + // https://github.com/tapjs/signal-exit/issues/21 + k !== 'SIGPROF' && + // no sense trying to listen for SIGKILL, it's impossible + k !== 'SIGKILL'); +// These are some obscure signals that are reported by kill -l +// on macOS, Linux, or Windows, but which don't have any mapping +// in Node.js. No sense trying if they're just going to throw +// every time on every platform. +// +// 'SIGEMT', +// 'SIGLOST', +// 'SIGPOLL', +// 'SIGRTMAX', +// 'SIGRTMAX-1', +// 'SIGRTMAX-10', +// 'SIGRTMAX-11', +// 'SIGRTMAX-12', +// 'SIGRTMAX-13', +// 'SIGRTMAX-14', +// 'SIGRTMAX-15', +// 'SIGRTMAX-2', +// 'SIGRTMAX-3', +// 'SIGRTMAX-4', +// 'SIGRTMAX-5', +// 'SIGRTMAX-6', +// 'SIGRTMAX-7', +// 'SIGRTMAX-8', +// 'SIGRTMAX-9', +// 'SIGRTMIN', +// 'SIGRTMIN+1', +// 'SIGRTMIN+10', +// 'SIGRTMIN+11', +// 'SIGRTMIN+12', +// 'SIGRTMIN+13', +// 'SIGRTMIN+14', +// 'SIGRTMIN+15', +// 'SIGRTMIN+16', +// 'SIGRTMIN+2', +// 'SIGRTMIN+3', +// 'SIGRTMIN+4', +// 'SIGRTMIN+5', +// 'SIGRTMIN+6', +// 'SIGRTMIN+7', +// 'SIGRTMIN+8', +// 'SIGRTMIN+9', +// 'SIGSTKFLT', +// 'SIGUNUSED', +//# sourceMappingURL=all-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/all-signals.js.map b/node_modules/foreground-child/dist/commonjs/all-signals.js.map new file mode 100644 index 0000000..51c056d --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/all-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.js","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":";;;;;;AAAA,oEAAsC;AACzB,QAAA,UAAU;AACrB,0EAA0E;AAC1E,MAAM,CAAC,IAAI,CAAC,wBAAS,CAAC,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,CACF,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;IACnB,iDAAiD;IACjD,CAAC,KAAK,SAAS;IACf,yDAAyD;IACzD,CAAC,KAAK,SAAS,CACE,CAAA;AAEvB,8DAA8D;AAC9D,gEAAgE;AAChE,6DAA6D;AAC7D,gCAAgC;AAChC,EAAE;AACF,YAAY;AACZ,aAAa;AACb,aAAa;AACb,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,eAAe;AACf,eAAe","sourcesContent":["import constants from 'node:constants'\nexport const allSignals =\n // this is the full list of signals that Node will let us do anything with\n Object.keys(constants).filter(\n k =>\n k.startsWith('SIG') &&\n // https://github.com/tapjs/signal-exit/issues/21\n k !== 'SIGPROF' &&\n // no sense trying to listen for SIGKILL, it's impossible\n k !== 'SIGKILL',\n ) as NodeJS.Signals[]\n\n// These are some obscure signals that are reported by kill -l\n// on macOS, Linux, or Windows, but which don't have any mapping\n// in Node.js. No sense trying if they're just going to throw\n// every time on every platform.\n//\n// 'SIGEMT',\n// 'SIGLOST',\n// 'SIGPOLL',\n// 'SIGRTMAX',\n// 'SIGRTMAX-1',\n// 'SIGRTMAX-10',\n// 'SIGRTMAX-11',\n// 'SIGRTMAX-12',\n// 'SIGRTMAX-13',\n// 'SIGRTMAX-14',\n// 'SIGRTMAX-15',\n// 'SIGRTMAX-2',\n// 'SIGRTMAX-3',\n// 'SIGRTMAX-4',\n// 'SIGRTMAX-5',\n// 'SIGRTMAX-6',\n// 'SIGRTMAX-7',\n// 'SIGRTMAX-8',\n// 'SIGRTMAX-9',\n// 'SIGRTMIN',\n// 'SIGRTMIN+1',\n// 'SIGRTMIN+10',\n// 'SIGRTMIN+11',\n// 'SIGRTMIN+12',\n// 'SIGRTMIN+13',\n// 'SIGRTMIN+14',\n// 'SIGRTMIN+15',\n// 'SIGRTMIN+16',\n// 'SIGRTMIN+2',\n// 'SIGRTMIN+3',\n// 'SIGRTMIN+4',\n// 'SIGRTMIN+5',\n// 'SIGRTMIN+6',\n// 'SIGRTMIN+7',\n// 'SIGRTMIN+8',\n// 'SIGRTMIN+9',\n// 'SIGSTKFLT',\n// 'SIGUNUSED',\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.d.ts b/node_modules/foreground-child/dist/commonjs/index.d.ts new file mode 100644 index 0000000..d15b38e --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.d.ts @@ -0,0 +1,58 @@ +import { ChildProcessByStdio, SpawnOptions, ChildProcess } from 'child_process'; +/** + * The signature for the cleanup method. + * + * Arguments indicate the exit status of the child process. + * + * If a Promise is returned, then the process is not terminated + * until it resolves, and the resolution value is treated as the + * exit status (if a number) or signal exit (if a signal string). + * + * If `undefined` is returned, then no change is made, and the parent + * exits in the same way that the child exited. + * + * If boolean `false` is returned, then the parent's exit is canceled. + * + * If a number is returned, then the parent process exits with the number + * as its exitCode. + * + * If a signal string is returned, then the parent process is killed with + * the same signal that caused the child to exit. + */ +export type Cleanup = (code: number | null, signal: null | NodeJS.Signals, processInfo: { + watchdogPid?: ChildProcess['pid']; +}) => void | undefined | number | NodeJS.Signals | false | Promise; +export type FgArgs = [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup] | [ + program: [cmd: string, ...args: string[]], + opts?: SpawnOptions, + cleanup?: Cleanup +] | [program: string, cleanup?: Cleanup] | [program: string, opts?: SpawnOptions, cleanup?: Cleanup] | [program: string, args?: string[], cleanup?: Cleanup] | [ + program: string, + args?: string[], + opts?: SpawnOptions, + cleanup?: Cleanup +]; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +export declare const normalizeFgArgs: (fgArgs: FgArgs) => [program: string, args: string[], spawnOpts: SpawnOptions, cleanup: Cleanup]; +/** + * Spawn the specified program as a "foreground" process, or at least as + * close as is possible given node's lack of exec-without-fork. + * + * Cleanup method may be used to modify or ignore the result of the child's + * exit code or signal. If cleanup returns undefined (or a Promise that + * resolves to undefined), then the parent will exit in the same way that + * the child did. + * + * Return boolean `false` to prevent the parent's exit entirely. + */ +export declare function foregroundChild(cmd: string | [cmd: string, ...args: string[]], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.d.ts.map b/node_modules/foreground-child/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..b26fecd --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAInB,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAA;AAUtB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,OAAO,GAAG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UG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.js b/node_modules/foreground-child/dist/commonjs/index.js new file mode 100644 index 0000000..6db65c6 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.js @@ -0,0 +1,123 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.normalizeFgArgs = void 0; +exports.foregroundChild = foregroundChild; +const child_process_1 = require("child_process"); +const cross_spawn_1 = __importDefault(require("cross-spawn")); +const signal_exit_1 = require("signal-exit"); +const proxy_signals_js_1 = require("./proxy-signals.js"); +const watchdog_js_1 = require("./watchdog.js"); +/* c8 ignore start */ +const spawn = process?.platform === 'win32' ? cross_spawn_1.default : child_process_1.spawn; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +const normalizeFgArgs = (fgArgs) => { + let [program, args = [], spawnOpts = {}, cleanup = () => { }] = fgArgs; + if (typeof args === 'function') { + cleanup = args; + spawnOpts = {}; + args = []; + } + else if (!!args && typeof args === 'object' && !Array.isArray(args)) { + if (typeof spawnOpts === 'function') + cleanup = spawnOpts; + spawnOpts = args; + args = []; + } + else if (typeof spawnOpts === 'function') { + cleanup = spawnOpts; + spawnOpts = {}; + } + if (Array.isArray(program)) { + const [pp, ...pa] = program; + program = pp; + args = pa; + } + return [program, args, { ...spawnOpts }, cleanup]; +}; +exports.normalizeFgArgs = normalizeFgArgs; +function foregroundChild(...fgArgs) { + const [program, args, spawnOpts, cleanup] = (0, exports.normalizeFgArgs)(fgArgs); + spawnOpts.stdio = [0, 1, 2]; + if (process.send) { + spawnOpts.stdio.push('ipc'); + } + const child = spawn(program, args, spawnOpts); + const childHangup = () => { + try { + child.kill('SIGHUP'); + /* c8 ignore start */ + } + catch (_) { + // SIGHUP is weird on windows + child.kill('SIGTERM'); + } + /* c8 ignore stop */ + }; + const removeOnExit = (0, signal_exit_1.onExit)(childHangup); + (0, proxy_signals_js_1.proxySignals)(child); + const dog = (0, watchdog_js_1.watchdog)(child); + let done = false; + child.on('close', async (code, signal) => { + /* c8 ignore start */ + if (done) + return; + /* c8 ignore stop */ + done = true; + const result = cleanup(code, signal, { + watchdogPid: dog.pid, + }); + const res = isPromise(result) ? await result : result; + removeOnExit(); + if (res === false) + return; + else if (typeof res === 'string') { + signal = res; + code = null; + } + else if (typeof res === 'number') { + code = res; + signal = null; + } + if (signal) { + // If there is nothing else keeping the event loop alive, + // then there's a race between a graceful exit and getting + // the signal to this process. Put this timeout here to + // make sure we're still alive to get the signal, and thus + // exit with the intended signal code. + /* istanbul ignore next */ + setTimeout(() => { }, 2000); + try { + process.kill(process.pid, signal); + /* c8 ignore start */ + } + catch (_) { + process.kill(process.pid, 'SIGTERM'); + } + /* c8 ignore stop */ + } + else { + process.exit(code || 0); + } + }); + if (process.send) { + process.removeAllListeners('message'); + child.on('message', (message, sendHandle) => { + process.send?.(message, sendHandle); + }); + process.on('message', (message, sendHandle) => { + child.send(message, sendHandle); + }); + } + return child; +} +const isPromise = (o) => !!o && typeof o === 'object' && typeof o.then === 'function'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/index.js.map b/node_modules/foreground-child/dist/commonjs/index.js.map new file mode 100644 index 0000000..56037c8 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAuIA,0CAyFC;AAhOD,iDAOsB;AACtB,8DAAoC;AACpC,6CAAoC;AACpC,yDAAiD;AACjD,+CAAwC;AAExC,qBAAqB;AACrB,MAAM,KAAK,GAAG,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAU,CAAC,CAAC,CAAC,qBAAS,CAAA;AAsDpE;;;;;;GAMG;AACI,MAAM,eAAe,GAAG,CAC7B,MAAc,EAMd,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC,GAAG,MAAM,CAAA;IACrE,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,GAAG,IAAI,CAAA;QACd,SAAS,GAAG,EAAE,CAAA;QACd,IAAI,GAAG,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,IAAI,OAAO,SAAS,KAAK,UAAU;YAAE,OAAO,GAAG,S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BACX,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YACtC,CAAC;YACD,oBAAoB;QACtB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAErC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC5C,KAAK,CAAC,IAAI,CACR,OAAuB,EACvB,UAAoC,CACrC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,CAAM,EAAqB,EAAE,CAC9C,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAA","sourcesContent":["import {\n ChildProcessByStdio,\n SendHandle,\n Serializable,\n spawn as nodeSpawn,\n SpawnOptions,\n ChildProcess,\n} from 'child_process'\nimport crossSpawn from 'cross-spawn'\nimport { onExit } from 'signal-exit'\nimport { proxySignals } from './proxy-signals.js'\nimport { watchdog } from './watchdog.js'\n\n/* c8 ignore start */\nconst spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn\n/* c8 ignore stop */\n\n/**\n * The signature for the cleanup method.\n *\n * Arguments indicate the exit status of the child process.\n *\n * If a Promise is returned, then the process is not terminated\n * until it resolves, and the resolution value is treated as the\n * exit status (if a number) or signal exit (if a signal string).\n *\n * If `undefined` is returned, then no change is made, and the parent\n * exits in the same way that the child exited.\n *\n * If boolean `false` is returned, then the parent's exit is canceled.\n *\n * If a number is returned, then the parent process exits with the number\n * as its exitCode.\n *\n * If a signal string is returned, then the parent process is killed with\n * the same signal that caused the child to exit.\n */\nexport type Cleanup = (\n code: number | null,\n signal: null | NodeJS.Signals,\n processInfo: {\n watchdogPid?: ChildProcess['pid']\n },\n) =>\n | void\n | undefined\n | number\n | NodeJS.Signals\n | false\n | Promise\n\nexport type FgArgs =\n | [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup]\n | [\n program: [cmd: string, ...args: string[]],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n | [program: string, cleanup?: Cleanup]\n | [program: string, opts?: SpawnOptions, cleanup?: Cleanup]\n | [program: string, args?: string[], cleanup?: Cleanup]\n | [\n program: string,\n args?: string[],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n\n/**\n * Normalizes the arguments passed to `foregroundChild`.\n *\n * Exposed for testing.\n *\n * @internal\n */\nexport const normalizeFgArgs = (\n fgArgs: FgArgs,\n): [\n program: string,\n args: string[],\n spawnOpts: SpawnOptions,\n cleanup: Cleanup,\n] => {\n let [program, args = [], spawnOpts = {}, cleanup = () => {}] = fgArgs\n if (typeof args === 'function') {\n cleanup = args\n spawnOpts = {}\n args = []\n } else if (!!args && typeof args === 'object' && !Array.isArray(args)) {\n if (typeof spawnOpts === 'function') cleanup = spawnOpts\n spawnOpts = args\n args = []\n } else if (typeof spawnOpts === 'function') {\n cleanup = spawnOpts\n spawnOpts = {}\n }\n if (Array.isArray(program)) {\n const [pp, ...pa] = program\n program = pp\n args = pa\n }\n return [program, args, { ...spawnOpts }, cleanup]\n}\n\n/**\n * Spawn the specified program as a \"foreground\" process, or at least as\n * close as is possible given node's lack of exec-without-fork.\n *\n * Cleanup method may be used to modify or ignore the result of the child's\n * exit code or signal. If cleanup returns undefined (or a Promise that\n * resolves to undefined), then the parent will exit in the same way that\n * the child did.\n *\n * Return boolean `false` to prevent the parent's exit entirely.\n */\nexport function foregroundChild(\n cmd: string | [cmd: string, ...args: string[]],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n ...fgArgs: FgArgs\n): ChildProcessByStdio {\n const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs)\n\n spawnOpts.stdio = [0, 1, 2]\n if (process.send) {\n spawnOpts.stdio.push('ipc')\n }\n\n const child = spawn(program, args, spawnOpts) as ChildProcessByStdio<\n null,\n null,\n null\n >\n\n const childHangup = () => {\n try {\n child.kill('SIGHUP')\n\n /* c8 ignore start */\n } catch (_) {\n // SIGHUP is weird on windows\n child.kill('SIGTERM')\n }\n /* c8 ignore stop */\n }\n const removeOnExit = onExit(childHangup)\n\n proxySignals(child)\n const dog = watchdog(child)\n\n let done = false\n child.on('close', async (code, signal) => {\n /* c8 ignore start */\n if (done) return\n /* c8 ignore stop */\n done = true\n const result = cleanup(code, signal, {\n watchdogPid: dog.pid,\n })\n const res = isPromise(result) ? await result : result\n removeOnExit()\n\n if (res === false) return\n else if (typeof res === 'string') {\n signal = res\n code = null\n } else if (typeof res === 'number') {\n code = res\n signal = null\n }\n\n if (signal) {\n // If there is nothing else keeping the event loop alive,\n // then there's a race between a graceful exit and getting\n // the signal to this process. Put this timeout here to\n // make sure we're still alive to get the signal, and thus\n // exit with the intended signal code.\n /* istanbul ignore next */\n setTimeout(() => {}, 2000)\n try {\n process.kill(process.pid, signal)\n /* c8 ignore start */\n } catch (_) {\n process.kill(process.pid, 'SIGTERM')\n }\n /* c8 ignore stop */\n } else {\n process.exit(code || 0)\n }\n })\n\n if (process.send) {\n process.removeAllListeners('message')\n\n child.on('message', (message, sendHandle) => {\n process.send?.(message, sendHandle)\n })\n\n process.on('message', (message, sendHandle) => {\n child.send(\n message as Serializable,\n sendHandle as SendHandle | undefined,\n )\n })\n }\n\n return child\n}\n\nconst isPromise = (o: any): o is Promise =>\n !!o && typeof o === 'object' && typeof o.then === 'function'\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/package.json b/node_modules/foreground-child/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts new file mode 100644 index 0000000..edf17bd --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts @@ -0,0 +1,6 @@ +import { type ChildProcess } from 'child_process'; +/** + * Starts forwarding signals to `child` through `parent`. + */ +export declare const proxySignals: (child: ChildProcess) => () => void; +//# sourceMappingURL=proxy-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map new file mode 100644 index 0000000..7c19279 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.js b/node_modules/foreground-child/dist/commonjs/proxy-signals.js new file mode 100644 index 0000000..3913e7b --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.proxySignals = void 0; +const all_signals_js_1 = require("./all-signals.js"); +/** + * Starts forwarding signals to `child` through `parent`. + */ +const proxySignals = (child) => { + const listeners = new Map(); + for (const sig of all_signals_js_1.allSignals) { + const listener = () => { + // some signals can only be received, not sent + try { + child.kill(sig); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }; + try { + // if it's a signal this system doesn't recognize, skip it + process.on(sig, listener); + listeners.set(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + } + const unproxy = () => { + for (const [sig, listener] of listeners) { + process.removeListener(sig, listener); + } + }; + child.on('exit', unproxy); + return unproxy; +}; +exports.proxySignals = proxySignals; +//# sourceMappingURL=proxy-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map b/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map new file mode 100644 index 0000000..1995822 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/proxy-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.js","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":";;;AACA,qDAA6C;AAE7C;;GAEG;AACI,MAAM,YAAY,GAAG,CAAC,KAAmB,EAAE,EAAE;IAClD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;IAE3B,KAAK,MAAM,GAAG,IAAI,2BAAU,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,8CAA8C;YAC9C,IAAI,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACf,qBAAqB;YACvB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;YACd,oBAAoB;QACtB,CAAC,CAAA;QACD,IAAI,CAAC;YACH,0DAA0D;YAC1D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YACzB,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC5B,qBAAqB;QACvB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;QACd,oBAAoB;IACtB,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,SAAS,EAAE,CAAC;YACxC,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QACvC,CAAC;IACH,CAAC,CAAA;IACD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzB,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AA5BY,QAAA,YAAY,gBA4BxB","sourcesContent":["import { type ChildProcess } from 'child_process'\nimport { allSignals } from './all-signals.js'\n\n/**\n * Starts forwarding signals to `child` through `parent`.\n */\nexport const proxySignals = (child: ChildProcess) => {\n const listeners = new Map()\n\n for (const sig of allSignals) {\n const listener = () => {\n // some signals can only be received, not sent\n try {\n child.kill(sig)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n try {\n // if it's a signal this system doesn't recognize, skip it\n process.on(sig, listener)\n listeners.set(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n\n const unproxy = () => {\n for (const [sig, listener] of listeners) {\n process.removeListener(sig, listener)\n }\n }\n child.on('exit', unproxy)\n return unproxy\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.d.ts b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts new file mode 100644 index 0000000..f10c9de --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts @@ -0,0 +1,10 @@ +import { ChildProcess } from 'child_process'; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +export declare const watchdog: (child: ChildProcess) => ChildProcess; +//# sourceMappingURL=watchdog.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map new file mode 100644 index 0000000..d9ec243 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.js b/node_modules/foreground-child/dist/commonjs/watchdog.js new file mode 100644 index 0000000..514e234 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.js @@ -0,0 +1,50 @@ +"use strict"; +// this spawns a child process that listens for SIGHUP when the +// parent process exits, and after 200ms, sends a SIGKILL to the +// child, in case it did not terminate. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.watchdog = void 0; +const child_process_1 = require("child_process"); +const watchdogCode = String.raw ` +const pid = parseInt(process.argv[1], 10) +process.title = 'node (foreground-child watchdog pid=' + pid + ')' +if (!isNaN(pid)) { + let barked = false + // keepalive + const interval = setInterval(() => {}, 60000) + const bark = () => { + clearInterval(interval) + if (barked) return + barked = true + process.removeListener('SIGHUP', bark) + setTimeout(() => { + try { + process.kill(pid, 'SIGKILL') + setTimeout(() => process.exit(), 200) + } catch (_) {} + }, 500) + }) + process.on('SIGHUP', bark) +} +`; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +const watchdog = (child) => { + let dogExited = false; + const dog = (0, child_process_1.spawn)(process.execPath, ['-e', watchdogCode, String(child.pid)], { + stdio: 'ignore', + }); + dog.on('exit', () => (dogExited = true)); + child.on('exit', () => { + if (!dogExited) + dog.kill('SIGKILL'); + }); + return dog; +}; +exports.watchdog = watchdog; +//# sourceMappingURL=watchdog.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/commonjs/watchdog.js.map b/node_modules/foreground-child/dist/commonjs/watchdog.js.map new file mode 100644 index 0000000..d486c97 --- /dev/null +++ b/node_modules/foreground-child/dist/commonjs/watchdog.js.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.js","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,gEAAgE;AAChE,uCAAuC;;;AAEvC,iDAAmD;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAA;AAED;;;;;;GAMG;AACI,MAAM,QAAQ,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC9C,IAAI,SAAS,GAAG,KAAK,CAAA;IACrB,MAAM,GAAG,GAAG,IAAA,qBAAK,EACf,OAAO,CAAC,QAAQ,EAChB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EACvC;QACE,KAAK,EAAE,QAAQ;KAChB,CACF,CAAA;IACD,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAA;IACxC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,IAAI,CAAC,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAdY,QAAA,QAAQ,YAcpB","sourcesContent":["// this spawns a child process that listens for SIGHUP when the\n// parent process exits, and after 200ms, sends a SIGKILL to the\n// child, in case it did not terminate.\n\nimport { ChildProcess, spawn } from 'child_process'\n\nconst watchdogCode = String.raw`\nconst pid = parseInt(process.argv[1], 10)\nprocess.title = 'node (foreground-child watchdog pid=' + pid + ')'\nif (!isNaN(pid)) {\n let barked = false\n // keepalive\n const interval = setInterval(() => {}, 60000)\n const bark = () => {\n clearInterval(interval)\n if (barked) return\n barked = true\n process.removeListener('SIGHUP', bark)\n setTimeout(() => {\n try {\n process.kill(pid, 'SIGKILL')\n setTimeout(() => process.exit(), 200)\n } catch (_) {}\n }, 500)\n })\n process.on('SIGHUP', bark)\n}\n`\n\n/**\n * Pass in a ChildProcess, and this will spawn a watchdog process that\n * will make sure it exits if the parent does, thus preventing any\n * dangling detached zombie processes.\n *\n * If the child ends before the parent, then the watchdog will terminate.\n */\nexport const watchdog = (child: ChildProcess) => {\n let dogExited = false\n const dog = spawn(\n process.execPath,\n ['-e', watchdogCode, String(child.pid)],\n {\n stdio: 'ignore',\n },\n )\n dog.on('exit', () => (dogExited = true))\n child.on('exit', () => {\n if (!dogExited) dog.kill('SIGKILL')\n })\n return dog\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.d.ts b/node_modules/foreground-child/dist/esm/all-signals.d.ts new file mode 100644 index 0000000..ecc0a62 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.d.ts @@ -0,0 +1,2 @@ +export declare const allSignals: NodeJS.Signals[]; +//# sourceMappingURL=all-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.d.ts.map b/node_modules/foreground-child/dist/esm/all-signals.d.ts.map new file mode 100644 index 0000000..cd1c161 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,EAShB,MAAM,CAAC,OAAO,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.js b/node_modules/foreground-child/dist/esm/all-signals.js new file mode 100644 index 0000000..7e8d54d --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.js @@ -0,0 +1,52 @@ +import constants from 'node:constants'; +export const allSignals = +// this is the full list of signals that Node will let us do anything with +Object.keys(constants).filter(k => k.startsWith('SIG') && + // https://github.com/tapjs/signal-exit/issues/21 + k !== 'SIGPROF' && + // no sense trying to listen for SIGKILL, it's impossible + k !== 'SIGKILL'); +// These are some obscure signals that are reported by kill -l +// on macOS, Linux, or Windows, but which don't have any mapping +// in Node.js. No sense trying if they're just going to throw +// every time on every platform. +// +// 'SIGEMT', +// 'SIGLOST', +// 'SIGPOLL', +// 'SIGRTMAX', +// 'SIGRTMAX-1', +// 'SIGRTMAX-10', +// 'SIGRTMAX-11', +// 'SIGRTMAX-12', +// 'SIGRTMAX-13', +// 'SIGRTMAX-14', +// 'SIGRTMAX-15', +// 'SIGRTMAX-2', +// 'SIGRTMAX-3', +// 'SIGRTMAX-4', +// 'SIGRTMAX-5', +// 'SIGRTMAX-6', +// 'SIGRTMAX-7', +// 'SIGRTMAX-8', +// 'SIGRTMAX-9', +// 'SIGRTMIN', +// 'SIGRTMIN+1', +// 'SIGRTMIN+10', +// 'SIGRTMIN+11', +// 'SIGRTMIN+12', +// 'SIGRTMIN+13', +// 'SIGRTMIN+14', +// 'SIGRTMIN+15', +// 'SIGRTMIN+16', +// 'SIGRTMIN+2', +// 'SIGRTMIN+3', +// 'SIGRTMIN+4', +// 'SIGRTMIN+5', +// 'SIGRTMIN+6', +// 'SIGRTMIN+7', +// 'SIGRTMIN+8', +// 'SIGRTMIN+9', +// 'SIGSTKFLT', +// 'SIGUNUSED', +//# sourceMappingURL=all-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/all-signals.js.map b/node_modules/foreground-child/dist/esm/all-signals.js.map new file mode 100644 index 0000000..1c63c6b --- /dev/null +++ b/node_modules/foreground-child/dist/esm/all-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"all-signals.js","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,MAAM,CAAC,MAAM,UAAU;AACrB,0EAA0E;AAC1E,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,CACF,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;IACnB,iDAAiD;IACjD,CAAC,KAAK,SAAS;IACf,yDAAyD;IACzD,CAAC,KAAK,SAAS,CACE,CAAA;AAEvB,8DAA8D;AAC9D,gEAAgE;AAChE,6DAA6D;AAC7D,gCAAgC;AAChC,EAAE;AACF,YAAY;AACZ,aAAa;AACb,aAAa;AACb,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,cAAc;AACd,gBAAgB;AAChB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,iBAAiB;AACjB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB,eAAe;AACf,eAAe","sourcesContent":["import constants from 'node:constants'\nexport const allSignals =\n // this is the full list of signals that Node will let us do anything with\n Object.keys(constants).filter(\n k =>\n k.startsWith('SIG') &&\n // https://github.com/tapjs/signal-exit/issues/21\n k !== 'SIGPROF' &&\n // no sense trying to listen for SIGKILL, it's impossible\n k !== 'SIGKILL',\n ) as NodeJS.Signals[]\n\n// These are some obscure signals that are reported by kill -l\n// on macOS, Linux, or Windows, but which don't have any mapping\n// in Node.js. No sense trying if they're just going to throw\n// every time on every platform.\n//\n// 'SIGEMT',\n// 'SIGLOST',\n// 'SIGPOLL',\n// 'SIGRTMAX',\n// 'SIGRTMAX-1',\n// 'SIGRTMAX-10',\n// 'SIGRTMAX-11',\n// 'SIGRTMAX-12',\n// 'SIGRTMAX-13',\n// 'SIGRTMAX-14',\n// 'SIGRTMAX-15',\n// 'SIGRTMAX-2',\n// 'SIGRTMAX-3',\n// 'SIGRTMAX-4',\n// 'SIGRTMAX-5',\n// 'SIGRTMAX-6',\n// 'SIGRTMAX-7',\n// 'SIGRTMAX-8',\n// 'SIGRTMAX-9',\n// 'SIGRTMIN',\n// 'SIGRTMIN+1',\n// 'SIGRTMIN+10',\n// 'SIGRTMIN+11',\n// 'SIGRTMIN+12',\n// 'SIGRTMIN+13',\n// 'SIGRTMIN+14',\n// 'SIGRTMIN+15',\n// 'SIGRTMIN+16',\n// 'SIGRTMIN+2',\n// 'SIGRTMIN+3',\n// 'SIGRTMIN+4',\n// 'SIGRTMIN+5',\n// 'SIGRTMIN+6',\n// 'SIGRTMIN+7',\n// 'SIGRTMIN+8',\n// 'SIGRTMIN+9',\n// 'SIGSTKFLT',\n// 'SIGUNUSED',\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.d.ts b/node_modules/foreground-child/dist/esm/index.d.ts new file mode 100644 index 0000000..d15b38e --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.d.ts @@ -0,0 +1,58 @@ +import { ChildProcessByStdio, SpawnOptions, ChildProcess } from 'child_process'; +/** + * The signature for the cleanup method. + * + * Arguments indicate the exit status of the child process. + * + * If a Promise is returned, then the process is not terminated + * until it resolves, and the resolution value is treated as the + * exit status (if a number) or signal exit (if a signal string). + * + * If `undefined` is returned, then no change is made, and the parent + * exits in the same way that the child exited. + * + * If boolean `false` is returned, then the parent's exit is canceled. + * + * If a number is returned, then the parent process exits with the number + * as its exitCode. + * + * If a signal string is returned, then the parent process is killed with + * the same signal that caused the child to exit. + */ +export type Cleanup = (code: number | null, signal: null | NodeJS.Signals, processInfo: { + watchdogPid?: ChildProcess['pid']; +}) => void | undefined | number | NodeJS.Signals | false | Promise; +export type FgArgs = [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup] | [ + program: [cmd: string, ...args: string[]], + opts?: SpawnOptions, + cleanup?: Cleanup +] | [program: string, cleanup?: Cleanup] | [program: string, opts?: SpawnOptions, cleanup?: Cleanup] | [program: string, args?: string[], cleanup?: Cleanup] | [ + program: string, + args?: string[], + opts?: SpawnOptions, + cleanup?: Cleanup +]; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +export declare const normalizeFgArgs: (fgArgs: FgArgs) => [program: string, args: string[], spawnOpts: SpawnOptions, cleanup: Cleanup]; +/** + * Spawn the specified program as a "foreground" process, or at least as + * close as is possible given node's lack of exec-without-fork. + * + * Cleanup method may be used to modify or ignore the result of the child's + * exit code or signal. If cleanup returns undefined (or a Promise that + * resolves to undefined), then the parent will exit in the same way that + * the child did. + * + * Return boolean `false` to prevent the parent's exit entirely. + */ +export declare function foregroundChild(cmd: string | [cmd: string, ...args: string[]], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +export declare function foregroundChild(program: string, args?: string[], spawnOpts?: SpawnOptions, cleanup?: Cleanup): ChildProcessByStdio; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.d.ts.map b/node_modules/foreground-child/dist/esm/index.d.ts.map new file mode 100644 index 0000000..b26fecd --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"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MAAM,KACb,CACD,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,OAAO,CAqBjB,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACxC,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,EAAE,EACf,SAAS,CAAC,EAAE,YAAY,EACxB,OAAO,CAAC,EAAE,OAAO,GAChB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.js b/node_modules/foreground-child/dist/esm/index.js new file mode 100644 index 0000000..6266b58 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.js @@ -0,0 +1,115 @@ +import { spawn as nodeSpawn, } from 'child_process'; +import crossSpawn from 'cross-spawn'; +import { onExit } from 'signal-exit'; +import { proxySignals } from './proxy-signals.js'; +import { watchdog } from './watchdog.js'; +/* c8 ignore start */ +const spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn; +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * Exposed for testing. + * + * @internal + */ +export const normalizeFgArgs = (fgArgs) => { + let [program, args = [], spawnOpts = {}, cleanup = () => { }] = fgArgs; + if (typeof args === 'function') { + cleanup = args; + spawnOpts = {}; + args = []; + } + else if (!!args && typeof args === 'object' && !Array.isArray(args)) { + if (typeof spawnOpts === 'function') + cleanup = spawnOpts; + spawnOpts = args; + args = []; + } + else if (typeof spawnOpts === 'function') { + cleanup = spawnOpts; + spawnOpts = {}; + } + if (Array.isArray(program)) { + const [pp, ...pa] = program; + program = pp; + args = pa; + } + return [program, args, { ...spawnOpts }, cleanup]; +}; +export function foregroundChild(...fgArgs) { + const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs); + spawnOpts.stdio = [0, 1, 2]; + if (process.send) { + spawnOpts.stdio.push('ipc'); + } + const child = spawn(program, args, spawnOpts); + const childHangup = () => { + try { + child.kill('SIGHUP'); + /* c8 ignore start */ + } + catch (_) { + // SIGHUP is weird on windows + child.kill('SIGTERM'); + } + /* c8 ignore stop */ + }; + const removeOnExit = onExit(childHangup); + proxySignals(child); + const dog = watchdog(child); + let done = false; + child.on('close', async (code, signal) => { + /* c8 ignore start */ + if (done) + return; + /* c8 ignore stop */ + done = true; + const result = cleanup(code, signal, { + watchdogPid: dog.pid, + }); + const res = isPromise(result) ? await result : result; + removeOnExit(); + if (res === false) + return; + else if (typeof res === 'string') { + signal = res; + code = null; + } + else if (typeof res === 'number') { + code = res; + signal = null; + } + if (signal) { + // If there is nothing else keeping the event loop alive, + // then there's a race between a graceful exit and getting + // the signal to this process. Put this timeout here to + // make sure we're still alive to get the signal, and thus + // exit with the intended signal code. + /* istanbul ignore next */ + setTimeout(() => { }, 2000); + try { + process.kill(process.pid, signal); + /* c8 ignore start */ + } + catch (_) { + process.kill(process.pid, 'SIGTERM'); + } + /* c8 ignore stop */ + } + else { + process.exit(code || 0); + } + }); + if (process.send) { + process.removeAllListeners('message'); + child.on('message', (message, sendHandle) => { + process.send?.(message, sendHandle); + }); + process.on('message', (message, sendHandle) => { + child.send(message, sendHandle); + }); + } + return child; +} +const isPromise = (o) => !!o && typeof o === 'object' && typeof o.then === 'function'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/index.js.map b/node_modules/foreground-child/dist/esm/index.js.map new file mode 100644 index 0000000..7d9d1bd --- /dev/null +++ b/node_modules/foreground-child/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,SAAS,GAGnB,MAAM,eAAe,CAAA;AACtB,OAAO,UAAU,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,qBAAqB;AACrB,MAAM,KAAK,GAAG,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAA;AAsDpE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,MAAc,EAMd,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC,GAAG,MAAM,CAAA;IACrE,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,OAAO,GAAG,IAAI,CAAA;QACd,SAAS,GAAG,EAAE,CAAA;QACd,IAAI,GAAG,EAAE,CAAA;IACX,CAAC;SAAM,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,IAAI,OAAO,SAAS,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,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;YACtC,CAAC;YACD,oBAAoB;QACtB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;QAErC,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC1C,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE;YAC5C,KAAK,CAAC,IAAI,CACR,OAAuB,EACvB,UAAoC,CACrC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,CAAM,EAAqB,EAAE,CAC9C,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAA","sourcesContent":["import {\n ChildProcessByStdio,\n SendHandle,\n Serializable,\n spawn as nodeSpawn,\n SpawnOptions,\n ChildProcess,\n} from 'child_process'\nimport crossSpawn from 'cross-spawn'\nimport { onExit } from 'signal-exit'\nimport { proxySignals } from './proxy-signals.js'\nimport { watchdog } from './watchdog.js'\n\n/* c8 ignore start */\nconst spawn = process?.platform === 'win32' ? crossSpawn : nodeSpawn\n/* c8 ignore stop */\n\n/**\n * The signature for the cleanup method.\n *\n * Arguments indicate the exit status of the child process.\n *\n * If a Promise is returned, then the process is not terminated\n * until it resolves, and the resolution value is treated as the\n * exit status (if a number) or signal exit (if a signal string).\n *\n * If `undefined` is returned, then no change is made, and the parent\n * exits in the same way that the child exited.\n *\n * If boolean `false` is returned, then the parent's exit is canceled.\n *\n * If a number is returned, then the parent process exits with the number\n * as its exitCode.\n *\n * If a signal string is returned, then the parent process is killed with\n * the same signal that caused the child to exit.\n */\nexport type Cleanup = (\n code: number | null,\n signal: null | NodeJS.Signals,\n processInfo: {\n watchdogPid?: ChildProcess['pid']\n },\n) =>\n | void\n | undefined\n | number\n | NodeJS.Signals\n | false\n | Promise\n\nexport type FgArgs =\n | [program: string | [cmd: string, ...args: string[]], cleanup?: Cleanup]\n | [\n program: [cmd: string, ...args: string[]],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n | [program: string, cleanup?: Cleanup]\n | [program: string, opts?: SpawnOptions, cleanup?: Cleanup]\n | [program: string, args?: string[], cleanup?: Cleanup]\n | [\n program: string,\n args?: string[],\n opts?: SpawnOptions,\n cleanup?: Cleanup,\n ]\n\n/**\n * Normalizes the arguments passed to `foregroundChild`.\n *\n * Exposed for testing.\n *\n * @internal\n */\nexport const normalizeFgArgs = (\n fgArgs: FgArgs,\n): [\n program: string,\n args: string[],\n spawnOpts: SpawnOptions,\n cleanup: Cleanup,\n] => {\n let [program, args = [], spawnOpts = {}, cleanup = () => {}] = fgArgs\n if (typeof args === 'function') {\n cleanup = args\n spawnOpts = {}\n args = []\n } else if (!!args && typeof args === 'object' && !Array.isArray(args)) {\n if (typeof spawnOpts === 'function') cleanup = spawnOpts\n spawnOpts = args\n args = []\n } else if (typeof spawnOpts === 'function') {\n cleanup = spawnOpts\n spawnOpts = {}\n }\n if (Array.isArray(program)) {\n const [pp, ...pa] = program\n program = pp\n args = pa\n }\n return [program, args, { ...spawnOpts }, cleanup]\n}\n\n/**\n * Spawn the specified program as a \"foreground\" process, or at least as\n * close as is possible given node's lack of exec-without-fork.\n *\n * Cleanup method may be used to modify or ignore the result of the child's\n * exit code or signal. If cleanup returns undefined (or a Promise that\n * resolves to undefined), then the parent will exit in the same way that\n * the child did.\n *\n * Return boolean `false` to prevent the parent's exit entirely.\n */\nexport function foregroundChild(\n cmd: string | [cmd: string, ...args: string[]],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n program: string,\n args?: string[],\n spawnOpts?: SpawnOptions,\n cleanup?: Cleanup,\n): ChildProcessByStdio\nexport function foregroundChild(\n ...fgArgs: FgArgs\n): ChildProcessByStdio {\n const [program, args, spawnOpts, cleanup] = normalizeFgArgs(fgArgs)\n\n spawnOpts.stdio = [0, 1, 2]\n if (process.send) {\n spawnOpts.stdio.push('ipc')\n }\n\n const child = spawn(program, args, spawnOpts) as ChildProcessByStdio<\n null,\n null,\n null\n >\n\n const childHangup = () => {\n try {\n child.kill('SIGHUP')\n\n /* c8 ignore start */\n } catch (_) {\n // SIGHUP is weird on windows\n child.kill('SIGTERM')\n }\n /* c8 ignore stop */\n }\n const removeOnExit = onExit(childHangup)\n\n proxySignals(child)\n const dog = watchdog(child)\n\n let done = false\n child.on('close', async (code, signal) => {\n /* c8 ignore start */\n if (done) return\n /* c8 ignore stop */\n done = true\n const result = cleanup(code, signal, {\n watchdogPid: dog.pid,\n })\n const res = isPromise(result) ? await result : result\n removeOnExit()\n\n if (res === false) return\n else if (typeof res === 'string') {\n signal = res\n code = null\n } else if (typeof res === 'number') {\n code = res\n signal = null\n }\n\n if (signal) {\n // If there is nothing else keeping the event loop alive,\n // then there's a race between a graceful exit and getting\n // the signal to this process. Put this timeout here to\n // make sure we're still alive to get the signal, and thus\n // exit with the intended signal code.\n /* istanbul ignore next */\n setTimeout(() => {}, 2000)\n try {\n process.kill(process.pid, signal)\n /* c8 ignore start */\n } catch (_) {\n process.kill(process.pid, 'SIGTERM')\n }\n /* c8 ignore stop */\n } else {\n process.exit(code || 0)\n }\n })\n\n if (process.send) {\n process.removeAllListeners('message')\n\n child.on('message', (message, sendHandle) => {\n process.send?.(message, sendHandle)\n })\n\n process.on('message', (message, sendHandle) => {\n child.send(\n message as Serializable,\n sendHandle as SendHandle | undefined,\n )\n })\n }\n\n return child\n}\n\nconst isPromise = (o: any): o is Promise =>\n !!o && typeof o === 'object' && typeof o.then === 'function'\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/package.json b/node_modules/foreground-child/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/foreground-child/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.d.ts b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts new file mode 100644 index 0000000..edf17bd --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts @@ -0,0 +1,6 @@ +import { type ChildProcess } from 'child_process'; +/** + * Starts forwarding signals to `child` through `parent`. + */ +export declare const proxySignals: (child: ChildProcess) => () => void; +//# sourceMappingURL=proxy-signals.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map new file mode 100644 index 0000000..7c19279 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.d.ts","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGjD;;GAEG;AACH,eAAO,MAAM,YAAY,UAAW,YAAY,eA4B/C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.js b/node_modules/foreground-child/dist/esm/proxy-signals.js new file mode 100644 index 0000000..8e1efe3 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.js @@ -0,0 +1,34 @@ +import { allSignals } from './all-signals.js'; +/** + * Starts forwarding signals to `child` through `parent`. + */ +export const proxySignals = (child) => { + const listeners = new Map(); + for (const sig of allSignals) { + const listener = () => { + // some signals can only be received, not sent + try { + child.kill(sig); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }; + try { + // if it's a signal this system doesn't recognize, skip it + process.on(sig, listener); + listeners.set(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + } + const unproxy = () => { + for (const [sig, listener] of listeners) { + process.removeListener(sig, listener); + } + }; + child.on('exit', unproxy); + return unproxy; +}; +//# sourceMappingURL=proxy-signals.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/proxy-signals.js.map b/node_modules/foreground-child/dist/esm/proxy-signals.js.map new file mode 100644 index 0000000..978750f --- /dev/null +++ b/node_modules/foreground-child/dist/esm/proxy-signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"proxy-signals.js","sourceRoot":"","sources":["../../src/proxy-signals.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAmB,EAAE,EAAE;IAClD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;IAE3B,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,8CAA8C;YAC9C,IAAI,CAAC;gBACH,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACf,qBAAqB;YACvB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;YACd,oBAAoB;QACtB,CAAC,CAAA;QACD,IAAI,CAAC;YACH,0DAA0D;YAC1D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YACzB,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC5B,qBAAqB;QACvB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;QACd,oBAAoB;IACtB,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,SAAS,EAAE,CAAC;YACxC,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QACvC,CAAC;IACH,CAAC,CAAA;IACD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzB,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA","sourcesContent":["import { type ChildProcess } from 'child_process'\nimport { allSignals } from './all-signals.js'\n\n/**\n * Starts forwarding signals to `child` through `parent`.\n */\nexport const proxySignals = (child: ChildProcess) => {\n const listeners = new Map()\n\n for (const sig of allSignals) {\n const listener = () => {\n // some signals can only be received, not sent\n try {\n child.kill(sig)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n try {\n // if it's a signal this system doesn't recognize, skip it\n process.on(sig, listener)\n listeners.set(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n }\n\n const unproxy = () => {\n for (const [sig, listener] of listeners) {\n process.removeListener(sig, listener)\n }\n }\n child.on('exit', unproxy)\n return unproxy\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.d.ts b/node_modules/foreground-child/dist/esm/watchdog.d.ts new file mode 100644 index 0000000..f10c9de --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.d.ts @@ -0,0 +1,10 @@ +import { ChildProcess } from 'child_process'; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +export declare const watchdog: (child: ChildProcess) => ChildProcess; +//# sourceMappingURL=watchdog.d.ts.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.d.ts.map b/node_modules/foreground-child/dist/esm/watchdog.d.ts.map new file mode 100644 index 0000000..d9ec243 --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.d.ts","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAA;AAyBnD;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,YAAY,iBAc3C,CAAA"} \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.js b/node_modules/foreground-child/dist/esm/watchdog.js new file mode 100644 index 0000000..7aa184e --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.js @@ -0,0 +1,46 @@ +// this spawns a child process that listens for SIGHUP when the +// parent process exits, and after 200ms, sends a SIGKILL to the +// child, in case it did not terminate. +import { spawn } from 'child_process'; +const watchdogCode = String.raw ` +const pid = parseInt(process.argv[1], 10) +process.title = 'node (foreground-child watchdog pid=' + pid + ')' +if (!isNaN(pid)) { + let barked = false + // keepalive + const interval = setInterval(() => {}, 60000) + const bark = () => { + clearInterval(interval) + if (barked) return + barked = true + process.removeListener('SIGHUP', bark) + setTimeout(() => { + try { + process.kill(pid, 'SIGKILL') + setTimeout(() => process.exit(), 200) + } catch (_) {} + }, 500) + }) + process.on('SIGHUP', bark) +} +`; +/** + * Pass in a ChildProcess, and this will spawn a watchdog process that + * will make sure it exits if the parent does, thus preventing any + * dangling detached zombie processes. + * + * If the child ends before the parent, then the watchdog will terminate. + */ +export const watchdog = (child) => { + let dogExited = false; + const dog = spawn(process.execPath, ['-e', watchdogCode, String(child.pid)], { + stdio: 'ignore', + }); + dog.on('exit', () => (dogExited = true)); + child.on('exit', () => { + if (!dogExited) + dog.kill('SIGKILL'); + }); + return dog; +}; +//# sourceMappingURL=watchdog.js.map \ No newline at end of file diff --git a/node_modules/foreground-child/dist/esm/watchdog.js.map b/node_modules/foreground-child/dist/esm/watchdog.js.map new file mode 100644 index 0000000..6f4e39f --- /dev/null +++ b/node_modules/foreground-child/dist/esm/watchdog.js.map @@ -0,0 +1 @@ +{"version":3,"file":"watchdog.js","sourceRoot":"","sources":["../../src/watchdog.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gEAAgE;AAChE,uCAAuC;AAEvC,OAAO,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAA;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC9C,IAAI,SAAS,GAAG,KAAK,CAAA;IACrB,MAAM,GAAG,GAAG,KAAK,CACf,OAAO,CAAC,QAAQ,EAChB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EACvC;QACE,KAAK,EAAE,QAAQ;KAChB,CACF,CAAA;IACD,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAA;IACxC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,IAAI,CAAC,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA","sourcesContent":["// this spawns a child process that listens for SIGHUP when the\n// parent process exits, and after 200ms, sends a SIGKILL to the\n// child, in case it did not terminate.\n\nimport { ChildProcess, spawn } from 'child_process'\n\nconst watchdogCode = String.raw`\nconst pid = parseInt(process.argv[1], 10)\nprocess.title = 'node (foreground-child watchdog pid=' + pid + ')'\nif (!isNaN(pid)) {\n let barked = false\n // keepalive\n const interval = setInterval(() => {}, 60000)\n const bark = () => {\n clearInterval(interval)\n if (barked) return\n barked = true\n process.removeListener('SIGHUP', bark)\n setTimeout(() => {\n try {\n process.kill(pid, 'SIGKILL')\n setTimeout(() => process.exit(), 200)\n } catch (_) {}\n }, 500)\n })\n process.on('SIGHUP', bark)\n}\n`\n\n/**\n * Pass in a ChildProcess, and this will spawn a watchdog process that\n * will make sure it exits if the parent does, thus preventing any\n * dangling detached zombie processes.\n *\n * If the child ends before the parent, then the watchdog will terminate.\n */\nexport const watchdog = (child: ChildProcess) => {\n let dogExited = false\n const dog = spawn(\n process.execPath,\n ['-e', watchdogCode, String(child.pid)],\n {\n stdio: 'ignore',\n },\n )\n dog.on('exit', () => (dogExited = true))\n child.on('exit', () => {\n if (!dogExited) dog.kill('SIGKILL')\n })\n return dog\n}\n"]} \ No newline at end of file diff --git a/node_modules/foreground-child/package.json b/node_modules/foreground-child/package.json new file mode 100644 index 0000000..75f5b99 --- /dev/null +++ b/node_modules/foreground-child/package.json @@ -0,0 +1,106 @@ +{ + "name": "foreground-child", + "version": "3.3.1", + "description": "Run a child as if it's the foreground process. Give it stdio. Exit when it exits.", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "exports": { + "./watchdog": { + "import": { + "types": "./dist/esm/watchdog.d.ts", + "default": "./dist/esm/watchdog.js" + }, + "require": { + "types": "./dist/commonjs/watchdog.d.ts", + "default": "./dist/commonjs/watchdog.js" + } + }, + "./proxy-signals": { + "import": { + "types": "./dist/esm/proxy-signals.d.ts", + "default": "./dist/esm/proxy-signals.js" + }, + "require": { + "types": "./dist/commonjs/proxy-signals.d.ts", + "default": "./dist/commonjs/proxy-signals.js" + } + }, + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=14" + }, + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "typecheck": true + }, + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/foreground-child.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "devDependencies": { + "@types/cross-spawn": "^6.0.2", + "@types/node": "^18.15.11", + "@types/tap": "^15.0.8", + "prettier": "^3.3.2", + "tap": "^21.1.0", + "tshy": "^3.0.2", + "typedoc": "^0.24.2", + "typescript": "^5.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "tshy": { + "exports": { + "./watchdog": "./src/watchdog.ts", + "./proxy-signals": "./src/proxy-signals.ts", + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "type": "module", + "module": "./dist/esm/index.js" +} diff --git a/node_modules/form-data/CHANGELOG.md b/node_modules/form-data/CHANGELOG.md new file mode 100644 index 0000000..cd3105e --- /dev/null +++ b/node_modules/form-data/CHANGELOG.md @@ -0,0 +1,659 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v4.0.5](https://github.com/form-data/form-data/compare/v4.0.4...v4.0.5) - 2025-11-17 + +### Commits + +- [Tests] Switch to newer v8 prediction library; enable node 24 testing [`16e0076`](https://github.com/form-data/form-data/commit/16e00765342106876f98a1c9703314006c9e937a) +- [Dev Deps] update `@ljharb/eslint-config`, `eslint` [`5822467`](https://github.com/form-data/form-data/commit/5822467f0ec21f6ad613c1c90856375e498793c7) +- [Fix] set Symbol.toStringTag in the proper place [`76d0dee`](https://github.com/form-data/form-data/commit/76d0dee43933b5e167f7f09e5d9cbbd1cf911aa7) + +## [v4.0.4](https://github.com/form-data/form-data/compare/v4.0.3...v4.0.4) - 2025-07-16 + +### Commits + +- [meta] add `auto-changelog` [`811f682`](https://github.com/form-data/form-data/commit/811f68282fab0315209d0e2d1c44b6c32ea0d479) +- [Tests] handle predict-v8-randomness failures in node < 17 and node > 23 [`1d11a76`](https://github.com/form-data/form-data/commit/1d11a76434d101f22fdb26b8aef8615f28b98402) +- [Fix] Switch to using `crypto` random for boundary values [`3d17230`](https://github.com/form-data/form-data/commit/3d1723080e6577a66f17f163ecd345a21d8d0fd0) +- [Tests] fix linting errors [`5e34080`](https://github.com/form-data/form-data/commit/5e340800b5f8914213e4e0378c084aae71cfd73a) +- [meta] actually ensure the readme backup isn’t published [`316c82b`](https://github.com/form-data/form-data/commit/316c82ba93fd4985af757b771b9a1f26d3b709ef) +- [Dev Deps] update `@ljharb/eslint-config` [`58c25d7`](https://github.com/form-data/form-data/commit/58c25d76406a5b0dfdf54045cf252563f2bbda8d) +- [meta] fix readme capitalization [`2300ca1`](https://github.com/form-data/form-data/commit/2300ca19595b0ee96431e868fe2a40db79e41c61) + +## [v4.0.3](https://github.com/form-data/form-data/compare/v4.0.2...v4.0.3) - 2025-06-05 + +### Fixed + +- [Fix] `append`: avoid a crash on nullish values [`#577`](https://github.com/form-data/form-data/issues/577) + +### Commits + +- [eslint] use a shared config [`426ba9a`](https://github.com/form-data/form-data/commit/426ba9ac440f95d1998dac9a5cd8d738043b048f) +- [eslint] fix some spacing issues [`2094191`](https://github.com/form-data/form-data/commit/20941917f0e9487e68c564ebc3157e23609e2939) +- [Refactor] use `hasown` [`81ab41b`](https://github.com/form-data/form-data/commit/81ab41b46fdf34f5d89d7ff30b513b0925febfaa) +- [Fix] validate boundary type in `setBoundary()` method [`8d8e469`](https://github.com/form-data/form-data/commit/8d8e4693093519f7f18e3c597d1e8df8c493de9e) +- [Tests] add tests to check the behavior of `getBoundary` with non-strings [`837b8a1`](https://github.com/form-data/form-data/commit/837b8a1f7562bfb8bda74f3fc538adb7a5858995) +- [Dev Deps] remove unused deps [`870e4e6`](https://github.com/form-data/form-data/commit/870e4e665935e701bf983a051244ab928e62d58e) +- [meta] remove local commit hooks [`e6e83cc`](https://github.com/form-data/form-data/commit/e6e83ccb545a5619ed6cd04f31d5c2f655eb633e) +- [Dev Deps] update `eslint` [`4066fd6`](https://github.com/form-data/form-data/commit/4066fd6f65992b62fa324a6474a9292a4f88c916) +- [meta] fix scripts to use prepublishOnly [`c4bbb13`](https://github.com/form-data/form-data/commit/c4bbb13c0ef669916657bc129341301b1d331d75) + +## [v4.0.2](https://github.com/form-data/form-data/compare/v4.0.1...v4.0.2) - 2025-02-14 + +### Merged + +- [Fix] set `Symbol.toStringTag` when available [`#573`](https://github.com/form-data/form-data/pull/573) +- [Fix] set `Symbol.toStringTag` when available [`#573`](https://github.com/form-data/form-data/pull/573) +- fix (npmignore): ignore temporary build files [`#532`](https://github.com/form-data/form-data/pull/532) +- fix (npmignore): ignore temporary build files [`#532`](https://github.com/form-data/form-data/pull/532) + +### Fixed + +- [Fix] set `Symbol.toStringTag` when available (#573) [`#396`](https://github.com/form-data/form-data/issues/396) +- [Fix] set `Symbol.toStringTag` when available (#573) [`#396`](https://github.com/form-data/form-data/issues/396) +- [Fix] set `Symbol.toStringTag` when available [`#396`](https://github.com/form-data/form-data/issues/396) + +### Commits + +- Merge tags v2.5.3 and v3.0.3 [`92613b9`](https://github.com/form-data/form-data/commit/92613b9208556eb4ebc482fdf599fae111626fb6) +- [Tests] migrate from travis to GHA [`806eda7`](https://github.com/form-data/form-data/commit/806eda77740e6e3c67c7815afb216f2e1f187ba5) +- [Tests] migrate from travis to GHA [`8fdb3bc`](https://github.com/form-data/form-data/commit/8fdb3bc6b5d001f8909a9fca391d1d1d97ef1d79) +- [Refactor] use `Object.prototype.hasOwnProperty.call` [`7fecefe`](https://github.com/form-data/form-data/commit/7fecefe4ba8f775634aff86a698776ad95ecffb5) +- [Refactor] use `Object.prototype.hasOwnProperty.call` [`6e682d4`](https://github.com/form-data/form-data/commit/6e682d4bd41de7e80de41e3c4ee10f23fcc3dd00) +- [Refactor] use `Object.prototype.hasOwnProperty.call` [`df3c1e6`](https://github.com/form-data/form-data/commit/df3c1e6f0937f47a782dc4573756a54987f31dde) +- [Dev Deps] update `@types/node`, `browserify`, `coveralls`, `cross-spawn`, `eslint`, `formidable`, `in-publish`, `pkgfiles`, `pre-commit`, `puppeteer`, `request`, `tape`, `typescript` [`8261fcb`](https://github.com/form-data/form-data/commit/8261fcb8bf5944d30ae3bd04b91b71d6a9932ef4) +- [Dev Deps] update `@types/node`, `browserify`, `coveralls`, `cross-spawn`, `eslint`, `formidable`, `in-publish`, `pkgfiles`, `pre-commit`, `puppeteer`, `request`, `tape`, `typescript` [`fb66cb7`](https://github.com/form-data/form-data/commit/fb66cb740e29fb170eee947d4be6fdf82d6659af) +- [Dev Deps] update `@types/node`, `browserify`, `coveralls`, `eslint`, `formidable`, `in-publish`, `phantomjs-prebuilt`, `pkgfiles`, `pre-commit`, `request`, `tape`, `typescript` [`819f6b7`](https://github.com/form-data/form-data/commit/819f6b7a543306a891fca37c3a06d0ff4a734422) +- [eslint] clean up ignores [`3217b3d`](https://github.com/form-data/form-data/commit/3217b3ded8e382e51171d5c74c6038a21cc54440) +- [eslint] clean up ignores [`3a9d480`](https://github.com/form-data/form-data/commit/3a9d480232dbcbc07260ad84c3da4975d9a3ae9e) +- [Fix] `Buffer.from` and `Buffer.alloc` require node 4+ [`c499f76`](https://github.com/form-data/form-data/commit/c499f76f1faac1ddbf210c45217038e4c1e02337) +- Only apps should have lockfiles [`b82f590`](https://github.com/form-data/form-data/commit/b82f59093cdbadb4b7ec0922d33ae7ab048b82ff) +- Only apps should have lockfiles [`b170ee2`](https://github.com/form-data/form-data/commit/b170ee2b22b4c695c363b811c0c553d2fb1bbd79) +- [Deps] update `combined-stream`, `mime-types` [`6b1ca1d`](https://github.com/form-data/form-data/commit/6b1ca1dc7362a1b1c3a99a885516cca4b7eb817f) +- [Dev Deps] pin `request` which via `tough-cookie` ^2.4 depends on `psl` [`e5df7f2`](https://github.com/form-data/form-data/commit/e5df7f24383342264bd73dee3274818a40d04065) +- [Deps] update `mime-types` [`5a5bafe`](https://github.com/form-data/form-data/commit/5a5bafee894fead10da49e1fa2b084e17f2e1034) +- Bumped version 2.5.3 [`9457283`](https://github.com/form-data/form-data/commit/9457283e1dce6122adc908fdd7442cfc54cabe7a) +- [Dev Deps] pin `request` which via `tough-cookie` ^2.4 depends on `psl` [`9dbe192`](https://github.com/form-data/form-data/commit/9dbe192be3db215eac4d9c0b980470a5c2c030c6) +- Merge tags v2.5.2 and v3.0.2 [`d53265d`](https://github.com/form-data/form-data/commit/d53265d86c5153f535ec68eb107548b1b2883576) +- Bumped version 2.5.2 [`7020dd4`](https://github.com/form-data/form-data/commit/7020dd4c1260370abc40e86e3dfe49c5d576fbda) +- [Dev Deps] downgrade `cross-spawn` [`3fc1a9b`](https://github.com/form-data/form-data/commit/3fc1a9b62ddf1fe77a2bd6bd3476e4c0a9e01a88) +- fix: move util.isArray to Array.isArray (#564) [`edb555a`](https://github.com/form-data/form-data/commit/edb555a811f6f7e4668db4831551cf41c1de1cac) +- fix: move util.isArray to Array.isArray (#564) [`10418d1`](https://github.com/form-data/form-data/commit/10418d1fe4b0d65fe020eafe3911feb5ad5e2bd6) + +## [v4.0.1](https://github.com/form-data/form-data/compare/v4.0.0...v4.0.1) - 2024-10-10 + +### Commits + +- [Tests] migrate from travis to GHA [`757b4e3`](https://github.com/form-data/form-data/commit/757b4e32e95726aec9bdcc771fb5a3b564d88034) +- [eslint] clean up ignores [`e8f0d80`](https://github.com/form-data/form-data/commit/e8f0d80cd7cd424d1488532621ec40a33218b30b) +- fix (npmignore): ignore temporary build files [`335ad19`](https://github.com/form-data/form-data/commit/335ad19c6e17dc2d7298ffe0e9b37ba63600e94b) +- fix: move util.isArray to Array.isArray [`440d3be`](https://github.com/form-data/form-data/commit/440d3bed752ac2f9213b4c2229dbccefe140e5fa) + +## [v4.0.0](https://github.com/form-data/form-data/compare/v3.0.4...v4.0.0) - 2021-02-15 + +### Merged + +- Handle custom stream [`#382`](https://github.com/form-data/form-data/pull/382) + +### Commits + +- Fix typo [`e705c0a`](https://github.com/form-data/form-data/commit/e705c0a1fdaf90d21501f56460b93e43a18bd435) +- Update README for custom stream behavior [`6dd8624`](https://github.com/form-data/form-data/commit/6dd8624b2999e32768d62752c9aae5845a803b0d) + +## [v3.0.4](https://github.com/form-data/form-data/compare/v3.0.3...v3.0.4) - 2025-07-16 + +### Fixed + +- [Fix] `append`: avoid a crash on nullish values [`#577`](https://github.com/form-data/form-data/issues/577) + +### Commits + +- [eslint] update linting config [`f5e7eb0`](https://github.com/form-data/form-data/commit/f5e7eb024bc3fc7e2074ff80f143a4f4cbc1dbda) +- [meta] add `auto-changelog` [`d2eb290`](https://github.com/form-data/form-data/commit/d2eb290a3e47ed5bcad7020d027daa15b3cf5ef5) +- [Tests] handle predict-v8-randomness failures in node < 17 and node > 23 [`e8c574c`](https://github.com/form-data/form-data/commit/e8c574cb07ff3a0de2ecc0912d783ef22e190c1f) +- [Fix] Switch to using `crypto` random for boundary values [`c6ced61`](https://github.com/form-data/form-data/commit/c6ced61d4fae8f617ee2fd692133ed87baa5d0fd) +- [Refactor] use `hasown` [`1a78b5d`](https://github.com/form-data/form-data/commit/1a78b5dd05e508d67e97764d812ac7c6d92ea88d) +- [Fix] validate boundary type in `setBoundary()` method [`70bbaa0`](https://github.com/form-data/form-data/commit/70bbaa0b395ca0fb975c309de8d7286979254cc4) +- [Tests] add tests to check the behavior of `getBoundary` with non-strings [`b22a64e`](https://github.com/form-data/form-data/commit/b22a64ef94ba4f3f6ff7d1ac72a54cca128567df) +- [meta] actually ensure the readme backup isn’t published [`0150851`](https://github.com/form-data/form-data/commit/01508513ffb26fd662ae7027834b325af8efb9ea) +- [meta] remove local commit hooks [`fc42bb9`](https://github.com/form-data/form-data/commit/fc42bb9315b641bfa6dae51cb4e188a86bb04769) +- [Dev Deps] remove unused deps [`a14d09e`](https://github.com/form-data/form-data/commit/a14d09ea8ed7e0a2e1705269ce6fb54bb7ee6bdb) +- [meta] fix scripts to use prepublishOnly [`11d9f73`](https://github.com/form-data/form-data/commit/11d9f7338f18a59b431832a3562b49baece0a432) +- [meta] fix readme capitalization [`fc38b48`](https://github.com/form-data/form-data/commit/fc38b4834a117a1856f3d877eb2f5b7496a24932) + +## [v3.0.3](https://github.com/form-data/form-data/compare/v3.0.2...v3.0.3) - 2025-02-14 + +### Merged + +- [Fix] set `Symbol.toStringTag` when available [`#573`](https://github.com/form-data/form-data/pull/573) + +### Fixed + +- [Fix] set `Symbol.toStringTag` when available (#573) [`#396`](https://github.com/form-data/form-data/issues/396) + +### Commits + +- [Refactor] use `Object.prototype.hasOwnProperty.call` [`7fecefe`](https://github.com/form-data/form-data/commit/7fecefe4ba8f775634aff86a698776ad95ecffb5) +- [Dev Deps] update `@types/node`, `browserify`, `coveralls`, `cross-spawn`, `eslint`, `formidable`, `in-publish`, `pkgfiles`, `pre-commit`, `puppeteer`, `request`, `tape`, `typescript` [`8261fcb`](https://github.com/form-data/form-data/commit/8261fcb8bf5944d30ae3bd04b91b71d6a9932ef4) +- Only apps should have lockfiles [`b82f590`](https://github.com/form-data/form-data/commit/b82f59093cdbadb4b7ec0922d33ae7ab048b82ff) +- [Dev Deps] pin `request` which via `tough-cookie` ^2.4 depends on `psl` [`e5df7f2`](https://github.com/form-data/form-data/commit/e5df7f24383342264bd73dee3274818a40d04065) +- [Deps] update `mime-types` [`5a5bafe`](https://github.com/form-data/form-data/commit/5a5bafee894fead10da49e1fa2b084e17f2e1034) + +## [v3.0.2](https://github.com/form-data/form-data/compare/v3.0.1...v3.0.2) - 2024-10-10 + +### Merged + +- fix (npmignore): ignore temporary build files [`#532`](https://github.com/form-data/form-data/pull/532) + +### Commits + +- [Tests] migrate from travis to GHA [`8fdb3bc`](https://github.com/form-data/form-data/commit/8fdb3bc6b5d001f8909a9fca391d1d1d97ef1d79) +- [eslint] clean up ignores [`3217b3d`](https://github.com/form-data/form-data/commit/3217b3ded8e382e51171d5c74c6038a21cc54440) +- fix: move util.isArray to Array.isArray (#564) [`edb555a`](https://github.com/form-data/form-data/commit/edb555a811f6f7e4668db4831551cf41c1de1cac) + +## [v3.0.1](https://github.com/form-data/form-data/compare/v3.0.0...v3.0.1) - 2021-02-15 + +### Merged + +- Fix typo: ads -> adds [`#451`](https://github.com/form-data/form-data/pull/451) + +### Commits + +- feat: add setBoundary method [`55d90ce`](https://github.com/form-data/form-data/commit/55d90ce4a4c22b0ea0647991d85cb946dfb7395b) + +## [v3.0.0](https://github.com/form-data/form-data/compare/v2.5.5...v3.0.0) - 2019-11-05 + +### Merged + +- Update Readme.md [`#449`](https://github.com/form-data/form-data/pull/449) +- Update package.json [`#448`](https://github.com/form-data/form-data/pull/448) +- fix memory leak [`#447`](https://github.com/form-data/form-data/pull/447) +- form-data: Replaced PhantomJS Dependency [`#442`](https://github.com/form-data/form-data/pull/442) +- Fix constructor options in Typescript definitions [`#446`](https://github.com/form-data/form-data/pull/446) +- Fix the getHeaders method signatures [`#434`](https://github.com/form-data/form-data/pull/434) +- Update combined-stream (fixes #422) [`#424`](https://github.com/form-data/form-data/pull/424) + +### Fixed + +- Merge pull request #424 from botgram/update-combined-stream [`#422`](https://github.com/form-data/form-data/issues/422) +- Update combined-stream (fixes #422) [`#422`](https://github.com/form-data/form-data/issues/422) + +### Commits + +- Add readable stream options to constructor type [`80c8f74`](https://github.com/form-data/form-data/commit/80c8f746bcf4c0418ae35fbedde12fb8c01e2748) +- Fixed: getHeaders method signatures [`f4ca7f8`](https://github.com/form-data/form-data/commit/f4ca7f8e31f7e07df22c1aeb8e0a32a7055a64ca) +- Pass options to constructor if not used with new [`4bde68e`](https://github.com/form-data/form-data/commit/4bde68e12de1ba90fefad2e7e643f6375b902763) +- Make userHeaders optional [`2b4e478`](https://github.com/form-data/form-data/commit/2b4e4787031490942f2d1ee55c56b85a250875a7) + +## [v2.5.5](https://github.com/form-data/form-data/compare/v2.5.4...v2.5.5) - 2025-07-18 + +### Commits + +- [meta] actually ensure the readme backup isn’t published [`10626c0`](https://github.com/form-data/form-data/commit/10626c0a9b78c7d3fcaa51772265015ee0afc25c) +- [Fix] use proper dependency [`026abe5`](https://github.com/form-data/form-data/commit/026abe5c5c0489d8a2ccb59d5cfd14fb63078377) + +## [v2.5.4](https://github.com/form-data/form-data/compare/v2.5.3...v2.5.4) - 2025-07-17 + +### Fixed + +- [Fix] `append`: avoid a crash on nullish values [`#577`](https://github.com/form-data/form-data/issues/577) + +### Commits + +- [eslint] update linting config [`8bf2492`](https://github.com/form-data/form-data/commit/8bf2492e0555d41ff58fa04c91593af998f87a3c) +- [meta] add `auto-changelog` [`b5101ad`](https://github.com/form-data/form-data/commit/b5101ad3d5f73cfd0143aae3735b92826fd731ea) +- [Tests] handle predict-v8-randomness failures in node < 17 and node > 23 [`0e93122`](https://github.com/form-data/form-data/commit/0e93122358414942393d9c2dc434ae69e58be7c8) +- [Fix] Switch to using `crypto` random for boundary values [`b88316c`](https://github.com/form-data/form-data/commit/b88316c94bb004323669cd3639dc8bb8262539eb) +- [Fix] validate boundary type in `setBoundary()` method [`131ae5e`](https://github.com/form-data/form-data/commit/131ae5efa30b9c608add4faef3befb38aa2e1bf1) +- [Tests] Switch to newer v8 prediction library; enable node 24 testing [`c97cfbe`](https://github.com/form-data/form-data/commit/c97cfbed9eb6d2d4b5d53090f69ded4bf9fd8a21) +- [Refactor] use `hasown` [`97ac9c2`](https://github.com/form-data/form-data/commit/97ac9c208be0b83faeee04bb3faef1ed3474ee4c) +- [meta] remove local commit hooks [`be99d4e`](https://github.com/form-data/form-data/commit/be99d4eea5ce47139c23c1f0914596194019d7fb) +- [Dev Deps] remove unused deps [`ddbc89b`](https://github.com/form-data/form-data/commit/ddbc89b6d6d64f730bcb27cb33b7544068466a05) +- [meta] fix scripts to use prepublishOnly [`e351a97`](https://github.com/form-data/form-data/commit/e351a97e9f6c57c74ffd01625e83b09de805d08a) +- [Dev Deps] remove unused script [`8f23366`](https://github.com/form-data/form-data/commit/8f233664842da5bd605ce85541defc713d1d1e0a) +- [Dev Deps] add missing peer dep [`02ff026`](https://github.com/form-data/form-data/commit/02ff026fda71f9943cfdd5754727c628adb8d135) +- [meta] fix readme capitalization [`2fd5f61`](https://github.com/form-data/form-data/commit/2fd5f61ebfb526cd015fb8e7b8b8c1add4a38872) + +## [v2.5.3](https://github.com/form-data/form-data/compare/v2.5.2...v2.5.3) - 2025-02-14 + +### Merged + +- [Fix] set `Symbol.toStringTag` when available [`#573`](https://github.com/form-data/form-data/pull/573) + +### Fixed + +- [Fix] set `Symbol.toStringTag` when available (#573) [`#396`](https://github.com/form-data/form-data/issues/396) + +### Commits + +- [Refactor] use `Object.prototype.hasOwnProperty.call` [`6e682d4`](https://github.com/form-data/form-data/commit/6e682d4bd41de7e80de41e3c4ee10f23fcc3dd00) +- [Dev Deps] update `@types/node`, `browserify`, `coveralls`, `eslint`, `formidable`, `in-publish`, `phantomjs-prebuilt`, `pkgfiles`, `pre-commit`, `request`, `tape`, `typescript` [`819f6b7`](https://github.com/form-data/form-data/commit/819f6b7a543306a891fca37c3a06d0ff4a734422) +- Only apps should have lockfiles [`b170ee2`](https://github.com/form-data/form-data/commit/b170ee2b22b4c695c363b811c0c553d2fb1bbd79) +- [Deps] update `combined-stream`, `mime-types` [`6b1ca1d`](https://github.com/form-data/form-data/commit/6b1ca1dc7362a1b1c3a99a885516cca4b7eb817f) +- Bumped version 2.5.3 [`9457283`](https://github.com/form-data/form-data/commit/9457283e1dce6122adc908fdd7442cfc54cabe7a) +- [Dev Deps] pin `request` which via `tough-cookie` ^2.4 depends on `psl` [`9dbe192`](https://github.com/form-data/form-data/commit/9dbe192be3db215eac4d9c0b980470a5c2c030c6) + +## [v2.5.2](https://github.com/form-data/form-data/compare/v2.5.1...v2.5.2) - 2024-10-10 + +### Merged + +- fix (npmignore): ignore temporary build files [`#532`](https://github.com/form-data/form-data/pull/532) + +### Commits + +- [Tests] migrate from travis to GHA [`806eda7`](https://github.com/form-data/form-data/commit/806eda77740e6e3c67c7815afb216f2e1f187ba5) +- [eslint] clean up ignores [`3a9d480`](https://github.com/form-data/form-data/commit/3a9d480232dbcbc07260ad84c3da4975d9a3ae9e) +- [Fix] `Buffer.from` and `Buffer.alloc` require node 4+ [`c499f76`](https://github.com/form-data/form-data/commit/c499f76f1faac1ddbf210c45217038e4c1e02337) +- Bumped version 2.5.2 [`7020dd4`](https://github.com/form-data/form-data/commit/7020dd4c1260370abc40e86e3dfe49c5d576fbda) +- [Dev Deps] downgrade `cross-spawn` [`3fc1a9b`](https://github.com/form-data/form-data/commit/3fc1a9b62ddf1fe77a2bd6bd3476e4c0a9e01a88) +- fix: move util.isArray to Array.isArray (#564) [`10418d1`](https://github.com/form-data/form-data/commit/10418d1fe4b0d65fe020eafe3911feb5ad5e2bd6) + +## [v2.5.1](https://github.com/form-data/form-data/compare/v2.5.0...v2.5.1) - 2019-08-28 + +### Merged + +- Fix error in callback signatures [`#435`](https://github.com/form-data/form-data/pull/435) +- -Fixed: Eerror in the documentations as indicated in #439 [`#440`](https://github.com/form-data/form-data/pull/440) +- Add constructor options to TypeScript defs [`#437`](https://github.com/form-data/form-data/pull/437) + +### Commits + +- Add remaining combined-stream options to typedef [`4d41a32`](https://github.com/form-data/form-data/commit/4d41a32c0b3f85f8bbc9cf17df43befd2d5fc305) +- Bumped version 2.5.1 [`8ce81f5`](https://github.com/form-data/form-data/commit/8ce81f56cccf5466363a5eff135ad394a929f59b) +- Bump rimraf to 2.7.1 [`a6bc2d4`](https://github.com/form-data/form-data/commit/a6bc2d4296dbdee5d84cbab7c69bcd0eea7a12e2) + +## [v2.5.0](https://github.com/form-data/form-data/compare/v2.4.0...v2.5.0) - 2019-07-03 + +### Merged + +- - Added: public methods with information and examples to readme [`#429`](https://github.com/form-data/form-data/pull/429) +- chore: move @types/node to devDep [`#431`](https://github.com/form-data/form-data/pull/431) +- Switched windows tests from AppVeyor to Travis [`#430`](https://github.com/form-data/form-data/pull/430) +- feat(typings): migrate TS typings #427 [`#428`](https://github.com/form-data/form-data/pull/428) +- enhance the method of path.basename, handle undefined case [`#421`](https://github.com/form-data/form-data/pull/421) + +### Commits + +- - Added: public methods with information and examples to the readme file. [`21323f3`](https://github.com/form-data/form-data/commit/21323f3b4043a167046a4a2554c5f2825356c423) +- feat(typings): migrate TS typings [`a3c0142`](https://github.com/form-data/form-data/commit/a3c0142ed91b0c7dcaf89c4f618776708f1f70a9) +- - Fixed: Typos [`37350fa`](https://github.com/form-data/form-data/commit/37350fa250782f156a998ec1fa9671866d40ac49) +- Switched to Travis Windows from Appveyor [`fc61c73`](https://github.com/form-data/form-data/commit/fc61c7381fad12662df16dbc3e7621c91b886f03) +- - Fixed: rendering of subheaders [`e93ed8d`](https://github.com/form-data/form-data/commit/e93ed8df9d7f22078bc3a2c24889e9dfa11e192d) +- Updated deps and readme [`e3d8628`](https://github.com/form-data/form-data/commit/e3d8628728f6e4817ab97deeed92f0c822661b89) +- Updated dependencies [`19add50`](https://github.com/form-data/form-data/commit/19add50afb7de66c70d189f422d16f1b886616e2) +- Bumped version to 2.5.0 [`905f173`](https://github.com/form-data/form-data/commit/905f173a3f785e8d312998e765634ee451ca5f42) +- - Fixed: filesize is not a valid option? knownLength should be used for streams [`d88f912`](https://github.com/form-data/form-data/commit/d88f912b75b666b47f8674467516eade69d2d5be) +- Bump notion of modern node to node8 [`508b626`](https://github.com/form-data/form-data/commit/508b626bf1b460d3733d3420dc1cfd001617f6ac) +- enhance the method of path.basename [`faaa68a`](https://github.com/form-data/form-data/commit/faaa68a297be7d4fca0ac4709d5b93afc1f78b5c) + +## [v2.4.0](https://github.com/form-data/form-data/compare/v2.3.2...v2.4.0) - 2019-06-19 + +### Merged + +- Added "getBuffer" method and updated certificates [`#419`](https://github.com/form-data/form-data/pull/419) +- docs(readme): add axios integration document [`#425`](https://github.com/form-data/form-data/pull/425) +- Allow newer versions of combined-stream [`#402`](https://github.com/form-data/form-data/pull/402) + +### Commits + +- Updated: Certificate [`e90a76a`](https://github.com/form-data/form-data/commit/e90a76ab3dcaa63a6f3045f8255bfbb9c25a3e4e) +- Updated build/test/badges [`8512eef`](https://github.com/form-data/form-data/commit/8512eef436e28372f5bc88de3ca76a9cb46e6847) +- Bumped version 2.4.0 [`0f8da06`](https://github.com/form-data/form-data/commit/0f8da06c0b4c997bd2f6b09d78290d339616a950) +- docs(readme): remove unnecessary bracket [`4e3954d`](https://github.com/form-data/form-data/commit/4e3954dde304d27e3b95371d8c78002f3af5d5b2) +- Bumped version to 2.3.3 [`b16916a`](https://github.com/form-data/form-data/commit/b16916a568a0d06f3f8a16c31f9a8b89b7844094) + +## [v2.3.2](https://github.com/form-data/form-data/compare/v2.3.1...v2.3.2) - 2018-02-13 + +### Merged + +- Pulling in fixed combined-stream [`#379`](https://github.com/form-data/form-data/pull/379) + +### Commits + +- All the dev dependencies are breaking in old versions of node :'( [`c7dba6a`](https://github.com/form-data/form-data/commit/c7dba6a139d872d173454845e25e1850ed6b72b4) +- Updated badges [`19b6c7a`](https://github.com/form-data/form-data/commit/19b6c7a8a5c40f47f91c8a8da3e5e4dc3c449fa3) +- Try tests in node@4 [`872a326`](https://github.com/form-data/form-data/commit/872a326ab13e2740b660ff589b75232c3a85fcc9) +- Pull in final version [`9d44871`](https://github.com/form-data/form-data/commit/9d44871073d647995270b19dbc26f65671ce15c7) + +## [v2.3.1](https://github.com/form-data/form-data/compare/v2.3.0...v2.3.1) - 2017-08-24 + +### Commits + +- Updated readme with custom options example [`8e0a569`](https://github.com/form-data/form-data/commit/8e0a5697026016fe171e93bec43c2205279e23ca) +- Added support (tests) for node 8 [`d1d6f4a`](https://github.com/form-data/form-data/commit/d1d6f4ad4670d8ba84cc85b28e522ca0e93eb362) + +## [v2.3.0](https://github.com/form-data/form-data/compare/v2.2.0...v2.3.0) - 2017-08-24 + +### Merged + +- Added custom `options` support [`#368`](https://github.com/form-data/form-data/pull/368) +- Allow form.submit with url string param to use https [`#249`](https://github.com/form-data/form-data/pull/249) +- Proper header production [`#357`](https://github.com/form-data/form-data/pull/357) +- Fix wrong MIME type in example [`#285`](https://github.com/form-data/form-data/pull/285) + +### Commits + +- allow form.submit with url string param to use https [`c0390dc`](https://github.com/form-data/form-data/commit/c0390dcc623e15215308fa2bb0225aa431d9381e) +- update tests for url parsing [`eec0e80`](https://github.com/form-data/form-data/commit/eec0e807889d46697abd39a89ad9bf39996ba787) +- Uses for in to assign properties instead of Object.assign [`f6854ed`](https://github.com/form-data/form-data/commit/f6854edd85c708191bb9c89615a09fd0a9afe518) +- Adds test to check for option override [`61762f2`](https://github.com/form-data/form-data/commit/61762f2c5262e576d6a7f778b4ebab6546ef8582) +- Removes the 2mb maxDataSize limitation [`dc171c3`](https://github.com/form-data/form-data/commit/dc171c3ba49ac9b8813636fd4159d139b812315b) +- Ignore .DS_Store [`e8a05d3`](https://github.com/form-data/form-data/commit/e8a05d33361f7dca8927fe1d96433d049843de24) + +## [v2.2.0](https://github.com/form-data/form-data/compare/v2.1.4...v2.2.0) - 2017-06-11 + +### Merged + +- Filename can be a nested path [`#355`](https://github.com/form-data/form-data/pull/355) + +### Commits + +- Bumped version number. [`d7398c3`](https://github.com/form-data/form-data/commit/d7398c3e7cd81ed12ecc0b84363721bae467db02) + +## [v2.1.4](https://github.com/form-data/form-data/compare/2.1.3...v2.1.4) - 2017-04-08 + +## [2.1.3](https://github.com/form-data/form-data/compare/v2.1.3...2.1.3) - 2017-04-08 + +## [v2.1.3](https://github.com/form-data/form-data/compare/v2.1.2...v2.1.3) - 2017-04-08 + +### Merged + +- toString should output '[object FormData]' [`#346`](https://github.com/form-data/form-data/pull/346) + +## [v2.1.2](https://github.com/form-data/form-data/compare/v2.1.1...v2.1.2) - 2016-11-07 + +### Merged + +- #271 Added check for self and window objects + tests [`#282`](https://github.com/form-data/form-data/pull/282) + +### Commits + +- Added check for self and window objects + tests [`c99e4ec`](https://github.com/form-data/form-data/commit/c99e4ec32cd14d83776f2bdcc5a4e7384131c1b1) + +## [v2.1.1](https://github.com/form-data/form-data/compare/v2.1.0...v2.1.1) - 2016-10-03 + +### Merged + +- Bumped dependencies. [`#270`](https://github.com/form-data/form-data/pull/270) +- Update browser.js shim to use self instead of window [`#267`](https://github.com/form-data/form-data/pull/267) +- Boilerplate code rediction [`#265`](https://github.com/form-data/form-data/pull/265) +- eslint@3.7.0 [`#266`](https://github.com/form-data/form-data/pull/266) + +### Commits + +- code duplicates removed [`e9239fb`](https://github.com/form-data/form-data/commit/e9239fbe7d3c897b29fe3bde857d772469541c01) +- Changed according to requests [`aa99246`](https://github.com/form-data/form-data/commit/aa9924626bd9168334d73fea568c0ad9d8fbaa96) +- chore(package): update eslint to version 3.7.0 [`090a859`](https://github.com/form-data/form-data/commit/090a859835016cab0de49629140499e418db9c3a) + +## [v2.1.0](https://github.com/form-data/form-data/compare/v2.0.0...v2.1.0) - 2016-09-25 + +### Merged + +- Added `hasKnownLength` public method [`#263`](https://github.com/form-data/form-data/pull/263) + +### Commits + +- Added hasKnownLength public method [`655b959`](https://github.com/form-data/form-data/commit/655b95988ef2ed3399f8796b29b2a8673c1df11c) + +## [v2.0.0](https://github.com/form-data/form-data/compare/v1.0.0...v2.0.0) - 2016-09-16 + +### Merged + +- Replaced async with asynckit [`#258`](https://github.com/form-data/form-data/pull/258) +- Pre-release house cleaning [`#247`](https://github.com/form-data/form-data/pull/247) + +### Commits + +- Replaced async with asynckit. Modernized [`1749b78`](https://github.com/form-data/form-data/commit/1749b78d50580fbd080e65c1eb9702ad4f4fc0c0) +- Ignore .bak files [`c08190a`](https://github.com/form-data/form-data/commit/c08190a87d3e22a528b6e32b622193742a4c2672) +- Trying to be more chatty. :) [`c79eabb`](https://github.com/form-data/form-data/commit/c79eabb24eaf761069255a44abf4f540cfd47d40) + +## [v1.0.0](https://github.com/form-data/form-data/compare/v1.0.0-rc4...v1.0.0) - 2016-08-26 + +### Merged + +- Allow custom header fields to be set as an object. [`#190`](https://github.com/form-data/form-data/pull/190) +- v1.0.0-rc4 [`#182`](https://github.com/form-data/form-data/pull/182) +- Avoid undefined variable reference in older browsers [`#176`](https://github.com/form-data/form-data/pull/176) +- More housecleaning [`#164`](https://github.com/form-data/form-data/pull/164) +- More cleanup [`#159`](https://github.com/form-data/form-data/pull/159) +- Added windows testing. Some cleanup. [`#158`](https://github.com/form-data/form-data/pull/158) +- Housecleaning. Added test coverage. [`#156`](https://github.com/form-data/form-data/pull/156) +- Second iteration of cleanup. [`#145`](https://github.com/form-data/form-data/pull/145) + +### Commits + +- Pre-release house cleaning [`440d72b`](https://github.com/form-data/form-data/commit/440d72b5fd44dd132f42598c3183d46e5f35ce71) +- Updated deps, updated docs [`54b6114`](https://github.com/form-data/form-data/commit/54b61143e9ce66a656dd537a1e7b31319a4991be) +- make docs up-to-date [`5e383d7`](https://github.com/form-data/form-data/commit/5e383d7f1466713f7fcef58a6817e0cb466c8ba7) +- Added missing deps [`fe04862`](https://github.com/form-data/form-data/commit/fe04862000b2762245e2db69d5207696a08c1174) + +## [v1.0.0-rc4](https://github.com/form-data/form-data/compare/v1.0.0-rc3...v1.0.0-rc4) - 2016-03-15 + +### Merged + +- Housecleaning, preparing for the release [`#144`](https://github.com/form-data/form-data/pull/144) +- lib: emit error when failing to get length [`#127`](https://github.com/form-data/form-data/pull/127) +- Cleaning up for Codacity 2. [`#143`](https://github.com/form-data/form-data/pull/143) +- Cleaned up codacity concerns. [`#142`](https://github.com/form-data/form-data/pull/142) +- Should throw type error without new operator. [`#129`](https://github.com/form-data/form-data/pull/129) + +### Commits + +- More cleanup [`94b6565`](https://github.com/form-data/form-data/commit/94b6565bb98a387335c72feff5ed5c10da0a7f6f) +- Shuffling things around [`3c2f172`](https://github.com/form-data/form-data/commit/3c2f172eaddf0979b3eef5c73985d1a6fd3eee4a) +- Second iteration of cleanup. [`347c88e`](https://github.com/form-data/form-data/commit/347c88ef9a99a66b9bcf4278497425db2f0182b2) +- Housecleaning [`c335610`](https://github.com/form-data/form-data/commit/c3356100c054a4695e4dec8ed7072775cd745616) +- More housecleaning [`f573321`](https://github.com/form-data/form-data/commit/f573321824aae37ba2052a92cc889d533d9f8fb8) +- Trying to make far run on windows. + cleanup [`e426dfc`](https://github.com/form-data/form-data/commit/e426dfcefb07ee307d8a15dec04044cce62413e6) +- Playing with appveyor [`c9458a7`](https://github.com/form-data/form-data/commit/c9458a7c328782b19859bc1745e7d6b2005ede86) +- Updated dev dependencies. [`ceebe88`](https://github.com/form-data/form-data/commit/ceebe88872bb22da0a5a98daf384e3cc232928d3) +- Replaced win-spawn with cross-spawn [`405a69e`](https://github.com/form-data/form-data/commit/405a69ee34e235ee6561b5ff0140b561be40d1cc) +- Updated readme badges. [`12f282a`](https://github.com/form-data/form-data/commit/12f282a1310fcc2f70cc5669782283929c32a63d) +- Making paths windows friendly. [`f4bddc5`](https://github.com/form-data/form-data/commit/f4bddc5955e2472f8e23c892c9b4d7a08fcb85a3) +- [WIP] trying things for greater sanity [`8ad1f02`](https://github.com/form-data/form-data/commit/8ad1f02b0b3db4a0b00c5d6145ed69bcb7558213) +- Bending under Codacy [`bfff3bb`](https://github.com/form-data/form-data/commit/bfff3bb36052dc83f429949b4e6f9b146a49d996) +- Another attempt to make windows friendly [`f3eb628`](https://github.com/form-data/form-data/commit/f3eb628974ccb91ba0020f41df490207eeed77f6) +- Updated dependencies. [`f73996e`](https://github.com/form-data/form-data/commit/f73996e0508ee2d4b2b376276adfac1de4188ac2) +- Missed travis changes. [`67ee79f`](https://github.com/form-data/form-data/commit/67ee79f964fdabaf300bd41b0af0c1cfaca07687) +- Restructured badges. [`48444a1`](https://github.com/form-data/form-data/commit/48444a1ff156ba2c2c3cfd11047c2f2fd92d4474) +- Add similar type error as the browser for attempting to use form-data without new. [`5711320`](https://github.com/form-data/form-data/commit/5711320fb7c8cc620cfc79b24c7721526e23e539) +- Took out codeclimate-test-reporter [`a7e0c65`](https://github.com/form-data/form-data/commit/a7e0c6522afe85ca9974b0b4e1fca9c77c3e52b1) +- One more [`8e84cff`](https://github.com/form-data/form-data/commit/8e84cff3370526ecd3e175fd98e966242d81993c) + +## [v1.0.0-rc3](https://github.com/form-data/form-data/compare/v1.0.0-rc2...v1.0.0-rc3) - 2015-07-29 + +### Merged + +- House cleaning. Added `pre-commit`. [`#140`](https://github.com/form-data/form-data/pull/140) +- Allow custom content-type without setting a filename. [`#138`](https://github.com/form-data/form-data/pull/138) +- Add node-fetch to alternative submission methods. [`#132`](https://github.com/form-data/form-data/pull/132) +- Update dependencies [`#130`](https://github.com/form-data/form-data/pull/130) +- Switching to container based TravisCI [`#136`](https://github.com/form-data/form-data/pull/136) +- Default content-type to 'application/octect-stream' [`#128`](https://github.com/form-data/form-data/pull/128) +- Allow filename as third option of .append [`#125`](https://github.com/form-data/form-data/pull/125) + +### Commits + +- Allow custom content-type without setting a filename [`c8a77cc`](https://github.com/form-data/form-data/commit/c8a77cc0cf16d15f1ebf25272beaab639ce89f76) +- Fixed ranged test. [`a5ac58c`](https://github.com/form-data/form-data/commit/a5ac58cbafd0909f32fe8301998f689314fd4859) +- Allow filename as third option of #append [`d081005`](https://github.com/form-data/form-data/commit/d0810058c84764b3c463a18b15ebb37864de9260) +- Allow custom content-type without setting a filename [`8cb9709`](https://github.com/form-data/form-data/commit/8cb9709e5f1809cfde0cd707dbabf277138cd771) + +## [v1.0.0-rc2](https://github.com/form-data/form-data/compare/v1.0.0-rc1...v1.0.0-rc2) - 2015-07-21 + +### Merged + +- #109 Append proper line break [`#123`](https://github.com/form-data/form-data/pull/123) +- Add shim for browser (browserify/webpack). [`#122`](https://github.com/form-data/form-data/pull/122) +- Update license field [`#115`](https://github.com/form-data/form-data/pull/115) + +### Commits + +- Add shim for browser. [`87c33f4`](https://github.com/form-data/form-data/commit/87c33f4269a2211938f80ab3e53835362b1afee8) +- Bump version [`a3f5d88`](https://github.com/form-data/form-data/commit/a3f5d8872c810ce240c7d3838c69c3c9fcecc111) + +## [v1.0.0-rc1](https://github.com/form-data/form-data/compare/0.2...v1.0.0-rc1) - 2015-06-13 + +### Merged + +- v1.0.0-rc1 [`#114`](https://github.com/form-data/form-data/pull/114) +- Updated test targets [`#102`](https://github.com/form-data/form-data/pull/102) +- Remove duplicate plus sign [`#94`](https://github.com/form-data/form-data/pull/94) + +### Commits + +- Made https test local. Updated deps. [`afe1959`](https://github.com/form-data/form-data/commit/afe1959ec711f23e57038ab5cb20fedd86271f29) +- Proper self-signed ssl [`4d5ec50`](https://github.com/form-data/form-data/commit/4d5ec50e81109ad2addf3dbb56dc7c134df5ff87) +- Update HTTPS handling for modern days [`2c11b01`](https://github.com/form-data/form-data/commit/2c11b01ce2c06e205c84d7154fa2f27b66c94f3b) +- Made tests more local [`09633fa`](https://github.com/form-data/form-data/commit/09633fa249e7ce3ac581543aafe16ee9039a823b) +- Auto create tmp folder for Formidable [`28714b7`](https://github.com/form-data/form-data/commit/28714b7f71ad556064cdff88fabe6b92bd407ddd) +- remove duplicate plus sign [`36e09c6`](https://github.com/form-data/form-data/commit/36e09c695b0514d91a23f5cd64e6805404776fc7) + +## [0.2](https://github.com/form-data/form-data/compare/0.1.4...0.2) - 2014-12-06 + +### Merged + +- Bumped version [`#96`](https://github.com/form-data/form-data/pull/96) +- Replace mime library. [`#95`](https://github.com/form-data/form-data/pull/95) +- #71 Respect bytes range in a read stream. [`#73`](https://github.com/form-data/form-data/pull/73) + +## [0.1.4](https://github.com/form-data/form-data/compare/0.1.3...0.1.4) - 2014-06-23 + +### Merged + +- Updated version. [`#76`](https://github.com/form-data/form-data/pull/76) +- #71 Respect bytes range in a read stream. [`#75`](https://github.com/form-data/form-data/pull/75) + +## [0.1.3](https://github.com/form-data/form-data/compare/0.1.2...0.1.3) - 2014-06-17 + +### Merged + +- Updated versions. [`#69`](https://github.com/form-data/form-data/pull/69) +- Added custom headers support [`#60`](https://github.com/form-data/form-data/pull/60) +- Added test for Request. Small fixes. [`#56`](https://github.com/form-data/form-data/pull/56) + +### Commits + +- Added test for the custom header functionality [`bd50685`](https://github.com/form-data/form-data/commit/bd506855af62daf728ef1718cae88ed23bb732f3) +- Documented custom headers option [`77a024a`](https://github.com/form-data/form-data/commit/77a024a9375f93c246c35513d80f37d5e11d35ff) +- Removed 0.6 support. [`aee8dce`](https://github.com/form-data/form-data/commit/aee8dce604c595cfaacfc6efb12453d1691ac0d6) + +## [0.1.2](https://github.com/form-data/form-data/compare/0.1.1...0.1.2) - 2013-10-02 + +### Merged + +- Fixed default https port assignment, added tests. [`#52`](https://github.com/form-data/form-data/pull/52) +- #45 Added tests for multi-submit. Updated readme. [`#49`](https://github.com/form-data/form-data/pull/49) +- #47 return request from .submit() [`#48`](https://github.com/form-data/form-data/pull/48) + +### Commits + +- Bumped version. [`2b761b2`](https://github.com/form-data/form-data/commit/2b761b256ae607fc2121621f12c2e1042be26baf) + +## [0.1.1](https://github.com/form-data/form-data/compare/0.1.0...0.1.1) - 2013-08-21 + +### Merged + +- Added license type and reference to package.json [`#46`](https://github.com/form-data/form-data/pull/46) + +### Commits + +- #47 return request from .submit() [`1d61c2d`](https://github.com/form-data/form-data/commit/1d61c2da518bd5e136550faa3b5235bb540f1e06) +- #47 Updated readme. [`e3dae15`](https://github.com/form-data/form-data/commit/e3dae1526bd3c3b9d7aff6075abdaac12c3cc60f) + +## [0.1.0](https://github.com/form-data/form-data/compare/0.0.10...0.1.0) - 2013-07-08 + +### Merged + +- Update master to 0.1.0 [`#44`](https://github.com/form-data/form-data/pull/44) +- 0.1.0 - Added error handling. Streamlined edge cases behavior. [`#43`](https://github.com/form-data/form-data/pull/43) +- Pointed badges back to mothership. [`#39`](https://github.com/form-data/form-data/pull/39) +- Updated node-fake to support 0.11 tests. [`#37`](https://github.com/form-data/form-data/pull/37) +- Updated tests to play nice with 0.10 [`#36`](https://github.com/form-data/form-data/pull/36) +- #32 Added .npmignore [`#34`](https://github.com/form-data/form-data/pull/34) +- Spring cleaning [`#30`](https://github.com/form-data/form-data/pull/30) + +### Commits + +- Added error handling. Streamlined edge cases behavior. [`4da496e`](https://github.com/form-data/form-data/commit/4da496e577cb9bc0fd6c94cbf9333a0082ce353a) +- Made tests more deterministic. [`7fc009b`](https://github.com/form-data/form-data/commit/7fc009b8a2cc9232514a44b2808b9f89ce68f7d2) +- Fixed styling. [`d373b41`](https://github.com/form-data/form-data/commit/d373b417e779024bc3326073e176383cd08c0b18) +- #40 Updated Readme.md regarding getLengthSync() [`efb373f`](https://github.com/form-data/form-data/commit/efb373fd63814d977960e0299d23c92cd876cfef) +- Updated readme. [`527e3a6`](https://github.com/form-data/form-data/commit/527e3a63b032cb6f576f597ad7ff2ebcf8a0b9b4) + +## [0.0.10](https://github.com/form-data/form-data/compare/0.0.9...0.0.10) - 2013-05-08 + +### Commits + +- Updated tests to play nice with 0.10. [`932b39b`](https://github.com/form-data/form-data/commit/932b39b773e49edcb2c5d2e58fe389ab6c42f47c) +- Added dependency tracking. [`3131d7f`](https://github.com/form-data/form-data/commit/3131d7f6996cd519d50547e4de1587fd80d0fa07) + +## 0.0.9 - 2013-04-29 + +### Merged + +- Custom params for form.submit() should cover most edge cases. [`#22`](https://github.com/form-data/form-data/pull/22) +- Updated Readme and version number. [`#20`](https://github.com/form-data/form-data/pull/20) +- Allow custom headers and pre-known length in parts [`#17`](https://github.com/form-data/form-data/pull/17) +- Bumped version number. [`#12`](https://github.com/form-data/form-data/pull/12) +- Fix for #10 [`#11`](https://github.com/form-data/form-data/pull/11) +- Bumped version number. [`#8`](https://github.com/form-data/form-data/pull/8) +- Added support for https destination, http-response and mikeal's request streams. [`#7`](https://github.com/form-data/form-data/pull/7) +- Updated git url. [`#6`](https://github.com/form-data/form-data/pull/6) +- Version bump. [`#5`](https://github.com/form-data/form-data/pull/5) +- Changes to support custom content-type and getLengthSync. [`#4`](https://github.com/form-data/form-data/pull/4) +- make .submit(url) use host from url, not 'localhost' [`#2`](https://github.com/form-data/form-data/pull/2) +- Make package.json JSON [`#1`](https://github.com/form-data/form-data/pull/1) + +### Fixed + +- Add MIT license [`#14`](https://github.com/form-data/form-data/issues/14) + +### Commits + +- Spring cleaning. [`850ba1b`](https://github.com/form-data/form-data/commit/850ba1b649b6856b0fa87bbcb04bc70ece0137a6) +- Added custom request params to form.submit(). Made tests more stable. [`de3502f`](https://github.com/form-data/form-data/commit/de3502f6c4a509f6ed12a7dd9dc2ce9c2e0a8d23) +- Basic form (no files) working [`6ffdc34`](https://github.com/form-data/form-data/commit/6ffdc343e8594cfc2efe1e27653ea39d8980a14e) +- Got initial test to pass [`9a59d08`](https://github.com/form-data/form-data/commit/9a59d08c024479fd3c9d99ba2f0893a47b3980f0) +- Implement initial getLength [`9060c91`](https://github.com/form-data/form-data/commit/9060c91b861a6573b73beddd11e866db422b5830) +- Make getLength work with file streams [`6f6b1e9`](https://github.com/form-data/form-data/commit/6f6b1e9b65951e6314167db33b446351702f5558) +- Implemented a simplistic submit() function [`41e9cc1`](https://github.com/form-data/form-data/commit/41e9cc124124721e53bc1d1459d45db1410c44e6) +- added test for custom headers and content-length in parts (felixge/node-form-data/17) [`b16d14e`](https://github.com/form-data/form-data/commit/b16d14e693670f5d52babec32cdedd1aa07c1aa4) +- Fixed code styling. [`5847424`](https://github.com/form-data/form-data/commit/5847424c666970fc2060acd619e8a78678888a82) +- #29 Added custom filename and content-type options to support identity-less streams. [`adf8b4a`](https://github.com/form-data/form-data/commit/adf8b4a41530795682cd3e35ffaf26b30288ccda) +- Initial Readme and package.json [`8c744e5`](https://github.com/form-data/form-data/commit/8c744e58be4014bdf432e11b718ed87f03e217af) +- allow append() to completely override header and boundary [`3fb2ad4`](https://github.com/form-data/form-data/commit/3fb2ad491f66e4b4ff16130be25b462820b8c972) +- Syntax highlighting [`ab3a6a5`](https://github.com/form-data/form-data/commit/ab3a6a5ed1ab77a2943ce3befcb2bb3cd9ff0330) +- Updated Readme.md [`de8f441`](https://github.com/form-data/form-data/commit/de8f44122ca754cbfedc0d2748e84add5ff0b669) +- Added examples to Readme file. [`c406ac9`](https://github.com/form-data/form-data/commit/c406ac921d299cbc130464ed19338a9ef97cb650) +- pass options.knownLength to set length at beginning, w/o waiting for async size calculation [`e2ac039`](https://github.com/form-data/form-data/commit/e2ac0397ff7c37c3dca74fa9925b55f832e4fa0b) +- Updated dependencies and added test command. [`09bd7cd`](https://github.com/form-data/form-data/commit/09bd7cd86f1ad7a58df1b135eb6eef0d290894b4) +- Bumped version. Updated readme. [`4581140`](https://github.com/form-data/form-data/commit/4581140f322758c6fc92019d342c7d7d6c94af5c) +- Test runner [`1707ebb`](https://github.com/form-data/form-data/commit/1707ebbd180856e6ed44e80c46b02557e2425762) +- Added .npmignore, bumped version. [`2e033e0`](https://github.com/form-data/form-data/commit/2e033e0e4be7c1457be090cd9b2996f19d8fb665) +- FormData.prototype.append takes and passes along options (for header) [`b519203`](https://github.com/form-data/form-data/commit/b51920387ed4da7b4e106fc07b9459f26b5ae2f0) +- Make package.json JSON [`bf1b58d`](https://github.com/form-data/form-data/commit/bf1b58df794b10fda86ed013eb9237b1e5032085) +- Add dependencies to package.json [`7413d0b`](https://github.com/form-data/form-data/commit/7413d0b4cf5546312d47ea426db8180619083974) +- Add convenient submit() interface [`55855e4`](https://github.com/form-data/form-data/commit/55855e4bea14585d4a3faf9e7318a56696adbc7d) +- Fix content type [`08b6ae3`](https://github.com/form-data/form-data/commit/08b6ae337b23ef1ba457ead72c9b133047df213c) +- Combatting travis rvm calls. [`409adfd`](https://github.com/form-data/form-data/commit/409adfd100a3cf4968a632c05ba58d92d262d144) +- Fixed Issue #2 [`b3a5d66`](https://github.com/form-data/form-data/commit/b3a5d661739dcd6921b444b81d5cb3c32fab655d) +- Fix for #10. [`bab70b9`](https://github.com/form-data/form-data/commit/bab70b9e803e17287632762073d227d6c59989e0) +- Trying workarounds for formidable - 0.6 "love". [`25782a3`](https://github.com/form-data/form-data/commit/25782a3f183d9c30668ec2bca6247ed83f10611c) +- change whitespace to conform with felixge's style guide [`9fa34f4`](https://github.com/form-data/form-data/commit/9fa34f433bece85ef73086a874c6f0164ab7f1f6) +- Add async to deps [`b7d1a6b`](https://github.com/form-data/form-data/commit/b7d1a6b10ee74be831de24ed76843e5a6935f155) +- typo [`7860a9c`](https://github.com/form-data/form-data/commit/7860a9c8a582f0745ce0e4a0549f4bffc29c0b50) +- Bumped version. [`fa36c1b`](https://github.com/form-data/form-data/commit/fa36c1b4229c34b85d7efd41908429b6d1da3bfc) +- Updated .gitignore [`de567bd`](https://github.com/form-data/form-data/commit/de567bde620e53b8e9b0ed3506e79491525ec558) +- Don't rely on resume() being called by pipe [`1deae47`](https://github.com/form-data/form-data/commit/1deae47e042bcd170bd5dbe2b4a4fa5356bb8aa2) +- One more wrong content type [`28f166d`](https://github.com/form-data/form-data/commit/28f166d443e2eb77f2559324014670674b97e46e) +- Another typo [`b959b6a`](https://github.com/form-data/form-data/commit/b959b6a2be061cac17f8d329b89cea109f0f32be) +- Typo [`698fa0a`](https://github.com/form-data/form-data/commit/698fa0aa5dbf4eeb77377415acc202a6fbe3f4a2) +- Being simply dumb. [`b614db8`](https://github.com/form-data/form-data/commit/b614db85702061149fbd98418605106975e72ade) +- Fixed typo in the filename. [`30af6be`](https://github.com/form-data/form-data/commit/30af6be13fb0c9e92b32e935317680b9d7599928) diff --git a/node_modules/form-data/License b/node_modules/form-data/License new file mode 100644 index 0000000..c7ff12a --- /dev/null +++ b/node_modules/form-data/License @@ -0,0 +1,19 @@ +Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/node_modules/form-data/README.md b/node_modules/form-data/README.md new file mode 100644 index 0000000..f850e30 --- /dev/null +++ b/node_modules/form-data/README.md @@ -0,0 +1,355 @@ +# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) + +A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. + +The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. + +[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface + +[![Linux Build](https://img.shields.io/travis/form-data/form-data/v4.0.5.svg?label=linux:6.x-12.x)](https://travis-ci.org/form-data/form-data) +[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v4.0.5.svg?label=macos:6.x-12.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/travis/form-data/form-data/v4.0.5.svg?label=windows:6.x-12.x)](https://travis-ci.org/form-data/form-data) + +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v4.0.5.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) +[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) + +## Install + +``` +npm install --save form-data +``` + +## Usage + +In this example we are constructing a form with 3 fields that contain a string, +a buffer and a file stream. + +``` javascript +var FormData = require('form-data'); +var fs = require('fs'); + +var form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +``` + +Also you can use http-response stream: + +``` javascript +var FormData = require('form-data'); +var http = require('http'); + +var form = new FormData(); + +http.request('http://nodejs.org/images/logo.png', function (response) { + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', response); +}); +``` + +Or @mikeal's [request](https://github.com/request/request) stream: + +``` javascript +var FormData = require('form-data'); +var request = require('request'); + +var form = new FormData(); + +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_logo', request('http://nodejs.org/images/logo.png')); +``` + +In order to submit this form to a web application, call ```submit(url, [callback])``` method: + +``` javascript +form.submit('http://example.org/', function (err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +}); + +``` + +For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. + +### Custom options + +You can provide custom options, such as `maxDataSize`: + +``` javascript +var FormData = require('form-data'); + +var form = new FormData({ maxDataSize: 20971520 }); +form.append('my_field', 'my value'); +form.append('my_buffer', /* something big */); +``` + +List of available options could be found in [combined-stream](https://github.com/felixge/node-combined-stream/blob/master/lib/combined_stream.js#L7-L15) + +### Alternative submission methods + +You can use node's http client interface: + +``` javascript +var http = require('http'); + +var request = http.request({ + method: 'post', + host: 'example.org', + path: '/upload', + headers: form.getHeaders() +}); + +form.pipe(request); + +request.on('response', function (res) { + console.log(res.statusCode); +}); +``` + +Or if you would prefer the `'Content-Length'` header to be set for you: + +``` javascript +form.submit('example.org/upload', function (err, res) { + console.log(res.statusCode); +}); +``` + +To use custom headers and pre-known length in parts: + +``` javascript +var CRLF = '\r\n'; +var form = new FormData(); + +var options = { + header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, + knownLength: 1 +}; + +form.append('my_buffer', buffer, options); + +form.submit('http://example.com/', function (err, res) { + if (err) throw err; + console.log('Done'); +}); +``` + +Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: + +``` javascript +someModule.stream(function (err, stdout, stderr) { + if (err) throw err; + + var form = new FormData(); + + form.append('file', stdout, { + filename: 'unicycle.jpg', // ... or: + filepath: 'photos/toys/unicycle.jpg', + contentType: 'image/jpeg', + knownLength: 19806 + }); + + form.submit('http://example.com/', function (err, res) { + if (err) throw err; + console.log('Done'); + }); +}); +``` + +The `filepath` property overrides `filename` and may contain a relative path. This is typically used when uploading [multiple files from a directory](https://wicg.github.io/entries-api/#dom-htmlinputelement-webkitdirectory). + +For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: + +``` javascript +form.submit({ + host: 'example.com', + path: '/probably.php?extra=params', + auth: 'username:password' +}, function (err, res) { + console.log(res.statusCode); +}); +``` + +In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: + +``` javascript +form.submit({ + host: 'example.com', + path: '/surelynot.php', + headers: { 'x-test-header': 'test-header-value' } +}, function (err, res) { + console.log(res.statusCode); +}); +``` + +### Methods + +- [_Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] )](https://github.com/form-data/form-data#void-append-string-field-mixed-value--mixed-options-). +- [_Headers_ getHeaders( [**Headers** _userHeaders_] )](https://github.com/form-data/form-data#array-getheaders-array-userheaders-) +- [_String_ getBoundary()](https://github.com/form-data/form-data#string-getboundary) +- [_Void_ setBoundary()](https://github.com/form-data/form-data#void-setboundary) +- [_Buffer_ getBuffer()](https://github.com/form-data/form-data#buffer-getbuffer) +- [_Integer_ getLengthSync()](https://github.com/form-data/form-data#integer-getlengthsync) +- [_Integer_ getLength( **function** _callback_ )](https://github.com/form-data/form-data#integer-getlength-function-callback-) +- [_Boolean_ hasKnownLength()](https://github.com/form-data/form-data#boolean-hasknownlength) +- [_Request_ submit( _params_, **function** _callback_ )](https://github.com/form-data/form-data#request-submit-params-function-callback-) +- [_String_ toString()](https://github.com/form-data/form-data#string-tostring) + +#### _Void_ append( **String** _field_, **Mixed** _value_ [, **Mixed** _options_] ) +Append data to the form. You can submit about any format (string, integer, boolean, buffer, etc.). However, Arrays are not supported and need to be turned into strings by the user. +```javascript +var form = new FormData(); +form.append('my_string', 'my value'); +form.append('my_integer', 1); +form.append('my_boolean', true); +form.append('my_buffer', new Buffer(10)); +form.append('my_array_as_json', JSON.stringify(['bird', 'cute'])); +``` + +You may provide a string for options, or an object. +```javascript +// Set filename by providing a string for options +form.append('my_file', fs.createReadStream('/foo/bar.jpg'), 'bar.jpg'); + +// provide an object. +form.append('my_file', fs.createReadStream('/foo/bar.jpg'), { filename: 'bar.jpg', contentType: 'image/jpeg', knownLength: 19806 }); +``` + +#### _Headers_ getHeaders( [**Headers** _userHeaders_] ) +This method adds the correct `content-type` header to the provided array of `userHeaders`. + +#### _String_ getBoundary() +Return the boundary of the formData. By default, the boundary consists of 26 `-` followed by 24 numbers +for example: +```javascript +--------------------------515890814546601021194782 +``` + +#### _Void_ setBoundary(String _boundary_) +Set the boundary string, overriding the default behavior described above. + +_Note: The boundary must be unique and may not appear in the data._ + +#### _Buffer_ getBuffer() +Return the full formdata request package, as a Buffer. You can insert this Buffer in e.g. Axios to send multipart data. +```javascript +var form = new FormData(); +form.append('my_buffer', Buffer.from([0x4a,0x42,0x20,0x52,0x6f,0x63,0x6b,0x73])); +form.append('my_file', fs.readFileSync('/foo/bar.jpg')); + +axios.post('https://example.com/path/to/api', form.getBuffer(), form.getHeaders()); +``` +**Note:** Because the output is of type Buffer, you can only append types that are accepted by Buffer: *string, Buffer, ArrayBuffer, Array, or Array-like Object*. A ReadStream for example will result in an error. + +#### _Integer_ getLengthSync() +Same as `getLength` but synchronous. + +_Note: getLengthSync __doesn't__ calculate streams length._ + +#### _Integer_ getLength(**function** _callback_ ) +Returns the `Content-Length` async. The callback is used to handle errors and continue once the length has been calculated +```javascript +this.getLength(function (err, length) { + if (err) { + this._error(err); + return; + } + + // add content length + request.setHeader('Content-Length', length); + + ... +}.bind(this)); +``` + +#### _Boolean_ hasKnownLength() +Checks if the length of added values is known. + +#### _Request_ submit(_params_, **function** _callback_ ) +Submit the form to a web application. +```javascript +var form = new FormData(); +form.append('my_string', 'Hello World'); + +form.submit('http://example.com/', function (err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +} ); +``` + +#### _String_ toString() +Returns the form data as a string. Don't use this if you are sending files or buffers, use `getBuffer()` instead. + +### Integration with other libraries + +#### Request + +Form submission using [request](https://github.com/request/request): + +```javascript +var formData = { + my_field: 'my_value', + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), +}; + +request.post({url:'http://service.com/upload', formData: formData}, function (err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads). + +#### node-fetch + +You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch): + +```javascript +var form = new FormData(); + +form.append('a', 1); + +fetch('http://example.com', { method: 'POST', body: form }) + .then(function (res) { + return res.json(); + }).then(function (json) { + console.log(json); + }); +``` + +#### axios + +In Node.js you can post a file using [axios](https://github.com/axios/axios): +```javascript +const form = new FormData(); +const stream = fs.createReadStream(PATH_TO_FILE); + +form.append('image', stream); + +// In Node.js environment you need to set boundary in the header field 'Content-Type' by calling method `getHeaders` +const formHeaders = form.getHeaders(); + +axios.post('http://example.com', form, { + headers: { + ...formHeaders, + }, +}) + .then(response => response) + .catch(error => error) +``` + +## Notes + +- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. +- ```getLength(cb)``` will send an error as first parameter of callback if stream length cannot be calculated (e.g. send in custom streams w/o using ```knownLength```). +- ```submit``` will not add `content-length` if form length is unknown or not calculable. +- Starting version `2.x` FormData has dropped support for `node@0.10.x`. +- Starting version `3.x` FormData has dropped support for `node@4.x`. + +## License + +Form-Data is released under the [MIT](License) license. diff --git a/node_modules/form-data/index.d.ts b/node_modules/form-data/index.d.ts new file mode 100644 index 0000000..295e9e9 --- /dev/null +++ b/node_modules/form-data/index.d.ts @@ -0,0 +1,62 @@ +// Definitions by: Carlos Ballesteros Velasco +// Leon Yu +// BendingBender +// Maple Miao + +/// +import * as stream from 'stream'; +import * as http from 'http'; + +export = FormData; + +// Extracted because @types/node doesn't export interfaces. +interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + read?(this: stream.Readable, size: number): void; + destroy?(this: stream.Readable, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean; +} + +interface Options extends ReadableOptions { + writable?: boolean; + readable?: boolean; + dataSize?: number; + maxDataSize?: number; + pauseStreams?: boolean; +} + +declare class FormData extends stream.Readable { + constructor(options?: Options); + append(key: string, value: any, options?: FormData.AppendOptions | string): void; + getHeaders(userHeaders?: FormData.Headers): FormData.Headers; + submit( + params: string | FormData.SubmitOptions, + callback?: (error: Error | null, response: http.IncomingMessage) => void + ): http.ClientRequest; + getBuffer(): Buffer; + setBoundary(boundary: string): void; + getBoundary(): string; + getLength(callback: (err: Error | null, length: number) => void): void; + getLengthSync(): number; + hasKnownLength(): boolean; +} + +declare namespace FormData { + interface Headers { + [key: string]: any; + } + + interface AppendOptions { + header?: string | Headers; + knownLength?: number; + filename?: string; + filepath?: string; + contentType?: string; + } + + interface SubmitOptions extends http.RequestOptions { + protocol?: 'https:' | 'http:'; + } +} diff --git a/node_modules/form-data/lib/browser.js b/node_modules/form-data/lib/browser.js new file mode 100644 index 0000000..8950a91 --- /dev/null +++ b/node_modules/form-data/lib/browser.js @@ -0,0 +1,4 @@ +'use strict'; + +/* eslint-env browser */ +module.exports = typeof self === 'object' ? self.FormData : window.FormData; diff --git a/node_modules/form-data/lib/form_data.js b/node_modules/form-data/lib/form_data.js new file mode 100644 index 0000000..63a0f01 --- /dev/null +++ b/node_modules/form-data/lib/form_data.js @@ -0,0 +1,494 @@ +'use strict'; + +var CombinedStream = require('combined-stream'); +var util = require('util'); +var path = require('path'); +var http = require('http'); +var https = require('https'); +var parseUrl = require('url').parse; +var fs = require('fs'); +var Stream = require('stream').Stream; +var crypto = require('crypto'); +var mime = require('mime-types'); +var asynckit = require('asynckit'); +var setToStringTag = require('es-set-tostringtag'); +var hasOwn = require('hasown'); +var populate = require('./populate.js'); + +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + * @param {object} options - Properties to be added/overriden for FormData and CombinedStream + */ +function FormData(options) { + if (!(this instanceof FormData)) { + return new FormData(options); + } + + this._overheadLength = 0; + this._valueLength = 0; + this._valuesToMeasure = []; + + CombinedStream.call(this); + + options = options || {}; // eslint-disable-line no-param-reassign + for (var option in options) { // eslint-disable-line no-restricted-syntax + this[option] = options[option]; + } +} + +// make it a Stream +util.inherits(FormData, CombinedStream); + +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + +FormData.prototype.append = function (field, value, options) { + options = options || {}; // eslint-disable-line no-param-reassign + + // allow filename as single option + if (typeof options === 'string') { + options = { filename: options }; // eslint-disable-line no-param-reassign + } + + var append = CombinedStream.prototype.append.bind(this); + + // all that streamy business can't handle numbers + if (typeof value === 'number' || value == null) { + value = String(value); // eslint-disable-line no-param-reassign + } + + // https://github.com/felixge/node-form-data/issues/38 + if (Array.isArray(value)) { + /* + * Please convert your array into string + * the way web server expects it + */ + this._error(new Error('Arrays are not supported.')); + return; + } + + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); + + append(header); + append(value); + append(footer); + + // pass along options.knownLength + this._trackLength(header, value, options); +}; + +FormData.prototype._trackLength = function (header, value, options) { + var valueLength = 0; + + /* + * used w/ getLengthSync(), when length is known. + * e.g. for streaming directly from a remote server, + * w/ a known file a size, and not wanting to wait for + * incoming file to finish to get its size. + */ + if (options.knownLength != null) { + valueLength += Number(options.knownLength); + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } + + this._valueLength += valueLength; + + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length; + + // empty or either doesn't have path or not an http response or not a stream + if (!value || (!value.path && !(value.readable && hasOwn(value, 'httpVersion')) && !(value instanceof Stream))) { + return; + } + + // no need to bother with the length + if (!options.knownLength) { + this._valuesToMeasure.push(value); + } +}; + +FormData.prototype._lengthRetriever = function (value, callback) { + if (hasOwn(value, 'fd')) { + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + // when end specified + // no need to calculate range + // inclusive, starts with 0 + callback(null, value.end + 1 - (value.start ? value.start : 0)); // eslint-disable-line callback-return + + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function (err, stat) { + if (err) { + callback(err); + return; + } + + // update final size based on the range options + var fileSize = stat.size - (value.start ? value.start : 0); + callback(null, fileSize); + }); + } + + // or http response + } else if (hasOwn(value, 'httpVersion')) { + callback(null, Number(value.headers['content-length'])); // eslint-disable-line callback-return + + // or request stream http://github.com/mikeal/request + } else if (hasOwn(value, 'httpModule')) { + // wait till response come back + value.on('response', function (response) { + value.pause(); + callback(null, Number(response.headers['content-length'])); + }); + value.resume(); + + // something else + } else { + callback('Unknown stream'); // eslint-disable-line callback-return + } +}; + +FormData.prototype._multiPartHeader = function (field, value, options) { + /* + * custom header specified (as string)? + * it becomes responsible for boundary + * (e.g. to handle extra CRLFs on .NET servers) + */ + if (typeof options.header === 'string') { + return options.header; + } + + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); + + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; + + // allow custom headers. + if (typeof options.header === 'object') { + populate(headers, options.header); + } + + var header; + for (var prop in headers) { // eslint-disable-line no-restricted-syntax + if (hasOwn(headers, prop)) { + header = headers[prop]; + + // skip nullish headers. + if (header == null) { + continue; // eslint-disable-line no-restricted-syntax, no-continue + } + + // convert all headers to arrays. + if (!Array.isArray(header)) { + header = [header]; + } + + // add non-empty headers. + if (header.length) { + contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK; + } + } + } + + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; + +FormData.prototype._getContentDisposition = function (value, options) { // eslint-disable-line consistent-return + var filename; + + if (typeof options.filepath === 'string') { + // custom filepath for relative paths + filename = path.normalize(options.filepath).replace(/\\/g, '/'); + } else if (options.filename || (value && (value.name || value.path))) { + /* + * custom filename take precedence + * formidable and the browser add a name property + * fs- and request- streams have path property + */ + filename = path.basename(options.filename || (value && (value.name || value.path))); + } else if (value && value.readable && hasOwn(value, 'httpVersion')) { + // or try http response + filename = path.basename(value.client._httpMessage.path || ''); + } + + if (filename) { + return 'filename="' + filename + '"'; + } +}; + +FormData.prototype._getContentType = function (value, options) { + // use custom content-type above all + var contentType = options.contentType; + + // or try `name` from formidable, browser + if (!contentType && value && value.name) { + contentType = mime.lookup(value.name); + } + + // or try `path` from fs-, request- streams + if (!contentType && value && value.path) { + contentType = mime.lookup(value.path); + } + + // or if it's http-reponse + if (!contentType && value && value.readable && hasOwn(value, 'httpVersion')) { + contentType = value.headers['content-type']; + } + + // or guess it from the filepath or filename + if (!contentType && (options.filepath || options.filename)) { + contentType = mime.lookup(options.filepath || options.filename); + } + + // fallback to the default content type if `value` is not simple value + if (!contentType && value && typeof value === 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } + + return contentType; +}; + +FormData.prototype._multiPartFooter = function () { + return function (next) { + var footer = FormData.LINE_BREAK; + + var lastPart = this._streams.length === 0; + if (lastPart) { + footer += this._lastBoundary(); + } + + next(footer); + }.bind(this); +}; + +FormData.prototype._lastBoundary = function () { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; + +FormData.prototype.getHeaders = function (userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; + + for (header in userHeaders) { // eslint-disable-line no-restricted-syntax + if (hasOwn(userHeaders, header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } + + return formHeaders; +}; + +FormData.prototype.setBoundary = function (boundary) { + if (typeof boundary !== 'string') { + throw new TypeError('FormData boundary must be a string'); + } + this._boundary = boundary; +}; + +FormData.prototype.getBoundary = function () { + if (!this._boundary) { + this._generateBoundary(); + } + + return this._boundary; +}; + +FormData.prototype.getBuffer = function () { + var dataBuffer = new Buffer.alloc(0); // eslint-disable-line new-cap + var boundary = this.getBoundary(); + + // Create the form content. Add Line breaks to the end of data. + for (var i = 0, len = this._streams.length; i < len; i++) { + if (typeof this._streams[i] !== 'function') { + // Add content to the buffer. + if (Buffer.isBuffer(this._streams[i])) { + dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]); + } else { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]); + } + + // Add break after content. + if (typeof this._streams[i] !== 'string' || this._streams[i].substring(2, boundary.length + 2) !== boundary) { + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]); + } + } + } + + // Add the footer and return the Buffer object. + return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]); +}; + +FormData.prototype._generateBoundary = function () { + // This generates a 50 character boundary similar to those used by Firefox. + + // They are optimized for boyer-moore parsing. + this._boundary = '--------------------------' + crypto.randomBytes(12).toString('hex'); +}; + +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually and add it as knownLength option +FormData.prototype.getLengthSync = function () { + var knownLength = this._overheadLength + this._valueLength; + + // Don't get confused, there are 3 "internal" streams for each keyval pair so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + // https://github.com/form-data/form-data/issues/40 + if (!this.hasKnownLength()) { + /* + * Some async length retrievers are present + * therefore synchronous length calculation is false. + * Please use getLength(callback) to get proper length + */ + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } + + return knownLength; +}; + +// Public API to check if length of added values is known +// https://github.com/form-data/form-data/issues/196 +// https://github.com/form-data/form-data/issues/262 +FormData.prototype.hasKnownLength = function () { + var hasKnownLength = true; + + if (this._valuesToMeasure.length) { + hasKnownLength = false; + } + + return hasKnownLength; +}; + +FormData.prototype.getLength = function (cb) { + var knownLength = this._overheadLength + this._valueLength; + + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + if (!this._valuesToMeasure.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + + asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function (err, values) { + if (err) { + cb(err); + return; + } + + values.forEach(function (length) { + knownLength += length; + }); + + cb(null, knownLength); + }); +}; + +FormData.prototype.submit = function (params, cb) { + var request; + var options; + var defaults = { method: 'post' }; + + // parse provided url if it's string or treat it as options object + if (typeof params === 'string') { + params = parseUrl(params); // eslint-disable-line no-param-reassign + /* eslint sort-keys: 0 */ + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname, + protocol: params.protocol + }, defaults); + } else { // use custom params + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol === 'https:' ? 443 : 80; + } + } + + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); + + // https if specified, fallback to http in any other case + if (options.protocol === 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } + + // get content length and fire away + this.getLength(function (err, length) { + if (err && err !== 'Unknown stream') { + this._error(err); + return; + } + + // add content length + if (length) { + request.setHeader('Content-Length', length); + } + + this.pipe(request); + if (cb) { + var onResponse; + + var callback = function (error, responce) { + request.removeListener('error', callback); + request.removeListener('response', onResponse); + + return cb.call(this, error, responce); + }; + + onResponse = callback.bind(this, null); + + request.on('error', callback); + request.on('response', onResponse); + } + }.bind(this)); + + return request; +}; + +FormData.prototype._error = function (err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; + +FormData.prototype.toString = function () { + return '[object FormData]'; +}; +setToStringTag(FormData.prototype, 'FormData'); + +// Public API +module.exports = FormData; diff --git a/node_modules/form-data/lib/populate.js b/node_modules/form-data/lib/populate.js new file mode 100644 index 0000000..55ac3bb --- /dev/null +++ b/node_modules/form-data/lib/populate.js @@ -0,0 +1,10 @@ +'use strict'; + +// populates missing values +module.exports = function (dst, src) { + Object.keys(src).forEach(function (prop) { + dst[prop] = dst[prop] || src[prop]; // eslint-disable-line no-param-reassign + }); + + return dst; +}; diff --git a/node_modules/form-data/node_modules/mime-db/HISTORY.md b/node_modules/form-data/node_modules/mime-db/HISTORY.md new file mode 100644 index 0000000..7436f64 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-db/HISTORY.md @@ -0,0 +1,507 @@ +1.52.0 / 2022-02-21 +=================== + + * Add extensions from IANA for more `image/*` types + * Add extension `.asc` to `application/pgp-keys` + * Add extensions to various XML types + * Add new upstream MIME types + +1.51.0 / 2021-11-08 +=================== + + * Add new upstream MIME types + * Mark `image/vnd.microsoft.icon` as compressible + * Mark `image/vnd.ms-dds` as compressible + +1.50.0 / 2021-09-15 +=================== + + * Add deprecated iWorks mime types and extensions + * Add new upstream MIME types + +1.49.0 / 2021-07-26 +=================== + + * Add extension `.trig` to `application/trig` + * Add new upstream MIME types + +1.48.0 / 2021-05-30 +=================== + + * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + * Add new upstream MIME types + * Mark `text/yaml` as compressible + +1.47.0 / 2021-04-01 +=================== + + * Add new upstream MIME types + * Remove ambigious extensions from IANA for `application/*+xml` types + * Update primary extension to `.es` for `application/ecmascript` + +1.46.0 / 2021-02-13 +=================== + + * Add extension `.amr` to `audio/amr` + * Add extension `.m4s` to `video/iso.segment` + * Add extension `.opus` to `audio/ogg` + * Add new upstream MIME types + +1.45.0 / 2020-09-22 +=================== + + * Add `application/ubjson` with extension `.ubj` + * Add `image/avif` with extension `.avif` + * Add `image/ktx2` with extension `.ktx2` + * Add extension `.dbf` to `application/vnd.dbf` + * Add extension `.rar` to `application/vnd.rar` + * Add extension `.td` to `application/urc-targetdesc+xml` + * Add new upstream MIME types + * Fix extension of `application/vnd.apple.keynote` to be `.key` + +1.44.0 / 2020-04-22 +=================== + + * Add charsets from IANA + * Add extension `.cjs` to `application/node` + * Add new upstream MIME types + +1.43.0 / 2020-01-05 +=================== + + * Add `application/x-keepass2` with extension `.kdbx` + * Add extension `.mxmf` to `audio/mobile-xmf` + * Add extensions from IANA for `application/*+xml` types + * Add new upstream MIME types + +1.42.0 / 2019-09-25 +=================== + + * Add `image/vnd.ms-dds` with extension `.dds` + * Add new upstream MIME types + * Remove compressible from `multipart/mixed` + +1.41.0 / 2019-08-30 +=================== + + * Add new upstream MIME types + * Add `application/toml` with extension `.toml` + * Mark `font/ttf` as compressible + +1.40.0 / 2019-04-20 +=================== + + * Add extensions from IANA for `model/*` types + * Add `text/mdx` with extension `.mdx` + +1.39.0 / 2019-04-04 +=================== + + * Add extensions `.siv` and `.sieve` to `application/sieve` + * Add new upstream MIME types + +1.38.0 / 2019-02-04 +=================== + + * Add extension `.nq` to `application/n-quads` + * Add extension `.nt` to `application/n-triples` + * Add new upstream MIME types + * Mark `text/less` as compressible + +1.37.0 / 2018-10-19 +=================== + + * Add extensions to HEIC image types + * Add new upstream MIME types + +1.36.0 / 2018-08-20 +=================== + + * Add Apple file extensions from IANA + * Add extensions from IANA for `image/*` types + * Add new upstream MIME types + +1.35.0 / 2018-07-15 +=================== + + * Add extension `.owl` to `application/rdf+xml` + * Add new upstream MIME types + - Removes extension `.woff` from `application/font-woff` + +1.34.0 / 2018-06-03 +=================== + + * Add extension `.csl` to `application/vnd.citationstyles.style+xml` + * Add extension `.es` to `application/ecmascript` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/turtle` + * Mark all XML-derived types as compressible + +1.33.0 / 2018-02-15 +=================== + + * Add extensions from IANA for `message/*` types + * Add new upstream MIME types + * Fix some incorrect OOXML types + * Remove `application/font-woff2` + +1.32.0 / 2017-11-29 +=================== + + * Add new upstream MIME types + * Update `text/hjson` to registered `application/hjson` + * Add `text/shex` with extension `.shex` + +1.31.0 / 2017-10-25 +=================== + + * Add `application/raml+yaml` with extension `.raml` + * Add `application/wasm` with extension `.wasm` + * Add new `font` type from IANA + * Add new upstream font extensions + * Add new upstream MIME types + * Add extensions for JPEG-2000 images + +1.30.0 / 2017-08-27 +=================== + + * Add `application/vnd.ms-outlook` + * Add `application/x-arj` + * Add extension `.mjs` to `application/javascript` + * Add glTF types and extensions + * Add new upstream MIME types + * Add `text/x-org` + * Add VirtualBox MIME types + * Fix `source` records for `video/*` types that are IANA + * Update `font/opentype` to registered `font/otf` + +1.29.0 / 2017-07-10 +=================== + + * Add `application/fido.trusted-apps+json` + * Add extension `.wadl` to `application/vnd.sun.wadl+xml` + * Add new upstream MIME types + * Add `UTF-8` as default charset for `text/css` + +1.28.0 / 2017-05-14 +=================== + + * Add new upstream MIME types + * Add extension `.gz` to `application/gzip` + * Update extensions `.md` and `.markdown` to be `text/markdown` + +1.27.0 / 2017-03-16 +=================== + + * Add new upstream MIME types + * Add `image/apng` with extension `.apng` + +1.26.0 / 2017-01-14 +=================== + + * Add new upstream MIME types + * Add extension `.geojson` to `application/geo+json` + +1.25.0 / 2016-11-11 +=================== + + * Add new upstream MIME types + +1.24.0 / 2016-09-18 +=================== + + * Add `audio/mp3` + * Add new upstream MIME types + +1.23.0 / 2016-05-01 +=================== + + * Add new upstream MIME types + * Add extension `.3gpp` to `audio/3gpp` + +1.22.0 / 2016-02-15 +=================== + + * Add `text/slim` + * Add extension `.rng` to `application/xml` + * Add new upstream MIME types + * Fix extension of `application/dash+xml` to be `.mpd` + * Update primary extension to `.m4a` for `audio/mp4` + +1.21.0 / 2016-01-06 +=================== + + * Add Google document types + * Add new upstream MIME types + +1.20.0 / 2015-11-10 +=================== + + * Add `text/x-suse-ymp` + * Add new upstream MIME types + +1.19.0 / 2015-09-17 +=================== + + * Add `application/vnd.apple.pkpass` + * Add new upstream MIME types + +1.18.0 / 2015-09-03 +=================== + + * Add new upstream MIME types + +1.17.0 / 2015-08-13 +=================== + + * Add `application/x-msdos-program` + * Add `audio/g711-0` + * Add `image/vnd.mozilla.apng` + * Add extension `.exe` to `application/x-msdos-program` + +1.16.0 / 2015-07-29 +=================== + + * Add `application/vnd.uri-map` + +1.15.0 / 2015-07-13 +=================== + + * Add `application/x-httpd-php` + +1.14.0 / 2015-06-25 +=================== + + * Add `application/scim+json` + * Add `application/vnd.3gpp.ussd+xml` + * Add `application/vnd.biopax.rdf+xml` + * Add `text/x-processing` + +1.13.0 / 2015-06-07 +=================== + + * Add nginx as a source + * Add `application/x-cocoa` + * Add `application/x-java-archive-diff` + * Add `application/x-makeself` + * Add `application/x-perl` + * Add `application/x-pilot` + * Add `application/x-redhat-package-manager` + * Add `application/x-sea` + * Add `audio/x-m4a` + * Add `audio/x-realaudio` + * Add `image/x-jng` + * Add `text/mathml` + +1.12.0 / 2015-06-05 +=================== + + * Add `application/bdoc` + * Add `application/vnd.hyperdrive+json` + * Add `application/x-bdoc` + * Add extension `.rtf` to `text/rtf` + +1.11.0 / 2015-05-31 +=================== + + * Add `audio/wav` + * Add `audio/wave` + * Add extension `.litcoffee` to `text/coffeescript` + * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` + * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` + +1.10.0 / 2015-05-19 +=================== + + * Add `application/vnd.balsamiq.bmpr` + * Add `application/vnd.microsoft.portable-executable` + * Add `application/x-ns-proxy-autoconfig` + +1.9.1 / 2015-04-19 +================== + + * Remove `.json` extension from `application/manifest+json` + - This is causing bugs downstream + +1.9.0 / 2015-04-19 +================== + + * Add `application/manifest+json` + * Add `application/vnd.micro+json` + * Add `image/vnd.zbrush.pcx` + * Add `image/x-ms-bmp` + +1.8.0 / 2015-03-13 +================== + + * Add `application/vnd.citationstyles.style+xml` + * Add `application/vnd.fastcopy-disk-image` + * Add `application/vnd.gov.sk.xmldatacontainer+xml` + * Add extension `.jsonld` to `application/ld+json` + +1.7.0 / 2015-02-08 +================== + + * Add `application/vnd.gerber` + * Add `application/vnd.msa-disk-image` + +1.6.1 / 2015-02-05 +================== + + * Community extensions ownership transferred from `node-mime` + +1.6.0 / 2015-01-29 +================== + + * Add `application/jose` + * Add `application/jose+json` + * Add `application/json-seq` + * Add `application/jwk+json` + * Add `application/jwk-set+json` + * Add `application/jwt` + * Add `application/rdap+json` + * Add `application/vnd.gov.sk.e-form+xml` + * Add `application/vnd.ims.imsccv1p3` + +1.5.0 / 2014-12-30 +================== + + * Add `application/vnd.oracle.resource+json` + * Fix various invalid MIME type entries + - `application/mbox+xml` + - `application/oscp-response` + - `application/vwg-multiplexed` + - `audio/g721` + +1.4.0 / 2014-12-21 +================== + + * Add `application/vnd.ims.imsccv1p2` + * Fix various invalid MIME type entries + - `application/vnd-acucobol` + - `application/vnd-curl` + - `application/vnd-dart` + - `application/vnd-dxr` + - `application/vnd-fdf` + - `application/vnd-mif` + - `application/vnd-sema` + - `application/vnd-wap-wmlc` + - `application/vnd.adobe.flash-movie` + - `application/vnd.dece-zip` + - `application/vnd.dvb_service` + - `application/vnd.micrografx-igx` + - `application/vnd.sealed-doc` + - `application/vnd.sealed-eml` + - `application/vnd.sealed-mht` + - `application/vnd.sealed-ppt` + - `application/vnd.sealed-tiff` + - `application/vnd.sealed-xls` + - `application/vnd.sealedmedia.softseal-html` + - `application/vnd.sealedmedia.softseal-pdf` + - `application/vnd.wap-slc` + - `application/vnd.wap-wbxml` + - `audio/vnd.sealedmedia.softseal-mpeg` + - `image/vnd-djvu` + - `image/vnd-svf` + - `image/vnd-wap-wbmp` + - `image/vnd.sealed-png` + - `image/vnd.sealedmedia.softseal-gif` + - `image/vnd.sealedmedia.softseal-jpg` + - `model/vnd-dwf` + - `model/vnd.parasolid.transmit-binary` + - `model/vnd.parasolid.transmit-text` + - `text/vnd-a` + - `text/vnd-curl` + - `text/vnd.wap-wml` + * Remove example template MIME types + - `application/example` + - `audio/example` + - `image/example` + - `message/example` + - `model/example` + - `multipart/example` + - `text/example` + - `video/example` + +1.3.1 / 2014-12-16 +================== + + * Fix missing extensions + - `application/json5` + - `text/hjson` + +1.3.0 / 2014-12-07 +================== + + * Add `application/a2l` + * Add `application/aml` + * Add `application/atfx` + * Add `application/atxml` + * Add `application/cdfx+xml` + * Add `application/dii` + * Add `application/json5` + * Add `application/lxf` + * Add `application/mf4` + * Add `application/vnd.apache.thrift.compact` + * Add `application/vnd.apache.thrift.json` + * Add `application/vnd.coffeescript` + * Add `application/vnd.enphase.envoy` + * Add `application/vnd.ims.imsccv1p1` + * Add `text/csv-schema` + * Add `text/hjson` + * Add `text/markdown` + * Add `text/yaml` + +1.2.0 / 2014-11-09 +================== + + * Add `application/cea` + * Add `application/dit` + * Add `application/vnd.gov.sk.e-form+zip` + * Add `application/vnd.tmd.mediaflex.api+xml` + * Type `application/epub+zip` is now IANA-registered + +1.1.2 / 2014-10-23 +================== + + * Rebuild database for `application/x-www-form-urlencoded` change + +1.1.1 / 2014-10-20 +================== + + * Mark `application/x-www-form-urlencoded` as compressible. + +1.1.0 / 2014-09-28 +================== + + * Add `application/font-woff2` + +1.0.3 / 2014-09-25 +================== + + * Fix engine requirement in package + +1.0.2 / 2014-09-25 +================== + + * Add `application/coap-group+json` + * Add `application/dcd` + * Add `application/vnd.apache.thrift.binary` + * Add `image/vnd.tencent.tap` + * Mark all JSON-derived types as compressible + * Update `text/vtt` data + +1.0.1 / 2014-08-30 +================== + + * Fix extension ordering + +1.0.0 / 2014-08-30 +================== + + * Add `application/atf` + * Add `application/merge-patch+json` + * Add `multipart/x-mixed-replace` + * Add `source: 'apache'` metadata + * Add `source: 'iana'` metadata + * Remove badly-assumed charset data diff --git a/node_modules/form-data/node_modules/mime-db/LICENSE b/node_modules/form-data/node_modules/mime-db/LICENSE new file mode 100644 index 0000000..0751cb1 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-db/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/form-data/node_modules/mime-db/README.md b/node_modules/form-data/node_modules/mime-db/README.md new file mode 100644 index 0000000..5a8fcfe --- /dev/null +++ b/node_modules/form-data/node_modules/mime-db/README.md @@ -0,0 +1,100 @@ +# mime-db + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +This is a large database of mime types and information about them. +It consists of a single, public JSON file and does not include any logic, +allowing it to remain as un-opinionated as possible with an API. +It aggregates data from the following sources: + +- http://www.iana.org/assignments/media-types/media-types.xhtml +- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types + +## Installation + +```bash +npm install mime-db +``` + +### Database Download + +If you're crazy enough to use this in the browser, you can just grab the +JSON file using [jsDelivr](https://www.jsdelivr.com/). It is recommended to +replace `master` with [a release tag](https://github.com/jshttp/mime-db/tags) +as the JSON format may change in the future. + +``` +https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json +``` + +## Usage + +```js +var db = require('mime-db') + +// grab data on .js files +var data = db['application/javascript'] +``` + +## Data Structure + +The JSON file is a map lookup for lowercased mime types. +Each mime type has the following properties: + +- `.source` - where the mime type is defined. + If not set, it's probably a custom media type. + - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) + - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) +- `.extensions[]` - known extensions associated with this mime type. +- `.compressible` - whether a file of this type can be gzipped. +- `.charset` - the default charset associated with this type, if any. + +If unknown, every property could be `undefined`. + +## Contributing + +To edit the database, only make PRs against `src/custom-types.json` or +`src/custom-suffix.json`. + +The `src/custom-types.json` file is a JSON object with the MIME type as the +keys and the values being an object with the following keys: + +- `compressible` - leave out if you don't know, otherwise `true`/`false` to + indicate whether the data represented by the type is typically compressible. +- `extensions` - include an array of file extensions that are associated with + the type. +- `notes` - human-readable notes about the type, typically what the type is. +- `sources` - include an array of URLs of where the MIME type and the associated + extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source); + links to type aggregating sites and Wikipedia are _not acceptable_. + +To update the build, run `npm run build`. + +### Adding Custom Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + +If that is not possible / feasible, they can be added directly here as a +"custom" type. To do this, it is required to have a primary source that +definitively lists the media type. If an extension is going to be listed as +associateed with this media type, the source must definitively link the +media type and extension as well. + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-db/master?label=ci +[ci-url]: https://github.com/jshttp/mime-db/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-db/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://badgen.net/npm/node/mime-db +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-db +[npm-url]: https://npmjs.org/package/mime-db +[npm-version-image]: https://badgen.net/npm/v/mime-db diff --git a/node_modules/form-data/node_modules/mime-db/db.json b/node_modules/form-data/node_modules/mime-db/db.json new file mode 100644 index 0000000..eb9c42c --- /dev/null +++ b/node_modules/form-data/node_modules/mime-db/db.json @@ -0,0 +1,8519 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/3gpp-ims+xml": { + "source": "iana", + "compressible": true + }, + "application/3gpphal+json": { + "source": "iana", + "compressible": true + }, + "application/3gpphalforms+json": { + "source": "iana", + "compressible": true + }, + "application/a2l": { + "source": "iana" + }, + "application/ace+cbor": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/activity+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamcontrol+json": { + "source": "iana", + "compressible": true + }, + "application/alto-updatestreamparams+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/at+jwt": { + "source": "iana" + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomdeleted"] + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atomsvc"] + }, + "application/atsc-dwd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dwd"] + }, + "application/atsc-dynamic-event-message": { + "source": "iana" + }, + "application/atsc-held+xml": { + "source": "iana", + "compressible": true, + "extensions": ["held"] + }, + "application/atsc-rdt+json": { + "source": "iana", + "compressible": true + }, + "application/atsc-rsat+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsat"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana", + "compressible": true + }, + "application/bacnet-xdd+zip": { + "source": "iana", + "compressible": false + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/beep+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xcs"] + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/captive+json": { + "source": "iana", + "compressible": true + }, + "application/cbor": { + "source": "iana" + }, + "application/cbor-seq": { + "source": "iana" + }, + "application/cccex": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana", + "compressible": true + }, + "application/ccxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ccxml"] + }, + "application/cdfx+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdfx"] + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cdni": { + "source": "iana" + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana", + "compressible": true + }, + "application/cellml+xml": { + "source": "iana", + "compressible": true + }, + "application/cfw": { + "source": "iana" + }, + "application/city+json": { + "source": "iana", + "compressible": true + }, + "application/clr": { + "source": "iana" + }, + "application/clue+xml": { + "source": "iana", + "compressible": true + }, + "application/clue_info+xml": { + "source": "iana", + "compressible": true + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana", + "compressible": true + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/coap-payload": { + "source": "iana" + }, + "application/commonground": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/cose": { + "source": "iana" + }, + "application/cose-key": { + "source": "iana" + }, + "application/cose-key-set": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cpl"] + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana", + "compressible": true + }, + "application/cstadata+xml": { + "source": "iana", + "compressible": true + }, + "application/csvm+json": { + "source": "iana", + "compressible": true + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cwt": { + "source": "iana" + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpd"] + }, + "application/dash-patch+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "compressible": true, + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana", + "compressible": true + }, + "application/dicom": { + "source": "iana" + }, + "application/dicom+json": { + "source": "iana", + "compressible": true + }, + "application/dicom+xml": { + "source": "iana", + "compressible": true + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/dns+json": { + "source": "iana", + "compressible": true + }, + "application/dns-message": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dbk"] + }, + "application/dots+cbor": { + "source": "iana" + }, + "application/dskpp+xml": { + "source": "iana", + "compressible": true + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/ecmascript": { + "source": "iana", + "compressible": true, + "extensions": ["es","ecma"] + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/efi": { + "source": "iana" + }, + "application/elm+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/elm+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.cap+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/emergencycalldata.comment+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.control+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.deviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.ecall.msd": { + "source": "iana" + }, + "application/emergencycalldata.providerinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.serviceinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.subscriberinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/emergencycalldata.veds+xml": { + "source": "iana", + "compressible": true + }, + "application/emma+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["emotionml"] + }, + "application/encaprtp": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana", + "compressible": true + }, + "application/epub+zip": { + "source": "iana", + "compressible": false, + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/expect-ct-report+json": { + "source": "iana", + "compressible": true + }, + "application/express": { + "source": "iana", + "extensions": ["exp"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fdt"] + }, + "application/fhir+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fhir+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/fido.trusted-apps+json": { + "compressible": true + }, + "application/fits": { + "source": "iana" + }, + "application/flexfec": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false + }, + "application/framework-attributes+xml": { + "source": "iana", + "compressible": true + }, + "application/geo+json": { + "source": "iana", + "compressible": true, + "extensions": ["geojson"] + }, + "application/geo+json-seq": { + "source": "iana" + }, + "application/geopackage+sqlite3": { + "source": "iana" + }, + "application/geoxacml+xml": { + "source": "iana", + "compressible": true + }, + "application/gltf-buffer": { + "source": "iana" + }, + "application/gml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["gml"] + }, + "application/gpx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["gpx"] + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false, + "extensions": ["gz"] + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana", + "compressible": true + }, + "application/hjson": { + "extensions": ["hjson"] + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pkg-reply+xml": { + "source": "iana", + "compressible": true + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana", + "compressible": true, + "extensions": ["its"] + }, + "application/java-archive": { + "source": "apache", + "compressible": false, + "extensions": ["jar","war","ear"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js","mjs"] + }, + "application/jf2feed+json": { + "source": "iana", + "compressible": true + }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/jscalendar+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwt": { + "source": "iana" + }, + "application/kpml-request+xml": { + "source": "iana", + "compressible": true + }, + "application/kpml-response+xml": { + "source": "iana", + "compressible": true + }, + "application/ld+json": { + "source": "iana", + "compressible": true, + "extensions": ["jsonld"] + }, + "application/lgr+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lgr"] + }, + "application/link-format": { + "source": "iana" + }, + "application/load-control+xml": { + "source": "iana", + "compressible": true + }, + "application/lost+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana", + "compressible": true + }, + "application/lpf+zip": { + "source": "iana", + "compressible": false + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mads"] + }, + "application/manifest+json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["webmanifest"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana", + "compressible": true + }, + "application/mathml-presentation+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-deregister+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-envelope+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-msk-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-protection-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-reception-report+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-register-response+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-schedule+xml": { + "source": "iana", + "compressible": true + }, + "application/mbms-user-service-description+xml": { + "source": "iana", + "compressible": true + }, + "application/mbox": { + "source": "iana", + "extensions": ["mbox"] + }, + "application/media-policy-dataset+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpf"] + }, + "application/media_control+xml": { + "source": "iana", + "compressible": true + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "compressible": true, + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "compressible": true, + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mipc": { + "source": "iana" + }, + "application/missing-blocks+cbor-seq": { + "source": "iana" + }, + "application/mmt-aei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["maei"] + }, + "application/mmt-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musd"] + }, + "application/mods+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana", + "compressible": true + }, + "application/mrb-publish+xml": { + "source": "iana", + "compressible": true + }, + "application/msc-ivr+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msc-mixer+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mud+json": { + "source": "iana", + "compressible": true + }, + "application/multipart-core": { + "source": "iana" + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/n-quads": { + "source": "iana", + "extensions": ["nq"] + }, + "application/n-triples": { + "source": "iana", + "extensions": ["nt"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-groupinfo": { + "source": "iana", + "charset": "US-ASCII" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana", + "compressible": true + }, + "application/node": { + "source": "iana", + "extensions": ["cjs"] + }, + "application/nss": { + "source": "iana" + }, + "application/oauth-authz-req+jwt": { + "source": "iana" + }, + "application/oblivious-dns-message": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "iana" + }, + "application/octet-stream": { + "source": "iana", + "compressible": false, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odm+xml": { + "source": "iana", + "compressible": true + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/omdoc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg"] + }, + "application/opc-nodeset+xml": { + "source": "iana", + "compressible": true + }, + "application/oscore": { + "source": "iana" + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p21": { + "source": "iana" + }, + "application/p21+zip": { + "source": "iana", + "compressible": false + }, + "application/p2p-overlay+xml": { + "source": "iana", + "compressible": true, + "extensions": ["relo"] + }, + "application/parityfec": { + "source": "iana" + }, + "application/passport": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pem-certificate-chain": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana", + "extensions": ["asc"] + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["asc","sig"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pidf-diff+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs12": { + "source": "iana" + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkcs8-encrypted": { + "source": "iana" + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/ppsp-tracker+json": { + "source": "iana", + "compressible": true + }, + "application/problem+json": { + "source": "iana", + "compressible": true + }, + "application/problem+xml": { + "source": "iana", + "compressible": true + }, + "application/provenance+xml": { + "source": "iana", + "compressible": true, + "extensions": ["provx"] + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.cyn": { + "source": "iana", + "charset": "7-BIT" + }, + "application/prs.hpub+zip": { + "source": "iana", + "compressible": false + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana", + "compressible": true + }, + "application/pskc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["pskcxml"] + }, + "application/pvd+json": { + "source": "iana", + "compressible": true + }, + "application/qsig": { + "source": "iana" + }, + "application/raml+yaml": { + "compressible": true, + "extensions": ["raml"] + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf","owl"] + }, + "application/reginfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "iana" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resource-lists+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rld"] + }, + "application/rfc+xml": { + "source": "iana", + "compressible": true + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana", + "compressible": true + }, + "application/rls-services+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rs"] + }, + "application/route-apd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rapd"] + }, + "application/route-s-tsid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sls"] + }, + "application/route-usd+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rusd"] + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-publication": { + "source": "iana" + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana", + "compressible": true + }, + "application/samlmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/sarif+json": { + "source": "iana", + "compressible": true + }, + "application/sarif-external-properties+json": { + "source": "iana", + "compressible": true + }, + "application/sbe": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana", + "compressible": true + }, + "application/scim+json": { + "source": "iana", + "compressible": true + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/secevent+jwt": { + "source": "iana" + }, + "application/senml+cbor": { + "source": "iana" + }, + "application/senml+json": { + "source": "iana", + "compressible": true + }, + "application/senml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["senmlx"] + }, + "application/senml-etch+cbor": { + "source": "iana" + }, + "application/senml-etch+json": { + "source": "iana", + "compressible": true + }, + "application/senml-exi": { + "source": "iana" + }, + "application/sensml+cbor": { + "source": "iana" + }, + "application/sensml+json": { + "source": "iana", + "compressible": true + }, + "application/sensml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sensmlx"] + }, + "application/sensml-exi": { + "source": "iana" + }, + "application/sep+xml": { + "source": "iana", + "compressible": true + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana", + "extensions": ["siv","sieve"] + }, + "application/simple-filter+xml": { + "source": "iana", + "compressible": true + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/sipc": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "iana" + }, + "application/smil+xml": { + "source": "iana", + "compressible": true, + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "compressible": true, + "extensions": ["srx"] + }, + "application/spdx+json": { + "source": "iana", + "compressible": true + }, + "application/spirits-event+xml": { + "source": "iana", + "compressible": true + }, + "application/sql": { + "source": "iana" + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ssdl"] + }, + "application/ssml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ssml"] + }, + "application/stix+json": { + "source": "iana", + "compressible": true + }, + "application/swid+xml": { + "source": "iana", + "compressible": true, + "extensions": ["swidtag"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/taxii+json": { + "source": "iana", + "compressible": true + }, + "application/td+json": { + "source": "iana", + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tei","teicorpus"] + }, + "application/tetra_isi": { + "source": "iana" + }, + "application/thraud+xml": { + "source": "iana", + "compressible": true, + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/tlsrpt+gzip": { + "source": "iana" + }, + "application/tlsrpt+json": { + "source": "iana", + "compressible": true + }, + "application/tnauthlist": { + "source": "iana" + }, + "application/token-introspection+jwt": { + "source": "iana" + }, + "application/toml": { + "compressible": true, + "extensions": ["toml"] + }, + "application/trickle-ice-sdpfrag": { + "source": "iana" + }, + "application/trig": { + "source": "iana", + "extensions": ["trig"] + }, + "application/ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ttml"] + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/tzif": { + "source": "iana" + }, + "application/tzif-leap": { + "source": "iana" + }, + "application/ubjson": { + "compressible": false, + "extensions": ["ubj"] + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/urc-ressheet+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rsheet"] + }, + "application/urc-targetdesc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["td"] + }, + "application/urc-uisocketdesc+xml": { + "source": "iana", + "compressible": true + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana", + "compressible": true + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd.1000minds.decision-model+xml": { + "source": "iana", + "compressible": true, + "extensions": ["1km"] + }, + "application/vnd.3gpp-prose+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp-v2x-local-service-information": { + "source": "iana" + }, + "application/vnd.3gpp.5gnas": { + "source": "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gmop+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.gtpc": { + "source": "iana" + }, + "application/vnd.3gpp.interworking-data": { + "source": "iana" + }, + "application/vnd.3gpp.lpp": { + "source": "iana" + }, + "application/vnd.3gpp.mc-signalling-ear": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-payload": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-signalling": { + "source": "iana" + }, + "application/vnd.3gpp.mcdata-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcdata-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-floor-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-signed+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-ue-init-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcptt-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-command+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-affiliation-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-location-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-service-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-transmission-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-ue-config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mcvideo-user-profile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.mid-call+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ngap": { + "source": "iana" + }, + "application/vnd.3gpp.pfcp": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.s1ap": { + "source": "iana" + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp.sms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.srvcc-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.state-and-event-info+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp.ussd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3lightssoftware.imagescal": { + "source": "iana" + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acucobol": { + "source": "iana", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "compressible": false, + "extensions": ["air"] + }, + "application/vnd.adobe.flash.movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata": { + "source": "iana" + }, + "application/vnd.afpc.afplinedata-pagedef": { + "source": "iana" + }, + "application/vnd.afpc.cmoca-cmresource": { + "source": "iana" + }, + "application/vnd.afpc.foca-charset": { + "source": "iana" + }, + "application/vnd.afpc.foca-codedfont": { + "source": "iana" + }, + "application/vnd.afpc.foca-codepage": { + "source": "iana" + }, + "application/vnd.afpc.modca": { + "source": "iana" + }, + "application/vnd.afpc.modca-cmtable": { + "source": "iana" + }, + "application/vnd.afpc.modca-formdef": { + "source": "iana" + }, + "application/vnd.afpc.modca-mediummap": { + "source": "iana" + }, + "application/vnd.afpc.modca-objectcontainer": { + "source": "iana" + }, + "application/vnd.afpc.modca-overlay": { + "source": "iana" + }, + "application/vnd.afpc.modca-pagesegment": { + "source": "iana" + }, + "application/vnd.age": { + "source": "iana", + "extensions": ["age"] + }, + "application/vnd.ah-barcode": { + "source": "iana" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amadeus+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.amazon.mobi8-ebook": { + "source": "iana" + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.android.ota": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anki": { + "source": "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.arrow.file": { + "source": "iana" + }, + "application/vnd.apache.arrow.stream": { + "source": "iana" + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.aplextor.warrp+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apothekende.reservation+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mpkg"] + }, + "application/vnd.apple.keynote": { + "source": "iana", + "extensions": ["key"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.apple.numbers": { + "source": "iana", + "extensions": ["numbers"] + }, + "application/vnd.apple.pages": { + "source": "iana", + "extensions": ["pages"] + }, + "application/vnd.apple.pkpass": { + "compressible": false, + "extensions": ["pkpass"] + }, + "application/vnd.arastra.swi": { + "source": "iana" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artisan+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avalon+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.avistar+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["bmml"] + }, + "application/vnd.balsamiq.bmpr": { + "source": "iana" + }, + "application/vnd.banana-accounting": { + "source": "iana" + }, + "application/vnd.bbf.usp.error": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg": { + "source": "iana" + }, + "application/vnd.bbf.usp.msg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.bint.med-content": { + "source": "iana" + }, + "application/vnd.biopax.rdf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.blink-idb-value-wrapper": { + "source": "iana" + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.bpf": { + "source": "iana" + }, + "application/vnd.bpf3": { + "source": "iana" + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.byu.uapi+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.capasystems-pg+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "compressible": true, + "extensions": ["cdxml"] + }, + "application/vnd.chess-pgn": { + "source": "iana" + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.ciedi": { + "source": "iana" + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.citationstyles.style+xml": { + "source": "iana", + "compressible": true, + "extensions": ["csl"] + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.document-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.presentation-template": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet": { + "source": "iana" + }, + "application/vnd.collabio.xodocuments.spreadsheet-template": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.comicbook+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.comicbook-rar": { + "source": "iana" + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.coreos.ignition+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wbs"] + }, + "application/vnd.cryptii.pipe+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.crypto-shade-file": { + "source": "iana" + }, + "application/vnd.cryptomator.encrypted": { + "source": "iana" + }, + "application/vnd.cryptomator.vault": { + "source": "iana" + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "iana" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.cyclonedx+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.cyclonedx+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.d2l.coursepackage1p0+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.d3m-dataset": { + "source": "iana" + }, + "application/vnd.d3m-problem": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "iana", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.datapackage+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dataresource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dbf": { + "source": "iana", + "extensions": ["dbf"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "iana", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume.movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.drive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbisl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "iana", + "extensions": ["svc"] + }, + "application/vnd.dxr": { + "source": "iana" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecip.rlp": { + "source": "iana" + }, + "application/vnd.eclipse.ditto+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.efi.img": { + "source": "iana" + }, + "application/vnd.efi.iso": { + "source": "iana" + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.espass-espass+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "compressible": true, + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.etsi.cug+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.sci+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eu.kasparian.car+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.evolv.ecig.profile": { + "source": "iana" + }, + "application/vnd.evolv.ecig.settings": { + "source": "iana" + }, + "application/vnd.evolv.ecig.theme": { + "source": "iana" + }, + "application/vnd.exstream-empower+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.exstream-package": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.familysearch.gedcom+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.fastcopy-disk-image": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "iana", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.ficlab.flb+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.filmit.zfc": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.frogans.fnc": { + "source": "iana", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "iana", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujifilm.fb.docuworks": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.futoin+cbor": { + "source": "iana" + }, + "application/vnd.futoin+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.gentics.grd+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.geo+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.slides": { + "source": "iana" + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.gerber": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.google-apps.document": { + "compressible": false, + "extensions": ["gdoc"] + }, + "application/vnd.google-apps.presentation": { + "compressible": false, + "extensions": ["gslides"] + }, + "application/vnd.google-apps.spreadsheet": { + "compressible": false, + "extensions": ["gsheet"] + }, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "compressible": true, + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.hdt": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hl7cda+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.hl7v2+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana", + "extensions": ["sfd-hdstx"] + }, + "application/vnd.hyper+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyper-item+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hyperdrive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "iana" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "iana", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.imagemeter.folder+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.imagemeter.image+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.informix-visionary": { + "source": "iana" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "compressible": true, + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.iso11783-10+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las": { + "source": "iana" + }, + "application/vnd.las.las+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.las.las+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lasxml"] + }, + "application/vnd.laszip": { + "source": "iana" + }, + "application/vnd.leap+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.liberty-request+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "compressible": true, + "extensions": ["lbe"] + }, + "application/vnd.logipipe.circuit+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.loom": { + "source": "iana" + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.mapbox-vector-tile": { + "source": "iana", + "extensions": ["mvt"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxar.archive.3tz+zip": { + "source": "iana", + "compressible": false + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micro+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "iana", + "extensions": ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + "source": "iana" + }, + "application/vnd.microsoft.windows.thumbnail-cache": { + "source": "iana" + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "iana", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-outlook": { + "compressible": false, + "extensions": ["msg"] + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printdevicecapabilities+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-printschematicket+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-windows.devicepairing": { + "source": "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.nacamar.ybrid+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nearst.inv+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.nebumind.line": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nimn": { + "source": "iana" + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana", + "compressible": true, + "extensions": ["ac"] + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "iana", + "extensions": ["n-gage"] + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "iana", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.ocf+cbor": { + "source": "iana" + }, + "application/vnd.oci.image.manifest.v1+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+cbor": { + "source": "iana" + }, + "application/vnd.oma.lwm2m+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.lwm2m+tlv": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.omads-email+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-file+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omads-folder+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.onepager": { + "source": "iana" + }, + "application/vnd.onepagertamp": { + "source": "iana" + }, + "application/vnd.onepagertamx": { + "source": "iana" + }, + "application/vnd.onepagertat": { + "source": "iana" + }, + "application/vnd.onepagertatp": { + "source": "iana" + }, + "application/vnd.onepagertatx": { + "source": "iana" + }, + "application/vnd.openblox.game+xml": { + "source": "iana", + "compressible": true, + "extensions": ["obgx"] + }, + "application/vnd.openblox.game-binary": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openstreetmap.data+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osm"] + }, + "application/vnd.opentimestamps.ots": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "iana", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "iana", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "iana", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.oxli.countgraph": { + "source": "iana" + }, + "application/vnd.pagerduty+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "iana" + }, + "application/vnd.patentdive": { + "source": "iana" + }, + "application/vnd.patientecommsdoc": { + "source": "iana" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.psfs": { + "source": "iana" + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quarantainenet": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.rar": { + "source": "iana", + "extensions": ["rar"] + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["musicxml"] + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.resilient.logic": { + "source": "iana" + }, + "application/vnd.restful+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "compressible": true, + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sar": { + "source": "iana" + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "iana" + }, + "application/vnd.sealed.eml": { + "source": "iana" + }, + "application/vnd.sealed.mht": { + "source": "iana" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "iana" + }, + "application/vnd.sealed.tiff": { + "source": "iana" + }, + "application/vnd.sealed.xls": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "iana" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.seis+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.sema": { + "source": "iana", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shade-save-file": { + "source": "iana" + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.shootproof+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shopkick+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.shp": { + "source": "iana" + }, + "application/vnd.shx": { + "source": "iana" + }, + "application/vnd.sigrok.session": { + "source": "iana" + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.snesdev-page-table": { + "source": "iana" + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana", + "compressible": true, + "extensions": ["fo"] + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "compressible": true, + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sqlite3": { + "source": "iana" + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wadl"] + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.sycle+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.syft+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["ddf"] + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana", + "charset": "UTF-8", + "compressible": true + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tableschema+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.think-cell.ppttc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.tml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.tri.onesource": { + "source": "iana" + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["uoml"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.uri-map": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.vel+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.veritone.aion+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.veryant.thin": { + "source": "iana" + }, + "application/vnd.ves.encrypted": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "iana" + }, + "application/vnd.wap.wbxml": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "iana", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.dpp": { + "source": "iana" + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.wv.ssp+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana", + "compressible": true + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.youtube.yt": { + "source": "iana" + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "compressible": true, + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["vxml"] + }, + "application/voucher-cms+json": { + "source": "iana", + "compressible": true + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/wasm": { + "source": "iana", + "compressible": true, + "extensions": ["wasm"] + }, + "application/watcherinfo+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wif"] + }, + "application/webpush-options+json": { + "source": "iana", + "compressible": true + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "compressible": true, + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-arj": { + "compressible": false, + "extensions": ["arj"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-cocoa": { + "source": "nginx", + "extensions": ["cco"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "compressible": true, + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "compressible": true, + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "compressible": true, + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-httpd-php": { + "compressible": true, + "extensions": ["php"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-iwork-keynote-sffkey": { + "extensions": ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + "extensions": ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + "extensions": ["pages"] + }, + "application/x-java-archive-diff": { + "source": "nginx", + "extensions": ["jardiff"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-keepass2": { + "extensions": ["kdbx"] + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-makeself": { + "source": "nginx", + "extensions": ["run"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdos-program": { + "extensions": ["exe"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-ns-proxy-autoconfig": { + "compressible": true, + "extensions": ["pac"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-perl": { + "source": "nginx", + "extensions": ["pl","pm"] + }, + "application/x-pilot": { + "source": "nginx", + "extensions": ["prc","pdb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-pki-message": { + "source": "iana" + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-redhat-package-manager": { + "source": "nginx", + "extensions": ["rpm"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sea": { + "source": "nginx", + "extensions": ["sea"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl","tk"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-virtualbox-hdd": { + "compressible": true, + "extensions": ["hdd"] + }, + "application/x-virtualbox-ova": { + "compressible": true, + "extensions": ["ova"] + }, + "application/x-virtualbox-ovf": { + "compressible": true, + "extensions": ["ovf"] + }, + "application/x-virtualbox-vbox": { + "compressible": true, + "extensions": ["vbox"] + }, + "application/x-virtualbox-vbox-extpack": { + "compressible": false, + "extensions": ["vbox-extpack"] + }, + "application/x-virtualbox-vdi": { + "compressible": true, + "extensions": ["vdi"] + }, + "application/x-virtualbox-vhd": { + "compressible": true, + "extensions": ["vhd"] + }, + "application/x-virtualbox-vmdk": { + "compressible": true, + "extensions": ["vmdk"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "iana", + "extensions": ["der","crt","pem"] + }, + "application/x-x509-ca-ra-cert": { + "source": "iana" + }, + "application/x-x509-next-ca-cert": { + "source": "iana" + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana", + "compressible": true + }, + "application/xaml+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xav"] + }, + "application/xcap-caps+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xca"] + }, + "application/xcap-diff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xel"] + }, + "application/xcap-error+xml": { + "source": "iana", + "compressible": true + }, + "application/xcap-ns+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xns"] + }, + "application/xcon-conference-info+xml": { + "source": "iana", + "compressible": true + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana", + "compressible": true + }, + "application/xenc+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xenc"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "apache", + "compressible": true + }, + "application/xliff+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xlf"] + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd","rng"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/xmpp+xml": { + "source": "iana", + "compressible": true + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xsl","xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "compressible": true, + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "compressible": true, + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yang-data+json": { + "source": "iana", + "compressible": true + }, + "application/yang-data+xml": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+json": { + "source": "iana", + "compressible": true + }, + "application/yang-patch+xml": { + "source": "iana", + "compressible": true + }, + "application/yin+xml": { + "source": "iana", + "compressible": true, + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zlib": { + "source": "iana" + }, + "application/zstd": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana", + "compressible": false, + "extensions": ["3gpp"] + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/aac": { + "source": "iana" + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana", + "extensions": ["amr"] + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/evs": { + "source": "iana" + }, + "audio/flexfec": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g711-0": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "iana" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/melp": { + "source": "iana" + }, + "audio/melp1200": { + "source": "iana" + }, + "audio/melp2400": { + "source": "iana" + }, + "audio/melp600": { + "source": "iana" + }, + "audio/mhas": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/mobile-xmf": { + "source": "iana", + "extensions": ["mxmf"] + }, + "audio/mp3": { + "compressible": false, + "extensions": ["mp3"] + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["m4a","mp4a"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx","opus"] + }, + "audio/opus": { + "source": "iana" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/scip": { + "source": "iana" + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sofa": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tetra_acelp": { + "source": "iana" + }, + "audio/tetra_acelp_bb": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/tsvcis": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/usac": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dts.uhd": { + "source": "iana" + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.presonus.multitrack": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "iana" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "iana" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/wav": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/wave": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-m4a": { + "source": "nginx", + "extensions": ["m4a"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-realaudio": { + "source": "nginx", + "extensions": ["ra"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/collection": { + "source": "iana", + "extensions": ["ttc"] + }, + "font/otf": { + "source": "iana", + "compressible": true, + "extensions": ["otf"] + }, + "font/sfnt": { + "source": "iana" + }, + "font/ttf": { + "source": "iana", + "compressible": true, + "extensions": ["ttf"] + }, + "font/woff": { + "source": "iana", + "extensions": ["woff"] + }, + "font/woff2": { + "source": "iana", + "extensions": ["woff2"] + }, + "image/aces": { + "source": "iana", + "extensions": ["exr"] + }, + "image/apng": { + "compressible": false, + "extensions": ["apng"] + }, + "image/avci": { + "source": "iana", + "extensions": ["avci"] + }, + "image/avcs": { + "source": "iana", + "extensions": ["avcs"] + }, + "image/avif": { + "source": "iana", + "compressible": false, + "extensions": ["avif"] + }, + "image/bmp": { + "source": "iana", + "compressible": true, + "extensions": ["bmp"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/dicom-rle": { + "source": "iana", + "extensions": ["drle"] + }, + "image/emf": { + "source": "iana", + "extensions": ["emf"] + }, + "image/fits": { + "source": "iana", + "extensions": ["fits"] + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/heic": { + "source": "iana", + "extensions": ["heic"] + }, + "image/heic-sequence": { + "source": "iana", + "extensions": ["heics"] + }, + "image/heif": { + "source": "iana", + "extensions": ["heif"] + }, + "image/heif-sequence": { + "source": "iana", + "extensions": ["heifs"] + }, + "image/hej2k": { + "source": "iana", + "extensions": ["hej2"] + }, + "image/hsj2": { + "source": "iana", + "extensions": ["hsj2"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/jls": { + "source": "iana", + "extensions": ["jls"] + }, + "image/jp2": { + "source": "iana", + "compressible": false, + "extensions": ["jp2","jpg2"] + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpeg","jpg","jpe"] + }, + "image/jph": { + "source": "iana", + "extensions": ["jph"] + }, + "image/jphc": { + "source": "iana", + "extensions": ["jhc"] + }, + "image/jpm": { + "source": "iana", + "compressible": false, + "extensions": ["jpm"] + }, + "image/jpx": { + "source": "iana", + "compressible": false, + "extensions": ["jpx","jpf"] + }, + "image/jxr": { + "source": "iana", + "extensions": ["jxr"] + }, + "image/jxra": { + "source": "iana", + "extensions": ["jxra"] + }, + "image/jxrs": { + "source": "iana", + "extensions": ["jxrs"] + }, + "image/jxs": { + "source": "iana", + "extensions": ["jxs"] + }, + "image/jxsc": { + "source": "iana", + "extensions": ["jxsc"] + }, + "image/jxsi": { + "source": "iana", + "extensions": ["jxsi"] + }, + "image/jxss": { + "source": "iana", + "extensions": ["jxss"] + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/ktx2": { + "source": "iana", + "extensions": ["ktx2"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif"] + }, + "image/prs.pti": { + "source": "iana", + "extensions": ["pti"] + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana", + "extensions": ["t38"] + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tif","tiff"] + }, + "image/tiff-fx": { + "source": "iana", + "extensions": ["tfx"] + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana", + "extensions": ["azv"] + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "iana", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana", + "compressible": true, + "extensions": ["ico"] + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.mozilla.apng": { + "source": "iana" + }, + "image/vnd.ms-dds": { + "compressible": true, + "extensions": ["dds"] + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.pco.b16": { + "source": "iana", + "extensions": ["b16"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "iana" + }, + "image/vnd.svf": { + "source": "iana" + }, + "image/vnd.tencent.tap": { + "source": "iana", + "extensions": ["tap"] + }, + "image/vnd.valve.source.texture": { + "source": "iana", + "extensions": ["vtf"] + }, + "image/vnd.wap.wbmp": { + "source": "iana", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/vnd.zbrush.pcx": { + "source": "iana", + "extensions": ["pcx"] + }, + "image/webp": { + "source": "apache", + "extensions": ["webp"] + }, + "image/wmf": { + "source": "iana", + "extensions": ["wmf"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-jng": { + "source": "nginx", + "extensions": ["jng"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-ms-bmp": { + "source": "nginx", + "compressible": true, + "extensions": ["bmp"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana", + "extensions": [ + "disposition-notification" + ] + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana", + "extensions": ["u8msg"] + }, + "message/global-delivery-status": { + "source": "iana", + "extensions": ["u8dsn"] + }, + "message/global-disposition-notification": { + "source": "iana", + "extensions": ["u8mdn"] + }, + "message/global-headers": { + "source": "iana", + "extensions": ["u8hdr"] + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/news": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime"] + }, + "message/s-http": { + "source": "iana" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "iana" + }, + "message/vnd.wfa.wsc": { + "source": "iana", + "extensions": ["wsc"] + }, + "model/3mf": { + "source": "iana", + "extensions": ["3mf"] + }, + "model/e57": { + "source": "iana" + }, + "model/gltf+json": { + "source": "iana", + "compressible": true, + "extensions": ["gltf"] + }, + "model/gltf-binary": { + "source": "iana", + "compressible": true, + "extensions": ["glb"] + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/mtl": { + "source": "iana", + "extensions": ["mtl"] + }, + "model/obj": { + "source": "iana", + "extensions": ["obj"] + }, + "model/step": { + "source": "iana" + }, + "model/step+xml": { + "source": "iana", + "compressible": true, + "extensions": ["stpx"] + }, + "model/step+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpz"] + }, + "model/step-xml+zip": { + "source": "iana", + "compressible": false, + "extensions": ["stpxz"] + }, + "model/stl": { + "source": "iana", + "extensions": ["stl"] + }, + "model/vnd.collada+xml": { + "source": "iana", + "compressible": true, + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "iana", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "apache" + }, + "model/vnd.gs.gdl": { + "source": "iana" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana", + "compressible": true + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana", + "extensions": ["ogex"] + }, + "model/vnd.parasolid.transmit.binary": { + "source": "iana", + "extensions": ["x_b"] + }, + "model/vnd.parasolid.transmit.text": { + "source": "iana", + "extensions": ["x_t"] + }, + "model/vnd.pytha.pyox": { + "source": "iana" + }, + "model/vnd.rosette.annotated-data-model": { + "source": "iana" + }, + "model/vnd.sap.vds": { + "source": "iana", + "extensions": ["vds"] + }, + "model/vnd.usdz+zip": { + "source": "iana", + "compressible": false, + "extensions": ["usdz"] + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana", + "extensions": ["bsp"] + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana", + "extensions": ["x3db"] + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana", + "extensions": ["x3dv"] + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana" + }, + "multipart/multilingual": { + "source": "iana" + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/vnd.bint.med-plus": { + "source": "iana" + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee","litcoffee"] + }, + "text/cql": { + "source": "iana" + }, + "text/cql-expression": { + "source": "iana" + }, + "text/cql-identifier": { + "source": "iana" + }, + "text/css": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "iana" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/fhirpath": { + "source": "iana" + }, + "text/flexfec": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/gff3": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm","shtml"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "compressible": true + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "compressible": true, + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana", + "compressible": true, + "extensions": ["markdown","md"] + }, + "text/mathml": { + "source": "nginx", + "extensions": ["mml"] + }, + "text/mdx": { + "compressible": true, + "extensions": ["mdx"] + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana", + "charset": "UTF-8" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana", + "charset": "UTF-8" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/prs.prop.logic": { + "source": "iana" + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/shaclc": { + "source": "iana" + }, + "text/shex": { + "source": "iana", + "extensions": ["shex"] + }, + "text/slim": { + "extensions": ["slim","slm"] + }, + "text/spdx": { + "source": "iana", + "extensions": ["spdx"] + }, + "text/strings": { + "source": "iana" + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd.a": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.ascii-art": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "iana", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.familysearch.gedcom": { + "source": "iana", + "extensions": ["ged"] + }, + "text/vnd.ficlab.flt": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.gml": { + "source": "iana" + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.hans": { + "source": "iana" + }, + "text/vnd.hgl": { + "source": "iana" + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.senx.warpscript": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "iana" + }, + "text/vnd.sosi": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "charset": "UTF-8", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana", + "charset": "UTF-8" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "iana", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vtt": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "source": "nginx", + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-org": { + "compressible": true, + "extensions": ["org"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-processing": { + "compressible": true, + "extensions": ["pde"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-suse-ymp": { + "compressible": true, + "extensions": ["ymp"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml"] + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "compressible": true, + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "iana" + }, + "video/3gpp": { + "source": "iana", + "extensions": ["3gp","3gpp"] + }, + "video/3gpp-tt": { + "source": "iana" + }, + "video/3gpp2": { + "source": "iana", + "extensions": ["3g2"] + }, + "video/av1": { + "source": "iana" + }, + "video/bmpeg": { + "source": "iana" + }, + "video/bt656": { + "source": "iana" + }, + "video/celb": { + "source": "iana" + }, + "video/dv": { + "source": "iana" + }, + "video/encaprtp": { + "source": "iana" + }, + "video/ffv1": { + "source": "iana" + }, + "video/flexfec": { + "source": "iana" + }, + "video/h261": { + "source": "iana", + "extensions": ["h261"] + }, + "video/h263": { + "source": "iana", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "iana" + }, + "video/h263-2000": { + "source": "iana" + }, + "video/h264": { + "source": "iana", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "iana" + }, + "video/h264-svc": { + "source": "iana" + }, + "video/h265": { + "source": "iana" + }, + "video/iso.segment": { + "source": "iana", + "extensions": ["m4s"] + }, + "video/jpeg": { + "source": "iana", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "iana" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/jxsv": { + "source": "iana" + }, + "video/mj2": { + "source": "iana", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "iana" + }, + "video/mp2p": { + "source": "iana" + }, + "video/mp2t": { + "source": "iana", + "extensions": ["ts"] + }, + "video/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "iana" + }, + "video/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "iana" + }, + "video/mpv": { + "source": "iana" + }, + "video/nv": { + "source": "iana" + }, + "video/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "iana" + }, + "video/pointer": { + "source": "iana" + }, + "video/quicktime": { + "source": "iana", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raptorfec": { + "source": "iana" + }, + "video/raw": { + "source": "iana" + }, + "video/rtp-enc-aescm128": { + "source": "iana" + }, + "video/rtploopback": { + "source": "iana" + }, + "video/rtx": { + "source": "iana" + }, + "video/scip": { + "source": "iana" + }, + "video/smpte291": { + "source": "iana" + }, + "video/smpte292m": { + "source": "iana" + }, + "video/ulpfec": { + "source": "iana" + }, + "video/vc1": { + "source": "iana" + }, + "video/vc2": { + "source": "iana" + }, + "video/vnd.cctv": { + "source": "iana" + }, + "video/vnd.dece.hd": { + "source": "iana", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "iana", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "iana" + }, + "video/vnd.dece.pd": { + "source": "iana", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "iana", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "iana", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "iana" + }, + "video/vnd.directv.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "iana" + }, + "video/vnd.dvb.file": { + "source": "iana", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "iana", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "iana" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "iana" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "iana" + }, + "video/vnd.motorola.video": { + "source": "iana" + }, + "video/vnd.motorola.videop": { + "source": "iana" + }, + "video/vnd.mpegurl": { + "source": "iana", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "iana", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "iana" + }, + "video/vnd.nokia.mp4vr": { + "source": "iana" + }, + "video/vnd.nokia.videovoip": { + "source": "iana" + }, + "video/vnd.objectvideo": { + "source": "iana" + }, + "video/vnd.radgamettools.bink": { + "source": "iana" + }, + "video/vnd.radgamettools.smacker": { + "source": "iana" + }, + "video/vnd.sealed.mpeg1": { + "source": "iana" + }, + "video/vnd.sealed.mpeg4": { + "source": "iana" + }, + "video/vnd.sealed.swf": { + "source": "iana" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "iana" + }, + "video/vnd.uvvu.mp4": { + "source": "iana", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "iana", + "extensions": ["viv"] + }, + "video/vnd.youtube.yt": { + "source": "iana" + }, + "video/vp8": { + "source": "iana" + }, + "video/vp9": { + "source": "iana" + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/node_modules/form-data/node_modules/mime-db/index.js b/node_modules/form-data/node_modules/mime-db/index.js new file mode 100644 index 0000000..ec2be30 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-db/index.js @@ -0,0 +1,12 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/node_modules/form-data/node_modules/mime-db/package.json b/node_modules/form-data/node_modules/mime-db/package.json new file mode 100644 index 0000000..32c14b8 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-db/package.json @@ -0,0 +1,60 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.52.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)", + "Robert Kieffer (http://github.com/broofa)" + ], + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": "jshttp/mime-db", + "devDependencies": { + "bluebird": "3.7.2", + "co": "4.6.0", + "cogent": "1.0.1", + "csv-parse": "4.16.3", + "eslint": "7.32.0", + "eslint-config-standard": "15.0.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.1.1", + "eslint-plugin-standard": "4.1.0", + "gnode": "0.1.2", + "media-typer": "1.1.0", + "mocha": "9.2.1", + "nyc": "15.1.0", + "raw-body": "2.5.0", + "stream-to-array": "2.3.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "db.json", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build", + "fetch": "node scripts/fetch-apache && gnode scripts/fetch-iana && node scripts/fetch-nginx", + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/form-data/node_modules/mime-types/HISTORY.md b/node_modules/form-data/node_modules/mime-types/HISTORY.md new file mode 100644 index 0000000..c5043b7 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-types/HISTORY.md @@ -0,0 +1,397 @@ +2.1.35 / 2022-03-12 +=================== + + * deps: mime-db@1.52.0 + - Add extensions from IANA for more `image/*` types + - Add extension `.asc` to `application/pgp-keys` + - Add extensions to various XML types + - Add new upstream MIME types + +2.1.34 / 2021-11-08 +=================== + + * deps: mime-db@1.51.0 + - Add new upstream MIME types + +2.1.33 / 2021-10-01 +=================== + + * deps: mime-db@1.50.0 + - Add deprecated iWorks mime types and extensions + - Add new upstream MIME types + +2.1.32 / 2021-07-27 +=================== + + * deps: mime-db@1.49.0 + - Add extension `.trig` to `application/trig` + - Add new upstream MIME types + +2.1.31 / 2021-06-01 +=================== + + * deps: mime-db@1.48.0 + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add new upstream MIME types + +2.1.30 / 2021-04-02 +=================== + + * deps: mime-db@1.47.0 + - Add extension `.amr` to `audio/amr` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +2.1.29 / 2021-02-17 +=================== + + * deps: mime-db@1.46.0 + - Add extension `.amr` to `audio/amr` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.opus` to `audio/ogg` + - Add new upstream MIME types + +2.1.28 / 2021-01-01 +=================== + + * deps: mime-db@1.45.0 + - Add `application/ubjson` with extension `.ubj` + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + +2.1.27 / 2020-04-23 +=================== + + * deps: mime-db@1.44.0 + - Add charsets from IANA + - Add extension `.cjs` to `application/node` + - Add new upstream MIME types + +2.1.26 / 2020-01-05 +=================== + + * deps: mime-db@1.43.0 + - Add `application/x-keepass2` with extension `.kdbx` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extensions from IANA for `application/*+xml` types + - Add new upstream MIME types + +2.1.25 / 2019-11-12 +=================== + + * deps: mime-db@1.42.0 + - Add new upstream MIME types + - Add `application/toml` with extension `.toml` + - Add `image/vnd.ms-dds` with extension `.dds` + +2.1.24 / 2019-04-20 +=================== + + * deps: mime-db@1.40.0 + - Add extensions from IANA for `model/*` types + - Add `text/mdx` with extension `.mdx` + +2.1.23 / 2019-04-17 +=================== + + * deps: mime-db@~1.39.0 + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add new upstream MIME types + +2.1.22 / 2019-02-14 +=================== + + * deps: mime-db@~1.38.0 + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add new upstream MIME types + +2.1.21 / 2018-10-19 +=================== + + * deps: mime-db@~1.37.0 + - Add extensions to HEIC image types + - Add new upstream MIME types + +2.1.20 / 2018-08-26 +=================== + + * deps: mime-db@~1.36.0 + - Add Apple file extensions from IANA + - Add extensions from IANA for `image/*` types + - Add new upstream MIME types + +2.1.19 / 2018-07-17 +=================== + + * deps: mime-db@~1.35.0 + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.owl` to `application/rdf+xml` + - Add new upstream MIME types + - Add UTF-8 as default charset for `text/turtle` + +2.1.18 / 2018-02-16 +=================== + + * deps: mime-db@~1.33.0 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add new upstream MIME types + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +2.1.17 / 2017-09-01 +=================== + + * deps: mime-db@~1.30.0 + - Add `application/vnd.ms-outlook` + - Add `application/x-arj` + - Add extension `.mjs` to `application/javascript` + - Add glTF types and extensions + - Add new upstream MIME types + - Add `text/x-org` + - Add VirtualBox MIME types + - Fix `source` records for `video/*` types that are IANA + - Update `font/opentype` to registered `font/otf` + +2.1.16 / 2017-07-24 +=================== + + * deps: mime-db@~1.29.0 + - Add `application/fido.trusted-apps+json` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add new upstream MIME types + - Update extensions `.md` and `.markdown` to be `text/markdown` + +2.1.15 / 2017-03-23 +=================== + + * deps: mime-db@~1.27.0 + - Add new mime types + - Add `image/apng` + +2.1.14 / 2017-01-14 +=================== + + * deps: mime-db@~1.26.0 + - Add new mime types + +2.1.13 / 2016-11-18 +=================== + + * deps: mime-db@~1.25.0 + - Add new mime types + +2.1.12 / 2016-09-18 +=================== + + * deps: mime-db@~1.24.0 + - Add new mime types + - Add `audio/mp3` + +2.1.11 / 2016-05-01 +=================== + + * deps: mime-db@~1.23.0 + - Add new mime types + +2.1.10 / 2016-02-15 +=================== + + * deps: mime-db@~1.22.0 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +2.1.9 / 2016-01-06 +================== + + * deps: mime-db@~1.21.0 + - Add new mime types + +2.1.8 / 2015-11-30 +================== + + * deps: mime-db@~1.20.0 + - Add new mime types + +2.1.7 / 2015-09-20 +================== + + * deps: mime-db@~1.19.0 + - Add new mime types + +2.1.6 / 2015-09-03 +================== + + * deps: mime-db@~1.18.0 + - Add new mime types + +2.1.5 / 2015-08-20 +================== + + * deps: mime-db@~1.17.0 + - Add new mime types + +2.1.4 / 2015-07-30 +================== + + * deps: mime-db@~1.16.0 + - Add new mime types + +2.1.3 / 2015-07-13 +================== + + * deps: mime-db@~1.15.0 + - Add new mime types + +2.1.2 / 2015-06-25 +================== + + * deps: mime-db@~1.14.0 + - Add new mime types + +2.1.1 / 2015-06-08 +================== + + * perf: fix deopt during mapping + +2.1.0 / 2015-06-07 +================== + + * Fix incorrectly treating extension-less file name as extension + - i.e. `'path/to/json'` will no longer return `application/json` + * Fix `.charset(type)` to accept parameters + * Fix `.charset(type)` to match case-insensitive + * Improve generation of extension to MIME mapping + * Refactor internals for readability and no argument reassignment + * Prefer `application/*` MIME types from the same source + * Prefer any type over `application/octet-stream` + * deps: mime-db@~1.13.0 + - Add nginx as a source + - Add new mime types + +2.0.14 / 2015-06-06 +=================== + + * deps: mime-db@~1.12.0 + - Add new mime types + +2.0.13 / 2015-05-31 +=================== + + * deps: mime-db@~1.11.0 + - Add new mime types + +2.0.12 / 2015-05-19 +=================== + + * deps: mime-db@~1.10.0 + - Add new mime types + +2.0.11 / 2015-05-05 +=================== + + * deps: mime-db@~1.9.1 + - Add new mime types + +2.0.10 / 2015-03-13 +=================== + + * deps: mime-db@~1.8.0 + - Add new mime types + +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/node_modules/form-data/node_modules/mime-types/LICENSE b/node_modules/form-data/node_modules/mime-types/LICENSE new file mode 100644 index 0000000..0616607 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-types/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/form-data/node_modules/mime-types/README.md b/node_modules/form-data/node_modules/mime-types/README.md new file mode 100644 index 0000000..48d2fb4 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-types/README.md @@ -0,0 +1,113 @@ +# mime-types + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +The ultimate javascript content-type utility. + +Similar to [the `mime@1.x` module](https://www.npmjs.com/package/mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, + `mime-types` simply returns `false`, so do + `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- No `.define()` functionality +- Bug fixes for `.lookup(path)` + +Otherwise, the API is compatible with `mime` 1.x. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install mime-types +``` + +## Adding Types + +All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db), +so open a PR there if you'd like to add mime types. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' +mime.lookup('folder/.htaccess') // false + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. +When given an extension, `mime.lookup` is used to get the matching +content-type, otherwise the given content-type is used. Then if the +content-type does not already have a `charset` parameter, `mime.charset` +is used to get the default charset and add to the returned content-type. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' +mime.contentType('text/html') // 'text/html; charset=utf-8' +mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1' + +// from a full path +mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/markdown') // 'UTF-8' +``` + +### var type = mime.types[extension] + +A map of content-types by extension. + +### [extensions...] = mime.extensions[type] + +A map of extensions by content-type. + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/mime-types/master?label=ci +[ci-url]: https://github.com/jshttp/mime-types/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/mime-types/master +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types?branch=master +[node-version-image]: https://badgen.net/npm/node/mime-types +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/mime-types +[npm-url]: https://npmjs.org/package/mime-types +[npm-version-image]: https://badgen.net/npm/v/mime-types diff --git a/node_modules/form-data/node_modules/mime-types/index.js b/node_modules/form-data/node_modules/mime-types/index.js new file mode 100644 index 0000000..b9f34d5 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-types/index.js @@ -0,0 +1,188 @@ +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var db = require('mime-db') +var extname = require('path').extname + +/** + * Module variables. + * @private + */ + +var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/ +var TEXT_TYPE_REGEXP = /^text\//i + +/** + * Module exports. + * @public + */ + +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function charset (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + var mime = match && db[match[1].toLowerCase()] + + if (mime && mime.charset) { + return mime.charset + } + + // default text/* to utf-8 + if (match && TEXT_TYPE_REGEXP.test(match[1])) { + return 'UTF-8' + } + + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {boolean|string} + */ + +function contentType (str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } + + var mime = str.indexOf('/') === -1 + ? exports.lookup(str) + : str + + if (!mime) { + return false + } + + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() + } + + return mime +} + +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function extension (type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = EXTRACT_TYPE_REGEXP.exec(type) + + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] + + if (!exts || !exts.length) { + return false + } + + return exts[0] +} + +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {boolean|string} + */ + +function lookup (path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .substr(1) + + if (!extension) { + return false + } + + return exports.types[extension] || false +} + +/** + * Populate the extensions and types maps. + * @private + */ + +function populateMaps (extensions, types) { + // source preference (least -> most) + var preference = ['nginx', 'apache', undefined, 'iana'] + + Object.keys(db).forEach(function forEachMimeType (type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + + if (types[extension]) { + var from = preference.indexOf(db[types[extension]].source) + var to = preference.indexOf(mime.source) + + if (types[extension] !== 'application/octet-stream' && + (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) { + // skip the remapping + continue + } + } + + // set the extension -> mime + types[extension] = type + } + }) +} diff --git a/node_modules/form-data/node_modules/mime-types/package.json b/node_modules/form-data/node_modules/mime-types/package.json new file mode 100644 index 0000000..bbef696 --- /dev/null +++ b/node_modules/form-data/node_modules/mime-types/package.json @@ -0,0 +1,44 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "2.1.35", + "contributors": [ + "Douglas Christopher Wilson ", + "Jeremiah Senkpiel (https://searchbeam.jit.su)", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": "jshttp/mime-types", + "dependencies": { + "mime-db": "1.52.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.2", + "nyc": "15.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec test/test.js", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/form-data/package.json b/node_modules/form-data/package.json new file mode 100644 index 0000000..f8d6117 --- /dev/null +++ b/node_modules/form-data/package.json @@ -0,0 +1,82 @@ +{ + "author": "Felix Geisendörfer (http://debuggable.com/)", + "name": "form-data", + "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", + "version": "4.0.5", + "repository": { + "type": "git", + "url": "git://github.com/form-data/form-data.git" + }, + "main": "./lib/form_data", + "browser": "./lib/browser", + "typings": "./index.d.ts", + "scripts": { + "pretest": "npm run lint", + "pretests-only": "rimraf coverage test/tmp", + "tests-only": "istanbul cover test/run.js", + "posttests-only": "istanbul report lcov text", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "lint": "eslint --ext=js,mjs .", + "report": "istanbul report lcov text", + "ci-lint": "is-node-modern 8 && npm run lint || is-node-not-modern 8", + "ci-test": "npm run tests-only && npm run browser && npm run report", + "predebug": "rimraf coverage test/tmp", + "debug": "verbose=1 ./test/run.js", + "browser": "browserify -t browserify-istanbul test/run-browser.js | obake --coverage", + "check": "istanbul check-coverage coverage/coverage*.json", + "files": "pkgfiles --sort=name", + "get-version": "node -e \"console.log(require('./package.json').version)\"", + "update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md", + "postupdate-readme": "mv README.md.bak READ.ME.md.bak", + "restore-readme": "mv READ.ME.md.bak README.md", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepack": "npm run update-readme", + "postpack": "npm run restore-readme", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "engines": { + "node": ">= 6" + }, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.4.0", + "auto-changelog": "^2.5.0", + "browserify": "^13.3.0", + "browserify-istanbul": "^2.0.0", + "coveralls": "^3.1.1", + "cross-spawn": "^6.0.6", + "eslint": "^8.57.1", + "fake": "^0.2.2", + "far": "^0.0.7", + "formidable": "^1.2.6", + "in-publish": "^2.0.1", + "is-node-modern": "^1.0.0", + "istanbul": "^0.4.5", + "js-randomness-predictor": "^1.5.5", + "obake": "^0.1.2", + "pkgfiles": "^2.3.2", + "pre-commit": "^1.2.2", + "puppeteer": "^1.20.0", + "request": "~2.87.0", + "rimraf": "^2.7.1", + "semver": "^6.3.1", + "tape": "^5.9.0" + }, + "license": "MIT", + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + } +} diff --git a/node_modules/formidable/LICENSE b/node_modules/formidable/LICENSE new file mode 100644 index 0000000..5e7ad11 --- /dev/null +++ b/node_modules/formidable/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2011-present Felix Geisendörfer, and contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/formidable/README.md b/node_modules/formidable/README.md new file mode 100644 index 0000000..a3990fd --- /dev/null +++ b/node_modules/formidable/README.md @@ -0,0 +1,891 @@ +

+ npm formidable package logo +

+ +# formidable [![npm version][npmv-img]][npmv-url] [![MIT license][license-img]][license-url] [![Libera Manifesto][libera-manifesto-img]][libera-manifesto-url] [![Twitter][twitter-img]][twitter-url] + +> A Node.js module for parsing form data, especially file uploads. + +[![Code style][codestyle-img]][codestyle-url] +[![linux build status][linux-build-img]][build-url] +[![macos build status][macos-build-img]][build-url] + + +If you have any _how-to_ kind of questions, please read the [Contributing +Guide][contributing-url] and [Code of Conduct][code_of_conduct-url] +documents.
For bugs reports and feature requests, [please create an +issue][open-issue-url] or ping [@wgw_eth / @wgw_lol][twitter-url] +at Twitter. + +[![Conventional Commits][ccommits-img]][ccommits-url] +[![Minimum Required Nodejs][nodejs-img]][npmv-url] +[![Buy me a Kofi][kofi-img]][kofi-url] +[![Make A Pull Request][prs-welcome-img]][prs-welcome-url] + + + +This project is [semantically versioned](https://semver.org) and if you want support in migrating between versions you can schedule us for training or support us through donations, so we can prioritize. + +> [!CAUTION] +> As of April 2025, old versions like v1 and v2 are still the most used, while they are deperecated for years -- they are also vulnerable to attacks if you are not implementing it properly. **Please upgrade!** We are here to help, and AI Editors & Agents could help a lot in such codemod-like migrations. + +> [!TIP] +> If you are starting a fresh project, you can check out the `formidable-mini` which is a super minimal version of Formidable (not quite configurable yet, but when it does it could become the basis for `formidable@v4`), using web standards like FormData API and File API, and you can use it to stream uploads directly to S3 or other such services. + + + +[![][npm-weekly-img]][npmv-url] [![][npm-monthly-img]][npmv-url] +[![][npm-yearly-img]][npmv-url] [![][npm-alltime-img]][npmv-url] + +## Project Status: Maintained + +> [!NOTE] +> Check [VERSION NOTES](https://github.com/node-formidable/formidable/blob/master/VERSION_NOTES.md) for more information on v1, v2, and v3 plans, NPM dist-tags and branches._ + +This module was initially developed by +[**@felixge**](https://github.com/felixge) for +[Transloadit](http://transloadit.com/), a service focused on uploading and +encoding images and videos. It has been battle-tested against hundreds of GBs of +file uploads from a large variety of clients and is considered production-ready +and is used in production for years. + +Currently, we are few maintainers trying to deal with it. :) More contributors +are always welcome! :heart: Jump on +[issue #412](https://github.com/felixge/node-formidable/issues/412) which is +closed, but if you are interested we can discuss it and add you after strict +rules, like enabling Two-Factor Auth in your npm and GitHub accounts. + +## Highlights + +- [Fast (~900-2500 mb/sec)](#benchmarks) & streaming multipart parser +- Automatically writing file uploads to disk (optional, see + [`options.fileWriteStreamHandler`](#options)) +- [Plugins API](#useplugin-plugin) - allowing custom parsers and plugins +- Low memory footprint +- Graceful error handling +- Very high test coverage + +## Install + +This package is a dual ESM/commonjs package. + +> [!NOTE] +> This project requires `Node.js >= 20`. Install it using [yarn](https://yarnpkg.com) or [npm](https://npmjs.com).
_We highly recommend to use Yarn when you think to contribute to this project._ + +This is a low-level package, and if you're using a high-level framework it _may_ +already be included. Check the examples below and the [examples/](https://github.com/node-formidable/formidable/tree/master/examples) folder. + +``` +# v2 +npm install formidable@v2 + +# v3 +npm install formidable +npm install formidable@v3 +``` + +_**Note:** Future not ready releases will be published on `*-next` dist-tags for the corresponding version._ + + +## Examples + +For more examples look at the `examples/` directory. + +### with Node.js http module + +Parse an incoming file upload, with the +[Node.js's built-in `http` module](https://nodejs.org/api/http.html). + +```js +import http from 'node:http'; +import formidable, {errors as formidableErrors} from 'formidable'; + +const server = http.createServer(async (req, res) => { + if (req.url === '/api/upload' && req.method.toLowerCase() === 'post') { + // parse a file upload + const form = formidable({}); + let fields; + let files; + try { + [fields, files] = await form.parse(req); + } catch (err) { + // example to check for a very specific error + if (err.code === formidableErrors.maxFieldsExceeded) { + + } + console.error(err); + res.writeHead(err.httpCode || 400, { 'Content-Type': 'text/plain' }); + res.end(String(err)); + return; + } + res.writeHead(200, { 'Content-Type': 'application/json' }); + res.end(JSON.stringify({ fields, files }, null, 2)); + return; + } + + // show a file upload form + res.writeHead(200, { 'Content-Type': 'text/html' }); + res.end(` +

With Node.js "http" module

+
+
Text field title:
+
File:
+ +
+ `); +}); + +server.listen(8080, () => { + console.log('Server listening on http://localhost:8080/ ...'); +}); +``` + +### with Express.js + +There are multiple variants to do this, but Formidable just need Node.js Request +stream, so something like the following example should work just fine, without +any third-party [Express.js](https://ghub.now.sh/express) middleware. + +Or try the +[examples/with-express.js](https://github.com/node-formidable/formidable/blob/master/examples/with-express.js) + +```js +import express from 'express'; +import formidable from 'formidable'; + +const app = express(); + +app.get('/', (req, res) => { + res.send(` +

With "express" npm package

+
+
Text field title:
+
File:
+ +
+ `); +}); + +app.post('/api/upload', (req, res, next) => { + const form = formidable({}); + + form.parse(req, (err, fields, files) => { + if (err) { + next(err); + return; + } + res.json({ fields, files }); + }); +}); + +app.listen(3000, () => { + console.log('Server listening on http://localhost:3000 ...'); +}); +``` + +### with Koa and Formidable + +Of course, with [Koa v1, v2 or future v3](https://ghub.now.sh/koa) the things +are very similar. You can use `formidable` manually as shown below or through +the [koa-better-body](https://ghub.now.sh/koa-better-body) package which is +using `formidable` under the hood and support more features and different +request bodies, check its documentation for more info. + +_Note: this example is assuming Koa v2. Be aware that you should pass `ctx.req` +which is Node.js's Request, and **NOT** the `ctx.request` which is Koa's Request +object - there is a difference._ + +```js +import Koa from 'Koa'; +import formidable from 'formidable'; + +const app = new Koa(); + +app.on('error', (err) => { + console.error('server error', err); +}); + +app.use(async (ctx, next) => { + if (ctx.url === '/api/upload' && ctx.method.toLowerCase() === 'post') { + const form = formidable({}); + + // not very elegant, but that's for now if you don't want to use `koa-better-body` + // or other middlewares. + await new Promise((resolve, reject) => { + form.parse(ctx.req, (err, fields, files) => { + if (err) { + reject(err); + return; + } + + ctx.set('Content-Type', 'application/json'); + ctx.status = 200; + ctx.state = { fields, files }; + ctx.body = JSON.stringify(ctx.state, null, 2); + resolve(); + }); + }); + await next(); + return; + } + + // show a file upload form + ctx.set('Content-Type', 'text/html'); + ctx.status = 200; + ctx.body = ` +

With "koa" npm package

+
+
Text field title:
+
File:
+ +
+ `; +}); + +app.use((ctx) => { + console.log('The next middleware is called'); + console.log('Results:', ctx.state); +}); + +app.listen(3000, () => { + console.log('Server listening on http://localhost:3000 ...'); +}); +``` + +## Benchmarks + +The benchmark is quite old, from the old codebase. But maybe quite true though. +Previously the numbers was around ~500 mb/sec. Currently with moving to the new +Node.js Streams API it's faster. You can clearly see the differences between the +Node versions. + +_Note: a lot better benchmarking could and should be done in future._ + +Benchmarked on 8GB RAM, Xeon X3440 (2.53 GHz, 4 cores, 8 threads) + +``` +~/github/node-formidable master +❯ nve --parallel 8 10 12 13 node benchmark/bench-multipart-parser.js + + ⬢ Node 8 + +1261.08 mb/sec + + ⬢ Node 10 + +1113.04 mb/sec + + ⬢ Node 12 + +2107.00 mb/sec + + ⬢ Node 13 + +2566.42 mb/sec +``` + +![benchmark January 29th, 2020](./benchmark/2020-01-29_xeon-x3440.png) + +## API + +### Formidable / IncomingForm + +All shown are equivalent. + +_Please pass [`options`](#options) to the function/constructor, not by assigning +them to the instance `form`_ + +```js +import formidable from 'formidable'; +const form = formidable(options); +``` + +### Options + +See it's defaults in [src/Formidable.js DEFAULT_OPTIONS](./src/Formidable.js) +(the `DEFAULT_OPTIONS` constant). + +- `options.encoding` **{string}** - default `'utf-8'`; sets encoding for + incoming form fields, +- `options.uploadDir` **{string}** - default `os.tmpdir()`; the directory for + placing file uploads in. You can move them later by using `fs.rename()`. +- `options.keepExtensions` **{boolean}** - default `false`; to include the + extensions of the original files or not +- `options.allowEmptyFiles` **{boolean}** - default `false`; allow upload empty + files +- `options.minFileSize` **{number}** - default `1` (1byte); the minium size of + uploaded file. +- `options.maxFiles` **{number}** - default `Infinity`; + limit the amount of uploaded files, set Infinity for unlimited +- `options.maxFileSize` **{number}** - default `200 * 1024 * 1024` (200mb); + limit the size of each uploaded file. +- `options.maxTotalFileSize` **{number}** - default `options.maxFileSize`; + limit the size of the batch of uploaded files. +- `options.maxFields` **{number}** - default `1000`; limit the number of fields, set Infinity for unlimited +- `options.maxFieldsSize` **{number}** - default `20 * 1024 * 1024` (20mb); + limit the amount of memory all fields together (except files) can allocate in + bytes. +- `options.hashAlgorithm` **{string | false}** - default `false`; include checksums calculated + for incoming files, set this to some hash algorithm, see + [crypto.createHash](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options) + for available algorithms +- `options.fileWriteStreamHandler` **{function}** - default `null`, which by + default writes to host machine file system every file parsed; The function + should return an instance of a + [Writable stream](https://nodejs.org/api/stream.html#stream_class_stream_writable) + that will receive the uploaded file data. With this option, you can have any + custom behavior regarding where the uploaded file data will be streamed for. + If you are looking to write the file uploaded in other types of cloud storages + (AWS S3, Azure blob storage, Google cloud storage) or private file storage, + this is the option you're looking for. When this option is defined the default + behavior of writing the file in the host machine file system is lost. +- `options.filename` **{function}** - default `undefined` Use it to control + newFilename. Must return a string. Will be joined with options.uploadDir. + +- `options.filter` **{function}** - default function that always returns true. + Use it to filter files before they are uploaded. Must return a boolean. Will not make the form.parse error + +- `options.createDirsFromUploads` **{boolean}** - default false. If true, makes direct folder uploads possible. Use `` to create a form to upload folders. Has to be used with the options `options.uploadDir` and `options.filename` where `options.filename` has to return a string with the character `/` for folders to be created. The base will be `options.uploadDir`. + + +#### `options.filename` **{function}** function (name, ext, part, form) -> string + +where part can be decomposed as + +```js +const { originalFilename, mimetype} = part; +``` + +_**Note:** If this size of combined fields, or size of some file is exceeded, an +`'error'` event is fired._ + +```js +// The amount of bytes received for this form so far. +form.bytesReceived; +``` + +```js +// The expected number of bytes in this form. +form.bytesExpected; +``` + +#### `options.filter` **{function}** function ({name, originalFilename, mimetype}) -> boolean + +Behaves like Array.filter: Returning false will simply ignore the file and go to the next. + +```js +const options = { + filter: function ({name, originalFilename, mimetype}) { + // keep only images + return mimetype && mimetype.includes("image"); + } +}; +``` + +**Note:** use an outside variable to cancel all uploads upon the first error + +**Note:** use form.emit('error') to make form.parse error + +```js +let cancelUploads = false;// create variable at the same scope as form +const options = { + filter: function ({name, originalFilename, mimetype}) { + // keep only images + const valid = mimetype && mimetype.includes("image"); + if (!valid) { + form.emit('error', new formidableErrors.default('invalid type', 0, 400)); // optional make form.parse error + cancelUploads = true; //variable to make filter return false after the first problem + } + return valid && !cancelUploads; + } +}; +``` + + +### .parse(request, ?callback) + +Parses an incoming Node.js `request` containing form data. If `callback` is not provided a promise is returned. + +```js +const form = formidable({ uploadDir: __dirname }); + +form.parse(req, (err, fields, files) => { + console.log('fields:', fields); + console.log('files:', files); +}); + +// with Promise +const [fields, files] = await form.parse(req); +``` + +You may overwrite this method if you are interested in directly accessing the +multipart stream. Doing so will disable any `'field'` / `'file'` events +processing which would occur otherwise, making you fully responsible for +handling the processing. + +About `uploadDir`, given the following directory structure +``` +project-name +├── src +│ └── server.js +│ +└── uploads + └── image.jpg +``` + +`__dirname` would be the same directory as the source file itself (src) + + +```js + `${__dirname}/../uploads` +``` + +to put files in uploads. + +Omitting `__dirname` would make the path relative to the current working directory. This would be the same if server.js is launched from src but not project-name. + + +`null` will use default which is `os.tmpdir()` + +Note: If the directory does not exist, the uploaded files are __silently discarded__. To make sure it exists: + +```js +import {createNecessaryDirectoriesSync} from "filesac"; + + +const uploadPath = `${__dirname}/../uploads`; +createNecessaryDirectoriesSync(`${uploadPath}/x`); +``` + + +In the example below, we listen on couple of events and direct them to the +`data` listener, so you can do whatever you choose there, based on whether its +before the file been emitted, the header value, the header name, on field, on +file and etc. + +Or the other way could be to just override the `form.onPart` as it's shown a bit +later. + +```js +form.once('error', console.error); + +form.on('fileBegin', (formname, file) => { + form.emit('data', { name: 'fileBegin', formname, value: file }); +}); + +form.on('file', (formname, file) => { + form.emit('data', { name: 'file', formname, value: file }); +}); + +form.on('field', (fieldName, fieldValue) => { + form.emit('data', { name: 'field', key: fieldName, value: fieldValue }); +}); + +form.once('end', () => { + console.log('Done!'); +}); + +// If you want to customize whatever you want... +form.on('data', ({ name, key, value, buffer, start, end, formname, ...more }) => { + if (name === 'partBegin') { + } + if (name === 'partData') { + } + if (name === 'headerField') { + } + if (name === 'headerValue') { + } + if (name === 'headerEnd') { + } + if (name === 'headersEnd') { + } + if (name === 'field') { + console.log('field name:', key); + console.log('field value:', value); + } + if (name === 'file') { + console.log('file:', formname, value); + } + if (name === 'fileBegin') { + console.log('fileBegin:', formname, value); + } +}); +``` + +### .use(plugin: Plugin) + +A method that allows you to extend the Formidable library. By default we include +4 plugins, which essentially are adapters to plug the different built-in parsers. + +**The plugins added by this method are always enabled.** + +_See [src/plugins/](./src/plugins/) for more detailed look on default plugins._ + +The `plugin` param has such signature: + +```typescript +function(formidable: Formidable, options: Options): void; +``` + +The architecture is simple. The `plugin` is a function that is passed with the +Formidable instance (the `form` across the README examples) and the options. + +**Note:** the plugin function's `this` context is also the same instance. + +```js +const form = formidable({ keepExtensions: true }); + +form.use((self, options) => { + // self === this === form + console.log('woohoo, custom plugin'); + // do your stuff; check `src/plugins` for inspiration +}); + +form.parse(req, (error, fields, files) => { + console.log('done!'); +}); +``` + +**Important to note**, is that inside plugin `this.options`, `self.options` and +`options` MAY or MAY NOT be the same. General best practice is to always use the +`this`, so you can later test your plugin independently and more easily. + +If you want to disable some parsing capabilities of Formidable, you can disable +the plugin which corresponds to the parser. For example, if you want to disable +multipart parsing (so the [src/parsers/Multipart.js](./src/parsers/Multipart.js) +which is used in [src/plugins/multipart.js](./src/plugins/multipart.js)), then +you can remove it from the `options.enabledPlugins`, like so + +```js +import formidable, {octetstream, querystring, json} from "formidable"; +const form = formidable({ + hashAlgorithm: 'sha1', + enabledPlugins: [octetstream, querystring, json], +}); +``` + +**Be aware** that the order _MAY_ be important too. The names corresponds 1:1 to +files in [src/plugins/](./src/plugins) folder. + +Pull requests for new built-in plugins MAY be accepted - for example, more +advanced querystring parser. Add your plugin as a new file in `src/plugins/` +folder (lowercased) and follow how the other plugins are made. + +### form.onPart + +If you want to use Formidable to only handle certain parts for you, you can do +something similar. Or see +[#387](https://github.com/node-formidable/node-formidable/issues/387) for +inspiration, you can for example validate the mime-type. + +```js +const form = formidable(); + +form.onPart = (part) => { + part.on('data', (buffer) => { + // do whatever you want here + }); +}; +``` + +For example, force Formidable to be used only on non-file "parts" (i.e., html +fields) + +```js +const form = formidable(); + +form.onPart = function (part) { + // let formidable handle only non-file parts + if (part.originalFilename === '' || !part.mimetype) { + // used internally, please do not override! + form._handlePart(part); + } +}; +``` + +### File + +```ts +export interface File { + // The size of the uploaded file in bytes. + // If the file is still being uploaded (see `'fileBegin'` event), + // this property says how many bytes of the file have been written to disk yet. + file.size: number; + + // The path this file is being written to. You can modify this in the `'fileBegin'` event in + // case you are unhappy with the way formidable generates a temporary path for your files. + file.filepath: string; + + // The name this file had according to the uploading client. + file.originalFilename: string | null; + + // calculated based on options provided + file.newFilename: string | null; + + // The mime type of this file, according to the uploading client. + file.mimetype: string | null; + + // A Date object (or `null`) containing the time this file was last written to. + // Mostly here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/). + file.mtime: Date | null; + + file.hashAlgorithm: false | |'sha1' | 'md5' | 'sha256' + // If `options.hashAlgorithm` calculation was set, you can read the hex digest out of this var (at the end it will be a string) + file.hash: string | object | null; +} +``` + +#### file.toJSON() + +This method returns a JSON-representation of the file, allowing you to +`JSON.stringify()` the file which is useful for logging and responding to +requests. + +### Events + +#### `'progress'` + +Emitted after each incoming chunk of data that has been parsed. Can be used to +roll your own progress bar. **Warning** Use this only for server side progress bar. On the client side better use `XMLHttpRequest` with `xhr.upload.onprogress =` + +```js +form.on('progress', (bytesReceived, bytesExpected) => {}); +``` + +#### `'field'` + +Emitted whenever a field / value pair has been received. + +```js +form.on('field', (name, value) => {}); +``` + +#### `'fileBegin'` + +Emitted whenever a new file is detected in the upload stream. Use this event if +you want to stream the file to somewhere else while buffering the upload on the +file system. + +```js +form.on('fileBegin', (formName, file) => { + // accessible here + // formName the name in the form () or http filename for octetstream + // file.originalFilename http filename or null if there was a parsing error + // file.newFilename generated hexoid or what options.filename returned + // file.filepath default pathname as per options.uploadDir and options.filename + // file.filepath = CUSTOM_PATH // to change the final path +}); +``` + +#### `'file'` + +Emitted whenever a field / file pair has been received. `file` is an instance of +`File`. + +```js +form.on('file', (formname, file) => { + // same as fileBegin, except + // it is too late to change file.filepath + // file.hash is available if options.hash was used +}); +``` + +#### `'error'` + +Emitted when there is an error processing the incoming form. A request that +experiences an error is automatically paused, you will have to manually call +`request.resume()` if you want the request to continue firing `'data'` events. + +May have `error.httpCode` and `error.code` attached. + +```js +form.on('error', (err) => {}); +``` + +#### `'aborted'` + +Emitted when the request was aborted by the user. Right now this can be due to a +'timeout' or 'close' event on the socket. After this event is emitted, an +`error` event will follow. In the future there will be a separate 'timeout' +event (needs a change in the node core). + +```js +form.on('aborted', () => {}); +``` + +#### `'end'` + +Emitted when the entire request has been received, and all contained files have +finished flushing to disk. This is a great place for you to send your response. + +```js +form.on('end', () => {}); +``` + + +### Helpers + +#### firstValues + +Gets first values of fields, like pre 3.0.0 without multiples pass in a list of optional exceptions where arrays of strings is still wanted (` +
File:
+ + + `); +}); + +server.listen(8080, () => { + console.log('Server listening on http://localhost:8080/ ...'); +}); +``` + +### com Express.js + +Existem várias variantes para fazer isso, mas o Formidable só precisa do Node.js Request +stream, então algo como o exemplo a seguir deve funcionar bem, sem nenhum middleware [Express.js](https://ghub.now.sh/express) de terceiros. + +Ou tente o +[examples/with-express.js](https://github.com/node-formidable/formidable/blob/master/examples/with-express.js) + +```js +import express from 'express'; +import formidable from 'formidable'; + +const app = express(); + +app.get('/', (req, res) => { + res.send(` +

With "express" npm package

+
+
Text field title:
+
File:
+ +
+ `); +}); + +app.post('/api/upload', (req, res, next) => { + const form = formidable({}); + + form.parse(req, (err, fields, files) => { + if (err) { + next(err); + return; + } + res.json({ fields, files }); + }); +}); + +app.listen(3000, () => { + console.log('Server listening on http://localhost:3000 ...'); +}); +``` + +### com Koa e Formidable + +Claro, com [Koa v1, v2 ou future v3](https://ghub.now.sh/koa) as coisas +sao muito parecidas. Você pode usar `formidable` manualmente como mostrado abaixo ou através +do pacote [koa-better-body](https://ghub.now.sh/koa-better-body) que é +usando `formidable` sob o capô e suporte a mais recursos e diferentes +corpos de solicitação, verifique sua documentação para mais informações. + +_Nota: este exemplo está assumindo Koa v2. Esteja ciente de que você deve passar `ctx.req` +que é a solicitação do Node.js e **NÃO** o `ctx.request` que é a solicitação do Koa +objeto - há uma diferença._ + +```js +import Koa from 'Koa'; +import formidable from 'formidable'; + +const app = new Koa(); + +app.on('error', (err) => { + console.error('server error', err); +}); + +app.use(async (ctx, next) => { + if (ctx.url === '/api/upload' && ctx.method.toLowerCase() === 'post') { + const form = formidable({}); + + // não muito elegante, mas é por enquanto se você não quiser usar `koa-better-body` + // ou outros middlewares. + await new Promise((resolve, reject) => { + form.parse(ctx.req, (err, fields, files) => { + if (err) { + reject(err); + return; + } + + ctx.set('Content-Type', 'application/json'); + ctx.status = 200; + ctx.state = { fields, files }; + ctx.body = JSON.stringify(ctx.state, null, 2); + resolve(); + }); + }); + await next(); + return; + } + + // mostrar um formulário de upload de arquivo + ctx.set('Content-Type', 'text/html'); + ctx.status = 200; + ctx.body = ` +

With "koa" npm package

+
+
Text field title:
+
File:
+ +
+ `; +}); + +app.use((ctx) => { + console.log('The next middleware is called'); + console.log('Results:', ctx.state); +}); + +app.listen(3000, () => { + console.log('Server listening on http://localhost:3000 ...'); +}); +``` + +## Benchmarks + +O benchmark é bastante antigo, da antiga base de código. Mas talvez seja bem verdade. +Anteriormente, os números giravam em torno de ~ 500 mb/s. Atualmente com a mudança para o novo +Node.js Streams API, é mais rápido. Você pode ver claramente as diferenças entre as +versões do Node. + +_Observação: um benchmarking muito melhor pode e deve ser feito no futuro._ + +Benchmark realizado em 8 GB de RAM, Xeon X3440 (2,53 GHz, 4 núcleos, 8 threads) + +``` +~/github/node-formidable master +❯ nve --parallel 8 10 12 13 node benchmark/bench-multipart-parser.js + + ⬢ Node 8 + +1261.08 mb/sec + + ⬢ Node 10 + +1113.04 mb/sec + + ⬢ Node 12 + +2107.00 mb/sec + + ⬢ Node 13 + +2566.42 mb/sec +``` + +![benchmark 29 de janeiro de 2020](./benchmark/2020-01-29_xeon-x3440.png) + +## API + +### Formidable / IncomingForm + +Todos os mostrados são equivalentes. + +_Por favor, passe [`options`](#options) para a função/construtor, não atribuindo +eles para a instância `form`_ + +```js +import formidable from 'formidable'; +const form = formidable(options); +``` + +### Opções + +Veja seus padrões em [src/Formidable.js DEFAULT_OPTIONS](./src/Formidable.js) +(a constante `DEFAULT_OPTIONS`). + +- `options.encoding` **{string}** - padrão `'utf-8'`; define a codificação para campos de formulário de entrada, +- `options.uploadDir` **{string}** - padrão `os.tmpdir()`; o diretório para colocar os uploads de arquivos. Você pode movê-los mais tarde usando `fs.rename()`. +- `options.keepExtensions` **{boolean}** - padrão `false`; incluir as extensões dos arquivos originais ou não +- `options.allowEmptyFiles` **{boolean}** - padrão `false`; permitir upload de arquivos vazios +- `options.minFileSize` **{number}** - padrão `1` (1byte); o tamanho mínimo do arquivo carregado. +- `options.maxFiles` **{number}** - padrão `Infinity`; + limitar a quantidade de arquivos carregados, defina Infinity para ilimitado +- `options.maxFileSize` **{number}** - padrão `200 * 1024 * 1024` (200mb); + limitar o tamanho de cada arquivo carregado. +- `options.maxTotalFileSize` **{number}** - padrão `options.maxFileSize`; + limitar o tamanho do lote de arquivos carregados. +- `options.maxFields` **{number}** - padrão `1000`; limite o número de campos, defina Infinity para ilimitado +- `options.maxFieldsSize` **{number}** - padrão `20 * 1024 * 1024` (20mb); + limitar a quantidade de memória que todos os campos juntos (exceto arquivos) podem alocar em + bytes. +- `options.hashAlgorithm` **{string | false}** - padrão `false`; incluir checksums calculados + para arquivos recebidos, defina isso para algum algoritmo de hash, consulte + [crypto.createHash](https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm_options) + para algoritmos disponíveis +- `options.fileWriteStreamHandler` **{function}** - padrão `null`, que por padrão grava no sistema de arquivos da máquina host cada arquivo analisado; A função + deve retornar uma instância de um + [fluxo gravável](https://nodejs.org/api/stream.html#stream_class_stream_writable) + que receberá os dados do arquivo carregado. Com esta opção, você pode ter qualquer + comportamento personalizado em relação a onde os dados do arquivo carregado serão transmitidos. + Se você deseja gravar o arquivo carregado em outros tipos de armazenamento em nuvem + (AWS S3, armazenamento de blob do Azure, armazenamento em nuvem do Google) ou armazenamento de arquivo privado, + esta é a opção que você está procurando. Quando esta opção é definida, o comportamento padrão de gravar o arquivo no sistema de arquivos da máquina host é perdido. +- `options.filename` **{function}** - padrão `undefined` Use-o para controlar newFilename. Deve retornar uma string. Será associado a options.uploadDir. + +- `options.filter` **{function}** - função padrão que sempre retorna verdadeiro. + Use-o para filtrar arquivos antes de serem carregados. Deve retornar um booleano. + + +#### `options.filename` **{function}** function (name, ext, part, form) -> string + +onde a parte pode ser decomposta como + +```js +const { originalFilename, mimetype} = part; +``` + +_**Observação:** Se este tamanho de campos combinados, ou tamanho de algum arquivo for excedido, um +O evento `'error'` é disparado._ + +```js +// A quantidade de bytes recebidos para este formulário até agora. +form.bytesReceived; +``` + +```js +// O número esperado de bytes neste formulário. +form.bytesExpected; +``` + +#### `options.filter` **{function}** function ({name, originalFilename, mimetype}) -> boolean + +**Observação:** use uma variável externa para cancelar todos os uploads no primeiro erro + +```js +const options = { + filter: function ({name, originalFilename, mimetype}) { + // manter apenas imagens + return mimetype && mimetype.includes("image"); + } +}; +``` + + +### .parse(request, callback) + +Analisa uma `request` do Node.js recebida contendo dados de formulário. Se `callback` for +fornecido, todos os campos e arquivos são coletados e passados para o retorno de chamada. + +```js +const form = formidable({ uploadDir: __dirname }); + +form.parse(req, (err, fields, files) => { + console.log('fields:', fields); + console.log('files:', files); +}); +``` + +Você pode substituir esse método se estiver interessado em acessar diretamente o +fluxo de várias partes. Fazer isso desativará qualquer processamento de eventos `'field'` / `'file'` +que ocorreria de outra forma, tornando você totalmente responsável por lidar com o processamento. + +Sobre `uploadDir`, dada a seguinte estrutura de diretório +``` +project-name +├── src +│ └── server.js +│ +└── uploads + └── image.jpg +``` + +`__dirname` seria o mesmo diretório que o próprio arquivo de origem (src) + + +```js + `${__dirname}/../uploads` +``` + +para colocar arquivos em uploads. + +Omitir `__dirname` tornaria o caminho relativo ao diretório de trabalho atual. Isso seria o mesmo se server.js fosse iniciado a partir de src, mas não de project-name. + + +`null` usará o padrão que é `os.tmpdir()` + +Nota: Se o diretório não existir, os arquivos carregados são __silenciosamente descartados__. Para ter certeza de que existe: + +```js +import {createNecessaryDirectoriesSync} from "filesac"; + + +const uploadPath = `${__dirname}/../uploads`; +createNecessaryDirectoriesSync(`${uploadPath}/x`); +``` + + +No exemplo abaixo, escutamos alguns eventos e os direcionamos para o ouvinte `data`, para +que você possa fazer o que quiser lá, com base em se é antes do arquivo ser emitido, o valor do +cabeçalho, o nome do cabeçalho, no campo , em arquivo e etc. + +Ou a outra maneira poderia ser apenas substituir o `form.onPart` como é mostrado um pouco +mais tarde. + +```js +form.once('error', console.error); + +form.on('fileBegin', (formname, file) => { + form.emit('data', { name: 'fileBegin', formname, value: file }); +}); + +form.on('file', (formname, file) => { + form.emit('data', { name: 'file', formname, value: file }); +}); + +form.on('field', (fieldName, fieldValue) => { + form.emit('data', { name: 'field', key: fieldName, value: fieldValue }); +}); + +form.once('end', () => { + console.log('Done!'); +}); + +// Se você quiser personalizar o que quiser... +form.on('data', ({ name, key, value, buffer, start, end, formname, ...more }) => { + if (name === 'partBegin') { + } + if (name === 'partData') { + } + if (name === 'headerField') { + } + if (name === 'headerValue') { + } + if (name === 'headerEnd') { + } + if (name === 'headersEnd') { + } + if (name === 'field') { + console.log('field name:', key); + console.log('field value:', value); + } + if (name === 'file') { + console.log('file:', formname, value); + } + if (name === 'fileBegin') { + console.log('fileBegin:', formname, value); + } +}); +``` + +### .use(plugin: Plugin) + +Um método que permite estender a biblioteca Formidable. Por padrão, incluímos +4 plug-ins, que são essencialmente adaptadores para conectar os diferentes analisadores integrados. + +**Os plugins adicionados por este método estão sempre ativados.** + +_Consulte [src/plugins/](./src/plugins/) para uma visão mais detalhada dos plug-ins padrão._ + +O parâmetro `plugin` tem essa assinatura: + +```typescript +function(formidable: Formidable, options: Options): void; +``` + +A arquitetura é simples. O `plugin` é uma função que é passada com a instância Formidable (o `form` nos exemplos README) e as opções. + +**Observação:** o contexto `this` da função do plug-in também é a mesma instância. + +```js +const form = formidable({ keepExtensions: true }); + +form.use((self, options) => { + // self === this === form + console.log('woohoo, custom plugin'); + // faça suas coisas; verifique `src/plugins` para inspiração +}); + +form.parse(req, (error, fields, files) => { + console.log('done!'); +}); +``` +**Importante observar**, é que dentro do plugin `this.options`, `self.options` e +`options` PODEM ou NÃO ser iguais. A melhor prática geral é sempre usar o +`this`, para que você possa testar seu plugin mais tarde de forma independente e mais fácil. + +Se você quiser desabilitar alguns recursos de análise do Formidable, você pode desabilitar +o plugin que corresponde ao analisador. Por exemplo, se você deseja desabilitar a análise de +várias partes (para que o [src/parsers/Multipart.js](./src/parsers/Multipart.js) +que é usado em [src/plugins/multipart.js](./src/plugins/multipart.js)), então +você pode removê-lo do `options.enabledPlugins`, assim + +```js +import formidable, {octetstream, querystring, json} from "formidable"; +const form = formidable({ + hashAlgorithm: 'sha1', + enabledPlugins: [octetstream, querystring, json], +}); +``` + +**Esteja ciente** de que a ordem _PODE_ ser importante também. Os nomes correspondem 1:1 a +arquivos na pasta [src/plugins/](./src/plugins). + +Solicitações pull para novos plug-ins integrados PODEM ser aceitas - por exemplo, analisador de +querystring mais avançado. Adicione seu plugin como um novo arquivo na pasta `src/plugins/` (em letras minúsculas) e +siga como os outros plugins são feitos. + +### form.onPart + +Se você quiser usar Formidable para manipular apenas algumas partes para você, você pode fazer +alguma coisa similar. ou ver +[#387](https://github.com/node-formidable/node-formidable/issues/387) para +inspiração, você pode, por exemplo, validar o tipo mime. + +```js +const form = formidable(); + +form.onPart = (part) => { + part.on('data', (buffer) => { + // faça o que quiser aqui + }); +}; +``` + +Por exemplo, force Formidable a ser usado apenas em "partes" que não sejam de arquivo (ou seja, html +Campos) + +```js +const form = formidable(); + +form.onPart = function (part) { + // deixe formidável lidar apenas com partes não arquivadas + if (part.originalFilename === '' || !part.mimetype) { + // usado internamente, por favor, não substitua! + form._handlePart(part); + } +}; +``` + +### Arquivo + +```ts +export interface File { + // O tamanho do arquivo enviado em bytes. + // Se o arquivo ainda estiver sendo carregado (veja o evento `'fileBegin'`), + // esta propriedade diz quantos bytes do arquivo já foram gravados no disco. + file.size: number; + + // O caminho em que este arquivo está sendo gravado. Você pode modificar isso no evento `'fileBegin'` + // caso você esteja insatisfeito com a forma como o formidable gera um caminho temporário para seus arquivos. + file.filepath: string; + + // O nome que este arquivo tinha de acordo com o cliente de upload. + file.originalFilename: string | null; + + // calculado com base nas opções fornecidas. + file.newFilename: string | null; + + // O tipo mime deste arquivo, de acordo com o cliente de upload. + file.mimetype: string | null; + + // Um objeto Date (ou `null`) contendo a hora em que este arquivo foi gravado pela última vez. + // Principalmente aqui para compatibilidade com o [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/). + file.mtime: Date | null; + + file.hashAlgorithm: false | |'sha1' | 'md5' | 'sha256' + // Se o cálculo `options.hashAlgorithm` foi definido, você pode ler o resumo hexadecimal desta var (no final, será uma string) + file.hash: string | object | null; +} +``` + +#### file.toJSON() + +Este método retorna uma representação JSON do arquivo, permitindo que você `JSON.stringify()` +o arquivo que é útil para registrar e responder a solicitações. + +### Eventos + +#### `'progress'` +Emitido após cada bloco de entrada de dados que foi analisado. Pode ser usado para rolar sua própria barra de progresso. **Aviso** Use isso +apenas para a barra de progresso do lado do servidor. No lado do cliente, é melhor usar `XMLHttpRequest` com `xhr.upload.onprogress =` + +```js +form.on('progress', (bytesReceived, bytesExpected) => {}); +``` + +#### `'field'` + +Emitido sempre que um par campo/valor é recebido. + +```js +form.on('field', (name, value) => {}); +``` + +#### `'fileBegin'` + +Emitido sempre que um novo arquivo é detectado no fluxo de upload. +Use este evento se desejar transmitir o arquivo para outro lugar enquanto armazena o upload no sistema de arquivos. + +```js +form.on('fileBegin', (formName, file) => { + // acessível aqui + // formName o nome no formulário () ou http filename para octetstream + // file.originalFilename http filename ou null se houver um erro de análise + // file.newFilename gerou hexoid ou o que options.filename retornou + // file.filepath nome do caminho padrão de acordo com options.uploadDir e options.filename + // file.filepath = CUSTOM_PATH // para alterar o caminho final +}); +``` + +#### `'file'` + +Emitido sempre que um par campo/arquivo é recebido. `file` é uma instância de +`File`. + +```js +form.on('file', (formname, file) => { + // o mesmo que fileBegin, exceto + // é muito tarde para alterar file.filepath + // file.hash está disponível se options.hash foi usado +}); +``` + +#### `'error'` + +Emitido quando há um erro no processamento do formulário recebido. Uma solicitação que +apresenta um erro é pausada automaticamente, você terá que chamar manualmente +`request.resume()` se você quiser que a requisição continue disparando eventos `'data'`. + +Pode ter `error.httpCode` e `error.code` anexados. + +```js +form.on('error', (err) => {}); +``` + +#### `'aborted'` + +Emitido quando a requisição foi abortada pelo usuário. Agora isso pode ser devido a um +evento 'timeout' ou 'close' no soquete. Após este evento ser emitido, um +O evento `error` seguirá. No futuro, haverá um 'timeout' separado +evento (precisa de uma mudança no núcleo do nó). + +```js +form.on('aborted', () => {}); +``` + +#### `'end'` + +Emitido quando toda a solicitação foi recebida e todos os arquivos contidos foram +liberados para o disco. Este é um ótimo lugar para você enviar sua resposta. + +```js +form.on('end', () => {}); +``` + + +### Helpers + +#### firstValues + +Obtém os primeiros valores dos campos, como pré 3.0.0 sem passar múltiplos em uma +lista de exceções opcionais onde arrays de strings ainda são desejados (` [output]' + +exports.describe = 'instruments a file or a directory tree and writes the instrumented code to the desired output location' + +exports.builder = function (yargs) { + yargs + .demandCommand(0, 0) + .example('$0 instrument ./lib ./output', 'instrument all .js files in ./lib with coverage and output in ./output') + + setupOptions(yargs, 'instrument') +} + +exports.handler = cliWrapper(async argv => { + if (argv.output && !argv.inPlace && (path.resolve(argv.cwd, argv.input) === path.resolve(argv.cwd, argv.output))) { + throw new Error('cannot instrument files in place, must differ from . Set \'--in-place\' to force') + } + + if (path.relative(argv.cwd, path.resolve(argv.cwd, argv.input)).startsWith('..')) { + throw new Error('cannot instrument files outside project root directory') + } + + if (argv.delete && argv.inPlace) { + throw new Error('cannot use \'--delete\' when instrumenting files in place') + } + + if (argv.delete && argv.output && argv.output.length !== 0) { + const relPath = path.relative(process.cwd(), path.resolve(argv.output)) + if (relPath !== '' && !relPath.startsWith('..')) { + await rimraf(argv.output) + } else { + throw new Error(`attempt to delete '${process.cwd()}' or containing directory.`) + } + } + + // If instrument is set to false enable a noop instrumenter. + argv.instrumenter = (argv.instrument) + ? './lib/instrumenters/istanbul' + : './lib/instrumenters/noop' + + if (argv.inPlace) { + argv.output = argv.input + argv.completeCopy = false + } + + const nyc = new NYC(argv) + if (!argv.useSpawnWrap) { + nyc.require.forEach(requireModule => { + const mod = resolveFrom.silent(nyc.cwd, requireModule) || requireModule + require(mod) + }) + } + + await nyc.instrumentAllFiles(argv.input, argv.output) +}) diff --git a/node_modules/nyc/lib/commands/merge.js b/node_modules/nyc/lib/commands/merge.js new file mode 100644 index 0000000..758c6f5 --- /dev/null +++ b/node_modules/nyc/lib/commands/merge.js @@ -0,0 +1,46 @@ +'use strict' +const path = require('path') +const makeDir = require('make-dir') +const fs = require('../fs-promises') +const { cliWrapper, setupOptions } = require('./helpers.js') + +const NYC = require('../../index.js') + +exports.command = 'merge [output-file]' + +exports.describe = 'merge istanbul format coverage output in a given folder' + +exports.builder = function (yargs) { + yargs + .demandCommand(0, 0) + .example('$0 merge ./out coverage.json', 'merge together reports in ./out and output as coverage.json') + .positional('input-directory', { + describe: 'directory containing multiple istanbul coverage files', + type: 'text', + default: './.nyc_output' + }) + .positional('output-file', { + describe: 'file to output combined istanbul format coverage to', + type: 'text', + default: 'coverage.json' + }) + + setupOptions(yargs, 'merge') + yargs.default('exclude-after-remap', false) +} + +exports.handler = cliWrapper(async argv => { + process.env.NYC_CWD = process.cwd() + const nyc = new NYC(argv) + const inputStat = await fs.stat(argv.inputDirectory).catch(error => { + throw new Error(`failed access input directory ${argv.inputDirectory} with error:\n\n${error.message}`) + }) + + if (!inputStat.isDirectory()) { + throw new Error(`${argv.inputDirectory} was not a directory`) + } + await makeDir(path.dirname(argv.outputFile)) + const map = await nyc.getCoverageMapFromAllCoverageFiles(argv.inputDirectory) + await fs.writeFile(argv.outputFile, JSON.stringify(map), 'utf8') + console.info(`coverage files in ${argv.inputDirectory} merged into ${argv.outputFile}`) +}) diff --git a/node_modules/nyc/lib/commands/report.js b/node_modules/nyc/lib/commands/report.js new file mode 100644 index 0000000..6efb441 --- /dev/null +++ b/node_modules/nyc/lib/commands/report.js @@ -0,0 +1,30 @@ +'use strict' + +const NYC = require('../../index.js') +const { cliWrapper, suppressEPIPE, setupOptions } = require('./helpers.js') + +exports.command = 'report' + +exports.describe = 'run coverage report for .nyc_output' + +exports.builder = function (yargs) { + yargs + .demandCommand(0, 0) + .example('$0 report --reporter=lcov', 'output an HTML lcov report to ./coverage') + + setupOptions(yargs, 'report') +} + +exports.handler = cliWrapper(async argv => { + process.env.NYC_CWD = process.cwd() + var nyc = new NYC(argv) + await nyc.report().catch(suppressEPIPE) + if (argv.checkCoverage) { + await nyc.checkCoverage({ + lines: argv.lines, + functions: argv.functions, + branches: argv.branches, + statements: argv.statements + }, argv['per-file']).catch(suppressEPIPE) + } +}) diff --git a/node_modules/nyc/lib/config-util.js b/node_modules/nyc/lib/config-util.js new file mode 100644 index 0000000..883a12c --- /dev/null +++ b/node_modules/nyc/lib/config-util.js @@ -0,0 +1,65 @@ +'use strict' + +const path = require('path') +const findUp = require('find-up') +const Yargs = require('yargs/yargs') + +const { setupOptions } = require('./commands/helpers') +const processArgs = require('./process-args') +const { loadNycConfig } = require('@istanbuljs/load-nyc-config') + +async function guessCWD (cwd) { + cwd = cwd || process.env.NYC_CWD || process.cwd() + const pkgPath = await findUp('package.json', { cwd }) + if (pkgPath) { + cwd = path.dirname(pkgPath) + } + + return cwd +} + +async function processConfig (cwd) { + cwd = await guessCWD(cwd) + const yargs = Yargs([]) + .usage('$0 [command] [options]') + .usage('$0 [options] [bin-to-instrument]') + .showHidden(false) + + setupOptions(yargs, null, cwd) + + yargs + .example('$0 npm test', 'instrument your tests with coverage') + .example('$0 --require @babel/register npm test', 'instrument your tests with coverage and transpile with Babel') + .example('$0 report --reporter=text-lcov', 'output lcov report after running your tests') + .epilog('visit https://git.io/vHysA for list of available reporters') + .boolean('h') + .boolean('version') + .help(false) + .version(false) + + const instrumenterArgs = processArgs.hideInstrumenteeArgs() + + // This yargs.parse must come before any options that exit post-hoc + const childArgs = processArgs.hideInstrumenterArgs(yargs.parse(process.argv.slice(2))) + const config = await loadNycConfig(yargs.parse(instrumenterArgs)) + + yargs + .config(config) + .help('h') + .alias('h', 'help') + .version() + .command(require('./commands/check-coverage')) + .command(require('./commands/instrument')) + .command(require('./commands/report')) + .command(require('./commands/merge')) + + return { + get argv () { + return yargs.parse(instrumenterArgs) + }, + childArgs, + yargs + } +} + +module.exports = processConfig diff --git a/node_modules/nyc/lib/fs-promises.js b/node_modules/nyc/lib/fs-promises.js new file mode 100644 index 0000000..b67ebb1 --- /dev/null +++ b/node_modules/nyc/lib/fs-promises.js @@ -0,0 +1,51 @@ +'use strict' + +const fs = require('fs') + +const { promisify } = require('util') + +module.exports = { ...fs } + +// Promisify all functions for consistency +const fns = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchmod', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'read', + 'readdir', + 'readFile', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'write', + 'writeFile' +] +fns.forEach(fn => { + /* istanbul ignore else: all functions exist on OSX */ + if (fs[fn]) { + module.exports[fn] = promisify(fs[fn]) + } +}) diff --git a/node_modules/nyc/lib/hash.js b/node_modules/nyc/lib/hash.js new file mode 100644 index 0000000..ebf6c7d --- /dev/null +++ b/node_modules/nyc/lib/hash.js @@ -0,0 +1,30 @@ +'use strict' + +function getInvalidatingOptions (config) { + return [ + 'compact', + 'esModules', + 'ignoreClassMethods', + 'instrument', + 'instrumenter', + 'parserPlugins', + 'preserveComments', + 'produceSourceMap', + 'sourceMap' + ].reduce((acc, optName) => { + acc[optName] = config[optName] + return acc + }, {}) +} + +module.exports = { + salt (config) { + return JSON.stringify({ + modules: { + 'istanbul-lib-instrument': require('istanbul-lib-instrument/package.json').version, + nyc: require('../package.json').version + }, + nycrc: getInvalidatingOptions(config) + }) + } +} diff --git a/node_modules/nyc/lib/instrumenters/istanbul.js b/node_modules/nyc/lib/instrumenters/istanbul.js new file mode 100644 index 0000000..299f9bf --- /dev/null +++ b/node_modules/nyc/lib/instrumenters/istanbul.js @@ -0,0 +1,44 @@ +'use strict' + +function InstrumenterIstanbul (options) { + const { createInstrumenter } = require('istanbul-lib-instrument') + const convertSourceMap = require('convert-source-map') + + const instrumenter = createInstrumenter({ + autoWrap: true, + coverageVariable: '__coverage__', + embedSource: true, + compact: options.compact, + preserveComments: options.preserveComments, + produceSourceMap: options.produceSourceMap, + ignoreClassMethods: options.ignoreClassMethods, + esModules: options.esModules, + parserPlugins: options.parserPlugins + }) + + return { + instrumentSync (code, filename, { sourceMap, registerMap }) { + var instrumented = instrumenter.instrumentSync(code, filename, sourceMap) + if (instrumented !== code) { + registerMap() + } + + // the instrumenter can optionally produce source maps, + // this is useful for features like remapping stack-traces. + if (options.produceSourceMap) { + var lastSourceMap = instrumenter.lastSourceMap() + /* istanbul ignore else */ + if (lastSourceMap) { + instrumented += '\n' + convertSourceMap.fromObject(lastSourceMap).toComment() + } + } + + return instrumented + }, + lastFileCoverage () { + return instrumenter.lastFileCoverage() + } + } +} + +module.exports = InstrumenterIstanbul diff --git a/node_modules/nyc/lib/instrumenters/noop.js b/node_modules/nyc/lib/instrumenters/noop.js new file mode 100644 index 0000000..b0c9f70 --- /dev/null +++ b/node_modules/nyc/lib/instrumenters/noop.js @@ -0,0 +1,22 @@ +'use strict' + +function NOOP () { + const { readInitialCoverage } = require('istanbul-lib-instrument') + + return { + instrumentSync (code, filename) { + const extracted = readInitialCoverage(code) + if (extracted) { + this.fileCoverage = extracted.coverageData + } else { + this.fileCoverage = null + } + return code + }, + lastFileCoverage () { + return this.fileCoverage + } + } +} + +module.exports = NOOP diff --git a/node_modules/nyc/lib/process-args.js b/node_modules/nyc/lib/process-args.js new file mode 100644 index 0000000..60f5e5e --- /dev/null +++ b/node_modules/nyc/lib/process-args.js @@ -0,0 +1,39 @@ +'use strict' + +const { Parser } = require('yargs/yargs') +const commands = [ + 'report', + 'check-coverage', + 'instrument', + 'merge' +] + +module.exports = { + // don't pass arguments that are meant + // for nyc to the bin being instrumented. + hideInstrumenterArgs: function (yargv) { + var argv = process.argv.slice(1) + argv = argv.slice(argv.indexOf(yargv._[0])) + if (argv[0][0] === '-') { + argv.unshift(process.execPath) + } + return argv + }, + // don't pass arguments for the bin being + // instrumented to nyc. + hideInstrumenteeArgs: function () { + var argv = process.argv.slice(2) + var yargv = Parser(argv) + if (!yargv._.length) return argv + for (var i = 0, command; (command = yargv._[i]) !== undefined; i++) { + if (~commands.indexOf(command)) return argv + } + + // drop all the arguments after the bin being + // instrumented by nyc. + argv = argv.slice(0, argv.indexOf(yargv._[0])) + argv.push(yargv._[0]) + + return argv + } +} diff --git a/node_modules/nyc/lib/register-env.js b/node_modules/nyc/lib/register-env.js new file mode 100644 index 0000000..a91ec5c --- /dev/null +++ b/node_modules/nyc/lib/register-env.js @@ -0,0 +1,27 @@ +'use strict' + +const processOnSpawn = require('process-on-spawn') + +const envToCopy = {} + +processOnSpawn.addListener(({ env }) => { + Object.assign(env, envToCopy) +}) + +const copyAtLoad = [ + 'NYC_CONFIG', + 'NYC_CWD', + 'NYC_PROCESS_ID', + 'BABEL_DISABLE_CACHE', + 'NYC_PROCESS_ID' +] + +for (const env of copyAtLoad) { + if (env in process.env) { + envToCopy[env] = process.env[env] + } +} + +module.exports = function updateVariable (envName) { + envToCopy[envName] = process.env[envName] +} diff --git a/node_modules/nyc/lib/source-maps.js b/node_modules/nyc/lib/source-maps.js new file mode 100644 index 0000000..8a3914c --- /dev/null +++ b/node_modules/nyc/lib/source-maps.js @@ -0,0 +1,84 @@ +'use strict' + +const convertSourceMap = require('convert-source-map') +const libCoverage = require('istanbul-lib-coverage') +const libSourceMaps = require('istanbul-lib-source-maps') +const fs = require('./fs-promises') +const os = require('os') +const path = require('path') +const pMap = require('p-map') + +class SourceMaps { + constructor (opts) { + this.cache = opts.cache + this.cacheDirectory = opts.cacheDirectory + this.loadedMaps = {} + this._sourceMapCache = libSourceMaps.createSourceMapStore() + } + + cachedPath (source, hash) { + return path.join( + this.cacheDirectory, + `${path.parse(source).name}-${hash}.map` + ) + } + + purgeCache () { + this._sourceMapCache = libSourceMaps.createSourceMapStore() + this.loadedMaps = {} + } + + extract (code, filename) { + const sourceMap = convertSourceMap.fromSource(code) || convertSourceMap.fromMapFileSource(code, path.dirname(filename)) + return sourceMap ? sourceMap.toObject() : undefined + } + + registerMap (filename, hash, sourceMap) { + if (!sourceMap) { + return + } + + if (this.cache && hash) { + const mapPath = this.cachedPath(filename, hash) + fs.writeFileSync(mapPath, JSON.stringify(sourceMap)) + } else { + this._sourceMapCache.registerMap(filename, sourceMap) + } + } + + async remapCoverage (obj) { + const transformed = await this._sourceMapCache.transformCoverage( + libCoverage.createCoverageMap(obj) + ) + return transformed.data + } + + async reloadCachedSourceMaps (report) { + await pMap( + Object.entries(report), + async ([absFile, fileReport]) => { + if (!fileReport || !fileReport.contentHash) { + return + } + + const hash = fileReport.contentHash + if (!(hash in this.loadedMaps)) { + try { + const mapPath = this.cachedPath(absFile, hash) + this.loadedMaps[hash] = JSON.parse(await fs.readFile(mapPath, 'utf8')) + } catch (e) { + // set to false to avoid repeatedly trying to load the map + this.loadedMaps[hash] = false + } + } + + if (this.loadedMaps[hash]) { + this._sourceMapCache.registerMap(absFile, this.loadedMaps[hash]) + } + }, + { concurrency: os.cpus().length } + ) + } +} + +module.exports = SourceMaps diff --git a/node_modules/nyc/lib/wrap.js b/node_modules/nyc/lib/wrap.js new file mode 100644 index 0000000..cf30637 --- /dev/null +++ b/node_modules/nyc/lib/wrap.js @@ -0,0 +1,28 @@ +'use strict' + +const NYC = require('../index.js') + +const config = JSON.parse( + process.env.NYC_CONFIG || + /* istanbul ignore next */ '{}' +) + +config.isChildProcess = true + +config._processInfo = { + pid: process.pid, + ppid: process.ppid, + parent: process.env.NYC_PROCESS_ID || null +} + +if (process.env.NYC_PROCESSINFO_EXTERNAL_ID) { + config._processInfo.externalId = process.env.NYC_PROCESSINFO_EXTERNAL_ID + delete process.env.NYC_PROCESSINFO_EXTERNAL_ID +} + +if (process.env.NYC_CONFIG_OVERRIDE) { + Object.assign(config, JSON.parse(process.env.NYC_CONFIG_OVERRIDE)) + process.env.NYC_CONFIG = JSON.stringify(config) +} + +;(new NYC(config)).wrap() diff --git a/node_modules/nyc/node_modules/ansi-regex/index.d.ts b/node_modules/nyc/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000..2dbf6af --- /dev/null +++ b/node_modules/nyc/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/nyc/node_modules/ansi-regex/index.js b/node_modules/nyc/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..616ff83 --- /dev/null +++ b/node_modules/nyc/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/nyc/node_modules/ansi-regex/license b/node_modules/nyc/node_modules/ansi-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/ansi-regex/package.json b/node_modules/nyc/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..017f531 --- /dev/null +++ b/node_modules/nyc/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/nyc/node_modules/ansi-regex/readme.md b/node_modules/nyc/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..4d848bc --- /dev/null +++ b/node_modules/nyc/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/nyc/node_modules/brace-expansion/LICENSE b/node_modules/nyc/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000..de32266 --- /dev/null +++ b/node_modules/nyc/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/nyc/node_modules/brace-expansion/README.md b/node_modules/nyc/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..6b4e0e1 --- /dev/null +++ b/node_modules/nyc/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/nyc/node_modules/brace-expansion/index.js b/node_modules/nyc/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..bd19fe6 --- /dev/null +++ b/node_modules/nyc/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/nyc/node_modules/brace-expansion/package.json b/node_modules/nyc/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..3447888 --- /dev/null +++ b/node_modules/nyc/node_modules/brace-expansion/package.json @@ -0,0 +1,50 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.12", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "publishConfig": { + "tag": "1.x" + } +} diff --git a/node_modules/nyc/node_modules/cliui/CHANGELOG.md b/node_modules/nyc/node_modules/cliui/CHANGELOG.md new file mode 100644 index 0000000..6a77f8f --- /dev/null +++ b/node_modules/nyc/node_modules/cliui/CHANGELOG.md @@ -0,0 +1,76 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [6.0.0](https://www.github.com/yargs/cliui/compare/v5.0.0...v6.0.0) (2019-11-10) + + +### ⚠ BREAKING CHANGES + +* update deps, drop Node 6 + +### Code Refactoring + +* update deps, drop Node 6 ([62056df](https://www.github.com/yargs/cliui/commit/62056df)) + +## [5.0.0](https://github.com/yargs/cliui/compare/v4.1.0...v5.0.0) (2019-04-10) + + +### Bug Fixes + +* Update wrap-ansi to fix compatibility with latest versions of chalk. ([#60](https://github.com/yargs/cliui/issues/60)) ([7bf79ae](https://github.com/yargs/cliui/commit/7bf79ae)) + + +### BREAKING CHANGES + +* Drop support for node < 6. + + + + +## [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23) + + +### Features + +* add resetOutput method ([#57](https://github.com/yargs/cliui/issues/57)) ([7246902](https://github.com/yargs/cliui/commit/7246902)) + + + + +## [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18) + + +### Bug Fixes + +* downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46)) +* set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36)) + + +### Chores + +* drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376)) + + +### Features + +* add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922)) + + +### BREAKING CHANGES + +* officially drop support for Node < 4 + + + + +## [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11) + + +### Bug Fixes + +* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33)) + +### Features + +* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32)) diff --git a/node_modules/nyc/node_modules/cliui/LICENSE.txt b/node_modules/nyc/node_modules/cliui/LICENSE.txt new file mode 100644 index 0000000..c7e2747 --- /dev/null +++ b/node_modules/nyc/node_modules/cliui/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/nyc/node_modules/cliui/README.md b/node_modules/nyc/node_modules/cliui/README.md new file mode 100644 index 0000000..deacfa0 --- /dev/null +++ b/node_modules/nyc/node_modules/cliui/README.md @@ -0,0 +1,115 @@ +# cliui + +[![Build Status](https://travis-ci.org/yargs/cliui.svg)](https://travis-ci.org/yargs/cliui) +[![Coverage Status](https://coveralls.io/repos/yargs/cliui/badge.svg?branch=)](https://coveralls.io/r/yargs/cliui?branch=) +[![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +easily create complex multi-column command-line-interfaces. + +## Example + +```js +var ui = require('cliui')() + +ui.div('Usage: $0 [command] [options]') + +ui.div({ + text: 'Options:', + padding: [2, 0, 2, 0] +}) + +ui.div( + { + text: "-f, --file", + width: 20, + padding: [0, 4, 0, 4] + }, + { + text: "the file to load." + + chalk.green("(if this description is long it wraps).") + , + width: 20 + }, + { + text: chalk.red("[required]"), + align: 'right' + } +) + +console.log(ui.toString()) +``` + + + +## Layout DSL + +cliui exposes a simple layout DSL: + +If you create a single `ui.div`, passing a string rather than an +object: + +* `\n`: characters will be interpreted as new rows. +* `\t`: characters will be interpreted as new columns. +* `\s`: characters will be interpreted as padding. + +**as an example...** + +```js +var ui = require('./')({ + width: 60 +}) + +ui.div( + 'Usage: node ./bin/foo.js\n' + + ' \t provide a regex\n' + + ' \t provide a glob\t [required]' +) + +console.log(ui.toString()) +``` + +**will output:** + +```shell +Usage: node ./bin/foo.js + provide a regex + provide a glob [required] +``` + +## Methods + +```js +cliui = require('cliui') +``` + +### cliui({width: integer}) + +Specify the maximum width of the UI being generated. +If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`. + +### cliui({wrap: boolean}) + +Enable or disable the wrapping of text in a column. + +### cliui.div(column, column, column) + +Create a row with any number of columns, a column +can either be a string, or an object with the following +options: + +* **text:** some text to place in the column. +* **width:** the width of a column. +* **align:** alignment, `right` or `center`. +* **padding:** `[top, right, bottom, left]`. +* **border:** should a border be placed around the div? + +### cliui.span(column, column, column) + +Similar to `div`, except the next row will be appended without +a new line being created. + +### cliui.resetOutput() + +Resets the UI elements of the current cliui instance, maintaining the values +set for `width` and `wrap`. diff --git a/node_modules/nyc/node_modules/cliui/index.js b/node_modules/nyc/node_modules/cliui/index.js new file mode 100644 index 0000000..e917b00 --- /dev/null +++ b/node_modules/nyc/node_modules/cliui/index.js @@ -0,0 +1,354 @@ +'use strict' + +const stringWidth = require('string-width') +const stripAnsi = require('strip-ansi') +const wrap = require('wrap-ansi') + +const align = { + right: alignRight, + center: alignCenter +} +const top = 0 +const right = 1 +const bottom = 2 +const left = 3 + +class UI { + constructor (opts) { + this.width = opts.width + this.wrap = opts.wrap + this.rows = [] + } + + span (...args) { + const cols = this.div(...args) + cols.span = true + } + + resetOutput () { + this.rows = [] + } + + div (...args) { + if (args.length === 0) { + this.div('') + } + + if (this.wrap && this._shouldApplyLayoutDSL(...args)) { + return this._applyLayoutDSL(args[0]) + } + + const cols = args.map(arg => { + if (typeof arg === 'string') { + return this._colFromString(arg) + } + + return arg + }) + + this.rows.push(cols) + return cols + } + + _shouldApplyLayoutDSL (...args) { + return args.length === 1 && typeof args[0] === 'string' && + /[\t\n]/.test(args[0]) + } + + _applyLayoutDSL (str) { + const rows = str.split('\n').map(row => row.split('\t')) + let leftColumnWidth = 0 + + // simple heuristic for layout, make sure the + // second column lines up along the left-hand. + // don't allow the first column to take up more + // than 50% of the screen. + rows.forEach(columns => { + if (columns.length > 1 && stringWidth(columns[0]) > leftColumnWidth) { + leftColumnWidth = Math.min( + Math.floor(this.width * 0.5), + stringWidth(columns[0]) + ) + } + }) + + // generate a table: + // replacing ' ' with padding calculations. + // using the algorithmically generated width. + rows.forEach(columns => { + this.div(...columns.map((r, i) => { + return { + text: r.trim(), + padding: this._measurePadding(r), + width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined + } + })) + }) + + return this.rows[this.rows.length - 1] + } + + _colFromString (text) { + return { + text, + padding: this._measurePadding(text) + } + } + + _measurePadding (str) { + // measure padding without ansi escape codes + const noAnsi = stripAnsi(str) + return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length] + } + + toString () { + const lines = [] + + this.rows.forEach(row => { + this.rowToString(row, lines) + }) + + // don't display any lines with the + // hidden flag set. + return lines + .filter(line => !line.hidden) + .map(line => line.text) + .join('\n') + } + + rowToString (row, lines) { + this._rasterize(row).forEach((rrow, r) => { + let str = '' + rrow.forEach((col, c) => { + const { width } = row[c] // the width with padding. + const wrapWidth = this._negatePadding(row[c]) // the width without padding. + + let ts = col // temporary string used during alignment/padding. + + if (wrapWidth > stringWidth(col)) { + ts += ' '.repeat(wrapWidth - stringWidth(col)) + } + + // align the string within its column. + if (row[c].align && row[c].align !== 'left' && this.wrap) { + ts = align[row[c].align](ts, wrapWidth) + if (stringWidth(ts) < wrapWidth) { + ts += ' '.repeat(width - stringWidth(ts) - 1) + } + } + + // apply border and padding to string. + const padding = row[c].padding || [0, 0, 0, 0] + if (padding[left]) { + str += ' '.repeat(padding[left]) + } + + str += addBorder(row[c], ts, '| ') + str += ts + str += addBorder(row[c], ts, ' |') + if (padding[right]) { + str += ' '.repeat(padding[right]) + } + + // if prior row is span, try to render the + // current row on the prior line. + if (r === 0 && lines.length > 0) { + str = this._renderInline(str, lines[lines.length - 1]) + } + }) + + // remove trailing whitespace. + lines.push({ + text: str.replace(/ +$/, ''), + span: row.span + }) + }) + + return lines + } + + // if the full 'source' can render in + // the target line, do so. + _renderInline (source, previousLine) { + const leadingWhitespace = source.match(/^ */)[0].length + const target = previousLine.text + const targetTextWidth = stringWidth(target.trimRight()) + + if (!previousLine.span) { + return source + } + + // if we're not applying wrapping logic, + // just always append to the span. + if (!this.wrap) { + previousLine.hidden = true + return target + source + } + + if (leadingWhitespace < targetTextWidth) { + return source + } + + previousLine.hidden = true + + return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft() + } + + _rasterize (row) { + const rrows = [] + const widths = this._columnWidths(row) + let wrapped + + // word wrap all columns, and create + // a data-structure that is easy to rasterize. + row.forEach((col, c) => { + // leave room for left and right padding. + col.width = widths[c] + if (this.wrap) { + wrapped = wrap(col.text, this._negatePadding(col), { hard: true }).split('\n') + } else { + wrapped = col.text.split('\n') + } + + if (col.border) { + wrapped.unshift('.' + '-'.repeat(this._negatePadding(col) + 2) + '.') + wrapped.push("'" + '-'.repeat(this._negatePadding(col) + 2) + "'") + } + + // add top and bottom padding. + if (col.padding) { + wrapped.unshift(...new Array(col.padding[top] || 0).fill('')) + wrapped.push(...new Array(col.padding[bottom] || 0).fill('')) + } + + wrapped.forEach((str, r) => { + if (!rrows[r]) { + rrows.push([]) + } + + const rrow = rrows[r] + + for (let i = 0; i < c; i++) { + if (rrow[i] === undefined) { + rrow.push('') + } + } + + rrow.push(str) + }) + }) + + return rrows + } + + _negatePadding (col) { + let wrapWidth = col.width + if (col.padding) { + wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0) + } + + if (col.border) { + wrapWidth -= 4 + } + + return wrapWidth + } + + _columnWidths (row) { + if (!this.wrap) { + return row.map(col => { + return col.width || stringWidth(col.text) + }) + } + + let unset = row.length + let remainingWidth = this.width + + // column widths can be set in config. + const widths = row.map(col => { + if (col.width) { + unset-- + remainingWidth -= col.width + return col.width + } + + return undefined + }) + + // any unset widths should be calculated. + const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0 + + return widths.map((w, i) => { + if (w === undefined) { + return Math.max(unsetWidth, _minWidth(row[i])) + } + + return w + }) + } +} + +function addBorder (col, ts, style) { + if (col.border) { + if (/[.']-+[.']/.test(ts)) { + return '' + } + + if (ts.trim().length !== 0) { + return style + } + + return ' ' + } + + return '' +} + +// calculates the minimum width of +// a column, based on padding preferences. +function _minWidth (col) { + const padding = col.padding || [] + const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0) + if (col.border) { + return minWidth + 4 + } + + return minWidth +} + +function getWindowWidth () { + /* istanbul ignore next: depends on terminal */ + if (typeof process === 'object' && process.stdout && process.stdout.columns) { + return process.stdout.columns + } +} + +function alignRight (str, width) { + str = str.trim() + const strWidth = stringWidth(str) + + if (strWidth < width) { + return ' '.repeat(width - strWidth) + str + } + + return str +} + +function alignCenter (str, width) { + str = str.trim() + const strWidth = stringWidth(str) + + /* istanbul ignore next */ + if (strWidth >= width) { + return str + } + + return ' '.repeat((width - strWidth) >> 1) + str +} + +module.exports = function (opts = {}) { + return new UI({ + width: opts.width || getWindowWidth() || /* istanbul ignore next */ 80, + wrap: opts.wrap !== false + }) +} diff --git a/node_modules/nyc/node_modules/cliui/package.json b/node_modules/nyc/node_modules/cliui/package.json new file mode 100644 index 0000000..f92fd10 --- /dev/null +++ b/node_modules/nyc/node_modules/cliui/package.json @@ -0,0 +1,65 @@ +{ + "name": "cliui", + "version": "6.0.0", + "description": "easily create complex multi-column command-line-interfaces", + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "nyc mocha", + "coverage": "nyc --reporter=text-lcov mocha | coveralls" + }, + "repository": { + "type": "git", + "url": "http://github.com/yargs/cliui.git" + }, + "config": { + "blanket": { + "pattern": [ + "index.js" + ], + "data-cover-never": [ + "node_modules", + "test" + ], + "output-reporter": "spec" + } + }, + "standard": { + "ignore": [ + "**/example/**" + ], + "globals": [ + "it" + ] + }, + "keywords": [ + "cli", + "command-line", + "layout", + "design", + "console", + "wrap", + "table" + ], + "author": "Ben Coe ", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "chalk": "^3.0.0", + "coveralls": "^3.0.3", + "mocha": "^6.2.2", + "nyc": "^14.1.1", + "standard": "^12.0.1" + }, + "files": [ + "index.js" + ], + "engine": { + "node": ">=8" + } +} diff --git a/node_modules/nyc/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/nyc/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/emoji-regex/README.md b/node_modules/nyc/node_modules/emoji-regex/README.md new file mode 100644 index 0000000..f10e173 --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/nyc/node_modules/emoji-regex/es2015/index.js b/node_modules/nyc/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 0000000..b4cf3dc --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}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6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/nyc/node_modules/emoji-regex/es2015/text.js b/node_modules/nyc/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 0000000..780309d --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{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\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/nyc/node_modules/emoji-regex/index.d.ts b/node_modules/nyc/node_modules/emoji-regex/index.d.ts new file mode 100644 index 0000000..1955b47 --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,23 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/node_modules/nyc/node_modules/emoji-regex/index.js b/node_modules/nyc/node_modules/emoji-regex/index.js new file mode 100644 index 0000000..d993a3a --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|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648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/nyc/node_modules/emoji-regex/package.json b/node_modules/nyc/node_modules/emoji-regex/package.json new file mode 100644 index 0000000..6d32352 --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/package.json @@ -0,0 +1,50 @@ +{ + "name": "emoji-regex", + "version": "8.0.0", + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/emoji-regex.git" + }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + } +} diff --git a/node_modules/nyc/node_modules/emoji-regex/text.js b/node_modules/nyc/node_modules/emoji-regex/text.js new file mode 100644 index 0000000..0a55ce2 --- /dev/null +++ b/node_modules/nyc/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?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\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/nyc/node_modules/find-up/index.d.ts b/node_modules/nyc/node_modules/find-up/index.d.ts new file mode 100644 index 0000000..41e3192 --- /dev/null +++ b/node_modules/nyc/node_modules/find-up/index.d.ts @@ -0,0 +1,137 @@ +import {Options as LocatePathOptions} from 'locate-path'; + +declare const stop: unique symbol; + +declare namespace findUp { + interface Options extends LocatePathOptions {} + + type StopSymbol = typeof stop; + + type Match = string | StopSymbol | undefined; +} + +declare const findUp: { + /** + Find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + + @example + ``` + // / + // └── Users + // └── sindresorhus + // ├── unicorn.png + // └── foo + // └── bar + // ├── baz + // └── example.js + + // example.js + import findUp = require('find-up'); + + (async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + })(); + ``` + */ + (name: string | string[], options?: findUp.Options): Promise; + + /** + Find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + (async () => { + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + })(); + ``` + */ + (matcher: (directory: string) => (findUp.Match | Promise), options?: findUp.Options): Promise; + + sync: { + /** + Synchronously find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + */ + (name: string | string[], options?: findUp.Options): string | undefined; + + /** + Synchronously find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + console.log(findUp.sync(directory => { + const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + ``` + */ + (matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined; + + /** + Synchronously check if a path exists. + + @param path - Path to the file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png')); + //=> true + ``` + */ + exists(path: string): boolean; + } + + /** + Check if a path exists. + + @param path - Path to a file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + (async () => { + console.log(await findUp.exists('/Users/sindresorhus/unicorn.png')); + //=> true + })(); + ``` + */ + exists(path: string): Promise; + + /** + Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`. + */ + readonly stop: findUp.StopSymbol; +}; + +export = findUp; diff --git a/node_modules/nyc/node_modules/find-up/index.js b/node_modules/nyc/node_modules/find-up/index.js new file mode 100644 index 0000000..ce564e5 --- /dev/null +++ b/node_modules/nyc/node_modules/find-up/index.js @@ -0,0 +1,89 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); +const pathExists = require('path-exists'); + +const stop = Symbol('findUp.stop'); + +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } + + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } + + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.exists = pathExists; + +module.exports.sync.exists = pathExists.sync; + +module.exports.stop = stop; diff --git a/node_modules/nyc/node_modules/find-up/license b/node_modules/nyc/node_modules/find-up/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/find-up/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/find-up/package.json b/node_modules/nyc/node_modules/find-up/package.json new file mode 100644 index 0000000..cd50281 --- /dev/null +++ b/node_modules/nyc/node_modules/find-up/package.json @@ -0,0 +1,53 @@ +{ + "name": "find-up", + "version": "4.1.0", + "description": "Find a file or directory by walking up parent directories", + "license": "MIT", + "repository": "sindresorhus/find-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "walk", + "walking", + "path" + ], + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "is-path-inside": "^2.1.0", + "tempy": "^0.3.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + } +} diff --git a/node_modules/nyc/node_modules/find-up/readme.md b/node_modules/nyc/node_modules/find-up/readme.md new file mode 100644 index 0000000..d6a21e5 --- /dev/null +++ b/node_modules/nyc/node_modules/find-up/readme.md @@ -0,0 +1,156 @@ +# find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) + +> Find a file or directory by walking up parent directories + + +## Install + +``` +$ npm install find-up +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +`example.js` + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' +})(); +``` + + +## API + +### findUp(name, options?) +### findUp(matcher, options?) + +Returns a `Promise` for either the path or `undefined` if it couldn't be found. + +### findUp([...name], options?) + +Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found. + +### findUp.sync(name, options?) +### findUp.sync(matcher, options?) + +Returns a path or `undefined` if it couldn't be found. + +### findUp.sync([...name], options?) + +Returns the first path found (by respecting the order of the array) or `undefined` if none could be found. + +#### name + +Type: `string` + +Name of the file or directory to find. + +#### matcher + +Type: `Function` + +A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases. + +When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path. + +#### options + +Type: `object` + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + +##### type + +Type: `string`
+Default: `'file'`
+Values: `'file'` `'directory'` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`
+Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### findUp.exists(path) + +Returns a `Promise` of whether the path exists. + +### findUp.sync.exists(path) + +Returns a `boolean` of whether the path exists. + +#### path + +Type: `string` + +Path to a file or directory. + +### findUp.stop + +A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem. + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + await findUp(directory => { + return path.basename(directory) === 'work' ? findUp.stop : 'logo.png'; + }); +})(); +``` + + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path + + +--- + +
+ + Get professional support for 'find-up' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/nyc/node_modules/glob/LICENSE b/node_modules/nyc/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/node_modules/nyc/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/nyc/node_modules/glob/README.md b/node_modules/nyc/node_modules/glob/README.md new file mode 100644 index 0000000..83f0c83 --- /dev/null +++ b/node_modules/nyc/node_modules/glob/README.md @@ -0,0 +1,378 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![a fun cartoon logo made of glob characters](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. +* `fs` File-system object with Node's `fs` API. By default, the built-in + `fs` module will be used. Set to a volume provided by a library like + `memfs` to avoid using the "real" file-system. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/nyc/node_modules/glob/common.js b/node_modules/nyc/node_modules/glob/common.js new file mode 100644 index 0000000..424c46e --- /dev/null +++ b/node_modules/nyc/node_modules/glob/common.js @@ -0,0 +1,238 @@ +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var fs = require("fs") +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasort (a, b) { + return a.localeCompare(b, 'en') +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + // always treat \ in patterns as escapes, not path separators + options.allowWindowsEscape = false + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/nyc/node_modules/glob/glob.js b/node_modules/nyc/node_modules/glob/glob.js new file mode 100644 index 0000000..37a4d7e --- /dev/null +++ b/node_modules/nyc/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + self.fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/nyc/node_modules/glob/package.json b/node_modules/nyc/node_modules/glob/package.json new file mode 100644 index 0000000..5940b64 --- /dev/null +++ b/node_modules/nyc/node_modules/glob/package.json @@ -0,0 +1,55 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.2.3", + "publishConfig": { + "tag": "v7-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "memfs": "^3.2.0", + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^15.0.6", + "tick": "0.0.6" + }, + "tap": { + "before": "test/00-setup.js", + "after": "test/zz-cleanup.js", + "jobs": 1 + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/nyc/node_modules/glob/sync.js b/node_modules/nyc/node_modules/glob/sync.js new file mode 100644 index 0000000..2c4f480 --- /dev/null +++ b/node_modules/nyc/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert.ok(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert.ok(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/nyc/node_modules/locate-path/index.d.ts b/node_modules/nyc/node_modules/locate-path/index.d.ts new file mode 100644 index 0000000..fbde526 --- /dev/null +++ b/node_modules/nyc/node_modules/locate-path/index.d.ts @@ -0,0 +1,83 @@ +declare namespace locatePath { + interface Options { + /** + Current working directory. + + @default process.cwd() + */ + readonly cwd?: string; + + /** + Type of path to match. + + @default 'file' + */ + readonly type?: 'file' | 'directory'; + + /** + Allow symbolic links to match if they point to the requested path type. + + @default true + */ + readonly allowSymlinks?: boolean; + } + + interface AsyncOptions extends Options { + /** + Number of concurrently pending promises. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `paths` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +declare const locatePath: { + /** + Get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + + @example + ``` + import locatePath = require('locate-path'); + + const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' + ]; + + (async () => { + console(await locatePath(files)); + //=> 'rainbow' + })(); + ``` + */ + (paths: Iterable, options?: locatePath.AsyncOptions): Promise< + string | undefined + >; + + /** + Synchronously get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + */ + sync( + paths: Iterable, + options?: locatePath.Options + ): string | undefined; +}; + +export = locatePath; diff --git a/node_modules/nyc/node_modules/locate-path/index.js b/node_modules/nyc/node_modules/locate-path/index.js new file mode 100644 index 0000000..4604bbf --- /dev/null +++ b/node_modules/nyc/node_modules/locate-path/index.js @@ -0,0 +1,65 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const {promisify} = require('util'); +const pLocate = require('p-locate'); + +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); + +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; + +function checkType({type}) { + if (type in typeMappings) { + return; + } + + throw new Error(`Invalid type specified: ${type}`); +} + +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); + +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; + + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch (_) { + return false; + } + }, options); +}; + +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; + + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); + + if (matchType(options.type, stat)) { + return path_; + } + } catch (_) { + } + } +}; diff --git a/node_modules/nyc/node_modules/locate-path/license b/node_modules/nyc/node_modules/locate-path/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/locate-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/locate-path/package.json b/node_modules/nyc/node_modules/locate-path/package.json new file mode 100644 index 0000000..063b290 --- /dev/null +++ b/node_modules/nyc/node_modules/locate-path/package.json @@ -0,0 +1,45 @@ +{ + "name": "locate-path", + "version": "5.0.0", + "description": "Get the first path that exists on disk of multiple paths", + "license": "MIT", + "repository": "sindresorhus/locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "dependencies": { + "p-locate": "^4.1.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/nyc/node_modules/locate-path/readme.md b/node_modules/nyc/node_modules/locate-path/readme.md new file mode 100644 index 0000000..2184c6f --- /dev/null +++ b/node_modules/nyc/node_modules/locate-path/readme.md @@ -0,0 +1,122 @@ +# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + + +## Install + +``` +$ npm install locate-path +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + console(await locatePath(files)); + //=> 'rainbow' +})(); +``` + + +## API + +### locatePath(paths, [options]) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `paths` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory. + +##### type + +Type: `string`
+Default: `file`
+Values: `file` `directory` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`
+Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### locatePath.sync(paths, [options]) + +Returns the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### cwd + +Same as above. + +##### type + +Same as above. + +##### allowSymlinks + +Same as above. + + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/nyc/node_modules/minimatch/LICENSE b/node_modules/nyc/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/nyc/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/nyc/node_modules/minimatch/README.md b/node_modules/nyc/node_modules/minimatch/README.md new file mode 100644 index 0000000..33ede1d --- /dev/null +++ b/node_modules/nyc/node_modules/minimatch/README.md @@ -0,0 +1,230 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### allowWindowsEscape + +Windows path separator `\` is by default converted to `/`, which +prohibits the usage of `\` as a escape character. This flag skips that +behavior and allows using the escape character. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/nyc/node_modules/minimatch/minimatch.js b/node_modules/nyc/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..fda45ad --- /dev/null +++ b/node_modules/nyc/node_modules/minimatch/minimatch.js @@ -0,0 +1,947 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = (function () { try { return require('path') } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + assertValidPattern(pattern) + + if (!options) options = {} + + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/nyc/node_modules/minimatch/package.json b/node_modules/nyc/node_modules/minimatch/package.json new file mode 100644 index 0000000..566efdf --- /dev/null +++ b/node_modules/nyc/node_modules/minimatch/package.json @@ -0,0 +1,33 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "devDependencies": { + "tap": "^15.1.6" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ] +} diff --git a/node_modules/nyc/node_modules/p-limit/index.d.ts b/node_modules/nyc/node_modules/p-limit/index.d.ts new file mode 100644 index 0000000..6bbfad4 --- /dev/null +++ b/node_modules/nyc/node_modules/p-limit/index.d.ts @@ -0,0 +1,38 @@ +export interface Limit { + /** + @param fn - Promise-returning/async function. + @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. + @returns The promise returned by calling `fn(...arguments)`. + */ + ( + fn: (...arguments: Arguments) => PromiseLike | ReturnType, + ...arguments: Arguments + ): Promise; + + /** + The number of promises that are currently running. + */ + readonly activeCount: number; + + /** + The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + */ + readonly pendingCount: number; + + /** + Discard pending promises that are waiting to run. + + This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + + Note: This does not cancel promises that are already running. + */ + clearQueue(): void; +} + +/** +Run multiple promise-returning & async functions with limited concurrency. + +@param concurrency - Concurrency limit. Minimum: `1`. +@returns A `limit` function. +*/ +export default function pLimit(concurrency: number): Limit; diff --git a/node_modules/nyc/node_modules/p-limit/index.js b/node_modules/nyc/node_modules/p-limit/index.js new file mode 100644 index 0000000..6a72a4c --- /dev/null +++ b/node_modules/nyc/node_modules/p-limit/index.js @@ -0,0 +1,57 @@ +'use strict'; +const pTry = require('p-try'); + +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + const run = (fn, resolve, ...args) => { + activeCount++; + + const result = pTry(fn, ...args); + + resolve(result); + + result.then(next, next); + }; + + const enqueue = (fn, resolve, ...args) => { + if (activeCount < concurrency) { + run(fn, resolve, ...args); + } else { + queue.push(run.bind(null, fn, resolve, ...args)); + } + }; + + const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.length + }, + clearQueue: { + value: () => { + queue.length = 0; + } + } + }); + + return generator; +}; + +module.exports = pLimit; +module.exports.default = pLimit; diff --git a/node_modules/nyc/node_modules/p-limit/license b/node_modules/nyc/node_modules/p-limit/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/p-limit/package.json b/node_modules/nyc/node_modules/p-limit/package.json new file mode 100644 index 0000000..99a814f --- /dev/null +++ b/node_modules/nyc/node_modules/p-limit/package.json @@ -0,0 +1,52 @@ +{ + "name": "p-limit", + "version": "2.3.0", + "description": "Run multiple promise-returning & async functions with limited concurrency", + "license": "MIT", + "repository": "sindresorhus/p-limit", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-try": "^2.0.0" + }, + "devDependencies": { + "ava": "^1.2.1", + "delay": "^4.1.0", + "in-range": "^1.0.0", + "random-int": "^1.0.0", + "time-span": "^2.0.0", + "tsd-check": "^0.3.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/nyc/node_modules/p-limit/readme.md b/node_modules/nyc/node_modules/p-limit/readme.md new file mode 100644 index 0000000..64aa476 --- /dev/null +++ b/node_modules/nyc/node_modules/p-limit/readme.md @@ -0,0 +1,101 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + +## Install + +``` +$ npm install p-limit +``` + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`\ +Minimum: `1`\ +Default: `Infinity` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + +### limit.clearQueue() + +Discard pending promises that are waiting to run. + +This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + +Note: This does not cancel promises that are already running. + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/nyc/node_modules/p-locate/index.d.ts b/node_modules/nyc/node_modules/p-locate/index.d.ts new file mode 100644 index 0000000..14115e1 --- /dev/null +++ b/node_modules/nyc/node_modules/p-locate/index.d.ts @@ -0,0 +1,64 @@ +declare namespace pLocate { + interface Options { + /** + Number of concurrently pending promises returned by `tester`. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `input` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +declare const pLocate: { + /** + Get the first fulfilled promise that satisfies the provided testing function. + + @param input - An iterable of promises/values to test. + @param tester - This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + @returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + + @example + ``` + import pathExists = require('path-exists'); + import pLocate = require('p-locate'); + + const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' + ]; + + (async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' + })(); + ``` + */ + ( + input: Iterable | ValueType>, + tester: (element: ValueType) => PromiseLike | boolean, + options?: pLocate.Options + ): Promise; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function pLocate( + // input: Iterable | ValueType>, + // tester: (element: ValueType) => PromiseLike | boolean, + // options?: pLocate.Options + // ): Promise; + // export = pLocate; + default: typeof pLocate; +}; + +export = pLocate; diff --git a/node_modules/nyc/node_modules/p-locate/index.js b/node_modules/nyc/node_modules/p-locate/index.js new file mode 100644 index 0000000..e13ce15 --- /dev/null +++ b/node_modules/nyc/node_modules/p-locate/index.js @@ -0,0 +1,52 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); + +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + + return false; +}; + +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + + const limit = pLimit(options.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; + } + + throw error; + } +}; + +module.exports = pLocate; +// TODO: Remove this for the next major release +module.exports.default = pLocate; diff --git a/node_modules/nyc/node_modules/p-locate/license b/node_modules/nyc/node_modules/p-locate/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/p-locate/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/p-locate/package.json b/node_modules/nyc/node_modules/p-locate/package.json new file mode 100644 index 0000000..e3de275 --- /dev/null +++ b/node_modules/nyc/node_modules/p-locate/package.json @@ -0,0 +1,53 @@ +{ + "name": "p-locate", + "version": "4.1.0", + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "license": "MIT", + "repository": "sindresorhus/p-locate", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-limit": "^2.2.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "delay": "^4.1.0", + "in-range": "^1.0.0", + "time-span": "^3.0.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/nyc/node_modules/p-locate/readme.md b/node_modules/nyc/node_modules/p-locate/readme.md new file mode 100644 index 0000000..f8e2c2e --- /dev/null +++ b/node_modules/nyc/node_modules/p-locate/readme.md @@ -0,0 +1,90 @@ +# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + + +## Install + +``` +$ npm install p-locate +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + + +## API + +### pLocate(input, tester, [options]) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +An iterable of promises/values to test. + +#### tester(element) + +Type: `Function` + +This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/nyc/node_modules/signal-exit/LICENSE.txt b/node_modules/nyc/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 0000000..eead04a --- /dev/null +++ b/node_modules/nyc/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/nyc/node_modules/signal-exit/README.md b/node_modules/nyc/node_modules/signal-exit/README.md new file mode 100644 index 0000000..f9c7c00 --- /dev/null +++ b/node_modules/nyc/node_modules/signal-exit/README.md @@ -0,0 +1,39 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the process to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/node_modules/nyc/node_modules/signal-exit/index.js b/node_modules/nyc/node_modules/signal-exit/index.js new file mode 100644 index 0000000..93703f3 --- /dev/null +++ b/node_modules/nyc/node_modules/signal-exit/index.js @@ -0,0 +1,202 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +var process = global.process + +const processOk = function (process) { + return process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function' +} + +// some kind of non-node environment, just no-op +/* istanbul ignore if */ +if (!processOk(process)) { + module.exports = function () { + return function () {} + } +} else { + var assert = require('assert') + var signals = require('./signals.js') + var isWin = /^win/i.test(process.platform) + + var EE = require('events') + /* istanbul ignore if */ + if (typeof EE !== 'function') { + EE = EE.EventEmitter + } + + var emitter + if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ + } else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} + } + + // Because this emitter is a global, we have to check to see if a + // previous version of this library failed to enable infinite listeners. + // I know what you're about to say. But literally everything about + // signal-exit is a compromise with evil. Get used to it. + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true + } + + module.exports = function (cb, opts) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return function () {} + } + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove + } + + var unload = function unload () { + if (!loaded || !processOk(global.process)) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 + } + module.exports.unload = unload + + var emit = function emit (event, code, signal) { + /* istanbul ignore if */ + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) + } + + // { : , ... } + var sigListeners = {} + signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + if (isWin && sig === 'SIGHUP') { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + sig = 'SIGINT' + } + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } + }) + + module.exports.signals = function () { + return signals + } + + var loaded = false + + var load = function load () { + if (loaded || !processOk(global.process)) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit + } + module.exports.load = load + + var originalProcessReallyExit = process.reallyExit + var processReallyExit = function processReallyExit (code) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + process.exitCode = code || /* istanbul ignore next */ 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) + } + + var originalProcessEmit = process.emit + var processEmit = function processEmit (ev, arg) { + if (ev === 'exit' && processOk(global.process)) { + /* istanbul ignore else */ + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + /* istanbul ignore next */ + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } + } +} diff --git a/node_modules/nyc/node_modules/signal-exit/package.json b/node_modules/nyc/node_modules/signal-exit/package.json new file mode 100644 index 0000000..e1a0031 --- /dev/null +++ b/node_modules/nyc/node_modules/signal-exit/package.json @@ -0,0 +1,38 @@ +{ + "name": "signal-exit", + "version": "3.0.7", + "description": "when you want to fire an event no matter how a process exits.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "files": [ + "index.js", + "signals.js" + ], + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, + "keywords": [ + "signal", + "exit" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "homepage": "https://github.com/tapjs/signal-exit", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^3.1.1", + "nyc": "^15.1.0", + "standard-version": "^9.3.1", + "tap": "^15.1.1" + } +} diff --git a/node_modules/nyc/node_modules/signal-exit/signals.js b/node_modules/nyc/node_modules/signal-exit/signals.js new file mode 100644 index 0000000..3bd67a8 --- /dev/null +++ b/node_modules/nyc/node_modules/signal-exit/signals.js @@ -0,0 +1,53 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/node_modules/nyc/node_modules/string-width/index.d.ts b/node_modules/nyc/node_modules/string-width/index.d.ts new file mode 100644 index 0000000..12b5309 --- /dev/null +++ b/node_modules/nyc/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/nyc/node_modules/string-width/index.js b/node_modules/nyc/node_modules/string-width/index.js new file mode 100644 index 0000000..f4d261a --- /dev/null +++ b/node_modules/nyc/node_modules/string-width/index.js @@ -0,0 +1,47 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/nyc/node_modules/string-width/license b/node_modules/nyc/node_modules/string-width/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/string-width/package.json b/node_modules/nyc/node_modules/string-width/package.json new file mode 100644 index 0000000..28ba7b4 --- /dev/null +++ b/node_modules/nyc/node_modules/string-width/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.3", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/nyc/node_modules/string-width/readme.md b/node_modules/nyc/node_modules/string-width/readme.md new file mode 100644 index 0000000..bdd3141 --- /dev/null +++ b/node_modules/nyc/node_modules/string-width/readme.md @@ -0,0 +1,50 @@ +# string-width + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/nyc/node_modules/strip-ansi/index.d.ts b/node_modules/nyc/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000..907fccc --- /dev/null +++ b/node_modules/nyc/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/nyc/node_modules/strip-ansi/index.js b/node_modules/nyc/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..9a593df --- /dev/null +++ b/node_modules/nyc/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/nyc/node_modules/strip-ansi/license b/node_modules/nyc/node_modules/strip-ansi/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/strip-ansi/package.json b/node_modules/nyc/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..1a41108 --- /dev/null +++ b/node_modules/nyc/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/nyc/node_modules/strip-ansi/readme.md b/node_modules/nyc/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..7c4b56d --- /dev/null +++ b/node_modules/nyc/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/nyc/node_modules/wrap-ansi/index.js b/node_modules/nyc/node_modules/wrap-ansi/index.js new file mode 100644 index 0000000..a6e5443 --- /dev/null +++ b/node_modules/nyc/node_modules/wrap-ansi/index.js @@ -0,0 +1,186 @@ +'use strict'; +const stringWidth = require('string-width'); +const stripAnsi = require('strip-ansi'); +const ansiStyles = require('ansi-styles'); + +const ESCAPES = new Set([ + '\u001B', + '\u009B' +]); + +const END_CODE = 39; + +const wrapAnsi = code => `${ESCAPES.values().next().value}[${code}m`; + +// Calculate the length of words split on ' ', ignoring +// the extra characters added by ansi escape codes +const wordLengths = string => string.split(' ').map(character => stringWidth(character)); + +// Wrap a long word across multiple rows +// Ansi escape codes do not count towards length +const wrapWord = (rows, word, columns) => { + const characters = [...word]; + + let isInsideEscape = false; + let visible = stringWidth(stripAnsi(rows[rows.length - 1])); + + for (const [index, character] of characters.entries()) { + const characterLength = stringWidth(character); + + if (visible + characterLength <= columns) { + rows[rows.length - 1] += character; + } else { + rows.push(character); + visible = 0; + } + + if (ESCAPES.has(character)) { + isInsideEscape = true; + } else if (isInsideEscape && character === 'm') { + isInsideEscape = false; + continue; + } + + if (isInsideEscape) { + continue; + } + + visible += characterLength; + + if (visible === columns && index < characters.length - 1) { + rows.push(''); + visible = 0; + } + } + + // It's possible that the last row we copy over is only + // ansi escape characters, handle this edge-case + if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { + rows[rows.length - 2] += rows.pop(); + } +}; + +// Trims spaces from a string ignoring invisible sequences +const stringVisibleTrimSpacesRight = str => { + const words = str.split(' '); + let last = words.length; + + while (last > 0) { + if (stringWidth(words[last - 1]) > 0) { + break; + } + + last--; + } + + if (last === words.length) { + return str; + } + + return words.slice(0, last).join(' ') + words.slice(last).join(''); +}; + +// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode +// +// 'hard' will never allow a string to take up more than columns characters +// +// 'soft' allows long words to expand past the column length +const exec = (string, columns, options = {}) => { + if (options.trim !== false && string.trim() === '') { + return ''; + } + + let pre = ''; + let ret = ''; + let escapeCode; + + const lengths = wordLengths(string); + let rows = ['']; + + for (const [index, word] of string.split(' ').entries()) { + if (options.trim !== false) { + rows[rows.length - 1] = rows[rows.length - 1].trimLeft(); + } + + let rowLength = stringWidth(rows[rows.length - 1]); + + if (index !== 0) { + if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { + // If we start with a new word but the current row length equals the length of the columns, add a new row + rows.push(''); + rowLength = 0; + } + + if (rowLength > 0 || options.trim === false) { + rows[rows.length - 1] += ' '; + rowLength++; + } + } + + // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns' + if (options.hard && lengths[index] > columns) { + const remainingColumns = (columns - rowLength); + const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); + const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); + if (breaksStartingNextLine < breaksStartingThisLine) { + rows.push(''); + } + + wrapWord(rows, word, columns); + continue; + } + + if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); + continue; + } + + rows.push(''); + } + + if (rowLength + lengths[index] > columns && options.wordWrap === false) { + wrapWord(rows, word, columns); + continue; + } + + rows[rows.length - 1] += word; + } + + if (options.trim !== false) { + rows = rows.map(stringVisibleTrimSpacesRight); + } + + pre = rows.join('\n'); + + for (const [index, character] of [...pre].entries()) { + ret += character; + + if (ESCAPES.has(character)) { + const code = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4))); + escapeCode = code === END_CODE ? null : code; + } + + const code = ansiStyles.codes.get(Number(escapeCode)); + + if (escapeCode && code) { + if (pre[index + 1] === '\n') { + ret += wrapAnsi(code); + } else if (character === '\n') { + ret += wrapAnsi(escapeCode); + } + } + } + + return ret; +}; + +// For each newline, invoke the method separately +module.exports = (string, columns, options) => { + return String(string) + .normalize() + .replace(/\r\n/g, '\n') + .split('\n') + .map(line => exec(line, columns, options)) + .join('\n'); +}; diff --git a/node_modules/nyc/node_modules/wrap-ansi/license b/node_modules/nyc/node_modules/wrap-ansi/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/nyc/node_modules/wrap-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/wrap-ansi/package.json b/node_modules/nyc/node_modules/wrap-ansi/package.json new file mode 100644 index 0000000..1d57c9f --- /dev/null +++ b/node_modules/nyc/node_modules/wrap-ansi/package.json @@ -0,0 +1,61 @@ +{ + "name": "wrap-ansi", + "version": "6.2.0", + "description": "Wordwrap a string with ANSI escape codes", + "license": "MIT", + "repository": "chalk/wrap-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "wrap", + "break", + "wordwrap", + "wordbreak", + "linewrap", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "chalk": "^2.4.2", + "coveralls": "^3.0.3", + "has-ansi": "^3.0.0", + "nyc": "^14.1.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/nyc/node_modules/wrap-ansi/readme.md b/node_modules/nyc/node_modules/wrap-ansi/readme.md new file mode 100644 index 0000000..d81a4d5 --- /dev/null +++ b/node_modules/nyc/node_modules/wrap-ansi/readme.md @@ -0,0 +1,97 @@ +# wrap-ansi [![Build Status](https://travis-ci.org/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.org/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master) + +> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) + + +## Install + +``` +$ npm install wrap-ansi +``` + + +## Usage + +```js +const chalk = require('chalk'); +const wrapAnsi = require('wrap-ansi'); + +const input = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(wrapAnsi(input, 20)); +``` + + + + +## API + +### wrapAnsi(string, columns, options?) + +Wrap words to the specified column width. + +#### string + +Type: `string` + +String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`. + +#### columns + +Type: `number` + +Number of columns to wrap the text to. + +#### options + +Type: `object` + +##### hard + +Type: `boolean`
+Default: `false` + +By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width. + +##### wordWrap + +Type: `boolean`
+Default: `true` + +By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. + +##### trim + +Type: `boolean`
+Default: `true` + +Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim. + + +## Related + +- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes +- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right +- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) +- [Benjamin Coe](https://github.com/bcoe) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/nyc/node_modules/y18n/CHANGELOG.md b/node_modules/nyc/node_modules/y18n/CHANGELOG.md new file mode 100644 index 0000000..b7e86e9 --- /dev/null +++ b/node_modules/nyc/node_modules/y18n/CHANGELOG.md @@ -0,0 +1,35 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +### [4.0.3](https://www.github.com/yargs/y18n/compare/y18n-v4.0.2...y18n-v4.0.3) (2021-04-07) + + +### Bug Fixes + +* **release:** 4.x.x should not enforce Node 10 ([#126](https://www.github.com/yargs/y18n/issues/126)) ([1e21a53](https://www.github.com/yargs/y18n/commit/1e21a536e9135d8403a47be88922157a706b7cde)) + +### 4.0.1 (2020-11-30) + +### Bug Fixes + +* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/a9ac604abf756dec9687be3843e2c93bfe581f25)) + + +# [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10) + + +### Bug Fixes + +* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123)) + + +### Features + +* **__:** added tagged template literal support ([#44](https://github.com/yargs/y18n/issues/44)) ([0598daf](https://github.com/yargs/y18n/commit/0598daf)) + + +### BREAKING CHANGES + +* **__:** dropping Node 0.10/Node 0.12 support diff --git a/node_modules/nyc/node_modules/y18n/LICENSE b/node_modules/nyc/node_modules/y18n/LICENSE new file mode 100644 index 0000000..3c157f0 --- /dev/null +++ b/node_modules/nyc/node_modules/y18n/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/nyc/node_modules/y18n/README.md b/node_modules/nyc/node_modules/y18n/README.md new file mode 100644 index 0000000..826474f --- /dev/null +++ b/node_modules/nyc/node_modules/y18n/README.md @@ -0,0 +1,109 @@ +# y18n + +[![Build Status][travis-image]][travis-url] +[![Coverage Status][coveralls-image]][coveralls-url] +[![NPM version][npm-image]][npm-url] +[![js-standard-style][standard-image]][standard-url] +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) + +The bare-bones internationalization library used by yargs. + +Inspired by [i18n](https://www.npmjs.com/package/i18n). + +## Examples + +_simple string translation:_ + +```js +var __ = require('y18n').__ + +console.log(__('my awesome string %s', 'foo')) +``` + +output: + +`my awesome string foo` + +_using tagged template literals_ + +```js +var __ = require('y18n').__ +var str = 'foo' + +console.log(__`my awesome string ${str}`) +``` + +output: + +`my awesome string foo` + +_pluralization support:_ + +```js +var __n = require('y18n').__n + +console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')) +``` + +output: + +`2 fishes foo` + +## JSON Language Files + +The JSON language files should be stored in a `./locales` folder. +File names correspond to locales, e.g., `en.json`, `pirate.json`. + +When strings are observed for the first time they will be +added to the JSON file corresponding to the current locale. + +## Methods + +### require('y18n')(config) + +Create an instance of y18n with the config provided, options include: + +* `directory`: the locale directory, default `./locales`. +* `updateFiles`: should newly observed strings be updated in file, default `true`. +* `locale`: what locale should be used. +* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) + be allowed if a file matching the locale does not exist (e.g. `en_US.json`), + default `true`. + +### y18n.\_\_(str, arg, arg, arg) + +Print a localized string, `%s` will be replaced with `arg`s. + +This function can also be used as a tag for a template literal. You can use it +like this: __`hello ${'world'}`. This will be equivalent to +`__('hello %s', 'world')`. + +### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) + +Print a localized string with appropriate pluralization. If `%d` is provided +in the string, the `count` will replace this placeholder. + +### y18n.setLocale(str) + +Set the current locale being used. + +### y18n.getLocale() + +What locale is currently being used? + +### y18n.updateLocale(obj) + +Update the current locale with the key value pairs in `obj`. + +## License + +ISC + +[travis-url]: https://travis-ci.org/yargs/y18n +[travis-image]: https://img.shields.io/travis/yargs/y18n.svg +[coveralls-url]: https://coveralls.io/github/yargs/y18n +[coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg +[npm-url]: https://npmjs.org/package/y18n +[npm-image]: https://img.shields.io/npm/v/y18n.svg +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg +[standard-url]: https://github.com/feross/standard diff --git a/node_modules/nyc/node_modules/y18n/index.js b/node_modules/nyc/node_modules/y18n/index.js new file mode 100644 index 0000000..727362a --- /dev/null +++ b/node_modules/nyc/node_modules/y18n/index.js @@ -0,0 +1,188 @@ +var fs = require('fs') +var path = require('path') +var util = require('util') + +function Y18N (opts) { + // configurable options. + opts = opts || {} + this.directory = opts.directory || './locales' + this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true + this.locale = opts.locale || 'en' + this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true + + // internal stuff. + this.cache = Object.create(null) + this.writeQueue = [] +} + +Y18N.prototype.__ = function () { + if (typeof arguments[0] !== 'string') { + return this._taggedLiteral.apply(this, arguments) + } + var args = Array.prototype.slice.call(arguments) + var str = args.shift() + var cb = function () {} // start with noop. + + if (typeof args[args.length - 1] === 'function') cb = args.pop() + cb = cb || function () {} // noop. + + if (!this.cache[this.locale]) this._readLocaleFile() + + // we've observed a new string, update the language file. + if (!this.cache[this.locale][str] && this.updateFiles) { + this.cache[this.locale][str] = str + + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite([this.directory, this.locale, cb]) + } else { + cb() + } + + return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args)) +} + +Y18N.prototype._taggedLiteral = function (parts) { + var args = arguments + var str = '' + parts.forEach(function (part, i) { + var arg = args[i + 1] + str += part + if (typeof arg !== 'undefined') { + str += '%s' + } + }) + return this.__.apply(null, [str].concat([].slice.call(arguments, 1))) +} + +Y18N.prototype._enqueueWrite = function (work) { + this.writeQueue.push(work) + if (this.writeQueue.length === 1) this._processWriteQueue() +} + +Y18N.prototype._processWriteQueue = function () { + var _this = this + var work = this.writeQueue[0] + + // destructure the enqueued work. + var directory = work[0] + var locale = work[1] + var cb = work[2] + + var languageFile = this._resolveLocaleFile(directory, locale) + var serializedLocale = JSON.stringify(this.cache[locale], null, 2) + + fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) { + _this.writeQueue.shift() + if (_this.writeQueue.length > 0) _this._processWriteQueue() + cb(err) + }) +} + +Y18N.prototype._readLocaleFile = function () { + var localeLookup = {} + var languageFile = this._resolveLocaleFile(this.directory, this.locale) + + try { + localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8')) + } catch (err) { + if (err instanceof SyntaxError) { + err.message = 'syntax error in ' + languageFile + } + + if (err.code === 'ENOENT') localeLookup = {} + else throw err + } + + this.cache[this.locale] = localeLookup +} + +Y18N.prototype._resolveLocaleFile = function (directory, locale) { + var file = path.resolve(directory, './', locale + '.json') + if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) { + // attempt fallback to language only + var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json') + if (this._fileExistsSync(languageFile)) file = languageFile + } + return file +} + +// this only exists because fs.existsSync() "will be deprecated" +// see https://nodejs.org/api/fs.html#fs_fs_existssync_path +Y18N.prototype._fileExistsSync = function (file) { + try { + return fs.statSync(file).isFile() + } catch (err) { + return false + } +} + +Y18N.prototype.__n = function () { + var args = Array.prototype.slice.call(arguments) + var singular = args.shift() + var plural = args.shift() + var quantity = args.shift() + + var cb = function () {} // start with noop. + if (typeof args[args.length - 1] === 'function') cb = args.pop() + + if (!this.cache[this.locale]) this._readLocaleFile() + + var str = quantity === 1 ? singular : plural + if (this.cache[this.locale][singular]) { + str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other'] + } + + // we've observed a new string, update the language file. + if (!this.cache[this.locale][singular] && this.updateFiles) { + this.cache[this.locale][singular] = { + one: singular, + other: plural + } + + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite([this.directory, this.locale, cb]) + } else { + cb() + } + + // if a %d placeholder is provided, add quantity + // to the arguments expanded by util.format. + var values = [str] + if (~str.indexOf('%d')) values.push(quantity) + + return util.format.apply(util, values.concat(args)) +} + +Y18N.prototype.setLocale = function (locale) { + this.locale = locale +} + +Y18N.prototype.getLocale = function () { + return this.locale +} + +Y18N.prototype.updateLocale = function (obj) { + if (!this.cache[this.locale]) this._readLocaleFile() + + for (var key in obj) { + this.cache[this.locale][key] = obj[key] + } +} + +module.exports = function (opts) { + var y18n = new Y18N(opts) + + // bind all functions to y18n, so that + // they can be used in isolation. + for (var key in y18n) { + if (typeof y18n[key] === 'function') { + y18n[key] = y18n[key].bind(y18n) + } + } + + return y18n +} diff --git a/node_modules/nyc/node_modules/y18n/package.json b/node_modules/nyc/node_modules/y18n/package.json new file mode 100644 index 0000000..6f08863 --- /dev/null +++ b/node_modules/nyc/node_modules/y18n/package.json @@ -0,0 +1,39 @@ +{ + "name": "y18n", + "version": "4.0.3", + "description": "the bare-bones internationalization library used by yargs", + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "nyc mocha", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "release": "standard-version" + }, + "repository": { + "type": "git", + "url": "git@github.com:yargs/y18n.git" + }, + "files": [ + "index.js" + ], + "keywords": [ + "i18n", + "internationalization", + "yargs" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/yargs/y18n/issues" + }, + "homepage": "https://github.com/yargs/y18n", + "devDependencies": { + "chai": "^4.0.1", + "coveralls": "^3.0.0", + "mocha": "^4.0.1", + "nyc": "^11.0.1", + "rimraf": "^2.5.0", + "standard": "^10.0.0-beta.0", + "standard-version": "^4.2.0" + } +} diff --git a/node_modules/nyc/node_modules/yargs-parser/CHANGELOG.md b/node_modules/nyc/node_modules/yargs-parser/CHANGELOG.md new file mode 100644 index 0000000..d91dc51 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs-parser/CHANGELOG.md @@ -0,0 +1,601 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [18.1.3](https://www.github.com/yargs/yargs-parser/compare/v18.1.2...v18.1.3) (2020-04-16) + + +### Bug Fixes + +* **setArg:** options using camel-case and dot-notation populated twice ([#268](https://www.github.com/yargs/yargs-parser/issues/268)) ([f7e15b9](https://www.github.com/yargs/yargs-parser/commit/f7e15b9800900b9856acac1a830a5f35847be73e)) + +### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26) + + +### Bug Fixes + +* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13)) + +### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16) + + +### Bug Fixes + +* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential +prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2)) + +## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07) + + +### Features + +* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f)) + +## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02) + + +### ⚠ BREAKING CHANGES + +* the narg count is now enforced when parsing arrays. + +### Features + +* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c)) + +## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01) + + +### Features + +* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb)) + +### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29) + + +### Bug Fixes + +* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba)) + +## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10) + + +### ⚠ BREAKING CHANGES + +* this reverts parsing behavior of booleans to that of yargs@14 +* objects used during parsing are now created with a null +prototype. There may be some scenarios where this change in behavior +leaks externally. + +### Features + +* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5)) +* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732)) + + +### Bug Fixes + +* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346)) +* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c)) +* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de)) +* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5)) + +## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01) + + +### ⚠ BREAKING CHANGES + +* populate error if incompatible narg/count or array/count options are used (#191) + +### Features + +* options that have had their default value used are now tracked ([#211](https://www.github.com/yargs/yargs-parser/issues/211)) ([a525234](https://www.github.com/yargs/yargs-parser/commit/a525234558c847deedd73f8792e0a3b77b26e2c0)) +* populate error if incompatible narg/count or array/count options are used ([#191](https://www.github.com/yargs/yargs-parser/issues/191)) ([84a401f](https://www.github.com/yargs/yargs-parser/commit/84a401f0fa3095e0a19661670d1570d0c3b9d3c9)) + + +### Reverts + +* revert 16.0.0 CHANGELOG entry ([920320a](https://www.github.com/yargs/yargs-parser/commit/920320ad9861bbfd58eda39221ae211540fc1daf)) + +## [15.0.0](https://github.com/yargs/yargs-parser/compare/v14.0.0...v15.0.0) (2019-10-07) + + +### Features + +* rework `collect-unknown-options` into `unknown-options-as-args`, providing more comprehensive functionality ([ef771ca](https://github.com/yargs/yargs-parser/commit/ef771ca)) + + +### BREAKING CHANGES + +* rework `collect-unknown-options` into `unknown-options-as-args`, providing more comprehensive functionality + + + +## [14.0.0](https://github.com/yargs/yargs-parser/compare/v13.1.1...v14.0.0) (2019-09-06) + + +### Bug Fixes + +* boolean arrays with default values ([#185](https://github.com/yargs/yargs-parser/issues/185)) ([7d42572](https://github.com/yargs/yargs-parser/commit/7d42572)) +* boolean now behaves the same as other array types ([#184](https://github.com/yargs/yargs-parser/issues/184)) ([17ca3bd](https://github.com/yargs/yargs-parser/commit/17ca3bd)) +* eatNargs() for 'opt.narg === 0' and boolean typed options ([#188](https://github.com/yargs/yargs-parser/issues/188)) ([c5a1db0](https://github.com/yargs/yargs-parser/commit/c5a1db0)) +* maybeCoerceNumber now takes precedence over coerce return value ([#182](https://github.com/yargs/yargs-parser/issues/182)) ([2f26436](https://github.com/yargs/yargs-parser/commit/2f26436)) +* take into account aliases when appending arrays from config object ([#199](https://github.com/yargs/yargs-parser/issues/199)) ([f8a2d3f](https://github.com/yargs/yargs-parser/commit/f8a2d3f)) + + +### Features + +* add configuration option to "collect-unknown-options" ([#181](https://github.com/yargs/yargs-parser/issues/181)) ([7909cc4](https://github.com/yargs/yargs-parser/commit/7909cc4)) +* maybeCoerceNumber() now takes into account arrays ([#187](https://github.com/yargs/yargs-parser/issues/187)) ([31c204b](https://github.com/yargs/yargs-parser/commit/31c204b)) + + +### BREAKING CHANGES + +* unless "parse-numbers" is set to "false", arrays of numeric strings are now parsed as numbers, rather than strings. +* we have dropped the broken "defaulted" functionality; we would like to revisit adding this in the future. +* maybeCoerceNumber now takes precedence over coerce return value (#182) + + + +### [13.1.1](https://www.github.com/yargs/yargs-parser/compare/v13.1.0...v13.1.1) (2019-06-10) + + +### Bug Fixes + +* convert values to strings when tokenizing ([#167](https://www.github.com/yargs/yargs-parser/issues/167)) ([57b7883](https://www.github.com/yargs/yargs-parser/commit/57b7883)) +* nargs should allow duplicates when duplicate-arguments-array=false ([#164](https://www.github.com/yargs/yargs-parser/issues/164)) ([47ccb0b](https://www.github.com/yargs/yargs-parser/commit/47ccb0b)) +* should populate "_" when given config with "short-option-groups" false ([#179](https://www.github.com/yargs/yargs-parser/issues/179)) ([6055974](https://www.github.com/yargs/yargs-parser/commit/6055974)) + +## [13.1.0](https://github.com/yargs/yargs-parser/compare/v13.0.0...v13.1.0) (2019-05-05) + + +### Features + +* add `strip-aliased` and `strip-dashed` configuration options. ([#172](https://github.com/yargs/yargs-parser/issues/172)) ([a3936aa](https://github.com/yargs/yargs-parser/commit/a3936aa)) +* support boolean which do not consume next argument. ([#171](https://github.com/yargs/yargs-parser/issues/171)) ([0ae7fcb](https://github.com/yargs/yargs-parser/commit/0ae7fcb)) + + + + +# [13.0.0](https://github.com/yargs/yargs-parser/compare/v12.0.0...v13.0.0) (2019-02-02) + + +### Features + +* don't coerce number from string with leading '0' or '+' ([#158](https://github.com/yargs/yargs-parser/issues/158)) ([18d0fd5](https://github.com/yargs/yargs-parser/commit/18d0fd5)) + + +### BREAKING CHANGES + +* options with leading '+' or '0' now parse as strings + + + + +# [12.0.0](https://github.com/yargs/yargs-parser/compare/v11.1.1...v12.0.0) (2019-01-29) + + +### Bug Fixes + +* better handling of quoted strings ([#153](https://github.com/yargs/yargs-parser/issues/153)) ([2fb71b2](https://github.com/yargs/yargs-parser/commit/2fb71b2)) + + +### Features + +* default value is now used if no right-hand value provided for numbers/strings ([#156](https://github.com/yargs/yargs-parser/issues/156)) ([5a7c46a](https://github.com/yargs/yargs-parser/commit/5a7c46a)) + + +### BREAKING CHANGES + +* a flag with no right-hand value no longer populates defaulted options with `undefined`. +* quotes at beginning and endings of strings are not removed during parsing. + + + + +## [11.1.1](https://github.com/yargs/yargs-parser/compare/v11.1.0...v11.1.1) (2018-11-19) + + +### Bug Fixes + +* ensure empty string is added into argv._ ([#140](https://github.com/yargs/yargs-parser/issues/140)) ([79cda98](https://github.com/yargs/yargs-parser/commit/79cda98)) + + +### Reverts + +* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([f4a3063](https://github.com/yargs/yargs-parser/commit/f4a3063)) + + + + +# [11.1.0](https://github.com/yargs/yargs-parser/compare/v11.0.0...v11.1.0) (2018-11-10) + + +### Bug Fixes + +* handling of one char alias ([#139](https://github.com/yargs/yargs-parser/issues/139)) ([ee56e31](https://github.com/yargs/yargs-parser/commit/ee56e31)) + + +### Features + +* add halt-at-non-option configuration option ([#130](https://github.com/yargs/yargs-parser/issues/130)) ([a849fce](https://github.com/yargs/yargs-parser/commit/a849fce)) + + + + +# [11.0.0](https://github.com/yargs/yargs-parser/compare/v10.1.0...v11.0.0) (2018-10-06) + + +### Bug Fixes + +* flatten-duplicate-arrays:false for more than 2 arrays ([#128](https://github.com/yargs/yargs-parser/issues/128)) ([2bc395f](https://github.com/yargs/yargs-parser/commit/2bc395f)) +* hyphenated flags combined with dot notation broke parsing ([#131](https://github.com/yargs/yargs-parser/issues/131)) ([dc788da](https://github.com/yargs/yargs-parser/commit/dc788da)) +* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([77ae1d4](https://github.com/yargs/yargs-parser/commit/77ae1d4)) + + +### Chores + +* update dependencies ([6dc42a1](https://github.com/yargs/yargs-parser/commit/6dc42a1)) + + +### Features + +* also add camelCase array options ([#125](https://github.com/yargs/yargs-parser/issues/125)) ([08c0117](https://github.com/yargs/yargs-parser/commit/08c0117)) +* array.type can now be provided, supporting coercion ([#132](https://github.com/yargs/yargs-parser/issues/132)) ([4b8cfce](https://github.com/yargs/yargs-parser/commit/4b8cfce)) + + +### BREAKING CHANGES + +* drops Node 4 support +* the argv object is now populated differently (correctly) when hyphens and dot notation are used in conjunction. + + + + +# [10.1.0](https://github.com/yargs/yargs-parser/compare/v10.0.0...v10.1.0) (2018-06-29) + + +### Features + +* add `set-placeholder-key` configuration ([#123](https://github.com/yargs/yargs-parser/issues/123)) ([19386ee](https://github.com/yargs/yargs-parser/commit/19386ee)) + + + + +# [10.0.0](https://github.com/yargs/yargs-parser/compare/v9.0.2...v10.0.0) (2018-04-04) + + +### Bug Fixes + +* do not set boolean flags if not defined in `argv` ([#119](https://github.com/yargs/yargs-parser/issues/119)) ([f6e6599](https://github.com/yargs/yargs-parser/commit/f6e6599)) + + +### BREAKING CHANGES + +* `boolean` flags defined without a `default` value will now behave like other option type and won't be set in the parsed results when the user doesn't set the corresponding CLI arg. + +Previous behavior: +```js +var parse = require('yargs-parser'); + +parse('--flag', {boolean: ['flag']}); +// => { _: [], flag: true } + +parse('--no-flag', {boolean: ['flag']}); +// => { _: [], flag: false } + +parse('', {boolean: ['flag']}); +// => { _: [], flag: false } +``` + +New behavior: +```js +var parse = require('yargs-parser'); + +parse('--flag', {boolean: ['flag']}); +// => { _: [], flag: true } + +parse('--no-flag', {boolean: ['flag']}); +// => { _: [], flag: false } + +parse('', {boolean: ['flag']}); +// => { _: [] } => flag not set similarly to other option type +``` + + + + +## [9.0.2](https://github.com/yargs/yargs-parser/compare/v9.0.1...v9.0.2) (2018-01-20) + + +### Bug Fixes + +* nargs was still aggressively consuming too many arguments ([9b28aad](https://github.com/yargs/yargs-parser/commit/9b28aad)) + + + + +## [9.0.1](https://github.com/yargs/yargs-parser/compare/v9.0.0...v9.0.1) (2018-01-20) + + +### Bug Fixes + +* nargs was consuming too many arguments ([4fef206](https://github.com/yargs/yargs-parser/commit/4fef206)) + + + + +# [9.0.0](https://github.com/yargs/yargs-parser/compare/v8.1.0...v9.0.0) (2018-01-20) + + +### Features + +* narg arguments no longer consume flag arguments ([#114](https://github.com/yargs/yargs-parser/issues/114)) ([60bb9b3](https://github.com/yargs/yargs-parser/commit/60bb9b3)) + + +### BREAKING CHANGES + +* arguments of form --foo, -abc, will no longer be consumed by nargs + + + + +# [8.1.0](https://github.com/yargs/yargs-parser/compare/v8.0.0...v8.1.0) (2017-12-20) + + +### Bug Fixes + +* allow null config values ([#108](https://github.com/yargs/yargs-parser/issues/108)) ([d8b14f9](https://github.com/yargs/yargs-parser/commit/d8b14f9)) +* ensure consistent parsing of dot-notation arguments ([#102](https://github.com/yargs/yargs-parser/issues/102)) ([c9bd79c](https://github.com/yargs/yargs-parser/commit/c9bd79c)) +* implement [@antoniom](https://github.com/antoniom)'s fix for camel-case expansion ([3087e1d](https://github.com/yargs/yargs-parser/commit/3087e1d)) +* only run coercion functions once, despite aliases. ([#76](https://github.com/yargs/yargs-parser/issues/76)) ([#103](https://github.com/yargs/yargs-parser/issues/103)) ([507aaef](https://github.com/yargs/yargs-parser/commit/507aaef)) +* scientific notation circumvented bounds check ([#110](https://github.com/yargs/yargs-parser/issues/110)) ([3571f57](https://github.com/yargs/yargs-parser/commit/3571f57)) +* tokenizer should ignore spaces at the beginning of the argString ([#106](https://github.com/yargs/yargs-parser/issues/106)) ([f34ead9](https://github.com/yargs/yargs-parser/commit/f34ead9)) + + +### Features + +* make combining arrays a configurable option ([#111](https://github.com/yargs/yargs-parser/issues/111)) ([c8bf536](https://github.com/yargs/yargs-parser/commit/c8bf536)) +* merge array from arguments with array from config ([#83](https://github.com/yargs/yargs-parser/issues/83)) ([806ddd6](https://github.com/yargs/yargs-parser/commit/806ddd6)) + + + + +# [8.0.0](https://github.com/yargs/yargs-parser/compare/v7.0.0...v8.0.0) (2017-10-05) + + +### Bug Fixes + +* Ignore multiple spaces between arguments. ([#100](https://github.com/yargs/yargs-parser/issues/100)) ([d137227](https://github.com/yargs/yargs-parser/commit/d137227)) + + +### Features + +* allow configuration of prefix for boolean negation ([#94](https://github.com/yargs/yargs-parser/issues/94)) ([00bde7d](https://github.com/yargs/yargs-parser/commit/00bde7d)) +* reworking how numbers are parsed ([#104](https://github.com/yargs/yargs-parser/issues/104)) ([fba00eb](https://github.com/yargs/yargs-parser/commit/fba00eb)) + + +### BREAKING CHANGES + +* strings that fail `Number.isSafeInteger()` are no longer coerced into numbers. + + + + +# [7.0.0](https://github.com/yargs/yargs-parser/compare/v6.0.1...v7.0.0) (2017-05-02) + + +### Chores + +* revert populate-- logic ([#91](https://github.com/yargs/yargs-parser/issues/91)) ([6003e6d](https://github.com/yargs/yargs-parser/commit/6003e6d)) + + +### BREAKING CHANGES + +* populate-- now defaults to false. + + + + +## [6.0.1](https://github.com/yargs/yargs-parser/compare/v6.0.0...v6.0.1) (2017-05-01) + + +### Bug Fixes + +* default '--' to undefined when not provided; this is closer to the array API ([#90](https://github.com/yargs/yargs-parser/issues/90)) ([4e739cc](https://github.com/yargs/yargs-parser/commit/4e739cc)) + + + + +# [6.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v6.0.0) (2017-05-01) + + +### Bug Fixes + +* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f)) +* parsing hints should apply for dot notation keys ([#86](https://github.com/yargs/yargs-parser/issues/86)) ([3e47d62](https://github.com/yargs/yargs-parser/commit/3e47d62)) + + +### Chores + +* upgrade to newest version of camelcase ([#87](https://github.com/yargs/yargs-parser/issues/87)) ([f1903aa](https://github.com/yargs/yargs-parser/commit/f1903aa)) + + +### Features + +* add -- option which allows arguments after the -- flag to be returned separated from positional arguments ([#84](https://github.com/yargs/yargs-parser/issues/84)) ([2572ca8](https://github.com/yargs/yargs-parser/commit/2572ca8)) +* when parsing stops, we now populate "--" by default ([#88](https://github.com/yargs/yargs-parser/issues/88)) ([cd666db](https://github.com/yargs/yargs-parser/commit/cd666db)) + + +### BREAKING CHANGES + +* rather than placing arguments in "_", when parsing is stopped via "--"; we now populate an array called "--" by default. +* camelcase now requires Node 4+. +* environment variables will now override config files (args, env, config-file, config-object) + + + + +# [5.0.0](https://github.com/yargs/yargs-parser/compare/v4.2.1...v5.0.0) (2017-02-18) + + +### Bug Fixes + +* environment variables should take precedence over config file ([#81](https://github.com/yargs/yargs-parser/issues/81)) ([76cee1f](https://github.com/yargs/yargs-parser/commit/76cee1f)) + + +### BREAKING CHANGES + +* environment variables will now override config files (args, env, config-file, config-object) + + + + +## [4.2.1](https://github.com/yargs/yargs-parser/compare/v4.2.0...v4.2.1) (2017-01-02) + + +### Bug Fixes + +* flatten/duplicate regression ([#75](https://github.com/yargs/yargs-parser/issues/75)) ([68d68a0](https://github.com/yargs/yargs-parser/commit/68d68a0)) + + + + +# [4.2.0](https://github.com/yargs/yargs-parser/compare/v4.1.0...v4.2.0) (2016-12-01) + + +### Bug Fixes + +* inner objects in configs had their keys appended to top-level key when dot-notation was disabled ([#72](https://github.com/yargs/yargs-parser/issues/72)) ([0b1b5f9](https://github.com/yargs/yargs-parser/commit/0b1b5f9)) + + +### Features + +* allow multiple arrays to be provided, rather than always combining ([#71](https://github.com/yargs/yargs-parser/issues/71)) ([0f0fb2d](https://github.com/yargs/yargs-parser/commit/0f0fb2d)) + + + + +# [4.1.0](https://github.com/yargs/yargs-parser/compare/v4.0.2...v4.1.0) (2016-11-07) + + +### Features + +* apply coercions to default options ([#65](https://github.com/yargs/yargs-parser/issues/65)) ([c79052b](https://github.com/yargs/yargs-parser/commit/c79052b)) +* handle dot notation boolean options ([#63](https://github.com/yargs/yargs-parser/issues/63)) ([02c3545](https://github.com/yargs/yargs-parser/commit/02c3545)) + + + + +## [4.0.2](https://github.com/yargs/yargs-parser/compare/v4.0.1...v4.0.2) (2016-09-30) + + +### Bug Fixes + +* whoops, let's make the assign not change the Object key order ([29d069a](https://github.com/yargs/yargs-parser/commit/29d069a)) + + + + +## [4.0.1](https://github.com/yargs/yargs-parser/compare/v4.0.0...v4.0.1) (2016-09-30) + + +### Bug Fixes + +* lodash.assign was deprecated ([#59](https://github.com/yargs/yargs-parser/issues/59)) ([5e7eb11](https://github.com/yargs/yargs-parser/commit/5e7eb11)) + + + + +# [4.0.0](https://github.com/yargs/yargs-parser/compare/v3.2.0...v4.0.0) (2016-09-26) + + +### Bug Fixes + +* coerce should be applied to the final objects and arrays created ([#57](https://github.com/yargs/yargs-parser/issues/57)) ([4ca69da](https://github.com/yargs/yargs-parser/commit/4ca69da)) + + +### BREAKING CHANGES + +* coerce is no longer applied to individual arguments in an implicit array. + + + + +# [3.2.0](https://github.com/yargs/yargs-parser/compare/v3.1.0...v3.2.0) (2016-08-13) + + +### Features + +* coerce full array instead of each element ([#51](https://github.com/yargs/yargs-parser/issues/51)) ([cc4dc56](https://github.com/yargs/yargs-parser/commit/cc4dc56)) + + + + +# [3.1.0](https://github.com/yargs/yargs-parser/compare/v3.0.0...v3.1.0) (2016-08-09) + + +### Bug Fixes + +* address pkgConf parsing bug outlined in [#37](https://github.com/yargs/yargs-parser/issues/37) ([#45](https://github.com/yargs/yargs-parser/issues/45)) ([be76ee6](https://github.com/yargs/yargs-parser/commit/be76ee6)) +* better parsing of negative values ([#44](https://github.com/yargs/yargs-parser/issues/44)) ([2e43692](https://github.com/yargs/yargs-parser/commit/2e43692)) +* check aliases when guessing defaults for arguments fixes [#41](https://github.com/yargs/yargs-parser/issues/41) ([#43](https://github.com/yargs/yargs-parser/issues/43)) ([f3e4616](https://github.com/yargs/yargs-parser/commit/f3e4616)) + + +### Features + +* added coerce option, for providing specialized argument parsing ([#42](https://github.com/yargs/yargs-parser/issues/42)) ([7b49cd2](https://github.com/yargs/yargs-parser/commit/7b49cd2)) + + + + +# [3.0.0](https://github.com/yargs/yargs-parser/compare/v2.4.1...v3.0.0) (2016-08-07) + + +### Bug Fixes + +* parsing issue with numeric character in group of options ([#19](https://github.com/yargs/yargs-parser/issues/19)) ([f743236](https://github.com/yargs/yargs-parser/commit/f743236)) +* upgraded lodash.assign ([5d7fdf4](https://github.com/yargs/yargs-parser/commit/5d7fdf4)) + +### BREAKING CHANGES + +* subtle change to how values are parsed in a group of single-character arguments. +* _first released in 3.1.0, better handling of negative values should be considered a breaking change._ + + + + +## [2.4.1](https://github.com/yargs/yargs-parser/compare/v2.4.0...v2.4.1) (2016-07-16) + + +### Bug Fixes + +* **count:** do not increment a default value ([#39](https://github.com/yargs/yargs-parser/issues/39)) ([b04a189](https://github.com/yargs/yargs-parser/commit/b04a189)) + + + + +# [2.4.0](https://github.com/yargs/yargs-parser/compare/v2.3.0...v2.4.0) (2016-04-11) + + +### Features + +* **environment:** Support nested options in environment variables ([#26](https://github.com/yargs/yargs-parser/issues/26)) thanks [@elas7](https://github.com/elas7) \o/ ([020778b](https://github.com/yargs/yargs-parser/commit/020778b)) + + + + +# [2.3.0](https://github.com/yargs/yargs-parser/compare/v2.2.0...v2.3.0) (2016-04-09) + + +### Bug Fixes + +* **boolean:** fix for boolean options with non boolean defaults (#20) ([2dbe86b](https://github.com/yargs/yargs-parser/commit/2dbe86b)), closes [(#20](https://github.com/(/issues/20) +* **package:** remove tests from tarball ([0353c0d](https://github.com/yargs/yargs-parser/commit/0353c0d)) +* **parsing:** handle calling short option with an empty string as the next value. ([a867165](https://github.com/yargs/yargs-parser/commit/a867165)) +* boolean flag when next value contains the strings 'true' or 'false'. ([69941a6](https://github.com/yargs/yargs-parser/commit/69941a6)) +* update dependencies; add standard-version bin for next release (#24) ([822d9d5](https://github.com/yargs/yargs-parser/commit/822d9d5)) + +### Features + +* **configuration:** Allow to pass configuration objects to yargs-parser ([0780900](https://github.com/yargs/yargs-parser/commit/0780900)) +* **normalize:** allow normalize to work with arrays ([e0eaa1a](https://github.com/yargs/yargs-parser/commit/e0eaa1a)) diff --git a/node_modules/nyc/node_modules/yargs-parser/LICENSE.txt b/node_modules/nyc/node_modules/yargs-parser/LICENSE.txt new file mode 100644 index 0000000..836440b --- /dev/null +++ b/node_modules/nyc/node_modules/yargs-parser/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/nyc/node_modules/yargs-parser/README.md b/node_modules/nyc/node_modules/yargs-parser/README.md new file mode 100644 index 0000000..bae61c2 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs-parser/README.md @@ -0,0 +1,449 @@ +# yargs-parser + +[![Build Status](https://travis-ci.org/yargs/yargs-parser.svg)](https://travis-ci.org/yargs/yargs-parser) +[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + + +The mighty option parser used by [yargs](https://github.com/yargs/yargs). + +visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. + + + +## Example + +```sh +npm i yargs-parser --save +``` + +```js +var argv = require('yargs-parser')(process.argv.slice(2)) +console.log(argv) +``` + +```sh +node example.js --foo=33 --bar hello +{ _: [], foo: 33, bar: 'hello' } +``` + +_or parse a string!_ + +```js +var argv = require('yargs-parser')('--foo=99 --bar=33') +console.log(argv) +``` + +```sh +{ _: [], foo: 99, bar: 33 } +``` + +Convert an array of mixed types before passing to `yargs-parser`: + +```js +var parse = require('yargs-parser') +parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string +parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings +``` + +## API + +### require('yargs-parser')(args, opts={}) + +Parses command line arguments returning a simple mapping of keys and values. + +**expects:** + +* `args`: a string or array of strings representing the options to parse. +* `opts`: provide a set of hints indicating how `args` should be parsed: + * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. + * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
+ Indicate that keys should be parsed as an array and coerced to booleans / numbers:
+ `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. + * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. + * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided + (or throws an error). For arrays the function is called only once for the entire array:
+ `{coerce: {foo: function (arg) {return modifiedArg}}}`. + * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). + * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:
+ `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. + * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). + * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. + * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. + * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. + * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. + * `opts.normalize`: `path.normalize()` will be applied to values set to this key. + * `opts.number`: keys should be treated as numbers. + * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). + +**returns:** + +* `obj`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. + * [optional] `--`: an array with arguments after the end-of-options flag `--`. + +### require('yargs-parser').detailed(args, opts={}) + +Parses a command line string, returning detailed information required by the +yargs engine. + +**expects:** + +* `args`: a string or array of strings representing options to parse. +* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. + +**returns:** + +* `argv`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. + * [optional] `--`: an array with arguments after the end-of-options flag `--`. +* `error`: populated with an error object if an exception occurred during parsing. +* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. +* `newAliases`: any new aliases added via camel-case expansion: + * `boolean`: `{ fooBar: true }` +* `defaulted`: any new argument created by `opts.default`, no aliases included. + * `boolean`: `{ foo: true }` +* `configuration`: given by default settings and `opts.configuration`. + + + +### Configuration + +The yargs-parser applies several automated transformations on the keys provided +in `args`. These features can be turned on and off using the `configuration` field +of `opts`. + +```js +var parsed = parser(['--no-dice'], { + configuration: { + 'boolean-negation': false + } +}) +``` + +### short option groups + +* default: `true`. +* key: `short-option-groups`. + +Should a group of short-options be treated as boolean flags? + +```sh +node example.js -abc +{ _: [], a: true, b: true, c: true } +``` + +_if disabled:_ + +```sh +node example.js -abc +{ _: [], abc: true } +``` + +### camel-case expansion + +* default: `true`. +* key: `camel-case-expansion`. + +Should hyphenated arguments be expanded into camel-case aliases? + +```sh +node example.js --foo-bar +{ _: [], 'foo-bar': true, fooBar: true } +``` + +_if disabled:_ + +```sh +node example.js --foo-bar +{ _: [], 'foo-bar': true } +``` + +### dot-notation + +* default: `true` +* key: `dot-notation` + +Should keys that contain `.` be treated as objects? + +```sh +node example.js --foo.bar +{ _: [], foo: { bar: true } } +``` + +_if disabled:_ + +```sh +node example.js --foo.bar +{ _: [], "foo.bar": true } +``` + +### parse numbers + +* default: `true` +* key: `parse-numbers` + +Should keys that look like numbers be treated as such? + +```sh +node example.js --foo=99.3 +{ _: [], foo: 99.3 } +``` + +_if disabled:_ + +```sh +node example.js --foo=99.3 +{ _: [], foo: "99.3" } +``` + +### boolean negation + +* default: `true` +* key: `boolean-negation` + +Should variables prefixed with `--no` be treated as negations? + +```sh +node example.js --no-foo +{ _: [], foo: false } +``` + +_if disabled:_ + +```sh +node example.js --no-foo +{ _: [], "no-foo": true } +``` + +### combine arrays + +* default: `false` +* key: `combine-arrays` + +Should arrays be combined when provided by both command line arguments and +a configuration file. + +### duplicate arguments array + +* default: `true` +* key: `duplicate-arguments-array` + +Should arguments be coerced into an array when duplicated: + +```sh +node example.js -x 1 -x 2 +{ _: [], x: [1, 2] } +``` + +_if disabled:_ + +```sh +node example.js -x 1 -x 2 +{ _: [], x: 2 } +``` + +### flatten duplicate arrays + +* default: `true` +* key: `flatten-duplicate-arrays` + +Should array arguments be coerced into a single array when duplicated: + +```sh +node example.js -x 1 2 -x 3 4 +{ _: [], x: [1, 2, 3, 4] } +``` + +_if disabled:_ + +```sh +node example.js -x 1 2 -x 3 4 +{ _: [], x: [[1, 2], [3, 4]] } +``` + +### greedy arrays + +* default: `true` +* key: `greedy-arrays` + +Should arrays consume more than one positional argument following their flag. + +```sh +node example --arr 1 2 +{ _[], arr: [1, 2] } +``` + +_if disabled:_ + +```sh +node example --arr 1 2 +{ _[2], arr: [1] } +``` + +**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** + +### nargs eats options + +* default: `false` +* key: `nargs-eats-options` + +Should nargs consume dash options as well as positional arguments. + +### negation prefix + +* default: `no-` +* key: `negation-prefix` + +The prefix to use for negated boolean variables. + +```sh +node example.js --no-foo +{ _: [], foo: false } +``` + +_if set to `quux`:_ + +```sh +node example.js --quuxfoo +{ _: [], foo: false } +``` + +### populate -- + +* default: `false`. +* key: `populate--` + +Should unparsed flags be stored in `--` or `_`. + +_If disabled:_ + +```sh +node example.js a -b -- x y +{ _: [ 'a', 'x', 'y' ], b: true } +``` + +_If enabled:_ + +```sh +node example.js a -b -- x y +{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true } +``` + +### set placeholder key + +* default: `false`. +* key: `set-placeholder-key`. + +Should a placeholder be added for keys not set via the corresponding CLI argument? + +_If disabled:_ + +```sh +node example.js -a 1 -c 2 +{ _: [], a: 1, c: 2 } +``` + +_If enabled:_ + +```sh +node example.js -a 1 -c 2 +{ _: [], a: 1, b: undefined, c: 2 } +``` + +### halt at non-option + +* default: `false`. +* key: `halt-at-non-option`. + +Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. + +_If disabled:_ + +```sh +node example.js -a run b -x y +{ _: [ 'b' ], a: 'run', x: 'y' } +``` + +_If enabled:_ + +```sh +node example.js -a run b -x y +{ _: [ 'b', '-x', 'y' ], a: 'run' } +``` + +### strip aliased + +* default: `false` +* key: `strip-aliased` + +Should aliases be removed before returning results? + +_If disabled:_ + +```sh +node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } +``` + +_If enabled:_ + +```sh +node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +### strip dashed + +* default: `false` +* key: `strip-dashed` + +Should dashed keys be removed before returning results? This option has no effect if +`camel-case-expansion` is disabled. + +_If disabled:_ + +```sh +node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +_If enabled:_ + +```sh +node example.js --test-field 1 +{ _: [], testField: 1 } +``` + +### unknown options as args + +* default: `false` +* key: `unknown-options-as-args` + +Should unknown options be treated like regular arguments? An unknown option is one that is not +configured in `opts`. + +_If disabled_ + +```sh +node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } +``` + +_If enabled_ + +```sh +node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } +``` + +## Special Thanks + +The yargs project evolves from optimist and minimist. It owes its +existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ + +## License + +ISC diff --git a/node_modules/nyc/node_modules/yargs-parser/index.js b/node_modules/nyc/node_modules/yargs-parser/index.js new file mode 100644 index 0000000..c14c1fc --- /dev/null +++ b/node_modules/nyc/node_modules/yargs-parser/index.js @@ -0,0 +1,1032 @@ +const camelCase = require('camelcase') +const decamelize = require('decamelize') +const path = require('path') +const tokenizeArgString = require('./lib/tokenize-arg-string') +const util = require('util') + +function parse (args, opts) { + opts = Object.assign(Object.create(null), opts) + // allow a string argument to be passed in rather + // than an argv array. + args = tokenizeArgString(args) + + // aliases might have transitive relationships, normalize this. + const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)) + const configuration = Object.assign({ + 'boolean-negation': true, + 'camel-case-expansion': true, + 'combine-arrays': false, + 'dot-notation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true, + 'greedy-arrays': true, + 'halt-at-non-option': false, + 'nargs-eats-options': false, + 'negation-prefix': 'no-', + 'parse-numbers': true, + 'populate--': false, + 'set-placeholder-key': false, + 'short-option-groups': true, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false + }, opts.configuration) + const defaults = Object.assign(Object.create(null), opts.default) + const configObjects = opts.configObjects || [] + const envPrefix = opts.envPrefix + const notFlagsOption = configuration['populate--'] + const notFlagsArgv = notFlagsOption ? '--' : '_' + const newAliases = Object.create(null) + const defaulted = Object.create(null) + // allow a i18n handler to be passed in, default to a fake one (util.format). + const __ = opts.__ || util.format + const flags = { + aliases: Object.create(null), + arrays: Object.create(null), + bools: Object.create(null), + strings: Object.create(null), + numbers: Object.create(null), + counts: Object.create(null), + normalize: Object.create(null), + configs: Object.create(null), + nargs: Object.create(null), + coercions: Object.create(null), + keys: [] + } + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/ + const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)') + + ;[].concat(opts.array).filter(Boolean).forEach(function (opt) { + const key = opt.key || opt + + // assign to flags[bools|strings|numbers] + const assignment = Object.keys(opt).map(function (key) { + return ({ + boolean: 'bools', + string: 'strings', + number: 'numbers' + })[key] + }).filter(Boolean).pop() + + // assign key to be coerced + if (assignment) { + flags[assignment][key] = true + } + + flags.arrays[key] = true + flags.keys.push(key) + }) + + ;[].concat(opts.boolean).filter(Boolean).forEach(function (key) { + flags.bools[key] = true + flags.keys.push(key) + }) + + ;[].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true + flags.keys.push(key) + }) + + ;[].concat(opts.number).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true + flags.keys.push(key) + }) + + ;[].concat(opts.count).filter(Boolean).forEach(function (key) { + flags.counts[key] = true + flags.keys.push(key) + }) + + ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true + flags.keys.push(key) + }) + + Object.keys(opts.narg || {}).forEach(function (k) { + flags.nargs[k] = opts.narg[k] + flags.keys.push(k) + }) + + Object.keys(opts.coerce || {}).forEach(function (k) { + flags.coercions[k] = opts.coerce[k] + flags.keys.push(k) + }) + + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + ;[].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true + }) + } else { + Object.keys(opts.config || {}).forEach(function (k) { + flags.configs[k] = opts.config[k] + }) + } + + // create a lookup table that takes into account all + // combinations of aliases: {f: ['foo'], foo: ['f']} + extendAliases(opts.key, aliases, opts.default, flags.arrays) + + // apply default values to all aliases. + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key] + }) + }) + + let error = null + checkConfiguration() + + let notFlags = [] + + const argv = Object.assign(Object.create(null), { _: [] }) + // TODO(bcoe): for the first pass at removing object prototype we didn't + // remove all prototypes from objects returned by this API, we might want + // to gradually move towards doing so. + const argvReturn = {} + + for (let i = 0; i < args.length; i++) { + const arg = args[i] + let broken + let key + let letters + let m + let next + let value + + // any unknown option (except for end-of-options, "--") + if (arg !== '--' && isUnknownOptionAsArg(arg)) { + argv._.push(arg) + // -- separated by = + } else if (arg.match(/^--.+=/) || ( + !configuration['short-option-groups'] && arg.match(/^-.+=/) + )) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + m = arg.match(/^--?([^=]+)=([\s\S]*)$/) + + // arrays format = '--f=a b c' + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]) + } else if (checkAllAliases(m[1], flags.nargs) !== false) { + // nargs format = '--f=monkey washing cat' + i = eatNargs(i, m[1], args, m[2]) + } else { + setArg(m[1], m[2]) + } + } else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { + key = arg.match(negatedBoolean)[1] + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false) + + // -- separated by space. + } else if (arg.match(/^--.+/) || ( + !configuration['short-option-groups'] && arg.match(/^-[^-]+/) + )) { + key = arg.match(/^--?(.+)/)[1] + + if (checkAllAliases(key, flags.arrays)) { + // array format = '--foo a b c' + i = eatArray(i, key, args) + } else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '--foo a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args) + } else { + next = args[i + 1] + + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next) + i++ + } else if (/^(true|false)$/.test(next)) { + setArg(key, next) + i++ + } else { + setArg(key, defaultValue(key)) + } + } + + // dot-notation flag separated by '='. + } else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/) + setArg(m[1], m[2]) + + // dot-notation flag separated by space. + } else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1] + key = arg.match(/^-(.\..+)/)[1] + + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next) + i++ + } else { + setArg(key, defaultValue(key)) + } + } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split('') + broken = false + + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2) + + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3) + key = letters[j] + + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f=a b c' + i = eatArray(i, key, args, value) + } else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f=monkey washing cat' + i = eatNargs(i, key, args, value) + } else { + setArg(key, value) + } + + broken = true + break + } + + if (next === '-') { + setArg(letters[j], next) + continue + } + + // current letter is an alphabetic character and next value is a number + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next) + broken = true + break + } + + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next) + broken = true + break + } else { + setArg(letters[j], defaultValue(letters[j])) + } + } + + key = arg.slice(-1)[0] + + if (!broken && key !== '-') { + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f a b c' + i = eatArray(i, key, args) + } else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args) + } else { + next = args[i + 1] + + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next) + i++ + } else if (/^(true|false)$/.test(next)) { + setArg(key, next) + i++ + } else { + setArg(key, defaultValue(key)) + } + } + } + } else if (arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools)) { + // single-digit boolean alias, e.g: xargs -0 + key = arg.slice(1) + setArg(key, defaultValue(key)) + } else if (arg === '--') { + notFlags = args.slice(i + 1) + break + } else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i) + break + } else { + argv._.push(maybeCoerceNumber('_', arg)) + } + } + + // order of precedence: + // 1. command line arg + // 2. value from env var + // 3. value from config file + // 4. value from config objects + // 5. configured default value + applyEnvVars(argv, true) // special case: check env vars that point to config file + applyEnvVars(argv, false) + setConfig(argv) + setConfigObjects() + applyDefaultsAndAliases(argv, flags.aliases, defaults, true) + applyCoercions(argv) + if (configuration['set-placeholder-key']) setPlaceholderKeys(argv) + + // for any counts either not in args or without an explicit default, set to 0 + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) setArg(key, 0) + }) + + // '--' defaults to undefined. + if (notFlagsOption && notFlags.length) argv[notFlagsArgv] = [] + notFlags.forEach(function (key) { + argv[notFlagsArgv].push(key) + }) + + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key] + }) + } + + if (configuration['strip-aliased']) { + ;[].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion']) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')] + } + + delete argv[alias] + }) + } + + // how many arguments should we consume, based + // on the nargs option? + function eatNargs (i, key, args, argAfterEqualSign) { + let ii + let toEat = checkAllAliases(key, flags.nargs) + // NaN has a special meaning for the array type, indicating that one or + // more values are expected. + toEat = isNaN(toEat) ? 1 : toEat + + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error(__('Argument unexpected for: %s', key)) + } + setArg(key, defaultValue(key)) + return i + } + + let available = isUndefined(argAfterEqualSign) ? 0 : 1 + if (configuration['nargs-eats-options']) { + // classic behavior, yargs eats positional and dash arguments. + if (args.length - (i + 1) + available < toEat) { + error = Error(__('Not enough arguments following: %s', key)) + } + available = toEat + } else { + // nargs will not consume flag arguments, e.g., -abc, --foo, + // and terminates when one is observed. + for (ii = i + 1; ii < args.length; ii++) { + if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) available++ + else break + } + if (available < toEat) error = Error(__('Not enough arguments following: %s', key)) + } + + let consumed = Math.min(available, toEat) + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign) + consumed-- + } + for (ii = i + 1; ii < (consumed + i + 1); ii++) { + setArg(key, args[ii]) + } + + return (i + consumed) + } + + // if an option is an array, eat all non-hyphenated arguments + // following it... YUM! + // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] + function eatArray (i, key, args, argAfterEqualSign) { + let argsToSet = [] + let next = argAfterEqualSign || args[i + 1] + // If both array and nargs are configured, enforce the nargs count: + const nargsCount = checkAllAliases(key, flags.nargs) + + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true) + } else if (isUndefined(next) || + (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + // for keys without value ==> argsToSet remains an empty [] + // set user default value, if available + if (defaults[key] !== undefined) { + const defVal = defaults[key] + argsToSet = Array.isArray(defVal) ? defVal : [defVal] + } + } else { + // value in --option=value is eaten as is + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push(processValue(key, argAfterEqualSign)) + } + for (let ii = i + 1; ii < args.length; ii++) { + if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || + (nargsCount && argsToSet.length >= nargsCount)) break + next = args[ii] + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break + i = ii + argsToSet.push(processValue(key, next)) + } + } + + // If both array and nargs are configured, create an error if less than + // nargs positionals were found. NaN has special meaning, indicating + // that at least one value is required (more are okay). + if ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0)) { + error = Error(__('Not enough arguments following: %s', key)) + } + + setArg(key, argsToSet) + return i + } + + function setArg (key, val) { + if (/-/.test(key) && configuration['camel-case-expansion']) { + const alias = key.split('.').map(function (prop) { + return camelCase(prop) + }).join('.') + addNewAlias(key, alias) + } + + const value = processValue(key, val) + const splitKey = key.split('.') + setKey(argv, splitKey, value) + + // handle populating aliases of the full key + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + x = x.split('.') + setKey(argv, x, value) + }) + } + + // handle populating aliases of the first element of the dot-notation key + if (splitKey.length > 1 && configuration['dot-notation']) { + ;(flags.aliases[splitKey[0]] || []).forEach(function (x) { + x = x.split('.') + + // expand alias with nested objects in key + const a = [].concat(splitKey) + a.shift() // nuke the old key. + x = x.concat(a) + + // populate alias only if is not already an alias of the full key + // (already populated above) + if (!(flags.aliases[key] || []).includes(x.join('.'))) { + setKey(argv, x, value) + } + }) + } + + // Set normalize getter and setter when key is in 'normalize' but isn't an array + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + const keys = [key].concat(flags.aliases[key] || []) + keys.forEach(function (key) { + Object.defineProperty(argvReturn, key, { + enumerable: true, + get () { + return val + }, + set (value) { + val = typeof value === 'string' ? path.normalize(value) : value + } + }) + }) + } + } + + function addNewAlias (key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias] + newAliases[alias] = true + } + if (!(flags.aliases[alias] && flags.aliases[alias].length)) { + addNewAlias(alias, key) + } + } + + function processValue (key, val) { + // strings may be quoted, clean this up as we assign values. + if (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0] + ) { + val = val.substring(1, val.length - 1) + } + + // handle parsing boolean arguments --foo=true --bar false. + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') val = val === 'true' + } + + let value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v) }) + : maybeCoerceNumber(key, val) + + // increment a count given as arg (either no value or value parsed as boolean) + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment + } + + // Set normalized value when key is in 'normalize' and in 'arrays' + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) value = val.map(path.normalize) + else value = path.normalize(val) + } + return value + } + + function maybeCoerceNumber (key, value) { + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { + const shouldCoerceNumber = isNumber(value) && configuration['parse-numbers'] && ( + Number.isSafeInteger(Math.floor(value)) + ) + if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) value = Number(value) + } + return value + } + + // set args from config.json file, this should be + // applied last so that defaults can be applied. + function setConfig (argv) { + const configLookup = Object.create(null) + + // expand defaults/aliases, in-case any happen to reference + // the config.json file. + applyDefaultsAndAliases(configLookup, flags.aliases, defaults) + + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = argv[configKey] || configLookup[configKey] + if (configPath) { + try { + let config = null + const resolvedConfigPath = path.resolve(process.cwd(), configPath) + + if (typeof flags.configs[configKey] === 'function') { + try { + config = flags.configs[configKey](resolvedConfigPath) + } catch (e) { + config = e + } + if (config instanceof Error) { + error = config + return + } + } else { + config = require(resolvedConfigPath) + } + + setConfigObject(config) + } catch (ex) { + if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath)) + } + } + }) + } + + // set args from config object. + // it recursively checks nested objects. + function setConfigObject (config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key] + const fullKey = prev ? prev + '.' + key : key + + // if the value is an inner object and we have dot-notation + // enabled, treat inner objects in config the same as + // heavily nested dot notations (foo.bar.apple). + if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { + // if the value is an object but not an array, check nested object + setConfigObject(value, fullKey) + } else { + // setting arguments via CLI takes precedence over + // values within the config file. + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { + setArg(fullKey, value) + } + } + }) + } + + // set all config objects passed in opts + function setConfigObjects () { + if (typeof configObjects === 'undefined') return + configObjects.forEach(function (configObject) { + setConfigObject(configObject) + }) + } + + function applyEnvVars (argv, configOnly) { + if (typeof envPrefix === 'undefined') return + + const prefix = typeof envPrefix === 'string' ? envPrefix : '' + Object.keys(process.env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + // get array of nested keys and convert them to camel case + const keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length) + } + return camelCase(key) + }) + + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { + setArg(keys.join('.'), process.env[envVar]) + } + } + }) + } + + function applyCoercions (argv) { + let coerce + const applied = new Set() + Object.keys(argv).forEach(function (key) { + if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases + coerce = checkAllAliases(key, flags.coercions) + if (typeof coerce === 'function') { + try { + const value = maybeCoerceNumber(key, coerce(argv[key])) + ;([].concat(flags.aliases[key] || [], key)).forEach(ali => { + applied.add(ali) + argv[ali] = value + }) + } catch (err) { + error = err + } + } + } + }) + } + + function setPlaceholderKeys (argv) { + flags.keys.forEach((key) => { + // don't set placeholder keys for dot notation options 'foo.bar'. + if (~key.indexOf('.')) return + if (typeof argv[key] === 'undefined') argv[key] = undefined + }) + return argv + } + + function applyDefaultsAndAliases (obj, aliases, defaults, canLog = false) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]) + if (canLog) defaulted[key] = true + + ;(aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) return + setKey(obj, x.split('.'), defaults[key]) + }) + } + }) + } + + function hasKey (obj, keys) { + let o = obj + + if (!configuration['dot-notation']) keys = [keys.join('.')] + + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}) + }) + + const key = keys[keys.length - 1] + + if (typeof o !== 'object') return false + else return key in o + } + + function setKey (obj, keys, value) { + let o = obj + + if (!configuration['dot-notation']) keys = [keys.join('.')] + + keys.slice(0, -1).forEach(function (key, index) { + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + key = sanitizeKey(key) + + if (typeof o === 'object' && o[key] === undefined) { + o[key] = {} + } + + if (typeof o[key] !== 'object' || Array.isArray(o[key])) { + // ensure that o[key] is an array, and that the last item is an empty object. + if (Array.isArray(o[key])) { + o[key].push({}) + } else { + o[key] = [o[key], {}] + } + + // we want to update the empty object at the end of the o[key] array, so set o to that object + o = o[key][o[key].length - 1] + } else { + o = o[key] + } + }) + + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + const key = sanitizeKey(keys[keys.length - 1]) + + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays) + const isValueArray = Array.isArray(value) + let duplicate = configuration['duplicate-arguments-array'] + + // nargs has higher priority than duplicate + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined + } + } + + if (value === increment) { + o[key] = increment(o[key]) + } else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]) + } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value + } else { + o[key] = o[key].concat([value]) + } + } else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value] + } else if (duplicate && !( + o[key] === undefined || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools) + )) { + o[key] = [o[key], value] + } else { + o[key] = value + } + } + + // extend the aliases list with inferred aliases. + function extendAliases (...args) { + args.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + // short-circuit if we've already added a key + // to the aliases array, for example it might + // exist in both 'opts.default' and 'opts.key'. + if (flags.aliases[key]) return + + flags.aliases[key] = [].concat(aliases[key] || []) + // For "--option-name", also set argv.optionName + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + const c = camelCase(x) + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c) + newAliases[c] = true + } + } + }) + // For "--optionName", also set argv['option-name'] + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + const c = decamelize(x, '-') + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c) + newAliases[c] = true + } + } + }) + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y + })) + }) + }) + }) + } + + // return the 1st set flag for any of a key's aliases (or false if no flag set) + function checkAllAliases (key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key) + const keys = Object.keys(flag) + const setAlias = toCheck.find(key => keys.includes(key)) + return setAlias ? flag[setAlias] : false + } + + function hasAnyFlag (key) { + const toCheck = [].concat(Object.keys(flags).map(k => flags[k])) + return toCheck.some(function (flag) { + return Array.isArray(flag) ? flag.includes(key) : flag[key] + }) + } + + function hasFlagsMatching (arg, ...patterns) { + const toCheck = [].concat(...patterns) + return toCheck.some(function (pattern) { + const match = arg.match(pattern) + return match && hasAnyFlag(match[1]) + }) + } + + // based on a simplified version of the short flag group parsing logic + function hasAllShortFlags (arg) { + // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { return false } + let hasAllFlags = true + let next + const letters = arg.slice(1).split('') + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2) + + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false + break + } + + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break + } + } + return hasAllFlags + } + + function isUnknownOptionAsArg (arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg) + } + + function isUnknownOption (arg) { + // ignore negative numbers + if (arg.match(negative)) { return false } + // if this is a short option group and all of them are configured, it isn't unknown + if (hasAllShortFlags(arg)) { return false } + // e.g. '--count=2' + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/ + // e.g. '-a' or '--arg' + const normalFlag = /^-+([^=]+?)$/ + // e.g. '-a-' + const flagEndingInHyphen = /^-+([^=]+?)-$/ + // e.g. '-abc123' + const flagEndingInDigits = /^-+([^=]+?\d+)$/ + // e.g. '-a/usr/local' + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/ + // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters) + } + + // make a best effor to pick a default value + // for an option based on name and type. + function defaultValue (key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key] + } else { + return defaultForType(guessType(key)) + } + } + + // return a default value, given the type of a flag., + // e.g., key of type 'string' will default to '', rather than 'true'. + function defaultForType (type) { + const def = { + boolean: true, + string: '', + number: undefined, + array: [] + } + + return def[type] + } + + // given a flag, enforce a default type. + function guessType (key) { + let type = 'boolean' + if (checkAllAliases(key, flags.strings)) type = 'string' + else if (checkAllAliases(key, flags.numbers)) type = 'number' + else if (checkAllAliases(key, flags.bools)) type = 'boolean' + else if (checkAllAliases(key, flags.arrays)) type = 'array' + return type + } + + function isNumber (x) { + if (x === null || x === undefined) return false + // if loaded from config, may already be a number. + if (typeof x === 'number') return true + // hexadecimal. + if (/^0x[0-9a-f]+$/i.test(x)) return true + // don't treat 0123 as a number; as it drops the leading '0'. + if (x.length > 1 && x[0] === '0') return false + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) + } + + function isUndefined (num) { + return num === undefined + } + + // check user configuration settings for inconsistencies + function checkConfiguration () { + // count keys should not be set as array/narg + Object.keys(flags.counts).find(key => { + if (checkAllAliases(key, flags.arrays)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)) + return true + } else if (checkAllAliases(key, flags.nargs)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)) + return true + } + }) + } + + return { + argv: Object.assign(argvReturn, argv), + error: error, + aliases: Object.assign({}, flags.aliases), + newAliases: Object.assign({}, newAliases), + defaulted: Object.assign({}, defaulted), + configuration: configuration + } +} + +// if any aliases reference each other, we should +// merge them together. +function combineAliases (aliases) { + const aliasArrays = [] + const combined = Object.create(null) + let change = true + + // turn alias lookup hash {key: ['alias1', 'alias2']} into + // a simple array ['key', 'alias1', 'alias2'] + Object.keys(aliases).forEach(function (key) { + aliasArrays.push( + [].concat(aliases[key], key) + ) + }) + + // combine arrays until zero changes are + // made in an iteration. + while (change) { + change = false + for (let i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1 + }) + + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]) + aliasArrays.splice(ii, 1) + change = true + break + } + } + } + } + + // map arrays back to the hash-lookup (de-dupe while + // we're at it). + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i + }) + combined[aliasArray.pop()] = aliasArray + }) + + return combined +} + +// this function should only be called when a count is given as an arg +// it is NOT called to set a default value +// thus we can start the count at 1 instead of 0 +function increment (orig) { + return orig !== undefined ? orig + 1 : 1 +} + +function Parser (args, opts) { + const result = parse(args.slice(), opts) + return result.argv +} + +// parse arguments and return detailed +// meta information, aliases, etc. +Parser.detailed = function (args, opts) { + return parse(args.slice(), opts) +} + +// TODO(bcoe): in the next major version of yargs, switch to +// Object.create(null) for dot notation: +function sanitizeKey (key) { + if (key === '__proto__') return '___proto___' + return key +} + +module.exports = Parser diff --git a/node_modules/nyc/node_modules/yargs-parser/lib/tokenize-arg-string.js b/node_modules/nyc/node_modules/yargs-parser/lib/tokenize-arg-string.js new file mode 100644 index 0000000..260c67c --- /dev/null +++ b/node_modules/nyc/node_modules/yargs-parser/lib/tokenize-arg-string.js @@ -0,0 +1,40 @@ +// take an un-split argv string and tokenize it. +module.exports = function (argString) { + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e) + } + + argString = argString.trim() + + let i = 0 + let prevC = null + let c = null + let opening = null + const args = [] + + for (let ii = 0; ii < argString.length; ii++) { + prevC = c + c = argString.charAt(ii) + + // split on spaces unless we're in quotes. + if (c === ' ' && !opening) { + if (!(prevC === ' ')) { + i++ + } + continue + } + + // don't split the string if we're in matching + // opening or closing single and double quotes. + if (c === opening) { + opening = null + } else if ((c === "'" || c === '"') && !opening) { + opening = c + } + + if (!args[i]) args[i] = '' + args[i] += c + } + + return args +} diff --git a/node_modules/nyc/node_modules/yargs-parser/package.json b/node_modules/nyc/node_modules/yargs-parser/package.json new file mode 100644 index 0000000..636ff17 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs-parser/package.json @@ -0,0 +1,46 @@ +{ + "name": "yargs-parser", + "version": "18.1.3", + "description": "the mighty option parser used by yargs", + "main": "index.js", + "scripts": { + "fix": "standard --fix", + "test": "c8 --reporter=text --reporter=html mocha test/*.js", + "posttest": "standard", + "coverage": "c8 report --check-coverage check-coverage --lines=100 --branches=97 --statements=100" + }, + "repository": { + "type": "git", + "url": "https://github.com/yargs/yargs-parser.git" + }, + "keywords": [ + "argument", + "parser", + "yargs", + "command", + "cli", + "parsing", + "option", + "args", + "argument" + ], + "author": "Ben Coe ", + "license": "ISC", + "devDependencies": { + "c8": "^7.0.1", + "chai": "^4.2.0", + "mocha": "^7.0.0", + "standard": "^14.3.1" + }, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "files": [ + "lib", + "index.js" + ], + "engines": { + "node": ">=6" + } +} diff --git a/node_modules/nyc/node_modules/yargs/CHANGELOG.md b/node_modules/nyc/node_modules/yargs/CHANGELOG.md new file mode 100644 index 0000000..a010cf3 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/CHANGELOG.md @@ -0,0 +1,420 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [15.4.0](https://www.github.com/yargs/yargs/compare/v15.3.1...v15.4.0) (2020-06-30) + + +### Features + +* adds deprecation option for commands ([027a636](https://www.github.com/yargs/yargs/commit/027a6365b737e13116811a8ef43670196e1fa00a)) +* support array of examples ([#1682](https://www.github.com/yargs/yargs/issues/1682)) ([225ab82](https://www.github.com/yargs/yargs/commit/225ab8271938bed3a48d23175f3d580ce8cd1306)) + + +### Bug Fixes + +* **docs:** describe usage of `.check()` in more detail ([932cd11](https://www.github.com/yargs/yargs/commit/932cd1177e93f5cc99edfe57a4028e30717bf8fb)) +* **i18n:** Japanese translation phrasing ([#1619](https://www.github.com/yargs/yargs/issues/1619)) ([0894175](https://www.github.com/yargs/yargs/commit/089417550ef5a5b8ce3578dd2a989191300b64cd)) +* **strict mode:** report default command unknown arguments ([#1626](https://www.github.com/yargs/yargs/issues/1626)) ([69f29a9](https://www.github.com/yargs/yargs/commit/69f29a9cd429d4bb99481238305390107ac75b02)) +* **usage:** translate 'options' group only when displaying help ([#1600](https://www.github.com/yargs/yargs/issues/1600)) ([e60b39b](https://www.github.com/yargs/yargs/commit/e60b39b9d3a912c06db43f87c86ba894142b6c1c)) + + +### Reverts + +* Revert "chore(deps): update dependency eslint to v7 (#1656)" (#1673) ([34949f8](https://www.github.com/yargs/yargs/commit/34949f89ee7cdf88f7b315659df4b5f62f714842)), closes [#1656](https://www.github.com/yargs/yargs/issues/1656) [#1673](https://www.github.com/yargs/yargs/issues/1673) + +### [15.3.1](https://www.github.com/yargs/yargs/compare/v15.3.0...v15.3.1) (2020-03-16) + + +### Bug Fixes + +* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential +prototype pollution vulnerability. This was reported by the Snyk Security Research Team. ([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2)) + +## [15.3.0](https://www.github.com/yargs/yargs/compare/v15.2.0...v15.3.0) (2020-03-08) + + +### Features + +* **yargs-parser:** introduce single-digit boolean aliases ([#1576](https://www.github.com/yargs/yargs/issues/1576)) ([3af7f04](https://www.github.com/yargs/yargs/commit/3af7f04cdbfcbd4b3f432aca5144d43f21958c39)) +* add usage for single-digit boolean aliases ([#1580](https://www.github.com/yargs/yargs/issues/1580)) ([6014e39](https://www.github.com/yargs/yargs/commit/6014e39bca3a1e8445aa0fb2a435f6181e344c45)) + + +### Bug Fixes + +* address ambiguity between nargs of 1 and requiresArg ([#1572](https://www.github.com/yargs/yargs/issues/1572)) ([a5edc32](https://www.github.com/yargs/yargs/commit/a5edc328ecb3f90d1ba09cfe70a0040f68adf50a)) + +## [15.2.0](https://www.github.com/yargs/yargs/compare/v15.1.0...v15.2.0) (2020-03-01) + + +### ⚠ BREAKING CHANGES + +* **deps:** yargs-parser@17.0.0 no longer implicitly creates arrays out of boolean +arguments when duplicates are provided + +### Features + +* **completion:** takes negated flags into account when boolean-negation is set ([#1509](https://www.github.com/yargs/yargs/issues/1509)) ([7293ad5](https://www.github.com/yargs/yargs/commit/7293ad50d20ea0fb7dd1ac9b925e90e1bd95dea8)) +* **deps:** pull in yargs-parser@17.0.0 ([#1553](https://www.github.com/yargs/yargs/issues/1553)) ([b9409da](https://www.github.com/yargs/yargs/commit/b9409da199ebca515a848489c206b807fab2e65d)) +* deprecateOption ([#1559](https://www.github.com/yargs/yargs/issues/1559)) ([8aae333](https://www.github.com/yargs/yargs/commit/8aae3332251d09fa136db17ef4a40d83fa052bc4)) +* display appropriate $0 for electron apps ([#1536](https://www.github.com/yargs/yargs/issues/1536)) ([d0e4379](https://www.github.com/yargs/yargs/commit/d0e437912917d6a66bb5128992fa2f566a5f830b)) +* introduces strictCommands() subset of strict mode ([#1540](https://www.github.com/yargs/yargs/issues/1540)) ([1d4cca3](https://www.github.com/yargs/yargs/commit/1d4cca395a98b395e6318f0505fc73bef8b01350)) +* **deps:** yargs-parser with 'greedy-array' configuration ([#1569](https://www.github.com/yargs/yargs/issues/1569)) ([a03a320](https://www.github.com/yargs/yargs/commit/a03a320dbf5c0ce33d829a857fc04a651c0bb53e)) + + +### Bug Fixes + +* help always displayed for the first command parsed having an async handler ([#1535](https://www.github.com/yargs/yargs/issues/1535)) ([d585b30](https://www.github.com/yargs/yargs/commit/d585b303a43746201b05c9c9fda94a444634df33)) +* **deps:** fix enumeration for normalized path arguments ([#1567](https://www.github.com/yargs/yargs/issues/1567)) ([0b5b1b0](https://www.github.com/yargs/yargs/commit/0b5b1b0e5f4f9baf393c48e9cc2bc85c1b67a47a)) +* **locales:** only translate default option group name ([acc16de](https://www.github.com/yargs/yargs/commit/acc16de6b846ea7332db753646a9cec76b589162)) +* **locales:** remove extra space in French for 'default' ([#1564](https://www.github.com/yargs/yargs/issues/1564)) ([ecfc2c4](https://www.github.com/yargs/yargs/commit/ecfc2c474575c6cdbc6d273c94c13181bd1dbaa6)) +* **translations:** add French translation for unknown command ([#1563](https://www.github.com/yargs/yargs/issues/1563)) ([18b0b75](https://www.github.com/yargs/yargs/commit/18b0b752424bf560271e670ff95a0f90c8386787)) +* **translations:** fix pluralization in error messages. ([#1557](https://www.github.com/yargs/yargs/issues/1557)) ([94fa38c](https://www.github.com/yargs/yargs/commit/94fa38cbab8d86943e87bf41d368ed56dffa6835)) +* **yargs:** correct support of bundled electron apps ([#1554](https://www.github.com/yargs/yargs/issues/1554)) ([a0b61ac](https://www.github.com/yargs/yargs/commit/a0b61ac21e2b554aa73dbf1a66d4a7af94047c2f)) + +## [15.1.0](https://www.github.com/yargs/yargs/compare/v15.0.2...v15.1.0) (2020-01-02) + + +### Features + +* **lang:** add Finnish localization (language code fi) ([222c8fe](https://www.github.com/yargs/yargs/commit/222c8fef2e2ad46e314c337dec96940f896bec35)) +* complete short options with a single dash ([#1507](https://www.github.com/yargs/yargs/issues/1507)) ([99011ab](https://www.github.com/yargs/yargs/commit/99011ab5ba90232506ece0a17e59e2001a1ab562)) +* onFinishCommand handler ([#1473](https://www.github.com/yargs/yargs/issues/1473)) ([fe380cd](https://www.github.com/yargs/yargs/commit/fe380cd356aa33aef0449facd59c22cab8930ac9)) + + +### Bug Fixes + +* getCompletion() was not working for options ([#1495](https://www.github.com/yargs/yargs/issues/1495)) ([463feb2](https://www.github.com/yargs/yargs/commit/463feb2870158eb9df670222b0f0a40a05cf18d0)) +* misspelling of package.json `engines` field ([0891d0e](https://www.github.com/yargs/yargs/commit/0891d0ed35b30c83a6d9e9f6a5c5f84d13c546a0)) +* populate positionals when unknown-options-as-args is set ([#1508](https://www.github.com/yargs/yargs/issues/1508)) ([bb0f2eb](https://www.github.com/yargs/yargs/commit/bb0f2eb996fa4e19d330b31a01c2036cafa99a7e)), closes [#1444](https://www.github.com/yargs/yargs/issues/1444) +* show 2 dashes on help for single digit option key or alias ([#1493](https://www.github.com/yargs/yargs/issues/1493)) ([63b3dd3](https://www.github.com/yargs/yargs/commit/63b3dd31a455d428902220c1992ae930e18aff5c)) +* **docs:** use recommended cjs import syntax for ts examples ([#1513](https://www.github.com/yargs/yargs/issues/1513)) ([f9a18bf](https://www.github.com/yargs/yargs/commit/f9a18bfd624a5013108084f690cd8a1de794c430)) + +### [15.0.2](https://www.github.com/yargs/yargs/compare/v15.0.1...v15.0.2) (2019-11-19) + + +### Bug Fixes + +* temporary fix for libraries that call Object.freeze() ([#1483](https://www.github.com/yargs/yargs/issues/1483)) ([99c2dc8](https://www.github.com/yargs/yargs/commit/99c2dc850e67c606644f8b0c0bca1a59c87dcbcd)) + +### [15.0.1](https://www.github.com/yargs/yargs/compare/v15.0.0...v15.0.1) (2019-11-16) + + +### Bug Fixes + +* **deps:** cliui, find-up, and string-width, all drop Node 6 support ([#1479](https://www.github.com/yargs/yargs/issues/1479)) ([6a9ebe2](https://www.github.com/yargs/yargs/commit/6a9ebe2d955e3e979e76c07ffbb1c17fef64cb49)) + +## [15.0.0](https://www.github.com/yargs/yargs/compare/v14.2.0...v15.0.0) (2019-11-10) + + +### ⚠ BREAKING CHANGES + +* **deps:** yargs-parser now throws on invalid combinations of config (#1470) +* yargs-parser@16.0.0 drops support for Node 6 +* drop Node 6 support (#1461) +* remove package.json-based parserConfiguration (#1460) + +### Features + +* **deps:** yargs-parser now throws on invalid combinations of config ([#1470](https://www.github.com/yargs/yargs/issues/1470)) ([c10c38c](https://www.github.com/yargs/yargs/commit/c10c38cca04298f96b55a7e374a9a134abefffa7)) +* expose `Parser` from `require('yargs/yargs')` ([#1477](https://www.github.com/yargs/yargs/issues/1477)) ([1840ba2](https://www.github.com/yargs/yargs/commit/1840ba22f1a24c0ece8e32bbd31db4134a080aee)) + + +### Bug Fixes + +* **docs:** TypeScript import to prevent a future major release warning ([#1441](https://www.github.com/yargs/yargs/issues/1441)) ([b1b156a](https://www.github.com/yargs/yargs/commit/b1b156a3eb4ddd6803fbbd56c611a77919293000)) +* stop-parse was not being respected by commands ([#1459](https://www.github.com/yargs/yargs/issues/1459)) ([12c82e6](https://www.github.com/yargs/yargs/commit/12c82e62663e928148a7ee2f51629aa26a0f9bb2)) +* update to yargs-parser with fix for array default values ([#1463](https://www.github.com/yargs/yargs/issues/1463)) ([ebee59d](https://www.github.com/yargs/yargs/commit/ebee59d9022da538410e69a5c025019ed46d13d2)) +* **docs:** update boolean description and examples in docs ([#1474](https://www.github.com/yargs/yargs/issues/1474)) ([afd5b48](https://www.github.com/yargs/yargs/commit/afd5b4871bfeb90d58351ac56c5c44a83ef033e6)) + + +### Miscellaneous Chores + +* drop Node 6 support ([#1461](https://www.github.com/yargs/yargs/issues/1461)) ([2ba8ce0](https://www.github.com/yargs/yargs/commit/2ba8ce05e8fefbeffc6cb7488d9ebf6e86cceb1d)) + + +### Code Refactoring + +* remove package.json-based parserConfiguration ([#1460](https://www.github.com/yargs/yargs/issues/1460)) ([0d3642b](https://www.github.com/yargs/yargs/commit/0d3642b6f829b637938774c0c6ce5f6bfe1afa51)) + +## [14.2.0](https://github.com/yargs/yargs/compare/v14.1.0...v14.2.0) (2019-10-07) + + +### Bug Fixes + +* async middleware was called twice ([#1422](https://github.com/yargs/yargs/issues/1422)) ([9a42b63](https://github.com/yargs/yargs/commit/9a42b63)) +* fix promise check to accept any spec conform object ([#1424](https://github.com/yargs/yargs/issues/1424)) ([0be43d2](https://github.com/yargs/yargs/commit/0be43d2)) +* groups were not being maintained for nested commands ([#1430](https://github.com/yargs/yargs/issues/1430)) ([d38650e](https://github.com/yargs/yargs/commit/d38650e)) +* **docs:** broken markdown link ([#1426](https://github.com/yargs/yargs/issues/1426)) ([236e24e](https://github.com/yargs/yargs/commit/236e24e)) +* support merging deeply nested configuration ([#1423](https://github.com/yargs/yargs/issues/1423)) ([bae66fe](https://github.com/yargs/yargs/commit/bae66fe)) + + +### Features + +* **deps:** introduce yargs-parser with support for unknown-options-as-args ([#1440](https://github.com/yargs/yargs/issues/1440)) ([4d21520](https://github.com/yargs/yargs/commit/4d21520)) + +## [14.1.0](https://github.com/yargs/yargs/compare/v14.0.0...v14.1.0) (2019-09-06) + + +### Bug Fixes + +* **docs:** fix incorrect parserConfiguration documentation ([2a99124](https://github.com/yargs/yargs/commit/2a99124)) +* detect zsh when zsh isnt run as a login prompt ([#1395](https://github.com/yargs/yargs/issues/1395)) ([8792d13](https://github.com/yargs/yargs/commit/8792d13)) +* populate correct value on yargs.parsed and stop warning on access ([#1412](https://github.com/yargs/yargs/issues/1412)) ([bb0eb52](https://github.com/yargs/yargs/commit/bb0eb52)) +* showCompletionScript was logging script twice ([#1388](https://github.com/yargs/yargs/issues/1388)) ([07c8537](https://github.com/yargs/yargs/commit/07c8537)) +* strict() should not ignore hyphenated arguments ([#1414](https://github.com/yargs/yargs/issues/1414)) ([b774b5e](https://github.com/yargs/yargs/commit/b774b5e)) +* **docs:** formalize existing callback argument to showHelp ([#1386](https://github.com/yargs/yargs/issues/1386)) ([d217764](https://github.com/yargs/yargs/commit/d217764)) + + +### Features + +* make it possible to merge configurations when extending other config. ([#1411](https://github.com/yargs/yargs/issues/1411)) ([5d7ad98](https://github.com/yargs/yargs/commit/5d7ad98)) + +## [14.0.0](https://github.com/yargs/yargs/compare/v13.3.0...v14.0.0) (2019-07-30) + + +### ⚠ BREAKING CHANGES + +* we now only officially support yargs.$0 parameter and discourage direct access to yargs.parsed +* previously to this fix methods like `yargs.getOptions()` contained the state of the last command to execute. +* do not allow additional positionals in strict mode + +### Bug Fixes + +* calling parse multiple times now appropriately maintains state ([#1137](https://github.com/yargs/yargs/issues/1137)) ([#1369](https://github.com/yargs/yargs/issues/1369)) ([026b151](https://github.com/yargs/yargs/commit/026b151)) +* prefer user supplied script name in usage ([#1383](https://github.com/yargs/yargs/issues/1383)) ([28c74b9](https://github.com/yargs/yargs/commit/28c74b9)) +* **deps:** use decamelize from npm instead of vendored copy ([#1377](https://github.com/yargs/yargs/issues/1377)) ([015eeb9](https://github.com/yargs/yargs/commit/015eeb9)) +* **examples:** fix usage-options.js to reflect current API ([#1375](https://github.com/yargs/yargs/issues/1375)) ([6e5b76b](https://github.com/yargs/yargs/commit/6e5b76b)) +* do not allow additional positionals in strict mode ([35d777c](https://github.com/yargs/yargs/commit/35d777c)) +* properties accessed on singleton now reflect current state of instance ([#1366](https://github.com/yargs/yargs/issues/1366)) ([409d35b](https://github.com/yargs/yargs/commit/409d35b)) +* tolerate null prototype for config objects with `extends` ([#1376](https://github.com/yargs/yargs/issues/1376)) ([3d26d11](https://github.com/yargs/yargs/commit/3d26d11)), closes [#1372](https://github.com/yargs/yargs/issues/1372) +* yargs.parsed now populated before returning, when yargs.parse() called with no args (#1382) ([e3981fd](https://github.com/yargs/yargs/commit/e3981fd)), closes [#1382](https://github.com/yargs/yargs/issues/1382) + +### Features + +* adds support for multiple epilog messages ([#1384](https://github.com/yargs/yargs/issues/1384)) ([07a5554](https://github.com/yargs/yargs/commit/07a5554)) +* allow completionCommand to be set via showCompletionScript ([#1385](https://github.com/yargs/yargs/issues/1385)) ([5562853](https://github.com/yargs/yargs/commit/5562853)) + +## [13.3.0](https://www.github.com/yargs/yargs/compare/v13.2.4...v13.3.0) (2019-06-10) + + +### Bug Fixes + +* **deps:** yargs-parser update addressing several parsing bugs ([#1357](https://www.github.com/yargs/yargs/issues/1357)) ([e230d5b](https://www.github.com/yargs/yargs/commit/e230d5b)) + + +### Features + +* **i18n:** swap out os-locale dependency for simple inline implementation ([#1356](https://www.github.com/yargs/yargs/issues/1356)) ([4dfa19b](https://www.github.com/yargs/yargs/commit/4dfa19b)) +* support defaultDescription for positional arguments ([812048c](https://www.github.com/yargs/yargs/commit/812048c)) + +### [13.2.4](https://github.com/yargs/yargs/compare/v13.2.3...v13.2.4) (2019-05-13) + + +### Bug Fixes + +* **i18n:** rename unclear 'implication failed' to 'missing dependent arguments' ([#1317](https://github.com/yargs/yargs/issues/1317)) ([bf46813](https://github.com/yargs/yargs/commit/bf46813)) + + + +### [13.2.3](https://github.com/yargs/yargs/compare/v13.2.2...v13.2.3) (2019-05-05) + + +### Bug Fixes + +* **deps:** upgrade cliui for compatibility with latest chalk. ([#1330](https://github.com/yargs/yargs/issues/1330)) ([b20db65](https://github.com/yargs/yargs/commit/b20db65)) +* address issues with dutch translation ([#1316](https://github.com/yargs/yargs/issues/1316)) ([0295132](https://github.com/yargs/yargs/commit/0295132)) + + +### Tests + +* accept differently formatted output ([#1327](https://github.com/yargs/yargs/issues/1327)) ([c294d1b](https://github.com/yargs/yargs/commit/c294d1b)) + + + +## [13.2.2](https://github.com/yargs/yargs/compare/v13.2.1...v13.2.2) (2019-03-06) + + + +## [13.2.1](https://github.com/yargs/yargs/compare/v13.2.0...v13.2.1) (2019-02-18) + + +### Bug Fixes + +* add zsh script to files array ([3180224](https://github.com/yargs/yargs/commit/3180224)) +* support options/sub-commands in zsh completion ([0a96394](https://github.com/yargs/yargs/commit/0a96394)) + + +# [13.2.0](https://github.com/yargs/yargs/compare/v13.1.0...v13.2.0) (2019-02-15) + + +### Features + +* zsh auto completion ([#1292](https://github.com/yargs/yargs/issues/1292)) ([16c5d25](https://github.com/yargs/yargs/commit/16c5d25)), closes [#1156](https://github.com/yargs/yargs/issues/1156) + + + +# [13.1.0](https://github.com/yargs/yargs/compare/v13.0.0...v13.1.0) (2019-02-12) + + +### Features + +* add applyBeforeValidation, for applying sync middleware before validation ([5be206a](https://github.com/yargs/yargs/commit/5be206a)) + + + + +# [13.0.0](https://github.com/yargs/yargs/compare/v12.0.5...v13.0.0) (2019-02-02) + + +### Bug Fixes + +* **deps:** Update os-locale to avoid security vulnerability ([#1270](https://github.com/yargs/yargs/issues/1270)) ([27bf739](https://github.com/yargs/yargs/commit/27bf739)) +* **validation:** Use the error as a message when none exists otherwise ([#1268](https://github.com/yargs/yargs/issues/1268)) ([0510fe6](https://github.com/yargs/yargs/commit/0510fe6)) +* better bash path completion ([#1272](https://github.com/yargs/yargs/issues/1272)) ([da75ea2](https://github.com/yargs/yargs/commit/da75ea2)) +* middleware added multiple times due to reference bug ([#1282](https://github.com/yargs/yargs/issues/1282)) ([64af518](https://github.com/yargs/yargs/commit/64af518)) + + +### Chores + +* ~drop Node 6 from testing matrix ([#1287](https://github.com/yargs/yargs/issues/1287)) ([ef16792](https://github.com/yargs/yargs/commit/ef16792))~ + * _opting to not drop Node 6 support until April, [see](https://github.com/nodejs/Release)._ +* update dependencies ([#1284](https://github.com/yargs/yargs/issues/1284)) ([f25de4f](https://github.com/yargs/yargs/commit/f25de4f)) + + +### Features + +* Add `.parserConfiguration()` method, deprecating package.json config ([#1262](https://github.com/yargs/yargs/issues/1262)) ([3c6869a](https://github.com/yargs/yargs/commit/3c6869a)) +* adds config option for sorting command output ([#1256](https://github.com/yargs/yargs/issues/1256)) ([6916ce9](https://github.com/yargs/yargs/commit/6916ce9)) +* options/positionals with leading '+' and '0' no longer parse as numbers ([#1286](https://github.com/yargs/yargs/issues/1286)) ([e9dc3aa](https://github.com/yargs/yargs/commit/e9dc3aa)) +* support promises in middleware ([f3a4e4f](https://github.com/yargs/yargs/commit/f3a4e4f)) + + +### BREAKING CHANGES + +* options with leading '+' or '0' now parse as strings +* dropping Node 6 which hits end of life in April 2019 +* see [yargs-parser@12.0.0 CHANGELOG](https://github.com/yargs/yargs-parser/blob/master/CHANGELOG.md#breaking-changes) +* we now warn if the yargs stanza package.json is used. + + + + +## [12.0.5](https://github.com/yargs/yargs/compare/v12.0.4...v12.0.5) (2018-11-19) + + +### Bug Fixes + +* allows camel-case, variadic arguments, and strict mode to be combined ([#1247](https://github.com/yargs/yargs/issues/1247)) ([eacc035](https://github.com/yargs/yargs/commit/eacc035)) + + + + +## [12.0.4](https://github.com/yargs/yargs/compare/v12.0.3...v12.0.4) (2018-11-10) + + +### Bug Fixes + +* don't load config when processing positionals ([5d0dc92](https://github.com/yargs/yargs/commit/5d0dc92)) + + + + +## [12.0.3](https://github.com/yargs/yargs/compare/v12.0.2...v12.0.3) (2018-10-06) + + +### Bug Fixes + +* $0 contains first arg in bundled electron apps ([#1206](https://github.com/yargs/yargs/issues/1206)) ([567820b](https://github.com/yargs/yargs/commit/567820b)) +* accept single function for middleware ([66fd6f7](https://github.com/yargs/yargs/commit/66fd6f7)), closes [#1214](https://github.com/yargs/yargs/issues/1214) [#1214](https://github.com/yargs/yargs/issues/1214) +* hide `hidden` options from help output even if they are in a group ([#1221](https://github.com/yargs/yargs/issues/1221)) ([da54028](https://github.com/yargs/yargs/commit/da54028)) +* improve Norwegian Bokmål translations ([#1208](https://github.com/yargs/yargs/issues/1208)) ([a458fa4](https://github.com/yargs/yargs/commit/a458fa4)) +* improve Norwegian Nynorsk translations ([#1207](https://github.com/yargs/yargs/issues/1207)) ([d422eb5](https://github.com/yargs/yargs/commit/d422eb5)) + + + + +## [12.0.2](https://github.com/yargs/yargs/compare/v12.0.1...v12.0.2) (2018-09-04) + + +### Bug Fixes + +* middleware should work regardless of when method is called ([664b265](https://github.com/yargs/yargs/commit/664b265)), closes [#1178](https://github.com/yargs/yargs/issues/1178) +* translation not working when using __ with a single parameter ([#1183](https://github.com/yargs/yargs/issues/1183)) ([f449aea](https://github.com/yargs/yargs/commit/f449aea)) +* upgrade os-locale to version that addresses license issue ([#1195](https://github.com/yargs/yargs/issues/1195)) ([efc0970](https://github.com/yargs/yargs/commit/efc0970)) + + + + +## [12.0.1](https://github.com/yargs/yargs/compare/v12.0.0...v12.0.1) (2018-06-29) + + + + +# [12.0.0](https://github.com/yargs/yargs/compare/v11.1.0...v12.0.0) (2018-06-26) + + +### Bug Fixes + +* .argv and .parse() now invoke identical code path ([#1126](https://github.com/yargs/yargs/issues/1126)) ([f13ebf4](https://github.com/yargs/yargs/commit/f13ebf4)) +* remove the trailing white spaces from the help output ([#1090](https://github.com/yargs/yargs/issues/1090)) ([3f0746c](https://github.com/yargs/yargs/commit/3f0746c)) +* **completion:** Avoid default command and recommendations during completion ([#1123](https://github.com/yargs/yargs/issues/1123)) ([036e7c5](https://github.com/yargs/yargs/commit/036e7c5)) + + +### Chores + +* test Node.js 6, 8 and 10 ([#1160](https://github.com/yargs/yargs/issues/1160)) ([84f9d2b](https://github.com/yargs/yargs/commit/84f9d2b)) +* upgrade to version of yargs-parser that does not populate value for unset boolean ([#1104](https://github.com/yargs/yargs/issues/1104)) ([d4705f4](https://github.com/yargs/yargs/commit/d4705f4)) + + +### Features + +* add support for global middleware, useful for shared tasks like metrics ([#1119](https://github.com/yargs/yargs/issues/1119)) ([9d71ac7](https://github.com/yargs/yargs/commit/9d71ac7)) +* allow setting scriptName $0 ([#1143](https://github.com/yargs/yargs/issues/1143)) ([a2f2eae](https://github.com/yargs/yargs/commit/a2f2eae)) +* remove `setPlaceholderKeys` ([#1105](https://github.com/yargs/yargs/issues/1105)) ([6ee2c82](https://github.com/yargs/yargs/commit/6ee2c82)) + + +### BREAKING CHANGES + +* Options absent from `argv` (not set via CLI argument) are now absent from the parsed result object rather than being set with `undefined` +* drop Node 4 from testing matrix, such that we'll gradually start drifting away from supporting Node 4. +* yargs-parser does not populate 'false' when boolean flag is not passed +* tests that assert against help output will need to be updated + + + + +# [11.1.0](https://github.com/yargs/yargs/compare/v11.0.0...v11.1.0) (2018-03-04) + + +### Bug Fixes + +* choose correct config directory when require.main does not exist ([#1056](https://github.com/yargs/yargs/issues/1056)) ([a04678c](https://github.com/yargs/yargs/commit/a04678c)) + + +### Features + +* allow hidden options to be displayed with --show-hidden ([#1061](https://github.com/yargs/yargs/issues/1061)) ([ea862ae](https://github.com/yargs/yargs/commit/ea862ae)) +* extend *.rc files in addition to json ([#1080](https://github.com/yargs/yargs/issues/1080)) ([11691a6](https://github.com/yargs/yargs/commit/11691a6)) + + + + +# [11.0.0](https://github.com/yargs/yargs/compare/v10.1.2...v11.0.0) (2018-01-22) + + +### Bug Fixes + +* Set implicit nargs=1 when type=number requiresArg=true ([#1050](https://github.com/yargs/yargs/issues/1050)) ([2b56812](https://github.com/yargs/yargs/commit/2b56812)) + + +### Features + +* requiresArg is now simply an alias for nargs(1) ([#1054](https://github.com/yargs/yargs/issues/1054)) ([a3ddacc](https://github.com/yargs/yargs/commit/a3ddacc)) + + +### BREAKING CHANGES + +* requiresArg now has significantly different error output, matching nargs. + +[Historical Versions](/docs/CHANGELOG-historical.md) diff --git a/node_modules/nyc/node_modules/yargs/LICENSE b/node_modules/nyc/node_modules/yargs/LICENSE new file mode 100644 index 0000000..b0145ca --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/nyc/node_modules/yargs/README.md b/node_modules/nyc/node_modules/yargs/README.md new file mode 100644 index 0000000..0db992b --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/README.md @@ -0,0 +1,140 @@ +

+ +

+

Yargs

+

+ Yargs be a node.js library fer hearties tryin' ter parse optstrings +

+ +
+ +[![Build Status][travis-image]][travis-url] +[![NPM version][npm-image]][npm-url] +[![js-standard-style][standard-image]][standard-url] +[![Coverage][coverage-image]][coverage-url] +[![Conventional Commits][conventional-commits-image]][conventional-commits-url] +[![Slack][slack-image]][slack-url] + +## Description : +Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. + +It gives you: + +* commands and (grouped) options (`my-program.js serve --port=5000`). +* a dynamically generated help menu based on your arguments. + +> + +* bash-completion shortcuts for commands and options. +* and [tons more](/docs/api.md). + +## Installation + +Stable version: +```bash +npm i yargs +``` + +Bleeding edge version with the most recent features: +```bash +npm i yargs@next +``` + +## Usage : + +### Simple Example + +```javascript +#!/usr/bin/env node +const {argv} = require('yargs') + +if (argv.ships > 3 && argv.distance < 53.5) { + console.log('Plunder more riffiwobbles!') +} else { + console.log('Retreat from the xupptumblers!') +} +``` + +```bash +$ ./plunder.js --ships=4 --distance=22 +Plunder more riffiwobbles! + +$ ./plunder.js --ships 12 --distance 98.7 +Retreat from the xupptumblers! +``` + +### Complex Example + +```javascript +#!/usr/bin/env node +require('yargs') // eslint-disable-line + .command('serve [port]', 'start the server', (yargs) => { + yargs + .positional('port', { + describe: 'port to bind on', + default: 5000 + }) + }, (argv) => { + if (argv.verbose) console.info(`start server on :${argv.port}`) + serve(argv.port) + }) + .option('verbose', { + alias: 'v', + type: 'boolean', + description: 'Run with verbose logging' + }) + .argv +``` + +Run the example above with `--help` to see the help for the application. + +## TypeScript + +yargs has type definitions at [@types/yargs][type-definitions]. + +``` +npm i @types/yargs --save-dev +``` + +See usage examples in [docs](/docs/typescript.md). + +## Webpack + +See usage examples of yargs with webpack in [docs](/docs/webpack.md). + +## Community : + +Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). + +## Documentation : + +### Table of Contents + +* [Yargs' API](/docs/api.md) +* [Examples](/docs/examples.md) +* [Parsing Tricks](/docs/tricks.md) + * [Stop the Parser](/docs/tricks.md#stop) + * [Negating Boolean Arguments](/docs/tricks.md#negate) + * [Numbers](/docs/tricks.md#numbers) + * [Arrays](/docs/tricks.md#arrays) + * [Objects](/docs/tricks.md#objects) + * [Quotes](/docs/tricks.md#quotes) +* [Advanced Topics](/docs/advanced.md) + * [Composing Your App Using Commands](/docs/advanced.md#commands) + * [Building Configurable CLI Apps](/docs/advanced.md#configuration) + * [Customizing Yargs' Parser](/docs/advanced.md#customizing) +* [Contributing](/contributing.md) + +[travis-url]: https://travis-ci.org/yargs/yargs +[travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg +[npm-url]: https://www.npmjs.com/package/yargs +[npm-image]: https://img.shields.io/npm/v/yargs.svg +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg +[standard-url]: http://standardjs.com/ +[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg +[conventional-commits-url]: https://conventionalcommits.org/ +[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg +[slack-url]: http://devtoolscommunity.herokuapp.com +[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs +[coverage-image]: https://img.shields.io/nycrc/yargs/yargs +[coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc diff --git a/node_modules/nyc/node_modules/yargs/build/lib/apply-extends.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/apply-extends.d.ts new file mode 100644 index 0000000..5a9aca7 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/apply-extends.d.ts @@ -0,0 +1,2 @@ +import { Dictionary } from './common-types'; +export declare function applyExtends(config: Dictionary, cwd: string, mergeExtends?: boolean): Dictionary; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/apply-extends.js b/node_modules/nyc/node_modules/yargs/build/lib/apply-extends.js new file mode 100644 index 0000000..005734a --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/apply-extends.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyExtends = void 0; +const fs = require("fs"); +const path = require("path"); +const yerror_1 = require("./yerror"); +let previouslyVisitedConfigs = []; +function checkForCircularExtends(cfgPath) { + if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) { + throw new yerror_1.YError(`Circular extended configurations: '${cfgPath}'.`); + } +} +function getPathToDefaultConfig(cwd, pathToExtend) { + return path.resolve(cwd, pathToExtend); +} +function mergeDeep(config1, config2) { + const target = {}; + function isObject(obj) { + return obj && typeof obj === 'object' && !Array.isArray(obj); + } + Object.assign(target, config1); + for (const key of Object.keys(config2)) { + if (isObject(config2[key]) && isObject(target[key])) { + target[key] = mergeDeep(config1[key], config2[key]); + } + else { + target[key] = config2[key]; + } + } + return target; +} +function applyExtends(config, cwd, mergeExtends = false) { + let defaultConfig = {}; + if (Object.prototype.hasOwnProperty.call(config, 'extends')) { + if (typeof config.extends !== 'string') + return defaultConfig; + const isPath = /\.json|\..*rc$/.test(config.extends); + let pathToDefault = null; + if (!isPath) { + try { + pathToDefault = require.resolve(config.extends); + } + catch (err) { + // most likely this simply isn't a module. + } + } + else { + pathToDefault = getPathToDefaultConfig(cwd, config.extends); + } + // maybe the module uses key for some other reason, + // err on side of caution. + if (!pathToDefault && !isPath) + return config; + if (!pathToDefault) + throw new yerror_1.YError(`Unable to find extended config '${config.extends}' in '${cwd}'.`); + checkForCircularExtends(pathToDefault); + previouslyVisitedConfigs.push(pathToDefault); + defaultConfig = isPath ? JSON.parse(fs.readFileSync(pathToDefault, 'utf8')) : require(config.extends); + delete config.extends; + defaultConfig = applyExtends(defaultConfig, path.dirname(pathToDefault), mergeExtends); + } + previouslyVisitedConfigs = []; + return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config); +} +exports.applyExtends = applyExtends; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/argsert.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/argsert.d.ts new file mode 100644 index 0000000..6f7a83f --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/argsert.d.ts @@ -0,0 +1,2 @@ +export declare function argsert(callerArguments: any[], length?: number): void; +export declare function argsert(expected: string, callerArguments: any[], length?: number): void; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/argsert.js b/node_modules/nyc/node_modules/yargs/build/lib/argsert.js new file mode 100644 index 0000000..40cb091 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/argsert.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.argsert = void 0; +const yerror_1 = require("./yerror"); +const parse_command_1 = require("./parse-command"); +const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']; +function argsert(arg1, arg2, arg3) { + function parseArgs() { + return typeof arg1 === 'object' + ? [{ demanded: [], optional: [] }, arg1, arg2] + : [parse_command_1.parseCommand(`cmd ${arg1}`), arg2, arg3]; + } + // TODO: should this eventually raise an exception. + try { + // preface the argument description with "cmd", so + // that we can run it through yargs' command parser. + let position = 0; + let [parsed, callerArguments, length] = parseArgs(); + const args = [].slice.call(callerArguments); + while (args.length && args[args.length - 1] === undefined) + args.pop(); + length = length || args.length; + if (length < parsed.demanded.length) { + throw new yerror_1.YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`); + } + const totalCommands = parsed.demanded.length + parsed.optional.length; + if (length > totalCommands) { + throw new yerror_1.YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`); + } + parsed.demanded.forEach((demanded) => { + const arg = args.shift(); + const observedType = guessType(arg); + const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*'); + if (matchingTypes.length === 0) + argumentTypeError(observedType, demanded.cmd, position); + position += 1; + }); + parsed.optional.forEach((optional) => { + if (args.length === 0) + return; + const arg = args.shift(); + const observedType = guessType(arg); + const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*'); + if (matchingTypes.length === 0) + argumentTypeError(observedType, optional.cmd, position); + position += 1; + }); + } + catch (err) { + console.warn(err.stack); + } +} +exports.argsert = argsert; +function guessType(arg) { + if (Array.isArray(arg)) { + return 'array'; + } + else if (arg === null) { + return 'null'; + } + return typeof arg; +} +function argumentTypeError(observedType, allowedTypes, position) { + throw new yerror_1.YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`); +} diff --git a/node_modules/nyc/node_modules/yargs/build/lib/command.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/command.d.ts new file mode 100644 index 0000000..9db6ab5 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/command.d.ts @@ -0,0 +1,64 @@ +/// +import { Dictionary } from './common-types'; +import { Middleware } from './middleware'; +import { Positional } from './parse-command'; +import { RequireDirectoryOptions } from 'require-directory'; +import { UsageInstance } from './usage'; +import { ValidationInstance } from './validation'; +import { YargsInstance, Options, OptionDefinition, Context, Arguments, DetailedArguments } from './yargs'; +export declare function command(yargs: YargsInstance, usage: UsageInstance, validation: ValidationInstance, globalMiddleware?: Middleware[]): CommandInstance; +/** Instance of the command module. */ +export interface CommandInstance { + addDirectory(dir: string, context: Context, req: NodeRequireFunction, callerFile: string, opts?: RequireDirectoryOptions): void; + addHandler(handler: CommandHandlerDefinition): void; + addHandler(cmd: string | string[], description: CommandHandler['description'], builder?: CommandBuilderDefinition | CommandBuilder, handler?: CommandHandlerCallback, commandMiddleware?: Middleware[], deprecated?: boolean): void; + cmdToParseOptions(cmdString: string): Positionals; + freeze(): void; + getCommandHandlers(): Dictionary; + getCommands(): string[]; + hasDefaultCommand(): boolean; + reset(): CommandInstance; + runCommand(command: string | null, yargs: YargsInstance, parsed: DetailedArguments, commandIndex?: number): Arguments | Promise; + runDefaultBuilderOn(yargs: YargsInstance): void; + unfreeze(): void; +} +export interface CommandHandlerDefinition extends Partial> { + aliases?: string[]; + builder?: CommandBuilder | CommandBuilderDefinition; + command?: string | string[]; + desc?: CommandHandler['description']; + describe?: CommandHandler['description']; +} +export declare function isCommandHandlerDefinition(cmd: string | string[] | CommandHandlerDefinition): cmd is CommandHandlerDefinition; +export interface CommandBuilderDefinition { + builder?: CommandBuilder; + deprecated?: boolean; + handler: CommandHandlerCallback; + middlewares?: Middleware[]; +} +export declare function isCommandBuilderDefinition(builder?: CommandBuilder | CommandBuilderDefinition): builder is CommandBuilderDefinition; +export interface CommandHandlerCallback { + (argv: Arguments): any; +} +export interface CommandHandler { + builder: CommandBuilder; + demanded: Positional[]; + deprecated?: boolean; + description?: string | false; + handler: CommandHandlerCallback; + middlewares: Middleware[]; + optional: Positional[]; + original: string; +} +export declare type CommandBuilder = CommandBuilderCallback | Dictionary; +interface CommandBuilderCallback { + (y: YargsInstance): YargsInstance | void; +} +export declare function isCommandBuilderCallback(builder: CommandBuilder): builder is CommandBuilderCallback; +interface Positionals extends Pick { + demand: Dictionary; +} +export interface FinishCommandHandler { + (handlerResult: any): any; +} +export {}; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/command.js b/node_modules/nyc/node_modules/yargs/build/lib/command.js new file mode 100644 index 0000000..d90c455 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/command.js @@ -0,0 +1,416 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isCommandBuilderCallback = exports.isCommandBuilderDefinition = exports.isCommandHandlerDefinition = exports.command = void 0; +const common_types_1 = require("./common-types"); +const is_promise_1 = require("./is-promise"); +const middleware_1 = require("./middleware"); +const parse_command_1 = require("./parse-command"); +const path = require("path"); +const util_1 = require("util"); +const yargs_1 = require("./yargs"); +const requireDirectory = require("require-directory"); +const whichModule = require("which-module"); +const Parser = require("yargs-parser"); +const DEFAULT_MARKER = /(^\*)|(^\$0)/; +// handles parsing positional arguments, +// and populating argv with said positional +// arguments. +function command(yargs, usage, validation, globalMiddleware = []) { + const self = {}; + let handlers = {}; + let aliasMap = {}; + let defaultCommand; + self.addHandler = function addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) { + let aliases = []; + const middlewares = middleware_1.commandMiddlewareFactory(commandMiddleware); + handler = handler || (() => { }); + if (Array.isArray(cmd)) { + aliases = cmd.slice(1); + cmd = cmd[0]; + } + else if (isCommandHandlerDefinition(cmd)) { + let command = (Array.isArray(cmd.command) || typeof cmd.command === 'string') ? cmd.command : moduleName(cmd); + if (cmd.aliases) + command = [].concat(command).concat(cmd.aliases); + self.addHandler(command, extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated); + return; + } + // allow a module to be provided instead of separate builder and handler + if (isCommandBuilderDefinition(builder)) { + self.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated); + return; + } + // parse positionals out of cmd string + const parsedCommand = parse_command_1.parseCommand(cmd); + // remove positional args from aliases only + aliases = aliases.map(alias => parse_command_1.parseCommand(alias).cmd); + // check for default and filter out '*'' + let isDefault = false; + const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c) => { + if (DEFAULT_MARKER.test(c)) { + isDefault = true; + return false; + } + return true; + }); + // standardize on $0 for default command. + if (parsedAliases.length === 0 && isDefault) + parsedAliases.push('$0'); + // shift cmd and aliases after filtering out '*' + if (isDefault) { + parsedCommand.cmd = parsedAliases[0]; + aliases = parsedAliases.slice(1); + cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd); + } + // populate aliasMap + aliases.forEach((alias) => { + aliasMap[alias] = parsedCommand.cmd; + }); + if (description !== false) { + usage.command(cmd, description, isDefault, aliases, deprecated); + } + handlers[parsedCommand.cmd] = { + original: cmd, + description, + handler, + builder: builder || {}, + middlewares, + deprecated, + demanded: parsedCommand.demanded, + optional: parsedCommand.optional + }; + if (isDefault) + defaultCommand = handlers[parsedCommand.cmd]; + }; + self.addDirectory = function addDirectory(dir, context, req, callerFile, opts) { + opts = opts || {}; + // disable recursion to support nested directories of subcommands + if (typeof opts.recurse !== 'boolean') + opts.recurse = false; + // exclude 'json', 'coffee' from require-directory defaults + if (!Array.isArray(opts.extensions)) + opts.extensions = ['js']; + // allow consumer to define their own visitor function + const parentVisit = typeof opts.visit === 'function' ? opts.visit : (o) => o; + // call addHandler via visitor function + opts.visit = function visit(obj, joined, filename) { + const visited = parentVisit(obj, joined, filename); + // allow consumer to skip modules with their own visitor + if (visited) { + // check for cyclic reference + // each command file path should only be seen once per execution + if (~context.files.indexOf(joined)) + return visited; + // keep track of visited files in context.files + context.files.push(joined); + self.addHandler(visited); + } + return visited; + }; + requireDirectory({ require: req, filename: callerFile }, dir, opts); + }; + // lookup module object from require()d command and derive name + // if module was not require()d and no name given, throw error + function moduleName(obj) { + const mod = whichModule(obj); + if (!mod) + throw new Error(`No command name given for module: ${util_1.inspect(obj)}`); + return commandFromFilename(mod.filename); + } + // derive command name from filename + function commandFromFilename(filename) { + return path.basename(filename, path.extname(filename)); + } + function extractDesc({ describe, description, desc }) { + for (const test of [describe, description, desc]) { + if (typeof test === 'string' || test === false) + return test; + common_types_1.assertNotStrictEqual(test, true); + } + return false; + } + self.getCommands = () => Object.keys(handlers).concat(Object.keys(aliasMap)); + self.getCommandHandlers = () => handlers; + self.hasDefaultCommand = () => !!defaultCommand; + self.runCommand = function runCommand(command, yargs, parsed, commandIndex) { + let aliases = parsed.aliases; + const commandHandler = handlers[command] || handlers[aliasMap[command]] || defaultCommand; + const currentContext = yargs.getContext(); + let numFiles = currentContext.files.length; + const parentCommands = currentContext.commands.slice(); + // what does yargs look like after the builder is run? + let innerArgv = parsed.argv; + let positionalMap = {}; + if (command) { + currentContext.commands.push(command); + currentContext.fullCommands.push(commandHandler.original); + } + const builder = commandHandler.builder; + if (isCommandBuilderCallback(builder)) { + // a function can be provided, which builds + // up a yargs chain and possibly returns it. + const builderOutput = builder(yargs.reset(parsed.aliases)); + const innerYargs = yargs_1.isYargsInstance(builderOutput) ? builderOutput : yargs; + if (shouldUpdateUsage(innerYargs)) { + innerYargs.getUsageInstance().usage(usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description); + } + innerArgv = innerYargs._parseArgs(null, null, true, commandIndex); + aliases = innerYargs.parsed.aliases; + } + else if (isCommandBuilderOptionDefinitions(builder)) { + // as a short hand, an object can instead be provided, specifying + // the options that a command takes. + const innerYargs = yargs.reset(parsed.aliases); + if (shouldUpdateUsage(innerYargs)) { + innerYargs.getUsageInstance().usage(usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description); + } + Object.keys(commandHandler.builder).forEach((key) => { + innerYargs.option(key, builder[key]); + }); + innerArgv = innerYargs._parseArgs(null, null, true, commandIndex); + aliases = innerYargs.parsed.aliases; + } + if (!yargs._hasOutput()) { + positionalMap = populatePositionals(commandHandler, innerArgv, currentContext); + } + const middlewares = globalMiddleware.slice(0).concat(commandHandler.middlewares); + middleware_1.applyMiddleware(innerArgv, yargs, middlewares, true); + // we apply validation post-hoc, so that custom + // checks get passed populated positional arguments. + if (!yargs._hasOutput()) { + yargs._runValidation(innerArgv, aliases, positionalMap, yargs.parsed.error, !command); + } + if (commandHandler.handler && !yargs._hasOutput()) { + yargs._setHasOutput(); + // to simplify the parsing of positionals in commands, + // we temporarily populate '--' rather than _, with arguments + const populateDoubleDash = !!yargs.getOptions().configuration['populate--']; + if (!populateDoubleDash) + yargs._copyDoubleDash(innerArgv); + innerArgv = middleware_1.applyMiddleware(innerArgv, yargs, middlewares, false); + let handlerResult; + if (is_promise_1.isPromise(innerArgv)) { + handlerResult = innerArgv.then(argv => commandHandler.handler(argv)); + } + else { + handlerResult = commandHandler.handler(innerArgv); + } + const handlerFinishCommand = yargs.getHandlerFinishCommand(); + if (is_promise_1.isPromise(handlerResult)) { + yargs.getUsageInstance().cacheHelpMessage(); + handlerResult + .then(value => { + if (handlerFinishCommand) { + handlerFinishCommand(value); + } + }) + .catch(error => { + try { + yargs.getUsageInstance().fail(null, error); + } + catch (err) { + // fail's throwing would cause an unhandled rejection. + } + }) + .then(() => { + yargs.getUsageInstance().clearCachedHelpMessage(); + }); + } + else { + if (handlerFinishCommand) { + handlerFinishCommand(handlerResult); + } + } + } + if (command) { + currentContext.commands.pop(); + currentContext.fullCommands.pop(); + } + numFiles = currentContext.files.length - numFiles; + if (numFiles > 0) + currentContext.files.splice(numFiles * -1, numFiles); + return innerArgv; + }; + function shouldUpdateUsage(yargs) { + return !yargs.getUsageInstance().getUsageDisabled() && + yargs.getUsageInstance().getUsage().length === 0; + } + function usageFromParentCommandsCommandHandler(parentCommands, commandHandler) { + const c = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, '').trim() : commandHandler.original; + const pc = parentCommands.filter((c) => { return !DEFAULT_MARKER.test(c); }); + pc.push(c); + return `$0 ${pc.join(' ')}`; + } + self.runDefaultBuilderOn = function (yargs) { + common_types_1.assertNotStrictEqual(defaultCommand, undefined); + if (shouldUpdateUsage(yargs)) { + // build the root-level command string from the default string. + const commandString = DEFAULT_MARKER.test(defaultCommand.original) + ? defaultCommand.original : defaultCommand.original.replace(/^[^[\]<>]*/, '$0 '); + yargs.getUsageInstance().usage(commandString, defaultCommand.description); + } + const builder = defaultCommand.builder; + if (isCommandBuilderCallback(builder)) { + builder(yargs); + } + else { + Object.keys(builder).forEach((key) => { + yargs.option(key, builder[key]); + }); + } + }; + // transcribe all positional arguments "command [apple]" + // onto argv. + function populatePositionals(commandHandler, argv, context) { + argv._ = argv._.slice(context.commands.length); // nuke the current commands + const demanded = commandHandler.demanded.slice(0); + const optional = commandHandler.optional.slice(0); + const positionalMap = {}; + validation.positionalCount(demanded.length, argv._.length); + while (demanded.length) { + const demand = demanded.shift(); + populatePositional(demand, argv, positionalMap); + } + while (optional.length) { + const maybe = optional.shift(); + populatePositional(maybe, argv, positionalMap); + } + argv._ = context.commands.concat(argv._); + postProcessPositionals(argv, positionalMap, self.cmdToParseOptions(commandHandler.original)); + return positionalMap; + } + function populatePositional(positional, argv, positionalMap) { + const cmd = positional.cmd[0]; + if (positional.variadic) { + positionalMap[cmd] = argv._.splice(0).map(String); + } + else { + if (argv._.length) + positionalMap[cmd] = [String(argv._.shift())]; + } + } + // we run yargs-parser against the positional arguments + // applying the same parsing logic used for flags. + function postProcessPositionals(argv, positionalMap, parseOptions) { + // combine the parsing hints we've inferred from the command + // string with explicitly configured parsing hints. + const options = Object.assign({}, yargs.getOptions()); + options.default = Object.assign(parseOptions.default, options.default); + for (const key of Object.keys(parseOptions.alias)) { + options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]); + } + options.array = options.array.concat(parseOptions.array); + delete options.config; // don't load config when processing positionals. + const unparsed = []; + Object.keys(positionalMap).forEach((key) => { + positionalMap[key].map((value) => { + if (options.configuration['unknown-options-as-args']) + options.key[key] = true; + unparsed.push(`--${key}`); + unparsed.push(value); + }); + }); + // short-circuit parse. + if (!unparsed.length) + return; + const config = Object.assign({}, options.configuration, { + 'populate--': true + }); + const parsed = Parser.detailed(unparsed, Object.assign({}, options, { + configuration: config + })); + if (parsed.error) { + yargs.getUsageInstance().fail(parsed.error.message, parsed.error); + } + else { + // only copy over positional keys (don't overwrite + // flag arguments that were already parsed). + const positionalKeys = Object.keys(positionalMap); + Object.keys(positionalMap).forEach((key) => { + positionalKeys.push(...parsed.aliases[key]); + }); + Object.keys(parsed.argv).forEach((key) => { + if (positionalKeys.indexOf(key) !== -1) { + // any new aliases need to be placed in positionalMap, which + // is used for validation. + if (!positionalMap[key]) + positionalMap[key] = parsed.argv[key]; + argv[key] = parsed.argv[key]; + } + }); + } + } + self.cmdToParseOptions = function (cmdString) { + const parseOptions = { + array: [], + default: {}, + alias: {}, + demand: {} + }; + const parsed = parse_command_1.parseCommand(cmdString); + parsed.demanded.forEach((d) => { + const [cmd, ...aliases] = d.cmd; + if (d.variadic) { + parseOptions.array.push(cmd); + parseOptions.default[cmd] = []; + } + parseOptions.alias[cmd] = aliases; + parseOptions.demand[cmd] = true; + }); + parsed.optional.forEach((o) => { + const [cmd, ...aliases] = o.cmd; + if (o.variadic) { + parseOptions.array.push(cmd); + parseOptions.default[cmd] = []; + } + parseOptions.alias[cmd] = aliases; + }); + return parseOptions; + }; + self.reset = () => { + handlers = {}; + aliasMap = {}; + defaultCommand = undefined; + return self; + }; + // used by yargs.parse() to freeze + // the state of commands such that + // we can apply .parse() multiple times + // with the same yargs instance. + const frozens = []; + self.freeze = () => { + frozens.push({ + handlers, + aliasMap, + defaultCommand + }); + }; + self.unfreeze = () => { + const frozen = frozens.pop(); + common_types_1.assertNotStrictEqual(frozen, undefined); + ({ + handlers, + aliasMap, + defaultCommand + } = frozen); + }; + return self; +} +exports.command = command; +function isCommandHandlerDefinition(cmd) { + return typeof cmd === 'object'; +} +exports.isCommandHandlerDefinition = isCommandHandlerDefinition; +function isCommandBuilderDefinition(builder) { + return typeof builder === 'object' && + !!builder.builder && + typeof builder.handler === 'function'; +} +exports.isCommandBuilderDefinition = isCommandBuilderDefinition; +function isCommandBuilderCallback(builder) { + return typeof builder === 'function'; +} +exports.isCommandBuilderCallback = isCommandBuilderCallback; +function isCommandBuilderOptionDefinitions(builder) { + return typeof builder === 'object'; +} diff --git a/node_modules/nyc/node_modules/yargs/build/lib/common-types.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/common-types.d.ts new file mode 100644 index 0000000..f83c0dd --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/common-types.d.ts @@ -0,0 +1,36 @@ +/** + * An object whose all properties have the same type. + */ +export declare type Dictionary = { + [key: string]: T; +}; +/** + * Returns the keys of T that match Dictionary and are not arrays. + */ +export declare type DictionaryKeyof = Exclude>, KeyOf>; +/** + * Returns the keys of T that match U. + */ +export declare type KeyOf = Exclude<{ + [K in keyof T]: T[K] extends U ? K : never; +}[keyof T], undefined>; +/** + * An array whose first element is not undefined. + */ +export declare type NotEmptyArray = [T, ...T[]]; +/** + * Returns the type of a Dictionary or array values. + */ +export declare type ValueOf = T extends (infer U)[] ? U : T[keyof T]; +/** + * Typing wrapper around assert.notStrictEqual() + */ +export declare function assertNotStrictEqual(actual: T | N, expected: N, message?: string | Error): asserts actual is Exclude; +/** + * Asserts actual is a single key, not a key array or a key map. + */ +export declare function assertSingleKey(actual: string | string[] | Dictionary): asserts actual is string; +/** + * Typing wrapper around Object.keys() + */ +export declare function objectKeys(object: T): (keyof T)[]; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/common-types.js b/node_modules/nyc/node_modules/yargs/build/lib/common-types.js new file mode 100644 index 0000000..3064cbf --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/common-types.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objectKeys = exports.assertSingleKey = exports.assertNotStrictEqual = void 0; +const assert_1 = require("assert"); +/** + * Typing wrapper around assert.notStrictEqual() + */ +function assertNotStrictEqual(actual, expected, message) { + assert_1.notStrictEqual(actual, expected, message); +} +exports.assertNotStrictEqual = assertNotStrictEqual; +/** + * Asserts actual is a single key, not a key array or a key map. + */ +function assertSingleKey(actual) { + assert_1.strictEqual(typeof actual, 'string'); +} +exports.assertSingleKey = assertSingleKey; +/** + * Typing wrapper around Object.keys() + */ +function objectKeys(object) { + return Object.keys(object); +} +exports.objectKeys = objectKeys; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/completion-templates.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/completion-templates.d.ts new file mode 100644 index 0000000..67bcd30 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/completion-templates.d.ts @@ -0,0 +1,2 @@ +export declare const completionShTemplate = "###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word=\"${COMP_WORDS[COMP_CWORD]}\"\n args=(\"${COMP_WORDS[@]}\")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions \"${args[@]}\")\n\n COMPREPLY=( $(compgen -W \"${type_list}\" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o default -F _yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n"; +export declare const completionZshTemplate = "###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$'\n' reply=($(COMP_CWORD=\"$((CURRENT-1))\" COMP_LINE=\"$BUFFER\" COMP_POINT=\"$CURSOR\" {{app_path}} --get-yargs-completions \"${words[@]}\"))\n IFS=$si\n _describe 'values' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n"; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/completion-templates.js b/node_modules/nyc/node_modules/yargs/build/lib/completion-templates.js new file mode 100644 index 0000000..3ee0e06 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/completion-templates.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.completionZshTemplate = exports.completionShTemplate = void 0; +exports.completionShTemplate = `###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc +# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. +# +_yargs_completions() +{ + local cur_word args type_list + + cur_word="\${COMP_WORDS[COMP_CWORD]}" + args=("\${COMP_WORDS[@]}") + + # ask yargs to generate completions. + type_list=$({{app_path}} --get-yargs-completions "\${args[@]}") + + COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) ) + + # if no match was found, fall back to filename completion + if [ \${#COMPREPLY[@]} -eq 0 ]; then + COMPREPLY=() + fi + + return 0 +} +complete -o default -F _yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +`; +exports.completionZshTemplate = `###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc +# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX. +# +_{{app_name}}_yargs_completions() +{ + local reply + local si=$IFS + IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}")) + IFS=$si + _describe 'values' reply +} +compdef _{{app_name}}_yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +`; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/completion.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/completion.d.ts new file mode 100644 index 0000000..176a91b --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/completion.d.ts @@ -0,0 +1,21 @@ +import { CommandInstance } from './command'; +import { UsageInstance } from './usage'; +import { YargsInstance } from './yargs'; +import { Arguments, DetailedArguments } from 'yargs-parser'; +export declare function completion(yargs: YargsInstance, usage: UsageInstance, command: CommandInstance): CompletionInstance; +/** Instance of the completion module. */ +export interface CompletionInstance { + completionKey: string; + generateCompletionScript($0: string, cmd: string): string; + getCompletion(args: string[], done: (completions: string[]) => any): any; + registerFunction(fn: CompletionFunction): void; + setParsed(parsed: DetailedArguments): void; +} +export declare type CompletionFunction = SyncCompletionFunction | AsyncCompletionFunction; +interface SyncCompletionFunction { + (current: string, argv: Arguments): string[] | Promise; +} +interface AsyncCompletionFunction { + (current: string, argv: Arguments, done: (completions: string[]) => any): any; +} +export {}; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/completion.js b/node_modules/nyc/node_modules/yargs/build/lib/completion.js new file mode 100644 index 0000000..d65925a --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/completion.js @@ -0,0 +1,135 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.completion = void 0; +const command_1 = require("./command"); +const templates = require("./completion-templates"); +const is_promise_1 = require("./is-promise"); +const parse_command_1 = require("./parse-command"); +const path = require("path"); +const common_types_1 = require("./common-types"); +// add bash completions to your +// yargs-powered applications. +function completion(yargs, usage, command) { + const self = { + completionKey: 'get-yargs-completions' + }; + let aliases; + self.setParsed = function setParsed(parsed) { + aliases = parsed.aliases; + }; + const zshShell = (process.env.SHELL && process.env.SHELL.indexOf('zsh') !== -1) || + (process.env.ZSH_NAME && process.env.ZSH_NAME.indexOf('zsh') !== -1); + // get a list of completion commands. + // 'args' is the array of strings from the line to be completed + self.getCompletion = function getCompletion(args, done) { + const completions = []; + const current = args.length ? args[args.length - 1] : ''; + const argv = yargs.parse(args, true); + const parentCommands = yargs.getContext().commands; + // a custom completion function can be provided + // to completion(). + function runCompletionFunction(argv) { + common_types_1.assertNotStrictEqual(completionFunction, null); + if (isSyncCompletionFunction(completionFunction)) { + const result = completionFunction(current, argv); + // promise based completion function. + if (is_promise_1.isPromise(result)) { + return result.then((list) => { + process.nextTick(() => { done(list); }); + }).catch((err) => { + process.nextTick(() => { throw err; }); + }); + } + // synchronous completion function. + return done(result); + } + else { + // asynchronous completion function + return completionFunction(current, argv, (completions) => { + done(completions); + }); + } + } + if (completionFunction) { + return is_promise_1.isPromise(argv) ? argv.then(runCompletionFunction) : runCompletionFunction(argv); + } + const handlers = command.getCommandHandlers(); + for (let i = 0, ii = args.length; i < ii; ++i) { + if (handlers[args[i]] && handlers[args[i]].builder) { + const builder = handlers[args[i]].builder; + if (command_1.isCommandBuilderCallback(builder)) { + const y = yargs.reset(); + builder(y); + return y.argv; + } + } + } + if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current) { + usage.getCommands().forEach((usageCommand) => { + const commandName = parse_command_1.parseCommand(usageCommand[0]).cmd; + if (args.indexOf(commandName) === -1) { + if (!zshShell) { + completions.push(commandName); + } + else { + const desc = usageCommand[1] || ''; + completions.push(commandName.replace(/:/g, '\\:') + ':' + desc); + } + } + }); + } + if (current.match(/^-/) || (current === '' && completions.length === 0)) { + const descs = usage.getDescriptions(); + const options = yargs.getOptions(); + Object.keys(options.key).forEach((key) => { + const negable = !!options.configuration['boolean-negation'] && options.boolean.includes(key); + // If the key and its aliases aren't in 'args', add the key to 'completions' + let keyAndAliases = [key].concat(aliases[key] || []); + if (negable) + keyAndAliases = keyAndAliases.concat(keyAndAliases.map(key => `no-${key}`)); + function completeOptionKey(key) { + const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1); + if (notInArgs) { + const startsByTwoDashes = (s) => /^--/.test(s); + const isShortOption = (s) => /^[^0-9]$/.test(s); + const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--'; + if (!zshShell) { + completions.push(dashes + key); + } + else { + const desc = descs[key] || ''; + completions.push(dashes + `${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`); + } + } + } + completeOptionKey(key); + if (negable && !!options.default[key]) + completeOptionKey(`no-${key}`); + }); + } + done(completions); + }; + // generate the completion script to add to your .bashrc. + self.generateCompletionScript = function generateCompletionScript($0, cmd) { + let script = zshShell ? templates.completionZshTemplate : templates.completionShTemplate; + const name = path.basename($0); + // add ./to applications not yet installed as bin. + if ($0.match(/\.js$/)) + $0 = `./${$0}`; + script = script.replace(/{{app_name}}/g, name); + script = script.replace(/{{completion_command}}/g, cmd); + return script.replace(/{{app_path}}/g, $0); + }; + // register a function to perform your own custom + // completions., this function can be either + // synchrnous or asynchronous. + let completionFunction = null; + self.registerFunction = (fn) => { + completionFunction = fn; + }; + return self; +} +exports.completion = completion; +function isSyncCompletionFunction(completionFunction) { + return completionFunction.length < 3; +} diff --git a/node_modules/nyc/node_modules/yargs/build/lib/is-promise.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/is-promise.d.ts new file mode 100644 index 0000000..19b5566 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/is-promise.d.ts @@ -0,0 +1 @@ +export declare function isPromise(maybePromise: T | Promise): maybePromise is Promise; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/is-promise.js b/node_modules/nyc/node_modules/yargs/build/lib/is-promise.js new file mode 100644 index 0000000..c24f9a8 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/is-promise.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPromise = void 0; +function isPromise(maybePromise) { + return !!maybePromise && + !!maybePromise.then && + (typeof maybePromise.then === 'function'); +} +exports.isPromise = isPromise; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/levenshtein.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/levenshtein.d.ts new file mode 100644 index 0000000..08b6b7f --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/levenshtein.d.ts @@ -0,0 +1 @@ +export declare function levenshtein(a: string, b: string): number; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/levenshtein.js b/node_modules/nyc/node_modules/yargs/build/lib/levenshtein.js new file mode 100644 index 0000000..84c0831 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/levenshtein.js @@ -0,0 +1,58 @@ +"use strict"; +/* +Copyright (c) 2011 Andrei Mackenzie + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.levenshtein = void 0; +// levenshtein distance algorithm, pulled from Andrei Mackenzie's MIT licensed. +// gist, which can be found here: https://gist.github.com/andrei-m/982927 +// Compute the edit distance between the two given strings +function levenshtein(a, b) { + if (a.length === 0) + return b.length; + if (b.length === 0) + return a.length; + const matrix = []; + // increment along the first column of each row + let i; + for (i = 0; i <= b.length; i++) { + matrix[i] = [i]; + } + // increment each column in the first row + let j; + for (j = 0; j <= a.length; j++) { + matrix[0][j] = j; + } + // Fill in the rest of the matrix + for (i = 1; i <= b.length; i++) { + for (j = 1; j <= a.length; j++) { + if (b.charAt(i - 1) === a.charAt(j - 1)) { + matrix[i][j] = matrix[i - 1][j - 1]; + } + else { + matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution + Math.min(matrix[i][j - 1] + 1, // insertion + matrix[i - 1][j] + 1)); // deletion + } + } + } + return matrix[b.length][a.length]; +} +exports.levenshtein = levenshtein; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/middleware.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/middleware.d.ts new file mode 100644 index 0000000..8fa7c34 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/middleware.d.ts @@ -0,0 +1,10 @@ +import { YargsInstance, Arguments } from './yargs'; +export declare function globalMiddlewareFactory(globalMiddleware: Middleware[], context: T): (callback: MiddlewareCallback | MiddlewareCallback[], applyBeforeValidation?: boolean) => T; +export declare function commandMiddlewareFactory(commandMiddleware?: MiddlewareCallback[]): Middleware[]; +export declare function applyMiddleware(argv: Arguments | Promise, yargs: YargsInstance, middlewares: Middleware[], beforeValidation: boolean): Arguments | Promise; +export interface MiddlewareCallback { + (argv: Arguments, yargs: YargsInstance): Partial | Promise>; +} +export interface Middleware extends MiddlewareCallback { + applyBeforeValidation: boolean; +} diff --git a/node_modules/nyc/node_modules/yargs/build/lib/middleware.js b/node_modules/nyc/node_modules/yargs/build/lib/middleware.js new file mode 100644 index 0000000..e93b6d2 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/middleware.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.applyMiddleware = exports.commandMiddlewareFactory = exports.globalMiddlewareFactory = void 0; +const argsert_1 = require("./argsert"); +const is_promise_1 = require("./is-promise"); +function globalMiddlewareFactory(globalMiddleware, context) { + return function (callback, applyBeforeValidation = false) { + argsert_1.argsert(' [boolean]', [callback, applyBeforeValidation], arguments.length); + if (Array.isArray(callback)) { + for (let i = 0; i < callback.length; i++) { + if (typeof callback[i] !== 'function') { + throw Error('middleware must be a function'); + } + callback[i].applyBeforeValidation = applyBeforeValidation; + } + Array.prototype.push.apply(globalMiddleware, callback); + } + else if (typeof callback === 'function') { + callback.applyBeforeValidation = applyBeforeValidation; + globalMiddleware.push(callback); + } + return context; + }; +} +exports.globalMiddlewareFactory = globalMiddlewareFactory; +function commandMiddlewareFactory(commandMiddleware) { + if (!commandMiddleware) + return []; + return commandMiddleware.map(middleware => { + middleware.applyBeforeValidation = false; + return middleware; + }); +} +exports.commandMiddlewareFactory = commandMiddlewareFactory; +function applyMiddleware(argv, yargs, middlewares, beforeValidation) { + const beforeValidationError = new Error('middleware cannot return a promise when applyBeforeValidation is true'); + return middlewares + .reduce((acc, middleware) => { + if (middleware.applyBeforeValidation !== beforeValidation) { + return acc; + } + if (is_promise_1.isPromise(acc)) { + return acc + .then(initialObj => Promise.all([initialObj, middleware(initialObj, yargs)])) + .then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj)); + } + else { + const result = middleware(acc, yargs); + if (beforeValidation && is_promise_1.isPromise(result)) + throw beforeValidationError; + return is_promise_1.isPromise(result) + ? result.then(middlewareObj => Object.assign(acc, middlewareObj)) + : Object.assign(acc, result); + } + }, argv); +} +exports.applyMiddleware = applyMiddleware; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/obj-filter.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/obj-filter.d.ts new file mode 100644 index 0000000..031ae28 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/obj-filter.d.ts @@ -0,0 +1 @@ +export declare function objFilter(original?: T, filter?: (k: keyof T, v: T[keyof T]) => boolean): T; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/obj-filter.js b/node_modules/nyc/node_modules/yargs/build/lib/obj-filter.js new file mode 100644 index 0000000..790f947 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/obj-filter.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objFilter = void 0; +const common_types_1 = require("./common-types"); +function objFilter(original = {}, filter = () => true) { + const obj = {}; + common_types_1.objectKeys(original).forEach((key) => { + if (filter(key, original[key])) { + obj[key] = original[key]; + } + }); + return obj; +} +exports.objFilter = objFilter; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/parse-command.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/parse-command.d.ts new file mode 100644 index 0000000..fc57836 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/parse-command.d.ts @@ -0,0 +1,11 @@ +import { NotEmptyArray } from './common-types'; +export declare function parseCommand(cmd: string): ParsedCommand; +export interface ParsedCommand { + cmd: string; + demanded: Positional[]; + optional: Positional[]; +} +export interface Positional { + cmd: NotEmptyArray; + variadic: boolean; +} diff --git a/node_modules/nyc/node_modules/yargs/build/lib/parse-command.js b/node_modules/nyc/node_modules/yargs/build/lib/parse-command.js new file mode 100644 index 0000000..aaf2327 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/parse-command.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseCommand = void 0; +function parseCommand(cmd) { + const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' '); + const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/); + const bregex = /\.*[\][<>]/g; + const firstCommand = splitCommand.shift(); + if (!firstCommand) + throw new Error(`No command found in: ${cmd}`); + const parsedCommand = { + cmd: firstCommand.replace(bregex, ''), + demanded: [], + optional: [] + }; + splitCommand.forEach((cmd, i) => { + let variadic = false; + cmd = cmd.replace(/\s/g, ''); + if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1) + variadic = true; + if (/^\[/.test(cmd)) { + parsedCommand.optional.push({ + cmd: cmd.replace(bregex, '').split('|'), + variadic + }); + } + else { + parsedCommand.demanded.push({ + cmd: cmd.replace(bregex, '').split('|'), + variadic + }); + } + }); + return parsedCommand; +} +exports.parseCommand = parseCommand; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/process-argv.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/process-argv.d.ts new file mode 100644 index 0000000..18fd43b --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/process-argv.d.ts @@ -0,0 +1,2 @@ +export declare function getProcessArgvWithoutBin(): string[]; +export declare function getProcessArgvBin(): string; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/process-argv.js b/node_modules/nyc/node_modules/yargs/build/lib/process-argv.js new file mode 100644 index 0000000..a9201dd --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/process-argv.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProcessArgvBin = exports.getProcessArgvWithoutBin = void 0; +function getProcessArgvBinIndex() { + // The binary name is the first command line argument for: + // - bundled Electron apps: bin argv1 argv2 ... argvn + if (isBundledElectronApp()) + return 0; + // or the second one (default) for: + // - standard node apps: node bin.js argv1 argv2 ... argvn + // - unbundled Electron apps: electron bin.js argv1 arg2 ... argvn + return 1; +} +function isBundledElectronApp() { + // process.defaultApp is either set by electron in an electron unbundled app, or undefined + // see https://github.com/electron/electron/blob/master/docs/api/process.md#processdefaultapp-readonly + return isElectronApp() && !process.defaultApp; +} +function isElectronApp() { + // process.versions.electron is either set by electron, or undefined + // see https://github.com/electron/electron/blob/master/docs/api/process.md#processversionselectron-readonly + return !!process.versions.electron; +} +function getProcessArgvWithoutBin() { + return process.argv.slice(getProcessArgvBinIndex() + 1); +} +exports.getProcessArgvWithoutBin = getProcessArgvWithoutBin; +function getProcessArgvBin() { + return process.argv[getProcessArgvBinIndex()]; +} +exports.getProcessArgvBin = getProcessArgvBin; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/usage.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/usage.d.ts new file mode 100644 index 0000000..d9dd1fa --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/usage.d.ts @@ -0,0 +1,49 @@ +import { Dictionary } from './common-types'; +import { YargsInstance } from './yargs'; +import { YError } from './yerror'; +import { Y18N } from 'y18n'; +export declare function usage(yargs: YargsInstance, y18n: Y18N): UsageInstance; +/** Instance of the usage module. */ +export interface UsageInstance { + cacheHelpMessage(): void; + clearCachedHelpMessage(): void; + command(cmd: string, description: string | undefined, isDefault: boolean, aliases: string[], deprecated?: boolean): void; + deferY18nLookup(str: string): string; + describe(keys: string | string[] | Dictionary, desc?: string): void; + epilog(msg: string): void; + example(cmd: string, description?: string): void; + fail(msg?: string | null, err?: YError | string): void; + failFn(f: FailureFunction): void; + freeze(): void; + functionDescription(fn: { + name?: string; + }): string; + getCommands(): [string, string, boolean, string[], boolean][]; + getDescriptions(): Dictionary; + getPositionalGroupName(): string; + getUsage(): [string, string][]; + getUsageDisabled(): boolean; + help(): string; + reset(localLookup: Dictionary): UsageInstance; + showHelp(level: 'error' | 'log' | ((message: string) => void)): void; + showHelpOnFail(enabled?: boolean | string, message?: string): UsageInstance; + showVersion(): void; + stringifiedValues(values?: any[], separator?: string): string; + unfreeze(): void; + usage(msg: string | null, description?: string | false): UsageInstance; + version(ver: any): void; + wrap(cols: number | null | undefined): void; +} +export interface FailureFunction { + (msg: string | undefined | null, err: YError | string | undefined, usage: UsageInstance): void; +} +export interface FrozenUsageInstance { + failMessage: string | undefined | null; + failureOutput: boolean; + usages: [string, string][]; + usageDisabled: boolean; + epilogs: string[]; + examples: [string, string][]; + commands: [string, string, boolean, string[], boolean][]; + descriptions: Dictionary; +} diff --git a/node_modules/nyc/node_modules/yargs/build/lib/usage.js b/node_modules/nyc/node_modules/yargs/build/lib/usage.js new file mode 100644 index 0000000..73f7b24 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/usage.js @@ -0,0 +1,540 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.usage = void 0; +// this file handles outputting usage instructions, +// failures, etc. keeps logging in one place. +const common_types_1 = require("./common-types"); +const obj_filter_1 = require("./obj-filter"); +const path = require("path"); +const yerror_1 = require("./yerror"); +const decamelize = require("decamelize"); +const setBlocking = require("set-blocking"); +const stringWidth = require("string-width"); +function usage(yargs, y18n) { + const __ = y18n.__; + const self = {}; + // methods for ouputting/building failure message. + const fails = []; + self.failFn = function failFn(f) { + fails.push(f); + }; + let failMessage = null; + let showHelpOnFail = true; + self.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) { + function parseFunctionArgs() { + return typeof arg1 === 'string' ? [true, arg1] : [arg1, arg2]; + } + const [enabled, message] = parseFunctionArgs(); + failMessage = message; + showHelpOnFail = enabled; + return self; + }; + let failureOutput = false; + self.fail = function fail(msg, err) { + const logger = yargs._getLoggerInstance(); + if (fails.length) { + for (let i = fails.length - 1; i >= 0; --i) { + fails[i](msg, err, self); + } + } + else { + if (yargs.getExitProcess()) + setBlocking(true); + // don't output failure message more than once + if (!failureOutput) { + failureOutput = true; + if (showHelpOnFail) { + yargs.showHelp('error'); + logger.error(); + } + if (msg || err) + logger.error(msg || err); + if (failMessage) { + if (msg || err) + logger.error(''); + logger.error(failMessage); + } + } + err = err || new yerror_1.YError(msg); + if (yargs.getExitProcess()) { + return yargs.exit(1); + } + else if (yargs._hasParseCallback()) { + return yargs.exit(1, err); + } + else { + throw err; + } + } + }; + // methods for ouputting/building help (usage) message. + let usages = []; + let usageDisabled = false; + self.usage = (msg, description) => { + if (msg === null) { + usageDisabled = true; + usages = []; + return self; + } + usageDisabled = false; + usages.push([msg, description || '']); + return self; + }; + self.getUsage = () => { + return usages; + }; + self.getUsageDisabled = () => { + return usageDisabled; + }; + self.getPositionalGroupName = () => { + return __('Positionals:'); + }; + let examples = []; + self.example = (cmd, description) => { + examples.push([cmd, description || '']); + }; + let commands = []; + self.command = function command(cmd, description, isDefault, aliases, deprecated = false) { + // the last default wins, so cancel out any previously set default + if (isDefault) { + commands = commands.map((cmdArray) => { + cmdArray[2] = false; + return cmdArray; + }); + } + commands.push([cmd, description || '', isDefault, aliases, deprecated]); + }; + self.getCommands = () => commands; + let descriptions = {}; + self.describe = function describe(keyOrKeys, desc) { + if (Array.isArray(keyOrKeys)) { + keyOrKeys.forEach((k) => { + self.describe(k, desc); + }); + } + else if (typeof keyOrKeys === 'object') { + Object.keys(keyOrKeys).forEach((k) => { + self.describe(k, keyOrKeys[k]); + }); + } + else { + descriptions[keyOrKeys] = desc; + } + }; + self.getDescriptions = () => descriptions; + let epilogs = []; + self.epilog = (msg) => { + epilogs.push(msg); + }; + let wrapSet = false; + let wrap; + self.wrap = (cols) => { + wrapSet = true; + wrap = cols; + }; + function getWrap() { + if (!wrapSet) { + wrap = windowWidth(); + wrapSet = true; + } + return wrap; + } + const deferY18nLookupPrefix = '__yargsString__:'; + self.deferY18nLookup = str => deferY18nLookupPrefix + str; + self.help = function help() { + if (cachedHelpMessage) + return cachedHelpMessage; + normalizeAliases(); + // handle old demanded API + const base$0 = yargs.customScriptName ? yargs.$0 : path.basename(yargs.$0); + const demandedOptions = yargs.getDemandedOptions(); + const demandedCommands = yargs.getDemandedCommands(); + const deprecatedOptions = yargs.getDeprecatedOptions(); + const groups = yargs.getGroups(); + const options = yargs.getOptions(); + let keys = []; + keys = keys.concat(Object.keys(descriptions)); + keys = keys.concat(Object.keys(demandedOptions)); + keys = keys.concat(Object.keys(demandedCommands)); + keys = keys.concat(Object.keys(options.default)); + keys = keys.filter(filterHiddenOptions); + keys = Object.keys(keys.reduce((acc, key) => { + if (key !== '_') + acc[key] = true; + return acc; + }, {})); + const theWrap = getWrap(); + const ui = require('cliui')({ + width: theWrap, + wrap: !!theWrap + }); + // the usage string. + if (!usageDisabled) { + if (usages.length) { + // user-defined usage. + usages.forEach((usage) => { + ui.div(`${usage[0].replace(/\$0/g, base$0)}`); + if (usage[1]) { + ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] }); + } + }); + ui.div(); + } + else if (commands.length) { + let u = null; + // demonstrate how commands are used. + if (demandedCommands._) { + u = `${base$0} <${__('command')}>\n`; + } + else { + u = `${base$0} [${__('command')}]\n`; + } + ui.div(`${u}`); + } + } + // your application's commands, i.e., non-option + // arguments populated in '_'. + if (commands.length) { + ui.div(__('Commands:')); + const context = yargs.getContext(); + const parentCommands = context.commands.length ? `${context.commands.join(' ')} ` : ''; + if (yargs.getParserConfiguration()['sort-commands'] === true) { + commands = commands.sort((a, b) => a[0].localeCompare(b[0])); + } + commands.forEach((command) => { + const commandString = `${base$0} ${parentCommands}${command[0].replace(/^\$0 ?/, '')}`; // drop $0 from default commands. + ui.span({ + text: commandString, + padding: [0, 2, 0, 2], + width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4 + }, { text: command[1] }); + const hints = []; + if (command[2]) + hints.push(`[${__('default')}]`); + if (command[3] && command[3].length) { + hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`); + } + if (command[4]) { + if (typeof command[4] === 'string') { + hints.push(`[${__('deprecated: %s', command[4])}]`); + } + else { + hints.push(`[${__('deprecated')}]`); + } + } + if (hints.length) { + ui.div({ text: hints.join(' '), padding: [0, 0, 0, 2], align: 'right' }); + } + else { + ui.div(); + } + }); + ui.div(); + } + // perform some cleanup on the keys array, making it + // only include top-level keys not their aliases. + const aliasKeys = (Object.keys(options.alias) || []) + .concat(Object.keys(yargs.parsed.newAliases) || []); + keys = keys.filter(key => !yargs.parsed.newAliases[key] && aliasKeys.every(alias => (options.alias[alias] || []).indexOf(key) === -1)); + // populate 'Options:' group with any keys that have not + // explicitly had a group set. + const defaultGroup = __('Options:'); + if (!groups[defaultGroup]) + groups[defaultGroup] = []; + addUngroupedKeys(keys, options.alias, groups, defaultGroup); + // display 'Options:' table along with any custom tables: + Object.keys(groups).forEach((groupName) => { + if (!groups[groupName].length) + return; + // if we've grouped the key 'f', but 'f' aliases 'foobar', + // normalizedKeys should contain only 'foobar'. + const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => { + if (~aliasKeys.indexOf(key)) + return key; + for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) { + if (~(options.alias[aliasKey] || []).indexOf(key)) + return aliasKey; + } + return key; + }); + if (normalizedKeys.length < 1) + return; + ui.div(groupName); + // actually generate the switches string --foo, -f, --bar. + const switches = normalizedKeys.reduce((acc, key) => { + acc[key] = [key].concat(options.alias[key] || []) + .map(sw => { + // for the special positional group don't + // add '--' or '-' prefix. + if (groupName === self.getPositionalGroupName()) + return sw; + else { + return ( + // matches yargs-parser logic in which single-digits + // aliases declared with a boolean type are now valid + /^[0-9]$/.test(sw) + ? ~options.boolean.indexOf(key) ? '-' : '--' + : sw.length > 1 ? '--' : '-') + sw; + } + }) + .join(', '); + return acc; + }, {}); + normalizedKeys.forEach((key) => { + const kswitch = switches[key]; + let desc = descriptions[key] || ''; + let type = null; + if (~desc.lastIndexOf(deferY18nLookupPrefix)) + desc = __(desc.substring(deferY18nLookupPrefix.length)); + if (~options.boolean.indexOf(key)) + type = `[${__('boolean')}]`; + if (~options.count.indexOf(key)) + type = `[${__('count')}]`; + if (~options.string.indexOf(key)) + type = `[${__('string')}]`; + if (~options.normalize.indexOf(key)) + type = `[${__('string')}]`; + if (~options.array.indexOf(key)) + type = `[${__('array')}]`; + if (~options.number.indexOf(key)) + type = `[${__('number')}]`; + const deprecatedExtra = (deprecated) => typeof deprecated === 'string' + ? `[${__('deprecated: %s', deprecated)}]` + : `[${__('deprecated')}]`; + const extra = [ + (key in deprecatedOptions) ? deprecatedExtra(deprecatedOptions[key]) : null, + type, + (key in demandedOptions) ? `[${__('required')}]` : null, + options.choices && options.choices[key] ? `[${__('choices:')} ${self.stringifiedValues(options.choices[key])}]` : null, + defaultString(options.default[key], options.defaultDescription[key]) + ].filter(Boolean).join(' '); + ui.span({ text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches, theWrap) + 4 }, desc); + if (extra) + ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' }); + else + ui.div(); + }); + ui.div(); + }); + // describe some common use-cases for your application. + if (examples.length) { + ui.div(__('Examples:')); + examples.forEach((example) => { + example[0] = example[0].replace(/\$0/g, base$0); + }); + examples.forEach((example) => { + if (example[1] === '') { + ui.div({ + text: example[0], + padding: [0, 2, 0, 2] + }); + } + else { + ui.div({ + text: example[0], + padding: [0, 2, 0, 2], + width: maxWidth(examples, theWrap) + 4 + }, { + text: example[1] + }); + } + }); + ui.div(); + } + // the usage string. + if (epilogs.length > 0) { + const e = epilogs.map(epilog => epilog.replace(/\$0/g, base$0)).join('\n'); + ui.div(`${e}\n`); + } + // Remove the trailing white spaces + return ui.toString().replace(/\s*$/, ''); + }; + // return the maximum width of a string + // in the left-hand column of a table. + function maxWidth(table, theWrap, modifier) { + let width = 0; + // table might be of the form [leftColumn], + // or {key: leftColumn} + if (!Array.isArray(table)) { + table = Object.values(table).map(v => [v]); + } + table.forEach((v) => { + width = Math.max(stringWidth(modifier ? `${modifier} ${v[0]}` : v[0]), width); + }); + // if we've enabled 'wrap' we should limit + // the max-width of the left-column. + if (theWrap) + width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10)); + return width; + } + // make sure any options set for aliases, + // are copied to the keys being aliased. + function normalizeAliases() { + // handle old demanded API + const demandedOptions = yargs.getDemandedOptions(); + const options = yargs.getOptions(); + (Object.keys(options.alias) || []).forEach((key) => { + options.alias[key].forEach((alias) => { + // copy descriptions. + if (descriptions[alias]) + self.describe(key, descriptions[alias]); + // copy demanded. + if (alias in demandedOptions) + yargs.demandOption(key, demandedOptions[alias]); + // type messages. + if (~options.boolean.indexOf(alias)) + yargs.boolean(key); + if (~options.count.indexOf(alias)) + yargs.count(key); + if (~options.string.indexOf(alias)) + yargs.string(key); + if (~options.normalize.indexOf(alias)) + yargs.normalize(key); + if (~options.array.indexOf(alias)) + yargs.array(key); + if (~options.number.indexOf(alias)) + yargs.number(key); + }); + }); + } + // if yargs is executing an async handler, we take a snapshot of the + // help message to display on failure: + let cachedHelpMessage; + self.cacheHelpMessage = function () { + cachedHelpMessage = this.help(); + }; + // however this snapshot must be cleared afterwards + // not to be be used by next calls to parse + self.clearCachedHelpMessage = function () { + cachedHelpMessage = undefined; + }; + // given a set of keys, place any keys that are + // ungrouped under the 'Options:' grouping. + function addUngroupedKeys(keys, aliases, groups, defaultGroup) { + let groupedKeys = []; + let toCheck = null; + Object.keys(groups).forEach((group) => { + groupedKeys = groupedKeys.concat(groups[group]); + }); + keys.forEach((key) => { + toCheck = [key].concat(aliases[key]); + if (!toCheck.some(k => groupedKeys.indexOf(k) !== -1)) { + groups[defaultGroup].push(key); + } + }); + return groupedKeys; + } + function filterHiddenOptions(key) { + return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt]; + } + self.showHelp = (level) => { + const logger = yargs._getLoggerInstance(); + if (!level) + level = 'error'; + const emit = typeof level === 'function' ? level : logger[level]; + emit(self.help()); + }; + self.functionDescription = (fn) => { + const description = fn.name ? decamelize(fn.name, '-') : __('generated-value'); + return ['(', description, ')'].join(''); + }; + self.stringifiedValues = function stringifiedValues(values, separator) { + let string = ''; + const sep = separator || ', '; + const array = [].concat(values); + if (!values || !array.length) + return string; + array.forEach((value) => { + if (string.length) + string += sep; + string += JSON.stringify(value); + }); + return string; + }; + // format the default-value-string displayed in + // the right-hand column. + function defaultString(value, defaultDescription) { + let string = `[${__('default:')} `; + if (value === undefined && !defaultDescription) + return null; + if (defaultDescription) { + string += defaultDescription; + } + else { + switch (typeof value) { + case 'string': + string += `"${value}"`; + break; + case 'object': + string += JSON.stringify(value); + break; + default: + string += value; + } + } + return `${string}]`; + } + // guess the width of the console window, max-width 80. + function windowWidth() { + const maxWidth = 80; + // CI is not a TTY + /* c8 ignore next 2 */ + if (typeof process === 'object' && process.stdout && process.stdout.columns) { + return Math.min(maxWidth, process.stdout.columns); + } + else { + return maxWidth; + } + } + // logic for displaying application version. + let version = null; + self.version = (ver) => { + version = ver; + }; + self.showVersion = () => { + const logger = yargs._getLoggerInstance(); + logger.log(version); + }; + self.reset = function reset(localLookup) { + // do not reset wrap here + // do not reset fails here + failMessage = null; + failureOutput = false; + usages = []; + usageDisabled = false; + epilogs = []; + examples = []; + commands = []; + descriptions = obj_filter_1.objFilter(descriptions, k => !localLookup[k]); + return self; + }; + const frozens = []; + self.freeze = function freeze() { + frozens.push({ + failMessage, + failureOutput, + usages, + usageDisabled, + epilogs, + examples, + commands, + descriptions + }); + }; + self.unfreeze = function unfreeze() { + const frozen = frozens.pop(); + common_types_1.assertNotStrictEqual(frozen, undefined); + ({ + failMessage, + failureOutput, + usages, + usageDisabled, + epilogs, + examples, + commands, + descriptions + } = frozen); + }; + return self; +} +exports.usage = usage; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/validation.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/validation.d.ts new file mode 100644 index 0000000..e2d7854 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/validation.d.ts @@ -0,0 +1,34 @@ +import { Dictionary } from './common-types'; +import { UsageInstance } from './usage'; +import { YargsInstance, Arguments } from './yargs'; +import { DetailedArguments } from 'yargs-parser'; +import { Y18N } from 'y18n'; +export declare function validation(yargs: YargsInstance, usage: UsageInstance, y18n: Y18N): ValidationInstance; +/** Instance of the validation module. */ +export interface ValidationInstance { + check(f: CustomCheck['func'], global: boolean): void; + conflicting(argv: Arguments): void; + conflicts(key: string | Dictionary, value?: string | string[]): void; + customChecks(argv: Arguments, aliases: DetailedArguments['aliases']): void; + freeze(): void; + getConflicting(): Dictionary<(string | undefined)[]>; + getImplied(): Dictionary; + implications(argv: Arguments): void; + implies(key: string | Dictionary, value?: KeyOrPos | KeyOrPos[]): void; + isValidAndSomeAliasIsNotNew(key: string, aliases: DetailedArguments['aliases']): boolean; + limitedChoices(argv: Arguments): void; + nonOptionCount(argv: Arguments): void; + positionalCount(required: number, observed: number): void; + recommendCommands(cmd: string, potentialCommands: string[]): void; + requiredArguments(argv: Arguments): void; + reset(localLookup: Dictionary): ValidationInstance; + unfreeze(): void; + unknownArguments(argv: Arguments, aliases: DetailedArguments['aliases'], positionalMap: Dictionary, isDefaultCommand: boolean): void; + unknownCommands(argv: Arguments): boolean; +} +interface CustomCheck { + func: (argv: Arguments, aliases: DetailedArguments['aliases']) => any; + global: boolean; +} +export declare type KeyOrPos = string | number; +export {}; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/validation.js b/node_modules/nyc/node_modules/yargs/build/lib/validation.js new file mode 100644 index 0000000..60c5e43 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/validation.js @@ -0,0 +1,330 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validation = void 0; +const argsert_1 = require("./argsert"); +const common_types_1 = require("./common-types"); +const levenshtein_1 = require("./levenshtein"); +const obj_filter_1 = require("./obj-filter"); +const specialKeys = ['$0', '--', '_']; +// validation-type-stuff, missing params, +// bad implications, custom checks. +function validation(yargs, usage, y18n) { + const __ = y18n.__; + const __n = y18n.__n; + const self = {}; + // validate appropriate # of non-option + // arguments were provided, i.e., '_'. + self.nonOptionCount = function nonOptionCount(argv) { + const demandedCommands = yargs.getDemandedCommands(); + // don't count currently executing commands + const _s = argv._.length - yargs.getContext().commands.length; + if (demandedCommands._ && (_s < demandedCommands._.min || _s > demandedCommands._.max)) { + if (_s < demandedCommands._.min) { + if (demandedCommands._.minMsg !== undefined) { + usage.fail( + // replace $0 with observed, $1 with expected. + demandedCommands._.minMsg + ? demandedCommands._.minMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.min.toString()) + : null); + } + else { + usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', _s, _s, demandedCommands._.min)); + } + } + else if (_s > demandedCommands._.max) { + if (demandedCommands._.maxMsg !== undefined) { + usage.fail( + // replace $0 with observed, $1 with expected. + demandedCommands._.maxMsg + ? demandedCommands._.maxMsg.replace(/\$0/g, _s.toString()).replace(/\$1/, demandedCommands._.max.toString()) + : null); + } + else { + usage.fail(__n('Too many non-option arguments: got %s, maximum of %s', 'Too many non-option arguments: got %s, maximum of %s', _s, _s, demandedCommands._.max)); + } + } + } + }; + // validate the appropriate # of + // positional arguments were provided: + self.positionalCount = function positionalCount(required, observed) { + if (observed < required) { + usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', observed, observed, required)); + } + }; + // make sure all the required arguments are present. + self.requiredArguments = function requiredArguments(argv) { + const demandedOptions = yargs.getDemandedOptions(); + let missing = null; + for (const key of Object.keys(demandedOptions)) { + if (!Object.prototype.hasOwnProperty.call(argv, key) || typeof argv[key] === 'undefined') { + missing = missing || {}; + missing[key] = demandedOptions[key]; + } + } + if (missing) { + const customMsgs = []; + for (const key of Object.keys(missing)) { + const msg = missing[key]; + if (msg && customMsgs.indexOf(msg) < 0) { + customMsgs.push(msg); + } + } + const customMsg = customMsgs.length ? `\n${customMsgs.join('\n')}` : ''; + usage.fail(__n('Missing required argument: %s', 'Missing required arguments: %s', Object.keys(missing).length, Object.keys(missing).join(', ') + customMsg)); + } + }; + // check for unknown arguments (strict-mode). + self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand) { + const commandKeys = yargs.getCommandInstance().getCommands(); + const unknown = []; + const currentContext = yargs.getContext(); + Object.keys(argv).forEach((key) => { + if (specialKeys.indexOf(key) === -1 && + !Object.prototype.hasOwnProperty.call(positionalMap, key) && + !Object.prototype.hasOwnProperty.call(yargs._getParseContext(), key) && + !self.isValidAndSomeAliasIsNotNew(key, aliases)) { + unknown.push(key); + } + }); + if ((currentContext.commands.length > 0) || (commandKeys.length > 0) || isDefaultCommand) { + argv._.slice(currentContext.commands.length).forEach((key) => { + if (commandKeys.indexOf(key) === -1) { + unknown.push(key); + } + }); + } + if (unknown.length > 0) { + usage.fail(__n('Unknown argument: %s', 'Unknown arguments: %s', unknown.length, unknown.join(', '))); + } + }; + self.unknownCommands = function unknownCommands(argv) { + const commandKeys = yargs.getCommandInstance().getCommands(); + const unknown = []; + const currentContext = yargs.getContext(); + if ((currentContext.commands.length > 0) || (commandKeys.length > 0)) { + argv._.slice(currentContext.commands.length).forEach((key) => { + if (commandKeys.indexOf(key) === -1) { + unknown.push(key); + } + }); + } + if (unknown.length > 0) { + usage.fail(__n('Unknown command: %s', 'Unknown commands: %s', unknown.length, unknown.join(', '))); + return true; + } + else { + return false; + } + }; + // check for a key that is not an alias, or for which every alias is new, + // implying that it was invented by the parser, e.g., during camelization + self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) { + if (!Object.prototype.hasOwnProperty.call(aliases, key)) { + return false; + } + const newAliases = yargs.parsed.newAliases; + for (const a of [key, ...aliases[key]]) { + if (!Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]) { + return true; + } + } + return false; + }; + // validate arguments limited to enumerated choices + self.limitedChoices = function limitedChoices(argv) { + const options = yargs.getOptions(); + const invalid = {}; + if (!Object.keys(options.choices).length) + return; + Object.keys(argv).forEach((key) => { + if (specialKeys.indexOf(key) === -1 && + Object.prototype.hasOwnProperty.call(options.choices, key)) { + [].concat(argv[key]).forEach((value) => { + // TODO case-insensitive configurability + if (options.choices[key].indexOf(value) === -1 && + value !== undefined) { + invalid[key] = (invalid[key] || []).concat(value); + } + }); + } + }); + const invalidKeys = Object.keys(invalid); + if (!invalidKeys.length) + return; + let msg = __('Invalid values:'); + invalidKeys.forEach((key) => { + msg += `\n ${__('Argument: %s, Given: %s, Choices: %s', key, usage.stringifiedValues(invalid[key]), usage.stringifiedValues(options.choices[key]))}`; + }); + usage.fail(msg); + }; + // custom checks, added using the `check` option on yargs. + let checks = []; + self.check = function check(f, global) { + checks.push({ + func: f, + global + }); + }; + self.customChecks = function customChecks(argv, aliases) { + for (let i = 0, f; (f = checks[i]) !== undefined; i++) { + const func = f.func; + let result = null; + try { + result = func(argv, aliases); + } + catch (err) { + usage.fail(err.message ? err.message : err, err); + continue; + } + if (!result) { + usage.fail(__('Argument check failed: %s', func.toString())); + } + else if (typeof result === 'string' || result instanceof Error) { + usage.fail(result.toString(), result); + } + } + }; + // check implications, argument foo implies => argument bar. + let implied = {}; + self.implies = function implies(key, value) { + argsert_1.argsert(' [array|number|string]', [key, value], arguments.length); + if (typeof key === 'object') { + Object.keys(key).forEach((k) => { + self.implies(k, key[k]); + }); + } + else { + yargs.global(key); + if (!implied[key]) { + implied[key] = []; + } + if (Array.isArray(value)) { + value.forEach((i) => self.implies(key, i)); + } + else { + common_types_1.assertNotStrictEqual(value, undefined); + implied[key].push(value); + } + } + }; + self.getImplied = function getImplied() { + return implied; + }; + function keyExists(argv, val) { + // convert string '1' to number 1 + const num = Number(val); + val = isNaN(num) ? val : num; + if (typeof val === 'number') { + // check length of argv._ + val = argv._.length >= val; + } + else if (val.match(/^--no-.+/)) { + // check if key/value doesn't exist + val = val.match(/^--no-(.+)/)[1]; + val = !argv[val]; + } + else { + // check if key/value exists + val = argv[val]; + } + return val; + } + self.implications = function implications(argv) { + const implyFail = []; + Object.keys(implied).forEach((key) => { + const origKey = key; + (implied[key] || []).forEach((value) => { + let key = origKey; + const origValue = value; + key = keyExists(argv, key); + value = keyExists(argv, value); + if (key && !value) { + implyFail.push(` ${origKey} -> ${origValue}`); + } + }); + }); + if (implyFail.length) { + let msg = `${__('Implications failed:')}\n`; + implyFail.forEach((value) => { + msg += (value); + }); + usage.fail(msg); + } + }; + let conflicting = {}; + self.conflicts = function conflicts(key, value) { + argsert_1.argsert(' [array|string]', [key, value], arguments.length); + if (typeof key === 'object') { + Object.keys(key).forEach((k) => { + self.conflicts(k, key[k]); + }); + } + else { + yargs.global(key); + if (!conflicting[key]) { + conflicting[key] = []; + } + if (Array.isArray(value)) { + value.forEach((i) => self.conflicts(key, i)); + } + else { + conflicting[key].push(value); + } + } + }; + self.getConflicting = () => conflicting; + self.conflicting = function conflictingFn(argv) { + Object.keys(argv).forEach((key) => { + if (conflicting[key]) { + conflicting[key].forEach((value) => { + // we default keys to 'undefined' that have been configured, we should not + // apply conflicting check unless they are a value other than 'undefined'. + if (value && argv[key] !== undefined && argv[value] !== undefined) { + usage.fail(__('Arguments %s and %s are mutually exclusive', key, value)); + } + }); + } + }); + }; + self.recommendCommands = function recommendCommands(cmd, potentialCommands) { + const threshold = 3; // if it takes more than three edits, let's move on. + potentialCommands = potentialCommands.sort((a, b) => b.length - a.length); + let recommended = null; + let bestDistance = Infinity; + for (let i = 0, candidate; (candidate = potentialCommands[i]) !== undefined; i++) { + const d = levenshtein_1.levenshtein(cmd, candidate); + if (d <= threshold && d < bestDistance) { + bestDistance = d; + recommended = candidate; + } + } + if (recommended) + usage.fail(__('Did you mean %s?', recommended)); + }; + self.reset = function reset(localLookup) { + implied = obj_filter_1.objFilter(implied, k => !localLookup[k]); + conflicting = obj_filter_1.objFilter(conflicting, k => !localLookup[k]); + checks = checks.filter(c => c.global); + return self; + }; + const frozens = []; + self.freeze = function freeze() { + frozens.push({ + implied, + checks, + conflicting + }); + }; + self.unfreeze = function unfreeze() { + const frozen = frozens.pop(); + common_types_1.assertNotStrictEqual(frozen, undefined); + ({ + implied, + checks, + conflicting + } = frozen); + }; + return self; +} +exports.validation = validation; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/yargs.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/yargs.d.ts new file mode 100644 index 0000000..8e6e27c --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/yargs.d.ts @@ -0,0 +1,274 @@ +/// +import { CommandInstance, CommandHandler, CommandBuilderDefinition, CommandBuilder, CommandHandlerCallback, FinishCommandHandler } from './command'; +import { Dictionary } from './common-types'; +import { Arguments as ParserArguments, DetailedArguments as ParserDetailedArguments, Configuration as ParserConfiguration, Options as ParserOptions, ConfigCallback, CoerceCallback } from 'yargs-parser'; +import { YError } from './yerror'; +import { UsageInstance, FailureFunction } from './usage'; +import { CompletionFunction } from './completion'; +import { ValidationInstance, KeyOrPos } from './validation'; +import { Y18N } from 'y18n'; +import { MiddlewareCallback, Middleware } from './middleware'; +import { RequireDirectoryOptions } from 'require-directory'; +export declare function Yargs(processArgs?: string | string[], cwd?: string, parentRequire?: NodeRequire): YargsInstance; +export declare function rebase(base: string, dir: string): string; +/** Instance of the yargs module. */ +export interface YargsInstance { + $0: string; + argv: Arguments; + customScriptName: boolean; + parsed: DetailedArguments | false; + _copyDoubleDash>(argv: T): T; + _getLoggerInstance(): LoggerInstance; + _getParseContext(): Object; + _hasOutput(): boolean; + _hasParseCallback(): boolean; + _parseArgs: { + (args: null, shortCircuit: null, _calledFromCommand: boolean, commandIndex?: number): Arguments | Promise; + (args: string | string[], shortCircuit?: boolean): Arguments | Promise; + }; + _runValidation(argv: Arguments, aliases: Dictionary, positionalMap: Dictionary, parseErrors: Error | null, isDefaultCommand?: boolean): void; + _setHasOutput(): void; + addHelpOpt: { + (opt?: string | false): YargsInstance; + (opt?: string, msg?: string): YargsInstance; + }; + addShowHiddenOpt: { + (opt?: string | false): YargsInstance; + (opt?: string, msg?: string): YargsInstance; + }; + alias: { + (keys: string | string[], aliases: string | string[]): YargsInstance; + (keyAliases: Dictionary): YargsInstance; + }; + array(keys: string | string[]): YargsInstance; + boolean(keys: string | string[]): YargsInstance; + check(f: (argv: Arguments, aliases: Dictionary) => any, _global?: boolean): YargsInstance; + choices: { + (keys: string | string[], choices: string | string[]): YargsInstance; + (keyChoices: Dictionary): YargsInstance; + }; + coerce: { + (keys: string | string[], coerceCallback: CoerceCallback): YargsInstance; + (keyCoerceCallbacks: Dictionary): YargsInstance; + }; + command(cmd: string | string[], description: CommandHandler['description'], builder?: CommandBuilderDefinition | CommandBuilder, handler?: CommandHandlerCallback, commandMiddleware?: Middleware[], deprecated?: boolean): YargsInstance; + commandDir(dir: string, opts?: RequireDirectoryOptions): YargsInstance; + completion: { + (cmd?: string, fn?: CompletionFunction): YargsInstance; + (cmd?: string, desc?: string | false, fn?: CompletionFunction): YargsInstance; + }; + config: { + (config: Dictionary): YargsInstance; + (keys?: string | string[], configCallback?: ConfigCallback): YargsInstance; + (keys?: string | string[], msg?: string, configCallback?: ConfigCallback): YargsInstance; + }; + conflicts: { + (key: string, conflictsWith: string | string[]): YargsInstance; + (keyConflicts: Dictionary): YargsInstance; + }; + count(keys: string | string[]): YargsInstance; + default: { + (key: string, value: any, defaultDescription?: string): YargsInstance; + (keys: string[], value: Exclude): YargsInstance; + (keys: Dictionary): YargsInstance; + }; + defaults: YargsInstance['default']; + demand: { + (min: number, max?: number | string, msg?: string): YargsInstance; + (keys: string | string[], msg?: string | true): YargsInstance; + (keys: string | string[], max: string[], msg?: string | true): YargsInstance; + (keyMsgs: Dictionary): YargsInstance; + (keyMsgs: Dictionary, max: string[], msg?: string): YargsInstance; + }; + demandCommand(): YargsInstance; + demandCommand(min: number, minMsg?: string): YargsInstance; + demandCommand(min: number, max: number, minMsg?: string | null, maxMsg?: string | null): YargsInstance; + demandOption: { + (keys: string | string[], msg?: string): YargsInstance; + (keyMsgs: Dictionary): YargsInstance; + }; + deprecateOption(option: string, message?: string | boolean): YargsInstance; + describe: { + (keys: string | string[], description?: string): YargsInstance; + (keyDescriptions: Dictionary): YargsInstance; + }; + detectLocale(detect: boolean): YargsInstance; + env(prefix?: string | false): YargsInstance; + epilog: YargsInstance['epilogue']; + epilogue(msg: string): YargsInstance; + example(cmd: string | [string, string?][], description?: string): YargsInstance; + exit(code: number, err?: YError | string): void; + exitProcess(enabled: boolean): YargsInstance; + fail(f: FailureFunction): YargsInstance; + getCommandInstance(): CommandInstance; + getCompletion(args: string[], done: (completions: string[]) => any): void; + getContext(): Context; + getDemandedCommands(): Options['demandedCommands']; + getDemandedOptions(): Options['demandedOptions']; + getDeprecatedOptions(): Options['deprecatedOptions']; + getDetectLocale(): boolean; + getExitProcess(): boolean; + getGroups(): Dictionary; + getHandlerFinishCommand(): FinishCommandHandler | null; + getOptions(): Options; + getParserConfiguration(): Configuration; + getStrict(): boolean; + getStrictCommands(): boolean; + getUsageInstance(): UsageInstance; + getValidationInstance(): ValidationInstance; + global(keys: string | string[], global?: boolean): YargsInstance; + group(keys: string | string[], groupName: string): YargsInstance; + help: YargsInstance['addHelpOpt']; + hide(key: string): YargsInstance; + implies: { + (key: string, implication: KeyOrPos | KeyOrPos[]): YargsInstance; + (keyImplications: Dictionary): YargsInstance; + }; + locale: { + (): string; + (locale: string): YargsInstance; + }; + middleware(callback: MiddlewareCallback | MiddlewareCallback[], applyBeforeValidation?: boolean): YargsInstance; + nargs: { + (keys: string | string[], nargs: number): YargsInstance; + (keyNargs: Dictionary): YargsInstance; + }; + normalize(keys: string | string[]): YargsInstance; + number(keys: string | string[]): YargsInstance; + onFinishCommand(f: FinishCommandHandler): YargsInstance; + option: { + (key: string, optionDefinition: OptionDefinition): YargsInstance; + (keyOptionDefinitions: Dictionary): YargsInstance; + }; + options: YargsInstance['option']; + parse: { + (): Arguments | Promise; + (args: string | string[], context: object, parseCallback?: ParseCallback): Arguments | Promise; + (args: string | string[], parseCallback: ParseCallback): Arguments | Promise; + (args: string | string[], shortCircuit: boolean): Arguments | Promise; + }; + parserConfiguration(config: Configuration): YargsInstance; + pkgConf(key: string, rootPath?: string): YargsInstance; + positional(key: string, positionalDefinition: PositionalDefinition): YargsInstance; + recommendCommands(recommend: boolean): YargsInstance; + require: YargsInstance['demand']; + required: YargsInstance['demand']; + requiresArg(keys: string | string[] | Dictionary): YargsInstance; + reset(aliases?: DetailedArguments['aliases']): YargsInstance; + resetOptions(aliases?: DetailedArguments['aliases']): YargsInstance; + scriptName(scriptName: string): YargsInstance; + showCompletionScript($0?: string, cmd?: string): YargsInstance; + showHelp(level: 'error' | 'log' | ((message: string) => void)): YargsInstance; + showHelpOnFail: { + (message?: string): YargsInstance; + (enabled: boolean, message: string): YargsInstance; + }; + showHidden: YargsInstance['addShowHiddenOpt']; + skipValidation(keys: string | string[]): YargsInstance; + strict(enable?: boolean): YargsInstance; + strictCommands(enable?: boolean): YargsInstance; + string(key: string | string[]): YargsInstance; + terminalWidth(): number | null; + updateStrings(obj: Dictionary): YargsInstance; + updateLocale: YargsInstance['updateStrings']; + usage: { + (msg: string | null): YargsInstance; + (msg: string, description: CommandHandler['description'], builder?: CommandBuilderDefinition | CommandBuilder, handler?: CommandHandlerCallback): YargsInstance; + }; + version: { + (ver?: string | false): YargsInstance; + (key?: string, ver?: string): YargsInstance; + (key?: string, msg?: string, ver?: string): YargsInstance; + }; + wrap(cols: number | null | undefined): YargsInstance; +} +export declare function isYargsInstance(y: YargsInstance | void): y is YargsInstance; +/** Yargs' context. */ +export interface Context { + commands: string[]; + files: string[]; + fullCommands: string[]; +} +declare type LoggerInstance = Pick; +export interface Options extends ParserOptions { + __: Y18N['__']; + alias: Dictionary; + array: string[]; + boolean: string[]; + choices: Dictionary; + config: Dictionary; + configObjects: Dictionary[]; + configuration: Configuration; + count: string[]; + defaultDescription: Dictionary; + demandedCommands: Dictionary<{ + min: number; + max: number; + minMsg?: string | null; + maxMsg?: string | null; + }>; + demandedOptions: Dictionary; + deprecatedOptions: Dictionary; + hiddenOptions: string[]; + /** Manually set keys */ + key: Dictionary; + local: string[]; + normalize: string[]; + number: string[]; + showHiddenOpt: string; + skipValidation: string[]; + string: string[]; +} +export interface Configuration extends Partial { + /** Should a config object be deep-merged with the object config it extends? */ + 'deep-merge-config'?: boolean; + /** Should commands be sorted in help? */ + 'sort-commands'?: boolean; +} +export interface OptionDefinition { + alias?: string | string[]; + array?: boolean; + boolean?: boolean; + choices?: string | string[]; + coerce?: CoerceCallback; + config?: boolean; + configParser?: ConfigCallback; + conflicts?: string | string[]; + count?: boolean; + default?: any; + defaultDescription?: string; + deprecate?: string | boolean; + deprecated?: OptionDefinition['deprecate']; + desc?: string; + describe?: OptionDefinition['desc']; + description?: OptionDefinition['desc']; + demand?: string | true; + demandOption?: OptionDefinition['demand']; + global?: boolean; + group?: string; + hidden?: boolean; + implies?: string | number | KeyOrPos[]; + nargs?: number; + normalize?: boolean; + number?: boolean; + require?: OptionDefinition['demand']; + required?: OptionDefinition['demand']; + requiresArg?: boolean; + skipValidation?: boolean; + string?: boolean; + type?: 'array' | 'boolean' | 'count' | 'number' | 'string'; +} +interface PositionalDefinition extends Pick { + type?: 'boolean' | 'number' | 'string'; +} +interface ParseCallback { + (err: YError | string | undefined | null, argv: Arguments | Promise, output: string): void; +} +export interface Arguments extends ParserArguments { + /** The script name or node command */ + $0: string; +} +export interface DetailedArguments extends ParserDetailedArguments { + argv: Arguments; +} +export {}; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/yargs.js b/node_modules/nyc/node_modules/yargs/build/lib/yargs.js new file mode 100644 index 0000000..316f3d6 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/yargs.js @@ -0,0 +1,1190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isYargsInstance = exports.rebase = exports.Yargs = void 0; +const command_1 = require("./command"); +const common_types_1 = require("./common-types"); +const yerror_1 = require("./yerror"); +const usage_1 = require("./usage"); +const argsert_1 = require("./argsert"); +const fs = require("fs"); +const completion_1 = require("./completion"); +const path = require("path"); +const validation_1 = require("./validation"); +const obj_filter_1 = require("./obj-filter"); +const apply_extends_1 = require("./apply-extends"); +const middleware_1 = require("./middleware"); +const processArgv = require("./process-argv"); +const is_promise_1 = require("./is-promise"); +const Parser = require("yargs-parser"); +const y18nFactory = require("y18n"); +const setBlocking = require("set-blocking"); +const findUp = require("find-up"); +const requireMainFilename = require("require-main-filename"); +function Yargs(processArgs = [], cwd = process.cwd(), parentRequire = require) { + const self = {}; + let command; + let completion = null; + let groups = {}; + const globalMiddleware = []; + let output = ''; + const preservedGroups = {}; + let usage; + let validation; + let handlerFinishCommand = null; + const y18n = y18nFactory({ + directory: path.resolve(__dirname, '../../locales'), + updateFiles: false + }); + self.middleware = middleware_1.globalMiddlewareFactory(globalMiddleware, self); + self.scriptName = function (scriptName) { + self.customScriptName = true; + self.$0 = scriptName; + return self; + }; + // ignore the node bin, specify this in your + // bin file with #!/usr/bin/env node + let default$0; + if (/\b(node|iojs|electron)(\.exe)?$/.test(process.argv[0])) { + default$0 = process.argv.slice(1, 2); + } + else { + default$0 = process.argv.slice(0, 1); + } + self.$0 = default$0 + .map(x => { + const b = rebase(cwd, x); + return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x; + }) + .join(' ').trim(); + if (process.env._ !== undefined && processArgv.getProcessArgvBin() === process.env._) { + self.$0 = process.env._.replace(`${path.dirname(process.execPath)}/`, ''); + } + // use context object to keep track of resets, subcommand execution, etc + // submodules should modify and check the state of context as necessary + const context = { resets: -1, commands: [], fullCommands: [], files: [] }; + self.getContext = () => context; + // puts yargs back into an initial state. any keys + // that have been set to "global" will not be reset + // by this action. + let options; + self.resetOptions = self.reset = function resetOptions(aliases = {}) { + context.resets++; + options = options || {}; + // put yargs back into an initial state, this + // logic is used to build a nested command + // hierarchy. + const tmpOptions = {}; + tmpOptions.local = options.local ? options.local : []; + tmpOptions.configObjects = options.configObjects ? options.configObjects : []; + // if a key has been explicitly set as local, + // we should reset it before passing options to command. + const localLookup = {}; + tmpOptions.local.forEach((l) => { + localLookup[l] = true; + (aliases[l] || []).forEach((a) => { + localLookup[a] = true; + }); + }); + // add all groups not set to local to preserved groups + Object.assign(preservedGroups, Object.keys(groups).reduce((acc, groupName) => { + const keys = groups[groupName].filter(key => !(key in localLookup)); + if (keys.length > 0) { + acc[groupName] = keys; + } + return acc; + }, {})); + // groups can now be reset + groups = {}; + const arrayOptions = [ + 'array', 'boolean', 'string', 'skipValidation', + 'count', 'normalize', 'number', + 'hiddenOptions' + ]; + const objectOptions = [ + 'narg', 'key', 'alias', 'default', 'defaultDescription', + 'config', 'choices', 'demandedOptions', 'demandedCommands', 'coerce', + 'deprecatedOptions' + ]; + arrayOptions.forEach(k => { + tmpOptions[k] = (options[k] || []).filter(k => !localLookup[k]); + }); + objectOptions.forEach((k) => { + tmpOptions[k] = obj_filter_1.objFilter(options[k], k => !localLookup[k]); + }); + tmpOptions.envPrefix = options.envPrefix; + options = tmpOptions; + // if this is the first time being executed, create + // instances of all our helpers -- otherwise just reset. + usage = usage ? usage.reset(localLookup) : usage_1.usage(self, y18n); + validation = validation ? validation.reset(localLookup) : validation_1.validation(self, usage, y18n); + command = command ? command.reset() : command_1.command(self, usage, validation, globalMiddleware); + if (!completion) + completion = completion_1.completion(self, usage, command); + completionCommand = null; + output = ''; + exitError = null; + hasOutput = false; + self.parsed = false; + return self; + }; + self.resetOptions(); + // temporary hack: allow "freezing" of reset-able state for parse(msg, cb) + const frozens = []; + function freeze() { + frozens.push({ + options, + configObjects: options.configObjects.slice(0), + exitProcess, + groups, + strict, + strictCommands, + completionCommand, + output, + exitError, + hasOutput, + parsed: self.parsed, + parseFn, + parseContext, + handlerFinishCommand + }); + usage.freeze(); + validation.freeze(); + command.freeze(); + } + function unfreeze() { + const frozen = frozens.pop(); + common_types_1.assertNotStrictEqual(frozen, undefined); + let configObjects; + ({ + options, + configObjects, + exitProcess, + groups, + output, + exitError, + hasOutput, + parsed: self.parsed, + strict, + strictCommands, + completionCommand, + parseFn, + parseContext, + handlerFinishCommand + } = frozen); + options.configObjects = configObjects; + usage.unfreeze(); + validation.unfreeze(); + command.unfreeze(); + } + self.boolean = function (keys) { + argsert_1.argsert('', [keys], arguments.length); + populateParserHintArray('boolean', keys); + return self; + }; + self.array = function (keys) { + argsert_1.argsert('', [keys], arguments.length); + populateParserHintArray('array', keys); + return self; + }; + self.number = function (keys) { + argsert_1.argsert('', [keys], arguments.length); + populateParserHintArray('number', keys); + return self; + }; + self.normalize = function (keys) { + argsert_1.argsert('', [keys], arguments.length); + populateParserHintArray('normalize', keys); + return self; + }; + self.count = function (keys) { + argsert_1.argsert('', [keys], arguments.length); + populateParserHintArray('count', keys); + return self; + }; + self.string = function (keys) { + argsert_1.argsert('', [keys], arguments.length); + populateParserHintArray('string', keys); + return self; + }; + self.requiresArg = function (keys) { + // the 2nd paramter [number] in the argsert the assertion is mandatory + // as populateParserHintSingleValueDictionary recursively calls requiresArg + // with Nan as a 2nd parameter, although we ignore it + argsert_1.argsert(' [number]', [keys], arguments.length); + // If someone configures nargs at the same time as requiresArg, + // nargs should take precedent, + // see: https://github.com/yargs/yargs/pull/1572 + // TODO: make this work with aliases, using a check similar to + // checkAllAliases() in yargs-parser. + if (typeof keys === 'string' && options.narg[keys]) { + return self; + } + else { + populateParserHintSingleValueDictionary(self.requiresArg, 'narg', keys, NaN); + } + return self; + }; + self.skipValidation = function (keys) { + argsert_1.argsert('', [keys], arguments.length); + populateParserHintArray('skipValidation', keys); + return self; + }; + function populateParserHintArray(type, keys) { + keys = [].concat(keys); + keys.forEach((key) => { + key = sanitizeKey(key); + options[type].push(key); + }); + } + self.nargs = function (key, value) { + argsert_1.argsert(' [number]', [key, value], arguments.length); + populateParserHintSingleValueDictionary(self.nargs, 'narg', key, value); + return self; + }; + self.choices = function (key, value) { + argsert_1.argsert(' [string|array]', [key, value], arguments.length); + populateParserHintArrayDictionary(self.choices, 'choices', key, value); + return self; + }; + self.alias = function (key, value) { + argsert_1.argsert(' [string|array]', [key, value], arguments.length); + populateParserHintArrayDictionary(self.alias, 'alias', key, value); + return self; + }; + // TODO: actually deprecate self.defaults. + self.default = self.defaults = function (key, value, defaultDescription) { + argsert_1.argsert(' [*] [string]', [key, value, defaultDescription], arguments.length); + if (defaultDescription) { + common_types_1.assertSingleKey(key); + options.defaultDescription[key] = defaultDescription; + } + if (typeof value === 'function') { + common_types_1.assertSingleKey(key); + if (!options.defaultDescription[key]) + options.defaultDescription[key] = usage.functionDescription(value); + value = value.call(); + } + populateParserHintSingleValueDictionary(self.default, 'default', key, value); + return self; + }; + self.describe = function (key, desc) { + argsert_1.argsert(' [string]', [key, desc], arguments.length); + setKey(key, true); + usage.describe(key, desc); + return self; + }; + function setKey(key, set) { + populateParserHintSingleValueDictionary(setKey, 'key', key, set); + return self; + } + function demandOption(keys, msg) { + argsert_1.argsert(' [string]', [keys, msg], arguments.length); + populateParserHintSingleValueDictionary(self.demandOption, 'demandedOptions', keys, msg); + return self; + } + self.demandOption = demandOption; + self.coerce = function (keys, value) { + argsert_1.argsert(' [function]', [keys, value], arguments.length); + populateParserHintSingleValueDictionary(self.coerce, 'coerce', keys, value); + return self; + }; + function populateParserHintSingleValueDictionary(builder, type, key, value) { + populateParserHintDictionary(builder, type, key, value, (type, key, value) => { + options[type][key] = value; + }); + } + function populateParserHintArrayDictionary(builder, type, key, value) { + populateParserHintDictionary(builder, type, key, value, (type, key, value) => { + options[type][key] = (options[type][key] || []).concat(value); + }); + } + function populateParserHintDictionary(builder, type, key, value, singleKeyHandler) { + if (Array.isArray(key)) { + // an array of keys with one value ['x', 'y', 'z'], function parse () {} + key.forEach((k) => { + builder(k, value); + }); + } + else if (((key) => typeof key === 'object')(key)) { + // an object of key value pairs: {'x': parse () {}, 'y': parse() {}} + for (const k of common_types_1.objectKeys(key)) { + builder(k, key[k]); + } + } + else { + singleKeyHandler(type, sanitizeKey(key), value); + } + } + function sanitizeKey(key) { + if (key === '__proto__') + return '___proto___'; + return key; + } + function deleteFromParserHintObject(optionKey) { + // delete from all parsing hints: + // boolean, array, key, alias, etc. + common_types_1.objectKeys(options).forEach((hintKey) => { + // configObjects is not a parsing hint array + if (((key) => key === 'configObjects')(hintKey)) + return; + const hint = options[hintKey]; + if (Array.isArray(hint)) { + if (~hint.indexOf(optionKey)) + hint.splice(hint.indexOf(optionKey), 1); + } + else if (typeof hint === 'object') { + delete hint[optionKey]; + } + }); + // now delete the description from usage.js. + delete usage.getDescriptions()[optionKey]; + } + self.config = function config(key = 'config', msg, parseFn) { + argsert_1.argsert('[object|string] [string|function] [function]', [key, msg, parseFn], arguments.length); + // allow a config object to be provided directly. + if ((typeof key === 'object') && !Array.isArray(key)) { + key = apply_extends_1.applyExtends(key, cwd, self.getParserConfiguration()['deep-merge-config']); + options.configObjects = (options.configObjects || []).concat(key); + return self; + } + // allow for a custom parsing function. + if (typeof msg === 'function') { + parseFn = msg; + msg = undefined; + } + self.describe(key, msg || usage.deferY18nLookup('Path to JSON config file')); + (Array.isArray(key) ? key : [key]).forEach((k) => { + options.config[k] = parseFn || true; + }); + return self; + }; + self.example = function (cmd, description) { + argsert_1.argsert(' [string]', [cmd, description], arguments.length); + if (Array.isArray(cmd)) { + cmd.forEach((exampleParams) => self.example(...exampleParams)); + } + else { + usage.example(cmd, description); + } + return self; + }; + self.command = function (cmd, description, builder, handler, middlewares, deprecated) { + argsert_1.argsert(' [string|boolean] [function|object] [function] [array] [boolean|string]', [cmd, description, builder, handler, middlewares, deprecated], arguments.length); + command.addHandler(cmd, description, builder, handler, middlewares, deprecated); + return self; + }; + self.commandDir = function (dir, opts) { + argsert_1.argsert(' [object]', [dir, opts], arguments.length); + const req = parentRequire || require; + command.addDirectory(dir, self.getContext(), req, require('get-caller-file')(), opts); + return self; + }; + // TODO: deprecate self.demand in favor of + // .demandCommand() .demandOption(). + self.demand = self.required = self.require = function demand(keys, max, msg) { + // you can optionally provide a 'max' key, + // which will raise an exception if too many '_' + // options are provided. + if (Array.isArray(max)) { + max.forEach((key) => { + common_types_1.assertNotStrictEqual(msg, true); + demandOption(key, msg); + }); + max = Infinity; + } + else if (typeof max !== 'number') { + msg = max; + max = Infinity; + } + if (typeof keys === 'number') { + common_types_1.assertNotStrictEqual(msg, true); + self.demandCommand(keys, max, msg, msg); + } + else if (Array.isArray(keys)) { + keys.forEach((key) => { + common_types_1.assertNotStrictEqual(msg, true); + demandOption(key, msg); + }); + } + else { + if (typeof msg === 'string') { + demandOption(keys, msg); + } + else if (msg === true || typeof msg === 'undefined') { + demandOption(keys); + } + } + return self; + }; + self.demandCommand = function demandCommand(min = 1, max, minMsg, maxMsg) { + argsert_1.argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length); + if (typeof max !== 'number') { + minMsg = max; + max = Infinity; + } + self.global('_', false); + options.demandedCommands._ = { + min, + max, + minMsg, + maxMsg + }; + return self; + }; + self.getDemandedOptions = () => { + argsert_1.argsert([], 0); + return options.demandedOptions; + }; + self.getDemandedCommands = () => { + argsert_1.argsert([], 0); + return options.demandedCommands; + }; + self.deprecateOption = function deprecateOption(option, message) { + argsert_1.argsert(' [string|boolean]', [option, message], arguments.length); + options.deprecatedOptions[option] = message; + return self; + }; + self.getDeprecatedOptions = () => { + argsert_1.argsert([], 0); + return options.deprecatedOptions; + }; + self.implies = function (key, value) { + argsert_1.argsert(' [number|string|array]', [key, value], arguments.length); + validation.implies(key, value); + return self; + }; + self.conflicts = function (key1, key2) { + argsert_1.argsert(' [string|array]', [key1, key2], arguments.length); + validation.conflicts(key1, key2); + return self; + }; + self.usage = function (msg, description, builder, handler) { + argsert_1.argsert(' [string|boolean] [function|object] [function]', [msg, description, builder, handler], arguments.length); + if (description !== undefined) { + common_types_1.assertNotStrictEqual(msg, null); + // .usage() can be used as an alias for defining + // a default command. + if ((msg || '').match(/^\$0( |$)/)) { + return self.command(msg, description, builder, handler); + } + else { + throw new yerror_1.YError('.usage() description must start with $0 if being used as alias for .command()'); + } + } + else { + usage.usage(msg); + return self; + } + }; + self.epilogue = self.epilog = function (msg) { + argsert_1.argsert('', [msg], arguments.length); + usage.epilog(msg); + return self; + }; + self.fail = function (f) { + argsert_1.argsert('', [f], arguments.length); + usage.failFn(f); + return self; + }; + self.onFinishCommand = function (f) { + argsert_1.argsert('', [f], arguments.length); + handlerFinishCommand = f; + return self; + }; + self.getHandlerFinishCommand = () => handlerFinishCommand; + self.check = function (f, _global) { + argsert_1.argsert(' [boolean]', [f, _global], arguments.length); + validation.check(f, _global !== false); + return self; + }; + self.global = function global(globals, global) { + argsert_1.argsert(' [boolean]', [globals, global], arguments.length); + globals = [].concat(globals); + if (global !== false) { + options.local = options.local.filter(l => globals.indexOf(l) === -1); + } + else { + globals.forEach((g) => { + if (options.local.indexOf(g) === -1) + options.local.push(g); + }); + } + return self; + }; + self.pkgConf = function pkgConf(key, rootPath) { + argsert_1.argsert(' [string]', [key, rootPath], arguments.length); + let conf = null; + // prefer cwd to require-main-filename in this method + // since we're looking for e.g. "nyc" config in nyc consumer + // rather than "yargs" config in nyc (where nyc is the main filename) + const obj = pkgUp(rootPath || cwd); + // If an object exists in the key, add it to options.configObjects + if (obj[key] && typeof obj[key] === 'object') { + conf = apply_extends_1.applyExtends(obj[key], rootPath || cwd, self.getParserConfiguration()['deep-merge-config']); + options.configObjects = (options.configObjects || []).concat(conf); + } + return self; + }; + const pkgs = {}; + function pkgUp(rootPath) { + const npath = rootPath || '*'; + if (pkgs[npath]) + return pkgs[npath]; + let obj = {}; + try { + let startDir = rootPath || requireMainFilename(parentRequire); + // When called in an environment that lacks require.main.filename, such as a jest test runner, + // startDir is already process.cwd(), and should not be shortened. + // Whether or not it is _actually_ a directory (e.g., extensionless bin) is irrelevant, find-up handles it. + if (!rootPath && path.extname(startDir)) { + startDir = path.dirname(startDir); + } + const pkgJsonPath = findUp.sync('package.json', { + cwd: startDir + }); + common_types_1.assertNotStrictEqual(pkgJsonPath, undefined); + obj = JSON.parse(fs.readFileSync(pkgJsonPath).toString()); + } + catch (noop) { } + pkgs[npath] = obj || {}; + return pkgs[npath]; + } + let parseFn = null; + let parseContext = null; + self.parse = function parse(args, shortCircuit, _parseFn) { + argsert_1.argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length); + freeze(); + if (typeof args === 'undefined') { + const argv = self._parseArgs(processArgs); + const tmpParsed = self.parsed; + unfreeze(); + // TODO: remove this compatibility hack when we release yargs@15.x: + self.parsed = tmpParsed; + return argv; + } + // a context object can optionally be provided, this allows + // additional information to be passed to a command handler. + if (typeof shortCircuit === 'object') { + parseContext = shortCircuit; + shortCircuit = _parseFn; + } + // by providing a function as a second argument to + // parse you can capture output that would otherwise + // default to printing to stdout/stderr. + if (typeof shortCircuit === 'function') { + parseFn = shortCircuit; + shortCircuit = false; + } + // completion short-circuits the parsing process, + // skipping validation, etc. + if (!shortCircuit) + processArgs = args; + if (parseFn) + exitProcess = false; + const parsed = self._parseArgs(args, !!shortCircuit); + completion.setParsed(self.parsed); + if (parseFn) + parseFn(exitError, parsed, output); + unfreeze(); + return parsed; + }; + self._getParseContext = () => parseContext || {}; + self._hasParseCallback = () => !!parseFn; + self.option = self.options = function option(key, opt) { + argsert_1.argsert(' [object]', [key, opt], arguments.length); + if (typeof key === 'object') { + Object.keys(key).forEach((k) => { + self.options(k, key[k]); + }); + } + else { + if (typeof opt !== 'object') { + opt = {}; + } + options.key[key] = true; // track manually set keys. + if (opt.alias) + self.alias(key, opt.alias); + const deprecate = opt.deprecate || opt.deprecated; + if (deprecate) { + self.deprecateOption(key, deprecate); + } + const demand = opt.demand || opt.required || opt.require; + // A required option can be specified via "demand: true". + if (demand) { + self.demand(key, demand); + } + if (opt.demandOption) { + self.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined); + } + if (opt.conflicts) { + self.conflicts(key, opt.conflicts); + } + if ('default' in opt) { + self.default(key, opt.default); + } + if (opt.implies !== undefined) { + self.implies(key, opt.implies); + } + if (opt.nargs !== undefined) { + self.nargs(key, opt.nargs); + } + if (opt.config) { + self.config(key, opt.configParser); + } + if (opt.normalize) { + self.normalize(key); + } + if (opt.choices) { + self.choices(key, opt.choices); + } + if (opt.coerce) { + self.coerce(key, opt.coerce); + } + if (opt.group) { + self.group(key, opt.group); + } + if (opt.boolean || opt.type === 'boolean') { + self.boolean(key); + if (opt.alias) + self.boolean(opt.alias); + } + if (opt.array || opt.type === 'array') { + self.array(key); + if (opt.alias) + self.array(opt.alias); + } + if (opt.number || opt.type === 'number') { + self.number(key); + if (opt.alias) + self.number(opt.alias); + } + if (opt.string || opt.type === 'string') { + self.string(key); + if (opt.alias) + self.string(opt.alias); + } + if (opt.count || opt.type === 'count') { + self.count(key); + } + if (typeof opt.global === 'boolean') { + self.global(key, opt.global); + } + if (opt.defaultDescription) { + options.defaultDescription[key] = opt.defaultDescription; + } + if (opt.skipValidation) { + self.skipValidation(key); + } + const desc = opt.describe || opt.description || opt.desc; + self.describe(key, desc); + if (opt.hidden) { + self.hide(key); + } + if (opt.requiresArg) { + self.requiresArg(key); + } + } + return self; + }; + self.getOptions = () => options; + self.positional = function (key, opts) { + argsert_1.argsert(' ', [key, opts], arguments.length); + if (context.resets === 0) { + throw new yerror_1.YError(".positional() can only be called in a command's builder function"); + } + // .positional() only supports a subset of the configuration + // options available to .option(). + const supportedOpts = ['default', 'defaultDescription', 'implies', 'normalize', + 'choices', 'conflicts', 'coerce', 'type', 'describe', + 'desc', 'description', 'alias']; + opts = obj_filter_1.objFilter(opts, (k, v) => { + let accept = supportedOpts.indexOf(k) !== -1; + // type can be one of string|number|boolean. + if (k === 'type' && ['string', 'number', 'boolean'].indexOf(v) === -1) + accept = false; + return accept; + }); + // copy over any settings that can be inferred from the command string. + const fullCommand = context.fullCommands[context.fullCommands.length - 1]; + const parseOptions = fullCommand ? command.cmdToParseOptions(fullCommand) : { + array: [], + alias: {}, + default: {}, + demand: {} + }; + common_types_1.objectKeys(parseOptions).forEach((pk) => { + const parseOption = parseOptions[pk]; + if (Array.isArray(parseOption)) { + if (parseOption.indexOf(key) !== -1) + opts[pk] = true; + } + else { + if (parseOption[key] && !(pk in opts)) + opts[pk] = parseOption[key]; + } + }); + self.group(key, usage.getPositionalGroupName()); + return self.option(key, opts); + }; + self.group = function group(opts, groupName) { + argsert_1.argsert(' ', [opts, groupName], arguments.length); + const existing = preservedGroups[groupName] || groups[groupName]; + if (preservedGroups[groupName]) { + // we now only need to track this group name in groups. + delete preservedGroups[groupName]; + } + const seen = {}; + groups[groupName] = (existing || []).concat(opts).filter((key) => { + if (seen[key]) + return false; + return (seen[key] = true); + }); + return self; + }; + // combine explicit and preserved groups. explicit groups should be first + self.getGroups = () => Object.assign({}, groups, preservedGroups); + // as long as options.envPrefix is not undefined, + // parser will apply env vars matching prefix to argv + self.env = function (prefix) { + argsert_1.argsert('[string|boolean]', [prefix], arguments.length); + if (prefix === false) + delete options.envPrefix; + else + options.envPrefix = prefix || ''; + return self; + }; + self.wrap = function (cols) { + argsert_1.argsert('', [cols], arguments.length); + usage.wrap(cols); + return self; + }; + let strict = false; + self.strict = function (enabled) { + argsert_1.argsert('[boolean]', [enabled], arguments.length); + strict = enabled !== false; + return self; + }; + self.getStrict = () => strict; + let strictCommands = false; + self.strictCommands = function (enabled) { + argsert_1.argsert('[boolean]', [enabled], arguments.length); + strictCommands = enabled !== false; + return self; + }; + self.getStrictCommands = () => strictCommands; + let parserConfig = {}; + self.parserConfiguration = function parserConfiguration(config) { + argsert_1.argsert('', [config], arguments.length); + parserConfig = config; + return self; + }; + self.getParserConfiguration = () => parserConfig; + self.showHelp = function (level) { + argsert_1.argsert('[string|function]', [level], arguments.length); + if (!self.parsed) + self._parseArgs(processArgs); // run parser, if it has not already been executed. + if (command.hasDefaultCommand()) { + context.resets++; // override the restriction on top-level positoinals. + command.runDefaultBuilderOn(self); + } + usage.showHelp(level); + return self; + }; + let versionOpt = null; + self.version = function version(opt, msg, ver) { + const defaultVersionOpt = 'version'; + argsert_1.argsert('[boolean|string] [string] [string]', [opt, msg, ver], arguments.length); + // nuke the key previously configured + // to return version #. + if (versionOpt) { + deleteFromParserHintObject(versionOpt); + usage.version(undefined); + versionOpt = null; + } + if (arguments.length === 0) { + ver = guessVersion(); + opt = defaultVersionOpt; + } + else if (arguments.length === 1) { + if (opt === false) { // disable default 'version' key. + return self; + } + ver = opt; + opt = defaultVersionOpt; + } + else if (arguments.length === 2) { + ver = msg; + msg = undefined; + } + versionOpt = typeof opt === 'string' ? opt : defaultVersionOpt; + msg = msg || usage.deferY18nLookup('Show version number'); + usage.version(ver || undefined); + self.boolean(versionOpt); + self.describe(versionOpt, msg); + return self; + }; + function guessVersion() { + const obj = pkgUp(); + return obj.version || 'unknown'; + } + let helpOpt = null; + self.addHelpOpt = self.help = function addHelpOpt(opt, msg) { + const defaultHelpOpt = 'help'; + argsert_1.argsert('[string|boolean] [string]', [opt, msg], arguments.length); + // nuke the key previously configured + // to return help. + if (helpOpt) { + deleteFromParserHintObject(helpOpt); + helpOpt = null; + } + if (arguments.length === 1) { + if (opt === false) + return self; + } + // use arguments, fallback to defaults for opt and msg + helpOpt = typeof opt === 'string' ? opt : defaultHelpOpt; + self.boolean(helpOpt); + self.describe(helpOpt, msg || usage.deferY18nLookup('Show help')); + return self; + }; + const defaultShowHiddenOpt = 'show-hidden'; + options.showHiddenOpt = defaultShowHiddenOpt; + self.addShowHiddenOpt = self.showHidden = function addShowHiddenOpt(opt, msg) { + argsert_1.argsert('[string|boolean] [string]', [opt, msg], arguments.length); + if (arguments.length === 1) { + if (opt === false) + return self; + } + const showHiddenOpt = typeof opt === 'string' ? opt : defaultShowHiddenOpt; + self.boolean(showHiddenOpt); + self.describe(showHiddenOpt, msg || usage.deferY18nLookup('Show hidden options')); + options.showHiddenOpt = showHiddenOpt; + return self; + }; + self.hide = function hide(key) { + argsert_1.argsert('', [key], arguments.length); + options.hiddenOptions.push(key); + return self; + }; + self.showHelpOnFail = function showHelpOnFail(enabled, message) { + argsert_1.argsert('[boolean|string] [string]', [enabled, message], arguments.length); + usage.showHelpOnFail(enabled, message); + return self; + }; + var exitProcess = true; + self.exitProcess = function (enabled = true) { + argsert_1.argsert('[boolean]', [enabled], arguments.length); + exitProcess = enabled; + return self; + }; + self.getExitProcess = () => exitProcess; + var completionCommand = null; + self.completion = function (cmd, desc, fn) { + argsert_1.argsert('[string] [string|boolean|function] [function]', [cmd, desc, fn], arguments.length); + // a function to execute when generating + // completions can be provided as the second + // or third argument to completion. + if (typeof desc === 'function') { + fn = desc; + desc = undefined; + } + // register the completion command. + completionCommand = cmd || completionCommand || 'completion'; + if (!desc && desc !== false) { + desc = 'generate completion script'; + } + self.command(completionCommand, desc); + // a function can be provided + if (fn) + completion.registerFunction(fn); + return self; + }; + self.showCompletionScript = function ($0, cmd) { + argsert_1.argsert('[string] [string]', [$0, cmd], arguments.length); + $0 = $0 || self.$0; + _logger.log(completion.generateCompletionScript($0, cmd || completionCommand || 'completion')); + return self; + }; + self.getCompletion = function (args, done) { + argsert_1.argsert(' ', [args, done], arguments.length); + completion.getCompletion(args, done); + }; + self.locale = function (locale) { + argsert_1.argsert('[string]', [locale], arguments.length); + if (!locale) { + guessLocale(); + return y18n.getLocale(); + } + detectLocale = false; + y18n.setLocale(locale); + return self; + }; + self.updateStrings = self.updateLocale = function (obj) { + argsert_1.argsert('', [obj], arguments.length); + detectLocale = false; + y18n.updateLocale(obj); + return self; + }; + let detectLocale = true; + self.detectLocale = function (detect) { + argsert_1.argsert('', [detect], arguments.length); + detectLocale = detect; + return self; + }; + self.getDetectLocale = () => detectLocale; + var hasOutput = false; + var exitError = null; + // maybe exit, always capture + // context about why we wanted to exit. + self.exit = (code, err) => { + hasOutput = true; + exitError = err; + if (exitProcess) + process.exit(code); + }; + // we use a custom logger that buffers output, + // so that we can print to non-CLIs, e.g., chat-bots. + const _logger = { + log(...args) { + if (!self._hasParseCallback()) + console.log(...args); + hasOutput = true; + if (output.length) + output += '\n'; + output += args.join(' '); + }, + error(...args) { + if (!self._hasParseCallback()) + console.error(...args); + hasOutput = true; + if (output.length) + output += '\n'; + output += args.join(' '); + } + }; + self._getLoggerInstance = () => _logger; + // has yargs output an error our help + // message in the current execution context. + self._hasOutput = () => hasOutput; + self._setHasOutput = () => { + hasOutput = true; + }; + let recommendCommands; + self.recommendCommands = function (recommend = true) { + argsert_1.argsert('[boolean]', [recommend], arguments.length); + recommendCommands = recommend; + return self; + }; + self.getUsageInstance = () => usage; + self.getValidationInstance = () => validation; + self.getCommandInstance = () => command; + self.terminalWidth = () => { + argsert_1.argsert([], 0); + return typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null; + }; + Object.defineProperty(self, 'argv', { + get: () => self._parseArgs(processArgs), + enumerable: true + }); + self._parseArgs = function parseArgs(args, shortCircuit, _calledFromCommand, commandIndex) { + let skipValidation = !!_calledFromCommand; + args = args || processArgs; + options.__ = y18n.__; + options.configuration = self.getParserConfiguration(); + const populateDoubleDash = !!options.configuration['populate--']; + const config = Object.assign({}, options.configuration, { + 'populate--': true + }); + const parsed = Parser.detailed(args, Object.assign({}, options, { + configuration: config + })); + let argv = parsed.argv; + if (parseContext) + argv = Object.assign({}, argv, parseContext); + const aliases = parsed.aliases; + argv.$0 = self.$0; + self.parsed = parsed; + try { + guessLocale(); // guess locale lazily, so that it can be turned off in chain. + // while building up the argv object, there + // are two passes through the parser. If completion + // is being performed short-circuit on the first pass. + if (shortCircuit) { + return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv); + } + // if there's a handler associated with a + // command defer processing to it. + if (helpOpt) { + // consider any multi-char helpOpt alias as a valid help command + // unless all helpOpt aliases are single-char + // note that parsed.aliases is a normalized bidirectional map :) + const helpCmds = [helpOpt] + .concat(aliases[helpOpt] || []) + .filter(k => k.length > 1); + // check if help should trigger and strip it from _. + if (~helpCmds.indexOf(argv._[argv._.length - 1])) { + argv._.pop(); + argv[helpOpt] = true; + } + } + const handlerKeys = command.getCommands(); + const requestCompletions = completion.completionKey in argv; + const skipRecommendation = argv[helpOpt] || requestCompletions; + const skipDefaultCommand = skipRecommendation && (handlerKeys.length > 1 || handlerKeys[0] !== '$0'); + if (argv._.length) { + if (handlerKeys.length) { + let firstUnknownCommand; + for (let i = (commandIndex || 0), cmd; argv._[i] !== undefined; i++) { + cmd = String(argv._[i]); + if (~handlerKeys.indexOf(cmd) && cmd !== completionCommand) { + // commands are executed using a recursive algorithm that executes + // the deepest command first; we keep track of the position in the + // argv._ array that is currently being executed. + const innerArgv = command.runCommand(cmd, self, parsed, i + 1); + return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv); + } + else if (!firstUnknownCommand && cmd !== completionCommand) { + firstUnknownCommand = cmd; + break; + } + } + // run the default command, if defined + if (command.hasDefaultCommand() && !skipDefaultCommand) { + const innerArgv = command.runCommand(null, self, parsed); + return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv); + } + // recommend a command if recommendCommands() has + // been enabled, and no commands were found to execute + if (recommendCommands && firstUnknownCommand && !skipRecommendation) { + validation.recommendCommands(firstUnknownCommand, handlerKeys); + } + } + // generate a completion script for adding to ~/.bashrc. + if (completionCommand && ~argv._.indexOf(completionCommand) && !requestCompletions) { + if (exitProcess) + setBlocking(true); + self.showCompletionScript(); + self.exit(0); + } + } + else if (command.hasDefaultCommand() && !skipDefaultCommand) { + const innerArgv = command.runCommand(null, self, parsed); + return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv); + } + // we must run completions first, a user might + // want to complete the --help or --version option. + if (requestCompletions) { + if (exitProcess) + setBlocking(true); + // we allow for asynchronous completions, + // e.g., loading in a list of commands from an API. + args = [].concat(args); + const completionArgs = args.slice(args.indexOf(`--${completion.completionKey}`) + 1); + completion.getCompletion(completionArgs, (completions) => { + ; + (completions || []).forEach((completion) => { + _logger.log(completion); + }); + self.exit(0); + }); + return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv); + } + // Handle 'help' and 'version' options + // if we haven't already output help! + if (!hasOutput) { + Object.keys(argv).forEach((key) => { + if (key === helpOpt && argv[key]) { + if (exitProcess) + setBlocking(true); + skipValidation = true; + self.showHelp('log'); + self.exit(0); + } + else if (key === versionOpt && argv[key]) { + if (exitProcess) + setBlocking(true); + skipValidation = true; + usage.showVersion(); + self.exit(0); + } + }); + } + // Check if any of the options to skip validation were provided + if (!skipValidation && options.skipValidation.length > 0) { + skipValidation = Object.keys(argv).some(key => options.skipValidation.indexOf(key) >= 0 && argv[key] === true); + } + // If the help or version options where used and exitProcess is false, + // or if explicitly skipped, we won't run validations. + if (!skipValidation) { + if (parsed.error) + throw new yerror_1.YError(parsed.error.message); + // if we're executed via bash completion, don't + // bother with validation. + if (!requestCompletions) { + self._runValidation(argv, aliases, {}, parsed.error); + } + } + } + catch (err) { + if (err instanceof yerror_1.YError) + usage.fail(err.message, err); + else + throw err; + } + return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv); + }; + // to simplify the parsing of positionals in commands, + // we temporarily populate '--' rather than _, with arguments + // after the '--' directive. After the parse, we copy these back. + self._copyDoubleDash = function (argv) { + if (is_promise_1.isPromise(argv) || !argv._ || !argv['--']) + return argv; + argv._.push.apply(argv._, argv['--']); + // TODO(bcoe): refactor command parsing such that this delete is not + // necessary: https://github.com/yargs/yargs/issues/1482 + try { + delete argv['--']; + } + catch (_err) { } + return argv; + }; + self._runValidation = function runValidation(argv, aliases, positionalMap, parseErrors, isDefaultCommand = false) { + if (parseErrors) + throw new yerror_1.YError(parseErrors.message); + validation.nonOptionCount(argv); + validation.requiredArguments(argv); + let failedStrictCommands = false; + if (strictCommands) { + failedStrictCommands = validation.unknownCommands(argv); + } + if (strict && !failedStrictCommands) { + validation.unknownArguments(argv, aliases, positionalMap, isDefaultCommand); + } + validation.customChecks(argv, aliases); + validation.limitedChoices(argv); + validation.implications(argv); + validation.conflicting(argv); + }; + function guessLocale() { + if (!detectLocale) + return; + const locale = process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || process.env.LANGUAGE || 'en_US'; + self.locale(locale.replace(/[.:].*/, '')); + } + // an app should almost always have --version and --help, + // if you *really* want to disable this use .help(false)/.version(false). + self.help(); + self.version(); + return self; +} +exports.Yargs = Yargs; +// rebase an absolute path to a relative one with respect to a base directory +// exported for tests +function rebase(base, dir) { + return path.relative(base, dir); +} +exports.rebase = rebase; +function isYargsInstance(y) { + return !!y && (typeof y._parseArgs === 'function'); +} +exports.isYargsInstance = isYargsInstance; diff --git a/node_modules/nyc/node_modules/yargs/build/lib/yerror.d.ts b/node_modules/nyc/node_modules/yargs/build/lib/yerror.d.ts new file mode 100644 index 0000000..024d0c7 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/yerror.d.ts @@ -0,0 +1,4 @@ +export declare class YError extends Error { + name: string; + constructor(msg?: string | null); +} diff --git a/node_modules/nyc/node_modules/yargs/build/lib/yerror.js b/node_modules/nyc/node_modules/yargs/build/lib/yerror.js new file mode 100644 index 0000000..0fa146e --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/build/lib/yerror.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.YError = void 0; +class YError extends Error { + constructor(msg) { + super(msg || 'yargs error'); + this.name = 'YError'; + Error.captureStackTrace(this, YError); + } +} +exports.YError = YError; diff --git a/node_modules/nyc/node_modules/yargs/index.js b/node_modules/nyc/node_modules/yargs/index.js new file mode 100644 index 0000000..7dc62de --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/index.js @@ -0,0 +1,40 @@ +'use strict' +// classic singleton yargs API, to use yargs +// without running as a singleton do: +// require('yargs/yargs')(process.argv.slice(2)) +const yargs = require('./yargs') +const processArgv = require('./build/lib/process-argv') + +Argv(processArgv.getProcessArgvWithoutBin()) + +module.exports = Argv + +function Argv (processArgs, cwd) { + const argv = yargs(processArgs, cwd, require) + singletonify(argv) + return argv +} + +/* Hack an instance of Argv with process.argv into Argv + so people can do + require('yargs')(['--beeble=1','-z','zizzle']).argv + to parse a list of args and + require('yargs').argv + to get a parsed version of process.argv. +*/ +function singletonify (inst) { + Object.keys(inst).forEach((key) => { + if (key === 'argv') { + Argv.__defineGetter__(key, inst.__lookupGetter__(key)) + } else if (typeof inst[key] === 'function') { + Argv[key] = inst[key].bind(inst) + } else { + Argv.__defineGetter__('$0', () => { + return inst.$0 + }) + Argv.__defineGetter__('parsed', () => { + return inst.parsed + }) + } + }) +} diff --git a/node_modules/nyc/node_modules/yargs/locales/be.json b/node_modules/nyc/node_modules/yargs/locales/be.json new file mode 100644 index 0000000..e28fa30 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/be.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Каманды:", + "Options:": "Опцыі:", + "Examples:": "Прыклады:", + "boolean": "булевы тып", + "count": "падлік", + "string": "радковы тып", + "number": "лік", + "array": "масіў", + "required": "неабходна", + "default": "па змаўчанні", + "default:": "па змаўчанні:", + "choices:": "магчымасці:", + "aliases:": "аліасы:", + "generated-value": "згенераванае значэнне", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s", + "other": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s", + "other": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s" + }, + "Missing argument value: %s": { + "one": "Не хапае значэння аргументу: %s", + "other": "Не хапае значэнняў аргументаў: %s" + }, + "Missing required argument: %s": { + "one": "Не хапае неабходнага аргументу: %s", + "other": "Не хапае неабходных аргументаў: %s" + }, + "Unknown argument: %s": { + "one": "Невядомы аргумент: %s", + "other": "Невядомыя аргументы: %s" + }, + "Invalid values:": "Несапраўдныя значэння:", + "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Дадзенае значэнне: %s, Магчымасці: %s", + "Argument check failed: %s": "Праверка аргументаў не ўдалася: %s", + "Implications failed:": "Дадзены аргумент патрабуе наступны дадатковы аргумент:", + "Not enough arguments following: %s": "Недастаткова наступных аргументаў: %s", + "Invalid JSON config file: %s": "Несапраўдны файл канфігурацыі JSON: %s", + "Path to JSON config file": "Шлях да файла канфігурацыі JSON", + "Show help": "Паказаць дапамогу", + "Show version number": "Паказаць нумар версіі", + "Did you mean %s?": "Вы мелі на ўвазе %s?" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/de.json b/node_modules/nyc/node_modules/yargs/locales/de.json new file mode 100644 index 0000000..dc73ec3 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/de.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Kommandos:", + "Options:": "Optionen:", + "Examples:": "Beispiele:", + "boolean": "boolean", + "count": "Zähler", + "string": "string", + "number": "Zahl", + "array": "array", + "required": "erforderlich", + "default": "Standard", + "default:": "Standard:", + "choices:": "Möglichkeiten:", + "aliases:": "Aliase:", + "generated-value": "Generierter-Wert", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt", + "other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt", + "other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt" + }, + "Missing argument value: %s": { + "one": "Fehlender Argumentwert: %s", + "other": "Fehlende Argumentwerte: %s" + }, + "Missing required argument: %s": { + "one": "Fehlendes Argument: %s", + "other": "Fehlende Argumente: %s" + }, + "Unknown argument: %s": { + "one": "Unbekanntes Argument: %s", + "other": "Unbekannte Argumente: %s" + }, + "Invalid values:": "Unzulässige Werte:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s", + "Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s", + "Implications failed:": "Fehlende abhängige Argumente:", + "Not enough arguments following: %s": "Nicht genügend Argumente nach: %s", + "Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s", + "Path to JSON config file": "Pfad zur JSON-Config Datei", + "Show help": "Hilfe anzeigen", + "Show version number": "Version anzeigen", + "Did you mean %s?": "Meintest du %s?" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/en.json b/node_modules/nyc/node_modules/yargs/locales/en.json new file mode 100644 index 0000000..d794947 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/en.json @@ -0,0 +1,51 @@ +{ + "Commands:": "Commands:", + "Options:": "Options:", + "Examples:": "Examples:", + "boolean": "boolean", + "count": "count", + "string": "string", + "number": "number", + "array": "array", + "required": "required", + "default": "default", + "default:": "default:", + "choices:": "choices:", + "aliases:": "aliases:", + "generated-value": "generated-value", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Not enough non-option arguments: got %s, need at least %s", + "other": "Not enough non-option arguments: got %s, need at least %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Too many non-option arguments: got %s, maximum of %s", + "other": "Too many non-option arguments: got %s, maximum of %s" + }, + "Missing argument value: %s": { + "one": "Missing argument value: %s", + "other": "Missing argument values: %s" + }, + "Missing required argument: %s": { + "one": "Missing required argument: %s", + "other": "Missing required arguments: %s" + }, + "Unknown argument: %s": { + "one": "Unknown argument: %s", + "other": "Unknown arguments: %s" + }, + "Invalid values:": "Invalid values:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s", + "Argument check failed: %s": "Argument check failed: %s", + "Implications failed:": "Missing dependent arguments:", + "Not enough arguments following: %s": "Not enough arguments following: %s", + "Invalid JSON config file: %s": "Invalid JSON config file: %s", + "Path to JSON config file": "Path to JSON config file", + "Show help": "Show help", + "Show version number": "Show version number", + "Did you mean %s?": "Did you mean %s?", + "Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive", + "Positionals:": "Positionals:", + "command": "command", + "deprecated": "deprecated", + "deprecated: %s": "deprecated: %s" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/es.json b/node_modules/nyc/node_modules/yargs/locales/es.json new file mode 100644 index 0000000..d77b461 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/es.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Comandos:", + "Options:": "Opciones:", + "Examples:": "Ejemplos:", + "boolean": "booleano", + "count": "cuenta", + "string": "cadena de caracteres", + "number": "número", + "array": "tabla", + "required": "requerido", + "default": "defecto", + "default:": "defecto:", + "choices:": "selección:", + "aliases:": "alias:", + "generated-value": "valor-generado", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s", + "other": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s", + "other": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s" + }, + "Missing argument value: %s": { + "one": "Falta argumento: %s", + "other": "Faltan argumentos: %s" + }, + "Missing required argument: %s": { + "one": "Falta argumento requerido: %s", + "other": "Faltan argumentos requeridos: %s" + }, + "Unknown argument: %s": { + "one": "Argumento desconocido: %s", + "other": "Argumentos desconocidos: %s" + }, + "Invalid values:": "Valores inválidos:", + "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Seleccionados: %s", + "Argument check failed: %s": "Verificación de argumento ha fallado: %s", + "Implications failed:": "Implicaciones fallidas:", + "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s", + "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s", + "Path to JSON config file": "Ruta al archivo de configuración JSON", + "Show help": "Muestra ayuda", + "Show version number": "Muestra número de versión", + "Did you mean %s?": "Quisiste decir %s?" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/fi.json b/node_modules/nyc/node_modules/yargs/locales/fi.json new file mode 100644 index 0000000..0728c57 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/fi.json @@ -0,0 +1,49 @@ +{ + "Commands:": "Komennot:", + "Options:": "Valinnat:", + "Examples:": "Esimerkkejä:", + "boolean": "totuusarvo", + "count": "lukumäärä", + "string": "merkkijono", + "number": "numero", + "array": "taulukko", + "required": "pakollinen", + "default": "oletusarvo", + "default:": "oletusarvo:", + "choices:": "vaihtoehdot:", + "aliases:": "aliakset:", + "generated-value": "generoitu-arvo", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s", + "other": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s", + "other": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s" + }, + "Missing argument value: %s": { + "one": "Argumentin arvo puuttuu: %s", + "other": "Argumentin arvot puuttuvat: %s" + }, + "Missing required argument: %s": { + "one": "Pakollinen argumentti puuttuu: %s", + "other": "Pakollisia argumentteja puuttuu: %s" + }, + "Unknown argument: %s": { + "one": "Tuntematon argumenttn: %s", + "other": "Tuntemattomia argumentteja: %s" + }, + "Invalid values:": "Virheelliset arvot:", + "Argument: %s, Given: %s, Choices: %s": "Argumentti: %s, Annettu: %s, Vaihtoehdot: %s", + "Argument check failed: %s": "Argumentin tarkistus epäonnistui: %s", + "Implications failed:": "Riippuvia argumentteja puuttuu:", + "Not enough arguments following: %s": "Argumentin perässä ei ole tarpeeksi argumentteja: %s", + "Invalid JSON config file: %s": "Epävalidi JSON-asetustiedosto: %s", + "Path to JSON config file": "JSON-asetustiedoston polku", + "Show help": "Näytä ohje", + "Show version number": "Näytä versionumero", + "Did you mean %s?": "Tarkoititko %s?", + "Arguments %s and %s are mutually exclusive" : "Argumentit %s ja %s eivät ole yhteensopivat", + "Positionals:": "Sijaintiparametrit:", + "command": "komento" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/fr.json b/node_modules/nyc/node_modules/yargs/locales/fr.json new file mode 100644 index 0000000..edd743f --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/fr.json @@ -0,0 +1,53 @@ +{ + "Commands:": "Commandes :", + "Options:": "Options :", + "Examples:": "Exemples :", + "boolean": "booléen", + "count": "compteur", + "string": "chaîne de caractères", + "number": "nombre", + "array": "tableau", + "required": "requis", + "default": "défaut", + "default:": "défaut :", + "choices:": "choix :", + "aliases:": "alias :", + "generated-value": "valeur générée", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Pas assez d'arguments (hors options) : reçu %s, besoin d'au moins %s", + "other": "Pas assez d'arguments (hors options) : reçus %s, besoin d'au moins %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Trop d'arguments (hors options) : reçu %s, maximum de %s", + "other": "Trop d'arguments (hors options) : reçus %s, maximum de %s" + }, + "Missing argument value: %s": { + "one": "Argument manquant : %s", + "other": "Arguments manquants : %s" + }, + "Missing required argument: %s": { + "one": "Argument requis manquant : %s", + "other": "Arguments requis manquants : %s" + }, + "Unknown argument: %s": { + "one": "Argument inconnu : %s", + "other": "Arguments inconnus : %s" + }, + "Unknown command: %s": { + "one": "Commande inconnue : %s", + "other": "Commandes inconnues : %s" + }, + "Invalid values:": "Valeurs invalides :", + "Argument: %s, Given: %s, Choices: %s": "Argument : %s, donné : %s, choix : %s", + "Argument check failed: %s": "Echec de la vérification de l'argument : %s", + "Implications failed:": "Arguments dépendants manquants :", + "Not enough arguments following: %s": "Pas assez d'arguments après : %s", + "Invalid JSON config file: %s": "Fichier de configuration JSON invalide : %s", + "Path to JSON config file": "Chemin du fichier de configuration JSON", + "Show help": "Affiche l'aide", + "Show version number": "Affiche le numéro de version", + "Did you mean %s?": "Vouliez-vous dire %s ?", + "Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs", + "Positionals:": "Arguments positionnels :", + "command": "commande" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/hi.json b/node_modules/nyc/node_modules/yargs/locales/hi.json new file mode 100644 index 0000000..a9de77c --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/hi.json @@ -0,0 +1,49 @@ +{ + "Commands:": "आदेश:", + "Options:": "विकल्प:", + "Examples:": "उदाहरण:", + "boolean": "सत्यता", + "count": "संख्या", + "string": "वर्णों का तार ", + "number": "अंक", + "array": "सरणी", + "required": "आवश्यक", + "default": "डिफॉल्ट", + "default:": "डिफॉल्ट:", + "choices:": "विकल्प:", + "aliases:": "उपनाम:", + "generated-value": "उत्पन्न-मूल्य", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है", + "other": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य", + "other": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य" + }, + "Missing argument value: %s": { + "one": "कुछ तर्को के मूल्य गुम हैं: %s", + "other": "कुछ तर्को के मूल्य गुम हैं: %s" + }, + "Missing required argument: %s": { + "one": "आवश्यक तर्क गुम हैं: %s", + "other": "आवश्यक तर्क गुम हैं: %s" + }, + "Unknown argument: %s": { + "one": "अज्ञात तर्क प्राप्त: %s", + "other": "अज्ञात तर्क प्राप्त: %s" + }, + "Invalid values:": "अमान्य मूल्य:", + "Argument: %s, Given: %s, Choices: %s": "तर्क: %s, प्राप्त: %s, विकल्प: %s", + "Argument check failed: %s": "तर्क जांच विफल: %s", + "Implications failed:": "दिए गए तर्क के लिए अतिरिक्त तर्क की अपेक्षा है:", + "Not enough arguments following: %s": "निम्नलिखित के बाद पर्याप्त तर्क नहीं प्राप्त: %s", + "Invalid JSON config file: %s": "अमान्य JSON config फाइल: %s", + "Path to JSON config file": "JSON config फाइल का पथ", + "Show help": "सहायता दिखाएँ", + "Show version number": "Version संख्या दिखाएँ", + "Did you mean %s?": "क्या आपका मतलब है %s?", + "Arguments %s and %s are mutually exclusive" : "तर्क %s और %s परस्पर अनन्य हैं", + "Positionals:": "स्थानीय:", + "command": "आदेश" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/hu.json b/node_modules/nyc/node_modules/yargs/locales/hu.json new file mode 100644 index 0000000..21492d0 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/hu.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Parancsok:", + "Options:": "Opciók:", + "Examples:": "Példák:", + "boolean": "boolean", + "count": "számláló", + "string": "szöveg", + "number": "szám", + "array": "tömb", + "required": "kötelező", + "default": "alapértelmezett", + "default:": "alapértelmezett:", + "choices:": "lehetőségek:", + "aliases:": "aliaszok:", + "generated-value": "generált-érték", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell", + "other": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet", + "other": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet" + }, + "Missing argument value: %s": { + "one": "Hiányzó argumentum érték: %s", + "other": "Hiányzó argumentum értékek: %s" + }, + "Missing required argument: %s": { + "one": "Hiányzó kötelező argumentum: %s", + "other": "Hiányzó kötelező argumentumok: %s" + }, + "Unknown argument: %s": { + "one": "Ismeretlen argumentum: %s", + "other": "Ismeretlen argumentumok: %s" + }, + "Invalid values:": "Érvénytelen érték:", + "Argument: %s, Given: %s, Choices: %s": "Argumentum: %s, Megadott: %s, Lehetőségek: %s", + "Argument check failed: %s": "Argumentum ellenőrzés sikertelen: %s", + "Implications failed:": "Implikációk sikertelenek:", + "Not enough arguments following: %s": "Nem elég argumentum követi: %s", + "Invalid JSON config file: %s": "Érvénytelen JSON konfigurációs file: %s", + "Path to JSON config file": "JSON konfigurációs file helye", + "Show help": "Súgo megjelenítése", + "Show version number": "Verziószám megjelenítése", + "Did you mean %s?": "Erre gondoltál %s?" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/id.json b/node_modules/nyc/node_modules/yargs/locales/id.json new file mode 100644 index 0000000..125867c --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/id.json @@ -0,0 +1,50 @@ + +{ + "Commands:": "Perintah:", + "Options:": "Pilihan:", + "Examples:": "Contoh:", + "boolean": "boolean", + "count": "jumlah", + "number": "nomor", + "string": "string", + "array": "larik", + "required": "diperlukan", + "default": "bawaan", + "default:": "bawaan:", + "aliases:": "istilah lain:", + "choices:": "pilihan:", + "generated-value": "nilai-yang-dihasilkan", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Argumen wajib kurang: hanya %s, minimal %s", + "other": "Argumen wajib kurang: hanya %s, minimal %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Terlalu banyak argumen wajib: ada %s, maksimal %s", + "other": "Terlalu banyak argumen wajib: ada %s, maksimal %s" + }, + "Missing argument value: %s": { + "one": "Kurang argumen: %s", + "other": "Kurang argumen: %s" + }, + "Missing required argument: %s": { + "one": "Kurang argumen wajib: %s", + "other": "Kurang argumen wajib: %s" + }, + "Unknown argument: %s": { + "one": "Argumen tak diketahui: %s", + "other": "Argumen tak diketahui: %s" + }, + "Invalid values:": "Nilai-nilai tidak valid:", + "Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s", + "Argument check failed: %s": "Pemeriksaan argument gagal: %s", + "Implications failed:": "Implikasi gagal:", + "Not enough arguments following: %s": "Kurang argumen untuk: %s", + "Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s", + "Path to JSON config file": "Alamat berkas konfigurasi JSON", + "Show help": "Lihat bantuan", + "Show version number": "Lihat nomor versi", + "Did you mean %s?": "Maksud Anda: %s?", + "Arguments %s and %s are mutually exclusive" : "Argumen %s dan %s saling eksklusif", + "Positionals:": "Posisional-posisional:", + "command": "perintah" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/it.json b/node_modules/nyc/node_modules/yargs/locales/it.json new file mode 100644 index 0000000..fde5756 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/it.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Comandi:", + "Options:": "Opzioni:", + "Examples:": "Esempi:", + "boolean": "booleano", + "count": "contatore", + "string": "stringa", + "number": "numero", + "array": "vettore", + "required": "richiesto", + "default": "predefinito", + "default:": "predefinito:", + "choices:": "scelte:", + "aliases:": "alias:", + "generated-value": "valore generato", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s", + "other": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s", + "other": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s" + }, + "Missing argument value: %s": { + "one": "Argomento mancante: %s", + "other": "Argomenti mancanti: %s" + }, + "Missing required argument: %s": { + "one": "Argomento richiesto mancante: %s", + "other": "Argomenti richiesti mancanti: %s" + }, + "Unknown argument: %s": { + "one": "Argomento sconosciuto: %s", + "other": "Argomenti sconosciuti: %s" + }, + "Invalid values:": "Valori non validi:", + "Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s", + "Argument check failed: %s": "Controllo dell'argomento fallito: %s", + "Implications failed:": "Argomenti dipendenti mancanti:", + "Not enough arguments following: %s": "Argomenti insufficienti dopo: %s", + "Invalid JSON config file: %s": "File di configurazione JSON non valido: %s", + "Path to JSON config file": "Percorso del file di configurazione JSON", + "Show help": "Mostra la schermata di aiuto", + "Show version number": "Mostra il numero di versione", + "Did you mean %s?": "Intendi forse %s?" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/ja.json b/node_modules/nyc/node_modules/yargs/locales/ja.json new file mode 100644 index 0000000..3954ae6 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/ja.json @@ -0,0 +1,51 @@ +{ + "Commands:": "コマンド:", + "Options:": "オプション:", + "Examples:": "例:", + "boolean": "真偽", + "count": "カウント", + "string": "文字列", + "number": "数値", + "array": "配列", + "required": "必須", + "default": "デフォルト", + "default:": "デフォルト:", + "choices:": "選択してください:", + "aliases:": "エイリアス:", + "generated-value": "生成された値", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:", + "other": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:", + "other": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:" + }, + "Missing argument value: %s": { + "one": "引数の値が見つかりません: %s", + "other": "引数の値が見つかりません: %s" + }, + "Missing required argument: %s": { + "one": "必須の引数が見つかりません: %s", + "other": "必須の引数が見つかりません: %s" + }, + "Unknown argument: %s": { + "one": "未知の引数です: %s", + "other": "未知の引数です: %s" + }, + "Invalid values:": "不正な値です:", + "Argument: %s, Given: %s, Choices: %s": "引数は %s です。与えられた値: %s, 選択してください: %s", + "Argument check failed: %s": "引数のチェックに失敗しました: %s", + "Implications failed:": "オプションの組み合わせで不正が生じました:", + "Not enough arguments following: %s": "次の引数が不足しています。: %s", + "Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s", + "Path to JSON config file": "JSONの設定ファイルまでのpath", + "Show help": "ヘルプを表示", + "Show version number": "バージョンを表示", + "Did you mean %s?": "もしかして %s?", + "Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません", + "Positionals:": "位置:", + "command": "コマンド", + "deprecated": "非推奨", + "deprecated: %s": "非推奨: %s" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/ko.json b/node_modules/nyc/node_modules/yargs/locales/ko.json new file mode 100644 index 0000000..e3187ea --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/ko.json @@ -0,0 +1,49 @@ +{ + "Commands:": "명령:", + "Options:": "옵션:", + "Examples:": "예시:", + "boolean": "여부", + "count": "개수", + "string": "문자열", + "number": "숫자", + "array": "배열", + "required": "필수", + "default": "기본", + "default:": "기본:", + "choices:": "선택:", + "aliases:": "별칭:", + "generated-value": "생성된 값", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다", + "other": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다", + "other": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다" + }, + "Missing argument value: %s": { + "one": "인자값을 받지 못했습니다: %s", + "other": "인자값들을 받지 못했습니다: %s" + }, + "Missing required argument: %s": { + "one": "필수 인자를 받지 못했습니다: %s", + "other": "필수 인자들을 받지 못했습니다: %s" + }, + "Unknown argument: %s": { + "one": "알 수 없는 인자입니다: %s", + "other": "알 수 없는 인자들입니다: %s" + }, + "Invalid values:": "잘못된 값입니다:", + "Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s", + "Argument check failed: %s": "유효하지 않은 인자입니다: %s", + "Implications failed:": "옵션의 조합이 잘못되었습니다:", + "Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s", + "Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s", + "Path to JSON config file": "JSON 설정파일 경로", + "Show help": "도움말을 보여줍니다", + "Show version number": "버전 넘버를 보여줍니다", + "Did you mean %s?": "찾고계신게 %s입니까?", + "Arguments %s and %s are mutually exclusive" : "%s와 %s 인자는 같이 사용될 수 없습니다", + "Positionals:": "위치:", + "command": "명령" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/nb.json b/node_modules/nyc/node_modules/yargs/locales/nb.json new file mode 100644 index 0000000..6f410ed --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/nb.json @@ -0,0 +1,44 @@ +{ + "Commands:": "Kommandoer:", + "Options:": "Alternativer:", + "Examples:": "Eksempler:", + "boolean": "boolsk", + "count": "antall", + "string": "streng", + "number": "nummer", + "array": "matrise", + "required": "obligatorisk", + "default": "standard", + "default:": "standard:", + "choices:": "valg:", + "generated-value": "generert-verdi", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s", + "other": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s", + "other": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s" + }, + "Missing argument value: %s": { + "one": "Mangler argument verdi: %s", + "other": "Mangler argument verdier: %s" + }, + "Missing required argument: %s": { + "one": "Mangler obligatorisk argument: %s", + "other": "Mangler obligatoriske argumenter: %s" + }, + "Unknown argument: %s": { + "one": "Ukjent argument: %s", + "other": "Ukjente argumenter: %s" + }, + "Invalid values:": "Ugyldige verdier:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s", + "Argument check failed: %s": "Argumentsjekk mislyktes: %s", + "Implications failed:": "Konsekvensene mislyktes:", + "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s", + "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", + "Path to JSON config file": "Bane til JSON konfigurasjonsfil", + "Show help": "Vis hjelp", + "Show version number": "Vis versjonsnummer" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/nl.json b/node_modules/nyc/node_modules/yargs/locales/nl.json new file mode 100644 index 0000000..9ff95c5 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/nl.json @@ -0,0 +1,49 @@ +{ + "Commands:": "Commando's:", + "Options:": "Opties:", + "Examples:": "Voorbeelden:", + "boolean": "booleaans", + "count": "aantal", + "string": "string", + "number": "getal", + "array": "lijst", + "required": "verplicht", + "default": "standaard", + "default:": "standaard:", + "choices:": "keuzes:", + "aliases:": "aliassen:", + "generated-value": "gegenereerde waarde", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig", + "other": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s", + "other": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s" + }, + "Missing argument value: %s": { + "one": "Missende argumentwaarde: %s", + "other": "Missende argumentwaarden: %s" + }, + "Missing required argument: %s": { + "one": "Missend verplicht argument: %s", + "other": "Missende verplichte argumenten: %s" + }, + "Unknown argument: %s": { + "one": "Onbekend argument: %s", + "other": "Onbekende argumenten: %s" + }, + "Invalid values:": "Ongeldige waarden:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s", + "Argument check failed: %s": "Argumentcontrole mislukt: %s", + "Implications failed:": "Ontbrekende afhankelijke argumenten:", + "Not enough arguments following: %s": "Niet genoeg argumenten na: %s", + "Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s", + "Path to JSON config file": "Pad naar JSON-config-bestand", + "Show help": "Toon help", + "Show version number": "Toon versienummer", + "Did you mean %s?": "Bedoelde u misschien %s?", + "Arguments %s and %s are mutually exclusive": "Argumenten %s en %s kunnen niet tegelijk gebruikt worden", + "Positionals:": "Positie-afhankelijke argumenten", + "command": "commando" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/nn.json b/node_modules/nyc/node_modules/yargs/locales/nn.json new file mode 100644 index 0000000..24479ac --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/nn.json @@ -0,0 +1,44 @@ +{ + "Commands:": "Kommandoar:", + "Options:": "Alternativ:", + "Examples:": "Døme:", + "boolean": "boolsk", + "count": "mengd", + "string": "streng", + "number": "nummer", + "array": "matrise", + "required": "obligatorisk", + "default": "standard", + "default:": "standard:", + "choices:": "val:", + "generated-value": "generert-verdi", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s", + "other": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "For mange ikkje-alternativ argument: fekk %s, maksimum %s", + "other": "For mange ikkje-alternativ argument: fekk %s, maksimum %s" + }, + "Missing argument value: %s": { + "one": "Manglar argumentverdi: %s", + "other": "Manglar argumentverdiar: %s" + }, + "Missing required argument: %s": { + "one": "Manglar obligatorisk argument: %s", + "other": "Manglar obligatoriske argument: %s" + }, + "Unknown argument: %s": { + "one": "Ukjent argument: %s", + "other": "Ukjende argument: %s" + }, + "Invalid values:": "Ugyldige verdiar:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s", + "Argument check failed: %s": "Argumentsjekk mislukkast: %s", + "Implications failed:": "Konsekvensane mislukkast:", + "Not enough arguments following: %s": "Ikkje nok fylgjande argument: %s", + "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", + "Path to JSON config file": "Bane til JSON konfigurasjonsfil", + "Show help": "Vis hjelp", + "Show version number": "Vis versjonsnummer" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/pirate.json b/node_modules/nyc/node_modules/yargs/locales/pirate.json new file mode 100644 index 0000000..dcb5cb7 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/pirate.json @@ -0,0 +1,13 @@ +{ + "Commands:": "Choose yer command:", + "Options:": "Options for me hearties!", + "Examples:": "Ex. marks the spot:", + "required": "requi-yar-ed", + "Missing required argument: %s": { + "one": "Ye be havin' to set the followin' argument land lubber: %s", + "other": "Ye be havin' to set the followin' arguments land lubber: %s" + }, + "Show help": "Parlay this here code of conduct", + "Show version number": "'Tis the version ye be askin' fer", + "Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/pl.json b/node_modules/nyc/node_modules/yargs/locales/pl.json new file mode 100644 index 0000000..a41d4bd --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/pl.json @@ -0,0 +1,49 @@ +{ + "Commands:": "Polecenia:", + "Options:": "Opcje:", + "Examples:": "Przykłady:", + "boolean": "boolean", + "count": "ilość", + "string": "ciąg znaków", + "number": "liczba", + "array": "tablica", + "required": "wymagany", + "default": "domyślny", + "default:": "domyślny:", + "choices:": "dostępne:", + "aliases:": "aliasy:", + "generated-value": "wygenerowana-wartość", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s", + "other": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s", + "other": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s" + }, + "Missing argument value: %s": { + "one": "Brak wartości dla argumentu: %s", + "other": "Brak wartości dla argumentów: %s" + }, + "Missing required argument: %s": { + "one": "Brak wymaganego argumentu: %s", + "other": "Brak wymaganych argumentów: %s" + }, + "Unknown argument: %s": { + "one": "Nieznany argument: %s", + "other": "Nieznane argumenty: %s" + }, + "Invalid values:": "Nieprawidłowe wartości:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s", + "Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s", + "Implications failed:": "Założenia nie zostały spełnione:", + "Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s", + "Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s", + "Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON", + "Show help": "Pokaż pomoc", + "Show version number": "Pokaż numer wersji", + "Did you mean %s?": "Czy chodziło Ci o %s?", + "Arguments %s and %s are mutually exclusive": "Argumenty %s i %s wzajemnie się wykluczają", + "Positionals:": "Pozycyjne:", + "command": "polecenie" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/pt.json b/node_modules/nyc/node_modules/yargs/locales/pt.json new file mode 100644 index 0000000..0c8ac99 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/pt.json @@ -0,0 +1,45 @@ +{ + "Commands:": "Comandos:", + "Options:": "Opções:", + "Examples:": "Exemplos:", + "boolean": "boolean", + "count": "contagem", + "string": "cadeia de caracteres", + "number": "número", + "array": "arranjo", + "required": "requerido", + "default": "padrão", + "default:": "padrão:", + "choices:": "escolhas:", + "generated-value": "valor-gerado", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s", + "other": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Excesso de argumentos não opcionais: recebido %s, máximo de %s", + "other": "Excesso de argumentos não opcionais: recebido %s, máximo de %s" + }, + "Missing argument value: %s": { + "one": "Falta valor de argumento: %s", + "other": "Falta valores de argumento: %s" + }, + "Missing required argument: %s": { + "one": "Falta argumento obrigatório: %s", + "other": "Faltando argumentos obrigatórios: %s" + }, + "Unknown argument: %s": { + "one": "Argumento desconhecido: %s", + "other": "Argumentos desconhecidos: %s" + }, + "Invalid values:": "Valores inválidos:", + "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s", + "Argument check failed: %s": "Verificação de argumento falhou: %s", + "Implications failed:": "Implicações falharam:", + "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s", + "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s", + "Path to JSON config file": "Caminho para o arquivo de configuração em JSON", + "Show help": "Mostra ajuda", + "Show version number": "Mostra número de versão", + "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/pt_BR.json b/node_modules/nyc/node_modules/yargs/locales/pt_BR.json new file mode 100644 index 0000000..eae1ec6 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/pt_BR.json @@ -0,0 +1,48 @@ +{ + "Commands:": "Comandos:", + "Options:": "Opções:", + "Examples:": "Exemplos:", + "boolean": "booleano", + "count": "contagem", + "string": "string", + "number": "número", + "array": "array", + "required": "obrigatório", + "default:": "padrão:", + "choices:": "opções:", + "aliases:": "sinônimos:", + "generated-value": "valor-gerado", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s", + "other": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Excesso de argumentos: recebido %s, máximo de %s", + "other": "Excesso de argumentos: recebido %s, máximo de %s" + }, + "Missing argument value: %s": { + "one": "Falta valor de argumento: %s", + "other": "Falta valores de argumento: %s" + }, + "Missing required argument: %s": { + "one": "Falta argumento obrigatório: %s", + "other": "Faltando argumentos obrigatórios: %s" + }, + "Unknown argument: %s": { + "one": "Argumento desconhecido: %s", + "other": "Argumentos desconhecidos: %s" + }, + "Invalid values:": "Valores inválidos:", + "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s", + "Argument check failed: %s": "Verificação de argumento falhou: %s", + "Implications failed:": "Implicações falharam:", + "Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s", + "Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s", + "Path to JSON config file": "Caminho para o arquivo JSON de configuração", + "Show help": "Exibe ajuda", + "Show version number": "Exibe a versão", + "Did you mean %s?": "Você quis dizer %s?", + "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos", + "Positionals:": "Posicionais:", + "command": "comando" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/ru.json b/node_modules/nyc/node_modules/yargs/locales/ru.json new file mode 100644 index 0000000..5f7f768 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/ru.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Команды:", + "Options:": "Опции:", + "Examples:": "Примеры:", + "boolean": "булевый тип", + "count": "подсчет", + "string": "строковой тип", + "number": "число", + "array": "массив", + "required": "необходимо", + "default": "по умолчанию", + "default:": "по умолчанию:", + "choices:": "возможности:", + "aliases:": "алиасы:", + "generated-value": "генерированное значение", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s", + "other": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s", + "other": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s" + }, + "Missing argument value: %s": { + "one": "Не хватает значения аргумента: %s", + "other": "Не хватает значений аргументов: %s" + }, + "Missing required argument: %s": { + "one": "Не хватает необходимого аргумента: %s", + "other": "Не хватает необходимых аргументов: %s" + }, + "Unknown argument: %s": { + "one": "Неизвестный аргумент: %s", + "other": "Неизвестные аргументы: %s" + }, + "Invalid values:": "Недействительные значения:", + "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Данное значение: %s, Возможности: %s", + "Argument check failed: %s": "Проверка аргументов не удалась: %s", + "Implications failed:": "Данный аргумент требует следующий дополнительный аргумент:", + "Not enough arguments following: %s": "Недостаточно следующих аргументов: %s", + "Invalid JSON config file: %s": "Недействительный файл конфигурации JSON: %s", + "Path to JSON config file": "Путь к файлу конфигурации JSON", + "Show help": "Показать помощь", + "Show version number": "Показать номер версии", + "Did you mean %s?": "Вы имели в виду %s?" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/th.json b/node_modules/nyc/node_modules/yargs/locales/th.json new file mode 100644 index 0000000..33b048e --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/th.json @@ -0,0 +1,46 @@ +{ + "Commands:": "คอมมาน", + "Options:": "ออฟชั่น", + "Examples:": "ตัวอย่าง", + "boolean": "บูลีน", + "count": "นับ", + "string": "สตริง", + "number": "ตัวเลข", + "array": "อาเรย์", + "required": "จำเป็น", + "default": "ค่าเริ่มต้", + "default:": "ค่าเริ่มต้น", + "choices:": "ตัวเลือก", + "aliases:": "เอเลียส", + "generated-value": "ค่าที่ถูกสร้างขึ้น", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า", + "other": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า", + "other": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า" + }, + "Missing argument value: %s": { + "one": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s", + "other": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s" + }, + "Missing required argument: %s": { + "one": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s", + "other": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s" + }, + "Unknown argument: %s": { + "one": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s", + "other": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s" + }, + "Invalid values:": "ค่าไม่ถูกต้อง:", + "Argument: %s, Given: %s, Choices: %s": "อาร์กิวเมนต์: %s, ได้รับ: %s, ตัวเลือก: %s", + "Argument check failed: %s": "ตรวจสอบพบอาร์กิวเมนต์ที่ไม่ถูกต้อง: %s", + "Implications failed:": "Implications ไม่สำเร็จ:", + "Not enough arguments following: %s": "ใส่อาร์กิวเมนต์ไม่ครบ: %s", + "Invalid JSON config file: %s": "ไฟล์คอนฟิค JSON ไม่ถูกต้อง: %s", + "Path to JSON config file": "พาทไฟล์คอนฟิค JSON", + "Show help": "ขอความช่วยเหลือ", + "Show version number": "แสดงตัวเลขเวอร์ชั่น", + "Did you mean %s?": "คุณหมายถึง %s?" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/tr.json b/node_modules/nyc/node_modules/yargs/locales/tr.json new file mode 100644 index 0000000..0d0d2cc --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/tr.json @@ -0,0 +1,48 @@ +{ + "Commands:": "Komutlar:", + "Options:": "Seçenekler:", + "Examples:": "Örnekler:", + "boolean": "boolean", + "count": "sayı", + "string": "string", + "number": "numara", + "array": "array", + "required": "zorunlu", + "default": "varsayılan", + "default:": "varsayılan:", + "choices:": "seçimler:", + "aliases:": "takma adlar:", + "generated-value": "oluşturulan-değer", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli", + "other": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s", + "other": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s" + }, + "Missing argument value: %s": { + "one": "Eksik argüman değeri: %s", + "other": "Eksik argüman değerleri: %s" + }, + "Missing required argument: %s": { + "one": "Eksik zorunlu argüman: %s", + "other": "Eksik zorunlu argümanlar: %s" + }, + "Unknown argument: %s": { + "one": "Bilinmeyen argüman: %s", + "other": "Bilinmeyen argümanlar: %s" + }, + "Invalid values:": "Geçersiz değerler:", + "Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s", + "Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s", + "Implications failed:": "Sonuçlar başarısız oldu:", + "Not enough arguments following: %s": "%s için yeterli argüman bulunamadı", + "Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s", + "Path to JSON config file": "JSON yapılandırma dosya konumu", + "Show help": "Yardım detaylarını göster", + "Show version number": "Versiyon detaylarını göster", + "Did you mean %s?": "Bunu mu demek istediniz: %s?", + "Positionals:": "Sıralılar:", + "command": "komut" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/zh_CN.json b/node_modules/nyc/node_modules/yargs/locales/zh_CN.json new file mode 100644 index 0000000..257d26b --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/zh_CN.json @@ -0,0 +1,48 @@ +{ + "Commands:": "命令:", + "Options:": "选项:", + "Examples:": "示例:", + "boolean": "布尔", + "count": "计数", + "string": "字符串", + "number": "数字", + "array": "数组", + "required": "必需", + "default": "默认值", + "default:": "默认值:", + "choices:": "可选值:", + "generated-value": "生成的值", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个", + "other": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个", + "other": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个" + }, + "Missing argument value: %s": { + "one": "没有给此选项指定值:%s", + "other": "没有给这些选项指定值:%s" + }, + "Missing required argument: %s": { + "one": "缺少必须的选项:%s", + "other": "缺少这些必须的选项:%s" + }, + "Unknown argument: %s": { + "one": "无法识别的选项:%s", + "other": "无法识别这些选项:%s" + }, + "Invalid values:": "无效的选项值:", + "Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s", + "Argument check failed: %s": "选项值验证失败:%s", + "Implications failed:": "缺少依赖的选项:", + "Not enough arguments following: %s": "没有提供足够的值给此选项:%s", + "Invalid JSON config file: %s": "无效的 JSON 配置文件:%s", + "Path to JSON config file": "JSON 配置文件的路径", + "Show help": "显示帮助信息", + "Show version number": "显示版本号", + "Did you mean %s?": "是指 %s?", + "Arguments %s and %s are mutually exclusive" : "选项 %s 和 %s 是互斥的", + "Positionals:": "位置:", + "command": "命令" +} diff --git a/node_modules/nyc/node_modules/yargs/locales/zh_TW.json b/node_modules/nyc/node_modules/yargs/locales/zh_TW.json new file mode 100644 index 0000000..e3c7bcf --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/locales/zh_TW.json @@ -0,0 +1,47 @@ +{ + "Commands:": "命令:", + "Options:": "選項:", + "Examples:": "例:", + "boolean": "布林", + "count": "次數", + "string": "字串", + "number": "數字", + "array": "陣列", + "required": "必須", + "default": "預設值", + "default:": "預設值:", + "choices:": "可選值:", + "aliases:": "別名:", + "generated-value": "生成的值", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個", + "other": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個", + "other": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個" + }, + "Missing argument value: %s": { + "one": "此引數無指定值:%s", + "other": "這些引數無指定值:%s" + }, + "Missing required argument: %s": { + "one": "缺少必須的引數:%s", + "other": "缺少這些必須的引數:%s" + }, + "Unknown argument: %s": { + "one": "未知的引數:%s", + "other": "未知的這些引數:%s" + }, + "Invalid values:": "無效的選項值:", + "Argument: %s, Given: %s, Choices: %s": "引數名稱: %s, 傳入的值: %s, 可選的值:%s", + "Argument check failed: %s": "引數驗證失敗:%s", + "Implications failed:": "缺少依賴的選項:", + "Not enough arguments following: %s": "沒有提供足夠的值給此引數:%s", + "Invalid JSON config file: %s": "無效的 JSON 設置文件:%s", + "Path to JSON config file": "JSON 設置文件的路徑", + "Show help": "顯示說明", + "Show version number": "顯示版本", + "Did you mean %s?": "是指 %s?", + "Arguments %s and %s are mutually exclusive" : "引數 %s 和 %s 是互斥的" +} diff --git a/node_modules/nyc/node_modules/yargs/package.json b/node_modules/nyc/node_modules/yargs/package.json new file mode 100644 index 0000000..dc3018a --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/package.json @@ -0,0 +1,92 @@ +{ + "name": "yargs", + "version": "15.4.1", + "description": "yargs the modern, pirate-themed, successor to optimist.", + "main": "./index.js", + "contributors": [ + { + "name": "Yargs Contributors", + "url": "https://github.com/yargs/yargs/graphs/contributors" + } + ], + "files": [ + "index.js", + "yargs.js", + "build", + "locales", + "LICENSE" + ], + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "devDependencies": { + "@types/chai": "^4.2.11", + "@types/decamelize": "^1.2.0", + "@types/mocha": "^7.0.2", + "@types/node": "^10.0.3", + "@typescript-eslint/eslint-plugin": "^3.0.0", + "@typescript-eslint/parser": "^3.0.0", + "c8": "^7.0.0", + "chai": "^4.2.0", + "chalk": "^4.0.0", + "coveralls": "^3.0.9", + "cpr": "^3.0.1", + "cross-spawn": "^7.0.0", + "es6-promise": "^4.2.5", + "eslint": "^6.8.0", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-node": "^11.0.0", + "gts": "^2.0.0-alpha.4", + "hashish": "0.0.4", + "mocha": "^7.0.0", + "rimraf": "^3.0.2", + "standardx": "^5.0.0", + "typescript": "^3.7.0", + "which": "^2.0.0", + "yargs-test-extends": "^1.0.1" + }, + "scripts": { + "fix": "standardx --fix && standardx --fix **/*.ts", + "posttest": "npm run check", + "test": "c8 mocha --require ./test/before.js --timeout=12000 --check-leaks", + "coverage": "c8 report --check-coverage", + "check": "standardx && standardx **/*.ts", + "compile": "rimraf build && tsc", + "prepare": "npm run compile", + "pretest": "npm run compile -- -p tsconfig.test.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/yargs/yargs.git" + }, + "homepage": "https://yargs.js.org/", + "standardx": { + "ignore": [ + "build", + "**/example/**" + ] + }, + "keywords": [ + "argument", + "args", + "option", + "parser", + "parsing", + "cli", + "command" + ], + "license": "MIT", + "engines": { + "node": ">=8" + } +} diff --git a/node_modules/nyc/node_modules/yargs/yargs.js b/node_modules/nyc/node_modules/yargs/yargs.js new file mode 100644 index 0000000..93e8059 --- /dev/null +++ b/node_modules/nyc/node_modules/yargs/yargs.js @@ -0,0 +1,14 @@ +'use strict' + +// an async function fails early in Node.js versions prior to 8. +async function requiresNode8OrGreater () {} +requiresNode8OrGreater() + +const { Yargs, rebase } = require('./build/lib/yargs') +const Parser = require('yargs-parser') + +exports = module.exports = Yargs +exports.rebase = rebase + +// allow consumers to directly use the version of yargs-parser used by yargs +exports.Parser = Parser diff --git a/node_modules/nyc/package.json b/node_modules/nyc/package.json new file mode 100644 index 0000000..87d0ab1 --- /dev/null +++ b/node_modules/nyc/package.json @@ -0,0 +1,108 @@ +{ + "name": "nyc", + "version": "17.1.0", + "description": "the Istanbul command line interface", + "main": "index.js", + "scripts": { + "lint": "standard", + "pretest": "npm run lint && npm run clean && npm run instrument", + "test": "tap", + "snap": "npm test -- --snapshot", + "fix": "standard --fix", + "posttest": "npm run report", + "clean": "node ./npm-run-clean.js", + "instrument": "node ./build-self-coverage.js", + "report": "node ./bin/nyc report --temp-dir ./.self_coverage/ -r text -r lcov", + "release": "standard-version" + }, + "bin": { + "nyc": "./bin/nyc.js" + }, + "files": [ + "index.js", + "bin/*.js", + "lib/**/*.js" + ], + "standard": { + "ignore": [ + "/tap-snapshots/", + "**/fixtures/**", + "**/test/build/*" + ] + }, + "keywords": [ + "coverage", + "reporter", + "subprocess", + "testing" + ], + "contributors": [ + { + "name": "Isaac Schlueter", + "website": "https://github.com/isaacs" + }, + { + "name": "Mark Wubben", + "website": "https://novemberborn.net" + }, + { + "name": "James Talmage", + "website": "https://twitter.com/jamestalmage" + }, + { + "name": "Krishnan Anantheswaran", + "website": "https://github.com/gotwarlost" + } + ], + "author": "Ben Coe ", + "license": "ISC", + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "devDependencies": { + "any-path": "^1.3.0", + "is-windows": "^1.0.2", + "requirejs": "^2.3.6", + "source-map-support": "^0.5.16", + "standard": "^14.3.1", + "standard-version": "^9.0.0", + "tap": "^18.7.2", + "uuid": "^3.4.0", + "which": "^2.0.2" + }, + "engines": { + "node": ">=18" + }, + "homepage": "https://istanbul.js.org/", + "bugs": "https://github.com/istanbuljs/nyc/issues", + "repository": { + "type": "git", + "url": "git@github.com:istanbuljs/nyc.git" + } +} diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 0000000..0930cf8 --- /dev/null +++ b/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json new file mode 100644 index 0000000..503eb1e --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,42 @@ +{ + "name": "object-assign", + "version": "4.1.1", + "description": "ES2015 `Object.assign()` ponyfill", + "license": "MIT", + "repository": "sindresorhus/object-assign", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "bench": "matcha bench.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + } +} diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md new file mode 100644 index 0000000..1be09d3 --- /dev/null +++ b/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/object-inspect/.eslintrc b/node_modules/object-inspect/.eslintrc new file mode 100644 index 0000000..21f9039 --- /dev/null +++ b/node_modules/object-inspect/.eslintrc @@ -0,0 +1,53 @@ +{ + "root": true, + "extends": "@ljharb", + "rules": { + "complexity": 0, + "func-style": [2, "declaration"], + "indent": [2, 4], + "max-lines": 1, + "max-lines-per-function": 1, + "max-params": [2, 4], + "max-statements": 0, + "max-statements-per-line": [2, { "max": 2 }], + "no-magic-numbers": 0, + "no-param-reassign": 1, + "strict": 0, // TODO + }, + "overrides": [ + { + "files": ["test/**", "test-*", "example/**"], + "extends": "@ljharb/eslint-config/tests", + "rules": { + "id-length": 0, + }, + }, + { + "files": ["example/**"], + "rules": { + "no-console": 0, + }, + }, + { + "files": ["test/browser/**"], + "env": { + "browser": true, + }, + }, + { + "files": ["test/bigint*"], + "rules": { + "new-cap": [2, { "capIsNewExceptions": ["BigInt"] }], + }, + }, + { + "files": "index.js", + "globals": { + "HTMLElement": false, + }, + "rules": { + "no-use-before-define": 1, + }, + }, + ], +} diff --git a/node_modules/object-inspect/.github/FUNDING.yml b/node_modules/object-inspect/.github/FUNDING.yml new file mode 100644 index 0000000..730276b --- /dev/null +++ b/node_modules/object-inspect/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/object-inspect +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/object-inspect/.nycrc b/node_modules/object-inspect/.nycrc new file mode 100644 index 0000000..58a5db7 --- /dev/null +++ b/node_modules/object-inspect/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "instrumentation": false, + "sourceMap": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "example", + "test", + "test-core-js.js" + ] +} diff --git a/node_modules/object-inspect/CHANGELOG.md b/node_modules/object-inspect/CHANGELOG.md new file mode 100644 index 0000000..bdf9002 --- /dev/null +++ b/node_modules/object-inspect/CHANGELOG.md @@ -0,0 +1,424 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.13.4](https://github.com/inspect-js/object-inspect/compare/v1.13.3...v1.13.4) - 2025-02-04 + +### Commits + +- [Fix] avoid being fooled by a `Symbol.toStringTag` [`fa5870d`](https://github.com/inspect-js/object-inspect/commit/fa5870da468a525d2f20193700f70752f506cbf7) +- [Tests] fix tests in node v6.0 - v6.4 [`2abfe1b`](https://github.com/inspect-js/object-inspect/commit/2abfe1bc3c69f9293c07c5cd65a9d7d87a628b84) +- [Dev Deps] update `es-value-fixtures`, `for-each`, `has-symbols` [`3edfb01`](https://github.com/inspect-js/object-inspect/commit/3edfb01cc8cce220fba0dfdfe2dc8bc955758cdd) + +## [v1.13.3](https://github.com/inspect-js/object-inspect/compare/v1.13.2...v1.13.3) - 2024-11-09 + +### Commits + +- [actions] split out node 10-20, and 20+ [`44395a8`](https://github.com/inspect-js/object-inspect/commit/44395a8fc1deda6718a5e125e86b9ffcaa1c7580) +- [Fix] `quoteStyle`: properly escape only the containing quotes [`5137f8f`](https://github.com/inspect-js/object-inspect/commit/5137f8f7bea69a7fc671bb683fd35f244f38fc52) +- [Refactor] clean up `quoteStyle` code [`450680c`](https://github.com/inspect-js/object-inspect/commit/450680cd50de4e689ee3b8e1d6db3a1bcf3fc18c) +- [Tests] add `quoteStyle` escaping tests [`e997c59`](https://github.com/inspect-js/object-inspect/commit/e997c595aeaea84fd98ca35d7e1c3b5ab3ae26e0) +- [Dev Deps] update `auto-changelog`, `es-value-fixtures`, `tape` [`d5a469c`](https://github.com/inspect-js/object-inspect/commit/d5a469c99ec07ccaeafc36ac4b36a93285086d48) +- [Tests] replace `aud` with `npm audit` [`fb7815f`](https://github.com/inspect-js/object-inspect/commit/fb7815f9b72cae277a04f65bbb0543f85b88be62) +- [Dev Deps] update `mock-property` [`11c817b`](https://github.com/inspect-js/object-inspect/commit/11c817bf10392aa017755962ba6bc89d731359ee) + +## [v1.13.2](https://github.com/inspect-js/object-inspect/compare/v1.13.1...v1.13.2) - 2024-06-21 + +### Commits + +- [readme] update badges [`8a51e6b`](https://github.com/inspect-js/object-inspect/commit/8a51e6bedaf389ec40cc4659e9df53e8543d176e) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`ef05f58`](https://github.com/inspect-js/object-inspect/commit/ef05f58c9761a41416ab907299bf0fa79517014b) +- [Dev Deps] update `error-cause`, `has-tostringtag`, `tape` [`c0c6c26`](https://github.com/inspect-js/object-inspect/commit/c0c6c26c44cee6671f7c5d43d2b91d27c5c00d90) +- [Fix] Don't throw when `global` is not defined [`d4d0965`](https://github.com/inspect-js/object-inspect/commit/d4d096570f7dbd0e03266a96de11d05eb7b63e0f) +- [meta] add missing `engines.node` [`17a352a`](https://github.com/inspect-js/object-inspect/commit/17a352af6fe1ba6b70a19081674231eb1a50c940) +- [Dev Deps] update `globalthis` [`9c08884`](https://github.com/inspect-js/object-inspect/commit/9c08884aa662a149e2f11403f413927736b97da7) +- [Dev Deps] update `error-cause` [`6af352d`](https://github.com/inspect-js/object-inspect/commit/6af352d7c3929a4cc4c55768c27bf547a5e900f4) +- [Dev Deps] update `npmignore` [`94e617d`](https://github.com/inspect-js/object-inspect/commit/94e617d38831722562fa73dff4c895746861d267) +- [Dev Deps] update `mock-property` [`2ac24d7`](https://github.com/inspect-js/object-inspect/commit/2ac24d7e58cd388ad093c33249e413e05bbfd6c3) +- [Dev Deps] update `tape` [`46125e5`](https://github.com/inspect-js/object-inspect/commit/46125e58f1d1dcfb170ed3d1ea69da550ea8d77b) + +## [v1.13.1](https://github.com/inspect-js/object-inspect/compare/v1.13.0...v1.13.1) - 2023-10-19 + +### Commits + +- [Fix] in IE 8, global can !== window despite them being prototypes of each other [`30d0859`](https://github.com/inspect-js/object-inspect/commit/30d0859dc4606cf75c2410edcd5d5c6355f8d372) + +## [v1.13.0](https://github.com/inspect-js/object-inspect/compare/v1.12.3...v1.13.0) - 2023-10-14 + +### Commits + +- [New] add special handling for the global object [`431bab2`](https://github.com/inspect-js/object-inspect/commit/431bab21a490ee51d35395966a504501e8c685da) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`fd4f619`](https://github.com/inspect-js/object-inspect/commit/fd4f6193562b4b0e95dcf5c0201b4e8cbbc4f58d) +- [Dev Deps] update `mock-property`, `tape` [`b453f6c`](https://github.com/inspect-js/object-inspect/commit/b453f6ceeebf8a1b738a1029754092e0367a4134) +- [Dev Deps] update `error-cause` [`e8ffc57`](https://github.com/inspect-js/object-inspect/commit/e8ffc577d73b92bb6a4b00c44f14e3319e374888) +- [Dev Deps] update `tape` [`054b8b9`](https://github.com/inspect-js/object-inspect/commit/054b8b9b98633284cf989e582450ebfbbe53503c) +- [Dev Deps] temporarily remove `aud` due to breaking change in transitive deps [`2476845`](https://github.com/inspect-js/object-inspect/commit/2476845e0678dd290c541c81cd3dec8420782c52) +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` [`383fa5e`](https://github.com/inspect-js/object-inspect/commit/383fa5eebc0afd705cc778a4b49d8e26452e49a8) +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 [`68c244c`](https://github.com/inspect-js/object-inspect/commit/68c244c5174cdd877e5dcb8ee90aa3f44b2f25be) + +## [v1.12.3](https://github.com/inspect-js/object-inspect/compare/v1.12.2...v1.12.3) - 2023-01-12 + +### Commits + +- [Fix] in eg FF 24, collections lack forEach [`75fc226`](https://github.com/inspect-js/object-inspect/commit/75fc22673c82d45f28322b1946bb0eb41b672b7f) +- [actions] update rebase action to use reusable workflow [`250a277`](https://github.com/inspect-js/object-inspect/commit/250a277a095e9dacc029ab8454dcfc15de549dcd) +- [Dev Deps] update `aud`, `es-value-fixtures`, `tape` [`66a19b3`](https://github.com/inspect-js/object-inspect/commit/66a19b3209ccc3c5ef4b34c3cb0160e65d1ce9d5) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `error-cause` [`c43d332`](https://github.com/inspect-js/object-inspect/commit/c43d3324b48384a16fd3dc444e5fc589d785bef3) +- [Tests] add `@pkgjs/support` to `postlint` [`e2618d2`](https://github.com/inspect-js/object-inspect/commit/e2618d22a7a3fa361b6629b53c1752fddc9c4d80) + +## [v1.12.2](https://github.com/inspect-js/object-inspect/compare/v1.12.1...v1.12.2) - 2022-05-26 + +### Commits + +- [Fix] use `util.inspect` for a custom inspection symbol method [`e243bf2`](https://github.com/inspect-js/object-inspect/commit/e243bf2eda6c4403ac6f1146fddb14d12e9646c1) +- [meta] add support info [`ca20ba3`](https://github.com/inspect-js/object-inspect/commit/ca20ba35713c17068ca912a86c542f5e8acb656c) +- [Fix] ignore `cause` in node v16.9 and v16.10 where it has a bug [`86aa553`](https://github.com/inspect-js/object-inspect/commit/86aa553a4a455562c2c56f1540f0bf857b9d314b) + +## [v1.12.1](https://github.com/inspect-js/object-inspect/compare/v1.12.0...v1.12.1) - 2022-05-21 + +### Commits + +- [Tests] use `mock-property` [`4ec8893`](https://github.com/inspect-js/object-inspect/commit/4ec8893ea9bfd28065ca3638cf6762424bf44352) +- [meta] use `npmignore` to autogenerate an npmignore file [`07f868c`](https://github.com/inspect-js/object-inspect/commit/07f868c10bd25a9d18686528339bb749c211fc9a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b05244b`](https://github.com/inspect-js/object-inspect/commit/b05244b4f331e00c43b3151bc498041be77ccc91) +- [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `es-value-fixtures`, `functions-have-names`, `tape` [`d037398`](https://github.com/inspect-js/object-inspect/commit/d037398dcc5d531532e4c19c4a711ed677f579c1) +- [Fix] properly handle callable regexes in older engines [`848fe48`](https://github.com/inspect-js/object-inspect/commit/848fe48bd6dd0064ba781ee6f3c5e54a94144c37) + +## [v1.12.0](https://github.com/inspect-js/object-inspect/compare/v1.11.1...v1.12.0) - 2021-12-18 + +### Commits + +- [New] add `numericSeparator` boolean option [`2d2d537`](https://github.com/inspect-js/object-inspect/commit/2d2d537f5359a4300ce1c10241369f8024f89e11) +- [Robustness] cache more prototype methods [`191533d`](https://github.com/inspect-js/object-inspect/commit/191533da8aec98a05eadd73a5a6e979c9c8653e8) +- [New] ensure an Error’s `cause` is displayed [`53bc2ce`](https://github.com/inspect-js/object-inspect/commit/53bc2cee4e5a9cc4986f3cafa22c0685f340715e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`bc164b6`](https://github.com/inspect-js/object-inspect/commit/bc164b6e2e7d36b263970f16f54de63048b84a36) +- [Robustness] cache `RegExp.prototype.test` [`a314ab8`](https://github.com/inspect-js/object-inspect/commit/a314ab8271b905cbabc594c82914d2485a8daf12) +- [meta] fix auto-changelog settings [`5ed0983`](https://github.com/inspect-js/object-inspect/commit/5ed0983be72f73e32e2559997517a95525c7e20d) + +## [v1.11.1](https://github.com/inspect-js/object-inspect/compare/v1.11.0...v1.11.1) - 2021-12-05 + +### Commits + +- [meta] add `auto-changelog` [`7dbdd22`](https://github.com/inspect-js/object-inspect/commit/7dbdd228401d6025d8b7391476d88aee9ea9bbdf) +- [actions] reuse common workflows [`c8823bc`](https://github.com/inspect-js/object-inspect/commit/c8823bc0a8790729680709d45fb6e652432e91aa) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`7532b12`](https://github.com/inspect-js/object-inspect/commit/7532b120598307497b712890f75af8056f6d37a6) +- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`94abb5d`](https://github.com/inspect-js/object-inspect/commit/94abb5d4e745bf33253942dea86b3e538d2ff6c6) +- [actions] update codecov uploader [`5ed5102`](https://github.com/inspect-js/object-inspect/commit/5ed51025267a00e53b1341357315490ac4eb0874) +- [Dev Deps] update `eslint`, `tape` [`37b2ad2`](https://github.com/inspect-js/object-inspect/commit/37b2ad26c08d94bfd01d5d07069a0b28ef4e2ad7) +- [meta] add `sideEffects` flag [`d341f90`](https://github.com/inspect-js/object-inspect/commit/d341f905ef8bffa6a694cda6ddc5ba343532cd4f) + +## [v1.11.0](https://github.com/inspect-js/object-inspect/compare/v1.10.3...v1.11.0) - 2021-07-12 + +### Commits + +- [New] `customInspect`: add `symbol` option, to mimic modern util.inspect behavior [`e973a6e`](https://github.com/inspect-js/object-inspect/commit/e973a6e21f8140c5837cf25e9d89bdde88dc3120) +- [Dev Deps] update `eslint` [`05f1cb3`](https://github.com/inspect-js/object-inspect/commit/05f1cb3cbcfe1f238e8b51cf9bc294305b7ed793) + +## [v1.10.3](https://github.com/inspect-js/object-inspect/compare/v1.10.2...v1.10.3) - 2021-05-07 + +### Commits + +- [Fix] handle core-js Symbol shams [`4acfc2c`](https://github.com/inspect-js/object-inspect/commit/4acfc2c4b503498759120eb517abad6d51c9c5d6) +- [readme] update badges [`95c323a`](https://github.com/inspect-js/object-inspect/commit/95c323ad909d6cbabb95dd6015c190ba6db9c1f2) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`cb38f48`](https://github.com/inspect-js/object-inspect/commit/cb38f485de6ec7a95109b5a9bbd0a1deba2f6611) + +## [v1.10.2](https://github.com/inspect-js/object-inspect/compare/v1.10.1...v1.10.2) - 2021-04-17 + +### Commits + +- [Fix] use a robust check for a boxed Symbol [`87f12d6`](https://github.com/inspect-js/object-inspect/commit/87f12d6e69ce530be04659c81a4cd502943acac5) + +## [v1.10.1](https://github.com/inspect-js/object-inspect/compare/v1.10.0...v1.10.1) - 2021-04-17 + +### Commits + +- [Fix] use a robust check for a boxed bigint [`d5ca829`](https://github.com/inspect-js/object-inspect/commit/d5ca8298b6d2e5c7b9334a5b21b96ed95d225c91) + +## [v1.10.0](https://github.com/inspect-js/object-inspect/compare/v1.9.0...v1.10.0) - 2021-04-17 + +### Commits + +- [Tests] increase coverage [`d8abb8a`](https://github.com/inspect-js/object-inspect/commit/d8abb8a62c2f084919df994a433b346e0d87a227) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`4bfec2e`](https://github.com/inspect-js/object-inspect/commit/4bfec2e30aaef6ddef6cbb1448306f9f8b9520b7) +- [New] respect `Symbol.toStringTag` on objects [`799b58f`](https://github.com/inspect-js/object-inspect/commit/799b58f536a45e4484633a8e9daeb0330835f175) +- [Fix] do not allow Symbol.toStringTag to masquerade as builtins [`d6c5b37`](https://github.com/inspect-js/object-inspect/commit/d6c5b37d7e94427796b82432fb0c8964f033a6ab) +- [New] add `WeakRef` support [`b6d898e`](https://github.com/inspect-js/object-inspect/commit/b6d898ee21868c780a7ee66b28532b5b34ed7f09) +- [meta] do not publish github action workflow files [`918cdfc`](https://github.com/inspect-js/object-inspect/commit/918cdfc4b6fe83f559ff6ef04fe66201e3ff5cbd) +- [meta] create `FUNDING.yml` [`0bb5fc5`](https://github.com/inspect-js/object-inspect/commit/0bb5fc516dbcd2cd728bd89cee0b580acc5ce301) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`22c8dc0`](https://github.com/inspect-js/object-inspect/commit/22c8dc0cac113d70f4781e49a950070923a671be) +- [meta] use `prepublishOnly` script for npm 7+ [`e52ee09`](https://github.com/inspect-js/object-inspect/commit/e52ee09e8050b8dbac94ef57f786675567728223) +- [Dev Deps] update `eslint` [`7c4e6fd`](https://github.com/inspect-js/object-inspect/commit/7c4e6fdedcd27cc980e13c9ad834d05a96f3d40c) + +## [v1.9.0](https://github.com/inspect-js/object-inspect/compare/v1.8.0...v1.9.0) - 2020-11-30 + +### Commits + +- [Tests] migrate tests to Github Actions [`d262251`](https://github.com/inspect-js/object-inspect/commit/d262251e13e16d3490b5473672f6b6d6ff86675d) +- [New] add enumerable own Symbols to plain object output [`ee60c03`](https://github.com/inspect-js/object-inspect/commit/ee60c033088cff9d33baa71e59a362a541b48284) +- [Tests] add passing tests [`01ac3e4`](https://github.com/inspect-js/object-inspect/commit/01ac3e4b5a30f97875a63dc9b1416b3bd626afc9) +- [actions] add "Require Allow Edits" action [`c2d7746`](https://github.com/inspect-js/object-inspect/commit/c2d774680cde4ca4af332d84d4121b26f798ba9e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `core-js` [`70058de`](https://github.com/inspect-js/object-inspect/commit/70058de1579fc54d1d15ed6c2dbe246637ce70ff) +- [Fix] hex characters in strings should be uppercased, to match node `assert` [`6ab8faa`](https://github.com/inspect-js/object-inspect/commit/6ab8faaa0abc08fe7a8e2afd8b39c6f1f0e00113) +- [Tests] run `nyc` on all tests [`4c47372`](https://github.com/inspect-js/object-inspect/commit/4c473727879ddc8e28b599202551ddaaf07b6210) +- [Tests] node 0.8 has an unpredictable property order; fix `groups` test by removing property [`f192069`](https://github.com/inspect-js/object-inspect/commit/f192069a978a3b60e6f0e0d45ac7df260ab9a778) +- [New] add enumerable properties to Function inspect result, per node’s `assert` [`fd38e1b`](https://github.com/inspect-js/object-inspect/commit/fd38e1bc3e2a1dc82091ce3e021917462eee64fc) +- [Tests] fix tests for node < 10, due to regex match `groups` [`2ac6462`](https://github.com/inspect-js/object-inspect/commit/2ac6462cc4f72eaa0b63a8cfee9aabe3008b2330) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`44b59e2`](https://github.com/inspect-js/object-inspect/commit/44b59e2676a7f825ef530dfd19dafb599e3b9456) +- [Robustness] cache `Symbol.prototype.toString` [`f3c2074`](https://github.com/inspect-js/object-inspect/commit/f3c2074d8f32faf8292587c07c9678ea931703dd) +- [Dev Deps] update `eslint` [`9411294`](https://github.com/inspect-js/object-inspect/commit/94112944b9245e3302e25453277876402d207e7f) +- [meta] `require-allow-edits` no longer requires an explicit github token [`36c0220`](https://github.com/inspect-js/object-inspect/commit/36c02205de3c2b0e84d53777c5c9fd54a36c48ab) +- [actions] update rebase checkout action to v2 [`55a39a6`](https://github.com/inspect-js/object-inspect/commit/55a39a64e944f19c6a7d8efddf3df27700f20d14) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`f59fd3c`](https://github.com/inspect-js/object-inspect/commit/f59fd3cf406c3a7c7ece140904a80bbc6bacfcca) +- [Dev Deps] update `eslint` [`a492bec`](https://github.com/inspect-js/object-inspect/commit/a492becec644b0155c9c4bc1caf6f9fac11fb2c7) + +## [v1.8.0](https://github.com/inspect-js/object-inspect/compare/v1.7.0...v1.8.0) - 2020-06-18 + +### Fixed + +- [New] add `indent` option [`#27`](https://github.com/inspect-js/object-inspect/issues/27) + +### Commits + +- [Tests] add codecov [`4324cbb`](https://github.com/inspect-js/object-inspect/commit/4324cbb1a2bd7710822a4151ff373570db22453e) +- [New] add `maxStringLength` option [`b3995cb`](https://github.com/inspect-js/object-inspect/commit/b3995cb71e15b5ee127a3094c43994df9d973502) +- [New] add `customInspect` option, to disable custom inspect methods [`28b9179`](https://github.com/inspect-js/object-inspect/commit/28b9179ee802bb3b90810100c11637db90c2fb6d) +- [Tests] add Date and RegExp tests [`3b28eca`](https://github.com/inspect-js/object-inspect/commit/3b28eca57b0367aeadffac604ea09e8bdae7d97b) +- [actions] add automatic rebasing / merge commit blocking [`0d9c6c0`](https://github.com/inspect-js/object-inspect/commit/0d9c6c044e83475ff0bfffb9d35b149834c83a2e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape`; add `aud` [`7c204f2`](https://github.com/inspect-js/object-inspect/commit/7c204f22b9e41bc97147f4d32d4cb045b17769a6) +- [readme] fix repo URLs, remove testling [`34ca9a0`](https://github.com/inspect-js/object-inspect/commit/34ca9a0dabfe75bd311f806a326fadad029909a3) +- [Fix] when truncating a deep array, note it as `[Array]` instead of just `[Object]` [`f74c82d`](https://github.com/inspect-js/object-inspect/commit/f74c82dd0b35386445510deb250f34c41be3ec0e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1a8a5ea`](https://github.com/inspect-js/object-inspect/commit/1a8a5ea069ea2bee89d77caedad83ffa23d35711) +- [Fix] do not be fooled by a function’s own `toString` method [`7cb5c65`](https://github.com/inspect-js/object-inspect/commit/7cb5c657a976f94715c19c10556a30f15bb7d5d7) +- [patch] indicate explicitly that anon functions are anonymous, to match node [`81ebdd4`](https://github.com/inspect-js/object-inspect/commit/81ebdd4215005144074bbdff3f6bafa01407910a) +- [Dev Deps] loosen the `core-js` dep [`e7472e8`](https://github.com/inspect-js/object-inspect/commit/e7472e8e242117670560bd995830c2a4d12080f5) +- [Dev Deps] update `tape` [`699827e`](https://github.com/inspect-js/object-inspect/commit/699827e6b37258b5203c33c78c009bf4b0e6a66d) +- [meta] add `safe-publish-latest` [`c5d2868`](https://github.com/inspect-js/object-inspect/commit/c5d2868d6eb33c472f37a20f89ceef2787046088) +- [Dev Deps] update `@ljharb/eslint-config` [`9199501`](https://github.com/inspect-js/object-inspect/commit/919950195d486114ccebacbdf9d74d7f382693b0) + +## [v1.7.0](https://github.com/inspect-js/object-inspect/compare/v1.6.0...v1.7.0) - 2019-11-10 + +### Commits + +- [Tests] use shared travis-ci configs [`19899ed`](https://github.com/inspect-js/object-inspect/commit/19899edbf31f4f8809acf745ce34ad1ce1bfa63b) +- [Tests] add linting [`a00f057`](https://github.com/inspect-js/object-inspect/commit/a00f057d917f66ea26dd37769c6b810ec4af97e8) +- [Tests] lint last file [`2698047`](https://github.com/inspect-js/object-inspect/commit/2698047b58af1e2e88061598ef37a75f228dddf6) +- [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`589e87a`](https://github.com/inspect-js/object-inspect/commit/589e87a99cadcff4b600e6a303418e9d922836e8) +- [New] add support for `WeakMap` and `WeakSet` [`3ddb3e4`](https://github.com/inspect-js/object-inspect/commit/3ddb3e4e0c8287130c61a12e0ed9c104b1549306) +- [meta] clean up license so github can detect it properly [`27527bb`](https://github.com/inspect-js/object-inspect/commit/27527bb801520c9610c68cc3b55d6f20a2bee56d) +- [Tests] cover `util.inspect.custom` [`36d47b9`](https://github.com/inspect-js/object-inspect/commit/36d47b9c59056a57ef2f1491602c726359561800) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape` [`b614eaa`](https://github.com/inspect-js/object-inspect/commit/b614eaac901da0e5c69151f534671f990a94cace) +- [Tests] fix coverage thresholds [`7b7b176`](https://github.com/inspect-js/object-inspect/commit/7b7b176e15f8bd6e8b2f261ff5a493c2fe78d9c2) +- [Tests] bigint tests now can run on unflagged node [`063af31`](https://github.com/inspect-js/object-inspect/commit/063af31ce9cd13c202e3b67c07ba06dc9b7c0f81) +- [Refactor] add early bailout to `isMap` and `isSet` checks [`fc51047`](https://github.com/inspect-js/object-inspect/commit/fc5104714a3671d37e225813db79470d6335683b) +- [meta] add `funding` field [`7f9953a`](https://github.com/inspect-js/object-inspect/commit/7f9953a113eec7b064a6393cf9f90ba15f1d131b) +- [Tests] Fix invalid strict-mode syntax with hexadecimal [`a8b5425`](https://github.com/inspect-js/object-inspect/commit/a8b542503b4af1599a275209a1a99f5fdedb1ead) +- [Dev Deps] update `@ljharb/eslint-config` [`98df157`](https://github.com/inspect-js/object-inspect/commit/98df1577314d9188a3fc3f17fdcf2fba697ae1bd) +- add copyright to LICENSE [`bb69fd0`](https://github.com/inspect-js/object-inspect/commit/bb69fd017a062d299e44da1f9b2c7dcd67f621e6) +- [Tests] use `npx aud` in `posttest` [`4838353`](https://github.com/inspect-js/object-inspect/commit/4838353593974cf7f905b9ef04c03c094f0cdbe2) +- [Tests] move `0.6` to allowed failures, because it won‘t build on travis [`1bff32a`](https://github.com/inspect-js/object-inspect/commit/1bff32aa52e8aea687f0856b28ba754b3e43ebf7) + +## [v1.6.0](https://github.com/inspect-js/object-inspect/compare/v1.5.0...v1.6.0) - 2018-05-02 + +### Commits + +- [New] add support for boxed BigInt primitives [`356c66a`](https://github.com/inspect-js/object-inspect/commit/356c66a410e7aece7162c8319880a5ef647beaa9) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`c77b65b`](https://github.com/inspect-js/object-inspect/commit/c77b65bba593811b906b9ec57561c5cba92e2db3) +- [New] Add support for upcoming `BigInt` [`1ac548e`](https://github.com/inspect-js/object-inspect/commit/1ac548e4b27e26466c28c9a5e63e5d4e0591c31f) +- [Tests] run bigint tests in CI with --harmony-bigint flag [`d31b738`](https://github.com/inspect-js/object-inspect/commit/d31b73831880254b5c6cf5691cda9a149fbc5f04) +- [Dev Deps] update `core-js`, `tape` [`ff9eff6`](https://github.com/inspect-js/object-inspect/commit/ff9eff67113341ee1aaf80c1c22d683f43bfbccf) +- [Docs] fix example to use `safer-buffer` [`48cae12`](https://github.com/inspect-js/object-inspect/commit/48cae12a73ec6cacc955175bc56bbe6aee6a211f) + +## [v1.5.0](https://github.com/inspect-js/object-inspect/compare/v1.4.1...v1.5.0) - 2017-12-25 + +### Commits + +- [New] add `quoteStyle` option [`f5a72d2`](https://github.com/inspect-js/object-inspect/commit/f5a72d26edb3959b048f74c056ca7100a6b091e4) +- [Tests] add more test coverage [`30ebe4e`](https://github.com/inspect-js/object-inspect/commit/30ebe4e1fa943b99ecbb85be7614256d536e2759) +- [Tests] require 0.6 to pass [`99a008c`](https://github.com/inspect-js/object-inspect/commit/99a008ccace189a60fd7da18bf00e32c9572b980) + +## [v1.4.1](https://github.com/inspect-js/object-inspect/compare/v1.4.0...v1.4.1) - 2017-12-19 + +### Commits + +- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12` [`6674476`](https://github.com/inspect-js/object-inspect/commit/6674476cc56acaac1bde96c84fed5ef631911906) +- [Fix] `inspect(Object(-0))` should be “Object(-0)”, not “Object(0)” [`d0a031f`](https://github.com/inspect-js/object-inspect/commit/d0a031f1cbb3024ee9982bfe364dd18a7e4d1bd3) + +## [v1.4.0](https://github.com/inspect-js/object-inspect/compare/v1.3.0...v1.4.0) - 2017-10-24 + +### Commits + +- [Tests] add `npm run coverage` [`3b48fb2`](https://github.com/inspect-js/object-inspect/commit/3b48fb25db037235eeb808f0b2830aad7aa36f70) +- [Tests] remove commented-out osx builds [`71e24db`](https://github.com/inspect-js/object-inspect/commit/71e24db8ad6ee3b9b381c5300b0475f2ba595a73) +- [New] add support for `util.inspect.custom`, in node only. [`20cca77`](https://github.com/inspect-js/object-inspect/commit/20cca7762d7e17f15b21a90793dff84acce155df) +- [Tests] up to `node` `v8.6`; use `nvm install-latest-npm` to ensure new npm doesn’t break old node [`252952d`](https://github.com/inspect-js/object-inspect/commit/252952d230d8065851dd3d4d5fe8398aae068529) +- [Tests] up to `node` `v8.8` [`4aa868d`](https://github.com/inspect-js/object-inspect/commit/4aa868d3a62914091d489dd6ec6eed194ee67cd3) +- [Dev Deps] update `core-js`, `tape` [`59483d1`](https://github.com/inspect-js/object-inspect/commit/59483d1df418f852f51fa0db7b24aa6b0209a27a) + +## [v1.3.0](https://github.com/inspect-js/object-inspect/compare/v1.2.2...v1.3.0) - 2017-07-31 + +### Fixed + +- [Fix] Map/Set: work around core-js bug < v2.5.0 [`#9`](https://github.com/inspect-js/object-inspect/issues/9) + +### Commits + +- [New] add support for arrays with additional object keys [`0d19937`](https://github.com/inspect-js/object-inspect/commit/0d199374ee37959e51539616666f420ccb29acb9) +- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; fix new npm breaking on older nodes [`e24784a`](https://github.com/inspect-js/object-inspect/commit/e24784a90c49117787157a12a63897c49cf89bbb) +- Only apps should have lockfiles [`c6faebc`](https://github.com/inspect-js/object-inspect/commit/c6faebcb2ee486a889a4a1c4d78c0776c7576185) +- [Dev Deps] update `tape` [`7345a0a`](https://github.com/inspect-js/object-inspect/commit/7345a0aeba7e91b888a079c10004d17696a7f586) + +## [v1.2.2](https://github.com/inspect-js/object-inspect/compare/v1.2.1...v1.2.2) - 2017-03-24 + +### Commits + +- [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; improve test matrix [`a2ddc15`](https://github.com/inspect-js/object-inspect/commit/a2ddc15a1f2c65af18076eea1c0eb9cbceb478a0) +- [Tests] up to `node` `v7.0`, `v6.9`, `v5.12`, `v4.6`, `io.js` `v3.3`; improve test matrix [`a48949f`](https://github.com/inspect-js/object-inspect/commit/a48949f6b574b2d4d2298109d8e8d0eb3e7a83e7) +- [Performance] check for primitive types as early as possible. [`3b8092a`](https://github.com/inspect-js/object-inspect/commit/3b8092a2a4deffd0575f94334f00194e2d48dad3) +- [Refactor] remove unneeded `else`s. [`7255034`](https://github.com/inspect-js/object-inspect/commit/725503402e08de4f96f6bf2d8edef44ac36f26b6) +- [Refactor] avoid recreating `lowbyte` function every time. [`81edd34`](https://github.com/inspect-js/object-inspect/commit/81edd3475bd15bdd18e84de7472033dcf5004aaa) +- [Fix] differentiate -0 from 0 [`521d345`](https://github.com/inspect-js/object-inspect/commit/521d3456b009da7bf1c5785c8a9df5a9f8718264) +- [Refactor] move object key gathering into separate function [`aca6265`](https://github.com/inspect-js/object-inspect/commit/aca626536eaeef697196c6e9db3e90e7e0355b6a) +- [Refactor] consolidate wrapping logic for boxed primitives into a function. [`4e440cd`](https://github.com/inspect-js/object-inspect/commit/4e440cd9065df04802a2a1dead03f48c353ca301) +- [Robustness] use `typeof` instead of comparing to literal `undefined` [`5ca6f60`](https://github.com/inspect-js/object-inspect/commit/5ca6f601937506daff8ed2fcf686363b55807b69) +- [Refactor] consolidate Map/Set notations. [`4e576e5`](https://github.com/inspect-js/object-inspect/commit/4e576e5d7ed2f9ec3fb7f37a0d16732eb10758a9) +- [Tests] ensure that this function remains anonymous, despite ES6 name inference. [`7540ae5`](https://github.com/inspect-js/object-inspect/commit/7540ae591278756db614fa4def55ca413150e1a3) +- [Refactor] explicitly coerce Error objects to strings. [`7f4ca84`](https://github.com/inspect-js/object-inspect/commit/7f4ca8424ee8dc2c0ca5a422d94f7fac40327261) +- [Refactor] split up `var` declarations for debuggability [`6f2c11e`](https://github.com/inspect-js/object-inspect/commit/6f2c11e6a85418586a00292dcec5e97683f89bc3) +- [Robustness] cache `Object.prototype.toString` [`df44a20`](https://github.com/inspect-js/object-inspect/commit/df44a20adfccf31529d60d1df2079bfc3c836e27) +- [Dev Deps] update `tape` [`3ec714e`](https://github.com/inspect-js/object-inspect/commit/3ec714eba57bc3f58a6eb4fca1376f49e70d300a) +- [Dev Deps] update `tape` [`beb72d9`](https://github.com/inspect-js/object-inspect/commit/beb72d969653747d7cde300393c28755375329b0) + +## [v1.2.1](https://github.com/inspect-js/object-inspect/compare/v1.2.0...v1.2.1) - 2016-04-09 + +### Fixed + +- [Fix] fix Boolean `false` object inspection. [`#7`](https://github.com/substack/object-inspect/pull/7) + +## [v1.2.0](https://github.com/inspect-js/object-inspect/compare/v1.1.0...v1.2.0) - 2016-04-09 + +### Fixed + +- [New] add support for inspecting String/Number/Boolean objects. [`#6`](https://github.com/inspect-js/object-inspect/issues/6) + +### Commits + +- [Dev Deps] update `tape` [`742caa2`](https://github.com/inspect-js/object-inspect/commit/742caa262cf7af4c815d4821c8bd0129c1446432) + +## [v1.1.0](https://github.com/inspect-js/object-inspect/compare/1.0.2...v1.1.0) - 2015-12-14 + +### Merged + +- [New] add ES6 Map/Set support. [`#4`](https://github.com/inspect-js/object-inspect/pull/4) + +### Fixed + +- [New] add ES6 Map/Set support. [`#3`](https://github.com/inspect-js/object-inspect/issues/3) + +### Commits + +- Update `travis.yml` to test on bunches of `iojs` and `node` versions. [`4c1fd65`](https://github.com/inspect-js/object-inspect/commit/4c1fd65cc3bd95307e854d114b90478324287fd2) +- [Dev Deps] update `tape` [`88a907e`](https://github.com/inspect-js/object-inspect/commit/88a907e33afbe408e4b5d6e4e42a33143f88848c) + +## [1.0.2](https://github.com/inspect-js/object-inspect/compare/1.0.1...1.0.2) - 2015-08-07 + +### Commits + +- [Fix] Cache `Object.prototype.hasOwnProperty` in case it's deleted later. [`1d0075d`](https://github.com/inspect-js/object-inspect/commit/1d0075d3091dc82246feeb1f9871cb2b8ed227b3) +- [Dev Deps] Update `tape` [`ca8d5d7`](https://github.com/inspect-js/object-inspect/commit/ca8d5d75635ddbf76f944e628267581e04958457) +- gitignore node_modules since this is a reusable modules. [`ed41407`](https://github.com/inspect-js/object-inspect/commit/ed41407811743ca530cdeb28f982beb96026af82) + +## [1.0.1](https://github.com/inspect-js/object-inspect/compare/1.0.0...1.0.1) - 2015-07-19 + +### Commits + +- Make `inspect` work with symbol primitives and objects, including in node 0.11 and 0.12. [`ddf1b94`](https://github.com/inspect-js/object-inspect/commit/ddf1b94475ab951f1e3bccdc0a48e9073cfbfef4) +- bump tape [`103d674`](https://github.com/inspect-js/object-inspect/commit/103d67496b504bdcfdd765d303a773f87ec106e2) +- use newer travis config [`d497276`](https://github.com/inspect-js/object-inspect/commit/d497276c1da14234bb5098a59cf20de75fbc316a) + +## [1.0.0](https://github.com/inspect-js/object-inspect/compare/0.4.0...1.0.0) - 2014-08-05 + +### Commits + +- error inspect works properly [`260a22d`](https://github.com/inspect-js/object-inspect/commit/260a22d134d3a8a482c67d52091c6040c34f4299) +- seen coverage [`57269e8`](https://github.com/inspect-js/object-inspect/commit/57269e8baa992a7439047f47325111fdcbcb8417) +- htmlelement instance coverage [`397ffe1`](https://github.com/inspect-js/object-inspect/commit/397ffe10a1980350868043ef9de65686d438979f) +- more element coverage [`6905cc2`](https://github.com/inspect-js/object-inspect/commit/6905cc2f7df35600177e613b0642b4df5efd3eca) +- failing test for type errors [`385b615`](https://github.com/inspect-js/object-inspect/commit/385b6152e49b51b68449a662f410b084ed7c601a) +- fn name coverage [`edc906d`](https://github.com/inspect-js/object-inspect/commit/edc906d40fca6b9194d304062c037ee8e398c4c2) +- server-side element test [`362d1d3`](https://github.com/inspect-js/object-inspect/commit/362d1d3e86f187651c29feeb8478110afada385b) +- custom inspect fn [`e89b0f6`](https://github.com/inspect-js/object-inspect/commit/e89b0f6fe6d5e03681282af83732a509160435a6) +- fixed browser test [`b530882`](https://github.com/inspect-js/object-inspect/commit/b5308824a1c8471c5617e394766a03a6977102a9) +- depth test, matches node [`1cfd9e0`](https://github.com/inspect-js/object-inspect/commit/1cfd9e0285a4ae1dff44101ad482915d9bf47e48) +- exercise hasOwnProperty path [`8d753fb`](https://github.com/inspect-js/object-inspect/commit/8d753fb362a534fa1106e4d80f2ee9bea06a66d9) +- more cases covered for errors [`c5c46a5`](https://github.com/inspect-js/object-inspect/commit/c5c46a569ec4606583497e8550f0d8c7ad39a4a4) +- \W obj key test case [`b0eceee`](https://github.com/inspect-js/object-inspect/commit/b0eceeea6e0eb94d686c1046e99b9e25e5005f75) +- coverage for explicit depth param [`e12b91c`](https://github.com/inspect-js/object-inspect/commit/e12b91cd59683362f3a0e80f46481a0211e26c15) + +## [0.4.0](https://github.com/inspect-js/object-inspect/compare/0.3.1...0.4.0) - 2014-03-21 + +### Commits + +- passing lowbyte interpolation test [`b847511`](https://github.com/inspect-js/object-inspect/commit/b8475114f5def7e7961c5353d48d3d8d9a520985) +- lowbyte test [`4a2b0e1`](https://github.com/inspect-js/object-inspect/commit/4a2b0e142667fc933f195472759385ac08f3946c) + +## [0.3.1](https://github.com/inspect-js/object-inspect/compare/0.3.0...0.3.1) - 2014-03-04 + +### Commits + +- sort keys [`a07b19c`](https://github.com/inspect-js/object-inspect/commit/a07b19cc3b1521a82d4fafb6368b7a9775428a05) + +## [0.3.0](https://github.com/inspect-js/object-inspect/compare/0.2.0...0.3.0) - 2014-03-04 + +### Commits + +- [] and {} instead of [ ] and { } [`654c44b`](https://github.com/inspect-js/object-inspect/commit/654c44b2865811f3519e57bb8526e0821caf5c6b) + +## [0.2.0](https://github.com/inspect-js/object-inspect/compare/0.1.3...0.2.0) - 2014-03-04 + +### Commits + +- failing holes test [`99cdfad`](https://github.com/inspect-js/object-inspect/commit/99cdfad03c6474740275a75636fe6ca86c77737a) +- regex already work [`e324033`](https://github.com/inspect-js/object-inspect/commit/e324033267025995ec97d32ed0a65737c99477a6) +- failing undef/null test [`1f88a00`](https://github.com/inspect-js/object-inspect/commit/1f88a00265d3209719dda8117b7e6360b4c20943) +- holes in the all example [`7d345f3`](https://github.com/inspect-js/object-inspect/commit/7d345f3676dcbe980cff89a4f6c243269ebbb709) +- check for .inspect(), fixes Buffer use-case [`c3f7546`](https://github.com/inspect-js/object-inspect/commit/c3f75466dbca125347d49847c05262c292f12b79) +- fixes for holes [`ce25f73`](https://github.com/inspect-js/object-inspect/commit/ce25f736683de4b92ff27dc5471218415e2d78d8) +- weird null behavior [`405c1ea`](https://github.com/inspect-js/object-inspect/commit/405c1ea72cd5a8cf3b498c3eaa903d01b9fbcab5) +- tape is actually a devDependency, upgrade [`703b0ce`](https://github.com/inspect-js/object-inspect/commit/703b0ce6c5817b4245a082564bccd877e0bb6990) +- put date in the example [`a342219`](https://github.com/inspect-js/object-inspect/commit/a3422190eeaa013215f46df2d0d37b48595ac058) +- passing the null test [`4ab737e`](https://github.com/inspect-js/object-inspect/commit/4ab737ebf862a75d247ebe51e79307a34d6380d4) + +## [0.1.3](https://github.com/inspect-js/object-inspect/compare/0.1.1...0.1.3) - 2013-07-26 + +### Commits + +- special isElement() check [`882768a`](https://github.com/inspect-js/object-inspect/commit/882768a54035d30747be9de1baf14e5aa0daa128) +- oh right old IEs don't have indexOf either [`36d1275`](https://github.com/inspect-js/object-inspect/commit/36d12756c38b08a74370b0bb696c809e529913a5) + +## [0.1.1](https://github.com/inspect-js/object-inspect/compare/0.1.0...0.1.1) - 2013-07-26 + +### Commits + +- tests! [`4422fd9`](https://github.com/inspect-js/object-inspect/commit/4422fd95532c2745aa6c4f786f35f1090be29998) +- fix for ie<9, doesn't have hasOwnProperty [`6b7d611`](https://github.com/inspect-js/object-inspect/commit/6b7d61183050f6da801ea04473211da226482613) +- fix for all IEs: no f.name [`4e0c2f6`](https://github.com/inspect-js/object-inspect/commit/4e0c2f6dfd01c306d067d7163319acc97c94ee50) +- badges [`5ed0d88`](https://github.com/inspect-js/object-inspect/commit/5ed0d88e4e407f9cb327fa4a146c17921f9680f3) + +## [0.1.0](https://github.com/inspect-js/object-inspect/compare/0.0.0...0.1.0) - 2013-07-26 + +### Commits + +- [Function] for functions [`ad5c485`](https://github.com/inspect-js/object-inspect/commit/ad5c485098fc83352cb540a60b2548ca56820e0b) + +## 0.0.0 - 2013-07-26 + +### Commits + +- working browser example [`34be6b6`](https://github.com/inspect-js/object-inspect/commit/34be6b6548f9ce92bdc3c27572857ba0c4a1218d) +- package.json etc [`cad51f2`](https://github.com/inspect-js/object-inspect/commit/cad51f23fc6bcf1a456ed6abe16088256c2f632f) +- docs complete [`b80cce2`](https://github.com/inspect-js/object-inspect/commit/b80cce2490c4e7183a9ee11ea89071f0abec4446) +- circular example [`4b4a7b9`](https://github.com/inspect-js/object-inspect/commit/4b4a7b92209e4e6b4630976cb6bcd17d14165a59) +- string rep [`7afb479`](https://github.com/inspect-js/object-inspect/commit/7afb479baa798d27f09e0a178b72ea327f60f5c8) diff --git a/node_modules/object-inspect/LICENSE b/node_modules/object-inspect/LICENSE new file mode 100644 index 0000000..ca64cc1 --- /dev/null +++ b/node_modules/object-inspect/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/object-inspect/example/all.js b/node_modules/object-inspect/example/all.js new file mode 100644 index 0000000..2f3355c --- /dev/null +++ b/node_modules/object-inspect/example/all.js @@ -0,0 +1,23 @@ +'use strict'; + +var inspect = require('../'); +var Buffer = require('safer-buffer').Buffer; + +var holes = ['a', 'b']; +holes[4] = 'e'; +holes[6] = 'g'; + +var obj = { + a: 1, + b: [3, 4, undefined, null], + c: undefined, + d: null, + e: { + regex: /^x/i, + buf: Buffer.from('abc'), + holes: holes + }, + now: new Date() +}; +obj.self = obj; +console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/circular.js b/node_modules/object-inspect/example/circular.js new file mode 100644 index 0000000..487a7c1 --- /dev/null +++ b/node_modules/object-inspect/example/circular.js @@ -0,0 +1,6 @@ +'use strict'; + +var inspect = require('../'); +var obj = { a: 1, b: [3, 4] }; +obj.c = obj; +console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/fn.js b/node_modules/object-inspect/example/fn.js new file mode 100644 index 0000000..9b5db8d --- /dev/null +++ b/node_modules/object-inspect/example/fn.js @@ -0,0 +1,5 @@ +'use strict'; + +var inspect = require('../'); +var obj = [1, 2, function f(n) { return n + 5; }, 4]; +console.log(inspect(obj)); diff --git a/node_modules/object-inspect/example/inspect.js b/node_modules/object-inspect/example/inspect.js new file mode 100644 index 0000000..e2df7c9 --- /dev/null +++ b/node_modules/object-inspect/example/inspect.js @@ -0,0 +1,10 @@ +'use strict'; + +/* eslint-env browser */ +var inspect = require('../'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }])); diff --git a/node_modules/object-inspect/index.js b/node_modules/object-inspect/index.js new file mode 100644 index 0000000..a4b2d4c --- /dev/null +++ b/node_modules/object-inspect/index.js @@ -0,0 +1,544 @@ +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; +var gOPS = Object.getOwnPropertySymbols; +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +// ie, `has-tostringtag/shams +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') + ? Symbol.toStringTag + : null; +var isEnumerable = Object.prototype.propertyIsEnumerable; + +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( + [].__proto__ === Array.prototype // eslint-disable-line no-proto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); + +function addNumericSeparator(num, str) { + if ( + num === Infinity + || num === -Infinity + || num !== num + || (num && num > -1000 && num < 1000) + || $test.call(/e/, str) + ) { + return str; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + return $replace.call(str, sepRegex, '$&_'); +} + +var utilInspect = require('./util.inspect'); +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + +var quotes = { + __proto__: null, + 'double': '"', + single: "'" +}; +var quoteREs = { + __proto__: null, + 'double': /(["\\])/g, + single: /(['\\])/g +}; + +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if ( + has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' + ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity + : opts.maxStringLength !== null + ) + ) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); + } + + if ( + has(opts, 'indent') + && opts.indent !== null + && opts.indent !== '\t' + && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) + ) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; + } + if (typeof obj === 'bigint') { + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } + + var indent = getIndent(opts, depth); + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += ''; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + var xs = arrObjKeys(obj, inspect); + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + return '[ ' + $join.call(xs, ', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; + } + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + } + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + } + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isWeakRef(obj)) { + return weakCollectionOf('WeakRef'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other + /* eslint-env browser */ + if (typeof window !== 'undefined' && obj === window) { + return '{ [object Window] }'; + } + if ( + (typeof globalThis !== 'undefined' && obj === globalThis) + || (typeof global !== 'undefined' && obj === global) + ) { + return '{ [object globalThis] }'; + } + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? '' : 'null prototype'; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); + if (ys.length === 0) { return tag + '{}'; } + if (indent) { + return tag + '{' + indentedJoin(ys, indent) + '}'; + } + return tag + '{ ' + $join.call(ys, ', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes(s, defaultStyle, opts) { + var style = opts.quoteStyle || defaultStyle; + var quoteChar = quotes[style]; + return quoteChar + s + quoteChar; +} + +function quote(s) { + return $replace.call(String(s), /"/g, '"'); +} + +function canTrustToString(obj) { + return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); +} +function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } +function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } +function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } +function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } +function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } + +// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives +function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === 'object' && obj instanceof Symbol; + } + if (typeof obj === 'symbol') { + return true; + } + if (!obj || typeof obj !== 'object' || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e) {} + return false; +} + +function isBigInt(obj) { + if (!obj || typeof obj !== 'object' || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e) {} + return false; +} + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has(obj, key) { + return hasOwn.call(obj, key); +} + +function toStr(obj) { + return objectToString.call(obj); +} + +function nameOf(f) { + if (f.name) { return f.name; } + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; +} + +function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; +} + +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakRef(x) { + if (!weakRefDeref || !x || typeof x !== 'object') { + return false; + } + try { + weakRefDeref.call(x); + return true; + } catch (e) {} + return false; +} + +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} + +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; + } + var quoteRE = quoteREs[opts.quoteStyle || 'single']; + quoteRE.lastIndex = 0; + // eslint-disable-next-line no-control-regex + var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', + 9: 't', + 10: 'n', + 12: 'f', + 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); +} + +function markBoxed(str) { + return 'Object(' + str + ')'; +} + +function weakCollectionOf(type) { + return type + ' { ? }'; +} + +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} + +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + return true; +} + +function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), ' '); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; +} + +function indentedJoin(xs, indent) { + if (xs.length === 0) { return ''; } + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; +} + +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + var syms = typeof gOPS === 'function' ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k = 0; k < syms.length; k++) { + symMap['$' + syms[k]] = syms[k]; + } + } + + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { + // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section + continue; // eslint-disable-line no-restricted-syntax, no-continue + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + if (typeof gOPS === 'function') { + for (var j = 0; j < syms.length; j++) { + if (isEnumerable.call(obj, syms[j])) { + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); + } + } + } + return xs; +} diff --git a/node_modules/object-inspect/package-support.json b/node_modules/object-inspect/package-support.json new file mode 100644 index 0000000..5cc12d0 --- /dev/null +++ b/node_modules/object-inspect/package-support.json @@ -0,0 +1,20 @@ +{ + "versions": [ + { + "version": "*", + "target": { + "node": "all" + }, + "response": { + "type": "time-permitting" + }, + "backing": { + "npm-funding": true, + "donations": [ + "https://github.com/ljharb", + "https://tidelift.com/funding/github/npm/object-inspect" + ] + } + } + ] +} diff --git a/node_modules/object-inspect/package.json b/node_modules/object-inspect/package.json new file mode 100644 index 0000000..9fd97ff --- /dev/null +++ b/node_modules/object-inspect/package.json @@ -0,0 +1,105 @@ +{ + "name": "object-inspect", + "version": "1.13.4", + "description": "string representations of objects in node and the browser", + "main": "index.js", + "sideEffects": false, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.1", + "@pkgjs/support": "^0.0.6", + "auto-changelog": "^2.5.0", + "core-js": "^2.6.12", + "error-cause": "^1.0.8", + "es-value-fixtures": "^1.7.1", + "eslint": "=8.8.0", + "for-each": "^0.3.4", + "functions-have-names": "^1.2.3", + "glob": "=10.3.7", + "globalthis": "^1.0.4", + "has-symbols": "^1.1.0", + "has-tostringtag": "^1.0.2", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "make-arrow-function": "^1.2.0", + "mock-property": "^1.1.0", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "semver": "^6.3.1", + "string.prototype.repeat": "^1.0.0", + "tape": "^5.9.0" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "pretest": "npm run lint", + "lint": "eslint --ext=js,mjs .", + "postlint": "npx @pkgjs/support validate", + "test": "npm run tests-only && npm run test:corejs", + "tests-only": "nyc tape 'test/*.js'", + "test:corejs": "nyc tape test-core-js.js 'test/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "testling": { + "files": [ + "test/*.js", + "test/browser/*.js" + ], + "browsers": [ + "ie/6..latest", + "chrome/latest", + "firefox/latest", + "safari/latest", + "opera/latest", + "iphone/latest", + "ipad/latest", + "android/latest" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/object-inspect.git" + }, + "homepage": "https://github.com/inspect-js/object-inspect", + "keywords": [ + "inspect", + "util.inspect", + "object", + "stringify", + "pretty" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "browser": { + "./util.inspect.js": false + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "./test-core-js.js" + ] + }, + "support": true, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/object-inspect/readme.markdown b/node_modules/object-inspect/readme.markdown new file mode 100644 index 0000000..f91617d --- /dev/null +++ b/node_modules/object-inspect/readme.markdown @@ -0,0 +1,84 @@ +# object-inspect [![Version Badge][npm-version-svg]][package-url] + +string representations of objects in node and the browser + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +# example + +## circular + +``` js +var inspect = require('object-inspect'); +var obj = { a: 1, b: [3,4] }; +obj.c = obj; +console.log(inspect(obj)); +``` + +## dom element + +``` js +var inspect = require('object-inspect'); + +var d = document.createElement('div'); +d.setAttribute('id', 'beep'); +d.innerHTML = 'woooiiiii'; + +console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ])); +``` + +output: + +``` +[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ] +``` + +# methods + +``` js +var inspect = require('object-inspect') +``` + +## var s = inspect(obj, opts={}) + +Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`. + +Additional options: + - `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements. + - `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`. + - `customInspect`: When `true`, a custom inspect method function will be invoked (either undere the `util.inspect.custom` symbol, or the `inspect` property). When the string `'symbol'`, only the symbol method will be invoked. Default `true`. + - `indent`: must be "\t", `null`, or a positive integer. Default `null`. + - `numericSeparator`: must be a boolean, if present. Default `false`. If `true`, all numbers will be printed with numeric separators (eg, `1234.5678` will be printed as `'1_234.567_8'`) + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install object-inspect +``` + +# license + +MIT + +[package-url]: https://npmjs.org/package/object-inspect +[npm-version-svg]: https://versionbadg.es/inspect-js/object-inspect.svg +[deps-svg]: https://david-dm.org/inspect-js/object-inspect.svg +[deps-url]: https://david-dm.org/inspect-js/object-inspect +[dev-deps-svg]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/object-inspect.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg +[downloads-url]: https://npm-stat.com/charts.html?package=object-inspect +[codecov-image]: https://codecov.io/gh/inspect-js/object-inspect/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/object-inspect/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/object-inspect +[actions-url]: https://github.com/inspect-js/object-inspect/actions diff --git a/node_modules/object-inspect/test-core-js.js b/node_modules/object-inspect/test-core-js.js new file mode 100644 index 0000000..e53c400 --- /dev/null +++ b/node_modules/object-inspect/test-core-js.js @@ -0,0 +1,26 @@ +'use strict'; + +require('core-js'); + +var inspect = require('./'); +var test = require('tape'); + +test('Maps', function (t) { + t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}'); + t.end(); +}); + +test('WeakMaps', function (t) { + t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }'); + t.end(); +}); + +test('Sets', function (t) { + t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}'); + t.end(); +}); + +test('WeakSets', function (t) { + t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }'); + t.end(); +}); diff --git a/node_modules/object-inspect/test/bigint.js b/node_modules/object-inspect/test/bigint.js new file mode 100644 index 0000000..4ecc31d --- /dev/null +++ b/node_modules/object-inspect/test/bigint.js @@ -0,0 +1,58 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); + +test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) { + t.test('primitives', function (st) { + st.plan(3); + + st.equal(inspect(BigInt(-256)), '-256n'); + st.equal(inspect(BigInt(0)), '0n'); + st.equal(inspect(BigInt(256)), '256n'); + }); + + t.test('objects', function (st) { + st.plan(3); + + st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)'); + st.equal(inspect(Object(BigInt(0))), 'Object(0n)'); + st.equal(inspect(Object(BigInt(256))), 'Object(256n)'); + }); + + t.test('syntactic primitives', function (st) { + st.plan(3); + + /* eslint-disable no-new-func */ + st.equal(inspect(Function('return -256n')()), '-256n'); + st.equal(inspect(Function('return 0n')()), '0n'); + st.equal(inspect(Function('return 256n')()), '256n'); + }); + + t.test('toStringTag', { skip: !hasToStringTag }, function (st) { + st.plan(1); + + var faker = {}; + faker[Symbol.toStringTag] = 'BigInt'; + st.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'BigInt\' }', + 'object lying about being a BigInt inspects as an object' + ); + }); + + t.test('numericSeparator', function (st) { + st.equal(inspect(BigInt(0), { numericSeparator: false }), '0n', '0n, numericSeparator false'); + st.equal(inspect(BigInt(0), { numericSeparator: true }), '0n', '0n, numericSeparator true'); + + st.equal(inspect(BigInt(1234), { numericSeparator: false }), '1234n', '1234n, numericSeparator false'); + st.equal(inspect(BigInt(1234), { numericSeparator: true }), '1_234n', '1234n, numericSeparator true'); + st.equal(inspect(BigInt(-1234), { numericSeparator: false }), '-1234n', '1234n, numericSeparator false'); + st.equal(inspect(BigInt(-1234), { numericSeparator: true }), '-1_234n', '1234n, numericSeparator true'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/browser/dom.js b/node_modules/object-inspect/test/browser/dom.js new file mode 100644 index 0000000..210c0b2 --- /dev/null +++ b/node_modules/object-inspect/test/browser/dom.js @@ -0,0 +1,15 @@ +var inspect = require('../../'); +var test = require('tape'); + +test('dom element', function (t) { + t.plan(1); + + var d = document.createElement('div'); + d.setAttribute('id', 'beep'); + d.innerHTML = 'woooiiiii'; + + t.equal( + inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]), + '[
...
, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]' + ); +}); diff --git a/node_modules/object-inspect/test/circular.js b/node_modules/object-inspect/test/circular.js new file mode 100644 index 0000000..5df4233 --- /dev/null +++ b/node_modules/object-inspect/test/circular.js @@ -0,0 +1,16 @@ +var inspect = require('../'); +var test = require('tape'); + +test('circular', function (t) { + t.plan(2); + var obj = { a: 1, b: [3, 4] }; + obj.c = obj; + t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }'); + + var double = {}; + double.a = [double]; + double.b = {}; + double.b.inner = double.b; + double.b.obj = double; + t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }'); +}); diff --git a/node_modules/object-inspect/test/deep.js b/node_modules/object-inspect/test/deep.js new file mode 100644 index 0000000..99ce32a --- /dev/null +++ b/node_modules/object-inspect/test/deep.js @@ -0,0 +1,12 @@ +var inspect = require('../'); +var test = require('tape'); + +test('deep', function (t) { + t.plan(4); + var obj = [[[[[[500]]]]]]; + t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]'); + t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]'); + t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]'); + + t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]'); +}); diff --git a/node_modules/object-inspect/test/element.js b/node_modules/object-inspect/test/element.js new file mode 100644 index 0000000..47fa9e2 --- /dev/null +++ b/node_modules/object-inspect/test/element.js @@ -0,0 +1,53 @@ +var inspect = require('../'); +var test = require('tape'); + +test('element', function (t) { + t.plan(3); + var elem = { + nodeName: 'div', + attributes: [{ name: 'class', value: 'row' }], + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1,
, 3 ]"); + t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1,
, 3 ]'); +}); + +test('element no attr', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); +}); + +test('element with contents', function (t) { + t.plan(1); + var elem = { + nodeName: 'div', + getAttribute: function (key) { return key; }, + childNodes: [{ nodeName: 'b' }] + }; + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
...
, 3 ]'); +}); + +test('element instance', function (t) { + t.plan(1); + var h = global.HTMLElement; + global.HTMLElement = function (name, attr) { + this.nodeName = name; + this.attributes = attr; + }; + global.HTMLElement.prototype.getAttribute = function () {}; + + var elem = new global.HTMLElement('div', []); + var obj = [1, elem, 3]; + t.deepEqual(inspect(obj), '[ 1,
, 3 ]'); + global.HTMLElement = h; +}); diff --git a/node_modules/object-inspect/test/err.js b/node_modules/object-inspect/test/err.js new file mode 100644 index 0000000..cc1d884 --- /dev/null +++ b/node_modules/object-inspect/test/err.js @@ -0,0 +1,48 @@ +var test = require('tape'); +var ErrorWithCause = require('error-cause/Error'); + +var inspect = require('../'); + +test('type error', function (t) { + t.plan(1); + var aerr = new TypeError(); + aerr.foo = 555; + aerr.bar = [1, 2, 3]; + + var berr = new TypeError('tuv'); + berr.baz = 555; + + var cerr = new SyntaxError(); + cerr.message = 'whoa'; + cerr['a-b'] = 5; + + var withCause = new ErrorWithCause('foo', { cause: 'bar' }); + var withCausePlus = new ErrorWithCause('foo', { cause: 'bar' }); + withCausePlus.foo = 'bar'; + var withUndefinedCause = new ErrorWithCause('foo', { cause: undefined }); + var withEnumerableCause = new Error('foo'); + withEnumerableCause.cause = 'bar'; + + var obj = [ + new TypeError(), + new TypeError('xxx'), + aerr, + berr, + cerr, + withCause, + withCausePlus, + withUndefinedCause, + withEnumerableCause + ]; + t.equal(inspect(obj), '[ ' + [ + '[TypeError]', + '[TypeError: xxx]', + '{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }', + '{ [TypeError: tuv] baz: 555 }', + '{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }', + 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: \'bar\' }', + '{ [Error: foo] ' + ('cause' in Error.prototype ? '' : '[cause]: \'bar\', ') + 'foo: \'bar\' }', + 'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: undefined }', + '{ [Error: foo] cause: \'bar\' }' + ].join(', ') + ' ]'); +}); diff --git a/node_modules/object-inspect/test/fakes.js b/node_modules/object-inspect/test/fakes.js new file mode 100644 index 0000000..a65c08c --- /dev/null +++ b/node_modules/object-inspect/test/fakes.js @@ -0,0 +1,29 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); + +test('fakes', { skip: !hasToStringTag }, function (t) { + forEach([ + 'Array', + 'Boolean', + 'Date', + 'Error', + 'Number', + 'RegExp', + 'String' + ], function (expected) { + var faker = {}; + faker[Symbol.toStringTag] = expected; + + t.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }', + 'faker masquerading as ' + expected + ' is not shown as one' + ); + }); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/fn.js b/node_modules/object-inspect/test/fn.js new file mode 100644 index 0000000..de3ca62 --- /dev/null +++ b/node_modules/object-inspect/test/fn.js @@ -0,0 +1,76 @@ +var inspect = require('../'); +var test = require('tape'); +var arrow = require('make-arrow-function')(); +var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); + +test('function', function (t) { + t.plan(1); + var obj = [1, 2, function f(n) { return n; }, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); +}); + +test('function name', function (t) { + t.plan(1); + var f = (function () { + return function () {}; + }()); + f.toString = function toStr() { return 'function xxx () {}'; }; + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]'); +}); + +test('anon function', function (t) { + var f = (function () { + return function () {}; + }()); + var obj = [1, 2, f, 4]; + t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]'); + + t.end(); +}); + +test('arrow function', { skip: !arrow }, function (t) { + t.equal(inspect(arrow), '[Function (anonymous)]'); + + t.end(); +}); + +test('truly nameless function', { skip: !arrow || !functionsHaveConfigurableNames }, function (t) { + function f() {} + Object.defineProperty(f, 'name', { value: false }); + t.equal(f.name, false); + t.equal( + inspect(f), + '[Function: f]', + 'named function with falsy `.name` does not hide its original name' + ); + + function g() {} + Object.defineProperty(g, 'name', { value: true }); + t.equal(g.name, true); + t.equal( + inspect(g), + '[Function: true]', + 'named function with truthy `.name` hides its original name' + ); + + var anon = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon, 'name', { value: null }); + t.equal(anon.name, null); + t.equal( + inspect(anon), + '[Function (anonymous)]', + 'anon function with falsy `.name` does not hide its anonymity' + ); + + var anon2 = function () {}; // eslint-disable-line func-style + Object.defineProperty(anon2, 'name', { value: 1 }); + t.equal(anon2.name, 1); + t.equal( + inspect(anon2), + '[Function: 1]', + 'anon function with truthy `.name` hides its anonymity' + ); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/global.js b/node_modules/object-inspect/test/global.js new file mode 100644 index 0000000..c57216a --- /dev/null +++ b/node_modules/object-inspect/test/global.js @@ -0,0 +1,17 @@ +'use strict'; + +var inspect = require('../'); + +var test = require('tape'); +var globalThis = require('globalthis')(); + +test('global object', function (t) { + /* eslint-env browser */ + var expected = typeof window === 'undefined' ? 'globalThis' : 'Window'; + t.equal( + inspect([globalThis]), + '[ { [object ' + expected + '] } ]' + ); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/has.js b/node_modules/object-inspect/test/has.js new file mode 100644 index 0000000..01800de --- /dev/null +++ b/node_modules/object-inspect/test/has.js @@ -0,0 +1,15 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var mockProperty = require('mock-property'); + +test('when Object#hasOwnProperty is deleted', function (t) { + t.plan(1); + var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays + + t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty" + t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); + + t.equal(inspect(arr), '[ 1, , 3 ]'); +}); diff --git a/node_modules/object-inspect/test/holes.js b/node_modules/object-inspect/test/holes.js new file mode 100644 index 0000000..87fc8c8 --- /dev/null +++ b/node_modules/object-inspect/test/holes.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var inspect = require('../'); + +var xs = ['a', 'b']; +xs[5] = 'f'; +xs[7] = 'j'; +xs[8] = 'k'; + +test('holes', function (t) { + t.plan(1); + t.equal( + inspect(xs), + "[ 'a', 'b', , , , 'f', , 'j', 'k' ]" + ); +}); diff --git a/node_modules/object-inspect/test/indent-option.js b/node_modules/object-inspect/test/indent-option.js new file mode 100644 index 0000000..89d8fce --- /dev/null +++ b/node_modules/object-inspect/test/indent-option.js @@ -0,0 +1,271 @@ +var test = require('tape'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('bad indent options', function (t) { + forEach([ + undefined, + true, + false, + -1, + 1.2, + Infinity, + -Infinity, + NaN + ], function (indent) { + t['throws']( + function () { inspect('', { indent: indent }); }, + TypeError, + inspect(indent) + ' is invalid' + ); + }); + + t.end(); +}); + +test('simple object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: 2 }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: 2', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('two deep object with indent', function (t) { + t.plan(2); + + var obj = { a: 1, b: { c: 3, d: 4 } }; + + var expectedSpaces = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + var expectedTabs = [ + '{', + ' a: 1,', + ' b: {', + ' c: 3,', + ' d: 4', + ' }', + '}' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('simple array with all single line elements', function (t) { + t.plan(2); + + var obj = [1, 2, 3, 'asdf\nsdf']; + + var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]'; + + t.equal(inspect(obj, { indent: 2 }), expected, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs'); +}); + +test('array with complex elements', function (t) { + t.plan(2); + + var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf']; + + var expectedSpaces = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' 1,', + ' {', + ' a: 1,', + ' b: {', + ' c: 1', + ' }', + ' },', + ' \'asdf\\nsdf\'', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('values', function (t) { + t.plan(2); + var obj = [{}, [], { 'a-b': 5 }]; + + var expectedSpaces = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + var expectedTabs = [ + '[', + ' {},', + ' [],', + ' {', + ' \'a-b\': 5', + ' }', + ']' + ].join('\n'); + + t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two'); + t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs'); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + + var expectedStringSpaces = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + '}' + ].join('\n'); + var expectedStringTabsDoubleQuotes = [ + 'Map (2) {', + ' { a: 1 } => [ "b" ],', + ' 3 => NaN', + '}' + ].join('\n'); + + t.equal( + inspect(map, { indent: 2 }), + expectedStringSpaces, + 'Map keys are not indented (two)' + ); + t.equal( + inspect(map, { indent: '\t' }), + expectedStringTabs, + 'Map keys are not indented (tabs)' + ); + t.equal( + inspect(map, { indent: '\t', quoteStyle: 'double' }), + expectedStringTabsDoubleQuotes, + 'Map keys are not indented (tabs + double quotes)' + ); + + t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)'); + t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + var expectedNestedSpaces = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Map (1) {', + ' [Circular] => Map (2) {', + ' { a: 1 } => [ \'b\' ],', + ' 3 => NaN', + ' }', + '}' + ].join('\n'); + t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)'); + t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedStringSpaces = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + var expectedStringTabs = [ + 'Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + '}' + ].join('\n'); + t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)'); + t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)'); + + t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)'); + t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + var expectedNestedSpaces = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + var expectedNestedTabs = [ + 'Set (2) {', + ' Set (2) {', + ' {', + ' a: 1', + ' },', + ' [ \'b\' ]', + ' },', + ' [Circular]', + '}' + ].join('\n'); + t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)'); + t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)'); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/inspect.js b/node_modules/object-inspect/test/inspect.js new file mode 100644 index 0000000..1abf81b --- /dev/null +++ b/node_modules/object-inspect/test/inspect.js @@ -0,0 +1,139 @@ +var test = require('tape'); +var hasSymbols = require('has-symbols/shams')(); +var utilInspect = require('../util.inspect'); +var repeat = require('string.prototype.repeat'); + +var inspect = require('..'); + +test('inspect', function (t) { + t.plan(5); + + var obj = [{ inspect: function xyzInspect() { return '!XYZ¡'; } }, []]; + var stringResult = '[ !XYZ¡, [] ]'; + var falseResult = '[ { inspect: [Function: xyzInspect] }, [] ]'; + + t.equal(inspect(obj), stringResult); + t.equal(inspect(obj, { customInspect: true }), stringResult); + t.equal(inspect(obj, { customInspect: 'symbol' }), falseResult); + t.equal(inspect(obj, { customInspect: false }), falseResult); + t['throws']( + function () { inspect(obj, { customInspect: 'not a boolean or "symbol"' }); }, + TypeError, + '`customInspect` must be a boolean or the string "symbol"' + ); +}); + +test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspect.custom }, function (t) { + t.plan(4); + + var obj = { inspect: function stringInspect() { return 'string'; } }; + obj[utilInspect.custom] = function custom() { return 'symbol'; }; + + var symbolResult = '[ symbol, [] ]'; + var stringResult = '[ string, [] ]'; + var falseResult = '[ { inspect: [Function: stringInspect]' + (utilInspect.custom ? ', [' + inspect(utilInspect.custom) + ']: [Function: custom]' : '') + ' }, [] ]'; + + var symbolStringFallback = utilInspect.custom ? symbolResult : stringResult; + var symbolFalseFallback = utilInspect.custom ? symbolResult : falseResult; + + t.equal(inspect([obj, []]), symbolStringFallback); + t.equal(inspect([obj, []], { customInspect: true }), symbolStringFallback); + t.equal(inspect([obj, []], { customInspect: 'symbol' }), symbolFalseFallback); + t.equal(inspect([obj, []], { customInspect: false }), falseResult); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + t.plan(2); + + var obj = { a: 1 }; + obj[Symbol('test')] = 2; + obj[Symbol.iterator] = 3; + Object.defineProperty(obj, Symbol('non-enum'), { + enumerable: false, + value: 4 + }); + + if (typeof Symbol.iterator === 'symbol') { + t.equal(inspect(obj), '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }', 'object with symbols'); + t.equal(inspect([obj, []]), '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]', 'object with symbols in array'); + } else { + // symbol sham key ordering is unreliable + t.match( + inspect(obj), + /^(?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 })$/, + 'object with symbols (nondeterministic symbol sham key ordering)' + ); + t.match( + inspect([obj, []]), + /^\[ (?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 }), \[\] \]$/, + 'object with symbols in array (nondeterministic symbol sham key ordering)' + ); + } +}); + +test('maxStringLength', function (t) { + t['throws']( + function () { inspect('', { maxStringLength: -1 }); }, + TypeError, + 'maxStringLength must be >= 0, or Infinity, not negative' + ); + + var str = repeat('a', 1e8); + + t.equal( + inspect([str], { maxStringLength: 10 }), + '[ \'aaaaaaaaaa\'... 99999990 more characters ]', + 'maxStringLength option limits output' + ); + + t.equal( + inspect(['f'], { maxStringLength: null }), + '[ \'\'... 1 more character ]', + 'maxStringLength option accepts `null`' + ); + + t.equal( + inspect([str], { maxStringLength: Infinity }), + '[ \'' + str + '\' ]', + 'maxStringLength option accepts ∞' + ); + + t.end(); +}); + +test('inspect options', { skip: !utilInspect.custom }, function (t) { + var obj = {}; + obj[utilInspect.custom] = function () { + return JSON.stringify(arguments); + }; + t.equal( + inspect(obj), + utilInspect(obj, { depth: 5 }), + 'custom symbols will use node\'s inspect' + ); + t.equal( + inspect(obj, { depth: 2 }), + utilInspect(obj, { depth: 2 }), + 'a reduced depth will be passed to node\'s inspect' + ); + t.equal( + inspect({ d1: obj }, { depth: 3 }), + '{ d1: ' + utilInspect(obj, { depth: 2 }) + ' }', + 'deep objects will receive a reduced depth' + ); + t.equal( + inspect({ d1: obj }, { depth: 1 }), + '{ d1: [Object] }', + 'unlike nodejs inspect, customInspect will not be used once the depth is exceeded.' + ); + t.end(); +}); + +test('inspect URL', { skip: typeof URL === 'undefined' }, function (t) { + t.match( + inspect(new URL('https://nodejs.org')), + /nodejs\.org/, // Different environments stringify it differently + 'url can be inspected' + ); + t.end(); +}); diff --git a/node_modules/object-inspect/test/lowbyte.js b/node_modules/object-inspect/test/lowbyte.js new file mode 100644 index 0000000..68a345d --- /dev/null +++ b/node_modules/object-inspect/test/lowbyte.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' }; + +test('interpolate low bytes', function (t) { + t.plan(1); + t.equal( + inspect(obj), + "{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }" + ); +}); diff --git a/node_modules/object-inspect/test/number.js b/node_modules/object-inspect/test/number.js new file mode 100644 index 0000000..8f287e8 --- /dev/null +++ b/node_modules/object-inspect/test/number.js @@ -0,0 +1,58 @@ +var test = require('tape'); +var v = require('es-value-fixtures'); +var forEach = require('for-each'); + +var inspect = require('../'); + +test('negative zero', function (t) { + t.equal(inspect(0), '0', 'inspect(0) === "0"'); + t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"'); + + t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"'); + t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"'); + + t.end(); +}); + +test('numericSeparator', function (t) { + forEach(v.nonBooleans, function (nonBoolean) { + t['throws']( + function () { inspect(true, { numericSeparator: nonBoolean }); }, + TypeError, + inspect(nonBoolean) + ' is not a boolean' + ); + }); + + t.test('3 digit numbers', function (st) { + var failed = false; + for (var i = -999; i < 1000; i += 1) { + var actual = inspect(i); + var actualSepNo = inspect(i, { numericSeparator: false }); + var actualSepYes = inspect(i, { numericSeparator: true }); + var expected = String(i); + if (actual !== expected || actualSepNo !== expected || actualSepYes !== expected) { + failed = true; + t.equal(actual, expected); + t.equal(actualSepNo, expected); + t.equal(actualSepYes, expected); + } + } + + st.notOk(failed, 'all 3 digit numbers passed'); + + st.end(); + }); + + t.equal(inspect(1e3), '1000', '1000'); + t.equal(inspect(1e3, { numericSeparator: false }), '1000', '1000, numericSeparator false'); + t.equal(inspect(1e3, { numericSeparator: true }), '1_000', '1000, numericSeparator true'); + t.equal(inspect(-1e3), '-1000', '-1000'); + t.equal(inspect(-1e3, { numericSeparator: false }), '-1000', '-1000, numericSeparator false'); + t.equal(inspect(-1e3, { numericSeparator: true }), '-1_000', '-1000, numericSeparator true'); + + t.equal(inspect(1234.5678, { numericSeparator: true }), '1_234.567_8', 'fractional numbers get separators'); + t.equal(inspect(1234.56789, { numericSeparator: true }), '1_234.567_89', 'fractional numbers get separators'); + t.equal(inspect(1234.567891, { numericSeparator: true }), '1_234.567_891', 'fractional numbers get separators'); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/quoteStyle.js b/node_modules/object-inspect/test/quoteStyle.js new file mode 100644 index 0000000..da23e63 --- /dev/null +++ b/node_modules/object-inspect/test/quoteStyle.js @@ -0,0 +1,26 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); + +test('quoteStyle option', function (t) { + t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value'); + t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value'); + + t.equal(inspect('"', { quoteStyle: 'single' }), '\'"\'', 'double quote, quoteStyle: "single"'); + t.equal(inspect('"', { quoteStyle: 'double' }), '"\\""', 'double quote, quoteStyle: "double"'); + + t.equal(inspect('\'', { quoteStyle: 'single' }), '\'\\\'\'', 'single quote, quoteStyle: "single"'); + t.equal(inspect('\'', { quoteStyle: 'double' }), '"\'"', 'single quote, quoteStyle: "double"'); + + t.equal(inspect('`', { quoteStyle: 'single' }), '\'`\'', 'backtick, quoteStyle: "single"'); + t.equal(inspect('`', { quoteStyle: 'double' }), '"`"', 'backtick, quoteStyle: "double"'); + + t.end(); +}); diff --git a/node_modules/object-inspect/test/toStringTag.js b/node_modules/object-inspect/test/toStringTag.js new file mode 100644 index 0000000..95f8270 --- /dev/null +++ b/node_modules/object-inspect/test/toStringTag.js @@ -0,0 +1,40 @@ +'use strict'; + +var test = require('tape'); +var hasToStringTag = require('has-tostringtag/shams')(); + +var inspect = require('../'); + +test('Symbol.toStringTag', { skip: !hasToStringTag }, function (t) { + t.plan(4); + + var obj = { a: 1 }; + t.equal(inspect(obj), '{ a: 1 }', 'object, no Symbol.toStringTag'); + + obj[Symbol.toStringTag] = 'foo'; + t.equal(inspect(obj), '{ a: 1, [Symbol(Symbol.toStringTag)]: \'foo\' }', 'object with Symbol.toStringTag'); + + t.test('null objects', { skip: 'toString' in { __proto__: null } }, function (st) { + st.plan(2); + + var dict = { __proto__: null, a: 1 }; + st.equal(inspect(dict), '[Object: null prototype] { a: 1 }', 'null object with Symbol.toStringTag'); + + dict[Symbol.toStringTag] = 'Dict'; + st.equal(inspect(dict), '[Dict: null prototype] { a: 1, [Symbol(Symbol.toStringTag)]: \'Dict\' }', 'null object with Symbol.toStringTag'); + }); + + t.test('instances', function (st) { + st.plan(4); + + function C() { + this.a = 1; + } + st.equal(Object.prototype.toString.call(new C()), '[object Object]', 'instance, no toStringTag, Object.prototype.toString'); + st.equal(inspect(new C()), 'C { a: 1 }', 'instance, no toStringTag'); + + C.prototype[Symbol.toStringTag] = 'Class!'; + st.equal(Object.prototype.toString.call(new C()), '[object Class!]', 'instance, with toStringTag, Object.prototype.toString'); + st.equal(inspect(new C()), 'C [Class!] { a: 1 }', 'instance, with toStringTag'); + }); +}); diff --git a/node_modules/object-inspect/test/undef.js b/node_modules/object-inspect/test/undef.js new file mode 100644 index 0000000..e3f4961 --- /dev/null +++ b/node_modules/object-inspect/test/undef.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var inspect = require('../'); + +var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null }; + +test('undef and null', function (t) { + t.plan(1); + t.equal( + inspect(obj), + '{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }' + ); +}); diff --git a/node_modules/object-inspect/test/values.js b/node_modules/object-inspect/test/values.js new file mode 100644 index 0000000..15986cd --- /dev/null +++ b/node_modules/object-inspect/test/values.js @@ -0,0 +1,261 @@ +'use strict'; + +var inspect = require('../'); +var test = require('tape'); +var mockProperty = require('mock-property'); +var hasSymbols = require('has-symbols/shams')(); +var hasToStringTag = require('has-tostringtag/shams')(); +var forEach = require('for-each'); +var semver = require('semver'); + +test('values', function (t) { + t.plan(1); + var obj = [{}, [], { 'a-b': 5 }]; + t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]'); +}); + +test('arrays with properties', function (t) { + t.plan(1); + var arr = [3]; + arr.foo = 'bar'; + var obj = [1, 2, arr]; + obj.baz = 'quux'; + obj.index = -1; + t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]'); +}); + +test('has', function (t) { + t.plan(1); + t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true })); + + t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }'); +}); + +test('indexOf seen', function (t) { + t.plan(1); + var xs = [1, 2, 3, {}]; + xs.push(xs); + + var seen = []; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[ 1, 2, 3, {}, [Circular] ]' + ); +}); + +test('seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('seen seen seen', function (t) { + t.plan(1); + var xs = [1, 2, 3]; + + var seen = [5, xs]; + seen.indexOf = undefined; + + t.equal( + inspect(xs, {}, 0, seen), + '[Circular]' + ); +}); + +test('symbols', { skip: !hasSymbols }, function (t) { + var sym = Symbol('foo'); + t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"'); + if (typeof sym === 'symbol') { + // Symbol shams are incapable of differentiating boxed from unboxed symbols + t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"'); + } + + t.test('toStringTag', { skip: !hasToStringTag }, function (st) { + st.plan(1); + + var faker = {}; + faker[Symbol.toStringTag] = 'Symbol'; + st.equal( + inspect(faker), + '{ [Symbol(Symbol.toStringTag)]: \'Symbol\' }', + 'object lying about being a Symbol inspects as an object' + ); + }); + + t.end(); +}); + +test('Map', { skip: typeof Map !== 'function' }, function (t) { + var map = new Map(); + map.set({ a: 1 }, ['b']); + map.set(3, NaN); + var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}'; + t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents'); + t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty'); + + var nestedMap = new Map(); + nestedMap.set(nestedMap, map); + t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work'); + + t.end(); +}); + +test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) { + var map = new WeakMap(); + map.set({ a: 1 }, ['b']); + var expectedString = 'WeakMap { ? }'; + t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents'); + t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty'); + + t.end(); +}); + +test('Set', { skip: typeof Set !== 'function' }, function (t) { + var set = new Set(); + set.add({ a: 1 }); + set.add(['b']); + var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}'; + t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents'); + t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty'); + + var nestedSet = new Set(); + nestedSet.add(set); + nestedSet.add(nestedSet); + t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work'); + + t.end(); +}); + +test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) { + var map = new WeakSet(); + map.add({ a: 1 }); + var expectedString = 'WeakSet { ? }'; + t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents'); + t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty'); + + t.end(); +}); + +test('WeakRef', { skip: typeof WeakRef !== 'function' }, function (t) { + var ref = new WeakRef({ a: 1 }); + var expectedString = 'WeakRef { ? }'; + t.equal(inspect(ref), expectedString, 'new WeakRef({ a: 1 }) should not show contents'); + + t.end(); +}); + +test('FinalizationRegistry', { skip: typeof FinalizationRegistry !== 'function' }, function (t) { + var registry = new FinalizationRegistry(function () {}); + var expectedString = 'FinalizationRegistry [FinalizationRegistry] {}'; + t.equal(inspect(registry), expectedString, 'new FinalizationRegistry(function () {}) should work normallys'); + + t.end(); +}); + +test('Strings', function (t) { + var str = 'abc'; + + t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such'); + t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted'); + t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted'); + t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such'); + t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted'); + t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted'); + + t.end(); +}); + +test('Numbers', function (t) { + var num = 42; + + t.equal(inspect(num), String(num), 'primitive number shows as such'); + t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such'); + + t.end(); +}); + +test('Booleans', function (t) { + t.equal(inspect(true), String(true), 'primitive true shows as such'); + t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such'); + + t.equal(inspect(false), String(false), 'primitive false shows as such'); + t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such'); + + t.end(); +}); + +test('Date', function (t) { + var now = new Date(); + t.equal(inspect(now), String(now), 'Date shows properly'); + t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly'); + + t.end(); +}); + +test('RegExps', function (t) { + t.equal(inspect(/a/g), '/a/g', 'regex shows properly'); + t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly'); + + var match = 'abc abc'.match(/[ab]+/); + delete match.groups; // for node < 10 + t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly'); + + t.end(); +}); + +test('Proxies', { skip: typeof Proxy !== 'function' || !hasToStringTag }, function (t) { + var target = { proxy: true }; + var fake = new Proxy(target, { has: function () { return false; } }); + + // needed to work around a weird difference in node v6.0 - v6.4 where non-present properties are not logged + var isNode60 = semver.satisfies(process.version, '6.0 - 6.4'); + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(fake), + '{ ' + (isNode60 ? '' : 'proxy: true, ') + '[Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Proxy for + ' + tag + ' shows as the target, which has no slots' + ); + }); + + t.end(); +}); + +test('fakers', { skip: !hasToStringTag }, function (t) { + var target = { proxy: false }; + + forEach([ + 'Boolean', + 'Number', + 'String', + 'Symbol', + 'Date' + ], function (tag) { + target[Symbol.toStringTag] = tag; + + t.equal( + inspect(target), + '{ proxy: false, [Symbol(Symbol.toStringTag)]: \'' + tag + '\' }', + 'Object pretending to be ' + tag + ' does not trick us' + ); + }); + + t.end(); +}); diff --git a/node_modules/object-inspect/util.inspect.js b/node_modules/object-inspect/util.inspect.js new file mode 100644 index 0000000..7784fab --- /dev/null +++ b/node_modules/object-inspect/util.inspect.js @@ -0,0 +1 @@ +module.exports = require('util').inspect; diff --git a/node_modules/on-finished/HISTORY.md b/node_modules/on-finished/HISTORY.md new file mode 100644 index 0000000..1917595 --- /dev/null +++ b/node_modules/on-finished/HISTORY.md @@ -0,0 +1,98 @@ +2.4.1 / 2022-02-22 +================== + + * Fix error on early async hooks implementations + +2.4.0 / 2022-02-21 +================== + + * Prevent loss of async hooks context + +2.3.0 / 2015-05-26 +================== + + * Add defined behavior for HTTP `CONNECT` requests + * Add defined behavior for HTTP `Upgrade` requests + * deps: ee-first@1.1.1 + +2.2.1 / 2015-04-22 +================== + + * Fix `isFinished(req)` when data buffered + +2.2.0 / 2014-12-22 +================== + + * Add message object to callback arguments + +2.1.1 / 2014-10-22 +================== + + * Fix handling of pipelined requests + +2.1.0 / 2014-08-16 +================== + + * Check if `socket` is detached + * Return `undefined` for `isFinished` if state unknown + +2.0.0 / 2014-08-16 +================== + + * Add `isFinished` function + * Move to `jshttp` organization + * Remove support for plain socket argument + * Rename to `on-finished` + * Support both `req` and `res` as arguments + * deps: ee-first@1.0.5 + +1.2.2 / 2014-06-10 +================== + + * Reduce listeners added to emitters + - avoids "event emitter leak" warnings when used multiple times on same request + +1.2.1 / 2014-06-08 +================== + + * Fix returned value when already finished + +1.2.0 / 2014-06-05 +================== + + * Call callback when called on already-finished socket + +1.1.4 / 2014-05-27 +================== + + * Support node.js 0.8 + +1.1.3 / 2014-04-30 +================== + + * Make sure errors passed as instanceof `Error` + +1.1.2 / 2014-04-18 +================== + + * Default the `socket` to passed-in object + +1.1.1 / 2014-01-16 +================== + + * Rename module to `finished` + +1.1.0 / 2013-12-25 +================== + + * Call callback when called on already-errored socket + +1.0.1 / 2013-12-20 +================== + + * Actually pass the error to the callback + +1.0.0 / 2013-12-20 +================== + + * Initial release diff --git a/node_modules/on-finished/LICENSE b/node_modules/on-finished/LICENSE new file mode 100644 index 0000000..5931fd2 --- /dev/null +++ b/node_modules/on-finished/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2013 Jonathan Ong +Copyright (c) 2014 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/on-finished/README.md b/node_modules/on-finished/README.md new file mode 100644 index 0000000..8973cde --- /dev/null +++ b/node_modules/on-finished/README.md @@ -0,0 +1,162 @@ +# on-finished + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Execute a callback when a HTTP request closes, finishes, or errors. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install on-finished +``` + +## API + +```js +var onFinished = require('on-finished') +``` + +### onFinished(res, listener) + +Attach a listener to listen for the response to finish. The listener will +be invoked only once when the response finished. If the response finished +to an error, the first argument will contain the error. If the response +has already finished, the listener will be invoked. + +Listening to the end of a response would be used to close things associated +with the response, like open files. + +Listener is invoked as `listener(err, res)`. + + + +```js +onFinished(res, function (err, res) { + // clean up open fds, etc. + // err contains the error if request error'd +}) +``` + +### onFinished(req, listener) + +Attach a listener to listen for the request to finish. The listener will +be invoked only once when the request finished. If the request finished +to an error, the first argument will contain the error. If the request +has already finished, the listener will be invoked. + +Listening to the end of a request would be used to know when to continue +after reading the data. + +Listener is invoked as `listener(err, req)`. + + + +```js +var data = '' + +req.setEncoding('utf8') +req.on('data', function (str) { + data += str +}) + +onFinished(req, function (err, req) { + // data is read unless there is err +}) +``` + +### onFinished.isFinished(res) + +Determine if `res` is already finished. This would be useful to check and +not even start certain operations if the response has already finished. + +### onFinished.isFinished(req) + +Determine if `req` is already finished. This would be useful to check and +not even start certain operations if the request has already finished. + +## Special Node.js requests + +### HTTP CONNECT method + +The meaning of the `CONNECT` method from RFC 7231, section 4.3.6: + +> The CONNECT method requests that the recipient establish a tunnel to +> the destination origin server identified by the request-target and, +> if successful, thereafter restrict its behavior to blind forwarding +> of packets, in both directions, until the tunnel is closed. Tunnels +> are commonly used to create an end-to-end virtual connection, through +> one or more proxies, which can then be secured using TLS (Transport +> Layer Security, [RFC5246]). + +In Node.js, these request objects come from the `'connect'` event on +the HTTP server. + +When this module is used on a HTTP `CONNECT` request, the request is +considered "finished" immediately, **due to limitations in the Node.js +interface**. This means if the `CONNECT` request contains a request entity, +the request will be considered "finished" even before it has been read. + +There is no such thing as a response object to a `CONNECT` request in +Node.js, so there is no support for one. + +### HTTP Upgrade request + +The meaning of the `Upgrade` header from RFC 7230, section 6.1: + +> The "Upgrade" header field is intended to provide a simple mechanism +> for transitioning from HTTP/1.1 to some other protocol on the same +> connection. + +In Node.js, these request objects come from the `'upgrade'` event on +the HTTP server. + +When this module is used on a HTTP request with an `Upgrade` header, the +request is considered "finished" immediately, **due to limitations in the +Node.js interface**. This means if the `Upgrade` request contains a request +entity, the request will be considered "finished" even before it has been +read. + +There is no such thing as a response object to a `Upgrade` request in +Node.js, so there is no support for one. + +## Example + +The following code ensures that file descriptors are always closed +once the response finishes. + +```js +var destroy = require('destroy') +var fs = require('fs') +var http = require('http') +var onFinished = require('on-finished') + +http.createServer(function onRequest (req, res) { + var stream = fs.createReadStream('package.json') + stream.pipe(res) + onFinished(res, function () { + destroy(stream) + }) +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/on-finished/master?label=ci +[ci-url]: https://github.com/jshttp/on-finished/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-finished/master +[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master +[node-image]: https://badgen.net/npm/node/on-finished +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/on-finished +[npm-url]: https://npmjs.org/package/on-finished +[npm-version-image]: https://badgen.net/npm/v/on-finished diff --git a/node_modules/on-finished/index.js b/node_modules/on-finished/index.js new file mode 100644 index 0000000..e68df7b --- /dev/null +++ b/node_modules/on-finished/index.js @@ -0,0 +1,234 @@ +/*! + * on-finished + * Copyright(c) 2013 Jonathan Ong + * Copyright(c) 2014 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = onFinished +module.exports.isFinished = isFinished + +/** + * Module dependencies. + * @private + */ + +var asyncHooks = tryRequireAsyncHooks() +var first = require('ee-first') + +/** + * Variables. + * @private + */ + +/* istanbul ignore next */ +var defer = typeof setImmediate === 'function' + ? setImmediate + : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) } + +/** + * Invoke callback when the response has finished, useful for + * cleaning up resources afterwards. + * + * @param {object} msg + * @param {function} listener + * @return {object} + * @public + */ + +function onFinished (msg, listener) { + if (isFinished(msg) !== false) { + defer(listener, null, msg) + return msg + } + + // attach the listener to the message + attachListener(msg, wrap(listener)) + + return msg +} + +/** + * Determine if message is already finished. + * + * @param {object} msg + * @return {boolean} + * @public + */ + +function isFinished (msg) { + var socket = msg.socket + + if (typeof msg.finished === 'boolean') { + // OutgoingMessage + return Boolean(msg.finished || (socket && !socket.writable)) + } + + if (typeof msg.complete === 'boolean') { + // IncomingMessage + return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable)) + } + + // don't know + return undefined +} + +/** + * Attach a finished listener to the message. + * + * @param {object} msg + * @param {function} callback + * @private + */ + +function attachFinishedListener (msg, callback) { + var eeMsg + var eeSocket + var finished = false + + function onFinish (error) { + eeMsg.cancel() + eeSocket.cancel() + + finished = true + callback(error) + } + + // finished on first message event + eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish) + + function onSocket (socket) { + // remove listener + msg.removeListener('socket', onSocket) + + if (finished) return + if (eeMsg !== eeSocket) return + + // finished on first socket event + eeSocket = first([[socket, 'error', 'close']], onFinish) + } + + if (msg.socket) { + // socket already assigned + onSocket(msg.socket) + return + } + + // wait for socket to be assigned + msg.on('socket', onSocket) + + if (msg.socket === undefined) { + // istanbul ignore next: node.js 0.8 patch + patchAssignSocket(msg, onSocket) + } +} + +/** + * Attach the listener to the message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function attachListener (msg, listener) { + var attached = msg.__onFinished + + // create a private single listener with queue + if (!attached || !attached.queue) { + attached = msg.__onFinished = createListener(msg) + attachFinishedListener(msg, attached) + } + + attached.queue.push(listener) +} + +/** + * Create listener on message. + * + * @param {object} msg + * @return {function} + * @private + */ + +function createListener (msg) { + function listener (err) { + if (msg.__onFinished === listener) msg.__onFinished = null + if (!listener.queue) return + + var queue = listener.queue + listener.queue = null + + for (var i = 0; i < queue.length; i++) { + queue[i](err, msg) + } + } + + listener.queue = [] + + return listener +} + +/** + * Patch ServerResponse.prototype.assignSocket for node.js 0.8. + * + * @param {ServerResponse} res + * @param {function} callback + * @private + */ + +// istanbul ignore next: node.js 0.8 patch +function patchAssignSocket (res, callback) { + var assignSocket = res.assignSocket + + if (typeof assignSocket !== 'function') return + + // res.on('socket', callback) is broken in 0.8 + res.assignSocket = function _assignSocket (socket) { + assignSocket.call(this, socket) + callback(socket) + } +} + +/** + * Try to require async_hooks + * @private + */ + +function tryRequireAsyncHooks () { + try { + return require('async_hooks') + } catch (e) { + return {} + } +} + +/** + * Wrap function with async resource, if possible. + * AsyncResource.bind static method backported. + * @private + */ + +function wrap (fn) { + var res + + // create anonymous resource + if (asyncHooks.AsyncResource) { + res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') + } + + // incompatible node.js + if (!res || !res.runInAsyncScope) { + return fn + } + + // return bound function + return res.runInAsyncScope.bind(res, fn, null) +} diff --git a/node_modules/on-finished/package.json b/node_modules/on-finished/package.json new file mode 100644 index 0000000..644cd81 --- /dev/null +++ b/node_modules/on-finished/package.json @@ -0,0 +1,39 @@ +{ + "name": "on-finished", + "description": "Execute a callback when a request closes, finishes, or errors", + "version": "2.4.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/on-finished", + "dependencies": { + "ee-first": "1.1.1" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.1", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.8" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/once/LICENSE b/node_modules/once/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/once/README.md b/node_modules/once/README.md new file mode 100644 index 0000000..1f1ffca --- /dev/null +++ b/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js new file mode 100644 index 0000000..2354067 --- /dev/null +++ b/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/node_modules/once/package.json b/node_modules/once/package.json new file mode 100644 index 0000000..16815b2 --- /dev/null +++ b/node_modules/once/package.json @@ -0,0 +1,33 @@ +{ + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" + }, + "dependencies": { + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.0.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "files": [ + "once.js" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once" + }, + "keywords": [ + "once", + "function", + "one", + "single" + ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/node_modules/os-name/cli.js b/node_modules/os-name/cli.js new file mode 100644 index 0000000..8413d2a --- /dev/null +++ b/node_modules/os-name/cli.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var osName = require('./'); +var argv = process.argv; + +function help() { + console.log([ + '', + ' ' + pkg.description, + '', + ' Example', + ' os-name', + ' OS X Mavericks' + ].join('\n')); +} + +if (argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +console.log(osName()); diff --git a/node_modules/os-name/index.js b/node_modules/os-name/index.js new file mode 100644 index 0000000..23993d9 --- /dev/null +++ b/node_modules/os-name/index.js @@ -0,0 +1,32 @@ +'use strict'; +var os = require('os'); +var osxRelease = require('osx-release'); +var winRelease = require('win-release'); + +module.exports = function (platform, release) { + if (!platform && release) { + throw new Error('You can\'t specify a `release` without specfying `platform`'); + } + + platform = platform || os.platform(); + release = release || os.release(); + + var id; + + if (platform === 'darwin') { + id = osxRelease(release).name; + return 'OS X' + (id ? ' ' + id : ''); + } + + if (platform === 'linux') { + id = release.replace(/^(\d+\.\d+).*/, '$1'); + return 'Linux' + (id ? ' ' + id : ''); + } + + if (platform === 'win32') { + id = winRelease(release); + return 'Windows' + (id ? ' ' + id : ''); + } + + return platform; +}; diff --git a/node_modules/os-name/package.json b/node_modules/os-name/package.json new file mode 100644 index 0000000..e72c2fa --- /dev/null +++ b/node_modules/os-name/package.json @@ -0,0 +1,47 @@ +{ + "name": "os-name", + "version": "1.0.3", + "description": "Get the name of the current operating system. Example: OS X Mavericks", + "license": "MIT", + "repository": "sindresorhus/os-name", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bin": { + "os-name": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js", + "cli.js" + ], + "keywords": [ + "cli", + "bin", + "os", + "operating", + "system", + "platform", + "name", + "title", + "release", + "version", + "osx", + "windows", + "linux" + ], + "dependencies": { + "osx-release": "^1.0.0", + "win-release": "^1.0.0" + }, + "devDependencies": { + "mocha": "*" + } +} diff --git a/node_modules/os-name/readme.md b/node_modules/os-name/readme.md new file mode 100644 index 0000000..9940814 --- /dev/null +++ b/node_modules/os-name/readme.md @@ -0,0 +1,76 @@ +# os-name [![Build Status](https://travis-ci.org/sindresorhus/os-name.svg?branch=master)](https://travis-ci.org/sindresorhus/os-name) + +> Get the name of the current operating system. Example: `OS X Mavericks` + +Useful for analytics and debugging. + + +## Install + +```sh +$ npm install --save os-name +``` + + +## Usage + +```js +var os = require('os'); +var osName = require('os-name'); + +// on an OS X Mavericks system + +osName(); +//=> OS X Mavericks + +osName(os.platform(), os.release()); +//=> OS X Mavericks + +osName(os.platform()); +//=> OS X + +osName('linux', '3.13.0-24-generic'); +//=> Linux 3.13 + +osName('win32', '6.3.9600'); +//=> Windows 8.1 + +osName('win32'); +// Windows +``` + + +## API + +### osName([platform, release]) + +By default the name of the current operating system is returned. + +You can optionally supply a custom [`os.platform()`](http://nodejs.org/api/os.html#os_os_platform) and [`os.release()`](http://nodejs.org/api/os.html#os_os_release). + +Check out [getos](https://github.com/wblankenship/getos) if you need the Linux distribution name. + + +## CLI + +```sh +$ npm install --global os-name +``` + +```sh +$ os-name --help + + Example + os-name + OS X Mavericks +``` + + +## Contributing + +Production systems depend on this package for logging / tracking. Please be careful when introducing new output, and adhere to existing output format (whitespace, capitalization, etc.). + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/osx-release/cli.js b/node_modules/osx-release/cli.js new file mode 100644 index 0000000..4e05a43 --- /dev/null +++ b/node_modules/osx-release/cli.js @@ -0,0 +1,41 @@ +#!/usr/bin/env node +'use strict'; +var argv = require('minimist')(process.argv.slice(2)); +var pkg = require('./package.json'); +var osxRelease = require('./'); +var input = argv._[0]; + +function help() { + console.log([ + '', + ' ' + pkg.description, + '', + ' Usage', + ' osx-release [release]', + '', + ' Example', + ' osx-release', + ' Mavericks 10.9', + '', + ' osx-release 14.0.0', + ' Yosemite 10.10' + ].join('\n')); +} + +if (!input || argv.help) { + help(); + return; +} + +if (argv.version) { + console.log(pkg.version); + return; +} + +var output = osxRelease(input); + +if (!output.name || !output.version) { + process.exit(1); +} + +console.log(output.name + ' ' + output.version); diff --git a/node_modules/osx-release/index.js b/node_modules/osx-release/index.js new file mode 100644 index 0000000..7071581 --- /dev/null +++ b/node_modules/osx-release/index.js @@ -0,0 +1,24 @@ +'use strict'; +var os = require('os'); + +var nameMap = { + '15': 'El Capitan', + '14': 'Yosemite', + '13': 'Mavericks', + '12': 'Mountain Lion', + '11': 'Lion', + '10': 'Snow Leopard', + '9': 'Leopard', + '8': 'Tiger', + '7': 'Panther', + '6': 'Jaguar', + '5': 'Puma' +}; + +module.exports = function (release) { + release = (release || os.release()).split('.')[0]; + return { + name: nameMap[release], + version: '10.' + (Number(release) - 4) + }; +}; diff --git a/node_modules/osx-release/license b/node_modules/osx-release/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/osx-release/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/osx-release/package.json b/node_modules/osx-release/package.json new file mode 100644 index 0000000..3a0c358 --- /dev/null +++ b/node_modules/osx-release/package.json @@ -0,0 +1,44 @@ +{ + "name": "osx-release", + "version": "1.1.0", + "description": "Get the name and version of a OS X release from the Darwin version. Example: 13.2.0 → {name: 'Mavericks', version: '10.9'}", + "license": "MIT", + "repository": "sindresorhus/osx-release", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bin": "cli.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js", + "cli.js" + ], + "keywords": [ + "cli-app", + "cli", + "bin", + "os", + "osx", + "darwin", + "operating", + "system", + "platform", + "name", + "title", + "release", + "version" + ], + "dependencies": { + "minimist": "^1.1.0" + }, + "devDependencies": { + "mocha": "*" + } +} diff --git a/node_modules/osx-release/readme.md b/node_modules/osx-release/readme.md new file mode 100644 index 0000000..59d39e4 --- /dev/null +++ b/node_modules/osx-release/readme.md @@ -0,0 +1,78 @@ +# osx-release [![Build Status](https://travis-ci.org/sindresorhus/osx-release.svg?branch=master)](https://travis-ci.org/sindresorhus/osx-release) + +> Get the name and version of a OS X release from the Darwin version. +> Example: `13.2.0` → `{name: 'Mavericks', version: '10.9'}` + + +## Install + +```sh +$ npm install --save osx-release +``` + + +## Usage + +```js +var os = require('os'); +var osxRelease = require('osx-release'); + +// on an OS X Mavericks system + +osxRelease(); +//=> {name: 'Mavericks', version: '10.9'} + +os.release(); +//=> 13.2.0 +// this is the Darwin kernel version + +osxRelease(os.release()); +//=> {name: 'Mavericks', version: '10.9'} + +osxRelease('14.0.0'); +//=> {name: 'Yosemite', version: '10.10'} +``` + + +## API + +### osxRelease([release]) + +#### release + +Type: `string` + +By default the current OS is used, but you can supply a custom [Darwin kernel version](http://en.wikipedia.org/wiki/Darwin_%28operating_system%29#Release_history), which is the output of [`os.release()`](http://nodejs.org/api/os.html#os_os_release). + + +## CLI + +```sh +$ npm install --global osx-release +``` + +```sh +$ osx-release --help + + Usage + osx-release [release] + + Example + osx-release + Mavericks 10.9 + + osx-release 14.0.0 + Yosemite 10.10 +``` + + +## Related + +- [os-name](https://github.com/sindresorhus/os-name) - Get the name of the current operating system. Example: `OS X Mavericks` +- [osx-version](https://github.com/sindresorhus/osx-version) - Get the OS X version of the current system. Example: `10.9.3` +- [win-release](https://github.com/sindresorhus/osx-version) - Get the name of a Windows version from the release number: `5.1.2600` → `XP` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/p-limit/index.d.ts b/node_modules/p-limit/index.d.ts new file mode 100644 index 0000000..f348d7f --- /dev/null +++ b/node_modules/p-limit/index.d.ts @@ -0,0 +1,42 @@ +declare namespace pLimit { + interface Limit { + /** + The number of promises that are currently running. + */ + readonly activeCount: number; + + /** + The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + */ + readonly pendingCount: number; + + /** + Discard pending promises that are waiting to run. + + This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + + Note: This does not cancel promises that are already running. + */ + clearQueue: () => void; + + /** + @param fn - Promise-returning/async function. + @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. + @returns The promise returned by calling `fn(...arguments)`. + */ + ( + fn: (...arguments: Arguments) => PromiseLike | ReturnType, + ...arguments: Arguments + ): Promise; + } +} + +/** +Run multiple promise-returning & async functions with limited concurrency. + +@param concurrency - Concurrency limit. Minimum: `1`. +@returns A `limit` function. +*/ +declare function pLimit(concurrency: number): pLimit.Limit; + +export = pLimit; diff --git a/node_modules/p-limit/index.js b/node_modules/p-limit/index.js new file mode 100644 index 0000000..c2ae52d --- /dev/null +++ b/node_modules/p-limit/index.js @@ -0,0 +1,71 @@ +'use strict'; +const Queue = require('yocto-queue'); + +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + throw new TypeError('Expected `concurrency` to be a number from 1 and up'); + } + + const queue = new Queue(); + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.size > 0) { + queue.dequeue()(); + } + }; + + const run = async (fn, resolve, ...args) => { + activeCount++; + + const result = (async () => fn(...args))(); + + resolve(result); + + try { + await result; + } catch {} + + next(); + }; + + const enqueue = (fn, resolve, ...args) => { + queue.enqueue(run.bind(null, fn, resolve, ...args)); + + (async () => { + // This function needs to wait until the next microtask before comparing + // `activeCount` to `concurrency`, because `activeCount` is updated asynchronously + // when the run function is dequeued and called. The comparison in the if-statement + // needs to happen asynchronously as well to get an up-to-date value for `activeCount`. + await Promise.resolve(); + + if (activeCount < concurrency && queue.size > 0) { + queue.dequeue()(); + } + })(); + }; + + const generator = (fn, ...args) => new Promise(resolve => { + enqueue(fn, resolve, ...args); + }); + + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.size + }, + clearQueue: { + value: () => { + queue.clear(); + } + } + }); + + return generator; +}; + +module.exports = pLimit; diff --git a/node_modules/p-limit/license b/node_modules/p-limit/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-limit/package.json b/node_modules/p-limit/package.json new file mode 100644 index 0000000..7651473 --- /dev/null +++ b/node_modules/p-limit/package.json @@ -0,0 +1,52 @@ +{ + "name": "p-limit", + "version": "3.1.0", + "description": "Run multiple promise-returning & async functions with limited concurrency", + "license": "MIT", + "repository": "sindresorhus/p-limit", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "delay": "^4.4.0", + "in-range": "^2.0.0", + "random-int": "^2.0.1", + "time-span": "^4.0.0", + "tsd": "^0.13.1", + "xo": "^0.35.0" + } +} diff --git a/node_modules/p-limit/readme.md b/node_modules/p-limit/readme.md new file mode 100644 index 0000000..b283c1e --- /dev/null +++ b/node_modules/p-limit/readme.md @@ -0,0 +1,101 @@ +# p-limit + +> Run multiple promise-returning & async functions with limited concurrency + +## Install + +``` +$ npm install p-limit +``` + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`\ +Minimum: `1`\ +Default: `Infinity` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + +### limit.clearQueue() + +Discard pending promises that are waiting to run. + +This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + +Note: This does not cancel promises that are already running. + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/p-locate/index.d.ts b/node_modules/p-locate/index.d.ts new file mode 100644 index 0000000..38c7e57 --- /dev/null +++ b/node_modules/p-locate/index.d.ts @@ -0,0 +1,53 @@ +declare namespace pLocate { + interface Options { + /** + Number of concurrently pending promises returned by `tester`. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `input` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +/** +Get the first fulfilled promise that satisfies the provided testing function. + +@param input - An iterable of promises/values to test. +@param tester - This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. +@returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +@example +``` +import pathExists = require('path-exists'); +import pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` +*/ +declare function pLocate( + input: Iterable | ValueType>, + tester: (element: ValueType) => PromiseLike | boolean, + options?: pLocate.Options +): Promise; + +export = pLocate; diff --git a/node_modules/p-locate/index.js b/node_modules/p-locate/index.js new file mode 100644 index 0000000..641c3dd --- /dev/null +++ b/node_modules/p-locate/index.js @@ -0,0 +1,50 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); + +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + + return false; +}; + +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + + const limit = pLimit(options.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; + } + + throw error; + } +}; + +module.exports = pLocate; diff --git a/node_modules/p-locate/license b/node_modules/p-locate/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/p-locate/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-locate/package.json b/node_modules/p-locate/package.json new file mode 100644 index 0000000..2d5e447 --- /dev/null +++ b/node_modules/p-locate/package.json @@ -0,0 +1,54 @@ +{ + "name": "p-locate", + "version": "5.0.0", + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "license": "MIT", + "repository": "sindresorhus/p-locate", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-limit": "^3.0.2" + }, + "devDependencies": { + "ava": "^2.4.0", + "delay": "^4.1.0", + "in-range": "^2.0.0", + "time-span": "^4.0.0", + "tsd": "^0.13.1", + "xo": "^0.32.1" + } +} diff --git a/node_modules/p-locate/readme.md b/node_modules/p-locate/readme.md new file mode 100644 index 0000000..be85ec1 --- /dev/null +++ b/node_modules/p-locate/readme.md @@ -0,0 +1,93 @@ +# p-locate [![Build Status](https://travis-ci.com/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.com/github/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + +## Install + +``` +$ npm install p-locate +``` + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + +## API + +### pLocate(input, tester, options?) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +An iterable of promises/values to test. + +#### tester(element) + +Type: `Function` + +This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + +#### options + +Type: `object` + +##### concurrency + +Type: `number`\ +Default: `Infinity`\ +Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`\ +Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/p-map/index.d.ts b/node_modules/p-map/index.d.ts new file mode 100644 index 0000000..8f79629 --- /dev/null +++ b/node_modules/p-map/index.d.ts @@ -0,0 +1,65 @@ +declare namespace pMap { + interface Options { + /** + Number of concurrently pending promises returned by `mapper`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises. + + @default true + */ + readonly stopOnError?: boolean; + } + + /** + Function which is called for every item in `input`. Expected to return a `Promise` or value. + + @param element - Iterated element. + @param index - Index of the element in the source array. + */ + type Mapper = ( + element: Element, + index: number + ) => NewElement | Promise; +} + +/** +@param input - Iterated over concurrently in the `mapper` function. +@param mapper - Function which is called for every item in `input`. Expected to return a `Promise` or value. +@returns A `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order. + +@example +``` +import pMap = require('p-map'); +import got = require('got'); + +const sites = [ + getWebsiteFromUsername('https://sindresorhus'), //=> Promise + 'https://ava.li', + 'https://github.com' +]; + +(async () => { + const mapper = async site => { + const {requestUrl} = await got.head(site); + return requestUrl; + }; + + const result = await pMap(sites, mapper, {concurrency: 2}); + + console.log(result); + //=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/'] +})(); +``` +*/ +declare function pMap( + input: Iterable, + mapper: pMap.Mapper, + options?: pMap.Options +): Promise; + +export = pMap; diff --git a/node_modules/p-map/index.js b/node_modules/p-map/index.js new file mode 100644 index 0000000..5a8aeb2 --- /dev/null +++ b/node_modules/p-map/index.js @@ -0,0 +1,81 @@ +'use strict'; +const AggregateError = require('aggregate-error'); + +module.exports = async ( + iterable, + mapper, + { + concurrency = Infinity, + stopOnError = true + } = {} +) => { + return new Promise((resolve, reject) => { + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!(typeof concurrency === 'number' && concurrency >= 1)) { + throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`); + } + + const ret = []; + const errors = []; + const iterator = iterable[Symbol.iterator](); + let isRejected = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + + const next = () => { + if (isRejected) { + return; + } + + const nextItem = iterator.next(); + const i = currentIndex; + currentIndex++; + + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0) { + if (!stopOnError && errors.length !== 0) { + reject(new AggregateError(errors)); + } else { + resolve(ret); + } + } + + return; + } + + resolvingCount++; + + (async () => { + try { + const element = await nextItem.value; + ret[i] = await mapper(element, i); + resolvingCount--; + next(); + } catch (error) { + if (stopOnError) { + isRejected = true; + reject(error); + } else { + errors.push(error); + resolvingCount--; + next(); + } + } + })(); + }; + + for (let i = 0; i < concurrency; i++) { + next(); + + if (isIterableDone) { + break; + } + } + }); +}; diff --git a/node_modules/p-map/license b/node_modules/p-map/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/p-map/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-map/package.json b/node_modules/p-map/package.json new file mode 100644 index 0000000..d19f5b3 --- /dev/null +++ b/node_modules/p-map/package.json @@ -0,0 +1,52 @@ +{ + "name": "p-map", + "version": "3.0.0", + "description": "Map over promises concurrently", + "license": "MIT", + "repository": "sindresorhus/p-map", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "map", + "resolved", + "wait", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "async", + "await", + "promises", + "concurrently", + "concurrency", + "parallel", + "bluebird" + ], + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.2.0", + "delay": "^4.1.0", + "in-range": "^2.0.0", + "random-int": "^2.0.0", + "time-span": "^3.1.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/p-map/readme.md b/node_modules/p-map/readme.md new file mode 100644 index 0000000..4941cb7 --- /dev/null +++ b/node_modules/p-map/readme.md @@ -0,0 +1,99 @@ +# p-map [![Build Status](https://travis-ci.org/sindresorhus/p-map.svg?branch=master)](https://travis-ci.org/sindresorhus/p-map) + +> Map over promises concurrently + +Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently. + + +## Install + +``` +$ npm install p-map +``` + + +## Usage + +```js +const pMap = require('p-map'); +const got = require('got'); + +const sites = [ + getWebsiteFromUsername('https://sindresorhus'), //=> Promise + 'https://ava.li', + 'https://github.com' +]; + +(async () => { + const mapper = async site => { + const {requestUrl} = await got.head(site); + return requestUrl; + }; + + const result = await pMap(sites, mapper, {concurrency: 2}); + + console.log(result); + //=> ['https://sindresorhus.com/', 'https://ava.li/', 'https://github.com/'] +})(); +``` + +## API + +### pMap(input, mapper, options?) + +Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order. + +#### input + +Type: `Iterable` + +Iterated over concurrently in the `mapper` function. + +#### mapper(element, index) + +Type: `Function` + +Expected to return a `Promise` or value. + +#### options + +Type: `object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises returned by `mapper`. + +##### stopOnError + +Type: `boolean`
+Default: `true` + +When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [aggregated error](https://github.com/sindresorhus/aggregate-error) containing all the errors from the rejected promises. + + +## Related + +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently +- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object` +- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [More…](https://github.com/sindresorhus/promise-fun) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/p-try/index.d.ts b/node_modules/p-try/index.d.ts new file mode 100644 index 0000000..2a7319e --- /dev/null +++ b/node_modules/p-try/index.d.ts @@ -0,0 +1,39 @@ +declare const pTry: { + /** + Start a promise chain. + + @param fn - The function to run to start the promise chain. + @param arguments - Arguments to pass to `fn`. + @returns The value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. + + @example + ``` + import pTry = require('p-try'); + + (async () => { + try { + const value = await pTry(() => { + return synchronousFunctionThatMightThrow(); + }); + console.log(value); + } catch (error) { + console.error(error); + } + })(); + ``` + */ + ( + fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, + ...arguments: ArgumentsType + ): Promise; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function pTry( + // fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, + // ...arguments: ArgumentsType + // ): Promise; + // export = pTry; + default: typeof pTry; +}; + +export = pTry; diff --git a/node_modules/p-try/index.js b/node_modules/p-try/index.js new file mode 100644 index 0000000..db858da --- /dev/null +++ b/node_modules/p-try/index.js @@ -0,0 +1,9 @@ +'use strict'; + +const pTry = (fn, ...arguments_) => new Promise(resolve => { + resolve(fn(...arguments_)); +}); + +module.exports = pTry; +// TODO: remove this in the next major version +module.exports.default = pTry; diff --git a/node_modules/p-try/license b/node_modules/p-try/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/p-try/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/p-try/package.json b/node_modules/p-try/package.json new file mode 100644 index 0000000..81c4d32 --- /dev/null +++ b/node_modules/p-try/package.json @@ -0,0 +1,42 @@ +{ + "name": "p-try", + "version": "2.2.0", + "description": "`Start a promise chain", + "license": "MIT", + "repository": "sindresorhus/p-try", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "try", + "resolve", + "function", + "catch", + "async", + "await", + "promises", + "settled", + "ponyfill", + "polyfill", + "shim", + "bluebird" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/p-try/readme.md b/node_modules/p-try/readme.md new file mode 100644 index 0000000..4d7bd64 --- /dev/null +++ b/node_modules/p-try/readme.md @@ -0,0 +1,58 @@ +# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) + +> Start a promise chain + +[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) + + +## Install + +``` +$ npm install p-try +``` + + +## Usage + +```js +const pTry = require('p-try'); + +(async () => { + try { + const value = await pTry(() => { + return synchronousFunctionThatMightThrow(); + }); + console.log(value); + } catch (error) { + console.error(error); + } +})(); +``` + + +## API + +### pTry(fn, ...arguments) + +Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +#### fn + +The function to run to start the promise chain. + +#### arguments + +Arguments to pass to `fn`. + + +## Related + +- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/package-hash/LICENSE b/node_modules/package-hash/LICENSE new file mode 100644 index 0000000..ddc33e0 --- /dev/null +++ b/node_modules/package-hash/LICENSE @@ -0,0 +1,14 @@ +ISC License (ISC) +Copyright (c) 2016-2017, Mark Wubben (novemberborn.net) + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/package-hash/README.md b/node_modules/package-hash/README.md new file mode 100644 index 0000000..2278164 --- /dev/null +++ b/node_modules/package-hash/README.md @@ -0,0 +1,79 @@ +# package-hash + +Generates a hash for an installed npm package, useful for salting caches. +[AVA](https://github.com/sindresorhus/ava) for example caches precompiled test +files. It generates a salt for its cache based on the various packages that are +used when compiling the test files. + +`package-hash` can generate an appropriate hash based on the package location +(on disk) and the `package.json` file. This hash is salted with a hash +for the `package-hash` itself. + +`package-hash` can detect when the package-to-be-hashed is a Git repository. In +the AVA example this is useful when you're debugging one of the packages used to +compile the test files. You can clone it locally and use `npm link` so AVA can +find the clone. The hash will include the HEAD (`.git/HEAD`) and its +corresponding ref (e.g. `.git/refs/heads/master`), any packed refs +(`.git/packed-refs`), as well as the diff (`git diff`) for any non-committed +changes. This makes it really easy to test your changes without having to +explicitly clear the cache in the parent project. + +## Installation + +```console +$ npm install --save package-hash +``` + +## Usage + +```js +const packageHash = require('package-hash') + +// Asynchronously: +const hash = await packageHash(require.resolve('babel-core/package.json')) + +// Synchronously: +const hash = packageHash.sync(require.resolve('babel-core/package.json')) +``` + +`packageHash()` / `packageHash.sync()` must be called with a file path for an +existing `package.json` file. To get the path to an npm package it's easiest to +use `require.resolve('the-name/package.json')`. + +You can provide multiple paths: + +```js +const hash = await packageHash([ + require.resolve('babel-core/package.json'), + require.resolve('babel-preset-es2015/package.json') +]) +``` + +An optional salt value can also be provided: + +```js +const hash = await packageHash(require.resolve('babel-core/package.json'), 'salt value') +``` + +## API + +### `packageHash(paths, salt?)` + +`paths: string | string[]` ➜ can be a single file path, or an array of paths. + +`salt: Array | Buffer | Object | string` ➜ optional. If an `Array` or `Object` (not `null`) it is first converted to a JSON string. + +Returns a promise for the hex-encoded hash string. + +### `packageHash.sync(paths, salt?)` + +`paths: string | string[]` ➜ can be a single file path, or an array of paths. + +`salt: Array | Buffer | Object | string` ➜ optional. If an `Array` or `Object` (not `null`) it is first converted to a JSON string. + +Returns a hex-encoded hash string. + +## Compatibility + +`package-hash` has been tested with Node.js 8 and above, including Windows +support. diff --git a/node_modules/package-hash/index.js b/node_modules/package-hash/index.js new file mode 100644 index 0000000..2d99262 --- /dev/null +++ b/node_modules/package-hash/index.js @@ -0,0 +1,162 @@ +'use strict' + +const cp = require('child_process') // eslint-disable-line security/detect-child-process +const path = require('path') +const {promisify} = require('util') + +const fs = require('graceful-fs') +const flattenDeep = require('lodash.flattendeep') +const hasha = require('hasha') +const releaseZalgo = require('release-zalgo') + +const PACKAGE_FILE = require.resolve('./package.json') +const TEN_MEBIBYTE = 1024 * 1024 * 10 +const execFile = promisify(cp.execFile) + +const readFile = { + async: promisify(fs.readFile), + sync: fs.readFileSync +} + +const tryReadFile = { + async (file) { + return readFile.async(file).catch(() => null) + }, + + sync (file) { + try { + return fs.readFileSync(file) + } catch (err) { + return null + } + } +} + +const tryExecFile = { + async (file, args, options) { + return execFile(file, args, options) + .then(({stdout}) => stdout) + .catch(() => null) + }, + + sync (file, args, options) { + try { + return cp.execFileSync(file, args, options) + } catch (err) { + return null + } + } +} + +const git = { + tryGetRef (zalgo, dir, head) { + const m = /^ref: (.+)$/.exec(head.toString('utf8').trim()) + if (!m) return null + + return zalgo.run(tryReadFile, path.join(dir, '.git', m[1])) + }, + + tryGetDiff (zalgo, dir) { + return zalgo.run(tryExecFile, + 'git', + // Attempt to get consistent output no matter the platform. Diff both + // staged and unstaged changes. + ['--no-pager', 'diff', 'HEAD', '--no-color', '--no-ext-diff'], + { + cwd: dir, + maxBuffer: TEN_MEBIBYTE, + env: Object.assign({}, process.env, { + // Force the GIT_DIR to prevent git from diffing a parent repository + // in case the directory isn't actually a repository. + GIT_DIR: path.join(dir, '.git') + }), + // Ignore stderr. + stdio: ['ignore', 'pipe', 'ignore'] + }) + } +} + +function addPackageData (zalgo, pkgPath) { + const dir = path.dirname(pkgPath) + + return zalgo.all([ + dir, + zalgo.run(readFile, pkgPath), + zalgo.run(tryReadFile, path.join(dir, '.git', 'HEAD')) + .then(head => { + if (!head) return [] + + return zalgo.all([ + zalgo.run(tryReadFile, path.join(dir, '.git', 'packed-refs')), + git.tryGetRef(zalgo, dir, head), + git.tryGetDiff(zalgo, dir) + ]) + .then(results => { + return [head].concat(results.filter(Boolean)) + }) + }) + ]) +} + +function computeHash (zalgo, paths, pepper, salt) { + const inputs = [] + if (pepper) inputs.push(pepper) + + if (typeof salt !== 'undefined') { + if (Buffer.isBuffer(salt) || typeof salt === 'string') { + inputs.push(salt) + } else if (typeof salt === 'object' && salt !== null) { + inputs.push(JSON.stringify(salt)) + } else { + throw new TypeError('Salt must be an Array, Buffer, Object or string') + } + } + + // TODO: Replace flattenDeep with Array#flat(Infinity) after node.js 10 is dropped + return zalgo.all(paths.map(pkgPath => addPackageData(zalgo, pkgPath))) + .then(furtherInputs => hasha(flattenDeep([inputs, furtherInputs]), {algorithm: 'sha256'})) +} + +let ownHash = null +let ownHashPromise = null +function run (zalgo, paths, salt) { + if (!ownHash) { + return zalgo.run({ + async () { + if (!ownHashPromise) { + ownHashPromise = computeHash(zalgo, [PACKAGE_FILE]) + } + return ownHashPromise + }, + sync () { + return computeHash(zalgo, [PACKAGE_FILE]) + } + }) + .then(hash => { + ownHash = Buffer.from(hash, 'hex') + ownHashPromise = null + return run(zalgo, paths, salt) + }) + } + + if (paths === PACKAGE_FILE && typeof salt === 'undefined') { + // Special case that allow the pepper value to be obtained. Mainly here for + // testing purposes. + return zalgo.returns(ownHash.toString('hex')) + } + + paths = Array.isArray(paths) ? paths : [paths] + return computeHash(zalgo, paths, ownHash, salt) +} + +module.exports = (paths, salt) => { + try { + return run(releaseZalgo.async(), paths, salt) + } catch (err) { + return Promise.reject(err) + } +} +module.exports.sync = (paths, salt) => { + const result = run(releaseZalgo.sync(), paths, salt) + return releaseZalgo.unwrapSync(result) +} diff --git a/node_modules/package-hash/package.json b/node_modules/package-hash/package.json new file mode 100644 index 0000000..a4b62db --- /dev/null +++ b/node_modules/package-hash/package.json @@ -0,0 +1,60 @@ +{ + "name": "package-hash", + "version": "4.0.0", + "description": "Generates a hash for an installed npm package, useful for salting caches", + "main": "index.js", + "files": [ + "index.js" + ], + "engines": { + "node": ">=8" + }, + "scripts": { + "lint": "as-i-preach", + "unpack-fixtures": "node scripts/unpack-fixtures.js", + "pregenerate-fixture-index": "npm run unpack-fixtures", + "generate-fixture-index": "node scripts/generate-fixture-index.js", + "pretest": "npm run unpack-fixtures", + "test": "ava", + "posttest": "npm run lint", + "coverage": "nyc npm test", + "watch:test": "npm run test -- --watch" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/novemberborn/package-hash.git" + }, + "author": "Mark Wubben (https://novemberborn.net/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/novemberborn/package-hash/issues" + }, + "homepage": "https://github.com/novemberborn/package-hash#readme", + "dependencies": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "devDependencies": { + "@novemberborn/as-i-preach": "^11.0.0", + "ava": "^1.4.1", + "codecov": "^3.3.0", + "nyc": "^13.3.0", + "rimraf": "^2.6.3", + "tar": "^4.4.8" + }, + "nyc": { + "cache": true, + "exclude": [ + "scripts", + "test" + ], + "reporter": [ + "html", + "lcov", + "text" + ] + }, + "standard-engine": "@novemberborn/as-i-preach" +} diff --git a/node_modules/package-json-from-dist/LICENSE.md b/node_modules/package-json-from-dist/LICENSE.md new file mode 100644 index 0000000..881248b --- /dev/null +++ b/node_modules/package-json-from-dist/LICENSE.md @@ -0,0 +1,63 @@ +All packages under `src/` are licensed according to the terms in +their respective `LICENSE` or `LICENSE.md` files. + +The remainder of this project is licensed under the Blue Oak +Model License, as follows: + +----- + +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node_modules/package-json-from-dist/README.md b/node_modules/package-json-from-dist/README.md new file mode 100644 index 0000000..a9e1344 --- /dev/null +++ b/node_modules/package-json-from-dist/README.md @@ -0,0 +1,110 @@ +# package-json-from-dist + +Sometimes you want to load the `package.json` into your +TypeScript program, and it's tempting to just `import +'../package.json'`, since that seems to work. + +However, this requires `tsc` to make an entire copy of your +`package.json` file into the `dist` folder, which is a problem if +you're using something like +[tshy](https://github.com/isaacs/tshy), which uses the +`package.json` file in dist for another purpose. Even when that +does work, it's asking the module system to do a bunch of extra +fs system calls, just to load a version number or something. (See +[this issue](https://github.com/isaacs/tshy/issues/61).) + +This module helps by just finding the package.json file +appropriately, and reading and parsing it in the most normal +fashion. + +## Caveats + +This _only_ works if your code builds into a target folder called +`dist`, which is in the root of the package. It also requires +that you do not have a folder named `node_modules` anywhere +within your dev environment, or else it'll get the wrong answers +there. (But, at least, that'll be in dev, so you're pretty likely +to notice.) + +If you build to some other location, then you'll need a different +approach. (Feel free to fork this module and make it your own, or +just put the code right inline, there's not much of it.) + +## USAGE + +```js +// src/index.ts +import { + findPackageJson, + loadPackageJson, +} from 'package-json-from-dist' + +const pj = findPackageJson(import.meta.url) +console.log(`package.json found at ${pj}`) + +const pkg = loadPackageJson(import.meta.url) +console.log(`Hello from ${pkg.name}@${pkg.version}`) +``` + +If your module is not directly in the `./src` folder, then you need +to specify the path that you would expect to find the +`package.json` when it's _not_ built to the `dist` folder. + +```js +// src/components/something.ts +import { + findPackageJson, + loadPackageJson, +} from 'package-json-from-dist' + +const pj = findPackageJson(import.meta.url, '../../package.json') +console.log(`package.json found at ${pj}`) + +const pkg = loadPackageJson(import.meta.url, '../../package.json') +console.log(`Hello from ${pkg.name}@${pkg.version}`) +``` + +When running from CommmonJS, use `__filename` instead of +`import.meta.url`. + +```js +// src/index.cts +import { + findPackageJson, + loadPackageJson, +} from 'package-json-from-dist' + +const pj = findPackageJson(__filename) +console.log(`package.json found at ${pj}`) + +const pkg = loadPackageJson(__filename) +console.log(`Hello from ${pkg.name}@${pkg.version}`) +``` + +Since [tshy](https://github.com/isaacs/tshy) builds _both_ +CommonJS and ESM by default, you may find that you need a +CommonJS override and some `//@ts-ignore` magic to make it work. + +`src/pkg.ts`: + +```js +import { + findPackageJson, + loadPackageJson, +} from 'package-json-from-dist' +//@ts-ignore +export const pkg = loadPackageJson(import.meta.url) +//@ts-ignore +export const pj = findPackageJson(import.meta.url) +``` + +`src/pkg-cjs.cts`: + +```js +import { + findPackageJson, + loadPackageJson, +} from 'package-json-from-dist' +export const pkg = loadPackageJson(__filename) +export const pj = findPackageJson(__filename) +``` diff --git a/node_modules/package-json-from-dist/dist/commonjs/index.d.ts b/node_modules/package-json-from-dist/dist/commonjs/index.d.ts new file mode 100644 index 0000000..d486ffd --- /dev/null +++ b/node_modules/package-json-from-dist/dist/commonjs/index.d.ts @@ -0,0 +1,89 @@ +/** + * Find the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url) + * console.log(`package.json found at ${pj}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url, '../../package.json') + * console.log(`package.json found at ${pj}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(__filename) + * console.log(`package.json found at ${pj}`) + * ``` + */ +export declare const findPackageJson: (from: string | URL, pathFromSrc?: string) => string; +/** + * Load the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url, '../../package.json') + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(__filename) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + */ +export declare const loadPackageJson: (from: string | URL, pathFromSrc?: string) => any; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map b/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..ca3e21c --- /dev/null +++ b/node_modules/package-json-from-dist/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,KAClB,MAsCF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,QAEiD,CAAA"} \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/commonjs/index.js b/node_modules/package-json-from-dist/dist/commonjs/index.js new file mode 100644 index 0000000..b966ac9 --- /dev/null +++ b/node_modules/package-json-from-dist/dist/commonjs/index.js @@ -0,0 +1,134 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadPackageJson = exports.findPackageJson = void 0; +const node_fs_1 = require("node:fs"); +const node_path_1 = require("node:path"); +const node_url_1 = require("node:url"); +const NM = `${node_path_1.sep}node_modules${node_path_1.sep}`; +const STORE = `.store${node_path_1.sep}`; +const PKG = `${node_path_1.sep}package${node_path_1.sep}`; +const DIST = `${node_path_1.sep}dist${node_path_1.sep}`; +/** + * Find the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url) + * console.log(`package.json found at ${pj}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url, '../../package.json') + * console.log(`package.json found at ${pj}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(__filename) + * console.log(`package.json found at ${pj}`) + * ``` + */ +const findPackageJson = (from, pathFromSrc = '../package.json') => { + const f = typeof from === 'object' || from.startsWith('file://') ? + (0, node_url_1.fileURLToPath)(from) + : from; + const __dirname = (0, node_path_1.dirname)(f); + const nms = __dirname.lastIndexOf(NM); + if (nms !== -1) { + // inside of node_modules. find the dist directly under package name. + const nm = __dirname.substring(0, nms + NM.length); + const pkgDir = __dirname.substring(nms + NM.length); + // affordance for yarn berry, which puts package contents in + // '.../node_modules/.store/${id}-${hash}/package/...' + if (pkgDir.startsWith(STORE)) { + const pkg = pkgDir.indexOf(PKG, STORE.length); + if (pkg) { + return (0, node_path_1.resolve)(nm, pkgDir.substring(0, pkg + PKG.length), 'package.json'); + } + } + const pkgName = pkgDir.startsWith('@') ? + pkgDir.split(node_path_1.sep, 2).join(node_path_1.sep) + : String(pkgDir.split(node_path_1.sep)[0]); + return (0, node_path_1.resolve)(nm, pkgName, 'package.json'); + } + else { + // see if we are in a dist folder. + const d = __dirname.lastIndexOf(DIST); + if (d !== -1) { + return (0, node_path_1.resolve)(__dirname.substring(0, d), 'package.json'); + } + else { + return (0, node_path_1.resolve)(__dirname, pathFromSrc); + } + } +}; +exports.findPackageJson = findPackageJson; +/** + * Load the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url, '../../package.json') + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(__filename) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + */ +const loadPackageJson = (from, pathFromSrc = '../package.json') => JSON.parse((0, node_fs_1.readFileSync)((0, exports.findPackageJson)(from, pathFromSrc), 'utf8')); +exports.loadPackageJson = loadPackageJson; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/commonjs/index.js.map b/node_modules/package-json-from-dist/dist/commonjs/index.js.map new file mode 100644 index 0000000..2fb5d23 --- /dev/null +++ b/node_modules/package-json-from-dist/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AACtC,yCAAiD;AACjD,uCAAwC;AAExC,MAAM,EAAE,GAAG,GAAG,eAAG,eAAe,eAAG,EAAE,CAAA;AACrC,MAAM,KAAK,GAAG,SAAS,eAAG,EAAE,CAAA;AAC5B,MAAM,GAAG,GAAG,GAAG,eAAG,UAAU,eAAG,EAAE,CAAA;AACjC,MAAM,IAAI,GAAG,GAAG,eAAG,OAAO,eAAG,EAAE,CAAA;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACI,MAAM,eAAe,GAAG,CAC7B,IAAkB,EAClB,cAAsB,iBAAiB,EAC/B,EAAE;IACV,MAAM,CAAC,GACL,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QACtD,IAAA,wBAAa,EAAC,IAAI,CAAC;QACrB,CAAC,CAAC,IAAI,CAAA;IACR,MAAM,SAAS,GAAG,IAAA,mBAAO,EAAC,CAAC,CAAC,CAAA;IAE5B,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IACrC,IAAI,GAAG,KAAK,CAAC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AAS,EAAE,WAAW,CAAC,CAAA;QACxC,CAAC;IACH,CAAC;AACH,CAAC,CAAA;AAzCY,QAAA,eAAe,mBAyC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACI,MAAM,eAAe,GAAG,CAC7B,IAAkB,EAClB,cAAsB,iBAAiB,EACvC,EAAE,CACF,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAA,uBAAe,EAAC,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;AAJzD,QAAA,eAAe,mBAI0C","sourcesContent":["import { readFileSync } from 'node:fs'\nimport { dirname, resolve, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst NM = `${sep}node_modules${sep}`\nconst STORE = `.store${sep}`\nconst PKG = `${sep}package${sep}`\nconst DIST = `${sep}dist${sep}`\n\n/**\n * Find the package.json file, either from a TypeScript file somewhere not\n * in a 'dist' folder, or a built and/or installed 'dist' folder.\n *\n * Note: this *only* works if you build your code into `'./dist'`, and that the\n * source path does not also contain `'dist'`! If you don't build into\n * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will\n * not work properly!\n *\n * The default `pathFromSrc` option assumes that the calling code lives one\n * folder below the root of the package. Otherwise, it must be specified.\n *\n * Example:\n *\n * ```ts\n * // src/index.ts\n * import { findPackageJson } from 'package-json-from-dist'\n *\n * const pj = findPackageJson(import.meta.url)\n * console.log(`package.json found at ${pj}`)\n * ```\n *\n * If the caller is deeper within the project source, then you must provide\n * the appropriate fallback path:\n *\n * ```ts\n * // src/components/something.ts\n * import { findPackageJson } from 'package-json-from-dist'\n *\n * const pj = findPackageJson(import.meta.url, '../../package.json')\n * console.log(`package.json found at ${pj}`)\n * ```\n *\n * When running from CommmonJS, use `__filename` instead of `import.meta.url`\n *\n * ```ts\n * // src/index.cts\n * import { findPackageJson } from 'package-json-from-dist'\n *\n * const pj = findPackageJson(__filename)\n * console.log(`package.json found at ${pj}`)\n * ```\n */\nexport const findPackageJson = (\n from: string | URL,\n pathFromSrc: string = '../package.json',\n): string => {\n const f =\n typeof from === 'object' || from.startsWith('file://') ?\n fileURLToPath(from)\n : from\n const __dirname = dirname(f)\n\n const nms = __dirname.lastIndexOf(NM)\n if (nms !== -1) {\n // inside of node_modules. find the dist directly under package name.\n const nm = __dirname.substring(0, nms + NM.length)\n const pkgDir = __dirname.substring(nms + NM.length)\n // affordance for yarn berry, which puts package contents in\n // '.../node_modules/.store/${id}-${hash}/package/...'\n if (pkgDir.startsWith(STORE)) {\n const pkg = pkgDir.indexOf(PKG, STORE.length)\n if (pkg) {\n return resolve(\n nm,\n pkgDir.substring(0, pkg + PKG.length),\n 'package.json',\n )\n }\n }\n const pkgName =\n pkgDir.startsWith('@') ?\n pkgDir.split(sep, 2).join(sep)\n : String(pkgDir.split(sep)[0])\n return resolve(nm, pkgName, 'package.json')\n } else {\n // see if we are in a dist folder.\n const d = __dirname.lastIndexOf(DIST)\n if (d !== -1) {\n return resolve(__dirname.substring(0, d), 'package.json')\n } else {\n return resolve(__dirname, pathFromSrc)\n }\n }\n}\n\n/**\n * Load the package.json file, either from a TypeScript file somewhere not\n * in a 'dist' folder, or a built and/or installed 'dist' folder.\n *\n * Note: this *only* works if you build your code into `'./dist'`, and that the\n * source path does not also contain `'dist'`! If you don't build into\n * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will\n * not work properly!\n *\n * The default `pathFromSrc` option assumes that the calling code lives one\n * folder below the root of the package. Otherwise, it must be specified.\n *\n * Example:\n *\n * ```ts\n * // src/index.ts\n * import { loadPackageJson } from 'package-json-from-dist'\n *\n * const pj = loadPackageJson(import.meta.url)\n * console.log(`Hello from ${pj.name}@${pj.version}`)\n * ```\n *\n * If the caller is deeper within the project source, then you must provide\n * the appropriate fallback path:\n *\n * ```ts\n * // src/components/something.ts\n * import { loadPackageJson } from 'package-json-from-dist'\n *\n * const pj = loadPackageJson(import.meta.url, '../../package.json')\n * console.log(`Hello from ${pj.name}@${pj.version}`)\n * ```\n *\n * When running from CommmonJS, use `__filename` instead of `import.meta.url`\n *\n * ```ts\n * // src/index.cts\n * import { loadPackageJson } from 'package-json-from-dist'\n *\n * const pj = loadPackageJson(__filename)\n * console.log(`Hello from ${pj.name}@${pj.version}`)\n * ```\n */\nexport const loadPackageJson = (\n from: string | URL,\n pathFromSrc: string = '../package.json',\n) =>\n JSON.parse(readFileSync(findPackageJson(from, pathFromSrc), 'utf8'))\n"]} \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/commonjs/package.json b/node_modules/package-json-from-dist/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/package-json-from-dist/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/package-json-from-dist/dist/esm/index.d.ts b/node_modules/package-json-from-dist/dist/esm/index.d.ts new file mode 100644 index 0000000..d486ffd --- /dev/null +++ b/node_modules/package-json-from-dist/dist/esm/index.d.ts @@ -0,0 +1,89 @@ +/** + * Find the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url) + * console.log(`package.json found at ${pj}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url, '../../package.json') + * console.log(`package.json found at ${pj}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(__filename) + * console.log(`package.json found at ${pj}`) + * ``` + */ +export declare const findPackageJson: (from: string | URL, pathFromSrc?: string) => string; +/** + * Load the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url, '../../package.json') + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(__filename) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + */ +export declare const loadPackageJson: (from: string | URL, pathFromSrc?: string) => any; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/esm/index.d.ts.map b/node_modules/package-json-from-dist/dist/esm/index.d.ts.map new file mode 100644 index 0000000..ca3e21c --- /dev/null +++ b/node_modules/package-json-from-dist/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,KAClB,MAsCF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,SACpB,MAAM,GAAG,GAAG,gBACL,MAAM,QAEiD,CAAA"} \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/esm/index.js b/node_modules/package-json-from-dist/dist/esm/index.js new file mode 100644 index 0000000..426ad3c --- /dev/null +++ b/node_modules/package-json-from-dist/dist/esm/index.js @@ -0,0 +1,129 @@ +import { readFileSync } from 'node:fs'; +import { dirname, resolve, sep } from 'node:path'; +import { fileURLToPath } from 'node:url'; +const NM = `${sep}node_modules${sep}`; +const STORE = `.store${sep}`; +const PKG = `${sep}package${sep}`; +const DIST = `${sep}dist${sep}`; +/** + * Find the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url) + * console.log(`package.json found at ${pj}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(import.meta.url, '../../package.json') + * console.log(`package.json found at ${pj}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { findPackageJson } from 'package-json-from-dist' + * + * const pj = findPackageJson(__filename) + * console.log(`package.json found at ${pj}`) + * ``` + */ +export const findPackageJson = (from, pathFromSrc = '../package.json') => { + const f = typeof from === 'object' || from.startsWith('file://') ? + fileURLToPath(from) + : from; + const __dirname = dirname(f); + const nms = __dirname.lastIndexOf(NM); + if (nms !== -1) { + // inside of node_modules. find the dist directly under package name. + const nm = __dirname.substring(0, nms + NM.length); + const pkgDir = __dirname.substring(nms + NM.length); + // affordance for yarn berry, which puts package contents in + // '.../node_modules/.store/${id}-${hash}/package/...' + if (pkgDir.startsWith(STORE)) { + const pkg = pkgDir.indexOf(PKG, STORE.length); + if (pkg) { + return resolve(nm, pkgDir.substring(0, pkg + PKG.length), 'package.json'); + } + } + const pkgName = pkgDir.startsWith('@') ? + pkgDir.split(sep, 2).join(sep) + : String(pkgDir.split(sep)[0]); + return resolve(nm, pkgName, 'package.json'); + } + else { + // see if we are in a dist folder. + const d = __dirname.lastIndexOf(DIST); + if (d !== -1) { + return resolve(__dirname.substring(0, d), 'package.json'); + } + else { + return resolve(__dirname, pathFromSrc); + } + } +}; +/** + * Load the package.json file, either from a TypeScript file somewhere not + * in a 'dist' folder, or a built and/or installed 'dist' folder. + * + * Note: this *only* works if you build your code into `'./dist'`, and that the + * source path does not also contain `'dist'`! If you don't build into + * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will + * not work properly! + * + * The default `pathFromSrc` option assumes that the calling code lives one + * folder below the root of the package. Otherwise, it must be specified. + * + * Example: + * + * ```ts + * // src/index.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * If the caller is deeper within the project source, then you must provide + * the appropriate fallback path: + * + * ```ts + * // src/components/something.ts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(import.meta.url, '../../package.json') + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + * + * When running from CommmonJS, use `__filename` instead of `import.meta.url` + * + * ```ts + * // src/index.cts + * import { loadPackageJson } from 'package-json-from-dist' + * + * const pj = loadPackageJson(__filename) + * console.log(`Hello from ${pj.name}@${pj.version}`) + * ``` + */ +export const loadPackageJson = (from, pathFromSrc = '../package.json') => JSON.parse(readFileSync(findPackageJson(from, pathFromSrc), 'utf8')); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/esm/index.js.map b/node_modules/package-json-from-dist/dist/esm/index.js.map new file mode 100644 index 0000000..53b6ce7 --- /dev/null +++ b/node_modules/package-json-from-dist/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,EAAE,GAAG,GAAG,GAAG,eAAe,GAAG,EAAE,CAAA;AACrC,MAAM,KAAK,GAAG,SAAS,GAAG,EAAE,CAAA;AAC5B,MAAM,GAAG,GAAG,GAAG,GAAG,UAAU,GAAG,EAAE,CAAA;AACjC,MAAM,IAAI,GAAG,GAAG,GAAG,OAAO,GAAG,EAAE,CAAA;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAkB,EAClB,cAAsB,iBAAiB,EAC/B,EAAE;IACV,MAAM,CAAC,GACL,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QACtD,aAAa,CAAC,IAAI,CAAC;QACrB,CAAC,CAAC,IAAI,CAAA;IACR,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAE5B,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IACrC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,qEAAqE;QACrE,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA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G,CAC7B,IAAkB,EAClB,cAAsB,iBAAiB,EACvC,EAAE,CACF,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA","sourcesContent":["import { readFileSync } from 'node:fs'\nimport { dirname, resolve, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst NM = `${sep}node_modules${sep}`\nconst STORE = `.store${sep}`\nconst PKG = `${sep}package${sep}`\nconst DIST = `${sep}dist${sep}`\n\n/**\n * Find the package.json file, either from a TypeScript file somewhere not\n * in a 'dist' folder, or a built and/or installed 'dist' folder.\n *\n * Note: this *only* works if you build your code into `'./dist'`, and that the\n * source path does not also contain `'dist'`! If you don't build into\n * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will\n * not work properly!\n *\n * The default `pathFromSrc` option assumes that the calling code lives one\n * folder below the root of the package. Otherwise, it must be specified.\n *\n * Example:\n *\n * ```ts\n * // src/index.ts\n * import { findPackageJson } from 'package-json-from-dist'\n *\n * const pj = findPackageJson(import.meta.url)\n * console.log(`package.json found at ${pj}`)\n * ```\n *\n * If the caller is deeper within the project source, then you must provide\n * the appropriate fallback path:\n *\n * ```ts\n * // src/components/something.ts\n * import { findPackageJson } from 'package-json-from-dist'\n *\n * const pj = findPackageJson(import.meta.url, '../../package.json')\n * console.log(`package.json found at ${pj}`)\n * ```\n *\n * When running from CommmonJS, use `__filename` instead of `import.meta.url`\n *\n * ```ts\n * // src/index.cts\n * import { findPackageJson } from 'package-json-from-dist'\n *\n * const pj = findPackageJson(__filename)\n * console.log(`package.json found at ${pj}`)\n * ```\n */\nexport const findPackageJson = (\n from: string | URL,\n pathFromSrc: string = '../package.json',\n): string => {\n const f =\n typeof from === 'object' || from.startsWith('file://') ?\n fileURLToPath(from)\n : from\n const __dirname = dirname(f)\n\n const nms = __dirname.lastIndexOf(NM)\n if (nms !== -1) {\n // inside of node_modules. find the dist directly under package name.\n const nm = __dirname.substring(0, nms + NM.length)\n const pkgDir = __dirname.substring(nms + NM.length)\n // affordance for yarn berry, which puts package contents in\n // '.../node_modules/.store/${id}-${hash}/package/...'\n if (pkgDir.startsWith(STORE)) {\n const pkg = pkgDir.indexOf(PKG, STORE.length)\n if (pkg) {\n return resolve(\n nm,\n pkgDir.substring(0, pkg + PKG.length),\n 'package.json',\n )\n }\n }\n const pkgName =\n pkgDir.startsWith('@') ?\n pkgDir.split(sep, 2).join(sep)\n : String(pkgDir.split(sep)[0])\n return resolve(nm, pkgName, 'package.json')\n } else {\n // see if we are in a dist folder.\n const d = __dirname.lastIndexOf(DIST)\n if (d !== -1) {\n return resolve(__dirname.substring(0, d), 'package.json')\n } else {\n return resolve(__dirname, pathFromSrc)\n }\n }\n}\n\n/**\n * Load the package.json file, either from a TypeScript file somewhere not\n * in a 'dist' folder, or a built and/or installed 'dist' folder.\n *\n * Note: this *only* works if you build your code into `'./dist'`, and that the\n * source path does not also contain `'dist'`! If you don't build into\n * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will\n * not work properly!\n *\n * The default `pathFromSrc` option assumes that the calling code lives one\n * folder below the root of the package. Otherwise, it must be specified.\n *\n * Example:\n *\n * ```ts\n * // src/index.ts\n * import { loadPackageJson } from 'package-json-from-dist'\n *\n * const pj = loadPackageJson(import.meta.url)\n * console.log(`Hello from ${pj.name}@${pj.version}`)\n * ```\n *\n * If the caller is deeper within the project source, then you must provide\n * the appropriate fallback path:\n *\n * ```ts\n * // src/components/something.ts\n * import { loadPackageJson } from 'package-json-from-dist'\n *\n * const pj = loadPackageJson(import.meta.url, '../../package.json')\n * console.log(`Hello from ${pj.name}@${pj.version}`)\n * ```\n *\n * When running from CommmonJS, use `__filename` instead of `import.meta.url`\n *\n * ```ts\n * // src/index.cts\n * import { loadPackageJson } from 'package-json-from-dist'\n *\n * const pj = loadPackageJson(__filename)\n * console.log(`Hello from ${pj.name}@${pj.version}`)\n * ```\n */\nexport const loadPackageJson = (\n from: string | URL,\n pathFromSrc: string = '../package.json',\n) =>\n JSON.parse(readFileSync(findPackageJson(from, pathFromSrc), 'utf8'))\n"]} \ No newline at end of file diff --git a/node_modules/package-json-from-dist/dist/esm/package.json b/node_modules/package-json-from-dist/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/package-json-from-dist/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/package-json-from-dist/package.json b/node_modules/package-json-from-dist/package.json new file mode 100644 index 0000000..a2d03c3 --- /dev/null +++ b/node_modules/package-json-from-dist/package.json @@ -0,0 +1,68 @@ +{ + "name": "package-json-from-dist", + "version": "1.0.1", + "description": "Load the local package.json from either src or dist folder", + "main": "./dist/commonjs/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --log-level warn", + "typedoc": "typedoc" + }, + "author": "Isaac Z. Schlueter (https://izs.me)", + "license": "BlueOak-1.0.0", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/package-json-from-dist.git" + }, + "devDependencies": { + "@types/node": "^20.12.12", + "prettier": "^3.2.5", + "tap": "^18.5.3", + "typedoc": "^0.24.8", + "typescript": "^5.1.6", + "tshy": "^1.14.0" + }, + "prettier": { + "semi": false, + "printWidth": 70, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf", + "experimentalTernaries": true + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "types": "./dist/commonjs/index.d.ts", + "type": "module" +} diff --git a/node_modules/parseurl/HISTORY.md b/node_modules/parseurl/HISTORY.md new file mode 100644 index 0000000..8e40954 --- /dev/null +++ b/node_modules/parseurl/HISTORY.md @@ -0,0 +1,58 @@ +1.3.3 / 2019-04-15 +================== + + * Fix Node.js 0.8 return value inconsistencies + +1.3.2 / 2017-09-09 +================== + + * perf: reduce overhead for full URLs + * perf: unroll the "fast-path" `RegExp` + +1.3.1 / 2016-01-17 +================== + + * perf: enable strict mode + +1.3.0 / 2014-08-09 +================== + + * Add `parseurl.original` for parsing `req.originalUrl` with fallback + * Return `undefined` if `req.url` is `undefined` + +1.2.0 / 2014-07-21 +================== + + * Cache URLs based on original value + * Remove no-longer-needed URL mis-parse work-around + * Simplify the "fast-path" `RegExp` + +1.1.3 / 2014-07-08 +================== + + * Fix typo + +1.1.2 / 2014-07-08 +================== + + * Seriously fix Node.js 0.8 compatibility + +1.1.1 / 2014-07-08 +================== + + * Fix Node.js 0.8 compatibility + +1.1.0 / 2014-07-08 +================== + + * Incorporate URL href-only parse fast-path + +1.0.1 / 2014-03-08 +================== + + * Add missing `require` + +1.0.0 / 2014-03-08 +================== + + * Genesis from `connect` diff --git a/node_modules/parseurl/LICENSE b/node_modules/parseurl/LICENSE new file mode 100644 index 0000000..27653d3 --- /dev/null +++ b/node_modules/parseurl/LICENSE @@ -0,0 +1,24 @@ + +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/parseurl/README.md b/node_modules/parseurl/README.md new file mode 100644 index 0000000..443e716 --- /dev/null +++ b/node_modules/parseurl/README.md @@ -0,0 +1,133 @@ +# parseurl + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Parse a URL with memoization. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install parseurl +``` + +## API + +```js +var parseurl = require('parseurl') +``` + +### parseurl(req) + +Parse the URL of the given request object (looks at the `req.url` property) +and return the result. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.url` does +not change will return a cached parsed object, rather than parsing again. + +### parseurl.original(req) + +Parse the original URL of the given request object and return the result. +This works by trying to parse `req.originalUrl` if it is a string, otherwise +parses `req.url`. The result is the same as `url.parse` in Node.js core. +Calling this function multiple times on the same `req` where `req.originalUrl` +does not change will return a cached parsed object, rather than parsing again. + +## Benchmark + +```bash +$ npm run-script bench + +> parseurl@1.3.3 bench nodejs-parseurl +> node benchmark/index.js + + http_parser@2.8.0 + node@10.6.0 + v8@6.7.288.46-node.13 + uv@1.21.0 + zlib@1.2.11 + ares@1.14.0 + modules@64 + nghttp2@1.32.0 + napi@3 + openssl@1.1.0h + icu@61.1 + unicode@10.0 + cldr@33.0 + tz@2018c + +> node benchmark/fullurl.js + + Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy" + + 4 tests completed. + + fasturl x 2,207,842 ops/sec ±3.76% (184 runs sampled) + nativeurl - legacy x 507,180 ops/sec ±0.82% (191 runs sampled) + nativeurl - whatwg x 290,044 ops/sec ±1.96% (189 runs sampled) + parseurl x 488,907 ops/sec ±2.13% (192 runs sampled) + +> node benchmark/pathquery.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" + + 4 tests completed. + + fasturl x 3,812,564 ops/sec ±3.15% (188 runs sampled) + nativeurl - legacy x 2,651,631 ops/sec ±1.68% (189 runs sampled) + nativeurl - whatwg x 161,837 ops/sec ±2.26% (189 runs sampled) + parseurl x 4,166,338 ops/sec ±2.23% (184 runs sampled) + +> node benchmark/samerequest.js + + Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object + + 4 tests completed. + + fasturl x 3,821,651 ops/sec ±2.42% (185 runs sampled) + nativeurl - legacy x 2,651,162 ops/sec ±1.90% (187 runs sampled) + nativeurl - whatwg x 175,166 ops/sec ±1.44% (188 runs sampled) + parseurl x 14,912,606 ops/sec ±3.59% (183 runs sampled) + +> node benchmark/simplepath.js + + Parsing URL "/foo/bar" + + 4 tests completed. + + fasturl x 12,421,765 ops/sec ±2.04% (191 runs sampled) + nativeurl - legacy x 7,546,036 ops/sec ±1.41% (188 runs sampled) + nativeurl - whatwg x 198,843 ops/sec ±1.83% (189 runs sampled) + parseurl x 24,244,006 ops/sec ±0.51% (194 runs sampled) + +> node benchmark/slash.js + + Parsing URL "/" + + 4 tests completed. + + fasturl x 17,159,456 ops/sec ±3.25% (188 runs sampled) + nativeurl - legacy x 11,635,097 ops/sec ±3.79% (184 runs sampled) + nativeurl - whatwg x 240,693 ops/sec ±0.83% (189 runs sampled) + parseurl x 42,279,067 ops/sec ±0.55% (190 runs sampled) +``` + +## License + + [MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/parseurl/master +[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master +[node-image]: https://badgen.net/npm/node/parseurl +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/parseurl +[npm-url]: https://npmjs.org/package/parseurl +[npm-version-image]: https://badgen.net/npm/v/parseurl +[travis-image]: https://badgen.net/travis/pillarjs/parseurl/master +[travis-url]: https://travis-ci.org/pillarjs/parseurl diff --git a/node_modules/parseurl/index.js b/node_modules/parseurl/index.js new file mode 100644 index 0000000..ece7223 --- /dev/null +++ b/node_modules/parseurl/index.js @@ -0,0 +1,158 @@ +/*! + * parseurl + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var url = require('url') +var parse = url.parse +var Url = url.Url + +/** + * Module exports. + * @public + */ + +module.exports = parseurl +module.exports.original = originalurl + +/** + * Parse the `req` url with memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function parseurl (req) { + var url = req.url + + if (url === undefined) { + // URL is undefined + return undefined + } + + var parsed = req._parsedUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedUrl = parsed) +}; + +/** + * Parse the `req` original url with fallback and memoization. + * + * @param {ServerRequest} req + * @return {Object} + * @public + */ + +function originalurl (req) { + var url = req.originalUrl + + if (typeof url !== 'string') { + // Fallback + return parseurl(req) + } + + var parsed = req._parsedOriginalUrl + + if (fresh(url, parsed)) { + // Return cached URL parse + return parsed + } + + // Parse the URL + parsed = fastparse(url) + parsed._raw = url + + return (req._parsedOriginalUrl = parsed) +}; + +/** + * Parse the `str` url with fast-path short-cut. + * + * @param {string} str + * @return {Object} + * @private + */ + +function fastparse (str) { + if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) { + return parse(str) + } + + var pathname = str + var query = null + var search = null + + // This takes the regexp from https://github.com/joyent/node/pull/7878 + // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/ + // And unrolls it into a for loop + for (var i = 1; i < str.length; i++) { + switch (str.charCodeAt(i)) { + case 0x3f: /* ? */ + if (search === null) { + pathname = str.substring(0, i) + query = str.substring(i + 1) + search = str.substring(i) + } + break + case 0x09: /* \t */ + case 0x0a: /* \n */ + case 0x0c: /* \f */ + case 0x0d: /* \r */ + case 0x20: /* */ + case 0x23: /* # */ + case 0xa0: + case 0xfeff: + return parse(str) + } + } + + var url = Url !== undefined + ? new Url() + : {} + + url.path = str + url.href = str + url.pathname = pathname + + if (search !== null) { + url.query = query + url.search = search + } + + return url +} + +/** + * Determine if parsed is still fresh for url. + * + * @param {string} url + * @param {object} parsedUrl + * @return {boolean} + * @private + */ + +function fresh (url, parsedUrl) { + return typeof parsedUrl === 'object' && + parsedUrl !== null && + (Url === undefined || parsedUrl instanceof Url) && + parsedUrl._raw === url +} diff --git a/node_modules/parseurl/package.json b/node_modules/parseurl/package.json new file mode 100644 index 0000000..6b443ca --- /dev/null +++ b/node_modules/parseurl/package.json @@ -0,0 +1,40 @@ +{ + "name": "parseurl", + "description": "parse a url with memoization", + "version": "1.3.3", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "repository": "pillarjs/parseurl", + "license": "MIT", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-import": "2.17.1", + "eslint-plugin-node": "7.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "fast-url-parser": "1.1.3", + "istanbul": "0.4.5", + "mocha": "6.1.3" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --check-leaks --bail --reporter spec test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" + } +} diff --git a/node_modules/path-exists/index.d.ts b/node_modules/path-exists/index.d.ts new file mode 100644 index 0000000..54b7ab8 --- /dev/null +++ b/node_modules/path-exists/index.d.ts @@ -0,0 +1,28 @@ +declare const pathExists: { + /** + Check if a path exists. + + @returns Whether the path exists. + + @example + ``` + // foo.ts + import pathExists = require('path-exists'); + + (async () => { + console.log(await pathExists('foo.ts')); + //=> true + })(); + ``` + */ + (path: string): Promise; + + /** + Synchronously check if a path exists. + + @returns Whether the path exists. + */ + sync(path: string): boolean; +}; + +export = pathExists; diff --git a/node_modules/path-exists/index.js b/node_modules/path-exists/index.js new file mode 100644 index 0000000..1943921 --- /dev/null +++ b/node_modules/path-exists/index.js @@ -0,0 +1,23 @@ +'use strict'; +const fs = require('fs'); +const {promisify} = require('util'); + +const pAccess = promisify(fs.access); + +module.exports = async path => { + try { + await pAccess(path); + return true; + } catch (_) { + return false; + } +}; + +module.exports.sync = path => { + try { + fs.accessSync(path); + return true; + } catch (_) { + return false; + } +}; diff --git a/node_modules/path-exists/license b/node_modules/path-exists/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/path-exists/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-exists/package.json b/node_modules/path-exists/package.json new file mode 100644 index 0000000..0755256 --- /dev/null +++ b/node_modules/path-exists/package.json @@ -0,0 +1,39 @@ +{ + "name": "path-exists", + "version": "4.0.0", + "description": "Check if a path exists", + "license": "MIT", + "repository": "sindresorhus/path-exists", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "exists", + "exist", + "file", + "filepath", + "fs", + "filesystem", + "file-system", + "access", + "stat" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/path-exists/readme.md b/node_modules/path-exists/readme.md new file mode 100644 index 0000000..81f9845 --- /dev/null +++ b/node_modules/path-exists/readme.md @@ -0,0 +1,52 @@ +# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists) + +> Check if a path exists + +NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed. + +While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it. + +Never use this before handling a file though: + +> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there. + + +## Install + +``` +$ npm install path-exists +``` + + +## Usage + +```js +// foo.js +const pathExists = require('path-exists'); + +(async () => { + console.log(await pathExists('foo.js')); + //=> true +})(); +``` + + +## API + +### pathExists(path) + +Returns a `Promise` of whether the path exists. + +### pathExists.sync(path) + +Returns a `boolean` of whether the path exists. + + +## Related + +- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js new file mode 100644 index 0000000..22aa6c3 --- /dev/null +++ b/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +} + +function win32(path) { + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = Boolean(device && device.charAt(1) !== ':'); + + // UNC paths are always absolute + return Boolean(result[2] || isUnc); +} + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/node_modules/path-is-absolute/license b/node_modules/path-is-absolute/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json new file mode 100644 index 0000000..91196d5 --- /dev/null +++ b/node_modules/path-is-absolute/package.json @@ -0,0 +1,43 @@ +{ + "name": "path-is-absolute", + "version": "1.0.1", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": "sindresorhus/path-is-absolute", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "devDependencies": { + "xo": "^0.16.0" + } +} diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md new file mode 100644 index 0000000..8dbdf5f --- /dev/null +++ b/node_modules/path-is-absolute/readme.md @@ -0,0 +1,59 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +const pathIsAbsolute = require('path-is-absolute'); + +// Running on Linux +pathIsAbsolute('/home/foo'); +//=> true +pathIsAbsolute('C:/Users/foo'); +//=> false + +// Running on Windows +pathIsAbsolute('C:/Users/foo'); +//=> true +pathIsAbsolute('/home/foo'); +//=> false + +// Running on any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +POSIX specific version. + +### pathIsAbsolute.win32(path) + +Windows specific version. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-key/index.d.ts b/node_modules/path-key/index.d.ts new file mode 100644 index 0000000..7c575d1 --- /dev/null +++ b/node_modules/path-key/index.d.ts @@ -0,0 +1,40 @@ +/// + +declare namespace pathKey { + interface Options { + /** + Use a custom environment variables object. Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env). + */ + readonly env?: {[key: string]: string | undefined}; + + /** + Get the PATH key for a specific platform. Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform). + */ + readonly platform?: NodeJS.Platform; + } +} + +declare const pathKey: { + /** + Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform. + + @example + ``` + import pathKey = require('path-key'); + + const key = pathKey(); + //=> 'PATH' + + const PATH = process.env[key]; + //=> '/usr/local/bin:/usr/bin:/bin' + ``` + */ + (options?: pathKey.Options): string; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function pathKey(options?: pathKey.Options): string; + // export = pathKey; + default: typeof pathKey; +}; + +export = pathKey; diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js new file mode 100644 index 0000000..0cf6415 --- /dev/null +++ b/node_modules/path-key/index.js @@ -0,0 +1,16 @@ +'use strict'; + +const pathKey = (options = {}) => { + const environment = options.env || process.env; + const platform = options.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; + } + + return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path'; +}; + +module.exports = pathKey; +// TODO: Remove this for the next major release +module.exports.default = pathKey; diff --git a/node_modules/path-key/license b/node_modules/path-key/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/path-key/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json new file mode 100644 index 0000000..c8cbd38 --- /dev/null +++ b/node_modules/path-key/package.json @@ -0,0 +1,39 @@ +{ + "name": "path-key", + "version": "3.1.1", + "description": "Get the PATH environment variable key cross-platform", + "license": "MIT", + "repository": "sindresorhus/path-key", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "path", + "key", + "environment", + "env", + "variable", + "var", + "get", + "cross-platform", + "windows" + ], + "devDependencies": { + "@types/node": "^11.13.0", + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md new file mode 100644 index 0000000..a9052d7 --- /dev/null +++ b/node_modules/path-key/readme.md @@ -0,0 +1,61 @@ +# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) + +> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform + +It's usually `PATH`, but on Windows it can be any casing like `Path`... + + +## Install + +``` +$ npm install path-key +``` + + +## Usage + +```js +const pathKey = require('path-key'); + +const key = pathKey(); +//=> 'PATH' + +const PATH = process.env[key]; +//=> '/usr/local/bin:/usr/bin:/bin' +``` + + +## API + +### pathKey(options?) + +#### options + +Type: `object` + +##### env + +Type: `object`
+Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) + +Use a custom environment variables object. + +#### platform + +Type: `string`
+Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) + +Get the PATH key for a specific platform. + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/path-scurry/LICENSE.md b/node_modules/path-scurry/LICENSE.md new file mode 100644 index 0000000..c5402b9 --- /dev/null +++ b/node_modules/path-scurry/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node_modules/path-scurry/README.md b/node_modules/path-scurry/README.md new file mode 100644 index 0000000..b5cb495 --- /dev/null +++ b/node_modules/path-scurry/README.md @@ -0,0 +1,636 @@ +# path-scurry + +Extremely high performant utility for building tools that read +the file system, minimizing filesystem and path string munging +operations to the greatest degree possible. + +## Ugh, yet another file traversal thing on npm? + +Yes. None of the existing ones gave me exactly what I wanted. + +## Well what is it you wanted? + +While working on [glob](http://npm.im/glob), I found that I +needed a module to very efficiently manage the traversal over a +folder tree, such that: + +1. No `readdir()` or `stat()` would ever be called on the same + file or directory more than one time. +2. No `readdir()` calls would be made if we can be reasonably + sure that the path is not a directory. (Ie, a previous + `readdir()` or `stat()` covered the path, and + `ent.isDirectory()` is false.) +3. `path.resolve()`, `dirname()`, `basename()`, and other + string-parsing/munging operations are be minimized. This means + it has to track "provisional" child nodes that may not exist + (and if we find that they _don't_ exist, store that + information as well, so we don't have to ever check again). +4. The API is not limited to use as a stream/iterator/etc. There + are many cases where an API like node's `fs` is preferrable. +5. It's more important to prevent excess syscalls than to be up + to date, but it should be smart enough to know what it + _doesn't_ know, and go get it seamlessly when requested. +6. Do not blow up the JS heap allocation if operating on a + directory with a huge number of entries. +7. Handle all the weird aspects of Windows paths, like UNC paths + and drive letters and wrongway slashes, so that the consumer + can return canonical platform-specific paths without having to + parse or join or do any error-prone string munging. + +## PERFORMANCE + +JavaScript people throw around the word "blazing" a lot. I hope +that this module doesn't blaze anyone. But it does go very fast, +in the cases it's optimized for, if used properly. + +PathScurry provides ample opportunities to get extremely good +performance, as well as several options to trade performance for +convenience. + +Benchmarks can be run by executing `npm run bench`. + +As is always the case, doing more means going slower, doing less +means going faster, and there are trade offs between speed and +memory usage. + +PathScurry makes heavy use of [LRUCache](http://npm.im/lru-cache) +to efficiently cache whatever it can, and `Path` objects remain +in the graph for the lifetime of the walker, so repeated calls +with a single PathScurry object will be extremely fast. However, +adding items to a cold cache means "doing more", so in those +cases, we pay a price. Nothing is free, but every effort has been +made to reduce costs wherever possible. + +Also, note that a "cache as long as possible" approach means that +changes to the filesystem may not be reflected in the results of +repeated PathScurry operations. + +For resolving string paths, `PathScurry` ranges from 5-50 times +faster than `path.resolve` on repeated resolutions, but around +100 to 1000 times _slower_ on the first resolution. If your +program is spending a lot of time resolving the _same_ paths +repeatedly (like, thousands or millions of times), then this can +be beneficial. But both implementations are pretty fast, and +speeding up an infrequent operation from 4µs to 400ns is not +going to move the needle on your app's performance. + +For walking file system directory trees, a lot depends on how +often a given PathScurry object will be used, and also on the +walk method used. + +With default settings on a folder tree of 100,000 items, +consisting of around a 10-to-1 ratio of normal files to +directories, PathScurry performs comparably to +[@nodelib/fs.walk](http://npm.im/@nodelib/fs.walk), which is the +fastest and most reliable file system walker I could find. As far +as I can tell, it's almost impossible to go much faster in a +Node.js program, just based on how fast you can push syscalls out +to the fs thread pool. + +On my machine, that is about 1000-1200 completed walks per second +for async or stream walks, and around 500-600 walks per second +synchronously. + +In the warm cache state, PathScurry's performance increases +around 4x for async `for await` iteration, 10-15x faster for +streams and synchronous `for of` iteration, and anywhere from 30x +to 80x faster for the rest. + +``` +# walk 100,000 fs entries, 10/1 file/dir ratio +# operations / ms + New PathScurry object | Reuse PathScurry object + stream: 1112.589 | 13974.917 +sync stream: 492.718 | 15028.343 + async walk: 1095.648 | 32706.395 + sync walk: 527.632 | 46129.772 + async iter: 1288.821 | 5045.510 + sync iter: 498.496 | 17920.746 +``` + +A hand-rolled walk calling `entry.readdir()` and recursing +through the entries can benefit even more from caching, with +greater flexibility and without the overhead of streams or +generators. + +The cold cache state is still limited by the costs of file system +operations, but with a warm cache, the only bottleneck is CPU +speed and VM optimizations. Of course, in that case, some care +must be taken to ensure that you don't lose performance as a +result of silly mistakes, like calling `readdir()` on entries +that you know are not directories. + +``` +# manual recursive iteration functions + cold cache | warm cache +async: 1164.901 | 17923.320 + cb: 1101.127 | 40999.344 +zalgo: 1082.240 | 66689.936 + sync: 526.935 | 87097.591 +``` + +In this case, the speed improves by around 10-20x in the async +case, 40x in the case of using `entry.readdirCB` with protections +against synchronous callbacks, and 50-100x with callback +deferrals disabled, and _several hundred times faster_ for +synchronous iteration. + +If you can think of a case that is not covered in these +benchmarks, or an implementation that performs significantly +better than PathScurry, please [let me +know](https://github.com/isaacs/path-scurry/issues). + +## USAGE + +```ts +// hybrid module, load with either method +import { PathScurry, Path } from 'path-scurry' +// or: +const { PathScurry, Path } = require('path-scurry') + +// very simple example, say we want to find and +// delete all the .DS_Store files in a given path +// note that the API is very similar to just a +// naive walk with fs.readdir() +import { unlink } from 'fs/promises' + +// easy way, iterate over the directory and do the thing +const pw = new PathScurry(process.cwd()) +for await (const entry of pw) { + if (entry.isFile() && entry.name === '.DS_Store') { + unlink(entry.fullpath()) + } +} + +// here it is as a manual recursive method +const walk = async (entry: Path) => { + const promises: Promise = [] + // readdir doesn't throw on non-directories, it just doesn't + // return any entries, to save stack trace costs. + // Items are returned in arbitrary unsorted order + for (const child of await pw.readdir(entry)) { + // each child is a Path object + if (child.name === '.DS_Store' && child.isFile()) { + // could also do pw.resolve(entry, child.name), + // just like fs.readdir walking, but .fullpath is + // a *slightly* more efficient shorthand. + promises.push(unlink(child.fullpath())) + } else if (child.isDirectory()) { + promises.push(walk(child)) + } + } + return Promise.all(promises) +} + +walk(pw.cwd).then(() => { + console.log('all .DS_Store files removed') +}) + +const pw2 = new PathScurry('/a/b/c') // pw2.cwd is the Path for /a/b/c +const relativeDir = pw2.cwd.resolve('../x') // Path entry for '/a/b/x' +const relative2 = pw2.cwd.resolve('/a/b/d/../x') // same path, same entry +assert.equal(relativeDir, relative2) +``` + +## API + +[Full TypeDoc API](https://isaacs.github.io/path-scurry) + +There are platform-specific classes exported, but for the most +part, the default `PathScurry` and `Path` exports are what you +most likely need, unless you are testing behavior for other +platforms. + +Intended public API is documented here, but the full +documentation does include internal types, which should not be +accessed directly. + +### Interface `PathScurryOpts` + +The type of the `options` argument passed to the `PathScurry` +constructor. + +- `nocase`: Boolean indicating that file names should be compared + case-insensitively. Defaults to `true` on darwin and win32 + implementations, `false` elsewhere. + + **Warning** Performing case-insensitive matching on a + case-sensitive filesystem will result in occasionally very + bizarre behavior. Performing case-sensitive matching on a + case-insensitive filesystem may negatively impact performance. + +- `childrenCacheSize`: Number of child entries to cache, in order + to speed up `resolve()` and `readdir()` calls. Defaults to + `16 * 1024` (ie, `16384`). + + Setting it to a higher value will run the risk of JS heap + allocation errors on large directory trees. Setting it to `256` + or smaller will significantly reduce the construction time and + data consumption overhead, but with the downside of operations + being slower on large directory trees. Setting it to `0` will + mean that effectively no operations are cached, and this module + will be roughly the same speed as `fs` for file system + operations, and _much_ slower than `path.resolve()` for + repeated path resolution. + +- `fs` An object that will be used to override the default `fs` + methods. Any methods that are not overridden will use Node's + built-in implementations. + + - lstatSync + - readdir (callback `withFileTypes` Dirent variant, used for + readdirCB and most walks) + - readdirSync + - readlinkSync + - realpathSync + - promises: Object containing the following async methods: + - lstat + - readdir (Dirent variant only) + - readlink + - realpath + +### Interface `WalkOptions` + +The options object that may be passed to all walk methods. + +- `withFileTypes`: Boolean, default true. Indicates that `Path` + objects should be returned. Set to `false` to get string paths + instead. +- `follow`: Boolean, default false. Attempt to read directory + entries from symbolic links. Otherwise, only actual directories + are traversed. Regardless of this setting, a given target path + will only ever be walked once, meaning that a symbolic link to + a previously traversed directory will never be followed. + + Setting this imposes a slight performance penalty, because + `readlink` must be called on all symbolic links encountered, in + order to avoid infinite cycles. + +- `filter`: Function `(entry: Path) => boolean`. If provided, + will prevent the inclusion of any entry for which it returns a + falsey value. This will not prevent directories from being + traversed if they do not pass the filter, though it will + prevent the directories themselves from being included in the + results. By default, if no filter is provided, then all entries + are included in the results. +- `walkFilter`: Function `(entry: Path) => boolean`. If provided, + will prevent the traversal of any directory (or in the case of + `follow:true` symbolic links to directories) for which the + function returns false. This will not prevent the directories + themselves from being included in the result set. Use `filter` + for that. + +Note that TypeScript return types will only be inferred properly +from static analysis if the `withFileTypes` option is omitted, or +a constant `true` or `false` value. + +### Class `PathScurry` + +The main interface. Defaults to an appropriate class based on the +current platform. + +Use `PathScurryWin32`, `PathScurryDarwin`, or `PathScurryPosix` +if implementation-specific behavior is desired. + +All walk methods may be called with a `WalkOptions` argument to +walk over the object's current working directory with the +supplied options. + +#### `async pw.walk(entry?: string | Path | WalkOptions, opts?: WalkOptions)` + +Walk the directory tree according to the options provided, +resolving to an array of all entries found. + +#### `pw.walkSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` + +Walk the directory tree according to the options provided, +returning an array of all entries found. + +#### `pw.iterate(entry?: string | Path | WalkOptions, opts?: WalkOptions)` + +Iterate over the directory asynchronously, for use with `for +await of`. This is also the default async iterator method. + +#### `pw.iterateSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` + +Iterate over the directory synchronously, for use with `for of`. +This is also the default sync iterator method. + +#### `pw.stream(entry?: string | Path | WalkOptions, opts?: WalkOptions)` + +Return a [Minipass](http://npm.im/minipass) stream that emits +each entry or path string in the walk. Results are made available +asynchronously. + +#### `pw.streamSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)` + +Return a [Minipass](http://npm.im/minipass) stream that emits +each entry or path string in the walk. Results are made available +synchronously, meaning that the walk will complete in a single +tick if the stream is fully consumed. + +#### `pw.cwd` + +Path object representing the current working directory for the +PathScurry. + +#### `pw.chdir(path: string)` + +Set the new effective current working directory for the scurry +object, so that `path.relative()` and `path.relativePosix()` +return values relative to the new cwd path. + +#### `pw.depth(path?: Path | string): number` + +Return the depth of the specified path (or the PathScurry cwd) +within the directory tree. + +Root entries have a depth of `0`. + +#### `pw.resolve(...paths: string[])` + +Caching `path.resolve()`. + +Significantly faster than `path.resolve()` if called repeatedly +with the same paths. Significantly slower otherwise, as it builds +out the cached Path entries. + +To get a `Path` object resolved from the `PathScurry`, use +`pw.cwd.resolve(path)`. Note that `Path.resolve` only takes a +single string argument, not multiple. + +#### `pw.resolvePosix(...paths: string[])` + +Caching `path.resolve()`, but always using posix style paths. + +This is identical to `pw.resolve(...paths)` on posix systems (ie, +everywhere except Windows). + +On Windows, it returns the full absolute UNC path using `/` +separators. Ie, instead of `'C:\\foo\\bar`, it would return +`//?/C:/foo/bar`. + +#### `pw.relative(path: string | Path): string` + +Return the relative path from the PathWalker cwd to the supplied +path string or entry. + +If the nearest common ancestor is the root, then an absolute path +is returned. + +#### `pw.relativePosix(path: string | Path): string` + +Return the relative path from the PathWalker cwd to the supplied +path string or entry, using `/` path separators. + +If the nearest common ancestor is the root, then an absolute path +is returned. + +On posix platforms (ie, all platforms except Windows), this is +identical to `pw.relative(path)`. + +On Windows systems, it returns the resulting string as a +`/`-delimited path. If an absolute path is returned (because the +target does not share a common ancestor with `pw.cwd`), then a +full absolute UNC path will be returned. Ie, instead of +`'C:\\foo\\bar`, it would return `//?/C:/foo/bar`. + +#### `pw.basename(path: string | Path): string` + +Return the basename of the provided string or Path. + +#### `pw.dirname(path: string | Path): string` + +Return the parent directory of the supplied string or Path. + +#### `async pw.readdir(dir = pw.cwd, opts = { withFileTypes: true })` + +Read the directory and resolve to an array of strings if +`withFileTypes` is explicitly set to `false` or Path objects +otherwise. + +Can be called as `pw.readdir({ withFileTypes: boolean })` as +well. + +Returns `[]` if no entries are found, or if any error occurs. + +Note that TypeScript return types will only be inferred properly +from static analysis if the `withFileTypes` option is omitted, or +a constant `true` or `false` value. + +#### `pw.readdirSync(dir = pw.cwd, opts = { withFileTypes: true })` + +Synchronous `pw.readdir()` + +#### `async pw.readlink(link = pw.cwd, opts = { withFileTypes: false })` + +Call `fs.readlink` on the supplied string or Path object, and +return the result. + +Can be called as `pw.readlink({ withFileTypes: boolean })` as +well. + +Returns `undefined` if any error occurs (for example, if the +argument is not a symbolic link), or a `Path` object if +`withFileTypes` is explicitly set to `true`, or a string +otherwise. + +Note that TypeScript return types will only be inferred properly +from static analysis if the `withFileTypes` option is omitted, or +a constant `true` or `false` value. + +#### `pw.readlinkSync(link = pw.cwd, opts = { withFileTypes: false })` + +Synchronous `pw.readlink()` + +#### `async pw.lstat(entry = pw.cwd)` + +Call `fs.lstat` on the supplied string or Path object, and fill +in as much information as possible, returning the updated `Path` +object. + +Returns `undefined` if the entry does not exist, or if any error +is encountered. + +Note that some `Stats` data (such as `ino`, `dev`, and `mode`) +will not be supplied. For those things, you'll need to call +`fs.lstat` yourself. + +#### `pw.lstatSync(entry = pw.cwd)` + +Synchronous `pw.lstat()` + +#### `pw.realpath(entry = pw.cwd, opts = { withFileTypes: false })` + +Call `fs.realpath` on the supplied string or Path object, and +return the realpath if available. + +Returns `undefined` if any error occurs. + +May be called as `pw.realpath({ withFileTypes: boolean })` to run +on `pw.cwd`. + +#### `pw.realpathSync(entry = pw.cwd, opts = { withFileTypes: false })` + +Synchronous `pw.realpath()` + +### Class `Path` implements [fs.Dirent](https://nodejs.org/docs/latest/api/fs.html#class-fsdirent) + +Object representing a given path on the filesystem, which may or +may not exist. + +Note that the actual class in use will be either `PathWin32` or +`PathPosix`, depending on the implementation of `PathScurry` in +use. They differ in the separators used to split and join path +strings, and the handling of root paths. + +In `PathPosix` implementations, paths are split and joined using +the `'/'` character, and `'/'` is the only root path ever in use. + +In `PathWin32` implementations, paths are split using either +`'/'` or `'\\'` and joined using `'\\'`, and multiple roots may +be in use based on the drives and UNC paths encountered. UNC +paths such as `//?/C:/` that identify a drive letter, will be +treated as an alias for the same root entry as their associated +drive letter (in this case `'C:\\'`). + +#### `path.name` + +Name of this file system entry. + +**Important**: _always_ test the path name against any test +string using the `isNamed` method, and not by directly comparing +this string. Otherwise, unicode path strings that the system sees +as identical will not be properly treated as the same path, +leading to incorrect behavior and possible security issues. + +#### `path.isNamed(name: string): boolean` + +Return true if the path is a match for the given path name. This +handles case sensitivity and unicode normalization. + +Note: even on case-sensitive systems, it is **not** safe to test +the equality of the `.name` property to determine whether a given +pathname matches, due to unicode normalization mismatches. + +Always use this method instead of testing the `path.name` +property directly. + +#### `path.isCWD` + +Set to true if this `Path` object is the current working +directory of the `PathScurry` collection that contains it. + +#### `path.getType()` + +Returns the type of the Path object, `'File'`, `'Directory'`, +etc. + +#### `path.isType(t: type)` + +Returns true if `is{t}()` returns true. + +For example, `path.isType('Directory')` is equivalent to +`path.isDirectory()`. + +#### `path.depth()` + +Return the depth of the Path entry within the directory tree. +Root paths have a depth of `0`. + +#### `path.fullpath()` + +The fully resolved path to the entry. + +#### `path.fullpathPosix()` + +The fully resolved path to the entry, using `/` separators. + +On posix systems, this is identical to `path.fullpath()`. On +windows, this will return a fully resolved absolute UNC path +using `/` separators. Eg, instead of `'C:\\foo\\bar'`, it will +return `'//?/C:/foo/bar'`. + +#### `path.isFile()`, `path.isDirectory()`, etc. + +Same as the identical `fs.Dirent.isX()` methods. + +#### `path.isUnknown()` + +Returns true if the path's type is unknown. Always returns true +when the path is known to not exist. + +#### `path.resolve(p: string)` + +Return a `Path` object associated with the provided path string +as resolved from the current Path object. + +#### `path.relative(): string` + +Return the relative path from the PathWalker cwd to the supplied +path string or entry. + +If the nearest common ancestor is the root, then an absolute path +is returned. + +#### `path.relativePosix(): string` + +Return the relative path from the PathWalker cwd to the supplied +path string or entry, using `/` path separators. + +If the nearest common ancestor is the root, then an absolute path +is returned. + +On posix platforms (ie, all platforms except Windows), this is +identical to `pw.relative(path)`. + +On Windows systems, it returns the resulting string as a +`/`-delimited path. If an absolute path is returned (because the +target does not share a common ancestor with `pw.cwd`), then a +full absolute UNC path will be returned. Ie, instead of +`'C:\\foo\\bar`, it would return `//?/C:/foo/bar`. + +#### `async path.readdir()` + +Return an array of `Path` objects found by reading the associated +path entry. + +If path is not a directory, or if any error occurs, returns `[]`, +and marks all children as provisional and non-existent. + +#### `path.readdirSync()` + +Synchronous `path.readdir()` + +#### `async path.readlink()` + +Return the `Path` object referenced by the `path` as a symbolic +link. + +If the `path` is not a symbolic link, or any error occurs, +returns `undefined`. + +#### `path.readlinkSync()` + +Synchronous `path.readlink()` + +#### `async path.lstat()` + +Call `lstat` on the path object, and fill it in with details +determined. + +If path does not exist, or any other error occurs, returns +`undefined`, and marks the path as "unknown" type. + +#### `path.lstatSync()` + +Synchronous `path.lstat()` + +#### `async path.realpath()` + +Call `realpath` on the path, and return a Path object +corresponding to the result, or `undefined` if any error occurs. + +#### `path.realpathSync()` + +Synchornous `path.realpath()` diff --git a/node_modules/path-scurry/dist/commonjs/index.d.ts b/node_modules/path-scurry/dist/commonjs/index.d.ts new file mode 100644 index 0000000..3ad4aa5 --- /dev/null +++ b/node_modules/path-scurry/dist/commonjs/index.d.ts @@ -0,0 +1,1116 @@ +/// +/// +/// +import { LRUCache } from 'lru-cache'; +import { posix, win32 } from 'node:path'; +import { Minipass } from 'minipass'; +import type { Dirent, Stats } from 'node:fs'; +/** + * An object that will be used to override the default `fs` + * methods. Any methods that are not overridden will use Node's + * built-in implementations. + * + * - lstatSync + * - readdir (callback `withFileTypes` Dirent variant, used for + * readdirCB and most walks) + * - readdirSync + * - readlinkSync + * - realpathSync + * - promises: Object containing the following async methods: + * - lstat + * - readdir (Dirent variant only) + * - readlink + * - realpath + */ +export interface FSOption { + lstatSync?: (path: string) => Stats; + readdir?: (path: string, options: { + withFileTypes: true; + }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; + readdirSync?: (path: string, options: { + withFileTypes: true; + }) => Dirent[]; + readlinkSync?: (path: string) => string; + realpathSync?: (path: string) => string; + promises?: { + lstat?: (path: string) => Promise; + readdir?: (path: string, options: { + withFileTypes: true; + }) => Promise; + readlink?: (path: string) => Promise; + realpath?: (path: string) => Promise; + [k: string]: any; + }; + [k: string]: any; +} +interface FSValue { + lstatSync: (path: string) => Stats; + readdir: (path: string, options: { + withFileTypes: true; + }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; + readdirSync: (path: string, options: { + withFileTypes: true; + }) => Dirent[]; + readlinkSync: (path: string) => string; + realpathSync: (path: string) => string; + promises: { + lstat: (path: string) => Promise; + readdir: (path: string, options: { + withFileTypes: true; + }) => Promise; + readlink: (path: string) => Promise; + realpath: (path: string) => Promise; + [k: string]: any; + }; + [k: string]: any; +} +export type Type = 'Unknown' | 'FIFO' | 'CharacterDevice' | 'Directory' | 'BlockDevice' | 'File' | 'SymbolicLink' | 'Socket'; +/** + * Options that may be provided to the Path constructor + */ +export interface PathOpts { + fullpath?: string; + relative?: string; + relativePosix?: string; + parent?: PathBase; + /** + * See {@link FSOption} + */ + fs?: FSOption; +} +/** + * An LRUCache for storing resolved path strings or Path objects. + * @internal + */ +export declare class ResolveCache extends LRUCache { + constructor(); +} +/** + * an LRUCache for storing child entries. + * @internal + */ +export declare class ChildrenCache extends LRUCache { + constructor(maxSize?: number); +} +/** + * Array of Path objects, plus a marker indicating the first provisional entry + * + * @internal + */ +export type Children = PathBase[] & { + provisional: number; +}; +declare const setAsCwd: unique symbol; +/** + * Path objects are sort of like a super-powered + * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} + * + * Each one represents a single filesystem entry on disk, which may or may not + * exist. It includes methods for reading various types of information via + * lstat, readlink, and readdir, and caches all information to the greatest + * degree possible. + * + * Note that fs operations that would normally throw will instead return an + * "empty" value. This is in order to prevent excessive overhead from error + * stack traces. + */ +export declare abstract class PathBase implements Dirent { + #private; + /** + * the basename of this path + * + * **Important**: *always* test the path name against any test string + * usingthe {@link isNamed} method, and not by directly comparing this + * string. Otherwise, unicode path strings that the system sees as identical + * will not be properly treated as the same path, leading to incorrect + * behavior and possible security issues. + */ + name: string; + /** + * the Path entry corresponding to the path root. + * + * @internal + */ + root: PathBase; + /** + * All roots found within the current PathScurry family + * + * @internal + */ + roots: { + [k: string]: PathBase; + }; + /** + * a reference to the parent path, or undefined in the case of root entries + * + * @internal + */ + parent?: PathBase; + /** + * boolean indicating whether paths are compared case-insensitively + * @internal + */ + nocase: boolean; + /** + * boolean indicating that this path is the current working directory + * of the PathScurry collection that contains it. + */ + isCWD: boolean; + /** + * the string or regexp used to split paths. On posix, it is `'/'`, and on + * windows it is a RegExp matching either `'/'` or `'\\'` + */ + abstract splitSep: string | RegExp; + /** + * The path separator string to use when joining paths + */ + abstract sep: string; + get dev(): number | undefined; + get mode(): number | undefined; + get nlink(): number | undefined; + get uid(): number | undefined; + get gid(): number | undefined; + get rdev(): number | undefined; + get blksize(): number | undefined; + get ino(): number | undefined; + get size(): number | undefined; + get blocks(): number | undefined; + get atimeMs(): number | undefined; + get mtimeMs(): number | undefined; + get ctimeMs(): number | undefined; + get birthtimeMs(): number | undefined; + get atime(): Date | undefined; + get mtime(): Date | undefined; + get ctime(): Date | undefined; + get birthtime(): Date | undefined; + /** + * This property is for compatibility with the Dirent class as of + * Node v20, where Dirent['parentPath'] refers to the path of the + * directory that was passed to readdir. For root entries, it's the path + * to the entry itself. + */ + get parentPath(): string; + /** + * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, + * this property refers to the *parent* path, not the path object itself. + */ + get path(): string; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: { + [k: string]: PathBase; + }, nocase: boolean, children: ChildrenCache, opts: PathOpts); + /** + * Returns the depth of the Path object from its root. + * + * For example, a path at `/foo/bar` would have a depth of 2. + */ + depth(): number; + /** + * @internal + */ + abstract getRootString(path: string): string; + /** + * @internal + */ + abstract getRoot(rootPath: string): PathBase; + /** + * @internal + */ + abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase; + /** + * @internal + */ + childrenCache(): ChildrenCache; + /** + * Get the Path object referenced by the string path, resolved from this Path + */ + resolve(path?: string): PathBase; + /** + * Returns the cached children Path objects, if still available. If they + * have fallen out of the cache, then returns an empty array, and resets the + * READDIR_CALLED bit, so that future calls to readdir() will require an fs + * lookup. + * + * @internal + */ + children(): Children; + /** + * Resolves a path portion and returns or creates the child Path. + * + * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is + * `'..'`. + * + * This should not be called directly. If `pathPart` contains any path + * separators, it will lead to unsafe undefined behavior. + * + * Use `Path.resolve()` instead. + * + * @internal + */ + child(pathPart: string, opts?: PathOpts): PathBase; + /** + * The relative path from the cwd. If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpath() + */ + relative(): string; + /** + * The relative path from the cwd, using / as the path separator. + * If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpathPosix() + * On posix systems, this is identical to relative(). + */ + relativePosix(): string; + /** + * The fully resolved path string for this Path entry + */ + fullpath(): string; + /** + * On platforms other than windows, this is identical to fullpath. + * + * On windows, this is overridden to return the forward-slash form of the + * full UNC path. + */ + fullpathPosix(): string; + /** + * Is the Path of an unknown type? + * + * Note that we might know *something* about it if there has been a previous + * filesystem operation, for example that it does not exist, or is not a + * link, or whether it has child entries. + */ + isUnknown(): boolean; + isType(type: Type): boolean; + getType(): Type; + /** + * Is the Path a regular file? + */ + isFile(): boolean; + /** + * Is the Path a directory? + */ + isDirectory(): boolean; + /** + * Is the path a character device? + */ + isCharacterDevice(): boolean; + /** + * Is the path a block device? + */ + isBlockDevice(): boolean; + /** + * Is the path a FIFO pipe? + */ + isFIFO(): boolean; + /** + * Is the path a socket? + */ + isSocket(): boolean; + /** + * Is the path a symbolic link? + */ + isSymbolicLink(): boolean; + /** + * Return the entry if it has been subject of a successful lstat, or + * undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* simply + * mean that we haven't called lstat on it. + */ + lstatCached(): PathBase | undefined; + /** + * Return the cached link target if the entry has been the subject of a + * successful readlink, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readlink() has been called at some point. + */ + readlinkCached(): PathBase | undefined; + /** + * Returns the cached realpath target if the entry has been the subject + * of a successful realpath, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * realpath() has been called at some point. + */ + realpathCached(): PathBase | undefined; + /** + * Returns the cached child Path entries array if the entry has been the + * subject of a successful readdir(), or [] otherwise. + * + * Does not read the filesystem, so an empty array *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readdir() has been called recently enough to still be valid. + */ + readdirCached(): PathBase[]; + /** + * Return true if it's worth trying to readlink. Ie, we don't (yet) have + * any indication that readlink will definitely fail. + * + * Returns false if the path is known to not be a symlink, if a previous + * readlink failed, or if the entry does not exist. + */ + canReadlink(): boolean; + /** + * Return true if readdir has previously been successfully called on this + * path, indicating that cachedReaddir() is likely valid. + */ + calledReaddir(): boolean; + /** + * Returns true if the path is known to not exist. That is, a previous lstat + * or readdir failed to verify its existence when that would have been + * expected, or a parent entry was marked either enoent or enotdir. + */ + isENOENT(): boolean; + /** + * Return true if the path is a match for the given path name. This handles + * case sensitivity and unicode normalization. + * + * Note: even on case-sensitive systems, it is **not** safe to test the + * equality of the `.name` property to determine whether a given pathname + * matches, due to unicode normalization mismatches. + * + * Always use this method instead of testing the `path.name` property + * directly. + */ + isNamed(n: string): boolean; + /** + * Return the Path object corresponding to the target of a symbolic link. + * + * If the Path is not a symbolic link, or if the readlink call fails for any + * reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + */ + readlink(): Promise; + /** + * Synchronous {@link PathBase.readlink} + */ + readlinkSync(): PathBase | undefined; + /** + * Call lstat() on this Path, and update all known information that can be + * determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + lstat(): Promise; + /** + * synchronous {@link PathBase.lstat} + */ + lstatSync(): PathBase | undefined; + /** + * Standard node-style callback interface to get list of directory entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + * + * @param cb The callback called with (er, entries). Note that the `er` + * param is somewhat extraneous, as all readdir() errors are handled and + * simply result in an empty set of entries being returned. + * @param allowZalgo Boolean indicating that immediately known results should + * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release + * zalgo at your peril, the dark pony lord is devious and unforgiving. + */ + readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void; + /** + * Return an array of known child entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + readdir(): Promise; + /** + * synchronous {@link PathBase.readdir} + */ + readdirSync(): PathBase[]; + canReaddir(): boolean; + shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean; + /** + * Return the Path object corresponding to path as resolved + * by realpath(3). + * + * If the realpath call fails for any reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * On success, returns a Path object. + */ + realpath(): Promise; + /** + * Synchronous {@link realpath} + */ + realpathSync(): PathBase | undefined; + /** + * Internal method to mark this Path object as the scurry cwd, + * called by {@link PathScurry#chdir} + * + * @internal + */ + [setAsCwd](oldCwd: PathBase): void; +} +/** + * Path class used on win32 systems + * + * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` + * as the path separator for parsing paths. + */ +export declare class PathWin32 extends PathBase { + /** + * Separator for generating path strings. + */ + sep: '\\'; + /** + * Separator for parsing path strings. + */ + splitSep: RegExp; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: { + [k: string]: PathBase; + }, nocase: boolean, children: ChildrenCache, opts: PathOpts); + /** + * @internal + */ + newChild(name: string, type?: number, opts?: PathOpts): PathWin32; + /** + * @internal + */ + getRootString(path: string): string; + /** + * @internal + */ + getRoot(rootPath: string): PathBase; + /** + * @internal + */ + sameRoot(rootPath: string, compare?: string): boolean; +} +/** + * Path class used on all posix systems. + * + * Uses `'/'` as the path separator. + */ +export declare class PathPosix extends PathBase { + /** + * separator for parsing path strings + */ + splitSep: '/'; + /** + * separator for generating path strings + */ + sep: '/'; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: { + [k: string]: PathBase; + }, nocase: boolean, children: ChildrenCache, opts: PathOpts); + /** + * @internal + */ + getRootString(path: string): string; + /** + * @internal + */ + getRoot(_rootPath: string): PathBase; + /** + * @internal + */ + newChild(name: string, type?: number, opts?: PathOpts): PathPosix; +} +/** + * Options that may be provided to the PathScurry constructor + */ +export interface PathScurryOpts { + /** + * perform case-insensitive path matching. Default based on platform + * subclass. + */ + nocase?: boolean; + /** + * Number of Path entries to keep in the cache of Path child references. + * + * Setting this higher than 65536 will dramatically increase the data + * consumption and construction time overhead of each PathScurry. + * + * Setting this value to 256 or lower will significantly reduce the data + * consumption and construction time overhead, but may also reduce resolve() + * and readdir() performance on large filesystems. + * + * Default `16384`. + */ + childrenCacheSize?: number; + /** + * An object that overrides the built-in functions from the fs and + * fs/promises modules. + * + * See {@link FSOption} + */ + fs?: FSOption; +} +/** + * The base class for all PathScurry classes, providing the interface for path + * resolution and filesystem operations. + * + * Typically, you should *not* instantiate this class directly, but rather one + * of the platform-specific classes, or the exported {@link PathScurry} which + * defaults to the current platform. + */ +export declare abstract class PathScurryBase { + #private; + /** + * The root Path entry for the current working directory of this Scurry + */ + root: PathBase; + /** + * The string path for the root of this Scurry's current working directory + */ + rootPath: string; + /** + * A collection of all roots encountered, referenced by rootPath + */ + roots: { + [k: string]: PathBase; + }; + /** + * The Path entry corresponding to this PathScurry's current working directory. + */ + cwd: PathBase; + /** + * Perform path comparisons case-insensitively. + * + * Defaults true on Darwin and Windows systems, false elsewhere. + */ + nocase: boolean; + /** + * The path separator used for parsing paths + * + * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows + */ + abstract sep: string | RegExp; + /** + * This class should not be instantiated directly. + * + * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry + * + * @internal + */ + constructor(cwd: string | URL | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts); + /** + * Get the depth of a provided path, string, or the cwd + */ + depth(path?: Path | string): number; + /** + * Parse the root portion of a path string + * + * @internal + */ + abstract parseRootPath(dir: string): string; + /** + * create a new Path to use as root during construction. + * + * @internal + */ + abstract newRoot(fs: FSValue): PathBase; + /** + * Determine whether a given path string is absolute + */ + abstract isAbsolute(p: string): boolean; + /** + * Return the cache of child entries. Exposed so subclasses can create + * child Path objects in a platform-specific way. + * + * @internal + */ + childrenCache(): ChildrenCache; + /** + * Resolve one or more path strings to a resolved string + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolve(...paths: string[]): string; + /** + * Resolve one or more path strings to a resolved string, returning + * the posix path. Identical to .resolve() on posix systems, but on + * windows will return a forward-slash separated UNC path. + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolvePosix(...paths: string[]): string; + /** + * find the relative path from the cwd to the supplied path string or entry + */ + relative(entry?: PathBase | string): string; + /** + * find the relative path from the cwd to the supplied path string or + * entry, using / as the path delimiter, even on Windows. + */ + relativePosix(entry?: PathBase | string): string; + /** + * Return the basename for the provided string or Path object + */ + basename(entry?: PathBase | string): string; + /** + * Return the dirname for the provided string or Path object + */ + dirname(entry?: PathBase | string): string; + /** + * Return an array of known child entries. + * + * First argument may be either a string, or a Path object. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + * + * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set + * `{ withFileTypes: false }` to return strings. + */ + readdir(): Promise; + readdir(opts: { + withFileTypes: true; + }): Promise; + readdir(opts: { + withFileTypes: false; + }): Promise; + readdir(opts: { + withFileTypes: boolean; + }): Promise; + readdir(entry: PathBase | string): Promise; + readdir(entry: PathBase | string, opts: { + withFileTypes: true; + }): Promise; + readdir(entry: PathBase | string, opts: { + withFileTypes: false; + }): Promise; + readdir(entry: PathBase | string, opts: { + withFileTypes: boolean; + }): Promise; + /** + * synchronous {@link PathScurryBase.readdir} + */ + readdirSync(): PathBase[]; + readdirSync(opts: { + withFileTypes: true; + }): PathBase[]; + readdirSync(opts: { + withFileTypes: false; + }): string[]; + readdirSync(opts: { + withFileTypes: boolean; + }): PathBase[] | string[]; + readdirSync(entry: PathBase | string): PathBase[]; + readdirSync(entry: PathBase | string, opts: { + withFileTypes: true; + }): PathBase[]; + readdirSync(entry: PathBase | string, opts: { + withFileTypes: false; + }): string[]; + readdirSync(entry: PathBase | string, opts: { + withFileTypes: boolean; + }): PathBase[] | string[]; + /** + * Call lstat() on the string or Path object, and update all known + * information that can be determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + lstat(entry?: string | PathBase): Promise; + /** + * synchronous {@link PathScurryBase.lstat} + */ + lstatSync(entry?: string | PathBase): PathBase | undefined; + /** + * Return the Path object or string path corresponding to the target of a + * symbolic link. + * + * If the path is not a symbolic link, or if the readlink call fails for any + * reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * + * `{withFileTypes}` option defaults to `false`. + * + * On success, returns a Path object if `withFileTypes` option is true, + * otherwise a string. + */ + readlink(): Promise; + readlink(opt: { + withFileTypes: false; + }): Promise; + readlink(opt: { + withFileTypes: true; + }): Promise; + readlink(opt: { + withFileTypes: boolean; + }): Promise; + readlink(entry: string | PathBase, opt?: { + withFileTypes: false; + }): Promise; + readlink(entry: string | PathBase, opt: { + withFileTypes: true; + }): Promise; + readlink(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): Promise; + /** + * synchronous {@link PathScurryBase.readlink} + */ + readlinkSync(): string | undefined; + readlinkSync(opt: { + withFileTypes: false; + }): string | undefined; + readlinkSync(opt: { + withFileTypes: true; + }): PathBase | undefined; + readlinkSync(opt: { + withFileTypes: boolean; + }): PathBase | string | undefined; + readlinkSync(entry: string | PathBase, opt?: { + withFileTypes: false; + }): string | undefined; + readlinkSync(entry: string | PathBase, opt: { + withFileTypes: true; + }): PathBase | undefined; + readlinkSync(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): string | PathBase | undefined; + /** + * Return the Path object or string path corresponding to path as resolved + * by realpath(3). + * + * If the realpath call fails for any reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * + * `{withFileTypes}` option defaults to `false`. + * + * On success, returns a Path object if `withFileTypes` option is true, + * otherwise a string. + */ + realpath(): Promise; + realpath(opt: { + withFileTypes: false; + }): Promise; + realpath(opt: { + withFileTypes: true; + }): Promise; + realpath(opt: { + withFileTypes: boolean; + }): Promise; + realpath(entry: string | PathBase, opt?: { + withFileTypes: false; + }): Promise; + realpath(entry: string | PathBase, opt: { + withFileTypes: true; + }): Promise; + realpath(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): Promise; + realpathSync(): string | undefined; + realpathSync(opt: { + withFileTypes: false; + }): string | undefined; + realpathSync(opt: { + withFileTypes: true; + }): PathBase | undefined; + realpathSync(opt: { + withFileTypes: boolean; + }): PathBase | string | undefined; + realpathSync(entry: string | PathBase, opt?: { + withFileTypes: false; + }): string | undefined; + realpathSync(entry: string | PathBase, opt: { + withFileTypes: true; + }): PathBase | undefined; + realpathSync(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): string | PathBase | undefined; + /** + * Asynchronously walk the directory tree, returning an array of + * all path strings or Path objects found. + * + * Note that this will be extremely memory-hungry on large filesystems. + * In such cases, it may be better to use the stream or async iterator + * walk implementation. + */ + walk(): Promise; + walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; + walk(opts: WalkOptionsWithFileTypesFalse): Promise; + walk(opts: WalkOptions): Promise; + walk(entry: string | PathBase): Promise; + walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; + walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise; + walk(entry: string | PathBase, opts: WalkOptions): Promise; + /** + * Synchronously walk the directory tree, returning an array of + * all path strings or Path objects found. + * + * Note that this will be extremely memory-hungry on large filesystems. + * In such cases, it may be better to use the stream or async iterator + * walk implementation. + */ + walkSync(): PathBase[]; + walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[]; + walkSync(opts: WalkOptionsWithFileTypesFalse): string[]; + walkSync(opts: WalkOptions): string[] | PathBase[]; + walkSync(entry: string | PathBase): PathBase[]; + walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[]; + walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[]; + walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[]; + /** + * Support for `for await` + * + * Alias for {@link PathScurryBase.iterate} + * + * Note: As of Node 19, this is very slow, compared to other methods of + * walking. Consider using {@link PathScurryBase.stream} if memory overhead + * and backpressure are concerns, or {@link PathScurryBase.walk} if not. + */ + [Symbol.asyncIterator](): AsyncGenerator; + /** + * Async generator form of {@link PathScurryBase.walk} + * + * Note: As of Node 19, this is very slow, compared to other methods of + * walking, especially if most/all of the directory tree has been previously + * walked. Consider using {@link PathScurryBase.stream} if memory overhead + * and backpressure are concerns, or {@link PathScurryBase.walk} if not. + */ + iterate(): AsyncGenerator; + iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; + iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; + iterate(opts: WalkOptions): AsyncGenerator; + iterate(entry: string | PathBase): AsyncGenerator; + iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; + iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; + iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator; + /** + * Iterating over a PathScurry performs a synchronous walk. + * + * Alias for {@link PathScurryBase.iterateSync} + */ + [Symbol.iterator](): Generator; + iterateSync(): Generator; + iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; + iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator; + iterateSync(opts: WalkOptions): Generator; + iterateSync(entry: string | PathBase): Generator; + iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; + iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator; + iterateSync(entry: string | PathBase, opts: WalkOptions): Generator; + /** + * Stream form of {@link PathScurryBase.walk} + * + * Returns a Minipass stream that emits {@link PathBase} objects by default, + * or strings if `{ withFileTypes: false }` is set in the options. + */ + stream(): Minipass; + stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; + stream(opts: WalkOptionsWithFileTypesFalse): Minipass; + stream(opts: WalkOptions): Minipass; + stream(entry: string | PathBase): Minipass; + stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; + stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; + stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; + /** + * Synchronous form of {@link PathScurryBase.stream} + * + * Returns a Minipass stream that emits {@link PathBase} objects by default, + * or strings if `{ withFileTypes: false }` is set in the options. + * + * Will complete the walk in a single tick if the stream is consumed fully. + * Otherwise, will pause as needed for stream backpressure. + */ + streamSync(): Minipass; + streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; + streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass; + streamSync(opts: WalkOptions): Minipass; + streamSync(entry: string | PathBase): Minipass; + streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; + streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; + streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; + chdir(path?: string | Path): void; +} +/** + * Options provided to all walk methods. + */ +export interface WalkOptions { + /** + * Return results as {@link PathBase} objects rather than strings. + * When set to false, results are fully resolved paths, as returned by + * {@link PathBase.fullpath}. + * @default true + */ + withFileTypes?: boolean; + /** + * Attempt to read directory entries from symbolic links. Otherwise, only + * actual directories are traversed. Regardless of this setting, a given + * target path will only ever be walked once, meaning that a symbolic link + * to a previously traversed directory will never be followed. + * + * Setting this imposes a slight performance penalty, because `readlink` + * must be called on all symbolic links encountered, in order to avoid + * infinite cycles. + * @default false + */ + follow?: boolean; + /** + * Only return entries where the provided function returns true. + * + * This will not prevent directories from being traversed, even if they do + * not pass the filter, though it will prevent directories themselves from + * being included in the result set. See {@link walkFilter} + * + * Asynchronous functions are not supported here. + * + * By default, if no filter is provided, all entries and traversed + * directories are included. + */ + filter?: (entry: PathBase) => boolean; + /** + * Only traverse directories (and in the case of {@link follow} being set to + * true, symbolic links to directories) if the provided function returns + * true. + * + * This will not prevent directories from being included in the result set, + * even if they do not pass the supplied filter function. See {@link filter} + * to do that. + * + * Asynchronous functions are not supported here. + */ + walkFilter?: (entry: PathBase) => boolean; +} +export type WalkOptionsWithFileTypesUnset = WalkOptions & { + withFileTypes?: undefined; +}; +export type WalkOptionsWithFileTypesTrue = WalkOptions & { + withFileTypes: true; +}; +export type WalkOptionsWithFileTypesFalse = WalkOptions & { + withFileTypes: false; +}; +/** + * Windows implementation of {@link PathScurryBase} + * + * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses + * {@link PathWin32} for Path objects. + */ +export declare class PathScurryWin32 extends PathScurryBase { + /** + * separator for generating path strings + */ + sep: '\\'; + constructor(cwd?: URL | string, opts?: PathScurryOpts); + /** + * @internal + */ + parseRootPath(dir: string): string; + /** + * @internal + */ + newRoot(fs: FSValue): PathWin32; + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p: string): boolean; +} +/** + * {@link PathScurryBase} implementation for all posix systems other than Darwin. + * + * Defaults to case-sensitive matching, uses `'/'` to generate path strings. + * + * Uses {@link PathPosix} for Path objects. + */ +export declare class PathScurryPosix extends PathScurryBase { + /** + * separator for generating path strings + */ + sep: '/'; + constructor(cwd?: URL | string, opts?: PathScurryOpts); + /** + * @internal + */ + parseRootPath(_dir: string): string; + /** + * @internal + */ + newRoot(fs: FSValue): PathPosix; + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p: string): boolean; +} +/** + * {@link PathScurryBase} implementation for Darwin (macOS) systems. + * + * Defaults to case-insensitive matching, uses `'/'` for generating path + * strings. + * + * Uses {@link PathPosix} for Path objects. + */ +export declare class PathScurryDarwin extends PathScurryPosix { + constructor(cwd?: URL | string, opts?: PathScurryOpts); +} +/** + * Default {@link PathBase} implementation for the current platform. + * + * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. + */ +export declare const Path: typeof PathWin32 | typeof PathPosix; +export type Path = PathBase | InstanceType; +/** + * Default {@link PathScurryBase} implementation for the current platform. + * + * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on + * Darwin (macOS) systems, {@link PathScurryPosix} on all others. + */ +export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix; +export type PathScurry = PathScurryBase | InstanceType; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/path-scurry/dist/commonjs/index.d.ts.map b/node_modules/path-scurry/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..1f59f8f --- /dev/null +++ b/node_modules/path-scurry/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAmBxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAA;IACnC,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,EAChC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,KAC9D,IAAI,CAAA;IACT,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,KAC7B,MAAM,EAAE,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAA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AO;IAYnB;;OAEG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;CAK/B;AAED;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IACjD;;OAEG;IACH,GAAG,EAAE,GAAG,CAAM;gBAEZ,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;IAO3B;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO;IAYnB;;OAEG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;CAG/B;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;gBAEjD,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;CAK5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,qCAAuD,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EACnB,OAAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,eAGQ,CAAA;AACnB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/commonjs/index.js b/node_modules/path-scurry/dist/commonjs/index.js new file mode 100644 index 0000000..555de62 --- /dev/null +++ b/node_modules/path-scurry/dist/commonjs/index.js @@ -0,0 +1,2014 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0; +const lru_cache_1 = require("lru-cache"); +const node_path_1 = require("node:path"); +const node_url_1 = require("node:url"); +const fs_1 = require("fs"); +const actualFS = __importStar(require("node:fs")); +const realpathSync = fs_1.realpathSync.native; +// TODO: test perf of fs/promises realpath vs realpathCB, +// since the promises one uses realpath.native +const promises_1 = require("node:fs/promises"); +const minipass_1 = require("minipass"); +const defaultFS = { + lstatSync: fs_1.lstatSync, + readdir: fs_1.readdir, + readdirSync: fs_1.readdirSync, + readlinkSync: fs_1.readlinkSync, + realpathSync, + promises: { + lstat: promises_1.lstat, + readdir: promises_1.readdir, + readlink: promises_1.readlink, + realpath: promises_1.realpath, + }, +}; +// if they just gave us require('fs') then use our default +const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ? + defaultFS + : { + ...defaultFS, + ...fsOption, + promises: { + ...defaultFS.promises, + ...(fsOption.promises || {}), + }, + }; +// turn something like //?/c:/ into c:\ +const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i; +const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\'); +// windows paths are separated by either / or \ +const eitherSep = /[\\\/]/; +const UNKNOWN = 0; // may not even exist, for all we know +const IFIFO = 0b0001; +const IFCHR = 0b0010; +const IFDIR = 0b0100; +const IFBLK = 0b0110; +const IFREG = 0b1000; +const IFLNK = 0b1010; +const IFSOCK = 0b1100; +const IFMT = 0b1111; +// mask to unset low 4 bits +const IFMT_UNKNOWN = ~IFMT; +// set after successfully calling readdir() and getting entries. +const READDIR_CALLED = 0b0000_0001_0000; +// set after a successful lstat() +const LSTAT_CALLED = 0b0000_0010_0000; +// set if an entry (or one of its parents) is definitely not a dir +const ENOTDIR = 0b0000_0100_0000; +// set if an entry (or one of its parents) does not exist +// (can also be set on lstat errors like EACCES or ENAMETOOLONG) +const ENOENT = 0b0000_1000_0000; +// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK +// set if we fail to readlink +const ENOREADLINK = 0b0001_0000_0000; +// set if we know realpath() will fail +const ENOREALPATH = 0b0010_0000_0000; +const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH; +const TYPEMASK = 0b0011_1111_1111; +const entToType = (s) => s.isFile() ? IFREG + : s.isDirectory() ? IFDIR + : s.isSymbolicLink() ? IFLNK + : s.isCharacterDevice() ? IFCHR + : s.isBlockDevice() ? IFBLK + : s.isSocket() ? IFSOCK + : s.isFIFO() ? IFIFO + : UNKNOWN; +// normalize unicode path names +const normalizeCache = new Map(); +const normalize = (s) => { + const c = normalizeCache.get(s); + if (c) + return c; + const n = s.normalize('NFKD'); + normalizeCache.set(s, n); + return n; +}; +const normalizeNocaseCache = new Map(); +const normalizeNocase = (s) => { + const c = normalizeNocaseCache.get(s); + if (c) + return c; + const n = normalize(s.toLowerCase()); + normalizeNocaseCache.set(s, n); + return n; +}; +/** + * An LRUCache for storing resolved path strings or Path objects. + * @internal + */ +class ResolveCache extends lru_cache_1.LRUCache { + constructor() { + super({ max: 256 }); + } +} +exports.ResolveCache = ResolveCache; +// In order to prevent blowing out the js heap by allocating hundreds of +// thousands of Path entries when walking extremely large trees, the "children" +// in this tree are represented by storing an array of Path entries in an +// LRUCache, indexed by the parent. At any time, Path.children() may return an +// empty array, indicating that it doesn't know about any of its children, and +// thus has to rebuild that cache. This is fine, it just means that we don't +// benefit as much from having the cached entries, but huge directory walks +// don't blow out the stack, and smaller ones are still as fast as possible. +// +//It does impose some complexity when building up the readdir data, because we +//need to pass a reference to the children array that we started with. +/** + * an LRUCache for storing child entries. + * @internal + */ +class ChildrenCache extends lru_cache_1.LRUCache { + constructor(maxSize = 16 * 1024) { + super({ + maxSize, + // parent + children + sizeCalculation: a => a.length + 1, + }); + } +} +exports.ChildrenCache = ChildrenCache; +const setAsCwd = Symbol('PathScurry setAsCwd'); +/** + * Path objects are sort of like a super-powered + * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} + * + * Each one represents a single filesystem entry on disk, which may or may not + * exist. It includes methods for reading various types of information via + * lstat, readlink, and readdir, and caches all information to the greatest + * degree possible. + * + * Note that fs operations that would normally throw will instead return an + * "empty" value. This is in order to prevent excessive overhead from error + * stack traces. + */ +class PathBase { + /** + * the basename of this path + * + * **Important**: *always* test the path name against any test string + * usingthe {@link isNamed} method, and not by directly comparing this + * string. Otherwise, unicode path strings that the system sees as identical + * will not be properly treated as the same path, leading to incorrect + * behavior and possible security issues. + */ + name; + /** + * the Path entry corresponding to the path root. + * + * @internal + */ + root; + /** + * All roots found within the current PathScurry family + * + * @internal + */ + roots; + /** + * a reference to the parent path, or undefined in the case of root entries + * + * @internal + */ + parent; + /** + * boolean indicating whether paths are compared case-insensitively + * @internal + */ + nocase; + /** + * boolean indicating that this path is the current working directory + * of the PathScurry collection that contains it. + */ + isCWD = false; + // potential default fs override + #fs; + // Stats fields + #dev; + get dev() { + return this.#dev; + } + #mode; + get mode() { + return this.#mode; + } + #nlink; + get nlink() { + return this.#nlink; + } + #uid; + get uid() { + return this.#uid; + } + #gid; + get gid() { + return this.#gid; + } + #rdev; + get rdev() { + return this.#rdev; + } + #blksize; + get blksize() { + return this.#blksize; + } + #ino; + get ino() { + return this.#ino; + } + #size; + get size() { + return this.#size; + } + #blocks; + get blocks() { + return this.#blocks; + } + #atimeMs; + get atimeMs() { + return this.#atimeMs; + } + #mtimeMs; + get mtimeMs() { + return this.#mtimeMs; + } + #ctimeMs; + get ctimeMs() { + return this.#ctimeMs; + } + #birthtimeMs; + get birthtimeMs() { + return this.#birthtimeMs; + } + #atime; + get atime() { + return this.#atime; + } + #mtime; + get mtime() { + return this.#mtime; + } + #ctime; + get ctime() { + return this.#ctime; + } + #birthtime; + get birthtime() { + return this.#birthtime; + } + #matchName; + #depth; + #fullpath; + #fullpathPosix; + #relative; + #relativePosix; + #type; + #children; + #linkTarget; + #realpath; + /** + * This property is for compatibility with the Dirent class as of + * Node v20, where Dirent['parentPath'] refers to the path of the + * directory that was passed to readdir. For root entries, it's the path + * to the entry itself. + */ + get parentPath() { + return (this.parent || this).fullpath(); + } + /** + * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, + * this property refers to the *parent* path, not the path object itself. + */ + get path() { + return this.parentPath; + } + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + this.name = name; + this.#matchName = nocase ? normalizeNocase(name) : normalize(name); + this.#type = type & TYPEMASK; + this.nocase = nocase; + this.roots = roots; + this.root = root || this; + this.#children = children; + this.#fullpath = opts.fullpath; + this.#relative = opts.relative; + this.#relativePosix = opts.relativePosix; + this.parent = opts.parent; + if (this.parent) { + this.#fs = this.parent.#fs; + } + else { + this.#fs = fsFromOption(opts.fs); + } + } + /** + * Returns the depth of the Path object from its root. + * + * For example, a path at `/foo/bar` would have a depth of 2. + */ + depth() { + if (this.#depth !== undefined) + return this.#depth; + if (!this.parent) + return (this.#depth = 0); + return (this.#depth = this.parent.depth() + 1); + } + /** + * @internal + */ + childrenCache() { + return this.#children; + } + /** + * Get the Path object referenced by the string path, resolved from this Path + */ + resolve(path) { + if (!path) { + return this; + } + const rootPath = this.getRootString(path); + const dir = path.substring(rootPath.length); + const dirParts = dir.split(this.splitSep); + const result = rootPath ? + this.getRoot(rootPath).#resolveParts(dirParts) + : this.#resolveParts(dirParts); + return result; + } + #resolveParts(dirParts) { + let p = this; + for (const part of dirParts) { + p = p.child(part); + } + return p; + } + /** + * Returns the cached children Path objects, if still available. If they + * have fallen out of the cache, then returns an empty array, and resets the + * READDIR_CALLED bit, so that future calls to readdir() will require an fs + * lookup. + * + * @internal + */ + children() { + const cached = this.#children.get(this); + if (cached) { + return cached; + } + const children = Object.assign([], { provisional: 0 }); + this.#children.set(this, children); + this.#type &= ~READDIR_CALLED; + return children; + } + /** + * Resolves a path portion and returns or creates the child Path. + * + * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is + * `'..'`. + * + * This should not be called directly. If `pathPart` contains any path + * separators, it will lead to unsafe undefined behavior. + * + * Use `Path.resolve()` instead. + * + * @internal + */ + child(pathPart, opts) { + if (pathPart === '' || pathPart === '.') { + return this; + } + if (pathPart === '..') { + return this.parent || this; + } + // find the child + const children = this.children(); + const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart); + for (const p of children) { + if (p.#matchName === name) { + return p; + } + } + // didn't find it, create provisional child, since it might not + // actually exist. If we know the parent isn't a dir, then + // in fact it CAN'T exist. + const s = this.parent ? this.sep : ''; + const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined; + const pchild = this.newChild(pathPart, UNKNOWN, { + ...opts, + parent: this, + fullpath, + }); + if (!this.canReaddir()) { + pchild.#type |= ENOENT; + } + // don't have to update provisional, because if we have real children, + // then provisional is set to children.length, otherwise a lower number + children.push(pchild); + return pchild; + } + /** + * The relative path from the cwd. If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpath() + */ + relative() { + if (this.isCWD) + return ''; + if (this.#relative !== undefined) { + return this.#relative; + } + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#relative = this.name); + } + const pv = p.relative(); + return pv + (!pv || !p.parent ? '' : this.sep) + name; + } + /** + * The relative path from the cwd, using / as the path separator. + * If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpathPosix() + * On posix systems, this is identical to relative(). + */ + relativePosix() { + if (this.sep === '/') + return this.relative(); + if (this.isCWD) + return ''; + if (this.#relativePosix !== undefined) + return this.#relativePosix; + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#relativePosix = this.fullpathPosix()); + } + const pv = p.relativePosix(); + return pv + (!pv || !p.parent ? '' : '/') + name; + } + /** + * The fully resolved path string for this Path entry + */ + fullpath() { + if (this.#fullpath !== undefined) { + return this.#fullpath; + } + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#fullpath = this.name); + } + const pv = p.fullpath(); + const fp = pv + (!p.parent ? '' : this.sep) + name; + return (this.#fullpath = fp); + } + /** + * On platforms other than windows, this is identical to fullpath. + * + * On windows, this is overridden to return the forward-slash form of the + * full UNC path. + */ + fullpathPosix() { + if (this.#fullpathPosix !== undefined) + return this.#fullpathPosix; + if (this.sep === '/') + return (this.#fullpathPosix = this.fullpath()); + if (!this.parent) { + const p = this.fullpath().replace(/\\/g, '/'); + if (/^[a-z]:\//i.test(p)) { + return (this.#fullpathPosix = `//?/${p}`); + } + else { + return (this.#fullpathPosix = p); + } + } + const p = this.parent; + const pfpp = p.fullpathPosix(); + const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name; + return (this.#fullpathPosix = fpp); + } + /** + * Is the Path of an unknown type? + * + * Note that we might know *something* about it if there has been a previous + * filesystem operation, for example that it does not exist, or is not a + * link, or whether it has child entries. + */ + isUnknown() { + return (this.#type & IFMT) === UNKNOWN; + } + isType(type) { + return this[`is${type}`](); + } + getType() { + return (this.isUnknown() ? 'Unknown' + : this.isDirectory() ? 'Directory' + : this.isFile() ? 'File' + : this.isSymbolicLink() ? 'SymbolicLink' + : this.isFIFO() ? 'FIFO' + : this.isCharacterDevice() ? 'CharacterDevice' + : this.isBlockDevice() ? 'BlockDevice' + : /* c8 ignore start */ this.isSocket() ? 'Socket' + : 'Unknown'); + /* c8 ignore stop */ + } + /** + * Is the Path a regular file? + */ + isFile() { + return (this.#type & IFMT) === IFREG; + } + /** + * Is the Path a directory? + */ + isDirectory() { + return (this.#type & IFMT) === IFDIR; + } + /** + * Is the path a character device? + */ + isCharacterDevice() { + return (this.#type & IFMT) === IFCHR; + } + /** + * Is the path a block device? + */ + isBlockDevice() { + return (this.#type & IFMT) === IFBLK; + } + /** + * Is the path a FIFO pipe? + */ + isFIFO() { + return (this.#type & IFMT) === IFIFO; + } + /** + * Is the path a socket? + */ + isSocket() { + return (this.#type & IFMT) === IFSOCK; + } + /** + * Is the path a symbolic link? + */ + isSymbolicLink() { + return (this.#type & IFLNK) === IFLNK; + } + /** + * Return the entry if it has been subject of a successful lstat, or + * undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* simply + * mean that we haven't called lstat on it. + */ + lstatCached() { + return this.#type & LSTAT_CALLED ? this : undefined; + } + /** + * Return the cached link target if the entry has been the subject of a + * successful readlink, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readlink() has been called at some point. + */ + readlinkCached() { + return this.#linkTarget; + } + /** + * Returns the cached realpath target if the entry has been the subject + * of a successful realpath, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * realpath() has been called at some point. + */ + realpathCached() { + return this.#realpath; + } + /** + * Returns the cached child Path entries array if the entry has been the + * subject of a successful readdir(), or [] otherwise. + * + * Does not read the filesystem, so an empty array *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readdir() has been called recently enough to still be valid. + */ + readdirCached() { + const children = this.children(); + return children.slice(0, children.provisional); + } + /** + * Return true if it's worth trying to readlink. Ie, we don't (yet) have + * any indication that readlink will definitely fail. + * + * Returns false if the path is known to not be a symlink, if a previous + * readlink failed, or if the entry does not exist. + */ + canReadlink() { + if (this.#linkTarget) + return true; + if (!this.parent) + return false; + // cases where it cannot possibly succeed + const ifmt = this.#type & IFMT; + return !((ifmt !== UNKNOWN && ifmt !== IFLNK) || + this.#type & ENOREADLINK || + this.#type & ENOENT); + } + /** + * Return true if readdir has previously been successfully called on this + * path, indicating that cachedReaddir() is likely valid. + */ + calledReaddir() { + return !!(this.#type & READDIR_CALLED); + } + /** + * Returns true if the path is known to not exist. That is, a previous lstat + * or readdir failed to verify its existence when that would have been + * expected, or a parent entry was marked either enoent or enotdir. + */ + isENOENT() { + return !!(this.#type & ENOENT); + } + /** + * Return true if the path is a match for the given path name. This handles + * case sensitivity and unicode normalization. + * + * Note: even on case-sensitive systems, it is **not** safe to test the + * equality of the `.name` property to determine whether a given pathname + * matches, due to unicode normalization mismatches. + * + * Always use this method instead of testing the `path.name` property + * directly. + */ + isNamed(n) { + return !this.nocase ? + this.#matchName === normalize(n) + : this.#matchName === normalizeNocase(n); + } + /** + * Return the Path object corresponding to the target of a symbolic link. + * + * If the Path is not a symbolic link, or if the readlink call fails for any + * reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + */ + async readlink() { + const target = this.#linkTarget; + if (target) { + return target; + } + if (!this.canReadlink()) { + return undefined; + } + /* c8 ignore start */ + // already covered by the canReadlink test, here for ts grumples + if (!this.parent) { + return undefined; + } + /* c8 ignore stop */ + try { + const read = await this.#fs.promises.readlink(this.fullpath()); + const linkTarget = (await this.parent.realpath())?.resolve(read); + if (linkTarget) { + return (this.#linkTarget = linkTarget); + } + } + catch (er) { + this.#readlinkFail(er.code); + return undefined; + } + } + /** + * Synchronous {@link PathBase.readlink} + */ + readlinkSync() { + const target = this.#linkTarget; + if (target) { + return target; + } + if (!this.canReadlink()) { + return undefined; + } + /* c8 ignore start */ + // already covered by the canReadlink test, here for ts grumples + if (!this.parent) { + return undefined; + } + /* c8 ignore stop */ + try { + const read = this.#fs.readlinkSync(this.fullpath()); + const linkTarget = this.parent.realpathSync()?.resolve(read); + if (linkTarget) { + return (this.#linkTarget = linkTarget); + } + } + catch (er) { + this.#readlinkFail(er.code); + return undefined; + } + } + #readdirSuccess(children) { + // succeeded, mark readdir called bit + this.#type |= READDIR_CALLED; + // mark all remaining provisional children as ENOENT + for (let p = children.provisional; p < children.length; p++) { + const c = children[p]; + if (c) + c.#markENOENT(); + } + } + #markENOENT() { + // mark as UNKNOWN and ENOENT + if (this.#type & ENOENT) + return; + this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN; + this.#markChildrenENOENT(); + } + #markChildrenENOENT() { + // all children are provisional and do not exist + const children = this.children(); + children.provisional = 0; + for (const p of children) { + p.#markENOENT(); + } + } + #markENOREALPATH() { + this.#type |= ENOREALPATH; + this.#markENOTDIR(); + } + // save the information when we know the entry is not a dir + #markENOTDIR() { + // entry is not a directory, so any children can't exist. + // this *should* be impossible, since any children created + // after it's been marked ENOTDIR should be marked ENOENT, + // so it won't even get to this point. + /* c8 ignore start */ + if (this.#type & ENOTDIR) + return; + /* c8 ignore stop */ + let t = this.#type; + // this could happen if we stat a dir, then delete it, + // then try to read it or one of its children. + if ((t & IFMT) === IFDIR) + t &= IFMT_UNKNOWN; + this.#type = t | ENOTDIR; + this.#markChildrenENOENT(); + } + #readdirFail(code = '') { + // markENOTDIR and markENOENT also set provisional=0 + if (code === 'ENOTDIR' || code === 'EPERM') { + this.#markENOTDIR(); + } + else if (code === 'ENOENT') { + this.#markENOENT(); + } + else { + this.children().provisional = 0; + } + } + #lstatFail(code = '') { + // Windows just raises ENOENT in this case, disable for win CI + /* c8 ignore start */ + if (code === 'ENOTDIR') { + // already know it has a parent by this point + const p = this.parent; + p.#markENOTDIR(); + } + else if (code === 'ENOENT') { + /* c8 ignore stop */ + this.#markENOENT(); + } + } + #readlinkFail(code = '') { + let ter = this.#type; + ter |= ENOREADLINK; + if (code === 'ENOENT') + ter |= ENOENT; + // windows gets a weird error when you try to readlink a file + if (code === 'EINVAL' || code === 'UNKNOWN') { + // exists, but not a symlink, we don't know WHAT it is, so remove + // all IFMT bits. + ter &= IFMT_UNKNOWN; + } + this.#type = ter; + // windows just gets ENOENT in this case. We do cover the case, + // just disabled because it's impossible on Windows CI + /* c8 ignore start */ + if (code === 'ENOTDIR' && this.parent) { + this.parent.#markENOTDIR(); + } + /* c8 ignore stop */ + } + #readdirAddChild(e, c) { + return (this.#readdirMaybePromoteChild(e, c) || + this.#readdirAddNewChild(e, c)); + } + #readdirAddNewChild(e, c) { + // alloc new entry at head, so it's never provisional + const type = entToType(e); + const child = this.newChild(e.name, type, { parent: this }); + const ifmt = child.#type & IFMT; + if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) { + child.#type |= ENOTDIR; + } + c.unshift(child); + c.provisional++; + return child; + } + #readdirMaybePromoteChild(e, c) { + for (let p = c.provisional; p < c.length; p++) { + const pchild = c[p]; + const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name); + if (name !== pchild.#matchName) { + continue; + } + return this.#readdirPromoteChild(e, pchild, p, c); + } + } + #readdirPromoteChild(e, p, index, c) { + const v = p.name; + // retain any other flags, but set ifmt from dirent + p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e); + // case sensitivity fixing when we learn the true name. + if (v !== e.name) + p.name = e.name; + // just advance provisional index (potentially off the list), + // otherwise we have to splice/pop it out and re-insert at head + if (index !== c.provisional) { + if (index === c.length - 1) + c.pop(); + else + c.splice(index, 1); + c.unshift(p); + } + c.provisional++; + return p; + } + /** + * Call lstat() on this Path, and update all known information that can be + * determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + async lstat() { + if ((this.#type & ENOENT) === 0) { + try { + this.#applyStat(await this.#fs.promises.lstat(this.fullpath())); + return this; + } + catch (er) { + this.#lstatFail(er.code); + } + } + } + /** + * synchronous {@link PathBase.lstat} + */ + lstatSync() { + if ((this.#type & ENOENT) === 0) { + try { + this.#applyStat(this.#fs.lstatSync(this.fullpath())); + return this; + } + catch (er) { + this.#lstatFail(er.code); + } + } + } + #applyStat(st) { + const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st; + this.#atime = atime; + this.#atimeMs = atimeMs; + this.#birthtime = birthtime; + this.#birthtimeMs = birthtimeMs; + this.#blksize = blksize; + this.#blocks = blocks; + this.#ctime = ctime; + this.#ctimeMs = ctimeMs; + this.#dev = dev; + this.#gid = gid; + this.#ino = ino; + this.#mode = mode; + this.#mtime = mtime; + this.#mtimeMs = mtimeMs; + this.#nlink = nlink; + this.#rdev = rdev; + this.#size = size; + this.#uid = uid; + const ifmt = entToType(st); + // retain any other flags, but set the ifmt + this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED; + if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) { + this.#type |= ENOTDIR; + } + } + #onReaddirCB = []; + #readdirCBInFlight = false; + #callOnReaddirCB(children) { + this.#readdirCBInFlight = false; + const cbs = this.#onReaddirCB.slice(); + this.#onReaddirCB.length = 0; + cbs.forEach(cb => cb(null, children)); + } + /** + * Standard node-style callback interface to get list of directory entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + * + * @param cb The callback called with (er, entries). Note that the `er` + * param is somewhat extraneous, as all readdir() errors are handled and + * simply result in an empty set of entries being returned. + * @param allowZalgo Boolean indicating that immediately known results should + * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release + * zalgo at your peril, the dark pony lord is devious and unforgiving. + */ + readdirCB(cb, allowZalgo = false) { + if (!this.canReaddir()) { + if (allowZalgo) + cb(null, []); + else + queueMicrotask(() => cb(null, [])); + return; + } + const children = this.children(); + if (this.calledReaddir()) { + const c = children.slice(0, children.provisional); + if (allowZalgo) + cb(null, c); + else + queueMicrotask(() => cb(null, c)); + return; + } + // don't have to worry about zalgo at this point. + this.#onReaddirCB.push(cb); + if (this.#readdirCBInFlight) { + return; + } + this.#readdirCBInFlight = true; + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => { + if (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + else { + // if we didn't get an error, we always get entries. + //@ts-ignore + for (const e of entries) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + this.#callOnReaddirCB(children.slice(0, children.provisional)); + return; + }); + } + #asyncReaddirInFlight; + /** + * Return an array of known child entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + async readdir() { + if (!this.canReaddir()) { + return []; + } + const children = this.children(); + if (this.calledReaddir()) { + return children.slice(0, children.provisional); + } + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + if (this.#asyncReaddirInFlight) { + await this.#asyncReaddirInFlight; + } + else { + /* c8 ignore start */ + let resolve = () => { }; + /* c8 ignore stop */ + this.#asyncReaddirInFlight = new Promise(res => (resolve = res)); + try { + for (const e of await this.#fs.promises.readdir(fullpath, { + withFileTypes: true, + })) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + catch (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + this.#asyncReaddirInFlight = undefined; + resolve(); + } + return children.slice(0, children.provisional); + } + /** + * synchronous {@link PathBase.readdir} + */ + readdirSync() { + if (!this.canReaddir()) { + return []; + } + const children = this.children(); + if (this.calledReaddir()) { + return children.slice(0, children.provisional); + } + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + try { + for (const e of this.#fs.readdirSync(fullpath, { + withFileTypes: true, + })) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + catch (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + return children.slice(0, children.provisional); + } + canReaddir() { + if (this.#type & ENOCHILD) + return false; + const ifmt = IFMT & this.#type; + // we always set ENOTDIR when setting IFMT, so should be impossible + /* c8 ignore start */ + if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) { + return false; + } + /* c8 ignore stop */ + return true; + } + shouldWalk(dirs, walkFilter) { + return ((this.#type & IFDIR) === IFDIR && + !(this.#type & ENOCHILD) && + !dirs.has(this) && + (!walkFilter || walkFilter(this))); + } + /** + * Return the Path object corresponding to path as resolved + * by realpath(3). + * + * If the realpath call fails for any reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * On success, returns a Path object. + */ + async realpath() { + if (this.#realpath) + return this.#realpath; + if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) + return undefined; + try { + const rp = await this.#fs.promises.realpath(this.fullpath()); + return (this.#realpath = this.resolve(rp)); + } + catch (_) { + this.#markENOREALPATH(); + } + } + /** + * Synchronous {@link realpath} + */ + realpathSync() { + if (this.#realpath) + return this.#realpath; + if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) + return undefined; + try { + const rp = this.#fs.realpathSync(this.fullpath()); + return (this.#realpath = this.resolve(rp)); + } + catch (_) { + this.#markENOREALPATH(); + } + } + /** + * Internal method to mark this Path object as the scurry cwd, + * called by {@link PathScurry#chdir} + * + * @internal + */ + [setAsCwd](oldCwd) { + if (oldCwd === this) + return; + oldCwd.isCWD = false; + this.isCWD = true; + const changed = new Set([]); + let rp = []; + let p = this; + while (p && p.parent) { + changed.add(p); + p.#relative = rp.join(this.sep); + p.#relativePosix = rp.join('/'); + p = p.parent; + rp.push('..'); + } + // now un-memoize parents of old cwd + p = oldCwd; + while (p && p.parent && !changed.has(p)) { + p.#relative = undefined; + p.#relativePosix = undefined; + p = p.parent; + } + } +} +exports.PathBase = PathBase; +/** + * Path class used on win32 systems + * + * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` + * as the path separator for parsing paths. + */ +class PathWin32 extends PathBase { + /** + * Separator for generating path strings. + */ + sep = '\\'; + /** + * Separator for parsing path strings. + */ + splitSep = eitherSep; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + super(name, type, root, roots, nocase, children, opts); + } + /** + * @internal + */ + newChild(name, type = UNKNOWN, opts = {}) { + return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); + } + /** + * @internal + */ + getRootString(path) { + return node_path_1.win32.parse(path).root; + } + /** + * @internal + */ + getRoot(rootPath) { + rootPath = uncToDrive(rootPath.toUpperCase()); + if (rootPath === this.root.name) { + return this.root; + } + // ok, not that one, check if it matches another we know about + for (const [compare, root] of Object.entries(this.roots)) { + if (this.sameRoot(rootPath, compare)) { + return (this.roots[rootPath] = root); + } + } + // otherwise, have to create a new one. + return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root); + } + /** + * @internal + */ + sameRoot(rootPath, compare = this.root.name) { + // windows can (rarely) have case-sensitive filesystem, but + // UNC and drive letters are always case-insensitive, and canonically + // represented uppercase. + rootPath = rootPath + .toUpperCase() + .replace(/\//g, '\\') + .replace(uncDriveRegexp, '$1\\'); + return rootPath === compare; + } +} +exports.PathWin32 = PathWin32; +/** + * Path class used on all posix systems. + * + * Uses `'/'` as the path separator. + */ +class PathPosix extends PathBase { + /** + * separator for parsing path strings + */ + splitSep = '/'; + /** + * separator for generating path strings + */ + sep = '/'; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + super(name, type, root, roots, nocase, children, opts); + } + /** + * @internal + */ + getRootString(path) { + return path.startsWith('/') ? '/' : ''; + } + /** + * @internal + */ + getRoot(_rootPath) { + return this.root; + } + /** + * @internal + */ + newChild(name, type = UNKNOWN, opts = {}) { + return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); + } +} +exports.PathPosix = PathPosix; +/** + * The base class for all PathScurry classes, providing the interface for path + * resolution and filesystem operations. + * + * Typically, you should *not* instantiate this class directly, but rather one + * of the platform-specific classes, or the exported {@link PathScurry} which + * defaults to the current platform. + */ +class PathScurryBase { + /** + * The root Path entry for the current working directory of this Scurry + */ + root; + /** + * The string path for the root of this Scurry's current working directory + */ + rootPath; + /** + * A collection of all roots encountered, referenced by rootPath + */ + roots; + /** + * The Path entry corresponding to this PathScurry's current working directory. + */ + cwd; + #resolveCache; + #resolvePosixCache; + #children; + /** + * Perform path comparisons case-insensitively. + * + * Defaults true on Darwin and Windows systems, false elsewhere. + */ + nocase; + #fs; + /** + * This class should not be instantiated directly. + * + * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry + * + * @internal + */ + constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) { + this.#fs = fsFromOption(fs); + if (cwd instanceof URL || cwd.startsWith('file://')) { + cwd = (0, node_url_1.fileURLToPath)(cwd); + } + // resolve and split root, and then add to the store. + // this is the only time we call path.resolve() + const cwdPath = pathImpl.resolve(cwd); + this.roots = Object.create(null); + this.rootPath = this.parseRootPath(cwdPath); + this.#resolveCache = new ResolveCache(); + this.#resolvePosixCache = new ResolveCache(); + this.#children = new ChildrenCache(childrenCacheSize); + const split = cwdPath.substring(this.rootPath.length).split(sep); + // resolve('/') leaves '', splits to [''], we don't want that. + if (split.length === 1 && !split[0]) { + split.pop(); + } + /* c8 ignore start */ + if (nocase === undefined) { + throw new TypeError('must provide nocase setting to PathScurryBase ctor'); + } + /* c8 ignore stop */ + this.nocase = nocase; + this.root = this.newRoot(this.#fs); + this.roots[this.rootPath] = this.root; + let prev = this.root; + let len = split.length - 1; + const joinSep = pathImpl.sep; + let abs = this.rootPath; + let sawFirst = false; + for (const part of split) { + const l = len--; + prev = prev.child(part, { + relative: new Array(l).fill('..').join(joinSep), + relativePosix: new Array(l).fill('..').join('/'), + fullpath: (abs += (sawFirst ? '' : joinSep) + part), + }); + sawFirst = true; + } + this.cwd = prev; + } + /** + * Get the depth of a provided path, string, or the cwd + */ + depth(path = this.cwd) { + if (typeof path === 'string') { + path = this.cwd.resolve(path); + } + return path.depth(); + } + /** + * Return the cache of child entries. Exposed so subclasses can create + * child Path objects in a platform-specific way. + * + * @internal + */ + childrenCache() { + return this.#children; + } + /** + * Resolve one or more path strings to a resolved string + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolve(...paths) { + // first figure out the minimum number of paths we have to test + // we always start at cwd, but any absolutes will bump the start + let r = ''; + for (let i = paths.length - 1; i >= 0; i--) { + const p = paths[i]; + if (!p || p === '.') + continue; + r = r ? `${p}/${r}` : p; + if (this.isAbsolute(p)) { + break; + } + } + const cached = this.#resolveCache.get(r); + if (cached !== undefined) { + return cached; + } + const result = this.cwd.resolve(r).fullpath(); + this.#resolveCache.set(r, result); + return result; + } + /** + * Resolve one or more path strings to a resolved string, returning + * the posix path. Identical to .resolve() on posix systems, but on + * windows will return a forward-slash separated UNC path. + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolvePosix(...paths) { + // first figure out the minimum number of paths we have to test + // we always start at cwd, but any absolutes will bump the start + let r = ''; + for (let i = paths.length - 1; i >= 0; i--) { + const p = paths[i]; + if (!p || p === '.') + continue; + r = r ? `${p}/${r}` : p; + if (this.isAbsolute(p)) { + break; + } + } + const cached = this.#resolvePosixCache.get(r); + if (cached !== undefined) { + return cached; + } + const result = this.cwd.resolve(r).fullpathPosix(); + this.#resolvePosixCache.set(r, result); + return result; + } + /** + * find the relative path from the cwd to the supplied path string or entry + */ + relative(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.relative(); + } + /** + * find the relative path from the cwd to the supplied path string or + * entry, using / as the path delimiter, even on Windows. + */ + relativePosix(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.relativePosix(); + } + /** + * Return the basename for the provided string or Path object + */ + basename(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.name; + } + /** + * Return the dirname for the provided string or Path object + */ + dirname(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return (entry.parent || entry).fullpath(); + } + async readdir(entry = this.cwd, opts = { + withFileTypes: true, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes } = opts; + if (!entry.canReaddir()) { + return []; + } + else { + const p = await entry.readdir(); + return withFileTypes ? p : p.map(e => e.name); + } + } + readdirSync(entry = this.cwd, opts = { + withFileTypes: true, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true } = opts; + if (!entry.canReaddir()) { + return []; + } + else if (withFileTypes) { + return entry.readdirSync(); + } + else { + return entry.readdirSync().map(e => e.name); + } + } + /** + * Call lstat() on the string or Path object, and update all known + * information that can be determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + async lstat(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.lstat(); + } + /** + * synchronous {@link PathScurryBase.lstat} + */ + lstatSync(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.lstatSync(); + } + async readlink(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = await entry.readlink(); + return withFileTypes ? e : e?.fullpath(); + } + readlinkSync(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = entry.readlinkSync(); + return withFileTypes ? e : e?.fullpath(); + } + async realpath(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = await entry.realpath(); + return withFileTypes ? e : e?.fullpath(); + } + realpathSync(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = entry.realpathSync(); + return withFileTypes ? e : e?.fullpath(); + } + async walk(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = []; + if (!filter || filter(entry)) { + results.push(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set(); + const walk = (dir, cb) => { + dirs.add(dir); + dir.readdirCB((er, entries) => { + /* c8 ignore start */ + if (er) { + return cb(er); + } + /* c8 ignore stop */ + let len = entries.length; + if (!len) + return cb(); + const next = () => { + if (--len === 0) { + cb(); + } + }; + for (const e of entries) { + if (!filter || filter(e)) { + results.push(withFileTypes ? e : e.fullpath()); + } + if (follow && e.isSymbolicLink()) { + e.realpath() + .then(r => (r?.isUnknown() ? r.lstat() : r)) + .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next()); + } + else { + if (e.shouldWalk(dirs, walkFilter)) { + walk(e, next); + } + else { + next(); + } + } + } + }, true); // zalgooooooo + }; + const start = entry; + return new Promise((res, rej) => { + walk(start, er => { + /* c8 ignore start */ + if (er) + return rej(er); + /* c8 ignore stop */ + res(results); + }); + }); + } + walkSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = []; + if (!filter || filter(entry)) { + results.push(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set([entry]); + for (const dir of dirs) { + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + results.push(withFileTypes ? e : e.fullpath()); + } + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + dirs.add(r); + } + } + } + return results; + } + /** + * Support for `for await` + * + * Alias for {@link PathScurryBase.iterate} + * + * Note: As of Node 19, this is very slow, compared to other methods of + * walking. Consider using {@link PathScurryBase.stream} if memory overhead + * and backpressure are concerns, or {@link PathScurryBase.walk} if not. + */ + [Symbol.asyncIterator]() { + return this.iterate(); + } + iterate(entry = this.cwd, options = {}) { + // iterating async over the stream is significantly more performant, + // especially in the warm-cache scenario, because it buffers up directory + // entries in the background instead of waiting for a yield for each one. + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + options = entry; + entry = this.cwd; + } + return this.stream(entry, options)[Symbol.asyncIterator](); + } + /** + * Iterating over a PathScurry performs a synchronous walk. + * + * Alias for {@link PathScurryBase.iterateSync} + */ + [Symbol.iterator]() { + return this.iterateSync(); + } + *iterateSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + if (!filter || filter(entry)) { + yield withFileTypes ? entry : entry.fullpath(); + } + const dirs = new Set([entry]); + for (const dir of dirs) { + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + yield withFileTypes ? e : e.fullpath(); + } + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + dirs.add(r); + } + } + } + } + stream(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = new minipass_1.Minipass({ objectMode: true }); + if (!filter || filter(entry)) { + results.write(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set(); + const queue = [entry]; + let processing = 0; + const process = () => { + let paused = false; + while (!paused) { + const dir = queue.shift(); + if (!dir) { + if (processing === 0) + results.end(); + return; + } + processing++; + dirs.add(dir); + const onReaddir = (er, entries, didRealpaths = false) => { + /* c8 ignore start */ + if (er) + return results.emit('error', er); + /* c8 ignore stop */ + if (follow && !didRealpaths) { + const promises = []; + for (const e of entries) { + if (e.isSymbolicLink()) { + promises.push(e + .realpath() + .then((r) => r?.isUnknown() ? r.lstat() : r)); + } + } + if (promises.length) { + Promise.all(promises).then(() => onReaddir(null, entries, true)); + return; + } + } + for (const e of entries) { + if (e && (!filter || filter(e))) { + if (!results.write(withFileTypes ? e : e.fullpath())) { + paused = true; + } + } + } + processing--; + for (const e of entries) { + const r = e.realpathCached() || e; + if (r.shouldWalk(dirs, walkFilter)) { + queue.push(r); + } + } + if (paused && !results.flowing) { + results.once('drain', process); + } + else if (!sync) { + process(); + } + }; + // zalgo containment + let sync = true; + dir.readdirCB(onReaddir, true); + sync = false; + } + }; + process(); + return results; + } + streamSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = new minipass_1.Minipass({ objectMode: true }); + const dirs = new Set(); + if (!filter || filter(entry)) { + results.write(withFileTypes ? entry : entry.fullpath()); + } + const queue = [entry]; + let processing = 0; + const process = () => { + let paused = false; + while (!paused) { + const dir = queue.shift(); + if (!dir) { + if (processing === 0) + results.end(); + return; + } + processing++; + dirs.add(dir); + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + if (!results.write(withFileTypes ? e : e.fullpath())) { + paused = true; + } + } + } + processing--; + for (const e of entries) { + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + queue.push(r); + } + } + } + if (paused && !results.flowing) + results.once('drain', process); + }; + process(); + return results; + } + chdir(path = this.cwd) { + const oldCwd = this.cwd; + this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path; + this.cwd[setAsCwd](oldCwd); + } +} +exports.PathScurryBase = PathScurryBase; +/** + * Windows implementation of {@link PathScurryBase} + * + * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses + * {@link PathWin32} for Path objects. + */ +class PathScurryWin32 extends PathScurryBase { + /** + * separator for generating path strings + */ + sep = '\\'; + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = true } = opts; + super(cwd, node_path_1.win32, '\\', { ...opts, nocase }); + this.nocase = nocase; + for (let p = this.cwd; p; p = p.parent) { + p.nocase = this.nocase; + } + } + /** + * @internal + */ + parseRootPath(dir) { + // if the path starts with a single separator, it's not a UNC, and we'll + // just get separator as the root, and driveFromUNC will return \ + // In that case, mount \ on the root from the cwd. + return node_path_1.win32.parse(dir).root.toUpperCase(); + } + /** + * @internal + */ + newRoot(fs) { + return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); + } + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p) { + return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p)); + } +} +exports.PathScurryWin32 = PathScurryWin32; +/** + * {@link PathScurryBase} implementation for all posix systems other than Darwin. + * + * Defaults to case-sensitive matching, uses `'/'` to generate path strings. + * + * Uses {@link PathPosix} for Path objects. + */ +class PathScurryPosix extends PathScurryBase { + /** + * separator for generating path strings + */ + sep = '/'; + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = false } = opts; + super(cwd, node_path_1.posix, '/', { ...opts, nocase }); + this.nocase = nocase; + } + /** + * @internal + */ + parseRootPath(_dir) { + return '/'; + } + /** + * @internal + */ + newRoot(fs) { + return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); + } + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p) { + return p.startsWith('/'); + } +} +exports.PathScurryPosix = PathScurryPosix; +/** + * {@link PathScurryBase} implementation for Darwin (macOS) systems. + * + * Defaults to case-insensitive matching, uses `'/'` for generating path + * strings. + * + * Uses {@link PathPosix} for Path objects. + */ +class PathScurryDarwin extends PathScurryPosix { + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = true } = opts; + super(cwd, { ...opts, nocase }); + } +} +exports.PathScurryDarwin = PathScurryDarwin; +/** + * Default {@link PathBase} implementation for the current platform. + * + * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. + */ +exports.Path = process.platform === 'win32' ? PathWin32 : PathPosix; +/** + * Default {@link PathScurryBase} implementation for the current platform. + * + * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on + * Darwin (macOS) systems, {@link PathScurryPosix} on all others. + */ +exports.PathScurry = process.platform === 'win32' ? PathScurryWin32 + : process.platform === 'darwin' ? PathScurryDarwin + : PathScurryPosix; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-scurry/dist/commonjs/index.js.map b/node_modules/path-scurry/dist/commonjs/index.js.map new file mode 100644 index 0000000..fdeca21 --- /dev/null +++ b/node_modules/path-scurry/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,yCAAwC;AAExC,uCAAwC;AAExC,2BAMW;AACX,kDAAmC;AAEnC,MAAM,YAAY,GAAG,iBAAG,CAAC,MAAM,CAAA;AAC/B,yDAAyD;AACzD,8CAA8C;AAE9C,+CAAqE;AAErE,uCAAmC;AAqEnC,MAAM,SAAS,GAAY;IACzB,SAAS,EAAT,cAAS;IACT,OAAO,EAAE,YAAS;IAClB,WAAW,EAAX,gBAAW;IACX,YAAY,EAAZ,iBAAY;IACZ,YAAY;IACZ,QAAQ,EAAE;QACR,KAAK,EAAL,gBAAK;QACL,OAAO,EAAP,kBAAO;QACP,QAAQ,EAAR,mBAAQ;QACR,QAAQ,EAAR,mBAAQ;KACT;CACF,CAAA;AAED,0DAA0D;AAC1D,MAAM,YAAY,GAAG,CAAC,QAAmB,EAAW,EAAE,CACpD,CAAC,QAAQ,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAC5D,SAAS;IACX,CAAC,CAAC;QACE,GAAG,SAAS;QACZ,GAAG,QAAQ;QACX,QAAQ,EAAE;YACR,GAAG,SAAS,CAAC,QAAQ;YACrB,GAAG,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;SAC7B;KACF,CAAA;AAEL,uCAAuC;AACvC,MAAM,cAAc,GAAG,wBAAwB,CAAA;AAC/C,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC9C,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC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;AA1CD,0CA0CC;AAED;;;;;;;GAOG;AACH,MAAa,gBAAiB,SAAQ,eAAe;IACnD,YACE,MAAoB,OAAO,CAAC,GAAG,EAAE,EACjC,OAAuB,EAAE;QAEzB,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;QAC9B,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IACjC,CAAC;CACF;AARD,4CAQC;AAED;;;;GAIG;AACU,QAAA,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAGxE;;;;;GAKG;AACU,QAAA,UAAU,GAIrB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe;IAC9C,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB;QAClD,CAAC,CAAC,eAAe,CAAA","sourcesContent":["import { LRUCache } from 'lru-cache'\nimport { posix, win32 } from 'node:path'\n\nimport { fileURLToPath } from 'node:url'\n\nimport {\n lstatSync,\n readdir as readdirCB,\n readdirSync,\n readlinkSync,\n realpathSync as rps,\n} from 'fs'\nimport * as actualFS from 'node:fs'\n\nconst realpathSync = rps.native\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\n\nimport { lstat, readdir, readlink, realpath } from 'node:fs/promises'\n\nimport { Minipass } from 'minipass'\nimport type { Dirent, Stats } from 'node:fs'\n\n/**\n * An object that will be used to override the default `fs`\n * methods. Any methods that are not overridden will use Node's\n * built-in implementations.\n *\n * - lstatSync\n * - readdir (callback `withFileTypes` Dirent variant, used for\n * readdirCB and most walks)\n * - readdirSync\n * - readlinkSync\n * - realpathSync\n * - promises: Object containing the following async methods:\n * - lstat\n * - readdir (Dirent variant only)\n * - readlink\n * - realpath\n */\nexport interface FSOption {\n lstatSync?: (path: string) => Stats\n readdir?: (\n path: string,\n options: { withFileTypes: true },\n cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n ) => void\n readdirSync?: (\n path: string,\n options: { withFileTypes: true },\n ) => Dirent[]\n readlinkSync?: (path: string) => string\n realpathSync?: (path: string) => string\n promises?: {\n lstat?: (path: string) => Promise\n readdir?: (\n path: string,\n options: { withFileTypes: true },\n ) => Promise\n readlink?: (path: string) => Promise\n realpath?: (path: string) => Promise\n [k: string]: any\n }\n [k: string]: any\n}\n\ninterface FSValue {\n lstatSync: (path: string) => Stats\n readdir: (\n path: string,\n options: { withFileTypes: true },\n cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n ) => void\n readdirSync: (path: string, options: { withFileTypes: true }) => Dirent[]\n readlinkSync: (path: string) => string\n realpathSync: (path: string) => string\n promises: {\n lstat: (path: string) => Promise\n readdir: (\n path: string,\n options: { withFileTypes: true },\n ) => Promise\n readlink: (path: string) => Promise\n realpath: (path: string) => Promise\n [k: string]: any\n }\n [k: string]: any\n}\n\nconst defaultFS: FSValue = {\n lstatSync,\n readdir: readdirCB,\n readdirSync,\n readlinkSync,\n realpathSync,\n promises: {\n lstat,\n readdir,\n readlink,\n realpath,\n },\n}\n\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption?: FSOption): FSValue =>\n !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n defaultFS\n : {\n ...defaultFS,\n ...fsOption,\n promises: {\n ...defaultFS.promises,\n ...(fsOption.promises || {}),\n },\n }\n\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i\nconst uncToDrive = (rootPath: string): string =>\n rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\')\n\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/\n\nconst UNKNOWN = 0 // may not even exist, for all we know\nconst IFIFO = 0b0001\nconst IFCHR = 0b0010\nconst IFDIR = 0b0100\nconst IFBLK = 0b0110\nconst IFREG = 0b1000\nconst IFLNK = 0b1010\nconst IFSOCK = 0b1100\nconst IFMT = 0b1111\n\nexport type Type =\n | 'Unknown'\n | 'FIFO'\n | 'CharacterDevice'\n | 'Directory'\n | 'BlockDevice'\n | 'File'\n | 'SymbolicLink'\n | 'Socket'\n\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT\n\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000\n\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH\nconst TYPEMASK = 0b0011_1111_1111\n\nconst entToType = (s: Dirent | Stats) =>\n s.isFile() ? IFREG\n : s.isDirectory() ? IFDIR\n : s.isSymbolicLink() ? IFLNK\n : s.isCharacterDevice() ? IFCHR\n : s.isBlockDevice() ? IFBLK\n : s.isSocket() ? IFSOCK\n : s.isFIFO() ? IFIFO\n : UNKNOWN\n\n// normalize unicode path names\nconst normalizeCache = new Map()\nconst normalize = (s: string) => {\n const c = normalizeCache.get(s)\n if (c) return c\n const n = s.normalize('NFKD')\n normalizeCache.set(s, n)\n return n\n}\n\nconst normalizeNocaseCache = new Map()\nconst normalizeNocase = (s: string) => {\n const c = normalizeNocaseCache.get(s)\n if (c) return c\n const n = normalize(s.toLowerCase())\n normalizeNocaseCache.set(s, n)\n return n\n}\n\n/**\n * Options that may be provided to the Path constructor\n */\nexport interface PathOpts {\n fullpath?: string\n relative?: string\n relativePosix?: string\n parent?: PathBase\n /**\n * See {@link FSOption}\n */\n fs?: FSOption\n}\n\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nexport class ResolveCache extends LRUCache {\n constructor() {\n super({ max: 256 })\n }\n}\n\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent. At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache. This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nexport class ChildrenCache extends LRUCache {\n constructor(maxSize: number = 16 * 1024) {\n super({\n maxSize,\n // parent + children\n sizeCalculation: a => a.length + 1,\n })\n }\n}\n\n/**\n * Array of Path objects, plus a marker indicating the first provisional entry\n *\n * @internal\n */\nexport type Children = PathBase[] & { provisional: number }\n\nconst setAsCwd = Symbol('PathScurry setAsCwd')\n\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nexport abstract class PathBase implements Dirent {\n /**\n * the basename of this path\n *\n * **Important**: *always* test the path name against any test string\n * usingthe {@link isNamed} method, and not by directly comparing this\n * string. Otherwise, unicode path strings that the system sees as identical\n * will not be properly treated as the same path, leading to incorrect\n * behavior and possible security issues.\n */\n name: string\n /**\n * the Path entry corresponding to the path root.\n *\n * @internal\n */\n root: PathBase\n /**\n * All roots found within the current PathScurry family\n *\n * @internal\n */\n roots: { [k: string]: PathBase }\n /**\n * a reference to the parent path, or undefined in the case of root entries\n *\n * @internal\n */\n parent?: PathBase\n /**\n * boolean indicating whether paths are compared case-insensitively\n * @internal\n */\n nocase: boolean\n\n /**\n * boolean indicating that this path is the current working directory\n * of the PathScurry collection that contains it.\n */\n isCWD: boolean = false\n\n /**\n * the string or regexp used to split paths. On posix, it is `'/'`, and on\n * windows it is a RegExp matching either `'/'` or `'\\\\'`\n */\n abstract splitSep: string | RegExp\n /**\n * The path separator string to use when joining paths\n */\n abstract sep: string\n\n // potential default fs override\n #fs: FSValue\n\n // Stats fields\n #dev?: number\n get dev() {\n return this.#dev\n }\n #mode?: number\n get mode() {\n return this.#mode\n }\n #nlink?: number\n get nlink() {\n return this.#nlink\n }\n #uid?: number\n get uid() {\n return this.#uid\n }\n #gid?: number\n get gid() {\n return this.#gid\n }\n #rdev?: number\n get rdev() {\n return this.#rdev\n }\n #blksize?: number\n get blksize() {\n return this.#blksize\n }\n #ino?: number\n get ino() {\n return this.#ino\n }\n #size?: number\n get size() {\n return this.#size\n }\n #blocks?: number\n get blocks() {\n return this.#blocks\n }\n #atimeMs?: number\n get atimeMs() {\n return this.#atimeMs\n }\n #mtimeMs?: number\n get mtimeMs() {\n return this.#mtimeMs\n }\n #ctimeMs?: number\n get ctimeMs() {\n return this.#ctimeMs\n }\n #birthtimeMs?: number\n get birthtimeMs() {\n return this.#birthtimeMs\n }\n #atime?: Date\n get atime() {\n return this.#atime\n }\n #mtime?: Date\n get mtime() {\n return this.#mtime\n }\n #ctime?: Date\n get ctime() {\n return this.#ctime\n }\n #birthtime?: Date\n get birthtime() {\n return this.#birthtime\n }\n\n #matchName: string\n #depth?: number\n #fullpath?: string\n #fullpathPosix?: string\n #relative?: string\n #relativePosix?: string\n #type: number\n #children: ChildrenCache\n #linkTarget?: PathBase\n #realpath?: PathBase\n\n /**\n * This property is for compatibility with the Dirent class as of\n * Node v20, where Dirent['parentPath'] refers to the path of the\n * directory that was passed to readdir. For root entries, it's the path\n * to the entry itself.\n */\n get parentPath(): string {\n return (this.parent || this).fullpath()\n }\n\n /**\n * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n * this property refers to the *parent* path, not the path object itself.\n */\n get path(): string {\n return this.parentPath\n }\n\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(\n name: string,\n type: number = UNKNOWN,\n root: PathBase | undefined,\n roots: { [k: string]: PathBase },\n nocase: boolean,\n children: ChildrenCache,\n opts: PathOpts,\n ) {\n this.name = name\n this.#matchName = nocase ? normalizeNocase(name) : normalize(name)\n this.#type = type & TYPEMASK\n this.nocase = nocase\n this.roots = roots\n this.root = root || this\n this.#children = children\n this.#fullpath = opts.fullpath\n this.#relative = opts.relative\n this.#relativePosix = opts.relativePosix\n this.parent = opts.parent\n if (this.parent) {\n this.#fs = this.parent.#fs\n } else {\n this.#fs = fsFromOption(opts.fs)\n }\n }\n\n /**\n * Returns the depth of the Path object from its root.\n *\n * For example, a path at `/foo/bar` would have a depth of 2.\n */\n depth(): number {\n if (this.#depth !== undefined) return this.#depth\n if (!this.parent) return (this.#depth = 0)\n return (this.#depth = this.parent.depth() + 1)\n }\n\n /**\n * @internal\n */\n abstract getRootString(path: string): string\n /**\n * @internal\n */\n abstract getRoot(rootPath: string): PathBase\n /**\n * @internal\n */\n abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase\n\n /**\n * @internal\n */\n childrenCache() {\n return this.#children\n }\n\n /**\n * Get the Path object referenced by the string path, resolved from this Path\n */\n resolve(path?: string): PathBase {\n if (!path) {\n return this\n }\n const rootPath = this.getRootString(path)\n const dir = path.substring(rootPath.length)\n const dirParts = dir.split(this.splitSep)\n const result: PathBase =\n rootPath ?\n this.getRoot(rootPath).#resolveParts(dirParts)\n : this.#resolveParts(dirParts)\n return result\n }\n\n #resolveParts(dirParts: string[]) {\n let p: PathBase = this\n for (const part of dirParts) {\n p = p.child(part)\n }\n return p\n }\n\n /**\n * Returns the cached children Path objects, if still available. If they\n * have fallen out of the cache, then returns an empty array, and resets the\n * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n * lookup.\n *\n * @internal\n */\n children(): Children {\n const cached = this.#children.get(this)\n if (cached) {\n return cached\n }\n const children: Children = Object.assign([], { provisional: 0 })\n this.#children.set(this, children)\n this.#type &= ~READDIR_CALLED\n return children\n }\n\n /**\n * Resolves a path portion and returns or creates the child Path.\n *\n * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n * `'..'`.\n *\n * This should not be called directly. If `pathPart` contains any path\n * separators, it will lead to unsafe undefined behavior.\n *\n * Use `Path.resolve()` instead.\n *\n * @internal\n */\n child(pathPart: string, opts?: PathOpts): PathBase {\n if (pathPart === '' || pathPart === '.') {\n return this\n }\n if (pathPart === '..') {\n return this.parent || this\n }\n\n // find the child\n const children = this.children()\n const name =\n this.nocase ? normalizeNocase(pathPart) : normalize(pathPart)\n for (const p of children) {\n if (p.#matchName === name) {\n return p\n }\n }\n\n // didn't find it, create provisional child, since it might not\n // actually exist. If we know the parent isn't a dir, then\n // in fact it CAN'T exist.\n const s = this.parent ? this.sep : ''\n const fullpath =\n this.#fullpath ? this.#fullpath + s + pathPart : undefined\n const pchild = this.newChild(pathPart, UNKNOWN, {\n ...opts,\n parent: this,\n fullpath,\n })\n\n if (!this.canReaddir()) {\n pchild.#type |= ENOENT\n }\n\n // don't have to update provisional, because if we have real children,\n // then provisional is set to children.length, otherwise a lower number\n children.push(pchild)\n return pchild\n }\n\n /**\n * The relative path from the cwd. If it does not share an ancestor with\n * the cwd, then this ends up being equivalent to the fullpath()\n */\n relative(): string {\n if (this.isCWD) return ''\n if (this.#relative !== undefined) {\n return this.#relative\n }\n const name = this.name\n const p = this.parent\n if (!p) {\n return (this.#relative = this.name)\n }\n const pv = p.relative()\n return pv + (!pv || !p.parent ? '' : this.sep) + name\n }\n\n /**\n * The relative path from the cwd, using / as the path separator.\n * If it does not share an ancestor with\n * the cwd, then this ends up being equivalent to the fullpathPosix()\n * On posix systems, this is identical to relative().\n */\n relativePosix(): string {\n if (this.sep === '/') return this.relative()\n if (this.isCWD) return ''\n if (this.#relativePosix !== undefined) return this.#relativePosix\n const name = this.name\n const p = this.parent\n if (!p) {\n return (this.#relativePosix = this.fullpathPosix())\n }\n const pv = p.relativePosix()\n return pv + (!pv || !p.parent ? '' : '/') + name\n }\n\n /**\n * The fully resolved path string for this Path entry\n */\n fullpath(): string {\n if (this.#fullpath !== undefined) {\n return this.#fullpath\n }\n const name = this.name\n const p = this.parent\n if (!p) {\n return (this.#fullpath = this.name)\n }\n const pv = p.fullpath()\n const fp = pv + (!p.parent ? '' : this.sep) + name\n return (this.#fullpath = fp)\n }\n\n /**\n * On platforms other than windows, this is identical to fullpath.\n *\n * On windows, this is overridden to return the forward-slash form of the\n * full UNC path.\n */\n fullpathPosix(): string {\n if (this.#fullpathPosix !== undefined) return this.#fullpathPosix\n if (this.sep === '/') return (this.#fullpathPosix = this.fullpath())\n if (!this.parent) {\n const p = this.fullpath().replace(/\\\\/g, '/')\n if (/^[a-z]:\\//i.test(p)) {\n return (this.#fullpathPosix = `//?/${p}`)\n } else {\n return (this.#fullpathPosix = p)\n }\n }\n const p = this.parent\n const pfpp = p.fullpathPosix()\n const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name\n return (this.#fullpathPosix = fpp)\n }\n\n /**\n * Is the Path of an unknown type?\n *\n * Note that we might know *something* about it if there has been a previous\n * filesystem operation, for example that it does not exist, or is not a\n * link, or whether it has child entries.\n */\n isUnknown(): boolean {\n return (this.#type & IFMT) === UNKNOWN\n }\n\n isType(type: Type): boolean {\n return this[`is${type}`]()\n }\n\n getType(): Type {\n return (\n this.isUnknown() ? 'Unknown'\n : this.isDirectory() ? 'Directory'\n : this.isFile() ? 'File'\n : this.isSymbolicLink() ? 'SymbolicLink'\n : this.isFIFO() ? 'FIFO'\n : this.isCharacterDevice() ? 'CharacterDevice'\n : this.isBlockDevice() ? 'BlockDevice'\n : /* c8 ignore start */ this.isSocket() ? 'Socket'\n : 'Unknown'\n )\n /* c8 ignore stop */\n }\n\n /**\n * Is the Path a regular file?\n */\n isFile(): boolean {\n return (this.#type & IFMT) === IFREG\n }\n\n /**\n * Is the Path a directory?\n */\n isDirectory(): boolean {\n return (this.#type & IFMT) === IFDIR\n }\n\n /**\n * Is the path a character device?\n */\n isCharacterDevice(): boolean {\n return (this.#type & IFMT) === IFCHR\n }\n\n /**\n * Is the path a block device?\n */\n isBlockDevice(): boolean {\n return (this.#type & IFMT) === IFBLK\n }\n\n /**\n * Is the path a FIFO pipe?\n */\n isFIFO(): boolean {\n return (this.#type & IFMT) === IFIFO\n }\n\n /**\n * Is the path a socket?\n */\n isSocket(): boolean {\n return (this.#type & IFMT) === IFSOCK\n }\n\n /**\n * Is the path a symbolic link?\n */\n isSymbolicLink(): boolean {\n return (this.#type & IFLNK) === IFLNK\n }\n\n /**\n * Return the entry if it has been subject of a successful lstat, or\n * undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* simply\n * mean that we haven't called lstat on it.\n */\n lstatCached(): PathBase | undefined {\n return this.#type & LSTAT_CALLED ? this : undefined\n }\n\n /**\n * Return the cached link target if the entry has been the subject of a\n * successful readlink, or undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * readlink() has been called at some point.\n */\n readlinkCached(): PathBase | undefined {\n return this.#linkTarget\n }\n\n /**\n * Returns the cached realpath target if the entry has been the subject\n * of a successful realpath, or undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * realpath() has been called at some point.\n */\n realpathCached(): PathBase | undefined {\n return this.#realpath\n }\n\n /**\n * Returns the cached child Path entries array if the entry has been the\n * subject of a successful readdir(), or [] otherwise.\n *\n * Does not read the filesystem, so an empty array *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * readdir() has been called recently enough to still be valid.\n */\n readdirCached(): PathBase[] {\n const children = this.children()\n return children.slice(0, children.provisional)\n }\n\n /**\n * Return true if it's worth trying to readlink. Ie, we don't (yet) have\n * any indication that readlink will definitely fail.\n *\n * Returns false if the path is known to not be a symlink, if a previous\n * readlink failed, or if the entry does not exist.\n */\n canReadlink(): boolean {\n if (this.#linkTarget) return true\n if (!this.parent) return false\n // cases where it cannot possibly succeed\n const ifmt = this.#type & IFMT\n return !(\n (ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n this.#type & ENOREADLINK ||\n this.#type & ENOENT\n )\n }\n\n /**\n * Return true if readdir has previously been successfully called on this\n * path, indicating that cachedReaddir() is likely valid.\n */\n calledReaddir(): boolean {\n return !!(this.#type & READDIR_CALLED)\n }\n\n /**\n * Returns true if the path is known to not exist. That is, a previous lstat\n * or readdir failed to verify its existence when that would have been\n * expected, or a parent entry was marked either enoent or enotdir.\n */\n isENOENT(): boolean {\n return !!(this.#type & ENOENT)\n }\n\n /**\n * Return true if the path is a match for the given path name. This handles\n * case sensitivity and unicode normalization.\n *\n * Note: even on case-sensitive systems, it is **not** safe to test the\n * equality of the `.name` property to determine whether a given pathname\n * matches, due to unicode normalization mismatches.\n *\n * Always use this method instead of testing the `path.name` property\n * directly.\n */\n isNamed(n: string): boolean {\n return !this.nocase ?\n this.#matchName === normalize(n)\n : this.#matchName === normalizeNocase(n)\n }\n\n /**\n * Return the Path object corresponding to the target of a symbolic link.\n *\n * If the Path is not a symbolic link, or if the readlink call fails for any\n * reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n */\n async readlink(): Promise {\n const target = this.#linkTarget\n if (target) {\n return target\n }\n if (!this.canReadlink()) {\n return undefined\n }\n /* c8 ignore start */\n // already covered by the canReadlink test, here for ts grumples\n if (!this.parent) {\n return undefined\n }\n /* c8 ignore stop */\n try {\n const read = await this.#fs.promises.readlink(this.fullpath())\n const linkTarget = (await this.parent.realpath())?.resolve(read)\n if (linkTarget) {\n return (this.#linkTarget = linkTarget)\n }\n } catch (er) {\n this.#readlinkFail((er as NodeJS.ErrnoException).code)\n return undefined\n }\n }\n\n /**\n * Synchronous {@link PathBase.readlink}\n */\n readlinkSync(): PathBase | undefined {\n const target = this.#linkTarget\n if (target) {\n return target\n }\n if (!this.canReadlink()) {\n return undefined\n }\n /* c8 ignore start */\n // already covered by the canReadlink test, here for ts grumples\n if (!this.parent) {\n return undefined\n }\n /* c8 ignore stop */\n try {\n const read = this.#fs.readlinkSync(this.fullpath())\n const linkTarget = this.parent.realpathSync()?.resolve(read)\n if (linkTarget) {\n return (this.#linkTarget = linkTarget)\n }\n } catch (er) {\n this.#readlinkFail((er as NodeJS.ErrnoException).code)\n return undefined\n }\n }\n\n #readdirSuccess(children: Children) {\n // succeeded, mark readdir called bit\n this.#type |= READDIR_CALLED\n // mark all remaining provisional children as ENOENT\n for (let p = children.provisional; p < children.length; p++) {\n const c = children[p]\n if (c) c.#markENOENT()\n }\n }\n\n #markENOENT() {\n // mark as UNKNOWN and ENOENT\n if (this.#type & ENOENT) return\n this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN\n this.#markChildrenENOENT()\n }\n\n #markChildrenENOENT() {\n // all children are provisional and do not exist\n const children = this.children()\n children.provisional = 0\n for (const p of children) {\n p.#markENOENT()\n }\n }\n\n #markENOREALPATH() {\n this.#type |= ENOREALPATH\n this.#markENOTDIR()\n }\n\n // save the information when we know the entry is not a dir\n #markENOTDIR() {\n // entry is not a directory, so any children can't exist.\n // this *should* be impossible, since any children created\n // after it's been marked ENOTDIR should be marked ENOENT,\n // so it won't even get to this point.\n /* c8 ignore start */\n if (this.#type & ENOTDIR) return\n /* c8 ignore stop */\n let t = this.#type\n // this could happen if we stat a dir, then delete it,\n // then try to read it or one of its children.\n if ((t & IFMT) === IFDIR) t &= IFMT_UNKNOWN\n this.#type = t | ENOTDIR\n this.#markChildrenENOENT()\n }\n\n #readdirFail(code: string = '') {\n // markENOTDIR and markENOENT also set provisional=0\n if (code === 'ENOTDIR' || code === 'EPERM') {\n this.#markENOTDIR()\n } else if (code === 'ENOENT') {\n this.#markENOENT()\n } else {\n this.children().provisional = 0\n }\n }\n\n #lstatFail(code: string = '') {\n // Windows just raises ENOENT in this case, disable for win CI\n /* c8 ignore start */\n if (code === 'ENOTDIR') {\n // already know it has a parent by this point\n const p = this.parent as PathBase\n p.#markENOTDIR()\n } else if (code === 'ENOENT') {\n /* c8 ignore stop */\n this.#markENOENT()\n }\n }\n\n #readlinkFail(code: string = '') {\n let ter = this.#type\n ter |= ENOREADLINK\n if (code === 'ENOENT') ter |= ENOENT\n // windows gets a weird error when you try to readlink a file\n if (code === 'EINVAL' || code === 'UNKNOWN') {\n // exists, but not a symlink, we don't know WHAT it is, so remove\n // all IFMT bits.\n ter &= IFMT_UNKNOWN\n }\n this.#type = ter\n // windows just gets ENOENT in this case. We do cover the case,\n // just disabled because it's impossible on Windows CI\n /* c8 ignore start */\n if (code === 'ENOTDIR' && this.parent) {\n this.parent.#markENOTDIR()\n }\n /* c8 ignore stop */\n }\n\n #readdirAddChild(e: Dirent, c: Children) {\n return (\n this.#readdirMaybePromoteChild(e, c) ||\n this.#readdirAddNewChild(e, c)\n )\n }\n\n #readdirAddNewChild(e: Dirent, c: Children): PathBase {\n // alloc new entry at head, so it's never provisional\n const type = entToType(e)\n const child = this.newChild(e.name, type, { parent: this })\n const ifmt = child.#type & IFMT\n if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n child.#type |= ENOTDIR\n }\n c.unshift(child)\n c.provisional++\n return child\n }\n\n #readdirMaybePromoteChild(e: Dirent, c: Children): PathBase | undefined {\n for (let p = c.provisional; p < c.length; p++) {\n const pchild = c[p]\n const name =\n this.nocase ? normalizeNocase(e.name) : normalize(e.name)\n if (name !== pchild!.#matchName) {\n continue\n }\n\n return this.#readdirPromoteChild(e, pchild!, p, c)\n }\n }\n\n #readdirPromoteChild(\n e: Dirent,\n p: PathBase,\n index: number,\n c: Children,\n ): PathBase {\n const v = p.name\n // retain any other flags, but set ifmt from dirent\n p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e)\n // case sensitivity fixing when we learn the true name.\n if (v !== e.name) p.name = e.name\n\n // just advance provisional index (potentially off the list),\n // otherwise we have to splice/pop it out and re-insert at head\n if (index !== c.provisional) {\n if (index === c.length - 1) c.pop()\n else c.splice(index, 1)\n c.unshift(p)\n }\n c.provisional++\n return p\n }\n\n /**\n * Call lstat() on this Path, and update all known information that can be\n * determined.\n *\n * Note that unlike `fs.lstat()`, the returned value does not contain some\n * information, such as `mode`, `dev`, `nlink`, and `ino`. If that\n * information is required, you will need to call `fs.lstat` yourself.\n *\n * If the Path refers to a nonexistent file, or if the lstat call fails for\n * any reason, `undefined` is returned. Otherwise the updated Path object is\n * returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async lstat(): Promise {\n if ((this.#type & ENOENT) === 0) {\n try {\n this.#applyStat(await this.#fs.promises.lstat(this.fullpath()))\n return this\n } catch (er) {\n this.#lstatFail((er as NodeJS.ErrnoException).code)\n }\n }\n }\n\n /**\n * synchronous {@link PathBase.lstat}\n */\n lstatSync(): PathBase | undefined {\n if ((this.#type & ENOENT) === 0) {\n try {\n this.#applyStat(this.#fs.lstatSync(this.fullpath()))\n return this\n } catch (er) {\n this.#lstatFail((er as NodeJS.ErrnoException).code)\n }\n }\n }\n\n #applyStat(st: Stats) {\n const {\n atime,\n atimeMs,\n birthtime,\n birthtimeMs,\n blksize,\n blocks,\n ctime,\n ctimeMs,\n dev,\n gid,\n ino,\n mode,\n mtime,\n mtimeMs,\n nlink,\n rdev,\n size,\n uid,\n } = st\n this.#atime = atime\n this.#atimeMs = atimeMs\n this.#birthtime = birthtime\n this.#birthtimeMs = birthtimeMs\n this.#blksize = blksize\n this.#blocks = blocks\n this.#ctime = ctime\n this.#ctimeMs = ctimeMs\n this.#dev = dev\n this.#gid = gid\n this.#ino = ino\n this.#mode = mode\n this.#mtime = mtime\n this.#mtimeMs = mtimeMs\n this.#nlink = nlink\n this.#rdev = rdev\n this.#size = size\n this.#uid = uid\n const ifmt = entToType(st)\n // retain any other flags, but set the ifmt\n this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED\n if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n this.#type |= ENOTDIR\n }\n }\n\n #onReaddirCB: ((\n er: NodeJS.ErrnoException | null,\n entries: Path[],\n ) => any)[] = []\n #readdirCBInFlight: boolean = false\n #callOnReaddirCB(children: Path[]) {\n this.#readdirCBInFlight = false\n const cbs = this.#onReaddirCB.slice()\n this.#onReaddirCB.length = 0\n cbs.forEach(cb => cb(null, children))\n }\n\n /**\n * Standard node-style callback interface to get list of directory entries.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n *\n * @param cb The callback called with (er, entries). Note that the `er`\n * param is somewhat extraneous, as all readdir() errors are handled and\n * simply result in an empty set of entries being returned.\n * @param allowZalgo Boolean indicating that immediately known results should\n * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n * zalgo at your peril, the dark pony lord is devious and unforgiving.\n */\n readdirCB(\n cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any,\n allowZalgo: boolean = false,\n ): void {\n if (!this.canReaddir()) {\n if (allowZalgo) cb(null, [])\n else queueMicrotask(() => cb(null, []))\n return\n }\n\n const children = this.children()\n if (this.calledReaddir()) {\n const c = children.slice(0, children.provisional)\n if (allowZalgo) cb(null, c)\n else queueMicrotask(() => cb(null, c))\n return\n }\n\n // don't have to worry about zalgo at this point.\n this.#onReaddirCB.push(cb)\n if (this.#readdirCBInFlight) {\n return\n }\n this.#readdirCBInFlight = true\n\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath()\n this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n if (er) {\n this.#readdirFail((er as NodeJS.ErrnoException).code)\n children.provisional = 0\n } else {\n // if we didn't get an error, we always get entries.\n //@ts-ignore\n for (const e of entries) {\n this.#readdirAddChild(e, children)\n }\n this.#readdirSuccess(children)\n }\n this.#callOnReaddirCB(children.slice(0, children.provisional))\n return\n })\n }\n\n #asyncReaddirInFlight?: Promise\n\n /**\n * Return an array of known child entries.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async readdir(): Promise {\n if (!this.canReaddir()) {\n return []\n }\n\n const children = this.children()\n if (this.calledReaddir()) {\n return children.slice(0, children.provisional)\n }\n\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath()\n if (this.#asyncReaddirInFlight) {\n await this.#asyncReaddirInFlight\n } else {\n /* c8 ignore start */\n let resolve: () => void = () => {}\n /* c8 ignore stop */\n this.#asyncReaddirInFlight = new Promise(\n res => (resolve = res),\n )\n try {\n for (const e of await this.#fs.promises.readdir(fullpath, {\n withFileTypes: true,\n })) {\n this.#readdirAddChild(e, children)\n }\n this.#readdirSuccess(children)\n } catch (er) {\n this.#readdirFail((er as NodeJS.ErrnoException).code)\n children.provisional = 0\n }\n this.#asyncReaddirInFlight = undefined\n resolve()\n }\n return children.slice(0, children.provisional)\n }\n\n /**\n * synchronous {@link PathBase.readdir}\n */\n readdirSync(): PathBase[] {\n if (!this.canReaddir()) {\n return []\n }\n\n const children = this.children()\n if (this.calledReaddir()) {\n return children.slice(0, children.provisional)\n }\n\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath()\n try {\n for (const e of this.#fs.readdirSync(fullpath, {\n withFileTypes: true,\n })) {\n this.#readdirAddChild(e, children)\n }\n this.#readdirSuccess(children)\n } catch (er) {\n this.#readdirFail((er as NodeJS.ErrnoException).code)\n children.provisional = 0\n }\n return children.slice(0, children.provisional)\n }\n\n canReaddir() {\n if (this.#type & ENOCHILD) return false\n const ifmt = IFMT & this.#type\n // we always set ENOTDIR when setting IFMT, so should be impossible\n /* c8 ignore start */\n if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n return false\n }\n /* c8 ignore stop */\n return true\n }\n\n shouldWalk(\n dirs: Set,\n walkFilter?: (e: PathBase) => boolean,\n ): boolean {\n return (\n (this.#type & IFDIR) === IFDIR &&\n !(this.#type & ENOCHILD) &&\n !dirs.has(this) &&\n (!walkFilter || walkFilter(this))\n )\n }\n\n /**\n * Return the Path object corresponding to path as resolved\n * by realpath(3).\n *\n * If the realpath call fails for any reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n * On success, returns a Path object.\n */\n async realpath(): Promise {\n if (this.#realpath) return this.#realpath\n if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n try {\n const rp = await this.#fs.promises.realpath(this.fullpath())\n return (this.#realpath = this.resolve(rp))\n } catch (_) {\n this.#markENOREALPATH()\n }\n }\n\n /**\n * Synchronous {@link realpath}\n */\n realpathSync(): PathBase | undefined {\n if (this.#realpath) return this.#realpath\n if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n try {\n const rp = this.#fs.realpathSync(this.fullpath())\n return (this.#realpath = this.resolve(rp))\n } catch (_) {\n this.#markENOREALPATH()\n }\n }\n\n /**\n * Internal method to mark this Path object as the scurry cwd,\n * called by {@link PathScurry#chdir}\n *\n * @internal\n */\n [setAsCwd](oldCwd: PathBase): void {\n if (oldCwd === this) return\n oldCwd.isCWD = false\n this.isCWD = true\n\n const changed = new Set([])\n let rp = []\n let p: PathBase = this\n while (p && p.parent) {\n changed.add(p)\n p.#relative = rp.join(this.sep)\n p.#relativePosix = rp.join('/')\n p = p.parent\n rp.push('..')\n }\n // now un-memoize parents of old cwd\n p = oldCwd\n while (p && p.parent && !changed.has(p)) {\n p.#relative = undefined\n p.#relativePosix = undefined\n p = p.parent\n }\n }\n}\n\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nexport class PathWin32 extends PathBase {\n /**\n * Separator for generating path strings.\n */\n sep: '\\\\' = '\\\\'\n /**\n * Separator for parsing path strings.\n */\n splitSep: RegExp = eitherSep\n\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(\n name: string,\n type: number = UNKNOWN,\n root: PathBase | undefined,\n roots: { [k: string]: PathBase },\n nocase: boolean,\n children: ChildrenCache,\n opts: PathOpts,\n ) {\n super(name, type, root, roots, nocase, children, opts)\n }\n\n /**\n * @internal\n */\n newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n return new PathWin32(\n name,\n type,\n this.root,\n this.roots,\n this.nocase,\n this.childrenCache(),\n opts,\n )\n }\n\n /**\n * @internal\n */\n getRootString(path: string): string {\n return win32.parse(path).root\n }\n\n /**\n * @internal\n */\n getRoot(rootPath: string): PathBase {\n rootPath = uncToDrive(rootPath.toUpperCase())\n if (rootPath === this.root.name) {\n return this.root\n }\n // ok, not that one, check if it matches another we know about\n for (const [compare, root] of Object.entries(this.roots)) {\n if (this.sameRoot(rootPath, compare)) {\n return (this.roots[rootPath] = root)\n }\n }\n // otherwise, have to create a new one.\n return (this.roots[rootPath] = new PathScurryWin32(\n rootPath,\n this,\n ).root)\n }\n\n /**\n * @internal\n */\n sameRoot(rootPath: string, compare: string = this.root.name): boolean {\n // windows can (rarely) have case-sensitive filesystem, but\n // UNC and drive letters are always case-insensitive, and canonically\n // represented uppercase.\n rootPath = rootPath\n .toUpperCase()\n .replace(/\\//g, '\\\\')\n .replace(uncDriveRegexp, '$1\\\\')\n return rootPath === compare\n }\n}\n\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nexport class PathPosix extends PathBase {\n /**\n * separator for parsing path strings\n */\n splitSep: '/' = '/'\n /**\n * separator for generating path strings\n */\n sep: '/' = '/'\n\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(\n name: string,\n type: number = UNKNOWN,\n root: PathBase | undefined,\n roots: { [k: string]: PathBase },\n nocase: boolean,\n children: ChildrenCache,\n opts: PathOpts,\n ) {\n super(name, type, root, roots, nocase, children, opts)\n }\n\n /**\n * @internal\n */\n getRootString(path: string): string {\n return path.startsWith('/') ? '/' : ''\n }\n\n /**\n * @internal\n */\n getRoot(_rootPath: string): PathBase {\n return this.root\n }\n\n /**\n * @internal\n */\n newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n return new PathPosix(\n name,\n type,\n this.root,\n this.roots,\n this.nocase,\n this.childrenCache(),\n opts,\n )\n }\n}\n\n/**\n * Options that may be provided to the PathScurry constructor\n */\nexport interface PathScurryOpts {\n /**\n * perform case-insensitive path matching. Default based on platform\n * subclass.\n */\n nocase?: boolean\n /**\n * Number of Path entries to keep in the cache of Path child references.\n *\n * Setting this higher than 65536 will dramatically increase the data\n * consumption and construction time overhead of each PathScurry.\n *\n * Setting this value to 256 or lower will significantly reduce the data\n * consumption and construction time overhead, but may also reduce resolve()\n * and readdir() performance on large filesystems.\n *\n * Default `16384`.\n */\n childrenCacheSize?: number\n /**\n * An object that overrides the built-in functions from the fs and\n * fs/promises modules.\n *\n * See {@link FSOption}\n */\n fs?: FSOption\n}\n\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nexport abstract class PathScurryBase {\n /**\n * The root Path entry for the current working directory of this Scurry\n */\n root: PathBase\n /**\n * The string path for the root of this Scurry's current working directory\n */\n rootPath: string\n /**\n * A collection of all roots encountered, referenced by rootPath\n */\n roots: { [k: string]: PathBase }\n /**\n * The Path entry corresponding to this PathScurry's current working directory.\n */\n cwd: PathBase\n #resolveCache: ResolveCache\n #resolvePosixCache: ResolveCache\n #children: ChildrenCache\n /**\n * Perform path comparisons case-insensitively.\n *\n * Defaults true on Darwin and Windows systems, false elsewhere.\n */\n nocase: boolean\n\n /**\n * The path separator used for parsing paths\n *\n * `'/'` on Posix systems, either `'/'` or `'\\\\'` on Windows\n */\n abstract sep: string | RegExp\n\n #fs: FSValue\n\n /**\n * This class should not be instantiated directly.\n *\n * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n *\n * @internal\n */\n constructor(\n cwd: URL | string = process.cwd(),\n pathImpl: typeof win32 | typeof posix,\n sep: string | RegExp,\n {\n nocase,\n childrenCacheSize = 16 * 1024,\n fs = defaultFS,\n }: PathScurryOpts = {},\n ) {\n this.#fs = fsFromOption(fs)\n if (cwd instanceof URL || cwd.startsWith('file://')) {\n cwd = fileURLToPath(cwd)\n }\n // resolve and split root, and then add to the store.\n // this is the only time we call path.resolve()\n const cwdPath = pathImpl.resolve(cwd)\n this.roots = Object.create(null)\n this.rootPath = this.parseRootPath(cwdPath)\n this.#resolveCache = new ResolveCache()\n this.#resolvePosixCache = new ResolveCache()\n this.#children = new ChildrenCache(childrenCacheSize)\n\n const split = cwdPath.substring(this.rootPath.length).split(sep)\n // resolve('/') leaves '', splits to [''], we don't want that.\n if (split.length === 1 && !split[0]) {\n split.pop()\n }\n /* c8 ignore start */\n if (nocase === undefined) {\n throw new TypeError(\n 'must provide nocase setting to PathScurryBase ctor',\n )\n }\n /* c8 ignore stop */\n this.nocase = nocase\n this.root = this.newRoot(this.#fs)\n this.roots[this.rootPath] = this.root\n let prev: PathBase = this.root\n let len = split.length - 1\n const joinSep = pathImpl.sep\n let abs = this.rootPath\n let sawFirst = false\n for (const part of split) {\n const l = len--\n prev = prev.child(part, {\n relative: new Array(l).fill('..').join(joinSep),\n relativePosix: new Array(l).fill('..').join('/'),\n fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n })\n sawFirst = true\n }\n this.cwd = prev\n }\n\n /**\n * Get the depth of a provided path, string, or the cwd\n */\n depth(path: Path | string = this.cwd): number {\n if (typeof path === 'string') {\n path = this.cwd.resolve(path)\n }\n return path.depth()\n }\n\n /**\n * Parse the root portion of a path string\n *\n * @internal\n */\n abstract parseRootPath(dir: string): string\n /**\n * create a new Path to use as root during construction.\n *\n * @internal\n */\n abstract newRoot(fs: FSValue): PathBase\n /**\n * Determine whether a given path string is absolute\n */\n abstract isAbsolute(p: string): boolean\n\n /**\n * Return the cache of child entries. Exposed so subclasses can create\n * child Path objects in a platform-specific way.\n *\n * @internal\n */\n childrenCache() {\n return this.#children\n }\n\n /**\n * Resolve one or more path strings to a resolved string\n *\n * Same interface as require('path').resolve.\n *\n * Much faster than path.resolve() when called multiple times for the same\n * path, because the resolved Path objects are cached. Much slower\n * otherwise.\n */\n resolve(...paths: string[]): string {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = ''\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i]\n if (!p || p === '.') continue\n r = r ? `${p}/${r}` : p\n if (this.isAbsolute(p)) {\n break\n }\n }\n const cached = this.#resolveCache.get(r)\n if (cached !== undefined) {\n return cached\n }\n const result = this.cwd.resolve(r).fullpath()\n this.#resolveCache.set(r, result)\n return result\n }\n\n /**\n * Resolve one or more path strings to a resolved string, returning\n * the posix path. Identical to .resolve() on posix systems, but on\n * windows will return a forward-slash separated UNC path.\n *\n * Same interface as require('path').resolve.\n *\n * Much faster than path.resolve() when called multiple times for the same\n * path, because the resolved Path objects are cached. Much slower\n * otherwise.\n */\n resolvePosix(...paths: string[]): string {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = ''\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i]\n if (!p || p === '.') continue\n r = r ? `${p}/${r}` : p\n if (this.isAbsolute(p)) {\n break\n }\n }\n const cached = this.#resolvePosixCache.get(r)\n if (cached !== undefined) {\n return cached\n }\n const result = this.cwd.resolve(r).fullpathPosix()\n this.#resolvePosixCache.set(r, result)\n return result\n }\n\n /**\n * find the relative path from the cwd to the supplied path string or entry\n */\n relative(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.relative()\n }\n\n /**\n * find the relative path from the cwd to the supplied path string or\n * entry, using / as the path delimiter, even on Windows.\n */\n relativePosix(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.relativePosix()\n }\n\n /**\n * Return the basename for the provided string or Path object\n */\n basename(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.name\n }\n\n /**\n * Return the dirname for the provided string or Path object\n */\n dirname(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return (entry.parent || entry).fullpath()\n }\n\n /**\n * Return an array of known child entries.\n *\n * First argument may be either a string, or a Path object.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n *\n * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set\n * `{ withFileTypes: false }` to return strings.\n */\n\n readdir(): Promise\n readdir(opts: { withFileTypes: true }): Promise\n readdir(opts: { withFileTypes: false }): Promise\n readdir(opts: { withFileTypes: boolean }): Promise\n readdir(entry: PathBase | string): Promise\n readdir(\n entry: PathBase | string,\n opts: { withFileTypes: true },\n ): Promise\n readdir(\n entry: PathBase | string,\n opts: { withFileTypes: false },\n ): Promise\n readdir(\n entry: PathBase | string,\n opts: { withFileTypes: boolean },\n ): Promise\n async readdir(\n entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n opts: { withFileTypes: boolean } = {\n withFileTypes: true,\n },\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const { withFileTypes } = opts\n if (!entry.canReaddir()) {\n return []\n } else {\n const p = await entry.readdir()\n return withFileTypes ? p : p.map(e => e.name)\n }\n }\n\n /**\n * synchronous {@link PathScurryBase.readdir}\n */\n readdirSync(): PathBase[]\n readdirSync(opts: { withFileTypes: true }): PathBase[]\n readdirSync(opts: { withFileTypes: false }): string[]\n readdirSync(opts: { withFileTypes: boolean }): PathBase[] | string[]\n readdirSync(entry: PathBase | string): PathBase[]\n readdirSync(\n entry: PathBase | string,\n opts: { withFileTypes: true },\n ): PathBase[]\n readdirSync(\n entry: PathBase | string,\n opts: { withFileTypes: false },\n ): string[]\n readdirSync(\n entry: PathBase | string,\n opts: { withFileTypes: boolean },\n ): PathBase[] | string[]\n readdirSync(\n entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n opts: { withFileTypes: boolean } = {\n withFileTypes: true,\n },\n ): PathBase[] | string[] {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const { withFileTypes = true } = opts\n if (!entry.canReaddir()) {\n return []\n } else if (withFileTypes) {\n return entry.readdirSync()\n } else {\n return entry.readdirSync().map(e => e.name)\n }\n }\n\n /**\n * Call lstat() on the string or Path object, and update all known\n * information that can be determined.\n *\n * Note that unlike `fs.lstat()`, the returned value does not contain some\n * information, such as `mode`, `dev`, `nlink`, and `ino`. If that\n * information is required, you will need to call `fs.lstat` yourself.\n *\n * If the Path refers to a nonexistent file, or if the lstat call fails for\n * any reason, `undefined` is returned. Otherwise the updated Path object is\n * returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async lstat(\n entry: string | PathBase = this.cwd,\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.lstat()\n }\n\n /**\n * synchronous {@link PathScurryBase.lstat}\n */\n lstatSync(entry: string | PathBase = this.cwd): PathBase | undefined {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.lstatSync()\n }\n\n /**\n * Return the Path object or string path corresponding to the target of a\n * symbolic link.\n *\n * If the path is not a symbolic link, or if the readlink call fails for any\n * reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n *\n * `{withFileTypes}` option defaults to `false`.\n *\n * On success, returns a Path object if `withFileTypes` option is true,\n * otherwise a string.\n */\n readlink(): Promise\n readlink(opt: { withFileTypes: false }): Promise\n readlink(opt: { withFileTypes: true }): Promise\n readlink(opt: {\n withFileTypes: boolean\n }): Promise\n readlink(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): Promise\n readlink(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): Promise\n readlink(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): Promise\n async readlink(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = await entry.readlink()\n return withFileTypes ? e : e?.fullpath()\n }\n\n /**\n * synchronous {@link PathScurryBase.readlink}\n */\n readlinkSync(): string | undefined\n readlinkSync(opt: { withFileTypes: false }): string | undefined\n readlinkSync(opt: { withFileTypes: true }): PathBase | undefined\n readlinkSync(opt: {\n withFileTypes: boolean\n }): PathBase | string | undefined\n readlinkSync(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): string | undefined\n readlinkSync(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): PathBase | undefined\n readlinkSync(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): string | PathBase | undefined\n readlinkSync(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): string | PathBase | undefined {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = entry.readlinkSync()\n return withFileTypes ? e : e?.fullpath()\n }\n\n /**\n * Return the Path object or string path corresponding to path as resolved\n * by realpath(3).\n *\n * If the realpath call fails for any reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n *\n * `{withFileTypes}` option defaults to `false`.\n *\n * On success, returns a Path object if `withFileTypes` option is true,\n * otherwise a string.\n */\n realpath(): Promise\n realpath(opt: { withFileTypes: false }): Promise\n realpath(opt: { withFileTypes: true }): Promise\n realpath(opt: {\n withFileTypes: boolean\n }): Promise\n realpath(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): Promise\n realpath(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): Promise\n realpath(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): Promise\n async realpath(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = await entry.realpath()\n return withFileTypes ? e : e?.fullpath()\n }\n\n realpathSync(): string | undefined\n realpathSync(opt: { withFileTypes: false }): string | undefined\n realpathSync(opt: { withFileTypes: true }): PathBase | undefined\n realpathSync(opt: {\n withFileTypes: boolean\n }): PathBase | string | undefined\n realpathSync(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): string | undefined\n realpathSync(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): PathBase | undefined\n realpathSync(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): string | PathBase | undefined\n realpathSync(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): string | PathBase | undefined {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = entry.realpathSync()\n return withFileTypes ? e : e?.fullpath()\n }\n\n /**\n * Asynchronously walk the directory tree, returning an array of\n * all path strings or Path objects found.\n *\n * Note that this will be extremely memory-hungry on large filesystems.\n * In such cases, it may be better to use the stream or async iterator\n * walk implementation.\n */\n walk(): Promise\n walk(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Promise\n walk(opts: WalkOptionsWithFileTypesFalse): Promise\n walk(opts: WalkOptions): Promise\n walk(entry: string | PathBase): Promise\n walk(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Promise\n walk(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Promise\n walk(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Promise\n async walk(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results: (string | PathBase)[] = []\n if (!filter || filter(entry)) {\n results.push(withFileTypes ? entry : entry.fullpath())\n }\n const dirs = new Set()\n const walk = (\n dir: PathBase,\n cb: (er?: NodeJS.ErrnoException) => void,\n ) => {\n dirs.add(dir)\n dir.readdirCB((er, entries) => {\n /* c8 ignore start */\n if (er) {\n return cb(er)\n }\n /* c8 ignore stop */\n let len = entries.length\n if (!len) return cb()\n const next = () => {\n if (--len === 0) {\n cb()\n }\n }\n for (const e of entries) {\n if (!filter || filter(e)) {\n results.push(withFileTypes ? e : e.fullpath())\n }\n if (follow && e.isSymbolicLink()) {\n e.realpath()\n .then(r => (r?.isUnknown() ? r.lstat() : r))\n .then(r =>\n r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next(),\n )\n } else {\n if (e.shouldWalk(dirs, walkFilter)) {\n walk(e, next)\n } else {\n next()\n }\n }\n }\n }, true) // zalgooooooo\n }\n\n const start = entry\n return new Promise((res, rej) => {\n walk(start, er => {\n /* c8 ignore start */\n if (er) return rej(er)\n /* c8 ignore stop */\n res(results as PathBase[] | string[])\n })\n })\n }\n\n /**\n * Synchronously walk the directory tree, returning an array of\n * all path strings or Path objects found.\n *\n * Note that this will be extremely memory-hungry on large filesystems.\n * In such cases, it may be better to use the stream or async iterator\n * walk implementation.\n */\n walkSync(): PathBase[]\n walkSync(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): PathBase[]\n walkSync(opts: WalkOptionsWithFileTypesFalse): string[]\n walkSync(opts: WalkOptions): string[] | PathBase[]\n walkSync(entry: string | PathBase): PathBase[]\n walkSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n ): PathBase[]\n walkSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): string[]\n walkSync(\n entry: string | PathBase,\n opts: WalkOptions,\n ): PathBase[] | string[]\n walkSync(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): PathBase[] | string[] {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results: (string | PathBase)[] = []\n if (!filter || filter(entry)) {\n results.push(withFileTypes ? entry : entry.fullpath())\n }\n const dirs = new Set([entry])\n for (const dir of dirs) {\n const entries = dir.readdirSync()\n for (const e of entries) {\n if (!filter || filter(e)) {\n results.push(withFileTypes ? e : e.fullpath())\n }\n let r: PathBase | undefined = e\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync()))) continue\n if (r.isUnknown()) r.lstatSync()\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n dirs.add(r)\n }\n }\n }\n return results as string[] | PathBase[]\n }\n\n /**\n * Support for `for await`\n *\n * Alias for {@link PathScurryBase.iterate}\n *\n * Note: As of Node 19, this is very slow, compared to other methods of\n * walking. Consider using {@link PathScurryBase.stream} if memory overhead\n * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n */\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n\n /**\n * Async generator form of {@link PathScurryBase.walk}\n *\n * Note: As of Node 19, this is very slow, compared to other methods of\n * walking, especially if most/all of the directory tree has been previously\n * walked. Consider using {@link PathScurryBase.stream} if memory overhead\n * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n */\n iterate(): AsyncGenerator\n iterate(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): AsyncGenerator\n iterate(\n opts: WalkOptionsWithFileTypesFalse,\n ): AsyncGenerator\n iterate(opts: WalkOptions): AsyncGenerator\n iterate(entry: string | PathBase): AsyncGenerator\n iterate(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): AsyncGenerator\n iterate(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): AsyncGenerator\n iterate(\n entry: string | PathBase,\n opts: WalkOptions,\n ): AsyncGenerator\n iterate(\n entry: string | PathBase | WalkOptions = this.cwd,\n options: WalkOptions = {},\n ): AsyncGenerator {\n // iterating async over the stream is significantly more performant,\n // especially in the warm-cache scenario, because it buffers up directory\n // entries in the background instead of waiting for a yield for each one.\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n options = entry\n entry = this.cwd\n }\n return this.stream(entry, options)[Symbol.asyncIterator]()\n }\n\n /**\n * Iterating over a PathScurry performs a synchronous walk.\n *\n * Alias for {@link PathScurryBase.iterateSync}\n */\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n iterateSync(): Generator\n iterateSync(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Generator\n iterateSync(\n opts: WalkOptionsWithFileTypesFalse,\n ): Generator\n iterateSync(opts: WalkOptions): Generator\n iterateSync(entry: string | PathBase): Generator\n iterateSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Generator\n iterateSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Generator\n iterateSync(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Generator\n *iterateSync(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Generator {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n if (!filter || filter(entry)) {\n yield withFileTypes ? entry : entry.fullpath()\n }\n const dirs = new Set([entry])\n for (const dir of dirs) {\n const entries = dir.readdirSync()\n for (const e of entries) {\n if (!filter || filter(e)) {\n yield withFileTypes ? e : e.fullpath()\n }\n let r: PathBase | undefined = e\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync()))) continue\n if (r.isUnknown()) r.lstatSync()\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n dirs.add(r)\n }\n }\n }\n }\n\n /**\n * Stream form of {@link PathScurryBase.walk}\n *\n * Returns a Minipass stream that emits {@link PathBase} objects by default,\n * or strings if `{ withFileTypes: false }` is set in the options.\n */\n stream(): Minipass\n stream(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Minipass\n stream(opts: WalkOptionsWithFileTypesFalse): Minipass\n stream(opts: WalkOptions): Minipass\n stream(entry: string | PathBase): Minipass\n stream(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n ): Minipass\n stream(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Minipass\n stream(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Minipass | Minipass\n stream(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Minipass | Minipass {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results = new Minipass({ objectMode: true })\n if (!filter || filter(entry)) {\n results.write(withFileTypes ? entry : entry.fullpath())\n }\n const dirs = new Set()\n const queue: PathBase[] = [entry]\n let processing = 0\n const process = () => {\n let paused = false\n while (!paused) {\n const dir = queue.shift()\n if (!dir) {\n if (processing === 0) results.end()\n return\n }\n\n processing++\n dirs.add(dir)\n\n const onReaddir = (\n er: null | NodeJS.ErrnoException,\n entries: PathBase[],\n didRealpaths: boolean = false,\n ) => {\n /* c8 ignore start */\n if (er) return results.emit('error', er)\n /* c8 ignore stop */\n if (follow && !didRealpaths) {\n const promises: Promise[] = []\n for (const e of entries) {\n if (e.isSymbolicLink()) {\n promises.push(\n e\n .realpath()\n .then((r: PathBase | undefined) =>\n r?.isUnknown() ? r.lstat() : r,\n ),\n )\n }\n }\n if (promises.length) {\n Promise.all(promises).then(() =>\n onReaddir(null, entries, true),\n )\n return\n }\n }\n\n for (const e of entries) {\n if (e && (!filter || filter(e))) {\n if (!results.write(withFileTypes ? e : e.fullpath())) {\n paused = true\n }\n }\n }\n\n processing--\n for (const e of entries) {\n const r = e.realpathCached() || e\n if (r.shouldWalk(dirs, walkFilter)) {\n queue.push(r)\n }\n }\n if (paused && !results.flowing) {\n results.once('drain', process)\n } else if (!sync) {\n process()\n }\n }\n\n // zalgo containment\n let sync = true\n dir.readdirCB(onReaddir, true)\n sync = false\n }\n }\n process()\n return results as Minipass | Minipass\n }\n\n /**\n * Synchronous form of {@link PathScurryBase.stream}\n *\n * Returns a Minipass stream that emits {@link PathBase} objects by default,\n * or strings if `{ withFileTypes: false }` is set in the options.\n *\n * Will complete the walk in a single tick if the stream is consumed fully.\n * Otherwise, will pause as needed for stream backpressure.\n */\n streamSync(): Minipass\n streamSync(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Minipass\n streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass\n streamSync(opts: WalkOptions): Minipass\n streamSync(entry: string | PathBase): Minipass\n streamSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n ): Minipass\n streamSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Minipass\n streamSync(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Minipass | Minipass\n streamSync(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Minipass | Minipass {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results = new Minipass({ objectMode: true })\n const dirs = new Set()\n if (!filter || filter(entry)) {\n results.write(withFileTypes ? entry : entry.fullpath())\n }\n const queue: PathBase[] = [entry]\n let processing = 0\n const process = () => {\n let paused = false\n while (!paused) {\n const dir = queue.shift()\n if (!dir) {\n if (processing === 0) results.end()\n return\n }\n processing++\n dirs.add(dir)\n\n const entries = dir.readdirSync()\n for (const e of entries) {\n if (!filter || filter(e)) {\n if (!results.write(withFileTypes ? e : e.fullpath())) {\n paused = true\n }\n }\n }\n processing--\n for (const e of entries) {\n let r: PathBase | undefined = e\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync()))) continue\n if (r.isUnknown()) r.lstatSync()\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n queue.push(r)\n }\n }\n }\n if (paused && !results.flowing) results.once('drain', process)\n }\n process()\n return results as Minipass | Minipass\n }\n\n chdir(path: string | Path = this.cwd) {\n const oldCwd = this.cwd\n this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path\n this.cwd[setAsCwd](oldCwd)\n }\n}\n\n/**\n * Options provided to all walk methods.\n */\nexport interface WalkOptions {\n /**\n * Return results as {@link PathBase} objects rather than strings.\n * When set to false, results are fully resolved paths, as returned by\n * {@link PathBase.fullpath}.\n * @default true\n */\n withFileTypes?: boolean\n\n /**\n * Attempt to read directory entries from symbolic links. Otherwise, only\n * actual directories are traversed. Regardless of this setting, a given\n * target path will only ever be walked once, meaning that a symbolic link\n * to a previously traversed directory will never be followed.\n *\n * Setting this imposes a slight performance penalty, because `readlink`\n * must be called on all symbolic links encountered, in order to avoid\n * infinite cycles.\n * @default false\n */\n follow?: boolean\n\n /**\n * Only return entries where the provided function returns true.\n *\n * This will not prevent directories from being traversed, even if they do\n * not pass the filter, though it will prevent directories themselves from\n * being included in the result set. See {@link walkFilter}\n *\n * Asynchronous functions are not supported here.\n *\n * By default, if no filter is provided, all entries and traversed\n * directories are included.\n */\n filter?: (entry: PathBase) => boolean\n\n /**\n * Only traverse directories (and in the case of {@link follow} being set to\n * true, symbolic links to directories) if the provided function returns\n * true.\n *\n * This will not prevent directories from being included in the result set,\n * even if they do not pass the supplied filter function. See {@link filter}\n * to do that.\n *\n * Asynchronous functions are not supported here.\n */\n walkFilter?: (entry: PathBase) => boolean\n}\n\nexport type WalkOptionsWithFileTypesUnset = WalkOptions & {\n withFileTypes?: undefined\n}\nexport type WalkOptionsWithFileTypesTrue = WalkOptions & {\n withFileTypes: true\n}\nexport type WalkOptionsWithFileTypesFalse = WalkOptions & {\n withFileTypes: false\n}\n\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings. Uses\n * {@link PathWin32} for Path objects.\n */\nexport class PathScurryWin32 extends PathScurryBase {\n /**\n * separator for generating path strings\n */\n sep: '\\\\' = '\\\\'\n\n constructor(\n cwd: URL | string = process.cwd(),\n opts: PathScurryOpts = {},\n ) {\n const { nocase = true } = opts\n super(cwd, win32, '\\\\', { ...opts, nocase })\n this.nocase = nocase\n for (let p: PathBase | undefined = this.cwd; p; p = p.parent) {\n p.nocase = this.nocase\n }\n }\n\n /**\n * @internal\n */\n parseRootPath(dir: string): string {\n // if the path starts with a single separator, it's not a UNC, and we'll\n // just get separator as the root, and driveFromUNC will return \\\n // In that case, mount \\ on the root from the cwd.\n return win32.parse(dir).root.toUpperCase()\n }\n\n /**\n * @internal\n */\n newRoot(fs: FSValue) {\n return new PathWin32(\n this.rootPath,\n IFDIR,\n undefined,\n this.roots,\n this.nocase,\n this.childrenCache(),\n { fs },\n )\n }\n\n /**\n * Return true if the provided path string is an absolute path\n */\n isAbsolute(p: string): boolean {\n return (\n p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p)\n )\n }\n}\n\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryPosix extends PathScurryBase {\n /**\n * separator for generating path strings\n */\n sep: '/' = '/'\n constructor(\n cwd: URL | string = process.cwd(),\n opts: PathScurryOpts = {},\n ) {\n const { nocase = false } = opts\n super(cwd, posix, '/', { ...opts, nocase })\n this.nocase = nocase\n }\n\n /**\n * @internal\n */\n parseRootPath(_dir: string): string {\n return '/'\n }\n\n /**\n * @internal\n */\n newRoot(fs: FSValue) {\n return new PathPosix(\n this.rootPath,\n IFDIR,\n undefined,\n this.roots,\n this.nocase,\n this.childrenCache(),\n { fs },\n )\n }\n\n /**\n * Return true if the provided path string is an absolute path\n */\n isAbsolute(p: string): boolean {\n return p.startsWith('/')\n }\n}\n\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryDarwin extends PathScurryPosix {\n constructor(\n cwd: URL | string = process.cwd(),\n opts: PathScurryOpts = {},\n ) {\n const { nocase = true } = opts\n super(cwd, { ...opts, nocase })\n }\n}\n\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexport const Path = process.platform === 'win32' ? PathWin32 : PathPosix\nexport type Path = PathBase | InstanceType\n\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexport const PathScurry:\n | typeof PathScurryWin32\n | typeof PathScurryDarwin\n | typeof PathScurryPosix =\n process.platform === 'win32' ? PathScurryWin32\n : process.platform === 'darwin' ? PathScurryDarwin\n : PathScurryPosix\nexport type PathScurry = PathScurryBase | InstanceType\n"]} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/commonjs/package.json b/node_modules/path-scurry/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/path-scurry/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/path-scurry/dist/esm/index.d.ts b/node_modules/path-scurry/dist/esm/index.d.ts new file mode 100644 index 0000000..33b3edb --- /dev/null +++ b/node_modules/path-scurry/dist/esm/index.d.ts @@ -0,0 +1,1116 @@ +/// +/// +/// +import { LRUCache } from 'lru-cache'; +import { posix, win32 } from 'node:path'; +import { Minipass } from 'minipass'; +import type { Dirent, Stats } from 'node:fs'; +/** + * An object that will be used to override the default `fs` + * methods. Any methods that are not overridden will use Node's + * built-in implementations. + * + * - lstatSync + * - readdir (callback `withFileTypes` Dirent variant, used for + * readdirCB and most walks) + * - readdirSync + * - readlinkSync + * - realpathSync + * - promises: Object containing the following async methods: + * - lstat + * - readdir (Dirent variant only) + * - readlink + * - realpath + */ +export interface FSOption { + lstatSync?: (path: string) => Stats; + readdir?: (path: string, options: { + withFileTypes: true; + }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; + readdirSync?: (path: string, options: { + withFileTypes: true; + }) => Dirent[]; + readlinkSync?: (path: string) => string; + realpathSync?: (path: string) => string; + promises?: { + lstat?: (path: string) => Promise; + readdir?: (path: string, options: { + withFileTypes: true; + }) => Promise; + readlink?: (path: string) => Promise; + realpath?: (path: string) => Promise; + [k: string]: any; + }; + [k: string]: any; +} +interface FSValue { + lstatSync: (path: string) => Stats; + readdir: (path: string, options: { + withFileTypes: true; + }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void; + readdirSync: (path: string, options: { + withFileTypes: true; + }) => Dirent[]; + readlinkSync: (path: string) => string; + realpathSync: (path: string) => string; + promises: { + lstat: (path: string) => Promise; + readdir: (path: string, options: { + withFileTypes: true; + }) => Promise; + readlink: (path: string) => Promise; + realpath: (path: string) => Promise; + [k: string]: any; + }; + [k: string]: any; +} +export type Type = 'Unknown' | 'FIFO' | 'CharacterDevice' | 'Directory' | 'BlockDevice' | 'File' | 'SymbolicLink' | 'Socket'; +/** + * Options that may be provided to the Path constructor + */ +export interface PathOpts { + fullpath?: string; + relative?: string; + relativePosix?: string; + parent?: PathBase; + /** + * See {@link FSOption} + */ + fs?: FSOption; +} +/** + * An LRUCache for storing resolved path strings or Path objects. + * @internal + */ +export declare class ResolveCache extends LRUCache { + constructor(); +} +/** + * an LRUCache for storing child entries. + * @internal + */ +export declare class ChildrenCache extends LRUCache { + constructor(maxSize?: number); +} +/** + * Array of Path objects, plus a marker indicating the first provisional entry + * + * @internal + */ +export type Children = PathBase[] & { + provisional: number; +}; +declare const setAsCwd: unique symbol; +/** + * Path objects are sort of like a super-powered + * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} + * + * Each one represents a single filesystem entry on disk, which may or may not + * exist. It includes methods for reading various types of information via + * lstat, readlink, and readdir, and caches all information to the greatest + * degree possible. + * + * Note that fs operations that would normally throw will instead return an + * "empty" value. This is in order to prevent excessive overhead from error + * stack traces. + */ +export declare abstract class PathBase implements Dirent { + #private; + /** + * the basename of this path + * + * **Important**: *always* test the path name against any test string + * usingthe {@link isNamed} method, and not by directly comparing this + * string. Otherwise, unicode path strings that the system sees as identical + * will not be properly treated as the same path, leading to incorrect + * behavior and possible security issues. + */ + name: string; + /** + * the Path entry corresponding to the path root. + * + * @internal + */ + root: PathBase; + /** + * All roots found within the current PathScurry family + * + * @internal + */ + roots: { + [k: string]: PathBase; + }; + /** + * a reference to the parent path, or undefined in the case of root entries + * + * @internal + */ + parent?: PathBase; + /** + * boolean indicating whether paths are compared case-insensitively + * @internal + */ + nocase: boolean; + /** + * boolean indicating that this path is the current working directory + * of the PathScurry collection that contains it. + */ + isCWD: boolean; + /** + * the string or regexp used to split paths. On posix, it is `'/'`, and on + * windows it is a RegExp matching either `'/'` or `'\\'` + */ + abstract splitSep: string | RegExp; + /** + * The path separator string to use when joining paths + */ + abstract sep: string; + get dev(): number | undefined; + get mode(): number | undefined; + get nlink(): number | undefined; + get uid(): number | undefined; + get gid(): number | undefined; + get rdev(): number | undefined; + get blksize(): number | undefined; + get ino(): number | undefined; + get size(): number | undefined; + get blocks(): number | undefined; + get atimeMs(): number | undefined; + get mtimeMs(): number | undefined; + get ctimeMs(): number | undefined; + get birthtimeMs(): number | undefined; + get atime(): Date | undefined; + get mtime(): Date | undefined; + get ctime(): Date | undefined; + get birthtime(): Date | undefined; + /** + * This property is for compatibility with the Dirent class as of + * Node v20, where Dirent['parentPath'] refers to the path of the + * directory that was passed to readdir. For root entries, it's the path + * to the entry itself. + */ + get parentPath(): string; + /** + * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, + * this property refers to the *parent* path, not the path object itself. + */ + get path(): string; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: { + [k: string]: PathBase; + }, nocase: boolean, children: ChildrenCache, opts: PathOpts); + /** + * Returns the depth of the Path object from its root. + * + * For example, a path at `/foo/bar` would have a depth of 2. + */ + depth(): number; + /** + * @internal + */ + abstract getRootString(path: string): string; + /** + * @internal + */ + abstract getRoot(rootPath: string): PathBase; + /** + * @internal + */ + abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase; + /** + * @internal + */ + childrenCache(): ChildrenCache; + /** + * Get the Path object referenced by the string path, resolved from this Path + */ + resolve(path?: string): PathBase; + /** + * Returns the cached children Path objects, if still available. If they + * have fallen out of the cache, then returns an empty array, and resets the + * READDIR_CALLED bit, so that future calls to readdir() will require an fs + * lookup. + * + * @internal + */ + children(): Children; + /** + * Resolves a path portion and returns or creates the child Path. + * + * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is + * `'..'`. + * + * This should not be called directly. If `pathPart` contains any path + * separators, it will lead to unsafe undefined behavior. + * + * Use `Path.resolve()` instead. + * + * @internal + */ + child(pathPart: string, opts?: PathOpts): PathBase; + /** + * The relative path from the cwd. If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpath() + */ + relative(): string; + /** + * The relative path from the cwd, using / as the path separator. + * If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpathPosix() + * On posix systems, this is identical to relative(). + */ + relativePosix(): string; + /** + * The fully resolved path string for this Path entry + */ + fullpath(): string; + /** + * On platforms other than windows, this is identical to fullpath. + * + * On windows, this is overridden to return the forward-slash form of the + * full UNC path. + */ + fullpathPosix(): string; + /** + * Is the Path of an unknown type? + * + * Note that we might know *something* about it if there has been a previous + * filesystem operation, for example that it does not exist, or is not a + * link, or whether it has child entries. + */ + isUnknown(): boolean; + isType(type: Type): boolean; + getType(): Type; + /** + * Is the Path a regular file? + */ + isFile(): boolean; + /** + * Is the Path a directory? + */ + isDirectory(): boolean; + /** + * Is the path a character device? + */ + isCharacterDevice(): boolean; + /** + * Is the path a block device? + */ + isBlockDevice(): boolean; + /** + * Is the path a FIFO pipe? + */ + isFIFO(): boolean; + /** + * Is the path a socket? + */ + isSocket(): boolean; + /** + * Is the path a symbolic link? + */ + isSymbolicLink(): boolean; + /** + * Return the entry if it has been subject of a successful lstat, or + * undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* simply + * mean that we haven't called lstat on it. + */ + lstatCached(): PathBase | undefined; + /** + * Return the cached link target if the entry has been the subject of a + * successful readlink, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readlink() has been called at some point. + */ + readlinkCached(): PathBase | undefined; + /** + * Returns the cached realpath target if the entry has been the subject + * of a successful realpath, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * realpath() has been called at some point. + */ + realpathCached(): PathBase | undefined; + /** + * Returns the cached child Path entries array if the entry has been the + * subject of a successful readdir(), or [] otherwise. + * + * Does not read the filesystem, so an empty array *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readdir() has been called recently enough to still be valid. + */ + readdirCached(): PathBase[]; + /** + * Return true if it's worth trying to readlink. Ie, we don't (yet) have + * any indication that readlink will definitely fail. + * + * Returns false if the path is known to not be a symlink, if a previous + * readlink failed, or if the entry does not exist. + */ + canReadlink(): boolean; + /** + * Return true if readdir has previously been successfully called on this + * path, indicating that cachedReaddir() is likely valid. + */ + calledReaddir(): boolean; + /** + * Returns true if the path is known to not exist. That is, a previous lstat + * or readdir failed to verify its existence when that would have been + * expected, or a parent entry was marked either enoent or enotdir. + */ + isENOENT(): boolean; + /** + * Return true if the path is a match for the given path name. This handles + * case sensitivity and unicode normalization. + * + * Note: even on case-sensitive systems, it is **not** safe to test the + * equality of the `.name` property to determine whether a given pathname + * matches, due to unicode normalization mismatches. + * + * Always use this method instead of testing the `path.name` property + * directly. + */ + isNamed(n: string): boolean; + /** + * Return the Path object corresponding to the target of a symbolic link. + * + * If the Path is not a symbolic link, or if the readlink call fails for any + * reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + */ + readlink(): Promise; + /** + * Synchronous {@link PathBase.readlink} + */ + readlinkSync(): PathBase | undefined; + /** + * Call lstat() on this Path, and update all known information that can be + * determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + lstat(): Promise; + /** + * synchronous {@link PathBase.lstat} + */ + lstatSync(): PathBase | undefined; + /** + * Standard node-style callback interface to get list of directory entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + * + * @param cb The callback called with (er, entries). Note that the `er` + * param is somewhat extraneous, as all readdir() errors are handled and + * simply result in an empty set of entries being returned. + * @param allowZalgo Boolean indicating that immediately known results should + * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release + * zalgo at your peril, the dark pony lord is devious and unforgiving. + */ + readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void; + /** + * Return an array of known child entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + readdir(): Promise; + /** + * synchronous {@link PathBase.readdir} + */ + readdirSync(): PathBase[]; + canReaddir(): boolean; + shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean; + /** + * Return the Path object corresponding to path as resolved + * by realpath(3). + * + * If the realpath call fails for any reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * On success, returns a Path object. + */ + realpath(): Promise; + /** + * Synchronous {@link realpath} + */ + realpathSync(): PathBase | undefined; + /** + * Internal method to mark this Path object as the scurry cwd, + * called by {@link PathScurry#chdir} + * + * @internal + */ + [setAsCwd](oldCwd: PathBase): void; +} +/** + * Path class used on win32 systems + * + * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` + * as the path separator for parsing paths. + */ +export declare class PathWin32 extends PathBase { + /** + * Separator for generating path strings. + */ + sep: '\\'; + /** + * Separator for parsing path strings. + */ + splitSep: RegExp; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: { + [k: string]: PathBase; + }, nocase: boolean, children: ChildrenCache, opts: PathOpts); + /** + * @internal + */ + newChild(name: string, type?: number, opts?: PathOpts): PathWin32; + /** + * @internal + */ + getRootString(path: string): string; + /** + * @internal + */ + getRoot(rootPath: string): PathBase; + /** + * @internal + */ + sameRoot(rootPath: string, compare?: string): boolean; +} +/** + * Path class used on all posix systems. + * + * Uses `'/'` as the path separator. + */ +export declare class PathPosix extends PathBase { + /** + * separator for parsing path strings + */ + splitSep: '/'; + /** + * separator for generating path strings + */ + sep: '/'; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: { + [k: string]: PathBase; + }, nocase: boolean, children: ChildrenCache, opts: PathOpts); + /** + * @internal + */ + getRootString(path: string): string; + /** + * @internal + */ + getRoot(_rootPath: string): PathBase; + /** + * @internal + */ + newChild(name: string, type?: number, opts?: PathOpts): PathPosix; +} +/** + * Options that may be provided to the PathScurry constructor + */ +export interface PathScurryOpts { + /** + * perform case-insensitive path matching. Default based on platform + * subclass. + */ + nocase?: boolean; + /** + * Number of Path entries to keep in the cache of Path child references. + * + * Setting this higher than 65536 will dramatically increase the data + * consumption and construction time overhead of each PathScurry. + * + * Setting this value to 256 or lower will significantly reduce the data + * consumption and construction time overhead, but may also reduce resolve() + * and readdir() performance on large filesystems. + * + * Default `16384`. + */ + childrenCacheSize?: number; + /** + * An object that overrides the built-in functions from the fs and + * fs/promises modules. + * + * See {@link FSOption} + */ + fs?: FSOption; +} +/** + * The base class for all PathScurry classes, providing the interface for path + * resolution and filesystem operations. + * + * Typically, you should *not* instantiate this class directly, but rather one + * of the platform-specific classes, or the exported {@link PathScurry} which + * defaults to the current platform. + */ +export declare abstract class PathScurryBase { + #private; + /** + * The root Path entry for the current working directory of this Scurry + */ + root: PathBase; + /** + * The string path for the root of this Scurry's current working directory + */ + rootPath: string; + /** + * A collection of all roots encountered, referenced by rootPath + */ + roots: { + [k: string]: PathBase; + }; + /** + * The Path entry corresponding to this PathScurry's current working directory. + */ + cwd: PathBase; + /** + * Perform path comparisons case-insensitively. + * + * Defaults true on Darwin and Windows systems, false elsewhere. + */ + nocase: boolean; + /** + * The path separator used for parsing paths + * + * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows + */ + abstract sep: string | RegExp; + /** + * This class should not be instantiated directly. + * + * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry + * + * @internal + */ + constructor(cwd: string | URL | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts); + /** + * Get the depth of a provided path, string, or the cwd + */ + depth(path?: Path | string): number; + /** + * Parse the root portion of a path string + * + * @internal + */ + abstract parseRootPath(dir: string): string; + /** + * create a new Path to use as root during construction. + * + * @internal + */ + abstract newRoot(fs: FSValue): PathBase; + /** + * Determine whether a given path string is absolute + */ + abstract isAbsolute(p: string): boolean; + /** + * Return the cache of child entries. Exposed so subclasses can create + * child Path objects in a platform-specific way. + * + * @internal + */ + childrenCache(): ChildrenCache; + /** + * Resolve one or more path strings to a resolved string + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolve(...paths: string[]): string; + /** + * Resolve one or more path strings to a resolved string, returning + * the posix path. Identical to .resolve() on posix systems, but on + * windows will return a forward-slash separated UNC path. + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolvePosix(...paths: string[]): string; + /** + * find the relative path from the cwd to the supplied path string or entry + */ + relative(entry?: PathBase | string): string; + /** + * find the relative path from the cwd to the supplied path string or + * entry, using / as the path delimiter, even on Windows. + */ + relativePosix(entry?: PathBase | string): string; + /** + * Return the basename for the provided string or Path object + */ + basename(entry?: PathBase | string): string; + /** + * Return the dirname for the provided string or Path object + */ + dirname(entry?: PathBase | string): string; + /** + * Return an array of known child entries. + * + * First argument may be either a string, or a Path object. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + * + * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set + * `{ withFileTypes: false }` to return strings. + */ + readdir(): Promise; + readdir(opts: { + withFileTypes: true; + }): Promise; + readdir(opts: { + withFileTypes: false; + }): Promise; + readdir(opts: { + withFileTypes: boolean; + }): Promise; + readdir(entry: PathBase | string): Promise; + readdir(entry: PathBase | string, opts: { + withFileTypes: true; + }): Promise; + readdir(entry: PathBase | string, opts: { + withFileTypes: false; + }): Promise; + readdir(entry: PathBase | string, opts: { + withFileTypes: boolean; + }): Promise; + /** + * synchronous {@link PathScurryBase.readdir} + */ + readdirSync(): PathBase[]; + readdirSync(opts: { + withFileTypes: true; + }): PathBase[]; + readdirSync(opts: { + withFileTypes: false; + }): string[]; + readdirSync(opts: { + withFileTypes: boolean; + }): PathBase[] | string[]; + readdirSync(entry: PathBase | string): PathBase[]; + readdirSync(entry: PathBase | string, opts: { + withFileTypes: true; + }): PathBase[]; + readdirSync(entry: PathBase | string, opts: { + withFileTypes: false; + }): string[]; + readdirSync(entry: PathBase | string, opts: { + withFileTypes: boolean; + }): PathBase[] | string[]; + /** + * Call lstat() on the string or Path object, and update all known + * information that can be determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + lstat(entry?: string | PathBase): Promise; + /** + * synchronous {@link PathScurryBase.lstat} + */ + lstatSync(entry?: string | PathBase): PathBase | undefined; + /** + * Return the Path object or string path corresponding to the target of a + * symbolic link. + * + * If the path is not a symbolic link, or if the readlink call fails for any + * reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * + * `{withFileTypes}` option defaults to `false`. + * + * On success, returns a Path object if `withFileTypes` option is true, + * otherwise a string. + */ + readlink(): Promise; + readlink(opt: { + withFileTypes: false; + }): Promise; + readlink(opt: { + withFileTypes: true; + }): Promise; + readlink(opt: { + withFileTypes: boolean; + }): Promise; + readlink(entry: string | PathBase, opt?: { + withFileTypes: false; + }): Promise; + readlink(entry: string | PathBase, opt: { + withFileTypes: true; + }): Promise; + readlink(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): Promise; + /** + * synchronous {@link PathScurryBase.readlink} + */ + readlinkSync(): string | undefined; + readlinkSync(opt: { + withFileTypes: false; + }): string | undefined; + readlinkSync(opt: { + withFileTypes: true; + }): PathBase | undefined; + readlinkSync(opt: { + withFileTypes: boolean; + }): PathBase | string | undefined; + readlinkSync(entry: string | PathBase, opt?: { + withFileTypes: false; + }): string | undefined; + readlinkSync(entry: string | PathBase, opt: { + withFileTypes: true; + }): PathBase | undefined; + readlinkSync(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): string | PathBase | undefined; + /** + * Return the Path object or string path corresponding to path as resolved + * by realpath(3). + * + * If the realpath call fails for any reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * + * `{withFileTypes}` option defaults to `false`. + * + * On success, returns a Path object if `withFileTypes` option is true, + * otherwise a string. + */ + realpath(): Promise; + realpath(opt: { + withFileTypes: false; + }): Promise; + realpath(opt: { + withFileTypes: true; + }): Promise; + realpath(opt: { + withFileTypes: boolean; + }): Promise; + realpath(entry: string | PathBase, opt?: { + withFileTypes: false; + }): Promise; + realpath(entry: string | PathBase, opt: { + withFileTypes: true; + }): Promise; + realpath(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): Promise; + realpathSync(): string | undefined; + realpathSync(opt: { + withFileTypes: false; + }): string | undefined; + realpathSync(opt: { + withFileTypes: true; + }): PathBase | undefined; + realpathSync(opt: { + withFileTypes: boolean; + }): PathBase | string | undefined; + realpathSync(entry: string | PathBase, opt?: { + withFileTypes: false; + }): string | undefined; + realpathSync(entry: string | PathBase, opt: { + withFileTypes: true; + }): PathBase | undefined; + realpathSync(entry: string | PathBase, opt: { + withFileTypes: boolean; + }): string | PathBase | undefined; + /** + * Asynchronously walk the directory tree, returning an array of + * all path strings or Path objects found. + * + * Note that this will be extremely memory-hungry on large filesystems. + * In such cases, it may be better to use the stream or async iterator + * walk implementation. + */ + walk(): Promise; + walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; + walk(opts: WalkOptionsWithFileTypesFalse): Promise; + walk(opts: WalkOptions): Promise; + walk(entry: string | PathBase): Promise; + walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise; + walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise; + walk(entry: string | PathBase, opts: WalkOptions): Promise; + /** + * Synchronously walk the directory tree, returning an array of + * all path strings or Path objects found. + * + * Note that this will be extremely memory-hungry on large filesystems. + * In such cases, it may be better to use the stream or async iterator + * walk implementation. + */ + walkSync(): PathBase[]; + walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[]; + walkSync(opts: WalkOptionsWithFileTypesFalse): string[]; + walkSync(opts: WalkOptions): string[] | PathBase[]; + walkSync(entry: string | PathBase): PathBase[]; + walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[]; + walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[]; + walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[]; + /** + * Support for `for await` + * + * Alias for {@link PathScurryBase.iterate} + * + * Note: As of Node 19, this is very slow, compared to other methods of + * walking. Consider using {@link PathScurryBase.stream} if memory overhead + * and backpressure are concerns, or {@link PathScurryBase.walk} if not. + */ + [Symbol.asyncIterator](): AsyncGenerator; + /** + * Async generator form of {@link PathScurryBase.walk} + * + * Note: As of Node 19, this is very slow, compared to other methods of + * walking, especially if most/all of the directory tree has been previously + * walked. Consider using {@link PathScurryBase.stream} if memory overhead + * and backpressure are concerns, or {@link PathScurryBase.walk} if not. + */ + iterate(): AsyncGenerator; + iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; + iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; + iterate(opts: WalkOptions): AsyncGenerator; + iterate(entry: string | PathBase): AsyncGenerator; + iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator; + iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator; + iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator; + /** + * Iterating over a PathScurry performs a synchronous walk. + * + * Alias for {@link PathScurryBase.iterateSync} + */ + [Symbol.iterator](): Generator; + iterateSync(): Generator; + iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; + iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator; + iterateSync(opts: WalkOptions): Generator; + iterateSync(entry: string | PathBase): Generator; + iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator; + iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator; + iterateSync(entry: string | PathBase, opts: WalkOptions): Generator; + /** + * Stream form of {@link PathScurryBase.walk} + * + * Returns a Minipass stream that emits {@link PathBase} objects by default, + * or strings if `{ withFileTypes: false }` is set in the options. + */ + stream(): Minipass; + stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; + stream(opts: WalkOptionsWithFileTypesFalse): Minipass; + stream(opts: WalkOptions): Minipass; + stream(entry: string | PathBase): Minipass; + stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; + stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; + stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; + /** + * Synchronous form of {@link PathScurryBase.stream} + * + * Returns a Minipass stream that emits {@link PathBase} objects by default, + * or strings if `{ withFileTypes: false }` is set in the options. + * + * Will complete the walk in a single tick if the stream is consumed fully. + * Otherwise, will pause as needed for stream backpressure. + */ + streamSync(): Minipass; + streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass; + streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass; + streamSync(opts: WalkOptions): Minipass; + streamSync(entry: string | PathBase): Minipass; + streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass; + streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass; + streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass; + chdir(path?: string | Path): void; +} +/** + * Options provided to all walk methods. + */ +export interface WalkOptions { + /** + * Return results as {@link PathBase} objects rather than strings. + * When set to false, results are fully resolved paths, as returned by + * {@link PathBase.fullpath}. + * @default true + */ + withFileTypes?: boolean; + /** + * Attempt to read directory entries from symbolic links. Otherwise, only + * actual directories are traversed. Regardless of this setting, a given + * target path will only ever be walked once, meaning that a symbolic link + * to a previously traversed directory will never be followed. + * + * Setting this imposes a slight performance penalty, because `readlink` + * must be called on all symbolic links encountered, in order to avoid + * infinite cycles. + * @default false + */ + follow?: boolean; + /** + * Only return entries where the provided function returns true. + * + * This will not prevent directories from being traversed, even if they do + * not pass the filter, though it will prevent directories themselves from + * being included in the result set. See {@link walkFilter} + * + * Asynchronous functions are not supported here. + * + * By default, if no filter is provided, all entries and traversed + * directories are included. + */ + filter?: (entry: PathBase) => boolean; + /** + * Only traverse directories (and in the case of {@link follow} being set to + * true, symbolic links to directories) if the provided function returns + * true. + * + * This will not prevent directories from being included in the result set, + * even if they do not pass the supplied filter function. See {@link filter} + * to do that. + * + * Asynchronous functions are not supported here. + */ + walkFilter?: (entry: PathBase) => boolean; +} +export type WalkOptionsWithFileTypesUnset = WalkOptions & { + withFileTypes?: undefined; +}; +export type WalkOptionsWithFileTypesTrue = WalkOptions & { + withFileTypes: true; +}; +export type WalkOptionsWithFileTypesFalse = WalkOptions & { + withFileTypes: false; +}; +/** + * Windows implementation of {@link PathScurryBase} + * + * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses + * {@link PathWin32} for Path objects. + */ +export declare class PathScurryWin32 extends PathScurryBase { + /** + * separator for generating path strings + */ + sep: '\\'; + constructor(cwd?: URL | string, opts?: PathScurryOpts); + /** + * @internal + */ + parseRootPath(dir: string): string; + /** + * @internal + */ + newRoot(fs: FSValue): PathWin32; + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p: string): boolean; +} +/** + * {@link PathScurryBase} implementation for all posix systems other than Darwin. + * + * Defaults to case-sensitive matching, uses `'/'` to generate path strings. + * + * Uses {@link PathPosix} for Path objects. + */ +export declare class PathScurryPosix extends PathScurryBase { + /** + * separator for generating path strings + */ + sep: '/'; + constructor(cwd?: URL | string, opts?: PathScurryOpts); + /** + * @internal + */ + parseRootPath(_dir: string): string; + /** + * @internal + */ + newRoot(fs: FSValue): PathPosix; + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p: string): boolean; +} +/** + * {@link PathScurryBase} implementation for Darwin (macOS) systems. + * + * Defaults to case-insensitive matching, uses `'/'` for generating path + * strings. + * + * Uses {@link PathPosix} for Path objects. + */ +export declare class PathScurryDarwin extends PathScurryPosix { + constructor(cwd?: URL | string, opts?: PathScurryOpts); +} +/** + * Default {@link PathBase} implementation for the current platform. + * + * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. + */ +export declare const Path: typeof PathWin32 | typeof PathPosix; +export type Path = PathBase | InstanceType; +/** + * Default {@link PathScurryBase} implementation for the current platform. + * + * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on + * Darwin (macOS) systems, {@link PathScurryPosix} on all others. + */ +export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix; +export type PathScurry = PathScurryBase | InstanceType; +export {}; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/path-scurry/dist/esm/index.d.ts.map b/node_modules/path-scurry/dist/esm/index.d.ts.map new file mode 100644 index 0000000..1f59f8f --- /dev/null +++ b/node_modules/path-scurry/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAmBxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAA;IACnC,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,EAChC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,KAC9D,IAAI,CAAA;IACT,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,O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GAAG;IACxD,aAAa,EAAE,KAAK,CAAA;CACrB,CAAA;AAED;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IACjD;;OAEG;IACH,GAAG,EAAE,IAAI,CAAO;gBAGd,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;IAU3B;;OAEG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAOlC;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO;IAYnB;;OAEG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;CAK/B;AAED;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IACjD;;OAEG;IACH,GAAG,EAAE,GAAG,CAAM;gBAEZ,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;IAO3B;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO;IAYnB;;OAEG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;CAG/B;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;gBAEjD,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;CAK5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,qCAAuD,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EACnB,OAAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,eAGQ,CAAA;AACnB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/esm/index.js b/node_modules/path-scurry/dist/esm/index.js new file mode 100644 index 0000000..3b11b81 --- /dev/null +++ b/node_modules/path-scurry/dist/esm/index.js @@ -0,0 +1,1979 @@ +import { LRUCache } from 'lru-cache'; +import { posix, win32 } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps, } from 'fs'; +import * as actualFS from 'node:fs'; +const realpathSync = rps.native; +// TODO: test perf of fs/promises realpath vs realpathCB, +// since the promises one uses realpath.native +import { lstat, readdir, readlink, realpath } from 'node:fs/promises'; +import { Minipass } from 'minipass'; +const defaultFS = { + lstatSync, + readdir: readdirCB, + readdirSync, + readlinkSync, + realpathSync, + promises: { + lstat, + readdir, + readlink, + realpath, + }, +}; +// if they just gave us require('fs') then use our default +const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ? + defaultFS + : { + ...defaultFS, + ...fsOption, + promises: { + ...defaultFS.promises, + ...(fsOption.promises || {}), + }, + }; +// turn something like //?/c:/ into c:\ +const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i; +const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\'); +// windows paths are separated by either / or \ +const eitherSep = /[\\\/]/; +const UNKNOWN = 0; // may not even exist, for all we know +const IFIFO = 0b0001; +const IFCHR = 0b0010; +const IFDIR = 0b0100; +const IFBLK = 0b0110; +const IFREG = 0b1000; +const IFLNK = 0b1010; +const IFSOCK = 0b1100; +const IFMT = 0b1111; +// mask to unset low 4 bits +const IFMT_UNKNOWN = ~IFMT; +// set after successfully calling readdir() and getting entries. +const READDIR_CALLED = 0b0000_0001_0000; +// set after a successful lstat() +const LSTAT_CALLED = 0b0000_0010_0000; +// set if an entry (or one of its parents) is definitely not a dir +const ENOTDIR = 0b0000_0100_0000; +// set if an entry (or one of its parents) does not exist +// (can also be set on lstat errors like EACCES or ENAMETOOLONG) +const ENOENT = 0b0000_1000_0000; +// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK +// set if we fail to readlink +const ENOREADLINK = 0b0001_0000_0000; +// set if we know realpath() will fail +const ENOREALPATH = 0b0010_0000_0000; +const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH; +const TYPEMASK = 0b0011_1111_1111; +const entToType = (s) => s.isFile() ? IFREG + : s.isDirectory() ? IFDIR + : s.isSymbolicLink() ? IFLNK + : s.isCharacterDevice() ? IFCHR + : s.isBlockDevice() ? IFBLK + : s.isSocket() ? IFSOCK + : s.isFIFO() ? IFIFO + : UNKNOWN; +// normalize unicode path names +const normalizeCache = new Map(); +const normalize = (s) => { + const c = normalizeCache.get(s); + if (c) + return c; + const n = s.normalize('NFKD'); + normalizeCache.set(s, n); + return n; +}; +const normalizeNocaseCache = new Map(); +const normalizeNocase = (s) => { + const c = normalizeNocaseCache.get(s); + if (c) + return c; + const n = normalize(s.toLowerCase()); + normalizeNocaseCache.set(s, n); + return n; +}; +/** + * An LRUCache for storing resolved path strings or Path objects. + * @internal + */ +export class ResolveCache extends LRUCache { + constructor() { + super({ max: 256 }); + } +} +// In order to prevent blowing out the js heap by allocating hundreds of +// thousands of Path entries when walking extremely large trees, the "children" +// in this tree are represented by storing an array of Path entries in an +// LRUCache, indexed by the parent. At any time, Path.children() may return an +// empty array, indicating that it doesn't know about any of its children, and +// thus has to rebuild that cache. This is fine, it just means that we don't +// benefit as much from having the cached entries, but huge directory walks +// don't blow out the stack, and smaller ones are still as fast as possible. +// +//It does impose some complexity when building up the readdir data, because we +//need to pass a reference to the children array that we started with. +/** + * an LRUCache for storing child entries. + * @internal + */ +export class ChildrenCache extends LRUCache { + constructor(maxSize = 16 * 1024) { + super({ + maxSize, + // parent + children + sizeCalculation: a => a.length + 1, + }); + } +} +const setAsCwd = Symbol('PathScurry setAsCwd'); +/** + * Path objects are sort of like a super-powered + * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent} + * + * Each one represents a single filesystem entry on disk, which may or may not + * exist. It includes methods for reading various types of information via + * lstat, readlink, and readdir, and caches all information to the greatest + * degree possible. + * + * Note that fs operations that would normally throw will instead return an + * "empty" value. This is in order to prevent excessive overhead from error + * stack traces. + */ +export class PathBase { + /** + * the basename of this path + * + * **Important**: *always* test the path name against any test string + * usingthe {@link isNamed} method, and not by directly comparing this + * string. Otherwise, unicode path strings that the system sees as identical + * will not be properly treated as the same path, leading to incorrect + * behavior and possible security issues. + */ + name; + /** + * the Path entry corresponding to the path root. + * + * @internal + */ + root; + /** + * All roots found within the current PathScurry family + * + * @internal + */ + roots; + /** + * a reference to the parent path, or undefined in the case of root entries + * + * @internal + */ + parent; + /** + * boolean indicating whether paths are compared case-insensitively + * @internal + */ + nocase; + /** + * boolean indicating that this path is the current working directory + * of the PathScurry collection that contains it. + */ + isCWD = false; + // potential default fs override + #fs; + // Stats fields + #dev; + get dev() { + return this.#dev; + } + #mode; + get mode() { + return this.#mode; + } + #nlink; + get nlink() { + return this.#nlink; + } + #uid; + get uid() { + return this.#uid; + } + #gid; + get gid() { + return this.#gid; + } + #rdev; + get rdev() { + return this.#rdev; + } + #blksize; + get blksize() { + return this.#blksize; + } + #ino; + get ino() { + return this.#ino; + } + #size; + get size() { + return this.#size; + } + #blocks; + get blocks() { + return this.#blocks; + } + #atimeMs; + get atimeMs() { + return this.#atimeMs; + } + #mtimeMs; + get mtimeMs() { + return this.#mtimeMs; + } + #ctimeMs; + get ctimeMs() { + return this.#ctimeMs; + } + #birthtimeMs; + get birthtimeMs() { + return this.#birthtimeMs; + } + #atime; + get atime() { + return this.#atime; + } + #mtime; + get mtime() { + return this.#mtime; + } + #ctime; + get ctime() { + return this.#ctime; + } + #birthtime; + get birthtime() { + return this.#birthtime; + } + #matchName; + #depth; + #fullpath; + #fullpathPosix; + #relative; + #relativePosix; + #type; + #children; + #linkTarget; + #realpath; + /** + * This property is for compatibility with the Dirent class as of + * Node v20, where Dirent['parentPath'] refers to the path of the + * directory that was passed to readdir. For root entries, it's the path + * to the entry itself. + */ + get parentPath() { + return (this.parent || this).fullpath(); + } + /** + * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, + * this property refers to the *parent* path, not the path object itself. + */ + get path() { + return this.parentPath; + } + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + this.name = name; + this.#matchName = nocase ? normalizeNocase(name) : normalize(name); + this.#type = type & TYPEMASK; + this.nocase = nocase; + this.roots = roots; + this.root = root || this; + this.#children = children; + this.#fullpath = opts.fullpath; + this.#relative = opts.relative; + this.#relativePosix = opts.relativePosix; + this.parent = opts.parent; + if (this.parent) { + this.#fs = this.parent.#fs; + } + else { + this.#fs = fsFromOption(opts.fs); + } + } + /** + * Returns the depth of the Path object from its root. + * + * For example, a path at `/foo/bar` would have a depth of 2. + */ + depth() { + if (this.#depth !== undefined) + return this.#depth; + if (!this.parent) + return (this.#depth = 0); + return (this.#depth = this.parent.depth() + 1); + } + /** + * @internal + */ + childrenCache() { + return this.#children; + } + /** + * Get the Path object referenced by the string path, resolved from this Path + */ + resolve(path) { + if (!path) { + return this; + } + const rootPath = this.getRootString(path); + const dir = path.substring(rootPath.length); + const dirParts = dir.split(this.splitSep); + const result = rootPath ? + this.getRoot(rootPath).#resolveParts(dirParts) + : this.#resolveParts(dirParts); + return result; + } + #resolveParts(dirParts) { + let p = this; + for (const part of dirParts) { + p = p.child(part); + } + return p; + } + /** + * Returns the cached children Path objects, if still available. If they + * have fallen out of the cache, then returns an empty array, and resets the + * READDIR_CALLED bit, so that future calls to readdir() will require an fs + * lookup. + * + * @internal + */ + children() { + const cached = this.#children.get(this); + if (cached) { + return cached; + } + const children = Object.assign([], { provisional: 0 }); + this.#children.set(this, children); + this.#type &= ~READDIR_CALLED; + return children; + } + /** + * Resolves a path portion and returns or creates the child Path. + * + * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is + * `'..'`. + * + * This should not be called directly. If `pathPart` contains any path + * separators, it will lead to unsafe undefined behavior. + * + * Use `Path.resolve()` instead. + * + * @internal + */ + child(pathPart, opts) { + if (pathPart === '' || pathPart === '.') { + return this; + } + if (pathPart === '..') { + return this.parent || this; + } + // find the child + const children = this.children(); + const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart); + for (const p of children) { + if (p.#matchName === name) { + return p; + } + } + // didn't find it, create provisional child, since it might not + // actually exist. If we know the parent isn't a dir, then + // in fact it CAN'T exist. + const s = this.parent ? this.sep : ''; + const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined; + const pchild = this.newChild(pathPart, UNKNOWN, { + ...opts, + parent: this, + fullpath, + }); + if (!this.canReaddir()) { + pchild.#type |= ENOENT; + } + // don't have to update provisional, because if we have real children, + // then provisional is set to children.length, otherwise a lower number + children.push(pchild); + return pchild; + } + /** + * The relative path from the cwd. If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpath() + */ + relative() { + if (this.isCWD) + return ''; + if (this.#relative !== undefined) { + return this.#relative; + } + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#relative = this.name); + } + const pv = p.relative(); + return pv + (!pv || !p.parent ? '' : this.sep) + name; + } + /** + * The relative path from the cwd, using / as the path separator. + * If it does not share an ancestor with + * the cwd, then this ends up being equivalent to the fullpathPosix() + * On posix systems, this is identical to relative(). + */ + relativePosix() { + if (this.sep === '/') + return this.relative(); + if (this.isCWD) + return ''; + if (this.#relativePosix !== undefined) + return this.#relativePosix; + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#relativePosix = this.fullpathPosix()); + } + const pv = p.relativePosix(); + return pv + (!pv || !p.parent ? '' : '/') + name; + } + /** + * The fully resolved path string for this Path entry + */ + fullpath() { + if (this.#fullpath !== undefined) { + return this.#fullpath; + } + const name = this.name; + const p = this.parent; + if (!p) { + return (this.#fullpath = this.name); + } + const pv = p.fullpath(); + const fp = pv + (!p.parent ? '' : this.sep) + name; + return (this.#fullpath = fp); + } + /** + * On platforms other than windows, this is identical to fullpath. + * + * On windows, this is overridden to return the forward-slash form of the + * full UNC path. + */ + fullpathPosix() { + if (this.#fullpathPosix !== undefined) + return this.#fullpathPosix; + if (this.sep === '/') + return (this.#fullpathPosix = this.fullpath()); + if (!this.parent) { + const p = this.fullpath().replace(/\\/g, '/'); + if (/^[a-z]:\//i.test(p)) { + return (this.#fullpathPosix = `//?/${p}`); + } + else { + return (this.#fullpathPosix = p); + } + } + const p = this.parent; + const pfpp = p.fullpathPosix(); + const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name; + return (this.#fullpathPosix = fpp); + } + /** + * Is the Path of an unknown type? + * + * Note that we might know *something* about it if there has been a previous + * filesystem operation, for example that it does not exist, or is not a + * link, or whether it has child entries. + */ + isUnknown() { + return (this.#type & IFMT) === UNKNOWN; + } + isType(type) { + return this[`is${type}`](); + } + getType() { + return (this.isUnknown() ? 'Unknown' + : this.isDirectory() ? 'Directory' + : this.isFile() ? 'File' + : this.isSymbolicLink() ? 'SymbolicLink' + : this.isFIFO() ? 'FIFO' + : this.isCharacterDevice() ? 'CharacterDevice' + : this.isBlockDevice() ? 'BlockDevice' + : /* c8 ignore start */ this.isSocket() ? 'Socket' + : 'Unknown'); + /* c8 ignore stop */ + } + /** + * Is the Path a regular file? + */ + isFile() { + return (this.#type & IFMT) === IFREG; + } + /** + * Is the Path a directory? + */ + isDirectory() { + return (this.#type & IFMT) === IFDIR; + } + /** + * Is the path a character device? + */ + isCharacterDevice() { + return (this.#type & IFMT) === IFCHR; + } + /** + * Is the path a block device? + */ + isBlockDevice() { + return (this.#type & IFMT) === IFBLK; + } + /** + * Is the path a FIFO pipe? + */ + isFIFO() { + return (this.#type & IFMT) === IFIFO; + } + /** + * Is the path a socket? + */ + isSocket() { + return (this.#type & IFMT) === IFSOCK; + } + /** + * Is the path a symbolic link? + */ + isSymbolicLink() { + return (this.#type & IFLNK) === IFLNK; + } + /** + * Return the entry if it has been subject of a successful lstat, or + * undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* simply + * mean that we haven't called lstat on it. + */ + lstatCached() { + return this.#type & LSTAT_CALLED ? this : undefined; + } + /** + * Return the cached link target if the entry has been the subject of a + * successful readlink, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readlink() has been called at some point. + */ + readlinkCached() { + return this.#linkTarget; + } + /** + * Returns the cached realpath target if the entry has been the subject + * of a successful realpath, or undefined otherwise. + * + * Does not read the filesystem, so an undefined result *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * realpath() has been called at some point. + */ + realpathCached() { + return this.#realpath; + } + /** + * Returns the cached child Path entries array if the entry has been the + * subject of a successful readdir(), or [] otherwise. + * + * Does not read the filesystem, so an empty array *could* just mean we + * don't have any cached data. Only use it if you are very sure that a + * readdir() has been called recently enough to still be valid. + */ + readdirCached() { + const children = this.children(); + return children.slice(0, children.provisional); + } + /** + * Return true if it's worth trying to readlink. Ie, we don't (yet) have + * any indication that readlink will definitely fail. + * + * Returns false if the path is known to not be a symlink, if a previous + * readlink failed, or if the entry does not exist. + */ + canReadlink() { + if (this.#linkTarget) + return true; + if (!this.parent) + return false; + // cases where it cannot possibly succeed + const ifmt = this.#type & IFMT; + return !((ifmt !== UNKNOWN && ifmt !== IFLNK) || + this.#type & ENOREADLINK || + this.#type & ENOENT); + } + /** + * Return true if readdir has previously been successfully called on this + * path, indicating that cachedReaddir() is likely valid. + */ + calledReaddir() { + return !!(this.#type & READDIR_CALLED); + } + /** + * Returns true if the path is known to not exist. That is, a previous lstat + * or readdir failed to verify its existence when that would have been + * expected, or a parent entry was marked either enoent or enotdir. + */ + isENOENT() { + return !!(this.#type & ENOENT); + } + /** + * Return true if the path is a match for the given path name. This handles + * case sensitivity and unicode normalization. + * + * Note: even on case-sensitive systems, it is **not** safe to test the + * equality of the `.name` property to determine whether a given pathname + * matches, due to unicode normalization mismatches. + * + * Always use this method instead of testing the `path.name` property + * directly. + */ + isNamed(n) { + return !this.nocase ? + this.#matchName === normalize(n) + : this.#matchName === normalizeNocase(n); + } + /** + * Return the Path object corresponding to the target of a symbolic link. + * + * If the Path is not a symbolic link, or if the readlink call fails for any + * reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + */ + async readlink() { + const target = this.#linkTarget; + if (target) { + return target; + } + if (!this.canReadlink()) { + return undefined; + } + /* c8 ignore start */ + // already covered by the canReadlink test, here for ts grumples + if (!this.parent) { + return undefined; + } + /* c8 ignore stop */ + try { + const read = await this.#fs.promises.readlink(this.fullpath()); + const linkTarget = (await this.parent.realpath())?.resolve(read); + if (linkTarget) { + return (this.#linkTarget = linkTarget); + } + } + catch (er) { + this.#readlinkFail(er.code); + return undefined; + } + } + /** + * Synchronous {@link PathBase.readlink} + */ + readlinkSync() { + const target = this.#linkTarget; + if (target) { + return target; + } + if (!this.canReadlink()) { + return undefined; + } + /* c8 ignore start */ + // already covered by the canReadlink test, here for ts grumples + if (!this.parent) { + return undefined; + } + /* c8 ignore stop */ + try { + const read = this.#fs.readlinkSync(this.fullpath()); + const linkTarget = this.parent.realpathSync()?.resolve(read); + if (linkTarget) { + return (this.#linkTarget = linkTarget); + } + } + catch (er) { + this.#readlinkFail(er.code); + return undefined; + } + } + #readdirSuccess(children) { + // succeeded, mark readdir called bit + this.#type |= READDIR_CALLED; + // mark all remaining provisional children as ENOENT + for (let p = children.provisional; p < children.length; p++) { + const c = children[p]; + if (c) + c.#markENOENT(); + } + } + #markENOENT() { + // mark as UNKNOWN and ENOENT + if (this.#type & ENOENT) + return; + this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN; + this.#markChildrenENOENT(); + } + #markChildrenENOENT() { + // all children are provisional and do not exist + const children = this.children(); + children.provisional = 0; + for (const p of children) { + p.#markENOENT(); + } + } + #markENOREALPATH() { + this.#type |= ENOREALPATH; + this.#markENOTDIR(); + } + // save the information when we know the entry is not a dir + #markENOTDIR() { + // entry is not a directory, so any children can't exist. + // this *should* be impossible, since any children created + // after it's been marked ENOTDIR should be marked ENOENT, + // so it won't even get to this point. + /* c8 ignore start */ + if (this.#type & ENOTDIR) + return; + /* c8 ignore stop */ + let t = this.#type; + // this could happen if we stat a dir, then delete it, + // then try to read it or one of its children. + if ((t & IFMT) === IFDIR) + t &= IFMT_UNKNOWN; + this.#type = t | ENOTDIR; + this.#markChildrenENOENT(); + } + #readdirFail(code = '') { + // markENOTDIR and markENOENT also set provisional=0 + if (code === 'ENOTDIR' || code === 'EPERM') { + this.#markENOTDIR(); + } + else if (code === 'ENOENT') { + this.#markENOENT(); + } + else { + this.children().provisional = 0; + } + } + #lstatFail(code = '') { + // Windows just raises ENOENT in this case, disable for win CI + /* c8 ignore start */ + if (code === 'ENOTDIR') { + // already know it has a parent by this point + const p = this.parent; + p.#markENOTDIR(); + } + else if (code === 'ENOENT') { + /* c8 ignore stop */ + this.#markENOENT(); + } + } + #readlinkFail(code = '') { + let ter = this.#type; + ter |= ENOREADLINK; + if (code === 'ENOENT') + ter |= ENOENT; + // windows gets a weird error when you try to readlink a file + if (code === 'EINVAL' || code === 'UNKNOWN') { + // exists, but not a symlink, we don't know WHAT it is, so remove + // all IFMT bits. + ter &= IFMT_UNKNOWN; + } + this.#type = ter; + // windows just gets ENOENT in this case. We do cover the case, + // just disabled because it's impossible on Windows CI + /* c8 ignore start */ + if (code === 'ENOTDIR' && this.parent) { + this.parent.#markENOTDIR(); + } + /* c8 ignore stop */ + } + #readdirAddChild(e, c) { + return (this.#readdirMaybePromoteChild(e, c) || + this.#readdirAddNewChild(e, c)); + } + #readdirAddNewChild(e, c) { + // alloc new entry at head, so it's never provisional + const type = entToType(e); + const child = this.newChild(e.name, type, { parent: this }); + const ifmt = child.#type & IFMT; + if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) { + child.#type |= ENOTDIR; + } + c.unshift(child); + c.provisional++; + return child; + } + #readdirMaybePromoteChild(e, c) { + for (let p = c.provisional; p < c.length; p++) { + const pchild = c[p]; + const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name); + if (name !== pchild.#matchName) { + continue; + } + return this.#readdirPromoteChild(e, pchild, p, c); + } + } + #readdirPromoteChild(e, p, index, c) { + const v = p.name; + // retain any other flags, but set ifmt from dirent + p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e); + // case sensitivity fixing when we learn the true name. + if (v !== e.name) + p.name = e.name; + // just advance provisional index (potentially off the list), + // otherwise we have to splice/pop it out and re-insert at head + if (index !== c.provisional) { + if (index === c.length - 1) + c.pop(); + else + c.splice(index, 1); + c.unshift(p); + } + c.provisional++; + return p; + } + /** + * Call lstat() on this Path, and update all known information that can be + * determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + async lstat() { + if ((this.#type & ENOENT) === 0) { + try { + this.#applyStat(await this.#fs.promises.lstat(this.fullpath())); + return this; + } + catch (er) { + this.#lstatFail(er.code); + } + } + } + /** + * synchronous {@link PathBase.lstat} + */ + lstatSync() { + if ((this.#type & ENOENT) === 0) { + try { + this.#applyStat(this.#fs.lstatSync(this.fullpath())); + return this; + } + catch (er) { + this.#lstatFail(er.code); + } + } + } + #applyStat(st) { + const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st; + this.#atime = atime; + this.#atimeMs = atimeMs; + this.#birthtime = birthtime; + this.#birthtimeMs = birthtimeMs; + this.#blksize = blksize; + this.#blocks = blocks; + this.#ctime = ctime; + this.#ctimeMs = ctimeMs; + this.#dev = dev; + this.#gid = gid; + this.#ino = ino; + this.#mode = mode; + this.#mtime = mtime; + this.#mtimeMs = mtimeMs; + this.#nlink = nlink; + this.#rdev = rdev; + this.#size = size; + this.#uid = uid; + const ifmt = entToType(st); + // retain any other flags, but set the ifmt + this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED; + if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) { + this.#type |= ENOTDIR; + } + } + #onReaddirCB = []; + #readdirCBInFlight = false; + #callOnReaddirCB(children) { + this.#readdirCBInFlight = false; + const cbs = this.#onReaddirCB.slice(); + this.#onReaddirCB.length = 0; + cbs.forEach(cb => cb(null, children)); + } + /** + * Standard node-style callback interface to get list of directory entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + * + * @param cb The callback called with (er, entries). Note that the `er` + * param is somewhat extraneous, as all readdir() errors are handled and + * simply result in an empty set of entries being returned. + * @param allowZalgo Boolean indicating that immediately known results should + * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release + * zalgo at your peril, the dark pony lord is devious and unforgiving. + */ + readdirCB(cb, allowZalgo = false) { + if (!this.canReaddir()) { + if (allowZalgo) + cb(null, []); + else + queueMicrotask(() => cb(null, [])); + return; + } + const children = this.children(); + if (this.calledReaddir()) { + const c = children.slice(0, children.provisional); + if (allowZalgo) + cb(null, c); + else + queueMicrotask(() => cb(null, c)); + return; + } + // don't have to worry about zalgo at this point. + this.#onReaddirCB.push(cb); + if (this.#readdirCBInFlight) { + return; + } + this.#readdirCBInFlight = true; + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => { + if (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + else { + // if we didn't get an error, we always get entries. + //@ts-ignore + for (const e of entries) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + this.#callOnReaddirCB(children.slice(0, children.provisional)); + return; + }); + } + #asyncReaddirInFlight; + /** + * Return an array of known child entries. + * + * If the Path cannot or does not contain any children, then an empty array + * is returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + async readdir() { + if (!this.canReaddir()) { + return []; + } + const children = this.children(); + if (this.calledReaddir()) { + return children.slice(0, children.provisional); + } + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + if (this.#asyncReaddirInFlight) { + await this.#asyncReaddirInFlight; + } + else { + /* c8 ignore start */ + let resolve = () => { }; + /* c8 ignore stop */ + this.#asyncReaddirInFlight = new Promise(res => (resolve = res)); + try { + for (const e of await this.#fs.promises.readdir(fullpath, { + withFileTypes: true, + })) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + catch (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + this.#asyncReaddirInFlight = undefined; + resolve(); + } + return children.slice(0, children.provisional); + } + /** + * synchronous {@link PathBase.readdir} + */ + readdirSync() { + if (!this.canReaddir()) { + return []; + } + const children = this.children(); + if (this.calledReaddir()) { + return children.slice(0, children.provisional); + } + // else read the directory, fill up children + // de-provisionalize any provisional children. + const fullpath = this.fullpath(); + try { + for (const e of this.#fs.readdirSync(fullpath, { + withFileTypes: true, + })) { + this.#readdirAddChild(e, children); + } + this.#readdirSuccess(children); + } + catch (er) { + this.#readdirFail(er.code); + children.provisional = 0; + } + return children.slice(0, children.provisional); + } + canReaddir() { + if (this.#type & ENOCHILD) + return false; + const ifmt = IFMT & this.#type; + // we always set ENOTDIR when setting IFMT, so should be impossible + /* c8 ignore start */ + if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) { + return false; + } + /* c8 ignore stop */ + return true; + } + shouldWalk(dirs, walkFilter) { + return ((this.#type & IFDIR) === IFDIR && + !(this.#type & ENOCHILD) && + !dirs.has(this) && + (!walkFilter || walkFilter(this))); + } + /** + * Return the Path object corresponding to path as resolved + * by realpath(3). + * + * If the realpath call fails for any reason, `undefined` is returned. + * + * Result is cached, and thus may be outdated if the filesystem is mutated. + * On success, returns a Path object. + */ + async realpath() { + if (this.#realpath) + return this.#realpath; + if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) + return undefined; + try { + const rp = await this.#fs.promises.realpath(this.fullpath()); + return (this.#realpath = this.resolve(rp)); + } + catch (_) { + this.#markENOREALPATH(); + } + } + /** + * Synchronous {@link realpath} + */ + realpathSync() { + if (this.#realpath) + return this.#realpath; + if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) + return undefined; + try { + const rp = this.#fs.realpathSync(this.fullpath()); + return (this.#realpath = this.resolve(rp)); + } + catch (_) { + this.#markENOREALPATH(); + } + } + /** + * Internal method to mark this Path object as the scurry cwd, + * called by {@link PathScurry#chdir} + * + * @internal + */ + [setAsCwd](oldCwd) { + if (oldCwd === this) + return; + oldCwd.isCWD = false; + this.isCWD = true; + const changed = new Set([]); + let rp = []; + let p = this; + while (p && p.parent) { + changed.add(p); + p.#relative = rp.join(this.sep); + p.#relativePosix = rp.join('/'); + p = p.parent; + rp.push('..'); + } + // now un-memoize parents of old cwd + p = oldCwd; + while (p && p.parent && !changed.has(p)) { + p.#relative = undefined; + p.#relativePosix = undefined; + p = p.parent; + } + } +} +/** + * Path class used on win32 systems + * + * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'` + * as the path separator for parsing paths. + */ +export class PathWin32 extends PathBase { + /** + * Separator for generating path strings. + */ + sep = '\\'; + /** + * Separator for parsing path strings. + */ + splitSep = eitherSep; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + super(name, type, root, roots, nocase, children, opts); + } + /** + * @internal + */ + newChild(name, type = UNKNOWN, opts = {}) { + return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); + } + /** + * @internal + */ + getRootString(path) { + return win32.parse(path).root; + } + /** + * @internal + */ + getRoot(rootPath) { + rootPath = uncToDrive(rootPath.toUpperCase()); + if (rootPath === this.root.name) { + return this.root; + } + // ok, not that one, check if it matches another we know about + for (const [compare, root] of Object.entries(this.roots)) { + if (this.sameRoot(rootPath, compare)) { + return (this.roots[rootPath] = root); + } + } + // otherwise, have to create a new one. + return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root); + } + /** + * @internal + */ + sameRoot(rootPath, compare = this.root.name) { + // windows can (rarely) have case-sensitive filesystem, but + // UNC and drive letters are always case-insensitive, and canonically + // represented uppercase. + rootPath = rootPath + .toUpperCase() + .replace(/\//g, '\\') + .replace(uncDriveRegexp, '$1\\'); + return rootPath === compare; + } +} +/** + * Path class used on all posix systems. + * + * Uses `'/'` as the path separator. + */ +export class PathPosix extends PathBase { + /** + * separator for parsing path strings + */ + splitSep = '/'; + /** + * separator for generating path strings + */ + sep = '/'; + /** + * Do not create new Path objects directly. They should always be accessed + * via the PathScurry class or other methods on the Path class. + * + * @internal + */ + constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) { + super(name, type, root, roots, nocase, children, opts); + } + /** + * @internal + */ + getRootString(path) { + return path.startsWith('/') ? '/' : ''; + } + /** + * @internal + */ + getRoot(_rootPath) { + return this.root; + } + /** + * @internal + */ + newChild(name, type = UNKNOWN, opts = {}) { + return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts); + } +} +/** + * The base class for all PathScurry classes, providing the interface for path + * resolution and filesystem operations. + * + * Typically, you should *not* instantiate this class directly, but rather one + * of the platform-specific classes, or the exported {@link PathScurry} which + * defaults to the current platform. + */ +export class PathScurryBase { + /** + * The root Path entry for the current working directory of this Scurry + */ + root; + /** + * The string path for the root of this Scurry's current working directory + */ + rootPath; + /** + * A collection of all roots encountered, referenced by rootPath + */ + roots; + /** + * The Path entry corresponding to this PathScurry's current working directory. + */ + cwd; + #resolveCache; + #resolvePosixCache; + #children; + /** + * Perform path comparisons case-insensitively. + * + * Defaults true on Darwin and Windows systems, false elsewhere. + */ + nocase; + #fs; + /** + * This class should not be instantiated directly. + * + * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry + * + * @internal + */ + constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) { + this.#fs = fsFromOption(fs); + if (cwd instanceof URL || cwd.startsWith('file://')) { + cwd = fileURLToPath(cwd); + } + // resolve and split root, and then add to the store. + // this is the only time we call path.resolve() + const cwdPath = pathImpl.resolve(cwd); + this.roots = Object.create(null); + this.rootPath = this.parseRootPath(cwdPath); + this.#resolveCache = new ResolveCache(); + this.#resolvePosixCache = new ResolveCache(); + this.#children = new ChildrenCache(childrenCacheSize); + const split = cwdPath.substring(this.rootPath.length).split(sep); + // resolve('/') leaves '', splits to [''], we don't want that. + if (split.length === 1 && !split[0]) { + split.pop(); + } + /* c8 ignore start */ + if (nocase === undefined) { + throw new TypeError('must provide nocase setting to PathScurryBase ctor'); + } + /* c8 ignore stop */ + this.nocase = nocase; + this.root = this.newRoot(this.#fs); + this.roots[this.rootPath] = this.root; + let prev = this.root; + let len = split.length - 1; + const joinSep = pathImpl.sep; + let abs = this.rootPath; + let sawFirst = false; + for (const part of split) { + const l = len--; + prev = prev.child(part, { + relative: new Array(l).fill('..').join(joinSep), + relativePosix: new Array(l).fill('..').join('/'), + fullpath: (abs += (sawFirst ? '' : joinSep) + part), + }); + sawFirst = true; + } + this.cwd = prev; + } + /** + * Get the depth of a provided path, string, or the cwd + */ + depth(path = this.cwd) { + if (typeof path === 'string') { + path = this.cwd.resolve(path); + } + return path.depth(); + } + /** + * Return the cache of child entries. Exposed so subclasses can create + * child Path objects in a platform-specific way. + * + * @internal + */ + childrenCache() { + return this.#children; + } + /** + * Resolve one or more path strings to a resolved string + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolve(...paths) { + // first figure out the minimum number of paths we have to test + // we always start at cwd, but any absolutes will bump the start + let r = ''; + for (let i = paths.length - 1; i >= 0; i--) { + const p = paths[i]; + if (!p || p === '.') + continue; + r = r ? `${p}/${r}` : p; + if (this.isAbsolute(p)) { + break; + } + } + const cached = this.#resolveCache.get(r); + if (cached !== undefined) { + return cached; + } + const result = this.cwd.resolve(r).fullpath(); + this.#resolveCache.set(r, result); + return result; + } + /** + * Resolve one or more path strings to a resolved string, returning + * the posix path. Identical to .resolve() on posix systems, but on + * windows will return a forward-slash separated UNC path. + * + * Same interface as require('path').resolve. + * + * Much faster than path.resolve() when called multiple times for the same + * path, because the resolved Path objects are cached. Much slower + * otherwise. + */ + resolvePosix(...paths) { + // first figure out the minimum number of paths we have to test + // we always start at cwd, but any absolutes will bump the start + let r = ''; + for (let i = paths.length - 1; i >= 0; i--) { + const p = paths[i]; + if (!p || p === '.') + continue; + r = r ? `${p}/${r}` : p; + if (this.isAbsolute(p)) { + break; + } + } + const cached = this.#resolvePosixCache.get(r); + if (cached !== undefined) { + return cached; + } + const result = this.cwd.resolve(r).fullpathPosix(); + this.#resolvePosixCache.set(r, result); + return result; + } + /** + * find the relative path from the cwd to the supplied path string or entry + */ + relative(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.relative(); + } + /** + * find the relative path from the cwd to the supplied path string or + * entry, using / as the path delimiter, even on Windows. + */ + relativePosix(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.relativePosix(); + } + /** + * Return the basename for the provided string or Path object + */ + basename(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.name; + } + /** + * Return the dirname for the provided string or Path object + */ + dirname(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return (entry.parent || entry).fullpath(); + } + async readdir(entry = this.cwd, opts = { + withFileTypes: true, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes } = opts; + if (!entry.canReaddir()) { + return []; + } + else { + const p = await entry.readdir(); + return withFileTypes ? p : p.map(e => e.name); + } + } + readdirSync(entry = this.cwd, opts = { + withFileTypes: true, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true } = opts; + if (!entry.canReaddir()) { + return []; + } + else if (withFileTypes) { + return entry.readdirSync(); + } + else { + return entry.readdirSync().map(e => e.name); + } + } + /** + * Call lstat() on the string or Path object, and update all known + * information that can be determined. + * + * Note that unlike `fs.lstat()`, the returned value does not contain some + * information, such as `mode`, `dev`, `nlink`, and `ino`. If that + * information is required, you will need to call `fs.lstat` yourself. + * + * If the Path refers to a nonexistent file, or if the lstat call fails for + * any reason, `undefined` is returned. Otherwise the updated Path object is + * returned. + * + * Results are cached, and thus may be out of date if the filesystem is + * mutated. + */ + async lstat(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.lstat(); + } + /** + * synchronous {@link PathScurryBase.lstat} + */ + lstatSync(entry = this.cwd) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + return entry.lstatSync(); + } + async readlink(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = await entry.readlink(); + return withFileTypes ? e : e?.fullpath(); + } + readlinkSync(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = entry.readlinkSync(); + return withFileTypes ? e : e?.fullpath(); + } + async realpath(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = await entry.realpath(); + return withFileTypes ? e : e?.fullpath(); + } + realpathSync(entry = this.cwd, { withFileTypes } = { + withFileTypes: false, + }) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + withFileTypes = entry.withFileTypes; + entry = this.cwd; + } + const e = entry.realpathSync(); + return withFileTypes ? e : e?.fullpath(); + } + async walk(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = []; + if (!filter || filter(entry)) { + results.push(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set(); + const walk = (dir, cb) => { + dirs.add(dir); + dir.readdirCB((er, entries) => { + /* c8 ignore start */ + if (er) { + return cb(er); + } + /* c8 ignore stop */ + let len = entries.length; + if (!len) + return cb(); + const next = () => { + if (--len === 0) { + cb(); + } + }; + for (const e of entries) { + if (!filter || filter(e)) { + results.push(withFileTypes ? e : e.fullpath()); + } + if (follow && e.isSymbolicLink()) { + e.realpath() + .then(r => (r?.isUnknown() ? r.lstat() : r)) + .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next()); + } + else { + if (e.shouldWalk(dirs, walkFilter)) { + walk(e, next); + } + else { + next(); + } + } + } + }, true); // zalgooooooo + }; + const start = entry; + return new Promise((res, rej) => { + walk(start, er => { + /* c8 ignore start */ + if (er) + return rej(er); + /* c8 ignore stop */ + res(results); + }); + }); + } + walkSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = []; + if (!filter || filter(entry)) { + results.push(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set([entry]); + for (const dir of dirs) { + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + results.push(withFileTypes ? e : e.fullpath()); + } + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + dirs.add(r); + } + } + } + return results; + } + /** + * Support for `for await` + * + * Alias for {@link PathScurryBase.iterate} + * + * Note: As of Node 19, this is very slow, compared to other methods of + * walking. Consider using {@link PathScurryBase.stream} if memory overhead + * and backpressure are concerns, or {@link PathScurryBase.walk} if not. + */ + [Symbol.asyncIterator]() { + return this.iterate(); + } + iterate(entry = this.cwd, options = {}) { + // iterating async over the stream is significantly more performant, + // especially in the warm-cache scenario, because it buffers up directory + // entries in the background instead of waiting for a yield for each one. + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + options = entry; + entry = this.cwd; + } + return this.stream(entry, options)[Symbol.asyncIterator](); + } + /** + * Iterating over a PathScurry performs a synchronous walk. + * + * Alias for {@link PathScurryBase.iterateSync} + */ + [Symbol.iterator]() { + return this.iterateSync(); + } + *iterateSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + if (!filter || filter(entry)) { + yield withFileTypes ? entry : entry.fullpath(); + } + const dirs = new Set([entry]); + for (const dir of dirs) { + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + yield withFileTypes ? e : e.fullpath(); + } + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + dirs.add(r); + } + } + } + } + stream(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = new Minipass({ objectMode: true }); + if (!filter || filter(entry)) { + results.write(withFileTypes ? entry : entry.fullpath()); + } + const dirs = new Set(); + const queue = [entry]; + let processing = 0; + const process = () => { + let paused = false; + while (!paused) { + const dir = queue.shift(); + if (!dir) { + if (processing === 0) + results.end(); + return; + } + processing++; + dirs.add(dir); + const onReaddir = (er, entries, didRealpaths = false) => { + /* c8 ignore start */ + if (er) + return results.emit('error', er); + /* c8 ignore stop */ + if (follow && !didRealpaths) { + const promises = []; + for (const e of entries) { + if (e.isSymbolicLink()) { + promises.push(e + .realpath() + .then((r) => r?.isUnknown() ? r.lstat() : r)); + } + } + if (promises.length) { + Promise.all(promises).then(() => onReaddir(null, entries, true)); + return; + } + } + for (const e of entries) { + if (e && (!filter || filter(e))) { + if (!results.write(withFileTypes ? e : e.fullpath())) { + paused = true; + } + } + } + processing--; + for (const e of entries) { + const r = e.realpathCached() || e; + if (r.shouldWalk(dirs, walkFilter)) { + queue.push(r); + } + } + if (paused && !results.flowing) { + results.once('drain', process); + } + else if (!sync) { + process(); + } + }; + // zalgo containment + let sync = true; + dir.readdirCB(onReaddir, true); + sync = false; + } + }; + process(); + return results; + } + streamSync(entry = this.cwd, opts = {}) { + if (typeof entry === 'string') { + entry = this.cwd.resolve(entry); + } + else if (!(entry instanceof PathBase)) { + opts = entry; + entry = this.cwd; + } + const { withFileTypes = true, follow = false, filter, walkFilter, } = opts; + const results = new Minipass({ objectMode: true }); + const dirs = new Set(); + if (!filter || filter(entry)) { + results.write(withFileTypes ? entry : entry.fullpath()); + } + const queue = [entry]; + let processing = 0; + const process = () => { + let paused = false; + while (!paused) { + const dir = queue.shift(); + if (!dir) { + if (processing === 0) + results.end(); + return; + } + processing++; + dirs.add(dir); + const entries = dir.readdirSync(); + for (const e of entries) { + if (!filter || filter(e)) { + if (!results.write(withFileTypes ? e : e.fullpath())) { + paused = true; + } + } + } + processing--; + for (const e of entries) { + let r = e; + if (e.isSymbolicLink()) { + if (!(follow && (r = e.realpathSync()))) + continue; + if (r.isUnknown()) + r.lstatSync(); + } + if (r.shouldWalk(dirs, walkFilter)) { + queue.push(r); + } + } + } + if (paused && !results.flowing) + results.once('drain', process); + }; + process(); + return results; + } + chdir(path = this.cwd) { + const oldCwd = this.cwd; + this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path; + this.cwd[setAsCwd](oldCwd); + } +} +/** + * Windows implementation of {@link PathScurryBase} + * + * Defaults to case insensitve, uses `'\\'` to generate path strings. Uses + * {@link PathWin32} for Path objects. + */ +export class PathScurryWin32 extends PathScurryBase { + /** + * separator for generating path strings + */ + sep = '\\'; + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = true } = opts; + super(cwd, win32, '\\', { ...opts, nocase }); + this.nocase = nocase; + for (let p = this.cwd; p; p = p.parent) { + p.nocase = this.nocase; + } + } + /** + * @internal + */ + parseRootPath(dir) { + // if the path starts with a single separator, it's not a UNC, and we'll + // just get separator as the root, and driveFromUNC will return \ + // In that case, mount \ on the root from the cwd. + return win32.parse(dir).root.toUpperCase(); + } + /** + * @internal + */ + newRoot(fs) { + return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); + } + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p) { + return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p)); + } +} +/** + * {@link PathScurryBase} implementation for all posix systems other than Darwin. + * + * Defaults to case-sensitive matching, uses `'/'` to generate path strings. + * + * Uses {@link PathPosix} for Path objects. + */ +export class PathScurryPosix extends PathScurryBase { + /** + * separator for generating path strings + */ + sep = '/'; + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = false } = opts; + super(cwd, posix, '/', { ...opts, nocase }); + this.nocase = nocase; + } + /** + * @internal + */ + parseRootPath(_dir) { + return '/'; + } + /** + * @internal + */ + newRoot(fs) { + return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs }); + } + /** + * Return true if the provided path string is an absolute path + */ + isAbsolute(p) { + return p.startsWith('/'); + } +} +/** + * {@link PathScurryBase} implementation for Darwin (macOS) systems. + * + * Defaults to case-insensitive matching, uses `'/'` for generating path + * strings. + * + * Uses {@link PathPosix} for Path objects. + */ +export class PathScurryDarwin extends PathScurryPosix { + constructor(cwd = process.cwd(), opts = {}) { + const { nocase = true } = opts; + super(cwd, { ...opts, nocase }); + } +} +/** + * Default {@link PathBase} implementation for the current platform. + * + * {@link PathWin32} on Windows systems, {@link PathPosix} on all others. + */ +export const Path = process.platform === 'win32' ? PathWin32 : PathPosix; +/** + * Default {@link PathScurryBase} implementation for the current platform. + * + * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on + * Darwin (macOS) systems, {@link PathScurryPosix} on all others. + */ +export const PathScurry = process.platform === 'win32' ? PathScurryWin32 + : process.platform === 'darwin' ? PathScurryDarwin + : PathScurryPosix; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-scurry/dist/esm/index.js.map b/node_modules/path-scurry/dist/esm/index.js.map new file mode 100644 index 0000000..7e01bd2 --- /dev/null +++ b/node_modules/path-scurry/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EACL,SAAS,EACT,OAAO,IAAI,SAAS,EACpB,WAAW,EACX,YAAY,EACZ,YAAY,IAAI,GAAG,GACpB,MAAM,IAAI,CAAA;AACX,OAAO,KAAK,QAAQ,MAAM,SAAS,CAAA;AAEnC,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAA;AAC/B,yDAAyD;AACzD,8CAA8C;AAE9C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAErE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CAAC,CAAC,CAAC,gBAAgB;QAClD,CAAC,CAAC,eAAe,CAAA","sourcesContent":["import { LRUCache } from 'lru-cache'\nimport { posix, win32 } from 'node:path'\n\nimport { fileURLToPath } from 'node:url'\n\nimport {\n lstatSync,\n readdir as readdirCB,\n readdirSync,\n readlinkSync,\n realpathSync as rps,\n} from 'fs'\nimport * as actualFS from 'node:fs'\n\nconst realpathSync = rps.native\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\n\nimport { lstat, readdir, readlink, realpath } from 'node:fs/promises'\n\nimport { Minipass } from 'minipass'\nimport type { Dirent, Stats } from 'node:fs'\n\n/**\n * An object that will be used to override the default `fs`\n * methods. Any methods that are not overridden will use Node's\n * built-in implementations.\n *\n * - lstatSync\n * - readdir (callback `withFileTypes` Dirent variant, used for\n * readdirCB and most walks)\n * - readdirSync\n * - readlinkSync\n * - realpathSync\n * - promises: Object containing the following async methods:\n * - lstat\n * - readdir (Dirent variant only)\n * - readlink\n * - realpath\n */\nexport interface FSOption {\n lstatSync?: (path: string) => Stats\n readdir?: (\n path: string,\n options: { withFileTypes: true },\n cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n ) => void\n readdirSync?: (\n path: string,\n options: { withFileTypes: true },\n ) => Dirent[]\n readlinkSync?: (path: string) => string\n realpathSync?: (path: string) => string\n promises?: {\n lstat?: (path: string) => Promise\n readdir?: (\n path: string,\n options: { withFileTypes: true },\n ) => Promise\n readlink?: (path: string) => Promise\n realpath?: (path: string) => Promise\n [k: string]: any\n }\n [k: string]: any\n}\n\ninterface FSValue {\n lstatSync: (path: string) => Stats\n readdir: (\n path: string,\n options: { withFileTypes: true },\n cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n ) => void\n readdirSync: (path: string, options: { withFileTypes: true }) => Dirent[]\n readlinkSync: (path: string) => string\n realpathSync: (path: string) => string\n promises: {\n lstat: (path: string) => Promise\n readdir: (\n path: string,\n options: { withFileTypes: true },\n ) => Promise\n readlink: (path: string) => Promise\n realpath: (path: string) => Promise\n [k: string]: any\n }\n [k: string]: any\n}\n\nconst defaultFS: FSValue = {\n lstatSync,\n readdir: readdirCB,\n readdirSync,\n readlinkSync,\n realpathSync,\n promises: {\n lstat,\n readdir,\n readlink,\n realpath,\n },\n}\n\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption?: FSOption): FSValue =>\n !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n defaultFS\n : {\n ...defaultFS,\n ...fsOption,\n promises: {\n ...defaultFS.promises,\n ...(fsOption.promises || {}),\n },\n }\n\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i\nconst uncToDrive = (rootPath: string): string =>\n rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\')\n\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/\n\nconst UNKNOWN = 0 // may not even exist, for all we know\nconst IFIFO = 0b0001\nconst IFCHR = 0b0010\nconst IFDIR = 0b0100\nconst IFBLK = 0b0110\nconst IFREG = 0b1000\nconst IFLNK = 0b1010\nconst IFSOCK = 0b1100\nconst IFMT = 0b1111\n\nexport type Type =\n | 'Unknown'\n | 'FIFO'\n | 'CharacterDevice'\n | 'Directory'\n | 'BlockDevice'\n | 'File'\n | 'SymbolicLink'\n | 'Socket'\n\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT\n\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000\n\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH\nconst TYPEMASK = 0b0011_1111_1111\n\nconst entToType = (s: Dirent | Stats) =>\n s.isFile() ? IFREG\n : s.isDirectory() ? IFDIR\n : s.isSymbolicLink() ? IFLNK\n : s.isCharacterDevice() ? IFCHR\n : s.isBlockDevice() ? IFBLK\n : s.isSocket() ? IFSOCK\n : s.isFIFO() ? IFIFO\n : UNKNOWN\n\n// normalize unicode path names\nconst normalizeCache = new Map()\nconst normalize = (s: string) => {\n const c = normalizeCache.get(s)\n if (c) return c\n const n = s.normalize('NFKD')\n normalizeCache.set(s, n)\n return n\n}\n\nconst normalizeNocaseCache = new Map()\nconst normalizeNocase = (s: string) => {\n const c = normalizeNocaseCache.get(s)\n if (c) return c\n const n = normalize(s.toLowerCase())\n normalizeNocaseCache.set(s, n)\n return n\n}\n\n/**\n * Options that may be provided to the Path constructor\n */\nexport interface PathOpts {\n fullpath?: string\n relative?: string\n relativePosix?: string\n parent?: PathBase\n /**\n * See {@link FSOption}\n */\n fs?: FSOption\n}\n\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nexport class ResolveCache extends LRUCache {\n constructor() {\n super({ max: 256 })\n }\n}\n\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent. At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache. This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nexport class ChildrenCache extends LRUCache {\n constructor(maxSize: number = 16 * 1024) {\n super({\n maxSize,\n // parent + children\n sizeCalculation: a => a.length + 1,\n })\n }\n}\n\n/**\n * Array of Path objects, plus a marker indicating the first provisional entry\n *\n * @internal\n */\nexport type Children = PathBase[] & { provisional: number }\n\nconst setAsCwd = Symbol('PathScurry setAsCwd')\n\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nexport abstract class PathBase implements Dirent {\n /**\n * the basename of this path\n *\n * **Important**: *always* test the path name against any test string\n * usingthe {@link isNamed} method, and not by directly comparing this\n * string. Otherwise, unicode path strings that the system sees as identical\n * will not be properly treated as the same path, leading to incorrect\n * behavior and possible security issues.\n */\n name: string\n /**\n * the Path entry corresponding to the path root.\n *\n * @internal\n */\n root: PathBase\n /**\n * All roots found within the current PathScurry family\n *\n * @internal\n */\n roots: { [k: string]: PathBase }\n /**\n * a reference to the parent path, or undefined in the case of root entries\n *\n * @internal\n */\n parent?: PathBase\n /**\n * boolean indicating whether paths are compared case-insensitively\n * @internal\n */\n nocase: boolean\n\n /**\n * boolean indicating that this path is the current working directory\n * of the PathScurry collection that contains it.\n */\n isCWD: boolean = false\n\n /**\n * the string or regexp used to split paths. On posix, it is `'/'`, and on\n * windows it is a RegExp matching either `'/'` or `'\\\\'`\n */\n abstract splitSep: string | RegExp\n /**\n * The path separator string to use when joining paths\n */\n abstract sep: string\n\n // potential default fs override\n #fs: FSValue\n\n // Stats fields\n #dev?: number\n get dev() {\n return this.#dev\n }\n #mode?: number\n get mode() {\n return this.#mode\n }\n #nlink?: number\n get nlink() {\n return this.#nlink\n }\n #uid?: number\n get uid() {\n return this.#uid\n }\n #gid?: number\n get gid() {\n return this.#gid\n }\n #rdev?: number\n get rdev() {\n return this.#rdev\n }\n #blksize?: number\n get blksize() {\n return this.#blksize\n }\n #ino?: number\n get ino() {\n return this.#ino\n }\n #size?: number\n get size() {\n return this.#size\n }\n #blocks?: number\n get blocks() {\n return this.#blocks\n }\n #atimeMs?: number\n get atimeMs() {\n return this.#atimeMs\n }\n #mtimeMs?: number\n get mtimeMs() {\n return this.#mtimeMs\n }\n #ctimeMs?: number\n get ctimeMs() {\n return this.#ctimeMs\n }\n #birthtimeMs?: number\n get birthtimeMs() {\n return this.#birthtimeMs\n }\n #atime?: Date\n get atime() {\n return this.#atime\n }\n #mtime?: Date\n get mtime() {\n return this.#mtime\n }\n #ctime?: Date\n get ctime() {\n return this.#ctime\n }\n #birthtime?: Date\n get birthtime() {\n return this.#birthtime\n }\n\n #matchName: string\n #depth?: number\n #fullpath?: string\n #fullpathPosix?: string\n #relative?: string\n #relativePosix?: string\n #type: number\n #children: ChildrenCache\n #linkTarget?: PathBase\n #realpath?: PathBase\n\n /**\n * This property is for compatibility with the Dirent class as of\n * Node v20, where Dirent['parentPath'] refers to the path of the\n * directory that was passed to readdir. For root entries, it's the path\n * to the entry itself.\n */\n get parentPath(): string {\n return (this.parent || this).fullpath()\n }\n\n /**\n * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n * this property refers to the *parent* path, not the path object itself.\n */\n get path(): string {\n return this.parentPath\n }\n\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(\n name: string,\n type: number = UNKNOWN,\n root: PathBase | undefined,\n roots: { [k: string]: PathBase },\n nocase: boolean,\n children: ChildrenCache,\n opts: PathOpts,\n ) {\n this.name = name\n this.#matchName = nocase ? normalizeNocase(name) : normalize(name)\n this.#type = type & TYPEMASK\n this.nocase = nocase\n this.roots = roots\n this.root = root || this\n this.#children = children\n this.#fullpath = opts.fullpath\n this.#relative = opts.relative\n this.#relativePosix = opts.relativePosix\n this.parent = opts.parent\n if (this.parent) {\n this.#fs = this.parent.#fs\n } else {\n this.#fs = fsFromOption(opts.fs)\n }\n }\n\n /**\n * Returns the depth of the Path object from its root.\n *\n * For example, a path at `/foo/bar` would have a depth of 2.\n */\n depth(): number {\n if (this.#depth !== undefined) return this.#depth\n if (!this.parent) return (this.#depth = 0)\n return (this.#depth = this.parent.depth() + 1)\n }\n\n /**\n * @internal\n */\n abstract getRootString(path: string): string\n /**\n * @internal\n */\n abstract getRoot(rootPath: string): PathBase\n /**\n * @internal\n */\n abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase\n\n /**\n * @internal\n */\n childrenCache() {\n return this.#children\n }\n\n /**\n * Get the Path object referenced by the string path, resolved from this Path\n */\n resolve(path?: string): PathBase {\n if (!path) {\n return this\n }\n const rootPath = this.getRootString(path)\n const dir = path.substring(rootPath.length)\n const dirParts = dir.split(this.splitSep)\n const result: PathBase =\n rootPath ?\n this.getRoot(rootPath).#resolveParts(dirParts)\n : this.#resolveParts(dirParts)\n return result\n }\n\n #resolveParts(dirParts: string[]) {\n let p: PathBase = this\n for (const part of dirParts) {\n p = p.child(part)\n }\n return p\n }\n\n /**\n * Returns the cached children Path objects, if still available. If they\n * have fallen out of the cache, then returns an empty array, and resets the\n * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n * lookup.\n *\n * @internal\n */\n children(): Children {\n const cached = this.#children.get(this)\n if (cached) {\n return cached\n }\n const children: Children = Object.assign([], { provisional: 0 })\n this.#children.set(this, children)\n this.#type &= ~READDIR_CALLED\n return children\n }\n\n /**\n * Resolves a path portion and returns or creates the child Path.\n *\n * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n * `'..'`.\n *\n * This should not be called directly. If `pathPart` contains any path\n * separators, it will lead to unsafe undefined behavior.\n *\n * Use `Path.resolve()` instead.\n *\n * @internal\n */\n child(pathPart: string, opts?: PathOpts): PathBase {\n if (pathPart === '' || pathPart === '.') {\n return this\n }\n if (pathPart === '..') {\n return this.parent || this\n }\n\n // find the child\n const children = this.children()\n const name =\n this.nocase ? normalizeNocase(pathPart) : normalize(pathPart)\n for (const p of children) {\n if (p.#matchName === name) {\n return p\n }\n }\n\n // didn't find it, create provisional child, since it might not\n // actually exist. If we know the parent isn't a dir, then\n // in fact it CAN'T exist.\n const s = this.parent ? this.sep : ''\n const fullpath =\n this.#fullpath ? this.#fullpath + s + pathPart : undefined\n const pchild = this.newChild(pathPart, UNKNOWN, {\n ...opts,\n parent: this,\n fullpath,\n })\n\n if (!this.canReaddir()) {\n pchild.#type |= ENOENT\n }\n\n // don't have to update provisional, because if we have real children,\n // then provisional is set to children.length, otherwise a lower number\n children.push(pchild)\n return pchild\n }\n\n /**\n * The relative path from the cwd. If it does not share an ancestor with\n * the cwd, then this ends up being equivalent to the fullpath()\n */\n relative(): string {\n if (this.isCWD) return ''\n if (this.#relative !== undefined) {\n return this.#relative\n }\n const name = this.name\n const p = this.parent\n if (!p) {\n return (this.#relative = this.name)\n }\n const pv = p.relative()\n return pv + (!pv || !p.parent ? '' : this.sep) + name\n }\n\n /**\n * The relative path from the cwd, using / as the path separator.\n * If it does not share an ancestor with\n * the cwd, then this ends up being equivalent to the fullpathPosix()\n * On posix systems, this is identical to relative().\n */\n relativePosix(): string {\n if (this.sep === '/') return this.relative()\n if (this.isCWD) return ''\n if (this.#relativePosix !== undefined) return this.#relativePosix\n const name = this.name\n const p = this.parent\n if (!p) {\n return (this.#relativePosix = this.fullpathPosix())\n }\n const pv = p.relativePosix()\n return pv + (!pv || !p.parent ? '' : '/') + name\n }\n\n /**\n * The fully resolved path string for this Path entry\n */\n fullpath(): string {\n if (this.#fullpath !== undefined) {\n return this.#fullpath\n }\n const name = this.name\n const p = this.parent\n if (!p) {\n return (this.#fullpath = this.name)\n }\n const pv = p.fullpath()\n const fp = pv + (!p.parent ? '' : this.sep) + name\n return (this.#fullpath = fp)\n }\n\n /**\n * On platforms other than windows, this is identical to fullpath.\n *\n * On windows, this is overridden to return the forward-slash form of the\n * full UNC path.\n */\n fullpathPosix(): string {\n if (this.#fullpathPosix !== undefined) return this.#fullpathPosix\n if (this.sep === '/') return (this.#fullpathPosix = this.fullpath())\n if (!this.parent) {\n const p = this.fullpath().replace(/\\\\/g, '/')\n if (/^[a-z]:\\//i.test(p)) {\n return (this.#fullpathPosix = `//?/${p}`)\n } else {\n return (this.#fullpathPosix = p)\n }\n }\n const p = this.parent\n const pfpp = p.fullpathPosix()\n const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name\n return (this.#fullpathPosix = fpp)\n }\n\n /**\n * Is the Path of an unknown type?\n *\n * Note that we might know *something* about it if there has been a previous\n * filesystem operation, for example that it does not exist, or is not a\n * link, or whether it has child entries.\n */\n isUnknown(): boolean {\n return (this.#type & IFMT) === UNKNOWN\n }\n\n isType(type: Type): boolean {\n return this[`is${type}`]()\n }\n\n getType(): Type {\n return (\n this.isUnknown() ? 'Unknown'\n : this.isDirectory() ? 'Directory'\n : this.isFile() ? 'File'\n : this.isSymbolicLink() ? 'SymbolicLink'\n : this.isFIFO() ? 'FIFO'\n : this.isCharacterDevice() ? 'CharacterDevice'\n : this.isBlockDevice() ? 'BlockDevice'\n : /* c8 ignore start */ this.isSocket() ? 'Socket'\n : 'Unknown'\n )\n /* c8 ignore stop */\n }\n\n /**\n * Is the Path a regular file?\n */\n isFile(): boolean {\n return (this.#type & IFMT) === IFREG\n }\n\n /**\n * Is the Path a directory?\n */\n isDirectory(): boolean {\n return (this.#type & IFMT) === IFDIR\n }\n\n /**\n * Is the path a character device?\n */\n isCharacterDevice(): boolean {\n return (this.#type & IFMT) === IFCHR\n }\n\n /**\n * Is the path a block device?\n */\n isBlockDevice(): boolean {\n return (this.#type & IFMT) === IFBLK\n }\n\n /**\n * Is the path a FIFO pipe?\n */\n isFIFO(): boolean {\n return (this.#type & IFMT) === IFIFO\n }\n\n /**\n * Is the path a socket?\n */\n isSocket(): boolean {\n return (this.#type & IFMT) === IFSOCK\n }\n\n /**\n * Is the path a symbolic link?\n */\n isSymbolicLink(): boolean {\n return (this.#type & IFLNK) === IFLNK\n }\n\n /**\n * Return the entry if it has been subject of a successful lstat, or\n * undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* simply\n * mean that we haven't called lstat on it.\n */\n lstatCached(): PathBase | undefined {\n return this.#type & LSTAT_CALLED ? this : undefined\n }\n\n /**\n * Return the cached link target if the entry has been the subject of a\n * successful readlink, or undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * readlink() has been called at some point.\n */\n readlinkCached(): PathBase | undefined {\n return this.#linkTarget\n }\n\n /**\n * Returns the cached realpath target if the entry has been the subject\n * of a successful realpath, or undefined otherwise.\n *\n * Does not read the filesystem, so an undefined result *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * realpath() has been called at some point.\n */\n realpathCached(): PathBase | undefined {\n return this.#realpath\n }\n\n /**\n * Returns the cached child Path entries array if the entry has been the\n * subject of a successful readdir(), or [] otherwise.\n *\n * Does not read the filesystem, so an empty array *could* just mean we\n * don't have any cached data. Only use it if you are very sure that a\n * readdir() has been called recently enough to still be valid.\n */\n readdirCached(): PathBase[] {\n const children = this.children()\n return children.slice(0, children.provisional)\n }\n\n /**\n * Return true if it's worth trying to readlink. Ie, we don't (yet) have\n * any indication that readlink will definitely fail.\n *\n * Returns false if the path is known to not be a symlink, if a previous\n * readlink failed, or if the entry does not exist.\n */\n canReadlink(): boolean {\n if (this.#linkTarget) return true\n if (!this.parent) return false\n // cases where it cannot possibly succeed\n const ifmt = this.#type & IFMT\n return !(\n (ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n this.#type & ENOREADLINK ||\n this.#type & ENOENT\n )\n }\n\n /**\n * Return true if readdir has previously been successfully called on this\n * path, indicating that cachedReaddir() is likely valid.\n */\n calledReaddir(): boolean {\n return !!(this.#type & READDIR_CALLED)\n }\n\n /**\n * Returns true if the path is known to not exist. That is, a previous lstat\n * or readdir failed to verify its existence when that would have been\n * expected, or a parent entry was marked either enoent or enotdir.\n */\n isENOENT(): boolean {\n return !!(this.#type & ENOENT)\n }\n\n /**\n * Return true if the path is a match for the given path name. This handles\n * case sensitivity and unicode normalization.\n *\n * Note: even on case-sensitive systems, it is **not** safe to test the\n * equality of the `.name` property to determine whether a given pathname\n * matches, due to unicode normalization mismatches.\n *\n * Always use this method instead of testing the `path.name` property\n * directly.\n */\n isNamed(n: string): boolean {\n return !this.nocase ?\n this.#matchName === normalize(n)\n : this.#matchName === normalizeNocase(n)\n }\n\n /**\n * Return the Path object corresponding to the target of a symbolic link.\n *\n * If the Path is not a symbolic link, or if the readlink call fails for any\n * reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n */\n async readlink(): Promise {\n const target = this.#linkTarget\n if (target) {\n return target\n }\n if (!this.canReadlink()) {\n return undefined\n }\n /* c8 ignore start */\n // already covered by the canReadlink test, here for ts grumples\n if (!this.parent) {\n return undefined\n }\n /* c8 ignore stop */\n try {\n const read = await this.#fs.promises.readlink(this.fullpath())\n const linkTarget = (await this.parent.realpath())?.resolve(read)\n if (linkTarget) {\n return (this.#linkTarget = linkTarget)\n }\n } catch (er) {\n this.#readlinkFail((er as NodeJS.ErrnoException).code)\n return undefined\n }\n }\n\n /**\n * Synchronous {@link PathBase.readlink}\n */\n readlinkSync(): PathBase | undefined {\n const target = this.#linkTarget\n if (target) {\n return target\n }\n if (!this.canReadlink()) {\n return undefined\n }\n /* c8 ignore start */\n // already covered by the canReadlink test, here for ts grumples\n if (!this.parent) {\n return undefined\n }\n /* c8 ignore stop */\n try {\n const read = this.#fs.readlinkSync(this.fullpath())\n const linkTarget = this.parent.realpathSync()?.resolve(read)\n if (linkTarget) {\n return (this.#linkTarget = linkTarget)\n }\n } catch (er) {\n this.#readlinkFail((er as NodeJS.ErrnoException).code)\n return undefined\n }\n }\n\n #readdirSuccess(children: Children) {\n // succeeded, mark readdir called bit\n this.#type |= READDIR_CALLED\n // mark all remaining provisional children as ENOENT\n for (let p = children.provisional; p < children.length; p++) {\n const c = children[p]\n if (c) c.#markENOENT()\n }\n }\n\n #markENOENT() {\n // mark as UNKNOWN and ENOENT\n if (this.#type & ENOENT) return\n this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN\n this.#markChildrenENOENT()\n }\n\n #markChildrenENOENT() {\n // all children are provisional and do not exist\n const children = this.children()\n children.provisional = 0\n for (const p of children) {\n p.#markENOENT()\n }\n }\n\n #markENOREALPATH() {\n this.#type |= ENOREALPATH\n this.#markENOTDIR()\n }\n\n // save the information when we know the entry is not a dir\n #markENOTDIR() {\n // entry is not a directory, so any children can't exist.\n // this *should* be impossible, since any children created\n // after it's been marked ENOTDIR should be marked ENOENT,\n // so it won't even get to this point.\n /* c8 ignore start */\n if (this.#type & ENOTDIR) return\n /* c8 ignore stop */\n let t = this.#type\n // this could happen if we stat a dir, then delete it,\n // then try to read it or one of its children.\n if ((t & IFMT) === IFDIR) t &= IFMT_UNKNOWN\n this.#type = t | ENOTDIR\n this.#markChildrenENOENT()\n }\n\n #readdirFail(code: string = '') {\n // markENOTDIR and markENOENT also set provisional=0\n if (code === 'ENOTDIR' || code === 'EPERM') {\n this.#markENOTDIR()\n } else if (code === 'ENOENT') {\n this.#markENOENT()\n } else {\n this.children().provisional = 0\n }\n }\n\n #lstatFail(code: string = '') {\n // Windows just raises ENOENT in this case, disable for win CI\n /* c8 ignore start */\n if (code === 'ENOTDIR') {\n // already know it has a parent by this point\n const p = this.parent as PathBase\n p.#markENOTDIR()\n } else if (code === 'ENOENT') {\n /* c8 ignore stop */\n this.#markENOENT()\n }\n }\n\n #readlinkFail(code: string = '') {\n let ter = this.#type\n ter |= ENOREADLINK\n if (code === 'ENOENT') ter |= ENOENT\n // windows gets a weird error when you try to readlink a file\n if (code === 'EINVAL' || code === 'UNKNOWN') {\n // exists, but not a symlink, we don't know WHAT it is, so remove\n // all IFMT bits.\n ter &= IFMT_UNKNOWN\n }\n this.#type = ter\n // windows just gets ENOENT in this case. We do cover the case,\n // just disabled because it's impossible on Windows CI\n /* c8 ignore start */\n if (code === 'ENOTDIR' && this.parent) {\n this.parent.#markENOTDIR()\n }\n /* c8 ignore stop */\n }\n\n #readdirAddChild(e: Dirent, c: Children) {\n return (\n this.#readdirMaybePromoteChild(e, c) ||\n this.#readdirAddNewChild(e, c)\n )\n }\n\n #readdirAddNewChild(e: Dirent, c: Children): PathBase {\n // alloc new entry at head, so it's never provisional\n const type = entToType(e)\n const child = this.newChild(e.name, type, { parent: this })\n const ifmt = child.#type & IFMT\n if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n child.#type |= ENOTDIR\n }\n c.unshift(child)\n c.provisional++\n return child\n }\n\n #readdirMaybePromoteChild(e: Dirent, c: Children): PathBase | undefined {\n for (let p = c.provisional; p < c.length; p++) {\n const pchild = c[p]\n const name =\n this.nocase ? normalizeNocase(e.name) : normalize(e.name)\n if (name !== pchild!.#matchName) {\n continue\n }\n\n return this.#readdirPromoteChild(e, pchild!, p, c)\n }\n }\n\n #readdirPromoteChild(\n e: Dirent,\n p: PathBase,\n index: number,\n c: Children,\n ): PathBase {\n const v = p.name\n // retain any other flags, but set ifmt from dirent\n p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e)\n // case sensitivity fixing when we learn the true name.\n if (v !== e.name) p.name = e.name\n\n // just advance provisional index (potentially off the list),\n // otherwise we have to splice/pop it out and re-insert at head\n if (index !== c.provisional) {\n if (index === c.length - 1) c.pop()\n else c.splice(index, 1)\n c.unshift(p)\n }\n c.provisional++\n return p\n }\n\n /**\n * Call lstat() on this Path, and update all known information that can be\n * determined.\n *\n * Note that unlike `fs.lstat()`, the returned value does not contain some\n * information, such as `mode`, `dev`, `nlink`, and `ino`. If that\n * information is required, you will need to call `fs.lstat` yourself.\n *\n * If the Path refers to a nonexistent file, or if the lstat call fails for\n * any reason, `undefined` is returned. Otherwise the updated Path object is\n * returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async lstat(): Promise {\n if ((this.#type & ENOENT) === 0) {\n try {\n this.#applyStat(await this.#fs.promises.lstat(this.fullpath()))\n return this\n } catch (er) {\n this.#lstatFail((er as NodeJS.ErrnoException).code)\n }\n }\n }\n\n /**\n * synchronous {@link PathBase.lstat}\n */\n lstatSync(): PathBase | undefined {\n if ((this.#type & ENOENT) === 0) {\n try {\n this.#applyStat(this.#fs.lstatSync(this.fullpath()))\n return this\n } catch (er) {\n this.#lstatFail((er as NodeJS.ErrnoException).code)\n }\n }\n }\n\n #applyStat(st: Stats) {\n const {\n atime,\n atimeMs,\n birthtime,\n birthtimeMs,\n blksize,\n blocks,\n ctime,\n ctimeMs,\n dev,\n gid,\n ino,\n mode,\n mtime,\n mtimeMs,\n nlink,\n rdev,\n size,\n uid,\n } = st\n this.#atime = atime\n this.#atimeMs = atimeMs\n this.#birthtime = birthtime\n this.#birthtimeMs = birthtimeMs\n this.#blksize = blksize\n this.#blocks = blocks\n this.#ctime = ctime\n this.#ctimeMs = ctimeMs\n this.#dev = dev\n this.#gid = gid\n this.#ino = ino\n this.#mode = mode\n this.#mtime = mtime\n this.#mtimeMs = mtimeMs\n this.#nlink = nlink\n this.#rdev = rdev\n this.#size = size\n this.#uid = uid\n const ifmt = entToType(st)\n // retain any other flags, but set the ifmt\n this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED\n if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n this.#type |= ENOTDIR\n }\n }\n\n #onReaddirCB: ((\n er: NodeJS.ErrnoException | null,\n entries: Path[],\n ) => any)[] = []\n #readdirCBInFlight: boolean = false\n #callOnReaddirCB(children: Path[]) {\n this.#readdirCBInFlight = false\n const cbs = this.#onReaddirCB.slice()\n this.#onReaddirCB.length = 0\n cbs.forEach(cb => cb(null, children))\n }\n\n /**\n * Standard node-style callback interface to get list of directory entries.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n *\n * @param cb The callback called with (er, entries). Note that the `er`\n * param is somewhat extraneous, as all readdir() errors are handled and\n * simply result in an empty set of entries being returned.\n * @param allowZalgo Boolean indicating that immediately known results should\n * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n * zalgo at your peril, the dark pony lord is devious and unforgiving.\n */\n readdirCB(\n cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any,\n allowZalgo: boolean = false,\n ): void {\n if (!this.canReaddir()) {\n if (allowZalgo) cb(null, [])\n else queueMicrotask(() => cb(null, []))\n return\n }\n\n const children = this.children()\n if (this.calledReaddir()) {\n const c = children.slice(0, children.provisional)\n if (allowZalgo) cb(null, c)\n else queueMicrotask(() => cb(null, c))\n return\n }\n\n // don't have to worry about zalgo at this point.\n this.#onReaddirCB.push(cb)\n if (this.#readdirCBInFlight) {\n return\n }\n this.#readdirCBInFlight = true\n\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath()\n this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n if (er) {\n this.#readdirFail((er as NodeJS.ErrnoException).code)\n children.provisional = 0\n } else {\n // if we didn't get an error, we always get entries.\n //@ts-ignore\n for (const e of entries) {\n this.#readdirAddChild(e, children)\n }\n this.#readdirSuccess(children)\n }\n this.#callOnReaddirCB(children.slice(0, children.provisional))\n return\n })\n }\n\n #asyncReaddirInFlight?: Promise\n\n /**\n * Return an array of known child entries.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async readdir(): Promise {\n if (!this.canReaddir()) {\n return []\n }\n\n const children = this.children()\n if (this.calledReaddir()) {\n return children.slice(0, children.provisional)\n }\n\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath()\n if (this.#asyncReaddirInFlight) {\n await this.#asyncReaddirInFlight\n } else {\n /* c8 ignore start */\n let resolve: () => void = () => {}\n /* c8 ignore stop */\n this.#asyncReaddirInFlight = new Promise(\n res => (resolve = res),\n )\n try {\n for (const e of await this.#fs.promises.readdir(fullpath, {\n withFileTypes: true,\n })) {\n this.#readdirAddChild(e, children)\n }\n this.#readdirSuccess(children)\n } catch (er) {\n this.#readdirFail((er as NodeJS.ErrnoException).code)\n children.provisional = 0\n }\n this.#asyncReaddirInFlight = undefined\n resolve()\n }\n return children.slice(0, children.provisional)\n }\n\n /**\n * synchronous {@link PathBase.readdir}\n */\n readdirSync(): PathBase[] {\n if (!this.canReaddir()) {\n return []\n }\n\n const children = this.children()\n if (this.calledReaddir()) {\n return children.slice(0, children.provisional)\n }\n\n // else read the directory, fill up children\n // de-provisionalize any provisional children.\n const fullpath = this.fullpath()\n try {\n for (const e of this.#fs.readdirSync(fullpath, {\n withFileTypes: true,\n })) {\n this.#readdirAddChild(e, children)\n }\n this.#readdirSuccess(children)\n } catch (er) {\n this.#readdirFail((er as NodeJS.ErrnoException).code)\n children.provisional = 0\n }\n return children.slice(0, children.provisional)\n }\n\n canReaddir() {\n if (this.#type & ENOCHILD) return false\n const ifmt = IFMT & this.#type\n // we always set ENOTDIR when setting IFMT, so should be impossible\n /* c8 ignore start */\n if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n return false\n }\n /* c8 ignore stop */\n return true\n }\n\n shouldWalk(\n dirs: Set,\n walkFilter?: (e: PathBase) => boolean,\n ): boolean {\n return (\n (this.#type & IFDIR) === IFDIR &&\n !(this.#type & ENOCHILD) &&\n !dirs.has(this) &&\n (!walkFilter || walkFilter(this))\n )\n }\n\n /**\n * Return the Path object corresponding to path as resolved\n * by realpath(3).\n *\n * If the realpath call fails for any reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n * On success, returns a Path object.\n */\n async realpath(): Promise {\n if (this.#realpath) return this.#realpath\n if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n try {\n const rp = await this.#fs.promises.realpath(this.fullpath())\n return (this.#realpath = this.resolve(rp))\n } catch (_) {\n this.#markENOREALPATH()\n }\n }\n\n /**\n * Synchronous {@link realpath}\n */\n realpathSync(): PathBase | undefined {\n if (this.#realpath) return this.#realpath\n if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n try {\n const rp = this.#fs.realpathSync(this.fullpath())\n return (this.#realpath = this.resolve(rp))\n } catch (_) {\n this.#markENOREALPATH()\n }\n }\n\n /**\n * Internal method to mark this Path object as the scurry cwd,\n * called by {@link PathScurry#chdir}\n *\n * @internal\n */\n [setAsCwd](oldCwd: PathBase): void {\n if (oldCwd === this) return\n oldCwd.isCWD = false\n this.isCWD = true\n\n const changed = new Set([])\n let rp = []\n let p: PathBase = this\n while (p && p.parent) {\n changed.add(p)\n p.#relative = rp.join(this.sep)\n p.#relativePosix = rp.join('/')\n p = p.parent\n rp.push('..')\n }\n // now un-memoize parents of old cwd\n p = oldCwd\n while (p && p.parent && !changed.has(p)) {\n p.#relative = undefined\n p.#relativePosix = undefined\n p = p.parent\n }\n }\n}\n\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nexport class PathWin32 extends PathBase {\n /**\n * Separator for generating path strings.\n */\n sep: '\\\\' = '\\\\'\n /**\n * Separator for parsing path strings.\n */\n splitSep: RegExp = eitherSep\n\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(\n name: string,\n type: number = UNKNOWN,\n root: PathBase | undefined,\n roots: { [k: string]: PathBase },\n nocase: boolean,\n children: ChildrenCache,\n opts: PathOpts,\n ) {\n super(name, type, root, roots, nocase, children, opts)\n }\n\n /**\n * @internal\n */\n newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n return new PathWin32(\n name,\n type,\n this.root,\n this.roots,\n this.nocase,\n this.childrenCache(),\n opts,\n )\n }\n\n /**\n * @internal\n */\n getRootString(path: string): string {\n return win32.parse(path).root\n }\n\n /**\n * @internal\n */\n getRoot(rootPath: string): PathBase {\n rootPath = uncToDrive(rootPath.toUpperCase())\n if (rootPath === this.root.name) {\n return this.root\n }\n // ok, not that one, check if it matches another we know about\n for (const [compare, root] of Object.entries(this.roots)) {\n if (this.sameRoot(rootPath, compare)) {\n return (this.roots[rootPath] = root)\n }\n }\n // otherwise, have to create a new one.\n return (this.roots[rootPath] = new PathScurryWin32(\n rootPath,\n this,\n ).root)\n }\n\n /**\n * @internal\n */\n sameRoot(rootPath: string, compare: string = this.root.name): boolean {\n // windows can (rarely) have case-sensitive filesystem, but\n // UNC and drive letters are always case-insensitive, and canonically\n // represented uppercase.\n rootPath = rootPath\n .toUpperCase()\n .replace(/\\//g, '\\\\')\n .replace(uncDriveRegexp, '$1\\\\')\n return rootPath === compare\n }\n}\n\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nexport class PathPosix extends PathBase {\n /**\n * separator for parsing path strings\n */\n splitSep: '/' = '/'\n /**\n * separator for generating path strings\n */\n sep: '/' = '/'\n\n /**\n * Do not create new Path objects directly. They should always be accessed\n * via the PathScurry class or other methods on the Path class.\n *\n * @internal\n */\n constructor(\n name: string,\n type: number = UNKNOWN,\n root: PathBase | undefined,\n roots: { [k: string]: PathBase },\n nocase: boolean,\n children: ChildrenCache,\n opts: PathOpts,\n ) {\n super(name, type, root, roots, nocase, children, opts)\n }\n\n /**\n * @internal\n */\n getRootString(path: string): string {\n return path.startsWith('/') ? '/' : ''\n }\n\n /**\n * @internal\n */\n getRoot(_rootPath: string): PathBase {\n return this.root\n }\n\n /**\n * @internal\n */\n newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n return new PathPosix(\n name,\n type,\n this.root,\n this.roots,\n this.nocase,\n this.childrenCache(),\n opts,\n )\n }\n}\n\n/**\n * Options that may be provided to the PathScurry constructor\n */\nexport interface PathScurryOpts {\n /**\n * perform case-insensitive path matching. Default based on platform\n * subclass.\n */\n nocase?: boolean\n /**\n * Number of Path entries to keep in the cache of Path child references.\n *\n * Setting this higher than 65536 will dramatically increase the data\n * consumption and construction time overhead of each PathScurry.\n *\n * Setting this value to 256 or lower will significantly reduce the data\n * consumption and construction time overhead, but may also reduce resolve()\n * and readdir() performance on large filesystems.\n *\n * Default `16384`.\n */\n childrenCacheSize?: number\n /**\n * An object that overrides the built-in functions from the fs and\n * fs/promises modules.\n *\n * See {@link FSOption}\n */\n fs?: FSOption\n}\n\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nexport abstract class PathScurryBase {\n /**\n * The root Path entry for the current working directory of this Scurry\n */\n root: PathBase\n /**\n * The string path for the root of this Scurry's current working directory\n */\n rootPath: string\n /**\n * A collection of all roots encountered, referenced by rootPath\n */\n roots: { [k: string]: PathBase }\n /**\n * The Path entry corresponding to this PathScurry's current working directory.\n */\n cwd: PathBase\n #resolveCache: ResolveCache\n #resolvePosixCache: ResolveCache\n #children: ChildrenCache\n /**\n * Perform path comparisons case-insensitively.\n *\n * Defaults true on Darwin and Windows systems, false elsewhere.\n */\n nocase: boolean\n\n /**\n * The path separator used for parsing paths\n *\n * `'/'` on Posix systems, either `'/'` or `'\\\\'` on Windows\n */\n abstract sep: string | RegExp\n\n #fs: FSValue\n\n /**\n * This class should not be instantiated directly.\n *\n * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n *\n * @internal\n */\n constructor(\n cwd: URL | string = process.cwd(),\n pathImpl: typeof win32 | typeof posix,\n sep: string | RegExp,\n {\n nocase,\n childrenCacheSize = 16 * 1024,\n fs = defaultFS,\n }: PathScurryOpts = {},\n ) {\n this.#fs = fsFromOption(fs)\n if (cwd instanceof URL || cwd.startsWith('file://')) {\n cwd = fileURLToPath(cwd)\n }\n // resolve and split root, and then add to the store.\n // this is the only time we call path.resolve()\n const cwdPath = pathImpl.resolve(cwd)\n this.roots = Object.create(null)\n this.rootPath = this.parseRootPath(cwdPath)\n this.#resolveCache = new ResolveCache()\n this.#resolvePosixCache = new ResolveCache()\n this.#children = new ChildrenCache(childrenCacheSize)\n\n const split = cwdPath.substring(this.rootPath.length).split(sep)\n // resolve('/') leaves '', splits to [''], we don't want that.\n if (split.length === 1 && !split[0]) {\n split.pop()\n }\n /* c8 ignore start */\n if (nocase === undefined) {\n throw new TypeError(\n 'must provide nocase setting to PathScurryBase ctor',\n )\n }\n /* c8 ignore stop */\n this.nocase = nocase\n this.root = this.newRoot(this.#fs)\n this.roots[this.rootPath] = this.root\n let prev: PathBase = this.root\n let len = split.length - 1\n const joinSep = pathImpl.sep\n let abs = this.rootPath\n let sawFirst = false\n for (const part of split) {\n const l = len--\n prev = prev.child(part, {\n relative: new Array(l).fill('..').join(joinSep),\n relativePosix: new Array(l).fill('..').join('/'),\n fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n })\n sawFirst = true\n }\n this.cwd = prev\n }\n\n /**\n * Get the depth of a provided path, string, or the cwd\n */\n depth(path: Path | string = this.cwd): number {\n if (typeof path === 'string') {\n path = this.cwd.resolve(path)\n }\n return path.depth()\n }\n\n /**\n * Parse the root portion of a path string\n *\n * @internal\n */\n abstract parseRootPath(dir: string): string\n /**\n * create a new Path to use as root during construction.\n *\n * @internal\n */\n abstract newRoot(fs: FSValue): PathBase\n /**\n * Determine whether a given path string is absolute\n */\n abstract isAbsolute(p: string): boolean\n\n /**\n * Return the cache of child entries. Exposed so subclasses can create\n * child Path objects in a platform-specific way.\n *\n * @internal\n */\n childrenCache() {\n return this.#children\n }\n\n /**\n * Resolve one or more path strings to a resolved string\n *\n * Same interface as require('path').resolve.\n *\n * Much faster than path.resolve() when called multiple times for the same\n * path, because the resolved Path objects are cached. Much slower\n * otherwise.\n */\n resolve(...paths: string[]): string {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = ''\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i]\n if (!p || p === '.') continue\n r = r ? `${p}/${r}` : p\n if (this.isAbsolute(p)) {\n break\n }\n }\n const cached = this.#resolveCache.get(r)\n if (cached !== undefined) {\n return cached\n }\n const result = this.cwd.resolve(r).fullpath()\n this.#resolveCache.set(r, result)\n return result\n }\n\n /**\n * Resolve one or more path strings to a resolved string, returning\n * the posix path. Identical to .resolve() on posix systems, but on\n * windows will return a forward-slash separated UNC path.\n *\n * Same interface as require('path').resolve.\n *\n * Much faster than path.resolve() when called multiple times for the same\n * path, because the resolved Path objects are cached. Much slower\n * otherwise.\n */\n resolvePosix(...paths: string[]): string {\n // first figure out the minimum number of paths we have to test\n // we always start at cwd, but any absolutes will bump the start\n let r = ''\n for (let i = paths.length - 1; i >= 0; i--) {\n const p = paths[i]\n if (!p || p === '.') continue\n r = r ? `${p}/${r}` : p\n if (this.isAbsolute(p)) {\n break\n }\n }\n const cached = this.#resolvePosixCache.get(r)\n if (cached !== undefined) {\n return cached\n }\n const result = this.cwd.resolve(r).fullpathPosix()\n this.#resolvePosixCache.set(r, result)\n return result\n }\n\n /**\n * find the relative path from the cwd to the supplied path string or entry\n */\n relative(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.relative()\n }\n\n /**\n * find the relative path from the cwd to the supplied path string or\n * entry, using / as the path delimiter, even on Windows.\n */\n relativePosix(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.relativePosix()\n }\n\n /**\n * Return the basename for the provided string or Path object\n */\n basename(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.name\n }\n\n /**\n * Return the dirname for the provided string or Path object\n */\n dirname(entry: PathBase | string = this.cwd): string {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return (entry.parent || entry).fullpath()\n }\n\n /**\n * Return an array of known child entries.\n *\n * First argument may be either a string, or a Path object.\n *\n * If the Path cannot or does not contain any children, then an empty array\n * is returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n *\n * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set\n * `{ withFileTypes: false }` to return strings.\n */\n\n readdir(): Promise\n readdir(opts: { withFileTypes: true }): Promise\n readdir(opts: { withFileTypes: false }): Promise\n readdir(opts: { withFileTypes: boolean }): Promise\n readdir(entry: PathBase | string): Promise\n readdir(\n entry: PathBase | string,\n opts: { withFileTypes: true },\n ): Promise\n readdir(\n entry: PathBase | string,\n opts: { withFileTypes: false },\n ): Promise\n readdir(\n entry: PathBase | string,\n opts: { withFileTypes: boolean },\n ): Promise\n async readdir(\n entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n opts: { withFileTypes: boolean } = {\n withFileTypes: true,\n },\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const { withFileTypes } = opts\n if (!entry.canReaddir()) {\n return []\n } else {\n const p = await entry.readdir()\n return withFileTypes ? p : p.map(e => e.name)\n }\n }\n\n /**\n * synchronous {@link PathScurryBase.readdir}\n */\n readdirSync(): PathBase[]\n readdirSync(opts: { withFileTypes: true }): PathBase[]\n readdirSync(opts: { withFileTypes: false }): string[]\n readdirSync(opts: { withFileTypes: boolean }): PathBase[] | string[]\n readdirSync(entry: PathBase | string): PathBase[]\n readdirSync(\n entry: PathBase | string,\n opts: { withFileTypes: true },\n ): PathBase[]\n readdirSync(\n entry: PathBase | string,\n opts: { withFileTypes: false },\n ): string[]\n readdirSync(\n entry: PathBase | string,\n opts: { withFileTypes: boolean },\n ): PathBase[] | string[]\n readdirSync(\n entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n opts: { withFileTypes: boolean } = {\n withFileTypes: true,\n },\n ): PathBase[] | string[] {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const { withFileTypes = true } = opts\n if (!entry.canReaddir()) {\n return []\n } else if (withFileTypes) {\n return entry.readdirSync()\n } else {\n return entry.readdirSync().map(e => e.name)\n }\n }\n\n /**\n * Call lstat() on the string or Path object, and update all known\n * information that can be determined.\n *\n * Note that unlike `fs.lstat()`, the returned value does not contain some\n * information, such as `mode`, `dev`, `nlink`, and `ino`. If that\n * information is required, you will need to call `fs.lstat` yourself.\n *\n * If the Path refers to a nonexistent file, or if the lstat call fails for\n * any reason, `undefined` is returned. Otherwise the updated Path object is\n * returned.\n *\n * Results are cached, and thus may be out of date if the filesystem is\n * mutated.\n */\n async lstat(\n entry: string | PathBase = this.cwd,\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.lstat()\n }\n\n /**\n * synchronous {@link PathScurryBase.lstat}\n */\n lstatSync(entry: string | PathBase = this.cwd): PathBase | undefined {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n }\n return entry.lstatSync()\n }\n\n /**\n * Return the Path object or string path corresponding to the target of a\n * symbolic link.\n *\n * If the path is not a symbolic link, or if the readlink call fails for any\n * reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n *\n * `{withFileTypes}` option defaults to `false`.\n *\n * On success, returns a Path object if `withFileTypes` option is true,\n * otherwise a string.\n */\n readlink(): Promise\n readlink(opt: { withFileTypes: false }): Promise\n readlink(opt: { withFileTypes: true }): Promise\n readlink(opt: {\n withFileTypes: boolean\n }): Promise\n readlink(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): Promise\n readlink(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): Promise\n readlink(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): Promise\n async readlink(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = await entry.readlink()\n return withFileTypes ? e : e?.fullpath()\n }\n\n /**\n * synchronous {@link PathScurryBase.readlink}\n */\n readlinkSync(): string | undefined\n readlinkSync(opt: { withFileTypes: false }): string | undefined\n readlinkSync(opt: { withFileTypes: true }): PathBase | undefined\n readlinkSync(opt: {\n withFileTypes: boolean\n }): PathBase | string | undefined\n readlinkSync(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): string | undefined\n readlinkSync(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): PathBase | undefined\n readlinkSync(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): string | PathBase | undefined\n readlinkSync(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): string | PathBase | undefined {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = entry.readlinkSync()\n return withFileTypes ? e : e?.fullpath()\n }\n\n /**\n * Return the Path object or string path corresponding to path as resolved\n * by realpath(3).\n *\n * If the realpath call fails for any reason, `undefined` is returned.\n *\n * Result is cached, and thus may be outdated if the filesystem is mutated.\n *\n * `{withFileTypes}` option defaults to `false`.\n *\n * On success, returns a Path object if `withFileTypes` option is true,\n * otherwise a string.\n */\n realpath(): Promise\n realpath(opt: { withFileTypes: false }): Promise\n realpath(opt: { withFileTypes: true }): Promise\n realpath(opt: {\n withFileTypes: boolean\n }): Promise\n realpath(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): Promise\n realpath(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): Promise\n realpath(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): Promise\n async realpath(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = await entry.realpath()\n return withFileTypes ? e : e?.fullpath()\n }\n\n realpathSync(): string | undefined\n realpathSync(opt: { withFileTypes: false }): string | undefined\n realpathSync(opt: { withFileTypes: true }): PathBase | undefined\n realpathSync(opt: {\n withFileTypes: boolean\n }): PathBase | string | undefined\n realpathSync(\n entry: string | PathBase,\n opt?: { withFileTypes: false },\n ): string | undefined\n realpathSync(\n entry: string | PathBase,\n opt: { withFileTypes: true },\n ): PathBase | undefined\n realpathSync(\n entry: string | PathBase,\n opt: { withFileTypes: boolean },\n ): string | PathBase | undefined\n realpathSync(\n entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n { withFileTypes }: { withFileTypes: boolean } = {\n withFileTypes: false,\n },\n ): string | PathBase | undefined {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n withFileTypes = entry.withFileTypes\n entry = this.cwd\n }\n const e = entry.realpathSync()\n return withFileTypes ? e : e?.fullpath()\n }\n\n /**\n * Asynchronously walk the directory tree, returning an array of\n * all path strings or Path objects found.\n *\n * Note that this will be extremely memory-hungry on large filesystems.\n * In such cases, it may be better to use the stream or async iterator\n * walk implementation.\n */\n walk(): Promise\n walk(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Promise\n walk(opts: WalkOptionsWithFileTypesFalse): Promise\n walk(opts: WalkOptions): Promise\n walk(entry: string | PathBase): Promise\n walk(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Promise\n walk(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Promise\n walk(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Promise\n async walk(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Promise {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results: (string | PathBase)[] = []\n if (!filter || filter(entry)) {\n results.push(withFileTypes ? entry : entry.fullpath())\n }\n const dirs = new Set()\n const walk = (\n dir: PathBase,\n cb: (er?: NodeJS.ErrnoException) => void,\n ) => {\n dirs.add(dir)\n dir.readdirCB((er, entries) => {\n /* c8 ignore start */\n if (er) {\n return cb(er)\n }\n /* c8 ignore stop */\n let len = entries.length\n if (!len) return cb()\n const next = () => {\n if (--len === 0) {\n cb()\n }\n }\n for (const e of entries) {\n if (!filter || filter(e)) {\n results.push(withFileTypes ? e : e.fullpath())\n }\n if (follow && e.isSymbolicLink()) {\n e.realpath()\n .then(r => (r?.isUnknown() ? r.lstat() : r))\n .then(r =>\n r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next(),\n )\n } else {\n if (e.shouldWalk(dirs, walkFilter)) {\n walk(e, next)\n } else {\n next()\n }\n }\n }\n }, true) // zalgooooooo\n }\n\n const start = entry\n return new Promise((res, rej) => {\n walk(start, er => {\n /* c8 ignore start */\n if (er) return rej(er)\n /* c8 ignore stop */\n res(results as PathBase[] | string[])\n })\n })\n }\n\n /**\n * Synchronously walk the directory tree, returning an array of\n * all path strings or Path objects found.\n *\n * Note that this will be extremely memory-hungry on large filesystems.\n * In such cases, it may be better to use the stream or async iterator\n * walk implementation.\n */\n walkSync(): PathBase[]\n walkSync(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): PathBase[]\n walkSync(opts: WalkOptionsWithFileTypesFalse): string[]\n walkSync(opts: WalkOptions): string[] | PathBase[]\n walkSync(entry: string | PathBase): PathBase[]\n walkSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n ): PathBase[]\n walkSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): string[]\n walkSync(\n entry: string | PathBase,\n opts: WalkOptions,\n ): PathBase[] | string[]\n walkSync(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): PathBase[] | string[] {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results: (string | PathBase)[] = []\n if (!filter || filter(entry)) {\n results.push(withFileTypes ? entry : entry.fullpath())\n }\n const dirs = new Set([entry])\n for (const dir of dirs) {\n const entries = dir.readdirSync()\n for (const e of entries) {\n if (!filter || filter(e)) {\n results.push(withFileTypes ? e : e.fullpath())\n }\n let r: PathBase | undefined = e\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync()))) continue\n if (r.isUnknown()) r.lstatSync()\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n dirs.add(r)\n }\n }\n }\n return results as string[] | PathBase[]\n }\n\n /**\n * Support for `for await`\n *\n * Alias for {@link PathScurryBase.iterate}\n *\n * Note: As of Node 19, this is very slow, compared to other methods of\n * walking. Consider using {@link PathScurryBase.stream} if memory overhead\n * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n */\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n\n /**\n * Async generator form of {@link PathScurryBase.walk}\n *\n * Note: As of Node 19, this is very slow, compared to other methods of\n * walking, especially if most/all of the directory tree has been previously\n * walked. Consider using {@link PathScurryBase.stream} if memory overhead\n * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n */\n iterate(): AsyncGenerator\n iterate(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): AsyncGenerator\n iterate(\n opts: WalkOptionsWithFileTypesFalse,\n ): AsyncGenerator\n iterate(opts: WalkOptions): AsyncGenerator\n iterate(entry: string | PathBase): AsyncGenerator\n iterate(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): AsyncGenerator\n iterate(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): AsyncGenerator\n iterate(\n entry: string | PathBase,\n opts: WalkOptions,\n ): AsyncGenerator\n iterate(\n entry: string | PathBase | WalkOptions = this.cwd,\n options: WalkOptions = {},\n ): AsyncGenerator {\n // iterating async over the stream is significantly more performant,\n // especially in the warm-cache scenario, because it buffers up directory\n // entries in the background instead of waiting for a yield for each one.\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n options = entry\n entry = this.cwd\n }\n return this.stream(entry, options)[Symbol.asyncIterator]()\n }\n\n /**\n * Iterating over a PathScurry performs a synchronous walk.\n *\n * Alias for {@link PathScurryBase.iterateSync}\n */\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n iterateSync(): Generator\n iterateSync(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Generator\n iterateSync(\n opts: WalkOptionsWithFileTypesFalse,\n ): Generator\n iterateSync(opts: WalkOptions): Generator\n iterateSync(entry: string | PathBase): Generator\n iterateSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Generator\n iterateSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Generator\n iterateSync(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Generator\n *iterateSync(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Generator {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n if (!filter || filter(entry)) {\n yield withFileTypes ? entry : entry.fullpath()\n }\n const dirs = new Set([entry])\n for (const dir of dirs) {\n const entries = dir.readdirSync()\n for (const e of entries) {\n if (!filter || filter(e)) {\n yield withFileTypes ? e : e.fullpath()\n }\n let r: PathBase | undefined = e\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync()))) continue\n if (r.isUnknown()) r.lstatSync()\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n dirs.add(r)\n }\n }\n }\n }\n\n /**\n * Stream form of {@link PathScurryBase.walk}\n *\n * Returns a Minipass stream that emits {@link PathBase} objects by default,\n * or strings if `{ withFileTypes: false }` is set in the options.\n */\n stream(): Minipass\n stream(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Minipass\n stream(opts: WalkOptionsWithFileTypesFalse): Minipass\n stream(opts: WalkOptions): Minipass\n stream(entry: string | PathBase): Minipass\n stream(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n ): Minipass\n stream(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Minipass\n stream(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Minipass | Minipass\n stream(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Minipass | Minipass {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results = new Minipass({ objectMode: true })\n if (!filter || filter(entry)) {\n results.write(withFileTypes ? entry : entry.fullpath())\n }\n const dirs = new Set()\n const queue: PathBase[] = [entry]\n let processing = 0\n const process = () => {\n let paused = false\n while (!paused) {\n const dir = queue.shift()\n if (!dir) {\n if (processing === 0) results.end()\n return\n }\n\n processing++\n dirs.add(dir)\n\n const onReaddir = (\n er: null | NodeJS.ErrnoException,\n entries: PathBase[],\n didRealpaths: boolean = false,\n ) => {\n /* c8 ignore start */\n if (er) return results.emit('error', er)\n /* c8 ignore stop */\n if (follow && !didRealpaths) {\n const promises: Promise[] = []\n for (const e of entries) {\n if (e.isSymbolicLink()) {\n promises.push(\n e\n .realpath()\n .then((r: PathBase | undefined) =>\n r?.isUnknown() ? r.lstat() : r,\n ),\n )\n }\n }\n if (promises.length) {\n Promise.all(promises).then(() =>\n onReaddir(null, entries, true),\n )\n return\n }\n }\n\n for (const e of entries) {\n if (e && (!filter || filter(e))) {\n if (!results.write(withFileTypes ? e : e.fullpath())) {\n paused = true\n }\n }\n }\n\n processing--\n for (const e of entries) {\n const r = e.realpathCached() || e\n if (r.shouldWalk(dirs, walkFilter)) {\n queue.push(r)\n }\n }\n if (paused && !results.flowing) {\n results.once('drain', process)\n } else if (!sync) {\n process()\n }\n }\n\n // zalgo containment\n let sync = true\n dir.readdirCB(onReaddir, true)\n sync = false\n }\n }\n process()\n return results as Minipass | Minipass\n }\n\n /**\n * Synchronous form of {@link PathScurryBase.stream}\n *\n * Returns a Minipass stream that emits {@link PathBase} objects by default,\n * or strings if `{ withFileTypes: false }` is set in the options.\n *\n * Will complete the walk in a single tick if the stream is consumed fully.\n * Otherwise, will pause as needed for stream backpressure.\n */\n streamSync(): Minipass\n streamSync(\n opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n ): Minipass\n streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass\n streamSync(opts: WalkOptions): Minipass\n streamSync(entry: string | PathBase): Minipass\n streamSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n ): Minipass\n streamSync(\n entry: string | PathBase,\n opts: WalkOptionsWithFileTypesFalse,\n ): Minipass\n streamSync(\n entry: string | PathBase,\n opts: WalkOptions,\n ): Minipass | Minipass\n streamSync(\n entry: string | PathBase | WalkOptions = this.cwd,\n opts: WalkOptions = {},\n ): Minipass | Minipass {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry)\n } else if (!(entry instanceof PathBase)) {\n opts = entry\n entry = this.cwd\n }\n const {\n withFileTypes = true,\n follow = false,\n filter,\n walkFilter,\n } = opts\n const results = new Minipass({ objectMode: true })\n const dirs = new Set()\n if (!filter || filter(entry)) {\n results.write(withFileTypes ? entry : entry.fullpath())\n }\n const queue: PathBase[] = [entry]\n let processing = 0\n const process = () => {\n let paused = false\n while (!paused) {\n const dir = queue.shift()\n if (!dir) {\n if (processing === 0) results.end()\n return\n }\n processing++\n dirs.add(dir)\n\n const entries = dir.readdirSync()\n for (const e of entries) {\n if (!filter || filter(e)) {\n if (!results.write(withFileTypes ? e : e.fullpath())) {\n paused = true\n }\n }\n }\n processing--\n for (const e of entries) {\n let r: PathBase | undefined = e\n if (e.isSymbolicLink()) {\n if (!(follow && (r = e.realpathSync()))) continue\n if (r.isUnknown()) r.lstatSync()\n }\n if (r.shouldWalk(dirs, walkFilter)) {\n queue.push(r)\n }\n }\n }\n if (paused && !results.flowing) results.once('drain', process)\n }\n process()\n return results as Minipass | Minipass\n }\n\n chdir(path: string | Path = this.cwd) {\n const oldCwd = this.cwd\n this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path\n this.cwd[setAsCwd](oldCwd)\n }\n}\n\n/**\n * Options provided to all walk methods.\n */\nexport interface WalkOptions {\n /**\n * Return results as {@link PathBase} objects rather than strings.\n * When set to false, results are fully resolved paths, as returned by\n * {@link PathBase.fullpath}.\n * @default true\n */\n withFileTypes?: boolean\n\n /**\n * Attempt to read directory entries from symbolic links. Otherwise, only\n * actual directories are traversed. Regardless of this setting, a given\n * target path will only ever be walked once, meaning that a symbolic link\n * to a previously traversed directory will never be followed.\n *\n * Setting this imposes a slight performance penalty, because `readlink`\n * must be called on all symbolic links encountered, in order to avoid\n * infinite cycles.\n * @default false\n */\n follow?: boolean\n\n /**\n * Only return entries where the provided function returns true.\n *\n * This will not prevent directories from being traversed, even if they do\n * not pass the filter, though it will prevent directories themselves from\n * being included in the result set. See {@link walkFilter}\n *\n * Asynchronous functions are not supported here.\n *\n * By default, if no filter is provided, all entries and traversed\n * directories are included.\n */\n filter?: (entry: PathBase) => boolean\n\n /**\n * Only traverse directories (and in the case of {@link follow} being set to\n * true, symbolic links to directories) if the provided function returns\n * true.\n *\n * This will not prevent directories from being included in the result set,\n * even if they do not pass the supplied filter function. See {@link filter}\n * to do that.\n *\n * Asynchronous functions are not supported here.\n */\n walkFilter?: (entry: PathBase) => boolean\n}\n\nexport type WalkOptionsWithFileTypesUnset = WalkOptions & {\n withFileTypes?: undefined\n}\nexport type WalkOptionsWithFileTypesTrue = WalkOptions & {\n withFileTypes: true\n}\nexport type WalkOptionsWithFileTypesFalse = WalkOptions & {\n withFileTypes: false\n}\n\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings. Uses\n * {@link PathWin32} for Path objects.\n */\nexport class PathScurryWin32 extends PathScurryBase {\n /**\n * separator for generating path strings\n */\n sep: '\\\\' = '\\\\'\n\n constructor(\n cwd: URL | string = process.cwd(),\n opts: PathScurryOpts = {},\n ) {\n const { nocase = true } = opts\n super(cwd, win32, '\\\\', { ...opts, nocase })\n this.nocase = nocase\n for (let p: PathBase | undefined = this.cwd; p; p = p.parent) {\n p.nocase = this.nocase\n }\n }\n\n /**\n * @internal\n */\n parseRootPath(dir: string): string {\n // if the path starts with a single separator, it's not a UNC, and we'll\n // just get separator as the root, and driveFromUNC will return \\\n // In that case, mount \\ on the root from the cwd.\n return win32.parse(dir).root.toUpperCase()\n }\n\n /**\n * @internal\n */\n newRoot(fs: FSValue) {\n return new PathWin32(\n this.rootPath,\n IFDIR,\n undefined,\n this.roots,\n this.nocase,\n this.childrenCache(),\n { fs },\n )\n }\n\n /**\n * Return true if the provided path string is an absolute path\n */\n isAbsolute(p: string): boolean {\n return (\n p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p)\n )\n }\n}\n\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryPosix extends PathScurryBase {\n /**\n * separator for generating path strings\n */\n sep: '/' = '/'\n constructor(\n cwd: URL | string = process.cwd(),\n opts: PathScurryOpts = {},\n ) {\n const { nocase = false } = opts\n super(cwd, posix, '/', { ...opts, nocase })\n this.nocase = nocase\n }\n\n /**\n * @internal\n */\n parseRootPath(_dir: string): string {\n return '/'\n }\n\n /**\n * @internal\n */\n newRoot(fs: FSValue) {\n return new PathPosix(\n this.rootPath,\n IFDIR,\n undefined,\n this.roots,\n this.nocase,\n this.childrenCache(),\n { fs },\n )\n }\n\n /**\n * Return true if the provided path string is an absolute path\n */\n isAbsolute(p: string): boolean {\n return p.startsWith('/')\n }\n}\n\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryDarwin extends PathScurryPosix {\n constructor(\n cwd: URL | string = process.cwd(),\n opts: PathScurryOpts = {},\n ) {\n const { nocase = true } = opts\n super(cwd, { ...opts, nocase })\n }\n}\n\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexport const Path = process.platform === 'win32' ? PathWin32 : PathPosix\nexport type Path = PathBase | InstanceType\n\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexport const PathScurry:\n | typeof PathScurryWin32\n | typeof PathScurryDarwin\n | typeof PathScurryPosix =\n process.platform === 'win32' ? PathScurryWin32\n : process.platform === 'darwin' ? PathScurryDarwin\n : PathScurryPosix\nexport type PathScurry = PathScurryBase | InstanceType\n"]} \ No newline at end of file diff --git a/node_modules/path-scurry/dist/esm/package.json b/node_modules/path-scurry/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/path-scurry/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/path-scurry/node_modules/lru-cache/LICENSE b/node_modules/path-scurry/node_modules/lru-cache/LICENSE new file mode 100644 index 0000000..f785757 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/path-scurry/node_modules/lru-cache/README.md b/node_modules/path-scurry/node_modules/lru-cache/README.md new file mode 100644 index 0000000..931822f --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/README.md @@ -0,0 +1,331 @@ +# lru-cache + +A cache object that deletes the least-recently-used items. + +Specify a max number of the most recently used items that you +want to keep, and this cache will keep that many of the most +recently accessed items. + +This is not primarily a TTL cache, and does not make strong TTL +guarantees. There is no preemptive pruning of expired items by +default, but you _may_ set a TTL on the cache or on a single +`set`. If you do so, it will treat expired items as missing, and +delete them when fetched. If you are more interested in TTL +caching than LRU caching, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +As of version 7, this is one of the most performant LRU +implementations available in JavaScript, and supports a wide +diversity of use cases. However, note that using some of the +features will necessarily impact performance, by causing the +cache to have to do more work. See the "Performance" section +below. + +## Installation + +```bash +npm install lru-cache --save +``` + +## Usage + +```js +// hybrid module, either works +import { LRUCache } from 'lru-cache' +// or: +const { LRUCache } = require('lru-cache') +// or in minified form for web browsers: +import { LRUCache } from 'http://unpkg.com/lru-cache@9/dist/mjs/index.min.mjs' + +// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent +// unsafe unbounded storage. +// +// In most cases, it's best to specify a max for performance, so all +// the required memory allocation is done up-front. +// +// All the other options are optional, see the sections below for +// documentation on what each one does. Most of them can be +// overridden for specific items in get()/set() +const options = { + max: 500, + + // for use with tracking overall storage size + maxSize: 5000, + sizeCalculation: (value, key) => { + return 1 + }, + + // for use when you need to clean up something when objects + // are evicted from the cache + dispose: (value, key) => { + freeFromMemoryOrWhatever(value) + }, + + // how long to live in ms + ttl: 1000 * 60 * 5, + + // return stale items before removing from cache? + allowStale: false, + + updateAgeOnGet: false, + updateAgeOnHas: false, + + // async method to use for cache.fetch(), for + // stale-while-revalidate type of behavior + fetchMethod: async ( + key, + staleValue, + { options, signal, context } + ) => {}, +} + +const cache = new LRUCache(options) + +cache.set('key', 'value') +cache.get('key') // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.clear() // empty the cache +``` + +If you put more stuff in the cache, then less recently used items +will fall out. That's what an LRU cache is. + +For full description of the API and all options, please see [the +LRUCache typedocs](https://isaacs.github.io/node-lru-cache/) + +## Storage Bounds Safety + +This implementation aims to be as flexible as possible, within +the limits of safe memory consumption and optimal performance. + +At initial object creation, storage is allocated for `max` items. +If `max` is set to zero, then some performance is lost, and item +count is unbounded. Either `maxSize` or `ttl` _must_ be set if +`max` is not specified. + +If `maxSize` is set, then this creates a safe limit on the +maximum storage consumed, but without the performance benefits of +pre-allocation. When `maxSize` is set, every item _must_ provide +a size, either via the `sizeCalculation` method provided to the +constructor, or via a `size` or `sizeCalculation` option provided +to `cache.set()`. The size of every item _must_ be a positive +integer. + +If neither `max` nor `maxSize` are set, then `ttl` tracking must +be enabled. Note that, even when tracking item `ttl`, items are +_not_ preemptively deleted when they become stale, unless +`ttlAutopurge` is enabled. Instead, they are only purged the +next time the key is requested. Thus, if `ttlAutopurge`, `max`, +and `maxSize` are all not set, then the cache will potentially +grow unbounded. + +In this case, a warning is printed to standard error. Future +versions may require the use of `ttlAutopurge` if `max` and +`maxSize` are not specified. + +If you truly wish to use a cache that is bound _only_ by TTL +expiration, consider using a `Map` object, and calling +`setTimeout` to delete entries when they expire. It will perform +much better than an LRU cache. + +Here is an implementation you may use, under the same +[license](./LICENSE) as this package: + +```js +// a storage-unbounded ttl cache that is not an lru-cache +const cache = { + data: new Map(), + timers: new Map(), + set: (k, v, ttl) => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.set( + k, + setTimeout(() => cache.delete(k), ttl) + ) + cache.data.set(k, v) + }, + get: k => cache.data.get(k), + has: k => cache.data.has(k), + delete: k => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.delete(k) + return cache.data.delete(k) + }, + clear: () => { + cache.data.clear() + for (const v of cache.timers.values()) { + clearTimeout(v) + } + cache.timers.clear() + }, +} +``` + +If that isn't to your liking, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +## Storing Undefined Values + +This cache never stores undefined values, as `undefined` is used +internally in a few places to indicate that a key is not in the +cache. + +You may call `cache.set(key, undefined)`, but this is just +an alias for `cache.delete(key)`. Note that this has the effect +that `cache.has(key)` will return _false_ after setting it to +undefined. + +```js +cache.set(myKey, undefined) +cache.has(myKey) // false! +``` + +If you need to track `undefined` values, and still note that the +key is in the cache, an easy workaround is to use a sigil object +of your own. + +```js +import { LRUCache } from 'lru-cache' +const undefinedValue = Symbol('undefined') +const cache = new LRUCache(...) +const mySet = (key, value) => + cache.set(key, value === undefined ? undefinedValue : value) +const myGet = (key, value) => { + const v = cache.get(key) + return v === undefinedValue ? undefined : v +} +``` + +## Performance + +As of January 2022, version 7 of this library is one of the most +performant LRU cache implementations in JavaScript. + +Benchmarks can be extremely difficult to get right. In +particular, the performance of set/get/delete operations on +objects will vary _wildly_ depending on the type of key used. V8 +is highly optimized for objects with keys that are short strings, +especially integer numeric strings. Thus any benchmark which +tests _solely_ using numbers as keys will tend to find that an +object-based approach performs the best. + +Note that coercing _anything_ to strings to use as object keys is +unsafe, unless you can be 100% certain that no other type of +value will be used. For example: + +```js +const myCache = {} +const set = (k, v) => (myCache[k] = v) +const get = k => myCache[k] + +set({}, 'please hang onto this for me') +set('[object Object]', 'oopsie') +``` + +Also beware of "Just So" stories regarding performance. Garbage +collection of large (especially: deep) object graphs can be +incredibly costly, with several "tipping points" where it +increases exponentially. As a result, putting that off until +later can make it much worse, and less predictable. If a library +performs well, but only in a scenario where the object graph is +kept shallow, then that won't help you if you are using large +objects as keys. + +In general, when attempting to use a library to improve +performance (such as a cache like this one), it's best to choose +an option that will perform well in the sorts of scenarios where +you'll actually use it. + +This library is optimized for repeated gets and minimizing +eviction time, since that is the expected need of a LRU. Set +operations are somewhat slower on average than a few other +options, in part because of that optimization. It is assumed +that you'll be caching some costly operation, ideally as rarely +as possible, so optimizing set over get would be unwise. + +If performance matters to you: + +1. If it's at all possible to use small integer values as keys, + and you can guarantee that no other types of values will be + used as keys, then do that, and use a cache such as + [lru-fast](https://npmjs.com/package/lru-fast), or + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) + which uses an Object as its data store. + +2. Failing that, if at all possible, use short non-numeric + strings (ie, less than 256 characters) as your keys, and use + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). + +3. If the types of your keys will be anything else, especially + long strings, strings that look like floats, objects, or some + mix of types, or if you aren't sure, then this library will + work well for you. + + If you do not need the features that this library provides + (like asynchronous fetching, a variety of TTL staleness + options, and so on), then [mnemonist's + LRUMap](https://yomguithereal.github.io/mnemonist/lru-map) is + a very good option, and just slightly faster than this module + (since it does considerably less). + +4. Do not use a `dispose` function, size tracking, or especially + ttl behavior, unless absolutely needed. These features are + convenient, and necessary in some use cases, and every attempt + has been made to make the performance impact minimal, but it + isn't nothing. + +## Breaking Changes in Version 7 + +This library changed to a different algorithm and internal data +structure in version 7, yielding significantly better +performance, albeit with some subtle changes as a result. + +If you were relying on the internals of LRUCache in version 6 or +before, it probably will not work in version 7 and above. + +## Breaking Changes in Version 8 + +- The `fetchContext` option was renamed to `context`, and may no + longer be set on the cache instance itself. +- Rewritten in TypeScript, so pretty much all the types moved + around a lot. +- The AbortController/AbortSignal polyfill was removed. For this + reason, **Node version 16.14.0 or higher is now required**. +- Internal properties were moved to actual private class + properties. +- Keys and values must not be `null` or `undefined`. +- Minified export available at `'lru-cache/min'`, for both CJS + and MJS builds. + +## Breaking Changes in Version 9 + +- Named export only, no default export. +- AbortController polyfill returned, albeit with a warning when + used. + +## Breaking Changes in Version 10 + +- `cache.fetch()` return type is now `Promise` + instead of `Promise`. This is an irrelevant change + practically speaking, but can require changes for TypeScript + users. + +For more info, see the [change log](CHANGELOG.md). diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts new file mode 100644 index 0000000..f59de76 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts @@ -0,0 +1,1277 @@ +/** + * @module LRUCache + */ +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + */ + interface Status { + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss'; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The old value, specified in the case of `set:'update'` or + * `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: undefined; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: undefined; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoerOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache implements Map { + #private; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: any) => boolean; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: any) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator | undefined, void, unknown>; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRLUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | BackgroundFetch | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts.map b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000..34d60c5 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru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EAAE,GAC5B,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9B,EAAE,SAAS,SAAS,GAAG,IAAI,GAC3B,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GACnC,KAAK,GACR,CAAC;IAiBJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IAgFxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAqDX;;OAEG;IACH,KAAK;CA0CN"} \ No newline at end of file diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js new file mode 100644 index 0000000..0589231 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js @@ -0,0 +1,1546 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const perf = typeof performance === 'object' && + performance && + typeof performance.now === 'function' + ? performance + : Date; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? process : {}); +/* c8 ignore start */ +const emitWarning = (msg, type, code, fn) => { + typeof PROCESS.emitWarning === 'function' + ? PROCESS.emitWarning(msg, type, code, fn) + : console.error(`[${code}] ${type}: ${msg}`); +}; +let AC = globalThis.AbortController; +let AS = globalThis.AbortSignal; +/* c8 ignore start */ +if (typeof AC === 'undefined') { + //@ts-ignore + AS = class AbortSignal { + onabort; + _onabort = []; + reason; + aborted = false; + addEventListener(_, fn) { + this._onabort.push(fn); + } + }; + //@ts-ignore + AC = class AbortController { + constructor() { + warnACPolyfill(); + } + signal = new AS(); + abort(reason) { + if (this.signal.aborted) + return; + //@ts-ignore + this.signal.reason = reason; + //@ts-ignore + this.signal.aborted = true; + //@ts-ignore + for (const fn of this.signal._onabort) { + fn(reason); + } + this.signal.onabort?.(reason); + } + }; + let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'; + const warnACPolyfill = () => { + if (!printACPolyfillWarning) + return; + printACPolyfillWarning = false; + emitWarning('AbortController is not defined. If using lru-cache in ' + + 'node 14, load an AbortController polyfill from the ' + + '`node-abort-controller` package. A minimal polyfill is ' + + 'provided for use by LRUCache.fetch(), but it should not be ' + + 'relied upon in other contexts (eg, passing it to other APIs that ' + + 'use AbortController/AbortSignal might have undesirable effects). ' + + 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill); + }; +} +/* c8 ignore stop */ +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); +/* c8 ignore start */ +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +const getUintArray = (max) => !isPosInt(max) + ? null + : max <= Math.pow(2, 8) + ? Uint8Array + : max <= Math.pow(2, 16) + ? Uint16Array + : max <= Math.pow(2, 32) + ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER + ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + heap; + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #disposeAfter; + #fetchMethod; + #memoMethod; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && + typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && + typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = new Array(max).fill(undefined); + this.#valList = new Array(max).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 + ? ttlResolution + : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + this.#setItemTTL = (index, ttl, start = perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + if (ttl !== 0 && this.ttlAutopurge) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? perf.now() : 0; + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore next */ + if (!ttl || !start) + return; + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + return 0; + } + if (!isPosInt(size)) { + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; true;) { + if (!this.#isValidIndex(i)) { + break; + } + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; true;) { + if (!this.#isValidIndex(i)) { + break; + } + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + return undefined; + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRLUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = perf.now() - age; + } + this.set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + if (v === undefined) { + this.delete(k); + return this; + } + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + // have to delete, in case something is there already. + this.#delete(k, 'set'); + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 + ? this.#tail + : this.#free.length !== 0 + ? this.#free.pop() + : this.#size === this.#max + ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + } + else { + // update + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) { + oldVal.__abortController.abort(new Error('replaced')); + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && !noDisposeOnSet) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else if (!noDisposeOnSet) { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (status) { + status.set = 'replace'; + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + } + else if (status) { + status.set = 'update'; + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('evicted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, 'evict']); + } + } + this.#removeItemSize(head); + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || + (!allowStale && this.#isStale(index))) { + return; + } + const v = this.#valList[index]; + // either stale and allowed, or forcing a refresh of non-stale value + return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AC(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + if (this.#valList[index] === p) { + if (v === undefined) { + if (bf.__staleWhileFetching) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.set(k, v, fetchOpts.options); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + return fetchFail(er); + }; + const fetchFail = (er) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || bf.__staleWhileFetching === undefined; + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || + options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AC); + } + async fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + async forceFetch(k, fetchOptions = {}) { + const v = await this.fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, forceRefresh, ...options } = memoOptions; + const v = this.get(k, options); + if (!forceRefresh && v !== undefined) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + this.set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + if (status) + status.get = 'stale'; + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status && allowStale) + status.returnedStale = true; + return allowStale ? value : undefined; + } + else { + if (status && + allowStale && + value.__staleWhileFetching !== undefined) { + status.returnedStale = true; + } + return allowStale ? value.__staleWhileFetching : undefined; + } + } + else { + if (status) + status.get = 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + if (fetching) { + return value.__staleWhileFetching; + } + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return value; + } + } + else if (status) { + status.get = 'miss'; + } + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map new file mode 100644 index 0000000..557c616 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,MAAM,IAAI,GACR,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU;IACnC,CAAC,CAAC,WAAW;IACb,CAAC,CAAC,IAAI,CAAA;AAEV,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAKhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAChC,CAAA;AACzB,qBAAqB;AAErB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;QACvC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1C,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,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G,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC3B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;aAC9B;SACF;IACH,CAAC;CACF;AAxwDD,4BAwwDC","sourcesContent":["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js new file mode 100644 index 0000000..ad643b0 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js @@ -0,0 +1,2 @@ +"use strict";var G=(l,t,e)=>{if(!t.has(l))throw TypeError("Cannot "+e)};var j=(l,t,e)=>(G(l,t,"read from private field"),e?e.call(l):t.get(l)),I=(l,t,e)=>{if(t.has(l))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(l):t.set(l,e)},x=(l,t,e,i)=>(G(l,t,"write to private field"),i?i.call(l,e):t.set(l,e),e);Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var T=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,P=new Set,U=typeof process=="object"&&process?process:{},H=(l,t,e,i)=>{typeof U.emitWarning=="function"?U.emitWarning(l,t,e,i):console.error(`[${e}] ${t}: ${l}`)},D=globalThis.AbortController,N=globalThis.AbortSignal;if(typeof D>"u"){N=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},D=class{constructor(){t()}signal=new N;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let l=U.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=!1,H("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var V=l=>!P.has(l),Y=Symbol("type"),A=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),k=l=>A(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?E:null:null,E=class extends Array{constructor(t){super(t),this.fill(0)}},v,O=class{heap;length;static create(t){let e=k(t);if(!e)return[];x(O,v,!0);let i=new O(t,e);return x(O,v,!1),i}constructor(t,e){if(!j(O,v))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},W=O;v=new WeakMap,I(W,v,!1);var C=class{#g;#f;#p;#w;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#c;#o;#h;#_;#r;#b;#m;#u;#y;#E;#a;static unsafeExposeInternals(t){return{starts:t.#m,ttls:t.#u,sizes:t.#b,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#x(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#F(e),isStale:e=>t.#d(e)}}get max(){return this.#g}get maxSize(){return this.#f}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get disposeAfter(){return this.#w}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:o,allowStale:r,dispose:g,disposeAfter:b,noDisposeOnSet:f,noUpdateTTL:u,maxSize:c=0,maxEntrySize:F=0,sizeCalculation:d,fetchMethod:S,memoMethod:a,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:z}=t;if(e!==0&&!A(e))throw new TypeError("max option must be a nonnegative integer");let y=e?k(e):Array;if(!y)throw new Error("invalid max value: "+e);if(this.#g=e,this.#f=c,this.maxEntrySize=F||this.#f,this.sizeCalculation=d,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(a!==void 0&&typeof a!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=a,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=S,this.#E=!!S,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new y(e),this.#c=new y(e),this.#o=0,this.#h=0,this.#_=W.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof b=="function"?(this.#w=b,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#y=!!this.#p,this.#a=!!this.#w,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#f!==0&&!A(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!A(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!o,this.ttlResolution=A(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!A(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#U()}if(this.#g===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#g&&!this.#f){let R="LRU_CACHE_UNBOUNDED";V(R)&&(P.add(R),H("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,C))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#U(){let t=new E(this.#g),e=new E(this.#g);this.#u=t,this.#m=e,this.#M=(n,h,o=T.now())=>{if(e[n]=h!==0?o:0,t[n]=h,h!==0&&this.ttlAutopurge){let r=setTimeout(()=>{this.#d(n)&&this.#T(this.#i[n],"expire")},h+1);r.unref&&r.unref()}},this.#v=n=>{e[n]=t[n]!==0?T.now():0},this.#O=(n,h)=>{if(t[h]){let o=t[h],r=e[h];if(!o||!r)return;n.ttl=o,n.start=r,n.now=i||s();let g=n.now-r;n.remainingTTL=o-g}};let i=0,s=()=>{let n=T.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#s.get(n);if(h===void 0)return 0;let o=t[h],r=e[h];if(!o||!r)return 1/0;let g=(i||s())-r;return o-g},this.#d=n=>{let h=e[n],o=t[n];return!!o&&!!h&&(i||s())-h>o}}#v=()=>{};#O=()=>{};#M=()=>{};#d=()=>!1;#P(){let t=new E(this.#g);this.#S=0,this.#b=t,this.#z=e=>{this.#S-=t[e],t[e]=0},this.#G=(e,i,s,n)=>{if(this.#e(i))return 0;if(!A(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!A(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#D=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#S>n;)this.#L(!0)}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S)}}#z=t=>{};#D=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;!(!this.#j(e)||((t||!this.#d(e))&&(yield e),e===this.#o));)e=this.#c[e]}*#F({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#j(e)||((t||!this.#d(e))&&(yield e),e===this.#h));)e=this.#l[e]}#j(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#F())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#F()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#F())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#F()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#F({allowStale:!0}))this.#d(e)&&(this.#T(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#u&&this.#m){let h=this.#u[e],o=this.#m[e];if(h&&o){let r=h-(T.now()-o);n.ttl=r,n.start=Date.now()}}return this.#b&&(n.size=this.#b[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#u&&this.#m){h.ttl=this.#u[e];let o=T.now()-this.#m[e];h.start=Math.floor(Date.now()-o)}this.#b&&(h.size=this.#b[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=T.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:r}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,b=this.#G(t,e,i.size||0,o);if(this.maxEntrySize&&b>this.maxEntrySize)return r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this.#T(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#g?this.#L(!1):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#h]=f,this.#c[f]=this.#h,this.#h=f,this.#n++,this.#D(f,b,r),r&&(r.set="add"),g=!1;else{this.#C(f);let u=this.#t[f];if(e!==u){if(this.#E&&this.#e(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:c}=u;c!==void 0&&!h&&(this.#y&&this.#p?.(c,t,"set"),this.#a&&this.#r?.push([c,t,"set"]))}else h||(this.#y&&this.#p?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"]));if(this.#z(f),this.#D(f,b,r),this.#t[f]=e,r){r.set="replace";let c=u&&this.#e(u)?u.__staleWhileFetching:u;c!==void 0&&(r.oldValue=c)}}else r&&(r.set="update")}if(s!==0&&!this.#u&&this.#U(),this.#u&&(g||this.#M(f,s,n),r&&this.#O(r,f)),!h&&this.#a&&this.#r){let u=this.#r,c;for(;c=u?.shift();)this.#w?.(...c)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#L(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#w?.(...e)}}}#L(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#E&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#z(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#o=this.#h=0,this.#_.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#d(n))s&&(s.has="stale",this.#O(s,n));else return i&&this.#v(n),s&&(s.has="hit",this.#O(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#d(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#x(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new D,{signal:o}=i;o?.addEventListener("abort",()=>h.abort(o.reason),{signal:h.signal});let r={signal:h.signal,options:i,context:s},g=(d,S=!1)=>{let{aborted:a}=h.signal,w=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(a&&!S?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!w&&!S)return f(h.signal.reason);let m=c;return this.#t[e]===c&&(d===void 0?m.__staleWhileFetching?this.#t[e]=m.__staleWhileFetching:this.#T(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,d,r.options))),d},b=d=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=d),f(d)),f=d=>{let{aborted:S}=h.signal,a=S&&i.allowStaleOnFetchAbort,w=a||i.allowStaleOnFetchRejection,m=w||i.noDeleteOnFetchRejection,p=c;if(this.#t[e]===c&&(!m||p.__staleWhileFetching===void 0?this.#T(t,"fetch"):a||(this.#t[e]=p.__staleWhileFetching)),w)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw d},u=(d,S)=>{let a=this.#R?.(t,n,r);a&&a instanceof Promise&&a.then(w=>d(w===void 0?void 0:w),S),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=w=>g(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(u).then(g,b),F=Object.assign(c,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,F,{...r.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=F,F}#e(t){if(!this.#E)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof D}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:r=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:b=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:d,forceRefresh:S=!1,status:a,signal:w}=e;if(!this.#E)return a&&(a.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let m={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:o,size:r,sizeCalculation:g,noUpdateTTL:b,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:F,ignoreFetchAbort:c,status:a,signal:w},p=this.#s.get(t);if(p===void 0){a&&(a.fetch="miss");let _=this.#x(t,p,m,d);return _.__returned=_}else{let _=this.#t[p];if(this.#e(_)){let M=i&&_.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",M&&(a.returnedStale=!0)),M?_.__staleWhileFetching:_.__returned=_}let z=this.#d(p);if(!S&&!z)return a&&(a.fetch="hit"),this.#C(p),s&&this.#v(p),a&&this.#O(a,p),_;let y=this.#x(t,p,m,d),L=y.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=z?"stale":"refresh",L&&z&&(a.returnedStale=!0)),L?y.__staleWhileFetching:y.__returned=y}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...h}=e,o=this.get(t,h);if(!n&&o!==void 0)return o;let r=i(t,o,{options:h,context:s});return this.set(t,r,h),r}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,o=this.#s.get(t);if(o!==void 0){let r=this.#t[o],g=this.#e(r);return h&&this.#O(h,o),this.#d(o)?(h&&(h.get="stale"),g?(h&&i&&r.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?r.__staleWhileFetching:void 0):(n||this.#T(t,"expire"),h&&i&&(h.returnedStale=!0),i?r:void 0)):(h&&(h.get="hit"),g?r.__staleWhileFetching:(this.#C(o),s&&this.#v(o),r))}else h&&(h.get="miss")}#I(t,e){this.#c[e]=t,this.#l[t]=e}#C(t){t!==this.#h&&(t===this.#o?this.#o=this.#l[t]:this.#I(this.#c[t],this.#l[t]),this.#I(this.#h,t),this.#h=t)}delete(t){return this.#T(t,"delete")}#T(t,e){let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=!0,this.#n===1)this.#N(e);else{this.#z(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(n,t,e),this.#a&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#c[s];else if(s===this.#o)this.#o=this.#l[s];else{let h=this.#c[s];this.#l[h]=this.#l[s];let o=this.#l[s];this.#c[o]=this.#c[s]}this.#n--,this.#_.push(s)}}if(this.#a&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#N("delete")}#N(t){for(let e of this.#F({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#y&&this.#p?.(i,s,t),this.#a&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#u&&this.#m&&(this.#u.fill(0),this.#m.fill(0)),this.#b&&this.#b.fill(0),this.#o=0,this.#h=0,this.#_.length=0,this.#S=0,this.#n=0,this.#a&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#w?.(...i)}}};exports.LRUCache=C; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map new file mode 100644 index 0000000..11b43a0 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/index.ts"], + "sourcesContent": ["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "+aAMA,IAAMA,EACJ,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WACvB,YACA,KAEAC,EAAS,IAAI,IAMbC,EACJ,OAAO,SAAY,UAAc,QAAU,QAAU,CAAA,EAIjDC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACF,OAAOL,EAAQ,aAAgB,WAC3BA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EACvC,QAAQ,MAAM,IAAID,MAASD,MAASD,GAAK,CAC/C,EAEII,EAAK,WAAW,gBAChBC,EAAK,WAAW,YAGpB,GAAI,OAAOD,EAAO,IAAa,CAE7BC,EAAK,KAAiB,CACpB,QACA,SAAqC,CAAA,EACrC,OACA,QAAmB,GACnB,iBAAiBC,EAAWH,EAAwB,CAClD,KAAK,SAAS,KAAKA,CAAE,CACvB,GAGFC,EAAK,KAAqB,CACxB,aAAA,CACEG,EAAc,CAChB,CACA,OAAS,IAAIF,EACb,MAAMG,EAAW,CACf,GAAI,MAAK,OAAO,QAEhB,MAAK,OAAO,OAASA,EAErB,KAAK,OAAO,QAAU,GAEtB,QAAWL,KAAM,KAAK,OAAO,SAC3BA,EAAGK,CAAM,EAEX,KAAK,OAAO,UAAUA,CAAM,EAC9B,GAEF,IAAIC,EACFX,EAAQ,KAAK,8BAAgC,IACzCS,EAAiB,IAAK,CACr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B,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKgB,IAAoB,KAAKN,GAAW,CAC3C,IAAM8E,EAAK,KAAK9E,GACZ+E,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAK3F,KAAgB,GAAG4F,CAAI,EAGlC,GAvwDF,QAAA,SAAAhG", + "names": ["perf", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "AC", "AS", "_", "warnACPolyfill", "reason", "printACPolyfillWarning", "shouldWarn", "TYPE", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "_Stack", "HeapCls", "__privateSet", "_constructing", "s", "__privateGet", "Stack", "__privateAdd", "LRUCache", "#max", "#maxSize", "#dispose", "#disposeAfter", "#fetchMethod", "#memoMethod", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "key", "ttls", "starts", "#setItemTTL", "start", "t", "#delete", "#updateItemAge", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "getOptions", "value", "thisp", "deleted", "entry", "remain", "arr", "setOptions", "oldVal", "oldValue", "dt", "task", "val", "free", "head", "hasOptions", "peekOptions", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "fetchFail", "bf", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "forceRefresh", "stale", "isStale", "staleVal", "memoOptions", "vv", "fetching", "#connect", "#clear", "pi", "ni"] +} diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts new file mode 100644 index 0000000..f59de76 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts @@ -0,0 +1,1277 @@ +/** + * @module LRUCache + */ +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + */ + interface Status { + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss'; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The old value, specified in the case of `set:'update'` or + * `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: undefined; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: undefined; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoerOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache implements Map { + #private; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: any) => boolean; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: any) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V | BackgroundFetch | undefined)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator | undefined, void, unknown>; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => any, thisp?: any): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRLUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | BackgroundFetch | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map new file mode 100644 index 0000000..34d60c5 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0FH,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM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/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js new file mode 100644 index 0000000..555654a --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js @@ -0,0 +1,1542 @@ +/** + * @module LRUCache + */ +const perf = typeof performance === 'object' && + performance && + typeof performance.now === 'function' + ? performance + : Date; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? process : {}); +/* c8 ignore start */ +const emitWarning = (msg, type, code, fn) => { + typeof PROCESS.emitWarning === 'function' + ? PROCESS.emitWarning(msg, type, code, fn) + : console.error(`[${code}] ${type}: ${msg}`); +}; +let AC = globalThis.AbortController; +let AS = globalThis.AbortSignal; +/* c8 ignore start */ +if (typeof AC === 'undefined') { + //@ts-ignore + AS = class AbortSignal { + onabort; + _onabort = []; + reason; + aborted = false; + addEventListener(_, fn) { + this._onabort.push(fn); + } + }; + //@ts-ignore + AC = class AbortController { + constructor() { + warnACPolyfill(); + } + signal = new AS(); + abort(reason) { + if (this.signal.aborted) + return; + //@ts-ignore + this.signal.reason = reason; + //@ts-ignore + this.signal.aborted = true; + //@ts-ignore + for (const fn of this.signal._onabort) { + fn(reason); + } + this.signal.onabort?.(reason); + } + }; + let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'; + const warnACPolyfill = () => { + if (!printACPolyfillWarning) + return; + printACPolyfillWarning = false; + emitWarning('AbortController is not defined. If using lru-cache in ' + + 'node 14, load an AbortController polyfill from the ' + + '`node-abort-controller` package. A minimal polyfill is ' + + 'provided for use by LRUCache.fetch(), but it should not be ' + + 'relied upon in other contexts (eg, passing it to other APIs that ' + + 'use AbortController/AbortSignal might have undesirable effects). ' + + 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill); + }; +} +/* c8 ignore stop */ +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); +/* c8 ignore start */ +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +const getUintArray = (max) => !isPosInt(max) + ? null + : max <= Math.pow(2, 8) + ? Uint8Array + : max <= Math.pow(2, 16) + ? Uint16Array + : max <= Math.pow(2, 32) + ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER + ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + heap; + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #disposeAfter; + #fetchMethod; + #memoMethod; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && + typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && + typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = new Array(max).fill(undefined); + this.#valList = new Array(max).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 + ? ttlResolution + : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + this.#setItemTTL = (index, ttl, start = perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + if (ttl !== 0 && this.ttlAutopurge) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? perf.now() : 0; + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore next */ + if (!ttl || !start) + return; + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + return 0; + } + if (!isPosInt(size)) { + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; true;) { + if (!this.#isValidIndex(i)) { + break; + } + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; true;) { + if (!this.#isValidIndex(i)) { + break; + } + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined) + return undefined; + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRLUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) + ? v.__staleWhileFetching + : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = perf.now() - age; + } + this.set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + if (v === undefined) { + this.delete(k); + return this; + } + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + // have to delete, in case something is there already. + this.#delete(k, 'set'); + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 + ? this.#tail + : this.#free.length !== 0 + ? this.#free.pop() + : this.#size === this.#max + ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + } + else { + // update + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) { + oldVal.__abortController.abort(new Error('replaced')); + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && !noDisposeOnSet) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else if (!noDisposeOnSet) { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (status) { + status.set = 'replace'; + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) + ? oldVal.__staleWhileFetching + : oldVal; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + } + else if (status) { + status.set = 'update'; + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('evicted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, 'evict']); + } + } + this.#removeItemSize(head); + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || + (!allowStale && this.#isStale(index))) { + return; + } + const v = this.#valList[index]; + // either stale and allowed, or forcing a refresh of non-stale value + return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AC(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + if (this.#valList[index] === p) { + if (v === undefined) { + if (bf.__staleWhileFetching) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.set(k, v, fetchOpts.options); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + return fetchFail(er); + }; + const fetchFail = (er) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || bf.__staleWhileFetching === undefined; + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || + options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AC); + } + async fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + async forceFetch(k, fetchOptions = {}) { + const v = await this.fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, forceRefresh, ...options } = memoOptions; + const v = this.get(k, options); + if (!forceRefresh && v !== undefined) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + this.set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + if (status) + status.get = 'stale'; + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status && allowStale) + status.returnedStale = true; + return allowStale ? value : undefined; + } + else { + if (status && + allowStale && + value.__staleWhileFetching !== undefined) { + status.returnedStale = true; + } + return allowStale ? value.__staleWhileFetching : undefined; + } + } + else { + if (status) + status.get = 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + if (fetching) { + return value.__staleWhileFetching; + } + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return value; + } + } + else if (status) { + status.get = 'miss'; + } + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map new file mode 100644 index 0000000..8f7ac53 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],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CAAA;QAC7B,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;YAC9B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;SACrB;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;SACpB;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE;YAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;gBAC3B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;aAC9B;SACF;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js new file mode 100644 index 0000000..4571d02 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js @@ -0,0 +1,2 @@ +var G=(l,t,e)=>{if(!t.has(l))throw TypeError("Cannot "+e)};var I=(l,t,e)=>(G(l,t,"read from private field"),e?e.call(l):t.get(l)),j=(l,t,e)=>{if(t.has(l))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(l):t.set(l,e)},x=(l,t,e,i)=>(G(l,t,"write to private field"),i?i.call(l,e):t.set(l,e),e);var T=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,P=new Set,M=typeof process=="object"&&process?process:{},H=(l,t,e,i)=>{typeof M.emitWarning=="function"?M.emitWarning(l,t,e,i):console.error(`[${e}] ${t}: ${l}`)},W=globalThis.AbortController,N=globalThis.AbortSignal;if(typeof W>"u"){N=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},W=class{constructor(){t()}signal=new N;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let l=M.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{l&&(l=!1,H("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var V=l=>!P.has(l),Y=Symbol("type"),A=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),k=l=>A(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0)}},z,E=class{heap;length;static create(t){let e=k(t);if(!e)return[];x(E,z,!0);let i=new E(t,e);return x(E,z,!1),i}constructor(t,e){if(!I(E,z))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},R=E;z=new WeakMap,j(R,z,!1);var D=class{#g;#f;#p;#w;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#c;#o;#h;#_;#r;#m;#b;#u;#y;#O;#a;static unsafeExposeInternals(t){return{starts:t.#b,ttls:t.#u,sizes:t.#m,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#c,get head(){return t.#o},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#x(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#F(e),isStale:e=>t.#d(e)}}get max(){return this.#g}get maxSize(){return this.#f}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get disposeAfter(){return this.#w}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:h,updateAgeOnHas:o,allowStale:r,dispose:g,disposeAfter:m,noDisposeOnSet:f,noUpdateTTL:u,maxSize:c=0,maxEntrySize:F=0,sizeCalculation:d,fetchMethod:S,memoMethod:a,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:v}=t;if(e!==0&&!A(e))throw new TypeError("max option must be a nonnegative integer");let y=e?k(e):Array;if(!y)throw new Error("invalid max value: "+e);if(this.#g=e,this.#f=c,this.maxEntrySize=F||this.#f,this.sizeCalculation=d,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(a!==void 0&&typeof a!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=a,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=S,this.#O=!!S,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new y(e),this.#c=new y(e),this.#o=0,this.#h=0,this.#_=R.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof m=="function"?(this.#w=m,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#y=!!this.#p,this.#a=!!this.#w,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!v,this.maxEntrySize!==0){if(this.#f!==0&&!A(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!A(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!r,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!o,this.ttlResolution=A(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!A(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#g===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#g&&!this.#f){let C="LRU_CACHE_UNBOUNDED";V(C)&&(P.add(C),H("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,D))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#M(){let t=new O(this.#g),e=new O(this.#g);this.#u=t,this.#b=e,this.#U=(n,h,o=T.now())=>{if(e[n]=h!==0?o:0,t[n]=h,h!==0&&this.ttlAutopurge){let r=setTimeout(()=>{this.#d(n)&&this.#T(this.#i[n],"expire")},h+1);r.unref&&r.unref()}},this.#z=n=>{e[n]=t[n]!==0?T.now():0},this.#E=(n,h)=>{if(t[h]){let o=t[h],r=e[h];if(!o||!r)return;n.ttl=o,n.start=r,n.now=i||s();let g=n.now-r;n.remainingTTL=o-g}};let i=0,s=()=>{let n=T.now();if(this.ttlResolution>0){i=n;let h=setTimeout(()=>i=0,this.ttlResolution);h.unref&&h.unref()}return n};this.getRemainingTTL=n=>{let h=this.#s.get(n);if(h===void 0)return 0;let o=t[h],r=e[h];if(!o||!r)return 1/0;let g=(i||s())-r;return o-g},this.#d=n=>{let h=e[n],o=t[n];return!!o&&!!h&&(i||s())-h>o}}#z=()=>{};#E=()=>{};#U=()=>{};#d=()=>!1;#P(){let t=new O(this.#g);this.#S=0,this.#m=t,this.#v=e=>{this.#S-=t[e],t[e]=0},this.#G=(e,i,s,n)=>{if(this.#e(i))return 0;if(!A(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!A(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#D=(e,i,s)=>{if(t[e]=i,this.#f){let n=this.#f-t[e];for(;this.#S>n;)this.#L(!0)}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S)}}#v=t=>{};#D=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;!(!this.#I(e)||((t||!this.#d(e))&&(yield e),e===this.#o));)e=this.#c[e]}*#F({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#I(e)||((t||!this.#d(e))&&(yield e),e===this.#h));)e=this.#l[e]}#I(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#F())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#F()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#F())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#F()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#F({allowStale:!0}))this.#d(e)&&(this.#T(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#u&&this.#b){let h=this.#u[e],o=this.#b[e];if(h&&o){let r=h-(T.now()-o);n.ttl=r,n.start=Date.now()}}return this.#m&&(n.size=this.#m[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let h={value:n};if(this.#u&&this.#b){h.ttl=this.#u[e];let o=T.now()-this.#b[e];h.start=Math.floor(Date.now()-o)}this.#m&&(h.size=this.#m[e]),t.unshift([i,h])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=T.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:r}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,m=this.#G(t,e,i.size||0,o);if(this.maxEntrySize&&m>this.maxEntrySize)return r&&(r.set="miss",r.maxEntrySizeExceeded=!0),this.#T(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#g?this.#L(!1):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#h]=f,this.#c[f]=this.#h,this.#h=f,this.#n++,this.#D(f,m,r),r&&(r.set="add"),g=!1;else{this.#C(f);let u=this.#t[f];if(e!==u){if(this.#O&&this.#e(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:c}=u;c!==void 0&&!h&&(this.#y&&this.#p?.(c,t,"set"),this.#a&&this.#r?.push([c,t,"set"]))}else h||(this.#y&&this.#p?.(u,t,"set"),this.#a&&this.#r?.push([u,t,"set"]));if(this.#v(f),this.#D(f,m,r),this.#t[f]=e,r){r.set="replace";let c=u&&this.#e(u)?u.__staleWhileFetching:u;c!==void 0&&(r.oldValue=c)}}else r&&(r.set="update")}if(s!==0&&!this.#u&&this.#M(),this.#u&&(g||this.#U(f,s,n),r&&this.#E(r,f)),!h&&this.#a&&this.#r){let u=this.#r,c;for(;c=u?.shift();)this.#w?.(...c)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#L(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#a&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#w?.(...e)}}}#L(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#O&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(s,i,"evict"),this.#a&&this.#r?.push([s,i,"evict"])),this.#v(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#o=this.#h=0,this.#_.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let h=this.#t[n];if(this.#e(h)&&h.__staleWhileFetching===void 0)return!1;if(this.#d(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#z(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#d(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#x(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let h=new W,{signal:o}=i;o?.addEventListener("abort",()=>h.abort(o.reason),{signal:h.signal});let r={signal:h.signal,options:i,context:s},g=(d,S=!1)=>{let{aborted:a}=h.signal,w=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(a&&!S?(i.status.fetchAborted=!0,i.status.fetchError=h.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),a&&!w&&!S)return f(h.signal.reason);let b=c;return this.#t[e]===c&&(d===void 0?b.__staleWhileFetching?this.#t[e]=b.__staleWhileFetching:this.#T(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,d,r.options))),d},m=d=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=d),f(d)),f=d=>{let{aborted:S}=h.signal,a=S&&i.allowStaleOnFetchAbort,w=a||i.allowStaleOnFetchRejection,b=w||i.noDeleteOnFetchRejection,p=c;if(this.#t[e]===c&&(!b||p.__staleWhileFetching===void 0?this.#T(t,"fetch"):a||(this.#t[e]=p.__staleWhileFetching)),w)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw d},u=(d,S)=>{let a=this.#R?.(t,n,r);a&&a instanceof Promise&&a.then(w=>d(w===void 0?void 0:w),S),h.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=w=>g(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(u).then(g,m),F=Object.assign(c,{__abortController:h,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,F,{...r.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=F,F}#e(t){if(!this.#O)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof W}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:r=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:m=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:F=this.allowStaleOnFetchAbort,context:d,forceRefresh:S=!1,status:a,signal:w}=e;if(!this.#O)return a&&(a.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:a});let b={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:h,noDisposeOnSet:o,size:r,sizeCalculation:g,noUpdateTTL:m,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:F,ignoreFetchAbort:c,status:a,signal:w},p=this.#s.get(t);if(p===void 0){a&&(a.fetch="miss");let _=this.#x(t,p,b,d);return _.__returned=_}else{let _=this.#t[p];if(this.#e(_)){let U=i&&_.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",U&&(a.returnedStale=!0)),U?_.__staleWhileFetching:_.__returned=_}let v=this.#d(p);if(!S&&!v)return a&&(a.fetch="hit"),this.#C(p),s&&this.#z(p),a&&this.#E(a,p),_;let y=this.#x(t,p,b,d),L=y.__staleWhileFetching!==void 0&&i;return a&&(a.fetch=v?"stale":"refresh",L&&v&&(a.returnedStale=!0)),L?y.__staleWhileFetching:y.__returned=y}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...h}=e,o=this.get(t,h);if(!n&&o!==void 0)return o;let r=i(t,o,{options:h,context:s});return this.set(t,r,h),r}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:h}=e,o=this.#s.get(t);if(o!==void 0){let r=this.#t[o],g=this.#e(r);return h&&this.#E(h,o),this.#d(o)?(h&&(h.get="stale"),g?(h&&i&&r.__staleWhileFetching!==void 0&&(h.returnedStale=!0),i?r.__staleWhileFetching:void 0):(n||this.#T(t,"expire"),h&&i&&(h.returnedStale=!0),i?r:void 0)):(h&&(h.get="hit"),g?r.__staleWhileFetching:(this.#C(o),s&&this.#z(o),r))}else h&&(h.get="miss")}#j(t,e){this.#c[e]=t,this.#l[t]=e}#C(t){t!==this.#h&&(t===this.#o?this.#o=this.#l[t]:this.#j(this.#c[t],this.#l[t]),this.#j(this.#h,t),this.#h=t)}delete(t){return this.#T(t,"delete")}#T(t,e){let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=!0,this.#n===1)this.#N(e);else{this.#v(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#y||this.#a)&&(this.#y&&this.#p?.(n,t,e),this.#a&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#c[s];else if(s===this.#o)this.#o=this.#l[s];else{let h=this.#c[s];this.#l[h]=this.#l[s];let o=this.#l[s];this.#c[o]=this.#c[s]}this.#n--,this.#_.push(s)}}if(this.#a&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#N("delete")}#N(t){for(let e of this.#F({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#y&&this.#p?.(i,s,t),this.#a&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#u&&this.#b&&(this.#u.fill(0),this.#b.fill(0)),this.#m&&this.#m.fill(0),this.#o=0,this.#h=0,this.#_.length=0,this.#S=0,this.#n=0,this.#a&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#w?.(...i)}}};export{D as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map new file mode 100644 index 0000000..117a9de --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/index.ts"], + "sourcesContent": ["/**\n * @module LRUCache\n */\n\n// module-private names and types\ntype Perf = { now: () => number }\nconst perf: Perf =\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ? performance\n : Date\n\nconst warned = new Set()\n\n// either a function or a class\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ? process : {}\n) as { [k: string]: any }\n/* c8 ignore start */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC\n) => {\n typeof PROCESS.emitWarning === 'function'\n ? PROCESS.emitWarning(msg, type, code, fn)\n : console.error(`[${code}] ${type}: ${msg}`)\n}\n\nlet AC = globalThis.AbortController\nlet AS = globalThis.AbortSignal\n\n/* c8 ignore start */\nif (typeof AC === 'undefined') {\n //@ts-ignore\n AS = class AbortSignal {\n onabort?: (...a: any[]) => any\n _onabort: ((...a: any[]) => any)[] = []\n reason?: any\n aborted: boolean = false\n addEventListener(_: string, fn: (...a: any[]) => any) {\n this._onabort.push(fn)\n }\n }\n //@ts-ignore\n AC = class AbortController {\n constructor() {\n warnACPolyfill()\n }\n signal = new AS()\n abort(reason: any) {\n if (this.signal.aborted) return\n //@ts-ignore\n this.signal.reason = reason\n //@ts-ignore\n this.signal.aborted = true\n //@ts-ignore\n for (const fn of this.signal._onabort) {\n fn(reason)\n }\n this.signal.onabort?.(reason)\n }\n }\n let printACPolyfillWarning =\n PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1'\n const warnACPolyfill = () => {\n if (!printACPolyfillWarning) return\n printACPolyfillWarning = false\n emitWarning(\n 'AbortController is not defined. If using lru-cache in ' +\n 'node 14, load an AbortController polyfill from the ' +\n '`node-abort-controller` package. A minimal polyfill is ' +\n 'provided for use by LRUCache.fetch(), but it should not be ' +\n 'relied upon in other contexts (eg, passing it to other APIs that ' +\n 'use AbortController/AbortSignal might have undesirable effects). ' +\n 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.',\n 'NO_ABORT_CONTROLLER',\n 'ENOTSUP',\n warnACPolyfill\n )\n }\n}\n/* c8 ignore stop */\n\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: any): n is PosInt =>\n n && n === Math.floor(n) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n/* c8 ignore start */\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\nconst getUintArray = (max: number) =>\n !isPosInt(max)\n ? null\n : max <= Math.pow(2, 8)\n ? Uint8Array\n : max <= Math.pow(2, 16)\n ? Uint16Array\n : max <= Math.pow(2, 32)\n ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER\n ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n heap: NumberArray\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(\n max: number,\n HeapCls: { new (n: number): NumberArray }\n ) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n */\n export interface Status {\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss'\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The old value, specified in the case of `set:'update'` or\n * `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions\n extends FetcherFetchOptions {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext\n extends FetchOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext\n extends FetchOptions {\n context?: undefined\n }\n\n export interface MemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext\n extends MemoOptions {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext\n extends MemoOptions {\n context?: undefined\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoerOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions\n extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions\n extends Pick, 'updateAgeOnHas'> {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions\n extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions\n extends Pick, 'allowStale'> {}\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions\n extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n }\n\n export interface OptionsMaxLimit\n extends OptionsBase {\n max: Count\n }\n export interface OptionsTTLLimit\n extends OptionsBase {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit\n extends OptionsBase {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache\n implements Map\n{\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: any) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context\n ),\n moveToTail: (index: number): void =>\n c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) =>\n c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) =>\n c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(\n options: LRUCache.Options | LRUCache\n ) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n } = options\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize'\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (\n memoMethod !== undefined &&\n typeof memoMethod !== 'function'\n ) {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (\n fetchMethod !== undefined &&\n typeof fetchMethod !== 'function'\n ) {\n throw new TypeError(\n 'fetchMethod must be a function if specified'\n )\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = new Array(max).fill(undefined)\n this.#valList = new Array(max).fill(undefined)\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified'\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified'\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0\n ? ttlResolution\n : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError(\n 'ttl must be a positive integer if specified'\n )\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required'\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n\n this.#setItemTTL = (index, ttl, start = perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n if (ttl !== 0 && this.ttlAutopurge) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? perf.now() : 0\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore next */\n if (!ttl || !start) return\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(\n () => (cachedNow = 0),\n this.ttlResolution\n )\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n return 0\n }\n if (!isPosInt(size)) {\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)'\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.'\n )\n }\n }\n return size\n }\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - (sizes[index] as number)\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index] as number\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status\n ) => void = (_i, _s, _st) => {}\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache'\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; true; ) {\n if (!this.#isValidIndex(i)) {\n break\n }\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (\n k !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (\n v !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {}\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => any,\n thisp: any = this\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined) return undefined\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRLUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined = this.#isBackgroundFetch(v)\n ? v.__staleWhileFetching\n : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = perf.now() - age\n }\n this.set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions = {}\n ) {\n if (v === undefined) {\n this.delete(k)\n return this\n }\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0\n ? this.#tail\n : this.#free.length !== 0\n ? this.#free.pop()\n : this.#size === this.#max\n ? this.#evict(false)\n : this.#size\n ) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n } else {\n // update\n this.#moveToTail(index)\n const oldVal = this.#valList[index] as V | BackgroundFetch\n if (v !== oldVal) {\n if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {\n oldVal.__abortController.abort(new Error('replaced'))\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && !noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(s as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s as V, k, 'set'])\n }\n }\n } else if (!noDisposeOnSet) {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal as V, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal as V, k, 'set'])\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (status) {\n status.set = 'replace'\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal)\n ? oldVal.__staleWhileFetching\n : oldVal\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n } else if (status) {\n status.set = 'update'\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head] as K\n const v = this.#valList[head] as V\n if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('evicted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } =\n hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (\n index === undefined ||\n (!allowStale && this.#isStale(index))\n ) {\n return\n }\n const v = this.#valList[index]\n // either stale and allowed, or forcing a refresh of non-stale value\n return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: any\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AC()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (\n v: V | undefined,\n updateCache = false\n ): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n if (v === undefined) {\n if (bf.__staleWhileFetching) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.set(k, v, fetchOpts.options)\n }\n }\n return v\n }\n\n const eb = (er: any) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er\n }\n return fetchFail(er)\n }\n\n const fetchFail = (er: any): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted =\n aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del = !noDelete || bf.__staleWhileFetching === undefined\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: any) => void\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n }\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (\n !options.ignoreFetchAbort ||\n options.allowStaleOnFetchAbort\n ) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: any): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AC\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n\n async fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale =\n allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n fetchOptions?: unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : never\n ): Promise\n async forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {}\n ): Promise {\n const v = await this.fetch(\n k,\n fetchOptions as unknown extends FC\n ? LRUCache.FetchOptions\n : FC extends undefined | void\n ? LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext\n )\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC\n ? K\n : FC extends undefined | void\n ? K\n : never,\n memoOptions?: unknown extends FC\n ? LRUCache.MemoOptions\n : FC extends undefined | void\n ? LRUCache.MemoOptionsNoContext\n : never\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, forceRefresh, ...options } = memoOptions\n const v = this.get(k, options)\n if (!forceRefresh && v !== undefined) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n this.set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n if (status) status.get = 'stale'\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status && allowStale) status.returnedStale = true\n return allowStale ? value : undefined\n } else {\n if (\n status &&\n allowStale &&\n value.__staleWhileFetching !== undefined\n ) {\n status.returnedStale = true\n }\n return allowStale ? value.__staleWhileFetching : undefined\n }\n } else {\n if (status) status.get = 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n if (fetching) {\n return value.__staleWhileFetching\n }\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return value\n }\n } else if (status) {\n status.get = 'miss'\n }\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "mVAMA,IAAMA,EACJ,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WACvB,YACA,KAEAC,EAAS,IAAI,IAMbC,EACJ,OAAO,SAAY,UAAc,QAAU,QAAU,CAAA,EAIjDC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACF,OAAOL,EAAQ,aAAgB,WAC3BA,EAAQ,YAAYE,EAA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KAAS,KAAKM,GAAU,CAAE,WAAY,EAAI,CAAE,EAAG,CACxD,IAAMyC,EAAI,KAAKhE,GAASiB,CAAK,EAC7B,GAAI,KAAKF,GAAmBiD,CAAC,EAC3BA,EAAE,kBAAkB,MAAM,IAAI,MAAM,SAAS,CAAC,MACzC,CACL,IAAMhD,EAAI,KAAKjB,GAASkB,CAAK,EACzB,KAAKP,IACP,KAAKlB,KAAWwE,EAAQhD,EAAQ7C,CAAM,EAEpC,KAAKyC,IACP,KAAKN,IAAW,KAAK,CAAC0D,EAAQhD,EAAQ7C,CAAM,CAAC,GAoBnD,GAfA,KAAK2B,GAAQ,MAAK,EAClB,KAAKE,GAAS,KAAK,MAAS,EAC5B,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,KACrB,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,GAEjB,KAAKD,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKgB,IAAoB,KAAKN,GAAW,CAC3C,IAAM8E,EAAK,KAAK9E,GACZ+E,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAK3F,KAAgB,GAAG4F,CAAI,EAGlC", + "names": ["perf", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "AC", "AS", "_", "warnACPolyfill", "reason", "printACPolyfillWarning", "shouldWarn", "TYPE", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "_constructing", "_Stack", "HeapCls", "__privateSet", "s", "__privateGet", "Stack", "__privateAdd", "LRUCache", "#max", "#maxSize", "#dispose", "#disposeAfter", "#fetchMethod", "#memoMethod", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "key", "ttls", "starts", "#setItemTTL", "start", "t", "#delete", "#updateItemAge", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "getOptions", "value", "thisp", "deleted", "entry", "remain", "arr", "setOptions", "oldVal", "oldValue", "dt", "task", "val", "free", "head", "hasOptions", "peekOptions", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "fetchFail", "bf", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "forceRefresh", "stale", "isStale", "staleVal", "memoOptions", "vv", "fetching", "#connect", "#clear", "pi", "ni"] +} diff --git a/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/path-scurry/node_modules/lru-cache/package.json b/node_modules/path-scurry/node_modules/lru-cache/package.json new file mode 100644 index 0000000..f3cd4c0 --- /dev/null +++ b/node_modules/path-scurry/node_modules/lru-cache/package.json @@ -0,0 +1,116 @@ +{ + "name": "lru-cache", + "publishConfig": { + "tag": "legacy-v10" + }, + "description": "A cache object that deletes the least-recently-used items.", + "version": "10.4.3", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "sideEffects": false, + "scripts": { + "build": "npm run prepare", + "prepare": "tshy && bash fixup.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write .", + "typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts", + "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", + "prebenchmark": "npm run prepare", + "benchmark": "make -C benchmark", + "preprofile": "npm run prepare", + "profile": "make -C benchmark profile" + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "tshy": { + "exports": { + ".": "./src/index.ts", + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + } + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "@types/node": "^20.2.5", + "@types/tap": "^15.0.6", + "benchmark": "^2.1.4", + "esbuild": "^0.17.11", + "eslint-config-prettier": "^8.5.0", + "marked": "^4.2.12", + "mkdirp": "^2.1.5", + "prettier": "^2.6.2", + "tap": "^20.0.3", + "tshy": "^2.0.0", + "tslib": "^2.4.0", + "typedoc": "^0.25.3", + "typescript": "^5.2.2" + }, + "license": "ISC", + "files": [ + "dist" + ], + "prettier": { + "semi": false, + "printWidth": 70, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "node-arg": [ + "--expose-gc" + ], + "plugin": [ + "@tapjs/clock" + ] + }, + "exports": { + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./min": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "type": "module", + "module": "./dist/esm/index.js" +} diff --git a/node_modules/path-scurry/package.json b/node_modules/path-scurry/package.json new file mode 100644 index 0000000..e176615 --- /dev/null +++ b/node_modules/path-scurry/package.json @@ -0,0 +1,89 @@ +{ + "name": "path-scurry", + "version": "1.11.1", + "description": "walk paths fast and efficiently", + "author": "Isaac Z. Schlueter (https://blog.izs.me)", + "main": "./dist/commonjs/index.js", + "type": "module", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist" + ], + "license": "BlueOak-1.0.0", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts", + "bench": "bash ./scripts/bench.sh" + }, + "prettier": { + "experimentalTernaries": true, + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "devDependencies": { + "@nodelib/fs.walk": "^1.2.8", + "@types/node": "^20.12.11", + "c8": "^7.12.0", + "eslint-config-prettier": "^8.6.0", + "mkdirp": "^3.0.0", + "prettier": "^3.2.5", + "rimraf": "^5.0.1", + "tap": "^18.7.2", + "ts-node": "^10.9.2", + "tshy": "^1.14.0", + "typedoc": "^0.25.12", + "typescript": "^5.4.3" + }, + "tap": { + "typecheck": true + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/path-scurry" + }, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "tshy": { + "selfLink": false, + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "types": "./dist/commonjs/index.d.ts" +} diff --git a/node_modules/path-to-regexp/LICENSE b/node_modules/path-to-regexp/LICENSE new file mode 100644 index 0000000..983fbe8 --- /dev/null +++ b/node_modules/path-to-regexp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-to-regexp/Readme.md b/node_modules/path-to-regexp/Readme.md new file mode 100644 index 0000000..f5df40a --- /dev/null +++ b/node_modules/path-to-regexp/Readme.md @@ -0,0 +1,224 @@ +# Path-to-RegExp + +> Turn a path string such as `/user/:name` into a regular expression. + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Build status][build-image]][build-url] +[![Build coverage][coverage-image]][coverage-url] +[![License][license-image]][license-url] + +## Installation + +``` +npm install path-to-regexp --save +``` + +## Usage + +```js +const { + match, + pathToRegexp, + compile, + parse, + stringify, +} = require("path-to-regexp"); +``` + +### Parameters + +Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (`:foo`). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (`:"param-name"`). + +```js +const fn = match("/:foo/:bar"); + +fn("/test/route"); +//=> { path: '/test/route', params: { foo: 'test', bar: 'route' } } +``` + +### Wildcard + +Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (`*foo`). + +```js +const fn = match("/*splat"); + +fn("/bar/baz"); +//=> { path: '/bar/baz', params: { splat: [ 'bar', 'baz' ] } } +``` + +### Optional + +Braces can be used to define parts of the path that are optional. + +```js +const fn = match("/users{/:id}/delete"); + +fn("/users/delete"); +//=> { path: '/users/delete', params: {} } + +fn("/users/123/delete"); +//=> { path: '/users/123/delete', params: { id: '123' } } +``` + +## Match + +The `match` function returns a function for matching strings against a path: + +- **path** String, `TokenData` object, or array of strings and `TokenData` objects. +- **options** _(optional)_ (Extends [pathToRegexp](#pathToRegexp) options) + - **decode** Function for decoding strings to params, or `false` to disable all processing. (default: `decodeURIComponent`) + +```js +const fn = match("/foo/:bar"); +``` + +**Please note:** `path-to-regexp` is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc). + +## PathToRegexp + +The `pathToRegexp` function returns the `regexp` for matching strings against paths, and an array of `keys` for understanding the `RegExp#exec` matches. + +- **path** String, `TokenData` object, or array of strings and `TokenData` objects. +- **options** _(optional)_ (See [parse](#parse) for more options) + - **sensitive** Regexp will be case sensitive. (default: `false`) + - **end** Validate the match reaches the end of the string. (default: `true`) + - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) + - **trailing** Allows optional trailing delimiter to match. (default: `true`) + +```js +const { regexp, keys } = pathToRegexp("/foo/:bar"); + +regexp.exec("/foo/123"); //=> ["/foo/123", "123"] +``` + +## Compile ("Reverse" Path-To-RegExp) + +The `compile` function will return a function for transforming parameters into a valid path: + +- **path** A string or `TokenData` object. +- **options** (See [parse](#parse) for more options) + - **delimiter** The default delimiter for segments, e.g. `[^/]` for `:named` parameters. (default: `'/'`) + - **encode** Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) + +```js +const toPath = compile("/user/:id"); + +toPath({ id: "name" }); //=> "/user/name" +toPath({ id: "café" }); //=> "/user/caf%C3%A9" + +const toPathRepeated = compile("/*segment"); + +toPathRepeated({ segment: ["foo"] }); //=> "/foo" +toPathRepeated({ segment: ["a", "b", "c"] }); //=> "/a/b/c" + +// When disabling `encode`, you need to make sure inputs are encoded correctly. No arrays are accepted. +const toPathRaw = compile("/user/:id", { encode: false }); + +toPathRaw({ id: "%3A%2F" }); //=> "/user/%3A%2F" +``` + +## Stringify + +Transform a `TokenData` object to a Path-to-RegExp string. + +- **data** A `TokenData` object. + +```js +const data = { + tokens: [ + { type: "text", value: "/" }, + { type: "param", name: "foo" }, + ], +}; + +const path = stringify(data); //=> "/:foo" +``` + +## Developers + +- If you are rewriting paths with match and compile, consider using `encode: false` and `decode: false` to keep raw paths passed around. +- To ensure matches work on paths containing characters usually encoded, such as emoji, consider using [encodeurl](https://github.com/pillarjs/encodeurl) for `encodePath`. + +### Parse + +The `parse` function accepts a string and returns `TokenData`, which can be used with `match` and `compile`. + +- **path** A string. +- **options** _(optional)_ + - **encodePath** A function for encoding input strings. (default: `x => x`, recommended: [`encodeurl`](https://github.com/pillarjs/encodeurl)) + +### Tokens + +`TokenData` has two properties: + +- **tokens** A sequence of tokens, currently of types `text`, `parameter`, `wildcard`, or `group`. +- **originalPath** The original path used with `parse`, shown in error messages to assist debugging. + +### Custom path + +In some applications you may not be able to use the `path-to-regexp` syntax, but you still want to use this library for `match` and `compile`. For example: + +```js +import { match } from "path-to-regexp"; + +const tokens = [ + { type: "text", value: "/" }, + { type: "parameter", name: "foo" }, +]; +const originalPath = "/[foo]"; // To help debug error messages. +const path = { tokens, originalPath }; +const fn = match(path); + +fn("/test"); //=> { path: '/test', index: 0, params: { foo: 'test' } } +``` + +## Errors + +An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before. + +### Missing parameter name + +Parameter names must be provided after `:` or `*`, for example `/*path`. They can be valid JavaScript identifiers (e.g. `:myName`) or JSON strings (`:"my-name"`). + +### Unexpected `?` or `+` + +In past releases, `?`, `*`, and `+` were used to denote optional or repeating parameters. As an alternative, try these: + +- For optional (`?`), use braces: `/file{.:ext}`. +- For one or more (`+`), use a wildcard: `/*path`. +- For zero or more (`*`), use both: `/files{/*path}`. + +### Unexpected `(`, `)`, `[`, `]`, etc. + +Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. `"\\("`. + +### Unterminated quote + +Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, `:"foo`. + +### Express <= 4.x + +Path-To-RegExp breaks compatibility with Express <= `4.x` in the following ways: + +- The wildcard `*` must have a name and matches the behavior of parameters `:`. +- The optional character `?` is no longer supported, use braces instead: `/:file{.:ext}`. +- Regexp characters are not supported. +- Some characters have been reserved to avoid confusion during upgrade (`()[]?+!`). +- Parameter names now support valid JavaScript identifiers, or quoted like `:"this"`. + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/path-to-regexp +[npm-url]: https://npmjs.org/package/path-to-regexp +[downloads-image]: https://img.shields.io/npm/dm/path-to-regexp +[downloads-url]: https://npmjs.org/package/path-to-regexp +[build-image]: https://img.shields.io/github/actions/workflow/status/pillarjs/path-to-regexp/ci.yml?branch=master +[build-url]: https://github.com/pillarjs/path-to-regexp/actions/workflows/ci.yml?query=branch%3Amaster +[coverage-image]: https://img.shields.io/codecov/c/gh/pillarjs/path-to-regexp +[coverage-url]: https://codecov.io/gh/pillarjs/path-to-regexp +[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat +[license-url]: LICENSE.md diff --git a/node_modules/path-to-regexp/dist/index.d.ts b/node_modules/path-to-regexp/dist/index.d.ts new file mode 100644 index 0000000..b59dff0 --- /dev/null +++ b/node_modules/path-to-regexp/dist/index.d.ts @@ -0,0 +1,144 @@ +/** + * Encode a string into another string. + */ +export type Encode = (value: string) => string; +/** + * Decode a string into another string. + */ +export type Decode = (value: string) => string; +export interface ParseOptions { + /** + * A function for encoding input strings. + */ + encodePath?: Encode; +} +export interface PathToRegexpOptions { + /** + * Matches the path completely without trailing characters. (default: `true`) + */ + end?: boolean; + /** + * Allows optional trailing delimiter to match. (default: `true`) + */ + trailing?: boolean; + /** + * Match will be case sensitive. (default: `false`) + */ + sensitive?: boolean; + /** + * The default delimiter for segments. (default: `'/'`) + */ + delimiter?: string; +} +export interface MatchOptions extends PathToRegexpOptions { + /** + * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`) + */ + decode?: Decode | false; +} +export interface CompileOptions { + /** + * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`) + */ + encode?: Encode | false; + /** + * The default delimiter for segments. (default: `'/'`) + */ + delimiter?: string; +} +/** + * Plain text. + */ +export interface Text { + type: "text"; + value: string; +} +/** + * A parameter designed to match arbitrary text within a segment. + */ +export interface Parameter { + type: "param"; + name: string; +} +/** + * A wildcard parameter designed to match multiple segments. + */ +export interface Wildcard { + type: "wildcard"; + name: string; +} +/** + * A set of possible tokens to expand when matching. + */ +export interface Group { + type: "group"; + tokens: Token[]; +} +/** + * A token that corresponds with a regexp capture. + */ +export type Key = Parameter | Wildcard; +/** + * A sequence of `path-to-regexp` keys that match capturing groups. + */ +export type Keys = Array; +/** + * A sequence of path match characters. + */ +export type Token = Text | Parameter | Wildcard | Group; +/** + * Tokenized path instance. + */ +export declare class TokenData { + readonly tokens: Token[]; + readonly originalPath?: string | undefined; + constructor(tokens: Token[], originalPath?: string | undefined); +} +/** + * ParseError is thrown when there is an error processing the path. + */ +export declare class PathError extends TypeError { + readonly originalPath: string | undefined; + constructor(message: string, originalPath: string | undefined); +} +/** + * Parse a string for the raw tokens. + */ +export declare function parse(str: string, options?: ParseOptions): TokenData; +/** + * Compile a string to a template function for the path. + */ +export declare function compile

(path: Path, options?: CompileOptions & ParseOptions): (params?: P) => string; +export type ParamData = Partial>; +export type PathFunction

= (data?: P) => string; +/** + * A match result contains data about the path match. + */ +export interface MatchResult

{ + path: string; + params: P; +} +/** + * A match is either `false` (no match) or a match result. + */ +export type Match

= false | MatchResult

; +/** + * The match function takes a string and returns whether it matched the path. + */ +export type MatchFunction

= (path: string) => Match

; +/** + * Supported path types. + */ +export type Path = string | TokenData; +/** + * Transform a path into a match function. + */ +export declare function match

(path: Path | Path[], options?: MatchOptions & ParseOptions): MatchFunction

; +export declare function pathToRegexp(path: Path | Path[], options?: PathToRegexpOptions & ParseOptions): { + regexp: RegExp; + keys: Keys; +}; +/** + * Stringify token data into a path string. + */ +export declare function stringify(data: TokenData): string; diff --git a/node_modules/path-to-regexp/dist/index.js b/node_modules/path-to-regexp/dist/index.js new file mode 100644 index 0000000..9331ae0 --- /dev/null +++ b/node_modules/path-to-regexp/dist/index.js @@ -0,0 +1,409 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PathError = exports.TokenData = void 0; +exports.parse = parse; +exports.compile = compile; +exports.match = match; +exports.pathToRegexp = pathToRegexp; +exports.stringify = stringify; +const DEFAULT_DELIMITER = "/"; +const NOOP_VALUE = (value) => value; +const ID_START = /^[$_\p{ID_Start}]$/u; +const ID_CONTINUE = /^[$\u200c\u200d\p{ID_Continue}]$/u; +const SIMPLE_TOKENS = { + // Groups. + "{": "{", + "}": "}", + // Reserved. + "(": "(", + ")": ")", + "[": "[", + "]": "]", + "+": "+", + "?": "?", + "!": "!", +}; +/** + * Escape text for stringify to path. + */ +function escapeText(str) { + return str.replace(/[{}()\[\]+?!:*\\]/g, "\\$&"); +} +/** + * Escape a regular expression string. + */ +function escape(str) { + return str.replace(/[.+*?^${}()[\]|/\\]/g, "\\$&"); +} +/** + * Tokenized path instance. + */ +class TokenData { + constructor(tokens, originalPath) { + this.tokens = tokens; + this.originalPath = originalPath; + } +} +exports.TokenData = TokenData; +/** + * ParseError is thrown when there is an error processing the path. + */ +class PathError extends TypeError { + constructor(message, originalPath) { + let text = message; + if (originalPath) + text += `: ${originalPath}`; + text += `; visit https://git.new/pathToRegexpError for info`; + super(text); + this.originalPath = originalPath; + } +} +exports.PathError = PathError; +/** + * Parse a string for the raw tokens. + */ +function parse(str, options = {}) { + const { encodePath = NOOP_VALUE } = options; + const chars = [...str]; + const tokens = []; + let index = 0; + let pos = 0; + function name() { + let value = ""; + if (ID_START.test(chars[index])) { + do { + value += chars[index++]; + } while (ID_CONTINUE.test(chars[index])); + } + else if (chars[index] === '"') { + let quoteStart = index; + while (index++ < chars.length) { + if (chars[index] === '"') { + index++; + quoteStart = 0; + break; + } + // Increment over escape characters. + if (chars[index] === "\\") + index++; + value += chars[index]; + } + if (quoteStart) { + throw new PathError(`Unterminated quote at index ${quoteStart}`, str); + } + } + if (!value) { + throw new PathError(`Missing parameter name at index ${index}`, str); + } + return value; + } + while (index < chars.length) { + const value = chars[index]; + const type = SIMPLE_TOKENS[value]; + if (type) { + tokens.push({ type, index: index++, value }); + } + else if (value === "\\") { + tokens.push({ type: "escape", index: index++, value: chars[index++] }); + } + else if (value === ":") { + tokens.push({ type: "param", index: index++, value: name() }); + } + else if (value === "*") { + tokens.push({ type: "wildcard", index: index++, value: name() }); + } + else { + tokens.push({ type: "char", index: index++, value }); + } + } + tokens.push({ type: "end", index, value: "" }); + function consumeUntil(endType) { + const output = []; + while (true) { + const token = tokens[pos++]; + if (token.type === endType) + break; + if (token.type === "char" || token.type === "escape") { + let path = token.value; + let cur = tokens[pos]; + while (cur.type === "char" || cur.type === "escape") { + path += cur.value; + cur = tokens[++pos]; + } + output.push({ + type: "text", + value: encodePath(path), + }); + continue; + } + if (token.type === "param" || token.type === "wildcard") { + output.push({ + type: token.type, + name: token.value, + }); + continue; + } + if (token.type === "{") { + output.push({ + type: "group", + tokens: consumeUntil("}"), + }); + continue; + } + throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str); + } + return output; + } + return new TokenData(consumeUntil("end"), str); +} +/** + * Compile a string to a template function for the path. + */ +function compile(path, options = {}) { + const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; + const data = typeof path === "object" ? path : parse(path, options); + const fn = tokensToFunction(data.tokens, delimiter, encode); + return function path(params = {}) { + const [path, ...missing] = fn(params); + if (missing.length) { + throw new TypeError(`Missing parameters: ${missing.join(", ")}`); + } + return path; + }; +} +function tokensToFunction(tokens, delimiter, encode) { + const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode)); + return (data) => { + const result = [""]; + for (const encoder of encoders) { + const [value, ...extras] = encoder(data); + result[0] += value; + result.push(...extras); + } + return result; + }; +} +/** + * Convert a single token into a path building function. + */ +function tokenToFunction(token, delimiter, encode) { + if (token.type === "text") + return () => [token.value]; + if (token.type === "group") { + const fn = tokensToFunction(token.tokens, delimiter, encode); + return (data) => { + const [value, ...missing] = fn(data); + if (!missing.length) + return [value]; + return [""]; + }; + } + const encodeValue = encode || NOOP_VALUE; + if (token.type === "wildcard" && encode !== false) { + return (data) => { + const value = data[token.name]; + if (value == null) + return ["", token.name]; + if (!Array.isArray(value) || value.length === 0) { + throw new TypeError(`Expected "${token.name}" to be a non-empty array`); + } + return [ + value + .map((value, index) => { + if (typeof value !== "string") { + throw new TypeError(`Expected "${token.name}/${index}" to be a string`); + } + return encodeValue(value); + }) + .join(delimiter), + ]; + }; + } + return (data) => { + const value = data[token.name]; + if (value == null) + return ["", token.name]; + if (typeof value !== "string") { + throw new TypeError(`Expected "${token.name}" to be a string`); + } + return [encodeValue(value)]; + }; +} +/** + * Transform a path into a match function. + */ +function match(path, options = {}) { + const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options; + const { regexp, keys } = pathToRegexp(path, options); + const decoders = keys.map((key) => { + if (decode === false) + return NOOP_VALUE; + if (key.type === "param") + return decode; + return (value) => value.split(delimiter).map(decode); + }); + return function match(input) { + const m = regexp.exec(input); + if (!m) + return false; + const path = m[0]; + const params = Object.create(null); + for (let i = 1; i < m.length; i++) { + if (m[i] === undefined) + continue; + const key = keys[i - 1]; + const decoder = decoders[i - 1]; + params[key.name] = decoder(m[i]); + } + return { path, params }; + }; +} +function pathToRegexp(path, options = {}) { + const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options; + const keys = []; + const flags = sensitive ? "" : "i"; + const sources = []; + for (const input of pathsToArray(path, [])) { + const data = typeof input === "object" ? input : parse(input, options); + for (const tokens of flatten(data.tokens, 0, [])) { + sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath)); + } + } + let pattern = `^(?:${sources.join("|")})`; + if (trailing) + pattern += `(?:${escape(delimiter)}$)?`; + pattern += end ? "$" : `(?=${escape(delimiter)}|$)`; + const regexp = new RegExp(pattern, flags); + return { regexp, keys }; +} +/** + * Convert a path or array of paths into a flat array. + */ +function pathsToArray(paths, init) { + if (Array.isArray(paths)) { + for (const p of paths) + pathsToArray(p, init); + } + else { + init.push(paths); + } + return init; +} +/** + * Generate a flat list of sequence tokens from the given tokens. + */ +function* flatten(tokens, index, init) { + if (index === tokens.length) { + return yield init; + } + const token = tokens[index]; + if (token.type === "group") { + for (const seq of flatten(token.tokens, 0, init.slice())) { + yield* flatten(tokens, index + 1, seq); + } + } + else { + init.push(token); + } + yield* flatten(tokens, index + 1, init); +} +/** + * Transform a flat sequence of tokens into a regular expression. + */ +function toRegExpSource(tokens, delimiter, keys, originalPath) { + let result = ""; + let backtrack = ""; + let isSafeSegmentParam = true; + for (const token of tokens) { + if (token.type === "text") { + result += escape(token.value); + backtrack += token.value; + isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter)); + continue; + } + if (token.type === "param" || token.type === "wildcard") { + if (!isSafeSegmentParam && !backtrack) { + throw new PathError(`Missing text before "${token.name}" ${token.type}`, originalPath); + } + if (token.type === "param") { + result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`; + } + else { + result += `([\\s\\S]+)`; + } + keys.push(token); + backtrack = ""; + isSafeSegmentParam = false; + continue; + } + } + return result; +} +/** + * Block backtracking on previous text and ignore delimiter string. + */ +function negate(delimiter, backtrack) { + if (backtrack.length < 2) { + if (delimiter.length < 2) + return `[^${escape(delimiter + backtrack)}]`; + return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`; + } + if (delimiter.length < 2) { + return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`; + } + return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\s\\S])`; +} +/** + * Stringify an array of tokens into a path string. + */ +function stringifyTokens(tokens) { + let value = ""; + let i = 0; + function name(value) { + const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]); + return isSafe ? value : JSON.stringify(value); + } + while (i < tokens.length) { + const token = tokens[i++]; + if (token.type === "text") { + value += escapeText(token.value); + continue; + } + if (token.type === "group") { + value += `{${stringifyTokens(token.tokens)}}`; + continue; + } + if (token.type === "param") { + value += `:${name(token.name)}`; + continue; + } + if (token.type === "wildcard") { + value += `*${name(token.name)}`; + continue; + } + throw new TypeError(`Unknown token type: ${token.type}`); + } + return value; +} +/** + * Stringify token data into a path string. + */ +function stringify(data) { + return stringifyTokens(data.tokens); +} +/** + * Validate the parameter name contains valid ID characters. + */ +function isNameSafe(name) { + const [first, ...rest] = name; + return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char)); +} +/** + * Validate the next token does not interfere with the current param name. + */ +function isNextNameSafe(token) { + if (token && token.type === "text") + return !ID_CONTINUE.test(token.value[0]); + return true; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/path-to-regexp/dist/index.js.map b/node_modules/path-to-regexp/dist/index.js.map new file mode 100644 index 0000000..ec14c73 --- /dev/null +++ b/node_modules/path-to-regexp/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AA4LA,sBA8GC;AAKD,0BAgBC;AAgHD,sBA+BC;AAED,oCA2BC;AAmJD,8BAEC;AAhoBD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC;AAC5C,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAkFxD,MAAM,aAAa,GAA8B;IAC/C,UAAU;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,YAAY;IACZ,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;CACT,CAAC;AAEF;;GAEG;AACH,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC;AAiDD;;GAEG;AACH,MAAa,SAAS;IACpB,YACkB,MAAe,EACf,YAAqB;QADrB,WAAM,GAAN,MAAM,CAAS;QACf,iBAAY,GAAZ,YAAY,CAAS;IACpC,CAAC;CACL;AALD,8BAKC;AAED;;GAEG;AACH,MAAa,SAAU,SAAQ,SAAS;IACtC,YACE,OAAe,EACC,YAA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,IAAI,KAAK,UAAU,EAAE,CAAC;YAC9B,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,SAAS;QACX,CAAC;QAED,MAAM,IAAI,SAAS,CAAC,uBAAwB,KAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAe;IACvC,OAAO,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,KAAwB;IAC9C,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["const DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value: string) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\n\n/**\n * Encode a string into another string.\n */\nexport type Encode = (value: string) => string;\n\n/**\n * Decode a string into another string.\n */\nexport type Decode = (value: string) => string;\n\nexport interface ParseOptions {\n /**\n * A function for encoding input strings.\n */\n encodePath?: Encode;\n}\n\nexport interface PathToRegexpOptions {\n /**\n * Matches the path completely without trailing characters. (default: `true`)\n */\n end?: boolean;\n /**\n * Allows optional trailing delimiter to match. (default: `true`)\n */\n trailing?: boolean;\n /**\n * Match will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\nexport interface MatchOptions extends PathToRegexpOptions {\n /**\n * Function for decoding strings for params, or `false` to disable entirely. (default: `decodeURIComponent`)\n */\n decode?: Decode | false;\n}\n\nexport interface CompileOptions {\n /**\n * Function for encoding input strings for output into the path, or `false` to disable entirely. (default: `encodeURIComponent`)\n */\n encode?: Encode | false;\n /**\n * The default delimiter for segments. (default: `'/'`)\n */\n delimiter?: string;\n}\n\ntype TokenType =\n | \"{\"\n | \"}\"\n | \"wildcard\"\n | \"param\"\n | \"char\"\n | \"escape\"\n | \"end\"\n // Reserved for use or ambiguous due to past use.\n | \"(\"\n | \")\"\n | \"[\"\n | \"]\"\n | \"+\"\n | \"?\"\n | \"!\";\n\n/**\n * Tokenizer results.\n */\ninterface LexToken {\n type: TokenType;\n index: number;\n value: string;\n}\n\nconst SIMPLE_TOKENS: Record = {\n // Groups.\n \"{\": \"{\",\n \"}\": \"}\",\n // Reserved.\n \"(\": \"(\",\n \")\": \")\",\n \"[\": \"[\",\n \"]\": \"]\",\n \"+\": \"+\",\n \"?\": \"?\",\n \"!\": \"!\",\n};\n\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str: string) {\n return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escape(str: string) {\n return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Plain text.\n */\nexport interface Text {\n type: \"text\";\n value: string;\n}\n\n/**\n * A parameter designed to match arbitrary text within a segment.\n */\nexport interface Parameter {\n type: \"param\";\n name: string;\n}\n\n/**\n * A wildcard parameter designed to match multiple segments.\n */\nexport interface Wildcard {\n type: \"wildcard\";\n name: string;\n}\n\n/**\n * A set of possible tokens to expand when matching.\n */\nexport interface Group {\n type: \"group\";\n tokens: Token[];\n}\n\n/**\n * A token that corresponds with a regexp capture.\n */\nexport type Key = Parameter | Wildcard;\n\n/**\n * A sequence of `path-to-regexp` keys that match capturing groups.\n */\nexport type Keys = Array;\n\n/**\n * A sequence of path match characters.\n */\nexport type Token = Text | Parameter | Wildcard | Group;\n\n/**\n * Tokenized path instance.\n */\nexport class TokenData {\n constructor(\n public readonly tokens: Token[],\n public readonly originalPath?: string,\n ) {}\n}\n\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nexport class PathError extends TypeError {\n constructor(\n message: string,\n public readonly originalPath: string | undefined,\n ) {\n let text = message;\n if (originalPath) text += `: ${originalPath}`;\n text += `; visit https://git.new/pathToRegexpError for info`;\n super(text);\n }\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): TokenData {\n const { encodePath = NOOP_VALUE } = options;\n const chars = [...str];\n const tokens: Array = [];\n let index = 0;\n let pos = 0;\n\n function name() {\n let value = \"\";\n\n if (ID_START.test(chars[index])) {\n do {\n value += chars[index++];\n } while (ID_CONTINUE.test(chars[index]));\n } else if (chars[index] === '\"') {\n let quoteStart = index;\n\n while (index++ < chars.length) {\n if (chars[index] === '\"') {\n index++;\n quoteStart = 0;\n break;\n }\n\n // Increment over escape characters.\n if (chars[index] === \"\\\\\") index++;\n\n value += chars[index];\n }\n\n if (quoteStart) {\n throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n }\n }\n\n if (!value) {\n throw new PathError(`Missing parameter name at index ${index}`, str);\n }\n\n return value;\n }\n\n while (index < chars.length) {\n const value = chars[index];\n const type = SIMPLE_TOKENS[value];\n\n if (type) {\n tokens.push({ type, index: index++, value });\n } else if (value === \"\\\\\") {\n tokens.push({ type: \"escape\", index: index++, value: chars[index++] });\n } else if (value === \":\") {\n tokens.push({ type: \"param\", index: index++, value: name() });\n } else if (value === \"*\") {\n tokens.push({ type: \"wildcard\", index: index++, value: name() });\n } else {\n tokens.push({ type: \"char\", index: index++, value });\n }\n }\n\n tokens.push({ type: \"end\", index, value: \"\" });\n\n function consumeUntil(endType: TokenType): Token[] {\n const output: Token[] = [];\n\n while (true) {\n const token = tokens[pos++];\n if (token.type === endType) break;\n\n if (token.type === \"char\" || token.type === \"escape\") {\n let path = token.value;\n let cur = tokens[pos];\n\n while (cur.type === \"char\" || cur.type === \"escape\") {\n path += cur.value;\n cur = tokens[++pos];\n }\n\n output.push({\n type: \"text\",\n value: encodePath(path),\n });\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n output.push({\n type: token.type,\n name: token.value,\n });\n continue;\n }\n\n if (token.type === \"{\") {\n output.push({\n type: \"group\",\n tokens: consumeUntil(\"}\"),\n });\n continue;\n }\n\n throw new PathError(\n `Unexpected ${token.type} at index ${token.index}, expected ${endType}`,\n str,\n );\n }\n\n return output;\n }\n\n return new TokenData(consumeUntil(\"end\"), str);\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile

(\n path: Path,\n options: CompileOptions & ParseOptions = {},\n) {\n const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const data = typeof path === \"object\" ? path : parse(path, options);\n const fn = tokensToFunction(data.tokens, delimiter, encode);\n\n return function path(params: P = {} as P) {\n const [path, ...missing] = fn(params);\n if (missing.length) {\n throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n }\n return path;\n };\n}\n\nexport type ParamData = Partial>;\nexport type PathFunction

= (data?: P) => string;\n\nfunction tokensToFunction(\n tokens: Token[],\n delimiter: string,\n encode: Encode | false,\n) {\n const encoders = tokens.map((token) =>\n tokenToFunction(token, delimiter, encode),\n );\n\n return (data: ParamData) => {\n const result: string[] = [\"\"];\n\n for (const encoder of encoders) {\n const [value, ...extras] = encoder(data);\n result[0] += value;\n result.push(...extras);\n }\n\n return result;\n };\n}\n\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(\n token: Token,\n delimiter: string,\n encode: Encode | false,\n): (data: ParamData) => string[] {\n if (token.type === \"text\") return () => [token.value];\n\n if (token.type === \"group\") {\n const fn = tokensToFunction(token.tokens, delimiter, encode);\n\n return (data) => {\n const [value, ...missing] = fn(data);\n if (!missing.length) return [value];\n return [\"\"];\n };\n }\n\n const encodeValue = encode || NOOP_VALUE;\n\n if (token.type === \"wildcard\" && encode !== false) {\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (!Array.isArray(value) || value.length === 0) {\n throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n }\n\n return [\n value\n .map((value, index) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `Expected \"${token.name}/${index}\" to be a string`,\n );\n }\n\n return encodeValue(value);\n })\n .join(delimiter),\n ];\n };\n }\n\n return (data) => {\n const value = data[token.name];\n if (value == null) return [\"\", token.name];\n\n if (typeof value !== \"string\") {\n throw new TypeError(`Expected \"${token.name}\" to be a string`);\n }\n\n return [encodeValue(value)];\n };\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult

{\n path: string;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match

= false | MatchResult

;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction

= (path: string) => Match

;\n\n/**\n * Supported path types.\n */\nexport type Path = string | TokenData;\n\n/**\n * Transform a path into a match function.\n */\nexport function match

(\n path: Path | Path[],\n options: MatchOptions & ParseOptions = {},\n): MatchFunction

{\n const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } =\n options;\n const { regexp, keys } = pathToRegexp(path, options);\n\n const decoders = keys.map((key) => {\n if (decode === false) return NOOP_VALUE;\n if (key.type === \"param\") return decode;\n return (value: string) => value.split(delimiter).map(decode);\n });\n\n return function match(input: string) {\n const m = regexp.exec(input);\n if (!m) return false;\n\n const path = m[0];\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n const decoder = decoders[i - 1];\n params[key.name] = decoder(m[i]);\n }\n\n return { path, params };\n };\n}\n\nexport function pathToRegexp(\n path: Path | Path[],\n options: PathToRegexpOptions & ParseOptions = {},\n) {\n const {\n delimiter = DEFAULT_DELIMITER,\n end = true,\n sensitive = false,\n trailing = true,\n } = options;\n const keys: Keys = [];\n const flags = sensitive ? \"\" : \"i\";\n const sources: string[] = [];\n\n for (const input of pathsToArray(path, [])) {\n const data = typeof input === \"object\" ? input : parse(input, options);\n for (const tokens of flatten(data.tokens, 0, [])) {\n sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n }\n }\n\n let pattern = `^(?:${sources.join(\"|\")})`;\n if (trailing) pattern += `(?:${escape(delimiter)}$)?`;\n pattern += end ? \"$\" : `(?=${escape(delimiter)}|$)`;\n\n const regexp = new RegExp(pattern, flags);\n return { regexp, keys };\n}\n\n/**\n * Convert a path or array of paths into a flat array.\n */\nfunction pathsToArray(paths: Path | Path[], init: Path[]): Path[] {\n if (Array.isArray(paths)) {\n for (const p of paths) pathsToArray(p, init);\n } else {\n init.push(paths);\n }\n return init;\n}\n\n/**\n * Flattened token set.\n */\ntype FlatToken = Text | Parameter | Wildcard;\n\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction* flatten(\n tokens: Token[],\n index: number,\n init: FlatToken[],\n): Generator {\n if (index === tokens.length) {\n return yield init;\n }\n\n const token = tokens[index];\n\n if (token.type === \"group\") {\n for (const seq of flatten(token.tokens, 0, init.slice())) {\n yield* flatten(tokens, index + 1, seq);\n }\n } else {\n init.push(token);\n }\n\n yield* flatten(tokens, index + 1, init);\n}\n\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(\n tokens: FlatToken[],\n delimiter: string,\n keys: Keys,\n originalPath: string | undefined,\n): string {\n let result = \"\";\n let backtrack = \"\";\n let isSafeSegmentParam = true;\n\n for (const token of tokens) {\n if (token.type === \"text\") {\n result += escape(token.value);\n backtrack += token.value;\n isSafeSegmentParam ||= token.value.includes(delimiter);\n continue;\n }\n\n if (token.type === \"param\" || token.type === \"wildcard\") {\n if (!isSafeSegmentParam && !backtrack) {\n throw new PathError(\n `Missing text before \"${token.name}\" ${token.type}`,\n originalPath,\n );\n }\n\n if (token.type === \"param\") {\n result += `(${negate(delimiter, isSafeSegmentParam ? \"\" : backtrack)}+)`;\n } else {\n result += `([\\\\s\\\\S]+)`;\n }\n\n keys.push(token);\n backtrack = \"\";\n isSafeSegmentParam = false;\n continue;\n }\n }\n\n return result;\n}\n\n/**\n * Block backtracking on previous text and ignore delimiter string.\n */\nfunction negate(delimiter: string, backtrack: string): string {\n if (backtrack.length < 2) {\n if (delimiter.length < 2) return `[^${escape(delimiter + backtrack)}]`;\n return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;\n }\n if (delimiter.length < 2) {\n return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;\n }\n return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\\\s\\\\S])`;\n}\n\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens: Token[]): string {\n let value = \"\";\n let i = 0;\n\n function name(value: string) {\n const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]);\n return isSafe ? value : JSON.stringify(value);\n }\n\n while (i < tokens.length) {\n const token = tokens[i++];\n\n if (token.type === \"text\") {\n value += escapeText(token.value);\n continue;\n }\n\n if (token.type === \"group\") {\n value += `{${stringifyTokens(token.tokens)}}`;\n continue;\n }\n\n if (token.type === \"param\") {\n value += `:${name(token.name)}`;\n continue;\n }\n\n if (token.type === \"wildcard\") {\n value += `*${name(token.name)}`;\n continue;\n }\n\n throw new TypeError(`Unknown token type: ${(token as any).type}`);\n }\n\n return value;\n}\n\n/**\n * Stringify token data into a path string.\n */\nexport function stringify(data: TokenData): string {\n return stringifyTokens(data.tokens);\n}\n\n/**\n * Validate the parameter name contains valid ID characters.\n */\nfunction isNameSafe(name: string): boolean {\n const [first, ...rest] = name;\n return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));\n}\n\n/**\n * Validate the next token does not interfere with the current param name.\n */\nfunction isNextNameSafe(token: Token | undefined): boolean {\n if (token && token.type === \"text\") return !ID_CONTINUE.test(token.value[0]);\n return true;\n}\n"]} \ No newline at end of file diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json new file mode 100644 index 0000000..7ae266e --- /dev/null +++ b/node_modules/path-to-regexp/package.json @@ -0,0 +1,64 @@ +{ + "name": "path-to-regexp", + "version": "8.3.0", + "description": "Express style path to RegExp utility", + "keywords": [ + "express", + "regexp", + "route", + "routing" + ], + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/path-to-regexp.git" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + }, + "license": "MIT", + "exports": "./dist/index.js", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "files": [ + "dist/" + ], + "scripts": { + "bench": "vitest bench", + "build": "ts-scripts build", + "format": "ts-scripts format", + "lint": "ts-scripts lint", + "prepare": "ts-scripts install && npm run build", + "size": "size-limit", + "specs": "ts-scripts specs", + "test": "ts-scripts test && npm run size" + }, + "devDependencies": { + "@borderless/ts-scripts": "^0.15.0", + "@size-limit/preset-small-lib": "^11.1.2", + "@types/node": "^22.7.2", + "@types/semver": "^7.3.1", + "@vitest/coverage-v8": "^3.0.5", + "recheck": "^4.4.5", + "size-limit": "^11.1.2", + "typescript": "^5.7.3", + "vitest": "^3.0.5" + }, + "publishConfig": { + "access": "public" + }, + "size-limit": [ + { + "path": "dist/index.js", + "limit": "2 kB" + } + ], + "ts-scripts": { + "dist": [ + "dist" + ], + "project": [ + "tsconfig.build.json" + ] + } +} diff --git a/node_modules/pause-stream/.npmignore b/node_modules/pause-stream/.npmignore new file mode 100644 index 0000000..13abef4 --- /dev/null +++ b/node_modules/pause-stream/.npmignore @@ -0,0 +1,3 @@ +node_modules +node_modules/* +npm_debug.log diff --git a/node_modules/pause-stream/LICENSE b/node_modules/pause-stream/LICENSE new file mode 100644 index 0000000..6a477d4 --- /dev/null +++ b/node_modules/pause-stream/LICENSE @@ -0,0 +1,231 @@ +Dual Licensed MIT and Apache 2 + +The MIT License + +Copyright (c) 2013 Dominic Tarr + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + ----------------------------------------------------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2013 Dominic Tarr + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/node_modules/pause-stream/index.js b/node_modules/pause-stream/index.js new file mode 100644 index 0000000..0e0bf96 --- /dev/null +++ b/node_modules/pause-stream/index.js @@ -0,0 +1,3 @@ +//through@2 handles this by default! +module.exports = require('through') + diff --git a/node_modules/pause-stream/package.json b/node_modules/pause-stream/package.json new file mode 100644 index 0000000..2a22646 --- /dev/null +++ b/node_modules/pause-stream/package.json @@ -0,0 +1,35 @@ +{ + "name": "pause-stream", + "version": "0.0.11", + "description": "a ThroughStream that strictly buffers all readable events when paused.", + "main": "index.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "stream-tester": "0.0.2", + "stream-spec": "~0.2.0" + }, + "scripts": { + "test": "node test/index.js && node test/pause-end.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/dominictarr/pause-stream.git" + }, + "keywords": [ + "stream", + "pipe", + "pause", + "drain", + "buffer" + ], + "author": "Dominic Tarr (dominictarr.com)", + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" + } +} diff --git a/node_modules/pause-stream/readme.markdown b/node_modules/pause-stream/readme.markdown new file mode 100644 index 0000000..2366939 --- /dev/null +++ b/node_modules/pause-stream/readme.markdown @@ -0,0 +1,29 @@ +# PauseStream + +This is a `Stream` that will strictly buffer when paused. +Connect it to anything you need buffered. + +``` js + var ps = require('pause-stream')(); + + badlyBehavedStream.pipe(ps.pause()) + + aLittleLater(function (err, data) { + ps.pipe(createAnotherStream(data)) + ps.resume() + }) +``` + +`PauseStream` will buffer whenever paused. +it will buffer when yau have called `pause` manually. +but also when it's downstream `dest.write()===false`. +it will attempt to drain the buffer when you call resume +or the downstream emits `'drain'` + +`PauseStream` is tested using [stream-spec](https://github.com/dominictarr/stream-spec) +and [stream-tester](https://github.com/dominictarr/stream-tester) + +This is now the default case of +[through](https://github.com/dominictarr/through) + +https://github.com/dominictarr/pause-stream/commit/4a6fe3dc2c11091b1efbfde912e0473719ed9cc0 diff --git a/node_modules/pause-stream/test/index.js b/node_modules/pause-stream/test/index.js new file mode 100644 index 0000000..db8778d --- /dev/null +++ b/node_modules/pause-stream/test/index.js @@ -0,0 +1,17 @@ +var spec = require('stream-spec') +var tester = require('stream-tester') +var ps = require('..')() + +spec(ps) + .through({strict: false}) + .validateOnExit() + +var master = tester.createConsistent + +tester.createRandomStream(1000) //1k random numbers + .pipe(master = tester.createConsistentStream()) + .pipe(tester.createUnpauseStream()) + .pipe(ps) + .pipe(tester.createPauseStream()) + .pipe(master.createSlave()) + diff --git a/node_modules/pause-stream/test/pause-end.js b/node_modules/pause-stream/test/pause-end.js new file mode 100644 index 0000000..a6c27ef --- /dev/null +++ b/node_modules/pause-stream/test/pause-end.js @@ -0,0 +1,33 @@ + +var pause = require('..') +var assert = require('assert') + +var ps = pause() +var read = [], ended = false + +ps.on('data', function (i) { + read.push(i) +}) + +ps.on('end', function () { + ended = true +}) + +assert.deepEqual(read, []) + +ps.write(0) +ps.write(1) +ps.write(2) + +assert.deepEqual(read, [0, 1, 2]) + +ps.pause() + +assert.deepEqual(read, [0, 1, 2]) + +ps.end() +assert.equal(ended, false) +ps.resume() +assert.equal(ended, true) + + diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE new file mode 100644 index 0000000..46c9b95 --- /dev/null +++ b/node_modules/picocolors/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md new file mode 100644 index 0000000..8e47aa8 --- /dev/null +++ b/node_modules/picocolors/README.md @@ -0,0 +1,21 @@ +# picocolors + +The tiniest and the fastest library for terminal output formatting with ANSI colors. + +```javascript +import pc from "picocolors" + +console.log( + pc.green(`How are ${pc.italic(`you`)} doing?`) +) +``` + +- **No dependencies.** +- **14 times** smaller and **2 times** faster than chalk. +- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist. +- Node.js v6+ & browsers support. Support for both CJS and ESM projects. +- TypeScript type declarations included. +- [`NO_COLOR`](https://no-color.org/) friendly. + +## Docs +Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub. diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json new file mode 100644 index 0000000..372d4b6 --- /dev/null +++ b/node_modules/picocolors/package.json @@ -0,0 +1,25 @@ +{ + "name": "picocolors", + "version": "1.1.1", + "main": "./picocolors.js", + "types": "./picocolors.d.ts", + "browser": { + "./picocolors.js": "./picocolors.browser.js" + }, + "sideEffects": false, + "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors", + "files": [ + "picocolors.*", + "types.d.ts" + ], + "keywords": [ + "terminal", + "colors", + "formatting", + "cli", + "console" + ], + "author": "Alexey Raspopov", + "repository": "alexeyraspopov/picocolors", + "license": "ISC" +} diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js new file mode 100644 index 0000000..9dcf637 --- /dev/null +++ b/node_modules/picocolors/picocolors.browser.js @@ -0,0 +1,4 @@ +var x=String; +var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}}; +module.exports=create(); +module.exports.createColors = create; diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts new file mode 100644 index 0000000..94e146a --- /dev/null +++ b/node_modules/picocolors/picocolors.d.ts @@ -0,0 +1,5 @@ +import { Colors } from "./types" + +declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors } + +export = picocolors diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js new file mode 100644 index 0000000..e32df85 --- /dev/null +++ b/node_modules/picocolors/picocolors.js @@ -0,0 +1,75 @@ +let p = process || {}, argv = p.argv || [], env = p.env || {} +let isColorSupported = + !(!!env.NO_COLOR || argv.includes("--no-color")) && + (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI) + +let formatter = (open, close, replace = open) => + input => { + let string = "" + input, index = string.indexOf(close, open.length) + return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close + } + +let replaceClose = (string, close, replace, index) => { + let result = "", cursor = 0 + do { + result += string.substring(cursor, index) + replace + cursor = index + close.length + index = string.indexOf(close, cursor) + } while (~index) + return result + string.substring(cursor) +} + +let createColors = (enabled = isColorSupported) => { + let f = enabled ? formatter : () => String + return { + isColorSupported: enabled, + reset: f("\x1b[0m", "\x1b[0m"), + bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic: f("\x1b[3m", "\x1b[23m"), + underline: f("\x1b[4m", "\x1b[24m"), + inverse: f("\x1b[7m", "\x1b[27m"), + hidden: f("\x1b[8m", "\x1b[28m"), + strikethrough: f("\x1b[9m", "\x1b[29m"), + + black: f("\x1b[30m", "\x1b[39m"), + red: f("\x1b[31m", "\x1b[39m"), + green: f("\x1b[32m", "\x1b[39m"), + yellow: f("\x1b[33m", "\x1b[39m"), + blue: f("\x1b[34m", "\x1b[39m"), + magenta: f("\x1b[35m", "\x1b[39m"), + cyan: f("\x1b[36m", "\x1b[39m"), + white: f("\x1b[37m", "\x1b[39m"), + gray: f("\x1b[90m", "\x1b[39m"), + + bgBlack: f("\x1b[40m", "\x1b[49m"), + bgRed: f("\x1b[41m", "\x1b[49m"), + bgGreen: f("\x1b[42m", "\x1b[49m"), + bgYellow: f("\x1b[43m", "\x1b[49m"), + bgBlue: f("\x1b[44m", "\x1b[49m"), + bgMagenta: f("\x1b[45m", "\x1b[49m"), + bgCyan: f("\x1b[46m", "\x1b[49m"), + bgWhite: f("\x1b[47m", "\x1b[49m"), + + blackBright: f("\x1b[90m", "\x1b[39m"), + redBright: f("\x1b[91m", "\x1b[39m"), + greenBright: f("\x1b[92m", "\x1b[39m"), + yellowBright: f("\x1b[93m", "\x1b[39m"), + blueBright: f("\x1b[94m", "\x1b[39m"), + magentaBright: f("\x1b[95m", "\x1b[39m"), + cyanBright: f("\x1b[96m", "\x1b[39m"), + whiteBright: f("\x1b[97m", "\x1b[39m"), + + bgBlackBright: f("\x1b[100m", "\x1b[49m"), + bgRedBright: f("\x1b[101m", "\x1b[49m"), + bgGreenBright: f("\x1b[102m", "\x1b[49m"), + bgYellowBright: f("\x1b[103m", "\x1b[49m"), + bgBlueBright: f("\x1b[104m", "\x1b[49m"), + bgMagentaBright: f("\x1b[105m", "\x1b[49m"), + bgCyanBright: f("\x1b[106m", "\x1b[49m"), + bgWhiteBright: f("\x1b[107m", "\x1b[49m"), + } +} + +module.exports = createColors() +module.exports.createColors = createColors diff --git a/node_modules/picocolors/types.d.ts b/node_modules/picocolors/types.d.ts new file mode 100644 index 0000000..cd1aec4 --- /dev/null +++ b/node_modules/picocolors/types.d.ts @@ -0,0 +1,51 @@ +export type Formatter = (input: string | number | null | undefined) => string + +export interface Colors { + isColorSupported: boolean + + reset: Formatter + bold: Formatter + dim: Formatter + italic: Formatter + underline: Formatter + inverse: Formatter + hidden: Formatter + strikethrough: Formatter + + black: Formatter + red: Formatter + green: Formatter + yellow: Formatter + blue: Formatter + magenta: Formatter + cyan: Formatter + white: Formatter + gray: Formatter + + bgBlack: Formatter + bgRed: Formatter + bgGreen: Formatter + bgYellow: Formatter + bgBlue: Formatter + bgMagenta: Formatter + bgCyan: Formatter + bgWhite: Formatter + + blackBright: Formatter + redBright: Formatter + greenBright: Formatter + yellowBright: Formatter + blueBright: Formatter + magentaBright: Formatter + cyanBright: Formatter + whiteBright: Formatter + + bgBlackBright: Formatter + bgRedBright: Formatter + bgGreenBright: Formatter + bgYellowBright: Formatter + bgBlueBright: Formatter + bgMagentaBright: Formatter + bgCyanBright: Formatter + bgWhiteBright: Formatter +} diff --git a/node_modules/pkg-dir/index.d.ts b/node_modules/pkg-dir/index.d.ts new file mode 100644 index 0000000..e339404 --- /dev/null +++ b/node_modules/pkg-dir/index.d.ts @@ -0,0 +1,44 @@ +declare const pkgDir: { + /** + Find the root directory of a Node.js project or npm package. + + @param cwd - Directory to start from. Default: `process.cwd()`. + @returns The project root path or `undefined` if it couldn't be found. + + @example + ``` + // / + // └── Users + // └── sindresorhus + // └── foo + // ├── package.json + // └── bar + // ├── baz + // └── example.js + + // example.js + import pkgDir = require('pkg-dir'); + + (async () => { + const rootDir = await pkgDir(__dirname); + + console.log(rootDir); + //=> '/Users/sindresorhus/foo' + })(); + ``` + */ + (cwd?: string): Promise; + + /** + Synchronously find the root directory of a Node.js project or npm package. + + @param cwd - Directory to start from. Default: `process.cwd()`. + @returns The project root path or `undefined` if it couldn't be found. + */ + sync(cwd?: string): string | undefined; + + // TODO: Remove this for the next major release + default: typeof pkgDir; +}; + +export = pkgDir; diff --git a/node_modules/pkg-dir/index.js b/node_modules/pkg-dir/index.js new file mode 100644 index 0000000..83e683d --- /dev/null +++ b/node_modules/pkg-dir/index.js @@ -0,0 +1,17 @@ +'use strict'; +const path = require('path'); +const findUp = require('find-up'); + +const pkgDir = async cwd => { + const filePath = await findUp('package.json', {cwd}); + return filePath && path.dirname(filePath); +}; + +module.exports = pkgDir; +// TODO: Remove this for the next major release +module.exports.default = pkgDir; + +module.exports.sync = cwd => { + const filePath = findUp.sync('package.json', {cwd}); + return filePath && path.dirname(filePath); +}; diff --git a/node_modules/pkg-dir/license b/node_modules/pkg-dir/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/pkg-dir/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/pkg-dir/node_modules/find-up/index.d.ts b/node_modules/pkg-dir/node_modules/find-up/index.d.ts new file mode 100644 index 0000000..41e3192 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/find-up/index.d.ts @@ -0,0 +1,137 @@ +import {Options as LocatePathOptions} from 'locate-path'; + +declare const stop: unique symbol; + +declare namespace findUp { + interface Options extends LocatePathOptions {} + + type StopSymbol = typeof stop; + + type Match = string | StopSymbol | undefined; +} + +declare const findUp: { + /** + Find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + + @example + ``` + // / + // └── Users + // └── sindresorhus + // ├── unicorn.png + // └── foo + // └── bar + // ├── baz + // └── example.js + + // example.js + import findUp = require('find-up'); + + (async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + })(); + ``` + */ + (name: string | string[], options?: findUp.Options): Promise; + + /** + Find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + (async () => { + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + })(); + ``` + */ + (matcher: (directory: string) => (findUp.Match | Promise), options?: findUp.Options): Promise; + + sync: { + /** + Synchronously find a file or directory by walking up parent directories. + + @param name - Name of the file or directory to find. Can be multiple. + @returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found. + */ + (name: string | string[], options?: findUp.Options): string | undefined; + + /** + Synchronously find a file or directory by walking up parent directories. + + @param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search. + @returns The first path found or `undefined` if none could be found. + + @example + ``` + import path = require('path'); + import findUp = require('find-up'); + + console.log(findUp.sync(directory => { + const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' + ``` + */ + (matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined; + + /** + Synchronously check if a path exists. + + @param path - Path to the file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png')); + //=> true + ``` + */ + exists(path: string): boolean; + } + + /** + Check if a path exists. + + @param path - Path to a file or directory. + @returns Whether the path exists. + + @example + ``` + import findUp = require('find-up'); + + (async () => { + console.log(await findUp.exists('/Users/sindresorhus/unicorn.png')); + //=> true + })(); + ``` + */ + exists(path: string): Promise; + + /** + Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`. + */ + readonly stop: findUp.StopSymbol; +}; + +export = findUp; diff --git a/node_modules/pkg-dir/node_modules/find-up/index.js b/node_modules/pkg-dir/node_modules/find-up/index.js new file mode 100644 index 0000000..ce564e5 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/find-up/index.js @@ -0,0 +1,89 @@ +'use strict'; +const path = require('path'); +const locatePath = require('locate-path'); +const pathExists = require('path-exists'); + +const stop = Symbol('findUp.stop'); + +module.exports = async (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = async locateOptions => { + if (typeof name !== 'function') { + return locatePath(paths, locateOptions); + } + + const foundPath = await name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + // eslint-disable-next-line no-await-in-loop + const foundPath = await runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.sync = (name, options = {}) => { + let directory = path.resolve(options.cwd || ''); + const {root} = path.parse(directory); + const paths = [].concat(name); + + const runMatcher = locateOptions => { + if (typeof name !== 'function') { + return locatePath.sync(paths, locateOptions); + } + + const foundPath = name(locateOptions.cwd); + if (typeof foundPath === 'string') { + return locatePath.sync([foundPath], locateOptions); + } + + return foundPath; + }; + + // eslint-disable-next-line no-constant-condition + while (true) { + const foundPath = runMatcher({...options, cwd: directory}); + + if (foundPath === stop) { + return; + } + + if (foundPath) { + return path.resolve(directory, foundPath); + } + + if (directory === root) { + return; + } + + directory = path.dirname(directory); + } +}; + +module.exports.exists = pathExists; + +module.exports.sync.exists = pathExists.sync; + +module.exports.stop = stop; diff --git a/node_modules/pkg-dir/node_modules/find-up/license b/node_modules/pkg-dir/node_modules/find-up/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/find-up/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/pkg-dir/node_modules/find-up/package.json b/node_modules/pkg-dir/node_modules/find-up/package.json new file mode 100644 index 0000000..cd50281 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/find-up/package.json @@ -0,0 +1,53 @@ +{ + "name": "find-up", + "version": "4.1.0", + "description": "Find a file or directory by walking up parent directories", + "license": "MIT", + "repository": "sindresorhus/find-up", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "package", + "resolve", + "parent", + "parents", + "folder", + "directory", + "walk", + "walking", + "path" + ], + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "is-path-inside": "^2.1.0", + "tempy": "^0.3.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + } +} diff --git a/node_modules/pkg-dir/node_modules/find-up/readme.md b/node_modules/pkg-dir/node_modules/find-up/readme.md new file mode 100644 index 0000000..d6a21e5 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/find-up/readme.md @@ -0,0 +1,156 @@ +# find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) + +> Find a file or directory by walking up parent directories + + +## Install + +``` +$ npm install find-up +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js +``` + +`example.js` + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + console.log(await findUp('unicorn.png')); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(['rainbow.png', 'unicorn.png'])); + //=> '/Users/sindresorhus/unicorn.png' + + console.log(await findUp(async directory => { + const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png')); + return hasUnicorns && directory; + }, {type: 'directory'})); + //=> '/Users/sindresorhus' +})(); +``` + + +## API + +### findUp(name, options?) +### findUp(matcher, options?) + +Returns a `Promise` for either the path or `undefined` if it couldn't be found. + +### findUp([...name], options?) + +Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found. + +### findUp.sync(name, options?) +### findUp.sync(matcher, options?) + +Returns a path or `undefined` if it couldn't be found. + +### findUp.sync([...name], options?) + +Returns the first path found (by respecting the order of the array) or `undefined` if none could be found. + +#### name + +Type: `string` + +Name of the file or directory to find. + +#### matcher + +Type: `Function` + +A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases. + +When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path. + +#### options + +Type: `object` + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + +##### type + +Type: `string`
+Default: `'file'`
+Values: `'file'` `'directory'` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`
+Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### findUp.exists(path) + +Returns a `Promise` of whether the path exists. + +### findUp.sync.exists(path) + +Returns a `boolean` of whether the path exists. + +#### path + +Type: `string` + +Path to a file or directory. + +### findUp.stop + +A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem. + +```js +const path = require('path'); +const findUp = require('find-up'); + +(async () => { + await findUp(directory => { + return path.basename(directory) === 'work' ? findUp.stop : 'logo.png'; + }); +})(); +``` + + +## Related + +- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path + + +--- + +

+ + Get professional support for 'find-up' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/pkg-dir/node_modules/locate-path/index.d.ts b/node_modules/pkg-dir/node_modules/locate-path/index.d.ts new file mode 100644 index 0000000..fbde526 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/locate-path/index.d.ts @@ -0,0 +1,83 @@ +declare namespace locatePath { + interface Options { + /** + Current working directory. + + @default process.cwd() + */ + readonly cwd?: string; + + /** + Type of path to match. + + @default 'file' + */ + readonly type?: 'file' | 'directory'; + + /** + Allow symbolic links to match if they point to the requested path type. + + @default true + */ + readonly allowSymlinks?: boolean; + } + + interface AsyncOptions extends Options { + /** + Number of concurrently pending promises. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `paths` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +declare const locatePath: { + /** + Get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + + @example + ``` + import locatePath = require('locate-path'); + + const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' + ]; + + (async () => { + console(await locatePath(files)); + //=> 'rainbow' + })(); + ``` + */ + (paths: Iterable, options?: locatePath.AsyncOptions): Promise< + string | undefined + >; + + /** + Synchronously get the first path that exists on disk of multiple paths. + + @param paths - Paths to check. + @returns The first path that exists or `undefined` if none exists. + */ + sync( + paths: Iterable, + options?: locatePath.Options + ): string | undefined; +}; + +export = locatePath; diff --git a/node_modules/pkg-dir/node_modules/locate-path/index.js b/node_modules/pkg-dir/node_modules/locate-path/index.js new file mode 100644 index 0000000..4604bbf --- /dev/null +++ b/node_modules/pkg-dir/node_modules/locate-path/index.js @@ -0,0 +1,65 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const {promisify} = require('util'); +const pLocate = require('p-locate'); + +const fsStat = promisify(fs.stat); +const fsLStat = promisify(fs.lstat); + +const typeMappings = { + directory: 'isDirectory', + file: 'isFile' +}; + +function checkType({type}) { + if (type in typeMappings) { + return; + } + + throw new Error(`Invalid type specified: ${type}`); +} + +const matchType = (type, stat) => type === undefined || stat[typeMappings[type]](); + +module.exports = async (paths, options) => { + options = { + cwd: process.cwd(), + type: 'file', + allowSymlinks: true, + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fsStat : fsLStat; + + return pLocate(paths, async path_ => { + try { + const stat = await statFn(path.resolve(options.cwd, path_)); + return matchType(options.type, stat); + } catch (_) { + return false; + } + }, options); +}; + +module.exports.sync = (paths, options) => { + options = { + cwd: process.cwd(), + allowSymlinks: true, + type: 'file', + ...options + }; + checkType(options); + const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync; + + for (const path_ of paths) { + try { + const stat = statFn(path.resolve(options.cwd, path_)); + + if (matchType(options.type, stat)) { + return path_; + } + } catch (_) { + } + } +}; diff --git a/node_modules/pkg-dir/node_modules/locate-path/license b/node_modules/pkg-dir/node_modules/locate-path/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/locate-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/pkg-dir/node_modules/locate-path/package.json b/node_modules/pkg-dir/node_modules/locate-path/package.json new file mode 100644 index 0000000..063b290 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/locate-path/package.json @@ -0,0 +1,45 @@ +{ + "name": "locate-path", + "version": "5.0.0", + "description": "Get the first path that exists on disk of multiple paths", + "license": "MIT", + "repository": "sindresorhus/locate-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "locate", + "path", + "paths", + "file", + "files", + "exists", + "find", + "finder", + "search", + "searcher", + "array", + "iterable", + "iterator" + ], + "dependencies": { + "p-locate": "^4.1.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/pkg-dir/node_modules/locate-path/readme.md b/node_modules/pkg-dir/node_modules/locate-path/readme.md new file mode 100644 index 0000000..2184c6f --- /dev/null +++ b/node_modules/pkg-dir/node_modules/locate-path/readme.md @@ -0,0 +1,122 @@ +# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) + +> Get the first path that exists on disk of multiple paths + + +## Install + +``` +$ npm install locate-path +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const locatePath = require('locate-path'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + console(await locatePath(files)); + //=> 'rainbow' +})(); +``` + + +## API + +### locatePath(paths, [options]) + +Returns a `Promise` for the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `paths` order when searching. + +Disable this to improve performance if you don't care about the order. + +##### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory. + +##### type + +Type: `string`
+Default: `file`
+Values: `file` `directory` + +The type of paths that can match. + +##### allowSymlinks + +Type: `boolean`
+Default: `true` + +Allow symbolic links to match if they point to the chosen path type. + +### locatePath.sync(paths, [options]) + +Returns the first path that exists or `undefined` if none exists. + +#### paths + +Type: `Iterable` + +Paths to check. + +#### options + +Type: `Object` + +##### cwd + +Same as above. + +##### type + +Same as above. + +##### allowSymlinks + +Same as above. + + +## Related + +- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/pkg-dir/node_modules/p-limit/index.d.ts b/node_modules/pkg-dir/node_modules/p-limit/index.d.ts new file mode 100644 index 0000000..6bbfad4 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-limit/index.d.ts @@ -0,0 +1,38 @@ +export interface Limit { + /** + @param fn - Promise-returning/async function. + @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. + @returns The promise returned by calling `fn(...arguments)`. + */ + ( + fn: (...arguments: Arguments) => PromiseLike | ReturnType, + ...arguments: Arguments + ): Promise; + + /** + The number of promises that are currently running. + */ + readonly activeCount: number; + + /** + The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + */ + readonly pendingCount: number; + + /** + Discard pending promises that are waiting to run. + + This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + + Note: This does not cancel promises that are already running. + */ + clearQueue(): void; +} + +/** +Run multiple promise-returning & async functions with limited concurrency. + +@param concurrency - Concurrency limit. Minimum: `1`. +@returns A `limit` function. +*/ +export default function pLimit(concurrency: number): Limit; diff --git a/node_modules/pkg-dir/node_modules/p-limit/index.js b/node_modules/pkg-dir/node_modules/p-limit/index.js new file mode 100644 index 0000000..6a72a4c --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-limit/index.js @@ -0,0 +1,57 @@ +'use strict'; +const pTry = require('p-try'); + +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + const run = (fn, resolve, ...args) => { + activeCount++; + + const result = pTry(fn, ...args); + + resolve(result); + + result.then(next, next); + }; + + const enqueue = (fn, resolve, ...args) => { + if (activeCount < concurrency) { + run(fn, resolve, ...args); + } else { + queue.push(run.bind(null, fn, resolve, ...args)); + } + }; + + const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.length + }, + clearQueue: { + value: () => { + queue.length = 0; + } + } + }); + + return generator; +}; + +module.exports = pLimit; +module.exports.default = pLimit; diff --git a/node_modules/pkg-dir/node_modules/p-limit/license b/node_modules/pkg-dir/node_modules/p-limit/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-limit/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/pkg-dir/node_modules/p-limit/package.json b/node_modules/pkg-dir/node_modules/p-limit/package.json new file mode 100644 index 0000000..99a814f --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-limit/package.json @@ -0,0 +1,52 @@ +{ + "name": "p-limit", + "version": "2.3.0", + "description": "Run multiple promise-returning & async functions with limited concurrency", + "license": "MIT", + "repository": "sindresorhus/p-limit", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "limit", + "limited", + "concurrency", + "throttle", + "throat", + "rate", + "batch", + "ratelimit", + "task", + "queue", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-try": "^2.0.0" + }, + "devDependencies": { + "ava": "^1.2.1", + "delay": "^4.1.0", + "in-range": "^1.0.0", + "random-int": "^1.0.0", + "time-span": "^2.0.0", + "tsd-check": "^0.3.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/pkg-dir/node_modules/p-limit/readme.md b/node_modules/pkg-dir/node_modules/p-limit/readme.md new file mode 100644 index 0000000..64aa476 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-limit/readme.md @@ -0,0 +1,101 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + +## Install + +``` +$ npm install p-limit +``` + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`\ +Minimum: `1`\ +Default: `Infinity` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + +### limit.clearQueue() + +Discard pending promises that are waiting to run. + +This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + +Note: This does not cancel promises that are already running. + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/pkg-dir/node_modules/p-locate/index.d.ts b/node_modules/pkg-dir/node_modules/p-locate/index.d.ts new file mode 100644 index 0000000..14115e1 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-locate/index.d.ts @@ -0,0 +1,64 @@ +declare namespace pLocate { + interface Options { + /** + Number of concurrently pending promises returned by `tester`. Minimum: `1`. + + @default Infinity + */ + readonly concurrency?: number; + + /** + Preserve `input` order when searching. + + Disable this to improve performance if you don't care about the order. + + @default true + */ + readonly preserveOrder?: boolean; + } +} + +declare const pLocate: { + /** + Get the first fulfilled promise that satisfies the provided testing function. + + @param input - An iterable of promises/values to test. + @param tester - This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + @returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + + @example + ``` + import pathExists = require('path-exists'); + import pLocate = require('p-locate'); + + const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' + ]; + + (async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' + })(); + ``` + */ + ( + input: Iterable | ValueType>, + tester: (element: ValueType) => PromiseLike | boolean, + options?: pLocate.Options + ): Promise; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function pLocate( + // input: Iterable | ValueType>, + // tester: (element: ValueType) => PromiseLike | boolean, + // options?: pLocate.Options + // ): Promise; + // export = pLocate; + default: typeof pLocate; +}; + +export = pLocate; diff --git a/node_modules/pkg-dir/node_modules/p-locate/index.js b/node_modules/pkg-dir/node_modules/p-locate/index.js new file mode 100644 index 0000000..e13ce15 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-locate/index.js @@ -0,0 +1,52 @@ +'use strict'; +const pLimit = require('p-limit'); + +class EndError extends Error { + constructor(value) { + super(); + this.value = value; + } +} + +// The input can also be a promise, so we await it +const testElement = async (element, tester) => tester(await element); + +// The input can also be a promise, so we `Promise.all()` them both +const finder = async element => { + const values = await Promise.all(element); + if (values[1] === true) { + throw new EndError(values[0]); + } + + return false; +}; + +const pLocate = async (iterable, tester, options) => { + options = { + concurrency: Infinity, + preserveOrder: true, + ...options + }; + + const limit = pLimit(options.concurrency); + + // Start all the promises concurrently with optional limit + const items = [...iterable].map(element => [element, limit(testElement, element, tester)]); + + // Check the promises either serially or concurrently + const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity); + + try { + await Promise.all(items.map(element => checkLimit(finder, element))); + } catch (error) { + if (error instanceof EndError) { + return error.value; + } + + throw error; + } +}; + +module.exports = pLocate; +// TODO: Remove this for the next major release +module.exports.default = pLocate; diff --git a/node_modules/pkg-dir/node_modules/p-locate/license b/node_modules/pkg-dir/node_modules/p-locate/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-locate/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/pkg-dir/node_modules/p-locate/package.json b/node_modules/pkg-dir/node_modules/p-locate/package.json new file mode 100644 index 0000000..e3de275 --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-locate/package.json @@ -0,0 +1,53 @@ +{ + "name": "p-locate", + "version": "4.1.0", + "description": "Get the first fulfilled promise that satisfies the provided testing function", + "license": "MIT", + "repository": "sindresorhus/p-locate", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "promise", + "locate", + "find", + "finder", + "search", + "searcher", + "test", + "array", + "collection", + "iterable", + "iterator", + "race", + "fulfilled", + "fastest", + "async", + "await", + "promises", + "bluebird" + ], + "dependencies": { + "p-limit": "^2.2.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "delay": "^4.1.0", + "in-range": "^1.0.0", + "time-span": "^3.0.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/pkg-dir/node_modules/p-locate/readme.md b/node_modules/pkg-dir/node_modules/p-locate/readme.md new file mode 100644 index 0000000..f8e2c2e --- /dev/null +++ b/node_modules/pkg-dir/node_modules/p-locate/readme.md @@ -0,0 +1,90 @@ +# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate) + +> Get the first fulfilled promise that satisfies the provided testing function + +Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find). + + +## Install + +``` +$ npm install p-locate +``` + + +## Usage + +Here we find the first file that exists on disk, in array order. + +```js +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +const files = [ + 'unicorn.png', + 'rainbow.png', // Only this one actually exists on disk + 'pony.png' +]; + +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + + console.log(foundPath); + //=> 'rainbow' +})(); +``` + +*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* + + +## API + +### pLocate(input, tester, [options]) + +Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`. + +#### input + +Type: `Iterable` + +An iterable of promises/values to test. + +#### tester(element) + +Type: `Function` + +This function will receive resolved values from `input` and is expected to return a `Promise` or `boolean`. + +#### options + +Type: `Object` + +##### concurrency + +Type: `number`
+Default: `Infinity`
+Minimum: `1` + +Number of concurrently pending promises returned by `tester`. + +##### preserveOrder + +Type: `boolean`
+Default: `true` + +Preserve `input` order when searching. + +Disable this to improve performance if you don't care about the order. + + +## Related + +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently +- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/pkg-dir/package.json b/node_modules/pkg-dir/package.json new file mode 100644 index 0000000..aad11e8 --- /dev/null +++ b/node_modules/pkg-dir/package.json @@ -0,0 +1,56 @@ +{ + "name": "pkg-dir", + "version": "4.2.0", + "description": "Find the root directory of a Node.js project or npm package", + "license": "MIT", + "repository": "sindresorhus/pkg-dir", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "package", + "json", + "root", + "npm", + "entry", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "dependencies": { + "find-up": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tempy": "^0.3.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/pkg-dir/readme.md b/node_modules/pkg-dir/readme.md new file mode 100644 index 0000000..92a77f4 --- /dev/null +++ b/node_modules/pkg-dir/readme.md @@ -0,0 +1,66 @@ +# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir) + +> Find the root directory of a Node.js project or npm package + + +## Install + +``` +$ npm install pkg-dir +``` + + +## Usage + +``` +/ +└── Users + └── sindresorhus + └── foo + ├── package.json + └── bar + ├── baz + └── example.js +``` + +```js +// example.js +const pkgDir = require('pkg-dir'); + +(async () => { + const rootDir = await pkgDir(__dirname); + + console.log(rootDir); + //=> '/Users/sindresorhus/foo' +})(); +``` + + +## API + +### pkgDir([cwd]) + +Returns a `Promise` for either the project root path or `undefined` if it couldn't be found. + +### pkgDir.sync([cwd]) + +Returns the project root path or `undefined` if it couldn't be found. + +#### cwd + +Type: `string`
+Default: `process.cwd()` + +Directory to start from. + + +## Related + +- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module +- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/platform/LICENSE b/node_modules/platform/LICENSE new file mode 100644 index 0000000..598835f --- /dev/null +++ b/node_modules/platform/LICENSE @@ -0,0 +1,21 @@ +Copyright 2014-2020 Benjamin Tan +Copyright 2011-2013 John-David Dalton + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/platform/README.md b/node_modules/platform/README.md new file mode 100644 index 0000000..c2a15c0 --- /dev/null +++ b/node_modules/platform/README.md @@ -0,0 +1,76 @@ +# Platform.js v1.3.5 + +A platform detection library that works on nearly all JavaScript platforms. + +## Disclaimer + +Platform.js is for informational purposes only & **not** intended as a substitution for feature detection/inference checks. + +## Documentation + +* [doc/README.md](https://github.com/bestiejs/platform.js/blob/master/doc/README.md#readme) +* [wiki/Changelog](https://github.com/bestiejs/platform.js/wiki/Changelog) +* [wiki/Roadmap](https://github.com/bestiejs/platform.js/wiki/Roadmap) +* [platform.js demo](https://bestiejs.github.io/platform.js/) (See also [whatsmyua.info](https://www.whatsmyua.info/) for comparisons between platform.js and other platform detection libraries) + +## Installation + +In a browser: + +```html + +``` + +In an AMD loader: + +```js +require(['platform'], function(platform) {/*…*/}); +``` + +Using npm: + +```shell +$ npm i --save platform +``` + +In Node.js: + +```js +var platform = require('platform'); +``` + +Usage example: + +```js +// on IE10 x86 platform preview running in IE7 compatibility mode on Windows 7 64 bit edition +platform.name; // 'IE' +platform.version; // '10.0' +platform.layout; // 'Trident' +platform.os; // 'Windows Server 2008 R2 / 7 x64' +platform.description; // 'IE 10.0 x86 (platform preview; running in IE 7 mode) on Windows Server 2008 R2 / 7 x64' + +// or on an iPad +platform.name; // 'Safari' +platform.version; // '5.1' +platform.product; // 'iPad' +platform.manufacturer; // 'Apple' +platform.layout; // 'WebKit' +platform.os; // 'iOS 5.0' +platform.description; // 'Safari 5.1 on Apple iPad (iOS 5.0)' + +// or parsing a given UA string +var info = platform.parse('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7.2; en; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 11.52'); +info.name; // 'Opera' +info.version; // '11.52' +info.layout; // 'Presto' +info.os; // 'Mac OS X 10.7.2' +info.description; // 'Opera 11.52 (identifying as Firefox 4.0) on Mac OS X 10.7.2' +``` + +## Support + +Tested in Chrome 82-83, Firefox 77-78, IE 11, Edge 82-83, Safari 12-13, Node.js 4-14, & PhantomJS 2.1.1. + +## BestieJS + +Platform.js is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, & plenty of documentation. diff --git a/node_modules/platform/package.json b/node_modules/platform/package.json new file mode 100644 index 0000000..31c9e64 --- /dev/null +++ b/node_modules/platform/package.json @@ -0,0 +1,30 @@ +{ + "name": "platform", + "version": "1.3.6", + "description": "A platform detection library that works on nearly all JavaScript platforms.", + "license": "MIT", + "main": "platform.js", + "keywords": "environment, platform, ua, useragent", + "author": "Benjamin Tan ", + "contributors": [ + "Benjamin Tan ", + "John-David Dalton ", + "Mathias Bynens " + ], + "repository": "bestiejs/platform.js", + "scripts": { + "doc": "docdown platform.js doc/README.md style=github title=\"Platform.js v${npm_package_version}\" toc=properties url=https://github.com/bestiejs/platform.js/blob/${npm_package_version}/platform.js", + "prepublishOnly": "node bump/bump.js ${npm_package_version}", + "test": "node test/test.js" + }, + "devDependencies": { + "docdown": "^0.7.3", + "qunit-extras": "^1.5.0", + "qunitjs": "^1.23.1", + "replace": "^1.1.0", + "requirejs": "^2.3.6" + }, + "files": [ + "platform.js" + ] +} diff --git a/node_modules/platform/platform.js b/node_modules/platform/platform.js new file mode 100644 index 0000000..e6d268b --- /dev/null +++ b/node_modules/platform/platform.js @@ -0,0 +1,1260 @@ +/*! + * Platform.js v1.3.6 + * Copyright 2014-2020 Benjamin Tan + * Copyright 2011-2013 John-David Dalton + * Available under MIT license + */ +;(function() { + 'use strict'; + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Used as a reference to the global object. */ + var root = (objectTypes[typeof window] && window) || this; + + /** Backup possible global object. */ + var oldRoot = root; + + /** Detect free variable `exports`. */ + var freeExports = objectTypes[typeof exports] && exports; + + /** Detect free variable `module`. */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */ + var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { + root = freeGlobal; + } + + /** + * Used as the maximum length of an array-like object. + * See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + */ + var maxSafeInteger = Math.pow(2, 53) - 1; + + /** Regular expression to detect Opera. */ + var reOpera = /\bOpera/; + + /** Possible global object. */ + var thisBinding = this; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check for own properties of an object. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to resolve the internal `[[Class]]` of values. */ + var toString = objectProto.toString; + + /*--------------------------------------------------------------------------*/ + + /** + * Capitalizes a string value. + * + * @private + * @param {string} string The string to capitalize. + * @returns {string} The capitalized string. + */ + function capitalize(string) { + string = String(string); + return string.charAt(0).toUpperCase() + string.slice(1); + } + + /** + * A utility function to clean up the OS name. + * + * @private + * @param {string} os The OS name to clean up. + * @param {string} [pattern] A `RegExp` pattern matching the OS name. + * @param {string} [label] A label for the OS. + */ + function cleanupOS(os, pattern, label) { + // Platform tokens are defined at: + // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx + // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx + var data = { + '10.0': '10', + '6.4': '10 Technical Preview', + '6.3': '8.1', + '6.2': '8', + '6.1': 'Server 2008 R2 / 7', + '6.0': 'Server 2008 / Vista', + '5.2': 'Server 2003 / XP 64-bit', + '5.1': 'XP', + '5.01': '2000 SP1', + '5.0': '2000', + '4.0': 'NT', + '4.90': 'ME' + }; + // Detect Windows version from platform tokens. + if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) && + (data = data[/[\d.]+$/.exec(os)])) { + os = 'Windows ' + data; + } + // Correct character case and cleanup string. + os = String(os); + + if (pattern && label) { + os = os.replace(RegExp(pattern, 'i'), label); + } + + os = format( + os.replace(/ ce$/i, ' CE') + .replace(/\bhpw/i, 'web') + .replace(/\bMacintosh\b/, 'Mac OS') + .replace(/_PowerPC\b/i, ' OS') + .replace(/\b(OS X) [^ \d]+/i, '$1') + .replace(/\bMac (OS X)\b/, '$1') + .replace(/\/(\d)/, ' $1') + .replace(/_/g, '.') + .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '') + .replace(/\bx86\.64\b/gi, 'x86_64') + .replace(/\b(Windows Phone) OS\b/, '$1') + .replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1') + .split(' on ')[0] + ); + + return os; + } + + /** + * An iteration utility for arrays and objects. + * + * @private + * @param {Array|Object} object The object to iterate over. + * @param {Function} callback The function called per iteration. + */ + function each(object, callback) { + var index = -1, + length = object ? object.length : 0; + + if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { + while (++index < length) { + callback(object[index], index, object); + } + } else { + forOwn(object, callback); + } + } + + /** + * Trim and conditionally capitalize string values. + * + * @private + * @param {string} string The string to format. + * @returns {string} The formatted string. + */ + function format(string) { + string = trim(string); + return /^(?:webOS|i(?:OS|P))/.test(string) + ? string + : capitalize(string); + } + + /** + * Iterates over an object's own properties, executing the `callback` for each. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} callback The function executed per own property. + */ + function forOwn(object, callback) { + for (var key in object) { + if (hasOwnProperty.call(object, key)) { + callback(object[key], key, object); + } + } + } + + /** + * Gets the internal `[[Class]]` of a value. + * + * @private + * @param {*} value The value. + * @returns {string} The `[[Class]]`. + */ + function getClassOf(value) { + return value == null + ? capitalize(value) + : toString.call(value).slice(8, -1); + } + + /** + * Host objects can return type values that are different from their actual + * data type. The objects we are concerned with usually return non-primitive + * types of "object", "function", or "unknown". + * + * @private + * @param {*} object The owner of the property. + * @param {string} property The property to check. + * @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`. + */ + function isHostType(object, property) { + var type = object != null ? typeof object[property] : 'number'; + return !/^(?:boolean|number|string|undefined)$/.test(type) && + (type == 'object' ? !!object[property] : true); + } + + /** + * Prepares a string for use in a `RegExp` by making hyphens and spaces optional. + * + * @private + * @param {string} string The string to qualify. + * @returns {string} The qualified string. + */ + function qualify(string) { + return String(string).replace(/([ -])(?!$)/g, '$1?'); + } + + /** + * A bare-bones `Array#reduce` like utility function. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {*} The accumulated result. + */ + function reduce(array, callback) { + var accumulator = null; + each(array, function(value, index) { + accumulator = callback(accumulator, value, index, array); + }); + return accumulator; + } + + /** + * Removes leading and trailing whitespace from a string. + * + * @private + * @param {string} string The string to trim. + * @returns {string} The trimmed string. + */ + function trim(string) { + return String(string).replace(/^ +| +$/g, ''); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a new platform object. + * + * @memberOf platform + * @param {Object|string} [ua=navigator.userAgent] The user agent string or + * context object. + * @returns {Object} A platform object. + */ + function parse(ua) { + + /** The environment context object. */ + var context = root; + + /** Used to flag when a custom context is provided. */ + var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String'; + + // Juggle arguments. + if (isCustomContext) { + context = ua; + ua = null; + } + + /** Browser navigator object. */ + var nav = context.navigator || {}; + + /** Browser user agent string. */ + var userAgent = nav.userAgent || ''; + + ua || (ua = userAgent); + + /** Used to flag when `thisBinding` is the [ModuleScope]. */ + var isModuleScope = isCustomContext || thisBinding == oldRoot; + + /** Used to detect if browser is like Chrome. */ + var likeChrome = isCustomContext + ? !!nav.likeChrome + : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString()); + + /** Internal `[[Class]]` value shortcuts. */ + var objectClass = 'Object', + airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject', + enviroClass = isCustomContext ? objectClass : 'Environment', + javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java), + phantomClass = isCustomContext ? objectClass : 'RuntimeObject'; + + /** Detect Java environments. */ + var java = /\bJava/.test(javaClass) && context.java; + + /** Detect Rhino. */ + var rhino = java && getClassOf(context.environment) == enviroClass; + + /** A character to represent alpha. */ + var alpha = java ? 'a' : '\u03b1'; + + /** A character to represent beta. */ + var beta = java ? 'b' : '\u03b2'; + + /** Browser document object. */ + var doc = context.document || {}; + + /** + * Detect Opera browser (Presto-based). + * http://www.howtocreate.co.uk/operaStuff/operaObject.html + * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini + */ + var opera = context.operamini || context.opera; + + /** Opera `[[Class]]`. */ + var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera)) + ? operaClass + : (opera = null); + + /*------------------------------------------------------------------------*/ + + /** Temporary variable used over the script's lifetime. */ + var data; + + /** The CPU architecture. */ + var arch = ua; + + /** Platform description array. */ + var description = []; + + /** Platform alpha/beta indicator. */ + var prerelease = null; + + /** A flag to indicate that environment features should be used to resolve the platform. */ + var useFeatures = ua == userAgent; + + /** The browser/environment version. */ + var version = useFeatures && opera && typeof opera.version == 'function' && opera.version(); + + /** A flag to indicate if the OS ends with "/ Version" */ + var isSpecialCasedOS; + + /* Detectable layout engines (order is important). */ + var layout = getLayout([ + { 'label': 'EdgeHTML', 'pattern': 'Edge' }, + 'Trident', + { 'label': 'WebKit', 'pattern': 'AppleWebKit' }, + 'iCab', + 'Presto', + 'NetFront', + 'Tasman', + 'KHTML', + 'Gecko' + ]); + + /* Detectable browser names (order is important). */ + var name = getName([ + 'Adobe AIR', + 'Arora', + 'Avant Browser', + 'Breach', + 'Camino', + 'Electron', + 'Epiphany', + 'Fennec', + 'Flock', + 'Galeon', + 'GreenBrowser', + 'iCab', + 'Iceweasel', + 'K-Meleon', + 'Konqueror', + 'Lunascape', + 'Maxthon', + { 'label': 'Microsoft Edge', 'pattern': '(?:Edge|Edg|EdgA|EdgiOS)' }, + 'Midori', + 'Nook Browser', + 'PaleMoon', + 'PhantomJS', + 'Raven', + 'Rekonq', + 'RockMelt', + { 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' }, + 'SeaMonkey', + { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, + 'Sleipnir', + 'SlimBrowser', + { 'label': 'SRWare Iron', 'pattern': 'Iron' }, + 'Sunrise', + 'Swiftfox', + 'Vivaldi', + 'Waterfox', + 'WebPositive', + { 'label': 'Yandex Browser', 'pattern': 'YaBrowser' }, + { 'label': 'UC Browser', 'pattern': 'UCBrowser' }, + 'Opera Mini', + { 'label': 'Opera Mini', 'pattern': 'OPiOS' }, + 'Opera', + { 'label': 'Opera', 'pattern': 'OPR' }, + 'Chromium', + 'Chrome', + { 'label': 'Chrome', 'pattern': '(?:HeadlessChrome)' }, + { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' }, + { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' }, + { 'label': 'Firefox for iOS', 'pattern': 'FxiOS' }, + { 'label': 'IE', 'pattern': 'IEMobile' }, + { 'label': 'IE', 'pattern': 'MSIE' }, + 'Safari' + ]); + + /* Detectable products (order is important). */ + var product = getProduct([ + { 'label': 'BlackBerry', 'pattern': 'BB10' }, + 'BlackBerry', + { 'label': 'Galaxy S', 'pattern': 'GT-I9000' }, + { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' }, + { 'label': 'Galaxy S3', 'pattern': 'GT-I9300' }, + { 'label': 'Galaxy S4', 'pattern': 'GT-I9500' }, + { 'label': 'Galaxy S5', 'pattern': 'SM-G900' }, + { 'label': 'Galaxy S6', 'pattern': 'SM-G920' }, + { 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' }, + { 'label': 'Galaxy S7', 'pattern': 'SM-G930' }, + { 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' }, + 'Google TV', + 'Lumia', + 'iPad', + 'iPod', + 'iPhone', + 'Kindle', + { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, + 'Nexus', + 'Nook', + 'PlayBook', + 'PlayStation Vita', + 'PlayStation', + 'TouchPad', + 'Transformer', + { 'label': 'Wii U', 'pattern': 'WiiU' }, + 'Wii', + 'Xbox One', + { 'label': 'Xbox 360', 'pattern': 'Xbox' }, + 'Xoom' + ]); + + /* Detectable manufacturers. */ + var manufacturer = getManufacturer({ + 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 }, + 'Alcatel': {}, + 'Archos': {}, + 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 }, + 'Asus': { 'Transformer': 1 }, + 'Barnes & Noble': { 'Nook': 1 }, + 'BlackBerry': { 'PlayBook': 1 }, + 'Google': { 'Google TV': 1, 'Nexus': 1 }, + 'HP': { 'TouchPad': 1 }, + 'HTC': {}, + 'Huawei': {}, + 'Lenovo': {}, + 'LG': {}, + 'Microsoft': { 'Xbox': 1, 'Xbox One': 1 }, + 'Motorola': { 'Xoom': 1 }, + 'Nintendo': { 'Wii U': 1, 'Wii': 1 }, + 'Nokia': { 'Lumia': 1 }, + 'Oppo': {}, + 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 }, + 'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 }, + 'Xiaomi': { 'Mi': 1, 'Redmi': 1 } + }); + + /* Detectable operating systems (order is important). */ + var os = getOS([ + 'Windows Phone', + 'KaiOS', + 'Android', + 'CentOS', + { 'label': 'Chrome OS', 'pattern': 'CrOS' }, + 'Debian', + { 'label': 'DragonFly BSD', 'pattern': 'DragonFly' }, + 'Fedora', + 'FreeBSD', + 'Gentoo', + 'Haiku', + 'Kubuntu', + 'Linux Mint', + 'OpenBSD', + 'Red Hat', + 'SuSE', + 'Ubuntu', + 'Xubuntu', + 'Cygwin', + 'Symbian OS', + 'hpwOS', + 'webOS ', + 'webOS', + 'Tablet OS', + 'Tizen', + 'Linux', + 'Mac OS X', + 'Macintosh', + 'Mac', + 'Windows 98;', + 'Windows ' + ]); + + /*------------------------------------------------------------------------*/ + + /** + * Picks the layout engine from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected layout engine. + */ + function getLayout(guesses) { + return reduce(guesses, function(result, guess) { + return result || RegExp('\\b' + ( + guess.pattern || qualify(guess) + ) + '\\b', 'i').exec(ua) && (guess.label || guess); + }); + } + + /** + * Picks the manufacturer from an array of guesses. + * + * @private + * @param {Array} guesses An object of guesses. + * @returns {null|string} The detected manufacturer. + */ + function getManufacturer(guesses) { + return reduce(guesses, function(result, value, key) { + // Lookup the manufacturer by product or scan the UA for the manufacturer. + return result || ( + value[product] || + value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || + RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua) + ) && key; + }); + } + + /** + * Picks the browser name from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected browser name. + */ + function getName(guesses) { + return reduce(guesses, function(result, guess) { + return result || RegExp('\\b' + ( + guess.pattern || qualify(guess) + ) + '\\b', 'i').exec(ua) && (guess.label || guess); + }); + } + + /** + * Picks the OS name from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected OS name. + */ + function getOS(guesses) { + return reduce(guesses, function(result, guess) { + var pattern = guess.pattern || qualify(guess); + if (!result && (result = + RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua) + )) { + result = cleanupOS(result, pattern, guess.label || guess); + } + return result; + }); + } + + /** + * Picks the product name from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected product name. + */ + function getProduct(guesses) { + return reduce(guesses, function(result, guess) { + var pattern = guess.pattern || qualify(guess); + if (!result && (result = + RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || + RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) || + RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua) + )) { + // Split by forward slash and append product version if needed. + if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) { + result[0] += ' ' + result[1]; + } + // Correct character case and cleanup string. + guess = guess.label || guess; + result = format(result[0] + .replace(RegExp(pattern, 'i'), guess) + .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ') + .replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2')); + } + return result; + }); + } + + /** + * Resolves the version using an array of UA patterns. + * + * @private + * @param {Array} patterns An array of UA patterns. + * @returns {null|string} The detected version. + */ + function getVersion(patterns) { + return reduce(patterns, function(result, pattern) { + return result || (RegExp(pattern + + '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null; + }); + } + + /** + * Returns `platform.description` when the platform object is coerced to a string. + * + * @name toString + * @memberOf platform + * @returns {string} Returns `platform.description` if available, else an empty string. + */ + function toStringPlatform() { + return this.description || ''; + } + + /*------------------------------------------------------------------------*/ + + // Convert layout to an array so we can add extra details. + layout && (layout = [layout]); + + // Detect Android products. + // Browsers on Android devices typically provide their product IDS after "Android;" + // up to "Build" or ") AppleWebKit". + // Example: + // "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36 + // (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36" + if (/\bAndroid\b/.test(os) && !product && + (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) { + product = trim(data[1]) + // Replace any language codes (eg. "en-US"). + .replace(/^[a-z]{2}-[a-z]{2};\s*/i, '') + || null; + } + // Detect product names that contain their manufacturer's name. + if (manufacturer && !product) { + product = getProduct([manufacturer]); + } else if (manufacturer && product) { + product = product + .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ') + .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2'); + } + // Clean up Google TV. + if ((data = /\bGoogle TV\b/.exec(product))) { + product = data[0]; + } + // Detect simulators. + if (/\bSimulator\b/i.test(ua)) { + product = (product ? product + ' ' : '') + 'Simulator'; + } + // Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS. + if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) { + description.push('running in Turbo/Uncompressed mode'); + } + // Detect IE Mobile 11. + if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) { + data = parse(ua.replace(/like iPhone OS/, '')); + manufacturer = data.manufacturer; + product = data.product; + } + // Detect iOS. + else if (/^iP/.test(product)) { + name || (name = 'Safari'); + os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua)) + ? ' ' + data[1].replace(/_/g, '.') + : ''); + } + // Detect Kubuntu. + else if (name == 'Konqueror' && /^Linux\b/i.test(os)) { + os = 'Kubuntu'; + } + // Detect Android browsers. + else if ((manufacturer && manufacturer != 'Google' && + ((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) || + (/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) { + name = 'Android Browser'; + os = /\bAndroid\b/.test(os) ? os : 'Android'; + } + // Detect Silk desktop/accelerated modes. + else if (name == 'Silk') { + if (!/\bMobi/i.test(ua)) { + os = 'Android'; + description.unshift('desktop mode'); + } + if (/Accelerated *= *true/i.test(ua)) { + description.unshift('accelerated'); + } + } + // Detect UC Browser speed mode. + else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) { + description.push('speed mode'); + } + // Detect PaleMoon identifying as Firefox. + else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) { + description.push('identifying as Firefox ' + data[1]); + } + // Detect Firefox OS and products running Firefox. + else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) { + os || (os = 'Firefox OS'); + product || (product = data[1]); + } + // Detect false positives for Firefox/Safari. + else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) { + // Escape the `/` for Firefox 1. + if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) { + // Clear name of false positives. + name = null; + } + // Reassign a generic name. + if ((data = product || manufacturer || os) && + (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) { + name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser'; + } + } + // Add Chrome version to description for Electron. + else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) { + description.push('Chromium ' + data); + } + // Detect non-Opera (Presto-based) versions (order is important). + if (!version) { + version = getVersion([ + '(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)', + 'Version', + qualify(name), + '(?:Firefox|Minefield|NetFront)' + ]); + } + // Detect stubborn layout engines. + if ((data = + layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' || + /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') || + /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' || + !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') || + layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront' + )) { + layout = [data]; + } + // Detect Windows Phone 7 desktop mode. + if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) { + name += ' Mobile'; + os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x'); + description.unshift('desktop mode'); + } + // Detect Windows Phone 8.x desktop mode. + else if (/\bWPDesktop\b/i.test(ua)) { + name = 'IE Mobile'; + os = 'Windows Phone 8.x'; + description.unshift('desktop mode'); + version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]); + } + // Detect IE 11 identifying as other browsers. + else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) { + if (name) { + description.push('identifying as ' + name + (version ? ' ' + version : '')); + } + name = 'IE'; + version = data[1]; + } + // Leverage environment features. + if (useFeatures) { + // Detect server-side environments. + // Rhino has a global function while others have a global object. + if (isHostType(context, 'global')) { + if (java) { + data = java.lang.System; + arch = data.getProperty('os.arch'); + os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version'); + } + if (rhino) { + try { + version = context.require('ringo/engine').version.join('.'); + name = 'RingoJS'; + } catch(e) { + if ((data = context.system) && data.global.system == context.system) { + name = 'Narwhal'; + os || (os = data[0].os || null); + } + } + if (!name) { + name = 'Rhino'; + } + } + else if ( + typeof context.process == 'object' && !context.process.browser && + (data = context.process) + ) { + if (typeof data.versions == 'object') { + if (typeof data.versions.electron == 'string') { + description.push('Node ' + data.versions.node); + name = 'Electron'; + version = data.versions.electron; + } else if (typeof data.versions.nw == 'string') { + description.push('Chromium ' + version, 'Node ' + data.versions.node); + name = 'NW.js'; + version = data.versions.nw; + } + } + if (!name) { + name = 'Node.js'; + arch = data.arch; + os = data.platform; + version = /[\d.]+/.exec(data.version); + version = version ? version[0] : null; + } + } + } + // Detect Adobe AIR. + else if (getClassOf((data = context.runtime)) == airRuntimeClass) { + name = 'Adobe AIR'; + os = data.flash.system.Capabilities.os; + } + // Detect PhantomJS. + else if (getClassOf((data = context.phantom)) == phantomClass) { + name = 'PhantomJS'; + version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch); + } + // Detect IE compatibility modes. + else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) { + // We're in compatibility mode when the Trident version + 4 doesn't + // equal the document mode. + version = [version, doc.documentMode]; + if ((data = +data[1] + 4) != version[1]) { + description.push('IE ' + version[1] + ' mode'); + layout && (layout[1] = ''); + version[1] = data; + } + version = name == 'IE' ? String(version[1].toFixed(1)) : version[0]; + } + // Detect IE 11 masking as other browsers. + else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) { + description.push('masking as ' + name + ' ' + version); + name = 'IE'; + version = '11.0'; + layout = ['Trident']; + os = 'Windows'; + } + os = os && format(os); + } + // Detect prerelease phases. + if (version && (data = + /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || + /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) || + /\bMinefield\b/i.test(ua) && 'a' + )) { + prerelease = /b/i.test(data) ? 'beta' : 'alpha'; + version = version.replace(RegExp(data + '\\+?$'), '') + + (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || ''); + } + // Detect Firefox Mobile. + if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) { + name = 'Firefox Mobile'; + } + // Obscure Maxthon's unreliable version. + else if (name == 'Maxthon' && version) { + version = version.replace(/\.[\d.]+/, '.x'); + } + // Detect Xbox 360 and Xbox One. + else if (/\bXbox\b/i.test(product)) { + if (product == 'Xbox 360') { + os = null; + } + if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) { + description.unshift('mobile mode'); + } + } + // Add mobile postfix. + else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && + (os == 'Windows CE' || /Mobi/i.test(ua))) { + name += ' Mobile'; + } + // Detect IE platform preview. + else if (name == 'IE' && useFeatures) { + try { + if (context.external === null) { + description.unshift('platform preview'); + } + } catch(e) { + description.unshift('embedded'); + } + } + // Detect BlackBerry OS version. + // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp + else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = + (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] || + version + )) { + data = [data, /BB10/.test(ua)]; + os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0]; + version = null; + } + // Detect Opera identifying/masking itself as another browser. + // http://www.opera.com/support/kb/view/843/ + else if (this != forOwn && product != 'Wii' && ( + (useFeatures && opera) || + (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) || + (name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) || + (name == 'IE' && ( + (os && !/^Win/.test(os) && version > 5.5) || + /\bWindows XP\b/.test(os) && version > 8 || + version == 8 && !/\bTrident\b/.test(ua) + )) + ) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) { + // When "identifying", the UA contains both Opera and the other browser's name. + data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : ''); + if (reOpera.test(name)) { + if (/\bIE\b/.test(data) && os == 'Mac OS') { + os = null; + } + data = 'identify' + data; + } + // When "masking", the UA contains only the other browser's name. + else { + data = 'mask' + data; + if (operaClass) { + name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2')); + } else { + name = 'Opera'; + } + if (/\bIE\b/.test(data)) { + os = null; + } + if (!useFeatures) { + version = null; + } + } + layout = ['Presto']; + description.push(data); + } + // Detect WebKit Nightly and approximate Chrome/Safari versions. + if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { + // Correct build number for numeric comparison. + // (e.g. "532.5" becomes "532.05") + data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data]; + // Nightly builds are postfixed with a "+". + if (name == 'Safari' && data[1].slice(-1) == '+') { + name = 'WebKit Nightly'; + prerelease = 'alpha'; + version = data[1].slice(0, -1); + } + // Clear incorrect browser versions. + else if (version == data[1] || + version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { + version = null; + } + // Use the full Chrome version when available. + data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1]; + // Detect Blink layout engine. + if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') { + layout = ['Blink']; + } + // Detect JavaScriptCore. + // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi + if (!useFeatures || (!likeChrome && !data[1])) { + layout && (layout[1] = 'like Safari'); + data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : '12'); + } else { + layout && (layout[1] = 'like Chrome'); + data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28'); + } + // Add the postfix of ".x" or "+" for approximate versions. + layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+')); + // Obscure version for some Safari 1-2 releases. + if (name == 'Safari' && (!version || parseInt(version) > 45)) { + version = data; + } else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) { + description.unshift('headless'); + } + } + // Detect Opera desktop modes. + if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) { + name += ' '; + description.unshift('desktop mode'); + if (data == 'zvav') { + name += 'Mini'; + version = null; + } else { + name += 'Mobile'; + } + os = os.replace(RegExp(' *' + data + '$'), ''); + } + // Detect Chrome desktop mode. + else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) { + description.unshift('desktop mode'); + name = 'Chrome Mobile'; + version = null; + + if (/\bOS X\b/.test(os)) { + manufacturer = 'Apple'; + os = 'iOS 4.3+'; + } else { + os = null; + } + } + // Newer versions of SRWare Iron uses the Chrome tag to indicate its version number. + else if (/\bSRWare Iron\b/.test(name) && !version) { + version = getVersion('Chrome'); + } + // Strip incorrect OS versions. + if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 && + ua.indexOf('/' + data + '-') > -1) { + os = trim(os.replace(data, '')); + } + // Ensure OS does not include the browser name. + if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) { + os = os.replace(RegExp(' *' + qualify(name) + ' *'), ''); + } + // Add layout engine. + if (layout && !/\b(?:Avant|Nook)\b/.test(name) && ( + /Browser|Lunascape|Maxthon/.test(name) || + name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || + /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) { + // Don't add layout details to description if they are falsey. + (data = layout[layout.length - 1]) && description.push(data); + } + // Combine contextual information. + if (description.length) { + description = ['(' + description.join('; ') + ')']; + } + // Append manufacturer to description. + if (manufacturer && product && product.indexOf(manufacturer) < 0) { + description.push('on ' + manufacturer); + } + // Append product to description. + if (product) { + description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product); + } + // Parse the OS into an object. + if (os) { + data = / ([\d.+]+)$/.exec(os); + isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/'; + os = { + 'architecture': 32, + 'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os, + 'version': data ? data[1] : null, + 'toString': function() { + var version = this.version; + return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : ''); + } + }; + } + // Add browser/OS architecture. + if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) { + if (os) { + os.architecture = 64; + os.family = os.family.replace(RegExp(' *' + data), ''); + } + if ( + name && (/\bWOW64\b/i.test(ua) || + (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) + ) { + description.unshift('32-bit'); + } + } + // Chrome 39 and above on OS X is always 64-bit. + else if ( + os && /^OS X/.test(os.family) && + name == 'Chrome' && parseFloat(version) >= 39 + ) { + os.architecture = 64; + } + + ua || (ua = null); + + /*------------------------------------------------------------------------*/ + + /** + * The platform object. + * + * @name platform + * @type Object + */ + var platform = {}; + + /** + * The platform description. + * + * @memberOf platform + * @type string|null + */ + platform.description = ua; + + /** + * The name of the browser's layout engine. + * + * The list of common layout engines include: + * "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit" + * + * @memberOf platform + * @type string|null + */ + platform.layout = layout && layout[0]; + + /** + * The name of the product's manufacturer. + * + * The list of manufacturers include: + * "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry", + * "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo", + * "Nokia", "Samsung" and "Sony" + * + * @memberOf platform + * @type string|null + */ + platform.manufacturer = manufacturer; + + /** + * The name of the browser/environment. + * + * The list of common browser names include: + * "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE", + * "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk", + * "Opera Mini" and "Opera" + * + * Mobile versions of some browsers have "Mobile" appended to their name: + * eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile" + * + * @memberOf platform + * @type string|null + */ + platform.name = name; + + /** + * The alpha/beta release indicator. + * + * @memberOf platform + * @type string|null + */ + platform.prerelease = prerelease; + + /** + * The name of the product hosting the browser. + * + * The list of common products include: + * + * "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle", + * "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer" + * + * @memberOf platform + * @type string|null + */ + platform.product = product; + + /** + * The browser's user agent string. + * + * @memberOf platform + * @type string|null + */ + platform.ua = ua; + + /** + * The browser/environment version. + * + * @memberOf platform + * @type string|null + */ + platform.version = name && version; + + /** + * The name of the operating system. + * + * @memberOf platform + * @type Object + */ + platform.os = os || { + + /** + * The CPU architecture the OS is built for. + * + * @memberOf platform.os + * @type number|null + */ + 'architecture': null, + + /** + * The family of the OS. + * + * Common values include: + * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista", + * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat", + * "SuSE", "Android", "iOS" and "Windows Phone" + * + * @memberOf platform.os + * @type string|null + */ + 'family': null, + + /** + * The version of the OS. + * + * @memberOf platform.os + * @type string|null + */ + 'version': null, + + /** + * Returns the OS string. + * + * @memberOf platform.os + * @returns {string} The OS string. + */ + 'toString': function() { return 'null'; } + }; + + platform.parse = parse; + platform.toString = toStringPlatform; + + if (platform.version) { + description.unshift(version); + } + if (platform.name) { + description.unshift(name); + } + if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) { + description.push(product ? '(' + os + ')' : 'on ' + os); + } + if (description.length) { + platform.description = description.join(' '); + } + return platform; + } + + /*--------------------------------------------------------------------------*/ + + // Export platform. + var platform = parse(); + + // Some AMD build optimizers, like r.js, check for condition patterns like the following: + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose platform on the global object to prevent errors when platform is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + root.platform = platform; + + // Define as an anonymous module so platform can be aliased through path mapping. + define(function() { + return platform; + }); + } + // Check for `exports` after `define` in case a build optimizer adds an `exports` object. + else if (freeExports && freeModule) { + // Export for CommonJS support. + forOwn(platform, function(value, key) { + freeExports[key] = value; + }); + } + else { + // Export to the global object. + root.platform = platform; + } +}.call(this)); diff --git a/node_modules/process-nextick-args/index.js b/node_modules/process-nextick-args/index.js new file mode 100644 index 0000000..3eecf11 --- /dev/null +++ b/node_modules/process-nextick-args/index.js @@ -0,0 +1,45 @@ +'use strict'; + +if (typeof process === 'undefined' || + !process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + diff --git a/node_modules/process-nextick-args/license.md b/node_modules/process-nextick-args/license.md new file mode 100644 index 0000000..c67e353 --- /dev/null +++ b/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** diff --git a/node_modules/process-nextick-args/package.json b/node_modules/process-nextick-args/package.json new file mode 100644 index 0000000..6070b72 --- /dev/null +++ b/node_modules/process-nextick-args/package.json @@ -0,0 +1,25 @@ +{ + "name": "process-nextick-args", + "version": "2.0.1", + "description": "process.nextTick but always with args", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "devDependencies": { + "tap": "~0.2.6" + } +} diff --git a/node_modules/process-nextick-args/readme.md b/node_modules/process-nextick-args/readme.md new file mode 100644 index 0000000..ecb432c --- /dev/null +++ b/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var pna = require('process-nextick-args'); + +pna.nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/node_modules/process-on-spawn/CHANGELOG.md b/node_modules/process-on-spawn/CHANGELOG.md new file mode 100644 index 0000000..357cbe6 --- /dev/null +++ b/node_modules/process-on-spawn/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [1.1.0](https://github.com/cfware/process-on-spawn/compare/v1.0.0...v1.1.0) (2024-11-13) + + +### Features + +* add types ([#12](https://github.com/cfware/process-on-spawn/issues/12)) ([821d4f4](https://github.com/cfware/process-on-spawn/commit/821d4f4edec41b778fc8428d9f38bbd25717e885)) + +## 1.0.0 (2019-12-16) + + +### Features + +* Initial implementation ([39123b4](https://github.com/cfware/process-on-spawn/commit/39123b4ec06d8f9a22a0b19bbf955ab9e80fa376)) diff --git a/node_modules/process-on-spawn/LICENSE b/node_modules/process-on-spawn/LICENSE new file mode 100644 index 0000000..807a18b --- /dev/null +++ b/node_modules/process-on-spawn/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 CFWare, LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/process-on-spawn/README.md b/node_modules/process-on-spawn/README.md new file mode 100644 index 0000000..3977442 --- /dev/null +++ b/node_modules/process-on-spawn/README.md @@ -0,0 +1,61 @@ +# process-on-spawn + +![Tests][tests-status] +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![MIT][license-image]](LICENSE) + +Execute callbacks when child processes are spawned. + +## Usage + +```js +'use strict'; + +const processOnSpawn = require('process-on-spawn'); +processOnSpawn.addListener(opts => { + opts.env.CHILD_VARIABLE = 'value'; +}); +``` + +### listener(opts) + +* `options` \<[Object]\> + * `execPath` \<[string]\> The command to run. + * `args` \<[string\[\]][string]\> Arguments of the child process. + * `cwd` \<[string]\> Current working directory of the child process. + * `detached` \<[boolean]\> The child will be prepared to run independently of its parent process. + * `uid` \<[number]\> The user identity to be used by the child. + * `gid` \<[number]\> The group identity to be used by the child. + * `windowsVerbatimArguments` \<[boolean]\> No quoting or escaping of arguments will be done on Windows. + * `windowsHide` \<[boolean]\> The subprocess console window that would normally be created on Windows systems will be hidden. + +All properties except `env` are read-only. + +### processOnSpawn.addListener(listener) + +Add a listener to be called after any listeners already attached. + +### processOnSpawn.prependListener(listener) + +Insert a listener to be called before any listeners already attached. + +### processOnSpawn.removeListener(listener) + +Remove the specified listener. If the listener was added multiple times only +the first is removed. + +### processOnSpawn.removeAllListeners() + +Remove all attached listeners. + +[npm-image]: https://img.shields.io/npm/v/process-on-spawn.svg +[npm-url]: https://npmjs.org/package/process-on-spawn +[tests-status]: https://github.com/cfware/process-on-spawn/workflows/Tests/badge.svg +[downloads-image]: https://img.shields.io/npm/dm/process-on-spawn.svg +[downloads-url]: https://npmjs.org/package/process-on-spawn +[license-image]: https://img.shields.io/npm/l/process-on-spawn.svg +[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object +[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type +[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type +[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type diff --git a/node_modules/process-on-spawn/index.d.ts b/node_modules/process-on-spawn/index.d.ts new file mode 100644 index 0000000..3a6e7ff --- /dev/null +++ b/node_modules/process-on-spawn/index.d.ts @@ -0,0 +1,19 @@ +/// +export namespace ProcessOnSpawn { + export interface SpawnOptions { + env: NodeJS.ProcessEnv + cwd: string + execPath: string + args: ReadonlyArray + detached: boolean + uid?: number + gid?: number + windowsVerbatimArguments: boolean + windowsHide: boolean + } + export type Handler = (opts: SpawnOptions) => any +} +export function addListener(fn: ProcessOnSpawn.Handler): void +export function prependListener(fn: ProcessOnSpawn.Handler): void +export function removeListener(fn: ProcessOnSpawn.Handler): void +export function removeAllListeners(): void diff --git a/node_modules/process-on-spawn/index.js b/node_modules/process-on-spawn/index.js new file mode 100644 index 0000000..1dfaa26 --- /dev/null +++ b/node_modules/process-on-spawn/index.js @@ -0,0 +1,114 @@ +'use strict'; + +/* Drop this dependency once node.js 12 is required. */ +const fromEntries = require('fromentries'); + +const state = getState(1); + +function getState(version) { + const stateId = Symbol.for('process-on-spawn@*:singletonId'); + + if (stateId in global === false) { + /* Hopefully version and unwrap forward compatibility is never actually needed */ + Object.defineProperty(global, stateId, { + writable: true, + value: { + version, + listeners: [], + unwrap: wrapSpawnFunctions() + } + }); + } + + return global[stateId]; +} + +function wrappedSpawnFunction(fn) { + return function (options) { + let env = fromEntries( + options.envPairs.map(nvp => nvp.split(/^([^=]*)=/).slice(1)) + ); + + const opts = Object.create(null, { + env: { + enumerable: true, + get() { + return env; + }, + set(value) { + if (!value || typeof value !== 'object') { + throw new TypeError('env must be an object'); + } + + env = value; + } + }, + cwd: { + enumerable: true, + get() { + return options.cwd || process.cwd(); + } + } + }); + + const args = [...options.args]; + Object.freeze(args); + Object.assign(opts, { + execPath: options.file, + args, + detached: Boolean(options.detached), + uid: options.uid, + gid: options.gid, + windowsVerbatimArguments: Boolean(options.windowsVerbatimArguments), + windowsHide: Boolean(options.windowsHide) + }); + Object.freeze(opts); + + state.listeners.forEach(listener => { + listener(opts); + }); + + options.envPairs = Object.entries(opts.env).map(([name, value]) => `${name}=${value}`); + + return fn.call(this, options); + }; +} + +function wrapSpawnFunctions() { + const {ChildProcess} = require('child_process'); + + /* eslint-disable-next-line node/no-deprecated-api */ + const spawnSyncBinding = process.binding('spawn_sync'); + const originalSync = spawnSyncBinding.spawn; + const originalAsync = ChildProcess.prototype.spawn; + + spawnSyncBinding.spawn = wrappedSpawnFunction(spawnSyncBinding.spawn); + ChildProcess.prototype.spawn = wrappedSpawnFunction(ChildProcess.prototype.spawn); + + /* istanbul ignore next: forward compatibility code */ + /* c8 ignore next */ + return () => { + /* c8 ignore next */ + spawnSyncBinding.spawn = originalSync; + /* c8 ignore next */ + ChildProcess.prototype.spawn = originalAsync; + }; +} + +module.exports = { + addListener(listener) { + state.listeners.push(listener); + }, + prependListener(listener) { + state.listeners.unshift(listener); + }, + removeListener(listener) { + const idx = state.listeners.indexOf(listener); + if (idx !== -1) { + state.listeners.splice(idx, 1); + } + }, + removeAllListeners() { + state.listeners = []; + } +}; diff --git a/node_modules/process-on-spawn/package.json b/node_modules/process-on-spawn/package.json new file mode 100644 index 0000000..dcf05d2 --- /dev/null +++ b/node_modules/process-on-spawn/package.json @@ -0,0 +1,42 @@ +{ + "name": "process-on-spawn", + "version": "1.1.0", + "description": "Execute callbacks when child processes are spawned", + "scripts": { + "release": "standard-version --sign", + "pretest": "xo", + "tests-only": "c8 --no-check-coverage -r none tape test/test.js | tap-min", + "test": "npm run -s tests-only", + "posttest": "if-ver -ge 10 || exit 0; c8 report" + }, + "engines": { + "node": ">=8" + }, + "author": "Corey Farrell", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/cfware/process-on-spawn.git" + }, + "bugs": { + "url": "https://github.com/cfware/process-on-spawn/issues" + }, + "homepage": "https://github.com/cfware/process-on-spawn#readme", + "xo": { + "rules": { + "capitalized-comments": 0 + } + }, + "dependencies": { + "fromentries": "^1.2.0" + }, + "devDependencies": { + "@types/node": "^20.1.3", + "c8": "^7.0.0", + "if-ver": "^1.1.0", + "standard-version": "^8.0.0", + "tap-min": "^2.0.0", + "tape": "^5.0.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/proxy-addr/HISTORY.md b/node_modules/proxy-addr/HISTORY.md new file mode 100644 index 0000000..8480242 --- /dev/null +++ b/node_modules/proxy-addr/HISTORY.md @@ -0,0 +1,161 @@ +2.0.7 / 2021-05-31 +================== + + * deps: forwarded@0.2.0 + - Use `req.socket` over deprecated `req.connection` + +2.0.6 / 2020-02-24 +================== + + * deps: ipaddr.js@1.9.1 + +2.0.5 / 2019-04-16 +================== + + * deps: ipaddr.js@1.9.0 + +2.0.4 / 2018-07-26 +================== + + * deps: ipaddr.js@1.8.0 + +2.0.3 / 2018-02-19 +================== + + * deps: ipaddr.js@1.6.0 + +2.0.2 / 2017-09-24 +================== + + * deps: forwarded@~0.1.2 + - perf: improve header parsing + - perf: reduce overhead when no `X-Forwarded-For` header + +2.0.1 / 2017-09-10 +================== + + * deps: forwarded@~0.1.1 + - Fix trimming leading / trailing OWS + - perf: hoist regular expression + * deps: ipaddr.js@1.5.2 + +2.0.0 / 2017-08-08 +================== + + * Drop support for Node.js below 0.10 + +1.1.5 / 2017-07-25 +================== + + * Fix array argument being altered + * deps: ipaddr.js@1.4.0 + +1.1.4 / 2017-03-24 +================== + + * deps: ipaddr.js@1.3.0 + +1.1.3 / 2017-01-14 +================== + + * deps: ipaddr.js@1.2.0 + +1.1.2 / 2016-05-29 +================== + + * deps: ipaddr.js@1.1.1 + - Fix IPv6-mapped IPv4 validation edge cases + +1.1.1 / 2016-05-03 +================== + + * Fix regression matching mixed versions against multiple subnets + +1.1.0 / 2016-05-01 +================== + + * Fix accepting various invalid netmasks + - IPv4 netmasks must be contingous + - IPv6 addresses cannot be used as a netmask + * deps: ipaddr.js@1.1.0 + +1.0.10 / 2015-12-09 +=================== + + * deps: ipaddr.js@1.0.5 + - Fix regression in `isValid` with non-string arguments + +1.0.9 / 2015-12-01 +================== + + * deps: ipaddr.js@1.0.4 + - Fix accepting some invalid IPv6 addresses + - Reject CIDRs with negative or overlong masks + * perf: enable strict mode + +1.0.8 / 2015-05-10 +================== + + * deps: ipaddr.js@1.0.1 + +1.0.7 / 2015-03-16 +================== + + * deps: ipaddr.js@0.1.9 + - Fix OOM on certain inputs to `isValid` + +1.0.6 / 2015-02-01 +================== + + * deps: ipaddr.js@0.1.8 + +1.0.5 / 2015-01-08 +================== + + * deps: ipaddr.js@0.1.6 + +1.0.4 / 2014-11-23 +================== + + * deps: ipaddr.js@0.1.5 + - Fix edge cases with `isValid` + +1.0.3 / 2014-09-21 +================== + + * Use `forwarded` npm module + +1.0.2 / 2014-09-18 +================== + + * Fix a global leak when multiple subnets are trusted + * Support Node.js 0.6 + * deps: ipaddr.js@0.1.3 + +1.0.1 / 2014-06-03 +================== + + * Fix links in npm package + +1.0.0 / 2014-05-08 +================== + + * Add `trust` argument to determine proxy trust on + * Accepts custom function + * Accepts IPv4/IPv6 address(es) + * Accepts subnets + * Accepts pre-defined names + * Add optional `trust` argument to `proxyaddr.all` to + stop at first untrusted + * Add `proxyaddr.compile` to pre-compile `trust` function + to make subsequent calls faster + +0.0.1 / 2014-05-04 +================== + + * Fix bad npm publish + +0.0.0 / 2014-05-04 +================== + + * Initial release diff --git a/node_modules/proxy-addr/LICENSE b/node_modules/proxy-addr/LICENSE new file mode 100644 index 0000000..cab251c --- /dev/null +++ b/node_modules/proxy-addr/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/proxy-addr/README.md b/node_modules/proxy-addr/README.md new file mode 100644 index 0000000..69c0b63 --- /dev/null +++ b/node_modules/proxy-addr/README.md @@ -0,0 +1,139 @@ +# proxy-addr + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Determine address of proxied request + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install proxy-addr +``` + +## API + +```js +var proxyaddr = require('proxy-addr') +``` + +### proxyaddr(req, trust) + +Return the address of the request, using the given `trust` parameter. + +The `trust` argument is a function that returns `true` if you trust +the address, `false` if you don't. The closest untrusted address is +returned. + +```js +proxyaddr(req, function (addr) { return addr === '127.0.0.1' }) +proxyaddr(req, function (addr, i) { return i < 1 }) +``` + +The `trust` arugment may also be a single IP address string or an +array of trusted addresses, as plain IP addresses, CIDR-formatted +strings, or IP/netmask strings. + +```js +proxyaddr(req, '127.0.0.1') +proxyaddr(req, ['127.0.0.0/8', '10.0.0.0/8']) +proxyaddr(req, ['127.0.0.0/255.0.0.0', '192.168.0.0/255.255.0.0']) +``` + +This module also supports IPv6. Your IPv6 addresses will be normalized +automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`). + +```js +proxyaddr(req, '::1') +proxyaddr(req, ['::1/128', 'fe80::/10']) +``` + +This module will automatically work with IPv4-mapped IPv6 addresses +as well to support node.js in IPv6-only mode. This means that you do +not have to specify both `::ffff:a00:1` and `10.0.0.1`. + +As a convenience, this module also takes certain pre-defined names +in addition to IP addresses, which expand into IP addresses: + +```js +proxyaddr(req, 'loopback') +proxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64']) +``` + + * `loopback`: IPv4 and IPv6 loopback addresses (like `::1` and + `127.0.0.1`). + * `linklocal`: IPv4 and IPv6 link-local addresses (like + `fe80::1:1:1:1` and `169.254.0.1`). + * `uniquelocal`: IPv4 private addresses and IPv6 unique-local + addresses (like `fc00:ac:1ab5:fff::1` and `192.168.0.1`). + +When `trust` is specified as a function, it will be called for each +address to determine if it is a trusted address. The function is +given two arguments: `addr` and `i`, where `addr` is a string of +the address to check and `i` is a number that represents the distance +from the socket address. + +### proxyaddr.all(req, [trust]) + +Return all the addresses of the request, optionally stopping at the +first untrusted. This array is ordered from closest to furthest +(i.e. `arr[0] === req.connection.remoteAddress`). + +```js +proxyaddr.all(req) +``` + +The optional `trust` argument takes the same arguments as `trust` +does in `proxyaddr(req, trust)`. + +```js +proxyaddr.all(req, 'loopback') +``` + +### proxyaddr.compile(val) + +Compiles argument `val` into a `trust` function. This function takes +the same arguments as `trust` does in `proxyaddr(req, trust)` and +returns a function suitable for `proxyaddr(req, trust)`. + +```js +var trust = proxyaddr.compile('loopback') +var addr = proxyaddr(req, trust) +``` + +This function is meant to be optimized for use against every request. +It is recommend to compile a trust function up-front for the trusted +configuration and pass that to `proxyaddr(req, trust)` for each request. + +## Testing + +```sh +$ npm test +``` + +## Benchmarks + +```sh +$ npm run-script bench +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/proxy-addr/master?label=ci +[ci-url]: https://github.com/jshttp/proxy-addr/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/proxy-addr/master +[coveralls-url]: https://coveralls.io/r/jshttp/proxy-addr?branch=master +[node-image]: https://badgen.net/npm/node/proxy-addr +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/proxy-addr +[npm-url]: https://npmjs.org/package/proxy-addr +[npm-version-image]: https://badgen.net/npm/v/proxy-addr diff --git a/node_modules/proxy-addr/index.js b/node_modules/proxy-addr/index.js new file mode 100644 index 0000000..a909b05 --- /dev/null +++ b/node_modules/proxy-addr/index.js @@ -0,0 +1,327 @@ +/*! + * proxy-addr + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = proxyaddr +module.exports.all = alladdrs +module.exports.compile = compile + +/** + * Module dependencies. + * @private + */ + +var forwarded = require('forwarded') +var ipaddr = require('ipaddr.js') + +/** + * Variables. + * @private + */ + +var DIGIT_REGEXP = /^[0-9]+$/ +var isip = ipaddr.isValid +var parseip = ipaddr.parse + +/** + * Pre-defined IP ranges. + * @private + */ + +var IP_RANGES = { + linklocal: ['169.254.0.0/16', 'fe80::/10'], + loopback: ['127.0.0.1/8', '::1/128'], + uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7'] +} + +/** + * Get all addresses in the request, optionally stopping + * at the first untrusted. + * + * @param {Object} request + * @param {Function|Array|String} [trust] + * @public + */ + +function alladdrs (req, trust) { + // get addresses + var addrs = forwarded(req) + + if (!trust) { + // Return all addresses + return addrs + } + + if (typeof trust !== 'function') { + trust = compile(trust) + } + + for (var i = 0; i < addrs.length - 1; i++) { + if (trust(addrs[i], i)) continue + + addrs.length = i + 1 + } + + return addrs +} + +/** + * Compile argument into trust function. + * + * @param {Array|String} val + * @private + */ + +function compile (val) { + if (!val) { + throw new TypeError('argument is required') + } + + var trust + + if (typeof val === 'string') { + trust = [val] + } else if (Array.isArray(val)) { + trust = val.slice() + } else { + throw new TypeError('unsupported trust argument') + } + + for (var i = 0; i < trust.length; i++) { + val = trust[i] + + if (!Object.prototype.hasOwnProperty.call(IP_RANGES, val)) { + continue + } + + // Splice in pre-defined range + val = IP_RANGES[val] + trust.splice.apply(trust, [i, 1].concat(val)) + i += val.length - 1 + } + + return compileTrust(compileRangeSubnets(trust)) +} + +/** + * Compile `arr` elements into range subnets. + * + * @param {Array} arr + * @private + */ + +function compileRangeSubnets (arr) { + var rangeSubnets = new Array(arr.length) + + for (var i = 0; i < arr.length; i++) { + rangeSubnets[i] = parseipNotation(arr[i]) + } + + return rangeSubnets +} + +/** + * Compile range subnet array into trust function. + * + * @param {Array} rangeSubnets + * @private + */ + +function compileTrust (rangeSubnets) { + // Return optimized function based on length + var len = rangeSubnets.length + return len === 0 + ? trustNone + : len === 1 + ? trustSingle(rangeSubnets[0]) + : trustMulti(rangeSubnets) +} + +/** + * Parse IP notation string into range subnet. + * + * @param {String} note + * @private + */ + +function parseipNotation (note) { + var pos = note.lastIndexOf('/') + var str = pos !== -1 + ? note.substring(0, pos) + : note + + if (!isip(str)) { + throw new TypeError('invalid IP address: ' + str) + } + + var ip = parseip(str) + + if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) { + // Store as IPv4 + ip = ip.toIPv4Address() + } + + var max = ip.kind() === 'ipv6' + ? 128 + : 32 + + var range = pos !== -1 + ? note.substring(pos + 1, note.length) + : null + + if (range === null) { + range = max + } else if (DIGIT_REGEXP.test(range)) { + range = parseInt(range, 10) + } else if (ip.kind() === 'ipv4' && isip(range)) { + range = parseNetmask(range) + } else { + range = null + } + + if (range <= 0 || range > max) { + throw new TypeError('invalid range on address: ' + note) + } + + return [ip, range] +} + +/** + * Parse netmask string into CIDR range. + * + * @param {String} netmask + * @private + */ + +function parseNetmask (netmask) { + var ip = parseip(netmask) + var kind = ip.kind() + + return kind === 'ipv4' + ? ip.prefixLengthFromSubnetMask() + : null +} + +/** + * Determine address of proxied request. + * + * @param {Object} request + * @param {Function|Array|String} trust + * @public + */ + +function proxyaddr (req, trust) { + if (!req) { + throw new TypeError('req argument is required') + } + + if (!trust) { + throw new TypeError('trust argument is required') + } + + var addrs = alladdrs(req, trust) + var addr = addrs[addrs.length - 1] + + return addr +} + +/** + * Static trust function to trust nothing. + * + * @private + */ + +function trustNone () { + return false +} + +/** + * Compile trust function for multiple subnets. + * + * @param {Array} subnets + * @private + */ + +function trustMulti (subnets) { + return function trust (addr) { + if (!isip(addr)) return false + + var ip = parseip(addr) + var ipconv + var kind = ip.kind() + + for (var i = 0; i < subnets.length; i++) { + var subnet = subnets[i] + var subnetip = subnet[0] + var subnetkind = subnetip.kind() + var subnetrange = subnet[1] + var trusted = ip + + if (kind !== subnetkind) { + if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + continue + } + + if (!ipconv) { + // Convert IP to match subnet IP kind + ipconv = subnetkind === 'ipv4' + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress() + } + + trusted = ipconv + } + + if (trusted.match(subnetip, subnetrange)) { + return true + } + } + + return false + } +} + +/** + * Compile trust function for single subnet. + * + * @param {Object} subnet + * @private + */ + +function trustSingle (subnet) { + var subnetip = subnet[0] + var subnetkind = subnetip.kind() + var subnetisipv4 = subnetkind === 'ipv4' + var subnetrange = subnet[1] + + return function trust (addr) { + if (!isip(addr)) return false + + var ip = parseip(addr) + var kind = ip.kind() + + if (kind !== subnetkind) { + if (subnetisipv4 && !ip.isIPv4MappedAddress()) { + // Incompatible IP addresses + return false + } + + // Convert IP to match subnet IP kind + ip = subnetisipv4 + ? ip.toIPv4Address() + : ip.toIPv4MappedAddress() + } + + return ip.match(subnetip, subnetrange) + } +} diff --git a/node_modules/proxy-addr/package.json b/node_modules/proxy-addr/package.json new file mode 100644 index 0000000..24ba8f7 --- /dev/null +++ b/node_modules/proxy-addr/package.json @@ -0,0 +1,47 @@ +{ + "name": "proxy-addr", + "description": "Determine address of proxied request", + "version": "2.0.7", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "ip", + "proxy", + "x-forwarded-for" + ], + "repository": "jshttp/proxy-addr", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "devDependencies": { + "benchmark": "2.1.4", + "beautify-benchmark": "0.2.4", + "deep-equal": "1.0.1", + "eslint": "7.26.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.23.4", + "eslint-plugin-markdown": "2.2.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "8.4.0", + "nyc": "15.1.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.10" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/proxy-from-env/.eslintrc b/node_modules/proxy-from-env/.eslintrc new file mode 100644 index 0000000..a51449b --- /dev/null +++ b/node_modules/proxy-from-env/.eslintrc @@ -0,0 +1,29 @@ +{ + "env": { + "node": true + }, + "rules": { + "array-bracket-spacing": [2, "never"], + "block-scoped-var": 2, + "brace-style": [2, "1tbs"], + "camelcase": 1, + "computed-property-spacing": [2, "never"], + "curly": 2, + "eol-last": 2, + "eqeqeq": [2, "smart"], + "max-depth": [1, 3], + "max-len": [1, 80], + "max-statements": [1, 15], + "new-cap": 1, + "no-extend-native": 2, + "no-mixed-spaces-and-tabs": 2, + "no-trailing-spaces": 2, + "no-unused-vars": 1, + "no-use-before-define": [2, "nofunc"], + "object-curly-spacing": [2, "never"], + "quotes": [2, "single", "avoid-escape"], + "semi": [2, "always"], + "keyword-spacing": [2, {"before": true, "after": true}], + "space-unary-ops": 2 + } +} diff --git a/node_modules/proxy-from-env/.travis.yml b/node_modules/proxy-from-env/.travis.yml new file mode 100644 index 0000000..64a05f9 --- /dev/null +++ b/node_modules/proxy-from-env/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - node + - lts/* +script: + - npm run lint + # test-coverage will also run the tests, but does not print helpful output upon test failure. + # So we also run the tests separately. + - npm run test + - npm run test-coverage && cat coverage/lcov.info | ./node_modules/.bin/coveralls && rm -rf coverage diff --git a/node_modules/proxy-from-env/LICENSE b/node_modules/proxy-from-env/LICENSE new file mode 100644 index 0000000..8f25097 --- /dev/null +++ b/node_modules/proxy-from-env/LICENSE @@ -0,0 +1,20 @@ +The MIT License + +Copyright (C) 2016-2018 Rob Wu + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/proxy-from-env/README.md b/node_modules/proxy-from-env/README.md new file mode 100644 index 0000000..e82520c --- /dev/null +++ b/node_modules/proxy-from-env/README.md @@ -0,0 +1,131 @@ +# proxy-from-env + +[![Build Status](https://travis-ci.org/Rob--W/proxy-from-env.svg?branch=master)](https://travis-ci.org/Rob--W/proxy-from-env) +[![Coverage Status](https://coveralls.io/repos/github/Rob--W/proxy-from-env/badge.svg?branch=master)](https://coveralls.io/github/Rob--W/proxy-from-env?branch=master) + +`proxy-from-env` is a Node.js package that exports a function (`getProxyForUrl`) +that takes an input URL (a string or +[`url.parse`](https://nodejs.org/docs/latest/api/url.html#url_url_parsing)'s +return value) and returns the desired proxy URL (also a string) based on +standard proxy environment variables. If no proxy is set, an empty string is +returned. + +It is your responsibility to actually proxy the request using the given URL. + +Installation: + +```sh +npm install proxy-from-env +``` + +## Example +This example shows how the data for a URL can be fetched via the +[`http` module](https://nodejs.org/api/http.html), in a proxy-aware way. + +```javascript +var http = require('http'); +var parseUrl = require('url').parse; +var getProxyForUrl = require('proxy-from-env').getProxyForUrl; + +var some_url = 'http://example.com/something'; + +// // Example, if there is a proxy server at 10.0.0.1:1234, then setting the +// // http_proxy environment variable causes the request to go through a proxy. +// process.env.http_proxy = 'http://10.0.0.1:1234'; +// +// // But if the host to be proxied is listed in NO_PROXY, then the request is +// // not proxied (but a direct request is made). +// process.env.no_proxy = 'example.com'; + +var proxy_url = getProxyForUrl(some_url); // <-- Our magic. +if (proxy_url) { + // Should be proxied through proxy_url. + var parsed_some_url = parseUrl(some_url); + var parsed_proxy_url = parseUrl(proxy_url); + // A HTTP proxy is quite simple. It is similar to a normal request, except the + // path is an absolute URL, and the proxied URL's host is put in the header + // instead of the server's actual host. + httpOptions = { + protocol: parsed_proxy_url.protocol, + hostname: parsed_proxy_url.hostname, + port: parsed_proxy_url.port, + path: parsed_some_url.href, + headers: { + Host: parsed_some_url.host, // = host name + optional port. + }, + }; +} else { + // Direct request. + httpOptions = some_url; +} +http.get(httpOptions, function(res) { + var responses = []; + res.on('data', function(chunk) { responses.push(chunk); }); + res.on('end', function() { console.log(responses.join('')); }); +}); + +``` + +## Environment variables +The environment variables can be specified in lowercase or uppercase, with the +lowercase name having precedence over the uppercase variant. A variable that is +not set has the same meaning as a variable that is set but has no value. + +### NO\_PROXY + +`NO_PROXY` is a list of host names (optionally with a port). If the input URL +matches any of the entries in `NO_PROXY`, then the input URL should be fetched +by a direct request (i.e. without a proxy). + +Matching follows the following rules: + +- `NO_PROXY=*` disables all proxies. +- Space and commas may be used to separate the entries in the `NO_PROXY` list. +- If `NO_PROXY` does not contain any entries, then proxies are never disabled. +- If a port is added after the host name, then the ports must match. If the URL + does not have an explicit port name, the protocol's default port is used. +- Generally, the proxy is only disabled if the host name is an exact match for + an entry in the `NO_PROXY` list. The only exceptions are entries that start + with a dot or with a wildcard; then the proxy is disabled if the host name + ends with the entry. + +See `test.js` for examples of what should match and what does not. + +### \*\_PROXY + +The environment variable used for the proxy depends on the protocol of the URL. +For example, `https://example.com` uses the "https" protocol, and therefore the +proxy to be used is `HTTPS_PROXY` (_NOT_ `HTTP_PROXY`, which is _only_ used for +http:-URLs). + +The library is not limited to http(s), other schemes such as +`FTP_PROXY` (ftp:), +`WSS_PROXY` (wss:), +`WS_PROXY` (ws:) +are also supported. + +If present, `ALL_PROXY` is used as fallback if there is no other match. + + +## External resources +The exact way of parsing the environment variables is not codified in any +standard. This library is designed to be compatible with formats as expected by +existing software. +The following resources were used to determine the desired behavior: + +- cURL: + https://curl.haxx.se/docs/manpage.html#ENVIRONMENT + https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4446-L4514 + https://github.com/curl/curl/blob/4af40b3646d3b09f68e419f7ca866ff395d1f897/lib/url.c#L4608-L4638 + +- wget: + https://www.gnu.org/software/wget/manual/wget.html#Proxies + http://git.savannah.gnu.org/cgit/wget.git/tree/src/init.c?id=636a5f9a1c508aa39e35a3a8e9e54520a284d93d#n383 + http://git.savannah.gnu.org/cgit/wget.git/tree/src/retr.c?id=93c1517c4071c4288ba5a4b038e7634e4c6b5482#n1278 + +- W3: + https://www.w3.org/Daemon/User/Proxies/ProxyClients.html + +- Python's urllib: + https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L755-L782 + https://github.com/python/cpython/blob/936135bb97fe04223aa30ca6e98eac8f3ed6b349/Lib/urllib/request.py#L2444-L2479 diff --git a/node_modules/proxy-from-env/index.js b/node_modules/proxy-from-env/index.js new file mode 100644 index 0000000..df75004 --- /dev/null +++ b/node_modules/proxy-from-env/index.js @@ -0,0 +1,108 @@ +'use strict'; + +var parseUrl = require('url').parse; + +var DEFAULT_PORTS = { + ftp: 21, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443, +}; + +var stringEndsWith = String.prototype.endsWith || function(s) { + return s.length <= this.length && + this.indexOf(s, this.length - s.length) !== -1; +}; + +/** + * @param {string|object} url - The URL, or the result from url.parse. + * @return {string} The URL of the proxy that should handle the request to the + * given URL. If no proxy is set, this will be an empty string. + */ +function getProxyForUrl(url) { + var parsedUrl = typeof url === 'string' ? parseUrl(url) : url || {}; + var proto = parsedUrl.protocol; + var hostname = parsedUrl.host; + var port = parsedUrl.port; + if (typeof hostname !== 'string' || !hostname || typeof proto !== 'string') { + return ''; // Don't proxy URLs without a valid scheme or host. + } + + proto = proto.split(':', 1)[0]; + // Stripping ports in this way instead of using parsedUrl.hostname to make + // sure that the brackets around IPv6 addresses are kept. + hostname = hostname.replace(/:\d*$/, ''); + port = parseInt(port) || DEFAULT_PORTS[proto] || 0; + if (!shouldProxy(hostname, port)) { + return ''; // Don't proxy URLs that match NO_PROXY. + } + + var proxy = + getEnv('npm_config_' + proto + '_proxy') || + getEnv(proto + '_proxy') || + getEnv('npm_config_proxy') || + getEnv('all_proxy'); + if (proxy && proxy.indexOf('://') === -1) { + // Missing scheme in proxy, default to the requested URL's scheme. + proxy = proto + '://' + proxy; + } + return proxy; +} + +/** + * Determines whether a given URL should be proxied. + * + * @param {string} hostname - The host name of the URL. + * @param {number} port - The effective port of the URL. + * @returns {boolean} Whether the given URL should be proxied. + * @private + */ +function shouldProxy(hostname, port) { + var NO_PROXY = + (getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase(); + if (!NO_PROXY) { + return true; // Always proxy if NO_PROXY is not set. + } + if (NO_PROXY === '*') { + return false; // Never proxy if wildcard is set. + } + + return NO_PROXY.split(/[,\s]/).every(function(proxy) { + if (!proxy) { + return true; // Skip zero-length hosts. + } + var parsedProxy = proxy.match(/^(.+):(\d+)$/); + var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy; + var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0; + if (parsedProxyPort && parsedProxyPort !== port) { + return true; // Skip if ports don't match. + } + + if (!/^[.*]/.test(parsedProxyHostname)) { + // No wildcards, so stop proxying if there is an exact match. + return hostname !== parsedProxyHostname; + } + + if (parsedProxyHostname.charAt(0) === '*') { + // Remove leading wildcard. + parsedProxyHostname = parsedProxyHostname.slice(1); + } + // Stop proxying if the hostname ends with the no_proxy host. + return !stringEndsWith.call(hostname, parsedProxyHostname); + }); +} + +/** + * Get the value for an environment variable. + * + * @param {string} key - The name of the environment variable. + * @return {string} The value of the environment variable. + * @private + */ +function getEnv(key) { + return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || ''; +} + +exports.getProxyForUrl = getProxyForUrl; diff --git a/node_modules/proxy-from-env/package.json b/node_modules/proxy-from-env/package.json new file mode 100644 index 0000000..be2b845 --- /dev/null +++ b/node_modules/proxy-from-env/package.json @@ -0,0 +1,34 @@ +{ + "name": "proxy-from-env", + "version": "1.1.0", + "description": "Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.", + "main": "index.js", + "scripts": { + "lint": "eslint *.js", + "test": "mocha ./test.js --reporter spec", + "test-coverage": "istanbul cover ./node_modules/.bin/_mocha -- --reporter spec" + }, + "repository": { + "type": "git", + "url": "https://github.com/Rob--W/proxy-from-env.git" + }, + "keywords": [ + "proxy", + "http_proxy", + "https_proxy", + "no_proxy", + "environment" + ], + "author": "Rob Wu (https://robwu.nl/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/Rob--W/proxy-from-env/issues" + }, + "homepage": "https://github.com/Rob--W/proxy-from-env#readme", + "devDependencies": { + "coveralls": "^3.0.9", + "eslint": "^6.8.0", + "istanbul": "^0.4.5", + "mocha": "^7.1.0" + } +} diff --git a/node_modules/proxy-from-env/test.js b/node_modules/proxy-from-env/test.js new file mode 100644 index 0000000..abf6542 --- /dev/null +++ b/node_modules/proxy-from-env/test.js @@ -0,0 +1,483 @@ +/* eslint max-statements:0 */ +'use strict'; + +var assert = require('assert'); +var parseUrl = require('url').parse; + +var getProxyForUrl = require('./').getProxyForUrl; + +// Runs the callback with process.env temporarily set to env. +function runWithEnv(env, callback) { + var originalEnv = process.env; + process.env = env; + try { + callback(); + } finally { + process.env = originalEnv; + } +} + +// Defines a test case that checks whether getProxyForUrl(input) === expected. +function testProxyUrl(env, expected, input) { + assert(typeof env === 'object' && env !== null); + // Copy object to make sure that the in param does not get modified between + // the call of this function and the use of it below. + env = JSON.parse(JSON.stringify(env)); + + var title = 'getProxyForUrl(' + JSON.stringify(input) + ')' + + ' === ' + JSON.stringify(expected); + + // Save call stack for later use. + var stack = {}; + Error.captureStackTrace(stack, testProxyUrl); + // Only use the last stack frame because that shows where this function is + // called, and that is sufficient for our purpose. No need to flood the logs + // with an uninteresting stack trace. + stack = stack.stack.split('\n', 2)[1]; + + it(title, function() { + var actual; + runWithEnv(env, function() { + actual = getProxyForUrl(input); + }); + if (expected === actual) { + return; // Good! + } + try { + assert.strictEqual(expected, actual); // Create a formatted error message. + // Should not happen because previously we determined expected !== actual. + throw new Error('assert.strictEqual passed. This is impossible!'); + } catch (e) { + // Use the original stack trace, so we can see a helpful line number. + e.stack = e.message + stack; + throw e; + } + }); +} + +describe('getProxyForUrl', function() { + describe('No proxy variables', function() { + var env = {}; + testProxyUrl(env, '', 'http://example.com'); + testProxyUrl(env, '', 'https://example.com'); + testProxyUrl(env, '', 'ftp://example.com'); + }); + + describe('Invalid URLs', function() { + var env = {}; + env.ALL_PROXY = 'http://unexpected.proxy'; + testProxyUrl(env, '', 'bogus'); + testProxyUrl(env, '', '//example.com'); + testProxyUrl(env, '', '://example.com'); + testProxyUrl(env, '', '://'); + testProxyUrl(env, '', '/path'); + testProxyUrl(env, '', ''); + testProxyUrl(env, '', 'http:'); + testProxyUrl(env, '', 'http:/'); + testProxyUrl(env, '', 'http://'); + testProxyUrl(env, '', 'prototype://'); + testProxyUrl(env, '', 'hasOwnProperty://'); + testProxyUrl(env, '', '__proto__://'); + testProxyUrl(env, '', undefined); + testProxyUrl(env, '', null); + testProxyUrl(env, '', {}); + testProxyUrl(env, '', {host: 'x', protocol: 1}); + testProxyUrl(env, '', {host: 1, protocol: 'x'}); + }); + + describe('http_proxy and HTTP_PROXY', function() { + var env = {}; + env.HTTP_PROXY = 'http://http-proxy'; + + testProxyUrl(env, '', 'https://example'); + testProxyUrl(env, 'http://http-proxy', 'http://example'); + testProxyUrl(env, 'http://http-proxy', parseUrl('http://example')); + + // eslint-disable-next-line camelcase + env.http_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'http://example'); + }); + + describe('http_proxy with non-sensical value', function() { + var env = {}; + // Crazy values should be passed as-is. It is the responsibility of the + // one who launches the application that the value makes sense. + // TODO: Should we be stricter and perform validation? + env.HTTP_PROXY = 'Crazy \n!() { ::// }'; + testProxyUrl(env, 'Crazy \n!() { ::// }', 'http://wow'); + + // The implementation assumes that the HTTP_PROXY environment variable is + // somewhat reasonable, and if the scheme is missing, it is added. + // Garbage in, garbage out some would say... + env.HTTP_PROXY = 'crazy without colon slash slash'; + testProxyUrl(env, 'http://crazy without colon slash slash', 'http://wow'); + }); + + describe('https_proxy and HTTPS_PROXY', function() { + var env = {}; + // Assert that there is no fall back to http_proxy + env.HTTP_PROXY = 'http://unexpected.proxy'; + testProxyUrl(env, '', 'https://example'); + + env.HTTPS_PROXY = 'http://https-proxy'; + testProxyUrl(env, 'http://https-proxy', 'https://example'); + + // eslint-disable-next-line camelcase + env.https_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'https://example'); + }); + + describe('ftp_proxy', function() { + var env = {}; + // Something else than http_proxy / https, as a sanity check. + env.FTP_PROXY = 'http://ftp-proxy'; + + testProxyUrl(env, 'http://ftp-proxy', 'ftp://example'); + testProxyUrl(env, '', 'ftps://example'); + }); + + describe('all_proxy', function() { + var env = {}; + env.ALL_PROXY = 'http://catch-all'; + testProxyUrl(env, 'http://catch-all', 'https://example'); + + // eslint-disable-next-line camelcase + env.all_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'https://example'); + }); + + describe('all_proxy without scheme', function() { + var env = {}; + env.ALL_PROXY = 'noscheme'; + testProxyUrl(env, 'http://noscheme', 'http://example'); + testProxyUrl(env, 'https://noscheme', 'https://example'); + + // The module does not impose restrictions on the scheme. + testProxyUrl(env, 'bogus-scheme://noscheme', 'bogus-scheme://example'); + + // But the URL should still be valid. + testProxyUrl(env, '', 'bogus'); + }); + + describe('no_proxy empty', function() { + var env = {}; + env.HTTPS_PROXY = 'http://proxy'; + + // NO_PROXY set but empty. + env.NO_PROXY = ''; + testProxyUrl(env, 'http://proxy', 'https://example'); + + // No entries in NO_PROXY (comma). + env.NO_PROXY = ','; + testProxyUrl(env, 'http://proxy', 'https://example'); + + // No entries in NO_PROXY (whitespace). + env.NO_PROXY = ' '; + testProxyUrl(env, 'http://proxy', 'https://example'); + + // No entries in NO_PROXY (multiple whitespace / commas). + env.NO_PROXY = ',\t,,,\n, ,\r'; + testProxyUrl(env, 'http://proxy', 'https://example'); + }); + + describe('no_proxy=example (single host)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = 'example'; + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, '', 'http://example:80'); + testProxyUrl(env, '', 'http://example:0'); + testProxyUrl(env, '', 'http://example:1337'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, 'http://proxy', 'http://a.b.example'); + testProxyUrl(env, 'http://proxy', 'http://host/example'); + }); + + describe('no_proxy=sub.example (subdomain)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = 'sub.example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://example:80'); + testProxyUrl(env, 'http://proxy', 'http://example:0'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://no.sub.example'); + testProxyUrl(env, 'http://proxy', 'http://sub-example'); + testProxyUrl(env, 'http://proxy', 'http://example.sub'); + }); + + describe('no_proxy=example:80 (host + port)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = 'example:80'; + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, '', 'http://example:80'); + testProxyUrl(env, '', 'http://example:0'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, 'http://proxy', 'http://a.b.example'); + }); + + describe('no_proxy=.example (host suffix)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '.example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://example:80'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, '', 'http://sub.example:80'); + testProxyUrl(env, '', 'http://sub.example:1337'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, '', 'http://a.b.example'); + }); + + describe('no_proxy=*', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + env.NO_PROXY = '*'; + testProxyUrl(env, '', 'http://example.com'); + }); + + describe('no_proxy=*.example (host suffix with *.)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '*.example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://example:80'); + testProxyUrl(env, 'http://proxy', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, '', 'http://sub.example:80'); + testProxyUrl(env, '', 'http://sub.example:1337'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, '', 'http://a.b.example'); + }); + + describe('no_proxy=*example (substring suffix)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '*example'; + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, '', 'http://example:80'); + testProxyUrl(env, '', 'http://example:1337'); + testProxyUrl(env, '', 'http://sub.example'); + testProxyUrl(env, '', 'http://sub.example:80'); + testProxyUrl(env, '', 'http://sub.example:1337'); + testProxyUrl(env, '', 'http://prefexample'); + testProxyUrl(env, '', 'http://a.b.example'); + testProxyUrl(env, 'http://proxy', 'http://example.no'); + testProxyUrl(env, 'http://proxy', 'http://host/example'); + }); + + describe('no_proxy=.*example (arbitrary wildcards are NOT supported)', + function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '.*example'; + testProxyUrl(env, 'http://proxy', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://sub.example'); + testProxyUrl(env, 'http://proxy', 'http://prefexample'); + testProxyUrl(env, 'http://proxy', 'http://x.prefexample'); + testProxyUrl(env, 'http://proxy', 'http://a.b.example'); + }); + + describe('no_proxy=[::1],[::2]:80,10.0.0.1,10.0.0.2:80 (IP addresses)', + function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '[::1],[::2]:80,10.0.0.1,10.0.0.2:80'; + testProxyUrl(env, '', 'http://[::1]/'); + testProxyUrl(env, '', 'http://[::1]:80/'); + testProxyUrl(env, '', 'http://[::1]:1337/'); + + testProxyUrl(env, '', 'http://[::2]/'); + testProxyUrl(env, '', 'http://[::2]:80/'); + testProxyUrl(env, 'http://proxy', 'http://[::2]:1337/'); + + testProxyUrl(env, '', 'http://10.0.0.1/'); + testProxyUrl(env, '', 'http://10.0.0.1:80/'); + testProxyUrl(env, '', 'http://10.0.0.1:1337/'); + + testProxyUrl(env, '', 'http://10.0.0.2/'); + testProxyUrl(env, '', 'http://10.0.0.2:80/'); + testProxyUrl(env, 'http://proxy', 'http://10.0.0.2:1337/'); + }); + + describe('no_proxy=127.0.0.1/32 (CIDR is NOT supported)', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '127.0.0.1/32'; + testProxyUrl(env, 'http://proxy', 'http://127.0.0.1'); + testProxyUrl(env, 'http://proxy', 'http://127.0.0.1/32'); + }); + + describe('no_proxy=127.0.0.1 does NOT match localhost', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + + env.NO_PROXY = '127.0.0.1'; + testProxyUrl(env, '', 'http://127.0.0.1'); + // We're not performing DNS queries, so this shouldn't match. + testProxyUrl(env, 'http://proxy', 'http://localhost'); + }); + + describe('no_proxy with protocols that have a default port', function() { + var env = {}; + env.WS_PROXY = 'http://ws'; + env.WSS_PROXY = 'http://wss'; + env.HTTP_PROXY = 'http://http'; + env.HTTPS_PROXY = 'http://https'; + env.GOPHER_PROXY = 'http://gopher'; + env.FTP_PROXY = 'http://ftp'; + env.ALL_PROXY = 'http://all'; + + env.NO_PROXY = 'xxx:21,xxx:70,xxx:80,xxx:443'; + + testProxyUrl(env, '', 'http://xxx'); + testProxyUrl(env, '', 'http://xxx:80'); + testProxyUrl(env, 'http://http', 'http://xxx:1337'); + + testProxyUrl(env, '', 'ws://xxx'); + testProxyUrl(env, '', 'ws://xxx:80'); + testProxyUrl(env, 'http://ws', 'ws://xxx:1337'); + + testProxyUrl(env, '', 'https://xxx'); + testProxyUrl(env, '', 'https://xxx:443'); + testProxyUrl(env, 'http://https', 'https://xxx:1337'); + + testProxyUrl(env, '', 'wss://xxx'); + testProxyUrl(env, '', 'wss://xxx:443'); + testProxyUrl(env, 'http://wss', 'wss://xxx:1337'); + + testProxyUrl(env, '', 'gopher://xxx'); + testProxyUrl(env, '', 'gopher://xxx:70'); + testProxyUrl(env, 'http://gopher', 'gopher://xxx:1337'); + + testProxyUrl(env, '', 'ftp://xxx'); + testProxyUrl(env, '', 'ftp://xxx:21'); + testProxyUrl(env, 'http://ftp', 'ftp://xxx:1337'); + }); + + describe('no_proxy should not be case-sensitive', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + env.NO_PROXY = 'XXX,YYY,ZzZ'; + + testProxyUrl(env, '', 'http://xxx'); + testProxyUrl(env, '', 'http://XXX'); + testProxyUrl(env, '', 'http://yyy'); + testProxyUrl(env, '', 'http://YYY'); + testProxyUrl(env, '', 'http://ZzZ'); + testProxyUrl(env, '', 'http://zZz'); + }); + + describe('NPM proxy configuration', function() { + describe('npm_config_http_proxy should work', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://http-proxy'; + + testProxyUrl(env, '', 'https://example'); + testProxyUrl(env, 'http://http-proxy', 'http://example'); + + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'http://example'); + }); + // eslint-disable-next-line max-len + describe('npm_config_http_proxy should take precedence over HTTP_PROXY and npm_config_proxy', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://http-proxy'; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://unexpected-proxy'; + env.HTTP_PROXY = 'http://unexpected-proxy'; + + testProxyUrl(env, 'http://http-proxy', 'http://example'); + }); + describe('npm_config_https_proxy should work', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_http_proxy = 'http://unexpected.proxy'; + testProxyUrl(env, '', 'https://example'); + + // eslint-disable-next-line camelcase + env.npm_config_https_proxy = 'http://https-proxy'; + testProxyUrl(env, 'http://https-proxy', 'https://example'); + + // eslint-disable-next-line camelcase + env.npm_config_https_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'https://example'); + }); + // eslint-disable-next-line max-len + describe('npm_config_https_proxy should take precedence over HTTPS_PROXY and npm_config_proxy', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_https_proxy = 'http://https-proxy'; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://unexpected-proxy'; + env.HTTPS_PROXY = 'http://unexpected-proxy'; + + testProxyUrl(env, 'http://https-proxy', 'https://example'); + }); + describe('npm_config_proxy should work', function() { + var env = {}; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://http-proxy'; + testProxyUrl(env, 'http://http-proxy', 'http://example'); + testProxyUrl(env, 'http://http-proxy', 'https://example'); + + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://priority'; + testProxyUrl(env, 'http://priority', 'http://example'); + testProxyUrl(env, 'http://priority', 'https://example'); + }); + // eslint-disable-next-line max-len + describe('HTTP_PROXY and HTTPS_PROXY should take precedence over npm_config_proxy', function() { + var env = {}; + env.HTTP_PROXY = 'http://http-proxy'; + env.HTTPS_PROXY = 'http://https-proxy'; + // eslint-disable-next-line camelcase + env.npm_config_proxy = 'http://unexpected-proxy'; + testProxyUrl(env, 'http://http-proxy', 'http://example'); + testProxyUrl(env, 'http://https-proxy', 'https://example'); + }); + describe('npm_config_no_proxy should work', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + // eslint-disable-next-line camelcase + env.npm_config_no_proxy = 'example'; + + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://otherwebsite'); + }); + // eslint-disable-next-line max-len + describe('npm_config_no_proxy should take precedence over NO_PROXY', function() { + var env = {}; + env.HTTP_PROXY = 'http://proxy'; + env.NO_PROXY = 'otherwebsite'; + // eslint-disable-next-line camelcase + env.npm_config_no_proxy = 'example'; + + testProxyUrl(env, '', 'http://example'); + testProxyUrl(env, 'http://proxy', 'http://otherwebsite'); + }); + }); +}); diff --git a/node_modules/pump/.github/FUNDING.yml b/node_modules/pump/.github/FUNDING.yml new file mode 100644 index 0000000..f6c9139 --- /dev/null +++ b/node_modules/pump/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: mafintosh +tidelift: "npm/pump" diff --git a/node_modules/pump/.travis.yml b/node_modules/pump/.travis.yml new file mode 100644 index 0000000..17f9433 --- /dev/null +++ b/node_modules/pump/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + +script: "npm test" diff --git a/node_modules/pump/LICENSE b/node_modules/pump/LICENSE new file mode 100644 index 0000000..757562e --- /dev/null +++ b/node_modules/pump/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/pump/README.md b/node_modules/pump/README.md new file mode 100644 index 0000000..5dcd8a5 --- /dev/null +++ b/node_modules/pump/README.md @@ -0,0 +1,74 @@ +# pump + +pump is a small node module that pipes streams together and destroys all of them if one of them closes. + +``` +npm install pump +``` + +[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump) + +## What problem does it solve? + +When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error. +You are also not able to provide a callback to tell when then pipe has finished. + +pump does these two things for you + +## Usage + +Simply pass the streams you want to pipe together to pump and add an optional callback + +``` js +var pump = require('pump') +var fs = require('fs') + +var source = fs.createReadStream('/dev/random') +var dest = fs.createWriteStream('/dev/null') + +pump(source, dest, function(err) { + console.log('pipe finished', err) +}) + +setTimeout(function() { + dest.destroy() // when dest is closed pump will destroy source +}, 1000) +``` + +You can use pump to pipe more than two streams together as well + +``` js +var transform = someTransformStream() + +pump(source, transform, anotherTransform, dest, function(err) { + console.log('pipe finished', err) +}) +``` + +If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. + +Similarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do: + +``` +return pump(s1, s2) // returns s2 +``` + +Note that `pump` attaches error handlers to the streams to do internal error handling, so if `s2` emits an +error in the above scenario, it will not trigger a `proccess.on('uncaughtException')` if you do not listen for it. + +If you want to return a stream that combines *both* s1 and s2 to a single stream use +[pumpify](https://github.com/mafintosh/pumpify) instead. + +## License + +MIT + +## Related + +`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of pump and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-pump?utm_source=npm-pump&utm_medium=referral&utm_campaign=enterprise) diff --git a/node_modules/pump/SECURITY.md b/node_modules/pump/SECURITY.md new file mode 100644 index 0000000..da9c516 --- /dev/null +++ b/node_modules/pump/SECURITY.md @@ -0,0 +1,5 @@ +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/node_modules/pump/index.js b/node_modules/pump/index.js new file mode 100644 index 0000000..712c076 --- /dev/null +++ b/node_modules/pump/index.js @@ -0,0 +1,86 @@ +var once = require('once') +var eos = require('end-of-stream') +var fs + +try { + fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes +} catch (e) {} + +var noop = function () {} +var ancient = typeof process === 'undefined' ? false : /^v?\.0/.test(process.version) + +var isFn = function (fn) { + return typeof fn === 'function' +} + +var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} + +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) +} + +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) + + var closed = false + stream.on('close', function () { + closed = true + }) + + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) + + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true + + if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + + if (isFn(stream.destroy)) return stream.destroy() + + callback(err || new Error('stream was destroyed')) + } +} + +var call = function (fn) { + fn() +} + +var pipe = function (from, to) { + return from.pipe(to) +} + +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop + + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') + + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) + + return streams.reduce(pipe) +} + +module.exports = pump diff --git a/node_modules/pump/package.json b/node_modules/pump/package.json new file mode 100644 index 0000000..976555c --- /dev/null +++ b/node_modules/pump/package.json @@ -0,0 +1,24 @@ +{ + "name": "pump", + "version": "3.0.3", + "repository": "git://github.com/mafintosh/pump.git", + "license": "MIT", + "description": "pipe streams together and close all of them if one of them closes", + "browser": { + "fs": false + }, + "keywords": [ + "streams", + "pipe", + "destroy", + "callback" + ], + "author": "Mathias Buus Madsen ", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + }, + "scripts": { + "test": "node test-browser.js && node test-node.js" + } +} diff --git a/node_modules/pump/test-browser.js b/node_modules/pump/test-browser.js new file mode 100644 index 0000000..9a06c8a --- /dev/null +++ b/node_modules/pump/test-browser.js @@ -0,0 +1,66 @@ +var stream = require('stream') +var pump = require('./index') + +var rs = new stream.Readable() +var ws = new stream.Writable() + +rs._read = function (size) { + this.push(Buffer(size).fill('abc')) +} + +ws._write = function (chunk, encoding, cb) { + setTimeout(function () { + cb() + }, 100) +} + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-browser.js passes') + clearTimeout(timeout) + } +} + +ws.on('finish', function () { + wsClosed = true + check() +}) + +rs.on('end', function () { + rsClosed = true + check() +}) + +var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +if (res !== ws) { + throw new Error('should return last stream') +} + +setTimeout(function () { + rs.push(null) + rs.emit('close') +}, 1000) + +var timeout = setTimeout(function () { + check() + throw new Error('timeout') +}, 5000) diff --git a/node_modules/pump/test-node.js b/node_modules/pump/test-node.js new file mode 100644 index 0000000..561251a --- /dev/null +++ b/node_modules/pump/test-node.js @@ -0,0 +1,53 @@ +var pump = require('./index') + +var rs = require('fs').createReadStream('/dev/random') +var ws = require('fs').createWriteStream('/dev/null') + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-node.js passes') + clearTimeout(timeout) + } +} + +ws.on('close', function () { + wsClosed = true + check() +}) + +rs.on('close', function () { + rsClosed = true + check() +}) + +var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +if (res !== ws) { + throw new Error('should return last stream') +} + +setTimeout(function () { + rs.destroy() +}, 1000) + +var timeout = setTimeout(function () { + throw new Error('timeout') +}, 5000) diff --git a/node_modules/qs/.editorconfig b/node_modules/qs/.editorconfig new file mode 100644 index 0000000..6adecfb --- /dev/null +++ b/node_modules/qs/.editorconfig @@ -0,0 +1,46 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 160 +quote_type = single + +[test/*] +max_line_length = off + +[LICENSE.md] +indent_size = off + +[*.md] +max_line_length = off + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[LICENSE] +indent_size = 2 +max_line_length = off + +[coverage/**/*] +indent_size = off +indent_style = off +indent = off +max_line_length = off + +[.nycrc] +indent_style = tab + +[tea.yaml] +indent_size = 2 diff --git a/node_modules/qs/.eslintrc b/node_modules/qs/.eslintrc new file mode 100644 index 0000000..a89f60e --- /dev/null +++ b/node_modules/qs/.eslintrc @@ -0,0 +1,39 @@ +{ + "root": true, + + "extends": "@ljharb", + + "ignorePatterns": [ + "dist/", + ], + + "rules": { + "complexity": 0, + "consistent-return": 1, + "func-name-matching": 0, + "id-length": [2, { "min": 1, "max": 25, "properties": "never" }], + "indent": [2, 4], + "max-lines": 0, + "max-lines-per-function": [2, { "max": 150 }], + "max-params": [2, 18], + "max-statements": [2, 100], + "multiline-comment-style": 0, + "no-continue": 1, + "no-magic-numbers": 0, + "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"], + }, + + "overrides": [ + { + "files": "test/**", + "rules": { + "function-paren-newline": 0, + "max-lines-per-function": 0, + "max-statements": 0, + "no-buffer-constructor": 0, + "no-extend-native": 0, + "no-throw-literal": 0, + }, + }, + ], +} diff --git a/node_modules/qs/.github/FUNDING.yml b/node_modules/qs/.github/FUNDING.yml new file mode 100644 index 0000000..0355f4f --- /dev/null +++ b/node_modules/qs/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/qs +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with a single custom sponsorship URL diff --git a/node_modules/qs/.nycrc b/node_modules/qs/.nycrc new file mode 100644 index 0000000..1d57cab --- /dev/null +++ b/node_modules/qs/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "dist" + ] +} diff --git a/node_modules/qs/CHANGELOG.md b/node_modules/qs/CHANGELOG.md new file mode 100644 index 0000000..dc8e879 --- /dev/null +++ b/node_modules/qs/CHANGELOG.md @@ -0,0 +1,622 @@ +## **6.14.0** +- [New] `parse`: add `throwOnParameterLimitExceeded` option (#517) +- [Refactor] `parse`: use `utils.combine` more +- [patch] `parse`: add explicit `throwOnLimitExceeded` default +- [actions] use shared action; re-add finishers +- [meta] Fix changelog formatting bug +- [Deps] update `side-channel` +- [Dev Deps] update `es-value-fixtures`, `has-bigints`, `has-proto`, `has-symbols` +- [Tests] increase coverage + +## **6.13.1** +- [Fix] `stringify`: avoid a crash when a `filter` key is `null` +- [Fix] `utils.merge`: functions should not be stringified into keys +- [Fix] `parse`: avoid a crash with interpretNumericEntities: true, comma: true, and iso charset +- [Fix] `stringify`: ensure a non-string `filter` does not crash +- [Refactor] use `__proto__` syntax instead of `Object.create` for null objects +- [Refactor] misc cleanup +- [Tests] `utils.merge`: add some coverage +- [Tests] fix a test case +- [actions] split out node 10-20, and 20+ +- [Dev Deps] update `es-value-fixtures`, `mock-property`, `object-inspect`, `tape` + +## **6.13.0** +- [New] `parse`: add `strictDepth` option (#511) +- [Tests] use `npm audit` instead of `aud` + +## **6.12.3** +- [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays` +- [meta] fix changelog indentation + +## **6.12.2** +- [Fix] `parse`: parse encoded square brackets (#506) +- [readme] add CII best practices badge + +## **6.12.1** +- [Fix] `parse`: Disable `decodeDotInKeys` by default to restore previous behavior (#501) +- [Performance] `utils`: Optimize performance under large data volumes, reduce memory usage, and speed up processing (#502) +- [Refactor] `utils`: use `+=` +- [Tests] increase coverage + +## **6.12.0** + +- [New] `parse`/`stringify`: add `decodeDotInKeys`/`encodeDotKeys` options (#488) +- [New] `parse`: add `duplicates` option +- [New] `parse`/`stringify`: add `allowEmptyArrays` option to allow [] in object values (#487) +- [Refactor] `parse`/`stringify`: move allowDots config logic to its own variable +- [Refactor] `stringify`: move option-handling code into `normalizeStringifyOptions` +- [readme] update readme, add logos (#484) +- [readme] `stringify`: clarify default `arrayFormat` behavior +- [readme] fix line wrapping +- [readme] remove dead badges +- [Deps] update `side-channel` +- [meta] make the dist build 50% smaller +- [meta] add `sideEffects` flag +- [meta] run build in prepack, not prepublish +- [Tests] `parse`: remove useless tests; add coverage +- [Tests] `stringify`: increase coverage +- [Tests] use `mock-property` +- [Tests] `stringify`: improve coverage +- [Dev Deps] update `@ljharb/eslint-config `, `aud`, `has-override-mistake`, `has-property-descriptors`, `mock-property`, `npmignore`, `object-inspect`, `tape` +- [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak` +- [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6 + +## **6.11.2** +- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473) +- [Tests] add passing test cases with empty keys (#473) + +## **6.11.1** +- [Fix] `stringify`: encode comma values more consistently (#463) +- [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447) +- [meta] remove extraneous code backticks (#457) +- [meta] fix changelog markdown +- [actions] update checkout action +- [actions] restrict action permissions +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` + +## **6.11.0** +- [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442) +- [readme] fix version badge + +## **6.10.5** +- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434) + +## **6.10.4** +- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441) +- [meta] use `npmignore` to autogenerate an npmignore file +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape` + +## **6.10.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [actions] reuse common workflows +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape` + +## **6.10.2** +- [Fix] `stringify`: actually fix cyclic references (#426) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [actions] update codecov uploader +- [actions] update workflows +- [Tests] clean up stringify tests slightly +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `safe-publish-latest`, `tape` + +## **6.10.1** +- [Fix] `stringify`: avoid exception on repeated object values (#402) + +## **6.10.0** +- [New] `stringify`: throw on cycles, instead of an infinite loop (#395, #394, #393) +- [New] `parse`: add `allowSparse` option for collapsing arrays with missing indices (#312) +- [meta] fix README.md (#399) +- [meta] only run `npm run dist` in publish, not install +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` +- [Tests] fix tests on node v0.6 +- [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run` +- [Tests] Revert "[meta] ignore eclint transitive audit warning" + +## **6.9.7** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [Tests] clean up stringify tests slightly +- [meta] fix README.md (#399) +- Revert "[meta] ignore eclint transitive audit warning" +- [actions] backport actions from main +- [Dev Deps] backport updates from main + +## **6.9.6** +- [Fix] restore `dist` dir; mistakenly removed in d4f6c32 + +## **6.9.5** +- [Fix] `stringify`: do not encode parens for RFC1738 +- [Fix] `stringify`: fix arrayFormat comma with empty array/objects (#350) +- [Refactor] `format`: remove `util.assign` call +- [meta] add "Allow Edits" workflow; update rebase workflow +- [actions] switch Automatic Rebase workflow to `pull_request_target` event +- [Tests] `stringify`: add tests for #378 +- [Tests] migrate tests to Github Actions +- [Tests] run `nyc` on all tests; use `tape` runner +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `mkdirp`, `object-inspect`, `tape`; add `aud` + +## **6.9.4** +- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364) +- [Refactor] `stringify`: reduce branching (part of #350) +- [Refactor] move `maybeMap` to `utils` +- [Dev Deps] update `browserify`, `tape` + +## **6.9.3** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.9.2** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [meta] ignore eclint transitive audit warning +- [meta] fix indentation in package.json +- [meta] add tidelift marketing copy +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite` +- [actions] add automatic rebasing / merge commit blocking + +## **6.9.1** +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [Fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config` +- [Tests] use shared travis-ci config + +## **6.9.0** +- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16` +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray + +## **6.8.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Tests] clean up stringify tests slightly +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Refactor] `stringify`: reduce branching +- [meta] do not publish workflow files + +## **6.8.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.8.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [actions] add automatic rebasing / merge commit blocking + +## **6.8.0** +- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326) +- [New] [Fix] stringify symbols and bigints +- [Fix] ensure node 0.12 can stringify Symbols +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape` +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326) +- [Tests] use `eclint` instead of `editorconfig-tools` +- [docs] readme: add security note +- [meta] add github sponsorship +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause + +## **6.7.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424) +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] add note and links for coercing primitive values (#408) +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [actions] backport actions from main +- [Dev Deps] backport updates from main +- [Tests] use `nyc` for coverage +- [Tests] clean up stringify tests slightly + +## **6.7.2** +- [Fix] proper comma parsing of URL-encoded commas (#361) +- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336) + +## **6.7.1** +- [Fix] `parse`: Fix parsing array from object with `comma` true (#359) +- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335) +- [fix] `parse`: with comma true, do not split non-string values (#334) +- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Refactor] `formats`: tiny bit of cleanup. +- readme: add security note +- [meta] add tidelift marketing copy +- [meta] add `funding` field +- [meta] add FUNDING.yml +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify` +- [Tests] `parse`: add passing `arrayFormat` tests +- [Tests] use shared travis-ci configs +- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray +- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended +- [Tests] use `eclint` instead of `editorconfig-tools` +- [actions] add automatic rebasing / merge commit blocking + +## **6.7.0** +- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219) +- [Fix] correctly parse nested arrays (#212) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] `stringify`/`utils`: cache `Array.isArray` +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] temporarily allow coverage to fail + +## **6.6.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty` +- [Refactor] `formats`: tiny bit of cleanup. +- [Refactor] `utils`: `isBuffer`: small tweak; add tests +- [Refactor]: `stringify`/`utils`: cache `Array.isArray` +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `parse`/`stringify`: make a function to normalize the options +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] do not publish workflow files +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [meta] Fixes typo in CHANGELOG.md +- [actions] backport actions from main +- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10 +- [Tests] always use `String(x)` over `x.toString()` +- [Dev Deps] backport from main + +## **6.6.0** +- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268) +- [New] move two-value combine to a `utils` function (#189) +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260) +- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1` +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults +- [Refactor] add missing defaults +- [Refactor] `parse`: one less `concat` call +- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape` +- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS + +## **6.5.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] correctly parse nested arrays +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Refactor] `utils`: reduce observable [[Get]]s +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Refactor] `parse`: only need to reassign the var once +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clean up license text so it’s properly detected as BSD-3-Clause +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] always use `String(x)` over `x.toString()` +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.5.2** +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230) +- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify` + +## **6.5.1** +- [Fix] Fix parsing & compacting very deep objects (#224) +- [Refactor] name utils functions +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` +- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node +- [Tests] Use precise dist for Node.js 0.6 runtime (#225) +- [Tests] make 0.6 required, now that it’s passing +- [Tests] on `node` `v8.2`; fix npm on node 0.6 + +## **6.5.0** +- [New] add `utils.assign` +- [New] pass default encoder/decoder to custom encoder/decoder functions (#206) +- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213) +- [Fix] Handle stringifying empty objects with addQueryPrefix (#217) +- [Fix] do not mutate `options` argument (#207) +- [Refactor] `parse`: cache index to reuse in else statement (#182) +- [Docs] add various badges to readme (#208) +- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape` +- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4 +- [Tests] add `editorconfig-tools` + +## **6.4.1** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] use `safer-buffer` instead of `Buffer` constructor +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [readme] remove travis badge; add github actions/codecov badges; update URLs +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.4.0** +- [New] `qs.stringify`: add `encodeValuesOnly` option +- [Fix] follow `allowPrototypes` option during merge (#201, #201) +- [Fix] support keys starting with brackets (#202, #200) +- [Fix] chmod a-x +- [Dev Deps] update `eslint` +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds +- [eslint] reduce warnings + +## **6.3.3** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] fix for an impossible situation: when the formatter is called with a non-string value +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279) +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269) +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.3.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Dev Deps] update `eslint` +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.3.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape` +- [Tests] on all node minors; improve test matrix +- [Docs] document stringify option `allowDots` (#195) +- [Docs] add empty object and array values example (#195) +- [Docs] Fix minor inconsistency/typo (#192) +- [Docs] document stringify option `sort` (#191) +- [Refactor] `stringify`: throw faster with an invalid encoder +- [Refactor] remove unnecessary escapes (#184) +- Remove contributing.md, since `qs` is no longer part of `hapi` (#183) + +## **6.3.0** +- [New] Add support for RFC 1738 (#174, #173) +- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159) +- [Fix] ensure `utils.merge` handles merging two arrays +- [Refactor] only constructors should be capitalized +- [Refactor] capitalized var names are for constructors only +- [Refactor] avoid using a sparse array +- [Robustness] `formats`: cache `String#replace` +- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` +- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix +- [Tests] flesh out arrayLimit/arrayFormat tests (#107) +- [Tests] skip Object.create tests when null objects are not available +- [Tests] Turn on eslint for test files (#175) + +## **6.2.4** +- [Fix] `parse`: ignore `__proto__` keys (#428) +- [Fix] `utils.merge`: avoid a crash with a null target and an array source +- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source +- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided +- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` +- [Robustness] `stringify`: avoid relying on a global `undefined` (#427) +- [Refactor] use cached `Array.isArray` +- [Docs] Clarify the need for "arrayLimit" option +- [meta] fix README.md (#399) +- [meta] Clean up license text so it’s properly detected as BSD-3-Clause +- [meta] add FUNDING.yml +- [actions] backport actions from main +- [Tests] use `safer-buffer` instead of `Buffer` constructor +- [Tests] remove nonexistent tape option +- [Dev Deps] backport from main + +## **6.2.3** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.2.2** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## **6.1.2** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.1.1** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) +- [New] allowDots option for `stringify` (#151) +- [Fix] "sort" option should work at a depth of 3 or more (#151) +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## **6.0.4** +- [Fix] follow `allowPrototypes` option during merge (#201, #200) +- [Fix] chmod a-x +- [Fix] support keys starting with brackets (#202, #200) +- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds + +## **6.0.3** +- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) +- Revert ES6 requirement and restore support for node down to v0.8. + +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json + +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 + +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + +## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) +- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string + +## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) +- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify + +## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm + +## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional + +## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" + +## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost +- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign +- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute + +## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function + +## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option + +## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/node_modules/qs/LICENSE.md b/node_modules/qs/LICENSE.md new file mode 100644 index 0000000..fecf6b6 --- /dev/null +++ b/node_modules/qs/LICENSE.md @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/qs/README.md b/node_modules/qs/README.md new file mode 100644 index 0000000..22c411d --- /dev/null +++ b/node_modules/qs/README.md @@ -0,0 +1,733 @@ +

+ qs +

+ +# qs [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9058/badge)](https://bestpractices.coreinfrastructure.org/projects/9058) + +[![npm badge][npm-badge-png]][package-url] + +A querystring parsing and stringifying library with some added security. + +Lead Maintainer: [Jordan Harband](https://github.com/ljharb) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var qs = require('qs'); +var assert = require('assert'); + +var obj = qs.parse('a=c'); +assert.deepEqual(obj, { a: 'c' }); + +var str = qs.stringify(obj); +assert.equal(str, 'a=c'); +``` + +### Parsing Objects + +[](#preventEval) +```javascript +qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +assert.deepEqual(qs.parse('foo[bar]=baz'), { + foo: { + bar: 'baz' + } +}); +``` + +When using the `plainObjects` option the parsed value is returned as a null object, created via `{ __proto__: null }` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); +assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } }); +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. +*WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. +Always be careful with this option. + +```javascript +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); +``` + +URI encoded strings work too: + +```javascript +assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } +}); +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' + } + } +}); +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. +This means if you attempt to parse a string like `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +}; +var string = 'a[b][c][d][e][f][g][h][i]=j'; +assert.deepEqual(qs.parse(string), expected); +``` + +This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: + +```javascript +var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); +``` + +You can configure **qs** to throw an error when parsing nested input beyond this depth using the `strictDepth` option (defaulted to false): + +```javascript +try { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); +} catch (err) { + assert(err instanceof RangeError); + assert.strictEqual(err.message, 'Input depth exceeded depth option of 1 and strictDepth is true'); +} +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. The strictDepth option adds a layer of protection by throwing an error when the limit is exceeded, allowing you to catch and handle such cases. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); +``` + +If you want an error to be thrown whenever the a limit is exceeded (eg, `parameterLimit`, `arrayLimit`), set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. +```javascript +try { + qs.parse('a=1&b=2&c=3&d=4', { parameterLimit: 3, throwOnLimitExceeded: true }); +} catch (err) { + assert(err instanceof Error); + assert.strictEqual(err.message, 'Parameter limit exceeded. Only 3 parameters allowed.'); +} +``` + +When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `parameterLimit` and ignore the rest without throwing an error. + +To bypass the leading question mark, use `ignoreQueryPrefix`: + +```javascript +var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true }); +assert.deepEqual(prefixed, { a: 'b', c: 'd' }); +``` + +An optional delimiter can also be passed: + +```javascript +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { a: 'b', c: 'd' }); +``` + +Delimiters can be a regular expression too: + +```javascript +var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); +``` + +Option `decodeDotInKeys` can be used to decode dots in keys +Note: it implies `allowDots`, so `parse` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. + +```javascript +var withDots = qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { decodeDotInKeys: true }); +assert.deepEqual(withDots, { 'name.obj': { first: 'John', last: 'Doe' }}); +``` + +Option `allowEmptyArrays` can be used to allowing empty array values in object +```javascript +var withEmptyArrays = qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }); +assert.deepEqual(withEmptyArrays, { foo: [], bar: 'baz' }); +``` + +Option `duplicates` can be used to change the behavior when duplicate keys are encountered +```javascript +assert.deepEqual(qs.parse('foo=bar&foo=baz'), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), { foo: ['bar', 'baz'] }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'bar' }); +assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' }); +``` + +If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1: + +```javascript +var oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' }); +assert.deepEqual(oldCharset, { a: '§' }); +``` + +Some services add an initial `utf8=✓` value to forms so that old Internet Explorer versions are more likely to submit the form as utf-8. +Additionally, the server can check the value against wrong encodings of the checkmark character and detect that a query string or `application/x-www-form-urlencoded` body was *not* sent as utf-8, eg. if the form had an `accept-charset` parameter or the containing page had a different character set. + +**qs** supports this mechanism via the `charsetSentinel` option. +If specified, the `utf8` parameter will be omitted from the returned object. +It will be used to switch to `iso-8859-1`/`utf-8` mode depending on how the checkmark is encoded. + +**Important**: When you specify both the `charset` option and the `charsetSentinel` option, the `charset` will be overridden when the request contains a `utf8` parameter from which the actual charset can be deduced. +In that sense the `charset` will behave as the default charset rather than the authoritative charset. + +```javascript +var detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', { + charset: 'iso-8859-1', + charsetSentinel: true +}); +assert.deepEqual(detectedAsUtf8, { a: 'ø' }); + +// Browsers encode the checkmark as ✓ when submitting as iso-8859-1: +var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', { + charset: 'utf-8', + charsetSentinel: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: 'ø' }); +``` + +If you want to decode the `&#...;` syntax to the actual character, you can specify the `interpretNumericEntities` option as well: + +```javascript +var detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', { + charset: 'iso-8859-1', + interpretNumericEntities: true +}); +assert.deepEqual(detectedAsIso8859_1, { a: '☺' }); +``` + +It also works when the charset has been detected in `charsetSentinel` mode. + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); +``` + +You may specify an index as well: + +```javascript +var withIndexes = qs.parse('a[1]=c&a[0]=b'); +assert.deepEqual(withIndexes, { a: ['b', 'c'] }); +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number to create an array. +When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving their order: + +```javascript +var noSparse = qs.parse('a[1]=b&a[15]=c'); +assert.deepEqual(noSparse, { a: ['b', 'c'] }); +``` + +You may also use `allowSparse` option to parse sparse arrays: + +```javascript +var sparseArray = qs.parse('a[1]=2&a[3]=5', { allowSparse: true }); +assert.deepEqual(sparseArray, { a: [, '2', , '5'] }); +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +var withEmptyString = qs.parse('a[]=&a[]=b'); +assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + +var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); +assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); +``` + +**qs** will also limit specifying indices in an array to a maximum index of `20`. +Any array members with an index of greater than `20` will instead be converted to an object with the index as the key. +This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array. + +```javascript +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); +assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); +``` + +If you want to throw an error whenever the array limit is exceeded, set the `throwOnLimitExceeded` option to `true`. This option will generate a descriptive error if the query string exceeds a configured limit. +```javascript +try { + qs.parse('a[1]=b', { arrayLimit: 0, throwOnLimitExceeded: true }); +} catch (err) { + assert(err instanceof Error); + assert.strictEqual(err.message, 'Array limit exceeded. Only 0 elements allowed in an array.'); +} +``` + +When `throwOnLimitExceeded` is set to `false` (default), **qs** will parse up to the specified `arrayLimit` and if the limit is exceeded, the array will instead be converted to an object with the index as the key + +To disable array parsing entirely, set `parseArrays` to `false`. + +```javascript +var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); +assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +var mixedNotation = qs.parse('a[0]=b&a[b]=c'); +assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); +``` + +You can also create arrays of objects: + +```javascript +var arraysOfObjects = qs.parse('a[][b]=c'); +assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); +``` + +Some people use comma to join array, **qs** can parse it: +```javascript +var arraysOfObjects = qs.parse('a=b,c', { comma: true }) +assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] }) +``` +(_this cannot convert nested objects, such as `a={b:1},{c:d}`_) + +### Parsing primitive/scalar values (numbers, booleans, null, etc) + +By default, all values are parsed as strings. +This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91). + +```javascript +var primitiveValues = qs.parse('a=15&b=true&c=null'); +assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' }); +``` + +If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters. + +### Stringifying + +[](#preventEval) +```javascript +qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); +assert.equal(unencoded, 'a[b]=c'); +``` + +Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`: +```javascript +var encodedValues = qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true } +); +assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'); +``` + +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + +You can encode keys and values using different logic by using the type argument provided to the encoder: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return // Encoded key + } else if (type === 'value') { + return // Encoded value + } +}}) +``` + +The type argument is also provided to the decoder: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return // Decoded key + } else if (type === 'value') { + return // Decoded value + } +}}) +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. +Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array: + +```javascript +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' }) +// 'a=b,c' +``` + +Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse. + +When objects are stringified, by default they use bracket notation: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }); +// 'a[b][c]=d&a[b][e]=f' +``` + +You may override this to use dot notation by setting the `allowDots` option to `true`: + +```javascript +qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true }); +// 'a.b.c=d&a.b.e=f' +``` + +You may encode the dot notation in the keys of object with option `encodeDotInKeys` by setting it to `true`: +Note: it implies `allowDots`, so `stringify` will error if you set `decodeDotInKeys` to `true`, and `allowDots` to `false`. +Caveat: when `encodeValuesOnly` is `true` as well as `encodeDotInKeys`, only dots in keys and nothing else will be encoded. +```javascript +qs.stringify({ "name.obj": { "first": "John", "last": "Doe" } }, { allowDots: true, encodeDotInKeys: true }) +// 'name%252Eobj.first=John&name%252Eobj.last=Doe' +``` + +You may allow empty array values by setting the `allowEmptyArrays` option to `true`: +```javascript +qs.stringify({ foo: [], bar: 'baz' }, { allowEmptyArrays: true }); +// 'foo[]&bar=baz' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +assert.equal(qs.stringify({ a: '' }), 'a='); +``` + +Key with no values (such as an empty object or array) will return nothing: + +```javascript +assert.equal(qs.stringify({ a: [] }), ''); +assert.equal(qs.stringify({ a: {} }), ''); +assert.equal(qs.stringify({ a: [{}] }), ''); +assert.equal(qs.stringify({ a: { b: []} }), ''); +assert.equal(qs.stringify({ a: { b: {}} }), ''); +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); +``` + +The query string may optionally be prepended with a question mark: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d'); +``` + +The delimiter may be overridden with stringify as well: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); +``` + +If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option: + +```javascript +var date = new Date(7); +assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A')); +assert.equal( + qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }), + 'a=7' +); +``` + +You may use the `sort` option to affect the order of parameter keys: + +```javascript +function alphabeticalSort(a, b) { + return a.localeCompare(b); +} +assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y'); +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. +Otherwise, if you pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); +// 'a=b&c=d&e[f]=123&e[g][0]=4' +qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); +// 'a=b&e=f' +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); +// 'a[0]=b&a[2]=d' +``` + +You could also use `filter` to inject custom serialization for user defined types. +Consider you're working with some api that expects query strings of the format for ranges: + +``` +https://domain.com/endpoint?range=30...70 +``` + +For which you model as: + +```javascript +class Range { + constructor(from, to) { + this.from = from; + this.to = to; + } +} +``` + +You could _inject_ a custom serializer to handle values of this type: + +```javascript +qs.stringify( + { + range: new Range(30, 70), + }, + { + filter: (prefix, value) => { + if (value instanceof Range) { + return `${value.from}...${value.to}`; + } + // serialize the usual way + return value; + }, + } +); +// range=30...70 +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +var withNull = qs.stringify({ a: null, b: '' }); +assert.equal(withNull, 'a=&b='); +``` + +Parsing does not distinguish between parameters with and without equal signs. +Both are converted to empty strings. + +```javascript +var equalsInsensitive = qs.parse('a&b='); +assert.deepEqual(equalsInsensitive, { a: '', b: '' }); +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +assert.equal(strictNull, 'a&b='); +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); +assert.deepEqual(parsedStrictNull, { a: null, b: '' }); +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); +assert.equal(nullsSkipped, 'a=b'); +``` + +If you're communicating with legacy systems, you can switch to `iso-8859-1` using the `charset` option: + +```javascript +var iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }); +assert.equal(iso, '%E6=%E6'); +``` + +Characters that don't exist in `iso-8859-1` will be converted to numeric entities, similar to what browsers do: + +```javascript +var numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }); +assert.equal(numeric, 'a=%26%239786%3B'); +``` + +You can use the `charsetSentinel` option to announce the character by including an `utf8=✓` parameter with the proper encoding if the checkmark, similar to what Ruby on Rails and others do when submitting forms. + +```javascript +var sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true }); +assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA'); + +var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }); +assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6'); +``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`, and `iso-8859-1` support is also built in via the `charset` parameter. + +If you wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` + +### RFC 3986 and RFC 1738 space encoding + +RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible. +In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'. + +``` +assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c'); +assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c'); +``` + +## Security + +Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. + +## qs for enterprise + +Available as part of the Tidelift Subscription + +The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. +Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. +[Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +[package-url]: https://npmjs.org/package/qs +[npm-version-svg]: https://versionbadg.es/ljharb/qs.svg +[deps-svg]: https://david-dm.org/ljharb/qs.svg +[deps-url]: https://david-dm.org/ljharb/qs +[dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/qs.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/qs.svg +[downloads-url]: https://npm-stat.com/charts.html?package=qs +[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/qs/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs +[actions-url]: https://github.com/ljharb/qs/actions + +## Acknowledgements + +qs logo by [NUMI](https://github.com/numi-hq/open-design): + +[NUMI Logo](https://numi.tech/?ref=qs) diff --git a/node_modules/qs/dist/qs.js b/node_modules/qs/dist/qs.js new file mode 100644 index 0000000..f37989a --- /dev/null +++ b/node_modules/qs/dist/qs.js @@ -0,0 +1,141 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(p=isArray(p)?[p]:p);var f=has.call(r,d);f&&"combine"===t.duplicates?r[d]=utils.combine(r[d],p):f&&"last"!==t.duplicates||(r[d]=p)}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l);else{s=r.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,c=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&d!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=l:"__proto__"!==c&&(s[c]=l):s={0:l}}l=s}return l},parseKeys=function parseQueryStringKeys(e,t,r,i){if(e){var a=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,l=r.depth>0&&/(\[[^[\]]*])/.exec(a),n=l?a.slice(0,l.index):a,s=[];if(n){if(!r.plainObjects&&has.call(Object.prototype,n)&&!r.allowPrototypes)return;s.push(n)}for(var d=0;r.depth>0&&null!==(l=o.exec(a))&&d0?g.join(",")||null:void 0}];else if(isArray(f))S=f;else{var N=Object.keys(g);S=u?N.sort(u):N}var T=l?String(r).replace(/\./g,"%2E"):String(r),O=o&&isArray(g)&&1===g.length?T+"[]":T;if(a&&isArray(g)&&0===g.length)return O+"[]";for(var k=0;k0?c+y:""}; + +},{"1":1,"46":46,"5":5}],5:[function(require,module,exports){ +"use strict";var formats=require(1),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,hexTable=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var o=[],n=0;n=limit?a.slice(i,i+limit):a,p=[],f=0;f=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||n===formats.RFC1738&&(40===s||41===s)?p[p.length]=u.charAt(f):s<128?p[p.length]=hexTable[s]:s<2048?p[p.length]=hexTable[192|s>>6]+hexTable[128|63&s]:s<55296||s>=57344?p[p.length]=hexTable[224|s>>12]+hexTable[128|s>>6&63]+hexTable[128|63&s]:(f+=1,s=65536+((1023&s)<<10|1023&u.charCodeAt(f)),p[p.length]=hexTable[240|s>>18]+hexTable[128|s>>12&63]+hexTable[128|s>>6&63]+hexTable[128|63&s])}c+=p.join("")}return c},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],o=0;o-1?callBindBasic([t]):t}; + +},{"10":10,"25":25}],25:[function(require,module,exports){ +"use strict";var undefined,$Object=require(22),$Error=require(16),$EvalError=require(15),$RangeError=require(17),$ReferenceError=require(18),$SyntaxError=require(19),$TypeError=require(20),$URIError=require(21),abs=require(34),floor=require(35),max=require(37),min=require(38),pow=require(39),round=require(40),sign=require(41),$Function=Function,getEvalledConstructor=function(r){try{return $Function('"use strict"; return ('+r+").constructor;")()}catch(r){}},$gOPD=require(30),$defineProperty=require(14),throwTypeError=function(){throw new $TypeError},ThrowTypeError=$gOPD?function(){try{return throwTypeError}catch(r){try{return $gOPD(arguments,"callee").get}catch(r){return throwTypeError}}}():throwTypeError,hasSymbols=require(31)(),getProto=require(28),$ObjectGPO=require(26),$ReflectGPO=require(27),$apply=require(8),$call=require(9),needsEval={},TypedArray="undefined"!=typeof Uint8Array&&getProto?getProto(Uint8Array):undefined,INTRINSICS={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?undefined:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?undefined:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,"%AsyncFromSyncIteratorPrototype%":undefined,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":"undefined"==typeof Atomics?undefined:Atomics,"%BigInt%":"undefined"==typeof BigInt?undefined:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?undefined:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?undefined:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?undefined:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float32Array%":"undefined"==typeof Float32Array?undefined:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?undefined:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?undefined:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":"undefined"==typeof Int8Array?undefined:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?undefined:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?undefined:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,"%JSON%":"object"==typeof JSON?JSON:undefined,"%Map%":"undefined"==typeof Map?undefined:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&hasSymbols&&getProto?getProto((new Map)[Symbol.iterator]()):undefined,"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?undefined:Promise,"%Proxy%":"undefined"==typeof Proxy?undefined:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":"undefined"==typeof Reflect?undefined:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?undefined:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&hasSymbols&&getProto?getProto((new Set)[Symbol.iterator]()):undefined,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?undefined:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined,"%Symbol%":hasSymbols?Symbol:undefined,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError,"%Uint8Array%":"undefined"==typeof Uint8Array?undefined:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?undefined:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?undefined:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?undefined:Uint32Array,"%URIError%":$URIError,"%WeakMap%":"undefined"==typeof WeakMap?undefined:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?undefined:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?undefined:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round,"%Math.sign%":sign,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(r){var errorProto=getProto(getProto(r));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function doEval(r){var e;if("%AsyncFunction%"===r)e=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===r)e=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===r)e=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===r){var t=doEval("%AsyncGeneratorFunction%");t&&(e=t.prototype)}else if("%AsyncIteratorPrototype%"===r){var o=doEval("%AsyncGenerator%");o&&getProto&&(e=getProto(o.prototype))}return INTRINSICS[r]=e,e},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=require(24),hasOwn=require(33),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function stringToPath(r){var e=$strSlice(r,0,1),t=$strSlice(r,-1);if("%"===e&&"%"!==t)throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if("%"===t&&"%"!==e)throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var o=[];return $replace(r,rePropName,(function(r,e,t,n){o[o.length]=t?$replace(n,reEscapeChar,"$1"):e||r})),o},getBaseIntrinsic=function getBaseIntrinsic(r,e){var t,o=r;if(hasOwn(LEGACY_ALIASES,o)&&(o="%"+(t=LEGACY_ALIASES[o])[0]+"%"),hasOwn(INTRINSICS,o)){var n=INTRINSICS[o];if(n===needsEval&&(n=doEval(o)),void 0===n&&!e)throw new $TypeError("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:t,name:o,value:n}}throw new $SyntaxError("intrinsic "+r+" does not exist!")};module.exports=function GetIntrinsic(r,e){if("string"!=typeof r||0===r.length)throw new $TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new $TypeError('"allowMissing" argument must be a boolean');if(null===$exec(/^%?[^%]*%?$/,r))throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var t=stringToPath(r),o=t.length>0?t[0]:"",n=getBaseIntrinsic("%"+o+"%",e),a=n.name,i=n.value,y=!1,p=n.alias;p&&(o=p[0],$spliceApply(t,$concat([0,1],p)));for(var s=1,d=!0;s=t.length){var c=$gOPD(i,f);i=(d=!!c)&&"get"in c&&!("originalValue"in c.get)?c.get:i[f]}else d=hasOwn(i,f),i=i[f];d&&!y&&(INTRINSICS[a]=i)}}return i}; + +},{"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"20":20,"21":21,"22":22,"24":24,"26":26,"27":27,"28":28,"30":30,"31":31,"33":33,"34":34,"35":35,"37":37,"38":38,"39":39,"40":40,"41":41,"8":8,"9":9}],13:[function(require,module,exports){ +"use strict";var hasProtoAccessor,callBind=require(10),gOPD=require(30);try{hasProtoAccessor=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,"__proto__"),$Object=Object,$getPrototypeOf=$Object.getPrototypeOf;module.exports=desc&&"function"==typeof desc.get?callBind([desc.get]):"function"==typeof $getPrototypeOf&&function getDunder(t){return $getPrototypeOf(null==t?t:$Object(t))}; + +},{"10":10,"30":30}],30:[function(require,module,exports){ +"use strict";var $gOPD=require(29);if($gOPD)try{$gOPD([],"length")}catch(g){$gOPD=null}module.exports=$gOPD; + +},{"29":29}],14:[function(require,module,exports){ +"use strict";var $defineProperty=Object.defineProperty||!1;if($defineProperty)try{$defineProperty({},"a",{value:1})}catch(e){$defineProperty=!1}module.exports=$defineProperty; + +},{}],15:[function(require,module,exports){ +"use strict";module.exports=EvalError; + +},{}],16:[function(require,module,exports){ +"use strict";module.exports=Error; + +},{}],17:[function(require,module,exports){ +"use strict";module.exports=RangeError; + +},{}],18:[function(require,module,exports){ +"use strict";module.exports=ReferenceError; + +},{}],19:[function(require,module,exports){ +"use strict";module.exports=SyntaxError; + +},{}],21:[function(require,module,exports){ +"use strict";module.exports=URIError; + +},{}],22:[function(require,module,exports){ +"use strict";module.exports=Object; + +},{}],23:[function(require,module,exports){ +"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o-1e3&&t<1e3||$test.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-$floor(-t):$floor(t);if(n!==t){var o=String(n),i=$slice.call(e,o.length+1);return $replace.call(o,r,"$&_")+"."+$replace.call($replace.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(e,r,"$&_")}var utilInspect=require(6),inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function wrapQuotes(t,e,r){var n=r.quoteStyle||e,o=quotes[n];return o+t+o}function quote(t){return $replace.call(String(t),/"/g,""")}function isArray(t){return!("[object Array]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isDate(t){return!("[object Date]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isRegExp(t){return!("[object RegExp]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isError(t){return!("[object Error]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isString(t){return!("[object String]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isNumber(t){return!("[object Number]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isBoolean(t){return!("[object Boolean]"!==toStr(t)||toStringTag&&"object"==typeof t&&toStringTag in t)}function isSymbol(t){if(hasShammedSymbols)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!symToString)return!1;try{return symToString.call(t),!0}catch(t){}return!1}function isBigInt(t){if(!t||"object"!=typeof t||!bigIntValueOf)return!1;try{return bigIntValueOf.call(t),!0}catch(t){}return!1}module.exports=function inspect_(t,e,r,n){var o=e||{};if(has(o,"quoteStyle")&&!has(quotes,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=!has(o,"customInspect")||o.customInspect;if("boolean"!=typeof i&&"symbol"!==i)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has(o,"numericSeparator")&&"boolean"!=typeof o.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return inspectString(t,o);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var c=String(t);return a?addNumericSeparator(t,c):c}if("bigint"==typeof t){var l=String(t)+"n";return a?addNumericSeparator(t,l):l}var p=void 0===o.depth?5:o.depth;if(void 0===r&&(r=0),r>=p&&p>0&&"object"==typeof t)return isArray(t)?"[Array]":"[Object]";var u=getIndent(o,r);if(void 0===n)n=[];else if(indexOf(n,t)>=0)return"[Circular]";function inspect(t,e,i){if(e&&(n=$arrSlice.call(n)).push(e),i){var a={depth:o.depth};return has(o,"quoteStyle")&&(a.quoteStyle=o.quoteStyle),inspect_(t,a,r+1,n)}return inspect_(t,o,r+1,n)}if("function"==typeof t&&!isRegExp(t)){var s=nameOf(t),f=arrObjKeys(t,inspect);return"[Function"+(s?": "+s:" (anonymous)")+"]"+(f.length>0?" { "+$join.call(f,", ")+" }":"")}if(isSymbol(t)){var y=hasShammedSymbols?$replace.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(t);return"object"!=typeof t||hasShammedSymbols?y:markBoxed(y)}if(isElement(t)){for(var S="<"+$toLowerCase.call(String(t.nodeName)),g=t.attributes||[],b=0;b"}if(isArray(t)){if(0===t.length)return"[]";var m=arrObjKeys(t,inspect);return u&&!singleLineValues(m)?"["+indentedJoin(m,u)+"]":"[ "+$join.call(m,", ")+" ]"}if(isError(t)){var h=arrObjKeys(t,inspect);return"cause"in Error.prototype||!("cause"in t)||isEnumerable.call(t,"cause")?0===h.length?"["+String(t)+"]":"{ ["+String(t)+"] "+$join.call(h,", ")+" }":"{ ["+String(t)+"] "+$join.call($concat.call("[cause]: "+inspect(t.cause),h),", ")+" }"}if("object"==typeof t&&i){if(inspectSymbol&&"function"==typeof t[inspectSymbol]&&utilInspect)return utilInspect(t,{depth:p-r});if("symbol"!==i&&"function"==typeof t.inspect)return t.inspect()}if(isMap(t)){var d=[];return mapForEach&&mapForEach.call(t,(function(e,r){d.push(inspect(r,t,!0)+" => "+inspect(e,t))})),collectionOf("Map",mapSize.call(t),d,u)}if(isSet(t)){var j=[];return setForEach&&setForEach.call(t,(function(e){j.push(inspect(e,t))})),collectionOf("Set",setSize.call(t),j,u)}if(isWeakMap(t))return weakCollectionOf("WeakMap");if(isWeakSet(t))return weakCollectionOf("WeakSet");if(isWeakRef(t))return weakCollectionOf("WeakRef");if(isNumber(t))return markBoxed(inspect(Number(t)));if(isBigInt(t))return markBoxed(inspect(bigIntValueOf.call(t)));if(isBoolean(t))return markBoxed(booleanValueOf.call(t));if(isString(t))return markBoxed(inspect(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||"undefined"!=typeof global&&t===global)return"{ [object globalThis] }";if(!isDate(t)&&!isRegExp(t)){var O=arrObjKeys(t,inspect),w=gPO?gPO(t)===Object.prototype:t instanceof Object||t.constructor===Object,$=t instanceof Object?"":"null prototype",k=!w&&toStringTag&&Object(t)===t&&toStringTag in t?$slice.call(toStr(t),8,-1):$?"Object":"",v=(w||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(k||$?"["+$join.call($concat.call([],k||[],$||[]),": ")+"] ":"");return 0===O.length?v+"{}":u?v+"{"+indentedJoin(O,u)+"}":v+"{ "+$join.call(O,", ")+" }"}return String(t)};var hasOwn=Object.prototype.hasOwnProperty||function(t){return t in this};function has(t,e){return hasOwn.call(t,e)}function toStr(t){return objectToString.call(t)}function nameOf(t){if(t.name)return t.name;var e=$match.call(functionToString.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return inspectString($slice.call(t,0,e.maxStringLength),e)+n}var o=quoteREs[e.quoteStyle||"single"];return o.lastIndex=0,wrapQuotes($replace.call($replace.call(t,o,"\\$1"),/[\x00-\x1f]/g,lowbyte),"single",e)}function lowbyte(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+$toUpperCase.call(e.toString(16))}function markBoxed(t){return"Object("+t+")"}function weakCollectionOf(t){return t+" { ? }"}function collectionOf(t,e,r,n){return t+" ("+e+") {"+(n?indentedJoin(r,n):$join.call(r,", "))+"}"}function singleLineValues(t){for(var e=0;e=0)return!1;return!0}function getIndent(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=$join.call(Array(t.indent+1)," ")}return{base:r,prev:$join.call(Array(e+1),r)}}function indentedJoin(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+$join.call(t,","+r)+"\n"+e.prev}function arrObjKeys(t,e){var r=isArray(t),n=[];if(r){n.length=t.length;for(var o=0;o -1) { + return val.split(','); + } + + if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + + return val; +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = { __proto__: null }; + + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split( + options.delimiter, + options.throwOnLimitExceeded ? limit + 1 : limit + ); + + if (options.throwOnLimitExceeded && parts.length > limit) { + throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); + } + + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key; + var val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + + val = utils.maybeMap( + parseArrayValue( + part.slice(pos + 1), + options, + isArray(obj[key]) ? obj[key].length : 0 + ), + function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + } + ); + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(String(val)); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + var existing = has.call(obj, key); + if (existing && options.duplicates === 'combine') { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === 'last') { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function (chain, val, options, valuesParsed) { + var currentArrayLength = 0; + if (chain.length > 0 && chain[chain.length - 1] === '[]') { + var parentKey = chain.slice(0, -1).join(''); + currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; + } + + var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) + ? [] + : utils.combine([], leaf); + } else { + obj = options.plainObjects ? { __proto__: null } : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === '') { + obj = { 0: leaf }; + } else if ( + !isNaN(index) + && root !== decodedRoot + && String(index) === decodedRoot + && index >= 0 + && (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = leaf; + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + // Get the parent + + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + // Stash the parent if it exists + + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, check strictDepth option for throw, else just add whatever is left + + if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options, valuesParsed); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { + throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); + } + + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + duplicates: duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, + throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? { __proto__: null } : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? { __proto__: null } : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + + if (options.allowSparse === true) { + return obj; + } + + return utils.compact(obj); +}; diff --git a/node_modules/qs/lib/stringify.js b/node_modules/qs/lib/stringify.js new file mode 100644 index 0000000..2666eaf --- /dev/null +++ b/node_modules/qs/lib/stringify.js @@ -0,0 +1,356 @@ +'use strict'; + +var getSideChannel = require('side-channel'); +var utils = require('./utils'); +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; + +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + commaRoundTrip: false, + delimiter: '&', + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + filter: void undefined, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; + +var sentinel = {}; + +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + sideChannel +) { + var obj = object; + + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + // Where object last appeared in the ref tree + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; // Break while + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (generateArrayPrefix === 'comma' && isArray(obj)) { + // we need to join elements in + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); + + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } + + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && key && typeof key.value !== 'undefined' + ? key.value + : obj[key]; + + if (skipNulls && value === null) { + continue; + } + + var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); + var keyPrefix = isArray(obj) + ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix + : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); + + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + var value = obj[key]; + + if (options.skipNulls && value === null) { + continue; + } + pushToArray(keys, stringify( + value, + key, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; diff --git a/node_modules/qs/lib/utils.js b/node_modules/qs/lib/utils.js new file mode 100644 index 0000000..2905ff0 --- /dev/null +++ b/node_modules/qs/lib/utils.js @@ -0,0 +1,268 @@ +'use strict'; + +var formats = require('./formats'); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}()); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } + + item.obj[item.prop] = compacted; + } + } +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? { __proto__: null } : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; + } + + if (typeof source !== 'object' && typeof source !== 'function') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if ( + (options && (options.plainObjects || options.allowPrototypes)) + || !has.call(Object.prototype, source) + ) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; + +var decode = function (str, defaultDecoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; + +var limit = 1024; + +/* eslint operator-linebreak: [2, "before"] */ + +var encode = function encode(str, defaultEncoder, charset, kind, format) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + var out = ''; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; + } + + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } + + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | (c >> 6)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); + + arr[arr.length] = hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } + + out += arr.join(''); + } + + return out; +}; + +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = []; + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj: obj, prop: key }); + refs.push(val); + } + } + } + + compactQueue(queue); + + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b) { + return [].concat(a, b); +}; + +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + return mapped; + } + return fn(val); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + maybeMap: maybeMap, + merge: merge +}; diff --git a/node_modules/qs/package.json b/node_modules/qs/package.json new file mode 100644 index 0000000..e4144d0 --- /dev/null +++ b/node_modules/qs/package.json @@ -0,0 +1,93 @@ +{ + "name": "qs", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/ljharb/qs", + "version": "6.14.0", + "repository": { + "type": "git", + "url": "https://github.com/ljharb/qs.git" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "main": "lib/index.js", + "sideEffects": false, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "keywords": [ + "querystring", + "qs", + "query", + "url", + "parse", + "stringify" + ], + "engines": { + "node": ">=0.6" + }, + "dependencies": { + "side-channel": "^1.1.0" + }, + "devDependencies": { + "@browserify/envify": "^6.0.0", + "@browserify/uglifyify": "^6.0.0", + "@ljharb/eslint-config": "^21.1.1", + "browserify": "^16.5.2", + "bundle-collapser": "^1.4.0", + "common-shakeify": "~1.0.0", + "eclint": "^2.8.1", + "es-value-fixtures": "^1.7.0", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "glob": "=10.3.7", + "has-bigints": "^1.1.0", + "has-override-mistake": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "iconv-lite": "^0.5.1", + "in-publish": "^2.0.1", + "jackspeak": "=2.1.1", + "mkdirp": "^0.5.5", + "mock-property": "^1.1.0", + "module-deps": "^6.2.3", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "qs-iconv": "^1.0.4", + "safe-publish-latest": "^2.0.0", + "safer-buffer": "^2.1.2", + "tape": "^5.9.0", + "unassertify": "^3.0.1" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent readme && npm run --silent lint", + "test": "npm run tests-only", + "tests-only": "nyc tape 'test/**/*.js'", + "posttest": "npx npm@'>=10.2' audit --production", + "readme": "evalmd README.md", + "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)", + "lint": "eslint --ext=js,mjs .", + "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js" + }, + "license": "BSD-3-Clause", + "publishConfig": { + "ignore": [ + "!dist/*", + "bower.json", + "component.json", + ".github/workflows", + "logos", + "tea.yaml" + ] + } +} diff --git a/node_modules/qs/test/empty-keys-cases.js b/node_modules/qs/test/empty-keys-cases.js new file mode 100644 index 0000000..2b1190e --- /dev/null +++ b/node_modules/qs/test/empty-keys-cases.js @@ -0,0 +1,267 @@ +'use strict'; + +module.exports = { + emptyTestCases: [ + { + input: '&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&&', + withEmptyKeys: {}, + stringifyOutput: { + brackets: '', + indices: '', + repeat: '' + }, + noEmptyKeys: {} + }, + { + input: '&=', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '&=&=&', + withEmptyKeys: { '': ['', ''] }, + stringifyOutput: { + brackets: '[]=&[]=', + indices: '[0]=&[1]=', + repeat: '=&=' + }, + noEmptyKeys: {} + }, + { + input: '=', + withEmptyKeys: { '': '' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + } + }, + { + input: '=&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&&&', + withEmptyKeys: { '': '' }, + stringifyOutput: { + brackets: '=', + indices: '=', + repeat: '=' + }, + noEmptyKeys: {} + }, + { + input: '=&=&=&', + withEmptyKeys: { '': ['', '', ''] }, + stringifyOutput: { + brackets: '[]=&[]=&[]=', + indices: '[0]=&[1]=&[2]=', + repeat: '=&=&=' + }, + noEmptyKeys: {} + }, + { + input: '=&a[]=b&a[1]=c', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '=a', + withEmptyKeys: { '': 'a' }, + noEmptyKeys: {}, + stringifyOutput: { + brackets: '=a', + indices: '=a', + repeat: '=a' + } + }, + { + input: 'a==a', + withEmptyKeys: { a: '=a' }, + noEmptyKeys: { a: '=a' }, + stringifyOutput: { + brackets: 'a==a', + indices: 'a==a', + repeat: 'a==a' + } + }, + { + input: '=&a[]=b', + withEmptyKeys: { '': '', a: ['b'] }, + stringifyOutput: { + brackets: '=&a[]=b', + indices: '=&a[0]=b', + repeat: '=&a=b' + }, + noEmptyKeys: { a: ['b'] } + }, + { + input: '=&a[]=b&a[]=c&a[2]=d', + withEmptyKeys: { '': '', a: ['b', 'c', 'd'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c&a[]=d', + indices: '=&a[0]=b&a[1]=c&a[2]=d', + repeat: '=&a=b&a=c&a=d' + }, + noEmptyKeys: { a: ['b', 'c', 'd'] } + }, + { + input: '=a&=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: {} + }, + { + input: '=a&foo=b', + withEmptyKeys: { '': 'a', foo: 'b' }, + noEmptyKeys: { foo: 'b' }, + stringifyOutput: { + brackets: '=a&foo=b', + indices: '=a&foo=b', + repeat: '=a&foo=b' + } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a[0]=b&a=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: 'a=b&a[0]=c&=', + withEmptyKeys: { '': '', a: ['b', 'c'] }, + stringifyOutput: { + brackets: '=&a[]=b&a[]=c', + indices: '=&a[0]=b&a[1]=c', + repeat: '=&a=b&a=c' + }, + noEmptyKeys: { a: ['b', 'c'] } + }, + { + input: '[]=a&[]=b& []=1', + withEmptyKeys: { '': ['a', 'b'], ' ': ['1'] }, + stringifyOutput: { + brackets: '[]=a&[]=b& []=1', + indices: '[0]=a&[1]=b& [0]=1', + repeat: '=a&=b& =1' + }, + noEmptyKeys: { 0: 'a', 1: 'b', ' ': ['1'] } + }, + { + input: '[0]=a&[1]=b&a[0]=1&a[1]=2', + withEmptyKeys: { '': ['a', 'b'], a: ['1', '2'] }, + noEmptyKeys: { 0: 'a', 1: 'b', a: ['1', '2'] }, + stringifyOutput: { + brackets: '[]=a&[]=b&a[]=1&a[]=2', + indices: '[0]=a&[1]=b&a[0]=1&a[1]=2', + repeat: '=a&=b&a=1&a=2' + } + }, + { + input: '[deep]=a&[deep]=2', + withEmptyKeys: { '': { deep: ['a', '2'] } + }, + stringifyOutput: { + brackets: '[deep][]=a&[deep][]=2', + indices: '[deep][0]=a&[deep][1]=2', + repeat: '[deep]=a&[deep]=2' + }, + noEmptyKeys: { deep: ['a', '2'] } + }, + { + input: '%5B0%5D=a&%5B1%5D=b', + withEmptyKeys: { '': ['a', 'b'] }, + stringifyOutput: { + brackets: '[]=a&[]=b', + indices: '[0]=a&[1]=b', + repeat: '=a&=b' + }, + noEmptyKeys: { 0: 'a', 1: 'b' } + } + ] +}; diff --git a/node_modules/qs/test/parse.js b/node_modules/qs/test/parse.js new file mode 100644 index 0000000..32cdfd8 --- /dev/null +++ b/node_modules/qs/test/parse.js @@ -0,0 +1,1276 @@ +'use strict'; + +var test = require('tape'); +var hasPropertyDescriptors = require('has-property-descriptors')(); +var iconv = require('iconv-lite'); +var mockProperty = require('mock-property'); +var hasOverrideMistake = require('has-override-mistake')(); +var SaferBuffer = require('safer-buffer').Buffer; +var v = require('es-value-fixtures'); +var inspect = require('object-inspect'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); + +var qs = require('../'); +var utils = require('../lib/utils'); + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { 0: 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + st.end(); + }); + + t.test('comma: false', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c'), { a: 'b,c' }); + st.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('comma: true', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b,c', { comma: true }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a=c', { comma: true }), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + + st.end(); + }); + + t.test('decode dot keys correctly', function (st) { + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: false, decodeDotInKeys: false }), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name.obj.first=John&name.obj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { name: { obj: { first: 'John', last: 'Doe' } } }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: false }), + { 'name%2Eobj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe', { allowDots: true, decodeDotInKeys: true }), + { 'name.obj': { first: 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: false, decodeDotInKeys: false } + ), + { 'name%2Eobj%2Esubobject.first%2Egodly%2Ename': 'John', 'name%2Eobj%2Esubobject.last': 'Doe' }, + 'with allowDots false and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + { allowDots: true, decodeDotInKeys: false } + ), + { name: { obj: { subobject: { first: { godly: { name: 'John' } }, last: 'Doe' } } } }, + 'with allowDots true and decodeDotInKeys false' + ); + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { allowDots: true, decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots true and decodeDotInKeys true' + ); + st.deepEqual( + qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'), + { 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' }, + 'with allowDots and decodeDotInKeys undefined' + ); + + st.end(); + }); + + t.test('decodes dot in key of object, and allow enabling dot notation when decodeDotInKeys is set to true and allowDots is undefined', function (st) { + st.deepEqual( + qs.parse( + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + { decodeDotInKeys: true } + ), + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + 'with allowDots undefined and decodeDotInKeys true' + ); + + st.end(); + }); + + t.test('throws when decodeDotInKeys is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { decodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allows empty arrays in obj values', function (st) { + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: true }), { foo: [], bar: 'baz' }); + st.deepEqual(qs.parse('foo[]&bar=baz', { allowEmptyArrays: false }), { foo: [''], bar: 'baz' }); + + st.end(); + }); + + t.test('throws when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: 0 }); }, + TypeError + ); + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.parse('foo[]&bar=baz', { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.deepEqual( + qs.parse('testEmptyArray[]', { strictNullHandling: true, allowEmptyArrays: true }), + { testEmptyArray: [] } + ); + + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); + + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); + }); + + t.test('uses original key when depth = 0', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.test('uses original key when depth = false', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' }); + st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' }); + st.end(); + }); + + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); + + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); + }); + + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + + st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + + st.end(); + }); + + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); + }); + + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] }); + st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); + }); + + t.test('limits specific array indices to arrayLimit', function (st) { + st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } }); + + st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a'), { a: { 21: 'a' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); + + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); + }); + + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); + }); + + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); + }); + + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); + }); + + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } }); + st.end(); + }); + + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); + }); + + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } }); + st.end(); + }); + + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); + }); + + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { _r: '1' }); + st.end(); + }); + + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); + }); + + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); + }); + + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); + st.end(); + }); + + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] }); + st.end(); + }); + + t.test('parses sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] }); + st.end(); + }); + + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); + }); + + t.test('parses buffers correctly', function (st) { + var b = SaferBuffer.from('test'); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); + }); + + t.test('parses jquery-param strings', function (st) { + // readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8' + var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8'; + var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] }; + st.deepEqual(qs.parse(encoded), expected); + st.end(); + }); + + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); + }); + + t.test('does not error when parsing a very long array', function (st) { + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str = str + '&' + str; + } + + st.doesNotThrow(function () { + qs.parse(str); + }); + + st.end(); + }); + + t.test('does not throw when a native prototype has an enumerable property', function (st) { + st.intercept(Object.prototype, 'crash', { value: '' }); + st.intercept(Array.prototype, 'crash', { value: '' }); + + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + + st.end(); + }); + + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); + }); + + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } }); + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: 0 }), { a: ['b'] }); + + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: 0 }), { a: { '-1': 'b' } }); + + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: -1 }), { a: { 0: 'b', 1: 'c' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } }); + + st.end(); + }); + + t.test('allows disabling array parsing', function (st) { + var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false }); + st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } }); + st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array'); + + var emptyBrackets = qs.parse('a[]=b', { parseArrays: false }); + st.deepEqual(emptyBrackets, { a: { 0: 'b' } }); + st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array'); + + st.end(); + }); + + t.test('allows for query string prefix', function (st) { + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' }); + st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' }); + + st.end(); + }); + + t.test('parses an object', function (st) { + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses string with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] }); + st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } }); + st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' }); + st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null }); + + // test cases inversed from from stringify tests + st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c'), { a: ['c'] }); + st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] }); + + st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] }); + st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] }); + + st.end(); + }); + + t.test('parses values with comma as array divider', function (st) { + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' }); + st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] }); + st.end(); + }); + + t.test('use number decoder, parses string that has one number with comma option enabled', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (!isNaN(Number(str))) { + return parseFloat(str); + } + return defaultDecoder(str, defaultDecoder, charset, type); + }; + + st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 }); + st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 }); + + st.end(); + }); + + t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses url-encoded brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) { + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=', { comma: true }), { foo: [['1', '2', '3'], ''] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] }); + st.deepEqual(qs.parse('foo%5B%5D=1,2,3&foo%5B%5D=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] }); + + st.end(); + }); + + t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) { + st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' }); + st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] }); + st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] }); + + st.end(); + }); + + t.test('parses an object in dot notation', function (st) { + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input, { allowDots: true }); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object and not child values', function (st) { + var input = { + 'user[name]': { 'pop[bob]': { test: 3 } }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': { test: 3 } }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.parse('a=b&c=d'); + + restore(); + + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); + }); + + t.test('does not crash when parsing deep objects', function (st) { + var parsed; + var str = 'foo'; + + for (var i = 0; i < 5000; i++) { + str += '[p]'; + } + + str += '=bar'; + + st.doesNotThrow(function () { + parsed = qs.parse(str, { depth: 5000 }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + + var depth = 0; + var ref = parsed.foo; + while ((ref = ref.p)) { + depth += 1; + } + + st.equal(depth, 5000, 'parsed is 5000 properties deep'); + + st.end(); + }); + + t.test('parses null objects correctly', { skip: !hasProto }, function (st) { + var a = { __proto__: null, b: 'c' }; + + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); + }); + + t.test('parses dates correctly', function (st) { + var now = new Date(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); + }); + + t.test('parses regular expressions correctly', function (st) { + var re = /^test$/; + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); + }); + + t.test('does not allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {}); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {}); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: false }), + {}, + 'bare "toString" results in {}' + ); + + st.end(); + }); + + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }); + + st.deepEqual( + qs.parse('toString', { allowPrototypes: true }), + { toString: '' }, + 'bare "toString" results in { toString: "" }' + ); + + st.end(); + }); + + t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) { + // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it + // can't be unfrozen. Instead, we add a new non-writable property to simulate this. + st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true })); + + st['throws']( + function () { + var obj = {}; + obj.frozenProp = 'bar'; + }, + // node < 6 has a different error message + /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#'|#)/, + 'regular assignment of an inherited non-writable property throws' + ); + + var parsed; + st.doesNotThrow( + function () { + parsed = qs.parse('frozenProp', { allowPrototypes: false }); + }, + 'parsing a nonwritable Object.prototype property does not throw' + ); + + st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}'); + + st.end(); + }); + + t.test('params starting with a closing bracket', function (st) { + st.deepEqual(qs.parse(']=toString'), { ']': 'toString' }); + st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' }); + st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' }); + st.end(); + }); + + t.test('params starting with a starting bracket', function (st) { + st.deepEqual(qs.parse('[=toString'), { '[': 'toString' }); + st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' }); + st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' }); + st.end(); + }); + + t.test('add keys to objects', function (st) { + st.deepEqual( + qs.parse('a[b]=c&a=d'), + { a: { b: 'c', d: true } }, + 'can add keys to objects' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString'), + { a: { b: 'c' } }, + 'can not overwrite prototype' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { allowPrototypes: true }), + { a: { b: 'c', toString: true } }, + 'can overwrite prototype with allowPrototypes true' + ); + + st.deepEqual( + qs.parse('a[b]=c&a=toString', { plainObjects: true }), + { __proto__: null, a: { __proto__: null, b: 'c', toString: true } }, + 'can overwrite prototype with plainObjects true' + ); + + st.end(); + }); + + t.test('dunder proto is ignored', function (st) { + var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42'; + var result = qs.parse(payload, { allowPrototypes: true }); + + st.deepEqual( + result, + { + categories: { + length: '42' + } + }, + 'silent [[Prototype]] payload' + ); + + var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true }); + + st.deepEqual( + plainResult, + { + __proto__: null, + categories: { + __proto__: null, + length: '42' + } + }, + 'silent [[Prototype]] payload: plain objects' + ); + + var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true }); + + st.notOk(Array.isArray(query.categories), 'is not an array'); + st.notOk(query.categories instanceof Array, 'is not instanceof an array'); + st.deepEqual(query.categories, { some: { json: 'toInject' } }); + st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array'); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }), + { + foo: { + bar: 'stuffs' + } + }, + 'hidden values' + ); + + st.deepEqual( + qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }), + { + __proto__: null, + foo: { + __proto__: null, + bar: 'stuffs' + } + }, + 'hidden values: plain objects' + ); + + st.end(); + }); + + t.test('can return null objects', { skip: !hasProto }, function (st) { + var expected = { + __proto__: null, + a: { + __proto__: null, + b: 'c', + hasOwnProperty: 'd' + } + }; + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), { __proto__: null }); + var expectedArray = { + __proto__: null, + a: { + __proto__: null, + 0: 'b', + c: 'd' + } + }; + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); + }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /%([0-9A-F]{2})/ig; + var result = []; + var parts = reg.exec(str); + while (parts) { + result.push(parseInt(parts[1], 16)); + parts = reg.exec(str); + } + return String(iconv.decode(SaferBuffer.from(result), 'shift_jis')); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('receives the default decoder as a second argument', function (st) { + st.plan(1); + qs.parse('a', { + decoder: function (str, defaultDecoder) { + st.equal(defaultDecoder, utils.decode); + } + }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st['throws'](function () { + qs.parse({}, { decoder: 'string' }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.parse('a[b]=true', options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.parse('a=b', { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('parses an iso-8859-1 string if asked to', function (st) { + st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' }); + st.end(); + }); + + var urlEncodedCheckmarkInUtf8 = '%E2%9C%93'; + var urlEncodedOSlashInUtf8 = '%C3%B8'; + var urlEncodedNumCheckmark = '%26%2310003%3B'; + var urlEncodedNumSmiley = '%26%239786%3B'; + + t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' }); + st.end(); + }); + + t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) { + st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' }); + st.end(); + }); + + t.test('ignores an utf8 sentinel with an unknown value', function (st) { + st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' }); + st.end(); + }); + + t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) { + st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' }); + st.end(); + }); + + t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, { + charset: 'iso-8859-1', + decoder: function (str, defaultDecoder, charset) { + return str ? defaultDecoder(str, defaultDecoder, charset) : null; + }, + interpretNumericEntities: true + }), { foo: null, bar: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' }); + st.end(); + }); + + t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) { + st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' }); + st.end(); + }); + + t.test('interpretNumericEntities with comma:true and iso charset does not crash', function (st) { + st.deepEqual( + qs.parse('b&a[]=1,' + urlEncodedNumSmiley, { comma: true, charset: 'iso-8859-1', interpretNumericEntities: true }), + { b: '', a: ['1,☺'] } + ); + + st.end(); + }); + + t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) { + st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' }); + st.end(); + }); + + t.test('allows for decoding keys and values differently', function (st) { + var decoder = function (str, defaultDecoder, charset, type) { + if (type === 'key') { + return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' }); + st.end(); + }); + + t.test('parameter limit tests', function (st) { + st.test('does not throw error when within parameter limit', function (sst) { + var result = qs.parse('a=1&b=2&c=3', { parameterLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean' + ); + sst.end(); + }); + + st.test('throws error when parameter limit exceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Parameter limit exceeded. Only 3 parameters allowed.'), + 'throws error when parameter limit is exceeded' + ); + sst.end(); + }); + + st.test('silently truncates when throwOnLimitExceeded is not given', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3 }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('silently truncates when parameter limit exceeded without error', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5', { parameterLimit: 3, throwOnLimitExceeded: false }); + sst.deepEqual(result, { a: '1', b: '2', c: '3' }, 'parses and truncates silently'); + sst.end(); + }); + + st.test('allows unlimited parameters when parameterLimit set to Infinity', function (sst) { + var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity }); + sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation'); + sst.end(); + }); + + st.end(); + }); + + t.test('array limit tests', function (st) { + st.test('does not throw error when array is within limit', function (sst) { + var result = qs.parse('a[]=1&a[]=2&a[]=3', { arrayLimit: 5, throwOnLimitExceeded: true }); + sst.deepEqual(result, { a: ['1', '2', '3'] }, 'parses array without errors'); + sst.end(); + }); + + st.test('throws error when throwOnLimitExceeded is present but not boolean for array limit', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: 'true' }); + }, + new TypeError('`throwOnLimitExceeded` option must be a boolean'), + 'throws error when throwOnLimitExceeded is present and not boolean for array limit' + ); + sst.end(); + }); + + st.test('throws error when array limit exceeded', function (sst) { + sst['throws']( + function () { + qs.parse('a[]=1&a[]=2&a[]=3&a[]=4', { arrayLimit: 3, throwOnLimitExceeded: true }); + }, + new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'), + 'throws error when array limit is exceeded' + ); + sst.end(); + }); + + st.test('converts array to object if length is greater than limit', function (sst) { + var result = qs.parse('a[1]=1&a[2]=2&a[3]=3&a[4]=4&a[5]=5&a[6]=6', { arrayLimit: 5 }); + + sst.deepEqual(result, { a: { 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6' } }, 'parses into object if array length is greater than limit'); + sst.end(); + }); + + st.end(); + }); + + t.end(); +}); + +test('parses empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('skips empty string key with ' + testCase.input, function (st) { + st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys); + + st.end(); + }); + }); +}); + +test('`duplicates` option', function (t) { + v.nonStrings.concat('not a valid option').forEach(function (invalidOption) { + if (typeof invalidOption !== 'undefined') { + t['throws']( + function () { qs.parse('', { duplicates: invalidOption }); }, + TypeError, + 'throws on invalid option: ' + inspect(invalidOption) + ); + } + }); + + t.deepEqual( + qs.parse('foo=bar&foo=baz'), + { foo: ['bar', 'baz'] }, + 'duplicates: default, combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'combine' }), + { foo: ['bar', 'baz'] }, + 'duplicates: combine' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), + { foo: 'bar' }, + 'duplicates: first' + ); + + t.deepEqual( + qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), + { foo: 'baz' }, + 'duplicates: last' + ); + + t.end(); +}); + +test('qs strictDepth option - throw cases', function (t) { + t.test('throws an exception when depth exceeds the limit with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for multiple nested arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[0][1][2][3][4]=b', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for nested objects and arrays with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][0][d][e]=f', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + + t.test('throws an exception for different types of values with strictDepth: true', function (st) { + st['throws']( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 3, strictDepth: true }); + }, + RangeError, + 'throws RangeError' + ); + st.end(); + }); + +}); + +test('qs strictDepth option - non-throw cases', function (t) { + t.test('when depth is 0 and strictDepth true, do not throw', function (st) { + st.doesNotThrow( + function () { + qs.parse('a[b][c][d][e]=true&a[b][c][d][f]=42', { depth: 0, strictDepth: true }); + }, + RangeError, + 'does not throw RangeError' + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1, strictDepth: true }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw an exception when depth exceeds the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); + st.deepEqual(result, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }, 'parses with depth limit'); + } + ); + st.end(); + }); + + t.test('parses successfully when depth is within the limit with strictDepth: false', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b]=c', { depth: 1 }); + st.deepEqual(result, { a: { b: 'c' } }, 'parses correctly'); + } + ); + st.end(); + }); + + t.test('does not throw when depth is exactly at the limit with strictDepth: true', function (st) { + st.doesNotThrow( + function () { + var result = qs.parse('a[b][c]=d', { depth: 2, strictDepth: true }); + st.deepEqual(result, { a: { b: { c: 'd' } } }, 'parses correctly'); + } + ); + st.end(); + }); +}); diff --git a/node_modules/qs/test/stringify.js b/node_modules/qs/test/stringify.js new file mode 100644 index 0000000..7253144 --- /dev/null +++ b/node_modules/qs/test/stringify.js @@ -0,0 +1,1306 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var utils = require('../lib/utils'); +var iconv = require('iconv-lite'); +var SaferBuffer = require('safer-buffer').Buffer; +var hasSymbols = require('has-symbols'); +var mockProperty = require('mock-property'); +var emptyTestCases = require('./empty-keys-cases').emptyTestCases; +var hasProto = require('has-proto')(); +var hasBigInt = require('has-bigints')(); + +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); + }); + + t.test('stringifies falsy values', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(null, { strictNullHandling: true }), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(0), ''); + st.end(); + }); + + t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) { + st.equal(qs.stringify(Symbol.iterator), ''); + st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29'); + st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29'); + st.equal( + qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=Symbol%28Symbol.iterator%29' + ); + st.end(); + }); + + t.test('stringifies bigints', { skip: !hasBigInt }, function (st) { + var three = BigInt(3); + var encodeWithN = function (value, defaultEncoder, charset) { + var result = defaultEncoder(value, defaultEncoder, charset); + return typeof value === 'bigint' ? result + 'n' : result; + }; + st.equal(qs.stringify(three), ''); + st.equal(qs.stringify([three]), '0=3'); + st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n'); + st.equal(qs.stringify({ a: three }), 'a=3'); + st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n'); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[]=3' + ); + st.equal( + qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }), + 'a[]=3n' + ); + st.end(); + }); + + t.test('encodes dot in key of object when encodeDotInKeys and allowDots is provided', function (st) { + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj%5Bfirst%5D=John&name.obj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.first=John&name.obj.last=Doe', + 'with allowDots true and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%5Bfirst%5D=John&name%252Eobj%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj': { first: 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: false } + ), + 'name.obj.subobject%5Bfirst.godly.name%5D=John&name.obj.subobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: false } + ), + 'name.obj.subobject.first.godly.name=John&name.obj.subobject.last=Doe', + 'with allowDots false and encodeDotInKeys false' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: false, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject%5Bfirst.godly.name%5D=John&name%252Eobj%252Esubobject%5Blast%5D=Doe', + 'with allowDots false and encodeDotInKeys true' + ); + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { allowDots: true, encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots true and encodeDotInKeys true' + ); + + st.end(); + }); + + t.test('should encode dot in key of object, and automatically set allowDots to `true` when encodeDotInKeys is true and allowDots in undefined', function (st) { + st.equal( + qs.stringify( + { 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, + { encodeDotInKeys: true } + ), + 'name%252Eobj%252Esubobject.first%252Egodly%252Ename=John&name%252Eobj%252Esubobject.last=Doe', + 'with allowDots undefined and encodeDotInKeys true' + ); + st.end(); + }); + + t.test('should encode dot in key of object when encodeDotInKeys and allowDots is provided, and nothing else when encodeValuesOnly is provided', function (st) { + st.equal( + qs.stringify({ 'name.obj': { first: 'John', last: 'Doe' } }, { + encodeDotInKeys: true, allowDots: true, encodeValuesOnly: true + }), + 'name%2Eobj.first=John&name%2Eobj.last=Doe' + ); + + st.equal( + qs.stringify({ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } }, { allowDots: true, encodeDotInKeys: true, encodeValuesOnly: true }), + 'name%2Eobj%2Esubobject.first%2Egodly%2Ename=John&name%2Eobj%2Esubobject.last=Doe' + ); + + st.end(); + }); + + t.test('throws when `commaRoundTrip` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({}, { commaRoundTrip: 'not a boolean' }); }, + TypeError, + 'throws when `commaRoundTrip` is not a boolean' + ); + + st.end(); + }); + + t.test('throws when `encodeDotInKeys` is not a boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { encodeDotInKeys: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('adds query prefix', function (st) { + st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b'); + st.end(); + }); + + t.test('with query prefix, outputs blank string given an empty object', function (st) { + st.equal(qs.stringify({}, { addQueryPrefix: true }), ''); + st.end(); + }); + + t.test('stringifies nested falsy values', function (st) { + st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D='); + st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D'); + st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); + }); + + t.test('`allowDots` option: stringifies a nested object with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); + st.end(); + }); + + t.test('stringifies an array value', function (st) { + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }), + 'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }), + 'a=b%2Cc%2Cd', + 'comma => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma', commaRoundTrip: true }), + 'a=b%2Cc%2Cd', + 'comma round trip => comma' + ); + st.equal( + qs.stringify({ a: ['b', 'c', 'd'] }), + 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d', + 'default => indices' + ); + st.end(); + }); + + t.test('`skipNulls` option', function (st) { + st.equal( + qs.stringify({ a: 'b', c: null }, { skipNulls: true }), + 'a=b', + 'omits nulls when asked' + ); + + st.equal( + qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), + 'a%5Bb%5D=c', + 'omits nested nulls when asked' + ); + + st.end(); + }); + + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + + st.end(); + }); + + t.test('omits object key/value pair when value is empty array', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + + st.end(); + }); + + t.test('should not omit object key/value pair when value is empty array and when asked', function (st) { + st.equal(qs.stringify({ a: [], b: 'zz' }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: false }), 'b=zz'); + st.equal(qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: true }), 'a[]&b=zz'); + + st.end(); + }); + + t.test('should throw when allowEmptyArrays is not of type boolean', function (st) { + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 'foobar' }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: 0 }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: NaN }); }, + TypeError + ); + + st['throws']( + function () { qs.stringify({ a: [], b: 'zz' }, { allowEmptyArrays: null }); }, + TypeError + ); + + st.end(); + }); + + t.test('allowEmptyArrays + strictNullHandling', function (st) { + st.equal( + qs.stringify( + { testEmptyArray: [] }, + { strictNullHandling: true, allowEmptyArrays: true } + ), + 'testEmptyArray[]' + ); + + st.end(); + }); + + t.test('stringifies an array value with one item vs multiple items', function (st) { + st.test('non-array item', function (s2t) { + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: 'c' }, { encodeValuesOnly: true }), 'a=c'); + + s2t.end(); + }); + + st.test('array with a single item', function (s2t) { + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c'); + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a[]=c'); // so it parses back as an array + s2t.equal(qs.stringify({ a: ['c'] }, { encodeValuesOnly: true }), 'a[0]=c'); + + s2t.end(); + }); + + st.test('array with multiple items', function (s2t) { + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=c&a[1]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=c&a[]=d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c,d'); + s2t.equal(qs.stringify({ a: ['c', 'd'] }, { encodeValuesOnly: true }), 'a[0]=c&a[1]=d'); + + s2t.end(); + }); + + st.test('array with multiple items with a comma inside', function (s2t) { + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma' }), 'a=c%2Cd%2Ce'); + + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { encodeValuesOnly: true, arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd,e'); + s2t.equal(qs.stringify({ a: ['c,d', 'e'] }, { arrayFormat: 'comma', commaRoundTrip: true }), 'a=c%2Cd%2Ce'); + + s2t.end(); + }); + + st.end(); + }); + + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d'); + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d'); + st.end(); + }); + + t.test('stringifies comma and empty array values', function (st) { + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'indices' }), 'a[0]=,&a[1]=&a[2]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'brackets' }), 'a[]=,&a[]=&a[]=c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'comma' }), 'a=,,,c,d%'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: false, arrayFormat: 'repeat' }), 'a=,&a=&a=c,d%'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[0]=%2C&a[1]=&a[2]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=%2C&a[]=&a[]=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C,,c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a%5B0%5D=%2C&a%5B1%5D=&a%5B2%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a%5B%5D=%2C&a%5B%5D=&a%5B%5D=c%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C%2C%2Cc%2Cd%25'); + st.equal(qs.stringify({ a: [',', '', 'c,d%'] }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&a=&a=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies comma and empty non-array values', function (st) { + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'indices' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'brackets' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'comma' }), 'a=,&b=&c=c,d%'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: false, arrayFormat: 'repeat' }), 'a=,&b=&c=c,d%'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'indices' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'brackets' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'comma' }), 'a=%2C&b=&c=c%2Cd%25'); + st.equal(qs.stringify({ a: ',', b: '', c: 'c,d%' }, { encode: true, encodeValuesOnly: false, arrayFormat: 'repeat' }), 'a=%2C&b=&c=c%2Cd%25'); + + st.end(); + }); + + t.test('stringifies a nested array value with dots notation', function (st) { + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a.b[0]=c&a.b[1]=d', + 'indices: stringifies with dots + indices' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a.b[]=c&a.b[]=d', + 'brackets: stringifies with dots + brackets' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' } + ), + 'a.b=c,d', + 'comma: stringifies with dots + comma' + ); + st.equal( + qs.stringify( + { a: { b: ['c', 'd'] } }, + { allowDots: true, encodeValuesOnly: true } + ), + 'a.b[0]=c&a.b[1]=d', + 'default: stringifies with dots + indices' + ); + st.end(); + }); + + t.test('stringifies an object inside an array', function (st) { + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b]=c', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b]=c', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b]=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 'c' }] }, { encodeValuesOnly: true }), + 'a[0][b]=c', + 'default => indices' + ); + + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices', encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'repeat', encodeValuesOnly: true }), + 'a[b][c]=1', + 'repeat => repeat' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets', encodeValuesOnly: true }), + 'a[][b][c][]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: { c: [1] } }] }, { encodeValuesOnly: true }), + 'a[0][b][c][0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'indices => indices' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'a[][b]=1&a[]=2&a[]=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }), + '???', + 'brackets => brackets', + { skip: 'TODO: figure out what this should do' } + ); + st.equal( + qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }), + 'a[0][b]=1&a[1]=2&a[2]=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('stringifies an object inside an array with dots notation', function (st) { + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b=c', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b=c', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: 'c' }] }, + { allowDots: true, encode: false } + ), + 'a[0].b=c', + 'default => indices' + ); + + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'indices' } + ), + 'a[0].b.c[0]=1', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false, arrayFormat: 'brackets' } + ), + 'a[].b.c[]=1', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: [{ b: { c: [1] } }] }, + { allowDots: true, encode: false } + ), + 'a[0].b.c[0]=1', + 'default => indices' + ); + + st.end(); + }); + + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses repeat notation for arrays when arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); + }); + + t.test('uses brackets notation for arrays when arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); + }); + + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); + + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); + + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); + + st.end(); + }); + + t.test('stringifies an empty array in different arrayFormat', function (st) { + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c'); + // arrayFormat default + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', commaRoundTrip: true }), 'b[]=&c=c'); + // with strictNullHandling + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true, commaRoundTrip: true }), 'b[]&c=c'); + // with skipNulls + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c'); + st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c'); + + st.end(); + }); + + t.test('stringifies a null object', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ __proto__: null, a: 'b' }), 'a=b'); + st.end(); + }); + + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); + }); + + t.test('stringifies an object with a null object as a child', { skip: !hasProto }, function (st) { + st.equal(qs.stringify({ a: { __proto__: null, b: 'c' } }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); + + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); + }); + + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('stringifies a date', function (st) { + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + st.equal(qs.stringify({ a: now }), str); + st.end(); + }); + + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); + }); + + t.test('skips properties that are part of the object prototype', function (st) { + st.intercept(Object.prototype, 'crash', { value: 'test' }); + + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + + st.end(); + }); + + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test'); + st.end(); + }); + + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var restore = mockProperty(global, 'Buffer', { 'delete': true }); + + var result = qs.stringify({ a: 'b', c: 'd' }); + + restore(); + + st.equal(result, 'a=b&c=d'); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + st['throws']( + function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var circular = { + a: 'value' + }; + circular.a = circular; + st['throws']( + function () { qs.stringify(circular); }, + /RangeError: Cyclic object value/, + 'cyclic values throw' + ); + + var arr = ['a']; + st.doesNotThrow( + function () { qs.stringify({ x: arr, y: arr }); }, + 'non-cyclic values do not throw' + ); + + st.end(); + }); + + t.test('non-circular duplicated references can still work', function (st) { + var hourOfDay = { + 'function': 'hour_of_day' + }; + + var p1 = { + 'function': 'gte', + arguments: [hourOfDay, 0] + }; + var p2 = { + 'function': 'lte', + arguments: [hourOfDay, 23] + }; + + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), + 'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), + 'filters[$and][][function]=gte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=0&filters[$and][][function]=lte&filters[$and][][arguments][][function]=hour_of_day&filters[$and][][arguments][]=23' + ); + st.equal( + qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), + 'filters[$and][function]=gte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=0&filters[$and][function]=lte&filters[$and][arguments][function]=hour_of_day&filters[$and][arguments]=23' + ); + + st.end(); + }); + + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'indices => indices' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' } + ), + 'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3', + 'brackets => brackets' + ); + st.equal( + qs.stringify( + { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, + { filter: ['a', 'b', 0, 2] } + ), + 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3', + 'default => indices' + ); + + st.end(); + }); + + t.test('supports custom representations when filter=function', function (st) { + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + calls += 1; + if (calls === 1) { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { + return void 0; + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); + return value.getTime(); + } + return value; + }; + + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); + }); + + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); + + t.test('can sort the keys', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); + }); + + t.test('can sort the keys at depth 3 or more too', function (st) { + var sort = function (a, b) { + return a.localeCompare(b); + }; + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: sort, encode: false } + ), + 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb' + ); + st.equal( + qs.stringify( + { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' }, + { sort: null, encode: false } + ), + 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b' + ); + st.end(); + }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': '' }, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i = 0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(8); + + qs.stringify({ a: 1, b: new Date(), c: true, d: [1] }, { + encoder: function (str) { + st.match(typeof str, /^(?:string|number|boolean)$/); + return ''; + } + }); + + st.end(); + }); + + t.test('receives the default encoder as a second argument', function (st) { + st.plan(2); + + qs.stringify({ a: 1 }, { + encoder: function (str, defaultEncoder) { + st.equal(defaultEncoder, utils.encode); + } + }); + + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st['throws'](function () { + qs.stringify({}, { encoder: 'string' }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) { + st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + + st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, { + encoder: function (buffer) { + return buffer; + } + }), 'a=a b'); + st.end(); + }); + + t.test('serializeDate option', function (st) { + var date = new Date(); + st.equal( + qs.stringify({ a: date }), + 'a=' + date.toISOString().replace(/:/g, '%3A'), + 'default is toISOString' + ); + + var mutatedDate = new Date(); + mutatedDate.toISOString = function () { + throw new SyntaxError(); + }; + st['throws'](function () { + mutatedDate.toISOString(); + }, SyntaxError); + st.equal( + qs.stringify({ a: mutatedDate }), + 'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'), + 'toISOString works even when method is not locally present' + ); + + var specificDate = new Date(6); + st.equal( + qs.stringify( + { a: specificDate }, + { serializeDate: function (d) { return d.getTime() * 7; } } + ), + 'a=42', + 'custom serializeDate function called' + ); + + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma' + } + ), + 'a=' + date.getTime(), + 'works with arrayFormat comma' + ); + st.equal( + qs.stringify( + { a: [date] }, + { + serializeDate: function (d) { return d.getTime(); }, + arrayFormat: 'comma', + commaRoundTrip: true + } + ), + 'a%5B%5D=' + date.getTime(), + 'works with arrayFormat comma' + ); + + st.end(); + }); + + t.test('RFC 1738 serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b'); + + st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar'); + + st.end(); + }); + + t.test('RFC 3986 spaces serialization', function (st) { + st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Backward compatibility to RFC 3986', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b'); + + st.end(); + }); + + t.test('Edge cases and unknown formats', function (st) { + ['UFO1234', false, 1234, null, {}, []].forEach(function (format) { + st['throws']( + function () { + qs.stringify({ a: 'b c' }, { format: format }); + }, + new TypeError('Unknown format option provided.') + ); + }); + st.end(); + }); + + t.test('encodeValuesOnly', function (st) { + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'indices' } + ), + 'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h', + 'encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'brackets' } + ), + 'a=b&c[]=d&c[]=e%3Df&f[][]=g&f[][]=h', + 'encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] }, + { encodeValuesOnly: true, arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e%3Df&f=g&f=h', + 'encodeValuesOnly + repeat' + ); + + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'indices' } + ), + 'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h', + 'no encodeValuesOnly + indices' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'brackets' } + ), + 'a=b&c%5B%5D=d&c%5B%5D=e&f%5B%5D%5B%5D=g&f%5B%5D%5B%5D=h', + 'no encodeValuesOnly + brackets' + ); + st.equal( + qs.stringify( + { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }, + { arrayFormat: 'repeat' } + ), + 'a=b&c=d&c=e&f=g&f=h', + 'no encodeValuesOnly + repeat' + ); + + st.end(); + }); + + t.test('encodeValuesOnly - strictNullHandling', function (st) { + st.equal( + qs.stringify( + { a: { b: null } }, + { encodeValuesOnly: true, strictNullHandling: true } + ), + 'a[b]' + ); + st.end(); + }); + + t.test('throws if an invalid charset is specified', function (st) { + st['throws'](function () { + qs.stringify({ a: 'b' }, { charset: 'foobar' }); + }, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined')); + st.end(); + }); + + t.test('respects a charset of iso-8859-1', function (st) { + st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6'); + st.end(); + }); + + t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) { + st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B'); + st.end(); + }); + + t.test('respects an explicit charset of utf-8 (the default)', function (st) { + st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6'); + st.end(); + }); + + t.test('`charsetSentinel` option', function (st) { + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), + 'utf8=%E2%9C%93&a=%C3%A6', + 'adds the right sentinel when instructed to and the charset is utf-8' + ); + + st.equal( + qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), + 'utf8=%26%2310003%3B&a=%E6', + 'adds the right sentinel when instructed to and the charset is iso-8859-1' + ); + + st.end(); + }); + + t.test('does not mutate the options argument', function (st) { + var options = {}; + qs.stringify({}, options); + st.deepEqual(options, {}); + st.end(); + }); + + t.test('strictNullHandling works with custom filter', function (st) { + var filter = function (prefix, value) { + return value; + }; + + var options = { strictNullHandling: true, filter: filter }; + st.equal(qs.stringify({ key: null }, options), 'key'); + st.end(); + }); + + t.test('strictNullHandling works with null serializeDate', function (st) { + var serializeDate = function () { + return null; + }; + var options = { strictNullHandling: true, serializeDate: serializeDate }; + var date = new Date(); + st.equal(qs.stringify({ key: date }, options), 'key'); + st.end(); + }); + + t.test('allows for encoding keys and values differently', function (st) { + var encoder = function (str, defaultEncoder, charset, type) { + if (type === 'key') { + return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase(); + } + if (type === 'value') { + return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase(); + } + throw 'this should never happen! type: ' + type; + }; + + st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE'); + st.end(); + }); + + t.test('objects inside arrays', function (st) { + var obj = { a: { b: { c: 'd', e: 'f' } } }; + var withArray = { a: { b: [{ c: 'd', e: 'f' }] } }; + + st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'brackets' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'no array, repeat'); + st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma'); + + st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'brackets' }), 'a[b][][c]=d&a[b][][e]=f', 'array, bracket'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices'); + st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'repeat' }), 'a[b][c]=d&a[b][e]=f', 'array, repeat'); + st.equal( + qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }), + '???', + 'array, comma', + { skip: 'TODO: figure out what this should do' } + ); + + st.end(); + }); + + t.test('stringifies sparse arrays', function (st) { + /* eslint no-sparse-arrays: 0 */ + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1]=2&a[4]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[]=2&a[]=1'); + st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a=2&a=1'); + + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][b][2][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][b][][c]=1'); + st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[b][c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[1][2][3][c][1]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[][][][c][]=1'); + st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true, arrayFormat: 'repeat' }), 'a[c]=1'); + + st.end(); + }); + + t.test('encodes a very long string', function (st) { + var chars = []; + var expected = []; + for (var i = 0; i < 5e3; i++) { + chars.push(' ' + i); + + expected.push('%20' + i); + } + + var obj = { + foo: chars.join('') + }; + + st.equal( + qs.stringify(obj, { arrayFormat: 'brackets', charset: 'utf-8' }), + 'foo=' + expected.join('') + ); + + st.end(); + }); + + t.end(); +}); + +test('stringifies empty keys', function (t) { + emptyTestCases.forEach(function (testCase) { + t.test('stringifies an object with empty string key with ' + testCase.input, function (st) { + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'indices' }), + testCase.stringifyOutput.indices, + 'test case: ' + testCase.input + ', indices' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'brackets' }), + testCase.stringifyOutput.brackets, + 'test case: ' + testCase.input + ', brackets' + ); + st.deepEqual( + qs.stringify(testCase.withEmptyKeys, { encode: false, arrayFormat: 'repeat' }), + testCase.stringifyOutput.repeat, + 'test case: ' + testCase.input + ', repeat' + ); + + st.end(); + }); + }); + + t.test('edge case with object/arrays', function (st) { + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); + st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3'); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false, arrayFormat: 'indices' }), '[][0]=2&[][1]=3&[a]=2'); + + st.end(); + }); + + t.test('stringifies non-string keys', function (st) { + var actual = qs.stringify({ a: 'b', 'false': {} }, { + filter: ['a', false, null], + allowDots: true, + encodeDotInKeys: true + }); + + st.equal(actual, 'a=b', 'stringifies correctly'); + + st.end(); + }); +}); diff --git a/node_modules/qs/test/utils.js b/node_modules/qs/test/utils.js new file mode 100644 index 0000000..3933516 --- /dev/null +++ b/node_modules/qs/test/utils.js @@ -0,0 +1,262 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var SaferBuffer = require('safer-buffer').Buffer; +var forEach = require('for-each'); +var v = require('es-value-fixtures'); + +var utils = require('../lib/utils'); + +test('merge()', function (t) { + t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null'); + + t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array'); + + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + + var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } }); + t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array'); + + var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } }); + t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array'); + + var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' }); + t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array'); + + var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] }); + t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] }); + + var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar'); + t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true }); + + var func = function f() {}; + t.deepEqual( + utils.merge(func, { foo: 'bar' }), + [func, { foo: 'bar' }], + 'functions can not be merged into' + ); + + func.bar = 'baz'; + t.deepEqual( + utils.merge({ foo: 'bar' }, func), + { foo: 'bar', bar: 'baz' }, + 'functions can be merge sources' + ); + + t.test( + 'avoids invoking array setters unnecessarily', + { skip: typeof Object.defineProperty !== 'function' }, + function (st) { + var setCount = 0; + var getCount = 0; + var observed = []; + Object.defineProperty(observed, 0, { + get: function () { + getCount += 1; + return { bar: 'baz' }; + }, + set: function () { setCount += 1; } + }); + utils.merge(observed, [null]); + st.equal(setCount, 0); + st.equal(getCount, 1); + observed[0] = observed[0]; // eslint-disable-line no-self-assign + st.equal(setCount, 1); + st.equal(getCount, 2); + st.end(); + } + ); + + t.end(); +}); + +test('assign()', function (t) { + var target = { a: 1, b: 2 }; + var source = { b: 3, c: 4 }; + var result = utils.assign(target, source); + + t.equal(result, target, 'returns the target'); + t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged'); + t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched'); + + t.end(); +}); + +test('combine()', function (t) { + t.test('both arrays', function (st) { + var a = [1]; + var b = [2]; + var combined = utils.combine(a, b); + + st.deepEqual(a, [1], 'a is not mutated'); + st.deepEqual(b, [2], 'b is not mutated'); + st.notEqual(a, combined, 'a !== combined'); + st.notEqual(b, combined, 'b !== combined'); + st.deepEqual(combined, [1, 2], 'combined is a + b'); + + st.end(); + }); + + t.test('one array, one non-array', function (st) { + var aN = 1; + var a = [aN]; + var bN = 2; + var b = [bN]; + + var combinedAnB = utils.combine(aN, b); + st.deepEqual(b, [bN], 'b is not mutated'); + st.notEqual(aN, combinedAnB, 'aN + b !== aN'); + st.notEqual(a, combinedAnB, 'aN + b !== a'); + st.notEqual(bN, combinedAnB, 'aN + b !== bN'); + st.notEqual(b, combinedAnB, 'aN + b !== b'); + st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array'); + + var combinedABn = utils.combine(a, bN); + st.deepEqual(a, [aN], 'a is not mutated'); + st.notEqual(aN, combinedABn, 'a + bN !== aN'); + st.notEqual(a, combinedABn, 'a + bN !== a'); + st.notEqual(bN, combinedABn, 'a + bN !== bN'); + st.notEqual(b, combinedABn, 'a + bN !== b'); + st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array'); + + st.end(); + }); + + t.test('neither is an array', function (st) { + var combined = utils.combine(1, 2); + st.notEqual(1, combined, '1 + 2 !== 1'); + st.notEqual(2, combined, '1 + 2 !== 2'); + st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array'); + + st.end(); + }); + + t.end(); +}); + +test('decode', function (t) { + t.equal( + utils.decode('a+b'), + 'a b', + 'decodes + to space' + ); + + t.equal( + utils.decode('name%2Eobj'), + 'name.obj', + 'decodes a string' + ); + t.equal( + utils.decode('name%2Eobj%2Efoo', null, 'iso-8859-1'), + 'name.obj.foo', + 'decodes a string in iso-8859-1' + ); + + t.end(); +}); + +test('encode', function (t) { + forEach(v.nullPrimitives, function (nullish) { + t['throws']( + function () { utils.encode(nullish); }, + TypeError, + inspect(nullish) + ' is not a string' + ); + }); + + t.equal(utils.encode(''), '', 'empty string returns itself'); + t.deepEqual(utils.encode([]), [], 'empty array returns itself'); + t.deepEqual(utils.encode({ length: 0 }), { length: 0 }, 'empty arraylike returns itself'); + + t.test('symbols', { skip: !v.hasSymbols }, function (st) { + st.equal(utils.encode(Symbol('x')), 'Symbol%28x%29', 'symbol is encoded'); + + st.end(); + }); + + t.equal( + utils.encode('(abc)'), + '%28abc%29', + 'encodes parentheses' + ); + t.equal( + utils.encode({ toString: function () { return '(abc)'; } }), + '%28abc%29', + 'toStrings and encodes parentheses' + ); + + t.equal( + utils.encode('abc 123 💩', null, 'iso-8859-1'), + 'abc%20123%20%26%2355357%3B%26%2356489%3B', + 'encodes in iso-8859-1' + ); + + var longString = ''; + var expectedString = ''; + for (var i = 0; i < 1500; i++) { + longString += ' '; + expectedString += '%20'; + } + + t.equal( + utils.encode(longString), + expectedString, + 'encodes a long string' + ); + + t.equal( + utils.encode('\x28\x29'), + '%28%29', + 'encodes parens normally' + ); + t.equal( + utils.encode('\x28\x29', null, null, null, 'RFC1738'), + '()', + 'does not encode parens in RFC1738' + ); + + // todo RFC1738 format + + t.equal( + utils.encode('Āက豈'), + '%C4%80%E1%80%80%EF%A4%80', + 'encodes multibyte chars' + ); + + t.equal( + utils.encode('\uD83D \uDCA9'), + '%F0%9F%90%A0%F0%BA%90%80', + 'encodes lone surrogates' + ); + + t.end(); +}); + +test('isBuffer()', function (t) { + forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) { + t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer'); + }); + + var fakeBuffer = { constructor: Buffer }; + t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer'); + + var saferBuffer = SaferBuffer.from('abc'); + t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer'); + + var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc'); + t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer'); + t.end(); +}); + +test('isRegExp()', function (t) { + t.equal(utils.isRegExp(/a/g), true, 'RegExp is a RegExp'); + t.equal(utils.isRegExp(new RegExp('a', 'g')), true, 'new RegExp is a RegExp'); + t.equal(utils.isRegExp(new Date()), false, 'Date is not a RegExp'); + + forEach(v.primitives, function (primitive) { + t.equal(utils.isRegExp(primitive), false, inspect(primitive) + ' is not a RegExp'); + }); + + t.end(); +}); diff --git a/node_modules/randombytes/.travis.yml b/node_modules/randombytes/.travis.yml new file mode 100644 index 0000000..69fdf71 --- /dev/null +++ b/node_modules/randombytes/.travis.yml @@ -0,0 +1,15 @@ +sudo: false +language: node_js +matrix: + include: + - node_js: '7' + env: TEST_SUITE=test + - node_js: '6' + env: TEST_SUITE=test + - node_js: '5' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=phantom +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randombytes/.zuul.yml b/node_modules/randombytes/.zuul.yml new file mode 100644 index 0000000..96d9cfb --- /dev/null +++ b/node_modules/randombytes/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/node_modules/randombytes/LICENSE b/node_modules/randombytes/LICENSE new file mode 100644 index 0000000..fea9d48 --- /dev/null +++ b/node_modules/randombytes/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 crypto-browserify + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/randombytes/README.md b/node_modules/randombytes/README.md new file mode 100644 index 0000000..3bacba4 --- /dev/null +++ b/node_modules/randombytes/README.md @@ -0,0 +1,14 @@ +randombytes +=== + +[![Version](http://img.shields.io/npm/v/randombytes.svg)](https://www.npmjs.org/package/randombytes) [![Build Status](https://travis-ci.org/crypto-browserify/randombytes.svg?branch=master)](https://travis-ci.org/crypto-browserify/randombytes) + +randombytes from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues + +```js +var randomBytes = require('randombytes'); +randomBytes(16);//get 16 random bytes +randomBytes(16, function (err, resp) { + // resp is 16 random bytes +}); +``` diff --git a/node_modules/randombytes/browser.js b/node_modules/randombytes/browser.js new file mode 100644 index 0000000..0fb0b71 --- /dev/null +++ b/node_modules/randombytes/browser.js @@ -0,0 +1,50 @@ +'use strict' + +// limit of Crypto.getRandomValues() +// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues +var MAX_BYTES = 65536 + +// Node supports requesting up to this number of bytes +// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48 +var MAX_UINT32 = 4294967295 + +function oldBrowser () { + throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') +} + +var Buffer = require('safe-buffer').Buffer +var crypto = global.crypto || global.msCrypto + +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser +} + +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > MAX_UINT32) throw new RangeError('requested too many random bytes') + + var bytes = Buffer.allocUnsafe(size) + + if (size > 0) { // getRandomValues fails on IE if size == 0 + if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues + // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + for (var generated = 0; generated < size; generated += MAX_BYTES) { + // buffer.slice automatically checks if the end is past the end of + // the buffer so we don't have to here + crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)) + } + } else { + crypto.getRandomValues(bytes) + } + } + + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) + } + + return bytes +} diff --git a/node_modules/randombytes/index.js b/node_modules/randombytes/index.js new file mode 100644 index 0000000..a2d9e39 --- /dev/null +++ b/node_modules/randombytes/index.js @@ -0,0 +1 @@ +module.exports = require('crypto').randomBytes diff --git a/node_modules/randombytes/package.json b/node_modules/randombytes/package.json new file mode 100644 index 0000000..3623652 --- /dev/null +++ b/node_modules/randombytes/package.json @@ -0,0 +1,36 @@ +{ + "name": "randombytes", + "version": "2.1.0", + "description": "random bytes from browserify stand alone", + "main": "index.js", + "scripts": { + "test": "standard && node test.js | tspec", + "phantom": "zuul --phantom -- test.js", + "local": "zuul --local --no-coverage -- test.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:crypto-browserify/randombytes.git" + }, + "keywords": [ + "crypto", + "random" + ], + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/crypto-browserify/randombytes/issues" + }, + "homepage": "https://github.com/crypto-browserify/randombytes", + "browser": "browser.js", + "devDependencies": { + "phantomjs": "^1.9.9", + "standard": "^10.0.2", + "tap-spec": "^2.1.2", + "tape": "^4.6.3", + "zuul": "^3.7.2" + }, + "dependencies": { + "safe-buffer": "^5.1.0" + } +} diff --git a/node_modules/randombytes/test.js b/node_modules/randombytes/test.js new file mode 100644 index 0000000..f266976 --- /dev/null +++ b/node_modules/randombytes/test.js @@ -0,0 +1,81 @@ +var test = require('tape') +var randomBytes = require('./') +var MAX_BYTES = 65536 +var MAX_UINT32 = 4294967295 + +test('sync', function (t) { + t.plan(9) + t.equals(randomBytes(0).length, 0, 'len: ' + 0) + t.equals(randomBytes(3).length, 3, 'len: ' + 3) + t.equals(randomBytes(30).length, 30, 'len: ' + 30) + t.equals(randomBytes(300).length, 300, 'len: ' + 300) + t.equals(randomBytes(17 + MAX_BYTES).length, 17 + MAX_BYTES, 'len: ' + 17 + MAX_BYTES) + t.equals(randomBytes(MAX_BYTES * 100).length, MAX_BYTES * 100, 'len: ' + MAX_BYTES * 100) + t.throws(function () { + randomBytes(MAX_UINT32 + 1) + }) + t.throws(function () { + t.equals(randomBytes(-1)) + }) + t.throws(function () { + t.equals(randomBytes('hello')) + }) +}) + +test('async', function (t) { + t.plan(9) + + randomBytes(0, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 0, 'len: ' + 0) + }) + + randomBytes(3, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 3, 'len: ' + 3) + }) + + randomBytes(30, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 30, 'len: ' + 30) + }) + + randomBytes(300, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 300, 'len: ' + 300) + }) + + randomBytes(17 + MAX_BYTES, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 17 + MAX_BYTES, 'len: ' + 17 + MAX_BYTES) + }) + + randomBytes(MAX_BYTES * 100, function (err, resp) { + if (err) throw err + + t.equals(resp.length, MAX_BYTES * 100, 'len: ' + MAX_BYTES * 100) + }) + + t.throws(function () { + randomBytes(MAX_UINT32 + 1, function () { + t.ok(false, 'should not get here') + }) + }) + + t.throws(function () { + randomBytes(-1, function () { + t.ok(false, 'should not get here') + }) + }) + + t.throws(function () { + randomBytes('hello', function () { + t.ok(false, 'should not get here') + }) + }) +}) diff --git a/node_modules/range-parser/HISTORY.md b/node_modules/range-parser/HISTORY.md new file mode 100644 index 0000000..70a973d --- /dev/null +++ b/node_modules/range-parser/HISTORY.md @@ -0,0 +1,56 @@ +1.2.1 / 2019-05-10 +================== + + * Improve error when `str` is not a string + +1.2.0 / 2016-06-01 +================== + + * Add `combine` option to combine overlapping ranges + +1.1.0 / 2016-05-13 +================== + + * Fix incorrectly returning -1 when there is at least one valid range + * perf: remove internal function + +1.0.3 / 2015-10-29 +================== + + * perf: enable strict mode + +1.0.2 / 2014-09-08 +================== + + * Support Node.js 0.6 + +1.0.1 / 2014-09-07 +================== + + * Move repository to jshttp + +1.0.0 / 2013-12-11 +================== + + * Add repository to package.json + * Add MIT license + +0.0.4 / 2012-06-17 +================== + + * Change ret -1 for unsatisfiable and -2 when invalid + +0.0.3 / 2012-06-17 +================== + + * Fix last-byte-pos default to len - 1 + +0.0.2 / 2012-06-14 +================== + + * Add `.type` + +0.0.1 / 2012-06-11 +================== + + * Initial release diff --git a/node_modules/range-parser/LICENSE b/node_modules/range-parser/LICENSE new file mode 100644 index 0000000..3599954 --- /dev/null +++ b/node_modules/range-parser/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015-2016 Douglas Christopher Wilson + +```js +var parseRange = require('range-parser') +``` + +### parseRange(size, header, options) + +Parse the given `header` string where `size` is the maximum size of the resource. +An array of ranges will be returned or negative numbers indicating an error parsing. + + * `-2` signals a malformed header string + * `-1` signals an unsatisfiable range + + + +```js +// parse header from request +var range = parseRange(size, req.headers.range) + +// the type of the range +if (range.type === 'bytes') { + // the ranges + range.forEach(function (r) { + // do something with r.start and r.end + }) +} +``` + +#### Options + +These properties are accepted in the options object. + +##### combine + +Specifies if overlapping & adjacent ranges should be combined, defaults to `false`. +When `true`, ranges will be combined and returned as if they were specified that +way in the header. + + + +```js +parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true }) +// => [ +// { start: 0, end: 10 }, +// { start: 50, end: 60 } +// ] +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/range-parser/master +[coveralls-url]: https://coveralls.io/r/jshttp/range-parser?branch=master +[node-image]: https://badgen.net/npm/node/range-parser +[node-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/range-parser +[npm-url]: https://npmjs.org/package/range-parser +[npm-version-image]: https://badgen.net/npm/v/range-parser +[travis-image]: https://badgen.net/travis/jshttp/range-parser/master +[travis-url]: https://travis-ci.org/jshttp/range-parser diff --git a/node_modules/range-parser/index.js b/node_modules/range-parser/index.js new file mode 100644 index 0000000..b7dc5c0 --- /dev/null +++ b/node_modules/range-parser/index.js @@ -0,0 +1,162 @@ +/*! + * range-parser + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = rangeParser + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @param {Object} [options] + * @return {Array} + * @public + */ + +function rangeParser (size, str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string') + } + + var index = str.indexOf('=') + + if (index === -1) { + return -2 + } + + // split the range string + var arr = str.slice(index + 1).split(',') + var ranges = [] + + // add ranges type + ranges.type = str.slice(0, index) + + // parse all ranges + for (var i = 0; i < arr.length; i++) { + var range = arr[i].split('-') + var start = parseInt(range[0], 10) + var end = parseInt(range[1], 10) + + // -nnn + if (isNaN(start)) { + start = size - end + end = size - 1 + // nnn- + } else if (isNaN(end)) { + end = size - 1 + } + + // limit last-byte-pos to current length + if (end > size - 1) { + end = size - 1 + } + + // invalid or unsatisifiable + if (isNaN(start) || isNaN(end) || start > end || start < 0) { + continue + } + + // add range + ranges.push({ + start: start, + end: end + }) + } + + if (ranges.length < 1) { + // unsatisifiable + return -1 + } + + return options && options.combine + ? combineRanges(ranges) + : ranges +} + +/** + * Combine overlapping & adjacent ranges. + * @private + */ + +function combineRanges (ranges) { + var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) + + for (var j = 0, i = 1; i < ordered.length; i++) { + var range = ordered[i] + var current = ordered[j] + + if (range.start > current.end + 1) { + // next range + ordered[++j] = range + } else if (range.end > current.end) { + // extend range + current.end = range.end + current.index = Math.min(current.index, range.index) + } + } + + // trim ordered array + ordered.length = j + 1 + + // generate combined range + var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) + + // copy ranges type + combined.type = ranges.type + + return combined +} + +/** + * Map function to add index value to ranges. + * @private + */ + +function mapWithIndex (range, index) { + return { + start: range.start, + end: range.end, + index: index + } +} + +/** + * Map function to remove index value from ranges. + * @private + */ + +function mapWithoutIndex (range) { + return { + start: range.start, + end: range.end + } +} + +/** + * Sort function to sort ranges by index. + * @private + */ + +function sortByRangeIndex (a, b) { + return a.index - b.index +} + +/** + * Sort function to sort ranges by start position. + * @private + */ + +function sortByRangeStart (a, b) { + return a.start - b.start +} diff --git a/node_modules/range-parser/package.json b/node_modules/range-parser/package.json new file mode 100644 index 0000000..abea6d8 --- /dev/null +++ b/node_modules/range-parser/package.json @@ -0,0 +1,44 @@ +{ + "name": "range-parser", + "author": "TJ Holowaychuk (http://tjholowaychuk.com)", + "description": "Range header field string parser", + "version": "1.2.1", + "contributors": [ + "Douglas Christopher Wilson ", + "James Wyatt Cready ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "keywords": [ + "range", + "parser", + "http" + ], + "repository": "jshttp/range-parser", + "devDependencies": { + "deep-equal": "1.0.1", + "eslint": "5.16.0", + "eslint-config-standard": "12.0.0", + "eslint-plugin-markdown": "1.0.0", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", + "eslint-plugin-standard": "4.0.0", + "mocha": "6.1.4", + "nyc": "14.1.1" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" + } +} diff --git a/node_modules/raw-body/HISTORY.md b/node_modules/raw-body/HISTORY.md new file mode 100644 index 0000000..1da8fb8 --- /dev/null +++ b/node_modules/raw-body/HISTORY.md @@ -0,0 +1,333 @@ +3.0.1 / 2025-09-03 +================== + + * deps: iconv-lite@0.7.0 + - Avoid false positives in encodingExists by using objects without a prototype + - Remove compatibility check for StringDecoder.end method + * Fix the engines field to reflect support for Node >= 0.10 + +3.0.0 / 2024-07-25 +================== + + * deps: iconv-lite@0.6.3 + - Fix HKSCS encoding to prefer Big5 codes + - Fix minor issue in UTF-32 decoder's endianness detection code + - Update 'gb18030' encoding to :2005 edition + +3.0.0-beta.1 / 2023-02-21 +========================= + + * Change TypeScript argument to `NodeJS.ReadableStream` interface + * Drop support for Node.js 0.8 + * deps: iconv-lite@0.5.2 + - Add encoding cp720 + - Add encoding UTF-32 + +2.5.2 / 2023-02-21 +================== + + * Fix error message for non-stream argument + +2.5.1 / 2022-02-28 +================== + + * Fix error on early async hooks implementations + +2.5.0 / 2022-02-21 +================== + + * Prevent loss of async hooks context + * Prevent hanging when stream is not readable + * deps: http-errors@2.0.0 + - deps: depd@2.0.0 + - deps: statuses@2.0.1 + +2.4.3 / 2022-02-14 +================== + + * deps: bytes@3.1.2 + +2.4.2 / 2021-11-16 +================== + + * deps: bytes@3.1.1 + * deps: http-errors@1.8.1 + - deps: setprototypeof@1.2.0 + - deps: toidentifier@1.0.1 + +2.4.1 / 2019-06-25 +================== + + * deps: http-errors@1.7.3 + - deps: inherits@2.0.4 + +2.4.0 / 2019-04-17 +================== + + * deps: bytes@3.1.0 + - Add petabyte (`pb`) support + * deps: http-errors@1.7.2 + - Set constructor name when possible + - deps: setprototypeof@1.1.1 + - deps: statuses@'>= 1.5.0 < 2' + * deps: iconv-lite@0.4.24 + - Added encoding MIK + +2.3.3 / 2018-05-08 +================== + + * deps: http-errors@1.6.3 + - deps: depd@~1.1.2 + - deps: setprototypeof@1.1.0 + - deps: statuses@'>= 1.3.1 < 2' + * deps: iconv-lite@0.4.23 + - Fix loading encoding with year appended + - Fix deprecation warnings on Node.js 10+ + +2.3.2 / 2017-09-09 +================== + + * deps: iconv-lite@0.4.19 + - Fix ISO-8859-1 regression + - Update Windows-1255 + +2.3.1 / 2017-09-07 +================== + + * deps: bytes@3.0.0 + * deps: http-errors@1.6.2 + - deps: depd@1.1.1 + * perf: skip buffer decoding on overage chunk + +2.3.0 / 2017-08-04 +================== + + * Add TypeScript definitions + * Use `http-errors` for standard emitted errors + * deps: bytes@2.5.0 + * deps: iconv-lite@0.4.18 + - Add support for React Native + - Add a warning if not loaded as utf-8 + - Fix CESU-8 decoding in Node.js 8 + - Improve speed of ISO-8859-1 encoding + +2.2.0 / 2017-01-02 +================== + + * deps: iconv-lite@0.4.15 + - Added encoding MS-31J + - Added encoding MS-932 + - Added encoding MS-936 + - Added encoding MS-949 + - Added encoding MS-950 + - Fix GBK/GB18030 handling of Euro character + +2.1.7 / 2016-06-19 +================== + + * deps: bytes@2.4.0 + * perf: remove double-cleanup on happy path + +2.1.6 / 2016-03-07 +================== + + * deps: bytes@2.3.0 + - Drop partial bytes on all parsed units + - Fix parsing byte string that looks like hex + +2.1.5 / 2015-11-30 +================== + + * deps: bytes@2.2.0 + * deps: iconv-lite@0.4.13 + +2.1.4 / 2015-09-27 +================== + + * Fix masking critical errors from `iconv-lite` + * deps: iconv-lite@0.4.12 + - Fix CESU-8 decoding in Node.js 4.x + +2.1.3 / 2015-09-12 +================== + + * Fix sync callback when attaching data listener causes sync read + - Node.js 0.10 compatibility issue + +2.1.2 / 2015-07-05 +================== + + * Fix error stack traces to skip `makeError` + * deps: iconv-lite@0.4.11 + - Add encoding CESU-8 + +2.1.1 / 2015-06-14 +================== + + * Use `unpipe` module for unpiping requests + +2.1.0 / 2015-05-28 +================== + + * deps: iconv-lite@0.4.10 + - Improved UTF-16 endianness detection + - Leading BOM is now removed when decoding + - The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails + +2.0.2 / 2015-05-21 +================== + + * deps: bytes@2.1.0 + - Slight optimizations + +2.0.1 / 2015-05-10 +================== + + * Fix a false-positive when unpiping in Node.js 0.8 + +2.0.0 / 2015-05-08 +================== + + * Return a promise without callback instead of thunk + * deps: bytes@2.0.1 + - units no longer case sensitive when parsing + +1.3.4 / 2015-04-15 +================== + + * Fix hanging callback if request aborts during read + * deps: iconv-lite@0.4.8 + - Add encoding alias UNICODE-1-1-UTF-7 + +1.3.3 / 2015-02-08 +================== + + * deps: iconv-lite@0.4.7 + - Gracefully support enumerables on `Object.prototype` + +1.3.2 / 2015-01-20 +================== + + * deps: iconv-lite@0.4.6 + - Fix rare aliases of single-byte encodings + +1.3.1 / 2014-11-21 +================== + + * deps: iconv-lite@0.4.5 + - Fix Windows-31J and X-SJIS encoding support + +1.3.0 / 2014-07-20 +================== + + * Fully unpipe the stream on error + - Fixes `Cannot switch to old mode now` error on Node.js 0.10+ + +1.2.3 / 2014-07-20 +================== + + * deps: iconv-lite@0.4.4 + - Added encoding UTF-7 + +1.2.2 / 2014-06-19 +================== + + * Send invalid encoding error to callback + +1.2.1 / 2014-06-15 +================== + + * deps: iconv-lite@0.4.3 + - Added encodings UTF-16BE and UTF-16 with BOM + +1.2.0 / 2014-06-13 +================== + + * Passing string as `options` interpreted as encoding + * Support all encodings from `iconv-lite` + +1.1.7 / 2014-06-12 +================== + + * use `string_decoder` module from npm + +1.1.6 / 2014-05-27 +================== + + * check encoding for old streams1 + * support node.js < 0.10.6 + +1.1.5 / 2014-05-14 +================== + + * bump bytes + +1.1.4 / 2014-04-19 +================== + + * allow true as an option + * bump bytes + +1.1.3 / 2014-03-02 +================== + + * fix case when length=null + +1.1.2 / 2013-12-01 +================== + + * be less strict on state.encoding check + +1.1.1 / 2013-11-27 +================== + + * add engines + +1.1.0 / 2013-11-27 +================== + + * add err.statusCode and err.type + * allow for encoding option to be true + * pause the stream instead of dumping on error + * throw if the stream's encoding is set + +1.0.1 / 2013-11-19 +================== + + * dont support streams1, throw if dev set encoding + +1.0.0 / 2013-11-17 +================== + + * rename `expected` option to `length` + +0.2.0 / 2013-11-15 +================== + + * republish + +0.1.1 / 2013-11-15 +================== + + * use bytes + +0.1.0 / 2013-11-11 +================== + + * generator support + +0.0.3 / 2013-10-10 +================== + + * update repo + +0.0.2 / 2013-09-14 +================== + + * dump stream on bad headers + * listen to events after defining received and buffers + +0.0.1 / 2013-09-14 +================== + + * Initial release diff --git a/node_modules/raw-body/LICENSE b/node_modules/raw-body/LICENSE new file mode 100644 index 0000000..1029a7a --- /dev/null +++ b/node_modules/raw-body/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2013-2014 Jonathan Ong +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/raw-body/README.md b/node_modules/raw-body/README.md new file mode 100644 index 0000000..d9b36d6 --- /dev/null +++ b/node_modules/raw-body/README.md @@ -0,0 +1,223 @@ +# raw-body + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build status][github-actions-ci-image]][github-actions-ci-url] +[![Test coverage][coveralls-image]][coveralls-url] + +Gets the entire buffer of a stream either as a `Buffer` or a string. +Validates the stream's length against an expected length and maximum limit. +Ideal for parsing request bodies. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install raw-body +``` + +### TypeScript + +This module includes a [TypeScript](https://www.typescriptlang.org/) +declaration file to enable auto complete in compatible editors and type +information for TypeScript projects. This module depends on the Node.js +types, so install `@types/node`: + +```sh +$ npm install @types/node +``` + +## API + +```js +var getRawBody = require('raw-body') +``` + +### getRawBody(stream, [options], [callback]) + +**Returns a promise if no callback specified and global `Promise` exists.** + +Options: + +- `length` - The length of the stream. + If the contents of the stream do not add up to this length, + an `400` error code is returned. +- `limit` - The byte limit of the body. + This is the number of bytes or any string format supported by + [bytes](https://www.npmjs.com/package/bytes), + for example `1000`, `'500kb'` or `'3mb'`. + If the body ends up being larger than this limit, + a `413` error code is returned. +- `encoding` - The encoding to use to decode the body into a string. + By default, a `Buffer` instance will be returned when no encoding is specified. + Most likely, you want `utf-8`, so setting `encoding` to `true` will decode as `utf-8`. + You can use any type of encoding supported by [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme). + +You can also pass a string in place of options to just specify the encoding. + +If an error occurs, the stream will be paused, everything unpiped, +and you are responsible for correctly disposing the stream. +For HTTP requests, you may need to finish consuming the stream if +you want to keep the socket open for future requests. For streams +that use file descriptors, you should `stream.destroy()` or +`stream.close()` to prevent leaks. + +## Errors + +This module creates errors depending on the error condition during reading. +The error may be an error from the underlying Node.js implementation, but is +otherwise an error created by this module, which has the following attributes: + + * `limit` - the limit in bytes + * `length` and `expected` - the expected length of the stream + * `received` - the received bytes + * `encoding` - the invalid encoding + * `status` and `statusCode` - the corresponding status code for the error + * `type` - the error type + +### Types + +The errors from this module have a `type` property which allows for the programmatic +determination of the type of error returned. + +#### encoding.unsupported + +This error will occur when the `encoding` option is specified, but the value does +not map to an encoding supported by the [iconv-lite](https://www.npmjs.org/package/iconv-lite#readme) +module. + +#### entity.too.large + +This error will occur when the `limit` option is specified, but the stream has +an entity that is larger. + +#### request.aborted + +This error will occur when the request stream is aborted by the client before +reading the body has finished. + +#### request.size.invalid + +This error will occur when the `length` option is specified, but the stream has +emitted more bytes. + +#### stream.encoding.set + +This error will occur when the given stream has an encoding set on it, making it +a decoded stream. The stream should not have an encoding set and is expected to +emit `Buffer` objects. + +#### stream.not.readable + +This error will occur when the given stream is not readable. + +## Examples + +### Simple Express example + +```js +var contentType = require('content-type') +var express = require('express') +var getRawBody = require('raw-body') + +var app = express() + +app.use(function (req, res, next) { + getRawBody(req, { + length: req.headers['content-length'], + limit: '1mb', + encoding: contentType.parse(req).parameters.charset + }, function (err, string) { + if (err) return next(err) + req.text = string + next() + }) +}) + +// now access req.text +``` + +### Simple Koa example + +```js +var contentType = require('content-type') +var getRawBody = require('raw-body') +var koa = require('koa') + +var app = koa() + +app.use(function * (next) { + this.text = yield getRawBody(this.req, { + length: this.req.headers['content-length'], + limit: '1mb', + encoding: contentType.parse(this.req).parameters.charset + }) + yield next +}) + +// now access this.text +``` + +### Using as a promise + +To use this library as a promise, simply omit the `callback` and a promise is +returned, provided that a global `Promise` is defined. + +```js +var getRawBody = require('raw-body') +var http = require('http') + +var server = http.createServer(function (req, res) { + getRawBody(req) + .then(function (buf) { + res.statusCode = 200 + res.end(buf.length + ' bytes submitted') + }) + .catch(function (err) { + res.statusCode = 500 + res.end(err.message) + }) +}) + +server.listen(3000) +``` + +### Using with TypeScript + +```ts +import * as getRawBody from 'raw-body'; +import * as http from 'http'; + +const server = http.createServer((req, res) => { + getRawBody(req) + .then((buf) => { + res.statusCode = 200; + res.end(buf.length + ' bytes submitted'); + }) + .catch((err) => { + res.statusCode = err.statusCode; + res.end(err.message); + }); +}); + +server.listen(3000); +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/raw-body.svg +[npm-url]: https://npmjs.org/package/raw-body +[node-version-image]: https://img.shields.io/node/v/raw-body.svg +[node-version-url]: https://nodejs.org/en/download/ +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/raw-body/master.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/raw-body?branch=master +[downloads-image]: https://img.shields.io/npm/dm/raw-body.svg +[downloads-url]: https://npmjs.org/package/raw-body +[github-actions-ci-image]: https://img.shields.io/github/actions/workflow/status/stream-utils/raw-body/ci.yml?branch=master&label=ci +[github-actions-ci-url]: https://github.com/jshttp/stream-utils/raw-body?query=workflow%3Aci diff --git a/node_modules/raw-body/SECURITY.md b/node_modules/raw-body/SECURITY.md new file mode 100644 index 0000000..2421efc --- /dev/null +++ b/node_modules/raw-body/SECURITY.md @@ -0,0 +1,24 @@ +# Security Policies and Procedures + +## Reporting a Bug + +The `raw-body` team and community take all security bugs seriously. Thank you +for improving the security of Express. We appreciate your efforts and +responsible disclosure and will make every effort to acknowledge your +contributions. + +Report security bugs by emailing the current owners of `raw-body`. This information +can be found in the npm registry using the command `npm owner ls raw-body`. +If unsure or unable to get the information from the above, open an issue +in the [project issue tracker](https://github.com/stream-utils/raw-body/issues) +asking for the current contact information. + +To ensure the timely response to your report, please ensure that the entirety +of the report is contained within the email body and not solely behind a web +link or an attachment. + +At least one owner will acknowledge your email within 48 hours, and will send a +more detailed response within 48 hours indicating the next steps in handling +your report. After the initial reply to your report, the owners will +endeavor to keep you informed of the progress towards a fix and full +announcement, and may ask for additional information or guidance. diff --git a/node_modules/raw-body/index.d.ts b/node_modules/raw-body/index.d.ts new file mode 100644 index 0000000..b504611 --- /dev/null +++ b/node_modules/raw-body/index.d.ts @@ -0,0 +1,85 @@ +declare namespace getRawBody { + export type Encoding = string | true; + + export interface Options { + /** + * The expected length of the stream. + */ + length?: number | string | null; + /** + * The byte limit of the body. This is the number of bytes or any string + * format supported by `bytes`, for example `1000`, `'500kb'` or `'3mb'`. + */ + limit?: number | string | null; + /** + * The encoding to use to decode the body into a string. By default, a + * `Buffer` instance will be returned when no encoding is specified. Most + * likely, you want `utf-8`, so setting encoding to `true` will decode as + * `utf-8`. You can use any type of encoding supported by `iconv-lite`. + */ + encoding?: Encoding | null; + } + + export interface RawBodyError extends Error { + /** + * The limit in bytes. + */ + limit?: number; + /** + * The expected length of the stream. + */ + length?: number; + expected?: number; + /** + * The received bytes. + */ + received?: number; + /** + * The encoding. + */ + encoding?: string; + /** + * The corresponding status code for the error. + */ + status: number; + statusCode: number; + /** + * The error type. + */ + type: string; + } +} + +/** + * Gets the entire buffer of a stream either as a `Buffer` or a string. + * Validates the stream's length against an expected length and maximum + * limit. Ideal for parsing request bodies. + */ +declare function getRawBody( + stream: NodeJS.ReadableStream, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding, + callback: (err: getRawBody.RawBodyError, body: string) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: getRawBody.Options, + callback: (err: getRawBody.RawBodyError, body: Buffer) => void +): void; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options: (getRawBody.Options & { encoding: getRawBody.Encoding }) | getRawBody.Encoding +): Promise; + +declare function getRawBody( + stream: NodeJS.ReadableStream, + options?: getRawBody.Options +): Promise; + +export = getRawBody; diff --git a/node_modules/raw-body/index.js b/node_modules/raw-body/index.js new file mode 100644 index 0000000..9cdcd12 --- /dev/null +++ b/node_modules/raw-body/index.js @@ -0,0 +1,336 @@ +/*! + * raw-body + * Copyright(c) 2013-2014 Jonathan Ong + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var asyncHooks = tryRequireAsyncHooks() +var bytes = require('bytes') +var createError = require('http-errors') +var iconv = require('iconv-lite') +var unpipe = require('unpipe') + +/** + * Module exports. + * @public + */ + +module.exports = getRawBody + +/** + * Module variables. + * @private + */ + +var ICONV_ENCODING_MESSAGE_REGEXP = /^Encoding not recognized: / + +/** + * Get the decoder for a given encoding. + * + * @param {string} encoding + * @private + */ + +function getDecoder (encoding) { + if (!encoding) return null + + try { + return iconv.getDecoder(encoding) + } catch (e) { + // error getting decoder + if (!ICONV_ENCODING_MESSAGE_REGEXP.test(e.message)) throw e + + // the encoding was not found + throw createError(415, 'specified encoding unsupported', { + encoding: encoding, + type: 'encoding.unsupported' + }) + } +} + +/** + * Get the raw body of a stream (typically HTTP). + * + * @param {object} stream + * @param {object|string|function} [options] + * @param {function} [callback] + * @public + */ + +function getRawBody (stream, options, callback) { + var done = callback + var opts = options || {} + + // light validation + if (stream === undefined) { + throw new TypeError('argument stream is required') + } else if (typeof stream !== 'object' || stream === null || typeof stream.on !== 'function') { + throw new TypeError('argument stream must be a stream') + } + + if (options === true || typeof options === 'string') { + // short cut for encoding + opts = { + encoding: options + } + } + + if (typeof options === 'function') { + done = options + opts = {} + } + + // validate callback is a function, if provided + if (done !== undefined && typeof done !== 'function') { + throw new TypeError('argument callback must be a function') + } + + // require the callback without promises + if (!done && !global.Promise) { + throw new TypeError('argument callback is required') + } + + // get encoding + var encoding = opts.encoding !== true + ? opts.encoding + : 'utf-8' + + // convert the limit to an integer + var limit = bytes.parse(opts.limit) + + // convert the expected length to an integer + var length = opts.length != null && !isNaN(opts.length) + ? parseInt(opts.length, 10) + : null + + if (done) { + // classic callback style + return readStream(stream, encoding, length, limit, wrap(done)) + } + + return new Promise(function executor (resolve, reject) { + readStream(stream, encoding, length, limit, function onRead (err, buf) { + if (err) return reject(err) + resolve(buf) + }) + }) +} + +/** + * Halt a stream. + * + * @param {Object} stream + * @private + */ + +function halt (stream) { + // unpipe everything from the stream + unpipe(stream) + + // pause stream + if (typeof stream.pause === 'function') { + stream.pause() + } +} + +/** + * Read the data from the stream. + * + * @param {object} stream + * @param {string} encoding + * @param {number} length + * @param {number} limit + * @param {function} callback + * @public + */ + +function readStream (stream, encoding, length, limit, callback) { + var complete = false + var sync = true + + // check the length and limit options. + // note: we intentionally leave the stream paused, + // so users should handle the stream themselves. + if (limit !== null && length !== null && length > limit) { + return done(createError(413, 'request entity too large', { + expected: length, + length: length, + limit: limit, + type: 'entity.too.large' + })) + } + + // streams1: assert request encoding is buffer. + // streams2+: assert the stream encoding is buffer. + // stream._decoder: streams1 + // state.encoding: streams2 + // state.decoder: streams2, specifically < 0.10.6 + var state = stream._readableState + if (stream._decoder || (state && (state.encoding || state.decoder))) { + // developer error + return done(createError(500, 'stream encoding should not be set', { + type: 'stream.encoding.set' + })) + } + + if (typeof stream.readable !== 'undefined' && !stream.readable) { + return done(createError(500, 'stream is not readable', { + type: 'stream.not.readable' + })) + } + + var received = 0 + var decoder + + try { + decoder = getDecoder(encoding) + } catch (err) { + return done(err) + } + + var buffer = decoder + ? '' + : [] + + // attach listeners + stream.on('aborted', onAborted) + stream.on('close', cleanup) + stream.on('data', onData) + stream.on('end', onEnd) + stream.on('error', onEnd) + + // mark sync section complete + sync = false + + function done () { + var args = new Array(arguments.length) + + // copy arguments + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + + // mark complete + complete = true + + if (sync) { + process.nextTick(invokeCallback) + } else { + invokeCallback() + } + + function invokeCallback () { + cleanup() + + if (args[0]) { + // halt the stream on error + halt(stream) + } + + callback.apply(null, args) + } + } + + function onAborted () { + if (complete) return + + done(createError(400, 'request aborted', { + code: 'ECONNABORTED', + expected: length, + length: length, + received: received, + type: 'request.aborted' + })) + } + + function onData (chunk) { + if (complete) return + + received += chunk.length + + if (limit !== null && received > limit) { + done(createError(413, 'request entity too large', { + limit: limit, + received: received, + type: 'entity.too.large' + })) + } else if (decoder) { + buffer += decoder.write(chunk) + } else { + buffer.push(chunk) + } + } + + function onEnd (err) { + if (complete) return + if (err) return done(err) + + if (length !== null && received !== length) { + done(createError(400, 'request size did not match content length', { + expected: length, + length: length, + received: received, + type: 'request.size.invalid' + })) + } else { + var string = decoder + ? buffer + (decoder.end() || '') + : Buffer.concat(buffer) + done(null, string) + } + } + + function cleanup () { + buffer = null + + stream.removeListener('aborted', onAborted) + stream.removeListener('data', onData) + stream.removeListener('end', onEnd) + stream.removeListener('error', onEnd) + stream.removeListener('close', cleanup) + } +} + +/** + * Try to require async_hooks + * @private + */ + +function tryRequireAsyncHooks () { + try { + return require('async_hooks') + } catch (e) { + return {} + } +} + +/** + * Wrap function with async resource, if possible. + * AsyncResource.bind static method backported. + * @private + */ + +function wrap (fn) { + var res + + // create anonymous resource + if (asyncHooks.AsyncResource) { + res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn') + } + + // incompatible node.js + if (!res || !res.runInAsyncScope) { + return fn + } + + // return bound function + return res.runInAsyncScope.bind(res, fn, null) +} diff --git a/node_modules/raw-body/package.json b/node_modules/raw-body/package.json new file mode 100644 index 0000000..80b777b --- /dev/null +++ b/node_modules/raw-body/package.json @@ -0,0 +1,50 @@ +{ + "name": "raw-body", + "description": "Get and validate the raw body of a readable stream.", + "version": "3.0.1", + "author": "Jonathan Ong (http://jongleberry.com)", + "contributors": [ + "Douglas Christopher Wilson ", + "Raynos " + ], + "license": "MIT", + "repository": "stream-utils/raw-body", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.7.0", + "unpipe": "1.0.0" + }, + "devDependencies": { + "bluebird": "3.7.2", + "eslint": "8.57.0", + "eslint-config-standard": "15.0.1", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-markdown": "3.0.0", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "6.6.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "10.7.0", + "nyc": "17.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.10" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "SECURITY.md", + "index.d.ts", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/readable-stream/.travis.yml b/node_modules/readable-stream/.travis.yml new file mode 100644 index 0000000..f62cdac --- /dev/null +++ b/node_modules/readable-stream/.travis.yml @@ -0,0 +1,34 @@ +sudo: false +language: node_js +before_install: + - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: NPM_LEGACY=true + - node_js: '0.10' + env: NPM_LEGACY=true + - node_js: '0.11' + env: NPM_LEGACY=true + - node_js: '0.12' + env: NPM_LEGACY=true + - node_js: 1 + env: NPM_LEGACY=true + - node_js: 2 + env: NPM_LEGACY=true + - node_js: 3 + env: NPM_LEGACY=true + - node_js: 4 + - node_js: 5 + - node_js: 6 + - node_js: 7 + - node_js: 8 + - node_js: 9 +script: "npm run test" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 0000000..f478d58 --- /dev/null +++ b/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/node_modules/readable-stream/GOVERNANCE.md b/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 0000000..16ffb93 --- /dev/null +++ b/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/node_modules/readable-stream/LICENSE b/node_modules/readable-stream/LICENSE new file mode 100644 index 0000000..2873b3b --- /dev/null +++ b/node_modules/readable-stream/LICENSE @@ -0,0 +1,47 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" diff --git a/node_modules/readable-stream/README.md b/node_modules/readable-stream/README.md new file mode 100644 index 0000000..f1c5a93 --- /dev/null +++ b/node_modules/readable-stream/README.md @@ -0,0 +1,58 @@ +# readable-stream + +***Node-core v8.17.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.17.0/docs/api/stream.html). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> +* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com> + - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E +* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com> diff --git a/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 0000000..83275f1 --- /dev/null +++ b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,60 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section + + diff --git a/node_modules/readable-stream/duplex-browser.js b/node_modules/readable-stream/duplex-browser.js new file mode 100644 index 0000000..f8b2db8 --- /dev/null +++ b/node_modules/readable-stream/duplex-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_duplex.js'); diff --git a/node_modules/readable-stream/duplex.js b/node_modules/readable-stream/duplex.js new file mode 100644 index 0000000..46924cb --- /dev/null +++ b/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require('./readable').Duplex diff --git a/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 0000000..57003c3 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,131 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 0000000..612edb4 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,47 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 0000000..3af95cb --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,1019 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = require('events').EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = require('./internal/streams/BufferList'); +var destroyImpl = require('./internal/streams/destroy'); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', state.awaitDrain); + state.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, { hasUnpiped: false }); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 0000000..fcfc105 --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,214 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 0000000..e1e897f --- /dev/null +++ b/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,685 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = Object.create(require('core-util-is')); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream = require('./internal/streams/stream'); +/**/ + +/**/ + +var Buffer = require('safe-buffer').Buffer; +var OurUint8Array = (typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = require('./internal/streams/destroy'); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + + // reuse the free corkReq. + state.corkedRequestsFree.next = corkReq; +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/BufferList.js b/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 0000000..5e08097 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,78 @@ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = require('safe-buffer').Buffer; +var util = require('util'); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js new file mode 100644 index 0000000..85a8214 --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/destroy.js @@ -0,0 +1,84 @@ +'use strict'; + +/**/ + +var pna = require('process-nextick-args'); +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + pna.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, this, err); + } + } + + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + if (!_this._writableState) { + pna.nextTick(emitErrorNT, _this, err); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + pna.nextTick(emitErrorNT, _this, err); + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; \ No newline at end of file diff --git a/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/readable-stream/lib/internal/streams/stream-browser.js new file mode 100644 index 0000000..9332a3f --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream-browser.js @@ -0,0 +1 @@ +module.exports = require('events').EventEmitter; diff --git a/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/readable-stream/lib/internal/streams/stream.js new file mode 100644 index 0000000..ce2ad5b --- /dev/null +++ b/node_modules/readable-stream/lib/internal/streams/stream.js @@ -0,0 +1 @@ +module.exports = require('stream'); diff --git a/node_modules/readable-stream/node_modules/safe-buffer/LICENSE b/node_modules/readable-stream/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/readable-stream/node_modules/safe-buffer/README.md b/node_modules/readable-stream/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts b/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/readable-stream/node_modules/safe-buffer/index.js b/node_modules/readable-stream/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..22438da --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/index.js @@ -0,0 +1,62 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/readable-stream/node_modules/safe-buffer/package.json b/node_modules/readable-stream/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..623fbc3 --- /dev/null +++ b/node_modules/readable-stream/node_modules/safe-buffer/package.json @@ -0,0 +1,37 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json new file mode 100644 index 0000000..514c178 --- /dev/null +++ b/node_modules/readable-stream/package.json @@ -0,0 +1,52 @@ +{ + "name": "readable-stream", + "version": "2.3.8", + "description": "Streams3, a user-land copy of the stream library from Node.js", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "scripts": { + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "license": "MIT" +} diff --git a/node_modules/readable-stream/passthrough.js b/node_modules/readable-stream/passthrough.js new file mode 100644 index 0000000..ffd791d --- /dev/null +++ b/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/node_modules/readable-stream/readable-browser.js b/node_modules/readable-stream/readable-browser.js new file mode 100644 index 0000000..e503725 --- /dev/null +++ b/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/node_modules/readable-stream/readable.js b/node_modules/readable-stream/readable.js new file mode 100644 index 0000000..ec89ec5 --- /dev/null +++ b/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/node_modules/readable-stream/transform.js b/node_modules/readable-stream/transform.js new file mode 100644 index 0000000..b1baba2 --- /dev/null +++ b/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/node_modules/readable-stream/writable-browser.js b/node_modules/readable-stream/writable-browser.js new file mode 100644 index 0000000..ebdde6a --- /dev/null +++ b/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/node_modules/readable-stream/writable.js b/node_modules/readable-stream/writable.js new file mode 100644 index 0000000..3211a6f --- /dev/null +++ b/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/node_modules/readdirp/LICENSE b/node_modules/readdirp/LICENSE new file mode 100644 index 0000000..037cbb4 --- /dev/null +++ b/node_modules/readdirp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/readdirp/README.md b/node_modules/readdirp/README.md new file mode 100644 index 0000000..df8d32d --- /dev/null +++ b/node_modules/readdirp/README.md @@ -0,0 +1,120 @@ +# readdirp [![Weekly downloads](https://img.shields.io/npm/dw/readdirp.svg)](https://github.com/paulmillr/readdirp) + +Recursive version of fs.readdir. Exposes a **stream API** (with small RAM & CPU footprint) and a **promise API**. + +```sh +npm install readdirp +jsr add jsr:@paulmillr/readdirp +``` + +```javascript +// Use streams to achieve small RAM & CPU footprint. +// 1) Streams example with for-await. +import readdirp from 'readdirp'; +for await (const entry of readdirp('.')) { + const {path} = entry; + console.log(`${JSON.stringify({path})}`); +} + +// 2) Streams example, non for-await. +// Print out all JS files along with their size within the current folder & subfolders. +import readdirp from 'readdirp'; +readdirp('.', {alwaysStat: true, fileFilter: (f) => f.basename.endsWith('.js')}) + .on('data', (entry) => { + const {path, stats: {size}} = entry; + console.log(`${JSON.stringify({path, size})}`); + }) + // Optionally call stream.destroy() in `warn()` in order to abort and cause 'close' to be emitted + .on('warn', error => console.error('non-fatal error', error)) + .on('error', error => console.error('fatal error', error)) + .on('end', () => console.log('done')); + +// 3) Promise example. More RAM and CPU than streams / for-await. +import { readdirpPromise } from 'readdirp'; +const files = await readdirpPromise('.'); +console.log(files.map(file => file.path)); + +// Other options. +import readdirp from 'readdirp'; +readdirp('test', { + fileFilter: (f) => f.basename.endsWith('.js'), + directoryFilter: (d) => d.basename !== '.git', + // directoryFilter: (di) => di.basename.length === 9 + type: 'files_directories', + depth: 1 +}); +``` + +## API + +`const stream = readdirp(root[, options])` — **Stream API** + +- Reads given root recursively and returns a `stream` of [entry infos](#entryinfo) +- Optionally can be used like `for await (const entry of stream)` with node.js 10+ (`asyncIterator`). +- `on('data', (entry) => {})` [entry info](#entryinfo) for every file / dir. +- `on('warn', (error) => {})` non-fatal `Error` that prevents a file / dir from being processed. Example: inaccessible to the user. +- `on('error', (error) => {})` fatal `Error` which also ends the stream. Example: illegal options where passed. +- `on('end')` — we are done. Called when all entries were found and no more will be emitted. +- `on('close')` — stream is destroyed via `stream.destroy()`. + Could be useful if you want to manually abort even on a non fatal error. + At that point the stream is no longer `readable` and no more entries, warning or errors are emitted +- To learn more about streams, consult the very detailed [nodejs streams documentation](https://nodejs.org/api/stream.html) + or the [stream-handbook](https://github.com/substack/stream-handbook) + +`const entries = await readdirp.promise(root[, options])` — **Promise API**. Returns a list of [entry infos](#entryinfo). + +First argument is awalys `root`, path in which to start reading and recursing into subdirectories. + +### options + +- `fileFilter`: filter to include or exclude files + - **Function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry +- `directoryFilter`: filter to include/exclude directories found and to recurse into. Directories that do not pass a filter will not be recursed into. +- `depth: 5`: depth at which to stop recursing even if more subdirectories are found +- `type: 'files'`: determines if data events on the stream should be emitted for `'files'` (default), `'directories'`, `'files_directories'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. +- `alwaysStat: false`: always return `stats` property for every file. Default is `false`, readdirp will return `Dirent` entries. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. +- `lstat: false`: include symlink entries in the stream along with files. When `true`, `fs.lstat` would be used instead of `fs.stat` + +### `EntryInfo` + +Has the following properties: + +- `path: 'assets/javascripts/react.js'`: path to the file/directory (relative to given root) +- `fullPath: '/Users/dev/projects/app/assets/javascripts/react.js'`: full path to the file/directory found +- `basename: 'react.js'`: name of the file/directory +- `dirent: fs.Dirent`: built-in [dir entry object](https://nodejs.org/api/fs.html#fs_class_fs_dirent) - only with `alwaysStat: false` +- `stats: fs.Stats`: built in [stat object](https://nodejs.org/api/fs.html#fs_class_fs_stats) - only with `alwaysStat: true` + +## Changelog + +- 4.0 (Aug 25, 2024) rewritten in typescript, producing hybrid common.js / esm module. + - Remove glob support and all dependencies + - Make sure you're using `let {readdirp} = require('readdirp')` in common.js +- 3.5 (Oct 13, 2020) disallows recursive directory-based symlinks. + Before, it could have entered infinite loop. +- 3.4 (Mar 19, 2020) adds support for directory-based symlinks. +- 3.3 (Dec 6, 2019) stabilizes RAM consumption and enables perf management with `highWaterMark` option. Fixes race conditions related to `for-await` looping. +- 3.2 (Oct 14, 2019) improves performance by 250% and makes streams implementation more idiomatic. +- 3.1 (Jul 7, 2019) brings `bigint` support to `stat` output on Windows. This is backwards-incompatible for some cases. Be careful. It you use it incorrectly, you'll see "TypeError: Cannot mix BigInt and other types, use explicit conversions". +- 3.0 brings huge performance improvements and stream backpressure support. +- Upgrading 2.x to 3.x: + - Signature changed from `readdirp(options)` to `readdirp(root, options)` + - Replaced callback API with promise API. + - Renamed `entryType` option to `type` + - Renamed `entryType: 'both'` to `'files_directories'` + - `EntryInfo` + - Renamed `stat` to `stats` + - Emitted only when `alwaysStat: true` + - `dirent` is emitted instead of `stats` by default with `alwaysStat: false` + - Renamed `name` to `basename` + - Removed `parentDir` and `fullParentDir` properties +- Supported node.js versions: + - 4.x: node 14+ + - 3.x: node 8+ + - 2.x: node 0.6+ + +## License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller () + +MIT License, see [LICENSE](LICENSE) file. diff --git a/node_modules/readdirp/esm/index.d.ts b/node_modules/readdirp/esm/index.d.ts new file mode 100644 index 0000000..df93940 --- /dev/null +++ b/node_modules/readdirp/esm/index.d.ts @@ -0,0 +1,108 @@ +/** + * Recursive version of readdir. Exposes a streaming API and promise API. + * Streaming API allows to use a small amount of RAM. + * + * @module + * @example +```js +import readdirp from 'readdirp'; +for await (const entry of readdirp('.')) { + const {path} = entry; + console.log(`${JSON.stringify({path})}`); +} +``` + */ +/*! readdirp - MIT License (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) */ +import type { Stats, Dirent } from 'node:fs'; +import { Readable } from 'node:stream'; +/** Path in file system. */ +export type Path = string; +/** Emitted entry. Contains relative & absolute path, basename, and either stats or dirent. */ +export interface EntryInfo { + path: string; + fullPath: string; + stats?: Stats; + dirent?: Dirent; + basename: string; +} +/** Path or dir entries (files) */ +export type PathOrDirent = Dirent | Path; +/** Filterer for files */ +export type Tester = (entryInfo: EntryInfo) => boolean; +export type Predicate = string[] | string | Tester; +export declare const EntryTypes: { + readonly FILE_TYPE: "files"; + readonly DIR_TYPE: "directories"; + readonly FILE_DIR_TYPE: "files_directories"; + readonly EVERYTHING_TYPE: "all"; +}; +export type EntryType = (typeof EntryTypes)[keyof typeof EntryTypes]; +/** + * Options for readdirp. + * * type: files, directories, or both + * * lstat: whether to use symlink-friendly stat + * * depth: max depth + * * alwaysStat: whether to use stat (more resources) or dirent + * * highWaterMark: streaming param, specifies max amount of resources per entry + */ +export type ReaddirpOptions = { + root: string; + fileFilter?: Predicate; + directoryFilter?: Predicate; + type?: EntryType; + lstat?: boolean; + depth?: number; + alwaysStat?: boolean; + highWaterMark?: number; +}; +/** Directory entry. Contains path, depth count, and files. */ +export interface DirEntry { + files: PathOrDirent[]; + depth: number; + path: Path; +} +/** Readable readdir stream, emitting new files as they're being listed. */ +export declare class ReaddirpStream extends Readable { + parents: any[]; + reading: boolean; + parent?: DirEntry; + _stat: Function; + _maxDepth: number; + _wantsDir: boolean; + _wantsFile: boolean; + _wantsEverything: boolean; + _root: Path; + _isDirent: boolean; + _statsProp: 'dirent' | 'stats'; + _rdOptions: { + encoding: 'utf8'; + withFileTypes: boolean; + }; + _fileFilter: Tester; + _directoryFilter: Tester; + constructor(options?: Partial); + _read(batch: number): Promise; + _exploreDir(path: Path, depth: number): Promise<{ + files: string[] | undefined; + depth: number; + path: string; + }>; + _formatEntry(dirent: PathOrDirent, path: Path): Promise; + _onError(err: Error): void; + _getEntryType(entry: EntryInfo): Promise; + _includeAsFile(entry: EntryInfo): boolean | undefined; +} +/** + * Streaming version: Reads all files and directories in given root recursively. + * Consumes ~constant small amount of RAM. + * @param root Root directory + * @param options Options to specify root (start directory), filters and recursion depth + */ +export declare function readdirp(root: Path, options?: Partial): ReaddirpStream; +/** + * Promise version: Reads all files and directories in given root recursively. + * Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed. + * @returns array of paths and their entry infos + */ +export declare function readdirpPromise(root: Path, options?: Partial): Promise; +export default readdirp; diff --git a/node_modules/readdirp/esm/index.js b/node_modules/readdirp/esm/index.js new file mode 100644 index 0000000..ae8ca78 --- /dev/null +++ b/node_modules/readdirp/esm/index.js @@ -0,0 +1,257 @@ +import { stat, lstat, readdir, realpath } from 'node:fs/promises'; +import { Readable } from 'node:stream'; +import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from 'node:path'; +export const EntryTypes = { + FILE_TYPE: 'files', + DIR_TYPE: 'directories', + FILE_DIR_TYPE: 'files_directories', + EVERYTHING_TYPE: 'all', +}; +const defaultOptions = { + root: '.', + fileFilter: (_entryInfo) => true, + directoryFilter: (_entryInfo) => true, + type: EntryTypes.FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false, + highWaterMark: 4096, +}; +Object.freeze(defaultOptions); +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const ALL_TYPES = [ + EntryTypes.DIR_TYPE, + EntryTypes.EVERYTHING_TYPE, + EntryTypes.FILE_DIR_TYPE, + EntryTypes.FILE_TYPE, +]; +const DIR_TYPES = new Set([ + EntryTypes.DIR_TYPE, + EntryTypes.EVERYTHING_TYPE, + EntryTypes.FILE_DIR_TYPE, +]); +const FILE_TYPES = new Set([ + EntryTypes.EVERYTHING_TYPE, + EntryTypes.FILE_DIR_TYPE, + EntryTypes.FILE_TYPE, +]); +const isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code); +const wantBigintFsStats = process.platform === 'win32'; +const emptyFn = (_entryInfo) => true; +const normalizeFilter = (filter) => { + if (filter === undefined) + return emptyFn; + if (typeof filter === 'function') + return filter; + if (typeof filter === 'string') { + const fl = filter.trim(); + return (entry) => entry.basename === fl; + } + if (Array.isArray(filter)) { + const trItems = filter.map((item) => item.trim()); + return (entry) => trItems.some((f) => entry.basename === f); + } + return emptyFn; +}; +/** Readable readdir stream, emitting new files as they're being listed. */ +export class ReaddirpStream extends Readable { + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark, + }); + const opts = { ...defaultOptions, ...options }; + const { root, type } = opts; + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = (path) => statMethod(path, { bigint: true }); + } + else { + this._stat = statMethod; + } + this._maxDepth = opts.depth ?? defaultOptions.depth; + this._wantsDir = type ? DIR_TYPES.has(type) : false; + this._wantsFile = type ? FILE_TYPES.has(type) : false; + this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE; + this._root = presolve(root); + this._isDirent = !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + async _read(batch) { + if (this.reading) + return; + this.reading = true; + try { + while (!this.destroyed && batch > 0) { + const par = this.parent; + const fil = par && par.files; + if (fil && fil.length > 0) { + const { path, depth } = par; + const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path)); + const awaited = await Promise.all(slice); + for (const entry of awaited) { + if (!entry) + continue; + if (this.destroyed) + return; + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + if (this._wantsDir) { + this.push(entry); + batch--; + } + } + else if ((entryType === 'file' || this._includeAsFile(entry)) && + this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } + else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) + return; + } + } + } + catch (error) { + this.destroy(error); + } + finally { + this.reading = false; + } + } + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } + catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + async _formatEntry(dirent, path) { + let entry; + const basename = this._isDirent ? dirent.name : dirent; + try { + const fullPath = presolve(pjoin(path, basename)); + entry = { path: prelative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } + catch (err) { + this._onError(err); + return; + } + return entry; + } + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } + else { + this.destroy(err); + } + } + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + if (!entry && this._statsProp in entry) { + return ''; + } + const stats = entry[this._statsProp]; + if (stats.isFile()) + return 'file'; + if (stats.isDirectory()) + return 'directory'; + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) { + const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`); + // @ts-ignore + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } + catch (error) { + this._onError(error); + return ''; + } + } + } + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + return stats && this._wantsEverything && !stats.isDirectory(); + } +} +/** + * Streaming version: Reads all files and directories in given root recursively. + * Consumes ~constant small amount of RAM. + * @param root Root directory + * @param options Options to specify root (start directory), filters and recursion depth + */ +export function readdirp(root, options = {}) { + // @ts-ignore + let type = options.entryType || options.type; + if (type === 'both') + type = EntryTypes.FILE_DIR_TYPE; // backwards-compatibility + if (type) + options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } + else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } + else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + options.root = root; + return new ReaddirpStream(options); +} +/** + * Promise version: Reads all files and directories in given root recursively. + * Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed. + * @returns array of paths and their entry infos + */ +export function readdirpPromise(root, options = {}) { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', (entry) => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', (error) => reject(error)); + }); +} +export default readdirp; diff --git a/node_modules/readdirp/esm/package.json b/node_modules/readdirp/esm/package.json new file mode 100644 index 0000000..8769641 --- /dev/null +++ b/node_modules/readdirp/esm/package.json @@ -0,0 +1 @@ +{ "type": "module", "sideEffects": false } diff --git a/node_modules/readdirp/index.d.ts b/node_modules/readdirp/index.d.ts new file mode 100644 index 0000000..df93940 --- /dev/null +++ b/node_modules/readdirp/index.d.ts @@ -0,0 +1,108 @@ +/** + * Recursive version of readdir. Exposes a streaming API and promise API. + * Streaming API allows to use a small amount of RAM. + * + * @module + * @example +```js +import readdirp from 'readdirp'; +for await (const entry of readdirp('.')) { + const {path} = entry; + console.log(`${JSON.stringify({path})}`); +} +``` + */ +/*! readdirp - MIT License (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) */ +import type { Stats, Dirent } from 'node:fs'; +import { Readable } from 'node:stream'; +/** Path in file system. */ +export type Path = string; +/** Emitted entry. Contains relative & absolute path, basename, and either stats or dirent. */ +export interface EntryInfo { + path: string; + fullPath: string; + stats?: Stats; + dirent?: Dirent; + basename: string; +} +/** Path or dir entries (files) */ +export type PathOrDirent = Dirent | Path; +/** Filterer for files */ +export type Tester = (entryInfo: EntryInfo) => boolean; +export type Predicate = string[] | string | Tester; +export declare const EntryTypes: { + readonly FILE_TYPE: "files"; + readonly DIR_TYPE: "directories"; + readonly FILE_DIR_TYPE: "files_directories"; + readonly EVERYTHING_TYPE: "all"; +}; +export type EntryType = (typeof EntryTypes)[keyof typeof EntryTypes]; +/** + * Options for readdirp. + * * type: files, directories, or both + * * lstat: whether to use symlink-friendly stat + * * depth: max depth + * * alwaysStat: whether to use stat (more resources) or dirent + * * highWaterMark: streaming param, specifies max amount of resources per entry + */ +export type ReaddirpOptions = { + root: string; + fileFilter?: Predicate; + directoryFilter?: Predicate; + type?: EntryType; + lstat?: boolean; + depth?: number; + alwaysStat?: boolean; + highWaterMark?: number; +}; +/** Directory entry. Contains path, depth count, and files. */ +export interface DirEntry { + files: PathOrDirent[]; + depth: number; + path: Path; +} +/** Readable readdir stream, emitting new files as they're being listed. */ +export declare class ReaddirpStream extends Readable { + parents: any[]; + reading: boolean; + parent?: DirEntry; + _stat: Function; + _maxDepth: number; + _wantsDir: boolean; + _wantsFile: boolean; + _wantsEverything: boolean; + _root: Path; + _isDirent: boolean; + _statsProp: 'dirent' | 'stats'; + _rdOptions: { + encoding: 'utf8'; + withFileTypes: boolean; + }; + _fileFilter: Tester; + _directoryFilter: Tester; + constructor(options?: Partial); + _read(batch: number): Promise; + _exploreDir(path: Path, depth: number): Promise<{ + files: string[] | undefined; + depth: number; + path: string; + }>; + _formatEntry(dirent: PathOrDirent, path: Path): Promise; + _onError(err: Error): void; + _getEntryType(entry: EntryInfo): Promise; + _includeAsFile(entry: EntryInfo): boolean | undefined; +} +/** + * Streaming version: Reads all files and directories in given root recursively. + * Consumes ~constant small amount of RAM. + * @param root Root directory + * @param options Options to specify root (start directory), filters and recursion depth + */ +export declare function readdirp(root: Path, options?: Partial): ReaddirpStream; +/** + * Promise version: Reads all files and directories in given root recursively. + * Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed. + * @returns array of paths and their entry infos + */ +export declare function readdirpPromise(root: Path, options?: Partial): Promise; +export default readdirp; diff --git a/node_modules/readdirp/index.js b/node_modules/readdirp/index.js new file mode 100644 index 0000000..0e08e13 --- /dev/null +++ b/node_modules/readdirp/index.js @@ -0,0 +1,263 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReaddirpStream = exports.EntryTypes = void 0; +exports.readdirp = readdirp; +exports.readdirpPromise = readdirpPromise; +const promises_1 = require("node:fs/promises"); +const node_stream_1 = require("node:stream"); +const node_path_1 = require("node:path"); +exports.EntryTypes = { + FILE_TYPE: 'files', + DIR_TYPE: 'directories', + FILE_DIR_TYPE: 'files_directories', + EVERYTHING_TYPE: 'all', +}; +const defaultOptions = { + root: '.', + fileFilter: (_entryInfo) => true, + directoryFilter: (_entryInfo) => true, + type: exports.EntryTypes.FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false, + highWaterMark: 4096, +}; +Object.freeze(defaultOptions); +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const ALL_TYPES = [ + exports.EntryTypes.DIR_TYPE, + exports.EntryTypes.EVERYTHING_TYPE, + exports.EntryTypes.FILE_DIR_TYPE, + exports.EntryTypes.FILE_TYPE, +]; +const DIR_TYPES = new Set([ + exports.EntryTypes.DIR_TYPE, + exports.EntryTypes.EVERYTHING_TYPE, + exports.EntryTypes.FILE_DIR_TYPE, +]); +const FILE_TYPES = new Set([ + exports.EntryTypes.EVERYTHING_TYPE, + exports.EntryTypes.FILE_DIR_TYPE, + exports.EntryTypes.FILE_TYPE, +]); +const isNormalFlowError = (error) => NORMAL_FLOW_ERRORS.has(error.code); +const wantBigintFsStats = process.platform === 'win32'; +const emptyFn = (_entryInfo) => true; +const normalizeFilter = (filter) => { + if (filter === undefined) + return emptyFn; + if (typeof filter === 'function') + return filter; + if (typeof filter === 'string') { + const fl = filter.trim(); + return (entry) => entry.basename === fl; + } + if (Array.isArray(filter)) { + const trItems = filter.map((item) => item.trim()); + return (entry) => trItems.some((f) => entry.basename === f); + } + return emptyFn; +}; +/** Readable readdir stream, emitting new files as they're being listed. */ +class ReaddirpStream extends node_stream_1.Readable { + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark, + }); + const opts = { ...defaultOptions, ...options }; + const { root, type } = opts; + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + const statMethod = opts.lstat ? promises_1.lstat : promises_1.stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = (path) => statMethod(path, { bigint: true }); + } + else { + this._stat = statMethod; + } + this._maxDepth = opts.depth ?? defaultOptions.depth; + this._wantsDir = type ? DIR_TYPES.has(type) : false; + this._wantsFile = type ? FILE_TYPES.has(type) : false; + this._wantsEverything = type === exports.EntryTypes.EVERYTHING_TYPE; + this._root = (0, node_path_1.resolve)(root); + this._isDirent = !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + async _read(batch) { + if (this.reading) + return; + this.reading = true; + try { + while (!this.destroyed && batch > 0) { + const par = this.parent; + const fil = par && par.files; + if (fil && fil.length > 0) { + const { path, depth } = par; + const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path)); + const awaited = await Promise.all(slice); + for (const entry of awaited) { + if (!entry) + continue; + if (this.destroyed) + return; + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + if (this._wantsDir) { + this.push(entry); + batch--; + } + } + else if ((entryType === 'file' || this._includeAsFile(entry)) && + this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } + else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) + return; + } + } + } + catch (error) { + this.destroy(error); + } + finally { + this.reading = false; + } + } + async _exploreDir(path, depth) { + let files; + try { + files = await (0, promises_1.readdir)(path, this._rdOptions); + } + catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + async _formatEntry(dirent, path) { + let entry; + const basename = this._isDirent ? dirent.name : dirent; + try { + const fullPath = (0, node_path_1.resolve)((0, node_path_1.join)(path, basename)); + entry = { path: (0, node_path_1.relative)(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } + catch (err) { + this._onError(err); + return; + } + return entry; + } + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } + else { + this.destroy(err); + } + } + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + if (!entry && this._statsProp in entry) { + return ''; + } + const stats = entry[this._statsProp]; + if (stats.isFile()) + return 'file'; + if (stats.isDirectory()) + return 'directory'; + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await (0, promises_1.realpath)(full); + const entryRealPathStats = await (0, promises_1.lstat)(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === node_path_1.sep) { + const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`); + // @ts-ignore + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } + catch (error) { + this._onError(error); + return ''; + } + } + } + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + return stats && this._wantsEverything && !stats.isDirectory(); + } +} +exports.ReaddirpStream = ReaddirpStream; +/** + * Streaming version: Reads all files and directories in given root recursively. + * Consumes ~constant small amount of RAM. + * @param root Root directory + * @param options Options to specify root (start directory), filters and recursion depth + */ +function readdirp(root, options = {}) { + // @ts-ignore + let type = options.entryType || options.type; + if (type === 'both') + type = exports.EntryTypes.FILE_DIR_TYPE; // backwards-compatibility + if (type) + options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } + else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } + else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + options.root = root; + return new ReaddirpStream(options); +} +/** + * Promise version: Reads all files and directories in given root recursively. + * Compared to streaming version, will consume a lot of RAM e.g. when 1 million files are listed. + * @returns array of paths and their entry infos + */ +function readdirpPromise(root, options = {}) { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', (entry) => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', (error) => reject(error)); + }); +} +exports.default = readdirp; diff --git a/node_modules/readdirp/package.json b/node_modules/readdirp/package.json new file mode 100644 index 0000000..118177c --- /dev/null +++ b/node_modules/readdirp/package.json @@ -0,0 +1,70 @@ +{ + "name": "readdirp", + "description": "Recursive version of fs.readdir with small RAM & CPU footprint.", + "version": "4.1.2", + "homepage": "https://github.com/paulmillr/readdirp", + "repository": { + "type": "git", + "url": "git://github.com/paulmillr/readdirp.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/paulmillr/readdirp/issues" + }, + "author": "Thorsten Lorenz (thlorenz.com)", + "contributors": [ + "Thorsten Lorenz (thlorenz.com)", + "Paul Miller (https://paulmillr.com)" + ], + "engines": { + "node": ">= 14.18.0" + }, + "files": [ + "index.js", + "index.d.ts", + "index.d.ts.map", + "index.js.map", + "esm" + ], + "main": "./index.js", + "module": "./esm/index.js", + "types": "./index.d.ts", + "exports": { + ".": { + "import": "./esm/index.js", + "require": "./index.js" + } + }, + "sideEffects": false, + "keywords": [ + "recursive", + "fs", + "stream", + "streams", + "readdir", + "filesystem", + "find", + "filter" + ], + "scripts": { + "build": "tsc && tsc -p tsconfig.cjs.json", + "lint": "prettier --check index.ts test/index.test.js", + "format": "prettier --write index.ts test/index.test.js", + "test": "node test/index.test.js", + "test:coverage": "c8 node test/index.test.js" + }, + "devDependencies": { + "@paulmillr/jsbt": "0.3.1", + "@types/node": "20.14.8", + "c8": "10.1.3", + "chai": "4.3.4", + "chai-subset": "1.6.0", + "micro-should": "0.5.0", + "prettier": "3.1.1", + "typescript": "5.5.2" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } +} \ No newline at end of file diff --git a/node_modules/release-zalgo/LICENSE b/node_modules/release-zalgo/LICENSE new file mode 100644 index 0000000..a192d7d --- /dev/null +++ b/node_modules/release-zalgo/LICENSE @@ -0,0 +1,14 @@ +ISC License (ISC) +Copyright (c) 2017, Mark Wubben (novemberborn.net) + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/release-zalgo/README.md b/node_modules/release-zalgo/README.md new file mode 100644 index 0000000..9f84fe3 --- /dev/null +++ b/node_modules/release-zalgo/README.md @@ -0,0 +1,194 @@ +# release-zalgo + +Helps you write code with promise-like chains that can run both synchronously +and asynchronously. + +## Installation + +```console +$ npm install --save release-zalgo +``` + +## Usage + +If you use this module, you'll release **Ẕ̶̨̫̹̌͊͌͑͊̕͢͟a̡̜̦̝͓͇͗̉̆̂͋̏͗̍ͅl̡̛̝͍̅͆̎̊̇̕͜͢ģ̧̧͍͓̜̲͖̹̂͋̆̃̑͗̋͌̊̏ͅǫ̷̧͓̣͚̞̣̋̂̑̊̂̀̿̀̚͟͠ͅ**. You mustn't do that. + +Before you proceed, please read this great post by [Isaac +Schlueter](http://izs.me/) on [Designing APIs for +Asynchrony](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). + +The first rule of using this package is to keep your external API consistent. + +The second rule is to accept the burden of controlling Ẕ̶̨̫̹̌͊͌͑͊̕͢͟a̡̜̦̝͓͇͗̉̆̂͋̏͗̍ͅl̡̛̝͍̅͆̎̊̇̕͜͢ģ̧̧͍͓̜̲͖̹̂͋̆̃̑͗̋͌̊̏ͅǫ̷̧͓̣͚̞̣̋̂̑̊̂̀̿̀̚͟͠ͅ by ensuring he does not escape your API boundary. + +With that out of the way… this package lets you write code that can run both +synchronously and asynchronously. This is useful if you have fairly complex +logic for which you don't want to write multiple implementations. See +[`package-hash`](https://github.com/novemberborn/package-hash) for instance. + +This is best shown by example. Let's say you have a `hashFile()` function: + +```js +const crypto = require('crypto') +const fs = require('fs') + +function hashFile (file) { + return new Promise((resolve, reject) => { + fs.readFile(file, (err, buffer) => err ? reject(err) : resolve(buffer)) + }) + .then(buffer => { + const hash = crypto.createHash('sha1') + hash.update(buffer) + return hash.digest('hex') + }) +} +``` + +A synchronous version could be implemented like this: + +```js +function hashFileSync (file) { + const buffer = fs.readFileSync(file) + const hash = crypto.createHash('sha1') + hash.update(buffer) + return hash.digest('hex') +} +``` + +Here's the version that uses `release-zalgo`: + +```js +const crypto = require('crypto') +const fs = require('fs') + +const releaseZalgo = require('release-zalgo') + +const readFile = { + async (file) { + return new Promise((resolve, reject) => { + fs.readFile(file, (err, buffer) => err ? reject(err) : resolve(buffer)) + }) + }, + + sync (file) { + return fs.readFileSync(file) + } +} + +function run (zalgo, file) { + return zalgo.run(readFile, file) + .then(buffer => { + const hash = crypto.createHash('sha1') + hash.update(buffer) + return hash.digest('hex') + }) +} + +function hashFile (file) { + return run(releaseZalgo.async(), file) +} + +function hashFileSync (file) { + const result = run(releaseZalgo.sync(), file) + return releaseZalgo.unwrapSync(result) +} +``` + +Note how close the `run()` implementation is to the original `hashFile()`. + +Just don't do this: + +```js +function badExample (zalgo, file) { + let buffer + zalgo.run(readFile, file) + .then(result => { buffer = result }) + + const hash = crypto.createHash('sha1') + hash.update(buffer) + return hash.digest('hex') +} +``` + +This won't work asynchronously. Just pretend you're working with promises and +you'll be OK. + +## API + +First require the package: + +```js +const releaseZalgo = require('release-zalgo') +``` + +### `releaseZalgo.sync()` + +Returns a `zalgo` object that runs code synchronously: + +```js +const zalgo = releaseZalgo.sync() +``` + +### `releaseZalgo.async()` + +Returns a `zalgo` object that runs code asynchronously: + +```js +const zalgo = releaseZalgo.async() +``` + +### `releaseZalgo.unwrapSync(thenable)` + +Synchronously unwraps a [thenable], which is returned when running +synchronously. Returns the [thenable]s fulfilment value, or throws its +rejection reason. Throws if the [thenable] is asynchronous. + +### `zalgo.run(executors, ...args)` + +When running synchronously, `executors.sync()` is called. When running +asynchronously `executors.async()` is used. The executer is invoked immediately +and passed the remaining arguments. + +For asynchronous execution a `Promise` is returned. It is fulfilled with +`executors.async()`'s return value, or rejected if `executors.async()` throws. + +For synchronous execution a *[thenable]* is returned. It has the same methods as +`Promise` except that callbacks are invoked immediately. The [thenable] is +fulfilled with `executors.sync()`'s return value, or rejected if +`executors.sync()` throws. + +### `zalgo.all(arr)` + +When running synchronously, returns a new [thenable] which is fulfilled with +an array, after unwrapping all items in `arr`. + +When running asynchronously, delegates to `Promise.all(arr)`. + +### `zalgo.returns(value)` + +When running synchronously, returns a new [thenable] which is fulfilled with +`value`. + +When running asynchronously, delegates to `Promise.resolve(value)`. + +### `zalgo.throws(reason)` + +When running synchronously, returns a new [thenable] which is rejected with +`reason`. + +When running asynchronously, delegates to `Promise.reject(reason)`. + +### Thenables + +Thenables are returned when running sychronously. They're much like `Promise`s, +in that they have `then()` and `catch()` methods. You can pass callbacks and +they'll be invoked with the fulfilment value or rejection reason. Callbacks +can return other thenables or throw exceptions. + +Note that `then()` and `catch()` must be called on the thenable, e.g. +`thenable.then()`, not `(thenable.then)()`. + +Thenables should not be exposed outside of your API. Use +`releaseZalgo.unwrapSync()` to unwrap them. + +[thenable]: #thenables diff --git a/node_modules/release-zalgo/index.js b/node_modules/release-zalgo/index.js new file mode 100644 index 0000000..151cb0d --- /dev/null +++ b/node_modules/release-zalgo/index.js @@ -0,0 +1,9 @@ +'use strict' + +const Async = require('./lib/Async') +const Sync = require('./lib/Sync') +const unwrapSync = require('./lib/unwrapSync') + +exports.sync = () => new Sync() +exports.async = () => new Async() +exports.unwrapSync = unwrapSync diff --git a/node_modules/release-zalgo/lib/Async.js b/node_modules/release-zalgo/lib/Async.js new file mode 100644 index 0000000..846f7ad --- /dev/null +++ b/node_modules/release-zalgo/lib/Async.js @@ -0,0 +1,21 @@ +'use strict' + +class Async { + run (executors) { + const args = Array.from(arguments).slice(1) + return new Promise(resolve => resolve(executors.async.apply(null, args))) + } + + all (arr) { + return Promise.all(arr) + } + + returns (value) { + return Promise.resolve(value) + } + + throws (reason) { + return Promise.reject(reason) + } +} +module.exports = Async diff --git a/node_modules/release-zalgo/lib/Sync.js b/node_modules/release-zalgo/lib/Sync.js new file mode 100644 index 0000000..d081d5f --- /dev/null +++ b/node_modules/release-zalgo/lib/Sync.js @@ -0,0 +1,24 @@ +'use strict' + +const Thenable = require('./Thenable') +const unwrapSync = require('./unwrapSync') + +class Sync { + run (executors) { + const args = Array.from(arguments).slice(1) + return new Thenable(() => executors.sync.apply(null, args)) + } + + all (arr) { + return new Thenable(() => arr.map(value => unwrapSync(value))) + } + + returns (value) { + return new Thenable(() => value) + } + + throws (reason) { + return new Thenable(() => { throw reason }) + } +} +module.exports = Sync diff --git a/node_modules/release-zalgo/lib/Thenable.js b/node_modules/release-zalgo/lib/Thenable.js new file mode 100644 index 0000000..7a809b2 --- /dev/null +++ b/node_modules/release-zalgo/lib/Thenable.js @@ -0,0 +1,39 @@ +'use strict' + +const constants = require('./constants') +const unwrapSync = require('./unwrapSync') + +// Behaves like a Promise, though the then() and catch() methods are unbound and +// must be called with the instance as their thisArg. +// +// The executor must either return a value or throw a rejection reason. It is +// not provided resolver or rejecter methods. The executor may return another +// thenable. +class Thenable { + constructor (executor) { + try { + this.result = unwrapSync(executor()) + this.state = constants.RESOLVED + } catch (err) { + this.result = err + this.state = constants.REJECTED + } + } + + then (onFulfilled, onRejected) { + if (this.state === constants.RESOLVED && typeof onFulfilled === 'function') { + return new Thenable(() => onFulfilled(this.result)) + } + + if (this.state === constants.REJECTED && typeof onRejected === 'function') { + return new Thenable(() => onRejected(this.result)) + } + + return this + } + + catch (onRejected) { + return this.then(null, onRejected) + } +} +module.exports = Thenable diff --git a/node_modules/release-zalgo/lib/constants.js b/node_modules/release-zalgo/lib/constants.js new file mode 100644 index 0000000..8c417b5 --- /dev/null +++ b/node_modules/release-zalgo/lib/constants.js @@ -0,0 +1,6 @@ +'use strict' + +exports.PENDING = Symbol('PENDING') +exports.RESOLVED = Symbol('RESOLVED') +exports.REJECTED = Symbol('REJECTED') +exports.ASYNC = Symbol('ASYNC') diff --git a/node_modules/release-zalgo/lib/unwrapSync.js b/node_modules/release-zalgo/lib/unwrapSync.js new file mode 100644 index 0000000..baa130b --- /dev/null +++ b/node_modules/release-zalgo/lib/unwrapSync.js @@ -0,0 +1,54 @@ +'use strict' + +const ExtendableError = require('es6-error') + +const constants = require('./constants') + +class UnwrapError extends ExtendableError { + constructor (thenable) { + super('Could not unwrap asynchronous thenable') + this.thenable = thenable + } +} + +// Logic is derived from the Promise Resolution Procedure, as described in the +// Promises/A+ specification: https://promisesaplus.com/#point-45 +// +// Note that there is no cycle detection. +function unwrapSync (x) { + if (!x || typeof x !== 'object' && typeof x !== 'function') { + return x + } + + const then = x.then + if (typeof then !== 'function') return x + + let state = constants.PENDING + let value + const unwrapValue = y => { + if (state === constants.PENDING) { + state = constants.RESOLVED + value = y + } + } + const unwrapReason = r => { + if (state === constants.PENDING) { + state = constants.REJECTED + value = r + } + } + then.call(x, unwrapValue, unwrapReason) + + if (state === constants.PENDING) { + state = constants.ASYNC + throw new UnwrapError(x) + } + + if (state === constants.RESOLVED) { + return unwrapSync(value) + } + + // state === REJECTED + throw value +} +module.exports = unwrapSync diff --git a/node_modules/release-zalgo/package.json b/node_modules/release-zalgo/package.json new file mode 100644 index 0000000..bb651a4 --- /dev/null +++ b/node_modules/release-zalgo/package.json @@ -0,0 +1,49 @@ +{ + "name": "release-zalgo", + "version": "1.0.0", + "description": "Helps you write code with promise-like chains that can run both synchronously and asynchronously", + "main": "index.js", + "files": [ + "index.js", + "lib" + ], + "engines": { + "node": ">=4" + }, + "scripts": { + "lint": "as-i-preach", + "test": "ava", + "posttest": "as-i-preach", + "coverage": "nyc npm test" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/novemberborn/release-zalgo.git" + }, + "keywords": [ + "babel" + ], + "author": "Mark Wubben (https://novemberborn.net/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/novemberborn/release-zalgo/issues" + }, + "homepage": "https://github.com/novemberborn/release-zalgo#readme", + "dependencies": { + "es6-error": "^4.0.1" + }, + "devDependencies": { + "@novemberborn/as-i-preach": "^7.0.0", + "ava": "^0.18.0", + "coveralls": "^2.11.15", + "nyc": "^10.1.2" + }, + "nyc": { + "reporter": [ + "html", + "lcov", + "text" + ] + }, + "standard-engine": "@novemberborn/as-i-preach" +} diff --git a/node_modules/require-directory/.jshintrc b/node_modules/require-directory/.jshintrc new file mode 100644 index 0000000..e14e4dc --- /dev/null +++ b/node_modules/require-directory/.jshintrc @@ -0,0 +1,67 @@ +{ + "maxerr" : 50, + "bitwise" : true, + "camelcase" : true, + "curly" : true, + "eqeqeq" : true, + "forin" : true, + "immed" : true, + "indent" : 2, + "latedef" : true, + "newcap" : true, + "noarg" : true, + "noempty" : true, + "nonew" : true, + "plusplus" : true, + "quotmark" : true, + "undef" : true, + "unused" : true, + "strict" : true, + "trailing" : true, + "maxparams" : false, + "maxdepth" : false, + "maxstatements" : false, + "maxcomplexity" : false, + "maxlen" : false, + "asi" : false, + "boss" : false, + "debug" : false, + "eqnull" : true, + "es5" : false, + "esnext" : false, + "moz" : false, + "evil" : false, + "expr" : true, + "funcscope" : true, + "globalstrict" : true, + "iterator" : true, + "lastsemic" : false, + "laxbreak" : false, + "laxcomma" : false, + "loopfunc" : false, + "multistr" : false, + "proto" : false, + "scripturl" : false, + "smarttabs" : false, + "shadow" : false, + "sub" : false, + "supernew" : false, + "validthis" : false, + "browser" : true, + "couch" : false, + "devel" : true, + "dojo" : false, + "jquery" : false, + "mootools" : false, + "node" : true, + "nonstandard" : false, + "prototypejs" : false, + "rhino" : false, + "worker" : false, + "wsh" : false, + "yui" : false, + "nomen" : true, + "onevar" : true, + "passfail" : false, + "white" : true +} diff --git a/node_modules/require-directory/.npmignore b/node_modules/require-directory/.npmignore new file mode 100644 index 0000000..47cf365 --- /dev/null +++ b/node_modules/require-directory/.npmignore @@ -0,0 +1 @@ +test/** diff --git a/node_modules/require-directory/.travis.yml b/node_modules/require-directory/.travis.yml new file mode 100644 index 0000000..20fd86b --- /dev/null +++ b/node_modules/require-directory/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.10 diff --git a/node_modules/require-directory/LICENSE b/node_modules/require-directory/LICENSE new file mode 100644 index 0000000..a70f253 --- /dev/null +++ b/node_modules/require-directory/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2011 Troy Goode + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/require-directory/README.markdown b/node_modules/require-directory/README.markdown new file mode 100644 index 0000000..926a063 --- /dev/null +++ b/node_modules/require-directory/README.markdown @@ -0,0 +1,184 @@ +# require-directory + +Recursively iterates over specified directory, `require()`'ing each file, and returning a nested hash structure containing those modules. + +**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)** + +[![NPM](https://nodei.co/npm/require-directory.png?downloads=true&stars=true)](https://nodei.co/npm/require-directory/) + +[![build status](https://secure.travis-ci.org/troygoode/node-require-directory.png)](http://travis-ci.org/troygoode/node-require-directory) + +## How To Use + +### Installation (via [npm](https://npmjs.org/package/require-directory)) + +```bash +$ npm install require-directory +``` + +### Usage + +A common pattern in node.js is to include an index file which creates a hash of the files in its current directory. Given a directory structure like so: + +* app.js +* routes/ + * index.js + * home.js + * auth/ + * login.js + * logout.js + * register.js + +`routes/index.js` uses `require-directory` to build the hash (rather than doing so manually) like so: + +```javascript +var requireDirectory = require('require-directory'); +module.exports = requireDirectory(module); +``` + +`app.js` references `routes/index.js` like any other module, but it now has a hash/tree of the exports from the `./routes/` directory: + +```javascript +var routes = require('./routes'); + +// snip + +app.get('/', routes.home); +app.get('/register', routes.auth.register); +app.get('/login', routes.auth.login); +app.get('/logout', routes.auth.logout); +``` + +The `routes` variable above is the equivalent of this: + +```javascript +var routes = { + home: require('routes/home.js'), + auth: { + login: require('routes/auth/login.js'), + logout: require('routes/auth/logout.js'), + register: require('routes/auth/register.js') + } +}; +``` + +*Note that `routes.index` will be `undefined` as you would hope.* + +### Specifying Another Directory + +You can specify which directory you want to build a tree of (if it isn't the current directory for whatever reason) by passing it as the second parameter. Not specifying the path (`requireDirectory(module)`) is the equivelant of `requireDirectory(module, __dirname)`: + +```javascript +var requireDirectory = require('require-directory'); +module.exports = requireDirectory(module, './some/subdirectory'); +``` + +For example, in the [example in the Usage section](#usage) we could have avoided creating `routes/index.js` and instead changed the first lines of `app.js` to: + +```javascript +var requireDirectory = require('require-directory'); +var routes = requireDirectory(module, './routes'); +``` + +## Options + +You can pass an options hash to `require-directory` as the 2nd parameter (or 3rd if you're passing the path to another directory as the 2nd parameter already). Here are the available options: + +### Whitelisting + +Whitelisting (either via RegExp or function) allows you to specify that only certain files be loaded. + +```javascript +var requireDirectory = require('require-directory'), + whitelist = /onlyinclude.js$/, + hash = requireDirectory(module, {include: whitelist}); +``` + +```javascript +var requireDirectory = require('require-directory'), + check = function(path){ + if(/onlyinclude.js$/.test(path)){ + return true; // don't include + }else{ + return false; // go ahead and include + } + }, + hash = requireDirectory(module, {include: check}); +``` + +### Blacklisting + +Blacklisting (either via RegExp or function) allows you to specify that all but certain files should be loaded. + +```javascript +var requireDirectory = require('require-directory'), + blacklist = /dontinclude\.js$/, + hash = requireDirectory(module, {exclude: blacklist}); +``` + +```javascript +var requireDirectory = require('require-directory'), + check = function(path){ + if(/dontinclude\.js$/.test(path)){ + return false; // don't include + }else{ + return true; // go ahead and include + } + }, + hash = requireDirectory(module, {exclude: check}); +``` + +### Visiting Objects As They're Loaded + +`require-directory` takes a function as the `visit` option that will be called for each module that is added to module.exports. + +```javascript +var requireDirectory = require('require-directory'), + visitor = function(obj) { + console.log(obj); // will be called for every module that is loaded + }, + hash = requireDirectory(module, {visit: visitor}); +``` + +The visitor can also transform the objects by returning a value: + +```javascript +var requireDirectory = require('require-directory'), + visitor = function(obj) { + return obj(new Date()); + }, + hash = requireDirectory(module, {visit: visitor}); +``` + +### Renaming Keys + +```javascript +var requireDirectory = require('require-directory'), + renamer = function(name) { + return name.toUpperCase(); + }, + hash = requireDirectory(module, {rename: renamer}); +``` + +### No Recursion + +```javascript +var requireDirectory = require('require-directory'), + hash = requireDirectory(module, {recurse: false}); +``` + +## Run Unit Tests + +```bash +$ npm run lint +$ npm test +``` + +## License + +[MIT License](http://www.opensource.org/licenses/mit-license.php) + +## Author + +[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com)) + diff --git a/node_modules/require-directory/index.js b/node_modules/require-directory/index.js new file mode 100644 index 0000000..cd37da7 --- /dev/null +++ b/node_modules/require-directory/index.js @@ -0,0 +1,86 @@ +'use strict'; + +var fs = require('fs'), + join = require('path').join, + resolve = require('path').resolve, + dirname = require('path').dirname, + defaultOptions = { + extensions: ['js', 'json', 'coffee'], + recurse: true, + rename: function (name) { + return name; + }, + visit: function (obj) { + return obj; + } + }; + +function checkFileInclusion(path, filename, options) { + return ( + // verify file has valid extension + (new RegExp('\\.(' + options.extensions.join('|') + ')$', 'i').test(filename)) && + + // if options.include is a RegExp, evaluate it and make sure the path passes + !(options.include && options.include instanceof RegExp && !options.include.test(path)) && + + // if options.include is a function, evaluate it and make sure the path passes + !(options.include && typeof options.include === 'function' && !options.include(path, filename)) && + + // if options.exclude is a RegExp, evaluate it and make sure the path doesn't pass + !(options.exclude && options.exclude instanceof RegExp && options.exclude.test(path)) && + + // if options.exclude is a function, evaluate it and make sure the path doesn't pass + !(options.exclude && typeof options.exclude === 'function' && options.exclude(path, filename)) + ); +} + +function requireDirectory(m, path, options) { + var retval = {}; + + // path is optional + if (path && !options && typeof path !== 'string') { + options = path; + path = null; + } + + // default options + options = options || {}; + for (var prop in defaultOptions) { + if (typeof options[prop] === 'undefined') { + options[prop] = defaultOptions[prop]; + } + } + + // if no path was passed in, assume the equivelant of __dirname from caller + // otherwise, resolve path relative to the equivalent of __dirname + path = !path ? dirname(m.filename) : resolve(dirname(m.filename), path); + + // get the path of each file in specified directory, append to current tree node, recurse + fs.readdirSync(path).forEach(function (filename) { + var joined = join(path, filename), + files, + key, + obj; + + if (fs.statSync(joined).isDirectory() && options.recurse) { + // this node is a directory; recurse + files = requireDirectory(m, joined, options); + // exclude empty directories + if (Object.keys(files).length) { + retval[options.rename(filename, joined, filename)] = files; + } + } else { + if (joined !== m.filename && checkFileInclusion(joined, filename, options)) { + // hash node key shouldn't include file extension + key = filename.substring(0, filename.lastIndexOf('.')); + obj = m.require(joined); + retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj; + } + } + }); + + return retval; +} + +module.exports = requireDirectory; +module.exports.defaults = defaultOptions; diff --git a/node_modules/require-directory/package.json b/node_modules/require-directory/package.json new file mode 100644 index 0000000..25ece4b --- /dev/null +++ b/node_modules/require-directory/package.json @@ -0,0 +1,40 @@ +{ + "author": "Troy Goode (http://github.com/troygoode/)", + "name": "require-directory", + "version": "2.1.1", + "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.", + "keywords": [ + "require", + "directory", + "library", + "recursive" + ], + "homepage": "https://github.com/troygoode/node-require-directory/", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/troygoode/node-require-directory.git" + }, + "contributors": [ + { + "name": "Troy Goode", + "email": "troygoode@gmail.com", + "web": "http://github.com/troygoode/" + } + ], + "license": "MIT", + "bugs": { + "url": "http://github.com/troygoode/node-require-directory/issues/" + }, + "engines": { + "node": ">=0.10.0" + }, + "devDependencies": { + "jshint": "^2.6.0", + "mocha": "^2.1.0" + }, + "scripts": { + "test": "mocha", + "lint": "jshint index.js test/test.js" + } +} diff --git a/node_modules/require-main-filename/CHANGELOG.md b/node_modules/require-main-filename/CHANGELOG.md new file mode 100644 index 0000000..717d59e --- /dev/null +++ b/node_modules/require-main-filename/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [2.0.0](https://github.com/yargs/require-main-filename/compare/v1.0.2...v2.0.0) (2019-01-28) + + +### Chores + +* drop support for Node 0.10 ([#11](https://github.com/yargs/require-main-filename/issues/11)) ([87f4e13](https://github.com/yargs/require-main-filename/commit/87f4e13)) + + +### BREAKING CHANGES + +* drop support for Node 0.10/0.12 + + + + +## [1.0.2](https://github.com/yargs/require-main-filename/compare/v1.0.1...v1.0.2) (2017-06-16) + + +### Bug Fixes + +* add files to package.json ([#4](https://github.com/yargs/require-main-filename/issues/4)) ([fa29988](https://github.com/yargs/require-main-filename/commit/fa29988)) diff --git a/node_modules/require-main-filename/LICENSE.txt b/node_modules/require-main-filename/LICENSE.txt new file mode 100644 index 0000000..836440b --- /dev/null +++ b/node_modules/require-main-filename/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/require-main-filename/README.md b/node_modules/require-main-filename/README.md new file mode 100644 index 0000000..820d9f5 --- /dev/null +++ b/node_modules/require-main-filename/README.md @@ -0,0 +1,26 @@ +# require-main-filename + +[![Build Status](https://travis-ci.org/yargs/require-main-filename.png)](https://travis-ci.org/yargs/require-main-filename) +[![Coverage Status](https://coveralls.io/repos/yargs/require-main-filename/badge.svg?branch=master)](https://coveralls.io/r/yargs/require-main-filename?branch=master) +[![NPM version](https://img.shields.io/npm/v/require-main-filename.svg)](https://www.npmjs.com/package/require-main-filename) + +`require.main.filename` is great for figuring out the entry +point for the current application. This can be combined with a module like +[pkg-conf](https://www.npmjs.com/package/pkg-conf) to, _as if by magic_, load +top-level configuration. + +Unfortunately, `require.main.filename` sometimes fails when an application is +executed with an alternative process manager, e.g., [iisnode](https://github.com/tjanczuk/iisnode). + +`require-main-filename` is a shim that addresses this problem. + +## Usage + +```js +var main = require('require-main-filename')() +// use main as an alternative to require.main.filename. +``` + +## License + +ISC diff --git a/node_modules/require-main-filename/index.js b/node_modules/require-main-filename/index.js new file mode 100644 index 0000000..dca7f0c --- /dev/null +++ b/node_modules/require-main-filename/index.js @@ -0,0 +1,18 @@ +module.exports = function (_require) { + _require = _require || require + var main = _require.main + if (main && isIISNode(main)) return handleIISNode(main) + else return main ? main.filename : process.cwd() +} + +function isIISNode (main) { + return /\\iisnode\\/.test(main.filename) +} + +function handleIISNode (main) { + if (!main.children.length) { + return main.filename + } else { + return main.children[0].filename + } +} diff --git a/node_modules/require-main-filename/package.json b/node_modules/require-main-filename/package.json new file mode 100644 index 0000000..a549822 --- /dev/null +++ b/node_modules/require-main-filename/package.json @@ -0,0 +1,35 @@ +{ + "name": "require-main-filename", + "version": "2.0.0", + "description": "shim for require.main.filename() that works in as many environments as possible", + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "tap --coverage test.js", + "release": "standard-version" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/yargs/require-main-filename.git" + }, + "keywords": [ + "require", + "shim", + "iisnode" + ], + "files": [ + "index.js" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/yargs/require-main-filename/issues" + }, + "homepage": "https://github.com/yargs/require-main-filename#readme", + "devDependencies": { + "chai": "^4.0.0", + "standard": "^10.0.3", + "standard-version": "^4.0.0", + "tap": "^11.0.0" + } +} diff --git a/node_modules/resolve-from/index.d.ts b/node_modules/resolve-from/index.d.ts new file mode 100644 index 0000000..dd5f5ef --- /dev/null +++ b/node_modules/resolve-from/index.d.ts @@ -0,0 +1,31 @@ +declare const resolveFrom: { + /** + Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. + + @param fromDirectory - Directory to resolve from. + @param moduleId - What you would use in `require()`. + @returns Resolved module path. Throws when the module can't be found. + + @example + ``` + import resolveFrom = require('resolve-from'); + + // There is a file at `./foo/bar.js` + + resolveFrom('foo', './bar'); + //=> '/Users/sindresorhus/dev/test/foo/bar.js' + ``` + */ + (fromDirectory: string, moduleId: string): string; + + /** + Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path. + + @param fromDirectory - Directory to resolve from. + @param moduleId - What you would use in `require()`. + @returns Resolved module path or `undefined` when the module can't be found. + */ + silent(fromDirectory: string, moduleId: string): string | undefined; +}; + +export = resolveFrom; diff --git a/node_modules/resolve-from/index.js b/node_modules/resolve-from/index.js new file mode 100644 index 0000000..44f291c --- /dev/null +++ b/node_modules/resolve-from/index.js @@ -0,0 +1,47 @@ +'use strict'; +const path = require('path'); +const Module = require('module'); +const fs = require('fs'); + +const resolveFrom = (fromDirectory, moduleId, silent) => { + if (typeof fromDirectory !== 'string') { + throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDirectory}\``); + } + + if (typeof moduleId !== 'string') { + throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``); + } + + try { + fromDirectory = fs.realpathSync(fromDirectory); + } catch (error) { + if (error.code === 'ENOENT') { + fromDirectory = path.resolve(fromDirectory); + } else if (silent) { + return; + } else { + throw error; + } + } + + const fromFile = path.join(fromDirectory, 'noop.js'); + + const resolveFileName = () => Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDirectory) + }); + + if (silent) { + try { + return resolveFileName(); + } catch (error) { + return; + } + } + + return resolveFileName(); +}; + +module.exports = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId); +module.exports.silent = (fromDirectory, moduleId) => resolveFrom(fromDirectory, moduleId, true); diff --git a/node_modules/resolve-from/license b/node_modules/resolve-from/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/resolve-from/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/resolve-from/package.json b/node_modules/resolve-from/package.json new file mode 100644 index 0000000..733df16 --- /dev/null +++ b/node_modules/resolve-from/package.json @@ -0,0 +1,36 @@ +{ + "name": "resolve-from", + "version": "5.0.0", + "description": "Resolve the path of a module like `require.resolve()` but from a given path", + "license": "MIT", + "repository": "sindresorhus/resolve-from", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "require", + "resolve", + "path", + "module", + "from", + "like", + "import" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/resolve-from/readme.md b/node_modules/resolve-from/readme.md new file mode 100644 index 0000000..fd4f46f --- /dev/null +++ b/node_modules/resolve-from/readme.md @@ -0,0 +1,72 @@ +# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) + +> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path + + +## Install + +``` +$ npm install resolve-from +``` + + +## Usage + +```js +const resolveFrom = require('resolve-from'); + +// There is a file at `./foo/bar.js` + +resolveFrom('foo', './bar'); +//=> '/Users/sindresorhus/dev/test/foo/bar.js' +``` + + +## API + +### resolveFrom(fromDirectory, moduleId) + +Like `require()`, throws when the module can't be found. + +### resolveFrom.silent(fromDirectory, moduleId) + +Returns `undefined` instead of throwing when the module can't be found. + +#### fromDirectory + +Type: `string` + +Directory to resolve from. + +#### moduleId + +Type: `string` + +What you would use in `require()`. + + +## Tip + +Create a partial using a bound function if you want to resolve from the same `fromDirectory` multiple times: + +```js +const resolveFromFoo = resolveFrom.bind(null, 'foo'); + +resolveFromFoo('./bar'); +resolveFromFoo('./baz'); +``` + + +## Related + +- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory +- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path +- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory +- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point +- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily +- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/rimraf/CHANGELOG.md b/node_modules/rimraf/CHANGELOG.md new file mode 100644 index 0000000..f116f14 --- /dev/null +++ b/node_modules/rimraf/CHANGELOG.md @@ -0,0 +1,65 @@ +# v3.0 + +- Add `--preserve-root` option to executable (default true) +- Drop support for Node.js below version 6 + +# v2.7 + +- Make `glob` an optional dependency + +# 2.6 + +- Retry on EBUSY on non-windows platforms as well +- Make `rimraf.sync` 10000% more reliable on Windows + +# 2.5 + +- Handle Windows EPERM when lstat-ing read-only dirs +- Add glob option to pass options to glob + +# 2.4 + +- Add EPERM to delay/retry loop +- Add `disableGlob` option + +# 2.3 + +- Make maxBusyTries and emfileWait configurable +- Handle weird SunOS unlink-dir issue +- Glob the CLI arg for better Windows support + +# 2.2 + +- Handle ENOENT properly on Windows +- Allow overriding fs methods +- Treat EPERM as indicative of non-empty dir +- Remove optional graceful-fs dep +- Consistently return null error instead of undefined on success +- win32: Treat ENOTEMPTY the same as EBUSY +- Add `rimraf` binary + +# 2.1 + +- Fix SunOS error code for a non-empty directory +- Try rmdir before readdir +- Treat EISDIR like EPERM +- Remove chmod +- Remove lstat polyfill, node 0.7 is not supported + +# 2.0 + +- Fix myGid call to check process.getgid +- Simplify the EBUSY backoff logic. +- Use fs.lstat in node >= 0.7.9 +- Remove gently option +- remove fiber implementation +- Delete files that are marked read-only + +# 1.0 + +- Allow ENOENT in sync method +- Throw when no callback is provided +- Make opts.gently an absolute path +- use 'stat' if 'lstat' is not available +- Consistent error naming, and rethrow non-ENOENT stat errors +- add fiber implementation diff --git a/node_modules/rimraf/LICENSE b/node_modules/rimraf/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/rimraf/README.md b/node_modules/rimraf/README.md new file mode 100644 index 0000000..423b8cf --- /dev/null +++ b/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js new file mode 100644 index 0000000..023814c --- /dev/null +++ b/node_modules/rimraf/bin.js @@ -0,0 +1,68 @@ +#!/usr/bin/env node + +const rimraf = require('./') + +const path = require('path') + +const isRoot = arg => /^(\/|[a-zA-Z]:\\)$/.test(path.resolve(arg)) +const filterOutRoot = arg => { + const ok = preserveRoot === false || !isRoot(arg) + if (!ok) { + console.error(`refusing to remove ${arg}`) + console.error('Set --no-preserve-root to allow this') + } + return ok +} + +let help = false +let dashdash = false +let noglob = false +let preserveRoot = true +const args = process.argv.slice(2).filter(arg => { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else if (arg === '--preserve-root') + preserveRoot = true + else if (arg === '--no-preserve-root') + preserveRoot = false + else + return !!arg +}).filter(arg => !preserveRoot || filterOutRoot(arg)) + +const go = n => { + if (n >= args.length) + return + const options = noglob ? { glob: false } : {} + rimraf(args[n], options, er => { + if (er) + throw er + go(n+1) + }) +} + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + const log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + log(' --preserve-root Do not remove \'/\' (default)') + log(' --no-preserve-root Do not treat \'/\' specially') + log(' -- Stop parsing flags') + process.exit(help ? 0 : 1) +} else + go(0) diff --git a/node_modules/rimraf/node_modules/brace-expansion/LICENSE b/node_modules/rimraf/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000..de32266 --- /dev/null +++ b/node_modules/rimraf/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/rimraf/node_modules/brace-expansion/README.md b/node_modules/rimraf/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..6b4e0e1 --- /dev/null +++ b/node_modules/rimraf/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/rimraf/node_modules/brace-expansion/index.js b/node_modules/rimraf/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..bd19fe6 --- /dev/null +++ b/node_modules/rimraf/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/rimraf/node_modules/brace-expansion/package.json b/node_modules/rimraf/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..3447888 --- /dev/null +++ b/node_modules/rimraf/node_modules/brace-expansion/package.json @@ -0,0 +1,50 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.12", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "publishConfig": { + "tag": "1.x" + } +} diff --git a/node_modules/rimraf/node_modules/glob/LICENSE b/node_modules/rimraf/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/node_modules/rimraf/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/rimraf/node_modules/glob/README.md b/node_modules/rimraf/node_modules/glob/README.md new file mode 100644 index 0000000..83f0c83 --- /dev/null +++ b/node_modules/rimraf/node_modules/glob/README.md @@ -0,0 +1,378 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![a fun cartoon logo made of glob characters](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. +* `fs` File-system object with Node's `fs` API. By default, the built-in + `fs` module will be used. Set to a volume provided by a library like + `memfs` to avoid using the "real" file-system. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/rimraf/node_modules/glob/common.js b/node_modules/rimraf/node_modules/glob/common.js new file mode 100644 index 0000000..424c46e --- /dev/null +++ b/node_modules/rimraf/node_modules/glob/common.js @@ -0,0 +1,238 @@ +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var fs = require("fs") +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasort (a, b) { + return a.localeCompare(b, 'en') +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + // always treat \ in patterns as escapes, not path separators + options.allowWindowsEscape = false + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/rimraf/node_modules/glob/glob.js b/node_modules/rimraf/node_modules/glob/glob.js new file mode 100644 index 0000000..37a4d7e --- /dev/null +++ b/node_modules/rimraf/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + self.fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/rimraf/node_modules/glob/package.json b/node_modules/rimraf/node_modules/glob/package.json new file mode 100644 index 0000000..5940b64 --- /dev/null +++ b/node_modules/rimraf/node_modules/glob/package.json @@ -0,0 +1,55 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.2.3", + "publishConfig": { + "tag": "v7-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "memfs": "^3.2.0", + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^15.0.6", + "tick": "0.0.6" + }, + "tap": { + "before": "test/00-setup.js", + "after": "test/zz-cleanup.js", + "jobs": 1 + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/rimraf/node_modules/glob/sync.js b/node_modules/rimraf/node_modules/glob/sync.js new file mode 100644 index 0000000..2c4f480 --- /dev/null +++ b/node_modules/rimraf/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert.ok(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert.ok(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/rimraf/node_modules/minimatch/LICENSE b/node_modules/rimraf/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/rimraf/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/rimraf/node_modules/minimatch/README.md b/node_modules/rimraf/node_modules/minimatch/README.md new file mode 100644 index 0000000..33ede1d --- /dev/null +++ b/node_modules/rimraf/node_modules/minimatch/README.md @@ -0,0 +1,230 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### allowWindowsEscape + +Windows path separator `\` is by default converted to `/`, which +prohibits the usage of `\` as a escape character. This flag skips that +behavior and allows using the escape character. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/rimraf/node_modules/minimatch/minimatch.js b/node_modules/rimraf/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..fda45ad --- /dev/null +++ b/node_modules/rimraf/node_modules/minimatch/minimatch.js @@ -0,0 +1,947 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = (function () { try { return require('path') } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + assertValidPattern(pattern) + + if (!options) options = {} + + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/rimraf/node_modules/minimatch/package.json b/node_modules/rimraf/node_modules/minimatch/package.json new file mode 100644 index 0000000..566efdf --- /dev/null +++ b/node_modules/rimraf/node_modules/minimatch/package.json @@ -0,0 +1,33 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "devDependencies": { + "tap": "^15.1.6" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ] +} diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json new file mode 100644 index 0000000..1bf8d5e --- /dev/null +++ b/node_modules/rimraf/package.json @@ -0,0 +1,32 @@ +{ + "name": "rimraf", + "version": "3.0.2", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "repository": "git://github.com/isaacs/rimraf.git", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --follow-tags", + "test": "tap test/*.js" + }, + "bin": "./bin.js", + "dependencies": { + "glob": "^7.1.3" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^12.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js new file mode 100644 index 0000000..34da417 --- /dev/null +++ b/node_modules/rimraf/rimraf.js @@ -0,0 +1,360 @@ +const assert = require("assert") +const path = require("path") +const fs = require("fs") +let glob = undefined +try { + glob = require("glob") +} catch (_err) { + // treat glob as optional. +} + +const defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +let timeout = 0 + +const isWindows = (process.platform === "win32") + +const defaults = options => { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + if (options.disableGlob !== true && glob === undefined) { + throw Error('glob dependency not found, set `options.disableGlob = true` if intentional') + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +const rimraf = (p, options, cb) => { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + let busyTries = 0 + let errState = null + let n = 0 + + const next = (er) => { + errState = errState || er + if (--n === 0) + cb(errState) + } + + const afterGlob = (er, results) => { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(p => { + const CB = (er) => { + if (er) { + if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), busyTries * 100) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(() => rimraf_(p, options, CB), timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + } + rimraf_(p, options, CB) + }) + } + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, (er, stat) => { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +const rimraf_ = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, er => { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +const fixWinEPERM = (p, options, er, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.chmod(p, 0o666, er2 => { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, (er3, stats) => { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +const fixWinEPERMSync = (p, options, er) => { + assert(p) + assert(options) + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + let stats + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +const rmdir = (p, options, originalEr, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +const rmkids = (p, options, cb) => { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) + return cb(er) + let n = files.length + if (n === 0) + return options.rmdir(p, cb) + let errState + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +const rimrafSync = (p, options) => { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + let results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (let i = 0; i < results.length; i++) { + const p = results[i] + + let st + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + + rmdirSync(p, options, er) + } + } +} + +const rmdirSync = (p, options, originalEr) => { + assert(p) + assert(options) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +const rmkidsSync = (p, options) => { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) + continue + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync diff --git a/node_modules/router/HISTORY.md b/node_modules/router/HISTORY.md new file mode 100644 index 0000000..b292257 --- /dev/null +++ b/node_modules/router/HISTORY.md @@ -0,0 +1,228 @@ +2.2.0 / 2025-03-26 +================== + +* Remove `setImmediate` support check +* Restore `debug` dependency + +2.1.0 / 2025-02-10 +================== + +* Updated `engines` field to Node@18 or higher +* Remove `Object.setPrototypeOf` polyfill +* Use `Array.flat` instead of `array-flatten` package +* Replace `methods` dependency with standard library +* deps: parseurl@^1.3.3 +* deps: is-promise@^4.0.0 +* Replace `utils-merge` dependency with `Object.assign` +* deps: Remove unused dep `after` + +2.0.0 / 2024-09-09 +================== + +* Drop support for node <18 +* deps: path-to-regexp@^8.0.0 + - Drop support for partial capture group `router.route('/user(s?)/:user/:op')` but still have optional non-capture `/user{s}/:user/:op` + - `:name?` becomes `{:name}` + - `:name*` becomes `*name`. + - The splat change also changes splat from strings to an array of strings + - Optional splats become `{*name}` + - `:name+` becomes `*name` and thus equivalent to `*name` so I dropped those tests + - Strings as regular expressions are fully removed, need to be converted to native regular expressions + +2.0.0-beta.2 / 2024-03-20 +========================= + +This incorporates all changes after 1.3.5 up to 1.3.8. + + * Add support for returned, rejected Promises to `router.param` + +2.0.0-beta.1 / 2020-03-29 +========================= + +This incorporates all changes after 1.3.3 up to 1.3.5. + + * Internalize private `router.process_params` method + * Remove `debug` dependency + * deps: array-flatten@3.0.0 + * deps: parseurl@~1.3.3 + * deps: path-to-regexp@3.2.0 + - Add new `?`, `*`, and `+` parameter modifiers. + - Matching group expressions are only RegExp syntax. + `(*)` is no longer valid and must be written as `(.*)`, for example. + - Named matching groups no longer available by position in `req.params`. + `/:foo(.*)` only captures as `req.params.foo` and not available as + `req.params[0]`. + - Regular expressions can only be used in a matching group. + `/\\d+` is no longer valid and must be written as `/(\\d+)`. + - Matching groups are now literal regular expressions. + `:foo` named captures can no longer be included inside a capture group. + - Special `*` path segment behavior removed. + `/foo/*/bar` will match a literal `*` as the middle segment. + * deps: setprototypeof@1.2.0 + +2.0.0-alpha.1 / 2018-07-27 +========================== + + * Add basic support for returned, rejected Promises + - Rejected Promises from middleware functions `next(error)` + * Drop support for Node.js below 0.10 + * deps: debug@3.1.0 + - Add `DEBUG_HIDE_DATE` environment variable + - Change timer to per-namespace instead of global + - Change non-TTY date format + - Remove `DEBUG_FD` environment variable support + - Support 256 namespace colors + +1.3.8 / 2023-02-24 +================== + + * Fix routing requests without method + +1.3.7 / 2022-04-28 +================== + + * Fix hanging on large stack of sync routes + +1.3.6 / 2021-11-15 +================== + + * Fix handling very large stacks of sync middleware + * deps: safe-buffer@5.2.1 + +1.3.5 / 2020-03-24 +================== + + * Fix incorrect middleware execution with unanchored `RegExp`s + * perf: use plain object for internal method map + +1.3.4 / 2020-01-24 +================== + + * deps: array-flatten@3.0.0 + * deps: parseurl@~1.3.3 + * deps: setprototypeof@1.2.0 + +1.3.3 / 2018-07-06 +================== + + * Fix JSDoc for `Router` constructor + +1.3.2 / 2017-09-24 +================== + + * deps: debug@2.6.9 + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: setprototypeof@1.1.0 + * deps: utils-merge@1.0.1 + +1.3.1 / 2017-05-19 +================== + + * deps: debug@2.6.8 + - Fix `DEBUG_MAX_ARRAY_LENGTH` + - deps: ms@2.0.0 + +1.3.0 / 2017-02-25 +================== + + * Add `next("router")` to exit from router + * Fix case where `router.use` skipped requests routes did not + * Use `%o` in path debug to tell types apart + * deps: setprototypeof@1.0.3 + * perf: add fast match path for `*` route + +1.2.0 / 2017-02-17 +================== + + * Skip routing when `req.url` is not set + * deps: debug@2.6.1 + - Allow colors in workers + - Deprecated `DEBUG_FD` environment variable set to `3` or higher + - Fix error when running under React Native + - Use same color for same namespace + - deps: ms@0.7.2 + +1.1.5 / 2017-01-28 +================== + + * deps: array-flatten@2.1.1 + * deps: setprototypeof@1.0.2 + - Fix using fallback even when native method exists + +1.1.4 / 2016-01-21 +================== + + * deps: array-flatten@2.0.0 + * deps: methods@~1.1.2 + - perf: enable strict mode + * deps: parseurl@~1.3.1 + - perf: enable strict mode + +1.1.3 / 2015-08-02 +================== + + * Fix infinite loop condition using `mergeParams: true` + * Fix inner numeric indices incorrectly altering parent `req.params` + * deps: array-flatten@1.1.1 + - perf: enable strict mode + * deps: path-to-regexp@0.1.7 + - Fix regression with escaped round brackets and matching groups + +1.1.2 / 2015-07-06 +================== + + * Fix hiding platform issues with `decodeURIComponent` + - Only `URIError`s are a 400 + * Fix using `*` before params in routes + * Fix using capture groups before params in routes + * deps: path-to-regexp@0.1.6 + * perf: enable strict mode + * perf: remove argument reassignments in routing + * perf: skip attempting to decode zero length string + * perf: use plain for loops + +1.1.1 / 2015-05-25 +================== + + * Fix issue where `next('route')` in `router.param` would incorrectly skip values + * deps: array-flatten@1.1.0 + * deps: debug@~2.2.0 + - deps: ms@0.7.1 + +1.1.0 / 2015-04-22 +================== + + * Use `setprototypeof` instead of `__proto__` + * deps: debug@~2.1.3 + - Fix high intensity foreground color for bold + - deps: ms@0.7.0 + +1.0.0 / 2015-01-13 +================== + + * Fix crash from error within `OPTIONS` response handler + * deps: array-flatten@1.0.2 + - Remove redundant code path + +1.0.0-beta.3 / 2015-01-11 +========================= + + * Fix duplicate methods appearing in OPTIONS responses + * Fix OPTIONS responses to include the HEAD method properly + * Remove support for leading colon in `router.param(name, fn)` + * Use `array-flatten` for flattening arrays + * deps: debug@~2.1.1 + * deps: methods@~1.1.1 + +1.0.0-beta.2 / 2014-11-19 +========================= + + * Match routes iteratively to prevent stack overflows + +1.0.0-beta.1 / 2014-11-16 +========================= + + * Initial release ported from Express 4.x + - Altered to work without Express diff --git a/node_modules/router/LICENSE b/node_modules/router/LICENSE new file mode 100644 index 0000000..237e1b6 --- /dev/null +++ b/node_modules/router/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2013 Roman Shtylman +Copyright (c) 2014-2022 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/router/README.md b/node_modules/router/README.md new file mode 100644 index 0000000..218fd57 --- /dev/null +++ b/node_modules/router/README.md @@ -0,0 +1,416 @@ +# router + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Simple middleware-style router + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install router +``` + +## API + +```js +var finalhandler = require('finalhandler') +var http = require('http') +var Router = require('router') + +var router = Router() +router.get('/', function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') +}) + +var server = http.createServer(function (req, res) { + router(req, res, finalhandler(req, res)) +}) + +server.listen(3000) +``` + +This module is currently an extracted version from the Express project, +but with the main change being it can be used with a plain `http.createServer` +object or other web frameworks by removing Express-specific API calls. + +## Router(options) + +Options + +- `strict` - When `false` trailing slashes are optional (default: `false`) +- `caseSensitive` - When `true` the routing will be case sensitive. (default: `false`) +- `mergeParams` - When `true` any `req.params` passed to the router will be + merged into the router's `req.params`. (default: `false`) ([example](#example-using-mergeparams)) + +Returns a function with the signature `router(req, res, callback)` where +`callback([err])` must be provided to handle errors and fall-through from +not handling requests. + +### router.use([path], ...middleware) + +Use the given [middleware function](#middleware) for all http methods on the +given `path`, defaulting to the root path. + +`router` does not automatically see `use` as a handler. As such, it will not +consider it one for handling `OPTIONS` requests. + +* Note: If a `path` is specified, that `path` is stripped from the start of + `req.url`. + + + +```js +router.use(function (req, res, next) { + // do your things + + // continue to the next middleware + // the request will stall if this is not called + next() + + // note: you should NOT call `next` if you have begun writing to the response +}) +``` + +[Middleware](#middleware) can themselves use `next('router')` at any time to +exit the current router instance completely, invoking the top-level callback. + +### router\[method](path, ...[middleware], handler) + +The [http methods](https://github.com/jshttp/methods/blob/master/index.js) provide +the routing functionality in `router`. + +Method middleware and handlers follow usual [middleware](#middleware) behavior, +except they will only be called when the method and path match the request. + + + +```js +// handle a `GET` request +router.get('/', function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') +}) +``` + +[Middleware](#middleware) given before the handler have one additional trick, +they may invoke `next('route')`. Calling `next('route')` bypasses the remaining +middleware and the handler mounted for this route, passing the request to the +next route suitable for handling this request. + +Route handlers and middleware can themselves use `next('router')` at any time +to exit the current router instance completely, invoking the top-level callback. + +### router.param(name, param_middleware) + +Maps the specified path parameter `name` to a specialized param-capturing middleware. + +This function positions the middleware in the same stack as `.use`. + +The function can optionally return a `Promise` object. If a `Promise` object +is returned from the function, the router will attach an `onRejected` callback +using `.then`. If the promise is rejected, `next` will be called with the +rejected value, or an error if the value is falsy. + +Parameter mapping is used to provide pre-conditions to routes +which use normalized placeholders. For example a _:user_id_ parameter +could automatically load a user's information from the database without +any additional code: + + + +```js +router.param('user_id', function (req, res, next, id) { + User.find(id, function (err, user) { + if (err) { + return next(err) + } else if (!user) { + return next(new Error('failed to load user')) + } + req.user = user + + // continue processing the request + next() + }) +}) +``` + +### router.route(path) + +Creates an instance of a single `Route` for the given `path`. +(See `Router.Route` below) + +Routes can be used to handle http `methods` with their own, optional middleware. + +Using `router.route(path)` is a recommended approach to avoiding duplicate +route naming and thus typo errors. + + + +```js +var api = router.route('/api/') +``` + +## Router.Route(path) + +Represents a single route as an instance that can be used to handle http +`methods` with it's own, optional middleware. + +### route\[method](handler) + +These are functions which you can directly call on a route to register a new +`handler` for the `method` on the route. + + + +```js +// handle a `GET` request +var status = router.route('/status') + +status.get(function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('All Systems Green!') +}) +``` + +### route.all(handler) + +Adds a handler for all HTTP methods to this route. + +The handler can behave like middleware and call `next` to continue processing +rather than responding. + + + +```js +router.route('/') + .all(function (req, res, next) { + next() + }) + .all(checkSomething) + .get(function (req, res) { + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Hello World!') + }) +``` + +## Middleware + +Middleware (and method handlers) are functions that follow specific function +parameters and have defined behavior when used with `router`. The most common +format is with three parameters - "req", "res" and "next". + +- `req` - This is a [HTTP incoming message](https://nodejs.org/api/http.html#http_http_incomingmessage) instance. +- `res` - This is a [HTTP server response](https://nodejs.org/api/http.html#http_class_http_serverresponse) instance. +- `next` - Calling this function that tells `router` to proceed to the next matching middleware or method handler. It accepts an error as the first argument. + +The function can optionally return a `Promise` object. If a `Promise` object +is returned from the function, the router will attach an `onRejected` callback +using `.then`. If the promise is rejected, `next` will be called with the +rejected value, or an error if the value is falsy. + +Middleware and method handlers can also be defined with four arguments. When +the function has four parameters defined, the first argument is an error and +subsequent arguments remain, becoming - "err", "req", "res", "next". These +functions are "error handling middleware", and can be used for handling +errors that occurred in previous handlers (E.g. from calling `next(err)`). +This is most used when you want to define arbitrary rendering of errors. + + + +```js +router.get('/error_route', function (req, res, next) { + return next(new Error('Bad Request')) +}) + +router.use(function (err, req, res, next) { + res.end(err.message) //= > "Bad Request" +}) +``` + +Error handling middleware will **only** be invoked when an error was given. As +long as the error is in the pipeline, normal middleware and handlers will be +bypassed - only error handling middleware will be invoked with an error. + +## Examples + +```js +// import our modules +var http = require('http') +var Router = require('router') +var finalhandler = require('finalhandler') +var compression = require('compression') +var bodyParser = require('body-parser') + +// store our message to display +var message = 'Hello World!' + +// initialize the router & server and add a final callback. +var router = Router() +var server = http.createServer(function onRequest (req, res) { + router(req, res, finalhandler(req, res)) +}) + +// use some middleware and compress all outgoing responses +router.use(compression()) + +// handle `GET` requests to `/message` +router.get('/message', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end(message + '\n') +}) + +// create and mount a new router for our API +var api = Router() +router.use('/api/', api) + +// add a body parsing middleware to our API +api.use(bodyParser.json()) + +// handle `PATCH` requests to `/api/set-message` +api.patch('/set-message', function (req, res) { + if (req.body.value) { + message = req.body.value + + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end(message + '\n') + } else { + res.statusCode = 400 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + res.end('Invalid API Syntax\n') + } +}) + +// make our http server listen to connections +server.listen(8080) +``` + +You can get the message by running this command in your terminal, + or navigating to `127.0.0.1:8080` in a web browser. +```bash +curl http://127.0.0.1:8080 +``` + +You can set the message by sending it a `PATCH` request via this command: +```bash +curl http://127.0.0.1:8080/api/set-message -X PATCH -H "Content-Type: application/json" -d '{"value":"Cats!"}' +``` + +### Example using mergeParams + +```js +var http = require('http') +var Router = require('router') +var finalhandler = require('finalhandler') + +// this example is about the mergeParams option +var opts = { mergeParams: true } + +// make a router with out special options +var router = Router(opts) +var server = http.createServer(function onRequest (req, res) { + // set something to be passed into the router + req.params = { type: 'kitten' } + + router(req, res, finalhandler(req, res)) +}) + +router.get('/', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + + // with respond with the the params that were passed in + res.end(req.params.type + '\n') +}) + +// make another router with our options +var handler = Router(opts) + +// mount our new router to a route that accepts a param +router.use('/:path', handler) + +handler.get('/', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Type', 'text/plain; charset=utf-8') + + // will respond with the param of the router's parent route + res.end(req.params.path + '\n') +}) + +// make our http server listen to connections +server.listen(8080) +``` + +Now you can get the type, or what path you are requesting: +```bash +curl http://127.0.0.1:8080 +> kitten +curl http://127.0.0.1:8080/such_path +> such_path +``` + +### Example of advanced `.route()` usage + +This example shows how to implement routes where there is a custom +handler to execute when the path matched, but no methods matched. +Without any special handling, this would be treated as just a +generic non-match by `router` (which typically results in a 404), +but with a custom handler, a `405 Method Not Allowed` can be sent. + +```js +var http = require('http') +var finalhandler = require('finalhandler') +var Router = require('router') + +// create the router and server +var router = new Router() +var server = http.createServer(function onRequest (req, res) { + router(req, res, finalhandler(req, res)) +}) + +// register a route and add all methods +router.route('/pet/:id') + .get(function (req, res) { + // this is GET /pet/:id + res.setHeader('Content-Type', 'application/json') + res.end(JSON.stringify({ name: 'tobi' })) + }) + .delete(function (req, res) { + // this is DELETE /pet/:id + res.end() + }) + .all(function (req, res) { + // this is called for all other methods not + // defined above for /pet/:id + res.statusCode = 405 + res.end() + }) + +// make our http server listen to connections +server.listen(8080) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/pillarjs/router/master?label=ci +[ci-url]: https://github.com/pillarjs/router/actions/workflows/ci.yml +[npm-image]: https://img.shields.io/npm/v/router.svg +[npm-url]: https://npmjs.org/package/router +[node-version-image]: https://img.shields.io/node/v/router.svg +[node-version-url]: http://nodejs.org/download/ +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/router/master.svg +[coveralls-url]: https://coveralls.io/r/pillarjs/router?branch=master +[downloads-image]: https://img.shields.io/npm/dm/router.svg +[downloads-url]: https://npmjs.org/package/router diff --git a/node_modules/router/index.js b/node_modules/router/index.js new file mode 100644 index 0000000..4358aeb --- /dev/null +++ b/node_modules/router/index.js @@ -0,0 +1,748 @@ +/*! + * router + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const isPromise = require('is-promise') +const Layer = require('./lib/layer') +const { METHODS } = require('node:http') +const parseUrl = require('parseurl') +const Route = require('./lib/route') +const debug = require('debug')('router') +const deprecate = require('depd')('router') + +/** + * Module variables. + * @private + */ + +const slice = Array.prototype.slice +const flatten = Array.prototype.flat +const methods = METHODS.map((method) => method.toLowerCase()) + +/** + * Expose `Router`. + */ + +module.exports = Router + +/** + * Expose `Route`. + */ + +module.exports.Route = Route + +/** + * Initialize a new `Router` with the given `options`. + * + * @param {object} [options] + * @return {Router} which is a callable function + * @public + */ + +function Router (options) { + if (!(this instanceof Router)) { + return new Router(options) + } + + const opts = options || {} + + function router (req, res, next) { + router.handle(req, res, next) + } + + // inherit from the correct prototype + Object.setPrototypeOf(router, this) + + router.caseSensitive = opts.caseSensitive + router.mergeParams = opts.mergeParams + router.params = {} + router.strict = opts.strict + router.stack = [] + + return router +} + +/** + * Router prototype inherits from a Function. + */ + +/* istanbul ignore next */ +Router.prototype = function () {} + +/** + * Map the given param placeholder `name`(s) to the given callback. + * + * Parameter mapping is used to provide pre-conditions to routes + * which use normalized placeholders. For example a _:user_id_ parameter + * could automatically load a user's information from the database without + * any additional code. + * + * The callback uses the same signature as middleware, the only difference + * being that the value of the placeholder is passed, in this case the _id_ + * of the user. Once the `next()` function is invoked, just like middleware + * it will continue on to execute the route, or subsequent parameter functions. + * + * Just like in middleware, you must either respond to the request or call next + * to avoid stalling the request. + * + * router.param('user_id', function(req, res, next, id){ + * User.find(id, function(err, user){ + * if (err) { + * return next(err) + * } else if (!user) { + * return next(new Error('failed to load user')) + * } + * req.user = user + * next() + * }) + * }) + * + * @param {string} name + * @param {function} fn + * @public + */ + +Router.prototype.param = function param (name, fn) { + if (!name) { + throw new TypeError('argument name is required') + } + + if (typeof name !== 'string') { + throw new TypeError('argument name must be a string') + } + + if (!fn) { + throw new TypeError('argument fn is required') + } + + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + let params = this.params[name] + + if (!params) { + params = this.params[name] = [] + } + + params.push(fn) + + return this +} + +/** + * Dispatch a req, res into the router. + * + * @private + */ + +Router.prototype.handle = function handle (req, res, callback) { + if (!callback) { + throw new TypeError('argument callback is required') + } + + debug('dispatching %s %s', req.method, req.url) + + let idx = 0 + let methods + const protohost = getProtohost(req.url) || '' + let removed = '' + const self = this + let slashAdded = false + let sync = 0 + const paramcalled = {} + + // middleware and routes + const stack = this.stack + + // manage inter-router variables + const parentParams = req.params + const parentUrl = req.baseUrl || '' + let done = restore(callback, req, 'baseUrl', 'next', 'params') + + // setup next layer + req.next = next + + // for options requests, respond with a default if nothing else responds + if (req.method === 'OPTIONS') { + methods = [] + done = wrap(done, generateOptionsResponder(res, methods)) + } + + // setup basic req values + req.baseUrl = parentUrl + req.originalUrl = req.originalUrl || req.url + + next() + + function next (err) { + let layerError = err === 'route' + ? null + : err + + // remove added slash + if (slashAdded) { + req.url = req.url.slice(1) + slashAdded = false + } + + // restore altered req.url + if (removed.length !== 0) { + req.baseUrl = parentUrl + req.url = protohost + removed + req.url.slice(protohost.length) + removed = '' + } + + // signal to exit router + if (layerError === 'router') { + setImmediate(done, null) + return + } + + // no more matching layers + if (idx >= stack.length) { + setImmediate(done, layerError) + return + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + // get pathname of request + const path = getPathname(req) + + if (path == null) { + return done(layerError) + } + + // find next matching layer + let layer + let match + let route + + while (match !== true && idx < stack.length) { + layer = stack[idx++] + match = matchLayer(layer, path) + route = layer.route + + if (typeof match !== 'boolean') { + // hold on to layerError + layerError = layerError || match + } + + if (match !== true) { + continue + } + + if (!route) { + // process non-route handlers normally + continue + } + + if (layerError) { + // routes do not match with a pending error + match = false + continue + } + + const method = req.method + const hasMethod = route._handlesMethod(method) + + // build up automatic options response + if (!hasMethod && method === 'OPTIONS' && methods) { + methods.push.apply(methods, route._methods()) + } + + // don't even bother matching route + if (!hasMethod && method !== 'HEAD') { + match = false + } + } + + // no match + if (match !== true) { + return done(layerError) + } + + // store route for dispatch on change + if (route) { + req.route = route + } + + // Capture one-time layer values + req.params = self.mergeParams + ? mergeParams(layer.params, parentParams) + : layer.params + const layerPath = layer.path + + // this should be done for the layer + processParams(self.params, layer, paramcalled, req, res, function (err) { + if (err) { + next(layerError || err) + } else if (route) { + layer.handleRequest(req, res, next) + } else { + trimPrefix(layer, layerError, layerPath, path) + } + + sync = 0 + }) + } + + function trimPrefix (layer, layerError, layerPath, path) { + if (layerPath.length !== 0) { + // Validate path is a prefix match + if (layerPath !== path.substring(0, layerPath.length)) { + next(layerError) + return + } + + // Validate path breaks on a path separator + const c = path[layerPath.length] + if (c && c !== '/') { + next(layerError) + return + } + + // Trim off the part of the url that matches the route + // middleware (.use stuff) needs to have the path stripped + debug('trim prefix (%s) from url %s', layerPath, req.url) + removed = layerPath + req.url = protohost + req.url.slice(protohost.length + removed.length) + + // Ensure leading slash + if (!protohost && req.url[0] !== '/') { + req.url = '/' + req.url + slashAdded = true + } + + // Setup base URL (no trailing slash) + req.baseUrl = parentUrl + (removed[removed.length - 1] === '/' + ? removed.substring(0, removed.length - 1) + : removed) + } + + debug('%s %s : %s', layer.name, layerPath, req.originalUrl) + + if (layerError) { + layer.handleError(layerError, req, res, next) + } else { + layer.handleRequest(req, res, next) + } + } +} + +/** + * Use the given middleware function, with optional path, defaulting to "/". + * + * Use (like `.all`) will run for any http METHOD, but it will not add + * handlers for those methods so OPTIONS requests will not consider `.use` + * functions even if they could respond. + * + * The other difference is that _route_ path is stripped and not visible + * to the handler function. The main effect of this feature is that mounted + * handlers can operate without any code changes regardless of the "prefix" + * pathname. + * + * @public + */ + +Router.prototype.use = function use (handler) { + let offset = 0 + let path = '/' + + // default path to '/' + // disambiguate router.use([handler]) + if (typeof handler !== 'function') { + let arg = handler + + while (Array.isArray(arg) && arg.length !== 0) { + arg = arg[0] + } + + // first arg is the path + if (typeof arg !== 'function') { + offset = 1 + path = handler + } + } + + const callbacks = flatten.call(slice.call(arguments, offset), Infinity) + + if (callbacks.length === 0) { + throw new TypeError('argument handler is required') + } + + for (let i = 0; i < callbacks.length; i++) { + const fn = callbacks[i] + + if (typeof fn !== 'function') { + throw new TypeError('argument handler must be a function') + } + + // add the middleware + debug('use %o %s', path, fn.name || '') + + const layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: false, + end: false + }, fn) + + layer.route = undefined + + this.stack.push(layer) + } + + return this +} + +/** + * Create a new Route for the given path. + * + * Each route contains a separate middleware stack and VERB handlers. + * + * See the Route api documentation for details on adding handlers + * and middleware to routes. + * + * @param {string} path + * @return {Route} + * @public + */ + +Router.prototype.route = function route (path) { + const route = new Route(path) + + const layer = new Layer(path, { + sensitive: this.caseSensitive, + strict: this.strict, + end: true + }, handle) + + function handle (req, res, next) { + route.dispatch(req, res, next) + } + + layer.route = route + + this.stack.push(layer) + return route +} + +// create Router#VERB functions +methods.concat('all').forEach(function (method) { + Router.prototype[method] = function (path) { + const route = this.route(path) + route[method].apply(route, slice.call(arguments, 1)) + return this + } +}) + +/** + * Generate a callback that will make an OPTIONS response. + * + * @param {OutgoingMessage} res + * @param {array} methods + * @private + */ + +function generateOptionsResponder (res, methods) { + return function onDone (fn, err) { + if (err || methods.length === 0) { + return fn(err) + } + + trySendOptionsResponse(res, methods, fn) + } +} + +/** + * Get pathname of request. + * + * @param {IncomingMessage} req + * @private + */ + +function getPathname (req) { + try { + return parseUrl(req).pathname + } catch (err) { + return undefined + } +} + +/** + * Get get protocol + host for a URL. + * + * @param {string} url + * @private + */ + +function getProtohost (url) { + if (typeof url !== 'string' || url.length === 0 || url[0] === '/') { + return undefined + } + + const searchIndex = url.indexOf('?') + const pathLength = searchIndex !== -1 + ? searchIndex + : url.length + const fqdnIndex = url.substring(0, pathLength).indexOf('://') + + return fqdnIndex !== -1 + ? url.substring(0, url.indexOf('/', 3 + fqdnIndex)) + : undefined +} + +/** + * Match path to a layer. + * + * @param {Layer} layer + * @param {string} path + * @private + */ + +function matchLayer (layer, path) { + try { + return layer.match(path) + } catch (err) { + return err + } +} + +/** + * Merge params with parent params + * + * @private + */ + +function mergeParams (params, parent) { + if (typeof parent !== 'object' || !parent) { + return params + } + + // make copy of parent for base + const obj = Object.assign({}, parent) + + // simple non-numeric merging + if (!(0 in params) || !(0 in parent)) { + return Object.assign(obj, params) + } + + let i = 0 + let o = 0 + + // determine numeric gap in params + while (i in params) { + i++ + } + + // determine numeric gap in parent + while (o in parent) { + o++ + } + + // offset numeric indices in params before merge + for (i--; i >= 0; i--) { + params[i + o] = params[i] + + // create holes for the merge when necessary + if (i < o) { + delete params[i] + } + } + + return Object.assign(obj, params) +} + +/** + * Process any parameters for the layer. + * + * @private + */ + +function processParams (params, layer, called, req, res, done) { + // captured parameters from the layer, keys and values + const keys = layer.keys + + // fast track + if (!keys || keys.length === 0) { + return done() + } + + let i = 0 + let paramIndex = 0 + let key + let paramVal + let paramCallbacks + let paramCalled + + // process params in order + // param callbacks can be async + function param (err) { + if (err) { + return done(err) + } + + if (i >= keys.length) { + return done() + } + + paramIndex = 0 + key = keys[i++] + paramVal = req.params[key] + paramCallbacks = params[key] + paramCalled = called[key] + + if (paramVal === undefined || !paramCallbacks) { + return param() + } + + // param previously called with same value or error occurred + if (paramCalled && (paramCalled.match === paramVal || + (paramCalled.error && paramCalled.error !== 'route'))) { + // restore value + req.params[key] = paramCalled.value + + // next param + return param(paramCalled.error) + } + + called[key] = paramCalled = { + error: null, + match: paramVal, + value: paramVal + } + + paramCallback() + } + + // single param callbacks + function paramCallback (err) { + const fn = paramCallbacks[paramIndex++] + + // store updated value + paramCalled.value = req.params[key] + + if (err) { + // store error + paramCalled.error = err + param(err) + return + } + + if (!fn) return param() + + try { + const ret = fn(req, res, paramCallback, paramVal, key) + if (isPromise(ret)) { + if (!(ret instanceof Promise)) { + deprecate('parameters that are Promise-like are deprecated, use a native Promise instead') + } + + ret.then(null, function (error) { + paramCallback(error || new Error('Rejected promise')) + }) + } + } catch (e) { + paramCallback(e) + } + } + + param() +} + +/** + * Restore obj props after function + * + * @private + */ + +function restore (fn, obj) { + const props = new Array(arguments.length - 2) + const vals = new Array(arguments.length - 2) + + for (let i = 0; i < props.length; i++) { + props[i] = arguments[i + 2] + vals[i] = obj[props[i]] + } + + return function () { + // restore vals + for (let i = 0; i < props.length; i++) { + obj[props[i]] = vals[i] + } + + return fn.apply(this, arguments) + } +} + +/** + * Send an OPTIONS response. + * + * @private + */ + +function sendOptionsResponse (res, methods) { + const options = Object.create(null) + + // build unique method map + for (let i = 0; i < methods.length; i++) { + options[methods[i]] = true + } + + // construct the allow list + const allow = Object.keys(options).sort().join(', ') + + // send response + res.setHeader('Allow', allow) + res.setHeader('Content-Length', Buffer.byteLength(allow)) + res.setHeader('Content-Type', 'text/plain') + res.setHeader('X-Content-Type-Options', 'nosniff') + res.end(allow) +} + +/** + * Try to send an OPTIONS response. + * + * @private + */ + +function trySendOptionsResponse (res, methods, next) { + try { + sendOptionsResponse(res, methods) + } catch (err) { + next(err) + } +} + +/** + * Wrap a function + * + * @private + */ + +function wrap (old, fn) { + return function proxy () { + const args = new Array(arguments.length + 1) + + args[0] = old + for (let i = 0, len = arguments.length; i < len; i++) { + args[i + 1] = arguments[i] + } + + fn.apply(this, args) + } +} diff --git a/node_modules/router/lib/layer.js b/node_modules/router/lib/layer.js new file mode 100644 index 0000000..6a4408f --- /dev/null +++ b/node_modules/router/lib/layer.js @@ -0,0 +1,247 @@ +/*! + * router + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const isPromise = require('is-promise') +const pathRegexp = require('path-to-regexp') +const debug = require('debug')('router:layer') +const deprecate = require('depd')('router') + +/** + * Module variables. + * @private + */ + +const TRAILING_SLASH_REGEXP = /\/+$/ +const MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g + +/** + * Expose `Layer`. + */ + +module.exports = Layer + +function Layer (path, options, fn) { + if (!(this instanceof Layer)) { + return new Layer(path, options, fn) + } + + debug('new %o', path) + const opts = options || {} + + this.handle = fn + this.keys = [] + this.name = fn.name || '' + this.params = undefined + this.path = undefined + this.slash = path === '/' && opts.end === false + + function matcher (_path) { + if (_path instanceof RegExp) { + const keys = [] + let name = 0 + let m + // eslint-disable-next-line no-cond-assign + while (m = MATCHING_GROUP_REGEXP.exec(_path.source)) { + keys.push({ + name: m[1] || name++, + offset: m.index + }) + } + + return function regexpMatcher (p) { + const match = _path.exec(p) + if (!match) { + return false + } + + const params = {} + for (let i = 1; i < match.length; i++) { + const key = keys[i - 1] + const prop = key.name + const val = decodeParam(match[i]) + + if (val !== undefined) { + params[prop] = val + } + } + + return { + params, + path: match[0] + } + } + } + + return pathRegexp.match((opts.strict ? _path : loosen(_path)), { + sensitive: opts.sensitive, + end: opts.end, + trailing: !opts.strict, + decode: decodeParam + }) + } + this.matchers = Array.isArray(path) ? path.map(matcher) : [matcher(path)] +} + +/** + * Handle the error for the layer. + * + * @param {Error} error + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handleError = function handleError (error, req, res, next) { + const fn = this.handle + + if (fn.length !== 4) { + // not a standard error handler + return next(error) + } + + try { + // invoke function + const ret = fn(error, req, res, next) + + // wait for returned promise + if (isPromise(ret)) { + if (!(ret instanceof Promise)) { + deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') + } + + ret.then(null, function (error) { + next(error || new Error('Rejected promise')) + }) + } + } catch (err) { + next(err) + } +} + +/** + * Handle the request for the layer. + * + * @param {Request} req + * @param {Response} res + * @param {function} next + * @api private + */ + +Layer.prototype.handleRequest = function handleRequest (req, res, next) { + const fn = this.handle + + if (fn.length > 3) { + // not a standard request handler + return next() + } + + try { + // invoke function + const ret = fn(req, res, next) + + // wait for returned promise + if (isPromise(ret)) { + if (!(ret instanceof Promise)) { + deprecate('handlers that are Promise-like are deprecated, use a native Promise instead') + } + + ret.then(null, function (error) { + next(error || new Error('Rejected promise')) + }) + } + } catch (err) { + next(err) + } +} + +/** + * Check if this route matches `path`, if so + * populate `.params`. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +Layer.prototype.match = function match (path) { + let match + + if (path != null) { + // fast path non-ending match for / (any path matches) + if (this.slash) { + this.params = {} + this.path = '' + return true + } + + let i = 0 + while (!match && i < this.matchers.length) { + // match the path + match = this.matchers[i](path) + i++ + } + } + + if (!match) { + this.params = undefined + this.path = undefined + return false + } + + // store values + this.params = match.params + this.path = match.path + this.keys = Object.keys(match.params) + + return true +} + +/** + * Decode param value. + * + * @param {string} val + * @return {string} + * @private + */ + +function decodeParam (val) { + if (typeof val !== 'string' || val.length === 0) { + return val + } + + try { + return decodeURIComponent(val) + } catch (err) { + if (err instanceof URIError) { + err.message = 'Failed to decode param \'' + val + '\'' + err.status = 400 + } + + throw err + } +} + +/** + * Loosens the given path for path-to-regexp matching. + */ +function loosen (path) { + if (path instanceof RegExp || path === '/') { + return path + } + + return Array.isArray(path) + ? path.map(function (p) { return loosen(p) }) + : String(path).replace(TRAILING_SLASH_REGEXP, '') +} diff --git a/node_modules/router/lib/route.js b/node_modules/router/lib/route.js new file mode 100644 index 0000000..1887d78 --- /dev/null +++ b/node_modules/router/lib/route.js @@ -0,0 +1,242 @@ +/*! + * router + * Copyright(c) 2013 Roman Shtylman + * Copyright(c) 2014-2022 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +const debug = require('debug')('router:route') +const Layer = require('./layer') +const { METHODS } = require('node:http') + +/** + * Module variables. + * @private + */ + +const slice = Array.prototype.slice +const flatten = Array.prototype.flat +const methods = METHODS.map((method) => method.toLowerCase()) + +/** + * Expose `Route`. + */ + +module.exports = Route + +/** + * Initialize `Route` with the given `path`, + * + * @param {String} path + * @api private + */ + +function Route (path) { + debug('new %o', path) + this.path = path + this.stack = [] + + // route handlers for various http methods + this.methods = Object.create(null) +} + +/** + * @private + */ + +Route.prototype._handlesMethod = function _handlesMethod (method) { + if (this.methods._all) { + return true + } + + // normalize name + let name = typeof method === 'string' + ? method.toLowerCase() + : method + + if (name === 'head' && !this.methods.head) { + name = 'get' + } + + return Boolean(this.methods[name]) +} + +/** + * @return {array} supported HTTP methods + * @private + */ + +Route.prototype._methods = function _methods () { + const methods = Object.keys(this.methods) + + // append automatic head + if (this.methods.get && !this.methods.head) { + methods.push('head') + } + + for (let i = 0; i < methods.length; i++) { + // make upper case + methods[i] = methods[i].toUpperCase() + } + + return methods +} + +/** + * dispatch req, res into this route + * + * @private + */ + +Route.prototype.dispatch = function dispatch (req, res, done) { + let idx = 0 + const stack = this.stack + let sync = 0 + + if (stack.length === 0) { + return done() + } + + let method = typeof req.method === 'string' + ? req.method.toLowerCase() + : req.method + + if (method === 'head' && !this.methods.head) { + method = 'get' + } + + req.route = this + + next() + + function next (err) { + // signal to exit route + if (err && err === 'route') { + return done() + } + + // signal to exit router + if (err && err === 'router') { + return done(err) + } + + // no more matching layers + if (idx >= stack.length) { + return done(err) + } + + // max sync stack + if (++sync > 100) { + return setImmediate(next, err) + } + + let layer + let match + + // find next matching layer + while (match !== true && idx < stack.length) { + layer = stack[idx++] + match = !layer.method || layer.method === method + } + + // no match + if (match !== true) { + return done(err) + } + + if (err) { + layer.handleError(err, req, res, next) + } else { + layer.handleRequest(req, res, next) + } + + sync = 0 + } +} + +/** + * Add a handler for all HTTP verbs to this route. + * + * Behaves just like middleware and can respond or call `next` + * to continue processing. + * + * You can use multiple `.all` call to add multiple handlers. + * + * function check_something(req, res, next){ + * next() + * } + * + * function validate_user(req, res, next){ + * next() + * } + * + * route + * .all(validate_user) + * .all(check_something) + * .get(function(req, res, next){ + * res.send('hello world') + * }) + * + * @param {array|function} handler + * @return {Route} for chaining + * @api public + */ + +Route.prototype.all = function all (handler) { + const callbacks = flatten.call(slice.call(arguments), Infinity) + + if (callbacks.length === 0) { + throw new TypeError('argument handler is required') + } + + for (let i = 0; i < callbacks.length; i++) { + const fn = callbacks[i] + + if (typeof fn !== 'function') { + throw new TypeError('argument handler must be a function') + } + + const layer = Layer('/', {}, fn) + layer.method = undefined + + this.methods._all = true + this.stack.push(layer) + } + + return this +} + +methods.forEach(function (method) { + Route.prototype[method] = function (handler) { + const callbacks = flatten.call(slice.call(arguments), Infinity) + + if (callbacks.length === 0) { + throw new TypeError('argument handler is required') + } + + for (let i = 0; i < callbacks.length; i++) { + const fn = callbacks[i] + + if (typeof fn !== 'function') { + throw new TypeError('argument handler must be a function') + } + + debug('%s %s', method, this.path) + + const layer = Layer('/', {}, fn) + layer.method = method + + this.methods[method] = true + this.stack.push(layer) + } + + return this + } +}) diff --git a/node_modules/router/package.json b/node_modules/router/package.json new file mode 100644 index 0000000..123eca2 --- /dev/null +++ b/node_modules/router/package.json @@ -0,0 +1,44 @@ +{ + "name": "router", + "description": "Simple middleware-style router", + "version": "2.2.0", + "author": "Douglas Christopher Wilson ", + "contributors": [ + "Blake Embrey " + ], + "license": "MIT", + "repository": "pillarjs/router", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "devDependencies": { + "finalhandler": "^2.1.0", + "mocha": "10.2.0", + "nyc": "15.1.0", + "run-series": "^1.1.9", + "standard": "^17.1.0", + "supertest": "6.3.3" + }, + "files": [ + "lib/", + "LICENSE", + "HISTORY.md", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "standard", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test:debug": "mocha --reporter spec --bail --check-leaks test/ --inspect --inspect-brk", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/safe-buffer/LICENSE b/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/safe-buffer/README.md b/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/safe-buffer/index.d.ts b/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..f8d3ec9 --- /dev/null +++ b/node_modules/safe-buffer/index.js @@ -0,0 +1,65 @@ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..f2869e2 --- /dev/null +++ b/node_modules/safe-buffer/package.json @@ -0,0 +1,51 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.2.1", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/safer-buffer/LICENSE b/node_modules/safer-buffer/LICENSE new file mode 100644 index 0000000..4fe9e6f --- /dev/null +++ b/node_modules/safer-buffer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Nikita Skovoroda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/safer-buffer/Porting-Buffer.md b/node_modules/safer-buffer/Porting-Buffer.md new file mode 100644 index 0000000..68d86ba --- /dev/null +++ b/node_modules/safer-buffer/Porting-Buffer.md @@ -0,0 +1,268 @@ +# Porting to the Buffer.from/Buffer.alloc API + + +## Overview + +- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*) +- [Variant 2: Use a polyfill](#variant-2) +- [Variant 3: manual detection, with safeguards](#variant-3) + +### Finding problematic bits of code using grep + +Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`. + +It will find all the potentially unsafe places in your own code (with some considerably unlikely +exceptions). + +### Finding problematic bits of code using Node.js 8 + +If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code: + +- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js. +- `--trace-deprecation` does the same thing, but only for deprecation warnings. +- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8. + +You can set these flags using an environment variable: + +```console +$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' +$ cat example.js +'use strict'; +const foo = new Buffer('foo'); +$ node example.js +(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead. + at showFlaggedDeprecation (buffer.js:127:13) + at new Buffer (buffer.js:148:3) + at Object. (/path/to/example.js:2:13) + [... more stack trace lines ...] +``` + +### Finding problematic bits of code using linters + +Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets. + +There is a drawback, though, that it doesn't always +[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is +overriden e.g. with a polyfill, so recommended is a combination of this and some other method +described above. + + +## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x. + +This is the recommended solution nowadays that would imply only minimal overhead. + +The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible. + +What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way: + +- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`. +- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`). +- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`. + +Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than +`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended to avoid accidential unsafe Buffer API usage. + +There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005) +for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`. +Note that it currently only works with cases where the arguments are literals or where the +constructor is invoked with two arguments. + +_If you currently support those older Node.js versions and dropping them would be a semver-major change +for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2) +or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive +the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and +your users will not observe a runtime deprecation warning when running your code on Node.js 10._ + + +## Variant 2: Use a polyfill + +Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older +Node.js versions. + +You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill +`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api. + +Make sure that you do not use old `new Buffer` API — in any files where the line above is added, +using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though. + +Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or +[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) — +those are great, the only downsides being 4 deps in the tree and slightly more code changes to +migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only +`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies. + +_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also +provides a polyfill, but takes a different approach which has +[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you +to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as +it is problematic, can cause issues in your code, and will start emitting runtime deprecation +warnings starting with Node.js 10._ + +Note that in either case, it is important that you also remove all calls to the old Buffer +API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides +a polyfill for the new API. I have seen people doing that mistake. + +Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) +or +[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md) +is recommended. + +_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._ + + +## Variant 3 — manual detection, with safeguards + +This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own +wrapper around them. + +### Buffer(0) + +This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which +returns the same result all the way down to Node.js 0.8.x. + +### Buffer(notNumber) + +Before: + +```js +var buf = new Buffer(notNumber, encoding); +``` + +After: + +```js +var buf; +if (Buffer.from && Buffer.from !== Uint8Array.from) { + buf = Buffer.from(notNumber, encoding); +} else { + if (typeof notNumber === 'number') + throw new Error('The "size" argument must be of type number.'); + buf = new Buffer(notNumber, encoding); +} +``` + +`encoding` is optional. + +Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not +hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the +Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous +security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create +problems ranging from DoS to leaking sensitive information to the attacker from the process memory. + +When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can +be omitted. + +Also note that using TypeScript does not fix this problem for you — when libs written in +`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as +all type checks are translation-time only and are not present in the actual JS code which TS +compiles to. + +### Buffer(number) + +For Node.js 0.10.x (and below) support: + +```js +var buf; +if (Buffer.alloc) { + buf = Buffer.alloc(number); +} else { + buf = new Buffer(number); + buf.fill(0); +} +``` + +Otherwise (Node.js ≥ 0.12.x): + +```js +const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0); +``` + +## Regarding Buffer.allocUnsafe + +Be extra cautious when using `Buffer.allocUnsafe`: + * Don't use it if you don't have a good reason to + * e.g. you probably won't ever see a performance difference for small buffers, in fact, those + might be even faster with `Buffer.alloc()`, + * if your code is not in the hot code path — you also probably won't notice a difference, + * keep in mind that zero-filling minimizes the potential risks. + * If you use it, make sure that you never return the buffer in a partially-filled state, + * if you are writing to it sequentially — always truncate it to the actuall written length + +Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues, +ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs) +leaking to the remote attacker. + +_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js +version (and lacking type checks also adds DoS to the list of potential problems)._ + + +## FAQ + + +### What is wrong with the `Buffer` constructor? + +The `Buffer` constructor could be used to create a buffer in many different ways: + +- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained + *arbitrary memory* for performance reasons, which could include anything ranging from + program source code to passwords and encryption keys. +- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of + the string `'abc'`. A second argument could specify another encoding: For example, + `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original + sequence of bytes that it represents. +- There are several other combinations of arguments. + +This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell +what exactly the contents of the generated buffer are* without knowing the type of `foo`. + +Sometimes, the value of `foo` comes from an external source. For example, this function +could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form: + +``` +function stringToBase64(req, res) { + // The request body should have the format of `{ string: 'foobar' }` + const rawBytes = new Buffer(req.body.string) + const encoded = rawBytes.toString('base64') + res.end({ encoded: encoded }) +} +``` + +Note that this code does *not* validate the type of `req.body.string`: + +- `req.body.string` is expected to be a string. If this is the case, all goes well. +- `req.body.string` is controlled by the client that sends the request. +- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes: + - Before Node.js 8, the content would be uninitialized + - After Node.js 8, the content would be `50` bytes with the value `0` + +Because of the missing type check, an attacker could intentionally send a number +as part of the request. Using this, they can either: + +- Read uninitialized memory. This **will** leak passwords, encryption keys and other + kinds of sensitive information. (Information leak) +- Force the program to allocate a large amount of memory. For example, when specifying + `500000000` as the input value, each request will allocate 500MB of memory. + This can be used to either exhaust the memory available of a program completely + and make it crash, or slow it down significantly. (Denial of Service) + +Both of these scenarios are considered serious security issues in a real-world +web server context. + +when using `Buffer.from(req.body.string)` instead, passing a number will always +throw an exception instead, giving a controlled behaviour that can always be +handled by the program. + + +### The `Buffer()` constructor has been deprecated for a while. Is this really an issue? + +Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still +widely used. This includes new code, and overall usage of such code has actually been +*increasing*. diff --git a/node_modules/safer-buffer/Readme.md b/node_modules/safer-buffer/Readme.md new file mode 100644 index 0000000..14b0822 --- /dev/null +++ b/node_modules/safer-buffer/Readme.md @@ -0,0 +1,156 @@ +# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url] + +[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master +[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer +[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg +[npm-url]: https://npmjs.org/package/safer-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com +[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg +[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md + +Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current. + +## How to use? + +First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API. + +Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use +`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new +Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._ + +Also, see the +[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide. + +## Do I need it? + +Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that +is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()` +though. + +See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) +for a better description. + +## Why not [safe-buffer](https://npmjs.com/safe-buffer)? + +_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and +itself contains footguns._ + +`safe-buffer` could be used safely to get the new API while still keeping support for older +Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API +I found out that `safe-buffer` is itself causing problems in some cases. + +For example, consider the following snippet: + +```console +$ cat example.unsafe.js +console.log(Buffer(20)) +$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js + +$ standard example.unsafe.js +standard: Use JavaScript Standard Style (https://standardjs.com) + /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead. +``` + +This is allocates and writes to console an uninitialized chunk of memory. +[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people +to avoid using unsafe API. + +Let's now throw in `safe-buffer`! + +```console +$ cat example.safe-buffer.js +const Buffer = require('safe-buffer').Buffer +console.log(Buffer(20)) +$ standard example.safe-buffer.js +$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js + +``` + +See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior +remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out +chunks of uninitialized memory. +_And this code will still emit runtime warnings on Node.js 10.x and above._ + +That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or +emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some +discussion, it was decided to move my approach into a separate package, and _this is that separate +package_. + +This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing, +«fixing» the lint warning by blindly including `safe-buffer` without any actual changes. + +Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request +can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go +unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even +pass CI. _I also observed that being done in popular packages._ + +Some examples: + * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31) + (a module with 548 759 downloads/month), + * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61) + (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)), + * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c) + (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)), + * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec) + (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)), + * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1) + (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)). + * And there are a lot more over the ecosystem. + +I filed a PR at +[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to +partially fix that (for cases when that lint rule is used), but it is a semver-major change for +linter rules and presets, so it would take significant time for that to reach actual setups. +_It also hasn't been released yet (2018-03-20)._ + +Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake. +It still supports it with an explicit concern barier, by placing it under +`require('safer-buffer/dangereous')`. + +## But isn't throwing bad? + +Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like +unguarded `new Buffer()` calls that end up receiving user input can do. + +This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so +it is really simple to keep track of things and make sure that you don't mix old API usage with that. +Also, CI should hint anything that you might have missed. + +New commits, if tested, won't land new usage of unsafe Buffer API this way. +_Node.js 10.x also deals with that by printing a runtime depecation warning._ + +### Would it affect third-party modules? + +No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`. +Don't do that. + +### But I don't want throwing… + +That is also fine! + +Also, it could be better in some cases when you don't comprehensive enough test coverage. + +In that case — just don't override `Buffer` and use +`var SaferBuffer = require('safer-buffer').Buffer` instead. + +That way, everything using `Buffer` natively would still work, but there would be two drawbacks: + +* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and + `SaferBuffer.alloc` instead. +* You are still open to accidentally using the insecure deprecated API — use a linter to catch that. + +Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly +recommended. `Buffer` is not overriden in this usecase, so linters won't get confused. + +## «Without footguns»? + +Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property +on older versions and duping things from there. You shouldn't do that in your code, probabably. + +The intention is to remove the most significant footguns that affect lots of packages in the +ecosystem, and to do it in the proper way. + +Also, this package doesn't protect against security issues affecting some Node.js versions, so for +usage in your own production code, it is still recommended to update to a Node.js version +[supported by upstream](https://github.com/nodejs/release#release-schedule). diff --git a/node_modules/safer-buffer/dangerous.js b/node_modules/safer-buffer/dangerous.js new file mode 100644 index 0000000..ca41fdc --- /dev/null +++ b/node_modules/safer-buffer/dangerous.js @@ -0,0 +1,58 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer +var safer = require('./safer.js') +var Safer = safer.Buffer + +var dangerous = {} + +var key + +for (key in safer) { + if (!safer.hasOwnProperty(key)) continue + dangerous[key] = safer[key] +} + +var Dangereous = dangerous.Buffer = {} + +// Copy Safer API +for (key in Safer) { + if (!Safer.hasOwnProperty(key)) continue + Dangereous[key] = Safer[key] +} + +// Copy those missing unsafe methods, if they are present +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (Dangereous.hasOwnProperty(key)) continue + Dangereous[key] = Buffer[key] +} + +if (!Dangereous.allocUnsafe) { + Dangereous.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return Buffer(size) + } +} + +if (!Dangereous.allocUnsafeSlow) { + Dangereous.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + return buffer.SlowBuffer(size) + } +} + +module.exports = dangerous diff --git a/node_modules/safer-buffer/package.json b/node_modules/safer-buffer/package.json new file mode 100644 index 0000000..d452b04 --- /dev/null +++ b/node_modules/safer-buffer/package.json @@ -0,0 +1,34 @@ +{ + "name": "safer-buffer", + "version": "2.1.2", + "description": "Modern Buffer API polyfill without footguns", + "main": "safer.js", + "scripts": { + "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js", + "test": "standard && tape tests.js" + }, + "author": { + "name": "Nikita Skovoroda", + "email": "chalkerx@gmail.com", + "url": "https://github.com/ChALkeR" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/ChALkeR/safer-buffer.git" + }, + "bugs": { + "url": "https://github.com/ChALkeR/safer-buffer/issues" + }, + "devDependencies": { + "standard": "^11.0.1", + "tape": "^4.9.0" + }, + "files": [ + "Porting-Buffer.md", + "Readme.md", + "tests.js", + "dangerous.js", + "safer.js" + ] +} diff --git a/node_modules/safer-buffer/safer.js b/node_modules/safer-buffer/safer.js new file mode 100644 index 0000000..37c7e1a --- /dev/null +++ b/node_modules/safer-buffer/safer.js @@ -0,0 +1,77 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var buffer = require('buffer') +var Buffer = buffer.Buffer + +var safer = {} + +var key + +for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue + if (key === 'SlowBuffer' || key === 'Buffer') continue + safer[key] = buffer[key] +} + +var Safer = safer.Buffer = {} +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue + Safer[key] = Buffer[key] +} + +safer.Buffer.prototype = Buffer.prototype + +if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) + } + if (value && typeof value.length === 'undefined') { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) + } + return Buffer(value, encodingOrOffset, length) + } +} + +if (!Safer.alloc) { + Safer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + var buf = Buffer(size) + if (!fill || fill.length === 0) { + buf.fill(0) + } else if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + return buf + } +} + +if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding('buffer').kStringMaxLength + } catch (e) { + // we can't determine kStringMaxLength in environments where process.binding + // is unsupported, so let's not set it + } +} + +if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + } + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength + } +} + +module.exports = safer diff --git a/node_modules/safer-buffer/tests.js b/node_modules/safer-buffer/tests.js new file mode 100644 index 0000000..7ed2777 --- /dev/null +++ b/node_modules/safer-buffer/tests.js @@ -0,0 +1,406 @@ +/* eslint-disable node/no-deprecated-api */ + +'use strict' + +var test = require('tape') + +var buffer = require('buffer') + +var index = require('./') +var safer = require('./safer') +var dangerous = require('./dangerous') + +/* Inheritance tests */ + +test('Default is Safer', function (t) { + t.equal(index, safer) + t.notEqual(safer, dangerous) + t.notEqual(index, dangerous) + t.end() +}) + +test('Is not a function', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'object') + }); + [buffer].forEach(function (impl) { + t.equal(typeof impl, 'object') + t.equal(typeof impl.Buffer, 'function') + }) + t.end() +}) + +test('Constructor throws', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer() }) + t.throws(function () { impl.Buffer(0) }) + t.throws(function () { impl.Buffer('a') }) + t.throws(function () { impl.Buffer('a', 'utf-8') }) + t.throws(function () { return new impl.Buffer() }) + t.throws(function () { return new impl.Buffer(0) }) + t.throws(function () { return new impl.Buffer('a') }) + t.throws(function () { return new impl.Buffer('a', 'utf-8') }) + }) + t.end() +}) + +test('Safe methods exist', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.alloc, 'function', 'alloc') + t.equal(typeof impl.Buffer.from, 'function', 'from') + }) + t.end() +}) + +test('Unsafe methods exist only in Dangerous', function (t) { + [index, safer].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'undefined') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined') + }); + [dangerous].forEach(function (impl) { + t.equal(typeof impl.Buffer.allocUnsafe, 'function') + t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function') + }) + t.end() +}) + +test('Generic methods/properties are defined and equal', function (t) { + ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in buffer static methods/properties are inherited', function (t) { + Object.keys(buffer).forEach(function (method) { + if (method === 'SlowBuffer' || method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], buffer[method], method) + t.notEqual(typeof impl[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Built-in Buffer static methods/properties are inherited', function (t) { + Object.keys(buffer.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], buffer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('.prototype property of Buffer is inherited', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype') + t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype') + }) + t.end() +}) + +test('All Safer methods are present in Dangerous', function (t) { + Object.keys(safer).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], safer[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(safer.Buffer).forEach(function (method) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], safer.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +test('Safe methods from Dangerous methods are present in Safer', function (t) { + Object.keys(dangerous).forEach(function (method) { + if (method === 'Buffer') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl[method], dangerous[method], method) + if (method !== 'kStringMaxLength') { + t.notEqual(typeof impl[method], 'undefined', method) + } + }) + }) + Object.keys(dangerous.Buffer).forEach(function (method) { + if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return; + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer[method], dangerous.Buffer[method], method) + t.notEqual(typeof impl.Buffer[method], 'undefined', method) + }) + }) + t.end() +}) + +/* Behaviour tests */ + +test('Methods return Buffers', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(''))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3]))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3])))) + t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([]))) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0))) + t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10))) + }) + t.end() +}) + +test('Constructor is buffer.Buffer', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer) + t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer) + t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer) + t.equal(impl.Buffer.from([]).constructor, buffer.Buffer) + }); + [0, 10, 100].forEach(function (arg) { + t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer) + t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor) + }) + t.end() +}) + +test('Invalid calls throw', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.throws(function () { impl.Buffer.from(0) }) + t.throws(function () { impl.Buffer.from(10) }) + t.throws(function () { impl.Buffer.from(10, 'utf-8') }) + t.throws(function () { impl.Buffer.from('string', 'invalid encoding') }) + t.throws(function () { impl.Buffer.from(-10) }) + t.throws(function () { impl.Buffer.from(1e90) }) + t.throws(function () { impl.Buffer.from(Infinity) }) + t.throws(function () { impl.Buffer.from(-Infinity) }) + t.throws(function () { impl.Buffer.from(NaN) }) + t.throws(function () { impl.Buffer.from(null) }) + t.throws(function () { impl.Buffer.from(undefined) }) + t.throws(function () { impl.Buffer.from() }) + t.throws(function () { impl.Buffer.from({}) }) + t.throws(function () { impl.Buffer.alloc('') }) + t.throws(function () { impl.Buffer.alloc('string') }) + t.throws(function () { impl.Buffer.alloc('string', 'utf-8') }) + t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') }) + t.throws(function () { impl.Buffer.alloc(-10) }) + t.throws(function () { impl.Buffer.alloc(1e90) }) + t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) }) + t.throws(function () { impl.Buffer.alloc(Infinity) }) + t.throws(function () { impl.Buffer.alloc(-Infinity) }) + t.throws(function () { impl.Buffer.alloc(null) }) + t.throws(function () { impl.Buffer.alloc(undefined) }) + t.throws(function () { impl.Buffer.alloc() }) + t.throws(function () { impl.Buffer.alloc([]) }) + t.throws(function () { impl.Buffer.alloc([0, 42, 3]) }) + t.throws(function () { impl.Buffer.alloc({}) }) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.throws(function () { dangerous.Buffer[method]('') }) + t.throws(function () { dangerous.Buffer[method]('string') }) + t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') }) + t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) }) + t.throws(function () { dangerous.Buffer[method](Infinity) }) + if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) { + t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0') + } else { + t.throws(function () { dangerous.Buffer[method](-10) }) + t.throws(function () { dangerous.Buffer[method](-1e90) }) + t.throws(function () { dangerous.Buffer[method](-Infinity) }) + } + t.throws(function () { dangerous.Buffer[method](null) }) + t.throws(function () { dangerous.Buffer[method](undefined) }) + t.throws(function () { dangerous.Buffer[method]() }) + t.throws(function () { dangerous.Buffer[method]([]) }) + t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) }) + t.throws(function () { dangerous.Buffer[method]({}) }) + }) + t.end() +}) + +test('Buffers have appropriate lengths', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.equal(impl.Buffer.alloc(0).length, 0) + t.equal(impl.Buffer.alloc(10).length, 10) + t.equal(impl.Buffer.from('').length, 0) + t.equal(impl.Buffer.from('string').length, 6) + t.equal(impl.Buffer.from('string', 'utf-8').length, 6) + t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11) + t.equal(impl.Buffer.from([0, 42, 3]).length, 3) + t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3) + t.equal(impl.Buffer.from([]).length, 0) + }); + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + t.equal(dangerous.Buffer[method](0).length, 0) + t.equal(dangerous.Buffer[method](10).length, 10) + }) + t.end() +}) + +test('Buffers have appropriate lengths (2)', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true; + [ safer.Buffer.alloc, + dangerous.Buffer.allocUnsafe, + dangerous.Buffer.allocUnsafeSlow + ].forEach(function (method) { + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 1e5) + var buf = method(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + } + }) + t.ok(ok) + t.end() +}) + +test('.alloc(size) is zero-filled and has correct length', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = index.Buffer.alloc(length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) { + ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) { + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var buf = dangerous.Buffer[method](length) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + buf.fill(0, 0, length) + var j + for (j = 0; j < length; j++) { + if (buf[j] !== 0) ok = false + } + buf.fill(1, 0, length) + for (j = 0; j < length; j++) { + if (buf[j] !== 1) ok = false + } + } + t.ok(ok, method) + }) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.end() +}) + +test('.alloc(size, fill) is `fill`-filled', function (t) { + t.equal(index.Buffer.alloc, safer.Buffer.alloc) + t.equal(index.Buffer.alloc, dangerous.Buffer.alloc) + var ok = true + for (var i = 0; i < 1e2; i++) { + var length = Math.round(Math.random() * 2e6) + var fill = Math.round(Math.random() * 255) + var buf = index.Buffer.alloc(length, fill) + if (!buffer.Buffer.isBuffer(buf)) ok = false + if (buf.length !== length) ok = false + for (var j = 0; j < length; j++) { + if (buf[j] !== fill) ok = false + } + } + t.ok(ok) + t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97)) + t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98)) + + var tmp = new buffer.Buffer(2) + tmp.fill('ok') + if (tmp[1] === tmp[0]) { + // Outdated Node.js + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo')) + } else { + t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko')) + } + t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok')) + + t.end() +}) + +test('safer.Buffer.from returns results same as Buffer constructor', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), new buffer.Buffer('')) + t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string')) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8')) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64')) + t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3])) + t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3]))) + t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([])) + }) + t.end() +}) + +test('safer.Buffer.from returns consistent results', function (t) { + [index, safer, dangerous].forEach(function (impl) { + t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0)) + t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string')) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103])) + t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string'))) + t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree')) + t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree')) + }) + t.end() +}) diff --git a/node_modules/sax/LICENSE.md b/node_modules/sax/LICENSE.md new file mode 100644 index 0000000..c5402b9 --- /dev/null +++ b/node_modules/sax/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node_modules/sax/README.md b/node_modules/sax/README.md new file mode 100644 index 0000000..682d207 --- /dev/null +++ b/node_modules/sax/README.md @@ -0,0 +1,227 @@ +# sax js + +A sax-style parser for XML and HTML. + +Designed with [node](http://nodejs.org/) in mind, but should work fine in +the browser or other CommonJS implementations. + +## What This Is + +- A very simple tool to parse through an XML string. +- A stepping stone to a streaming HTML parser. +- A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML + docs. + +## What This Is (probably) Not + +- An HTML Parser - That's a fine goal, but this isn't it. It's just + XML. +- A DOM Builder - You can use it to build an object model out of XML, + but it doesn't do that out of the box. +- XSLT - No DOM = no querying. +- 100% Compliant with (some other SAX implementation) - Most SAX + implementations are in Java and do a lot more than this does. +- An XML Validator - It does a little validation when in strict mode, but + not much. +- A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic + masochism. +- A DTD-aware Thing - Fetching DTDs is a much bigger job. + +## Regarding `Hello, world!').close() + +// stream usage +// takes the same options as the parser +var saxStream = require('sax').createStream(strict, options) +saxStream.on('error', function (e) { + // unhandled errors will throw, since this is a proper node + // event emitter. + console.error('error!', e) + // clear the error + this._parser.error = null + this._parser.resume() +}) +saxStream.on('opentag', function (node) { + // same object as above +}) +// pipe is supported, and it's readable/writable +// same chunks coming in also go out. +fs.createReadStream('file.xml') + .pipe(saxStream) + .pipe(fs.createWriteStream('file-copy.xml')) +``` + +## Arguments + +Pass the following arguments to the parser function. All are optional. + +`strict` - Boolean. Whether or not to be a jerk. Default: `false`. + +`opt` - Object bag of settings regarding string formatting. All default to `false`. + +Settings supported: + +- `trim` - Boolean. Whether or not to trim text and comment nodes. +- `normalize` - Boolean. If true, then turn any whitespace into a single + space. +- `lowercase` - Boolean. If true, then lowercase tag names and attribute names + in loose mode, rather than uppercasing them. +- `xmlns` - Boolean. If true, then namespaces are supported. +- `position` - Boolean. If false, then don't track line/col/position. +- `strictEntities` - Boolean. If true, only parse [predefined XML + entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent) + (`&`, `'`, `>`, `<`, and `"`) +- `unquotedAttributeValues` - Boolean. If true, then unquoted + attribute values are allowed. Defaults to `false` when `strict` + is true, `true` otherwise. + +## Methods + +`write` - Write bytes onto the stream. You don't have to do this all at +once. You can keep writing as much as you want. + +`close` - Close the stream. Once closed, no more data may be written until +it is done processing the buffer, which is signaled by the `end` event. + +`resume` - To gracefully handle errors, assign a listener to the `error` +event. Then, when the error is taken care of, you can call `resume` to +continue parsing. Otherwise, the parser will not continue while in an error +state. + +## Members + +At all times, the parser object will have the following members: + +`line`, `column`, `position` - Indications of the position in the XML +document where the parser currently is looking. + +`startTagPosition` - Indicates the position where the current tag starts. + +`closed` - Boolean indicating whether or not the parser can be written to. +If it's `true`, then wait for the `ready` event to write again. + +`strict` - Boolean indicating whether or not the parser is a jerk. + +`opt` - Any options passed into the constructor. + +`tag` - The current tag being dealt with. + +And a bunch of other stuff that you probably shouldn't touch. + +## Events + +All events emit with a single argument. To listen to an event, assign a +function to `on`. Functions get executed in the this-context of +the parser object. The list of supported events are also in the exported +`EVENTS` array. + +When using the stream interface, assign handlers using the EventEmitter +`on` function in the normal fashion. + +`error` - Indication that something bad happened. The error will be hanging +out on `parser.error`, and must be deleted before parsing can continue. By +listening to this event, you can keep an eye on that kind of stuff. Note: +this happens _much_ more in strict mode. Argument: instance of `Error`. + +`text` - Text node. Argument: string of text. + +`doctype` - The ``. Argument: +object with `name` and `body` members. Attributes are not parsed, as +processing instructions have implementation dependent semantics. + +`sgmldeclaration` - Random SGML declarations. Stuff like `` +would trigger this kind of event. This is a weird thing to support, so it +might go away at some point. SAX isn't intended to be used to parse SGML, +after all. + +`opentagstart` - Emitted immediately when the tag name is available, +but before any attributes are encountered. Argument: object with a +`name` field and an empty `attributes` set. Note that this is the +same object that will later be emitted in the `opentag` event. + +`opentag` - An opening tag. Argument: object with `name` and `attributes`. +In non-strict mode, tag names are uppercased, unless the `lowercase` +option is set. If the `xmlns` option is set, then it will contain +namespace binding information on the `ns` member, and will have a +`local`, `prefix`, and `uri` member. + +`closetag` - A closing tag. In loose mode, tags are auto-closed if their +parent closes. In strict mode, well-formedness is enforced. Note that +self-closing tags will have `closeTag` emitted immediately after `openTag`. +Argument: tag name. + +`attribute` - An attribute node. Argument: object with `name` and `value`. +In non-strict mode, attribute names are uppercased, unless the `lowercase` +option is set. If the `xmlns` option is set, it will also contains namespace +information. + +`comment` - A comment node. Argument: the string of the comment. + +`opencdata` - The opening tag of a ``) of a `` tags trigger a `"script"` +event, and their contents are not checked for special xml characters. +If you pass `noscript: true`, then this behavior is suppressed. + +## Reporting Problems + +It's best to write a failing test if you find an issue. I will always +accept pull requests with failing tests if they demonstrate intended +behavior, but it is very hard to figure out what issue you're describing +without a test. Writing a test is also the best way for you yourself +to figure out if you really understand the issue you think you have with +sax-js. diff --git a/node_modules/sax/lib/sax.js b/node_modules/sax/lib/sax.js new file mode 100644 index 0000000..cbbd94e --- /dev/null +++ b/node_modules/sax/lib/sax.js @@ -0,0 +1,1697 @@ +;(function (sax) { + // wrapper for non-node envs + sax.parser = function (strict, opt) { + return new SAXParser(strict, opt) + } + sax.SAXParser = SAXParser + sax.SAXStream = SAXStream + sax.createStream = createStream + + // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. + // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), + // since that's the earliest that a buffer overrun could occur. This way, checks are + // as rare as required, but as often as necessary to ensure never crossing this bound. + // Furthermore, buffers are only tested at most once per write(), so passing a very + // large string into write() might have undesirable effects, but this is manageable by + // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme + // edge case, result in creating at most one complete copy of the string passed in. + // Set to Infinity to have unlimited buffers. + sax.MAX_BUFFER_LENGTH = 64 * 1024 + + var buffers = [ + 'comment', + 'sgmlDecl', + 'textNode', + 'tagName', + 'doctype', + 'procInstName', + 'procInstBody', + 'entity', + 'attribName', + 'attribValue', + 'cdata', + 'script', + ] + + sax.EVENTS = [ + 'text', + 'processinginstruction', + 'sgmldeclaration', + 'doctype', + 'comment', + 'opentagstart', + 'attribute', + 'opentag', + 'closetag', + 'opencdata', + 'cdata', + 'closecdata', + 'error', + 'end', + 'ready', + 'script', + 'opennamespace', + 'closenamespace', + ] + + function SAXParser(strict, opt) { + if (!(this instanceof SAXParser)) { + return new SAXParser(strict, opt) + } + + var parser = this + clearBuffers(parser) + parser.q = parser.c = '' + parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH + parser.opt = opt || {} + parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags + parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' + parser.tags = [] + parser.closed = parser.closedRoot = parser.sawRoot = false + parser.tag = parser.error = null + parser.strict = !!strict + parser.noscript = !!(strict || parser.opt.noscript) + parser.state = S.BEGIN + parser.strictEntities = parser.opt.strictEntities + parser.ENTITIES = + parser.strictEntities ? + Object.create(sax.XML_ENTITIES) + : Object.create(sax.ENTITIES) + parser.attribList = [] + + // namespaces form a prototype chain. + // it always points at the current tag, + // which protos to its parent tag. + if (parser.opt.xmlns) { + parser.ns = Object.create(rootNS) + } + + // disallow unquoted attribute values if not otherwise configured + // and strict mode is true + if (parser.opt.unquotedAttributeValues === undefined) { + parser.opt.unquotedAttributeValues = !strict + } + + // mostly just for error reporting + parser.trackPosition = parser.opt.position !== false + if (parser.trackPosition) { + parser.position = parser.line = parser.column = 0 + } + emit(parser, 'onready') + } + + if (!Object.create) { + Object.create = function (o) { + function F() {} + F.prototype = o + var newf = new F() + return newf + } + } + + if (!Object.keys) { + Object.keys = function (o) { + var a = [] + for (var i in o) if (o.hasOwnProperty(i)) a.push(i) + return a + } + } + + function checkBufferLength(parser) { + var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) + var maxActual = 0 + for (var i = 0, l = buffers.length; i < l; i++) { + var len = parser[buffers[i]].length + if (len > maxAllowed) { + // Text/cdata nodes can get big, and since they're buffered, + // we can get here under normal conditions. + // Avoid issues by emitting the text node now, + // so at least it won't get any bigger. + switch (buffers[i]) { + case 'textNode': + closeText(parser) + break + + case 'cdata': + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' + break + + case 'script': + emitNode(parser, 'onscript', parser.script) + parser.script = '' + break + + default: + error(parser, 'Max buffer length exceeded: ' + buffers[i]) + } + } + maxActual = Math.max(maxActual, len) + } + // schedule the next check for the earliest possible buffer overrun. + var m = sax.MAX_BUFFER_LENGTH - maxActual + parser.bufferCheckPosition = m + parser.position + } + + function clearBuffers(parser) { + for (var i = 0, l = buffers.length; i < l; i++) { + parser[buffers[i]] = '' + } + } + + function flushBuffers(parser) { + closeText(parser) + if (parser.cdata !== '') { + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' + } + if (parser.script !== '') { + emitNode(parser, 'onscript', parser.script) + parser.script = '' + } + } + + SAXParser.prototype = { + end: function () { + end(this) + }, + write: write, + resume: function () { + this.error = null + return this + }, + close: function () { + return this.write(null) + }, + flush: function () { + flushBuffers(this) + }, + } + + var Stream + try { + Stream = require('stream').Stream + } catch (ex) { + Stream = function () {} + } + if (!Stream) Stream = function () {} + + var streamWraps = sax.EVENTS.filter(function (ev) { + return ev !== 'error' && ev !== 'end' + }) + + function createStream(strict, opt) { + return new SAXStream(strict, opt) + } + + function SAXStream(strict, opt) { + if (!(this instanceof SAXStream)) { + return new SAXStream(strict, opt) + } + + Stream.apply(this) + + this._parser = new SAXParser(strict, opt) + this.writable = true + this.readable = true + + var me = this + + this._parser.onend = function () { + me.emit('end') + } + + this._parser.onerror = function (er) { + me.emit('error', er) + + // if didn't throw, then means error was handled. + // go ahead and clear error, so we can write again. + me._parser.error = null + } + + this._decoder = null + + streamWraps.forEach(function (ev) { + Object.defineProperty(me, 'on' + ev, { + get: function () { + return me._parser['on' + ev] + }, + set: function (h) { + if (!h) { + me.removeAllListeners(ev) + me._parser['on' + ev] = h + return h + } + me.on(ev, h) + }, + enumerable: true, + configurable: false, + }) + }) + } + + SAXStream.prototype = Object.create(Stream.prototype, { + constructor: { + value: SAXStream, + }, + }) + + SAXStream.prototype.write = function (data) { + if ( + typeof Buffer === 'function' && + typeof Buffer.isBuffer === 'function' && + Buffer.isBuffer(data) + ) { + if (!this._decoder) { + var SD = require('string_decoder').StringDecoder + this._decoder = new SD('utf8') + } + data = this._decoder.write(data) + } + + this._parser.write(data.toString()) + this.emit('data', data) + return true + } + + SAXStream.prototype.end = function (chunk) { + if (chunk && chunk.length) { + this.write(chunk) + } + this._parser.end() + return true + } + + SAXStream.prototype.on = function (ev, handler) { + var me = this + if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { + me._parser['on' + ev] = function () { + var args = + arguments.length === 1 ? + [arguments[0]] + : Array.apply(null, arguments) + args.splice(0, 0, ev) + me.emit.apply(me, args) + } + } + + return Stream.prototype.on.call(me, ev, handler) + } + + // this really needs to be replaced with character classes. + // XML allows all manner of ridiculous numbers and digits. + var CDATA = '[CDATA[' + var DOCTYPE = 'DOCTYPE' + var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' + var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' + var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } + + // http://www.w3.org/TR/REC-xml/#NT-NameStartChar + // This implementation works on strings, a single character at a time + // as such, it cannot ever support astral-plane characters (10000-EFFFF) + // without a significant breaking change to either this parser, or the + // JavaScript language. Implementation of an emoji-capable xml parser + // is left as an exercise for the reader. + var nameStart = + /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + + var nameBody = + /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ + + var entityStart = + /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + var entityBody = + /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ + + function isWhitespace(c) { + return c === ' ' || c === '\n' || c === '\r' || c === '\t' + } + + function isQuote(c) { + return c === '"' || c === "'" + } + + function isAttribEnd(c) { + return c === '>' || isWhitespace(c) + } + + function isMatch(regex, c) { + return regex.test(c) + } + + function notMatch(regex, c) { + return !isMatch(regex, c) + } + + var S = 0 + sax.STATE = { + BEGIN: S++, // leading byte order mark or whitespace + BEGIN_WHITESPACE: S++, // leading whitespace + TEXT: S++, // general stuff + TEXT_ENTITY: S++, // & and such. + OPEN_WAKA: S++, // < + SGML_DECL: S++, // + SCRIPT: S++, // ' +}); +``` + +The above will produce the following string, HTML-escaped output which is safe to put into an HTML document as it will not cause the inline script element to terminate: + +```js +'{"haxorXSS":"\\u003C\\u002Fscript\\u003E"}' +``` + +> You can pass an optional `unsafe` argument to `serialize()` for straight serialization. + +### Options + +The `serialize()` function accepts an `options` object as its second argument. All options are being defaulted to `undefined`: + +#### `options.space` + +This option is the same as the `space` argument that can be passed to [`JSON.stringify`][JSON.stringify]. It can be used to add whitespace and indentation to the serialized output to make it more readable. + +```js +serialize(obj, {space: 2}); +``` + +#### `options.isJSON` + +This option is a signal to `serialize()` that the object being serialized does not contain any function or regexps values. This enables a hot-path that allows serialization to be over 3x faster. If you're serializing a lot of data, and know its pure JSON, then you can enable this option for a speed-up. + +**Note:** That when using this option, the output will still be escaped to protect against XSS. + +```js +serialize(obj, {isJSON: true}); +``` + +#### `options.unsafe` + +This option is to signal `serialize()` that we want to do a straight conversion, without the XSS protection. This options needs to be explicitly set to `true`. HTML characters and JavaScript line terminators will not be escaped. You will have to roll your own. + +```js +serialize(obj, {unsafe: true}); +``` + +#### `options.ignoreFunction` + +This option is to signal `serialize()` that we do not want serialize JavaScript function. +Just treat function like `JSON.stringify` do, but other features will work as expected. + +```js +serialize(obj, {ignoreFunction: true}); +``` + +## Deserializing + +For some use cases you might also need to deserialize the string. This is explicitly not part of this module. However, you can easily write it yourself: + +```js +function deserialize(serializedJavascript){ + return eval('(' + serializedJavascript + ')'); +} +``` + +**Note:** Don't forget the parentheses around the serialized javascript, as the opening bracket `{` will be considered to be the start of a body. + +## License + +This software is free to use under the Yahoo! Inc. BSD license. +See the [LICENSE file][LICENSE] for license text and copyright information. + + +[npm]: https://www.npmjs.org/package/serialize-javascript +[npm-badge]: https://img.shields.io/npm/v/serialize-javascript.svg?style=flat-square +[david]: https://david-dm.org/yahoo/serialize-javascript +[david-badge]: https://img.shields.io/david/yahoo/serialize-javascript.svg?style=flat-square +[express-state]: https://github.com/yahoo/express-state +[JSON.stringify]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify +[LICENSE]: https://github.com/yahoo/serialize-javascript/blob/main/LICENSE diff --git a/node_modules/serialize-javascript/index.js b/node_modules/serialize-javascript/index.js new file mode 100644 index 0000000..156f8f9 --- /dev/null +++ b/node_modules/serialize-javascript/index.js @@ -0,0 +1,268 @@ +/* +Copyright (c) 2014, Yahoo! Inc. All rights reserved. +Copyrights licensed under the New BSD License. +See the accompanying LICENSE file for terms. +*/ + +'use strict'; + +var randomBytes = require('randombytes'); + +// Generate an internal UID to make the regexp pattern harder to guess. +var UID_LENGTH = 16; +var UID = generateUID(); +var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|A|U|I|B|L)-' + UID + '-(\\d+)__@"', 'g'); + +var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g; +var IS_PURE_FUNCTION = /function.*?\(/; +var IS_ARROW_FUNCTION = /.*?=>.*?/; +var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g; + +var RESERVED_SYMBOLS = ['*', 'async']; + +// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their +// Unicode char counterparts which are safe to use in JavaScript strings. +var ESCAPED_CHARS = { + '<' : '\\u003C', + '>' : '\\u003E', + '/' : '\\u002F', + '\u2028': '\\u2028', + '\u2029': '\\u2029' +}; + +function escapeUnsafeChars(unsafeChar) { + return ESCAPED_CHARS[unsafeChar]; +} + +function generateUID() { + var bytes = randomBytes(UID_LENGTH); + var result = ''; + for(var i=0; i arg1+5 + if(IS_ARROW_FUNCTION.test(serializedFn)) { + return serializedFn; + } + + var argsStartsAt = serializedFn.indexOf('('); + var def = serializedFn.substr(0, argsStartsAt) + .trim() + .split(' ') + .filter(function(val) { return val.length > 0 }); + + var nonReservedSymbols = def.filter(function(val) { + return RESERVED_SYMBOLS.indexOf(val) === -1 + }); + + // enhanced literal objects, example: {key() {}} + if(nonReservedSymbols.length > 0) { + return (def.indexOf('async') > -1 ? 'async ' : '') + 'function' + + (def.join('').indexOf('*') > -1 ? '*' : '') + + serializedFn.substr(argsStartsAt); + } + + // arrow functions + return serializedFn; + } + + // Check if the parameter is function + if (options.ignoreFunction && typeof obj === "function") { + obj = undefined; + } + // Protects against `JSON.stringify()` returning `undefined`, by serializing + // to the literal string: "undefined". + if (obj === undefined) { + return String(obj); + } + + var str; + + // Creates a JSON string representation of the value. + // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args. + if (options.isJSON && !options.space) { + str = JSON.stringify(obj); + } else { + str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space); + } + + // Protects against `JSON.stringify()` returning `undefined`, by serializing + // to the literal string: "undefined". + if (typeof str !== 'string') { + return String(str); + } + + // Replace unsafe HTML and invalid JavaScript line terminator chars with + // their safe Unicode char counterpart. This _must_ happen before the + // regexps and functions are serialized and added back to the string. + if (options.unsafe !== true) { + str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars); + } + + if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && arrays.length === 0 && undefs.length === 0 && infinities.length === 0 && bigInts.length === 0 && urls.length === 0) { + return str; + } + + // Replaces all occurrences of function, regexp, date, map and set placeholders in the + // JSON string with their string representations. If the original value can + // not be found, then `undefined` is used. + return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) { + // The placeholder may not be preceded by a backslash. This is to prevent + // replacing things like `"a\"@__R--0__@"` and thus outputting + // invalid JS. + if (backSlash) { + return match; + } + + if (type === 'D') { + return "new Date(\"" + dates[valueIndex].toISOString() + "\")"; + } + + if (type === 'R') { + return "new RegExp(" + serialize(regexps[valueIndex].source) + ", \"" + regexps[valueIndex].flags + "\")"; + } + + if (type === 'M') { + return "new Map(" + serialize(Array.from(maps[valueIndex].entries()), options) + ")"; + } + + if (type === 'S') { + return "new Set(" + serialize(Array.from(sets[valueIndex].values()), options) + ")"; + } + + if (type === 'A') { + return "Array.prototype.slice.call(" + serialize(Object.assign({ length: arrays[valueIndex].length }, arrays[valueIndex]), options) + ")"; + } + + if (type === 'U') { + return 'undefined' + } + + if (type === 'I') { + return infinities[valueIndex]; + } + + if (type === 'B') { + return "BigInt(\"" + bigInts[valueIndex] + "\")"; + } + + if (type === 'L') { + return "new URL(" + serialize(urls[valueIndex].toString(), options) + ")"; + } + + var fn = functions[valueIndex]; + + return serializeFunc(fn); + }); +} diff --git a/node_modules/serialize-javascript/package.json b/node_modules/serialize-javascript/package.json new file mode 100644 index 0000000..ee71672 --- /dev/null +++ b/node_modules/serialize-javascript/package.json @@ -0,0 +1,36 @@ +{ + "name": "serialize-javascript", + "version": "6.0.2", + "description": "Serialize JavaScript to a superset of JSON that includes regular expressions and functions.", + "main": "index.js", + "scripts": { + "benchmark": "node -v && node test/benchmark/serialize.js", + "test": "nyc --reporter=lcov mocha test/unit" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/yahoo/serialize-javascript.git" + }, + "keywords": [ + "serialize", + "serialization", + "javascript", + "js", + "json" + ], + "author": "Eric Ferraiuolo ", + "license": "BSD-3-Clause", + "bugs": { + "url": "https://github.com/yahoo/serialize-javascript/issues" + }, + "homepage": "https://github.com/yahoo/serialize-javascript", + "devDependencies": { + "benchmark": "^2.1.4", + "chai": "^4.1.0", + "mocha": "^10.0.0", + "nyc": "^15.0.0" + }, + "dependencies": { + "randombytes": "^2.1.0" + } +} diff --git a/node_modules/serve-static/HISTORY.md b/node_modules/serve-static/HISTORY.md new file mode 100644 index 0000000..a3f174e --- /dev/null +++ b/node_modules/serve-static/HISTORY.md @@ -0,0 +1,516 @@ +2.2.0 / 2025-03-27 +================== + +* deps: send@^1.2.0 + +2.1.0 / 2024-09-10 +=================== + +* Changes from 1.16.0 +* deps: send@^1.2.0 + +2.0.0 / 2024-08-23 +================== + +* deps: + * parseurl@^1.3.3 + * excape-html@^1.0.3 + * encodeurl@^2.0.0 + * supertest@^6.3.4 + * safe-buffer@^5.2.1 + * nyc@^17.0.0 + * mocha@^10.7.0 +* Changes from 1.x + +2.0.0-beta.2 / 2024-03-20 +========================= + + * deps: send@1.0.0-beta.2 + +2.0.0-beta.1 / 2022-02-05 +========================= + + * Change `dotfiles` option default to `'ignore'` + * Drop support for Node.js 0.8 + * Remove `hidden` option; use `dotfiles` option instead + * Remove `mime` export; use `mime-types` package instead + * deps: send@1.0.0-beta.1 + - Use `mime-types` for file to content type mapping + - deps: debug@3.1.0 + +1.16.0 / 2024-09-10 +=================== + +* Remove link renderization in html while redirecting + +1.15.0 / 2022-03-24 +=================== + + * deps: send@0.18.0 + - Fix emitted 416 error missing headers property + - Limit the headers removed for 304 response + - deps: depd@2.0.0 + - deps: destroy@1.2.0 + - deps: http-errors@2.0.0 + - deps: on-finished@2.4.1 + - deps: statuses@2.0.1 + +1.14.2 / 2021-12-15 +=================== + + * deps: send@0.17.2 + - deps: http-errors@1.8.1 + - deps: ms@2.1.3 + - pref: ignore empty http tokens + +1.14.1 / 2019-05-10 +=================== + + * Set stricter CSP header in redirect response + * deps: send@0.17.1 + - deps: range-parser@~1.2.1 + +1.14.0 / 2019-05-07 +=================== + + * deps: parseurl@~1.3.3 + * deps: send@0.17.0 + - deps: http-errors@~1.7.2 + - deps: mime@1.6.0 + - deps: ms@2.1.1 + - deps: statuses@~1.5.0 + - perf: remove redundant `path.normalize` call + +1.13.2 / 2018-02-07 +=================== + + * Fix incorrect end tag in redirects + * deps: encodeurl@~1.0.2 + - Fix encoding `%` as last character + * deps: send@0.16.2 + - deps: depd@~1.1.2 + - deps: encodeurl@~1.0.2 + - deps: statuses@~1.4.0 + +1.13.1 / 2017-09-29 +=================== + + * Fix regression when `root` is incorrectly set to a file + * deps: send@0.16.1 + +1.13.0 / 2017-09-27 +=================== + + * deps: send@0.16.0 + - Add 70 new types for file extensions + - Add `immutable` option + - Fix missing `` in default error & redirects + - Set charset as "UTF-8" for .js and .json + - Use instance methods on steam to check for listeners + - deps: mime@1.4.1 + - perf: improve path validation speed + +1.12.6 / 2017-09-22 +=================== + + * deps: send@0.15.6 + - deps: debug@2.6.9 + - perf: improve `If-Match` token parsing + * perf: improve slash collapsing + +1.12.5 / 2017-09-21 +=================== + + * deps: parseurl@~1.3.2 + - perf: reduce overhead for full URLs + - perf: unroll the "fast-path" `RegExp` + * deps: send@0.15.5 + - Fix handling of modified headers with invalid dates + - deps: etag@~1.8.1 + - deps: fresh@0.5.2 + +1.12.4 / 2017-08-05 +=================== + + * deps: send@0.15.4 + - deps: debug@2.6.8 + - deps: depd@~1.1.1 + - deps: http-errors@~1.6.2 + +1.12.3 / 2017-05-16 +=================== + + * deps: send@0.15.3 + - deps: debug@2.6.7 + +1.12.2 / 2017-04-26 +=================== + + * deps: send@0.15.2 + - deps: debug@2.6.4 + +1.12.1 / 2017-03-04 +=================== + + * deps: send@0.15.1 + - Fix issue when `Date.parse` does not return `NaN` on invalid date + - Fix strict violation in broken environments + +1.12.0 / 2017-02-25 +=================== + + * Send complete HTML document in redirect response + * Set default CSP header in redirect response + * deps: send@0.15.0 + - Fix false detection of `no-cache` request directive + - Fix incorrect result when `If-None-Match` has both `*` and ETags + - Fix weak `ETag` matching to match spec + - Remove usage of `res._headers` private field + - Support `If-Match` and `If-Unmodified-Since` headers + - Use `res.getHeaderNames()` when available + - Use `res.headersSent` when available + - deps: debug@2.6.1 + - deps: etag@~1.8.0 + - deps: fresh@0.5.0 + - deps: http-errors@~1.6.1 + +1.11.2 / 2017-01-23 +=================== + + * deps: send@0.14.2 + - deps: http-errors@~1.5.1 + - deps: ms@0.7.2 + - deps: statuses@~1.3.1 + +1.11.1 / 2016-06-10 +=================== + + * Fix redirect error when `req.url` contains raw non-URL characters + * deps: send@0.14.1 + +1.11.0 / 2016-06-07 +=================== + + * Use status code 301 for redirects + * deps: send@0.14.0 + - Add `acceptRanges` option + - Add `cacheControl` option + - Attempt to combine multiple ranges into single range + - Correctly inherit from `Stream` class + - Fix `Content-Range` header in 416 responses when using `start`/`end` options + - Fix `Content-Range` header missing from default 416 responses + - Ignore non-byte `Range` headers + - deps: http-errors@~1.5.0 + - deps: range-parser@~1.2.0 + - deps: statuses@~1.3.0 + - perf: remove argument reassignment + +1.10.3 / 2016-05-30 +=================== + + * deps: send@0.13.2 + - Fix invalid `Content-Type` header when `send.mime.default_type` unset + +1.10.2 / 2016-01-19 +=================== + + * deps: parseurl@~1.3.1 + - perf: enable strict mode + +1.10.1 / 2016-01-16 +=================== + + * deps: escape-html@~1.0.3 + - perf: enable strict mode + - perf: optimize string replacement + - perf: use faster string coercion + * deps: send@0.13.1 + - deps: depd@~1.1.0 + - deps: destroy@~1.0.4 + - deps: escape-html@~1.0.3 + - deps: range-parser@~1.0.3 + +1.10.0 / 2015-06-17 +=================== + + * Add `fallthrough` option + - Allows declaring this middleware is the final destination + - Provides better integration with Express patterns + * Fix reading options from options prototype + * Improve the default redirect response headers + * deps: escape-html@1.0.2 + * deps: send@0.13.0 + - Allow Node.js HTTP server to set `Date` response header + - Fix incorrectly removing `Content-Location` on 304 response + - Improve the default redirect response headers + - Send appropriate headers on default error response + - Use `http-errors` for standard emitted errors + - Use `statuses` instead of `http` module for status messages + - deps: escape-html@1.0.2 + - deps: etag@~1.7.0 + - deps: fresh@0.3.0 + - deps: on-finished@~2.3.0 + - perf: enable strict mode + - perf: remove unnecessary array allocations + * perf: enable strict mode + * perf: remove argument reassignment + +1.9.3 / 2015-05-14 +================== + + * deps: send@0.12.3 + - deps: debug@~2.2.0 + - deps: depd@~1.0.1 + - deps: etag@~1.6.0 + - deps: ms@0.7.1 + - deps: on-finished@~2.2.1 + +1.9.2 / 2015-03-14 +================== + + * deps: send@0.12.2 + - Throw errors early for invalid `extensions` or `index` options + - deps: debug@~2.1.3 + +1.9.1 / 2015-02-17 +================== + + * deps: send@0.12.1 + - Fix regression sending zero-length files + +1.9.0 / 2015-02-16 +================== + + * deps: send@0.12.0 + - Always read the stat size from the file + - Fix mutating passed-in `options` + - deps: mime@1.3.4 + +1.8.1 / 2015-01-20 +================== + + * Fix redirect loop in Node.js 0.11.14 + * deps: send@0.11.1 + - Fix root path disclosure + +1.8.0 / 2015-01-05 +================== + + * deps: send@0.11.0 + - deps: debug@~2.1.1 + - deps: etag@~1.5.1 + - deps: ms@0.7.0 + - deps: on-finished@~2.2.0 + +1.7.2 / 2015-01-02 +================== + + * Fix potential open redirect when mounted at root + +1.7.1 / 2014-10-22 +================== + + * deps: send@0.10.1 + - deps: on-finished@~2.1.1 + +1.7.0 / 2014-10-15 +================== + + * deps: send@0.10.0 + - deps: debug@~2.1.0 + - deps: depd@~1.0.0 + - deps: etag@~1.5.0 + +1.6.5 / 2015-02-04 +================== + + * Fix potential open redirect when mounted at root + - Back-ported from v1.7.2 + +1.6.4 / 2014-10-08 +================== + + * Fix redirect loop when index file serving disabled + +1.6.3 / 2014-09-24 +================== + + * deps: send@0.9.3 + - deps: etag@~1.4.0 + +1.6.2 / 2014-09-15 +================== + + * deps: send@0.9.2 + - deps: depd@0.4.5 + - deps: etag@~1.3.1 + - deps: range-parser@~1.0.2 + +1.6.1 / 2014-09-07 +================== + + * deps: send@0.9.1 + - deps: fresh@0.2.4 + +1.6.0 / 2014-09-07 +================== + + * deps: send@0.9.0 + - Add `lastModified` option + - Use `etag` to generate `ETag` header + - deps: debug@~2.0.0 + +1.5.4 / 2014-09-04 +================== + + * deps: send@0.8.5 + - Fix a path traversal issue when using `root` + - Fix malicious path detection for empty string path + +1.5.3 / 2014-08-17 +================== + + * deps: send@0.8.3 + +1.5.2 / 2014-08-14 +================== + + * deps: send@0.8.2 + - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream` + +1.5.1 / 2014-08-09 +================== + + * Fix parsing of weird `req.originalUrl` values + * deps: parseurl@~1.3.0 + * deps: utils-merge@1.0.0 + +1.5.0 / 2014-08-05 +================== + + * deps: send@0.8.1 + - Add `extensions` option + +1.4.4 / 2014-08-04 +================== + + * deps: send@0.7.4 + - Fix serving index files without root dir + +1.4.3 / 2014-07-29 +================== + + * deps: send@0.7.3 + - Fix incorrect 403 on Windows and Node.js 0.11 + +1.4.2 / 2014-07-27 +================== + + * deps: send@0.7.2 + - deps: depd@0.4.4 + +1.4.1 / 2014-07-26 +================== + + * deps: send@0.7.1 + - deps: depd@0.4.3 + +1.4.0 / 2014-07-21 +================== + + * deps: parseurl@~1.2.0 + - Cache URLs based on original value + - Remove no-longer-needed URL mis-parse work-around + - Simplify the "fast-path" `RegExp` + * deps: send@0.7.0 + - Add `dotfiles` option + - deps: debug@1.0.4 + - deps: depd@0.4.2 + +1.3.2 / 2014-07-11 +================== + + * deps: send@0.6.0 + - Cap `maxAge` value to 1 year + - deps: debug@1.0.3 + +1.3.1 / 2014-07-09 +================== + + * deps: parseurl@~1.1.3 + - faster parsing of href-only URLs + +1.3.0 / 2014-06-28 +================== + + * Add `setHeaders` option + * Include HTML link in redirect response + * deps: send@0.5.0 + - Accept string for `maxAge` (converted by `ms`) + +1.2.3 / 2014-06-11 +================== + + * deps: send@0.4.3 + - Do not throw un-catchable error on file open race condition + - Use `escape-html` for HTML escaping + - deps: debug@1.0.2 + - deps: finished@1.2.2 + - deps: fresh@0.2.2 + +1.2.2 / 2014-06-09 +================== + + * deps: send@0.4.2 + - fix "event emitter leak" warnings + - deps: debug@1.0.1 + - deps: finished@1.2.1 + +1.2.1 / 2014-06-02 +================== + + * use `escape-html` for escaping + * deps: send@0.4.1 + - Send `max-age` in `Cache-Control` in correct format + +1.2.0 / 2014-05-29 +================== + + * deps: send@0.4.0 + - Calculate ETag with md5 for reduced collisions + - Fix wrong behavior when index file matches directory + - Ignore stream errors after request ends + - Skip directories in index file search + - deps: debug@0.8.1 + +1.1.0 / 2014-04-24 +================== + + * Accept options directly to `send` module + * deps: send@0.3.0 + +1.0.4 / 2014-04-07 +================== + + * Resolve relative paths at middleware setup + * Use parseurl to parse the URL from request + +1.0.3 / 2014-03-20 +================== + + * Do not rely on connect-like environments + +1.0.2 / 2014-03-06 +================== + + * deps: send@0.2.0 + +1.0.1 / 2014-03-05 +================== + + * Add mime export for back-compat + +1.0.0 / 2014-03-05 +================== + + * Genesis from `connect` diff --git a/node_modules/serve-static/LICENSE b/node_modules/serve-static/LICENSE new file mode 100644 index 0000000..cbe62e8 --- /dev/null +++ b/node_modules/serve-static/LICENSE @@ -0,0 +1,25 @@ +(The MIT License) + +Copyright (c) 2010 Sencha Inc. +Copyright (c) 2011 LearnBoost +Copyright (c) 2011 TJ Holowaychuk +Copyright (c) 2014-2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/serve-static/README.md b/node_modules/serve-static/README.md new file mode 100644 index 0000000..70f01c3 --- /dev/null +++ b/node_modules/serve-static/README.md @@ -0,0 +1,253 @@ +# serve-static + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![CI][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install serve-static +``` + +## API + +```js +var serveStatic = require('serve-static') +``` + +### serveStatic(root, options) + +Create a new middleware function to serve files from within a given root +directory. The file to serve will be determined by combining `req.url` +with the provided root directory. When a file is not found, instead of +sending a 404 response, this module will instead call `next()` to move on +to the next middleware, allowing for stacking and fall-backs. + +#### Options + +##### acceptRanges + +Enable or disable accepting ranged requests, defaults to true. +Disabling this will not send `Accept-Ranges` and ignore the contents +of the `Range` request header. + +##### cacheControl + +Enable or disable setting `Cache-Control` response header, defaults to +true. Disabling this will ignore the `immutable` and `maxAge` options. + +##### dotfiles + +Set how "dotfiles" are treated when encountered. A dotfile is a file +or directory that begins with a dot ("."). Note this check is done on +the path itself without checking if the path actually exists on the +disk. If `root` is specified, only the dotfiles above the root are +checked (i.e. the root itself can be within a dotfile when set +to "deny"). + + - `'allow'` No special treatment for dotfiles. + - `'deny'` Deny a request for a dotfile and 403/`next()`. + - `'ignore'` Pretend like the dotfile does not exist and 404/`next()`. + +The default value is `'ignore'`. + +##### etag + +Enable or disable etag generation, defaults to true. + +##### extensions + +Set file extension fallbacks. When set, if a file is not found, the given +extensions will be added to the file name and search for. The first that +exists will be served. Example: `['html', 'htm']`. + +The default value is `false`. + +##### fallthrough + +Set the middleware to have client errors fall-through as just unhandled +requests, otherwise forward a client error. The difference is that client +errors like a bad request or a request to a non-existent file will cause +this middleware to simply `next()` to your next middleware when this value +is `true`. When this value is `false`, these errors (even 404s), will invoke +`next(err)`. + +Typically `true` is desired such that multiple physical directories can be +mapped to the same web address or for routes to fill in non-existent files. + +The value `false` can be used if this middleware is mounted at a path that +is designed to be strictly a single file system directory, which allows for +short-circuiting 404s for less overhead. This middleware will also reply to +all methods. + +The default value is `true`. + +##### immutable + +Enable or disable the `immutable` directive in the `Cache-Control` response +header, defaults to `false`. If set to `true`, the `maxAge` option should +also be specified to enable caching. The `immutable` directive will prevent +supported clients from making conditional requests during the life of the +`maxAge` option to check if the file has changed. + +##### index + +By default this module will send "index.html" files in response to a request +on a directory. To disable this set `false` or to supply a new index pass a +string or an array in preferred order. + +##### lastModified + +Enable or disable `Last-Modified` header, defaults to true. Uses the file +system's last modified value. + +##### maxAge + +Provide a max-age in milliseconds for http caching, defaults to 0. This +can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) +module. + +##### redirect + +Redirect to trailing "/" when the pathname is a dir. Defaults to `true`. + +##### setHeaders + +Function to set custom headers on response. Alterations to the headers need to +occur synchronously. The function is called as `fn(res, path, stat)`, where +the arguments are: + + - `res` the response object + - `path` the file path that is being sent + - `stat` the stat object of the file that is being sent + +## Examples + +### Serve files with vanilla node.js http server + +```js +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') + +// Serve up public/ftp folder +var serve = serveStatic('public/ftp', { index: ['index.html', 'index.htm'] }) + +// Create server +var server = http.createServer(function onRequest (req, res) { + serve(req, res, finalhandler(req, res)) +}) + +// Listen +server.listen(3000) +``` + +### Serve all files as downloads + +```js +var contentDisposition = require('content-disposition') +var finalhandler = require('finalhandler') +var http = require('http') +var serveStatic = require('serve-static') + +// Serve up public/ftp folder +var serve = serveStatic('public/ftp', { + index: false, + setHeaders: setHeaders +}) + +// Set header to force download +function setHeaders (res, path) { + res.setHeader('Content-Disposition', contentDisposition(path)) +} + +// Create server +var server = http.createServer(function onRequest (req, res) { + serve(req, res, finalhandler(req, res)) +}) + +// Listen +server.listen(3000) +``` + +### Serving using express + +#### Simple + +This is a simple example of using Express. + +```js +var express = require('express') +var serveStatic = require('serve-static') + +var app = express() + +app.use(serveStatic('public/ftp', { index: ['default.html', 'default.htm'] })) +app.listen(3000) +``` + +#### Multiple roots + +This example shows a simple way to search through multiple directories. +Files are searched for in `public-optimized/` first, then `public/` second +as a fallback. + +```js +var express = require('express') +var path = require('path') +var serveStatic = require('serve-static') + +var app = express() + +app.use(serveStatic(path.join(__dirname, 'public-optimized'))) +app.use(serveStatic(path.join(__dirname, 'public'))) +app.listen(3000) +``` + +#### Different settings for paths + +This example shows how to set a different max age depending on the served +file. In this example, HTML files are not cached, while everything else +is for 1 day. + +```js +var express = require('express') +var path = require('path') +var serveStatic = require('serve-static') + +var app = express() + +app.use(serveStatic(path.join(__dirname, 'public'), { + maxAge: '1d', + setHeaders: setCustomCacheControl +})) + +app.listen(3000) + +function setCustomCacheControl (res, file) { + if (path.extname(file) === '.html') { + // Custom Cache-Control for HTML files + res.setHeader('Cache-Control', 'public, max-age=0') + } +} +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master +[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux +[github-actions-ci-url]: https://github.com/expressjs/serve-static/actions/workflows/ci.yml +[node-image]: https://badgen.net/npm/node/serve-static +[node-url]: https://nodejs.org/en/download/ +[npm-downloads-image]: https://badgen.net/npm/dm/serve-static +[npm-url]: https://npmjs.org/package/serve-static +[npm-version-image]: https://badgen.net/npm/v/serve-static diff --git a/node_modules/serve-static/index.js b/node_modules/serve-static/index.js new file mode 100644 index 0000000..1bee463 --- /dev/null +++ b/node_modules/serve-static/index.js @@ -0,0 +1,208 @@ +/*! + * serve-static + * Copyright(c) 2010 Sencha Inc. + * Copyright(c) 2011 TJ Holowaychuk + * Copyright(c) 2014-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var encodeUrl = require('encodeurl') +var escapeHtml = require('escape-html') +var parseUrl = require('parseurl') +var resolve = require('path').resolve +var send = require('send') +var url = require('url') + +/** + * Module exports. + * @public + */ + +module.exports = serveStatic + +/** + * @param {string} root + * @param {object} [options] + * @return {function} + * @public + */ + +function serveStatic (root, options) { + if (!root) { + throw new TypeError('root path required') + } + + if (typeof root !== 'string') { + throw new TypeError('root path must be a string') + } + + // copy options object + var opts = Object.create(options || null) + + // fall-though + var fallthrough = opts.fallthrough !== false + + // default redirect + var redirect = opts.redirect !== false + + // headers listener + var setHeaders = opts.setHeaders + + if (setHeaders && typeof setHeaders !== 'function') { + throw new TypeError('option setHeaders must be function') + } + + // setup options for send + opts.maxage = opts.maxage || opts.maxAge || 0 + opts.root = resolve(root) + + // construct directory listener + var onDirectory = redirect + ? createRedirectDirectoryListener() + : createNotFoundDirectoryListener() + + return function serveStatic (req, res, next) { + if (req.method !== 'GET' && req.method !== 'HEAD') { + if (fallthrough) { + return next() + } + + // method not allowed + res.statusCode = 405 + res.setHeader('Allow', 'GET, HEAD') + res.setHeader('Content-Length', '0') + res.end() + return + } + + var forwardError = !fallthrough + var originalUrl = parseUrl.original(req) + var path = parseUrl(req).pathname + + // make sure redirect occurs at mount + if (path === '/' && originalUrl.pathname.substr(-1) !== '/') { + path = '' + } + + // create send stream + var stream = send(req, path, opts) + + // add directory handler + stream.on('directory', onDirectory) + + // add headers listener + if (setHeaders) { + stream.on('headers', setHeaders) + } + + // add file listener for fallthrough + if (fallthrough) { + stream.on('file', function onFile () { + // once file is determined, always forward error + forwardError = true + }) + } + + // forward errors + stream.on('error', function error (err) { + if (forwardError || !(err.statusCode < 500)) { + next(err) + return + } + + next() + }) + + // pipe + stream.pipe(res) + } +} + +/** + * Collapse all leading slashes into a single slash + * @private + */ +function collapseLeadingSlashes (str) { + for (var i = 0; i < str.length; i++) { + if (str.charCodeAt(i) !== 0x2f /* / */) { + break + } + } + + return i > 1 + ? '/' + str.substr(i) + : str +} + +/** + * Create a minimal HTML document. + * + * @param {string} title + * @param {string} body + * @private + */ + +function createHtmlDocument (title, body) { + return '\n' + + '\n' + + '\n' + + '\n' + + '' + title + '\n' + + '\n' + + '\n' + + '
' + body + '
\n' + + '\n' + + '\n' +} + +/** + * Create a directory listener that just 404s. + * @private + */ + +function createNotFoundDirectoryListener () { + return function notFound () { + this.error(404) + } +} + +/** + * Create a directory listener that performs a redirect. + * @private + */ + +function createRedirectDirectoryListener () { + return function redirect (res) { + if (this.hasTrailingSlash()) { + this.error(404) + return + } + + // get original URL + var originalUrl = parseUrl.original(this.req) + + // append trailing slash + originalUrl.path = null + originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/') + + // reformat the URL + var loc = encodeUrl(url.format(originalUrl)) + var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc)) + + // send redirect response + res.statusCode = 301 + res.setHeader('Content-Type', 'text/html; charset=UTF-8') + res.setHeader('Content-Length', Buffer.byteLength(doc)) + res.setHeader('Content-Security-Policy', "default-src 'none'") + res.setHeader('X-Content-Type-Options', 'nosniff') + res.setHeader('Location', loc) + res.end(doc) + } +} diff --git a/node_modules/serve-static/package.json b/node_modules/serve-static/package.json new file mode 100644 index 0000000..38d3365 --- /dev/null +++ b/node_modules/serve-static/package.json @@ -0,0 +1,41 @@ +{ + "name": "serve-static", + "description": "Serve static files", + "version": "2.2.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "expressjs/serve-static", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "^10.7.0", + "nyc": "^17.0.0", + "supertest": "^6.3.4" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 18" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/set-blocking/CHANGELOG.md b/node_modules/set-blocking/CHANGELOG.md new file mode 100644 index 0000000..03bf591 --- /dev/null +++ b/node_modules/set-blocking/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17) + + +### Features + +* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277)) + + +### BREAKING CHANGES + +* stdio/stderr will not be set to blocking if isTTY === false + + + + +# 1.0.0 (2016-05-14) + + +### Features + +* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0)) diff --git a/node_modules/set-blocking/LICENSE.txt b/node_modules/set-blocking/LICENSE.txt new file mode 100644 index 0000000..836440b --- /dev/null +++ b/node_modules/set-blocking/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/set-blocking/README.md b/node_modules/set-blocking/README.md new file mode 100644 index 0000000..e93b420 --- /dev/null +++ b/node_modules/set-blocking/README.md @@ -0,0 +1,31 @@ +# set-blocking + +[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) +[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) +[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. + +```js +const setBlocking = require('set-blocking') +setBlocking(true) +console.log(someLargeStringToOutput) +``` + +## Historical Context/Word of Warning + +This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on +newer versions of Node.js (`0.12+`), truncating terminal output. + +You should be mindful of the side-effects caused by using `set-blocking`: + +* if your module sets blocking to `true`, it will effect other modules + consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call + `setBlocking(true)` once we already know we are about to call `process.exit(code)`. +* this patch will not apply to subprocesses spawned with `isTTY = true`, this is + the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). + +## License + +ISC diff --git a/node_modules/set-blocking/index.js b/node_modules/set-blocking/index.js new file mode 100644 index 0000000..6f78774 --- /dev/null +++ b/node_modules/set-blocking/index.js @@ -0,0 +1,7 @@ +module.exports = function (blocking) { + [process.stdout, process.stderr].forEach(function (stream) { + if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(blocking) + } + }) +} diff --git a/node_modules/set-blocking/package.json b/node_modules/set-blocking/package.json new file mode 100644 index 0000000..c082db7 --- /dev/null +++ b/node_modules/set-blocking/package.json @@ -0,0 +1,42 @@ +{ + "name": "set-blocking", + "version": "2.0.0", + "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "nyc mocha ./test/*.js", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "version": "standard-version" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/yargs/set-blocking.git" + }, + "keywords": [ + "flush", + "terminal", + "blocking", + "shim", + "stdio", + "stderr" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/yargs/set-blocking/issues" + }, + "homepage": "https://github.com/yargs/set-blocking#readme", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.9", + "mocha": "^2.4.5", + "nyc": "^6.4.4", + "standard": "^7.0.1", + "standard-version": "^2.2.1" + }, + "files": [ + "index.js", + "LICENSE.txt" + ] +} \ No newline at end of file diff --git a/node_modules/setprototypeof/LICENSE b/node_modules/setprototypeof/LICENSE new file mode 100644 index 0000000..61afa2f --- /dev/null +++ b/node_modules/setprototypeof/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Wes Todd + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/setprototypeof/README.md b/node_modules/setprototypeof/README.md new file mode 100644 index 0000000..791eeff --- /dev/null +++ b/node_modules/setprototypeof/README.md @@ -0,0 +1,31 @@ +# Polyfill for `Object.setPrototypeOf` + +[![NPM Version](https://img.shields.io/npm/v/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) +[![NPM Downloads](https://img.shields.io/npm/dm/setprototypeof.svg)](https://npmjs.org/package/setprototypeof) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) + +A simple cross platform implementation to set the prototype of an instianted object. Supports all modern browsers and at least back to IE8. + +## Usage: + +``` +$ npm install --save setprototypeof +``` + +```javascript +var setPrototypeOf = require('setprototypeof') + +var obj = {} +setPrototypeOf(obj, { + foo: function () { + return 'bar' + } +}) +obj.foo() // bar +``` + +TypeScript is also supported: + +```typescript +import setPrototypeOf from 'setprototypeof' +``` diff --git a/node_modules/setprototypeof/index.d.ts b/node_modules/setprototypeof/index.d.ts new file mode 100644 index 0000000..f108ecd --- /dev/null +++ b/node_modules/setprototypeof/index.d.ts @@ -0,0 +1,2 @@ +declare function setPrototypeOf(o: any, proto: object | null): any; +export = setPrototypeOf; diff --git a/node_modules/setprototypeof/index.js b/node_modules/setprototypeof/index.js new file mode 100644 index 0000000..c527055 --- /dev/null +++ b/node_modules/setprototypeof/index.js @@ -0,0 +1,17 @@ +'use strict' +/* eslint no-proto: 0 */ +module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties) + +function setProtoOf (obj, proto) { + obj.__proto__ = proto + return obj +} + +function mixinProperties (obj, proto) { + for (var prop in proto) { + if (!Object.prototype.hasOwnProperty.call(obj, prop)) { + obj[prop] = proto[prop] + } + } + return obj +} diff --git a/node_modules/setprototypeof/package.json b/node_modules/setprototypeof/package.json new file mode 100644 index 0000000..f20915b --- /dev/null +++ b/node_modules/setprototypeof/package.json @@ -0,0 +1,38 @@ +{ + "name": "setprototypeof", + "version": "1.2.0", + "description": "A small polyfill for Object.setprototypeof", + "main": "index.js", + "typings": "index.d.ts", + "scripts": { + "test": "standard && mocha", + "testallversions": "npm run node010 && npm run node4 && npm run node6 && npm run node9 && npm run node11", + "testversion": "docker run -it --rm -v $(PWD):/usr/src/app -w /usr/src/app node:${NODE_VER} npm install mocha@${MOCHA_VER:-latest} && npm t", + "node010": "NODE_VER=0.10 MOCHA_VER=3 npm run testversion", + "node4": "NODE_VER=4 npm run testversion", + "node6": "NODE_VER=6 npm run testversion", + "node9": "NODE_VER=9 npm run testversion", + "node11": "NODE_VER=11 npm run testversion", + "prepublishOnly": "npm t", + "postpublish": "git push origin && git push origin --tags" + }, + "repository": { + "type": "git", + "url": "https://github.com/wesleytodd/setprototypeof.git" + }, + "keywords": [ + "polyfill", + "object", + "setprototypeof" + ], + "author": "Wes Todd", + "license": "ISC", + "bugs": { + "url": "https://github.com/wesleytodd/setprototypeof/issues" + }, + "homepage": "https://github.com/wesleytodd/setprototypeof", + "devDependencies": { + "mocha": "^6.1.4", + "standard": "^13.0.2" + } +} diff --git a/node_modules/setprototypeof/test/index.js b/node_modules/setprototypeof/test/index.js new file mode 100644 index 0000000..afeb4dd --- /dev/null +++ b/node_modules/setprototypeof/test/index.js @@ -0,0 +1,24 @@ +'use strict' +/* eslint-env mocha */ +/* eslint no-proto: 0 */ +var assert = require('assert') +var setPrototypeOf = require('..') + +describe('setProtoOf(obj, proto)', function () { + it('should merge objects', function () { + var obj = { a: 1, b: 2 } + var proto = { b: 3, c: 4 } + var mergeObj = setPrototypeOf(obj, proto) + + if (Object.getPrototypeOf) { + assert.strictEqual(Object.getPrototypeOf(obj), proto) + } else if ({ __proto__: [] } instanceof Array) { + assert.strictEqual(obj.__proto__, proto) + } else { + assert.strictEqual(obj.a, 1) + assert.strictEqual(obj.b, 2) + assert.strictEqual(obj.c, 4) + } + assert.strictEqual(mergeObj, obj) + }) +}) diff --git a/node_modules/sharp/LICENSE b/node_modules/sharp/LICENSE new file mode 100644 index 0000000..37ec93a --- /dev/null +++ b/node_modules/sharp/LICENSE @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/sharp/README.md b/node_modules/sharp/README.md new file mode 100644 index 0000000..47da52e --- /dev/null +++ b/node_modules/sharp/README.md @@ -0,0 +1,118 @@ +# sharp + +sharp logo + +The typical use case for this high speed Node-API module +is to convert large images in common formats to +smaller, web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions. + +It can be used with all JavaScript runtimes +that provide support for Node-API v9, including +Node.js (^18.17.0 or >= 20.3.0), Deno and Bun. + +Resizing an image is typically 4x-5x faster than using the +quickest ImageMagick and GraphicsMagick settings +due to its use of [libvips](https://github.com/libvips/libvips). + +Colour spaces, embedded ICC profiles and alpha transparency channels are all handled correctly. +Lanczos resampling ensures quality is not sacrificed for speed. + +As well as image resizing, operations such as +rotation, extraction, compositing and gamma correction are available. + +Most modern macOS, Windows and Linux systems +do not require any additional install or runtime dependencies. + +## Documentation + +Visit [sharp.pixelplumbing.com](https://sharp.pixelplumbing.com/) for complete +[installation instructions](https://sharp.pixelplumbing.com/install), +[API documentation](https://sharp.pixelplumbing.com/api-constructor), +[benchmark tests](https://sharp.pixelplumbing.com/performance) and +[changelog](https://sharp.pixelplumbing.com/changelog). + +## Examples + +```sh +npm install sharp +``` + +```javascript +const sharp = require('sharp'); +``` + +### Callback + +```javascript +sharp(inputBuffer) + .resize(320, 240) + .toFile('output.webp', (err, info) => { ... }); +``` + +### Promise + +```javascript +sharp('input.jpg') + .rotate() + .resize(200) + .jpeg({ mozjpeg: true }) + .toBuffer() + .then( data => { ... }) + .catch( err => { ... }); +``` + +### Async/await + +```javascript +const semiTransparentRedPng = await sharp({ + create: { + width: 48, + height: 48, + channels: 4, + background: { r: 255, g: 0, b: 0, alpha: 0.5 } + } +}) + .png() + .toBuffer(); +``` + +### Stream + +```javascript +const roundedCorners = Buffer.from( + '' +); + +const roundedCornerResizer = + sharp() + .resize(200, 200) + .composite([{ + input: roundedCorners, + blend: 'dest-in' + }]) + .png(); + +readableStream + .pipe(roundedCornerResizer) + .pipe(writableStream); +``` + +## Contributing + +A [guide for contributors](https://github.com/lovell/sharp/blob/main/.github/CONTRIBUTING.md) +covers reporting bugs, requesting features and submitting code changes. + +## Licensing + +Copyright 2013 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/sharp/install/build.js b/node_modules/sharp/install/build.js new file mode 100644 index 0000000..2ca2245 --- /dev/null +++ b/node_modules/sharp/install/build.js @@ -0,0 +1,38 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const { + useGlobalLibvips, + globalLibvipsVersion, + log, + spawnRebuild, +} = require('../lib/libvips'); + +log('Attempting to build from source via node-gyp'); +log('See https://sharp.pixelplumbing.com/install#building-from-source'); + +try { + const addonApi = require('node-addon-api'); + log(`Found node-addon-api ${addonApi.version || ''}`); +} catch (_err) { + log('Please add node-addon-api to your dependencies'); + process.exit(1); +} +try { + const gyp = require('node-gyp'); + log(`Found node-gyp ${gyp().version}`); +} catch (_err) { + log('Please add node-gyp to your dependencies'); + process.exit(1); +} + +if (useGlobalLibvips(log)) { + log(`Detected globally-installed libvips v${globalLibvipsVersion()}`); +} + +const status = spawnRebuild(); +if (status !== 0) { + process.exit(status); +} diff --git a/node_modules/sharp/install/check.js b/node_modules/sharp/install/check.js new file mode 100644 index 0000000..1cfb7d3 --- /dev/null +++ b/node_modules/sharp/install/check.js @@ -0,0 +1,14 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +try { + const { useGlobalLibvips } = require('../lib/libvips'); + if (useGlobalLibvips() || process.env.npm_config_build_from_source) { + process.exit(1); + } +} catch (err) { + const summary = err.message.split(/\n/).slice(0, 1); + console.log(`sharp: skipping install check: ${summary}`); +} diff --git a/node_modules/sharp/lib/channel.js b/node_modules/sharp/lib/channel.js new file mode 100644 index 0000000..3c6c0b4 --- /dev/null +++ b/node_modules/sharp/lib/channel.js @@ -0,0 +1,177 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const is = require('./is'); + +/** + * Boolean operations for bandbool. + * @private + */ +const bool = { + and: 'and', + or: 'or', + eor: 'eor' +}; + +/** + * Remove alpha channels, if any. This is a no-op if the image does not have an alpha channel. + * + * See also {@link /api-operation/#flatten flatten}. + * + * @example + * sharp('rgba.png') + * .removeAlpha() + * .toFile('rgb.png', function(err, info) { + * // rgb.png is a 3 channel image without an alpha channel + * }); + * + * @returns {Sharp} + */ +function removeAlpha () { + this.options.removeAlpha = true; + return this; +} + +/** + * Ensure the output image has an alpha transparency channel. + * If missing, the added alpha channel will have the specified + * transparency level, defaulting to fully-opaque (1). + * This is a no-op if the image already has an alpha channel. + * + * @since 0.21.2 + * + * @example + * // rgba.png will be a 4 channel image with a fully-opaque alpha channel + * await sharp('rgb.jpg') + * .ensureAlpha() + * .toFile('rgba.png') + * + * @example + * // rgba is a 4 channel image with a fully-transparent alpha channel + * const rgba = await sharp(rgb) + * .ensureAlpha(0) + * .toBuffer(); + * + * @param {number} [alpha=1] - alpha transparency level (0=fully-transparent, 1=fully-opaque) + * @returns {Sharp} + * @throws {Error} Invalid alpha transparency level + */ +function ensureAlpha (alpha) { + if (is.defined(alpha)) { + if (is.number(alpha) && is.inRange(alpha, 0, 1)) { + this.options.ensureAlpha = alpha; + } else { + throw is.invalidParameterError('alpha', 'number between 0 and 1', alpha); + } + } else { + this.options.ensureAlpha = 1; + } + return this; +} + +/** + * Extract a single channel from a multi-channel image. + * + * The output colourspace will be either `b-w` (8-bit) or `grey16` (16-bit). + * + * @example + * // green.jpg is a greyscale image containing the green channel of the input + * await sharp(input) + * .extractChannel('green') + * .toFile('green.jpg'); + * + * @example + * // red1 is the red value of the first pixel, red2 the second pixel etc. + * const [red1, red2, ...] = await sharp(input) + * .extractChannel(0) + * .raw() + * .toBuffer(); + * + * @param {number|string} channel - zero-indexed channel/band number to extract, or `red`, `green`, `blue` or `alpha`. + * @returns {Sharp} + * @throws {Error} Invalid channel + */ +function extractChannel (channel) { + const channelMap = { red: 0, green: 1, blue: 2, alpha: 3 }; + if (Object.keys(channelMap).includes(channel)) { + channel = channelMap[channel]; + } + if (is.integer(channel) && is.inRange(channel, 0, 4)) { + this.options.extractChannel = channel; + } else { + throw is.invalidParameterError('channel', 'integer or one of: red, green, blue, alpha', channel); + } + return this; +} + +/** + * Join one or more channels to the image. + * The meaning of the added channels depends on the output colourspace, set with `toColourspace()`. + * By default the output image will be web-friendly sRGB, with additional channels interpreted as alpha channels. + * Channel ordering follows vips convention: + * - sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha. + * - CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha. + * + * Buffers may be any of the image formats supported by sharp. + * For raw pixel input, the `options` object should contain a `raw` attribute, which follows the format of the attribute of the same name in the `sharp()` constructor. + * + * @param {Array|string|Buffer} images - one or more images (file paths, Buffers). + * @param {Object} options - image options, see `sharp()` constructor. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function joinChannel (images, options) { + if (Array.isArray(images)) { + images.forEach(function (image) { + this.options.joinChannelIn.push(this._createInputDescriptor(image, options)); + }, this); + } else { + this.options.joinChannelIn.push(this._createInputDescriptor(images, options)); + } + return this; +} + +/** + * Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image. + * + * @example + * sharp('3-channel-rgb-input.png') + * .bandbool(sharp.bool.and) + * .toFile('1-channel-output.png', function (err, info) { + * // The output will be a single channel image where each pixel `P = R & G & B`. + * // If `I(1,1) = [247, 170, 14] = [0b11110111, 0b10101010, 0b00001111]` + * // then `O(1,1) = 0b11110111 & 0b10101010 & 0b00001111 = 0b00000010 = 2`. + * }); + * + * @param {string} boolOp - one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function bandbool (boolOp) { + if (is.string(boolOp) && is.inArray(boolOp, ['and', 'or', 'eor'])) { + this.options.bandBoolOp = boolOp; + } else { + throw is.invalidParameterError('boolOp', 'one of: and, or, eor', boolOp); + } + return this; +} + +/** + * Decorate the Sharp prototype with channel-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Object.assign(Sharp.prototype, { + // Public instance functions + removeAlpha, + ensureAlpha, + extractChannel, + joinChannel, + bandbool + }); + // Class attributes + Sharp.bool = bool; +}; diff --git a/node_modules/sharp/lib/colour.js b/node_modules/sharp/lib/colour.js new file mode 100644 index 0000000..e61c248 --- /dev/null +++ b/node_modules/sharp/lib/colour.js @@ -0,0 +1,195 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const color = require('@img/colour'); +const is = require('./is'); + +/** + * Colourspaces. + * @private + */ +const colourspace = { + multiband: 'multiband', + 'b-w': 'b-w', + bw: 'b-w', + cmyk: 'cmyk', + srgb: 'srgb' +}; + +/** + * Tint the image using the provided colour. + * An alpha channel may be present and will be unchanged by the operation. + * + * @example + * const output = await sharp(input) + * .tint({ r: 255, g: 240, b: 16 }) + * .toBuffer(); + * + * @param {string|Object} tint - Parsed by the [color](https://www.npmjs.org/package/color) module. + * @returns {Sharp} + * @throws {Error} Invalid parameter + */ +function tint (tint) { + this._setBackgroundColourOption('tint', tint); + return this; +} + +/** + * Convert to 8-bit greyscale; 256 shades of grey. + * This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use `gamma()` with `greyscale()` for the best results. + * By default the output image will be web-friendly sRGB and contain three (identical) colour channels. + * This may be overridden by other sharp operations such as `toColourspace('b-w')`, + * which will produce an output image containing one colour channel. + * An alpha channel may be present, and will be unchanged by the operation. + * + * @example + * const output = await sharp(input).greyscale().toBuffer(); + * + * @param {Boolean} [greyscale=true] + * @returns {Sharp} + */ +function greyscale (greyscale) { + this.options.greyscale = is.bool(greyscale) ? greyscale : true; + return this; +} + +/** + * Alternative spelling of `greyscale`. + * @param {Boolean} [grayscale=true] + * @returns {Sharp} + */ +function grayscale (grayscale) { + return this.greyscale(grayscale); +} + +/** + * Set the pipeline colourspace. + * + * The input image will be converted to the provided colourspace at the start of the pipeline. + * All operations will use this colourspace before converting to the output colourspace, + * as defined by {@link #tocolourspace toColourspace}. + * + * @since 0.29.0 + * + * @example + * // Run pipeline in 16 bits per channel RGB while converting final result to 8 bits per channel sRGB. + * await sharp(input) + * .pipelineColourspace('rgb16') + * .toColourspace('srgb') + * .toFile('16bpc-pipeline-to-8bpc-output.png') + * + * @param {string} [colourspace] - pipeline colourspace e.g. `rgb16`, `scrgb`, `lab`, `grey16` [...](https://www.libvips.org/API/current/enum.Interpretation.html) + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function pipelineColourspace (colourspace) { + if (!is.string(colourspace)) { + throw is.invalidParameterError('colourspace', 'string', colourspace); + } + this.options.colourspacePipeline = colourspace; + return this; +} + +/** + * Alternative spelling of `pipelineColourspace`. + * @param {string} [colorspace] - pipeline colorspace. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function pipelineColorspace (colorspace) { + return this.pipelineColourspace(colorspace); +} + +/** + * Set the output colourspace. + * By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels. + * + * @example + * // Output 16 bits per pixel RGB + * await sharp(input) + * .toColourspace('rgb16') + * .toFile('16-bpp.png') + * + * @param {string} [colourspace] - output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html) + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function toColourspace (colourspace) { + if (!is.string(colourspace)) { + throw is.invalidParameterError('colourspace', 'string', colourspace); + } + this.options.colourspace = colourspace; + return this; +} + +/** + * Alternative spelling of `toColourspace`. + * @param {string} [colorspace] - output colorspace. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function toColorspace (colorspace) { + return this.toColourspace(colorspace); +} + +/** + * Create a RGBA colour array from a given value. + * @private + * @param {string|Object} value + * @throws {Error} Invalid value + */ +function _getBackgroundColourOption (value) { + if ( + is.object(value) || + (is.string(value) && value.length >= 3 && value.length <= 200) + ) { + const colour = color(value); + return [ + colour.red(), + colour.green(), + colour.blue(), + Math.round(colour.alpha() * 255) + ]; + } else { + throw is.invalidParameterError('background', 'object or string', value); + } +} + +/** + * Update a colour attribute of the this.options Object. + * @private + * @param {string} key + * @param {string|Object} value + * @throws {Error} Invalid value + */ +function _setBackgroundColourOption (key, value) { + if (is.defined(value)) { + this.options[key] = _getBackgroundColourOption(value); + } +} + +/** + * Decorate the Sharp prototype with colour-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Object.assign(Sharp.prototype, { + // Public + tint, + greyscale, + grayscale, + pipelineColourspace, + pipelineColorspace, + toColourspace, + toColorspace, + // Private + _getBackgroundColourOption, + _setBackgroundColourOption + }); + // Class attributes + Sharp.colourspace = colourspace; + Sharp.colorspace = colourspace; +}; diff --git a/node_modules/sharp/lib/composite.js b/node_modules/sharp/lib/composite.js new file mode 100644 index 0000000..1c3e5e6 --- /dev/null +++ b/node_modules/sharp/lib/composite.js @@ -0,0 +1,212 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const is = require('./is'); + +/** + * Blend modes. + * @member + * @private + */ +const blend = { + clear: 'clear', + source: 'source', + over: 'over', + in: 'in', + out: 'out', + atop: 'atop', + dest: 'dest', + 'dest-over': 'dest-over', + 'dest-in': 'dest-in', + 'dest-out': 'dest-out', + 'dest-atop': 'dest-atop', + xor: 'xor', + add: 'add', + saturate: 'saturate', + multiply: 'multiply', + screen: 'screen', + overlay: 'overlay', + darken: 'darken', + lighten: 'lighten', + 'colour-dodge': 'colour-dodge', + 'color-dodge': 'colour-dodge', + 'colour-burn': 'colour-burn', + 'color-burn': 'colour-burn', + 'hard-light': 'hard-light', + 'soft-light': 'soft-light', + difference: 'difference', + exclusion: 'exclusion' +}; + +/** + * Composite image(s) over the processed (resized, extracted etc.) image. + * + * The images to composite must be the same size or smaller than the processed image. + * If both `top` and `left` options are provided, they take precedence over `gravity`. + * + * Other operations in the same processing pipeline (e.g. resize, rotate, flip, + * flop, extract) will always be applied to the input image before composition. + * + * The `blend` option can be one of `clear`, `source`, `over`, `in`, `out`, `atop`, + * `dest`, `dest-over`, `dest-in`, `dest-out`, `dest-atop`, + * `xor`, `add`, `saturate`, `multiply`, `screen`, `overlay`, `darken`, `lighten`, + * `colour-dodge`, `color-dodge`, `colour-burn`,`color-burn`, + * `hard-light`, `soft-light`, `difference`, `exclusion`. + * + * More information about blend modes can be found at + * https://www.libvips.org/API/current/enum.BlendMode.html + * and https://www.cairographics.org/operators/ + * + * @since 0.22.0 + * + * @example + * await sharp(background) + * .composite([ + * { input: layer1, gravity: 'northwest' }, + * { input: layer2, gravity: 'southeast' }, + * ]) + * .toFile('combined.png'); + * + * @example + * const output = await sharp('input.gif', { animated: true }) + * .composite([ + * { input: 'overlay.png', tile: true, blend: 'saturate' } + * ]) + * .toBuffer(); + * + * @example + * sharp('input.png') + * .rotate(180) + * .resize(300) + * .flatten( { background: '#ff6600' } ) + * .composite([{ input: 'overlay.png', gravity: 'southeast' }]) + * .sharpen() + * .withMetadata() + * .webp( { quality: 90 } ) + * .toBuffer() + * .then(function(outputBuffer) { + * // outputBuffer contains upside down, 300px wide, alpha channel flattened + * // onto orange background, composited with overlay.png with SE gravity, + * // sharpened, with metadata, 90% quality WebP image data. Phew! + * }); + * + * @param {Object[]} images - Ordered list of images to composite + * @param {Buffer|String} [images[].input] - Buffer containing image data, String containing the path to an image file, or Create object (see below) + * @param {Object} [images[].input.create] - describes a blank overlay to be created. + * @param {Number} [images[].input.create.width] + * @param {Number} [images[].input.create.height] + * @param {Number} [images[].input.create.channels] - 3-4 + * @param {String|Object} [images[].input.create.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. + * @param {Object} [images[].input.text] - describes a new text image to be created. + * @param {string} [images[].input.text.text] - text to render as a UTF-8 string. It can contain Pango markup, for example `LeMonde`. + * @param {string} [images[].input.text.font] - font name to render with. + * @param {string} [images[].input.text.fontfile] - absolute filesystem path to a font file that can be used by `font`. + * @param {number} [images[].input.text.width=0] - integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. + * @param {number} [images[].input.text.height=0] - integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. + * @param {string} [images[].input.text.align='left'] - text alignment (`'left'`, `'centre'`, `'center'`, `'right'`). + * @param {boolean} [images[].input.text.justify=false] - set this to true to apply justification to the text. + * @param {number} [images[].input.text.dpi=72] - the resolution (size) at which to render the text. Does not take effect if `height` is specified. + * @param {boolean} [images[].input.text.rgba=false] - set this to true to enable RGBA output. This is useful for colour emoji rendering, or support for Pango markup features like `Red!`. + * @param {number} [images[].input.text.spacing=0] - text line height in points. Will use the font line height if none is specified. + * @param {Boolean} [images[].autoOrient=false] - set to true to use EXIF orientation data, if present, to orient the image. + * @param {String} [images[].blend='over'] - how to blend this image with the image below. + * @param {String} [images[].gravity='centre'] - gravity at which to place the overlay. + * @param {Number} [images[].top] - the pixel offset from the top edge. + * @param {Number} [images[].left] - the pixel offset from the left edge. + * @param {Boolean} [images[].tile=false] - set to true to repeat the overlay image across the entire image with the given `gravity`. + * @param {Boolean} [images[].premultiplied=false] - set to true to avoid premultiplying the image below. Equivalent to the `--premultiplied` vips option. + * @param {Number} [images[].density=72] - number representing the DPI for vector overlay image. + * @param {Object} [images[].raw] - describes overlay when using raw pixel data. + * @param {Number} [images[].raw.width] + * @param {Number} [images[].raw.height] + * @param {Number} [images[].raw.channels] + * @param {boolean} [images[].animated=false] - Set to `true` to read all frames/pages of an animated image. + * @param {string} [images[].failOn='warning'] - @see {@link /api-constructor/ constructor parameters} + * @param {number|boolean} [images[].limitInputPixels=268402689] - @see {@link /api-constructor/ constructor parameters} + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function composite (images) { + if (!Array.isArray(images)) { + throw is.invalidParameterError('images to composite', 'array', images); + } + this.options.composite = images.map(image => { + if (!is.object(image)) { + throw is.invalidParameterError('image to composite', 'object', image); + } + const inputOptions = this._inputOptionsFromObject(image); + const composite = { + input: this._createInputDescriptor(image.input, inputOptions, { allowStream: false }), + blend: 'over', + tile: false, + left: 0, + top: 0, + hasOffset: false, + gravity: 0, + premultiplied: false + }; + if (is.defined(image.blend)) { + if (is.string(blend[image.blend])) { + composite.blend = blend[image.blend]; + } else { + throw is.invalidParameterError('blend', 'valid blend name', image.blend); + } + } + if (is.defined(image.tile)) { + if (is.bool(image.tile)) { + composite.tile = image.tile; + } else { + throw is.invalidParameterError('tile', 'boolean', image.tile); + } + } + if (is.defined(image.left)) { + if (is.integer(image.left)) { + composite.left = image.left; + } else { + throw is.invalidParameterError('left', 'integer', image.left); + } + } + if (is.defined(image.top)) { + if (is.integer(image.top)) { + composite.top = image.top; + } else { + throw is.invalidParameterError('top', 'integer', image.top); + } + } + if (is.defined(image.top) !== is.defined(image.left)) { + throw new Error('Expected both left and top to be set'); + } else { + composite.hasOffset = is.integer(image.top) && is.integer(image.left); + } + if (is.defined(image.gravity)) { + if (is.integer(image.gravity) && is.inRange(image.gravity, 0, 8)) { + composite.gravity = image.gravity; + } else if (is.string(image.gravity) && is.integer(this.constructor.gravity[image.gravity])) { + composite.gravity = this.constructor.gravity[image.gravity]; + } else { + throw is.invalidParameterError('gravity', 'valid gravity', image.gravity); + } + } + if (is.defined(image.premultiplied)) { + if (is.bool(image.premultiplied)) { + composite.premultiplied = image.premultiplied; + } else { + throw is.invalidParameterError('premultiplied', 'boolean', image.premultiplied); + } + } + return composite; + }); + return this; +} + +/** + * Decorate the Sharp prototype with composite-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Sharp.prototype.composite = composite; + Sharp.blend = blend; +}; diff --git a/node_modules/sharp/lib/constructor.js b/node_modules/sharp/lib/constructor.js new file mode 100644 index 0000000..9aac810 --- /dev/null +++ b/node_modules/sharp/lib/constructor.js @@ -0,0 +1,499 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const util = require('node:util'); +const stream = require('node:stream'); +const is = require('./is'); + +require('./sharp'); + +// Use NODE_DEBUG=sharp to enable libvips warnings +const debuglog = util.debuglog('sharp'); + +const queueListener = (queueLength) => { + Sharp.queue.emit('change', queueLength); +}; + +/** + * Constructor factory to create an instance of `sharp`, to which further methods are chained. + * + * JPEG, PNG, WebP, GIF, AVIF or TIFF format image data can be streamed out from this object. + * When using Stream based output, derived attributes are available from the `info` event. + * + * Non-critical problems encountered during processing are emitted as `warning` events. + * + * Implements the [stream.Duplex](http://nodejs.org/api/stream.html#stream_class_stream_duplex) class. + * + * When loading more than one page/frame of an animated image, + * these are combined as a vertically-stacked "toilet roll" image + * where the overall height is the `pageHeight` multiplied by the number of `pages`. + * + * @constructs Sharp + * + * @emits Sharp#info + * @emits Sharp#warning + * + * @example + * sharp('input.jpg') + * .resize(300, 200) + * .toFile('output.jpg', function(err) { + * // output.jpg is a 300 pixels wide and 200 pixels high image + * // containing a scaled and cropped version of input.jpg + * }); + * + * @example + * // Read image data from remote URL, + * // resize to 300 pixels wide, + * // emit an 'info' event with calculated dimensions + * // and finally write image data to writableStream + * const { body } = fetch('https://...'); + * const readableStream = Readable.fromWeb(body); + * const transformer = sharp() + * .resize(300) + * .on('info', ({ height }) => { + * console.log(`Image height is ${height}`); + * }); + * readableStream.pipe(transformer).pipe(writableStream); + * + * @example + * // Create a blank 300x200 PNG image of semi-translucent red pixels + * sharp({ + * create: { + * width: 300, + * height: 200, + * channels: 4, + * background: { r: 255, g: 0, b: 0, alpha: 0.5 } + * } + * }) + * .png() + * .toBuffer() + * .then( ... ); + * + * @example + * // Convert an animated GIF to an animated WebP + * await sharp('in.gif', { animated: true }).toFile('out.webp'); + * + * @example + * // Read a raw array of pixels and save it to a png + * const input = Uint8Array.from([255, 255, 255, 0, 0, 0]); // or Uint8ClampedArray + * const image = sharp(input, { + * // because the input does not contain its dimensions or how many channels it has + * // we need to specify it in the constructor options + * raw: { + * width: 2, + * height: 1, + * channels: 3 + * } + * }); + * await image.toFile('my-two-pixels.png'); + * + * @example + * // Generate RGB Gaussian noise + * await sharp({ + * create: { + * width: 300, + * height: 200, + * channels: 3, + * noise: { + * type: 'gaussian', + * mean: 128, + * sigma: 30 + * } + * } + * }).toFile('noise.png'); + * + * @example + * // Generate an image from text + * await sharp({ + * text: { + * text: 'Hello, world!', + * width: 400, // max width + * height: 300 // max height + * } + * }).toFile('text_bw.png'); + * + * @example + * // Generate an rgba image from text using pango markup and font + * await sharp({ + * text: { + * text: 'Red!blue', + * font: 'sans', + * rgba: true, + * dpi: 300 + * } + * }).toFile('text_rgba.png'); + * + * @example + * // Join four input images as a 2x2 grid with a 4 pixel gutter + * const data = await sharp( + * [image1, image2, image3, image4], + * { join: { across: 2, shim: 4 } } + * ).toBuffer(); + * + * @example + * // Generate a two-frame animated image from emoji + * const images = ['😀', '😛'].map(text => ({ + * text: { text, width: 64, height: 64, channels: 4, rgba: true } + * })); + * await sharp(images, { join: { animated: true } }).toFile('out.gif'); + * + * @param {(Buffer|ArrayBuffer|Uint8Array|Uint8ClampedArray|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array|Float64Array|string|Array)} [input] - if present, can be + * a Buffer / ArrayBuffer / Uint8Array / Uint8ClampedArray containing JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image data, or + * a TypedArray containing raw pixel image data, or + * a String containing the filesystem path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file. + * An array of inputs can be provided, and these will be joined together. + * JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present. + * @param {Object} [options] - if present, is an Object with optional attributes. + * @param {string} [options.failOn='warning'] - When to abort processing of invalid pixel data, one of (in order of sensitivity, least to most): 'none', 'truncated', 'error', 'warning'. Higher levels imply lower levels. Invalid metadata will always abort. + * @param {number|boolean} [options.limitInputPixels=268402689] - Do not process input images where the number of pixels + * (width x height) exceeds this limit. Assumes image dimensions contained in the input metadata can be trusted. + * An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF). + * @param {boolean} [options.unlimited=false] - Set this to `true` to remove safety features that help prevent memory exhaustion (JPEG, PNG, SVG, HEIF). + * @param {boolean} [options.autoOrient=false] - Set this to `true` to rotate/flip the image to match EXIF `Orientation`, if any. + * @param {boolean} [options.sequentialRead=true] - Set this to `false` to use random access rather than sequential read. Some operations will do this automatically. + * @param {number} [options.density=72] - number representing the DPI for vector images in the range 1 to 100000. + * @param {number} [options.ignoreIcc=false] - should the embedded ICC profile, if any, be ignored. + * @param {number} [options.pages=1] - Number of pages to extract for multi-page input (GIF, WebP, TIFF), use -1 for all pages. + * @param {number} [options.page=0] - Page number to start extracting from for multi-page input (GIF, WebP, TIFF), zero based. + * @param {boolean} [options.animated=false] - Set to `true` to read all frames/pages of an animated image (GIF, WebP, TIFF), equivalent of setting `pages` to `-1`. + * @param {Object} [options.raw] - describes raw pixel input image data. See `raw()` for pixel ordering. + * @param {number} [options.raw.width] - integral number of pixels wide. + * @param {number} [options.raw.height] - integral number of pixels high. + * @param {number} [options.raw.channels] - integral number of channels, between 1 and 4. + * @param {boolean} [options.raw.premultiplied] - specifies that the raw input has already been premultiplied, set to `true` + * to avoid sharp premultiplying the image. (optional, default `false`) + * @param {number} [options.raw.pageHeight] - The pixel height of each page/frame for animated images, must be an integral factor of `raw.height`. + * @param {Object} [options.create] - describes a new image to be created. + * @param {number} [options.create.width] - integral number of pixels wide. + * @param {number} [options.create.height] - integral number of pixels high. + * @param {number} [options.create.channels] - integral number of channels, either 3 (RGB) or 4 (RGBA). + * @param {string|Object} [options.create.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. + * @param {number} [options.create.pageHeight] - The pixel height of each page/frame for animated images, must be an integral factor of `create.height`. + * @param {Object} [options.create.noise] - describes a noise to be created. + * @param {string} [options.create.noise.type] - type of generated noise, currently only `gaussian` is supported. + * @param {number} [options.create.noise.mean=128] - Mean value of pixels in the generated noise. + * @param {number} [options.create.noise.sigma=30] - Standard deviation of pixel values in the generated noise. + * @param {Object} [options.text] - describes a new text image to be created. + * @param {string} [options.text.text] - text to render as a UTF-8 string. It can contain Pango markup, for example `LeMonde`. + * @param {string} [options.text.font] - font name to render with. + * @param {string} [options.text.fontfile] - absolute filesystem path to a font file that can be used by `font`. + * @param {number} [options.text.width=0] - Integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. + * @param {number} [options.text.height=0] - Maximum integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. + * @param {string} [options.text.align='left'] - Alignment style for multi-line text (`'left'`, `'centre'`, `'center'`, `'right'`). + * @param {boolean} [options.text.justify=false] - set this to true to apply justification to the text. + * @param {number} [options.text.dpi=72] - the resolution (size) at which to render the text. Does not take effect if `height` is specified. + * @param {boolean} [options.text.rgba=false] - set this to true to enable RGBA output. This is useful for colour emoji rendering, or support for pango markup features like `Red!`. + * @param {number} [options.text.spacing=0] - text line height in points. Will use the font line height if none is specified. + * @param {string} [options.text.wrap='word'] - word wrapping style when width is provided, one of: 'word', 'char', 'word-char' (prefer word, fallback to char) or 'none'. + * @param {Object} [options.join] - describes how an array of input images should be joined. + * @param {number} [options.join.across=1] - number of images to join horizontally. + * @param {boolean} [options.join.animated=false] - set this to `true` to join the images as an animated image. + * @param {number} [options.join.shim=0] - number of pixels to insert between joined images. + * @param {string|Object} [options.join.background] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. + * @param {string} [options.join.halign='left'] - horizontal alignment style for images joined horizontally (`'left'`, `'centre'`, `'center'`, `'right'`). + * @param {string} [options.join.valign='top'] - vertical alignment style for images joined vertically (`'top'`, `'centre'`, `'center'`, `'bottom'`). + * @param {Object} [options.tiff] - Describes TIFF specific options. + * @param {number} [options.tiff.subifd=-1] - Sub Image File Directory to extract for OME-TIFF, defaults to main image. + * @param {Object} [options.svg] - Describes SVG specific options. + * @param {string} [options.svg.stylesheet] - Custom CSS for SVG input, applied with a User Origin during the CSS cascade. + * @param {boolean} [options.svg.highBitdepth=false] - Set to `true` to render SVG input at 32-bits per channel (128-bit) instead of 8-bits per channel (32-bit) RGBA. + * @param {Object} [options.pdf] - Describes PDF specific options. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. + * @param {string|Object} [options.pdf.background] - Background colour to use when PDF is partially transparent. Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. + * @param {Object} [options.openSlide] - Describes OpenSlide specific options. Requires the use of a globally-installed libvips compiled with support for OpenSlide. + * @param {number} [options.openSlide.level=0] - Level to extract from a multi-level input, zero based. + * @param {Object} [options.jp2] - Describes JPEG 2000 specific options. Requires the use of a globally-installed libvips compiled with support for OpenJPEG. + * @param {boolean} [options.jp2.oneshot=false] - Set to `true` to decode tiled JPEG 2000 images in a single operation, improving compatibility. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +const Sharp = function (input, options) { + // biome-ignore lint/complexity/noArguments: constructor factory + if (arguments.length === 1 && !is.defined(input)) { + throw new Error('Invalid input'); + } + if (!(this instanceof Sharp)) { + return new Sharp(input, options); + } + stream.Duplex.call(this); + this.options = { + // resize options + topOffsetPre: -1, + leftOffsetPre: -1, + widthPre: -1, + heightPre: -1, + topOffsetPost: -1, + leftOffsetPost: -1, + widthPost: -1, + heightPost: -1, + width: -1, + height: -1, + canvas: 'crop', + position: 0, + resizeBackground: [0, 0, 0, 255], + angle: 0, + rotationAngle: 0, + rotationBackground: [0, 0, 0, 255], + rotateBefore: false, + orientBefore: false, + flip: false, + flop: false, + extendTop: 0, + extendBottom: 0, + extendLeft: 0, + extendRight: 0, + extendBackground: [0, 0, 0, 255], + extendWith: 'background', + withoutEnlargement: false, + withoutReduction: false, + affineMatrix: [], + affineBackground: [0, 0, 0, 255], + affineIdx: 0, + affineIdy: 0, + affineOdx: 0, + affineOdy: 0, + affineInterpolator: this.constructor.interpolators.bilinear, + kernel: 'lanczos3', + fastShrinkOnLoad: true, + // operations + tint: [-1, 0, 0, 0], + flatten: false, + flattenBackground: [0, 0, 0], + unflatten: false, + negate: false, + negateAlpha: true, + medianSize: 0, + blurSigma: 0, + precision: 'integer', + minAmpl: 0.2, + sharpenSigma: 0, + sharpenM1: 1, + sharpenM2: 2, + sharpenX1: 2, + sharpenY2: 10, + sharpenY3: 20, + threshold: 0, + thresholdGrayscale: true, + trimBackground: [], + trimThreshold: -1, + trimLineArt: false, + dilateWidth: 0, + erodeWidth: 0, + gamma: 0, + gammaOut: 0, + greyscale: false, + normalise: false, + normaliseLower: 1, + normaliseUpper: 99, + claheWidth: 0, + claheHeight: 0, + claheMaxSlope: 3, + brightness: 1, + saturation: 1, + hue: 0, + lightness: 0, + booleanBufferIn: null, + booleanFileIn: '', + joinChannelIn: [], + extractChannel: -1, + removeAlpha: false, + ensureAlpha: -1, + colourspace: 'srgb', + colourspacePipeline: 'last', + composite: [], + // output + fileOut: '', + formatOut: 'input', + streamOut: false, + keepMetadata: 0, + withMetadataOrientation: -1, + withMetadataDensity: 0, + withIccProfile: '', + withExif: {}, + withExifMerge: true, + withXmp: '', + resolveWithObject: false, + loop: -1, + delay: [], + // output format + jpegQuality: 80, + jpegProgressive: false, + jpegChromaSubsampling: '4:2:0', + jpegTrellisQuantisation: false, + jpegOvershootDeringing: false, + jpegOptimiseScans: false, + jpegOptimiseCoding: true, + jpegQuantisationTable: 0, + pngProgressive: false, + pngCompressionLevel: 6, + pngAdaptiveFiltering: false, + pngPalette: false, + pngQuality: 100, + pngEffort: 7, + pngBitdepth: 8, + pngDither: 1, + jp2Quality: 80, + jp2TileHeight: 512, + jp2TileWidth: 512, + jp2Lossless: false, + jp2ChromaSubsampling: '4:4:4', + webpQuality: 80, + webpAlphaQuality: 100, + webpLossless: false, + webpNearLossless: false, + webpSmartSubsample: false, + webpSmartDeblock: false, + webpPreset: 'default', + webpEffort: 4, + webpMinSize: false, + webpMixed: false, + gifBitdepth: 8, + gifEffort: 7, + gifDither: 1, + gifInterFrameMaxError: 0, + gifInterPaletteMaxError: 3, + gifKeepDuplicateFrames: false, + gifReuse: true, + gifProgressive: false, + tiffQuality: 80, + tiffCompression: 'jpeg', + tiffBigtiff: false, + tiffPredictor: 'horizontal', + tiffPyramid: false, + tiffMiniswhite: false, + tiffBitdepth: 8, + tiffTile: false, + tiffTileHeight: 256, + tiffTileWidth: 256, + tiffXres: 1.0, + tiffYres: 1.0, + tiffResolutionUnit: 'inch', + heifQuality: 50, + heifLossless: false, + heifCompression: 'av1', + heifEffort: 4, + heifChromaSubsampling: '4:4:4', + heifBitdepth: 8, + jxlDistance: 1, + jxlDecodingTier: 0, + jxlEffort: 7, + jxlLossless: false, + rawDepth: 'uchar', + tileSize: 256, + tileOverlap: 0, + tileContainer: 'fs', + tileLayout: 'dz', + tileFormat: 'last', + tileDepth: 'last', + tileAngle: 0, + tileSkipBlanks: -1, + tileBackground: [255, 255, 255, 255], + tileCentre: false, + tileId: 'https://example.com/iiif', + tileBasename: '', + timeoutSeconds: 0, + linearA: [], + linearB: [], + pdfBackground: [255, 255, 255, 255], + // Function to notify of libvips warnings + debuglog: warning => { + this.emit('warning', warning); + debuglog(warning); + }, + // Function to notify of queue length changes + queueListener + }; + this.options.input = this._createInputDescriptor(input, options, { allowStream: true }); + return this; +}; +Object.setPrototypeOf(Sharp.prototype, stream.Duplex.prototype); +Object.setPrototypeOf(Sharp, stream.Duplex); + +/** + * Take a "snapshot" of the Sharp instance, returning a new instance. + * Cloned instances inherit the input of their parent instance. + * This allows multiple output Streams and therefore multiple processing pipelines to share a single input Stream. + * + * @example + * const pipeline = sharp().rotate(); + * pipeline.clone().resize(800, 600).pipe(firstWritableStream); + * pipeline.clone().extract({ left: 20, top: 20, width: 100, height: 100 }).pipe(secondWritableStream); + * readableStream.pipe(pipeline); + * // firstWritableStream receives auto-rotated, resized readableStream + * // secondWritableStream receives auto-rotated, extracted region of readableStream + * + * @example + * // Create a pipeline that will download an image, resize it and format it to different files + * // Using Promises to know when the pipeline is complete + * const fs = require("fs"); + * const got = require("got"); + * const sharpStream = sharp({ failOn: 'none' }); + * + * const promises = []; + * + * promises.push( + * sharpStream + * .clone() + * .jpeg({ quality: 100 }) + * .toFile("originalFile.jpg") + * ); + * + * promises.push( + * sharpStream + * .clone() + * .resize({ width: 500 }) + * .jpeg({ quality: 80 }) + * .toFile("optimized-500.jpg") + * ); + * + * promises.push( + * sharpStream + * .clone() + * .resize({ width: 500 }) + * .webp({ quality: 80 }) + * .toFile("optimized-500.webp") + * ); + * + * // https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md + * got.stream("https://www.example.com/some-file.jpg").pipe(sharpStream); + * + * Promise.all(promises) + * .then(res => { console.log("Done!", res); }) + * .catch(err => { + * console.error("Error processing files, let's clean it up", err); + * try { + * fs.unlinkSync("originalFile.jpg"); + * fs.unlinkSync("optimized-500.jpg"); + * fs.unlinkSync("optimized-500.webp"); + * } catch (e) {} + * }); + * + * @returns {Sharp} + */ +function clone () { + // Clone existing options + const clone = this.constructor.call(); + const { debuglog, queueListener, ...options } = this.options; + clone.options = structuredClone(options); + clone.options.debuglog = debuglog; + clone.options.queueListener = queueListener; + // Pass 'finish' event to clone for Stream-based input + if (this._isStreamInput()) { + this.on('finish', () => { + // Clone inherits input data + this._flattenBufferIn(); + clone.options.input.buffer = this.options.input.buffer; + clone.emit('finish'); + }); + } + return clone; +} +Object.assign(Sharp.prototype, { clone }); + +/** + * Export constructor. + * @module Sharp + * @private + */ +module.exports = Sharp; diff --git a/node_modules/sharp/lib/index.d.ts b/node_modules/sharp/lib/index.d.ts new file mode 100644 index 0000000..89ff39e --- /dev/null +++ b/node_modules/sharp/lib/index.d.ts @@ -0,0 +1,1971 @@ +/** + * Copyright 2017 François Nguyen and others. + * + * Billy Kwok + * Bradley Odell + * Espen Hovlandsdal + * Floris de Bijl + * François Nguyen + * Jamie Woodbury + * Wooseop Kim + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of + * the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +// SPDX-License-Identifier: MIT + +/// + +import type { Duplex } from 'node:stream'; + +//#region Constructor functions + +/** + * Creates a sharp instance from an image + * @param input Buffer containing JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data, or String containing the path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file. + * @param options Object with optional attributes. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ +declare function sharp(options?: sharp.SharpOptions): sharp.Sharp; +declare function sharp( + input?: sharp.SharpInput | Array, + options?: sharp.SharpOptions, +): sharp.Sharp; + +declare namespace sharp { + /** Object containing nested boolean values representing the available input and output formats/methods. */ + const format: FormatEnum; + + /** An Object containing the version numbers of sharp, libvips and its dependencies. */ + const versions: { + aom?: string | undefined; + archive?: string | undefined; + cairo?: string | undefined; + cgif?: string | undefined; + exif?: string | undefined; + expat?: string | undefined; + ffi?: string | undefined; + fontconfig?: string | undefined; + freetype?: string | undefined; + fribidi?: string | undefined; + glib?: string | undefined; + harfbuzz?: string | undefined; + heif?: string | undefined; + highway?: string | undefined; + imagequant?: string | undefined; + lcms?: string | undefined; + mozjpeg?: string | undefined; + pango?: string | undefined; + pixman?: string | undefined; + png?: string | undefined; + "proxy-libintl"?: string | undefined; + rsvg?: string | undefined; + sharp: string; + spng?: string | undefined; + tiff?: string | undefined; + vips: string; + webp?: string | undefined; + xml?: string | undefined; + "zlib-ng"?: string | undefined; + }; + + /** An Object containing the available interpolators and their proper values */ + const interpolators: Interpolators; + + /** An EventEmitter that emits a change event when a task is either queued, waiting for libuv to provide a worker thread, complete */ + const queue: NodeJS.EventEmitter; + + //#endregion + + //#region Utility functions + + /** + * Gets or, when options are provided, sets the limits of libvips' operation cache. + * Existing entries in the cache will be trimmed after any change in limits. + * This method always returns cache statistics, useful for determining how much working memory is required for a particular task. + * @param options Object with the following attributes, or Boolean where true uses default cache settings and false removes all caching (optional, default true) + * @returns The cache results. + */ + function cache(options?: boolean | CacheOptions): CacheResult; + + /** + * Gets or sets the number of threads libvips' should create to process each image. + * The default value is the number of CPU cores. A value of 0 will reset to this default. + * The maximum number of images that can be processed in parallel is limited by libuv's UV_THREADPOOL_SIZE environment variable. + * @param concurrency The new concurrency value. + * @returns The current concurrency value. + */ + function concurrency(concurrency?: number): number; + + /** + * Provides access to internal task counters. + * @returns Object containing task counters + */ + function counters(): SharpCounters; + + /** + * Get and set use of SIMD vector unit instructions. Requires libvips to have been compiled with highway support. + * Improves the performance of resize, blur and sharpen operations by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON. + * @param enable enable or disable use of SIMD vector unit instructions + * @returns true if usage of SIMD vector unit instructions is enabled + */ + function simd(enable?: boolean): boolean; + + /** + * Block libvips operations at runtime. + * + * This is in addition to the `VIPS_BLOCK_UNTRUSTED` environment variable, + * which when set will block all "untrusted" operations. + * + * @since 0.32.4 + * + * @example Block all TIFF input. + * sharp.block({ + * operation: ['VipsForeignLoadTiff'] + * }); + * + * @param {Object} options + * @param {Array} options.operation - List of libvips low-level operation names to block. + */ + function block(options: { operation: string[] }): void; + + /** + * Unblock libvips operations at runtime. + * + * This is useful for defining a list of allowed operations. + * + * @since 0.32.4 + * + * @example Block all input except WebP from the filesystem. + * sharp.block({ + * operation: ['VipsForeignLoad'] + * }); + * sharp.unblock({ + * operation: ['VipsForeignLoadWebpFile'] + * }); + * + * @example Block all input except JPEG and PNG from a Buffer or Stream. + * sharp.block({ + * operation: ['VipsForeignLoad'] + * }); + * sharp.unblock({ + * operation: ['VipsForeignLoadJpegBuffer', 'VipsForeignLoadPngBuffer'] + * }); + * + * @param {Object} options + * @param {Array} options.operation - List of libvips low-level operation names to unblock. + */ + function unblock(options: { operation: string[] }): void; + + //#endregion + + const gravity: GravityEnum; + const strategy: StrategyEnum; + const kernel: KernelEnum; + const fit: FitEnum; + const bool: BoolEnum; + + interface Sharp extends Duplex { + //#region Channel functions + + /** + * Remove alpha channel, if any. This is a no-op if the image does not have an alpha channel. + * @returns A sharp instance that can be used to chain operations + */ + removeAlpha(): Sharp; + + /** + * Ensure alpha channel, if missing. The added alpha channel will be fully opaque. This is a no-op if the image already has an alpha channel. + * @param alpha transparency level (0=fully-transparent, 1=fully-opaque) (optional, default 1). + * @returns A sharp instance that can be used to chain operations + */ + ensureAlpha(alpha?: number): Sharp; + + /** + * Extract a single channel from a multi-channel image. + * @param channel zero-indexed channel/band number to extract, or red, green, blue or alpha. + * @throws {Error} Invalid channel + * @returns A sharp instance that can be used to chain operations + */ + extractChannel(channel: 0 | 1 | 2 | 3 | 'red' | 'green' | 'blue' | 'alpha'): Sharp; + + /** + * Join one or more channels to the image. The meaning of the added channels depends on the output colourspace, set with toColourspace(). + * By default the output image will be web-friendly sRGB, with additional channels interpreted as alpha channels. Channel ordering follows vips convention: + * - sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha. + * - CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha. + * + * Buffers may be any of the image formats supported by sharp. + * For raw pixel input, the options object should contain a raw attribute, which follows the format of the attribute of the same name in the sharp() constructor. + * @param images one or more images (file paths, Buffers). + * @param options image options, see sharp() constructor. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + joinChannel(images: string | Buffer | ArrayLike, options?: SharpOptions): Sharp; + + /** + * Perform a bitwise boolean operation on all input image channels (bands) to produce a single channel output image. + * @param boolOp one of "and", "or" or "eor" to perform that bitwise operation, like the C logic operators &, | and ^ respectively. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + bandbool(boolOp: keyof BoolEnum): Sharp; + + //#endregion + + //#region Color functions + + /** + * Tint the image using the provided colour. + * An alpha channel may be present and will be unchanged by the operation. + * @param tint Parsed by the color module. + * @returns A sharp instance that can be used to chain operations + */ + tint(tint: Colour | Color): Sharp; + + /** + * Convert to 8-bit greyscale; 256 shades of grey. + * This is a linear operation. + * If the input image is in a non-linear colour space such as sRGB, use gamma() with greyscale() for the best results. + * By default the output image will be web-friendly sRGB and contain three (identical) colour channels. + * This may be overridden by other sharp operations such as toColourspace('b-w'), which will produce an output image containing one colour channel. + * An alpha channel may be present, and will be unchanged by the operation. + * @param greyscale true to enable and false to disable (defaults to true) + * @returns A sharp instance that can be used to chain operations + */ + greyscale(greyscale?: boolean): Sharp; + + /** + * Alternative spelling of greyscale(). + * @param grayscale true to enable and false to disable (defaults to true) + * @returns A sharp instance that can be used to chain operations + */ + grayscale(grayscale?: boolean): Sharp; + + /** + * Set the pipeline colourspace. + * The input image will be converted to the provided colourspace at the start of the pipeline. + * All operations will use this colourspace before converting to the output colourspace, as defined by toColourspace. + * This feature is experimental and has not yet been fully-tested with all operations. + * + * @param colourspace pipeline colourspace e.g. rgb16, scrgb, lab, grey16 ... + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + pipelineColourspace(colourspace?: string): Sharp; + + /** + * Alternative spelling of pipelineColourspace + * @param colorspace pipeline colourspace e.g. rgb16, scrgb, lab, grey16 ... + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + pipelineColorspace(colorspace?: string): Sharp; + + /** + * Set the output colourspace. + * By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels. + * @param colourspace output colourspace e.g. srgb, rgb, cmyk, lab, b-w ... + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + toColourspace(colourspace?: string): Sharp; + + /** + * Alternative spelling of toColourspace(). + * @param colorspace output colorspace e.g. srgb, rgb, cmyk, lab, b-w ... + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + toColorspace(colorspace: string): Sharp; + + //#endregion + + //#region Composite functions + + /** + * Composite image(s) over the processed (resized, extracted etc.) image. + * + * The images to composite must be the same size or smaller than the processed image. + * If both `top` and `left` options are provided, they take precedence over `gravity`. + * @param images - Ordered list of images to composite + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + composite(images: OverlayOptions[]): Sharp; + + //#endregion + + //#region Input functions + + /** + * Take a "snapshot" of the Sharp instance, returning a new instance. + * Cloned instances inherit the input of their parent instance. + * This allows multiple output Streams and therefore multiple processing pipelines to share a single input Stream. + * @returns A sharp instance that can be used to chain operations + */ + clone(): Sharp; + + /** + * Fast access to (uncached) image metadata without decoding any compressed image data. + * @returns A sharp instance that can be used to chain operations + */ + metadata(callback: (err: Error, metadata: Metadata) => void): Sharp; + + /** + * Fast access to (uncached) image metadata without decoding any compressed image data. + * @returns A promise that resolves with a metadata object + */ + metadata(): Promise; + + /** + * Keep all metadata (EXIF, ICC, XMP, IPTC) from the input image in the output image. + * @returns A sharp instance that can be used to chain operations + */ + keepMetadata(): Sharp; + + /** + * Access to pixel-derived image statistics for every channel in the image. + * @returns A sharp instance that can be used to chain operations + */ + stats(callback: (err: Error, stats: Stats) => void): Sharp; + + /** + * Access to pixel-derived image statistics for every channel in the image. + * @returns A promise that resolves with a stats object + */ + stats(): Promise; + + //#endregion + + //#region Operation functions + + /** + * Rotate the output image by either an explicit angle + * or auto-orient based on the EXIF `Orientation` tag. + * + * If an angle is provided, it is converted to a valid positive degree rotation. + * For example, `-450` will produce a 270 degree rotation. + * + * When rotating by an angle other than a multiple of 90, + * the background colour can be provided with the `background` option. + * + * If no angle is provided, it is determined from the EXIF data. + * Mirroring is supported and may infer the use of a flip operation. + * + * The use of `rotate` without an angle will remove the EXIF `Orientation` tag, if any. + * + * Only one rotation can occur per pipeline (aside from an initial call without + * arguments to orient via EXIF data). Previous calls to `rotate` in the same + * pipeline will be ignored. + * + * Multi-page images can only be rotated by 180 degrees. + * + * Method order is important when rotating, resizing and/or extracting regions, + * for example `.rotate(x).extract(y)` will produce a different result to `.extract(y).rotate(x)`. + * + * @example + * const pipeline = sharp() + * .rotate() + * .resize(null, 200) + * .toBuffer(function (err, outputBuffer, info) { + * // outputBuffer contains 200px high JPEG image data, + * // auto-rotated using EXIF Orientation tag + * // info.width and info.height contain the dimensions of the resized image + * }); + * readableStream.pipe(pipeline); + * + * @example + * const rotateThenResize = await sharp(input) + * .rotate(90) + * .resize({ width: 16, height: 8, fit: 'fill' }) + * .toBuffer(); + * const resizeThenRotate = await sharp(input) + * .resize({ width: 16, height: 8, fit: 'fill' }) + * .rotate(90) + * .toBuffer(); + * + * @param {number} [angle=auto] angle of rotation. + * @param {Object} [options] - if present, is an Object with optional attributes. + * @param {string|Object} [options.background="#000000"] parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ + rotate(angle?: number, options?: RotateOptions): Sharp; + + /** + * Alias for calling `rotate()` with no arguments, which orients the image based + * on EXIF orientsion. + * + * This operation is aliased to emphasize its purpose, helping to remove any + * confusion between rotation and orientation. + * + * @example + * const output = await sharp(input).autoOrient().toBuffer(); + * + * @returns {Sharp} + */ + autoOrient(): Sharp + + /** + * Flip the image about the vertical Y axis. This always occurs after rotation, if any. + * The use of flip implies the removal of the EXIF Orientation tag, if any. + * @param flip true to enable and false to disable (defaults to true) + * @returns A sharp instance that can be used to chain operations + */ + flip(flip?: boolean): Sharp; + + /** + * Flop the image about the horizontal X axis. This always occurs after rotation, if any. + * The use of flop implies the removal of the EXIF Orientation tag, if any. + * @param flop true to enable and false to disable (defaults to true) + * @returns A sharp instance that can be used to chain operations + */ + flop(flop?: boolean): Sharp; + + /** + * Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any. + * You must provide an array of length 4 or a 2x2 affine transformation matrix. + * By default, new pixels are filled with a black background. You can provide a background colour with the `background` option. + * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`. + * + * In the case of a 2x2 matrix, the transform is: + * X = matrix[0, 0] * (x + idx) + matrix[0, 1] * (y + idy) + odx + * Y = matrix[1, 0] * (x + idx) + matrix[1, 1] * (y + idy) + ody + * + * where: + * + * x and y are the coordinates in input image. + * X and Y are the coordinates in output image. + * (0,0) is the upper left corner. + * + * @param matrix Affine transformation matrix, may either by a array of length four or a 2x2 matrix array + * @param options if present, is an Object with optional attributes. + * + * @returns A sharp instance that can be used to chain operations + */ + affine(matrix: [number, number, number, number] | Matrix2x2, options?: AffineOptions): Sharp; + + /** + * Sharpen the image. + * When used without parameters, performs a fast, mild sharpen of the output image. + * When a sigma is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space. + * Fine-grained control over the level of sharpening in "flat" (m1) and "jagged" (m2) areas is available. + * @param options if present, is an Object with optional attributes + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + sharpen(options?: SharpenOptions): Sharp; + + /** + * Sharpen the image. + * When used without parameters, performs a fast, mild sharpen of the output image. + * When a sigma is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space. + * Fine-grained control over the level of sharpening in "flat" (m1) and "jagged" (m2) areas is available. + * @param sigma the sigma of the Gaussian mask, where sigma = 1 + radius / 2. + * @param flat the level of sharpening to apply to "flat" areas. (optional, default 1.0) + * @param jagged the level of sharpening to apply to "jagged" areas. (optional, default 2.0) + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + * + * @deprecated Use the object parameter `sharpen({sigma, m1, m2, x1, y2, y3})` instead + */ + sharpen(sigma?: number, flat?: number, jagged?: number): Sharp; + + /** + * Apply median filter. When used without parameters the default window is 3x3. + * @param size square mask size: size x size (optional, default 3) + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + median(size?: number): Sharp; + + /** + * Blur the image. + * When used without parameters, performs a fast, mild blur of the output image. + * When a sigma is provided, performs a slower, more accurate Gaussian blur. + * When a boolean sigma is provided, ether blur mild or disable blur + * @param sigma a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where sigma = 1 + radius / 2. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + blur(sigma?: number | boolean | BlurOptions): Sharp; + + /** + * Expand foreground objects using the dilate morphological operator. + * @param {Number} [width=1] dilation width in pixels. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + dilate(width?: number): Sharp; + + /** + * Shrink foreground objects using the erode morphological operator. + * @param {Number} [width=1] erosion width in pixels. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + erode(width?: number): Sharp; + + /** + * Merge alpha transparency channel, if any, with background. + * @param flatten true to enable and false to disable (defaults to true) + * @returns A sharp instance that can be used to chain operations + */ + flatten(flatten?: boolean | FlattenOptions): Sharp; + + /** + * Ensure the image has an alpha channel with all white pixel values made fully transparent. + * Existing alpha channel values for non-white pixels remain unchanged. + * @returns A sharp instance that can be used to chain operations + */ + unflatten(): Sharp; + + /** + * Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of 1/gamma then increasing the encoding (brighten) post-resize at a factor of gamma. + * This can improve the perceived brightness of a resized image in non-linear colour spaces. + * JPEG and WebP input images will not take advantage of the shrink-on-load performance optimisation when applying a gamma correction. + * Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases. + * @param gamma value between 1.0 and 3.0. (optional, default 2.2) + * @param gammaOut value between 1.0 and 3.0. (optional, defaults to same as gamma) + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + gamma(gamma?: number, gammaOut?: number): Sharp; + + /** + * Produce the "negative" of the image. + * @param negate true to enable and false to disable, or an object of options (defaults to true) + * @returns A sharp instance that can be used to chain operations + */ + negate(negate?: boolean | NegateOptions): Sharp; + + /** + * Enhance output image contrast by stretching its luminance to cover a full dynamic range. + * + * Uses a histogram-based approach, taking a default range of 1% to 99% to reduce sensitivity to noise at the extremes. + * + * Luminance values below the `lower` percentile will be underexposed by clipping to zero. + * Luminance values above the `upper` percentile will be overexposed by clipping to the max pixel value. + * + * @param normalise options + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + normalise(normalise?: NormaliseOptions): Sharp; + + /** + * Alternative spelling of normalise. + * @param normalize options + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + normalize(normalize?: NormaliseOptions): Sharp; + + /** + * Perform contrast limiting adaptive histogram equalization (CLAHE) + * + * This will, in general, enhance the clarity of the image by bringing out + * darker details. Please read more about CLAHE here: + * https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE + * + * @param options clahe options + */ + clahe(options: ClaheOptions): Sharp; + + /** + * Convolve the image with the specified kernel. + * @param kernel the specified kernel + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + convolve(kernel: Kernel): Sharp; + + /** + * Any pixel value greather than or equal to the threshold value will be set to 255, otherwise it will be set to 0. + * @param threshold a value in the range 0-255 representing the level at which the threshold will be applied. (optional, default 128) + * @param options threshold options + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + threshold(threshold?: number, options?: ThresholdOptions): Sharp; + + /** + * Perform a bitwise boolean operation with operand image. + * This operation creates an output image where each pixel is the result of the selected bitwise boolean operation between the corresponding pixels of the input images. + * @param operand Buffer containing image data or String containing the path to an image file. + * @param operator one of "and", "or" or "eor" to perform that bitwise operation, like the C logic operators &, | and ^ respectively. + * @param options describes operand when using raw pixel data. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + boolean(operand: string | Buffer, operator: keyof BoolEnum, options?: { raw: Raw }): Sharp; + + /** + * Apply the linear formula a * input + b to the image (levels adjustment) + * @param a multiplier (optional, default 1.0) + * @param b offset (optional, default 0.0) + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + linear(a?: number | number[] | null, b?: number | number[]): Sharp; + + /** + * Recomb the image with the specified matrix. + * @param inputMatrix 3x3 Recombination matrix or 4x4 Recombination matrix + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + recomb(inputMatrix: Matrix3x3 | Matrix4x4): Sharp; + + /** + * Transforms the image using brightness, saturation, hue rotation and lightness. + * Brightness and lightness both operate on luminance, with the difference being that brightness is multiplicative whereas lightness is additive. + * @param options describes the modulation + * @returns A sharp instance that can be used to chain operations + */ + modulate(options?: { + brightness?: number | undefined; + saturation?: number | undefined; + hue?: number | undefined; + lightness?: number | undefined; + }): Sharp; + + //#endregion + + //#region Output functions + + /** + * Write output image data to a file. + * If an explicit output format is not selected, it will be inferred from the extension, with JPEG, PNG, WebP, AVIF, TIFF, DZI, and libvips' V format supported. + * Note that raw pixel data is only supported for buffer output. + * @param fileOut The path to write the image data to. + * @param callback Callback function called on completion with two arguments (err, info). info contains the output image format, size (bytes), width, height and channels. + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + toFile(fileOut: string, callback: (err: Error, info: OutputInfo) => void): Sharp; + + /** + * Write output image data to a file. + * @param fileOut The path to write the image data to. + * @throws {Error} Invalid parameters + * @returns A promise that fulfills with an object containing information on the resulting file + */ + toFile(fileOut: string): Promise; + + /** + * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported. + * By default, the format will match the input image, except SVG input which becomes PNG output. + * @param callback Callback function called on completion with three arguments (err, buffer, info). + * @returns A sharp instance that can be used to chain operations + */ + toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): Sharp; + + /** + * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported. + * By default, the format will match the input image, except SVG input which becomes PNG output. + * @param options resolve options + * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data. + * @returns A promise that resolves with the Buffer data. + */ + toBuffer(options?: { resolveWithObject: false }): Promise; + + /** + * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported. + * By default, the format will match the input image, except SVG input which becomes PNG output. + * @param options resolve options + * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data. + * @returns A promise that resolves with an object containing the Buffer data and an info object containing the output image format, size (bytes), width, height and channels + */ + toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>; + + /** + * Keep all EXIF metadata from the input image in the output image. + * EXIF metadata is unsupported for TIFF output. + * @returns A sharp instance that can be used to chain operations + */ + keepExif(): Sharp; + + /** + * Set EXIF metadata in the output image, ignoring any EXIF in the input image. + * @param {Exif} exif Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data. + * @returns A sharp instance that can be used to chain operations + * @throws {Error} Invalid parameters + */ + withExif(exif: Exif): Sharp; + + /** + * Update EXIF metadata from the input image in the output image. + * @param {Exif} exif Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data. + * @returns A sharp instance that can be used to chain operations + * @throws {Error} Invalid parameters + */ + withExifMerge(exif: Exif): Sharp; + + /** + * Keep ICC profile from the input image in the output image where possible. + * @returns A sharp instance that can be used to chain operations + */ + keepIccProfile(): Sharp; + + /** + * Transform using an ICC profile and attach to the output image. + * @param {string} icc - Absolute filesystem path to output ICC profile or built-in profile name (srgb, p3, cmyk). + * @returns A sharp instance that can be used to chain operations + * @throws {Error} Invalid parameters + */ + withIccProfile(icc: string, options?: WithIccProfileOptions): Sharp; + + /** + * Keep all XMP metadata from the input image in the output image. + * @returns A sharp instance that can be used to chain operations + */ + keepXmp(): Sharp; + + /** + * Set XMP metadata in the output image. + * @param {string} xmp - String containing XMP metadata to be embedded in the output image. + * @returns A sharp instance that can be used to chain operations + * @throws {Error} Invalid parameters + */ + withXmp(xmp: string): Sharp; + + /** + * Include all metadata (EXIF, XMP, IPTC) from the input image in the output image. + * The default behaviour, when withMetadata is not used, is to strip all metadata and convert to the device-independent sRGB colour space. + * This will also convert to and add a web-friendly sRGB ICC profile. + * @param withMetadata + * @throws {Error} Invalid parameters. + */ + withMetadata(withMetadata?: WriteableMetadata): Sharp; + + /** + * Use these JPEG options for output image. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + jpeg(options?: JpegOptions): Sharp; + + /** + * Use these JP2 (JPEG 2000) options for output image. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + jp2(options?: Jp2Options): Sharp; + + /** + * Use these JPEG-XL (JXL) options for output image. + * This feature is experimental, please do not use in production systems. + * Requires libvips compiled with support for libjxl. + * The prebuilt binaries do not include this. + * Image metadata (EXIF, XMP) is unsupported. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + jxl(options?: JxlOptions): Sharp; + + /** + * Use these PNG options for output image. + * PNG output is always full colour at 8 or 16 bits per pixel. + * Indexed PNG input at 1, 2 or 4 bits per pixel is converted to 8 bits per pixel. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + png(options?: PngOptions): Sharp; + + /** + * Use these WebP options for output image. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + webp(options?: WebpOptions): Sharp; + + /** + * Use these GIF options for output image. + * Requires libvips compiled with support for ImageMagick or GraphicsMagick. The prebuilt binaries do not include this - see installing a custom libvips. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + gif(options?: GifOptions): Sharp; + + /** + * Use these AVIF options for output image. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + avif(options?: AvifOptions): Sharp; + + /** + * Use these HEIF options for output image. + * Support for patent-encumbered HEIC images requires the use of a globally-installed libvips compiled with support for libheif, libde265 and x265. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + heif(options?: HeifOptions): Sharp; + + /** + * Use these TIFF options for output image. + * @param options Output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + tiff(options?: TiffOptions): Sharp; + + /** + * Force output to be raw, uncompressed uint8 pixel data. + * @param options Raw output options. + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + raw(options?: RawOptions): Sharp; + + /** + * Force output to a given format. + * @param format a String or an Object with an 'id' attribute + * @param options output options + * @throws {Error} Unsupported format or options + * @returns A sharp instance that can be used to chain operations + */ + toFormat( + format: keyof FormatEnum | AvailableFormatInfo, + options?: + | OutputOptions + | JpegOptions + | PngOptions + | WebpOptions + | AvifOptions + | HeifOptions + | JxlOptions + | GifOptions + | Jp2Options + | RawOptions + | TiffOptions, + ): Sharp; + + /** + * Use tile-based deep zoom (image pyramid) output. + * Set the format and options for tile images via the toFormat, jpeg, png or webp functions. + * Use a .zip or .szi file extension with toFile to write to a compressed archive file format. + * @param tile tile options + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + tile(tile?: TileOptions): Sharp; + + /** + * Set a timeout for processing, in seconds. Use a value of zero to continue processing indefinitely, the default behaviour. + * The clock starts when libvips opens an input image for processing. Time spent waiting for a libuv thread to become available is not included. + * @param options Object with a `seconds` attribute between 0 and 3600 (number) + * @throws {Error} Invalid options + * @returns A sharp instance that can be used to chain operations + */ + timeout(options: TimeoutOptions): Sharp; + + //#endregion + + //#region Resize functions + + /** + * Resize image to width, height or width x height. + * + * When both a width and height are provided, the possible methods by which the image should fit these are: + * - cover: Crop to cover both provided dimensions (the default). + * - contain: Embed within both provided dimensions. + * - fill: Ignore the aspect ratio of the input and stretch to both provided dimensions. + * - inside: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified. + * - outside: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified. + * Some of these values are based on the object-fit CSS property. + * + * When using a fit of cover or contain, the default position is centre. Other options are: + * - sharp.position: top, right top, right, right bottom, bottom, left bottom, left, left top. + * - sharp.gravity: north, northeast, east, southeast, south, southwest, west, northwest, center or centre. + * - sharp.strategy: cover only, dynamically crop using either the entropy or attention strategy. Some of these values are based on the object-position CSS property. + * + * The experimental strategy-based approach resizes so one dimension is at its target length then repeatedly ranks edge regions, + * discarding the edge with the lowest score based on the selected strategy. + * - entropy: focus on the region with the highest Shannon entropy. + * - attention: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones. + * + * Possible interpolation kernels are: + * - nearest: Use nearest neighbour interpolation. + * - cubic: Use a Catmull-Rom spline. + * - lanczos2: Use a Lanczos kernel with a=2. + * - lanczos3: Use a Lanczos kernel with a=3 (the default). + * + * @param width pixels wide the resultant image should be. Use null or undefined to auto-scale the width to match the height. + * @param height pixels high the resultant image should be. Use null or undefined to auto-scale the height to match the width. + * @param options resize options + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + resize(widthOrOptions?: number | ResizeOptions | null, height?: number | null, options?: ResizeOptions): Sharp; + + /** + * Shorthand for resize(null, null, options); + * + * @param options resize options + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + resize(options: ResizeOptions): Sharp; + + /** + * Extend / pad / extrude one or more edges of the image with either + * the provided background colour or pixels derived from the image. + * This operation will always occur after resizing and extraction, if any. + * @param extend single pixel count to add to all edges or an Object with per-edge counts + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + extend(extend: number | ExtendOptions): Sharp; + + /** + * Extract a region of the image. + * - Use extract() before resize() for pre-resize extraction. + * - Use extract() after resize() for post-resize extraction. + * - Use extract() before and after for both. + * + * @param region The region to extract + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + extract(region: Region): Sharp; + + /** + * Trim pixels from all edges that contain values similar to the given background colour, which defaults to that of the top-left pixel. + * Images with an alpha channel will use the combined bounding box of alpha and non-alpha channels. + * The info response Object will contain trimOffsetLeft and trimOffsetTop properties. + * @param options trim options + * @throws {Error} Invalid parameters + * @returns A sharp instance that can be used to chain operations + */ + trim(options?: TrimOptions): Sharp; + + //#endregion + } + + type SharpInput = Buffer + | ArrayBuffer + | Uint8Array + | Uint8ClampedArray + | Int8Array + | Uint16Array + | Int16Array + | Uint32Array + | Int32Array + | Float32Array + | Float64Array + | string; + + interface SharpOptions { + /** + * Auto-orient based on the EXIF `Orientation` tag, if present. + * Mirroring is supported and may infer the use of a flip operation. + * + * Using this option will remove the EXIF `Orientation` tag, if any. + */ + autoOrient?: boolean | undefined; + /** + * When to abort processing of invalid pixel data, one of (in order of sensitivity): + * 'none' (least), 'truncated', 'error' or 'warning' (most), highers level imply lower levels, invalid metadata will always abort. (optional, default 'warning') + */ + failOn?: FailOnOptions | undefined; + /** + * By default halt processing and raise an error when loading invalid images. + * Set this flag to false if you'd rather apply a "best effort" to decode images, + * even if the data is corrupt or invalid. (optional, default true) + * + * @deprecated Use `failOn` instead + */ + failOnError?: boolean | undefined; + /** + * Do not process input images where the number of pixels (width x height) exceeds this limit. + * Assumes image dimensions contained in the input metadata can be trusted. + * An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF). (optional, default 268402689) + */ + limitInputPixels?: number | boolean | undefined; + /** Set this to true to remove safety features that help prevent memory exhaustion (SVG, PNG). (optional, default false) */ + unlimited?: boolean | undefined; + /** Set this to false to use random access rather than sequential read. Some operations will do this automatically. */ + sequentialRead?: boolean | undefined; + /** Number representing the DPI for vector images in the range 1 to 100000. (optional, default 72) */ + density?: number | undefined; + /** Should the embedded ICC profile, if any, be ignored. */ + ignoreIcc?: boolean | undefined; + /** Number of pages to extract for multi-page input (GIF, TIFF, PDF), use -1 for all pages */ + pages?: number | undefined; + /** Page number to start extracting from for multi-page input (GIF, TIFF, PDF), zero based. (optional, default 0) */ + page?: number | undefined; + /** TIFF specific input options */ + tiff?: TiffInputOptions | undefined; + /** SVG specific input options */ + svg?: SvgInputOptions | undefined; + /** PDF specific input options */ + pdf?: PdfInputOptions | undefined; + /** OpenSlide specific input options */ + openSlide?: OpenSlideInputOptions | undefined; + /** JPEG 2000 specific input options */ + jp2?: Jp2InputOptions | undefined; + /** Deprecated: use tiff.subifd instead */ + subifd?: number | undefined; + /** Deprecated: use pdf.background instead */ + pdfBackground?: Colour | Color | undefined; + /** Deprecated: use openSlide.level instead */ + level?: number | undefined; + /** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default false) */ + animated?: boolean | undefined; + /** Describes raw pixel input image data. See raw() for pixel ordering. */ + raw?: CreateRaw | undefined; + /** Describes a new image to be created. */ + create?: Create | undefined; + /** Describes a new text image to be created. */ + text?: CreateText | undefined; + /** Describes how array of input images should be joined. */ + join?: Join | undefined; + } + + interface CacheOptions { + /** Is the maximum memory in MB to use for this cache (optional, default 50) */ + memory?: number | undefined; + /** Is the maximum number of files to hold open (optional, default 20) */ + files?: number | undefined; + /** Is the maximum number of operations to cache (optional, default 100) */ + items?: number | undefined; + } + + interface TimeoutOptions { + /** Number of seconds after which processing will be stopped (default 0, eg disabled) */ + seconds: number; + } + + interface SharpCounters { + /** The number of tasks this module has queued waiting for libuv to provide a worker thread from its pool. */ + queue: number; + /** The number of resize tasks currently being processed. */ + process: number; + } + + interface Raw { + width: number; + height: number; + channels: Channels; + } + + interface CreateRaw extends Raw { + /** Specifies that the raw input has already been premultiplied, set to true to avoid sharp premultiplying the image. (optional, default false) */ + premultiplied?: boolean | undefined; + /** The height of each page/frame for animated images, must be an integral factor of the overall image height. */ + pageHeight?: number | undefined; + } + + type CreateChannels = 3 | 4; + + interface Create { + /** Number of pixels wide. */ + width: number; + /** Number of pixels high. */ + height: number; + /** Number of bands, 3 for RGB, 4 for RGBA */ + channels: CreateChannels; + /** Parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. */ + background: Colour | Color; + /** Describes a noise to be created. */ + noise?: Noise | undefined; + /** The height of each page/frame for animated images, must be an integral factor of the overall image height. */ + pageHeight?: number | undefined; + + } + + interface CreateText { + /** Text to render as a UTF-8 string. It can contain Pango markup, for example `LeMonde`. */ + text: string; + /** Font name to render with. */ + font?: string; + /** Absolute filesystem path to a font file that can be used by `font`. */ + fontfile?: string; + /** Integral number of pixels to word-wrap at. Lines of text wider than this will be broken at word boundaries. (optional, default `0`) */ + width?: number; + /** + * Integral number of pixels high. When defined, `dpi` will be ignored and the text will automatically fit the pixel resolution + * defined by `width` and `height`. Will be ignored if `width` is not specified or set to 0. (optional, default `0`) + */ + height?: number; + /** Text alignment ('left', 'centre', 'center', 'right'). (optional, default 'left') */ + align?: TextAlign; + /** Set this to true to apply justification to the text. (optional, default `false`) */ + justify?: boolean; + /** The resolution (size) at which to render the text. Does not take effect if `height` is specified. (optional, default `72`) */ + dpi?: number; + /** + * Set this to true to enable RGBA output. This is useful for colour emoji rendering, + * or support for pango markup features like `Red!`. (optional, default `false`) + */ + rgba?: boolean; + /** Text line height in points. Will use the font line height if none is specified. (optional, default `0`) */ + spacing?: number; + /** Word wrapping style when width is provided, one of: 'word', 'char', 'word-char' (prefer word, fallback to char) or 'none' */ + wrap?: TextWrap; + } + + interface Join { + /** Number of images per row. */ + across?: number | undefined; + /** Treat input as frames of an animated image. */ + animated?: boolean | undefined; + /** Space between images, in pixels. */ + shim?: number | undefined; + /** Background colour. */ + background?: Colour | Color | undefined; + /** Horizontal alignment. */ + halign?: HorizontalAlignment | undefined; + /** Vertical alignment. */ + valign?: VerticalAlignment | undefined; + } + + interface TiffInputOptions { + /** Sub Image File Directory to extract, defaults to main image. Use -1 for all subifds. */ + subifd?: number | undefined; + } + + interface SvgInputOptions { + /** Custom CSS for SVG input, applied with a User Origin during the CSS cascade. */ + stylesheet?: string | undefined; + /** Set to `true` to render SVG input at 32-bits per channel (128-bit) instead of 8-bits per channel (32-bit) RGBA. */ + highBitdepth?: boolean | undefined; + } + + interface PdfInputOptions { + /** Background colour to use when PDF is partially transparent. Requires the use of a globally-installed libvips compiled with support for PDFium, Poppler, ImageMagick or GraphicsMagick. */ + background?: Colour | Color | undefined; + } + + interface OpenSlideInputOptions { + /** Level to extract from a multi-level input, zero based. (optional, default 0) */ + level?: number | undefined; + } + + interface Jp2InputOptions { + /** Set to `true` to load JPEG 2000 images using [oneshot mode](https://github.com/libvips/libvips/issues/4205) */ + oneshot?: boolean | undefined; + } + + interface ExifDir { + [k: string]: string; + } + + interface Exif { + 'IFD0'?: ExifDir; + 'IFD1'?: ExifDir; + 'IFD2'?: ExifDir; + 'IFD3'?: ExifDir; + } + + type HeifCompression = 'av1' | 'hevc'; + + type Unit = 'inch' | 'cm'; + + interface WriteableMetadata { + /** Number of pixels per inch (DPI) */ + density?: number | undefined; + /** Value between 1 and 8, used to update the EXIF Orientation tag. */ + orientation?: number | undefined; + /** + * Filesystem path to output ICC profile, defaults to sRGB. + * @deprecated Use `withIccProfile()` instead. + */ + icc?: string | undefined; + /** + * Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data. + * @deprecated Use `withExif()` or `withExifMerge()` instead. + */ + exif?: Exif | undefined; + } + + interface Metadata { + /** Number value of the EXIF Orientation header, if present */ + orientation?: number | undefined; + /** Name of decoder used to decompress image data e.g. jpeg, png, webp, gif, svg */ + format: keyof FormatEnum; + /** Total size of image in bytes, for Stream and Buffer input only */ + size?: number | undefined; + /** Number of pixels wide (EXIF orientation is not taken into consideration) */ + width: number; + /** Number of pixels high (EXIF orientation is not taken into consideration) */ + height: number; + /** Any changed metadata after the image orientation is applied. */ + autoOrient: { + /** Number of pixels wide (EXIF orientation is taken into consideration) */ + width: number; + /** Number of pixels high (EXIF orientation is taken into consideration) */ + height: number; + }; + /** Name of colour space interpretation */ + space: keyof ColourspaceEnum; + /** Number of bands e.g. 3 for sRGB, 4 for CMYK */ + channels: Channels; + /** Name of pixel depth format e.g. uchar, char, ushort, float ... */ + depth: keyof DepthEnum; + /** Number of pixels per inch (DPI), if present */ + density?: number | undefined; + /** String containing JPEG chroma subsampling, 4:2:0 or 4:4:4 for RGB, 4:2:0:4 or 4:4:4:4 for CMYK */ + chromaSubsampling?: string | undefined; + /** Boolean indicating whether the image is interlaced using a progressive scan */ + isProgressive: boolean; + /** Boolean indicating whether the image is palette-based (GIF, PNG). */ + isPalette: boolean; + /** Number of bits per sample for each channel (GIF, PNG). */ + bitsPerSample?: number | undefined; + /** Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP */ + pages?: number | undefined; + /** Number of pixels high each page in a multi-page image will be. */ + pageHeight?: number | undefined; + /** Number of times to loop an animated image, zero refers to a continuous loop. */ + loop?: number | undefined; + /** Delay in ms between each page in an animated image, provided as an array of integers. */ + delay?: number[] | undefined; + /** Number of the primary page in a HEIF image */ + pagePrimary?: number | undefined; + /** Boolean indicating the presence of an embedded ICC profile */ + hasProfile: boolean; + /** Boolean indicating the presence of an alpha transparency channel */ + hasAlpha: boolean; + /** Buffer containing raw EXIF data, if present */ + exif?: Buffer | undefined; + /** Buffer containing raw ICC profile data, if present */ + icc?: Buffer | undefined; + /** Buffer containing raw IPTC data, if present */ + iptc?: Buffer | undefined; + /** Buffer containing raw XMP data, if present */ + xmp?: Buffer | undefined; + /** String containing XMP data, if valid UTF-8 */ + xmpAsString?: string | undefined; + /** Buffer containing raw TIFFTAG_PHOTOSHOP data, if present */ + tifftagPhotoshop?: Buffer | undefined; + /** The encoder used to compress an HEIF file, `av1` (AVIF) or `hevc` (HEIC) */ + compression?: HeifCompression | undefined; + /** Default background colour, if present, for PNG (bKGD) and GIF images */ + background?: { r: number; g: number; b: number } | { gray: number }; + /** Details of each level in a multi-level image provided as an array of objects, requires libvips compiled with support for OpenSlide */ + levels?: LevelMetadata[] | undefined; + /** Number of Sub Image File Directories in an OME-TIFF image */ + subifds?: number | undefined; + /** The unit of resolution (density) */ + resolutionUnit?: Unit | undefined; + /** String containing format for images loaded via *magick */ + formatMagick?: string | undefined; + /** Array of keyword/text pairs representing PNG text blocks, if present. */ + comments?: CommentsMetadata[] | undefined; + } + + interface LevelMetadata { + width: number; + height: number; + } + + interface CommentsMetadata { + keyword: string; + text: string; + } + + interface Stats { + /** Array of channel statistics for each channel in the image. */ + channels: ChannelStats[]; + /** Value to identify if the image is opaque or transparent, based on the presence and use of alpha channel */ + isOpaque: boolean; + /** Histogram-based estimation of greyscale entropy, discarding alpha channel if any (experimental) */ + entropy: number; + /** Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any (experimental) */ + sharpness: number; + /** Object containing most dominant sRGB colour based on a 4096-bin 3D histogram (experimental) */ + dominant: { r: number; g: number; b: number }; + } + + interface ChannelStats { + /** minimum value in the channel */ + min: number; + /** maximum value in the channel */ + max: number; + /** sum of all values in a channel */ + sum: number; + /** sum of squared values in a channel */ + squaresSum: number; + /** mean of the values in a channel */ + mean: number; + /** standard deviation for the values in a channel */ + stdev: number; + /** x-coordinate of one of the pixel where the minimum lies */ + minX: number; + /** y-coordinate of one of the pixel where the minimum lies */ + minY: number; + /** x-coordinate of one of the pixel where the maximum lies */ + maxX: number; + /** y-coordinate of one of the pixel where the maximum lies */ + maxY: number; + } + + interface OutputOptions { + /** Force format output, otherwise attempt to use input format (optional, default true) */ + force?: boolean | undefined; + } + + interface WithIccProfileOptions { + /** Should the ICC profile be included in the output image metadata? (optional, default true) */ + attach?: boolean | undefined; + } + + interface JpegOptions extends OutputOptions { + /** Quality, integer 1-100 (optional, default 80) */ + quality?: number | undefined; + /** Use progressive (interlace) scan (optional, default false) */ + progressive?: boolean | undefined; + /** Set to '4:4:4' to prevent chroma subsampling when quality <= 90 (optional, default '4:2:0') */ + chromaSubsampling?: string | undefined; + /** Apply trellis quantisation (optional, default false) */ + trellisQuantisation?: boolean | undefined; + /** Apply overshoot deringing (optional, default false) */ + overshootDeringing?: boolean | undefined; + /** Optimise progressive scans, forces progressive (optional, default false) */ + optimiseScans?: boolean | undefined; + /** Alternative spelling of optimiseScans (optional, default false) */ + optimizeScans?: boolean | undefined; + /** Optimise Huffman coding tables (optional, default true) */ + optimiseCoding?: boolean | undefined; + /** Alternative spelling of optimiseCoding (optional, default true) */ + optimizeCoding?: boolean | undefined; + /** Quantization table to use, integer 0-8 (optional, default 0) */ + quantisationTable?: number | undefined; + /** Alternative spelling of quantisationTable (optional, default 0) */ + quantizationTable?: number | undefined; + /** Use mozjpeg defaults (optional, default false) */ + mozjpeg?: boolean | undefined; + } + + interface Jp2Options extends OutputOptions { + /** Quality, integer 1-100 (optional, default 80) */ + quality?: number; + /** Use lossless compression mode (optional, default false) */ + lossless?: boolean; + /** Horizontal tile size (optional, default 512) */ + tileWidth?: number; + /** Vertical tile size (optional, default 512) */ + tileHeight?: number; + /** Set to '4:2:0' to enable chroma subsampling (optional, default '4:4:4') */ + chromaSubsampling?: '4:4:4' | '4:2:0'; + } + + interface JxlOptions extends OutputOptions { + /** Maximum encoding error, between 0 (highest quality) and 15 (lowest quality) (optional, default 1.0) */ + distance?: number; + /** Calculate distance based on JPEG-like quality, between 1 and 100, overrides distance if specified */ + quality?: number; + /** Target decode speed tier, between 0 (highest quality) and 4 (lowest quality) (optional, default 0) */ + decodingTier?: number; + /** Use lossless compression (optional, default false) */ + lossless?: boolean; + /** CPU effort, between 3 (fastest) and 9 (slowest) (optional, default 7) */ + effort?: number | undefined; + } + + interface WebpOptions extends OutputOptions, AnimationOptions { + /** Quality, integer 1-100 (optional, default 80) */ + quality?: number | undefined; + /** Quality of alpha layer, number from 0-100 (optional, default 100) */ + alphaQuality?: number | undefined; + /** Use lossless compression mode (optional, default false) */ + lossless?: boolean | undefined; + /** Use near_lossless compression mode (optional, default false) */ + nearLossless?: boolean | undefined; + /** Use high quality chroma subsampling (optional, default false) */ + smartSubsample?: boolean | undefined; + /** Auto-adjust the deblocking filter, slow but can improve low contrast edges (optional, default false) */ + smartDeblock?: boolean | undefined; + /** Level of CPU effort to reduce file size, integer 0-6 (optional, default 4) */ + effort?: number | undefined; + /** Prevent use of animation key frames to minimise file size (slow) (optional, default false) */ + minSize?: boolean; + /** Allow mixture of lossy and lossless animation frames (slow) (optional, default false) */ + mixed?: boolean; + /** Preset options: one of default, photo, picture, drawing, icon, text (optional, default 'default') */ + preset?: keyof PresetEnum | undefined; + } + + interface AvifOptions extends OutputOptions { + /** quality, integer 1-100 (optional, default 50) */ + quality?: number | undefined; + /** use lossless compression (optional, default false) */ + lossless?: boolean | undefined; + /** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */ + effort?: number | undefined; + /** set to '4:2:0' to use chroma subsampling, requires libvips v8.11.0 (optional, default '4:4:4') */ + chromaSubsampling?: string | undefined; + /** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */ + bitdepth?: 8 | 10 | 12 | undefined; + } + + interface HeifOptions extends OutputOptions { + /** quality, integer 1-100 (optional, default 50) */ + quality?: number | undefined; + /** compression format: av1, hevc (optional, default 'av1') */ + compression?: HeifCompression | undefined; + /** use lossless compression (optional, default false) */ + lossless?: boolean | undefined; + /** Level of CPU effort to reduce file size, between 0 (fastest) and 9 (slowest) (optional, default 4) */ + effort?: number | undefined; + /** set to '4:2:0' to use chroma subsampling (optional, default '4:4:4') */ + chromaSubsampling?: string | undefined; + /** Set bitdepth to 8, 10 or 12 bit (optional, default 8) */ + bitdepth?: 8 | 10 | 12 | undefined; + } + + interface GifOptions extends OutputOptions, AnimationOptions { + /** Re-use existing palette, otherwise generate new (slow) */ + reuse?: boolean | undefined; + /** Use progressive (interlace) scan */ + progressive?: boolean | undefined; + /** Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */ + colours?: number | undefined; + /** Alternative spelling of "colours". Maximum number of palette entries, including transparency, between 2 and 256 (optional, default 256) */ + colors?: number | undefined; + /** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest) (optional, default 7) */ + effort?: number | undefined; + /** Level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most) (optional, default 1.0) */ + dither?: number | undefined; + /** Maximum inter-frame error for transparency, between 0 (lossless) and 32 (optional, default 0) */ + interFrameMaxError?: number | undefined; + /** Maximum inter-palette error for palette reuse, between 0 and 256 (optional, default 3) */ + interPaletteMaxError?: number | undefined; + /** Keep duplicate frames in the output instead of combining them (optional, default false) */ + keepDuplicateFrames?: boolean | undefined; + } + + interface TiffOptions extends OutputOptions { + /** Quality, integer 1-100 (optional, default 80) */ + quality?: number | undefined; + /** Compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k (optional, default 'jpeg') */ + compression?: string | undefined; + /** Use BigTIFF variant (has no effect when compression is none) (optional, default false) */ + bigtiff?: boolean | undefined; + /** Compression predictor options: none, horizontal, float (optional, default 'horizontal') */ + predictor?: string | undefined; + /** Write an image pyramid (optional, default false) */ + pyramid?: boolean | undefined; + /** Write a tiled tiff (optional, default false) */ + tile?: boolean | undefined; + /** Horizontal tile size (optional, default 256) */ + tileWidth?: number | undefined; + /** Vertical tile size (optional, default 256) */ + tileHeight?: number | undefined; + /** Horizontal resolution in pixels/mm (optional, default 1.0) */ + xres?: number | undefined; + /** Vertical resolution in pixels/mm (optional, default 1.0) */ + yres?: number | undefined; + /** Reduce bitdepth to 1, 2 or 4 bit (optional, default 8) */ + bitdepth?: 1 | 2 | 4 | 8 | undefined; + /** Write 1-bit images as miniswhite (optional, default false) */ + miniswhite?: boolean | undefined; + /** Resolution unit options: inch, cm (optional, default 'inch') */ + resolutionUnit?: Unit | undefined; + } + + interface PngOptions extends OutputOptions { + /** Use progressive (interlace) scan (optional, default false) */ + progressive?: boolean | undefined; + /** zlib compression level, 0-9 (optional, default 6) */ + compressionLevel?: number | undefined; + /** Use adaptive row filtering (optional, default false) */ + adaptiveFiltering?: boolean | undefined; + /** Use the lowest number of colours needed to achieve given quality (optional, default `100`) */ + quality?: number | undefined; + /** Level of CPU effort to reduce file size, between 1 (fastest) and 10 (slowest), sets palette to true (optional, default 7) */ + effort?: number | undefined; + /** Quantise to a palette-based image with alpha transparency support (optional, default false) */ + palette?: boolean | undefined; + /** Maximum number of palette entries (optional, default 256) */ + colours?: number | undefined; + /** Alternative Spelling of "colours". Maximum number of palette entries (optional, default 256) */ + colors?: number | undefined; + /** Level of Floyd-Steinberg error diffusion (optional, default 1.0) */ + dither?: number | undefined; + } + + interface RotateOptions { + /** parsed by the color module to extract values for red, green, blue and alpha. (optional, default "#000000") */ + background?: Colour | Color | undefined; + } + + type Precision = 'integer' | 'float' | 'approximate'; + + interface BlurOptions { + /** A value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2` */ + sigma: number; + /** A value between 0.001 and 1. A smaller value will generate a larger, more accurate mask. */ + minAmplitude?: number; + /** How accurate the operation should be, one of: integer, float, approximate. (optional, default "integer") */ + precision?: Precision | undefined; + } + + interface FlattenOptions { + /** background colour, parsed by the color module, defaults to black. (optional, default {r:0,g:0,b:0}) */ + background?: Colour | Color | undefined; + } + + interface NegateOptions { + /** whether or not to negate any alpha channel. (optional, default true) */ + alpha?: boolean | undefined; + } + + interface NormaliseOptions { + /** Percentile below which luminance values will be underexposed. */ + lower?: number | undefined; + /** Percentile above which luminance values will be overexposed. */ + upper?: number | undefined; + } + + interface ResizeOptions { + /** Alternative means of specifying width. If both are present this takes priority. */ + width?: number | undefined; + /** Alternative means of specifying height. If both are present this takes priority. */ + height?: number | undefined; + /** How the image should be resized to fit both provided dimensions, one of cover, contain, fill, inside or outside. (optional, default 'cover') */ + fit?: keyof FitEnum | undefined; + /** Position, gravity or strategy to use when fit is cover or contain. (optional, default 'centre') */ + position?: number | string | undefined; + /** Background colour when using a fit of contain, parsed by the color module, defaults to black without transparency. (optional, default {r:0,g:0,b:0,alpha:1}) */ + background?: Colour | Color | undefined; + /** The kernel to use for image reduction. (optional, default 'lanczos3') */ + kernel?: keyof KernelEnum | undefined; + /** Do not enlarge if the width or height are already less than the specified dimensions, equivalent to GraphicsMagick's > geometry option. (optional, default false) */ + withoutEnlargement?: boolean | undefined; + /** Do not reduce if the width or height are already greater than the specified dimensions, equivalent to GraphicsMagick's < geometry option. (optional, default false) */ + withoutReduction?: boolean | undefined; + /** Take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. (optional, default true) */ + fastShrinkOnLoad?: boolean | undefined; + } + + interface Region { + /** zero-indexed offset from left edge */ + left: number; + /** zero-indexed offset from top edge */ + top: number; + /** dimension of extracted image */ + width: number; + /** dimension of extracted image */ + height: number; + } + + interface Noise { + /** type of generated noise, currently only gaussian is supported. */ + type: 'gaussian'; + /** mean of pixels in generated noise. */ + mean?: number | undefined; + /** standard deviation of pixels in generated noise. */ + sigma?: number | undefined; + } + + type ExtendWith = 'background' | 'copy' | 'repeat' | 'mirror'; + + interface ExtendOptions { + /** single pixel count to top edge (optional, default 0) */ + top?: number | undefined; + /** single pixel count to left edge (optional, default 0) */ + left?: number | undefined; + /** single pixel count to bottom edge (optional, default 0) */ + bottom?: number | undefined; + /** single pixel count to right edge (optional, default 0) */ + right?: number | undefined; + /** background colour, parsed by the color module, defaults to black without transparency. (optional, default {r:0,g:0,b:0,alpha:1}) */ + background?: Colour | Color | undefined; + /** how the extension is done, one of: "background", "copy", "repeat", "mirror" (optional, default `'background'`) */ + extendWith?: ExtendWith | undefined; + } + + interface TrimOptions { + /** Background colour, parsed by the color module, defaults to that of the top-left pixel. (optional) */ + background?: Colour | Color | undefined; + /** Allowed difference from the above colour, a positive number. (optional, default 10) */ + threshold?: number | undefined; + /** Does the input more closely resemble line art (e.g. vector) rather than being photographic? (optional, default false) */ + lineArt?: boolean | undefined; + } + + interface RawOptions { + depth?: keyof DepthEnum; + } + + /** 1 for grayscale, 2 for grayscale + alpha, 3 for sRGB, 4 for CMYK or RGBA */ + type Channels = 1 | 2 | 3 | 4; + + interface RGBA { + r?: number | undefined; + g?: number | undefined; + b?: number | undefined; + alpha?: number | undefined; + } + + type Colour = string | RGBA; + type Color = Colour; + + interface Kernel { + /** width of the kernel in pixels. */ + width: number; + /** height of the kernel in pixels. */ + height: number; + /** Array of length width*height containing the kernel values. */ + kernel: ArrayLike; + /** the scale of the kernel in pixels. (optional, default sum) */ + scale?: number | undefined; + /** the offset of the kernel in pixels. (optional, default 0) */ + offset?: number | undefined; + } + + interface ClaheOptions { + /** width of the region */ + width: number; + /** height of the region */ + height: number; + /** max slope of the cumulative contrast. A value of 0 disables contrast limiting. Valid values are integers in the range 0-100 (inclusive) (optional, default 3) */ + maxSlope?: number | undefined; + } + + interface ThresholdOptions { + /** convert to single channel greyscale. (optional, default true) */ + greyscale?: boolean | undefined; + /** alternative spelling for greyscale. (optional, default true) */ + grayscale?: boolean | undefined; + } + + interface OverlayOptions extends SharpOptions { + /** Buffer containing image data, String containing the path to an image file, or Create object */ + input?: string | Buffer | { create: Create } | { text: CreateText } | { raw: CreateRaw } | undefined; + /** how to blend this image with the image below. (optional, default `'over'`) */ + blend?: Blend | undefined; + /** gravity at which to place the overlay. (optional, default 'centre') */ + gravity?: Gravity | undefined; + /** the pixel offset from the top edge. */ + top?: number | undefined; + /** the pixel offset from the left edge. */ + left?: number | undefined; + /** set to true to repeat the overlay image across the entire image with the given gravity. (optional, default false) */ + tile?: boolean | undefined; + /** Set to true to avoid premultipling the image below. Equivalent to the --premultiplied vips option. */ + premultiplied?: boolean | undefined; + /** number representing the DPI for vector overlay image. (optional, default 72)*/ + density?: number | undefined; + /** Set to true to read all frames/pages of an animated image. (optional, default false) */ + animated?: boolean | undefined; + /** see sharp() constructor, (optional, default 'warning') */ + failOn?: FailOnOptions | undefined; + /** see sharp() constructor, (optional, default 268402689) */ + limitInputPixels?: number | boolean | undefined; + /** see sharp() constructor, (optional, default false) */ + autoOrient?: boolean | undefined; + } + + interface TileOptions { + /** Tile size in pixels, a value between 1 and 8192. (optional, default 256) */ + size?: number | undefined; + /** Tile overlap in pixels, a value between 0 and 8192. (optional, default 0) */ + overlap?: number | undefined; + /** Tile angle of rotation, must be a multiple of 90. (optional, default 0) */ + angle?: number | undefined; + /** background colour, parsed by the color module, defaults to white without transparency. (optional, default {r:255,g:255,b:255,alpha:1}) */ + background?: string | RGBA | undefined; + /** How deep to make the pyramid, possible values are "onepixel", "onetile" or "one" (default based on layout) */ + depth?: string | undefined; + /** Threshold to skip tile generation, a value 0 - 255 for 8-bit images or 0 - 65535 for 16-bit images */ + skipBlanks?: number | undefined; + /** Tile container, with value fs (filesystem) or zip (compressed file). (optional, default 'fs') */ + container?: TileContainer | undefined; + /** Filesystem layout, possible values are dz, iiif, iiif3, zoomify or google. (optional, default 'dz') */ + layout?: TileLayout | undefined; + /** Centre image in tile. (optional, default false) */ + centre?: boolean | undefined; + /** Alternative spelling of centre. (optional, default false) */ + center?: boolean | undefined; + /** When layout is iiif/iiif3, sets the @id/id attribute of info.json (optional, default 'https://example.com/iiif') */ + id?: string | undefined; + /** The name of the directory within the zip file when container is `zip`. */ + basename?: string | undefined; + } + + interface AnimationOptions { + /** Number of animation iterations, a value between 0 and 65535. Use 0 for infinite animation. (optional, default 0) */ + loop?: number | undefined; + /** delay(s) between animation frames (in milliseconds), each value between 0 and 65535. (optional) */ + delay?: number | number[] | undefined; + } + + interface SharpenOptions { + /** The sigma of the Gaussian mask, where sigma = 1 + radius / 2, between 0.000001 and 10000 */ + sigma: number; + /** The level of sharpening to apply to "flat" areas, between 0 and 1000000 (optional, default 1.0) */ + m1?: number | undefined; + /** The level of sharpening to apply to "jagged" areas, between 0 and 1000000 (optional, default 2.0) */ + m2?: number | undefined; + /** Threshold between "flat" and "jagged", between 0 and 1000000 (optional, default 2.0) */ + x1?: number | undefined; + /** Maximum amount of brightening, between 0 and 1000000 (optional, default 10.0) */ + y2?: number | undefined; + /** Maximum amount of darkening, between 0 and 1000000 (optional, default 20.0) */ + y3?: number | undefined; + } + + interface AffineOptions { + /** Parsed by the color module to extract values for red, green, blue and alpha. (optional, default "#000000") */ + background?: string | object | undefined; + /** Input horizontal offset (optional, default 0) */ + idx?: number | undefined; + /** Input vertical offset (optional, default 0) */ + idy?: number | undefined; + /** Output horizontal offset (optional, default 0) */ + odx?: number | undefined; + /** Output horizontal offset (optional, default 0) */ + ody?: number | undefined; + /** Interpolator (optional, default sharp.interpolators.bicubic) */ + interpolator?: Interpolators[keyof Interpolators] | undefined; + } + + interface OutputInfo { + format: string; + size: number; + width: number; + height: number; + channels: Channels; + /** indicating if premultiplication was used */ + premultiplied: boolean; + /** Only defined when using a crop strategy */ + cropOffsetLeft?: number | undefined; + /** Only defined when using a crop strategy */ + cropOffsetTop?: number | undefined; + /** Only defined when using a trim method */ + trimOffsetLeft?: number | undefined; + /** Only defined when using a trim method */ + trimOffsetTop?: number | undefined; + /** DPI the font was rendered at, only defined when using `text` input */ + textAutofitDpi?: number | undefined; + /** When using the attention crop strategy, the focal point of the cropped region */ + attentionX?: number | undefined; + attentionY?: number | undefined; + /** Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP */ + pages?: number | undefined; + /** Number of pixels high each page in a multi-page image will be. */ + pageHeight?: number | undefined; + } + + interface AvailableFormatInfo { + id: string; + input: { file: boolean; buffer: boolean; stream: boolean; fileSuffix?: string[] }; + output: { file: boolean; buffer: boolean; stream: boolean; alias?: string[] }; + } + + interface FitEnum { + contain: 'contain'; + cover: 'cover'; + fill: 'fill'; + inside: 'inside'; + outside: 'outside'; + } + + interface KernelEnum { + nearest: 'nearest'; + cubic: 'cubic'; + linear: 'linear'; + mitchell: 'mitchell'; + lanczos2: 'lanczos2'; + lanczos3: 'lanczos3'; + mks2013: 'mks2013'; + mks2021: 'mks2021'; + } + + interface PresetEnum { + default: 'default'; + picture: 'picture'; + photo: 'photo'; + drawing: 'drawing'; + icon: 'icon'; + text: 'text'; + } + + interface BoolEnum { + and: 'and'; + or: 'or'; + eor: 'eor'; + } + + interface ColourspaceEnum { + 'b-w': string; + cmc: string; + cmyk: string; + fourier: string; + grey16: string; + histogram: string; + hsv: string; + lab: string; + labq: string; + labs: string; + lch: string; + matrix: string; + multiband: string; + rgb: string; + rgb16: string; + scrgb: string; + srgb: string; + xyz: string; + yxy: string; + } + + interface DepthEnum { + char: string; + complex: string; + double: string; + dpcomplex: string; + float: string; + int: string; + short: string; + uchar: string; + uint: string; + ushort: string; + } + + type FailOnOptions = 'none' | 'truncated' | 'error' | 'warning'; + + type TextAlign = 'left' | 'centre' | 'center' | 'right'; + + type TextWrap = 'word' | 'char' | 'word-char' | 'none'; + + type HorizontalAlignment = 'left' | 'centre' | 'center' | 'right'; + + type VerticalAlignment = 'top' | 'centre' | 'center' | 'bottom'; + + type TileContainer = 'fs' | 'zip'; + + type TileLayout = 'dz' | 'iiif' | 'iiif3' | 'zoomify' | 'google'; + + type Blend = + | 'clear' + | 'source' + | 'over' + | 'in' + | 'out' + | 'atop' + | 'dest' + | 'dest-over' + | 'dest-in' + | 'dest-out' + | 'dest-atop' + | 'xor' + | 'add' + | 'saturate' + | 'multiply' + | 'screen' + | 'overlay' + | 'darken' + | 'lighten' + | 'color-dodge' + | 'colour-dodge' + | 'color-burn' + | 'colour-burn' + | 'hard-light' + | 'soft-light' + | 'difference' + | 'exclusion'; + + type Gravity = number | string; + + interface GravityEnum { + north: number; + northeast: number; + southeast: number; + south: number; + southwest: number; + west: number; + northwest: number; + east: number; + center: number; + centre: number; + } + + interface StrategyEnum { + entropy: number; + attention: number; + } + + interface FormatEnum { + avif: AvailableFormatInfo; + dcraw: AvailableFormatInfo; + dz: AvailableFormatInfo; + exr: AvailableFormatInfo; + fits: AvailableFormatInfo; + gif: AvailableFormatInfo; + heif: AvailableFormatInfo; + input: AvailableFormatInfo; + jpeg: AvailableFormatInfo; + jpg: AvailableFormatInfo; + jp2: AvailableFormatInfo; + jxl: AvailableFormatInfo; + magick: AvailableFormatInfo; + openslide: AvailableFormatInfo; + pdf: AvailableFormatInfo; + png: AvailableFormatInfo; + ppm: AvailableFormatInfo; + rad: AvailableFormatInfo; + raw: AvailableFormatInfo; + svg: AvailableFormatInfo; + tiff: AvailableFormatInfo; + tif: AvailableFormatInfo; + v: AvailableFormatInfo; + webp: AvailableFormatInfo; + } + + interface CacheResult { + memory: { current: number; high: number; max: number }; + files: { current: number; max: number }; + items: { current: number; max: number }; + } + + interface Interpolators { + /** [Nearest neighbour interpolation](http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation). Suitable for image enlargement only. */ + nearest: 'nearest'; + /** [Bilinear interpolation](http://en.wikipedia.org/wiki/Bilinear_interpolation). Faster than bicubic but with less smooth results. */ + bilinear: 'bilinear'; + /** [Bicubic interpolation](http://en.wikipedia.org/wiki/Bicubic_interpolation) (the default). */ + bicubic: 'bicubic'; + /** + * [LBB interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/lbb.cpp#L100). + * Prevents some "[acutance](http://en.wikipedia.org/wiki/Acutance)" but typically reduces performance by a factor of 2. + */ + locallyBoundedBicubic: 'lbb'; + /** [Nohalo interpolation](http://eprints.soton.ac.uk/268086/). Prevents acutance but typically reduces performance by a factor of 3. */ + nohalo: 'nohalo'; + /** [VSQBS interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/vsqbs.cpp#L48). Prevents "staircasing" when enlarging. */ + vertexSplitQuadraticBasisSpline: 'vsqbs'; + } + + type Matrix2x2 = [[number, number], [number, number]]; + type Matrix3x3 = [[number, number, number], [number, number, number], [number, number, number]]; + type Matrix4x4 = [[number, number, number, number], [number, number, number, number], [number, number, number, number], [number, number, number, number]]; +} + +export = sharp; diff --git a/node_modules/sharp/lib/index.js b/node_modules/sharp/lib/index.js new file mode 100644 index 0000000..b80191d --- /dev/null +++ b/node_modules/sharp/lib/index.js @@ -0,0 +1,16 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const Sharp = require('./constructor'); +require('./input')(Sharp); +require('./resize')(Sharp); +require('./composite')(Sharp); +require('./operation')(Sharp); +require('./colour')(Sharp); +require('./channel')(Sharp); +require('./output')(Sharp); +require('./utility')(Sharp); + +module.exports = Sharp; diff --git a/node_modules/sharp/lib/input.js b/node_modules/sharp/lib/input.js new file mode 100644 index 0000000..728b718 --- /dev/null +++ b/node_modules/sharp/lib/input.js @@ -0,0 +1,809 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const is = require('./is'); +const sharp = require('./sharp'); + +/** + * Justification alignment + * @member + * @private + */ +const align = { + left: 'low', + top: 'low', + low: 'low', + center: 'centre', + centre: 'centre', + right: 'high', + bottom: 'high', + high: 'high' +}; + +const inputStreamParameters = [ + // Limits and error handling + 'failOn', 'limitInputPixels', 'unlimited', + // Format-generic + 'animated', 'autoOrient', 'density', 'ignoreIcc', 'page', 'pages', 'sequentialRead', + // Format-specific + 'jp2', 'openSlide', 'pdf', 'raw', 'svg', 'tiff', + // Deprecated + 'failOnError', 'openSlideLevel', 'pdfBackground', 'tiffSubifd' +]; + +/** + * Extract input options, if any, from an object. + * @private + */ +function _inputOptionsFromObject (obj) { + const params = inputStreamParameters + .filter(p => is.defined(obj[p])) + .map(p => ([p, obj[p]])); + return params.length + ? Object.fromEntries(params) + : undefined; +} + +/** + * Create Object containing input and input-related options. + * @private + */ +function _createInputDescriptor (input, inputOptions, containerOptions) { + const inputDescriptor = { + autoOrient: false, + failOn: 'warning', + limitInputPixels: 0x3FFF ** 2, + ignoreIcc: false, + unlimited: false, + sequentialRead: true + }; + if (is.string(input)) { + // filesystem + inputDescriptor.file = input; + } else if (is.buffer(input)) { + // Buffer + if (input.length === 0) { + throw Error('Input Buffer is empty'); + } + inputDescriptor.buffer = input; + } else if (is.arrayBuffer(input)) { + if (input.byteLength === 0) { + throw Error('Input bit Array is empty'); + } + inputDescriptor.buffer = Buffer.from(input, 0, input.byteLength); + } else if (is.typedArray(input)) { + if (input.length === 0) { + throw Error('Input Bit Array is empty'); + } + inputDescriptor.buffer = Buffer.from(input.buffer, input.byteOffset, input.byteLength); + } else if (is.plainObject(input) && !is.defined(inputOptions)) { + // Plain Object descriptor, e.g. create + inputOptions = input; + if (_inputOptionsFromObject(inputOptions)) { + // Stream with options + inputDescriptor.buffer = []; + } + } else if (!is.defined(input) && !is.defined(inputOptions) && is.object(containerOptions) && containerOptions.allowStream) { + // Stream without options + inputDescriptor.buffer = []; + } else if (Array.isArray(input)) { + if (input.length > 1) { + // Join images together + if (!this.options.joining) { + this.options.joining = true; + this.options.join = input.map(i => this._createInputDescriptor(i)); + } else { + throw new Error('Recursive join is unsupported'); + } + } else { + throw new Error('Expected at least two images to join'); + } + } else { + throw new Error(`Unsupported input '${input}' of type ${typeof input}${ + is.defined(inputOptions) ? ` when also providing options of type ${typeof inputOptions}` : '' + }`); + } + if (is.object(inputOptions)) { + // Deprecated: failOnError + if (is.defined(inputOptions.failOnError)) { + if (is.bool(inputOptions.failOnError)) { + inputDescriptor.failOn = inputOptions.failOnError ? 'warning' : 'none'; + } else { + throw is.invalidParameterError('failOnError', 'boolean', inputOptions.failOnError); + } + } + // failOn + if (is.defined(inputOptions.failOn)) { + if (is.string(inputOptions.failOn) && is.inArray(inputOptions.failOn, ['none', 'truncated', 'error', 'warning'])) { + inputDescriptor.failOn = inputOptions.failOn; + } else { + throw is.invalidParameterError('failOn', 'one of: none, truncated, error, warning', inputOptions.failOn); + } + } + // autoOrient + if (is.defined(inputOptions.autoOrient)) { + if (is.bool(inputOptions.autoOrient)) { + inputDescriptor.autoOrient = inputOptions.autoOrient; + } else { + throw is.invalidParameterError('autoOrient', 'boolean', inputOptions.autoOrient); + } + } + // Density + if (is.defined(inputOptions.density)) { + if (is.inRange(inputOptions.density, 1, 100000)) { + inputDescriptor.density = inputOptions.density; + } else { + throw is.invalidParameterError('density', 'number between 1 and 100000', inputOptions.density); + } + } + // Ignore embeddded ICC profile + if (is.defined(inputOptions.ignoreIcc)) { + if (is.bool(inputOptions.ignoreIcc)) { + inputDescriptor.ignoreIcc = inputOptions.ignoreIcc; + } else { + throw is.invalidParameterError('ignoreIcc', 'boolean', inputOptions.ignoreIcc); + } + } + // limitInputPixels + if (is.defined(inputOptions.limitInputPixels)) { + if (is.bool(inputOptions.limitInputPixels)) { + inputDescriptor.limitInputPixels = inputOptions.limitInputPixels + ? 0x3FFF ** 2 + : 0; + } else if (is.integer(inputOptions.limitInputPixels) && is.inRange(inputOptions.limitInputPixels, 0, Number.MAX_SAFE_INTEGER)) { + inputDescriptor.limitInputPixels = inputOptions.limitInputPixels; + } else { + throw is.invalidParameterError('limitInputPixels', 'positive integer', inputOptions.limitInputPixels); + } + } + // unlimited + if (is.defined(inputOptions.unlimited)) { + if (is.bool(inputOptions.unlimited)) { + inputDescriptor.unlimited = inputOptions.unlimited; + } else { + throw is.invalidParameterError('unlimited', 'boolean', inputOptions.unlimited); + } + } + // sequentialRead + if (is.defined(inputOptions.sequentialRead)) { + if (is.bool(inputOptions.sequentialRead)) { + inputDescriptor.sequentialRead = inputOptions.sequentialRead; + } else { + throw is.invalidParameterError('sequentialRead', 'boolean', inputOptions.sequentialRead); + } + } + // Raw pixel input + if (is.defined(inputOptions.raw)) { + if ( + is.object(inputOptions.raw) && + is.integer(inputOptions.raw.width) && inputOptions.raw.width > 0 && + is.integer(inputOptions.raw.height) && inputOptions.raw.height > 0 && + is.integer(inputOptions.raw.channels) && is.inRange(inputOptions.raw.channels, 1, 4) + ) { + inputDescriptor.rawWidth = inputOptions.raw.width; + inputDescriptor.rawHeight = inputOptions.raw.height; + inputDescriptor.rawChannels = inputOptions.raw.channels; + switch (input.constructor) { + case Uint8Array: + case Uint8ClampedArray: + inputDescriptor.rawDepth = 'uchar'; + break; + case Int8Array: + inputDescriptor.rawDepth = 'char'; + break; + case Uint16Array: + inputDescriptor.rawDepth = 'ushort'; + break; + case Int16Array: + inputDescriptor.rawDepth = 'short'; + break; + case Uint32Array: + inputDescriptor.rawDepth = 'uint'; + break; + case Int32Array: + inputDescriptor.rawDepth = 'int'; + break; + case Float32Array: + inputDescriptor.rawDepth = 'float'; + break; + case Float64Array: + inputDescriptor.rawDepth = 'double'; + break; + default: + inputDescriptor.rawDepth = 'uchar'; + break; + } + } else { + throw new Error('Expected width, height and channels for raw pixel input'); + } + inputDescriptor.rawPremultiplied = false; + if (is.defined(inputOptions.raw.premultiplied)) { + if (is.bool(inputOptions.raw.premultiplied)) { + inputDescriptor.rawPremultiplied = inputOptions.raw.premultiplied; + } else { + throw is.invalidParameterError('raw.premultiplied', 'boolean', inputOptions.raw.premultiplied); + } + } + inputDescriptor.rawPageHeight = 0; + if (is.defined(inputOptions.raw.pageHeight)) { + if (is.integer(inputOptions.raw.pageHeight) && inputOptions.raw.pageHeight > 0 && inputOptions.raw.pageHeight <= inputOptions.raw.height) { + if (inputOptions.raw.height % inputOptions.raw.pageHeight !== 0) { + throw new Error(`Expected raw.height ${inputOptions.raw.height} to be a multiple of raw.pageHeight ${inputOptions.raw.pageHeight}`); + } + inputDescriptor.rawPageHeight = inputOptions.raw.pageHeight; + } else { + throw is.invalidParameterError('raw.pageHeight', 'positive integer', inputOptions.raw.pageHeight); + } + } + } + // Multi-page input (GIF, TIFF, PDF) + if (is.defined(inputOptions.animated)) { + if (is.bool(inputOptions.animated)) { + inputDescriptor.pages = inputOptions.animated ? -1 : 1; + } else { + throw is.invalidParameterError('animated', 'boolean', inputOptions.animated); + } + } + if (is.defined(inputOptions.pages)) { + if (is.integer(inputOptions.pages) && is.inRange(inputOptions.pages, -1, 100000)) { + inputDescriptor.pages = inputOptions.pages; + } else { + throw is.invalidParameterError('pages', 'integer between -1 and 100000', inputOptions.pages); + } + } + if (is.defined(inputOptions.page)) { + if (is.integer(inputOptions.page) && is.inRange(inputOptions.page, 0, 100000)) { + inputDescriptor.page = inputOptions.page; + } else { + throw is.invalidParameterError('page', 'integer between 0 and 100000', inputOptions.page); + } + } + // OpenSlide specific options + if (is.object(inputOptions.openSlide) && is.defined(inputOptions.openSlide.level)) { + if (is.integer(inputOptions.openSlide.level) && is.inRange(inputOptions.openSlide.level, 0, 256)) { + inputDescriptor.openSlideLevel = inputOptions.openSlide.level; + } else { + throw is.invalidParameterError('openSlide.level', 'integer between 0 and 256', inputOptions.openSlide.level); + } + } else if (is.defined(inputOptions.level)) { + // Deprecated + if (is.integer(inputOptions.level) && is.inRange(inputOptions.level, 0, 256)) { + inputDescriptor.openSlideLevel = inputOptions.level; + } else { + throw is.invalidParameterError('level', 'integer between 0 and 256', inputOptions.level); + } + } + // TIFF specific options + if (is.object(inputOptions.tiff) && is.defined(inputOptions.tiff.subifd)) { + if (is.integer(inputOptions.tiff.subifd) && is.inRange(inputOptions.tiff.subifd, -1, 100000)) { + inputDescriptor.tiffSubifd = inputOptions.tiff.subifd; + } else { + throw is.invalidParameterError('tiff.subifd', 'integer between -1 and 100000', inputOptions.tiff.subifd); + } + } else if (is.defined(inputOptions.subifd)) { + // Deprecated + if (is.integer(inputOptions.subifd) && is.inRange(inputOptions.subifd, -1, 100000)) { + inputDescriptor.tiffSubifd = inputOptions.subifd; + } else { + throw is.invalidParameterError('subifd', 'integer between -1 and 100000', inputOptions.subifd); + } + } + // SVG specific options + if (is.object(inputOptions.svg)) { + if (is.defined(inputOptions.svg.stylesheet)) { + if (is.string(inputOptions.svg.stylesheet)) { + inputDescriptor.svgStylesheet = inputOptions.svg.stylesheet; + } else { + throw is.invalidParameterError('svg.stylesheet', 'string', inputOptions.svg.stylesheet); + } + } + if (is.defined(inputOptions.svg.highBitdepth)) { + if (is.bool(inputOptions.svg.highBitdepth)) { + inputDescriptor.svgHighBitdepth = inputOptions.svg.highBitdepth; + } else { + throw is.invalidParameterError('svg.highBitdepth', 'boolean', inputOptions.svg.highBitdepth); + } + } + } + // PDF specific options + if (is.object(inputOptions.pdf) && is.defined(inputOptions.pdf.background)) { + inputDescriptor.pdfBackground = this._getBackgroundColourOption(inputOptions.pdf.background); + } else if (is.defined(inputOptions.pdfBackground)) { + // Deprecated + inputDescriptor.pdfBackground = this._getBackgroundColourOption(inputOptions.pdfBackground); + } + // JPEG 2000 specific options + if (is.object(inputOptions.jp2) && is.defined(inputOptions.jp2.oneshot)) { + if (is.bool(inputOptions.jp2.oneshot)) { + inputDescriptor.jp2Oneshot = inputOptions.jp2.oneshot; + } else { + throw is.invalidParameterError('jp2.oneshot', 'boolean', inputOptions.jp2.oneshot); + } + } + // Create new image + if (is.defined(inputOptions.create)) { + if ( + is.object(inputOptions.create) && + is.integer(inputOptions.create.width) && inputOptions.create.width > 0 && + is.integer(inputOptions.create.height) && inputOptions.create.height > 0 && + is.integer(inputOptions.create.channels) + ) { + inputDescriptor.createWidth = inputOptions.create.width; + inputDescriptor.createHeight = inputOptions.create.height; + inputDescriptor.createChannels = inputOptions.create.channels; + inputDescriptor.createPageHeight = 0; + if (is.defined(inputOptions.create.pageHeight)) { + if (is.integer(inputOptions.create.pageHeight) && inputOptions.create.pageHeight > 0 && inputOptions.create.pageHeight <= inputOptions.create.height) { + if (inputOptions.create.height % inputOptions.create.pageHeight !== 0) { + throw new Error(`Expected create.height ${inputOptions.create.height} to be a multiple of create.pageHeight ${inputOptions.create.pageHeight}`); + } + inputDescriptor.createPageHeight = inputOptions.create.pageHeight; + } else { + throw is.invalidParameterError('create.pageHeight', 'positive integer', inputOptions.create.pageHeight); + } + } + // Noise + if (is.defined(inputOptions.create.noise)) { + if (!is.object(inputOptions.create.noise)) { + throw new Error('Expected noise to be an object'); + } + if (inputOptions.create.noise.type !== 'gaussian') { + throw new Error('Only gaussian noise is supported at the moment'); + } + inputDescriptor.createNoiseType = inputOptions.create.noise.type; + if (!is.inRange(inputOptions.create.channels, 1, 4)) { + throw is.invalidParameterError('create.channels', 'number between 1 and 4', inputOptions.create.channels); + } + inputDescriptor.createNoiseMean = 128; + if (is.defined(inputOptions.create.noise.mean)) { + if (is.number(inputOptions.create.noise.mean) && is.inRange(inputOptions.create.noise.mean, 0, 10000)) { + inputDescriptor.createNoiseMean = inputOptions.create.noise.mean; + } else { + throw is.invalidParameterError('create.noise.mean', 'number between 0 and 10000', inputOptions.create.noise.mean); + } + } + inputDescriptor.createNoiseSigma = 30; + if (is.defined(inputOptions.create.noise.sigma)) { + if (is.number(inputOptions.create.noise.sigma) && is.inRange(inputOptions.create.noise.sigma, 0, 10000)) { + inputDescriptor.createNoiseSigma = inputOptions.create.noise.sigma; + } else { + throw is.invalidParameterError('create.noise.sigma', 'number between 0 and 10000', inputOptions.create.noise.sigma); + } + } + } else if (is.defined(inputOptions.create.background)) { + if (!is.inRange(inputOptions.create.channels, 3, 4)) { + throw is.invalidParameterError('create.channels', 'number between 3 and 4', inputOptions.create.channels); + } + inputDescriptor.createBackground = this._getBackgroundColourOption(inputOptions.create.background); + } else { + throw new Error('Expected valid noise or background to create a new input image'); + } + delete inputDescriptor.buffer; + } else { + throw new Error('Expected valid width, height and channels to create a new input image'); + } + } + // Create a new image with text + if (is.defined(inputOptions.text)) { + if (is.object(inputOptions.text) && is.string(inputOptions.text.text)) { + inputDescriptor.textValue = inputOptions.text.text; + if (is.defined(inputOptions.text.height) && is.defined(inputOptions.text.dpi)) { + throw new Error('Expected only one of dpi or height'); + } + if (is.defined(inputOptions.text.font)) { + if (is.string(inputOptions.text.font)) { + inputDescriptor.textFont = inputOptions.text.font; + } else { + throw is.invalidParameterError('text.font', 'string', inputOptions.text.font); + } + } + if (is.defined(inputOptions.text.fontfile)) { + if (is.string(inputOptions.text.fontfile)) { + inputDescriptor.textFontfile = inputOptions.text.fontfile; + } else { + throw is.invalidParameterError('text.fontfile', 'string', inputOptions.text.fontfile); + } + } + if (is.defined(inputOptions.text.width)) { + if (is.integer(inputOptions.text.width) && inputOptions.text.width > 0) { + inputDescriptor.textWidth = inputOptions.text.width; + } else { + throw is.invalidParameterError('text.width', 'positive integer', inputOptions.text.width); + } + } + if (is.defined(inputOptions.text.height)) { + if (is.integer(inputOptions.text.height) && inputOptions.text.height > 0) { + inputDescriptor.textHeight = inputOptions.text.height; + } else { + throw is.invalidParameterError('text.height', 'positive integer', inputOptions.text.height); + } + } + if (is.defined(inputOptions.text.align)) { + if (is.string(inputOptions.text.align) && is.string(this.constructor.align[inputOptions.text.align])) { + inputDescriptor.textAlign = this.constructor.align[inputOptions.text.align]; + } else { + throw is.invalidParameterError('text.align', 'valid alignment', inputOptions.text.align); + } + } + if (is.defined(inputOptions.text.justify)) { + if (is.bool(inputOptions.text.justify)) { + inputDescriptor.textJustify = inputOptions.text.justify; + } else { + throw is.invalidParameterError('text.justify', 'boolean', inputOptions.text.justify); + } + } + if (is.defined(inputOptions.text.dpi)) { + if (is.integer(inputOptions.text.dpi) && is.inRange(inputOptions.text.dpi, 1, 1000000)) { + inputDescriptor.textDpi = inputOptions.text.dpi; + } else { + throw is.invalidParameterError('text.dpi', 'integer between 1 and 1000000', inputOptions.text.dpi); + } + } + if (is.defined(inputOptions.text.rgba)) { + if (is.bool(inputOptions.text.rgba)) { + inputDescriptor.textRgba = inputOptions.text.rgba; + } else { + throw is.invalidParameterError('text.rgba', 'bool', inputOptions.text.rgba); + } + } + if (is.defined(inputOptions.text.spacing)) { + if (is.integer(inputOptions.text.spacing) && is.inRange(inputOptions.text.spacing, -1000000, 1000000)) { + inputDescriptor.textSpacing = inputOptions.text.spacing; + } else { + throw is.invalidParameterError('text.spacing', 'integer between -1000000 and 1000000', inputOptions.text.spacing); + } + } + if (is.defined(inputOptions.text.wrap)) { + if (is.string(inputOptions.text.wrap) && is.inArray(inputOptions.text.wrap, ['word', 'char', 'word-char', 'none'])) { + inputDescriptor.textWrap = inputOptions.text.wrap; + } else { + throw is.invalidParameterError('text.wrap', 'one of: word, char, word-char, none', inputOptions.text.wrap); + } + } + delete inputDescriptor.buffer; + } else { + throw new Error('Expected a valid string to create an image with text.'); + } + } + // Join images together + if (is.defined(inputOptions.join)) { + if (is.defined(this.options.join)) { + if (is.defined(inputOptions.join.animated)) { + if (is.bool(inputOptions.join.animated)) { + inputDescriptor.joinAnimated = inputOptions.join.animated; + } else { + throw is.invalidParameterError('join.animated', 'boolean', inputOptions.join.animated); + } + } + if (is.defined(inputOptions.join.across)) { + if (is.integer(inputOptions.join.across) && is.inRange(inputOptions.join.across, 1, 1000000)) { + inputDescriptor.joinAcross = inputOptions.join.across; + } else { + throw is.invalidParameterError('join.across', 'integer between 1 and 100000', inputOptions.join.across); + } + } + if (is.defined(inputOptions.join.shim)) { + if (is.integer(inputOptions.join.shim) && is.inRange(inputOptions.join.shim, 0, 1000000)) { + inputDescriptor.joinShim = inputOptions.join.shim; + } else { + throw is.invalidParameterError('join.shim', 'integer between 0 and 100000', inputOptions.join.shim); + } + } + if (is.defined(inputOptions.join.background)) { + inputDescriptor.joinBackground = this._getBackgroundColourOption(inputOptions.join.background); + } + if (is.defined(inputOptions.join.halign)) { + if (is.string(inputOptions.join.halign) && is.string(this.constructor.align[inputOptions.join.halign])) { + inputDescriptor.joinHalign = this.constructor.align[inputOptions.join.halign]; + } else { + throw is.invalidParameterError('join.halign', 'valid alignment', inputOptions.join.halign); + } + } + if (is.defined(inputOptions.join.valign)) { + if (is.string(inputOptions.join.valign) && is.string(this.constructor.align[inputOptions.join.valign])) { + inputDescriptor.joinValign = this.constructor.align[inputOptions.join.valign]; + } else { + throw is.invalidParameterError('join.valign', 'valid alignment', inputOptions.join.valign); + } + } + } else { + throw new Error('Expected input to be an array of images to join'); + } + } + } else if (is.defined(inputOptions)) { + throw new Error(`Invalid input options ${inputOptions}`); + } + return inputDescriptor; +} + +/** + * Handle incoming Buffer chunk on Writable Stream. + * @private + * @param {Buffer} chunk + * @param {string} encoding - unused + * @param {Function} callback + */ +function _write (chunk, _encoding, callback) { + if (Array.isArray(this.options.input.buffer)) { + if (is.buffer(chunk)) { + if (this.options.input.buffer.length === 0) { + this.on('finish', () => { + this.streamInFinished = true; + }); + } + this.options.input.buffer.push(chunk); + callback(); + } else { + callback(new Error('Non-Buffer data on Writable Stream')); + } + } else { + callback(new Error('Unexpected data on Writable Stream')); + } +} + +/** + * Flattens the array of chunks accumulated in input.buffer. + * @private + */ +function _flattenBufferIn () { + if (this._isStreamInput()) { + this.options.input.buffer = Buffer.concat(this.options.input.buffer); + } +} + +/** + * Are we expecting Stream-based input? + * @private + * @returns {boolean} + */ +function _isStreamInput () { + return Array.isArray(this.options.input.buffer); +} + +/** + * Fast access to (uncached) image metadata without decoding any compressed pixel data. + * + * This is read from the header of the input image. + * It does not take into consideration any operations to be applied to the output image, + * such as resize or rotate. + * + * Dimensions in the response will respect the `page` and `pages` properties of the + * {@link /api-constructor/ constructor parameters}. + * + * A `Promise` is returned when `callback` is not provided. + * + * - `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg` + * - `size`: Total size of image in bytes, for Stream and Buffer input only + * - `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below) + * - `height`: Number of pixels high (EXIF orientation is not taken into consideration, see example below) + * - `space`: Name of colour space interpretation e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...](https://www.libvips.org/API/current/enum.Interpretation.html) + * - `channels`: Number of bands e.g. `3` for sRGB, `4` for CMYK + * - `depth`: Name of pixel depth format e.g. `uchar`, `char`, `ushort`, `float` [...](https://www.libvips.org/API/current/enum.BandFormat.html) + * - `density`: Number of pixels per inch (DPI), if present + * - `chromaSubsampling`: String containing JPEG chroma subsampling, `4:2:0` or `4:4:4` for RGB, `4:2:0:4` or `4:4:4:4` for CMYK + * - `isProgressive`: Boolean indicating whether the image is interlaced using a progressive scan + * - `isPalette`: Boolean indicating whether the image is palette-based (GIF, PNG). + * - `bitsPerSample`: Number of bits per sample for each channel (GIF, PNG, HEIF). + * - `pages`: Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP + * - `pageHeight`: Number of pixels high each page in a multi-page image will be. + * - `loop`: Number of times to loop an animated image, zero refers to a continuous loop. + * - `delay`: Delay in ms between each page in an animated image, provided as an array of integers. + * - `pagePrimary`: Number of the primary page in a HEIF image + * - `levels`: Details of each level in a multi-level image provided as an array of objects, requires libvips compiled with support for OpenSlide + * - `subifds`: Number of Sub Image File Directories in an OME-TIFF image + * - `background`: Default background colour, if present, for PNG (bKGD) and GIF images + * - `compression`: The encoder used to compress an HEIF file, `av1` (AVIF) or `hevc` (HEIC) + * - `resolutionUnit`: The unit of resolution (density), either `inch` or `cm`, if present + * - `hasProfile`: Boolean indicating the presence of an embedded ICC profile + * - `hasAlpha`: Boolean indicating the presence of an alpha transparency channel + * - `orientation`: Number value of the EXIF Orientation header, if present + * - `exif`: Buffer containing raw EXIF data, if present + * - `icc`: Buffer containing raw [ICC](https://www.npmjs.com/package/icc) profile data, if present + * - `iptc`: Buffer containing raw IPTC data, if present + * - `xmp`: Buffer containing raw XMP data, if present + * - `xmpAsString`: String containing XMP data, if valid UTF-8. + * - `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present + * - `formatMagick`: String containing format for images loaded via *magick + * - `comments`: Array of keyword/text pairs representing PNG text blocks, if present. + * + * @example + * const metadata = await sharp(input).metadata(); + * + * @example + * const image = sharp(inputJpg); + * image + * .metadata() + * .then(function(metadata) { + * return image + * .resize(Math.round(metadata.width / 2)) + * .webp() + * .toBuffer(); + * }) + * .then(function(data) { + * // data contains a WebP image half the width and height of the original JPEG + * }); + * + * @example + * // Get dimensions taking EXIF Orientation into account. + * const { autoOrient } = await sharp(input).metadata(); + * const { width, height } = autoOrient; + * + * @param {Function} [callback] - called with the arguments `(err, metadata)` + * @returns {Promise|Sharp} + */ +function metadata (callback) { + const stack = Error(); + if (is.fn(callback)) { + if (this._isStreamInput()) { + this.on('finish', () => { + this._flattenBufferIn(); + sharp.metadata(this.options, (err, metadata) => { + if (err) { + callback(is.nativeError(err, stack)); + } else { + callback(null, metadata); + } + }); + }); + } else { + sharp.metadata(this.options, (err, metadata) => { + if (err) { + callback(is.nativeError(err, stack)); + } else { + callback(null, metadata); + } + }); + } + return this; + } else { + if (this._isStreamInput()) { + return new Promise((resolve, reject) => { + const finished = () => { + this._flattenBufferIn(); + sharp.metadata(this.options, (err, metadata) => { + if (err) { + reject(is.nativeError(err, stack)); + } else { + resolve(metadata); + } + }); + }; + if (this.writableFinished) { + finished(); + } else { + this.once('finish', finished); + } + }); + } else { + return new Promise((resolve, reject) => { + sharp.metadata(this.options, (err, metadata) => { + if (err) { + reject(is.nativeError(err, stack)); + } else { + resolve(metadata); + } + }); + }); + } + } +} + +/** + * Access to pixel-derived image statistics for every channel in the image. + * A `Promise` is returned when `callback` is not provided. + * + * - `channels`: Array of channel statistics for each channel in the image. Each channel statistic contains + * - `min` (minimum value in the channel) + * - `max` (maximum value in the channel) + * - `sum` (sum of all values in a channel) + * - `squaresSum` (sum of squared values in a channel) + * - `mean` (mean of the values in a channel) + * - `stdev` (standard deviation for the values in a channel) + * - `minX` (x-coordinate of one of the pixel where the minimum lies) + * - `minY` (y-coordinate of one of the pixel where the minimum lies) + * - `maxX` (x-coordinate of one of the pixel where the maximum lies) + * - `maxY` (y-coordinate of one of the pixel where the maximum lies) + * - `isOpaque`: Is the image fully opaque? Will be `true` if the image has no alpha channel or if every pixel is fully opaque. + * - `entropy`: Histogram-based estimation of greyscale entropy, discarding alpha channel if any. + * - `sharpness`: Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any. + * - `dominant`: Object containing most dominant sRGB colour based on a 4096-bin 3D histogram. + * + * **Note**: Statistics are derived from the original input image. Any operations performed on the image must first be + * written to a buffer in order to run `stats` on the result (see third example). + * + * @example + * const image = sharp(inputJpg); + * image + * .stats() + * .then(function(stats) { + * // stats contains the channel-wise statistics array and the isOpaque value + * }); + * + * @example + * const { entropy, sharpness, dominant } = await sharp(input).stats(); + * const { r, g, b } = dominant; + * + * @example + * const image = sharp(input); + * // store intermediate result + * const part = await image.extract(region).toBuffer(); + * // create new instance to obtain statistics of extracted region + * const stats = await sharp(part).stats(); + * + * @param {Function} [callback] - called with the arguments `(err, stats)` + * @returns {Promise} + */ +function stats (callback) { + const stack = Error(); + if (is.fn(callback)) { + if (this._isStreamInput()) { + this.on('finish', () => { + this._flattenBufferIn(); + sharp.stats(this.options, (err, stats) => { + if (err) { + callback(is.nativeError(err, stack)); + } else { + callback(null, stats); + } + }); + }); + } else { + sharp.stats(this.options, (err, stats) => { + if (err) { + callback(is.nativeError(err, stack)); + } else { + callback(null, stats); + } + }); + } + return this; + } else { + if (this._isStreamInput()) { + return new Promise((resolve, reject) => { + this.on('finish', function () { + this._flattenBufferIn(); + sharp.stats(this.options, (err, stats) => { + if (err) { + reject(is.nativeError(err, stack)); + } else { + resolve(stats); + } + }); + }); + }); + } else { + return new Promise((resolve, reject) => { + sharp.stats(this.options, (err, stats) => { + if (err) { + reject(is.nativeError(err, stack)); + } else { + resolve(stats); + } + }); + }); + } + } +} + +/** + * Decorate the Sharp prototype with input-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Object.assign(Sharp.prototype, { + // Private + _inputOptionsFromObject, + _createInputDescriptor, + _write, + _flattenBufferIn, + _isStreamInput, + // Public + metadata, + stats + }); + // Class attributes + Sharp.align = align; +}; diff --git a/node_modules/sharp/lib/is.js b/node_modules/sharp/lib/is.js new file mode 100644 index 0000000..3ac9a1a --- /dev/null +++ b/node_modules/sharp/lib/is.js @@ -0,0 +1,143 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +/** + * Is this value defined and not null? + * @private + */ +const defined = (val) => typeof val !== 'undefined' && val !== null; + +/** + * Is this value an object? + * @private + */ +const object = (val) => typeof val === 'object'; + +/** + * Is this value a plain object? + * @private + */ +const plainObject = (val) => Object.prototype.toString.call(val) === '[object Object]'; + +/** + * Is this value a function? + * @private + */ +const fn = (val) => typeof val === 'function'; + +/** + * Is this value a boolean? + * @private + */ +const bool = (val) => typeof val === 'boolean'; + +/** + * Is this value a Buffer object? + * @private + */ +const buffer = (val) => val instanceof Buffer; + +/** + * Is this value a typed array object?. E.g. Uint8Array or Uint8ClampedArray? + * @private + */ +const typedArray = (val) => { + if (defined(val)) { + switch (val.constructor) { + case Uint8Array: + case Uint8ClampedArray: + case Int8Array: + case Uint16Array: + case Int16Array: + case Uint32Array: + case Int32Array: + case Float32Array: + case Float64Array: + return true; + } + } + + return false; +}; + +/** + * Is this value an ArrayBuffer object? + * @private + */ +const arrayBuffer = (val) => val instanceof ArrayBuffer; + +/** + * Is this value a non-empty string? + * @private + */ +const string = (val) => typeof val === 'string' && val.length > 0; + +/** + * Is this value a real number? + * @private + */ +const number = (val) => typeof val === 'number' && !Number.isNaN(val); + +/** + * Is this value an integer? + * @private + */ +const integer = (val) => Number.isInteger(val); + +/** + * Is this value within an inclusive given range? + * @private + */ +const inRange = (val, min, max) => val >= min && val <= max; + +/** + * Is this value within the elements of an array? + * @private + */ +const inArray = (val, list) => list.includes(val); + +/** + * Create an Error with a message relating to an invalid parameter. + * + * @param {string} name - parameter name. + * @param {string} expected - description of the type/value/range expected. + * @param {*} actual - the value received. + * @returns {Error} Containing the formatted message. + * @private + */ +const invalidParameterError = (name, expected, actual) => new Error( + `Expected ${expected} for ${name} but received ${actual} of type ${typeof actual}` + ); + +/** + * Ensures an Error from C++ contains a JS stack. + * + * @param {Error} native - Error with message from C++. + * @param {Error} context - Error with stack from JS. + * @returns {Error} Error with message and stack. + * @private + */ +const nativeError = (native, context) => { + context.message = native.message; + return context; +}; + +module.exports = { + defined, + object, + plainObject, + fn, + bool, + buffer, + typedArray, + arrayBuffer, + string, + number, + integer, + inRange, + inArray, + invalidParameterError, + nativeError +}; diff --git a/node_modules/sharp/lib/libvips.js b/node_modules/sharp/lib/libvips.js new file mode 100644 index 0000000..881dc5c --- /dev/null +++ b/node_modules/sharp/lib/libvips.js @@ -0,0 +1,207 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const { spawnSync } = require('node:child_process'); +const { createHash } = require('node:crypto'); +const semverCoerce = require('semver/functions/coerce'); +const semverGreaterThanOrEqualTo = require('semver/functions/gte'); +const semverSatisfies = require('semver/functions/satisfies'); +const detectLibc = require('detect-libc'); + +const { config, engines, optionalDependencies } = require('../package.json'); + +/* node:coverage ignore next */ +const minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || config.libvips; +const minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version; + +const prebuiltPlatforms = [ + 'darwin-arm64', 'darwin-x64', + 'linux-arm', 'linux-arm64', 'linux-ppc64', 'linux-riscv64', 'linux-s390x', 'linux-x64', + 'linuxmusl-arm64', 'linuxmusl-x64', + 'win32-arm64', 'win32-ia32', 'win32-x64' +]; + +const spawnSyncOptions = { + encoding: 'utf8', + shell: true +}; + +const log = (item) => { + if (item instanceof Error) { + console.error(`sharp: Installation error: ${item.message}`); + } else { + console.log(`sharp: ${item}`); + } +}; + +/* node:coverage ignore next */ +const runtimeLibc = () => detectLibc.isNonGlibcLinuxSync() ? detectLibc.familySync() : ''; + +const runtimePlatformArch = () => `${process.platform}${runtimeLibc()}-${process.arch}`; + +const buildPlatformArch = () => { + /* node:coverage ignore next 3 */ + if (isEmscripten()) { + return 'wasm32'; + } + const { npm_config_arch, npm_config_platform, npm_config_libc } = process.env; + const libc = typeof npm_config_libc === 'string' ? npm_config_libc : runtimeLibc(); + return `${npm_config_platform || process.platform}${libc}-${npm_config_arch || process.arch}`; +}; + +const buildSharpLibvipsIncludeDir = () => { + try { + return require(`@img/sharp-libvips-dev-${buildPlatformArch()}/include`); + } catch { + /* node:coverage ignore next 5 */ + try { + return require('@img/sharp-libvips-dev/include'); + } catch {} + } + return ''; +}; + +const buildSharpLibvipsCPlusPlusDir = () => { + /* node:coverage ignore next 4 */ + try { + return require('@img/sharp-libvips-dev/cplusplus'); + } catch {} + return ''; +}; + +const buildSharpLibvipsLibDir = () => { + try { + return require(`@img/sharp-libvips-dev-${buildPlatformArch()}/lib`); + } catch { + /* node:coverage ignore next 5 */ + try { + return require(`@img/sharp-libvips-${buildPlatformArch()}/lib`); + } catch {} + } + return ''; +}; + +/* node:coverage disable */ + +const isUnsupportedNodeRuntime = () => { + if (process.release?.name === 'node' && process.versions) { + if (!semverSatisfies(process.versions.node, engines.node)) { + return { found: process.versions.node, expected: engines.node }; + } + } +}; + +const isEmscripten = () => { + const { CC } = process.env; + return Boolean(CC?.endsWith('/emcc')); +}; + +const isRosetta = () => { + if (process.platform === 'darwin' && process.arch === 'x64') { + const translated = spawnSync('sysctl sysctl.proc_translated', spawnSyncOptions).stdout; + return (translated || '').trim() === 'sysctl.proc_translated: 1'; + } + return false; +}; + +/* node:coverage enable */ + +const sha512 = (s) => createHash('sha512').update(s).digest('hex'); + +const yarnLocator = () => { + try { + const identHash = sha512(`imgsharp-libvips-${buildPlatformArch()}`); + const npmVersion = semverCoerce(optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`], { + includePrerelease: true + }).version; + return sha512(`${identHash}npm:${npmVersion}`).slice(0, 10); + } catch {} + return ''; +}; + +/* node:coverage disable */ + +const spawnRebuild = () => + spawnSync(`node-gyp rebuild --directory=src ${isEmscripten() ? '--nodedir=emscripten' : ''}`, { + ...spawnSyncOptions, + stdio: 'inherit' + }).status; + +const globalLibvipsVersion = () => { + if (process.platform !== 'win32') { + const globalLibvipsVersion = spawnSync('pkg-config --modversion vips-cpp', { + ...spawnSyncOptions, + env: { + ...process.env, + PKG_CONFIG_PATH: pkgConfigPath() + } + }).stdout; + return (globalLibvipsVersion || '').trim(); + } else { + return ''; + } +}; + +/* node:coverage enable */ + +const pkgConfigPath = () => { + if (process.platform !== 'win32') { + /* node:coverage ignore next 4 */ + const brewPkgConfigPath = spawnSync( + 'which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', + spawnSyncOptions + ).stdout || ''; + return [ + brewPkgConfigPath.trim(), + process.env.PKG_CONFIG_PATH, + '/usr/local/lib/pkgconfig', + '/usr/lib/pkgconfig', + '/usr/local/libdata/pkgconfig', + '/usr/libdata/pkgconfig' + ].filter(Boolean).join(':'); + } else { + return ''; + } +}; + +const skipSearch = (status, reason, logger) => { + if (logger) { + logger(`Detected ${reason}, skipping search for globally-installed libvips`); + } + return status; +}; + +const useGlobalLibvips = (logger) => { + if (Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS) === true) { + return skipSearch(false, 'SHARP_IGNORE_GLOBAL_LIBVIPS', logger); + } + if (Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS) === true) { + return skipSearch(true, 'SHARP_FORCE_GLOBAL_LIBVIPS', logger); + } + /* node:coverage ignore next 3 */ + if (isRosetta()) { + return skipSearch(false, 'Rosetta', logger); + } + const globalVipsVersion = globalLibvipsVersion(); + /* node:coverage ignore next */ + return !!globalVipsVersion && semverGreaterThanOrEqualTo(globalVipsVersion, minimumLibvipsVersion); +}; + +module.exports = { + minimumLibvipsVersion, + prebuiltPlatforms, + buildPlatformArch, + buildSharpLibvipsIncludeDir, + buildSharpLibvipsCPlusPlusDir, + buildSharpLibvipsLibDir, + isUnsupportedNodeRuntime, + runtimePlatformArch, + log, + yarnLocator, + spawnRebuild, + globalLibvipsVersion, + pkgConfigPath, + useGlobalLibvips +}; diff --git a/node_modules/sharp/lib/operation.js b/node_modules/sharp/lib/operation.js new file mode 100644 index 0000000..ebbf54e --- /dev/null +++ b/node_modules/sharp/lib/operation.js @@ -0,0 +1,1016 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const is = require('./is'); + +/** + * How accurate an operation should be. + * @member + * @private + */ +const vipsPrecision = { + integer: 'integer', + float: 'float', + approximate: 'approximate' +}; + +/** + * Rotate the output image. + * + * The provided angle is converted to a valid positive degree rotation. + * For example, `-450` will produce a 270 degree rotation. + * + * When rotating by an angle other than a multiple of 90, + * the background colour can be provided with the `background` option. + * + * For backwards compatibility, if no angle is provided, `.autoOrient()` will be called. + * + * Only one rotation can occur per pipeline (aside from an initial call without + * arguments to orient via EXIF data). Previous calls to `rotate` in the same + * pipeline will be ignored. + * + * Multi-page images can only be rotated by 180 degrees. + * + * Method order is important when rotating, resizing and/or extracting regions, + * for example `.rotate(x).extract(y)` will produce a different result to `.extract(y).rotate(x)`. + * + * @example + * const rotateThenResize = await sharp(input) + * .rotate(90) + * .resize({ width: 16, height: 8, fit: 'fill' }) + * .toBuffer(); + * const resizeThenRotate = await sharp(input) + * .resize({ width: 16, height: 8, fit: 'fill' }) + * .rotate(90) + * .toBuffer(); + * + * @param {number} [angle=auto] angle of rotation. + * @param {Object} [options] - if present, is an Object with optional attributes. + * @param {string|Object} [options.background="#000000"] parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function rotate (angle, options) { + if (!is.defined(angle)) { + return this.autoOrient(); + } + if (this.options.angle || this.options.rotationAngle) { + this.options.debuglog('ignoring previous rotate options'); + this.options.angle = 0; + this.options.rotationAngle = 0; + } + if (is.integer(angle) && !(angle % 90)) { + this.options.angle = angle; + } else if (is.number(angle)) { + this.options.rotationAngle = angle; + if (is.object(options) && options.background) { + this._setBackgroundColourOption('rotationBackground', options.background); + } + } else { + throw is.invalidParameterError('angle', 'numeric', angle); + } + return this; +} + +/** + * Auto-orient based on the EXIF `Orientation` tag, then remove the tag. + * Mirroring is supported and may infer the use of a flip operation. + * + * Previous or subsequent use of `rotate(angle)` and either `flip()` or `flop()` + * will logically occur after auto-orientation, regardless of call order. + * + * @example + * const output = await sharp(input).autoOrient().toBuffer(); + * + * @example + * const pipeline = sharp() + * .autoOrient() + * .resize(null, 200) + * .toBuffer(function (err, outputBuffer, info) { + * // outputBuffer contains 200px high JPEG image data, + * // auto-oriented using EXIF Orientation tag + * // info.width and info.height contain the dimensions of the resized image + * }); + * readableStream.pipe(pipeline); + * + * @returns {Sharp} + */ +function autoOrient () { + this.options.input.autoOrient = true; + return this; +} + +/** + * Mirror the image vertically (up-down) about the x-axis. + * This always occurs before rotation, if any. + * + * This operation does not work correctly with multi-page images. + * + * @example + * const output = await sharp(input).flip().toBuffer(); + * + * @param {Boolean} [flip=true] + * @returns {Sharp} + */ +function flip (flip) { + this.options.flip = is.bool(flip) ? flip : true; + return this; +} + +/** + * Mirror the image horizontally (left-right) about the y-axis. + * This always occurs before rotation, if any. + * + * @example + * const output = await sharp(input).flop().toBuffer(); + * + * @param {Boolean} [flop=true] + * @returns {Sharp} + */ +function flop (flop) { + this.options.flop = is.bool(flop) ? flop : true; + return this; +} + +/** + * Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any. + * + * You must provide an array of length 4 or a 2x2 affine transformation matrix. + * By default, new pixels are filled with a black background. You can provide a background colour with the `background` option. + * A particular interpolator may also be specified. Set the `interpolator` option to an attribute of the `sharp.interpolators` Object e.g. `sharp.interpolators.nohalo`. + * + * In the case of a 2x2 matrix, the transform is: + * - X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx` + * - Y = `matrix[1, 0]` \* (x + `idx`) + `matrix[1, 1]` \* (y + `idy`) + `ody` + * + * where: + * - x and y are the coordinates in input image. + * - X and Y are the coordinates in output image. + * - (0,0) is the upper left corner. + * + * @since 0.27.0 + * + * @example + * const pipeline = sharp() + * .affine([[1, 0.3], [0.1, 0.7]], { + * background: 'white', + * interpolator: sharp.interpolators.nohalo + * }) + * .toBuffer((err, outputBuffer, info) => { + * // outputBuffer contains the transformed image + * // info.width and info.height contain the new dimensions + * }); + * + * inputStream + * .pipe(pipeline); + * + * @param {Array>|Array} matrix - affine transformation matrix + * @param {Object} [options] - if present, is an Object with optional attributes. + * @param {String|Object} [options.background="#000000"] - parsed by the [color](https://www.npmjs.org/package/color) module to extract values for red, green, blue and alpha. + * @param {Number} [options.idx=0] - input horizontal offset + * @param {Number} [options.idy=0] - input vertical offset + * @param {Number} [options.odx=0] - output horizontal offset + * @param {Number} [options.ody=0] - output vertical offset + * @param {String} [options.interpolator=sharp.interpolators.bicubic] - interpolator + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function affine (matrix, options) { + const flatMatrix = [].concat(...matrix); + if (flatMatrix.length === 4 && flatMatrix.every(is.number)) { + this.options.affineMatrix = flatMatrix; + } else { + throw is.invalidParameterError('matrix', '1x4 or 2x2 array', matrix); + } + + if (is.defined(options)) { + if (is.object(options)) { + this._setBackgroundColourOption('affineBackground', options.background); + if (is.defined(options.idx)) { + if (is.number(options.idx)) { + this.options.affineIdx = options.idx; + } else { + throw is.invalidParameterError('options.idx', 'number', options.idx); + } + } + if (is.defined(options.idy)) { + if (is.number(options.idy)) { + this.options.affineIdy = options.idy; + } else { + throw is.invalidParameterError('options.idy', 'number', options.idy); + } + } + if (is.defined(options.odx)) { + if (is.number(options.odx)) { + this.options.affineOdx = options.odx; + } else { + throw is.invalidParameterError('options.odx', 'number', options.odx); + } + } + if (is.defined(options.ody)) { + if (is.number(options.ody)) { + this.options.affineOdy = options.ody; + } else { + throw is.invalidParameterError('options.ody', 'number', options.ody); + } + } + if (is.defined(options.interpolator)) { + if (is.inArray(options.interpolator, Object.values(this.constructor.interpolators))) { + this.options.affineInterpolator = options.interpolator; + } else { + throw is.invalidParameterError('options.interpolator', 'valid interpolator name', options.interpolator); + } + } + } else { + throw is.invalidParameterError('options', 'object', options); + } + } + + return this; +} + +/** + * Sharpen the image. + * + * When used without parameters, performs a fast, mild sharpen of the output image. + * + * When a `sigma` is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space. + * Fine-grained control over the level of sharpening in "flat" (m1) and "jagged" (m2) areas is available. + * + * See {@link https://www.libvips.org/API/current/method.Image.sharpen.html libvips sharpen} operation. + * + * @example + * const data = await sharp(input).sharpen().toBuffer(); + * + * @example + * const data = await sharp(input).sharpen({ sigma: 2 }).toBuffer(); + * + * @example + * const data = await sharp(input) + * .sharpen({ + * sigma: 2, + * m1: 0, + * m2: 3, + * x1: 3, + * y2: 15, + * y3: 15, + * }) + * .toBuffer(); + * + * @param {Object|number} [options] - if present, is an Object with attributes + * @param {number} [options.sigma] - the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`, between 0.000001 and 10 + * @param {number} [options.m1=1.0] - the level of sharpening to apply to "flat" areas, between 0 and 1000000 + * @param {number} [options.m2=2.0] - the level of sharpening to apply to "jagged" areas, between 0 and 1000000 + * @param {number} [options.x1=2.0] - threshold between "flat" and "jagged", between 0 and 1000000 + * @param {number} [options.y2=10.0] - maximum amount of brightening, between 0 and 1000000 + * @param {number} [options.y3=20.0] - maximum amount of darkening, between 0 and 1000000 + * @param {number} [flat] - (deprecated) see `options.m1`. + * @param {number} [jagged] - (deprecated) see `options.m2`. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function sharpen (options, flat, jagged) { + if (!is.defined(options)) { + // No arguments: default to mild sharpen + this.options.sharpenSigma = -1; + } else if (is.bool(options)) { + // Deprecated boolean argument: apply mild sharpen? + this.options.sharpenSigma = options ? -1 : 0; + } else if (is.number(options) && is.inRange(options, 0.01, 10000)) { + // Deprecated numeric argument: specific sigma + this.options.sharpenSigma = options; + // Deprecated control over flat areas + if (is.defined(flat)) { + if (is.number(flat) && is.inRange(flat, 0, 10000)) { + this.options.sharpenM1 = flat; + } else { + throw is.invalidParameterError('flat', 'number between 0 and 10000', flat); + } + } + // Deprecated control over jagged areas + if (is.defined(jagged)) { + if (is.number(jagged) && is.inRange(jagged, 0, 10000)) { + this.options.sharpenM2 = jagged; + } else { + throw is.invalidParameterError('jagged', 'number between 0 and 10000', jagged); + } + } + } else if (is.plainObject(options)) { + if (is.number(options.sigma) && is.inRange(options.sigma, 0.000001, 10)) { + this.options.sharpenSigma = options.sigma; + } else { + throw is.invalidParameterError('options.sigma', 'number between 0.000001 and 10', options.sigma); + } + if (is.defined(options.m1)) { + if (is.number(options.m1) && is.inRange(options.m1, 0, 1000000)) { + this.options.sharpenM1 = options.m1; + } else { + throw is.invalidParameterError('options.m1', 'number between 0 and 1000000', options.m1); + } + } + if (is.defined(options.m2)) { + if (is.number(options.m2) && is.inRange(options.m2, 0, 1000000)) { + this.options.sharpenM2 = options.m2; + } else { + throw is.invalidParameterError('options.m2', 'number between 0 and 1000000', options.m2); + } + } + if (is.defined(options.x1)) { + if (is.number(options.x1) && is.inRange(options.x1, 0, 1000000)) { + this.options.sharpenX1 = options.x1; + } else { + throw is.invalidParameterError('options.x1', 'number between 0 and 1000000', options.x1); + } + } + if (is.defined(options.y2)) { + if (is.number(options.y2) && is.inRange(options.y2, 0, 1000000)) { + this.options.sharpenY2 = options.y2; + } else { + throw is.invalidParameterError('options.y2', 'number between 0 and 1000000', options.y2); + } + } + if (is.defined(options.y3)) { + if (is.number(options.y3) && is.inRange(options.y3, 0, 1000000)) { + this.options.sharpenY3 = options.y3; + } else { + throw is.invalidParameterError('options.y3', 'number between 0 and 1000000', options.y3); + } + } + } else { + throw is.invalidParameterError('sigma', 'number between 0.01 and 10000', options); + } + return this; +} + +/** + * Apply median filter. + * When used without parameters the default window is 3x3. + * + * @example + * const output = await sharp(input).median().toBuffer(); + * + * @example + * const output = await sharp(input).median(5).toBuffer(); + * + * @param {number} [size=3] square mask size: size x size + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function median (size) { + if (!is.defined(size)) { + // No arguments: default to 3x3 + this.options.medianSize = 3; + } else if (is.integer(size) && is.inRange(size, 1, 1000)) { + // Numeric argument: specific sigma + this.options.medianSize = size; + } else { + throw is.invalidParameterError('size', 'integer between 1 and 1000', size); + } + return this; +} + +/** + * Blur the image. + * + * When used without parameters, performs a fast 3x3 box blur (equivalent to a box linear filter). + * + * When a `sigma` is provided, performs a slower, more accurate Gaussian blur. + * + * @example + * const boxBlurred = await sharp(input) + * .blur() + * .toBuffer(); + * + * @example + * const gaussianBlurred = await sharp(input) + * .blur(5) + * .toBuffer(); + * + * @param {Object|number|Boolean} [options] + * @param {number} [options.sigma] a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`. + * @param {string} [options.precision='integer'] How accurate the operation should be, one of: integer, float, approximate. + * @param {number} [options.minAmplitude=0.2] A value between 0.001 and 1. A smaller value will generate a larger, more accurate mask. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function blur (options) { + let sigma; + if (is.number(options)) { + sigma = options; + } else if (is.plainObject(options)) { + if (!is.number(options.sigma)) { + throw is.invalidParameterError('options.sigma', 'number between 0.3 and 1000', sigma); + } + sigma = options.sigma; + if ('precision' in options) { + if (is.string(vipsPrecision[options.precision])) { + this.options.precision = vipsPrecision[options.precision]; + } else { + throw is.invalidParameterError('precision', 'one of: integer, float, approximate', options.precision); + } + } + if ('minAmplitude' in options) { + if (is.number(options.minAmplitude) && is.inRange(options.minAmplitude, 0.001, 1)) { + this.options.minAmpl = options.minAmplitude; + } else { + throw is.invalidParameterError('minAmplitude', 'number between 0.001 and 1', options.minAmplitude); + } + } + } + + if (!is.defined(options)) { + // No arguments: default to mild blur + this.options.blurSigma = -1; + } else if (is.bool(options)) { + // Boolean argument: apply mild blur? + this.options.blurSigma = options ? -1 : 0; + } else if (is.number(sigma) && is.inRange(sigma, 0.3, 1000)) { + // Numeric argument: specific sigma + this.options.blurSigma = sigma; + } else { + throw is.invalidParameterError('sigma', 'number between 0.3 and 1000', sigma); + } + + return this; +} + +/** + * Expand foreground objects using the dilate morphological operator. + * + * @example + * const output = await sharp(input) + * .dilate() + * .toBuffer(); + * + * @param {Number} [width=1] dilation width in pixels. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function dilate (width) { + if (!is.defined(width)) { + this.options.dilateWidth = 1; + } else if (is.integer(width) && width > 0) { + this.options.dilateWidth = width; + } else { + throw is.invalidParameterError('dilate', 'positive integer', dilate); + } + return this; +} + +/** + * Shrink foreground objects using the erode morphological operator. + * + * @example + * const output = await sharp(input) + * .erode() + * .toBuffer(); + * + * @param {Number} [width=1] erosion width in pixels. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function erode (width) { + if (!is.defined(width)) { + this.options.erodeWidth = 1; + } else if (is.integer(width) && width > 0) { + this.options.erodeWidth = width; + } else { + throw is.invalidParameterError('erode', 'positive integer', erode); + } + return this; +} + +/** + * Merge alpha transparency channel, if any, with a background, then remove the alpha channel. + * + * See also {@link /api-channel#removealpha removeAlpha}. + * + * @example + * await sharp(rgbaInput) + * .flatten({ background: '#F0A703' }) + * .toBuffer(); + * + * @param {Object} [options] + * @param {string|Object} [options.background={r: 0, g: 0, b: 0}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black. + * @returns {Sharp} + */ +function flatten (options) { + this.options.flatten = is.bool(options) ? options : true; + if (is.object(options)) { + this._setBackgroundColourOption('flattenBackground', options.background); + } + return this; +} + +/** + * Ensure the image has an alpha channel + * with all white pixel values made fully transparent. + * + * Existing alpha channel values for non-white pixels remain unchanged. + * + * This feature is experimental and the API may change. + * + * @since 0.32.1 + * + * @example + * await sharp(rgbInput) + * .unflatten() + * .toBuffer(); + * + * @example + * await sharp(rgbInput) + * .threshold(128, { grayscale: false }) // converter bright pixels to white + * .unflatten() + * .toBuffer(); + */ +function unflatten () { + this.options.unflatten = true; + return this; +} + +/** + * Apply a gamma correction by reducing the encoding (darken) pre-resize at a factor of `1/gamma` + * then increasing the encoding (brighten) post-resize at a factor of `gamma`. + * This can improve the perceived brightness of a resized image in non-linear colour spaces. + * JPEG and WebP input images will not take advantage of the shrink-on-load performance optimisation + * when applying a gamma correction. + * + * Supply a second argument to use a different output gamma value, otherwise the first value is used in both cases. + * + * @param {number} [gamma=2.2] value between 1.0 and 3.0. + * @param {number} [gammaOut] value between 1.0 and 3.0. (optional, defaults to same as `gamma`) + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function gamma (gamma, gammaOut) { + if (!is.defined(gamma)) { + // Default gamma correction of 2.2 (sRGB) + this.options.gamma = 2.2; + } else if (is.number(gamma) && is.inRange(gamma, 1, 3)) { + this.options.gamma = gamma; + } else { + throw is.invalidParameterError('gamma', 'number between 1.0 and 3.0', gamma); + } + if (!is.defined(gammaOut)) { + // Default gamma correction for output is same as input + this.options.gammaOut = this.options.gamma; + } else if (is.number(gammaOut) && is.inRange(gammaOut, 1, 3)) { + this.options.gammaOut = gammaOut; + } else { + throw is.invalidParameterError('gammaOut', 'number between 1.0 and 3.0', gammaOut); + } + return this; +} + +/** + * Produce the "negative" of the image. + * + * @example + * const output = await sharp(input) + * .negate() + * .toBuffer(); + * + * @example + * const output = await sharp(input) + * .negate({ alpha: false }) + * .toBuffer(); + * + * @param {Object} [options] + * @param {Boolean} [options.alpha=true] Whether or not to negate any alpha channel + * @returns {Sharp} + */ +function negate (options) { + this.options.negate = is.bool(options) ? options : true; + if (is.plainObject(options) && 'alpha' in options) { + if (!is.bool(options.alpha)) { + throw is.invalidParameterError('alpha', 'should be boolean value', options.alpha); + } else { + this.options.negateAlpha = options.alpha; + } + } + return this; +} + +/** + * Enhance output image contrast by stretching its luminance to cover a full dynamic range. + * + * Uses a histogram-based approach, taking a default range of 1% to 99% to reduce sensitivity to noise at the extremes. + * + * Luminance values below the `lower` percentile will be underexposed by clipping to zero. + * Luminance values above the `upper` percentile will be overexposed by clipping to the max pixel value. + * + * @example + * const output = await sharp(input) + * .normalise() + * .toBuffer(); + * + * @example + * const output = await sharp(input) + * .normalise({ lower: 0, upper: 100 }) + * .toBuffer(); + * + * @param {Object} [options] + * @param {number} [options.lower=1] - Percentile below which luminance values will be underexposed. + * @param {number} [options.upper=99] - Percentile above which luminance values will be overexposed. + * @returns {Sharp} + */ +function normalise (options) { + if (is.plainObject(options)) { + if (is.defined(options.lower)) { + if (is.number(options.lower) && is.inRange(options.lower, 0, 99)) { + this.options.normaliseLower = options.lower; + } else { + throw is.invalidParameterError('lower', 'number between 0 and 99', options.lower); + } + } + if (is.defined(options.upper)) { + if (is.number(options.upper) && is.inRange(options.upper, 1, 100)) { + this.options.normaliseUpper = options.upper; + } else { + throw is.invalidParameterError('upper', 'number between 1 and 100', options.upper); + } + } + } + if (this.options.normaliseLower >= this.options.normaliseUpper) { + throw is.invalidParameterError('range', 'lower to be less than upper', + `${this.options.normaliseLower} >= ${this.options.normaliseUpper}`); + } + this.options.normalise = true; + return this; +} + +/** + * Alternative spelling of normalise. + * + * @example + * const output = await sharp(input) + * .normalize() + * .toBuffer(); + * + * @param {Object} [options] + * @param {number} [options.lower=1] - Percentile below which luminance values will be underexposed. + * @param {number} [options.upper=99] - Percentile above which luminance values will be overexposed. + * @returns {Sharp} + */ +function normalize (options) { + return this.normalise(options); +} + +/** + * Perform contrast limiting adaptive histogram equalization + * {@link https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE CLAHE}. + * + * This will, in general, enhance the clarity of the image by bringing out darker details. + * + * @since 0.28.3 + * + * @example + * const output = await sharp(input) + * .clahe({ + * width: 3, + * height: 3, + * }) + * .toBuffer(); + * + * @param {Object} options + * @param {number} options.width - Integral width of the search window, in pixels. + * @param {number} options.height - Integral height of the search window, in pixels. + * @param {number} [options.maxSlope=3] - Integral level of brightening, between 0 and 100, where 0 disables contrast limiting. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function clahe (options) { + if (is.plainObject(options)) { + if (is.integer(options.width) && options.width > 0) { + this.options.claheWidth = options.width; + } else { + throw is.invalidParameterError('width', 'integer greater than zero', options.width); + } + if (is.integer(options.height) && options.height > 0) { + this.options.claheHeight = options.height; + } else { + throw is.invalidParameterError('height', 'integer greater than zero', options.height); + } + if (is.defined(options.maxSlope)) { + if (is.integer(options.maxSlope) && is.inRange(options.maxSlope, 0, 100)) { + this.options.claheMaxSlope = options.maxSlope; + } else { + throw is.invalidParameterError('maxSlope', 'integer between 0 and 100', options.maxSlope); + } + } + } else { + throw is.invalidParameterError('options', 'plain object', options); + } + return this; +} + +/** + * Convolve the image with the specified kernel. + * + * @example + * sharp(input) + * .convolve({ + * width: 3, + * height: 3, + * kernel: [-1, 0, 1, -2, 0, 2, -1, 0, 1] + * }) + * .raw() + * .toBuffer(function(err, data, info) { + * // data contains the raw pixel data representing the convolution + * // of the input image with the horizontal Sobel operator + * }); + * + * @param {Object} kernel + * @param {number} kernel.width - width of the kernel in pixels. + * @param {number} kernel.height - height of the kernel in pixels. + * @param {Array} kernel.kernel - Array of length `width*height` containing the kernel values. + * @param {number} [kernel.scale=sum] - the scale of the kernel in pixels. + * @param {number} [kernel.offset=0] - the offset of the kernel in pixels. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function convolve (kernel) { + if (!is.object(kernel) || !Array.isArray(kernel.kernel) || + !is.integer(kernel.width) || !is.integer(kernel.height) || + !is.inRange(kernel.width, 3, 1001) || !is.inRange(kernel.height, 3, 1001) || + kernel.height * kernel.width !== kernel.kernel.length + ) { + // must pass in a kernel + throw new Error('Invalid convolution kernel'); + } + // Default scale is sum of kernel values + if (!is.integer(kernel.scale)) { + kernel.scale = kernel.kernel.reduce((a, b) => a + b, 0); + } + // Clip scale to a minimum value of 1 + if (kernel.scale < 1) { + kernel.scale = 1; + } + if (!is.integer(kernel.offset)) { + kernel.offset = 0; + } + this.options.convKernel = kernel; + return this; +} + +/** + * Any pixel value greater than or equal to the threshold value will be set to 255, otherwise it will be set to 0. + * @param {number} [threshold=128] - a value in the range 0-255 representing the level at which the threshold will be applied. + * @param {Object} [options] + * @param {Boolean} [options.greyscale=true] - convert to single channel greyscale. + * @param {Boolean} [options.grayscale=true] - alternative spelling for greyscale. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function threshold (threshold, options) { + if (!is.defined(threshold)) { + this.options.threshold = 128; + } else if (is.bool(threshold)) { + this.options.threshold = threshold ? 128 : 0; + } else if (is.integer(threshold) && is.inRange(threshold, 0, 255)) { + this.options.threshold = threshold; + } else { + throw is.invalidParameterError('threshold', 'integer between 0 and 255', threshold); + } + if (!is.object(options) || options.greyscale === true || options.grayscale === true) { + this.options.thresholdGrayscale = true; + } else { + this.options.thresholdGrayscale = false; + } + return this; +} + +/** + * Perform a bitwise boolean operation with operand image. + * + * This operation creates an output image where each pixel is the result of + * the selected bitwise boolean `operation` between the corresponding pixels of the input images. + * + * @param {Buffer|string} operand - Buffer containing image data or string containing the path to an image file. + * @param {string} operator - one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively. + * @param {Object} [options] + * @param {Object} [options.raw] - describes operand when using raw pixel data. + * @param {number} [options.raw.width] + * @param {number} [options.raw.height] + * @param {number} [options.raw.channels] + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function boolean (operand, operator, options) { + this.options.boolean = this._createInputDescriptor(operand, options); + if (is.string(operator) && is.inArray(operator, ['and', 'or', 'eor'])) { + this.options.booleanOp = operator; + } else { + throw is.invalidParameterError('operator', 'one of: and, or, eor', operator); + } + return this; +} + +/** + * Apply the linear formula `a` * input + `b` to the image to adjust image levels. + * + * When a single number is provided, it will be used for all image channels. + * When an array of numbers is provided, the array length must match the number of channels. + * + * @example + * await sharp(input) + * .linear(0.5, 2) + * .toBuffer(); + * + * @example + * await sharp(rgbInput) + * .linear( + * [0.25, 0.5, 0.75], + * [150, 100, 50] + * ) + * .toBuffer(); + * + * @param {(number|number[])} [a=[]] multiplier + * @param {(number|number[])} [b=[]] offset + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function linear (a, b) { + if (!is.defined(a) && is.number(b)) { + a = 1.0; + } else if (is.number(a) && !is.defined(b)) { + b = 0.0; + } + if (!is.defined(a)) { + this.options.linearA = []; + } else if (is.number(a)) { + this.options.linearA = [a]; + } else if (Array.isArray(a) && a.length && a.every(is.number)) { + this.options.linearA = a; + } else { + throw is.invalidParameterError('a', 'number or array of numbers', a); + } + if (!is.defined(b)) { + this.options.linearB = []; + } else if (is.number(b)) { + this.options.linearB = [b]; + } else if (Array.isArray(b) && b.length && b.every(is.number)) { + this.options.linearB = b; + } else { + throw is.invalidParameterError('b', 'number or array of numbers', b); + } + if (this.options.linearA.length !== this.options.linearB.length) { + throw new Error('Expected a and b to be arrays of the same length'); + } + return this; +} + +/** + * Recombine the image with the specified matrix. + * + * @since 0.21.1 + * + * @example + * sharp(input) + * .recomb([ + * [0.3588, 0.7044, 0.1368], + * [0.2990, 0.5870, 0.1140], + * [0.2392, 0.4696, 0.0912], + * ]) + * .raw() + * .toBuffer(function(err, data, info) { + * // data contains the raw pixel data after applying the matrix + * // With this example input, a sepia filter has been applied + * }); + * + * @param {Array>} inputMatrix - 3x3 or 4x4 Recombination matrix + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function recomb (inputMatrix) { + if (!Array.isArray(inputMatrix)) { + throw is.invalidParameterError('inputMatrix', 'array', inputMatrix); + } + if (inputMatrix.length !== 3 && inputMatrix.length !== 4) { + throw is.invalidParameterError('inputMatrix', '3x3 or 4x4 array', inputMatrix.length); + } + const recombMatrix = inputMatrix.flat().map(Number); + if (recombMatrix.length !== 9 && recombMatrix.length !== 16) { + throw is.invalidParameterError('inputMatrix', 'cardinality of 9 or 16', recombMatrix.length); + } + this.options.recombMatrix = recombMatrix; + return this; +} + +/** + * Transforms the image using brightness, saturation, hue rotation, and lightness. + * Brightness and lightness both operate on luminance, with the difference being that + * brightness is multiplicative whereas lightness is additive. + * + * @since 0.22.1 + * + * @example + * // increase brightness by a factor of 2 + * const output = await sharp(input) + * .modulate({ + * brightness: 2 + * }) + * .toBuffer(); + * + * @example + * // hue-rotate by 180 degrees + * const output = await sharp(input) + * .modulate({ + * hue: 180 + * }) + * .toBuffer(); + * + * @example + * // increase lightness by +50 + * const output = await sharp(input) + * .modulate({ + * lightness: 50 + * }) + * .toBuffer(); + * + * @example + * // decrease brightness and saturation while also hue-rotating by 90 degrees + * const output = await sharp(input) + * .modulate({ + * brightness: 0.5, + * saturation: 0.5, + * hue: 90, + * }) + * .toBuffer(); + * + * @param {Object} [options] + * @param {number} [options.brightness] Brightness multiplier + * @param {number} [options.saturation] Saturation multiplier + * @param {number} [options.hue] Degrees for hue rotation + * @param {number} [options.lightness] Lightness addend + * @returns {Sharp} + */ +function modulate (options) { + if (!is.plainObject(options)) { + throw is.invalidParameterError('options', 'plain object', options); + } + if ('brightness' in options) { + if (is.number(options.brightness) && options.brightness >= 0) { + this.options.brightness = options.brightness; + } else { + throw is.invalidParameterError('brightness', 'number above zero', options.brightness); + } + } + if ('saturation' in options) { + if (is.number(options.saturation) && options.saturation >= 0) { + this.options.saturation = options.saturation; + } else { + throw is.invalidParameterError('saturation', 'number above zero', options.saturation); + } + } + if ('hue' in options) { + if (is.integer(options.hue)) { + this.options.hue = options.hue % 360; + } else { + throw is.invalidParameterError('hue', 'number', options.hue); + } + } + if ('lightness' in options) { + if (is.number(options.lightness)) { + this.options.lightness = options.lightness; + } else { + throw is.invalidParameterError('lightness', 'number', options.lightness); + } + } + return this; +} + +/** + * Decorate the Sharp prototype with operation-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Object.assign(Sharp.prototype, { + autoOrient, + rotate, + flip, + flop, + affine, + sharpen, + erode, + dilate, + median, + blur, + flatten, + unflatten, + gamma, + negate, + normalise, + normalize, + clahe, + convolve, + threshold, + boolean, + linear, + recomb, + modulate + }); +}; diff --git a/node_modules/sharp/lib/output.js b/node_modules/sharp/lib/output.js new file mode 100644 index 0000000..27a6ac4 --- /dev/null +++ b/node_modules/sharp/lib/output.js @@ -0,0 +1,1666 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const path = require('node:path'); +const is = require('./is'); +const sharp = require('./sharp'); + +const formats = new Map([ + ['heic', 'heif'], + ['heif', 'heif'], + ['avif', 'avif'], + ['jpeg', 'jpeg'], + ['jpg', 'jpeg'], + ['jpe', 'jpeg'], + ['tile', 'tile'], + ['dz', 'tile'], + ['png', 'png'], + ['raw', 'raw'], + ['tiff', 'tiff'], + ['tif', 'tiff'], + ['webp', 'webp'], + ['gif', 'gif'], + ['jp2', 'jp2'], + ['jpx', 'jp2'], + ['j2k', 'jp2'], + ['j2c', 'jp2'], + ['jxl', 'jxl'] +]); + +const jp2Regex = /\.(jp[2x]|j2[kc])$/i; + +const errJp2Save = () => new Error('JP2 output requires libvips with support for OpenJPEG'); + +const bitdepthFromColourCount = (colours) => 1 << 31 - Math.clz32(Math.ceil(Math.log2(colours))); + +/** + * Write output image data to a file. + * + * If an explicit output format is not selected, it will be inferred from the extension, + * with JPEG, PNG, WebP, AVIF, TIFF, GIF, DZI, and libvips' V format supported. + * Note that raw pixel data is only supported for buffer output. + * + * By default all metadata will be removed, which includes EXIF-based orientation. + * See {@link #withmetadata withMetadata} for control over this. + * + * The caller is responsible for ensuring directory structures and permissions exist. + * + * A `Promise` is returned when `callback` is not provided. + * + * @example + * sharp(input) + * .toFile('output.png', (err, info) => { ... }); + * + * @example + * sharp(input) + * .toFile('output.png') + * .then(info => { ... }) + * .catch(err => { ... }); + * + * @param {string} fileOut - the path to write the image data to. + * @param {Function} [callback] - called on completion with two arguments `(err, info)`. + * `info` contains the output image `format`, `size` (bytes), `width`, `height`, + * `channels` and `premultiplied` (indicating if premultiplication was used). + * When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. + * When using the attention crop strategy also contains `attentionX` and `attentionY`, the focal point of the cropped region. + * Animated output will also contain `pageHeight` and `pages`. + * May also contain `textAutofitDpi` (dpi the font was rendered at) if image was created from text. + * @returns {Promise} - when no callback is provided + * @throws {Error} Invalid parameters + */ +function toFile (fileOut, callback) { + let err; + if (!is.string(fileOut)) { + err = new Error('Missing output file path'); + } else if (is.string(this.options.input.file) && path.resolve(this.options.input.file) === path.resolve(fileOut)) { + err = new Error('Cannot use same file for input and output'); + } else if (jp2Regex.test(path.extname(fileOut)) && !this.constructor.format.jp2k.output.file) { + err = errJp2Save(); + } + if (err) { + if (is.fn(callback)) { + callback(err); + } else { + return Promise.reject(err); + } + } else { + this.options.fileOut = fileOut; + const stack = Error(); + return this._pipeline(callback, stack); + } + return this; +} + +/** + * Write output to a Buffer. + * JPEG, PNG, WebP, AVIF, TIFF, GIF and raw pixel data output are supported. + * + * Use {@link #toformat toFormat} or one of the format-specific functions such as {@link #jpeg jpeg}, {@link #png png} etc. to set the output format. + * + * If no explicit format is set, the output format will match the input image, except SVG input which becomes PNG output. + * + * By default all metadata will be removed, which includes EXIF-based orientation. + * See {@link #withmetadata withMetadata} for control over this. + * + * `callback`, if present, gets three arguments `(err, data, info)` where: + * - `err` is an error, if any. + * - `data` is the output image data. + * - `info` contains the output image `format`, `size` (bytes), `width`, `height`, + * `channels` and `premultiplied` (indicating if premultiplication was used). + * When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. + * Animated output will also contain `pageHeight` and `pages`. + * May also contain `textAutofitDpi` (dpi the font was rendered at) if image was created from text. + * + * A `Promise` is returned when `callback` is not provided. + * + * @example + * sharp(input) + * .toBuffer((err, data, info) => { ... }); + * + * @example + * sharp(input) + * .toBuffer() + * .then(data => { ... }) + * .catch(err => { ... }); + * + * @example + * sharp(input) + * .png() + * .toBuffer({ resolveWithObject: true }) + * .then(({ data, info }) => { ... }) + * .catch(err => { ... }); + * + * @example + * const { data, info } = await sharp('my-image.jpg') + * // output the raw pixels + * .raw() + * .toBuffer({ resolveWithObject: true }); + * + * // create a more type safe way to work with the raw pixel data + * // this will not copy the data, instead it will change `data`s underlying ArrayBuffer + * // so `data` and `pixelArray` point to the same memory location + * const pixelArray = new Uint8ClampedArray(data.buffer); + * + * // When you are done changing the pixelArray, sharp takes the `pixelArray` as an input + * const { width, height, channels } = info; + * await sharp(pixelArray, { raw: { width, height, channels } }) + * .toFile('my-changed-image.jpg'); + * + * @param {Object} [options] + * @param {boolean} [options.resolveWithObject] Resolve the Promise with an Object containing `data` and `info` properties instead of resolving only with `data`. + * @param {Function} [callback] + * @returns {Promise} - when no callback is provided + */ +function toBuffer (options, callback) { + if (is.object(options)) { + this._setBooleanOption('resolveWithObject', options.resolveWithObject); + } else if (this.options.resolveWithObject) { + this.options.resolveWithObject = false; + } + this.options.fileOut = ''; + const stack = Error(); + return this._pipeline(is.fn(options) ? options : callback, stack); +} + +/** + * Keep all EXIF metadata from the input image in the output image. + * + * EXIF metadata is unsupported for TIFF output. + * + * @since 0.33.0 + * + * @example + * const outputWithExif = await sharp(inputWithExif) + * .keepExif() + * .toBuffer(); + * + * @returns {Sharp} + */ +function keepExif () { + this.options.keepMetadata |= 0b00001; + return this; +} + +/** + * Set EXIF metadata in the output image, ignoring any EXIF in the input image. + * + * @since 0.33.0 + * + * @example + * const dataWithExif = await sharp(input) + * .withExif({ + * IFD0: { + * Copyright: 'The National Gallery' + * }, + * IFD3: { + * GPSLatitudeRef: 'N', + * GPSLatitude: '51/1 30/1 3230/100', + * GPSLongitudeRef: 'W', + * GPSLongitude: '0/1 7/1 4366/100' + * } + * }) + * .toBuffer(); + * + * @param {Object>} exif Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function withExif (exif) { + if (is.object(exif)) { + for (const [ifd, entries] of Object.entries(exif)) { + if (is.object(entries)) { + for (const [k, v] of Object.entries(entries)) { + if (is.string(v)) { + this.options.withExif[`exif-${ifd.toLowerCase()}-${k}`] = v; + } else { + throw is.invalidParameterError(`${ifd}.${k}`, 'string', v); + } + } + } else { + throw is.invalidParameterError(ifd, 'object', entries); + } + } + } else { + throw is.invalidParameterError('exif', 'object', exif); + } + this.options.withExifMerge = false; + return this.keepExif(); +} + +/** + * Update EXIF metadata from the input image in the output image. + * + * @since 0.33.0 + * + * @example + * const dataWithMergedExif = await sharp(inputWithExif) + * .withExifMerge({ + * IFD0: { + * Copyright: 'The National Gallery' + * } + * }) + * .toBuffer(); + * + * @param {Object>} exif Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function withExifMerge (exif) { + this.withExif(exif); + this.options.withExifMerge = true; + return this; +} + +/** + * Keep ICC profile from the input image in the output image. + * + * When input and output colour spaces differ, use with {@link /api-colour/#tocolourspace toColourspace} and optionally {@link /api-colour/#pipelinecolourspace pipelineColourspace}. + * + * @since 0.33.0 + * + * @example + * const outputWithIccProfile = await sharp(inputWithIccProfile) + * .keepIccProfile() + * .toBuffer(); + * + * @example + * const cmykOutputWithIccProfile = await sharp(cmykInputWithIccProfile) + * .pipelineColourspace('cmyk') + * .toColourspace('cmyk') + * .keepIccProfile() + * .toBuffer(); + * + * @returns {Sharp} + */ +function keepIccProfile () { + this.options.keepMetadata |= 0b01000; + return this; +} + +/** + * Transform using an ICC profile and attach to the output image. + * + * This can either be an absolute filesystem path or + * built-in profile name (`srgb`, `p3`, `cmyk`). + * + * @since 0.33.0 + * + * @example + * const outputWithP3 = await sharp(input) + * .withIccProfile('p3') + * .toBuffer(); + * + * @param {string} icc - Absolute filesystem path to output ICC profile or built-in profile name (srgb, p3, cmyk). + * @param {Object} [options] + * @param {number} [options.attach=true] Should the ICC profile be included in the output image metadata? + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function withIccProfile (icc, options) { + if (is.string(icc)) { + this.options.withIccProfile = icc; + } else { + throw is.invalidParameterError('icc', 'string', icc); + } + this.keepIccProfile(); + if (is.object(options)) { + if (is.defined(options.attach)) { + if (is.bool(options.attach)) { + if (!options.attach) { + this.options.keepMetadata &= ~0b01000; + } + } else { + throw is.invalidParameterError('attach', 'boolean', options.attach); + } + } + } + return this; +} + +/** + * Keep XMP metadata from the input image in the output image. + * + * @since 0.34.3 + * + * @example + * const outputWithXmp = await sharp(inputWithXmp) + * .keepXmp() + * .toBuffer(); + * + * @returns {Sharp} + */ +function keepXmp () { + this.options.keepMetadata |= 0b00010; + return this; +} + +/** + * Set XMP metadata in the output image. + * + * Supported by PNG, JPEG, WebP, and TIFF output. + * + * @since 0.34.3 + * + * @example + * const xmpString = ` + * + * + * + * + * John Doe + * + * + * `; + * + * const data = await sharp(input) + * .withXmp(xmpString) + * .toBuffer(); + * + * @param {string} xmp String containing XMP metadata to be embedded in the output image. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function withXmp (xmp) { + if (is.string(xmp) && xmp.length > 0) { + this.options.withXmp = xmp; + this.options.keepMetadata |= 0b00010; + } else { + throw is.invalidParameterError('xmp', 'non-empty string', xmp); + } + return this; +} + +/** + * Keep all metadata (EXIF, ICC, XMP, IPTC) from the input image in the output image. + * + * The default behaviour, when `keepMetadata` is not used, is to convert to the device-independent + * sRGB colour space and strip all metadata, including the removal of any ICC profile. + * + * @since 0.33.0 + * + * @example + * const outputWithMetadata = await sharp(inputWithMetadata) + * .keepMetadata() + * .toBuffer(); + * + * @returns {Sharp} + */ +function keepMetadata () { + this.options.keepMetadata = 0b11111; + return this; +} + +/** + * Keep most metadata (EXIF, XMP, IPTC) from the input image in the output image. + * + * This will also convert to and add a web-friendly sRGB ICC profile if appropriate. + * + * Allows orientation and density to be set or updated. + * + * @example + * const outputSrgbWithMetadata = await sharp(inputRgbWithMetadata) + * .withMetadata() + * .toBuffer(); + * + * @example + * // Set output metadata to 96 DPI + * const data = await sharp(input) + * .withMetadata({ density: 96 }) + * .toBuffer(); + * + * @param {Object} [options] + * @param {number} [options.orientation] Used to update the EXIF `Orientation` tag, integer between 1 and 8. + * @param {number} [options.density] Number of pixels per inch (DPI). + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function withMetadata (options) { + this.keepMetadata(); + this.withIccProfile('srgb'); + if (is.object(options)) { + if (is.defined(options.orientation)) { + if (is.integer(options.orientation) && is.inRange(options.orientation, 1, 8)) { + this.options.withMetadataOrientation = options.orientation; + } else { + throw is.invalidParameterError('orientation', 'integer between 1 and 8', options.orientation); + } + } + if (is.defined(options.density)) { + if (is.number(options.density) && options.density > 0) { + this.options.withMetadataDensity = options.density; + } else { + throw is.invalidParameterError('density', 'positive number', options.density); + } + } + if (is.defined(options.icc)) { + this.withIccProfile(options.icc); + } + if (is.defined(options.exif)) { + this.withExifMerge(options.exif); + } + } + return this; +} + +/** + * Force output to a given format. + * + * @example + * // Convert any input to PNG output + * const data = await sharp(input) + * .toFormat('png') + * .toBuffer(); + * + * @param {(string|Object)} format - as a string or an Object with an 'id' attribute + * @param {Object} options - output options + * @returns {Sharp} + * @throws {Error} unsupported format or options + */ +function toFormat (format, options) { + const actualFormat = formats.get((is.object(format) && is.string(format.id) ? format.id : format).toLowerCase()); + if (!actualFormat) { + throw is.invalidParameterError('format', `one of: ${[...formats.keys()].join(', ')}`, format); + } + return this[actualFormat](options); +} + +/** + * Use these JPEG options for output image. + * + * @example + * // Convert any input to very high quality JPEG output + * const data = await sharp(input) + * .jpeg({ + * quality: 100, + * chromaSubsampling: '4:4:4' + * }) + * .toBuffer(); + * + * @example + * // Use mozjpeg to reduce output JPEG file size (slower) + * const data = await sharp(input) + * .jpeg({ mozjpeg: true }) + * .toBuffer(); + * + * @param {Object} [options] - output options + * @param {number} [options.quality=80] - quality, integer 1-100 + * @param {boolean} [options.progressive=false] - use progressive (interlace) scan + * @param {string} [options.chromaSubsampling='4:2:0'] - set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling + * @param {boolean} [options.optimiseCoding=true] - optimise Huffman coding tables + * @param {boolean} [options.optimizeCoding=true] - alternative spelling of optimiseCoding + * @param {boolean} [options.mozjpeg=false] - use mozjpeg defaults, equivalent to `{ trellisQuantisation: true, overshootDeringing: true, optimiseScans: true, quantisationTable: 3 }` + * @param {boolean} [options.trellisQuantisation=false] - apply trellis quantisation + * @param {boolean} [options.overshootDeringing=false] - apply overshoot deringing + * @param {boolean} [options.optimiseScans=false] - optimise progressive scans, forces progressive + * @param {boolean} [options.optimizeScans=false] - alternative spelling of optimiseScans + * @param {number} [options.quantisationTable=0] - quantization table to use, integer 0-8 + * @param {number} [options.quantizationTable=0] - alternative spelling of quantisationTable + * @param {boolean} [options.force=true] - force JPEG output, otherwise attempt to use input format + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function jpeg (options) { + if (is.object(options)) { + if (is.defined(options.quality)) { + if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { + this.options.jpegQuality = options.quality; + } else { + throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality); + } + } + if (is.defined(options.progressive)) { + this._setBooleanOption('jpegProgressive', options.progressive); + } + if (is.defined(options.chromaSubsampling)) { + if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ['4:2:0', '4:4:4'])) { + this.options.jpegChromaSubsampling = options.chromaSubsampling; + } else { + throw is.invalidParameterError('chromaSubsampling', 'one of: 4:2:0, 4:4:4', options.chromaSubsampling); + } + } + const optimiseCoding = is.bool(options.optimizeCoding) ? options.optimizeCoding : options.optimiseCoding; + if (is.defined(optimiseCoding)) { + this._setBooleanOption('jpegOptimiseCoding', optimiseCoding); + } + if (is.defined(options.mozjpeg)) { + if (is.bool(options.mozjpeg)) { + if (options.mozjpeg) { + this.options.jpegTrellisQuantisation = true; + this.options.jpegOvershootDeringing = true; + this.options.jpegOptimiseScans = true; + this.options.jpegProgressive = true; + this.options.jpegQuantisationTable = 3; + } + } else { + throw is.invalidParameterError('mozjpeg', 'boolean', options.mozjpeg); + } + } + const trellisQuantisation = is.bool(options.trellisQuantization) ? options.trellisQuantization : options.trellisQuantisation; + if (is.defined(trellisQuantisation)) { + this._setBooleanOption('jpegTrellisQuantisation', trellisQuantisation); + } + if (is.defined(options.overshootDeringing)) { + this._setBooleanOption('jpegOvershootDeringing', options.overshootDeringing); + } + const optimiseScans = is.bool(options.optimizeScans) ? options.optimizeScans : options.optimiseScans; + if (is.defined(optimiseScans)) { + this._setBooleanOption('jpegOptimiseScans', optimiseScans); + if (optimiseScans) { + this.options.jpegProgressive = true; + } + } + const quantisationTable = is.number(options.quantizationTable) ? options.quantizationTable : options.quantisationTable; + if (is.defined(quantisationTable)) { + if (is.integer(quantisationTable) && is.inRange(quantisationTable, 0, 8)) { + this.options.jpegQuantisationTable = quantisationTable; + } else { + throw is.invalidParameterError('quantisationTable', 'integer between 0 and 8', quantisationTable); + } + } + } + return this._updateFormatOut('jpeg', options); +} + +/** + * Use these PNG options for output image. + * + * By default, PNG output is full colour at 8 bits per pixel. + * + * Indexed PNG input at 1, 2 or 4 bits per pixel is converted to 8 bits per pixel. + * Set `palette` to `true` for slower, indexed PNG output. + * + * For 16 bits per pixel output, convert to `rgb16` via + * {@link /api-colour/#tocolourspace toColourspace}. + * + * @example + * // Convert any input to full colour PNG output + * const data = await sharp(input) + * .png() + * .toBuffer(); + * + * @example + * // Convert any input to indexed PNG output (slower) + * const data = await sharp(input) + * .png({ palette: true }) + * .toBuffer(); + * + * @example + * // Output 16 bits per pixel RGB(A) + * const data = await sharp(input) + * .toColourspace('rgb16') + * .png() + * .toBuffer(); + * + * @param {Object} [options] + * @param {boolean} [options.progressive=false] - use progressive (interlace) scan + * @param {number} [options.compressionLevel=6] - zlib compression level, 0 (fastest, largest) to 9 (slowest, smallest) + * @param {boolean} [options.adaptiveFiltering=false] - use adaptive row filtering + * @param {boolean} [options.palette=false] - quantise to a palette-based image with alpha transparency support + * @param {number} [options.quality=100] - use the lowest number of colours needed to achieve given quality, sets `palette` to `true` + * @param {number} [options.effort=7] - CPU effort, between 1 (fastest) and 10 (slowest), sets `palette` to `true` + * @param {number} [options.colours=256] - maximum number of palette entries, sets `palette` to `true` + * @param {number} [options.colors=256] - alternative spelling of `options.colours`, sets `palette` to `true` + * @param {number} [options.dither=1.0] - level of Floyd-Steinberg error diffusion, sets `palette` to `true` + * @param {boolean} [options.force=true] - force PNG output, otherwise attempt to use input format + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function png (options) { + if (is.object(options)) { + if (is.defined(options.progressive)) { + this._setBooleanOption('pngProgressive', options.progressive); + } + if (is.defined(options.compressionLevel)) { + if (is.integer(options.compressionLevel) && is.inRange(options.compressionLevel, 0, 9)) { + this.options.pngCompressionLevel = options.compressionLevel; + } else { + throw is.invalidParameterError('compressionLevel', 'integer between 0 and 9', options.compressionLevel); + } + } + if (is.defined(options.adaptiveFiltering)) { + this._setBooleanOption('pngAdaptiveFiltering', options.adaptiveFiltering); + } + const colours = options.colours || options.colors; + if (is.defined(colours)) { + if (is.integer(colours) && is.inRange(colours, 2, 256)) { + this.options.pngBitdepth = bitdepthFromColourCount(colours); + } else { + throw is.invalidParameterError('colours', 'integer between 2 and 256', colours); + } + } + if (is.defined(options.palette)) { + this._setBooleanOption('pngPalette', options.palette); + } else if ([options.quality, options.effort, options.colours, options.colors, options.dither].some(is.defined)) { + this._setBooleanOption('pngPalette', true); + } + if (this.options.pngPalette) { + if (is.defined(options.quality)) { + if (is.integer(options.quality) && is.inRange(options.quality, 0, 100)) { + this.options.pngQuality = options.quality; + } else { + throw is.invalidParameterError('quality', 'integer between 0 and 100', options.quality); + } + } + if (is.defined(options.effort)) { + if (is.integer(options.effort) && is.inRange(options.effort, 1, 10)) { + this.options.pngEffort = options.effort; + } else { + throw is.invalidParameterError('effort', 'integer between 1 and 10', options.effort); + } + } + if (is.defined(options.dither)) { + if (is.number(options.dither) && is.inRange(options.dither, 0, 1)) { + this.options.pngDither = options.dither; + } else { + throw is.invalidParameterError('dither', 'number between 0.0 and 1.0', options.dither); + } + } + } + } + return this._updateFormatOut('png', options); +} + +/** + * Use these WebP options for output image. + * + * @example + * // Convert any input to lossless WebP output + * const data = await sharp(input) + * .webp({ lossless: true }) + * .toBuffer(); + * + * @example + * // Optimise the file size of an animated WebP + * const outputWebp = await sharp(inputWebp, { animated: true }) + * .webp({ effort: 6 }) + * .toBuffer(); + * + * @param {Object} [options] - output options + * @param {number} [options.quality=80] - quality, integer 1-100 + * @param {number} [options.alphaQuality=100] - quality of alpha layer, integer 0-100 + * @param {boolean} [options.lossless=false] - use lossless compression mode + * @param {boolean} [options.nearLossless=false] - use near_lossless compression mode + * @param {boolean} [options.smartSubsample=false] - use high quality chroma subsampling + * @param {boolean} [options.smartDeblock=false] - auto-adjust the deblocking filter, can improve low contrast edges (slow) + * @param {string} [options.preset='default'] - named preset for preprocessing/filtering, one of: default, photo, picture, drawing, icon, text + * @param {number} [options.effort=4] - CPU effort, between 0 (fastest) and 6 (slowest) + * @param {number} [options.loop=0] - number of animation iterations, use 0 for infinite animation + * @param {number|number[]} [options.delay] - delay(s) between animation frames (in milliseconds) + * @param {boolean} [options.minSize=false] - prevent use of animation key frames to minimise file size (slow) + * @param {boolean} [options.mixed=false] - allow mixture of lossy and lossless animation frames (slow) + * @param {boolean} [options.force=true] - force WebP output, otherwise attempt to use input format + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function webp (options) { + if (is.object(options)) { + if (is.defined(options.quality)) { + if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { + this.options.webpQuality = options.quality; + } else { + throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality); + } + } + if (is.defined(options.alphaQuality)) { + if (is.integer(options.alphaQuality) && is.inRange(options.alphaQuality, 0, 100)) { + this.options.webpAlphaQuality = options.alphaQuality; + } else { + throw is.invalidParameterError('alphaQuality', 'integer between 0 and 100', options.alphaQuality); + } + } + if (is.defined(options.lossless)) { + this._setBooleanOption('webpLossless', options.lossless); + } + if (is.defined(options.nearLossless)) { + this._setBooleanOption('webpNearLossless', options.nearLossless); + } + if (is.defined(options.smartSubsample)) { + this._setBooleanOption('webpSmartSubsample', options.smartSubsample); + } + if (is.defined(options.smartDeblock)) { + this._setBooleanOption('webpSmartDeblock', options.smartDeblock); + } + if (is.defined(options.preset)) { + if (is.string(options.preset) && is.inArray(options.preset, ['default', 'photo', 'picture', 'drawing', 'icon', 'text'])) { + this.options.webpPreset = options.preset; + } else { + throw is.invalidParameterError('preset', 'one of: default, photo, picture, drawing, icon, text', options.preset); + } + } + if (is.defined(options.effort)) { + if (is.integer(options.effort) && is.inRange(options.effort, 0, 6)) { + this.options.webpEffort = options.effort; + } else { + throw is.invalidParameterError('effort', 'integer between 0 and 6', options.effort); + } + } + if (is.defined(options.minSize)) { + this._setBooleanOption('webpMinSize', options.minSize); + } + if (is.defined(options.mixed)) { + this._setBooleanOption('webpMixed', options.mixed); + } + } + trySetAnimationOptions(options, this.options); + return this._updateFormatOut('webp', options); +} + +/** + * Use these GIF options for the output image. + * + * The first entry in the palette is reserved for transparency. + * + * The palette of the input image will be re-used if possible. + * + * @since 0.30.0 + * + * @example + * // Convert PNG to GIF + * await sharp(pngBuffer) + * .gif() + * .toBuffer(); + * + * @example + * // Convert animated WebP to animated GIF + * await sharp('animated.webp', { animated: true }) + * .toFile('animated.gif'); + * + * @example + * // Create a 128x128, cropped, non-dithered, animated thumbnail of an animated GIF + * const out = await sharp('in.gif', { animated: true }) + * .resize({ width: 128, height: 128 }) + * .gif({ dither: 0 }) + * .toBuffer(); + * + * @example + * // Lossy file size reduction of animated GIF + * await sharp('in.gif', { animated: true }) + * .gif({ interFrameMaxError: 8 }) + * .toFile('optim.gif'); + * + * @param {Object} [options] - output options + * @param {boolean} [options.reuse=true] - re-use existing palette, otherwise generate new (slow) + * @param {boolean} [options.progressive=false] - use progressive (interlace) scan + * @param {number} [options.colours=256] - maximum number of palette entries, including transparency, between 2 and 256 + * @param {number} [options.colors=256] - alternative spelling of `options.colours` + * @param {number} [options.effort=7] - CPU effort, between 1 (fastest) and 10 (slowest) + * @param {number} [options.dither=1.0] - level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most) + * @param {number} [options.interFrameMaxError=0] - maximum inter-frame error for transparency, between 0 (lossless) and 32 + * @param {number} [options.interPaletteMaxError=3] - maximum inter-palette error for palette reuse, between 0 and 256 + * @param {boolean} [options.keepDuplicateFrames=false] - keep duplicate frames in the output instead of combining them + * @param {number} [options.loop=0] - number of animation iterations, use 0 for infinite animation + * @param {number|number[]} [options.delay] - delay(s) between animation frames (in milliseconds) + * @param {boolean} [options.force=true] - force GIF output, otherwise attempt to use input format + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function gif (options) { + if (is.object(options)) { + if (is.defined(options.reuse)) { + this._setBooleanOption('gifReuse', options.reuse); + } + if (is.defined(options.progressive)) { + this._setBooleanOption('gifProgressive', options.progressive); + } + const colours = options.colours || options.colors; + if (is.defined(colours)) { + if (is.integer(colours) && is.inRange(colours, 2, 256)) { + this.options.gifBitdepth = bitdepthFromColourCount(colours); + } else { + throw is.invalidParameterError('colours', 'integer between 2 and 256', colours); + } + } + if (is.defined(options.effort)) { + if (is.number(options.effort) && is.inRange(options.effort, 1, 10)) { + this.options.gifEffort = options.effort; + } else { + throw is.invalidParameterError('effort', 'integer between 1 and 10', options.effort); + } + } + if (is.defined(options.dither)) { + if (is.number(options.dither) && is.inRange(options.dither, 0, 1)) { + this.options.gifDither = options.dither; + } else { + throw is.invalidParameterError('dither', 'number between 0.0 and 1.0', options.dither); + } + } + if (is.defined(options.interFrameMaxError)) { + if (is.number(options.interFrameMaxError) && is.inRange(options.interFrameMaxError, 0, 32)) { + this.options.gifInterFrameMaxError = options.interFrameMaxError; + } else { + throw is.invalidParameterError('interFrameMaxError', 'number between 0.0 and 32.0', options.interFrameMaxError); + } + } + if (is.defined(options.interPaletteMaxError)) { + if (is.number(options.interPaletteMaxError) && is.inRange(options.interPaletteMaxError, 0, 256)) { + this.options.gifInterPaletteMaxError = options.interPaletteMaxError; + } else { + throw is.invalidParameterError('interPaletteMaxError', 'number between 0.0 and 256.0', options.interPaletteMaxError); + } + } + if (is.defined(options.keepDuplicateFrames)) { + if (is.bool(options.keepDuplicateFrames)) { + this._setBooleanOption('gifKeepDuplicateFrames', options.keepDuplicateFrames); + } else { + throw is.invalidParameterError('keepDuplicateFrames', 'boolean', options.keepDuplicateFrames); + } + } + } + trySetAnimationOptions(options, this.options); + return this._updateFormatOut('gif', options); +} + +/** + * Use these JP2 options for output image. + * + * Requires libvips compiled with support for OpenJPEG. + * The prebuilt binaries do not include this - see + * {@link /install#custom-libvips installing a custom libvips}. + * + * @example + * // Convert any input to lossless JP2 output + * const data = await sharp(input) + * .jp2({ lossless: true }) + * .toBuffer(); + * + * @example + * // Convert any input to very high quality JP2 output + * const data = await sharp(input) + * .jp2({ + * quality: 100, + * chromaSubsampling: '4:4:4' + * }) + * .toBuffer(); + * + * @since 0.29.1 + * + * @param {Object} [options] - output options + * @param {number} [options.quality=80] - quality, integer 1-100 + * @param {boolean} [options.lossless=false] - use lossless compression mode + * @param {number} [options.tileWidth=512] - horizontal tile size + * @param {number} [options.tileHeight=512] - vertical tile size + * @param {string} [options.chromaSubsampling='4:4:4'] - set to '4:2:0' to use chroma subsampling + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function jp2 (options) { + /* node:coverage ignore next 41 */ + if (!this.constructor.format.jp2k.output.buffer) { + throw errJp2Save(); + } + if (is.object(options)) { + if (is.defined(options.quality)) { + if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { + this.options.jp2Quality = options.quality; + } else { + throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality); + } + } + if (is.defined(options.lossless)) { + if (is.bool(options.lossless)) { + this.options.jp2Lossless = options.lossless; + } else { + throw is.invalidParameterError('lossless', 'boolean', options.lossless); + } + } + if (is.defined(options.tileWidth)) { + if (is.integer(options.tileWidth) && is.inRange(options.tileWidth, 1, 32768)) { + this.options.jp2TileWidth = options.tileWidth; + } else { + throw is.invalidParameterError('tileWidth', 'integer between 1 and 32768', options.tileWidth); + } + } + if (is.defined(options.tileHeight)) { + if (is.integer(options.tileHeight) && is.inRange(options.tileHeight, 1, 32768)) { + this.options.jp2TileHeight = options.tileHeight; + } else { + throw is.invalidParameterError('tileHeight', 'integer between 1 and 32768', options.tileHeight); + } + } + if (is.defined(options.chromaSubsampling)) { + if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ['4:2:0', '4:4:4'])) { + this.options.jp2ChromaSubsampling = options.chromaSubsampling; + } else { + throw is.invalidParameterError('chromaSubsampling', 'one of: 4:2:0, 4:4:4', options.chromaSubsampling); + } + } + } + return this._updateFormatOut('jp2', options); +} + +/** + * Set animation options if available. + * @private + * + * @param {Object} [source] - output options + * @param {number} [source.loop=0] - number of animation iterations, use 0 for infinite animation + * @param {number[]} [source.delay] - list of delays between animation frames (in milliseconds) + * @param {Object} [target] - target object for valid options + * @throws {Error} Invalid options + */ +function trySetAnimationOptions (source, target) { + if (is.object(source) && is.defined(source.loop)) { + if (is.integer(source.loop) && is.inRange(source.loop, 0, 65535)) { + target.loop = source.loop; + } else { + throw is.invalidParameterError('loop', 'integer between 0 and 65535', source.loop); + } + } + if (is.object(source) && is.defined(source.delay)) { + // We allow singular values as well + if (is.integer(source.delay) && is.inRange(source.delay, 0, 65535)) { + target.delay = [source.delay]; + } else if ( + Array.isArray(source.delay) && + source.delay.every(is.integer) && + source.delay.every(v => is.inRange(v, 0, 65535))) { + target.delay = source.delay; + } else { + throw is.invalidParameterError('delay', 'integer or an array of integers between 0 and 65535', source.delay); + } + } +} + +/** + * Use these TIFF options for output image. + * + * The `density` can be set in pixels/inch via {@link #withmetadata withMetadata} + * instead of providing `xres` and `yres` in pixels/mm. + * + * @example + * // Convert SVG input to LZW-compressed, 1 bit per pixel TIFF output + * sharp('input.svg') + * .tiff({ + * compression: 'lzw', + * bitdepth: 1 + * }) + * .toFile('1-bpp-output.tiff') + * .then(info => { ... }); + * + * @param {Object} [options] - output options + * @param {number} [options.quality=80] - quality, integer 1-100 + * @param {boolean} [options.force=true] - force TIFF output, otherwise attempt to use input format + * @param {string} [options.compression='jpeg'] - compression options: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k + * @param {boolean} [options.bigtiff=false] - use BigTIFF variant (has no effect when compression is none) + * @param {string} [options.predictor='horizontal'] - compression predictor options: none, horizontal, float + * @param {boolean} [options.pyramid=false] - write an image pyramid + * @param {boolean} [options.tile=false] - write a tiled tiff + * @param {number} [options.tileWidth=256] - horizontal tile size + * @param {number} [options.tileHeight=256] - vertical tile size + * @param {number} [options.xres=1.0] - horizontal resolution in pixels/mm + * @param {number} [options.yres=1.0] - vertical resolution in pixels/mm + * @param {string} [options.resolutionUnit='inch'] - resolution unit options: inch, cm + * @param {number} [options.bitdepth=8] - reduce bitdepth to 1, 2 or 4 bit + * @param {boolean} [options.miniswhite=false] - write 1-bit images as miniswhite + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function tiff (options) { + if (is.object(options)) { + if (is.defined(options.quality)) { + if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { + this.options.tiffQuality = options.quality; + } else { + throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality); + } + } + if (is.defined(options.bitdepth)) { + if (is.integer(options.bitdepth) && is.inArray(options.bitdepth, [1, 2, 4, 8])) { + this.options.tiffBitdepth = options.bitdepth; + } else { + throw is.invalidParameterError('bitdepth', '1, 2, 4 or 8', options.bitdepth); + } + } + // tiling + if (is.defined(options.tile)) { + this._setBooleanOption('tiffTile', options.tile); + } + if (is.defined(options.tileWidth)) { + if (is.integer(options.tileWidth) && options.tileWidth > 0) { + this.options.tiffTileWidth = options.tileWidth; + } else { + throw is.invalidParameterError('tileWidth', 'integer greater than zero', options.tileWidth); + } + } + if (is.defined(options.tileHeight)) { + if (is.integer(options.tileHeight) && options.tileHeight > 0) { + this.options.tiffTileHeight = options.tileHeight; + } else { + throw is.invalidParameterError('tileHeight', 'integer greater than zero', options.tileHeight); + } + } + // miniswhite + if (is.defined(options.miniswhite)) { + this._setBooleanOption('tiffMiniswhite', options.miniswhite); + } + // pyramid + if (is.defined(options.pyramid)) { + this._setBooleanOption('tiffPyramid', options.pyramid); + } + // resolution + if (is.defined(options.xres)) { + if (is.number(options.xres) && options.xres > 0) { + this.options.tiffXres = options.xres; + } else { + throw is.invalidParameterError('xres', 'number greater than zero', options.xres); + } + } + if (is.defined(options.yres)) { + if (is.number(options.yres) && options.yres > 0) { + this.options.tiffYres = options.yres; + } else { + throw is.invalidParameterError('yres', 'number greater than zero', options.yres); + } + } + // compression + if (is.defined(options.compression)) { + if (is.string(options.compression) && is.inArray(options.compression, ['none', 'jpeg', 'deflate', 'packbits', 'ccittfax4', 'lzw', 'webp', 'zstd', 'jp2k'])) { + this.options.tiffCompression = options.compression; + } else { + throw is.invalidParameterError('compression', 'one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k', options.compression); + } + } + // bigtiff + if (is.defined(options.bigtiff)) { + this._setBooleanOption('tiffBigtiff', options.bigtiff); + } + // predictor + if (is.defined(options.predictor)) { + if (is.string(options.predictor) && is.inArray(options.predictor, ['none', 'horizontal', 'float'])) { + this.options.tiffPredictor = options.predictor; + } else { + throw is.invalidParameterError('predictor', 'one of: none, horizontal, float', options.predictor); + } + } + // resolutionUnit + if (is.defined(options.resolutionUnit)) { + if (is.string(options.resolutionUnit) && is.inArray(options.resolutionUnit, ['inch', 'cm'])) { + this.options.tiffResolutionUnit = options.resolutionUnit; + } else { + throw is.invalidParameterError('resolutionUnit', 'one of: inch, cm', options.resolutionUnit); + } + } + } + return this._updateFormatOut('tiff', options); +} + +/** + * Use these AVIF options for output image. + * + * AVIF image sequences are not supported. + * Prebuilt binaries support a bitdepth of 8 only. + * + * This feature is experimental on the Windows ARM64 platform + * and requires a CPU with ARM64v8.4 or later. + * + * @example + * const data = await sharp(input) + * .avif({ effort: 2 }) + * .toBuffer(); + * + * @example + * const data = await sharp(input) + * .avif({ lossless: true }) + * .toBuffer(); + * + * @since 0.27.0 + * + * @param {Object} [options] - output options + * @param {number} [options.quality=50] - quality, integer 1-100 + * @param {boolean} [options.lossless=false] - use lossless compression + * @param {number} [options.effort=4] - CPU effort, between 0 (fastest) and 9 (slowest) + * @param {string} [options.chromaSubsampling='4:4:4'] - set to '4:2:0' to use chroma subsampling + * @param {number} [options.bitdepth=8] - set bitdepth to 8, 10 or 12 bit + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function avif (options) { + return this.heif({ ...options, compression: 'av1' }); +} + +/** + * Use these HEIF options for output image. + * + * Support for patent-encumbered HEIC images using `hevc` compression requires the use of a + * globally-installed libvips compiled with support for libheif, libde265 and x265. + * + * @example + * const data = await sharp(input) + * .heif({ compression: 'hevc' }) + * .toBuffer(); + * + * @since 0.23.0 + * + * @param {Object} options - output options + * @param {string} options.compression - compression format: av1, hevc + * @param {number} [options.quality=50] - quality, integer 1-100 + * @param {boolean} [options.lossless=false] - use lossless compression + * @param {number} [options.effort=4] - CPU effort, between 0 (fastest) and 9 (slowest) + * @param {string} [options.chromaSubsampling='4:4:4'] - set to '4:2:0' to use chroma subsampling + * @param {number} [options.bitdepth=8] - set bitdepth to 8, 10 or 12 bit + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function heif (options) { + if (is.object(options)) { + if (is.string(options.compression) && is.inArray(options.compression, ['av1', 'hevc'])) { + this.options.heifCompression = options.compression; + } else { + throw is.invalidParameterError('compression', 'one of: av1, hevc', options.compression); + } + if (is.defined(options.quality)) { + if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { + this.options.heifQuality = options.quality; + } else { + throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality); + } + } + if (is.defined(options.lossless)) { + if (is.bool(options.lossless)) { + this.options.heifLossless = options.lossless; + } else { + throw is.invalidParameterError('lossless', 'boolean', options.lossless); + } + } + if (is.defined(options.effort)) { + if (is.integer(options.effort) && is.inRange(options.effort, 0, 9)) { + this.options.heifEffort = options.effort; + } else { + throw is.invalidParameterError('effort', 'integer between 0 and 9', options.effort); + } + } + if (is.defined(options.chromaSubsampling)) { + if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ['4:2:0', '4:4:4'])) { + this.options.heifChromaSubsampling = options.chromaSubsampling; + } else { + throw is.invalidParameterError('chromaSubsampling', 'one of: 4:2:0, 4:4:4', options.chromaSubsampling); + } + } + if (is.defined(options.bitdepth)) { + if (is.integer(options.bitdepth) && is.inArray(options.bitdepth, [8, 10, 12])) { + if (options.bitdepth !== 8 && this.constructor.versions.heif) { + throw is.invalidParameterError('bitdepth when using prebuilt binaries', 8, options.bitdepth); + } + this.options.heifBitdepth = options.bitdepth; + } else { + throw is.invalidParameterError('bitdepth', '8, 10 or 12', options.bitdepth); + } + } + } else { + throw is.invalidParameterError('options', 'Object', options); + } + return this._updateFormatOut('heif', options); +} + +/** + * Use these JPEG-XL (JXL) options for output image. + * + * This feature is experimental, please do not use in production systems. + * + * Requires libvips compiled with support for libjxl. + * The prebuilt binaries do not include this - see + * {@link /install/#custom-libvips installing a custom libvips}. + * + * @since 0.31.3 + * + * @param {Object} [options] - output options + * @param {number} [options.distance=1.0] - maximum encoding error, between 0 (highest quality) and 15 (lowest quality) + * @param {number} [options.quality] - calculate `distance` based on JPEG-like quality, between 1 and 100, overrides distance if specified + * @param {number} [options.decodingTier=0] - target decode speed tier, between 0 (highest quality) and 4 (lowest quality) + * @param {boolean} [options.lossless=false] - use lossless compression + * @param {number} [options.effort=7] - CPU effort, between 1 (fastest) and 9 (slowest) + * @param {number} [options.loop=0] - number of animation iterations, use 0 for infinite animation + * @param {number|number[]} [options.delay] - delay(s) between animation frames (in milliseconds) + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function jxl (options) { + if (is.object(options)) { + if (is.defined(options.quality)) { + if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) { + // https://github.com/libjxl/libjxl/blob/0aeea7f180bafd6893c1db8072dcb67d2aa5b03d/tools/cjxl_main.cc#L640-L644 + this.options.jxlDistance = options.quality >= 30 + ? 0.1 + (100 - options.quality) * 0.09 + : 53 / 3000 * options.quality * options.quality - 23 / 20 * options.quality + 25; + } else { + throw is.invalidParameterError('quality', 'integer between 1 and 100', options.quality); + } + } else if (is.defined(options.distance)) { + if (is.number(options.distance) && is.inRange(options.distance, 0, 15)) { + this.options.jxlDistance = options.distance; + } else { + throw is.invalidParameterError('distance', 'number between 0.0 and 15.0', options.distance); + } + } + if (is.defined(options.decodingTier)) { + if (is.integer(options.decodingTier) && is.inRange(options.decodingTier, 0, 4)) { + this.options.jxlDecodingTier = options.decodingTier; + } else { + throw is.invalidParameterError('decodingTier', 'integer between 0 and 4', options.decodingTier); + } + } + if (is.defined(options.lossless)) { + if (is.bool(options.lossless)) { + this.options.jxlLossless = options.lossless; + } else { + throw is.invalidParameterError('lossless', 'boolean', options.lossless); + } + } + if (is.defined(options.effort)) { + if (is.integer(options.effort) && is.inRange(options.effort, 1, 9)) { + this.options.jxlEffort = options.effort; + } else { + throw is.invalidParameterError('effort', 'integer between 1 and 9', options.effort); + } + } + } + trySetAnimationOptions(options, this.options); + return this._updateFormatOut('jxl', options); +} + +/** + * Force output to be raw, uncompressed pixel data. + * Pixel ordering is left-to-right, top-to-bottom, without padding. + * Channel ordering will be RGB or RGBA for non-greyscale colourspaces. + * + * @example + * // Extract raw, unsigned 8-bit RGB pixel data from JPEG input + * const { data, info } = await sharp('input.jpg') + * .raw() + * .toBuffer({ resolveWithObject: true }); + * + * @example + * // Extract alpha channel as raw, unsigned 16-bit pixel data from PNG input + * const data = await sharp('input.png') + * .ensureAlpha() + * .extractChannel(3) + * .toColourspace('b-w') + * .raw({ depth: 'ushort' }) + * .toBuffer(); + * + * @param {Object} [options] - output options + * @param {string} [options.depth='uchar'] - bit depth, one of: char, uchar (default), short, ushort, int, uint, float, complex, double, dpcomplex + * @returns {Sharp} + * @throws {Error} Invalid options + */ +function raw (options) { + if (is.object(options)) { + if (is.defined(options.depth)) { + if (is.string(options.depth) && is.inArray(options.depth, + ['char', 'uchar', 'short', 'ushort', 'int', 'uint', 'float', 'complex', 'double', 'dpcomplex'] + )) { + this.options.rawDepth = options.depth; + } else { + throw is.invalidParameterError('depth', 'one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex', options.depth); + } + } + } + return this._updateFormatOut('raw'); +} + +/** + * Use tile-based deep zoom (image pyramid) output. + * + * Set the format and options for tile images via the `toFormat`, `jpeg`, `png` or `webp` functions. + * Use a `.zip` or `.szi` file extension with `toFile` to write to a compressed archive file format. + * + * The container will be set to `zip` when the output is a Buffer or Stream, otherwise it will default to `fs`. + * + * @example + * sharp('input.tiff') + * .png() + * .tile({ + * size: 512 + * }) + * .toFile('output.dz', function(err, info) { + * // output.dzi is the Deep Zoom XML definition + * // output_files contains 512x512 tiles grouped by zoom level + * }); + * + * @example + * const zipFileWithTiles = await sharp(input) + * .tile({ basename: "tiles" }) + * .toBuffer(); + * + * @example + * const iiififier = sharp().tile({ layout: "iiif" }); + * readableStream + * .pipe(iiififier) + * .pipe(writeableStream); + * + * @param {Object} [options] + * @param {number} [options.size=256] tile size in pixels, a value between 1 and 8192. + * @param {number} [options.overlap=0] tile overlap in pixels, a value between 0 and 8192. + * @param {number} [options.angle=0] tile angle of rotation, must be a multiple of 90. + * @param {string|Object} [options.background={r: 255, g: 255, b: 255, alpha: 1}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to white without transparency. + * @param {string} [options.depth] how deep to make the pyramid, possible values are `onepixel`, `onetile` or `one`, default based on layout. + * @param {number} [options.skipBlanks=-1] Threshold to skip tile generation. Range is 0-255 for 8-bit images, 0-65535 for 16-bit images. Default is 5 for `google` layout, -1 (no skip) otherwise. + * @param {string} [options.container='fs'] tile container, with value `fs` (filesystem) or `zip` (compressed file). + * @param {string} [options.layout='dz'] filesystem layout, possible values are `dz`, `iiif`, `iiif3`, `zoomify` or `google`. + * @param {boolean} [options.centre=false] centre image in tile. + * @param {boolean} [options.center=false] alternative spelling of centre. + * @param {string} [options.id='https://example.com/iiif'] when `layout` is `iiif`/`iiif3`, sets the `@id`/`id` attribute of `info.json` + * @param {string} [options.basename] the name of the directory within the zip file when container is `zip`. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function tile (options) { + if (is.object(options)) { + // Size of square tiles, in pixels + if (is.defined(options.size)) { + if (is.integer(options.size) && is.inRange(options.size, 1, 8192)) { + this.options.tileSize = options.size; + } else { + throw is.invalidParameterError('size', 'integer between 1 and 8192', options.size); + } + } + // Overlap of tiles, in pixels + if (is.defined(options.overlap)) { + if (is.integer(options.overlap) && is.inRange(options.overlap, 0, 8192)) { + if (options.overlap > this.options.tileSize) { + throw is.invalidParameterError('overlap', `<= size (${this.options.tileSize})`, options.overlap); + } + this.options.tileOverlap = options.overlap; + } else { + throw is.invalidParameterError('overlap', 'integer between 0 and 8192', options.overlap); + } + } + // Container + if (is.defined(options.container)) { + if (is.string(options.container) && is.inArray(options.container, ['fs', 'zip'])) { + this.options.tileContainer = options.container; + } else { + throw is.invalidParameterError('container', 'one of: fs, zip', options.container); + } + } + // Layout + if (is.defined(options.layout)) { + if (is.string(options.layout) && is.inArray(options.layout, ['dz', 'google', 'iiif', 'iiif3', 'zoomify'])) { + this.options.tileLayout = options.layout; + } else { + throw is.invalidParameterError('layout', 'one of: dz, google, iiif, iiif3, zoomify', options.layout); + } + } + // Angle of rotation, + if (is.defined(options.angle)) { + if (is.integer(options.angle) && !(options.angle % 90)) { + this.options.tileAngle = options.angle; + } else { + throw is.invalidParameterError('angle', 'positive/negative multiple of 90', options.angle); + } + } + // Background colour + this._setBackgroundColourOption('tileBackground', options.background); + // Depth of tiles + if (is.defined(options.depth)) { + if (is.string(options.depth) && is.inArray(options.depth, ['onepixel', 'onetile', 'one'])) { + this.options.tileDepth = options.depth; + } else { + throw is.invalidParameterError('depth', 'one of: onepixel, onetile, one', options.depth); + } + } + // Threshold to skip blank tiles + if (is.defined(options.skipBlanks)) { + if (is.integer(options.skipBlanks) && is.inRange(options.skipBlanks, -1, 65535)) { + this.options.tileSkipBlanks = options.skipBlanks; + } else { + throw is.invalidParameterError('skipBlanks', 'integer between -1 and 255/65535', options.skipBlanks); + } + } else if (is.defined(options.layout) && options.layout === 'google') { + this.options.tileSkipBlanks = 5; + } + // Center image in tile + const centre = is.bool(options.center) ? options.center : options.centre; + if (is.defined(centre)) { + this._setBooleanOption('tileCentre', centre); + } + // @id attribute for IIIF layout + if (is.defined(options.id)) { + if (is.string(options.id)) { + this.options.tileId = options.id; + } else { + throw is.invalidParameterError('id', 'string', options.id); + } + } + // Basename for zip container + if (is.defined(options.basename)) { + if (is.string(options.basename)) { + this.options.tileBasename = options.basename; + } else { + throw is.invalidParameterError('basename', 'string', options.basename); + } + } + } + // Format + if (is.inArray(this.options.formatOut, ['jpeg', 'png', 'webp'])) { + this.options.tileFormat = this.options.formatOut; + } else if (this.options.formatOut !== 'input') { + throw is.invalidParameterError('format', 'one of: jpeg, png, webp', this.options.formatOut); + } + return this._updateFormatOut('dz'); +} + +/** + * Set a timeout for processing, in seconds. + * Use a value of zero to continue processing indefinitely, the default behaviour. + * + * The clock starts when libvips opens an input image for processing. + * Time spent waiting for a libuv thread to become available is not included. + * + * @example + * // Ensure processing takes no longer than 3 seconds + * try { + * const data = await sharp(input) + * .blur(1000) + * .timeout({ seconds: 3 }) + * .toBuffer(); + * } catch (err) { + * if (err.message.includes('timeout')) { ... } + * } + * + * @since 0.29.2 + * + * @param {Object} options + * @param {number} options.seconds - Number of seconds after which processing will be stopped + * @returns {Sharp} + */ +function timeout (options) { + if (!is.plainObject(options)) { + throw is.invalidParameterError('options', 'object', options); + } + if (is.integer(options.seconds) && is.inRange(options.seconds, 0, 3600)) { + this.options.timeoutSeconds = options.seconds; + } else { + throw is.invalidParameterError('seconds', 'integer between 0 and 3600', options.seconds); + } + return this; +} + +/** + * Update the output format unless options.force is false, + * in which case revert to input format. + * @private + * @param {string} formatOut + * @param {Object} [options] + * @param {boolean} [options.force=true] - force output format, otherwise attempt to use input format + * @returns {Sharp} + */ +function _updateFormatOut (formatOut, options) { + if (!(is.object(options) && options.force === false)) { + this.options.formatOut = formatOut; + } + return this; +} + +/** + * Update a boolean attribute of the this.options Object. + * @private + * @param {string} key + * @param {boolean} val + * @throws {Error} Invalid key + */ +function _setBooleanOption (key, val) { + if (is.bool(val)) { + this.options[key] = val; + } else { + throw is.invalidParameterError(key, 'boolean', val); + } +} + +/** + * Called by a WriteableStream to notify us it is ready for data. + * @private + */ +function _read () { + if (!this.options.streamOut) { + this.options.streamOut = true; + const stack = Error(); + this._pipeline(undefined, stack); + } +} + +/** + * Invoke the C++ image processing pipeline + * Supports callback, stream and promise variants + * @private + */ +function _pipeline (callback, stack) { + if (typeof callback === 'function') { + // output=file/buffer + if (this._isStreamInput()) { + // output=file/buffer, input=stream + this.on('finish', () => { + this._flattenBufferIn(); + sharp.pipeline(this.options, (err, data, info) => { + if (err) { + callback(is.nativeError(err, stack)); + } else { + callback(null, data, info); + } + }); + }); + } else { + // output=file/buffer, input=file/buffer + sharp.pipeline(this.options, (err, data, info) => { + if (err) { + callback(is.nativeError(err, stack)); + } else { + callback(null, data, info); + } + }); + } + return this; + } else if (this.options.streamOut) { + // output=stream + if (this._isStreamInput()) { + // output=stream, input=stream + this.once('finish', () => { + this._flattenBufferIn(); + sharp.pipeline(this.options, (err, data, info) => { + if (err) { + this.emit('error', is.nativeError(err, stack)); + } else { + this.emit('info', info); + this.push(data); + } + this.push(null); + this.on('end', () => this.emit('close')); + }); + }); + if (this.streamInFinished) { + this.emit('finish'); + } + } else { + // output=stream, input=file/buffer + sharp.pipeline(this.options, (err, data, info) => { + if (err) { + this.emit('error', is.nativeError(err, stack)); + } else { + this.emit('info', info); + this.push(data); + } + this.push(null); + this.on('end', () => this.emit('close')); + }); + } + return this; + } else { + // output=promise + if (this._isStreamInput()) { + // output=promise, input=stream + return new Promise((resolve, reject) => { + this.once('finish', () => { + this._flattenBufferIn(); + sharp.pipeline(this.options, (err, data, info) => { + if (err) { + reject(is.nativeError(err, stack)); + } else { + if (this.options.resolveWithObject) { + resolve({ data, info }); + } else { + resolve(data); + } + } + }); + }); + }); + } else { + // output=promise, input=file/buffer + return new Promise((resolve, reject) => { + sharp.pipeline(this.options, (err, data, info) => { + if (err) { + reject(is.nativeError(err, stack)); + } else { + if (this.options.resolveWithObject) { + resolve({ data, info }); + } else { + resolve(data); + } + } + }); + }); + } + } +} + +/** + * Decorate the Sharp prototype with output-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Object.assign(Sharp.prototype, { + // Public + toFile, + toBuffer, + keepExif, + withExif, + withExifMerge, + keepIccProfile, + withIccProfile, + keepXmp, + withXmp, + keepMetadata, + withMetadata, + toFormat, + jpeg, + jp2, + png, + webp, + tiff, + avif, + heif, + jxl, + gif, + raw, + tile, + timeout, + // Private + _updateFormatOut, + _setBooleanOption, + _read, + _pipeline + }); +}; diff --git a/node_modules/sharp/lib/resize.js b/node_modules/sharp/lib/resize.js new file mode 100644 index 0000000..544fbba --- /dev/null +++ b/node_modules/sharp/lib/resize.js @@ -0,0 +1,595 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const is = require('./is'); + +/** + * Weighting to apply when using contain/cover fit. + * @member + * @private + */ +const gravity = { + center: 0, + centre: 0, + north: 1, + east: 2, + south: 3, + west: 4, + northeast: 5, + southeast: 6, + southwest: 7, + northwest: 8 +}; + +/** + * Position to apply when using contain/cover fit. + * @member + * @private + */ +const position = { + top: 1, + right: 2, + bottom: 3, + left: 4, + 'right top': 5, + 'right bottom': 6, + 'left bottom': 7, + 'left top': 8 +}; + +/** + * How to extend the image. + * @member + * @private + */ +const extendWith = { + background: 'background', + copy: 'copy', + repeat: 'repeat', + mirror: 'mirror' +}; + +/** + * Strategies for automagic cover behaviour. + * @member + * @private + */ +const strategy = { + entropy: 16, + attention: 17 +}; + +/** + * Reduction kernels. + * @member + * @private + */ +const kernel = { + nearest: 'nearest', + linear: 'linear', + cubic: 'cubic', + mitchell: 'mitchell', + lanczos2: 'lanczos2', + lanczos3: 'lanczos3', + mks2013: 'mks2013', + mks2021: 'mks2021' +}; + +/** + * Methods by which an image can be resized to fit the provided dimensions. + * @member + * @private + */ +const fit = { + contain: 'contain', + cover: 'cover', + fill: 'fill', + inside: 'inside', + outside: 'outside' +}; + +/** + * Map external fit property to internal canvas property. + * @member + * @private + */ +const mapFitToCanvas = { + contain: 'embed', + cover: 'crop', + fill: 'ignore_aspect', + inside: 'max', + outside: 'min' +}; + +/** + * @private + */ +function isRotationExpected (options) { + return (options.angle % 360) !== 0 || options.rotationAngle !== 0; +} + +/** + * @private + */ +function isResizeExpected (options) { + return options.width !== -1 || options.height !== -1; +} + +/** + * Resize image to `width`, `height` or `width x height`. + * + * When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are: + * - `cover`: (default) Preserving aspect ratio, attempt to ensure the image covers both provided dimensions by cropping/clipping to fit. + * - `contain`: Preserving aspect ratio, contain within both provided dimensions using "letterboxing" where necessary. + * - `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions. + * - `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified. + * - `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified. + * + * Some of these values are based on the [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property. + * + * Examples of various values for the fit property when resizing + * + * When using a **fit** of `cover` or `contain`, the default **position** is `centre`. Other options are: + * - `sharp.position`: `top`, `right top`, `right`, `right bottom`, `bottom`, `left bottom`, `left`, `left top`. + * - `sharp.gravity`: `north`, `northeast`, `east`, `southeast`, `south`, `southwest`, `west`, `northwest`, `center` or `centre`. + * - `sharp.strategy`: `cover` only, dynamically crop using either the `entropy` or `attention` strategy. + * + * Some of these values are based on the [object-position](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position) CSS property. + * + * The strategy-based approach initially resizes so one dimension is at its target length + * then repeatedly ranks edge regions, discarding the edge with the lowest score based on the selected strategy. + * - `entropy`: focus on the region with the highest [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_%28information_theory%29). + * - `attention`: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones. + * + * Possible downsizing kernels are: + * - `nearest`: Use [nearest neighbour interpolation](http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation). + * - `linear`: Use a [triangle filter](https://en.wikipedia.org/wiki/Triangular_function). + * - `cubic`: Use a [Catmull-Rom spline](https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline). + * - `mitchell`: Use a [Mitchell-Netravali spline](https://www.cs.utexas.edu/~fussell/courses/cs384g-fall2013/lectures/mitchell/Mitchell.pdf). + * - `lanczos2`: Use a [Lanczos kernel](https://en.wikipedia.org/wiki/Lanczos_resampling#Lanczos_kernel) with `a=2`. + * - `lanczos3`: Use a Lanczos kernel with `a=3` (the default). + * - `mks2013`: Use a [Magic Kernel Sharp](https://johncostella.com/magic/mks.pdf) 2013 kernel, as adopted by Facebook. + * - `mks2021`: Use a Magic Kernel Sharp 2021 kernel, with more accurate (reduced) sharpening than the 2013 version. + * + * When upsampling, these kernels map to `nearest`, `linear` and `cubic` interpolators. + * Downsampling kernels without a matching upsampling interpolator map to `cubic`. + * + * Only one resize can occur per pipeline. + * Previous calls to `resize` in the same pipeline will be ignored. + * + * @example + * sharp(input) + * .resize({ width: 100 }) + * .toBuffer() + * .then(data => { + * // 100 pixels wide, auto-scaled height + * }); + * + * @example + * sharp(input) + * .resize({ height: 100 }) + * .toBuffer() + * .then(data => { + * // 100 pixels high, auto-scaled width + * }); + * + * @example + * sharp(input) + * .resize(200, 300, { + * kernel: sharp.kernel.nearest, + * fit: 'contain', + * position: 'right top', + * background: { r: 255, g: 255, b: 255, alpha: 0.5 } + * }) + * .toFile('output.png') + * .then(() => { + * // output.png is a 200 pixels wide and 300 pixels high image + * // containing a nearest-neighbour scaled version + * // contained within the north-east corner of a semi-transparent white canvas + * }); + * + * @example + * const transformer = sharp() + * .resize({ + * width: 200, + * height: 200, + * fit: sharp.fit.cover, + * position: sharp.strategy.entropy + * }); + * // Read image data from readableStream + * // Write 200px square auto-cropped image data to writableStream + * readableStream + * .pipe(transformer) + * .pipe(writableStream); + * + * @example + * sharp(input) + * .resize(200, 200, { + * fit: sharp.fit.inside, + * withoutEnlargement: true + * }) + * .toFormat('jpeg') + * .toBuffer() + * .then(function(outputBuffer) { + * // outputBuffer contains JPEG image data + * // no wider and no higher than 200 pixels + * // and no larger than the input image + * }); + * + * @example + * sharp(input) + * .resize(200, 200, { + * fit: sharp.fit.outside, + * withoutReduction: true + * }) + * .toFormat('jpeg') + * .toBuffer() + * .then(function(outputBuffer) { + * // outputBuffer contains JPEG image data + * // of at least 200 pixels wide and 200 pixels high while maintaining aspect ratio + * // and no smaller than the input image + * }); + * + * @example + * const scaleByHalf = await sharp(input) + * .metadata() + * .then(({ width }) => sharp(input) + * .resize(Math.round(width * 0.5)) + * .toBuffer() + * ); + * + * @param {number} [width] - How many pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height. + * @param {number} [height] - How many pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width. + * @param {Object} [options] + * @param {number} [options.width] - An alternative means of specifying `width`. If both are present this takes priority. + * @param {number} [options.height] - An alternative means of specifying `height`. If both are present this takes priority. + * @param {String} [options.fit='cover'] - How the image should be resized/cropped to fit the target dimension(s), one of `cover`, `contain`, `fill`, `inside` or `outside`. + * @param {String} [options.position='centre'] - A position, gravity or strategy to use when `fit` is `cover` or `contain`. + * @param {String|Object} [options.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour when `fit` is `contain`, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency. + * @param {String} [options.kernel='lanczos3'] - The kernel to use for image reduction and the inferred interpolator to use for upsampling. Use the `fastShrinkOnLoad` option to control kernel vs shrink-on-load. + * @param {Boolean} [options.withoutEnlargement=false] - Do not scale up if the width *or* height are already less than the target dimensions, equivalent to GraphicsMagick's `>` geometry option. This may result in output dimensions smaller than the target dimensions. + * @param {Boolean} [options.withoutReduction=false] - Do not scale down if the width *or* height are already greater than the target dimensions, equivalent to GraphicsMagick's `<` geometry option. This may still result in a crop to reach the target dimensions. + * @param {Boolean} [options.fastShrinkOnLoad=true] - Take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern or round-down of an auto-scaled dimension. + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function resize (widthOrOptions, height, options) { + if (isResizeExpected(this.options)) { + this.options.debuglog('ignoring previous resize options'); + } + if (this.options.widthPost !== -1) { + this.options.debuglog('operation order will be: extract, resize, extract'); + } + if (is.defined(widthOrOptions)) { + if (is.object(widthOrOptions) && !is.defined(options)) { + options = widthOrOptions; + } else if (is.integer(widthOrOptions) && widthOrOptions > 0) { + this.options.width = widthOrOptions; + } else { + throw is.invalidParameterError('width', 'positive integer', widthOrOptions); + } + } else { + this.options.width = -1; + } + if (is.defined(height)) { + if (is.integer(height) && height > 0) { + this.options.height = height; + } else { + throw is.invalidParameterError('height', 'positive integer', height); + } + } else { + this.options.height = -1; + } + if (is.object(options)) { + // Width + if (is.defined(options.width)) { + if (is.integer(options.width) && options.width > 0) { + this.options.width = options.width; + } else { + throw is.invalidParameterError('width', 'positive integer', options.width); + } + } + // Height + if (is.defined(options.height)) { + if (is.integer(options.height) && options.height > 0) { + this.options.height = options.height; + } else { + throw is.invalidParameterError('height', 'positive integer', options.height); + } + } + // Fit + if (is.defined(options.fit)) { + const canvas = mapFitToCanvas[options.fit]; + if (is.string(canvas)) { + this.options.canvas = canvas; + } else { + throw is.invalidParameterError('fit', 'valid fit', options.fit); + } + } + // Position + if (is.defined(options.position)) { + const pos = is.integer(options.position) + ? options.position + : strategy[options.position] || position[options.position] || gravity[options.position]; + if (is.integer(pos) && (is.inRange(pos, 0, 8) || is.inRange(pos, 16, 17))) { + this.options.position = pos; + } else { + throw is.invalidParameterError('position', 'valid position/gravity/strategy', options.position); + } + } + // Background + this._setBackgroundColourOption('resizeBackground', options.background); + // Kernel + if (is.defined(options.kernel)) { + if (is.string(kernel[options.kernel])) { + this.options.kernel = kernel[options.kernel]; + } else { + throw is.invalidParameterError('kernel', 'valid kernel name', options.kernel); + } + } + // Without enlargement + if (is.defined(options.withoutEnlargement)) { + this._setBooleanOption('withoutEnlargement', options.withoutEnlargement); + } + // Without reduction + if (is.defined(options.withoutReduction)) { + this._setBooleanOption('withoutReduction', options.withoutReduction); + } + // Shrink on load + if (is.defined(options.fastShrinkOnLoad)) { + this._setBooleanOption('fastShrinkOnLoad', options.fastShrinkOnLoad); + } + } + if (isRotationExpected(this.options) && isResizeExpected(this.options)) { + this.options.rotateBefore = true; + } + return this; +} + +/** + * Extend / pad / extrude one or more edges of the image with either + * the provided background colour or pixels derived from the image. + * This operation will always occur after resizing and extraction, if any. + * + * @example + * // Resize to 140 pixels wide, then add 10 transparent pixels + * // to the top, left and right edges and 20 to the bottom edge + * sharp(input) + * .resize(140) + * .extend({ + * top: 10, + * bottom: 20, + * left: 10, + * right: 10, + * background: { r: 0, g: 0, b: 0, alpha: 0 } + * }) + * ... + * +* @example + * // Add a row of 10 red pixels to the bottom + * sharp(input) + * .extend({ + * bottom: 10, + * background: 'red' + * }) + * ... + * + * @example + * // Extrude image by 8 pixels to the right, mirroring existing right hand edge + * sharp(input) + * .extend({ + * right: 8, + * background: 'mirror' + * }) + * ... + * + * @param {(number|Object)} extend - single pixel count to add to all edges or an Object with per-edge counts + * @param {number} [extend.top=0] + * @param {number} [extend.left=0] + * @param {number} [extend.bottom=0] + * @param {number} [extend.right=0] + * @param {String} [extend.extendWith='background'] - populate new pixels using this method, one of: background, copy, repeat, mirror. + * @param {String|Object} [extend.background={r: 0, g: 0, b: 0, alpha: 1}] - background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to black without transparency. + * @returns {Sharp} + * @throws {Error} Invalid parameters +*/ +function extend (extend) { + if (is.integer(extend) && extend > 0) { + this.options.extendTop = extend; + this.options.extendBottom = extend; + this.options.extendLeft = extend; + this.options.extendRight = extend; + } else if (is.object(extend)) { + if (is.defined(extend.top)) { + if (is.integer(extend.top) && extend.top >= 0) { + this.options.extendTop = extend.top; + } else { + throw is.invalidParameterError('top', 'positive integer', extend.top); + } + } + if (is.defined(extend.bottom)) { + if (is.integer(extend.bottom) && extend.bottom >= 0) { + this.options.extendBottom = extend.bottom; + } else { + throw is.invalidParameterError('bottom', 'positive integer', extend.bottom); + } + } + if (is.defined(extend.left)) { + if (is.integer(extend.left) && extend.left >= 0) { + this.options.extendLeft = extend.left; + } else { + throw is.invalidParameterError('left', 'positive integer', extend.left); + } + } + if (is.defined(extend.right)) { + if (is.integer(extend.right) && extend.right >= 0) { + this.options.extendRight = extend.right; + } else { + throw is.invalidParameterError('right', 'positive integer', extend.right); + } + } + this._setBackgroundColourOption('extendBackground', extend.background); + if (is.defined(extend.extendWith)) { + if (is.string(extendWith[extend.extendWith])) { + this.options.extendWith = extendWith[extend.extendWith]; + } else { + throw is.invalidParameterError('extendWith', 'one of: background, copy, repeat, mirror', extend.extendWith); + } + } + } else { + throw is.invalidParameterError('extend', 'integer or object', extend); + } + return this; +} + +/** + * Extract/crop a region of the image. + * + * - Use `extract` before `resize` for pre-resize extraction. + * - Use `extract` after `resize` for post-resize extraction. + * - Use `extract` twice and `resize` once for extract-then-resize-then-extract in a fixed operation order. + * + * @example + * sharp(input) + * .extract({ left: left, top: top, width: width, height: height }) + * .toFile(output, function(err) { + * // Extract a region of the input image, saving in the same format. + * }); + * @example + * sharp(input) + * .extract({ left: leftOffsetPre, top: topOffsetPre, width: widthPre, height: heightPre }) + * .resize(width, height) + * .extract({ left: leftOffsetPost, top: topOffsetPost, width: widthPost, height: heightPost }) + * .toFile(output, function(err) { + * // Extract a region, resize, then extract from the resized image + * }); + * + * @param {Object} options - describes the region to extract using integral pixel values + * @param {number} options.left - zero-indexed offset from left edge + * @param {number} options.top - zero-indexed offset from top edge + * @param {number} options.width - width of region to extract + * @param {number} options.height - height of region to extract + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function extract (options) { + const suffix = isResizeExpected(this.options) || this.options.widthPre !== -1 ? 'Post' : 'Pre'; + if (this.options[`width${suffix}`] !== -1) { + this.options.debuglog('ignoring previous extract options'); + } + ['left', 'top', 'width', 'height'].forEach(function (name) { + const value = options[name]; + if (is.integer(value) && value >= 0) { + this.options[name + (name === 'left' || name === 'top' ? 'Offset' : '') + suffix] = value; + } else { + throw is.invalidParameterError(name, 'integer', value); + } + }, this); + // Ensure existing rotation occurs before pre-resize extraction + if (isRotationExpected(this.options) && !isResizeExpected(this.options)) { + if (this.options.widthPre === -1 || this.options.widthPost === -1) { + this.options.rotateBefore = true; + } + } + if (this.options.input.autoOrient) { + this.options.orientBefore = true; + } + return this; +} + +/** + * Trim pixels from all edges that contain values similar to the given background colour, which defaults to that of the top-left pixel. + * + * Images with an alpha channel will use the combined bounding box of alpha and non-alpha channels. + * + * If the result of this operation would trim an image to nothing then no change is made. + * + * The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties. + * + * @example + * // Trim pixels with a colour similar to that of the top-left pixel. + * await sharp(input) + * .trim() + * .toFile(output); + * + * @example + * // Trim pixels with the exact same colour as that of the top-left pixel. + * await sharp(input) + * .trim({ + * threshold: 0 + * }) + * .toFile(output); + * + * @example + * // Assume input is line art and trim only pixels with a similar colour to red. + * const output = await sharp(input) + * .trim({ + * background: "#FF0000", + * lineArt: true + * }) + * .toBuffer(); + * + * @example + * // Trim all "yellow-ish" pixels, being more lenient with the higher threshold. + * const output = await sharp(input) + * .trim({ + * background: "yellow", + * threshold: 42, + * }) + * .toBuffer(); + * + * @param {Object} [options] + * @param {string|Object} [options.background='top-left pixel'] - Background colour, parsed by the [color](https://www.npmjs.org/package/color) module, defaults to that of the top-left pixel. + * @param {number} [options.threshold=10] - Allowed difference from the above colour, a positive number. + * @param {boolean} [options.lineArt=false] - Does the input more closely resemble line art (e.g. vector) rather than being photographic? + * @returns {Sharp} + * @throws {Error} Invalid parameters + */ +function trim (options) { + this.options.trimThreshold = 10; + if (is.defined(options)) { + if (is.object(options)) { + if (is.defined(options.background)) { + this._setBackgroundColourOption('trimBackground', options.background); + } + if (is.defined(options.threshold)) { + if (is.number(options.threshold) && options.threshold >= 0) { + this.options.trimThreshold = options.threshold; + } else { + throw is.invalidParameterError('threshold', 'positive number', options.threshold); + } + } + if (is.defined(options.lineArt)) { + this._setBooleanOption('trimLineArt', options.lineArt); + } + } else { + throw is.invalidParameterError('trim', 'object', options); + } + } + if (isRotationExpected(this.options)) { + this.options.rotateBefore = true; + } + return this; +} + +/** + * Decorate the Sharp prototype with resize-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Object.assign(Sharp.prototype, { + resize, + extend, + extract, + trim + }); + // Class attributes + Sharp.gravity = gravity; + Sharp.strategy = strategy; + Sharp.kernel = kernel; + Sharp.fit = fit; + Sharp.position = position; +}; diff --git a/node_modules/sharp/lib/sharp.js b/node_modules/sharp/lib/sharp.js new file mode 100644 index 0000000..1081c93 --- /dev/null +++ b/node_modules/sharp/lib/sharp.js @@ -0,0 +1,121 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +// Inspects the runtime environment and exports the relevant sharp.node binary + +const { familySync, versionSync } = require('detect-libc'); + +const { runtimePlatformArch, isUnsupportedNodeRuntime, prebuiltPlatforms, minimumLibvipsVersion } = require('./libvips'); +const runtimePlatform = runtimePlatformArch(); + +const paths = [ + `../src/build/Release/sharp-${runtimePlatform}.node`, + '../src/build/Release/sharp-wasm32.node', + `@img/sharp-${runtimePlatform}/sharp.node`, + '@img/sharp-wasm32/sharp.node' +]; + +/* node:coverage disable */ + +let path, sharp; +const errors = []; +for (path of paths) { + try { + sharp = require(path); + break; + } catch (err) { + errors.push(err); + } +} + +if (sharp && path.startsWith('@img/sharp-linux-x64') && !sharp._isUsingX64V2()) { + const err = new Error('Prebuilt binaries for linux-x64 require v2 microarchitecture'); + err.code = 'Unsupported CPU'; + errors.push(err); + sharp = null; +} + +if (sharp) { + module.exports = sharp; +} else { + const [isLinux, isMacOs, isWindows] = ['linux', 'darwin', 'win32'].map(os => runtimePlatform.startsWith(os)); + + const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`]; + errors.forEach(err => { + if (err.code !== 'MODULE_NOT_FOUND') { + help.push(`${err.code}: ${err.message}`); + } + }); + const messages = errors.map(err => err.message).join(' '); + help.push('Possible solutions:'); + // Common error messages + if (isUnsupportedNodeRuntime()) { + const { found, expected } = isUnsupportedNodeRuntime(); + help.push( + '- Please upgrade Node.js:', + ` Found ${found}`, + ` Requires ${expected}` + ); + } else if (prebuiltPlatforms.includes(runtimePlatform)) { + const [os, cpu] = runtimePlatform.split('-'); + const libc = os.endsWith('musl') ? ' --libc=musl' : ''; + help.push( + '- Ensure optional dependencies can be installed:', + ' npm install --include=optional sharp', + '- Ensure your package manager supports multi-platform installation:', + ' See https://sharp.pixelplumbing.com/install#cross-platform', + '- Add platform-specific dependencies:', + ` npm install --os=${os.replace('musl', '')}${libc} --cpu=${cpu} sharp` + ); + } else { + help.push( + `- Manually install libvips >= ${minimumLibvipsVersion}`, + '- Add experimental WebAssembly-based dependencies:', + ' npm install --cpu=wasm32 sharp', + ' npm install @img/sharp-wasm32' + ); + } + if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) { + try { + const { config } = require(`@img/sharp-libvips-${runtimePlatform}/package`); + const libcFound = `${familySync()} ${versionSync()}`; + const libcRequires = `${config.musl ? 'musl' : 'glibc'} ${config.musl || config.glibc}`; + help.push( + '- Update your OS:', + ` Found ${libcFound}`, + ` Requires ${libcRequires}` + ); + } catch (_errEngines) {} + } + if (isLinux && /\/snap\/core[0-9]{2}/.test(messages)) { + help.push( + '- Remove the Node.js Snap, which does not support native modules', + ' snap remove node' + ); + } + if (isMacOs && /Incompatible library version/.test(messages)) { + help.push( + '- Update Homebrew:', + ' brew update && brew upgrade vips' + ); + } + if (errors.some(err => err.code === 'ERR_DLOPEN_DISABLED')) { + help.push('- Run Node.js without using the --no-addons flag'); + } + // Link to installation docs + if (isWindows && /The specified procedure could not be found/.test(messages)) { + help.push( + '- Using the canvas package on Windows?', + ' See https://sharp.pixelplumbing.com/install#canvas-and-windows', + '- Check for outdated versions of sharp in the dependency tree:', + ' npm ls sharp' + ); + } + help.push( + '- Consult the installation documentation:', + ' See https://sharp.pixelplumbing.com/install' + ); + throw new Error(help.join('\n')); +} diff --git a/node_modules/sharp/lib/utility.js b/node_modules/sharp/lib/utility.js new file mode 100644 index 0000000..c0ad39f --- /dev/null +++ b/node_modules/sharp/lib/utility.js @@ -0,0 +1,291 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +const events = require('node:events'); +const detectLibc = require('detect-libc'); + +const is = require('./is'); +const { runtimePlatformArch } = require('./libvips'); +const sharp = require('./sharp'); + +const runtimePlatform = runtimePlatformArch(); +const libvipsVersion = sharp.libvipsVersion(); + +/** + * An Object containing nested boolean values representing the available input and output formats/methods. + * @member + * @example + * console.log(sharp.format); + * @returns {Object} + */ +const format = sharp.format(); +format.heif.output.alias = ['avif', 'heic']; +format.jpeg.output.alias = ['jpe', 'jpg']; +format.tiff.output.alias = ['tif']; +format.jp2k.output.alias = ['j2c', 'j2k', 'jp2', 'jpx']; + +/** + * An Object containing the available interpolators and their proper values + * @readonly + * @enum {string} + */ +const interpolators = { + /** [Nearest neighbour interpolation](http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation). Suitable for image enlargement only. */ + nearest: 'nearest', + /** [Bilinear interpolation](http://en.wikipedia.org/wiki/Bilinear_interpolation). Faster than bicubic but with less smooth results. */ + bilinear: 'bilinear', + /** [Bicubic interpolation](http://en.wikipedia.org/wiki/Bicubic_interpolation) (the default). */ + bicubic: 'bicubic', + /** [LBB interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/lbb.cpp#L100). Prevents some "[acutance](http://en.wikipedia.org/wiki/Acutance)" but typically reduces performance by a factor of 2. */ + locallyBoundedBicubic: 'lbb', + /** [Nohalo interpolation](http://eprints.soton.ac.uk/268086/). Prevents acutance but typically reduces performance by a factor of 3. */ + nohalo: 'nohalo', + /** [VSQBS interpolation](https://github.com/libvips/libvips/blob/master/libvips/resample/vsqbs.cpp#L48). Prevents "staircasing" when enlarging. */ + vertexSplitQuadraticBasisSpline: 'vsqbs' +}; + +/** + * An Object containing the version numbers of sharp, libvips + * and (when using prebuilt binaries) its dependencies. + * + * @member + * @example + * console.log(sharp.versions); + */ +let versions = { + vips: libvipsVersion.semver +}; +/* node:coverage ignore next 15 */ +if (!libvipsVersion.isGlobal) { + if (!libvipsVersion.isWasm) { + try { + versions = require(`@img/sharp-${runtimePlatform}/versions`); + } catch (_) { + try { + versions = require(`@img/sharp-libvips-${runtimePlatform}/versions`); + } catch (_) {} + } + } else { + try { + versions = require('@img/sharp-wasm32/versions'); + } catch (_) {} + } +} +versions.sharp = require('../package.json').version; + +/* node:coverage ignore next 5 */ +if (versions.heif && format.heif) { + // Prebuilt binaries provide AV1 + format.heif.input.fileSuffix = ['.avif']; + format.heif.output.alias = ['avif']; +} + +/** + * Gets or, when options are provided, sets the limits of _libvips'_ operation cache. + * Existing entries in the cache will be trimmed after any change in limits. + * This method always returns cache statistics, + * useful for determining how much working memory is required for a particular task. + * + * @example + * const stats = sharp.cache(); + * @example + * sharp.cache( { items: 200 } ); + * sharp.cache( { files: 0 } ); + * sharp.cache(false); + * + * @param {Object|boolean} [options=true] - Object with the following attributes, or boolean where true uses default cache settings and false removes all caching + * @param {number} [options.memory=50] - is the maximum memory in MB to use for this cache + * @param {number} [options.files=20] - is the maximum number of files to hold open + * @param {number} [options.items=100] - is the maximum number of operations to cache + * @returns {Object} + */ +function cache (options) { + if (is.bool(options)) { + if (options) { + // Default cache settings of 50MB, 20 files, 100 items + return sharp.cache(50, 20, 100); + } else { + return sharp.cache(0, 0, 0); + } + } else if (is.object(options)) { + return sharp.cache(options.memory, options.files, options.items); + } else { + return sharp.cache(); + } +} +cache(true); + +/** + * Gets or, when a concurrency is provided, sets + * the maximum number of threads _libvips_ should use to process _each image_. + * These are from a thread pool managed by glib, + * which helps avoid the overhead of creating new threads. + * + * This method always returns the current concurrency. + * + * The default value is the number of CPU cores, + * except when using glibc-based Linux without jemalloc, + * where the default is `1` to help reduce memory fragmentation. + * + * A value of `0` will reset this to the number of CPU cores. + * + * Some image format libraries spawn additional threads, + * e.g. libaom manages its own 4 threads when encoding AVIF images, + * and these are independent of the value set here. + * + * :::note + * Further {@link /performance/ control over performance} is available. + * ::: + * + * @example + * const threads = sharp.concurrency(); // 4 + * sharp.concurrency(2); // 2 + * sharp.concurrency(0); // 4 + * + * @param {number} [concurrency] + * @returns {number} concurrency + */ +function concurrency (concurrency) { + return sharp.concurrency(is.integer(concurrency) ? concurrency : null); +} +/* node:coverage ignore next 7 */ +if (detectLibc.familySync() === detectLibc.GLIBC && !sharp._isUsingJemalloc()) { + // Reduce default concurrency to 1 when using glibc memory allocator + sharp.concurrency(1); +} else if (detectLibc.familySync() === detectLibc.MUSL && sharp.concurrency() === 1024) { + // Reduce default concurrency when musl thread over-subscription detected + sharp.concurrency(require('node:os').availableParallelism()); +} + +/** + * An EventEmitter that emits a `change` event when a task is either: + * - queued, waiting for _libuv_ to provide a worker thread + * - complete + * @member + * @example + * sharp.queue.on('change', function(queueLength) { + * console.log('Queue contains ' + queueLength + ' task(s)'); + * }); + */ +const queue = new events.EventEmitter(); + +/** + * Provides access to internal task counters. + * - queue is the number of tasks this module has queued waiting for _libuv_ to provide a worker thread from its pool. + * - process is the number of resize tasks currently being processed. + * + * @example + * const counters = sharp.counters(); // { queue: 2, process: 4 } + * + * @returns {Object} + */ +function counters () { + return sharp.counters(); +} + +/** + * Get and set use of SIMD vector unit instructions. + * Requires libvips to have been compiled with highway support. + * + * Improves the performance of `resize`, `blur` and `sharpen` operations + * by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM NEON. + * + * @example + * const simd = sharp.simd(); + * // simd is `true` if the runtime use of highway is currently enabled + * @example + * const simd = sharp.simd(false); + * // prevent libvips from using highway at runtime + * + * @param {boolean} [simd=true] + * @returns {boolean} + */ +function simd (simd) { + return sharp.simd(is.bool(simd) ? simd : null); +} + +/** + * Block libvips operations at runtime. + * + * This is in addition to the `VIPS_BLOCK_UNTRUSTED` environment variable, + * which when set will block all "untrusted" operations. + * + * @since 0.32.4 + * + * @example Block all TIFF input. + * sharp.block({ + * operation: ['VipsForeignLoadTiff'] + * }); + * + * @param {Object} options + * @param {Array} options.operation - List of libvips low-level operation names to block. + */ +function block (options) { + if (is.object(options)) { + if (Array.isArray(options.operation) && options.operation.every(is.string)) { + sharp.block(options.operation, true); + } else { + throw is.invalidParameterError('operation', 'Array', options.operation); + } + } else { + throw is.invalidParameterError('options', 'object', options); + } +} + +/** + * Unblock libvips operations at runtime. + * + * This is useful for defining a list of allowed operations. + * + * @since 0.32.4 + * + * @example Block all input except WebP from the filesystem. + * sharp.block({ + * operation: ['VipsForeignLoad'] + * }); + * sharp.unblock({ + * operation: ['VipsForeignLoadWebpFile'] + * }); + * + * @example Block all input except JPEG and PNG from a Buffer or Stream. + * sharp.block({ + * operation: ['VipsForeignLoad'] + * }); + * sharp.unblock({ + * operation: ['VipsForeignLoadJpegBuffer', 'VipsForeignLoadPngBuffer'] + * }); + * + * @param {Object} options + * @param {Array} options.operation - List of libvips low-level operation names to unblock. + */ +function unblock (options) { + if (is.object(options)) { + if (Array.isArray(options.operation) && options.operation.every(is.string)) { + sharp.block(options.operation, false); + } else { + throw is.invalidParameterError('operation', 'Array', options.operation); + } + } else { + throw is.invalidParameterError('options', 'object', options); + } +} + +/** + * Decorate the Sharp class with utility-related functions. + * @module Sharp + * @private + */ +module.exports = (Sharp) => { + Sharp.cache = cache; + Sharp.concurrency = concurrency; + Sharp.counters = counters; + Sharp.simd = simd; + Sharp.format = format; + Sharp.interpolators = interpolators; + Sharp.versions = versions; + Sharp.queue = queue; + Sharp.block = block; + Sharp.unblock = unblock; +}; diff --git a/node_modules/sharp/package.json b/node_modules/sharp/package.json new file mode 100644 index 0000000..0c0d009 --- /dev/null +++ b/node_modules/sharp/package.json @@ -0,0 +1,202 @@ +{ + "name": "sharp", + "description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images", + "version": "0.34.5", + "author": "Lovell Fuller ", + "homepage": "https://sharp.pixelplumbing.com", + "contributors": [ + "Pierre Inglebert ", + "Jonathan Ong ", + "Chanon Sajjamanochai ", + "Juliano Julio ", + "Daniel Gasienica ", + "Julian Walker ", + "Amit Pitaru ", + "Brandon Aaron ", + "Andreas Lind ", + "Maurus Cuelenaere ", + "Linus Unnebäck ", + "Victor Mateevitsi ", + "Alaric Holloway ", + "Bernhard K. Weisshuhn ", + "Chris Riley ", + "David Carley ", + "John Tobin ", + "Kenton Gray ", + "Felix Bünemann ", + "Samy Al Zahrani ", + "Chintan Thakkar ", + "F. Orlando Galashan ", + "Kleis Auke Wolthuizen ", + "Matt Hirsch ", + "Matthias Thoemmes ", + "Patrick Paskaris ", + "Jérémy Lal ", + "Rahul Nanwani ", + "Alice Monday ", + "Kristo Jorgenson ", + "YvesBos ", + "Guy Maliar ", + "Nicolas Coden ", + "Matt Parrish ", + "Marcel Bretschneider ", + "Matthew McEachen ", + "Jarda Kotěšovec ", + "Kenric D'Souza ", + "Oleh Aleinyk ", + "Marcel Bretschneider ", + "Andrea Bianco ", + "Rik Heywood ", + "Thomas Parisot ", + "Nathan Graves ", + "Tom Lokhorst ", + "Espen Hovlandsdal ", + "Sylvain Dumont ", + "Alun Davies ", + "Aidan Hoolachan ", + "Axel Eirola ", + "Freezy ", + "Daiz ", + "Julian Aubourg ", + "Keith Belovay ", + "Michael B. Klein ", + "Jordan Prudhomme ", + "Ilya Ovdin ", + "Andargor ", + "Paul Neave ", + "Brendan Kennedy ", + "Brychan Bennett-Odlum ", + "Edward Silverton ", + "Roman Malieiev ", + "Tomas Szabo ", + "Robert O'Rourke ", + "Guillermo Alfonso Varela Chouciño ", + "Christian Flintrup ", + "Manan Jadhav ", + "Leon Radley ", + "alza54 ", + "Jacob Smith ", + "Michael Nutt ", + "Brad Parham ", + "Taneli Vatanen ", + "Joris Dugué ", + "Chris Banks ", + "Ompal Singh ", + "Brodan ", + "Ankur Parihar ", + "Brahim Ait elhaj ", + "Mart Jansink ", + "Lachlan Newman ", + "Dennis Beatty ", + "Ingvar Stepanyan ", + "Don Denton " + ], + "scripts": { + "build": "node install/build.js", + "install": "node install/check.js || npm run build", + "clean": "rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*", + "test": "npm run lint && npm run test-unit", + "lint": "npm run lint-cpp && npm run lint-js && npm run lint-types", + "lint-cpp": "cpplint --quiet src/*.h src/*.cc", + "lint-js": "biome lint", + "lint-types": "tsd --files ./test/types/sharp.test-d.ts", + "test-leak": "./test/leak/leak.sh", + "test-unit": "node --experimental-test-coverage test/unit.mjs", + "package-from-local-build": "node npm/from-local-build.js", + "package-release-notes": "node npm/release-notes.js", + "docs-build": "node docs/build.mjs", + "docs-serve": "cd docs && npm start", + "docs-publish": "cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp" + }, + "type": "commonjs", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "install", + "lib", + "src/*.{cc,h,gyp}" + ], + "repository": { + "type": "git", + "url": "git://github.com/lovell/sharp.git" + }, + "keywords": [ + "jpeg", + "png", + "webp", + "avif", + "tiff", + "gif", + "svg", + "jp2", + "dzi", + "image", + "resize", + "thumbnail", + "crop", + "embed", + "libvips", + "vips" + ], + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + }, + "devDependencies": { + "@biomejs/biome": "^2.3.4", + "@cpplint/cli": "^0.1.0", + "@emnapi/runtime": "^1.7.0", + "@img/sharp-libvips-dev": "1.2.4", + "@img/sharp-libvips-dev-wasm32": "1.2.4", + "@img/sharp-libvips-win32-arm64": "1.2.4", + "@img/sharp-libvips-win32-ia32": "1.2.4", + "@img/sharp-libvips-win32-x64": "1.2.4", + "@types/node": "*", + "emnapi": "^1.7.0", + "exif-reader": "^2.0.2", + "extract-zip": "^2.0.1", + "icc": "^3.0.0", + "jsdoc-to-markdown": "^9.1.3", + "node-addon-api": "^8.5.0", + "node-gyp": "^11.5.0", + "tar-fs": "^3.1.1", + "tsd": "^0.33.0" + }, + "license": "Apache-2.0", + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "config": { + "libvips": ">=8.17.3" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } +} diff --git a/node_modules/sharp/src/binding.gyp b/node_modules/sharp/src/binding.gyp new file mode 100644 index 0000000..c4ec70c --- /dev/null +++ b/node_modules/sharp/src/binding.gyp @@ -0,0 +1,298 @@ +# Copyright 2013 Lovell Fuller and others. +# SPDX-License-Identifier: Apache-2.0 + +{ + 'variables': { + 'vips_version': ' +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "./common.h" + +using vips::VImage; + +namespace sharp { + + // Convenience methods to access the attributes of a Napi::Object + bool HasAttr(Napi::Object obj, std::string attr) { + return obj.Has(attr); + } + std::string AttrAsStr(Napi::Object obj, std::string attr) { + return obj.Get(attr).As(); + } + std::string AttrAsStr(Napi::Object obj, unsigned int const attr) { + return obj.Get(attr).As(); + } + uint32_t AttrAsUint32(Napi::Object obj, std::string attr) { + return obj.Get(attr).As().Uint32Value(); + } + int32_t AttrAsInt32(Napi::Object obj, std::string attr) { + return obj.Get(attr).As().Int32Value(); + } + int32_t AttrAsInt32(Napi::Object obj, unsigned int const attr) { + return obj.Get(attr).As().Int32Value(); + } + int64_t AttrAsInt64(Napi::Object obj, std::string attr) { + return obj.Get(attr).As().Int64Value(); + } + double AttrAsDouble(Napi::Object obj, std::string attr) { + return obj.Get(attr).As().DoubleValue(); + } + double AttrAsDouble(Napi::Object obj, unsigned int const attr) { + return obj.Get(attr).As().DoubleValue(); + } + bool AttrAsBool(Napi::Object obj, std::string attr) { + return obj.Get(attr).As().Value(); + } + std::vector AttrAsVectorOfDouble(Napi::Object obj, std::string attr) { + Napi::Array napiArray = obj.Get(attr).As(); + std::vector vectorOfDouble(napiArray.Length()); + for (unsigned int i = 0; i < napiArray.Length(); i++) { + vectorOfDouble[i] = AttrAsDouble(napiArray, i); + } + return vectorOfDouble; + } + std::vector AttrAsInt32Vector(Napi::Object obj, std::string attr) { + Napi::Array array = obj.Get(attr).As(); + std::vector vector(array.Length()); + for (unsigned int i = 0; i < array.Length(); i++) { + vector[i] = AttrAsInt32(array, i); + } + return vector; + } + + // Create an InputDescriptor instance from a Napi::Object describing an input image + InputDescriptor* CreateInputDescriptor(Napi::Object input) { + InputDescriptor *descriptor = new InputDescriptor; + if (HasAttr(input, "file")) { + descriptor->file = AttrAsStr(input, "file"); + } else if (HasAttr(input, "buffer")) { + Napi::Buffer buffer = input.Get("buffer").As>(); + descriptor->bufferLength = buffer.Length(); + descriptor->buffer = buffer.Data(); + descriptor->isBuffer = true; + } + descriptor->failOn = AttrAsEnum(input, "failOn", VIPS_TYPE_FAIL_ON); + // Density for vector-based input + if (HasAttr(input, "density")) { + descriptor->density = AttrAsDouble(input, "density"); + } + // Should we ignore any embedded ICC profile + if (HasAttr(input, "ignoreIcc")) { + descriptor->ignoreIcc = AttrAsBool(input, "ignoreIcc"); + } + // Raw pixel input + if (HasAttr(input, "rawChannels")) { + descriptor->rawDepth = AttrAsEnum(input, "rawDepth", VIPS_TYPE_BAND_FORMAT); + descriptor->rawChannels = AttrAsUint32(input, "rawChannels"); + descriptor->rawWidth = AttrAsUint32(input, "rawWidth"); + descriptor->rawHeight = AttrAsUint32(input, "rawHeight"); + descriptor->rawPremultiplied = AttrAsBool(input, "rawPremultiplied"); + descriptor->rawPageHeight = AttrAsUint32(input, "rawPageHeight"); + } + // Multi-page input (GIF, TIFF, PDF) + if (HasAttr(input, "pages")) { + descriptor->pages = AttrAsInt32(input, "pages"); + } + if (HasAttr(input, "page")) { + descriptor->page = AttrAsUint32(input, "page"); + } + // SVG + if (HasAttr(input, "svgStylesheet")) { + descriptor->svgStylesheet = AttrAsStr(input, "svgStylesheet"); + } + if (HasAttr(input, "svgHighBitdepth")) { + descriptor->svgHighBitdepth = AttrAsBool(input, "svgHighBitdepth"); + } + // Multi-level input (OpenSlide) + if (HasAttr(input, "openSlideLevel")) { + descriptor->openSlideLevel = AttrAsUint32(input, "openSlideLevel"); + } + // subIFD (OME-TIFF) + if (HasAttr(input, "subifd")) { + descriptor->tiffSubifd = AttrAsInt32(input, "tiffSubifd"); + } + // // PDF background color + if (HasAttr(input, "pdfBackground")) { + descriptor->pdfBackground = AttrAsVectorOfDouble(input, "pdfBackground"); + } + // Use JPEG 2000 oneshot mode? + if (HasAttr(input, "jp2Oneshot")) { + descriptor->jp2Oneshot = AttrAsBool(input, "jp2Oneshot"); + } + // Create new image + if (HasAttr(input, "createChannels")) { + descriptor->createChannels = AttrAsUint32(input, "createChannels"); + descriptor->createWidth = AttrAsUint32(input, "createWidth"); + descriptor->createHeight = AttrAsUint32(input, "createHeight"); + descriptor->createPageHeight = AttrAsUint32(input, "createPageHeight"); + if (HasAttr(input, "createNoiseType")) { + descriptor->createNoiseType = AttrAsStr(input, "createNoiseType"); + descriptor->createNoiseMean = AttrAsDouble(input, "createNoiseMean"); + descriptor->createNoiseSigma = AttrAsDouble(input, "createNoiseSigma"); + } else { + descriptor->createBackground = AttrAsVectorOfDouble(input, "createBackground"); + } + } + // Create new image with text + if (HasAttr(input, "textValue")) { + descriptor->textValue = AttrAsStr(input, "textValue"); + if (HasAttr(input, "textFont")) { + descriptor->textFont = AttrAsStr(input, "textFont"); + } + if (HasAttr(input, "textFontfile")) { + descriptor->textFontfile = AttrAsStr(input, "textFontfile"); + } + if (HasAttr(input, "textWidth")) { + descriptor->textWidth = AttrAsUint32(input, "textWidth"); + } + if (HasAttr(input, "textHeight")) { + descriptor->textHeight = AttrAsUint32(input, "textHeight"); + } + if (HasAttr(input, "textAlign")) { + descriptor->textAlign = AttrAsEnum(input, "textAlign", VIPS_TYPE_ALIGN); + } + if (HasAttr(input, "textJustify")) { + descriptor->textJustify = AttrAsBool(input, "textJustify"); + } + if (HasAttr(input, "textDpi")) { + descriptor->textDpi = AttrAsUint32(input, "textDpi"); + } + if (HasAttr(input, "textRgba")) { + descriptor->textRgba = AttrAsBool(input, "textRgba"); + } + if (HasAttr(input, "textSpacing")) { + descriptor->textSpacing = AttrAsUint32(input, "textSpacing"); + } + if (HasAttr(input, "textWrap")) { + descriptor->textWrap = AttrAsEnum(input, "textWrap", VIPS_TYPE_TEXT_WRAP); + } + } + // Join images together + if (HasAttr(input, "joinAnimated")) { + descriptor->joinAnimated = AttrAsBool(input, "joinAnimated"); + } + if (HasAttr(input, "joinAcross")) { + descriptor->joinAcross = AttrAsUint32(input, "joinAcross"); + } + if (HasAttr(input, "joinShim")) { + descriptor->joinShim = AttrAsUint32(input, "joinShim"); + } + if (HasAttr(input, "joinBackground")) { + descriptor->joinBackground = AttrAsVectorOfDouble(input, "joinBackground"); + } + if (HasAttr(input, "joinHalign")) { + descriptor->joinHalign = AttrAsEnum(input, "joinHalign", VIPS_TYPE_ALIGN); + } + if (HasAttr(input, "joinValign")) { + descriptor->joinValign = AttrAsEnum(input, "joinValign", VIPS_TYPE_ALIGN); + } + // Limit input images to a given number of pixels, where pixels = width * height + descriptor->limitInputPixels = static_cast(AttrAsInt64(input, "limitInputPixels")); + if (HasAttr(input, "access")) { + descriptor->access = AttrAsBool(input, "sequentialRead") ? VIPS_ACCESS_SEQUENTIAL : VIPS_ACCESS_RANDOM; + } + // Remove safety features and allow unlimited input + descriptor->unlimited = AttrAsBool(input, "unlimited"); + // Use the EXIF orientation to auto orient the image + descriptor->autoOrient = AttrAsBool(input, "autoOrient"); + return descriptor; + } + + // How many tasks are in the queue? + std::atomic counterQueue{0}; + + // How many tasks are being processed? + std::atomic counterProcess{0}; + + // Filename extension checkers + static bool EndsWith(std::string const &str, std::string const &end) { + return str.length() >= end.length() && 0 == str.compare(str.length() - end.length(), end.length(), end); + } + bool IsJpeg(std::string const &str) { + return EndsWith(str, ".jpg") || EndsWith(str, ".jpeg") || EndsWith(str, ".JPG") || EndsWith(str, ".JPEG"); + } + bool IsPng(std::string const &str) { + return EndsWith(str, ".png") || EndsWith(str, ".PNG"); + } + bool IsWebp(std::string const &str) { + return EndsWith(str, ".webp") || EndsWith(str, ".WEBP"); + } + bool IsGif(std::string const &str) { + return EndsWith(str, ".gif") || EndsWith(str, ".GIF"); + } + bool IsJp2(std::string const &str) { + return EndsWith(str, ".jp2") || EndsWith(str, ".jpx") || EndsWith(str, ".j2k") || EndsWith(str, ".j2c") + || EndsWith(str, ".JP2") || EndsWith(str, ".JPX") || EndsWith(str, ".J2K") || EndsWith(str, ".J2C"); + } + bool IsTiff(std::string const &str) { + return EndsWith(str, ".tif") || EndsWith(str, ".tiff") || EndsWith(str, ".TIF") || EndsWith(str, ".TIFF"); + } + bool IsHeic(std::string const &str) { + return EndsWith(str, ".heic") || EndsWith(str, ".HEIC"); + } + bool IsHeif(std::string const &str) { + return EndsWith(str, ".heif") || EndsWith(str, ".HEIF") || IsHeic(str) || IsAvif(str); + } + bool IsAvif(std::string const &str) { + return EndsWith(str, ".avif") || EndsWith(str, ".AVIF"); + } + bool IsJxl(std::string const &str) { + return EndsWith(str, ".jxl") || EndsWith(str, ".JXL"); + } + bool IsDz(std::string const &str) { + return EndsWith(str, ".dzi") || EndsWith(str, ".DZI"); + } + bool IsDzZip(std::string const &str) { + return EndsWith(str, ".zip") || EndsWith(str, ".ZIP") || EndsWith(str, ".szi") || EndsWith(str, ".SZI"); + } + bool IsV(std::string const &str) { + return EndsWith(str, ".v") || EndsWith(str, ".V") || EndsWith(str, ".vips") || EndsWith(str, ".VIPS"); + } + + /* + Trim space from end of string. + */ + std::string TrimEnd(std::string const &str) { + return str.substr(0, str.find_last_not_of(" \n\r\f") + 1); + } + + /* + Provide a string identifier for the given image type. + */ + std::string ImageTypeId(ImageType const imageType) { + std::string id; + switch (imageType) { + case ImageType::JPEG: id = "jpeg"; break; + case ImageType::PNG: id = "png"; break; + case ImageType::WEBP: id = "webp"; break; + case ImageType::TIFF: id = "tiff"; break; + case ImageType::GIF: id = "gif"; break; + case ImageType::JP2: id = "jp2"; break; + case ImageType::SVG: id = "svg"; break; + case ImageType::HEIF: id = "heif"; break; + case ImageType::PDF: id = "pdf"; break; + case ImageType::MAGICK: id = "magick"; break; + case ImageType::OPENSLIDE: id = "openslide"; break; + case ImageType::PPM: id = "ppm"; break; + case ImageType::FITS: id = "fits"; break; + case ImageType::EXR: id = "exr"; break; + case ImageType::JXL: id = "jxl"; break; + case ImageType::RAD: id = "rad"; break; + case ImageType::DCRAW: id = "dcraw"; break; + case ImageType::VIPS: id = "vips"; break; + case ImageType::RAW: id = "raw"; break; + case ImageType::UNKNOWN: id = "unknown"; break; + case ImageType::MISSING: id = "missing"; break; + } + return id; + } + + /** + * Regenerate this table with something like: + * + * $ vips -l foreign | grep -i load | awk '{ print $2, $1; }' + * + * Plus a bit of editing. + */ + std::map loaderToType = { + { "VipsForeignLoadJpegFile", ImageType::JPEG }, + { "VipsForeignLoadJpegBuffer", ImageType::JPEG }, + { "VipsForeignLoadPngFile", ImageType::PNG }, + { "VipsForeignLoadPngBuffer", ImageType::PNG }, + { "VipsForeignLoadWebpFile", ImageType::WEBP }, + { "VipsForeignLoadWebpBuffer", ImageType::WEBP }, + { "VipsForeignLoadTiffFile", ImageType::TIFF }, + { "VipsForeignLoadTiffBuffer", ImageType::TIFF }, + { "VipsForeignLoadGifFile", ImageType::GIF }, + { "VipsForeignLoadGifBuffer", ImageType::GIF }, + { "VipsForeignLoadNsgifFile", ImageType::GIF }, + { "VipsForeignLoadNsgifBuffer", ImageType::GIF }, + { "VipsForeignLoadJp2kBuffer", ImageType::JP2 }, + { "VipsForeignLoadJp2kFile", ImageType::JP2 }, + { "VipsForeignLoadSvgFile", ImageType::SVG }, + { "VipsForeignLoadSvgBuffer", ImageType::SVG }, + { "VipsForeignLoadHeifFile", ImageType::HEIF }, + { "VipsForeignLoadHeifBuffer", ImageType::HEIF }, + { "VipsForeignLoadPdfFile", ImageType::PDF }, + { "VipsForeignLoadPdfBuffer", ImageType::PDF }, + { "VipsForeignLoadMagickFile", ImageType::MAGICK }, + { "VipsForeignLoadMagickBuffer", ImageType::MAGICK }, + { "VipsForeignLoadMagick7File", ImageType::MAGICK }, + { "VipsForeignLoadMagick7Buffer", ImageType::MAGICK }, + { "VipsForeignLoadOpenslideFile", ImageType::OPENSLIDE }, + { "VipsForeignLoadPpmFile", ImageType::PPM }, + { "VipsForeignLoadFitsFile", ImageType::FITS }, + { "VipsForeignLoadOpenexr", ImageType::EXR }, + { "VipsForeignLoadJxlFile", ImageType::JXL }, + { "VipsForeignLoadJxlBuffer", ImageType::JXL }, + { "VipsForeignLoadRadFile", ImageType::RAD }, + { "VipsForeignLoadRadBuffer", ImageType::RAD }, + { "VipsForeignLoadDcRawFile", ImageType::DCRAW }, + { "VipsForeignLoadDcRawBuffer", ImageType::DCRAW }, + { "VipsForeignLoadVips", ImageType::VIPS }, + { "VipsForeignLoadVipsFile", ImageType::VIPS }, + { "VipsForeignLoadRaw", ImageType::RAW } + }; + + /* + Determine image format of a buffer. + */ + ImageType DetermineImageType(void *buffer, size_t const length) { + ImageType imageType = ImageType::UNKNOWN; + char const *load = vips_foreign_find_load_buffer(buffer, length); + if (load != nullptr) { + auto it = loaderToType.find(load); + if (it != loaderToType.end()) { + imageType = it->second; + } + } + return imageType; + } + + /* + Determine image format, reads the first few bytes of the file + */ + ImageType DetermineImageType(char const *file) { + ImageType imageType = ImageType::UNKNOWN; + char const *load = vips_foreign_find_load(file); + if (load != nullptr) { + auto it = loaderToType.find(load); + if (it != loaderToType.end()) { + imageType = it->second; + } + } else { + if (EndsWith(vips::VError().what(), " does not exist\n")) { + imageType = ImageType::MISSING; + } + } + return imageType; + } + + /* + Does this image type support multiple pages? + */ + bool ImageTypeSupportsPage(ImageType imageType) { + return + imageType == ImageType::WEBP || + imageType == ImageType::MAGICK || + imageType == ImageType::GIF || + imageType == ImageType::JP2 || + imageType == ImageType::TIFF || + imageType == ImageType::HEIF || + imageType == ImageType::PDF; + } + + /* + Does this image type support removal of safety limits? + */ + bool ImageTypeSupportsUnlimited(ImageType imageType) { + return + imageType == ImageType::JPEG || + imageType == ImageType::PNG || + imageType == ImageType::SVG || + imageType == ImageType::TIFF || + imageType == ImageType::HEIF; + } + + /* + Format-specific options builder + */ + vips::VOption* GetOptionsForImageType(ImageType imageType, InputDescriptor *descriptor) { + vips::VOption *option = VImage::option() + ->set("access", descriptor->access) + ->set("fail_on", descriptor->failOn); + if (descriptor->unlimited && ImageTypeSupportsUnlimited(imageType)) { + option->set("unlimited", true); + } + if (ImageTypeSupportsPage(imageType)) { + option->set("n", descriptor->pages); + option->set("page", descriptor->page); + } + switch (imageType) { + case ImageType::SVG: + option->set("dpi", descriptor->density) + ->set("stylesheet", descriptor->svgStylesheet.data()) + ->set("high_bitdepth", descriptor->svgHighBitdepth); + break; + case ImageType::TIFF: + option->set("subifd", descriptor->tiffSubifd); + break; + case ImageType::PDF: + option->set("dpi", descriptor->density) + ->set("background", descriptor->pdfBackground); + break; + case ImageType::OPENSLIDE: + option->set("level", descriptor->openSlideLevel); + break; + case ImageType::JP2: + option->set("oneshot", descriptor->jp2Oneshot); + break; + case ImageType::MAGICK: + option->set("density", std::to_string(descriptor->density).data()); + break; + default: + break; + } + return option; + } + + /* + Open an image from the given InputDescriptor (filesystem, compressed buffer, raw pixel data) + */ + std::tuple OpenInput(InputDescriptor *descriptor) { + VImage image; + ImageType imageType; + if (descriptor->isBuffer) { + if (descriptor->rawChannels > 0) { + // Raw, uncompressed pixel data + bool const is8bit = vips_band_format_is8bit(descriptor->rawDepth); + image = VImage::new_from_memory(descriptor->buffer, descriptor->bufferLength, + descriptor->rawWidth, descriptor->rawHeight, descriptor->rawChannels, descriptor->rawDepth); + if (descriptor->rawChannels < 3) { + image.get_image()->Type = is8bit ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_GREY16; + } else { + image.get_image()->Type = is8bit ? VIPS_INTERPRETATION_sRGB : VIPS_INTERPRETATION_RGB16; + } + if (descriptor->rawPageHeight > 0) { + image.set(VIPS_META_PAGE_HEIGHT, descriptor->rawPageHeight); + image.set(VIPS_META_N_PAGES, static_cast(descriptor->rawHeight / descriptor->rawPageHeight)); + } + if (descriptor->rawPremultiplied) { + image = image.unpremultiply(); + } + imageType = ImageType::RAW; + } else { + // Compressed data + imageType = DetermineImageType(descriptor->buffer, descriptor->bufferLength); + if (imageType != ImageType::UNKNOWN) { + try { + vips::VOption *option = GetOptionsForImageType(imageType, descriptor); + image = VImage::new_from_buffer(descriptor->buffer, descriptor->bufferLength, nullptr, option); + if (imageType == ImageType::SVG || imageType == ImageType::PDF || imageType == ImageType::MAGICK) { + image = SetDensity(image, descriptor->density); + } + } catch (vips::VError const &err) { + throw vips::VError(std::string("Input buffer has corrupt header: ") + err.what()); + } + } else { + throw vips::VError("Input buffer contains unsupported image format"); + } + } + } else { + int const channels = descriptor->createChannels; + if (channels > 0) { + // Create new image + if (descriptor->createNoiseType == "gaussian") { + std::vector bands = {}; + bands.reserve(channels); + for (int _band = 0; _band < channels; _band++) { + bands.push_back(VImage::gaussnoise(descriptor->createWidth, descriptor->createHeight, VImage::option() + ->set("mean", descriptor->createNoiseMean) + ->set("sigma", descriptor->createNoiseSigma))); + } + image = VImage::bandjoin(bands).copy(VImage::option()->set("interpretation", + channels < 3 ? VIPS_INTERPRETATION_B_W: VIPS_INTERPRETATION_sRGB)); + } else { + std::vector background = { + descriptor->createBackground[0], + descriptor->createBackground[1], + descriptor->createBackground[2] + }; + if (channels == 4) { + background.push_back(descriptor->createBackground[3]); + } + image = VImage::new_matrix(descriptor->createWidth, descriptor->createHeight) + .copy(VImage::option()->set("interpretation", + channels < 3 ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_sRGB)) + .new_from_image(background); + } + if (descriptor->createPageHeight > 0) { + image.set(VIPS_META_PAGE_HEIGHT, descriptor->createPageHeight); + image.set(VIPS_META_N_PAGES, static_cast(descriptor->createHeight / descriptor->createPageHeight)); + } + image = image.cast(VIPS_FORMAT_UCHAR); + imageType = ImageType::RAW; + } else if (descriptor->textValue.length() > 0) { + // Create a new image with text + vips::VOption *textOptions = VImage::option() + ->set("align", descriptor->textAlign) + ->set("justify", descriptor->textJustify) + ->set("rgba", descriptor->textRgba) + ->set("spacing", descriptor->textSpacing) + ->set("wrap", descriptor->textWrap) + ->set("autofit_dpi", &descriptor->textAutofitDpi); + if (descriptor->textWidth > 0) { + textOptions->set("width", descriptor->textWidth); + } + // Ignore dpi if height is set + if (descriptor->textWidth > 0 && descriptor->textHeight > 0) { + textOptions->set("height", descriptor->textHeight); + } else if (descriptor->textDpi > 0) { + textOptions->set("dpi", descriptor->textDpi); + } + if (descriptor->textFont.length() > 0) { + textOptions->set("font", const_cast(descriptor->textFont.data())); + } + if (descriptor->textFontfile.length() > 0) { + textOptions->set("fontfile", const_cast(descriptor->textFontfile.data())); + } + image = VImage::text(const_cast(descriptor->textValue.data()), textOptions); + if (!descriptor->textRgba) { + image = image.copy(VImage::option()->set("interpretation", VIPS_INTERPRETATION_B_W)); + } + imageType = ImageType::RAW; + } else { + // From filesystem + imageType = DetermineImageType(descriptor->file.data()); + if (imageType == ImageType::MISSING) { + if (descriptor->file.find("file.substr(0, 8) + "...')?"); + } + throw vips::VError("Input file is missing: " + descriptor->file); + } + if (imageType != ImageType::UNKNOWN) { + try { + vips::VOption *option = GetOptionsForImageType(imageType, descriptor); + image = VImage::new_from_file(descriptor->file.data(), option); + if (imageType == ImageType::SVG || imageType == ImageType::PDF || imageType == ImageType::MAGICK) { + image = SetDensity(image, descriptor->density); + } + } catch (vips::VError const &err) { + throw vips::VError(std::string("Input file has corrupt header: ") + err.what()); + } + } else { + throw vips::VError("Input file contains unsupported image format"); + } + } + } + + // Limit input images to a given number of pixels, where pixels = width * height + if (descriptor->limitInputPixels > 0 && + static_cast(image.width()) * image.height() > descriptor->limitInputPixels) { + throw vips::VError("Input image exceeds pixel limit"); + } + return std::make_tuple(image, imageType); + } + + /* + Does this image have an embedded profile? + */ + bool HasProfile(VImage image) { + return image.get_typeof(VIPS_META_ICC_NAME) == VIPS_TYPE_BLOB; + } + + /* + Get copy of embedded profile. + */ + std::pair GetProfile(VImage image) { + std::pair icc(nullptr, 0); + if (HasProfile(image)) { + size_t length; + const void *data = image.get_blob(VIPS_META_ICC_NAME, &length); + icc.first = static_cast(g_malloc(length)); + icc.second = length; + memcpy(icc.first, data, length); + } + return icc; + } + + /* + Set embedded profile. + */ + VImage SetProfile(VImage image, std::pair icc) { + if (icc.first != nullptr) { + image = image.copy(); + image.set(VIPS_META_ICC_NAME, reinterpret_cast(vips_area_free_cb), icc.first, icc.second); + } + return image; + } + + static void* RemoveExifCallback(VipsImage *image, char const *field, GValue *value, void *data) { + std::vector *fieldNames = static_cast *>(data); + std::string fieldName(field); + if (fieldName.substr(0, 8) == ("exif-ifd")) { + fieldNames->push_back(fieldName); + } + return nullptr; + } + + /* + Remove all EXIF-related image fields. + */ + VImage RemoveExif(VImage image) { + std::vector fieldNames; + vips_image_map(image.get_image(), static_cast(RemoveExifCallback), &fieldNames); + for (const auto& f : fieldNames) { + image.remove(f.data()); + } + return image; + } + + /* + Get EXIF Orientation of image, if any. + */ + int ExifOrientation(VImage image) { + int orientation = 0; + if (image.get_typeof(VIPS_META_ORIENTATION) != 0) { + orientation = image.get_int(VIPS_META_ORIENTATION); + } + return orientation; + } + + /* + Set EXIF Orientation of image. + */ + VImage SetExifOrientation(VImage image, int const orientation) { + VImage copy = image.copy(); + copy.set(VIPS_META_ORIENTATION, orientation); + return copy; + } + + /* + Remove EXIF Orientation from image. + */ + VImage RemoveExifOrientation(VImage image) { + VImage copy = image.copy(); + copy.remove(VIPS_META_ORIENTATION); + copy.remove("exif-ifd0-Orientation"); + return copy; + } + + /* + Set animation properties if necessary. + */ + VImage SetAnimationProperties(VImage image, int nPages, int pageHeight, std::vector delay, int loop) { + bool hasDelay = !delay.empty(); + VImage copy = image.copy(); + + // Only set page-height if we have more than one page, or this could + // accidentally turn into an animated image later. + if (nPages > 1) copy.set(VIPS_META_PAGE_HEIGHT, pageHeight); + if (hasDelay) { + if (delay.size() == 1) { + // We have just one delay, repeat that value for all frames. + delay.insert(delay.end(), nPages - 1, delay[0]); + } + copy.set("delay", delay); + } + if (nPages == 1 && !hasDelay && loop == -1) { + loop = 1; + } + if (loop != -1) copy.set("loop", loop); + + return copy; + } + + /* + Remove animation properties from image. + */ + VImage RemoveAnimationProperties(VImage image) { + VImage copy = image.copy(); + copy.remove(VIPS_META_PAGE_HEIGHT); + copy.remove("delay"); + copy.remove("loop"); + return copy; + } + + /* + Remove GIF palette from image. + */ + VImage RemoveGifPalette(VImage image) { + VImage copy = image.copy(); + copy.remove("gif-palette"); + return copy; + } + + /* + Does this image have a non-default density? + */ + bool HasDensity(VImage image) { + return image.xres() > 1.0; + } + + /* + Get pixels/mm resolution as pixels/inch density. + */ + int GetDensity(VImage image) { + return static_cast(round(image.xres() * 25.4)); + } + + /* + Set pixels/mm resolution based on a pixels/inch density. + */ + VImage SetDensity(VImage image, const double density) { + const double pixelsPerMm = density / 25.4; + VImage copy = image.copy(); + copy.get_image()->Xres = pixelsPerMm; + copy.get_image()->Yres = pixelsPerMm; + return copy; + } + + /* + Multi-page images can have a page height. Fetch it, and sanity check it. + If page-height is not set, it defaults to the image height + */ + int GetPageHeight(VImage image) { + return vips_image_get_page_height(image.get_image()); + } + + /* + Check the proposed format supports the current dimensions. + */ + void AssertImageTypeDimensions(VImage image, ImageType const imageType) { + const int height = image.get_typeof(VIPS_META_PAGE_HEIGHT) == G_TYPE_INT + ? image.get_int(VIPS_META_PAGE_HEIGHT) + : image.height(); + if (imageType == ImageType::JPEG) { + if (image.width() > 65535 || height > 65535) { + throw vips::VError("Processed image is too large for the JPEG format"); + } + } else if (imageType == ImageType::WEBP) { + if (image.width() > 16383 || height > 16383) { + throw vips::VError("Processed image is too large for the WebP format"); + } + } else if (imageType == ImageType::GIF) { + if (image.width() > 65535 || height > 65535) { + throw vips::VError("Processed image is too large for the GIF format"); + } + } else if (imageType == ImageType::HEIF) { + if (image.width() > 16384 || height > 16384) { + throw vips::VError("Processed image is too large for the HEIF format"); + } + } + } + + /* + Called when a Buffer undergoes GC, required to support mixed runtime libraries in Windows + */ + std::function FreeCallback = [](void*, char* data) { + g_free(data); + }; + + /* + Temporary buffer of warnings + */ + std::queue vipsWarnings; + std::mutex vipsWarningsMutex; + + /* + Called with warnings from the glib-registered "VIPS" domain + */ + void VipsWarningCallback(char const* log_domain, GLogLevelFlags log_level, char const* message, void* ignore) { + std::lock_guard lock(vipsWarningsMutex); + vipsWarnings.emplace(message); + } + + /* + Pop the oldest warning message from the queue + */ + std::string VipsWarningPop() { + std::string warning; + std::lock_guard lock(vipsWarningsMutex); + if (!vipsWarnings.empty()) { + warning = vipsWarnings.front(); + vipsWarnings.pop(); + } + return warning; + } + + /* + Attach an event listener for progress updates, used to detect timeout + */ + void SetTimeout(VImage image, int const seconds) { + if (seconds > 0) { + VipsImage *im = image.get_image(); + if (im->progress_signal == NULL) { + int *timeout = VIPS_NEW(im, int); + *timeout = seconds; + g_signal_connect(im, "eval", G_CALLBACK(VipsProgressCallBack), timeout); + vips_image_set_progress(im, true); + } + } + } + + /* + Event listener for progress updates, used to detect timeout + */ + void VipsProgressCallBack(VipsImage *im, VipsProgress *progress, int *timeout) { + if (*timeout > 0 && progress->run >= *timeout) { + vips_image_set_kill(im, true); + vips_error("timeout", "%d%% complete", progress->percent); + *timeout = 0; + } + } + + /* + Calculate the (left, top) coordinates of the output image + within the input image, applying the given gravity during an embed. + + @Azurebyte: We are basically swapping the inWidth and outWidth, inHeight and outHeight from the CalculateCrop function. + */ + std::tuple CalculateEmbedPosition(int const inWidth, int const inHeight, + int const outWidth, int const outHeight, int const gravity) { + + int left = 0; + int top = 0; + switch (gravity) { + case 1: + // North + left = (outWidth - inWidth) / 2; + break; + case 2: + // East + left = outWidth - inWidth; + top = (outHeight - inHeight) / 2; + break; + case 3: + // South + left = (outWidth - inWidth) / 2; + top = outHeight - inHeight; + break; + case 4: + // West + top = (outHeight - inHeight) / 2; + break; + case 5: + // Northeast + left = outWidth - inWidth; + break; + case 6: + // Southeast + left = outWidth - inWidth; + top = outHeight - inHeight; + break; + case 7: + // Southwest + top = outHeight - inHeight; + break; + case 8: + // Northwest + // Which is the default is 0,0 so we do not assign anything here. + break; + default: + // Centre + left = (outWidth - inWidth) / 2; + top = (outHeight - inHeight) / 2; + } + return std::make_tuple(left, top); + } + + /* + Calculate the (left, top) coordinates of the output image + within the input image, applying the given gravity during a crop. + */ + std::tuple CalculateCrop(int const inWidth, int const inHeight, + int const outWidth, int const outHeight, int const gravity) { + + int left = 0; + int top = 0; + switch (gravity) { + case 1: + // North + left = (inWidth - outWidth + 1) / 2; + break; + case 2: + // East + left = inWidth - outWidth; + top = (inHeight - outHeight + 1) / 2; + break; + case 3: + // South + left = (inWidth - outWidth + 1) / 2; + top = inHeight - outHeight; + break; + case 4: + // West + top = (inHeight - outHeight + 1) / 2; + break; + case 5: + // Northeast + left = inWidth - outWidth; + break; + case 6: + // Southeast + left = inWidth - outWidth; + top = inHeight - outHeight; + break; + case 7: + // Southwest + top = inHeight - outHeight; + break; + case 8: + // Northwest + break; + default: + // Centre + left = (inWidth - outWidth + 1) / 2; + top = (inHeight - outHeight + 1) / 2; + } + return std::make_tuple(left, top); + } + + /* + Calculate the (left, top) coordinates of the output image + within the input image, applying the given x and y offsets. + */ + std::tuple CalculateCrop(int const inWidth, int const inHeight, + int const outWidth, int const outHeight, int const x, int const y) { + + // default values + int left = 0; + int top = 0; + + // assign only if valid + if (x < (inWidth - outWidth)) { + left = x; + } else if (x >= (inWidth - outWidth)) { + left = inWidth - outWidth; + } + + if (y < (inHeight - outHeight)) { + top = y; + } else if (y >= (inHeight - outHeight)) { + top = inHeight - outHeight; + } + + return std::make_tuple(left, top); + } + + /* + Are pixel values in this image 16-bit integer? + */ + bool Is16Bit(VipsInterpretation const interpretation) { + return interpretation == VIPS_INTERPRETATION_RGB16 || interpretation == VIPS_INTERPRETATION_GREY16; + } + + /* + Convert RGBA value to another colourspace + */ + std::vector GetRgbaAsColourspace(std::vector const rgba, + VipsInterpretation const interpretation, bool premultiply) { + int const bands = static_cast(rgba.size()); + if (bands < 3) { + return rgba; + } + VImage pixel = VImage::new_matrix(1, 1); + pixel.set("bands", bands); + pixel = pixel + .new_from_image(rgba) + .colourspace(interpretation, VImage::option()->set("source_space", VIPS_INTERPRETATION_sRGB)); + if (premultiply) { + pixel = pixel.premultiply(); + } + return pixel(0, 0); + } + + /* + Apply the alpha channel to a given colour + */ + std::tuple> ApplyAlpha(VImage image, std::vector colour, bool premultiply) { + // Scale up 8-bit values to match 16-bit input image + double const multiplier = sharp::Is16Bit(image.interpretation()) ? 256.0 : 1.0; + // Create alphaColour colour + std::vector alphaColour; + if (image.bands() > 2) { + alphaColour = { + multiplier * colour[0], + multiplier * colour[1], + multiplier * colour[2] + }; + } else { + // Convert sRGB to greyscale + alphaColour = { multiplier * ( + 0.2126 * colour[0] + + 0.7152 * colour[1] + + 0.0722 * colour[2]) + }; + } + // Add alpha channel(s) to alphaColour colour + if (colour[3] < 255.0 || image.has_alpha()) { + int extraBands = image.bands() > 4 ? image.bands() - 3 : 1; + alphaColour.insert(alphaColour.end(), extraBands, colour[3] * multiplier); + } + // Ensure alphaColour colour uses correct colourspace + alphaColour = sharp::GetRgbaAsColourspace(alphaColour, image.interpretation(), premultiply); + // Add non-transparent alpha channel, if required + if (colour[3] < 255.0 && !image.has_alpha()) { + image = image.bandjoin_const({ 255 * multiplier }); + } + return std::make_tuple(image, alphaColour); + } + + /* + Removes alpha channels, if any. + */ + VImage RemoveAlpha(VImage image) { + while (image.bands() > 1 && image.has_alpha()) { + image = image.extract_band(0, VImage::option()->set("n", image.bands() - 1)); + } + return image; + } + + /* + Ensures alpha channel, if missing. + */ + VImage EnsureAlpha(VImage image, double const value) { + if (!image.has_alpha()) { + image = image.bandjoin_const({ value * vips_interpretation_max_alpha(image.interpretation()) }); + } + return image; + } + + std::pair ResolveShrink(int width, int height, int targetWidth, int targetHeight, + Canvas canvas, bool withoutEnlargement, bool withoutReduction) { + double hshrink = 1.0; + double vshrink = 1.0; + + if (targetWidth > 0 && targetHeight > 0) { + // Fixed width and height + hshrink = static_cast(width) / targetWidth; + vshrink = static_cast(height) / targetHeight; + + switch (canvas) { + case Canvas::CROP: + case Canvas::MIN: + if (hshrink < vshrink) { + vshrink = hshrink; + } else { + hshrink = vshrink; + } + break; + case Canvas::EMBED: + case Canvas::MAX: + if (hshrink > vshrink) { + vshrink = hshrink; + } else { + hshrink = vshrink; + } + break; + case Canvas::IGNORE_ASPECT: + break; + } + } else if (targetWidth > 0) { + // Fixed width + hshrink = static_cast(width) / targetWidth; + + if (canvas != Canvas::IGNORE_ASPECT) { + // Auto height + vshrink = hshrink; + } + } else if (targetHeight > 0) { + // Fixed height + vshrink = static_cast(height) / targetHeight; + + if (canvas != Canvas::IGNORE_ASPECT) { + // Auto width + hshrink = vshrink; + } + } + + // We should not reduce or enlarge the output image, if + // withoutReduction or withoutEnlargement is specified. + if (withoutReduction) { + // Equivalent of VIPS_SIZE_UP + hshrink = std::min(1.0, hshrink); + vshrink = std::min(1.0, vshrink); + } else if (withoutEnlargement) { + // Equivalent of VIPS_SIZE_DOWN + hshrink = std::max(1.0, hshrink); + vshrink = std::max(1.0, vshrink); + } + + // We don't want to shrink so much that we send an axis to 0 + hshrink = std::min(hshrink, static_cast(width)); + vshrink = std::min(vshrink, static_cast(height)); + + return std::make_pair(hshrink, vshrink); + } + + /* + Ensure decoding remains sequential. + */ + VImage StaySequential(VImage image, bool condition) { + if (vips_image_is_sequential(image.get_image()) && condition) { + image = image.copy_memory().copy(); + image.remove(VIPS_META_SEQUENTIAL); + } + return image; + } +} // namespace sharp diff --git a/node_modules/sharp/src/common.h b/node_modules/sharp/src/common.h new file mode 100644 index 0000000..c15755b --- /dev/null +++ b/node_modules/sharp/src/common.h @@ -0,0 +1,402 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef SRC_COMMON_H_ +#define SRC_COMMON_H_ + +#include +#include +#include +#include +#include + +#include +#include + +// Verify platform and compiler compatibility + +#if (VIPS_MAJOR_VERSION < 8) || \ + (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 17) || \ + (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 17 && VIPS_MICRO_VERSION < 3) +#error "libvips version 8.17.3+ is required - please see https://sharp.pixelplumbing.com/install" +#endif + +#if defined(__has_include) +#if !__has_include() +#error "C++17 compiler required - please see https://sharp.pixelplumbing.com/install" +#endif +#endif + +using vips::VImage; + +namespace sharp { + + struct InputDescriptor { + std::string name; + std::string file; + bool autoOrient; + char *buffer; + VipsFailOn failOn; + uint64_t limitInputPixels; + bool unlimited; + VipsAccess access; + size_t bufferLength; + bool isBuffer; + double density; + bool ignoreIcc; + VipsBandFormat rawDepth; + int rawChannels; + int rawWidth; + int rawHeight; + bool rawPremultiplied; + int rawPageHeight; + int pages; + int page; + int createChannels; + int createWidth; + int createHeight; + int createPageHeight; + std::vector createBackground; + std::string createNoiseType; + double createNoiseMean; + double createNoiseSigma; + std::string textValue; + std::string textFont; + std::string textFontfile; + int textWidth; + int textHeight; + VipsAlign textAlign; + bool textJustify; + int textDpi; + bool textRgba; + int textSpacing; + VipsTextWrap textWrap; + int textAutofitDpi; + bool joinAnimated; + int joinAcross; + int joinShim; + std::vector joinBackground; + VipsAlign joinHalign; + VipsAlign joinValign; + std::string svgStylesheet; + bool svgHighBitdepth; + int tiffSubifd; + int openSlideLevel; + std::vector pdfBackground; + bool jp2Oneshot; + + InputDescriptor(): + autoOrient(false), + buffer(nullptr), + failOn(VIPS_FAIL_ON_WARNING), + limitInputPixels(0x3FFF * 0x3FFF), + unlimited(false), + access(VIPS_ACCESS_SEQUENTIAL), + bufferLength(0), + isBuffer(false), + density(72.0), + ignoreIcc(false), + rawDepth(VIPS_FORMAT_UCHAR), + rawChannels(0), + rawWidth(0), + rawHeight(0), + rawPremultiplied(false), + rawPageHeight(0), + pages(1), + page(0), + createChannels(0), + createWidth(0), + createHeight(0), + createPageHeight(0), + createBackground{ 0.0, 0.0, 0.0, 255.0 }, + createNoiseMean(0.0), + createNoiseSigma(0.0), + textWidth(0), + textHeight(0), + textAlign(VIPS_ALIGN_LOW), + textJustify(false), + textDpi(72), + textRgba(false), + textSpacing(0), + textWrap(VIPS_TEXT_WRAP_WORD), + textAutofitDpi(0), + joinAnimated(false), + joinAcross(1), + joinShim(0), + joinBackground{ 0.0, 0.0, 0.0, 255.0 }, + joinHalign(VIPS_ALIGN_LOW), + joinValign(VIPS_ALIGN_LOW), + svgHighBitdepth(false), + tiffSubifd(-1), + openSlideLevel(0), + pdfBackground{ 255.0, 255.0, 255.0, 255.0 }, + jp2Oneshot(false) {} + }; + + // Convenience methods to access the attributes of a Napi::Object + bool HasAttr(Napi::Object obj, std::string attr); + std::string AttrAsStr(Napi::Object obj, std::string attr); + std::string AttrAsStr(Napi::Object obj, unsigned int const attr); + uint32_t AttrAsUint32(Napi::Object obj, std::string attr); + int32_t AttrAsInt32(Napi::Object obj, std::string attr); + int32_t AttrAsInt32(Napi::Object obj, unsigned int const attr); + double AttrAsDouble(Napi::Object obj, std::string attr); + double AttrAsDouble(Napi::Object obj, unsigned int const attr); + bool AttrAsBool(Napi::Object obj, std::string attr); + std::vector AttrAsVectorOfDouble(Napi::Object obj, std::string attr); + std::vector AttrAsInt32Vector(Napi::Object obj, std::string attr); + template T AttrAsEnum(Napi::Object obj, std::string attr, GType type) { + return static_cast( + vips_enum_from_nick(nullptr, type, AttrAsStr(obj, attr).data())); + } + + // Create an InputDescriptor instance from a Napi::Object describing an input image + InputDescriptor* CreateInputDescriptor(Napi::Object input); + + enum class ImageType { + JPEG, + PNG, + WEBP, + JP2, + TIFF, + GIF, + SVG, + HEIF, + PDF, + MAGICK, + OPENSLIDE, + PPM, + FITS, + EXR, + JXL, + RAD, + DCRAW, + VIPS, + RAW, + UNKNOWN, + MISSING + }; + + enum class Canvas { + CROP, + EMBED, + MAX, + MIN, + IGNORE_ASPECT + }; + + // How many tasks are in the queue? + extern std::atomic counterQueue; + + // How many tasks are being processed? + extern std::atomic counterProcess; + + // Filename extension checkers + bool IsJpeg(std::string const &str); + bool IsPng(std::string const &str); + bool IsWebp(std::string const &str); + bool IsJp2(std::string const &str); + bool IsGif(std::string const &str); + bool IsTiff(std::string const &str); + bool IsHeic(std::string const &str); + bool IsHeif(std::string const &str); + bool IsAvif(std::string const &str); + bool IsJxl(std::string const &str); + bool IsDz(std::string const &str); + bool IsDzZip(std::string const &str); + bool IsV(std::string const &str); + + /* + Trim space from end of string. + */ + std::string TrimEnd(std::string const &str); + + /* + Provide a string identifier for the given image type. + */ + std::string ImageTypeId(ImageType const imageType); + + /* + Determine image format of a buffer. + */ + ImageType DetermineImageType(void *buffer, size_t const length); + + /* + Determine image format of a file. + */ + ImageType DetermineImageType(char const *file); + + /* + Format-specific options builder + */ + vips::VOption* GetOptionsForImageType(ImageType imageType, InputDescriptor *descriptor); + + /* + Open an image from the given InputDescriptor (filesystem, compressed buffer, raw pixel data) + */ + std::tuple OpenInput(InputDescriptor *descriptor); + + /* + Does this image have an embedded profile? + */ + bool HasProfile(VImage image); + + /* + Get copy of embedded profile. + */ + std::pair GetProfile(VImage image); + + /* + Set embedded profile. + */ + VImage SetProfile(VImage image, std::pair icc); + + /* + Remove all EXIF-related image fields. + */ + VImage RemoveExif(VImage image); + + /* + Get EXIF Orientation of image, if any. + */ + int ExifOrientation(VImage image); + + /* + Set EXIF Orientation of image. + */ + VImage SetExifOrientation(VImage image, int const orientation); + + /* + Remove EXIF Orientation from image. + */ + VImage RemoveExifOrientation(VImage image); + + /* + Set animation properties if necessary. + */ + VImage SetAnimationProperties(VImage image, int nPages, int pageHeight, std::vector delay, int loop); + + /* + Remove animation properties from image. + */ + VImage RemoveAnimationProperties(VImage image); + + /* + Remove GIF palette from image. + */ + VImage RemoveGifPalette(VImage image); + + /* + Does this image have a non-default density? + */ + bool HasDensity(VImage image); + + /* + Get pixels/mm resolution as pixels/inch density. + */ + int GetDensity(VImage image); + + /* + Set pixels/mm resolution based on a pixels/inch density. + */ + VImage SetDensity(VImage image, const double density); + + /* + Multi-page images can have a page height. Fetch it, and sanity check it. + If page-height is not set, it defaults to the image height + */ + int GetPageHeight(VImage image); + + /* + Check the proposed format supports the current dimensions. + */ + void AssertImageTypeDimensions(VImage image, ImageType const imageType); + + /* + Called when a Buffer undergoes GC, required to support mixed runtime libraries in Windows + */ + extern std::function FreeCallback; + + /* + Called with warnings from the glib-registered "VIPS" domain + */ + void VipsWarningCallback(char const* log_domain, GLogLevelFlags log_level, char const* message, void* ignore); + + /* + Pop the oldest warning message from the queue + */ + std::string VipsWarningPop(); + + /* + Attach an event listener for progress updates, used to detect timeout + */ + void SetTimeout(VImage image, int const timeoutSeconds); + + /* + Event listener for progress updates, used to detect timeout + */ + void VipsProgressCallBack(VipsImage *image, VipsProgress *progress, int *timeoutSeconds); + + /* + Calculate the (left, top) coordinates of the output image + within the input image, applying the given gravity during an embed. + */ + std::tuple CalculateEmbedPosition(int const inWidth, int const inHeight, + int const outWidth, int const outHeight, int const gravity); + + /* + Calculate the (left, top) coordinates of the output image + within the input image, applying the given gravity. + */ + std::tuple CalculateCrop(int const inWidth, int const inHeight, + int const outWidth, int const outHeight, int const gravity); + + /* + Calculate the (left, top) coordinates of the output image + within the input image, applying the given x and y offsets of the output image. + */ + std::tuple CalculateCrop(int const inWidth, int const inHeight, + int const outWidth, int const outHeight, int const x, int const y); + + /* + Are pixel values in this image 16-bit integer? + */ + bool Is16Bit(VipsInterpretation const interpretation); + + /* + Convert RGBA value to another colourspace + */ + std::vector GetRgbaAsColourspace(std::vector const rgba, + VipsInterpretation const interpretation, bool premultiply); + + /* + Apply the alpha channel to a given colour + */ + std::tuple> ApplyAlpha(VImage image, std::vector colour, bool premultiply); + + /* + Removes alpha channels, if any. + */ + VImage RemoveAlpha(VImage image); + + /* + Ensures alpha channel, if missing. + */ + VImage EnsureAlpha(VImage image, double const value); + + /* + Calculate the horizontal and vertical shrink factors, taking the canvas mode into account. + */ + std::pair ResolveShrink(int width, int height, int targetWidth, int targetHeight, + Canvas canvas, bool withoutEnlargement, bool withoutReduction); + + /* + Ensure decoding remains sequential. + */ + VImage StaySequential(VImage image, bool condition = true); + +} // namespace sharp + +#endif // SRC_COMMON_H_ diff --git a/node_modules/sharp/src/metadata.cc b/node_modules/sharp/src/metadata.cc new file mode 100644 index 0000000..2fde7bf --- /dev/null +++ b/node_modules/sharp/src/metadata.cc @@ -0,0 +1,346 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#include +#include +#include +#include +#include + +#include +#include + +#include "./common.h" +#include "./metadata.h" + +static void* readPNGComment(VipsImage *image, const char *field, GValue *value, void *p); + +class MetadataWorker : public Napi::AsyncWorker { + public: + MetadataWorker(Napi::Function callback, MetadataBaton *baton, Napi::Function debuglog) : + Napi::AsyncWorker(callback), baton(baton), debuglog(Napi::Persistent(debuglog)) {} + ~MetadataWorker() {} + + void Execute() { + // Decrement queued task counter + sharp::counterQueue--; + + vips::VImage image; + sharp::ImageType imageType = sharp::ImageType::UNKNOWN; + try { + std::tie(image, imageType) = OpenInput(baton->input); + } catch (vips::VError const &err) { + (baton->err).append(err.what()); + } + if (imageType != sharp::ImageType::UNKNOWN) { + // Image type + baton->format = sharp::ImageTypeId(imageType); + // VipsImage attributes + baton->width = image.width(); + baton->height = image.height(); + baton->space = vips_enum_nick(VIPS_TYPE_INTERPRETATION, image.interpretation()); + baton->channels = image.bands(); + baton->depth = vips_enum_nick(VIPS_TYPE_BAND_FORMAT, image.format()); + if (sharp::HasDensity(image)) { + baton->density = sharp::GetDensity(image); + } + if (image.get_typeof("jpeg-chroma-subsample") == VIPS_TYPE_REF_STRING) { + baton->chromaSubsampling = image.get_string("jpeg-chroma-subsample"); + } + if (image.get_typeof("interlaced") == G_TYPE_INT) { + baton->isProgressive = image.get_int("interlaced") == 1; + } + if (image.get_typeof(VIPS_META_PALETTE) == G_TYPE_INT) { + baton->isPalette = image.get_int(VIPS_META_PALETTE); + } + if (image.get_typeof(VIPS_META_BITS_PER_SAMPLE) == G_TYPE_INT) { + baton->bitsPerSample = image.get_int(VIPS_META_BITS_PER_SAMPLE); + } + if (image.get_typeof(VIPS_META_N_PAGES) == G_TYPE_INT) { + baton->pages = image.get_int(VIPS_META_N_PAGES); + } + if (image.get_typeof(VIPS_META_PAGE_HEIGHT) == G_TYPE_INT) { + baton->pageHeight = image.get_int(VIPS_META_PAGE_HEIGHT); + } + if (image.get_typeof("loop") == G_TYPE_INT) { + baton->loop = image.get_int("loop"); + } + if (image.get_typeof("delay") == VIPS_TYPE_ARRAY_INT) { + baton->delay = image.get_array_int("delay"); + } + if (image.get_typeof("heif-primary") == G_TYPE_INT) { + baton->pagePrimary = image.get_int("heif-primary"); + } + if (image.get_typeof("heif-compression") == VIPS_TYPE_REF_STRING) { + baton->compression = image.get_string("heif-compression"); + } + if (image.get_typeof(VIPS_META_RESOLUTION_UNIT) == VIPS_TYPE_REF_STRING) { + baton->resolutionUnit = image.get_string(VIPS_META_RESOLUTION_UNIT); + } + if (image.get_typeof("magick-format") == VIPS_TYPE_REF_STRING) { + baton->formatMagick = image.get_string("magick-format"); + } + if (image.get_typeof("openslide.level-count") == VIPS_TYPE_REF_STRING) { + int const levels = std::stoi(image.get_string("openslide.level-count")); + for (int l = 0; l < levels; l++) { + std::string prefix = "openslide.level[" + std::to_string(l) + "]."; + int const width = std::stoi(image.get_string((prefix + "width").data())); + int const height = std::stoi(image.get_string((prefix + "height").data())); + baton->levels.push_back(std::pair(width, height)); + } + } + if (image.get_typeof(VIPS_META_N_SUBIFDS) == G_TYPE_INT) { + baton->subifds = image.get_int(VIPS_META_N_SUBIFDS); + } + baton->hasProfile = sharp::HasProfile(image); + if (image.get_typeof("background") == VIPS_TYPE_ARRAY_DOUBLE) { + baton->background = image.get_array_double("background"); + } + // Derived attributes + baton->hasAlpha = image.has_alpha(); + baton->orientation = sharp::ExifOrientation(image); + // EXIF + if (image.get_typeof(VIPS_META_EXIF_NAME) == VIPS_TYPE_BLOB) { + size_t exifLength; + void const *exif = image.get_blob(VIPS_META_EXIF_NAME, &exifLength); + baton->exif = static_cast(g_malloc(exifLength)); + memcpy(baton->exif, exif, exifLength); + baton->exifLength = exifLength; + } + // ICC profile + if (image.get_typeof(VIPS_META_ICC_NAME) == VIPS_TYPE_BLOB) { + size_t iccLength; + void const *icc = image.get_blob(VIPS_META_ICC_NAME, &iccLength); + baton->icc = static_cast(g_malloc(iccLength)); + memcpy(baton->icc, icc, iccLength); + baton->iccLength = iccLength; + } + // IPTC + if (image.get_typeof(VIPS_META_IPTC_NAME) == VIPS_TYPE_BLOB) { + size_t iptcLength; + void const *iptc = image.get_blob(VIPS_META_IPTC_NAME, &iptcLength); + baton->iptc = static_cast(g_malloc(iptcLength)); + memcpy(baton->iptc, iptc, iptcLength); + baton->iptcLength = iptcLength; + } + // XMP + if (image.get_typeof(VIPS_META_XMP_NAME) == VIPS_TYPE_BLOB) { + size_t xmpLength; + void const *xmp = image.get_blob(VIPS_META_XMP_NAME, &xmpLength); + baton->xmp = static_cast(g_malloc(xmpLength)); + memcpy(baton->xmp, xmp, xmpLength); + baton->xmpLength = xmpLength; + } + // TIFFTAG_PHOTOSHOP + if (image.get_typeof(VIPS_META_PHOTOSHOP_NAME) == VIPS_TYPE_BLOB) { + size_t tifftagPhotoshopLength; + void const *tifftagPhotoshop = image.get_blob(VIPS_META_PHOTOSHOP_NAME, &tifftagPhotoshopLength); + baton->tifftagPhotoshop = static_cast(g_malloc(tifftagPhotoshopLength)); + memcpy(baton->tifftagPhotoshop, tifftagPhotoshop, tifftagPhotoshopLength); + baton->tifftagPhotoshopLength = tifftagPhotoshopLength; + } + // PNG comments + vips_image_map(image.get_image(), readPNGComment, &baton->comments); + } + + // Clean up + vips_error_clear(); + vips_thread_shutdown(); + } + + void OnOK() { + Napi::Env env = Env(); + Napi::HandleScope scope(env); + + // Handle warnings + std::string warning = sharp::VipsWarningPop(); + while (!warning.empty()) { + debuglog.Call(Receiver().Value(), { Napi::String::New(env, warning) }); + warning = sharp::VipsWarningPop(); + } + + if (baton->err.empty()) { + Napi::Object info = Napi::Object::New(env); + info.Set("format", baton->format); + if (baton->input->bufferLength > 0) { + info.Set("size", baton->input->bufferLength); + } + info.Set("width", baton->width); + info.Set("height", baton->height); + info.Set("space", baton->space); + info.Set("channels", baton->channels); + info.Set("depth", baton->depth); + if (baton->density > 0) { + info.Set("density", baton->density); + } + if (!baton->chromaSubsampling.empty()) { + info.Set("chromaSubsampling", baton->chromaSubsampling); + } + info.Set("isProgressive", baton->isProgressive); + info.Set("isPalette", baton->isPalette); + if (baton->bitsPerSample > 0) { + info.Set("bitsPerSample", baton->bitsPerSample); + if (baton->isPalette) { + // Deprecated, remove with libvips 8.17.0 + info.Set("paletteBitDepth", baton->bitsPerSample); + } + } + if (baton->pages > 0) { + info.Set("pages", baton->pages); + } + if (baton->pageHeight > 0) { + info.Set("pageHeight", baton->pageHeight); + } + if (baton->loop >= 0) { + info.Set("loop", baton->loop); + } + if (!baton->delay.empty()) { + int i = 0; + Napi::Array delay = Napi::Array::New(env, static_cast(baton->delay.size())); + for (int const d : baton->delay) { + delay.Set(i++, d); + } + info.Set("delay", delay); + } + if (baton->pagePrimary > -1) { + info.Set("pagePrimary", baton->pagePrimary); + } + if (!baton->compression.empty()) { + info.Set("compression", baton->compression); + } + if (!baton->resolutionUnit.empty()) { + info.Set("resolutionUnit", baton->resolutionUnit == "in" ? "inch" : baton->resolutionUnit); + } + if (!baton->formatMagick.empty()) { + info.Set("formatMagick", baton->formatMagick); + } + if (!baton->levels.empty()) { + int i = 0; + Napi::Array levels = Napi::Array::New(env, static_cast(baton->levels.size())); + for (const auto& [width, height] : baton->levels) { + Napi::Object level = Napi::Object::New(env); + level.Set("width", width); + level.Set("height", height); + levels.Set(i++, level); + } + info.Set("levels", levels); + } + if (baton->subifds > 0) { + info.Set("subifds", baton->subifds); + } + if (!baton->background.empty()) { + Napi::Object background = Napi::Object::New(env); + if (baton->background.size() == 3) { + background.Set("r", baton->background[0]); + background.Set("g", baton->background[1]); + background.Set("b", baton->background[2]); + } else { + background.Set("gray", round(baton->background[0] * 100 / 255)); + } + info.Set("background", background); + } + info.Set("hasProfile", baton->hasProfile); + info.Set("hasAlpha", baton->hasAlpha); + if (baton->orientation > 0) { + info.Set("orientation", baton->orientation); + } + Napi::Object autoOrient = Napi::Object::New(env); + info.Set("autoOrient", autoOrient); + if (baton->orientation >= 5) { + autoOrient.Set("width", baton->height); + autoOrient.Set("height", baton->width); + } else { + autoOrient.Set("width", baton->width); + autoOrient.Set("height", baton->height); + } + if (baton->exifLength > 0) { + info.Set("exif", Napi::Buffer::NewOrCopy(env, baton->exif, baton->exifLength, sharp::FreeCallback)); + } + if (baton->iccLength > 0) { + info.Set("icc", Napi::Buffer::NewOrCopy(env, baton->icc, baton->iccLength, sharp::FreeCallback)); + } + if (baton->iptcLength > 0) { + info.Set("iptc", Napi::Buffer::NewOrCopy(env, baton->iptc, baton->iptcLength, sharp::FreeCallback)); + } + if (baton->xmpLength > 0) { + if (g_utf8_validate(static_cast(baton->xmp), baton->xmpLength, nullptr)) { + info.Set("xmpAsString", + Napi::String::New(env, static_cast(baton->xmp), baton->xmpLength)); + } + info.Set("xmp", Napi::Buffer::NewOrCopy(env, baton->xmp, baton->xmpLength, sharp::FreeCallback)); + } + if (baton->tifftagPhotoshopLength > 0) { + info.Set("tifftagPhotoshop", + Napi::Buffer::NewOrCopy(env, baton->tifftagPhotoshop, + baton->tifftagPhotoshopLength, sharp::FreeCallback)); + } + if (baton->comments.size() > 0) { + int i = 0; + Napi::Array comments = Napi::Array::New(env, baton->comments.size()); + for (const auto& [keyword, text] : baton->comments) { + Napi::Object comment = Napi::Object::New(env); + comment.Set("keyword", keyword); + comment.Set("text", text); + comments.Set(i++, comment); + } + info.Set("comments", comments); + } + Callback().Call(Receiver().Value(), { env.Null(), info }); + } else { + Callback().Call(Receiver().Value(), { Napi::Error::New(env, sharp::TrimEnd(baton->err)).Value() }); + } + + delete baton->input; + delete baton; + } + + private: + MetadataBaton* baton; + Napi::FunctionReference debuglog; +}; + +/* + metadata(options, callback) +*/ +Napi::Value metadata(const Napi::CallbackInfo& info) { + // V8 objects are converted to non-V8 types held in the baton struct + MetadataBaton *baton = new MetadataBaton; + Napi::Object options = info[size_t(0)].As(); + + // Input + baton->input = sharp::CreateInputDescriptor(options.Get("input").As()); + + // Function to notify of libvips warnings + Napi::Function debuglog = options.Get("debuglog").As(); + + // Join queue for worker thread + Napi::Function callback = info[size_t(1)].As(); + MetadataWorker *worker = new MetadataWorker(callback, baton, debuglog); + worker->Receiver().Set("options", options); + worker->Queue(); + + // Increment queued task counter + sharp::counterQueue++; + + return info.Env().Undefined(); +} + +const char *PNG_COMMENT_START = "png-comment-"; +const int PNG_COMMENT_START_LEN = strlen(PNG_COMMENT_START); + +static void* readPNGComment(VipsImage *image, const char *field, GValue *value, void *p) { + MetadataComments *comments = static_cast(p); + + if (vips_isprefix(PNG_COMMENT_START, field)) { + const char *keyword = strchr(field + PNG_COMMENT_START_LEN, '-'); + const char *str; + if (keyword != NULL && !vips_image_get_string(image, field, &str)) { + keyword++; // Skip the hyphen + comments->push_back(std::make_pair(keyword, str)); + } + } + + return NULL; +} diff --git a/node_modules/sharp/src/metadata.h b/node_modules/sharp/src/metadata.h new file mode 100644 index 0000000..6f02d45 --- /dev/null +++ b/node_modules/sharp/src/metadata.h @@ -0,0 +1,90 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef SRC_METADATA_H_ +#define SRC_METADATA_H_ + +#include +#include +#include + +#include "./common.h" + +typedef std::vector> MetadataComments; + +struct MetadataBaton { + // Input + sharp::InputDescriptor *input; + // Output + std::string format; + int width; + int height; + std::string space; + int channels; + std::string depth; + int density; + std::string chromaSubsampling; + bool isProgressive; + bool isPalette; + int bitsPerSample; + int pages; + int pageHeight; + int loop; + std::vector delay; + int pagePrimary; + std::string compression; + std::string resolutionUnit; + std::string formatMagick; + std::vector> levels; + int subifds; + std::vector background; + bool hasProfile; + bool hasAlpha; + int orientation; + char *exif; + size_t exifLength; + char *icc; + size_t iccLength; + char *iptc; + size_t iptcLength; + char *xmp; + size_t xmpLength; + char *tifftagPhotoshop; + size_t tifftagPhotoshopLength; + MetadataComments comments; + std::string err; + + MetadataBaton(): + input(nullptr), + width(0), + height(0), + channels(0), + density(0), + isProgressive(false), + isPalette(false), + bitsPerSample(0), + pages(0), + pageHeight(0), + loop(-1), + pagePrimary(-1), + subifds(0), + hasProfile(false), + hasAlpha(false), + orientation(0), + exif(nullptr), + exifLength(0), + icc(nullptr), + iccLength(0), + iptc(nullptr), + iptcLength(0), + xmp(nullptr), + xmpLength(0), + tifftagPhotoshop(nullptr), + tifftagPhotoshopLength(0) {} +}; + +Napi::Value metadata(const Napi::CallbackInfo& info); + +#endif // SRC_METADATA_H_ diff --git a/node_modules/sharp/src/operations.cc b/node_modules/sharp/src/operations.cc new file mode 100644 index 0000000..daeba5a --- /dev/null +++ b/node_modules/sharp/src/operations.cc @@ -0,0 +1,499 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#include +#include +#include +#include +#include +#include + +#include "./common.h" +#include "./operations.h" + +using vips::VImage; +using vips::VError; + +namespace sharp { + /* + * Tint an image using the provided RGB. + */ + VImage Tint(VImage image, std::vector const tint) { + std::vector const tintLab = (VImage::black(1, 1) + tint) + .colourspace(VIPS_INTERPRETATION_LAB, VImage::option()->set("source_space", VIPS_INTERPRETATION_sRGB)) + .getpoint(0, 0); + // LAB identity function + VImage identityLab = VImage::identity(VImage::option()->set("bands", 3)) + .colourspace(VIPS_INTERPRETATION_LAB, VImage::option()->set("source_space", VIPS_INTERPRETATION_sRGB)); + // Scale luminance range, 0.0 to 1.0 + VImage l = identityLab[0] / 100; + // Weighting functions + VImage weightL = 1.0 - 4.0 * ((l - 0.5) * (l - 0.5)); + VImage weightAB = (weightL * tintLab).extract_band(1, VImage::option()->set("n", 2)); + identityLab = identityLab[0].bandjoin(weightAB); + // Convert lookup table to sRGB + VImage lut = identityLab.colourspace(VIPS_INTERPRETATION_sRGB, + VImage::option()->set("source_space", VIPS_INTERPRETATION_LAB)); + // Original colourspace + VipsInterpretation typeBeforeTint = image.interpretation(); + if (typeBeforeTint == VIPS_INTERPRETATION_RGB) { + typeBeforeTint = VIPS_INTERPRETATION_sRGB; + } + // Apply lookup table + if (image.has_alpha()) { + VImage alpha = image[image.bands() - 1]; + image = RemoveAlpha(image) + .colourspace(VIPS_INTERPRETATION_B_W) + .maplut(lut) + .colourspace(typeBeforeTint) + .bandjoin(alpha); + } else { + image = image + .colourspace(VIPS_INTERPRETATION_B_W) + .maplut(lut) + .colourspace(typeBeforeTint); + } + return image; + } + + /* + * Stretch luminance to cover full dynamic range. + */ + VImage Normalise(VImage image, int const lower, int const upper) { + // Get original colourspace + VipsInterpretation typeBeforeNormalize = image.interpretation(); + if (typeBeforeNormalize == VIPS_INTERPRETATION_RGB) { + typeBeforeNormalize = VIPS_INTERPRETATION_sRGB; + } + // Convert to LAB colourspace + VImage lab = image.colourspace(VIPS_INTERPRETATION_LAB); + // Extract luminance + VImage luminance = lab[0]; + + // Find luminance range + int const min = lower == 0 ? luminance.min() : luminance.percent(lower); + int const max = upper == 100 ? luminance.max() : luminance.percent(upper); + + if (std::abs(max - min) > 1) { + // Extract chroma + VImage chroma = lab.extract_band(1, VImage::option()->set("n", 2)); + // Calculate multiplication factor and addition + double f = 100.0 / (max - min); + double a = -(min * f); + // Scale luminance, join to chroma, convert back to original colourspace + VImage normalized = luminance.linear(f, a).bandjoin(chroma).colourspace(typeBeforeNormalize); + // Attach original alpha channel, if any + if (image.has_alpha()) { + // Extract original alpha channel + VImage alpha = image[image.bands() - 1]; + // Join alpha channel to normalised image + return normalized.bandjoin(alpha); + } else { + return normalized; + } + } + return image; + } + + /* + * Contrast limiting adapative histogram equalization (CLAHE) + */ + VImage Clahe(VImage image, int const width, int const height, int const maxSlope) { + return image.hist_local(width, height, VImage::option()->set("max_slope", maxSlope)); + } + + /* + * Gamma encoding/decoding + */ + VImage Gamma(VImage image, double const exponent) { + if (image.has_alpha()) { + // Separate alpha channel + VImage alpha = image[image.bands() - 1]; + return RemoveAlpha(image).gamma(VImage::option()->set("exponent", exponent)).bandjoin(alpha); + } else { + return image.gamma(VImage::option()->set("exponent", exponent)); + } + } + + /* + * Flatten image to remove alpha channel + */ + VImage Flatten(VImage image, std::vector flattenBackground) { + double const multiplier = sharp::Is16Bit(image.interpretation()) ? 256.0 : 1.0; + std::vector background { + flattenBackground[0] * multiplier, + flattenBackground[1] * multiplier, + flattenBackground[2] * multiplier + }; + return image.flatten(VImage::option()->set("background", background)); + } + + /** + * Produce the "negative" of the image. + */ + VImage Negate(VImage image, bool const negateAlpha) { + if (image.has_alpha() && !negateAlpha) { + // Separate alpha channel + VImage alpha = image[image.bands() - 1]; + return RemoveAlpha(image).invert().bandjoin(alpha); + } else { + return image.invert(); + } + } + + /* + * Gaussian blur. Use sigma of -1.0 for fast blur. + */ + VImage Blur(VImage image, double const sigma, VipsPrecision precision, double const minAmpl) { + if (sigma == -1.0) { + // Fast, mild blur - averages neighbouring pixels + VImage blur = VImage::new_matrixv(3, 3, + 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0); + blur.set("scale", 9.0); + return image.conv(blur); + } else { + // Slower, accurate Gaussian blur + return StaySequential(image).gaussblur(sigma, VImage::option() + ->set("precision", precision) + ->set("min_ampl", minAmpl)); + } + } + + /* + * Convolution with a kernel. + */ + VImage Convolve(VImage image, int const width, int const height, + double const scale, double const offset, + std::vector const &kernel_v + ) { + VImage kernel = VImage::new_from_memory( + static_cast(const_cast(kernel_v.data())), + width * height * sizeof(double), + width, + height, + 1, + VIPS_FORMAT_DOUBLE); + kernel.set("scale", scale); + kernel.set("offset", offset); + + return image.conv(kernel); + } + + /* + * Recomb with a Matrix of the given bands/channel size. + * Eg. RGB will be a 3x3 matrix. + */ + VImage Recomb(VImage image, std::vector const& matrix) { + double* m = const_cast(matrix.data()); + image = image.colourspace(VIPS_INTERPRETATION_sRGB); + if (matrix.size() == 9) { + return image + .recomb(image.bands() == 3 + ? VImage::new_matrix(3, 3, m, 9) + : VImage::new_matrixv(4, 4, + m[0], m[1], m[2], 0.0, + m[3], m[4], m[5], 0.0, + m[6], m[7], m[8], 0.0, + 0.0, 0.0, 0.0, 1.0)); + } else { + return image.recomb(VImage::new_matrix(4, 4, m, 16)); + } + } + + VImage Modulate(VImage image, double const brightness, double const saturation, + int const hue, double const lightness) { + VipsInterpretation colourspaceBeforeModulate = image.interpretation(); + if (image.has_alpha()) { + // Separate alpha channel + VImage alpha = image[image.bands() - 1]; + return RemoveAlpha(image) + .colourspace(VIPS_INTERPRETATION_LCH) + .linear( + { brightness, saturation, 1}, + { lightness, 0.0, static_cast(hue) } + ) + .colourspace(colourspaceBeforeModulate) + .bandjoin(alpha); + } else { + return image + .colourspace(VIPS_INTERPRETATION_LCH) + .linear( + { brightness, saturation, 1 }, + { lightness, 0.0, static_cast(hue) } + ) + .colourspace(colourspaceBeforeModulate); + } + } + + /* + * Sharpen flat and jagged areas. Use sigma of -1.0 for fast sharpen. + */ + VImage Sharpen(VImage image, double const sigma, double const m1, double const m2, + double const x1, double const y2, double const y3) { + if (sigma == -1.0) { + // Fast, mild sharpen + VImage sharpen = VImage::new_matrixv(3, 3, + -1.0, -1.0, -1.0, + -1.0, 32.0, -1.0, + -1.0, -1.0, -1.0); + sharpen.set("scale", 24.0); + return image.conv(sharpen); + } else { + // Slow, accurate sharpen in LAB colour space, with control over flat vs jagged areas + VipsInterpretation colourspaceBeforeSharpen = image.interpretation(); + if (colourspaceBeforeSharpen == VIPS_INTERPRETATION_RGB) { + colourspaceBeforeSharpen = VIPS_INTERPRETATION_sRGB; + } + return image + .sharpen(VImage::option() + ->set("sigma", sigma) + ->set("m1", m1) + ->set("m2", m2) + ->set("x1", x1) + ->set("y2", y2) + ->set("y3", y3)) + .colourspace(colourspaceBeforeSharpen); + } + } + + VImage Threshold(VImage image, double const threshold, bool const thresholdGrayscale) { + if (!thresholdGrayscale) { + return image >= threshold; + } + return image.colourspace(VIPS_INTERPRETATION_B_W) >= threshold; + } + + /* + Perform boolean/bitwise operation on image color channels - results in one channel image + */ + VImage Bandbool(VImage image, VipsOperationBoolean const boolean) { + image = image.bandbool(boolean); + return image.copy(VImage::option()->set("interpretation", VIPS_INTERPRETATION_B_W)); + } + + /* + Perform bitwise boolean operation between images + */ + VImage Boolean(VImage image, VImage imageR, VipsOperationBoolean const boolean) { + return image.boolean(imageR, boolean); + } + + /* + Trim an image + */ + VImage Trim(VImage image, std::vector background, double threshold, bool const lineArt) { + if (image.width() < 3 && image.height() < 3) { + throw VError("Image to trim must be at least 3x3 pixels"); + } + if (background.size() == 0) { + // Top-left pixel provides the default background colour if none is given + background = image.extract_area(0, 0, 1, 1)(0, 0); + } else if (sharp::Is16Bit(image.interpretation())) { + for (size_t i = 0; i < background.size(); i++) { + background[i] *= 256.0; + } + threshold *= 256.0; + } + std::vector backgroundAlpha({ background.back() }); + if (image.has_alpha()) { + background.pop_back(); + } else { + background.resize(image.bands()); + } + int left, top, width, height; + left = image.find_trim(&top, &width, &height, VImage::option() + ->set("background", background) + ->set("line_art", lineArt) + ->set("threshold", threshold)); + if (image.has_alpha()) { + // Search alpha channel (A) + int leftA, topA, widthA, heightA; + VImage alpha = image[image.bands() - 1]; + leftA = alpha.find_trim(&topA, &widthA, &heightA, VImage::option() + ->set("background", backgroundAlpha) + ->set("line_art", lineArt) + ->set("threshold", threshold)); + if (widthA > 0 && heightA > 0) { + if (width > 0 && height > 0) { + // Combined bounding box (B) + int const leftB = std::min(left, leftA); + int const topB = std::min(top, topA); + int const widthB = std::max(left + width, leftA + widthA) - leftB; + int const heightB = std::max(top + height, topA + heightA) - topB; + return image.extract_area(leftB, topB, widthB, heightB); + } else { + // Use alpha only + return image.extract_area(leftA, topA, widthA, heightA); + } + } + } + if (width > 0 && height > 0) { + return image.extract_area(left, top, width, height); + } + return image; + } + + /* + * Calculate (a * in + b) + */ + VImage Linear(VImage image, std::vector const a, std::vector const b) { + size_t const bands = static_cast(image.bands()); + if (a.size() > bands) { + throw VError("Band expansion using linear is unsupported"); + } + bool const uchar = !Is16Bit(image.interpretation()); + if (image.has_alpha() && a.size() != bands && (a.size() == 1 || a.size() == bands - 1 || bands - 1 == 1)) { + // Separate alpha channel + VImage alpha = image[bands - 1]; + return RemoveAlpha(image).linear(a, b, VImage::option()->set("uchar", uchar)).bandjoin(alpha); + } else { + return image.linear(a, b, VImage::option()->set("uchar", uchar)); + } + } + + /* + * Unflatten + */ + VImage Unflatten(VImage image) { + if (image.has_alpha()) { + VImage alpha = image[image.bands() - 1]; + VImage noAlpha = RemoveAlpha(image); + return noAlpha.bandjoin(alpha & (noAlpha.colourspace(VIPS_INTERPRETATION_B_W) < 255)); + } else { + return image.bandjoin(image.colourspace(VIPS_INTERPRETATION_B_W) < 255); + } + } + + /* + * Ensure the image is in a given colourspace + */ + VImage EnsureColourspace(VImage image, VipsInterpretation colourspace) { + if (colourspace != VIPS_INTERPRETATION_LAST && image.interpretation() != colourspace) { + image = image.colourspace(colourspace, + VImage::option()->set("source_space", image.interpretation())); + } + return image; + } + + /* + * Split and crop each frame, reassemble, and update pageHeight. + */ + VImage CropMultiPage(VImage image, int left, int top, int width, int height, + int nPages, int *pageHeight) { + if (top == 0 && height == *pageHeight) { + // Fast path; no need to adjust the height of the multi-page image + return image.extract_area(left, 0, width, image.height()); + } else { + std::vector pages; + pages.reserve(nPages); + + // Split the image into cropped frames + image = StaySequential(image); + for (int i = 0; i < nPages; i++) { + pages.push_back( + image.extract_area(left, *pageHeight * i + top, width, height)); + } + + // Reassemble the frames into a tall, thin image + VImage assembled = VImage::arrayjoin(pages, + VImage::option()->set("across", 1)); + + // Update the page height + *pageHeight = height; + + return assembled; + } + } + + /* + * Split into frames, embed each frame, reassemble, and update pageHeight. + */ + VImage EmbedMultiPage(VImage image, int left, int top, int width, int height, + VipsExtend extendWith, std::vector background, int nPages, int *pageHeight) { + if (top == 0 && height == *pageHeight) { + // Fast path; no need to adjust the height of the multi-page image + return image.embed(left, 0, width, image.height(), VImage::option() + ->set("extend", extendWith) + ->set("background", background)); + } else if (left == 0 && width == image.width()) { + // Fast path; no need to adjust the width of the multi-page image + std::vector pages; + pages.reserve(nPages); + + // Rearrange the tall image into a vertical grid + image = image.grid(*pageHeight, nPages, 1); + + // Do the embed on the wide image + image = image.embed(0, top, image.width(), height, VImage::option() + ->set("extend", extendWith) + ->set("background", background)); + + // Split the wide image into frames + for (int i = 0; i < nPages; i++) { + pages.push_back( + image.extract_area(width * i, 0, width, height)); + } + + // Reassemble the frames into a tall, thin image + VImage assembled = VImage::arrayjoin(pages, + VImage::option()->set("across", 1)); + + // Update the page height + *pageHeight = height; + + return assembled; + } else { + std::vector pages; + pages.reserve(nPages); + + // Split the image into frames + for (int i = 0; i < nPages; i++) { + pages.push_back( + image.extract_area(0, *pageHeight * i, image.width(), *pageHeight)); + } + + // Embed each frame in the target size + for (int i = 0; i < nPages; i++) { + pages[i] = pages[i].embed(left, top, width, height, VImage::option() + ->set("extend", extendWith) + ->set("background", background)); + } + + // Reassemble the frames into a tall, thin image + VImage assembled = VImage::arrayjoin(pages, + VImage::option()->set("across", 1)); + + // Update the page height + *pageHeight = height; + + return assembled; + } + } + + /* + * Dilate an image + */ + VImage Dilate(VImage image, int const width) { + int const maskWidth = 2 * width + 1; + VImage mask = VImage::new_matrix(maskWidth, maskWidth); + return image.morph( + mask, + VIPS_OPERATION_MORPHOLOGY_DILATE).invert(); + } + + /* + * Erode an image + */ + VImage Erode(VImage image, int const width) { + int const maskWidth = 2 * width + 1; + VImage mask = VImage::new_matrix(maskWidth, maskWidth); + return image.morph( + mask, + VIPS_OPERATION_MORPHOLOGY_ERODE).invert(); + } + +} // namespace sharp diff --git a/node_modules/sharp/src/operations.h b/node_modules/sharp/src/operations.h new file mode 100644 index 0000000..c281c02 --- /dev/null +++ b/node_modules/sharp/src/operations.h @@ -0,0 +1,137 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef SRC_OPERATIONS_H_ +#define SRC_OPERATIONS_H_ + +#include +#include +#include +#include +#include +#include + +using vips::VImage; + +namespace sharp { + + /* + * Tint an image using the provided RGB. + */ + VImage Tint(VImage image, std::vector const tint); + + /* + * Stretch luminance to cover full dynamic range. + */ + VImage Normalise(VImage image, int const lower, int const upper); + + /* + * Contrast limiting adapative histogram equalization (CLAHE) + */ + VImage Clahe(VImage image, int const width, int const height, int const maxSlope); + + /* + * Gamma encoding/decoding + */ + VImage Gamma(VImage image, double const exponent); + + /* + * Flatten image to remove alpha channel + */ + VImage Flatten(VImage image, std::vector flattenBackground); + + /* + * Produce the "negative" of the image. + */ + VImage Negate(VImage image, bool const negateAlpha); + + /* + * Gaussian blur. Use sigma of -1.0 for fast blur. + */ + VImage Blur(VImage image, double const sigma, VipsPrecision precision, double const minAmpl); + + /* + * Convolution with a kernel. + */ + VImage Convolve(VImage image, int const width, int const height, + double const scale, double const offset, std::vector const &kernel_v); + + /* + * Sharpen flat and jagged areas. Use sigma of -1.0 for fast sharpen. + */ + VImage Sharpen(VImage image, double const sigma, double const m1, double const m2, + double const x1, double const y2, double const y3); + + /* + Threshold an image + */ + VImage Threshold(VImage image, double const threshold, bool const thresholdColor); + + /* + Perform boolean/bitwise operation on image color channels - results in one channel image + */ + VImage Bandbool(VImage image, VipsOperationBoolean const boolean); + + /* + Perform bitwise boolean operation between images + */ + VImage Boolean(VImage image, VImage imageR, VipsOperationBoolean const boolean); + + /* + Trim an image + */ + VImage Trim(VImage image, std::vector background, double threshold, bool const lineArt); + + /* + * Linear adjustment (a * in + b) + */ + VImage Linear(VImage image, std::vector const a, std::vector const b); + + /* + * Unflatten + */ + VImage Unflatten(VImage image); + + /* + * Recomb with a Matrix of the given bands/channel size. + * Eg. RGB will be a 3x3 matrix. + */ + VImage Recomb(VImage image, std::vector const &matrix); + + /* + * Modulate brightness, saturation, hue and lightness + */ + VImage Modulate(VImage image, double const brightness, double const saturation, + int const hue, double const lightness); + + /* + * Ensure the image is in a given colourspace + */ + VImage EnsureColourspace(VImage image, VipsInterpretation colourspace); + + /* + * Split and crop each frame, reassemble, and update pageHeight. + */ + VImage CropMultiPage(VImage image, int left, int top, int width, int height, + int nPages, int *pageHeight); + + /* + * Split into frames, embed each frame, reassemble, and update pageHeight. + */ + VImage EmbedMultiPage(VImage image, int left, int top, int width, int height, + VipsExtend extendWith, std::vector background, int nPages, int *pageHeight); + + /* + * Dilate an image + */ + VImage Dilate(VImage image, int const maskWidth); + + /* + * Erode an image + */ + VImage Erode(VImage image, int const maskWidth); +} // namespace sharp + +#endif // SRC_OPERATIONS_H_ diff --git a/node_modules/sharp/src/pipeline.cc b/node_modules/sharp/src/pipeline.cc new file mode 100644 index 0000000..5f0a3bb --- /dev/null +++ b/node_modules/sharp/src/pipeline.cc @@ -0,0 +1,1814 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#include +#include +#include // NOLINT(build/c++17) +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "./common.h" +#include "./operations.h" +#include "./pipeline.h" + +class PipelineWorker : public Napi::AsyncWorker { + public: + PipelineWorker(Napi::Function callback, PipelineBaton *baton, + Napi::Function debuglog, Napi::Function queueListener) : + Napi::AsyncWorker(callback), + baton(baton), + debuglog(Napi::Persistent(debuglog)), + queueListener(Napi::Persistent(queueListener)) {} + ~PipelineWorker() {} + + // libuv worker + void Execute() { + // Decrement queued task counter + sharp::counterQueue--; + // Increment processing task counter + sharp::counterProcess++; + + try { + // Open input + vips::VImage image; + sharp::ImageType inputImageType; + if (baton->join.empty()) { + std::tie(image, inputImageType) = sharp::OpenInput(baton->input); + } else { + std::vector images; + bool hasAlpha = false; + for (auto &join : baton->join) { + std::tie(image, inputImageType) = sharp::OpenInput(join); + image = sharp::EnsureColourspace(image, baton->colourspacePipeline); + images.push_back(image); + hasAlpha |= image.has_alpha(); + } + if (hasAlpha) { + for (auto &image : images) { + if (!image.has_alpha()) { + image = sharp::EnsureAlpha(image, 1); + } + } + } else { + baton->input->joinBackground.pop_back(); + } + inputImageType = sharp::ImageType::PNG; + image = VImage::arrayjoin(images, VImage::option() + ->set("across", baton->input->joinAcross) + ->set("shim", baton->input->joinShim) + ->set("background", baton->input->joinBackground) + ->set("halign", baton->input->joinHalign) + ->set("valign", baton->input->joinValign)); + if (baton->input->joinAnimated) { + image = image.copy(); + image.set(VIPS_META_N_PAGES, static_cast(images.size())); + image.set(VIPS_META_PAGE_HEIGHT, static_cast(image.height() / images.size())); + } + } + VipsAccess access = baton->input->access; + image = sharp::EnsureColourspace(image, baton->colourspacePipeline); + + int nPages = baton->input->pages; + if (nPages == -1) { + // Resolve the number of pages if we need to render until the end of the document + nPages = image.get_typeof(VIPS_META_N_PAGES) != 0 + ? image.get_int(VIPS_META_N_PAGES) - baton->input->page + : 1; + } + + // Get pre-resize page height + int pageHeight = sharp::GetPageHeight(image); + + // Calculate angle of rotation + VipsAngle rotation = VIPS_ANGLE_D0; + VipsAngle autoRotation = VIPS_ANGLE_D0; + bool autoFlop = false; + + if (baton->input->autoOrient) { + // Rotate and flip image according to Exif orientation + std::tie(autoRotation, autoFlop) = CalculateExifRotationAndFlop(sharp::ExifOrientation(image)); + } + + rotation = CalculateAngleRotation(baton->angle); + + bool const shouldRotateBefore = baton->rotateBefore && + (rotation != VIPS_ANGLE_D0 || baton->flip || baton->flop || baton->rotationAngle != 0.0); + bool const shouldOrientBefore = (shouldRotateBefore || baton->orientBefore) && + (autoRotation != VIPS_ANGLE_D0 || autoFlop); + + if (shouldOrientBefore) { + image = sharp::StaySequential(image, autoRotation != VIPS_ANGLE_D0); + if (autoRotation != VIPS_ANGLE_D0) { + if (autoRotation != VIPS_ANGLE_D180) { + MultiPageUnsupported(nPages, "Rotate"); + } + image = image.rot(autoRotation); + autoRotation = VIPS_ANGLE_D0; + } + if (autoFlop) { + image = image.flip(VIPS_DIRECTION_HORIZONTAL); + autoFlop = false; + } + } + + if (shouldRotateBefore) { + image = sharp::StaySequential(image, rotation != VIPS_ANGLE_D0 || baton->flip || baton->rotationAngle != 0.0); + if (baton->flip) { + image = image.flip(VIPS_DIRECTION_VERTICAL); + baton->flip = false; + } + if (baton->flop) { + image = image.flip(VIPS_DIRECTION_HORIZONTAL); + baton->flop = false; + } + if (rotation != VIPS_ANGLE_D0) { + if (rotation != VIPS_ANGLE_D180) { + MultiPageUnsupported(nPages, "Rotate"); + } + image = image.rot(rotation); + rotation = VIPS_ANGLE_D0; + } + if (baton->rotationAngle != 0.0) { + MultiPageUnsupported(nPages, "Rotate"); + std::vector background; + std::tie(image, background) = sharp::ApplyAlpha(image, baton->rotationBackground, false); + image = image.rotate(baton->rotationAngle, VImage::option()->set("background", background)).copy_memory(); + baton->rotationAngle = 0.0; + } + } + + // Trim + if (baton->trimThreshold >= 0.0) { + MultiPageUnsupported(nPages, "Trim"); + image = sharp::StaySequential(image); + image = sharp::Trim(image, baton->trimBackground, baton->trimThreshold, baton->trimLineArt); + baton->trimOffsetLeft = image.xoffset(); + baton->trimOffsetTop = image.yoffset(); + } + + // Pre extraction + if (baton->topOffsetPre != -1) { + image = nPages > 1 + ? sharp::CropMultiPage(image, + baton->leftOffsetPre, baton->topOffsetPre, baton->widthPre, baton->heightPre, nPages, &pageHeight) + : image.extract_area(baton->leftOffsetPre, baton->topOffsetPre, baton->widthPre, baton->heightPre); + } + + // Get pre-resize image width and height + int inputWidth = image.width(); + int inputHeight = image.height(); + + // Is there just one page? Shrink to inputHeight instead + if (nPages == 1) { + pageHeight = inputHeight; + } + + // Scaling calculations + double hshrink; + double vshrink; + int targetResizeWidth = baton->width; + int targetResizeHeight = baton->height; + + // When auto-rotating by 90 or 270 degrees, swap the target width and + // height to ensure the behavior aligns with how it would have been if + // the rotation had taken place *before* resizing. + if (autoRotation == VIPS_ANGLE_D90 || autoRotation == VIPS_ANGLE_D270) { + std::swap(targetResizeWidth, targetResizeHeight); + } + + // Shrink to pageHeight, so we work for multi-page images + std::tie(hshrink, vshrink) = sharp::ResolveShrink( + inputWidth, pageHeight, targetResizeWidth, targetResizeHeight, + baton->canvas, baton->withoutEnlargement, baton->withoutReduction); + + // The jpeg preload shrink. + int jpegShrinkOnLoad = 1; + + // WebP, PDF, SVG scale + double scale = 1.0; + + // Try to reload input using shrink-on-load for JPEG, WebP, SVG and PDF, when: + // - the width or height parameters are specified; + // - gamma correction doesn't need to be applied; + // - trimming or pre-resize extract isn't required; + // - input colourspace is not specified; + bool const shouldPreShrink = (targetResizeWidth > 0 || targetResizeHeight > 0) && + baton->gamma == 0 && baton->topOffsetPre == -1 && baton->trimThreshold < 0.0 && + baton->colourspacePipeline == VIPS_INTERPRETATION_LAST && !(shouldOrientBefore || shouldRotateBefore); + + if (shouldPreShrink) { + // The common part of the shrink: the bit by which both axes must be shrunk + double shrink = std::min(hshrink, vshrink); + + if (inputImageType == sharp::ImageType::JPEG) { + // Leave at least a factor of two for the final resize step, when fastShrinkOnLoad: false + // for more consistent results and to avoid extra sharpness to the image + int factor = baton->fastShrinkOnLoad ? 1 : 2; + if (shrink >= 8 * factor) { + jpegShrinkOnLoad = 8; + } else if (shrink >= 4 * factor) { + jpegShrinkOnLoad = 4; + } else if (shrink >= 2 * factor) { + jpegShrinkOnLoad = 2; + } + // Lower shrink-on-load for known libjpeg rounding errors + if (jpegShrinkOnLoad > 1 && static_cast(shrink) == jpegShrinkOnLoad) { + jpegShrinkOnLoad /= 2; + } + } else if (inputImageType == sharp::ImageType::WEBP && baton->fastShrinkOnLoad && shrink > 1.0) { + // Avoid upscaling via webp + scale = 1.0 / shrink; + } else if (inputImageType == sharp::ImageType::SVG || + inputImageType == sharp::ImageType::PDF) { + scale = 1.0 / shrink; + } + } + + // Reload input using shrink-on-load, it'll be an integer shrink + // factor for jpegload*, a double scale factor for webpload*, + // pdfload* and svgload* + if (jpegShrinkOnLoad > 1) { + vips::VOption *option = GetOptionsForImageType(inputImageType, baton->input)->set("shrink", jpegShrinkOnLoad); + if (baton->input->buffer != nullptr) { + // Reload JPEG buffer + VipsBlob *blob = vips_blob_new(nullptr, baton->input->buffer, baton->input->bufferLength); + image = VImage::jpegload_buffer(blob, option); + vips_area_unref(reinterpret_cast(blob)); + } else { + // Reload JPEG file + image = VImage::jpegload(const_cast(baton->input->file.data()), option); + } + } else if (scale != 1.0) { + vips::VOption *option = GetOptionsForImageType(inputImageType, baton->input)->set("scale", scale); + if (inputImageType == sharp::ImageType::WEBP) { + if (baton->input->buffer != nullptr) { + // Reload WebP buffer + VipsBlob *blob = vips_blob_new(nullptr, baton->input->buffer, baton->input->bufferLength); + image = VImage::webpload_buffer(blob, option); + vips_area_unref(reinterpret_cast(blob)); + } else { + // Reload WebP file + image = VImage::webpload(const_cast(baton->input->file.data()), option); + } + } else if (inputImageType == sharp::ImageType::SVG) { + if (baton->input->buffer != nullptr) { + // Reload SVG buffer + VipsBlob *blob = vips_blob_new(nullptr, baton->input->buffer, baton->input->bufferLength); + image = VImage::svgload_buffer(blob, option); + vips_area_unref(reinterpret_cast(blob)); + } else { + // Reload SVG file + image = VImage::svgload(const_cast(baton->input->file.data()), option); + } + sharp::SetDensity(image, baton->input->density); + if (image.width() > 32767 || image.height() > 32767) { + throw vips::VError("Input SVG image will exceed 32767x32767 pixel limit when scaled"); + } + } else if (inputImageType == sharp::ImageType::PDF) { + if (baton->input->buffer != nullptr) { + // Reload PDF buffer + VipsBlob *blob = vips_blob_new(nullptr, baton->input->buffer, baton->input->bufferLength); + image = VImage::pdfload_buffer(blob, option); + vips_area_unref(reinterpret_cast(blob)); + } else { + // Reload PDF file + image = VImage::pdfload(const_cast(baton->input->file.data()), option); + } + sharp::SetDensity(image, baton->input->density); + } + } else { + if (inputImageType == sharp::ImageType::SVG && (image.width() > 32767 || image.height() > 32767)) { + throw vips::VError("Input SVG image exceeds 32767x32767 pixel limit"); + } + } + if (baton->input->autoOrient) { + image = sharp::RemoveExifOrientation(image); + } + + // Any pre-shrinking may already have been done + inputWidth = image.width(); + inputHeight = image.height(); + + // After pre-shrink, but before the main shrink stage + // Reuse the initial pageHeight if we didn't pre-shrink + if (shouldPreShrink) { + pageHeight = sharp::GetPageHeight(image); + } + + // Shrink to pageHeight, so we work for multi-page images + std::tie(hshrink, vshrink) = sharp::ResolveShrink( + inputWidth, pageHeight, targetResizeWidth, targetResizeHeight, + baton->canvas, baton->withoutEnlargement, baton->withoutReduction); + + int targetHeight = static_cast(std::rint(static_cast(pageHeight) / vshrink)); + int targetPageHeight = targetHeight; + + // In toilet-roll mode, we must adjust vshrink so that we exactly hit + // pageHeight or we'll have pixels straddling pixel boundaries + if (inputHeight > pageHeight) { + targetHeight *= nPages; + vshrink = static_cast(inputHeight) / targetHeight; + } + + // Ensure we're using a device-independent colour space + std::pair inputProfile(nullptr, 0); + if ((baton->keepMetadata & VIPS_FOREIGN_KEEP_ICC) && baton->withIccProfile.empty()) { + // Cache input profile for use with output + inputProfile = sharp::GetProfile(image); + baton->input->ignoreIcc = true; + } + char const *processingProfile = image.interpretation() == VIPS_INTERPRETATION_RGB16 ? "p3" : "srgb"; + if ( + sharp::HasProfile(image) && + image.interpretation() != VIPS_INTERPRETATION_LABS && + image.interpretation() != VIPS_INTERPRETATION_GREY16 && + baton->colourspacePipeline != VIPS_INTERPRETATION_CMYK && + !baton->input->ignoreIcc + ) { + // Convert to sRGB/P3 using embedded profile + try { + image = image.icc_transform(processingProfile, VImage::option() + ->set("embedded", true) + ->set("depth", sharp::Is16Bit(image.interpretation()) ? 16 : 8) + ->set("intent", VIPS_INTENT_PERCEPTUAL)); + } catch(...) { + sharp::VipsWarningCallback(nullptr, G_LOG_LEVEL_WARNING, "Invalid embedded profile", nullptr); + } + } else if ( + image.interpretation() == VIPS_INTERPRETATION_CMYK && + baton->colourspacePipeline != VIPS_INTERPRETATION_CMYK + ) { + image = image.icc_transform(processingProfile, VImage::option() + ->set("input_profile", "cmyk") + ->set("intent", VIPS_INTENT_PERCEPTUAL)); + } + + // Flatten image to remove alpha channel + if (baton->flatten && image.has_alpha()) { + image = sharp::Flatten(image, baton->flattenBackground); + } + + // Gamma encoding (darken) + if (baton->gamma >= 1 && baton->gamma <= 3) { + image = sharp::Gamma(image, 1.0 / baton->gamma); + } + + // Convert to greyscale (linear, therefore after gamma encoding, if any) + if (baton->greyscale) { + image = image.colourspace(VIPS_INTERPRETATION_B_W); + } + + bool const shouldResize = hshrink != 1.0 || vshrink != 1.0; + bool const shouldBlur = baton->blurSigma != 0.0; + bool const shouldConv = baton->convKernelWidth * baton->convKernelHeight > 0; + bool const shouldSharpen = baton->sharpenSigma != 0.0; + bool const shouldComposite = !baton->composite.empty(); + + if (shouldComposite && !image.has_alpha()) { + image = sharp::EnsureAlpha(image, 1); + } + + VipsBandFormat premultiplyFormat = image.format(); + bool const shouldPremultiplyAlpha = image.has_alpha() && + (shouldResize || shouldBlur || shouldConv || shouldSharpen); + + if (shouldPremultiplyAlpha) { + image = image.premultiply().cast(premultiplyFormat); + } + + // Resize + if (shouldResize) { + image = image.resize(1.0 / hshrink, VImage::option() + ->set("vscale", 1.0 / vshrink) + ->set("kernel", baton->kernel)); + } + + image = sharp::StaySequential(image, + autoRotation != VIPS_ANGLE_D0 || + baton->flip || + rotation != VIPS_ANGLE_D0); + // Auto-rotate post-extract + if (autoRotation != VIPS_ANGLE_D0) { + if (autoRotation != VIPS_ANGLE_D180) { + MultiPageUnsupported(nPages, "Rotate"); + } + image = image.rot(autoRotation); + } + // Mirror vertically (up-down) about the x-axis + if (baton->flip) { + image = image.flip(VIPS_DIRECTION_VERTICAL); + } + // Mirror horizontally (left-right) about the y-axis + if (baton->flop != autoFlop) { + image = image.flip(VIPS_DIRECTION_HORIZONTAL); + } + // Rotate post-extract 90-angle + if (rotation != VIPS_ANGLE_D0) { + if (rotation != VIPS_ANGLE_D180) { + MultiPageUnsupported(nPages, "Rotate"); + } + image = image.rot(rotation); + } + + // Join additional color channels to the image + if (!baton->joinChannelIn.empty()) { + VImage joinImage; + sharp::ImageType joinImageType = sharp::ImageType::UNKNOWN; + + for (unsigned int i = 0; i < baton->joinChannelIn.size(); i++) { + baton->joinChannelIn[i]->access = access; + std::tie(joinImage, joinImageType) = sharp::OpenInput(baton->joinChannelIn[i]); + joinImage = sharp::EnsureColourspace(joinImage, baton->colourspacePipeline); + image = image.bandjoin(joinImage); + } + image = image.copy(VImage::option()->set("interpretation", baton->colourspace)); + image = sharp::RemoveGifPalette(image); + } + + inputWidth = image.width(); + inputHeight = nPages > 1 ? targetPageHeight : image.height(); + + // Resolve dimensions + if (baton->width <= 0) { + baton->width = inputWidth; + } + if (baton->height <= 0) { + baton->height = inputHeight; + } + + // Crop/embed + if (inputWidth != baton->width || inputHeight != baton->height) { + if (baton->canvas == sharp::Canvas::EMBED) { + std::vector background; + std::tie(image, background) = sharp::ApplyAlpha(image, baton->resizeBackground, shouldPremultiplyAlpha); + + // Embed + const auto& [left, top] = sharp::CalculateEmbedPosition( + inputWidth, inputHeight, baton->width, baton->height, baton->position); + const int width = std::max(inputWidth, baton->width); + const int height = std::max(inputHeight, baton->height); + + image = nPages > 1 + ? sharp::EmbedMultiPage(image, + left, top, width, height, VIPS_EXTEND_BACKGROUND, background, nPages, &targetPageHeight) + : image.embed(left, top, width, height, VImage::option() + ->set("extend", VIPS_EXTEND_BACKGROUND) + ->set("background", background)); + } else if (baton->canvas == sharp::Canvas::CROP) { + if (baton->width > inputWidth) { + baton->width = inputWidth; + } + if (baton->height > inputHeight) { + baton->height = inputHeight; + } + + // Crop + if (baton->position < 9) { + // Gravity-based crop + const auto& [left, top] = sharp::CalculateCrop( + inputWidth, inputHeight, baton->width, baton->height, baton->position); + const int width = std::min(inputWidth, baton->width); + const int height = std::min(inputHeight, baton->height); + + image = nPages > 1 + ? sharp::CropMultiPage(image, + left, top, width, height, nPages, &targetPageHeight) + : image.extract_area(left, top, width, height); + } else { + int attention_x; + int attention_y; + + // Attention-based or Entropy-based crop + MultiPageUnsupported(nPages, "Resize strategy"); + image = sharp::StaySequential(image); + image = image.smartcrop(baton->width, baton->height, VImage::option() + ->set("interesting", baton->position == 16 ? VIPS_INTERESTING_ENTROPY : VIPS_INTERESTING_ATTENTION) + ->set("premultiplied", shouldPremultiplyAlpha) + ->set("attention_x", &attention_x) + ->set("attention_y", &attention_y)); + baton->hasCropOffset = true; + baton->cropOffsetLeft = static_cast(image.xoffset()); + baton->cropOffsetTop = static_cast(image.yoffset()); + baton->hasAttentionCenter = true; + baton->attentionX = static_cast(attention_x * jpegShrinkOnLoad / scale); + baton->attentionY = static_cast(attention_y * jpegShrinkOnLoad / scale); + } + } + } + + // Rotate post-extract non-90 angle + if (!baton->rotateBefore && baton->rotationAngle != 0.0) { + MultiPageUnsupported(nPages, "Rotate"); + image = sharp::StaySequential(image); + std::vector background; + std::tie(image, background) = sharp::ApplyAlpha(image, baton->rotationBackground, shouldPremultiplyAlpha); + image = image.rotate(baton->rotationAngle, VImage::option()->set("background", background)); + } + + // Post extraction + if (baton->topOffsetPost != -1) { + if (nPages > 1) { + image = sharp::CropMultiPage(image, + baton->leftOffsetPost, baton->topOffsetPost, baton->widthPost, baton->heightPost, + nPages, &targetPageHeight); + + // heightPost is used in the info object, so update to reflect the number of pages + baton->heightPost *= nPages; + } else { + image = image.extract_area( + baton->leftOffsetPost, baton->topOffsetPost, baton->widthPost, baton->heightPost); + } + } + + // Affine transform + if (!baton->affineMatrix.empty()) { + MultiPageUnsupported(nPages, "Affine"); + image = sharp::StaySequential(image); + std::vector background; + std::tie(image, background) = sharp::ApplyAlpha(image, baton->affineBackground, shouldPremultiplyAlpha); + vips::VInterpolate interp = vips::VInterpolate::new_from_name( + const_cast(baton->affineInterpolator.data())); + image = image.affine(baton->affineMatrix, VImage::option()->set("background", background) + ->set("idx", baton->affineIdx) + ->set("idy", baton->affineIdy) + ->set("odx", baton->affineOdx) + ->set("ody", baton->affineOdy) + ->set("interpolate", interp)); + } + + // Extend edges + if (baton->extendTop > 0 || baton->extendBottom > 0 || baton->extendLeft > 0 || baton->extendRight > 0) { + // Embed + baton->width = image.width() + baton->extendLeft + baton->extendRight; + baton->height = (nPages > 1 ? targetPageHeight : image.height()) + baton->extendTop + baton->extendBottom; + + if (baton->extendWith == VIPS_EXTEND_BACKGROUND) { + std::vector background; + std::tie(image, background) = sharp::ApplyAlpha(image, baton->extendBackground, shouldPremultiplyAlpha); + + image = sharp::StaySequential(image, nPages > 1); + image = nPages > 1 + ? sharp::EmbedMultiPage(image, + baton->extendLeft, baton->extendTop, baton->width, baton->height, + baton->extendWith, background, nPages, &targetPageHeight) + : image.embed(baton->extendLeft, baton->extendTop, baton->width, baton->height, + VImage::option()->set("extend", baton->extendWith)->set("background", background)); + } else { + std::vector ignoredBackground(1); + image = sharp::StaySequential(image); + image = nPages > 1 + ? sharp::EmbedMultiPage(image, + baton->extendLeft, baton->extendTop, baton->width, baton->height, + baton->extendWith, ignoredBackground, nPages, &targetPageHeight) + : image.embed(baton->extendLeft, baton->extendTop, baton->width, baton->height, + VImage::option()->set("extend", baton->extendWith)); + } + } + // Median - must happen before blurring, due to the utility of blurring after thresholding + if (baton->medianSize > 0) { + image = image.median(baton->medianSize); + } + + // Threshold - must happen before blurring, due to the utility of blurring after thresholding + // Threshold - must happen before unflatten to enable non-white unflattening + if (baton->threshold != 0) { + image = sharp::Threshold(image, baton->threshold, baton->thresholdGrayscale); + } + + // Dilate - must happen before blurring, due to the utility of dilating after thresholding + if (baton->dilateWidth != 0) { + image = sharp::Dilate(image, baton->dilateWidth); + } + + // Erode - must happen before blurring, due to the utility of eroding after thresholding + if (baton->erodeWidth != 0) { + image = sharp::Erode(image, baton->erodeWidth); + } + + // Blur + if (shouldBlur) { + image = sharp::Blur(image, baton->blurSigma, baton->precision, baton->minAmpl); + } + + // Unflatten the image + if (baton->unflatten) { + image = sharp::Unflatten(image); + } + + // Convolve + if (shouldConv) { + image = sharp::Convolve(image, + baton->convKernelWidth, baton->convKernelHeight, + baton->convKernelScale, baton->convKernelOffset, + baton->convKernel); + } + + // Recomb + if (!baton->recombMatrix.empty()) { + image = sharp::Recomb(image, baton->recombMatrix); + } + + // Modulate + if (baton->brightness != 1.0 || baton->saturation != 1.0 || baton->hue != 0.0 || baton->lightness != 0.0) { + image = sharp::Modulate(image, baton->brightness, baton->saturation, baton->hue, baton->lightness); + } + + // Sharpen + if (shouldSharpen) { + image = sharp::Sharpen(image, baton->sharpenSigma, baton->sharpenM1, baton->sharpenM2, + baton->sharpenX1, baton->sharpenY2, baton->sharpenY3); + } + + // Reverse premultiplication after all transformations + if (shouldPremultiplyAlpha) { + image = image.unpremultiply().cast(premultiplyFormat); + } + baton->premultiplied = shouldPremultiplyAlpha; + + // Composite + if (shouldComposite) { + std::vector images = { image }; + std::vector modes, xs, ys; + for (Composite *composite : baton->composite) { + VImage compositeImage; + sharp::ImageType compositeImageType = sharp::ImageType::UNKNOWN; + composite->input->access = access; + std::tie(compositeImage, compositeImageType) = sharp::OpenInput(composite->input); + + if (composite->input->autoOrient) { + // Respect EXIF Orientation + VipsAngle compositeAutoRotation = VIPS_ANGLE_D0; + bool compositeAutoFlop = false; + std::tie(compositeAutoRotation, compositeAutoFlop) = + CalculateExifRotationAndFlop(sharp::ExifOrientation(compositeImage)); + + compositeImage = sharp::RemoveExifOrientation(compositeImage); + compositeImage = sharp::StaySequential(compositeImage, compositeAutoRotation != VIPS_ANGLE_D0); + + if (compositeAutoRotation != VIPS_ANGLE_D0) { + compositeImage = compositeImage.rot(compositeAutoRotation); + } + if (compositeAutoFlop) { + compositeImage = compositeImage.flip(VIPS_DIRECTION_HORIZONTAL); + } + } + + // Verify within current dimensions + if (compositeImage.width() > image.width() || compositeImage.height() > image.height()) { + throw vips::VError("Image to composite must have same dimensions or smaller"); + } + // Check if overlay is tiled + if (composite->tile) { + int across = 0; + int down = 0; + // Use gravity in overlay + if (compositeImage.width() <= image.width()) { + across = static_cast(ceil(static_cast(image.width()) / compositeImage.width())); + // Ensure odd number of tiles across when gravity is centre, north or south + if (composite->gravity == 0 || composite->gravity == 1 || composite->gravity == 3) { + across |= 1; + } + } + if (compositeImage.height() <= image.height()) { + down = static_cast(ceil(static_cast(image.height()) / compositeImage.height())); + // Ensure odd number of tiles down when gravity is centre, east or west + if (composite->gravity == 0 || composite->gravity == 2 || composite->gravity == 4) { + down |= 1; + } + } + if (across != 0 || down != 0) { + int left; + int top; + compositeImage = sharp::StaySequential(compositeImage).replicate(across, down); + if (composite->hasOffset) { + std::tie(left, top) = sharp::CalculateCrop( + compositeImage.width(), compositeImage.height(), image.width(), image.height(), + composite->left, composite->top); + } else { + std::tie(left, top) = sharp::CalculateCrop( + compositeImage.width(), compositeImage.height(), image.width(), image.height(), composite->gravity); + } + compositeImage = compositeImage.extract_area(left, top, image.width(), image.height()); + } + // gravity was used for extract_area, set it back to its default value of 0 + composite->gravity = 0; + } + // Ensure image to composite is with unpremultiplied alpha + compositeImage = sharp::EnsureAlpha(compositeImage, 1); + if (composite->premultiplied) compositeImage = compositeImage.unpremultiply(); + // Calculate position + int left; + int top; + if (composite->hasOffset) { + // Composite image at given offsets + if (composite->tile) { + std::tie(left, top) = sharp::CalculateCrop(image.width(), image.height(), + compositeImage.width(), compositeImage.height(), composite->left, composite->top); + } else { + left = composite->left; + top = composite->top; + } + } else { + // Composite image with given gravity + std::tie(left, top) = sharp::CalculateCrop(image.width(), image.height(), + compositeImage.width(), compositeImage.height(), composite->gravity); + } + images.push_back(compositeImage); + modes.push_back(composite->mode); + xs.push_back(left); + ys.push_back(top); + } + image = VImage::composite(images, modes, VImage::option() + ->set("compositing_space", baton->colourspacePipeline == VIPS_INTERPRETATION_LAST + ? VIPS_INTERPRETATION_sRGB + : baton->colourspacePipeline) + ->set("x", xs) + ->set("y", ys)); + image = sharp::RemoveGifPalette(image); + } + + // Gamma decoding (brighten) + if (baton->gammaOut >= 1 && baton->gammaOut <= 3) { + image = sharp::Gamma(image, baton->gammaOut); + } + + // Linear adjustment (a * in + b) + if (!baton->linearA.empty()) { + image = sharp::Linear(image, baton->linearA, baton->linearB); + } + + // Apply normalisation - stretch luminance to cover full dynamic range + if (baton->normalise) { + image = sharp::StaySequential(image); + image = sharp::Normalise(image, baton->normaliseLower, baton->normaliseUpper); + } + + // Apply contrast limiting adaptive histogram equalization (CLAHE) + if (baton->claheWidth != 0 && baton->claheHeight != 0) { + image = sharp::StaySequential(image); + image = sharp::Clahe(image, baton->claheWidth, baton->claheHeight, baton->claheMaxSlope); + } + + // Apply bitwise boolean operation between images + if (baton->boolean != nullptr) { + VImage booleanImage; + sharp::ImageType booleanImageType = sharp::ImageType::UNKNOWN; + baton->boolean->access = access; + std::tie(booleanImage, booleanImageType) = sharp::OpenInput(baton->boolean); + booleanImage = sharp::EnsureColourspace(booleanImage, baton->colourspacePipeline); + image = sharp::Boolean(image, booleanImage, baton->booleanOp); + image = sharp::RemoveGifPalette(image); + } + + // Apply per-channel Bandbool bitwise operations after all other operations + if (baton->bandBoolOp >= VIPS_OPERATION_BOOLEAN_AND && baton->bandBoolOp < VIPS_OPERATION_BOOLEAN_LAST) { + image = sharp::Bandbool(image, baton->bandBoolOp); + } + + // Tint the image + if (baton->tint[0] >= 0.0) { + image = sharp::Tint(image, baton->tint); + } + + // Remove alpha channel, if any + if (baton->removeAlpha) { + image = sharp::RemoveAlpha(image); + } + + // Ensure alpha channel, if missing + if (baton->ensureAlpha != -1) { + image = sharp::EnsureAlpha(image, baton->ensureAlpha); + } + + // Ensure output colour space + if (sharp::Is16Bit(image.interpretation())) { + image = image.cast(VIPS_FORMAT_USHORT); + } + if (image.interpretation() != baton->colourspace) { + image = image.colourspace(baton->colourspace, VImage::option()->set("source_space", image.interpretation())); + if (inputProfile.first != nullptr && baton->withIccProfile.empty()) { + image = sharp::SetProfile(image, inputProfile); + } + } + + // Extract channel + if (baton->extractChannel > -1) { + if (baton->extractChannel >= image.bands()) { + if (baton->extractChannel == 3 && image.has_alpha()) { + baton->extractChannel = image.bands() - 1; + } else { + (baton->err) + .append("Cannot extract channel ").append(std::to_string(baton->extractChannel)) + .append(" from image with channels 0-").append(std::to_string(image.bands() - 1)); + return Error(); + } + } + VipsInterpretation colourspace = sharp::Is16Bit(image.interpretation()) + ? VIPS_INTERPRETATION_GREY16 + : VIPS_INTERPRETATION_B_W; + image = image + .extract_band(baton->extractChannel) + .copy(VImage::option()->set("interpretation", colourspace)); + } + + // Apply output ICC profile + if (!baton->withIccProfile.empty()) { + try { + image = image.icc_transform(const_cast(baton->withIccProfile.data()), VImage::option() + ->set("input_profile", processingProfile) + ->set("embedded", true) + ->set("depth", sharp::Is16Bit(image.interpretation()) ? 16 : 8) + ->set("intent", VIPS_INTENT_PERCEPTUAL)); + } catch(...) { + sharp::VipsWarningCallback(nullptr, G_LOG_LEVEL_WARNING, "Invalid profile", nullptr); + } + } + + // Negate the colours in the image + if (baton->negate) { + image = sharp::Negate(image, baton->negateAlpha); + } + + // Override EXIF Orientation tag + if (baton->withMetadataOrientation != -1) { + image = sharp::SetExifOrientation(image, baton->withMetadataOrientation); + } + // Override pixel density + if (baton->withMetadataDensity > 0) { + image = sharp::SetDensity(image, baton->withMetadataDensity); + } + // EXIF key/value pairs + if (baton->keepMetadata & VIPS_FOREIGN_KEEP_EXIF) { + image = image.copy(); + if (!baton->withExifMerge) { + image = sharp::RemoveExif(image); + } + for (const auto& [key, value] : baton->withExif) { + image.set(key.c_str(), value.c_str()); + } + } + // XMP buffer + if ((baton->keepMetadata & VIPS_FOREIGN_KEEP_XMP) && !baton->withXmp.empty()) { + image = image.copy(); + image.set(VIPS_META_XMP_NAME, nullptr, + const_cast(static_cast(baton->withXmp.c_str())), baton->withXmp.size()); + } + // Number of channels used in output image + baton->channels = image.bands(); + baton->width = image.width(); + baton->height = image.height(); + + image = sharp::SetAnimationProperties( + image, nPages, targetPageHeight, baton->delay, baton->loop); + + if (image.get_typeof(VIPS_META_PAGE_HEIGHT) == G_TYPE_INT) { + baton->pageHeightOut = image.get_int(VIPS_META_PAGE_HEIGHT); + baton->pagesOut = image.get_int(VIPS_META_N_PAGES); + } + + // Output + sharp::SetTimeout(image, baton->timeoutSeconds); + if (baton->fileOut.empty()) { + // Buffer output + if (baton->formatOut == "jpeg" || (baton->formatOut == "input" && inputImageType == sharp::ImageType::JPEG)) { + // Write JPEG to buffer + sharp::AssertImageTypeDimensions(image, sharp::ImageType::JPEG); + VipsArea *area = reinterpret_cast(image.jpegsave_buffer(VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->jpegQuality) + ->set("interlace", baton->jpegProgressive) + ->set("subsample_mode", baton->jpegChromaSubsampling == "4:4:4" + ? VIPS_FOREIGN_SUBSAMPLE_OFF + : VIPS_FOREIGN_SUBSAMPLE_ON) + ->set("trellis_quant", baton->jpegTrellisQuantisation) + ->set("quant_table", baton->jpegQuantisationTable) + ->set("overshoot_deringing", baton->jpegOvershootDeringing) + ->set("optimize_scans", baton->jpegOptimiseScans) + ->set("optimize_coding", baton->jpegOptimiseCoding))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "jpeg"; + if (baton->colourspace == VIPS_INTERPRETATION_CMYK) { + baton->channels = std::min(baton->channels, 4); + } else { + baton->channels = std::min(baton->channels, 3); + } + } else if (baton->formatOut == "jp2" || (baton->formatOut == "input" + && inputImageType == sharp::ImageType::JP2)) { + // Write JP2 to Buffer + sharp::AssertImageTypeDimensions(image, sharp::ImageType::JP2); + VipsArea *area = reinterpret_cast(image.jp2ksave_buffer(VImage::option() + ->set("Q", baton->jp2Quality) + ->set("lossless", baton->jp2Lossless) + ->set("subsample_mode", baton->jp2ChromaSubsampling == "4:4:4" + ? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_ON) + ->set("tile_height", baton->jp2TileHeight) + ->set("tile_width", baton->jp2TileWidth))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "jp2"; + } else if (baton->formatOut == "png" || (baton->formatOut == "input" && + (inputImageType == sharp::ImageType::PNG || inputImageType == sharp::ImageType::SVG))) { + // Write PNG to buffer + sharp::AssertImageTypeDimensions(image, sharp::ImageType::PNG); + VipsArea *area = reinterpret_cast(image.pngsave_buffer(VImage::option() + ->set("keep", baton->keepMetadata) + ->set("interlace", baton->pngProgressive) + ->set("compression", baton->pngCompressionLevel) + ->set("filter", baton->pngAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_ALL : VIPS_FOREIGN_PNG_FILTER_NONE) + ->set("palette", baton->pngPalette) + ->set("Q", baton->pngQuality) + ->set("effort", baton->pngEffort) + ->set("bitdepth", sharp::Is16Bit(image.interpretation()) ? 16 : baton->pngBitdepth) + ->set("dither", baton->pngDither))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "png"; + } else if (baton->formatOut == "webp" || + (baton->formatOut == "input" && inputImageType == sharp::ImageType::WEBP)) { + // Write WEBP to buffer + sharp::AssertImageTypeDimensions(image, sharp::ImageType::WEBP); + VipsArea *area = reinterpret_cast(image.webpsave_buffer(VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->webpQuality) + ->set("lossless", baton->webpLossless) + ->set("near_lossless", baton->webpNearLossless) + ->set("smart_subsample", baton->webpSmartSubsample) + ->set("smart_deblock", baton->webpSmartDeblock) + ->set("preset", baton->webpPreset) + ->set("effort", baton->webpEffort) + ->set("min_size", baton->webpMinSize) + ->set("mixed", baton->webpMixed) + ->set("alpha_q", baton->webpAlphaQuality))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "webp"; + } else if (baton->formatOut == "gif" || + (baton->formatOut == "input" && inputImageType == sharp::ImageType::GIF)) { + // Write GIF to buffer + sharp::AssertImageTypeDimensions(image, sharp::ImageType::GIF); + VipsArea *area = reinterpret_cast(image.gifsave_buffer(VImage::option() + ->set("keep", baton->keepMetadata) + ->set("bitdepth", baton->gifBitdepth) + ->set("effort", baton->gifEffort) + ->set("reuse", baton->gifReuse) + ->set("interlace", baton->gifProgressive) + ->set("interframe_maxerror", baton->gifInterFrameMaxError) + ->set("interpalette_maxerror", baton->gifInterPaletteMaxError) + ->set("keep_duplicate_frames", baton->gifKeepDuplicateFrames) + ->set("dither", baton->gifDither))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "gif"; + } else if (baton->formatOut == "tiff" || + (baton->formatOut == "input" && inputImageType == sharp::ImageType::TIFF)) { + // Write TIFF to buffer + if (baton->tiffCompression == VIPS_FOREIGN_TIFF_COMPRESSION_JPEG) { + sharp::AssertImageTypeDimensions(image, sharp::ImageType::JPEG); + baton->channels = std::min(baton->channels, 3); + } + // Cast pixel values to float, if required + if (baton->tiffPredictor == VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT) { + image = image.cast(VIPS_FORMAT_FLOAT); + } + VipsArea *area = reinterpret_cast(image.tiffsave_buffer(VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->tiffQuality) + ->set("bitdepth", baton->tiffBitdepth) + ->set("compression", baton->tiffCompression) + ->set("bigtiff", baton->tiffBigtiff) + ->set("miniswhite", baton->tiffMiniswhite) + ->set("predictor", baton->tiffPredictor) + ->set("pyramid", baton->tiffPyramid) + ->set("tile", baton->tiffTile) + ->set("tile_height", baton->tiffTileHeight) + ->set("tile_width", baton->tiffTileWidth) + ->set("xres", baton->tiffXres) + ->set("yres", baton->tiffYres) + ->set("resunit", baton->tiffResolutionUnit))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "tiff"; + } else if (baton->formatOut == "heif" || + (baton->formatOut == "input" && inputImageType == sharp::ImageType::HEIF)) { + // Write HEIF to buffer + sharp::AssertImageTypeDimensions(image, sharp::ImageType::HEIF); + image = sharp::RemoveAnimationProperties(image); + VipsArea *area = reinterpret_cast(image.heifsave_buffer(VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->heifQuality) + ->set("compression", baton->heifCompression) + ->set("effort", baton->heifEffort) + ->set("bitdepth", baton->heifBitdepth) + ->set("subsample_mode", baton->heifChromaSubsampling == "4:4:4" + ? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_ON) + ->set("lossless", baton->heifLossless))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "heif"; + } else if (baton->formatOut == "dz") { + // Write DZ to buffer + baton->tileContainer = VIPS_FOREIGN_DZ_CONTAINER_ZIP; + if (!image.has_alpha()) { + baton->tileBackground.pop_back(); + } + image = sharp::StaySequential(image, baton->tileAngle != 0); + vips::VOption *options = BuildOptionsDZ(baton); + VipsArea *area = reinterpret_cast(image.dzsave_buffer(options)); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "dz"; + } else if (baton->formatOut == "jxl" || + (baton->formatOut == "input" && inputImageType == sharp::ImageType::JXL)) { + // Write JXL to buffer + image = sharp::RemoveAnimationProperties(image); + VipsArea *area = reinterpret_cast(image.jxlsave_buffer(VImage::option() + ->set("keep", baton->keepMetadata) + ->set("distance", baton->jxlDistance) + ->set("tier", baton->jxlDecodingTier) + ->set("effort", baton->jxlEffort) + ->set("lossless", baton->jxlLossless))); + baton->bufferOut = static_cast(area->data); + baton->bufferOutLength = area->length; + area->free_fn = nullptr; + vips_area_unref(area); + baton->formatOut = "jxl"; + } else if (baton->formatOut == "raw" || + (baton->formatOut == "input" && inputImageType == sharp::ImageType::RAW)) { + // Write raw, uncompressed image data to buffer + if (baton->greyscale || image.interpretation() == VIPS_INTERPRETATION_B_W) { + // Extract first band for greyscale image + image = image[0]; + baton->channels = 1; + } + if (image.format() != baton->rawDepth) { + // Cast pixels to requested format + image = image.cast(baton->rawDepth); + } + // Get raw image data + baton->bufferOut = static_cast(image.write_to_memory(&baton->bufferOutLength)); + if (baton->bufferOut == nullptr) { + (baton->err).append("Could not allocate enough memory for raw output"); + return Error(); + } + baton->formatOut = "raw"; + } else { + // Unsupported output format + (baton->err).append("Unsupported output format "); + if (baton->formatOut == "input") { + (baton->err).append("when trying to match input format of "); + (baton->err).append(ImageTypeId(inputImageType)); + } else { + (baton->err).append(baton->formatOut); + } + return Error(); + } + } else { + // File output + bool const isJpeg = sharp::IsJpeg(baton->fileOut); + bool const isPng = sharp::IsPng(baton->fileOut); + bool const isWebp = sharp::IsWebp(baton->fileOut); + bool const isGif = sharp::IsGif(baton->fileOut); + bool const isTiff = sharp::IsTiff(baton->fileOut); + bool const isJp2 = sharp::IsJp2(baton->fileOut); + bool const isHeif = sharp::IsHeif(baton->fileOut); + bool const isJxl = sharp::IsJxl(baton->fileOut); + bool const isDz = sharp::IsDz(baton->fileOut); + bool const isDzZip = sharp::IsDzZip(baton->fileOut); + bool const isV = sharp::IsV(baton->fileOut); + bool const mightMatchInput = baton->formatOut == "input"; + bool const willMatchInput = mightMatchInput && + !(isJpeg || isPng || isWebp || isGif || isTiff || isJp2 || isHeif || isDz || isDzZip || isV); + + if (baton->formatOut == "jpeg" || (mightMatchInput && isJpeg) || + (willMatchInput && inputImageType == sharp::ImageType::JPEG)) { + // Write JPEG to file + sharp::AssertImageTypeDimensions(image, sharp::ImageType::JPEG); + image.jpegsave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->jpegQuality) + ->set("interlace", baton->jpegProgressive) + ->set("subsample_mode", baton->jpegChromaSubsampling == "4:4:4" + ? VIPS_FOREIGN_SUBSAMPLE_OFF + : VIPS_FOREIGN_SUBSAMPLE_ON) + ->set("trellis_quant", baton->jpegTrellisQuantisation) + ->set("quant_table", baton->jpegQuantisationTable) + ->set("overshoot_deringing", baton->jpegOvershootDeringing) + ->set("optimize_scans", baton->jpegOptimiseScans) + ->set("optimize_coding", baton->jpegOptimiseCoding)); + baton->formatOut = "jpeg"; + baton->channels = std::min(baton->channels, 3); + } else if (baton->formatOut == "jp2" || (mightMatchInput && isJp2) || + (willMatchInput && (inputImageType == sharp::ImageType::JP2))) { + // Write JP2 to file + sharp::AssertImageTypeDimensions(image, sharp::ImageType::JP2); + image.jp2ksave(const_cast(baton->fileOut.data()), VImage::option() + ->set("Q", baton->jp2Quality) + ->set("lossless", baton->jp2Lossless) + ->set("subsample_mode", baton->jp2ChromaSubsampling == "4:4:4" + ? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_ON) + ->set("tile_height", baton->jp2TileHeight) + ->set("tile_width", baton->jp2TileWidth)); + baton->formatOut = "jp2"; + } else if (baton->formatOut == "png" || (mightMatchInput && isPng) || (willMatchInput && + (inputImageType == sharp::ImageType::PNG || inputImageType == sharp::ImageType::SVG))) { + // Write PNG to file + sharp::AssertImageTypeDimensions(image, sharp::ImageType::PNG); + image.pngsave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata) + ->set("interlace", baton->pngProgressive) + ->set("compression", baton->pngCompressionLevel) + ->set("filter", baton->pngAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_ALL : VIPS_FOREIGN_PNG_FILTER_NONE) + ->set("palette", baton->pngPalette) + ->set("Q", baton->pngQuality) + ->set("bitdepth", sharp::Is16Bit(image.interpretation()) ? 16 : baton->pngBitdepth) + ->set("effort", baton->pngEffort) + ->set("dither", baton->pngDither)); + baton->formatOut = "png"; + } else if (baton->formatOut == "webp" || (mightMatchInput && isWebp) || + (willMatchInput && inputImageType == sharp::ImageType::WEBP)) { + // Write WEBP to file + sharp::AssertImageTypeDimensions(image, sharp::ImageType::WEBP); + image.webpsave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->webpQuality) + ->set("lossless", baton->webpLossless) + ->set("near_lossless", baton->webpNearLossless) + ->set("smart_subsample", baton->webpSmartSubsample) + ->set("smart_deblock", baton->webpSmartDeblock) + ->set("preset", baton->webpPreset) + ->set("effort", baton->webpEffort) + ->set("min_size", baton->webpMinSize) + ->set("mixed", baton->webpMixed) + ->set("alpha_q", baton->webpAlphaQuality)); + baton->formatOut = "webp"; + } else if (baton->formatOut == "gif" || (mightMatchInput && isGif) || + (willMatchInput && inputImageType == sharp::ImageType::GIF)) { + // Write GIF to file + sharp::AssertImageTypeDimensions(image, sharp::ImageType::GIF); + image.gifsave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata) + ->set("bitdepth", baton->gifBitdepth) + ->set("effort", baton->gifEffort) + ->set("reuse", baton->gifReuse) + ->set("interlace", baton->gifProgressive) + ->set("interframe_maxerror", baton->gifInterFrameMaxError) + ->set("interpalette_maxerror", baton->gifInterPaletteMaxError) + ->set("keep_duplicate_frames", baton->gifKeepDuplicateFrames) + ->set("dither", baton->gifDither)); + baton->formatOut = "gif"; + } else if (baton->formatOut == "tiff" || (mightMatchInput && isTiff) || + (willMatchInput && inputImageType == sharp::ImageType::TIFF)) { + // Write TIFF to file + if (baton->tiffCompression == VIPS_FOREIGN_TIFF_COMPRESSION_JPEG) { + sharp::AssertImageTypeDimensions(image, sharp::ImageType::JPEG); + baton->channels = std::min(baton->channels, 3); + } + // Cast pixel values to float, if required + if (baton->tiffPredictor == VIPS_FOREIGN_TIFF_PREDICTOR_FLOAT) { + image = image.cast(VIPS_FORMAT_FLOAT); + } + image.tiffsave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->tiffQuality) + ->set("bitdepth", baton->tiffBitdepth) + ->set("compression", baton->tiffCompression) + ->set("bigtiff", baton->tiffBigtiff) + ->set("miniswhite", baton->tiffMiniswhite) + ->set("predictor", baton->tiffPredictor) + ->set("pyramid", baton->tiffPyramid) + ->set("tile", baton->tiffTile) + ->set("tile_height", baton->tiffTileHeight) + ->set("tile_width", baton->tiffTileWidth) + ->set("xres", baton->tiffXres) + ->set("yres", baton->tiffYres) + ->set("resunit", baton->tiffResolutionUnit)); + baton->formatOut = "tiff"; + } else if (baton->formatOut == "heif" || (mightMatchInput && isHeif) || + (willMatchInput && inputImageType == sharp::ImageType::HEIF)) { + // Write HEIF to file + sharp::AssertImageTypeDimensions(image, sharp::ImageType::HEIF); + image = sharp::RemoveAnimationProperties(image); + image.heifsave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata) + ->set("Q", baton->heifQuality) + ->set("compression", baton->heifCompression) + ->set("effort", baton->heifEffort) + ->set("bitdepth", baton->heifBitdepth) + ->set("subsample_mode", baton->heifChromaSubsampling == "4:4:4" + ? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_ON) + ->set("lossless", baton->heifLossless)); + baton->formatOut = "heif"; + } else if (baton->formatOut == "jxl" || (mightMatchInput && isJxl) || + (willMatchInput && inputImageType == sharp::ImageType::JXL)) { + // Write JXL to file + image = sharp::RemoveAnimationProperties(image); + image.jxlsave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata) + ->set("distance", baton->jxlDistance) + ->set("tier", baton->jxlDecodingTier) + ->set("effort", baton->jxlEffort) + ->set("lossless", baton->jxlLossless)); + baton->formatOut = "jxl"; + } else if (baton->formatOut == "dz" || isDz || isDzZip) { + // Write DZ to file + if (isDzZip) { + baton->tileContainer = VIPS_FOREIGN_DZ_CONTAINER_ZIP; + } + if (!image.has_alpha()) { + baton->tileBackground.pop_back(); + } + image = sharp::StaySequential(image, baton->tileAngle != 0); + vips::VOption *options = BuildOptionsDZ(baton); + image.dzsave(const_cast(baton->fileOut.data()), options); + baton->formatOut = "dz"; + } else if (baton->formatOut == "v" || (mightMatchInput && isV) || + (willMatchInput && inputImageType == sharp::ImageType::VIPS)) { + // Write V to file + image.vipssave(const_cast(baton->fileOut.data()), VImage::option() + ->set("keep", baton->keepMetadata)); + baton->formatOut = "v"; + } else { + // Unsupported output format + (baton->err).append("Unsupported output format " + baton->fileOut); + return Error(); + } + } + } catch (vips::VError const &err) { + char const *what = err.what(); + if (what && what[0]) { + (baton->err).append(what); + } else { + if (baton->input->failOn == VIPS_FAIL_ON_WARNING) { + (baton->err).append("Warning treated as error due to failOn setting"); + baton->errUseWarning = true; + } else { + (baton->err).append("Unknown error"); + } + } + } + // Clean up libvips' per-request data and threads + vips_error_clear(); + vips_thread_shutdown(); + } + + void OnOK() { + Napi::Env env = Env(); + Napi::HandleScope scope(env); + + // Handle warnings + std::string warning = sharp::VipsWarningPop(); + while (!warning.empty()) { + if (baton->errUseWarning) { + (baton->err).append("\n").append(warning); + } else { + debuglog.Call(Receiver().Value(), { Napi::String::New(env, warning) }); + } + warning = sharp::VipsWarningPop(); + } + + if (baton->err.empty()) { + int width = baton->width; + int height = baton->height; + if (baton->topOffsetPre != -1 && (baton->width == -1 || baton->height == -1)) { + width = baton->widthPre; + height = baton->heightPre; + } + if (baton->topOffsetPost != -1) { + width = baton->widthPost; + height = baton->heightPost; + } + // Info Object + Napi::Object info = Napi::Object::New(env); + info.Set("format", baton->formatOut); + info.Set("width", static_cast(width)); + info.Set("height", static_cast(height)); + info.Set("channels", static_cast(baton->channels)); + if (baton->formatOut == "raw") { + info.Set("depth", vips_enum_nick(VIPS_TYPE_BAND_FORMAT, baton->rawDepth)); + } + info.Set("premultiplied", baton->premultiplied); + if (baton->hasCropOffset) { + info.Set("cropOffsetLeft", static_cast(baton->cropOffsetLeft)); + info.Set("cropOffsetTop", static_cast(baton->cropOffsetTop)); + } + if (baton->hasAttentionCenter) { + info.Set("attentionX", static_cast(baton->attentionX)); + info.Set("attentionY", static_cast(baton->attentionY)); + } + if (baton->trimThreshold >= 0.0) { + info.Set("trimOffsetLeft", static_cast(baton->trimOffsetLeft)); + info.Set("trimOffsetTop", static_cast(baton->trimOffsetTop)); + } + if (baton->input->textAutofitDpi) { + info.Set("textAutofitDpi", static_cast(baton->input->textAutofitDpi)); + } + if (baton->pageHeightOut) { + info.Set("pageHeight", static_cast(baton->pageHeightOut)); + info.Set("pages", static_cast(baton->pagesOut)); + } + + if (baton->bufferOutLength > 0) { + // Add buffer size to info + info.Set("size", static_cast(baton->bufferOutLength)); + // Pass ownership of output data to Buffer instance + Napi::Buffer data = Napi::Buffer::NewOrCopy(env, static_cast(baton->bufferOut), + baton->bufferOutLength, sharp::FreeCallback); + Callback().Call(Receiver().Value(), { env.Null(), data, info }); + } else { + // Add file size to info + if (baton->formatOut != "dz" || sharp::IsDzZip(baton->fileOut)) { + try { + uint32_t const size = static_cast( + std::filesystem::file_size(std::filesystem::u8path(baton->fileOut))); + info.Set("size", size); + } catch (...) {} + } + Callback().Call(Receiver().Value(), { env.Null(), info }); + } + } else { + Callback().Call(Receiver().Value(), { Napi::Error::New(env, sharp::TrimEnd(baton->err)).Value() }); + } + + // Delete baton + delete baton->input; + delete baton->boolean; + for (Composite *composite : baton->composite) { + delete composite->input; + delete composite; + } + for (sharp::InputDescriptor *input : baton->joinChannelIn) { + delete input; + } + for (sharp::InputDescriptor *input : baton->join) { + delete input; + } + delete baton; + + // Decrement processing task counter + sharp::counterProcess--; + Napi::Number queueLength = Napi::Number::New(env, static_cast(sharp::counterQueue)); + queueListener.Call(Receiver().Value(), { queueLength }); + } + + private: + PipelineBaton *baton; + Napi::FunctionReference debuglog; + Napi::FunctionReference queueListener; + + void MultiPageUnsupported(int const pages, std::string op) { + if (pages > 1) { + throw vips::VError(op + " is not supported for multi-page images"); + } + } + + /* + Calculate the angle of rotation and need-to-flip for the given Exif orientation + By default, returns zero, i.e. no rotation. + */ + std::tuple + CalculateExifRotationAndFlop(int const exifOrientation) { + VipsAngle rotate = VIPS_ANGLE_D0; + bool flop = false; + switch (exifOrientation) { + case 6: rotate = VIPS_ANGLE_D90; break; + case 3: rotate = VIPS_ANGLE_D180; break; + case 8: rotate = VIPS_ANGLE_D270; break; + case 2: flop = true; break; + case 7: flop = true; rotate = VIPS_ANGLE_D270; break; + case 4: flop = true; rotate = VIPS_ANGLE_D180; break; + case 5: flop = true; rotate = VIPS_ANGLE_D90; break; + } + return std::make_tuple(rotate, flop); + } + + /* + Calculate the rotation for the given angle. + Supports any positive or negative angle that is a multiple of 90. + */ + VipsAngle + CalculateAngleRotation(int angle) { + angle = angle % 360; + if (angle < 0) + angle = 360 + angle; + switch (angle) { + case 90: return VIPS_ANGLE_D90; + case 180: return VIPS_ANGLE_D180; + case 270: return VIPS_ANGLE_D270; + } + return VIPS_ANGLE_D0; + } + + /* + Assemble the suffix argument to dzsave, which is the format (by extname) + alongside comma-separated arguments to the corresponding `formatsave` vips + action. + */ + std::string + AssembleSuffixString(std::string extname, std::vector> options) { + std::string argument; + for (const auto& [key, value] : options) { + if (!argument.empty()) { + argument += ","; + } + argument += key + "=" + value; + } + return extname + "[" + argument + "]"; + } + + /* + Build VOption for dzsave + */ + vips::VOption* + BuildOptionsDZ(PipelineBaton *baton) { + // Forward format options through suffix + std::string suffix; + if (baton->tileFormat == "png") { + std::vector> options { + {"interlace", baton->pngProgressive ? "true" : "false"}, + {"compression", std::to_string(baton->pngCompressionLevel)}, + {"filter", baton->pngAdaptiveFiltering ? "all" : "none"} + }; + suffix = AssembleSuffixString(".png", options); + } else if (baton->tileFormat == "webp") { + std::vector> options { + {"Q", std::to_string(baton->webpQuality)}, + {"alpha_q", std::to_string(baton->webpAlphaQuality)}, + {"lossless", baton->webpLossless ? "true" : "false"}, + {"near_lossless", baton->webpNearLossless ? "true" : "false"}, + {"smart_subsample", baton->webpSmartSubsample ? "true" : "false"}, + {"smart_deblock", baton->webpSmartDeblock ? "true" : "false"}, + {"preset", vips_enum_nick(VIPS_TYPE_FOREIGN_WEBP_PRESET, baton->webpPreset)}, + {"min_size", baton->webpMinSize ? "true" : "false"}, + {"mixed", baton->webpMixed ? "true" : "false"}, + {"effort", std::to_string(baton->webpEffort)} + }; + suffix = AssembleSuffixString(".webp", options); + } else { + std::vector> options { + {"Q", std::to_string(baton->jpegQuality)}, + {"interlace", baton->jpegProgressive ? "true" : "false"}, + {"subsample_mode", baton->jpegChromaSubsampling == "4:4:4" ? "off" : "on"}, + {"trellis_quant", baton->jpegTrellisQuantisation ? "true" : "false"}, + {"quant_table", std::to_string(baton->jpegQuantisationTable)}, + {"overshoot_deringing", baton->jpegOvershootDeringing ? "true": "false"}, + {"optimize_scans", baton->jpegOptimiseScans ? "true": "false"}, + {"optimize_coding", baton->jpegOptimiseCoding ? "true": "false"} + }; + std::string extname = baton->tileLayout == VIPS_FOREIGN_DZ_LAYOUT_DZ ? ".jpeg" : ".jpg"; + suffix = AssembleSuffixString(extname, options); + } + vips::VOption *options = VImage::option() + ->set("keep", baton->keepMetadata) + ->set("tile_size", baton->tileSize) + ->set("overlap", baton->tileOverlap) + ->set("container", baton->tileContainer) + ->set("layout", baton->tileLayout) + ->set("suffix", const_cast(suffix.data())) + ->set("angle", CalculateAngleRotation(baton->tileAngle)) + ->set("background", baton->tileBackground) + ->set("centre", baton->tileCentre) + ->set("id", const_cast(baton->tileId.data())) + ->set("skip_blanks", baton->tileSkipBlanks); + if (baton->tileDepth < VIPS_FOREIGN_DZ_DEPTH_LAST) { + options->set("depth", baton->tileDepth); + } + if (!baton->tileBasename.empty()) { + options->set("basename", const_cast(baton->tileBasename.data())); + } + return options; + } + + /* + Clear all thread-local data. + */ + void Error() { + // Clean up libvips' per-request data and threads + vips_error_clear(); + vips_thread_shutdown(); + } +}; + +/* + pipeline(options, output, callback) +*/ +Napi::Value pipeline(const Napi::CallbackInfo& info) { + // V8 objects are converted to non-V8 types held in the baton struct + PipelineBaton *baton = new PipelineBaton; + Napi::Object options = info[size_t(0)].As(); + + // Input + baton->input = sharp::CreateInputDescriptor(options.Get("input").As()); + // Join images together + if (sharp::HasAttr(options, "join")) { + Napi::Array join = options.Get("join").As(); + for (unsigned int i = 0; i < join.Length(); i++) { + baton->join.push_back( + sharp::CreateInputDescriptor(join.Get(i).As())); + } + } + // Extract image options + baton->topOffsetPre = sharp::AttrAsInt32(options, "topOffsetPre"); + baton->leftOffsetPre = sharp::AttrAsInt32(options, "leftOffsetPre"); + baton->widthPre = sharp::AttrAsInt32(options, "widthPre"); + baton->heightPre = sharp::AttrAsInt32(options, "heightPre"); + baton->topOffsetPost = sharp::AttrAsInt32(options, "topOffsetPost"); + baton->leftOffsetPost = sharp::AttrAsInt32(options, "leftOffsetPost"); + baton->widthPost = sharp::AttrAsInt32(options, "widthPost"); + baton->heightPost = sharp::AttrAsInt32(options, "heightPost"); + // Output image dimensions + baton->width = sharp::AttrAsInt32(options, "width"); + baton->height = sharp::AttrAsInt32(options, "height"); + // Canvas option + std::string canvas = sharp::AttrAsStr(options, "canvas"); + if (canvas == "crop") { + baton->canvas = sharp::Canvas::CROP; + } else if (canvas == "embed") { + baton->canvas = sharp::Canvas::EMBED; + } else if (canvas == "max") { + baton->canvas = sharp::Canvas::MAX; + } else if (canvas == "min") { + baton->canvas = sharp::Canvas::MIN; + } else if (canvas == "ignore_aspect") { + baton->canvas = sharp::Canvas::IGNORE_ASPECT; + } + // Composite + Napi::Array compositeArray = options.Get("composite").As(); + for (unsigned int i = 0; i < compositeArray.Length(); i++) { + Napi::Object compositeObject = compositeArray.Get(i).As(); + Composite *composite = new Composite; + composite->input = sharp::CreateInputDescriptor(compositeObject.Get("input").As()); + composite->mode = sharp::AttrAsEnum(compositeObject, "blend", VIPS_TYPE_BLEND_MODE); + composite->gravity = sharp::AttrAsUint32(compositeObject, "gravity"); + composite->left = sharp::AttrAsInt32(compositeObject, "left"); + composite->top = sharp::AttrAsInt32(compositeObject, "top"); + composite->hasOffset = sharp::AttrAsBool(compositeObject, "hasOffset"); + composite->tile = sharp::AttrAsBool(compositeObject, "tile"); + composite->premultiplied = sharp::AttrAsBool(compositeObject, "premultiplied"); + baton->composite.push_back(composite); + } + // Resize options + baton->withoutEnlargement = sharp::AttrAsBool(options, "withoutEnlargement"); + baton->withoutReduction = sharp::AttrAsBool(options, "withoutReduction"); + baton->position = sharp::AttrAsInt32(options, "position"); + baton->resizeBackground = sharp::AttrAsVectorOfDouble(options, "resizeBackground"); + baton->kernel = sharp::AttrAsEnum(options, "kernel", VIPS_TYPE_KERNEL); + baton->fastShrinkOnLoad = sharp::AttrAsBool(options, "fastShrinkOnLoad"); + // Join Channel Options + if (options.Has("joinChannelIn")) { + Napi::Array joinChannelArray = options.Get("joinChannelIn").As(); + for (unsigned int i = 0; i < joinChannelArray.Length(); i++) { + baton->joinChannelIn.push_back( + sharp::CreateInputDescriptor(joinChannelArray.Get(i).As())); + } + } + // Operators + baton->flatten = sharp::AttrAsBool(options, "flatten"); + baton->flattenBackground = sharp::AttrAsVectorOfDouble(options, "flattenBackground"); + baton->unflatten = sharp::AttrAsBool(options, "unflatten"); + baton->negate = sharp::AttrAsBool(options, "negate"); + baton->negateAlpha = sharp::AttrAsBool(options, "negateAlpha"); + baton->blurSigma = sharp::AttrAsDouble(options, "blurSigma"); + baton->precision = sharp::AttrAsEnum(options, "precision", VIPS_TYPE_PRECISION); + baton->minAmpl = sharp::AttrAsDouble(options, "minAmpl"); + baton->brightness = sharp::AttrAsDouble(options, "brightness"); + baton->saturation = sharp::AttrAsDouble(options, "saturation"); + baton->hue = sharp::AttrAsInt32(options, "hue"); + baton->lightness = sharp::AttrAsDouble(options, "lightness"); + baton->medianSize = sharp::AttrAsUint32(options, "medianSize"); + baton->sharpenSigma = sharp::AttrAsDouble(options, "sharpenSigma"); + baton->sharpenM1 = sharp::AttrAsDouble(options, "sharpenM1"); + baton->sharpenM2 = sharp::AttrAsDouble(options, "sharpenM2"); + baton->sharpenX1 = sharp::AttrAsDouble(options, "sharpenX1"); + baton->sharpenY2 = sharp::AttrAsDouble(options, "sharpenY2"); + baton->sharpenY3 = sharp::AttrAsDouble(options, "sharpenY3"); + baton->threshold = sharp::AttrAsInt32(options, "threshold"); + baton->thresholdGrayscale = sharp::AttrAsBool(options, "thresholdGrayscale"); + baton->trimBackground = sharp::AttrAsVectorOfDouble(options, "trimBackground"); + baton->trimThreshold = sharp::AttrAsDouble(options, "trimThreshold"); + baton->trimLineArt = sharp::AttrAsBool(options, "trimLineArt"); + baton->gamma = sharp::AttrAsDouble(options, "gamma"); + baton->gammaOut = sharp::AttrAsDouble(options, "gammaOut"); + baton->linearA = sharp::AttrAsVectorOfDouble(options, "linearA"); + baton->linearB = sharp::AttrAsVectorOfDouble(options, "linearB"); + baton->dilateWidth = sharp::AttrAsUint32(options, "dilateWidth"); + baton->erodeWidth = sharp::AttrAsUint32(options, "erodeWidth"); + baton->greyscale = sharp::AttrAsBool(options, "greyscale"); + baton->normalise = sharp::AttrAsBool(options, "normalise"); + baton->normaliseLower = sharp::AttrAsUint32(options, "normaliseLower"); + baton->normaliseUpper = sharp::AttrAsUint32(options, "normaliseUpper"); + baton->tint = sharp::AttrAsVectorOfDouble(options, "tint"); + baton->claheWidth = sharp::AttrAsUint32(options, "claheWidth"); + baton->claheHeight = sharp::AttrAsUint32(options, "claheHeight"); + baton->claheMaxSlope = sharp::AttrAsUint32(options, "claheMaxSlope"); + baton->angle = sharp::AttrAsInt32(options, "angle"); + baton->rotationAngle = sharp::AttrAsDouble(options, "rotationAngle"); + baton->rotationBackground = sharp::AttrAsVectorOfDouble(options, "rotationBackground"); + baton->rotateBefore = sharp::AttrAsBool(options, "rotateBefore"); + baton->orientBefore = sharp::AttrAsBool(options, "orientBefore"); + baton->flip = sharp::AttrAsBool(options, "flip"); + baton->flop = sharp::AttrAsBool(options, "flop"); + baton->extendTop = sharp::AttrAsInt32(options, "extendTop"); + baton->extendBottom = sharp::AttrAsInt32(options, "extendBottom"); + baton->extendLeft = sharp::AttrAsInt32(options, "extendLeft"); + baton->extendRight = sharp::AttrAsInt32(options, "extendRight"); + baton->extendBackground = sharp::AttrAsVectorOfDouble(options, "extendBackground"); + baton->extendWith = sharp::AttrAsEnum(options, "extendWith", VIPS_TYPE_EXTEND); + baton->extractChannel = sharp::AttrAsInt32(options, "extractChannel"); + baton->affineMatrix = sharp::AttrAsVectorOfDouble(options, "affineMatrix"); + baton->affineBackground = sharp::AttrAsVectorOfDouble(options, "affineBackground"); + baton->affineIdx = sharp::AttrAsDouble(options, "affineIdx"); + baton->affineIdy = sharp::AttrAsDouble(options, "affineIdy"); + baton->affineOdx = sharp::AttrAsDouble(options, "affineOdx"); + baton->affineOdy = sharp::AttrAsDouble(options, "affineOdy"); + baton->affineInterpolator = sharp::AttrAsStr(options, "affineInterpolator"); + baton->removeAlpha = sharp::AttrAsBool(options, "removeAlpha"); + baton->ensureAlpha = sharp::AttrAsDouble(options, "ensureAlpha"); + if (options.Has("boolean")) { + baton->boolean = sharp::CreateInputDescriptor(options.Get("boolean").As()); + baton->booleanOp = sharp::AttrAsEnum(options, "booleanOp", VIPS_TYPE_OPERATION_BOOLEAN); + } + if (options.Has("bandBoolOp")) { + baton->bandBoolOp = sharp::AttrAsEnum(options, "bandBoolOp", VIPS_TYPE_OPERATION_BOOLEAN); + } + if (options.Has("convKernel")) { + Napi::Object kernel = options.Get("convKernel").As(); + baton->convKernelWidth = sharp::AttrAsUint32(kernel, "width"); + baton->convKernelHeight = sharp::AttrAsUint32(kernel, "height"); + baton->convKernelScale = sharp::AttrAsDouble(kernel, "scale"); + baton->convKernelOffset = sharp::AttrAsDouble(kernel, "offset"); + size_t const kernelSize = static_cast(baton->convKernelWidth * baton->convKernelHeight); + baton->convKernel.resize(kernelSize); + Napi::Array kdata = kernel.Get("kernel").As(); + for (unsigned int i = 0; i < kernelSize; i++) { + baton->convKernel[i] = sharp::AttrAsDouble(kdata, i); + } + } + if (options.Has("recombMatrix")) { + Napi::Array recombMatrix = options.Get("recombMatrix").As(); + unsigned int matrixElements = recombMatrix.Length(); + baton->recombMatrix.resize(matrixElements); + for (unsigned int i = 0; i < matrixElements; i++) { + baton->recombMatrix[i] = sharp::AttrAsDouble(recombMatrix, i); + } + } + baton->colourspacePipeline = sharp::AttrAsEnum( + options, "colourspacePipeline", VIPS_TYPE_INTERPRETATION); + if (baton->colourspacePipeline == VIPS_INTERPRETATION_ERROR) { + baton->colourspacePipeline = VIPS_INTERPRETATION_LAST; + } + baton->colourspace = sharp::AttrAsEnum(options, "colourspace", VIPS_TYPE_INTERPRETATION); + if (baton->colourspace == VIPS_INTERPRETATION_ERROR) { + baton->colourspace = VIPS_INTERPRETATION_sRGB; + } + // Output + baton->formatOut = sharp::AttrAsStr(options, "formatOut"); + baton->fileOut = sharp::AttrAsStr(options, "fileOut"); + baton->keepMetadata = sharp::AttrAsUint32(options, "keepMetadata"); + baton->withMetadataOrientation = sharp::AttrAsUint32(options, "withMetadataOrientation"); + baton->withMetadataDensity = sharp::AttrAsDouble(options, "withMetadataDensity"); + baton->withIccProfile = sharp::AttrAsStr(options, "withIccProfile"); + Napi::Object withExif = options.Get("withExif").As(); + Napi::Array withExifKeys = withExif.GetPropertyNames(); + for (unsigned int i = 0; i < withExifKeys.Length(); i++) { + std::string k = sharp::AttrAsStr(withExifKeys, i); + if (withExif.HasOwnProperty(k)) { + baton->withExif.insert(std::make_pair(k, sharp::AttrAsStr(withExif, k))); + } + } + baton->withExifMerge = sharp::AttrAsBool(options, "withExifMerge"); + baton->withXmp = sharp::AttrAsStr(options, "withXmp"); + baton->timeoutSeconds = sharp::AttrAsUint32(options, "timeoutSeconds"); + baton->loop = sharp::AttrAsUint32(options, "loop"); + baton->delay = sharp::AttrAsInt32Vector(options, "delay"); + // Format-specific + baton->jpegQuality = sharp::AttrAsUint32(options, "jpegQuality"); + baton->jpegProgressive = sharp::AttrAsBool(options, "jpegProgressive"); + baton->jpegChromaSubsampling = sharp::AttrAsStr(options, "jpegChromaSubsampling"); + baton->jpegTrellisQuantisation = sharp::AttrAsBool(options, "jpegTrellisQuantisation"); + baton->jpegQuantisationTable = sharp::AttrAsUint32(options, "jpegQuantisationTable"); + baton->jpegOvershootDeringing = sharp::AttrAsBool(options, "jpegOvershootDeringing"); + baton->jpegOptimiseScans = sharp::AttrAsBool(options, "jpegOptimiseScans"); + baton->jpegOptimiseCoding = sharp::AttrAsBool(options, "jpegOptimiseCoding"); + baton->pngProgressive = sharp::AttrAsBool(options, "pngProgressive"); + baton->pngCompressionLevel = sharp::AttrAsUint32(options, "pngCompressionLevel"); + baton->pngAdaptiveFiltering = sharp::AttrAsBool(options, "pngAdaptiveFiltering"); + baton->pngPalette = sharp::AttrAsBool(options, "pngPalette"); + baton->pngQuality = sharp::AttrAsUint32(options, "pngQuality"); + baton->pngEffort = sharp::AttrAsUint32(options, "pngEffort"); + baton->pngBitdepth = sharp::AttrAsUint32(options, "pngBitdepth"); + baton->pngDither = sharp::AttrAsDouble(options, "pngDither"); + baton->jp2Quality = sharp::AttrAsUint32(options, "jp2Quality"); + baton->jp2Lossless = sharp::AttrAsBool(options, "jp2Lossless"); + baton->jp2TileHeight = sharp::AttrAsUint32(options, "jp2TileHeight"); + baton->jp2TileWidth = sharp::AttrAsUint32(options, "jp2TileWidth"); + baton->jp2ChromaSubsampling = sharp::AttrAsStr(options, "jp2ChromaSubsampling"); + baton->webpQuality = sharp::AttrAsUint32(options, "webpQuality"); + baton->webpAlphaQuality = sharp::AttrAsUint32(options, "webpAlphaQuality"); + baton->webpLossless = sharp::AttrAsBool(options, "webpLossless"); + baton->webpNearLossless = sharp::AttrAsBool(options, "webpNearLossless"); + baton->webpSmartSubsample = sharp::AttrAsBool(options, "webpSmartSubsample"); + baton->webpSmartDeblock = sharp::AttrAsBool(options, "webpSmartDeblock"); + baton->webpPreset = sharp::AttrAsEnum(options, "webpPreset", VIPS_TYPE_FOREIGN_WEBP_PRESET); + baton->webpEffort = sharp::AttrAsUint32(options, "webpEffort"); + baton->webpMinSize = sharp::AttrAsBool(options, "webpMinSize"); + baton->webpMixed = sharp::AttrAsBool(options, "webpMixed"); + baton->gifBitdepth = sharp::AttrAsUint32(options, "gifBitdepth"); + baton->gifEffort = sharp::AttrAsUint32(options, "gifEffort"); + baton->gifDither = sharp::AttrAsDouble(options, "gifDither"); + baton->gifInterFrameMaxError = sharp::AttrAsDouble(options, "gifInterFrameMaxError"); + baton->gifInterPaletteMaxError = sharp::AttrAsDouble(options, "gifInterPaletteMaxError"); + baton->gifKeepDuplicateFrames = sharp::AttrAsBool(options, "gifKeepDuplicateFrames"); + baton->gifReuse = sharp::AttrAsBool(options, "gifReuse"); + baton->gifProgressive = sharp::AttrAsBool(options, "gifProgressive"); + baton->tiffQuality = sharp::AttrAsUint32(options, "tiffQuality"); + baton->tiffBigtiff = sharp::AttrAsBool(options, "tiffBigtiff"); + baton->tiffPyramid = sharp::AttrAsBool(options, "tiffPyramid"); + baton->tiffMiniswhite = sharp::AttrAsBool(options, "tiffMiniswhite"); + baton->tiffBitdepth = sharp::AttrAsUint32(options, "tiffBitdepth"); + baton->tiffTile = sharp::AttrAsBool(options, "tiffTile"); + baton->tiffTileWidth = sharp::AttrAsUint32(options, "tiffTileWidth"); + baton->tiffTileHeight = sharp::AttrAsUint32(options, "tiffTileHeight"); + baton->tiffXres = sharp::AttrAsDouble(options, "tiffXres"); + baton->tiffYres = sharp::AttrAsDouble(options, "tiffYres"); + if (baton->tiffXres == 1.0 && baton->tiffYres == 1.0 && baton->withMetadataDensity > 0) { + baton->tiffXres = baton->tiffYres = baton->withMetadataDensity / 25.4; + } + baton->tiffCompression = sharp::AttrAsEnum( + options, "tiffCompression", VIPS_TYPE_FOREIGN_TIFF_COMPRESSION); + baton->tiffPredictor = sharp::AttrAsEnum( + options, "tiffPredictor", VIPS_TYPE_FOREIGN_TIFF_PREDICTOR); + baton->tiffResolutionUnit = sharp::AttrAsEnum( + options, "tiffResolutionUnit", VIPS_TYPE_FOREIGN_TIFF_RESUNIT); + baton->heifQuality = sharp::AttrAsUint32(options, "heifQuality"); + baton->heifLossless = sharp::AttrAsBool(options, "heifLossless"); + baton->heifCompression = sharp::AttrAsEnum( + options, "heifCompression", VIPS_TYPE_FOREIGN_HEIF_COMPRESSION); + baton->heifEffort = sharp::AttrAsUint32(options, "heifEffort"); + baton->heifChromaSubsampling = sharp::AttrAsStr(options, "heifChromaSubsampling"); + baton->heifBitdepth = sharp::AttrAsUint32(options, "heifBitdepth"); + baton->jxlDistance = sharp::AttrAsDouble(options, "jxlDistance"); + baton->jxlDecodingTier = sharp::AttrAsUint32(options, "jxlDecodingTier"); + baton->jxlEffort = sharp::AttrAsUint32(options, "jxlEffort"); + baton->jxlLossless = sharp::AttrAsBool(options, "jxlLossless"); + baton->rawDepth = sharp::AttrAsEnum(options, "rawDepth", VIPS_TYPE_BAND_FORMAT); + baton->tileSize = sharp::AttrAsUint32(options, "tileSize"); + baton->tileOverlap = sharp::AttrAsUint32(options, "tileOverlap"); + baton->tileAngle = sharp::AttrAsInt32(options, "tileAngle"); + baton->tileBackground = sharp::AttrAsVectorOfDouble(options, "tileBackground"); + baton->tileSkipBlanks = sharp::AttrAsInt32(options, "tileSkipBlanks"); + baton->tileContainer = sharp::AttrAsEnum( + options, "tileContainer", VIPS_TYPE_FOREIGN_DZ_CONTAINER); + baton->tileLayout = sharp::AttrAsEnum(options, "tileLayout", VIPS_TYPE_FOREIGN_DZ_LAYOUT); + baton->tileFormat = sharp::AttrAsStr(options, "tileFormat"); + baton->tileDepth = sharp::AttrAsEnum(options, "tileDepth", VIPS_TYPE_FOREIGN_DZ_DEPTH); + baton->tileCentre = sharp::AttrAsBool(options, "tileCentre"); + baton->tileId = sharp::AttrAsStr(options, "tileId"); + baton->tileBasename = sharp::AttrAsStr(options, "tileBasename"); + + // Function to notify of libvips warnings + Napi::Function debuglog = options.Get("debuglog").As(); + + // Function to notify of queue length changes + Napi::Function queueListener = options.Get("queueListener").As(); + + // Join queue for worker thread + Napi::Function callback = info[size_t(1)].As(); + PipelineWorker *worker = new PipelineWorker(callback, baton, debuglog, queueListener); + worker->Receiver().Set("options", options); + worker->Queue(); + + // Increment queued task counter + Napi::Number queueLength = Napi::Number::New(info.Env(), static_cast(++sharp::counterQueue)); + queueListener.Call(info.This(), { queueLength }); + + return info.Env().Undefined(); +} diff --git a/node_modules/sharp/src/pipeline.h b/node_modules/sharp/src/pipeline.h new file mode 100644 index 0000000..ff94659 --- /dev/null +++ b/node_modules/sharp/src/pipeline.h @@ -0,0 +1,408 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef SRC_PIPELINE_H_ +#define SRC_PIPELINE_H_ + +#include +#include +#include +#include + +#include +#include + +#include "./common.h" + +Napi::Value pipeline(const Napi::CallbackInfo& info); + +struct Composite { + sharp::InputDescriptor *input; + VipsBlendMode mode; + int gravity; + int left; + int top; + bool hasOffset; + bool tile; + bool premultiplied; + + Composite(): + input(nullptr), + mode(VIPS_BLEND_MODE_OVER), + gravity(0), + left(0), + top(0), + hasOffset(false), + tile(false), + premultiplied(false) {} +}; + +struct PipelineBaton { + sharp::InputDescriptor *input; + std::vector join; + std::string formatOut; + std::string fileOut; + void *bufferOut; + size_t bufferOutLength; + int pageHeightOut; + int pagesOut; + std::vector composite; + std::vector joinChannelIn; + int topOffsetPre; + int leftOffsetPre; + int widthPre; + int heightPre; + int topOffsetPost; + int leftOffsetPost; + int widthPost; + int heightPost; + int width; + int height; + int channels; + VipsKernel kernel; + sharp::Canvas canvas; + int position; + std::vector resizeBackground; + bool hasCropOffset; + int cropOffsetLeft; + int cropOffsetTop; + bool hasAttentionCenter; + int attentionX; + int attentionY; + bool premultiplied; + bool tileCentre; + bool fastShrinkOnLoad; + std::vector tint; + bool flatten; + std::vector flattenBackground; + bool unflatten; + bool negate; + bool negateAlpha; + double blurSigma; + VipsPrecision precision; + double minAmpl; + double brightness; + double saturation; + int hue; + double lightness; + int medianSize; + double sharpenSigma; + double sharpenM1; + double sharpenM2; + double sharpenX1; + double sharpenY2; + double sharpenY3; + int threshold; + bool thresholdGrayscale; + std::vector trimBackground; + double trimThreshold; + bool trimLineArt; + int trimOffsetLeft; + int trimOffsetTop; + std::vector linearA; + std::vector linearB; + int dilateWidth; + int erodeWidth; + double gamma; + double gammaOut; + bool greyscale; + bool normalise; + int normaliseLower; + int normaliseUpper; + int claheWidth; + int claheHeight; + int claheMaxSlope; + int angle; + double rotationAngle; + std::vector rotationBackground; + bool rotateBefore; + bool orientBefore; + bool flip; + bool flop; + int extendTop; + int extendBottom; + int extendLeft; + int extendRight; + std::vector extendBackground; + VipsExtend extendWith; + bool withoutEnlargement; + bool withoutReduction; + std::vector affineMatrix; + std::vector affineBackground; + double affineIdx; + double affineIdy; + double affineOdx; + double affineOdy; + std::string affineInterpolator; + int jpegQuality; + bool jpegProgressive; + std::string jpegChromaSubsampling; + bool jpegTrellisQuantisation; + int jpegQuantisationTable; + bool jpegOvershootDeringing; + bool jpegOptimiseScans; + bool jpegOptimiseCoding; + bool pngProgressive; + int pngCompressionLevel; + bool pngAdaptiveFiltering; + bool pngPalette; + int pngQuality; + int pngEffort; + int pngBitdepth; + double pngDither; + int jp2Quality; + bool jp2Lossless; + int jp2TileHeight; + int jp2TileWidth; + std::string jp2ChromaSubsampling; + int webpQuality; + int webpAlphaQuality; + bool webpNearLossless; + bool webpLossless; + bool webpSmartSubsample; + bool webpSmartDeblock; + VipsForeignWebpPreset webpPreset; + int webpEffort; + bool webpMinSize; + bool webpMixed; + int gifBitdepth; + int gifEffort; + double gifDither; + double gifInterFrameMaxError; + double gifInterPaletteMaxError; + bool gifKeepDuplicateFrames; + bool gifReuse; + bool gifProgressive; + int tiffQuality; + VipsForeignTiffCompression tiffCompression; + bool tiffBigtiff; + VipsForeignTiffPredictor tiffPredictor; + bool tiffPyramid; + int tiffBitdepth; + bool tiffMiniswhite; + bool tiffTile; + int tiffTileHeight; + int tiffTileWidth; + double tiffXres; + double tiffYres; + VipsForeignTiffResunit tiffResolutionUnit; + int heifQuality; + VipsForeignHeifCompression heifCompression; + int heifEffort; + std::string heifChromaSubsampling; + bool heifLossless; + int heifBitdepth; + double jxlDistance; + int jxlDecodingTier; + int jxlEffort; + bool jxlLossless; + VipsBandFormat rawDepth; + std::string err; + bool errUseWarning; + int keepMetadata; + int withMetadataOrientation; + double withMetadataDensity; + std::string withIccProfile; + std::unordered_map withExif; + bool withExifMerge; + std::string withXmp; + int timeoutSeconds; + std::vector convKernel; + int convKernelWidth; + int convKernelHeight; + double convKernelScale; + double convKernelOffset; + sharp::InputDescriptor *boolean; + VipsOperationBoolean booleanOp; + VipsOperationBoolean bandBoolOp; + int extractChannel; + bool removeAlpha; + double ensureAlpha; + VipsInterpretation colourspacePipeline; + VipsInterpretation colourspace; + std::vector delay; + int loop; + int tileSize; + int tileOverlap; + VipsForeignDzContainer tileContainer; + VipsForeignDzLayout tileLayout; + std::string tileFormat; + int tileAngle; + std::vector tileBackground; + int tileSkipBlanks; + VipsForeignDzDepth tileDepth; + std::string tileId; + std::string tileBasename; + std::vector recombMatrix; + + PipelineBaton(): + input(nullptr), + bufferOutLength(0), + pageHeightOut(0), + pagesOut(0), + topOffsetPre(-1), + topOffsetPost(-1), + channels(0), + kernel(VIPS_KERNEL_LANCZOS3), + canvas(sharp::Canvas::CROP), + position(0), + resizeBackground{ 0.0, 0.0, 0.0, 255.0 }, + hasCropOffset(false), + cropOffsetLeft(0), + cropOffsetTop(0), + hasAttentionCenter(false), + attentionX(0), + attentionY(0), + premultiplied(false), + tint{ -1.0, 0.0, 0.0, 0.0 }, + flatten(false), + flattenBackground{ 0.0, 0.0, 0.0 }, + unflatten(false), + negate(false), + negateAlpha(true), + blurSigma(0.0), + brightness(1.0), + saturation(1.0), + hue(0), + lightness(0), + medianSize(0), + sharpenSigma(0.0), + sharpenM1(1.0), + sharpenM2(2.0), + sharpenX1(2.0), + sharpenY2(10.0), + sharpenY3(20.0), + threshold(0), + thresholdGrayscale(true), + trimBackground{}, + trimThreshold(-1.0), + trimLineArt(false), + trimOffsetLeft(0), + trimOffsetTop(0), + linearA{}, + linearB{}, + dilateWidth(0), + erodeWidth(0), + gamma(0.0), + greyscale(false), + normalise(false), + normaliseLower(1), + normaliseUpper(99), + claheWidth(0), + claheHeight(0), + claheMaxSlope(3), + angle(0), + rotationAngle(0.0), + rotationBackground{ 0.0, 0.0, 0.0, 255.0 }, + flip(false), + flop(false), + extendTop(0), + extendBottom(0), + extendLeft(0), + extendRight(0), + extendBackground{ 0.0, 0.0, 0.0, 255.0 }, + extendWith(VIPS_EXTEND_BACKGROUND), + withoutEnlargement(false), + withoutReduction(false), + affineMatrix{ 1.0, 0.0, 0.0, 1.0 }, + affineBackground{ 0.0, 0.0, 0.0, 255.0 }, + affineIdx(0), + affineIdy(0), + affineOdx(0), + affineOdy(0), + affineInterpolator("bicubic"), + jpegQuality(80), + jpegProgressive(false), + jpegChromaSubsampling("4:2:0"), + jpegTrellisQuantisation(false), + jpegQuantisationTable(0), + jpegOvershootDeringing(false), + jpegOptimiseScans(false), + jpegOptimiseCoding(true), + pngProgressive(false), + pngCompressionLevel(6), + pngAdaptiveFiltering(false), + pngPalette(false), + pngQuality(100), + pngEffort(7), + pngBitdepth(8), + pngDither(1.0), + jp2Quality(80), + jp2Lossless(false), + jp2TileHeight(512), + jp2TileWidth(512), + jp2ChromaSubsampling("4:4:4"), + webpQuality(80), + webpAlphaQuality(100), + webpNearLossless(false), + webpLossless(false), + webpSmartSubsample(false), + webpSmartDeblock(false), + webpPreset(VIPS_FOREIGN_WEBP_PRESET_DEFAULT), + webpEffort(4), + webpMinSize(false), + webpMixed(false), + gifBitdepth(8), + gifEffort(7), + gifDither(1.0), + gifInterFrameMaxError(0.0), + gifInterPaletteMaxError(3.0), + gifKeepDuplicateFrames(false), + gifReuse(true), + gifProgressive(false), + tiffQuality(80), + tiffCompression(VIPS_FOREIGN_TIFF_COMPRESSION_JPEG), + tiffBigtiff(false), + tiffPredictor(VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL), + tiffPyramid(false), + tiffBitdepth(8), + tiffMiniswhite(false), + tiffTile(false), + tiffTileHeight(256), + tiffTileWidth(256), + tiffXres(1.0), + tiffYres(1.0), + tiffResolutionUnit(VIPS_FOREIGN_TIFF_RESUNIT_INCH), + heifQuality(50), + heifCompression(VIPS_FOREIGN_HEIF_COMPRESSION_AV1), + heifEffort(4), + heifChromaSubsampling("4:4:4"), + heifLossless(false), + heifBitdepth(8), + jxlDistance(1.0), + jxlDecodingTier(0), + jxlEffort(7), + jxlLossless(false), + rawDepth(VIPS_FORMAT_UCHAR), + errUseWarning(false), + keepMetadata(0), + withMetadataOrientation(-1), + withMetadataDensity(0.0), + withExifMerge(true), + timeoutSeconds(0), + convKernelWidth(0), + convKernelHeight(0), + convKernelScale(0.0), + convKernelOffset(0.0), + boolean(nullptr), + booleanOp(VIPS_OPERATION_BOOLEAN_LAST), + bandBoolOp(VIPS_OPERATION_BOOLEAN_LAST), + extractChannel(-1), + removeAlpha(false), + ensureAlpha(-1.0), + colourspacePipeline(VIPS_INTERPRETATION_LAST), + colourspace(VIPS_INTERPRETATION_LAST), + loop(-1), + tileSize(256), + tileOverlap(0), + tileContainer(VIPS_FOREIGN_DZ_CONTAINER_FS), + tileLayout(VIPS_FOREIGN_DZ_LAYOUT_DZ), + tileAngle(0), + tileBackground{ 255.0, 255.0, 255.0, 255.0 }, + tileSkipBlanks(-1), + tileDepth(VIPS_FOREIGN_DZ_DEPTH_LAST) {} +}; + +#endif // SRC_PIPELINE_H_ diff --git a/node_modules/sharp/src/sharp.cc b/node_modules/sharp/src/sharp.cc new file mode 100644 index 0000000..7678975 --- /dev/null +++ b/node_modules/sharp/src/sharp.cc @@ -0,0 +1,43 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#include + +#include +#include + +#include "./common.h" +#include "./metadata.h" +#include "./pipeline.h" +#include "./stats.h" +#include "./utilities.h" + +Napi::Object init(Napi::Env env, Napi::Object exports) { + static std::once_flag sharp_vips_init_once; + std::call_once(sharp_vips_init_once, []() { + vips_init("sharp"); + }); + + g_log_set_handler("VIPS", static_cast(G_LOG_LEVEL_WARNING), + static_cast(sharp::VipsWarningCallback), nullptr); + + // Methods available to JavaScript + exports.Set("metadata", Napi::Function::New(env, metadata)); + exports.Set("pipeline", Napi::Function::New(env, pipeline)); + exports.Set("cache", Napi::Function::New(env, cache)); + exports.Set("concurrency", Napi::Function::New(env, concurrency)); + exports.Set("counters", Napi::Function::New(env, counters)); + exports.Set("simd", Napi::Function::New(env, simd)); + exports.Set("libvipsVersion", Napi::Function::New(env, libvipsVersion)); + exports.Set("format", Napi::Function::New(env, format)); + exports.Set("block", Napi::Function::New(env, block)); + exports.Set("_maxColourDistance", Napi::Function::New(env, _maxColourDistance)); + exports.Set("_isUsingJemalloc", Napi::Function::New(env, _isUsingJemalloc)); + exports.Set("_isUsingX64V2", Napi::Function::New(env, _isUsingX64V2)); + exports.Set("stats", Napi::Function::New(env, stats)); + return exports; +} + +NODE_API_MODULE(sharp, init) diff --git a/node_modules/sharp/src/stats.cc b/node_modules/sharp/src/stats.cc new file mode 100644 index 0000000..b1fd27a --- /dev/null +++ b/node_modules/sharp/src/stats.cc @@ -0,0 +1,186 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#include +#include +#include +#include + +#include +#include + +#include "./common.h" +#include "./stats.h" + +class StatsWorker : public Napi::AsyncWorker { + public: + StatsWorker(Napi::Function callback, StatsBaton *baton, Napi::Function debuglog) : + Napi::AsyncWorker(callback), baton(baton), debuglog(Napi::Persistent(debuglog)) {} + ~StatsWorker() {} + + const int STAT_MIN_INDEX = 0; + const int STAT_MAX_INDEX = 1; + const int STAT_SUM_INDEX = 2; + const int STAT_SQ_SUM_INDEX = 3; + const int STAT_MEAN_INDEX = 4; + const int STAT_STDEV_INDEX = 5; + const int STAT_MINX_INDEX = 6; + const int STAT_MINY_INDEX = 7; + const int STAT_MAXX_INDEX = 8; + const int STAT_MAXY_INDEX = 9; + + void Execute() { + // Decrement queued task counter + sharp::counterQueue--; + + vips::VImage image; + sharp::ImageType imageType = sharp::ImageType::UNKNOWN; + try { + std::tie(image, imageType) = OpenInput(baton->input); + } catch (vips::VError const &err) { + (baton->err).append(err.what()); + } + if (imageType != sharp::ImageType::UNKNOWN) { + try { + vips::VImage stats = image.stats(); + int const bands = image.bands(); + for (int b = 1; b <= bands; b++) { + ChannelStats cStats( + static_cast(stats.getpoint(STAT_MIN_INDEX, b).front()), + static_cast(stats.getpoint(STAT_MAX_INDEX, b).front()), + stats.getpoint(STAT_SUM_INDEX, b).front(), + stats.getpoint(STAT_SQ_SUM_INDEX, b).front(), + stats.getpoint(STAT_MEAN_INDEX, b).front(), + stats.getpoint(STAT_STDEV_INDEX, b).front(), + static_cast(stats.getpoint(STAT_MINX_INDEX, b).front()), + static_cast(stats.getpoint(STAT_MINY_INDEX, b).front()), + static_cast(stats.getpoint(STAT_MAXX_INDEX, b).front()), + static_cast(stats.getpoint(STAT_MAXY_INDEX, b).front())); + baton->channelStats.push_back(cStats); + } + // Image is not opaque when alpha layer is present and contains a non-mamixa value + if (image.has_alpha()) { + double const minAlpha = static_cast(stats.getpoint(STAT_MIN_INDEX, bands).front()); + if (minAlpha != vips_interpretation_max_alpha(image.interpretation())) { + baton->isOpaque = false; + } + } + // Convert to greyscale + vips::VImage greyscale = image.colourspace(VIPS_INTERPRETATION_B_W)[0]; + // Estimate entropy via histogram of greyscale value frequency + baton->entropy = std::abs(greyscale.hist_find().hist_entropy()); + // Estimate sharpness via standard deviation of greyscale laplacian + if (image.width() > 1 || image.height() > 1) { + VImage laplacian = VImage::new_matrixv(3, 3, + 0.0, 1.0, 0.0, + 1.0, -4.0, 1.0, + 0.0, 1.0, 0.0); + laplacian.set("scale", 9.0); + baton->sharpness = greyscale.conv(laplacian).deviate(); + } + // Most dominant sRGB colour via 4096-bin 3D histogram + vips::VImage hist = sharp::RemoveAlpha(image) + .colourspace(VIPS_INTERPRETATION_sRGB) + .hist_find_ndim(VImage::option()->set("bins", 16)); + std::complex maxpos = hist.maxpos(); + int const dx = static_cast(std::real(maxpos)); + int const dy = static_cast(std::imag(maxpos)); + std::vector pel = hist(dx, dy); + int const dz = std::distance(pel.begin(), std::find(pel.begin(), pel.end(), hist.max())); + baton->dominantRed = dx * 16 + 8; + baton->dominantGreen = dy * 16 + 8; + baton->dominantBlue = dz * 16 + 8; + } catch (vips::VError const &err) { + (baton->err).append(err.what()); + } + } + + // Clean up + vips_error_clear(); + vips_thread_shutdown(); + } + + void OnOK() { + Napi::Env env = Env(); + Napi::HandleScope scope(env); + + // Handle warnings + std::string warning = sharp::VipsWarningPop(); + while (!warning.empty()) { + debuglog.Call(Receiver().Value(), { Napi::String::New(env, warning) }); + warning = sharp::VipsWarningPop(); + } + + if (baton->err.empty()) { + // Stats Object + Napi::Object info = Napi::Object::New(env); + Napi::Array channels = Napi::Array::New(env); + + std::vector::iterator it; + int i = 0; + for (it = baton->channelStats.begin(); it < baton->channelStats.end(); it++, i++) { + Napi::Object channelStat = Napi::Object::New(env); + channelStat.Set("min", it->min); + channelStat.Set("max", it->max); + channelStat.Set("sum", it->sum); + channelStat.Set("squaresSum", it->squaresSum); + channelStat.Set("mean", it->mean); + channelStat.Set("stdev", it->stdev); + channelStat.Set("minX", it->minX); + channelStat.Set("minY", it->minY); + channelStat.Set("maxX", it->maxX); + channelStat.Set("maxY", it->maxY); + channels.Set(i, channelStat); + } + + info.Set("channels", channels); + info.Set("isOpaque", baton->isOpaque); + info.Set("entropy", baton->entropy); + info.Set("sharpness", baton->sharpness); + Napi::Object dominant = Napi::Object::New(env); + dominant.Set("r", baton->dominantRed); + dominant.Set("g", baton->dominantGreen); + dominant.Set("b", baton->dominantBlue); + info.Set("dominant", dominant); + Callback().Call(Receiver().Value(), { env.Null(), info }); + } else { + Callback().Call(Receiver().Value(), { Napi::Error::New(env, sharp::TrimEnd(baton->err)).Value() }); + } + + delete baton->input; + delete baton; + } + + private: + StatsBaton* baton; + Napi::FunctionReference debuglog; +}; + +/* + stats(options, callback) +*/ +Napi::Value stats(const Napi::CallbackInfo& info) { + // V8 objects are converted to non-V8 types held in the baton struct + StatsBaton *baton = new StatsBaton; + Napi::Object options = info[size_t(0)].As(); + + // Input + baton->input = sharp::CreateInputDescriptor(options.Get("input").As()); + baton->input->access = VIPS_ACCESS_RANDOM; + + // Function to notify of libvips warnings + Napi::Function debuglog = options.Get("debuglog").As(); + + // Join queue for worker thread + Napi::Function callback = info[size_t(1)].As(); + StatsWorker *worker = new StatsWorker(callback, baton, debuglog); + worker->Receiver().Set("options", options); + worker->Queue(); + + // Increment queued task counter + sharp::counterQueue++; + + return info.Env().Undefined(); +} diff --git a/node_modules/sharp/src/stats.h b/node_modules/sharp/src/stats.h new file mode 100644 index 0000000..88e13c6 --- /dev/null +++ b/node_modules/sharp/src/stats.h @@ -0,0 +1,62 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef SRC_STATS_H_ +#define SRC_STATS_H_ + +#include +#include +#include + +#include "./common.h" + +struct ChannelStats { + // stats per channel + int min; + int max; + double sum; + double squaresSum; + double mean; + double stdev; + int minX; + int minY; + int maxX; + int maxY; + + ChannelStats(int minVal, int maxVal, double sumVal, double squaresSumVal, + double meanVal, double stdevVal, int minXVal, int minYVal, int maxXVal, int maxYVal): + min(minVal), max(maxVal), sum(sumVal), squaresSum(squaresSumVal), // NOLINT(build/include_what_you_use) + mean(meanVal), stdev(stdevVal), minX(minXVal), minY(minYVal), maxX(maxXVal), maxY(maxYVal) {} +}; + +struct StatsBaton { + // Input + sharp::InputDescriptor *input; + + // Output + std::vector channelStats; + bool isOpaque; + double entropy; + double sharpness; + int dominantRed; + int dominantGreen; + int dominantBlue; + + std::string err; + + StatsBaton(): + input(nullptr), + isOpaque(true), + entropy(0.0), + sharpness(0.0), + dominantRed(0), + dominantGreen(0), + dominantBlue(0) + {} +}; + +Napi::Value stats(const Napi::CallbackInfo& info); + +#endif // SRC_STATS_H_ diff --git a/node_modules/sharp/src/utilities.cc b/node_modules/sharp/src/utilities.cc new file mode 100644 index 0000000..4154c08 --- /dev/null +++ b/node_modules/sharp/src/utilities.cc @@ -0,0 +1,288 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#include +#include +#include + +#include +#include +#include + +#include "./common.h" +#include "./operations.h" +#include "./utilities.h" + +/* + Get and set cache limits +*/ +Napi::Value cache(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + + // Set memory limit + if (info[size_t(0)].IsNumber()) { + vips_cache_set_max_mem(info[size_t(0)].As().Int32Value() * 1048576); + } + // Set file limit + if (info[size_t(1)].IsNumber()) { + vips_cache_set_max_files(info[size_t(1)].As().Int32Value()); + } + // Set items limit + if (info[size_t(2)].IsNumber()) { + vips_cache_set_max(info[size_t(2)].As().Int32Value()); + } + + // Get memory stats + Napi::Object memory = Napi::Object::New(env); + memory.Set("current", round(vips_tracked_get_mem() / 1048576)); + memory.Set("high", round(vips_tracked_get_mem_highwater() / 1048576)); + memory.Set("max", round(vips_cache_get_max_mem() / 1048576)); + // Get file stats + Napi::Object files = Napi::Object::New(env); + files.Set("current", vips_tracked_get_files()); + files.Set("max", vips_cache_get_max_files()); + + // Get item stats + Napi::Object items = Napi::Object::New(env); + items.Set("current", vips_cache_get_size()); + items.Set("max", vips_cache_get_max()); + + Napi::Object cache = Napi::Object::New(env); + cache.Set("memory", memory); + cache.Set("files", files); + cache.Set("items", items); + return cache; +} + +/* + Get and set size of thread pool +*/ +Napi::Value concurrency(const Napi::CallbackInfo& info) { + // Set concurrency + if (info[size_t(0)].IsNumber()) { + vips_concurrency_set(info[size_t(0)].As().Int32Value()); + } + // Get concurrency + return Napi::Number::New(info.Env(), vips_concurrency_get()); +} + +/* + Get internal counters (queued tasks, processing tasks) +*/ +Napi::Value counters(const Napi::CallbackInfo& info) { + Napi::Object counters = Napi::Object::New(info.Env()); + counters.Set("queue", static_cast(sharp::counterQueue)); + counters.Set("process", static_cast(sharp::counterProcess)); + return counters; +} + +/* + Get and set use of SIMD vector unit instructions +*/ +Napi::Value simd(const Napi::CallbackInfo& info) { + // Set state + if (info[size_t(0)].IsBoolean()) { + vips_vector_set_enabled(info[size_t(0)].As().Value()); + } + // Get state + return Napi::Boolean::New(info.Env(), vips_vector_isenabled()); +} + +/* + Get libvips version +*/ +Napi::Value libvipsVersion(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + Napi::Object version = Napi::Object::New(env); + + char semver[9]; + std::snprintf(semver, sizeof(semver), "%d.%d.%d", vips_version(0), vips_version(1), vips_version(2)); + version.Set("semver", Napi::String::New(env, semver)); +#ifdef SHARP_USE_GLOBAL_LIBVIPS + version.Set("isGlobal", Napi::Boolean::New(env, true)); +#else + version.Set("isGlobal", Napi::Boolean::New(env, false)); +#endif +#ifdef __EMSCRIPTEN__ + version.Set("isWasm", Napi::Boolean::New(env, true)); +#else + version.Set("isWasm", Napi::Boolean::New(env, false)); +#endif + return version; +} + +/* + Get available input/output file/buffer/stream formats +*/ +Napi::Value format(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + Napi::Object format = Napi::Object::New(env); + for (std::string const f : { + "jpeg", "png", "webp", "tiff", "magick", "openslide", "dz", + "ppm", "fits", "gif", "svg", "heif", "pdf", "vips", "jp2k", "jxl", "rad", "dcraw" + }) { + // Input + const VipsObjectClass *oc = vips_class_find("VipsOperation", (f + "load").c_str()); + Napi::Boolean hasInputFile = Napi::Boolean::New(env, oc); + Napi::Boolean hasInputBuffer = + Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "load_buffer").c_str())); + Napi::Object input = Napi::Object::New(env); + input.Set("file", hasInputFile); + input.Set("buffer", hasInputBuffer); + input.Set("stream", hasInputBuffer); + if (hasInputFile) { + const VipsForeignClass *fc = VIPS_FOREIGN_CLASS(oc); + if (fc->suffs) { + Napi::Array fileSuffix = Napi::Array::New(env); + const char **suffix = fc->suffs; + for (int i = 0; *suffix; i++, suffix++) { + fileSuffix.Set(i, Napi::String::New(env, *suffix)); + } + input.Set("fileSuffix", fileSuffix); + } + } + // Output + Napi::Boolean hasOutputFile = + Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "save").c_str())); + Napi::Boolean hasOutputBuffer = + Napi::Boolean::New(env, vips_type_find("VipsOperation", (f + "save_buffer").c_str())); + Napi::Object output = Napi::Object::New(env); + output.Set("file", hasOutputFile); + output.Set("buffer", hasOutputBuffer); + output.Set("stream", hasOutputBuffer); + // Other attributes + Napi::Object container = Napi::Object::New(env); + container.Set("id", f); + container.Set("input", input); + container.Set("output", output); + // Add to set of formats + format.Set(f, container); + } + + // Raw, uncompressed data + Napi::Boolean supported = Napi::Boolean::New(env, true); + Napi::Boolean unsupported = Napi::Boolean::New(env, false); + Napi::Object rawInput = Napi::Object::New(env); + rawInput.Set("file", unsupported); + rawInput.Set("buffer", supported); + rawInput.Set("stream", supported); + Napi::Object rawOutput = Napi::Object::New(env); + rawOutput.Set("file", unsupported); + rawOutput.Set("buffer", supported); + rawOutput.Set("stream", supported); + Napi::Object raw = Napi::Object::New(env); + raw.Set("id", "raw"); + raw.Set("input", rawInput); + raw.Set("output", rawOutput); + format.Set("raw", raw); + + return format; +} + +/* + (Un)block libvips operations at runtime. +*/ +void block(const Napi::CallbackInfo& info) { + Napi::Array ops = info[size_t(0)].As(); + bool const state = info[size_t(1)].As().Value(); + for (unsigned int i = 0; i < ops.Length(); i++) { + vips_operation_block_set(ops.Get(i).As().Utf8Value().c_str(), state); + } +} + +/* + Synchronous, internal-only method used by some of the functional tests. + Calculates the maximum colour distance using the DE2000 algorithm + between two images of the same dimensions and number of channels. +*/ +Napi::Value _maxColourDistance(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + + // Open input files + VImage image1; + sharp::ImageType imageType1 = sharp::DetermineImageType(info[size_t(0)].As().Utf8Value().data()); + if (imageType1 != sharp::ImageType::UNKNOWN) { + try { + image1 = VImage::new_from_file(info[size_t(0)].As().Utf8Value().c_str()); + } catch (...) { + throw Napi::Error::New(env, "Input file 1 has corrupt header"); + } + } else { + throw Napi::Error::New(env, "Input file 1 is of an unsupported image format"); + } + VImage image2; + sharp::ImageType imageType2 = sharp::DetermineImageType(info[size_t(1)].As().Utf8Value().data()); + if (imageType2 != sharp::ImageType::UNKNOWN) { + try { + image2 = VImage::new_from_file(info[size_t(1)].As().Utf8Value().c_str()); + } catch (...) { + throw Napi::Error::New(env, "Input file 2 has corrupt header"); + } + } else { + throw Napi::Error::New(env, "Input file 2 is of an unsupported image format"); + } + // Ensure same number of channels + if (image1.bands() != image2.bands()) { + throw Napi::Error::New(env, "mismatchedBands"); + } + // Ensure same dimensions + if (image1.width() != image2.width() || image1.height() != image2.height()) { + throw Napi::Error::New(env, "mismatchedDimensions"); + } + + double maxColourDistance; + try { + // Premultiply and remove alpha + if (image1.has_alpha()) { + image1 = image1.premultiply().extract_band(1, VImage::option()->set("n", image1.bands() - 1)); + } + if (image2.has_alpha()) { + image2 = image2.premultiply().extract_band(1, VImage::option()->set("n", image2.bands() - 1)); + } + // Calculate colour distance + maxColourDistance = image1.dE00(image2).max(); + } catch (vips::VError const &err) { + throw Napi::Error::New(env, err.what()); + } + + // Clean up libvips' per-request data and threads + vips_error_clear(); + vips_thread_shutdown(); + + return Napi::Number::New(env, maxColourDistance); +} + +#if defined(__GNUC__) +// mallctl will be resolved by the runtime linker when jemalloc is being used +extern "C" { + int mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) __attribute__((weak)); +} +Napi::Value _isUsingJemalloc(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + return Napi::Boolean::New(env, mallctl != nullptr); +} +#else +Napi::Value _isUsingJemalloc(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + return Napi::Boolean::New(env, false); +} +#endif + +#if defined(__GNUC__) && defined(__x86_64__) +// Are SSE 4.2 intrinsics available at runtime? +Napi::Value _isUsingX64V2(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + unsigned int eax, ebx, ecx, edx; + __asm__ __volatile__("cpuid" + : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) + : "a"(1)); + return Napi::Boolean::New(env, (ecx & 1U << 20) != 0); +} +#else +Napi::Value _isUsingX64V2(const Napi::CallbackInfo& info) { + Napi::Env env = info.Env(); + return Napi::Boolean::New(env, false); +} +#endif diff --git a/node_modules/sharp/src/utilities.h b/node_modules/sharp/src/utilities.h new file mode 100644 index 0000000..a1719fa --- /dev/null +++ b/node_modules/sharp/src/utilities.h @@ -0,0 +1,22 @@ +/*! + Copyright 2013 Lovell Fuller and others. + SPDX-License-Identifier: Apache-2.0 +*/ + +#ifndef SRC_UTILITIES_H_ +#define SRC_UTILITIES_H_ + +#include + +Napi::Value cache(const Napi::CallbackInfo& info); +Napi::Value concurrency(const Napi::CallbackInfo& info); +Napi::Value counters(const Napi::CallbackInfo& info); +Napi::Value simd(const Napi::CallbackInfo& info); +Napi::Value libvipsVersion(const Napi::CallbackInfo& info); +Napi::Value format(const Napi::CallbackInfo& info); +void block(const Napi::CallbackInfo& info); +Napi::Value _maxColourDistance(const Napi::CallbackInfo& info); +Napi::Value _isUsingJemalloc(const Napi::CallbackInfo& info); +Napi::Value _isUsingX64V2(const Napi::CallbackInfo& info); + +#endif // SRC_UTILITIES_H_ diff --git a/node_modules/shebang-command/index.js b/node_modules/shebang-command/index.js new file mode 100644 index 0000000..f35db30 --- /dev/null +++ b/node_modules/shebang-command/index.js @@ -0,0 +1,19 @@ +'use strict'; +const shebangRegex = require('shebang-regex'); + +module.exports = (string = '') => { + const match = string.match(shebangRegex); + + if (!match) { + return null; + } + + const [path, argument] = match[0].replace(/#! ?/, '').split(' '); + const binary = path.split('/').pop(); + + if (binary === 'env') { + return argument; + } + + return argument ? `${binary} ${argument}` : binary; +}; diff --git a/node_modules/shebang-command/license b/node_modules/shebang-command/license new file mode 100644 index 0000000..db6bc32 --- /dev/null +++ b/node_modules/shebang-command/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Kevin Mårtensson (github.com/kevva) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-command/package.json b/node_modules/shebang-command/package.json new file mode 100644 index 0000000..18e3c04 --- /dev/null +++ b/node_modules/shebang-command/package.json @@ -0,0 +1,34 @@ +{ + "name": "shebang-command", + "version": "2.0.0", + "description": "Get the command from a shebang", + "license": "MIT", + "repository": "kevva/shebang-command", + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "cmd", + "command", + "parse", + "shebang" + ], + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "devDependencies": { + "ava": "^2.3.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/shebang-command/readme.md b/node_modules/shebang-command/readme.md new file mode 100644 index 0000000..84feb44 --- /dev/null +++ b/node_modules/shebang-command/readme.md @@ -0,0 +1,34 @@ +# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command) + +> Get the command from a shebang + + +## Install + +``` +$ npm install shebang-command +``` + + +## Usage + +```js +const shebangCommand = require('shebang-command'); + +shebangCommand('#!/usr/bin/env node'); +//=> 'node' + +shebangCommand('#!/bin/bash'); +//=> 'bash' +``` + + +## API + +### shebangCommand(string) + +#### string + +Type: `string` + +String containing a shebang. diff --git a/node_modules/shebang-regex/index.d.ts b/node_modules/shebang-regex/index.d.ts new file mode 100644 index 0000000..61d034b --- /dev/null +++ b/node_modules/shebang-regex/index.d.ts @@ -0,0 +1,22 @@ +/** +Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line. + +@example +``` +import shebangRegex = require('shebang-regex'); + +const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; + +shebangRegex.test(string); +//=> true + +shebangRegex.exec(string)[0]; +//=> '#!/usr/bin/env node' + +shebangRegex.exec(string)[1]; +//=> '/usr/bin/env node' +``` +*/ +declare const shebangRegex: RegExp; + +export = shebangRegex; diff --git a/node_modules/shebang-regex/index.js b/node_modules/shebang-regex/index.js new file mode 100644 index 0000000..63fc4a0 --- /dev/null +++ b/node_modules/shebang-regex/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = /^#!(.*)/; diff --git a/node_modules/shebang-regex/license b/node_modules/shebang-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/shebang-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/shebang-regex/package.json b/node_modules/shebang-regex/package.json new file mode 100644 index 0000000..00ab30f --- /dev/null +++ b/node_modules/shebang-regex/package.json @@ -0,0 +1,35 @@ +{ + "name": "shebang-regex", + "version": "3.0.0", + "description": "Regular expression for matching a shebang line", + "license": "MIT", + "repository": "sindresorhus/shebang-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "regex", + "regexp", + "shebang", + "match", + "test", + "line" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/shebang-regex/readme.md b/node_modules/shebang-regex/readme.md new file mode 100644 index 0000000..5ecf863 --- /dev/null +++ b/node_modules/shebang-regex/readme.md @@ -0,0 +1,33 @@ +# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) + +> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line + + +## Install + +``` +$ npm install shebang-regex +``` + + +## Usage + +```js +const shebangRegex = require('shebang-regex'); + +const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; + +shebangRegex.test(string); +//=> true + +shebangRegex.exec(string)[0]; +//=> '#!/usr/bin/env node' + +shebangRegex.exec(string)[1]; +//=> '/usr/bin/env node' +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/side-channel-list/.editorconfig b/node_modules/side-channel-list/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/node_modules/side-channel-list/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/node_modules/side-channel-list/.eslintrc b/node_modules/side-channel-list/.eslintrc new file mode 100644 index 0000000..93978e7 --- /dev/null +++ b/node_modules/side-channel-list/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/node_modules/side-channel-list/.github/FUNDING.yml b/node_modules/side-channel-list/.github/FUNDING.yml new file mode 100644 index 0000000..eaff735 --- /dev/null +++ b/node_modules/side-channel-list/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-list +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel-list/.nycrc b/node_modules/side-channel-list/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/node_modules/side-channel-list/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/side-channel-list/CHANGELOG.md b/node_modules/side-channel-list/CHANGELOG.md new file mode 100644 index 0000000..2ec51b7 --- /dev/null +++ b/node_modules/side-channel-list/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`5d6baee`](https://github.com/ljharb/side-channel-list/commit/5d6baee5c9054a1238007f5a1dfc109a7a816251) +- Initial commit [`3ae784c`](https://github.com/ljharb/side-channel-list/commit/3ae784c63a47895fbaeed2a91ab54a8029a7a100) +- npm init [`07055a4`](https://github.com/ljharb/side-channel-list/commit/07055a4d139895565b199dba5fe2479c1a1b9e28) +- Only apps should have lockfiles [`9573058`](https://github.com/ljharb/side-channel-list/commit/9573058a47494e2d68f8c6c77b5d7fbe441949c1) diff --git a/node_modules/side-channel-list/LICENSE b/node_modules/side-channel-list/LICENSE new file mode 100644 index 0000000..f82f389 --- /dev/null +++ b/node_modules/side-channel-list/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/side-channel-list/README.md b/node_modules/side-channel-list/README.md new file mode 100644 index 0000000..d9c7a13 --- /dev/null +++ b/node_modules/side-channel-list/README.md @@ -0,0 +1,62 @@ +# side-channel-list [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel, using a linked list. + +Warning: this implementation will leak memory until you `delete` the `key`. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-list +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelList = require('side-channel-list'); + +const channel = getSideChannelList(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-list +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-list.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-list.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-list +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-list/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-list#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-list.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-list.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-list.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-list +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-list/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-list/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-list +[actions-url]: https://github.com/ljharb/side-channel-list/actions diff --git a/node_modules/side-channel-list/index.d.ts b/node_modules/side-channel-list/index.d.ts new file mode 100644 index 0000000..c9cabc8 --- /dev/null +++ b/node_modules/side-channel-list/index.d.ts @@ -0,0 +1,13 @@ +declare namespace getSideChannelList { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + }; +} + +declare function getSideChannelList(): getSideChannelList.Channel; + +export = getSideChannelList; diff --git a/node_modules/side-channel-list/index.js b/node_modules/side-channel-list/index.js new file mode 100644 index 0000000..8d6f98c --- /dev/null +++ b/node_modules/side-channel-list/index.js @@ -0,0 +1,113 @@ +'use strict'; + +var inspect = require('object-inspect'); + +var $TypeError = require('es-errors/type'); + +/* +* This function traverses the list returning the node corresponding to the given key. +* +* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. +* By doing so, all the recently used nodes can be accessed relatively quickly. +*/ +/** @type {import('./list.d.ts').listGetNode} */ +// eslint-disable-next-line consistent-return +var listGetNode = function (list, key, isDelete) { + /** @type {typeof list | NonNullable<(typeof list)['next']>} */ + var prev = list; + /** @type {(typeof list)['next']} */ + var curr; + // eslint-disable-next-line eqeqeq + for (; (curr = prev.next) != null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + if (!isDelete) { + // eslint-disable-next-line no-extra-parens + curr.next = /** @type {NonNullable} */ (list.next); + list.next = curr; // eslint-disable-line no-param-reassign + } + return curr; + } + } +}; + +/** @type {import('./list.d.ts').listGet} */ +var listGet = function (objects, key) { + if (!objects) { + return void undefined; + } + var node = listGetNode(objects, key); + return node && node.value; +}; +/** @type {import('./list.d.ts').listSet} */ +var listSet = function (objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + // Prepend the new node to the beginning of the list + objects.next = /** @type {import('./list.d.ts').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens + key: key, + next: objects.next, + value: value + }); + } +}; +/** @type {import('./list.d.ts').listHas} */ +var listHas = function (objects, key) { + if (!objects) { + return false; + } + return !!listGetNode(objects, key); +}; +/** @type {import('./list.d.ts').listDelete} */ +// eslint-disable-next-line consistent-return +var listDelete = function (objects, key) { + if (objects) { + return listGetNode(objects, key, true); + } +}; + +/** @type {import('.')} */ +module.exports = function getSideChannelList() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {import('./list.d.ts').RootNode | undefined} */ var $o; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + var root = $o && $o.next; + var deletedNode = listDelete($o, key); + if (deletedNode && root && root === deletedNode) { + $o = void undefined; + } + return !!deletedNode; + }, + get: function (key) { + return listGet($o, key); + }, + has: function (key) { + return listHas($o, key); + }, + set: function (key, value) { + if (!$o) { + // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head + $o = { + next: void undefined + }; + } + // eslint-disable-next-line no-extra-parens + listSet(/** @type {NonNullable} */ ($o), key, value); + } + }; + // @ts-expect-error TODO: figure out why this is erroring + return channel; +}; diff --git a/node_modules/side-channel-list/list.d.ts b/node_modules/side-channel-list/list.d.ts new file mode 100644 index 0000000..2c759e2 --- /dev/null +++ b/node_modules/side-channel-list/list.d.ts @@ -0,0 +1,14 @@ +type ListNode = { + key: K; + next: undefined | ListNode; + value: T; +}; +type RootNode = { + next: undefined | ListNode; +}; + +export function listGetNode(list: RootNode, key: ListNode['key'], isDelete?: boolean): ListNode | undefined; +export function listGet(objects: undefined | RootNode, key: ListNode['key']): T | undefined; +export function listSet(objects: RootNode, key: ListNode['key'], value: T): void; +export function listHas(objects: undefined | RootNode, key: ListNode['key']): boolean; +export function listDelete(objects: undefined | RootNode, key: ListNode['key']): ListNode | undefined; diff --git a/node_modules/side-channel-list/package.json b/node_modules/side-channel-list/package.json new file mode 100644 index 0000000..ba0f5c5 --- /dev/null +++ b/node_modules/side-channel-list/package.json @@ -0,0 +1,77 @@ +{ + "name": "side-channel-list", + "version": "1.0.0", + "description": "Store information about any JS value in a side channel, using a linked list", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-list.git" + }, + "keywords": [], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-list/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-list#readme", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/side-channel-list/test/index.js b/node_modules/side-channel-list/test/index.js new file mode 100644 index 0000000..3ad4368 --- /dev/null +++ b/node_modules/side-channel-list/test/index.js @@ -0,0 +1,104 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelList = require('../'); + +test('getSideChannelList', function (t) { + t.test('export', function (st) { + st.equal(typeof getSideChannelList, 'function', 'is a function'); + + st.equal(getSideChannelList.length, 0, 'takes no arguments'); + + var channel = getSideChannelList(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannelList(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannelList(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannelList(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannelList(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannelList(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/side-channel-list/tsconfig.json b/node_modules/side-channel-list/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/node_modules/side-channel-list/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/side-channel-map/.editorconfig b/node_modules/side-channel-map/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/node_modules/side-channel-map/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/node_modules/side-channel-map/.eslintrc b/node_modules/side-channel-map/.eslintrc new file mode 100644 index 0000000..93978e7 --- /dev/null +++ b/node_modules/side-channel-map/.eslintrc @@ -0,0 +1,11 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/node_modules/side-channel-map/.github/FUNDING.yml b/node_modules/side-channel-map/.github/FUNDING.yml new file mode 100644 index 0000000..f2891bd --- /dev/null +++ b/node_modules/side-channel-map/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-map +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel-map/.nycrc b/node_modules/side-channel-map/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/node_modules/side-channel-map/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/side-channel-map/CHANGELOG.md b/node_modules/side-channel-map/CHANGELOG.md new file mode 100644 index 0000000..b6ccea9 --- /dev/null +++ b/node_modules/side-channel-map/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.1](https://github.com/ljharb/side-channel-map/compare/v1.0.0...v1.0.1) - 2024-12-10 + +### Commits + +- [Deps] update `call-bound` [`6d05aaa`](https://github.com/ljharb/side-channel-map/commit/6d05aaa4ce5f2be4e7825df433d650696f0ba40f) +- [types] fix generics ordering [`11c0184`](https://github.com/ljharb/side-channel-map/commit/11c0184132ac11fdc16857e12682e148e5e9ee74) + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`ad877b4`](https://github.com/ljharb/side-channel-map/commit/ad877b42926d46d63fff76a2bd01d2b4a01959a9) +- Initial commit [`28f8879`](https://github.com/ljharb/side-channel-map/commit/28f8879c512abe8fcf9b6a4dc7754a0287e5eba4) +- npm init [`2c9604e`](https://github.com/ljharb/side-channel-map/commit/2c9604e5aa40223e425ea7cea78f8a07697504bd) +- Only apps should have lockfiles [`5e7ba9c`](https://github.com/ljharb/side-channel-map/commit/5e7ba9cffe3ef42095815adc8ac1255b49bbadf5) diff --git a/node_modules/side-channel-map/LICENSE b/node_modules/side-channel-map/LICENSE new file mode 100644 index 0000000..f82f389 --- /dev/null +++ b/node_modules/side-channel-map/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/side-channel-map/README.md b/node_modules/side-channel-map/README.md new file mode 100644 index 0000000..8fa6f77 --- /dev/null +++ b/node_modules/side-channel-map/README.md @@ -0,0 +1,62 @@ +# side-channel-map [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel, using a Map. + +Warning: if the `key` is an object, this implementation will leak memory until you `delete` it. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-map +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelMap = require('side-channel-map'); + +const channel = getSideChannelMap(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-map +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-map.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-map.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-map +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-map/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-map#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-map.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-map.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-map.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-map +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-map/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-map/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-map +[actions-url]: https://github.com/ljharb/side-channel-map/actions diff --git a/node_modules/side-channel-map/index.d.ts b/node_modules/side-channel-map/index.d.ts new file mode 100644 index 0000000..de33e89 --- /dev/null +++ b/node_modules/side-channel-map/index.d.ts @@ -0,0 +1,15 @@ +declare namespace getSideChannelMap { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + }; +} + +declare function getSideChannelMap(): getSideChannelMap.Channel; + +declare const x: false | typeof getSideChannelMap; + +export = x; diff --git a/node_modules/side-channel-map/index.js b/node_modules/side-channel-map/index.js new file mode 100644 index 0000000..e111100 --- /dev/null +++ b/node_modules/side-channel-map/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); + +var $TypeError = require('es-errors/type'); +var $Map = GetIntrinsic('%Map%', true); + +/** @type {(thisArg: Map, key: K) => V} */ +var $mapGet = callBound('Map.prototype.get', true); +/** @type {(thisArg: Map, key: K, value: V) => void} */ +var $mapSet = callBound('Map.prototype.set', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapHas = callBound('Map.prototype.has', true); +/** @type {(thisArg: Map, key: K) => boolean} */ +var $mapDelete = callBound('Map.prototype.delete', true); +/** @type {(thisArg: Map) => number} */ +var $mapSize = callBound('Map.prototype.size', true); + +/** @type {import('.')} */ +module.exports = !!$Map && /** @type {Exclude} */ function getSideChannelMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {Map | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($m) { + var result = $mapDelete($m, key); + if ($mapSize($m) === 0) { + $m = void undefined; + } + return result; + } + return false; + }, + get: function (key) { // eslint-disable-line consistent-return + if ($m) { + return $mapGet($m, key); + } + }, + has: function (key) { + if ($m) { + return $mapHas($m, key); + } + return false; + }, + set: function (key, value) { + if (!$m) { + // @ts-expect-error TS can't handle narrowing a variable inside a closure + $m = new $Map(); + } + $mapSet($m, key, value); + } + }; + + // @ts-expect-error TODO: figure out why TS is erroring here + return channel; +}; diff --git a/node_modules/side-channel-map/package.json b/node_modules/side-channel-map/package.json new file mode 100644 index 0000000..18e8080 --- /dev/null +++ b/node_modules/side-channel-map/package.json @@ -0,0 +1,80 @@ +{ + "name": "side-channel-map", + "version": "1.0.1", + "description": "Store information about any JS value in a side channel, using a Map", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>= 10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-map.git" + }, + "keywords": [], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-map/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-map#readme", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/get-intrinsic": "^1.2.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/side-channel-map/test/index.js b/node_modules/side-channel-map/test/index.js new file mode 100644 index 0000000..1743323 --- /dev/null +++ b/node_modules/side-channel-map/test/index.js @@ -0,0 +1,114 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelMap = require('../'); + +test('getSideChannelMap', { skip: typeof Map !== 'function' }, function (t) { + var getSideChannel = getSideChannelMap || function () { + throw new EvalError('should never happen'); + }; + + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); + +test('getSideChannelMap, no Maps', { skip: typeof Map === 'function' }, function (t) { + t.equal(getSideChannelMap, false, 'is false'); + + t.end(); +}); diff --git a/node_modules/side-channel-map/tsconfig.json b/node_modules/side-channel-map/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/node_modules/side-channel-map/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/side-channel-weakmap/.editorconfig b/node_modules/side-channel-weakmap/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/node_modules/side-channel-weakmap/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/node_modules/side-channel-weakmap/.eslintrc b/node_modules/side-channel-weakmap/.eslintrc new file mode 100644 index 0000000..9b13ad8 --- /dev/null +++ b/node_modules/side-channel-weakmap/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/node_modules/side-channel-weakmap/.github/FUNDING.yml b/node_modules/side-channel-weakmap/.github/FUNDING.yml new file mode 100644 index 0000000..2ae71cd --- /dev/null +++ b/node_modules/side-channel-weakmap/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel-weakmap +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel-weakmap/.nycrc b/node_modules/side-channel-weakmap/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/node_modules/side-channel-weakmap/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/side-channel-weakmap/CHANGELOG.md b/node_modules/side-channel-weakmap/CHANGELOG.md new file mode 100644 index 0000000..aba7ab0 --- /dev/null +++ b/node_modules/side-channel-weakmap/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.1...v1.0.2) - 2024-12-10 + +### Commits + +- [types] fix generics ordering [`1b62e94`](https://github.com/ljharb/side-channel-weakmap/commit/1b62e94a2ad6ed30b640ba73c4a2535836c67289) + +## [v1.0.1](https://github.com/ljharb/side-channel-weakmap/compare/v1.0.0...v1.0.1) - 2024-12-10 + +### Commits + +- [types] fix generics ordering [`08a4a5d`](https://github.com/ljharb/side-channel-weakmap/commit/08a4a5dbffedc3ebc79f1aaaf5a3dd6d2196dc1b) +- [Deps] update `side-channel-map` [`b53fe44`](https://github.com/ljharb/side-channel-weakmap/commit/b53fe447dfdd3a9aebedfd015b384eac17fce916) + +## v1.0.0 - 2024-12-10 + +### Commits + +- Initial implementation, tests, readme, types [`53c0fa4`](https://github.com/ljharb/side-channel-weakmap/commit/53c0fa4788435a006f58b9d7b43cb65989ecee49) +- Initial commit [`a157947`](https://github.com/ljharb/side-channel-weakmap/commit/a157947f26fcaf2c4a941d3a044e76bf67343532) +- npm init [`54dfc55`](https://github.com/ljharb/side-channel-weakmap/commit/54dfc55bafb16265910d5aad4e743c43aee5bbbb) +- Only apps should have lockfiles [`0ddd6c7`](https://github.com/ljharb/side-channel-weakmap/commit/0ddd6c7b07fe8ee04d67b2e9f7255af7ce62c07d) diff --git a/node_modules/side-channel-weakmap/LICENSE b/node_modules/side-channel-weakmap/LICENSE new file mode 100644 index 0000000..3900dd7 --- /dev/null +++ b/node_modules/side-channel-weakmap/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/side-channel-weakmap/README.md b/node_modules/side-channel-weakmap/README.md new file mode 100644 index 0000000..856ee36 --- /dev/null +++ b/node_modules/side-channel-weakmap/README.md @@ -0,0 +1,62 @@ +# side-channel-weakmap [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: this implementation will leak memory until you `delete` the `key`. +Use [`side-channel`](https://npmjs.com/side-channel) for the best available strategy. + +## Getting started + +```sh +npm install --save side-channel-weakmap +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannelList = require('side-channel-weakmap'); + +const channel = getSideChannelList(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel-weakmap +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel-weakmap.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap.svg +[deps-url]: https://david-dm.org/ljharb/side-channel-weakmap +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel-weakmap/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel-weakmap#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel-weakmap.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel-weakmap.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel-weakmap.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel-weakmap +[codecov-image]: https://codecov.io/gh/ljharb/side-channel-weakmap/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel-weakmap/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel-weakmap +[actions-url]: https://github.com/ljharb/side-channel-weakmap/actions diff --git a/node_modules/side-channel-weakmap/index.d.ts b/node_modules/side-channel-weakmap/index.d.ts new file mode 100644 index 0000000..ce1bc2a --- /dev/null +++ b/node_modules/side-channel-weakmap/index.d.ts @@ -0,0 +1,15 @@ +declare namespace getSideChannelWeakMap { + type Channel = { + assert: (key: K) => void; + has: (key: K) => boolean; + get: (key: K) => V | undefined; + set: (key: K, value: V) => void; + delete: (key: K) => boolean; + } +} + +declare function getSideChannelWeakMap(): getSideChannelWeakMap.Channel; + +declare const x: false | typeof getSideChannelWeakMap; + +export = x; diff --git a/node_modules/side-channel-weakmap/index.js b/node_modules/side-channel-weakmap/index.js new file mode 100644 index 0000000..e5b8183 --- /dev/null +++ b/node_modules/side-channel-weakmap/index.js @@ -0,0 +1,84 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); +var getSideChannelMap = require('side-channel-map'); + +var $TypeError = require('es-errors/type'); +var $WeakMap = GetIntrinsic('%WeakMap%', true); + +/** @type {(thisArg: WeakMap, key: K) => V} */ +var $weakMapGet = callBound('WeakMap.prototype.get', true); +/** @type {(thisArg: WeakMap, key: K, value: V) => void} */ +var $weakMapSet = callBound('WeakMap.prototype.set', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapHas = callBound('WeakMap.prototype.has', true); +/** @type {(thisArg: WeakMap, key: K) => boolean} */ +var $weakMapDelete = callBound('WeakMap.prototype.delete', true); + +/** @type {import('.')} */ +module.exports = $WeakMap + ? /** @type {Exclude} */ function getSideChannelWeakMap() { + /** @typedef {ReturnType} Channel */ + /** @typedef {Parameters[0]} K */ + /** @typedef {Parameters[1]} V */ + + /** @type {WeakMap | undefined} */ var $wm; + /** @type {Channel | undefined} */ var $m; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapDelete($wm, key); + } + } else if (getSideChannelMap) { + if ($m) { + return $m['delete'](key); + } + } + return false; + }, + get: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } + return $m && $m.get(key); + }, + has: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } + return !!$m && $m.has(key); + }, + set: function (key, value) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if (getSideChannelMap) { + if (!$m) { + $m = getSideChannelMap(); + } + // eslint-disable-next-line no-extra-parens + /** @type {NonNullable} */ ($m).set(key, value); + } + } + }; + + // @ts-expect-error TODO: figure out why this is erroring + return channel; + } + : getSideChannelMap; diff --git a/node_modules/side-channel-weakmap/package.json b/node_modules/side-channel-weakmap/package.json new file mode 100644 index 0000000..9ef6583 --- /dev/null +++ b/node_modules/side-channel-weakmap/package.json @@ -0,0 +1,87 @@ +{ + "name": "side-channel-weakmap", + "version": "1.0.2", + "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel-weakmap.git" + }, + "keywords": [ + "weakmap", + "map", + "side", + "channel", + "metadata" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel-weakmap/issues" + }, + "homepage": "https://github.com/ljharb/side-channel-weakmap#readme", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/call-bind": "^1.0.5", + "@types/get-intrinsic": "^1.2.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/side-channel-weakmap/test/index.js b/node_modules/side-channel-weakmap/test/index.js new file mode 100644 index 0000000..a01248b --- /dev/null +++ b/node_modules/side-channel-weakmap/test/index.js @@ -0,0 +1,114 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannelWeakMap = require('../'); + +test('getSideChannelMap', { skip: typeof WeakMap !== 'function' && typeof Map !== 'function' }, function (t) { + var getSideChannel = getSideChannelWeakMap || function () { + throw new EvalError('should never happen'); + }; + + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); + +test('getSideChannelMap, no WeakMaps and/or Maps', { skip: typeof WeakMap === 'function' || typeof Map === 'function' }, function (t) { + t.equal(getSideChannelWeakMap, false, 'is false'); + + t.end(); +}); diff --git a/node_modules/side-channel-weakmap/tsconfig.json b/node_modules/side-channel-weakmap/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/node_modules/side-channel-weakmap/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/side-channel/.editorconfig b/node_modules/side-channel/.editorconfig new file mode 100644 index 0000000..72e0eba --- /dev/null +++ b/node_modules/side-channel/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true diff --git a/node_modules/side-channel/.eslintrc b/node_modules/side-channel/.eslintrc new file mode 100644 index 0000000..9b13ad8 --- /dev/null +++ b/node_modules/side-channel/.eslintrc @@ -0,0 +1,12 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "id-length": 0, + "max-lines-per-function": 0, + "multiline-comment-style": 1, + "new-cap": [2, { "capIsNewExceptions": ["GetIntrinsic"] }], + }, +} diff --git a/node_modules/side-channel/.github/FUNDING.yml b/node_modules/side-channel/.github/FUNDING.yml new file mode 100644 index 0000000..2a94840 --- /dev/null +++ b/node_modules/side-channel/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/side-channel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/side-channel/.nycrc b/node_modules/side-channel/.nycrc new file mode 100644 index 0000000..1826526 --- /dev/null +++ b/node_modules/side-channel/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/side-channel/CHANGELOG.md b/node_modules/side-channel/CHANGELOG.md new file mode 100644 index 0000000..58e378c --- /dev/null +++ b/node_modules/side-channel/CHANGELOG.md @@ -0,0 +1,110 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.0](https://github.com/ljharb/side-channel/compare/v1.0.6...v1.1.0) - 2024-12-11 + +### Commits + +- [Refactor] extract implementations to `side-channel-weakmap`, `side-channel-map`, `side-channel-list` [`ada5955`](https://github.com/ljharb/side-channel/commit/ada595549a5c4c6c853756d598846b180941c6da) +- [New] add `channel.delete` [`c01d2d3`](https://github.com/ljharb/side-channel/commit/c01d2d3fd51dbb1ce6da72ad7916e61bd6172aad) +- [types] improve types [`0c54356`](https://github.com/ljharb/side-channel/commit/0c5435651417df41b8cc1a5f7cdce8bffae68cde) +- [readme] add content [`be24868`](https://github.com/ljharb/side-channel/commit/be248682ac294b0e22c883092c45985aa91c490a) +- [actions] split out node 10-20, and 20+ [`c4488e2`](https://github.com/ljharb/side-channel/commit/c4488e241ef3d49a19fe266ac830a2e644305911) +- [types] use shared tsconfig [`0e0d57c`](https://github.com/ljharb/side-channel/commit/0e0d57c2ff17c7b45c6cbd43ebcf553edc9e3adc) +- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/object-inspect`, `@types/tape`, `auto-changelog`, `tape` [`fb4f622`](https://github.com/ljharb/side-channel/commit/fb4f622e64a99a1e40b6e5cd7691674a9dc429e4) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`b78336b`](https://github.com/ljharb/side-channel/commit/b78336b886172d1b457d414ac9e28de8c5fecc78) +- [Tests] replace `aud` with `npm audit` [`ee3ab46`](https://github.com/ljharb/side-channel/commit/ee3ab4690d954311c35115651bcfd45edd205aa1) +- [Dev Deps] add missing peer dep [`c03e21a`](https://github.com/ljharb/side-channel/commit/c03e21a7def3b67cdc15ae22316884fefcb2f6a8) + +## [v1.0.6](https://github.com/ljharb/side-channel/compare/v1.0.5...v1.0.6) - 2024-02-29 + +### Commits + +- add types [`9beef66`](https://github.com/ljharb/side-channel/commit/9beef6643e6d717ea57bedabf86448123a7dd9e9) +- [meta] simplify `exports` [`4334cf9`](https://github.com/ljharb/side-channel/commit/4334cf9df654151504c383b62a2f9ebdc8d9d5ac) +- [Deps] update `call-bind` [`d6043c4`](https://github.com/ljharb/side-channel/commit/d6043c4d8f4d7be9037dd0f0419c7a2e0e39ec6a) +- [Dev Deps] update `tape` [`6aca376`](https://github.com/ljharb/side-channel/commit/6aca3761868dc8cd5ff7fd9799bf6b95e09a6eb0) + +## [v1.0.5](https://github.com/ljharb/side-channel/compare/v1.0.4...v1.0.5) - 2024-02-06 + +### Commits + +- [actions] reuse common workflows [`3d2e1ff`](https://github.com/ljharb/side-channel/commit/3d2e1ffd16dd6eaaf3e40ff57951f840d2d63c04) +- [meta] use `npmignore` to autogenerate an npmignore file [`04296ea`](https://github.com/ljharb/side-channel/commit/04296ea17d1544b0a5d20fd5bfb31aa4f6513eb9) +- [meta] add `.editorconfig`; add `eclint` [`130f0a6`](https://github.com/ljharb/side-channel/commit/130f0a6adbc04d385c7456a601d38344dce3d6a9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`d480c2f`](https://github.com/ljharb/side-channel/commit/d480c2fbe757489ae9b4275491ffbcc3ac4725e9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ecbe70e`](https://github.com/ljharb/side-channel/commit/ecbe70e53a418234081a77971fec1fdfae20c841) +- [actions] update rebase action [`75240b9`](https://github.com/ljharb/side-channel/commit/75240b9963b816e8846400d2287cb68f88c7fba7) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`ae8d281`](https://github.com/ljharb/side-channel/commit/ae8d281572430099109870fd9430d2ca3f320b8d) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`7125b88`](https://github.com/ljharb/side-channel/commit/7125b885fd0eacad4fee9b073b72d14065ece278) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`82577c9`](https://github.com/ljharb/side-channel/commit/82577c9796304519139a570f82a317211b5f3b86) +- [Deps] update `call-bind`, `get-intrinsic`, `object-inspect` [`550aadf`](https://github.com/ljharb/side-channel/commit/550aadf20475a6081fd70304cc54f77259a5c8a8) +- [Tests] increase coverage [`5130877`](https://github.com/ljharb/side-channel/commit/5130877a7b27c862e64e6d1c12a178b28808859d) +- [Deps] update `get-intrinsic`, `object-inspect` [`ba0194c`](https://github.com/ljharb/side-channel/commit/ba0194c505b1a8a0427be14cadd5b8a46d4d01b8) +- [meta] add missing `engines.node` [`985fd24`](https://github.com/ljharb/side-channel/commit/985fd249663cb06617a693a94fe08cad12f5cb70) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`40227a8`](https://github.com/ljharb/side-channel/commit/40227a87b01709ad2c0eebf87eb4223a800099b9) +- [Deps] update `get-intrinsic` [`a989b40`](https://github.com/ljharb/side-channel/commit/a989b4024958737ae7be9fbffdeff2078f33a0fd) +- [Deps] update `object-inspect` [`aec42d2`](https://github.com/ljharb/side-channel/commit/aec42d2ec541a31aaa02475692c87d489237d9a3) + +## [v1.0.4](https://github.com/ljharb/side-channel/compare/v1.0.3...v1.0.4) - 2020-12-29 + +### Commits + +- [Tests] migrate tests to Github Actions [`10909cb`](https://github.com/ljharb/side-channel/commit/10909cbf8ce9c0bf96f604cf13d7ffd5a22c2d40) +- [Refactor] Use a linked list rather than an array, and move accessed nodes to the beginning [`195613f`](https://github.com/ljharb/side-channel/commit/195613f28b5c1e6072ef0b61b5beebaf2b6a304e) +- [meta] do not publish github action workflow files [`290ec29`](https://github.com/ljharb/side-channel/commit/290ec29cd21a60585145b4a7237ec55228c52c27) +- [Tests] run `nyc` on all tests; use `tape` runner [`ea6d030`](https://github.com/ljharb/side-channel/commit/ea6d030ff3fe6be2eca39e859d644c51ecd88869) +- [actions] add "Allow Edits" workflow [`d464d8f`](https://github.com/ljharb/side-channel/commit/d464d8fe52b5eddf1504a0ed97f0941a90f32c15) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`02daca8`](https://github.com/ljharb/side-channel/commit/02daca87c6809821c97be468d1afa2f5ef447383) +- [Refactor] use `call-bind` and `get-intrinsic` instead of `es-abstract` [`e09d481`](https://github.com/ljharb/side-channel/commit/e09d481528452ebafa5cdeae1af665c35aa2deee) +- [Deps] update `object.assign` [`ee83aa8`](https://github.com/ljharb/side-channel/commit/ee83aa81df313b5e46319a63adb05cf0c179079a) +- [actions] update rebase action to use checkout v2 [`7726b0b`](https://github.com/ljharb/side-channel/commit/7726b0b058b632fccea709f58960871defaaa9d7) + +## [v1.0.3](https://github.com/ljharb/side-channel/compare/v1.0.2...v1.0.3) - 2020-08-23 + +### Commits + +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`1f10561`](https://github.com/ljharb/side-channel/commit/1f105611ef3acf32dec8032ae5c0baa5e56bb868) +- [Deps] update `es-abstract`, `object-inspect` [`bc20159`](https://github.com/ljharb/side-channel/commit/bc201597949a505e37cef9eaf24c7010831e6f03) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`b9b2b22`](https://github.com/ljharb/side-channel/commit/b9b2b225f9e0ea72a6ec2b89348f0bd690bc9ed1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`7055ab4`](https://github.com/ljharb/side-channel/commit/7055ab4de0860606efd2003674a74f1fe6ebc07e) +- [Dev Deps] update `auto-changelog`; add `aud` [`d278c37`](https://github.com/ljharb/side-channel/commit/d278c37d08227be4f84aa769fcd919e73feeba40) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`3bcf982`](https://github.com/ljharb/side-channel/commit/3bcf982faa122745b39c33ce83d32fdf003741c6) +- [Tests] only audit prod deps [`18d01c4`](https://github.com/ljharb/side-channel/commit/18d01c4015b82a3d75044c4d5ba7917b2eac01ec) +- [Deps] update `es-abstract` [`6ab096d`](https://github.com/ljharb/side-channel/commit/6ab096d9de2b482cf5e0717e34e212f5b2b9bc9a) +- [Dev Deps] update `tape` [`9dc174c`](https://github.com/ljharb/side-channel/commit/9dc174cc651dfd300b4b72da936a0a7eda5f9452) +- [Deps] update `es-abstract` [`431d0f0`](https://github.com/ljharb/side-channel/commit/431d0f0ff11fbd2ae6f3115582a356d3a1cfce82) +- [Deps] update `es-abstract` [`49869fd`](https://github.com/ljharb/side-channel/commit/49869fd323bf4453f0ba515c0fb265cf5ab7b932) +- [meta] Add package.json to package's exports [`77d9cdc`](https://github.com/ljharb/side-channel/commit/77d9cdceb2a9e47700074f2ae0c0a202e7dac0d4) + +## [v1.0.2](https://github.com/ljharb/side-channel/compare/v1.0.1...v1.0.2) - 2019-12-20 + +### Commits + +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`4a526df`](https://github.com/ljharb/side-channel/commit/4a526df44e4701566ed001ec78546193f818b082) +- [Deps] update `es-abstract` [`d4f6e62`](https://github.com/ljharb/side-channel/commit/d4f6e629b6fb93a07415db7f30d3c90fd7f264fe) + +## [v1.0.1](https://github.com/ljharb/side-channel/compare/v1.0.0...v1.0.1) - 2019-12-01 + +### Commits + +- [Fix] add missing "exports" [`d212907`](https://github.com/ljharb/side-channel/commit/d2129073abf0701a5343bf28aa2145617604dc2e) + +## v1.0.0 - 2019-12-01 + +### Commits + +- Initial implementation [`dbebd3a`](https://github.com/ljharb/side-channel/commit/dbebd3a4b5ed64242f9a6810efe7c4214cd8cde4) +- Initial tests [`73bdefe`](https://github.com/ljharb/side-channel/commit/73bdefe568c9076cf8c0b8719bc2141aec0e19b8) +- Initial commit [`43c03e1`](https://github.com/ljharb/side-channel/commit/43c03e1c2849ec50a87b7a5cd76238a62b0b8770) +- npm init [`5c090a7`](https://github.com/ljharb/side-channel/commit/5c090a765d66a5527d9889b89aeff78dee91348c) +- [meta] add `auto-changelog` [`a5c4e56`](https://github.com/ljharb/side-channel/commit/a5c4e5675ec02d5eb4d84b4243aeea2a1d38fbec) +- [actions] add automatic rebasing / merge commit blocking [`bab1683`](https://github.com/ljharb/side-channel/commit/bab1683d8f9754b086e94397699fdc645e0d7077) +- [meta] add `funding` field; create FUNDING.yml [`63d7aea`](https://github.com/ljharb/side-channel/commit/63d7aeaf34f5650650ae97ca4b9fae685bd0937c) +- [Tests] add `npm run lint` [`46a5a81`](https://github.com/ljharb/side-channel/commit/46a5a81705cd2664f83df232c01dbbf2ee952885) +- Only apps should have lockfiles [`8b16b03`](https://github.com/ljharb/side-channel/commit/8b16b0305f00895d90c4e2e5773c854cfea0e448) +- [meta] add `safe-publish-latest` [`2f098ef`](https://github.com/ljharb/side-channel/commit/2f098ef092a39399cfe548b19a1fc03c2fd2f490) diff --git a/node_modules/side-channel/LICENSE b/node_modules/side-channel/LICENSE new file mode 100644 index 0000000..3900dd7 --- /dev/null +++ b/node_modules/side-channel/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/side-channel/README.md b/node_modules/side-channel/README.md new file mode 100644 index 0000000..cc7e103 --- /dev/null +++ b/node_modules/side-channel/README.md @@ -0,0 +1,61 @@ +# side-channel [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Store information about any JS value in a side channel. Uses WeakMap if available. + +Warning: in an environment that lacks `WeakMap`, this implementation will leak memory until you `delete` the `key`. + +## Getting started + +```sh +npm install --save side-channel +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const getSideChannel = require('side-channel'); + +const channel = getSideChannel(); + +const key = {}; +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); + +channel.set(key, 42); + +channel.assert(key); // does not throw +assert.equal(channel.has(key), true); +assert.equal(channel.get(key), 42); + +channel.delete(key); +assert.equal(channel.has(key), false); +assert.throws(() => channel.assert(key), TypeError); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/side-channel +[npm-version-svg]: https://versionbadg.es/ljharb/side-channel.svg +[deps-svg]: https://david-dm.org/ljharb/side-channel.svg +[deps-url]: https://david-dm.org/ljharb/side-channel +[dev-deps-svg]: https://david-dm.org/ljharb/side-channel/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/side-channel#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/side-channel.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/side-channel.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/side-channel.svg +[downloads-url]: https://npm-stat.com/charts.html?package=side-channel +[codecov-image]: https://codecov.io/gh/ljharb/side-channel/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/side-channel/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/side-channel +[actions-url]: https://github.com/ljharb/side-channel/actions diff --git a/node_modules/side-channel/index.d.ts b/node_modules/side-channel/index.d.ts new file mode 100644 index 0000000..18c6317 --- /dev/null +++ b/node_modules/side-channel/index.d.ts @@ -0,0 +1,14 @@ +import getSideChannelList from 'side-channel-list'; +import getSideChannelMap from 'side-channel-map'; +import getSideChannelWeakMap from 'side-channel-weakmap'; + +declare namespace getSideChannel { + type Channel = + | getSideChannelList.Channel + | ReturnType, false>> + | ReturnType, false>>; +} + +declare function getSideChannel(): getSideChannel.Channel; + +export = getSideChannel; diff --git a/node_modules/side-channel/index.js b/node_modules/side-channel/index.js new file mode 100644 index 0000000..a8a9b05 --- /dev/null +++ b/node_modules/side-channel/index.js @@ -0,0 +1,43 @@ +'use strict'; + +var $TypeError = require('es-errors/type'); +var inspect = require('object-inspect'); +var getSideChannelList = require('side-channel-list'); +var getSideChannelMap = require('side-channel-map'); +var getSideChannelWeakMap = require('side-channel-weakmap'); + +var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; + +/** @type {import('.')} */ +module.exports = function getSideChannel() { + /** @typedef {ReturnType} Channel */ + + /** @type {Channel | undefined} */ var $channelData; + + /** @type {Channel} */ + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + return !!$channelData && $channelData['delete'](key); + }, + get: function (key) { + return $channelData && $channelData.get(key); + }, + has: function (key) { + return !!$channelData && $channelData.has(key); + }, + set: function (key, value) { + if (!$channelData) { + $channelData = makeChannel(); + } + + $channelData.set(key, value); + } + }; + // @ts-expect-error TODO: figure out why this is erroring + return channel; +}; diff --git a/node_modules/side-channel/package.json b/node_modules/side-channel/package.json new file mode 100644 index 0000000..30fa42c --- /dev/null +++ b/node_modules/side-channel/package.json @@ -0,0 +1,85 @@ +{ + "name": "side-channel", + "version": "1.1.0", + "description": "Store information about any JS value in a side channel. Uses WeakMap if available.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "types": "./index.d.ts", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/side-channel.git" + }, + "keywords": [ + "weakmap", + "map", + "side", + "channel", + "metadata" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/side-channel/issues" + }, + "homepage": "https://github.com/ljharb/side-channel#readme", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.6.5", + "auto-changelog": "^2.5.0", + "eclint": "^2.8.1", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/side-channel/test/index.js b/node_modules/side-channel/test/index.js new file mode 100644 index 0000000..bd1e7c2 --- /dev/null +++ b/node_modules/side-channel/test/index.js @@ -0,0 +1,104 @@ +'use strict'; + +var test = require('tape'); + +var getSideChannel = require('../'); + +test('getSideChannel', function (t) { + t.test('export', function (st) { + st.equal(typeof getSideChannel, 'function', 'is a function'); + + st.equal(getSideChannel.length, 0, 'takes no arguments'); + + var channel = getSideChannel(); + st.ok(channel, 'is truthy'); + st.equal(typeof channel, 'object', 'is an object'); + st.end(); + }); + + t.test('assert', function (st) { + var channel = getSideChannel(); + st['throws']( + function () { channel.assert({}); }, + TypeError, + 'nonexistent value throws' + ); + + var o = {}; + channel.set(o, 'data'); + st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); + + st.end(); + }); + + t.test('has', function (st) { + var channel = getSideChannel(); + /** @type {unknown[]} */ var o = []; + + st.equal(channel.has(o), false, 'nonexistent value yields false'); + + channel.set(o, 'foo'); + st.equal(channel.has(o), true, 'existent value yields true'); + + st.equal(channel.has('abc'), false, 'non object value non existent yields false'); + + channel.set('abc', 'foo'); + st.equal(channel.has('abc'), true, 'non object value that exists yields true'); + + st.end(); + }); + + t.test('get', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); + + var data = {}; + channel.set(o, data); + st.equal(channel.get(o), data, '"get" yields data set by "set"'); + + st.end(); + }); + + t.test('set', function (st) { + var channel = getSideChannel(); + var o = function () {}; + st.equal(channel.get(o), undefined, 'value not set'); + + channel.set(o, 42); + st.equal(channel.get(o), 42, 'value was set'); + + channel.set(o, Infinity); + st.equal(channel.get(o), Infinity, 'value was set again'); + + var o2 = {}; + channel.set(o2, 17); + st.equal(channel.get(o), Infinity, 'o is not modified'); + st.equal(channel.get(o2), 17, 'o2 is set'); + + channel.set(o, 14); + st.equal(channel.get(o), 14, 'o is modified'); + st.equal(channel.get(o2), 17, 'o2 is not modified'); + + st.end(); + }); + + t.test('delete', function (st) { + var channel = getSideChannel(); + var o = {}; + st.equal(channel['delete']({}), false, 'nonexistent value yields false'); + + channel.set(o, 42); + st.equal(channel.has(o), true, 'value is set'); + + st.equal(channel['delete']({}), false, 'nonexistent value still yields false'); + + st.equal(channel['delete'](o), true, 'deleted value yields true'); + + st.equal(channel.has(o), false, 'value is no longer set'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/side-channel/tsconfig.json b/node_modules/side-channel/tsconfig.json new file mode 100644 index 0000000..d9a6668 --- /dev/null +++ b/node_modules/side-channel/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "es2021", + }, + "exclude": [ + "coverage", + ], +} diff --git a/node_modules/signal-exit/LICENSE.txt b/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 0000000..954f2fa --- /dev/null +++ b/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/signal-exit/README.md b/node_modules/signal-exit/README.md new file mode 100644 index 0000000..c55cd45 --- /dev/null +++ b/node_modules/signal-exit/README.md @@ -0,0 +1,74 @@ +# signal-exit + +When you want to fire an event no matter how a process exits: + +- reaching the end of execution. +- explicitly having `process.exit(code)` called. +- having `process.kill(pid, sig)` called. +- receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +// Hybrid module, either works +import { onExit } from 'signal-exit' +// or: +// const { onExit } = require('signal-exit') + +onExit((code, signal) => { + console.log('process exited!', code, signal) +}) +``` + +## API + +`remove = onExit((code, signal) => {}, options)` + +The return value of the function is a function that will remove +the handler. + +Note that the function _only_ fires for signals if the signal +would cause the process to exit. That is, there are no other +listeners, and it is a fatal signal. + +If the global `process` object is not suitable for this purpose +(ie, it's unset, or doesn't have an `emit` method, etc.) then the +`onExit` function is a no-op that returns a no-op `remove` method. + +### Options + +- `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. + +### Capturing Signal Exits + +If the handler returns an exact boolean `true`, and the exit is a +due to signal, then the signal will be considered handled, and +will _not_ trigger a synthetic `process.kill(process.pid, +signal)` after firing the `onExit` handlers. + +In this case, it your responsibility as the caller to exit with a +signal (for example, by calling `process.kill()`) if you wish to +preserve the same exit status that would otherwise have occurred. +If you do not, then the process will likely exit gracefully with +status 0 at some point, assuming that no other terminating signal +or other exit trigger occurs. + +Prior to calling handlers, the `onExit` machinery is unloaded, so +any subsequent exits or signals will not be handled, even if the +signal is captured and the exit is thus prevented. + +Note that numeric code exits may indicate that the process is +already committed to exiting, for example due to a fatal +exception or unhandled promise rejection, and so there is no way to +prevent it safely. + +### Browser Fallback + +The `'signal-exit/browser'` module is the same fallback shim that +just doesn't do anything, but presents the same function +interface. + +Patches welcome to add something that hooks onto +`window.onbeforeunload` or similar, but it might just not be a +thing that makes sense there. diff --git a/node_modules/signal-exit/dist/cjs/browser.d.ts b/node_modules/signal-exit/dist/cjs/browser.d.ts new file mode 100644 index 0000000..90f2e3f --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.d.ts @@ -0,0 +1,12 @@ +/** + * This is a browser shim that provides the same functional interface + * as the main node export, but it does nothing. + * @module + */ +import type { Handler } from './index.js'; +export declare const onExit: (cb: Handler, opts: { + alwaysLast?: boolean; +}) => () => void; +export declare const load: () => void; +export declare const unload: () => void; +//# sourceMappingURL=browser.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.d.ts.map b/node_modules/signal-exit/dist/cjs/browser.d.ts.map new file mode 100644 index 0000000..aacc1d3 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.js b/node_modules/signal-exit/dist/cjs/browser.js new file mode 100644 index 0000000..614fbf0 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unload = exports.load = exports.onExit = void 0; +const onExit = () => () => { }; +exports.onExit = onExit; +const load = () => { }; +exports.load = load; +const unload = () => { }; +exports.unload = unload; +//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/browser.js.map b/node_modules/signal-exit/dist/cjs/browser.js.map new file mode 100644 index 0000000..342cf2e --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":";;;AAMO,MAAM,MAAM,GAGD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AAHnB,QAAA,MAAM,UAGa;AACzB,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAf,QAAA,IAAI,QAAW;AACrB,MAAM,MAAM,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAAjB,QAAA,MAAM,UAAW","sourcesContent":["/**\n * This is a browser shim that provides the same functional interface\n * as the main node export, but it does nothing.\n * @module\n */\nimport type { Handler } from './index.js'\nexport const onExit: (\n cb: Handler,\n opts: { alwaysLast?: boolean }\n) => () => void = () => () => {}\nexport const load = () => {}\nexport const unload = () => {}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.d.ts b/node_modules/signal-exit/dist/cjs/index.d.ts new file mode 100644 index 0000000..cabe9cf --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.d.ts @@ -0,0 +1,48 @@ +/// +import { signals } from './signals.js'; +export { signals }; +/** + * A function that takes an exit code and signal as arguments + * + * In the case of signal exits *only*, a return value of true + * will indicate that the signal is being handled, and we should + * not synthetically exit with the signal we received. Regardless + * of the handler return value, the handler is unloaded when an + * otherwise fatal signal is received, so you get exactly 1 shot + * at it, unless you add another onExit handler at that point. + * + * In the case of numeric code exits, we may already have committed + * to exiting the process, for example via a fatal exception or + * unhandled promise rejection, so it is impossible to stop safely. + */ +export type Handler = (code: number | null | undefined, signal: NodeJS.Signals | null) => true | void; +export declare const +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit: (cb: Handler, opts?: { + alwaysLast?: boolean | undefined; +} | undefined) => () => void, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load: () => void, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload: () => void; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.d.ts.map b/node_modules/signal-exit/dist/cjs/index.d.ts.map new file mode 100644 index 0000000..f84594e --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAuBlB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAC1B,IAAI,GAAG,IAAI,CAAA;AA8QhB,eAAO;AACL;;;;;;;;GAQG;AACH,MAAM,OAzMO,OAAO;;wBAPiD,IAAI;AAkNzE;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,YAGP,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.js b/node_modules/signal-exit/dist/cjs/index.js new file mode 100644 index 0000000..797e674 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.js @@ -0,0 +1,279 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unload = exports.load = exports.onExit = exports.signals = void 0; +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +const signals_js_1 = require("./signals.js"); +Object.defineProperty(exports, "signals", { enumerable: true, get: function () { return signals_js_1.signals; } }); +const processOk = (process) => !!process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function'; +const kExitEmitter = Symbol.for('signal-exit emitter'); +const global = globalThis; +const ObjectDefineProperty = Object.defineProperty.bind(Object); +// teeny special purpose ee +class Emitter { + emitted = { + afterExit: false, + exit: false, + }; + listeners = { + afterExit: [], + exit: [], + }; + count = 0; + id = Math.random(); + constructor() { + if (global[kExitEmitter]) { + return global[kExitEmitter]; + } + ObjectDefineProperty(global, kExitEmitter, { + value: this, + writable: false, + enumerable: false, + configurable: false, + }); + } + on(ev, fn) { + this.listeners[ev].push(fn); + } + removeListener(ev, fn) { + const list = this.listeners[ev]; + const i = list.indexOf(fn); + /* c8 ignore start */ + if (i === -1) { + return; + } + /* c8 ignore stop */ + if (i === 0 && list.length === 1) { + list.length = 0; + } + else { + list.splice(i, 1); + } + } + emit(ev, code, signal) { + if (this.emitted[ev]) { + return false; + } + this.emitted[ev] = true; + let ret = false; + for (const fn of this.listeners[ev]) { + ret = fn(code, signal) === true || ret; + } + if (ev === 'exit') { + ret = this.emit('afterExit', code, signal) || ret; + } + return ret; + } +} +class SignalExitBase { +} +const signalExitWrap = (handler) => { + return { + onExit(cb, opts) { + return handler.onExit(cb, opts); + }, + load() { + return handler.load(); + }, + unload() { + return handler.unload(); + }, + }; +}; +class SignalExitFallback extends SignalExitBase { + onExit() { + return () => { }; + } + load() { } + unload() { } +} +class SignalExit extends SignalExitBase { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + /* c8 ignore start */ + #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; + /* c8 ignore stop */ + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process) { + super(); + this.#process = process; + // { : , ... } + this.#sigListeners = {}; + for (const sig of signals_js_1.signals) { + this.#sigListeners[sig] = () => { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + const listeners = this.#process.listeners(sig); + let { count } = this.#emitter; + // This is a workaround for the fact that signal-exit v3 and signal + // exit v4 are not aware of each other, and each will attempt to let + // the other handle it, so neither of them do. To correct this, we + // detect if we're the only handler *except* for previous versions + // of signal-exit, and increment by the count of listeners it has + // created. + /* c8 ignore start */ + const p = process; + if (typeof p.__signal_exit_emitter__ === 'object' && + typeof p.__signal_exit_emitter__.count === 'number') { + count += p.__signal_exit_emitter__.count; + } + /* c8 ignore stop */ + if (listeners.length === count) { + this.unload(); + const ret = this.#emitter.emit('exit', null, sig); + /* c8 ignore start */ + const s = sig === 'SIGHUP' ? this.#hupSig : sig; + if (!ret) + process.kill(process.pid, s); + /* c8 ignore stop */ + } + }; + } + this.#originalProcessReallyExit = process.reallyExit; + this.#originalProcessEmit = process.emit; + } + onExit(cb, opts) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return () => { }; + } + /* c8 ignore stop */ + if (this.#loaded === false) { + this.load(); + } + const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; + this.#emitter.on(ev, cb); + return () => { + this.#emitter.removeListener(ev, cb); + if (this.#emitter.listeners['exit'].length === 0 && + this.#emitter.listeners['afterExit'].length === 0) { + this.unload(); + } + }; + } + load() { + if (this.#loaded) { + return; + } + this.#loaded = true; + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + this.#emitter.count += 1; + for (const sig of signals_js_1.signals) { + try { + const fn = this.#sigListeners[sig]; + if (fn) + this.#process.on(sig, fn); + } + catch (_) { } + } + this.#process.emit = (ev, ...a) => { + return this.#processEmit(ev, ...a); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) { + return; + } + this.#loaded = false; + signals_js_1.signals.forEach(sig => { + const listener = this.#sigListeners[sig]; + /* c8 ignore start */ + if (!listener) { + throw new Error('Listener not defined for signal: ' + sig); + } + /* c8 ignore stop */ + try { + this.#process.removeListener(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return 0; + } + this.#process.exitCode = code || 0; + /* c8 ignore stop */ + this.#emitter.emit('exit', this.#process.exitCode, null); + return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + } + #processEmit(ev, ...args) { + const og = this.#originalProcessEmit; + if (ev === 'exit' && processOk(this.#process)) { + if (typeof args[0] === 'number') { + this.#process.exitCode = args[0]; + /* c8 ignore start */ + } + /* c8 ignore start */ + const ret = og.call(this.#process, ev, ...args); + /* c8 ignore start */ + this.#emitter.emit('exit', this.#process.exitCode, null); + /* c8 ignore stop */ + return ret; + } + else { + return og.call(this.#process, ev, ...args); + } + } +} +const process = globalThis.process; +// wrap so that we call the method on the actual handler, without +// exporting it directly. +_a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +exports.onExit = _a.onExit, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +exports.load = _a.load, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +exports.unload = _a.unload; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/index.js.map b/node_modules/signal-exit/dist/cjs/index.js.map new file mode 100644 index 0000000..528e3cc --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,iEAAiE;AACjE,+DAA+D;AAC/D,qDAAqD;AACrD,4DAA4D;AAC5D,6CAAsC;AAC7B,wFADA,oBAAO,OACA;AAQhB,MAAM,SAAS,GAAG,CAAC,OAAY,EAAwB,EAAE,CACvD,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,cAAc,KAAK,UAAU;IAC5C,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,UAAU,KAAK,UAAU;IACxC,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU;IACvC,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;IAC/B,OAAO,OAAO,CAAC,EAAE,KAAK,UAAU,CAAA;AAElC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AACtD,MAAM,MAAM,GAAqD,UAAU,CAAA;AAC3E,MAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MA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,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAA;SAC3C;IACH,CAAC;CACF;AAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;AAClC,iEAAiE;AACjE,yBAAyB;AACZ,KA6BT,cAAc,CAChB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,EAAE,CACxE;AA9BC;;;;;;;;GAQG;AACH,cAAM;AAEN;;;;;;GAMG;AACH,YAAI;AAEJ;;;;;;GAMG;AACH,cAAM,aAGP","sourcesContent":["// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n *\n * In the case of signal exits *only*, a return value of true\n * will indicate that the signal is being handled, and we should\n * not synthetically exit with the signal we received. Regardless\n * of the handler return value, the handler is unloaded when an\n * otherwise fatal signal is received, so you get exactly 1 shot\n * at it, unless you add another onExit handler at that point.\n *\n * In the case of numeric code exits, we may already have committed\n * to exiting the process, for example via a fatal exception or\n * unhandled promise rejection, so it is impossible to stop safely.\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => true | void\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny special purpose ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ): boolean {\n if (this.emitted[ev]) {\n return false\n }\n this.emitted[ev] = true\n let ret: boolean = false\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret\n }\n return ret\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = (handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { : , ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process as unknown as {\n __signal_exit_emitter__?: { count: number }\n }\n if (\n typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number'\n ) {\n count += p.__signal_exit_emitter__.count\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n const ret = this.#emitter.emit('exit', null, sig)\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig\n if (!ret) process.kill(process.pid, s)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/package.json b/node_modules/signal-exit/dist/cjs/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/signal-exit/dist/cjs/signals.d.ts b/node_modules/signal-exit/dist/cjs/signals.d.ts new file mode 100644 index 0000000..3f01ef0 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.d.ts @@ -0,0 +1,29 @@ +/// +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +export declare const signals: NodeJS.Signals[]; +//# sourceMappingURL=signals.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.d.ts.map b/node_modules/signal-exit/dist/cjs/signals.d.ts.map new file mode 100644 index 0000000..891fe1e --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,OAAO,EAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.js b/node_modules/signal-exit/dist/cjs/signals.js new file mode 100644 index 0000000..28afc50 --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.signals = void 0; +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +exports.signals = []; +exports.signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); +if (process.platform !== 'win32') { + exports.signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); +} +if (process.platform === 'linux') { + exports.signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); +} +//# sourceMappingURL=signals.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/cjs/signals.js.map b/node_modules/signal-exit/dist/cjs/signals.js.map new file mode 100644 index 0000000..78c613f --- /dev/null +++ b/node_modules/signal-exit/dist/cjs/signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACU,QAAA,OAAO,GAAqB,EAAE,CAAA;AAC3C,eAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAE3C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,eAAO,CAAC,IAAI,CACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ;IACR,yDAAyD;IACzD,UAAU;IACV,YAAY;KACb,CAAA;CACF;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,eAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;CACxD","sourcesContent":["/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.d.ts b/node_modules/signal-exit/dist/mjs/browser.d.ts new file mode 100644 index 0000000..90f2e3f --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.d.ts @@ -0,0 +1,12 @@ +/** + * This is a browser shim that provides the same functional interface + * as the main node export, but it does nothing. + * @module + */ +import type { Handler } from './index.js'; +export declare const onExit: (cb: Handler, opts: { + alwaysLast?: boolean; +}) => () => void; +export declare const load: () => void; +export declare const unload: () => void; +//# sourceMappingURL=browser.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.d.ts.map b/node_modules/signal-exit/dist/mjs/browser.d.ts.map new file mode 100644 index 0000000..aacc1d3 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,eAAO,MAAM,MAAM,EAAE,CACnB,EAAE,EAAE,OAAO,EACX,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,KAC3B,MAAM,IAAqB,CAAA;AAChC,eAAO,MAAM,IAAI,YAAW,CAAA;AAC5B,eAAO,MAAM,MAAM,YAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.js b/node_modules/signal-exit/dist/mjs/browser.js new file mode 100644 index 0000000..9c5f9b9 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.js @@ -0,0 +1,4 @@ +export const onExit = () => () => { }; +export const load = () => { }; +export const unload = () => { }; +//# sourceMappingURL=browser.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/browser.js.map b/node_modules/signal-exit/dist/mjs/browser.js.map new file mode 100644 index 0000000..b3ff303 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,MAAM,GAGD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AAChC,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AAC5B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA","sourcesContent":["/**\n * This is a browser shim that provides the same functional interface\n * as the main node export, but it does nothing.\n * @module\n */\nimport type { Handler } from './index.js'\nexport const onExit: (\n cb: Handler,\n opts: { alwaysLast?: boolean }\n) => () => void = () => () => {}\nexport const load = () => {}\nexport const unload = () => {}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.d.ts b/node_modules/signal-exit/dist/mjs/index.d.ts new file mode 100644 index 0000000..cabe9cf --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.d.ts @@ -0,0 +1,48 @@ +/// +import { signals } from './signals.js'; +export { signals }; +/** + * A function that takes an exit code and signal as arguments + * + * In the case of signal exits *only*, a return value of true + * will indicate that the signal is being handled, and we should + * not synthetically exit with the signal we received. Regardless + * of the handler return value, the handler is unloaded when an + * otherwise fatal signal is received, so you get exactly 1 shot + * at it, unless you add another onExit handler at that point. + * + * In the case of numeric code exits, we may already have committed + * to exiting the process, for example via a fatal exception or + * unhandled promise rejection, so it is impossible to stop safely. + */ +export type Handler = (code: number | null | undefined, signal: NodeJS.Signals | null) => true | void; +export declare const +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit: (cb: Handler, opts?: { + alwaysLast?: boolean | undefined; +} | undefined) => () => void, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load: () => void, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload: () => void; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.d.ts.map b/node_modules/signal-exit/dist/mjs/index.d.ts.map new file mode 100644 index 0000000..f84594e --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAuBlB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,OAAO,GAAG,CACpB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAC1B,IAAI,GAAG,IAAI,CAAA;AA8QhB,eAAO;AACL;;;;;;;;GAQG;AACH,MAAM,OAzMO,OAAO;;wBAPiD,IAAI;AAkNzE;;;;;;GAMG;AACH,IAAI;AAEJ;;;;;;GAMG;AACH,MAAM,YAGP,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.js b/node_modules/signal-exit/dist/mjs/index.js new file mode 100644 index 0000000..4a78bad --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.js @@ -0,0 +1,275 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +import { signals } from './signals.js'; +export { signals }; +const processOk = (process) => !!process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function'; +const kExitEmitter = Symbol.for('signal-exit emitter'); +const global = globalThis; +const ObjectDefineProperty = Object.defineProperty.bind(Object); +// teeny special purpose ee +class Emitter { + emitted = { + afterExit: false, + exit: false, + }; + listeners = { + afterExit: [], + exit: [], + }; + count = 0; + id = Math.random(); + constructor() { + if (global[kExitEmitter]) { + return global[kExitEmitter]; + } + ObjectDefineProperty(global, kExitEmitter, { + value: this, + writable: false, + enumerable: false, + configurable: false, + }); + } + on(ev, fn) { + this.listeners[ev].push(fn); + } + removeListener(ev, fn) { + const list = this.listeners[ev]; + const i = list.indexOf(fn); + /* c8 ignore start */ + if (i === -1) { + return; + } + /* c8 ignore stop */ + if (i === 0 && list.length === 1) { + list.length = 0; + } + else { + list.splice(i, 1); + } + } + emit(ev, code, signal) { + if (this.emitted[ev]) { + return false; + } + this.emitted[ev] = true; + let ret = false; + for (const fn of this.listeners[ev]) { + ret = fn(code, signal) === true || ret; + } + if (ev === 'exit') { + ret = this.emit('afterExit', code, signal) || ret; + } + return ret; + } +} +class SignalExitBase { +} +const signalExitWrap = (handler) => { + return { + onExit(cb, opts) { + return handler.onExit(cb, opts); + }, + load() { + return handler.load(); + }, + unload() { + return handler.unload(); + }, + }; +}; +class SignalExitFallback extends SignalExitBase { + onExit() { + return () => { }; + } + load() { } + unload() { } +} +class SignalExit extends SignalExitBase { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + /* c8 ignore start */ + #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'; + /* c8 ignore stop */ + #emitter = new Emitter(); + #process; + #originalProcessEmit; + #originalProcessReallyExit; + #sigListeners = {}; + #loaded = false; + constructor(process) { + super(); + this.#process = process; + // { : , ... } + this.#sigListeners = {}; + for (const sig of signals) { + this.#sigListeners[sig] = () => { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + const listeners = this.#process.listeners(sig); + let { count } = this.#emitter; + // This is a workaround for the fact that signal-exit v3 and signal + // exit v4 are not aware of each other, and each will attempt to let + // the other handle it, so neither of them do. To correct this, we + // detect if we're the only handler *except* for previous versions + // of signal-exit, and increment by the count of listeners it has + // created. + /* c8 ignore start */ + const p = process; + if (typeof p.__signal_exit_emitter__ === 'object' && + typeof p.__signal_exit_emitter__.count === 'number') { + count += p.__signal_exit_emitter__.count; + } + /* c8 ignore stop */ + if (listeners.length === count) { + this.unload(); + const ret = this.#emitter.emit('exit', null, sig); + /* c8 ignore start */ + const s = sig === 'SIGHUP' ? this.#hupSig : sig; + if (!ret) + process.kill(process.pid, s); + /* c8 ignore stop */ + } + }; + } + this.#originalProcessReallyExit = process.reallyExit; + this.#originalProcessEmit = process.emit; + } + onExit(cb, opts) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return () => { }; + } + /* c8 ignore stop */ + if (this.#loaded === false) { + this.load(); + } + const ev = opts?.alwaysLast ? 'afterExit' : 'exit'; + this.#emitter.on(ev, cb); + return () => { + this.#emitter.removeListener(ev, cb); + if (this.#emitter.listeners['exit'].length === 0 && + this.#emitter.listeners['afterExit'].length === 0) { + this.unload(); + } + }; + } + load() { + if (this.#loaded) { + return; + } + this.#loaded = true; + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + this.#emitter.count += 1; + for (const sig of signals) { + try { + const fn = this.#sigListeners[sig]; + if (fn) + this.#process.on(sig, fn); + } + catch (_) { } + } + this.#process.emit = (ev, ...a) => { + return this.#processEmit(ev, ...a); + }; + this.#process.reallyExit = (code) => { + return this.#processReallyExit(code); + }; + } + unload() { + if (!this.#loaded) { + return; + } + this.#loaded = false; + signals.forEach(sig => { + const listener = this.#sigListeners[sig]; + /* c8 ignore start */ + if (!listener) { + throw new Error('Listener not defined for signal: ' + sig); + } + /* c8 ignore stop */ + try { + this.#process.removeListener(sig, listener); + /* c8 ignore start */ + } + catch (_) { } + /* c8 ignore stop */ + }); + this.#process.emit = this.#originalProcessEmit; + this.#process.reallyExit = this.#originalProcessReallyExit; + this.#emitter.count -= 1; + } + #processReallyExit(code) { + /* c8 ignore start */ + if (!processOk(this.#process)) { + return 0; + } + this.#process.exitCode = code || 0; + /* c8 ignore stop */ + this.#emitter.emit('exit', this.#process.exitCode, null); + return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + } + #processEmit(ev, ...args) { + const og = this.#originalProcessEmit; + if (ev === 'exit' && processOk(this.#process)) { + if (typeof args[0] === 'number') { + this.#process.exitCode = args[0]; + /* c8 ignore start */ + } + /* c8 ignore start */ + const ret = og.call(this.#process, ev, ...args); + /* c8 ignore start */ + this.#emitter.emit('exit', this.#process.exitCode, null); + /* c8 ignore stop */ + return ret; + } + else { + return og.call(this.#process, ev, ...args); + } + } +} +const process = globalThis.process; +// wrap so that we call the method on the actual handler, without +// exporting it directly. +export const { +/** + * Called when the process is exiting, whether via signal, explicit + * exit, or running out of stuff to do. + * + * If the global process object is not suitable for instrumentation, + * then this will be a no-op. + * + * Returns a function that may be used to unload signal-exit. + */ +onExit, +/** + * Load the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +load, +/** + * Unload the listeners. Likely you never need to call this, unless + * doing a rather deep integration with signal-exit functionality. + * Mostly exposed for the benefit of testing. + * + * @internal + */ +unload, } = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/index.js.map b/node_modules/signal-exit/dist/mjs/index.js.map new file mode 100644 index 0000000..3a7b76d --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,+DAA+D;AAC/D,qDAAqD;AACrD,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAQlB,MAAM,SAAS,GAAG,CAAC,OAAY,EAAwB,EAAE,CACvD,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,cAAc,KAAK,UAAU;IAC5C,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,UAAU,KAAK,UAAU;IACxC,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU;IACvC,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;IAC/B,OAAO,OAAO,CAAC,EAAE,KAAK,UAAU,CAAA;AAElC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AACtD,MAAM,MAAM,GAAqD,UAAU,CAAA;AAC3E,MAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAwB/D,2BAA2B;AAC3B,MAAM,OAAO;IACX,OAAO,GAAY;QACjB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,KAAK;KACZ,CAAA;IAED,SAAS,GAAc;QACrB,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,EAAE;KACT,CAAA;IAED,KAAK,GAAW,CAAC,CAAA;IACjB,EAAE,GAA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AEJ;;;;;;GAMG;AACH,MAAM,GACP,GAAG,cAAc,CAChB,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,kBAAkB,EAAE,CACxE,CAAA","sourcesContent":["// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nimport { signals } from './signals.js'\nexport { signals }\n\n// just a loosened process type so we can do some evil things\ntype ProcessRE = NodeJS.Process & {\n reallyExit: (code?: number | undefined | null) => any\n emit: (ev: string, ...a: any[]) => any\n}\n\nconst processOk = (process: any): process is ProcessRE =>\n !!process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n\nconst kExitEmitter = Symbol.for('signal-exit emitter')\nconst global: typeof globalThis & { [kExitEmitter]?: Emitter } = globalThis\nconst ObjectDefineProperty = Object.defineProperty.bind(Object)\n\n/**\n * A function that takes an exit code and signal as arguments\n *\n * In the case of signal exits *only*, a return value of true\n * will indicate that the signal is being handled, and we should\n * not synthetically exit with the signal we received. Regardless\n * of the handler return value, the handler is unloaded when an\n * otherwise fatal signal is received, so you get exactly 1 shot\n * at it, unless you add another onExit handler at that point.\n *\n * In the case of numeric code exits, we may already have committed\n * to exiting the process, for example via a fatal exception or\n * unhandled promise rejection, so it is impossible to stop safely.\n */\nexport type Handler = (\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n) => true | void\ntype ExitEvent = 'afterExit' | 'exit'\ntype Emitted = { [k in ExitEvent]: boolean }\ntype Listeners = { [k in ExitEvent]: Handler[] }\n\n// teeny special purpose ee\nclass Emitter {\n emitted: Emitted = {\n afterExit: false,\n exit: false,\n }\n\n listeners: Listeners = {\n afterExit: [],\n exit: [],\n }\n\n count: number = 0\n id: number = Math.random()\n\n constructor() {\n if (global[kExitEmitter]) {\n return global[kExitEmitter]\n }\n ObjectDefineProperty(global, kExitEmitter, {\n value: this,\n writable: false,\n enumerable: false,\n configurable: false,\n })\n }\n\n on(ev: ExitEvent, fn: Handler) {\n this.listeners[ev].push(fn)\n }\n\n removeListener(ev: ExitEvent, fn: Handler) {\n const list = this.listeners[ev]\n const i = list.indexOf(fn)\n /* c8 ignore start */\n if (i === -1) {\n return\n }\n /* c8 ignore stop */\n if (i === 0 && list.length === 1) {\n list.length = 0\n } else {\n list.splice(i, 1)\n }\n }\n\n emit(\n ev: ExitEvent,\n code: number | null | undefined,\n signal: NodeJS.Signals | null\n ): boolean {\n if (this.emitted[ev]) {\n return false\n }\n this.emitted[ev] = true\n let ret: boolean = false\n for (const fn of this.listeners[ev]) {\n ret = fn(code, signal) === true || ret\n }\n if (ev === 'exit') {\n ret = this.emit('afterExit', code, signal) || ret\n }\n return ret\n }\n}\n\nabstract class SignalExitBase {\n abstract onExit(cb: Handler, opts?: { alwaysLast?: boolean }): () => void\n abstract load(): void\n abstract unload(): void\n}\n\nconst signalExitWrap = (handler: T) => {\n return {\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n return handler.onExit(cb, opts)\n },\n load() {\n return handler.load()\n },\n unload() {\n return handler.unload()\n },\n }\n}\n\nclass SignalExitFallback extends SignalExitBase {\n onExit() {\n return () => {}\n }\n load() {}\n unload() {}\n}\n\nclass SignalExit extends SignalExitBase {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n /* c8 ignore start */\n #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP'\n /* c8 ignore stop */\n #emitter = new Emitter()\n #process: ProcessRE\n #originalProcessEmit: ProcessRE['emit']\n #originalProcessReallyExit: ProcessRE['reallyExit']\n\n #sigListeners: { [k in NodeJS.Signals]?: () => void } = {}\n #loaded: boolean = false\n\n constructor(process: ProcessRE) {\n super()\n this.#process = process\n // { : , ... }\n this.#sigListeners = {}\n for (const sig of signals) {\n this.#sigListeners[sig] = () => {\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n const listeners = this.#process.listeners(sig)\n let { count } = this.#emitter\n // This is a workaround for the fact that signal-exit v3 and signal\n // exit v4 are not aware of each other, and each will attempt to let\n // the other handle it, so neither of them do. To correct this, we\n // detect if we're the only handler *except* for previous versions\n // of signal-exit, and increment by the count of listeners it has\n // created.\n /* c8 ignore start */\n const p = process as unknown as {\n __signal_exit_emitter__?: { count: number }\n }\n if (\n typeof p.__signal_exit_emitter__ === 'object' &&\n typeof p.__signal_exit_emitter__.count === 'number'\n ) {\n count += p.__signal_exit_emitter__.count\n }\n /* c8 ignore stop */\n if (listeners.length === count) {\n this.unload()\n const ret = this.#emitter.emit('exit', null, sig)\n /* c8 ignore start */\n const s = sig === 'SIGHUP' ? this.#hupSig : sig\n if (!ret) process.kill(process.pid, s)\n /* c8 ignore stop */\n }\n }\n }\n\n this.#originalProcessReallyExit = process.reallyExit\n this.#originalProcessEmit = process.emit\n }\n\n onExit(cb: Handler, opts?: { alwaysLast?: boolean }) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return () => {}\n }\n /* c8 ignore stop */\n\n if (this.#loaded === false) {\n this.load()\n }\n\n const ev = opts?.alwaysLast ? 'afterExit' : 'exit'\n this.#emitter.on(ev, cb)\n return () => {\n this.#emitter.removeListener(ev, cb)\n if (\n this.#emitter.listeners['exit'].length === 0 &&\n this.#emitter.listeners['afterExit'].length === 0\n ) {\n this.unload()\n }\n }\n }\n\n load() {\n if (this.#loaded) {\n return\n }\n this.#loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n this.#emitter.count += 1\n\n for (const sig of signals) {\n try {\n const fn = this.#sigListeners[sig]\n if (fn) this.#process.on(sig, fn)\n } catch (_) {}\n }\n\n this.#process.emit = (ev: string, ...a: any[]) => {\n return this.#processEmit(ev, ...a)\n }\n this.#process.reallyExit = (code?: number | null | undefined) => {\n return this.#processReallyExit(code)\n }\n }\n\n unload() {\n if (!this.#loaded) {\n return\n }\n this.#loaded = false\n\n signals.forEach(sig => {\n const listener = this.#sigListeners[sig]\n /* c8 ignore start */\n if (!listener) {\n throw new Error('Listener not defined for signal: ' + sig)\n }\n /* c8 ignore stop */\n try {\n this.#process.removeListener(sig, listener)\n /* c8 ignore start */\n } catch (_) {}\n /* c8 ignore stop */\n })\n this.#process.emit = this.#originalProcessEmit\n this.#process.reallyExit = this.#originalProcessReallyExit\n this.#emitter.count -= 1\n }\n\n #processReallyExit(code?: number | null | undefined) {\n /* c8 ignore start */\n if (!processOk(this.#process)) {\n return 0\n }\n this.#process.exitCode = code || 0\n /* c8 ignore stop */\n\n this.#emitter.emit('exit', this.#process.exitCode, null)\n return this.#originalProcessReallyExit.call(\n this.#process,\n this.#process.exitCode\n )\n }\n\n #processEmit(ev: string, ...args: any[]): any {\n const og = this.#originalProcessEmit\n if (ev === 'exit' && processOk(this.#process)) {\n if (typeof args[0] === 'number') {\n this.#process.exitCode = args[0]\n /* c8 ignore start */\n }\n /* c8 ignore start */\n const ret = og.call(this.#process, ev, ...args)\n /* c8 ignore start */\n this.#emitter.emit('exit', this.#process.exitCode, null)\n /* c8 ignore stop */\n return ret\n } else {\n return og.call(this.#process, ev, ...args)\n }\n }\n}\n\nconst process = globalThis.process\n// wrap so that we call the method on the actual handler, without\n// exporting it directly.\nexport const {\n /**\n * Called when the process is exiting, whether via signal, explicit\n * exit, or running out of stuff to do.\n *\n * If the global process object is not suitable for instrumentation,\n * then this will be a no-op.\n *\n * Returns a function that may be used to unload signal-exit.\n */\n onExit,\n\n /**\n * Load the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n load,\n\n /**\n * Unload the listeners. Likely you never need to call this, unless\n * doing a rather deep integration with signal-exit functionality.\n * Mostly exposed for the benefit of testing.\n *\n * @internal\n */\n unload,\n} = signalExitWrap(\n processOk(process) ? new SignalExit(process) : new SignalExitFallback()\n)\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/package.json b/node_modules/signal-exit/dist/mjs/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/signal-exit/dist/mjs/signals.d.ts b/node_modules/signal-exit/dist/mjs/signals.d.ts new file mode 100644 index 0000000..3f01ef0 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.d.ts @@ -0,0 +1,29 @@ +/// +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +export declare const signals: NodeJS.Signals[]; +//# sourceMappingURL=signals.d.ts.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.d.ts.map b/node_modules/signal-exit/dist/mjs/signals.d.ts.map new file mode 100644 index 0000000..891fe1e --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.d.ts","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,OAAO,EAAO,CAAA"} \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.js b/node_modules/signal-exit/dist/mjs/signals.js new file mode 100644 index 0000000..7dbf15a --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.js @@ -0,0 +1,39 @@ +/** + * This is not the set of all possible signals. + * + * It IS, however, the set of all signals that trigger + * an exit on either Linux or BSD systems. Linux is a + * superset of the signal names supported on BSD, and + * the unknown signals just fail to register, so we can + * catch that easily enough. + * + * Windows signals are a different set, since there are + * signals that terminate Windows processes, but don't + * terminate (or don't even exist) on Posix systems. + * + * Don't bother with SIGKILL. It's uncatchable, which + * means that we can't fire any callbacks anyway. + * + * If a user does happen to register a handler on a non- + * fatal signal like SIGWINCH or something, and then + * exit, it'll end up firing `process.emit('exit')`, so + * the handler will be fired anyway. + * + * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised + * artificially, inherently leave the process in a + * state from which it is not safe to try and enter JS + * listeners. + */ +export const signals = []; +signals.push('SIGHUP', 'SIGINT', 'SIGTERM'); +if (process.platform !== 'win32') { + signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); +} +if (process.platform === 'linux') { + signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT'); +} +//# sourceMappingURL=signals.js.map \ No newline at end of file diff --git a/node_modules/signal-exit/dist/mjs/signals.js.map b/node_modules/signal-exit/dist/mjs/signals.js.map new file mode 100644 index 0000000..91008c9 --- /dev/null +++ b/node_modules/signal-exit/dist/mjs/signals.js.map @@ -0,0 +1 @@ +{"version":3,"file":"signals.js","sourceRoot":"","sources":["../../src/signals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAqB,EAAE,CAAA;AAC3C,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;AAE3C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ;IACR,yDAAyD;IACzD,UAAU;IACV,YAAY;KACb,CAAA;CACF;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;CACxD","sourcesContent":["/**\n * This is not the set of all possible signals.\n *\n * It IS, however, the set of all signals that trigger\n * an exit on either Linux or BSD systems. Linux is a\n * superset of the signal names supported on BSD, and\n * the unknown signals just fail to register, so we can\n * catch that easily enough.\n *\n * Windows signals are a different set, since there are\n * signals that terminate Windows processes, but don't\n * terminate (or don't even exist) on Posix systems.\n *\n * Don't bother with SIGKILL. It's uncatchable, which\n * means that we can't fire any callbacks anyway.\n *\n * If a user does happen to register a handler on a non-\n * fatal signal like SIGWINCH or something, and then\n * exit, it'll end up firing `process.emit('exit')`, so\n * the handler will be fired anyway.\n *\n * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n * artificially, inherently leave the process in a\n * state from which it is not safe to try and enter JS\n * listeners.\n */\nexport const signals: NodeJS.Signals[] = []\nsignals.push('SIGHUP', 'SIGINT', 'SIGTERM')\n\nif (process.platform !== 'win32') {\n signals.push(\n 'SIGALRM',\n 'SIGABRT',\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT')\n}\n"]} \ No newline at end of file diff --git a/node_modules/signal-exit/package.json b/node_modules/signal-exit/package.json new file mode 100644 index 0000000..ac176ce --- /dev/null +++ b/node_modules/signal-exit/package.json @@ -0,0 +1,106 @@ +{ + "name": "signal-exit", + "version": "4.1.0", + "description": "when you want to fire an event no matter how a process exits.", + "main": "./dist/cjs/index.js", + "module": "./dist/mjs/index.js", + "browser": "./dist/mjs/browser.js", + "types": "./dist/mjs/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/mjs/index.d.ts", + "default": "./dist/mjs/index.js" + }, + "require": { + "types": "./dist/cjs/index.d.ts", + "default": "./dist/cjs/index.js" + } + }, + "./signals": { + "import": { + "types": "./dist/mjs/signals.d.ts", + "default": "./dist/mjs/signals.js" + }, + "require": { + "types": "./dist/cjs/signals.d.ts", + "default": "./dist/cjs/signals.js" + } + }, + "./browser": { + "import": { + "types": "./dist/mjs/browser.d.ts", + "default": "./dist/mjs/browser.js" + }, + "require": { + "types": "./dist/cjs/browser.d.ts", + "default": "./dist/cjs/browser.js" + } + } + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=14" + }, + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, + "keywords": [ + "signal", + "exit" + ], + "author": "Ben Coe ", + "license": "ISC", + "devDependencies": { + "@types/cross-spawn": "^6.0.2", + "@types/node": "^18.15.11", + "@types/signal-exit": "^3.0.1", + "@types/tap": "^15.0.8", + "c8": "^7.13.0", + "prettier": "^2.8.6", + "tap": "^16.3.4", + "ts-node": "^10.9.1", + "typedoc": "^0.23.28", + "typescript": "^5.0.2" + }, + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preprepare": "rm -rf dist", + "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "c8 tap", + "snap": "c8 tap", + "format": "prettier --write . --loglevel warn", + "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts" + }, + "prettier": { + "semi": false, + "printWidth": 75, + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "jsxSingleQuote": false, + "bracketSameLine": true, + "arrowParens": "avoid", + "endOfLine": "lf" + }, + "tap": { + "coverage": false, + "jobs": 1, + "node-arg": [ + "--no-warnings", + "--loader", + "ts-node/esm" + ], + "ts": false + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/sinon/CONTRIBUTING.md b/node_modules/sinon/CONTRIBUTING.md new file mode 100644 index 0000000..9a71d50 --- /dev/null +++ b/node_modules/sinon/CONTRIBUTING.md @@ -0,0 +1,152 @@ +# Contributing to Sinon.JS + +There are several ways of contributing to Sinon.JS + +- Look into [issues tagged `help-wanted`](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+wanted%22) +- Help [improve the documentation](https://github.com/sinonjs/sinon/tree/master/docs) published + at [the Sinon.JS website](https://sinonjs.org). [Documentation issues](https://github.com/sinonjs/sinon/issues?q=is%3Aopen+is%3Aissue+label%3ADocumentation). +- Help someone understand and use Sinon.JS on [Stack Overflow](https://stackoverflow.com/questions/tagged/sinon) +- Report an issue, please read instructions below +- Help with triaging the [issues](https://github.com/sinonjs/sinon/issues). The clearer they are, the more likely they are to be fixed soon. +- Contribute to the code base. + +## Contributor Code of Conduct + +Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. + +## Reporting an issue + +To save everyone time and make it much more likely for your issue to be understood, worked on and resolved quickly, it would help if you're mindful of [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) when pressing the "Submit new issue" button. + +As a minimum, please report the following: + +- Which environment are you using? Browser? Node? Which version(s)? +- Which version of SinonJS? +- How are you loading SinonJS? +- What other libraries are you using? +- What you expected to happen +- What actually happens +- Describe **with code** how to reproduce the faulty behaviour + +See [our issue template](https://github.com/sinonjs/sinon/blob/master/.github/) for all details. + +## Contributing to the code base + +Pick [an issue](https://github.com/sinonjs/sinon/issues) to fix, or pitch +new features. To avoid wasting your time, please ask for feedback on feature +suggestions with [an issue](https://github.com/sinonjs/sinon/issues/new). + +Make sure you have read [GitHub's guide on forking](https://guides.github.com/activities/forking/). It explains the general contribution process and key concepts. + +### Making a pull request + +Please try to [write great commit messages](http://chris.beams.io/posts/git-commit/). + +There are numerous benefits to great commit messages + +- They allow Sinon.JS users to understand the consequences of updating to a newer version +- They help contributors understand what is going on with the codebase, allowing features and fixes to be developed faster +- They save maintainers time when compiling the changelog for a new release + +If you're already a few commits in by the time you read this, you can still [change your commit messages](https://help.github.com/articles/changing-a-commit-message/). + +Also, before making your pull request, consider if your commits make sense on their own (and potentially should be multiple pull requests) or if they can be squashed down to one commit (with a great message). There are no hard and fast rules about this, but being mindful of your readers greatly help you author good commits. + +### Use EditorConfig + +To save everyone some time, please use [EditorConfig](http://editorconfig.org), so your editor helps make +sure we all use the same encoding, indentation, line endings, etc. + +### Installation + +The Sinon.JS developer environment requires Node/NPM. Please make sure you have +Node installed, and install Sinon's dependencies: + + $ npm install + +This will also install a pre-commit hook, that runs style validation on staged files. + +### Compatibility + +For details on compatibility and browser support, please see [`COMPATIBILITY.md`](COMPATIBILITY.md) + +### Linting and style + +Sinon.JS uses [ESLint](http://eslint.org) to keep the codebase free of lint, and uses [Prettier](https://prettier.io) to keep consistent style. + +If you are contributing to a Sinon project, you'll probably want to configure your editors ([ESLint](https://eslint.org/docs/user-guide/integrations#editors), [Prettier](https://prettier.io/docs/en/editors.html)) to make editing code a more enjoyable experience. + +Both Prettier and ESLint will check the code in pre-commit hooks (when installed) and will be run before unit tests in the CI environment. The build will fail if the source code does not pass the checks. + +You can run the linter locally: + +``` +$ npm run lint +``` + +You can fix a lot of lint violations automatically: + +``` +$ npm run lint -- --fix +``` + +You can run prettier locally: + +``` +$ npm run prettier:check +``` + +You can fix style violations automatically: + +``` +$ npm run prettier:write +``` + +To ensure consistent reporting of lint warnings, you should use the same versions of ESLint and Prettier as defined in `package.json` (which is what the CI servers use). + +### Tooling + +To transparently handle all issues with different tool versions we recommend using [_ASDF: The Multiple Runtime Manager_][asdf]. You would then need the Ruby and Node plugins. + +
+ +``` +asdf plugin add ruby +asdf plugin add nodejs +asdf install +``` + +
+ +[asdf]: https://asdf-vm.com + +### Run the tests + +Following command runs unit tests in PhantomJS, Node and WebWorker + + $ npm test + +##### Testing in development + +Sinon.JS uses [Mocha](https://mochajs.org/), please read those docs if you're unfamiliar with it. + +If you're doing more than a one line edit, you'll want to have finer control and less restarting of the Mocha + +To start tests in dev mode run + + $ npm run test-dev + +Dev mode features: + +- [watching related files](https://mochajs.org/#w---watch) to restart tests once changes are made +- using [Min reporter](https://mochajs.org/#min), which cleans the console each time tests run, so test results are always on top + +Note that in dev mode tests run only in Node. Before creating your PR please ensure tests are passing in Phantom and WebWorker as well. To check this please use [Run the tests](#run-the-tests) instructions. + +### Compiling a built version + +Build requires Node. Under the hood [Browserify](http://browserify.org/) is used. + +To build run + + $ node build.cjs diff --git a/node_modules/sinon/LICENSE b/node_modules/sinon/LICENSE new file mode 100644 index 0000000..432d21c --- /dev/null +++ b/node_modules/sinon/LICENSE @@ -0,0 +1,27 @@ +(The BSD License) + +Copyright (c) 2010-2017, Christian Johansen, christian@cjohansen.no +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Christian Johansen nor the names of his contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/sinon/README.md b/node_modules/sinon/README.md new file mode 100644 index 0000000..816e57c --- /dev/null +++ b/node_modules/sinon/README.md @@ -0,0 +1,88 @@ +

+ + Sinon.JS + +
+ Sinon.JS +

+ +

+ Standalone and test framework agnostic JavaScript test spies, stubs and mocks (pronounced "sigh-non", named after Sinon, the warrior). +

+ +

+npm version +Sauce Test Status +Codecov status +OpenCollective +OpenCollective +npm downloads per month +CDNJS version +Contributor Covenant +

+ + + +## Compatibility + +For details on compatibility and browser support, please see [`COMPATIBILITY.md`](COMPATIBILITY.md) + +## Installation + +via [npm](https://github.com/npm/npm) + + $ npm install sinon + +or via Sinon's browser builds available for download on the [homepage](https://sinonjs.org/releases/). +There are also [npm based CDNs](https://sinonjs.org/releases#npm-cdns) one can use. + +## Usage + +See the [sinon project homepage](https://sinonjs.org/) for documentation on usage. + +If you have questions that are not covered by the documentation, you can [check out the `sinon` tag on Stack Overflow](https://stackoverflow.com/questions/tagged/sinon). + +## Goals + +- No global pollution +- Easy to use +- Require minimal “integration” +- Easy to embed seamlessly with any testing framework +- Easily fake any interface +- Ship with ready-to-use fakes for timers + +## Contribute? + +See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how you can contribute to Sinon.JS + +## Backers + +Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/sinon#backer)] + + + +## Sponsors + +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/sinon#sponsor)] + + + + + + + + + + + + + +## Licence + +Sinon.js was released under [BSD-3](LICENSE) diff --git a/node_modules/sinon/lib/create-sinon-api.js b/node_modules/sinon/lib/create-sinon-api.js new file mode 100644 index 0000000..8dbab4e --- /dev/null +++ b/node_modules/sinon/lib/create-sinon-api.js @@ -0,0 +1,35 @@ +"use strict"; + +const behavior = require("./sinon/behavior"); +const createSandbox = require("./sinon/create-sandbox"); +const extend = require("./sinon/util/core/extend"); +const fakeTimers = require("./sinon/util/fake-timers"); +const Sandbox = require("./sinon/sandbox"); +const stub = require("./sinon/stub"); +const promise = require("./sinon/promise"); + +/** + * @returns {object} a configured sandbox + */ +module.exports = function createApi() { + const apiMethods = { + createSandbox: createSandbox, + match: require("@sinonjs/samsam").createMatcher, + restoreObject: require("./sinon/restore-object"), + + expectation: require("./sinon/mock-expectation"), + + // fake timers + timers: fakeTimers.timers, + + addBehavior: function (name, fn) { + behavior.addBehavior(stub, name, fn); + }, + + // fake promise + promise: promise, + }; + + const sandbox = new Sandbox(); + return extend(sandbox, apiMethods); +}; diff --git a/node_modules/sinon/lib/package.json b/node_modules/sinon/lib/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/sinon/lib/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/sinon/lib/sinon-esm.js b/node_modules/sinon/lib/sinon-esm.js new file mode 100644 index 0000000..c15cf40 --- /dev/null +++ b/node_modules/sinon/lib/sinon-esm.js @@ -0,0 +1,3 @@ +"use strict"; +// eslint-disable-next-line no-undef +sinon = require("./sinon"); diff --git a/node_modules/sinon/lib/sinon.js b/node_modules/sinon/lib/sinon.js new file mode 100644 index 0000000..c9065a9 --- /dev/null +++ b/node_modules/sinon/lib/sinon.js @@ -0,0 +1,5 @@ +"use strict"; + +const createApi = require("./create-sinon-api"); + +module.exports = createApi(); diff --git a/node_modules/sinon/lib/sinon/assert.js b/node_modules/sinon/lib/sinon/assert.js new file mode 100644 index 0000000..374be4d --- /dev/null +++ b/node_modules/sinon/lib/sinon/assert.js @@ -0,0 +1,334 @@ +"use strict"; +/** @module */ + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const calledInOrder = require("@sinonjs/commons").calledInOrder; +const createMatcher = require("@sinonjs/samsam").createMatcher; +const orderByFirstCall = require("@sinonjs/commons").orderByFirstCall; +const timesInWords = require("./util/core/times-in-words"); +const inspect = require("util").inspect; +const stringSlice = require("@sinonjs/commons").prototypes.string.slice; +const globalObject = require("@sinonjs/commons").global; + +const arraySlice = arrayProto.slice; +const concat = arrayProto.concat; +const forEach = arrayProto.forEach; +const join = arrayProto.join; +const splice = arrayProto.splice; + +function applyDefaults(obj, defaults) { + for (const key of Object.keys(defaults)) { + const val = obj[key]; + if (val === null || typeof val === "undefined") { + obj[key] = defaults[key]; + } + } +} + +/** + * @typedef {object} CreateAssertOptions + * @global + * + * @property {boolean} [shouldLimitAssertionLogs] default is false + * @property {number} [assertionLogLimit] default is 10K + */ + +/** + * Create an assertion object that exposes several methods to invoke + * + * @param {CreateAssertOptions} [opts] options bag + * @returns {object} object with multiple assertion methods + */ +function createAssertObject(opts) { + const cleanedAssertOptions = opts || {}; + applyDefaults(cleanedAssertOptions, { + shouldLimitAssertionLogs: false, + assertionLogLimit: 1e4, + }); + + const assert = { + fail: function fail(message) { + let msg = message; + if (cleanedAssertOptions.shouldLimitAssertionLogs) { + msg = message.substring( + 0, + cleanedAssertOptions.assertionLogLimit, + ); + } + const error = new Error(msg); + error.name = "AssertError"; + + throw error; + }, + + pass: function pass() { + return; + }, + + callOrder: function assertCallOrder() { + verifyIsStub.apply(null, arguments); + let expected = ""; + let actual = ""; + + if (!calledInOrder(arguments)) { + try { + expected = join(arguments, ", "); + const calls = arraySlice(arguments); + let i = calls.length; + while (i) { + if (!calls[--i].called) { + splice(calls, i, 1); + } + } + actual = join(orderByFirstCall(calls), ", "); + } catch (e) { + // If this fails, we'll just fall back to the blank string + } + + failAssertion( + this, + `expected ${expected} to be called in order but were called as ${actual}`, + ); + } else { + assert.pass("callOrder"); + } + }, + + callCount: function assertCallCount(method, count) { + verifyIsStub(method); + + let msg; + if (typeof count !== "number") { + msg = + `expected ${inspect(count)} to be a number ` + + `but was of type ${typeof count}`; + failAssertion(this, msg); + } else if (method.callCount !== count) { + msg = + `expected %n to be called ${timesInWords(count)} ` + + `but was called %c%C`; + failAssertion(this, method.printf(msg)); + } else { + assert.pass("callCount"); + } + }, + + expose: function expose(target, options) { + if (!target) { + throw new TypeError("target is null or undefined"); + } + + const o = options || {}; + const prefix = + (typeof o.prefix === "undefined" && "assert") || o.prefix; + const includeFail = + typeof o.includeFail === "undefined" || Boolean(o.includeFail); + const instance = this; + + forEach(Object.keys(instance), function (method) { + if ( + method !== "expose" && + (includeFail || !/^(fail)/.test(method)) + ) { + target[exposedName(prefix, method)] = instance[method]; + } + }); + + return target; + }, + + match: function match(actual, expectation) { + const matcher = createMatcher(expectation); + if (matcher.test(actual)) { + assert.pass("match"); + } else { + const formatted = [ + "expected value to match", + ` expected = ${inspect(expectation)}`, + ` actual = ${inspect(actual)}`, + ]; + + failAssertion(this, join(formatted, "\n")); + } + }, + }; + + function verifyIsStub() { + const args = arraySlice(arguments); + + forEach(args, function (method) { + if (!method) { + assert.fail("fake is not a spy"); + } + + if (method.proxy && method.proxy.isSinonProxy) { + verifyIsStub(method.proxy); + } else { + if (typeof method !== "function") { + assert.fail(`${method} is not a function`); + } + + if (typeof method.getCall !== "function") { + assert.fail(`${method} is not stubbed`); + } + } + }); + } + + function verifyIsValidAssertion(assertionMethod, assertionArgs) { + switch (assertionMethod) { + case "notCalled": + case "called": + case "calledOnce": + case "calledTwice": + case "calledThrice": + if (assertionArgs.length !== 0) { + assert.fail( + `${assertionMethod} takes 1 argument but was called with ${ + assertionArgs.length + 1 + } arguments`, + ); + } + break; + default: + break; + } + } + + function failAssertion(object, msg) { + const obj = object || globalObject; + const failMethod = obj.fail || assert.fail; + failMethod.call(obj, msg); + } + + function mirrorPropAsAssertion(name, method, message) { + let msg = message; + let meth = method; + if (arguments.length === 2) { + msg = method; + meth = name; + } + + assert[name] = function (fake) { + verifyIsStub(fake); + + const args = arraySlice(arguments, 1); + let failed = false; + + verifyIsValidAssertion(name, args); + + if (typeof meth === "function") { + failed = !meth(fake); + } else { + failed = + typeof fake[meth] === "function" + ? !fake[meth].apply(fake, args) + : !fake[meth]; + } + + if (failed) { + failAssertion( + this, + (fake.printf || fake.proxy.printf).apply( + fake, + concat([msg], args), + ), + ); + } else { + assert.pass(name); + } + }; + } + + function exposedName(prefix, prop) { + return !prefix || /^fail/.test(prop) + ? prop + : prefix + + stringSlice(prop, 0, 1).toUpperCase() + + stringSlice(prop, 1); + } + + mirrorPropAsAssertion( + "called", + "expected %n to have been called at least once but was never called", + ); + mirrorPropAsAssertion( + "notCalled", + function (spy) { + return !spy.called; + }, + "expected %n to not have been called but was called %c%C", + ); + mirrorPropAsAssertion( + "calledOnce", + "expected %n to be called once but was called %c%C", + ); + mirrorPropAsAssertion( + "calledTwice", + "expected %n to be called twice but was called %c%C", + ); + mirrorPropAsAssertion( + "calledThrice", + "expected %n to be called thrice but was called %c%C", + ); + mirrorPropAsAssertion( + "calledOn", + "expected %n to be called with %1 as this but was called with %t", + ); + mirrorPropAsAssertion( + "alwaysCalledOn", + "expected %n to always be called with %1 as this but was called with %t", + ); + mirrorPropAsAssertion("calledWithNew", "expected %n to be called with new"); + mirrorPropAsAssertion( + "alwaysCalledWithNew", + "expected %n to always be called with new", + ); + mirrorPropAsAssertion( + "calledWith", + "expected %n to be called with arguments %D", + ); + mirrorPropAsAssertion( + "calledWithMatch", + "expected %n to be called with match %D", + ); + mirrorPropAsAssertion( + "alwaysCalledWith", + "expected %n to always be called with arguments %D", + ); + mirrorPropAsAssertion( + "alwaysCalledWithMatch", + "expected %n to always be called with match %D", + ); + mirrorPropAsAssertion( + "calledWithExactly", + "expected %n to be called with exact arguments %D", + ); + mirrorPropAsAssertion( + "calledOnceWithExactly", + "expected %n to be called once and with exact arguments %D", + ); + mirrorPropAsAssertion( + "calledOnceWithMatch", + "expected %n to be called once and with match %D", + ); + mirrorPropAsAssertion( + "alwaysCalledWithExactly", + "expected %n to always be called with exact arguments %D", + ); + mirrorPropAsAssertion( + "neverCalledWith", + "expected %n to never be called with arguments %*%C", + ); + mirrorPropAsAssertion( + "neverCalledWithMatch", + "expected %n to never be called with match %*%C", + ); + mirrorPropAsAssertion("threw", "%n did not throw exception%C"); + mirrorPropAsAssertion("alwaysThrew", "%n did not always throw exception%C"); + + return assert; +} + +module.exports = createAssertObject(); +module.exports.createAssertObject = createAssertObject; diff --git a/node_modules/sinon/lib/sinon/behavior.js b/node_modules/sinon/lib/sinon/behavior.js new file mode 100644 index 0000000..a7d2b27 --- /dev/null +++ b/node_modules/sinon/lib/sinon/behavior.js @@ -0,0 +1,272 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const extend = require("./util/core/extend"); +const functionName = require("@sinonjs/commons").functionName; +const nextTick = require("./util/core/next-tick"); +const valueToString = require("@sinonjs/commons").valueToString; +const exportAsyncBehaviors = require("./util/core/export-async-behaviors"); + +const concat = arrayProto.concat; +const join = arrayProto.join; +const reverse = arrayProto.reverse; +const slice = arrayProto.slice; + +const useLeftMostCallback = -1; +const useRightMostCallback = -2; + +function getCallback(behavior, args) { + const callArgAt = behavior.callArgAt; + + if (callArgAt >= 0) { + return args[callArgAt]; + } + + let argumentList; + + if (callArgAt === useLeftMostCallback) { + argumentList = args; + } + + if (callArgAt === useRightMostCallback) { + argumentList = reverse(slice(args)); + } + + const callArgProp = behavior.callArgProp; + + for (let i = 0, l = argumentList.length; i < l; ++i) { + if (!callArgProp && typeof argumentList[i] === "function") { + return argumentList[i]; + } + + if ( + callArgProp && + argumentList[i] && + typeof argumentList[i][callArgProp] === "function" + ) { + return argumentList[i][callArgProp]; + } + } + + return null; +} + +function getCallbackError(behavior, func, args) { + if (behavior.callArgAt < 0) { + let msg; + + if (behavior.callArgProp) { + msg = `${functionName( + behavior.stub, + )} expected to yield to '${valueToString( + behavior.callArgProp, + )}', but no object with such a property was passed.`; + } else { + msg = `${functionName( + behavior.stub, + )} expected to yield, but no callback was passed.`; + } + + if (args.length > 0) { + msg += ` Received [${join(args, ", ")}]`; + } + + return msg; + } + + return `argument at index ${behavior.callArgAt} is not a function: ${func}`; +} + +function ensureArgs(name, behavior, args) { + // map function name to internal property + // callsArg => callArgAt + const property = name.replace(/sArg/, "ArgAt"); + const index = behavior[property]; + + if (index >= args.length) { + throw new TypeError( + `${name} failed: ${index + 1} arguments required but only ${ + args.length + } present`, + ); + } +} + +function callCallback(behavior, args) { + if (typeof behavior.callArgAt === "number") { + ensureArgs("callsArg", behavior, args); + const func = getCallback(behavior, args); + + if (typeof func !== "function") { + throw new TypeError(getCallbackError(behavior, func, args)); + } + + if (behavior.callbackAsync) { + nextTick(function () { + func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + }); + } else { + return func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + } + } + + return undefined; +} + +const proto = { + create: function create(stub) { + const behavior = extend({}, proto); + delete behavior.create; + delete behavior.addBehavior; + delete behavior.createBehavior; + behavior.stub = stub; + + if (stub.defaultBehavior && stub.defaultBehavior.promiseLibrary) { + behavior.promiseLibrary = stub.defaultBehavior.promiseLibrary; + } + + return behavior; + }, + + isPresent: function isPresent() { + return ( + typeof this.callArgAt === "number" || + this.exception || + this.exceptionCreator || + typeof this.returnArgAt === "number" || + this.returnThis || + typeof this.resolveArgAt === "number" || + this.resolveThis || + typeof this.throwArgAt === "number" || + this.fakeFn || + this.returnValueDefined + ); + }, + + /*eslint complexity: ["error", 20]*/ + invoke: function invoke(context, args) { + /* + * callCallback (conditionally) calls ensureArgs + * + * Note: callCallback intentionally happens before + * everything else and cannot be moved lower + */ + const returnValue = callCallback(this, args); + + if (this.exception) { + throw this.exception; + } else if (this.exceptionCreator) { + this.exception = this.exceptionCreator(); + this.exceptionCreator = undefined; + throw this.exception; + } else if (typeof this.returnArgAt === "number") { + ensureArgs("returnsArg", this, args); + return args[this.returnArgAt]; + } else if (this.returnThis) { + return context; + } else if (typeof this.throwArgAt === "number") { + ensureArgs("throwsArg", this, args); + throw args[this.throwArgAt]; + } else if (this.fakeFn) { + return this.fakeFn.apply(context, args); + } else if (typeof this.resolveArgAt === "number") { + ensureArgs("resolvesArg", this, args); + return (this.promiseLibrary || Promise).resolve( + args[this.resolveArgAt], + ); + } else if (this.resolveThis) { + return (this.promiseLibrary || Promise).resolve(context); + } else if (this.resolve) { + return (this.promiseLibrary || Promise).resolve(this.returnValue); + } else if (this.reject) { + return (this.promiseLibrary || Promise).reject(this.returnValue); + } else if (this.callsThrough) { + const wrappedMethod = this.effectiveWrappedMethod(); + + return wrappedMethod.apply(context, args); + } else if (this.callsThroughWithNew) { + // Get the original method (assumed to be a constructor in this case) + const WrappedClass = this.effectiveWrappedMethod(); + // Turn the arguments object into a normal array + const argsArray = slice(args); + // Call the constructor + const F = WrappedClass.bind.apply( + WrappedClass, + concat([null], argsArray), + ); + return new F(); + } else if (typeof this.returnValue !== "undefined") { + return this.returnValue; + } else if (typeof this.callArgAt === "number") { + return returnValue; + } + + return this.returnValue; + }, + + effectiveWrappedMethod: function effectiveWrappedMethod() { + for (let stubb = this.stub; stubb; stubb = stubb.parent) { + if (stubb.wrappedMethod) { + return stubb.wrappedMethod; + } + } + throw new Error("Unable to find wrapped method"); + }, + + onCall: function onCall(index) { + return this.stub.onCall(index); + }, + + onFirstCall: function onFirstCall() { + return this.stub.onFirstCall(); + }, + + onSecondCall: function onSecondCall() { + return this.stub.onSecondCall(); + }, + + onThirdCall: function onThirdCall() { + return this.stub.onThirdCall(); + }, + + withArgs: function withArgs(/* arguments */) { + throw new Error( + 'Defining a stub by invoking "stub.onCall(...).withArgs(...)" ' + + 'is not supported. Use "stub.withArgs(...).onCall(...)" ' + + "to define sequential behavior for calls with certain arguments.", + ); + }, +}; + +function createBehavior(behaviorMethod) { + return function () { + this.defaultBehavior = this.defaultBehavior || proto.create(this); + this.defaultBehavior[behaviorMethod].apply( + this.defaultBehavior, + arguments, + ); + return this; + }; +} + +function addBehavior(stub, name, fn) { + proto[name] = function () { + fn.apply(this, concat([this], slice(arguments))); + return this.stub || this; + }; + + stub[name] = createBehavior(name); +} + +proto.addBehavior = addBehavior; +proto.createBehavior = createBehavior; + +const asyncBehaviors = exportAsyncBehaviors(proto); + +module.exports = extend.nonEnum({}, proto, asyncBehaviors); diff --git a/node_modules/sinon/lib/sinon/collect-own-methods.js b/node_modules/sinon/lib/sinon/collect-own-methods.js new file mode 100644 index 0000000..bb88e3a --- /dev/null +++ b/node_modules/sinon/lib/sinon/collect-own-methods.js @@ -0,0 +1,27 @@ +"use strict"; + +const walk = require("./util/core/walk"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const push = require("@sinonjs/commons").prototypes.array.push; + +function collectMethod(methods, object, prop, propOwner) { + if ( + typeof getPropertyDescriptor(propOwner, prop).value === "function" && + hasOwnProperty(object, prop) + ) { + push(methods, object[prop]); + } +} + +// This function returns an array of all the own methods on the passed object +function collectOwnMethods(object) { + const methods = []; + + walk(object, collectMethod.bind(null, methods, object)); + + return methods; +} + +module.exports = collectOwnMethods; diff --git a/node_modules/sinon/lib/sinon/colorizer.js b/node_modules/sinon/lib/sinon/colorizer.js new file mode 100644 index 0000000..2425179 --- /dev/null +++ b/node_modules/sinon/lib/sinon/colorizer.js @@ -0,0 +1,41 @@ +"use strict"; + +module.exports = class Colorizer { + constructor(supportsColor = require("supports-color")) { + this.supportsColor = supportsColor; + } + + /** + * Should be renamed to true #privateField + * when we can ensure ES2022 support + * + * @private + */ + colorize(str, color) { + if (this.supportsColor.stdout === false) { + return str; + } + + return `\x1b[${color}m${str}\x1b[0m`; + } + + red(str) { + return this.colorize(str, 31); + } + + green(str) { + return this.colorize(str, 32); + } + + cyan(str) { + return this.colorize(str, 96); + } + + white(str) { + return this.colorize(str, 39); + } + + bold(str) { + return this.colorize(str, 1); + } +}; diff --git a/node_modules/sinon/lib/sinon/create-sandbox.js b/node_modules/sinon/lib/sinon/create-sandbox.js new file mode 100644 index 0000000..28e20ec --- /dev/null +++ b/node_modules/sinon/lib/sinon/create-sandbox.js @@ -0,0 +1,96 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Sandbox = require("./sandbox"); + +const forEach = arrayProto.forEach; +const push = arrayProto.push; + +function prepareSandboxFromConfig(config) { + const sandbox = new Sandbox({ assertOptions: config.assertOptions }); + + if (config.useFakeTimers) { + if (typeof config.useFakeTimers === "object") { + sandbox.useFakeTimers(config.useFakeTimers); + } else { + sandbox.useFakeTimers(); + } + } + + return sandbox; +} + +function exposeValue(sandbox, config, key, value) { + if (!value) { + return; + } + + if (config.injectInto && !(key in config.injectInto)) { + config.injectInto[key] = value; + push(sandbox.injectedKeys, key); + } else { + push(sandbox.args, value); + } +} + +/** + * Options to customize a sandbox + * + * The sandbox's methods can be injected into another object for + * convenience. The `injectInto` configuration option can name an + * object to add properties to. + * + * @typedef {object} SandboxConfig + * @property {string[]} properties The properties of the API to expose on the sandbox. Examples: ['spy', 'fake', 'restore'] + * @property {object} injectInto an object in which to inject properties from the sandbox (a facade). This is mostly an integration feature (sinon-test being one). + * @property {boolean} useFakeTimers whether timers are faked by default + * @property {object} [assertOptions] see CreateAssertOptions in ./assert + * + * This type def is really suffering from JSDoc not having standardized + * how to reference types defined in other modules :( + */ + +/** + * A configured sinon sandbox (private type) + * + * @typedef {object} ConfiguredSinonSandboxType + * @private + * @augments Sandbox + * @property {string[]} injectedKeys the keys that have been injected (from config.injectInto) + * @property {*[]} args the arguments for the sandbox + */ + +/** + * Create a sandbox + * + * As of Sinon 5 the `sinon` instance itself is a Sandbox, so you + * hardly ever need to create additional instances for the sake of testing + * + * @param config {SandboxConfig} + * @returns {Sandbox} + */ +function createSandbox(config) { + if (!config) { + return new Sandbox(); + } + + const configuredSandbox = prepareSandboxFromConfig(config); + configuredSandbox.args = configuredSandbox.args || []; + configuredSandbox.injectedKeys = []; + configuredSandbox.injectInto = config.injectInto; + const exposed = configuredSandbox.inject({}); + + if (config.properties) { + forEach(config.properties, function (prop) { + const value = + exposed[prop] || (prop === "sandbox" && configuredSandbox); + exposeValue(configuredSandbox, config, prop, value); + }); + } else { + exposeValue(configuredSandbox, config, "sandbox"); + } + + return configuredSandbox; +} + +module.exports = createSandbox; diff --git a/node_modules/sinon/lib/sinon/create-stub-instance.js b/node_modules/sinon/lib/sinon/create-stub-instance.js new file mode 100644 index 0000000..0029ca8 --- /dev/null +++ b/node_modules/sinon/lib/sinon/create-stub-instance.js @@ -0,0 +1,36 @@ +"use strict"; + +const stub = require("./stub"); +const sinonType = require("./util/core/sinon-type"); +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function isStub(value) { + return sinonType.get(value) === "stub"; +} + +module.exports = function createStubInstance(constructor, overrides) { + if (typeof constructor !== "function") { + throw new TypeError("The constructor should be a function."); + } + + const stubInstance = Object.create(constructor.prototype); + sinonType.set(stubInstance, "stub-instance"); + + const stubbedObject = stub(stubInstance); + + forEach(Object.keys(overrides || {}), function (propertyName) { + if (propertyName in stubbedObject) { + const value = overrides[propertyName]; + if (isStub(value)) { + stubbedObject[propertyName] = value; + } else { + stubbedObject[propertyName].returns(value); + } + } else { + throw new Error( + `Cannot stub ${propertyName}. Property does not exist!`, + ); + } + }); + return stubbedObject; +}; diff --git a/node_modules/sinon/lib/sinon/default-behaviors.js b/node_modules/sinon/lib/sinon/default-behaviors.js new file mode 100644 index 0000000..ba85007 --- /dev/null +++ b/node_modules/sinon/lib/sinon/default-behaviors.js @@ -0,0 +1,301 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const exportAsyncBehaviors = require("./util/core/export-async-behaviors"); +const extend = require("./util/core/extend"); + +const slice = arrayProto.slice; + +const useLeftMostCallback = -1; +const useRightMostCallback = -2; + +function throwsException(fake, error, message) { + if (typeof error === "function") { + fake.exceptionCreator = error; + } else if (typeof error === "string") { + fake.exceptionCreator = function () { + const newException = new Error( + message || `Sinon-provided ${error}`, + ); + newException.name = error; + return newException; + }; + } else if (!error) { + fake.exceptionCreator = function () { + return new Error("Error"); + }; + } else { + fake.exception = error; + } +} + +const defaultBehaviors = { + callsFake: function callsFake(fake, fn) { + fake.fakeFn = fn; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.callsThrough = false; + }, + + callsArg: function callsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOn: function callsArgOn(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgWith: function callsArgWith(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOnWith: function callsArgWith(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + yields: function (fake) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + yieldsRight: function (fake) { + fake.callArgAt = useRightMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsOn: function (fake, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsTo: function (fake, prop) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsToOn: function (fake, prop, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.fakeFn = undefined; + }, + + throws: throwsException, + throwsException: throwsException, + + returns: function returns(fake, value) { + fake.callsThrough = false; + fake.returnValue = value; + fake.resolve = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + }, + + returnsArg: function returnsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.returnArgAt = index; + }, + + throwsArg: function throwsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.throwArgAt = index; + }, + + returnsThis: function returnsThis(fake) { + fake.returnThis = true; + fake.callsThrough = false; + }, + + resolves: function resolves(fake, value) { + fake.returnValue = value; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + resolvesArg: function resolvesArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.resolveArgAt = index; + fake.returnValue = undefined; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + rejects: function rejects(fake, error, message) { + let reason; + if (typeof error === "string") { + reason = new Error(message || ""); + reason.name = error; + } else if (!error) { + reason = new Error("Error"); + } else { + reason = error; + } + fake.returnValue = reason; + fake.resolve = false; + fake.resolveThis = false; + fake.reject = true; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + + return fake; + }, + + resolvesThis: function resolvesThis(fake) { + fake.returnValue = undefined; + fake.resolve = false; + fake.resolveThis = true; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + callThrough: function callThrough(fake) { + fake.callsThrough = true; + }, + + callThroughWithNew: function callThroughWithNew(fake) { + fake.callsThroughWithNew = true; + }, + + get: function get(fake, getterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + get: getterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }); + + return fake; + }, + + set: function set(fake, setterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty( + rootStub.rootObj, + rootStub.propName, + // eslint-disable-next-line accessor-pairs + { + set: setterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }, + ); + + return fake; + }, + + value: function value(fake, newVal) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + value: newVal, + enumerable: true, + writable: true, + configurable: + rootStub.shadowsPropOnPrototype || + isPropertyConfigurable(rootStub.rootObj, rootStub.propName), + }); + + return fake; + }, +}; + +const asyncBehaviors = exportAsyncBehaviors(defaultBehaviors); + +module.exports = extend({}, defaultBehaviors, asyncBehaviors); diff --git a/node_modules/sinon/lib/sinon/fake.js b/node_modules/sinon/lib/sinon/fake.js new file mode 100644 index 0000000..cd79f46 --- /dev/null +++ b/node_modules/sinon/lib/sinon/fake.js @@ -0,0 +1,269 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const nextTick = require("./util/core/next-tick"); + +const slice = arrayProto.slice; + +module.exports = fake; + +/** + * Returns a `fake` that records all calls, arguments and return values. + * + * When an `f` argument is supplied, this implementation will be used. + * + * @example + * // create an empty fake + * var f1 = sinon.fake(); + * + * f1(); + * + * f1.calledOnce() + * // true + * + * @example + * function greet(greeting) { + * console.log(`Hello ${greeting}`); + * } + * + * // create a fake with implementation + * var f2 = sinon.fake(greet); + * + * // Hello world + * f2("world"); + * + * f2.calledWith("world"); + * // true + * + * @param {Function|undefined} f + * @returns {Function} + * @namespace + */ +function fake(f) { + if (arguments.length > 0 && typeof f !== "function") { + throw new TypeError("Expected f argument to be a Function"); + } + + return wrapFunc(f); +} + +/** + * Creates a `fake` that returns the provided `value`, as well as recording all + * calls, arguments and return values. + * + * @example + * var f1 = sinon.fake.returns(42); + * + * f1(); + * // 42 + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.returns = function returns(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return value; + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that throws an Error. + * If the `value` argument does not have Error in its prototype chain, it will + * be used for creating a new error. + * + * @example + * var f1 = sinon.fake.throws("hello"); + * + * f1(); + * // Uncaught Error: hello + * + * @example + * var f2 = sinon.fake.throws(new TypeError("Invalid argument")); + * + * f2(); + * // Uncaught TypeError: Invalid argument + * + * @memberof fake + * @param {*|Error} value + * @returns {Function} + */ +fake.throws = function throws(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + throw getError(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that resolves to the passed `value` + * argument. + * + * @example + * var f1 = sinon.fake.resolves("apple pie"); + * + * await f1(); + * // "apple pie" + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.resolves = function resolves(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.resolve(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that rejects to the passed `value` + * argument. When `value` does not have Error in its prototype chain, it will be + * wrapped in an Error. + * + * @example + * var f1 = sinon.fake.rejects(":("); + * + * try { + * await f1(); + * } catch (error) { + * console.log(error); + * // ":(" + * } + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.rejects = function rejects(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.reject(getError(value)); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback with the defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * // "apple*pie" + * + * @memberof fake + * @returns {Function} + */ +fake.yields = function yields() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + + callback.apply(null, values); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback **asynchronously** with the + * defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * + * setTimeout(() => { + * // "apple*pie" + * }); + * + * @memberof fake + * @returns {Function} + */ +fake.yieldsAsync = function yieldsAsync() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + nextTick(function () { + callback.apply(null, values); + }); + } + + return wrapFunc(f); +}; + +let uuid = 0; +/** + * Creates a proxy (sinon concept) from the passed function. + * + * @private + * @param {Function} f + * @returns {Function} + */ +function wrapFunc(f) { + const fakeInstance = function () { + let firstArg, lastArg; + + if (arguments.length > 0) { + firstArg = arguments[0]; + lastArg = arguments[arguments.length - 1]; + } + + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + /* eslint-disable no-use-before-define */ + proxy.firstArg = firstArg; + proxy.lastArg = lastArg; + proxy.callback = callback; + + return f && f.apply(this, arguments); + }; + const proxy = createProxy(fakeInstance, f || fakeInstance); + + proxy.displayName = "fake"; + proxy.id = `fake#${uuid++}`; + + return proxy; +} + +/** + * Returns an Error instance from the passed value, if the value is not + * already an Error instance. + * + * @private + * @param {*} value [description] + * @returns {Error} [description] + */ +function getError(value) { + return value instanceof Error ? value : new Error(value); +} diff --git a/node_modules/sinon/lib/sinon/mock-expectation.js b/node_modules/sinon/lib/sinon/mock-expectation.js new file mode 100644 index 0000000..e248f63 --- /dev/null +++ b/node_modules/sinon/lib/sinon/mock-expectation.js @@ -0,0 +1,321 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyInvoke = require("./proxy-invoke"); +const proxyCallToString = require("./proxy-call").toString; +const timesInWords = require("./util/core/times-in-words"); +const extend = require("./util/core/extend"); +const match = require("@sinonjs/samsam").createMatcher; +const stub = require("./stub"); +const assert = require("./assert"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const every = arrayProto.every; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const slice = arrayProto.slice; + +function callCountInWords(callCount) { + if (callCount === 0) { + return "never called"; + } + + return `called ${timesInWords(callCount)}`; +} + +function expectedCallCountInWords(expectation) { + const min = expectation.minCalls; + const max = expectation.maxCalls; + + if (typeof min === "number" && typeof max === "number") { + let str = timesInWords(min); + + if (min !== max) { + str = `at least ${str} and at most ${timesInWords(max)}`; + } + + return str; + } + + if (typeof min === "number") { + return `at least ${timesInWords(min)}`; + } + + return `at most ${timesInWords(max)}`; +} + +function receivedMinCalls(expectation) { + const hasMinLimit = typeof expectation.minCalls === "number"; + return !hasMinLimit || expectation.callCount >= expectation.minCalls; +} + +function receivedMaxCalls(expectation) { + if (typeof expectation.maxCalls !== "number") { + return false; + } + + return expectation.callCount === expectation.maxCalls; +} + +function verifyMatcher(possibleMatcher, arg) { + const isMatcher = match.isMatcher(possibleMatcher); + + return (isMatcher && possibleMatcher.test(arg)) || true; +} + +const mockExpectation = { + minCalls: 1, + maxCalls: 1, + + create: function create(methodName) { + const expectation = extend.nonEnum(stub(), mockExpectation); + delete expectation.create; + expectation.method = methodName; + + return expectation; + }, + + invoke: function invoke(func, thisValue, args) { + this.verifyCallAllowed(thisValue, args); + + return proxyInvoke.apply(this, arguments); + }, + + atLeast: function atLeast(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.maxCalls = null; + this.limitsSet = true; + } + + this.minCalls = num; + + return this; + }, + + atMost: function atMost(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.minCalls = null; + this.limitsSet = true; + } + + this.maxCalls = num; + + return this; + }, + + never: function never() { + return this.exactly(0); + }, + + once: function once() { + return this.exactly(1); + }, + + twice: function twice() { + return this.exactly(2); + }, + + thrice: function thrice() { + return this.exactly(3); + }, + + exactly: function exactly(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not a number`); + } + + this.atLeast(num); + return this.atMost(num); + }, + + met: function met() { + return !this.failed && receivedMinCalls(this); + }, + + verifyCallAllowed: function verifyCallAllowed(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (receivedMaxCalls(this)) { + this.failed = true; + mockExpectation.fail( + `${this.method} already called ${timesInWords(this.maxCalls)}`, + ); + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + mockExpectation.fail( + `${this.method} called with ${valueToString( + thisValue, + )} as thisValue, expected ${valueToString(this.expectedThis)}`, + ); + } + + if (!("expectedArguments" in this)) { + return; + } + + if (!args) { + mockExpectation.fail( + `${this.method} received no arguments, expected ${inspect( + expectedArguments, + )}`, + ); + } + + if (args.length < expectedArguments.length) { + mockExpectation.fail( + `${this.method} received too few arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + if ( + this.expectsExactArgCount && + args.length !== expectedArguments.length + ) { + mockExpectation.fail( + `${this.method} received too many arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + forEach( + expectedArguments, + function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, args[i])) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, didn't match ${String(expectedArguments)}`, + ); + } + + if (!deepEqual(args[i], expectedArgument)) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, expected ${inspect(expectedArguments)}`, + ); + } + }, + this, + ); + }, + + allowsCall: function allowsCall(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (this.met() && receivedMaxCalls(this)) { + return false; + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + return false; + } + + if (!("expectedArguments" in this)) { + return true; + } + + // eslint-disable-next-line no-underscore-dangle + const _args = args || []; + + if (_args.length < expectedArguments.length) { + return false; + } + + if ( + this.expectsExactArgCount && + _args.length !== expectedArguments.length + ) { + return false; + } + + return every(expectedArguments, function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, _args[i])) { + return false; + } + + if (!deepEqual(_args[i], expectedArgument)) { + return false; + } + + return true; + }); + }, + + withArgs: function withArgs() { + this.expectedArguments = slice(arguments); + return this; + }, + + withExactArgs: function withExactArgs() { + this.withArgs.apply(this, arguments); + this.expectsExactArgCount = true; + return this; + }, + + on: function on(thisValue) { + this.expectedThis = thisValue; + return this; + }, + + toString: function () { + const args = slice(this.expectedArguments || []); + + if (!this.expectsExactArgCount) { + push(args, "[...]"); + } + + const callStr = proxyCallToString.call({ + proxy: this.method || "anonymous mock expectation", + args: args, + }); + + const message = `${callStr.replace( + ", [...", + "[, ...", + )} ${expectedCallCountInWords(this)}`; + + if (this.met()) { + return `Expectation met: ${message}`; + } + + return `Expected ${message} (${callCountInWords(this.callCount)})`; + }, + + verify: function verify() { + if (!this.met()) { + mockExpectation.fail(String(this)); + } else { + mockExpectation.pass(String(this)); + } + + return true; + }, + + pass: function pass(message) { + assert.pass(message); + }, + + fail: function fail(message) { + const exception = new Error(message); + exception.name = "ExpectationError"; + + throw exception; + }, +}; + +module.exports = mockExpectation; diff --git a/node_modules/sinon/lib/sinon/mock.js b/node_modules/sinon/lib/sinon/mock.js new file mode 100644 index 0000000..da1f5e6 --- /dev/null +++ b/node_modules/sinon/lib/sinon/mock.js @@ -0,0 +1,206 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const mockExpectation = require("./mock-expectation"); +const proxyCallToString = require("./proxy-call").toString; +const extend = require("./util/core/extend"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const wrapMethod = require("./util/core/wrap-method"); + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const every = arrayProto.every; +const join = arrayProto.join; +const push = arrayProto.push; +const slice = arrayProto.slice; +const unshift = arrayProto.unshift; + +function mock(object) { + if (!object || typeof object === "string") { + return mockExpectation.create(object ? object : "Anonymous mock"); + } + + return mock.create(object); +} + +function each(collection, callback) { + const col = collection || []; + + forEach(col, callback); +} + +function arrayEquals(arr1, arr2, compareLength) { + if (compareLength && arr1.length !== arr2.length) { + return false; + } + + return every(arr1, function (element, i) { + return deepEqual(arr2[i], element); + }); +} + +extend(mock, { + create: function create(object) { + if (!object) { + throw new TypeError("object is null"); + } + + const mockObject = extend.nonEnum({}, mock, { object: object }); + delete mockObject.create; + + return mockObject; + }, + + expects: function expects(method) { + if (!method) { + throw new TypeError("method is falsy"); + } + + if (!this.expectations) { + this.expectations = {}; + this.proxies = []; + this.failures = []; + } + + if (!this.expectations[method]) { + this.expectations[method] = []; + const mockObject = this; + + wrapMethod(this.object, method, function () { + return mockObject.invokeMethod(method, this, arguments); + }); + + push(this.proxies, method); + } + + const expectation = mockExpectation.create(method); + expectation.wrappedMethod = this.object[method].wrappedMethod; + push(this.expectations[method], expectation); + + return expectation; + }, + + restore: function restore() { + const object = this.object; + + each(this.proxies, function (proxy) { + if (typeof object[proxy].restore === "function") { + object[proxy].restore(); + } + }); + }, + + verify: function verify() { + const expectations = this.expectations || {}; + const messages = this.failures ? slice(this.failures) : []; + const met = []; + + each(this.proxies, function (proxy) { + each(expectations[proxy], function (expectation) { + if (!expectation.met()) { + push(messages, String(expectation)); + } else { + push(met, String(expectation)); + } + }); + }); + + this.restore(); + + if (messages.length > 0) { + mockExpectation.fail(join(concat(messages, met), "\n")); + } else if (met.length > 0) { + mockExpectation.pass(join(concat(messages, met), "\n")); + } + + return true; + }, + + invokeMethod: function invokeMethod(method, thisValue, args) { + /* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */ + /* eslint consistent-return: "off" */ + const expectations = + this.expectations && this.expectations[method] + ? this.expectations[method] + : []; + const currentArgs = args || []; + let available; + + const expectationsWithMatchingArgs = filter( + expectations, + function (expectation) { + const expectedArgs = expectation.expectedArguments || []; + + return arrayEquals( + expectedArgs, + currentArgs, + expectation.expectsExactArgCount, + ); + }, + ); + + const expectationsToApply = filter( + expectationsWithMatchingArgs, + function (expectation) { + return ( + !expectation.met() && + expectation.allowsCall(thisValue, args) + ); + }, + ); + + if (expectationsToApply.length > 0) { + return expectationsToApply[0].apply(thisValue, args); + } + + const messages = []; + let exhausted = 0; + + forEach(expectationsWithMatchingArgs, function (expectation) { + if (expectation.allowsCall(thisValue, args)) { + available = available || expectation; + } else { + exhausted += 1; + } + }); + + if (available && exhausted === 0) { + return available.apply(thisValue, args); + } + + forEach(expectations, function (expectation) { + push(messages, ` ${String(expectation)}`); + }); + + unshift( + messages, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + })}`, + ); + + const err = new Error(); + if (!err.stack) { + // PhantomJS does not serialize the stack trace until the error has been thrown + try { + throw err; + } catch (e) { + /* empty */ + } + } + push( + this.failures, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + stack: err.stack, + })}`, + ); + + mockExpectation.fail(join(messages, "\n")); + }, +}); + +module.exports = mock; diff --git a/node_modules/sinon/lib/sinon/promise.js b/node_modules/sinon/lib/sinon/promise.js new file mode 100644 index 0000000..ca30af1 --- /dev/null +++ b/node_modules/sinon/lib/sinon/promise.js @@ -0,0 +1,84 @@ +"use strict"; + +const fake = require("./fake"); +const isRestorable = require("./util/core/is-restorable"); + +const STATUS_PENDING = "pending"; +const STATUS_RESOLVED = "resolved"; +const STATUS_REJECTED = "rejected"; + +/** + * Returns a fake for a given function or undefined. If no function is given, a + * new fake is returned. If the given function is already a fake, it is + * returned as is. Otherwise the given function is wrapped in a new fake. + * + * @param {Function} [executor] The optional executor function. + * @returns {Function} + */ +function getFakeExecutor(executor) { + if (isRestorable(executor)) { + return executor; + } + if (executor) { + return fake(executor); + } + return fake(); +} + +/** + * Returns a new promise that exposes it's internal `status`, `resolvedValue` + * and `rejectedValue` and can be resolved or rejected from the outside by + * calling `resolve(value)` or `reject(reason)`. + * + * @param {Function} [executor] The optional executor function. + * @returns {Promise} + */ +function promise(executor) { + const fakeExecutor = getFakeExecutor(executor); + const sinonPromise = new Promise(fakeExecutor); + + sinonPromise.status = STATUS_PENDING; + sinonPromise + .then(function (value) { + sinonPromise.status = STATUS_RESOLVED; + sinonPromise.resolvedValue = value; + }) + .catch(function (reason) { + sinonPromise.status = STATUS_REJECTED; + sinonPromise.rejectedValue = reason; + }); + + /** + * Resolves or rejects the promise with the given status and value. + * + * @param {string} status + * @param {*} value + * @param {Function} callback + */ + function finalize(status, value, callback) { + if (sinonPromise.status !== STATUS_PENDING) { + throw new Error(`Promise already ${sinonPromise.status}`); + } + + sinonPromise.status = status; + callback(value); + } + + sinonPromise.resolve = function (value) { + finalize(STATUS_RESOLVED, value, fakeExecutor.firstCall.args[0]); + // Return the promise so that callers can await it: + return sinonPromise; + }; + sinonPromise.reject = function (reason) { + finalize(STATUS_REJECTED, reason, fakeExecutor.firstCall.args[1]); + // Return a new promise that resolves when the sinon promise was + // rejected, so that callers can await it: + return new Promise(function (resolve) { + sinonPromise.catch(() => resolve()); + }); + }; + + return sinonPromise; +} + +module.exports = promise; diff --git a/node_modules/sinon/lib/sinon/proxy-call-util.js b/node_modules/sinon/lib/sinon/proxy-call-util.js new file mode 100644 index 0000000..036e6e2 --- /dev/null +++ b/node_modules/sinon/lib/sinon/proxy-call-util.js @@ -0,0 +1,67 @@ +"use strict"; + +const push = require("@sinonjs/commons").prototypes.array.push; + +exports.incrementCallCount = function incrementCallCount(proxy) { + proxy.called = true; + proxy.callCount += 1; + proxy.notCalled = false; + proxy.calledOnce = proxy.callCount === 1; + proxy.calledTwice = proxy.callCount === 2; + proxy.calledThrice = proxy.callCount === 3; +}; + +exports.createCallProperties = function createCallProperties(proxy) { + proxy.firstCall = proxy.getCall(0); + proxy.secondCall = proxy.getCall(1); + proxy.thirdCall = proxy.getCall(2); + proxy.lastCall = proxy.getCall(proxy.callCount - 1); +}; + +exports.delegateToCalls = function delegateToCalls( + proxy, + method, + matchAny, + actual, + returnsValues, + notCalled, + totalCallCount, +) { + proxy[method] = function () { + if (!this.called) { + if (notCalled) { + return notCalled.apply(this, arguments); + } + return false; + } + + if (totalCallCount !== undefined && this.callCount !== totalCallCount) { + return false; + } + + let currentCall; + let matches = 0; + const returnValues = []; + + for (let i = 0, l = this.callCount; i < l; i += 1) { + currentCall = this.getCall(i); + const returnValue = currentCall[actual || method].apply( + currentCall, + arguments, + ); + push(returnValues, returnValue); + if (returnValue) { + matches += 1; + + if (matchAny) { + return true; + } + } + } + + if (returnsValues) { + return returnValues; + } + return matches === this.callCount; + }; +}; diff --git a/node_modules/sinon/lib/sinon/proxy-call.js b/node_modules/sinon/lib/sinon/proxy-call.js new file mode 100644 index 0000000..631328c --- /dev/null +++ b/node_modules/sinon/lib/sinon/proxy-call.js @@ -0,0 +1,306 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const match = require("@sinonjs/samsam").createMatcher; +const deepEqual = require("@sinonjs/samsam").deepEqual; +const functionName = require("@sinonjs/commons").functionName; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const join = arrayProto.join; +const map = arrayProto.map; +const reduce = arrayProto.reduce; +const slice = arrayProto.slice; + +/** + * @param proxy + * @param text + * @param args + */ +function throwYieldError(proxy, text, args) { + let msg = functionName(proxy) + text; + if (args.length) { + msg += ` Received [${join(slice(args), ", ")}]`; + } + throw new Error(msg); +} + +const callProto = { + calledOn: function calledOn(thisValue) { + if (match.isMatcher(thisValue)) { + return thisValue.test(this.thisValue); + } + return this.thisValue === thisValue; + }, + + calledWith: function calledWith() { + const self = this; + const calledWithArgs = slice(arguments); + + if (calledWithArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithArgs, + function (prev, arg, i) { + return prev && deepEqual(self.args[i], arg); + }, + true, + ); + }, + + calledWithMatch: function calledWithMatch() { + const self = this; + const calledWithMatchArgs = slice(arguments); + + if (calledWithMatchArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithMatchArgs, + function (prev, expectation, i) { + const actual = self.args[i]; + + return prev && match(expectation).test(actual); + }, + true, + ); + }, + + calledWithExactly: function calledWithExactly() { + return ( + arguments.length === this.args.length && + this.calledWith.apply(this, arguments) + ); + }, + + notCalledWith: function notCalledWith() { + return !this.calledWith.apply(this, arguments); + }, + + notCalledWithMatch: function notCalledWithMatch() { + return !this.calledWithMatch.apply(this, arguments); + }, + + returned: function returned(value) { + return deepEqual(this.returnValue, value); + }, + + threw: function threw(error) { + if (typeof error === "undefined" || !this.exception) { + return Boolean(this.exception); + } + + return this.exception === error || this.exception.name === error; + }, + + calledWithNew: function calledWithNew() { + return this.proxy.prototype && this.thisValue instanceof this.proxy; + }, + + calledBefore: function (other) { + return this.callId < other.callId; + }, + + calledAfter: function (other) { + return this.callId > other.callId; + }, + + calledImmediatelyBefore: function (other) { + return this.callId === other.callId - 1; + }, + + calledImmediatelyAfter: function (other) { + return this.callId === other.callId + 1; + }, + + callArg: function (pos) { + this.ensureArgIsAFunction(pos); + return this.args[pos](); + }, + + callArgOn: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + return this.args[pos].apply(thisValue); + }, + + callArgWith: function (pos) { + return this.callArgOnWith.apply( + this, + concat([pos, null], slice(arguments, 1)), + ); + }, + + callArgOnWith: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + const args = slice(arguments, 2); + return this.args[pos].apply(thisValue, args); + }, + + throwArg: function (pos) { + if (pos > this.args.length) { + throw new TypeError( + `Not enough arguments: ${pos} required but only ${this.args.length} present`, + ); + } + + throw this.args[pos]; + }, + + yield: function () { + return this.yieldOn.apply(this, concat([null], slice(arguments, 0))); + }, + + yieldOn: function (thisValue) { + const args = slice(this.args); + const yieldFn = filter(args, function (arg) { + return typeof arg === "function"; + })[0]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + " cannot yield since no callback was passed.", + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 1)); + }, + + yieldTo: function (prop) { + return this.yieldToOn.apply( + this, + concat([prop, null], slice(arguments, 1)), + ); + }, + + yieldToOn: function (prop, thisValue) { + const args = slice(this.args); + const yieldArg = filter(args, function (arg) { + return arg && typeof arg[prop] === "function"; + })[0]; + const yieldFn = yieldArg && yieldArg[prop]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + ` cannot yield to '${valueToString( + prop, + )}' since no callback was passed.`, + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 2)); + }, + + toString: function () { + if (!this.args) { + return ":("; + } + + let callStr = this.proxy ? `${String(this.proxy)}(` : ""; + const formattedArgs = map(this.args, function (arg) { + return inspect(arg); + }); + + callStr = `${callStr + join(formattedArgs, ", ")})`; + + if (typeof this.returnValue !== "undefined") { + callStr += ` => ${inspect(this.returnValue)}`; + } + + if (this.exception) { + callStr += ` !${this.exception.name}`; + + if (this.exception.message) { + callStr += `(${this.exception.message})`; + } + } + if (this.stack) { + // If we have a stack, add the first frame that's in end-user code + // Skip the first two frames because they will refer to Sinon code + callStr += (this.stack.split("\n")[3] || "unknown").replace( + /^\s*(?:at\s+|@)?/, + " at ", + ); + } + + return callStr; + }, + + ensureArgIsAFunction: function (pos) { + if (typeof this.args[pos] !== "function") { + throw new TypeError( + `Expected argument at position ${pos} to be a Function, but was ${typeof this + .args[pos]}`, + ); + } + }, +}; +Object.defineProperty(callProto, "stack", { + enumerable: true, + configurable: true, + get: function () { + return (this.errorWithCallStack && this.errorWithCallStack.stack) || ""; + }, +}); + +callProto.invokeCallback = callProto.yield; + +/** + * @param proxy + * @param thisValue + * @param args + * @param returnValue + * @param exception + * @param id + * @param errorWithCallStack + * + * @returns {object} proxyCall + */ +function createProxyCall( + proxy, + thisValue, + args, + returnValue, + exception, + id, + errorWithCallStack, +) { + if (typeof id !== "number") { + throw new TypeError("Call id is not a number"); + } + + let firstArg, lastArg; + + if (args.length > 0) { + firstArg = args[0]; + lastArg = args[args.length - 1]; + } + + const proxyCall = Object.create(callProto); + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + proxyCall.proxy = proxy; + proxyCall.thisValue = thisValue; + proxyCall.args = args; + proxyCall.firstArg = firstArg; + proxyCall.lastArg = lastArg; + proxyCall.callback = callback; + proxyCall.returnValue = returnValue; + proxyCall.exception = exception; + proxyCall.callId = id; + proxyCall.errorWithCallStack = errorWithCallStack; + + return proxyCall; +} +createProxyCall.toString = callProto.toString; // used by mocks + +module.exports = createProxyCall; diff --git a/node_modules/sinon/lib/sinon/proxy-invoke.js b/node_modules/sinon/lib/sinon/proxy-invoke.js new file mode 100644 index 0000000..1b120ec --- /dev/null +++ b/node_modules/sinon/lib/sinon/proxy-invoke.js @@ -0,0 +1,91 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyCallUtil = require("./proxy-call-util"); + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const concat = arrayProto.concat; +const ErrorConstructor = Error.prototype.constructor; +const bind = Function.prototype.bind; + +let callId = 0; + +module.exports = function invoke(func, thisValue, args) { + const matchings = this.matchingFakes(args); + const currentCallId = callId++; + let exception, returnValue; + + proxyCallUtil.incrementCallCount(this); + push(this.thisValues, thisValue); + push(this.args, args); + push(this.callIds, currentCallId); + forEach(matchings, function (matching) { + proxyCallUtil.incrementCallCount(matching); + push(matching.thisValues, thisValue); + push(matching.args, args); + push(matching.callIds, currentCallId); + }); + + // Make call properties available from within the spied function: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + try { + this.invoking = true; + + const thisCall = this.getCall(this.callCount - 1); + + if (thisCall.calledWithNew()) { + // Call through with `new` + returnValue = new (bind.apply( + this.func || func, + concat([thisValue], args), + ))(); + + if ( + typeof returnValue !== "object" && + typeof returnValue !== "function" + ) { + returnValue = thisValue; + } + } else { + returnValue = (this.func || func).apply(thisValue, args); + } + } catch (e) { + exception = e; + } finally { + delete this.invoking; + } + + push(this.exceptions, exception); + push(this.returnValues, returnValue); + forEach(matchings, function (matching) { + push(matching.exceptions, exception); + push(matching.returnValues, returnValue); + }); + + const err = new ErrorConstructor(); + // 1. Please do not get stack at this point. It may be so very slow, and not actually used + // 2. PhantomJS does not serialize the stack trace until the error has been thrown: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack + try { + throw err; + } catch (e) { + /* empty */ + } + push(this.errorsWithCallStack, err); + forEach(matchings, function (matching) { + push(matching.errorsWithCallStack, err); + }); + + // Make return value and exception available in the calls: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + if (exception !== undefined) { + throw exception; + } + + return returnValue; +}; diff --git a/node_modules/sinon/lib/sinon/proxy.js b/node_modules/sinon/lib/sinon/proxy.js new file mode 100644 index 0000000..47a1370 --- /dev/null +++ b/node_modules/sinon/lib/sinon/proxy.js @@ -0,0 +1,369 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const extend = require("./util/core/extend"); +const functionToString = require("./util/core/function-to-string"); +const proxyCall = require("./proxy-call"); +const proxyCallUtil = require("./proxy-call-util"); +const proxyInvoke = require("./proxy-invoke"); +const inspect = require("util").inspect; + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const slice = arrayProto.slice; + +const emptyFakes = Object.freeze([]); + +// Public API +const proxyApi = { + toString: functionToString, + + named: function named(name) { + this.displayName = name; + const nameDescriptor = Object.getOwnPropertyDescriptor(this, "name"); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + nameDescriptor.value = name; + Object.defineProperty(this, "name", nameDescriptor); + } + return this; + }, + + invoke: proxyInvoke, + + /* + * Hook for derived implementation to return fake instances matching the + * given arguments. + */ + matchingFakes: function (/*args, strict*/) { + return emptyFakes; + }, + + getCall: function getCall(index) { + let i = index; + if (i < 0) { + // Negative indices means counting backwards from the last call + i += this.callCount; + } + if (i < 0 || i >= this.callCount) { + return null; + } + + return proxyCall( + this, + this.thisValues[i], + this.args[i], + this.returnValues[i], + this.exceptions[i], + this.callIds[i], + this.errorsWithCallStack[i], + ); + }, + + getCalls: function () { + const calls = []; + let i; + + for (i = 0; i < this.callCount; i++) { + push(calls, this.getCall(i)); + } + + return calls; + }, + + calledBefore: function calledBefore(proxy) { + if (!this.called) { + return false; + } + + if (!proxy.called) { + return true; + } + + return this.callIds[0] < proxy.callIds[proxy.callIds.length - 1]; + }, + + calledAfter: function calledAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return this.callIds[this.callCount - 1] > proxy.callIds[0]; + }, + + calledImmediatelyBefore: function calledImmediatelyBefore(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] - 1 + ); + }, + + calledImmediatelyAfter: function calledImmediatelyAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] + 1 + ); + }, + + formatters: require("./spy-formatters"), + printf: function (format) { + const spyInstance = this; + const args = slice(arguments, 1); + let formatter; + + return (format || "").replace(/%(.)/g, function (match, specifier) { + formatter = proxyApi.formatters[specifier]; + + if (typeof formatter === "function") { + return String(formatter(spyInstance, args)); + } else if (!isNaN(parseInt(specifier, 10))) { + return inspect(args[specifier - 1]); + } + + return `%${specifier}`; + }); + }, + + resetHistory: function () { + if (this.invoking) { + const err = new Error( + "Cannot reset Sinon function while invoking it. " + + "Move the call to .resetHistory outside of the callback.", + ); + err.name = "InvalidResetException"; + throw err; + } + + this.called = false; + this.notCalled = true; + this.calledOnce = false; + this.calledTwice = false; + this.calledThrice = false; + this.callCount = 0; + this.firstCall = null; + this.secondCall = null; + this.thirdCall = null; + this.lastCall = null; + this.args = []; + this.firstArg = null; + this.lastArg = null; + this.returnValues = []; + this.thisValues = []; + this.exceptions = []; + this.callIds = []; + this.errorsWithCallStack = []; + + if (this.fakes) { + forEach(this.fakes, function (fake) { + fake.resetHistory(); + }); + } + + return this; + }, +}; + +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(proxyApi, "calledOn", true); +delegateToCalls(proxyApi, "alwaysCalledOn", false, "calledOn"); +delegateToCalls(proxyApi, "calledWith", true); +delegateToCalls( + proxyApi, + "calledOnceWith", + true, + "calledWith", + false, + undefined, + 1, +); +delegateToCalls(proxyApi, "calledWithMatch", true); +delegateToCalls(proxyApi, "alwaysCalledWith", false, "calledWith"); +delegateToCalls(proxyApi, "alwaysCalledWithMatch", false, "calledWithMatch"); +delegateToCalls(proxyApi, "calledWithExactly", true); +delegateToCalls( + proxyApi, + "calledOnceWithExactly", + true, + "calledWithExactly", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "calledOnceWithMatch", + true, + "calledWithMatch", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "alwaysCalledWithExactly", + false, + "calledWithExactly", +); +delegateToCalls( + proxyApi, + "neverCalledWith", + false, + "notCalledWith", + false, + function () { + return true; + }, +); +delegateToCalls( + proxyApi, + "neverCalledWithMatch", + false, + "notCalledWithMatch", + false, + function () { + return true; + }, +); +delegateToCalls(proxyApi, "threw", true); +delegateToCalls(proxyApi, "alwaysThrew", false, "threw"); +delegateToCalls(proxyApi, "returned", true); +delegateToCalls(proxyApi, "alwaysReturned", false, "returned"); +delegateToCalls(proxyApi, "calledWithNew", true); +delegateToCalls(proxyApi, "alwaysCalledWithNew", false, "calledWithNew"); + +function createProxy(func, originalFunc) { + const proxy = wrapFunction(func, originalFunc); + + // Inherit function properties: + extend(proxy, func); + + proxy.prototype = func.prototype; + + extend.nonEnum(proxy, proxyApi); + + return proxy; +} + +function wrapFunction(func, originalFunc) { + const arity = originalFunc.length; + let p; + // Do not change this to use an eval. Projects that depend on sinon block the use of eval. + // ref: https://github.com/sinonjs/sinon/issues/710 + switch (arity) { + /*eslint-disable no-unused-vars, max-len*/ + case 0: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 1: + p = function proxy(a) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 2: + p = function proxy(a, b) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 3: + p = function proxy(a, b, c) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 4: + p = function proxy(a, b, c, d) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 5: + p = function proxy(a, b, c, d, e) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 6: + p = function proxy(a, b, c, d, e, f) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 7: + p = function proxy(a, b, c, d, e, f, g) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 8: + p = function proxy(a, b, c, d, e, f, g, h) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 9: + p = function proxy(a, b, c, d, e, f, g, h, i) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 10: + p = function proxy(a, b, c, d, e, f, g, h, i, j) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 11: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 12: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k, l) { + return p.invoke(func, this, slice(arguments)); + }; + break; + default: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + /*eslint-enable*/ + } + const nameDescriptor = Object.getOwnPropertyDescriptor( + originalFunc, + "name", + ); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + Object.defineProperty(p, "name", nameDescriptor); + } + extend.nonEnum(p, { + isSinonProxy: true, + + called: false, + notCalled: true, + calledOnce: false, + calledTwice: false, + calledThrice: false, + callCount: 0, + firstCall: null, + firstArg: null, + secondCall: null, + thirdCall: null, + lastCall: null, + lastArg: null, + args: [], + returnValues: [], + thisValues: [], + exceptions: [], + callIds: [], + errorsWithCallStack: [], + }); + return p; +} + +module.exports = createProxy; diff --git a/node_modules/sinon/lib/sinon/restore-object.js b/node_modules/sinon/lib/sinon/restore-object.js new file mode 100644 index 0000000..ace8622 --- /dev/null +++ b/node_modules/sinon/lib/sinon/restore-object.js @@ -0,0 +1,17 @@ +"use strict"; + +const walkObject = require("./util/core/walk-object"); + +function filter(object, property) { + return object[property].restore && object[property].restore.sinon; +} + +function restore(object, property) { + object[property].restore(); +} + +function restoreObject(object) { + return walkObject(restore, object, filter); +} + +module.exports = restoreObject; diff --git a/node_modules/sinon/lib/sinon/sandbox.js b/node_modules/sinon/lib/sinon/sandbox.js new file mode 100644 index 0000000..7c52872 --- /dev/null +++ b/node_modules/sinon/lib/sinon/sandbox.js @@ -0,0 +1,494 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const logger = require("@sinonjs/commons").deprecated; +const collectOwnMethods = require("./collect-own-methods"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const match = require("@sinonjs/samsam").createMatcher; +const sinonAssert = require("./assert"); +const sinonClock = require("./util/fake-timers"); +const sinonMock = require("./mock"); +const sinonSpy = require("./spy"); +const sinonStub = require("./stub"); +const sinonCreateStubInstance = require("./create-stub-instance"); +const sinonFake = require("./fake"); +const valueToString = require("@sinonjs/commons").valueToString; + +const DEFAULT_LEAK_THRESHOLD = 10000; + +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const reverse = arrayProto.reverse; + +function applyOnEach(fakes, method) { + const matchingFakes = filter(fakes, function (fake) { + return typeof fake[method] === "function"; + }); + + forEach(matchingFakes, function (fake) { + fake[method](); + }); +} + +function throwOnAccessors(descriptor) { + if (typeof descriptor.get === "function") { + throw new Error("Use sandbox.replaceGetter for replacing getters"); + } + + if (typeof descriptor.set === "function") { + throw new Error("Use sandbox.replaceSetter for replacing setters"); + } +} + +function verifySameType(object, property, replacement) { + if (typeof object[property] !== typeof replacement) { + throw new TypeError( + `Cannot replace ${typeof object[ + property + ]} with ${typeof replacement}`, + ); + } +} + +function checkForValidArguments(descriptor, property, replacement) { + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}. Perhaps you meant sandbox.define()?`, + ); + } + + if (typeof replacement === "undefined") { + throw new TypeError("Expected replacement argument to be defined"); + } +} + +/** + * A sinon sandbox + * + * @param opts + * @param {object} [opts.assertOptions] see the CreateAssertOptions in ./assert + * @class + */ +function Sandbox(opts = {}) { + const sandbox = this; + const assertOptions = opts.assertOptions || {}; + let fakeRestorers = []; + + let collection = []; + let loggedLeakWarning = false; + sandbox.leakThreshold = DEFAULT_LEAK_THRESHOLD; + + function addToCollection(object) { + if ( + push(collection, object) > sandbox.leakThreshold && + !loggedLeakWarning + ) { + // eslint-disable-next-line no-console + logger.printWarning( + "Potential memory leak detected; be sure to call restore() to clean up your sandbox. To suppress this warning, modify the leakThreshold property of your sandbox.", + ); + loggedLeakWarning = true; + } + } + + sandbox.assert = sinonAssert.createAssertObject(assertOptions); + + // this is for testing only + sandbox.getFakes = function getFakes() { + return collection; + }; + + sandbox.createStubInstance = function createStubInstance() { + const stubbed = sinonCreateStubInstance.apply(null, arguments); + + const ownMethods = collectOwnMethods(stubbed); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + + return stubbed; + }; + + sandbox.inject = function inject(obj) { + obj.spy = function () { + return sandbox.spy.apply(null, arguments); + }; + + obj.stub = function () { + return sandbox.stub.apply(null, arguments); + }; + + obj.mock = function () { + return sandbox.mock.apply(null, arguments); + }; + + obj.createStubInstance = function () { + return sandbox.createStubInstance.apply(sandbox, arguments); + }; + + obj.fake = function () { + return sandbox.fake.apply(null, arguments); + }; + + obj.define = function () { + return sandbox.define.apply(null, arguments); + }; + + obj.replace = function () { + return sandbox.replace.apply(null, arguments); + }; + + obj.replaceSetter = function () { + return sandbox.replaceSetter.apply(null, arguments); + }; + + obj.replaceGetter = function () { + return sandbox.replaceGetter.apply(null, arguments); + }; + + if (sandbox.clock) { + obj.clock = sandbox.clock; + } + + obj.match = match; + + return obj; + }; + + sandbox.mock = function mock() { + const m = sinonMock.apply(null, arguments); + + addToCollection(m); + + return m; + }; + + sandbox.reset = function reset() { + applyOnEach(collection, "reset"); + applyOnEach(collection, "resetHistory"); + }; + + sandbox.resetBehavior = function resetBehavior() { + applyOnEach(collection, "resetBehavior"); + }; + + sandbox.resetHistory = function resetHistory() { + function privateResetHistory(f) { + const method = f.resetHistory || f.reset; + if (method) { + method.call(f); + } + } + + forEach(collection, privateResetHistory); + }; + + sandbox.restore = function restore() { + if (arguments.length) { + throw new Error( + "sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()", + ); + } + + reverse(collection); + applyOnEach(collection, "restore"); + collection = []; + + forEach(fakeRestorers, function (restorer) { + restorer(); + }); + fakeRestorers = []; + + sandbox.restoreContext(); + }; + + sandbox.restoreContext = function restoreContext() { + if (!sandbox.injectedKeys) { + return; + } + + forEach(sandbox.injectedKeys, function (injectedKey) { + delete sandbox.injectInto[injectedKey]; + }); + + sandbox.injectedKeys.length = 0; + }; + + /** + * Creates a restorer function for the property + * + * @param {object|Function} object + * @param {string} property + * @param {boolean} forceAssignment + * @returns {Function} restorer function + */ + function getFakeRestorer(object, property, forceAssignment = false) { + const descriptor = getPropertyDescriptor(object, property); + const value = forceAssignment && object[property]; + + function restorer() { + if (forceAssignment) { + object[property] = value; + } else if (descriptor?.isOwn) { + Object.defineProperty(object, property, descriptor); + } else { + delete object[property]; + } + } + + restorer.object = object; + restorer.property = property; + return restorer; + } + + function verifyNotReplaced(object, property) { + forEach(fakeRestorers, function (fakeRestorer) { + if ( + fakeRestorer.object === object && + fakeRestorer.property === property + ) { + throw new TypeError( + `Attempted to replace ${property} which is already replaced`, + ); + } + }); + } + + /** + * Replace an existing property + * + * @param {object|Function} object + * @param {string} property + * @param {*} replacement a fake, stub, spy or any other value + * @returns {*} + */ + sandbox.replace = function replace(object, property, replacement) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + throwOnAccessors(descriptor); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.replace.usingAccessor = function replaceUsingAccessor( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property, true)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.define = function define(object, property, value) { + const descriptor = getPropertyDescriptor(object, property); + + if (descriptor) { + throw new TypeError( + `Cannot define the already existing property ${valueToString( + property, + )}. Perhaps you meant sandbox.replace()?`, + ); + } + + if (typeof value === "undefined") { + throw new TypeError("Expected value argument to be defined"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the defined property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = value; + + return value; + }; + + sandbox.replaceGetter = function replaceGetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.get !== "function") { + throw new Error("`object.property` is not a getter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + Object.defineProperty(object, property, { + get: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + sandbox.replaceSetter = function replaceSetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.set !== "function") { + throw new Error("`object.property` is not a setter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + // eslint-disable-next-line accessor-pairs + Object.defineProperty(object, property, { + set: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + function commonPostInitSetup(args, spy) { + const [object, property, types] = args; + + const isSpyingOnEntireObject = + typeof property === "undefined" && typeof object === "object"; + + if (isSpyingOnEntireObject) { + const ownMethods = collectOwnMethods(spy); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + } else if (Array.isArray(types)) { + for (const accessorType of types) { + addToCollection(spy[accessorType]); + } + } else { + addToCollection(spy); + } + + return spy; + } + + sandbox.spy = function spy() { + const createdSpy = sinonSpy.apply(sinonSpy, arguments); + return commonPostInitSetup(arguments, createdSpy); + }; + + sandbox.stub = function stub() { + const createdStub = sinonStub.apply(sinonStub, arguments); + return commonPostInitSetup(arguments, createdStub); + }; + + // eslint-disable-next-line no-unused-vars + sandbox.fake = function fake(f) { + const s = sinonFake.apply(sinonFake, arguments); + + addToCollection(s); + + return s; + }; + + forEach(Object.keys(sinonFake), function (key) { + const fakeBehavior = sinonFake[key]; + if (typeof fakeBehavior === "function") { + sandbox.fake[key] = function () { + const s = fakeBehavior.apply(fakeBehavior, arguments); + + addToCollection(s); + + return s; + }; + } + }); + + sandbox.useFakeTimers = function useFakeTimers(args) { + const clock = sinonClock.useFakeTimers.call(null, args); + + sandbox.clock = clock; + addToCollection(clock); + + return clock; + }; + + sandbox.verify = function verify() { + applyOnEach(collection, "verify"); + }; + + sandbox.verifyAndRestore = function verifyAndRestore() { + let exception; + + try { + sandbox.verify(); + } catch (e) { + exception = e; + } + + sandbox.restore(); + + if (exception) { + throw exception; + } + }; +} + +Sandbox.prototype.match = match; + +module.exports = Sandbox; diff --git a/node_modules/sinon/lib/sinon/spy-formatters.js b/node_modules/sinon/lib/sinon/spy-formatters.js new file mode 100644 index 0000000..d5e67fa --- /dev/null +++ b/node_modules/sinon/lib/sinon/spy-formatters.js @@ -0,0 +1,163 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Colorizer = require("./colorizer"); +const colororizer = new Colorizer(); +const match = require("@sinonjs/samsam").createMatcher; +const timesInWords = require("./util/core/times-in-words"); +const inspect = require("util").inspect; +const jsDiff = require("diff"); + +const join = arrayProto.join; +const map = arrayProto.map; +const push = arrayProto.push; +const slice = arrayProto.slice; + +/** + * + * @param matcher + * @param calledArg + * @param calledArgMessage + * + * @returns {string} the colored text + */ +function colorSinonMatchText(matcher, calledArg, calledArgMessage) { + let calledArgumentMessage = calledArgMessage; + let matcherMessage = matcher.message; + if (!matcher.test(calledArg)) { + matcherMessage = colororizer.red(matcher.message); + if (calledArgumentMessage) { + calledArgumentMessage = colororizer.green(calledArgumentMessage); + } + } + return `${calledArgumentMessage} ${matcherMessage}`; +} + +/** + * @param diff + * + * @returns {string} the colored diff + */ +function colorDiffText(diff) { + const objects = map(diff, function (part) { + let text = part.value; + if (part.added) { + text = colororizer.green(text); + } else if (part.removed) { + text = colororizer.red(text); + } + if (diff.length === 2) { + text += " "; // format simple diffs + } + return text; + }); + return join(objects, ""); +} + +/** + * + * @param value + * @returns {string} a quoted string + */ +function quoteStringValue(value) { + if (typeof value === "string") { + return JSON.stringify(value); + } + return value; +} + +module.exports = { + c: function (spyInstance) { + return timesInWords(spyInstance.callCount); + }, + + n: function (spyInstance) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return spyInstance.toString(); + }, + + D: function (spyInstance, args) { + let message = ""; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // describe multiple calls + if (l > 1) { + message += `\nCall ${i + 1}:`; + } + const calledArgs = spyInstance.getCall(i).args; + const expectedArgs = slice(args); + + for ( + let j = 0; + j < calledArgs.length || j < expectedArgs.length; + ++j + ) { + let calledArg = calledArgs[j]; + let expectedArg = expectedArgs[j]; + if (calledArg) { + calledArg = quoteStringValue(calledArg); + } + + if (expectedArg) { + expectedArg = quoteStringValue(expectedArg); + } + + message += "\n"; + + const calledArgMessage = + j < calledArgs.length ? inspect(calledArg) : ""; + if (match.isMatcher(expectedArg)) { + message += colorSinonMatchText( + expectedArg, + calledArg, + calledArgMessage, + ); + } else { + const expectedArgMessage = + j < expectedArgs.length ? inspect(expectedArg) : ""; + const diff = jsDiff.diffJson( + calledArgMessage, + expectedArgMessage, + ); + message += colorDiffText(diff); + } + } + } + + return message; + }, + + C: function (spyInstance) { + const calls = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + let stringifiedCall = ` ${spyInstance.getCall(i).toString()}`; + if (/\n/.test(calls[i - 1])) { + stringifiedCall = `\n${stringifiedCall}`; + } + push(calls, stringifiedCall); + } + + return calls.length > 0 ? `\n${join(calls, "\n")}` : ""; + }, + + t: function (spyInstance) { + const objects = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + push(objects, inspect(spyInstance.thisValues[i])); + } + + return join(objects, ", "); + }, + + "*": function (spyInstance, args) { + return join( + map(args, function (arg) { + return inspect(arg); + }), + ", ", + ); + }, +}; diff --git a/node_modules/sinon/lib/sinon/spy.js b/node_modules/sinon/lib/sinon/spy.js new file mode 100644 index 0000000..a10e26b --- /dev/null +++ b/node_modules/sinon/lib/sinon/spy.js @@ -0,0 +1,192 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const extend = require("./util/core/extend"); +const functionName = require("@sinonjs/commons").functionName; +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const isEsModule = require("./util/core/is-es-module"); +const proxyCallUtil = require("./proxy-call-util"); +const walkObject = require("./util/core/walk-object"); +const wrapMethod = require("./util/core/wrap-method"); +const valueToString = require("@sinonjs/commons").valueToString; + +/* cache references to library methods so that they also can be stubbed without problems */ +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const push = arrayProto.push; +const slice = arrayProto.slice; +const filter = Array.prototype.filter; + +let uuid = 0; + +function matches(fake, args, strict) { + const margs = fake.matchingArguments; + if ( + margs.length <= args.length && + deepEqual(slice(args, 0, margs.length), margs) + ) { + return !strict || margs.length === args.length; + } + return false; +} + +// Public API +const spyApi = { + withArgs: function () { + const args = slice(arguments); + const matching = pop(this.matchingFakes(args, true)); + if (matching) { + return matching; + } + + const original = this; + const fake = this.instantiateFake(); + fake.matchingArguments = args; + fake.parent = this; + push(this.fakes, fake); + + fake.withArgs = function () { + return original.withArgs.apply(original, arguments); + }; + + forEach(original.args, function (arg, i) { + if (!matches(fake, arg)) { + return; + } + + proxyCallUtil.incrementCallCount(fake); + push(fake.thisValues, original.thisValues[i]); + push(fake.args, arg); + push(fake.returnValues, original.returnValues[i]); + push(fake.exceptions, original.exceptions[i]); + push(fake.callIds, original.callIds[i]); + }); + + proxyCallUtil.createCallProperties(fake); + + return fake; + }, + + // Override proxy default implementation + matchingFakes: function (args, strict) { + return filter.call(this.fakes, function (fake) { + return matches(fake, args, strict); + }); + }, +}; + +/* eslint-disable @sinonjs/no-prototype-methods/no-prototype-methods */ +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(spyApi, "callArg", false, "callArgWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgWith = spyApi.callArg; +delegateToCalls(spyApi, "callArgOn", false, "callArgOnWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgOnWith = spyApi.callArgOn; +delegateToCalls(spyApi, "throwArg", false, "throwArg", false, function () { + throw new Error( + `${this.toString()} cannot throw arg since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yield", false, "yield", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +// "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode. +spyApi.invokeCallback = spyApi.yield; +delegateToCalls(spyApi, "yieldOn", false, "yieldOn", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yieldTo", false, "yieldTo", true, function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); +}); +delegateToCalls( + spyApi, + "yieldToOn", + false, + "yieldToOn", + true, + function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); + }, +); + +function createSpy(func) { + let name; + let funk = func; + + if (typeof funk !== "function") { + funk = function () { + return; + }; + } else { + name = functionName(funk); + } + + const proxy = createProxy(funk, funk); + + // Inherit spy API: + extend.nonEnum(proxy, spyApi); + extend.nonEnum(proxy, { + displayName: name || "spy", + fakes: [], + instantiateFake: createSpy, + id: `spy#${uuid++}`, + }); + return proxy; +} + +function spy(object, property, types) { + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be spied"); + } + + if (!property && typeof object === "function") { + return createSpy(object); + } + + if (!property && typeof object === "object") { + return walkObject(spy, object); + } + + if (!object && !property) { + return createSpy(function () { + return; + }); + } + + if (!types) { + return wrapMethod(object, property, createSpy(object[property])); + } + + const descriptor = {}; + const methodDesc = getPropertyDescriptor(object, property); + + forEach(types, function (type) { + descriptor[type] = createSpy(methodDesc[type]); + }); + + return wrapMethod(object, property, descriptor); +} + +extend(spy, spyApi); +module.exports = spy; diff --git a/node_modules/sinon/lib/sinon/stub.js b/node_modules/sinon/lib/sinon/stub.js new file mode 100644 index 0000000..8b9efc9 --- /dev/null +++ b/node_modules/sinon/lib/sinon/stub.js @@ -0,0 +1,257 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const behavior = require("./behavior"); +const behaviors = require("./default-behaviors"); +const createProxy = require("./proxy"); +const functionName = require("@sinonjs/commons").functionName; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const isNonExistentProperty = require("./util/core/is-non-existent-property"); +const spy = require("./spy"); +const extend = require("./util/core/extend"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isEsModule = require("./util/core/is-es-module"); +const sinonType = require("./util/core/sinon-type"); +const wrapMethod = require("./util/core/wrap-method"); +const throwOnFalsyObject = require("./throw-on-falsy-object"); +const valueToString = require("@sinonjs/commons").valueToString; +const walkObject = require("./util/core/walk-object"); + +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const slice = arrayProto.slice; +const sort = arrayProto.sort; + +let uuid = 0; + +function createStub(originalFunc) { + // eslint-disable-next-line prefer-const + let proxy; + + function functionStub() { + const args = slice(arguments); + const matchings = proxy.matchingFakes(args); + + const fnStub = + pop( + sort(matchings, function (a, b) { + return ( + a.matchingArguments.length - b.matchingArguments.length + ); + }), + ) || proxy; + return getCurrentBehavior(fnStub).invoke(this, arguments); + } + + proxy = createProxy(functionStub, originalFunc || functionStub); + // Inherit spy API: + extend.nonEnum(proxy, spy); + // Inherit stub API: + extend.nonEnum(proxy, stub); + + const name = originalFunc ? functionName(originalFunc) : null; + extend.nonEnum(proxy, { + fakes: [], + instantiateFake: createStub, + displayName: name || "stub", + defaultBehavior: null, + behaviors: [], + id: `stub#${uuid++}`, + }); + + sinonType.set(proxy, "stub"); + + return proxy; +} + +function stub(object, property) { + if (arguments.length > 2) { + throw new TypeError( + "stub(obj, 'meth', fn) has been removed, see documentation", + ); + } + + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be stubbed"); + } + + throwOnFalsyObject.apply(null, arguments); + + if (isNonExistentProperty(object, property)) { + throw new TypeError( + `Cannot stub non-existent property ${valueToString(property)}`, + ); + } + + const actualDescriptor = getPropertyDescriptor(object, property); + + assertValidPropertyDescriptor(actualDescriptor, property); + + const isObjectOrFunction = + typeof object === "object" || typeof object === "function"; + const isStubbingEntireObject = + typeof property === "undefined" && isObjectOrFunction; + const isCreatingNewStub = !object && typeof property === "undefined"; + const isStubbingNonFuncProperty = + isObjectOrFunction && + typeof property !== "undefined" && + (typeof actualDescriptor === "undefined" || + typeof actualDescriptor.value !== "function"); + + if (isStubbingEntireObject) { + return walkObject(stub, object); + } + + if (isCreatingNewStub) { + return createStub(); + } + + const func = + typeof actualDescriptor.value === "function" + ? actualDescriptor.value + : null; + const s = createStub(func); + + extend.nonEnum(s, { + rootObj: object, + propName: property, + shadowsPropOnPrototype: !actualDescriptor.isOwn, + restore: function restore() { + if (actualDescriptor !== undefined && actualDescriptor.isOwn) { + Object.defineProperty(object, property, actualDescriptor); + return; + } + + delete object[property]; + }, + }); + + return isStubbingNonFuncProperty ? s : wrapMethod(object, property, s); +} + +function assertValidPropertyDescriptor(descriptor, property) { + if (!descriptor || !property) { + return; + } + if (descriptor.isOwn && !descriptor.configurable && !descriptor.writable) { + throw new TypeError( + `Descriptor for property ${property} is non-configurable and non-writable`, + ); + } + if ((descriptor.get || descriptor.set) && !descriptor.configurable) { + throw new TypeError( + `Descriptor for accessor property ${property} is non-configurable`, + ); + } + if (isDataDescriptor(descriptor) && !descriptor.writable) { + throw new TypeError( + `Descriptor for data property ${property} is non-writable`, + ); + } +} + +function isDataDescriptor(descriptor) { + return ( + !descriptor.value && + !descriptor.writable && + !descriptor.set && + !descriptor.get + ); +} + +/*eslint-disable no-use-before-define*/ +function getParentBehaviour(stubInstance) { + return stubInstance.parent && getCurrentBehavior(stubInstance.parent); +} + +function getDefaultBehavior(stubInstance) { + return ( + stubInstance.defaultBehavior || + getParentBehaviour(stubInstance) || + behavior.create(stubInstance) + ); +} + +function getCurrentBehavior(stubInstance) { + const currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1]; + return currentBehavior && currentBehavior.isPresent() + ? currentBehavior + : getDefaultBehavior(stubInstance); +} +/*eslint-enable no-use-before-define*/ + +const proto = { + resetBehavior: function () { + this.defaultBehavior = null; + this.behaviors = []; + + delete this.returnValue; + delete this.returnArgAt; + delete this.throwArgAt; + delete this.resolveArgAt; + delete this.fakeFn; + this.returnThis = false; + this.resolveThis = false; + + forEach(this.fakes, function (fake) { + fake.resetBehavior(); + }); + }, + + reset: function () { + this.resetHistory(); + this.resetBehavior(); + }, + + onCall: function onCall(index) { + if (!this.behaviors[index]) { + this.behaviors[index] = behavior.create(this); + } + + return this.behaviors[index]; + }, + + onFirstCall: function onFirstCall() { + return this.onCall(0); + }, + + onSecondCall: function onSecondCall() { + return this.onCall(1); + }, + + onThirdCall: function onThirdCall() { + return this.onCall(2); + }, + + withArgs: function withArgs() { + const fake = spy.withArgs.apply(this, arguments); + if (this.defaultBehavior && this.defaultBehavior.promiseLibrary) { + fake.defaultBehavior = + fake.defaultBehavior || behavior.create(fake); + fake.defaultBehavior.promiseLibrary = + this.defaultBehavior.promiseLibrary; + } + return fake; + }, +}; + +forEach(Object.keys(behavior), function (method) { + if ( + hasOwnProperty(behavior, method) && + !hasOwnProperty(proto, method) && + method !== "create" && + method !== "invoke" + ) { + proto[method] = behavior.createBehavior(method); + } +}); + +forEach(Object.keys(behaviors), function (method) { + if (hasOwnProperty(behaviors, method) && !hasOwnProperty(proto, method)) { + behavior.addBehavior(stub, method, behaviors[method]); + } +}); + +extend(stub, proto); +module.exports = stub; diff --git a/node_modules/sinon/lib/sinon/throw-on-falsy-object.js b/node_modules/sinon/lib/sinon/throw-on-falsy-object.js new file mode 100644 index 0000000..173082e --- /dev/null +++ b/node_modules/sinon/lib/sinon/throw-on-falsy-object.js @@ -0,0 +1,13 @@ +"use strict"; +const valueToString = require("@sinonjs/commons").valueToString; + +function throwOnFalsyObject(object, property) { + if (property && !object) { + const type = object === null ? "null" : "undefined"; + throw new Error( + `Trying to stub property '${valueToString(property)}' of ${type}`, + ); + } +} + +module.exports = throwOnFalsyObject; diff --git a/node_modules/sinon/lib/sinon/util/core/export-async-behaviors.js b/node_modules/sinon/lib/sinon/util/core/export-async-behaviors.js new file mode 100644 index 0000000..49caa26 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/export-async-behaviors.js @@ -0,0 +1,25 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const reduce = arrayProto.reduce; + +module.exports = function exportAsyncBehaviors(behaviorMethods) { + return reduce( + Object.keys(behaviorMethods), + function (acc, method) { + // need to avoid creating another async versions of the newly added async methods + if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { + acc[`${method}Async`] = function () { + const result = behaviorMethods[method].apply( + this, + arguments, + ); + this.callbackAsync = true; + return result; + }; + } + return acc; + }, + {}, + ); +}; diff --git a/node_modules/sinon/lib/sinon/util/core/extend.js b/node_modules/sinon/lib/sinon/util/core/extend.js new file mode 100644 index 0000000..4fef772 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/extend.js @@ -0,0 +1,161 @@ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; + +const join = arrayProto.join; +const push = arrayProto.push; + +// Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug +const hasDontEnumBug = (function () { + const obj = { + constructor: function () { + return "0"; + }, + toString: function () { + return "1"; + }, + valueOf: function () { + return "2"; + }, + toLocaleString: function () { + return "3"; + }, + prototype: function () { + return "4"; + }, + isPrototypeOf: function () { + return "5"; + }, + propertyIsEnumerable: function () { + return "6"; + }, + hasOwnProperty: function () { + return "7"; + }, + length: function () { + return "8"; + }, + unique: function () { + return "9"; + }, + }; + + const result = []; + for (const prop in obj) { + if (hasOwnProperty(obj, prop)) { + push(result, obj[prop]()); + } + } + return join(result, "") !== "0123456789"; +})(); + +/** + * + * @param target + * @param sources + * @param doCopy + * @returns {*} target + */ +function extendCommon(target, sources, doCopy) { + let source, i, prop; + + for (i = 0; i < sources.length; i++) { + source = sources[i]; + + for (prop in source) { + if (hasOwnProperty(source, prop)) { + doCopy(target, source, prop); + } + } + + // Make sure we copy (own) toString method even when in JScript with DontEnum bug + // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug + if ( + hasDontEnumBug && + hasOwnProperty(source, "toString") && + source.toString !== target.toString + ) { + target.toString = source.toString; + } + } + + return target; +} + +/** + * Public: Extend target in place with all (own) properties, except 'name' when [[writable]] is false, + * from sources in-order. Thus, last source will override properties in previous sources. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports = function extend(target, ...sources) { + return extendCommon( + target, + sources, + function copyValue(dest, source, prop) { + const destOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + dest, + prop, + ); + const sourceOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + source, + prop, + ); + + if (prop === "name" && !destOwnPropertyDescriptor.writable) { + return; + } + const descriptors = { + configurable: sourceOwnPropertyDescriptor.configurable, + enumerable: sourceOwnPropertyDescriptor.enumerable, + }; + /* + if the source has an Accessor property copy over the accessor functions (get and set) + data properties has writable attribute where as accessor property don't + REF: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#properties + */ + + if (hasOwnProperty(sourceOwnPropertyDescriptor, "writable")) { + descriptors.writable = sourceOwnPropertyDescriptor.writable; + descriptors.value = sourceOwnPropertyDescriptor.value; + } else { + if (sourceOwnPropertyDescriptor.get) { + descriptors.get = + sourceOwnPropertyDescriptor.get.bind(dest); + } + if (sourceOwnPropertyDescriptor.set) { + descriptors.set = + sourceOwnPropertyDescriptor.set.bind(dest); + } + } + Object.defineProperty(dest, prop, descriptors); + }, + ); +}; + +/** + * Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will + * override properties in previous sources. Define the properties as non enumerable. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports.nonEnum = function extendNonEnum(target, ...sources) { + return extendCommon( + target, + sources, + function copyProperty(dest, source, prop) { + Object.defineProperty(dest, prop, { + value: source[prop], + enumerable: false, + configurable: true, + writable: true, + }); + }, + ); +}; diff --git a/node_modules/sinon/lib/sinon/util/core/function-to-string.js b/node_modules/sinon/lib/sinon/util/core/function-to-string.js new file mode 100644 index 0000000..cd43fff --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/function-to-string.js @@ -0,0 +1,25 @@ +"use strict"; + +module.exports = function toString() { + let i, prop, thisValue; + if (this.getCall && this.callCount) { + i = this.callCount; + + while (i--) { + thisValue = this.getCall(i).thisValue; + + // eslint-disable-next-line guard-for-in + for (prop in thisValue) { + try { + if (thisValue[prop] === this) { + return prop; + } + } catch (e) { + // no-op - accessing props can throw an error, nothing to do here + } + } + } + } + + return this.displayName || "sinon fake"; +}; diff --git a/node_modules/sinon/lib/sinon/util/core/get-next-tick.js b/node_modules/sinon/lib/sinon/util/core/get-next-tick.js new file mode 100644 index 0000000..9f730e4 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/get-next-tick.js @@ -0,0 +1,18 @@ +"use strict"; + +/* istanbul ignore next : not testing that setTimeout works */ +function nextTick(callback) { + setTimeout(callback, 0); +} + +module.exports = function getNextTick(process, setImmediate) { + if (typeof process === "object" && typeof process.nextTick === "function") { + return process.nextTick; + } + + if (typeof setImmediate === "function") { + return setImmediate; + } + + return nextTick; +}; diff --git a/node_modules/sinon/lib/sinon/util/core/get-property-descriptor.js b/node_modules/sinon/lib/sinon/util/core/get-property-descriptor.js new file mode 100644 index 0000000..c676ac5 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/get-property-descriptor.js @@ -0,0 +1,55 @@ +"use strict"; + +/** + * @typedef {object} PropertyDescriptor + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description + * @property {boolean} configurable defaults to false + * @property {boolean} enumerable defaults to false + * @property {boolean} writable defaults to false + * @property {*} value defaults to undefined + * @property {Function} get defaults to undefined + * @property {Function} set defaults to undefined + */ + +/* + * The following type def is strictly speaking illegal in JSDoc, but the expression forms a + * legal Typescript union type and is understood by Visual Studio and the IntelliJ + * family of editors. The "TS" flavor of JSDoc is becoming the de-facto standard these + * days for that reason (and the fact that JSDoc is essentially unmaintained) + */ + +/** + * @typedef {{isOwn: boolean} & PropertyDescriptor} SinonPropertyDescriptor + * a slightly enriched property descriptor + * @property {boolean} isOwn true if the descriptor is owned by this object, false if it comes from the prototype + */ + +/** + * Returns a slightly modified property descriptor that one can tell is from the object or the prototype + * + * @param {*} object + * @param {string} property + * @returns {SinonPropertyDescriptor} + */ +function getPropertyDescriptor(object, property) { + let proto = object; + let descriptor; + const isOwn = Boolean( + object && Object.getOwnPropertyDescriptor(object, property), + ); + + while ( + proto && + !(descriptor = Object.getOwnPropertyDescriptor(proto, property)) + ) { + proto = Object.getPrototypeOf(proto); + } + + if (descriptor) { + descriptor.isOwn = isOwn; + } + + return descriptor; +} + +module.exports = getPropertyDescriptor; diff --git a/node_modules/sinon/lib/sinon/util/core/is-es-module.js b/node_modules/sinon/lib/sinon/util/core/is-es-module.js new file mode 100644 index 0000000..e65131d --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/is-es-module.js @@ -0,0 +1,20 @@ +"use strict"; + +/** + * Verify if an object is a ECMAScript Module + * + * As the exports from a module is immutable we cannot alter the exports + * using spies or stubs. Let the consumer know this to avoid bug reports + * on weird error messages. + * + * @param {object} object The object to examine + * @returns {boolean} true when the object is a module + */ +module.exports = function (object) { + return ( + object && + typeof Symbol !== "undefined" && + object[Symbol.toStringTag] === "Module" && + Object.isSealed(object) + ); +}; diff --git a/node_modules/sinon/lib/sinon/util/core/is-non-existent-property.js b/node_modules/sinon/lib/sinon/util/core/is-non-existent-property.js new file mode 100644 index 0000000..842c13d --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/is-non-existent-property.js @@ -0,0 +1,14 @@ +"use strict"; + +/** + * @param {*} object + * @param {string} property + * @returns {boolean} whether a prop exists in the prototype chain + */ +function isNonExistentProperty(object, property) { + return Boolean( + object && typeof property !== "undefined" && !(property in object), + ); +} + +module.exports = isNonExistentProperty; diff --git a/node_modules/sinon/lib/sinon/util/core/is-property-configurable.js b/node_modules/sinon/lib/sinon/util/core/is-property-configurable.js new file mode 100644 index 0000000..157e21a --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/is-property-configurable.js @@ -0,0 +1,11 @@ +"use strict"; + +const getPropertyDescriptor = require("./get-property-descriptor"); + +function isPropertyConfigurable(obj, propName) { + const propertyDescriptor = getPropertyDescriptor(obj, propName); + + return propertyDescriptor ? propertyDescriptor.configurable : true; +} + +module.exports = isPropertyConfigurable; diff --git a/node_modules/sinon/lib/sinon/util/core/is-restorable.js b/node_modules/sinon/lib/sinon/util/core/is-restorable.js new file mode 100644 index 0000000..c717b33 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/is-restorable.js @@ -0,0 +1,11 @@ +"use strict"; + +function isRestorable(obj) { + return ( + typeof obj === "function" && + typeof obj.restore === "function" && + obj.restore.sinon + ); +} + +module.exports = isRestorable; diff --git a/node_modules/sinon/lib/sinon/util/core/next-tick.js b/node_modules/sinon/lib/sinon/util/core/next-tick.js new file mode 100644 index 0000000..6192ca2 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/next-tick.js @@ -0,0 +1,6 @@ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +const getNextTick = require("./get-next-tick"); + +module.exports = getNextTick(globalObject.process, globalObject.setImmediate); diff --git a/node_modules/sinon/lib/sinon/util/core/sinon-type.js b/node_modules/sinon/lib/sinon/util/core/sinon-type.js new file mode 100644 index 0000000..3a674a2 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/sinon-type.js @@ -0,0 +1,22 @@ +"use strict"; + +const sinonTypeSymbolProperty = Symbol("SinonType"); + +module.exports = { + /** + * Set the type of a Sinon object to make it possible to identify it later at runtime + * + * @param {object|Function} object object/function to set the type on + * @param {string} type the named type of the object/function + */ + set(object, type) { + Object.defineProperty(object, sinonTypeSymbolProperty, { + value: type, + configurable: false, + enumerable: false, + }); + }, + get(object) { + return object && object[sinonTypeSymbolProperty]; + }, +}; diff --git a/node_modules/sinon/lib/sinon/util/core/times-in-words.js b/node_modules/sinon/lib/sinon/util/core/times-in-words.js new file mode 100644 index 0000000..e89476e --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/times-in-words.js @@ -0,0 +1,7 @@ +"use strict"; + +const array = [null, "once", "twice", "thrice"]; + +module.exports = function timesInWords(count) { + return array[count] || `${count || 0} times`; +}; diff --git a/node_modules/sinon/lib/sinon/util/core/walk-object.js b/node_modules/sinon/lib/sinon/util/core/walk-object.js new file mode 100644 index 0000000..a5dadc9 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/walk-object.js @@ -0,0 +1,55 @@ +"use strict"; + +const functionName = require("@sinonjs/commons").functionName; + +const getPropertyDescriptor = require("./get-property-descriptor"); +const walk = require("./walk"); + +/** + * A utility that allows traversing an object, applying mutating functions on the properties + * + * @param {Function} mutator called on each property + * @param {object} object the object we are walking over + * @param {Function} filter a predicate (boolean function) that will decide whether or not to apply the mutator to the current property + * @returns {void} nothing + */ +function walkObject(mutator, object, filter) { + let called = false; + const name = functionName(mutator); + + if (!object) { + throw new Error( + `Trying to ${name} object but received ${String(object)}`, + ); + } + + walk(object, function (prop, propOwner) { + // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object + // is not Object.prototype + if ( + propOwner !== Object.prototype && + prop !== "constructor" && + typeof getPropertyDescriptor(propOwner, prop).value === "function" + ) { + if (filter) { + if (filter(object, prop)) { + called = true; + mutator(object, prop); + } + } else { + called = true; + mutator(object, prop); + } + } + }); + + if (!called) { + throw new Error( + `Found no methods on object to which we could apply mutations`, + ); + } + + return object; +} + +module.exports = walkObject; diff --git a/node_modules/sinon/lib/sinon/util/core/walk.js b/node_modules/sinon/lib/sinon/util/core/walk.js new file mode 100644 index 0000000..178c3ee --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/walk.js @@ -0,0 +1,49 @@ +"use strict"; + +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function walkInternal(obj, iterator, context, originalObj, seen) { + let prop; + const proto = Object.getPrototypeOf(obj); + + if (typeof Object.getOwnPropertyNames !== "function") { + // We explicitly want to enumerate through all of the prototype's properties + // in this case, therefore we deliberately leave out an own property check. + /* eslint-disable-next-line guard-for-in */ + for (prop in obj) { + iterator.call(context, obj[prop], prop, obj); + } + + return; + } + + forEach(Object.getOwnPropertyNames(obj), function (k) { + if (seen[k] !== true) { + seen[k] = true; + const target = + typeof Object.getOwnPropertyDescriptor(obj, k).get === + "function" + ? originalObj + : obj; + iterator.call(context, k, target); + } + }); + + if (proto) { + walkInternal(proto, iterator, context, originalObj, seen); + } +} + +/* Walks the prototype chain of an object and iterates over every own property + * name encountered. The iterator is called in the same fashion that Array.prototype.forEach + * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional + * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will + * default to using a simple for..in loop. + * + * obj - The object to walk the prototype chain for. + * iterator - The function to be called on each pass of the walk. + * context - (Optional) When given, the iterator will be called with this object as the receiver. + */ +module.exports = function walk(obj, iterator, context) { + return walkInternal(obj, iterator, context, obj, {}); +}; diff --git a/node_modules/sinon/lib/sinon/util/core/wrap-method.js b/node_modules/sinon/lib/sinon/util/core/wrap-method.js new file mode 100644 index 0000000..38ab120 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/core/wrap-method.js @@ -0,0 +1,245 @@ +"use strict"; + +// eslint-disable-next-line no-empty-function +const noop = () => {}; +const getPropertyDescriptor = require("./get-property-descriptor"); +const extend = require("./extend"); +const sinonType = require("./sinon-type"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const valueToString = require("@sinonjs/commons").valueToString; +const push = require("@sinonjs/commons").prototypes.array.push; + +function isFunction(obj) { + return ( + typeof obj === "function" || + Boolean(obj && obj.constructor && obj.call && obj.apply) + ); +} + +function mirrorProperties(target, source) { + for (const prop in source) { + if (!hasOwnProperty(target, prop)) { + target[prop] = source[prop]; + } + } +} + +function getAccessor(object, property, method) { + const accessors = ["get", "set"]; + const descriptor = getPropertyDescriptor(object, property); + + for (let i = 0; i < accessors.length; i++) { + if ( + descriptor[accessors[i]] && + descriptor[accessors[i]].name === method.name + ) { + return accessors[i]; + } + } + return null; +} + +// Cheap way to detect if we have ES5 support. +const hasES5Support = "keys" in Object; + +module.exports = function wrapMethod(object, property, method) { + if (!object) { + throw new TypeError("Should wrap property of object"); + } + + if (typeof method !== "function" && typeof method !== "object") { + throw new TypeError( + "Method wrapper should be a function or a property descriptor", + ); + } + + function checkWrappedMethod(wrappedMethod) { + let error; + + if (!isFunction(wrappedMethod)) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${valueToString( + property, + )} as function`, + ); + } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) { + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already wrapped`, + ); + } else if (wrappedMethod.calledBefore) { + const verb = wrappedMethod.returns ? "stubbed" : "spied on"; + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already ${verb}`, + ); + } + + if (error) { + if (wrappedMethod && wrappedMethod.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethod.stackTraceError.stack}`; + } + throw error; + } + } + + let error, wrappedMethod, i, wrappedMethodDesc, target, accessor; + + const wrappedMethods = []; + + function simplePropertyAssignment() { + wrappedMethod = object[property]; + checkWrappedMethod(wrappedMethod); + object[property] = method; + method.displayName = property; + } + + // Firefox has a problem when using hasOwn.call on objects from other frames. + const owned = object.hasOwnProperty + ? object.hasOwnProperty(property) // eslint-disable-line @sinonjs/no-prototype-methods/no-prototype-methods + : hasOwnProperty(object, property); + + if (hasES5Support) { + const methodDesc = + typeof method === "function" ? { value: method } : method; + wrappedMethodDesc = getPropertyDescriptor(object, property); + + if (!wrappedMethodDesc) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${property} as function`, + ); + } else if ( + wrappedMethodDesc.restore && + wrappedMethodDesc.restore.sinon + ) { + error = new TypeError( + `Attempted to wrap ${property} which is already wrapped`, + ); + } + if (error) { + if (wrappedMethodDesc && wrappedMethodDesc.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethodDesc.stackTraceError.stack}`; + } + throw error; + } + + const types = Object.keys(methodDesc); + for (i = 0; i < types.length; i++) { + wrappedMethod = wrappedMethodDesc[types[i]]; + checkWrappedMethod(wrappedMethod); + push(wrappedMethods, wrappedMethod); + } + + mirrorProperties(methodDesc, wrappedMethodDesc); + for (i = 0; i < types.length; i++) { + mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]); + } + + // you are not allowed to flip the configurable prop on an + // existing descriptor to anything but false (#2514) + if (!owned) { + methodDesc.configurable = true; + } + + Object.defineProperty(object, property, methodDesc); + + // catch failing assignment + // this is the converse of the check in `.restore` below + if (typeof method === "function" && object[property] !== method) { + // correct any wrongdoings caused by the defineProperty call above, + // such as adding new items (if object was a Storage object) + delete object[property]; + simplePropertyAssignment(); + } + } else { + simplePropertyAssignment(); + } + + extendObjectWithWrappedMethods(); + + function extendObjectWithWrappedMethods() { + for (i = 0; i < wrappedMethods.length; i++) { + accessor = getAccessor(object, property, wrappedMethods[i]); + target = accessor ? method[accessor] : method; + extend.nonEnum(target, { + displayName: property, + wrappedMethod: wrappedMethods[i], + + // Set up an Error object for a stack trace which can be used later to find what line of + // code the original method was created on. + stackTraceError: new Error("Stack Trace for original"), + + restore: restore, + }); + + target.restore.sinon = true; + if (!hasES5Support) { + mirrorProperties(target, wrappedMethod); + } + } + } + + function restore() { + accessor = getAccessor(object, property, this.wrappedMethod); + let descriptor; + // For prototype properties try to reset by delete first. + // If this fails (ex: localStorage on mobile safari) then force a reset + // via direct assignment. + if (accessor) { + if (!owned) { + try { + // In some cases `delete` may throw an error + delete object[property][accessor]; + } catch (e) {} // eslint-disable-line no-empty + // For native code functions `delete` fails without throwing an error + // on Chrome < 43, PhantomJS, etc. + } else if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + descriptor[accessor] = wrappedMethodDesc[accessor]; + Object.defineProperty(object, property, descriptor); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property][accessor] = this.wrappedMethod; + } + } else { + // Use strict equality comparison to check failures then force a reset + // via direct assignment. + if (object[property][accessor] === target) { + object[property][accessor] = this.wrappedMethod; + } + } + } else { + if (!owned) { + try { + delete object[property]; + } catch (e) {} // eslint-disable-line no-empty + } else if (hasES5Support) { + Object.defineProperty(object, property, wrappedMethodDesc); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property] = this.wrappedMethod; + } + } else { + if (object[property] === target) { + object[property] = this.wrappedMethod; + } + } + } + if (sinonType.get(object) === "stub-instance") { + // this is simply to avoid errors after restoring if something should + // traverse the object in a cleanup phase, ref #2477 + object[property] = noop; + } + } + + return method; +}; diff --git a/node_modules/sinon/lib/sinon/util/fake-timers.js b/node_modules/sinon/lib/sinon/util/fake-timers.js new file mode 100644 index 0000000..a8cabe2 --- /dev/null +++ b/node_modules/sinon/lib/sinon/util/fake-timers.js @@ -0,0 +1,90 @@ +"use strict"; + +const extend = require("./core/extend"); +const FakeTimers = require("@sinonjs/fake-timers"); +const globalObject = require("@sinonjs/commons").global; + +/** + * + * @param config + * @param globalCtx + * + * @returns {object} the clock, after installing it on the global context, if given + */ +function createClock(config, globalCtx) { + let FakeTimersCtx = FakeTimers; + if (globalCtx !== null && typeof globalCtx === "object") { + FakeTimersCtx = FakeTimers.withGlobal(globalCtx); + } + const clock = FakeTimersCtx.install(config); + clock.restore = clock.uninstall; + return clock; +} + +/** + * + * @param obj + * @param globalPropName + */ +function addIfDefined(obj, globalPropName) { + const globalProp = globalObject[globalPropName]; + if (typeof globalProp !== "undefined") { + obj[globalPropName] = globalProp; + } +} + +/** + * @param {number|Date|object} dateOrConfig The unix epoch value to install with (default 0) + * @returns {object} Returns a lolex clock instance + */ +exports.useFakeTimers = function (dateOrConfig) { + const hasArguments = typeof dateOrConfig !== "undefined"; + const argumentIsDateLike = + (typeof dateOrConfig === "number" || dateOrConfig instanceof Date) && + arguments.length === 1; + const argumentIsObject = + dateOrConfig !== null && + typeof dateOrConfig === "object" && + arguments.length === 1; + + if (!hasArguments) { + return createClock({ + now: 0, + }); + } + + if (argumentIsDateLike) { + return createClock({ + now: dateOrConfig, + }); + } + + if (argumentIsObject) { + const config = extend.nonEnum({}, dateOrConfig); + const globalCtx = config.global; + delete config.global; + return createClock(config, globalCtx); + } + + throw new TypeError( + "useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon", + ); +}; + +exports.clock = { + create: function (now) { + return FakeTimers.createClock(now); + }, +}; + +const timers = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval, + Date: Date, +}; +addIfDefined(timers, "setImmediate"); +addIfDefined(timers, "clearImmediate"); + +exports.timers = timers; diff --git a/node_modules/sinon/node_modules/supports-color/browser.js b/node_modules/sinon/node_modules/supports-color/browser.js new file mode 100644 index 0000000..62afa3a --- /dev/null +++ b/node_modules/sinon/node_modules/supports-color/browser.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/node_modules/sinon/node_modules/supports-color/index.js b/node_modules/sinon/node_modules/supports-color/index.js new file mode 100644 index 0000000..6fada39 --- /dev/null +++ b/node_modules/sinon/node_modules/supports-color/index.js @@ -0,0 +1,135 @@ +'use strict'; +const os = require('os'); +const tty = require('tty'); +const hasFlag = require('has-flag'); + +const {env} = process; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false') || + hasFlag('color=never')) { + forceColor = 0; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = 1; +} + +if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + forceColor = 1; + } else if (env.FORCE_COLOR === 'false') { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) +}; diff --git a/node_modules/sinon/node_modules/supports-color/license b/node_modules/sinon/node_modules/supports-color/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/sinon/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/sinon/node_modules/supports-color/package.json b/node_modules/sinon/node_modules/supports-color/package.json new file mode 100644 index 0000000..f7182ed --- /dev/null +++ b/node_modules/sinon/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "7.2.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "xo": "^0.24.0" + }, + "browser": "browser.js" +} diff --git a/node_modules/sinon/node_modules/supports-color/readme.md b/node_modules/sinon/node_modules/supports-color/readme.md new file mode 100644 index 0000000..3654228 --- /dev/null +++ b/node_modules/sinon/node_modules/supports-color/readme.md @@ -0,0 +1,76 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install supports-color +``` + + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- diff --git a/node_modules/sinon/package.json b/node_modules/sinon/package.json new file mode 100644 index 0000000..0601315 --- /dev/null +++ b/node_modules/sinon/package.json @@ -0,0 +1,145 @@ +{ + "name": "sinon", + "description": "JavaScript test spies, stubs and mocks.", + "keywords": [ + "sinon", + "test", + "testing", + "unit", + "stub", + "spy", + "fake", + "time", + "clock", + "mock", + "xhr", + "assert" + ], + "version": "21.0.0", + "homepage": "https://sinonjs.org/", + "author": "Christian Johansen", + "repository": { + "type": "git", + "url": "http://github.com/sinonjs/sinon.git" + }, + "bugs": { + "url": "http://github.com/sinonjs/sinon/issues" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + }, + "license": "BSD-3-Clause", + "scripts": { + "test-node": "mocha --recursive -R dot \"test/**/*-test.js\"", + "test-dev": "npm run test-node -- -n watch -n watch-path=test --node-option watch-path=lib -R min", + "test-headless": "mochify --driver puppeteer", + "test-coverage": "nyc nyc --exclude-after-remap false mochify --driver puppeteer --bundle 'node coverage.cjs'", + "test-cloud": "./scripts/test-cloud.sh", + "test-webworker": "mochify --driver puppeteer --serve . test/webworker/webworker-support-assessment.js", + "test-esm-support": "mocha test/es2015/module-support-assessment-test.mjs", + "test-esm-browser-build": "node test/es2015/check-esm-bundle-is-runnable.js", + "test-runnable-examples": "docs/release-source/release/examples/run-test.sh", + "test-docs": "cd docs; make check-links", + "test": "npm run test-node && npm run test-headless && npm run test-webworker", + "check-dependencies": "dependency-check package.json --no-dev --ignore-module esm", + "update-compatibility": "node ./scripts/update-compatibility.cjs", + "build": "node ./build.cjs", + "build-docs": "cd docs; make build", + "serve-docs": "cd docs; make livereload", + "lint": "eslint --max-warnings 0 '**/*.{js,cjs,mjs}'", + "pretest-webworker": "npm run build", + "prebuild": "rimraf pkg && npm run check-dependencies && npm run update-compatibility", + "postbuild": "npm run test-esm-support && npm run test-esm-browser-build", + "prepublishOnly": "npm run build", + "prettier:check": "prettier --check '**/*.{js,css,md}'", + "prettier:write": "prettier --write '**/*.{js,css,md}'", + "preversion": "./scripts/preversion.sh", + "version": "./scripts/version.sh", + "postversion": "./scripts/postversion.sh" + }, + "nyc": { + "instrument": false, + "temp-dir": "coverage/.nyc_output", + "reporter": [ + "text", + "lcovonly" + ] + }, + "lint-staged": { + "**/*.{js,css,md}": "prettier --write", + "*.js": "eslint --quiet", + "*.mjs": "eslint --quiet --ext mjs --parser-options=sourceType:module" + }, + "mochify": { + "reporter": "dot", + "timeout": 10000, + "bundle": "esbuild --bundle --sourcemap=inline --define:process.env.NODE_DEBUG=\"\" --external:fs", + "bundle_stdin": "require", + "spec": "test/**/*-test.js" + }, + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "supports-color": "^7.2.0" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@mochify/cli": "^0.4.1", + "@mochify/driver-puppeteer": "^0.4.0", + "@mochify/driver-webdriver": "^0.2.1", + "@sinonjs/eslint-config": "^5.0.3", + "@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.1", + "@sinonjs/referee": "^11.0.1", + "@studio/changes": "^3.0.0", + "babel-plugin-istanbul": "^7.0.0", + "babelify": "^10.0.0", + "browserify": "^16.5.2", + "debug": "^4.3.7", + "dependency-check": "^4.1.0", + "esbuild": "^0.25.1", + "esbuild-plugin-istanbul": "^0.3.0", + "get-stdin": "^9.0.0", + "lint-staged": "^15.2.10", + "mocha": "^10.7.3", + "nyc": "^17.0.0", + "prettier": "^3.3.3", + "puppeteer": "^23.3.0", + "rimraf": "^6.0.1", + "semver": "^7.6.3", + "shelljs": "^0.8.5" + }, + "files": [ + "lib", + "pkg", + "scripts/support-sinon.js", + "AUTHORS", + "CONTRIBUTING.md", + "CHANGELOG.md", + "LICENSE", + "README.md" + ], + "browser": "./lib/sinon.js", + "main": "./lib/sinon.js", + "module": "./pkg/sinon-esm.js", + "exports": { + ".": { + "browser": "./pkg/sinon-esm.js", + "require": "./lib/sinon.js", + "import": "./pkg/sinon-esm.js" + }, + "./*": "./*" + }, + "type": "module", + "cdn": "./pkg/sinon.js", + "jsdelivr": "./pkg/sinon.js", + "esm": { + "cjs": { + "mutableNamespace": false, + "cache": true + }, + "mode": "auto" + } +} diff --git a/node_modules/sinon/pkg/sinon-esm.js b/node_modules/sinon/pkg/sinon-esm.js new file mode 100644 index 0000000..b9b6fcb --- /dev/null +++ b/node_modules/sinon/pkg/sinon-esm.js @@ -0,0 +1,13315 @@ +/* Sinon.JS 21.0.0, 2025-06-13, @license BSD-3 */let sinon;(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0) { + return args[callArgAt]; + } + + let argumentList; + + if (callArgAt === useLeftMostCallback) { + argumentList = args; + } + + if (callArgAt === useRightMostCallback) { + argumentList = reverse(slice(args)); + } + + const callArgProp = behavior.callArgProp; + + for (let i = 0, l = argumentList.length; i < l; ++i) { + if (!callArgProp && typeof argumentList[i] === "function") { + return argumentList[i]; + } + + if ( + callArgProp && + argumentList[i] && + typeof argumentList[i][callArgProp] === "function" + ) { + return argumentList[i][callArgProp]; + } + } + + return null; +} + +function getCallbackError(behavior, func, args) { + if (behavior.callArgAt < 0) { + let msg; + + if (behavior.callArgProp) { + msg = `${functionName( + behavior.stub, + )} expected to yield to '${valueToString( + behavior.callArgProp, + )}', but no object with such a property was passed.`; + } else { + msg = `${functionName( + behavior.stub, + )} expected to yield, but no callback was passed.`; + } + + if (args.length > 0) { + msg += ` Received [${join(args, ", ")}]`; + } + + return msg; + } + + return `argument at index ${behavior.callArgAt} is not a function: ${func}`; +} + +function ensureArgs(name, behavior, args) { + // map function name to internal property + // callsArg => callArgAt + const property = name.replace(/sArg/, "ArgAt"); + const index = behavior[property]; + + if (index >= args.length) { + throw new TypeError( + `${name} failed: ${index + 1} arguments required but only ${ + args.length + } present`, + ); + } +} + +function callCallback(behavior, args) { + if (typeof behavior.callArgAt === "number") { + ensureArgs("callsArg", behavior, args); + const func = getCallback(behavior, args); + + if (typeof func !== "function") { + throw new TypeError(getCallbackError(behavior, func, args)); + } + + if (behavior.callbackAsync) { + nextTick(function () { + func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + }); + } else { + return func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + } + } + + return undefined; +} + +const proto = { + create: function create(stub) { + const behavior = extend({}, proto); + delete behavior.create; + delete behavior.addBehavior; + delete behavior.createBehavior; + behavior.stub = stub; + + if (stub.defaultBehavior && stub.defaultBehavior.promiseLibrary) { + behavior.promiseLibrary = stub.defaultBehavior.promiseLibrary; + } + + return behavior; + }, + + isPresent: function isPresent() { + return ( + typeof this.callArgAt === "number" || + this.exception || + this.exceptionCreator || + typeof this.returnArgAt === "number" || + this.returnThis || + typeof this.resolveArgAt === "number" || + this.resolveThis || + typeof this.throwArgAt === "number" || + this.fakeFn || + this.returnValueDefined + ); + }, + + /*eslint complexity: ["error", 20]*/ + invoke: function invoke(context, args) { + /* + * callCallback (conditionally) calls ensureArgs + * + * Note: callCallback intentionally happens before + * everything else and cannot be moved lower + */ + const returnValue = callCallback(this, args); + + if (this.exception) { + throw this.exception; + } else if (this.exceptionCreator) { + this.exception = this.exceptionCreator(); + this.exceptionCreator = undefined; + throw this.exception; + } else if (typeof this.returnArgAt === "number") { + ensureArgs("returnsArg", this, args); + return args[this.returnArgAt]; + } else if (this.returnThis) { + return context; + } else if (typeof this.throwArgAt === "number") { + ensureArgs("throwsArg", this, args); + throw args[this.throwArgAt]; + } else if (this.fakeFn) { + return this.fakeFn.apply(context, args); + } else if (typeof this.resolveArgAt === "number") { + ensureArgs("resolvesArg", this, args); + return (this.promiseLibrary || Promise).resolve( + args[this.resolveArgAt], + ); + } else if (this.resolveThis) { + return (this.promiseLibrary || Promise).resolve(context); + } else if (this.resolve) { + return (this.promiseLibrary || Promise).resolve(this.returnValue); + } else if (this.reject) { + return (this.promiseLibrary || Promise).reject(this.returnValue); + } else if (this.callsThrough) { + const wrappedMethod = this.effectiveWrappedMethod(); + + return wrappedMethod.apply(context, args); + } else if (this.callsThroughWithNew) { + // Get the original method (assumed to be a constructor in this case) + const WrappedClass = this.effectiveWrappedMethod(); + // Turn the arguments object into a normal array + const argsArray = slice(args); + // Call the constructor + const F = WrappedClass.bind.apply( + WrappedClass, + concat([null], argsArray), + ); + return new F(); + } else if (typeof this.returnValue !== "undefined") { + return this.returnValue; + } else if (typeof this.callArgAt === "number") { + return returnValue; + } + + return this.returnValue; + }, + + effectiveWrappedMethod: function effectiveWrappedMethod() { + for (let stubb = this.stub; stubb; stubb = stubb.parent) { + if (stubb.wrappedMethod) { + return stubb.wrappedMethod; + } + } + throw new Error("Unable to find wrapped method"); + }, + + onCall: function onCall(index) { + return this.stub.onCall(index); + }, + + onFirstCall: function onFirstCall() { + return this.stub.onFirstCall(); + }, + + onSecondCall: function onSecondCall() { + return this.stub.onSecondCall(); + }, + + onThirdCall: function onThirdCall() { + return this.stub.onThirdCall(); + }, + + withArgs: function withArgs(/* arguments */) { + throw new Error( + 'Defining a stub by invoking "stub.onCall(...).withArgs(...)" ' + + 'is not supported. Use "stub.withArgs(...).onCall(...)" ' + + "to define sequential behavior for calls with certain arguments.", + ); + }, +}; + +function createBehavior(behaviorMethod) { + return function () { + this.defaultBehavior = this.defaultBehavior || proto.create(this); + this.defaultBehavior[behaviorMethod].apply( + this.defaultBehavior, + arguments, + ); + return this; + }; +} + +function addBehavior(stub, name, fn) { + proto[name] = function () { + fn.apply(this, concat([this], slice(arguments))); + return this.stub || this; + }; + + stub[name] = createBehavior(name); +} + +proto.addBehavior = addBehavior; +proto.createBehavior = createBehavior; + +const asyncBehaviors = exportAsyncBehaviors(proto); + +module.exports = extend.nonEnum({}, proto, asyncBehaviors); + +},{"./util/core/export-async-behaviors":25,"./util/core/extend":26,"./util/core/next-tick":34,"@sinonjs/commons":47}],6:[function(require,module,exports){ +"use strict"; + +const walk = require("./util/core/walk"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const push = require("@sinonjs/commons").prototypes.array.push; + +function collectMethod(methods, object, prop, propOwner) { + if ( + typeof getPropertyDescriptor(propOwner, prop).value === "function" && + hasOwnProperty(object, prop) + ) { + push(methods, object[prop]); + } +} + +// This function returns an array of all the own methods on the passed object +function collectOwnMethods(object) { + const methods = []; + + walk(object, collectMethod.bind(null, methods, object)); + + return methods; +} + +module.exports = collectOwnMethods; + +},{"./util/core/get-property-descriptor":29,"./util/core/walk":38,"@sinonjs/commons":47}],7:[function(require,module,exports){ +"use strict"; + +module.exports = class Colorizer { + constructor(supportsColor = require("supports-color")) { + this.supportsColor = supportsColor; + } + + /** + * Should be renamed to true #privateField + * when we can ensure ES2022 support + * + * @private + */ + colorize(str, color) { + if (this.supportsColor.stdout === false) { + return str; + } + + return `\x1b[${color}m${str}\x1b[0m`; + } + + red(str) { + return this.colorize(str, 31); + } + + green(str) { + return this.colorize(str, 32); + } + + cyan(str) { + return this.colorize(str, 96); + } + + white(str) { + return this.colorize(str, 39); + } + + bold(str) { + return this.colorize(str, 1); + } +}; + +},{"supports-color":94}],8:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Sandbox = require("./sandbox"); + +const forEach = arrayProto.forEach; +const push = arrayProto.push; + +function prepareSandboxFromConfig(config) { + const sandbox = new Sandbox({ assertOptions: config.assertOptions }); + + if (config.useFakeTimers) { + if (typeof config.useFakeTimers === "object") { + sandbox.useFakeTimers(config.useFakeTimers); + } else { + sandbox.useFakeTimers(); + } + } + + return sandbox; +} + +function exposeValue(sandbox, config, key, value) { + if (!value) { + return; + } + + if (config.injectInto && !(key in config.injectInto)) { + config.injectInto[key] = value; + push(sandbox.injectedKeys, key); + } else { + push(sandbox.args, value); + } +} + +/** + * Options to customize a sandbox + * + * The sandbox's methods can be injected into another object for + * convenience. The `injectInto` configuration option can name an + * object to add properties to. + * + * @typedef {object} SandboxConfig + * @property {string[]} properties The properties of the API to expose on the sandbox. Examples: ['spy', 'fake', 'restore'] + * @property {object} injectInto an object in which to inject properties from the sandbox (a facade). This is mostly an integration feature (sinon-test being one). + * @property {boolean} useFakeTimers whether timers are faked by default + * @property {object} [assertOptions] see CreateAssertOptions in ./assert + * + * This type def is really suffering from JSDoc not having standardized + * how to reference types defined in other modules :( + */ + +/** + * A configured sinon sandbox (private type) + * + * @typedef {object} ConfiguredSinonSandboxType + * @private + * @augments Sandbox + * @property {string[]} injectedKeys the keys that have been injected (from config.injectInto) + * @property {*[]} args the arguments for the sandbox + */ + +/** + * Create a sandbox + * + * As of Sinon 5 the `sinon` instance itself is a Sandbox, so you + * hardly ever need to create additional instances for the sake of testing + * + * @param config {SandboxConfig} + * @returns {Sandbox} + */ +function createSandbox(config) { + if (!config) { + return new Sandbox(); + } + + const configuredSandbox = prepareSandboxFromConfig(config); + configuredSandbox.args = configuredSandbox.args || []; + configuredSandbox.injectedKeys = []; + configuredSandbox.injectInto = config.injectInto; + const exposed = configuredSandbox.inject({}); + + if (config.properties) { + forEach(config.properties, function (prop) { + const value = + exposed[prop] || (prop === "sandbox" && configuredSandbox); + exposeValue(configuredSandbox, config, prop, value); + }); + } else { + exposeValue(configuredSandbox, config, "sandbox"); + } + + return configuredSandbox; +} + +module.exports = createSandbox; + +},{"./sandbox":20,"@sinonjs/commons":47}],9:[function(require,module,exports){ +"use strict"; + +const stub = require("./stub"); +const sinonType = require("./util/core/sinon-type"); +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function isStub(value) { + return sinonType.get(value) === "stub"; +} + +module.exports = function createStubInstance(constructor, overrides) { + if (typeof constructor !== "function") { + throw new TypeError("The constructor should be a function."); + } + + const stubInstance = Object.create(constructor.prototype); + sinonType.set(stubInstance, "stub-instance"); + + const stubbedObject = stub(stubInstance); + + forEach(Object.keys(overrides || {}), function (propertyName) { + if (propertyName in stubbedObject) { + const value = overrides[propertyName]; + if (isStub(value)) { + stubbedObject[propertyName] = value; + } else { + stubbedObject[propertyName].returns(value); + } + } else { + throw new Error( + `Cannot stub ${propertyName}. Property does not exist!`, + ); + } + }); + return stubbedObject; +}; + +},{"./stub":23,"./util/core/sinon-type":35,"@sinonjs/commons":47}],10:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const exportAsyncBehaviors = require("./util/core/export-async-behaviors"); +const extend = require("./util/core/extend"); + +const slice = arrayProto.slice; + +const useLeftMostCallback = -1; +const useRightMostCallback = -2; + +function throwsException(fake, error, message) { + if (typeof error === "function") { + fake.exceptionCreator = error; + } else if (typeof error === "string") { + fake.exceptionCreator = function () { + const newException = new Error( + message || `Sinon-provided ${error}`, + ); + newException.name = error; + return newException; + }; + } else if (!error) { + fake.exceptionCreator = function () { + return new Error("Error"); + }; + } else { + fake.exception = error; + } +} + +const defaultBehaviors = { + callsFake: function callsFake(fake, fn) { + fake.fakeFn = fn; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.callsThrough = false; + }, + + callsArg: function callsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOn: function callsArgOn(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgWith: function callsArgWith(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOnWith: function callsArgWith(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + yields: function (fake) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + yieldsRight: function (fake) { + fake.callArgAt = useRightMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsOn: function (fake, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsTo: function (fake, prop) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsToOn: function (fake, prop, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.fakeFn = undefined; + }, + + throws: throwsException, + throwsException: throwsException, + + returns: function returns(fake, value) { + fake.callsThrough = false; + fake.returnValue = value; + fake.resolve = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + }, + + returnsArg: function returnsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.returnArgAt = index; + }, + + throwsArg: function throwsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.throwArgAt = index; + }, + + returnsThis: function returnsThis(fake) { + fake.returnThis = true; + fake.callsThrough = false; + }, + + resolves: function resolves(fake, value) { + fake.returnValue = value; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + resolvesArg: function resolvesArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.resolveArgAt = index; + fake.returnValue = undefined; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + rejects: function rejects(fake, error, message) { + let reason; + if (typeof error === "string") { + reason = new Error(message || ""); + reason.name = error; + } else if (!error) { + reason = new Error("Error"); + } else { + reason = error; + } + fake.returnValue = reason; + fake.resolve = false; + fake.resolveThis = false; + fake.reject = true; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + + return fake; + }, + + resolvesThis: function resolvesThis(fake) { + fake.returnValue = undefined; + fake.resolve = false; + fake.resolveThis = true; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + callThrough: function callThrough(fake) { + fake.callsThrough = true; + }, + + callThroughWithNew: function callThroughWithNew(fake) { + fake.callsThroughWithNew = true; + }, + + get: function get(fake, getterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + get: getterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }); + + return fake; + }, + + set: function set(fake, setterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty( + rootStub.rootObj, + rootStub.propName, + // eslint-disable-next-line accessor-pairs + { + set: setterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }, + ); + + return fake; + }, + + value: function value(fake, newVal) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + value: newVal, + enumerable: true, + writable: true, + configurable: + rootStub.shadowsPropOnPrototype || + isPropertyConfigurable(rootStub.rootObj, rootStub.propName), + }); + + return fake; + }, +}; + +const asyncBehaviors = exportAsyncBehaviors(defaultBehaviors); + +module.exports = extend({}, defaultBehaviors, asyncBehaviors); + +},{"./util/core/export-async-behaviors":25,"./util/core/extend":26,"./util/core/is-property-configurable":32,"@sinonjs/commons":47}],11:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const nextTick = require("./util/core/next-tick"); + +const slice = arrayProto.slice; + +module.exports = fake; + +/** + * Returns a `fake` that records all calls, arguments and return values. + * + * When an `f` argument is supplied, this implementation will be used. + * + * @example + * // create an empty fake + * var f1 = sinon.fake(); + * + * f1(); + * + * f1.calledOnce() + * // true + * + * @example + * function greet(greeting) { + * console.log(`Hello ${greeting}`); + * } + * + * // create a fake with implementation + * var f2 = sinon.fake(greet); + * + * // Hello world + * f2("world"); + * + * f2.calledWith("world"); + * // true + * + * @param {Function|undefined} f + * @returns {Function} + * @namespace + */ +function fake(f) { + if (arguments.length > 0 && typeof f !== "function") { + throw new TypeError("Expected f argument to be a Function"); + } + + return wrapFunc(f); +} + +/** + * Creates a `fake` that returns the provided `value`, as well as recording all + * calls, arguments and return values. + * + * @example + * var f1 = sinon.fake.returns(42); + * + * f1(); + * // 42 + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.returns = function returns(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return value; + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that throws an Error. + * If the `value` argument does not have Error in its prototype chain, it will + * be used for creating a new error. + * + * @example + * var f1 = sinon.fake.throws("hello"); + * + * f1(); + * // Uncaught Error: hello + * + * @example + * var f2 = sinon.fake.throws(new TypeError("Invalid argument")); + * + * f2(); + * // Uncaught TypeError: Invalid argument + * + * @memberof fake + * @param {*|Error} value + * @returns {Function} + */ +fake.throws = function throws(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + throw getError(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that resolves to the passed `value` + * argument. + * + * @example + * var f1 = sinon.fake.resolves("apple pie"); + * + * await f1(); + * // "apple pie" + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.resolves = function resolves(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.resolve(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that rejects to the passed `value` + * argument. When `value` does not have Error in its prototype chain, it will be + * wrapped in an Error. + * + * @example + * var f1 = sinon.fake.rejects(":("); + * + * try { + * await f1(); + * } catch (error) { + * console.log(error); + * // ":(" + * } + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.rejects = function rejects(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.reject(getError(value)); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback with the defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * // "apple*pie" + * + * @memberof fake + * @returns {Function} + */ +fake.yields = function yields() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + + callback.apply(null, values); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback **asynchronously** with the + * defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * + * setTimeout(() => { + * // "apple*pie" + * }); + * + * @memberof fake + * @returns {Function} + */ +fake.yieldsAsync = function yieldsAsync() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + nextTick(function () { + callback.apply(null, values); + }); + } + + return wrapFunc(f); +}; + +let uuid = 0; +/** + * Creates a proxy (sinon concept) from the passed function. + * + * @private + * @param {Function} f + * @returns {Function} + */ +function wrapFunc(f) { + const fakeInstance = function () { + let firstArg, lastArg; + + if (arguments.length > 0) { + firstArg = arguments[0]; + lastArg = arguments[arguments.length - 1]; + } + + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + /* eslint-disable no-use-before-define */ + proxy.firstArg = firstArg; + proxy.lastArg = lastArg; + proxy.callback = callback; + + return f && f.apply(this, arguments); + }; + const proxy = createProxy(fakeInstance, f || fakeInstance); + + proxy.displayName = "fake"; + proxy.id = `fake#${uuid++}`; + + return proxy; +} + +/** + * Returns an Error instance from the passed value, if the value is not + * already an Error instance. + * + * @private + * @param {*} value [description] + * @returns {Error} [description] + */ +function getError(value) { + return value instanceof Error ? value : new Error(value); +} + +},{"./proxy":18,"./util/core/next-tick":34,"@sinonjs/commons":47}],12:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyInvoke = require("./proxy-invoke"); +const proxyCallToString = require("./proxy-call").toString; +const timesInWords = require("./util/core/times-in-words"); +const extend = require("./util/core/extend"); +const match = require("@sinonjs/samsam").createMatcher; +const stub = require("./stub"); +const assert = require("./assert"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const every = arrayProto.every; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const slice = arrayProto.slice; + +function callCountInWords(callCount) { + if (callCount === 0) { + return "never called"; + } + + return `called ${timesInWords(callCount)}`; +} + +function expectedCallCountInWords(expectation) { + const min = expectation.minCalls; + const max = expectation.maxCalls; + + if (typeof min === "number" && typeof max === "number") { + let str = timesInWords(min); + + if (min !== max) { + str = `at least ${str} and at most ${timesInWords(max)}`; + } + + return str; + } + + if (typeof min === "number") { + return `at least ${timesInWords(min)}`; + } + + return `at most ${timesInWords(max)}`; +} + +function receivedMinCalls(expectation) { + const hasMinLimit = typeof expectation.minCalls === "number"; + return !hasMinLimit || expectation.callCount >= expectation.minCalls; +} + +function receivedMaxCalls(expectation) { + if (typeof expectation.maxCalls !== "number") { + return false; + } + + return expectation.callCount === expectation.maxCalls; +} + +function verifyMatcher(possibleMatcher, arg) { + const isMatcher = match.isMatcher(possibleMatcher); + + return (isMatcher && possibleMatcher.test(arg)) || true; +} + +const mockExpectation = { + minCalls: 1, + maxCalls: 1, + + create: function create(methodName) { + const expectation = extend.nonEnum(stub(), mockExpectation); + delete expectation.create; + expectation.method = methodName; + + return expectation; + }, + + invoke: function invoke(func, thisValue, args) { + this.verifyCallAllowed(thisValue, args); + + return proxyInvoke.apply(this, arguments); + }, + + atLeast: function atLeast(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.maxCalls = null; + this.limitsSet = true; + } + + this.minCalls = num; + + return this; + }, + + atMost: function atMost(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.minCalls = null; + this.limitsSet = true; + } + + this.maxCalls = num; + + return this; + }, + + never: function never() { + return this.exactly(0); + }, + + once: function once() { + return this.exactly(1); + }, + + twice: function twice() { + return this.exactly(2); + }, + + thrice: function thrice() { + return this.exactly(3); + }, + + exactly: function exactly(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not a number`); + } + + this.atLeast(num); + return this.atMost(num); + }, + + met: function met() { + return !this.failed && receivedMinCalls(this); + }, + + verifyCallAllowed: function verifyCallAllowed(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (receivedMaxCalls(this)) { + this.failed = true; + mockExpectation.fail( + `${this.method} already called ${timesInWords(this.maxCalls)}`, + ); + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + mockExpectation.fail( + `${this.method} called with ${valueToString( + thisValue, + )} as thisValue, expected ${valueToString(this.expectedThis)}`, + ); + } + + if (!("expectedArguments" in this)) { + return; + } + + if (!args) { + mockExpectation.fail( + `${this.method} received no arguments, expected ${inspect( + expectedArguments, + )}`, + ); + } + + if (args.length < expectedArguments.length) { + mockExpectation.fail( + `${this.method} received too few arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + if ( + this.expectsExactArgCount && + args.length !== expectedArguments.length + ) { + mockExpectation.fail( + `${this.method} received too many arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + forEach( + expectedArguments, + function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, args[i])) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, didn't match ${String(expectedArguments)}`, + ); + } + + if (!deepEqual(args[i], expectedArgument)) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, expected ${inspect(expectedArguments)}`, + ); + } + }, + this, + ); + }, + + allowsCall: function allowsCall(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (this.met() && receivedMaxCalls(this)) { + return false; + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + return false; + } + + if (!("expectedArguments" in this)) { + return true; + } + + // eslint-disable-next-line no-underscore-dangle + const _args = args || []; + + if (_args.length < expectedArguments.length) { + return false; + } + + if ( + this.expectsExactArgCount && + _args.length !== expectedArguments.length + ) { + return false; + } + + return every(expectedArguments, function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, _args[i])) { + return false; + } + + if (!deepEqual(_args[i], expectedArgument)) { + return false; + } + + return true; + }); + }, + + withArgs: function withArgs() { + this.expectedArguments = slice(arguments); + return this; + }, + + withExactArgs: function withExactArgs() { + this.withArgs.apply(this, arguments); + this.expectsExactArgCount = true; + return this; + }, + + on: function on(thisValue) { + this.expectedThis = thisValue; + return this; + }, + + toString: function () { + const args = slice(this.expectedArguments || []); + + if (!this.expectsExactArgCount) { + push(args, "[...]"); + } + + const callStr = proxyCallToString.call({ + proxy: this.method || "anonymous mock expectation", + args: args, + }); + + const message = `${callStr.replace( + ", [...", + "[, ...", + )} ${expectedCallCountInWords(this)}`; + + if (this.met()) { + return `Expectation met: ${message}`; + } + + return `Expected ${message} (${callCountInWords(this.callCount)})`; + }, + + verify: function verify() { + if (!this.met()) { + mockExpectation.fail(String(this)); + } else { + mockExpectation.pass(String(this)); + } + + return true; + }, + + pass: function pass(message) { + assert.pass(message); + }, + + fail: function fail(message) { + const exception = new Error(message); + exception.name = "ExpectationError"; + + throw exception; + }, +}; + +module.exports = mockExpectation; + +},{"./assert":4,"./proxy-call":16,"./proxy-invoke":17,"./stub":23,"./util/core/extend":26,"./util/core/times-in-words":36,"@sinonjs/commons":47,"@sinonjs/samsam":87,"util":91}],13:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const mockExpectation = require("./mock-expectation"); +const proxyCallToString = require("./proxy-call").toString; +const extend = require("./util/core/extend"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const wrapMethod = require("./util/core/wrap-method"); + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const every = arrayProto.every; +const join = arrayProto.join; +const push = arrayProto.push; +const slice = arrayProto.slice; +const unshift = arrayProto.unshift; + +function mock(object) { + if (!object || typeof object === "string") { + return mockExpectation.create(object ? object : "Anonymous mock"); + } + + return mock.create(object); +} + +function each(collection, callback) { + const col = collection || []; + + forEach(col, callback); +} + +function arrayEquals(arr1, arr2, compareLength) { + if (compareLength && arr1.length !== arr2.length) { + return false; + } + + return every(arr1, function (element, i) { + return deepEqual(arr2[i], element); + }); +} + +extend(mock, { + create: function create(object) { + if (!object) { + throw new TypeError("object is null"); + } + + const mockObject = extend.nonEnum({}, mock, { object: object }); + delete mockObject.create; + + return mockObject; + }, + + expects: function expects(method) { + if (!method) { + throw new TypeError("method is falsy"); + } + + if (!this.expectations) { + this.expectations = {}; + this.proxies = []; + this.failures = []; + } + + if (!this.expectations[method]) { + this.expectations[method] = []; + const mockObject = this; + + wrapMethod(this.object, method, function () { + return mockObject.invokeMethod(method, this, arguments); + }); + + push(this.proxies, method); + } + + const expectation = mockExpectation.create(method); + expectation.wrappedMethod = this.object[method].wrappedMethod; + push(this.expectations[method], expectation); + + return expectation; + }, + + restore: function restore() { + const object = this.object; + + each(this.proxies, function (proxy) { + if (typeof object[proxy].restore === "function") { + object[proxy].restore(); + } + }); + }, + + verify: function verify() { + const expectations = this.expectations || {}; + const messages = this.failures ? slice(this.failures) : []; + const met = []; + + each(this.proxies, function (proxy) { + each(expectations[proxy], function (expectation) { + if (!expectation.met()) { + push(messages, String(expectation)); + } else { + push(met, String(expectation)); + } + }); + }); + + this.restore(); + + if (messages.length > 0) { + mockExpectation.fail(join(concat(messages, met), "\n")); + } else if (met.length > 0) { + mockExpectation.pass(join(concat(messages, met), "\n")); + } + + return true; + }, + + invokeMethod: function invokeMethod(method, thisValue, args) { + /* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */ + /* eslint consistent-return: "off" */ + const expectations = + this.expectations && this.expectations[method] + ? this.expectations[method] + : []; + const currentArgs = args || []; + let available; + + const expectationsWithMatchingArgs = filter( + expectations, + function (expectation) { + const expectedArgs = expectation.expectedArguments || []; + + return arrayEquals( + expectedArgs, + currentArgs, + expectation.expectsExactArgCount, + ); + }, + ); + + const expectationsToApply = filter( + expectationsWithMatchingArgs, + function (expectation) { + return ( + !expectation.met() && + expectation.allowsCall(thisValue, args) + ); + }, + ); + + if (expectationsToApply.length > 0) { + return expectationsToApply[0].apply(thisValue, args); + } + + const messages = []; + let exhausted = 0; + + forEach(expectationsWithMatchingArgs, function (expectation) { + if (expectation.allowsCall(thisValue, args)) { + available = available || expectation; + } else { + exhausted += 1; + } + }); + + if (available && exhausted === 0) { + return available.apply(thisValue, args); + } + + forEach(expectations, function (expectation) { + push(messages, ` ${String(expectation)}`); + }); + + unshift( + messages, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + })}`, + ); + + const err = new Error(); + if (!err.stack) { + // PhantomJS does not serialize the stack trace until the error has been thrown + try { + throw err; + } catch (e) { + /* empty */ + } + } + push( + this.failures, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + stack: err.stack, + })}`, + ); + + mockExpectation.fail(join(messages, "\n")); + }, +}); + +module.exports = mock; + +},{"./mock-expectation":12,"./proxy-call":16,"./util/core/extend":26,"./util/core/wrap-method":39,"@sinonjs/commons":47,"@sinonjs/samsam":87}],14:[function(require,module,exports){ +"use strict"; + +const fake = require("./fake"); +const isRestorable = require("./util/core/is-restorable"); + +const STATUS_PENDING = "pending"; +const STATUS_RESOLVED = "resolved"; +const STATUS_REJECTED = "rejected"; + +/** + * Returns a fake for a given function or undefined. If no function is given, a + * new fake is returned. If the given function is already a fake, it is + * returned as is. Otherwise the given function is wrapped in a new fake. + * + * @param {Function} [executor] The optional executor function. + * @returns {Function} + */ +function getFakeExecutor(executor) { + if (isRestorable(executor)) { + return executor; + } + if (executor) { + return fake(executor); + } + return fake(); +} + +/** + * Returns a new promise that exposes it's internal `status`, `resolvedValue` + * and `rejectedValue` and can be resolved or rejected from the outside by + * calling `resolve(value)` or `reject(reason)`. + * + * @param {Function} [executor] The optional executor function. + * @returns {Promise} + */ +function promise(executor) { + const fakeExecutor = getFakeExecutor(executor); + const sinonPromise = new Promise(fakeExecutor); + + sinonPromise.status = STATUS_PENDING; + sinonPromise + .then(function (value) { + sinonPromise.status = STATUS_RESOLVED; + sinonPromise.resolvedValue = value; + }) + .catch(function (reason) { + sinonPromise.status = STATUS_REJECTED; + sinonPromise.rejectedValue = reason; + }); + + /** + * Resolves or rejects the promise with the given status and value. + * + * @param {string} status + * @param {*} value + * @param {Function} callback + */ + function finalize(status, value, callback) { + if (sinonPromise.status !== STATUS_PENDING) { + throw new Error(`Promise already ${sinonPromise.status}`); + } + + sinonPromise.status = status; + callback(value); + } + + sinonPromise.resolve = function (value) { + finalize(STATUS_RESOLVED, value, fakeExecutor.firstCall.args[0]); + // Return the promise so that callers can await it: + return sinonPromise; + }; + sinonPromise.reject = function (reason) { + finalize(STATUS_REJECTED, reason, fakeExecutor.firstCall.args[1]); + // Return a new promise that resolves when the sinon promise was + // rejected, so that callers can await it: + return new Promise(function (resolve) { + sinonPromise.catch(() => resolve()); + }); + }; + + return sinonPromise; +} + +module.exports = promise; + +},{"./fake":11,"./util/core/is-restorable":33}],15:[function(require,module,exports){ +"use strict"; + +const push = require("@sinonjs/commons").prototypes.array.push; + +exports.incrementCallCount = function incrementCallCount(proxy) { + proxy.called = true; + proxy.callCount += 1; + proxy.notCalled = false; + proxy.calledOnce = proxy.callCount === 1; + proxy.calledTwice = proxy.callCount === 2; + proxy.calledThrice = proxy.callCount === 3; +}; + +exports.createCallProperties = function createCallProperties(proxy) { + proxy.firstCall = proxy.getCall(0); + proxy.secondCall = proxy.getCall(1); + proxy.thirdCall = proxy.getCall(2); + proxy.lastCall = proxy.getCall(proxy.callCount - 1); +}; + +exports.delegateToCalls = function delegateToCalls( + proxy, + method, + matchAny, + actual, + returnsValues, + notCalled, + totalCallCount, +) { + proxy[method] = function () { + if (!this.called) { + if (notCalled) { + return notCalled.apply(this, arguments); + } + return false; + } + + if (totalCallCount !== undefined && this.callCount !== totalCallCount) { + return false; + } + + let currentCall; + let matches = 0; + const returnValues = []; + + for (let i = 0, l = this.callCount; i < l; i += 1) { + currentCall = this.getCall(i); + const returnValue = currentCall[actual || method].apply( + currentCall, + arguments, + ); + push(returnValues, returnValue); + if (returnValue) { + matches += 1; + + if (matchAny) { + return true; + } + } + } + + if (returnsValues) { + return returnValues; + } + return matches === this.callCount; + }; +}; + +},{"@sinonjs/commons":47}],16:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const match = require("@sinonjs/samsam").createMatcher; +const deepEqual = require("@sinonjs/samsam").deepEqual; +const functionName = require("@sinonjs/commons").functionName; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const join = arrayProto.join; +const map = arrayProto.map; +const reduce = arrayProto.reduce; +const slice = arrayProto.slice; + +/** + * @param proxy + * @param text + * @param args + */ +function throwYieldError(proxy, text, args) { + let msg = functionName(proxy) + text; + if (args.length) { + msg += ` Received [${join(slice(args), ", ")}]`; + } + throw new Error(msg); +} + +const callProto = { + calledOn: function calledOn(thisValue) { + if (match.isMatcher(thisValue)) { + return thisValue.test(this.thisValue); + } + return this.thisValue === thisValue; + }, + + calledWith: function calledWith() { + const self = this; + const calledWithArgs = slice(arguments); + + if (calledWithArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithArgs, + function (prev, arg, i) { + return prev && deepEqual(self.args[i], arg); + }, + true, + ); + }, + + calledWithMatch: function calledWithMatch() { + const self = this; + const calledWithMatchArgs = slice(arguments); + + if (calledWithMatchArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithMatchArgs, + function (prev, expectation, i) { + const actual = self.args[i]; + + return prev && match(expectation).test(actual); + }, + true, + ); + }, + + calledWithExactly: function calledWithExactly() { + return ( + arguments.length === this.args.length && + this.calledWith.apply(this, arguments) + ); + }, + + notCalledWith: function notCalledWith() { + return !this.calledWith.apply(this, arguments); + }, + + notCalledWithMatch: function notCalledWithMatch() { + return !this.calledWithMatch.apply(this, arguments); + }, + + returned: function returned(value) { + return deepEqual(this.returnValue, value); + }, + + threw: function threw(error) { + if (typeof error === "undefined" || !this.exception) { + return Boolean(this.exception); + } + + return this.exception === error || this.exception.name === error; + }, + + calledWithNew: function calledWithNew() { + return this.proxy.prototype && this.thisValue instanceof this.proxy; + }, + + calledBefore: function (other) { + return this.callId < other.callId; + }, + + calledAfter: function (other) { + return this.callId > other.callId; + }, + + calledImmediatelyBefore: function (other) { + return this.callId === other.callId - 1; + }, + + calledImmediatelyAfter: function (other) { + return this.callId === other.callId + 1; + }, + + callArg: function (pos) { + this.ensureArgIsAFunction(pos); + return this.args[pos](); + }, + + callArgOn: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + return this.args[pos].apply(thisValue); + }, + + callArgWith: function (pos) { + return this.callArgOnWith.apply( + this, + concat([pos, null], slice(arguments, 1)), + ); + }, + + callArgOnWith: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + const args = slice(arguments, 2); + return this.args[pos].apply(thisValue, args); + }, + + throwArg: function (pos) { + if (pos > this.args.length) { + throw new TypeError( + `Not enough arguments: ${pos} required but only ${this.args.length} present`, + ); + } + + throw this.args[pos]; + }, + + yield: function () { + return this.yieldOn.apply(this, concat([null], slice(arguments, 0))); + }, + + yieldOn: function (thisValue) { + const args = slice(this.args); + const yieldFn = filter(args, function (arg) { + return typeof arg === "function"; + })[0]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + " cannot yield since no callback was passed.", + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 1)); + }, + + yieldTo: function (prop) { + return this.yieldToOn.apply( + this, + concat([prop, null], slice(arguments, 1)), + ); + }, + + yieldToOn: function (prop, thisValue) { + const args = slice(this.args); + const yieldArg = filter(args, function (arg) { + return arg && typeof arg[prop] === "function"; + })[0]; + const yieldFn = yieldArg && yieldArg[prop]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + ` cannot yield to '${valueToString( + prop, + )}' since no callback was passed.`, + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 2)); + }, + + toString: function () { + if (!this.args) { + return ":("; + } + + let callStr = this.proxy ? `${String(this.proxy)}(` : ""; + const formattedArgs = map(this.args, function (arg) { + return inspect(arg); + }); + + callStr = `${callStr + join(formattedArgs, ", ")})`; + + if (typeof this.returnValue !== "undefined") { + callStr += ` => ${inspect(this.returnValue)}`; + } + + if (this.exception) { + callStr += ` !${this.exception.name}`; + + if (this.exception.message) { + callStr += `(${this.exception.message})`; + } + } + if (this.stack) { + // If we have a stack, add the first frame that's in end-user code + // Skip the first two frames because they will refer to Sinon code + callStr += (this.stack.split("\n")[3] || "unknown").replace( + /^\s*(?:at\s+|@)?/, + " at ", + ); + } + + return callStr; + }, + + ensureArgIsAFunction: function (pos) { + if (typeof this.args[pos] !== "function") { + throw new TypeError( + `Expected argument at position ${pos} to be a Function, but was ${typeof this + .args[pos]}`, + ); + } + }, +}; +Object.defineProperty(callProto, "stack", { + enumerable: true, + configurable: true, + get: function () { + return (this.errorWithCallStack && this.errorWithCallStack.stack) || ""; + }, +}); + +callProto.invokeCallback = callProto.yield; + +/** + * @param proxy + * @param thisValue + * @param args + * @param returnValue + * @param exception + * @param id + * @param errorWithCallStack + * + * @returns {object} proxyCall + */ +function createProxyCall( + proxy, + thisValue, + args, + returnValue, + exception, + id, + errorWithCallStack, +) { + if (typeof id !== "number") { + throw new TypeError("Call id is not a number"); + } + + let firstArg, lastArg; + + if (args.length > 0) { + firstArg = args[0]; + lastArg = args[args.length - 1]; + } + + const proxyCall = Object.create(callProto); + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + proxyCall.proxy = proxy; + proxyCall.thisValue = thisValue; + proxyCall.args = args; + proxyCall.firstArg = firstArg; + proxyCall.lastArg = lastArg; + proxyCall.callback = callback; + proxyCall.returnValue = returnValue; + proxyCall.exception = exception; + proxyCall.callId = id; + proxyCall.errorWithCallStack = errorWithCallStack; + + return proxyCall; +} +createProxyCall.toString = callProto.toString; // used by mocks + +module.exports = createProxyCall; + +},{"@sinonjs/commons":47,"@sinonjs/samsam":87,"util":91}],17:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyCallUtil = require("./proxy-call-util"); + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const concat = arrayProto.concat; +const ErrorConstructor = Error.prototype.constructor; +const bind = Function.prototype.bind; + +let callId = 0; + +module.exports = function invoke(func, thisValue, args) { + const matchings = this.matchingFakes(args); + const currentCallId = callId++; + let exception, returnValue; + + proxyCallUtil.incrementCallCount(this); + push(this.thisValues, thisValue); + push(this.args, args); + push(this.callIds, currentCallId); + forEach(matchings, function (matching) { + proxyCallUtil.incrementCallCount(matching); + push(matching.thisValues, thisValue); + push(matching.args, args); + push(matching.callIds, currentCallId); + }); + + // Make call properties available from within the spied function: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + try { + this.invoking = true; + + const thisCall = this.getCall(this.callCount - 1); + + if (thisCall.calledWithNew()) { + // Call through with `new` + returnValue = new (bind.apply( + this.func || func, + concat([thisValue], args), + ))(); + + if ( + typeof returnValue !== "object" && + typeof returnValue !== "function" + ) { + returnValue = thisValue; + } + } else { + returnValue = (this.func || func).apply(thisValue, args); + } + } catch (e) { + exception = e; + } finally { + delete this.invoking; + } + + push(this.exceptions, exception); + push(this.returnValues, returnValue); + forEach(matchings, function (matching) { + push(matching.exceptions, exception); + push(matching.returnValues, returnValue); + }); + + const err = new ErrorConstructor(); + // 1. Please do not get stack at this point. It may be so very slow, and not actually used + // 2. PhantomJS does not serialize the stack trace until the error has been thrown: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack + try { + throw err; + } catch (e) { + /* empty */ + } + push(this.errorsWithCallStack, err); + forEach(matchings, function (matching) { + push(matching.errorsWithCallStack, err); + }); + + // Make return value and exception available in the calls: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + if (exception !== undefined) { + throw exception; + } + + return returnValue; +}; + +},{"./proxy-call-util":15,"@sinonjs/commons":47}],18:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const extend = require("./util/core/extend"); +const functionToString = require("./util/core/function-to-string"); +const proxyCall = require("./proxy-call"); +const proxyCallUtil = require("./proxy-call-util"); +const proxyInvoke = require("./proxy-invoke"); +const inspect = require("util").inspect; + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const slice = arrayProto.slice; + +const emptyFakes = Object.freeze([]); + +// Public API +const proxyApi = { + toString: functionToString, + + named: function named(name) { + this.displayName = name; + const nameDescriptor = Object.getOwnPropertyDescriptor(this, "name"); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + nameDescriptor.value = name; + Object.defineProperty(this, "name", nameDescriptor); + } + return this; + }, + + invoke: proxyInvoke, + + /* + * Hook for derived implementation to return fake instances matching the + * given arguments. + */ + matchingFakes: function (/*args, strict*/) { + return emptyFakes; + }, + + getCall: function getCall(index) { + let i = index; + if (i < 0) { + // Negative indices means counting backwards from the last call + i += this.callCount; + } + if (i < 0 || i >= this.callCount) { + return null; + } + + return proxyCall( + this, + this.thisValues[i], + this.args[i], + this.returnValues[i], + this.exceptions[i], + this.callIds[i], + this.errorsWithCallStack[i], + ); + }, + + getCalls: function () { + const calls = []; + let i; + + for (i = 0; i < this.callCount; i++) { + push(calls, this.getCall(i)); + } + + return calls; + }, + + calledBefore: function calledBefore(proxy) { + if (!this.called) { + return false; + } + + if (!proxy.called) { + return true; + } + + return this.callIds[0] < proxy.callIds[proxy.callIds.length - 1]; + }, + + calledAfter: function calledAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return this.callIds[this.callCount - 1] > proxy.callIds[0]; + }, + + calledImmediatelyBefore: function calledImmediatelyBefore(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] - 1 + ); + }, + + calledImmediatelyAfter: function calledImmediatelyAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] + 1 + ); + }, + + formatters: require("./spy-formatters"), + printf: function (format) { + const spyInstance = this; + const args = slice(arguments, 1); + let formatter; + + return (format || "").replace(/%(.)/g, function (match, specifier) { + formatter = proxyApi.formatters[specifier]; + + if (typeof formatter === "function") { + return String(formatter(spyInstance, args)); + } else if (!isNaN(parseInt(specifier, 10))) { + return inspect(args[specifier - 1]); + } + + return `%${specifier}`; + }); + }, + + resetHistory: function () { + if (this.invoking) { + const err = new Error( + "Cannot reset Sinon function while invoking it. " + + "Move the call to .resetHistory outside of the callback.", + ); + err.name = "InvalidResetException"; + throw err; + } + + this.called = false; + this.notCalled = true; + this.calledOnce = false; + this.calledTwice = false; + this.calledThrice = false; + this.callCount = 0; + this.firstCall = null; + this.secondCall = null; + this.thirdCall = null; + this.lastCall = null; + this.args = []; + this.firstArg = null; + this.lastArg = null; + this.returnValues = []; + this.thisValues = []; + this.exceptions = []; + this.callIds = []; + this.errorsWithCallStack = []; + + if (this.fakes) { + forEach(this.fakes, function (fake) { + fake.resetHistory(); + }); + } + + return this; + }, +}; + +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(proxyApi, "calledOn", true); +delegateToCalls(proxyApi, "alwaysCalledOn", false, "calledOn"); +delegateToCalls(proxyApi, "calledWith", true); +delegateToCalls( + proxyApi, + "calledOnceWith", + true, + "calledWith", + false, + undefined, + 1, +); +delegateToCalls(proxyApi, "calledWithMatch", true); +delegateToCalls(proxyApi, "alwaysCalledWith", false, "calledWith"); +delegateToCalls(proxyApi, "alwaysCalledWithMatch", false, "calledWithMatch"); +delegateToCalls(proxyApi, "calledWithExactly", true); +delegateToCalls( + proxyApi, + "calledOnceWithExactly", + true, + "calledWithExactly", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "calledOnceWithMatch", + true, + "calledWithMatch", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "alwaysCalledWithExactly", + false, + "calledWithExactly", +); +delegateToCalls( + proxyApi, + "neverCalledWith", + false, + "notCalledWith", + false, + function () { + return true; + }, +); +delegateToCalls( + proxyApi, + "neverCalledWithMatch", + false, + "notCalledWithMatch", + false, + function () { + return true; + }, +); +delegateToCalls(proxyApi, "threw", true); +delegateToCalls(proxyApi, "alwaysThrew", false, "threw"); +delegateToCalls(proxyApi, "returned", true); +delegateToCalls(proxyApi, "alwaysReturned", false, "returned"); +delegateToCalls(proxyApi, "calledWithNew", true); +delegateToCalls(proxyApi, "alwaysCalledWithNew", false, "calledWithNew"); + +function createProxy(func, originalFunc) { + const proxy = wrapFunction(func, originalFunc); + + // Inherit function properties: + extend(proxy, func); + + proxy.prototype = func.prototype; + + extend.nonEnum(proxy, proxyApi); + + return proxy; +} + +function wrapFunction(func, originalFunc) { + const arity = originalFunc.length; + let p; + // Do not change this to use an eval. Projects that depend on sinon block the use of eval. + // ref: https://github.com/sinonjs/sinon/issues/710 + switch (arity) { + /*eslint-disable no-unused-vars, max-len*/ + case 0: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 1: + p = function proxy(a) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 2: + p = function proxy(a, b) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 3: + p = function proxy(a, b, c) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 4: + p = function proxy(a, b, c, d) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 5: + p = function proxy(a, b, c, d, e) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 6: + p = function proxy(a, b, c, d, e, f) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 7: + p = function proxy(a, b, c, d, e, f, g) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 8: + p = function proxy(a, b, c, d, e, f, g, h) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 9: + p = function proxy(a, b, c, d, e, f, g, h, i) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 10: + p = function proxy(a, b, c, d, e, f, g, h, i, j) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 11: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 12: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k, l) { + return p.invoke(func, this, slice(arguments)); + }; + break; + default: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + /*eslint-enable*/ + } + const nameDescriptor = Object.getOwnPropertyDescriptor( + originalFunc, + "name", + ); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + Object.defineProperty(p, "name", nameDescriptor); + } + extend.nonEnum(p, { + isSinonProxy: true, + + called: false, + notCalled: true, + calledOnce: false, + calledTwice: false, + calledThrice: false, + callCount: 0, + firstCall: null, + firstArg: null, + secondCall: null, + thirdCall: null, + lastCall: null, + lastArg: null, + args: [], + returnValues: [], + thisValues: [], + exceptions: [], + callIds: [], + errorsWithCallStack: [], + }); + return p; +} + +module.exports = createProxy; + +},{"./proxy-call":16,"./proxy-call-util":15,"./proxy-invoke":17,"./spy-formatters":21,"./util/core/extend":26,"./util/core/function-to-string":27,"@sinonjs/commons":47,"util":91}],19:[function(require,module,exports){ +"use strict"; + +const walkObject = require("./util/core/walk-object"); + +function filter(object, property) { + return object[property].restore && object[property].restore.sinon; +} + +function restore(object, property) { + object[property].restore(); +} + +function restoreObject(object) { + return walkObject(restore, object, filter); +} + +module.exports = restoreObject; + +},{"./util/core/walk-object":37}],20:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const logger = require("@sinonjs/commons").deprecated; +const collectOwnMethods = require("./collect-own-methods"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const match = require("@sinonjs/samsam").createMatcher; +const sinonAssert = require("./assert"); +const sinonClock = require("./util/fake-timers"); +const sinonMock = require("./mock"); +const sinonSpy = require("./spy"); +const sinonStub = require("./stub"); +const sinonCreateStubInstance = require("./create-stub-instance"); +const sinonFake = require("./fake"); +const valueToString = require("@sinonjs/commons").valueToString; + +const DEFAULT_LEAK_THRESHOLD = 10000; + +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const reverse = arrayProto.reverse; + +function applyOnEach(fakes, method) { + const matchingFakes = filter(fakes, function (fake) { + return typeof fake[method] === "function"; + }); + + forEach(matchingFakes, function (fake) { + fake[method](); + }); +} + +function throwOnAccessors(descriptor) { + if (typeof descriptor.get === "function") { + throw new Error("Use sandbox.replaceGetter for replacing getters"); + } + + if (typeof descriptor.set === "function") { + throw new Error("Use sandbox.replaceSetter for replacing setters"); + } +} + +function verifySameType(object, property, replacement) { + if (typeof object[property] !== typeof replacement) { + throw new TypeError( + `Cannot replace ${typeof object[ + property + ]} with ${typeof replacement}`, + ); + } +} + +function checkForValidArguments(descriptor, property, replacement) { + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}. Perhaps you meant sandbox.define()?`, + ); + } + + if (typeof replacement === "undefined") { + throw new TypeError("Expected replacement argument to be defined"); + } +} + +/** + * A sinon sandbox + * + * @param opts + * @param {object} [opts.assertOptions] see the CreateAssertOptions in ./assert + * @class + */ +function Sandbox(opts = {}) { + const sandbox = this; + const assertOptions = opts.assertOptions || {}; + let fakeRestorers = []; + + let collection = []; + let loggedLeakWarning = false; + sandbox.leakThreshold = DEFAULT_LEAK_THRESHOLD; + + function addToCollection(object) { + if ( + push(collection, object) > sandbox.leakThreshold && + !loggedLeakWarning + ) { + // eslint-disable-next-line no-console + logger.printWarning( + "Potential memory leak detected; be sure to call restore() to clean up your sandbox. To suppress this warning, modify the leakThreshold property of your sandbox.", + ); + loggedLeakWarning = true; + } + } + + sandbox.assert = sinonAssert.createAssertObject(assertOptions); + + // this is for testing only + sandbox.getFakes = function getFakes() { + return collection; + }; + + sandbox.createStubInstance = function createStubInstance() { + const stubbed = sinonCreateStubInstance.apply(null, arguments); + + const ownMethods = collectOwnMethods(stubbed); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + + return stubbed; + }; + + sandbox.inject = function inject(obj) { + obj.spy = function () { + return sandbox.spy.apply(null, arguments); + }; + + obj.stub = function () { + return sandbox.stub.apply(null, arguments); + }; + + obj.mock = function () { + return sandbox.mock.apply(null, arguments); + }; + + obj.createStubInstance = function () { + return sandbox.createStubInstance.apply(sandbox, arguments); + }; + + obj.fake = function () { + return sandbox.fake.apply(null, arguments); + }; + + obj.define = function () { + return sandbox.define.apply(null, arguments); + }; + + obj.replace = function () { + return sandbox.replace.apply(null, arguments); + }; + + obj.replaceSetter = function () { + return sandbox.replaceSetter.apply(null, arguments); + }; + + obj.replaceGetter = function () { + return sandbox.replaceGetter.apply(null, arguments); + }; + + if (sandbox.clock) { + obj.clock = sandbox.clock; + } + + obj.match = match; + + return obj; + }; + + sandbox.mock = function mock() { + const m = sinonMock.apply(null, arguments); + + addToCollection(m); + + return m; + }; + + sandbox.reset = function reset() { + applyOnEach(collection, "reset"); + applyOnEach(collection, "resetHistory"); + }; + + sandbox.resetBehavior = function resetBehavior() { + applyOnEach(collection, "resetBehavior"); + }; + + sandbox.resetHistory = function resetHistory() { + function privateResetHistory(f) { + const method = f.resetHistory || f.reset; + if (method) { + method.call(f); + } + } + + forEach(collection, privateResetHistory); + }; + + sandbox.restore = function restore() { + if (arguments.length) { + throw new Error( + "sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()", + ); + } + + reverse(collection); + applyOnEach(collection, "restore"); + collection = []; + + forEach(fakeRestorers, function (restorer) { + restorer(); + }); + fakeRestorers = []; + + sandbox.restoreContext(); + }; + + sandbox.restoreContext = function restoreContext() { + if (!sandbox.injectedKeys) { + return; + } + + forEach(sandbox.injectedKeys, function (injectedKey) { + delete sandbox.injectInto[injectedKey]; + }); + + sandbox.injectedKeys.length = 0; + }; + + /** + * Creates a restorer function for the property + * + * @param {object|Function} object + * @param {string} property + * @param {boolean} forceAssignment + * @returns {Function} restorer function + */ + function getFakeRestorer(object, property, forceAssignment = false) { + const descriptor = getPropertyDescriptor(object, property); + const value = forceAssignment && object[property]; + + function restorer() { + if (forceAssignment) { + object[property] = value; + } else if (descriptor?.isOwn) { + Object.defineProperty(object, property, descriptor); + } else { + delete object[property]; + } + } + + restorer.object = object; + restorer.property = property; + return restorer; + } + + function verifyNotReplaced(object, property) { + forEach(fakeRestorers, function (fakeRestorer) { + if ( + fakeRestorer.object === object && + fakeRestorer.property === property + ) { + throw new TypeError( + `Attempted to replace ${property} which is already replaced`, + ); + } + }); + } + + /** + * Replace an existing property + * + * @param {object|Function} object + * @param {string} property + * @param {*} replacement a fake, stub, spy or any other value + * @returns {*} + */ + sandbox.replace = function replace(object, property, replacement) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + throwOnAccessors(descriptor); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.replace.usingAccessor = function replaceUsingAccessor( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property, true)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.define = function define(object, property, value) { + const descriptor = getPropertyDescriptor(object, property); + + if (descriptor) { + throw new TypeError( + `Cannot define the already existing property ${valueToString( + property, + )}. Perhaps you meant sandbox.replace()?`, + ); + } + + if (typeof value === "undefined") { + throw new TypeError("Expected value argument to be defined"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the defined property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = value; + + return value; + }; + + sandbox.replaceGetter = function replaceGetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.get !== "function") { + throw new Error("`object.property` is not a getter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + Object.defineProperty(object, property, { + get: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + sandbox.replaceSetter = function replaceSetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.set !== "function") { + throw new Error("`object.property` is not a setter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + // eslint-disable-next-line accessor-pairs + Object.defineProperty(object, property, { + set: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + function commonPostInitSetup(args, spy) { + const [object, property, types] = args; + + const isSpyingOnEntireObject = + typeof property === "undefined" && typeof object === "object"; + + if (isSpyingOnEntireObject) { + const ownMethods = collectOwnMethods(spy); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + } else if (Array.isArray(types)) { + for (const accessorType of types) { + addToCollection(spy[accessorType]); + } + } else { + addToCollection(spy); + } + + return spy; + } + + sandbox.spy = function spy() { + const createdSpy = sinonSpy.apply(sinonSpy, arguments); + return commonPostInitSetup(arguments, createdSpy); + }; + + sandbox.stub = function stub() { + const createdStub = sinonStub.apply(sinonStub, arguments); + return commonPostInitSetup(arguments, createdStub); + }; + + // eslint-disable-next-line no-unused-vars + sandbox.fake = function fake(f) { + const s = sinonFake.apply(sinonFake, arguments); + + addToCollection(s); + + return s; + }; + + forEach(Object.keys(sinonFake), function (key) { + const fakeBehavior = sinonFake[key]; + if (typeof fakeBehavior === "function") { + sandbox.fake[key] = function () { + const s = fakeBehavior.apply(fakeBehavior, arguments); + + addToCollection(s); + + return s; + }; + } + }); + + sandbox.useFakeTimers = function useFakeTimers(args) { + const clock = sinonClock.useFakeTimers.call(null, args); + + sandbox.clock = clock; + addToCollection(clock); + + return clock; + }; + + sandbox.verify = function verify() { + applyOnEach(collection, "verify"); + }; + + sandbox.verifyAndRestore = function verifyAndRestore() { + let exception; + + try { + sandbox.verify(); + } catch (e) { + exception = e; + } + + sandbox.restore(); + + if (exception) { + throw exception; + } + }; +} + +Sandbox.prototype.match = match; + +module.exports = Sandbox; + +},{"./assert":4,"./collect-own-methods":6,"./create-stub-instance":9,"./fake":11,"./mock":13,"./spy":22,"./stub":23,"./util/core/get-property-descriptor":29,"./util/core/is-property-configurable":32,"./util/fake-timers":40,"@sinonjs/commons":47,"@sinonjs/samsam":87}],21:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Colorizer = require("./colorizer"); +const colororizer = new Colorizer(); +const match = require("@sinonjs/samsam").createMatcher; +const timesInWords = require("./util/core/times-in-words"); +const inspect = require("util").inspect; +const jsDiff = require("diff"); + +const join = arrayProto.join; +const map = arrayProto.map; +const push = arrayProto.push; +const slice = arrayProto.slice; + +/** + * + * @param matcher + * @param calledArg + * @param calledArgMessage + * + * @returns {string} the colored text + */ +function colorSinonMatchText(matcher, calledArg, calledArgMessage) { + let calledArgumentMessage = calledArgMessage; + let matcherMessage = matcher.message; + if (!matcher.test(calledArg)) { + matcherMessage = colororizer.red(matcher.message); + if (calledArgumentMessage) { + calledArgumentMessage = colororizer.green(calledArgumentMessage); + } + } + return `${calledArgumentMessage} ${matcherMessage}`; +} + +/** + * @param diff + * + * @returns {string} the colored diff + */ +function colorDiffText(diff) { + const objects = map(diff, function (part) { + let text = part.value; + if (part.added) { + text = colororizer.green(text); + } else if (part.removed) { + text = colororizer.red(text); + } + if (diff.length === 2) { + text += " "; // format simple diffs + } + return text; + }); + return join(objects, ""); +} + +/** + * + * @param value + * @returns {string} a quoted string + */ +function quoteStringValue(value) { + if (typeof value === "string") { + return JSON.stringify(value); + } + return value; +} + +module.exports = { + c: function (spyInstance) { + return timesInWords(spyInstance.callCount); + }, + + n: function (spyInstance) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return spyInstance.toString(); + }, + + D: function (spyInstance, args) { + let message = ""; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // describe multiple calls + if (l > 1) { + message += `\nCall ${i + 1}:`; + } + const calledArgs = spyInstance.getCall(i).args; + const expectedArgs = slice(args); + + for ( + let j = 0; + j < calledArgs.length || j < expectedArgs.length; + ++j + ) { + let calledArg = calledArgs[j]; + let expectedArg = expectedArgs[j]; + if (calledArg) { + calledArg = quoteStringValue(calledArg); + } + + if (expectedArg) { + expectedArg = quoteStringValue(expectedArg); + } + + message += "\n"; + + const calledArgMessage = + j < calledArgs.length ? inspect(calledArg) : ""; + if (match.isMatcher(expectedArg)) { + message += colorSinonMatchText( + expectedArg, + calledArg, + calledArgMessage, + ); + } else { + const expectedArgMessage = + j < expectedArgs.length ? inspect(expectedArg) : ""; + const diff = jsDiff.diffJson( + calledArgMessage, + expectedArgMessage, + ); + message += colorDiffText(diff); + } + } + } + + return message; + }, + + C: function (spyInstance) { + const calls = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + let stringifiedCall = ` ${spyInstance.getCall(i).toString()}`; + if (/\n/.test(calls[i - 1])) { + stringifiedCall = `\n${stringifiedCall}`; + } + push(calls, stringifiedCall); + } + + return calls.length > 0 ? `\n${join(calls, "\n")}` : ""; + }, + + t: function (spyInstance) { + const objects = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + push(objects, inspect(spyInstance.thisValues[i])); + } + + return join(objects, ", "); + }, + + "*": function (spyInstance, args) { + return join( + map(args, function (arg) { + return inspect(arg); + }), + ", ", + ); + }, +}; + +},{"./colorizer":7,"./util/core/times-in-words":36,"@sinonjs/commons":47,"@sinonjs/samsam":87,"diff":92,"util":91}],22:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const extend = require("./util/core/extend"); +const functionName = require("@sinonjs/commons").functionName; +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const isEsModule = require("./util/core/is-es-module"); +const proxyCallUtil = require("./proxy-call-util"); +const walkObject = require("./util/core/walk-object"); +const wrapMethod = require("./util/core/wrap-method"); +const valueToString = require("@sinonjs/commons").valueToString; + +/* cache references to library methods so that they also can be stubbed without problems */ +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const push = arrayProto.push; +const slice = arrayProto.slice; +const filter = Array.prototype.filter; + +let uuid = 0; + +function matches(fake, args, strict) { + const margs = fake.matchingArguments; + if ( + margs.length <= args.length && + deepEqual(slice(args, 0, margs.length), margs) + ) { + return !strict || margs.length === args.length; + } + return false; +} + +// Public API +const spyApi = { + withArgs: function () { + const args = slice(arguments); + const matching = pop(this.matchingFakes(args, true)); + if (matching) { + return matching; + } + + const original = this; + const fake = this.instantiateFake(); + fake.matchingArguments = args; + fake.parent = this; + push(this.fakes, fake); + + fake.withArgs = function () { + return original.withArgs.apply(original, arguments); + }; + + forEach(original.args, function (arg, i) { + if (!matches(fake, arg)) { + return; + } + + proxyCallUtil.incrementCallCount(fake); + push(fake.thisValues, original.thisValues[i]); + push(fake.args, arg); + push(fake.returnValues, original.returnValues[i]); + push(fake.exceptions, original.exceptions[i]); + push(fake.callIds, original.callIds[i]); + }); + + proxyCallUtil.createCallProperties(fake); + + return fake; + }, + + // Override proxy default implementation + matchingFakes: function (args, strict) { + return filter.call(this.fakes, function (fake) { + return matches(fake, args, strict); + }); + }, +}; + +/* eslint-disable @sinonjs/no-prototype-methods/no-prototype-methods */ +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(spyApi, "callArg", false, "callArgWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgWith = spyApi.callArg; +delegateToCalls(spyApi, "callArgOn", false, "callArgOnWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgOnWith = spyApi.callArgOn; +delegateToCalls(spyApi, "throwArg", false, "throwArg", false, function () { + throw new Error( + `${this.toString()} cannot throw arg since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yield", false, "yield", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +// "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode. +spyApi.invokeCallback = spyApi.yield; +delegateToCalls(spyApi, "yieldOn", false, "yieldOn", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yieldTo", false, "yieldTo", true, function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); +}); +delegateToCalls( + spyApi, + "yieldToOn", + false, + "yieldToOn", + true, + function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); + }, +); + +function createSpy(func) { + let name; + let funk = func; + + if (typeof funk !== "function") { + funk = function () { + return; + }; + } else { + name = functionName(funk); + } + + const proxy = createProxy(funk, funk); + + // Inherit spy API: + extend.nonEnum(proxy, spyApi); + extend.nonEnum(proxy, { + displayName: name || "spy", + fakes: [], + instantiateFake: createSpy, + id: `spy#${uuid++}`, + }); + return proxy; +} + +function spy(object, property, types) { + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be spied"); + } + + if (!property && typeof object === "function") { + return createSpy(object); + } + + if (!property && typeof object === "object") { + return walkObject(spy, object); + } + + if (!object && !property) { + return createSpy(function () { + return; + }); + } + + if (!types) { + return wrapMethod(object, property, createSpy(object[property])); + } + + const descriptor = {}; + const methodDesc = getPropertyDescriptor(object, property); + + forEach(types, function (type) { + descriptor[type] = createSpy(methodDesc[type]); + }); + + return wrapMethod(object, property, descriptor); +} + +extend(spy, spyApi); +module.exports = spy; + +},{"./proxy":18,"./proxy-call-util":15,"./util/core/extend":26,"./util/core/get-property-descriptor":29,"./util/core/is-es-module":30,"./util/core/walk-object":37,"./util/core/wrap-method":39,"@sinonjs/commons":47,"@sinonjs/samsam":87}],23:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const behavior = require("./behavior"); +const behaviors = require("./default-behaviors"); +const createProxy = require("./proxy"); +const functionName = require("@sinonjs/commons").functionName; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const isNonExistentProperty = require("./util/core/is-non-existent-property"); +const spy = require("./spy"); +const extend = require("./util/core/extend"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isEsModule = require("./util/core/is-es-module"); +const sinonType = require("./util/core/sinon-type"); +const wrapMethod = require("./util/core/wrap-method"); +const throwOnFalsyObject = require("./throw-on-falsy-object"); +const valueToString = require("@sinonjs/commons").valueToString; +const walkObject = require("./util/core/walk-object"); + +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const slice = arrayProto.slice; +const sort = arrayProto.sort; + +let uuid = 0; + +function createStub(originalFunc) { + // eslint-disable-next-line prefer-const + let proxy; + + function functionStub() { + const args = slice(arguments); + const matchings = proxy.matchingFakes(args); + + const fnStub = + pop( + sort(matchings, function (a, b) { + return ( + a.matchingArguments.length - b.matchingArguments.length + ); + }), + ) || proxy; + return getCurrentBehavior(fnStub).invoke(this, arguments); + } + + proxy = createProxy(functionStub, originalFunc || functionStub); + // Inherit spy API: + extend.nonEnum(proxy, spy); + // Inherit stub API: + extend.nonEnum(proxy, stub); + + const name = originalFunc ? functionName(originalFunc) : null; + extend.nonEnum(proxy, { + fakes: [], + instantiateFake: createStub, + displayName: name || "stub", + defaultBehavior: null, + behaviors: [], + id: `stub#${uuid++}`, + }); + + sinonType.set(proxy, "stub"); + + return proxy; +} + +function stub(object, property) { + if (arguments.length > 2) { + throw new TypeError( + "stub(obj, 'meth', fn) has been removed, see documentation", + ); + } + + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be stubbed"); + } + + throwOnFalsyObject.apply(null, arguments); + + if (isNonExistentProperty(object, property)) { + throw new TypeError( + `Cannot stub non-existent property ${valueToString(property)}`, + ); + } + + const actualDescriptor = getPropertyDescriptor(object, property); + + assertValidPropertyDescriptor(actualDescriptor, property); + + const isObjectOrFunction = + typeof object === "object" || typeof object === "function"; + const isStubbingEntireObject = + typeof property === "undefined" && isObjectOrFunction; + const isCreatingNewStub = !object && typeof property === "undefined"; + const isStubbingNonFuncProperty = + isObjectOrFunction && + typeof property !== "undefined" && + (typeof actualDescriptor === "undefined" || + typeof actualDescriptor.value !== "function"); + + if (isStubbingEntireObject) { + return walkObject(stub, object); + } + + if (isCreatingNewStub) { + return createStub(); + } + + const func = + typeof actualDescriptor.value === "function" + ? actualDescriptor.value + : null; + const s = createStub(func); + + extend.nonEnum(s, { + rootObj: object, + propName: property, + shadowsPropOnPrototype: !actualDescriptor.isOwn, + restore: function restore() { + if (actualDescriptor !== undefined && actualDescriptor.isOwn) { + Object.defineProperty(object, property, actualDescriptor); + return; + } + + delete object[property]; + }, + }); + + return isStubbingNonFuncProperty ? s : wrapMethod(object, property, s); +} + +function assertValidPropertyDescriptor(descriptor, property) { + if (!descriptor || !property) { + return; + } + if (descriptor.isOwn && !descriptor.configurable && !descriptor.writable) { + throw new TypeError( + `Descriptor for property ${property} is non-configurable and non-writable`, + ); + } + if ((descriptor.get || descriptor.set) && !descriptor.configurable) { + throw new TypeError( + `Descriptor for accessor property ${property} is non-configurable`, + ); + } + if (isDataDescriptor(descriptor) && !descriptor.writable) { + throw new TypeError( + `Descriptor for data property ${property} is non-writable`, + ); + } +} + +function isDataDescriptor(descriptor) { + return ( + !descriptor.value && + !descriptor.writable && + !descriptor.set && + !descriptor.get + ); +} + +/*eslint-disable no-use-before-define*/ +function getParentBehaviour(stubInstance) { + return stubInstance.parent && getCurrentBehavior(stubInstance.parent); +} + +function getDefaultBehavior(stubInstance) { + return ( + stubInstance.defaultBehavior || + getParentBehaviour(stubInstance) || + behavior.create(stubInstance) + ); +} + +function getCurrentBehavior(stubInstance) { + const currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1]; + return currentBehavior && currentBehavior.isPresent() + ? currentBehavior + : getDefaultBehavior(stubInstance); +} +/*eslint-enable no-use-before-define*/ + +const proto = { + resetBehavior: function () { + this.defaultBehavior = null; + this.behaviors = []; + + delete this.returnValue; + delete this.returnArgAt; + delete this.throwArgAt; + delete this.resolveArgAt; + delete this.fakeFn; + this.returnThis = false; + this.resolveThis = false; + + forEach(this.fakes, function (fake) { + fake.resetBehavior(); + }); + }, + + reset: function () { + this.resetHistory(); + this.resetBehavior(); + }, + + onCall: function onCall(index) { + if (!this.behaviors[index]) { + this.behaviors[index] = behavior.create(this); + } + + return this.behaviors[index]; + }, + + onFirstCall: function onFirstCall() { + return this.onCall(0); + }, + + onSecondCall: function onSecondCall() { + return this.onCall(1); + }, + + onThirdCall: function onThirdCall() { + return this.onCall(2); + }, + + withArgs: function withArgs() { + const fake = spy.withArgs.apply(this, arguments); + if (this.defaultBehavior && this.defaultBehavior.promiseLibrary) { + fake.defaultBehavior = + fake.defaultBehavior || behavior.create(fake); + fake.defaultBehavior.promiseLibrary = + this.defaultBehavior.promiseLibrary; + } + return fake; + }, +}; + +forEach(Object.keys(behavior), function (method) { + if ( + hasOwnProperty(behavior, method) && + !hasOwnProperty(proto, method) && + method !== "create" && + method !== "invoke" + ) { + proto[method] = behavior.createBehavior(method); + } +}); + +forEach(Object.keys(behaviors), function (method) { + if (hasOwnProperty(behaviors, method) && !hasOwnProperty(proto, method)) { + behavior.addBehavior(stub, method, behaviors[method]); + } +}); + +extend(stub, proto); +module.exports = stub; + +},{"./behavior":5,"./default-behaviors":10,"./proxy":18,"./spy":22,"./throw-on-falsy-object":24,"./util/core/extend":26,"./util/core/get-property-descriptor":29,"./util/core/is-es-module":30,"./util/core/is-non-existent-property":31,"./util/core/sinon-type":35,"./util/core/walk-object":37,"./util/core/wrap-method":39,"@sinonjs/commons":47}],24:[function(require,module,exports){ +"use strict"; +const valueToString = require("@sinonjs/commons").valueToString; + +function throwOnFalsyObject(object, property) { + if (property && !object) { + const type = object === null ? "null" : "undefined"; + throw new Error( + `Trying to stub property '${valueToString(property)}' of ${type}`, + ); + } +} + +module.exports = throwOnFalsyObject; + +},{"@sinonjs/commons":47}],25:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const reduce = arrayProto.reduce; + +module.exports = function exportAsyncBehaviors(behaviorMethods) { + return reduce( + Object.keys(behaviorMethods), + function (acc, method) { + // need to avoid creating another async versions of the newly added async methods + if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { + acc[`${method}Async`] = function () { + const result = behaviorMethods[method].apply( + this, + arguments, + ); + this.callbackAsync = true; + return result; + }; + } + return acc; + }, + {}, + ); +}; + +},{"@sinonjs/commons":47}],26:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; + +const join = arrayProto.join; +const push = arrayProto.push; + +// Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug +const hasDontEnumBug = (function () { + const obj = { + constructor: function () { + return "0"; + }, + toString: function () { + return "1"; + }, + valueOf: function () { + return "2"; + }, + toLocaleString: function () { + return "3"; + }, + prototype: function () { + return "4"; + }, + isPrototypeOf: function () { + return "5"; + }, + propertyIsEnumerable: function () { + return "6"; + }, + hasOwnProperty: function () { + return "7"; + }, + length: function () { + return "8"; + }, + unique: function () { + return "9"; + }, + }; + + const result = []; + for (const prop in obj) { + if (hasOwnProperty(obj, prop)) { + push(result, obj[prop]()); + } + } + return join(result, "") !== "0123456789"; +})(); + +/** + * + * @param target + * @param sources + * @param doCopy + * @returns {*} target + */ +function extendCommon(target, sources, doCopy) { + let source, i, prop; + + for (i = 0; i < sources.length; i++) { + source = sources[i]; + + for (prop in source) { + if (hasOwnProperty(source, prop)) { + doCopy(target, source, prop); + } + } + + // Make sure we copy (own) toString method even when in JScript with DontEnum bug + // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug + if ( + hasDontEnumBug && + hasOwnProperty(source, "toString") && + source.toString !== target.toString + ) { + target.toString = source.toString; + } + } + + return target; +} + +/** + * Public: Extend target in place with all (own) properties, except 'name' when [[writable]] is false, + * from sources in-order. Thus, last source will override properties in previous sources. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports = function extend(target, ...sources) { + return extendCommon( + target, + sources, + function copyValue(dest, source, prop) { + const destOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + dest, + prop, + ); + const sourceOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + source, + prop, + ); + + if (prop === "name" && !destOwnPropertyDescriptor.writable) { + return; + } + const descriptors = { + configurable: sourceOwnPropertyDescriptor.configurable, + enumerable: sourceOwnPropertyDescriptor.enumerable, + }; + /* + if the source has an Accessor property copy over the accessor functions (get and set) + data properties has writable attribute where as accessor property don't + REF: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#properties + */ + + if (hasOwnProperty(sourceOwnPropertyDescriptor, "writable")) { + descriptors.writable = sourceOwnPropertyDescriptor.writable; + descriptors.value = sourceOwnPropertyDescriptor.value; + } else { + if (sourceOwnPropertyDescriptor.get) { + descriptors.get = + sourceOwnPropertyDescriptor.get.bind(dest); + } + if (sourceOwnPropertyDescriptor.set) { + descriptors.set = + sourceOwnPropertyDescriptor.set.bind(dest); + } + } + Object.defineProperty(dest, prop, descriptors); + }, + ); +}; + +/** + * Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will + * override properties in previous sources. Define the properties as non enumerable. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports.nonEnum = function extendNonEnum(target, ...sources) { + return extendCommon( + target, + sources, + function copyProperty(dest, source, prop) { + Object.defineProperty(dest, prop, { + value: source[prop], + enumerable: false, + configurable: true, + writable: true, + }); + }, + ); +}; + +},{"@sinonjs/commons":47}],27:[function(require,module,exports){ +"use strict"; + +module.exports = function toString() { + let i, prop, thisValue; + if (this.getCall && this.callCount) { + i = this.callCount; + + while (i--) { + thisValue = this.getCall(i).thisValue; + + // eslint-disable-next-line guard-for-in + for (prop in thisValue) { + try { + if (thisValue[prop] === this) { + return prop; + } + } catch (e) { + // no-op - accessing props can throw an error, nothing to do here + } + } + } + } + + return this.displayName || "sinon fake"; +}; + +},{}],28:[function(require,module,exports){ +"use strict"; + +/* istanbul ignore next : not testing that setTimeout works */ +function nextTick(callback) { + setTimeout(callback, 0); +} + +module.exports = function getNextTick(process, setImmediate) { + if (typeof process === "object" && typeof process.nextTick === "function") { + return process.nextTick; + } + + if (typeof setImmediate === "function") { + return setImmediate; + } + + return nextTick; +}; + +},{}],29:[function(require,module,exports){ +"use strict"; + +/** + * @typedef {object} PropertyDescriptor + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description + * @property {boolean} configurable defaults to false + * @property {boolean} enumerable defaults to false + * @property {boolean} writable defaults to false + * @property {*} value defaults to undefined + * @property {Function} get defaults to undefined + * @property {Function} set defaults to undefined + */ + +/* + * The following type def is strictly speaking illegal in JSDoc, but the expression forms a + * legal Typescript union type and is understood by Visual Studio and the IntelliJ + * family of editors. The "TS" flavor of JSDoc is becoming the de-facto standard these + * days for that reason (and the fact that JSDoc is essentially unmaintained) + */ + +/** + * @typedef {{isOwn: boolean} & PropertyDescriptor} SinonPropertyDescriptor + * a slightly enriched property descriptor + * @property {boolean} isOwn true if the descriptor is owned by this object, false if it comes from the prototype + */ + +/** + * Returns a slightly modified property descriptor that one can tell is from the object or the prototype + * + * @param {*} object + * @param {string} property + * @returns {SinonPropertyDescriptor} + */ +function getPropertyDescriptor(object, property) { + let proto = object; + let descriptor; + const isOwn = Boolean( + object && Object.getOwnPropertyDescriptor(object, property), + ); + + while ( + proto && + !(descriptor = Object.getOwnPropertyDescriptor(proto, property)) + ) { + proto = Object.getPrototypeOf(proto); + } + + if (descriptor) { + descriptor.isOwn = isOwn; + } + + return descriptor; +} + +module.exports = getPropertyDescriptor; + +},{}],30:[function(require,module,exports){ +"use strict"; + +/** + * Verify if an object is a ECMAScript Module + * + * As the exports from a module is immutable we cannot alter the exports + * using spies or stubs. Let the consumer know this to avoid bug reports + * on weird error messages. + * + * @param {object} object The object to examine + * @returns {boolean} true when the object is a module + */ +module.exports = function (object) { + return ( + object && + typeof Symbol !== "undefined" && + object[Symbol.toStringTag] === "Module" && + Object.isSealed(object) + ); +}; + +},{}],31:[function(require,module,exports){ +"use strict"; + +/** + * @param {*} object + * @param {string} property + * @returns {boolean} whether a prop exists in the prototype chain + */ +function isNonExistentProperty(object, property) { + return Boolean( + object && typeof property !== "undefined" && !(property in object), + ); +} + +module.exports = isNonExistentProperty; + +},{}],32:[function(require,module,exports){ +"use strict"; + +const getPropertyDescriptor = require("./get-property-descriptor"); + +function isPropertyConfigurable(obj, propName) { + const propertyDescriptor = getPropertyDescriptor(obj, propName); + + return propertyDescriptor ? propertyDescriptor.configurable : true; +} + +module.exports = isPropertyConfigurable; + +},{"./get-property-descriptor":29}],33:[function(require,module,exports){ +"use strict"; + +function isRestorable(obj) { + return ( + typeof obj === "function" && + typeof obj.restore === "function" && + obj.restore.sinon + ); +} + +module.exports = isRestorable; + +},{}],34:[function(require,module,exports){ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +const getNextTick = require("./get-next-tick"); + +module.exports = getNextTick(globalObject.process, globalObject.setImmediate); + +},{"./get-next-tick":28,"@sinonjs/commons":47}],35:[function(require,module,exports){ +"use strict"; + +const sinonTypeSymbolProperty = Symbol("SinonType"); + +module.exports = { + /** + * Set the type of a Sinon object to make it possible to identify it later at runtime + * + * @param {object|Function} object object/function to set the type on + * @param {string} type the named type of the object/function + */ + set(object, type) { + Object.defineProperty(object, sinonTypeSymbolProperty, { + value: type, + configurable: false, + enumerable: false, + }); + }, + get(object) { + return object && object[sinonTypeSymbolProperty]; + }, +}; + +},{}],36:[function(require,module,exports){ +"use strict"; + +const array = [null, "once", "twice", "thrice"]; + +module.exports = function timesInWords(count) { + return array[count] || `${count || 0} times`; +}; + +},{}],37:[function(require,module,exports){ +"use strict"; + +const functionName = require("@sinonjs/commons").functionName; + +const getPropertyDescriptor = require("./get-property-descriptor"); +const walk = require("./walk"); + +/** + * A utility that allows traversing an object, applying mutating functions on the properties + * + * @param {Function} mutator called on each property + * @param {object} object the object we are walking over + * @param {Function} filter a predicate (boolean function) that will decide whether or not to apply the mutator to the current property + * @returns {void} nothing + */ +function walkObject(mutator, object, filter) { + let called = false; + const name = functionName(mutator); + + if (!object) { + throw new Error( + `Trying to ${name} object but received ${String(object)}`, + ); + } + + walk(object, function (prop, propOwner) { + // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object + // is not Object.prototype + if ( + propOwner !== Object.prototype && + prop !== "constructor" && + typeof getPropertyDescriptor(propOwner, prop).value === "function" + ) { + if (filter) { + if (filter(object, prop)) { + called = true; + mutator(object, prop); + } + } else { + called = true; + mutator(object, prop); + } + } + }); + + if (!called) { + throw new Error( + `Found no methods on object to which we could apply mutations`, + ); + } + + return object; +} + +module.exports = walkObject; + +},{"./get-property-descriptor":29,"./walk":38,"@sinonjs/commons":47}],38:[function(require,module,exports){ +"use strict"; + +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function walkInternal(obj, iterator, context, originalObj, seen) { + let prop; + const proto = Object.getPrototypeOf(obj); + + if (typeof Object.getOwnPropertyNames !== "function") { + // We explicitly want to enumerate through all of the prototype's properties + // in this case, therefore we deliberately leave out an own property check. + /* eslint-disable-next-line guard-for-in */ + for (prop in obj) { + iterator.call(context, obj[prop], prop, obj); + } + + return; + } + + forEach(Object.getOwnPropertyNames(obj), function (k) { + if (seen[k] !== true) { + seen[k] = true; + const target = + typeof Object.getOwnPropertyDescriptor(obj, k).get === + "function" + ? originalObj + : obj; + iterator.call(context, k, target); + } + }); + + if (proto) { + walkInternal(proto, iterator, context, originalObj, seen); + } +} + +/* Walks the prototype chain of an object and iterates over every own property + * name encountered. The iterator is called in the same fashion that Array.prototype.forEach + * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional + * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will + * default to using a simple for..in loop. + * + * obj - The object to walk the prototype chain for. + * iterator - The function to be called on each pass of the walk. + * context - (Optional) When given, the iterator will be called with this object as the receiver. + */ +module.exports = function walk(obj, iterator, context) { + return walkInternal(obj, iterator, context, obj, {}); +}; + +},{"@sinonjs/commons":47}],39:[function(require,module,exports){ +"use strict"; + +// eslint-disable-next-line no-empty-function +const noop = () => {}; +const getPropertyDescriptor = require("./get-property-descriptor"); +const extend = require("./extend"); +const sinonType = require("./sinon-type"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const valueToString = require("@sinonjs/commons").valueToString; +const push = require("@sinonjs/commons").prototypes.array.push; + +function isFunction(obj) { + return ( + typeof obj === "function" || + Boolean(obj && obj.constructor && obj.call && obj.apply) + ); +} + +function mirrorProperties(target, source) { + for (const prop in source) { + if (!hasOwnProperty(target, prop)) { + target[prop] = source[prop]; + } + } +} + +function getAccessor(object, property, method) { + const accessors = ["get", "set"]; + const descriptor = getPropertyDescriptor(object, property); + + for (let i = 0; i < accessors.length; i++) { + if ( + descriptor[accessors[i]] && + descriptor[accessors[i]].name === method.name + ) { + return accessors[i]; + } + } + return null; +} + +// Cheap way to detect if we have ES5 support. +const hasES5Support = "keys" in Object; + +module.exports = function wrapMethod(object, property, method) { + if (!object) { + throw new TypeError("Should wrap property of object"); + } + + if (typeof method !== "function" && typeof method !== "object") { + throw new TypeError( + "Method wrapper should be a function or a property descriptor", + ); + } + + function checkWrappedMethod(wrappedMethod) { + let error; + + if (!isFunction(wrappedMethod)) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${valueToString( + property, + )} as function`, + ); + } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) { + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already wrapped`, + ); + } else if (wrappedMethod.calledBefore) { + const verb = wrappedMethod.returns ? "stubbed" : "spied on"; + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already ${verb}`, + ); + } + + if (error) { + if (wrappedMethod && wrappedMethod.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethod.stackTraceError.stack}`; + } + throw error; + } + } + + let error, wrappedMethod, i, wrappedMethodDesc, target, accessor; + + const wrappedMethods = []; + + function simplePropertyAssignment() { + wrappedMethod = object[property]; + checkWrappedMethod(wrappedMethod); + object[property] = method; + method.displayName = property; + } + + // Firefox has a problem when using hasOwn.call on objects from other frames. + const owned = object.hasOwnProperty + ? object.hasOwnProperty(property) // eslint-disable-line @sinonjs/no-prototype-methods/no-prototype-methods + : hasOwnProperty(object, property); + + if (hasES5Support) { + const methodDesc = + typeof method === "function" ? { value: method } : method; + wrappedMethodDesc = getPropertyDescriptor(object, property); + + if (!wrappedMethodDesc) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${property} as function`, + ); + } else if ( + wrappedMethodDesc.restore && + wrappedMethodDesc.restore.sinon + ) { + error = new TypeError( + `Attempted to wrap ${property} which is already wrapped`, + ); + } + if (error) { + if (wrappedMethodDesc && wrappedMethodDesc.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethodDesc.stackTraceError.stack}`; + } + throw error; + } + + const types = Object.keys(methodDesc); + for (i = 0; i < types.length; i++) { + wrappedMethod = wrappedMethodDesc[types[i]]; + checkWrappedMethod(wrappedMethod); + push(wrappedMethods, wrappedMethod); + } + + mirrorProperties(methodDesc, wrappedMethodDesc); + for (i = 0; i < types.length; i++) { + mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]); + } + + // you are not allowed to flip the configurable prop on an + // existing descriptor to anything but false (#2514) + if (!owned) { + methodDesc.configurable = true; + } + + Object.defineProperty(object, property, methodDesc); + + // catch failing assignment + // this is the converse of the check in `.restore` below + if (typeof method === "function" && object[property] !== method) { + // correct any wrongdoings caused by the defineProperty call above, + // such as adding new items (if object was a Storage object) + delete object[property]; + simplePropertyAssignment(); + } + } else { + simplePropertyAssignment(); + } + + extendObjectWithWrappedMethods(); + + function extendObjectWithWrappedMethods() { + for (i = 0; i < wrappedMethods.length; i++) { + accessor = getAccessor(object, property, wrappedMethods[i]); + target = accessor ? method[accessor] : method; + extend.nonEnum(target, { + displayName: property, + wrappedMethod: wrappedMethods[i], + + // Set up an Error object for a stack trace which can be used later to find what line of + // code the original method was created on. + stackTraceError: new Error("Stack Trace for original"), + + restore: restore, + }); + + target.restore.sinon = true; + if (!hasES5Support) { + mirrorProperties(target, wrappedMethod); + } + } + } + + function restore() { + accessor = getAccessor(object, property, this.wrappedMethod); + let descriptor; + // For prototype properties try to reset by delete first. + // If this fails (ex: localStorage on mobile safari) then force a reset + // via direct assignment. + if (accessor) { + if (!owned) { + try { + // In some cases `delete` may throw an error + delete object[property][accessor]; + } catch (e) {} // eslint-disable-line no-empty + // For native code functions `delete` fails without throwing an error + // on Chrome < 43, PhantomJS, etc. + } else if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + descriptor[accessor] = wrappedMethodDesc[accessor]; + Object.defineProperty(object, property, descriptor); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property][accessor] = this.wrappedMethod; + } + } else { + // Use strict equality comparison to check failures then force a reset + // via direct assignment. + if (object[property][accessor] === target) { + object[property][accessor] = this.wrappedMethod; + } + } + } else { + if (!owned) { + try { + delete object[property]; + } catch (e) {} // eslint-disable-line no-empty + } else if (hasES5Support) { + Object.defineProperty(object, property, wrappedMethodDesc); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property] = this.wrappedMethod; + } + } else { + if (object[property] === target) { + object[property] = this.wrappedMethod; + } + } + } + if (sinonType.get(object) === "stub-instance") { + // this is simply to avoid errors after restoring if something should + // traverse the object in a cleanup phase, ref #2477 + object[property] = noop; + } + } + + return method; +}; + +},{"./extend":26,"./get-property-descriptor":29,"./sinon-type":35,"@sinonjs/commons":47}],40:[function(require,module,exports){ +"use strict"; + +const extend = require("./core/extend"); +const FakeTimers = require("@sinonjs/fake-timers"); +const globalObject = require("@sinonjs/commons").global; + +/** + * + * @param config + * @param globalCtx + * + * @returns {object} the clock, after installing it on the global context, if given + */ +function createClock(config, globalCtx) { + let FakeTimersCtx = FakeTimers; + if (globalCtx !== null && typeof globalCtx === "object") { + FakeTimersCtx = FakeTimers.withGlobal(globalCtx); + } + const clock = FakeTimersCtx.install(config); + clock.restore = clock.uninstall; + return clock; +} + +/** + * + * @param obj + * @param globalPropName + */ +function addIfDefined(obj, globalPropName) { + const globalProp = globalObject[globalPropName]; + if (typeof globalProp !== "undefined") { + obj[globalPropName] = globalProp; + } +} + +/** + * @param {number|Date|object} dateOrConfig The unix epoch value to install with (default 0) + * @returns {object} Returns a lolex clock instance + */ +exports.useFakeTimers = function (dateOrConfig) { + const hasArguments = typeof dateOrConfig !== "undefined"; + const argumentIsDateLike = + (typeof dateOrConfig === "number" || dateOrConfig instanceof Date) && + arguments.length === 1; + const argumentIsObject = + dateOrConfig !== null && + typeof dateOrConfig === "object" && + arguments.length === 1; + + if (!hasArguments) { + return createClock({ + now: 0, + }); + } + + if (argumentIsDateLike) { + return createClock({ + now: dateOrConfig, + }); + } + + if (argumentIsObject) { + const config = extend.nonEnum({}, dateOrConfig); + const globalCtx = config.global; + delete config.global; + return createClock(config, globalCtx); + } + + throw new TypeError( + "useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon", + ); +}; + +exports.clock = { + create: function (now) { + return FakeTimers.createClock(now); + }, +}; + +const timers = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval, + Date: Date, +}; +addIfDefined(timers, "setImmediate"); +addIfDefined(timers, "clearImmediate"); + +exports.timers = timers; + +},{"./core/extend":26,"@sinonjs/commons":47,"@sinonjs/fake-timers":60}],41:[function(require,module,exports){ +"use strict"; + +var every = require("./prototypes/array").every; + +/** + * @private + */ +function hasCallsLeft(callMap, spy) { + if (callMap[spy.id] === undefined) { + callMap[spy.id] = 0; + } + + return callMap[spy.id] < spy.callCount; +} + +/** + * @private + */ +function checkAdjacentCalls(callMap, spy, index, spies) { + var calledBeforeNext = true; + + if (index !== spies.length - 1) { + calledBeforeNext = spy.calledBefore(spies[index + 1]); + } + + if (hasCallsLeft(callMap, spy) && calledBeforeNext) { + callMap[spy.id] += 1; + return true; + } + + return false; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} calledBefore - A method that determines if this proxy was called before another one + * @property {string} id - Some id + * @property {number} callCount - Number of times this proxy has been called + */ + +/** + * Returns true when the spies have been called in the order they were supplied in + * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments + * @returns {boolean} true when spies are called in order, false otherwise + */ +function calledInOrder(spies) { + var callMap = {}; + // eslint-disable-next-line no-underscore-dangle + var _spies = arguments.length > 1 ? arguments : spies; + + return every(_spies, checkAdjacentCalls.bind(null, callMap)); +} + +module.exports = calledInOrder; + +},{"./prototypes/array":49}],42:[function(require,module,exports){ +"use strict"; + +/** + * Returns a display name for a value from a constructor + * @param {object} value A value to examine + * @returns {(string|null)} A string or null + */ +function className(value) { + const name = value.constructor && value.constructor.name; + return name || null; +} + +module.exports = className; + +},{}],43:[function(require,module,exports){ +/* eslint-disable no-console */ +"use strict"; + +/** + * Returns a function that will invoke the supplied function and print a + * deprecation warning to the console each time it is called. + * @param {Function} func + * @param {string} msg + * @returns {Function} + */ +exports.wrap = function (func, msg) { + var wrapped = function () { + exports.printWarning(msg); + return func.apply(this, arguments); + }; + if (func.prototype) { + wrapped.prototype = func.prototype; + } + return wrapped; +}; + +/** + * Returns a string which can be supplied to `wrap()` to notify the user that a + * particular part of the sinon API has been deprecated. + * @param {string} packageName + * @param {string} funcName + * @returns {string} + */ +exports.defaultMsg = function (packageName, funcName) { + return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`; +}; + +/** + * Prints a warning on the console, when it exists + * @param {string} msg + * @returns {undefined} + */ +exports.printWarning = function (msg) { + /* istanbul ignore next */ + if (typeof process === "object" && process.emitWarning) { + // Emit Warnings in Node + process.emitWarning(msg); + } else if (console.info) { + console.info(msg); + } else { + console.log(msg); + } +}; + +},{}],44:[function(require,module,exports){ +"use strict"; + +/** + * Returns true when fn returns true for all members of obj. + * This is an every implementation that works for all iterables + * @param {object} obj + * @param {Function} fn + * @returns {boolean} + */ +module.exports = function every(obj, fn) { + var pass = true; + + try { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + obj.forEach(function () { + if (!fn.apply(this, arguments)) { + // Throwing an error is the only way to break `forEach` + throw new Error(); + } + }); + } catch (e) { + pass = false; + } + + return pass; +}; + +},{}],45:[function(require,module,exports){ +"use strict"; + +/** + * Returns a display name for a function + * @param {Function} func + * @returns {string} + */ +module.exports = function functionName(func) { + if (!func) { + return ""; + } + + try { + return ( + func.displayName || + func.name || + // Use function decomposition as a last resort to get function + // name. Does not rely on function decomposition to work - if it + // doesn't debugging will be slightly less informative + // (i.e. toString will say 'spy' rather than 'myFunc'). + (String(func).match(/function ([^\s(]+)/) || [])[1] + ); + } catch (e) { + // Stringify may fail and we might get an exception, as a last-last + // resort fall back to empty string. + return ""; + } +}; + +},{}],46:[function(require,module,exports){ +"use strict"; + +/** + * A reference to the global object + * @type {object} globalObject + */ +var globalObject; + +/* istanbul ignore else */ +if (typeof global !== "undefined") { + // Node + globalObject = global; +} else if (typeof window !== "undefined") { + // Browser + globalObject = window; +} else { + // WebWorker + globalObject = self; +} + +module.exports = globalObject; + +},{}],47:[function(require,module,exports){ +"use strict"; + +module.exports = { + global: require("./global"), + calledInOrder: require("./called-in-order"), + className: require("./class-name"), + deprecated: require("./deprecated"), + every: require("./every"), + functionName: require("./function-name"), + orderByFirstCall: require("./order-by-first-call"), + prototypes: require("./prototypes"), + typeOf: require("./type-of"), + valueToString: require("./value-to-string"), +}; + +},{"./called-in-order":41,"./class-name":42,"./deprecated":43,"./every":44,"./function-name":45,"./global":46,"./order-by-first-call":48,"./prototypes":52,"./type-of":58,"./value-to-string":59}],48:[function(require,module,exports){ +"use strict"; + +var sort = require("./prototypes/array").sort; +var slice = require("./prototypes/array").slice; + +/** + * @private + */ +function comparator(a, b) { + // uuid, won't ever be equal + var aCall = a.getCall(0); + var bCall = b.getCall(0); + var aId = (aCall && aCall.callId) || -1; + var bId = (bCall && bCall.callId) || -1; + + return aId < bId ? -1 : 1; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} getCall - A method that can return the first call + */ + +/** + * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call + * @param {SinonProxy[] | SinonProxy} spies + * @returns {SinonProxy[]} + */ +function orderByFirstCall(spies) { + return sort(slice(spies), comparator); +} + +module.exports = orderByFirstCall; + +},{"./prototypes/array":49}],49:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Array.prototype); + +},{"./copy-prototype-methods":50}],50:[function(require,module,exports){ +"use strict"; + +var call = Function.call; +var throwsOnProto = require("./throws-on-proto"); + +var disallowedProperties = [ + // ignore size because it throws from Map + "size", + "caller", + "callee", + "arguments", +]; + +// This branch is covered when tests are run with `--disable-proto=throw`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */ +if (throwsOnProto) { + disallowedProperties.push("__proto__"); +} + +module.exports = function copyPrototypeMethods(prototype) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return Object.getOwnPropertyNames(prototype).reduce(function ( + result, + name + ) { + if (disallowedProperties.includes(name)) { + return result; + } + + if (typeof prototype[name] !== "function") { + return result; + } + + result[name] = call.bind(prototype[name]); + + return result; + }, + Object.create(null)); +}; + +},{"./throws-on-proto":57}],51:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Function.prototype); + +},{"./copy-prototype-methods":50}],52:[function(require,module,exports){ +"use strict"; + +module.exports = { + array: require("./array"), + function: require("./function"), + map: require("./map"), + object: require("./object"), + set: require("./set"), + string: require("./string"), +}; + +},{"./array":49,"./function":51,"./map":53,"./object":54,"./set":55,"./string":56}],53:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Map.prototype); + +},{"./copy-prototype-methods":50}],54:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Object.prototype); + +},{"./copy-prototype-methods":50}],55:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Set.prototype); + +},{"./copy-prototype-methods":50}],56:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(String.prototype); + +},{"./copy-prototype-methods":50}],57:[function(require,module,exports){ +"use strict"; + +/** + * Is true when the environment causes an error to be thrown for accessing the + * __proto__ property. + * This is necessary in order to support `node --disable-proto=throw`. + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto + * @type {boolean} + */ +let throwsOnProto; +try { + const object = {}; + // eslint-disable-next-line no-proto, no-unused-expressions + object.__proto__; + throwsOnProto = false; +} catch (_) { + // This branch is covered when tests are run with `--disable-proto=throw`, + // however we can test both branches at the same time, so this is ignored + /* istanbul ignore next */ + throwsOnProto = true; +} + +module.exports = throwsOnProto; + +},{}],58:[function(require,module,exports){ +"use strict"; + +var type = require("type-detect"); + +/** + * Returns the lower-case result of running type from type-detect on the value + * @param {*} value + * @returns {string} + */ +module.exports = function typeOf(value) { + return type(value).toLowerCase(); +}; + +},{"type-detect":95}],59:[function(require,module,exports){ +"use strict"; + +/** + * Returns a string representation of the value + * @param {*} value + * @returns {string} + */ +function valueToString(value) { + if (value && value.toString) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return value.toString(); + } + return String(value); +} + +module.exports = valueToString; + +},{}],60:[function(require,module,exports){ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +let timersModule, timersPromisesModule; +if (typeof require === "function" && typeof module === "object") { + try { + timersModule = require("timers"); + } catch (e) { + // ignored + } + try { + timersPromisesModule = require("timers/promises"); + } catch (e) { + // ignored + } +} + +/** + * @typedef {object} IdleDeadline + * @property {boolean} didTimeout - whether or not the callback was called before reaching the optional timeout + * @property {function():number} timeRemaining - a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period + */ + +/** + * Queues a function to be called during a browser's idle periods + * + * @callback RequestIdleCallback + * @param {function(IdleDeadline)} callback + * @param {{timeout: number}} options - an options object + * @returns {number} the id + */ + +/** + * @callback NextTick + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {void} + */ + +/** + * @callback SetImmediate + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {NodeImmediate} + */ + +/** + * @callback VoidVarArgsFunc + * @param {...*} callback - the callback to run + * @returns {void} + */ + +/** + * @typedef RequestAnimationFrame + * @property {function(number):void} requestAnimationFrame + * @returns {number} - the id + */ + +/** + * @typedef Performance + * @property {function(): number} now + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * @typedef {object} Clock + * @property {number} now - the current time + * @property {Date} Date - the Date constructor + * @property {number} loopLimit - the maximum number of timers before assuming an infinite loop + * @property {RequestIdleCallback} requestIdleCallback + * @property {function(number):void} cancelIdleCallback + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {NextTick} nextTick + * @property {queueMicrotask} queueMicrotask + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {SetImmediate} setImmediate + * @property {function(NodeImmediate):void} clearImmediate + * @property {function():number} countTimers + * @property {RequestAnimationFrame} requestAnimationFrame + * @property {function(number):void} cancelAnimationFrame + * @property {function():void} runMicrotasks + * @property {function(string | number): number} tick + * @property {function(string | number): Promise} tickAsync + * @property {function(): number} next + * @property {function(): Promise} nextAsync + * @property {function(): number} runAll + * @property {function(): number} runToFrame + * @property {function(): Promise} runAllAsync + * @property {function(): number} runToLast + * @property {function(): Promise} runToLastAsync + * @property {function(): void} reset + * @property {function(number | Date): void} setSystemTime + * @property {function(number): void} jump + * @property {Performance} performance + * @property {function(number[]): number[]} hrtime - process.hrtime (legacy) + * @property {function(): void} uninstall Uninstall the clock. + * @property {Function[]} methods - the methods that are faked + * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods + * @property {{methodName:string, original:any}[] | undefined} timersPromisesModuleMethods + * @property {Map} abortListenerMap + */ +/* eslint-enable jsdoc/require-property-description */ + +/** + * Configuration object for the `install` method. + * + * @typedef {object} Config + * @property {number|Date} [now] a number (in milliseconds) or a Date object (default epoch) + * @property {string[]} [toFake] names of the methods that should be faked. + * @property {number} [loopLimit] the maximum number of timers that will be run when calling runAll() + * @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false) + * @property {number} [advanceTimeDelta] increment mocked time every <> ms (default: 20ms) + * @property {boolean} [shouldClearNativeTimers] forwards clear timer calls to native functions if they are not fakes (default: false) + * @property {boolean} [ignoreMissingTimers] default is false, meaning asking to fake timers that are not present will throw an error + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * The internal structure to describe a scheduled fake timer + * + * @typedef {object} Timer + * @property {Function} func + * @property {*[]} args + * @property {number} delay + * @property {number} callAt + * @property {number} createdAt + * @property {boolean} immediate + * @property {number} id + * @property {Error} [error] + */ + +/** + * A Node timer + * + * @typedef {object} NodeImmediate + * @property {function(): boolean} hasRef + * @property {function(): NodeImmediate} ref + * @property {function(): NodeImmediate} unref + */ +/* eslint-enable jsdoc/require-property-description */ + +/* eslint-disable complexity */ + +/** + * Mocks available features in the specified global namespace. + * + * @param {*} _global Namespace to mock (e.g. `window`) + * @returns {FakeTimers} + */ +function withGlobal(_global) { + const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint + const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs + const NOOP = function () { + return undefined; + }; + const NOOP_ARRAY = function () { + return []; + }; + const isPresent = {}; + let timeoutResult, + addTimerReturnsObject = false; + + if (_global.setTimeout) { + isPresent.setTimeout = true; + timeoutResult = _global.setTimeout(NOOP, 0); + addTimerReturnsObject = typeof timeoutResult === "object"; + } + isPresent.clearTimeout = Boolean(_global.clearTimeout); + isPresent.setInterval = Boolean(_global.setInterval); + isPresent.clearInterval = Boolean(_global.clearInterval); + isPresent.hrtime = + _global.process && typeof _global.process.hrtime === "function"; + isPresent.hrtimeBigint = + isPresent.hrtime && typeof _global.process.hrtime.bigint === "function"; + isPresent.nextTick = + _global.process && typeof _global.process.nextTick === "function"; + const utilPromisify = _global.process && require("util").promisify; + isPresent.performance = + _global.performance && typeof _global.performance.now === "function"; + const hasPerformancePrototype = + _global.Performance && + (typeof _global.Performance).match(/^(function|object)$/); + const hasPerformanceConstructorPrototype = + _global.performance && + _global.performance.constructor && + _global.performance.constructor.prototype; + isPresent.queueMicrotask = _global.hasOwnProperty("queueMicrotask"); + isPresent.requestAnimationFrame = + _global.requestAnimationFrame && + typeof _global.requestAnimationFrame === "function"; + isPresent.cancelAnimationFrame = + _global.cancelAnimationFrame && + typeof _global.cancelAnimationFrame === "function"; + isPresent.requestIdleCallback = + _global.requestIdleCallback && + typeof _global.requestIdleCallback === "function"; + isPresent.cancelIdleCallbackPresent = + _global.cancelIdleCallback && + typeof _global.cancelIdleCallback === "function"; + isPresent.setImmediate = + _global.setImmediate && typeof _global.setImmediate === "function"; + isPresent.clearImmediate = + _global.clearImmediate && typeof _global.clearImmediate === "function"; + isPresent.Intl = _global.Intl && typeof _global.Intl === "object"; + + if (_global.clearTimeout) { + _global.clearTimeout(timeoutResult); + } + + const NativeDate = _global.Date; + const NativeIntl = _global.Intl; + let uniqueTimerId = idCounterStart; + + if (NativeDate === undefined) { + throw new Error( + "The global scope doesn't have a `Date` object" + + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)", + ); + } + isPresent.Date = true; + + /** + * The PerformanceEntry object encapsulates a single performance metric + * that is part of the browser's performance timeline. + * + * This is an object returned by the `mark` and `measure` methods on the Performance prototype + */ + class FakePerformanceEntry { + constructor(name, entryType, startTime, duration) { + this.name = name; + this.entryType = entryType; + this.startTime = startTime; + this.duration = duration; + } + + toJSON() { + return JSON.stringify({ ...this }); + } + } + + /** + * @param {number} num + * @returns {boolean} + */ + function isNumberFinite(num) { + if (Number.isFinite) { + return Number.isFinite(num); + } + + return isFinite(num); + } + + let isNearInfiniteLimit = false; + + /** + * @param {Clock} clock + * @param {number} i + */ + function checkIsNearInfiniteLimit(clock, i) { + if (clock.loopLimit && i === clock.loopLimit - 1) { + isNearInfiniteLimit = true; + } + } + + /** + * + */ + function resetIsNearInfiniteLimit() { + isNearInfiniteLimit = false; + } + + /** + * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into + * number of milliseconds. This is used to support human-readable strings passed + * to clock.tick() + * + * @param {string} str + * @returns {number} + */ + function parseTime(str) { + if (!str) { + return 0; + } + + const strings = str.split(":"); + const l = strings.length; + let i = l; + let ms = 0; + let parsed; + + if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { + throw new Error( + "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits", + ); + } + + while (i--) { + parsed = parseInt(strings[i], 10); + + if (parsed >= 60) { + throw new Error(`Invalid time ${str}`); + } + + ms += parsed * Math.pow(60, l - i - 1); + } + + return ms * 1000; + } + + /** + * Get the decimal part of the millisecond value as nanoseconds + * + * @param {number} msFloat the number of milliseconds + * @returns {number} an integer number of nanoseconds in the range [0,1e6) + * + * Example: nanoRemainer(123.456789) -> 456789 + */ + function nanoRemainder(msFloat) { + const modulo = 1e6; + const remainder = (msFloat * 1e6) % modulo; + const positiveRemainder = + remainder < 0 ? remainder + modulo : remainder; + + return Math.floor(positiveRemainder); + } + + /** + * Used to grok the `now` parameter to createClock. + * + * @param {Date|number} epoch the system time + * @returns {number} + */ + function getEpoch(epoch) { + if (!epoch) { + return 0; + } + if (typeof epoch.getTime === "function") { + return epoch.getTime(); + } + if (typeof epoch === "number") { + return epoch; + } + throw new TypeError("now should be milliseconds since UNIX epoch"); + } + + /** + * @param {number} from + * @param {number} to + * @param {Timer} timer + * @returns {boolean} + */ + function inRange(from, to, timer) { + return timer && timer.callAt >= from && timer.callAt <= to; + } + + /** + * @param {Clock} clock + * @param {Timer} job + */ + function getInfiniteLoopError(clock, job) { + const infiniteLoopError = new Error( + `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`, + ); + + if (!job.error) { + return infiniteLoopError; + } + + // pattern never matched in Node + const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/; + let clockMethodPattern = new RegExp( + String(Object.keys(clock).join("|")), + ); + + if (addTimerReturnsObject) { + // node.js environment + clockMethodPattern = new RegExp( + `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`, + ); + } + + let matchedLineIndex = -1; + job.error.stack.split("\n").some(function (line, i) { + // If we've matched a computed target line (e.g. setTimeout) then we + // don't need to look any further. Return true to stop iterating. + const matchedComputedTarget = line.match(computedTargetPattern); + /* istanbul ignore if */ + if (matchedComputedTarget) { + matchedLineIndex = i; + return true; + } + + // If we've matched a clock method line, then there may still be + // others further down the trace. Return false to keep iterating. + const matchedClockMethod = line.match(clockMethodPattern); + if (matchedClockMethod) { + matchedLineIndex = i; + return false; + } + + // If we haven't matched anything on this line, but we matched + // previously and set the matched line index, then we can stop. + // If we haven't matched previously, then we should keep iterating. + return matchedLineIndex >= 0; + }); + + const stack = `${infiniteLoopError}\n${job.type || "Microtask"} - ${ + job.func.name || "anonymous" + }\n${job.error.stack + .split("\n") + .slice(matchedLineIndex + 1) + .join("\n")}`; + + try { + Object.defineProperty(infiniteLoopError, "stack", { + value: stack, + }); + } catch (e) { + // noop + } + + return infiniteLoopError; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function createDate() { + class ClockDate extends NativeDate { + /** + * @param {number} year + * @param {number} month + * @param {number} date + * @param {number} hour + * @param {number} minute + * @param {number} second + * @param {number} ms + * @returns void + */ + // eslint-disable-next-line no-unused-vars + constructor(year, month, date, hour, minute, second, ms) { + // Defensive and verbose to avoid potential harm in passing + // explicit undefined when user does not pass argument + if (arguments.length === 0) { + super(ClockDate.clock.now); + } else { + super(...arguments); + } + + // ensures identity checks using the constructor prop still works + // this should have no other functional effect + Object.defineProperty(this, "constructor", { + value: NativeDate, + enumerable: false, + }); + } + + static [Symbol.hasInstance](instance) { + return instance instanceof NativeDate; + } + } + + ClockDate.isFake = true; + + if (NativeDate.now) { + ClockDate.now = function now() { + return ClockDate.clock.now; + }; + } + + if (NativeDate.toSource) { + ClockDate.toSource = function toSource() { + return NativeDate.toSource(); + }; + } + + ClockDate.toString = function toString() { + return NativeDate.toString(); + }; + + // noinspection UnnecessaryLocalVariableJS + /** + * A normal Class constructor cannot be called without `new`, but Date can, so we need + * to wrap it in a Proxy in order to ensure this functionality of Date is kept intact + * + * @type {ClockDate} + */ + const ClockDateProxy = new Proxy(ClockDate, { + // handler for [[Call]] invocations (i.e. not using `new`) + apply() { + // the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. + // This remains so in the 10th edition of 2019 as well. + if (this instanceof ClockDate) { + throw new TypeError( + "A Proxy should only capture `new` calls with the `construct` handler. This is not supposed to be possible, so check the logic.", + ); + } + + return new NativeDate(ClockDate.clock.now).toString(); + }, + }); + + return ClockDateProxy; + } + + /** + * Mirror Intl by default on our fake implementation + * + * Most of the properties are the original native ones, + * but we need to take control of those that have a + * dependency on the current clock. + * + * @returns {object} the partly fake Intl implementation + */ + function createIntl() { + const ClockIntl = {}; + /* + * All properties of Intl are non-enumerable, so we need + * to do a bit of work to get them out. + */ + Object.getOwnPropertyNames(NativeIntl).forEach( + (property) => (ClockIntl[property] = NativeIntl[property]), + ); + + ClockIntl.DateTimeFormat = function (...args) { + const realFormatter = new NativeIntl.DateTimeFormat(...args); + const formatter = {}; + + ["formatRange", "formatRangeToParts", "resolvedOptions"].forEach( + (method) => { + formatter[method] = + realFormatter[method].bind(realFormatter); + }, + ); + + ["format", "formatToParts"].forEach((method) => { + formatter[method] = function (date) { + return realFormatter[method](date || ClockIntl.clock.now); + }; + }); + + return formatter; + }; + + ClockIntl.DateTimeFormat.prototype = Object.create( + NativeIntl.DateTimeFormat.prototype, + ); + + ClockIntl.DateTimeFormat.supportedLocalesOf = + NativeIntl.DateTimeFormat.supportedLocalesOf; + + return ClockIntl; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function enqueueJob(clock, job) { + // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob + if (!clock.jobs) { + clock.jobs = []; + } + clock.jobs.push(job); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function runJobs(clock) { + // runs all microtick-deferred tasks - ecma262/#sec-runjobs + if (!clock.jobs) { + return; + } + for (let i = 0; i < clock.jobs.length; i++) { + const job = clock.jobs[i]; + job.func.apply(null, job.args); + + checkIsNearInfiniteLimit(clock, i); + if (clock.loopLimit && i > clock.loopLimit) { + throw getInfiniteLoopError(clock, job); + } + } + resetIsNearInfiniteLimit(); + clock.jobs = []; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + * @returns {number} id of the created timer + */ + function addTimer(clock, timer) { + if (timer.func === undefined) { + throw new Error("Callback must be provided to timer calls"); + } + + if (addTimerReturnsObject) { + // Node.js environment + if (typeof timer.func !== "function") { + throw new TypeError( + `[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${ + timer.func + } of type ${typeof timer.func}`, + ); + } + } + + if (isNearInfiniteLimit) { + timer.error = new Error(); + } + + timer.type = timer.immediate ? "Immediate" : "Timeout"; + + if (timer.hasOwnProperty("delay")) { + if (typeof timer.delay !== "number") { + timer.delay = parseInt(timer.delay, 10); + } + + if (!isNumberFinite(timer.delay)) { + timer.delay = 0; + } + timer.delay = timer.delay > maxTimeout ? 1 : timer.delay; + timer.delay = Math.max(0, timer.delay); + } + + if (timer.hasOwnProperty("interval")) { + timer.type = "Interval"; + timer.interval = timer.interval > maxTimeout ? 1 : timer.interval; + } + + if (timer.hasOwnProperty("animation")) { + timer.type = "AnimationFrame"; + timer.animation = true; + } + + if (timer.hasOwnProperty("idleCallback")) { + timer.type = "IdleCallback"; + timer.idleCallback = true; + } + + if (!clock.timers) { + clock.timers = {}; + } + + timer.id = uniqueTimerId++; + timer.createdAt = clock.now; + timer.callAt = + clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + clock.timers[timer.id] = timer; + + if (addTimerReturnsObject) { + const res = { + refed: true, + ref: function () { + this.refed = true; + return res; + }, + unref: function () { + this.refed = false; + return res; + }, + hasRef: function () { + return this.refed; + }, + refresh: function () { + timer.callAt = + clock.now + + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + // it _might_ have been removed, but if not the assignment is perfectly fine + clock.timers[timer.id] = timer; + + return res; + }, + [Symbol.toPrimitive]: function () { + return timer.id; + }, + }; + return res; + } + + return timer.id; + } + + /* eslint consistent-return: "off" */ + /** + * Timer comparitor + * + * @param {Timer} a + * @param {Timer} b + * @returns {number} + */ + function compareTimers(a, b) { + // Sort first by absolute timing + if (a.callAt < b.callAt) { + return -1; + } + if (a.callAt > b.callAt) { + return 1; + } + + // Sort next by immediate, immediate timers take precedence + if (a.immediate && !b.immediate) { + return -1; + } + if (!a.immediate && b.immediate) { + return 1; + } + + // Sort next by creation time, earlier-created timers take precedence + if (a.createdAt < b.createdAt) { + return -1; + } + if (a.createdAt > b.createdAt) { + return 1; + } + + // Sort next by id, lower-id timers take precedence + if (a.id < b.id) { + return -1; + } + if (a.id > b.id) { + return 1; + } + + // As timer ids are unique, no fallback `0` is necessary + } + + /** + * @param {Clock} clock + * @param {number} from + * @param {number} to + * @returns {Timer} + */ + function firstTimerInRange(clock, from, to) { + const timers = clock.timers; + let timer = null; + let id, isInRange; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + isInRange = inRange(from, to, timers[id]); + + if ( + isInRange && + (!timer || compareTimers(timer, timers[id]) === 1) + ) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function firstTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === 1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function lastTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === -1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + */ + function callTimer(clock, timer) { + if (typeof timer.interval === "number") { + clock.timers[timer.id].callAt += timer.interval; + } else { + delete clock.timers[timer.id]; + } + + if (typeof timer.func === "function") { + timer.func.apply(null, timer.args); + } else { + /* eslint no-eval: "off" */ + const eval2 = eval; + (function () { + eval2(timer.func); + })(); + } + } + + /** + * Gets clear handler name for a given timer type + * + * @param {string} ttype + */ + function getClearHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `cancel${ttype}`; + } + return `clear${ttype}`; + } + + /** + * Gets schedule handler name for a given timer type + * + * @param {string} ttype + */ + function getScheduleHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `request${ttype}`; + } + return `set${ttype}`; + } + + /** + * Creates an anonymous function to warn only once + */ + function createWarnOnce() { + let calls = 0; + return function (msg) { + // eslint-disable-next-line + !calls++ && console.warn(msg); + }; + } + const warnOnce = createWarnOnce(); + + /** + * @param {Clock} clock + * @param {number} timerId + * @param {string} ttype + */ + function clearTimer(clock, timerId, ttype) { + if (!timerId) { + // null appears to be allowed in most browsers, and appears to be + // relied upon by some libraries, like Bootstrap carousel + return; + } + + if (!clock.timers) { + clock.timers = {}; + } + + // in Node, the ID is stored as the primitive value for `Timeout` objects + // for `Immediate` objects, no ID exists, so it gets coerced to NaN + const id = Number(timerId); + + if (Number.isNaN(id) || id < idCounterStart) { + const handlerName = getClearHandler(ttype); + + if (clock.shouldClearNativeTimers === true) { + const nativeHandler = clock[`_${handlerName}`]; + return typeof nativeHandler === "function" + ? nativeHandler(timerId) + : undefined; + } + warnOnce( + `FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.` + + "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`.", + ); + } + + if (clock.timers.hasOwnProperty(id)) { + // check that the ID matches a timer of the correct type + const timer = clock.timers[id]; + if ( + timer.type === ttype || + (timer.type === "Timeout" && ttype === "Interval") || + (timer.type === "Interval" && ttype === "Timeout") + ) { + delete clock.timers[id]; + } else { + const clear = getClearHandler(ttype); + const schedule = getScheduleHandler(timer.type); + throw new Error( + `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`, + ); + } + } + } + + /** + * @param {Clock} clock + * @param {Config} config + * @returns {Timer[]} + */ + function uninstall(clock, config) { + let method, i, l; + const installedHrTime = "_hrtime"; + const installedNextTick = "_nextTick"; + + for (i = 0, l = clock.methods.length; i < l; i++) { + method = clock.methods[i]; + if (method === "hrtime" && _global.process) { + _global.process.hrtime = clock[installedHrTime]; + } else if (method === "nextTick" && _global.process) { + _global.process.nextTick = clock[installedNextTick]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + clock, + `_${method}`, + ); + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + _global, + method, + originalPerfDescriptor, + ); + } else if (originalPerfDescriptor.configurable) { + _global[method] = clock[`_${method}`]; + } + } else { + if (_global[method] && _global[method].hadOwnProperty) { + _global[method] = clock[`_${method}`]; + } else { + try { + delete _global[method]; + } catch (ignore) { + /* eslint no-empty: "off" */ + } + } + } + if (clock.timersModuleMethods !== undefined) { + for (let j = 0; j < clock.timersModuleMethods.length; j++) { + const entry = clock.timersModuleMethods[j]; + timersModule[entry.methodName] = entry.original; + } + } + if (clock.timersPromisesModuleMethods !== undefined) { + for ( + let j = 0; + j < clock.timersPromisesModuleMethods.length; + j++ + ) { + const entry = clock.timersPromisesModuleMethods[j]; + timersPromisesModule[entry.methodName] = entry.original; + } + } + } + + if (config.shouldAdvanceTime === true) { + _global.clearInterval(clock.attachedInterval); + } + + // Prevent multiple executions which will completely remove these props + clock.methods = []; + + for (const [listener, signal] of clock.abortListenerMap.entries()) { + signal.removeEventListener("abort", listener); + clock.abortListenerMap.delete(listener); + } + + // return pending timers, to enable checking what timers remained on uninstall + if (!clock.timers) { + return []; + } + return Object.keys(clock.timers).map(function mapper(key) { + return clock.timers[key]; + }); + } + + /** + * @param {object} target the target containing the method to replace + * @param {string} method the keyname of the method on the target + * @param {Clock} clock + */ + function hijackMethod(target, method, clock) { + clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call( + target, + method, + ); + clock[`_${method}`] = target[method]; + + if (method === "Date") { + target[method] = clock[method]; + } else if (method === "Intl") { + target[method] = clock[method]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + target, + method, + ); + // JSDOM has a read only performance field so we have to save/copy it differently + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + clock, + `_${method}`, + originalPerfDescriptor, + ); + + const perfDescriptor = Object.getOwnPropertyDescriptor( + clock, + method, + ); + Object.defineProperty(target, method, perfDescriptor); + } else { + target[method] = clock[method]; + } + } else { + target[method] = function () { + return clock[method].apply(clock, arguments); + }; + + Object.defineProperties( + target[method], + Object.getOwnPropertyDescriptors(clock[method]), + ); + } + + target[method].clock = clock; + } + + /** + * @param {Clock} clock + * @param {number} advanceTimeDelta + */ + function doIntervalTick(clock, advanceTimeDelta) { + clock.tick(advanceTimeDelta); + } + + /** + * @typedef {object} Timers + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {Date} Date + * @property {Intl} Intl + * @property {SetImmediate=} setImmediate + * @property {function(NodeImmediate): void=} clearImmediate + * @property {function(number[]):number[]=} hrtime + * @property {NextTick=} nextTick + * @property {Performance=} performance + * @property {RequestAnimationFrame=} requestAnimationFrame + * @property {boolean=} queueMicrotask + * @property {function(number): void=} cancelAnimationFrame + * @property {RequestIdleCallback=} requestIdleCallback + * @property {function(number): void=} cancelIdleCallback + */ + + /** @type {Timers} */ + const timers = { + setTimeout: _global.setTimeout, + clearTimeout: _global.clearTimeout, + setInterval: _global.setInterval, + clearInterval: _global.clearInterval, + Date: _global.Date, + }; + + if (isPresent.setImmediate) { + timers.setImmediate = _global.setImmediate; + } + + if (isPresent.clearImmediate) { + timers.clearImmediate = _global.clearImmediate; + } + + if (isPresent.hrtime) { + timers.hrtime = _global.process.hrtime; + } + + if (isPresent.nextTick) { + timers.nextTick = _global.process.nextTick; + } + + if (isPresent.performance) { + timers.performance = _global.performance; + } + + if (isPresent.requestAnimationFrame) { + timers.requestAnimationFrame = _global.requestAnimationFrame; + } + + if (isPresent.queueMicrotask) { + timers.queueMicrotask = _global.queueMicrotask; + } + + if (isPresent.cancelAnimationFrame) { + timers.cancelAnimationFrame = _global.cancelAnimationFrame; + } + + if (isPresent.requestIdleCallback) { + timers.requestIdleCallback = _global.requestIdleCallback; + } + + if (isPresent.cancelIdleCallback) { + timers.cancelIdleCallback = _global.cancelIdleCallback; + } + + if (isPresent.Intl) { + timers.Intl = _global.Intl; + } + + const originalSetTimeout = _global.setImmediate || _global.setTimeout; + + /** + * @param {Date|number} [start] the system time - non-integer values are floored + * @param {number} [loopLimit] maximum number of timers that will be run when calling runAll() + * @returns {Clock} + */ + function createClock(start, loopLimit) { + // eslint-disable-next-line no-param-reassign + start = Math.floor(getEpoch(start)); + // eslint-disable-next-line no-param-reassign + loopLimit = loopLimit || 1000; + let nanos = 0; + const adjustedSystemTime = [0, 0]; // [millis, nanoremainder] + + const clock = { + now: start, + Date: createDate(), + loopLimit: loopLimit, + }; + + clock.Date.clock = clock; + + //eslint-disable-next-line jsdoc/require-jsdoc + function getTimeToNextFrame() { + return 16 - ((clock.now - start) % 16); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function hrtime(prev) { + const millisSinceStart = clock.now - adjustedSystemTime[0] - start; + const secsSinceStart = Math.floor(millisSinceStart / 1000); + const remainderInNanos = + (millisSinceStart - secsSinceStart * 1e3) * 1e6 + + nanos - + adjustedSystemTime[1]; + + if (Array.isArray(prev)) { + if (prev[1] > 1e9) { + throw new TypeError( + "Number of nanoseconds can't exceed a billion", + ); + } + + const oldSecs = prev[0]; + let nanoDiff = remainderInNanos - prev[1]; + let secDiff = secsSinceStart - oldSecs; + + if (nanoDiff < 0) { + nanoDiff += 1e9; + secDiff -= 1; + } + + return [secDiff, nanoDiff]; + } + return [secsSinceStart, remainderInNanos]; + } + + /** + * A high resolution timestamp in milliseconds. + * + * @typedef {number} DOMHighResTimeStamp + */ + + /** + * performance.now() + * + * @returns {DOMHighResTimeStamp} + */ + function fakePerformanceNow() { + const hrt = hrtime(); + const millis = hrt[0] * 1000 + hrt[1] / 1e6; + return millis; + } + + if (isPresent.hrtimeBigint) { + hrtime.bigint = function () { + const parts = hrtime(); + return BigInt(parts[0]) * BigInt(1e9) + BigInt(parts[1]); // eslint-disable-line + }; + } + + if (isPresent.Intl) { + clock.Intl = createIntl(); + clock.Intl.clock = clock; + } + + clock.requestIdleCallback = function requestIdleCallback( + func, + timeout, + ) { + let timeToNextIdlePeriod = 0; + + if (clock.countTimers() > 0) { + timeToNextIdlePeriod = 50; // const for now + } + + const result = addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: + typeof timeout === "undefined" + ? timeToNextIdlePeriod + : Math.min(timeout, timeToNextIdlePeriod), + idleCallback: true, + }); + + return Number(result); + }; + + clock.cancelIdleCallback = function cancelIdleCallback(timerId) { + return clearTimer(clock, timerId, "IdleCallback"); + }; + + clock.setTimeout = function setTimeout(func, timeout) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + }); + }; + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setTimeout[utilPromisify.custom] = + function promisifiedSetTimeout(timeout, arg) { + return new _global.Promise(function setTimeoutExecutor( + resolve, + ) { + addTimer(clock, { + func: resolve, + args: [arg], + delay: timeout, + }); + }); + }; + } + + clock.clearTimeout = function clearTimeout(timerId) { + return clearTimer(clock, timerId, "Timeout"); + }; + + clock.nextTick = function nextTick(func) { + return enqueueJob(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + error: isNearInfiniteLimit ? new Error() : null, + }); + }; + + clock.queueMicrotask = function queueMicrotask(func) { + return clock.nextTick(func); // explicitly drop additional arguments + }; + + clock.setInterval = function setInterval(func, timeout) { + // eslint-disable-next-line no-param-reassign + timeout = parseInt(timeout, 10); + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + interval: timeout, + }); + }; + + clock.clearInterval = function clearInterval(timerId) { + return clearTimer(clock, timerId, "Interval"); + }; + + if (isPresent.setImmediate) { + clock.setImmediate = function setImmediate(func) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + immediate: true, + }); + }; + + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setImmediate[utilPromisify.custom] = + function promisifiedSetImmediate(arg) { + return new _global.Promise( + function setImmediateExecutor(resolve) { + addTimer(clock, { + func: resolve, + args: [arg], + immediate: true, + }); + }, + ); + }; + } + + clock.clearImmediate = function clearImmediate(timerId) { + return clearTimer(clock, timerId, "Immediate"); + }; + } + + clock.countTimers = function countTimers() { + return ( + Object.keys(clock.timers || {}).length + + (clock.jobs || []).length + ); + }; + + clock.requestAnimationFrame = function requestAnimationFrame(func) { + const result = addTimer(clock, { + func: func, + delay: getTimeToNextFrame(), + get args() { + return [fakePerformanceNow()]; + }, + animation: true, + }); + + return Number(result); + }; + + clock.cancelAnimationFrame = function cancelAnimationFrame(timerId) { + return clearTimer(clock, timerId, "AnimationFrame"); + }; + + clock.runMicrotasks = function runMicrotasks() { + runJobs(clock); + }; + + /** + * @param {number|string} tickValue milliseconds or a string parseable by parseTime + * @param {boolean} isAsync + * @param {Function} resolve + * @param {Function} reject + * @returns {number|undefined} will return the new `now` value or nothing for async + */ + function doTick(tickValue, isAsync, resolve, reject) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + const remainder = nanoRemainder(msFloat); + let nanosTotal = nanos + remainder; + let tickTo = clock.now + ms; + + if (msFloat < 0) { + throw new TypeError("Negative ticks are not supported"); + } + + // adjust for positive overflow + if (nanosTotal >= 1e6) { + tickTo += 1; + nanosTotal -= 1e6; + } + + nanos = nanosTotal; + let tickFrom = clock.now; + let previous = clock.now; + // ESLint fails to detect this correctly + /* eslint-disable prefer-const */ + let timer, + firstException, + oldNow, + nextPromiseTick, + compensationCheck, + postTimerCall; + /* eslint-enable prefer-const */ + + clock.duringTick = true; + + // perform microtasks + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during microtask callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function doTickInner() { + // perform each timer in the requested range + timer = firstTimerInRange(clock, tickFrom, tickTo); + // eslint-disable-next-line no-unmodified-loop-condition + while (timer && tickFrom <= tickTo) { + if (clock.timers[timer.id]) { + tickFrom = timer.callAt; + clock.now = timer.callAt; + oldNow = clock.now; + try { + runJobs(clock); + callTimer(clock, timer); + } catch (e) { + firstException = firstException || e; + } + + if (isAsync) { + // finish up after native setImmediate callback to allow + // all native es6 promises to process their callbacks after + // each timer fires. + originalSetTimeout(nextPromiseTick); + return; + } + + compensationCheck(); + } + + postTimerCall(); + } + + // perform process.nextTick()s again + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during process.nextTick() callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + clock.duringTick = false; + + // corner case: during runJobs new timers were scheduled which could be in the range [clock.now, tickTo] + timer = firstTimerInRange(clock, tickFrom, tickTo); + if (timer) { + try { + clock.tick(tickTo - clock.now); // do it all again - for the remainder of the requested range + } catch (e) { + firstException = firstException || e; + } + } else { + // no timers remaining in the requested range: move the clock all the way to the end + clock.now = tickTo; + + // update nanos + nanos = nanosTotal; + } + if (firstException) { + throw firstException; + } + + if (isAsync) { + resolve(clock.now); + } else { + return clock.now; + } + } + + nextPromiseTick = + isAsync && + function () { + try { + compensationCheck(); + postTimerCall(); + doTickInner(); + } catch (e) { + reject(e); + } + }; + + compensationCheck = function () { + // compensate for any setSystemTime() call during timer callback + if (oldNow !== clock.now) { + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + previous += clock.now - oldNow; + } + }; + + postTimerCall = function () { + timer = firstTimerInRange(clock, previous, tickTo); + previous = tickFrom; + }; + + return doTickInner(); + } + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.tick = function tick(tickValue) { + return doTick(tickValue, false); + }; + + if (typeof _global.Promise !== "undefined") { + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {Promise} + */ + clock.tickAsync = function tickAsync(tickValue) { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + doTick(tickValue, true, resolve, reject); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.next = function next() { + runJobs(clock); + const timer = firstTimer(clock); + if (!timer) { + return clock.now; + } + + clock.duringTick = true; + try { + clock.now = timer.callAt; + callTimer(clock, timer); + runJobs(clock); + return clock.now; + } finally { + clock.duringTick = false; + } + }; + + if (typeof _global.Promise !== "undefined") { + clock.nextAsync = function nextAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = firstTimer(clock); + if (!timer) { + resolve(clock.now); + return; + } + + let err; + clock.duringTick = true; + clock.now = timer.callAt; + try { + callTimer(clock, timer); + } catch (e) { + err = e; + } + clock.duringTick = false; + + originalSetTimeout(function () { + if (err) { + reject(err); + } else { + resolve(clock.now); + } + }); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.runAll = function runAll() { + let numTimers, i; + runJobs(clock); + for (i = 0; i < clock.loopLimit; i++) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + numTimers = Object.keys(clock.timers).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + clock.next(); + checkIsNearInfiniteLimit(clock, i); + } + + const excessJob = firstTimer(clock); + throw getInfiniteLoopError(clock, excessJob); + }; + + clock.runToFrame = function runToFrame() { + return clock.tick(getTimeToNextFrame()); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runAllAsync = function runAllAsync() { + return new _global.Promise(function (resolve, reject) { + let i = 0; + /** + * + */ + function doRun() { + originalSetTimeout(function () { + try { + runJobs(clock); + + let numTimers; + if (i < clock.loopLimit) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + numTimers = Object.keys( + clock.timers, + ).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + clock.next(); + + i++; + + doRun(); + checkIsNearInfiniteLimit(clock, i); + return; + } + + const excessJob = firstTimer(clock); + reject(getInfiniteLoopError(clock, excessJob)); + } catch (e) { + reject(e); + } + }); + } + doRun(); + }); + }; + } + + clock.runToLast = function runToLast() { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + return clock.now; + } + + return clock.tick(timer.callAt - clock.now); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runToLastAsync = function runToLastAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + resolve(clock.now); + } + + resolve(clock.tickAsync(timer.callAt - clock.now)); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.reset = function reset() { + nanos = 0; + clock.timers = {}; + clock.jobs = []; + clock.now = start; + }; + + clock.setSystemTime = function setSystemTime(systemTime) { + // determine time difference + const newNow = getEpoch(systemTime); + const difference = newNow - clock.now; + let id, timer; + + adjustedSystemTime[0] = adjustedSystemTime[0] + difference; + adjustedSystemTime[1] = adjustedSystemTime[1] + nanos; + // update 'system clock' + clock.now = newNow; + nanos = 0; + + // update timers and intervals to keep them stable + for (id in clock.timers) { + if (clock.timers.hasOwnProperty(id)) { + timer = clock.timers[id]; + timer.createdAt += difference; + timer.callAt += difference; + } + } + }; + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.jump = function jump(tickValue) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + + for (const timer of Object.values(clock.timers)) { + if (clock.now + ms > timer.callAt) { + timer.callAt = clock.now + ms; + } + } + clock.tick(ms); + }; + + if (isPresent.performance) { + clock.performance = Object.create(null); + clock.performance.now = fakePerformanceNow; + } + + if (isPresent.hrtime) { + clock.hrtime = hrtime; + } + + return clock; + } + + /* eslint-disable complexity */ + + /** + * @param {Config=} [config] Optional config + * @returns {Clock} + */ + function install(config) { + if ( + arguments.length > 1 || + config instanceof Date || + Array.isArray(config) || + typeof config === "number" + ) { + throw new TypeError( + `FakeTimers.install called with ${String( + config, + )} install requires an object parameter`, + ); + } + + if (_global.Date.isFake === true) { + // Timers are already faked; this is a problem. + // Make the user reset timers before continuing. + throw new TypeError( + "Can't install fake timers twice on the same global object.", + ); + } + + // eslint-disable-next-line no-param-reassign + config = typeof config !== "undefined" ? config : {}; + config.shouldAdvanceTime = config.shouldAdvanceTime || false; + config.advanceTimeDelta = config.advanceTimeDelta || 20; + config.shouldClearNativeTimers = + config.shouldClearNativeTimers || false; + + if (config.target) { + throw new TypeError( + "config.target is no longer supported. Use `withGlobal(target)` instead.", + ); + } + + /** + * @param {string} timer/object the name of the thing that is not present + * @param timer + */ + function handleMissingTimer(timer) { + if (config.ignoreMissingTimers) { + return; + } + + throw new ReferenceError( + `non-existent timers and/or objects cannot be faked: '${timer}'`, + ); + } + + let i, l; + const clock = createClock(config.now, config.loopLimit); + clock.shouldClearNativeTimers = config.shouldClearNativeTimers; + + clock.uninstall = function () { + return uninstall(clock, config); + }; + + clock.abortListenerMap = new Map(); + + clock.methods = config.toFake || []; + + if (clock.methods.length === 0) { + clock.methods = Object.keys(timers); + } + + if (config.shouldAdvanceTime === true) { + const intervalTick = doIntervalTick.bind( + null, + clock, + config.advanceTimeDelta, + ); + const intervalId = _global.setInterval( + intervalTick, + config.advanceTimeDelta, + ); + clock.attachedInterval = intervalId; + } + + if (clock.methods.includes("performance")) { + const proto = (() => { + if (hasPerformanceConstructorPrototype) { + return _global.performance.constructor.prototype; + } + if (hasPerformancePrototype) { + return _global.Performance.prototype; + } + })(); + if (proto) { + Object.getOwnPropertyNames(proto).forEach(function (name) { + if (name !== "now") { + clock.performance[name] = + name.indexOf("getEntries") === 0 + ? NOOP_ARRAY + : NOOP; + } + }); + // ensure `mark` returns a value that is valid + clock.performance.mark = (name) => + new FakePerformanceEntry(name, "mark", 0, 0); + clock.performance.measure = (name) => + new FakePerformanceEntry(name, "measure", 0, 100); + } else if ((config.toFake || []).includes("performance")) { + return handleMissingTimer("performance"); + } + } + if (_global === globalObject && timersModule) { + clock.timersModuleMethods = []; + } + if (_global === globalObject && timersPromisesModule) { + clock.timersPromisesModuleMethods = []; + } + for (i = 0, l = clock.methods.length; i < l; i++) { + const nameOfMethodToReplace = clock.methods[i]; + + if (!isPresent[nameOfMethodToReplace]) { + handleMissingTimer(nameOfMethodToReplace); + // eslint-disable-next-line + continue; + } + + if (nameOfMethodToReplace === "hrtime") { + if ( + _global.process && + typeof _global.process.hrtime === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else if (nameOfMethodToReplace === "nextTick") { + if ( + _global.process && + typeof _global.process.nextTick === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else { + hijackMethod(_global, nameOfMethodToReplace, clock); + } + if ( + clock.timersModuleMethods !== undefined && + timersModule[nameOfMethodToReplace] + ) { + const original = timersModule[nameOfMethodToReplace]; + clock.timersModuleMethods.push({ + methodName: nameOfMethodToReplace, + original: original, + }); + timersModule[nameOfMethodToReplace] = + _global[nameOfMethodToReplace]; + } + if (clock.timersPromisesModuleMethods !== undefined) { + if (nameOfMethodToReplace === "setTimeout") { + clock.timersPromisesModuleMethods.push({ + methodName: "setTimeout", + original: timersPromisesModule.setTimeout, + }); + + timersPromisesModule.setTimeout = ( + delay, + value, + options = {}, + ) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearTimeout(handle); + reject(options.signal.reason); + }; + + const handle = clock.setTimeout(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }, delay); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setImmediate") { + clock.timersPromisesModuleMethods.push({ + methodName: "setImmediate", + original: timersPromisesModule.setImmediate, + }); + + timersPromisesModule.setImmediate = (value, options = {}) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearImmediate(handle); + reject(options.signal.reason); + }; + + const handle = clock.setImmediate(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setInterval") { + clock.timersPromisesModuleMethods.push({ + methodName: "setInterval", + original: timersPromisesModule.setInterval, + }); + + timersPromisesModule.setInterval = ( + delay, + value, + options = {}, + ) => ({ + [Symbol.asyncIterator]: () => { + const createResolvable = () => { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + promise.resolve = resolve; + promise.reject = reject; + return promise; + }; + + let done = false; + let hasThrown = false; + let returnCall; + let nextAvailable = 0; + const nextQueue = []; + + const handle = clock.setInterval(() => { + if (nextQueue.length > 0) { + nextQueue.shift().resolve(); + } else { + nextAvailable++; + } + }, delay); + + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + clock.clearInterval(handle); + done = true; + for (const resolvable of nextQueue) { + resolvable.resolve(); + } + }; + + if (options.signal) { + if (options.signal.aborted) { + done = true; + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + + return { + next: async () => { + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + if (nextAvailable > 0) { + nextAvailable--; + return { done: false, value: value }; + } + + const resolvable = createResolvable(); + nextQueue.push(resolvable); + + await resolvable; + + if (returnCall && nextQueue.length === 0) { + returnCall.resolve(); + } + + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + return { done: false, value: value }; + }, + return: async () => { + if (done) { + return { done: true, value: undefined }; + } + + if (nextQueue.length > 0) { + returnCall = createResolvable(); + await returnCall; + } + + clock.clearInterval(handle); + done = true; + + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + return { done: true, value: undefined }; + }, + }; + }, + }); + } + } + } + + return clock; + } + + /* eslint-enable complexity */ + + return { + timers: timers, + createClock: createClock, + install: install, + withGlobal: withGlobal, + }; +} + +/** + * @typedef {object} FakeTimers + * @property {Timers} timers + * @property {createClock} createClock + * @property {Function} install + * @property {withGlobal} withGlobal + */ + +/* eslint-enable complexity */ + +/** @type {FakeTimers} */ +const defaultImplementation = withGlobal(globalObject); + +exports.timers = defaultImplementation.timers; +exports.createClock = defaultImplementation.createClock; +exports.install = defaultImplementation.install; +exports.withGlobal = withGlobal; + +},{"@sinonjs/commons":47,"timers":undefined,"timers/promises":undefined,"util":91}],61:[function(require,module,exports){ +"use strict"; + +var ARRAY_TYPES = [ + Array, + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, +]; + +module.exports = ARRAY_TYPES; + +},{}],62:[function(require,module,exports){ +"use strict"; + +var arrayProto = require("@sinonjs/commons").prototypes.array; +var deepEqual = require("./deep-equal").use(createMatcher); // eslint-disable-line no-use-before-define +var every = require("@sinonjs/commons").every; +var functionName = require("@sinonjs/commons").functionName; +var get = require("lodash.get"); +var iterableToString = require("./iterable-to-string"); +var objectProto = require("@sinonjs/commons").prototypes.object; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var assertMatcher = require("./create-matcher/assert-matcher"); +var assertMethodExists = require("./create-matcher/assert-method-exists"); +var assertType = require("./create-matcher/assert-type"); +var isIterable = require("./create-matcher/is-iterable"); +var isMatcher = require("./create-matcher/is-matcher"); + +var matcherPrototype = require("./create-matcher/matcher-prototype"); + +var arrayIndexOf = arrayProto.indexOf; +var some = arrayProto.some; + +var hasOwnProperty = objectProto.hasOwnProperty; +var objectToString = objectProto.toString; + +var TYPE_MAP = require("./create-matcher/type-map")(createMatcher); // eslint-disable-line no-use-before-define + +/** + * Creates a matcher object for the passed expectation + * + * @alias module:samsam.createMatcher + * @param {*} expectation An expecttation + * @param {string} message A message for the expectation + * @returns {object} A matcher object + */ +function createMatcher(expectation, message) { + var m = Object.create(matcherPrototype); + var type = typeOf(expectation); + + if (message !== undefined && typeof message !== "string") { + throw new TypeError("Message should be a string"); + } + + if (arguments.length > 2) { + throw new TypeError( + `Expected 1 or 2 arguments, received ${arguments.length}`, + ); + } + + if (type in TYPE_MAP) { + TYPE_MAP[type](m, expectation, message); + } else { + m.test = function (actual) { + return deepEqual(actual, expectation); + }; + } + + if (!m.message) { + m.message = `match(${valueToString(expectation)})`; + } + + // ensure that nothing mutates the exported message value, ref https://github.com/sinonjs/sinon/issues/2502 + Object.defineProperty(m, "message", { + configurable: false, + writable: false, + value: m.message, + }); + + return m; +} + +createMatcher.isMatcher = isMatcher; + +createMatcher.any = createMatcher(function () { + return true; +}, "any"); + +createMatcher.defined = createMatcher(function (actual) { + return actual !== null && actual !== undefined; +}, "defined"); + +createMatcher.truthy = createMatcher(function (actual) { + return Boolean(actual); +}, "truthy"); + +createMatcher.falsy = createMatcher(function (actual) { + return !actual; +}, "falsy"); + +createMatcher.same = function (expectation) { + return createMatcher( + function (actual) { + return expectation === actual; + }, + `same(${valueToString(expectation)})`, + ); +}; + +createMatcher.in = function (arrayOfExpectations) { + if (typeOf(arrayOfExpectations) !== "array") { + throw new TypeError("array expected"); + } + + return createMatcher( + function (actual) { + return some(arrayOfExpectations, function (expectation) { + return expectation === actual; + }); + }, + `in(${valueToString(arrayOfExpectations)})`, + ); +}; + +createMatcher.typeOf = function (type) { + assertType(type, "string", "type"); + return createMatcher(function (actual) { + return typeOf(actual) === type; + }, `typeOf("${type}")`); +}; + +createMatcher.instanceOf = function (type) { + /* istanbul ignore if */ + if ( + typeof Symbol === "undefined" || + typeof Symbol.hasInstance === "undefined" + ) { + assertType(type, "function", "type"); + } else { + assertMethodExists( + type, + Symbol.hasInstance, + "type", + "[Symbol.hasInstance]", + ); + } + return createMatcher( + function (actual) { + return actual instanceof type; + }, + `instanceOf(${functionName(type) || objectToString(type)})`, + ); +}; + +/** + * Creates a property matcher + * + * @private + * @param {Function} propertyTest A function to test the property against a value + * @param {string} messagePrefix A prefix to use for messages generated by the matcher + * @returns {object} A matcher + */ +function createPropertyMatcher(propertyTest, messagePrefix) { + return function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `${messagePrefix}("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + if ( + actual === undefined || + actual === null || + !propertyTest(actual, property) + ) { + return false; + } + return onlyProperty || deepEqual(actual[property], value); + }, message); + }; +} + +createMatcher.has = createPropertyMatcher(function (actual, property) { + if (typeof actual === "object") { + return property in actual; + } + return actual[property] !== undefined; +}, "has"); + +createMatcher.hasOwn = createPropertyMatcher(function (actual, property) { + return hasOwnProperty(actual, property); +}, "hasOwn"); + +createMatcher.hasNested = function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `hasNested("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + if ( + actual === undefined || + actual === null || + get(actual, property) === undefined + ) { + return false; + } + return onlyProperty || deepEqual(get(actual, property), value); + }, message); +}; + +var jsonParseResultTypes = { + null: true, + boolean: true, + number: true, + string: true, + object: true, + array: true, +}; +createMatcher.json = function (value) { + if (!jsonParseResultTypes[typeOf(value)]) { + throw new TypeError("Value cannot be the result of JSON.parse"); + } + var message = `json(${JSON.stringify(value, null, " ")})`; + return createMatcher(function (actual) { + var parsed; + try { + parsed = JSON.parse(actual); + } catch (e) { + return false; + } + return deepEqual(parsed, value); + }, message); +}; + +createMatcher.every = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return every(Object.keys(actual), function (key) { + return predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + every(actual, function (element) { + return predicate.test(element); + }) + ); + }, `every(${predicate.message})`); +}; + +createMatcher.some = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return !every(Object.keys(actual), function (key) { + return !predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + !every(actual, function (element) { + return !predicate.test(element); + }) + ); + }, `some(${predicate.message})`); +}; + +createMatcher.array = createMatcher.typeOf("array"); + +createMatcher.array.deepEquals = function (expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.length === expectation.length; + return ( + typeOf(actual) === "array" && + sameLength && + every(actual, function (element, index) { + var expected = expectation[index]; + return typeOf(expected) === "array" && + typeOf(element) === "array" + ? createMatcher.array.deepEquals(expected).test(element) + : deepEqual(expected, element); + }) + ); + }, + `deepEquals([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.startsWith = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[index] === expectedElement; + }) + ); + }, + `startsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.endsWith = function (expectation) { + return createMatcher( + function (actual) { + // This indicates the index in which we should start matching + var offset = actual.length - expectation.length; + + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[offset + index] === expectedElement; + }) + ); + }, + `endsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.contains = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement) { + return arrayIndexOf(actual, expectedElement) !== -1; + }) + ); + }, + `contains([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map = createMatcher.typeOf("map"); + +createMatcher.map.deepEquals = function mapDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "map" && + sameLength && + every(actual, function (element, key) { + return ( + expectation.has(key) && expectation.get(key) === element + ); + }) + ); + }, + `deepEquals(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map.contains = function mapContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "map" && + every(expectation, function (element, key) { + return actual.has(key) && actual.get(key) === element; + }) + ); + }, + `contains(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set = createMatcher.typeOf("set"); + +createMatcher.set.deepEquals = function setDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "set" && + sameLength && + every(actual, function (element) { + return expectation.has(element); + }) + ); + }, + `deepEquals(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set.contains = function setContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "set" && + every(expectation, function (element) { + return actual.has(element); + }) + ); + }, + `contains(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.bool = createMatcher.typeOf("boolean"); +createMatcher.number = createMatcher.typeOf("number"); +createMatcher.string = createMatcher.typeOf("string"); +createMatcher.object = createMatcher.typeOf("object"); +createMatcher.func = createMatcher.typeOf("function"); +createMatcher.regexp = createMatcher.typeOf("regexp"); +createMatcher.date = createMatcher.typeOf("date"); +createMatcher.symbol = createMatcher.typeOf("symbol"); + +module.exports = createMatcher; + +},{"./create-matcher/assert-matcher":63,"./create-matcher/assert-method-exists":64,"./create-matcher/assert-type":65,"./create-matcher/is-iterable":66,"./create-matcher/is-matcher":67,"./create-matcher/matcher-prototype":69,"./create-matcher/type-map":70,"./deep-equal":71,"./iterable-to-string":85,"@sinonjs/commons":47,"lodash.get":93}],63:[function(require,module,exports){ +"use strict"; + +var isMatcher = require("./is-matcher"); + +/** + * Throws a TypeError when `value` is not a matcher + * + * @private + * @param {*} value The value to examine + */ +function assertMatcher(value) { + if (!isMatcher(value)) { + throw new TypeError("Matcher expected"); + } +} + +module.exports = assertMatcher; + +},{"./is-matcher":67}],64:[function(require,module,exports){ +"use strict"; + +/** + * Throws a TypeError when expected method doesn't exist + * + * @private + * @param {*} value A value to examine + * @param {string} method The name of the method to look for + * @param {name} name A name to use for the error message + * @param {string} methodPath The name of the method to use for error messages + * @throws {TypeError} When the method doesn't exist + */ +function assertMethodExists(value, method, name, methodPath) { + if (value[method] === null || value[method] === undefined) { + throw new TypeError(`Expected ${name} to have method ${methodPath}`); + } +} + +module.exports = assertMethodExists; + +},{}],65:[function(require,module,exports){ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Ensures that value is of type + * + * @private + * @param {*} value A value to examine + * @param {string} type A basic JavaScript type to compare to, e.g. "object", "string" + * @param {string} name A string to use for the error message + * @throws {TypeError} If value is not of the expected type + * @returns {undefined} + */ +function assertType(value, type, name) { + var actual = typeOf(value); + if (actual !== type) { + throw new TypeError( + `Expected type of ${name} to be ${type}, but was ${actual}`, + ); + } +} + +module.exports = assertType; + +},{"@sinonjs/commons":47}],66:[function(require,module,exports){ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Returns `true` for iterables + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` looks like an iterable + */ +function isIterable(value) { + return Boolean(value) && typeOf(value.forEach) === "function"; +} + +module.exports = isIterable; + +},{"@sinonjs/commons":47}],67:[function(require,module,exports){ +"use strict"; + +var isPrototypeOf = require("@sinonjs/commons").prototypes.object.isPrototypeOf; + +var matcherPrototype = require("./matcher-prototype"); + +/** + * Returns `true` when `object` is a matcher + * + * @private + * @param {*} object A value to examine + * @returns {boolean} Returns `true` when `object` is a matcher + */ +function isMatcher(object) { + return isPrototypeOf(matcherPrototype, object); +} + +module.exports = isMatcher; + +},{"./matcher-prototype":69,"@sinonjs/commons":47}],68:[function(require,module,exports){ +"use strict"; + +var every = require("@sinonjs/commons").prototypes.array.every; +var concat = require("@sinonjs/commons").prototypes.array.concat; +var typeOf = require("@sinonjs/commons").typeOf; + +var deepEqualFactory = require("../deep-equal").use; + +var identical = require("../identical"); +var isMatcher = require("./is-matcher"); + +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Matches `actual` with `expectation` + * + * @private + * @param {*} actual A value to examine + * @param {object} expectation An object with properties to match on + * @param {object} matcher A matcher to use for comparison + * @returns {boolean} Returns true when `actual` matches all properties in `expectation` + */ +function matchObject(actual, expectation, matcher) { + var deepEqual = deepEqualFactory(matcher); + if (actual === null || actual === undefined) { + return false; + } + + var expectedKeys = keys(expectation); + /* istanbul ignore else: cannot collect coverage for engine that doesn't support Symbol */ + if (typeOf(getOwnPropertySymbols) === "function") { + expectedKeys = concat(expectedKeys, getOwnPropertySymbols(expectation)); + } + + return every(expectedKeys, function (key) { + var exp = expectation[key]; + var act = actual[key]; + + if (isMatcher(exp)) { + if (!exp.test(act)) { + return false; + } + } else if (typeOf(exp) === "object") { + if (identical(exp, act)) { + return true; + } + if (!matchObject(act, exp, matcher)) { + return false; + } + } else if (!deepEqual(act, exp)) { + return false; + } + + return true; + }); +} + +module.exports = matchObject; + +},{"../deep-equal":71,"../identical":73,"./is-matcher":67,"@sinonjs/commons":47}],69:[function(require,module,exports){ +"use strict"; + +var matcherPrototype = { + toString: function () { + return this.message; + }, +}; + +matcherPrototype.or = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var or = Object.create(matcherPrototype); + or.test = function (actual) { + return m1.test(actual) || m2.test(actual); + }; + or.message = `${m1.message}.or(${m2.message})`; + return or; +}; + +matcherPrototype.and = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var and = Object.create(matcherPrototype); + and.test = function (actual) { + return m1.test(actual) && m2.test(actual); + }; + and.message = `${m1.message}.and(${m2.message})`; + return and; +}; + +module.exports = matcherPrototype; + +},{"../create-matcher":62}],70:[function(require,module,exports){ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var join = require("@sinonjs/commons").prototypes.array.join; +var map = require("@sinonjs/commons").prototypes.array.map; +var stringIndexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var matchObject = require("./match-object"); + +var createTypeMap = function (match) { + return { + function: function (m, expectation, message) { + m.test = expectation; + m.message = message || `match(${functionName(expectation)})`; + }, + number: function (m, expectation) { + m.test = function (actual) { + // we need type coercion here + return expectation == actual; // eslint-disable-line eqeqeq + }; + }, + object: function (m, expectation) { + var array = []; + + if (typeof expectation.test === "function") { + m.test = function (actual) { + return expectation.test(actual) === true; + }; + m.message = `match(${functionName(expectation.test)})`; + return m; + } + + array = map(Object.keys(expectation), function (key) { + return `${key}: ${valueToString(expectation[key])}`; + }); + + m.test = function (actual) { + return matchObject(actual, expectation, match); + }; + m.message = `match(${join(array, ", ")})`; + + return m; + }, + regexp: function (m, expectation) { + m.test = function (actual) { + return typeof actual === "string" && expectation.test(actual); + }; + }, + string: function (m, expectation) { + m.test = function (actual) { + return ( + typeof actual === "string" && + stringIndexOf(actual, expectation) !== -1 + ); + }; + m.message = `match("${expectation}")`; + }, + }; +}; + +module.exports = createTypeMap; + +},{"./match-object":68,"@sinonjs/commons":47}],71:[function(require,module,exports){ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var className = require("@sinonjs/commons").className; +var typeOf = require("@sinonjs/commons").typeOf; +var arrayProto = require("@sinonjs/commons").prototypes.array; +var objectProto = require("@sinonjs/commons").prototypes.object; +var mapForEach = require("@sinonjs/commons").prototypes.map.forEach; + +var getClass = require("./get-class"); +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isArrayType = require("./is-array-type"); +var isDate = require("./is-date"); +var isElement = require("./is-element"); +var isIterable = require("./is-iterable"); +var isMap = require("./is-map"); +var isNaN = require("./is-nan"); +var isObject = require("./is-object"); +var isSet = require("./is-set"); +var isSubset = require("./is-subset"); + +var concat = arrayProto.concat; +var every = arrayProto.every; +var push = arrayProto.push; + +var getTime = Date.prototype.getTime; +var hasOwnProperty = objectProto.hasOwnProperty; +var indexOf = arrayProto.indexOf; +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Deep equal comparison. Two values are "deep equal" when: + * + * - They are equal, according to samsam.identical + * - They are both date objects representing the same time + * - They are both arrays containing elements that are all deepEqual + * - They are objects with the same set of properties, and each property + * in ``actual`` is deepEqual to the corresponding property in ``expectation`` + * + * Supports cyclic objects. + * + * @alias module:samsam.deepEqual + * @param {*} actual The object to examine + * @param {*} expectation The object actual is expected to be equal to + * @param {object} match A value to match on + * @returns {boolean} Returns true when actual and expectation are considered equal + */ +function deepEqualCyclic(actual, expectation, match) { + // used for cyclic comparison + // contain already visited objects + var actualObjects = []; + var expectationObjects = []; + // contain pathes (position in the object structure) + // of the already visited objects + // indexes same as in objects arrays + var actualPaths = []; + var expectationPaths = []; + // contains combinations of already compared objects + // in the manner: { "$1['ref']$2['ref']": true } + var compared = {}; + + // does the recursion for the deep equal check + // eslint-disable-next-line complexity + return (function deepEqual( + actualObj, + expectationObj, + actualPath, + expectationPath, + ) { + // If both are matchers they must be the same instance in order to be + // considered equal If we didn't do that we would end up running one + // matcher against the other + if (match && match.isMatcher(expectationObj)) { + if (match.isMatcher(actualObj)) { + return actualObj === expectationObj; + } + return expectationObj.test(actualObj); + } + + var actualType = typeof actualObj; + var expectationType = typeof expectationObj; + + if ( + actualObj === expectationObj || + isNaN(actualObj) || + isNaN(expectationObj) || + actualObj === null || + expectationObj === null || + actualObj === undefined || + expectationObj === undefined || + actualType !== "object" || + expectationType !== "object" + ) { + return identical(actualObj, expectationObj); + } + + // Elements are only equal if identical(expected, actual) + if (isElement(actualObj) || isElement(expectationObj)) { + return false; + } + + var isActualDate = isDate(actualObj); + var isExpectationDate = isDate(expectationObj); + if (isActualDate || isExpectationDate) { + if ( + !isActualDate || + !isExpectationDate || + getTime.call(actualObj) !== getTime.call(expectationObj) + ) { + return false; + } + } + + if (actualObj instanceof RegExp && expectationObj instanceof RegExp) { + if (valueToString(actualObj) !== valueToString(expectationObj)) { + return false; + } + } + + if (actualObj instanceof Promise && expectationObj instanceof Promise) { + return actualObj === expectationObj; + } + + if (actualObj instanceof Error && expectationObj instanceof Error) { + return actualObj === expectationObj; + } + + var actualClass = getClass(actualObj); + var expectationClass = getClass(expectationObj); + var actualKeys = keys(actualObj); + var expectationKeys = keys(expectationObj); + var actualName = className(actualObj); + var expectationName = className(expectationObj); + var expectationSymbols = + typeOf(getOwnPropertySymbols) === "function" + ? getOwnPropertySymbols(expectationObj) + : /* istanbul ignore next: cannot collect coverage for engine that doesn't support Symbol */ + []; + var expectationKeysAndSymbols = concat( + expectationKeys, + expectationSymbols, + ); + + if (isArguments(actualObj) || isArguments(expectationObj)) { + if (actualObj.length !== expectationObj.length) { + return false; + } + } else { + if ( + actualType !== expectationType || + actualClass !== expectationClass || + actualKeys.length !== expectationKeys.length || + (actualName && + expectationName && + actualName !== expectationName) + ) { + return false; + } + } + + if (isSet(actualObj) || isSet(expectationObj)) { + if ( + !isSet(actualObj) || + !isSet(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + return isSubset(actualObj, expectationObj, deepEqual); + } + + if (isMap(actualObj) || isMap(expectationObj)) { + if ( + !isMap(actualObj) || + !isMap(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + var mapsDeeplyEqual = true; + mapForEach(actualObj, function (value, key) { + mapsDeeplyEqual = + mapsDeeplyEqual && + deepEqualCyclic(value, expectationObj.get(key)); + }); + + return mapsDeeplyEqual; + } + + // jQuery objects have iteration protocols + // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + // But, they don't work well with the implementation concerning iterables below, + // so we will detect them and use jQuery's own equality function + /* istanbul ignore next -- this can only be tested in the `test-headless` script */ + if ( + actualObj.constructor && + actualObj.constructor.name === "jQuery" && + typeof actualObj.is === "function" + ) { + return actualObj.is(expectationObj); + } + + var isActualNonArrayIterable = + isIterable(actualObj) && + !isArrayType(actualObj) && + !isArguments(actualObj); + var isExpectationNonArrayIterable = + isIterable(expectationObj) && + !isArrayType(expectationObj) && + !isArguments(expectationObj); + if (isActualNonArrayIterable || isExpectationNonArrayIterable) { + var actualArray = Array.from(actualObj); + var expectationArray = Array.from(expectationObj); + if (actualArray.length !== expectationArray.length) { + return false; + } + + var arrayDeeplyEquals = true; + every(actualArray, function (key) { + arrayDeeplyEquals = + arrayDeeplyEquals && + deepEqualCyclic(actualArray[key], expectationArray[key]); + }); + + return arrayDeeplyEquals; + } + + return every(expectationKeysAndSymbols, function (key) { + if (!hasOwnProperty(actualObj, key)) { + return false; + } + + var actualValue = actualObj[key]; + var expectationValue = expectationObj[key]; + var actualObject = isObject(actualValue); + var expectationObject = isObject(expectationValue); + // determines, if the objects were already visited + // (it's faster to check for isObject first, than to + // get -1 from getIndex for non objects) + var actualIndex = actualObject + ? indexOf(actualObjects, actualValue) + : -1; + var expectationIndex = expectationObject + ? indexOf(expectationObjects, expectationValue) + : -1; + // determines the new paths of the objects + // - for non cyclic objects the current path will be extended + // by current property name + // - for cyclic objects the stored path is taken + var newActualPath = + actualIndex !== -1 + ? actualPaths[actualIndex] + : `${actualPath}[${JSON.stringify(key)}]`; + var newExpectationPath = + expectationIndex !== -1 + ? expectationPaths[expectationIndex] + : `${expectationPath}[${JSON.stringify(key)}]`; + var combinedPath = newActualPath + newExpectationPath; + + // stop recursion if current objects are already compared + if (compared[combinedPath]) { + return true; + } + + // remember the current objects and their paths + if (actualIndex === -1 && actualObject) { + push(actualObjects, actualValue); + push(actualPaths, newActualPath); + } + if (expectationIndex === -1 && expectationObject) { + push(expectationObjects, expectationValue); + push(expectationPaths, newExpectationPath); + } + + // remember that the current objects are already compared + if (actualObject && expectationObject) { + compared[combinedPath] = true; + } + + // End of cyclic logic + + // neither actualValue nor expectationValue is a cycle + // continue with next level + return deepEqual( + actualValue, + expectationValue, + newActualPath, + newExpectationPath, + ); + }); + })(actual, expectation, "$1", "$2"); +} + +deepEqualCyclic.use = function (match) { + return function deepEqual(a, b) { + return deepEqualCyclic(a, b, match); + }; +}; + +module.exports = deepEqualCyclic; + +},{"./get-class":72,"./identical":73,"./is-arguments":74,"./is-array-type":75,"./is-date":76,"./is-element":77,"./is-iterable":78,"./is-map":79,"./is-nan":80,"./is-object":82,"./is-set":83,"./is-subset":84,"@sinonjs/commons":47}],72:[function(require,module,exports){ +"use strict"; + +var toString = require("@sinonjs/commons").prototypes.object.toString; + +/** + * Returns the internal `Class` by calling `Object.prototype.toString` + * with the provided value as `this`. Return value is a `String`, naming the + * internal class, e.g. "Array" + * + * @private + * @param {*} value - Any value + * @returns {string} - A string representation of the `Class` of `value` + */ +function getClass(value) { + return toString(value).split(/[ \]]/)[1]; +} + +module.exports = getClass; + +},{"@sinonjs/commons":47}],73:[function(require,module,exports){ +"use strict"; + +var isNaN = require("./is-nan"); +var isNegZero = require("./is-neg-zero"); + +/** + * Strict equality check according to EcmaScript Harmony's `egal`. + * + * **From the Harmony wiki:** + * > An `egal` function simply makes available the internal `SameValue` function + * > from section 9.12 of the ES5 spec. If two values are egal, then they are not + * > observably distinguishable. + * + * `identical` returns `true` when `===` is `true`, except for `-0` and + * `+0`, where it returns `false`. Additionally, it returns `true` when + * `NaN` is compared to itself. + * + * @alias module:samsam.identical + * @param {*} obj1 The first value to compare + * @param {*} obj2 The second value to compare + * @returns {boolean} Returns `true` when the objects are *egal*, `false` otherwise + */ +function identical(obj1, obj2) { + if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) { + return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2); + } + + return false; +} + +module.exports = identical; + +},{"./is-nan":80,"./is-neg-zero":81}],74:[function(require,module,exports){ +"use strict"; + +var getClass = require("./get-class"); + +/** + * Returns `true` when `object` is an `arguments` object, `false` otherwise + * + * @alias module:samsam.isArguments + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an `arguments` object + */ +function isArguments(object) { + return getClass(object) === "Arguments"; +} + +module.exports = isArguments; + +},{"./get-class":72}],75:[function(require,module,exports){ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var indexOf = require("@sinonjs/commons").prototypes.array.indexOf; +var map = require("@sinonjs/commons").prototypes.array.map; +var ARRAY_TYPES = require("./array-types"); +var type = require("type-detect"); + +/** + * Returns `true` when `object` is an array type, `false` otherwise + * + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an array type + * @private + */ +function isArrayType(object) { + return indexOf(map(ARRAY_TYPES, functionName), type(object)) !== -1; +} + +module.exports = isArrayType; + +},{"./array-types":61,"@sinonjs/commons":47,"type-detect":88}],76:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is an instance of Date + * + * @private + * @param {Date} value The value to examine + * @returns {boolean} `true` when `value` is an instance of Date + */ +function isDate(value) { + return value instanceof Date; +} + +module.exports = isDate; + +},{}],77:[function(require,module,exports){ +"use strict"; + +var div = typeof document !== "undefined" && document.createElement("div"); + +/** + * Returns `true` when `object` is a DOM element node. + * + * Unlike Underscore.js/lodash, this function will return `false` if `object` + * is an *element-like* object, i.e. a regular object with a `nodeType` + * property that holds the value `1`. + * + * @alias module:samsam.isElement + * @param {object} object The object to examine + * @returns {boolean} Returns `true` for DOM element nodes + */ +function isElement(object) { + if (!object || object.nodeType !== 1 || !div) { + return false; + } + try { + object.appendChild(div); + object.removeChild(div); + } catch (e) { + return false; + } + return true; +} + +module.exports = isElement; + +},{}],78:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the argument is an iterable, `false` otherwise + * + * @alias module:samsam.isIterable + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an iterable, `false` otherwise + */ +function isIterable(val) { + // checks for null and undefined + if (typeof val !== "object") { + return false; + } + return typeof val[Symbol.iterator] === "function"; +} + +module.exports = isIterable; + +},{}],79:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is a Map + * + * @param {*} value A value to examine + * @returns {boolean} `true` when `value` is an instance of `Map`, `false` otherwise + * @private + */ +function isMap(value) { + return typeof Map !== "undefined" && value instanceof Map; +} + +module.exports = isMap; + +},{}],80:[function(require,module,exports){ +"use strict"; + +/** + * Compares a `value` to `NaN` + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `NaN` + */ +function isNaN(value) { + // Unlike global `isNaN`, this function avoids type coercion + // `typeof` check avoids IE host object issues, hat tip to + // lodash + + // eslint-disable-next-line no-self-compare + return typeof value === "number" && value !== value; +} + +module.exports = isNaN; + +},{}],81:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is `-0` + * + * @alias module:samsam.isNegZero + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `-0` + */ +function isNegZero(value) { + return value === 0 && 1 / value === -Infinity; +} + +module.exports = isNegZero; + +},{}],82:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the value is a regular Object and not a specialized Object + * + * This helps speed up deepEqual cyclic checks + * + * The premise is that only Objects are stored in the visited array. + * So if this function returns false, we don't have to do the + * expensive operation of searching for the value in the the array of already + * visited objects + * + * @private + * @param {object} value The object to examine + * @returns {boolean} `true` when the object is a non-specialised object + */ +function isObject(value) { + return ( + typeof value === "object" && + value !== null && + // none of these are collection objects, so we can return false + !(value instanceof Boolean) && + !(value instanceof Date) && + !(value instanceof Error) && + !(value instanceof Number) && + !(value instanceof RegExp) && + !(value instanceof String) + ); +} + +module.exports = isObject; + +},{}],83:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the argument is an instance of Set, `false` otherwise + * + * @alias module:samsam.isSet + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an instance of Set, `false` otherwise + */ +function isSet(val) { + return (typeof Set !== "undefined" && val instanceof Set) || false; +} + +module.exports = isSet; + +},{}],84:[function(require,module,exports){ +"use strict"; + +var forEach = require("@sinonjs/commons").prototypes.set.forEach; + +/** + * Returns `true` when `s1` is a subset of `s2`, `false` otherwise + * + * @private + * @param {Array|Set} s1 The target value + * @param {Array|Set} s2 The containing value + * @param {Function} compare A comparison function, should return `true` when + * values are considered equal + * @returns {boolean} Returns `true` when `s1` is a subset of `s2`, `false`` otherwise + */ +function isSubset(s1, s2, compare) { + var allContained = true; + forEach(s1, function (v1) { + var includes = false; + forEach(s2, function (v2) { + if (compare(v2, v1)) { + includes = true; + } + }); + allContained = allContained && includes; + }); + + return allContained; +} + +module.exports = isSubset; + +},{"@sinonjs/commons":47}],85:[function(require,module,exports){ +"use strict"; + +var slice = require("@sinonjs/commons").prototypes.string.slice; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +/** + * Creates a string represenation of an iterable object + * + * @private + * @param {object} obj The iterable object to stringify + * @returns {string} A string representation + */ +function iterableToString(obj) { + if (typeOf(obj) === "map") { + return mapToString(obj); + } + + return genericIterableToString(obj); +} + +/** + * Creates a string representation of a Map + * + * @private + * @param {Map} map The map to stringify + * @returns {string} A string representation + */ +function mapToString(map) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + map.forEach(function (value, key) { + representation += `[${stringify(key)},${stringify(value)}],`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Create a string represenation for an iterable + * + * @private + * @param {object} iterable The iterable to stringify + * @returns {string} A string representation + */ +function genericIterableToString(iterable) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + iterable.forEach(function (value) { + representation += `${stringify(value)},`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Creates a string representation of the passed `item` + * + * @private + * @param {object} item The item to stringify + * @returns {string} A string representation of `item` + */ +function stringify(item) { + return typeof item === "string" ? `'${item}'` : valueToString(item); +} + +module.exports = iterableToString; + +},{"@sinonjs/commons":47}],86:[function(require,module,exports){ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var indexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var forEach = require("@sinonjs/commons").prototypes.array.forEach; +var type = require("type-detect"); + +var engineCanCompareMaps = typeof Array.from === "function"; +var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define +var isArrayType = require("./is-array-type"); +var isSubset = require("./is-subset"); +var createMatcher = require("./create-matcher"); + +/** + * Returns true when `array` contains all of `subset` as defined by the `compare` + * argument + * + * @param {Array} array An array to search for a subset + * @param {Array} subset The subset to find in the array + * @param {Function} compare A comparison function + * @returns {boolean} [description] + * @private + */ +function arrayContains(array, subset, compare) { + if (subset.length === 0) { + return true; + } + var i, l, j, k; + for (i = 0, l = array.length; i < l; ++i) { + if (compare(array[i], subset[0])) { + for (j = 0, k = subset.length; j < k; ++j) { + if (i + j >= l) { + return false; + } + if (!compare(array[i + j], subset[j])) { + return false; + } + } + return true; + } + } + return false; +} + +/* eslint-disable complexity */ +/** + * Matches an object with a matcher (or value) + * + * @alias module:samsam.match + * @param {object} object The object candidate to match + * @param {object} matcherOrValue A matcher or value to match against + * @returns {boolean} true when `object` matches `matcherOrValue` + */ +function match(object, matcherOrValue) { + if (matcherOrValue && typeof matcherOrValue.test === "function") { + return matcherOrValue.test(object); + } + + switch (type(matcherOrValue)) { + case "bigint": + case "boolean": + case "number": + case "symbol": + return matcherOrValue === object; + case "function": + return matcherOrValue(object) === true; + case "string": + var notNull = typeof object === "string" || Boolean(object); + return ( + notNull && + indexOf( + valueToString(object).toLowerCase(), + matcherOrValue.toLowerCase(), + ) >= 0 + ); + case "null": + return object === null; + case "undefined": + return typeof object === "undefined"; + case "Date": + /* istanbul ignore else */ + if (type(object) === "Date") { + return object.getTime() === matcherOrValue.getTime(); + } + /* istanbul ignore next: this is basically the rest of the function, which is covered */ + break; + case "Array": + case "Int8Array": + case "Uint8Array": + case "Uint8ClampedArray": + case "Int16Array": + case "Uint16Array": + case "Int32Array": + case "Uint32Array": + case "Float32Array": + case "Float64Array": + return ( + isArrayType(matcherOrValue) && + arrayContains(object, matcherOrValue, match) + ); + case "Map": + /* istanbul ignore next: this is covered by a test, that is only run in IE, but we collect coverage information in node*/ + if (!engineCanCompareMaps) { + throw new Error( + "The JavaScript engine does not support Array.from and cannot reliably do value comparison of Map instances", + ); + } + + return ( + type(object) === "Map" && + arrayContains( + Array.from(object), + Array.from(matcherOrValue), + match, + ) + ); + default: + break; + } + + switch (type(object)) { + case "null": + return false; + case "Set": + return isSubset(matcherOrValue, object, match); + default: + break; + } + + /* istanbul ignore else */ + if (matcherOrValue && typeof matcherOrValue === "object") { + if (matcherOrValue === object) { + return true; + } + if (typeof object !== "object") { + return false; + } + var prop; + // eslint-disable-next-line guard-for-in + for (prop in matcherOrValue) { + var value = object[prop]; + if ( + typeof value === "undefined" && + typeof object.getAttribute === "function" + ) { + value = object.getAttribute(prop); + } + if ( + matcherOrValue[prop] === null || + typeof matcherOrValue[prop] === "undefined" + ) { + if (value !== matcherOrValue[prop]) { + return false; + } + } else if ( + typeof value === "undefined" || + !deepEqual(value, matcherOrValue[prop]) + ) { + return false; + } + } + return true; + } + + /* istanbul ignore next */ + throw new Error("Matcher was an unknown or unsupported type"); +} +/* eslint-enable complexity */ + +forEach(Object.keys(createMatcher), function (key) { + match[key] = createMatcher[key]; +}); + +module.exports = match; + +},{"./create-matcher":62,"./deep-equal":71,"./is-array-type":75,"./is-subset":84,"@sinonjs/commons":47,"type-detect":88}],87:[function(require,module,exports){ +"use strict"; + +/** + * @module samsam + */ +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isElement = require("./is-element"); +var isNegZero = require("./is-neg-zero"); +var isSet = require("./is-set"); +var isMap = require("./is-map"); +var match = require("./match"); +var deepEqualCyclic = require("./deep-equal").use(match); +var createMatcher = require("./create-matcher"); + +module.exports = { + createMatcher: createMatcher, + deepEqual: deepEqualCyclic, + identical: identical, + isArguments: isArguments, + isElement: isElement, + isMap: isMap, + isNegZero: isNegZero, + isSet: isSet, + match: match, +}; + +},{"./create-matcher":62,"./deep-equal":71,"./identical":73,"./is-arguments":74,"./is-element":77,"./is-map":79,"./is-neg-zero":81,"./is-set":83,"./match":86}],88:[function(require,module,exports){ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.typeDetect = factory()); +})(this, (function () { 'use strict'; + + var promiseExists = typeof Promise === 'function'; + var globalObject = (function (Obj) { + if (typeof globalThis === 'object') { + return globalThis; + } + Object.defineProperty(Obj, 'typeDetectGlobalObject', { + get: function get() { + return this; + }, + configurable: true, + }); + var global = typeDetectGlobalObject; + delete Obj.typeDetectGlobalObject; + return global; + })(Object.prototype); + var symbolExists = typeof Symbol !== 'undefined'; + var mapExists = typeof Map !== 'undefined'; + var setExists = typeof Set !== 'undefined'; + var weakMapExists = typeof WeakMap !== 'undefined'; + var weakSetExists = typeof WeakSet !== 'undefined'; + var dataViewExists = typeof DataView !== 'undefined'; + var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; + var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; + var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; + var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; + var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); + var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); + var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; + var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); + var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; + var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); + var toStringLeftSliceLength = 8; + var toStringRightSliceLength = -1; + function typeDetect(obj) { + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + if (obj === null) { + return 'null'; + } + if (obj === globalObject) { + return 'global'; + } + if (Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) { + return 'Array'; + } + if (typeof window === 'object' && window !== null) { + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + if (typeof window.navigator === 'object') { + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + var objPrototype = Object.getPrototypeOf(obj); + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + if (objPrototype === Date.prototype) { + return 'Date'; + } + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + if (objPrototype === null) { + return 'Object'; + } + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); + } + + return typeDetect; + +})); + +},{}],89:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],90:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],91:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +},{"./support/isBuffer":90,"inherits":89}],92:[function(require,module,exports){ +/*! + + diff v7.0.0 + +BSD 3-Clause License + +Copyright (c) 2009-2015, Kevin Decker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@license +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Diff = {})); +})(this, (function (exports) { 'use strict'; + + function Diff() {} + Diff.prototype = { + diff: function diff(oldString, newString) { + var _options$timeout; + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var callback = options.callback; + if (typeof options === 'function') { + callback = options; + options = {}; + } + var self = this; + function done(value) { + value = self.postProcess(value, options); + if (callback) { + setTimeout(function () { + callback(value); + }, 0); + return true; + } else { + return value; + } + } + + // Allow subclasses to massage the input prior to running + oldString = this.castInput(oldString, options); + newString = this.castInput(newString, options); + oldString = this.removeEmpty(this.tokenize(oldString, options)); + newString = this.removeEmpty(this.tokenize(newString, options)); + var newLen = newString.length, + oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + if (options.maxEditLength != null) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity; + var abortAfterTimestamp = Date.now() + maxExecutionTime; + var bestPath = [{ + oldPos: -1, + lastComponent: undefined + }]; + + // Seed editLength = 0, i.e. the content starts with the same values + var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options); + if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + // Identity per the equality and tokenizer + return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken)); + } + + // Once we hit the right edge of the edit graph on some diagonal k, we can + // definitely reach the end of the edit graph in no more than k edits, so + // there's no point in considering any moves to diagonal k+1 any more (from + // which we're guaranteed to need at least k+1 more edits). + // Similarly, once we've reached the bottom of the edit graph, there's no + // point considering moves to lower diagonals. + // We record this fact by setting minDiagonalToConsider and + // maxDiagonalToConsider to some finite value once we've hit the edge of + // the edit graph. + // This optimization is not faithful to the original algorithm presented in + // Myers's paper, which instead pointlessly extends D-paths off the end of + // the edit graph - see page 7 of Myers's paper which notes this point + // explicitly and illustrates it with a diagram. This has major performance + // implications for some common scenarios. For instance, to compute a diff + // where the new text simply appends d characters on the end of the + // original text of length n, the true Myers algorithm will take O(n+d^2) + // time while this optimization needs only O(n+d) time. + var minDiagonalToConsider = -Infinity, + maxDiagonalToConsider = Infinity; + + // Main worker method. checks all permutations of a given edit length for acceptance. + function execEditLength() { + for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { + var basePath = void 0; + var removePath = bestPath[diagonalPath - 1], + addPath = bestPath[diagonalPath + 1]; + if (removePath) { + // No one else is going to attempt to use this value, clear it + bestPath[diagonalPath - 1] = undefined; + } + var canAdd = false; + if (addPath) { + // what newPos will be after we do an insertion: + var addPathNewPos = addPath.oldPos - diagonalPath; + canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; + } + var canRemove = removePath && removePath.oldPos + 1 < oldLen; + if (!canAdd && !canRemove) { + // If this path is a terminal then prune + bestPath[diagonalPath] = undefined; + continue; + } + + // Select the diagonal that we want to branch from. We select the prior + // path whose position in the old string is the farthest from the origin + // and does not pass the bounds of the diff graph + if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) { + basePath = self.addToPath(addPath, true, false, 0, options); + } else { + basePath = self.addToPath(removePath, false, true, 1, options); + } + newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options); + if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + // If we have hit the end of both strings, then we are done + return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken)); + } else { + bestPath[diagonalPath] = basePath; + if (basePath.oldPos + 1 >= oldLen) { + maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); + } + if (newPos + 1 >= newLen) { + minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); + } + } + } + editLength++; + } + + // Performs the length of edit iteration. Is a bit fugly as this has to support the + // sync and async mode which is never fun. Loops over execEditLength until a value + // is produced, or until the edit length exceeds options.maxEditLength (if given), + // in which case it will return undefined. + if (callback) { + (function exec() { + setTimeout(function () { + if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { + return callback(); + } + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + } + }, + addToPath: function addToPath(path, added, removed, oldPosInc, options) { + var last = path.lastComponent; + if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { + return { + oldPos: path.oldPos + oldPosInc, + lastComponent: { + count: last.count + 1, + added: added, + removed: removed, + previousComponent: last.previousComponent + } + }; + } else { + return { + oldPos: path.oldPos + oldPosInc, + lastComponent: { + count: 1, + added: added, + removed: removed, + previousComponent: last + } + }; + } + }, + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) { + var newLen = newString.length, + oldLen = oldString.length, + oldPos = basePath.oldPos, + newPos = oldPos - diagonalPath, + commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) { + newPos++; + oldPos++; + commonCount++; + if (options.oneChangePerToken) { + basePath.lastComponent = { + count: 1, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + } + if (commonCount && !options.oneChangePerToken) { + basePath.lastComponent = { + count: commonCount, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + basePath.oldPos = oldPos; + return newPos; + }, + equals: function equals(left, right, options) { + if (options.comparator) { + return options.comparator(left, right); + } else { + return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + removeEmpty: function removeEmpty(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + return ret; + }, + castInput: function castInput(value) { + return value; + }, + tokenize: function tokenize(value) { + return Array.from(value); + }, + join: function join(chars) { + return chars.join(''); + }, + postProcess: function postProcess(changeObjects) { + return changeObjects; + } + }; + function buildValues(diff, lastComponent, newString, oldString, useLongestToken) { + // First we convert our linked list of components in reverse order to an + // array in the right order: + var components = []; + var nextComponent; + while (lastComponent) { + components.push(lastComponent); + nextComponent = lastComponent.previousComponent; + delete lastComponent.previousComponent; + lastComponent = nextComponent; + } + components.reverse(); + var componentPos = 0, + componentLen = components.length, + newPos = 0, + oldPos = 0; + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function (value, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value.length ? oldValue : value; + }); + component.value = diff.join(value); + } else { + component.value = diff.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + + // Common case + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + } + } + return components; + } + + var characterDiff = new Diff(); + function diffChars(oldStr, newStr, options) { + return characterDiff.diff(oldStr, newStr, options); + } + + function longestCommonPrefix(str1, str2) { + var i; + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[i] != str2[i]) { + return str1.slice(0, i); + } + } + return str1.slice(0, i); + } + function longestCommonSuffix(str1, str2) { + var i; + + // Unlike longestCommonPrefix, we need a special case to handle all scenarios + // where we return the empty string since str1.slice(-0) will return the + // entire string. + if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) { + return ''; + } + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) { + return str1.slice(-i); + } + } + return str1.slice(-i); + } + function replacePrefix(string, oldPrefix, newPrefix) { + if (string.slice(0, oldPrefix.length) != oldPrefix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug")); + } + return newPrefix + string.slice(oldPrefix.length); + } + function replaceSuffix(string, oldSuffix, newSuffix) { + if (!oldSuffix) { + return string + newSuffix; + } + if (string.slice(-oldSuffix.length) != oldSuffix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug")); + } + return string.slice(0, -oldSuffix.length) + newSuffix; + } + function removePrefix(string, oldPrefix) { + return replacePrefix(string, oldPrefix, ''); + } + function removeSuffix(string, oldSuffix) { + return replaceSuffix(string, oldSuffix, ''); + } + function maximumOverlap(string1, string2) { + return string2.slice(0, overlapCount(string1, string2)); + } + + // Nicked from https://stackoverflow.com/a/60422853/1709587 + function overlapCount(a, b) { + // Deal with cases where the strings differ in length + var startA = 0; + if (a.length > b.length) { + startA = a.length - b.length; + } + var endB = b.length; + if (a.length < b.length) { + endB = a.length; + } + // Create a back-reference for each index + // that should be followed in case of a mismatch. + // We only need B to make these references: + var map = Array(endB); + var k = 0; // Index that lags behind j + map[0] = 0; + for (var j = 1; j < endB; j++) { + if (b[j] == b[k]) { + map[j] = map[k]; // skip over the same character (optional optimisation) + } else { + map[j] = k; + } + while (k > 0 && b[j] != b[k]) { + k = map[k]; + } + if (b[j] == b[k]) { + k++; + } + } + // Phase 2: use these references while iterating over A + k = 0; + for (var i = startA; i < a.length; i++) { + while (k > 0 && a[i] != b[k]) { + k = map[k]; + } + if (a[i] == b[k]) { + k++; + } + } + return k; + } + + /** + * Returns true if the string consistently uses Windows line endings. + */ + function hasOnlyWinLineEndings(string) { + return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/); + } + + /** + * Returns true if the string consistently uses Unix line endings. + */ + function hasOnlyUnixLineEndings(string) { + return !string.includes('\r\n') && string.includes('\n'); + } + + // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode + // + // Ranges and exceptions: + // Latin-1 Supplement, 0080–00FF + // - U+00D7 × Multiplication sign + // - U+00F7 ÷ Division sign + // Latin Extended-A, 0100–017F + // Latin Extended-B, 0180–024F + // IPA Extensions, 0250–02AF + // Spacing Modifier Letters, 02B0–02FF + // - U+02C7 ˇ ˇ Caron + // - U+02D8 ˘ ˘ Breve + // - U+02D9 ˙ ˙ Dot Above + // - U+02DA ˚ ˚ Ring Above + // - U+02DB ˛ ˛ Ogonek + // - U+02DC ˜ ˜ Small Tilde + // - U+02DD ˝ ˝ Double Acute Accent + // Latin Extended Additional, 1E00–1EFF + var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}"; + + // Each token is one of the following: + // - A punctuation mark plus the surrounding whitespace + // - A word plus the surrounding whitespace + // - Pure whitespace (but only in the special case where this the entire text + // is just whitespace) + // + // We have to include surrounding whitespace in the tokens because the two + // alternative approaches produce horribly broken results: + // * If we just discard the whitespace, we can't fully reproduce the original + // text from the sequence of tokens and any attempt to render the diff will + // get the whitespace wrong. + // * If we have separate tokens for whitespace, then in a typical text every + // second token will be a single space character. But this often results in + // the optimal diff between two texts being a perverse one that preserves + // the spaces between words but deletes and reinserts actual common words. + // See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640 + // for an example. + // + // Keeping the surrounding whitespace of course has implications for .equals + // and .join, not just .tokenize. + + // This regex does NOT fully implement the tokenization rules described above. + // Instead, it gives runs of whitespace their own "token". The tokenize method + // then handles stitching whitespace tokens onto adjacent word or punctuation + // tokens. + var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), 'ug'); + var wordDiff = new Diff(); + wordDiff.equals = function (left, right, options) { + if (options.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left.trim() === right.trim(); + }; + wordDiff.tokenize = function (value) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var parts; + if (options.intlSegmenter) { + if (options.intlSegmenter.resolvedOptions().granularity != 'word') { + throw new Error('The segmenter passed must have a granularity of "word"'); + } + parts = Array.from(options.intlSegmenter.segment(value), function (segment) { + return segment.segment; + }); + } else { + parts = value.match(tokenizeIncludingWhitespace) || []; + } + var tokens = []; + var prevPart = null; + parts.forEach(function (part) { + if (/\s/.test(part)) { + if (prevPart == null) { + tokens.push(part); + } else { + tokens.push(tokens.pop() + part); + } + } else if (/\s/.test(prevPart)) { + if (tokens[tokens.length - 1] == prevPart) { + tokens.push(tokens.pop() + part); + } else { + tokens.push(prevPart + part); + } + } else { + tokens.push(part); + } + prevPart = part; + }); + return tokens; + }; + wordDiff.join = function (tokens) { + // Tokens being joined here will always have appeared consecutively in the + // same text, so we can simply strip off the leading whitespace from all the + // tokens except the first (and except any whitespace-only tokens - but such + // a token will always be the first and only token anyway) and then join them + // and the whitespace around words and punctuation will end up correct. + return tokens.map(function (token, i) { + if (i == 0) { + return token; + } else { + return token.replace(/^\s+/, ''); + } + }).join(''); + }; + wordDiff.postProcess = function (changes, options) { + if (!changes || options.oneChangePerToken) { + return changes; + } + var lastKeep = null; + // Change objects representing any insertion or deletion since the last + // "keep" change object. There can be at most one of each. + var insertion = null; + var deletion = null; + changes.forEach(function (change) { + if (change.added) { + insertion = change; + } else if (change.removed) { + deletion = change; + } else { + if (insertion || deletion) { + // May be false at start of text + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change); + } + lastKeep = change; + insertion = null; + deletion = null; + } + }); + if (insertion || deletion) { + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null); + } + return changes; + }; + function diffWords(oldStr, newStr, options) { + // This option has never been documented and never will be (it's clearer to + // just call `diffWordsWithSpace` directly if you need that behavior), but + // has existed in jsdiff for a long time, so we retain support for it here + // for the sake of backwards compatibility. + if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) { + return diffWordsWithSpace(oldStr, newStr, options); + } + return wordDiff.diff(oldStr, newStr, options); + } + function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) { + // Before returning, we tidy up the leading and trailing whitespace of the + // change objects to eliminate cases where trailing whitespace in one object + // is repeated as leading whitespace in the next. + // Below are examples of the outcomes we want here to explain the code. + // I=insert, K=keep, D=delete + // 1. diffing 'foo bar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' + // After cleanup, we want: K:'foo ' D:'bar ' K:'baz' + // + // 2. Diffing 'foo bar baz' vs 'foo qux baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz' + // After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz' + // + // 3. Diffing 'foo\nbar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz' + // After cleanup, we want K'foo' D:'\nbar' K:' baz' + // + // 4. Diffing 'foo baz' vs 'foo\nbar baz' + // Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz' + // After cleanup, we ideally want K'foo' I:'\nbar' K:' baz' + // but don't actually manage this currently (the pre-cleanup change + // objects don't contain enough information to make it possible). + // + // 5. Diffing 'foo bar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' + // After cleanup, we want K:'foo ' D:' bar ' K:'baz' + // + // Our handling is unavoidably imperfect in the case where there's a single + // indel between keeps and the whitespace has changed. For instance, consider + // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change + // object to represent the insertion of the space character (which isn't even + // a token), we have no way to avoid losing information about the texts' + // original whitespace in the result we return. Still, we do our best to + // output something that will look sensible if we e.g. print it with + // insertions in green and deletions in red. + + // Between two "keep" change objects (or before the first or after the last + // change object), we can have either: + // * A "delete" followed by an "insert" + // * Just an "insert" + // * Just a "delete" + // We handle the three cases separately. + if (deletion && insertion) { + var oldWsPrefix = deletion.value.match(/^\s*/)[0]; + var oldWsSuffix = deletion.value.match(/\s*$/)[0]; + var newWsPrefix = insertion.value.match(/^\s*/)[0]; + var newWsSuffix = insertion.value.match(/\s*$/)[0]; + if (startKeep) { + var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix); + startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix); + deletion.value = removePrefix(deletion.value, commonWsPrefix); + insertion.value = removePrefix(insertion.value, commonWsPrefix); + } + if (endKeep) { + var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix); + endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix); + deletion.value = removeSuffix(deletion.value, commonWsSuffix); + insertion.value = removeSuffix(insertion.value, commonWsSuffix); + } + } else if (insertion) { + // The whitespaces all reflect what was in the new text rather than + // the old, so we essentially have no information about whitespace + // insertion or deletion. We just want to dedupe the whitespace. + // We do that by having each change object keep its trailing + // whitespace and deleting duplicate leading whitespace where + // present. + if (startKeep) { + insertion.value = insertion.value.replace(/^\s*/, ''); + } + if (endKeep) { + endKeep.value = endKeep.value.replace(/^\s*/, ''); + } + // otherwise we've got a deletion and no insertion + } else if (startKeep && endKeep) { + var newWsFull = endKeep.value.match(/^\s*/)[0], + delWsStart = deletion.value.match(/^\s*/)[0], + delWsEnd = deletion.value.match(/\s*$/)[0]; + + // Any whitespace that comes straight after startKeep in both the old and + // new texts, assign to startKeep and remove from the deletion. + var newWsStart = longestCommonPrefix(newWsFull, delWsStart); + deletion.value = removePrefix(deletion.value, newWsStart); + + // Any whitespace that comes straight before endKeep in both the old and + // new texts, and hasn't already been assigned to startKeep, assign to + // endKeep and remove from the deletion. + var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd); + deletion.value = removeSuffix(deletion.value, newWsEnd); + endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd); + + // If there's any whitespace from the new text that HASN'T already been + // assigned, assign it to the start: + startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length)); + } else if (endKeep) { + // We are at the start of the text. Preserve all the whitespace on + // endKeep, and just remove whitespace from the end of deletion to the + // extent that it overlaps with the start of endKeep. + var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0]; + var deletionWsSuffix = deletion.value.match(/\s*$/)[0]; + var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix); + deletion.value = removeSuffix(deletion.value, overlap); + } else if (startKeep) { + // We are at the END of the text. Preserve all the whitespace on + // startKeep, and just remove whitespace from the start of deletion to + // the extent that it overlaps with the end of startKeep. + var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0]; + var deletionWsPrefix = deletion.value.match(/^\s*/)[0]; + var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix); + deletion.value = removePrefix(deletion.value, _overlap); + } + } + var wordWithSpaceDiff = new Diff(); + wordWithSpaceDiff.tokenize = function (value) { + // Slightly different to the tokenizeIncludingWhitespace regex used above in + // that this one treats each individual newline as a distinct tokens, rather + // than merging them into other surrounding whitespace. This was requested + // in https://github.com/kpdecker/jsdiff/issues/180 & + // https://github.com/kpdecker/jsdiff/issues/211 + var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), 'ug'); + return value.match(regex) || []; + }; + function diffWordsWithSpace(oldStr, newStr, options) { + return wordWithSpaceDiff.diff(oldStr, newStr, options); + } + + function generateOptions(options, defaults) { + if (typeof options === 'function') { + defaults.callback = options; + } else if (options) { + for (var name in options) { + /* istanbul ignore else */ + if (options.hasOwnProperty(name)) { + defaults[name] = options[name]; + } + } + } + return defaults; + } + + var lineDiff = new Diff(); + lineDiff.tokenize = function (value, options) { + if (options.stripTrailingCr) { + // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior + value = value.replace(/\r\n/g, '\n'); + } + var retLines = [], + linesAndNewlines = value.split(/(\n|\r\n)/); + + // Ignore the final empty token that occurs if the string ends with a new line + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + + // Merge the content and line separators into single tokens + for (var i = 0; i < linesAndNewlines.length; i++) { + var line = linesAndNewlines[i]; + if (i % 2 && !options.newlineIsToken) { + retLines[retLines.length - 1] += line; + } else { + retLines.push(line); + } + } + return retLines; + }; + lineDiff.equals = function (left, right, options) { + // If we're ignoring whitespace, we need to normalise lines by stripping + // whitespace before checking equality. (This has an annoying interaction + // with newlineIsToken that requires special handling: if newlines get their + // own token, then we DON'T want to trim the *newline* tokens down to empty + // strings, since this would cause us to treat whitespace-only line content + // as equal to a separator between lines, which would be weird and + // inconsistent with the documented behavior of the options.) + if (options.ignoreWhitespace) { + if (!options.newlineIsToken || !left.includes('\n')) { + left = left.trim(); + } + if (!options.newlineIsToken || !right.includes('\n')) { + right = right.trim(); + } + } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) { + if (left.endsWith('\n')) { + left = left.slice(0, -1); + } + if (right.endsWith('\n')) { + right = right.slice(0, -1); + } + } + return Diff.prototype.equals.call(this, left, right, options); + }; + function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); + } + + // Kept for backwards compatibility. This is a rather arbitrary wrapper method + // that just calls `diffLines` with `ignoreWhitespace: true`. It's confusing to + // have two ways to do exactly the same thing in the API, so we no longer + // document this one (library users should explicitly use `diffLines` with + // `ignoreWhitespace: true` instead) but we keep it around to maintain + // compatibility with code that used old versions. + function diffTrimmedLines(oldStr, newStr, callback) { + var options = generateOptions(callback, { + ignoreWhitespace: true + }); + return lineDiff.diff(oldStr, newStr, options); + } + + var sentenceDiff = new Diff(); + sentenceDiff.tokenize = function (value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); + }; + function diffSentences(oldStr, newStr, callback) { + return sentenceDiff.diff(oldStr, newStr, callback); + } + + var cssDiff = new Diff(); + cssDiff.tokenize = function (value) { + return value.split(/([{}:;,]|\s+)/); + }; + function diffCss(oldStr, newStr, callback) { + return cssDiff.diff(oldStr, newStr, callback); + } + + function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; + } + function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var jsonDiff = new Diff(); + // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a + // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: + jsonDiff.useLongestToken = true; + jsonDiff.tokenize = lineDiff.tokenize; + jsonDiff.castInput = function (value, options) { + var undefinedReplacement = options.undefinedReplacement, + _options$stringifyRep = options.stringifyReplacer, + stringifyReplacer = _options$stringifyRep === void 0 ? function (k, v) { + return typeof v === 'undefined' ? undefinedReplacement : v; + } : _options$stringifyRep; + return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); + }; + jsonDiff.equals = function (left, right, options) { + return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options); + }; + function diffJson(oldObj, newObj, options) { + return jsonDiff.diff(oldObj, newObj, options); + } + + // This function handles the presence of circular references by bailing out when encountering an + // object that is already on the "stack" of items being processed. Accepts an optional replacer + function canonicalize(obj, stack, replacementStack, replacer, key) { + stack = stack || []; + replacementStack = replacementStack || []; + if (replacer) { + obj = replacer(key, obj); + } + var i; + for (i = 0; i < stack.length; i += 1) { + if (stack[i] === obj) { + return replacementStack[i]; + } + } + var canonicalizedObj; + if ('[object Array]' === Object.prototype.toString.call(obj)) { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + if (_typeof(obj) === 'object' && obj !== null) { + stack.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], + _key; + for (_key in obj) { + /* istanbul ignore else */ + if (Object.prototype.hasOwnProperty.call(obj, _key)) { + sortedKeys.push(_key); + } + } + sortedKeys.sort(); + for (i = 0; i < sortedKeys.length; i += 1) { + _key = sortedKeys[i]; + canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; + } + + var arrayDiff = new Diff(); + arrayDiff.tokenize = function (value) { + return value.slice(); + }; + arrayDiff.join = arrayDiff.removeEmpty = function (value) { + return value; + }; + function diffArrays(oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); + } + + function unixToWin(patch) { + if (Array.isArray(patch)) { + return patch.map(unixToWin); + } + return _objectSpread2(_objectSpread2({}, patch), {}, { + hunks: patch.hunks.map(function (hunk) { + return _objectSpread2(_objectSpread2({}, hunk), {}, { + lines: hunk.lines.map(function (line, i) { + var _hunk$lines; + return line.startsWith('\\') || line.endsWith('\r') || (_hunk$lines = hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 && _hunk$lines.startsWith('\\') ? line : line + '\r'; + }) + }); + }) + }); + } + function winToUnix(patch) { + if (Array.isArray(patch)) { + return patch.map(winToUnix); + } + return _objectSpread2(_objectSpread2({}, patch), {}, { + hunks: patch.hunks.map(function (hunk) { + return _objectSpread2(_objectSpread2({}, hunk), {}, { + lines: hunk.lines.map(function (line) { + return line.endsWith('\r') ? line.substring(0, line.length - 1) : line; + }) + }); + }) + }); + } + + /** + * Returns true if the patch consistently uses Unix line endings (or only involves one line and has + * no line endings). + */ + function isUnix(patch) { + if (!Array.isArray(patch)) { + patch = [patch]; + } + return !patch.some(function (index) { + return index.hunks.some(function (hunk) { + return hunk.lines.some(function (line) { + return !line.startsWith('\\') && line.endsWith('\r'); + }); + }); + }); + } + + /** + * Returns true if the patch uses Windows line endings and only Windows line endings. + */ + function isWin(patch) { + if (!Array.isArray(patch)) { + patch = [patch]; + } + return patch.some(function (index) { + return index.hunks.some(function (hunk) { + return hunk.lines.some(function (line) { + return line.endsWith('\r'); + }); + }); + }) && patch.every(function (index) { + return index.hunks.every(function (hunk) { + return hunk.lines.every(function (line, i) { + var _hunk$lines2; + return line.startsWith('\\') || line.endsWith('\r') || ((_hunk$lines2 = hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 : _hunk$lines2.startsWith('\\')); + }); + }); + }); + } + + function parsePatch(uniDiff) { + var diffstr = uniDiff.split(/\n/), + list = [], + i = 0; + function parseIndex() { + var index = {}; + list.push(index); + + // Parse diff metadata + while (i < diffstr.length) { + var line = diffstr[i]; + + // File header found, end parsing diff metadata + if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { + break; + } + + // Diff index + var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); + if (header) { + index.index = header[1]; + } + i++; + } + + // Parse file headers if they are defined. Unified diff requires them, but + // there's no technical issues to have an isolated hunk without file header + parseFileHeader(index); + parseFileHeader(index); + + // Parse hunks + index.hunks = []; + while (i < diffstr.length) { + var _line = diffstr[i]; + if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) { + break; + } else if (/^@@/.test(_line)) { + index.hunks.push(parseHunk()); + } else if (_line) { + throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); + } else { + i++; + } + } + } + + // Parses the --- and +++ headers, if none are found, no lines + // are consumed. + function parseFileHeader(index) { + var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]); + if (fileHeader) { + var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; + var data = fileHeader[2].split('\t', 2); + var fileName = data[0].replace(/\\\\/g, '\\'); + if (/^".*"$/.test(fileName)) { + fileName = fileName.substr(1, fileName.length - 2); + } + index[keyPrefix + 'FileName'] = fileName; + index[keyPrefix + 'Header'] = (data[1] || '').trim(); + i++; + } + } + + // Parses a hunk + // This assumes that we are at the start of a hunk. + function parseHunk() { + var chunkHeaderIndex = i, + chunkHeaderLine = diffstr[i++], + chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); + var hunk = { + oldStart: +chunkHeader[1], + oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2], + newStart: +chunkHeader[3], + newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4], + lines: [] + }; + + // Unified Diff Format quirk: If the chunk size is 0, + // the first number is one lower than one would expect. + // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 + if (hunk.oldLines === 0) { + hunk.oldStart += 1; + } + if (hunk.newLines === 0) { + hunk.newStart += 1; + } + var addCount = 0, + removeCount = 0; + for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || (_diffstr$i = diffstr[i]) !== null && _diffstr$i !== void 0 && _diffstr$i.startsWith('\\')); i++) { + var _diffstr$i; + var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; + if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { + hunk.lines.push(diffstr[i]); + if (operation === '+') { + addCount++; + } else if (operation === '-') { + removeCount++; + } else if (operation === ' ') { + addCount++; + removeCount++; + } + } else { + throw new Error("Hunk at line ".concat(chunkHeaderIndex + 1, " contained invalid line ").concat(diffstr[i])); + } + } + + // Handle the empty block count case + if (!addCount && hunk.newLines === 1) { + hunk.newLines = 0; + } + if (!removeCount && hunk.oldLines === 1) { + hunk.oldLines = 0; + } + + // Perform sanity checking + if (addCount !== hunk.newLines) { + throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + if (removeCount !== hunk.oldLines) { + throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + return hunk; + } + while (i < diffstr.length) { + parseIndex(); + } + return list; + } + + // Iterator that traverses in the range of [min, max], stepping + // by distance from a given start position. I.e. for [0, 4], with + // start of 2, this will iterate 2, 3, 1, 4, 0. + function distanceIterator (start, minLine, maxLine) { + var wantForward = true, + backwardExhausted = false, + forwardExhausted = false, + localOffset = 1; + return function iterator() { + if (wantForward && !forwardExhausted) { + if (backwardExhausted) { + localOffset++; + } else { + wantForward = false; + } + + // Check if trying to fit beyond text length, and if not, check it fits + // after offset location (or desired location on first iteration) + if (start + localOffset <= maxLine) { + return start + localOffset; + } + forwardExhausted = true; + } + if (!backwardExhausted) { + if (!forwardExhausted) { + wantForward = true; + } + + // Check if trying to fit before text beginning, and if not, check it fits + // before offset location + if (minLine <= start - localOffset) { + return start - localOffset++; + } + backwardExhausted = true; + return iterator(); + } + + // We tried to fit hunk before text beginning and beyond text length, then + // hunk can't fit on the text. Return undefined + }; + } + + function applyPatch(source, uniDiff) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (typeof uniDiff === 'string') { + uniDiff = parsePatch(uniDiff); + } + if (Array.isArray(uniDiff)) { + if (uniDiff.length > 1) { + throw new Error('applyPatch only works with a single input.'); + } + uniDiff = uniDiff[0]; + } + if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) { + if (hasOnlyWinLineEndings(source) && isUnix(uniDiff)) { + uniDiff = unixToWin(uniDiff); + } else if (hasOnlyUnixLineEndings(source) && isWin(uniDiff)) { + uniDiff = winToUnix(uniDiff); + } + } + + // Apply the diff to the input + var lines = source.split('\n'), + hunks = uniDiff.hunks, + compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { + return line === patchContent; + }, + fuzzFactor = options.fuzzFactor || 0, + minLine = 0; + if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) { + throw new Error('fuzzFactor must be a non-negative integer'); + } + + // Special case for empty patch. + if (!hunks.length) { + return source; + } + + // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change + // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a + // newline that already exists - then we either return false and fail to apply the patch (if + // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0). + // If we do need to remove/add a newline at EOF, this will always be in the final hunk: + var prevLine = '', + removeEOFNL = false, + addEOFNL = false; + for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) { + var line = hunks[hunks.length - 1].lines[i]; + if (line[0] == '\\') { + if (prevLine[0] == '+') { + removeEOFNL = true; + } else if (prevLine[0] == '-') { + addEOFNL = true; + } + } + prevLine = line; + } + if (removeEOFNL) { + if (addEOFNL) { + // This means the final line gets changed but doesn't have a trailing newline in either the + // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if + // fuzzFactor is 0, we simply validate that the source file has no trailing newline. + if (!fuzzFactor && lines[lines.length - 1] == '') { + return false; + } + } else if (lines[lines.length - 1] == '') { + lines.pop(); + } else if (!fuzzFactor) { + return false; + } + } else if (addEOFNL) { + if (lines[lines.length - 1] != '') { + lines.push(''); + } else if (!fuzzFactor) { + return false; + } + } + + /** + * Checks if the hunk can be made to fit at the provided location with at most `maxErrors` + * insertions, substitutions, or deletions, while ensuring also that: + * - lines deleted in the hunk match exactly, and + * - wherever an insertion operation or block of insertion operations appears in the hunk, the + * immediately preceding and following lines of context match exactly + * + * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0]. + * + * If the hunk can be applied, returns an object with properties `oldLineLastI` and + * `replacementLines`. Otherwise, returns null. + */ + function applyHunk(hunkLines, toPos, maxErrors) { + var hunkLinesI = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var lastContextLineMatched = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + var patchedLines = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : []; + var patchedLinesLength = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0; + var nConsecutiveOldContextLines = 0; + var nextContextLineMustMatch = false; + for (; hunkLinesI < hunkLines.length; hunkLinesI++) { + var hunkLine = hunkLines[hunkLinesI], + operation = hunkLine.length > 0 ? hunkLine[0] : ' ', + content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine; + if (operation === '-') { + if (compareLine(toPos + 1, lines[toPos], operation, content)) { + toPos++; + nConsecutiveOldContextLines = 0; + } else { + if (!maxErrors || lines[toPos] == null) { + return null; + } + patchedLines[patchedLinesLength] = lines[toPos]; + return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1); + } + } + if (operation === '+') { + if (!lastContextLineMatched) { + return null; + } + patchedLines[patchedLinesLength] = content; + patchedLinesLength++; + nConsecutiveOldContextLines = 0; + nextContextLineMustMatch = true; + } + if (operation === ' ') { + nConsecutiveOldContextLines++; + patchedLines[patchedLinesLength] = lines[toPos]; + if (compareLine(toPos + 1, lines[toPos], operation, content)) { + patchedLinesLength++; + lastContextLineMatched = true; + nextContextLineMustMatch = false; + toPos++; + } else { + if (nextContextLineMustMatch || !maxErrors) { + return null; + } + + // Consider 3 possibilities in sequence: + // 1. lines contains a *substitution* not included in the patch context, or + // 2. lines contains an *insertion* not included in the patch context, or + // 3. lines contains a *deletion* not included in the patch context + // The first two options are of course only possible if the line from lines is non-null - + // i.e. only option 3 is possible if we've overrun the end of the old file. + return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength); + } + } + } + + // Before returning, trim any unmodified context lines off the end of patchedLines and reduce + // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region + // that starts in this hunk's trailing context. + patchedLinesLength -= nConsecutiveOldContextLines; + toPos -= nConsecutiveOldContextLines; + patchedLines.length = patchedLinesLength; + return { + patchedLines: patchedLines, + oldLineLastI: toPos - 1 + }; + } + var resultLines = []; + + // Search best fit offsets for each hunk based on the previous ones + var prevHunkOffset = 0; + for (var _i = 0; _i < hunks.length; _i++) { + var hunk = hunks[_i]; + var hunkResult = void 0; + var maxLine = lines.length - hunk.oldLines + fuzzFactor; + var toPos = void 0; + for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) { + toPos = hunk.oldStart + prevHunkOffset - 1; + var iterator = distanceIterator(toPos, minLine, maxLine); + for (; toPos !== undefined; toPos = iterator()) { + hunkResult = applyHunk(hunk.lines, toPos, maxErrors); + if (hunkResult) { + break; + } + } + if (hunkResult) { + break; + } + } + if (!hunkResult) { + return false; + } + + // Copy everything from the end of where we applied the last hunk to the start of this hunk + for (var _i2 = minLine; _i2 < toPos; _i2++) { + resultLines.push(lines[_i2]); + } + + // Add the lines produced by applying the hunk: + for (var _i3 = 0; _i3 < hunkResult.patchedLines.length; _i3++) { + var _line = hunkResult.patchedLines[_i3]; + resultLines.push(_line); + } + + // Set lower text limit to end of the current hunk, so next ones don't try + // to fit over already patched text + minLine = hunkResult.oldLineLastI + 1; + + // Note the offset between where the patch said the hunk should've applied and where we + // applied it, so we can adjust future hunks accordingly: + prevHunkOffset = toPos + 1 - hunk.oldStart; + } + + // Copy over the rest of the lines from the old text + for (var _i4 = minLine; _i4 < lines.length; _i4++) { + resultLines.push(lines[_i4]); + } + return resultLines.join('\n'); + } + + // Wrapper that supports multiple file patches via callbacks. + function applyPatches(uniDiff, options) { + if (typeof uniDiff === 'string') { + uniDiff = parsePatch(uniDiff); + } + var currentIndex = 0; + function processIndex() { + var index = uniDiff[currentIndex++]; + if (!index) { + return options.complete(); + } + options.loadFile(index, function (err, data) { + if (err) { + return options.complete(err); + } + var updatedContent = applyPatch(data, index, options); + options.patched(index, updatedContent, function (err) { + if (err) { + return options.complete(err); + } + processIndex(); + }); + }); + } + processIndex(); + } + + function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + if (!options) { + options = {}; + } + if (typeof options === 'function') { + options = { + callback: options + }; + } + if (typeof options.context === 'undefined') { + options.context = 4; + } + if (options.newlineIsToken) { + throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions'); + } + if (!options.callback) { + return diffLinesResultToPatch(diffLines(oldStr, newStr, options)); + } else { + var _options = options, + _callback = _options.callback; + diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options), {}, { + callback: function callback(diff) { + var patch = diffLinesResultToPatch(diff); + _callback(patch); + } + })); + } + function diffLinesResultToPatch(diff) { + // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays + // of lines containing trailing newline characters. We'll tidy up later... + + if (!diff) { + return; + } + diff.push({ + value: '', + lines: [] + }); // Append an empty value to make cleanup easier + + function contextLines(lines) { + return lines.map(function (entry) { + return ' ' + entry; + }); + } + var hunks = []; + var oldRangeStart = 0, + newRangeStart = 0, + curRange = [], + oldLine = 1, + newLine = 1; + var _loop = function _loop() { + var current = diff[i], + lines = current.lines || splitLines(current.value); + current.lines = lines; + if (current.added || current.removed) { + var _curRange; + // If we have previous context, start with that + if (!oldRangeStart) { + var prev = diff[i - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + if (prev) { + curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + + // Output our changes + (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) { + return (current.added ? '+' : '-') + entry; + }))); + + // Track the updated file position + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + // Identical context lines. Track line changes + if (oldRangeStart) { + // Close out any changes that have been output (or join overlapping) + if (lines.length <= options.context * 2 && i < diff.length - 2) { + var _curRange2; + // Overlapping + (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); + } else { + var _curRange3; + // end the range and output + var contextSize = Math.min(lines.length, options.context); + (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); + var _hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + hunks.push(_hunk); + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + for (var i = 0; i < diff.length; i++) { + _loop(); + } + + // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add + // "\ No newline at end of file". + for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) { + var hunk = _hunks[_i]; + for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) { + if (hunk.lines[_i2].endsWith('\n')) { + hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1); + } else { + hunk.lines.splice(_i2 + 1, 0, '\\ No newline at end of file'); + _i2++; // Skip the line we just added, then continue iterating + } + } + } + return { + oldFileName: oldFileName, + newFileName: newFileName, + oldHeader: oldHeader, + newHeader: newHeader, + hunks: hunks + }; + } + } + function formatPatch(diff) { + if (Array.isArray(diff)) { + return diff.map(formatPatch).join('\n'); + } + var ret = []; + if (diff.oldFileName == diff.newFileName) { + ret.push('Index: ' + diff.oldFileName); + } + ret.push('==================================================================='); + ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); + ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); + for (var i = 0; i < diff.hunks.length; i++) { + var hunk = diff.hunks[i]; + // Unified Diff Format quirk: If the chunk size is 0, + // the first number is one lower than one would expect. + // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 + if (hunk.oldLines === 0) { + hunk.oldStart -= 1; + } + if (hunk.newLines === 0) { + hunk.newStart -= 1; + } + ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); + ret.push.apply(ret, hunk.lines); + } + return ret.join('\n') + '\n'; + } + function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + var _options2; + if (typeof options === 'function') { + options = { + callback: options + }; + } + if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.callback)) { + var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); + if (!patchObj) { + return; + } + return formatPatch(patchObj); + } else { + var _options3 = options, + _callback2 = _options3.callback; + structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options), {}, { + callback: function callback(patchObj) { + if (!patchObj) { + _callback2(); + } else { + _callback2(formatPatch(patchObj)); + } + } + })); + } + } + function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { + return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); + } + + /** + * Split `text` into an array of lines, including the trailing newline character (where present) + */ + function splitLines(text) { + var hasTrailingNl = text.endsWith('\n'); + var result = text.split('\n').map(function (line) { + return line + '\n'; + }); + if (hasTrailingNl) { + result.pop(); + } else { + result.push(result.pop().slice(0, -1)); + } + return result; + } + + function arrayEqual(a, b) { + if (a.length !== b.length) { + return false; + } + return arrayStartsWith(a, b); + } + function arrayStartsWith(array, start) { + if (start.length > array.length) { + return false; + } + for (var i = 0; i < start.length; i++) { + if (start[i] !== array[i]) { + return false; + } + } + return true; + } + + function calcLineCount(hunk) { + var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), + oldLines = _calcOldNewLineCount.oldLines, + newLines = _calcOldNewLineCount.newLines; + if (oldLines !== undefined) { + hunk.oldLines = oldLines; + } else { + delete hunk.oldLines; + } + if (newLines !== undefined) { + hunk.newLines = newLines; + } else { + delete hunk.newLines; + } + } + function merge(mine, theirs, base) { + mine = loadPatch(mine, base); + theirs = loadPatch(theirs, base); + var ret = {}; + + // For index we just let it pass through as it doesn't have any necessary meaning. + // Leaving sanity checks on this to the API consumer that may know more about the + // meaning in their own context. + if (mine.index || theirs.index) { + ret.index = mine.index || theirs.index; + } + if (mine.newFileName || theirs.newFileName) { + if (!fileNameChanged(mine)) { + // No header or no change in ours, use theirs (and ours if theirs does not exist) + ret.oldFileName = theirs.oldFileName || mine.oldFileName; + ret.newFileName = theirs.newFileName || mine.newFileName; + ret.oldHeader = theirs.oldHeader || mine.oldHeader; + ret.newHeader = theirs.newHeader || mine.newHeader; + } else if (!fileNameChanged(theirs)) { + // No header or no change in theirs, use ours + ret.oldFileName = mine.oldFileName; + ret.newFileName = mine.newFileName; + ret.oldHeader = mine.oldHeader; + ret.newHeader = mine.newHeader; + } else { + // Both changed... figure it out + ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); + ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); + ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); + ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); + } + } + ret.hunks = []; + var mineIndex = 0, + theirsIndex = 0, + mineOffset = 0, + theirsOffset = 0; + while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { + var mineCurrent = mine.hunks[mineIndex] || { + oldStart: Infinity + }, + theirsCurrent = theirs.hunks[theirsIndex] || { + oldStart: Infinity + }; + if (hunkBefore(mineCurrent, theirsCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); + mineIndex++; + theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; + } else if (hunkBefore(theirsCurrent, mineCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); + theirsIndex++; + mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; + } else { + // Overlap, merge as best we can + var mergedHunk = { + oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), + oldLines: 0, + newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), + newLines: 0, + lines: [] + }; + mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); + theirsIndex++; + mineIndex++; + ret.hunks.push(mergedHunk); + } + } + return ret; + } + function loadPatch(param, base) { + if (typeof param === 'string') { + if (/^@@/m.test(param) || /^Index:/m.test(param)) { + return parsePatch(param)[0]; + } + if (!base) { + throw new Error('Must provide a base reference or pass in a patch'); + } + return structuredPatch(undefined, undefined, base, param); + } + return param; + } + function fileNameChanged(patch) { + return patch.newFileName && patch.newFileName !== patch.oldFileName; + } + function selectField(index, mine, theirs) { + if (mine === theirs) { + return mine; + } else { + index.conflict = true; + return { + mine: mine, + theirs: theirs + }; + } + } + function hunkBefore(test, check) { + return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; + } + function cloneHunk(hunk, offset) { + return { + oldStart: hunk.oldStart, + oldLines: hunk.oldLines, + newStart: hunk.newStart + offset, + newLines: hunk.newLines, + lines: hunk.lines + }; + } + function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { + // This will generally result in a conflicted hunk, but there are cases where the context + // is the only overlap where we can successfully merge the content here. + var mine = { + offset: mineOffset, + lines: mineLines, + index: 0 + }, + their = { + offset: theirOffset, + lines: theirLines, + index: 0 + }; + + // Handle any leading content + insertLeading(hunk, mine, their); + insertLeading(hunk, their, mine); + + // Now in the overlap content. Scan through and select the best changes from each. + while (mine.index < mine.lines.length && their.index < their.lines.length) { + var mineCurrent = mine.lines[mine.index], + theirCurrent = their.lines[their.index]; + if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { + // Both modified ... + mutualChange(hunk, mine, their); + } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { + var _hunk$lines; + // Mine inserted + (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); + } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { + var _hunk$lines2; + // Theirs inserted + (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); + } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { + // Mine removed or edited + removal(hunk, mine, their); + } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { + // Their removed or edited + removal(hunk, their, mine, true); + } else if (mineCurrent === theirCurrent) { + // Context identity + hunk.lines.push(mineCurrent); + mine.index++; + their.index++; + } else { + // Context mismatch + conflict(hunk, collectChange(mine), collectChange(their)); + } + } + + // Now push anything that may be remaining + insertTrailing(hunk, mine); + insertTrailing(hunk, their); + calcLineCount(hunk); + } + function mutualChange(hunk, mine, their) { + var myChanges = collectChange(mine), + theirChanges = collectChange(their); + if (allRemoves(myChanges) && allRemoves(theirChanges)) { + // Special case for remove changes that are supersets of one another + if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { + var _hunk$lines3; + (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); + return; + } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { + var _hunk$lines4; + (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); + return; + } + } else if (arrayEqual(myChanges, theirChanges)) { + var _hunk$lines5; + (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); + return; + } + conflict(hunk, myChanges, theirChanges); + } + function removal(hunk, mine, their, swap) { + var myChanges = collectChange(mine), + theirChanges = collectContext(their, myChanges); + if (theirChanges.merged) { + var _hunk$lines6; + (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); + } else { + conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); + } + } + function conflict(hunk, mine, their) { + hunk.conflict = true; + hunk.lines.push({ + conflict: true, + mine: mine, + theirs: their + }); + } + function insertLeading(hunk, insert, their) { + while (insert.offset < their.offset && insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + insert.offset++; + } + } + function insertTrailing(hunk, insert) { + while (insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + } + } + function collectChange(state) { + var ret = [], + operation = state.lines[state.index][0]; + while (state.index < state.lines.length) { + var line = state.lines[state.index]; + + // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. + if (operation === '-' && line[0] === '+') { + operation = '+'; + } + if (operation === line[0]) { + ret.push(line); + state.index++; + } else { + break; + } + } + return ret; + } + function collectContext(state, matchChanges) { + var changes = [], + merged = [], + matchIndex = 0, + contextChanges = false, + conflicted = false; + while (matchIndex < matchChanges.length && state.index < state.lines.length) { + var change = state.lines[state.index], + match = matchChanges[matchIndex]; + + // Once we've hit our add, then we are done + if (match[0] === '+') { + break; + } + contextChanges = contextChanges || change[0] !== ' '; + merged.push(match); + matchIndex++; + + // Consume any additions in the other block as a conflict to attempt + // to pull in the remaining context after this + if (change[0] === '+') { + conflicted = true; + while (change[0] === '+') { + changes.push(change); + change = state.lines[++state.index]; + } + } + if (match.substr(1) === change.substr(1)) { + changes.push(change); + state.index++; + } else { + conflicted = true; + } + } + if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { + conflicted = true; + } + if (conflicted) { + return changes; + } + while (matchIndex < matchChanges.length) { + merged.push(matchChanges[matchIndex++]); + } + return { + merged: merged, + changes: changes + }; + } + function allRemoves(changes) { + return changes.reduce(function (prev, change) { + return prev && change[0] === '-'; + }, true); + } + function skipRemoveSuperset(state, removeChanges, delta) { + for (var i = 0; i < delta; i++) { + var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); + if (state.lines[state.index + i] !== ' ' + changeContent) { + return false; + } + } + state.index += delta; + return true; + } + function calcOldNewLineCount(lines) { + var oldLines = 0; + var newLines = 0; + lines.forEach(function (line) { + if (typeof line !== 'string') { + var myCount = calcOldNewLineCount(line.mine); + var theirCount = calcOldNewLineCount(line.theirs); + if (oldLines !== undefined) { + if (myCount.oldLines === theirCount.oldLines) { + oldLines += myCount.oldLines; + } else { + oldLines = undefined; + } + } + if (newLines !== undefined) { + if (myCount.newLines === theirCount.newLines) { + newLines += myCount.newLines; + } else { + newLines = undefined; + } + } + } else { + if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { + newLines++; + } + if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { + oldLines++; + } + } + }); + return { + oldLines: oldLines, + newLines: newLines + }; + } + + function reversePatch(structuredPatch) { + if (Array.isArray(structuredPatch)) { + return structuredPatch.map(reversePatch).reverse(); + } + return _objectSpread2(_objectSpread2({}, structuredPatch), {}, { + oldFileName: structuredPatch.newFileName, + oldHeader: structuredPatch.newHeader, + newFileName: structuredPatch.oldFileName, + newHeader: structuredPatch.oldHeader, + hunks: structuredPatch.hunks.map(function (hunk) { + return { + oldLines: hunk.newLines, + oldStart: hunk.newStart, + newLines: hunk.oldLines, + newStart: hunk.oldStart, + lines: hunk.lines.map(function (l) { + if (l.startsWith('-')) { + return "+".concat(l.slice(1)); + } + if (l.startsWith('+')) { + return "-".concat(l.slice(1)); + } + return l; + }) + }; + }) + }); + } + + // See: http://code.google.com/p/google-diff-match-patch/wiki/API + function convertChangesToDMP(changes) { + var ret = [], + change, + operation; + for (var i = 0; i < changes.length; i++) { + change = changes[i]; + if (change.added) { + operation = 1; + } else if (change.removed) { + operation = -1; + } else { + operation = 0; + } + ret.push([operation, change.value]); + } + return ret; + } + + function convertChangesToXML(changes) { + var ret = []; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + ret.push(escapeHTML(change.value)); + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + } + return ret.join(''); + } + function escapeHTML(s) { + var n = s; + n = n.replace(/&/g, '&'); + n = n.replace(//g, '>'); + n = n.replace(/"/g, '"'); + return n; + } + + exports.Diff = Diff; + exports.applyPatch = applyPatch; + exports.applyPatches = applyPatches; + exports.canonicalize = canonicalize; + exports.convertChangesToDMP = convertChangesToDMP; + exports.convertChangesToXML = convertChangesToXML; + exports.createPatch = createPatch; + exports.createTwoFilesPatch = createTwoFilesPatch; + exports.diffArrays = diffArrays; + exports.diffChars = diffChars; + exports.diffCss = diffCss; + exports.diffJson = diffJson; + exports.diffLines = diffLines; + exports.diffSentences = diffSentences; + exports.diffTrimmedLines = diffTrimmedLines; + exports.diffWords = diffWords; + exports.diffWordsWithSpace = diffWordsWithSpace; + exports.formatPatch = formatPatch; + exports.merge = merge; + exports.parsePatch = parsePatch; + exports.reversePatch = reversePatch; + exports.structuredPatch = structuredPatch; + +})); + +},{}],93:[function(require,module,exports){ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + +},{}],94:[function(require,module,exports){ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; + +},{}],95:[function(require,module,exports){ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.typeDetect = factory()); +}(this, (function () { 'use strict'; + +/* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */ +var promiseExists = typeof Promise === 'function'; + +/* eslint-disable no-undef */ +var globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist + +var symbolExists = typeof Symbol !== 'undefined'; +var mapExists = typeof Map !== 'undefined'; +var setExists = typeof Set !== 'undefined'; +var weakMapExists = typeof WeakMap !== 'undefined'; +var weakSetExists = typeof WeakSet !== 'undefined'; +var dataViewExists = typeof DataView !== 'undefined'; +var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; +var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; +var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; +var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; +var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); +var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); +var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; +var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); +var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; +var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); +var toStringLeftSliceLength = 8; +var toStringRightSliceLength = -1; +/** + * ### typeOf (obj) + * + * Uses `Object.prototype.toString` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */ +function typeDetect(obj) { + /* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */ + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + + /* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */ + if (obj === null) { + return 'null'; + } + + /* ! Spec Conformance + * Test: `Object.prototype.toString.call(window)`` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: `Object.prototype.toString.call(this)`` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */ + if (obj === globalObject) { + return 'global'; + } + + /* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */ + if ( + Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj)) + ) { + return 'Array'; + } + + // Not caching existence of `window` and related properties due to potential + // for `window` to be unset before tests in quasi-browser environments. + if (typeof window === 'object' && window !== null) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The `Location` interface + * Test: `Object.prototype.toString.call(window.location)`` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */ + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The `Document` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: `Object.prototype.toString.call(document)`` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */ + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + + if (typeof window.navigator === 'object') { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: `Object.prototype.toString.call(navigator.mimeTypes)`` + * - IE <=10 === "[object MSMimeTypesCollection]" + */ + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: `Object.prototype.toString.call(navigator.plugins)`` + * - IE <=10 === "[object MSPluginsCollection]" + */ + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement` + * Test: `Object.prototype.toString.call(document.createElement('blockquote'))`` + * - IE <=10 === "[object HTMLBlockElement]" + */ + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + + /* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */ + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + + var objPrototype = Object.getPrototypeOf(obj); + /* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */ + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + + /* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */ + if (objPrototype === Date.prototype) { + return 'Date'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: `Object.prototype.toString.call(Promise.resolve())`` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */ + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + + /* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */ + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + + /* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */ + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + + /* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */ + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + + /* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */ + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))`` + * - Edge <=13 === "[object Object]" + */ + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: `Object.prototype.toString.call(new Map().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: `Object.prototype.toString.call(new Set().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: `Object.prototype.toString.call([][Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: `Object.prototype.toString.call(''[Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + + /* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */ + if (objPrototype === null) { + return 'Object'; + } + + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); +} + +return typeDetect; + +}))); + +},{}]},{},[2]); + +export default sinon; +const _leakThreshold = sinon.leakThreshold; +export { _leakThreshold as leakThreshold }; +const _assert = sinon.assert; +export { _assert as assert }; +const _getFakes = sinon.getFakes; +export { _getFakes as getFakes }; +const _createStubInstance = sinon.createStubInstance; +export { _createStubInstance as createStubInstance }; +const _inject = sinon.inject; +export { _inject as inject }; +const _mock = sinon.mock; +export { _mock as mock }; +const _reset = sinon.reset; +export { _reset as reset }; +const _resetBehavior = sinon.resetBehavior; +export { _resetBehavior as resetBehavior }; +const _resetHistory = sinon.resetHistory; +export { _resetHistory as resetHistory }; +const _restore = sinon.restore; +export { _restore as restore }; +const _restoreContext = sinon.restoreContext; +export { _restoreContext as restoreContext }; +const _replace = sinon.replace; +export { _replace as replace }; +const _define = sinon.define; +export { _define as define }; +const _replaceGetter = sinon.replaceGetter; +export { _replaceGetter as replaceGetter }; +const _replaceSetter = sinon.replaceSetter; +export { _replaceSetter as replaceSetter }; +const _spy = sinon.spy; +export { _spy as spy }; +const _stub = sinon.stub; +export { _stub as stub }; +const _fake = sinon.fake; +export { _fake as fake }; +const _useFakeTimers = sinon.useFakeTimers; +export { _useFakeTimers as useFakeTimers }; +const _verify = sinon.verify; +export { _verify as verify }; +const _verifyAndRestore = sinon.verifyAndRestore; +export { _verifyAndRestore as verifyAndRestore }; +const _createSandbox = sinon.createSandbox; +export { _createSandbox as createSandbox }; +const _match = sinon.match; +export { _match as match }; +const _restoreObject = sinon.restoreObject; +export { _restoreObject as restoreObject }; +const _expectation = sinon.expectation; +export { _expectation as expectation }; +const _timers = sinon.timers; +export { _timers as timers }; +const _addBehavior = sinon.addBehavior; +export { _addBehavior as addBehavior }; +const _promise = sinon.promise; +export { _promise as promise }; \ No newline at end of file diff --git a/node_modules/sinon/pkg/sinon-no-sourcemaps.cjs b/node_modules/sinon/pkg/sinon-no-sourcemaps.cjs new file mode 100644 index 0000000..5587b83 --- /dev/null +++ b/node_modules/sinon/pkg/sinon-no-sourcemaps.cjs @@ -0,0 +1,13253 @@ +/* Sinon.JS 21.0.0, 2025-06-13, @license BSD-3 */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sinon = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0) { + return args[callArgAt]; + } + + let argumentList; + + if (callArgAt === useLeftMostCallback) { + argumentList = args; + } + + if (callArgAt === useRightMostCallback) { + argumentList = reverse(slice(args)); + } + + const callArgProp = behavior.callArgProp; + + for (let i = 0, l = argumentList.length; i < l; ++i) { + if (!callArgProp && typeof argumentList[i] === "function") { + return argumentList[i]; + } + + if ( + callArgProp && + argumentList[i] && + typeof argumentList[i][callArgProp] === "function" + ) { + return argumentList[i][callArgProp]; + } + } + + return null; +} + +function getCallbackError(behavior, func, args) { + if (behavior.callArgAt < 0) { + let msg; + + if (behavior.callArgProp) { + msg = `${functionName( + behavior.stub, + )} expected to yield to '${valueToString( + behavior.callArgProp, + )}', but no object with such a property was passed.`; + } else { + msg = `${functionName( + behavior.stub, + )} expected to yield, but no callback was passed.`; + } + + if (args.length > 0) { + msg += ` Received [${join(args, ", ")}]`; + } + + return msg; + } + + return `argument at index ${behavior.callArgAt} is not a function: ${func}`; +} + +function ensureArgs(name, behavior, args) { + // map function name to internal property + // callsArg => callArgAt + const property = name.replace(/sArg/, "ArgAt"); + const index = behavior[property]; + + if (index >= args.length) { + throw new TypeError( + `${name} failed: ${index + 1} arguments required but only ${ + args.length + } present`, + ); + } +} + +function callCallback(behavior, args) { + if (typeof behavior.callArgAt === "number") { + ensureArgs("callsArg", behavior, args); + const func = getCallback(behavior, args); + + if (typeof func !== "function") { + throw new TypeError(getCallbackError(behavior, func, args)); + } + + if (behavior.callbackAsync) { + nextTick(function () { + func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + }); + } else { + return func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + } + } + + return undefined; +} + +const proto = { + create: function create(stub) { + const behavior = extend({}, proto); + delete behavior.create; + delete behavior.addBehavior; + delete behavior.createBehavior; + behavior.stub = stub; + + if (stub.defaultBehavior && stub.defaultBehavior.promiseLibrary) { + behavior.promiseLibrary = stub.defaultBehavior.promiseLibrary; + } + + return behavior; + }, + + isPresent: function isPresent() { + return ( + typeof this.callArgAt === "number" || + this.exception || + this.exceptionCreator || + typeof this.returnArgAt === "number" || + this.returnThis || + typeof this.resolveArgAt === "number" || + this.resolveThis || + typeof this.throwArgAt === "number" || + this.fakeFn || + this.returnValueDefined + ); + }, + + /*eslint complexity: ["error", 20]*/ + invoke: function invoke(context, args) { + /* + * callCallback (conditionally) calls ensureArgs + * + * Note: callCallback intentionally happens before + * everything else and cannot be moved lower + */ + const returnValue = callCallback(this, args); + + if (this.exception) { + throw this.exception; + } else if (this.exceptionCreator) { + this.exception = this.exceptionCreator(); + this.exceptionCreator = undefined; + throw this.exception; + } else if (typeof this.returnArgAt === "number") { + ensureArgs("returnsArg", this, args); + return args[this.returnArgAt]; + } else if (this.returnThis) { + return context; + } else if (typeof this.throwArgAt === "number") { + ensureArgs("throwsArg", this, args); + throw args[this.throwArgAt]; + } else if (this.fakeFn) { + return this.fakeFn.apply(context, args); + } else if (typeof this.resolveArgAt === "number") { + ensureArgs("resolvesArg", this, args); + return (this.promiseLibrary || Promise).resolve( + args[this.resolveArgAt], + ); + } else if (this.resolveThis) { + return (this.promiseLibrary || Promise).resolve(context); + } else if (this.resolve) { + return (this.promiseLibrary || Promise).resolve(this.returnValue); + } else if (this.reject) { + return (this.promiseLibrary || Promise).reject(this.returnValue); + } else if (this.callsThrough) { + const wrappedMethod = this.effectiveWrappedMethod(); + + return wrappedMethod.apply(context, args); + } else if (this.callsThroughWithNew) { + // Get the original method (assumed to be a constructor in this case) + const WrappedClass = this.effectiveWrappedMethod(); + // Turn the arguments object into a normal array + const argsArray = slice(args); + // Call the constructor + const F = WrappedClass.bind.apply( + WrappedClass, + concat([null], argsArray), + ); + return new F(); + } else if (typeof this.returnValue !== "undefined") { + return this.returnValue; + } else if (typeof this.callArgAt === "number") { + return returnValue; + } + + return this.returnValue; + }, + + effectiveWrappedMethod: function effectiveWrappedMethod() { + for (let stubb = this.stub; stubb; stubb = stubb.parent) { + if (stubb.wrappedMethod) { + return stubb.wrappedMethod; + } + } + throw new Error("Unable to find wrapped method"); + }, + + onCall: function onCall(index) { + return this.stub.onCall(index); + }, + + onFirstCall: function onFirstCall() { + return this.stub.onFirstCall(); + }, + + onSecondCall: function onSecondCall() { + return this.stub.onSecondCall(); + }, + + onThirdCall: function onThirdCall() { + return this.stub.onThirdCall(); + }, + + withArgs: function withArgs(/* arguments */) { + throw new Error( + 'Defining a stub by invoking "stub.onCall(...).withArgs(...)" ' + + 'is not supported. Use "stub.withArgs(...).onCall(...)" ' + + "to define sequential behavior for calls with certain arguments.", + ); + }, +}; + +function createBehavior(behaviorMethod) { + return function () { + this.defaultBehavior = this.defaultBehavior || proto.create(this); + this.defaultBehavior[behaviorMethod].apply( + this.defaultBehavior, + arguments, + ); + return this; + }; +} + +function addBehavior(stub, name, fn) { + proto[name] = function () { + fn.apply(this, concat([this], slice(arguments))); + return this.stub || this; + }; + + stub[name] = createBehavior(name); +} + +proto.addBehavior = addBehavior; +proto.createBehavior = createBehavior; + +const asyncBehaviors = exportAsyncBehaviors(proto); + +module.exports = extend.nonEnum({}, proto, asyncBehaviors); + +},{"./util/core/export-async-behaviors":24,"./util/core/extend":25,"./util/core/next-tick":33,"@sinonjs/commons":46}],5:[function(require,module,exports){ +"use strict"; + +const walk = require("./util/core/walk"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const push = require("@sinonjs/commons").prototypes.array.push; + +function collectMethod(methods, object, prop, propOwner) { + if ( + typeof getPropertyDescriptor(propOwner, prop).value === "function" && + hasOwnProperty(object, prop) + ) { + push(methods, object[prop]); + } +} + +// This function returns an array of all the own methods on the passed object +function collectOwnMethods(object) { + const methods = []; + + walk(object, collectMethod.bind(null, methods, object)); + + return methods; +} + +module.exports = collectOwnMethods; + +},{"./util/core/get-property-descriptor":28,"./util/core/walk":37,"@sinonjs/commons":46}],6:[function(require,module,exports){ +"use strict"; + +module.exports = class Colorizer { + constructor(supportsColor = require("supports-color")) { + this.supportsColor = supportsColor; + } + + /** + * Should be renamed to true #privateField + * when we can ensure ES2022 support + * + * @private + */ + colorize(str, color) { + if (this.supportsColor.stdout === false) { + return str; + } + + return `\x1b[${color}m${str}\x1b[0m`; + } + + red(str) { + return this.colorize(str, 31); + } + + green(str) { + return this.colorize(str, 32); + } + + cyan(str) { + return this.colorize(str, 96); + } + + white(str) { + return this.colorize(str, 39); + } + + bold(str) { + return this.colorize(str, 1); + } +}; + +},{"supports-color":93}],7:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Sandbox = require("./sandbox"); + +const forEach = arrayProto.forEach; +const push = arrayProto.push; + +function prepareSandboxFromConfig(config) { + const sandbox = new Sandbox({ assertOptions: config.assertOptions }); + + if (config.useFakeTimers) { + if (typeof config.useFakeTimers === "object") { + sandbox.useFakeTimers(config.useFakeTimers); + } else { + sandbox.useFakeTimers(); + } + } + + return sandbox; +} + +function exposeValue(sandbox, config, key, value) { + if (!value) { + return; + } + + if (config.injectInto && !(key in config.injectInto)) { + config.injectInto[key] = value; + push(sandbox.injectedKeys, key); + } else { + push(sandbox.args, value); + } +} + +/** + * Options to customize a sandbox + * + * The sandbox's methods can be injected into another object for + * convenience. The `injectInto` configuration option can name an + * object to add properties to. + * + * @typedef {object} SandboxConfig + * @property {string[]} properties The properties of the API to expose on the sandbox. Examples: ['spy', 'fake', 'restore'] + * @property {object} injectInto an object in which to inject properties from the sandbox (a facade). This is mostly an integration feature (sinon-test being one). + * @property {boolean} useFakeTimers whether timers are faked by default + * @property {object} [assertOptions] see CreateAssertOptions in ./assert + * + * This type def is really suffering from JSDoc not having standardized + * how to reference types defined in other modules :( + */ + +/** + * A configured sinon sandbox (private type) + * + * @typedef {object} ConfiguredSinonSandboxType + * @private + * @augments Sandbox + * @property {string[]} injectedKeys the keys that have been injected (from config.injectInto) + * @property {*[]} args the arguments for the sandbox + */ + +/** + * Create a sandbox + * + * As of Sinon 5 the `sinon` instance itself is a Sandbox, so you + * hardly ever need to create additional instances for the sake of testing + * + * @param config {SandboxConfig} + * @returns {Sandbox} + */ +function createSandbox(config) { + if (!config) { + return new Sandbox(); + } + + const configuredSandbox = prepareSandboxFromConfig(config); + configuredSandbox.args = configuredSandbox.args || []; + configuredSandbox.injectedKeys = []; + configuredSandbox.injectInto = config.injectInto; + const exposed = configuredSandbox.inject({}); + + if (config.properties) { + forEach(config.properties, function (prop) { + const value = + exposed[prop] || (prop === "sandbox" && configuredSandbox); + exposeValue(configuredSandbox, config, prop, value); + }); + } else { + exposeValue(configuredSandbox, config, "sandbox"); + } + + return configuredSandbox; +} + +module.exports = createSandbox; + +},{"./sandbox":19,"@sinonjs/commons":46}],8:[function(require,module,exports){ +"use strict"; + +const stub = require("./stub"); +const sinonType = require("./util/core/sinon-type"); +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function isStub(value) { + return sinonType.get(value) === "stub"; +} + +module.exports = function createStubInstance(constructor, overrides) { + if (typeof constructor !== "function") { + throw new TypeError("The constructor should be a function."); + } + + const stubInstance = Object.create(constructor.prototype); + sinonType.set(stubInstance, "stub-instance"); + + const stubbedObject = stub(stubInstance); + + forEach(Object.keys(overrides || {}), function (propertyName) { + if (propertyName in stubbedObject) { + const value = overrides[propertyName]; + if (isStub(value)) { + stubbedObject[propertyName] = value; + } else { + stubbedObject[propertyName].returns(value); + } + } else { + throw new Error( + `Cannot stub ${propertyName}. Property does not exist!`, + ); + } + }); + return stubbedObject; +}; + +},{"./stub":22,"./util/core/sinon-type":34,"@sinonjs/commons":46}],9:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const exportAsyncBehaviors = require("./util/core/export-async-behaviors"); +const extend = require("./util/core/extend"); + +const slice = arrayProto.slice; + +const useLeftMostCallback = -1; +const useRightMostCallback = -2; + +function throwsException(fake, error, message) { + if (typeof error === "function") { + fake.exceptionCreator = error; + } else if (typeof error === "string") { + fake.exceptionCreator = function () { + const newException = new Error( + message || `Sinon-provided ${error}`, + ); + newException.name = error; + return newException; + }; + } else if (!error) { + fake.exceptionCreator = function () { + return new Error("Error"); + }; + } else { + fake.exception = error; + } +} + +const defaultBehaviors = { + callsFake: function callsFake(fake, fn) { + fake.fakeFn = fn; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.callsThrough = false; + }, + + callsArg: function callsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOn: function callsArgOn(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgWith: function callsArgWith(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOnWith: function callsArgWith(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + yields: function (fake) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + yieldsRight: function (fake) { + fake.callArgAt = useRightMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsOn: function (fake, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsTo: function (fake, prop) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsToOn: function (fake, prop, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.fakeFn = undefined; + }, + + throws: throwsException, + throwsException: throwsException, + + returns: function returns(fake, value) { + fake.callsThrough = false; + fake.returnValue = value; + fake.resolve = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + }, + + returnsArg: function returnsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.returnArgAt = index; + }, + + throwsArg: function throwsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.throwArgAt = index; + }, + + returnsThis: function returnsThis(fake) { + fake.returnThis = true; + fake.callsThrough = false; + }, + + resolves: function resolves(fake, value) { + fake.returnValue = value; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + resolvesArg: function resolvesArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.resolveArgAt = index; + fake.returnValue = undefined; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + rejects: function rejects(fake, error, message) { + let reason; + if (typeof error === "string") { + reason = new Error(message || ""); + reason.name = error; + } else if (!error) { + reason = new Error("Error"); + } else { + reason = error; + } + fake.returnValue = reason; + fake.resolve = false; + fake.resolveThis = false; + fake.reject = true; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + + return fake; + }, + + resolvesThis: function resolvesThis(fake) { + fake.returnValue = undefined; + fake.resolve = false; + fake.resolveThis = true; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + callThrough: function callThrough(fake) { + fake.callsThrough = true; + }, + + callThroughWithNew: function callThroughWithNew(fake) { + fake.callsThroughWithNew = true; + }, + + get: function get(fake, getterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + get: getterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }); + + return fake; + }, + + set: function set(fake, setterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty( + rootStub.rootObj, + rootStub.propName, + // eslint-disable-next-line accessor-pairs + { + set: setterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }, + ); + + return fake; + }, + + value: function value(fake, newVal) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + value: newVal, + enumerable: true, + writable: true, + configurable: + rootStub.shadowsPropOnPrototype || + isPropertyConfigurable(rootStub.rootObj, rootStub.propName), + }); + + return fake; + }, +}; + +const asyncBehaviors = exportAsyncBehaviors(defaultBehaviors); + +module.exports = extend({}, defaultBehaviors, asyncBehaviors); + +},{"./util/core/export-async-behaviors":24,"./util/core/extend":25,"./util/core/is-property-configurable":31,"@sinonjs/commons":46}],10:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const nextTick = require("./util/core/next-tick"); + +const slice = arrayProto.slice; + +module.exports = fake; + +/** + * Returns a `fake` that records all calls, arguments and return values. + * + * When an `f` argument is supplied, this implementation will be used. + * + * @example + * // create an empty fake + * var f1 = sinon.fake(); + * + * f1(); + * + * f1.calledOnce() + * // true + * + * @example + * function greet(greeting) { + * console.log(`Hello ${greeting}`); + * } + * + * // create a fake with implementation + * var f2 = sinon.fake(greet); + * + * // Hello world + * f2("world"); + * + * f2.calledWith("world"); + * // true + * + * @param {Function|undefined} f + * @returns {Function} + * @namespace + */ +function fake(f) { + if (arguments.length > 0 && typeof f !== "function") { + throw new TypeError("Expected f argument to be a Function"); + } + + return wrapFunc(f); +} + +/** + * Creates a `fake` that returns the provided `value`, as well as recording all + * calls, arguments and return values. + * + * @example + * var f1 = sinon.fake.returns(42); + * + * f1(); + * // 42 + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.returns = function returns(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return value; + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that throws an Error. + * If the `value` argument does not have Error in its prototype chain, it will + * be used for creating a new error. + * + * @example + * var f1 = sinon.fake.throws("hello"); + * + * f1(); + * // Uncaught Error: hello + * + * @example + * var f2 = sinon.fake.throws(new TypeError("Invalid argument")); + * + * f2(); + * // Uncaught TypeError: Invalid argument + * + * @memberof fake + * @param {*|Error} value + * @returns {Function} + */ +fake.throws = function throws(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + throw getError(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that resolves to the passed `value` + * argument. + * + * @example + * var f1 = sinon.fake.resolves("apple pie"); + * + * await f1(); + * // "apple pie" + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.resolves = function resolves(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.resolve(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that rejects to the passed `value` + * argument. When `value` does not have Error in its prototype chain, it will be + * wrapped in an Error. + * + * @example + * var f1 = sinon.fake.rejects(":("); + * + * try { + * await f1(); + * } catch (error) { + * console.log(error); + * // ":(" + * } + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.rejects = function rejects(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.reject(getError(value)); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback with the defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * // "apple*pie" + * + * @memberof fake + * @returns {Function} + */ +fake.yields = function yields() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + + callback.apply(null, values); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback **asynchronously** with the + * defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * + * setTimeout(() => { + * // "apple*pie" + * }); + * + * @memberof fake + * @returns {Function} + */ +fake.yieldsAsync = function yieldsAsync() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + nextTick(function () { + callback.apply(null, values); + }); + } + + return wrapFunc(f); +}; + +let uuid = 0; +/** + * Creates a proxy (sinon concept) from the passed function. + * + * @private + * @param {Function} f + * @returns {Function} + */ +function wrapFunc(f) { + const fakeInstance = function () { + let firstArg, lastArg; + + if (arguments.length > 0) { + firstArg = arguments[0]; + lastArg = arguments[arguments.length - 1]; + } + + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + /* eslint-disable no-use-before-define */ + proxy.firstArg = firstArg; + proxy.lastArg = lastArg; + proxy.callback = callback; + + return f && f.apply(this, arguments); + }; + const proxy = createProxy(fakeInstance, f || fakeInstance); + + proxy.displayName = "fake"; + proxy.id = `fake#${uuid++}`; + + return proxy; +} + +/** + * Returns an Error instance from the passed value, if the value is not + * already an Error instance. + * + * @private + * @param {*} value [description] + * @returns {Error} [description] + */ +function getError(value) { + return value instanceof Error ? value : new Error(value); +} + +},{"./proxy":17,"./util/core/next-tick":33,"@sinonjs/commons":46}],11:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyInvoke = require("./proxy-invoke"); +const proxyCallToString = require("./proxy-call").toString; +const timesInWords = require("./util/core/times-in-words"); +const extend = require("./util/core/extend"); +const match = require("@sinonjs/samsam").createMatcher; +const stub = require("./stub"); +const assert = require("./assert"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const every = arrayProto.every; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const slice = arrayProto.slice; + +function callCountInWords(callCount) { + if (callCount === 0) { + return "never called"; + } + + return `called ${timesInWords(callCount)}`; +} + +function expectedCallCountInWords(expectation) { + const min = expectation.minCalls; + const max = expectation.maxCalls; + + if (typeof min === "number" && typeof max === "number") { + let str = timesInWords(min); + + if (min !== max) { + str = `at least ${str} and at most ${timesInWords(max)}`; + } + + return str; + } + + if (typeof min === "number") { + return `at least ${timesInWords(min)}`; + } + + return `at most ${timesInWords(max)}`; +} + +function receivedMinCalls(expectation) { + const hasMinLimit = typeof expectation.minCalls === "number"; + return !hasMinLimit || expectation.callCount >= expectation.minCalls; +} + +function receivedMaxCalls(expectation) { + if (typeof expectation.maxCalls !== "number") { + return false; + } + + return expectation.callCount === expectation.maxCalls; +} + +function verifyMatcher(possibleMatcher, arg) { + const isMatcher = match.isMatcher(possibleMatcher); + + return (isMatcher && possibleMatcher.test(arg)) || true; +} + +const mockExpectation = { + minCalls: 1, + maxCalls: 1, + + create: function create(methodName) { + const expectation = extend.nonEnum(stub(), mockExpectation); + delete expectation.create; + expectation.method = methodName; + + return expectation; + }, + + invoke: function invoke(func, thisValue, args) { + this.verifyCallAllowed(thisValue, args); + + return proxyInvoke.apply(this, arguments); + }, + + atLeast: function atLeast(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.maxCalls = null; + this.limitsSet = true; + } + + this.minCalls = num; + + return this; + }, + + atMost: function atMost(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.minCalls = null; + this.limitsSet = true; + } + + this.maxCalls = num; + + return this; + }, + + never: function never() { + return this.exactly(0); + }, + + once: function once() { + return this.exactly(1); + }, + + twice: function twice() { + return this.exactly(2); + }, + + thrice: function thrice() { + return this.exactly(3); + }, + + exactly: function exactly(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not a number`); + } + + this.atLeast(num); + return this.atMost(num); + }, + + met: function met() { + return !this.failed && receivedMinCalls(this); + }, + + verifyCallAllowed: function verifyCallAllowed(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (receivedMaxCalls(this)) { + this.failed = true; + mockExpectation.fail( + `${this.method} already called ${timesInWords(this.maxCalls)}`, + ); + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + mockExpectation.fail( + `${this.method} called with ${valueToString( + thisValue, + )} as thisValue, expected ${valueToString(this.expectedThis)}`, + ); + } + + if (!("expectedArguments" in this)) { + return; + } + + if (!args) { + mockExpectation.fail( + `${this.method} received no arguments, expected ${inspect( + expectedArguments, + )}`, + ); + } + + if (args.length < expectedArguments.length) { + mockExpectation.fail( + `${this.method} received too few arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + if ( + this.expectsExactArgCount && + args.length !== expectedArguments.length + ) { + mockExpectation.fail( + `${this.method} received too many arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + forEach( + expectedArguments, + function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, args[i])) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, didn't match ${String(expectedArguments)}`, + ); + } + + if (!deepEqual(args[i], expectedArgument)) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, expected ${inspect(expectedArguments)}`, + ); + } + }, + this, + ); + }, + + allowsCall: function allowsCall(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (this.met() && receivedMaxCalls(this)) { + return false; + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + return false; + } + + if (!("expectedArguments" in this)) { + return true; + } + + // eslint-disable-next-line no-underscore-dangle + const _args = args || []; + + if (_args.length < expectedArguments.length) { + return false; + } + + if ( + this.expectsExactArgCount && + _args.length !== expectedArguments.length + ) { + return false; + } + + return every(expectedArguments, function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, _args[i])) { + return false; + } + + if (!deepEqual(_args[i], expectedArgument)) { + return false; + } + + return true; + }); + }, + + withArgs: function withArgs() { + this.expectedArguments = slice(arguments); + return this; + }, + + withExactArgs: function withExactArgs() { + this.withArgs.apply(this, arguments); + this.expectsExactArgCount = true; + return this; + }, + + on: function on(thisValue) { + this.expectedThis = thisValue; + return this; + }, + + toString: function () { + const args = slice(this.expectedArguments || []); + + if (!this.expectsExactArgCount) { + push(args, "[...]"); + } + + const callStr = proxyCallToString.call({ + proxy: this.method || "anonymous mock expectation", + args: args, + }); + + const message = `${callStr.replace( + ", [...", + "[, ...", + )} ${expectedCallCountInWords(this)}`; + + if (this.met()) { + return `Expectation met: ${message}`; + } + + return `Expected ${message} (${callCountInWords(this.callCount)})`; + }, + + verify: function verify() { + if (!this.met()) { + mockExpectation.fail(String(this)); + } else { + mockExpectation.pass(String(this)); + } + + return true; + }, + + pass: function pass(message) { + assert.pass(message); + }, + + fail: function fail(message) { + const exception = new Error(message); + exception.name = "ExpectationError"; + + throw exception; + }, +}; + +module.exports = mockExpectation; + +},{"./assert":3,"./proxy-call":15,"./proxy-invoke":16,"./stub":22,"./util/core/extend":25,"./util/core/times-in-words":35,"@sinonjs/commons":46,"@sinonjs/samsam":86,"util":90}],12:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const mockExpectation = require("./mock-expectation"); +const proxyCallToString = require("./proxy-call").toString; +const extend = require("./util/core/extend"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const wrapMethod = require("./util/core/wrap-method"); + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const every = arrayProto.every; +const join = arrayProto.join; +const push = arrayProto.push; +const slice = arrayProto.slice; +const unshift = arrayProto.unshift; + +function mock(object) { + if (!object || typeof object === "string") { + return mockExpectation.create(object ? object : "Anonymous mock"); + } + + return mock.create(object); +} + +function each(collection, callback) { + const col = collection || []; + + forEach(col, callback); +} + +function arrayEquals(arr1, arr2, compareLength) { + if (compareLength && arr1.length !== arr2.length) { + return false; + } + + return every(arr1, function (element, i) { + return deepEqual(arr2[i], element); + }); +} + +extend(mock, { + create: function create(object) { + if (!object) { + throw new TypeError("object is null"); + } + + const mockObject = extend.nonEnum({}, mock, { object: object }); + delete mockObject.create; + + return mockObject; + }, + + expects: function expects(method) { + if (!method) { + throw new TypeError("method is falsy"); + } + + if (!this.expectations) { + this.expectations = {}; + this.proxies = []; + this.failures = []; + } + + if (!this.expectations[method]) { + this.expectations[method] = []; + const mockObject = this; + + wrapMethod(this.object, method, function () { + return mockObject.invokeMethod(method, this, arguments); + }); + + push(this.proxies, method); + } + + const expectation = mockExpectation.create(method); + expectation.wrappedMethod = this.object[method].wrappedMethod; + push(this.expectations[method], expectation); + + return expectation; + }, + + restore: function restore() { + const object = this.object; + + each(this.proxies, function (proxy) { + if (typeof object[proxy].restore === "function") { + object[proxy].restore(); + } + }); + }, + + verify: function verify() { + const expectations = this.expectations || {}; + const messages = this.failures ? slice(this.failures) : []; + const met = []; + + each(this.proxies, function (proxy) { + each(expectations[proxy], function (expectation) { + if (!expectation.met()) { + push(messages, String(expectation)); + } else { + push(met, String(expectation)); + } + }); + }); + + this.restore(); + + if (messages.length > 0) { + mockExpectation.fail(join(concat(messages, met), "\n")); + } else if (met.length > 0) { + mockExpectation.pass(join(concat(messages, met), "\n")); + } + + return true; + }, + + invokeMethod: function invokeMethod(method, thisValue, args) { + /* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */ + /* eslint consistent-return: "off" */ + const expectations = + this.expectations && this.expectations[method] + ? this.expectations[method] + : []; + const currentArgs = args || []; + let available; + + const expectationsWithMatchingArgs = filter( + expectations, + function (expectation) { + const expectedArgs = expectation.expectedArguments || []; + + return arrayEquals( + expectedArgs, + currentArgs, + expectation.expectsExactArgCount, + ); + }, + ); + + const expectationsToApply = filter( + expectationsWithMatchingArgs, + function (expectation) { + return ( + !expectation.met() && + expectation.allowsCall(thisValue, args) + ); + }, + ); + + if (expectationsToApply.length > 0) { + return expectationsToApply[0].apply(thisValue, args); + } + + const messages = []; + let exhausted = 0; + + forEach(expectationsWithMatchingArgs, function (expectation) { + if (expectation.allowsCall(thisValue, args)) { + available = available || expectation; + } else { + exhausted += 1; + } + }); + + if (available && exhausted === 0) { + return available.apply(thisValue, args); + } + + forEach(expectations, function (expectation) { + push(messages, ` ${String(expectation)}`); + }); + + unshift( + messages, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + })}`, + ); + + const err = new Error(); + if (!err.stack) { + // PhantomJS does not serialize the stack trace until the error has been thrown + try { + throw err; + } catch (e) { + /* empty */ + } + } + push( + this.failures, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + stack: err.stack, + })}`, + ); + + mockExpectation.fail(join(messages, "\n")); + }, +}); + +module.exports = mock; + +},{"./mock-expectation":11,"./proxy-call":15,"./util/core/extend":25,"./util/core/wrap-method":38,"@sinonjs/commons":46,"@sinonjs/samsam":86}],13:[function(require,module,exports){ +"use strict"; + +const fake = require("./fake"); +const isRestorable = require("./util/core/is-restorable"); + +const STATUS_PENDING = "pending"; +const STATUS_RESOLVED = "resolved"; +const STATUS_REJECTED = "rejected"; + +/** + * Returns a fake for a given function or undefined. If no function is given, a + * new fake is returned. If the given function is already a fake, it is + * returned as is. Otherwise the given function is wrapped in a new fake. + * + * @param {Function} [executor] The optional executor function. + * @returns {Function} + */ +function getFakeExecutor(executor) { + if (isRestorable(executor)) { + return executor; + } + if (executor) { + return fake(executor); + } + return fake(); +} + +/** + * Returns a new promise that exposes it's internal `status`, `resolvedValue` + * and `rejectedValue` and can be resolved or rejected from the outside by + * calling `resolve(value)` or `reject(reason)`. + * + * @param {Function} [executor] The optional executor function. + * @returns {Promise} + */ +function promise(executor) { + const fakeExecutor = getFakeExecutor(executor); + const sinonPromise = new Promise(fakeExecutor); + + sinonPromise.status = STATUS_PENDING; + sinonPromise + .then(function (value) { + sinonPromise.status = STATUS_RESOLVED; + sinonPromise.resolvedValue = value; + }) + .catch(function (reason) { + sinonPromise.status = STATUS_REJECTED; + sinonPromise.rejectedValue = reason; + }); + + /** + * Resolves or rejects the promise with the given status and value. + * + * @param {string} status + * @param {*} value + * @param {Function} callback + */ + function finalize(status, value, callback) { + if (sinonPromise.status !== STATUS_PENDING) { + throw new Error(`Promise already ${sinonPromise.status}`); + } + + sinonPromise.status = status; + callback(value); + } + + sinonPromise.resolve = function (value) { + finalize(STATUS_RESOLVED, value, fakeExecutor.firstCall.args[0]); + // Return the promise so that callers can await it: + return sinonPromise; + }; + sinonPromise.reject = function (reason) { + finalize(STATUS_REJECTED, reason, fakeExecutor.firstCall.args[1]); + // Return a new promise that resolves when the sinon promise was + // rejected, so that callers can await it: + return new Promise(function (resolve) { + sinonPromise.catch(() => resolve()); + }); + }; + + return sinonPromise; +} + +module.exports = promise; + +},{"./fake":10,"./util/core/is-restorable":32}],14:[function(require,module,exports){ +"use strict"; + +const push = require("@sinonjs/commons").prototypes.array.push; + +exports.incrementCallCount = function incrementCallCount(proxy) { + proxy.called = true; + proxy.callCount += 1; + proxy.notCalled = false; + proxy.calledOnce = proxy.callCount === 1; + proxy.calledTwice = proxy.callCount === 2; + proxy.calledThrice = proxy.callCount === 3; +}; + +exports.createCallProperties = function createCallProperties(proxy) { + proxy.firstCall = proxy.getCall(0); + proxy.secondCall = proxy.getCall(1); + proxy.thirdCall = proxy.getCall(2); + proxy.lastCall = proxy.getCall(proxy.callCount - 1); +}; + +exports.delegateToCalls = function delegateToCalls( + proxy, + method, + matchAny, + actual, + returnsValues, + notCalled, + totalCallCount, +) { + proxy[method] = function () { + if (!this.called) { + if (notCalled) { + return notCalled.apply(this, arguments); + } + return false; + } + + if (totalCallCount !== undefined && this.callCount !== totalCallCount) { + return false; + } + + let currentCall; + let matches = 0; + const returnValues = []; + + for (let i = 0, l = this.callCount; i < l; i += 1) { + currentCall = this.getCall(i); + const returnValue = currentCall[actual || method].apply( + currentCall, + arguments, + ); + push(returnValues, returnValue); + if (returnValue) { + matches += 1; + + if (matchAny) { + return true; + } + } + } + + if (returnsValues) { + return returnValues; + } + return matches === this.callCount; + }; +}; + +},{"@sinonjs/commons":46}],15:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const match = require("@sinonjs/samsam").createMatcher; +const deepEqual = require("@sinonjs/samsam").deepEqual; +const functionName = require("@sinonjs/commons").functionName; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const join = arrayProto.join; +const map = arrayProto.map; +const reduce = arrayProto.reduce; +const slice = arrayProto.slice; + +/** + * @param proxy + * @param text + * @param args + */ +function throwYieldError(proxy, text, args) { + let msg = functionName(proxy) + text; + if (args.length) { + msg += ` Received [${join(slice(args), ", ")}]`; + } + throw new Error(msg); +} + +const callProto = { + calledOn: function calledOn(thisValue) { + if (match.isMatcher(thisValue)) { + return thisValue.test(this.thisValue); + } + return this.thisValue === thisValue; + }, + + calledWith: function calledWith() { + const self = this; + const calledWithArgs = slice(arguments); + + if (calledWithArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithArgs, + function (prev, arg, i) { + return prev && deepEqual(self.args[i], arg); + }, + true, + ); + }, + + calledWithMatch: function calledWithMatch() { + const self = this; + const calledWithMatchArgs = slice(arguments); + + if (calledWithMatchArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithMatchArgs, + function (prev, expectation, i) { + const actual = self.args[i]; + + return prev && match(expectation).test(actual); + }, + true, + ); + }, + + calledWithExactly: function calledWithExactly() { + return ( + arguments.length === this.args.length && + this.calledWith.apply(this, arguments) + ); + }, + + notCalledWith: function notCalledWith() { + return !this.calledWith.apply(this, arguments); + }, + + notCalledWithMatch: function notCalledWithMatch() { + return !this.calledWithMatch.apply(this, arguments); + }, + + returned: function returned(value) { + return deepEqual(this.returnValue, value); + }, + + threw: function threw(error) { + if (typeof error === "undefined" || !this.exception) { + return Boolean(this.exception); + } + + return this.exception === error || this.exception.name === error; + }, + + calledWithNew: function calledWithNew() { + return this.proxy.prototype && this.thisValue instanceof this.proxy; + }, + + calledBefore: function (other) { + return this.callId < other.callId; + }, + + calledAfter: function (other) { + return this.callId > other.callId; + }, + + calledImmediatelyBefore: function (other) { + return this.callId === other.callId - 1; + }, + + calledImmediatelyAfter: function (other) { + return this.callId === other.callId + 1; + }, + + callArg: function (pos) { + this.ensureArgIsAFunction(pos); + return this.args[pos](); + }, + + callArgOn: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + return this.args[pos].apply(thisValue); + }, + + callArgWith: function (pos) { + return this.callArgOnWith.apply( + this, + concat([pos, null], slice(arguments, 1)), + ); + }, + + callArgOnWith: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + const args = slice(arguments, 2); + return this.args[pos].apply(thisValue, args); + }, + + throwArg: function (pos) { + if (pos > this.args.length) { + throw new TypeError( + `Not enough arguments: ${pos} required but only ${this.args.length} present`, + ); + } + + throw this.args[pos]; + }, + + yield: function () { + return this.yieldOn.apply(this, concat([null], slice(arguments, 0))); + }, + + yieldOn: function (thisValue) { + const args = slice(this.args); + const yieldFn = filter(args, function (arg) { + return typeof arg === "function"; + })[0]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + " cannot yield since no callback was passed.", + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 1)); + }, + + yieldTo: function (prop) { + return this.yieldToOn.apply( + this, + concat([prop, null], slice(arguments, 1)), + ); + }, + + yieldToOn: function (prop, thisValue) { + const args = slice(this.args); + const yieldArg = filter(args, function (arg) { + return arg && typeof arg[prop] === "function"; + })[0]; + const yieldFn = yieldArg && yieldArg[prop]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + ` cannot yield to '${valueToString( + prop, + )}' since no callback was passed.`, + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 2)); + }, + + toString: function () { + if (!this.args) { + return ":("; + } + + let callStr = this.proxy ? `${String(this.proxy)}(` : ""; + const formattedArgs = map(this.args, function (arg) { + return inspect(arg); + }); + + callStr = `${callStr + join(formattedArgs, ", ")})`; + + if (typeof this.returnValue !== "undefined") { + callStr += ` => ${inspect(this.returnValue)}`; + } + + if (this.exception) { + callStr += ` !${this.exception.name}`; + + if (this.exception.message) { + callStr += `(${this.exception.message})`; + } + } + if (this.stack) { + // If we have a stack, add the first frame that's in end-user code + // Skip the first two frames because they will refer to Sinon code + callStr += (this.stack.split("\n")[3] || "unknown").replace( + /^\s*(?:at\s+|@)?/, + " at ", + ); + } + + return callStr; + }, + + ensureArgIsAFunction: function (pos) { + if (typeof this.args[pos] !== "function") { + throw new TypeError( + `Expected argument at position ${pos} to be a Function, but was ${typeof this + .args[pos]}`, + ); + } + }, +}; +Object.defineProperty(callProto, "stack", { + enumerable: true, + configurable: true, + get: function () { + return (this.errorWithCallStack && this.errorWithCallStack.stack) || ""; + }, +}); + +callProto.invokeCallback = callProto.yield; + +/** + * @param proxy + * @param thisValue + * @param args + * @param returnValue + * @param exception + * @param id + * @param errorWithCallStack + * + * @returns {object} proxyCall + */ +function createProxyCall( + proxy, + thisValue, + args, + returnValue, + exception, + id, + errorWithCallStack, +) { + if (typeof id !== "number") { + throw new TypeError("Call id is not a number"); + } + + let firstArg, lastArg; + + if (args.length > 0) { + firstArg = args[0]; + lastArg = args[args.length - 1]; + } + + const proxyCall = Object.create(callProto); + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + proxyCall.proxy = proxy; + proxyCall.thisValue = thisValue; + proxyCall.args = args; + proxyCall.firstArg = firstArg; + proxyCall.lastArg = lastArg; + proxyCall.callback = callback; + proxyCall.returnValue = returnValue; + proxyCall.exception = exception; + proxyCall.callId = id; + proxyCall.errorWithCallStack = errorWithCallStack; + + return proxyCall; +} +createProxyCall.toString = callProto.toString; // used by mocks + +module.exports = createProxyCall; + +},{"@sinonjs/commons":46,"@sinonjs/samsam":86,"util":90}],16:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyCallUtil = require("./proxy-call-util"); + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const concat = arrayProto.concat; +const ErrorConstructor = Error.prototype.constructor; +const bind = Function.prototype.bind; + +let callId = 0; + +module.exports = function invoke(func, thisValue, args) { + const matchings = this.matchingFakes(args); + const currentCallId = callId++; + let exception, returnValue; + + proxyCallUtil.incrementCallCount(this); + push(this.thisValues, thisValue); + push(this.args, args); + push(this.callIds, currentCallId); + forEach(matchings, function (matching) { + proxyCallUtil.incrementCallCount(matching); + push(matching.thisValues, thisValue); + push(matching.args, args); + push(matching.callIds, currentCallId); + }); + + // Make call properties available from within the spied function: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + try { + this.invoking = true; + + const thisCall = this.getCall(this.callCount - 1); + + if (thisCall.calledWithNew()) { + // Call through with `new` + returnValue = new (bind.apply( + this.func || func, + concat([thisValue], args), + ))(); + + if ( + typeof returnValue !== "object" && + typeof returnValue !== "function" + ) { + returnValue = thisValue; + } + } else { + returnValue = (this.func || func).apply(thisValue, args); + } + } catch (e) { + exception = e; + } finally { + delete this.invoking; + } + + push(this.exceptions, exception); + push(this.returnValues, returnValue); + forEach(matchings, function (matching) { + push(matching.exceptions, exception); + push(matching.returnValues, returnValue); + }); + + const err = new ErrorConstructor(); + // 1. Please do not get stack at this point. It may be so very slow, and not actually used + // 2. PhantomJS does not serialize the stack trace until the error has been thrown: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack + try { + throw err; + } catch (e) { + /* empty */ + } + push(this.errorsWithCallStack, err); + forEach(matchings, function (matching) { + push(matching.errorsWithCallStack, err); + }); + + // Make return value and exception available in the calls: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + if (exception !== undefined) { + throw exception; + } + + return returnValue; +}; + +},{"./proxy-call-util":14,"@sinonjs/commons":46}],17:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const extend = require("./util/core/extend"); +const functionToString = require("./util/core/function-to-string"); +const proxyCall = require("./proxy-call"); +const proxyCallUtil = require("./proxy-call-util"); +const proxyInvoke = require("./proxy-invoke"); +const inspect = require("util").inspect; + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const slice = arrayProto.slice; + +const emptyFakes = Object.freeze([]); + +// Public API +const proxyApi = { + toString: functionToString, + + named: function named(name) { + this.displayName = name; + const nameDescriptor = Object.getOwnPropertyDescriptor(this, "name"); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + nameDescriptor.value = name; + Object.defineProperty(this, "name", nameDescriptor); + } + return this; + }, + + invoke: proxyInvoke, + + /* + * Hook for derived implementation to return fake instances matching the + * given arguments. + */ + matchingFakes: function (/*args, strict*/) { + return emptyFakes; + }, + + getCall: function getCall(index) { + let i = index; + if (i < 0) { + // Negative indices means counting backwards from the last call + i += this.callCount; + } + if (i < 0 || i >= this.callCount) { + return null; + } + + return proxyCall( + this, + this.thisValues[i], + this.args[i], + this.returnValues[i], + this.exceptions[i], + this.callIds[i], + this.errorsWithCallStack[i], + ); + }, + + getCalls: function () { + const calls = []; + let i; + + for (i = 0; i < this.callCount; i++) { + push(calls, this.getCall(i)); + } + + return calls; + }, + + calledBefore: function calledBefore(proxy) { + if (!this.called) { + return false; + } + + if (!proxy.called) { + return true; + } + + return this.callIds[0] < proxy.callIds[proxy.callIds.length - 1]; + }, + + calledAfter: function calledAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return this.callIds[this.callCount - 1] > proxy.callIds[0]; + }, + + calledImmediatelyBefore: function calledImmediatelyBefore(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] - 1 + ); + }, + + calledImmediatelyAfter: function calledImmediatelyAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] + 1 + ); + }, + + formatters: require("./spy-formatters"), + printf: function (format) { + const spyInstance = this; + const args = slice(arguments, 1); + let formatter; + + return (format || "").replace(/%(.)/g, function (match, specifier) { + formatter = proxyApi.formatters[specifier]; + + if (typeof formatter === "function") { + return String(formatter(spyInstance, args)); + } else if (!isNaN(parseInt(specifier, 10))) { + return inspect(args[specifier - 1]); + } + + return `%${specifier}`; + }); + }, + + resetHistory: function () { + if (this.invoking) { + const err = new Error( + "Cannot reset Sinon function while invoking it. " + + "Move the call to .resetHistory outside of the callback.", + ); + err.name = "InvalidResetException"; + throw err; + } + + this.called = false; + this.notCalled = true; + this.calledOnce = false; + this.calledTwice = false; + this.calledThrice = false; + this.callCount = 0; + this.firstCall = null; + this.secondCall = null; + this.thirdCall = null; + this.lastCall = null; + this.args = []; + this.firstArg = null; + this.lastArg = null; + this.returnValues = []; + this.thisValues = []; + this.exceptions = []; + this.callIds = []; + this.errorsWithCallStack = []; + + if (this.fakes) { + forEach(this.fakes, function (fake) { + fake.resetHistory(); + }); + } + + return this; + }, +}; + +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(proxyApi, "calledOn", true); +delegateToCalls(proxyApi, "alwaysCalledOn", false, "calledOn"); +delegateToCalls(proxyApi, "calledWith", true); +delegateToCalls( + proxyApi, + "calledOnceWith", + true, + "calledWith", + false, + undefined, + 1, +); +delegateToCalls(proxyApi, "calledWithMatch", true); +delegateToCalls(proxyApi, "alwaysCalledWith", false, "calledWith"); +delegateToCalls(proxyApi, "alwaysCalledWithMatch", false, "calledWithMatch"); +delegateToCalls(proxyApi, "calledWithExactly", true); +delegateToCalls( + proxyApi, + "calledOnceWithExactly", + true, + "calledWithExactly", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "calledOnceWithMatch", + true, + "calledWithMatch", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "alwaysCalledWithExactly", + false, + "calledWithExactly", +); +delegateToCalls( + proxyApi, + "neverCalledWith", + false, + "notCalledWith", + false, + function () { + return true; + }, +); +delegateToCalls( + proxyApi, + "neverCalledWithMatch", + false, + "notCalledWithMatch", + false, + function () { + return true; + }, +); +delegateToCalls(proxyApi, "threw", true); +delegateToCalls(proxyApi, "alwaysThrew", false, "threw"); +delegateToCalls(proxyApi, "returned", true); +delegateToCalls(proxyApi, "alwaysReturned", false, "returned"); +delegateToCalls(proxyApi, "calledWithNew", true); +delegateToCalls(proxyApi, "alwaysCalledWithNew", false, "calledWithNew"); + +function createProxy(func, originalFunc) { + const proxy = wrapFunction(func, originalFunc); + + // Inherit function properties: + extend(proxy, func); + + proxy.prototype = func.prototype; + + extend.nonEnum(proxy, proxyApi); + + return proxy; +} + +function wrapFunction(func, originalFunc) { + const arity = originalFunc.length; + let p; + // Do not change this to use an eval. Projects that depend on sinon block the use of eval. + // ref: https://github.com/sinonjs/sinon/issues/710 + switch (arity) { + /*eslint-disable no-unused-vars, max-len*/ + case 0: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 1: + p = function proxy(a) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 2: + p = function proxy(a, b) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 3: + p = function proxy(a, b, c) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 4: + p = function proxy(a, b, c, d) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 5: + p = function proxy(a, b, c, d, e) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 6: + p = function proxy(a, b, c, d, e, f) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 7: + p = function proxy(a, b, c, d, e, f, g) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 8: + p = function proxy(a, b, c, d, e, f, g, h) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 9: + p = function proxy(a, b, c, d, e, f, g, h, i) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 10: + p = function proxy(a, b, c, d, e, f, g, h, i, j) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 11: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 12: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k, l) { + return p.invoke(func, this, slice(arguments)); + }; + break; + default: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + /*eslint-enable*/ + } + const nameDescriptor = Object.getOwnPropertyDescriptor( + originalFunc, + "name", + ); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + Object.defineProperty(p, "name", nameDescriptor); + } + extend.nonEnum(p, { + isSinonProxy: true, + + called: false, + notCalled: true, + calledOnce: false, + calledTwice: false, + calledThrice: false, + callCount: 0, + firstCall: null, + firstArg: null, + secondCall: null, + thirdCall: null, + lastCall: null, + lastArg: null, + args: [], + returnValues: [], + thisValues: [], + exceptions: [], + callIds: [], + errorsWithCallStack: [], + }); + return p; +} + +module.exports = createProxy; + +},{"./proxy-call":15,"./proxy-call-util":14,"./proxy-invoke":16,"./spy-formatters":20,"./util/core/extend":25,"./util/core/function-to-string":26,"@sinonjs/commons":46,"util":90}],18:[function(require,module,exports){ +"use strict"; + +const walkObject = require("./util/core/walk-object"); + +function filter(object, property) { + return object[property].restore && object[property].restore.sinon; +} + +function restore(object, property) { + object[property].restore(); +} + +function restoreObject(object) { + return walkObject(restore, object, filter); +} + +module.exports = restoreObject; + +},{"./util/core/walk-object":36}],19:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const logger = require("@sinonjs/commons").deprecated; +const collectOwnMethods = require("./collect-own-methods"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const match = require("@sinonjs/samsam").createMatcher; +const sinonAssert = require("./assert"); +const sinonClock = require("./util/fake-timers"); +const sinonMock = require("./mock"); +const sinonSpy = require("./spy"); +const sinonStub = require("./stub"); +const sinonCreateStubInstance = require("./create-stub-instance"); +const sinonFake = require("./fake"); +const valueToString = require("@sinonjs/commons").valueToString; + +const DEFAULT_LEAK_THRESHOLD = 10000; + +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const reverse = arrayProto.reverse; + +function applyOnEach(fakes, method) { + const matchingFakes = filter(fakes, function (fake) { + return typeof fake[method] === "function"; + }); + + forEach(matchingFakes, function (fake) { + fake[method](); + }); +} + +function throwOnAccessors(descriptor) { + if (typeof descriptor.get === "function") { + throw new Error("Use sandbox.replaceGetter for replacing getters"); + } + + if (typeof descriptor.set === "function") { + throw new Error("Use sandbox.replaceSetter for replacing setters"); + } +} + +function verifySameType(object, property, replacement) { + if (typeof object[property] !== typeof replacement) { + throw new TypeError( + `Cannot replace ${typeof object[ + property + ]} with ${typeof replacement}`, + ); + } +} + +function checkForValidArguments(descriptor, property, replacement) { + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}. Perhaps you meant sandbox.define()?`, + ); + } + + if (typeof replacement === "undefined") { + throw new TypeError("Expected replacement argument to be defined"); + } +} + +/** + * A sinon sandbox + * + * @param opts + * @param {object} [opts.assertOptions] see the CreateAssertOptions in ./assert + * @class + */ +function Sandbox(opts = {}) { + const sandbox = this; + const assertOptions = opts.assertOptions || {}; + let fakeRestorers = []; + + let collection = []; + let loggedLeakWarning = false; + sandbox.leakThreshold = DEFAULT_LEAK_THRESHOLD; + + function addToCollection(object) { + if ( + push(collection, object) > sandbox.leakThreshold && + !loggedLeakWarning + ) { + // eslint-disable-next-line no-console + logger.printWarning( + "Potential memory leak detected; be sure to call restore() to clean up your sandbox. To suppress this warning, modify the leakThreshold property of your sandbox.", + ); + loggedLeakWarning = true; + } + } + + sandbox.assert = sinonAssert.createAssertObject(assertOptions); + + // this is for testing only + sandbox.getFakes = function getFakes() { + return collection; + }; + + sandbox.createStubInstance = function createStubInstance() { + const stubbed = sinonCreateStubInstance.apply(null, arguments); + + const ownMethods = collectOwnMethods(stubbed); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + + return stubbed; + }; + + sandbox.inject = function inject(obj) { + obj.spy = function () { + return sandbox.spy.apply(null, arguments); + }; + + obj.stub = function () { + return sandbox.stub.apply(null, arguments); + }; + + obj.mock = function () { + return sandbox.mock.apply(null, arguments); + }; + + obj.createStubInstance = function () { + return sandbox.createStubInstance.apply(sandbox, arguments); + }; + + obj.fake = function () { + return sandbox.fake.apply(null, arguments); + }; + + obj.define = function () { + return sandbox.define.apply(null, arguments); + }; + + obj.replace = function () { + return sandbox.replace.apply(null, arguments); + }; + + obj.replaceSetter = function () { + return sandbox.replaceSetter.apply(null, arguments); + }; + + obj.replaceGetter = function () { + return sandbox.replaceGetter.apply(null, arguments); + }; + + if (sandbox.clock) { + obj.clock = sandbox.clock; + } + + obj.match = match; + + return obj; + }; + + sandbox.mock = function mock() { + const m = sinonMock.apply(null, arguments); + + addToCollection(m); + + return m; + }; + + sandbox.reset = function reset() { + applyOnEach(collection, "reset"); + applyOnEach(collection, "resetHistory"); + }; + + sandbox.resetBehavior = function resetBehavior() { + applyOnEach(collection, "resetBehavior"); + }; + + sandbox.resetHistory = function resetHistory() { + function privateResetHistory(f) { + const method = f.resetHistory || f.reset; + if (method) { + method.call(f); + } + } + + forEach(collection, privateResetHistory); + }; + + sandbox.restore = function restore() { + if (arguments.length) { + throw new Error( + "sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()", + ); + } + + reverse(collection); + applyOnEach(collection, "restore"); + collection = []; + + forEach(fakeRestorers, function (restorer) { + restorer(); + }); + fakeRestorers = []; + + sandbox.restoreContext(); + }; + + sandbox.restoreContext = function restoreContext() { + if (!sandbox.injectedKeys) { + return; + } + + forEach(sandbox.injectedKeys, function (injectedKey) { + delete sandbox.injectInto[injectedKey]; + }); + + sandbox.injectedKeys.length = 0; + }; + + /** + * Creates a restorer function for the property + * + * @param {object|Function} object + * @param {string} property + * @param {boolean} forceAssignment + * @returns {Function} restorer function + */ + function getFakeRestorer(object, property, forceAssignment = false) { + const descriptor = getPropertyDescriptor(object, property); + const value = forceAssignment && object[property]; + + function restorer() { + if (forceAssignment) { + object[property] = value; + } else if (descriptor?.isOwn) { + Object.defineProperty(object, property, descriptor); + } else { + delete object[property]; + } + } + + restorer.object = object; + restorer.property = property; + return restorer; + } + + function verifyNotReplaced(object, property) { + forEach(fakeRestorers, function (fakeRestorer) { + if ( + fakeRestorer.object === object && + fakeRestorer.property === property + ) { + throw new TypeError( + `Attempted to replace ${property} which is already replaced`, + ); + } + }); + } + + /** + * Replace an existing property + * + * @param {object|Function} object + * @param {string} property + * @param {*} replacement a fake, stub, spy or any other value + * @returns {*} + */ + sandbox.replace = function replace(object, property, replacement) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + throwOnAccessors(descriptor); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.replace.usingAccessor = function replaceUsingAccessor( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property, true)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.define = function define(object, property, value) { + const descriptor = getPropertyDescriptor(object, property); + + if (descriptor) { + throw new TypeError( + `Cannot define the already existing property ${valueToString( + property, + )}. Perhaps you meant sandbox.replace()?`, + ); + } + + if (typeof value === "undefined") { + throw new TypeError("Expected value argument to be defined"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the defined property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = value; + + return value; + }; + + sandbox.replaceGetter = function replaceGetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.get !== "function") { + throw new Error("`object.property` is not a getter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + Object.defineProperty(object, property, { + get: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + sandbox.replaceSetter = function replaceSetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.set !== "function") { + throw new Error("`object.property` is not a setter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + // eslint-disable-next-line accessor-pairs + Object.defineProperty(object, property, { + set: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + function commonPostInitSetup(args, spy) { + const [object, property, types] = args; + + const isSpyingOnEntireObject = + typeof property === "undefined" && typeof object === "object"; + + if (isSpyingOnEntireObject) { + const ownMethods = collectOwnMethods(spy); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + } else if (Array.isArray(types)) { + for (const accessorType of types) { + addToCollection(spy[accessorType]); + } + } else { + addToCollection(spy); + } + + return spy; + } + + sandbox.spy = function spy() { + const createdSpy = sinonSpy.apply(sinonSpy, arguments); + return commonPostInitSetup(arguments, createdSpy); + }; + + sandbox.stub = function stub() { + const createdStub = sinonStub.apply(sinonStub, arguments); + return commonPostInitSetup(arguments, createdStub); + }; + + // eslint-disable-next-line no-unused-vars + sandbox.fake = function fake(f) { + const s = sinonFake.apply(sinonFake, arguments); + + addToCollection(s); + + return s; + }; + + forEach(Object.keys(sinonFake), function (key) { + const fakeBehavior = sinonFake[key]; + if (typeof fakeBehavior === "function") { + sandbox.fake[key] = function () { + const s = fakeBehavior.apply(fakeBehavior, arguments); + + addToCollection(s); + + return s; + }; + } + }); + + sandbox.useFakeTimers = function useFakeTimers(args) { + const clock = sinonClock.useFakeTimers.call(null, args); + + sandbox.clock = clock; + addToCollection(clock); + + return clock; + }; + + sandbox.verify = function verify() { + applyOnEach(collection, "verify"); + }; + + sandbox.verifyAndRestore = function verifyAndRestore() { + let exception; + + try { + sandbox.verify(); + } catch (e) { + exception = e; + } + + sandbox.restore(); + + if (exception) { + throw exception; + } + }; +} + +Sandbox.prototype.match = match; + +module.exports = Sandbox; + +},{"./assert":3,"./collect-own-methods":5,"./create-stub-instance":8,"./fake":10,"./mock":12,"./spy":21,"./stub":22,"./util/core/get-property-descriptor":28,"./util/core/is-property-configurable":31,"./util/fake-timers":39,"@sinonjs/commons":46,"@sinonjs/samsam":86}],20:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Colorizer = require("./colorizer"); +const colororizer = new Colorizer(); +const match = require("@sinonjs/samsam").createMatcher; +const timesInWords = require("./util/core/times-in-words"); +const inspect = require("util").inspect; +const jsDiff = require("diff"); + +const join = arrayProto.join; +const map = arrayProto.map; +const push = arrayProto.push; +const slice = arrayProto.slice; + +/** + * + * @param matcher + * @param calledArg + * @param calledArgMessage + * + * @returns {string} the colored text + */ +function colorSinonMatchText(matcher, calledArg, calledArgMessage) { + let calledArgumentMessage = calledArgMessage; + let matcherMessage = matcher.message; + if (!matcher.test(calledArg)) { + matcherMessage = colororizer.red(matcher.message); + if (calledArgumentMessage) { + calledArgumentMessage = colororizer.green(calledArgumentMessage); + } + } + return `${calledArgumentMessage} ${matcherMessage}`; +} + +/** + * @param diff + * + * @returns {string} the colored diff + */ +function colorDiffText(diff) { + const objects = map(diff, function (part) { + let text = part.value; + if (part.added) { + text = colororizer.green(text); + } else if (part.removed) { + text = colororizer.red(text); + } + if (diff.length === 2) { + text += " "; // format simple diffs + } + return text; + }); + return join(objects, ""); +} + +/** + * + * @param value + * @returns {string} a quoted string + */ +function quoteStringValue(value) { + if (typeof value === "string") { + return JSON.stringify(value); + } + return value; +} + +module.exports = { + c: function (spyInstance) { + return timesInWords(spyInstance.callCount); + }, + + n: function (spyInstance) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return spyInstance.toString(); + }, + + D: function (spyInstance, args) { + let message = ""; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // describe multiple calls + if (l > 1) { + message += `\nCall ${i + 1}:`; + } + const calledArgs = spyInstance.getCall(i).args; + const expectedArgs = slice(args); + + for ( + let j = 0; + j < calledArgs.length || j < expectedArgs.length; + ++j + ) { + let calledArg = calledArgs[j]; + let expectedArg = expectedArgs[j]; + if (calledArg) { + calledArg = quoteStringValue(calledArg); + } + + if (expectedArg) { + expectedArg = quoteStringValue(expectedArg); + } + + message += "\n"; + + const calledArgMessage = + j < calledArgs.length ? inspect(calledArg) : ""; + if (match.isMatcher(expectedArg)) { + message += colorSinonMatchText( + expectedArg, + calledArg, + calledArgMessage, + ); + } else { + const expectedArgMessage = + j < expectedArgs.length ? inspect(expectedArg) : ""; + const diff = jsDiff.diffJson( + calledArgMessage, + expectedArgMessage, + ); + message += colorDiffText(diff); + } + } + } + + return message; + }, + + C: function (spyInstance) { + const calls = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + let stringifiedCall = ` ${spyInstance.getCall(i).toString()}`; + if (/\n/.test(calls[i - 1])) { + stringifiedCall = `\n${stringifiedCall}`; + } + push(calls, stringifiedCall); + } + + return calls.length > 0 ? `\n${join(calls, "\n")}` : ""; + }, + + t: function (spyInstance) { + const objects = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + push(objects, inspect(spyInstance.thisValues[i])); + } + + return join(objects, ", "); + }, + + "*": function (spyInstance, args) { + return join( + map(args, function (arg) { + return inspect(arg); + }), + ", ", + ); + }, +}; + +},{"./colorizer":6,"./util/core/times-in-words":35,"@sinonjs/commons":46,"@sinonjs/samsam":86,"diff":91,"util":90}],21:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const extend = require("./util/core/extend"); +const functionName = require("@sinonjs/commons").functionName; +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const isEsModule = require("./util/core/is-es-module"); +const proxyCallUtil = require("./proxy-call-util"); +const walkObject = require("./util/core/walk-object"); +const wrapMethod = require("./util/core/wrap-method"); +const valueToString = require("@sinonjs/commons").valueToString; + +/* cache references to library methods so that they also can be stubbed without problems */ +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const push = arrayProto.push; +const slice = arrayProto.slice; +const filter = Array.prototype.filter; + +let uuid = 0; + +function matches(fake, args, strict) { + const margs = fake.matchingArguments; + if ( + margs.length <= args.length && + deepEqual(slice(args, 0, margs.length), margs) + ) { + return !strict || margs.length === args.length; + } + return false; +} + +// Public API +const spyApi = { + withArgs: function () { + const args = slice(arguments); + const matching = pop(this.matchingFakes(args, true)); + if (matching) { + return matching; + } + + const original = this; + const fake = this.instantiateFake(); + fake.matchingArguments = args; + fake.parent = this; + push(this.fakes, fake); + + fake.withArgs = function () { + return original.withArgs.apply(original, arguments); + }; + + forEach(original.args, function (arg, i) { + if (!matches(fake, arg)) { + return; + } + + proxyCallUtil.incrementCallCount(fake); + push(fake.thisValues, original.thisValues[i]); + push(fake.args, arg); + push(fake.returnValues, original.returnValues[i]); + push(fake.exceptions, original.exceptions[i]); + push(fake.callIds, original.callIds[i]); + }); + + proxyCallUtil.createCallProperties(fake); + + return fake; + }, + + // Override proxy default implementation + matchingFakes: function (args, strict) { + return filter.call(this.fakes, function (fake) { + return matches(fake, args, strict); + }); + }, +}; + +/* eslint-disable @sinonjs/no-prototype-methods/no-prototype-methods */ +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(spyApi, "callArg", false, "callArgWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgWith = spyApi.callArg; +delegateToCalls(spyApi, "callArgOn", false, "callArgOnWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgOnWith = spyApi.callArgOn; +delegateToCalls(spyApi, "throwArg", false, "throwArg", false, function () { + throw new Error( + `${this.toString()} cannot throw arg since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yield", false, "yield", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +// "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode. +spyApi.invokeCallback = spyApi.yield; +delegateToCalls(spyApi, "yieldOn", false, "yieldOn", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yieldTo", false, "yieldTo", true, function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); +}); +delegateToCalls( + spyApi, + "yieldToOn", + false, + "yieldToOn", + true, + function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); + }, +); + +function createSpy(func) { + let name; + let funk = func; + + if (typeof funk !== "function") { + funk = function () { + return; + }; + } else { + name = functionName(funk); + } + + const proxy = createProxy(funk, funk); + + // Inherit spy API: + extend.nonEnum(proxy, spyApi); + extend.nonEnum(proxy, { + displayName: name || "spy", + fakes: [], + instantiateFake: createSpy, + id: `spy#${uuid++}`, + }); + return proxy; +} + +function spy(object, property, types) { + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be spied"); + } + + if (!property && typeof object === "function") { + return createSpy(object); + } + + if (!property && typeof object === "object") { + return walkObject(spy, object); + } + + if (!object && !property) { + return createSpy(function () { + return; + }); + } + + if (!types) { + return wrapMethod(object, property, createSpy(object[property])); + } + + const descriptor = {}; + const methodDesc = getPropertyDescriptor(object, property); + + forEach(types, function (type) { + descriptor[type] = createSpy(methodDesc[type]); + }); + + return wrapMethod(object, property, descriptor); +} + +extend(spy, spyApi); +module.exports = spy; + +},{"./proxy":17,"./proxy-call-util":14,"./util/core/extend":25,"./util/core/get-property-descriptor":28,"./util/core/is-es-module":29,"./util/core/walk-object":36,"./util/core/wrap-method":38,"@sinonjs/commons":46,"@sinonjs/samsam":86}],22:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const behavior = require("./behavior"); +const behaviors = require("./default-behaviors"); +const createProxy = require("./proxy"); +const functionName = require("@sinonjs/commons").functionName; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const isNonExistentProperty = require("./util/core/is-non-existent-property"); +const spy = require("./spy"); +const extend = require("./util/core/extend"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isEsModule = require("./util/core/is-es-module"); +const sinonType = require("./util/core/sinon-type"); +const wrapMethod = require("./util/core/wrap-method"); +const throwOnFalsyObject = require("./throw-on-falsy-object"); +const valueToString = require("@sinonjs/commons").valueToString; +const walkObject = require("./util/core/walk-object"); + +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const slice = arrayProto.slice; +const sort = arrayProto.sort; + +let uuid = 0; + +function createStub(originalFunc) { + // eslint-disable-next-line prefer-const + let proxy; + + function functionStub() { + const args = slice(arguments); + const matchings = proxy.matchingFakes(args); + + const fnStub = + pop( + sort(matchings, function (a, b) { + return ( + a.matchingArguments.length - b.matchingArguments.length + ); + }), + ) || proxy; + return getCurrentBehavior(fnStub).invoke(this, arguments); + } + + proxy = createProxy(functionStub, originalFunc || functionStub); + // Inherit spy API: + extend.nonEnum(proxy, spy); + // Inherit stub API: + extend.nonEnum(proxy, stub); + + const name = originalFunc ? functionName(originalFunc) : null; + extend.nonEnum(proxy, { + fakes: [], + instantiateFake: createStub, + displayName: name || "stub", + defaultBehavior: null, + behaviors: [], + id: `stub#${uuid++}`, + }); + + sinonType.set(proxy, "stub"); + + return proxy; +} + +function stub(object, property) { + if (arguments.length > 2) { + throw new TypeError( + "stub(obj, 'meth', fn) has been removed, see documentation", + ); + } + + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be stubbed"); + } + + throwOnFalsyObject.apply(null, arguments); + + if (isNonExistentProperty(object, property)) { + throw new TypeError( + `Cannot stub non-existent property ${valueToString(property)}`, + ); + } + + const actualDescriptor = getPropertyDescriptor(object, property); + + assertValidPropertyDescriptor(actualDescriptor, property); + + const isObjectOrFunction = + typeof object === "object" || typeof object === "function"; + const isStubbingEntireObject = + typeof property === "undefined" && isObjectOrFunction; + const isCreatingNewStub = !object && typeof property === "undefined"; + const isStubbingNonFuncProperty = + isObjectOrFunction && + typeof property !== "undefined" && + (typeof actualDescriptor === "undefined" || + typeof actualDescriptor.value !== "function"); + + if (isStubbingEntireObject) { + return walkObject(stub, object); + } + + if (isCreatingNewStub) { + return createStub(); + } + + const func = + typeof actualDescriptor.value === "function" + ? actualDescriptor.value + : null; + const s = createStub(func); + + extend.nonEnum(s, { + rootObj: object, + propName: property, + shadowsPropOnPrototype: !actualDescriptor.isOwn, + restore: function restore() { + if (actualDescriptor !== undefined && actualDescriptor.isOwn) { + Object.defineProperty(object, property, actualDescriptor); + return; + } + + delete object[property]; + }, + }); + + return isStubbingNonFuncProperty ? s : wrapMethod(object, property, s); +} + +function assertValidPropertyDescriptor(descriptor, property) { + if (!descriptor || !property) { + return; + } + if (descriptor.isOwn && !descriptor.configurable && !descriptor.writable) { + throw new TypeError( + `Descriptor for property ${property} is non-configurable and non-writable`, + ); + } + if ((descriptor.get || descriptor.set) && !descriptor.configurable) { + throw new TypeError( + `Descriptor for accessor property ${property} is non-configurable`, + ); + } + if (isDataDescriptor(descriptor) && !descriptor.writable) { + throw new TypeError( + `Descriptor for data property ${property} is non-writable`, + ); + } +} + +function isDataDescriptor(descriptor) { + return ( + !descriptor.value && + !descriptor.writable && + !descriptor.set && + !descriptor.get + ); +} + +/*eslint-disable no-use-before-define*/ +function getParentBehaviour(stubInstance) { + return stubInstance.parent && getCurrentBehavior(stubInstance.parent); +} + +function getDefaultBehavior(stubInstance) { + return ( + stubInstance.defaultBehavior || + getParentBehaviour(stubInstance) || + behavior.create(stubInstance) + ); +} + +function getCurrentBehavior(stubInstance) { + const currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1]; + return currentBehavior && currentBehavior.isPresent() + ? currentBehavior + : getDefaultBehavior(stubInstance); +} +/*eslint-enable no-use-before-define*/ + +const proto = { + resetBehavior: function () { + this.defaultBehavior = null; + this.behaviors = []; + + delete this.returnValue; + delete this.returnArgAt; + delete this.throwArgAt; + delete this.resolveArgAt; + delete this.fakeFn; + this.returnThis = false; + this.resolveThis = false; + + forEach(this.fakes, function (fake) { + fake.resetBehavior(); + }); + }, + + reset: function () { + this.resetHistory(); + this.resetBehavior(); + }, + + onCall: function onCall(index) { + if (!this.behaviors[index]) { + this.behaviors[index] = behavior.create(this); + } + + return this.behaviors[index]; + }, + + onFirstCall: function onFirstCall() { + return this.onCall(0); + }, + + onSecondCall: function onSecondCall() { + return this.onCall(1); + }, + + onThirdCall: function onThirdCall() { + return this.onCall(2); + }, + + withArgs: function withArgs() { + const fake = spy.withArgs.apply(this, arguments); + if (this.defaultBehavior && this.defaultBehavior.promiseLibrary) { + fake.defaultBehavior = + fake.defaultBehavior || behavior.create(fake); + fake.defaultBehavior.promiseLibrary = + this.defaultBehavior.promiseLibrary; + } + return fake; + }, +}; + +forEach(Object.keys(behavior), function (method) { + if ( + hasOwnProperty(behavior, method) && + !hasOwnProperty(proto, method) && + method !== "create" && + method !== "invoke" + ) { + proto[method] = behavior.createBehavior(method); + } +}); + +forEach(Object.keys(behaviors), function (method) { + if (hasOwnProperty(behaviors, method) && !hasOwnProperty(proto, method)) { + behavior.addBehavior(stub, method, behaviors[method]); + } +}); + +extend(stub, proto); +module.exports = stub; + +},{"./behavior":4,"./default-behaviors":9,"./proxy":17,"./spy":21,"./throw-on-falsy-object":23,"./util/core/extend":25,"./util/core/get-property-descriptor":28,"./util/core/is-es-module":29,"./util/core/is-non-existent-property":30,"./util/core/sinon-type":34,"./util/core/walk-object":36,"./util/core/wrap-method":38,"@sinonjs/commons":46}],23:[function(require,module,exports){ +"use strict"; +const valueToString = require("@sinonjs/commons").valueToString; + +function throwOnFalsyObject(object, property) { + if (property && !object) { + const type = object === null ? "null" : "undefined"; + throw new Error( + `Trying to stub property '${valueToString(property)}' of ${type}`, + ); + } +} + +module.exports = throwOnFalsyObject; + +},{"@sinonjs/commons":46}],24:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const reduce = arrayProto.reduce; + +module.exports = function exportAsyncBehaviors(behaviorMethods) { + return reduce( + Object.keys(behaviorMethods), + function (acc, method) { + // need to avoid creating another async versions of the newly added async methods + if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { + acc[`${method}Async`] = function () { + const result = behaviorMethods[method].apply( + this, + arguments, + ); + this.callbackAsync = true; + return result; + }; + } + return acc; + }, + {}, + ); +}; + +},{"@sinonjs/commons":46}],25:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; + +const join = arrayProto.join; +const push = arrayProto.push; + +// Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug +const hasDontEnumBug = (function () { + const obj = { + constructor: function () { + return "0"; + }, + toString: function () { + return "1"; + }, + valueOf: function () { + return "2"; + }, + toLocaleString: function () { + return "3"; + }, + prototype: function () { + return "4"; + }, + isPrototypeOf: function () { + return "5"; + }, + propertyIsEnumerable: function () { + return "6"; + }, + hasOwnProperty: function () { + return "7"; + }, + length: function () { + return "8"; + }, + unique: function () { + return "9"; + }, + }; + + const result = []; + for (const prop in obj) { + if (hasOwnProperty(obj, prop)) { + push(result, obj[prop]()); + } + } + return join(result, "") !== "0123456789"; +})(); + +/** + * + * @param target + * @param sources + * @param doCopy + * @returns {*} target + */ +function extendCommon(target, sources, doCopy) { + let source, i, prop; + + for (i = 0; i < sources.length; i++) { + source = sources[i]; + + for (prop in source) { + if (hasOwnProperty(source, prop)) { + doCopy(target, source, prop); + } + } + + // Make sure we copy (own) toString method even when in JScript with DontEnum bug + // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug + if ( + hasDontEnumBug && + hasOwnProperty(source, "toString") && + source.toString !== target.toString + ) { + target.toString = source.toString; + } + } + + return target; +} + +/** + * Public: Extend target in place with all (own) properties, except 'name' when [[writable]] is false, + * from sources in-order. Thus, last source will override properties in previous sources. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports = function extend(target, ...sources) { + return extendCommon( + target, + sources, + function copyValue(dest, source, prop) { + const destOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + dest, + prop, + ); + const sourceOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + source, + prop, + ); + + if (prop === "name" && !destOwnPropertyDescriptor.writable) { + return; + } + const descriptors = { + configurable: sourceOwnPropertyDescriptor.configurable, + enumerable: sourceOwnPropertyDescriptor.enumerable, + }; + /* + if the source has an Accessor property copy over the accessor functions (get and set) + data properties has writable attribute where as accessor property don't + REF: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#properties + */ + + if (hasOwnProperty(sourceOwnPropertyDescriptor, "writable")) { + descriptors.writable = sourceOwnPropertyDescriptor.writable; + descriptors.value = sourceOwnPropertyDescriptor.value; + } else { + if (sourceOwnPropertyDescriptor.get) { + descriptors.get = + sourceOwnPropertyDescriptor.get.bind(dest); + } + if (sourceOwnPropertyDescriptor.set) { + descriptors.set = + sourceOwnPropertyDescriptor.set.bind(dest); + } + } + Object.defineProperty(dest, prop, descriptors); + }, + ); +}; + +/** + * Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will + * override properties in previous sources. Define the properties as non enumerable. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports.nonEnum = function extendNonEnum(target, ...sources) { + return extendCommon( + target, + sources, + function copyProperty(dest, source, prop) { + Object.defineProperty(dest, prop, { + value: source[prop], + enumerable: false, + configurable: true, + writable: true, + }); + }, + ); +}; + +},{"@sinonjs/commons":46}],26:[function(require,module,exports){ +"use strict"; + +module.exports = function toString() { + let i, prop, thisValue; + if (this.getCall && this.callCount) { + i = this.callCount; + + while (i--) { + thisValue = this.getCall(i).thisValue; + + // eslint-disable-next-line guard-for-in + for (prop in thisValue) { + try { + if (thisValue[prop] === this) { + return prop; + } + } catch (e) { + // no-op - accessing props can throw an error, nothing to do here + } + } + } + } + + return this.displayName || "sinon fake"; +}; + +},{}],27:[function(require,module,exports){ +"use strict"; + +/* istanbul ignore next : not testing that setTimeout works */ +function nextTick(callback) { + setTimeout(callback, 0); +} + +module.exports = function getNextTick(process, setImmediate) { + if (typeof process === "object" && typeof process.nextTick === "function") { + return process.nextTick; + } + + if (typeof setImmediate === "function") { + return setImmediate; + } + + return nextTick; +}; + +},{}],28:[function(require,module,exports){ +"use strict"; + +/** + * @typedef {object} PropertyDescriptor + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description + * @property {boolean} configurable defaults to false + * @property {boolean} enumerable defaults to false + * @property {boolean} writable defaults to false + * @property {*} value defaults to undefined + * @property {Function} get defaults to undefined + * @property {Function} set defaults to undefined + */ + +/* + * The following type def is strictly speaking illegal in JSDoc, but the expression forms a + * legal Typescript union type and is understood by Visual Studio and the IntelliJ + * family of editors. The "TS" flavor of JSDoc is becoming the de-facto standard these + * days for that reason (and the fact that JSDoc is essentially unmaintained) + */ + +/** + * @typedef {{isOwn: boolean} & PropertyDescriptor} SinonPropertyDescriptor + * a slightly enriched property descriptor + * @property {boolean} isOwn true if the descriptor is owned by this object, false if it comes from the prototype + */ + +/** + * Returns a slightly modified property descriptor that one can tell is from the object or the prototype + * + * @param {*} object + * @param {string} property + * @returns {SinonPropertyDescriptor} + */ +function getPropertyDescriptor(object, property) { + let proto = object; + let descriptor; + const isOwn = Boolean( + object && Object.getOwnPropertyDescriptor(object, property), + ); + + while ( + proto && + !(descriptor = Object.getOwnPropertyDescriptor(proto, property)) + ) { + proto = Object.getPrototypeOf(proto); + } + + if (descriptor) { + descriptor.isOwn = isOwn; + } + + return descriptor; +} + +module.exports = getPropertyDescriptor; + +},{}],29:[function(require,module,exports){ +"use strict"; + +/** + * Verify if an object is a ECMAScript Module + * + * As the exports from a module is immutable we cannot alter the exports + * using spies or stubs. Let the consumer know this to avoid bug reports + * on weird error messages. + * + * @param {object} object The object to examine + * @returns {boolean} true when the object is a module + */ +module.exports = function (object) { + return ( + object && + typeof Symbol !== "undefined" && + object[Symbol.toStringTag] === "Module" && + Object.isSealed(object) + ); +}; + +},{}],30:[function(require,module,exports){ +"use strict"; + +/** + * @param {*} object + * @param {string} property + * @returns {boolean} whether a prop exists in the prototype chain + */ +function isNonExistentProperty(object, property) { + return Boolean( + object && typeof property !== "undefined" && !(property in object), + ); +} + +module.exports = isNonExistentProperty; + +},{}],31:[function(require,module,exports){ +"use strict"; + +const getPropertyDescriptor = require("./get-property-descriptor"); + +function isPropertyConfigurable(obj, propName) { + const propertyDescriptor = getPropertyDescriptor(obj, propName); + + return propertyDescriptor ? propertyDescriptor.configurable : true; +} + +module.exports = isPropertyConfigurable; + +},{"./get-property-descriptor":28}],32:[function(require,module,exports){ +"use strict"; + +function isRestorable(obj) { + return ( + typeof obj === "function" && + typeof obj.restore === "function" && + obj.restore.sinon + ); +} + +module.exports = isRestorable; + +},{}],33:[function(require,module,exports){ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +const getNextTick = require("./get-next-tick"); + +module.exports = getNextTick(globalObject.process, globalObject.setImmediate); + +},{"./get-next-tick":27,"@sinonjs/commons":46}],34:[function(require,module,exports){ +"use strict"; + +const sinonTypeSymbolProperty = Symbol("SinonType"); + +module.exports = { + /** + * Set the type of a Sinon object to make it possible to identify it later at runtime + * + * @param {object|Function} object object/function to set the type on + * @param {string} type the named type of the object/function + */ + set(object, type) { + Object.defineProperty(object, sinonTypeSymbolProperty, { + value: type, + configurable: false, + enumerable: false, + }); + }, + get(object) { + return object && object[sinonTypeSymbolProperty]; + }, +}; + +},{}],35:[function(require,module,exports){ +"use strict"; + +const array = [null, "once", "twice", "thrice"]; + +module.exports = function timesInWords(count) { + return array[count] || `${count || 0} times`; +}; + +},{}],36:[function(require,module,exports){ +"use strict"; + +const functionName = require("@sinonjs/commons").functionName; + +const getPropertyDescriptor = require("./get-property-descriptor"); +const walk = require("./walk"); + +/** + * A utility that allows traversing an object, applying mutating functions on the properties + * + * @param {Function} mutator called on each property + * @param {object} object the object we are walking over + * @param {Function} filter a predicate (boolean function) that will decide whether or not to apply the mutator to the current property + * @returns {void} nothing + */ +function walkObject(mutator, object, filter) { + let called = false; + const name = functionName(mutator); + + if (!object) { + throw new Error( + `Trying to ${name} object but received ${String(object)}`, + ); + } + + walk(object, function (prop, propOwner) { + // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object + // is not Object.prototype + if ( + propOwner !== Object.prototype && + prop !== "constructor" && + typeof getPropertyDescriptor(propOwner, prop).value === "function" + ) { + if (filter) { + if (filter(object, prop)) { + called = true; + mutator(object, prop); + } + } else { + called = true; + mutator(object, prop); + } + } + }); + + if (!called) { + throw new Error( + `Found no methods on object to which we could apply mutations`, + ); + } + + return object; +} + +module.exports = walkObject; + +},{"./get-property-descriptor":28,"./walk":37,"@sinonjs/commons":46}],37:[function(require,module,exports){ +"use strict"; + +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function walkInternal(obj, iterator, context, originalObj, seen) { + let prop; + const proto = Object.getPrototypeOf(obj); + + if (typeof Object.getOwnPropertyNames !== "function") { + // We explicitly want to enumerate through all of the prototype's properties + // in this case, therefore we deliberately leave out an own property check. + /* eslint-disable-next-line guard-for-in */ + for (prop in obj) { + iterator.call(context, obj[prop], prop, obj); + } + + return; + } + + forEach(Object.getOwnPropertyNames(obj), function (k) { + if (seen[k] !== true) { + seen[k] = true; + const target = + typeof Object.getOwnPropertyDescriptor(obj, k).get === + "function" + ? originalObj + : obj; + iterator.call(context, k, target); + } + }); + + if (proto) { + walkInternal(proto, iterator, context, originalObj, seen); + } +} + +/* Walks the prototype chain of an object and iterates over every own property + * name encountered. The iterator is called in the same fashion that Array.prototype.forEach + * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional + * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will + * default to using a simple for..in loop. + * + * obj - The object to walk the prototype chain for. + * iterator - The function to be called on each pass of the walk. + * context - (Optional) When given, the iterator will be called with this object as the receiver. + */ +module.exports = function walk(obj, iterator, context) { + return walkInternal(obj, iterator, context, obj, {}); +}; + +},{"@sinonjs/commons":46}],38:[function(require,module,exports){ +"use strict"; + +// eslint-disable-next-line no-empty-function +const noop = () => {}; +const getPropertyDescriptor = require("./get-property-descriptor"); +const extend = require("./extend"); +const sinonType = require("./sinon-type"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const valueToString = require("@sinonjs/commons").valueToString; +const push = require("@sinonjs/commons").prototypes.array.push; + +function isFunction(obj) { + return ( + typeof obj === "function" || + Boolean(obj && obj.constructor && obj.call && obj.apply) + ); +} + +function mirrorProperties(target, source) { + for (const prop in source) { + if (!hasOwnProperty(target, prop)) { + target[prop] = source[prop]; + } + } +} + +function getAccessor(object, property, method) { + const accessors = ["get", "set"]; + const descriptor = getPropertyDescriptor(object, property); + + for (let i = 0; i < accessors.length; i++) { + if ( + descriptor[accessors[i]] && + descriptor[accessors[i]].name === method.name + ) { + return accessors[i]; + } + } + return null; +} + +// Cheap way to detect if we have ES5 support. +const hasES5Support = "keys" in Object; + +module.exports = function wrapMethod(object, property, method) { + if (!object) { + throw new TypeError("Should wrap property of object"); + } + + if (typeof method !== "function" && typeof method !== "object") { + throw new TypeError( + "Method wrapper should be a function or a property descriptor", + ); + } + + function checkWrappedMethod(wrappedMethod) { + let error; + + if (!isFunction(wrappedMethod)) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${valueToString( + property, + )} as function`, + ); + } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) { + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already wrapped`, + ); + } else if (wrappedMethod.calledBefore) { + const verb = wrappedMethod.returns ? "stubbed" : "spied on"; + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already ${verb}`, + ); + } + + if (error) { + if (wrappedMethod && wrappedMethod.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethod.stackTraceError.stack}`; + } + throw error; + } + } + + let error, wrappedMethod, i, wrappedMethodDesc, target, accessor; + + const wrappedMethods = []; + + function simplePropertyAssignment() { + wrappedMethod = object[property]; + checkWrappedMethod(wrappedMethod); + object[property] = method; + method.displayName = property; + } + + // Firefox has a problem when using hasOwn.call on objects from other frames. + const owned = object.hasOwnProperty + ? object.hasOwnProperty(property) // eslint-disable-line @sinonjs/no-prototype-methods/no-prototype-methods + : hasOwnProperty(object, property); + + if (hasES5Support) { + const methodDesc = + typeof method === "function" ? { value: method } : method; + wrappedMethodDesc = getPropertyDescriptor(object, property); + + if (!wrappedMethodDesc) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${property} as function`, + ); + } else if ( + wrappedMethodDesc.restore && + wrappedMethodDesc.restore.sinon + ) { + error = new TypeError( + `Attempted to wrap ${property} which is already wrapped`, + ); + } + if (error) { + if (wrappedMethodDesc && wrappedMethodDesc.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethodDesc.stackTraceError.stack}`; + } + throw error; + } + + const types = Object.keys(methodDesc); + for (i = 0; i < types.length; i++) { + wrappedMethod = wrappedMethodDesc[types[i]]; + checkWrappedMethod(wrappedMethod); + push(wrappedMethods, wrappedMethod); + } + + mirrorProperties(methodDesc, wrappedMethodDesc); + for (i = 0; i < types.length; i++) { + mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]); + } + + // you are not allowed to flip the configurable prop on an + // existing descriptor to anything but false (#2514) + if (!owned) { + methodDesc.configurable = true; + } + + Object.defineProperty(object, property, methodDesc); + + // catch failing assignment + // this is the converse of the check in `.restore` below + if (typeof method === "function" && object[property] !== method) { + // correct any wrongdoings caused by the defineProperty call above, + // such as adding new items (if object was a Storage object) + delete object[property]; + simplePropertyAssignment(); + } + } else { + simplePropertyAssignment(); + } + + extendObjectWithWrappedMethods(); + + function extendObjectWithWrappedMethods() { + for (i = 0; i < wrappedMethods.length; i++) { + accessor = getAccessor(object, property, wrappedMethods[i]); + target = accessor ? method[accessor] : method; + extend.nonEnum(target, { + displayName: property, + wrappedMethod: wrappedMethods[i], + + // Set up an Error object for a stack trace which can be used later to find what line of + // code the original method was created on. + stackTraceError: new Error("Stack Trace for original"), + + restore: restore, + }); + + target.restore.sinon = true; + if (!hasES5Support) { + mirrorProperties(target, wrappedMethod); + } + } + } + + function restore() { + accessor = getAccessor(object, property, this.wrappedMethod); + let descriptor; + // For prototype properties try to reset by delete first. + // If this fails (ex: localStorage on mobile safari) then force a reset + // via direct assignment. + if (accessor) { + if (!owned) { + try { + // In some cases `delete` may throw an error + delete object[property][accessor]; + } catch (e) {} // eslint-disable-line no-empty + // For native code functions `delete` fails without throwing an error + // on Chrome < 43, PhantomJS, etc. + } else if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + descriptor[accessor] = wrappedMethodDesc[accessor]; + Object.defineProperty(object, property, descriptor); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property][accessor] = this.wrappedMethod; + } + } else { + // Use strict equality comparison to check failures then force a reset + // via direct assignment. + if (object[property][accessor] === target) { + object[property][accessor] = this.wrappedMethod; + } + } + } else { + if (!owned) { + try { + delete object[property]; + } catch (e) {} // eslint-disable-line no-empty + } else if (hasES5Support) { + Object.defineProperty(object, property, wrappedMethodDesc); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property] = this.wrappedMethod; + } + } else { + if (object[property] === target) { + object[property] = this.wrappedMethod; + } + } + } + if (sinonType.get(object) === "stub-instance") { + // this is simply to avoid errors after restoring if something should + // traverse the object in a cleanup phase, ref #2477 + object[property] = noop; + } + } + + return method; +}; + +},{"./extend":25,"./get-property-descriptor":28,"./sinon-type":34,"@sinonjs/commons":46}],39:[function(require,module,exports){ +"use strict"; + +const extend = require("./core/extend"); +const FakeTimers = require("@sinonjs/fake-timers"); +const globalObject = require("@sinonjs/commons").global; + +/** + * + * @param config + * @param globalCtx + * + * @returns {object} the clock, after installing it on the global context, if given + */ +function createClock(config, globalCtx) { + let FakeTimersCtx = FakeTimers; + if (globalCtx !== null && typeof globalCtx === "object") { + FakeTimersCtx = FakeTimers.withGlobal(globalCtx); + } + const clock = FakeTimersCtx.install(config); + clock.restore = clock.uninstall; + return clock; +} + +/** + * + * @param obj + * @param globalPropName + */ +function addIfDefined(obj, globalPropName) { + const globalProp = globalObject[globalPropName]; + if (typeof globalProp !== "undefined") { + obj[globalPropName] = globalProp; + } +} + +/** + * @param {number|Date|object} dateOrConfig The unix epoch value to install with (default 0) + * @returns {object} Returns a lolex clock instance + */ +exports.useFakeTimers = function (dateOrConfig) { + const hasArguments = typeof dateOrConfig !== "undefined"; + const argumentIsDateLike = + (typeof dateOrConfig === "number" || dateOrConfig instanceof Date) && + arguments.length === 1; + const argumentIsObject = + dateOrConfig !== null && + typeof dateOrConfig === "object" && + arguments.length === 1; + + if (!hasArguments) { + return createClock({ + now: 0, + }); + } + + if (argumentIsDateLike) { + return createClock({ + now: dateOrConfig, + }); + } + + if (argumentIsObject) { + const config = extend.nonEnum({}, dateOrConfig); + const globalCtx = config.global; + delete config.global; + return createClock(config, globalCtx); + } + + throw new TypeError( + "useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon", + ); +}; + +exports.clock = { + create: function (now) { + return FakeTimers.createClock(now); + }, +}; + +const timers = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval, + Date: Date, +}; +addIfDefined(timers, "setImmediate"); +addIfDefined(timers, "clearImmediate"); + +exports.timers = timers; + +},{"./core/extend":25,"@sinonjs/commons":46,"@sinonjs/fake-timers":59}],40:[function(require,module,exports){ +"use strict"; + +var every = require("./prototypes/array").every; + +/** + * @private + */ +function hasCallsLeft(callMap, spy) { + if (callMap[spy.id] === undefined) { + callMap[spy.id] = 0; + } + + return callMap[spy.id] < spy.callCount; +} + +/** + * @private + */ +function checkAdjacentCalls(callMap, spy, index, spies) { + var calledBeforeNext = true; + + if (index !== spies.length - 1) { + calledBeforeNext = spy.calledBefore(spies[index + 1]); + } + + if (hasCallsLeft(callMap, spy) && calledBeforeNext) { + callMap[spy.id] += 1; + return true; + } + + return false; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} calledBefore - A method that determines if this proxy was called before another one + * @property {string} id - Some id + * @property {number} callCount - Number of times this proxy has been called + */ + +/** + * Returns true when the spies have been called in the order they were supplied in + * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments + * @returns {boolean} true when spies are called in order, false otherwise + */ +function calledInOrder(spies) { + var callMap = {}; + // eslint-disable-next-line no-underscore-dangle + var _spies = arguments.length > 1 ? arguments : spies; + + return every(_spies, checkAdjacentCalls.bind(null, callMap)); +} + +module.exports = calledInOrder; + +},{"./prototypes/array":48}],41:[function(require,module,exports){ +"use strict"; + +/** + * Returns a display name for a value from a constructor + * @param {object} value A value to examine + * @returns {(string|null)} A string or null + */ +function className(value) { + const name = value.constructor && value.constructor.name; + return name || null; +} + +module.exports = className; + +},{}],42:[function(require,module,exports){ +/* eslint-disable no-console */ +"use strict"; + +/** + * Returns a function that will invoke the supplied function and print a + * deprecation warning to the console each time it is called. + * @param {Function} func + * @param {string} msg + * @returns {Function} + */ +exports.wrap = function (func, msg) { + var wrapped = function () { + exports.printWarning(msg); + return func.apply(this, arguments); + }; + if (func.prototype) { + wrapped.prototype = func.prototype; + } + return wrapped; +}; + +/** + * Returns a string which can be supplied to `wrap()` to notify the user that a + * particular part of the sinon API has been deprecated. + * @param {string} packageName + * @param {string} funcName + * @returns {string} + */ +exports.defaultMsg = function (packageName, funcName) { + return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`; +}; + +/** + * Prints a warning on the console, when it exists + * @param {string} msg + * @returns {undefined} + */ +exports.printWarning = function (msg) { + /* istanbul ignore next */ + if (typeof process === "object" && process.emitWarning) { + // Emit Warnings in Node + process.emitWarning(msg); + } else if (console.info) { + console.info(msg); + } else { + console.log(msg); + } +}; + +},{}],43:[function(require,module,exports){ +"use strict"; + +/** + * Returns true when fn returns true for all members of obj. + * This is an every implementation that works for all iterables + * @param {object} obj + * @param {Function} fn + * @returns {boolean} + */ +module.exports = function every(obj, fn) { + var pass = true; + + try { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + obj.forEach(function () { + if (!fn.apply(this, arguments)) { + // Throwing an error is the only way to break `forEach` + throw new Error(); + } + }); + } catch (e) { + pass = false; + } + + return pass; +}; + +},{}],44:[function(require,module,exports){ +"use strict"; + +/** + * Returns a display name for a function + * @param {Function} func + * @returns {string} + */ +module.exports = function functionName(func) { + if (!func) { + return ""; + } + + try { + return ( + func.displayName || + func.name || + // Use function decomposition as a last resort to get function + // name. Does not rely on function decomposition to work - if it + // doesn't debugging will be slightly less informative + // (i.e. toString will say 'spy' rather than 'myFunc'). + (String(func).match(/function ([^\s(]+)/) || [])[1] + ); + } catch (e) { + // Stringify may fail and we might get an exception, as a last-last + // resort fall back to empty string. + return ""; + } +}; + +},{}],45:[function(require,module,exports){ +"use strict"; + +/** + * A reference to the global object + * @type {object} globalObject + */ +var globalObject; + +/* istanbul ignore else */ +if (typeof global !== "undefined") { + // Node + globalObject = global; +} else if (typeof window !== "undefined") { + // Browser + globalObject = window; +} else { + // WebWorker + globalObject = self; +} + +module.exports = globalObject; + +},{}],46:[function(require,module,exports){ +"use strict"; + +module.exports = { + global: require("./global"), + calledInOrder: require("./called-in-order"), + className: require("./class-name"), + deprecated: require("./deprecated"), + every: require("./every"), + functionName: require("./function-name"), + orderByFirstCall: require("./order-by-first-call"), + prototypes: require("./prototypes"), + typeOf: require("./type-of"), + valueToString: require("./value-to-string"), +}; + +},{"./called-in-order":40,"./class-name":41,"./deprecated":42,"./every":43,"./function-name":44,"./global":45,"./order-by-first-call":47,"./prototypes":51,"./type-of":57,"./value-to-string":58}],47:[function(require,module,exports){ +"use strict"; + +var sort = require("./prototypes/array").sort; +var slice = require("./prototypes/array").slice; + +/** + * @private + */ +function comparator(a, b) { + // uuid, won't ever be equal + var aCall = a.getCall(0); + var bCall = b.getCall(0); + var aId = (aCall && aCall.callId) || -1; + var bId = (bCall && bCall.callId) || -1; + + return aId < bId ? -1 : 1; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} getCall - A method that can return the first call + */ + +/** + * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call + * @param {SinonProxy[] | SinonProxy} spies + * @returns {SinonProxy[]} + */ +function orderByFirstCall(spies) { + return sort(slice(spies), comparator); +} + +module.exports = orderByFirstCall; + +},{"./prototypes/array":48}],48:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Array.prototype); + +},{"./copy-prototype-methods":49}],49:[function(require,module,exports){ +"use strict"; + +var call = Function.call; +var throwsOnProto = require("./throws-on-proto"); + +var disallowedProperties = [ + // ignore size because it throws from Map + "size", + "caller", + "callee", + "arguments", +]; + +// This branch is covered when tests are run with `--disable-proto=throw`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */ +if (throwsOnProto) { + disallowedProperties.push("__proto__"); +} + +module.exports = function copyPrototypeMethods(prototype) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return Object.getOwnPropertyNames(prototype).reduce(function ( + result, + name + ) { + if (disallowedProperties.includes(name)) { + return result; + } + + if (typeof prototype[name] !== "function") { + return result; + } + + result[name] = call.bind(prototype[name]); + + return result; + }, + Object.create(null)); +}; + +},{"./throws-on-proto":56}],50:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Function.prototype); + +},{"./copy-prototype-methods":49}],51:[function(require,module,exports){ +"use strict"; + +module.exports = { + array: require("./array"), + function: require("./function"), + map: require("./map"), + object: require("./object"), + set: require("./set"), + string: require("./string"), +}; + +},{"./array":48,"./function":50,"./map":52,"./object":53,"./set":54,"./string":55}],52:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Map.prototype); + +},{"./copy-prototype-methods":49}],53:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Object.prototype); + +},{"./copy-prototype-methods":49}],54:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Set.prototype); + +},{"./copy-prototype-methods":49}],55:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(String.prototype); + +},{"./copy-prototype-methods":49}],56:[function(require,module,exports){ +"use strict"; + +/** + * Is true when the environment causes an error to be thrown for accessing the + * __proto__ property. + * This is necessary in order to support `node --disable-proto=throw`. + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto + * @type {boolean} + */ +let throwsOnProto; +try { + const object = {}; + // eslint-disable-next-line no-proto, no-unused-expressions + object.__proto__; + throwsOnProto = false; +} catch (_) { + // This branch is covered when tests are run with `--disable-proto=throw`, + // however we can test both branches at the same time, so this is ignored + /* istanbul ignore next */ + throwsOnProto = true; +} + +module.exports = throwsOnProto; + +},{}],57:[function(require,module,exports){ +"use strict"; + +var type = require("type-detect"); + +/** + * Returns the lower-case result of running type from type-detect on the value + * @param {*} value + * @returns {string} + */ +module.exports = function typeOf(value) { + return type(value).toLowerCase(); +}; + +},{"type-detect":94}],58:[function(require,module,exports){ +"use strict"; + +/** + * Returns a string representation of the value + * @param {*} value + * @returns {string} + */ +function valueToString(value) { + if (value && value.toString) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return value.toString(); + } + return String(value); +} + +module.exports = valueToString; + +},{}],59:[function(require,module,exports){ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +let timersModule, timersPromisesModule; +if (typeof require === "function" && typeof module === "object") { + try { + timersModule = require("timers"); + } catch (e) { + // ignored + } + try { + timersPromisesModule = require("timers/promises"); + } catch (e) { + // ignored + } +} + +/** + * @typedef {object} IdleDeadline + * @property {boolean} didTimeout - whether or not the callback was called before reaching the optional timeout + * @property {function():number} timeRemaining - a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period + */ + +/** + * Queues a function to be called during a browser's idle periods + * + * @callback RequestIdleCallback + * @param {function(IdleDeadline)} callback + * @param {{timeout: number}} options - an options object + * @returns {number} the id + */ + +/** + * @callback NextTick + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {void} + */ + +/** + * @callback SetImmediate + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {NodeImmediate} + */ + +/** + * @callback VoidVarArgsFunc + * @param {...*} callback - the callback to run + * @returns {void} + */ + +/** + * @typedef RequestAnimationFrame + * @property {function(number):void} requestAnimationFrame + * @returns {number} - the id + */ + +/** + * @typedef Performance + * @property {function(): number} now + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * @typedef {object} Clock + * @property {number} now - the current time + * @property {Date} Date - the Date constructor + * @property {number} loopLimit - the maximum number of timers before assuming an infinite loop + * @property {RequestIdleCallback} requestIdleCallback + * @property {function(number):void} cancelIdleCallback + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {NextTick} nextTick + * @property {queueMicrotask} queueMicrotask + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {SetImmediate} setImmediate + * @property {function(NodeImmediate):void} clearImmediate + * @property {function():number} countTimers + * @property {RequestAnimationFrame} requestAnimationFrame + * @property {function(number):void} cancelAnimationFrame + * @property {function():void} runMicrotasks + * @property {function(string | number): number} tick + * @property {function(string | number): Promise} tickAsync + * @property {function(): number} next + * @property {function(): Promise} nextAsync + * @property {function(): number} runAll + * @property {function(): number} runToFrame + * @property {function(): Promise} runAllAsync + * @property {function(): number} runToLast + * @property {function(): Promise} runToLastAsync + * @property {function(): void} reset + * @property {function(number | Date): void} setSystemTime + * @property {function(number): void} jump + * @property {Performance} performance + * @property {function(number[]): number[]} hrtime - process.hrtime (legacy) + * @property {function(): void} uninstall Uninstall the clock. + * @property {Function[]} methods - the methods that are faked + * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods + * @property {{methodName:string, original:any}[] | undefined} timersPromisesModuleMethods + * @property {Map} abortListenerMap + */ +/* eslint-enable jsdoc/require-property-description */ + +/** + * Configuration object for the `install` method. + * + * @typedef {object} Config + * @property {number|Date} [now] a number (in milliseconds) or a Date object (default epoch) + * @property {string[]} [toFake] names of the methods that should be faked. + * @property {number} [loopLimit] the maximum number of timers that will be run when calling runAll() + * @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false) + * @property {number} [advanceTimeDelta] increment mocked time every <> ms (default: 20ms) + * @property {boolean} [shouldClearNativeTimers] forwards clear timer calls to native functions if they are not fakes (default: false) + * @property {boolean} [ignoreMissingTimers] default is false, meaning asking to fake timers that are not present will throw an error + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * The internal structure to describe a scheduled fake timer + * + * @typedef {object} Timer + * @property {Function} func + * @property {*[]} args + * @property {number} delay + * @property {number} callAt + * @property {number} createdAt + * @property {boolean} immediate + * @property {number} id + * @property {Error} [error] + */ + +/** + * A Node timer + * + * @typedef {object} NodeImmediate + * @property {function(): boolean} hasRef + * @property {function(): NodeImmediate} ref + * @property {function(): NodeImmediate} unref + */ +/* eslint-enable jsdoc/require-property-description */ + +/* eslint-disable complexity */ + +/** + * Mocks available features in the specified global namespace. + * + * @param {*} _global Namespace to mock (e.g. `window`) + * @returns {FakeTimers} + */ +function withGlobal(_global) { + const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint + const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs + const NOOP = function () { + return undefined; + }; + const NOOP_ARRAY = function () { + return []; + }; + const isPresent = {}; + let timeoutResult, + addTimerReturnsObject = false; + + if (_global.setTimeout) { + isPresent.setTimeout = true; + timeoutResult = _global.setTimeout(NOOP, 0); + addTimerReturnsObject = typeof timeoutResult === "object"; + } + isPresent.clearTimeout = Boolean(_global.clearTimeout); + isPresent.setInterval = Boolean(_global.setInterval); + isPresent.clearInterval = Boolean(_global.clearInterval); + isPresent.hrtime = + _global.process && typeof _global.process.hrtime === "function"; + isPresent.hrtimeBigint = + isPresent.hrtime && typeof _global.process.hrtime.bigint === "function"; + isPresent.nextTick = + _global.process && typeof _global.process.nextTick === "function"; + const utilPromisify = _global.process && require("util").promisify; + isPresent.performance = + _global.performance && typeof _global.performance.now === "function"; + const hasPerformancePrototype = + _global.Performance && + (typeof _global.Performance).match(/^(function|object)$/); + const hasPerformanceConstructorPrototype = + _global.performance && + _global.performance.constructor && + _global.performance.constructor.prototype; + isPresent.queueMicrotask = _global.hasOwnProperty("queueMicrotask"); + isPresent.requestAnimationFrame = + _global.requestAnimationFrame && + typeof _global.requestAnimationFrame === "function"; + isPresent.cancelAnimationFrame = + _global.cancelAnimationFrame && + typeof _global.cancelAnimationFrame === "function"; + isPresent.requestIdleCallback = + _global.requestIdleCallback && + typeof _global.requestIdleCallback === "function"; + isPresent.cancelIdleCallbackPresent = + _global.cancelIdleCallback && + typeof _global.cancelIdleCallback === "function"; + isPresent.setImmediate = + _global.setImmediate && typeof _global.setImmediate === "function"; + isPresent.clearImmediate = + _global.clearImmediate && typeof _global.clearImmediate === "function"; + isPresent.Intl = _global.Intl && typeof _global.Intl === "object"; + + if (_global.clearTimeout) { + _global.clearTimeout(timeoutResult); + } + + const NativeDate = _global.Date; + const NativeIntl = _global.Intl; + let uniqueTimerId = idCounterStart; + + if (NativeDate === undefined) { + throw new Error( + "The global scope doesn't have a `Date` object" + + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)", + ); + } + isPresent.Date = true; + + /** + * The PerformanceEntry object encapsulates a single performance metric + * that is part of the browser's performance timeline. + * + * This is an object returned by the `mark` and `measure` methods on the Performance prototype + */ + class FakePerformanceEntry { + constructor(name, entryType, startTime, duration) { + this.name = name; + this.entryType = entryType; + this.startTime = startTime; + this.duration = duration; + } + + toJSON() { + return JSON.stringify({ ...this }); + } + } + + /** + * @param {number} num + * @returns {boolean} + */ + function isNumberFinite(num) { + if (Number.isFinite) { + return Number.isFinite(num); + } + + return isFinite(num); + } + + let isNearInfiniteLimit = false; + + /** + * @param {Clock} clock + * @param {number} i + */ + function checkIsNearInfiniteLimit(clock, i) { + if (clock.loopLimit && i === clock.loopLimit - 1) { + isNearInfiniteLimit = true; + } + } + + /** + * + */ + function resetIsNearInfiniteLimit() { + isNearInfiniteLimit = false; + } + + /** + * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into + * number of milliseconds. This is used to support human-readable strings passed + * to clock.tick() + * + * @param {string} str + * @returns {number} + */ + function parseTime(str) { + if (!str) { + return 0; + } + + const strings = str.split(":"); + const l = strings.length; + let i = l; + let ms = 0; + let parsed; + + if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { + throw new Error( + "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits", + ); + } + + while (i--) { + parsed = parseInt(strings[i], 10); + + if (parsed >= 60) { + throw new Error(`Invalid time ${str}`); + } + + ms += parsed * Math.pow(60, l - i - 1); + } + + return ms * 1000; + } + + /** + * Get the decimal part of the millisecond value as nanoseconds + * + * @param {number} msFloat the number of milliseconds + * @returns {number} an integer number of nanoseconds in the range [0,1e6) + * + * Example: nanoRemainer(123.456789) -> 456789 + */ + function nanoRemainder(msFloat) { + const modulo = 1e6; + const remainder = (msFloat * 1e6) % modulo; + const positiveRemainder = + remainder < 0 ? remainder + modulo : remainder; + + return Math.floor(positiveRemainder); + } + + /** + * Used to grok the `now` parameter to createClock. + * + * @param {Date|number} epoch the system time + * @returns {number} + */ + function getEpoch(epoch) { + if (!epoch) { + return 0; + } + if (typeof epoch.getTime === "function") { + return epoch.getTime(); + } + if (typeof epoch === "number") { + return epoch; + } + throw new TypeError("now should be milliseconds since UNIX epoch"); + } + + /** + * @param {number} from + * @param {number} to + * @param {Timer} timer + * @returns {boolean} + */ + function inRange(from, to, timer) { + return timer && timer.callAt >= from && timer.callAt <= to; + } + + /** + * @param {Clock} clock + * @param {Timer} job + */ + function getInfiniteLoopError(clock, job) { + const infiniteLoopError = new Error( + `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`, + ); + + if (!job.error) { + return infiniteLoopError; + } + + // pattern never matched in Node + const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/; + let clockMethodPattern = new RegExp( + String(Object.keys(clock).join("|")), + ); + + if (addTimerReturnsObject) { + // node.js environment + clockMethodPattern = new RegExp( + `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`, + ); + } + + let matchedLineIndex = -1; + job.error.stack.split("\n").some(function (line, i) { + // If we've matched a computed target line (e.g. setTimeout) then we + // don't need to look any further. Return true to stop iterating. + const matchedComputedTarget = line.match(computedTargetPattern); + /* istanbul ignore if */ + if (matchedComputedTarget) { + matchedLineIndex = i; + return true; + } + + // If we've matched a clock method line, then there may still be + // others further down the trace. Return false to keep iterating. + const matchedClockMethod = line.match(clockMethodPattern); + if (matchedClockMethod) { + matchedLineIndex = i; + return false; + } + + // If we haven't matched anything on this line, but we matched + // previously and set the matched line index, then we can stop. + // If we haven't matched previously, then we should keep iterating. + return matchedLineIndex >= 0; + }); + + const stack = `${infiniteLoopError}\n${job.type || "Microtask"} - ${ + job.func.name || "anonymous" + }\n${job.error.stack + .split("\n") + .slice(matchedLineIndex + 1) + .join("\n")}`; + + try { + Object.defineProperty(infiniteLoopError, "stack", { + value: stack, + }); + } catch (e) { + // noop + } + + return infiniteLoopError; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function createDate() { + class ClockDate extends NativeDate { + /** + * @param {number} year + * @param {number} month + * @param {number} date + * @param {number} hour + * @param {number} minute + * @param {number} second + * @param {number} ms + * @returns void + */ + // eslint-disable-next-line no-unused-vars + constructor(year, month, date, hour, minute, second, ms) { + // Defensive and verbose to avoid potential harm in passing + // explicit undefined when user does not pass argument + if (arguments.length === 0) { + super(ClockDate.clock.now); + } else { + super(...arguments); + } + + // ensures identity checks using the constructor prop still works + // this should have no other functional effect + Object.defineProperty(this, "constructor", { + value: NativeDate, + enumerable: false, + }); + } + + static [Symbol.hasInstance](instance) { + return instance instanceof NativeDate; + } + } + + ClockDate.isFake = true; + + if (NativeDate.now) { + ClockDate.now = function now() { + return ClockDate.clock.now; + }; + } + + if (NativeDate.toSource) { + ClockDate.toSource = function toSource() { + return NativeDate.toSource(); + }; + } + + ClockDate.toString = function toString() { + return NativeDate.toString(); + }; + + // noinspection UnnecessaryLocalVariableJS + /** + * A normal Class constructor cannot be called without `new`, but Date can, so we need + * to wrap it in a Proxy in order to ensure this functionality of Date is kept intact + * + * @type {ClockDate} + */ + const ClockDateProxy = new Proxy(ClockDate, { + // handler for [[Call]] invocations (i.e. not using `new`) + apply() { + // the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. + // This remains so in the 10th edition of 2019 as well. + if (this instanceof ClockDate) { + throw new TypeError( + "A Proxy should only capture `new` calls with the `construct` handler. This is not supposed to be possible, so check the logic.", + ); + } + + return new NativeDate(ClockDate.clock.now).toString(); + }, + }); + + return ClockDateProxy; + } + + /** + * Mirror Intl by default on our fake implementation + * + * Most of the properties are the original native ones, + * but we need to take control of those that have a + * dependency on the current clock. + * + * @returns {object} the partly fake Intl implementation + */ + function createIntl() { + const ClockIntl = {}; + /* + * All properties of Intl are non-enumerable, so we need + * to do a bit of work to get them out. + */ + Object.getOwnPropertyNames(NativeIntl).forEach( + (property) => (ClockIntl[property] = NativeIntl[property]), + ); + + ClockIntl.DateTimeFormat = function (...args) { + const realFormatter = new NativeIntl.DateTimeFormat(...args); + const formatter = {}; + + ["formatRange", "formatRangeToParts", "resolvedOptions"].forEach( + (method) => { + formatter[method] = + realFormatter[method].bind(realFormatter); + }, + ); + + ["format", "formatToParts"].forEach((method) => { + formatter[method] = function (date) { + return realFormatter[method](date || ClockIntl.clock.now); + }; + }); + + return formatter; + }; + + ClockIntl.DateTimeFormat.prototype = Object.create( + NativeIntl.DateTimeFormat.prototype, + ); + + ClockIntl.DateTimeFormat.supportedLocalesOf = + NativeIntl.DateTimeFormat.supportedLocalesOf; + + return ClockIntl; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function enqueueJob(clock, job) { + // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob + if (!clock.jobs) { + clock.jobs = []; + } + clock.jobs.push(job); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function runJobs(clock) { + // runs all microtick-deferred tasks - ecma262/#sec-runjobs + if (!clock.jobs) { + return; + } + for (let i = 0; i < clock.jobs.length; i++) { + const job = clock.jobs[i]; + job.func.apply(null, job.args); + + checkIsNearInfiniteLimit(clock, i); + if (clock.loopLimit && i > clock.loopLimit) { + throw getInfiniteLoopError(clock, job); + } + } + resetIsNearInfiniteLimit(); + clock.jobs = []; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + * @returns {number} id of the created timer + */ + function addTimer(clock, timer) { + if (timer.func === undefined) { + throw new Error("Callback must be provided to timer calls"); + } + + if (addTimerReturnsObject) { + // Node.js environment + if (typeof timer.func !== "function") { + throw new TypeError( + `[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${ + timer.func + } of type ${typeof timer.func}`, + ); + } + } + + if (isNearInfiniteLimit) { + timer.error = new Error(); + } + + timer.type = timer.immediate ? "Immediate" : "Timeout"; + + if (timer.hasOwnProperty("delay")) { + if (typeof timer.delay !== "number") { + timer.delay = parseInt(timer.delay, 10); + } + + if (!isNumberFinite(timer.delay)) { + timer.delay = 0; + } + timer.delay = timer.delay > maxTimeout ? 1 : timer.delay; + timer.delay = Math.max(0, timer.delay); + } + + if (timer.hasOwnProperty("interval")) { + timer.type = "Interval"; + timer.interval = timer.interval > maxTimeout ? 1 : timer.interval; + } + + if (timer.hasOwnProperty("animation")) { + timer.type = "AnimationFrame"; + timer.animation = true; + } + + if (timer.hasOwnProperty("idleCallback")) { + timer.type = "IdleCallback"; + timer.idleCallback = true; + } + + if (!clock.timers) { + clock.timers = {}; + } + + timer.id = uniqueTimerId++; + timer.createdAt = clock.now; + timer.callAt = + clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + clock.timers[timer.id] = timer; + + if (addTimerReturnsObject) { + const res = { + refed: true, + ref: function () { + this.refed = true; + return res; + }, + unref: function () { + this.refed = false; + return res; + }, + hasRef: function () { + return this.refed; + }, + refresh: function () { + timer.callAt = + clock.now + + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + // it _might_ have been removed, but if not the assignment is perfectly fine + clock.timers[timer.id] = timer; + + return res; + }, + [Symbol.toPrimitive]: function () { + return timer.id; + }, + }; + return res; + } + + return timer.id; + } + + /* eslint consistent-return: "off" */ + /** + * Timer comparitor + * + * @param {Timer} a + * @param {Timer} b + * @returns {number} + */ + function compareTimers(a, b) { + // Sort first by absolute timing + if (a.callAt < b.callAt) { + return -1; + } + if (a.callAt > b.callAt) { + return 1; + } + + // Sort next by immediate, immediate timers take precedence + if (a.immediate && !b.immediate) { + return -1; + } + if (!a.immediate && b.immediate) { + return 1; + } + + // Sort next by creation time, earlier-created timers take precedence + if (a.createdAt < b.createdAt) { + return -1; + } + if (a.createdAt > b.createdAt) { + return 1; + } + + // Sort next by id, lower-id timers take precedence + if (a.id < b.id) { + return -1; + } + if (a.id > b.id) { + return 1; + } + + // As timer ids are unique, no fallback `0` is necessary + } + + /** + * @param {Clock} clock + * @param {number} from + * @param {number} to + * @returns {Timer} + */ + function firstTimerInRange(clock, from, to) { + const timers = clock.timers; + let timer = null; + let id, isInRange; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + isInRange = inRange(from, to, timers[id]); + + if ( + isInRange && + (!timer || compareTimers(timer, timers[id]) === 1) + ) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function firstTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === 1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function lastTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === -1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + */ + function callTimer(clock, timer) { + if (typeof timer.interval === "number") { + clock.timers[timer.id].callAt += timer.interval; + } else { + delete clock.timers[timer.id]; + } + + if (typeof timer.func === "function") { + timer.func.apply(null, timer.args); + } else { + /* eslint no-eval: "off" */ + const eval2 = eval; + (function () { + eval2(timer.func); + })(); + } + } + + /** + * Gets clear handler name for a given timer type + * + * @param {string} ttype + */ + function getClearHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `cancel${ttype}`; + } + return `clear${ttype}`; + } + + /** + * Gets schedule handler name for a given timer type + * + * @param {string} ttype + */ + function getScheduleHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `request${ttype}`; + } + return `set${ttype}`; + } + + /** + * Creates an anonymous function to warn only once + */ + function createWarnOnce() { + let calls = 0; + return function (msg) { + // eslint-disable-next-line + !calls++ && console.warn(msg); + }; + } + const warnOnce = createWarnOnce(); + + /** + * @param {Clock} clock + * @param {number} timerId + * @param {string} ttype + */ + function clearTimer(clock, timerId, ttype) { + if (!timerId) { + // null appears to be allowed in most browsers, and appears to be + // relied upon by some libraries, like Bootstrap carousel + return; + } + + if (!clock.timers) { + clock.timers = {}; + } + + // in Node, the ID is stored as the primitive value for `Timeout` objects + // for `Immediate` objects, no ID exists, so it gets coerced to NaN + const id = Number(timerId); + + if (Number.isNaN(id) || id < idCounterStart) { + const handlerName = getClearHandler(ttype); + + if (clock.shouldClearNativeTimers === true) { + const nativeHandler = clock[`_${handlerName}`]; + return typeof nativeHandler === "function" + ? nativeHandler(timerId) + : undefined; + } + warnOnce( + `FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.` + + "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`.", + ); + } + + if (clock.timers.hasOwnProperty(id)) { + // check that the ID matches a timer of the correct type + const timer = clock.timers[id]; + if ( + timer.type === ttype || + (timer.type === "Timeout" && ttype === "Interval") || + (timer.type === "Interval" && ttype === "Timeout") + ) { + delete clock.timers[id]; + } else { + const clear = getClearHandler(ttype); + const schedule = getScheduleHandler(timer.type); + throw new Error( + `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`, + ); + } + } + } + + /** + * @param {Clock} clock + * @param {Config} config + * @returns {Timer[]} + */ + function uninstall(clock, config) { + let method, i, l; + const installedHrTime = "_hrtime"; + const installedNextTick = "_nextTick"; + + for (i = 0, l = clock.methods.length; i < l; i++) { + method = clock.methods[i]; + if (method === "hrtime" && _global.process) { + _global.process.hrtime = clock[installedHrTime]; + } else if (method === "nextTick" && _global.process) { + _global.process.nextTick = clock[installedNextTick]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + clock, + `_${method}`, + ); + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + _global, + method, + originalPerfDescriptor, + ); + } else if (originalPerfDescriptor.configurable) { + _global[method] = clock[`_${method}`]; + } + } else { + if (_global[method] && _global[method].hadOwnProperty) { + _global[method] = clock[`_${method}`]; + } else { + try { + delete _global[method]; + } catch (ignore) { + /* eslint no-empty: "off" */ + } + } + } + if (clock.timersModuleMethods !== undefined) { + for (let j = 0; j < clock.timersModuleMethods.length; j++) { + const entry = clock.timersModuleMethods[j]; + timersModule[entry.methodName] = entry.original; + } + } + if (clock.timersPromisesModuleMethods !== undefined) { + for ( + let j = 0; + j < clock.timersPromisesModuleMethods.length; + j++ + ) { + const entry = clock.timersPromisesModuleMethods[j]; + timersPromisesModule[entry.methodName] = entry.original; + } + } + } + + if (config.shouldAdvanceTime === true) { + _global.clearInterval(clock.attachedInterval); + } + + // Prevent multiple executions which will completely remove these props + clock.methods = []; + + for (const [listener, signal] of clock.abortListenerMap.entries()) { + signal.removeEventListener("abort", listener); + clock.abortListenerMap.delete(listener); + } + + // return pending timers, to enable checking what timers remained on uninstall + if (!clock.timers) { + return []; + } + return Object.keys(clock.timers).map(function mapper(key) { + return clock.timers[key]; + }); + } + + /** + * @param {object} target the target containing the method to replace + * @param {string} method the keyname of the method on the target + * @param {Clock} clock + */ + function hijackMethod(target, method, clock) { + clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call( + target, + method, + ); + clock[`_${method}`] = target[method]; + + if (method === "Date") { + target[method] = clock[method]; + } else if (method === "Intl") { + target[method] = clock[method]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + target, + method, + ); + // JSDOM has a read only performance field so we have to save/copy it differently + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + clock, + `_${method}`, + originalPerfDescriptor, + ); + + const perfDescriptor = Object.getOwnPropertyDescriptor( + clock, + method, + ); + Object.defineProperty(target, method, perfDescriptor); + } else { + target[method] = clock[method]; + } + } else { + target[method] = function () { + return clock[method].apply(clock, arguments); + }; + + Object.defineProperties( + target[method], + Object.getOwnPropertyDescriptors(clock[method]), + ); + } + + target[method].clock = clock; + } + + /** + * @param {Clock} clock + * @param {number} advanceTimeDelta + */ + function doIntervalTick(clock, advanceTimeDelta) { + clock.tick(advanceTimeDelta); + } + + /** + * @typedef {object} Timers + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {Date} Date + * @property {Intl} Intl + * @property {SetImmediate=} setImmediate + * @property {function(NodeImmediate): void=} clearImmediate + * @property {function(number[]):number[]=} hrtime + * @property {NextTick=} nextTick + * @property {Performance=} performance + * @property {RequestAnimationFrame=} requestAnimationFrame + * @property {boolean=} queueMicrotask + * @property {function(number): void=} cancelAnimationFrame + * @property {RequestIdleCallback=} requestIdleCallback + * @property {function(number): void=} cancelIdleCallback + */ + + /** @type {Timers} */ + const timers = { + setTimeout: _global.setTimeout, + clearTimeout: _global.clearTimeout, + setInterval: _global.setInterval, + clearInterval: _global.clearInterval, + Date: _global.Date, + }; + + if (isPresent.setImmediate) { + timers.setImmediate = _global.setImmediate; + } + + if (isPresent.clearImmediate) { + timers.clearImmediate = _global.clearImmediate; + } + + if (isPresent.hrtime) { + timers.hrtime = _global.process.hrtime; + } + + if (isPresent.nextTick) { + timers.nextTick = _global.process.nextTick; + } + + if (isPresent.performance) { + timers.performance = _global.performance; + } + + if (isPresent.requestAnimationFrame) { + timers.requestAnimationFrame = _global.requestAnimationFrame; + } + + if (isPresent.queueMicrotask) { + timers.queueMicrotask = _global.queueMicrotask; + } + + if (isPresent.cancelAnimationFrame) { + timers.cancelAnimationFrame = _global.cancelAnimationFrame; + } + + if (isPresent.requestIdleCallback) { + timers.requestIdleCallback = _global.requestIdleCallback; + } + + if (isPresent.cancelIdleCallback) { + timers.cancelIdleCallback = _global.cancelIdleCallback; + } + + if (isPresent.Intl) { + timers.Intl = _global.Intl; + } + + const originalSetTimeout = _global.setImmediate || _global.setTimeout; + + /** + * @param {Date|number} [start] the system time - non-integer values are floored + * @param {number} [loopLimit] maximum number of timers that will be run when calling runAll() + * @returns {Clock} + */ + function createClock(start, loopLimit) { + // eslint-disable-next-line no-param-reassign + start = Math.floor(getEpoch(start)); + // eslint-disable-next-line no-param-reassign + loopLimit = loopLimit || 1000; + let nanos = 0; + const adjustedSystemTime = [0, 0]; // [millis, nanoremainder] + + const clock = { + now: start, + Date: createDate(), + loopLimit: loopLimit, + }; + + clock.Date.clock = clock; + + //eslint-disable-next-line jsdoc/require-jsdoc + function getTimeToNextFrame() { + return 16 - ((clock.now - start) % 16); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function hrtime(prev) { + const millisSinceStart = clock.now - adjustedSystemTime[0] - start; + const secsSinceStart = Math.floor(millisSinceStart / 1000); + const remainderInNanos = + (millisSinceStart - secsSinceStart * 1e3) * 1e6 + + nanos - + adjustedSystemTime[1]; + + if (Array.isArray(prev)) { + if (prev[1] > 1e9) { + throw new TypeError( + "Number of nanoseconds can't exceed a billion", + ); + } + + const oldSecs = prev[0]; + let nanoDiff = remainderInNanos - prev[1]; + let secDiff = secsSinceStart - oldSecs; + + if (nanoDiff < 0) { + nanoDiff += 1e9; + secDiff -= 1; + } + + return [secDiff, nanoDiff]; + } + return [secsSinceStart, remainderInNanos]; + } + + /** + * A high resolution timestamp in milliseconds. + * + * @typedef {number} DOMHighResTimeStamp + */ + + /** + * performance.now() + * + * @returns {DOMHighResTimeStamp} + */ + function fakePerformanceNow() { + const hrt = hrtime(); + const millis = hrt[0] * 1000 + hrt[1] / 1e6; + return millis; + } + + if (isPresent.hrtimeBigint) { + hrtime.bigint = function () { + const parts = hrtime(); + return BigInt(parts[0]) * BigInt(1e9) + BigInt(parts[1]); // eslint-disable-line + }; + } + + if (isPresent.Intl) { + clock.Intl = createIntl(); + clock.Intl.clock = clock; + } + + clock.requestIdleCallback = function requestIdleCallback( + func, + timeout, + ) { + let timeToNextIdlePeriod = 0; + + if (clock.countTimers() > 0) { + timeToNextIdlePeriod = 50; // const for now + } + + const result = addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: + typeof timeout === "undefined" + ? timeToNextIdlePeriod + : Math.min(timeout, timeToNextIdlePeriod), + idleCallback: true, + }); + + return Number(result); + }; + + clock.cancelIdleCallback = function cancelIdleCallback(timerId) { + return clearTimer(clock, timerId, "IdleCallback"); + }; + + clock.setTimeout = function setTimeout(func, timeout) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + }); + }; + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setTimeout[utilPromisify.custom] = + function promisifiedSetTimeout(timeout, arg) { + return new _global.Promise(function setTimeoutExecutor( + resolve, + ) { + addTimer(clock, { + func: resolve, + args: [arg], + delay: timeout, + }); + }); + }; + } + + clock.clearTimeout = function clearTimeout(timerId) { + return clearTimer(clock, timerId, "Timeout"); + }; + + clock.nextTick = function nextTick(func) { + return enqueueJob(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + error: isNearInfiniteLimit ? new Error() : null, + }); + }; + + clock.queueMicrotask = function queueMicrotask(func) { + return clock.nextTick(func); // explicitly drop additional arguments + }; + + clock.setInterval = function setInterval(func, timeout) { + // eslint-disable-next-line no-param-reassign + timeout = parseInt(timeout, 10); + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + interval: timeout, + }); + }; + + clock.clearInterval = function clearInterval(timerId) { + return clearTimer(clock, timerId, "Interval"); + }; + + if (isPresent.setImmediate) { + clock.setImmediate = function setImmediate(func) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + immediate: true, + }); + }; + + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setImmediate[utilPromisify.custom] = + function promisifiedSetImmediate(arg) { + return new _global.Promise( + function setImmediateExecutor(resolve) { + addTimer(clock, { + func: resolve, + args: [arg], + immediate: true, + }); + }, + ); + }; + } + + clock.clearImmediate = function clearImmediate(timerId) { + return clearTimer(clock, timerId, "Immediate"); + }; + } + + clock.countTimers = function countTimers() { + return ( + Object.keys(clock.timers || {}).length + + (clock.jobs || []).length + ); + }; + + clock.requestAnimationFrame = function requestAnimationFrame(func) { + const result = addTimer(clock, { + func: func, + delay: getTimeToNextFrame(), + get args() { + return [fakePerformanceNow()]; + }, + animation: true, + }); + + return Number(result); + }; + + clock.cancelAnimationFrame = function cancelAnimationFrame(timerId) { + return clearTimer(clock, timerId, "AnimationFrame"); + }; + + clock.runMicrotasks = function runMicrotasks() { + runJobs(clock); + }; + + /** + * @param {number|string} tickValue milliseconds or a string parseable by parseTime + * @param {boolean} isAsync + * @param {Function} resolve + * @param {Function} reject + * @returns {number|undefined} will return the new `now` value or nothing for async + */ + function doTick(tickValue, isAsync, resolve, reject) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + const remainder = nanoRemainder(msFloat); + let nanosTotal = nanos + remainder; + let tickTo = clock.now + ms; + + if (msFloat < 0) { + throw new TypeError("Negative ticks are not supported"); + } + + // adjust for positive overflow + if (nanosTotal >= 1e6) { + tickTo += 1; + nanosTotal -= 1e6; + } + + nanos = nanosTotal; + let tickFrom = clock.now; + let previous = clock.now; + // ESLint fails to detect this correctly + /* eslint-disable prefer-const */ + let timer, + firstException, + oldNow, + nextPromiseTick, + compensationCheck, + postTimerCall; + /* eslint-enable prefer-const */ + + clock.duringTick = true; + + // perform microtasks + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during microtask callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function doTickInner() { + // perform each timer in the requested range + timer = firstTimerInRange(clock, tickFrom, tickTo); + // eslint-disable-next-line no-unmodified-loop-condition + while (timer && tickFrom <= tickTo) { + if (clock.timers[timer.id]) { + tickFrom = timer.callAt; + clock.now = timer.callAt; + oldNow = clock.now; + try { + runJobs(clock); + callTimer(clock, timer); + } catch (e) { + firstException = firstException || e; + } + + if (isAsync) { + // finish up after native setImmediate callback to allow + // all native es6 promises to process their callbacks after + // each timer fires. + originalSetTimeout(nextPromiseTick); + return; + } + + compensationCheck(); + } + + postTimerCall(); + } + + // perform process.nextTick()s again + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during process.nextTick() callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + clock.duringTick = false; + + // corner case: during runJobs new timers were scheduled which could be in the range [clock.now, tickTo] + timer = firstTimerInRange(clock, tickFrom, tickTo); + if (timer) { + try { + clock.tick(tickTo - clock.now); // do it all again - for the remainder of the requested range + } catch (e) { + firstException = firstException || e; + } + } else { + // no timers remaining in the requested range: move the clock all the way to the end + clock.now = tickTo; + + // update nanos + nanos = nanosTotal; + } + if (firstException) { + throw firstException; + } + + if (isAsync) { + resolve(clock.now); + } else { + return clock.now; + } + } + + nextPromiseTick = + isAsync && + function () { + try { + compensationCheck(); + postTimerCall(); + doTickInner(); + } catch (e) { + reject(e); + } + }; + + compensationCheck = function () { + // compensate for any setSystemTime() call during timer callback + if (oldNow !== clock.now) { + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + previous += clock.now - oldNow; + } + }; + + postTimerCall = function () { + timer = firstTimerInRange(clock, previous, tickTo); + previous = tickFrom; + }; + + return doTickInner(); + } + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.tick = function tick(tickValue) { + return doTick(tickValue, false); + }; + + if (typeof _global.Promise !== "undefined") { + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {Promise} + */ + clock.tickAsync = function tickAsync(tickValue) { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + doTick(tickValue, true, resolve, reject); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.next = function next() { + runJobs(clock); + const timer = firstTimer(clock); + if (!timer) { + return clock.now; + } + + clock.duringTick = true; + try { + clock.now = timer.callAt; + callTimer(clock, timer); + runJobs(clock); + return clock.now; + } finally { + clock.duringTick = false; + } + }; + + if (typeof _global.Promise !== "undefined") { + clock.nextAsync = function nextAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = firstTimer(clock); + if (!timer) { + resolve(clock.now); + return; + } + + let err; + clock.duringTick = true; + clock.now = timer.callAt; + try { + callTimer(clock, timer); + } catch (e) { + err = e; + } + clock.duringTick = false; + + originalSetTimeout(function () { + if (err) { + reject(err); + } else { + resolve(clock.now); + } + }); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.runAll = function runAll() { + let numTimers, i; + runJobs(clock); + for (i = 0; i < clock.loopLimit; i++) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + numTimers = Object.keys(clock.timers).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + clock.next(); + checkIsNearInfiniteLimit(clock, i); + } + + const excessJob = firstTimer(clock); + throw getInfiniteLoopError(clock, excessJob); + }; + + clock.runToFrame = function runToFrame() { + return clock.tick(getTimeToNextFrame()); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runAllAsync = function runAllAsync() { + return new _global.Promise(function (resolve, reject) { + let i = 0; + /** + * + */ + function doRun() { + originalSetTimeout(function () { + try { + runJobs(clock); + + let numTimers; + if (i < clock.loopLimit) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + numTimers = Object.keys( + clock.timers, + ).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + clock.next(); + + i++; + + doRun(); + checkIsNearInfiniteLimit(clock, i); + return; + } + + const excessJob = firstTimer(clock); + reject(getInfiniteLoopError(clock, excessJob)); + } catch (e) { + reject(e); + } + }); + } + doRun(); + }); + }; + } + + clock.runToLast = function runToLast() { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + return clock.now; + } + + return clock.tick(timer.callAt - clock.now); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runToLastAsync = function runToLastAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + resolve(clock.now); + } + + resolve(clock.tickAsync(timer.callAt - clock.now)); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.reset = function reset() { + nanos = 0; + clock.timers = {}; + clock.jobs = []; + clock.now = start; + }; + + clock.setSystemTime = function setSystemTime(systemTime) { + // determine time difference + const newNow = getEpoch(systemTime); + const difference = newNow - clock.now; + let id, timer; + + adjustedSystemTime[0] = adjustedSystemTime[0] + difference; + adjustedSystemTime[1] = adjustedSystemTime[1] + nanos; + // update 'system clock' + clock.now = newNow; + nanos = 0; + + // update timers and intervals to keep them stable + for (id in clock.timers) { + if (clock.timers.hasOwnProperty(id)) { + timer = clock.timers[id]; + timer.createdAt += difference; + timer.callAt += difference; + } + } + }; + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.jump = function jump(tickValue) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + + for (const timer of Object.values(clock.timers)) { + if (clock.now + ms > timer.callAt) { + timer.callAt = clock.now + ms; + } + } + clock.tick(ms); + }; + + if (isPresent.performance) { + clock.performance = Object.create(null); + clock.performance.now = fakePerformanceNow; + } + + if (isPresent.hrtime) { + clock.hrtime = hrtime; + } + + return clock; + } + + /* eslint-disable complexity */ + + /** + * @param {Config=} [config] Optional config + * @returns {Clock} + */ + function install(config) { + if ( + arguments.length > 1 || + config instanceof Date || + Array.isArray(config) || + typeof config === "number" + ) { + throw new TypeError( + `FakeTimers.install called with ${String( + config, + )} install requires an object parameter`, + ); + } + + if (_global.Date.isFake === true) { + // Timers are already faked; this is a problem. + // Make the user reset timers before continuing. + throw new TypeError( + "Can't install fake timers twice on the same global object.", + ); + } + + // eslint-disable-next-line no-param-reassign + config = typeof config !== "undefined" ? config : {}; + config.shouldAdvanceTime = config.shouldAdvanceTime || false; + config.advanceTimeDelta = config.advanceTimeDelta || 20; + config.shouldClearNativeTimers = + config.shouldClearNativeTimers || false; + + if (config.target) { + throw new TypeError( + "config.target is no longer supported. Use `withGlobal(target)` instead.", + ); + } + + /** + * @param {string} timer/object the name of the thing that is not present + * @param timer + */ + function handleMissingTimer(timer) { + if (config.ignoreMissingTimers) { + return; + } + + throw new ReferenceError( + `non-existent timers and/or objects cannot be faked: '${timer}'`, + ); + } + + let i, l; + const clock = createClock(config.now, config.loopLimit); + clock.shouldClearNativeTimers = config.shouldClearNativeTimers; + + clock.uninstall = function () { + return uninstall(clock, config); + }; + + clock.abortListenerMap = new Map(); + + clock.methods = config.toFake || []; + + if (clock.methods.length === 0) { + clock.methods = Object.keys(timers); + } + + if (config.shouldAdvanceTime === true) { + const intervalTick = doIntervalTick.bind( + null, + clock, + config.advanceTimeDelta, + ); + const intervalId = _global.setInterval( + intervalTick, + config.advanceTimeDelta, + ); + clock.attachedInterval = intervalId; + } + + if (clock.methods.includes("performance")) { + const proto = (() => { + if (hasPerformanceConstructorPrototype) { + return _global.performance.constructor.prototype; + } + if (hasPerformancePrototype) { + return _global.Performance.prototype; + } + })(); + if (proto) { + Object.getOwnPropertyNames(proto).forEach(function (name) { + if (name !== "now") { + clock.performance[name] = + name.indexOf("getEntries") === 0 + ? NOOP_ARRAY + : NOOP; + } + }); + // ensure `mark` returns a value that is valid + clock.performance.mark = (name) => + new FakePerformanceEntry(name, "mark", 0, 0); + clock.performance.measure = (name) => + new FakePerformanceEntry(name, "measure", 0, 100); + } else if ((config.toFake || []).includes("performance")) { + return handleMissingTimer("performance"); + } + } + if (_global === globalObject && timersModule) { + clock.timersModuleMethods = []; + } + if (_global === globalObject && timersPromisesModule) { + clock.timersPromisesModuleMethods = []; + } + for (i = 0, l = clock.methods.length; i < l; i++) { + const nameOfMethodToReplace = clock.methods[i]; + + if (!isPresent[nameOfMethodToReplace]) { + handleMissingTimer(nameOfMethodToReplace); + // eslint-disable-next-line + continue; + } + + if (nameOfMethodToReplace === "hrtime") { + if ( + _global.process && + typeof _global.process.hrtime === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else if (nameOfMethodToReplace === "nextTick") { + if ( + _global.process && + typeof _global.process.nextTick === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else { + hijackMethod(_global, nameOfMethodToReplace, clock); + } + if ( + clock.timersModuleMethods !== undefined && + timersModule[nameOfMethodToReplace] + ) { + const original = timersModule[nameOfMethodToReplace]; + clock.timersModuleMethods.push({ + methodName: nameOfMethodToReplace, + original: original, + }); + timersModule[nameOfMethodToReplace] = + _global[nameOfMethodToReplace]; + } + if (clock.timersPromisesModuleMethods !== undefined) { + if (nameOfMethodToReplace === "setTimeout") { + clock.timersPromisesModuleMethods.push({ + methodName: "setTimeout", + original: timersPromisesModule.setTimeout, + }); + + timersPromisesModule.setTimeout = ( + delay, + value, + options = {}, + ) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearTimeout(handle); + reject(options.signal.reason); + }; + + const handle = clock.setTimeout(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }, delay); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setImmediate") { + clock.timersPromisesModuleMethods.push({ + methodName: "setImmediate", + original: timersPromisesModule.setImmediate, + }); + + timersPromisesModule.setImmediate = (value, options = {}) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearImmediate(handle); + reject(options.signal.reason); + }; + + const handle = clock.setImmediate(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setInterval") { + clock.timersPromisesModuleMethods.push({ + methodName: "setInterval", + original: timersPromisesModule.setInterval, + }); + + timersPromisesModule.setInterval = ( + delay, + value, + options = {}, + ) => ({ + [Symbol.asyncIterator]: () => { + const createResolvable = () => { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + promise.resolve = resolve; + promise.reject = reject; + return promise; + }; + + let done = false; + let hasThrown = false; + let returnCall; + let nextAvailable = 0; + const nextQueue = []; + + const handle = clock.setInterval(() => { + if (nextQueue.length > 0) { + nextQueue.shift().resolve(); + } else { + nextAvailable++; + } + }, delay); + + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + clock.clearInterval(handle); + done = true; + for (const resolvable of nextQueue) { + resolvable.resolve(); + } + }; + + if (options.signal) { + if (options.signal.aborted) { + done = true; + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + + return { + next: async () => { + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + if (nextAvailable > 0) { + nextAvailable--; + return { done: false, value: value }; + } + + const resolvable = createResolvable(); + nextQueue.push(resolvable); + + await resolvable; + + if (returnCall && nextQueue.length === 0) { + returnCall.resolve(); + } + + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + return { done: false, value: value }; + }, + return: async () => { + if (done) { + return { done: true, value: undefined }; + } + + if (nextQueue.length > 0) { + returnCall = createResolvable(); + await returnCall; + } + + clock.clearInterval(handle); + done = true; + + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + return { done: true, value: undefined }; + }, + }; + }, + }); + } + } + } + + return clock; + } + + /* eslint-enable complexity */ + + return { + timers: timers, + createClock: createClock, + install: install, + withGlobal: withGlobal, + }; +} + +/** + * @typedef {object} FakeTimers + * @property {Timers} timers + * @property {createClock} createClock + * @property {Function} install + * @property {withGlobal} withGlobal + */ + +/* eslint-enable complexity */ + +/** @type {FakeTimers} */ +const defaultImplementation = withGlobal(globalObject); + +exports.timers = defaultImplementation.timers; +exports.createClock = defaultImplementation.createClock; +exports.install = defaultImplementation.install; +exports.withGlobal = withGlobal; + +},{"@sinonjs/commons":46,"timers":undefined,"timers/promises":undefined,"util":90}],60:[function(require,module,exports){ +"use strict"; + +var ARRAY_TYPES = [ + Array, + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, +]; + +module.exports = ARRAY_TYPES; + +},{}],61:[function(require,module,exports){ +"use strict"; + +var arrayProto = require("@sinonjs/commons").prototypes.array; +var deepEqual = require("./deep-equal").use(createMatcher); // eslint-disable-line no-use-before-define +var every = require("@sinonjs/commons").every; +var functionName = require("@sinonjs/commons").functionName; +var get = require("lodash.get"); +var iterableToString = require("./iterable-to-string"); +var objectProto = require("@sinonjs/commons").prototypes.object; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var assertMatcher = require("./create-matcher/assert-matcher"); +var assertMethodExists = require("./create-matcher/assert-method-exists"); +var assertType = require("./create-matcher/assert-type"); +var isIterable = require("./create-matcher/is-iterable"); +var isMatcher = require("./create-matcher/is-matcher"); + +var matcherPrototype = require("./create-matcher/matcher-prototype"); + +var arrayIndexOf = arrayProto.indexOf; +var some = arrayProto.some; + +var hasOwnProperty = objectProto.hasOwnProperty; +var objectToString = objectProto.toString; + +var TYPE_MAP = require("./create-matcher/type-map")(createMatcher); // eslint-disable-line no-use-before-define + +/** + * Creates a matcher object for the passed expectation + * + * @alias module:samsam.createMatcher + * @param {*} expectation An expecttation + * @param {string} message A message for the expectation + * @returns {object} A matcher object + */ +function createMatcher(expectation, message) { + var m = Object.create(matcherPrototype); + var type = typeOf(expectation); + + if (message !== undefined && typeof message !== "string") { + throw new TypeError("Message should be a string"); + } + + if (arguments.length > 2) { + throw new TypeError( + `Expected 1 or 2 arguments, received ${arguments.length}`, + ); + } + + if (type in TYPE_MAP) { + TYPE_MAP[type](m, expectation, message); + } else { + m.test = function (actual) { + return deepEqual(actual, expectation); + }; + } + + if (!m.message) { + m.message = `match(${valueToString(expectation)})`; + } + + // ensure that nothing mutates the exported message value, ref https://github.com/sinonjs/sinon/issues/2502 + Object.defineProperty(m, "message", { + configurable: false, + writable: false, + value: m.message, + }); + + return m; +} + +createMatcher.isMatcher = isMatcher; + +createMatcher.any = createMatcher(function () { + return true; +}, "any"); + +createMatcher.defined = createMatcher(function (actual) { + return actual !== null && actual !== undefined; +}, "defined"); + +createMatcher.truthy = createMatcher(function (actual) { + return Boolean(actual); +}, "truthy"); + +createMatcher.falsy = createMatcher(function (actual) { + return !actual; +}, "falsy"); + +createMatcher.same = function (expectation) { + return createMatcher( + function (actual) { + return expectation === actual; + }, + `same(${valueToString(expectation)})`, + ); +}; + +createMatcher.in = function (arrayOfExpectations) { + if (typeOf(arrayOfExpectations) !== "array") { + throw new TypeError("array expected"); + } + + return createMatcher( + function (actual) { + return some(arrayOfExpectations, function (expectation) { + return expectation === actual; + }); + }, + `in(${valueToString(arrayOfExpectations)})`, + ); +}; + +createMatcher.typeOf = function (type) { + assertType(type, "string", "type"); + return createMatcher(function (actual) { + return typeOf(actual) === type; + }, `typeOf("${type}")`); +}; + +createMatcher.instanceOf = function (type) { + /* istanbul ignore if */ + if ( + typeof Symbol === "undefined" || + typeof Symbol.hasInstance === "undefined" + ) { + assertType(type, "function", "type"); + } else { + assertMethodExists( + type, + Symbol.hasInstance, + "type", + "[Symbol.hasInstance]", + ); + } + return createMatcher( + function (actual) { + return actual instanceof type; + }, + `instanceOf(${functionName(type) || objectToString(type)})`, + ); +}; + +/** + * Creates a property matcher + * + * @private + * @param {Function} propertyTest A function to test the property against a value + * @param {string} messagePrefix A prefix to use for messages generated by the matcher + * @returns {object} A matcher + */ +function createPropertyMatcher(propertyTest, messagePrefix) { + return function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `${messagePrefix}("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + if ( + actual === undefined || + actual === null || + !propertyTest(actual, property) + ) { + return false; + } + return onlyProperty || deepEqual(actual[property], value); + }, message); + }; +} + +createMatcher.has = createPropertyMatcher(function (actual, property) { + if (typeof actual === "object") { + return property in actual; + } + return actual[property] !== undefined; +}, "has"); + +createMatcher.hasOwn = createPropertyMatcher(function (actual, property) { + return hasOwnProperty(actual, property); +}, "hasOwn"); + +createMatcher.hasNested = function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `hasNested("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + if ( + actual === undefined || + actual === null || + get(actual, property) === undefined + ) { + return false; + } + return onlyProperty || deepEqual(get(actual, property), value); + }, message); +}; + +var jsonParseResultTypes = { + null: true, + boolean: true, + number: true, + string: true, + object: true, + array: true, +}; +createMatcher.json = function (value) { + if (!jsonParseResultTypes[typeOf(value)]) { + throw new TypeError("Value cannot be the result of JSON.parse"); + } + var message = `json(${JSON.stringify(value, null, " ")})`; + return createMatcher(function (actual) { + var parsed; + try { + parsed = JSON.parse(actual); + } catch (e) { + return false; + } + return deepEqual(parsed, value); + }, message); +}; + +createMatcher.every = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return every(Object.keys(actual), function (key) { + return predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + every(actual, function (element) { + return predicate.test(element); + }) + ); + }, `every(${predicate.message})`); +}; + +createMatcher.some = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return !every(Object.keys(actual), function (key) { + return !predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + !every(actual, function (element) { + return !predicate.test(element); + }) + ); + }, `some(${predicate.message})`); +}; + +createMatcher.array = createMatcher.typeOf("array"); + +createMatcher.array.deepEquals = function (expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.length === expectation.length; + return ( + typeOf(actual) === "array" && + sameLength && + every(actual, function (element, index) { + var expected = expectation[index]; + return typeOf(expected) === "array" && + typeOf(element) === "array" + ? createMatcher.array.deepEquals(expected).test(element) + : deepEqual(expected, element); + }) + ); + }, + `deepEquals([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.startsWith = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[index] === expectedElement; + }) + ); + }, + `startsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.endsWith = function (expectation) { + return createMatcher( + function (actual) { + // This indicates the index in which we should start matching + var offset = actual.length - expectation.length; + + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[offset + index] === expectedElement; + }) + ); + }, + `endsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.contains = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement) { + return arrayIndexOf(actual, expectedElement) !== -1; + }) + ); + }, + `contains([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map = createMatcher.typeOf("map"); + +createMatcher.map.deepEquals = function mapDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "map" && + sameLength && + every(actual, function (element, key) { + return ( + expectation.has(key) && expectation.get(key) === element + ); + }) + ); + }, + `deepEquals(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map.contains = function mapContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "map" && + every(expectation, function (element, key) { + return actual.has(key) && actual.get(key) === element; + }) + ); + }, + `contains(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set = createMatcher.typeOf("set"); + +createMatcher.set.deepEquals = function setDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "set" && + sameLength && + every(actual, function (element) { + return expectation.has(element); + }) + ); + }, + `deepEquals(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set.contains = function setContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "set" && + every(expectation, function (element) { + return actual.has(element); + }) + ); + }, + `contains(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.bool = createMatcher.typeOf("boolean"); +createMatcher.number = createMatcher.typeOf("number"); +createMatcher.string = createMatcher.typeOf("string"); +createMatcher.object = createMatcher.typeOf("object"); +createMatcher.func = createMatcher.typeOf("function"); +createMatcher.regexp = createMatcher.typeOf("regexp"); +createMatcher.date = createMatcher.typeOf("date"); +createMatcher.symbol = createMatcher.typeOf("symbol"); + +module.exports = createMatcher; + +},{"./create-matcher/assert-matcher":62,"./create-matcher/assert-method-exists":63,"./create-matcher/assert-type":64,"./create-matcher/is-iterable":65,"./create-matcher/is-matcher":66,"./create-matcher/matcher-prototype":68,"./create-matcher/type-map":69,"./deep-equal":70,"./iterable-to-string":84,"@sinonjs/commons":46,"lodash.get":92}],62:[function(require,module,exports){ +"use strict"; + +var isMatcher = require("./is-matcher"); + +/** + * Throws a TypeError when `value` is not a matcher + * + * @private + * @param {*} value The value to examine + */ +function assertMatcher(value) { + if (!isMatcher(value)) { + throw new TypeError("Matcher expected"); + } +} + +module.exports = assertMatcher; + +},{"./is-matcher":66}],63:[function(require,module,exports){ +"use strict"; + +/** + * Throws a TypeError when expected method doesn't exist + * + * @private + * @param {*} value A value to examine + * @param {string} method The name of the method to look for + * @param {name} name A name to use for the error message + * @param {string} methodPath The name of the method to use for error messages + * @throws {TypeError} When the method doesn't exist + */ +function assertMethodExists(value, method, name, methodPath) { + if (value[method] === null || value[method] === undefined) { + throw new TypeError(`Expected ${name} to have method ${methodPath}`); + } +} + +module.exports = assertMethodExists; + +},{}],64:[function(require,module,exports){ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Ensures that value is of type + * + * @private + * @param {*} value A value to examine + * @param {string} type A basic JavaScript type to compare to, e.g. "object", "string" + * @param {string} name A string to use for the error message + * @throws {TypeError} If value is not of the expected type + * @returns {undefined} + */ +function assertType(value, type, name) { + var actual = typeOf(value); + if (actual !== type) { + throw new TypeError( + `Expected type of ${name} to be ${type}, but was ${actual}`, + ); + } +} + +module.exports = assertType; + +},{"@sinonjs/commons":46}],65:[function(require,module,exports){ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Returns `true` for iterables + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` looks like an iterable + */ +function isIterable(value) { + return Boolean(value) && typeOf(value.forEach) === "function"; +} + +module.exports = isIterable; + +},{"@sinonjs/commons":46}],66:[function(require,module,exports){ +"use strict"; + +var isPrototypeOf = require("@sinonjs/commons").prototypes.object.isPrototypeOf; + +var matcherPrototype = require("./matcher-prototype"); + +/** + * Returns `true` when `object` is a matcher + * + * @private + * @param {*} object A value to examine + * @returns {boolean} Returns `true` when `object` is a matcher + */ +function isMatcher(object) { + return isPrototypeOf(matcherPrototype, object); +} + +module.exports = isMatcher; + +},{"./matcher-prototype":68,"@sinonjs/commons":46}],67:[function(require,module,exports){ +"use strict"; + +var every = require("@sinonjs/commons").prototypes.array.every; +var concat = require("@sinonjs/commons").prototypes.array.concat; +var typeOf = require("@sinonjs/commons").typeOf; + +var deepEqualFactory = require("../deep-equal").use; + +var identical = require("../identical"); +var isMatcher = require("./is-matcher"); + +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Matches `actual` with `expectation` + * + * @private + * @param {*} actual A value to examine + * @param {object} expectation An object with properties to match on + * @param {object} matcher A matcher to use for comparison + * @returns {boolean} Returns true when `actual` matches all properties in `expectation` + */ +function matchObject(actual, expectation, matcher) { + var deepEqual = deepEqualFactory(matcher); + if (actual === null || actual === undefined) { + return false; + } + + var expectedKeys = keys(expectation); + /* istanbul ignore else: cannot collect coverage for engine that doesn't support Symbol */ + if (typeOf(getOwnPropertySymbols) === "function") { + expectedKeys = concat(expectedKeys, getOwnPropertySymbols(expectation)); + } + + return every(expectedKeys, function (key) { + var exp = expectation[key]; + var act = actual[key]; + + if (isMatcher(exp)) { + if (!exp.test(act)) { + return false; + } + } else if (typeOf(exp) === "object") { + if (identical(exp, act)) { + return true; + } + if (!matchObject(act, exp, matcher)) { + return false; + } + } else if (!deepEqual(act, exp)) { + return false; + } + + return true; + }); +} + +module.exports = matchObject; + +},{"../deep-equal":70,"../identical":72,"./is-matcher":66,"@sinonjs/commons":46}],68:[function(require,module,exports){ +"use strict"; + +var matcherPrototype = { + toString: function () { + return this.message; + }, +}; + +matcherPrototype.or = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var or = Object.create(matcherPrototype); + or.test = function (actual) { + return m1.test(actual) || m2.test(actual); + }; + or.message = `${m1.message}.or(${m2.message})`; + return or; +}; + +matcherPrototype.and = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var and = Object.create(matcherPrototype); + and.test = function (actual) { + return m1.test(actual) && m2.test(actual); + }; + and.message = `${m1.message}.and(${m2.message})`; + return and; +}; + +module.exports = matcherPrototype; + +},{"../create-matcher":61}],69:[function(require,module,exports){ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var join = require("@sinonjs/commons").prototypes.array.join; +var map = require("@sinonjs/commons").prototypes.array.map; +var stringIndexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var matchObject = require("./match-object"); + +var createTypeMap = function (match) { + return { + function: function (m, expectation, message) { + m.test = expectation; + m.message = message || `match(${functionName(expectation)})`; + }, + number: function (m, expectation) { + m.test = function (actual) { + // we need type coercion here + return expectation == actual; // eslint-disable-line eqeqeq + }; + }, + object: function (m, expectation) { + var array = []; + + if (typeof expectation.test === "function") { + m.test = function (actual) { + return expectation.test(actual) === true; + }; + m.message = `match(${functionName(expectation.test)})`; + return m; + } + + array = map(Object.keys(expectation), function (key) { + return `${key}: ${valueToString(expectation[key])}`; + }); + + m.test = function (actual) { + return matchObject(actual, expectation, match); + }; + m.message = `match(${join(array, ", ")})`; + + return m; + }, + regexp: function (m, expectation) { + m.test = function (actual) { + return typeof actual === "string" && expectation.test(actual); + }; + }, + string: function (m, expectation) { + m.test = function (actual) { + return ( + typeof actual === "string" && + stringIndexOf(actual, expectation) !== -1 + ); + }; + m.message = `match("${expectation}")`; + }, + }; +}; + +module.exports = createTypeMap; + +},{"./match-object":67,"@sinonjs/commons":46}],70:[function(require,module,exports){ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var className = require("@sinonjs/commons").className; +var typeOf = require("@sinonjs/commons").typeOf; +var arrayProto = require("@sinonjs/commons").prototypes.array; +var objectProto = require("@sinonjs/commons").prototypes.object; +var mapForEach = require("@sinonjs/commons").prototypes.map.forEach; + +var getClass = require("./get-class"); +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isArrayType = require("./is-array-type"); +var isDate = require("./is-date"); +var isElement = require("./is-element"); +var isIterable = require("./is-iterable"); +var isMap = require("./is-map"); +var isNaN = require("./is-nan"); +var isObject = require("./is-object"); +var isSet = require("./is-set"); +var isSubset = require("./is-subset"); + +var concat = arrayProto.concat; +var every = arrayProto.every; +var push = arrayProto.push; + +var getTime = Date.prototype.getTime; +var hasOwnProperty = objectProto.hasOwnProperty; +var indexOf = arrayProto.indexOf; +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Deep equal comparison. Two values are "deep equal" when: + * + * - They are equal, according to samsam.identical + * - They are both date objects representing the same time + * - They are both arrays containing elements that are all deepEqual + * - They are objects with the same set of properties, and each property + * in ``actual`` is deepEqual to the corresponding property in ``expectation`` + * + * Supports cyclic objects. + * + * @alias module:samsam.deepEqual + * @param {*} actual The object to examine + * @param {*} expectation The object actual is expected to be equal to + * @param {object} match A value to match on + * @returns {boolean} Returns true when actual and expectation are considered equal + */ +function deepEqualCyclic(actual, expectation, match) { + // used for cyclic comparison + // contain already visited objects + var actualObjects = []; + var expectationObjects = []; + // contain pathes (position in the object structure) + // of the already visited objects + // indexes same as in objects arrays + var actualPaths = []; + var expectationPaths = []; + // contains combinations of already compared objects + // in the manner: { "$1['ref']$2['ref']": true } + var compared = {}; + + // does the recursion for the deep equal check + // eslint-disable-next-line complexity + return (function deepEqual( + actualObj, + expectationObj, + actualPath, + expectationPath, + ) { + // If both are matchers they must be the same instance in order to be + // considered equal If we didn't do that we would end up running one + // matcher against the other + if (match && match.isMatcher(expectationObj)) { + if (match.isMatcher(actualObj)) { + return actualObj === expectationObj; + } + return expectationObj.test(actualObj); + } + + var actualType = typeof actualObj; + var expectationType = typeof expectationObj; + + if ( + actualObj === expectationObj || + isNaN(actualObj) || + isNaN(expectationObj) || + actualObj === null || + expectationObj === null || + actualObj === undefined || + expectationObj === undefined || + actualType !== "object" || + expectationType !== "object" + ) { + return identical(actualObj, expectationObj); + } + + // Elements are only equal if identical(expected, actual) + if (isElement(actualObj) || isElement(expectationObj)) { + return false; + } + + var isActualDate = isDate(actualObj); + var isExpectationDate = isDate(expectationObj); + if (isActualDate || isExpectationDate) { + if ( + !isActualDate || + !isExpectationDate || + getTime.call(actualObj) !== getTime.call(expectationObj) + ) { + return false; + } + } + + if (actualObj instanceof RegExp && expectationObj instanceof RegExp) { + if (valueToString(actualObj) !== valueToString(expectationObj)) { + return false; + } + } + + if (actualObj instanceof Promise && expectationObj instanceof Promise) { + return actualObj === expectationObj; + } + + if (actualObj instanceof Error && expectationObj instanceof Error) { + return actualObj === expectationObj; + } + + var actualClass = getClass(actualObj); + var expectationClass = getClass(expectationObj); + var actualKeys = keys(actualObj); + var expectationKeys = keys(expectationObj); + var actualName = className(actualObj); + var expectationName = className(expectationObj); + var expectationSymbols = + typeOf(getOwnPropertySymbols) === "function" + ? getOwnPropertySymbols(expectationObj) + : /* istanbul ignore next: cannot collect coverage for engine that doesn't support Symbol */ + []; + var expectationKeysAndSymbols = concat( + expectationKeys, + expectationSymbols, + ); + + if (isArguments(actualObj) || isArguments(expectationObj)) { + if (actualObj.length !== expectationObj.length) { + return false; + } + } else { + if ( + actualType !== expectationType || + actualClass !== expectationClass || + actualKeys.length !== expectationKeys.length || + (actualName && + expectationName && + actualName !== expectationName) + ) { + return false; + } + } + + if (isSet(actualObj) || isSet(expectationObj)) { + if ( + !isSet(actualObj) || + !isSet(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + return isSubset(actualObj, expectationObj, deepEqual); + } + + if (isMap(actualObj) || isMap(expectationObj)) { + if ( + !isMap(actualObj) || + !isMap(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + var mapsDeeplyEqual = true; + mapForEach(actualObj, function (value, key) { + mapsDeeplyEqual = + mapsDeeplyEqual && + deepEqualCyclic(value, expectationObj.get(key)); + }); + + return mapsDeeplyEqual; + } + + // jQuery objects have iteration protocols + // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + // But, they don't work well with the implementation concerning iterables below, + // so we will detect them and use jQuery's own equality function + /* istanbul ignore next -- this can only be tested in the `test-headless` script */ + if ( + actualObj.constructor && + actualObj.constructor.name === "jQuery" && + typeof actualObj.is === "function" + ) { + return actualObj.is(expectationObj); + } + + var isActualNonArrayIterable = + isIterable(actualObj) && + !isArrayType(actualObj) && + !isArguments(actualObj); + var isExpectationNonArrayIterable = + isIterable(expectationObj) && + !isArrayType(expectationObj) && + !isArguments(expectationObj); + if (isActualNonArrayIterable || isExpectationNonArrayIterable) { + var actualArray = Array.from(actualObj); + var expectationArray = Array.from(expectationObj); + if (actualArray.length !== expectationArray.length) { + return false; + } + + var arrayDeeplyEquals = true; + every(actualArray, function (key) { + arrayDeeplyEquals = + arrayDeeplyEquals && + deepEqualCyclic(actualArray[key], expectationArray[key]); + }); + + return arrayDeeplyEquals; + } + + return every(expectationKeysAndSymbols, function (key) { + if (!hasOwnProperty(actualObj, key)) { + return false; + } + + var actualValue = actualObj[key]; + var expectationValue = expectationObj[key]; + var actualObject = isObject(actualValue); + var expectationObject = isObject(expectationValue); + // determines, if the objects were already visited + // (it's faster to check for isObject first, than to + // get -1 from getIndex for non objects) + var actualIndex = actualObject + ? indexOf(actualObjects, actualValue) + : -1; + var expectationIndex = expectationObject + ? indexOf(expectationObjects, expectationValue) + : -1; + // determines the new paths of the objects + // - for non cyclic objects the current path will be extended + // by current property name + // - for cyclic objects the stored path is taken + var newActualPath = + actualIndex !== -1 + ? actualPaths[actualIndex] + : `${actualPath}[${JSON.stringify(key)}]`; + var newExpectationPath = + expectationIndex !== -1 + ? expectationPaths[expectationIndex] + : `${expectationPath}[${JSON.stringify(key)}]`; + var combinedPath = newActualPath + newExpectationPath; + + // stop recursion if current objects are already compared + if (compared[combinedPath]) { + return true; + } + + // remember the current objects and their paths + if (actualIndex === -1 && actualObject) { + push(actualObjects, actualValue); + push(actualPaths, newActualPath); + } + if (expectationIndex === -1 && expectationObject) { + push(expectationObjects, expectationValue); + push(expectationPaths, newExpectationPath); + } + + // remember that the current objects are already compared + if (actualObject && expectationObject) { + compared[combinedPath] = true; + } + + // End of cyclic logic + + // neither actualValue nor expectationValue is a cycle + // continue with next level + return deepEqual( + actualValue, + expectationValue, + newActualPath, + newExpectationPath, + ); + }); + })(actual, expectation, "$1", "$2"); +} + +deepEqualCyclic.use = function (match) { + return function deepEqual(a, b) { + return deepEqualCyclic(a, b, match); + }; +}; + +module.exports = deepEqualCyclic; + +},{"./get-class":71,"./identical":72,"./is-arguments":73,"./is-array-type":74,"./is-date":75,"./is-element":76,"./is-iterable":77,"./is-map":78,"./is-nan":79,"./is-object":81,"./is-set":82,"./is-subset":83,"@sinonjs/commons":46}],71:[function(require,module,exports){ +"use strict"; + +var toString = require("@sinonjs/commons").prototypes.object.toString; + +/** + * Returns the internal `Class` by calling `Object.prototype.toString` + * with the provided value as `this`. Return value is a `String`, naming the + * internal class, e.g. "Array" + * + * @private + * @param {*} value - Any value + * @returns {string} - A string representation of the `Class` of `value` + */ +function getClass(value) { + return toString(value).split(/[ \]]/)[1]; +} + +module.exports = getClass; + +},{"@sinonjs/commons":46}],72:[function(require,module,exports){ +"use strict"; + +var isNaN = require("./is-nan"); +var isNegZero = require("./is-neg-zero"); + +/** + * Strict equality check according to EcmaScript Harmony's `egal`. + * + * **From the Harmony wiki:** + * > An `egal` function simply makes available the internal `SameValue` function + * > from section 9.12 of the ES5 spec. If two values are egal, then they are not + * > observably distinguishable. + * + * `identical` returns `true` when `===` is `true`, except for `-0` and + * `+0`, where it returns `false`. Additionally, it returns `true` when + * `NaN` is compared to itself. + * + * @alias module:samsam.identical + * @param {*} obj1 The first value to compare + * @param {*} obj2 The second value to compare + * @returns {boolean} Returns `true` when the objects are *egal*, `false` otherwise + */ +function identical(obj1, obj2) { + if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) { + return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2); + } + + return false; +} + +module.exports = identical; + +},{"./is-nan":79,"./is-neg-zero":80}],73:[function(require,module,exports){ +"use strict"; + +var getClass = require("./get-class"); + +/** + * Returns `true` when `object` is an `arguments` object, `false` otherwise + * + * @alias module:samsam.isArguments + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an `arguments` object + */ +function isArguments(object) { + return getClass(object) === "Arguments"; +} + +module.exports = isArguments; + +},{"./get-class":71}],74:[function(require,module,exports){ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var indexOf = require("@sinonjs/commons").prototypes.array.indexOf; +var map = require("@sinonjs/commons").prototypes.array.map; +var ARRAY_TYPES = require("./array-types"); +var type = require("type-detect"); + +/** + * Returns `true` when `object` is an array type, `false` otherwise + * + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an array type + * @private + */ +function isArrayType(object) { + return indexOf(map(ARRAY_TYPES, functionName), type(object)) !== -1; +} + +module.exports = isArrayType; + +},{"./array-types":60,"@sinonjs/commons":46,"type-detect":87}],75:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is an instance of Date + * + * @private + * @param {Date} value The value to examine + * @returns {boolean} `true` when `value` is an instance of Date + */ +function isDate(value) { + return value instanceof Date; +} + +module.exports = isDate; + +},{}],76:[function(require,module,exports){ +"use strict"; + +var div = typeof document !== "undefined" && document.createElement("div"); + +/** + * Returns `true` when `object` is a DOM element node. + * + * Unlike Underscore.js/lodash, this function will return `false` if `object` + * is an *element-like* object, i.e. a regular object with a `nodeType` + * property that holds the value `1`. + * + * @alias module:samsam.isElement + * @param {object} object The object to examine + * @returns {boolean} Returns `true` for DOM element nodes + */ +function isElement(object) { + if (!object || object.nodeType !== 1 || !div) { + return false; + } + try { + object.appendChild(div); + object.removeChild(div); + } catch (e) { + return false; + } + return true; +} + +module.exports = isElement; + +},{}],77:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the argument is an iterable, `false` otherwise + * + * @alias module:samsam.isIterable + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an iterable, `false` otherwise + */ +function isIterable(val) { + // checks for null and undefined + if (typeof val !== "object") { + return false; + } + return typeof val[Symbol.iterator] === "function"; +} + +module.exports = isIterable; + +},{}],78:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is a Map + * + * @param {*} value A value to examine + * @returns {boolean} `true` when `value` is an instance of `Map`, `false` otherwise + * @private + */ +function isMap(value) { + return typeof Map !== "undefined" && value instanceof Map; +} + +module.exports = isMap; + +},{}],79:[function(require,module,exports){ +"use strict"; + +/** + * Compares a `value` to `NaN` + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `NaN` + */ +function isNaN(value) { + // Unlike global `isNaN`, this function avoids type coercion + // `typeof` check avoids IE host object issues, hat tip to + // lodash + + // eslint-disable-next-line no-self-compare + return typeof value === "number" && value !== value; +} + +module.exports = isNaN; + +},{}],80:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is `-0` + * + * @alias module:samsam.isNegZero + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `-0` + */ +function isNegZero(value) { + return value === 0 && 1 / value === -Infinity; +} + +module.exports = isNegZero; + +},{}],81:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the value is a regular Object and not a specialized Object + * + * This helps speed up deepEqual cyclic checks + * + * The premise is that only Objects are stored in the visited array. + * So if this function returns false, we don't have to do the + * expensive operation of searching for the value in the the array of already + * visited objects + * + * @private + * @param {object} value The object to examine + * @returns {boolean} `true` when the object is a non-specialised object + */ +function isObject(value) { + return ( + typeof value === "object" && + value !== null && + // none of these are collection objects, so we can return false + !(value instanceof Boolean) && + !(value instanceof Date) && + !(value instanceof Error) && + !(value instanceof Number) && + !(value instanceof RegExp) && + !(value instanceof String) + ); +} + +module.exports = isObject; + +},{}],82:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the argument is an instance of Set, `false` otherwise + * + * @alias module:samsam.isSet + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an instance of Set, `false` otherwise + */ +function isSet(val) { + return (typeof Set !== "undefined" && val instanceof Set) || false; +} + +module.exports = isSet; + +},{}],83:[function(require,module,exports){ +"use strict"; + +var forEach = require("@sinonjs/commons").prototypes.set.forEach; + +/** + * Returns `true` when `s1` is a subset of `s2`, `false` otherwise + * + * @private + * @param {Array|Set} s1 The target value + * @param {Array|Set} s2 The containing value + * @param {Function} compare A comparison function, should return `true` when + * values are considered equal + * @returns {boolean} Returns `true` when `s1` is a subset of `s2`, `false`` otherwise + */ +function isSubset(s1, s2, compare) { + var allContained = true; + forEach(s1, function (v1) { + var includes = false; + forEach(s2, function (v2) { + if (compare(v2, v1)) { + includes = true; + } + }); + allContained = allContained && includes; + }); + + return allContained; +} + +module.exports = isSubset; + +},{"@sinonjs/commons":46}],84:[function(require,module,exports){ +"use strict"; + +var slice = require("@sinonjs/commons").prototypes.string.slice; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +/** + * Creates a string represenation of an iterable object + * + * @private + * @param {object} obj The iterable object to stringify + * @returns {string} A string representation + */ +function iterableToString(obj) { + if (typeOf(obj) === "map") { + return mapToString(obj); + } + + return genericIterableToString(obj); +} + +/** + * Creates a string representation of a Map + * + * @private + * @param {Map} map The map to stringify + * @returns {string} A string representation + */ +function mapToString(map) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + map.forEach(function (value, key) { + representation += `[${stringify(key)},${stringify(value)}],`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Create a string represenation for an iterable + * + * @private + * @param {object} iterable The iterable to stringify + * @returns {string} A string representation + */ +function genericIterableToString(iterable) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + iterable.forEach(function (value) { + representation += `${stringify(value)},`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Creates a string representation of the passed `item` + * + * @private + * @param {object} item The item to stringify + * @returns {string} A string representation of `item` + */ +function stringify(item) { + return typeof item === "string" ? `'${item}'` : valueToString(item); +} + +module.exports = iterableToString; + +},{"@sinonjs/commons":46}],85:[function(require,module,exports){ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var indexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var forEach = require("@sinonjs/commons").prototypes.array.forEach; +var type = require("type-detect"); + +var engineCanCompareMaps = typeof Array.from === "function"; +var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define +var isArrayType = require("./is-array-type"); +var isSubset = require("./is-subset"); +var createMatcher = require("./create-matcher"); + +/** + * Returns true when `array` contains all of `subset` as defined by the `compare` + * argument + * + * @param {Array} array An array to search for a subset + * @param {Array} subset The subset to find in the array + * @param {Function} compare A comparison function + * @returns {boolean} [description] + * @private + */ +function arrayContains(array, subset, compare) { + if (subset.length === 0) { + return true; + } + var i, l, j, k; + for (i = 0, l = array.length; i < l; ++i) { + if (compare(array[i], subset[0])) { + for (j = 0, k = subset.length; j < k; ++j) { + if (i + j >= l) { + return false; + } + if (!compare(array[i + j], subset[j])) { + return false; + } + } + return true; + } + } + return false; +} + +/* eslint-disable complexity */ +/** + * Matches an object with a matcher (or value) + * + * @alias module:samsam.match + * @param {object} object The object candidate to match + * @param {object} matcherOrValue A matcher or value to match against + * @returns {boolean} true when `object` matches `matcherOrValue` + */ +function match(object, matcherOrValue) { + if (matcherOrValue && typeof matcherOrValue.test === "function") { + return matcherOrValue.test(object); + } + + switch (type(matcherOrValue)) { + case "bigint": + case "boolean": + case "number": + case "symbol": + return matcherOrValue === object; + case "function": + return matcherOrValue(object) === true; + case "string": + var notNull = typeof object === "string" || Boolean(object); + return ( + notNull && + indexOf( + valueToString(object).toLowerCase(), + matcherOrValue.toLowerCase(), + ) >= 0 + ); + case "null": + return object === null; + case "undefined": + return typeof object === "undefined"; + case "Date": + /* istanbul ignore else */ + if (type(object) === "Date") { + return object.getTime() === matcherOrValue.getTime(); + } + /* istanbul ignore next: this is basically the rest of the function, which is covered */ + break; + case "Array": + case "Int8Array": + case "Uint8Array": + case "Uint8ClampedArray": + case "Int16Array": + case "Uint16Array": + case "Int32Array": + case "Uint32Array": + case "Float32Array": + case "Float64Array": + return ( + isArrayType(matcherOrValue) && + arrayContains(object, matcherOrValue, match) + ); + case "Map": + /* istanbul ignore next: this is covered by a test, that is only run in IE, but we collect coverage information in node*/ + if (!engineCanCompareMaps) { + throw new Error( + "The JavaScript engine does not support Array.from and cannot reliably do value comparison of Map instances", + ); + } + + return ( + type(object) === "Map" && + arrayContains( + Array.from(object), + Array.from(matcherOrValue), + match, + ) + ); + default: + break; + } + + switch (type(object)) { + case "null": + return false; + case "Set": + return isSubset(matcherOrValue, object, match); + default: + break; + } + + /* istanbul ignore else */ + if (matcherOrValue && typeof matcherOrValue === "object") { + if (matcherOrValue === object) { + return true; + } + if (typeof object !== "object") { + return false; + } + var prop; + // eslint-disable-next-line guard-for-in + for (prop in matcherOrValue) { + var value = object[prop]; + if ( + typeof value === "undefined" && + typeof object.getAttribute === "function" + ) { + value = object.getAttribute(prop); + } + if ( + matcherOrValue[prop] === null || + typeof matcherOrValue[prop] === "undefined" + ) { + if (value !== matcherOrValue[prop]) { + return false; + } + } else if ( + typeof value === "undefined" || + !deepEqual(value, matcherOrValue[prop]) + ) { + return false; + } + } + return true; + } + + /* istanbul ignore next */ + throw new Error("Matcher was an unknown or unsupported type"); +} +/* eslint-enable complexity */ + +forEach(Object.keys(createMatcher), function (key) { + match[key] = createMatcher[key]; +}); + +module.exports = match; + +},{"./create-matcher":61,"./deep-equal":70,"./is-array-type":74,"./is-subset":83,"@sinonjs/commons":46,"type-detect":87}],86:[function(require,module,exports){ +"use strict"; + +/** + * @module samsam + */ +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isElement = require("./is-element"); +var isNegZero = require("./is-neg-zero"); +var isSet = require("./is-set"); +var isMap = require("./is-map"); +var match = require("./match"); +var deepEqualCyclic = require("./deep-equal").use(match); +var createMatcher = require("./create-matcher"); + +module.exports = { + createMatcher: createMatcher, + deepEqual: deepEqualCyclic, + identical: identical, + isArguments: isArguments, + isElement: isElement, + isMap: isMap, + isNegZero: isNegZero, + isSet: isSet, + match: match, +}; + +},{"./create-matcher":61,"./deep-equal":70,"./identical":72,"./is-arguments":73,"./is-element":76,"./is-map":78,"./is-neg-zero":80,"./is-set":82,"./match":85}],87:[function(require,module,exports){ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.typeDetect = factory()); +})(this, (function () { 'use strict'; + + var promiseExists = typeof Promise === 'function'; + var globalObject = (function (Obj) { + if (typeof globalThis === 'object') { + return globalThis; + } + Object.defineProperty(Obj, 'typeDetectGlobalObject', { + get: function get() { + return this; + }, + configurable: true, + }); + var global = typeDetectGlobalObject; + delete Obj.typeDetectGlobalObject; + return global; + })(Object.prototype); + var symbolExists = typeof Symbol !== 'undefined'; + var mapExists = typeof Map !== 'undefined'; + var setExists = typeof Set !== 'undefined'; + var weakMapExists = typeof WeakMap !== 'undefined'; + var weakSetExists = typeof WeakSet !== 'undefined'; + var dataViewExists = typeof DataView !== 'undefined'; + var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; + var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; + var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; + var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; + var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); + var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); + var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; + var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); + var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; + var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); + var toStringLeftSliceLength = 8; + var toStringRightSliceLength = -1; + function typeDetect(obj) { + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + if (obj === null) { + return 'null'; + } + if (obj === globalObject) { + return 'global'; + } + if (Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) { + return 'Array'; + } + if (typeof window === 'object' && window !== null) { + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + if (typeof window.navigator === 'object') { + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + var objPrototype = Object.getPrototypeOf(obj); + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + if (objPrototype === Date.prototype) { + return 'Date'; + } + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + if (objPrototype === null) { + return 'Object'; + } + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); + } + + return typeDetect; + +})); + +},{}],88:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],89:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],90:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +},{"./support/isBuffer":89,"inherits":88}],91:[function(require,module,exports){ +/*! + + diff v7.0.0 + +BSD 3-Clause License + +Copyright (c) 2009-2015, Kevin Decker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@license +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Diff = {})); +})(this, (function (exports) { 'use strict'; + + function Diff() {} + Diff.prototype = { + diff: function diff(oldString, newString) { + var _options$timeout; + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var callback = options.callback; + if (typeof options === 'function') { + callback = options; + options = {}; + } + var self = this; + function done(value) { + value = self.postProcess(value, options); + if (callback) { + setTimeout(function () { + callback(value); + }, 0); + return true; + } else { + return value; + } + } + + // Allow subclasses to massage the input prior to running + oldString = this.castInput(oldString, options); + newString = this.castInput(newString, options); + oldString = this.removeEmpty(this.tokenize(oldString, options)); + newString = this.removeEmpty(this.tokenize(newString, options)); + var newLen = newString.length, + oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + if (options.maxEditLength != null) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity; + var abortAfterTimestamp = Date.now() + maxExecutionTime; + var bestPath = [{ + oldPos: -1, + lastComponent: undefined + }]; + + // Seed editLength = 0, i.e. the content starts with the same values + var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options); + if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + // Identity per the equality and tokenizer + return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken)); + } + + // Once we hit the right edge of the edit graph on some diagonal k, we can + // definitely reach the end of the edit graph in no more than k edits, so + // there's no point in considering any moves to diagonal k+1 any more (from + // which we're guaranteed to need at least k+1 more edits). + // Similarly, once we've reached the bottom of the edit graph, there's no + // point considering moves to lower diagonals. + // We record this fact by setting minDiagonalToConsider and + // maxDiagonalToConsider to some finite value once we've hit the edge of + // the edit graph. + // This optimization is not faithful to the original algorithm presented in + // Myers's paper, which instead pointlessly extends D-paths off the end of + // the edit graph - see page 7 of Myers's paper which notes this point + // explicitly and illustrates it with a diagram. This has major performance + // implications for some common scenarios. For instance, to compute a diff + // where the new text simply appends d characters on the end of the + // original text of length n, the true Myers algorithm will take O(n+d^2) + // time while this optimization needs only O(n+d) time. + var minDiagonalToConsider = -Infinity, + maxDiagonalToConsider = Infinity; + + // Main worker method. checks all permutations of a given edit length for acceptance. + function execEditLength() { + for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { + var basePath = void 0; + var removePath = bestPath[diagonalPath - 1], + addPath = bestPath[diagonalPath + 1]; + if (removePath) { + // No one else is going to attempt to use this value, clear it + bestPath[diagonalPath - 1] = undefined; + } + var canAdd = false; + if (addPath) { + // what newPos will be after we do an insertion: + var addPathNewPos = addPath.oldPos - diagonalPath; + canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; + } + var canRemove = removePath && removePath.oldPos + 1 < oldLen; + if (!canAdd && !canRemove) { + // If this path is a terminal then prune + bestPath[diagonalPath] = undefined; + continue; + } + + // Select the diagonal that we want to branch from. We select the prior + // path whose position in the old string is the farthest from the origin + // and does not pass the bounds of the diff graph + if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) { + basePath = self.addToPath(addPath, true, false, 0, options); + } else { + basePath = self.addToPath(removePath, false, true, 1, options); + } + newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options); + if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + // If we have hit the end of both strings, then we are done + return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken)); + } else { + bestPath[diagonalPath] = basePath; + if (basePath.oldPos + 1 >= oldLen) { + maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); + } + if (newPos + 1 >= newLen) { + minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); + } + } + } + editLength++; + } + + // Performs the length of edit iteration. Is a bit fugly as this has to support the + // sync and async mode which is never fun. Loops over execEditLength until a value + // is produced, or until the edit length exceeds options.maxEditLength (if given), + // in which case it will return undefined. + if (callback) { + (function exec() { + setTimeout(function () { + if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { + return callback(); + } + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + } + }, + addToPath: function addToPath(path, added, removed, oldPosInc, options) { + var last = path.lastComponent; + if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { + return { + oldPos: path.oldPos + oldPosInc, + lastComponent: { + count: last.count + 1, + added: added, + removed: removed, + previousComponent: last.previousComponent + } + }; + } else { + return { + oldPos: path.oldPos + oldPosInc, + lastComponent: { + count: 1, + added: added, + removed: removed, + previousComponent: last + } + }; + } + }, + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) { + var newLen = newString.length, + oldLen = oldString.length, + oldPos = basePath.oldPos, + newPos = oldPos - diagonalPath, + commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) { + newPos++; + oldPos++; + commonCount++; + if (options.oneChangePerToken) { + basePath.lastComponent = { + count: 1, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + } + if (commonCount && !options.oneChangePerToken) { + basePath.lastComponent = { + count: commonCount, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + basePath.oldPos = oldPos; + return newPos; + }, + equals: function equals(left, right, options) { + if (options.comparator) { + return options.comparator(left, right); + } else { + return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + removeEmpty: function removeEmpty(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + return ret; + }, + castInput: function castInput(value) { + return value; + }, + tokenize: function tokenize(value) { + return Array.from(value); + }, + join: function join(chars) { + return chars.join(''); + }, + postProcess: function postProcess(changeObjects) { + return changeObjects; + } + }; + function buildValues(diff, lastComponent, newString, oldString, useLongestToken) { + // First we convert our linked list of components in reverse order to an + // array in the right order: + var components = []; + var nextComponent; + while (lastComponent) { + components.push(lastComponent); + nextComponent = lastComponent.previousComponent; + delete lastComponent.previousComponent; + lastComponent = nextComponent; + } + components.reverse(); + var componentPos = 0, + componentLen = components.length, + newPos = 0, + oldPos = 0; + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function (value, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value.length ? oldValue : value; + }); + component.value = diff.join(value); + } else { + component.value = diff.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + + // Common case + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + } + } + return components; + } + + var characterDiff = new Diff(); + function diffChars(oldStr, newStr, options) { + return characterDiff.diff(oldStr, newStr, options); + } + + function longestCommonPrefix(str1, str2) { + var i; + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[i] != str2[i]) { + return str1.slice(0, i); + } + } + return str1.slice(0, i); + } + function longestCommonSuffix(str1, str2) { + var i; + + // Unlike longestCommonPrefix, we need a special case to handle all scenarios + // where we return the empty string since str1.slice(-0) will return the + // entire string. + if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) { + return ''; + } + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) { + return str1.slice(-i); + } + } + return str1.slice(-i); + } + function replacePrefix(string, oldPrefix, newPrefix) { + if (string.slice(0, oldPrefix.length) != oldPrefix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug")); + } + return newPrefix + string.slice(oldPrefix.length); + } + function replaceSuffix(string, oldSuffix, newSuffix) { + if (!oldSuffix) { + return string + newSuffix; + } + if (string.slice(-oldSuffix.length) != oldSuffix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug")); + } + return string.slice(0, -oldSuffix.length) + newSuffix; + } + function removePrefix(string, oldPrefix) { + return replacePrefix(string, oldPrefix, ''); + } + function removeSuffix(string, oldSuffix) { + return replaceSuffix(string, oldSuffix, ''); + } + function maximumOverlap(string1, string2) { + return string2.slice(0, overlapCount(string1, string2)); + } + + // Nicked from https://stackoverflow.com/a/60422853/1709587 + function overlapCount(a, b) { + // Deal with cases where the strings differ in length + var startA = 0; + if (a.length > b.length) { + startA = a.length - b.length; + } + var endB = b.length; + if (a.length < b.length) { + endB = a.length; + } + // Create a back-reference for each index + // that should be followed in case of a mismatch. + // We only need B to make these references: + var map = Array(endB); + var k = 0; // Index that lags behind j + map[0] = 0; + for (var j = 1; j < endB; j++) { + if (b[j] == b[k]) { + map[j] = map[k]; // skip over the same character (optional optimisation) + } else { + map[j] = k; + } + while (k > 0 && b[j] != b[k]) { + k = map[k]; + } + if (b[j] == b[k]) { + k++; + } + } + // Phase 2: use these references while iterating over A + k = 0; + for (var i = startA; i < a.length; i++) { + while (k > 0 && a[i] != b[k]) { + k = map[k]; + } + if (a[i] == b[k]) { + k++; + } + } + return k; + } + + /** + * Returns true if the string consistently uses Windows line endings. + */ + function hasOnlyWinLineEndings(string) { + return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/); + } + + /** + * Returns true if the string consistently uses Unix line endings. + */ + function hasOnlyUnixLineEndings(string) { + return !string.includes('\r\n') && string.includes('\n'); + } + + // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode + // + // Ranges and exceptions: + // Latin-1 Supplement, 0080–00FF + // - U+00D7 × Multiplication sign + // - U+00F7 ÷ Division sign + // Latin Extended-A, 0100–017F + // Latin Extended-B, 0180–024F + // IPA Extensions, 0250–02AF + // Spacing Modifier Letters, 02B0–02FF + // - U+02C7 ˇ ˇ Caron + // - U+02D8 ˘ ˘ Breve + // - U+02D9 ˙ ˙ Dot Above + // - U+02DA ˚ ˚ Ring Above + // - U+02DB ˛ ˛ Ogonek + // - U+02DC ˜ ˜ Small Tilde + // - U+02DD ˝ ˝ Double Acute Accent + // Latin Extended Additional, 1E00–1EFF + var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}"; + + // Each token is one of the following: + // - A punctuation mark plus the surrounding whitespace + // - A word plus the surrounding whitespace + // - Pure whitespace (but only in the special case where this the entire text + // is just whitespace) + // + // We have to include surrounding whitespace in the tokens because the two + // alternative approaches produce horribly broken results: + // * If we just discard the whitespace, we can't fully reproduce the original + // text from the sequence of tokens and any attempt to render the diff will + // get the whitespace wrong. + // * If we have separate tokens for whitespace, then in a typical text every + // second token will be a single space character. But this often results in + // the optimal diff between two texts being a perverse one that preserves + // the spaces between words but deletes and reinserts actual common words. + // See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640 + // for an example. + // + // Keeping the surrounding whitespace of course has implications for .equals + // and .join, not just .tokenize. + + // This regex does NOT fully implement the tokenization rules described above. + // Instead, it gives runs of whitespace their own "token". The tokenize method + // then handles stitching whitespace tokens onto adjacent word or punctuation + // tokens. + var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), 'ug'); + var wordDiff = new Diff(); + wordDiff.equals = function (left, right, options) { + if (options.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left.trim() === right.trim(); + }; + wordDiff.tokenize = function (value) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var parts; + if (options.intlSegmenter) { + if (options.intlSegmenter.resolvedOptions().granularity != 'word') { + throw new Error('The segmenter passed must have a granularity of "word"'); + } + parts = Array.from(options.intlSegmenter.segment(value), function (segment) { + return segment.segment; + }); + } else { + parts = value.match(tokenizeIncludingWhitespace) || []; + } + var tokens = []; + var prevPart = null; + parts.forEach(function (part) { + if (/\s/.test(part)) { + if (prevPart == null) { + tokens.push(part); + } else { + tokens.push(tokens.pop() + part); + } + } else if (/\s/.test(prevPart)) { + if (tokens[tokens.length - 1] == prevPart) { + tokens.push(tokens.pop() + part); + } else { + tokens.push(prevPart + part); + } + } else { + tokens.push(part); + } + prevPart = part; + }); + return tokens; + }; + wordDiff.join = function (tokens) { + // Tokens being joined here will always have appeared consecutively in the + // same text, so we can simply strip off the leading whitespace from all the + // tokens except the first (and except any whitespace-only tokens - but such + // a token will always be the first and only token anyway) and then join them + // and the whitespace around words and punctuation will end up correct. + return tokens.map(function (token, i) { + if (i == 0) { + return token; + } else { + return token.replace(/^\s+/, ''); + } + }).join(''); + }; + wordDiff.postProcess = function (changes, options) { + if (!changes || options.oneChangePerToken) { + return changes; + } + var lastKeep = null; + // Change objects representing any insertion or deletion since the last + // "keep" change object. There can be at most one of each. + var insertion = null; + var deletion = null; + changes.forEach(function (change) { + if (change.added) { + insertion = change; + } else if (change.removed) { + deletion = change; + } else { + if (insertion || deletion) { + // May be false at start of text + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change); + } + lastKeep = change; + insertion = null; + deletion = null; + } + }); + if (insertion || deletion) { + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null); + } + return changes; + }; + function diffWords(oldStr, newStr, options) { + // This option has never been documented and never will be (it's clearer to + // just call `diffWordsWithSpace` directly if you need that behavior), but + // has existed in jsdiff for a long time, so we retain support for it here + // for the sake of backwards compatibility. + if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) { + return diffWordsWithSpace(oldStr, newStr, options); + } + return wordDiff.diff(oldStr, newStr, options); + } + function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) { + // Before returning, we tidy up the leading and trailing whitespace of the + // change objects to eliminate cases where trailing whitespace in one object + // is repeated as leading whitespace in the next. + // Below are examples of the outcomes we want here to explain the code. + // I=insert, K=keep, D=delete + // 1. diffing 'foo bar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' + // After cleanup, we want: K:'foo ' D:'bar ' K:'baz' + // + // 2. Diffing 'foo bar baz' vs 'foo qux baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz' + // After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz' + // + // 3. Diffing 'foo\nbar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz' + // After cleanup, we want K'foo' D:'\nbar' K:' baz' + // + // 4. Diffing 'foo baz' vs 'foo\nbar baz' + // Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz' + // After cleanup, we ideally want K'foo' I:'\nbar' K:' baz' + // but don't actually manage this currently (the pre-cleanup change + // objects don't contain enough information to make it possible). + // + // 5. Diffing 'foo bar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' + // After cleanup, we want K:'foo ' D:' bar ' K:'baz' + // + // Our handling is unavoidably imperfect in the case where there's a single + // indel between keeps and the whitespace has changed. For instance, consider + // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change + // object to represent the insertion of the space character (which isn't even + // a token), we have no way to avoid losing information about the texts' + // original whitespace in the result we return. Still, we do our best to + // output something that will look sensible if we e.g. print it with + // insertions in green and deletions in red. + + // Between two "keep" change objects (or before the first or after the last + // change object), we can have either: + // * A "delete" followed by an "insert" + // * Just an "insert" + // * Just a "delete" + // We handle the three cases separately. + if (deletion && insertion) { + var oldWsPrefix = deletion.value.match(/^\s*/)[0]; + var oldWsSuffix = deletion.value.match(/\s*$/)[0]; + var newWsPrefix = insertion.value.match(/^\s*/)[0]; + var newWsSuffix = insertion.value.match(/\s*$/)[0]; + if (startKeep) { + var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix); + startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix); + deletion.value = removePrefix(deletion.value, commonWsPrefix); + insertion.value = removePrefix(insertion.value, commonWsPrefix); + } + if (endKeep) { + var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix); + endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix); + deletion.value = removeSuffix(deletion.value, commonWsSuffix); + insertion.value = removeSuffix(insertion.value, commonWsSuffix); + } + } else if (insertion) { + // The whitespaces all reflect what was in the new text rather than + // the old, so we essentially have no information about whitespace + // insertion or deletion. We just want to dedupe the whitespace. + // We do that by having each change object keep its trailing + // whitespace and deleting duplicate leading whitespace where + // present. + if (startKeep) { + insertion.value = insertion.value.replace(/^\s*/, ''); + } + if (endKeep) { + endKeep.value = endKeep.value.replace(/^\s*/, ''); + } + // otherwise we've got a deletion and no insertion + } else if (startKeep && endKeep) { + var newWsFull = endKeep.value.match(/^\s*/)[0], + delWsStart = deletion.value.match(/^\s*/)[0], + delWsEnd = deletion.value.match(/\s*$/)[0]; + + // Any whitespace that comes straight after startKeep in both the old and + // new texts, assign to startKeep and remove from the deletion. + var newWsStart = longestCommonPrefix(newWsFull, delWsStart); + deletion.value = removePrefix(deletion.value, newWsStart); + + // Any whitespace that comes straight before endKeep in both the old and + // new texts, and hasn't already been assigned to startKeep, assign to + // endKeep and remove from the deletion. + var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd); + deletion.value = removeSuffix(deletion.value, newWsEnd); + endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd); + + // If there's any whitespace from the new text that HASN'T already been + // assigned, assign it to the start: + startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length)); + } else if (endKeep) { + // We are at the start of the text. Preserve all the whitespace on + // endKeep, and just remove whitespace from the end of deletion to the + // extent that it overlaps with the start of endKeep. + var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0]; + var deletionWsSuffix = deletion.value.match(/\s*$/)[0]; + var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix); + deletion.value = removeSuffix(deletion.value, overlap); + } else if (startKeep) { + // We are at the END of the text. Preserve all the whitespace on + // startKeep, and just remove whitespace from the start of deletion to + // the extent that it overlaps with the end of startKeep. + var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0]; + var deletionWsPrefix = deletion.value.match(/^\s*/)[0]; + var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix); + deletion.value = removePrefix(deletion.value, _overlap); + } + } + var wordWithSpaceDiff = new Diff(); + wordWithSpaceDiff.tokenize = function (value) { + // Slightly different to the tokenizeIncludingWhitespace regex used above in + // that this one treats each individual newline as a distinct tokens, rather + // than merging them into other surrounding whitespace. This was requested + // in https://github.com/kpdecker/jsdiff/issues/180 & + // https://github.com/kpdecker/jsdiff/issues/211 + var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), 'ug'); + return value.match(regex) || []; + }; + function diffWordsWithSpace(oldStr, newStr, options) { + return wordWithSpaceDiff.diff(oldStr, newStr, options); + } + + function generateOptions(options, defaults) { + if (typeof options === 'function') { + defaults.callback = options; + } else if (options) { + for (var name in options) { + /* istanbul ignore else */ + if (options.hasOwnProperty(name)) { + defaults[name] = options[name]; + } + } + } + return defaults; + } + + var lineDiff = new Diff(); + lineDiff.tokenize = function (value, options) { + if (options.stripTrailingCr) { + // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior + value = value.replace(/\r\n/g, '\n'); + } + var retLines = [], + linesAndNewlines = value.split(/(\n|\r\n)/); + + // Ignore the final empty token that occurs if the string ends with a new line + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + + // Merge the content and line separators into single tokens + for (var i = 0; i < linesAndNewlines.length; i++) { + var line = linesAndNewlines[i]; + if (i % 2 && !options.newlineIsToken) { + retLines[retLines.length - 1] += line; + } else { + retLines.push(line); + } + } + return retLines; + }; + lineDiff.equals = function (left, right, options) { + // If we're ignoring whitespace, we need to normalise lines by stripping + // whitespace before checking equality. (This has an annoying interaction + // with newlineIsToken that requires special handling: if newlines get their + // own token, then we DON'T want to trim the *newline* tokens down to empty + // strings, since this would cause us to treat whitespace-only line content + // as equal to a separator between lines, which would be weird and + // inconsistent with the documented behavior of the options.) + if (options.ignoreWhitespace) { + if (!options.newlineIsToken || !left.includes('\n')) { + left = left.trim(); + } + if (!options.newlineIsToken || !right.includes('\n')) { + right = right.trim(); + } + } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) { + if (left.endsWith('\n')) { + left = left.slice(0, -1); + } + if (right.endsWith('\n')) { + right = right.slice(0, -1); + } + } + return Diff.prototype.equals.call(this, left, right, options); + }; + function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); + } + + // Kept for backwards compatibility. This is a rather arbitrary wrapper method + // that just calls `diffLines` with `ignoreWhitespace: true`. It's confusing to + // have two ways to do exactly the same thing in the API, so we no longer + // document this one (library users should explicitly use `diffLines` with + // `ignoreWhitespace: true` instead) but we keep it around to maintain + // compatibility with code that used old versions. + function diffTrimmedLines(oldStr, newStr, callback) { + var options = generateOptions(callback, { + ignoreWhitespace: true + }); + return lineDiff.diff(oldStr, newStr, options); + } + + var sentenceDiff = new Diff(); + sentenceDiff.tokenize = function (value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); + }; + function diffSentences(oldStr, newStr, callback) { + return sentenceDiff.diff(oldStr, newStr, callback); + } + + var cssDiff = new Diff(); + cssDiff.tokenize = function (value) { + return value.split(/([{}:;,]|\s+)/); + }; + function diffCss(oldStr, newStr, callback) { + return cssDiff.diff(oldStr, newStr, callback); + } + + function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; + } + function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var jsonDiff = new Diff(); + // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a + // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: + jsonDiff.useLongestToken = true; + jsonDiff.tokenize = lineDiff.tokenize; + jsonDiff.castInput = function (value, options) { + var undefinedReplacement = options.undefinedReplacement, + _options$stringifyRep = options.stringifyReplacer, + stringifyReplacer = _options$stringifyRep === void 0 ? function (k, v) { + return typeof v === 'undefined' ? undefinedReplacement : v; + } : _options$stringifyRep; + return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); + }; + jsonDiff.equals = function (left, right, options) { + return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options); + }; + function diffJson(oldObj, newObj, options) { + return jsonDiff.diff(oldObj, newObj, options); + } + + // This function handles the presence of circular references by bailing out when encountering an + // object that is already on the "stack" of items being processed. Accepts an optional replacer + function canonicalize(obj, stack, replacementStack, replacer, key) { + stack = stack || []; + replacementStack = replacementStack || []; + if (replacer) { + obj = replacer(key, obj); + } + var i; + for (i = 0; i < stack.length; i += 1) { + if (stack[i] === obj) { + return replacementStack[i]; + } + } + var canonicalizedObj; + if ('[object Array]' === Object.prototype.toString.call(obj)) { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + if (_typeof(obj) === 'object' && obj !== null) { + stack.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], + _key; + for (_key in obj) { + /* istanbul ignore else */ + if (Object.prototype.hasOwnProperty.call(obj, _key)) { + sortedKeys.push(_key); + } + } + sortedKeys.sort(); + for (i = 0; i < sortedKeys.length; i += 1) { + _key = sortedKeys[i]; + canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; + } + + var arrayDiff = new Diff(); + arrayDiff.tokenize = function (value) { + return value.slice(); + }; + arrayDiff.join = arrayDiff.removeEmpty = function (value) { + return value; + }; + function diffArrays(oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); + } + + function unixToWin(patch) { + if (Array.isArray(patch)) { + return patch.map(unixToWin); + } + return _objectSpread2(_objectSpread2({}, patch), {}, { + hunks: patch.hunks.map(function (hunk) { + return _objectSpread2(_objectSpread2({}, hunk), {}, { + lines: hunk.lines.map(function (line, i) { + var _hunk$lines; + return line.startsWith('\\') || line.endsWith('\r') || (_hunk$lines = hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 && _hunk$lines.startsWith('\\') ? line : line + '\r'; + }) + }); + }) + }); + } + function winToUnix(patch) { + if (Array.isArray(patch)) { + return patch.map(winToUnix); + } + return _objectSpread2(_objectSpread2({}, patch), {}, { + hunks: patch.hunks.map(function (hunk) { + return _objectSpread2(_objectSpread2({}, hunk), {}, { + lines: hunk.lines.map(function (line) { + return line.endsWith('\r') ? line.substring(0, line.length - 1) : line; + }) + }); + }) + }); + } + + /** + * Returns true if the patch consistently uses Unix line endings (or only involves one line and has + * no line endings). + */ + function isUnix(patch) { + if (!Array.isArray(patch)) { + patch = [patch]; + } + return !patch.some(function (index) { + return index.hunks.some(function (hunk) { + return hunk.lines.some(function (line) { + return !line.startsWith('\\') && line.endsWith('\r'); + }); + }); + }); + } + + /** + * Returns true if the patch uses Windows line endings and only Windows line endings. + */ + function isWin(patch) { + if (!Array.isArray(patch)) { + patch = [patch]; + } + return patch.some(function (index) { + return index.hunks.some(function (hunk) { + return hunk.lines.some(function (line) { + return line.endsWith('\r'); + }); + }); + }) && patch.every(function (index) { + return index.hunks.every(function (hunk) { + return hunk.lines.every(function (line, i) { + var _hunk$lines2; + return line.startsWith('\\') || line.endsWith('\r') || ((_hunk$lines2 = hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 : _hunk$lines2.startsWith('\\')); + }); + }); + }); + } + + function parsePatch(uniDiff) { + var diffstr = uniDiff.split(/\n/), + list = [], + i = 0; + function parseIndex() { + var index = {}; + list.push(index); + + // Parse diff metadata + while (i < diffstr.length) { + var line = diffstr[i]; + + // File header found, end parsing diff metadata + if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { + break; + } + + // Diff index + var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); + if (header) { + index.index = header[1]; + } + i++; + } + + // Parse file headers if they are defined. Unified diff requires them, but + // there's no technical issues to have an isolated hunk without file header + parseFileHeader(index); + parseFileHeader(index); + + // Parse hunks + index.hunks = []; + while (i < diffstr.length) { + var _line = diffstr[i]; + if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) { + break; + } else if (/^@@/.test(_line)) { + index.hunks.push(parseHunk()); + } else if (_line) { + throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); + } else { + i++; + } + } + } + + // Parses the --- and +++ headers, if none are found, no lines + // are consumed. + function parseFileHeader(index) { + var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]); + if (fileHeader) { + var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; + var data = fileHeader[2].split('\t', 2); + var fileName = data[0].replace(/\\\\/g, '\\'); + if (/^".*"$/.test(fileName)) { + fileName = fileName.substr(1, fileName.length - 2); + } + index[keyPrefix + 'FileName'] = fileName; + index[keyPrefix + 'Header'] = (data[1] || '').trim(); + i++; + } + } + + // Parses a hunk + // This assumes that we are at the start of a hunk. + function parseHunk() { + var chunkHeaderIndex = i, + chunkHeaderLine = diffstr[i++], + chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); + var hunk = { + oldStart: +chunkHeader[1], + oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2], + newStart: +chunkHeader[3], + newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4], + lines: [] + }; + + // Unified Diff Format quirk: If the chunk size is 0, + // the first number is one lower than one would expect. + // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 + if (hunk.oldLines === 0) { + hunk.oldStart += 1; + } + if (hunk.newLines === 0) { + hunk.newStart += 1; + } + var addCount = 0, + removeCount = 0; + for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || (_diffstr$i = diffstr[i]) !== null && _diffstr$i !== void 0 && _diffstr$i.startsWith('\\')); i++) { + var _diffstr$i; + var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; + if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { + hunk.lines.push(diffstr[i]); + if (operation === '+') { + addCount++; + } else if (operation === '-') { + removeCount++; + } else if (operation === ' ') { + addCount++; + removeCount++; + } + } else { + throw new Error("Hunk at line ".concat(chunkHeaderIndex + 1, " contained invalid line ").concat(diffstr[i])); + } + } + + // Handle the empty block count case + if (!addCount && hunk.newLines === 1) { + hunk.newLines = 0; + } + if (!removeCount && hunk.oldLines === 1) { + hunk.oldLines = 0; + } + + // Perform sanity checking + if (addCount !== hunk.newLines) { + throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + if (removeCount !== hunk.oldLines) { + throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + return hunk; + } + while (i < diffstr.length) { + parseIndex(); + } + return list; + } + + // Iterator that traverses in the range of [min, max], stepping + // by distance from a given start position. I.e. for [0, 4], with + // start of 2, this will iterate 2, 3, 1, 4, 0. + function distanceIterator (start, minLine, maxLine) { + var wantForward = true, + backwardExhausted = false, + forwardExhausted = false, + localOffset = 1; + return function iterator() { + if (wantForward && !forwardExhausted) { + if (backwardExhausted) { + localOffset++; + } else { + wantForward = false; + } + + // Check if trying to fit beyond text length, and if not, check it fits + // after offset location (or desired location on first iteration) + if (start + localOffset <= maxLine) { + return start + localOffset; + } + forwardExhausted = true; + } + if (!backwardExhausted) { + if (!forwardExhausted) { + wantForward = true; + } + + // Check if trying to fit before text beginning, and if not, check it fits + // before offset location + if (minLine <= start - localOffset) { + return start - localOffset++; + } + backwardExhausted = true; + return iterator(); + } + + // We tried to fit hunk before text beginning and beyond text length, then + // hunk can't fit on the text. Return undefined + }; + } + + function applyPatch(source, uniDiff) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (typeof uniDiff === 'string') { + uniDiff = parsePatch(uniDiff); + } + if (Array.isArray(uniDiff)) { + if (uniDiff.length > 1) { + throw new Error('applyPatch only works with a single input.'); + } + uniDiff = uniDiff[0]; + } + if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) { + if (hasOnlyWinLineEndings(source) && isUnix(uniDiff)) { + uniDiff = unixToWin(uniDiff); + } else if (hasOnlyUnixLineEndings(source) && isWin(uniDiff)) { + uniDiff = winToUnix(uniDiff); + } + } + + // Apply the diff to the input + var lines = source.split('\n'), + hunks = uniDiff.hunks, + compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { + return line === patchContent; + }, + fuzzFactor = options.fuzzFactor || 0, + minLine = 0; + if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) { + throw new Error('fuzzFactor must be a non-negative integer'); + } + + // Special case for empty patch. + if (!hunks.length) { + return source; + } + + // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change + // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a + // newline that already exists - then we either return false and fail to apply the patch (if + // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0). + // If we do need to remove/add a newline at EOF, this will always be in the final hunk: + var prevLine = '', + removeEOFNL = false, + addEOFNL = false; + for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) { + var line = hunks[hunks.length - 1].lines[i]; + if (line[0] == '\\') { + if (prevLine[0] == '+') { + removeEOFNL = true; + } else if (prevLine[0] == '-') { + addEOFNL = true; + } + } + prevLine = line; + } + if (removeEOFNL) { + if (addEOFNL) { + // This means the final line gets changed but doesn't have a trailing newline in either the + // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if + // fuzzFactor is 0, we simply validate that the source file has no trailing newline. + if (!fuzzFactor && lines[lines.length - 1] == '') { + return false; + } + } else if (lines[lines.length - 1] == '') { + lines.pop(); + } else if (!fuzzFactor) { + return false; + } + } else if (addEOFNL) { + if (lines[lines.length - 1] != '') { + lines.push(''); + } else if (!fuzzFactor) { + return false; + } + } + + /** + * Checks if the hunk can be made to fit at the provided location with at most `maxErrors` + * insertions, substitutions, or deletions, while ensuring also that: + * - lines deleted in the hunk match exactly, and + * - wherever an insertion operation or block of insertion operations appears in the hunk, the + * immediately preceding and following lines of context match exactly + * + * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0]. + * + * If the hunk can be applied, returns an object with properties `oldLineLastI` and + * `replacementLines`. Otherwise, returns null. + */ + function applyHunk(hunkLines, toPos, maxErrors) { + var hunkLinesI = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var lastContextLineMatched = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + var patchedLines = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : []; + var patchedLinesLength = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0; + var nConsecutiveOldContextLines = 0; + var nextContextLineMustMatch = false; + for (; hunkLinesI < hunkLines.length; hunkLinesI++) { + var hunkLine = hunkLines[hunkLinesI], + operation = hunkLine.length > 0 ? hunkLine[0] : ' ', + content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine; + if (operation === '-') { + if (compareLine(toPos + 1, lines[toPos], operation, content)) { + toPos++; + nConsecutiveOldContextLines = 0; + } else { + if (!maxErrors || lines[toPos] == null) { + return null; + } + patchedLines[patchedLinesLength] = lines[toPos]; + return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1); + } + } + if (operation === '+') { + if (!lastContextLineMatched) { + return null; + } + patchedLines[patchedLinesLength] = content; + patchedLinesLength++; + nConsecutiveOldContextLines = 0; + nextContextLineMustMatch = true; + } + if (operation === ' ') { + nConsecutiveOldContextLines++; + patchedLines[patchedLinesLength] = lines[toPos]; + if (compareLine(toPos + 1, lines[toPos], operation, content)) { + patchedLinesLength++; + lastContextLineMatched = true; + nextContextLineMustMatch = false; + toPos++; + } else { + if (nextContextLineMustMatch || !maxErrors) { + return null; + } + + // Consider 3 possibilities in sequence: + // 1. lines contains a *substitution* not included in the patch context, or + // 2. lines contains an *insertion* not included in the patch context, or + // 3. lines contains a *deletion* not included in the patch context + // The first two options are of course only possible if the line from lines is non-null - + // i.e. only option 3 is possible if we've overrun the end of the old file. + return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength); + } + } + } + + // Before returning, trim any unmodified context lines off the end of patchedLines and reduce + // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region + // that starts in this hunk's trailing context. + patchedLinesLength -= nConsecutiveOldContextLines; + toPos -= nConsecutiveOldContextLines; + patchedLines.length = patchedLinesLength; + return { + patchedLines: patchedLines, + oldLineLastI: toPos - 1 + }; + } + var resultLines = []; + + // Search best fit offsets for each hunk based on the previous ones + var prevHunkOffset = 0; + for (var _i = 0; _i < hunks.length; _i++) { + var hunk = hunks[_i]; + var hunkResult = void 0; + var maxLine = lines.length - hunk.oldLines + fuzzFactor; + var toPos = void 0; + for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) { + toPos = hunk.oldStart + prevHunkOffset - 1; + var iterator = distanceIterator(toPos, minLine, maxLine); + for (; toPos !== undefined; toPos = iterator()) { + hunkResult = applyHunk(hunk.lines, toPos, maxErrors); + if (hunkResult) { + break; + } + } + if (hunkResult) { + break; + } + } + if (!hunkResult) { + return false; + } + + // Copy everything from the end of where we applied the last hunk to the start of this hunk + for (var _i2 = minLine; _i2 < toPos; _i2++) { + resultLines.push(lines[_i2]); + } + + // Add the lines produced by applying the hunk: + for (var _i3 = 0; _i3 < hunkResult.patchedLines.length; _i3++) { + var _line = hunkResult.patchedLines[_i3]; + resultLines.push(_line); + } + + // Set lower text limit to end of the current hunk, so next ones don't try + // to fit over already patched text + minLine = hunkResult.oldLineLastI + 1; + + // Note the offset between where the patch said the hunk should've applied and where we + // applied it, so we can adjust future hunks accordingly: + prevHunkOffset = toPos + 1 - hunk.oldStart; + } + + // Copy over the rest of the lines from the old text + for (var _i4 = minLine; _i4 < lines.length; _i4++) { + resultLines.push(lines[_i4]); + } + return resultLines.join('\n'); + } + + // Wrapper that supports multiple file patches via callbacks. + function applyPatches(uniDiff, options) { + if (typeof uniDiff === 'string') { + uniDiff = parsePatch(uniDiff); + } + var currentIndex = 0; + function processIndex() { + var index = uniDiff[currentIndex++]; + if (!index) { + return options.complete(); + } + options.loadFile(index, function (err, data) { + if (err) { + return options.complete(err); + } + var updatedContent = applyPatch(data, index, options); + options.patched(index, updatedContent, function (err) { + if (err) { + return options.complete(err); + } + processIndex(); + }); + }); + } + processIndex(); + } + + function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + if (!options) { + options = {}; + } + if (typeof options === 'function') { + options = { + callback: options + }; + } + if (typeof options.context === 'undefined') { + options.context = 4; + } + if (options.newlineIsToken) { + throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions'); + } + if (!options.callback) { + return diffLinesResultToPatch(diffLines(oldStr, newStr, options)); + } else { + var _options = options, + _callback = _options.callback; + diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options), {}, { + callback: function callback(diff) { + var patch = diffLinesResultToPatch(diff); + _callback(patch); + } + })); + } + function diffLinesResultToPatch(diff) { + // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays + // of lines containing trailing newline characters. We'll tidy up later... + + if (!diff) { + return; + } + diff.push({ + value: '', + lines: [] + }); // Append an empty value to make cleanup easier + + function contextLines(lines) { + return lines.map(function (entry) { + return ' ' + entry; + }); + } + var hunks = []; + var oldRangeStart = 0, + newRangeStart = 0, + curRange = [], + oldLine = 1, + newLine = 1; + var _loop = function _loop() { + var current = diff[i], + lines = current.lines || splitLines(current.value); + current.lines = lines; + if (current.added || current.removed) { + var _curRange; + // If we have previous context, start with that + if (!oldRangeStart) { + var prev = diff[i - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + if (prev) { + curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + + // Output our changes + (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) { + return (current.added ? '+' : '-') + entry; + }))); + + // Track the updated file position + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + // Identical context lines. Track line changes + if (oldRangeStart) { + // Close out any changes that have been output (or join overlapping) + if (lines.length <= options.context * 2 && i < diff.length - 2) { + var _curRange2; + // Overlapping + (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); + } else { + var _curRange3; + // end the range and output + var contextSize = Math.min(lines.length, options.context); + (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); + var _hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + hunks.push(_hunk); + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + for (var i = 0; i < diff.length; i++) { + _loop(); + } + + // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add + // "\ No newline at end of file". + for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) { + var hunk = _hunks[_i]; + for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) { + if (hunk.lines[_i2].endsWith('\n')) { + hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1); + } else { + hunk.lines.splice(_i2 + 1, 0, '\\ No newline at end of file'); + _i2++; // Skip the line we just added, then continue iterating + } + } + } + return { + oldFileName: oldFileName, + newFileName: newFileName, + oldHeader: oldHeader, + newHeader: newHeader, + hunks: hunks + }; + } + } + function formatPatch(diff) { + if (Array.isArray(diff)) { + return diff.map(formatPatch).join('\n'); + } + var ret = []; + if (diff.oldFileName == diff.newFileName) { + ret.push('Index: ' + diff.oldFileName); + } + ret.push('==================================================================='); + ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); + ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); + for (var i = 0; i < diff.hunks.length; i++) { + var hunk = diff.hunks[i]; + // Unified Diff Format quirk: If the chunk size is 0, + // the first number is one lower than one would expect. + // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 + if (hunk.oldLines === 0) { + hunk.oldStart -= 1; + } + if (hunk.newLines === 0) { + hunk.newStart -= 1; + } + ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); + ret.push.apply(ret, hunk.lines); + } + return ret.join('\n') + '\n'; + } + function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + var _options2; + if (typeof options === 'function') { + options = { + callback: options + }; + } + if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.callback)) { + var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); + if (!patchObj) { + return; + } + return formatPatch(patchObj); + } else { + var _options3 = options, + _callback2 = _options3.callback; + structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options), {}, { + callback: function callback(patchObj) { + if (!patchObj) { + _callback2(); + } else { + _callback2(formatPatch(patchObj)); + } + } + })); + } + } + function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { + return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); + } + + /** + * Split `text` into an array of lines, including the trailing newline character (where present) + */ + function splitLines(text) { + var hasTrailingNl = text.endsWith('\n'); + var result = text.split('\n').map(function (line) { + return line + '\n'; + }); + if (hasTrailingNl) { + result.pop(); + } else { + result.push(result.pop().slice(0, -1)); + } + return result; + } + + function arrayEqual(a, b) { + if (a.length !== b.length) { + return false; + } + return arrayStartsWith(a, b); + } + function arrayStartsWith(array, start) { + if (start.length > array.length) { + return false; + } + for (var i = 0; i < start.length; i++) { + if (start[i] !== array[i]) { + return false; + } + } + return true; + } + + function calcLineCount(hunk) { + var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), + oldLines = _calcOldNewLineCount.oldLines, + newLines = _calcOldNewLineCount.newLines; + if (oldLines !== undefined) { + hunk.oldLines = oldLines; + } else { + delete hunk.oldLines; + } + if (newLines !== undefined) { + hunk.newLines = newLines; + } else { + delete hunk.newLines; + } + } + function merge(mine, theirs, base) { + mine = loadPatch(mine, base); + theirs = loadPatch(theirs, base); + var ret = {}; + + // For index we just let it pass through as it doesn't have any necessary meaning. + // Leaving sanity checks on this to the API consumer that may know more about the + // meaning in their own context. + if (mine.index || theirs.index) { + ret.index = mine.index || theirs.index; + } + if (mine.newFileName || theirs.newFileName) { + if (!fileNameChanged(mine)) { + // No header or no change in ours, use theirs (and ours if theirs does not exist) + ret.oldFileName = theirs.oldFileName || mine.oldFileName; + ret.newFileName = theirs.newFileName || mine.newFileName; + ret.oldHeader = theirs.oldHeader || mine.oldHeader; + ret.newHeader = theirs.newHeader || mine.newHeader; + } else if (!fileNameChanged(theirs)) { + // No header or no change in theirs, use ours + ret.oldFileName = mine.oldFileName; + ret.newFileName = mine.newFileName; + ret.oldHeader = mine.oldHeader; + ret.newHeader = mine.newHeader; + } else { + // Both changed... figure it out + ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); + ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); + ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); + ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); + } + } + ret.hunks = []; + var mineIndex = 0, + theirsIndex = 0, + mineOffset = 0, + theirsOffset = 0; + while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { + var mineCurrent = mine.hunks[mineIndex] || { + oldStart: Infinity + }, + theirsCurrent = theirs.hunks[theirsIndex] || { + oldStart: Infinity + }; + if (hunkBefore(mineCurrent, theirsCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); + mineIndex++; + theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; + } else if (hunkBefore(theirsCurrent, mineCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); + theirsIndex++; + mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; + } else { + // Overlap, merge as best we can + var mergedHunk = { + oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), + oldLines: 0, + newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), + newLines: 0, + lines: [] + }; + mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); + theirsIndex++; + mineIndex++; + ret.hunks.push(mergedHunk); + } + } + return ret; + } + function loadPatch(param, base) { + if (typeof param === 'string') { + if (/^@@/m.test(param) || /^Index:/m.test(param)) { + return parsePatch(param)[0]; + } + if (!base) { + throw new Error('Must provide a base reference or pass in a patch'); + } + return structuredPatch(undefined, undefined, base, param); + } + return param; + } + function fileNameChanged(patch) { + return patch.newFileName && patch.newFileName !== patch.oldFileName; + } + function selectField(index, mine, theirs) { + if (mine === theirs) { + return mine; + } else { + index.conflict = true; + return { + mine: mine, + theirs: theirs + }; + } + } + function hunkBefore(test, check) { + return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; + } + function cloneHunk(hunk, offset) { + return { + oldStart: hunk.oldStart, + oldLines: hunk.oldLines, + newStart: hunk.newStart + offset, + newLines: hunk.newLines, + lines: hunk.lines + }; + } + function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { + // This will generally result in a conflicted hunk, but there are cases where the context + // is the only overlap where we can successfully merge the content here. + var mine = { + offset: mineOffset, + lines: mineLines, + index: 0 + }, + their = { + offset: theirOffset, + lines: theirLines, + index: 0 + }; + + // Handle any leading content + insertLeading(hunk, mine, their); + insertLeading(hunk, their, mine); + + // Now in the overlap content. Scan through and select the best changes from each. + while (mine.index < mine.lines.length && their.index < their.lines.length) { + var mineCurrent = mine.lines[mine.index], + theirCurrent = their.lines[their.index]; + if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { + // Both modified ... + mutualChange(hunk, mine, their); + } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { + var _hunk$lines; + // Mine inserted + (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); + } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { + var _hunk$lines2; + // Theirs inserted + (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); + } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { + // Mine removed or edited + removal(hunk, mine, their); + } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { + // Their removed or edited + removal(hunk, their, mine, true); + } else if (mineCurrent === theirCurrent) { + // Context identity + hunk.lines.push(mineCurrent); + mine.index++; + their.index++; + } else { + // Context mismatch + conflict(hunk, collectChange(mine), collectChange(their)); + } + } + + // Now push anything that may be remaining + insertTrailing(hunk, mine); + insertTrailing(hunk, their); + calcLineCount(hunk); + } + function mutualChange(hunk, mine, their) { + var myChanges = collectChange(mine), + theirChanges = collectChange(their); + if (allRemoves(myChanges) && allRemoves(theirChanges)) { + // Special case for remove changes that are supersets of one another + if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { + var _hunk$lines3; + (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); + return; + } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { + var _hunk$lines4; + (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); + return; + } + } else if (arrayEqual(myChanges, theirChanges)) { + var _hunk$lines5; + (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); + return; + } + conflict(hunk, myChanges, theirChanges); + } + function removal(hunk, mine, their, swap) { + var myChanges = collectChange(mine), + theirChanges = collectContext(their, myChanges); + if (theirChanges.merged) { + var _hunk$lines6; + (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); + } else { + conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); + } + } + function conflict(hunk, mine, their) { + hunk.conflict = true; + hunk.lines.push({ + conflict: true, + mine: mine, + theirs: their + }); + } + function insertLeading(hunk, insert, their) { + while (insert.offset < their.offset && insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + insert.offset++; + } + } + function insertTrailing(hunk, insert) { + while (insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + } + } + function collectChange(state) { + var ret = [], + operation = state.lines[state.index][0]; + while (state.index < state.lines.length) { + var line = state.lines[state.index]; + + // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. + if (operation === '-' && line[0] === '+') { + operation = '+'; + } + if (operation === line[0]) { + ret.push(line); + state.index++; + } else { + break; + } + } + return ret; + } + function collectContext(state, matchChanges) { + var changes = [], + merged = [], + matchIndex = 0, + contextChanges = false, + conflicted = false; + while (matchIndex < matchChanges.length && state.index < state.lines.length) { + var change = state.lines[state.index], + match = matchChanges[matchIndex]; + + // Once we've hit our add, then we are done + if (match[0] === '+') { + break; + } + contextChanges = contextChanges || change[0] !== ' '; + merged.push(match); + matchIndex++; + + // Consume any additions in the other block as a conflict to attempt + // to pull in the remaining context after this + if (change[0] === '+') { + conflicted = true; + while (change[0] === '+') { + changes.push(change); + change = state.lines[++state.index]; + } + } + if (match.substr(1) === change.substr(1)) { + changes.push(change); + state.index++; + } else { + conflicted = true; + } + } + if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { + conflicted = true; + } + if (conflicted) { + return changes; + } + while (matchIndex < matchChanges.length) { + merged.push(matchChanges[matchIndex++]); + } + return { + merged: merged, + changes: changes + }; + } + function allRemoves(changes) { + return changes.reduce(function (prev, change) { + return prev && change[0] === '-'; + }, true); + } + function skipRemoveSuperset(state, removeChanges, delta) { + for (var i = 0; i < delta; i++) { + var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); + if (state.lines[state.index + i] !== ' ' + changeContent) { + return false; + } + } + state.index += delta; + return true; + } + function calcOldNewLineCount(lines) { + var oldLines = 0; + var newLines = 0; + lines.forEach(function (line) { + if (typeof line !== 'string') { + var myCount = calcOldNewLineCount(line.mine); + var theirCount = calcOldNewLineCount(line.theirs); + if (oldLines !== undefined) { + if (myCount.oldLines === theirCount.oldLines) { + oldLines += myCount.oldLines; + } else { + oldLines = undefined; + } + } + if (newLines !== undefined) { + if (myCount.newLines === theirCount.newLines) { + newLines += myCount.newLines; + } else { + newLines = undefined; + } + } + } else { + if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { + newLines++; + } + if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { + oldLines++; + } + } + }); + return { + oldLines: oldLines, + newLines: newLines + }; + } + + function reversePatch(structuredPatch) { + if (Array.isArray(structuredPatch)) { + return structuredPatch.map(reversePatch).reverse(); + } + return _objectSpread2(_objectSpread2({}, structuredPatch), {}, { + oldFileName: structuredPatch.newFileName, + oldHeader: structuredPatch.newHeader, + newFileName: structuredPatch.oldFileName, + newHeader: structuredPatch.oldHeader, + hunks: structuredPatch.hunks.map(function (hunk) { + return { + oldLines: hunk.newLines, + oldStart: hunk.newStart, + newLines: hunk.oldLines, + newStart: hunk.oldStart, + lines: hunk.lines.map(function (l) { + if (l.startsWith('-')) { + return "+".concat(l.slice(1)); + } + if (l.startsWith('+')) { + return "-".concat(l.slice(1)); + } + return l; + }) + }; + }) + }); + } + + // See: http://code.google.com/p/google-diff-match-patch/wiki/API + function convertChangesToDMP(changes) { + var ret = [], + change, + operation; + for (var i = 0; i < changes.length; i++) { + change = changes[i]; + if (change.added) { + operation = 1; + } else if (change.removed) { + operation = -1; + } else { + operation = 0; + } + ret.push([operation, change.value]); + } + return ret; + } + + function convertChangesToXML(changes) { + var ret = []; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + ret.push(escapeHTML(change.value)); + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + } + return ret.join(''); + } + function escapeHTML(s) { + var n = s; + n = n.replace(/&/g, '&'); + n = n.replace(//g, '>'); + n = n.replace(/"/g, '"'); + return n; + } + + exports.Diff = Diff; + exports.applyPatch = applyPatch; + exports.applyPatches = applyPatches; + exports.canonicalize = canonicalize; + exports.convertChangesToDMP = convertChangesToDMP; + exports.convertChangesToXML = convertChangesToXML; + exports.createPatch = createPatch; + exports.createTwoFilesPatch = createTwoFilesPatch; + exports.diffArrays = diffArrays; + exports.diffChars = diffChars; + exports.diffCss = diffCss; + exports.diffJson = diffJson; + exports.diffLines = diffLines; + exports.diffSentences = diffSentences; + exports.diffTrimmedLines = diffTrimmedLines; + exports.diffWords = diffWords; + exports.diffWordsWithSpace = diffWordsWithSpace; + exports.formatPatch = formatPatch; + exports.merge = merge; + exports.parsePatch = parsePatch; + exports.reversePatch = reversePatch; + exports.structuredPatch = structuredPatch; + +})); + +},{}],92:[function(require,module,exports){ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + +},{}],93:[function(require,module,exports){ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; + +},{}],94:[function(require,module,exports){ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.typeDetect = factory()); +}(this, (function () { 'use strict'; + +/* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */ +var promiseExists = typeof Promise === 'function'; + +/* eslint-disable no-undef */ +var globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist + +var symbolExists = typeof Symbol !== 'undefined'; +var mapExists = typeof Map !== 'undefined'; +var setExists = typeof Set !== 'undefined'; +var weakMapExists = typeof WeakMap !== 'undefined'; +var weakSetExists = typeof WeakSet !== 'undefined'; +var dataViewExists = typeof DataView !== 'undefined'; +var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; +var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; +var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; +var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; +var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); +var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); +var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; +var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); +var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; +var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); +var toStringLeftSliceLength = 8; +var toStringRightSliceLength = -1; +/** + * ### typeOf (obj) + * + * Uses `Object.prototype.toString` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */ +function typeDetect(obj) { + /* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */ + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + + /* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */ + if (obj === null) { + return 'null'; + } + + /* ! Spec Conformance + * Test: `Object.prototype.toString.call(window)`` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: `Object.prototype.toString.call(this)`` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */ + if (obj === globalObject) { + return 'global'; + } + + /* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */ + if ( + Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj)) + ) { + return 'Array'; + } + + // Not caching existence of `window` and related properties due to potential + // for `window` to be unset before tests in quasi-browser environments. + if (typeof window === 'object' && window !== null) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The `Location` interface + * Test: `Object.prototype.toString.call(window.location)`` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */ + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The `Document` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: `Object.prototype.toString.call(document)`` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */ + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + + if (typeof window.navigator === 'object') { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: `Object.prototype.toString.call(navigator.mimeTypes)`` + * - IE <=10 === "[object MSMimeTypesCollection]" + */ + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: `Object.prototype.toString.call(navigator.plugins)`` + * - IE <=10 === "[object MSPluginsCollection]" + */ + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement` + * Test: `Object.prototype.toString.call(document.createElement('blockquote'))`` + * - IE <=10 === "[object HTMLBlockElement]" + */ + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + + /* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */ + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + + var objPrototype = Object.getPrototypeOf(obj); + /* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */ + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + + /* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */ + if (objPrototype === Date.prototype) { + return 'Date'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: `Object.prototype.toString.call(Promise.resolve())`` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */ + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + + /* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */ + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + + /* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */ + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + + /* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */ + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + + /* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */ + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))`` + * - Edge <=13 === "[object Object]" + */ + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: `Object.prototype.toString.call(new Map().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: `Object.prototype.toString.call(new Set().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: `Object.prototype.toString.call([][Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: `Object.prototype.toString.call(''[Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + + /* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */ + if (objPrototype === null) { + return 'Object'; + } + + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); +} + +return typeDetect; + +}))); + +},{}]},{},[2])(2) +}); diff --git a/node_modules/sinon/pkg/sinon.js b/node_modules/sinon/pkg/sinon.js new file mode 100644 index 0000000..f812795 --- /dev/null +++ b/node_modules/sinon/pkg/sinon.js @@ -0,0 +1,13255 @@ +/* Sinon.JS 21.0.0, 2025-06-13, @license BSD-3 */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sinon = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0) { + return args[callArgAt]; + } + + let argumentList; + + if (callArgAt === useLeftMostCallback) { + argumentList = args; + } + + if (callArgAt === useRightMostCallback) { + argumentList = reverse(slice(args)); + } + + const callArgProp = behavior.callArgProp; + + for (let i = 0, l = argumentList.length; i < l; ++i) { + if (!callArgProp && typeof argumentList[i] === "function") { + return argumentList[i]; + } + + if ( + callArgProp && + argumentList[i] && + typeof argumentList[i][callArgProp] === "function" + ) { + return argumentList[i][callArgProp]; + } + } + + return null; +} + +function getCallbackError(behavior, func, args) { + if (behavior.callArgAt < 0) { + let msg; + + if (behavior.callArgProp) { + msg = `${functionName( + behavior.stub, + )} expected to yield to '${valueToString( + behavior.callArgProp, + )}', but no object with such a property was passed.`; + } else { + msg = `${functionName( + behavior.stub, + )} expected to yield, but no callback was passed.`; + } + + if (args.length > 0) { + msg += ` Received [${join(args, ", ")}]`; + } + + return msg; + } + + return `argument at index ${behavior.callArgAt} is not a function: ${func}`; +} + +function ensureArgs(name, behavior, args) { + // map function name to internal property + // callsArg => callArgAt + const property = name.replace(/sArg/, "ArgAt"); + const index = behavior[property]; + + if (index >= args.length) { + throw new TypeError( + `${name} failed: ${index + 1} arguments required but only ${ + args.length + } present`, + ); + } +} + +function callCallback(behavior, args) { + if (typeof behavior.callArgAt === "number") { + ensureArgs("callsArg", behavior, args); + const func = getCallback(behavior, args); + + if (typeof func !== "function") { + throw new TypeError(getCallbackError(behavior, func, args)); + } + + if (behavior.callbackAsync) { + nextTick(function () { + func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + }); + } else { + return func.apply( + behavior.callbackContext, + behavior.callbackArguments, + ); + } + } + + return undefined; +} + +const proto = { + create: function create(stub) { + const behavior = extend({}, proto); + delete behavior.create; + delete behavior.addBehavior; + delete behavior.createBehavior; + behavior.stub = stub; + + if (stub.defaultBehavior && stub.defaultBehavior.promiseLibrary) { + behavior.promiseLibrary = stub.defaultBehavior.promiseLibrary; + } + + return behavior; + }, + + isPresent: function isPresent() { + return ( + typeof this.callArgAt === "number" || + this.exception || + this.exceptionCreator || + typeof this.returnArgAt === "number" || + this.returnThis || + typeof this.resolveArgAt === "number" || + this.resolveThis || + typeof this.throwArgAt === "number" || + this.fakeFn || + this.returnValueDefined + ); + }, + + /*eslint complexity: ["error", 20]*/ + invoke: function invoke(context, args) { + /* + * callCallback (conditionally) calls ensureArgs + * + * Note: callCallback intentionally happens before + * everything else and cannot be moved lower + */ + const returnValue = callCallback(this, args); + + if (this.exception) { + throw this.exception; + } else if (this.exceptionCreator) { + this.exception = this.exceptionCreator(); + this.exceptionCreator = undefined; + throw this.exception; + } else if (typeof this.returnArgAt === "number") { + ensureArgs("returnsArg", this, args); + return args[this.returnArgAt]; + } else if (this.returnThis) { + return context; + } else if (typeof this.throwArgAt === "number") { + ensureArgs("throwsArg", this, args); + throw args[this.throwArgAt]; + } else if (this.fakeFn) { + return this.fakeFn.apply(context, args); + } else if (typeof this.resolveArgAt === "number") { + ensureArgs("resolvesArg", this, args); + return (this.promiseLibrary || Promise).resolve( + args[this.resolveArgAt], + ); + } else if (this.resolveThis) { + return (this.promiseLibrary || Promise).resolve(context); + } else if (this.resolve) { + return (this.promiseLibrary || Promise).resolve(this.returnValue); + } else if (this.reject) { + return (this.promiseLibrary || Promise).reject(this.returnValue); + } else if (this.callsThrough) { + const wrappedMethod = this.effectiveWrappedMethod(); + + return wrappedMethod.apply(context, args); + } else if (this.callsThroughWithNew) { + // Get the original method (assumed to be a constructor in this case) + const WrappedClass = this.effectiveWrappedMethod(); + // Turn the arguments object into a normal array + const argsArray = slice(args); + // Call the constructor + const F = WrappedClass.bind.apply( + WrappedClass, + concat([null], argsArray), + ); + return new F(); + } else if (typeof this.returnValue !== "undefined") { + return this.returnValue; + } else if (typeof this.callArgAt === "number") { + return returnValue; + } + + return this.returnValue; + }, + + effectiveWrappedMethod: function effectiveWrappedMethod() { + for (let stubb = this.stub; stubb; stubb = stubb.parent) { + if (stubb.wrappedMethod) { + return stubb.wrappedMethod; + } + } + throw new Error("Unable to find wrapped method"); + }, + + onCall: function onCall(index) { + return this.stub.onCall(index); + }, + + onFirstCall: function onFirstCall() { + return this.stub.onFirstCall(); + }, + + onSecondCall: function onSecondCall() { + return this.stub.onSecondCall(); + }, + + onThirdCall: function onThirdCall() { + return this.stub.onThirdCall(); + }, + + withArgs: function withArgs(/* arguments */) { + throw new Error( + 'Defining a stub by invoking "stub.onCall(...).withArgs(...)" ' + + 'is not supported. Use "stub.withArgs(...).onCall(...)" ' + + "to define sequential behavior for calls with certain arguments.", + ); + }, +}; + +function createBehavior(behaviorMethod) { + return function () { + this.defaultBehavior = this.defaultBehavior || proto.create(this); + this.defaultBehavior[behaviorMethod].apply( + this.defaultBehavior, + arguments, + ); + return this; + }; +} + +function addBehavior(stub, name, fn) { + proto[name] = function () { + fn.apply(this, concat([this], slice(arguments))); + return this.stub || this; + }; + + stub[name] = createBehavior(name); +} + +proto.addBehavior = addBehavior; +proto.createBehavior = createBehavior; + +const asyncBehaviors = exportAsyncBehaviors(proto); + +module.exports = extend.nonEnum({}, proto, asyncBehaviors); + +},{"./util/core/export-async-behaviors":24,"./util/core/extend":25,"./util/core/next-tick":33,"@sinonjs/commons":46}],5:[function(require,module,exports){ +"use strict"; + +const walk = require("./util/core/walk"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const push = require("@sinonjs/commons").prototypes.array.push; + +function collectMethod(methods, object, prop, propOwner) { + if ( + typeof getPropertyDescriptor(propOwner, prop).value === "function" && + hasOwnProperty(object, prop) + ) { + push(methods, object[prop]); + } +} + +// This function returns an array of all the own methods on the passed object +function collectOwnMethods(object) { + const methods = []; + + walk(object, collectMethod.bind(null, methods, object)); + + return methods; +} + +module.exports = collectOwnMethods; + +},{"./util/core/get-property-descriptor":28,"./util/core/walk":37,"@sinonjs/commons":46}],6:[function(require,module,exports){ +"use strict"; + +module.exports = class Colorizer { + constructor(supportsColor = require("supports-color")) { + this.supportsColor = supportsColor; + } + + /** + * Should be renamed to true #privateField + * when we can ensure ES2022 support + * + * @private + */ + colorize(str, color) { + if (this.supportsColor.stdout === false) { + return str; + } + + return `\x1b[${color}m${str}\x1b[0m`; + } + + red(str) { + return this.colorize(str, 31); + } + + green(str) { + return this.colorize(str, 32); + } + + cyan(str) { + return this.colorize(str, 96); + } + + white(str) { + return this.colorize(str, 39); + } + + bold(str) { + return this.colorize(str, 1); + } +}; + +},{"supports-color":93}],7:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Sandbox = require("./sandbox"); + +const forEach = arrayProto.forEach; +const push = arrayProto.push; + +function prepareSandboxFromConfig(config) { + const sandbox = new Sandbox({ assertOptions: config.assertOptions }); + + if (config.useFakeTimers) { + if (typeof config.useFakeTimers === "object") { + sandbox.useFakeTimers(config.useFakeTimers); + } else { + sandbox.useFakeTimers(); + } + } + + return sandbox; +} + +function exposeValue(sandbox, config, key, value) { + if (!value) { + return; + } + + if (config.injectInto && !(key in config.injectInto)) { + config.injectInto[key] = value; + push(sandbox.injectedKeys, key); + } else { + push(sandbox.args, value); + } +} + +/** + * Options to customize a sandbox + * + * The sandbox's methods can be injected into another object for + * convenience. The `injectInto` configuration option can name an + * object to add properties to. + * + * @typedef {object} SandboxConfig + * @property {string[]} properties The properties of the API to expose on the sandbox. Examples: ['spy', 'fake', 'restore'] + * @property {object} injectInto an object in which to inject properties from the sandbox (a facade). This is mostly an integration feature (sinon-test being one). + * @property {boolean} useFakeTimers whether timers are faked by default + * @property {object} [assertOptions] see CreateAssertOptions in ./assert + * + * This type def is really suffering from JSDoc not having standardized + * how to reference types defined in other modules :( + */ + +/** + * A configured sinon sandbox (private type) + * + * @typedef {object} ConfiguredSinonSandboxType + * @private + * @augments Sandbox + * @property {string[]} injectedKeys the keys that have been injected (from config.injectInto) + * @property {*[]} args the arguments for the sandbox + */ + +/** + * Create a sandbox + * + * As of Sinon 5 the `sinon` instance itself is a Sandbox, so you + * hardly ever need to create additional instances for the sake of testing + * + * @param config {SandboxConfig} + * @returns {Sandbox} + */ +function createSandbox(config) { + if (!config) { + return new Sandbox(); + } + + const configuredSandbox = prepareSandboxFromConfig(config); + configuredSandbox.args = configuredSandbox.args || []; + configuredSandbox.injectedKeys = []; + configuredSandbox.injectInto = config.injectInto; + const exposed = configuredSandbox.inject({}); + + if (config.properties) { + forEach(config.properties, function (prop) { + const value = + exposed[prop] || (prop === "sandbox" && configuredSandbox); + exposeValue(configuredSandbox, config, prop, value); + }); + } else { + exposeValue(configuredSandbox, config, "sandbox"); + } + + return configuredSandbox; +} + +module.exports = createSandbox; + +},{"./sandbox":19,"@sinonjs/commons":46}],8:[function(require,module,exports){ +"use strict"; + +const stub = require("./stub"); +const sinonType = require("./util/core/sinon-type"); +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function isStub(value) { + return sinonType.get(value) === "stub"; +} + +module.exports = function createStubInstance(constructor, overrides) { + if (typeof constructor !== "function") { + throw new TypeError("The constructor should be a function."); + } + + const stubInstance = Object.create(constructor.prototype); + sinonType.set(stubInstance, "stub-instance"); + + const stubbedObject = stub(stubInstance); + + forEach(Object.keys(overrides || {}), function (propertyName) { + if (propertyName in stubbedObject) { + const value = overrides[propertyName]; + if (isStub(value)) { + stubbedObject[propertyName] = value; + } else { + stubbedObject[propertyName].returns(value); + } + } else { + throw new Error( + `Cannot stub ${propertyName}. Property does not exist!`, + ); + } + }); + return stubbedObject; +}; + +},{"./stub":22,"./util/core/sinon-type":34,"@sinonjs/commons":46}],9:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const exportAsyncBehaviors = require("./util/core/export-async-behaviors"); +const extend = require("./util/core/extend"); + +const slice = arrayProto.slice; + +const useLeftMostCallback = -1; +const useRightMostCallback = -2; + +function throwsException(fake, error, message) { + if (typeof error === "function") { + fake.exceptionCreator = error; + } else if (typeof error === "string") { + fake.exceptionCreator = function () { + const newException = new Error( + message || `Sinon-provided ${error}`, + ); + newException.name = error; + return newException; + }; + } else if (!error) { + fake.exceptionCreator = function () { + return new Error("Error"); + }; + } else { + fake.exception = error; + } +} + +const defaultBehaviors = { + callsFake: function callsFake(fake, fn) { + fake.fakeFn = fn; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.callsThrough = false; + }, + + callsArg: function callsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOn: function callsArgOn(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = []; + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgWith: function callsArgWith(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + callsArgOnWith: function callsArgWith(fake, index, context) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + + fake.callArgAt = index; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + }, + + yields: function (fake) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + yieldsRight: function (fake) { + fake.callArgAt = useRightMostCallback; + fake.callbackArguments = slice(arguments, 1); + fake.callbackContext = undefined; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsOn: function (fake, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = context; + fake.callArgProp = undefined; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsTo: function (fake, prop) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 2); + fake.callbackContext = undefined; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.callsThrough = false; + fake.fakeFn = undefined; + }, + + yieldsToOn: function (fake, prop, context) { + fake.callArgAt = useLeftMostCallback; + fake.callbackArguments = slice(arguments, 3); + fake.callbackContext = context; + fake.callArgProp = prop; + fake.callbackAsync = false; + fake.fakeFn = undefined; + }, + + throws: throwsException, + throwsException: throwsException, + + returns: function returns(fake, value) { + fake.callsThrough = false; + fake.returnValue = value; + fake.resolve = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + }, + + returnsArg: function returnsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.returnArgAt = index; + }, + + throwsArg: function throwsArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.callsThrough = false; + + fake.throwArgAt = index; + }, + + returnsThis: function returnsThis(fake) { + fake.returnThis = true; + fake.callsThrough = false; + }, + + resolves: function resolves(fake, value) { + fake.returnValue = value; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + resolvesArg: function resolvesArg(fake, index) { + if (typeof index !== "number") { + throw new TypeError("argument index is not number"); + } + fake.resolveArgAt = index; + fake.returnValue = undefined; + fake.resolve = true; + fake.resolveThis = false; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + rejects: function rejects(fake, error, message) { + let reason; + if (typeof error === "string") { + reason = new Error(message || ""); + reason.name = error; + } else if (!error) { + reason = new Error("Error"); + } else { + reason = error; + } + fake.returnValue = reason; + fake.resolve = false; + fake.resolveThis = false; + fake.reject = true; + fake.returnValueDefined = true; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + + return fake; + }, + + resolvesThis: function resolvesThis(fake) { + fake.returnValue = undefined; + fake.resolve = false; + fake.resolveThis = true; + fake.reject = false; + fake.returnValueDefined = false; + fake.exception = undefined; + fake.exceptionCreator = undefined; + fake.fakeFn = undefined; + fake.callsThrough = false; + }, + + callThrough: function callThrough(fake) { + fake.callsThrough = true; + }, + + callThroughWithNew: function callThroughWithNew(fake) { + fake.callsThroughWithNew = true; + }, + + get: function get(fake, getterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + get: getterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }); + + return fake; + }, + + set: function set(fake, setterFunction) { + const rootStub = fake.stub || fake; + + Object.defineProperty( + rootStub.rootObj, + rootStub.propName, + // eslint-disable-next-line accessor-pairs + { + set: setterFunction, + configurable: isPropertyConfigurable( + rootStub.rootObj, + rootStub.propName, + ), + }, + ); + + return fake; + }, + + value: function value(fake, newVal) { + const rootStub = fake.stub || fake; + + Object.defineProperty(rootStub.rootObj, rootStub.propName, { + value: newVal, + enumerable: true, + writable: true, + configurable: + rootStub.shadowsPropOnPrototype || + isPropertyConfigurable(rootStub.rootObj, rootStub.propName), + }); + + return fake; + }, +}; + +const asyncBehaviors = exportAsyncBehaviors(defaultBehaviors); + +module.exports = extend({}, defaultBehaviors, asyncBehaviors); + +},{"./util/core/export-async-behaviors":24,"./util/core/extend":25,"./util/core/is-property-configurable":31,"@sinonjs/commons":46}],10:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const nextTick = require("./util/core/next-tick"); + +const slice = arrayProto.slice; + +module.exports = fake; + +/** + * Returns a `fake` that records all calls, arguments and return values. + * + * When an `f` argument is supplied, this implementation will be used. + * + * @example + * // create an empty fake + * var f1 = sinon.fake(); + * + * f1(); + * + * f1.calledOnce() + * // true + * + * @example + * function greet(greeting) { + * console.log(`Hello ${greeting}`); + * } + * + * // create a fake with implementation + * var f2 = sinon.fake(greet); + * + * // Hello world + * f2("world"); + * + * f2.calledWith("world"); + * // true + * + * @param {Function|undefined} f + * @returns {Function} + * @namespace + */ +function fake(f) { + if (arguments.length > 0 && typeof f !== "function") { + throw new TypeError("Expected f argument to be a Function"); + } + + return wrapFunc(f); +} + +/** + * Creates a `fake` that returns the provided `value`, as well as recording all + * calls, arguments and return values. + * + * @example + * var f1 = sinon.fake.returns(42); + * + * f1(); + * // 42 + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.returns = function returns(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return value; + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that throws an Error. + * If the `value` argument does not have Error in its prototype chain, it will + * be used for creating a new error. + * + * @example + * var f1 = sinon.fake.throws("hello"); + * + * f1(); + * // Uncaught Error: hello + * + * @example + * var f2 = sinon.fake.throws(new TypeError("Invalid argument")); + * + * f2(); + * // Uncaught TypeError: Invalid argument + * + * @memberof fake + * @param {*|Error} value + * @returns {Function} + */ +fake.throws = function throws(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + throw getError(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that resolves to the passed `value` + * argument. + * + * @example + * var f1 = sinon.fake.resolves("apple pie"); + * + * await f1(); + * // "apple pie" + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.resolves = function resolves(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.resolve(value); + } + + return wrapFunc(f); +}; + +/** + * Creates a `fake` that returns a promise that rejects to the passed `value` + * argument. When `value` does not have Error in its prototype chain, it will be + * wrapped in an Error. + * + * @example + * var f1 = sinon.fake.rejects(":("); + * + * try { + * await f1(); + * } catch (error) { + * console.log(error); + * // ":(" + * } + * + * @memberof fake + * @param {*} value + * @returns {Function} + */ +fake.rejects = function rejects(value) { + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + return Promise.reject(getError(value)); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback with the defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * // "apple*pie" + * + * @memberof fake + * @returns {Function} + */ +fake.yields = function yields() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + + callback.apply(null, values); + } + + return wrapFunc(f); +}; + +/** + * Returns a `fake` that calls the callback **asynchronously** with the + * defined arguments. + * + * @example + * function callback() { + * console.log(arguments.join("*")); + * } + * + * const f1 = sinon.fake.yields("apple", "pie"); + * + * f1(callback); + * + * setTimeout(() => { + * // "apple*pie" + * }); + * + * @memberof fake + * @returns {Function} + */ +fake.yieldsAsync = function yieldsAsync() { + const values = slice(arguments); + + // eslint-disable-next-line jsdoc/require-jsdoc + function f() { + const callback = arguments[arguments.length - 1]; + if (typeof callback !== "function") { + throw new TypeError("Expected last argument to be a function"); + } + nextTick(function () { + callback.apply(null, values); + }); + } + + return wrapFunc(f); +}; + +let uuid = 0; +/** + * Creates a proxy (sinon concept) from the passed function. + * + * @private + * @param {Function} f + * @returns {Function} + */ +function wrapFunc(f) { + const fakeInstance = function () { + let firstArg, lastArg; + + if (arguments.length > 0) { + firstArg = arguments[0]; + lastArg = arguments[arguments.length - 1]; + } + + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + /* eslint-disable no-use-before-define */ + proxy.firstArg = firstArg; + proxy.lastArg = lastArg; + proxy.callback = callback; + + return f && f.apply(this, arguments); + }; + const proxy = createProxy(fakeInstance, f || fakeInstance); + + proxy.displayName = "fake"; + proxy.id = `fake#${uuid++}`; + + return proxy; +} + +/** + * Returns an Error instance from the passed value, if the value is not + * already an Error instance. + * + * @private + * @param {*} value [description] + * @returns {Error} [description] + */ +function getError(value) { + return value instanceof Error ? value : new Error(value); +} + +},{"./proxy":17,"./util/core/next-tick":33,"@sinonjs/commons":46}],11:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyInvoke = require("./proxy-invoke"); +const proxyCallToString = require("./proxy-call").toString; +const timesInWords = require("./util/core/times-in-words"); +const extend = require("./util/core/extend"); +const match = require("@sinonjs/samsam").createMatcher; +const stub = require("./stub"); +const assert = require("./assert"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const every = arrayProto.every; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const slice = arrayProto.slice; + +function callCountInWords(callCount) { + if (callCount === 0) { + return "never called"; + } + + return `called ${timesInWords(callCount)}`; +} + +function expectedCallCountInWords(expectation) { + const min = expectation.minCalls; + const max = expectation.maxCalls; + + if (typeof min === "number" && typeof max === "number") { + let str = timesInWords(min); + + if (min !== max) { + str = `at least ${str} and at most ${timesInWords(max)}`; + } + + return str; + } + + if (typeof min === "number") { + return `at least ${timesInWords(min)}`; + } + + return `at most ${timesInWords(max)}`; +} + +function receivedMinCalls(expectation) { + const hasMinLimit = typeof expectation.minCalls === "number"; + return !hasMinLimit || expectation.callCount >= expectation.minCalls; +} + +function receivedMaxCalls(expectation) { + if (typeof expectation.maxCalls !== "number") { + return false; + } + + return expectation.callCount === expectation.maxCalls; +} + +function verifyMatcher(possibleMatcher, arg) { + const isMatcher = match.isMatcher(possibleMatcher); + + return (isMatcher && possibleMatcher.test(arg)) || true; +} + +const mockExpectation = { + minCalls: 1, + maxCalls: 1, + + create: function create(methodName) { + const expectation = extend.nonEnum(stub(), mockExpectation); + delete expectation.create; + expectation.method = methodName; + + return expectation; + }, + + invoke: function invoke(func, thisValue, args) { + this.verifyCallAllowed(thisValue, args); + + return proxyInvoke.apply(this, arguments); + }, + + atLeast: function atLeast(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.maxCalls = null; + this.limitsSet = true; + } + + this.minCalls = num; + + return this; + }, + + atMost: function atMost(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not number`); + } + + if (!this.limitsSet) { + this.minCalls = null; + this.limitsSet = true; + } + + this.maxCalls = num; + + return this; + }, + + never: function never() { + return this.exactly(0); + }, + + once: function once() { + return this.exactly(1); + }, + + twice: function twice() { + return this.exactly(2); + }, + + thrice: function thrice() { + return this.exactly(3); + }, + + exactly: function exactly(num) { + if (typeof num !== "number") { + throw new TypeError(`'${valueToString(num)}' is not a number`); + } + + this.atLeast(num); + return this.atMost(num); + }, + + met: function met() { + return !this.failed && receivedMinCalls(this); + }, + + verifyCallAllowed: function verifyCallAllowed(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (receivedMaxCalls(this)) { + this.failed = true; + mockExpectation.fail( + `${this.method} already called ${timesInWords(this.maxCalls)}`, + ); + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + mockExpectation.fail( + `${this.method} called with ${valueToString( + thisValue, + )} as thisValue, expected ${valueToString(this.expectedThis)}`, + ); + } + + if (!("expectedArguments" in this)) { + return; + } + + if (!args) { + mockExpectation.fail( + `${this.method} received no arguments, expected ${inspect( + expectedArguments, + )}`, + ); + } + + if (args.length < expectedArguments.length) { + mockExpectation.fail( + `${this.method} received too few arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + if ( + this.expectsExactArgCount && + args.length !== expectedArguments.length + ) { + mockExpectation.fail( + `${this.method} received too many arguments (${inspect( + args, + )}), expected ${inspect(expectedArguments)}`, + ); + } + + forEach( + expectedArguments, + function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, args[i])) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, didn't match ${String(expectedArguments)}`, + ); + } + + if (!deepEqual(args[i], expectedArgument)) { + mockExpectation.fail( + `${this.method} received wrong arguments ${inspect( + args, + )}, expected ${inspect(expectedArguments)}`, + ); + } + }, + this, + ); + }, + + allowsCall: function allowsCall(thisValue, args) { + const expectedArguments = this.expectedArguments; + + if (this.met() && receivedMaxCalls(this)) { + return false; + } + + if ("expectedThis" in this && this.expectedThis !== thisValue) { + return false; + } + + if (!("expectedArguments" in this)) { + return true; + } + + // eslint-disable-next-line no-underscore-dangle + const _args = args || []; + + if (_args.length < expectedArguments.length) { + return false; + } + + if ( + this.expectsExactArgCount && + _args.length !== expectedArguments.length + ) { + return false; + } + + return every(expectedArguments, function (expectedArgument, i) { + if (!verifyMatcher(expectedArgument, _args[i])) { + return false; + } + + if (!deepEqual(_args[i], expectedArgument)) { + return false; + } + + return true; + }); + }, + + withArgs: function withArgs() { + this.expectedArguments = slice(arguments); + return this; + }, + + withExactArgs: function withExactArgs() { + this.withArgs.apply(this, arguments); + this.expectsExactArgCount = true; + return this; + }, + + on: function on(thisValue) { + this.expectedThis = thisValue; + return this; + }, + + toString: function () { + const args = slice(this.expectedArguments || []); + + if (!this.expectsExactArgCount) { + push(args, "[...]"); + } + + const callStr = proxyCallToString.call({ + proxy: this.method || "anonymous mock expectation", + args: args, + }); + + const message = `${callStr.replace( + ", [...", + "[, ...", + )} ${expectedCallCountInWords(this)}`; + + if (this.met()) { + return `Expectation met: ${message}`; + } + + return `Expected ${message} (${callCountInWords(this.callCount)})`; + }, + + verify: function verify() { + if (!this.met()) { + mockExpectation.fail(String(this)); + } else { + mockExpectation.pass(String(this)); + } + + return true; + }, + + pass: function pass(message) { + assert.pass(message); + }, + + fail: function fail(message) { + const exception = new Error(message); + exception.name = "ExpectationError"; + + throw exception; + }, +}; + +module.exports = mockExpectation; + +},{"./assert":3,"./proxy-call":15,"./proxy-invoke":16,"./stub":22,"./util/core/extend":25,"./util/core/times-in-words":35,"@sinonjs/commons":46,"@sinonjs/samsam":86,"util":90}],12:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const mockExpectation = require("./mock-expectation"); +const proxyCallToString = require("./proxy-call").toString; +const extend = require("./util/core/extend"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const wrapMethod = require("./util/core/wrap-method"); + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const every = arrayProto.every; +const join = arrayProto.join; +const push = arrayProto.push; +const slice = arrayProto.slice; +const unshift = arrayProto.unshift; + +function mock(object) { + if (!object || typeof object === "string") { + return mockExpectation.create(object ? object : "Anonymous mock"); + } + + return mock.create(object); +} + +function each(collection, callback) { + const col = collection || []; + + forEach(col, callback); +} + +function arrayEquals(arr1, arr2, compareLength) { + if (compareLength && arr1.length !== arr2.length) { + return false; + } + + return every(arr1, function (element, i) { + return deepEqual(arr2[i], element); + }); +} + +extend(mock, { + create: function create(object) { + if (!object) { + throw new TypeError("object is null"); + } + + const mockObject = extend.nonEnum({}, mock, { object: object }); + delete mockObject.create; + + return mockObject; + }, + + expects: function expects(method) { + if (!method) { + throw new TypeError("method is falsy"); + } + + if (!this.expectations) { + this.expectations = {}; + this.proxies = []; + this.failures = []; + } + + if (!this.expectations[method]) { + this.expectations[method] = []; + const mockObject = this; + + wrapMethod(this.object, method, function () { + return mockObject.invokeMethod(method, this, arguments); + }); + + push(this.proxies, method); + } + + const expectation = mockExpectation.create(method); + expectation.wrappedMethod = this.object[method].wrappedMethod; + push(this.expectations[method], expectation); + + return expectation; + }, + + restore: function restore() { + const object = this.object; + + each(this.proxies, function (proxy) { + if (typeof object[proxy].restore === "function") { + object[proxy].restore(); + } + }); + }, + + verify: function verify() { + const expectations = this.expectations || {}; + const messages = this.failures ? slice(this.failures) : []; + const met = []; + + each(this.proxies, function (proxy) { + each(expectations[proxy], function (expectation) { + if (!expectation.met()) { + push(messages, String(expectation)); + } else { + push(met, String(expectation)); + } + }); + }); + + this.restore(); + + if (messages.length > 0) { + mockExpectation.fail(join(concat(messages, met), "\n")); + } else if (met.length > 0) { + mockExpectation.pass(join(concat(messages, met), "\n")); + } + + return true; + }, + + invokeMethod: function invokeMethod(method, thisValue, args) { + /* if we cannot find any matching files we will explicitly call mockExpection#fail with error messages */ + /* eslint consistent-return: "off" */ + const expectations = + this.expectations && this.expectations[method] + ? this.expectations[method] + : []; + const currentArgs = args || []; + let available; + + const expectationsWithMatchingArgs = filter( + expectations, + function (expectation) { + const expectedArgs = expectation.expectedArguments || []; + + return arrayEquals( + expectedArgs, + currentArgs, + expectation.expectsExactArgCount, + ); + }, + ); + + const expectationsToApply = filter( + expectationsWithMatchingArgs, + function (expectation) { + return ( + !expectation.met() && + expectation.allowsCall(thisValue, args) + ); + }, + ); + + if (expectationsToApply.length > 0) { + return expectationsToApply[0].apply(thisValue, args); + } + + const messages = []; + let exhausted = 0; + + forEach(expectationsWithMatchingArgs, function (expectation) { + if (expectation.allowsCall(thisValue, args)) { + available = available || expectation; + } else { + exhausted += 1; + } + }); + + if (available && exhausted === 0) { + return available.apply(thisValue, args); + } + + forEach(expectations, function (expectation) { + push(messages, ` ${String(expectation)}`); + }); + + unshift( + messages, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + })}`, + ); + + const err = new Error(); + if (!err.stack) { + // PhantomJS does not serialize the stack trace until the error has been thrown + try { + throw err; + } catch (e) { + /* empty */ + } + } + push( + this.failures, + `Unexpected call: ${proxyCallToString.call({ + proxy: method, + args: args, + stack: err.stack, + })}`, + ); + + mockExpectation.fail(join(messages, "\n")); + }, +}); + +module.exports = mock; + +},{"./mock-expectation":11,"./proxy-call":15,"./util/core/extend":25,"./util/core/wrap-method":38,"@sinonjs/commons":46,"@sinonjs/samsam":86}],13:[function(require,module,exports){ +"use strict"; + +const fake = require("./fake"); +const isRestorable = require("./util/core/is-restorable"); + +const STATUS_PENDING = "pending"; +const STATUS_RESOLVED = "resolved"; +const STATUS_REJECTED = "rejected"; + +/** + * Returns a fake for a given function or undefined. If no function is given, a + * new fake is returned. If the given function is already a fake, it is + * returned as is. Otherwise the given function is wrapped in a new fake. + * + * @param {Function} [executor] The optional executor function. + * @returns {Function} + */ +function getFakeExecutor(executor) { + if (isRestorable(executor)) { + return executor; + } + if (executor) { + return fake(executor); + } + return fake(); +} + +/** + * Returns a new promise that exposes it's internal `status`, `resolvedValue` + * and `rejectedValue` and can be resolved or rejected from the outside by + * calling `resolve(value)` or `reject(reason)`. + * + * @param {Function} [executor] The optional executor function. + * @returns {Promise} + */ +function promise(executor) { + const fakeExecutor = getFakeExecutor(executor); + const sinonPromise = new Promise(fakeExecutor); + + sinonPromise.status = STATUS_PENDING; + sinonPromise + .then(function (value) { + sinonPromise.status = STATUS_RESOLVED; + sinonPromise.resolvedValue = value; + }) + .catch(function (reason) { + sinonPromise.status = STATUS_REJECTED; + sinonPromise.rejectedValue = reason; + }); + + /** + * Resolves or rejects the promise with the given status and value. + * + * @param {string} status + * @param {*} value + * @param {Function} callback + */ + function finalize(status, value, callback) { + if (sinonPromise.status !== STATUS_PENDING) { + throw new Error(`Promise already ${sinonPromise.status}`); + } + + sinonPromise.status = status; + callback(value); + } + + sinonPromise.resolve = function (value) { + finalize(STATUS_RESOLVED, value, fakeExecutor.firstCall.args[0]); + // Return the promise so that callers can await it: + return sinonPromise; + }; + sinonPromise.reject = function (reason) { + finalize(STATUS_REJECTED, reason, fakeExecutor.firstCall.args[1]); + // Return a new promise that resolves when the sinon promise was + // rejected, so that callers can await it: + return new Promise(function (resolve) { + sinonPromise.catch(() => resolve()); + }); + }; + + return sinonPromise; +} + +module.exports = promise; + +},{"./fake":10,"./util/core/is-restorable":32}],14:[function(require,module,exports){ +"use strict"; + +const push = require("@sinonjs/commons").prototypes.array.push; + +exports.incrementCallCount = function incrementCallCount(proxy) { + proxy.called = true; + proxy.callCount += 1; + proxy.notCalled = false; + proxy.calledOnce = proxy.callCount === 1; + proxy.calledTwice = proxy.callCount === 2; + proxy.calledThrice = proxy.callCount === 3; +}; + +exports.createCallProperties = function createCallProperties(proxy) { + proxy.firstCall = proxy.getCall(0); + proxy.secondCall = proxy.getCall(1); + proxy.thirdCall = proxy.getCall(2); + proxy.lastCall = proxy.getCall(proxy.callCount - 1); +}; + +exports.delegateToCalls = function delegateToCalls( + proxy, + method, + matchAny, + actual, + returnsValues, + notCalled, + totalCallCount, +) { + proxy[method] = function () { + if (!this.called) { + if (notCalled) { + return notCalled.apply(this, arguments); + } + return false; + } + + if (totalCallCount !== undefined && this.callCount !== totalCallCount) { + return false; + } + + let currentCall; + let matches = 0; + const returnValues = []; + + for (let i = 0, l = this.callCount; i < l; i += 1) { + currentCall = this.getCall(i); + const returnValue = currentCall[actual || method].apply( + currentCall, + arguments, + ); + push(returnValues, returnValue); + if (returnValue) { + matches += 1; + + if (matchAny) { + return true; + } + } + } + + if (returnsValues) { + return returnValues; + } + return matches === this.callCount; + }; +}; + +},{"@sinonjs/commons":46}],15:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const match = require("@sinonjs/samsam").createMatcher; +const deepEqual = require("@sinonjs/samsam").deepEqual; +const functionName = require("@sinonjs/commons").functionName; +const inspect = require("util").inspect; +const valueToString = require("@sinonjs/commons").valueToString; + +const concat = arrayProto.concat; +const filter = arrayProto.filter; +const join = arrayProto.join; +const map = arrayProto.map; +const reduce = arrayProto.reduce; +const slice = arrayProto.slice; + +/** + * @param proxy + * @param text + * @param args + */ +function throwYieldError(proxy, text, args) { + let msg = functionName(proxy) + text; + if (args.length) { + msg += ` Received [${join(slice(args), ", ")}]`; + } + throw new Error(msg); +} + +const callProto = { + calledOn: function calledOn(thisValue) { + if (match.isMatcher(thisValue)) { + return thisValue.test(this.thisValue); + } + return this.thisValue === thisValue; + }, + + calledWith: function calledWith() { + const self = this; + const calledWithArgs = slice(arguments); + + if (calledWithArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithArgs, + function (prev, arg, i) { + return prev && deepEqual(self.args[i], arg); + }, + true, + ); + }, + + calledWithMatch: function calledWithMatch() { + const self = this; + const calledWithMatchArgs = slice(arguments); + + if (calledWithMatchArgs.length > self.args.length) { + return false; + } + + return reduce( + calledWithMatchArgs, + function (prev, expectation, i) { + const actual = self.args[i]; + + return prev && match(expectation).test(actual); + }, + true, + ); + }, + + calledWithExactly: function calledWithExactly() { + return ( + arguments.length === this.args.length && + this.calledWith.apply(this, arguments) + ); + }, + + notCalledWith: function notCalledWith() { + return !this.calledWith.apply(this, arguments); + }, + + notCalledWithMatch: function notCalledWithMatch() { + return !this.calledWithMatch.apply(this, arguments); + }, + + returned: function returned(value) { + return deepEqual(this.returnValue, value); + }, + + threw: function threw(error) { + if (typeof error === "undefined" || !this.exception) { + return Boolean(this.exception); + } + + return this.exception === error || this.exception.name === error; + }, + + calledWithNew: function calledWithNew() { + return this.proxy.prototype && this.thisValue instanceof this.proxy; + }, + + calledBefore: function (other) { + return this.callId < other.callId; + }, + + calledAfter: function (other) { + return this.callId > other.callId; + }, + + calledImmediatelyBefore: function (other) { + return this.callId === other.callId - 1; + }, + + calledImmediatelyAfter: function (other) { + return this.callId === other.callId + 1; + }, + + callArg: function (pos) { + this.ensureArgIsAFunction(pos); + return this.args[pos](); + }, + + callArgOn: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + return this.args[pos].apply(thisValue); + }, + + callArgWith: function (pos) { + return this.callArgOnWith.apply( + this, + concat([pos, null], slice(arguments, 1)), + ); + }, + + callArgOnWith: function (pos, thisValue) { + this.ensureArgIsAFunction(pos); + const args = slice(arguments, 2); + return this.args[pos].apply(thisValue, args); + }, + + throwArg: function (pos) { + if (pos > this.args.length) { + throw new TypeError( + `Not enough arguments: ${pos} required but only ${this.args.length} present`, + ); + } + + throw this.args[pos]; + }, + + yield: function () { + return this.yieldOn.apply(this, concat([null], slice(arguments, 0))); + }, + + yieldOn: function (thisValue) { + const args = slice(this.args); + const yieldFn = filter(args, function (arg) { + return typeof arg === "function"; + })[0]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + " cannot yield since no callback was passed.", + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 1)); + }, + + yieldTo: function (prop) { + return this.yieldToOn.apply( + this, + concat([prop, null], slice(arguments, 1)), + ); + }, + + yieldToOn: function (prop, thisValue) { + const args = slice(this.args); + const yieldArg = filter(args, function (arg) { + return arg && typeof arg[prop] === "function"; + })[0]; + const yieldFn = yieldArg && yieldArg[prop]; + + if (!yieldFn) { + throwYieldError( + this.proxy, + ` cannot yield to '${valueToString( + prop, + )}' since no callback was passed.`, + args, + ); + } + + return yieldFn.apply(thisValue, slice(arguments, 2)); + }, + + toString: function () { + if (!this.args) { + return ":("; + } + + let callStr = this.proxy ? `${String(this.proxy)}(` : ""; + const formattedArgs = map(this.args, function (arg) { + return inspect(arg); + }); + + callStr = `${callStr + join(formattedArgs, ", ")})`; + + if (typeof this.returnValue !== "undefined") { + callStr += ` => ${inspect(this.returnValue)}`; + } + + if (this.exception) { + callStr += ` !${this.exception.name}`; + + if (this.exception.message) { + callStr += `(${this.exception.message})`; + } + } + if (this.stack) { + // If we have a stack, add the first frame that's in end-user code + // Skip the first two frames because they will refer to Sinon code + callStr += (this.stack.split("\n")[3] || "unknown").replace( + /^\s*(?:at\s+|@)?/, + " at ", + ); + } + + return callStr; + }, + + ensureArgIsAFunction: function (pos) { + if (typeof this.args[pos] !== "function") { + throw new TypeError( + `Expected argument at position ${pos} to be a Function, but was ${typeof this + .args[pos]}`, + ); + } + }, +}; +Object.defineProperty(callProto, "stack", { + enumerable: true, + configurable: true, + get: function () { + return (this.errorWithCallStack && this.errorWithCallStack.stack) || ""; + }, +}); + +callProto.invokeCallback = callProto.yield; + +/** + * @param proxy + * @param thisValue + * @param args + * @param returnValue + * @param exception + * @param id + * @param errorWithCallStack + * + * @returns {object} proxyCall + */ +function createProxyCall( + proxy, + thisValue, + args, + returnValue, + exception, + id, + errorWithCallStack, +) { + if (typeof id !== "number") { + throw new TypeError("Call id is not a number"); + } + + let firstArg, lastArg; + + if (args.length > 0) { + firstArg = args[0]; + lastArg = args[args.length - 1]; + } + + const proxyCall = Object.create(callProto); + const callback = + lastArg && typeof lastArg === "function" ? lastArg : undefined; + + proxyCall.proxy = proxy; + proxyCall.thisValue = thisValue; + proxyCall.args = args; + proxyCall.firstArg = firstArg; + proxyCall.lastArg = lastArg; + proxyCall.callback = callback; + proxyCall.returnValue = returnValue; + proxyCall.exception = exception; + proxyCall.callId = id; + proxyCall.errorWithCallStack = errorWithCallStack; + + return proxyCall; +} +createProxyCall.toString = callProto.toString; // used by mocks + +module.exports = createProxyCall; + +},{"@sinonjs/commons":46,"@sinonjs/samsam":86,"util":90}],16:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const proxyCallUtil = require("./proxy-call-util"); + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const concat = arrayProto.concat; +const ErrorConstructor = Error.prototype.constructor; +const bind = Function.prototype.bind; + +let callId = 0; + +module.exports = function invoke(func, thisValue, args) { + const matchings = this.matchingFakes(args); + const currentCallId = callId++; + let exception, returnValue; + + proxyCallUtil.incrementCallCount(this); + push(this.thisValues, thisValue); + push(this.args, args); + push(this.callIds, currentCallId); + forEach(matchings, function (matching) { + proxyCallUtil.incrementCallCount(matching); + push(matching.thisValues, thisValue); + push(matching.args, args); + push(matching.callIds, currentCallId); + }); + + // Make call properties available from within the spied function: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + try { + this.invoking = true; + + const thisCall = this.getCall(this.callCount - 1); + + if (thisCall.calledWithNew()) { + // Call through with `new` + returnValue = new (bind.apply( + this.func || func, + concat([thisValue], args), + ))(); + + if ( + typeof returnValue !== "object" && + typeof returnValue !== "function" + ) { + returnValue = thisValue; + } + } else { + returnValue = (this.func || func).apply(thisValue, args); + } + } catch (e) { + exception = e; + } finally { + delete this.invoking; + } + + push(this.exceptions, exception); + push(this.returnValues, returnValue); + forEach(matchings, function (matching) { + push(matching.exceptions, exception); + push(matching.returnValues, returnValue); + }); + + const err = new ErrorConstructor(); + // 1. Please do not get stack at this point. It may be so very slow, and not actually used + // 2. PhantomJS does not serialize the stack trace until the error has been thrown: + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack + try { + throw err; + } catch (e) { + /* empty */ + } + push(this.errorsWithCallStack, err); + forEach(matchings, function (matching) { + push(matching.errorsWithCallStack, err); + }); + + // Make return value and exception available in the calls: + proxyCallUtil.createCallProperties(this); + forEach(matchings, proxyCallUtil.createCallProperties); + + if (exception !== undefined) { + throw exception; + } + + return returnValue; +}; + +},{"./proxy-call-util":14,"@sinonjs/commons":46}],17:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const extend = require("./util/core/extend"); +const functionToString = require("./util/core/function-to-string"); +const proxyCall = require("./proxy-call"); +const proxyCallUtil = require("./proxy-call-util"); +const proxyInvoke = require("./proxy-invoke"); +const inspect = require("util").inspect; + +const push = arrayProto.push; +const forEach = arrayProto.forEach; +const slice = arrayProto.slice; + +const emptyFakes = Object.freeze([]); + +// Public API +const proxyApi = { + toString: functionToString, + + named: function named(name) { + this.displayName = name; + const nameDescriptor = Object.getOwnPropertyDescriptor(this, "name"); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + nameDescriptor.value = name; + Object.defineProperty(this, "name", nameDescriptor); + } + return this; + }, + + invoke: proxyInvoke, + + /* + * Hook for derived implementation to return fake instances matching the + * given arguments. + */ + matchingFakes: function (/*args, strict*/) { + return emptyFakes; + }, + + getCall: function getCall(index) { + let i = index; + if (i < 0) { + // Negative indices means counting backwards from the last call + i += this.callCount; + } + if (i < 0 || i >= this.callCount) { + return null; + } + + return proxyCall( + this, + this.thisValues[i], + this.args[i], + this.returnValues[i], + this.exceptions[i], + this.callIds[i], + this.errorsWithCallStack[i], + ); + }, + + getCalls: function () { + const calls = []; + let i; + + for (i = 0; i < this.callCount; i++) { + push(calls, this.getCall(i)); + } + + return calls; + }, + + calledBefore: function calledBefore(proxy) { + if (!this.called) { + return false; + } + + if (!proxy.called) { + return true; + } + + return this.callIds[0] < proxy.callIds[proxy.callIds.length - 1]; + }, + + calledAfter: function calledAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return this.callIds[this.callCount - 1] > proxy.callIds[0]; + }, + + calledImmediatelyBefore: function calledImmediatelyBefore(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] - 1 + ); + }, + + calledImmediatelyAfter: function calledImmediatelyAfter(proxy) { + if (!this.called || !proxy.called) { + return false; + } + + return ( + this.callIds[this.callCount - 1] === + proxy.callIds[proxy.callCount - 1] + 1 + ); + }, + + formatters: require("./spy-formatters"), + printf: function (format) { + const spyInstance = this; + const args = slice(arguments, 1); + let formatter; + + return (format || "").replace(/%(.)/g, function (match, specifier) { + formatter = proxyApi.formatters[specifier]; + + if (typeof formatter === "function") { + return String(formatter(spyInstance, args)); + } else if (!isNaN(parseInt(specifier, 10))) { + return inspect(args[specifier - 1]); + } + + return `%${specifier}`; + }); + }, + + resetHistory: function () { + if (this.invoking) { + const err = new Error( + "Cannot reset Sinon function while invoking it. " + + "Move the call to .resetHistory outside of the callback.", + ); + err.name = "InvalidResetException"; + throw err; + } + + this.called = false; + this.notCalled = true; + this.calledOnce = false; + this.calledTwice = false; + this.calledThrice = false; + this.callCount = 0; + this.firstCall = null; + this.secondCall = null; + this.thirdCall = null; + this.lastCall = null; + this.args = []; + this.firstArg = null; + this.lastArg = null; + this.returnValues = []; + this.thisValues = []; + this.exceptions = []; + this.callIds = []; + this.errorsWithCallStack = []; + + if (this.fakes) { + forEach(this.fakes, function (fake) { + fake.resetHistory(); + }); + } + + return this; + }, +}; + +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(proxyApi, "calledOn", true); +delegateToCalls(proxyApi, "alwaysCalledOn", false, "calledOn"); +delegateToCalls(proxyApi, "calledWith", true); +delegateToCalls( + proxyApi, + "calledOnceWith", + true, + "calledWith", + false, + undefined, + 1, +); +delegateToCalls(proxyApi, "calledWithMatch", true); +delegateToCalls(proxyApi, "alwaysCalledWith", false, "calledWith"); +delegateToCalls(proxyApi, "alwaysCalledWithMatch", false, "calledWithMatch"); +delegateToCalls(proxyApi, "calledWithExactly", true); +delegateToCalls( + proxyApi, + "calledOnceWithExactly", + true, + "calledWithExactly", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "calledOnceWithMatch", + true, + "calledWithMatch", + false, + undefined, + 1, +); +delegateToCalls( + proxyApi, + "alwaysCalledWithExactly", + false, + "calledWithExactly", +); +delegateToCalls( + proxyApi, + "neverCalledWith", + false, + "notCalledWith", + false, + function () { + return true; + }, +); +delegateToCalls( + proxyApi, + "neverCalledWithMatch", + false, + "notCalledWithMatch", + false, + function () { + return true; + }, +); +delegateToCalls(proxyApi, "threw", true); +delegateToCalls(proxyApi, "alwaysThrew", false, "threw"); +delegateToCalls(proxyApi, "returned", true); +delegateToCalls(proxyApi, "alwaysReturned", false, "returned"); +delegateToCalls(proxyApi, "calledWithNew", true); +delegateToCalls(proxyApi, "alwaysCalledWithNew", false, "calledWithNew"); + +function createProxy(func, originalFunc) { + const proxy = wrapFunction(func, originalFunc); + + // Inherit function properties: + extend(proxy, func); + + proxy.prototype = func.prototype; + + extend.nonEnum(proxy, proxyApi); + + return proxy; +} + +function wrapFunction(func, originalFunc) { + const arity = originalFunc.length; + let p; + // Do not change this to use an eval. Projects that depend on sinon block the use of eval. + // ref: https://github.com/sinonjs/sinon/issues/710 + switch (arity) { + /*eslint-disable no-unused-vars, max-len*/ + case 0: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 1: + p = function proxy(a) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 2: + p = function proxy(a, b) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 3: + p = function proxy(a, b, c) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 4: + p = function proxy(a, b, c, d) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 5: + p = function proxy(a, b, c, d, e) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 6: + p = function proxy(a, b, c, d, e, f) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 7: + p = function proxy(a, b, c, d, e, f, g) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 8: + p = function proxy(a, b, c, d, e, f, g, h) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 9: + p = function proxy(a, b, c, d, e, f, g, h, i) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 10: + p = function proxy(a, b, c, d, e, f, g, h, i, j) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 11: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k) { + return p.invoke(func, this, slice(arguments)); + }; + break; + case 12: + p = function proxy(a, b, c, d, e, f, g, h, i, j, k, l) { + return p.invoke(func, this, slice(arguments)); + }; + break; + default: + p = function proxy() { + return p.invoke(func, this, slice(arguments)); + }; + break; + /*eslint-enable*/ + } + const nameDescriptor = Object.getOwnPropertyDescriptor( + originalFunc, + "name", + ); + if (nameDescriptor && nameDescriptor.configurable) { + // IE 11 functions don't have a name. + // Safari 9 has names that are not configurable. + Object.defineProperty(p, "name", nameDescriptor); + } + extend.nonEnum(p, { + isSinonProxy: true, + + called: false, + notCalled: true, + calledOnce: false, + calledTwice: false, + calledThrice: false, + callCount: 0, + firstCall: null, + firstArg: null, + secondCall: null, + thirdCall: null, + lastCall: null, + lastArg: null, + args: [], + returnValues: [], + thisValues: [], + exceptions: [], + callIds: [], + errorsWithCallStack: [], + }); + return p; +} + +module.exports = createProxy; + +},{"./proxy-call":15,"./proxy-call-util":14,"./proxy-invoke":16,"./spy-formatters":20,"./util/core/extend":25,"./util/core/function-to-string":26,"@sinonjs/commons":46,"util":90}],18:[function(require,module,exports){ +"use strict"; + +const walkObject = require("./util/core/walk-object"); + +function filter(object, property) { + return object[property].restore && object[property].restore.sinon; +} + +function restore(object, property) { + object[property].restore(); +} + +function restoreObject(object) { + return walkObject(restore, object, filter); +} + +module.exports = restoreObject; + +},{"./util/core/walk-object":36}],19:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const logger = require("@sinonjs/commons").deprecated; +const collectOwnMethods = require("./collect-own-methods"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isPropertyConfigurable = require("./util/core/is-property-configurable"); +const match = require("@sinonjs/samsam").createMatcher; +const sinonAssert = require("./assert"); +const sinonClock = require("./util/fake-timers"); +const sinonMock = require("./mock"); +const sinonSpy = require("./spy"); +const sinonStub = require("./stub"); +const sinonCreateStubInstance = require("./create-stub-instance"); +const sinonFake = require("./fake"); +const valueToString = require("@sinonjs/commons").valueToString; + +const DEFAULT_LEAK_THRESHOLD = 10000; + +const filter = arrayProto.filter; +const forEach = arrayProto.forEach; +const push = arrayProto.push; +const reverse = arrayProto.reverse; + +function applyOnEach(fakes, method) { + const matchingFakes = filter(fakes, function (fake) { + return typeof fake[method] === "function"; + }); + + forEach(matchingFakes, function (fake) { + fake[method](); + }); +} + +function throwOnAccessors(descriptor) { + if (typeof descriptor.get === "function") { + throw new Error("Use sandbox.replaceGetter for replacing getters"); + } + + if (typeof descriptor.set === "function") { + throw new Error("Use sandbox.replaceSetter for replacing setters"); + } +} + +function verifySameType(object, property, replacement) { + if (typeof object[property] !== typeof replacement) { + throw new TypeError( + `Cannot replace ${typeof object[ + property + ]} with ${typeof replacement}`, + ); + } +} + +function checkForValidArguments(descriptor, property, replacement) { + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}. Perhaps you meant sandbox.define()?`, + ); + } + + if (typeof replacement === "undefined") { + throw new TypeError("Expected replacement argument to be defined"); + } +} + +/** + * A sinon sandbox + * + * @param opts + * @param {object} [opts.assertOptions] see the CreateAssertOptions in ./assert + * @class + */ +function Sandbox(opts = {}) { + const sandbox = this; + const assertOptions = opts.assertOptions || {}; + let fakeRestorers = []; + + let collection = []; + let loggedLeakWarning = false; + sandbox.leakThreshold = DEFAULT_LEAK_THRESHOLD; + + function addToCollection(object) { + if ( + push(collection, object) > sandbox.leakThreshold && + !loggedLeakWarning + ) { + // eslint-disable-next-line no-console + logger.printWarning( + "Potential memory leak detected; be sure to call restore() to clean up your sandbox. To suppress this warning, modify the leakThreshold property of your sandbox.", + ); + loggedLeakWarning = true; + } + } + + sandbox.assert = sinonAssert.createAssertObject(assertOptions); + + // this is for testing only + sandbox.getFakes = function getFakes() { + return collection; + }; + + sandbox.createStubInstance = function createStubInstance() { + const stubbed = sinonCreateStubInstance.apply(null, arguments); + + const ownMethods = collectOwnMethods(stubbed); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + + return stubbed; + }; + + sandbox.inject = function inject(obj) { + obj.spy = function () { + return sandbox.spy.apply(null, arguments); + }; + + obj.stub = function () { + return sandbox.stub.apply(null, arguments); + }; + + obj.mock = function () { + return sandbox.mock.apply(null, arguments); + }; + + obj.createStubInstance = function () { + return sandbox.createStubInstance.apply(sandbox, arguments); + }; + + obj.fake = function () { + return sandbox.fake.apply(null, arguments); + }; + + obj.define = function () { + return sandbox.define.apply(null, arguments); + }; + + obj.replace = function () { + return sandbox.replace.apply(null, arguments); + }; + + obj.replaceSetter = function () { + return sandbox.replaceSetter.apply(null, arguments); + }; + + obj.replaceGetter = function () { + return sandbox.replaceGetter.apply(null, arguments); + }; + + if (sandbox.clock) { + obj.clock = sandbox.clock; + } + + obj.match = match; + + return obj; + }; + + sandbox.mock = function mock() { + const m = sinonMock.apply(null, arguments); + + addToCollection(m); + + return m; + }; + + sandbox.reset = function reset() { + applyOnEach(collection, "reset"); + applyOnEach(collection, "resetHistory"); + }; + + sandbox.resetBehavior = function resetBehavior() { + applyOnEach(collection, "resetBehavior"); + }; + + sandbox.resetHistory = function resetHistory() { + function privateResetHistory(f) { + const method = f.resetHistory || f.reset; + if (method) { + method.call(f); + } + } + + forEach(collection, privateResetHistory); + }; + + sandbox.restore = function restore() { + if (arguments.length) { + throw new Error( + "sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()", + ); + } + + reverse(collection); + applyOnEach(collection, "restore"); + collection = []; + + forEach(fakeRestorers, function (restorer) { + restorer(); + }); + fakeRestorers = []; + + sandbox.restoreContext(); + }; + + sandbox.restoreContext = function restoreContext() { + if (!sandbox.injectedKeys) { + return; + } + + forEach(sandbox.injectedKeys, function (injectedKey) { + delete sandbox.injectInto[injectedKey]; + }); + + sandbox.injectedKeys.length = 0; + }; + + /** + * Creates a restorer function for the property + * + * @param {object|Function} object + * @param {string} property + * @param {boolean} forceAssignment + * @returns {Function} restorer function + */ + function getFakeRestorer(object, property, forceAssignment = false) { + const descriptor = getPropertyDescriptor(object, property); + const value = forceAssignment && object[property]; + + function restorer() { + if (forceAssignment) { + object[property] = value; + } else if (descriptor?.isOwn) { + Object.defineProperty(object, property, descriptor); + } else { + delete object[property]; + } + } + + restorer.object = object; + restorer.property = property; + return restorer; + } + + function verifyNotReplaced(object, property) { + forEach(fakeRestorers, function (fakeRestorer) { + if ( + fakeRestorer.object === object && + fakeRestorer.property === property + ) { + throw new TypeError( + `Attempted to replace ${property} which is already replaced`, + ); + } + }); + } + + /** + * Replace an existing property + * + * @param {object|Function} object + * @param {string} property + * @param {*} replacement a fake, stub, spy or any other value + * @returns {*} + */ + sandbox.replace = function replace(object, property, replacement) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + throwOnAccessors(descriptor); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.replace.usingAccessor = function replaceUsingAccessor( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + checkForValidArguments(descriptor, property, replacement); + verifySameType(object, property, replacement); + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property, true)); + + object[property] = replacement; + + return replacement; + }; + + sandbox.define = function define(object, property, value) { + const descriptor = getPropertyDescriptor(object, property); + + if (descriptor) { + throw new TypeError( + `Cannot define the already existing property ${valueToString( + property, + )}. Perhaps you meant sandbox.replace()?`, + ); + } + + if (typeof value === "undefined") { + throw new TypeError("Expected value argument to be defined"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the defined property + push(fakeRestorers, getFakeRestorer(object, property)); + + object[property] = value; + + return value; + }; + + sandbox.replaceGetter = function replaceGetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.get !== "function") { + throw new Error("`object.property` is not a getter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + Object.defineProperty(object, property, { + get: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + sandbox.replaceSetter = function replaceSetter( + object, + property, + replacement, + ) { + const descriptor = getPropertyDescriptor(object, property); + + if (typeof descriptor === "undefined") { + throw new TypeError( + `Cannot replace non-existent property ${valueToString( + property, + )}`, + ); + } + + if (typeof replacement !== "function") { + throw new TypeError( + "Expected replacement argument to be a function", + ); + } + + if (typeof descriptor.set !== "function") { + throw new Error("`object.property` is not a setter"); + } + + verifyNotReplaced(object, property); + + // store a function for restoring the replaced property + push(fakeRestorers, getFakeRestorer(object, property)); + + // eslint-disable-next-line accessor-pairs + Object.defineProperty(object, property, { + set: replacement, + configurable: isPropertyConfigurable(object, property), + }); + + return replacement; + }; + + function commonPostInitSetup(args, spy) { + const [object, property, types] = args; + + const isSpyingOnEntireObject = + typeof property === "undefined" && typeof object === "object"; + + if (isSpyingOnEntireObject) { + const ownMethods = collectOwnMethods(spy); + + forEach(ownMethods, function (method) { + addToCollection(method); + }); + } else if (Array.isArray(types)) { + for (const accessorType of types) { + addToCollection(spy[accessorType]); + } + } else { + addToCollection(spy); + } + + return spy; + } + + sandbox.spy = function spy() { + const createdSpy = sinonSpy.apply(sinonSpy, arguments); + return commonPostInitSetup(arguments, createdSpy); + }; + + sandbox.stub = function stub() { + const createdStub = sinonStub.apply(sinonStub, arguments); + return commonPostInitSetup(arguments, createdStub); + }; + + // eslint-disable-next-line no-unused-vars + sandbox.fake = function fake(f) { + const s = sinonFake.apply(sinonFake, arguments); + + addToCollection(s); + + return s; + }; + + forEach(Object.keys(sinonFake), function (key) { + const fakeBehavior = sinonFake[key]; + if (typeof fakeBehavior === "function") { + sandbox.fake[key] = function () { + const s = fakeBehavior.apply(fakeBehavior, arguments); + + addToCollection(s); + + return s; + }; + } + }); + + sandbox.useFakeTimers = function useFakeTimers(args) { + const clock = sinonClock.useFakeTimers.call(null, args); + + sandbox.clock = clock; + addToCollection(clock); + + return clock; + }; + + sandbox.verify = function verify() { + applyOnEach(collection, "verify"); + }; + + sandbox.verifyAndRestore = function verifyAndRestore() { + let exception; + + try { + sandbox.verify(); + } catch (e) { + exception = e; + } + + sandbox.restore(); + + if (exception) { + throw exception; + } + }; +} + +Sandbox.prototype.match = match; + +module.exports = Sandbox; + +},{"./assert":3,"./collect-own-methods":5,"./create-stub-instance":8,"./fake":10,"./mock":12,"./spy":21,"./stub":22,"./util/core/get-property-descriptor":28,"./util/core/is-property-configurable":31,"./util/fake-timers":39,"@sinonjs/commons":46,"@sinonjs/samsam":86}],20:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const Colorizer = require("./colorizer"); +const colororizer = new Colorizer(); +const match = require("@sinonjs/samsam").createMatcher; +const timesInWords = require("./util/core/times-in-words"); +const inspect = require("util").inspect; +const jsDiff = require("diff"); + +const join = arrayProto.join; +const map = arrayProto.map; +const push = arrayProto.push; +const slice = arrayProto.slice; + +/** + * + * @param matcher + * @param calledArg + * @param calledArgMessage + * + * @returns {string} the colored text + */ +function colorSinonMatchText(matcher, calledArg, calledArgMessage) { + let calledArgumentMessage = calledArgMessage; + let matcherMessage = matcher.message; + if (!matcher.test(calledArg)) { + matcherMessage = colororizer.red(matcher.message); + if (calledArgumentMessage) { + calledArgumentMessage = colororizer.green(calledArgumentMessage); + } + } + return `${calledArgumentMessage} ${matcherMessage}`; +} + +/** + * @param diff + * + * @returns {string} the colored diff + */ +function colorDiffText(diff) { + const objects = map(diff, function (part) { + let text = part.value; + if (part.added) { + text = colororizer.green(text); + } else if (part.removed) { + text = colororizer.red(text); + } + if (diff.length === 2) { + text += " "; // format simple diffs + } + return text; + }); + return join(objects, ""); +} + +/** + * + * @param value + * @returns {string} a quoted string + */ +function quoteStringValue(value) { + if (typeof value === "string") { + return JSON.stringify(value); + } + return value; +} + +module.exports = { + c: function (spyInstance) { + return timesInWords(spyInstance.callCount); + }, + + n: function (spyInstance) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return spyInstance.toString(); + }, + + D: function (spyInstance, args) { + let message = ""; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // describe multiple calls + if (l > 1) { + message += `\nCall ${i + 1}:`; + } + const calledArgs = spyInstance.getCall(i).args; + const expectedArgs = slice(args); + + for ( + let j = 0; + j < calledArgs.length || j < expectedArgs.length; + ++j + ) { + let calledArg = calledArgs[j]; + let expectedArg = expectedArgs[j]; + if (calledArg) { + calledArg = quoteStringValue(calledArg); + } + + if (expectedArg) { + expectedArg = quoteStringValue(expectedArg); + } + + message += "\n"; + + const calledArgMessage = + j < calledArgs.length ? inspect(calledArg) : ""; + if (match.isMatcher(expectedArg)) { + message += colorSinonMatchText( + expectedArg, + calledArg, + calledArgMessage, + ); + } else { + const expectedArgMessage = + j < expectedArgs.length ? inspect(expectedArg) : ""; + const diff = jsDiff.diffJson( + calledArgMessage, + expectedArgMessage, + ); + message += colorDiffText(diff); + } + } + } + + return message; + }, + + C: function (spyInstance) { + const calls = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + let stringifiedCall = ` ${spyInstance.getCall(i).toString()}`; + if (/\n/.test(calls[i - 1])) { + stringifiedCall = `\n${stringifiedCall}`; + } + push(calls, stringifiedCall); + } + + return calls.length > 0 ? `\n${join(calls, "\n")}` : ""; + }, + + t: function (spyInstance) { + const objects = []; + + for (let i = 0, l = spyInstance.callCount; i < l; ++i) { + push(objects, inspect(spyInstance.thisValues[i])); + } + + return join(objects, ", "); + }, + + "*": function (spyInstance, args) { + return join( + map(args, function (arg) { + return inspect(arg); + }), + ", ", + ); + }, +}; + +},{"./colorizer":6,"./util/core/times-in-words":35,"@sinonjs/commons":46,"@sinonjs/samsam":86,"diff":91,"util":90}],21:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const createProxy = require("./proxy"); +const extend = require("./util/core/extend"); +const functionName = require("@sinonjs/commons").functionName; +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const deepEqual = require("@sinonjs/samsam").deepEqual; +const isEsModule = require("./util/core/is-es-module"); +const proxyCallUtil = require("./proxy-call-util"); +const walkObject = require("./util/core/walk-object"); +const wrapMethod = require("./util/core/wrap-method"); +const valueToString = require("@sinonjs/commons").valueToString; + +/* cache references to library methods so that they also can be stubbed without problems */ +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const push = arrayProto.push; +const slice = arrayProto.slice; +const filter = Array.prototype.filter; + +let uuid = 0; + +function matches(fake, args, strict) { + const margs = fake.matchingArguments; + if ( + margs.length <= args.length && + deepEqual(slice(args, 0, margs.length), margs) + ) { + return !strict || margs.length === args.length; + } + return false; +} + +// Public API +const spyApi = { + withArgs: function () { + const args = slice(arguments); + const matching = pop(this.matchingFakes(args, true)); + if (matching) { + return matching; + } + + const original = this; + const fake = this.instantiateFake(); + fake.matchingArguments = args; + fake.parent = this; + push(this.fakes, fake); + + fake.withArgs = function () { + return original.withArgs.apply(original, arguments); + }; + + forEach(original.args, function (arg, i) { + if (!matches(fake, arg)) { + return; + } + + proxyCallUtil.incrementCallCount(fake); + push(fake.thisValues, original.thisValues[i]); + push(fake.args, arg); + push(fake.returnValues, original.returnValues[i]); + push(fake.exceptions, original.exceptions[i]); + push(fake.callIds, original.callIds[i]); + }); + + proxyCallUtil.createCallProperties(fake); + + return fake; + }, + + // Override proxy default implementation + matchingFakes: function (args, strict) { + return filter.call(this.fakes, function (fake) { + return matches(fake, args, strict); + }); + }, +}; + +/* eslint-disable @sinonjs/no-prototype-methods/no-prototype-methods */ +const delegateToCalls = proxyCallUtil.delegateToCalls; +delegateToCalls(spyApi, "callArg", false, "callArgWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgWith = spyApi.callArg; +delegateToCalls(spyApi, "callArgOn", false, "callArgOnWith", true, function () { + throw new Error( + `${this.toString()} cannot call arg since it was not yet invoked.`, + ); +}); +spyApi.callArgOnWith = spyApi.callArgOn; +delegateToCalls(spyApi, "throwArg", false, "throwArg", false, function () { + throw new Error( + `${this.toString()} cannot throw arg since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yield", false, "yield", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +// "invokeCallback" is an alias for "yield" since "yield" is invalid in strict mode. +spyApi.invokeCallback = spyApi.yield; +delegateToCalls(spyApi, "yieldOn", false, "yieldOn", true, function () { + throw new Error( + `${this.toString()} cannot yield since it was not yet invoked.`, + ); +}); +delegateToCalls(spyApi, "yieldTo", false, "yieldTo", true, function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); +}); +delegateToCalls( + spyApi, + "yieldToOn", + false, + "yieldToOn", + true, + function (property) { + throw new Error( + `${this.toString()} cannot yield to '${valueToString( + property, + )}' since it was not yet invoked.`, + ); + }, +); + +function createSpy(func) { + let name; + let funk = func; + + if (typeof funk !== "function") { + funk = function () { + return; + }; + } else { + name = functionName(funk); + } + + const proxy = createProxy(funk, funk); + + // Inherit spy API: + extend.nonEnum(proxy, spyApi); + extend.nonEnum(proxy, { + displayName: name || "spy", + fakes: [], + instantiateFake: createSpy, + id: `spy#${uuid++}`, + }); + return proxy; +} + +function spy(object, property, types) { + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be spied"); + } + + if (!property && typeof object === "function") { + return createSpy(object); + } + + if (!property && typeof object === "object") { + return walkObject(spy, object); + } + + if (!object && !property) { + return createSpy(function () { + return; + }); + } + + if (!types) { + return wrapMethod(object, property, createSpy(object[property])); + } + + const descriptor = {}; + const methodDesc = getPropertyDescriptor(object, property); + + forEach(types, function (type) { + descriptor[type] = createSpy(methodDesc[type]); + }); + + return wrapMethod(object, property, descriptor); +} + +extend(spy, spyApi); +module.exports = spy; + +},{"./proxy":17,"./proxy-call-util":14,"./util/core/extend":25,"./util/core/get-property-descriptor":28,"./util/core/is-es-module":29,"./util/core/walk-object":36,"./util/core/wrap-method":38,"@sinonjs/commons":46,"@sinonjs/samsam":86}],22:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const behavior = require("./behavior"); +const behaviors = require("./default-behaviors"); +const createProxy = require("./proxy"); +const functionName = require("@sinonjs/commons").functionName; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const isNonExistentProperty = require("./util/core/is-non-existent-property"); +const spy = require("./spy"); +const extend = require("./util/core/extend"); +const getPropertyDescriptor = require("./util/core/get-property-descriptor"); +const isEsModule = require("./util/core/is-es-module"); +const sinonType = require("./util/core/sinon-type"); +const wrapMethod = require("./util/core/wrap-method"); +const throwOnFalsyObject = require("./throw-on-falsy-object"); +const valueToString = require("@sinonjs/commons").valueToString; +const walkObject = require("./util/core/walk-object"); + +const forEach = arrayProto.forEach; +const pop = arrayProto.pop; +const slice = arrayProto.slice; +const sort = arrayProto.sort; + +let uuid = 0; + +function createStub(originalFunc) { + // eslint-disable-next-line prefer-const + let proxy; + + function functionStub() { + const args = slice(arguments); + const matchings = proxy.matchingFakes(args); + + const fnStub = + pop( + sort(matchings, function (a, b) { + return ( + a.matchingArguments.length - b.matchingArguments.length + ); + }), + ) || proxy; + return getCurrentBehavior(fnStub).invoke(this, arguments); + } + + proxy = createProxy(functionStub, originalFunc || functionStub); + // Inherit spy API: + extend.nonEnum(proxy, spy); + // Inherit stub API: + extend.nonEnum(proxy, stub); + + const name = originalFunc ? functionName(originalFunc) : null; + extend.nonEnum(proxy, { + fakes: [], + instantiateFake: createStub, + displayName: name || "stub", + defaultBehavior: null, + behaviors: [], + id: `stub#${uuid++}`, + }); + + sinonType.set(proxy, "stub"); + + return proxy; +} + +function stub(object, property) { + if (arguments.length > 2) { + throw new TypeError( + "stub(obj, 'meth', fn) has been removed, see documentation", + ); + } + + if (isEsModule(object)) { + throw new TypeError("ES Modules cannot be stubbed"); + } + + throwOnFalsyObject.apply(null, arguments); + + if (isNonExistentProperty(object, property)) { + throw new TypeError( + `Cannot stub non-existent property ${valueToString(property)}`, + ); + } + + const actualDescriptor = getPropertyDescriptor(object, property); + + assertValidPropertyDescriptor(actualDescriptor, property); + + const isObjectOrFunction = + typeof object === "object" || typeof object === "function"; + const isStubbingEntireObject = + typeof property === "undefined" && isObjectOrFunction; + const isCreatingNewStub = !object && typeof property === "undefined"; + const isStubbingNonFuncProperty = + isObjectOrFunction && + typeof property !== "undefined" && + (typeof actualDescriptor === "undefined" || + typeof actualDescriptor.value !== "function"); + + if (isStubbingEntireObject) { + return walkObject(stub, object); + } + + if (isCreatingNewStub) { + return createStub(); + } + + const func = + typeof actualDescriptor.value === "function" + ? actualDescriptor.value + : null; + const s = createStub(func); + + extend.nonEnum(s, { + rootObj: object, + propName: property, + shadowsPropOnPrototype: !actualDescriptor.isOwn, + restore: function restore() { + if (actualDescriptor !== undefined && actualDescriptor.isOwn) { + Object.defineProperty(object, property, actualDescriptor); + return; + } + + delete object[property]; + }, + }); + + return isStubbingNonFuncProperty ? s : wrapMethod(object, property, s); +} + +function assertValidPropertyDescriptor(descriptor, property) { + if (!descriptor || !property) { + return; + } + if (descriptor.isOwn && !descriptor.configurable && !descriptor.writable) { + throw new TypeError( + `Descriptor for property ${property} is non-configurable and non-writable`, + ); + } + if ((descriptor.get || descriptor.set) && !descriptor.configurable) { + throw new TypeError( + `Descriptor for accessor property ${property} is non-configurable`, + ); + } + if (isDataDescriptor(descriptor) && !descriptor.writable) { + throw new TypeError( + `Descriptor for data property ${property} is non-writable`, + ); + } +} + +function isDataDescriptor(descriptor) { + return ( + !descriptor.value && + !descriptor.writable && + !descriptor.set && + !descriptor.get + ); +} + +/*eslint-disable no-use-before-define*/ +function getParentBehaviour(stubInstance) { + return stubInstance.parent && getCurrentBehavior(stubInstance.parent); +} + +function getDefaultBehavior(stubInstance) { + return ( + stubInstance.defaultBehavior || + getParentBehaviour(stubInstance) || + behavior.create(stubInstance) + ); +} + +function getCurrentBehavior(stubInstance) { + const currentBehavior = stubInstance.behaviors[stubInstance.callCount - 1]; + return currentBehavior && currentBehavior.isPresent() + ? currentBehavior + : getDefaultBehavior(stubInstance); +} +/*eslint-enable no-use-before-define*/ + +const proto = { + resetBehavior: function () { + this.defaultBehavior = null; + this.behaviors = []; + + delete this.returnValue; + delete this.returnArgAt; + delete this.throwArgAt; + delete this.resolveArgAt; + delete this.fakeFn; + this.returnThis = false; + this.resolveThis = false; + + forEach(this.fakes, function (fake) { + fake.resetBehavior(); + }); + }, + + reset: function () { + this.resetHistory(); + this.resetBehavior(); + }, + + onCall: function onCall(index) { + if (!this.behaviors[index]) { + this.behaviors[index] = behavior.create(this); + } + + return this.behaviors[index]; + }, + + onFirstCall: function onFirstCall() { + return this.onCall(0); + }, + + onSecondCall: function onSecondCall() { + return this.onCall(1); + }, + + onThirdCall: function onThirdCall() { + return this.onCall(2); + }, + + withArgs: function withArgs() { + const fake = spy.withArgs.apply(this, arguments); + if (this.defaultBehavior && this.defaultBehavior.promiseLibrary) { + fake.defaultBehavior = + fake.defaultBehavior || behavior.create(fake); + fake.defaultBehavior.promiseLibrary = + this.defaultBehavior.promiseLibrary; + } + return fake; + }, +}; + +forEach(Object.keys(behavior), function (method) { + if ( + hasOwnProperty(behavior, method) && + !hasOwnProperty(proto, method) && + method !== "create" && + method !== "invoke" + ) { + proto[method] = behavior.createBehavior(method); + } +}); + +forEach(Object.keys(behaviors), function (method) { + if (hasOwnProperty(behaviors, method) && !hasOwnProperty(proto, method)) { + behavior.addBehavior(stub, method, behaviors[method]); + } +}); + +extend(stub, proto); +module.exports = stub; + +},{"./behavior":4,"./default-behaviors":9,"./proxy":17,"./spy":21,"./throw-on-falsy-object":23,"./util/core/extend":25,"./util/core/get-property-descriptor":28,"./util/core/is-es-module":29,"./util/core/is-non-existent-property":30,"./util/core/sinon-type":34,"./util/core/walk-object":36,"./util/core/wrap-method":38,"@sinonjs/commons":46}],23:[function(require,module,exports){ +"use strict"; +const valueToString = require("@sinonjs/commons").valueToString; + +function throwOnFalsyObject(object, property) { + if (property && !object) { + const type = object === null ? "null" : "undefined"; + throw new Error( + `Trying to stub property '${valueToString(property)}' of ${type}`, + ); + } +} + +module.exports = throwOnFalsyObject; + +},{"@sinonjs/commons":46}],24:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const reduce = arrayProto.reduce; + +module.exports = function exportAsyncBehaviors(behaviorMethods) { + return reduce( + Object.keys(behaviorMethods), + function (acc, method) { + // need to avoid creating another async versions of the newly added async methods + if (method.match(/^(callsArg|yields)/) && !method.match(/Async/)) { + acc[`${method}Async`] = function () { + const result = behaviorMethods[method].apply( + this, + arguments, + ); + this.callbackAsync = true; + return result; + }; + } + return acc; + }, + {}, + ); +}; + +},{"@sinonjs/commons":46}],25:[function(require,module,exports){ +"use strict"; + +const arrayProto = require("@sinonjs/commons").prototypes.array; +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; + +const join = arrayProto.join; +const push = arrayProto.push; + +// Adapted from https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug +const hasDontEnumBug = (function () { + const obj = { + constructor: function () { + return "0"; + }, + toString: function () { + return "1"; + }, + valueOf: function () { + return "2"; + }, + toLocaleString: function () { + return "3"; + }, + prototype: function () { + return "4"; + }, + isPrototypeOf: function () { + return "5"; + }, + propertyIsEnumerable: function () { + return "6"; + }, + hasOwnProperty: function () { + return "7"; + }, + length: function () { + return "8"; + }, + unique: function () { + return "9"; + }, + }; + + const result = []; + for (const prop in obj) { + if (hasOwnProperty(obj, prop)) { + push(result, obj[prop]()); + } + } + return join(result, "") !== "0123456789"; +})(); + +/** + * + * @param target + * @param sources + * @param doCopy + * @returns {*} target + */ +function extendCommon(target, sources, doCopy) { + let source, i, prop; + + for (i = 0; i < sources.length; i++) { + source = sources[i]; + + for (prop in source) { + if (hasOwnProperty(source, prop)) { + doCopy(target, source, prop); + } + } + + // Make sure we copy (own) toString method even when in JScript with DontEnum bug + // See https://developer.mozilla.org/en/docs/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug + if ( + hasDontEnumBug && + hasOwnProperty(source, "toString") && + source.toString !== target.toString + ) { + target.toString = source.toString; + } + } + + return target; +} + +/** + * Public: Extend target in place with all (own) properties, except 'name' when [[writable]] is false, + * from sources in-order. Thus, last source will override properties in previous sources. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports = function extend(target, ...sources) { + return extendCommon( + target, + sources, + function copyValue(dest, source, prop) { + const destOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + dest, + prop, + ); + const sourceOwnPropertyDescriptor = Object.getOwnPropertyDescriptor( + source, + prop, + ); + + if (prop === "name" && !destOwnPropertyDescriptor.writable) { + return; + } + const descriptors = { + configurable: sourceOwnPropertyDescriptor.configurable, + enumerable: sourceOwnPropertyDescriptor.enumerable, + }; + /* + if the source has an Accessor property copy over the accessor functions (get and set) + data properties has writable attribute where as accessor property don't + REF: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#properties + */ + + if (hasOwnProperty(sourceOwnPropertyDescriptor, "writable")) { + descriptors.writable = sourceOwnPropertyDescriptor.writable; + descriptors.value = sourceOwnPropertyDescriptor.value; + } else { + if (sourceOwnPropertyDescriptor.get) { + descriptors.get = + sourceOwnPropertyDescriptor.get.bind(dest); + } + if (sourceOwnPropertyDescriptor.set) { + descriptors.set = + sourceOwnPropertyDescriptor.set.bind(dest); + } + } + Object.defineProperty(dest, prop, descriptors); + }, + ); +}; + +/** + * Public: Extend target in place with all (own) properties from sources in-order. Thus, last source will + * override properties in previous sources. Define the properties as non enumerable. + * + * @param {object} target - The Object to extend + * @param {object[]} sources - Objects to copy properties from. + * @returns {object} the extended target + */ +module.exports.nonEnum = function extendNonEnum(target, ...sources) { + return extendCommon( + target, + sources, + function copyProperty(dest, source, prop) { + Object.defineProperty(dest, prop, { + value: source[prop], + enumerable: false, + configurable: true, + writable: true, + }); + }, + ); +}; + +},{"@sinonjs/commons":46}],26:[function(require,module,exports){ +"use strict"; + +module.exports = function toString() { + let i, prop, thisValue; + if (this.getCall && this.callCount) { + i = this.callCount; + + while (i--) { + thisValue = this.getCall(i).thisValue; + + // eslint-disable-next-line guard-for-in + for (prop in thisValue) { + try { + if (thisValue[prop] === this) { + return prop; + } + } catch (e) { + // no-op - accessing props can throw an error, nothing to do here + } + } + } + } + + return this.displayName || "sinon fake"; +}; + +},{}],27:[function(require,module,exports){ +"use strict"; + +/* istanbul ignore next : not testing that setTimeout works */ +function nextTick(callback) { + setTimeout(callback, 0); +} + +module.exports = function getNextTick(process, setImmediate) { + if (typeof process === "object" && typeof process.nextTick === "function") { + return process.nextTick; + } + + if (typeof setImmediate === "function") { + return setImmediate; + } + + return nextTick; +}; + +},{}],28:[function(require,module,exports){ +"use strict"; + +/** + * @typedef {object} PropertyDescriptor + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description + * @property {boolean} configurable defaults to false + * @property {boolean} enumerable defaults to false + * @property {boolean} writable defaults to false + * @property {*} value defaults to undefined + * @property {Function} get defaults to undefined + * @property {Function} set defaults to undefined + */ + +/* + * The following type def is strictly speaking illegal in JSDoc, but the expression forms a + * legal Typescript union type and is understood by Visual Studio and the IntelliJ + * family of editors. The "TS" flavor of JSDoc is becoming the de-facto standard these + * days for that reason (and the fact that JSDoc is essentially unmaintained) + */ + +/** + * @typedef {{isOwn: boolean} & PropertyDescriptor} SinonPropertyDescriptor + * a slightly enriched property descriptor + * @property {boolean} isOwn true if the descriptor is owned by this object, false if it comes from the prototype + */ + +/** + * Returns a slightly modified property descriptor that one can tell is from the object or the prototype + * + * @param {*} object + * @param {string} property + * @returns {SinonPropertyDescriptor} + */ +function getPropertyDescriptor(object, property) { + let proto = object; + let descriptor; + const isOwn = Boolean( + object && Object.getOwnPropertyDescriptor(object, property), + ); + + while ( + proto && + !(descriptor = Object.getOwnPropertyDescriptor(proto, property)) + ) { + proto = Object.getPrototypeOf(proto); + } + + if (descriptor) { + descriptor.isOwn = isOwn; + } + + return descriptor; +} + +module.exports = getPropertyDescriptor; + +},{}],29:[function(require,module,exports){ +"use strict"; + +/** + * Verify if an object is a ECMAScript Module + * + * As the exports from a module is immutable we cannot alter the exports + * using spies or stubs. Let the consumer know this to avoid bug reports + * on weird error messages. + * + * @param {object} object The object to examine + * @returns {boolean} true when the object is a module + */ +module.exports = function (object) { + return ( + object && + typeof Symbol !== "undefined" && + object[Symbol.toStringTag] === "Module" && + Object.isSealed(object) + ); +}; + +},{}],30:[function(require,module,exports){ +"use strict"; + +/** + * @param {*} object + * @param {string} property + * @returns {boolean} whether a prop exists in the prototype chain + */ +function isNonExistentProperty(object, property) { + return Boolean( + object && typeof property !== "undefined" && !(property in object), + ); +} + +module.exports = isNonExistentProperty; + +},{}],31:[function(require,module,exports){ +"use strict"; + +const getPropertyDescriptor = require("./get-property-descriptor"); + +function isPropertyConfigurable(obj, propName) { + const propertyDescriptor = getPropertyDescriptor(obj, propName); + + return propertyDescriptor ? propertyDescriptor.configurable : true; +} + +module.exports = isPropertyConfigurable; + +},{"./get-property-descriptor":28}],32:[function(require,module,exports){ +"use strict"; + +function isRestorable(obj) { + return ( + typeof obj === "function" && + typeof obj.restore === "function" && + obj.restore.sinon + ); +} + +module.exports = isRestorable; + +},{}],33:[function(require,module,exports){ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +const getNextTick = require("./get-next-tick"); + +module.exports = getNextTick(globalObject.process, globalObject.setImmediate); + +},{"./get-next-tick":27,"@sinonjs/commons":46}],34:[function(require,module,exports){ +"use strict"; + +const sinonTypeSymbolProperty = Symbol("SinonType"); + +module.exports = { + /** + * Set the type of a Sinon object to make it possible to identify it later at runtime + * + * @param {object|Function} object object/function to set the type on + * @param {string} type the named type of the object/function + */ + set(object, type) { + Object.defineProperty(object, sinonTypeSymbolProperty, { + value: type, + configurable: false, + enumerable: false, + }); + }, + get(object) { + return object && object[sinonTypeSymbolProperty]; + }, +}; + +},{}],35:[function(require,module,exports){ +"use strict"; + +const array = [null, "once", "twice", "thrice"]; + +module.exports = function timesInWords(count) { + return array[count] || `${count || 0} times`; +}; + +},{}],36:[function(require,module,exports){ +"use strict"; + +const functionName = require("@sinonjs/commons").functionName; + +const getPropertyDescriptor = require("./get-property-descriptor"); +const walk = require("./walk"); + +/** + * A utility that allows traversing an object, applying mutating functions on the properties + * + * @param {Function} mutator called on each property + * @param {object} object the object we are walking over + * @param {Function} filter a predicate (boolean function) that will decide whether or not to apply the mutator to the current property + * @returns {void} nothing + */ +function walkObject(mutator, object, filter) { + let called = false; + const name = functionName(mutator); + + if (!object) { + throw new Error( + `Trying to ${name} object but received ${String(object)}`, + ); + } + + walk(object, function (prop, propOwner) { + // we don't want to stub things like toString(), valueOf(), etc. so we only stub if the object + // is not Object.prototype + if ( + propOwner !== Object.prototype && + prop !== "constructor" && + typeof getPropertyDescriptor(propOwner, prop).value === "function" + ) { + if (filter) { + if (filter(object, prop)) { + called = true; + mutator(object, prop); + } + } else { + called = true; + mutator(object, prop); + } + } + }); + + if (!called) { + throw new Error( + `Found no methods on object to which we could apply mutations`, + ); + } + + return object; +} + +module.exports = walkObject; + +},{"./get-property-descriptor":28,"./walk":37,"@sinonjs/commons":46}],37:[function(require,module,exports){ +"use strict"; + +const forEach = require("@sinonjs/commons").prototypes.array.forEach; + +function walkInternal(obj, iterator, context, originalObj, seen) { + let prop; + const proto = Object.getPrototypeOf(obj); + + if (typeof Object.getOwnPropertyNames !== "function") { + // We explicitly want to enumerate through all of the prototype's properties + // in this case, therefore we deliberately leave out an own property check. + /* eslint-disable-next-line guard-for-in */ + for (prop in obj) { + iterator.call(context, obj[prop], prop, obj); + } + + return; + } + + forEach(Object.getOwnPropertyNames(obj), function (k) { + if (seen[k] !== true) { + seen[k] = true; + const target = + typeof Object.getOwnPropertyDescriptor(obj, k).get === + "function" + ? originalObj + : obj; + iterator.call(context, k, target); + } + }); + + if (proto) { + walkInternal(proto, iterator, context, originalObj, seen); + } +} + +/* Walks the prototype chain of an object and iterates over every own property + * name encountered. The iterator is called in the same fashion that Array.prototype.forEach + * works, where it is passed the value, key, and own object as the 1st, 2nd, and 3rd positional + * argument, respectively. In cases where Object.getOwnPropertyNames is not available, walk will + * default to using a simple for..in loop. + * + * obj - The object to walk the prototype chain for. + * iterator - The function to be called on each pass of the walk. + * context - (Optional) When given, the iterator will be called with this object as the receiver. + */ +module.exports = function walk(obj, iterator, context) { + return walkInternal(obj, iterator, context, obj, {}); +}; + +},{"@sinonjs/commons":46}],38:[function(require,module,exports){ +"use strict"; + +// eslint-disable-next-line no-empty-function +const noop = () => {}; +const getPropertyDescriptor = require("./get-property-descriptor"); +const extend = require("./extend"); +const sinonType = require("./sinon-type"); +const hasOwnProperty = + require("@sinonjs/commons").prototypes.object.hasOwnProperty; +const valueToString = require("@sinonjs/commons").valueToString; +const push = require("@sinonjs/commons").prototypes.array.push; + +function isFunction(obj) { + return ( + typeof obj === "function" || + Boolean(obj && obj.constructor && obj.call && obj.apply) + ); +} + +function mirrorProperties(target, source) { + for (const prop in source) { + if (!hasOwnProperty(target, prop)) { + target[prop] = source[prop]; + } + } +} + +function getAccessor(object, property, method) { + const accessors = ["get", "set"]; + const descriptor = getPropertyDescriptor(object, property); + + for (let i = 0; i < accessors.length; i++) { + if ( + descriptor[accessors[i]] && + descriptor[accessors[i]].name === method.name + ) { + return accessors[i]; + } + } + return null; +} + +// Cheap way to detect if we have ES5 support. +const hasES5Support = "keys" in Object; + +module.exports = function wrapMethod(object, property, method) { + if (!object) { + throw new TypeError("Should wrap property of object"); + } + + if (typeof method !== "function" && typeof method !== "object") { + throw new TypeError( + "Method wrapper should be a function or a property descriptor", + ); + } + + function checkWrappedMethod(wrappedMethod) { + let error; + + if (!isFunction(wrappedMethod)) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${valueToString( + property, + )} as function`, + ); + } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) { + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already wrapped`, + ); + } else if (wrappedMethod.calledBefore) { + const verb = wrappedMethod.returns ? "stubbed" : "spied on"; + error = new TypeError( + `Attempted to wrap ${valueToString( + property, + )} which is already ${verb}`, + ); + } + + if (error) { + if (wrappedMethod && wrappedMethod.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethod.stackTraceError.stack}`; + } + throw error; + } + } + + let error, wrappedMethod, i, wrappedMethodDesc, target, accessor; + + const wrappedMethods = []; + + function simplePropertyAssignment() { + wrappedMethod = object[property]; + checkWrappedMethod(wrappedMethod); + object[property] = method; + method.displayName = property; + } + + // Firefox has a problem when using hasOwn.call on objects from other frames. + const owned = object.hasOwnProperty + ? object.hasOwnProperty(property) // eslint-disable-line @sinonjs/no-prototype-methods/no-prototype-methods + : hasOwnProperty(object, property); + + if (hasES5Support) { + const methodDesc = + typeof method === "function" ? { value: method } : method; + wrappedMethodDesc = getPropertyDescriptor(object, property); + + if (!wrappedMethodDesc) { + error = new TypeError( + `Attempted to wrap ${typeof wrappedMethod} property ${property} as function`, + ); + } else if ( + wrappedMethodDesc.restore && + wrappedMethodDesc.restore.sinon + ) { + error = new TypeError( + `Attempted to wrap ${property} which is already wrapped`, + ); + } + if (error) { + if (wrappedMethodDesc && wrappedMethodDesc.stackTraceError) { + error.stack += `\n--------------\n${wrappedMethodDesc.stackTraceError.stack}`; + } + throw error; + } + + const types = Object.keys(methodDesc); + for (i = 0; i < types.length; i++) { + wrappedMethod = wrappedMethodDesc[types[i]]; + checkWrappedMethod(wrappedMethod); + push(wrappedMethods, wrappedMethod); + } + + mirrorProperties(methodDesc, wrappedMethodDesc); + for (i = 0; i < types.length; i++) { + mirrorProperties(methodDesc[types[i]], wrappedMethodDesc[types[i]]); + } + + // you are not allowed to flip the configurable prop on an + // existing descriptor to anything but false (#2514) + if (!owned) { + methodDesc.configurable = true; + } + + Object.defineProperty(object, property, methodDesc); + + // catch failing assignment + // this is the converse of the check in `.restore` below + if (typeof method === "function" && object[property] !== method) { + // correct any wrongdoings caused by the defineProperty call above, + // such as adding new items (if object was a Storage object) + delete object[property]; + simplePropertyAssignment(); + } + } else { + simplePropertyAssignment(); + } + + extendObjectWithWrappedMethods(); + + function extendObjectWithWrappedMethods() { + for (i = 0; i < wrappedMethods.length; i++) { + accessor = getAccessor(object, property, wrappedMethods[i]); + target = accessor ? method[accessor] : method; + extend.nonEnum(target, { + displayName: property, + wrappedMethod: wrappedMethods[i], + + // Set up an Error object for a stack trace which can be used later to find what line of + // code the original method was created on. + stackTraceError: new Error("Stack Trace for original"), + + restore: restore, + }); + + target.restore.sinon = true; + if (!hasES5Support) { + mirrorProperties(target, wrappedMethod); + } + } + } + + function restore() { + accessor = getAccessor(object, property, this.wrappedMethod); + let descriptor; + // For prototype properties try to reset by delete first. + // If this fails (ex: localStorage on mobile safari) then force a reset + // via direct assignment. + if (accessor) { + if (!owned) { + try { + // In some cases `delete` may throw an error + delete object[property][accessor]; + } catch (e) {} // eslint-disable-line no-empty + // For native code functions `delete` fails without throwing an error + // on Chrome < 43, PhantomJS, etc. + } else if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + descriptor[accessor] = wrappedMethodDesc[accessor]; + Object.defineProperty(object, property, descriptor); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property][accessor] = this.wrappedMethod; + } + } else { + // Use strict equality comparison to check failures then force a reset + // via direct assignment. + if (object[property][accessor] === target) { + object[property][accessor] = this.wrappedMethod; + } + } + } else { + if (!owned) { + try { + delete object[property]; + } catch (e) {} // eslint-disable-line no-empty + } else if (hasES5Support) { + Object.defineProperty(object, property, wrappedMethodDesc); + } + + if (hasES5Support) { + descriptor = getPropertyDescriptor(object, property); + if (descriptor && descriptor.value === target) { + object[property] = this.wrappedMethod; + } + } else { + if (object[property] === target) { + object[property] = this.wrappedMethod; + } + } + } + if (sinonType.get(object) === "stub-instance") { + // this is simply to avoid errors after restoring if something should + // traverse the object in a cleanup phase, ref #2477 + object[property] = noop; + } + } + + return method; +}; + +},{"./extend":25,"./get-property-descriptor":28,"./sinon-type":34,"@sinonjs/commons":46}],39:[function(require,module,exports){ +"use strict"; + +const extend = require("./core/extend"); +const FakeTimers = require("@sinonjs/fake-timers"); +const globalObject = require("@sinonjs/commons").global; + +/** + * + * @param config + * @param globalCtx + * + * @returns {object} the clock, after installing it on the global context, if given + */ +function createClock(config, globalCtx) { + let FakeTimersCtx = FakeTimers; + if (globalCtx !== null && typeof globalCtx === "object") { + FakeTimersCtx = FakeTimers.withGlobal(globalCtx); + } + const clock = FakeTimersCtx.install(config); + clock.restore = clock.uninstall; + return clock; +} + +/** + * + * @param obj + * @param globalPropName + */ +function addIfDefined(obj, globalPropName) { + const globalProp = globalObject[globalPropName]; + if (typeof globalProp !== "undefined") { + obj[globalPropName] = globalProp; + } +} + +/** + * @param {number|Date|object} dateOrConfig The unix epoch value to install with (default 0) + * @returns {object} Returns a lolex clock instance + */ +exports.useFakeTimers = function (dateOrConfig) { + const hasArguments = typeof dateOrConfig !== "undefined"; + const argumentIsDateLike = + (typeof dateOrConfig === "number" || dateOrConfig instanceof Date) && + arguments.length === 1; + const argumentIsObject = + dateOrConfig !== null && + typeof dateOrConfig === "object" && + arguments.length === 1; + + if (!hasArguments) { + return createClock({ + now: 0, + }); + } + + if (argumentIsDateLike) { + return createClock({ + now: dateOrConfig, + }); + } + + if (argumentIsObject) { + const config = extend.nonEnum({}, dateOrConfig); + const globalCtx = config.global; + delete config.global; + return createClock(config, globalCtx); + } + + throw new TypeError( + "useFakeTimers expected epoch or config object. See https://github.com/sinonjs/sinon", + ); +}; + +exports.clock = { + create: function (now) { + return FakeTimers.createClock(now); + }, +}; + +const timers = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval, + Date: Date, +}; +addIfDefined(timers, "setImmediate"); +addIfDefined(timers, "clearImmediate"); + +exports.timers = timers; + +},{"./core/extend":25,"@sinonjs/commons":46,"@sinonjs/fake-timers":59}],40:[function(require,module,exports){ +"use strict"; + +var every = require("./prototypes/array").every; + +/** + * @private + */ +function hasCallsLeft(callMap, spy) { + if (callMap[spy.id] === undefined) { + callMap[spy.id] = 0; + } + + return callMap[spy.id] < spy.callCount; +} + +/** + * @private + */ +function checkAdjacentCalls(callMap, spy, index, spies) { + var calledBeforeNext = true; + + if (index !== spies.length - 1) { + calledBeforeNext = spy.calledBefore(spies[index + 1]); + } + + if (hasCallsLeft(callMap, spy) && calledBeforeNext) { + callMap[spy.id] += 1; + return true; + } + + return false; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} calledBefore - A method that determines if this proxy was called before another one + * @property {string} id - Some id + * @property {number} callCount - Number of times this proxy has been called + */ + +/** + * Returns true when the spies have been called in the order they were supplied in + * @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments + * @returns {boolean} true when spies are called in order, false otherwise + */ +function calledInOrder(spies) { + var callMap = {}; + // eslint-disable-next-line no-underscore-dangle + var _spies = arguments.length > 1 ? arguments : spies; + + return every(_spies, checkAdjacentCalls.bind(null, callMap)); +} + +module.exports = calledInOrder; + +},{"./prototypes/array":48}],41:[function(require,module,exports){ +"use strict"; + +/** + * Returns a display name for a value from a constructor + * @param {object} value A value to examine + * @returns {(string|null)} A string or null + */ +function className(value) { + const name = value.constructor && value.constructor.name; + return name || null; +} + +module.exports = className; + +},{}],42:[function(require,module,exports){ +/* eslint-disable no-console */ +"use strict"; + +/** + * Returns a function that will invoke the supplied function and print a + * deprecation warning to the console each time it is called. + * @param {Function} func + * @param {string} msg + * @returns {Function} + */ +exports.wrap = function (func, msg) { + var wrapped = function () { + exports.printWarning(msg); + return func.apply(this, arguments); + }; + if (func.prototype) { + wrapped.prototype = func.prototype; + } + return wrapped; +}; + +/** + * Returns a string which can be supplied to `wrap()` to notify the user that a + * particular part of the sinon API has been deprecated. + * @param {string} packageName + * @param {string} funcName + * @returns {string} + */ +exports.defaultMsg = function (packageName, funcName) { + return `${packageName}.${funcName} is deprecated and will be removed from the public API in a future version of ${packageName}.`; +}; + +/** + * Prints a warning on the console, when it exists + * @param {string} msg + * @returns {undefined} + */ +exports.printWarning = function (msg) { + /* istanbul ignore next */ + if (typeof process === "object" && process.emitWarning) { + // Emit Warnings in Node + process.emitWarning(msg); + } else if (console.info) { + console.info(msg); + } else { + console.log(msg); + } +}; + +},{}],43:[function(require,module,exports){ +"use strict"; + +/** + * Returns true when fn returns true for all members of obj. + * This is an every implementation that works for all iterables + * @param {object} obj + * @param {Function} fn + * @returns {boolean} + */ +module.exports = function every(obj, fn) { + var pass = true; + + try { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + obj.forEach(function () { + if (!fn.apply(this, arguments)) { + // Throwing an error is the only way to break `forEach` + throw new Error(); + } + }); + } catch (e) { + pass = false; + } + + return pass; +}; + +},{}],44:[function(require,module,exports){ +"use strict"; + +/** + * Returns a display name for a function + * @param {Function} func + * @returns {string} + */ +module.exports = function functionName(func) { + if (!func) { + return ""; + } + + try { + return ( + func.displayName || + func.name || + // Use function decomposition as a last resort to get function + // name. Does not rely on function decomposition to work - if it + // doesn't debugging will be slightly less informative + // (i.e. toString will say 'spy' rather than 'myFunc'). + (String(func).match(/function ([^\s(]+)/) || [])[1] + ); + } catch (e) { + // Stringify may fail and we might get an exception, as a last-last + // resort fall back to empty string. + return ""; + } +}; + +},{}],45:[function(require,module,exports){ +"use strict"; + +/** + * A reference to the global object + * @type {object} globalObject + */ +var globalObject; + +/* istanbul ignore else */ +if (typeof global !== "undefined") { + // Node + globalObject = global; +} else if (typeof window !== "undefined") { + // Browser + globalObject = window; +} else { + // WebWorker + globalObject = self; +} + +module.exports = globalObject; + +},{}],46:[function(require,module,exports){ +"use strict"; + +module.exports = { + global: require("./global"), + calledInOrder: require("./called-in-order"), + className: require("./class-name"), + deprecated: require("./deprecated"), + every: require("./every"), + functionName: require("./function-name"), + orderByFirstCall: require("./order-by-first-call"), + prototypes: require("./prototypes"), + typeOf: require("./type-of"), + valueToString: require("./value-to-string"), +}; + +},{"./called-in-order":40,"./class-name":41,"./deprecated":42,"./every":43,"./function-name":44,"./global":45,"./order-by-first-call":47,"./prototypes":51,"./type-of":57,"./value-to-string":58}],47:[function(require,module,exports){ +"use strict"; + +var sort = require("./prototypes/array").sort; +var slice = require("./prototypes/array").slice; + +/** + * @private + */ +function comparator(a, b) { + // uuid, won't ever be equal + var aCall = a.getCall(0); + var bCall = b.getCall(0); + var aId = (aCall && aCall.callId) || -1; + var bId = (bCall && bCall.callId) || -1; + + return aId < bId ? -1 : 1; +} + +/** + * A Sinon proxy object (fake, spy, stub) + * @typedef {object} SinonProxy + * @property {Function} getCall - A method that can return the first call + */ + +/** + * Sorts an array of SinonProxy instances (fake, spy, stub) by their first call + * @param {SinonProxy[] | SinonProxy} spies + * @returns {SinonProxy[]} + */ +function orderByFirstCall(spies) { + return sort(slice(spies), comparator); +} + +module.exports = orderByFirstCall; + +},{"./prototypes/array":48}],48:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Array.prototype); + +},{"./copy-prototype-methods":49}],49:[function(require,module,exports){ +"use strict"; + +var call = Function.call; +var throwsOnProto = require("./throws-on-proto"); + +var disallowedProperties = [ + // ignore size because it throws from Map + "size", + "caller", + "callee", + "arguments", +]; + +// This branch is covered when tests are run with `--disable-proto=throw`, +// however we can test both branches at the same time, so this is ignored +/* istanbul ignore next */ +if (throwsOnProto) { + disallowedProperties.push("__proto__"); +} + +module.exports = function copyPrototypeMethods(prototype) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return Object.getOwnPropertyNames(prototype).reduce(function ( + result, + name + ) { + if (disallowedProperties.includes(name)) { + return result; + } + + if (typeof prototype[name] !== "function") { + return result; + } + + result[name] = call.bind(prototype[name]); + + return result; + }, + Object.create(null)); +}; + +},{"./throws-on-proto":56}],50:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Function.prototype); + +},{"./copy-prototype-methods":49}],51:[function(require,module,exports){ +"use strict"; + +module.exports = { + array: require("./array"), + function: require("./function"), + map: require("./map"), + object: require("./object"), + set: require("./set"), + string: require("./string"), +}; + +},{"./array":48,"./function":50,"./map":52,"./object":53,"./set":54,"./string":55}],52:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Map.prototype); + +},{"./copy-prototype-methods":49}],53:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Object.prototype); + +},{"./copy-prototype-methods":49}],54:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(Set.prototype); + +},{"./copy-prototype-methods":49}],55:[function(require,module,exports){ +"use strict"; + +var copyPrototype = require("./copy-prototype-methods"); + +module.exports = copyPrototype(String.prototype); + +},{"./copy-prototype-methods":49}],56:[function(require,module,exports){ +"use strict"; + +/** + * Is true when the environment causes an error to be thrown for accessing the + * __proto__ property. + * This is necessary in order to support `node --disable-proto=throw`. + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto + * @type {boolean} + */ +let throwsOnProto; +try { + const object = {}; + // eslint-disable-next-line no-proto, no-unused-expressions + object.__proto__; + throwsOnProto = false; +} catch (_) { + // This branch is covered when tests are run with `--disable-proto=throw`, + // however we can test both branches at the same time, so this is ignored + /* istanbul ignore next */ + throwsOnProto = true; +} + +module.exports = throwsOnProto; + +},{}],57:[function(require,module,exports){ +"use strict"; + +var type = require("type-detect"); + +/** + * Returns the lower-case result of running type from type-detect on the value + * @param {*} value + * @returns {string} + */ +module.exports = function typeOf(value) { + return type(value).toLowerCase(); +}; + +},{"type-detect":94}],58:[function(require,module,exports){ +"use strict"; + +/** + * Returns a string representation of the value + * @param {*} value + * @returns {string} + */ +function valueToString(value) { + if (value && value.toString) { + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + return value.toString(); + } + return String(value); +} + +module.exports = valueToString; + +},{}],59:[function(require,module,exports){ +"use strict"; + +const globalObject = require("@sinonjs/commons").global; +let timersModule, timersPromisesModule; +if (typeof require === "function" && typeof module === "object") { + try { + timersModule = require("timers"); + } catch (e) { + // ignored + } + try { + timersPromisesModule = require("timers/promises"); + } catch (e) { + // ignored + } +} + +/** + * @typedef {object} IdleDeadline + * @property {boolean} didTimeout - whether or not the callback was called before reaching the optional timeout + * @property {function():number} timeRemaining - a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period + */ + +/** + * Queues a function to be called during a browser's idle periods + * + * @callback RequestIdleCallback + * @param {function(IdleDeadline)} callback + * @param {{timeout: number}} options - an options object + * @returns {number} the id + */ + +/** + * @callback NextTick + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {void} + */ + +/** + * @callback SetImmediate + * @param {VoidVarArgsFunc} callback - the callback to run + * @param {...*} args - optional arguments to call the callback with + * @returns {NodeImmediate} + */ + +/** + * @callback VoidVarArgsFunc + * @param {...*} callback - the callback to run + * @returns {void} + */ + +/** + * @typedef RequestAnimationFrame + * @property {function(number):void} requestAnimationFrame + * @returns {number} - the id + */ + +/** + * @typedef Performance + * @property {function(): number} now + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * @typedef {object} Clock + * @property {number} now - the current time + * @property {Date} Date - the Date constructor + * @property {number} loopLimit - the maximum number of timers before assuming an infinite loop + * @property {RequestIdleCallback} requestIdleCallback + * @property {function(number):void} cancelIdleCallback + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {NextTick} nextTick + * @property {queueMicrotask} queueMicrotask + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {SetImmediate} setImmediate + * @property {function(NodeImmediate):void} clearImmediate + * @property {function():number} countTimers + * @property {RequestAnimationFrame} requestAnimationFrame + * @property {function(number):void} cancelAnimationFrame + * @property {function():void} runMicrotasks + * @property {function(string | number): number} tick + * @property {function(string | number): Promise} tickAsync + * @property {function(): number} next + * @property {function(): Promise} nextAsync + * @property {function(): number} runAll + * @property {function(): number} runToFrame + * @property {function(): Promise} runAllAsync + * @property {function(): number} runToLast + * @property {function(): Promise} runToLastAsync + * @property {function(): void} reset + * @property {function(number | Date): void} setSystemTime + * @property {function(number): void} jump + * @property {Performance} performance + * @property {function(number[]): number[]} hrtime - process.hrtime (legacy) + * @property {function(): void} uninstall Uninstall the clock. + * @property {Function[]} methods - the methods that are faked + * @property {boolean} [shouldClearNativeTimers] inherited from config + * @property {{methodName:string, original:any}[] | undefined} timersModuleMethods + * @property {{methodName:string, original:any}[] | undefined} timersPromisesModuleMethods + * @property {Map} abortListenerMap + */ +/* eslint-enable jsdoc/require-property-description */ + +/** + * Configuration object for the `install` method. + * + * @typedef {object} Config + * @property {number|Date} [now] a number (in milliseconds) or a Date object (default epoch) + * @property {string[]} [toFake] names of the methods that should be faked. + * @property {number} [loopLimit] the maximum number of timers that will be run when calling runAll() + * @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false) + * @property {number} [advanceTimeDelta] increment mocked time every <> ms (default: 20ms) + * @property {boolean} [shouldClearNativeTimers] forwards clear timer calls to native functions if they are not fakes (default: false) + * @property {boolean} [ignoreMissingTimers] default is false, meaning asking to fake timers that are not present will throw an error + */ + +/* eslint-disable jsdoc/require-property-description */ +/** + * The internal structure to describe a scheduled fake timer + * + * @typedef {object} Timer + * @property {Function} func + * @property {*[]} args + * @property {number} delay + * @property {number} callAt + * @property {number} createdAt + * @property {boolean} immediate + * @property {number} id + * @property {Error} [error] + */ + +/** + * A Node timer + * + * @typedef {object} NodeImmediate + * @property {function(): boolean} hasRef + * @property {function(): NodeImmediate} ref + * @property {function(): NodeImmediate} unref + */ +/* eslint-enable jsdoc/require-property-description */ + +/* eslint-disable complexity */ + +/** + * Mocks available features in the specified global namespace. + * + * @param {*} _global Namespace to mock (e.g. `window`) + * @returns {FakeTimers} + */ +function withGlobal(_global) { + const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint + const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs + const NOOP = function () { + return undefined; + }; + const NOOP_ARRAY = function () { + return []; + }; + const isPresent = {}; + let timeoutResult, + addTimerReturnsObject = false; + + if (_global.setTimeout) { + isPresent.setTimeout = true; + timeoutResult = _global.setTimeout(NOOP, 0); + addTimerReturnsObject = typeof timeoutResult === "object"; + } + isPresent.clearTimeout = Boolean(_global.clearTimeout); + isPresent.setInterval = Boolean(_global.setInterval); + isPresent.clearInterval = Boolean(_global.clearInterval); + isPresent.hrtime = + _global.process && typeof _global.process.hrtime === "function"; + isPresent.hrtimeBigint = + isPresent.hrtime && typeof _global.process.hrtime.bigint === "function"; + isPresent.nextTick = + _global.process && typeof _global.process.nextTick === "function"; + const utilPromisify = _global.process && require("util").promisify; + isPresent.performance = + _global.performance && typeof _global.performance.now === "function"; + const hasPerformancePrototype = + _global.Performance && + (typeof _global.Performance).match(/^(function|object)$/); + const hasPerformanceConstructorPrototype = + _global.performance && + _global.performance.constructor && + _global.performance.constructor.prototype; + isPresent.queueMicrotask = _global.hasOwnProperty("queueMicrotask"); + isPresent.requestAnimationFrame = + _global.requestAnimationFrame && + typeof _global.requestAnimationFrame === "function"; + isPresent.cancelAnimationFrame = + _global.cancelAnimationFrame && + typeof _global.cancelAnimationFrame === "function"; + isPresent.requestIdleCallback = + _global.requestIdleCallback && + typeof _global.requestIdleCallback === "function"; + isPresent.cancelIdleCallbackPresent = + _global.cancelIdleCallback && + typeof _global.cancelIdleCallback === "function"; + isPresent.setImmediate = + _global.setImmediate && typeof _global.setImmediate === "function"; + isPresent.clearImmediate = + _global.clearImmediate && typeof _global.clearImmediate === "function"; + isPresent.Intl = _global.Intl && typeof _global.Intl === "object"; + + if (_global.clearTimeout) { + _global.clearTimeout(timeoutResult); + } + + const NativeDate = _global.Date; + const NativeIntl = _global.Intl; + let uniqueTimerId = idCounterStart; + + if (NativeDate === undefined) { + throw new Error( + "The global scope doesn't have a `Date` object" + + " (see https://github.com/sinonjs/sinon/issues/1852#issuecomment-419622780)", + ); + } + isPresent.Date = true; + + /** + * The PerformanceEntry object encapsulates a single performance metric + * that is part of the browser's performance timeline. + * + * This is an object returned by the `mark` and `measure` methods on the Performance prototype + */ + class FakePerformanceEntry { + constructor(name, entryType, startTime, duration) { + this.name = name; + this.entryType = entryType; + this.startTime = startTime; + this.duration = duration; + } + + toJSON() { + return JSON.stringify({ ...this }); + } + } + + /** + * @param {number} num + * @returns {boolean} + */ + function isNumberFinite(num) { + if (Number.isFinite) { + return Number.isFinite(num); + } + + return isFinite(num); + } + + let isNearInfiniteLimit = false; + + /** + * @param {Clock} clock + * @param {number} i + */ + function checkIsNearInfiniteLimit(clock, i) { + if (clock.loopLimit && i === clock.loopLimit - 1) { + isNearInfiniteLimit = true; + } + } + + /** + * + */ + function resetIsNearInfiniteLimit() { + isNearInfiniteLimit = false; + } + + /** + * Parse strings like "01:10:00" (meaning 1 hour, 10 minutes, 0 seconds) into + * number of milliseconds. This is used to support human-readable strings passed + * to clock.tick() + * + * @param {string} str + * @returns {number} + */ + function parseTime(str) { + if (!str) { + return 0; + } + + const strings = str.split(":"); + const l = strings.length; + let i = l; + let ms = 0; + let parsed; + + if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) { + throw new Error( + "tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits", + ); + } + + while (i--) { + parsed = parseInt(strings[i], 10); + + if (parsed >= 60) { + throw new Error(`Invalid time ${str}`); + } + + ms += parsed * Math.pow(60, l - i - 1); + } + + return ms * 1000; + } + + /** + * Get the decimal part of the millisecond value as nanoseconds + * + * @param {number} msFloat the number of milliseconds + * @returns {number} an integer number of nanoseconds in the range [0,1e6) + * + * Example: nanoRemainer(123.456789) -> 456789 + */ + function nanoRemainder(msFloat) { + const modulo = 1e6; + const remainder = (msFloat * 1e6) % modulo; + const positiveRemainder = + remainder < 0 ? remainder + modulo : remainder; + + return Math.floor(positiveRemainder); + } + + /** + * Used to grok the `now` parameter to createClock. + * + * @param {Date|number} epoch the system time + * @returns {number} + */ + function getEpoch(epoch) { + if (!epoch) { + return 0; + } + if (typeof epoch.getTime === "function") { + return epoch.getTime(); + } + if (typeof epoch === "number") { + return epoch; + } + throw new TypeError("now should be milliseconds since UNIX epoch"); + } + + /** + * @param {number} from + * @param {number} to + * @param {Timer} timer + * @returns {boolean} + */ + function inRange(from, to, timer) { + return timer && timer.callAt >= from && timer.callAt <= to; + } + + /** + * @param {Clock} clock + * @param {Timer} job + */ + function getInfiniteLoopError(clock, job) { + const infiniteLoopError = new Error( + `Aborting after running ${clock.loopLimit} timers, assuming an infinite loop!`, + ); + + if (!job.error) { + return infiniteLoopError; + } + + // pattern never matched in Node + const computedTargetPattern = /target\.*[<|(|[].*?[>|\]|)]\s*/; + let clockMethodPattern = new RegExp( + String(Object.keys(clock).join("|")), + ); + + if (addTimerReturnsObject) { + // node.js environment + clockMethodPattern = new RegExp( + `\\s+at (Object\\.)?(?:${Object.keys(clock).join("|")})\\s+`, + ); + } + + let matchedLineIndex = -1; + job.error.stack.split("\n").some(function (line, i) { + // If we've matched a computed target line (e.g. setTimeout) then we + // don't need to look any further. Return true to stop iterating. + const matchedComputedTarget = line.match(computedTargetPattern); + /* istanbul ignore if */ + if (matchedComputedTarget) { + matchedLineIndex = i; + return true; + } + + // If we've matched a clock method line, then there may still be + // others further down the trace. Return false to keep iterating. + const matchedClockMethod = line.match(clockMethodPattern); + if (matchedClockMethod) { + matchedLineIndex = i; + return false; + } + + // If we haven't matched anything on this line, but we matched + // previously and set the matched line index, then we can stop. + // If we haven't matched previously, then we should keep iterating. + return matchedLineIndex >= 0; + }); + + const stack = `${infiniteLoopError}\n${job.type || "Microtask"} - ${ + job.func.name || "anonymous" + }\n${job.error.stack + .split("\n") + .slice(matchedLineIndex + 1) + .join("\n")}`; + + try { + Object.defineProperty(infiniteLoopError, "stack", { + value: stack, + }); + } catch (e) { + // noop + } + + return infiniteLoopError; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function createDate() { + class ClockDate extends NativeDate { + /** + * @param {number} year + * @param {number} month + * @param {number} date + * @param {number} hour + * @param {number} minute + * @param {number} second + * @param {number} ms + * @returns void + */ + // eslint-disable-next-line no-unused-vars + constructor(year, month, date, hour, minute, second, ms) { + // Defensive and verbose to avoid potential harm in passing + // explicit undefined when user does not pass argument + if (arguments.length === 0) { + super(ClockDate.clock.now); + } else { + super(...arguments); + } + + // ensures identity checks using the constructor prop still works + // this should have no other functional effect + Object.defineProperty(this, "constructor", { + value: NativeDate, + enumerable: false, + }); + } + + static [Symbol.hasInstance](instance) { + return instance instanceof NativeDate; + } + } + + ClockDate.isFake = true; + + if (NativeDate.now) { + ClockDate.now = function now() { + return ClockDate.clock.now; + }; + } + + if (NativeDate.toSource) { + ClockDate.toSource = function toSource() { + return NativeDate.toSource(); + }; + } + + ClockDate.toString = function toString() { + return NativeDate.toString(); + }; + + // noinspection UnnecessaryLocalVariableJS + /** + * A normal Class constructor cannot be called without `new`, but Date can, so we need + * to wrap it in a Proxy in order to ensure this functionality of Date is kept intact + * + * @type {ClockDate} + */ + const ClockDateProxy = new Proxy(ClockDate, { + // handler for [[Call]] invocations (i.e. not using `new`) + apply() { + // the Date constructor called as a function, ref Ecma-262 Edition 5.1, section 15.9.2. + // This remains so in the 10th edition of 2019 as well. + if (this instanceof ClockDate) { + throw new TypeError( + "A Proxy should only capture `new` calls with the `construct` handler. This is not supposed to be possible, so check the logic.", + ); + } + + return new NativeDate(ClockDate.clock.now).toString(); + }, + }); + + return ClockDateProxy; + } + + /** + * Mirror Intl by default on our fake implementation + * + * Most of the properties are the original native ones, + * but we need to take control of those that have a + * dependency on the current clock. + * + * @returns {object} the partly fake Intl implementation + */ + function createIntl() { + const ClockIntl = {}; + /* + * All properties of Intl are non-enumerable, so we need + * to do a bit of work to get them out. + */ + Object.getOwnPropertyNames(NativeIntl).forEach( + (property) => (ClockIntl[property] = NativeIntl[property]), + ); + + ClockIntl.DateTimeFormat = function (...args) { + const realFormatter = new NativeIntl.DateTimeFormat(...args); + const formatter = {}; + + ["formatRange", "formatRangeToParts", "resolvedOptions"].forEach( + (method) => { + formatter[method] = + realFormatter[method].bind(realFormatter); + }, + ); + + ["format", "formatToParts"].forEach((method) => { + formatter[method] = function (date) { + return realFormatter[method](date || ClockIntl.clock.now); + }; + }); + + return formatter; + }; + + ClockIntl.DateTimeFormat.prototype = Object.create( + NativeIntl.DateTimeFormat.prototype, + ); + + ClockIntl.DateTimeFormat.supportedLocalesOf = + NativeIntl.DateTimeFormat.supportedLocalesOf; + + return ClockIntl; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function enqueueJob(clock, job) { + // enqueues a microtick-deferred task - ecma262/#sec-enqueuejob + if (!clock.jobs) { + clock.jobs = []; + } + clock.jobs.push(job); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function runJobs(clock) { + // runs all microtick-deferred tasks - ecma262/#sec-runjobs + if (!clock.jobs) { + return; + } + for (let i = 0; i < clock.jobs.length; i++) { + const job = clock.jobs[i]; + job.func.apply(null, job.args); + + checkIsNearInfiniteLimit(clock, i); + if (clock.loopLimit && i > clock.loopLimit) { + throw getInfiniteLoopError(clock, job); + } + } + resetIsNearInfiniteLimit(); + clock.jobs = []; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + * @returns {number} id of the created timer + */ + function addTimer(clock, timer) { + if (timer.func === undefined) { + throw new Error("Callback must be provided to timer calls"); + } + + if (addTimerReturnsObject) { + // Node.js environment + if (typeof timer.func !== "function") { + throw new TypeError( + `[ERR_INVALID_CALLBACK]: Callback must be a function. Received ${ + timer.func + } of type ${typeof timer.func}`, + ); + } + } + + if (isNearInfiniteLimit) { + timer.error = new Error(); + } + + timer.type = timer.immediate ? "Immediate" : "Timeout"; + + if (timer.hasOwnProperty("delay")) { + if (typeof timer.delay !== "number") { + timer.delay = parseInt(timer.delay, 10); + } + + if (!isNumberFinite(timer.delay)) { + timer.delay = 0; + } + timer.delay = timer.delay > maxTimeout ? 1 : timer.delay; + timer.delay = Math.max(0, timer.delay); + } + + if (timer.hasOwnProperty("interval")) { + timer.type = "Interval"; + timer.interval = timer.interval > maxTimeout ? 1 : timer.interval; + } + + if (timer.hasOwnProperty("animation")) { + timer.type = "AnimationFrame"; + timer.animation = true; + } + + if (timer.hasOwnProperty("idleCallback")) { + timer.type = "IdleCallback"; + timer.idleCallback = true; + } + + if (!clock.timers) { + clock.timers = {}; + } + + timer.id = uniqueTimerId++; + timer.createdAt = clock.now; + timer.callAt = + clock.now + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + clock.timers[timer.id] = timer; + + if (addTimerReturnsObject) { + const res = { + refed: true, + ref: function () { + this.refed = true; + return res; + }, + unref: function () { + this.refed = false; + return res; + }, + hasRef: function () { + return this.refed; + }, + refresh: function () { + timer.callAt = + clock.now + + (parseInt(timer.delay) || (clock.duringTick ? 1 : 0)); + + // it _might_ have been removed, but if not the assignment is perfectly fine + clock.timers[timer.id] = timer; + + return res; + }, + [Symbol.toPrimitive]: function () { + return timer.id; + }, + }; + return res; + } + + return timer.id; + } + + /* eslint consistent-return: "off" */ + /** + * Timer comparitor + * + * @param {Timer} a + * @param {Timer} b + * @returns {number} + */ + function compareTimers(a, b) { + // Sort first by absolute timing + if (a.callAt < b.callAt) { + return -1; + } + if (a.callAt > b.callAt) { + return 1; + } + + // Sort next by immediate, immediate timers take precedence + if (a.immediate && !b.immediate) { + return -1; + } + if (!a.immediate && b.immediate) { + return 1; + } + + // Sort next by creation time, earlier-created timers take precedence + if (a.createdAt < b.createdAt) { + return -1; + } + if (a.createdAt > b.createdAt) { + return 1; + } + + // Sort next by id, lower-id timers take precedence + if (a.id < b.id) { + return -1; + } + if (a.id > b.id) { + return 1; + } + + // As timer ids are unique, no fallback `0` is necessary + } + + /** + * @param {Clock} clock + * @param {number} from + * @param {number} to + * @returns {Timer} + */ + function firstTimerInRange(clock, from, to) { + const timers = clock.timers; + let timer = null; + let id, isInRange; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + isInRange = inRange(from, to, timers[id]); + + if ( + isInRange && + (!timer || compareTimers(timer, timers[id]) === 1) + ) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function firstTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === 1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @returns {Timer} + */ + function lastTimer(clock) { + const timers = clock.timers; + let timer = null; + let id; + + for (id in timers) { + if (timers.hasOwnProperty(id)) { + if (!timer || compareTimers(timer, timers[id]) === -1) { + timer = timers[id]; + } + } + } + + return timer; + } + + /** + * @param {Clock} clock + * @param {Timer} timer + */ + function callTimer(clock, timer) { + if (typeof timer.interval === "number") { + clock.timers[timer.id].callAt += timer.interval; + } else { + delete clock.timers[timer.id]; + } + + if (typeof timer.func === "function") { + timer.func.apply(null, timer.args); + } else { + /* eslint no-eval: "off" */ + const eval2 = eval; + (function () { + eval2(timer.func); + })(); + } + } + + /** + * Gets clear handler name for a given timer type + * + * @param {string} ttype + */ + function getClearHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `cancel${ttype}`; + } + return `clear${ttype}`; + } + + /** + * Gets schedule handler name for a given timer type + * + * @param {string} ttype + */ + function getScheduleHandler(ttype) { + if (ttype === "IdleCallback" || ttype === "AnimationFrame") { + return `request${ttype}`; + } + return `set${ttype}`; + } + + /** + * Creates an anonymous function to warn only once + */ + function createWarnOnce() { + let calls = 0; + return function (msg) { + // eslint-disable-next-line + !calls++ && console.warn(msg); + }; + } + const warnOnce = createWarnOnce(); + + /** + * @param {Clock} clock + * @param {number} timerId + * @param {string} ttype + */ + function clearTimer(clock, timerId, ttype) { + if (!timerId) { + // null appears to be allowed in most browsers, and appears to be + // relied upon by some libraries, like Bootstrap carousel + return; + } + + if (!clock.timers) { + clock.timers = {}; + } + + // in Node, the ID is stored as the primitive value for `Timeout` objects + // for `Immediate` objects, no ID exists, so it gets coerced to NaN + const id = Number(timerId); + + if (Number.isNaN(id) || id < idCounterStart) { + const handlerName = getClearHandler(ttype); + + if (clock.shouldClearNativeTimers === true) { + const nativeHandler = clock[`_${handlerName}`]; + return typeof nativeHandler === "function" + ? nativeHandler(timerId) + : undefined; + } + warnOnce( + `FakeTimers: ${handlerName} was invoked to clear a native timer instead of one created by this library.` + + "\nTo automatically clean-up native timers, use `shouldClearNativeTimers`.", + ); + } + + if (clock.timers.hasOwnProperty(id)) { + // check that the ID matches a timer of the correct type + const timer = clock.timers[id]; + if ( + timer.type === ttype || + (timer.type === "Timeout" && ttype === "Interval") || + (timer.type === "Interval" && ttype === "Timeout") + ) { + delete clock.timers[id]; + } else { + const clear = getClearHandler(ttype); + const schedule = getScheduleHandler(timer.type); + throw new Error( + `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`, + ); + } + } + } + + /** + * @param {Clock} clock + * @param {Config} config + * @returns {Timer[]} + */ + function uninstall(clock, config) { + let method, i, l; + const installedHrTime = "_hrtime"; + const installedNextTick = "_nextTick"; + + for (i = 0, l = clock.methods.length; i < l; i++) { + method = clock.methods[i]; + if (method === "hrtime" && _global.process) { + _global.process.hrtime = clock[installedHrTime]; + } else if (method === "nextTick" && _global.process) { + _global.process.nextTick = clock[installedNextTick]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + clock, + `_${method}`, + ); + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + _global, + method, + originalPerfDescriptor, + ); + } else if (originalPerfDescriptor.configurable) { + _global[method] = clock[`_${method}`]; + } + } else { + if (_global[method] && _global[method].hadOwnProperty) { + _global[method] = clock[`_${method}`]; + } else { + try { + delete _global[method]; + } catch (ignore) { + /* eslint no-empty: "off" */ + } + } + } + if (clock.timersModuleMethods !== undefined) { + for (let j = 0; j < clock.timersModuleMethods.length; j++) { + const entry = clock.timersModuleMethods[j]; + timersModule[entry.methodName] = entry.original; + } + } + if (clock.timersPromisesModuleMethods !== undefined) { + for ( + let j = 0; + j < clock.timersPromisesModuleMethods.length; + j++ + ) { + const entry = clock.timersPromisesModuleMethods[j]; + timersPromisesModule[entry.methodName] = entry.original; + } + } + } + + if (config.shouldAdvanceTime === true) { + _global.clearInterval(clock.attachedInterval); + } + + // Prevent multiple executions which will completely remove these props + clock.methods = []; + + for (const [listener, signal] of clock.abortListenerMap.entries()) { + signal.removeEventListener("abort", listener); + clock.abortListenerMap.delete(listener); + } + + // return pending timers, to enable checking what timers remained on uninstall + if (!clock.timers) { + return []; + } + return Object.keys(clock.timers).map(function mapper(key) { + return clock.timers[key]; + }); + } + + /** + * @param {object} target the target containing the method to replace + * @param {string} method the keyname of the method on the target + * @param {Clock} clock + */ + function hijackMethod(target, method, clock) { + clock[method].hadOwnProperty = Object.prototype.hasOwnProperty.call( + target, + method, + ); + clock[`_${method}`] = target[method]; + + if (method === "Date") { + target[method] = clock[method]; + } else if (method === "Intl") { + target[method] = clock[method]; + } else if (method === "performance") { + const originalPerfDescriptor = Object.getOwnPropertyDescriptor( + target, + method, + ); + // JSDOM has a read only performance field so we have to save/copy it differently + if ( + originalPerfDescriptor && + originalPerfDescriptor.get && + !originalPerfDescriptor.set + ) { + Object.defineProperty( + clock, + `_${method}`, + originalPerfDescriptor, + ); + + const perfDescriptor = Object.getOwnPropertyDescriptor( + clock, + method, + ); + Object.defineProperty(target, method, perfDescriptor); + } else { + target[method] = clock[method]; + } + } else { + target[method] = function () { + return clock[method].apply(clock, arguments); + }; + + Object.defineProperties( + target[method], + Object.getOwnPropertyDescriptors(clock[method]), + ); + } + + target[method].clock = clock; + } + + /** + * @param {Clock} clock + * @param {number} advanceTimeDelta + */ + function doIntervalTick(clock, advanceTimeDelta) { + clock.tick(advanceTimeDelta); + } + + /** + * @typedef {object} Timers + * @property {setTimeout} setTimeout + * @property {clearTimeout} clearTimeout + * @property {setInterval} setInterval + * @property {clearInterval} clearInterval + * @property {Date} Date + * @property {Intl} Intl + * @property {SetImmediate=} setImmediate + * @property {function(NodeImmediate): void=} clearImmediate + * @property {function(number[]):number[]=} hrtime + * @property {NextTick=} nextTick + * @property {Performance=} performance + * @property {RequestAnimationFrame=} requestAnimationFrame + * @property {boolean=} queueMicrotask + * @property {function(number): void=} cancelAnimationFrame + * @property {RequestIdleCallback=} requestIdleCallback + * @property {function(number): void=} cancelIdleCallback + */ + + /** @type {Timers} */ + const timers = { + setTimeout: _global.setTimeout, + clearTimeout: _global.clearTimeout, + setInterval: _global.setInterval, + clearInterval: _global.clearInterval, + Date: _global.Date, + }; + + if (isPresent.setImmediate) { + timers.setImmediate = _global.setImmediate; + } + + if (isPresent.clearImmediate) { + timers.clearImmediate = _global.clearImmediate; + } + + if (isPresent.hrtime) { + timers.hrtime = _global.process.hrtime; + } + + if (isPresent.nextTick) { + timers.nextTick = _global.process.nextTick; + } + + if (isPresent.performance) { + timers.performance = _global.performance; + } + + if (isPresent.requestAnimationFrame) { + timers.requestAnimationFrame = _global.requestAnimationFrame; + } + + if (isPresent.queueMicrotask) { + timers.queueMicrotask = _global.queueMicrotask; + } + + if (isPresent.cancelAnimationFrame) { + timers.cancelAnimationFrame = _global.cancelAnimationFrame; + } + + if (isPresent.requestIdleCallback) { + timers.requestIdleCallback = _global.requestIdleCallback; + } + + if (isPresent.cancelIdleCallback) { + timers.cancelIdleCallback = _global.cancelIdleCallback; + } + + if (isPresent.Intl) { + timers.Intl = _global.Intl; + } + + const originalSetTimeout = _global.setImmediate || _global.setTimeout; + + /** + * @param {Date|number} [start] the system time - non-integer values are floored + * @param {number} [loopLimit] maximum number of timers that will be run when calling runAll() + * @returns {Clock} + */ + function createClock(start, loopLimit) { + // eslint-disable-next-line no-param-reassign + start = Math.floor(getEpoch(start)); + // eslint-disable-next-line no-param-reassign + loopLimit = loopLimit || 1000; + let nanos = 0; + const adjustedSystemTime = [0, 0]; // [millis, nanoremainder] + + const clock = { + now: start, + Date: createDate(), + loopLimit: loopLimit, + }; + + clock.Date.clock = clock; + + //eslint-disable-next-line jsdoc/require-jsdoc + function getTimeToNextFrame() { + return 16 - ((clock.now - start) % 16); + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function hrtime(prev) { + const millisSinceStart = clock.now - adjustedSystemTime[0] - start; + const secsSinceStart = Math.floor(millisSinceStart / 1000); + const remainderInNanos = + (millisSinceStart - secsSinceStart * 1e3) * 1e6 + + nanos - + adjustedSystemTime[1]; + + if (Array.isArray(prev)) { + if (prev[1] > 1e9) { + throw new TypeError( + "Number of nanoseconds can't exceed a billion", + ); + } + + const oldSecs = prev[0]; + let nanoDiff = remainderInNanos - prev[1]; + let secDiff = secsSinceStart - oldSecs; + + if (nanoDiff < 0) { + nanoDiff += 1e9; + secDiff -= 1; + } + + return [secDiff, nanoDiff]; + } + return [secsSinceStart, remainderInNanos]; + } + + /** + * A high resolution timestamp in milliseconds. + * + * @typedef {number} DOMHighResTimeStamp + */ + + /** + * performance.now() + * + * @returns {DOMHighResTimeStamp} + */ + function fakePerformanceNow() { + const hrt = hrtime(); + const millis = hrt[0] * 1000 + hrt[1] / 1e6; + return millis; + } + + if (isPresent.hrtimeBigint) { + hrtime.bigint = function () { + const parts = hrtime(); + return BigInt(parts[0]) * BigInt(1e9) + BigInt(parts[1]); // eslint-disable-line + }; + } + + if (isPresent.Intl) { + clock.Intl = createIntl(); + clock.Intl.clock = clock; + } + + clock.requestIdleCallback = function requestIdleCallback( + func, + timeout, + ) { + let timeToNextIdlePeriod = 0; + + if (clock.countTimers() > 0) { + timeToNextIdlePeriod = 50; // const for now + } + + const result = addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: + typeof timeout === "undefined" + ? timeToNextIdlePeriod + : Math.min(timeout, timeToNextIdlePeriod), + idleCallback: true, + }); + + return Number(result); + }; + + clock.cancelIdleCallback = function cancelIdleCallback(timerId) { + return clearTimer(clock, timerId, "IdleCallback"); + }; + + clock.setTimeout = function setTimeout(func, timeout) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + }); + }; + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setTimeout[utilPromisify.custom] = + function promisifiedSetTimeout(timeout, arg) { + return new _global.Promise(function setTimeoutExecutor( + resolve, + ) { + addTimer(clock, { + func: resolve, + args: [arg], + delay: timeout, + }); + }); + }; + } + + clock.clearTimeout = function clearTimeout(timerId) { + return clearTimer(clock, timerId, "Timeout"); + }; + + clock.nextTick = function nextTick(func) { + return enqueueJob(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + error: isNearInfiniteLimit ? new Error() : null, + }); + }; + + clock.queueMicrotask = function queueMicrotask(func) { + return clock.nextTick(func); // explicitly drop additional arguments + }; + + clock.setInterval = function setInterval(func, timeout) { + // eslint-disable-next-line no-param-reassign + timeout = parseInt(timeout, 10); + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 2), + delay: timeout, + interval: timeout, + }); + }; + + clock.clearInterval = function clearInterval(timerId) { + return clearTimer(clock, timerId, "Interval"); + }; + + if (isPresent.setImmediate) { + clock.setImmediate = function setImmediate(func) { + return addTimer(clock, { + func: func, + args: Array.prototype.slice.call(arguments, 1), + immediate: true, + }); + }; + + if (typeof _global.Promise !== "undefined" && utilPromisify) { + clock.setImmediate[utilPromisify.custom] = + function promisifiedSetImmediate(arg) { + return new _global.Promise( + function setImmediateExecutor(resolve) { + addTimer(clock, { + func: resolve, + args: [arg], + immediate: true, + }); + }, + ); + }; + } + + clock.clearImmediate = function clearImmediate(timerId) { + return clearTimer(clock, timerId, "Immediate"); + }; + } + + clock.countTimers = function countTimers() { + return ( + Object.keys(clock.timers || {}).length + + (clock.jobs || []).length + ); + }; + + clock.requestAnimationFrame = function requestAnimationFrame(func) { + const result = addTimer(clock, { + func: func, + delay: getTimeToNextFrame(), + get args() { + return [fakePerformanceNow()]; + }, + animation: true, + }); + + return Number(result); + }; + + clock.cancelAnimationFrame = function cancelAnimationFrame(timerId) { + return clearTimer(clock, timerId, "AnimationFrame"); + }; + + clock.runMicrotasks = function runMicrotasks() { + runJobs(clock); + }; + + /** + * @param {number|string} tickValue milliseconds or a string parseable by parseTime + * @param {boolean} isAsync + * @param {Function} resolve + * @param {Function} reject + * @returns {number|undefined} will return the new `now` value or nothing for async + */ + function doTick(tickValue, isAsync, resolve, reject) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + const remainder = nanoRemainder(msFloat); + let nanosTotal = nanos + remainder; + let tickTo = clock.now + ms; + + if (msFloat < 0) { + throw new TypeError("Negative ticks are not supported"); + } + + // adjust for positive overflow + if (nanosTotal >= 1e6) { + tickTo += 1; + nanosTotal -= 1e6; + } + + nanos = nanosTotal; + let tickFrom = clock.now; + let previous = clock.now; + // ESLint fails to detect this correctly + /* eslint-disable prefer-const */ + let timer, + firstException, + oldNow, + nextPromiseTick, + compensationCheck, + postTimerCall; + /* eslint-enable prefer-const */ + + clock.duringTick = true; + + // perform microtasks + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during microtask callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + + //eslint-disable-next-line jsdoc/require-jsdoc + function doTickInner() { + // perform each timer in the requested range + timer = firstTimerInRange(clock, tickFrom, tickTo); + // eslint-disable-next-line no-unmodified-loop-condition + while (timer && tickFrom <= tickTo) { + if (clock.timers[timer.id]) { + tickFrom = timer.callAt; + clock.now = timer.callAt; + oldNow = clock.now; + try { + runJobs(clock); + callTimer(clock, timer); + } catch (e) { + firstException = firstException || e; + } + + if (isAsync) { + // finish up after native setImmediate callback to allow + // all native es6 promises to process their callbacks after + // each timer fires. + originalSetTimeout(nextPromiseTick); + return; + } + + compensationCheck(); + } + + postTimerCall(); + } + + // perform process.nextTick()s again + oldNow = clock.now; + runJobs(clock); + if (oldNow !== clock.now) { + // compensate for any setSystemTime() call during process.nextTick() callback + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + } + clock.duringTick = false; + + // corner case: during runJobs new timers were scheduled which could be in the range [clock.now, tickTo] + timer = firstTimerInRange(clock, tickFrom, tickTo); + if (timer) { + try { + clock.tick(tickTo - clock.now); // do it all again - for the remainder of the requested range + } catch (e) { + firstException = firstException || e; + } + } else { + // no timers remaining in the requested range: move the clock all the way to the end + clock.now = tickTo; + + // update nanos + nanos = nanosTotal; + } + if (firstException) { + throw firstException; + } + + if (isAsync) { + resolve(clock.now); + } else { + return clock.now; + } + } + + nextPromiseTick = + isAsync && + function () { + try { + compensationCheck(); + postTimerCall(); + doTickInner(); + } catch (e) { + reject(e); + } + }; + + compensationCheck = function () { + // compensate for any setSystemTime() call during timer callback + if (oldNow !== clock.now) { + tickFrom += clock.now - oldNow; + tickTo += clock.now - oldNow; + previous += clock.now - oldNow; + } + }; + + postTimerCall = function () { + timer = firstTimerInRange(clock, previous, tickTo); + previous = tickFrom; + }; + + return doTickInner(); + } + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.tick = function tick(tickValue) { + return doTick(tickValue, false); + }; + + if (typeof _global.Promise !== "undefined") { + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {Promise} + */ + clock.tickAsync = function tickAsync(tickValue) { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + doTick(tickValue, true, resolve, reject); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.next = function next() { + runJobs(clock); + const timer = firstTimer(clock); + if (!timer) { + return clock.now; + } + + clock.duringTick = true; + try { + clock.now = timer.callAt; + callTimer(clock, timer); + runJobs(clock); + return clock.now; + } finally { + clock.duringTick = false; + } + }; + + if (typeof _global.Promise !== "undefined") { + clock.nextAsync = function nextAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = firstTimer(clock); + if (!timer) { + resolve(clock.now); + return; + } + + let err; + clock.duringTick = true; + clock.now = timer.callAt; + try { + callTimer(clock, timer); + } catch (e) { + err = e; + } + clock.duringTick = false; + + originalSetTimeout(function () { + if (err) { + reject(err); + } else { + resolve(clock.now); + } + }); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.runAll = function runAll() { + let numTimers, i; + runJobs(clock); + for (i = 0; i < clock.loopLimit; i++) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + numTimers = Object.keys(clock.timers).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + return clock.now; + } + + clock.next(); + checkIsNearInfiniteLimit(clock, i); + } + + const excessJob = firstTimer(clock); + throw getInfiniteLoopError(clock, excessJob); + }; + + clock.runToFrame = function runToFrame() { + return clock.tick(getTimeToNextFrame()); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runAllAsync = function runAllAsync() { + return new _global.Promise(function (resolve, reject) { + let i = 0; + /** + * + */ + function doRun() { + originalSetTimeout(function () { + try { + runJobs(clock); + + let numTimers; + if (i < clock.loopLimit) { + if (!clock.timers) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + numTimers = Object.keys( + clock.timers, + ).length; + if (numTimers === 0) { + resetIsNearInfiniteLimit(); + resolve(clock.now); + return; + } + + clock.next(); + + i++; + + doRun(); + checkIsNearInfiniteLimit(clock, i); + return; + } + + const excessJob = firstTimer(clock); + reject(getInfiniteLoopError(clock, excessJob)); + } catch (e) { + reject(e); + } + }); + } + doRun(); + }); + }; + } + + clock.runToLast = function runToLast() { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + return clock.now; + } + + return clock.tick(timer.callAt - clock.now); + }; + + if (typeof _global.Promise !== "undefined") { + clock.runToLastAsync = function runToLastAsync() { + return new _global.Promise(function (resolve, reject) { + originalSetTimeout(function () { + try { + const timer = lastTimer(clock); + if (!timer) { + runJobs(clock); + resolve(clock.now); + } + + resolve(clock.tickAsync(timer.callAt - clock.now)); + } catch (e) { + reject(e); + } + }); + }); + }; + } + + clock.reset = function reset() { + nanos = 0; + clock.timers = {}; + clock.jobs = []; + clock.now = start; + }; + + clock.setSystemTime = function setSystemTime(systemTime) { + // determine time difference + const newNow = getEpoch(systemTime); + const difference = newNow - clock.now; + let id, timer; + + adjustedSystemTime[0] = adjustedSystemTime[0] + difference; + adjustedSystemTime[1] = adjustedSystemTime[1] + nanos; + // update 'system clock' + clock.now = newNow; + nanos = 0; + + // update timers and intervals to keep them stable + for (id in clock.timers) { + if (clock.timers.hasOwnProperty(id)) { + timer = clock.timers[id]; + timer.createdAt += difference; + timer.callAt += difference; + } + } + }; + + /** + * @param {string|number} tickValue number of milliseconds or a human-readable value like "01:11:15" + * @returns {number} will return the new `now` value + */ + clock.jump = function jump(tickValue) { + const msFloat = + typeof tickValue === "number" + ? tickValue + : parseTime(tickValue); + const ms = Math.floor(msFloat); + + for (const timer of Object.values(clock.timers)) { + if (clock.now + ms > timer.callAt) { + timer.callAt = clock.now + ms; + } + } + clock.tick(ms); + }; + + if (isPresent.performance) { + clock.performance = Object.create(null); + clock.performance.now = fakePerformanceNow; + } + + if (isPresent.hrtime) { + clock.hrtime = hrtime; + } + + return clock; + } + + /* eslint-disable complexity */ + + /** + * @param {Config=} [config] Optional config + * @returns {Clock} + */ + function install(config) { + if ( + arguments.length > 1 || + config instanceof Date || + Array.isArray(config) || + typeof config === "number" + ) { + throw new TypeError( + `FakeTimers.install called with ${String( + config, + )} install requires an object parameter`, + ); + } + + if (_global.Date.isFake === true) { + // Timers are already faked; this is a problem. + // Make the user reset timers before continuing. + throw new TypeError( + "Can't install fake timers twice on the same global object.", + ); + } + + // eslint-disable-next-line no-param-reassign + config = typeof config !== "undefined" ? config : {}; + config.shouldAdvanceTime = config.shouldAdvanceTime || false; + config.advanceTimeDelta = config.advanceTimeDelta || 20; + config.shouldClearNativeTimers = + config.shouldClearNativeTimers || false; + + if (config.target) { + throw new TypeError( + "config.target is no longer supported. Use `withGlobal(target)` instead.", + ); + } + + /** + * @param {string} timer/object the name of the thing that is not present + * @param timer + */ + function handleMissingTimer(timer) { + if (config.ignoreMissingTimers) { + return; + } + + throw new ReferenceError( + `non-existent timers and/or objects cannot be faked: '${timer}'`, + ); + } + + let i, l; + const clock = createClock(config.now, config.loopLimit); + clock.shouldClearNativeTimers = config.shouldClearNativeTimers; + + clock.uninstall = function () { + return uninstall(clock, config); + }; + + clock.abortListenerMap = new Map(); + + clock.methods = config.toFake || []; + + if (clock.methods.length === 0) { + clock.methods = Object.keys(timers); + } + + if (config.shouldAdvanceTime === true) { + const intervalTick = doIntervalTick.bind( + null, + clock, + config.advanceTimeDelta, + ); + const intervalId = _global.setInterval( + intervalTick, + config.advanceTimeDelta, + ); + clock.attachedInterval = intervalId; + } + + if (clock.methods.includes("performance")) { + const proto = (() => { + if (hasPerformanceConstructorPrototype) { + return _global.performance.constructor.prototype; + } + if (hasPerformancePrototype) { + return _global.Performance.prototype; + } + })(); + if (proto) { + Object.getOwnPropertyNames(proto).forEach(function (name) { + if (name !== "now") { + clock.performance[name] = + name.indexOf("getEntries") === 0 + ? NOOP_ARRAY + : NOOP; + } + }); + // ensure `mark` returns a value that is valid + clock.performance.mark = (name) => + new FakePerformanceEntry(name, "mark", 0, 0); + clock.performance.measure = (name) => + new FakePerformanceEntry(name, "measure", 0, 100); + } else if ((config.toFake || []).includes("performance")) { + return handleMissingTimer("performance"); + } + } + if (_global === globalObject && timersModule) { + clock.timersModuleMethods = []; + } + if (_global === globalObject && timersPromisesModule) { + clock.timersPromisesModuleMethods = []; + } + for (i = 0, l = clock.methods.length; i < l; i++) { + const nameOfMethodToReplace = clock.methods[i]; + + if (!isPresent[nameOfMethodToReplace]) { + handleMissingTimer(nameOfMethodToReplace); + // eslint-disable-next-line + continue; + } + + if (nameOfMethodToReplace === "hrtime") { + if ( + _global.process && + typeof _global.process.hrtime === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else if (nameOfMethodToReplace === "nextTick") { + if ( + _global.process && + typeof _global.process.nextTick === "function" + ) { + hijackMethod(_global.process, nameOfMethodToReplace, clock); + } + } else { + hijackMethod(_global, nameOfMethodToReplace, clock); + } + if ( + clock.timersModuleMethods !== undefined && + timersModule[nameOfMethodToReplace] + ) { + const original = timersModule[nameOfMethodToReplace]; + clock.timersModuleMethods.push({ + methodName: nameOfMethodToReplace, + original: original, + }); + timersModule[nameOfMethodToReplace] = + _global[nameOfMethodToReplace]; + } + if (clock.timersPromisesModuleMethods !== undefined) { + if (nameOfMethodToReplace === "setTimeout") { + clock.timersPromisesModuleMethods.push({ + methodName: "setTimeout", + original: timersPromisesModule.setTimeout, + }); + + timersPromisesModule.setTimeout = ( + delay, + value, + options = {}, + ) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearTimeout(handle); + reject(options.signal.reason); + }; + + const handle = clock.setTimeout(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }, delay); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setImmediate") { + clock.timersPromisesModuleMethods.push({ + methodName: "setImmediate", + original: timersPromisesModule.setImmediate, + }); + + timersPromisesModule.setImmediate = (value, options = {}) => + new Promise((resolve, reject) => { + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + // This is safe, there is no code path that leads to this function + // being invoked before handle has been assigned. + // eslint-disable-next-line no-use-before-define + clock.clearImmediate(handle); + reject(options.signal.reason); + }; + + const handle = clock.setImmediate(() => { + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + resolve(value); + }); + + if (options.signal) { + if (options.signal.aborted) { + abort(); + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + }); + } else if (nameOfMethodToReplace === "setInterval") { + clock.timersPromisesModuleMethods.push({ + methodName: "setInterval", + original: timersPromisesModule.setInterval, + }); + + timersPromisesModule.setInterval = ( + delay, + value, + options = {}, + ) => ({ + [Symbol.asyncIterator]: () => { + const createResolvable = () => { + let resolve, reject; + const promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + promise.resolve = resolve; + promise.reject = reject; + return promise; + }; + + let done = false; + let hasThrown = false; + let returnCall; + let nextAvailable = 0; + const nextQueue = []; + + const handle = clock.setInterval(() => { + if (nextQueue.length > 0) { + nextQueue.shift().resolve(); + } else { + nextAvailable++; + } + }, delay); + + const abort = () => { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + + clock.clearInterval(handle); + done = true; + for (const resolvable of nextQueue) { + resolvable.resolve(); + } + }; + + if (options.signal) { + if (options.signal.aborted) { + done = true; + } else { + options.signal.addEventListener( + "abort", + abort, + ); + clock.abortListenerMap.set( + abort, + options.signal, + ); + } + } + + return { + next: async () => { + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + if (nextAvailable > 0) { + nextAvailable--; + return { done: false, value: value }; + } + + const resolvable = createResolvable(); + nextQueue.push(resolvable); + + await resolvable; + + if (returnCall && nextQueue.length === 0) { + returnCall.resolve(); + } + + if (options.signal?.aborted && !hasThrown) { + hasThrown = true; + throw options.signal.reason; + } + + if (done) { + return { done: true, value: undefined }; + } + + return { done: false, value: value }; + }, + return: async () => { + if (done) { + return { done: true, value: undefined }; + } + + if (nextQueue.length > 0) { + returnCall = createResolvable(); + await returnCall; + } + + clock.clearInterval(handle); + done = true; + + if (options.signal) { + options.signal.removeEventListener( + "abort", + abort, + ); + clock.abortListenerMap.delete(abort); + } + + return { done: true, value: undefined }; + }, + }; + }, + }); + } + } + } + + return clock; + } + + /* eslint-enable complexity */ + + return { + timers: timers, + createClock: createClock, + install: install, + withGlobal: withGlobal, + }; +} + +/** + * @typedef {object} FakeTimers + * @property {Timers} timers + * @property {createClock} createClock + * @property {Function} install + * @property {withGlobal} withGlobal + */ + +/* eslint-enable complexity */ + +/** @type {FakeTimers} */ +const defaultImplementation = withGlobal(globalObject); + +exports.timers = defaultImplementation.timers; +exports.createClock = defaultImplementation.createClock; +exports.install = defaultImplementation.install; +exports.withGlobal = withGlobal; + +},{"@sinonjs/commons":46,"timers":undefined,"timers/promises":undefined,"util":90}],60:[function(require,module,exports){ +"use strict"; + +var ARRAY_TYPES = [ + Array, + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, +]; + +module.exports = ARRAY_TYPES; + +},{}],61:[function(require,module,exports){ +"use strict"; + +var arrayProto = require("@sinonjs/commons").prototypes.array; +var deepEqual = require("./deep-equal").use(createMatcher); // eslint-disable-line no-use-before-define +var every = require("@sinonjs/commons").every; +var functionName = require("@sinonjs/commons").functionName; +var get = require("lodash.get"); +var iterableToString = require("./iterable-to-string"); +var objectProto = require("@sinonjs/commons").prototypes.object; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var assertMatcher = require("./create-matcher/assert-matcher"); +var assertMethodExists = require("./create-matcher/assert-method-exists"); +var assertType = require("./create-matcher/assert-type"); +var isIterable = require("./create-matcher/is-iterable"); +var isMatcher = require("./create-matcher/is-matcher"); + +var matcherPrototype = require("./create-matcher/matcher-prototype"); + +var arrayIndexOf = arrayProto.indexOf; +var some = arrayProto.some; + +var hasOwnProperty = objectProto.hasOwnProperty; +var objectToString = objectProto.toString; + +var TYPE_MAP = require("./create-matcher/type-map")(createMatcher); // eslint-disable-line no-use-before-define + +/** + * Creates a matcher object for the passed expectation + * + * @alias module:samsam.createMatcher + * @param {*} expectation An expecttation + * @param {string} message A message for the expectation + * @returns {object} A matcher object + */ +function createMatcher(expectation, message) { + var m = Object.create(matcherPrototype); + var type = typeOf(expectation); + + if (message !== undefined && typeof message !== "string") { + throw new TypeError("Message should be a string"); + } + + if (arguments.length > 2) { + throw new TypeError( + `Expected 1 or 2 arguments, received ${arguments.length}`, + ); + } + + if (type in TYPE_MAP) { + TYPE_MAP[type](m, expectation, message); + } else { + m.test = function (actual) { + return deepEqual(actual, expectation); + }; + } + + if (!m.message) { + m.message = `match(${valueToString(expectation)})`; + } + + // ensure that nothing mutates the exported message value, ref https://github.com/sinonjs/sinon/issues/2502 + Object.defineProperty(m, "message", { + configurable: false, + writable: false, + value: m.message, + }); + + return m; +} + +createMatcher.isMatcher = isMatcher; + +createMatcher.any = createMatcher(function () { + return true; +}, "any"); + +createMatcher.defined = createMatcher(function (actual) { + return actual !== null && actual !== undefined; +}, "defined"); + +createMatcher.truthy = createMatcher(function (actual) { + return Boolean(actual); +}, "truthy"); + +createMatcher.falsy = createMatcher(function (actual) { + return !actual; +}, "falsy"); + +createMatcher.same = function (expectation) { + return createMatcher( + function (actual) { + return expectation === actual; + }, + `same(${valueToString(expectation)})`, + ); +}; + +createMatcher.in = function (arrayOfExpectations) { + if (typeOf(arrayOfExpectations) !== "array") { + throw new TypeError("array expected"); + } + + return createMatcher( + function (actual) { + return some(arrayOfExpectations, function (expectation) { + return expectation === actual; + }); + }, + `in(${valueToString(arrayOfExpectations)})`, + ); +}; + +createMatcher.typeOf = function (type) { + assertType(type, "string", "type"); + return createMatcher(function (actual) { + return typeOf(actual) === type; + }, `typeOf("${type}")`); +}; + +createMatcher.instanceOf = function (type) { + /* istanbul ignore if */ + if ( + typeof Symbol === "undefined" || + typeof Symbol.hasInstance === "undefined" + ) { + assertType(type, "function", "type"); + } else { + assertMethodExists( + type, + Symbol.hasInstance, + "type", + "[Symbol.hasInstance]", + ); + } + return createMatcher( + function (actual) { + return actual instanceof type; + }, + `instanceOf(${functionName(type) || objectToString(type)})`, + ); +}; + +/** + * Creates a property matcher + * + * @private + * @param {Function} propertyTest A function to test the property against a value + * @param {string} messagePrefix A prefix to use for messages generated by the matcher + * @returns {object} A matcher + */ +function createPropertyMatcher(propertyTest, messagePrefix) { + return function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `${messagePrefix}("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + if ( + actual === undefined || + actual === null || + !propertyTest(actual, property) + ) { + return false; + } + return onlyProperty || deepEqual(actual[property], value); + }, message); + }; +} + +createMatcher.has = createPropertyMatcher(function (actual, property) { + if (typeof actual === "object") { + return property in actual; + } + return actual[property] !== undefined; +}, "has"); + +createMatcher.hasOwn = createPropertyMatcher(function (actual, property) { + return hasOwnProperty(actual, property); +}, "hasOwn"); + +createMatcher.hasNested = function (property, value) { + assertType(property, "string", "property"); + var onlyProperty = arguments.length === 1; + var message = `hasNested("${property}"`; + if (!onlyProperty) { + message += `, ${valueToString(value)}`; + } + message += ")"; + return createMatcher(function (actual) { + if ( + actual === undefined || + actual === null || + get(actual, property) === undefined + ) { + return false; + } + return onlyProperty || deepEqual(get(actual, property), value); + }, message); +}; + +var jsonParseResultTypes = { + null: true, + boolean: true, + number: true, + string: true, + object: true, + array: true, +}; +createMatcher.json = function (value) { + if (!jsonParseResultTypes[typeOf(value)]) { + throw new TypeError("Value cannot be the result of JSON.parse"); + } + var message = `json(${JSON.stringify(value, null, " ")})`; + return createMatcher(function (actual) { + var parsed; + try { + parsed = JSON.parse(actual); + } catch (e) { + return false; + } + return deepEqual(parsed, value); + }, message); +}; + +createMatcher.every = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return every(Object.keys(actual), function (key) { + return predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + every(actual, function (element) { + return predicate.test(element); + }) + ); + }, `every(${predicate.message})`); +}; + +createMatcher.some = function (predicate) { + assertMatcher(predicate); + + return createMatcher(function (actual) { + if (typeOf(actual) === "object") { + return !every(Object.keys(actual), function (key) { + return !predicate.test(actual[key]); + }); + } + + return ( + isIterable(actual) && + !every(actual, function (element) { + return !predicate.test(element); + }) + ); + }, `some(${predicate.message})`); +}; + +createMatcher.array = createMatcher.typeOf("array"); + +createMatcher.array.deepEquals = function (expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.length === expectation.length; + return ( + typeOf(actual) === "array" && + sameLength && + every(actual, function (element, index) { + var expected = expectation[index]; + return typeOf(expected) === "array" && + typeOf(element) === "array" + ? createMatcher.array.deepEquals(expected).test(element) + : deepEqual(expected, element); + }) + ); + }, + `deepEquals([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.startsWith = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[index] === expectedElement; + }) + ); + }, + `startsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.endsWith = function (expectation) { + return createMatcher( + function (actual) { + // This indicates the index in which we should start matching + var offset = actual.length - expectation.length; + + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement, index) { + return actual[offset + index] === expectedElement; + }) + ); + }, + `endsWith([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.array.contains = function (expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "array" && + every(expectation, function (expectedElement) { + return arrayIndexOf(actual, expectedElement) !== -1; + }) + ); + }, + `contains([${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map = createMatcher.typeOf("map"); + +createMatcher.map.deepEquals = function mapDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "map" && + sameLength && + every(actual, function (element, key) { + return ( + expectation.has(key) && expectation.get(key) === element + ); + }) + ); + }, + `deepEquals(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.map.contains = function mapContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "map" && + every(expectation, function (element, key) { + return actual.has(key) && actual.get(key) === element; + }) + ); + }, + `contains(Map[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set = createMatcher.typeOf("set"); + +createMatcher.set.deepEquals = function setDeepEquals(expectation) { + return createMatcher( + function (actual) { + // Comparing lengths is the fastest way to spot a difference before iterating through every item + var sameLength = actual.size === expectation.size; + return ( + typeOf(actual) === "set" && + sameLength && + every(actual, function (element) { + return expectation.has(element); + }) + ); + }, + `deepEquals(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.set.contains = function setContains(expectation) { + return createMatcher( + function (actual) { + return ( + typeOf(actual) === "set" && + every(expectation, function (element) { + return actual.has(element); + }) + ); + }, + `contains(Set[${iterableToString(expectation)}])`, + ); +}; + +createMatcher.bool = createMatcher.typeOf("boolean"); +createMatcher.number = createMatcher.typeOf("number"); +createMatcher.string = createMatcher.typeOf("string"); +createMatcher.object = createMatcher.typeOf("object"); +createMatcher.func = createMatcher.typeOf("function"); +createMatcher.regexp = createMatcher.typeOf("regexp"); +createMatcher.date = createMatcher.typeOf("date"); +createMatcher.symbol = createMatcher.typeOf("symbol"); + +module.exports = createMatcher; + +},{"./create-matcher/assert-matcher":62,"./create-matcher/assert-method-exists":63,"./create-matcher/assert-type":64,"./create-matcher/is-iterable":65,"./create-matcher/is-matcher":66,"./create-matcher/matcher-prototype":68,"./create-matcher/type-map":69,"./deep-equal":70,"./iterable-to-string":84,"@sinonjs/commons":46,"lodash.get":92}],62:[function(require,module,exports){ +"use strict"; + +var isMatcher = require("./is-matcher"); + +/** + * Throws a TypeError when `value` is not a matcher + * + * @private + * @param {*} value The value to examine + */ +function assertMatcher(value) { + if (!isMatcher(value)) { + throw new TypeError("Matcher expected"); + } +} + +module.exports = assertMatcher; + +},{"./is-matcher":66}],63:[function(require,module,exports){ +"use strict"; + +/** + * Throws a TypeError when expected method doesn't exist + * + * @private + * @param {*} value A value to examine + * @param {string} method The name of the method to look for + * @param {name} name A name to use for the error message + * @param {string} methodPath The name of the method to use for error messages + * @throws {TypeError} When the method doesn't exist + */ +function assertMethodExists(value, method, name, methodPath) { + if (value[method] === null || value[method] === undefined) { + throw new TypeError(`Expected ${name} to have method ${methodPath}`); + } +} + +module.exports = assertMethodExists; + +},{}],64:[function(require,module,exports){ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Ensures that value is of type + * + * @private + * @param {*} value A value to examine + * @param {string} type A basic JavaScript type to compare to, e.g. "object", "string" + * @param {string} name A string to use for the error message + * @throws {TypeError} If value is not of the expected type + * @returns {undefined} + */ +function assertType(value, type, name) { + var actual = typeOf(value); + if (actual !== type) { + throw new TypeError( + `Expected type of ${name} to be ${type}, but was ${actual}`, + ); + } +} + +module.exports = assertType; + +},{"@sinonjs/commons":46}],65:[function(require,module,exports){ +"use strict"; + +var typeOf = require("@sinonjs/commons").typeOf; + +/** + * Returns `true` for iterables + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` looks like an iterable + */ +function isIterable(value) { + return Boolean(value) && typeOf(value.forEach) === "function"; +} + +module.exports = isIterable; + +},{"@sinonjs/commons":46}],66:[function(require,module,exports){ +"use strict"; + +var isPrototypeOf = require("@sinonjs/commons").prototypes.object.isPrototypeOf; + +var matcherPrototype = require("./matcher-prototype"); + +/** + * Returns `true` when `object` is a matcher + * + * @private + * @param {*} object A value to examine + * @returns {boolean} Returns `true` when `object` is a matcher + */ +function isMatcher(object) { + return isPrototypeOf(matcherPrototype, object); +} + +module.exports = isMatcher; + +},{"./matcher-prototype":68,"@sinonjs/commons":46}],67:[function(require,module,exports){ +"use strict"; + +var every = require("@sinonjs/commons").prototypes.array.every; +var concat = require("@sinonjs/commons").prototypes.array.concat; +var typeOf = require("@sinonjs/commons").typeOf; + +var deepEqualFactory = require("../deep-equal").use; + +var identical = require("../identical"); +var isMatcher = require("./is-matcher"); + +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Matches `actual` with `expectation` + * + * @private + * @param {*} actual A value to examine + * @param {object} expectation An object with properties to match on + * @param {object} matcher A matcher to use for comparison + * @returns {boolean} Returns true when `actual` matches all properties in `expectation` + */ +function matchObject(actual, expectation, matcher) { + var deepEqual = deepEqualFactory(matcher); + if (actual === null || actual === undefined) { + return false; + } + + var expectedKeys = keys(expectation); + /* istanbul ignore else: cannot collect coverage for engine that doesn't support Symbol */ + if (typeOf(getOwnPropertySymbols) === "function") { + expectedKeys = concat(expectedKeys, getOwnPropertySymbols(expectation)); + } + + return every(expectedKeys, function (key) { + var exp = expectation[key]; + var act = actual[key]; + + if (isMatcher(exp)) { + if (!exp.test(act)) { + return false; + } + } else if (typeOf(exp) === "object") { + if (identical(exp, act)) { + return true; + } + if (!matchObject(act, exp, matcher)) { + return false; + } + } else if (!deepEqual(act, exp)) { + return false; + } + + return true; + }); +} + +module.exports = matchObject; + +},{"../deep-equal":70,"../identical":72,"./is-matcher":66,"@sinonjs/commons":46}],68:[function(require,module,exports){ +"use strict"; + +var matcherPrototype = { + toString: function () { + return this.message; + }, +}; + +matcherPrototype.or = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var or = Object.create(matcherPrototype); + or.test = function (actual) { + return m1.test(actual) || m2.test(actual); + }; + or.message = `${m1.message}.or(${m2.message})`; + return or; +}; + +matcherPrototype.and = function (valueOrMatcher) { + var createMatcher = require("../create-matcher"); + var isMatcher = createMatcher.isMatcher; + + if (!arguments.length) { + throw new TypeError("Matcher expected"); + } + + var m2 = isMatcher(valueOrMatcher) + ? valueOrMatcher + : createMatcher(valueOrMatcher); + var m1 = this; + var and = Object.create(matcherPrototype); + and.test = function (actual) { + return m1.test(actual) && m2.test(actual); + }; + and.message = `${m1.message}.and(${m2.message})`; + return and; +}; + +module.exports = matcherPrototype; + +},{"../create-matcher":61}],69:[function(require,module,exports){ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var join = require("@sinonjs/commons").prototypes.array.join; +var map = require("@sinonjs/commons").prototypes.array.map; +var stringIndexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var valueToString = require("@sinonjs/commons").valueToString; + +var matchObject = require("./match-object"); + +var createTypeMap = function (match) { + return { + function: function (m, expectation, message) { + m.test = expectation; + m.message = message || `match(${functionName(expectation)})`; + }, + number: function (m, expectation) { + m.test = function (actual) { + // we need type coercion here + return expectation == actual; // eslint-disable-line eqeqeq + }; + }, + object: function (m, expectation) { + var array = []; + + if (typeof expectation.test === "function") { + m.test = function (actual) { + return expectation.test(actual) === true; + }; + m.message = `match(${functionName(expectation.test)})`; + return m; + } + + array = map(Object.keys(expectation), function (key) { + return `${key}: ${valueToString(expectation[key])}`; + }); + + m.test = function (actual) { + return matchObject(actual, expectation, match); + }; + m.message = `match(${join(array, ", ")})`; + + return m; + }, + regexp: function (m, expectation) { + m.test = function (actual) { + return typeof actual === "string" && expectation.test(actual); + }; + }, + string: function (m, expectation) { + m.test = function (actual) { + return ( + typeof actual === "string" && + stringIndexOf(actual, expectation) !== -1 + ); + }; + m.message = `match("${expectation}")`; + }, + }; +}; + +module.exports = createTypeMap; + +},{"./match-object":67,"@sinonjs/commons":46}],70:[function(require,module,exports){ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var className = require("@sinonjs/commons").className; +var typeOf = require("@sinonjs/commons").typeOf; +var arrayProto = require("@sinonjs/commons").prototypes.array; +var objectProto = require("@sinonjs/commons").prototypes.object; +var mapForEach = require("@sinonjs/commons").prototypes.map.forEach; + +var getClass = require("./get-class"); +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isArrayType = require("./is-array-type"); +var isDate = require("./is-date"); +var isElement = require("./is-element"); +var isIterable = require("./is-iterable"); +var isMap = require("./is-map"); +var isNaN = require("./is-nan"); +var isObject = require("./is-object"); +var isSet = require("./is-set"); +var isSubset = require("./is-subset"); + +var concat = arrayProto.concat; +var every = arrayProto.every; +var push = arrayProto.push; + +var getTime = Date.prototype.getTime; +var hasOwnProperty = objectProto.hasOwnProperty; +var indexOf = arrayProto.indexOf; +var keys = Object.keys; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Deep equal comparison. Two values are "deep equal" when: + * + * - They are equal, according to samsam.identical + * - They are both date objects representing the same time + * - They are both arrays containing elements that are all deepEqual + * - They are objects with the same set of properties, and each property + * in ``actual`` is deepEqual to the corresponding property in ``expectation`` + * + * Supports cyclic objects. + * + * @alias module:samsam.deepEqual + * @param {*} actual The object to examine + * @param {*} expectation The object actual is expected to be equal to + * @param {object} match A value to match on + * @returns {boolean} Returns true when actual and expectation are considered equal + */ +function deepEqualCyclic(actual, expectation, match) { + // used for cyclic comparison + // contain already visited objects + var actualObjects = []; + var expectationObjects = []; + // contain pathes (position in the object structure) + // of the already visited objects + // indexes same as in objects arrays + var actualPaths = []; + var expectationPaths = []; + // contains combinations of already compared objects + // in the manner: { "$1['ref']$2['ref']": true } + var compared = {}; + + // does the recursion for the deep equal check + // eslint-disable-next-line complexity + return (function deepEqual( + actualObj, + expectationObj, + actualPath, + expectationPath, + ) { + // If both are matchers they must be the same instance in order to be + // considered equal If we didn't do that we would end up running one + // matcher against the other + if (match && match.isMatcher(expectationObj)) { + if (match.isMatcher(actualObj)) { + return actualObj === expectationObj; + } + return expectationObj.test(actualObj); + } + + var actualType = typeof actualObj; + var expectationType = typeof expectationObj; + + if ( + actualObj === expectationObj || + isNaN(actualObj) || + isNaN(expectationObj) || + actualObj === null || + expectationObj === null || + actualObj === undefined || + expectationObj === undefined || + actualType !== "object" || + expectationType !== "object" + ) { + return identical(actualObj, expectationObj); + } + + // Elements are only equal if identical(expected, actual) + if (isElement(actualObj) || isElement(expectationObj)) { + return false; + } + + var isActualDate = isDate(actualObj); + var isExpectationDate = isDate(expectationObj); + if (isActualDate || isExpectationDate) { + if ( + !isActualDate || + !isExpectationDate || + getTime.call(actualObj) !== getTime.call(expectationObj) + ) { + return false; + } + } + + if (actualObj instanceof RegExp && expectationObj instanceof RegExp) { + if (valueToString(actualObj) !== valueToString(expectationObj)) { + return false; + } + } + + if (actualObj instanceof Promise && expectationObj instanceof Promise) { + return actualObj === expectationObj; + } + + if (actualObj instanceof Error && expectationObj instanceof Error) { + return actualObj === expectationObj; + } + + var actualClass = getClass(actualObj); + var expectationClass = getClass(expectationObj); + var actualKeys = keys(actualObj); + var expectationKeys = keys(expectationObj); + var actualName = className(actualObj); + var expectationName = className(expectationObj); + var expectationSymbols = + typeOf(getOwnPropertySymbols) === "function" + ? getOwnPropertySymbols(expectationObj) + : /* istanbul ignore next: cannot collect coverage for engine that doesn't support Symbol */ + []; + var expectationKeysAndSymbols = concat( + expectationKeys, + expectationSymbols, + ); + + if (isArguments(actualObj) || isArguments(expectationObj)) { + if (actualObj.length !== expectationObj.length) { + return false; + } + } else { + if ( + actualType !== expectationType || + actualClass !== expectationClass || + actualKeys.length !== expectationKeys.length || + (actualName && + expectationName && + actualName !== expectationName) + ) { + return false; + } + } + + if (isSet(actualObj) || isSet(expectationObj)) { + if ( + !isSet(actualObj) || + !isSet(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + return isSubset(actualObj, expectationObj, deepEqual); + } + + if (isMap(actualObj) || isMap(expectationObj)) { + if ( + !isMap(actualObj) || + !isMap(expectationObj) || + actualObj.size !== expectationObj.size + ) { + return false; + } + + var mapsDeeplyEqual = true; + mapForEach(actualObj, function (value, key) { + mapsDeeplyEqual = + mapsDeeplyEqual && + deepEqualCyclic(value, expectationObj.get(key)); + }); + + return mapsDeeplyEqual; + } + + // jQuery objects have iteration protocols + // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + // But, they don't work well with the implementation concerning iterables below, + // so we will detect them and use jQuery's own equality function + /* istanbul ignore next -- this can only be tested in the `test-headless` script */ + if ( + actualObj.constructor && + actualObj.constructor.name === "jQuery" && + typeof actualObj.is === "function" + ) { + return actualObj.is(expectationObj); + } + + var isActualNonArrayIterable = + isIterable(actualObj) && + !isArrayType(actualObj) && + !isArguments(actualObj); + var isExpectationNonArrayIterable = + isIterable(expectationObj) && + !isArrayType(expectationObj) && + !isArguments(expectationObj); + if (isActualNonArrayIterable || isExpectationNonArrayIterable) { + var actualArray = Array.from(actualObj); + var expectationArray = Array.from(expectationObj); + if (actualArray.length !== expectationArray.length) { + return false; + } + + var arrayDeeplyEquals = true; + every(actualArray, function (key) { + arrayDeeplyEquals = + arrayDeeplyEquals && + deepEqualCyclic(actualArray[key], expectationArray[key]); + }); + + return arrayDeeplyEquals; + } + + return every(expectationKeysAndSymbols, function (key) { + if (!hasOwnProperty(actualObj, key)) { + return false; + } + + var actualValue = actualObj[key]; + var expectationValue = expectationObj[key]; + var actualObject = isObject(actualValue); + var expectationObject = isObject(expectationValue); + // determines, if the objects were already visited + // (it's faster to check for isObject first, than to + // get -1 from getIndex for non objects) + var actualIndex = actualObject + ? indexOf(actualObjects, actualValue) + : -1; + var expectationIndex = expectationObject + ? indexOf(expectationObjects, expectationValue) + : -1; + // determines the new paths of the objects + // - for non cyclic objects the current path will be extended + // by current property name + // - for cyclic objects the stored path is taken + var newActualPath = + actualIndex !== -1 + ? actualPaths[actualIndex] + : `${actualPath}[${JSON.stringify(key)}]`; + var newExpectationPath = + expectationIndex !== -1 + ? expectationPaths[expectationIndex] + : `${expectationPath}[${JSON.stringify(key)}]`; + var combinedPath = newActualPath + newExpectationPath; + + // stop recursion if current objects are already compared + if (compared[combinedPath]) { + return true; + } + + // remember the current objects and their paths + if (actualIndex === -1 && actualObject) { + push(actualObjects, actualValue); + push(actualPaths, newActualPath); + } + if (expectationIndex === -1 && expectationObject) { + push(expectationObjects, expectationValue); + push(expectationPaths, newExpectationPath); + } + + // remember that the current objects are already compared + if (actualObject && expectationObject) { + compared[combinedPath] = true; + } + + // End of cyclic logic + + // neither actualValue nor expectationValue is a cycle + // continue with next level + return deepEqual( + actualValue, + expectationValue, + newActualPath, + newExpectationPath, + ); + }); + })(actual, expectation, "$1", "$2"); +} + +deepEqualCyclic.use = function (match) { + return function deepEqual(a, b) { + return deepEqualCyclic(a, b, match); + }; +}; + +module.exports = deepEqualCyclic; + +},{"./get-class":71,"./identical":72,"./is-arguments":73,"./is-array-type":74,"./is-date":75,"./is-element":76,"./is-iterable":77,"./is-map":78,"./is-nan":79,"./is-object":81,"./is-set":82,"./is-subset":83,"@sinonjs/commons":46}],71:[function(require,module,exports){ +"use strict"; + +var toString = require("@sinonjs/commons").prototypes.object.toString; + +/** + * Returns the internal `Class` by calling `Object.prototype.toString` + * with the provided value as `this`. Return value is a `String`, naming the + * internal class, e.g. "Array" + * + * @private + * @param {*} value - Any value + * @returns {string} - A string representation of the `Class` of `value` + */ +function getClass(value) { + return toString(value).split(/[ \]]/)[1]; +} + +module.exports = getClass; + +},{"@sinonjs/commons":46}],72:[function(require,module,exports){ +"use strict"; + +var isNaN = require("./is-nan"); +var isNegZero = require("./is-neg-zero"); + +/** + * Strict equality check according to EcmaScript Harmony's `egal`. + * + * **From the Harmony wiki:** + * > An `egal` function simply makes available the internal `SameValue` function + * > from section 9.12 of the ES5 spec. If two values are egal, then they are not + * > observably distinguishable. + * + * `identical` returns `true` when `===` is `true`, except for `-0` and + * `+0`, where it returns `false`. Additionally, it returns `true` when + * `NaN` is compared to itself. + * + * @alias module:samsam.identical + * @param {*} obj1 The first value to compare + * @param {*} obj2 The second value to compare + * @returns {boolean} Returns `true` when the objects are *egal*, `false` otherwise + */ +function identical(obj1, obj2) { + if (obj1 === obj2 || (isNaN(obj1) && isNaN(obj2))) { + return obj1 !== 0 || isNegZero(obj1) === isNegZero(obj2); + } + + return false; +} + +module.exports = identical; + +},{"./is-nan":79,"./is-neg-zero":80}],73:[function(require,module,exports){ +"use strict"; + +var getClass = require("./get-class"); + +/** + * Returns `true` when `object` is an `arguments` object, `false` otherwise + * + * @alias module:samsam.isArguments + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an `arguments` object + */ +function isArguments(object) { + return getClass(object) === "Arguments"; +} + +module.exports = isArguments; + +},{"./get-class":71}],74:[function(require,module,exports){ +"use strict"; + +var functionName = require("@sinonjs/commons").functionName; +var indexOf = require("@sinonjs/commons").prototypes.array.indexOf; +var map = require("@sinonjs/commons").prototypes.array.map; +var ARRAY_TYPES = require("./array-types"); +var type = require("type-detect"); + +/** + * Returns `true` when `object` is an array type, `false` otherwise + * + * @param {*} object - The object to examine + * @returns {boolean} `true` when `object` is an array type + * @private + */ +function isArrayType(object) { + return indexOf(map(ARRAY_TYPES, functionName), type(object)) !== -1; +} + +module.exports = isArrayType; + +},{"./array-types":60,"@sinonjs/commons":46,"type-detect":87}],75:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is an instance of Date + * + * @private + * @param {Date} value The value to examine + * @returns {boolean} `true` when `value` is an instance of Date + */ +function isDate(value) { + return value instanceof Date; +} + +module.exports = isDate; + +},{}],76:[function(require,module,exports){ +"use strict"; + +var div = typeof document !== "undefined" && document.createElement("div"); + +/** + * Returns `true` when `object` is a DOM element node. + * + * Unlike Underscore.js/lodash, this function will return `false` if `object` + * is an *element-like* object, i.e. a regular object with a `nodeType` + * property that holds the value `1`. + * + * @alias module:samsam.isElement + * @param {object} object The object to examine + * @returns {boolean} Returns `true` for DOM element nodes + */ +function isElement(object) { + if (!object || object.nodeType !== 1 || !div) { + return false; + } + try { + object.appendChild(div); + object.removeChild(div); + } catch (e) { + return false; + } + return true; +} + +module.exports = isElement; + +},{}],77:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the argument is an iterable, `false` otherwise + * + * @alias module:samsam.isIterable + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an iterable, `false` otherwise + */ +function isIterable(val) { + // checks for null and undefined + if (typeof val !== "object") { + return false; + } + return typeof val[Symbol.iterator] === "function"; +} + +module.exports = isIterable; + +},{}],78:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is a Map + * + * @param {*} value A value to examine + * @returns {boolean} `true` when `value` is an instance of `Map`, `false` otherwise + * @private + */ +function isMap(value) { + return typeof Map !== "undefined" && value instanceof Map; +} + +module.exports = isMap; + +},{}],79:[function(require,module,exports){ +"use strict"; + +/** + * Compares a `value` to `NaN` + * + * @private + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `NaN` + */ +function isNaN(value) { + // Unlike global `isNaN`, this function avoids type coercion + // `typeof` check avoids IE host object issues, hat tip to + // lodash + + // eslint-disable-next-line no-self-compare + return typeof value === "number" && value !== value; +} + +module.exports = isNaN; + +},{}],80:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when `value` is `-0` + * + * @alias module:samsam.isNegZero + * @param {*} value A value to examine + * @returns {boolean} Returns `true` when `value` is `-0` + */ +function isNegZero(value) { + return value === 0 && 1 / value === -Infinity; +} + +module.exports = isNegZero; + +},{}],81:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the value is a regular Object and not a specialized Object + * + * This helps speed up deepEqual cyclic checks + * + * The premise is that only Objects are stored in the visited array. + * So if this function returns false, we don't have to do the + * expensive operation of searching for the value in the the array of already + * visited objects + * + * @private + * @param {object} value The object to examine + * @returns {boolean} `true` when the object is a non-specialised object + */ +function isObject(value) { + return ( + typeof value === "object" && + value !== null && + // none of these are collection objects, so we can return false + !(value instanceof Boolean) && + !(value instanceof Date) && + !(value instanceof Error) && + !(value instanceof Number) && + !(value instanceof RegExp) && + !(value instanceof String) + ); +} + +module.exports = isObject; + +},{}],82:[function(require,module,exports){ +"use strict"; + +/** + * Returns `true` when the argument is an instance of Set, `false` otherwise + * + * @alias module:samsam.isSet + * @param {*} val - A value to examine + * @returns {boolean} Returns `true` when the argument is an instance of Set, `false` otherwise + */ +function isSet(val) { + return (typeof Set !== "undefined" && val instanceof Set) || false; +} + +module.exports = isSet; + +},{}],83:[function(require,module,exports){ +"use strict"; + +var forEach = require("@sinonjs/commons").prototypes.set.forEach; + +/** + * Returns `true` when `s1` is a subset of `s2`, `false` otherwise + * + * @private + * @param {Array|Set} s1 The target value + * @param {Array|Set} s2 The containing value + * @param {Function} compare A comparison function, should return `true` when + * values are considered equal + * @returns {boolean} Returns `true` when `s1` is a subset of `s2`, `false`` otherwise + */ +function isSubset(s1, s2, compare) { + var allContained = true; + forEach(s1, function (v1) { + var includes = false; + forEach(s2, function (v2) { + if (compare(v2, v1)) { + includes = true; + } + }); + allContained = allContained && includes; + }); + + return allContained; +} + +module.exports = isSubset; + +},{"@sinonjs/commons":46}],84:[function(require,module,exports){ +"use strict"; + +var slice = require("@sinonjs/commons").prototypes.string.slice; +var typeOf = require("@sinonjs/commons").typeOf; +var valueToString = require("@sinonjs/commons").valueToString; + +/** + * Creates a string represenation of an iterable object + * + * @private + * @param {object} obj The iterable object to stringify + * @returns {string} A string representation + */ +function iterableToString(obj) { + if (typeOf(obj) === "map") { + return mapToString(obj); + } + + return genericIterableToString(obj); +} + +/** + * Creates a string representation of a Map + * + * @private + * @param {Map} map The map to stringify + * @returns {string} A string representation + */ +function mapToString(map) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + map.forEach(function (value, key) { + representation += `[${stringify(key)},${stringify(value)}],`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Create a string represenation for an iterable + * + * @private + * @param {object} iterable The iterable to stringify + * @returns {string} A string representation + */ +function genericIterableToString(iterable) { + var representation = ""; + + // eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods + iterable.forEach(function (value) { + representation += `${stringify(value)},`; + }); + + representation = slice(representation, 0, -1); + return representation; +} + +/** + * Creates a string representation of the passed `item` + * + * @private + * @param {object} item The item to stringify + * @returns {string} A string representation of `item` + */ +function stringify(item) { + return typeof item === "string" ? `'${item}'` : valueToString(item); +} + +module.exports = iterableToString; + +},{"@sinonjs/commons":46}],85:[function(require,module,exports){ +"use strict"; + +var valueToString = require("@sinonjs/commons").valueToString; +var indexOf = require("@sinonjs/commons").prototypes.string.indexOf; +var forEach = require("@sinonjs/commons").prototypes.array.forEach; +var type = require("type-detect"); + +var engineCanCompareMaps = typeof Array.from === "function"; +var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define +var isArrayType = require("./is-array-type"); +var isSubset = require("./is-subset"); +var createMatcher = require("./create-matcher"); + +/** + * Returns true when `array` contains all of `subset` as defined by the `compare` + * argument + * + * @param {Array} array An array to search for a subset + * @param {Array} subset The subset to find in the array + * @param {Function} compare A comparison function + * @returns {boolean} [description] + * @private + */ +function arrayContains(array, subset, compare) { + if (subset.length === 0) { + return true; + } + var i, l, j, k; + for (i = 0, l = array.length; i < l; ++i) { + if (compare(array[i], subset[0])) { + for (j = 0, k = subset.length; j < k; ++j) { + if (i + j >= l) { + return false; + } + if (!compare(array[i + j], subset[j])) { + return false; + } + } + return true; + } + } + return false; +} + +/* eslint-disable complexity */ +/** + * Matches an object with a matcher (or value) + * + * @alias module:samsam.match + * @param {object} object The object candidate to match + * @param {object} matcherOrValue A matcher or value to match against + * @returns {boolean} true when `object` matches `matcherOrValue` + */ +function match(object, matcherOrValue) { + if (matcherOrValue && typeof matcherOrValue.test === "function") { + return matcherOrValue.test(object); + } + + switch (type(matcherOrValue)) { + case "bigint": + case "boolean": + case "number": + case "symbol": + return matcherOrValue === object; + case "function": + return matcherOrValue(object) === true; + case "string": + var notNull = typeof object === "string" || Boolean(object); + return ( + notNull && + indexOf( + valueToString(object).toLowerCase(), + matcherOrValue.toLowerCase(), + ) >= 0 + ); + case "null": + return object === null; + case "undefined": + return typeof object === "undefined"; + case "Date": + /* istanbul ignore else */ + if (type(object) === "Date") { + return object.getTime() === matcherOrValue.getTime(); + } + /* istanbul ignore next: this is basically the rest of the function, which is covered */ + break; + case "Array": + case "Int8Array": + case "Uint8Array": + case "Uint8ClampedArray": + case "Int16Array": + case "Uint16Array": + case "Int32Array": + case "Uint32Array": + case "Float32Array": + case "Float64Array": + return ( + isArrayType(matcherOrValue) && + arrayContains(object, matcherOrValue, match) + ); + case "Map": + /* istanbul ignore next: this is covered by a test, that is only run in IE, but we collect coverage information in node*/ + if (!engineCanCompareMaps) { + throw new Error( + "The JavaScript engine does not support Array.from and cannot reliably do value comparison of Map instances", + ); + } + + return ( + type(object) === "Map" && + arrayContains( + Array.from(object), + Array.from(matcherOrValue), + match, + ) + ); + default: + break; + } + + switch (type(object)) { + case "null": + return false; + case "Set": + return isSubset(matcherOrValue, object, match); + default: + break; + } + + /* istanbul ignore else */ + if (matcherOrValue && typeof matcherOrValue === "object") { + if (matcherOrValue === object) { + return true; + } + if (typeof object !== "object") { + return false; + } + var prop; + // eslint-disable-next-line guard-for-in + for (prop in matcherOrValue) { + var value = object[prop]; + if ( + typeof value === "undefined" && + typeof object.getAttribute === "function" + ) { + value = object.getAttribute(prop); + } + if ( + matcherOrValue[prop] === null || + typeof matcherOrValue[prop] === "undefined" + ) { + if (value !== matcherOrValue[prop]) { + return false; + } + } else if ( + typeof value === "undefined" || + !deepEqual(value, matcherOrValue[prop]) + ) { + return false; + } + } + return true; + } + + /* istanbul ignore next */ + throw new Error("Matcher was an unknown or unsupported type"); +} +/* eslint-enable complexity */ + +forEach(Object.keys(createMatcher), function (key) { + match[key] = createMatcher[key]; +}); + +module.exports = match; + +},{"./create-matcher":61,"./deep-equal":70,"./is-array-type":74,"./is-subset":83,"@sinonjs/commons":46,"type-detect":87}],86:[function(require,module,exports){ +"use strict"; + +/** + * @module samsam + */ +var identical = require("./identical"); +var isArguments = require("./is-arguments"); +var isElement = require("./is-element"); +var isNegZero = require("./is-neg-zero"); +var isSet = require("./is-set"); +var isMap = require("./is-map"); +var match = require("./match"); +var deepEqualCyclic = require("./deep-equal").use(match); +var createMatcher = require("./create-matcher"); + +module.exports = { + createMatcher: createMatcher, + deepEqual: deepEqualCyclic, + identical: identical, + isArguments: isArguments, + isElement: isElement, + isMap: isMap, + isNegZero: isNegZero, + isSet: isSet, + match: match, +}; + +},{"./create-matcher":61,"./deep-equal":70,"./identical":72,"./is-arguments":73,"./is-element":76,"./is-map":78,"./is-neg-zero":80,"./is-set":82,"./match":85}],87:[function(require,module,exports){ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.typeDetect = factory()); +})(this, (function () { 'use strict'; + + var promiseExists = typeof Promise === 'function'; + var globalObject = (function (Obj) { + if (typeof globalThis === 'object') { + return globalThis; + } + Object.defineProperty(Obj, 'typeDetectGlobalObject', { + get: function get() { + return this; + }, + configurable: true, + }); + var global = typeDetectGlobalObject; + delete Obj.typeDetectGlobalObject; + return global; + })(Object.prototype); + var symbolExists = typeof Symbol !== 'undefined'; + var mapExists = typeof Map !== 'undefined'; + var setExists = typeof Set !== 'undefined'; + var weakMapExists = typeof WeakMap !== 'undefined'; + var weakSetExists = typeof WeakSet !== 'undefined'; + var dataViewExists = typeof DataView !== 'undefined'; + var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; + var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; + var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; + var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; + var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); + var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); + var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; + var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); + var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; + var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); + var toStringLeftSliceLength = 8; + var toStringRightSliceLength = -1; + function typeDetect(obj) { + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + if (obj === null) { + return 'null'; + } + if (obj === globalObject) { + return 'global'; + } + if (Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) { + return 'Array'; + } + if (typeof window === 'object' && window !== null) { + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + if (typeof window.navigator === 'object') { + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + var objPrototype = Object.getPrototypeOf(obj); + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + if (objPrototype === Date.prototype) { + return 'Date'; + } + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + if (objPrototype === null) { + return 'Object'; + } + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); + } + + return typeDetect; + +})); + +},{}],88:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],89:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],90:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +},{"./support/isBuffer":89,"inherits":88}],91:[function(require,module,exports){ +/*! + + diff v7.0.0 + +BSD 3-Clause License + +Copyright (c) 2009-2015, Kevin Decker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +@license +*/ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Diff = {})); +})(this, (function (exports) { 'use strict'; + + function Diff() {} + Diff.prototype = { + diff: function diff(oldString, newString) { + var _options$timeout; + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var callback = options.callback; + if (typeof options === 'function') { + callback = options; + options = {}; + } + var self = this; + function done(value) { + value = self.postProcess(value, options); + if (callback) { + setTimeout(function () { + callback(value); + }, 0); + return true; + } else { + return value; + } + } + + // Allow subclasses to massage the input prior to running + oldString = this.castInput(oldString, options); + newString = this.castInput(newString, options); + oldString = this.removeEmpty(this.tokenize(oldString, options)); + newString = this.removeEmpty(this.tokenize(newString, options)); + var newLen = newString.length, + oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + if (options.maxEditLength != null) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + var maxExecutionTime = (_options$timeout = options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity; + var abortAfterTimestamp = Date.now() + maxExecutionTime; + var bestPath = [{ + oldPos: -1, + lastComponent: undefined + }]; + + // Seed editLength = 0, i.e. the content starts with the same values + var newPos = this.extractCommon(bestPath[0], newString, oldString, 0, options); + if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + // Identity per the equality and tokenizer + return done(buildValues(self, bestPath[0].lastComponent, newString, oldString, self.useLongestToken)); + } + + // Once we hit the right edge of the edit graph on some diagonal k, we can + // definitely reach the end of the edit graph in no more than k edits, so + // there's no point in considering any moves to diagonal k+1 any more (from + // which we're guaranteed to need at least k+1 more edits). + // Similarly, once we've reached the bottom of the edit graph, there's no + // point considering moves to lower diagonals. + // We record this fact by setting minDiagonalToConsider and + // maxDiagonalToConsider to some finite value once we've hit the edge of + // the edit graph. + // This optimization is not faithful to the original algorithm presented in + // Myers's paper, which instead pointlessly extends D-paths off the end of + // the edit graph - see page 7 of Myers's paper which notes this point + // explicitly and illustrates it with a diagram. This has major performance + // implications for some common scenarios. For instance, to compute a diff + // where the new text simply appends d characters on the end of the + // original text of length n, the true Myers algorithm will take O(n+d^2) + // time while this optimization needs only O(n+d) time. + var minDiagonalToConsider = -Infinity, + maxDiagonalToConsider = Infinity; + + // Main worker method. checks all permutations of a given edit length for acceptance. + function execEditLength() { + for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) { + var basePath = void 0; + var removePath = bestPath[diagonalPath - 1], + addPath = bestPath[diagonalPath + 1]; + if (removePath) { + // No one else is going to attempt to use this value, clear it + bestPath[diagonalPath - 1] = undefined; + } + var canAdd = false; + if (addPath) { + // what newPos will be after we do an insertion: + var addPathNewPos = addPath.oldPos - diagonalPath; + canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen; + } + var canRemove = removePath && removePath.oldPos + 1 < oldLen; + if (!canAdd && !canRemove) { + // If this path is a terminal then prune + bestPath[diagonalPath] = undefined; + continue; + } + + // Select the diagonal that we want to branch from. We select the prior + // path whose position in the old string is the farthest from the origin + // and does not pass the bounds of the diff graph + if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) { + basePath = self.addToPath(addPath, true, false, 0, options); + } else { + basePath = self.addToPath(removePath, false, true, 1, options); + } + newPos = self.extractCommon(basePath, newString, oldString, diagonalPath, options); + if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) { + // If we have hit the end of both strings, then we are done + return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken)); + } else { + bestPath[diagonalPath] = basePath; + if (basePath.oldPos + 1 >= oldLen) { + maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1); + } + if (newPos + 1 >= newLen) { + minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1); + } + } + } + editLength++; + } + + // Performs the length of edit iteration. Is a bit fugly as this has to support the + // sync and async mode which is never fun. Loops over execEditLength until a value + // is produced, or until the edit length exceeds options.maxEditLength (if given), + // in which case it will return undefined. + if (callback) { + (function exec() { + setTimeout(function () { + if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) { + return callback(); + } + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + } + }, + addToPath: function addToPath(path, added, removed, oldPosInc, options) { + var last = path.lastComponent; + if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) { + return { + oldPos: path.oldPos + oldPosInc, + lastComponent: { + count: last.count + 1, + added: added, + removed: removed, + previousComponent: last.previousComponent + } + }; + } else { + return { + oldPos: path.oldPos + oldPosInc, + lastComponent: { + count: 1, + added: added, + removed: removed, + previousComponent: last + } + }; + } + }, + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath, options) { + var newLen = newString.length, + oldLen = oldString.length, + oldPos = basePath.oldPos, + newPos = oldPos - diagonalPath, + commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldString[oldPos + 1], newString[newPos + 1], options)) { + newPos++; + oldPos++; + commonCount++; + if (options.oneChangePerToken) { + basePath.lastComponent = { + count: 1, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + } + if (commonCount && !options.oneChangePerToken) { + basePath.lastComponent = { + count: commonCount, + previousComponent: basePath.lastComponent, + added: false, + removed: false + }; + } + basePath.oldPos = oldPos; + return newPos; + }, + equals: function equals(left, right, options) { + if (options.comparator) { + return options.comparator(left, right); + } else { + return left === right || options.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + removeEmpty: function removeEmpty(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + return ret; + }, + castInput: function castInput(value) { + return value; + }, + tokenize: function tokenize(value) { + return Array.from(value); + }, + join: function join(chars) { + return chars.join(''); + }, + postProcess: function postProcess(changeObjects) { + return changeObjects; + } + }; + function buildValues(diff, lastComponent, newString, oldString, useLongestToken) { + // First we convert our linked list of components in reverse order to an + // array in the right order: + var components = []; + var nextComponent; + while (lastComponent) { + components.push(lastComponent); + nextComponent = lastComponent.previousComponent; + delete lastComponent.previousComponent; + lastComponent = nextComponent; + } + components.reverse(); + var componentPos = 0, + componentLen = components.length, + newPos = 0, + oldPos = 0; + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function (value, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value.length ? oldValue : value; + }); + component.value = diff.join(value); + } else { + component.value = diff.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + + // Common case + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + } + } + return components; + } + + var characterDiff = new Diff(); + function diffChars(oldStr, newStr, options) { + return characterDiff.diff(oldStr, newStr, options); + } + + function longestCommonPrefix(str1, str2) { + var i; + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[i] != str2[i]) { + return str1.slice(0, i); + } + } + return str1.slice(0, i); + } + function longestCommonSuffix(str1, str2) { + var i; + + // Unlike longestCommonPrefix, we need a special case to handle all scenarios + // where we return the empty string since str1.slice(-0) will return the + // entire string. + if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) { + return ''; + } + for (i = 0; i < str1.length && i < str2.length; i++) { + if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) { + return str1.slice(-i); + } + } + return str1.slice(-i); + } + function replacePrefix(string, oldPrefix, newPrefix) { + if (string.slice(0, oldPrefix.length) != oldPrefix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't start with prefix ").concat(JSON.stringify(oldPrefix), "; this is a bug")); + } + return newPrefix + string.slice(oldPrefix.length); + } + function replaceSuffix(string, oldSuffix, newSuffix) { + if (!oldSuffix) { + return string + newSuffix; + } + if (string.slice(-oldSuffix.length) != oldSuffix) { + throw Error("string ".concat(JSON.stringify(string), " doesn't end with suffix ").concat(JSON.stringify(oldSuffix), "; this is a bug")); + } + return string.slice(0, -oldSuffix.length) + newSuffix; + } + function removePrefix(string, oldPrefix) { + return replacePrefix(string, oldPrefix, ''); + } + function removeSuffix(string, oldSuffix) { + return replaceSuffix(string, oldSuffix, ''); + } + function maximumOverlap(string1, string2) { + return string2.slice(0, overlapCount(string1, string2)); + } + + // Nicked from https://stackoverflow.com/a/60422853/1709587 + function overlapCount(a, b) { + // Deal with cases where the strings differ in length + var startA = 0; + if (a.length > b.length) { + startA = a.length - b.length; + } + var endB = b.length; + if (a.length < b.length) { + endB = a.length; + } + // Create a back-reference for each index + // that should be followed in case of a mismatch. + // We only need B to make these references: + var map = Array(endB); + var k = 0; // Index that lags behind j + map[0] = 0; + for (var j = 1; j < endB; j++) { + if (b[j] == b[k]) { + map[j] = map[k]; // skip over the same character (optional optimisation) + } else { + map[j] = k; + } + while (k > 0 && b[j] != b[k]) { + k = map[k]; + } + if (b[j] == b[k]) { + k++; + } + } + // Phase 2: use these references while iterating over A + k = 0; + for (var i = startA; i < a.length; i++) { + while (k > 0 && a[i] != b[k]) { + k = map[k]; + } + if (a[i] == b[k]) { + k++; + } + } + return k; + } + + /** + * Returns true if the string consistently uses Windows line endings. + */ + function hasOnlyWinLineEndings(string) { + return string.includes('\r\n') && !string.startsWith('\n') && !string.match(/[^\r]\n/); + } + + /** + * Returns true if the string consistently uses Unix line endings. + */ + function hasOnlyUnixLineEndings(string) { + return !string.includes('\r\n') && string.includes('\n'); + } + + // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode + // + // Ranges and exceptions: + // Latin-1 Supplement, 0080–00FF + // - U+00D7 × Multiplication sign + // - U+00F7 ÷ Division sign + // Latin Extended-A, 0100–017F + // Latin Extended-B, 0180–024F + // IPA Extensions, 0250–02AF + // Spacing Modifier Letters, 02B0–02FF + // - U+02C7 ˇ ˇ Caron + // - U+02D8 ˘ ˘ Breve + // - U+02D9 ˙ ˙ Dot Above + // - U+02DA ˚ ˚ Ring Above + // - U+02DB ˛ ˛ Ogonek + // - U+02DC ˜ ˜ Small Tilde + // - U+02DD ˝ ˝ Double Acute Accent + // Latin Extended Additional, 1E00–1EFF + var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}"; + + // Each token is one of the following: + // - A punctuation mark plus the surrounding whitespace + // - A word plus the surrounding whitespace + // - Pure whitespace (but only in the special case where this the entire text + // is just whitespace) + // + // We have to include surrounding whitespace in the tokens because the two + // alternative approaches produce horribly broken results: + // * If we just discard the whitespace, we can't fully reproduce the original + // text from the sequence of tokens and any attempt to render the diff will + // get the whitespace wrong. + // * If we have separate tokens for whitespace, then in a typical text every + // second token will be a single space character. But this often results in + // the optimal diff between two texts being a perverse one that preserves + // the spaces between words but deletes and reinserts actual common words. + // See https://github.com/kpdecker/jsdiff/issues/160#issuecomment-1866099640 + // for an example. + // + // Keeping the surrounding whitespace of course has implications for .equals + // and .join, not just .tokenize. + + // This regex does NOT fully implement the tokenization rules described above. + // Instead, it gives runs of whitespace their own "token". The tokenize method + // then handles stitching whitespace tokens onto adjacent word or punctuation + // tokens. + var tokenizeIncludingWhitespace = new RegExp("[".concat(extendedWordChars, "]+|\\s+|[^").concat(extendedWordChars, "]"), 'ug'); + var wordDiff = new Diff(); + wordDiff.equals = function (left, right, options) { + if (options.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left.trim() === right.trim(); + }; + wordDiff.tokenize = function (value) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var parts; + if (options.intlSegmenter) { + if (options.intlSegmenter.resolvedOptions().granularity != 'word') { + throw new Error('The segmenter passed must have a granularity of "word"'); + } + parts = Array.from(options.intlSegmenter.segment(value), function (segment) { + return segment.segment; + }); + } else { + parts = value.match(tokenizeIncludingWhitespace) || []; + } + var tokens = []; + var prevPart = null; + parts.forEach(function (part) { + if (/\s/.test(part)) { + if (prevPart == null) { + tokens.push(part); + } else { + tokens.push(tokens.pop() + part); + } + } else if (/\s/.test(prevPart)) { + if (tokens[tokens.length - 1] == prevPart) { + tokens.push(tokens.pop() + part); + } else { + tokens.push(prevPart + part); + } + } else { + tokens.push(part); + } + prevPart = part; + }); + return tokens; + }; + wordDiff.join = function (tokens) { + // Tokens being joined here will always have appeared consecutively in the + // same text, so we can simply strip off the leading whitespace from all the + // tokens except the first (and except any whitespace-only tokens - but such + // a token will always be the first and only token anyway) and then join them + // and the whitespace around words and punctuation will end up correct. + return tokens.map(function (token, i) { + if (i == 0) { + return token; + } else { + return token.replace(/^\s+/, ''); + } + }).join(''); + }; + wordDiff.postProcess = function (changes, options) { + if (!changes || options.oneChangePerToken) { + return changes; + } + var lastKeep = null; + // Change objects representing any insertion or deletion since the last + // "keep" change object. There can be at most one of each. + var insertion = null; + var deletion = null; + changes.forEach(function (change) { + if (change.added) { + insertion = change; + } else if (change.removed) { + deletion = change; + } else { + if (insertion || deletion) { + // May be false at start of text + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change); + } + lastKeep = change; + insertion = null; + deletion = null; + } + }); + if (insertion || deletion) { + dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null); + } + return changes; + }; + function diffWords(oldStr, newStr, options) { + // This option has never been documented and never will be (it's clearer to + // just call `diffWordsWithSpace` directly if you need that behavior), but + // has existed in jsdiff for a long time, so we retain support for it here + // for the sake of backwards compatibility. + if ((options === null || options === void 0 ? void 0 : options.ignoreWhitespace) != null && !options.ignoreWhitespace) { + return diffWordsWithSpace(oldStr, newStr, options); + } + return wordDiff.diff(oldStr, newStr, options); + } + function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) { + // Before returning, we tidy up the leading and trailing whitespace of the + // change objects to eliminate cases where trailing whitespace in one object + // is repeated as leading whitespace in the next. + // Below are examples of the outcomes we want here to explain the code. + // I=insert, K=keep, D=delete + // 1. diffing 'foo bar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' + // After cleanup, we want: K:'foo ' D:'bar ' K:'baz' + // + // 2. Diffing 'foo bar baz' vs 'foo qux baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' I:' qux ' K:' baz' + // After cleanup, we want K:'foo ' D:'bar' I:'qux' K:' baz' + // + // 3. Diffing 'foo\nbar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:'\nbar ' K:' baz' + // After cleanup, we want K'foo' D:'\nbar' K:' baz' + // + // 4. Diffing 'foo baz' vs 'foo\nbar baz' + // Prior to cleanup, we have K:'foo\n' I:'\nbar ' K:' baz' + // After cleanup, we ideally want K'foo' I:'\nbar' K:' baz' + // but don't actually manage this currently (the pre-cleanup change + // objects don't contain enough information to make it possible). + // + // 5. Diffing 'foo bar baz' vs 'foo baz' + // Prior to cleanup, we have K:'foo ' D:' bar ' K:' baz' + // After cleanup, we want K:'foo ' D:' bar ' K:'baz' + // + // Our handling is unavoidably imperfect in the case where there's a single + // indel between keeps and the whitespace has changed. For instance, consider + // diffing 'foo\tbar\nbaz' vs 'foo baz'. Unless we create an extra change + // object to represent the insertion of the space character (which isn't even + // a token), we have no way to avoid losing information about the texts' + // original whitespace in the result we return. Still, we do our best to + // output something that will look sensible if we e.g. print it with + // insertions in green and deletions in red. + + // Between two "keep" change objects (or before the first or after the last + // change object), we can have either: + // * A "delete" followed by an "insert" + // * Just an "insert" + // * Just a "delete" + // We handle the three cases separately. + if (deletion && insertion) { + var oldWsPrefix = deletion.value.match(/^\s*/)[0]; + var oldWsSuffix = deletion.value.match(/\s*$/)[0]; + var newWsPrefix = insertion.value.match(/^\s*/)[0]; + var newWsSuffix = insertion.value.match(/\s*$/)[0]; + if (startKeep) { + var commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix); + startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix); + deletion.value = removePrefix(deletion.value, commonWsPrefix); + insertion.value = removePrefix(insertion.value, commonWsPrefix); + } + if (endKeep) { + var commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix); + endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix); + deletion.value = removeSuffix(deletion.value, commonWsSuffix); + insertion.value = removeSuffix(insertion.value, commonWsSuffix); + } + } else if (insertion) { + // The whitespaces all reflect what was in the new text rather than + // the old, so we essentially have no information about whitespace + // insertion or deletion. We just want to dedupe the whitespace. + // We do that by having each change object keep its trailing + // whitespace and deleting duplicate leading whitespace where + // present. + if (startKeep) { + insertion.value = insertion.value.replace(/^\s*/, ''); + } + if (endKeep) { + endKeep.value = endKeep.value.replace(/^\s*/, ''); + } + // otherwise we've got a deletion and no insertion + } else if (startKeep && endKeep) { + var newWsFull = endKeep.value.match(/^\s*/)[0], + delWsStart = deletion.value.match(/^\s*/)[0], + delWsEnd = deletion.value.match(/\s*$/)[0]; + + // Any whitespace that comes straight after startKeep in both the old and + // new texts, assign to startKeep and remove from the deletion. + var newWsStart = longestCommonPrefix(newWsFull, delWsStart); + deletion.value = removePrefix(deletion.value, newWsStart); + + // Any whitespace that comes straight before endKeep in both the old and + // new texts, and hasn't already been assigned to startKeep, assign to + // endKeep and remove from the deletion. + var newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd); + deletion.value = removeSuffix(deletion.value, newWsEnd); + endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd); + + // If there's any whitespace from the new text that HASN'T already been + // assigned, assign it to the start: + startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length)); + } else if (endKeep) { + // We are at the start of the text. Preserve all the whitespace on + // endKeep, and just remove whitespace from the end of deletion to the + // extent that it overlaps with the start of endKeep. + var endKeepWsPrefix = endKeep.value.match(/^\s*/)[0]; + var deletionWsSuffix = deletion.value.match(/\s*$/)[0]; + var overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix); + deletion.value = removeSuffix(deletion.value, overlap); + } else if (startKeep) { + // We are at the END of the text. Preserve all the whitespace on + // startKeep, and just remove whitespace from the start of deletion to + // the extent that it overlaps with the end of startKeep. + var startKeepWsSuffix = startKeep.value.match(/\s*$/)[0]; + var deletionWsPrefix = deletion.value.match(/^\s*/)[0]; + var _overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix); + deletion.value = removePrefix(deletion.value, _overlap); + } + } + var wordWithSpaceDiff = new Diff(); + wordWithSpaceDiff.tokenize = function (value) { + // Slightly different to the tokenizeIncludingWhitespace regex used above in + // that this one treats each individual newline as a distinct tokens, rather + // than merging them into other surrounding whitespace. This was requested + // in https://github.com/kpdecker/jsdiff/issues/180 & + // https://github.com/kpdecker/jsdiff/issues/211 + var regex = new RegExp("(\\r?\\n)|[".concat(extendedWordChars, "]+|[^\\S\\n\\r]+|[^").concat(extendedWordChars, "]"), 'ug'); + return value.match(regex) || []; + }; + function diffWordsWithSpace(oldStr, newStr, options) { + return wordWithSpaceDiff.diff(oldStr, newStr, options); + } + + function generateOptions(options, defaults) { + if (typeof options === 'function') { + defaults.callback = options; + } else if (options) { + for (var name in options) { + /* istanbul ignore else */ + if (options.hasOwnProperty(name)) { + defaults[name] = options[name]; + } + } + } + return defaults; + } + + var lineDiff = new Diff(); + lineDiff.tokenize = function (value, options) { + if (options.stripTrailingCr) { + // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior + value = value.replace(/\r\n/g, '\n'); + } + var retLines = [], + linesAndNewlines = value.split(/(\n|\r\n)/); + + // Ignore the final empty token that occurs if the string ends with a new line + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + + // Merge the content and line separators into single tokens + for (var i = 0; i < linesAndNewlines.length; i++) { + var line = linesAndNewlines[i]; + if (i % 2 && !options.newlineIsToken) { + retLines[retLines.length - 1] += line; + } else { + retLines.push(line); + } + } + return retLines; + }; + lineDiff.equals = function (left, right, options) { + // If we're ignoring whitespace, we need to normalise lines by stripping + // whitespace before checking equality. (This has an annoying interaction + // with newlineIsToken that requires special handling: if newlines get their + // own token, then we DON'T want to trim the *newline* tokens down to empty + // strings, since this would cause us to treat whitespace-only line content + // as equal to a separator between lines, which would be weird and + // inconsistent with the documented behavior of the options.) + if (options.ignoreWhitespace) { + if (!options.newlineIsToken || !left.includes('\n')) { + left = left.trim(); + } + if (!options.newlineIsToken || !right.includes('\n')) { + right = right.trim(); + } + } else if (options.ignoreNewlineAtEof && !options.newlineIsToken) { + if (left.endsWith('\n')) { + left = left.slice(0, -1); + } + if (right.endsWith('\n')) { + right = right.slice(0, -1); + } + } + return Diff.prototype.equals.call(this, left, right, options); + }; + function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); + } + + // Kept for backwards compatibility. This is a rather arbitrary wrapper method + // that just calls `diffLines` with `ignoreWhitespace: true`. It's confusing to + // have two ways to do exactly the same thing in the API, so we no longer + // document this one (library users should explicitly use `diffLines` with + // `ignoreWhitespace: true` instead) but we keep it around to maintain + // compatibility with code that used old versions. + function diffTrimmedLines(oldStr, newStr, callback) { + var options = generateOptions(callback, { + ignoreWhitespace: true + }); + return lineDiff.diff(oldStr, newStr, options); + } + + var sentenceDiff = new Diff(); + sentenceDiff.tokenize = function (value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); + }; + function diffSentences(oldStr, newStr, callback) { + return sentenceDiff.diff(oldStr, newStr, callback); + } + + var cssDiff = new Diff(); + cssDiff.tokenize = function (value) { + return value.split(/([{}:;,]|\s+)/); + }; + function diffCss(oldStr, newStr, callback) { + return cssDiff.diff(oldStr, newStr, callback); + } + + function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; + } + function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + var jsonDiff = new Diff(); + // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a + // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: + jsonDiff.useLongestToken = true; + jsonDiff.tokenize = lineDiff.tokenize; + jsonDiff.castInput = function (value, options) { + var undefinedReplacement = options.undefinedReplacement, + _options$stringifyRep = options.stringifyReplacer, + stringifyReplacer = _options$stringifyRep === void 0 ? function (k, v) { + return typeof v === 'undefined' ? undefinedReplacement : v; + } : _options$stringifyRep; + return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); + }; + jsonDiff.equals = function (left, right, options) { + return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'), options); + }; + function diffJson(oldObj, newObj, options) { + return jsonDiff.diff(oldObj, newObj, options); + } + + // This function handles the presence of circular references by bailing out when encountering an + // object that is already on the "stack" of items being processed. Accepts an optional replacer + function canonicalize(obj, stack, replacementStack, replacer, key) { + stack = stack || []; + replacementStack = replacementStack || []; + if (replacer) { + obj = replacer(key, obj); + } + var i; + for (i = 0; i < stack.length; i += 1) { + if (stack[i] === obj) { + return replacementStack[i]; + } + } + var canonicalizedObj; + if ('[object Array]' === Object.prototype.toString.call(obj)) { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + if (_typeof(obj) === 'object' && obj !== null) { + stack.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], + _key; + for (_key in obj) { + /* istanbul ignore else */ + if (Object.prototype.hasOwnProperty.call(obj, _key)) { + sortedKeys.push(_key); + } + } + sortedKeys.sort(); + for (i = 0; i < sortedKeys.length; i += 1) { + _key = sortedKeys[i]; + canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; + } + + var arrayDiff = new Diff(); + arrayDiff.tokenize = function (value) { + return value.slice(); + }; + arrayDiff.join = arrayDiff.removeEmpty = function (value) { + return value; + }; + function diffArrays(oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); + } + + function unixToWin(patch) { + if (Array.isArray(patch)) { + return patch.map(unixToWin); + } + return _objectSpread2(_objectSpread2({}, patch), {}, { + hunks: patch.hunks.map(function (hunk) { + return _objectSpread2(_objectSpread2({}, hunk), {}, { + lines: hunk.lines.map(function (line, i) { + var _hunk$lines; + return line.startsWith('\\') || line.endsWith('\r') || (_hunk$lines = hunk.lines[i + 1]) !== null && _hunk$lines !== void 0 && _hunk$lines.startsWith('\\') ? line : line + '\r'; + }) + }); + }) + }); + } + function winToUnix(patch) { + if (Array.isArray(patch)) { + return patch.map(winToUnix); + } + return _objectSpread2(_objectSpread2({}, patch), {}, { + hunks: patch.hunks.map(function (hunk) { + return _objectSpread2(_objectSpread2({}, hunk), {}, { + lines: hunk.lines.map(function (line) { + return line.endsWith('\r') ? line.substring(0, line.length - 1) : line; + }) + }); + }) + }); + } + + /** + * Returns true if the patch consistently uses Unix line endings (or only involves one line and has + * no line endings). + */ + function isUnix(patch) { + if (!Array.isArray(patch)) { + patch = [patch]; + } + return !patch.some(function (index) { + return index.hunks.some(function (hunk) { + return hunk.lines.some(function (line) { + return !line.startsWith('\\') && line.endsWith('\r'); + }); + }); + }); + } + + /** + * Returns true if the patch uses Windows line endings and only Windows line endings. + */ + function isWin(patch) { + if (!Array.isArray(patch)) { + patch = [patch]; + } + return patch.some(function (index) { + return index.hunks.some(function (hunk) { + return hunk.lines.some(function (line) { + return line.endsWith('\r'); + }); + }); + }) && patch.every(function (index) { + return index.hunks.every(function (hunk) { + return hunk.lines.every(function (line, i) { + var _hunk$lines2; + return line.startsWith('\\') || line.endsWith('\r') || ((_hunk$lines2 = hunk.lines[i + 1]) === null || _hunk$lines2 === void 0 ? void 0 : _hunk$lines2.startsWith('\\')); + }); + }); + }); + } + + function parsePatch(uniDiff) { + var diffstr = uniDiff.split(/\n/), + list = [], + i = 0; + function parseIndex() { + var index = {}; + list.push(index); + + // Parse diff metadata + while (i < diffstr.length) { + var line = diffstr[i]; + + // File header found, end parsing diff metadata + if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { + break; + } + + // Diff index + var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); + if (header) { + index.index = header[1]; + } + i++; + } + + // Parse file headers if they are defined. Unified diff requires them, but + // there's no technical issues to have an isolated hunk without file header + parseFileHeader(index); + parseFileHeader(index); + + // Parse hunks + index.hunks = []; + while (i < diffstr.length) { + var _line = diffstr[i]; + if (/^(Index:\s|diff\s|\-\-\-\s|\+\+\+\s|===================================================================)/.test(_line)) { + break; + } else if (/^@@/.test(_line)) { + index.hunks.push(parseHunk()); + } else if (_line) { + throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); + } else { + i++; + } + } + } + + // Parses the --- and +++ headers, if none are found, no lines + // are consumed. + function parseFileHeader(index) { + var fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]); + if (fileHeader) { + var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; + var data = fileHeader[2].split('\t', 2); + var fileName = data[0].replace(/\\\\/g, '\\'); + if (/^".*"$/.test(fileName)) { + fileName = fileName.substr(1, fileName.length - 2); + } + index[keyPrefix + 'FileName'] = fileName; + index[keyPrefix + 'Header'] = (data[1] || '').trim(); + i++; + } + } + + // Parses a hunk + // This assumes that we are at the start of a hunk. + function parseHunk() { + var chunkHeaderIndex = i, + chunkHeaderLine = diffstr[i++], + chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); + var hunk = { + oldStart: +chunkHeader[1], + oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2], + newStart: +chunkHeader[3], + newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4], + lines: [] + }; + + // Unified Diff Format quirk: If the chunk size is 0, + // the first number is one lower than one would expect. + // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 + if (hunk.oldLines === 0) { + hunk.oldStart += 1; + } + if (hunk.newLines === 0) { + hunk.newStart += 1; + } + var addCount = 0, + removeCount = 0; + for (; i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || (_diffstr$i = diffstr[i]) !== null && _diffstr$i !== void 0 && _diffstr$i.startsWith('\\')); i++) { + var _diffstr$i; + var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; + if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { + hunk.lines.push(diffstr[i]); + if (operation === '+') { + addCount++; + } else if (operation === '-') { + removeCount++; + } else if (operation === ' ') { + addCount++; + removeCount++; + } + } else { + throw new Error("Hunk at line ".concat(chunkHeaderIndex + 1, " contained invalid line ").concat(diffstr[i])); + } + } + + // Handle the empty block count case + if (!addCount && hunk.newLines === 1) { + hunk.newLines = 0; + } + if (!removeCount && hunk.oldLines === 1) { + hunk.oldLines = 0; + } + + // Perform sanity checking + if (addCount !== hunk.newLines) { + throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + if (removeCount !== hunk.oldLines) { + throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + return hunk; + } + while (i < diffstr.length) { + parseIndex(); + } + return list; + } + + // Iterator that traverses in the range of [min, max], stepping + // by distance from a given start position. I.e. for [0, 4], with + // start of 2, this will iterate 2, 3, 1, 4, 0. + function distanceIterator (start, minLine, maxLine) { + var wantForward = true, + backwardExhausted = false, + forwardExhausted = false, + localOffset = 1; + return function iterator() { + if (wantForward && !forwardExhausted) { + if (backwardExhausted) { + localOffset++; + } else { + wantForward = false; + } + + // Check if trying to fit beyond text length, and if not, check it fits + // after offset location (or desired location on first iteration) + if (start + localOffset <= maxLine) { + return start + localOffset; + } + forwardExhausted = true; + } + if (!backwardExhausted) { + if (!forwardExhausted) { + wantForward = true; + } + + // Check if trying to fit before text beginning, and if not, check it fits + // before offset location + if (minLine <= start - localOffset) { + return start - localOffset++; + } + backwardExhausted = true; + return iterator(); + } + + // We tried to fit hunk before text beginning and beyond text length, then + // hunk can't fit on the text. Return undefined + }; + } + + function applyPatch(source, uniDiff) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (typeof uniDiff === 'string') { + uniDiff = parsePatch(uniDiff); + } + if (Array.isArray(uniDiff)) { + if (uniDiff.length > 1) { + throw new Error('applyPatch only works with a single input.'); + } + uniDiff = uniDiff[0]; + } + if (options.autoConvertLineEndings || options.autoConvertLineEndings == null) { + if (hasOnlyWinLineEndings(source) && isUnix(uniDiff)) { + uniDiff = unixToWin(uniDiff); + } else if (hasOnlyUnixLineEndings(source) && isWin(uniDiff)) { + uniDiff = winToUnix(uniDiff); + } + } + + // Apply the diff to the input + var lines = source.split('\n'), + hunks = uniDiff.hunks, + compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { + return line === patchContent; + }, + fuzzFactor = options.fuzzFactor || 0, + minLine = 0; + if (fuzzFactor < 0 || !Number.isInteger(fuzzFactor)) { + throw new Error('fuzzFactor must be a non-negative integer'); + } + + // Special case for empty patch. + if (!hunks.length) { + return source; + } + + // Before anything else, handle EOFNL insertion/removal. If the patch tells us to make a change + // to the EOFNL that is redundant/impossible - i.e. to remove a newline that's not there, or add a + // newline that already exists - then we either return false and fail to apply the patch (if + // fuzzFactor is 0) or simply ignore the problem and do nothing (if fuzzFactor is >0). + // If we do need to remove/add a newline at EOF, this will always be in the final hunk: + var prevLine = '', + removeEOFNL = false, + addEOFNL = false; + for (var i = 0; i < hunks[hunks.length - 1].lines.length; i++) { + var line = hunks[hunks.length - 1].lines[i]; + if (line[0] == '\\') { + if (prevLine[0] == '+') { + removeEOFNL = true; + } else if (prevLine[0] == '-') { + addEOFNL = true; + } + } + prevLine = line; + } + if (removeEOFNL) { + if (addEOFNL) { + // This means the final line gets changed but doesn't have a trailing newline in either the + // original or patched version. In that case, we do nothing if fuzzFactor > 0, and if + // fuzzFactor is 0, we simply validate that the source file has no trailing newline. + if (!fuzzFactor && lines[lines.length - 1] == '') { + return false; + } + } else if (lines[lines.length - 1] == '') { + lines.pop(); + } else if (!fuzzFactor) { + return false; + } + } else if (addEOFNL) { + if (lines[lines.length - 1] != '') { + lines.push(''); + } else if (!fuzzFactor) { + return false; + } + } + + /** + * Checks if the hunk can be made to fit at the provided location with at most `maxErrors` + * insertions, substitutions, or deletions, while ensuring also that: + * - lines deleted in the hunk match exactly, and + * - wherever an insertion operation or block of insertion operations appears in the hunk, the + * immediately preceding and following lines of context match exactly + * + * `toPos` should be set such that lines[toPos] is meant to match hunkLines[0]. + * + * If the hunk can be applied, returns an object with properties `oldLineLastI` and + * `replacementLines`. Otherwise, returns null. + */ + function applyHunk(hunkLines, toPos, maxErrors) { + var hunkLinesI = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var lastContextLineMatched = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + var patchedLines = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : []; + var patchedLinesLength = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0; + var nConsecutiveOldContextLines = 0; + var nextContextLineMustMatch = false; + for (; hunkLinesI < hunkLines.length; hunkLinesI++) { + var hunkLine = hunkLines[hunkLinesI], + operation = hunkLine.length > 0 ? hunkLine[0] : ' ', + content = hunkLine.length > 0 ? hunkLine.substr(1) : hunkLine; + if (operation === '-') { + if (compareLine(toPos + 1, lines[toPos], operation, content)) { + toPos++; + nConsecutiveOldContextLines = 0; + } else { + if (!maxErrors || lines[toPos] == null) { + return null; + } + patchedLines[patchedLinesLength] = lines[toPos]; + return applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1); + } + } + if (operation === '+') { + if (!lastContextLineMatched) { + return null; + } + patchedLines[patchedLinesLength] = content; + patchedLinesLength++; + nConsecutiveOldContextLines = 0; + nextContextLineMustMatch = true; + } + if (operation === ' ') { + nConsecutiveOldContextLines++; + patchedLines[patchedLinesLength] = lines[toPos]; + if (compareLine(toPos + 1, lines[toPos], operation, content)) { + patchedLinesLength++; + lastContextLineMatched = true; + nextContextLineMustMatch = false; + toPos++; + } else { + if (nextContextLineMustMatch || !maxErrors) { + return null; + } + + // Consider 3 possibilities in sequence: + // 1. lines contains a *substitution* not included in the patch context, or + // 2. lines contains an *insertion* not included in the patch context, or + // 3. lines contains a *deletion* not included in the patch context + // The first two options are of course only possible if the line from lines is non-null - + // i.e. only option 3 is possible if we've overrun the end of the old file. + return lines[toPos] && (applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength + 1) || applyHunk(hunkLines, toPos + 1, maxErrors - 1, hunkLinesI, false, patchedLines, patchedLinesLength + 1)) || applyHunk(hunkLines, toPos, maxErrors - 1, hunkLinesI + 1, false, patchedLines, patchedLinesLength); + } + } + } + + // Before returning, trim any unmodified context lines off the end of patchedLines and reduce + // toPos (and thus oldLineLastI) accordingly. This allows later hunks to be applied to a region + // that starts in this hunk's trailing context. + patchedLinesLength -= nConsecutiveOldContextLines; + toPos -= nConsecutiveOldContextLines; + patchedLines.length = patchedLinesLength; + return { + patchedLines: patchedLines, + oldLineLastI: toPos - 1 + }; + } + var resultLines = []; + + // Search best fit offsets for each hunk based on the previous ones + var prevHunkOffset = 0; + for (var _i = 0; _i < hunks.length; _i++) { + var hunk = hunks[_i]; + var hunkResult = void 0; + var maxLine = lines.length - hunk.oldLines + fuzzFactor; + var toPos = void 0; + for (var maxErrors = 0; maxErrors <= fuzzFactor; maxErrors++) { + toPos = hunk.oldStart + prevHunkOffset - 1; + var iterator = distanceIterator(toPos, minLine, maxLine); + for (; toPos !== undefined; toPos = iterator()) { + hunkResult = applyHunk(hunk.lines, toPos, maxErrors); + if (hunkResult) { + break; + } + } + if (hunkResult) { + break; + } + } + if (!hunkResult) { + return false; + } + + // Copy everything from the end of where we applied the last hunk to the start of this hunk + for (var _i2 = minLine; _i2 < toPos; _i2++) { + resultLines.push(lines[_i2]); + } + + // Add the lines produced by applying the hunk: + for (var _i3 = 0; _i3 < hunkResult.patchedLines.length; _i3++) { + var _line = hunkResult.patchedLines[_i3]; + resultLines.push(_line); + } + + // Set lower text limit to end of the current hunk, so next ones don't try + // to fit over already patched text + minLine = hunkResult.oldLineLastI + 1; + + // Note the offset between where the patch said the hunk should've applied and where we + // applied it, so we can adjust future hunks accordingly: + prevHunkOffset = toPos + 1 - hunk.oldStart; + } + + // Copy over the rest of the lines from the old text + for (var _i4 = minLine; _i4 < lines.length; _i4++) { + resultLines.push(lines[_i4]); + } + return resultLines.join('\n'); + } + + // Wrapper that supports multiple file patches via callbacks. + function applyPatches(uniDiff, options) { + if (typeof uniDiff === 'string') { + uniDiff = parsePatch(uniDiff); + } + var currentIndex = 0; + function processIndex() { + var index = uniDiff[currentIndex++]; + if (!index) { + return options.complete(); + } + options.loadFile(index, function (err, data) { + if (err) { + return options.complete(err); + } + var updatedContent = applyPatch(data, index, options); + options.patched(index, updatedContent, function (err) { + if (err) { + return options.complete(err); + } + processIndex(); + }); + }); + } + processIndex(); + } + + function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + if (!options) { + options = {}; + } + if (typeof options === 'function') { + options = { + callback: options + }; + } + if (typeof options.context === 'undefined') { + options.context = 4; + } + if (options.newlineIsToken) { + throw new Error('newlineIsToken may not be used with patch-generation functions, only with diffing functions'); + } + if (!options.callback) { + return diffLinesResultToPatch(diffLines(oldStr, newStr, options)); + } else { + var _options = options, + _callback = _options.callback; + diffLines(oldStr, newStr, _objectSpread2(_objectSpread2({}, options), {}, { + callback: function callback(diff) { + var patch = diffLinesResultToPatch(diff); + _callback(patch); + } + })); + } + function diffLinesResultToPatch(diff) { + // STEP 1: Build up the patch with no "\ No newline at end of file" lines and with the arrays + // of lines containing trailing newline characters. We'll tidy up later... + + if (!diff) { + return; + } + diff.push({ + value: '', + lines: [] + }); // Append an empty value to make cleanup easier + + function contextLines(lines) { + return lines.map(function (entry) { + return ' ' + entry; + }); + } + var hunks = []; + var oldRangeStart = 0, + newRangeStart = 0, + curRange = [], + oldLine = 1, + newLine = 1; + var _loop = function _loop() { + var current = diff[i], + lines = current.lines || splitLines(current.value); + current.lines = lines; + if (current.added || current.removed) { + var _curRange; + // If we have previous context, start with that + if (!oldRangeStart) { + var prev = diff[i - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + if (prev) { + curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + + // Output our changes + (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) { + return (current.added ? '+' : '-') + entry; + }))); + + // Track the updated file position + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + // Identical context lines. Track line changes + if (oldRangeStart) { + // Close out any changes that have been output (or join overlapping) + if (lines.length <= options.context * 2 && i < diff.length - 2) { + var _curRange2; + // Overlapping + (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); + } else { + var _curRange3; + // end the range and output + var contextSize = Math.min(lines.length, options.context); + (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); + var _hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + hunks.push(_hunk); + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + for (var i = 0; i < diff.length; i++) { + _loop(); + } + + // Step 2: eliminate the trailing `\n` from each line of each hunk, and, where needed, add + // "\ No newline at end of file". + for (var _i = 0, _hunks = hunks; _i < _hunks.length; _i++) { + var hunk = _hunks[_i]; + for (var _i2 = 0; _i2 < hunk.lines.length; _i2++) { + if (hunk.lines[_i2].endsWith('\n')) { + hunk.lines[_i2] = hunk.lines[_i2].slice(0, -1); + } else { + hunk.lines.splice(_i2 + 1, 0, '\\ No newline at end of file'); + _i2++; // Skip the line we just added, then continue iterating + } + } + } + return { + oldFileName: oldFileName, + newFileName: newFileName, + oldHeader: oldHeader, + newHeader: newHeader, + hunks: hunks + }; + } + } + function formatPatch(diff) { + if (Array.isArray(diff)) { + return diff.map(formatPatch).join('\n'); + } + var ret = []; + if (diff.oldFileName == diff.newFileName) { + ret.push('Index: ' + diff.oldFileName); + } + ret.push('==================================================================='); + ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); + ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); + for (var i = 0; i < diff.hunks.length; i++) { + var hunk = diff.hunks[i]; + // Unified Diff Format quirk: If the chunk size is 0, + // the first number is one lower than one would expect. + // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 + if (hunk.oldLines === 0) { + hunk.oldStart -= 1; + } + if (hunk.newLines === 0) { + hunk.newStart -= 1; + } + ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); + ret.push.apply(ret, hunk.lines); + } + return ret.join('\n') + '\n'; + } + function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + var _options2; + if (typeof options === 'function') { + options = { + callback: options + }; + } + if (!((_options2 = options) !== null && _options2 !== void 0 && _options2.callback)) { + var patchObj = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); + if (!patchObj) { + return; + } + return formatPatch(patchObj); + } else { + var _options3 = options, + _callback2 = _options3.callback; + structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, _objectSpread2(_objectSpread2({}, options), {}, { + callback: function callback(patchObj) { + if (!patchObj) { + _callback2(); + } else { + _callback2(formatPatch(patchObj)); + } + } + })); + } + } + function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { + return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); + } + + /** + * Split `text` into an array of lines, including the trailing newline character (where present) + */ + function splitLines(text) { + var hasTrailingNl = text.endsWith('\n'); + var result = text.split('\n').map(function (line) { + return line + '\n'; + }); + if (hasTrailingNl) { + result.pop(); + } else { + result.push(result.pop().slice(0, -1)); + } + return result; + } + + function arrayEqual(a, b) { + if (a.length !== b.length) { + return false; + } + return arrayStartsWith(a, b); + } + function arrayStartsWith(array, start) { + if (start.length > array.length) { + return false; + } + for (var i = 0; i < start.length; i++) { + if (start[i] !== array[i]) { + return false; + } + } + return true; + } + + function calcLineCount(hunk) { + var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), + oldLines = _calcOldNewLineCount.oldLines, + newLines = _calcOldNewLineCount.newLines; + if (oldLines !== undefined) { + hunk.oldLines = oldLines; + } else { + delete hunk.oldLines; + } + if (newLines !== undefined) { + hunk.newLines = newLines; + } else { + delete hunk.newLines; + } + } + function merge(mine, theirs, base) { + mine = loadPatch(mine, base); + theirs = loadPatch(theirs, base); + var ret = {}; + + // For index we just let it pass through as it doesn't have any necessary meaning. + // Leaving sanity checks on this to the API consumer that may know more about the + // meaning in their own context. + if (mine.index || theirs.index) { + ret.index = mine.index || theirs.index; + } + if (mine.newFileName || theirs.newFileName) { + if (!fileNameChanged(mine)) { + // No header or no change in ours, use theirs (and ours if theirs does not exist) + ret.oldFileName = theirs.oldFileName || mine.oldFileName; + ret.newFileName = theirs.newFileName || mine.newFileName; + ret.oldHeader = theirs.oldHeader || mine.oldHeader; + ret.newHeader = theirs.newHeader || mine.newHeader; + } else if (!fileNameChanged(theirs)) { + // No header or no change in theirs, use ours + ret.oldFileName = mine.oldFileName; + ret.newFileName = mine.newFileName; + ret.oldHeader = mine.oldHeader; + ret.newHeader = mine.newHeader; + } else { + // Both changed... figure it out + ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); + ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); + ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); + ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); + } + } + ret.hunks = []; + var mineIndex = 0, + theirsIndex = 0, + mineOffset = 0, + theirsOffset = 0; + while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { + var mineCurrent = mine.hunks[mineIndex] || { + oldStart: Infinity + }, + theirsCurrent = theirs.hunks[theirsIndex] || { + oldStart: Infinity + }; + if (hunkBefore(mineCurrent, theirsCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); + mineIndex++; + theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; + } else if (hunkBefore(theirsCurrent, mineCurrent)) { + // This patch does not overlap with any of the others, yay. + ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); + theirsIndex++; + mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; + } else { + // Overlap, merge as best we can + var mergedHunk = { + oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), + oldLines: 0, + newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), + newLines: 0, + lines: [] + }; + mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); + theirsIndex++; + mineIndex++; + ret.hunks.push(mergedHunk); + } + } + return ret; + } + function loadPatch(param, base) { + if (typeof param === 'string') { + if (/^@@/m.test(param) || /^Index:/m.test(param)) { + return parsePatch(param)[0]; + } + if (!base) { + throw new Error('Must provide a base reference or pass in a patch'); + } + return structuredPatch(undefined, undefined, base, param); + } + return param; + } + function fileNameChanged(patch) { + return patch.newFileName && patch.newFileName !== patch.oldFileName; + } + function selectField(index, mine, theirs) { + if (mine === theirs) { + return mine; + } else { + index.conflict = true; + return { + mine: mine, + theirs: theirs + }; + } + } + function hunkBefore(test, check) { + return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; + } + function cloneHunk(hunk, offset) { + return { + oldStart: hunk.oldStart, + oldLines: hunk.oldLines, + newStart: hunk.newStart + offset, + newLines: hunk.newLines, + lines: hunk.lines + }; + } + function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { + // This will generally result in a conflicted hunk, but there are cases where the context + // is the only overlap where we can successfully merge the content here. + var mine = { + offset: mineOffset, + lines: mineLines, + index: 0 + }, + their = { + offset: theirOffset, + lines: theirLines, + index: 0 + }; + + // Handle any leading content + insertLeading(hunk, mine, their); + insertLeading(hunk, their, mine); + + // Now in the overlap content. Scan through and select the best changes from each. + while (mine.index < mine.lines.length && their.index < their.lines.length) { + var mineCurrent = mine.lines[mine.index], + theirCurrent = their.lines[their.index]; + if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { + // Both modified ... + mutualChange(hunk, mine, their); + } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { + var _hunk$lines; + // Mine inserted + (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); + } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { + var _hunk$lines2; + // Theirs inserted + (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); + } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { + // Mine removed or edited + removal(hunk, mine, their); + } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { + // Their removed or edited + removal(hunk, their, mine, true); + } else if (mineCurrent === theirCurrent) { + // Context identity + hunk.lines.push(mineCurrent); + mine.index++; + their.index++; + } else { + // Context mismatch + conflict(hunk, collectChange(mine), collectChange(their)); + } + } + + // Now push anything that may be remaining + insertTrailing(hunk, mine); + insertTrailing(hunk, their); + calcLineCount(hunk); + } + function mutualChange(hunk, mine, their) { + var myChanges = collectChange(mine), + theirChanges = collectChange(their); + if (allRemoves(myChanges) && allRemoves(theirChanges)) { + // Special case for remove changes that are supersets of one another + if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { + var _hunk$lines3; + (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); + return; + } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { + var _hunk$lines4; + (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); + return; + } + } else if (arrayEqual(myChanges, theirChanges)) { + var _hunk$lines5; + (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); + return; + } + conflict(hunk, myChanges, theirChanges); + } + function removal(hunk, mine, their, swap) { + var myChanges = collectChange(mine), + theirChanges = collectContext(their, myChanges); + if (theirChanges.merged) { + var _hunk$lines6; + (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); + } else { + conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); + } + } + function conflict(hunk, mine, their) { + hunk.conflict = true; + hunk.lines.push({ + conflict: true, + mine: mine, + theirs: their + }); + } + function insertLeading(hunk, insert, their) { + while (insert.offset < their.offset && insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + insert.offset++; + } + } + function insertTrailing(hunk, insert) { + while (insert.index < insert.lines.length) { + var line = insert.lines[insert.index++]; + hunk.lines.push(line); + } + } + function collectChange(state) { + var ret = [], + operation = state.lines[state.index][0]; + while (state.index < state.lines.length) { + var line = state.lines[state.index]; + + // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. + if (operation === '-' && line[0] === '+') { + operation = '+'; + } + if (operation === line[0]) { + ret.push(line); + state.index++; + } else { + break; + } + } + return ret; + } + function collectContext(state, matchChanges) { + var changes = [], + merged = [], + matchIndex = 0, + contextChanges = false, + conflicted = false; + while (matchIndex < matchChanges.length && state.index < state.lines.length) { + var change = state.lines[state.index], + match = matchChanges[matchIndex]; + + // Once we've hit our add, then we are done + if (match[0] === '+') { + break; + } + contextChanges = contextChanges || change[0] !== ' '; + merged.push(match); + matchIndex++; + + // Consume any additions in the other block as a conflict to attempt + // to pull in the remaining context after this + if (change[0] === '+') { + conflicted = true; + while (change[0] === '+') { + changes.push(change); + change = state.lines[++state.index]; + } + } + if (match.substr(1) === change.substr(1)) { + changes.push(change); + state.index++; + } else { + conflicted = true; + } + } + if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { + conflicted = true; + } + if (conflicted) { + return changes; + } + while (matchIndex < matchChanges.length) { + merged.push(matchChanges[matchIndex++]); + } + return { + merged: merged, + changes: changes + }; + } + function allRemoves(changes) { + return changes.reduce(function (prev, change) { + return prev && change[0] === '-'; + }, true); + } + function skipRemoveSuperset(state, removeChanges, delta) { + for (var i = 0; i < delta; i++) { + var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); + if (state.lines[state.index + i] !== ' ' + changeContent) { + return false; + } + } + state.index += delta; + return true; + } + function calcOldNewLineCount(lines) { + var oldLines = 0; + var newLines = 0; + lines.forEach(function (line) { + if (typeof line !== 'string') { + var myCount = calcOldNewLineCount(line.mine); + var theirCount = calcOldNewLineCount(line.theirs); + if (oldLines !== undefined) { + if (myCount.oldLines === theirCount.oldLines) { + oldLines += myCount.oldLines; + } else { + oldLines = undefined; + } + } + if (newLines !== undefined) { + if (myCount.newLines === theirCount.newLines) { + newLines += myCount.newLines; + } else { + newLines = undefined; + } + } + } else { + if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { + newLines++; + } + if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { + oldLines++; + } + } + }); + return { + oldLines: oldLines, + newLines: newLines + }; + } + + function reversePatch(structuredPatch) { + if (Array.isArray(structuredPatch)) { + return structuredPatch.map(reversePatch).reverse(); + } + return _objectSpread2(_objectSpread2({}, structuredPatch), {}, { + oldFileName: structuredPatch.newFileName, + oldHeader: structuredPatch.newHeader, + newFileName: structuredPatch.oldFileName, + newHeader: structuredPatch.oldHeader, + hunks: structuredPatch.hunks.map(function (hunk) { + return { + oldLines: hunk.newLines, + oldStart: hunk.newStart, + newLines: hunk.oldLines, + newStart: hunk.oldStart, + lines: hunk.lines.map(function (l) { + if (l.startsWith('-')) { + return "+".concat(l.slice(1)); + } + if (l.startsWith('+')) { + return "-".concat(l.slice(1)); + } + return l; + }) + }; + }) + }); + } + + // See: http://code.google.com/p/google-diff-match-patch/wiki/API + function convertChangesToDMP(changes) { + var ret = [], + change, + operation; + for (var i = 0; i < changes.length; i++) { + change = changes[i]; + if (change.added) { + operation = 1; + } else if (change.removed) { + operation = -1; + } else { + operation = 0; + } + ret.push([operation, change.value]); + } + return ret; + } + + function convertChangesToXML(changes) { + var ret = []; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + ret.push(escapeHTML(change.value)); + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + } + return ret.join(''); + } + function escapeHTML(s) { + var n = s; + n = n.replace(/&/g, '&'); + n = n.replace(//g, '>'); + n = n.replace(/"/g, '"'); + return n; + } + + exports.Diff = Diff; + exports.applyPatch = applyPatch; + exports.applyPatches = applyPatches; + exports.canonicalize = canonicalize; + exports.convertChangesToDMP = convertChangesToDMP; + exports.convertChangesToXML = convertChangesToXML; + exports.createPatch = createPatch; + exports.createTwoFilesPatch = createTwoFilesPatch; + exports.diffArrays = diffArrays; + exports.diffChars = diffChars; + exports.diffCss = diffCss; + exports.diffJson = diffJson; + exports.diffLines = diffLines; + exports.diffSentences = diffSentences; + exports.diffTrimmedLines = diffTrimmedLines; + exports.diffWords = diffWords; + exports.diffWordsWithSpace = diffWordsWithSpace; + exports.formatPatch = formatPatch; + exports.merge = merge; + exports.parsePatch = parsePatch; + exports.reversePatch = reversePatch; + exports.structuredPatch = structuredPatch; + +})); + +},{}],92:[function(require,module,exports){ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + +},{}],93:[function(require,module,exports){ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; + +},{}],94:[function(require,module,exports){ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.typeDetect = factory()); +}(this, (function () { 'use strict'; + +/* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */ +var promiseExists = typeof Promise === 'function'; + +/* eslint-disable no-undef */ +var globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist + +var symbolExists = typeof Symbol !== 'undefined'; +var mapExists = typeof Map !== 'undefined'; +var setExists = typeof Set !== 'undefined'; +var weakMapExists = typeof WeakMap !== 'undefined'; +var weakSetExists = typeof WeakSet !== 'undefined'; +var dataViewExists = typeof DataView !== 'undefined'; +var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; +var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; +var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; +var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; +var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); +var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); +var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; +var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); +var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; +var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); +var toStringLeftSliceLength = 8; +var toStringRightSliceLength = -1; +/** + * ### typeOf (obj) + * + * Uses `Object.prototype.toString` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */ +function typeDetect(obj) { + /* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */ + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + + /* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */ + if (obj === null) { + return 'null'; + } + + /* ! Spec Conformance + * Test: `Object.prototype.toString.call(window)`` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: `Object.prototype.toString.call(this)`` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */ + if (obj === globalObject) { + return 'global'; + } + + /* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */ + if ( + Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj)) + ) { + return 'Array'; + } + + // Not caching existence of `window` and related properties due to potential + // for `window` to be unset before tests in quasi-browser environments. + if (typeof window === 'object' && window !== null) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The `Location` interface + * Test: `Object.prototype.toString.call(window.location)`` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */ + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The `Document` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: `Object.prototype.toString.call(document)`` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */ + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + + if (typeof window.navigator === 'object') { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: `Object.prototype.toString.call(navigator.mimeTypes)`` + * - IE <=10 === "[object MSMimeTypesCollection]" + */ + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: `Object.prototype.toString.call(navigator.plugins)`` + * - IE <=10 === "[object MSPluginsCollection]" + */ + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement` + * Test: `Object.prototype.toString.call(document.createElement('blockquote'))`` + * - IE <=10 === "[object HTMLBlockElement]" + */ + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + + /* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */ + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + + var objPrototype = Object.getPrototypeOf(obj); + /* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */ + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + + /* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */ + if (objPrototype === Date.prototype) { + return 'Date'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: `Object.prototype.toString.call(Promise.resolve())`` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */ + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + + /* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */ + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + + /* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */ + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + + /* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */ + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + + /* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */ + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))`` + * - Edge <=13 === "[object Object]" + */ + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: `Object.prototype.toString.call(new Map().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: `Object.prototype.toString.call(new Set().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: `Object.prototype.toString.call([][Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: `Object.prototype.toString.call(''[Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + + /* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */ + if (objPrototype === null) { + return 'Object'; + } + + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); +} + +return typeDetect; + +}))); + +},{}]},{},[2])(2) +}); + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ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1cm47XG4gICAgICAgIH0sXG5cbiAgICAgICAgY2FsbE9yZGVyOiBmdW5jdGlvbiBhc3NlcnRDYWxsT3JkZXIoKSB7XG4gICAgICAgICAgICB2ZXJpZnlJc1N0dWIuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgICAgIGxldCBleHBlY3RlZCA9IFwiXCI7XG4gICAgICAgICAgICBsZXQgYWN0dWFsID0gXCJcIjtcblxuICAgICAgICAgICAgaWYgKCFjYWxsZWRJbk9yZGVyKGFyZ3VtZW50cykpIHtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBleHBlY3RlZCA9IGpvaW4oYXJndW1lbnRzLCBcIiwgXCIpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjYWxscyA9IGFycmF5U2xpY2UoYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBjYWxscy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNhbGxzWy0taV0uY2FsbGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3BsaWNlKGNhbGxzLCBpLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhY3R1YWwgPSBqb2luKG9yZGVyQnlGaXJzdENhbGwoY2FsbHMpLCBcIiwgXCIpO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhpcyBmYWlscywgd2UnbGwganVzdCBmYWxsIGJhY2sgdG8gdGhlIGJsYW5rIHN0cmluZ1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZhaWxBc3NlcnRpb24oXG4gICAgICAgICAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICAgICAgICAgIGBleHBlY3RlZCAke2V4cGVjdGVkfSB0byBiZSBjYWxsZWQgaW4gb3JkZXIgYnV0IHdlcmUgY2FsbGVkIGFzICR7YWN0dWFsfWAsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYXNzZXJ0LnBhc3MoXCJjYWxsT3JkZXJcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgY2FsbENvdW50OiBmdW5jdGlvbiBhc3NlcnRDYWxsQ291bnQobWV0aG9kLCBjb3VudCkge1xuICAgICAgICAgICAgdmVyaWZ5SXNTdHViKG1ldGhvZCk7XG5cbiAgICAgICAgICAgIGxldCBtc2c7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGNvdW50ICE9PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgbXNnID1cbiAgICAgICAgICAgICAgICAgICAgYGV4cGVjdGVkICR7aW5zcGVjdChjb3VudCl9IHRvIGJlIGEgbnVtYmVyIGAgK1xuICAgICAgICAgICAgICAgICAgICBgYnV0IHdhcyBvZiB0eXBlICR7dHlwZW9mIGNvdW50fWA7XG4gICAgICAgICAgICAgICAgZmFpbEFzc2VydGlvbih0aGlzLCBtc2cpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXRob2QuY2FsbENvdW50ICE9PSBjb3VudCkge1xuICAgICAgICAgICAgICAgIG1zZyA9XG4gICAgICAgICAgICAgICAgICAgIGBleHBlY3RlZCAlbiB0byBiZSBjYWxsZWQgJHt0aW1lc0luV29yZHMoY291bnQpfSBgICtcbiAgICAgICAgICAgICAgICAgICAgYGJ1dCB3YXMgY2FsbGVkICVjJUNgO1xuICAgICAgICAgICAgICAgIGZhaWxBc3NlcnRpb24odGhpcywgbWV0aG9kLnByaW50Zihtc2cpKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYXNzZXJ0LnBhc3MoXCJjYWxsQ291bnRcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgZXhwb3NlOiBmdW5jdGlvbiBleHBvc2UodGFyZ2V0LCBvcHRpb25zKSB7XG4gICAgICAgICAgICBpZiAoIXRhcmdldCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJ0YXJnZXQgaXMgbnVsbCBvciB1bmRlZmluZWRcIik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IG8gPSBvcHRpb25zIHx8IHt9O1xuICAgICAgICAgICAgY29uc3QgcHJlZml4ID1cbiAgICAgICAgICAgICAgICAodHlwZW9mIG8ucHJlZml4ID09PSBcInVuZGVmaW5lZFwiICYmIFwiYXNzZXJ0XCIpIHx8IG8ucHJlZml4O1xuICAgICAgICAgICAgY29uc3QgaW5jbHVkZUZhaWwgPVxuICAgICAgICAgICAgICAgIHR5cGVvZiBvLmluY2x1ZGVGYWlsID09PSBcInVuZGVmaW5lZFwiIHx8IEJvb2xlYW4oby5pbmNsdWRlRmFpbCk7XG4gICAgICAgICAgICBjb25zdCBpbnN0YW5jZSA9IHRoaXM7XG5cbiAgICAgICAgICAgIGZvckVhY2goT2JqZWN0LmtleXMoaW5zdGFuY2UpLCBmdW5jdGlvbiAobWV0aG9kKSB7XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICBtZXRob2QgIT09IFwiZXhwb3NlXCIgJiZcbiAgICAgICAgICAgICAgICAgICAgKGluY2x1ZGVGYWlsIHx8ICEvXihmYWlsKS8udGVzdChtZXRob2QpKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXRbZXhwb3NlZE5hbWUocHJlZml4LCBtZXRob2QpXSA9IGluc3RhbmNlW21ldGhvZF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiB0YXJnZXQ7XG4gICAgICAgIH0sXG5cbiAgICAgICAgbWF0Y2g6IGZ1bmN0aW9uIG1hdGNoKGFjdHVhbCwgZXhwZWN0YXRpb24pIHtcbiAgICAgICAgICAgIGNvbnN0IG1hdGNoZXIgPSBjcmVhdGVNYXRjaGVyKGV4cGVjdGF0aW9uKTtcbiAgICAgICAgICAgIGlmIChtYXRjaGVyLnRlc3QoYWN0dWFsKSkge1xuICAgICAgICAgICAgICAgIGFzc2VydC5wYXNzKFwibWF0Y2hcIik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnN0IGZvcm1hdHRlZCA9IFtcbiAgICAgICAgICAgICAgICAgICAgXCJleHBlY3RlZCB2YWx1ZSB0byBtYXRjaFwiLFxuICAgICAgICAgICAgICAgICAgICBgICAgIGV4cGVjdGVkID0gJHtpbnNwZWN0KGV4cGVjdGF0aW9uKX1gLFxuICAgICAgICAgICAgICAgICAgICBgICAgIGFjdHVhbCA9ICR7aW5zcGVjdChhY3R1YWwpfWAsXG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIGZhaWxBc3NlcnRpb24odGhpcywgam9pbihmb3JtYXR0ZWQsIFwiXFxuXCIpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gdmVyaWZ5SXNTdHViKCkge1xuICAgICAgICBjb25zdCBhcmdzID0gYXJyYXlTbGljZShhcmd1bWVudHMpO1xuXG4gICAgICAgIGZvckVhY2goYXJncywgZnVuY3Rpb24gKG1ldGhvZCkge1xuICAgICAgICAgICAgaWYgKCFtZXRob2QpIHtcbiAgICAgICAgICAgICAgICBhc3NlcnQuZmFpbChcImZha2UgaXMgbm90IGEgc3B5XCIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAobWV0aG9kLnByb3h5ICYmIG1ldGhvZC5wcm94eS5pc1Npbm9uUHJveHkpIHtcbiAgICAgICAgICAgICAgICB2ZXJpZnlJc1N0dWIobWV0aG9kLnByb3h5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtZXRob2QgIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgICAgICAgICBhc3NlcnQuZmFpbChgJHttZXRob2R9IGlzIG5vdCBhIGZ1bmN0aW9uYCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtZXRob2QuZ2V0Q2FsbCAhPT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGFzc2VydC5mYWlsKGAke21ldGhvZH0gaXMgbm90IHN0dWJiZWRgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHZlcmlmeUlzVmFsaWRBc3NlcnRpb24oYXNzZXJ0aW9uTWV0aG9kLCBhc3NlcnRpb25BcmdzKSB7XG4gICAgICAgIHN3aXRjaCAoYXNzZXJ0aW9uTWV0aG9kKSB7XG4gICAgICAgICAgICBjYXNlIFwibm90Q2FsbGVkXCI6XG4gICAgICAgICAgICBjYXNlIFwiY2FsbGVkXCI6XG4gICAgICAgICAgICBjYXNlIFwiY2FsbGVkT25jZVwiOlxuICAgICAgICAgICAgY2FzZSBcImNhbGxlZFR3aWNlXCI6XG4gICAgICAgICAgICBjYXNlIFwiY2FsbGVkVGhyaWNlXCI6XG4gICAgICAgICAgICAgICAgaWYgKGFzc2VydGlvbkFyZ3MubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGFzc2VydC5mYWlsKFxuICAgICAgICAgICAgICAgICAgICAgICAgYCR7YXNzZXJ0aW9uTWV0aG9kfSB0YWtlcyAxIGFyZ3VtZW50IGJ1dCB3YXMgY2FsbGVkIHdpdGggJHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhc3NlcnRpb25BcmdzLmxlbmd0aCArIDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gYXJndW1lbnRzYCxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZmFpbEFzc2VydGlvbihvYmplY3QsIG1zZykge1xuICAgICAgICBjb25zdCBvYmogPSBvYmplY3QgfHwgZ2xvYmFsT2JqZWN0O1xuICAgICAgICBjb25zdCBmYWlsTWV0aG9kID0gb2JqLmZhaWwgfHwgYXNzZXJ0LmZhaWw7XG4gICAgICAgIGZhaWxNZXRob2QuY2FsbChvYmosIG1zZyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbWlycm9yUHJvcEFzQXNzZXJ0aW9uKG5hbWUsIG1ldGhvZCwgbWVzc2FnZSkge1xuICAgICAgICBsZXQgbXNnID0gbWVzc2FnZTtcbiAgICAgICAgbGV0IG1ldGggPSBtZXRob2Q7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAyKSB7XG4gICAgICAgICAgICBtc2cgPSBtZXRob2Q7XG4gICAgICAgICAgICBtZXRoID0gbmFtZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGFzc2VydFtuYW1lXSA9IGZ1bmN0aW9uIChmYWtlKSB7XG4gICAgICAgICAgICB2ZXJpZnlJc1N0dWIoZmFrZSk7XG5cbiAgICAgICAgICAgIGNvbnN0IGFyZ3MgPSBhcnJheVNsaWNlKGFyZ3VtZW50cywgMSk7XG4gICAgICAgICAgICBsZXQgZmFpbGVkID0gZmFsc2U7XG5cbiAgICAgICAgICAgIHZlcmlmeUlzVmFsaWRBc3NlcnRpb24obmFtZSwgYXJncyk7XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWV0aCA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgZmFpbGVkID0gIW1ldGgoZmFrZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZhaWxlZCA9XG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiBmYWtlW21ldGhdID09PSBcImZ1bmN0aW9uXCJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gIWZha2VbbWV0aF0uYXBwbHkoZmFrZSwgYXJncylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogIWZha2VbbWV0aF07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChmYWlsZWQpIHtcbiAgICAgICAgICAgICAgICBmYWlsQXNzZXJ0aW9uKFxuICAgICAgICAgICAgICAgICAgICB0aGlzLFxuICAgICAgICAgICAgICAgICAgICAoZmFrZS5wcmludGYgfHwgZmFrZS5wcm94eS5wcmludGYpLmFwcGx5KFxuICAgICAgICAgICAgICAgICAgICAgICAgZmFrZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmNhdChbbXNnXSwgYXJncyksXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYXNzZXJ0LnBhc3MobmFtZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZXhwb3NlZE5hbWUocHJlZml4LCBwcm9wKSB7XG4gICAgICAgIHJldHVybiAhcHJlZml4IHx8IC9eZmFpbC8udGVzdChwcm9wKVxuICAgICAgICAgICAgPyBwcm9wXG4gICAgICAgICAgICA6IHByZWZpeCArXG4gICAgICAgICAgICAgICAgICBzdHJpbmdTbGljZShwcm9wLCAwLCAxKS50b1VwcGVyQ2FzZSgpICtcbiAgICAgICAgICAgICAgICAgIHN0cmluZ1NsaWNlKHByb3AsIDEpO1xuICAgIH1cblxuICAgIG1pcnJvclByb3BBc0Fzc2VydGl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iAoYmVoYXZpb3IuY2FsbGJhY2tBc3luYykge1xuICAgICAgICAgICAgbmV4dFRpY2soZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGZ1bmMuYXBwbHkoXG4gICAgICAgICAgICAgICAgICAgIGJlaGF2aW9yLmNhbGxiYWNrQ29udGV4dCxcbiAgICAgICAgICAgICAgICAgICAgYmVoYXZpb3IuY2FsbGJhY2tBcmd1bWVudHMsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmMuYXBwbHkoXG4gICAgICAgICAgICAgICAgYmVoYXZpb3IuY2FsbGJhY2tDb250ZXh0LFxuICAgICAgICAgICAgICAgIGJlaGF2aW9yLmNhbGxiYWNrQXJndW1lbnRzLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB1bmRlZmluZWQ7XG59XG5cbmNvbnN0IHByb3RvID0ge1xuICAgIGNyZWF0ZTogZnVuY3Rpb24gY3JlYXRlKHN0dWIpIHtcbiAgICAgICAgY29uc3QgYmVoYXZpb3IgPSBleHRlbmQoe30sIHByb3RvKTtcbiAgICAgICAgZGVsZXRlIGJlaGF2aW9yLmNyZWF0ZTtcbiAgICAgICAgZGVsZXRlIGJlaGF2aW9yLmFkZEJlaGF2aW9yO1xuICAgICAgICBkZWxldGUgYmVoYXZpb3IuY3JlYXRlQmVoYXZpb3I7XG4gICAgICAgIGJlaGF2aW9yLnN0dWIgPSBzdHViO1xuXG4gICAgICAgIGlmIChzdHViLmRlZmF1bHRCZWhhdmlvciAmJiBzdHViLmRlZmF1bHRCZWhhdmlvci5wcm9taXNlTGlicmFyeSkge1xuICAgICAgICAgICAgYmVoYXZpb3IucHJvbWlzZUxpYnJhcnkgPSBzdHViLmRlZmF1bHRCZWhhdmlvci5wcm9taXNlTGlicmFyeTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBiZWhhdmlvcjtcbiAgICB9LFxuXG4gICAgaXNQcmVzZW50OiBmdW5jdGlvbiBpc1ByZXNlbnQoKSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICB0eXBlb2YgdGhpcy5jYWxsQXJnQXQgPT09IFwibnVtYmVyXCIgfHxcbiAgICAgICAgICAgIHRoaXMuZXhjZXB0aW9uIHx8XG4gICAgICAgICAgICB0aGlzLmV4Y2VwdGlvbkNyZWF0b3IgfHxcbiAgICAgICAgICAgIHR5cGVvZiB0aGlzLnJldHVybkFyZ0F0ID09PSBcIm51bWJlclwiIHx8XG4gICAgICAgICAgICB0aGlzLnJldHVyblRoaXMgfHxcbiAgICAgICAgICAgIHR5cGVvZiB0aGlzLnJlc29sdmVBcmdBdCA9PT0gXCJudW1iZXJcIiB8fFxuICAgICAgICAgICAgdGhpcy5yZXNvbHZlVGhpcyB8fFxuICAgICAgICAgICAgdHlwZW9mIHRoaXMudGhyb3dBcmdBdCA9PT0gXCJudW1iZXJcIiB8fFxuICAgICAgICAgICAgdGhpcy5mYWtlRm4gfHxcbiAgICAgICAgICAgIHRoaXMucmV0dXJuVmFsdWVEZWZpbmVkXG4gICAgICAgICk7XG4gICAgfSxcblxuICAgIC8qZXNsaW50IGNvbXBsZXhpdHk6IFtcImVycm9yXCIsIDIwXSovXG4gICAgaW52b2tlOiBmdW5jdGlvbiBpbnZva2UoY29udGV4dCwgYXJncykge1xuICAgICAgICAvKlxuICAgICAgICAgKiBjYWxsQ2FsbGJhY2sgKGNvbmRpdGlvbmFsbHkpIGNhbGxzIGVuc3VyZUFyZ3NcbiAgICAgICAgICpcbiAgICAgICAgICogTm90ZTogY2FsbENhbGxiYWNrIGludGVudGlvbmFsbHkgaGFwcGVucyBiZWZvcmVcbiAgICAgICAgICogZXZlcnl0aGluZyBlbHNlIGFuZCBjYW5ub3QgYmUgbW92ZWQgbG93ZXJcbiAgICAgICAgICovXG4gICAgICAgIGNvbnN0IHJldHVyblZhbHVlID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dE9iaixcbiAgICAgICAgICAgIHJvb3RTdHViLnByb3BOYW1lLFxuICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGFjY2Vzc29yLXBhaXJzXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2V0OiBzZXR0ZXJGdW5jdGlvbixcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IGlzUHJvcGVydHlDb25maWd1cmFibGUoXG4gICAgICAgICAgICAgICAgICAgIHJvb3RTdHViLnJvb3RPYmosXG4gICAgICAgICAgICAgICAgICAgIHJvb3RTdHViLnByb3BOYW1lLFxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICB9LFxuICAgICAgICApO1xuXG4gICAgICAgIHJldHVybiBmYWtlO1xuICAgIH0sXG5cbiAgICB2YWx1ZTogZnVuY3Rpb24gdmFsdWUoZmFrZSwgbmV3VmFsKSB7XG4gICAgICAgIGNvbnN0IHJvb3RTdHViID0gZmFrZS5zdHViIHx8IGZha2U7XG5cbiAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHJvb3RTdHViLnJvb3RPYmosIHJvb3RTdHViLnByb3BOYW1lLCB7XG4gICAgICAgICAgICB2YWx1ZTogbmV3VmFsLFxuICAgICAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgICAgIHdyaXRhYmxlOiB0cnVlLFxuICAgICAgICAgICAgY29uZmlndXJhYmxlOlxuICAgICAgICAgICAgICAgIHJvb3RTdHViLnNoYWRvd3NQcm9wT25Qcm90b3R5cGUgfHxcbiAgICAgICAgICAgICAgICBpc1Byb3BlcnR5Q29uZmlndXJhYmxlKHJvb3RTdHViLnJvb3RPYmosIHJvb3RTdHViLnByb3BOYW1lKSxcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIGZha2U7XG4gICAgfSxcbn07XG5cbmNvbnN0IGFzeW5jQmVoYXZpb3JzID0gZXhwb3J0QXN5bmNCZWhhdmlvcnM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AgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWFyZ3MpIHtcbiAgICAgICAgICAgIG1vY2tFeHBlY3RhdGlvbi5mYWlsKFxuICAgICAgICAgICAgICAgIGAke3RoaXMubWV0aG9kfSByZWNlaXZlZCBubyBhcmd1bWVudHMsIGV4cGVjdGVkICR7aW5zcGVjdChcbiAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRBcmd1bWVudHMsXG4gICAgICAgICAgICAgICAgKX1gLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhcmdzLmxlbmd0aCA8IGV4cGVjdGVkQXJndW1lbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgbW9ja0V4cGVjdGF0aW9uLmZhaWwoXG4gICAgICAgICAgICAgICAgYCR7dGhpcy5tZXRob2R9IHJlY2VpdmVkIHRvbyBmZXcgYXJndW1lbnRzICgke2luc3BlY3QoXG4gICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgKX0pLCBleHBlY3RlZCAke2luc3BlY3QoZXhwZWN0ZWRBcmd1bWVudHMpfWAsXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgdGhpcy5leHBlY3RzRXhhY3RBcmdDb3VudCAmJlxuICAgICAgICAgICAgYXJncy5sZW5ndGggIT09IGV4cGVjdGVkQXJndW1lbnRzLmxlbmd0aFxuICAgICAgICApIHtcbiAgICAgICAgICAgIG1vY2tFeHBlY3RhdGlvbi5mYWlsKFxuICAgICAgICAgICAgICAgIGAke3RoaXMubWV0aG9kfSByZWNlaXZlZCB0b28gbWFueSBhcmd1bWVudHMgKCR7aW5zcGVjdChcbiAgICAgICAgICAgICAgICAgICAgYXJncyxcbiAgICAgICAgICAgICAgICApfSksIGV4cGVjdGVkICR7aW5zcGVjdChleHBlY3RlZEFyZ3VtZW50cyl9YCxcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3JFYWNoKFxuICAgICAgICAgICAgZXhwZWN0ZWRBcmd1bWVudHMsXG4gICAgICAgICAgICBmdW5jdGlvbiAoZXhwZWN0ZWRBcmd1bWVudCwgaSkge1xuICAgICAgICAgICAgICAgIGlmICghdmVyaWZ5TWF0Y2hlcihleHBlY3RlZEFyZ3VtZW50LCBhcmdzW2ldKSkge1xuICAgICAgICAgICAgICAgICAgICBtb2NrRXhwZWN0YXRpb24uZmFpbChcbiAgICAgICAgICAgICAgICAgICAgICAgIGAke3RoaXMubWV0aG9kfSByZWNlaXZlZCB3cm9uZyBhcmd1bWVudHMgJHtpbnNwZWN0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICApfSwgZGlkbid0IG1hdGNoICR7U3RyaW5nKGV4cGVjdGVkQXJndW1lbnRzKX1gLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghZGVlcEVxdWFsKGFyZ3NbaV0sIGV4cGVjdGVkQXJndW1lbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIG1vY2tFeHBlY3RhdGlvbi5mYWlsKFxuICAgICAgICAgICAgICAgICAgICAgICAgYCR7dGhpcy5tZXRob2R9IHJlY2VpdmVkIHdyb25nIGFyZ3VtZW50cyAke2luc3BlY3QoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJncyxcbiAgICAgICAgICAgICAgICAgICAgICAgICl9LCBleHBlY3RlZCAke2luc3BlY3QoZXhwZWN0ZWRBcmd1bWVudHMpfWAsXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICk7XG4gICAgfSxcblxuICAgIGFsbG93c0NhbGw6IGZ1bmN0aW9uIGFsbG93c0NhbGwodGhpc1ZhbHVlLCB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VjdHMobWV0aG9kKSB7XG4gICAgICAgIGlmICghbWV0aG9kKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFwibWV0aG9kIGlzIGZhbHN5XCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCF0aGlzLmV4cGVjdGF0aW9ucykge1xuICAgICAgICAgICAgdGhpcy5leHBlY3RhdGlvbnMgPSB7fTtcbiAgICAgICAgICAgIHRoaXMucHJveGllcyA9IFtdO1xuICAgICAgICAgICAgdGhpcy5mYWlsdXJlcyA9IFtdO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCF0aGlzLmV4cGVjdGF0aW9uc1ttZXRob2RdKSB7XG4gICAgICAgICAgICB0aGlzLmV4cGVjdGF0aW9uc1ttZXRob2RdID0gW107XG4gICAgICAgICAgICBjb25zdCBtb2NrT2JqZWN0ID0gdGhpcztcblxuICAgICAgICAgICAgd3JhcE1ldGhvZCh0aGlzLm9iamVjdCwgbWV0aG9kLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vY2tPYmplY3QuaW52b2tlTWV0aG9kKG1ldGhvZCwgdGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBwdXNoKHRoaXMucHJveGllcywgbWV0aG9kKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGV4cGVjdGF0aW9uID0gbW9ja0V4cGVjdGF0aW9uLmNyZWF0ZShtZXRob2QpO1xuICAgICAgICBleHBlY3RhdGlvbi53cmFwcGVkTWV0aG9kID0gdGhpcy5vYmplY3RbbWV0aG9kXS53cmFwcGVkTWV0aG9kO1xuICAgICAgICBwdXNoKHRoaXMuZXhwZWN0YXRpb25zW21ldGhvZF0sIGV4cGVjdGF0aW9uKTtcblxuICAgICAgICByZXR1cm4gZXhwZWN0YXRpb247XG4gICAgfSxcblxuICAgIHJlc3RvcmU6IGZ1bmN0aW9uIHJlc3RvcmUoKSB7XG4gICAgICAgIGNvbnN0IG9iamVjdCA9IHRoaXMub2JqZWN0O1xuXG4gICAgICAgIGVhY2godGhpcy5wcm94aWVzLCBmdW5jdGlvbiAocHJveHkpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygb2JqZWN0W3Byb3h5XS5yZXN0b3JlID09PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgICAgICBvYmplY3RbcHJveHldLnJlc3RvcmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIHZlcmlmeTogZnVuY3Rpb24gdmVyaWZ5KCkge1xuICAgICAgICBjb25zdCBleHBlY3RhdGlvbnMgPSB0aGlzLmV4cGVjdGF0aW9ucyB8fCB7fTtcbiAgICAgICAgY29uc3QgbWVzc2FnZXMgPSB0aGlzLmZhaWx1cmVzID8gc2xpY2UodGhpcy5mYWlsdXJlcykgOiBbXTtcbiAgICAgICAgY29uc3QgbWV0ID0gW107XG5cbiAgICAgICAgZWFjaCh0aGlzLnByb3hpZXMsIGZ1bmN0aW9uIChwcm94eSkge1xuICAgICAgICAgICAgZWFjaChleHBlY3RhdGlvbnNbcHJveHldLCBmdW5jdGlvbiAoZXhwZWN0YXRpb24pIHtcbiAgICAgICAgICAgICAgICBpZiAoIWV4cGVjdGF0aW9uLm1ldCgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHB1c2gobWVzc2FnZXMsIFN0cmluZyhleHBlY3RhdGlvbikpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHB1c2gobWV0LCBTdHJpbmcoZXhwZWN0YXRpb24pKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdGhpcy5yZXN0b3JlKCk7XG5cbiAgICAgICAgaWYgKG1lc3NhZ2VzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIG1vY2tFeHBlY3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wZWN0ZWRBcmd1bWVudHMgfHwgW107XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXlFcXVhbHMoXG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkQXJncyxcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudEFyZ3MsXG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdGF0aW9uLmV4cGVjdHNFeGFjdEFyZ0NvdW50LFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICApO1xuXG4gICAgICAgIGNvbnN0IGV4cGVjdGF0aW9uc1RvQXBwbHkgPSBmaWx0ZXIoXG4gICAgICAgICAgICBleHBlY3RhdGlvbnNXaXRoTWF0Y2hpbmdBcmdzLFxuICAgICAgICAgICAgZnVuY3Rpb24gKGV4cGVjdGF0aW9uKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgIWV4cGVjdGF0aW9uLm1ldCgpICYmXG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdGF0aW9uLmFsbG93c0NhbGwodGhpc1ZhbHVlLCBhcmdzKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICApO1xuXG4gICAgICAgIGlmIChleHBlY3RhdGlvbnNUb0FwcGx5Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIHJldHVybiBleHBlY3RhdGlvbnNUb0FwcGx5WzBdLmFwcGx5KHRoaXNWYWx1ZSwgYXJncyk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBtZXNzYWdlcyA9IFtdO1xuICAgICAgICBsZXQgZXhoYXVzdGVkID0gMDtcblxuICAgICAgICBmb3JFYWNoKGV4cGVjdGF0aW9uc1dpdGhNYXRjaGluZ0FyZ3MsIGZ1bmN0aW9uIChleHBlY3RhdGlvbikge1xuICAgICAgICAgICAgaWYgKGV4cGVjdGF0aW9uLmFsbG93c0NhbGwodGhpc1ZhbHVlLCBhcmdzKSkge1xuICAgICAgICAgICAgICAgIGF2YWlsYWJsZSA9IGF2YWlsYWJsZSB8fCBleHBlY3RhdGlvbjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZXhoYXVzdGVkICs9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChhdmFpbGFibGUgJiYgZXhoYXVzdGVkID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gYXZhaWxhYmxlLmFwcGx5KHRoaXNWYWx1ZSwgYXJncyk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3JFYWNoKGV4cGVjdGF0aW9ucywgZnVuY3Rpb24gKGV4cGVjdGF0aW9uKSB7XG4gICAgICAgICAgICBwdXNoKG1lc3NhZ2VzLCBgICAgICR7U3RyaW5nKGV4cGVjdGF0aW9uKX1gKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdW5zaGlmdChcbiAgICAgICAgICAgIG1lc3NhZ2VzLFxuICAgICAgICAgICAgYFVuZXhwZWN0ZWQgY2FsbDogJHtwcm94eUNhbGxUb1N0cmluZy5jYWxsKHtcbiAgICAgICAgICAgICAgICBwcm94eTogbWV0aG9kLFxuICAgICAgICAgICAgICAgIGFyZ3M6IGFyZ3MsXG4gICAgICAgICAgICB9KX1gLFxuICAgICAgICApO1xuXG4gICAgICAgIGNvbnN0IGVyciA9IG5ldyBFcnJvcigpO1xuICAgICAgICBpZiAoIWVyci5zdGFjaykge1xuICAgICAgICAgICAgLy8gUGhhbnRvbUpTIGRvZXMgbm90IHNlcmlhbGl6ZSB0aGUgc3RhY2sgdHJhY2UgdW50aWwgdGhlIGVycm9yIGhhcyBiZWVuIHRocm93blxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgLyogZW1wdHkgKi9cbiAgICAgICAgICAgIH1cbiAgIC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4gICAgICAgIH1cblxuICAgICAgICBsZXQgY3VycmVudENhbGw7XG4gICAgICAgIGxldCBtYXRjaGVzID0gMDtcbiAgICAgICAgY29uc3QgcmV0dXJuVmFsdWVzID0gW107XG5cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGwgPSB0aGlzLmNhbGxDb3VudDsgaSA8IGw7IGkgKz0gMSkge1xuICAgICAgICAgICAgY3VycmVudENhbGwgPSB0aGlzLmdldENhbGwoaSk7XG4gICAgICAgICAgICBjb25zdCByZXR1cm5WYWx1ZSA9IGN1cnJlbnRDYWxsW2FjdHVhbCB8fCBtZXRob2RdLmFwcGx5KFxuICAgICAgICAgICAgICAgIGN1cnJlbnRDYWxsLFxuICAgICAgICAgICAgICAgIGFyZ3VtZW50cyxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBwdXNoKHJldHVyblZhbHVlcywgcmV0dXJuVmFsdWUpO1xuICAgICAgICAgICAgaWYgKHJldHVyblZhbHVlKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2hlcyArPSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoQW55KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyZXR1cm5zVmFsdWVzKSB7XG4gICAgICAgICAgICByZXR1cm4gcmV0dXJuVmFsdWVzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtYXRjaGVzID09PSB0aGlzLmNhbGxDb3VudDtcbiAgICB9O1xufTtcbiIsIlwidXNlIHN0cmljdFwiO1xuXG5jb25zdCBhcnJheVByb3RvID0gcmVxdWlyZShcIkBzaW5vbmpzL2NvbW1vbnNcIikucHJvdG90eXBlcy5hcnJheTtcbmNvbnN0IG1hdGNoID0gcmVxdWlyZShcIkBzaW5vbmpzL3NhbXNhbVwiKS5jcmVhdGVNYXRjaGVyO1xuY29uc3QgZGV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HVybiB0aGlzLnlpZWxkT24uYXBwbHkodGhpcywgY29uY2F0KFtudWxsXSwgc2xpY2UoYXJndW1lbnRzLCAwKSkpO1xuICAgIH0sXG5cbiAgICB5aWVsZE9uOiBmdW5jdGlvbiAodGhpc1ZhbHVlKSB7XG4gICAgICAgIGNvbnN0IGFyZ3MgPSBzbGljZSh0aGlzLmFyZ3MpO1xuICAgICAgICBjb25zdCB5aWVsZEZuID0gZmlsdGVyKGFyZ3MsIGZ1bmN0aW9uIChhcmcpIHtcbiAgICAgICAgICAgIHJldHVybiB0eXBlb2YgYXJnID09PSBcImZ1bmN0aW9uXCI7XG4gICAgICAgIH0pWzBdO1xuXG4gICAgICAgIGlmICgheWllbGRGbikge1xuICAgICAgICAgICAgdGhyb3dZaWVsZEVycm9yKFxuICAgICAgICAgICAgICAgIHRoaXMucHJveHksXG4gICAgICAgICAgICAgICAgXCIgY2Fubm90IHlpZWxkIHNpbmNlIG5vIGNhbGxiYWNrIHdhcyBwYXNzZWQuXCIsXG4gICAgICAgICAgICAgICAgYXJncyxcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4geWllbGRGbi5hcHBseSh0aGlzVmFsdWUsIHNsaWNlKGFyZ3VtZW50cywgMSkpO1xuICAgIH0sXG5cbiAgICB5aWVsZFRvOiBmdW5jdGlvbiAocHJvcCkge1xuICAgICAgICByZXR1cm4gdGhpcy55aWVsZFRvT24uYXBwbHkoXG4gICAgICAgICAgICB0aGlzLFxuICAgICAgICAgICAgY29uY2F0KFtwcm9wLCBudWxsXSwgc2xpY2UoYXJndW1lbnRzLCAxKSksXG4gICAgICAgICk7XG4gICAgfSxcblxuICAgIHlpZWxkVG9PbjogZnVuY3Rpb24gKHByb3AsIHRoaXNWYWx1ZSkge1xuICAgICAgICBjb25zdCBhcmdzID0gc2xpY2UodGhpcy5hcmdzKTtcbiAgICAgICAgY29uc3QgeWllbGRBcmcgPSBmaWx0ZXIoYXJncywgZnVuY3Rpb24gKGFyZykge1xuICAgICAgICAgICAgcmV0dXJuIGFyZyAmJiB0eXBlb2YgYXJnW3Byb3BdID09PSBcImZ1bmN0aW9uXCI7XG4gICAgICAgIH0pWzBdO1xuICAgICAgICBjb25zdCB5aWVsZEZuID0geWllbGRBcmcgJiYgeWllbGRBcmdbcHJvcF07XG5cbiAgICAgICAgaWYgKCF5aWVsZEZuKSB7XG4gICAgICAgICAgICB0aHJvd1lpZWxkRXJyb3IoXG4gICAgICAgICAgICAgICAgdGhpcy5wcm94eSxcbiAgICAgICAgICAgICAgICBgIGNhbm5vdCB5aWVsZCB0byAnJHt2YWx1ZVRvU3RyaW5nKFxuICAgICAgICAgICAgICAgICAgICBwcm9wLFxuICAgICAgICAgICAgICAgICl9JyBzaW5jZSBubyBjYWxsYmFjayB3YXMgcGFzc2VkLmAsXG4gICAgICAgICAgICAgICAgYXJncyxcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4geWllbGRGbi5hcHBseSh0aGlzVmFsdWUsIHNsaWNlKGFyZ3VtZW50cywgMikpO1xuICAgIH0sXG5cbiAgICB0b1N0cmluZzogZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoIXRoaXMuYXJncykge1xuICAgICAgICAgICAgcmV0dXJuIFwiOihcIjtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBjYWxsU3RyID0gdGhpcy5wcm94eSA/IGAke1N0cmluZyh0aGlzLnByb3h5KX0oYCA6IFwiXCI7XG4gICAgICAgIGNvbnN0IGZvcm1hdHRlZEFyZ3MgPSBtYXAodGhpcy5hcmdzLCBmdW5jdGlvbiAoYXJnKSB7XG4gICAgICAgICAgICByZXR1cm4gaW5zcGVjdChhcmcpO1xuICAgICAgICB9KTtcblxuICAgICAgICBjYWxsU3RyID0gYCR7Y2FsbFN0ciArIGpvaW4oZm9ybWF0dGVkQXJncywgXCIsIFwiKX0pYDtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMucmV0dXJuVmFsdWUgIT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgIGNhbGxTdHIgKz0gYCA9PiAke2luc3BlY3QodGhpcy5yZXR1cm5WYWx1ZSl9YDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmV4Y2VwdGlvbikge1xuICAgICAgICAgICAgY2FsbFN0ciArPSBgICEke3RoaXMuZXhjZXB0aW9uLm5hbWV9YDtcblxuICAgICAgICAgICAgaWYgKHRoaXMuZXhjZXB0aW9uLm1lc3NhZ2UpIHtcbiAgICAgICAgICAgICAgICBjYWxsU3RyICs9IGAoJHt0aGlzLmV4Y2VwdGlvbi5tZXNzYWdlfSlgO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aGlzLnN0YWNrKSB7XG4gICAgICAgICAgICAvLyBJZiB3ZSBoYXZlIGEgc3RhY2ssIGFkZCB0aGUgZmlyc3QgZnJhbWUgdGhhdCdzIGluIGVuZC11c2VyIGNvZGVcbiAgICAgICAgICAgIC8vIFNraXAgdGhlIGZpcnN0IHR3byBmcmFtZXMgYmVjYXVzZSB0aGV5IHdpbGwgcmVmZXIgdG8gU2lub24gY29kZVxuICAgICAgICAgICAgY2FsbFN0ciArPSAodGhpcy5zdGFjay5zcGxpdChcIlxcblwiKVszXSB8fCBcInVua25vd25cIikucmVwbGFjZShcbiAgICAgICAgICAgICAgICAvXlxccyooPzphdFxccyt8QCk/LyxcbiAgICAgICAgICAgICAgICBcIiBhdCBcIixcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY2FsbFN0cjtcbiAgICB9LFxuXG4gICAgZW5zdXJlQXJnSXNBRnVuY3Rpb246IGZ1bmN0aW9uIChwb3MpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB0aGlzLmFyZ3NbcG9zXSAhPT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKFxuICAgICAgICA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gICAgcmV0dXJuIGluc3BlY3QoYXJnc1tzcGVjaWZpZXIgLSAxXSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBgJSR7c3BlY2lmaWVyfWA7XG4gICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICByZXNldEhpc3Rvcnk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHRoaXMuaW52b2tpbmcpIHtcbiAgICAgICAgICAgIGNvbnN0IGVyciA9IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICBcIkNhbm5vdCByZXNldCBTaW5vbiBmdW5jdGlvbiB3aGlsZSBpbnZva2luZyBpdC4gXCIgK1xuICAgICAgICAgICAgICAgICAgICBcIk1vdmUgdGhlIGNhbGwgdG8gLnJlc2V0SGlzdG9yeSBvdXRzaWRlIG9mIHRoZSBjYWxsYmFjay5cIixcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBlcnIubmFtZSA9IFwiSW52YWxpZFJlc2V0RXhjZXB0aW9uXCI7XG4gICAgICAgICAgICB0aHJvdyBlcnI7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNhbGxlZCA9IGZhbHNlO1xuICAgICAgICB0aGlzLm5vdENhbGxlZCA9IHRydWU7XG4gICAgICAgIHRoaXMuY2FsbGVkT25jZSA9IGZhbHNlO1xuICAgICAgICB0aGlzLmNhbGxlZFR3aWNlID0gZmFsc2U7XG4gICAgICAgIHRoaXMuY2FsbGVkVGhyaWNlID0gZmFsc2U7XG4gICAgICAgIHRoaXMuY2FsbENvdW50ID0gMDtcbiAgICAgICAgdGhpcy5maXJzdENhbGwgPSBudWxsO1xuICAgICAgICB0aGlzLnNlY29uZENhbGwgPSBudWxsO1xuICAgICAgICB0aGlzLnRoaXJkQ2FsbCA9IG51bGw7XG4gICAgICAgIHRoaXMubGFzdENhbGwgPSBudWxsO1xuICAgICAgICB0aGlzLmFyZ3MgPSBbXTtcbiAgICAgICAgdGhpcy5maXJzdEFyZyA9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RnVuYy5sZW5ndGg7XG4gICAgbGV0IHA7XG4gICAgLy8gRG8gbm90IGNoYW5nZSB0aGlzIHRvIHVzZSBhbiBldmFsLiBQcm9qZWN0cyB0aGF0IGRlcGVuZCBvbiBzaW5vbiBibG9jayB0aGUgdXNlIG9mIGV2YWwuXG4gICAgLy8gcmVmOiBodHRwczovL2dpdGh1Yi5jb20vc2lub25qcy9zaW5vbi9pc3N1ZXMvNzEwXG4gICAgc3dpdGNoIChhcml0eSkge1xuICAgICAgICAvKmVzbGludC1kaXNhYmxlIG5vLXVudXNlZC12YXJzLCBtYXgtbGVuKi9cbiAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgcCA9IGZ1bmN0aW9uIHByb3h5KCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwLmludm9rZShmdW5jLCB0aGlzLCBzbGljZShhcmd1bWVudHMpKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgcCA9IGZ1bmN0aW9uIHByb3h5KGEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcC5pbnZva2UoZnVuYywgdGhpcywgc2xpY2UoYXJndW1lbnRzKSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgIHAgPSBmdW5jdGlvbiBwcm94eShhLCBiKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHAuaW52b2tlKGZ1bmMsIHRoaXMsIHNsaWNlKGFyZ3VtZW50cykpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICBwID0gZnVuY3Rpb24gcHJveHkoYSwgYiwgYykge1xuICAgICAgICAgICAgICAgIHJldHVybiBwLmludm9rZShmdW5jLCB0aGlzLCBzbGljZShhcmd1bWVudHMpKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgcCA9IGZ1bmN0aW9uIHByb3h5KGEsIGIsIGMsIGQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcC5pbnZva2UoZnVuYywgdGhpcywgc2xpY2UoYXJndW1lbnRzKSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgIHAgPSBmdW5jdGlvbiBwcm94eShhLCBiLCBjLCBkLCBlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHAuaW52b2tlKGZ1bmMsIHRoaXMsIHNsaWNlKGFyZ3VtZW50cykpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICBwID0gZnVuY3Rpb24gcHJveHkoYSwgYiwgYywgZCwgZSwgZikge1xuICAgICAgICAgICAgICAgIHJldHVybiBwLmludm9rZShmdW5jLCB0aGlzLCBzbGljZShhcmd1bWVudHMpKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgcCA9IGZ1bmN0aW9uIHByb3h5KGEsIGIsIGMsIGQsIGUsIGYsIGcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcC5pbnZva2UoZnVuYywgdGhpcywgc2xpY2UoYXJndW1lbnRzKSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgODpcbiAgICAgICAgICAgIHAgPSBmdW5jdGlvbiBwcm94eShhLCBiLCBjLCBkLCBlLCBmLCBnLCBoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHAuaW52b2tlKGZ1bmMsIHRoaXMsIHNsaWNlKGFyZ3VtZW50cykpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDk6XG4gICAgICAgICAgICBwID0gZnVuY3Rpb24gcHJveHkoYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwLmludm9rZShmdW5jLCB0aGlzLCBzbGljZShhcmd1bWVudHMpKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgY2FzZSAxMDpcbiAgICAgICAgICAgIHAgPSBmdW5jdGlvbiBwcm94eShhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHAuaW52b2tlKGZ1bmMsIHRoaXMsIHNsaWNlKGFyZ3VtZW50cykpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlIDExOlxuICAgICAgICAgICAgcCA9IGZ1bmN0aW9uIHByb3h5KGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGspIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcC5pbnZva2UoZnVuYywgdGhpcywgc2xpY2UoYXJndW1lbnRzKSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMTI6XG4gICAgICAgICAgICBwID0gZnVuY3Rpb24gcHJveHkoYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwLmludm9rZShmdW5jLCB0aGlzLCBzbGljZShhcmd1bWVudHMpKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHAgPSBmdW5jdGlvbiBwcm94eSgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcC5pbnZva2UoZnVuYywgdGhpcywgc2xpY2UoYXJndW1lbnRzKSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgY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MpO1xuXG4gICAgICAgIGNvbnN0IG93bk1ldGhvZHMgPSBjb2xsZWN0T3duTWV0aG9kcyhzdHViYmVkKTtcblxuICAgICAgICBmb3JFYWNoKG93bk1ldGhvZHMsIGZ1bmN0aW9uIChtZXRob2QpIHtcbiAgICAgICAgICAgIGFkZFRvQ29sbGVjdGlvbihtZXRob2QpO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gc3R1YmJlZDtcbiAgICB9O1xuXG4gICAgc2FuZGJveC5pbmplY3QgPSBmdW5jdGlvbiBpbmplY3Qob2JqKSB7XG4gICAgICAgIG9iai5zcHkgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gc2FuZGJveC5zcHkuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgfTtcblxuICAgICAgICBvYmouc3R1YiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBzYW5kYm94LnN0dWIuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgfTtcblxuICAgICAgICBvYmoubW9jayA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBzYW5kYm94Lm1vY2suYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgfTtcblxuICAgICAgICBvYmouY3JlYXRlU3R1Ykluc3RhbmNlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHNhbmRib3guY3JlYXRlU3R1Ykluc3RhbmNlLmFwcGx5KHNhbmRib3gsIGFyZ3VtZW50cyk7XG4gICAgICAgIH07XG5cbiAgICAgICAgb2JqLmZha2UgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gc2FuZGJveC5mYWtlLmFwcGx5KG51bGwsIGFyZ3VtZW50cyk7XG4gICAgICAgIH07XG5cbiAgICAgICAgb2JqLmRlZmluZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBzYW5kYm94LmRlZmluZS5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgICAgICB9O1xuXG4gICAgICAgIG9iai5yZXBsYWNlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHNhbmRib3gucmVwbGFjZS5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgICAgICB9O1xuXG4gICAgICAgIG9iai5yZXBsYWNlU2V0dGVyID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHNhbmRib3gucmVwbGFjZVNldHRlci5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgICAgICB9O1xuXG4gICAgICAgIG9iai5yZXBsYWNlR2V0dGVyID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuIHNhbmRib3gucmVwbGFjZUdldHRlci5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChzYW5kYm94LmNsb2NrKSB7XG4gICAgICAgICAgICBvYmouY2xvY2sgPSBzYW5kYm94LmNsb2NrO1xuICAgICAgICB9XG5cbiAgICAgICAgb2JqLm1hdGNoID0gbWF0Y2g7XG5cbiAgICAgICAgcmV0dXJuIG9iajtcbiAgICB9O1xuXG4gICAgc2FuZGJveC5tb2NrID0gZnVuY3Rpb24gbW9jaygpIHtcbiAgICAgICAgY29uc3QgbSA9IHNpbm9uTW9jay5hcHBseShudWxsLCBhcmd1bWVudHMpO1xuXG4gICAgICAgIGFkZFRvQ29sbGVjdGlvbihtKTtcblxuICAgICAgICByZXR1cm4gbTtcbiAgICB9O1xuXG4gICAgc2FuZGJveC5yZXNldCA9IGZ1bmN0aW9uIHJlc2V0KCkge1xuICAgICAgICBhcHBseU9uRWFjaChjb2xsZWN0aW9uLCBcInJlc2V0XCIpO1xuICAgICAgICBhcHBseU9uRWFjaChjb2xsZWN0aW9uLCBcInJlc2V0SGlzdG9yeVwiKTtcbiAgICB9O1xuXG4g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wZXJ0eV07XG5cbiAgICAgICAgZnVuY3Rpb24gcmVzdG9yZXIoKSB7XG4gICAgICAgICAgICBpZiAoZm9yY2VBc3NpZ25tZW50KSB7XG4gICAgICAgICAgICAgICAgb2JqZWN0W3Byb3BlcnR5XSA9IHZhbHVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChkZXNjcmlwdG9yPy5pc093bikge1xuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmplY3QsIHByb3BlcnR5LCBkZXNjcmlwdG9yKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIG9iamVjdFtwcm9wZXJ0eV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXN0b3Jlci5vYmplY3QgPSBvYmplY3Q7XG4gICAgICAgIHJlc3RvcmVyLnByb3BlcnR5ID0gcHJvcGVydHk7XG4gICAgICAgIHJldHVybiByZXN0b3JlcjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB2ZXJpZnlOb3RSZXBsYWNlZChvYmplY3QsIHByb3BlcnR5KSB7XG4gICAgICAgIGZvckVhY2goZmFrZVJlc3RvcmVycywgZnVuY3Rpb24gKGZha2VSZXN0b3Jlcikge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIGZha2VSZXN0b3Jlci5vYmplY3QgPT09IG9iamVjdCAmJlxuICAgICAgICAgICAgICAgIGZha2VSZXN0b3Jlci5wcm9wZXJ0eSA9PT0gcHJvcGVydHlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgIGBBdHRlbXB0ZWQgdG8gcmVwbGFjZSAke3Byb3BlcnR5fSB3aGljaCBpcyBhbHJlYWR5IHJlcGxhY2VkYCxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG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Byb3BlcnR5ICR7dmFsdWVUb1N0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydHksXG4gICAgICAgICAgICAgICAgKX1gLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgcmVwbGFjZW1lbnQgIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICBcIkV4cGVjdGVkIHJlcGxhY2VtZW50IGFyZ3VtZW50IHRvIGJlIGEgZnVuY3Rpb25cIixcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIGRlc2NyaXB0b3IuZ2V0ICE9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImBvYmplY3QucHJvcGVydHlgIGlzIG5vdCBhIGdldHRlclwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZlcmlmeU5vdFJlcGxhY2VkKG9iamVjdCwgcHJvcGVydHkpO1xuXG4gICAgICAgIC8vIHN0b3JlIGEgZnVuY3Rpb24gZm9yIHJlc3RvcmluZyB0aGUgcmVwbGFjZWQgcHJvcGVydHlcbiAgICAgICAgcHVzaChmYWtlUmVzdG9yZXJzLCBnZXRGYWtlUmVzdG9yZXIob2JqZWN0LCBwcm9wZXJ0eSkpO1xuXG4gICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmplY3QsIHByb3BlcnR5LCB7XG4gICAgICAgICAgICBnZXQ6IHJlcGxhY2VtZW50LFxuICAgICAgICAgICAgY29uZmlndXJhYmxlOiBpc1Byb3BlcnR5Q29uZmlndXJhYmxlKG9iamVjdCwgcHJvcGVydHkpLFxuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gcmVwbGFjZW1lbnQ7XG4gICAgfTtcblxuICAgIHNhbmRib3gucmVwbGFjZVNldHRlciA9IGZ1bmN0aW9uIHJlcGxhY2VTZXR0ZXIoXG4gICAgICAgIG9iamVjdCxcbiAgICAgICAgcHJvcGVydHksXG4gICAgICAgIHJlcGxhY2VtZW50LFxuICAgICkge1xuICAgICAgICBjb25zdCBkZXNjcmlwdG9yID0gZ2V0UHJvcGVydHlEZXNjcmlwdG9yKG9iamVjdCwgcHJvcGVydHkpO1xuXG4gICAgICAgIGlmICh0eXBlb2YgZGVzY3JpcHRvciA9PT0gXCJ1bmRlZmluZWRcIikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICBgQ2Fubm90IHJlcGxhY2Ugbm9uLWV4aXN0ZW50IHByb3BlcnR5ICR7dmFsdWVUb1N0cmluZyhcbiAgICAgICAgICAgICAgICAgICAgcHJvcGVydHksXG4gICAgICAgICAgICAgICAgKX1gLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgcmVwbGFjZW1lbnQgIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICBcIkV4cGVjdGVkIHJlcGxhY2VtZW50IGFyZ3VtZW50IHRvIGJlIGEgZnVuY3Rpb25cIixcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIGRlc2NyaXB0b3Iuc2V0ICE9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcImBvYmplY3QucHJvcGVydHlgIGlzIG5vdCBhIHNldHRlclwiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZlcmlmeU5vdFJlcGxhY2VkKG9iamVjdCwgcHJvcGVydHkpO1xuXG4gICAgICAgIC8vIHN0b3JlIGEgZnVuY3Rpb24gZm9yIHJlc3RvcmluZyB0aGUgcmVwbGFjZWQgcHJvcGVydHlcbiAgICAgICAgcHVzaChmYWt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AgICBhZGRUb0NvbGxlY3Rpb24oc3B5W2FjY2Vzc29yVHlwZV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYWRkVG9Db2xsZWN0aW9uKHNweSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gc3B5O1xuICAgIH1cblxuICAgIHNhbmRib3guc3B5ID0gZnVuY3Rpb24gc3B5KCkge1xuICAgICAgICBjb25zdCBjcmVhdGVkU3B5ID0gc2lub25TcHkuYXBwbHkoc2lub25TcHksIGFyZ3VtZW50cyk7XG4gICAgICAgIHJldHVybiBjb21tb25Qb3N0SW5pdFNldHVwKGFyZ3VtZW50cywgY3JlYXRlZFNweSk7XG4gICAgfTtcblxuICAgIHNhbmRib3guc3R1YiA9IGZ1bmN0aW9uIHN0dWIoKSB7XG4gICAgICAgIGNvbnN0IGNyZWF0ZWRTdHViID0gc2lub25TdHViLmFwcGx5KHNpbm9uU3R1YiwgYXJndW1lbnRzKTtcbiAgICAgICAgcmV0dXJuIGNvbW1vblBvc3RJbml0U2V0dXAoYXJndW1lbnRzLCBjcmVhdGVkU3R1Yik7XG4gICAgfTtcblxuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bnVzZWQtdmFyc1xuICAgIHNhbmRib3guZmFrZSA9IGZ1bmN0aW9uIGZha2UoZikge1xuICAgICAgICBjb25zdCBzID0gc2lub25GYWtlLmFwcGx5KHNpbm9uRmFrZSwgYXJndW1lbnRzKTtcblxuICAgICAgICBhZGRUb0NvbGxlY3Rpb24ocyk7XG5cbiAgICAgICAgcmV0dXJuIHM7XG4gICAgfTtcblxuICAgIGZvckVhY2goT2JqZWN0LmtleXMoc2lub25GYWtlKSwgZnVuY3Rpb24gKGtleSkge1xuICAgICAgICBjb25zdCBmYWtlQmVoYXZpb3IgPSBzaW5vbkZha2Vba2V5XTtcbiAgICAgICAgaWYgKHR5cGVvZiBmYWtlQmVoYXZpb3IgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgc2FuZGJveC5mYWtlW2tleV0gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgcyA9IGZha2VCZWhhdmlvci5hcHBseShmYWtlQmVoYXZpb3IsIGFyZ3VtZW50cyk7XG5cbiAgICAgICAgICAgICAgICBhZGRUb0NvbGxlY3Rpb24ocyk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gcztcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9KTtcblxuICAgIHNhbmRib3gudXNlRmFrZVRpbWVycyA9IGZ1bmN0aW9uIHVzZUZha2VUaW1lcnMoYXJncykge1xuICAgICAgICBjb25zdCBjbG9jayA9IHNpbm9uQ2xvY2sudXNlRmFrZVRpbWVycy5jYWxsKG51bGwsIGFyZ3MpO1xuXG4gICAgICAgIHNhbmRib3guY2xvY2sgPSBjbG9jaztcbiAgICAgICAgYWRkVG9Db2xsZWN0aW9uKGNsb2NrKTtcblxuICAgICAgICByZXR1cm4gY2xvY2s7XG4gICAgfTtcblxuICAgIHNhbmRib3gudmVyaWZ5ID0gZnVuY3Rpb24gdmVyaWZ5KCkge1xuICAgICAgICBhcHBseU9uRWFjaChjb2xsZWN0aW9uLCBcInZlcmlmeVwiKTtcbiAgICB9O1xuXG4gICAgc2FuZGJveC52ZXJpZnlBbmRSZXN0b3JlID0gZnVuY3Rpb24gdmVyaWZ5QW5kUmVzdG9yZSgpIHtcbiAgICAgICAgbGV0IGV4Y2VwdGlvbjtcblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgc2FuZGJveC52ZXJpZnkoKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgZXhjZXB0aW9uID0gZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHNhbmRib3gucmVzdG9yZSgpO1xuXG4gICAgICAgIGlmIChleGNlcHRpb24pIHtcbiAgICAgICAgICAgIHRocm93IGV4Y2VwdGlvbjtcbiAgIC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bGVkQXJncyA9IHNweUluc3RhbmNlLmdldENhbGwoaSkuYXJncztcbiAgICAgICAgICAgIGNvbnN0IGV4cGVjdGVkQXJncyA9IHNsaWNlKGFyZ3MpO1xuXG4gICAgICAgICAgICBmb3IgKFxuICAgICAgICAgICAgICAgIGxldCBqID0gMDtcbiAgICAgICAgICAgICAgICBqIDwgY2FsbGVkQXJncy5sZW5ndGggfHwgaiA8IGV4cGVjdGVkQXJncy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgKytqXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FsbGVkQXJnID0gY2FsbGVkQXJnc1tqXTtcbiAgICAgICAgICAgICAgICBsZXQgZXhwZWN0ZWRBcmcgPSBleHBlY3RlZEFyZ3Nbal07XG4gICAgICAgICAgICAgICAgaWYgKGNhbGxlZEFyZykge1xuICAgICAgICAgICAgICAgICAgICBjYWxsZWRBcmcgPSBxdW90ZVN0cmluZ1ZhbHVlKGNhbGxlZEFyZyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkQXJnKSB7XG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkQXJnID0gcXVvdGVTdHJpbmdWYWx1ZShleHBlY3RlZEFyZyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgbWVzc2FnZSArPSBcIlxcblwiO1xuXG4gICAgICAgICAgICAgICAgY29uc3QgY2FsbGVkQXJnTWVzc2FnZSA9XG4gICAgICAgICAgICAgICAgICAgIGogPCBjYWxsZWRBcmdzLmxlbmd0aCA/IGluc3BlY3QoY2FsbGVkQXJnKSA6IFwiXCI7XG4gICAgICAgICAgICAgICAgaWYgKG1hdGNoLmlzTWF0Y2hlcihleHBlY3RlZEFyZykpIHtcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSArPSBjb2xvclNpbm9uTWF0Y2hUZXh0KFxuICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRBcmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsZWRBcmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsZWRBcmdNZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4cGVjdGVkQXJnTWVzc2FnZSA9XG4gICAgICAgICAgICAgICAgICAgICAgICBqIDwgZXhwZWN0ZWRBcmdzLmxlbmd0aCA/IGluc3BlY3QoZXhwZWN0ZWRBcmcpIDogXCJcIjtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGlmZiA9IGpzRGlmZi5kaWZmSnNvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxlZEFyZ01lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHBlY3RlZEFyZ01lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgKz0gY29sb3JEaWZmVGV4dChkaWZmKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbWVzc2FnZTtcbiAgICB9LFxuXG4gICAgQzogZnVuY3Rpb24gKHNweUluc3RhbmNlKSB7XG4gICAgICAgIGNvbnN0IGNhbGxzID0gW107XG5cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGwgPSBzcHlJbnN0YW5jZS5jYWxsQ291bnQ7IGkgPCBsOyArK2kpIHtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAc2lub25qcy9uby1wcm90b3R5cGUtbWV0aG9kcy9uby1wcm90b3R5cGUtbWV0aG9kc1xuICAgICAgICAgICAgbGV0IHN0cmluZ2lmaWVkQ2FsbCA9IGAgICAgJHtzcHlJbnN0YW5jZS5nZXRDYWxsKGkpLnRvU3RyaW5nKCl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WVsZFRvT25cIixcbiAgICB0cnVlLFxuICAgIGZ1bmN0aW9uIChwcm9wZXJ0eSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICBgJHt0aGlzLnRvU3RyaW5nKCl9IGNhbm5vdCB5aWVsZCB0byAnJHt2YWx1ZVRvU3RyaW5nKFxuICAgICAgICAgICAgICAgIHByb3BlcnR5LFxuICAgICAgICAgICAgKX0nIHNpbmNlIGl0IHdhcyBub3QgeWV0IGludm9rZWQuYCxcbiAgICAgICAgKTtcbiAgICB9LFxuKTtcblxuZnVuY3Rpb24gY3JlYXRlU3B5KGZ1bmMpIHtcbiAgICBsZXQgbmFtZTtcbiAgICBsZXQgZnVuayA9IGZ1bmM7XG5cbiAgICBpZiAodHlwZW9mIGZ1bmsgIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICBmdW5rID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9O1xuICAgIH0gZWxzZSB7XG4gICAgICAgIG5hbWUgPSBmdW5jdGlvbk5hbWUoZnVuayk7XG4gICAgfVxuXG4gICAgY29uc3QgcHJveHkgPSBjcmVhdGVQcm94eShmdW5rLCBmdW5rKTtcblxuICAgIC8vIEluaGVyaXQgc3B5IEFQSTpcbiAgICBleHRlbmQubm9uRW51bShwcm94eSwgc3B5QXBpKTtcbiAgICBleHRlbmQubm9uRW51bShwcm94eSwge1xuICAgICAgICBkaXNwbGF5TmFtZTogbmFtZSB8fCBcInNweVwiLFxuICAgICAgICBmYWtlczogW10sXG4gICAgICAgIGluc3RhbnRpYXRlRmFrZTogY3JlYXRlU3B5LFxuICAgICAgICBpZDogYHNweSMke3V1aWQrK31gLFxuICAgIH0pO1xuICAgIHJldHVybiBwcm94eTtcbn1cblxuZnVuY3Rpb24gc3B5KG9iamVjdCwgcHJvcGVydHksIHR5cGVzKSB7XG4gICAgaWYgKGlzRXNNb2R1bGUob2JqZWN0KSkge1xuICAgICAgIC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HJlcXVpcmUoXCJAc2lub25qcy9jb21tb25zXCIpLnByb3RvdHlwZXMuYXJyYXk7XG5jb25zdCByZWR1Y2UgPSBhcnJheVByb3RvLnJlZHVjZTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBleHBvcnRBc3luY0JlaGF2aW9ycyhiZWhhdmlvck1ldGhvZHMpIHtcbiAgICByZXR1cm4gcmVkdWNlKFxuICAgICAgICBPYmplY3Qua2V5cyhiZWhhdmlvck1ldGhvZHMpLFxuICAgICAgICBmdW5jdGlvbiAoYWNjLCBtZXRob2QpIHtcbiAgICAgICAgICAgIC8vIG5lZWQgdG8gYXZvaWQgY3JlYXRpbmcgYW5vdGhlciBhc3luYyB2ZXJzaW9ucyBvZiB0aGUgbmV3bHkgYWRkZWQgYXN5bmMgbWV0aG9kc1xuICAgICAgICAgICAgaWYgKG1ldGhvZC5tYXRjaCgvXihjYWxsc0FyZ3x5aWVsZHMpLykgJiYgIW1ldGhvZC5tYXRjaCgvQXN5bmMvKSkge1xuICAgICAgICAgICAgICAgIGFjY1tgJHttZXRob2R9QXN5bmNgXSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gYmVoYXZpb3JNZXRob2RzW21ldGhvZF0uYXBwbHkoXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJndW1lbnRzLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbGxiYWNrQXN5bmMgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYWNjO1xuICAgICAgICB9LFxuICAgICAgICB7fSxcbiAgICApO1xufTtcbiIsIlwidXNlIHN0cmljdFwiO1xuXG5jb25zdCBhcnJheVByb3RvID0gc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JvbS5cbiAqIEByZXR1cm5zIHtvYmplY3R9IHRoZSBleHRlbmRlZCB0YXJnZXRcbiAqL1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBleHRlbmQodGFyZ2V0LCAuLi5zb3VyY2VzKSB7XG4gICAgcmV0dXJuIGV4dGVuZENvbW1vbihcbiAgICAgICAgdGFyZ2V0LFxuICAgICAgICBzb3VyY2VzLFxuICAgICAgICBmdW5jdGlvbiBjb3B5VmFsdWUoZGVzdCwgc291cmNlLCBwcm9wKSB7XG4gICAgICAgICAgICBjb25zdCBkZXN0T3duUHJvcGVydHlEZXNjcmlwdG9yID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihcbiAgICAgICAgICAgICAgICBkZXN0LFxuICAgICAgICAgICAgICAgIHByb3AsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgY29uc3Qgc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG9yID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihcbiAgICAgICAgICAgICAgICBzb3VyY2UsXG4gICAgICAgICAgICAgICAgcHJvcCxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIGlmIChwcm9wID09PSBcIm5hbWVcIiAmJiAhZGVzdE93blByb3BlcnR5RGVzY3JpcHRvci53cml0YWJsZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvbnN0IGRlc2NyaXB0b3JzID0ge1xuICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG9yLmNvbmZpZ3VyYWJsZSxcbiAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiBzb3VyY2VPd25Qcm9wZXJ0eURlc2NyaXB0b3IuZW51bWVyYWJsZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICAvKlxuICAgICAgICAgICAgICAgIGlmIHRoZSBzb3VyY2UgaGFzIGFuIEFjY2Vzc29yIHByb3BlcnR5IGNvcHkgb3ZlciB0aGUgYWNjZXNzb3IgZnVuY3Rpb25zIChnZXQgYW5kIHNldClcbiAgICAgICAgICAgICAgICBkYXRhIHByb3BlcnRpZXMgaGFzIHdyaXRhYmxlIGF0dHJpYnV0ZSB3aGVyZSBhcyBhY2Nlc3NvciBwcm9wZXJ0eSBkb24ndFxuICAgICAgICAgICAgICAgIFJFRjogaHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvZW4tVVMvZG9jcy9XZWIvSmF2YVNjcmlwdC9EYXRhX3N0cnVjdHVyZXMjcHJvcGVydGllc1xuICAgICAgICAgICAgKi9cblxuICAgICAgICAgICAgaWYgKGhhc093blByb3BlcnR5KHNvdXJjZU93blByb3BlcnR5RGVzY3JpcHRvciwgXCJ3cml0YWJsZVwiKSkge1xuICAgICAgICAgICAgICAgIGRlc2NyaXB0b3JzLndyaXRhYmxlID0gc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG9yLndyaXRhYmxlO1xuICAgICAgICAgICAgICAgIGRlc2NyaXB0b3JzLnZhbHVlID0gc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG9yLnZhbHVlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG9yLmdldCkge1xuICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9ycy5nZXQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG9yLmdldC5iaW5kKGRlc3QpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG9yLnNldCkge1xuICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9ycy5zZXQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlT3duUHJvcGVydHlEZXNjcmlwdG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tlIHRvU3RyaW5nKCksIHZhbHVlT2YoKSwgZXRjLiBzbyB3ZSBvbmx5IHN0dWIgaWYgdGhlIG9iamVjdFxuICAgICAgICAvLyBpcyBub3QgT2JqZWN0LnByb3RvdHlwZVxuICAgICAgICBpZiAoXG4gICAgICAgICAgICBwcm9wT3duZXIgIT09IE9iamVjdC5wcm90b3R5cGUgJiZcbiAgICAgICAgICAgIHByb3AgIT09IFwiY29uc3RydWN0b3JcIiAmJlxuICAgICAgICAgICAgdHlwZW9mIGdldFByb3BlcnR5RGVzY3JpcHRvcihwcm9wT3duZXIsIHByb3ApLnZhbHVlID09PSBcImZ1bmN0aW9uXCJcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBpZiAoZmlsdGVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKGZpbHRlcihvYmplY3QsIHByb3ApKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhbGxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIG11dGF0b3Iob2JqZWN0LCBwcm9wKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNhbGxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgbXV0YXRvcihvYmplY3QsIHByb3ApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSk7XG5cbiAgICBpZiAoIWNhbGxlZCkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICBgRm91bmQgbm8gbWV0aG9kcyBvbiBvYmplY3QgdG8gd2hpY2ggd2UgY291bGQgYXBwbHkgbXV0YXRpb25zYCxcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4gb2JqZWN0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHdhbGtPYmplY3Q7XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuY29uc3QgZm9yRWFjaCA9IHJlcXVpcmUoXCJAc2lub25qcy9jb21tb25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ICAgICAgIGRlc2NyaXB0b3JbYWNjZXNzb3JdID0gd3JhcHBlZE1ldGhvZERlc2NbYWNjZXNzb3JdO1xuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmplY3QsIHByb3BlcnR5LCBkZXNjcmlwdG9yKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGhhc0VTNVN1cHBvcnQpIHtcbiAgICAgICAgICAgICAgICBkZXNjcmlwdG9yID0gZ2V0UHJvcGVydHlEZXNjcmlwdG9yKG9iamVjdCwgcHJvcGVydHkpO1xuICAgICAgICAgICAgICAgIGlmIChkZXNjcmlwdG9yICYmIGRlc2NyaXB0b3IudmFsdWUgPT09IHRhcmdldCkge1xuICAgICAgICAgICAgICAgICAgICBvYmplY3RbcHJvcGVydHldW2FjY2Vzc29yXSA9IHRoaXMud3JhcHBlZE1ldGhvZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIFVzZSBzdHJpY3QgZXF1YWxpdHkgY29tcGFyaXNvbiB0byBjaGVjayBmYWlsdXJlcyB0aGVuIGZvcmNlIGEgcmVzZXRcbiAgICAgICAgICAgICAgICAvLyB2aWEgZGlyZWN0IGFzc2lnbm1lbnQuXG4gICAgICAgICAgICAgICAgaWYgKG9iamVjdFtwcm9wZXJ0eV1bYWNjZXNzb3JdID09PSB0YXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0W3Byb3BlcnR5XVthY2Nlc3Nvcl0gPSB0aGlzLndyYXBwZWRNZXRob2Q7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFvd25lZCkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBvYmplY3RbcHJvcGVydHldO1xuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tZW1wdHlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaGFzRVM1U3VwcG9ydCkge1xuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmplY3QsIHByb3BlcnR5LCB3cmFwcGVkTWV0aG9kRGVzYyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChoYXNFUzVTdXBwb3J0KSB7XG4gICAgICAgICAgICAgICAgZGVzY3JpcHRvciA9IGdldFByb3BlcnR5RGVzY3JpcHRvcihvYmplY3QsIHByb3BlcnR5KTtcbiAgICAgICAgICAgICAgICBpZiAoZGVzY3JpcHRvciAmJiBkZXNjcmlwdG9yLnZhbHVlID09PSB0YXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0W3Byb3BlcnR5XSA9IHRoaXMud3JhcHBlZE1ldGhvZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChvYmplY3RbcHJvcGVydHldID09PSB0YXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0W3Byb3BlcnR5XSA9IHRoaXMud3JhcHBlZE1ldGhvZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHNpbm9uVHlwZS5nZXQob2JqZWN0KSA9PT0gXCJzdHViLWluc3RhbmNlXCIpIHtcbiAgICAgICAgICAgIC8vIHRoaXMgaXMgc2ltcGx5IHRvIGF2b2lkIGVycm9ycyBhZnRlciByZXN0b3JpbmcgaWYgc29tZXRoaW5nIHNob3VsZFxuICAgICAgICAgICAgLy8gdHJhdmVyc2UgdGhlIG9iamVjdCBpbiBhIGNsZWFudXAgcGhhc2UsIHJlZiAjMjQ3N1xuICAgICAgICAgICAgb2JqZWN0W3Byb3BlcnR5XSA9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4gICAgICovXG4gICAgZnVuY3Rpb24gcGFyc2VUaW1lKHN0cikge1xuICAgICAgICBpZiAoIXN0cikge1xuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBzdHJpbmdzID0gc3RyLnNwbGl0KFwiOlwiKTtcbiAgICAgICAgY29uc3QgbCA9IHN0cmluZ3MubGVuZ3RoO1xuICAgICAgICBsZXQgaSA9IGw7XG4gICAgICAgIGxldCBtcyA9IDA7XG4gICAgICAgIGxldCBwYXJzZWQ7XG5cbiAgICAgICAgaWYgKGwgPiAzIHx8ICEvXihcXGRcXGQ6KXswLDJ9XFxkXFxkPyQvLnRlc3Qoc3RyKSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgIFwidGljayBvbmx5IHVuZGVyc3RhbmRzIG51bWJlcnMsICdtOnMnIGFuZCAnaDptOnMnLiBFYWNoIHBhcnQgbXVzdCBiZSB0d28gZGlnaXRzXCIsXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgd2hpbGUgKGktLSkge1xuICAgICAgICAgICAgcGFyc2VkID0gcGFyc2VJbnQoc3RyaW5nc1tpXSwgMTApO1xuXG4gICAgICAgICAgICBpZiAocGFyc2VkID49IDYwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIHRpbWUgJHtzdHJ9YCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG1zICs9IHBhcnNlZCAqIE1hdGgucG93KDYwLCBsIC0gaSAtIDEpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG1zICogMTAwMDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBHZXQgdGhlIGRlY2ltYWwgcGFydCBvZiB0aGUgbWlsbGlzZWNvbmQgdmFsdWUgYXMgbmFub3NlY29uZHNcbiAgICAgKlxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBtc0Zsb2F0IHRoZSBudW1iZXIgb2YgbWlsbGlzZWNvbmRzXG4gICAgICogQHJldHVybnMge251bWJlcn0gYW4gaW50ZWdlciBudW1iZXIgb2YgbmFub3NlY29uZHMgaW4gdGhlIHJhbmdlIFswLDFlNilcbiAgICAgKlxuICAgICAqIEV4YW1wbGU6IG5hbm9SZW1haW5lcigxMjMuNDU2Nzg5KSAtPiA0NTY3ODlcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBuYW5vUmVtYWluZGVyKG1zRmxvYXQpIHtcbiAgICAgICAgY29uc3QgbW9kdWxvID0gMWU2O1xuICAgICAgICBjb25zdCByZW1haW5kZXIgPSAobXNGbG9hdCAqIDFlNikgJSBtb2R1bG87XG4gICAgICAgIGNvbnN0IHBvc2l0aXZlUmVtYWluZGVyID1cbiAgICAgICAgICAgIHJlbWFpbmRlciA8IDAgPyByZW1haW5kZXIgKyBtb2R1bG8gOiByZW1haW5kZXI7XG5cbiAgICAgICAgcmV0dXJuIE1hdGguZmxvb3IocG9zaXRpdmVSZW1haW5kZXIpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFVzZWQgdG8gZ3JvayB0aGUgYG5vd2AgcGFyYW1ldGVyIHRvIGNyZWF0ZUNsb2NrLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtEYXRlfG51bWJlcn0gZXBvY2ggdGhlIHN5c3RlbSB0aW1lXG4gICAgICogQHJldHVybnMge251bWJlcn1cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBnZXRFcG9jaChlcG9jaCkge1xuICAgICAgICBpZiAoIWVwb2NoKSB7XG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGVwb2NoLmdldFRpbWUgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgICAgcmV0dXJuIGVwb2NoLmdldFRpbWUoKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGVwb2NoID09PSBcIm51b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XJyb3Iuc3RhY2tcbiAgICAgICAgICAgIC5zcGxpdChcIlxcblwiKVxuICAgICAgICAgICAgLnNsaWNlKG1hdGNoZWRMaW5lSW5kZXggKyAxKVxuICAgICAgICAgICAgLmpvaW4oXCJcXG5cIil9YDtcblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGluZmluaXRlTG9vcEVycm9yLCBcInN0YWNrXCIsIHtcbiAgICAgICAgICAgICAgICB2YWx1ZTogc3RhY2ssXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgLy8gbm9vcFxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGluZmluaXRlTG9vcEVycm9yO1xuICAgIH1cblxuICAgIC8vZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIGpzZG9jL3JlcXVpcmUtanNkb2NcbiAgICBmdW5jdGlvbiBjcmVhdGVEYXRlKCkge1xuICAgICAgICBjbGFzcyBDbG9ja0RhdGUgZXh0ZW5kcyBOYXRpdmVEYXRlIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IHllYXJcbiAgICAgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBtb250aFxuICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IGRhdGVcbiAgICAgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBob3VyXG4gICAgICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbWludXRlXG4gICAgICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gc2Vjb25kXG4gICAgICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbXNcbiAgICAgICAgICAgICAqIEByZXR1cm5zIHZvaWRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXVudXNlZC12YXJzXG4gICAgICAgICAgICBjb25zdHJ1Y3Rvcih5ZWFyLCBtb250aCwgZGF0ZSwgaG91ciwgbWludXRlLCBzZWNvbmQsIG1zKSB7XG4gICAgICAgICAgICAgICAgLy8gRGVmZW5zaXZlIGFuZCB2ZXJib3NlIHRvIGF2b2lkIHBvdGVudGlhbCBoYXJtIGluIHBhc3NpbmdcbiAgICAgICAgICAgICAgICAvLyBleHBsaWNpdCB1bmRlZmluZWQgd2hlbiB1c2VyIGRvZXMgbm90IHBhc3MgYXJndW1lbnRcbiAgICAgICAgICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBzdXBlcihDbG9ja0RhdGUuY2xvY2subm93KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdXBlciguLi5hcmd1bWVudHMpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGVuc3VyZXMgaWRlbnRpdHkgY2hlY2tzIHVzaW5nIHRoZSBjb25zdHJ1Y3RvciBwcm9wIHN0aWxsIHdvcmtzXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBzaG91bGQgaGF2ZSBubyBvdGhlciBmdW5jdGlvbmFsIGVmZmVjdFxuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0aGlzLCBcImNvbnN0cnVjdG9yXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IE5hdGl2ZURhdGUsXG4gICAgICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzdGF0aWMgW1N5bWJvbC5oYXNJbnN0YW5jZV0oaW5zdGFuY2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5zdGFuY2UgaW5zdGFuY2VvZiBOYXRpdmVEYXRlO1xuICAgICAgICAgICAgfVxuICAgICAg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AgICAgLy8gaGFuZGxlciBmb3IgW1tDYWxsXV0gaW52b2NhdGlvbnMgKGkuZS4gbm90IHVzaW5nIGBuZXdgKVxuICAgICAgICAgICAgYXBwbHkoKSB7XG4gICAgICAgICAgICAgICAgLy8gdGhlIERhdGUgY29uc3RydWN0b3IgY2FsbGVkIGFzIGEgZnVuY3Rpb24sIHJlZiBFY21hLTI2MiBFZGl0aW9uIDUuMSwgc2VjdGlvbiAxNS45LjIuXG4gICAgICAgICAgICAgICAgLy8gVGhpcyByZW1haW5zIHNvIGluIHRoZSAxMHRoIGVkaXRpb24gb2YgMjAxOSBhcyB3ZWxsLlxuICAgICAgICAgICAgICAgIGlmICh0aGlzIGluc3RhbmNlb2YgQ2xvY2tEYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICBcIkEgUHJveHkgc2hvdWxkIG9ubHkgY2FwdHVyZSBgbmV3YCBjYWxscyB3aXRoIHRoZSBgY29uc3RydWN0YCBoYW5kbGVyLiBUaGlzIGlzIG5vdCBzdXBwb3NlZCB0byBiZSBwb3NzaWJsZSwgc28gY2hlY2sgdGhlIGxvZ2ljLlwiLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgTmF0aXZlRGF0ZShDbG9ja0RhdGUuY2xvY2subm93KS50b1N0cmluZygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIENsb2NrRGF0ZVByb3h5O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIE1pcnJvciBJbnRsIGJ5IGRlZmF1bHQgb24gb3VyIGZha2UgaW1wbGVtZW50YXRpb25cbiAgICAgKlxuICAgICAqIE1vc3Qgb2YgdGhlIHByb3BlcnRpZXMgYXJlIHRoZSBvcmlnaW5hbCBuYXRpdmUgb25lcyxcbiAgICAgK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ICBmdW5jdGlvbiBhZGRUaW1lcihjbG9jaywgdGltZXIpIHtcbiAgICAgICAgaWYgKHRpbWVyLmZ1bmMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiQ2FsbGJhY2sgbXVzdCBiZSBwcm92aWRlZCB0byB0aW1lciBjYWxsc1wiKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhZGRUaW1lclJldHVybnNPYmplY3QpIHtcbiAgICAgICAgICAgIC8vIE5vZGUuanMgZW52aXJvbm1lbnRcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGltZXIuZnVuYyAhPT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgYFtFUlJfSU5WQUxJRF9DQUxMQkFDS106IENhbGxiYWNrIG11c3QgYmUgYSBmdW5jdGlvbi4gUmVjZWl2ZWQgJHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVyLmZ1bmNcbiAgICAgICAgICAgICAgICAgICAgfSBvZiB0eXBlICR7dHlwZW9mIHRpbWVyLmZ1bmN9YCxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzTmVhckluZmluaXRlTGltaXQpIHtcbiAgICAgICAgICAgIHRpbWVyLmVycm9yID0gbmV3IEVycm9yKCk7XG4gICAgICAgIH1cblxuICAgICAgICB0aW1lci50eXBlID0gdGltZXIuaW1tZWRpYXRlID8gXCJJbW1lZGlhdGVcIiA6IFwiVGltZW91dFwiO1xuXG4gICAgICAgIGlmICh0aW1lci5oYXNPd25Qcm9wZXJ0eShcImRlbGF5XCIpKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHRpbWVyLmRlbGF5ICE9PSBcIm51bWJlclwiKSB7XG4gICAgICAgICAgICAgICAgdGltZXIuZGVsYXkgPSBwYXJzZUludCh0aW1lci5kZWxheSwgMTApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIWlzTnVtYmVyRmluaXRlKHRpbWVyLmRlbGF5KSkge1xuICAgICAgICAgICAgICAgIHRpbWVyLmRlbGF5ID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRpbWVyLmRlbGF5ID0gdGltZXIuZGVsYXkgPiBtYXhUaW1lb3V0ID8gMSA6IHRpbWVyLmRlbGF5O1xuICAgICAgICAgICAgdGltZXIuZGVsYXkgPSBNYXRoLm1heCgwLCB0aW1lci5kZWxheSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGltZXIuaGFzT3duUHJvcGVydHkoXCJpbnRlcnZhbFwiKSkge1xuICAgICAgICAgICAgdGltZXIudHlwZSA9IFwiSW50ZXJ2YWxcIjtcbiAgICAgICAgICAgIHRpbWVyLmludGVydmFsID0gdGltZXIuaW50ZXJ2YWwgPiBtYXhUaW1lb3V0ID8gMSA6IHRpbWVyLmludGVydmFsO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRpbWVyLmhhc093blByb3BlcnR5KFwiYW5pbWF0aW9uXCIpKSB7XG4gICAgICAgICAgICB0aW1lci50eXBlID0gXCJBbmltYXRpb25GcmFtZVwiO1xuICAgICAgICAgICAgdGltZXIuYW5pbWF0aW9uID0gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aW1lci5oYXNPd25Qcm9wZXJ0eShcImlkbGVDYWxsYmFja1wiKSkge1xuICAgICAgICAgICAgdGltZXIudHlwZSA9IFwiSWRsZUNhbGxiYWNrXCI7XG4gICAgICAgICAgICB0aW1lci5pZGxlQ2FsbGJhY2sgPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFjbG9jay50aW1lcnMpIHtcbiAgICAgICAgICAgIGNsb2NrLnRpbWVycyA9IHt9O1xuICAgICAgICB9XG5cbiAgICAgICAgdGltZXIuaWQgPSB1bmlxdWVUaW1lcklkKys7XG4gICAgICAgIHRpbWVyLmNyZWF0ZWRBdCA9IGNsb2NrLm5vdztcbiAgICAgICAgdGltZXIuY2FsbEF0ID1cbiAgICAgICAgICAgIGNsb2NrLm5vdyArIChwYXJzZUludCh0aW1lci5kZWxheSkgfHwgKGNsb2NrLmR1cmluZ1RpY2sgPyAxIDogMCkpO1xuXG4gICAgICAgIGNsb2NrLnRpbWVyc1t0aW1lci5pZF0gPSB0aW1lcjtcblxuICAgICAgICBpZiAoYWRkVGltZXJSZXR1cm5zT2JqZWN0KSB7XG4gICAgICAgICAgICBjb25zdCByZXMgPSB7XG4gICAgICAgICAgICAgICAgcmVmZWQ6IHRydWUsXG4gICAgICAgICAgICAgICAgcmVmOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVmZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgdW5yZWY6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgaGFzUmVmOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnJlZmVkO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgcmVmcmVzaDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB0aW1lci5jYWxsQXQgPVxuICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2subm93ICtcbiAgICAgICAgICAgICAgICAgICAgICAgIChwYXJzZUludCh0aW1lci5kZWxheSkgfHwgKGNsb2NrLmR1cmluZ1RpY2sgPyAxIDogMCkpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIGl0IF9taWdodF8gaGF2ZSBiZWVuIHJlbW92ZWQsIGJ1dCBpZiBub3QgdGhlIGFzc2lnbm1lbnQgaXMgcGVyZmVjdGx5IGZpbmVcbiAgICAgICAgICAgICAgICAgICAgY2xvY2sudGltZXJzW3RpbWVyLmlkXSA9IHRpbWVyO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXM7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBbU3ltYm9sLnRvUHJpbWl0aXZlXTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGltZXIuaWQ7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRpbWVyLmlkO1xuICAgIH1cblxuICAgIC8qIGVzbGludCBjb25zaXN0ZW50LXJldHVybjogXCJvZmZcIiAqL1xuICAgIC8qKlxuICAgICAqIFRpbWVyIGNvbXBhcml0b3JcbiAgICAgKlxuICAgICAqIEBwYXJhbSB7VGltZXJ9IGFcbiAgICAgKiBAcGFyYW0ge1RpbWVyfSBiXG4gICAgICogQHJldHVybnMge251bWJlcn1cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBjb21wYXJlVGltZXJzKGEsIGIpIHtcbiAgICAgICAgLy8gU29ydCBmaXJzdCBieSBhYnNvbHV0ZSB0aW1pbmdcbiAgICAgICAgaWYgKGEuY2FsbEF0IDwgYi5jYWxsQXQpIHtcbiAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYS5jYWxsQXQgPiBiLmNhbGxBdCkge1xuICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTb3J0IG5leHQgYnkgaW1tZWRpYXRlLCBpbW1lZGlhdGUgdGltZXJzIHRha2UgcHJlY2VkZW5jZVxuICAgICAgICBpZiAoYS5pbW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Y2xvY2sudGltZXJzO1xuICAgICAgICBsZXQgdGltZXIgPSBudWxsO1xuICAgICAgICBsZXQgaWQsIGlzSW5SYW5nZTtcblxuICAgICAgICBmb3IgKGlkIGluIHRpbWVycykge1xuICAgICAgICAgICAgaWYgKHRpbWVycy5oYXNPd25Qcm9wZXJ0eShpZCkpIHtcbiAgICAgICAgICAgICAgICBpc0luUmFuZ2UgPSBpblJhbmdlKGZyb20sIHRvLCB0aW1lcnNbaWRdKTtcblxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgaXNJblJhbmdlICYmXG4gICAgICAgICAgICAgICAgICAgICghdGltZXIgfHwgY29tcGFyZVRpbWVycyh0aW1lciwgdGltZXJzW2lkXSkgPT09IDEpXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRpbWVyID0gdGltZXJzW2lkXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGltZXI7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtDbG9ja30gY2xvY2tcbiAgICAgKiBAcmV0dXJucyB7VGltZXJ9XG4gICAgICovXG4gICAgZnVuY3Rpb24gZmlyc3RUaW1lcihjbG9jaykge1xuICAgICAgICBjb25zdCB0aW1lcnMgPSBjbG9jay50aW1lcnM7XG4gICAgICAgIGxldCB0aW1lciA9IG51bGw7XG4gICAgICAgIGxldCBpZDtcblxuICAgICAgICBmb3IgKGlkIGluIHRpbWVycykge1xuICAgICAgICAgICAgaWYgKHRpbWVycy5oYXNPd25Qcm9wZXJ0eShpZCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXRpbWVyIHx8IGNvbXBhcmVUaW1lcnModGltZXIsIHRpbWVyc1tpZF0pID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHRpbWVyID0gdGltZXJzW2lkXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGltZXI7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtDbG9ja30gY2xvY2tcbiAgICAgKiBAcmV0dXJucyB7VGltZXJ9XG4gICAgICovXG4gICAgZnVuY3Rpb24gbGFzdFRpbWVyKGNsb2NrKSB7XG4gICAgICAgIGNvbnN0IHRpbWVycyA9IGNsb2NrLnRpbWVycztcbiAgICAgICAgbGV0IHRpbWVyID0gbnVsbDtcbiAgICAgICAgbGV0IGlkO1xuXG4gICAgICAgIGZvciAoaWQgaW4gdGltZXJzKSB7XG4gICAgICAgICAgICBpZiAodGltZXJzLmhhc093blByb3BlcnR5KGlkKSkge1xuICAgICAgICAgICAgICAgIGlmICghdGltZXIgfHwgY29tcGFyZVRpbWVycyh0aW1lciwgdGltZXJzW2lkXSkgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHRpbWVyID0gdGltZXJzW2lkXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGltZXI7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtDbG9ja30gY2xvY2tcbiAgICAgKiBAcGFyYW0ge1RpbWVyfSB0aW1lclxuICAgICAqL1xuICAgIGZ1bmN0aW9uIGNhbGxUaW1lcihjbG9jaywgdGltZXIpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lci5pbnRlcnZhbCA9PT0gXCJudW1iZXJcIikge1xuICAgICAgICAgICAgY2xvY2sudGltZXJzW3RpbWVyLmlkXS5jYWxsQXQgKz0gdGltZXIuaW50ZXJ2YWw7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkZWxldGUgY2xvY2sudGltZXJzW3RpbWVyLmlkXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgdGltZXIuZnVuYyA9PT0gXCJmdW5jdGlvbl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1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBgc2V0JHt0dHlwZX1gO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgYW4gYW5vbnltb3VzIGZ1bmN0aW9uIHRvIHdhcm4gb25seSBvbmNlXG4gICAgICovXG4gICAgZnVuY3Rpb24gY3JlYXRlV2Fybk9uY2UoKSB7XG4gICAgICAgIGxldCBjYWxscyA9IDA7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAobXNnKSB7XG4gICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmVcbiAgICAgICAgICAgICFjYWxscysrICYmIGNvbnNvbGUud2Fybihtc2cpO1xuICAgICAgICB9O1xuICAgIH1cbiAgICBjb25zdCB3YXJuT25jZSA9IGNyZWF0ZVdhcm5PbmNlKCk7XG5cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge0Nsb2NrfSBjbG9ja1xuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB0aW1lcklkXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IHR0eXBlXG4gICAgICovXG4gICAgZnVuY3Rpb24gY2xlYXJUaW1lcihjbG9jaywgdGltZXJJZCwgdHR5cGUpIHtcbiAgICAgICAgaWYgKCF0aW1lcklkKSB7XG4gICAgICAgICAgICAvLyBudWxsIGFwcGVhcnMgdG8gYmUgYWxsb3dlZCBpbiBtb3N0IGJyb3dzZXJzLCBhbmQgYXBwZWFycyB0byBiZVxuICAgICAgICAgICAgLy8gcmVsaWVkIHVwb24gYnkgc29tZSBsaWJyYXJpZXMsIGxpa2UgQm9vdHN0cmFwIGNhcm91c2VsXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWNsb2NrLnRpbWVycykge1xuICAgICAgICAgICAgY2xvY2sudGltZXJzID0ge307XG4gICAgICAgIH1cblxuICAgICAgICAvLyBpbiBOb2RlLCB0aGUgSUQgaXMgc3RvcmVkIGFzIHRoZ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G9jay50aW1lcnMuaGFzT3duUHJvcGVydHkoaWQpKSB7XG4gICAgICAgICAgICAvLyBjaGVjayB0aGF0IHRoZSBJRCBtYXRjaGVzIGEgdGltZXIgb2YgdGhlIGNvcnJlY3QgdHlwZVxuICAgICAgICAgICAgY29uc3QgdGltZXIgPSBjbG9jay50aW1lcnNbaWRdO1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIHRpbWVyLnR5cGUgPT09IHR0eXBlIHx8XG4gICAgICAgICAgICAgICAgKHRpbWVyLnR5cGUgPT09IFwiVGltZW91dFwiICYmIHR0eXBlID09PSBcIkludGVydmFsXCIpIHx8XG4gICAgICAgICAgICAgICAgKHRpbWVyLnR5cGUgPT09IFwiSW50ZXJ2YWxcIiAmJiB0dHlwZSA9PT0gXCJUaW1lb3V0XCIpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgY2xvY2sudGltZXJzW2lkXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc3QgY2xlYXIgPSBnZXRDbGVhckhhbmRsZXIodHR5cGUpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHNjaGVkdWxlID0gZ2V0U2NoZWR1bGVIYW5kbGVyKHRpbWVyLnR5cGUpO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgYENhbm5vdCBjbGVhciB0aW1lcjogdGltZXIgY3JlYXRlZCB3aXRoICR7c2NoZWR1bGV9KCkgYnV0IGNsZWFyZWQgd2l0aCAke2NsZWFyfSgpYCxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtDbG9ja30gY2xvY2tcbiAgICAgKiBAcGFyYW0ge0NvbmZpZ30gY29uZmlnXG4gICAgICogQHJldHVybnMge1RpbWVyW119XG4gICAgICovXG4gICAgZnVuY3Rpb24gdW5pbnN0YWxsKGNsb2NrLCBjb25maWcpIHtcbiAgICAgICAgbGV0IG1ldGhvZCwgaSwgbDtcbiAgICAgICAgY29uc3QgaW5zdGFsbGVkSHJUaW1lID0gXCJfaHJ0aW1lXCI7XG4gICAgICAgIGNvbnN0IGluc3RhbGxlZE5leHRUaWNrID0gXCJfbmV4dFRpY2tcIjtcblxuICAgICAgICBmb3IgKGkgPSAwLCBsID0gY2xvY2subWV0aG9kcy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICAgIG1ldGhvZCA9IGNsb2NrLm1ldGhvZHNbaV07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSBcImhydGltZVwiICYmIF9nbG9iYWwucHJvY2Vzcykge1xuICAgICAgICAgICAgICAgIF9nbG9iYWwucHJvY2Vzcy5ocnRpbWUgPSBjbG9ja1tpbnN0YWxsZWRIclRpbWVdO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09IFwibmV4dFRpY2tcIiAmJiBfZ2xvYmFsLnByb2Nlc3MpIHtcbiAgICAgICAgICAgICAgICBfZ2xvYmFsLnByb2Nlc3MubmV4dFRpY2sgPSBjbG9ja1tpbnN0YWxsZWROZXh0VGlja107XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1ldGhvZCA9PT0gXCJwZXJmb3JtYW5jZVwiKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qgb3JpZ2luYWxQZXJmRGVzY3JpcHRvciA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoXG4gICAgICAgICAgICAgICAgICAgIGNsb2NrLFxuICAgICAgICAgICAgICAgICAgICBgXyR7bWV0aG9kfWAsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsUGVyZkRlc2NyaXB0b3IgJiZcbiAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWxQZXJmRGVzY3JpcHRvci5nZXQgJiZcbiAgICAgICAgICAgICAgICAgICAgIW9yaWdpbmFsUGVyZkRlc2NyaXB0b3Iuc2V0XG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShcbiAgICAgICAgICAgICAgICAgICAgICAgIF9nbG9iYWwsXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2QsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbFBlcmZEZXNjcmlwdG9yLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3JpZ2luYWxQZXJmRGVzY3JpcHRvci5jb25maWd1cmFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgX2dsb2JhbFttZXRob2RdID0gY2xvY2tbYF8ke21ldGhvZH1gXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChfZ2xvYmFsW21ldGhvZF0gJiYgX2dsb2JhbFttZXRob2RdLmhhZE93blByb3BlcnR5KSB7XG4gICAgICAgICAgICAgICAgICAgIF9nbG9iYWxbbWV0aG9kXSA9IGNsb2NrW2BfJHttZXRob2R9YF07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBfZ2xvYmFsW21ldGhvZF07XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGlnbm9yZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLyogZXNsaW50IG5vLWVtcHR5OiBcIm9mZlwiICovXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2xvY2sudGltZXJzTW9kdWxlTWV0aG9kcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjbG9jay50aW1lcnNNb2R1bGVNZXRob2RzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVudHJ5ID0gY2xvY2sudGltZXJzTW9kdWxlTWV0aG9kc1tqXTtcbiAgICAgICAgICAgICAgICAgICAgdGltZXJzTW9kdWxlW2VudHJ5Lm1ldGhvZE5hbWVdID0gZW50cnkub3JpZ2luYWw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGNsb2NrLnRpbWVyc1Byb21pc2VzTW9kdWxlTWV0aG9kcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgZm9yIChcbiAgICAgICAgICAgICAgICAgICAgbGV0IGogPSAwO1xuICAgICAgICAgICAgICAgICAgICBqIDwgY2xvY2sudGltZXJzUHJvbWlzZXNNb2R1bGVNZXRob2RzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaisrXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVudHJ5ID0gY2xvY2sudGltZXJzUHJvbWlzZXNNb2R1bGVNZXRob2RzW2pdO1xuICAgICAgICAgICAgICAgICAgICB0aW1lcnNQcm9taXNlc01vZHVsZVtlbnRyeS5tZXRob2ROYW1lXSA9IGVudHJ5Lm9yaWdpbmFsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb25maWcuc2hvdWxkQWR2YW5jZVRpbWUgPT09IHRydWUpIHtcbiAgICAgICAgICAgIF9nbG9iYWwuY2xlYXJJbnRlcnZhbChjbG9jay5hdHRhY2hlZEludGVydmFsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFByZXZlbnQgbXVsdGlwbGUgZXhlY3V0aW9ucyB3aGljaCB3aWxsIGNvbXBs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0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKFxuICAgICAgICAgICAgdGFyZ2V0LFxuICAgICAgICAgICAgbWV0aG9kLFxuICAgICAgICApO1xuICAgICAgICBjbG9ja1tgXyR7bWV0aG9kfWBdID0gdGFyZ2V0W21ldGhvZF07XG5cbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gXCJEYXRlXCIpIHtcbiAgICAgICAgICAgIHRhcmdldFttZXRob2RdID0gY2xvY2tbbWV0aG9kXTtcbiAgICAgICAgfSBlbHNlIGlmIChtZXRob2QgPT09IFwiSW50bFwiKSB7XG4gICAgICAgICAgICB0YXJnZXRbbWV0aG9kXSA9IGNsb2NrW21ldGhvZF07XG4gICAgICAgIH0gZWxzZSBpZiAobWV0aG9kID09PSBcInBlcmZvcm1hbmNlXCIpIHtcbiAgICAgICAgICAgIGNvbnN0IG9yaWdpbmFsUGVyZkRlc2NyaXB0b3IgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKFxuICAgICAgICAgICAgICAgIHRhcmdldCxcbiAgICAgICAgICAgICAgICBtZXRob2QsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgLy8gSlNET00gaGFzIGEgcmVhZCBvbmx5IHBlcmZvcm1hbmNlIGZpZWxkIHNvIHdlIGhhdmUgdG8gc2F2ZS9jb3B5IGl0IGRpZmZlcmVudGx5XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgb3JpZ2luYWxQZXJmRGVzY3JpcHRvciAmJlxuICAgICAgICAgICAgICAgIG9yaWdpbmFsUGVyZkRlc2NyaXB0b3IuZ2V0ICYmXG4gICAgICAgICAgICAgICAgIW9yaWdpbmFsUGVyZkRlc2NyaXB0b3Iuc2V0XG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoXG4gICAgICAgICAgICAgICAgICAgIGNsb2NrLFxuICAgICAgICAgICAgICAgICAgICBgXyR7bWV0aG9kfWAsXG4gICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsUGVyZkRlc2NyaXB0b3IsXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIGNvbnN0IHBlcmZEZXNjcmlwdG9yID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihcbiAgICAgICAgICAgICAgICAgICAgY2xvY2ssXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZCxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0YXJnZXQsIG1ldGhvZCwgcGVyZkRlc2NyaXB0b3IpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRbbWV0aG9kXSA9IGNsb2NrW21ldGhvZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0YXJnZXRbbWV0aG9kXSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2xvY2tbbWV0aG9kXS5hcHBseShjbG9jaywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzKFxuICAgICAgICAgICAgICAgIHRhcmdldFttZXRob2RdLFxuICAgICAgICAgICAgICAgIE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3JzKGNsb2NrW21ldGhvZF0pLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRhcmdldFttZXRob2RdLmNsb2NrID0gY2xvY2s7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQHBhcmFtIHtDbG9ja30gY2xvY2tcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gYWR2YW5jZVRpbWVEZWx0YVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIGRvSW50ZXJ2YWxUaW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aXNhYmxlLW5leHQtbGluZSBqc2RvYy9yZXF1aXJlLWpzZG9jXG4gICAgICAgIGZ1bmN0aW9uIGhydGltZShwcmV2KSB7XG4gICAgICAgICAgICBjb25zdCBtaWxsaXNTaW5jZVN0YXJ0ID0gY2xvY2subm93IC0gYWRqdXN0ZWRTeXN0ZW1UaW1lWzBdIC0gc3RhcnQ7XG4gICAgICAgICAgICBjb25zdCBzZWNzU2luY2VTdGFydCA9IE1hdGguZmxvb3IobWlsbGlzU2luY2VTdGFydCAvIDEwMDApO1xuICAgICAgICAgICAgY29uc3QgcmVtYWluZGVySW5OYW5vcyA9XG4gICAgICAgICAgICAgICAgKG1pbGxpc1NpbmNlU3RhcnQgLSBzZWNzU2luY2VTdGFydCAqIDFlMykgKiAxZTYgK1xuICAgICAgICAgICAgICAgIG5hbm9zIC1cbiAgICAgICAgICAgICAgICBhZGp1c3RlZFN5c3RlbVRpbWVbMV07XG5cbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHByZXYpKSB7XG4gICAgICAgICAgICAgICAgaWYgKHByZXZbMV0gPiAxZTkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiTnVtYmVyIG9mIG5hbm9zZWNvbmRzIGNhbid0IGV4Y2VlZCBhIGJpbGxpb25cIixcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBvbGRTZWNzID0gcHJldlswXTtcbiAgICAgICAgICAgICAgICBsZXQgbmFub0RpZmYgPSByZW1haW5kZXJJbk5hbm9zIC0gcHJldlsxXTtcbiAgICAgICAgICAgICAgICBsZXQgc2VjRGlmZiA9IHNlY3NTaW5jZVN0YXJ0IC0gb2xkU2VjcztcblxuICAgICAgICAgICAgICAgIGlmIChuYW5vRGlmZiA8IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbmFub0RpZmYgKz0gMWU5O1xuICAgICAgICAgICAgICAgICAgICBzZWNEaWZmIC09IDE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIFtzZWNEaWZmLCBuYW5vRGlmZl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gW3NlY3NTaW5jZVN0YXJ0LCByZW1haW5kZXJJbk5hbm9zXTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBBIGhpZ2ggcmVzb2x1dGlvbiB0aW1lc3RhbXAgaW4gbWlsbGlzZWNvbmRzLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAdHlwZWRlZiB7bnVtYmVyfSBET01IaWdoUmVzVGltZVN0YW1wXG4gICAgICAgICAqL1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBwZXJmb3JtYW5jZS5ub3coKVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcmV0dXJucyB7RE9NSGlnaFJlc1RpbWVTdGFtcH1cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGZha2VQZXJmb3JtYW5jZU5vdygpIHtcbiAgICAgICAgICAgIGNvbnN0IGhydCA9IGhydGltZSgpO1xuICAgICAgICAgICAgY29uc3QgbWlsbGlzID0gaHJ0WzBdICogMTAwMCArIGhydFsxXSAvIDFlNjtcbiAgICAgICAgICAgIHJldHVybiBtaWxsaXM7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaXNQcmVzZW50LmhydGltZUJpZ2ludCkge1xuICAgICAgICAgICAgaHJ0aW1lLmJpZ2ludCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwYXJ0cyA9IGhydGltZSgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBCaWdJbnQocGFydHNbMF0pICogQmlnSW50KDFlOSkgKyBCaWdJbnQocGFydHNbMV0pOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzUHJlc2VudC5JbnRsKSB7XG4gICAgICAgICAgICBjbG9jay5JbnRsID0gY3JlYXRlSW50bCgpO1xuICAgICAgICAgICAgY2xvY2suSW50bC5jbG9jayA9IGNsb2NrO1xuICAgICAgICB9XG5cbiAgICAgICAgY2xvY2sucmVxdWVzdElkbGVDYWxsYmFjayA9IGZ1bmN0aW9uIHJlcXVlc3RJZGxlQ2FsbGJhY2soXG4gICAgICAgICAgICBmdW5jLFxuICAgICAgICAgICAgdGltZW91dCxcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBsZXQgdGltZVRvTmV4dElkbGVQZXJpb2QgPSAwO1xuXG4gICAgICAgICAgICBpZiAoY2xvY2suY291bnRUaW1lcnMoKSA+IDApIHtcbiAgICAgICAgICAgICAgICB0aW1lVG9OZXh0SWRsZVBlcmlvZCA9IDUwOyAvLyBjb25zdCBmb3Igbm93XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IGFkZFRpbWVyKGNsb2NrLCB7XG4gICAgICAgICAgICAgICAgZnVuYzogZnVuYyxcbiAgICAgICAgICAgICAgICBhcmdzOiBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDIpLFxuICAgICAgICAgICAgICAgIGRlbGF5OlxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgdGltZW91dCA9PT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgICAgICAgICAgICAgPyB0aW1lVG9OZXh0SWRsZVBlcmlvZFxuICAgICAgICAgICAgICAgICAgICAgICAgOiBNYXRoLm1pbih0aW1lb3V0LCB0aW1lVG9OZXh0SWRsZVBlcmlvZCksXG4gICAgICAgICAgICAgICAgaWRsZUNhbGxiYWNrOiB0cnVlLFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBOdW1iZXIocmVzdWx0KTtcbiAgICAgICAgfTtcblxuICAgICAgICBjbG9jay5jYW5jZWxJZGxlQ2FsbGJhY2sgPSBmdW5jdGlvbiBjYW5jZWxJZGxlQ2FsbGJhY2sodGltZXJJZCkge1xuICAgICAgICAgICAgcmV0dXJuIGNsZWFyVGltZXIoY2xvY2ssIHRpbWVySWQsIFwiSWRsZUNhbGxiYWNrXCIpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGNsb2NrLnNldFRpbWVvdXQgPSBmdW5jdGlvbiBzZXRUaW1lb3V0KGZ1bmMsIHRpbWVvdXQpIHtcbiAgICAgICAgICAgIHJldHVybiBhZGRUaW1lcihjbG9jaywge1xuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmMsXG4gICAgICAgICAgICAgICAgYXJnczogQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzLCAyKSxcbiAgICAgICAgICAgICAgICBkZWxheTogdGltZW91dCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIF9nbG9iYWwuUHJvbWlzZSAhPT0gXCJ1bmRlZmluZWRcIiAmJiB1dGlsUHJvbWlzaWZ5KSB7XG4gICAgICAgICAgICBjbG9jay5zZXRUaW1lb3V0W3V0aWxQcm9taXNpZnkuY3VzdG9tXSA9XG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gcHJvbWlzaWZpZWRTZXRUaW1lb3V0KHRpbWVvdXQsIGFyZykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IF9nbG9iYWwuUHJvbWlzZShmdW5jdGlvbiBzZXRUaW1lb3V0RXhlY3V0b3IoXG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlLFxuICAgICAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZFRpbWVyKGNsb2NrLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuYzogcmVzb2x2ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdzOiBbYXJnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxheTogdGltZW91dCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgY2xvY2suY2xlYXJUaW1lb3V0ID0gZnVuY3Rpb24gY2xlYXJUaW1lb3V0KHRpbWVySWQpIHtcbiAgICAgICAgICAgIHJldHVybiBjbGVhclRpbWVyKGNsb2NrLCB0aW1lcklkLCBcIlRpbWVvdXRcIik7XG4gICAgICAgIH07XG5cbiAgICAgICAgY2xvY2submV4dFRpY2sgPSBmdW5jdGlvbiBuZXh0VGljayhmdW5jKSB7XG4gICAgICAgICAgICByZXR1cm4gZW5xdWV1ZUpvYihjbG9jaywge1xuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmMsXG4gICAgICAgICAgICAgICAgYXJnczogQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzLCAxKSxcbiAgICAgICAgICAgICAgICBlcnJvcjogaXNOZWFySW5maW5pdGVMaW1pdCA/IG5ldyBFcnJvcigpIDogbnVsbCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuXG4gICAgICAgIGNsb2NrLnF1ZXVlTWljcm90YXNrID0gZnVuY3Rpb24gcXVldWVNaWNyb3Rhc2soZnVuYykge1xuICAgICAgICAgICAgcmV0dXJuIGNsb2NrLm5leHRUaWNrKGZ1bmMpOyAvLyBleHBsaWNpdGx5IGRyb3AgYWRkaXRpb25hbCBhcmd1bWVudHNcbiAgICAgICAgfTtcblxuICAgICAgICBjbG9jay5zZXRJbnRlcnZhbCA9IGZ1bmN0aW9uIHNldEludGVydmFsKGZ1bmMsIHRpbWVvdXQpIHtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1wYXJhbS1yZWFzc2lnblxuICAgICAgICAgICAgdGltZW91dCA9IHBhcnNlSW50KHRpbWVvdXQsIDEwKTtcbiAgICAgICAgICAgIHJldHVybiBhZGRUaW1lcihjbG9jaywge1xuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmMsXG4gICAgICAgICAgICAgICAgYXJnczogQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzLCAyKSxcbiAgICAgICAgICAgICAgICBkZWxheTogdGltZW91dCxcbiAgICAgICAgICAgICAgICBpbnRlcnZhbDogdGltZW91dCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuXG4gICAgICAgIGNsb2NrLmNsZWFySW50ZXJ2YWwgPSBmdW5jdGlvbiBjbGVhckludGVydmFsKHRpbWVySWQpIHtcbiAgICAgICAgICAgIHJldHVybiBjbGVhclRpbWVyKGNsb2NrLCB0aW1lcklkLCBcIkludGVydmFsXCIpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChpc1ByZXNlbnQuc2V0SW1tZWRpYXRlKSB7XG4gICAgICAgICAgICBjbG9jay5zZXRJbW1lZGlhdGUgPSBmdW5jdGlvbiBzZXRJbW1lZGlhdGUoZnVuYykge1xuICAgICAgICAgICAgICAgIHJldHVybiBhZGRUaW1lcihjbG9jaywge1xuICAgICAgICAgICAgICAgICAgICBmdW5jOiBmdW5jLFxuICAgICAgICAgICAgICAgICAgICBhcmdzOiBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDEpLFxuICAgICAgICAgICAgICAgICAgICBpbW1lZGlhdGU6IHRydWUsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAodHlwZW9mIF9nbG9iYWwuUHJvbWlzZSAhPT0gXCJ1bmRlZmluZWRcIiAmJiB1dGlsUHJvbWlzaWZ5KSB7XG4gICAgICAgICAgICAgICAgY2xvY2suc2V0SW1tZWRpYXRlW3V0aWxQcm9taXNpZnkuY3VzdG9tXSA9XG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHByb21pc2lmaWVkU2V0SW1tZWRpYXRlKGFyZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBfZ2xvYmFsLlByb21pc2UoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0SW1tZWRpYXRlRXhlY3V0b3IocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRUaW1lcihjbG9jaywge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuYzogcmVzb2x2ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3M6IFthcmddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1tZWRpYXRlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY2xvY2suY2xlYXJJbW1lZGlhdGUgPSBmdW5jdGlvbiBjbGVhckltbWVkaWF0ZSh0aW1lcklkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsZWFyVGltZXIoY2xvY2ssIHRpbWVySWQsIFwiSW1tZWRpYXRlXCIpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNsb2NrLmNvdW50VGltZXJzID0gZnVuY3Rpb24gY291bnRUaW1lcnMoKSB7XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKGNsb2NrLnRpbWVycyB8fCB7fSkubGVuZ3RoICtcbiAgICAgICAgICAgICAgICAoY2xvY2suam9icyB8fCBbXSkubGVuZ3RoXG4gICAgICAgICAgICApO1xuICAgICAgICB9O1xuXG4gICAgICAgIGNsb2NrLnJlcXVlc3RBbmltYXRpb25GcmFtZSA9IGZ1bmN0aW9uIHJlcXVlc3RBbmltYXRpb25GcmFtZShmdW5jKSB7XG4gICAgICAgICAgICBjb25zdCByZXN1bHQgPSBhZGRUaW1lcihjbG9jaywge1xuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmMsXG4gICAgICAgICAgICAgICAgZGVsYXk6IGdldFRpbWVUb05leHRGcmFtZSgpLFxuICAgICAgICAgICAgICAgIGdldCBhcmdzKCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW2Zha2VQZXJmb3JtYW5jZU5vdygpXTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogdHJ1ZSxcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gTnVtYmVyKHJlc3VsdCk7XG4gICAgICAgIH07XG5cbiAgICAgICAgY2xvY2suY2FuY2VsQW5pbWF0aW9uRnJhbWUgPSBmdW5jdGlvbiBjYW5jZWxBbmltYXRpb25GcmFtZSh0aW1lcklkKSB7XG4gICAgICAgICAgICByZXR1cm4gY2xlYXJUaW1lcihjbG9jaywgdGltZXJJZCwgXCJBbmltYXRpb25GcmFtZVwiKTtcbiAgICAgICAgfTtcblxuICAgICAgICBjbG9jay5ydW5NaWNyb3Rhc2tzID0gZnVuY3Rpb24gcnVuTWljcm90YXNrcygpIHtcbiAgICAgICAgICAgIHJ1bkpvYnMoY2xvY2spO1xuICAgICAgICB9O1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAcGFyYW0ge251bWJlcnxzdHJpbmd9IHRpY2tWYWx1ZSBtaWxsaXNlY29uZHMgb3IgYSBzdHJpbmcgcGFyc2VhYmxlIGJ5IHBhcnNlVGltZVxuICAgICAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IGlzQXN5bmNcbiAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gcmVzb2x2ZVxuICAgICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSByZWplY3RcbiAgICAgICAgICogQHJldHVybnMge251bWJlcnx1bmRlZmluZWR9IHdpbGwgcmV0dXJuIHRoZSBuZXcgYG5vd2AgdmFsdWUgb3Igbm90aGluZyBmb3IgYXN5bmNcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGRvVGljayh0aWNrVmFsdWUsIGlzQXN5bmMsIHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgY29uc3QgbXNGbG9hdCA9XG4gICAgICAgICAgICAgICAgdHlwZW9mIHRpY2tWYWx1ZSA9PT0gXCJudW1iZXJcIlxuICAgICAgICAgICAgICAgICAgICA/IHRpY2tWYWx1ZVxuICAgICAgICAgICAgICAgICAgICA6IHBhcnNlVGltZSh0aWNrVmFsdWUpO1xuICAgICAgICAgICAgY29uc3QgbXMgPSBNYXRoLmZsb29yKG1zRmxvYXQpO1xuICAgICAgICAgICAgY29uc3QgcmVtYWluZGVyID0gbmFub1JlbWFpbmRlcihtc0Zsb2F0KTtcbiAgICAgICAgICAgIGxldCBuYW5vc1RvdGFsID0gbmFub3MgKyByZW1haW5kZXI7XG4gICAgICAgICAgICBsZXQgdGlja1RvID0gY2xvY2subm93ICsgbXM7XG5cbiAgICAgICAgICAgIGlmIChtc0Zsb2F0IDwgMCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJOZWdhdGl2ZSB0aWNrcyBhcmUgbm90IHN1cHBvcnRlZFwiKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gYWRqdXN0IGZvciBwb3NpdGl2ZSBvdmVyZmxvd1xuICAgICAgICAgICAgaWYgKG5hbm9zVG90YWwgPj0gMWU2KSB7XG4gICAgICAgICAgICAgICAgdGlja1RvICs9IDE7XG4gICAgICAgICAgICAgICAgbmFub3NUb3RhbCAtPSAxZTY7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG5hbm9zID0gbmFub3NUb3RhbDtcbiAgICAgICAgICAgIGxldCB0aWNrRnJvbSA9IGNsb2NrLm5vdztcbiAgICAgICAgICAgIGxldCBwcmV2aW91cyA9IGNsb2NrLm5vdztcbiAgICAgICAgICAgIC8vIEVTTGludCBmYWlscyB0byBkZXRlY3QgdGhpcyBjb3JyZWN0bHlcbiAgICAgICAgICAgIC8qIGVzbGludC1kaXNhYmxlIHByZWZlci1jb25zdCAqL1xuICAgICAgICAgICAgbGV0IHRpbWVyLFxuICAgICAgICAgICAgICAgIGZpcnN0RXhjZXB0aW9uLFxuICAgICAgICAgICAgICAgIG9sZE5vdyxcbiAgICAgICAgICAgICAgICBuZXh0UHJvbWlzZVRpY2ssXG4gICAgICAgICAgICAgICAgY29tcGVuc2F0aW9uQ2hlY2ssXG4gICAgICAgICAgICAgICAgcG9zdFRpbWVyQ2FsbDtcbiAgICAgICAgICAgIC8qIGVzbGludC1lbmFibGUgcHJlZmVyLWNvbnN0ICovXG5cbiAgICAgICAgICAgIGNsb2NrLmR1cmluZ1RpY2sgPSB0cnVlO1xuXG4gICAgICAgICAgICAvLyBwZXJmb3JtIG1pY3JvdGFza3NcbiAgICAgICAgICAgIG9sZE5vdyA9IGNsb2NrLm5vdztcbiAgICAgICAgICAgIHJ1bkpvYnMoY2xvY2spO1xuICAgICAgICAgICAgaWYgKG9sZE5vdyAhPT0gY2xvY2subm93KSB7XG4gICAgICAgICAgICAgICAgLy8gY29tcGVuc2F0ZSBmb3IgYW55IHNldFN5c3RlbVRpbWUoKSBjYWxsIGR1cmluZyBtaWNyb3Rhc2sgY2FsbGJhY2tcbiAgICAgICAgICAgICAgICB0aWNrRnJvbSArPSBjbG9jay5ub3cgLSBvbGROb3c7XG4gICAgICAgICAgICAgICAgdGlja1RvICs9IGNsb2NrLm5vdyAtIG9sZE5vdztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy9lc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUganNkb2MvcmVxdWlyZS1qc2RvY1xuICAgICAgICAgICAgZnVuY3Rpb24gZG9UaWNrSW5uZXIoKSB7XG4gICAgICAgICAgICAgICAgLy8gcGVyZm9ybSBlYWNoIHRpbWVyIGluIHRoZSByZXF1ZXN0ZWQgcmFuZ2VcbiAgICAgICAgICAgICAgICB0aW1lciA9IGZpcnN0VGltZXJJblJhbmdlKGNsb2NrLCB0aWNrRnJvbSwgdGlja1RvKTtcbiAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdW5tb2RpZmllZC1sb29wLWNvbmRpdGlvblxuICAgICAgICAgICAgICAgIHdoaWxlICh0aW1lciAmJiB0aWNrRnJvbSA8PSB0aWNrVG8pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNsb2NrLnRpbWVyc1t0aW1lci5pZF0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tGcm9tID0gdGltZXIuY2FsbEF0O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2subm93ID0gdGltZXIuY2FsbEF0O1xuICAgICAgICAgICAgICAgICAgICAgICAgb2xkTm93ID0gY2xvY2subm93O1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5Kb2JzKGNsb2NrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsVGltZXIoY2xvY2ssIHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdEV4Y2VwdGlvbiA9IGZpcnN0RXhjZXB0aW9uIHx8IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0FzeW5jKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmluaXNoIHVwIGFmdGVyIG5hdGl2ZSBzZXRJbW1lZGlhdGUgY2FsbGJhY2sgdG8gYWxsb3dcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbGwgbmF0aXZlIGVzNiBwcm9taXNlcyB0byBwcm9jZXNzIHRoZWlyIGNhbGxiYWNrcyBhZnRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVhY2ggdGltZXIgZmlyZXMuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWxTZXRUaW1lb3V0KG5leHRQcm9taXNlVGljayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wZW5zYXRpb25DaGVjaygpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcG9zdFRpbWVyQ2FsbCgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIHBlcmZvcm0gcHJvY2Vzcy5uZXh0VGljaygpcyBhZ2FpblxuICAgICAgICAgICAgICAgIG9sZE5vdyA9IGNsb2NrLm5vdztcbiAgICAgICAgICAgICAgICBydW5Kb2JzKGNsb2NrKTtcbiAgICAgICAgICAgICAgICBpZiAob2xkTm93ICE9PSBjbG9jay5ub3cpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gY29tcGVuc2F0ZSBmb3IgYW55IHNldFN5c3RlbVRpbWUoKSBjYWxsIGR1cmluZyBwcm9jZXNzLm5leHRUaWNrKCkgY2FsbGJhY2tcbiAgICAgICAgICAgICAgICAgICAgdGlja0Zyb20gKz0gY2xvY2subm93IC0gb2xkTm93O1xuICAgICAgICAgICAgICAgICAgICB0aWNrVG8gKz0gY2xvY2subm93IC0gb2xkTm93O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjbG9jay5kdXJpbmdUaWNrID0gZmFsc2U7XG5cbiAgICAgICAgICAgICAgICAvLyBjb3JuZXIgY2FzZTogZHVyaW5nIHJ1bkpvYnMgbmV3IHRpbWVycyB3ZXJlIHNjaGVkdWxlZCB3aGljaCBjb3VsZCBiZSBpbiB0aGUgcmFuZ2UgW2Nsb2NrLm5vdywgdGlja1RvXVxuICAgICAgICAgICAgICAgIHRpbWVyID0gZmlyc3RUaW1lckluUmFuZ2UoY2xvY2ssIHRpY2tGcm9tLCB0aWNrVG8pO1xuICAgICAgICAgICAgICAgIGlmICh0aW1lcikge1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sudGljayh0aWNrVG8gLSBjbG9jay5ub3cpOyAvLyBkbyBpdCBhbGwgYWdhaW4gLSBmb3IgdGhlIHJlbWFpbmRlciBvZiB0aGUgcmVxdWVzdGVkIHJhbmdlXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0RXhjZXB0aW9uID0gZmlyc3RFeGNlcHRpb24gfHwgZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5vIHRpbWVycyByZW1haW5pbmcgaW4gdGhlIHJlcXVlc3RlZCByYW5nZTogbW92ZSB0aGUgY2xvY2sgYWxsIHRoZSB3YXkgdG8gdGhlIGVuZFxuICAgICAgICAgICAgICAgICAgICBjbG9jay5ub3cgPSB0aWNrVG87XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlIG5hbm9zXG4gICAgICAgICAgICAgICAgICAgIG5hbm9zID0gbmFub3NUb3RhbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGZpcnN0RXhjZXB0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IGZpcnN0RXhjZXB0aW9uO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChpc0FzeW5jKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc29sdmUoY2xvY2subm93KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2xvY2subm93O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbmV4dFByb21pc2VUaWNrID1cbiAgICAgICAgICAgICAgICBpc0FzeW5jICYmXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29tcGVuc2F0aW9uQ2hlY2soKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RUaW1lckNhbGwoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvVGlja0lubmVyKCk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGNvbXBlbnNhdGlvbkNoZWNrID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIC8vIGNvbXBlbnNhdGUgZm9yIGFueSBzZXRTeXN0ZW1UaW1lKCkgY2FsbCBkdXJpbmcgdGltZXIgY2FsbGJhY2tcbiAgICAgICAgICAgICAgICBpZiAob2xkTm93ICE9PSBjbG9jay5ub3cpIHtcbiAgICAgICAgICAgICAgICAgICAgdGlja0Zyb20gKz0gY2xvY2subm93IC0gb2xkTm93O1xuICAgICAgICAgICAgICAgICAgICB0aWNrVG8gKz0gY2xvY2subm93IC0gb2xkTm93O1xuICAgICAgICAgICAgICAgICAgICBwcmV2aW91cyArPSBjbG9jay5ub3cgLSBvbGROb3c7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgcG9zd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2xvYmFsLlByb21pc2UoZnVuY3Rpb24gKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbFNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb1RpY2sodGlja1ZhbHVlLCB0cnVlLCByZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgY2xvY2submV4dCA9IGZ1bmN0aW9uIG5leHQoKSB7XG4gICAgICAgICAgICBydW5Kb2JzKGNsb2NrKTtcbiAgICAgICAgICAgIGNvbnN0IHRpbWVyID0gZmlyc3RUaW1lcihjbG9jayk7XG4gICAgICAgICAgICBpZiAoIXRpbWVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb2NrLm5vdztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY2xvY2suZHVyaW5nVGljayA9IHRydWU7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGNsb2NrLm5vdyA9IHRpbWVyLmNhbGxBdDtcbiAgICAgICAgICAgICAgICBjYWxsVGltZXIoY2xvY2ssIHRpbWVyKTtcbiAgICAgICAgICAgICAgICBydW5Kb2JzKGNsb2NrKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2xvY2subm93O1xuICAgICAgICAgICAgfSBmaW5hbGx5IHtcbiAgICAgICAgICAgICAgICBjbG9jay5kdXJpbmdUaWNrID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKHR5cGVvZiBfZ2xvYmFsLlByb21pc2UgIT09IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgIGNsb2NrLm5leHRBc3luYyA9IGZ1bmN0aW9uIG5leHRBc3luYygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IF9nbG9iYWwuUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsU2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRpbWVyID0gZmlyc3RUaW1lcihjbG9jayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aW1lcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGNsb2NrLm5vdyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXJyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrLmR1cmluZ1RpY2sgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrLm5vdyA9IHRpbWVyLmNhbGxBdDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsVGltZXIoY2xvY2ssIHRpbWVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVyciA9IGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrLmR1cmluZ1RpY2sgPSBmYWxzZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsU2V0VGltZW91dChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShjbG9jay5ub3cpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICBjbG9jay5ydW5BbGwgPSBmdW5jdGlvbiBydW5BbGwoKSB7XG4gICAgICAgICAgICBsZXQgbnVtVGltZXJzLCBpO1xuICAgICAgICAgICAgcnVuSm9icyhjbG9jayk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY2xvY2subG9vcExpbWl0OyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoIWNsb2NrLnRpbWVycykge1xuICAgICAgICAgICAgICAgICAgICByZXNldElzTmVhckluZmluaXRlTGltaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNsb2NrLm5vdztcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBudW1UaW1lcnMgPSBPYmplY3Qua2V5cyhjbG9jay50aW1lcnMpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAobnVtVGltZXJzID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc2V0SXNOZWFySW5maW5pdGVMaW1pdCgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2xvY2subm93O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNsb2NrLm5leHQoKTtcbiAgICAgICAgICAgICAgICBjaGVja0lzTmVhckluZmluaXRlTGltaXQoY2xvY2ssIGkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjb25zdCBleGNlc3NKb2IgPSBmaXJzdFRpbWVyKGNsb2NrKTtcbiAgICAgICAgICAgIHRocm93IGdldEluZmluaXRlTG9vcEVycm9yKGNsb2NrLCBleGNlc3NKb2IpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGNsb2NrLnJ1blRvRnJhbWUgPSBmdW5jdGlvbiBydW5Ub0ZyYW1lKCkge1xuICAgICAgICAgICAgcmV0dXJuIGNsb2NrLnRpY2soZ2V0VGltZVRvTmV4dEZyYW1lKCkpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGlmICh0eXBlb2YgX2dsb2JhbC5Qcm9taXNlICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICBjbG9jay5ydW5BbGxBc3luYyA9IGZ1bmN0aW9uIHJ1bkFsbEFzeW5jKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgX2dsb2JhbC5Qcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSAwO1xuICAgICAgICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRvUnVuKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWxTZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5Kb2JzKGNsb2NrKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbnVtVGltZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA8IGNsb2NrLmxvb3BMaW1pdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjbG9jay50aW1lcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNldElzTmVhckluZmluaXRlTGltaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGNsb2NrLm5vdyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1UaW1lcnMgPSBPYmplY3Qua2V5cyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay50aW1lcnMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChudW1UaW1lcnMgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNldElzTmVhckluZmluaXRlTGltaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGNsb2NrLm5vdyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay5uZXh0KCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkrKztcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9SdW4oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrSXNOZWFySW5maW5pdGVMaW1pdChjbG9jaywgaSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlc3NKb2IgPSBmaXJzdFRpbWVyKGNsb2NrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGdldEluZmluaXRlTG9vcEVycm9yKGNsb2NrLCBleGNlc3NKb2IpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkb1J1bigpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNsb2NrLnJ1blRvTGFzdCA9IGZ1bmN0aW9uIHJ1blRvTGFzdCgpIHtcbiAgICAgICAgICAgIGNvbnN0IHRpbWVyID0gbGFzdFRpbWVyKGNsb2NrKTtcbiAgICAgICAgICAgIGlmICghdGltZXIpIHtcbiAgICAgICAgICAgICAgICBydW5Kb2JzKGNsb2NrKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2xvY2subm93O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gY2xvY2sudGljayh0aW1lci5jYWxsQXQgLSBjbG9jay5ub3cpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGlmICh0eXBlb2YgX2dsb2JhbC5Qcm9taXNlICE9PSBcInVuZGVmaW5lZFwiKSB7XG4gICAgICAgICAgICBjbG9jay5ydW5Ub0xhc3RBc3luYyA9IGZ1bmN0aW9uIHJ1blRvTGFzdEFzeW5jKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgX2dsb2JhbC5Qcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWxTZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGltZXIgPSBsYXN0VGltZXIoY2xvY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdGltZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuSm9icyhjbG9jayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoY2xvY2subm93KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGNsb2NrLnRpY2tBc3luYyh0aW1lci5jYWxsQXQgLSBjbG9jay5ub3cpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNsb2NrLnJlc2V0ID0gZnVuY3Rpb24gcmVzZXQoKSB7XG4gICAgICAgICAgICBuYW5vcyA9IDA7XG4gICAgICAgICAgICBjbG9jay50aW1lcnMgPSB7fTtcbiAgICAgICAgICAgIGNsb2NrLmpvYnMgPSBbXTtcbiAgICAgICAgICAgIGNsb2NrLm5vdyA9IHN0YXJ0O1xuICAgICAgICB9O1xuXG4gICAgICAgIGNsb2NrLnNldFN5c3RlbVRpbWUgPSBmdW5jdGlvbiBzZXRTeXN0ZW1UaW1lKHN5c3RlbVRpbWUpIHtcbiAgICAgICAgICAgIC8vIGRldGVybWluZSB0aW1lIGRpZmZlcmVuY2VcbiAgICAgICAgICAgIGNvbnN0IG5ld05vdyA9IGdldEVwb2NoKHN5c3RlbVRpbWUpO1xuICAgICAgICAgICAgY29uc3QgZGlmZmVyZW5jZSA9IG5ld05vdyAtIGNsb2NrLm5vdztcbiAgICAgICAgICAgIGxldCBpZCwgdGltZXI7XG5cbiAgICAgICAgICAgIGFkanVzdGVkU3lzdGVtVGltZVswXSA9IGFkanVzdGVkU3lzdGVtVGltZVswXSArIGRpZmZlcmVuY2U7XG4gICAgICAgICAgICBhZGp1c3RlZFN5c3RlbVRpbWVbMV0gPSBhZGp1c3RlZFN5c3RlbVRpbWVbMV0gKyBuYW5vcztcbiAgICAgICAgICAgIC8vIHVwZGF0ZSAnc3lzdGVtIGNsb2NrJ1xuICAgICAgICAgICAgY2xvY2subm93ID0gbmV3Tm93O1xuICAgICAgICAgICAgbmFub3MgPSAwO1xuXG4gICAgICAgICAgICAvLyB1cGRhdGUgdGltZXJzIGFuZCBpbnRlcnZhbHMgdG8ga2VlcCB0aGVtIHN0YWJsZVxuICAgICAgICAgICAgZm9yIChpZCBpbiBjbG9jay50aW1lcnMpIHtcbiAgICAgICAgICAgICAgICBpZiAoY2xvY2sudGltZXJzLmhhc093blByb3BlcnR5KGlkKSkge1xuICAgICAgICAgICAgICAgICAgICB0aW1lciA9IGNsb2NrLnRpbWVyc1tpZF07XG4gICAgICAgICAgICAgICAgICAgIHRpbWVyLmNyZWF0ZWRBdCArPSBkaWZmZXJlbmNlO1xuICAgICAgICAgICAgICAgICAgICB0aW1lci5jYWxsQXQgKz0gZGlmZmVyZW5jZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfG51bWJlcn0gdGlja1ZhbHVlIG51bWJlciBvZiBtaWxsaXNlY29uZHMgb3IgYSBodW1hbi1yZWFkYWJsZSB2YWx1ZSBsaWtlIFwiMDE6MTE6MTVcIlxuICAgICAgICAgKiBAcmV0dXJucyB7bnVtYmVyfSB3aWxsIHJldHVybiB0aGUgbmV3IGBub3dgIHZhbHVlXG4gICAgICAgICAqL1xuICAgICAgICBjbG9jay5qdW1wID0gZnVuY3Rpb24ganVtcCh0aWNrVmFsdWUpIHtcbiAgICAgICAgICAgIGNvbnN0IG1zRmxvYXQgPVxuICAgICAgICAgICAgICAgIHR5cGVvZiB0aWNrVmFsdWUgPT09IFwibnVtYmVyXCJcbiAgICAgICAgICAgICAgICAgICAgPyB0aWNrVmFsdWVcbiAgICAgICAgICAgICAgICAgICAgOiBwYXJzZVRpbWUodGlja1ZhbHVlKTtcbiAgICAgICAgICAgIGNvbnN0IG1zID0gTWF0aC5mbG9vcihtc0Zsb2F0KTtcblxuICAgICAgICAgICAgZm9yIChjb25zdCB0aW1lciBvZiBPYmplY3QudmFsdWVzKGNsb2NrLnRpbWVycykpIHtcbiAgICAgICAgICAgICAgICBpZiAoY2xvY2subm93ICsgbXMgPiB0aW1lci5jYWxsQXQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGltZXIuY2FsbEF0ID0gY2xvY2subm93ICsgbXM7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2xvY2sudGljayhtcyk7XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKGlzUHJlc2VudC5wZXJmb3JtYW5jZSkge1xuICAgICAgICAgICAgY2xvY2sucGVyZm9ybWFuY2UgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICAgICAgY2xvY2sucGVyZm9ybWFuY2Uubm93ID0gZmFrZVBlcmZvcm1hbmNlTm93O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzUHJlc2VudC5ocnRpbWUpIHtcbiAgICAgICAgICAgIGNsb2NrLmhydGltZSA9IGhydGltZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjbG9jaztcbiAgICB9XG5cbiAgICAvKiBlc2xpbnQtZGlzYWJsZSBjb21wbGV4aXR5ICovXG5cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge0NvbmZpZz19IFtjb25maWddIE9wdGlvbmFsIGNvbmZpZ1xuICAgICAqIEByZXR1cm5zIHtDbG9ja31cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBpbnN0YWxsKGNvbmZpZykge1xuICAgICAgICBpZiAoXG4gICAgICAgICAgICBhcmd1bWVudHMubGVuZ3RoID4gMSB8fFxuICAgICAgICAgICAgY29uZmlnIGluc3RhbmNlb2YgRGF0ZSB8fFxuICAgICAgICAgICAgQXJyYXkuaXNBcnJheShjb25maWcpIHx8XG4gICAgICAgICAgICB0eXBlb2YgY29uZmlnID09PSBcIm51bWJlclwiXG4gICAgICAgICkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihcbiAgICAgICAgICAgICAgICBgRmFrZVRpbWVycy5pbnN0YWxsIGNhbGxlZCB3aXRoICR7U3RyaW5nKFxuICAgICAgICAgICAgICAgICAgICBjb25maWcsXG4gICAgICAgICAgICAgICAgKX0gaW5zdGFsbCByZXF1aXJlcyBhbiBvYmplY3QgcGFyYW1ldGVyYCxcbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoX2dsb2JhbC5EYXRlLmlzRmFrZSA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgLy8gVGltZXJzIGFyZSBhbHJlYWR5IGZha2VkOyB0aGlzIGlzIGEgcHJvYmxlbS5cbiAgICAgICAgICAgIC8vIE1ha2UgdGhlIHVzZXIgcmVzZXQgdGltZXJzIG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AgKi9cbiAgICAgICAgZnVuY3Rpb24gaGFuZGxlTWlzc2luZ1RpbWVyKHRpbWVyKSB7XG4gICAgICAgICAgICBpZiAoY29uZmlnLmlnbm9yZU1pc3NpbmdUaW1lcnMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRocm93IG5ldyBSZWZlcmVuY2VFcnJvcihcbiAgICAgICAgICAgICAgICBgbm9uLWV4aXN0ZW50IHRpbWVycyBhbmQvb3Igb2JqZWN0cyBjYW5ub3QgYmUgZmFrZWQ6ICcke3RpbWVyfSdgLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBpLCBsO1xuICAgICAgICBjb25zdCBjbG9jayA9IGNyZWF0ZUNsb2NrKGNvbmZpZy5ub3csIGNvbmZpZy5sb29wTGltaXQpO1xuICAgICAgICBjbG9jay5zaG91bGRDbGVhck5hdGl2ZVRpbWVycyA9IGNvbmZpZy5zaG91bGRDbGVhck5hdGl2ZVRpbWVycztcblxuICAgICAgICBjbG9jay51bmluc3RhbGwgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdW5pbnN0YWxsKGNsb2NrLCBjb25maWcpO1xuICAgICAgICB9O1xuXG4gICAgICAgIGNsb2NrLmFib3J0TGlzdGVuZXJNYXAgPSBuZXcgTWFwKCk7XG5cbiAgICAgICAgY2xvY2subWV0aG9kcyA9IGNvbmZpZy50b0Zha2UgfHwgW107XG5cbiAgICAgICAgaWYgKGNsb2NrLm1ldGhvZHMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICBjbG9jay5tZXRob2RzID0gT2JqZWN0LmtleXModGltZXJzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb25maWcuc2hvdWxkQWR2YW5jZVRpbWUgPT09IHRydWUpIHtcbiAgICAgICAgICAgIGNvbnN0IGludGVydmFsVGljayA9IGRvSW50ZXJ2YWxUaWNrLmJpbmQoXG4gICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICBjbG9jayxcbiAgICAgICAgICAgICAgICBjb25maWcuYWR2YW5jZVRpbWVEZWx0YSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBjb25zdCBpbnRlcnZhbElkID0gX2dsb2JhbC5zZXRJbnRlcnZhbChcbiAgICAgICAgICAgICAgICBpbnRlcnZhbFRpY2ssXG4gICAgICAgICAgICAgICAgY29uZmlnLmFkdmFuY2VUaW1lRGVsdGEsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgY2xvY2suYXR0YWNoZWRJbnRlcnZhbCA9IGludGVydmFsSWQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY2xvY2subWV0aG9kcy5pbmNsdWRlcyhcInBlcmZvcm1hbmNlXCIpKSB7XG4gICAgICAgICAgICBjb25zdCBwcm90byA9ICgoKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGhhc1BlcmZvcm1hbmNlQ29uc3RydWN0b3JQcm90b3R5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9nbG9iYWwucGVyZm9ybWFuY2UuY29uc3RydWN0b3IucHJvdG90eXBlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaGFzUGVyZm9ybWFuY2VQcm90b3R5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9nbG9iYWwuUGVyZm9ybWFuY2UucHJvdG90eXBlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pKCk7XG4gICAgICAgICAgICBpZiAocHJvdG8pIHtcbiAgICAgICAgICAgICAgICBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhwcm90bykuZm9yRWFjaChmdW5jdGlvbiAobmFtZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobmFtZSAhPT0gXCJub3dcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2sucGVyZm9ybWFuY2VbbmFtZV0gPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUuaW5kZXhPZihcImdldEVudHJpZXNcIikgPT09IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBOT09QX0FSUkFZXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTk9PUDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIC8vIGVuc3VyZSBgbWFya2AgcmV0dXJucyBhIHZhbHVlIHRoYXQgaXMgdmFsaWRcbiAgICAgICAgICAgICAgICBjbG9jay5wZXJmb3JtYW5jZS5tYXJrID0gKG5hbWUpID0+XG4gICAgICAgICAgICAgICAgICAgIG5ldyBGYWtlUGVyZm9ybWFuY2VFbnRyeShuYW1lLCBcIm1hcmtcIiwgMCwgMCk7XG4gICAgICAgICAgICAgICAgY2xvY2sucGVyZm9ybWFuY2UubWVhc3VyZSA9IChuYW1lKSA9PlxuICAgICAgICAgICAgICAgICAgICBuZXcgRmFrZVBlcmZvcm1hbmNlRW50cnkobmFtZSwgXCJtZWFzdXJlXCIsIDAsIDEwMCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKChjb25maWcudG9GYWtlIHx8IFtdKS5pbmNsdWRlcyhcInBlcmZvcm1hbmNlXCIpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZU1pc3NpbmdUaW1lcihcInBlcmZvcm1hbmNlXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChfZ2xvYmFsID09PSBnbG9iYWxPYmplY3QgJiYgdGltZXJzTW9kdWxlKSB7XG4gICAgICAgICAgICBjbG9jay50aW1lcnNNb2R1bGVNZXRob2RzID0gW107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKF9nbG9iYWwgPT09IGdsb2JhbE9iamVjdCAmJiB0aW1lcnNQcm9taXNlc01vZHVsZSkge1xuICAgICAgICAgICAgY2xvY2sudGltZXJzUHJvbWlzZXNNb2R1bGVNZXRob2RzID0gW107XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChpID0gMCwgbCA9IGNsb2NrLm1ldGhvZHMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7XG4gICAgICAgICAgICBjb25zdCBuYW1lT2ZNZXRob2RUb1JlcGxhY2UgPSBjbG9jay5tZXRob2RzW2ldO1xuXG4gICAgICAgICAgICBpZiAoIWlzUHJlc2VudFtuYW1lT2ZNZXRob2RUb1JlcGxhY2VdKSB7XG4gICAgICAgICAgICAgICAgaGFuZGxlTWlzc2luZ1RpbWVyKG5hbWVPZk1ldGhvZFRvUmVwbGFjZSk7XG4gICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChuYW1lT2ZNZXRob2RUb1JlcGxhY2UgPT09IFwiaHJ0aW1lXCIpIHtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgIF9nbG9iYWwucHJvY2VzcyAmJlxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgX2dsb2JhbC5wcm9jZXNzLmhydGltZSA9PT0gXCJmdW5jdGlvblwiXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGhpamFja01ldGhvZChfZ2xvYmFsLnByb2Nlc3MsIG5hbWVPZk1ldGhvZFRvUmVwbGFjZSwgY2xvY2spO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZU9mTWV0aG9kVG9SZXBsYWNlID09PSBcIm5leHRUaWNrXCIpIHtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgIF9nbG9iYWwucHJvY2VzcyAmJlxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgX2dsb2JhbC5wcm9jZXNzLm5leHRUaWNrID09PSBcImZ1bmN0aW9uXCJcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgaGlqYWNrTWV0aG9kKF9nbG9iYWwucHJvY2VzcywgbmFtZU9mTWV0aG9kVG9SZXBsYWNlLCBjbG9jayk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBoaWphY2tNZXRob2QoX2dsb2JhbCwgbmFtZU9mTWV0aG9kVG9SZXBsYWNlLCBjbG9jayk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgY2xvY2sudGltZXJzTW9kdWxlTWV0aG9kcyAhPT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICAgICAgdGltZXJzTW9kdWxlW25hbWVPZk1ldGhvZFRvUmVwbGFjZV1cbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIGNvbnN0IG9yaWdpbmFsID0gdGltZXJzTW9kdWxlW25hbWVPZk1ldGhvZFRvUmVwbGFjZV07XG4gICAgICAgICAgICAgICAgY2xvY2sudGltZXJzTW9kdWxlTWV0aG9kcy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kTmFtZTogbmFtZU9mTWV0aG9kVG9SZXBsYWNlLFxuICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbDogb3JpZ2luYWwsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgdGltZXJzTW9kdWxlW25hbWVPZk1ldGhvZFRvUmVwbGFjZV0gPVxuICAgICAgICAgICAgICAgICAgICBfZ2xvYmFsW25hbWVPZk1ldGhvZFRvUmVwbGFjZV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2xvY2sudGltZXJzUHJvbWlzZXNNb2R1bGVNZXRob2RzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBpZiAobmFtZU9mTWV0aG9kVG9SZXBsYWNlID09PSBcInNldFRpbWVvdXRcIikge1xuICAgICAgICAgICAgICAgICAgICBjbG9jay50aW1lcnNQcm9taXNlc01vZHVsZU1ldGhvZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2ROYW1lOiBcInNldFRpbWVvdXRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsOiB0aW1lcnNQcm9taXNlc01vZHVsZS5zZXRUaW1lb3V0LFxuICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICB0aW1lcnNQcm9taXNlc01vZHVsZS5zZXRUaW1lb3V0ID0gKFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsYXksXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMgPSB7fSxcbiAgICAgICAgICAgICAgICAgICAgKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGFib3J0ID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNpZ25hbC5yZW1vdmVFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJhYm9ydFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJvcnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrLmFib3J0TGlzdGVuZXJNYXAuZGVsZXRlKGFib3J0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIHNhZmUsIHRoZXJlIGlzIG5vIGNvZGUgcGF0aCB0aGF0IGxlYWRzIHRvIHRoaXMgZnVuY3Rpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmVpbmcgaW52b2tlZCBiZWZvcmUgaGFuZGxlIGhhcyBiZWVuIGFzc2lnbmVkLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdXNlLWJlZm9yZS1kZWZpbmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2suY2xlYXJUaW1lb3V0KGhhbmRsZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChvcHRpb25zLnNpZ25hbC5yZWFzb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoYW5kbGUgPSBjbG9jay5zZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuc2lnbmFsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNpZ25hbC5yZW1vdmVFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYWJvcnRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay5hYm9ydExpc3RlbmVyTWFwLmRlbGV0ZShhYm9ydCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBkZWxheSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5zaWduYWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuc2lnbmFsLmFib3J0ZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFib3J0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNpZ25hbC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYWJvcnRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay5hYm9ydExpc3RlbmVyTWFwLnNldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNpZ25hbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5hbWVPZk1ldGhvZFRvUmVwbGFjZSA9PT0gXCJzZXRJbW1lZGlhdGVcIikge1xuICAgICAgICAgICAgICAgICAgICBjbG9jay50aW1lcnNQcm9taXNlc01vZHVsZU1ldGhvZHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRob2ROYW1lOiBcInNldEltbWVkaWF0ZVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6IHRpbWVyc1Byb21pc2VzTW9kdWxlLnNldEltbWVkaWF0ZSxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGltZXJzUHJvbWlzZXNNb2R1bGUuc2V0SW1tZWRpYXRlID0gKHZhbHVlLCBvcHRpb25zID0ge30pID0+XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYWJvcnQgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuc2lnbmFsLnJlbW92ZUV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImFib3J0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2suYWJvcnRMaXN0ZW5lck1hcC5kZWxldGUoYWJvcnQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgc2FmZSwgdGhlcmUgaXMgbm8gY29kZSBwYXRoIHRoYXQgbGVhZHMgdG8gdGhpcyBmdW5jdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBiZWluZyBpbnZva2VkIGJlZm9yZSBoYW5kbGUgaGFzIGJlZW4gYXNzaWduZWQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11c2UtYmVmb3JlLWRlZmluZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay5jbGVhckltbWVkaWF0ZShoYW5kbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWplY3Qob3B0aW9ucy5zaWduYWwucmVhc29uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaGFuZGxlID0gY2xvY2suc2V0SW1tZWRpYXRlKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuc2lnbmFsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNpZ25hbC5yZW1vdmVFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYWJvcnRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay5hYm9ydExpc3RlbmVyTWFwLmRlbGV0ZShhYm9ydCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnNpZ25hbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5zaWduYWwuYWJvcnRlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJvcnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuc2lnbmFsLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJhYm9ydFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFib3J0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrLmFib3J0TGlzdGVuZXJNYXAuc2V0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFib3J0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuc2lnbmFsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmFtZU9mTWV0aG9kVG9SZXBsYWNlID09PSBcInNldEludGVydmFsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xvY2sudGltZXJzUHJvbWlzZXNNb2R1bGVNZXRob2RzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kTmFtZTogXCJzZXRJbnRlcnZhbFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6IHRpbWVyc1Byb21pc2VzTW9kdWxlLnNldEludGVydmFsLFxuICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICB0aW1lcnNQcm9taXNlc01vZHVsZS5zZXRJbnRlcnZhbCA9IChcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5LFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zID0ge30sXG4gICAgICAgICAgICAgICAgICAgICkgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFtTeW1ib2wuYXN5bmNJdGVyYXRvcl06ICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjcmVhdGVSZXNvbHZhYmxlID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzb2x2ZSwgcmVqZWN0O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBwcm9taXNlID0gbmV3IFByb21pc2UoKHJlcywgcmVqKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlID0gcmVzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0ID0gcmVqO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvbWlzZS5yZXNvbHZlID0gcmVzb2x2ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvbWlzZS5yZWplY3QgPSByZWplY3Q7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZG9uZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBoYXNUaHJvd24gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmV0dXJuQ2FsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV4dEF2YWlsYWJsZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbmV4dFF1ZXVlID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoYW5kbGUgPSBjbG9jay5zZXRJbnRlcnZhbCgoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0UXVldWUubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dFF1ZXVlLnNoaWZ0KCkucmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dEF2YWlsYWJsZSsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZGVsYXkpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYWJvcnQgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuc2lnbmFsLnJlbW92ZUV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImFib3J0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2suYWJvcnRMaXN0ZW5lck1hcC5kZWxldGUoYWJvcnQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb2NrLmNsZWFySW50ZXJ2YWwoaGFuZGxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgcmVzb2x2YWJsZSBvZiBuZXh0UXVldWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmFibGUucmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnNpZ25hbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5zaWduYWwuYWJvcnRlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNpZ25hbC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYWJvcnRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay5hYm9ydExpc3RlbmVyTWFwLnNldChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhYm9ydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNpZ25hbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0OiBhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5zaWduYWw/LmFib3J0ZWQgJiYgIWhhc1Rocm93bikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc1Rocm93biA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgb3B0aW9ucy5zaWduYWwucmVhc29uO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG9uZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGRvbmU6IHRydWUsIHZhbHVlOiB1bmRlZmluZWQgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRBdmFpbGFibGUgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dEF2YWlsYWJsZS0tO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGRvbmU6IGZhbHNlLCB2YWx1ZTogdmFsdWUgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzb2x2YWJsZSA9IGNyZWF0ZVJlc29sdmFibGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRRdWV1ZS5wdXNoKHJlc29sdmFibGUpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCByZXNvbHZhYmxlO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmV0dXJuQ2FsbCAmJiBuZXh0UXVldWUubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuQ2FsbC5yZXNvbHZlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnNpZ25hbD8uYWJvcnRlZCAmJiAhaGFzVGhyb3duKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzVGhyb3duID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBvcHRpb25zLnNpZ25hbC5yZWFzb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb25lKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgZG9uZTogdHJ1ZSwgdmFsdWU6IHVuZGVmaW5lZCB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBkb25lOiBmYWxzZSwgdmFsdWU6IHZhbHVlIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjogYXN5bmMgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBkb25lOiB0cnVlLCB2YWx1ZTogdW5kZWZpbmVkIH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0UXVldWUubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybkNhbGwgPSBjcmVhdGVSZXNvbHZhYmxlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgcmV0dXJuQ2FsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvY2suY2xlYXJJbnRlcnZhbChoYW5kbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZSA9IHRydWU7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnNpZ25hbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuc2lnbmFsLnJlbW92ZUV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYWJvcnRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWJvcnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9jay5hYm9ydExpc3RlbmVyTWFwLmRlbGV0ZShhYm9ydCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IGRvbmU6IHRydWUsIHZhbHVlOiB1bmRlZmluZWQgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNsb2NrO1xuICAgIH1cblxuICAgIC8qIGVzbGludC1lbmFibGUgY29tcGxleGl0eSAqL1xuXG4gICAgcmV0dXJuIHtcbiAgICAgICAgdGltZXJzOiB0aW1lcnMsXG4gICAgICAgIGNyZWF0ZUNsb2NrOiBjcmVhdGVDbG9jayxcbiAgICAgICAgaW5zdGFsbDogaW5zdGFsbCxcbiAgIC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gY3JlYXRlTWF0Y2hlci50eXBlT2YoXCJhcnJheVwiKTtcblxuY3JlYXRlTWF0Y2hlci5hcnJheS5kZWVwRXF1YWxzID0gZnVuY3Rpb24gKGV4cGVjdGF0aW9uKSB7XG4gICAgcmV0dXJuIGNyZWF0ZU1hdGNoZXIoXG4gICAgICAgIGZ1bmN0aW9uIChhY3R1YWwpIHtcbiAgICAgICAgICAgIC8vIENvbXBhcmluZyBsZW5ndGhzIGlzIHRoZSBmYXN0ZXN0IHdheSB0byBzcG90IGEgZGlmZmVyZW5jZSBiZWZvcmUgaXRlcmF0aW5nIHRocm91Z2ggZXZlcnkgaXRlbVxuICAgICAgICAgICAgdmFyIHNhbWVMZW5ndGggPSBhY3R1YWwubGVuZ3RoID09PSBleHBlY3RhdGlvbi5sZW5ndGg7XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIHR5cGVPZihhY3R1YWwpID09PSBcImFycmF5XCIgJiZcbiAgICAgICAgICAgICAgICBzYW1lTGVuZ3RoICYmXG4gICAgICAgICAgICAgICAgZXZlcnkoYWN0dWFsLCBmdW5jdGlvbiAoZWxlbWVudCwgaW5kZXgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV4cGVjdGVkID0gZXhwZWN0YXRpb25baW5kZXhdO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHlwZU9mKGV4cGVjdGVkKSA9PT0gXCJhcnJheVwiICYmXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlT2YoZWxlbWVudCkgPT09IFwiYXJyYXlcIlxuICAgICAgICAgICAgICAgICAgICAgICAgPyBjcmVhdGVNYXRjaGVyLmFycmF5LmRlZXBFcXVhbHMoZXhwZWN0ZWQpLnRlc3QoZWxlbWVudClcbiAgICAgICAgICAgICAgICAgICAgICAgIDogZGVlcEVxdWFsKGV4cGVjdGVkLCBlbGVtZW50KTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSx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ICAgICAgICAgICAgICAgZXZlcnkoZXhwZWN0YXRpb24sIGZ1bmN0aW9uIChleHBlY3RlZEVsZW1lbnQsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhY3R1YWxbb2Zmc2V0ICsgaW5kZXhdID09PSBleHBlY3RlZEVsZW1lbnQ7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0sXG4gICAgICAgIGBlbmRzV2l0aChbJHtpdGVyYWJsZVRvU3RyaW5nKGV4cGVjdGF0aW9uKX1dKWAsXG4gICAgKTtcbn07XG5cbmNyZWF0ZU1hdGNoZXIuYXJyYXkuY29udGFpbnMgPSBmdW5jdGlvbiAoZXhwZWN0YXRpb24pIHtcbiAgICByZXR1cm4gY3JlYXRlTWF0Y2hlcihcbiAgICAgICAgZnVuY3Rpb24gKGFjdHVhbCkge1xuICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICB0eXBlT2YoYWN0dWFsKSA9PT0gXCJhcnJheVwiICYmXG4gICAgICAgICAgICAgICAgZXZlcnkoZXhwZWN0YXRpb24sIGZ1bmN0aW9uIChleHBlY3RlZEVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5SW5kZXhPZihhY3R1YWwsIGV4cGVjdGVkRWxlbWVudCkgIT09IC0xO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICApO1xuICAgICAgICB9LFxuICAgICAgICBgY29udGFpbnMoWyR7aXRlcmFibGVUb1N0cmluZyhleHBlY3RhdGlvbil9XSlgLFxuICAgICk7XG59O1xuXG5jcmVhdGVNYXRjaGVyLm1hcCA9IGNyZWF0ZU1hdGNoZXIudHlwZU9mKFwibWFwXCIpO1xuXG5jcmVhdGVNYXRjaGVyLm1hcC5kZWVwRXF1YWxzID0gZnVuY3Rpb24gbWFwRGVlcEVxdWFscyhleHBlY3RhdGlvbikge1xuICAgIHJldHVybiBjcmVhdGVNYXRjaGVyKFxuICAgICAgICBmdW5jdGlvbiAoYWN0dWFsKSB7XG4gICAgICAgICAgICAvLyBDb21wYXJpbmcgbGVuZ3RocyBpcyB0aGUgZmFzdGVzdCB3YXkgdG8gc3BvdCBhIGRpZmZlcmVuY2UgYmVmb3JlIGl0ZXJhdGluZyB0aHJvdWdoIGV2ZXJ5IGl0ZW1cbiAgICAgICAgICAgIHZhciBzYW1lTGVuZ3RoID0gYWN0dWFsLnNpemUgPT09IGV4cGVjdGF0aW9uLnNpemU7XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIHR5cGVPZihhY3R1YWwpID09PSBcIm1hcFwiICYmXG4gICAgICAgICAgICAgICAgc2FtZUxlbmd0aCAmJlxuICAgICAgICAgICAgICAgIGV2ZXJ5KGFjdHVhbCwgZnVuY3Rpb24gKGVsZW1lbnQsIGtleSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgZXhwZWN0YXRpb24uaGFzKGtleSkgJiYgZXhwZWN0YXRpb24uZ2V0KGtleSkgPT09IGVsZW1lbnRcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSxcbiAgICAgICAgYGRlZXBFcXVhbHMoTWFwWyR7aXRlcmFibGVUb1N0cmluZyhleHBlY3RhdGlvbil9XSlgLFxuICAgICk7XG59O1xuXG5jcmVhdGVNYXRjaGVyLm1hcC5jb250YWlucyA9IGZ1bmN0aW9uIG1hcENvbnRhaW5zKGV4cGVjdGF0aW9uKSB7XG4gICAgcmV0dXJuIGNyZWF0ZU1hdGNoZXIoXG4gICAgICAgIGZ1bmN0aW9uIChhY3R1YWwpIHtcbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgdHlwZU9mKGFjdHVhbCkgPT09IFwibWFwXCIgJiZcbiAgICAgICAgICAgICAgICBldmVyeShleHBlY3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hdGNoKCR7ZnVuY3Rpb25OYW1lKGV4cGVjdGF0aW9uKX0pYDtcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyOiBmdW5jdGlvbiAobSwgZXhwZWN0YXRpb24pIHtcbiAgICAgICAgICAgIG0udGVzdCA9IGZ1bmN0aW9uIChhY3R1YWwpIHtcbiAgICAgICAgICAgICAgICAvLyB3ZSBuZWVkIHR5cGUgY29lcmNpb24gaGVyZVxuICAgICAgICAgICAgICAgIHJldHVybiBleHBlY3RhdGlvbiA9PSBhY3R1YWw7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgZXFlcWVxXG4gICAgICAgICAgICB9O1xuICAgICAgICB9LFxuICAgICAgICBvYmplY3Q6IGZ1bmN0aW9uIChtLCBleHBlY3RhdGlvbikge1xuICAgICAgICAgICAgdmFyIGFycmF5ID0gW107XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgZXhwZWN0YXRpb24udGVzdCA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICAgICAgICAgICAgbS50ZXN0ID0gZnVuY3Rpb24gKGFjdHVhbCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXhwZWN0YXRpb24udGVzdChhY3R1YWwpID09PSB0cnVlO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbS5tZXNzYWdlID0gYG1hdGNoKCR7ZnVuY3Rpb25OYW1lKGV4cGVjdGF0aW9uLnRlc3QpfSlgO1xuICAgICAgICAgICAgICAgIHJldHVybiBtO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBhcnJheSA9IG1hcChPYmplY3Qua2V5cyhleHBlY3RhdGlvbiksIGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYCR7a2V5fTogJHt2YWx1ZVRvU3RyaW5nKGV4cGVjdGF0aW9uW2tleV0pfWA7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbS50ZXN0ID0gZnVuY3Rpb24gKGFjdHVhbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaE9iamVjdChhY3R1YWwsIGV4cGVjdGF0aW9uLCBtYXRjaCk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbS5tZXNzYWdlID0gYG1hdGNoKCR7am9pbihhcnJheSwgXCIsIFwiKX0pYDtcblxuICAgICAgICAgICAgcmV0dXJuIG07XG4gICAgICAgIH0sXG4gICAgICAgIHJlZ2V4cDogZnVuY3Rpb24gKG0sIGV4cGVjdGF0aW9uKSB7XG4gICAgICAgICAgICBtLnRlc3QgPSBmdW5jdGlvbiAoYWN0dWFsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiBhY3R1YWwgPT09IFwic3RyaW5nXCIgJiYgZXhwZWN0YXRpb24udGVzdChhY3R1YWwpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgc3RyaW5nOiBmdW5jdGlvbiAobSwgZXhwZWN0YXRpb24pIHtcbiAgICAgICAgICAgIG0udGVzdCA9IGZ1bmN0aW9uIChhY3R1YWwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICB0eXBlb2YgYWN0dWFsID09PSBcInN0cmluZ1wiICYmXG4gICAgICAgICAgICAgICAgICAgIHN0cmluZ0luZGV4T2YoYWN0dWFsLCBleHBlY3RhdGlvbikgIT09IC0xXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBtLm1lc3NhZ2UgPSBgbWF0Y2goXCIke2V4cGVjdGF0aW9ufVwiKWA7XG4gICAgICAgIH0sXG4gICAgfTtcbn07XG5cbm1vZHVsZS5leHBvcnRzID0gY3JlYXRlVHlwZU1hcDtcbiIsIlwidXNlIHN0cmljdFwiO1xuXG52YXIgdmFsdWVUb1N0cmluZyA9IHJlcXVpcmUoXCJAc2lub25qcy9jb21tb25zXCIpLnZhbHVlVG9TdHJpbmc7XG52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pc05hTihleHBlY3RhdGlvbk9iaikgfHxcbiAgICAgICAgICAgIGFjdHVhbE9iaiA9PT0gbnVsbCB8fFxuICAgICAgICAgICAgZXhwZWN0YXRpb25PYmogPT09IG51bGwgfHxcbiAgICAgICAgICAgIGFjdHVhbE9iaiA9PT0gdW5kZWZpbmVkIHx8XG4gICAgICAgICAgICBleHBlY3RhdGlvbk9iaiA9PT0gdW5kZWZpbmVkIHx8XG4gICAgICAgICAgICBhY3R1YWxUeXBlICE9PSBcIm9iamVjdFwiIHx8XG4gICAgICAgICAgICBleHBlY3RhdGlvblR5cGUgIT09IFwib2JqZWN0XCJcbiAgICAgICAgKSB7XG4gICAgICAgICAgICByZXR1cm4gaWRlbnRpY2FsKGFjdHVhbE9iaiwgZXhwZWN0YXRpb25PYmopO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRWxlbWVudHMgYXJlIG9ubHkgZXF1YWwgaWYgaWRlbnRpY2FsKGV4cGVjdGVkLCBhY3R1YWwpXG4gICAgICAgIGlmIChpc0VsZW1lbnQoYWN0dWFsT2JqKSB8fCBpc0VsZW1lbnQoZXhwZWN0YXRpb25PYmopKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgaXNBY3R1YWxEYXRlID0gaXNEYXRlKGFjdHVhbE9iaik7XG4gICAgICAgIHZhciBpc0V4cGVjdGF0aW9uRGF0ZSA9IGlzRGF0ZShleHBlY3RhdGlvbk9iaik7XG4gICAgICAgIGlmIChpc0FjdHVhbERhdGUgfHwgaXNFeHBlY3RhdGlvbkRhdGUpIHtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAhaXNBY3R1YWxEYXRlIHx8XG4gICAgICAgICAgICAgICAgIWlzRXhwZWN0YXRpb25EYXRlIHx8XG4gICAgICAgICAgICAgICAgZ2V0VGltZS5jYWxsKGFjdHVhbE9iaikgIT09IGdldFRpbWUuY2FsbChleHBlY3RhdGlvbk9iailcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhY3R1YWxPYmogaW5zdGFuY2VvZiBSZWdFeHAgJiYgZXhwZWN0YXRpb25PYmogaW5zdGFuY2VvZiBSZWdFeHApIHtcbiAgICAgICAgICAgIGlmICh2YWx1ZVRvU3RyaW5nKGFjdHVhbE9iaikgIT09IHZhbHVlVG9TdHJpbmcoZXhwZWN0YXRpb25PYmopKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGFjdHVhbE9iaiBpbnN0YW5jZW9mIFByb21pc2UgJiYgZXhwZWN0YXRpb25PYmogaW5zdGFuY2VvZiBQcm9taXNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYWN0dWFsT2JqID09PSBleHBlY3RhdGlvbk9iajtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhY3R1YWxPYmogaW5zdGFuY2VvZiBFcnJvciAmJiBleHBlY3RhdGlvbk9iaiBpbnN0YW5jZW9mIEVycm9yKSB7XG4gICAgICAgICAgICByZXR1cm4gYWN0dWFsT2JqID09PSBleHBlY3RhdGlvbk9iajtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBhY3R1YWxDbGFzcyA9IGdldENsYXNzKGFjdHVhbE9iaik7XG4gICAgICAgIHZhciBleHBlY3RhdGlvbkNsYXNzID0gZ2V0Q2xhc3MoZXhwZWN0YXRpb25PYmopO1xuICAgICAgICB2YXIgYWN0dWFsS2V5cyA9IGtleXMoYWN0dWFsT2JqKTtcbiAgICAgICAgdmFyIGV4cGVjdGF0aW9uS2V5cyA9IGtleXMoZXhwZWN0YXRpb25PYmopO1xuICAgICAgICB2YXIgYWN0dWFsTmFtZSA9IGNsYXNzTmFtZShhY3R1YWxPYmopO1xuICAgICAgICB2YXIgZXhwZWN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xuICAgICAgICAgICAgICAgIChhY3R1YWxOYW1lICYmXG4gICAgICAgICAgICAgICAgICAgIGV4cGVjdGF0aW9uTmFtZSAmJlxuICAgICAgICAgICAgICAgICAgICBhY3R1YWxOYW1lICE9PSBleHBlY3RhdGlvbk5hbWUpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaXNTZXQoYWN0dWFsT2JqKSB8fCBpc1NldChleHBlY3RhdGlvbk9iaikpIHtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAhaXNTZXQoYWN0dWFsT2JqKSB8fFxuICAgICAgICAgICAgICAgICFpc1NldChleHBlY3RhdGlvbk9iaikgfHxcbiAgICAgICAgICAgICAgICBhY3R1YWxPYmouc2l6ZSAhPT0gZXhwZWN0YXRpb25PYmouc2l6ZVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gaXNTdWJzZXQoYWN0dWFsT2JqLCBleHBlY3RhdGlvbk9iaiwgZGVlcEVxdWFsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpc01hcChhY3R1YWxPYmopIHx8IGlzTWFwKGV4cGVjdGF0aW9uT2JqKSkge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICFpc01hcChhY3R1YWxPYmopIHx8XG4gICAgICAgICAgICAgICAgIWlzTWFwKGV4cGVjdGF0aW9uT2JqKSB8fFxuICAgICAgICAgICAgICAgIGFjdHVhbE9iai5zaXplICE9PSBleHBlY3RhdGlvbk9iai5zaXplXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBtYXBzRGVlcGx5RXF1YWwgPSB0cnVlO1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CJmdW5jdGlvblwiXG4gICAgICAgICkge1xuICAgICAgICAgICAgcmV0dXJuIGFjdHVhbE9iai5pcyhleHBlY3RhdGlvbk9iaik7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgaXNBY3R1YWxOb25BcnJheUl0ZXJhYmxlID1cbiAgICAgICAgICAgIGlzSXRlcmFibGUoYWN0dWFsT2JqKSAmJlxuICAgICAgICAgICAgIWlzQXJyYXlUeXBlKGFjdHVhbE9iaikgJiZcbiAgICAgICAgICAgICFpc0FyZ3VtZW50cyhhY3R1YWxPYmopO1xuICAgICAgICB2YXIgaXNFeHBlY3RhdGlvbk5vbkFycmF5SXRlcmFibGUgPVxuICAgICAgICAgICAgaXNJdGVyYWJsZShleHBlY3RhdGlvbk9iaikgJiZcbiAgICAgICAgICAgICFpc0FycmF5VHlwZShleHBlY3RhdGlvbk9iaikgJiZcbiAgICAgICAgICAgICFpc0FyZ3VtZW50cyhleHBlY3RhdGlvbk9iaik7XG4gICAgICAgIGlmIChpc0FjdHVhbE5vbkFycmF5SXRlcmFibGUgfHwgaXNFeHBlY3RhdGlvbk5vbkFycmF5SXRlcmFibGUpIHtcbiAgICAgICAgICAgIHZhciBhY3R1YWxBcnJheSA9IEFycmF5LmZyb20oYWN0dWFsT2JqKTtcbiAgICAgICAgICAgIHZhciBleHBlY3RhdGlvbkFycmF5ID0gQXJyYXkuZnJvbShleHBlY3RhdGlvbk9iaik7XG4gICAgICAgICAgICBpZiAoYWN0dWFsQXJyYXkubGVuZ3RoICE9PSBleHBlY3RhdGlvbkFycmF5Lmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGFycmF5RGVlcGx5RXF1YWxzID0gdHJ1ZTtcbiAgICAgICAgICAgIGV2ZXJ5KGFjdHVhbEFycmF5LCBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgYXJyYXlEZWVwbHlFcXVhbHMgPVxuICAgICAgICAgICAgICAgICAgICBhcnJheURlZXBseUVxdWFscyAmJlxuICAgICAgICAgICAgICAgICAgICBkZWVwRXF1YWxDeWNsaWMoYWN0dWFsQXJyYXlba2V5XSwgZXhwZWN0YXRpb25BcnJheVtrZXldKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gYXJyYXlEZWVwbHlFcXVhbHM7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZXZlcnkoZXhwZWN0YXRpb25LZXlzQW5kU3ltYm9scywgZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wZXJ0eShhY3R1YWxPYmosIGtleSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBhY3R1YWxWYWx1ZSA9IGFjdHVhbE9ialtrZXldO1xuICAgICAgICAgICAgdmFyIGV4cGVjdGF0aW9uVmFsdWUgPSBleHBlY3RhdGlvbk9ialtrZXldO1xuICAgICAgICAgICAgdmFyIGFjdHVhbE9iamVjdCA9IGlzT2JqZWN0KGFjdHVhbFZhbHVlKTtcbiAgICAgICAgICAgIHZhciBleHBlY3RhdGlvbk9iamVjdCA9IGlzT2JqZWN0KGV4cGVjdGF0aW9uVmFsdWUpO1xuICAgICAgICAgICAgLy8gZGV0ZXJtaW5lcywgaWYgdGhlIG9iamVjdHMgd2VyZSBhbHJlYWR5IHZpc2l0ZWRcbiAgICAgICAgICAgIC8vIChpdCdzIGZhc3RlciB0byBjaGVjayBmb3IgaXNPYmplY3QgZmlyc3QsIHRoYW4gdG9cbiAgICAgICAgICAgIC8vIGdldCAtMSBmcm9tIGdldEluZGV4IGZvciBub24gb2JqZWN0cylcbiAgICAgICAgICAgIHZhciBhY3R1YWxJbmRleCA9IGFjdHVhbE9iamVjdFxuICAgICAgICAgICAgICAgID8gaW5kZXhPZihhY3R1YWxPYmplY3RzLCBhY3R1YWxWYWx1ZSlcbiAgICAgICAgICAgICAgICA6IC0xO1xuICAgICAgICAgICAgdmFyIGV4cGVjdGF0aW9uSW5kZXggPSBleHBlY3RhdGlvbk9iamVjdFxuICAgICAgICAgICAgICAgID8gaW5kZXhPZihleHBlY3RhdGlvbk9iamVjdHMsIGV4cGVjdGF0aW9uVmFsdWUpXG4gICAgICAgICAgICAgICAgOiAtMTtcbiAgICAgICAgICAgIC8vIGRldGVybWluZXMgdGhlIG5ldyBwYXRocyBvZiB0aGUgb2JqZWN0c1xuICAgICAgICAgICAgLy8gLSBmb3Igbm9uIGN5Y2xpYyBvYmplY3RzIHRoZSBjdXJyZW50IHBhdGggd2lsbCBiZSBleHRlbmRlZFxuICAgICAgICAgICAgLy8gICBieSBjdXJyZW50IHByb3BlcnR5IG5hbWVcbiAgICAgICAgICAgIC8vIC0gZm9yIGN5Y2xpYyBvYmplY3RzIHRoZSBzdG9yZWQgcGF0aCBpcyB0YWtlblxuICAgICAgICAgICAgdmFyIG5ld0FjdHVhbFBhdGggPVxuICAgICAgICAgICAgICAgIGFjdHVhbEluZGV4ICE9PSAtMVxuICAgICAgICAgICAgICAgICAgICA/IGFjdHVhbFBhdGhzW2FjdHVhbEluZGV4XVxuICAgICAgICAgICAgICAgICAgICA6IGAke2FjdHVhbFBhdGh9WyR7SlNPTi5zdHJpbmdpZnkoa2V5KX1dYDtcbiAgICAgICAgICAgIHZhciBuZXdFeHBlY3RhdGlvblBhdGggPVxuICAgICAgICAgICAgICAgIGV4cGVjdGF0aW9uSW5kZXggIT09IC0xXG4gICAgICAgICAgICAgICAgICAgID8gZXhwZWN0YXRpb25QYXRoc1tleHBlY3RhdGlvbkluZGV4XVxuICAgICAgICAgICAgICAgICAgICA6IGAke2V4cGVjdGF0aW9uUGF0aH1bJHtKU09OLnN0cmluZ2lmeShrZXkpfV1gO1xuICAgICAgICAgICAgdmFyIGNvbWJpbmVkUGF0aCA9IG5ld0FjdHVhbFBhdGggKyBuZXdFeH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lvblwiKSB7XG4gICAgICAgIHJldHVybiBtYXRjaGVyT3JWYWx1ZS50ZXN0KG9iamVjdCk7XG4gICAgfVxuXG4gICAgc3dpdGNoICh0eXBlKG1hdGNoZXJPclZhbHVlKSkge1xuICAgICAgICBjYXNlIFwiYmlnaW50XCI6XG4gICAgICAgIGNhc2UgXCJib29sZWFuXCI6XG4gICAgICAgIGNhc2UgXCJudW1iZXJcIjpcbiAgICAgICAgY2FzZSBcInN5bWJvbFwiOlxuICAgICAgICAgICAgcmV0dXJuIG1hdGNoZXJPclZhbHVlID09PSBvYmplY3Q7XG4gICAgICAgIGNhc2UgXCJmdW5jdGlvblwiOlxuICAgICAgICAgICAgcmV0dXJuIG1hdGNoZXJPclZhbHVlKG9iamVjdCkgPT09IHRydWU7XG4gICAgICAgIGNhc2UgXCJzdHJpbmdcIjpcbiAgICAgICAgICAgIHZhciBub3ROdWxsID0gdHlwZW9mIG9iamVjdCA9PT0gXCJzdHJpbmdcIiB8fCBCb29sZWFuKG9iamVjdCk7XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIG5vdE51bGwgJiZcbiAgICAgICAgICAgICAgICBpbmRleE9mKFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZVRvU3RyaW5nKG9iamVjdCkudG9Mb3dlckNhc2UoKSxcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hlck9yVmFsdWUudG9Mb3dlckNhc2UoKSxcbiAgICAgICAgICAgICAgICApID49IDBcbiAgICAgICAgICAgICk7XG4gICAgICAgIGNhc2UgXCJudWxsXCI6XG4gICAgICAgICAgICByZXR1cm4gb2JqZWN0ID09PSBudWxsO1xuICAgICAgICBjYXNlIFwidW5kZWZpbmVkXCI6XG4gICAgICAgICAgICByZXR1cm4gdHlwZW9mIG9iamVjdCA9PT0gXCJ1bmRlZmluZWRcIjtcbiAgICAgICAgY2FzZSBcIkRhdGVcIjpcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBl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bGxlY3QgY292ZXJhZ2UgaW5mb3JtYXRpb24gaW4gbm9kZSovXG4gICAgICAgICAgICBpZiAoIWVuZ2luZUNhbkNvbXBhcmVNYXBzKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICBcIlRoZSBKYXZhU2NyaXB0IGVuZ2luZSBkb2VzIG5vdCBzdXBwb3J0IEFycmF5LmZyb20gYW5kIGNhbm5vdCByZWxpYWJseSBkbyB2YWx1ZSBjb21wYXJpc29uIG9mIE1hcCBpbnN0YW5jZXNcIixcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIHR5cGUob2JqZWN0KSA9PT0gXCJNYXBcIiAmJlxuICAgICAgICAgICAgICAgIGFycmF5Q29udGFpbnMoXG4gICAgICAgICAgICAgICAgICAgIEFycmF5LmZyb20ob2JqZWN0KSxcbiAgICAgICAgICAgICAgICAgICAgQXJyYXkuZnJvbShtYXRjaGVyT3JWYWx1ZSksXG4gICAgICAgICAgICAgICAgICAgIG1hdGNoLFxuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICk7XG4gICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBzd2l0Y2ggKHR5cGUob2JqZWN0KSkge1xuICAgICAgICBjYXNlIFwibnVsbFwiOlxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICBjYXNlIFwiU2V0XCI6XG4gICAgICAgICAgICByZXR1cm4gaXNTdWJzZXQobWF0Y2hlck9yVmFsdWUsIG9iamVjdCwgbWF0Y2gpO1xuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICBpZiAobWF0Y2hlck9yVmFsdWUgJiYgdHlwZW9mIG1hdGNoZXJPclZhbHVlID09PSBcIm9iamVjdFwiKSB7XG4gICAgICAgIGlmIChtYXRjaGVyT3JWYWx1ZSA9PT0gb2JqZWN0KSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIG9iamVjdCAhPT0gXCJvYmplY3RcIikge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHZhciBwcm9wO1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgZ3VhcmQtZm9yLWluXG4gICAgICAgIGZvciAocHJvcCBpbiBtYXRjaGVyT3JWYWx1ZSkge1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gb2JqZWN0W3Byb3BdO1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIHR5cGVvZiB2YWx1ZSA9PT0gXCJ1bmRlZmluZWRcIiAmJlxuICAgICAgICAgICAgICAgIHR5cGVvZiBvYmplY3QuZ2V0QXR0cmlidXRlID09PSBcImZ1bmN0aW9uXCJcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gb2JqZWN0LmdldEF0dHJpYnV0ZShwcm9wKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICBtYXRjaGVyT3JWYWx1ZVtwcm9wXSA9PT0gbnVsbCB8fFxuICAgICAgICAgICAgICAgIHR5cGVvZiBtYXRjaGVyT3JWYWx1ZVtwcm9wXSA9PT0gXCJ1bmRlZmluZWRcIlxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlICE9PSBtYXRjaGVyT3JWYWx1ZVtwcm9wXSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgICAgICB0eX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AgICAgICAgIGlmICh0eXBlb2Ygd2luZG93LmRvY3VtZW50ID09PSAnb2JqZWN0JyAmJiBvYmogPT09IHdpbmRvdy5kb2N1bWVudCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnRG9jdW1lbnQnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiB3aW5kb3cubmF2aWdhdG9yID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygd2luZG93Lm5hdmlnYXRvci5taW1lVHlwZXMgPT09ICdvYmplY3QnICYmXG4gICAgICAgICAgICAgICAgICAgIG9iaiA9PT0gd2luZG93Lm5hdmlnYXRvci5taW1lVHlwZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdNaW1lVHlwZUFycmF5JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB3aW5kb3cubmF2aWdhdG9yLnBsdWdpbnMgPT09ICdvYmplY3QnICYmXG4gICAgICAgICAgICAgICAgICAgIG9iaiA9PT0gd2luZG93Lm5hdmlnYXRvci5wbHVnaW5zKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnUGx1Z2luQXJyYXknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgodHlwZW9mIHdpbmRvdy5IVE1MRWxlbWVudCA9PT0gJ2Z1bmN0aW9uJyB8fFxuICAgICAgICAgICAgICAgIHR5cGVvZiB3aW5kb3cuSFRNTEVsZW1lbnQgPT09ICdvYmplY3QnKSAmJlxuICAgICAgICAgICAgICAgIG9iaiBpbnN0YW5jZW9mIHdpbmRvdy5IVE1MRWxlbWVudCkge1xuICAgICAgICAgICAgICAgIGlmIChvYmoudGFnTmFtZSA9PT0gJ0JMT0NLUVVPVEUnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnSFRNTFF1b3RlRWxlbWVudCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvYmoudGFnTmFtZSA9PT0gJ1REJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ0hUTUxUYWJsZURhdGFDZWxsRWxlbWVudCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChvYmoudGFnTmFtZSA9PT0gJ1RIJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ0hUTUxUYWJsZUhlYWRlckNlbGxFbGVtZW50JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHN0cmluZ1RhZyA9IChzeW1ib2xUb1N0cmluZ1RhZ0V4aXN0cyAmJiBvYmpbU3ltYm9sLnRvU3RyaW5nVGFnXSk7XG4gICAgICAgIGlmICh0eXBlb2Ygc3RyaW5nVGFnID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1RhZztcbiAgICAgICAgfVxuICAgICAgICB2YXIgb2JqUHJvdG90eXBlID0gT2JqZWN0LmdldFByb3RvdHlwZU9mKG9iaik7XG4gICAgICAgIGlmIChvYmpQcm90b3R5cGUgPT09IFJlZ0V4cC5wcm90b3R5cGUpIHtcbiAgICAgICAgICAgIHJldHVybiAnUmVnRXhwJztcbiAgICAgICAgfVxuICAgICAgICBpZiAob2JqUHJvdG90eXBlID09PSBEYXRlLnByb3RvdHlwZSkge1xuICAgICAgICAgICAgcmV0dXJuICdEYXRlJztcbiAgICAgICAgfVxuICAgICAgICBpZiAocHJvbWlzZUV4aXN0cyAmJiBvYmpQcm90b3R5cGUgPT09IFByb21pc2UucHJvdG90eXBlKSB7XG4gICAgICAgICAgICByZXR1cm4gJ1Byb21pc2UnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzZXRFeGlzdHMgJiYgb2JqUHJvdG90eXBlID09PSBTZXQucHJvdG90eXBlKSB7XG4gICAgICAgICAgICByZXR1cm4gJ1NldCc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcEV4aXN0cyAmJiBvYmpQcm90b3R5cGUgPT09IE1hcC5wcm90b3R5cGUpIHtcbiAgICAgICAgICAgIHJldHVybiAnTWFwJztcbiAgICAgICAgfVxuICAgICAgICBpZiAod2Vha1NldEV4aXN0cyAmJiBvYmpQcm90b3R5cGUgPT09IFdlYWtTZXQucHJvdG90eXBlKSB7XG4gICAgICAgICAgICByZXR1cm4gJ1dlYWtTZXQnO1xuICAgICAgICB9XG4gICAgICAgIGlmICh3ZWFrTWFwRXhpc3RzICYmIG9ialByb3RvdHlwZSA9PT0gV2Vha01hcC5wcm90b3R5cGUpIHtcbiAgICAgICAgICAgIHJldHVybiAnV2Vha01hcCc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRhdGFWaWV3RXhpc3RzICYmIG9ialByb3RvdHlwZSA9PT0gRGF0YVZpZXcucHJvdG90eXBlKSB7XG4gICAgICAgICAgICByZXR1cm4gJ0RhdGFWaWV3JztcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFwRXhpc3RzICYmIG9ialByb3RvdHlwZSA9PT0gbWFwSXRlcmF0b3JQcm90b3R5cGUpIHtcbiAgICAgICAgICAgIHJldHVybiAnTWFwIEl0ZXJhdG9yJztcbiAgICAgICAgfVxuICAgICAgICBpZiAoc2V0RXhpc3RzICYmIG9ialByb3RvdHlwZSA9PT0gc2V0SXRlcmF0b3JQcm90b3R5cGUpIHtcbiAgICAgICAgICAgIHJldHVybiAnU2V0IEl0ZXJhdG9yJztcbiAgICAgICAgfVxuICAgICAgICBpZiAoYXJyYXlJdGVyYXRvckV4aXN0cyAmJiBvYmpQcm90b3R5cGUgPT09IGFycmF5SXRlcmF0b3JQcm90b3R5cGUpIHtcbiAgICAgICAgICAgIHJldHVybiAnQXJyYXkgSXRlcmF0b3InO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdHJpbmdJdGVyYXRvckV4aXN0cyAmJiBvYmpQcm90b3R5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SBlbHNlIHtcbiAgICAgIG5hbWUgPSBuYW1lLnJlcGxhY2UoLycvZywgXCJcXFxcJ1wiKVxuICAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxcXFwiL2csICdcIicpXG4gICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oXlwifFwiJCkvZywgXCInXCIpO1xuICAgICAgbmFtZSA9IGN0eC5zdHlsaXplKG5hbWUsICdzdHJpbmcnKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gbmFtZSArICc6ICcgKyBzdHI7XG59XG5cblxuZnVuY3Rpb24gcmVkdWNlVG9TaW5nbGVTdHJpbmcob3V0cHV0LCBiYXNlLCBicmFjZXMpIHtcbiAgdmFyIG51bUxpbmVzRXN0ID0gMDtcbiAgdmFyIGxlbmd0aCA9IG91dHB1dC5yZWR1Y2UoZnVuY3Rpb24ocHJldiwgY3VyKSB7XG4gICAgbnVtTGluZXNFc3QrKztcbiAgICBpZiAoY3VyLmluZGV4T2YoJ1xcbicpID49IDApIG51bUxpbmVzRXN0Kys7XG4gICAgcmV0dXJuIHByZXYgKyBjdXIucmVwbGFjZSgvXFx1MDAxYlxcW1xcZFxcZD9tL2csICcnKS5sZW5ndGggKyAxO1xuICB9LCAwKTtcblxuICBpZiAobGVuZ3RoID4gNjApIHtcbiAgICByZXR1cm4gYnJhY2VzWzBdICtcbiAgICAgICAgICAgKGJhc2UgPT09ICcnID8gJycgOiBiYXNlICsgJ1xcbiAnKSArXG4gICAgICAgICAgICcgJyArXG4gICAgICAgICAgIG91dHB1dC5qb2luKCcsXFxuICAnKSArXG4gICAgICAgICAgICcgJyArXG4gICAgICAgICAgIGJyYWNlc1sxXTtcbiAgfVxuXG4gIHJldHVybiBicmFjZXNbMF0gKyBiYXNlICsgJyAnICsgb3V0cHV0LmpvaW4oJywgJykgKyAnICcgKyBicmFjZXNbMV07XG59XG5cblxuLy8gTk9URTogVGhlc2UgdHlwZSBjaGVja2luZyBmdW5jdGlvbnMgaW50ZW50aW9u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MpIHtcbiAgICAgIHZhciBsYXN0ID0gcGF0aC5sYXN0Q29tcG9uZW50O1xuICAgICAgaWYgKGxhc3QgJiYgIW9wdGlvbnMub25lQ2hhbmdlUGVyVG9rZW4gJiYgbGFzdC5hZGRlZCA9PT0gYWRkZWQgJiYgbGFzdC5yZW1vdmVkID09PSByZW1vdmVkKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgb2xkUG9zOiBwYXRoLm9sZFBvcyArIG9sZFBvc0luYyxcbiAgICAgICAgICBsYXN0Q29tcG9uZW50OiB7XG4gICAgICAgICAgICBjb3VudDogbGFzdC5jb3VudCArIDEsXG4gICAgICAgICAgICBhZGRlZDogYWRkZWQsXG4gICAgICAgICAgICByZW1vdmVkOiByZW1vdmVkLFxuICAgICAgICAgICAgcHJldmlvdXNDb21wb25lbnQ6IGxhc3QucHJldmlvdXNDb21wb25lbnRcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIG9sZFBvczogcGF0aC5vbGRQb3MgKyBvbGRQb3NJbmMsXG4gICAgICAgICAgbGFzdENvbXBvbmVudDoge1xuICAgICAgICAgICAgY291bnQ6IDEsXG4gICAgICAgICAgICBhZGRlZDogYWRkZWQsXG4gICAgICAgICAgICByZW1vdmVkOiByZW1vdmVkLFxuICAgICAgICAgICAgcHJldmlvdXNDb21wb25lbnQ6IGxhc3RcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfSxcbiAgICBleHRyYWN0Q29tbW9uOiBmdW5jdGlvbiBleHRyYWN0Q29tbW9uKGJhc2VQYXRoLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgZGlhZ29uYWxQYXRoLCBvcHRpb25zKSB7XG4gICAgICB2YXIgbmV3TGVuID0gbmV3U3RyaW5nLmxlbmd0aCxcbiAgICAgICAgb2xkTGVuID0gb2xkU3RyaW5nLmxlbmd0aCxcbiAgICAgICAgb2xkUG9zID0gYmFzZVBhdGgub2xkUG9zLFxuICAgICAgICBuZXdQb3MgPSBvbGRQb3MgLSBkaWFnb25hbFBhdGgsXG4gICAgICAgIGNvbW1vbkNvdW50ID0gMDtcbiAgICAgIHdoaWxlIChuZXdQb3MgKyAxIDwgbmV3TGVuICYmIG9sZFBvcyArIDEgPCBvbGRMZW4gJiYgdGhpcy5lcXVhbHMob2xkU3RyaW5nW29sZFBvcyArIDFdLCBuZXdTdHJpbmdbbmV3UG9zICsgMV0sIG9wdGlvbnMpKSB7XG4gICAgICAgIG5ld1BvcysrO1xuICAgICAgICBvbGRQb3MrKztcbiAgICAgICAgY29tbW9uQ291bnQrKztcbiAgICAgICAgaWYgKG9wdGlvbnMub25lQ2hhbmdlUGVyVG9rZW4pIHtcbiAgICAgICAgICBiYXNlUGF0aC5sYXN0Q29tcG9uZW50ID0ge1xuICAgICAgICAgICAgY291bnQ6IDEsXG4gICAgICAgICAgICBwcmV2aW91c0NvbXBvbmVudDogYmFzZVBhdGgubGFzdENvbXBvbmVudCxcbiAgICAgICAgICAgIGFkZGVkOiBmYWxzZSxcbiAgICAgICAgICAgIHJlbW92ZWQ6IGZhbHNlXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGNvbW1vbkNvdW50ICYmICFvcHRpb25zLm9uZUNoYW5nZVBlclRva2VuKSB7XG4gICAgICAgIGJhc2VQYXRoLmxhc3RDb21wb25lbnQgPSB7XG4gICAgICAgICAgY291bnQ6IGNvbW1vbkNvdW50LFxuICAgICAgICAgIHByZXZpb3VzQ29tcG9uZW50OiBiYXNlUGF0aC5sYXN0Q29tcG9uZW50LFxuICAgICAgICAgIGFkZGVkOiBmYWxzZSxcbiAgICAgICAgICByZW1vdmVkOiBmYWxzZVxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgYmFzZVBhdGgub2xkUG9zID0gb2xkUG9zO1xuICAgICAgcmV0dXJuIG5ld1BvcztcbiAgICB9LFxuICA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QEApXFxzLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBEaWZmIGluZGV4XG4gICAgICAgIHZhciBoZWFkZXIgPSAvXig/OkluZGV4OnxkaWZmKD86IC1yIFxcdyspKylcXHMrKC4rPylcXHMqJC8uZXhlYyhsaW5lKTtcbiAgICAgICAgaWYgKGhlYWRlcikge1xuICAgICAgICAgIGluZGV4LmluZGV4ID0gaGVhZGVyWzFdO1xuICAgICAgICB9XG4gICAgICAgIGkrKztcbiAgICAgIH1cblxuICAgICAgLy8gUGFyc2UgZmlsZSBoZWFkZXJzIGlmIHRoZXkgYXJlIGRlZmluZWQuIFVuaWZpZWQgZGlmZiByZXF1aXJlcyB0aGVtLCBidXRcbiAgICAgIC8vIHRoZXJlJ3Mgbm8gdGVjaG5pY2FsIGlzc3VlcyB0byBoYXZlIGFuIGlzb2xhdGVkIGh1bmsgd2l0aG91dCBmaWxlIGhlYWRlclxuICAgICAgcGFyc2VGaWxlSGVhZGVyKGluZGV4KTtcbiAgICAgIHBhcnNlRmlsZUhlYWRlcihpbmRleCk7XG5cbiAgICAgIC8vIFBhcnNlIGh1bmtzXG4gICAgICBpbmRleC5odW5rcyA9IFtdO1xuICAgICAgd2hpbGUgKGkgPCBkaWZmc3RyLmxlbmd0aCkge1xuICAgICAgICB2YXIgX2xpbmUgPSBkaWZmc3RyW2ldO1xuICAgICAgICBpZiAoL14oSW5kZXg6XFxzfGRpZmZcXHN8XFwtXFwtXFwtXFxzfFxcK1xcK1xcK1xcc3w9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09KS8udGVzdChfbGluZSkpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfSBlbHNlIGlmICgvXkBALy50ZXN0KF9saW5lKSkge1xuICAgICAgICAgIGluZGV4Lmh1bmtzLnB1c2gocGFyc2VIdW5rKCkpO1xuICAgICA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ICAgICAgaWYgKGh1bmsubmV3TGluZXMgPT09IDApIHtcbiAgICAgICAgaHVuay5uZXdTdGFydCArPSAxO1xuICAgICAgfVxuICAgICAgdmFyIGFkZENvdW50ID0gMCxcbiAgICAgICAgcmVtb3ZlQ291bnQgPSAwO1xuICAgICAgZm9yICg7IGkgPCBkaWZmc3RyLmxlbmd0aCAmJiAocmVtb3ZlQ291bnQgPCBodW5rLm9sZExpbmVzIHx8IGFkZENvdW50IDwgaHVuay5uZXdMaW5lcyB8fCAoX2RpZmZzdHIkaSA9IGRpZmZzdHJbaV0pICE9PSBudWxsICYmIF9kaWZmc3RyJGkgIT09IHZvaWQgMCAmJiBfZGlmZnN0ciRpLnN0YXJ0c1dpdGgoJ1xcXFwnKSk7IGkrKykge1xuICAgICAgICB2YXIgX2RpZmZzdHIkaTtcbiAgICAgICAgdmFyIG9wZXJhdGlvbiA9IGRpZmZzdHJbaV0ubGVuZ3RoID09IDAgJiYgaSAhPSBkaWZmc3RyLmxlbmd0aCAtIDEgPyAnICcgOiBkaWZmc3RyW2ldWzBdO1xuICAgICAgICBpZiAob3BlcmF0aW9uID09PSAnKycgfHwgb3BlcmF0aW9uID09PSAnLScgfHwgb3BlcmF0aW9uID09PSAnICcgfHwgb3BlcmF0aW9uID09PSAnXFxcXCcpIHtcbiAgICAgICAgICBodW5rLmxpbmVzLnB1c2goZGlmZnN0cltpXSk7XG4gICAgICAgICAgaWYgKG9wZXJhdGlvbiA9PT0gJysnKSB7XG4gICAgICAgICAgICBhZGRDb3VudCsrO1xuICAgICAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgICAgIHJlbW92ZUNvdW50Kys7XG4gICAgICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICcgJykge1xuICAgICAgICAgICAgYWRkQ291bnQrKztcbiAgICAgICAgICAgIHJlbW92ZUNvdW50Kys7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgIC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Z3RoID4gMCA/IGh1bmtMaW5lLnN1YnN0cigxKSA6IGh1bmtMaW5lO1xuICAgICAgICBpZiAob3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgICBpZiAoY29tcGFyZUxpbmUodG9Qb3MgKyAxLCBsaW5lc1t0b1Bvc10sIG9wZXJhdGlvbiwgY29udGVudCkpIHtcbiAgICAgICAgICAgIHRvUG9zKys7XG4gICAgICAgICAgICBuQ29uc2VjdXRpdmVPbGRDb250ZXh0TGluZXMgPSAwO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoIW1heEVycm9ycyB8fCBsaW5lc1t0b1Bvc10gPT0gbnVsbCkge1xuICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhdGNoZWRMaW5lc1twYXRjaGVkTGluZXNMZW5ndGhdID0gbGluZXNbdG9Qb3NdO1xuICAgICAgICAgICAgcmV0dXJuIGFwcGx5SHVuayhodW5rTGluZXMsIHRvUG9zICsgMSwgbWF4RXJyb3JzIC0gMSwgaHVua0xpbmVzSSwgZmFsc2UsIHBhdGNoZWRMaW5lcywgcGF0Y2hlZExpbmVzTGVuZ3RoICsgMSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChvcGVyYXRpb24gPT09ICcrJykge1xuICAgICAgICAgIGlmICghbGFzdENvbnRleHRMaW5lTWF0Y2hlZCkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBhdGNoZWRMaW5lc1twYXRjaGVkTGluZXNMZW5ndGhdID0gY29udGVudDtcbiAgICAgICAgICBwYXRjaGVkTGluZXNMZW5ndGgrKztcbiAgICAgICAgICBuQ29uc2VjdXRpdmVPbGRDb250ZXh0TGluZXMgPSAwO1xuICAgICAgICAgIG5leHRDb250ZXh0TGluZU11c3RNYXRjaCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICA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0xpbmU7XG4gICAgICAgICAgICBpZiAocHJldikge1xuICAgICAgICAgICAgICBjdXJSYW5nZSA9IG9wdGlvbnMuY29udGV4dCA+IDAgPyBjb250ZXh0TGluZXMocHJldi5saW5lcy5zbGljZSgtb3B0aW9ucy5jb250ZXh0KSkgOiBbXTtcbiAgICAgICAgICAgICAgb2xkUmFuZ2VTdGFydCAtPSBjdXJSYW5nZS5sZW5ndGg7XG4gICAgICAgICAgICAgIG5ld1JhbmdlU3RhcnQgLT0gY3VyUmFuZ2UubGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIE91dHB1dCBvdXIgY2hhbmdlc1xuICAgICAgICAgIChfY3VyUmFuZ2UgPSBjdXJSYW5nZSkucHVzaC5hcHBseShfY3VyUmFuZ2UsIF90b0NvbnN1bWFibGVBcnJheShsaW5lcy5tYXAoZnVuY3Rpb24gKGVudHJ5KSB7XG4gICAgICAgICAgICByZXR1cm4gKGN1cnJlbnQuYWRkZWQgPyAnKycgOiAnLScpICsgZW50cnk7XG4gICAgICAgICAgfSkpKTtcblxuICAgICAgICAgIC8vIFRyYWNrIHRoZSB1cGRhdGVkIGZpbGUgcG9zaXRpb25cbiAgICAgICAgICBpZiAoY3VycmVudC5hZGRlZCkge1xuICAgICAgICAgICAgbmV3TGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9sZExpbmUgKz0gbGluZXMubGVuZ3RoO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBJZGVudGljYWwgY29udGV4dCBsaW5lcy4gVHJhY2sgbGluZSBjaGFuZ2VzXG4gICAgICAgICAgaWYgKG9sZFJhbmdlU3RhcnQpIHtcbiAgICAgICAgICAgIC8vIENsb3NlIG91dCBhbnkgY2hhbmdlcyB0aGF0IGhhdmUgYmVlbiBvdXRwdXQgKG9yIGpvaW4gb3ZlcmxhcHBpbmcpXG4gICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoIDw9IG9wdGlvbnMuY29udGV4dCAqIDIgJiYgaSA8IGRpZmYubGVuZ3RoIC0gMikge1xuICAgICAgICAgICAgICB2YXIgX2N1clJhbmdlMjtcbiAgICAgICAgICAgICAgLy8gT3ZlcmxhcHBpbmdcbiAgICAgICAgICAgICAgKF9jdXJSYW5nZTIgPSBjdXJSYW5nZSkucHVzaC5hcHBseShfY3VyUmFuZ2UyLCBfdG9Db25zdW1hYmxlQXJyYXkoY29udGV4dExpbmVzKGxpbmVzKSkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdmFyIF9jdXJSYW5nZTM7XG4gICAgICAgICAgICAgIC8vIGVuZCB0aGUgcmFuZ2UgYW5kIG91dHB1dFxuICAgICAgICAgICAgICB2YXIgY29udGV4dFNpemUgPSBNYXRoLm1pbihsaW5lcy5sZW5ndGgsIG9wdGlvbnMuY29udGV4dCk7XG4gICAgICAgICAgICAgIChfY3VyUmFuZ2UzID0gY3VyUmFuZ2UpLnB1c2guYXBwbHkoX2N1clJhbmdlMywgX3RvQ29uc3VtYWJsZUFycmF5KGNvbnRleHRMaW5lcyhsaW5lcy5zbGljZSgwLCBjb250ZXh0U2l6ZSkpKSk7XG4gICAgICAgICAgICAgIHZhciBfaHVuayA9IHtcbiAgICAgICAgICAgICAgICBvbGRTdGFydDogb2xkUmFuZ2VTdGFydCxcbiAgICAgICAgICAgICAgICBvbGRMaW5lczogb2xkTGluZSAtIG9sZFJhbmdlU3RhcnQgKyBjb250ZXh0U2l6ZSxcbiAgICAgICAgICAgICAgICBuZXdTdGFydDogbmV3UmFuZ2VTdGFydCxcbiAgICAgICAgICAgICAgICBuZXdMaW5lczogbmV3TGluZSAtIG5ld1JhbmdlU3RhcnQgKyBjb250ZXh0U2l6ZSxcbiAgICAgICAgICAgICAgICBsaW5lczogY3VyUmFuZ2VcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgaHVua3MucHVzaChfaHVuayk7XG4gICAgICAgICAgICAgIG9sZFJhbmdlU3RhcnQgPSAwO1xuICAgICAgICAgICAgICBuZXdSYW5nZVN0YXJ0ID0gMDtcbiAgICAgICAgICAgICAgY3VyUmFuZ2UgPSBbXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgb2xkTGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICAgICAgbmV3TGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRpZmYubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgX2xvb3AoKTtcbiAgICAgIH1cblxuICAgICAgLy8gU3RlcCAyOiBlbGltaW5hdGUgdGhlIHRyYWlsaW5nIGBcXG5gIGZyb20gZWFjaCBsaW5lIG9mIGVhY2ggaHVuaywgYW5kLCB3aGVyZSBuZWVkZWQsIGFkZFxuICAgICAgLy8gICAgICAgICBcIlxcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGVcIi5cbiAgICAgIGZvciAodmFyIF9pID0gMCwgX2h1bmtzID0gaHVua3M7IF9pIDwgX2h1bmtzLmxlbmd0aDsgX2krKykge1xuICAgICAgICB2YXIgaHVuayA9IF9odW5rc1tfaV07XG4gICAgICAgIGZvciAodmFyIF9pMiA9IDA7IF9pMiA8IGh1bmsubGluZXMubGVuZ3RoOyBfaTIrKykge1xuICAgICAgICAgIGlmIChodW5rLmxpbmVzW19pMl0uZW5kc1dpdGgoJ1xcbicpKSB7XG4gICAgICAgICAgICBodW5rLmxpbmVzW19pMl0gPSBodW5rLmxpbmVzW19pMl0uc2xpY2UoMCwgLTEpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBodW5rLmxpbmVzLnNwbGljZShfaTIgKyAxLCAwLCAnXFxcXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlJyk7XG4gICAgICA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ZXMzO1xuICAgICAgICAoX2h1bmskbGluZXMzID0gaHVuay5saW5lcykucHVzaC5hcHBseShfaHVuayRsaW5lczMsIF90b0NvbnN1bWFibGVBcnJheShteUNoYW5nZXMpKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfSBlbHNlIGlmIChhcnJheVN0YXJ0c1dpdGgodGhlaXJDaGFuZ2VzLCBteUNoYW5nZXMpICYmIHNraXBSZW1vdmVTdXBlcnNldChtaW5lLCB0aGVpckNoYW5nZXMsIHRoZWlyQ2hhbmdlcy5sZW5ndGggLSBteUNoYW5nZXMubGVuZ3RoKSkge1xuICAgICAgICB2YXIgX2h1bmskbGluZXM0O1xuICAgICAgICAoX2h1bmskbGluZXM0ID0gaHVuay5saW5lcykucHVzaC5hcHBseShfaHVuayRsaW5lczQsIF90b0NvbnN1bWFibGVBcnJheSh0aGVpckNoYW5nZXMpKTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAoYXJyYXlFcXVhbChteUNoYW5nZXMsIHRoZWlyQ2hhbmdlcykpIHtcbiAgICAgIHZhciBfaHVuayRsaW5lczU7XG4gICAgICAoX2h1bmskbGluZXM1ID0gaHVuay5saW5lcykucHVzaC5hcHBseShfaHVuayRsaW5lczUsIF90b0NvbnN1bWFibGVBcnJheShteUNoYW5nZXMpKTtcbiAgICAgIHJldHVybjtcbiAgICB9XG4gICAgY29uZmxpY3QoaHVuaywgbXlDaGFuZ2VzLCB0aGVpckNoYW5nZXMpO1xuICB9XG4gIGZ1bmN0aW9uIHJlbW92YWwoaHVuaywgbWluZSwgdGhlaXIsIHN3YXApIHtcbiAgICB2YXIgbXlDaGFuZ2VzID0gY29sbGVjdENoYW5nZShtaW5lKSxcbiAgICAgIHRoZWlyQ2hhbmdlcyA9IGNvbGxlY3RDb250ZXh0KHRoZWlyLCBteUNoYW5nZXMpO1xuICAgIGlmICh0aGVpckNoYW5nZXMubWVyZ2VkKSB7XG4gICAgICB2YXIgX2h1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dMaW5lQ291bnQobGluZXMpIHtcbiAgICB2YXIgb2xkTGluZXMgPSAwO1xuICAgIHZhciBuZXdMaW5lcyA9IDA7XG4gICAgbGluZXMuZm9yRWFjaChmdW5jdGlvbiAobGluZSkge1xuICAgICAgaWYgKHR5cGVvZiBsaW5lICE9PSAnc3RyaW5nJykge1xuICAgICAgICB2YXIgbXlDb3VudCA9IGNhbGNPbGROZXdMaW5lQ291bnQobGluZS5taW5lKTtcbiAgICAgICAgdmFyIHRoZWlyQ291bnQgPSBjYWxjT2xkTmV3TGluZUNvdW50KGxpbmUudGhlaXJzKTtcbiAgICAgICAgaWYgKG9sZExpbmVzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBpZiAobXlDb3VudC5vbGRMaW5lcyA9PT0gdGhlaXJDb3VudC5vbGRMaW5lcykge1xuICAgICAgICAgICAgb2xkTGluZXMgKz0gbXlDb3VudC5vbGRMaW5lcztcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb2xkTGluZXMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChuZXdMaW5lcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgaWYgKG15Q291bnQubmV3TGluZXMgPT09IHRoZWlyQ291bnQubmV3TGluZXMpIHtcbiAgICAgICAgICAgIG5ld0xpbmVzICs9IG15Q291bnQubmV3TGluZXM7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG5ld0xpbmVzID0gdW5kZWZpbmVkO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKG5ld0xpbmVzICE9PSB1bmRlZmluZWQgJiYgKGxpbmVbMF0gPT09ICcrJyB8fCBsaW5lWzBdID09PSAnICcpKSB7XG4gICAgICAgICAgbmV3TGluZXMrKztcbiAgICAgICAgfVxuICAgICAgICBpZiAob2xkTGluZXMgIT09IHVuZGVmaW5lZC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AqL1xuICBpZiAoc3RyaW5nSXRlcmF0b3JFeGlzdHMgJiYgb2JqUHJvdG90eXBlID09PSBzdHJpbmdJdGVyYXRvclByb3RvdHlwZSkge1xuICAgIHJldHVybiAnU3RyaW5nIEl0ZXJhdG9yJztcbiAgfVxuXG4gIC8qICEgU3BlZWQgb3B0aW1pc2F0aW9uXG4gICogUHJlOlxuICAqICAgb2JqZWN0IGZyb20gbnVsbCAgIHggMiw0MjQsMzIwIG9wcy9zZWMgwrExLjY3JSAoNzYgcnVucyBzYW1wbGVkKVxuICAqIFBvc3Q6XG4gICogICBvYmplY3QgZnJvbSBudWxsICAgeCA1LDgzOCwwMDAgb3BzL3NlYyDCsTAuOTklICg4NCBydW5zIHNhbXBsZWQpXG4gICovXG4gIGlmIChvYmpQcm90b3R5cGUgPT09IG51bGwpIHtcbiAgICByZXR1cm4gJ09iamVjdCc7XG4gIH1cblxuICByZXR1cm4gT2JqZWN0XG4gICAgLnByb3RvdHlwZVxuICAgIC50b1N0cmluZ1xuICAgIC5jYWxsKG9iailcbiAgICAuc2xpY2UodG9TdHJpbmdMZWZ0U2xpY2VMZW5ndGgsIHRvU3RyaW5nUmlnaHRTbGljZUxlbmd0aCk7XG59XG5cbnJldHVybiB0eXBlRGV0ZWN0O1xuXG59KSkpO1xuIl19 diff --git a/node_modules/source-map/CHANGELOG.md b/node_modules/source-map/CHANGELOG.md new file mode 100644 index 0000000..3a8c066 --- /dev/null +++ b/node_modules/source-map/CHANGELOG.md @@ -0,0 +1,301 @@ +# Change Log + +## 0.5.6 + +* Fix for regression when people were using numbers as names in source maps. See + #236. + +## 0.5.5 + +* Fix "regression" of unsupported, implementation behavior that half the world + happens to have come to depend on. See #235. + +* Fix regression involving function hoisting in SpiderMonkey. See #233. + +## 0.5.4 + +* Large performance improvements to source-map serialization. See #228 and #229. + +## 0.5.3 + +* Do not include unnecessary distribution files. See + commit ef7006f8d1647e0a83fdc60f04f5a7ca54886f86. + +## 0.5.2 + +* Include browser distributions of the library in package.json's `files`. See + issue #212. + +## 0.5.1 + +* Fix latent bugs in IndexedSourceMapConsumer.prototype._parseMappings. See + ff05274becc9e6e1295ed60f3ea090d31d843379. + +## 0.5.0 + +* Node 0.8 is no longer supported. + +* Use webpack instead of dryice for bundling. + +* Big speedups serializing source maps. See pull request #203. + +* Fix a bug with `SourceMapConsumer.prototype.sourceContentFor` and sources that + explicitly start with the source root. See issue #199. + +## 0.4.4 + +* Fix an issue where using a `SourceMapGenerator` after having created a + `SourceMapConsumer` from it via `SourceMapConsumer.fromSourceMap` failed. See + issue #191. + +* Fix an issue with where `SourceMapGenerator` would mistakenly consider + different mappings as duplicates of each other and avoid generating them. See + issue #192. + +## 0.4.3 + +* A very large number of performance improvements, particularly when parsing + source maps. Collectively about 75% of time shaved off of the source map + parsing benchmark! + +* Fix a bug in `SourceMapConsumer.prototype.allGeneratedPositionsFor` and fuzzy + searching in the presence of a column option. See issue #177. + +* Fix a bug with joining a source and its source root when the source is above + the root. See issue #182. + +* Add the `SourceMapConsumer.prototype.hasContentsOfAllSources` method to + determine when all sources' contents are inlined into the source map. See + issue #190. + +## 0.4.2 + +* Add an `.npmignore` file so that the benchmarks aren't pulled down by + dependent projects. Issue #169. + +* Add an optional `column` argument to + `SourceMapConsumer.prototype.allGeneratedPositionsFor` and better handle lines + with no mappings. Issues #172 and #173. + +## 0.4.1 + +* Fix accidentally defining a global variable. #170. + +## 0.4.0 + +* The default direction for fuzzy searching was changed back to its original + direction. See #164. + +* There is now a `bias` option you can supply to `SourceMapConsumer` to control + the fuzzy searching direction. See #167. + +* About an 8% speed up in parsing source maps. See #159. + +* Added a benchmark for parsing and generating source maps. + +## 0.3.0 + +* Change the default direction that searching for positions fuzzes when there is + not an exact match. See #154. + +* Support for environments using json2.js for JSON serialization. See #156. + +## 0.2.0 + +* Support for consuming "indexed" source maps which do not have any remote + sections. See pull request #127. This introduces a minor backwards + incompatibility if you are monkey patching `SourceMapConsumer.prototype` + methods. + +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + +## 0.1.40 + +* Performance improvements for parsing source maps in SourceMapConsumer. + +## 0.1.39 + +* Fix a bug where setting a source's contents to null before any source content + had been set before threw a TypeError. See issue #131. + +## 0.1.38 + +* Fix a bug where finding relative paths from an empty path were creating + absolute paths. See issue #129. + +## 0.1.37 + +* Fix a bug where if the source root was an empty string, relative source paths + would turn into absolute source paths. Issue #124. + +## 0.1.36 + +* Allow the `names` mapping property to be an empty string. Issue #121. + +## 0.1.35 + +* A third optional parameter was added to `SourceNode.fromStringWithSourceMap` + to specify a path that relative sources in the second parameter should be + relative to. Issue #105. + +* If no file property is given to a `SourceMapGenerator`, then the resulting + source map will no longer have a `null` file property. The property will + simply not exist. Issue #104. + +* Fixed a bug where consecutive newlines were ignored in `SourceNode`s. + Issue #116. + +## 0.1.34 + +* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103. + +* Fix bug involving source contents and the + `SourceMapGenerator.prototype.applySourceMap`. Issue #100. + +## 0.1.33 + +* Fix some edge cases surrounding path joining and URL resolution. + +* Add a third parameter for relative path to + `SourceMapGenerator.prototype.applySourceMap`. + +* Fix issues with mappings and EOLs. + +## 0.1.32 + +* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns + (issue 92). + +* Fixed test runner to actually report number of failed tests as its process + exit code. + +* Fixed a typo when reporting bad mappings (issue 87). + +## 0.1.31 + +* Delay parsing the mappings in SourceMapConsumer until queried for a source + location. + +* Support Sass source maps (which at the time of writing deviate from the spec + in small ways) in SourceMapConsumer. + +## 0.1.30 + +* Do not join source root with a source, when the source is a data URI. + +* Extend the test runner to allow running single specific test files at a time. + +* Performance improvements in `SourceNode.prototype.walk` and + `SourceMapConsumer.prototype.eachMapping`. + +* Source map browser builds will now work inside Workers. + +* Better error messages when attempting to add an invalid mapping to a + `SourceMapGenerator`. + +## 0.1.29 + +* Allow duplicate entries in the `names` and `sources` arrays of source maps + (usually from TypeScript) we are parsing. Fixes github issue 72. + +## 0.1.28 + +* Skip duplicate mappings when creating source maps from SourceNode; github + issue 75. + +## 0.1.27 + +* Don't throw an error when the `file` property is missing in SourceMapConsumer, + we don't use it anyway. + +## 0.1.26 + +* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70. + +## 0.1.25 + +* Make compatible with browserify + +## 0.1.24 + +* Fix issue with absolute paths and `file://` URIs. See + https://bugzilla.mozilla.org/show_bug.cgi?id=885597 + +## 0.1.23 + +* Fix issue with absolute paths and sourcesContent, github issue 64. + +## 0.1.22 + +* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21. + +## 0.1.21 + +* Fixed handling of sources that start with a slash so that they are relative to + the source root's host. + +## 0.1.20 + +* Fixed github issue #43: absolute URLs aren't joined with the source root + anymore. + +## 0.1.19 + +* Using Travis CI to run tests. + +## 0.1.18 + +* Fixed a bug in the handling of sourceRoot. + +## 0.1.17 + +* Added SourceNode.fromStringWithSourceMap. + +## 0.1.16 + +* Added missing documentation. + +* Fixed the generating of empty mappings in SourceNode. + +## 0.1.15 + +* Added SourceMapGenerator.applySourceMap. + +## 0.1.14 + +* The sourceRoot is now handled consistently. + +## 0.1.13 + +* Added SourceMapGenerator.fromSourceMap. + +## 0.1.12 + +* SourceNode now generates empty mappings too. + +## 0.1.11 + +* Added name support to SourceNode. + +## 0.1.10 + +* Added sourcesContent support to the customer and generator. diff --git a/node_modules/source-map/LICENSE b/node_modules/source-map/LICENSE new file mode 100644 index 0000000..ed1b7cf --- /dev/null +++ b/node_modules/source-map/LICENSE @@ -0,0 +1,28 @@ + +Copyright (c) 2009-2011, Mozilla Foundation and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the names of the Mozilla Foundation nor the names of project + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/source-map/README.md b/node_modules/source-map/README.md new file mode 100644 index 0000000..fea4beb --- /dev/null +++ b/node_modules/source-map/README.md @@ -0,0 +1,742 @@ +# Source Map + +[![Build Status](https://travis-ci.org/mozilla/source-map.png?branch=master)](https://travis-ci.org/mozilla/source-map) + +[![NPM](https://nodei.co/npm/source-map.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map) + +This is a library to generate and consume the source map format +[described here][format]. + +[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit + +## Use with Node + + $ npm install source-map + +## Use on the Web + + + +-------------------------------------------------------------------------------- + + + + + +## Table of Contents + +- [Examples](#examples) + - [Consuming a source map](#consuming-a-source-map) + - [Generating a source map](#generating-a-source-map) + - [With SourceNode (high level API)](#with-sourcenode-high-level-api) + - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api) +- [API](#api) + - [SourceMapConsumer](#sourcemapconsumer) + - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap) + - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans) + - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition) + - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition) + - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition) + - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources) + - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing) + - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order) + - [SourceMapGenerator](#sourcemapgenerator) + - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap) + - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer) + - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping) + - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath) + - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring) + - [SourceNode](#sourcenode) + - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name) + - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath) + - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk) + - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk) + - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent) + - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn) + - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn) + - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep) + - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement) + - [SourceNode.prototype.toString()](#sourcenodeprototypetostring) + - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap) + + + +## Examples + +### Consuming a source map + +```js +var rawSourceMap = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['one.js', 'two.js'], + sourceRoot: 'http://example.com/www/js/', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' +}; + +var smc = new SourceMapConsumer(rawSourceMap); + +console.log(smc.sources); +// [ 'http://example.com/www/js/one.js', +// 'http://example.com/www/js/two.js' ] + +console.log(smc.originalPositionFor({ + line: 2, + column: 28 +})); +// { source: 'http://example.com/www/js/two.js', +// line: 2, +// column: 10, +// name: 'n' } + +console.log(smc.generatedPositionFor({ + source: 'http://example.com/www/js/two.js', + line: 2, + column: 10 +})); +// { line: 2, column: 28 } + +smc.eachMapping(function (m) { + // ... +}); +``` + +### Generating a source map + +In depth guide: +[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/) + +#### With SourceNode (high level API) + +```js +function compile(ast) { + switch (ast.type) { + case 'BinaryExpression': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + [compile(ast.left), " + ", compile(ast.right)] + ); + case 'Literal': + return new SourceNode( + ast.location.line, + ast.location.column, + ast.location.source, + String(ast.value) + ); + // ... + default: + throw new Error("Bad AST"); + } +} + +var ast = parse("40 + 2", "add.js"); +console.log(compile(ast).toStringWithSourceMap({ + file: 'add.js' +})); +// { code: '40 + 2', +// map: [object SourceMapGenerator] } +``` + +#### With SourceMapGenerator (low level API) + +```js +var map = new SourceMapGenerator({ + file: "source-mapped.js" +}); + +map.addMapping({ + generated: { + line: 10, + column: 35 + }, + source: "foo.js", + original: { + line: 33, + column: 2 + }, + name: "christopher" +}); + +console.log(map.toString()); +// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}' +``` + +## API + +Get a reference to the module: + +```js +// Node.js +var sourceMap = require('source-map'); + +// Browser builds +var sourceMap = window.sourceMap; + +// Inside Firefox +const sourceMap = require("devtools/toolkit/sourcemap/source-map.js"); +``` + +### SourceMapConsumer + +A SourceMapConsumer instance represents a parsed source map which we can query +for information about the original file positions by giving it a file position +in the generated source. + +#### new SourceMapConsumer(rawSourceMap) + +The only parameter is the raw source map (either as a string which can be +`JSON.parse`'d, or an object). According to the spec, source maps have the +following attributes: + +* `version`: Which version of the source map spec this map is following. + +* `sources`: An array of URLs to the original source files. + +* `names`: An array of identifiers which can be referenced by individual + mappings. + +* `sourceRoot`: Optional. The URL root from which all sources are relative. + +* `sourcesContent`: Optional. An array of contents of the original source files. + +* `mappings`: A string of base64 VLQs which contain the actual mappings. + +* `file`: Optional. The generated filename this source map is associated with. + +```js +var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData); +``` + +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + +```js +// Before: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] + +consumer.computeColumnSpans(); + +// After: +consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1, +// lastColumn: 9 }, +// { line: 2, +// column: 10, +// lastColumn: 19 }, +// { line: 2, +// column: 20, +// lastColumn: Infinity } ] + +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +Returns the original source, line, and column information for the generated +source's line and column positions provided. The only argument is an object with +the following properties: + +* `line`: The line number in the generated source. Line numbers in + this library are 1-based (note that the underlying source map + specification uses 0-based line numbers -- this library handles the + translation). + +* `column`: The column number in the generated source. Column numbers + in this library are 0-based. + +* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or + `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest + element that is smaller than or greater than the one we are searching for, + respectively, if the exact element cannot be found. Defaults to + `SourceMapConsumer.GREATEST_LOWER_BOUND`. + +and an object is returned with the following properties: + +* `source`: The original source file, or null if this information is not + available. + +* `line`: The line number in the original source, or null if this information is + not available. The line number is 1-based. + +* `column`: The column number in the original source, or null if this + information is not available. The column number is 0-based. + +* `name`: The original identifier, or null if this information is not available. + +```js +consumer.originalPositionFor({ line: 2, column: 10 }) +// { source: 'foo.coffee', +// line: 2, +// column: 2, +// name: null } + +consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 }) +// { source: null, +// line: null, +// column: null, +// name: null } +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +Returns the generated line and column information for the original source, +line, and column positions provided. The only argument is an object with +the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: The column number in the original source. The column + number is 0-based. + +and an object is returned with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 }) +// { line: 1, +// column: 56 } +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source, line, +and column provided. If no column is provided, returns all mappings +corresponding to a either the line we are searching for or the next closest line +that has any mappings. Otherwise, returns all mappings corresponding to the +given line and either the column we are searching for or the next closest column +that has any offsets. + +The only argument is an object with the following properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. The line number is + 1-based. + +* `column`: Optional. The column number in the original source. The + column number is 0-based. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. The line + number is 1-based. + +* `column`: The column number in the generated source, or null. The + column number is 0-based. + +```js +consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" }) +// [ { line: 2, +// column: 1 }, +// { line: 2, +// column: 10 }, +// { line: 2, +// column: 20 } ] +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +Return true if we have the embedded source content for every source listed in +the source map, false otherwise. + +In other words, if this method returns `true`, then +`consumer.sourceContentFor(s)` will succeed for every source `s` in +`consumer.sources`. + +```js +// ... +if (consumer.hasContentsOfAllSources()) { + consumerReadyCallback(consumer); +} else { + fetchSources(consumer, consumerReadyCallback); +} +// ... +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +Returns the original source content for the source provided. The only +argument is the URL of the original source file. + +If the source content for the given source is not found, then an error is +thrown. Optionally, pass `true` as the second param to have `null` returned +instead. + +```js +consumer.sources +// [ "my-cool-lib.clj" ] + +consumer.sourceContentFor("my-cool-lib.clj") +// "..." + +consumer.sourceContentFor("this is not in the source map"); +// Error: "this is not in the source map" is not in the source map + +consumer.sourceContentFor("this is not in the source map", true); +// null +``` + +#### SourceMapConsumer.prototype.eachMapping(callback, context, order) + +Iterate over each mapping between an original source/line/column and a +generated line/column in this source map. + +* `callback`: The function that is called with each mapping. Mappings have the + form `{ source, generatedLine, generatedColumn, originalLine, originalColumn, + name }` + +* `context`: Optional. If specified, this object will be the value of `this` + every time that `callback` is called. + +* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or + `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over + the mappings sorted by the generated file's line/column order or the + original's source/line/column order, respectively. Defaults to + `SourceMapConsumer.GENERATED_ORDER`. + +```js +consumer.eachMapping(function (m) { console.log(m); }) +// ... +// { source: 'illmatic.js', +// generatedLine: 1, +// generatedColumn: 0, +// originalLine: 1, +// originalColumn: 0, +// name: null } +// { source: 'illmatic.js', +// generatedLine: 2, +// generatedColumn: 0, +// originalLine: 2, +// originalColumn: 0, +// name: null } +// ... +``` +### SourceMapGenerator + +An instance of the SourceMapGenerator represents a source map which is being +built incrementally. + +#### new SourceMapGenerator([startOfSourceMap]) + +You may pass an object with the following properties: + +* `file`: The filename of the generated source that this source map is + associated with. + +* `sourceRoot`: A root for all relative URLs in this source map. + +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + +```js +var generator = new sourceMap.SourceMapGenerator({ + file: "my-generated-javascript-file.js", + sourceRoot: "http://example.com/app/js/" +}); +``` + +#### SourceMapGenerator.fromSourceMap(sourceMapConsumer) + +Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. + +* `sourceMapConsumer` The SourceMap. + +```js +var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +Add a single mapping from original source line and column to the generated +source's line and column for this source map being created. The mapping object +should have the following properties: + +* `generated`: An object with the generated line and column positions. + +* `original`: An object with the original line and column positions. + +* `source`: The original source file (relative to the sourceRoot). + +* `name`: An optional original token name for this mapping. + +```js +generator.addMapping({ + source: "module-one.scm", + original: { line: 128, column: 0 }, + generated: { line: 3, column: 456 } +}) +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for an original source file. + +* `sourceFile` the URL of the original source file. + +* `sourceContent` the content of the source file. + +```js +generator.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +Applies a SourceMap for a source file to the SourceMap. +Each mapping to the supplied source file is rewritten using the +supplied SourceMap. Note: The resolution for the resulting mappings +is the minimum of this map and the supplied map. + +* `sourceMapConsumer`: The SourceMap to be applied. + +* `sourceFile`: Optional. The filename of the source file. + If omitted, sourceMapConsumer.file will be used, if it exists. + Otherwise an error will be thrown. + +* `sourceMapPath`: Optional. The dirname of the path to the SourceMap + to be applied. If relative, it is relative to the SourceMap. + + This parameter is needed when the two SourceMaps aren't in the same + directory, and the SourceMap to be applied contains relative source + paths. If so, those relative source paths need to be rewritten + relative to the SourceMap. + + If omitted, it is assumed that both SourceMaps are in the same directory, + thus not needing any rewriting. (Supplying `'.'` has the same effect.) + +#### SourceMapGenerator.prototype.toString() + +Renders the source map being generated to a string. + +```js +generator.toString() +// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}' +``` + +### SourceNode + +SourceNodes provide a way to abstract over interpolating and/or concatenating +snippets of generated JavaScript source code, while maintaining the line and +column information associated between those snippets and the original source +code. This is useful as the final intermediate representation a compiler might +use before outputting the generated JS and source map. + +#### new SourceNode([line, column, source[, chunk[, name]]]) + +* `line`: The original line number associated with this source node, or null if + it isn't associated with an original line. The line number is 1-based. + +* `column`: The original column number associated with this source node, or null + if it isn't associated with an original column. The column number + is 0-based. + +* `source`: The original source's filename; null if no filename is provided. + +* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see + below. + +* `name`: Optional. The original identifier. + +```js +var node = new SourceNode(1, 2, "a.cpp", [ + new SourceNode(3, 4, "b.cpp", "extern int status;\n"), + new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"), + new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"), +]); +``` + +#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath]) + +Creates a SourceNode from generated code and a SourceMapConsumer. + +* `code`: The generated code + +* `sourceMapConsumer` The SourceMap for the generated code + +* `relativePath` The optional path that relative sources in `sourceMapConsumer` + should be relative to. + +```js +var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8")); +var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"), + consumer); +``` + +#### SourceNode.prototype.add(chunk) + +Add a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.add(" + "); +node.add(otherNode); +node.add([leftHandOperandNode, " + ", rightHandOperandNode]); +``` + +#### SourceNode.prototype.prepend(chunk) + +Prepend a chunk of generated JS to this source node. + +* `chunk`: A string snippet of generated JS code, another instance of + `SourceNode`, or an array where each member is one of those things. + +```js +node.prepend("/** Build Id: f783haef86324gf **/\n\n"); +``` + +#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent) + +Set the source content for a source file. This will be added to the +`SourceMap` in the `sourcesContent` field. + +* `sourceFile`: The filename of the source file + +* `sourceContent`: The content of the source file + +```js +node.setSourceContent("module-one.scm", + fs.readFileSync("path/to/module-one.scm")) +``` + +#### SourceNode.prototype.walk(fn) + +Walk over the tree of JS snippets in this node and its children. The walking +function is called once for each snippet of JS and is passed that snippet and +the its original associated source's line/column location. + +* `fn`: The traversal function. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.walk(function (code, loc) { console.log("WALK:", code, loc); }) +// WALK: uno { source: 'b.js', line: 3, column: 4, name: null } +// WALK: dos { source: 'a.js', line: 1, column: 2, name: null } +// WALK: tres { source: 'a.js', line: 1, column: 2, name: null } +// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null } +``` + +#### SourceNode.prototype.walkSourceContents(fn) + +Walk over the tree of SourceNodes. The walking function is called for each +source file content and is passed the filename and source content. + +* `fn`: The traversal function. + +```js +var a = new SourceNode(1, 2, "a.js", "generated from a"); +a.setSourceContent("a.js", "original a"); +var b = new SourceNode(1, 2, "b.js", "generated from b"); +b.setSourceContent("b.js", "original b"); +var c = new SourceNode(1, 2, "c.js", "generated from c"); +c.setSourceContent("c.js", "original c"); + +var node = new SourceNode(null, null, null, [a, b, c]); +node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); }) +// WALK: a.js : original a +// WALK: b.js : original b +// WALK: c.js : original c +``` + +#### SourceNode.prototype.join(sep) + +Like `Array.prototype.join` except for SourceNodes. Inserts the separator +between each of this source node's children. + +* `sep`: The separator. + +```js +var lhs = new SourceNode(1, 2, "a.rs", "my_copy"); +var operand = new SourceNode(3, 4, "a.rs", "="); +var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()"); + +var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]); +var joinedNode = node.join(" "); +``` + +#### SourceNode.prototype.replaceRight(pattern, replacement) + +Call `String.prototype.replace` on the very right-most source snippet. Useful +for trimming white space from the end of a source node, etc. + +* `pattern`: The pattern to replace. + +* `replacement`: The thing to replace the pattern with. + +```js +// Trim trailing white space. +node.replaceRight(/\s*$/, ""); +``` + +#### SourceNode.prototype.toString() + +Return the string representation of this source node. Walks over the tree and +concatenates all the various snippets together to one string. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toString() +// 'unodostresquatro' +``` + +#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap]) + +Returns the string representation of this tree of source nodes, plus a +SourceMapGenerator which contains all the mappings between the generated and +original sources. + +The arguments are the same as those to `new SourceMapGenerator`. + +```js +var node = new SourceNode(1, 2, "a.js", [ + new SourceNode(3, 4, "b.js", "uno"), + "dos", + [ + "tres", + new SourceNode(5, 6, "c.js", "quatro") + ] +]); + +node.toStringWithSourceMap({ file: "my-output-file.js" }) +// { code: 'unodostresquatro', +// map: [object SourceMapGenerator] } +``` diff --git a/node_modules/source-map/dist/source-map.debug.js b/node_modules/source-map/dist/source-map.debug.js new file mode 100644 index 0000000..aad0620 --- /dev/null +++ b/node_modules/source-map/dist/source-map.debug.js @@ -0,0 +1,3234 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["sourceMap"] = factory(); + else + root["sourceMap"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + /* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; + exports.SourceNode = __webpack_require__(10).SourceNode; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = __webpack_require__(2); + var util = __webpack_require__(4); + var ArraySet = __webpack_require__(5).ArraySet; + var MappingList = __webpack_require__(6).MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + exports.SourceMapGenerator = SourceMapGenerator; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = __webpack_require__(3); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var binarySearch = __webpack_require__(8); + var ArraySet = __webpack_require__(5).ArraySet; + var base64VLQ = __webpack_require__(2); + var quickSort = __webpack_require__(9).quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + } + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + var util = __webpack_require__(4); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + exports.SourceNode = SourceNode; + + +/***/ }) +/******/ ]) +}); +; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCAxNjI0YzcyOTliODg3ZjdiZGY2NCIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LXZscS5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LmpzIiwid2VicGFjazovLy8uL2xpYi91dGlsLmpzIiwid2VicGFjazovLy8uL2xpYi9hcnJheS1zZXQuanMiLCJ3ZWJwYWNrOi8vLy4vbGliL21hcHBpbmctbGlzdC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW1hcC1jb25zdW1lci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmluYXJ5LXNlYXJjaC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvcXVpY2stc29ydC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW5vZGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQztBQUNELE87QUNWQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSx1QkFBZTtBQUNmO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOzs7QUFHQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOzs7Ozs7O0FD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b24gM1xuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbExpbmUgLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNPcmlnaW5hbExpbmUpO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsTGluZSA9IG1hcHBpbmcub3JpZ2luYWxMaW5lIC0gMTtcblxuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHByZXZpb3VzT3JpZ2luYWxDb2x1bW4pO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsQ29sdW1uID0gbWFwcGluZy5vcmlnaW5hbENvbHVtbjtcblxuICAgICAgICBpZiAobWFwcGluZy5uYW1lICE9IG51bGwpIHtcbiAgICAgICAgICBuYW1lSWR4ID0gdGhpcy5fbmFtZXMuaW5kZXhPZihtYXBwaW5nLm5hbWUpO1xuICAgICAgICAgIG5leHQgKz0gYmFzZTY0VkxRLmVuY29kZShuYW1lSWR4IC0gcHJldmlvdXNOYW1lKTtcbiAgICAgICAgICBwcmV2aW91c05hbWUgPSBuYW1lSWR4O1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJlc3VsdCArPSBuZXh0O1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG4gIH07XG5cblNvdXJjZU1hcEdlbmVyYXRvci5wcm90b3R5cGUuX2dlbmVyYXRlU291cmNlc0NvbnRlbnQgPVxuICBmdW5jdGlvbiBTb3VyY2VNYXBHZW5lcmF0b3JfZ2VuZXJhdGVTb3VyY2VzQ29udGVudChhU291cmNlcywgYVNvdXJjZVJvb3QpIHtcbiAgICByZXR1cm4gYVNvdXJjZXMubWFwKGZ1bmN0aW9uIChzb3VyY2UpIHtcbiAgICAgIGlmICghdGhpcy5fc291cmNlc0NvbnRlbnRzKSB7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UGF0aCAhPSBudWxsKSB7XG4gICAgICAgICAgc291cmNlRmlsZSA9IHV0aWwuam9pbihhUmVsYXRpdmVQYXRoLCBzb3VyY2VGaWxlKTtcbiAgICAgICAgfVxuICAgICAgICBub2RlLnNldFNvdXJjZUNvbnRlbnQoc291cmNlRmlsZSwgY29udGVudCk7XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICByZXR1cm4gbm9kZTtcblxuICAgIGZ1bmN0aW9uIGFkZE1hcHBpbmdXaXRoQ29kZShtYXBwaW5nLCBjb2RlKSB7XG4gICAgICBpZiAobWFwcGluZyA9PT0gbnVsbCB8fCBtYXBwaW5nLnNvdXJjZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIG5vZGUuYWRkKGNvZGUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIHNvdXJjZSA9IGFSZWxhdGl2ZVBhdGhcbiAgICAgICAgICA/IHV0aWwuam9pbihhUmVsYXRpdmVQYXRoLCBtYXBwaW5nLnNvdXJjZSlcbiAgICAgICAgICA6IG1hcHBpbmcuc291cmNlO1xuICAgICAgICBub2RlLmFkZChuZXcgU291cmNlTm9kZShtYXBwaW5nLm9yaWdpbmFsTGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwcGluZy5vcmlnaW5hbENvbHVtbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXBwaW5nLm5hbWUpKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbi8qKlxuICogQWRkIGEgY2h1bmsgb2YgZ2VuZXJhdGVkIEpTIHRvIHRoaXMgc291cmNlIG5vZGUuXG4gKlxuICogQHBhcmFtIGFDaHVuayBBIHN0cmluZyBzbmlwcGV0IG9mIGdlbmVyYXRlZCBKUyBjb2RlLCBhbm90aGVyIGluc3Rhbm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7XG4gICAgICAgIGdlbmVyYXRlZC5saW5lKys7XG4gICAgICAgIGdlbmVyYXRlZC5jb2x1bW4gPSAwO1xuICAgICAgICAvLyBNYXBwaW5ncyBlbmQgYXQgZW9sXG4gICAgICAgIGlmIChpZHggKyAxID09PSBsZW5ndGgpIHtcbiAgICAgICAgICBsYXN0T3JpZ2luYWxTb3VyY2UgPSBudWxsO1xuICAgICAgICAgIHNvdXJjZU1hcHBpbmdBY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgfSBlbHNlIGlmIChzb3VyY2VNYXBwaW5nQWN0aXZlKSB7XG4gICAgICAgICAgbWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgc291cmNlOiBvcmlnaW5hbC5zb3VyY2UsXG4gICAgICAgICAgICBvcmlnaW5hbDoge1xuICAgICAgICAgICAgICBsaW5lOiBvcmlnaW5hbC5saW5lLFxuICAgICAgICAgICAgICBjb2x1bW46IG9yaWdpbmFsLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdlbmVyYXRlZDoge1xuICAgICAgICAgICAgICBsaW5lOiBnZW5lcmF0ZWQubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBnZW5lcmF0ZWQuY29sdW1uXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmFtZTogb3JpZ2luYWwubmFtZVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBnZW5lcmF0ZWQuY29sdW1uKys7XG4gICAgICB9XG4gICAgfVxuICB9KTtcbiAgdGhpcy53YWxrU291cmNlQ29udGVudHMoZnVuY3Rpb24gKHNvdXJjZUZpbGUsIHNvdXJjZUNvbnRlbnQpIHtcbiAgICBtYXAuc2V0U291cmNlQ29udGVudChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KTtcbiAgfSk7XG5cbiAgcmV0dXJuIHsgY29kZTogZ2VuZXJhdGVkLmNvZGUsIG1hcDogbWFwIH07XG59O1xuXG5leHBvcnRzLlNvdXJjZU5vZGUgPSBTb3VyY2VOb2RlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9saWIvc291cmNlLW5vZGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/node_modules/source-map/dist/source-map.js b/node_modules/source-map/dist/source-map.js new file mode 100644 index 0000000..b4eb087 --- /dev/null +++ b/node_modules/source-map/dist/source-map.js @@ -0,0 +1,3233 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["sourceMap"] = factory(); + else + root["sourceMap"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + /* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ + exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer; + exports.SourceNode = __webpack_require__(10).SourceNode; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var base64VLQ = __webpack_require__(2); + var util = __webpack_require__(4); + var ArraySet = __webpack_require__(5).ArraySet; + var MappingList = __webpack_require__(6).MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + exports.SourceMapGenerator = SourceMapGenerator; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + var base64 = __webpack_require__(3); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); + }()); + + function identity (s) { + return s; + } + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; + } + exports.toSetString = supportsNullProto ? identity : toSetString; + + function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; + } + exports.fromSetString = supportsNullProto ? identity : fromSetString; + + function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; + } + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + + /** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ + function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); + } + exports.parseSourceMapInput = parseSourceMapInput; + + /** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ + function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); + } + exports.computeSourceURL = computeSourceURL; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var has = Object.prototype.hasOwnProperty; + var hasNativeMap = typeof Map !== "undefined"; + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var util = __webpack_require__(4); + var binarySearch = __webpack_require__(8); + var ArraySet = __webpack_require__(5).ArraySet; + var base64VLQ = __webpack_require__(2); + var quickSort = __webpack_require__(9).quickSort; + + function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); + } + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ + BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; + }; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /* -*- Mode: js; js-indent-level: 2; -*- */ + /* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + + var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator; + var util = __webpack_require__(4); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + exports.SourceNode = SourceNode; + + +/***/ }) +/******/ ]) +}); +; \ No newline at end of file diff --git a/node_modules/source-map/dist/source-map.min.js b/node_modules/source-map/dist/source-map.min.js new file mode 100644 index 0000000..c7c72da --- /dev/null +++ b/node_modules/source-map/dist/source-map.min.js @@ -0,0 +1,2 @@ +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(t){var o=t;null!==n&&(o=i.relative(n,t)),r._sources.has(o)||r._sources.add(o);var s=e.sourceContentFor(t);null!=s&&r.setSourceContent(t,s)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if(n&&"number"!=typeof n.line&&"number"!=typeof n.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;f0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return e<0?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(y))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(t<0)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=f(e.source,n.source);return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:f(e.name,n.name)))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=f(e.source,n.source),0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:f(e.name,n.name)))))}function f(e,n){return e===n?0:null===e?1:null===n?-1:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}function m(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function _(e,n,r){if(n=n||"",e&&("/"!==e[e.length-1]&&"/"!==n[0]&&(e+="/"),n=e+n),r){var a=t(r);if(!a)throw new Error("sourceMapURL could not be parsed");if(a.path){var u=a.path.lastIndexOf("/");u>=0&&(a.path=a.path.substring(0,u+1))}n=s(o(a),n)}return i(n)}n.getArg=r;var v=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,y=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||v.test(e)},n.relative=a;var C=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=C?u:l,n.fromSetString=C?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d,n.parseSourceMapInput=m,n.computeSourceURL=_},function(e,n,r){function t(){this._array=[],this._set=s?new Map:Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;o=0)return n}else{var r=o.toSetString(e);if(i.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e,n){var r=e;return"string"==typeof e&&(r=a.parseSourceMapInput(e)),null!=r.sections?new s(r,n):new o(r,n)}function o(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var t=a.getArg(r,"version"),o=a.getArg(r,"sources"),i=a.getArg(r,"names",[]),s=a.getArg(r,"sourceRoot",null),u=a.getArg(r,"sourcesContent",null),c=a.getArg(r,"mappings"),g=a.getArg(r,"file",null);if(t!=this._version)throw new Error("Unsupported version: "+t);s&&(s=a.normalize(s)),o=o.map(String).map(a.normalize).map(function(e){return s&&a.isAbsolute(s)&&a.isAbsolute(e)?a.relative(s,e):e}),this._names=l.fromArray(i.map(String),!0),this._sources=l.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(e){return a.computeSourceURL(s,e,n)}),this.sourceRoot=s,this.sourcesContent=u,this._mappings=c,this._sourceMapURL=n,this.file=g}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e,n){var r=e;"string"==typeof e&&(r=a.parseSourceMapInput(e));var o=a.getArg(r,"version"),i=a.getArg(r,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new l,this._names=new l;var s={line:-1,column:0};this._sections=i.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=a.getArg(e,"offset"),o=a.getArg(r,"line"),i=a.getArg(r,"column");if(o=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.prototype._findSourceIndex=function(e){var n=e;if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);var r;for(r=0;r1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),A.push(r),"number"==typeof r.originalLine&&S.push(r)}g(A,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,g(S,a.compareByOriginalPositions),this.__originalMappings=S},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=a.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var t=e;null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t));var o;if(null!=this.sourceRoot&&(o=a.urlParse(this.sourceRoot))){var i=t.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!o.path||"/"==o.path)&&this._sources.has("/"+t))return this.sourcesContent[this._sources.indexOf("/"+t)]}if(n)return null;throw new Error('"'+t+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(i=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;r0){for(n=[],r=0;r 0 && aGenerated.column >= 0\n\t && !aOriginal && !aSource && !aName) {\n\t // Case 1.\n\t return;\n\t }\n\t else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n\t && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n\t && aGenerated.line > 0 && aGenerated.column >= 0\n\t && aOriginal.line > 0 && aOriginal.column >= 0\n\t && aSource) {\n\t // Cases 2 and 3.\n\t return;\n\t }\n\t else {\n\t throw new Error('Invalid mapping: ' + JSON.stringify({\n\t generated: aGenerated,\n\t source: aSource,\n\t original: aOriginal,\n\t name: aName\n\t }));\n\t }\n\t };\n\t\n\t/**\n\t * Serialize the accumulated mappings in to the stream of base 64 VLQs\n\t * specified by the source map format.\n\t */\n\tSourceMapGenerator.prototype._serializeMappings =\n\t function SourceMapGenerator_serializeMappings() {\n\t var previousGeneratedColumn = 0;\n\t var previousGeneratedLine = 1;\n\t var previousOriginalColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousName = 0;\n\t var previousSource = 0;\n\t var result = '';\n\t var next;\n\t var mapping;\n\t var nameIdx;\n\t var sourceIdx;\n\t\n\t var mappings = this._mappings.toArray();\n\t for (var i = 0, len = mappings.length; i < len; i++) {\n\t mapping = mappings[i];\n\t next = ''\n\t\n\t if (mapping.generatedLine !== previousGeneratedLine) {\n\t previousGeneratedColumn = 0;\n\t while (mapping.generatedLine !== previousGeneratedLine) {\n\t next += ';';\n\t previousGeneratedLine++;\n\t }\n\t }\n\t else {\n\t if (i > 0) {\n\t if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n\t continue;\n\t }\n\t next += ',';\n\t }\n\t }\n\t\n\t next += base64VLQ.encode(mapping.generatedColumn\n\t - previousGeneratedColumn);\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (mapping.source != null) {\n\t sourceIdx = this._sources.indexOf(mapping.source);\n\t next += base64VLQ.encode(sourceIdx - previousSource);\n\t previousSource = sourceIdx;\n\t\n\t // lines are stored 0-based in SourceMap spec version 3\n\t next += base64VLQ.encode(mapping.originalLine - 1\n\t - previousOriginalLine);\n\t previousOriginalLine = mapping.originalLine - 1;\n\t\n\t next += base64VLQ.encode(mapping.originalColumn\n\t - previousOriginalColumn);\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (mapping.name != null) {\n\t nameIdx = this._names.indexOf(mapping.name);\n\t next += base64VLQ.encode(nameIdx - previousName);\n\t previousName = nameIdx;\n\t }\n\t }\n\t\n\t result += next;\n\t }\n\t\n\t return result;\n\t };\n\t\n\tSourceMapGenerator.prototype._generateSourcesContent =\n\t function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n\t return aSources.map(function (source) {\n\t if (!this._sourcesContents) {\n\t return null;\n\t }\n\t if (aSourceRoot != null) {\n\t source = util.relative(aSourceRoot, source);\n\t }\n\t var key = util.toSetString(source);\n\t return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n\t ? this._sourcesContents[key]\n\t : null;\n\t }, this);\n\t };\n\t\n\t/**\n\t * Externalize the source map.\n\t */\n\tSourceMapGenerator.prototype.toJSON =\n\t function SourceMapGenerator_toJSON() {\n\t var map = {\n\t version: this._version,\n\t sources: this._sources.toArray(),\n\t names: this._names.toArray(),\n\t mappings: this._serializeMappings()\n\t };\n\t if (this._file != null) {\n\t map.file = this._file;\n\t }\n\t if (this._sourceRoot != null) {\n\t map.sourceRoot = this._sourceRoot;\n\t }\n\t if (this._sourcesContents) {\n\t map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n\t }\n\t\n\t return map;\n\t };\n\t\n\t/**\n\t * Render the source map being generated to a string.\n\t */\n\tSourceMapGenerator.prototype.toString =\n\t function SourceMapGenerator_toString() {\n\t return JSON.stringify(this.toJSON());\n\t };\n\t\n\texports.SourceMapGenerator = SourceMapGenerator;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t *\n\t * Based on the Base 64 VLQ implementation in Closure Compiler:\n\t * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n\t *\n\t * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n\t * Redistribution and use in source and binary forms, with or without\n\t * modification, are permitted provided that the following conditions are\n\t * met:\n\t *\n\t * * Redistributions of source code must retain the above copyright\n\t * notice, this list of conditions and the following disclaimer.\n\t * * Redistributions in binary form must reproduce the above\n\t * copyright notice, this list of conditions and the following\n\t * disclaimer in the documentation and/or other materials provided\n\t * with the distribution.\n\t * * Neither the name of Google Inc. nor the names of its\n\t * contributors may be used to endorse or promote products derived\n\t * from this software without specific prior written permission.\n\t *\n\t * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\t * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\t * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\t * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\t * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n\t * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n\t * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\t * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n\t * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t */\n\t\n\tvar base64 = __webpack_require__(3);\n\t\n\t// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n\t// length quantities we use in the source map spec, the first bit is the sign,\n\t// the next four bits are the actual value, and the 6th bit is the\n\t// continuation bit. The continuation bit tells us whether there are more\n\t// digits in this value following this digit.\n\t//\n\t// Continuation\n\t// | Sign\n\t// | |\n\t// V V\n\t// 101011\n\t\n\tvar VLQ_BASE_SHIFT = 5;\n\t\n\t// binary: 100000\n\tvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\t\n\t// binary: 011111\n\tvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\t\n\t// binary: 100000\n\tvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\t\n\t/**\n\t * Converts from a two-complement value to a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n\t * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n\t */\n\tfunction toVLQSigned(aValue) {\n\t return aValue < 0\n\t ? ((-aValue) << 1) + 1\n\t : (aValue << 1) + 0;\n\t}\n\t\n\t/**\n\t * Converts to a two-complement value from a value where the sign bit is\n\t * placed in the least significant bit. For example, as decimals:\n\t * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n\t * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n\t */\n\tfunction fromVLQSigned(aValue) {\n\t var isNegative = (aValue & 1) === 1;\n\t var shifted = aValue >> 1;\n\t return isNegative\n\t ? -shifted\n\t : shifted;\n\t}\n\t\n\t/**\n\t * Returns the base 64 VLQ encoded value.\n\t */\n\texports.encode = function base64VLQ_encode(aValue) {\n\t var encoded = \"\";\n\t var digit;\n\t\n\t var vlq = toVLQSigned(aValue);\n\t\n\t do {\n\t digit = vlq & VLQ_BASE_MASK;\n\t vlq >>>= VLQ_BASE_SHIFT;\n\t if (vlq > 0) {\n\t // There are still more digits in this value, so we must make sure the\n\t // continuation bit is marked.\n\t digit |= VLQ_CONTINUATION_BIT;\n\t }\n\t encoded += base64.encode(digit);\n\t } while (vlq > 0);\n\t\n\t return encoded;\n\t};\n\t\n\t/**\n\t * Decodes the next base 64 VLQ value from the given string and returns the\n\t * value and the rest of the string via the out parameter.\n\t */\n\texports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n\t var strLen = aStr.length;\n\t var result = 0;\n\t var shift = 0;\n\t var continuation, digit;\n\t\n\t do {\n\t if (aIndex >= strLen) {\n\t throw new Error(\"Expected more digits in base 64 VLQ value.\");\n\t }\n\t\n\t digit = base64.decode(aStr.charCodeAt(aIndex++));\n\t if (digit === -1) {\n\t throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n\t }\n\t\n\t continuation = !!(digit & VLQ_CONTINUATION_BIT);\n\t digit &= VLQ_BASE_MASK;\n\t result = result + (digit << shift);\n\t shift += VLQ_BASE_SHIFT;\n\t } while (continuation);\n\t\n\t aOutParam.value = fromVLQSigned(result);\n\t aOutParam.rest = aIndex;\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\t\n\t/**\n\t * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n\t */\n\texports.encode = function (number) {\n\t if (0 <= number && number < intToCharMap.length) {\n\t return intToCharMap[number];\n\t }\n\t throw new TypeError(\"Must be between 0 and 63: \" + number);\n\t};\n\t\n\t/**\n\t * Decode a single base 64 character code digit to an integer. Returns -1 on\n\t * failure.\n\t */\n\texports.decode = function (charCode) {\n\t var bigA = 65; // 'A'\n\t var bigZ = 90; // 'Z'\n\t\n\t var littleA = 97; // 'a'\n\t var littleZ = 122; // 'z'\n\t\n\t var zero = 48; // '0'\n\t var nine = 57; // '9'\n\t\n\t var plus = 43; // '+'\n\t var slash = 47; // '/'\n\t\n\t var littleOffset = 26;\n\t var numberOffset = 52;\n\t\n\t // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n\t if (bigA <= charCode && charCode <= bigZ) {\n\t return (charCode - bigA);\n\t }\n\t\n\t // 26 - 51: abcdefghijklmnopqrstuvwxyz\n\t if (littleA <= charCode && charCode <= littleZ) {\n\t return (charCode - littleA + littleOffset);\n\t }\n\t\n\t // 52 - 61: 0123456789\n\t if (zero <= charCode && charCode <= nine) {\n\t return (charCode - zero + numberOffset);\n\t }\n\t\n\t // 62: +\n\t if (charCode == plus) {\n\t return 62;\n\t }\n\t\n\t // 63: /\n\t if (charCode == slash) {\n\t return 63;\n\t }\n\t\n\t // Invalid base64 digit.\n\t return -1;\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t/**\n\t * This is a helper function for getting values from parameter/options\n\t * objects.\n\t *\n\t * @param args The object we are extracting values from\n\t * @param name The name of the property we are getting.\n\t * @param defaultValue An optional value to return if the property is missing\n\t * from the object. If this is not specified and the property is missing, an\n\t * error will be thrown.\n\t */\n\tfunction getArg(aArgs, aName, aDefaultValue) {\n\t if (aName in aArgs) {\n\t return aArgs[aName];\n\t } else if (arguments.length === 3) {\n\t return aDefaultValue;\n\t } else {\n\t throw new Error('\"' + aName + '\" is a required argument.');\n\t }\n\t}\n\texports.getArg = getArg;\n\t\n\tvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\n\tvar dataUrlRegexp = /^data:.+\\,.+$/;\n\t\n\tfunction urlParse(aUrl) {\n\t var match = aUrl.match(urlRegexp);\n\t if (!match) {\n\t return null;\n\t }\n\t return {\n\t scheme: match[1],\n\t auth: match[2],\n\t host: match[3],\n\t port: match[4],\n\t path: match[5]\n\t };\n\t}\n\texports.urlParse = urlParse;\n\t\n\tfunction urlGenerate(aParsedUrl) {\n\t var url = '';\n\t if (aParsedUrl.scheme) {\n\t url += aParsedUrl.scheme + ':';\n\t }\n\t url += '//';\n\t if (aParsedUrl.auth) {\n\t url += aParsedUrl.auth + '@';\n\t }\n\t if (aParsedUrl.host) {\n\t url += aParsedUrl.host;\n\t }\n\t if (aParsedUrl.port) {\n\t url += \":\" + aParsedUrl.port\n\t }\n\t if (aParsedUrl.path) {\n\t url += aParsedUrl.path;\n\t }\n\t return url;\n\t}\n\texports.urlGenerate = urlGenerate;\n\t\n\t/**\n\t * Normalizes a path, or the path portion of a URL:\n\t *\n\t * - Replaces consecutive slashes with one slash.\n\t * - Removes unnecessary '.' parts.\n\t * - Removes unnecessary '/..' parts.\n\t *\n\t * Based on code in the Node.js 'path' core module.\n\t *\n\t * @param aPath The path or url to normalize.\n\t */\n\tfunction normalize(aPath) {\n\t var path = aPath;\n\t var url = urlParse(aPath);\n\t if (url) {\n\t if (!url.path) {\n\t return aPath;\n\t }\n\t path = url.path;\n\t }\n\t var isAbsolute = exports.isAbsolute(path);\n\t\n\t var parts = path.split(/\\/+/);\n\t for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n\t part = parts[i];\n\t if (part === '.') {\n\t parts.splice(i, 1);\n\t } else if (part === '..') {\n\t up++;\n\t } else if (up > 0) {\n\t if (part === '') {\n\t // The first part is blank if the path is absolute. Trying to go\n\t // above the root is a no-op. Therefore we can remove all '..' parts\n\t // directly after the root.\n\t parts.splice(i + 1, up);\n\t up = 0;\n\t } else {\n\t parts.splice(i, 2);\n\t up--;\n\t }\n\t }\n\t }\n\t path = parts.join('/');\n\t\n\t if (path === '') {\n\t path = isAbsolute ? '/' : '.';\n\t }\n\t\n\t if (url) {\n\t url.path = path;\n\t return urlGenerate(url);\n\t }\n\t return path;\n\t}\n\texports.normalize = normalize;\n\t\n\t/**\n\t * Joins two paths/URLs.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be joined with the root.\n\t *\n\t * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n\t * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n\t * first.\n\t * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n\t * is updated with the result and aRoot is returned. Otherwise the result\n\t * is returned.\n\t * - If aPath is absolute, the result is aPath.\n\t * - Otherwise the two paths are joined with a slash.\n\t * - Joining for example 'http://' and 'www.example.com' is also supported.\n\t */\n\tfunction join(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t if (aPath === \"\") {\n\t aPath = \".\";\n\t }\n\t var aPathUrl = urlParse(aPath);\n\t var aRootUrl = urlParse(aRoot);\n\t if (aRootUrl) {\n\t aRoot = aRootUrl.path || '/';\n\t }\n\t\n\t // `join(foo, '//www.example.org')`\n\t if (aPathUrl && !aPathUrl.scheme) {\n\t if (aRootUrl) {\n\t aPathUrl.scheme = aRootUrl.scheme;\n\t }\n\t return urlGenerate(aPathUrl);\n\t }\n\t\n\t if (aPathUrl || aPath.match(dataUrlRegexp)) {\n\t return aPath;\n\t }\n\t\n\t // `join('http://', 'www.example.com')`\n\t if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n\t aRootUrl.host = aPath;\n\t return urlGenerate(aRootUrl);\n\t }\n\t\n\t var joined = aPath.charAt(0) === '/'\n\t ? aPath\n\t : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\t\n\t if (aRootUrl) {\n\t aRootUrl.path = joined;\n\t return urlGenerate(aRootUrl);\n\t }\n\t return joined;\n\t}\n\texports.join = join;\n\t\n\texports.isAbsolute = function (aPath) {\n\t return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n\t};\n\t\n\t/**\n\t * Make a path relative to a URL or another path.\n\t *\n\t * @param aRoot The root path or URL.\n\t * @param aPath The path or URL to be made relative to aRoot.\n\t */\n\tfunction relative(aRoot, aPath) {\n\t if (aRoot === \"\") {\n\t aRoot = \".\";\n\t }\n\t\n\t aRoot = aRoot.replace(/\\/$/, '');\n\t\n\t // It is possible for the path to be above the root. In this case, simply\n\t // checking whether the root is a prefix of the path won't work. Instead, we\n\t // need to remove components from the root one by one, until either we find\n\t // a prefix that fits, or we run out of components to remove.\n\t var level = 0;\n\t while (aPath.indexOf(aRoot + '/') !== 0) {\n\t var index = aRoot.lastIndexOf(\"/\");\n\t if (index < 0) {\n\t return aPath;\n\t }\n\t\n\t // If the only part of the root that is left is the scheme (i.e. http://,\n\t // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n\t // have exhausted all components, so the path is not relative to the root.\n\t aRoot = aRoot.slice(0, index);\n\t if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n\t return aPath;\n\t }\n\t\n\t ++level;\n\t }\n\t\n\t // Make sure we add a \"../\" for each component we removed from the root.\n\t return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n\t}\n\texports.relative = relative;\n\t\n\tvar supportsNullProto = (function () {\n\t var obj = Object.create(null);\n\t return !('__proto__' in obj);\n\t}());\n\t\n\tfunction identity (s) {\n\t return s;\n\t}\n\t\n\t/**\n\t * Because behavior goes wacky when you set `__proto__` on objects, we\n\t * have to prefix all the strings in our set with an arbitrary character.\n\t *\n\t * See https://github.com/mozilla/source-map/pull/31 and\n\t * https://github.com/mozilla/source-map/issues/30\n\t *\n\t * @param String aStr\n\t */\n\tfunction toSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return '$' + aStr;\n\t }\n\t\n\t return aStr;\n\t}\n\texports.toSetString = supportsNullProto ? identity : toSetString;\n\t\n\tfunction fromSetString(aStr) {\n\t if (isProtoString(aStr)) {\n\t return aStr.slice(1);\n\t }\n\t\n\t return aStr;\n\t}\n\texports.fromSetString = supportsNullProto ? identity : fromSetString;\n\t\n\tfunction isProtoString(s) {\n\t if (!s) {\n\t return false;\n\t }\n\t\n\t var length = s.length;\n\t\n\t if (length < 9 /* \"__proto__\".length */) {\n\t return false;\n\t }\n\t\n\t if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n\t s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n\t s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n\t s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n\t s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n\t s.charCodeAt(length - 9) !== 95 /* '_' */) {\n\t return false;\n\t }\n\t\n\t for (var i = length - 10; i >= 0; i--) {\n\t if (s.charCodeAt(i) !== 36 /* '$' */) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings where the original positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same original source/line/column, but different generated\n\t * line and column the same. Useful when searching for a mapping with a\n\t * stubbed out mapping.\n\t */\n\tfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n\t var cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0 || onlyCompareOriginal) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByOriginalPositions = compareByOriginalPositions;\n\t\n\t/**\n\t * Comparator between two mappings with deflated source and name indices where\n\t * the generated positions are compared.\n\t *\n\t * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n\t * mappings with the same generated line and column, but different\n\t * source/name/original line and column the same. Useful when searching for a\n\t * mapping with a stubbed out mapping.\n\t */\n\tfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0 || onlyCompareGenerated) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\t\n\tfunction strcmp(aStr1, aStr2) {\n\t if (aStr1 === aStr2) {\n\t return 0;\n\t }\n\t\n\t if (aStr1 === null) {\n\t return 1; // aStr2 !== null\n\t }\n\t\n\t if (aStr2 === null) {\n\t return -1; // aStr1 !== null\n\t }\n\t\n\t if (aStr1 > aStr2) {\n\t return 1;\n\t }\n\t\n\t return -1;\n\t}\n\t\n\t/**\n\t * Comparator between two mappings with inflated source and name strings where\n\t * the generated positions are compared.\n\t */\n\tfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n\t var cmp = mappingA.generatedLine - mappingB.generatedLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = strcmp(mappingA.source, mappingB.source);\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalLine - mappingB.originalLine;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t cmp = mappingA.originalColumn - mappingB.originalColumn;\n\t if (cmp !== 0) {\n\t return cmp;\n\t }\n\t\n\t return strcmp(mappingA.name, mappingB.name);\n\t}\n\texports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\t\n\t/**\n\t * Strip any JSON XSSI avoidance prefix from the string (as documented\n\t * in the source maps specification), and then parse the string as\n\t * JSON.\n\t */\n\tfunction parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}\n\texports.parseSourceMapInput = parseSourceMapInput;\n\t\n\t/**\n\t * Compute the URL of a source given the the source root, the source's\n\t * URL, and the source map's URL.\n\t */\n\tfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n\t sourceURL = sourceURL || '';\n\t\n\t if (sourceRoot) {\n\t // This follows what Chrome does.\n\t if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n\t sourceRoot += '/';\n\t }\n\t // The spec says:\n\t // Line 4: An optional source root, useful for relocating source\n\t // files on a server or removing repeated values in the\n\t // “sources” entry. This value is prepended to the individual\n\t // entries in the “source” field.\n\t sourceURL = sourceRoot + sourceURL;\n\t }\n\t\n\t // Historically, SourceMapConsumer did not take the sourceMapURL as\n\t // a parameter. This mode is still somewhat supported, which is why\n\t // this code block is conditional. However, it's preferable to pass\n\t // the source map URL to SourceMapConsumer, so that this function\n\t // can implement the source URL resolution algorithm as outlined in\n\t // the spec. This block is basically the equivalent of:\n\t // new URL(sourceURL, sourceMapURL).toString()\n\t // ... except it avoids using URL, which wasn't available in the\n\t // older releases of node still supported by this library.\n\t //\n\t // The spec says:\n\t // If the sources are not absolute URLs after prepending of the\n\t // “sourceRoot”, the sources are resolved relative to the\n\t // SourceMap (like resolving script src in a html document).\n\t if (sourceMapURL) {\n\t var parsed = urlParse(sourceMapURL);\n\t if (!parsed) {\n\t throw new Error(\"sourceMapURL could not be parsed\");\n\t }\n\t if (parsed.path) {\n\t // Strip the last path component, but keep the \"/\".\n\t var index = parsed.path.lastIndexOf('/');\n\t if (index >= 0) {\n\t parsed.path = parsed.path.substring(0, index + 1);\n\t }\n\t }\n\t sourceURL = join(urlGenerate(parsed), sourceURL);\n\t }\n\t\n\t return normalize(sourceURL);\n\t}\n\texports.computeSourceURL = computeSourceURL;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar hasNativeMap = typeof Map !== \"undefined\";\n\t\n\t/**\n\t * A data structure which is a combination of an array and a set. Adding a new\n\t * member is O(1), testing for membership is O(1), and finding the index of an\n\t * element is O(1). Removing elements from the set is not supported. Only\n\t * strings are supported for membership.\n\t */\n\tfunction ArraySet() {\n\t this._array = [];\n\t this._set = hasNativeMap ? new Map() : Object.create(null);\n\t}\n\t\n\t/**\n\t * Static method for creating ArraySet instances from an existing array.\n\t */\n\tArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n\t var set = new ArraySet();\n\t for (var i = 0, len = aArray.length; i < len; i++) {\n\t set.add(aArray[i], aAllowDuplicates);\n\t }\n\t return set;\n\t};\n\t\n\t/**\n\t * Return how many unique items are in this ArraySet. If duplicates have been\n\t * added, than those do not count towards the size.\n\t *\n\t * @returns Number\n\t */\n\tArraySet.prototype.size = function ArraySet_size() {\n\t return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n\t};\n\t\n\t/**\n\t * Add the given string to this set.\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n\t var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n\t var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n\t var idx = this._array.length;\n\t if (!isDuplicate || aAllowDuplicates) {\n\t this._array.push(aStr);\n\t }\n\t if (!isDuplicate) {\n\t if (hasNativeMap) {\n\t this._set.set(aStr, idx);\n\t } else {\n\t this._set[sStr] = idx;\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Is the given string a member of this set?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.has = function ArraySet_has(aStr) {\n\t if (hasNativeMap) {\n\t return this._set.has(aStr);\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t return has.call(this._set, sStr);\n\t }\n\t};\n\t\n\t/**\n\t * What is the index of the given string in the array?\n\t *\n\t * @param String aStr\n\t */\n\tArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n\t if (hasNativeMap) {\n\t var idx = this._set.get(aStr);\n\t if (idx >= 0) {\n\t return idx;\n\t }\n\t } else {\n\t var sStr = util.toSetString(aStr);\n\t if (has.call(this._set, sStr)) {\n\t return this._set[sStr];\n\t }\n\t }\n\t\n\t throw new Error('\"' + aStr + '\" is not in the set.');\n\t};\n\t\n\t/**\n\t * What is the element at the given index?\n\t *\n\t * @param Number aIdx\n\t */\n\tArraySet.prototype.at = function ArraySet_at(aIdx) {\n\t if (aIdx >= 0 && aIdx < this._array.length) {\n\t return this._array[aIdx];\n\t }\n\t throw new Error('No element indexed by ' + aIdx);\n\t};\n\t\n\t/**\n\t * Returns the array representation of this set (which has the proper indices\n\t * indicated by indexOf). Note that this is a copy of the internal array used\n\t * for storing the members so that no one can mess with internal state.\n\t */\n\tArraySet.prototype.toArray = function ArraySet_toArray() {\n\t return this._array.slice();\n\t};\n\t\n\texports.ArraySet = ArraySet;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2014 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\t\n\t/**\n\t * Determine whether mappingB is after mappingA with respect to generated\n\t * position.\n\t */\n\tfunction generatedPositionAfter(mappingA, mappingB) {\n\t // Optimized for most common case\n\t var lineA = mappingA.generatedLine;\n\t var lineB = mappingB.generatedLine;\n\t var columnA = mappingA.generatedColumn;\n\t var columnB = mappingB.generatedColumn;\n\t return lineB > lineA || lineB == lineA && columnB >= columnA ||\n\t util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n\t}\n\t\n\t/**\n\t * A data structure to provide a sorted view of accumulated mappings in a\n\t * performance conscious manner. It trades a neglibable overhead in general\n\t * case for a large speedup in case of mappings being added in order.\n\t */\n\tfunction MappingList() {\n\t this._array = [];\n\t this._sorted = true;\n\t // Serves as infimum\n\t this._last = {generatedLine: -1, generatedColumn: 0};\n\t}\n\t\n\t/**\n\t * Iterate through internal items. This method takes the same arguments that\n\t * `Array.prototype.forEach` takes.\n\t *\n\t * NOTE: The order of the mappings is NOT guaranteed.\n\t */\n\tMappingList.prototype.unsortedForEach =\n\t function MappingList_forEach(aCallback, aThisArg) {\n\t this._array.forEach(aCallback, aThisArg);\n\t };\n\t\n\t/**\n\t * Add the given source mapping.\n\t *\n\t * @param Object aMapping\n\t */\n\tMappingList.prototype.add = function MappingList_add(aMapping) {\n\t if (generatedPositionAfter(this._last, aMapping)) {\n\t this._last = aMapping;\n\t this._array.push(aMapping);\n\t } else {\n\t this._sorted = false;\n\t this._array.push(aMapping);\n\t }\n\t};\n\t\n\t/**\n\t * Returns the flat, sorted array of mappings. The mappings are sorted by\n\t * generated position.\n\t *\n\t * WARNING: This method returns internal data without copying, for\n\t * performance. The return value must NOT be mutated, and should be treated as\n\t * an immutable borrow. If you want to take ownership, you must make your own\n\t * copy.\n\t */\n\tMappingList.prototype.toArray = function MappingList_toArray() {\n\t if (!this._sorted) {\n\t this._array.sort(util.compareByGeneratedPositionsInflated);\n\t this._sorted = true;\n\t }\n\t return this._array;\n\t};\n\t\n\texports.MappingList = MappingList;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar util = __webpack_require__(4);\n\tvar binarySearch = __webpack_require__(8);\n\tvar ArraySet = __webpack_require__(5).ArraySet;\n\tvar base64VLQ = __webpack_require__(2);\n\tvar quickSort = __webpack_require__(9).quickSort;\n\t\n\tfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t return sourceMap.sections != null\n\t ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n\t : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n\t}\n\t\n\tSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n\t return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n\t}\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tSourceMapConsumer.prototype._version = 3;\n\t\n\t// `__generatedMappings` and `__originalMappings` are arrays that hold the\n\t// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n\t// are lazily instantiated, accessed via the `_generatedMappings` and\n\t// `_originalMappings` getters respectively, and we only parse the mappings\n\t// and create these arrays once queried for a source location. We jump through\n\t// these hoops because there can be many thousands of mappings, and parsing\n\t// them is expensive, so we only want to do it if we must.\n\t//\n\t// Each object in the arrays is of the form:\n\t//\n\t// {\n\t// generatedLine: The line number in the generated code,\n\t// generatedColumn: The column number in the generated code,\n\t// source: The path to the original source file that generated this\n\t// chunk of code,\n\t// originalLine: The line number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// originalColumn: The column number in the original source that\n\t// corresponds to this chunk of generated code,\n\t// name: The name of the original symbol which generated this chunk of\n\t// code.\n\t// }\n\t//\n\t// All properties except for `generatedLine` and `generatedColumn` can be\n\t// `null`.\n\t//\n\t// `_generatedMappings` is ordered by the generated positions.\n\t//\n\t// `_originalMappings` is ordered by the original positions.\n\t\n\tSourceMapConsumer.prototype.__generatedMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__generatedMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__generatedMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype.__originalMappings = null;\n\tObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n\t configurable: true,\n\t enumerable: true,\n\t get: function () {\n\t if (!this.__originalMappings) {\n\t this._parseMappings(this._mappings, this.sourceRoot);\n\t }\n\t\n\t return this.__originalMappings;\n\t }\n\t});\n\t\n\tSourceMapConsumer.prototype._charIsMappingSeparator =\n\t function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n\t var c = aStr.charAt(index);\n\t return c === \";\" || c === \",\";\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t throw new Error(\"Subclasses must implement _parseMappings\");\n\t };\n\t\n\tSourceMapConsumer.GENERATED_ORDER = 1;\n\tSourceMapConsumer.ORIGINAL_ORDER = 2;\n\t\n\tSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\n\tSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Iterate over each mapping between an original source/line/column and a\n\t * generated line/column in this source map.\n\t *\n\t * @param Function aCallback\n\t * The function that is called with each mapping.\n\t * @param Object aContext\n\t * Optional. If specified, this object will be the value of `this` every\n\t * time that `aCallback` is called.\n\t * @param aOrder\n\t * Either `SourceMapConsumer.GENERATED_ORDER` or\n\t * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n\t * iterate over the mappings sorted by the generated file's line/column\n\t * order or the original's source/line/column order, respectively. Defaults to\n\t * `SourceMapConsumer.GENERATED_ORDER`.\n\t */\n\tSourceMapConsumer.prototype.eachMapping =\n\t function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n\t var context = aContext || null;\n\t var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\t\n\t var mappings;\n\t switch (order) {\n\t case SourceMapConsumer.GENERATED_ORDER:\n\t mappings = this._generatedMappings;\n\t break;\n\t case SourceMapConsumer.ORIGINAL_ORDER:\n\t mappings = this._originalMappings;\n\t break;\n\t default:\n\t throw new Error(\"Unknown order of iteration.\");\n\t }\n\t\n\t var sourceRoot = this.sourceRoot;\n\t mappings.map(function (mapping) {\n\t var source = mapping.source === null ? null : this._sources.at(mapping.source);\n\t source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n\t return {\n\t source: source,\n\t generatedLine: mapping.generatedLine,\n\t generatedColumn: mapping.generatedColumn,\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: mapping.name === null ? null : this._names.at(mapping.name)\n\t };\n\t }, this).forEach(aCallback, context);\n\t };\n\t\n\t/**\n\t * Returns all generated line and column information for the original source,\n\t * line, and column provided. If no column is provided, returns all mappings\n\t * corresponding to a either the line we are searching for or the next\n\t * closest line that has any mappings. Otherwise, returns all mappings\n\t * corresponding to the given line and either the column we are searching for\n\t * or the next closest column that has any offsets.\n\t *\n\t * The only argument is an object with the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number is 1-based.\n\t * - column: Optional. the column number in the original source.\n\t * The column number is 0-based.\n\t *\n\t * and an array of objects is returned, each with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tSourceMapConsumer.prototype.allGeneratedPositionsFor =\n\t function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n\t var line = util.getArg(aArgs, 'line');\n\t\n\t // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n\t // returns the index of the closest mapping less than the needle. By\n\t // setting needle.originalColumn to 0, we thus find the last mapping for\n\t // the given line, provided such a mapping exists.\n\t var needle = {\n\t source: util.getArg(aArgs, 'source'),\n\t originalLine: line,\n\t originalColumn: util.getArg(aArgs, 'column', 0)\n\t };\n\t\n\t needle.source = this._findSourceIndex(needle.source);\n\t if (needle.source < 0) {\n\t return [];\n\t }\n\t\n\t var mappings = [];\n\t\n\t var index = this._findMapping(needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t binarySearch.LEAST_UPPER_BOUND);\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (aArgs.column === undefined) {\n\t var originalLine = mapping.originalLine;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we found. Since\n\t // mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we found.\n\t while (mapping && mapping.originalLine === originalLine) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t } else {\n\t var originalColumn = mapping.originalColumn;\n\t\n\t // Iterate until either we run out of mappings, or we run into\n\t // a mapping for a different line than the one we were searching for.\n\t // Since mappings are sorted, this is guaranteed to find all mappings for\n\t // the line we are searching for.\n\t while (mapping &&\n\t mapping.originalLine === line &&\n\t mapping.originalColumn == originalColumn) {\n\t mappings.push({\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t });\n\t\n\t mapping = this._originalMappings[++index];\n\t }\n\t }\n\t }\n\t\n\t return mappings;\n\t };\n\t\n\texports.SourceMapConsumer = SourceMapConsumer;\n\t\n\t/**\n\t * A BasicSourceMapConsumer instance represents a parsed source map which we can\n\t * query for information about the original file positions by giving it a file\n\t * position in the generated source.\n\t *\n\t * The first parameter is the raw source map (either as a JSON string, or\n\t * already parsed to an object). According to the spec, source maps have the\n\t * following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - sources: An array of URLs to the original source files.\n\t * - names: An array of identifiers which can be referrenced by individual mappings.\n\t * - sourceRoot: Optional. The URL root from which all sources are relative.\n\t * - sourcesContent: Optional. An array of contents of the original source files.\n\t * - mappings: A string of base64 VLQs which contain the actual mappings.\n\t * - file: Optional. The generated file this source map is associated with.\n\t *\n\t * Here is an example source map, taken from the source map spec[0]:\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"out.js\",\n\t * sourceRoot : \"\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AA,AB;;ABCDE;\"\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n\t */\n\tfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sources = util.getArg(sourceMap, 'sources');\n\t // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n\t // requires the array) to play nice here.\n\t var names = util.getArg(sourceMap, 'names', []);\n\t var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n\t var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n\t var mappings = util.getArg(sourceMap, 'mappings');\n\t var file = util.getArg(sourceMap, 'file', null);\n\t\n\t // Once again, Sass deviates from the spec and supplies the version as a\n\t // string rather than a number, so we use loose equality checking here.\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t if (sourceRoot) {\n\t sourceRoot = util.normalize(sourceRoot);\n\t }\n\t\n\t sources = sources\n\t .map(String)\n\t // Some source maps produce relative source paths like \"./foo.js\" instead of\n\t // \"foo.js\". Normalize these first so that future comparisons will succeed.\n\t // See bugzil.la/1090768.\n\t .map(util.normalize)\n\t // Always ensure that absolute sources are internally stored relative to\n\t // the source root, if the source root is absolute. Not doing this would\n\t // be particularly problematic when the source root is a prefix of the\n\t // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n\t .map(function (source) {\n\t return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n\t ? util.relative(sourceRoot, source)\n\t : source;\n\t });\n\t\n\t // Pass `true` below to allow duplicate names and sources. While source maps\n\t // are intended to be compressed and deduplicated, the TypeScript compiler\n\t // sometimes generates source maps with duplicates in them. See Github issue\n\t // #72 and bugzil.la/889492.\n\t this._names = ArraySet.fromArray(names.map(String), true);\n\t this._sources = ArraySet.fromArray(sources, true);\n\t\n\t this._absoluteSources = this._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t this.sourceRoot = sourceRoot;\n\t this.sourcesContent = sourcesContent;\n\t this._mappings = mappings;\n\t this._sourceMapURL = aSourceMapURL;\n\t this.file = file;\n\t}\n\t\n\tBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\t\n\t/**\n\t * Utility function to find the index of a source. Returns -1 if not\n\t * found.\n\t */\n\tBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t if (this._sources.has(relativeSource)) {\n\t return this._sources.indexOf(relativeSource);\n\t }\n\t\n\t // Maybe aSource is an absolute URL as returned by |sources|. In\n\t // this case we can't simply undo the transform.\n\t var i;\n\t for (i = 0; i < this._absoluteSources.length; ++i) {\n\t if (this._absoluteSources[i] == aSource) {\n\t return i;\n\t }\n\t }\n\t\n\t return -1;\n\t};\n\t\n\t/**\n\t * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n\t *\n\t * @param SourceMapGenerator aSourceMap\n\t * The source map that will be consumed.\n\t * @param String aSourceMapURL\n\t * The URL at which the source map can be found (optional)\n\t * @returns BasicSourceMapConsumer\n\t */\n\tBasicSourceMapConsumer.fromSourceMap =\n\t function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n\t var smc = Object.create(BasicSourceMapConsumer.prototype);\n\t\n\t var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n\t var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n\t smc.sourceRoot = aSourceMap._sourceRoot;\n\t smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n\t smc.sourceRoot);\n\t smc.file = aSourceMap._file;\n\t smc._sourceMapURL = aSourceMapURL;\n\t smc._absoluteSources = smc._sources.toArray().map(function (s) {\n\t return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n\t });\n\t\n\t // Because we are modifying the entries (by converting string sources and\n\t // names to indices into the sources and names ArraySets), we have to make\n\t // a copy of the entry or else bad things happen. Shared mutable state\n\t // strikes again! See github issue #191.\n\t\n\t var generatedMappings = aSourceMap._mappings.toArray().slice();\n\t var destGeneratedMappings = smc.__generatedMappings = [];\n\t var destOriginalMappings = smc.__originalMappings = [];\n\t\n\t for (var i = 0, length = generatedMappings.length; i < length; i++) {\n\t var srcMapping = generatedMappings[i];\n\t var destMapping = new Mapping;\n\t destMapping.generatedLine = srcMapping.generatedLine;\n\t destMapping.generatedColumn = srcMapping.generatedColumn;\n\t\n\t if (srcMapping.source) {\n\t destMapping.source = sources.indexOf(srcMapping.source);\n\t destMapping.originalLine = srcMapping.originalLine;\n\t destMapping.originalColumn = srcMapping.originalColumn;\n\t\n\t if (srcMapping.name) {\n\t destMapping.name = names.indexOf(srcMapping.name);\n\t }\n\t\n\t destOriginalMappings.push(destMapping);\n\t }\n\t\n\t destGeneratedMappings.push(destMapping);\n\t }\n\t\n\t quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\t\n\t return smc;\n\t };\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tBasicSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t return this._absoluteSources.slice();\n\t }\n\t});\n\t\n\t/**\n\t * Provide the JIT with a nice shape / hidden class.\n\t */\n\tfunction Mapping() {\n\t this.generatedLine = 0;\n\t this.generatedColumn = 0;\n\t this.source = null;\n\t this.originalLine = null;\n\t this.originalColumn = null;\n\t this.name = null;\n\t}\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tBasicSourceMapConsumer.prototype._parseMappings =\n\t function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t var generatedLine = 1;\n\t var previousGeneratedColumn = 0;\n\t var previousOriginalLine = 0;\n\t var previousOriginalColumn = 0;\n\t var previousSource = 0;\n\t var previousName = 0;\n\t var length = aStr.length;\n\t var index = 0;\n\t var cachedSegments = {};\n\t var temp = {};\n\t var originalMappings = [];\n\t var generatedMappings = [];\n\t var mapping, str, segment, end, value;\n\t\n\t while (index < length) {\n\t if (aStr.charAt(index) === ';') {\n\t generatedLine++;\n\t index++;\n\t previousGeneratedColumn = 0;\n\t }\n\t else if (aStr.charAt(index) === ',') {\n\t index++;\n\t }\n\t else {\n\t mapping = new Mapping();\n\t mapping.generatedLine = generatedLine;\n\t\n\t // Because each offset is encoded relative to the previous one,\n\t // many segments often have the same encoding. We can exploit this\n\t // fact by caching the parsed variable length fields of each segment,\n\t // allowing us to avoid a second parse if we encounter the same\n\t // segment again.\n\t for (end = index; end < length; end++) {\n\t if (this._charIsMappingSeparator(aStr, end)) {\n\t break;\n\t }\n\t }\n\t str = aStr.slice(index, end);\n\t\n\t segment = cachedSegments[str];\n\t if (segment) {\n\t index += str.length;\n\t } else {\n\t segment = [];\n\t while (index < end) {\n\t base64VLQ.decode(aStr, index, temp);\n\t value = temp.value;\n\t index = temp.rest;\n\t segment.push(value);\n\t }\n\t\n\t if (segment.length === 2) {\n\t throw new Error('Found a source, but no line and column');\n\t }\n\t\n\t if (segment.length === 3) {\n\t throw new Error('Found a source and line, but no column');\n\t }\n\t\n\t cachedSegments[str] = segment;\n\t }\n\t\n\t // Generated column.\n\t mapping.generatedColumn = previousGeneratedColumn + segment[0];\n\t previousGeneratedColumn = mapping.generatedColumn;\n\t\n\t if (segment.length > 1) {\n\t // Original source.\n\t mapping.source = previousSource + segment[1];\n\t previousSource += segment[1];\n\t\n\t // Original line.\n\t mapping.originalLine = previousOriginalLine + segment[2];\n\t previousOriginalLine = mapping.originalLine;\n\t // Lines are stored 0-based\n\t mapping.originalLine += 1;\n\t\n\t // Original column.\n\t mapping.originalColumn = previousOriginalColumn + segment[3];\n\t previousOriginalColumn = mapping.originalColumn;\n\t\n\t if (segment.length > 4) {\n\t // Original name.\n\t mapping.name = previousName + segment[4];\n\t previousName += segment[4];\n\t }\n\t }\n\t\n\t generatedMappings.push(mapping);\n\t if (typeof mapping.originalLine === 'number') {\n\t originalMappings.push(mapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t this.__generatedMappings = generatedMappings;\n\t\n\t quickSort(originalMappings, util.compareByOriginalPositions);\n\t this.__originalMappings = originalMappings;\n\t };\n\t\n\t/**\n\t * Find the mapping that best matches the hypothetical \"needle\" mapping that\n\t * we are searching for in the given \"haystack\" of mappings.\n\t */\n\tBasicSourceMapConsumer.prototype._findMapping =\n\t function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n\t aColumnName, aComparator, aBias) {\n\t // To return the position we are searching for, we must first find the\n\t // mapping for the given position and then return the opposite position it\n\t // points to. Because the mappings are sorted, we can use binary search to\n\t // find the best mapping.\n\t\n\t if (aNeedle[aLineName] <= 0) {\n\t throw new TypeError('Line must be greater than or equal to 1, got '\n\t + aNeedle[aLineName]);\n\t }\n\t if (aNeedle[aColumnName] < 0) {\n\t throw new TypeError('Column must be greater than or equal to 0, got '\n\t + aNeedle[aColumnName]);\n\t }\n\t\n\t return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n\t };\n\t\n\t/**\n\t * Compute the last column for each generated mapping. The last column is\n\t * inclusive.\n\t */\n\tBasicSourceMapConsumer.prototype.computeColumnSpans =\n\t function SourceMapConsumer_computeColumnSpans() {\n\t for (var index = 0; index < this._generatedMappings.length; ++index) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t // Mappings do not contain a field for the last generated columnt. We\n\t // can come up with an optimistic estimate, however, by assuming that\n\t // mappings are contiguous (i.e. given two consecutive mappings, the\n\t // first mapping ends where the second one starts).\n\t if (index + 1 < this._generatedMappings.length) {\n\t var nextMapping = this._generatedMappings[index + 1];\n\t\n\t if (mapping.generatedLine === nextMapping.generatedLine) {\n\t mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n\t continue;\n\t }\n\t }\n\t\n\t // The last mapping for each line spans the entire line.\n\t mapping.lastGeneratedColumn = Infinity;\n\t }\n\t };\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tBasicSourceMapConsumer.prototype.originalPositionFor =\n\t function SourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._generatedMappings,\n\t \"generatedLine\",\n\t \"generatedColumn\",\n\t util.compareByGeneratedPositionsDeflated,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._generatedMappings[index];\n\t\n\t if (mapping.generatedLine === needle.generatedLine) {\n\t var source = util.getArg(mapping, 'source', null);\n\t if (source !== null) {\n\t source = this._sources.at(source);\n\t source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n\t }\n\t var name = util.getArg(mapping, 'name', null);\n\t if (name !== null) {\n\t name = this._names.at(name);\n\t }\n\t return {\n\t source: source,\n\t line: util.getArg(mapping, 'originalLine', null),\n\t column: util.getArg(mapping, 'originalColumn', null),\n\t name: name\n\t };\n\t }\n\t }\n\t\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function BasicSourceMapConsumer_hasContentsOfAllSources() {\n\t if (!this.sourcesContent) {\n\t return false;\n\t }\n\t return this.sourcesContent.length >= this._sources.size() &&\n\t !this.sourcesContent.some(function (sc) { return sc == null; });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tBasicSourceMapConsumer.prototype.sourceContentFor =\n\t function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t if (!this.sourcesContent) {\n\t return null;\n\t }\n\t\n\t var index = this._findSourceIndex(aSource);\n\t if (index >= 0) {\n\t return this.sourcesContent[index];\n\t }\n\t\n\t var relativeSource = aSource;\n\t if (this.sourceRoot != null) {\n\t relativeSource = util.relative(this.sourceRoot, relativeSource);\n\t }\n\t\n\t var url;\n\t if (this.sourceRoot != null\n\t && (url = util.urlParse(this.sourceRoot))) {\n\t // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n\t // many users. We can help them out when they expect file:// URIs to\n\t // behave like it would if they were running a local HTTP server. See\n\t // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n\t var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n\t if (url.scheme == \"file\"\n\t && this._sources.has(fileUriAbsPath)) {\n\t return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n\t }\n\t\n\t if ((!url.path || url.path == \"/\")\n\t && this._sources.has(\"/\" + relativeSource)) {\n\t return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n\t }\n\t }\n\t\n\t // This function is used recursively from\n\t // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n\t // don't want to throw if we can't find the source - we just want to\n\t // return null, so we provide a flag to exit gracefully.\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n\t * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tBasicSourceMapConsumer.prototype.generatedPositionFor =\n\t function SourceMapConsumer_generatedPositionFor(aArgs) {\n\t var source = util.getArg(aArgs, 'source');\n\t source = this._findSourceIndex(source);\n\t if (source < 0) {\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t }\n\t\n\t var needle = {\n\t source: source,\n\t originalLine: util.getArg(aArgs, 'line'),\n\t originalColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t var index = this._findMapping(\n\t needle,\n\t this._originalMappings,\n\t \"originalLine\",\n\t \"originalColumn\",\n\t util.compareByOriginalPositions,\n\t util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n\t );\n\t\n\t if (index >= 0) {\n\t var mapping = this._originalMappings[index];\n\t\n\t if (mapping.source === needle.source) {\n\t return {\n\t line: util.getArg(mapping, 'generatedLine', null),\n\t column: util.getArg(mapping, 'generatedColumn', null),\n\t lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n\t };\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null,\n\t lastColumn: null\n\t };\n\t };\n\t\n\texports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\t\n\t/**\n\t * An IndexedSourceMapConsumer instance represents a parsed source map which\n\t * we can query for information. It differs from BasicSourceMapConsumer in\n\t * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n\t * input.\n\t *\n\t * The first parameter is a raw source map (either as a JSON string, or already\n\t * parsed to an object). According to the spec for indexed source maps, they\n\t * have the following attributes:\n\t *\n\t * - version: Which version of the source map spec this map is following.\n\t * - file: Optional. The generated file this source map is associated with.\n\t * - sections: A list of section definitions.\n\t *\n\t * Each value under the \"sections\" field has two fields:\n\t * - offset: The offset into the original specified at which this section\n\t * begins to apply, defined as an object with a \"line\" and \"column\"\n\t * field.\n\t * - map: A source map definition. This source map could also be indexed,\n\t * but doesn't have to be.\n\t *\n\t * Instead of the \"map\" field, it's also possible to have a \"url\" field\n\t * specifying a URL to retrieve a source map from, but that's currently\n\t * unsupported.\n\t *\n\t * Here's an example source map, taken from the source map spec[0], but\n\t * modified to omit a section which uses the \"url\" field.\n\t *\n\t * {\n\t * version : 3,\n\t * file: \"app.js\",\n\t * sections: [{\n\t * offset: {line:100, column:10},\n\t * map: {\n\t * version : 3,\n\t * file: \"section.js\",\n\t * sources: [\"foo.js\", \"bar.js\"],\n\t * names: [\"src\", \"maps\", \"are\", \"fun\"],\n\t * mappings: \"AAAA,E;;ABCDE;\"\n\t * }\n\t * }],\n\t * }\n\t *\n\t * The second parameter, if given, is a string whose value is the URL\n\t * at which the source map was found. This URL is used to compute the\n\t * sources array.\n\t *\n\t * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n\t */\n\tfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n\t var sourceMap = aSourceMap;\n\t if (typeof aSourceMap === 'string') {\n\t sourceMap = util.parseSourceMapInput(aSourceMap);\n\t }\n\t\n\t var version = util.getArg(sourceMap, 'version');\n\t var sections = util.getArg(sourceMap, 'sections');\n\t\n\t if (version != this._version) {\n\t throw new Error('Unsupported version: ' + version);\n\t }\n\t\n\t this._sources = new ArraySet();\n\t this._names = new ArraySet();\n\t\n\t var lastOffset = {\n\t line: -1,\n\t column: 0\n\t };\n\t this._sections = sections.map(function (s) {\n\t if (s.url) {\n\t // The url field will require support for asynchronicity.\n\t // See https://github.com/mozilla/source-map/issues/16\n\t throw new Error('Support for url field in sections not implemented.');\n\t }\n\t var offset = util.getArg(s, 'offset');\n\t var offsetLine = util.getArg(offset, 'line');\n\t var offsetColumn = util.getArg(offset, 'column');\n\t\n\t if (offsetLine < lastOffset.line ||\n\t (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n\t throw new Error('Section offsets must be ordered and non-overlapping.');\n\t }\n\t lastOffset = offset;\n\t\n\t return {\n\t generatedOffset: {\n\t // The offset fields are 0-based, but we use 1-based indices when\n\t // encoding/decoding from VLQ.\n\t generatedLine: offsetLine + 1,\n\t generatedColumn: offsetColumn + 1\n\t },\n\t consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n\t }\n\t });\n\t}\n\t\n\tIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\n\tIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\t\n\t/**\n\t * The version of the source mapping spec that we are consuming.\n\t */\n\tIndexedSourceMapConsumer.prototype._version = 3;\n\t\n\t/**\n\t * The list of original sources.\n\t */\n\tObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n\t get: function () {\n\t var sources = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n\t sources.push(this._sections[i].consumer.sources[j]);\n\t }\n\t }\n\t return sources;\n\t }\n\t});\n\t\n\t/**\n\t * Returns the original source, line, and column information for the generated\n\t * source's line and column positions provided. The only argument is an object\n\t * with the following properties:\n\t *\n\t * - line: The line number in the generated source. The line number\n\t * is 1-based.\n\t * - column: The column number in the generated source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - source: The original source file, or null.\n\t * - line: The line number in the original source, or null. The\n\t * line number is 1-based.\n\t * - column: The column number in the original source, or null. The\n\t * column number is 0-based.\n\t * - name: The original identifier, or null.\n\t */\n\tIndexedSourceMapConsumer.prototype.originalPositionFor =\n\t function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n\t var needle = {\n\t generatedLine: util.getArg(aArgs, 'line'),\n\t generatedColumn: util.getArg(aArgs, 'column')\n\t };\n\t\n\t // Find the section containing the generated position we're trying to map\n\t // to an original position.\n\t var sectionIndex = binarySearch.search(needle, this._sections,\n\t function(needle, section) {\n\t var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n\t if (cmp) {\n\t return cmp;\n\t }\n\t\n\t return (needle.generatedColumn -\n\t section.generatedOffset.generatedColumn);\n\t });\n\t var section = this._sections[sectionIndex];\n\t\n\t if (!section) {\n\t return {\n\t source: null,\n\t line: null,\n\t column: null,\n\t name: null\n\t };\n\t }\n\t\n\t return section.consumer.originalPositionFor({\n\t line: needle.generatedLine -\n\t (section.generatedOffset.generatedLine - 1),\n\t column: needle.generatedColumn -\n\t (section.generatedOffset.generatedLine === needle.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t bias: aArgs.bias\n\t });\n\t };\n\t\n\t/**\n\t * Return true if we have the source content for every source in the source\n\t * map, false otherwise.\n\t */\n\tIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n\t function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n\t return this._sections.every(function (s) {\n\t return s.consumer.hasContentsOfAllSources();\n\t });\n\t };\n\t\n\t/**\n\t * Returns the original source content. The only argument is the url of the\n\t * original source file. Returns null if no original source content is\n\t * available.\n\t */\n\tIndexedSourceMapConsumer.prototype.sourceContentFor =\n\t function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t var content = section.consumer.sourceContentFor(aSource, true);\n\t if (content) {\n\t return content;\n\t }\n\t }\n\t if (nullOnMissing) {\n\t return null;\n\t }\n\t else {\n\t throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n\t }\n\t };\n\t\n\t/**\n\t * Returns the generated line and column information for the original source,\n\t * line, and column positions provided. The only argument is an object with\n\t * the following properties:\n\t *\n\t * - source: The filename of the original source.\n\t * - line: The line number in the original source. The line number\n\t * is 1-based.\n\t * - column: The column number in the original source. The column\n\t * number is 0-based.\n\t *\n\t * and an object is returned with the following properties:\n\t *\n\t * - line: The line number in the generated source, or null. The\n\t * line number is 1-based. \n\t * - column: The column number in the generated source, or null.\n\t * The column number is 0-based.\n\t */\n\tIndexedSourceMapConsumer.prototype.generatedPositionFor =\n\t function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t\n\t // Only consider this section if the requested source is in the list of\n\t // sources of the consumer.\n\t if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n\t continue;\n\t }\n\t var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n\t if (generatedPosition) {\n\t var ret = {\n\t line: generatedPosition.line +\n\t (section.generatedOffset.generatedLine - 1),\n\t column: generatedPosition.column +\n\t (section.generatedOffset.generatedLine === generatedPosition.line\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0)\n\t };\n\t return ret;\n\t }\n\t }\n\t\n\t return {\n\t line: null,\n\t column: null\n\t };\n\t };\n\t\n\t/**\n\t * Parse the mappings in a string in to a data structure which we can easily\n\t * query (the ordered arrays in the `this.__generatedMappings` and\n\t * `this.__originalMappings` properties).\n\t */\n\tIndexedSourceMapConsumer.prototype._parseMappings =\n\t function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n\t this.__generatedMappings = [];\n\t this.__originalMappings = [];\n\t for (var i = 0; i < this._sections.length; i++) {\n\t var section = this._sections[i];\n\t var sectionMappings = section.consumer._generatedMappings;\n\t for (var j = 0; j < sectionMappings.length; j++) {\n\t var mapping = sectionMappings[j];\n\t\n\t var source = section.consumer._sources.at(mapping.source);\n\t source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n\t this._sources.add(source);\n\t source = this._sources.indexOf(source);\n\t\n\t var name = null;\n\t if (mapping.name) {\n\t name = section.consumer._names.at(mapping.name);\n\t this._names.add(name);\n\t name = this._names.indexOf(name);\n\t }\n\t\n\t // The mappings coming from the consumer for the section have\n\t // generated positions relative to the start of the section, so we\n\t // need to offset them to be relative to the start of the concatenated\n\t // generated file.\n\t var adjustedMapping = {\n\t source: source,\n\t generatedLine: mapping.generatedLine +\n\t (section.generatedOffset.generatedLine - 1),\n\t generatedColumn: mapping.generatedColumn +\n\t (section.generatedOffset.generatedLine === mapping.generatedLine\n\t ? section.generatedOffset.generatedColumn - 1\n\t : 0),\n\t originalLine: mapping.originalLine,\n\t originalColumn: mapping.originalColumn,\n\t name: name\n\t };\n\t\n\t this.__generatedMappings.push(adjustedMapping);\n\t if (typeof adjustedMapping.originalLine === 'number') {\n\t this.__originalMappings.push(adjustedMapping);\n\t }\n\t }\n\t }\n\t\n\t quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n\t quickSort(this.__originalMappings, util.compareByOriginalPositions);\n\t };\n\t\n\texports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\texports.GREATEST_LOWER_BOUND = 1;\n\texports.LEAST_UPPER_BOUND = 2;\n\t\n\t/**\n\t * Recursive implementation of binary search.\n\t *\n\t * @param aLow Indices here and lower do not contain the needle.\n\t * @param aHigh Indices here and higher do not contain the needle.\n\t * @param aNeedle The element being searched for.\n\t * @param aHaystack The non-empty array being searched.\n\t * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t */\n\tfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n\t // This function terminates when one of the following is true:\n\t //\n\t // 1. We find the exact element we are looking for.\n\t //\n\t // 2. We did not find the exact element, but we can return the index of\n\t // the next-closest element.\n\t //\n\t // 3. We did not find the exact element, and there is no next-closest\n\t // element than the one we are searching for, so we return -1.\n\t var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n\t var cmp = aCompare(aNeedle, aHaystack[mid], true);\n\t if (cmp === 0) {\n\t // Found the element we are looking for.\n\t return mid;\n\t }\n\t else if (cmp > 0) {\n\t // Our needle is greater than aHaystack[mid].\n\t if (aHigh - mid > 1) {\n\t // The element is in the upper half.\n\t return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // The exact needle element was not found in this haystack. Determine if\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return aHigh < aHaystack.length ? aHigh : -1;\n\t } else {\n\t return mid;\n\t }\n\t }\n\t else {\n\t // Our needle is less than aHaystack[mid].\n\t if (mid - aLow > 1) {\n\t // The element is in the lower half.\n\t return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n\t }\n\t\n\t // we are in termination case (3) or (2) and return the appropriate thing.\n\t if (aBias == exports.LEAST_UPPER_BOUND) {\n\t return mid;\n\t } else {\n\t return aLow < 0 ? -1 : aLow;\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * This is an implementation of binary search which will always try and return\n\t * the index of the closest element if there is no exact hit. This is because\n\t * mappings between original and generated line/col pairs are single points,\n\t * and there is an implicit region between each of them, so a miss just means\n\t * that you aren't on the very start of a region.\n\t *\n\t * @param aNeedle The element you are looking for.\n\t * @param aHaystack The array that is being searched.\n\t * @param aCompare A function which takes the needle and an element in the\n\t * array and returns -1, 0, or 1 depending on whether the needle is less\n\t * than, equal to, or greater than the element, respectively.\n\t * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n\t * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n\t * closest element that is smaller than or greater than the one we are\n\t * searching for, respectively, if the exact element cannot be found.\n\t * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n\t */\n\texports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n\t if (aHaystack.length === 0) {\n\t return -1;\n\t }\n\t\n\t var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n\t aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n\t if (index < 0) {\n\t return -1;\n\t }\n\t\n\t // We have found either the exact element, or the next-closest element than\n\t // the one we are searching for. However, there may be more than one such\n\t // element. Make sure we always return the smallest of these.\n\t while (index - 1 >= 0) {\n\t if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n\t break;\n\t }\n\t --index;\n\t }\n\t\n\t return index;\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\t// It turns out that some (most?) JavaScript engines don't self-host\n\t// `Array.prototype.sort`. This makes sense because C++ will likely remain\n\t// faster than JS when doing raw CPU-intensive sorting. However, when using a\n\t// custom comparator function, calling back and forth between the VM's C++ and\n\t// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n\t// worse generated code for the comparator function than would be optimal. In\n\t// fact, when sorting with a comparator, these costs outweigh the benefits of\n\t// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n\t// a ~3500ms mean speed-up in `bench/bench.html`.\n\t\n\t/**\n\t * Swap the elements indexed by `x` and `y` in the array `ary`.\n\t *\n\t * @param {Array} ary\n\t * The array.\n\t * @param {Number} x\n\t * The index of the first item.\n\t * @param {Number} y\n\t * The index of the second item.\n\t */\n\tfunction swap(ary, x, y) {\n\t var temp = ary[x];\n\t ary[x] = ary[y];\n\t ary[y] = temp;\n\t}\n\t\n\t/**\n\t * Returns a random integer within the range `low .. high` inclusive.\n\t *\n\t * @param {Number} low\n\t * The lower bound on the range.\n\t * @param {Number} high\n\t * The upper bound on the range.\n\t */\n\tfunction randomIntInRange(low, high) {\n\t return Math.round(low + (Math.random() * (high - low)));\n\t}\n\t\n\t/**\n\t * The Quick Sort algorithm.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t * @param {Number} p\n\t * Start index of the array\n\t * @param {Number} r\n\t * End index of the array\n\t */\n\tfunction doQuickSort(ary, comparator, p, r) {\n\t // If our lower bound is less than our upper bound, we (1) partition the\n\t // array into two pieces and (2) recurse on each half. If it is not, this is\n\t // the empty array and our base case.\n\t\n\t if (p < r) {\n\t // (1) Partitioning.\n\t //\n\t // The partitioning chooses a pivot between `p` and `r` and moves all\n\t // elements that are less than or equal to the pivot to the before it, and\n\t // all the elements that are greater than it after it. The effect is that\n\t // once partition is done, the pivot is in the exact place it will be when\n\t // the array is put in sorted order, and it will not need to be moved\n\t // again. This runs in O(n) time.\n\t\n\t // Always choose a random pivot so that an input array which is reverse\n\t // sorted does not cause O(n^2) running time.\n\t var pivotIndex = randomIntInRange(p, r);\n\t var i = p - 1;\n\t\n\t swap(ary, pivotIndex, r);\n\t var pivot = ary[r];\n\t\n\t // Immediately after `j` is incremented in this loop, the following hold\n\t // true:\n\t //\n\t // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n\t //\n\t // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n\t for (var j = p; j < r; j++) {\n\t if (comparator(ary[j], pivot) <= 0) {\n\t i += 1;\n\t swap(ary, i, j);\n\t }\n\t }\n\t\n\t swap(ary, i + 1, j);\n\t var q = i + 1;\n\t\n\t // (2) Recurse on each half.\n\t\n\t doQuickSort(ary, comparator, p, q - 1);\n\t doQuickSort(ary, comparator, q + 1, r);\n\t }\n\t}\n\t\n\t/**\n\t * Sort the given array in-place with the given comparator function.\n\t *\n\t * @param {Array} ary\n\t * An array to sort.\n\t * @param {function} comparator\n\t * Function to use to compare two items.\n\t */\n\texports.quickSort = function (ary, comparator) {\n\t doQuickSort(ary, comparator, 0, ary.length - 1);\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* -*- Mode: js; js-indent-level: 2; -*- */\n\t/*\n\t * Copyright 2011 Mozilla Foundation and contributors\n\t * Licensed under the New BSD license. See LICENSE or:\n\t * http://opensource.org/licenses/BSD-3-Clause\n\t */\n\t\n\tvar SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;\n\tvar util = __webpack_require__(4);\n\t\n\t// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n\t// operating systems these days (capturing the result).\n\tvar REGEX_NEWLINE = /(\\r?\\n)/;\n\t\n\t// Newline character code for charCodeAt() comparisons\n\tvar NEWLINE_CODE = 10;\n\t\n\t// Private symbol for identifying `SourceNode`s when multiple versions of\n\t// the source-map library are loaded. This MUST NOT CHANGE across\n\t// versions!\n\tvar isSourceNode = \"$$$isSourceNode$$$\";\n\t\n\t/**\n\t * SourceNodes provide a way to abstract over interpolating/concatenating\n\t * snippets of generated JavaScript source code while maintaining the line and\n\t * column information associated with the original source code.\n\t *\n\t * @param aLine The original line number.\n\t * @param aColumn The original column number.\n\t * @param aSource The original source's filename.\n\t * @param aChunks Optional. An array of strings which are snippets of\n\t * generated JS, or other SourceNodes.\n\t * @param aName The original identifier.\n\t */\n\tfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n\t this.children = [];\n\t this.sourceContents = {};\n\t this.line = aLine == null ? null : aLine;\n\t this.column = aColumn == null ? null : aColumn;\n\t this.source = aSource == null ? null : aSource;\n\t this.name = aName == null ? null : aName;\n\t this[isSourceNode] = true;\n\t if (aChunks != null) this.add(aChunks);\n\t}\n\t\n\t/**\n\t * Creates a SourceNode from generated code and a SourceMapConsumer.\n\t *\n\t * @param aGeneratedCode The generated code\n\t * @param aSourceMapConsumer The SourceMap for the generated code\n\t * @param aRelativePath Optional. The path that relative sources in the\n\t * SourceMapConsumer should be relative to.\n\t */\n\tSourceNode.fromStringWithSourceMap =\n\t function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n\t // The SourceNode we want to fill with the generated code\n\t // and the SourceMap\n\t var node = new SourceNode();\n\t\n\t // All even indices of this array are one line of the generated code,\n\t // while all odd indices are the newlines between two adjacent lines\n\t // (since `REGEX_NEWLINE` captures its match).\n\t // Processed fragments are accessed by calling `shiftNextLine`.\n\t var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n\t var remainingLinesIndex = 0;\n\t var shiftNextLine = function() {\n\t var lineContents = getNextLine();\n\t // The last line of a file might not have a newline.\n\t var newLine = getNextLine() || \"\";\n\t return lineContents + newLine;\n\t\n\t function getNextLine() {\n\t return remainingLinesIndex < remainingLines.length ?\n\t remainingLines[remainingLinesIndex++] : undefined;\n\t }\n\t };\n\t\n\t // We need to remember the position of \"remainingLines\"\n\t var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\t\n\t // The generate SourceNodes we need a code range.\n\t // To extract it current and last mapping is used.\n\t // Here we store the last mapping.\n\t var lastMapping = null;\n\t\n\t aSourceMapConsumer.eachMapping(function (mapping) {\n\t if (lastMapping !== null) {\n\t // We add the code from \"lastMapping\" to \"mapping\":\n\t // First check if there is a new line in between.\n\t if (lastGeneratedLine < mapping.generatedLine) {\n\t // Associate first line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t lastGeneratedLine++;\n\t lastGeneratedColumn = 0;\n\t // The remaining code is added without mapping\n\t } else {\n\t // There is no new line in between.\n\t // Associate the code between \"lastGeneratedColumn\" and\n\t // \"mapping.generatedColumn\" with \"lastMapping\"\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t var code = nextLine.substr(0, mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n\t lastGeneratedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t addMappingWithCode(lastMapping, code);\n\t // No more remaining code, continue\n\t lastMapping = mapping;\n\t return;\n\t }\n\t }\n\t // We add the generated code until the first mapping\n\t // to the SourceNode without any mapping.\n\t // Each line is added as separate string.\n\t while (lastGeneratedLine < mapping.generatedLine) {\n\t node.add(shiftNextLine());\n\t lastGeneratedLine++;\n\t }\n\t if (lastGeneratedColumn < mapping.generatedColumn) {\n\t var nextLine = remainingLines[remainingLinesIndex] || '';\n\t node.add(nextLine.substr(0, mapping.generatedColumn));\n\t remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n\t lastGeneratedColumn = mapping.generatedColumn;\n\t }\n\t lastMapping = mapping;\n\t }, this);\n\t // We have processed all mappings.\n\t if (remainingLinesIndex < remainingLines.length) {\n\t if (lastMapping) {\n\t // Associate the remaining code in the current line with \"lastMapping\"\n\t addMappingWithCode(lastMapping, shiftNextLine());\n\t }\n\t // and add the remaining lines without any mapping\n\t node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n\t }\n\t\n\t // Copy sourcesContent into SourceNode\n\t aSourceMapConsumer.sources.forEach(function (sourceFile) {\n\t var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\t if (content != null) {\n\t if (aRelativePath != null) {\n\t sourceFile = util.join(aRelativePath, sourceFile);\n\t }\n\t node.setSourceContent(sourceFile, content);\n\t }\n\t });\n\t\n\t return node;\n\t\n\t function addMappingWithCode(mapping, code) {\n\t if (mapping === null || mapping.source === undefined) {\n\t node.add(code);\n\t } else {\n\t var source = aRelativePath\n\t ? util.join(aRelativePath, mapping.source)\n\t : mapping.source;\n\t node.add(new SourceNode(mapping.originalLine,\n\t mapping.originalColumn,\n\t source,\n\t code,\n\t mapping.name));\n\t }\n\t }\n\t };\n\t\n\t/**\n\t * Add a chunk of generated JS to this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.add = function SourceNode_add(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t aChunk.forEach(function (chunk) {\n\t this.add(chunk);\n\t }, this);\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t if (aChunk) {\n\t this.children.push(aChunk);\n\t }\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Add a chunk of generated JS to the beginning of this source node.\n\t *\n\t * @param aChunk A string snippet of generated JS code, another instance of\n\t * SourceNode, or an array where each member is one of those things.\n\t */\n\tSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n\t if (Array.isArray(aChunk)) {\n\t for (var i = aChunk.length-1; i >= 0; i--) {\n\t this.prepend(aChunk[i]);\n\t }\n\t }\n\t else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n\t this.children.unshift(aChunk);\n\t }\n\t else {\n\t throw new TypeError(\n\t \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n\t );\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Walk over the tree of JS snippets in this node and its children. The\n\t * walking function is called once for each snippet of JS and is passed that\n\t * snippet and the its original associated source's line/column location.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n\t var chunk;\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t chunk = this.children[i];\n\t if (chunk[isSourceNode]) {\n\t chunk.walk(aFn);\n\t }\n\t else {\n\t if (chunk !== '') {\n\t aFn(chunk, { source: this.source,\n\t line: this.line,\n\t column: this.column,\n\t name: this.name });\n\t }\n\t }\n\t }\n\t};\n\t\n\t/**\n\t * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n\t * each of `this.children`.\n\t *\n\t * @param aSep The separator.\n\t */\n\tSourceNode.prototype.join = function SourceNode_join(aSep) {\n\t var newChildren;\n\t var i;\n\t var len = this.children.length;\n\t if (len > 0) {\n\t newChildren = [];\n\t for (i = 0; i < len-1; i++) {\n\t newChildren.push(this.children[i]);\n\t newChildren.push(aSep);\n\t }\n\t newChildren.push(this.children[i]);\n\t this.children = newChildren;\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Call String.prototype.replace on the very right-most source snippet. Useful\n\t * for trimming whitespace from the end of a source node, etc.\n\t *\n\t * @param aPattern The pattern to replace.\n\t * @param aReplacement The thing to replace the pattern with.\n\t */\n\tSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n\t var lastChild = this.children[this.children.length - 1];\n\t if (lastChild[isSourceNode]) {\n\t lastChild.replaceRight(aPattern, aReplacement);\n\t }\n\t else if (typeof lastChild === 'string') {\n\t this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n\t }\n\t else {\n\t this.children.push(''.replace(aPattern, aReplacement));\n\t }\n\t return this;\n\t};\n\t\n\t/**\n\t * Set the source content for a source file. This will be added to the SourceMapGenerator\n\t * in the sourcesContent field.\n\t *\n\t * @param aSourceFile The filename of the source file\n\t * @param aSourceContent The content of the source file\n\t */\n\tSourceNode.prototype.setSourceContent =\n\t function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n\t this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n\t };\n\t\n\t/**\n\t * Walk over the tree of SourceNodes. The walking function is called for each\n\t * source file content and is passed the filename and source content.\n\t *\n\t * @param aFn The traversal function.\n\t */\n\tSourceNode.prototype.walkSourceContents =\n\t function SourceNode_walkSourceContents(aFn) {\n\t for (var i = 0, len = this.children.length; i < len; i++) {\n\t if (this.children[i][isSourceNode]) {\n\t this.children[i].walkSourceContents(aFn);\n\t }\n\t }\n\t\n\t var sources = Object.keys(this.sourceContents);\n\t for (var i = 0, len = sources.length; i < len; i++) {\n\t aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n\t }\n\t };\n\t\n\t/**\n\t * Return the string representation of this source node. Walks over the tree\n\t * and concatenates all the various snippets together to one string.\n\t */\n\tSourceNode.prototype.toString = function SourceNode_toString() {\n\t var str = \"\";\n\t this.walk(function (chunk) {\n\t str += chunk;\n\t });\n\t return str;\n\t};\n\t\n\t/**\n\t * Returns the string representation of this source node along with a source\n\t * map.\n\t */\n\tSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n\t var generated = {\n\t code: \"\",\n\t line: 1,\n\t column: 0\n\t };\n\t var map = new SourceMapGenerator(aArgs);\n\t var sourceMappingActive = false;\n\t var lastOriginalSource = null;\n\t var lastOriginalLine = null;\n\t var lastOriginalColumn = null;\n\t var lastOriginalName = null;\n\t this.walk(function (chunk, original) {\n\t generated.code += chunk;\n\t if (original.source !== null\n\t && original.line !== null\n\t && original.column !== null) {\n\t if(lastOriginalSource !== original.source\n\t || lastOriginalLine !== original.line\n\t || lastOriginalColumn !== original.column\n\t || lastOriginalName !== original.name) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t lastOriginalSource = original.source;\n\t lastOriginalLine = original.line;\n\t lastOriginalColumn = original.column;\n\t lastOriginalName = original.name;\n\t sourceMappingActive = true;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t }\n\t });\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t }\n\t for (var idx = 0, length = chunk.length; idx < length; idx++) {\n\t if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n\t generated.line++;\n\t generated.column = 0;\n\t // Mappings end at eol\n\t if (idx + 1 === length) {\n\t lastOriginalSource = null;\n\t sourceMappingActive = false;\n\t } else if (sourceMappingActive) {\n\t map.addMapping({\n\t source: original.source,\n\t original: {\n\t line: original.line,\n\t column: original.column\n\t },\n\t generated: {\n\t line: generated.line,\n\t column: generated.column\n\t },\n\t name: original.name\n\t });\n\t }\n\t } else {\n\t generated.column++;\n\t }\n\t }\n\t });\n\t this.walkSourceContents(function (sourceFile, sourceContent) {\n\t map.setSourceContent(sourceFile, sourceContent);\n\t });\n\t\n\t return { code: generated.code, map: map };\n\t};\n\t\n\texports.SourceNode = SourceNode;\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// source-map.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0fd5815da764db5fb9fe","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./source-map.js\n// module id = 0\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-generator.js\n// module id = 1\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64-vlq.js\n// module id = 2\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/base64.js\n// module id = 3\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/util.js\n// module id = 4\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/array-set.js\n// module id = 5\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/mapping-list.js\n// module id = 6\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-map-consumer.js\n// module id = 7\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/binary-search.js\n// module id = 8\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/quick-sort.js\n// module id = 9\n// module chunks = 0","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/source-node.js\n// module id = 10\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/source-map/lib/array-set.js b/node_modules/source-map/lib/array-set.js new file mode 100644 index 0000000..fbd5c81 --- /dev/null +++ b/node_modules/source-map/lib/array-set.js @@ -0,0 +1,121 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var has = Object.prototype.hasOwnProperty; +var hasNativeMap = typeof Map !== "undefined"; + +/** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ +function ArraySet() { + this._array = []; + this._set = hasNativeMap ? new Map() : Object.create(null); +} + +/** + * Static method for creating ArraySet instances from an existing array. + */ +ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; +}; + +/** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ +ArraySet.prototype.size = function ArraySet_size() { + return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; +}; + +/** + * Add the given string to this set. + * + * @param String aStr + */ +ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); + var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + if (hasNativeMap) { + this._set.set(aStr, idx); + } else { + this._set[sStr] = idx; + } + } +}; + +/** + * Is the given string a member of this set? + * + * @param String aStr + */ +ArraySet.prototype.has = function ArraySet_has(aStr) { + if (hasNativeMap) { + return this._set.has(aStr); + } else { + var sStr = util.toSetString(aStr); + return has.call(this._set, sStr); + } +}; + +/** + * What is the index of the given string in the array? + * + * @param String aStr + */ +ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + if (hasNativeMap) { + var idx = this._set.get(aStr); + if (idx >= 0) { + return idx; + } + } else { + var sStr = util.toSetString(aStr); + if (has.call(this._set, sStr)) { + return this._set[sStr]; + } + } + + throw new Error('"' + aStr + '" is not in the set.'); +}; + +/** + * What is the element at the given index? + * + * @param Number aIdx + */ +ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); +}; + +/** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ +ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); +}; + +exports.ArraySet = ArraySet; diff --git a/node_modules/source-map/lib/base64-vlq.js b/node_modules/source-map/lib/base64-vlq.js new file mode 100644 index 0000000..612b404 --- /dev/null +++ b/node_modules/source-map/lib/base64-vlq.js @@ -0,0 +1,140 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +var base64 = require('./base64'); + +// A single base 64 digit can contain 6 bits of data. For the base 64 variable +// length quantities we use in the source map spec, the first bit is the sign, +// the next four bits are the actual value, and the 6th bit is the +// continuation bit. The continuation bit tells us whether there are more +// digits in this value following this digit. +// +// Continuation +// | Sign +// | | +// V V +// 101011 + +var VLQ_BASE_SHIFT = 5; + +// binary: 100000 +var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + +// binary: 011111 +var VLQ_BASE_MASK = VLQ_BASE - 1; + +// binary: 100000 +var VLQ_CONTINUATION_BIT = VLQ_BASE; + +/** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ +function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; +} + +/** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ +function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; +} + +/** + * Returns the base 64 VLQ encoded value. + */ +exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; +}; + +/** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ +exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; +}; diff --git a/node_modules/source-map/lib/base64.js b/node_modules/source-map/lib/base64.js new file mode 100644 index 0000000..8aa86b3 --- /dev/null +++ b/node_modules/source-map/lib/base64.js @@ -0,0 +1,67 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + +/** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ +exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); +}; + +/** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ +exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; +}; diff --git a/node_modules/source-map/lib/binary-search.js b/node_modules/source-map/lib/binary-search.js new file mode 100644 index 0000000..010ac94 --- /dev/null +++ b/node_modules/source-map/lib/binary-search.js @@ -0,0 +1,111 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +exports.GREATEST_LOWER_BOUND = 1; +exports.LEAST_UPPER_BOUND = 2; + +/** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ +function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } +} + +/** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ +exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; +}; diff --git a/node_modules/source-map/lib/mapping-list.js b/node_modules/source-map/lib/mapping-list.js new file mode 100644 index 0000000..06d1274 --- /dev/null +++ b/node_modules/source-map/lib/mapping-list.js @@ -0,0 +1,79 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); + +/** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ +function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; +} + +/** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ +function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; +} + +/** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ +MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + +/** + * Add the given source mapping. + * + * @param Object aMapping + */ +MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } +}; + +/** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ +MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; +}; + +exports.MappingList = MappingList; diff --git a/node_modules/source-map/lib/quick-sort.js b/node_modules/source-map/lib/quick-sort.js new file mode 100644 index 0000000..6a7caad --- /dev/null +++ b/node_modules/source-map/lib/quick-sort.js @@ -0,0 +1,114 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +// It turns out that some (most?) JavaScript engines don't self-host +// `Array.prototype.sort`. This makes sense because C++ will likely remain +// faster than JS when doing raw CPU-intensive sorting. However, when using a +// custom comparator function, calling back and forth between the VM's C++ and +// JIT'd JS is rather slow *and* loses JIT type information, resulting in +// worse generated code for the comparator function than would be optimal. In +// fact, when sorting with a comparator, these costs outweigh the benefits of +// sorting in C++. By using our own JS-implemented Quick Sort (below), we get +// a ~3500ms mean speed-up in `bench/bench.html`. + +/** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ +function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; +} + +/** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ +function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); +} + +/** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ +function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } +} + +/** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ +exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); +}; diff --git a/node_modules/source-map/lib/source-map-consumer.js b/node_modules/source-map/lib/source-map-consumer.js new file mode 100644 index 0000000..7b99d1d --- /dev/null +++ b/node_modules/source-map/lib/source-map-consumer.js @@ -0,0 +1,1145 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var util = require('./util'); +var binarySearch = require('./binary-search'); +var ArraySet = require('./array-set').ArraySet; +var base64VLQ = require('./base64-vlq'); +var quickSort = require('./quick-sort').quickSort; + +function SourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) + : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); +} + +SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL); +} + +/** + * The version of the source mapping spec that we are consuming. + */ +SourceMapConsumer.prototype._version = 3; + +// `__generatedMappings` and `__originalMappings` are arrays that hold the +// parsed mapping coordinates from the source map's "mappings" attribute. They +// are lazily instantiated, accessed via the `_generatedMappings` and +// `_originalMappings` getters respectively, and we only parse the mappings +// and create these arrays once queried for a source location. We jump through +// these hoops because there can be many thousands of mappings, and parsing +// them is expensive, so we only want to do it if we must. +// +// Each object in the arrays is of the form: +// +// { +// generatedLine: The line number in the generated code, +// generatedColumn: The column number in the generated code, +// source: The path to the original source file that generated this +// chunk of code, +// originalLine: The line number in the original source that +// corresponds to this chunk of generated code, +// originalColumn: The column number in the original source that +// corresponds to this chunk of generated code, +// name: The name of the original symbol which generated this chunk of +// code. +// } +// +// All properties except for `generatedLine` and `generatedColumn` can be +// `null`. +// +// `_generatedMappings` is ordered by the generated positions. +// +// `_originalMappings` is ordered by the original positions. + +SourceMapConsumer.prototype.__generatedMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } +}); + +SourceMapConsumer.prototype.__originalMappings = null; +Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + configurable: true, + enumerable: true, + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } +}); + +SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + +SourceMapConsumer.GENERATED_ORDER = 1; +SourceMapConsumer.ORIGINAL_ORDER = 2; + +SourceMapConsumer.GREATEST_LOWER_BOUND = 1; +SourceMapConsumer.LEAST_UPPER_BOUND = 2; + +/** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ +SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + +/** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number is 1-based. + * - column: Optional. the column number in the original source. + * The column number is 0-based. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + needle.source = this._findSourceIndex(needle.source); + if (needle.source < 0) { + return []; + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + +exports.SourceMapConsumer = SourceMapConsumer; + +/** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The first parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ +function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + if (sourceRoot) { + sourceRoot = util.normalize(sourceRoot); + } + + sources = sources + .map(String) + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names.map(String), true); + this._sources = ArraySet.fromArray(sources, true); + + this._absoluteSources = this._sources.toArray().map(function (s) { + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); + }); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this._sourceMapURL = aSourceMapURL; + this.file = file; +} + +BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + +/** + * Utility function to find the index of a source. Returns -1 if not + * found. + */ +BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + if (this._sources.has(relativeSource)) { + return this._sources.indexOf(relativeSource); + } + + // Maybe aSource is an absolute URL as returned by |sources|. In + // this case we can't simply undo the transform. + var i; + for (i = 0; i < this._absoluteSources.length; ++i) { + if (this._absoluteSources[i] == aSource) { + return i; + } + } + + return -1; +}; + +/** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @param String aSourceMapURL + * The URL at which the source map can be found (optional) + * @returns BasicSourceMapConsumer + */ +BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + smc._sourceMapURL = aSourceMapURL; + smc._absoluteSources = smc._sources.toArray().map(function (s) { + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + }); + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + +/** + * The version of the source mapping spec that we are consuming. + */ +BasicSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._absoluteSources.slice(); + } +}); + +/** + * Provide the JIT with a nice shape / hidden class. + */ +function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; +} + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + +/** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ +BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + +/** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ +BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + var index = this._findSourceIndex(aSource); + if (index >= 0) { + return this.sourcesContent[index]; + } + + var relativeSource = aSource; + if (this.sourceRoot != null) { + relativeSource = util.relative(this.sourceRoot, relativeSource); + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + relativeSource)) { + return this.sourcesContent[this._sources.indexOf("/" + relativeSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + relativeSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + source = this._findSourceIndex(source); + if (source < 0) { + return { + line: null, + column: null, + lastColumn: null + }; + } + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + +exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + +/** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The first parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * The second parameter, if given, is a string whose value is the URL + * at which the source map was found. This URL is used to compute the + * sources array. + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ +function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = util.parseSourceMapInput(aSourceMap); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL) + } + }); +} + +IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); +IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + +/** + * The version of the source mapping spec that we are consuming. + */ +IndexedSourceMapConsumer.prototype._version = 3; + +/** + * The list of original sources. + */ +Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } +}); + +/** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. The line number + * is 1-based. + * - column: The column number in the generated source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. The + * line number is 1-based. + * - column: The column number in the original source, or null. The + * column number is 0-based. + * - name: The original identifier, or null. + */ +IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + +/** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ +IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + +/** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ +IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + +/** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. The line number + * is 1-based. + * - column: The column number in the original source. The column + * number is 0-based. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. The + * line number is 1-based. + * - column: The column number in the generated source, or null. + * The column number is 0-based. + */ +IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + +/** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ +IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = null; + if (mapping.name) { + name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + } + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + +exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; diff --git a/node_modules/source-map/lib/source-map-generator.js b/node_modules/source-map/lib/source-map-generator.js new file mode 100644 index 0000000..508bcfb --- /dev/null +++ b/node_modules/source-map/lib/source-map-generator.js @@ -0,0 +1,425 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var base64VLQ = require('./base64-vlq'); +var util = require('./util'); +var ArraySet = require('./array-set').ArraySet; +var MappingList = require('./mapping-list').MappingList; + +/** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ +function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; +} + +SourceMapGenerator.prototype._version = 3; + +/** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ +SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var sourceRelative = sourceFile; + if (sourceRoot !== null) { + sourceRelative = util.relative(sourceRoot, sourceFile); + } + + if (!generator._sources.has(sourceRelative)) { + generator._sources.add(sourceRelative); + } + + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + +/** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ +SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null) { + source = String(source); + if (!this._sources.has(source)) { + this._sources.add(source); + } + } + + if (name != null) { + name = String(name); + if (!this._names.has(name)) { + this._names.add(name); + } + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + +/** + * Set the source content for a source file. + */ +SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = Object.create(null); + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + +/** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ +SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + +/** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ +SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + // When aOriginal is truthy but has empty values for .line and .column, + // it is most likely a programmer error. In this case we throw a very + // specific error message to try to guide them the right way. + // For example: https://github.com/Polymer/polymer-bundler/pull/519 + if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { + throw new Error( + 'original.line and original.column are not numbers -- you probably meant to omit ' + + 'the original mapping entirely and only map the generated position. If so, pass ' + + 'null for the original mapping instead of an object with empty or null values.' + ); + } + + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + +/** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ +SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var next; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + next = '' + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + next += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + next += ','; + } + } + + next += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + next += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + next += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + next += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + next += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + + result += next; + } + + return result; + }; + +SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) + ? this._sourcesContents[key] + : null; + }, this); + }; + +/** + * Externalize the source map. + */ +SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + +/** + * Render the source map being generated to a string. + */ +SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + +exports.SourceMapGenerator = SourceMapGenerator; diff --git a/node_modules/source-map/lib/source-node.js b/node_modules/source-map/lib/source-node.js new file mode 100644 index 0000000..8bcdbe3 --- /dev/null +++ b/node_modules/source-map/lib/source-node.js @@ -0,0 +1,413 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; +var util = require('./util'); + +// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other +// operating systems these days (capturing the result). +var REGEX_NEWLINE = /(\r?\n)/; + +// Newline character code for charCodeAt() comparisons +var NEWLINE_CODE = 10; + +// Private symbol for identifying `SourceNode`s when multiple versions of +// the source-map library are loaded. This MUST NOT CHANGE across +// versions! +var isSourceNode = "$$$isSourceNode$$$"; + +/** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ +function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); +} + +/** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ +SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are accessed by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var remainingLinesIndex = 0; + var shiftNextLine = function() { + var lineContents = getNextLine(); + // The last line of a file might not have a newline. + var newLine = getNextLine() || ""; + return lineContents + newLine; + + function getNextLine() { + return remainingLinesIndex < remainingLines.length ? + remainingLines[remainingLinesIndex++] : undefined; + } + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[remainingLinesIndex] || ''; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[remainingLinesIndex] || ''; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLinesIndex < remainingLines.length) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.splice(remainingLinesIndex).join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + +/** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ +SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; +}; + +/** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } +}; + +/** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ +SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; +}; + +/** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ +SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; +}; + +/** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ +SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + +/** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ +SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + +/** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ +SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; +}; + +/** + * Returns the string representation of this source node along with a source + * map. + */ +SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; +}; + +exports.SourceNode = SourceNode; diff --git a/node_modules/source-map/lib/util.js b/node_modules/source-map/lib/util.js new file mode 100644 index 0000000..3ca92e5 --- /dev/null +++ b/node_modules/source-map/lib/util.js @@ -0,0 +1,488 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ + +/** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ +function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } +} +exports.getArg = getArg; + +var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/; +var dataUrlRegexp = /^data:.+\,.+$/; + +function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; +} +exports.urlParse = urlParse; + +function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; +} +exports.urlGenerate = urlGenerate; + +/** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consecutive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ +function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; +} +exports.normalize = normalize; + +/** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ +function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; +} +exports.join = join; + +exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || urlRegexp.test(aPath); +}; + +/** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ +function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); +} +exports.relative = relative; + +var supportsNullProto = (function () { + var obj = Object.create(null); + return !('__proto__' in obj); +}()); + +function identity (s) { + return s; +} + +/** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ +function toSetString(aStr) { + if (isProtoString(aStr)) { + return '$' + aStr; + } + + return aStr; +} +exports.toSetString = supportsNullProto ? identity : toSetString; + +function fromSetString(aStr) { + if (isProtoString(aStr)) { + return aStr.slice(1); + } + + return aStr; +} +exports.fromSetString = supportsNullProto ? identity : fromSetString; + +function isProtoString(s) { + if (!s) { + return false; + } + + var length = s.length; + + if (length < 9 /* "__proto__".length */) { + return false; + } + + if (s.charCodeAt(length - 1) !== 95 /* '_' */ || + s.charCodeAt(length - 2) !== 95 /* '_' */ || + s.charCodeAt(length - 3) !== 111 /* 'o' */ || + s.charCodeAt(length - 4) !== 116 /* 't' */ || + s.charCodeAt(length - 5) !== 111 /* 'o' */ || + s.charCodeAt(length - 6) !== 114 /* 'r' */ || + s.charCodeAt(length - 7) !== 112 /* 'p' */ || + s.charCodeAt(length - 8) !== 95 /* '_' */ || + s.charCodeAt(length - 9) !== 95 /* '_' */) { + return false; + } + + for (var i = length - 10; i >= 0; i--) { + if (s.charCodeAt(i) !== 36 /* '$' */) { + return false; + } + } + + return true; +} + +/** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ +function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByOriginalPositions = compareByOriginalPositions; + +/** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ +function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + +function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 === null) { + return 1; // aStr2 !== null + } + + if (aStr2 === null) { + return -1; // aStr1 !== null + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; +} + +/** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ +function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); +} +exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; + +/** + * Strip any JSON XSSI avoidance prefix from the string (as documented + * in the source maps specification), and then parse the string as + * JSON. + */ +function parseSourceMapInput(str) { + return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, '')); +} +exports.parseSourceMapInput = parseSourceMapInput; + +/** + * Compute the URL of a source given the the source root, the source's + * URL, and the source map's URL. + */ +function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) { + sourceURL = sourceURL || ''; + + if (sourceRoot) { + // This follows what Chrome does. + if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') { + sourceRoot += '/'; + } + // The spec says: + // Line 4: An optional source root, useful for relocating source + // files on a server or removing repeated values in the + // “sources” entry. This value is prepended to the individual + // entries in the “source” field. + sourceURL = sourceRoot + sourceURL; + } + + // Historically, SourceMapConsumer did not take the sourceMapURL as + // a parameter. This mode is still somewhat supported, which is why + // this code block is conditional. However, it's preferable to pass + // the source map URL to SourceMapConsumer, so that this function + // can implement the source URL resolution algorithm as outlined in + // the spec. This block is basically the equivalent of: + // new URL(sourceURL, sourceMapURL).toString() + // ... except it avoids using URL, which wasn't available in the + // older releases of node still supported by this library. + // + // The spec says: + // If the sources are not absolute URLs after prepending of the + // “sourceRoot”, the sources are resolved relative to the + // SourceMap (like resolving script src in a html document). + if (sourceMapURL) { + var parsed = urlParse(sourceMapURL); + if (!parsed) { + throw new Error("sourceMapURL could not be parsed"); + } + if (parsed.path) { + // Strip the last path component, but keep the "/". + var index = parsed.path.lastIndexOf('/'); + if (index >= 0) { + parsed.path = parsed.path.substring(0, index + 1); + } + } + sourceURL = join(urlGenerate(parsed), sourceURL); + } + + return normalize(sourceURL); +} +exports.computeSourceURL = computeSourceURL; diff --git a/node_modules/source-map/package.json b/node_modules/source-map/package.json new file mode 100644 index 0000000..2466341 --- /dev/null +++ b/node_modules/source-map/package.json @@ -0,0 +1,73 @@ +{ + "name": "source-map", + "description": "Generates and consumes source maps", + "version": "0.6.1", + "homepage": "https://github.com/mozilla/source-map", + "author": "Nick Fitzgerald ", + "contributors": [ + "Tobias Koppers ", + "Duncan Beevers ", + "Stephen Crane ", + "Ryan Seddon ", + "Miles Elam ", + "Mihai Bazon ", + "Michael Ficarra ", + "Todd Wolfson ", + "Alexander Solovyov ", + "Felix Gnass ", + "Conrad Irwin ", + "usrbincc ", + "David Glasser ", + "Chase Douglas ", + "Evan Wallace ", + "Heather Arthur ", + "Hugh Kennedy ", + "David Glasser ", + "Simon Lydell ", + "Jmeas Smith ", + "Michael Z Goddard ", + "azu ", + "John Gozde ", + "Adam Kirkton ", + "Chris Montgomery ", + "J. Ryan Stinnett ", + "Jack Herrington ", + "Chris Truter ", + "Daniel Espeset ", + "Jamie Wong ", + "Eddy Bruël ", + "Hawken Rives ", + "Gilad Peleg ", + "djchie ", + "Gary Ye ", + "Nicolas Lalevée " + ], + "repository": { + "type": "git", + "url": "http://github.com/mozilla/source-map.git" + }, + "main": "./source-map.js", + "files": [ + "source-map.js", + "source-map.d.ts", + "lib/", + "dist/source-map.debug.js", + "dist/source-map.js", + "dist/source-map.min.js", + "dist/source-map.min.js.map" + ], + "engines": { + "node": ">=0.10.0" + }, + "license": "BSD-3-Clause", + "scripts": { + "test": "npm run build && node test/run-tests.js", + "build": "webpack --color", + "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md" + }, + "devDependencies": { + "doctoc": "^0.15.0", + "webpack": "^1.12.0" + }, + "typings": "source-map" +} diff --git a/node_modules/source-map/source-map.d.ts b/node_modules/source-map/source-map.d.ts new file mode 100644 index 0000000..8f972b0 --- /dev/null +++ b/node_modules/source-map/source-map.d.ts @@ -0,0 +1,98 @@ +export interface StartOfSourceMap { + file?: string; + sourceRoot?: string; +} + +export interface RawSourceMap extends StartOfSourceMap { + version: string; + sources: string[]; + names: string[]; + sourcesContent?: string[]; + mappings: string; +} + +export interface Position { + line: number; + column: number; +} + +export interface LineRange extends Position { + lastColumn: number; +} + +export interface FindPosition extends Position { + // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND + bias?: number; +} + +export interface SourceFindPosition extends FindPosition { + source: string; +} + +export interface MappedPosition extends Position { + source: string; + name?: string; +} + +export interface MappingItem { + source: string; + generatedLine: number; + generatedColumn: number; + originalLine: number; + originalColumn: number; + name: string; +} + +export class SourceMapConsumer { + static GENERATED_ORDER: number; + static ORIGINAL_ORDER: number; + + static GREATEST_LOWER_BOUND: number; + static LEAST_UPPER_BOUND: number; + + constructor(rawSourceMap: RawSourceMap); + computeColumnSpans(): void; + originalPositionFor(generatedPosition: FindPosition): MappedPosition; + generatedPositionFor(originalPosition: SourceFindPosition): LineRange; + allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; + hasContentsOfAllSources(): boolean; + sourceContentFor(source: string, returnNullOnMissing?: boolean): string; + eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; +} + +export interface Mapping { + generated: Position; + original: Position; + source: string; + name?: string; +} + +export class SourceMapGenerator { + constructor(startOfSourceMap?: StartOfSourceMap); + static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; + addMapping(mapping: Mapping): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; + toString(): string; +} + +export interface CodeWithSourceMap { + code: string; + map: SourceMapGenerator; +} + +export class SourceNode { + constructor(); + constructor(line: number, column: number, source: string); + constructor(line: number, column: number, source: string, chunk?: string, name?: string); + static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; + add(chunk: string): void; + prepend(chunk: string): void; + setSourceContent(sourceFile: string, sourceContent: string): void; + walk(fn: (chunk: string, mapping: MappedPosition) => void): void; + walkSourceContents(fn: (file: string, content: string) => void): void; + join(sep: string): SourceNode; + replaceRight(pattern: string, replacement: string): SourceNode; + toString(): string; + toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; +} diff --git a/node_modules/source-map/source-map.js b/node_modules/source-map/source-map.js new file mode 100644 index 0000000..bc88fe8 --- /dev/null +++ b/node_modules/source-map/source-map.js @@ -0,0 +1,8 @@ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator; +exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer; +exports.SourceNode = require('./lib/source-node').SourceNode; diff --git a/node_modules/spawn-wrap/CHANGELOG.md b/node_modules/spawn-wrap/CHANGELOG.md new file mode 100644 index 0000000..c9a0ab6 --- /dev/null +++ b/node_modules/spawn-wrap/CHANGELOG.md @@ -0,0 +1,43 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.0.0](https://github.com/istanbuljs/spawn-wrap/compare/v1.4.3...v2.0.0) (2019-12-20) + + +### ⚠ BREAKING CHANGES + +* no longer feature detect spawnSync, present since Node 0.11. +* Drop support for iojs (#84) +* explicitly drops support for Node 6 + +### Bug Fixes + +* Avoid path concatenation ([5626f2a](https://github.com/istanbuljs/spawn-wrap/commit/5626f2a)) +* Handle whitespace in homedir paths ([#98](https://github.com/istanbuljs/spawn-wrap/issues/98)) ([f002ecc](https://github.com/istanbuljs/spawn-wrap/commit/f002ecc)), closes [istanbuljs/nyc#784](https://github.com/istanbuljs/nyc/issues/784) +* Make munge functions pure ([#99](https://github.com/istanbuljs/spawn-wrap/issues/99)) ([5c1293e](https://github.com/istanbuljs/spawn-wrap/commit/5c1293e)) +* Remove '/.node-spawn-wrap-' from lib/homedir.js export ([5bcb288](https://github.com/istanbuljs/spawn-wrap/commit/5bcb288)) +* Remove legacy `ChildProcess` resolution ([#85](https://github.com/istanbuljs/spawn-wrap/issues/85)) ([da05012](https://github.com/istanbuljs/spawn-wrap/commit/da05012)) +* Remove legacy `spawnSync` feature detection ([#87](https://github.com/istanbuljs/spawn-wrap/issues/87)) ([78777aa](https://github.com/istanbuljs/spawn-wrap/commit/78777aa)) +* Switch from mkdirp to make-dir ([#94](https://github.com/istanbuljs/spawn-wrap/issues/94)) ([b8dace1](https://github.com/istanbuljs/spawn-wrap/commit/b8dace1)) +* Use `is-windows` package for detection ([#88](https://github.com/istanbuljs/spawn-wrap/issues/88)) ([c3e6239](https://github.com/istanbuljs/spawn-wrap/commit/c3e6239)), closes [istanbuljs/spawn-wrap#61](https://github.com/istanbuljs/spawn-wrap/issues/61) +* Use safe path functions in `setup` ([#86](https://github.com/istanbuljs/spawn-wrap/issues/86)) ([4103f72](https://github.com/istanbuljs/spawn-wrap/commit/4103f72)) + +### Features + +* Drop support for iojs ([#84](https://github.com/istanbuljs/spawn-wrap/issues/84)) ([6e86337](https://github.com/istanbuljs/spawn-wrap/commit/6e86337)) +* require Node 8 ([#80](https://github.com/istanbuljs/spawn-wrap/issues/80)) ([19543e7](https://github.com/istanbuljs/spawn-wrap/commit/19543e7)) + + +## [2.0.0-beta.0](https://github.com/istanbuljs/spawn-wrap/compare/v1.4.3...v2.0.0-beta.0) (2019-10-07) + + +See 2.0.0 for notes. + + +### [1.4.3](https://github.com/isaacs/spawn-wrap/compare/v1.4.2...v1.4.3) (2019-08-23) + + +### Bug Fixes + +* **win32:** handle cases where "node" is quoted ([#102](https://github.com/isaacs/spawn-wrap/issues/102)) ([aac8730](https://github.com/isaacs/spawn-wrap/commit/aac8730)) diff --git a/node_modules/spawn-wrap/LICENSE b/node_modules/spawn-wrap/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/spawn-wrap/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/spawn-wrap/README.md b/node_modules/spawn-wrap/README.md new file mode 100644 index 0000000..e35db2a --- /dev/null +++ b/node_modules/spawn-wrap/README.md @@ -0,0 +1,111 @@ +# spawn-wrap + +Wrap all spawned Node.js child processes by adding environs and +arguments ahead of the main JavaScript file argument. + +Any child processes launched by that child process will also be +wrapped in a similar fashion. + +This is a bit of a brutal hack, designed primarily to support code +coverage reporting in cases where tests or the system under test are +loaded via child processes rather than via `require()`. + +It can also be handy if you want to run your own mock executable +instead of some other thing when child procs call into it. + +[![Build Status](https://travis-ci.org/istanbuljs/spawn-wrap.svg)](https://travis-ci.org/istanbuljs/spawn-wrap) + +## USAGE + +```javascript +var wrap = require('spawn-wrap') + +// wrap(wrapperArgs, environs) +var unwrap = wrap(['/path/to/my/main.js', 'foo=bar'], { FOO: 1 }) + +// later to undo the wrapping, you can call the returned function +unwrap() +``` + +In this example, the `/path/to/my/main.js` file will be used as the +"main" module, whenever any Node or io.js child process is started, +whether via a call to `spawn` or `exec`, whether node is invoked +directly as the command or as the result of a shebang `#!` lookup. + +In `/path/to/my/main.js`, you can do whatever instrumentation or +environment manipulation you like. When you're done, and ready to run +the "real" main.js file (ie, the one that was spawned in the first +place), you can do this: + +```javascript +// /path/to/my/main.js +// process.argv[1] === 'foo=bar' +// and process.env.FOO === '1' + +// my wrapping manipulations +setupInstrumentationOrCoverageOrWhatever() +process.on('exit', function (code) { + storeCoverageInfoSynchronously() +}) + +// now run the instrumented and covered or whatever codes +require('spawn-wrap').runMain() +``` + +## ENVIRONMENT VARIABLES + +Spawn-wrap responds to two environment variables, both of which are +preserved through child processes. + +`SPAWN_WRAP_DEBUG=1` in the environment will make this module dump a +lot of information to stderr. + +`SPAWN_WRAP_SHIM_ROOT` can be set to a path on the filesystem where +the shim files are written in a `.node-spawn-wrap-` folder. By +default this is done in `$HOME`, but in some environments you may wish +to point it at some other root. (For example, if `$HOME` is mounted +as read-only in a virtual machine or container.) + +## CONTRACTS and CAVEATS + +The initial wrap call uses synchronous I/O. Probably you should not +be using this script in any production environments anyway. + +Also, this will slow down child process execution by a lot, since +we're adding a few layers of indirection. + +The contract which this library aims to uphold is: + +* Wrapped processes behave identical to their unwrapped counterparts + for all intents and purposes. That means that the wrapper script + propagates all signals and exit codes. +* If you send a signal to the wrapper, the child gets the signal. +* If the child exits with a numeric status code, then the wrapper + exits with that code. +* If the child dies with a signal, then the wrapper dies with the + same signal. +* If you execute any Node child process, in any of the various ways + that such a thing can be done, it will be wrapped. +* Children of wrapped processes are also wrapped. + +(Much of this made possible by +[foreground-child](http://npm.im/foreground-child).) + +There are a few ways situations in which this contract cannot be +adhered to, despite best efforts: + +1. In order to handle cases where `node` is invoked in a shell script, + the `PATH` environment variable is modified such that the the shim + will be run before the "real" node. However, since Windows does + not allow executing shebang scripts like regular programs, a + `node.cmd` file is required. +2. Signal propagation through `dash` doesn't always work. So, if you + use `child_process.exec()` on systems where `/bin/sh` is actually + `dash`, then the process may exit with a status code > 128 rather + than indicating that it received a signal. +3. `cmd.exe` is even stranger with how it propagates and interprets + unix signals. If you want your programs to be portable, then + probably you wanna not rely on signals too much. +4. It *is* possible to escape the wrapping, if you spawn a bash + script, and that script modifies the `PATH`, and then calls a + specific `node` binary explicitly. diff --git a/node_modules/spawn-wrap/index.js b/node_modules/spawn-wrap/index.js new file mode 100644 index 0000000..edadc58 --- /dev/null +++ b/node_modules/spawn-wrap/index.js @@ -0,0 +1,165 @@ +'use strict'; + +module.exports = wrap +wrap.runMain = runMain + +const Module = require('module') +const fs = require('fs') +const cp = require('child_process') +const ChildProcess = cp.ChildProcess +const assert = require('assert') +const crypto = require('crypto') +const IS_WINDOWS = require('is-windows')() +const makeDir = require('make-dir') +const rimraf = require('rimraf') +const path = require('path') +const signalExit = require('signal-exit') +const {IS_DEBUG, debug} = require("./lib/debug") +const munge = require("./lib/munge") +const homedir = require("./lib/homedir") + +const shebang = process.platform === 'os390' ? + '#!/bin/env ' : '#!' + +const shim = shebang + process.execPath + '\n' + + fs.readFileSync(path.join(__dirname, 'shim.js')) + +function wrap(argv, env, workingDir) { + const spawnSyncBinding = process.binding('spawn_sync') + + // if we're passed in the working dir, then it means that setup + // was already done, so no need. + const doSetup = !workingDir + if (doSetup) { + workingDir = setup(argv, env) + } + const spawn = ChildProcess.prototype.spawn + const spawnSync = spawnSyncBinding.spawn + + function unwrap() { + if (doSetup && !IS_DEBUG) { + rimraf.sync(workingDir) + } + ChildProcess.prototype.spawn = spawn + spawnSyncBinding.spawn = spawnSync + } + + spawnSyncBinding.spawn = wrappedSpawnFunction(spawnSync, workingDir) + ChildProcess.prototype.spawn = wrappedSpawnFunction(spawn, workingDir) + + return unwrap +} + +function wrappedSpawnFunction (fn, workingDir) { + return wrappedSpawn + + function wrappedSpawn (options) { + const mungedOptions = munge(workingDir, options) + debug('WRAPPED', mungedOptions) + return fn.call(this, mungedOptions) + } +} + +function setup(argv, env) { + if (argv && typeof argv === 'object' && !env && !Array.isArray(argv)) { + env = argv + argv = [] + } + + if (!argv && !env) { + throw new Error('at least one of "argv" and "env" required') + } + + if (argv) { + assert(Array.isArray(argv), 'argv must be an array') + } else { + argv = [] + } + + if (env) { + assert(typeof env === 'object', 'env must be an object') + } else { + env = {} + } + + debug('setup argv=%j env=%j', argv, env) + + // For stuff like --use_strict or --harmony, we need to inject + // the argument *before* the wrap-main. + const execArgv = [] + for (let i = 0; i < argv.length; i++) { + if (argv[i].startsWith('-')) { + execArgv.push(argv[i]) + if (argv[i] === '-r' || argv[i] === '--require') { + execArgv.push(argv[++i]) + } + } else { + break + } + } + if (execArgv.length) { + if (execArgv.length === argv.length) { + argv.length = 0 + } else { + argv = argv.slice(execArgv.length) + } + } + + const key = process.pid + '-' + crypto.randomBytes(6).toString('hex') + let workingDir = path.resolve(homedir, `.node-spawn-wrap-${key}`) + + const settings = JSON.stringify({ + module: __filename, + deps: { + foregroundChild: require.resolve('foreground-child'), + signalExit: require.resolve('signal-exit'), + debug: require.resolve('./lib/debug') + }, + isWindows: IS_WINDOWS, + key, + workingDir, + argv, + execArgv, + env, + root: process.pid + }, null, 2) + '\n' + + if (!IS_DEBUG) { + signalExit(() => rimraf.sync(workingDir)) + } + + makeDir.sync(workingDir) + workingDir = fs.realpathSync(workingDir) + if (IS_WINDOWS) { + const cmdShim = + '@echo off\r\n' + + 'SETLOCAL\r\n' + + 'CALL :find_dp0\r\n' + + 'SET PATHEXT=%PATHEXT:;.JS;=;%\r\n' + + '"' + process.execPath + '" "%dp0%node" %*\r\n' + + 'EXIT /b %errorlevel%\r\n'+ + ':find_dp0\r\n' + + 'SET dp0=%~dp0\r\n' + + 'EXIT /b\r\n' + + fs.writeFileSync(path.join(workingDir, 'node.cmd'), cmdShim) + fs.chmodSync(path.join(workingDir, 'node.cmd'), '0755') + } + fs.writeFileSync(path.join(workingDir, 'node'), shim) + fs.chmodSync(path.join(workingDir, 'node'), '0755') + const cmdname = path.basename(process.execPath).replace(/\.exe$/i, '') + if (cmdname !== 'node') { + fs.writeFileSync(path.join(workingDir, cmdname), shim) + fs.chmodSync(path.join(workingDir, cmdname), '0755') + } + fs.writeFileSync(path.join(workingDir, 'settings.json'), settings) + + return workingDir +} + +function runMain () { + process.argv.splice(1, 1) + process.argv[1] = path.resolve(process.argv[1]) + delete require.cache[process.argv[1]] + Module.runMain() +} diff --git a/node_modules/spawn-wrap/lib/debug.js b/node_modules/spawn-wrap/lib/debug.js new file mode 100644 index 0000000..5a7bcb2 --- /dev/null +++ b/node_modules/spawn-wrap/lib/debug.js @@ -0,0 +1,32 @@ +'use strict'; + +const util = require('util'); +const fs = require('fs') + +/** + * Boolean indicating if debug mode is enabled. + * + * @type {boolean} + */ +const IS_DEBUG = process.env.SPAWN_WRAP_DEBUG === '1' + +/** + * If debug is enabled, write message to stderr. + * + * If debug is disabled, no message is written. + */ +function debug(...args) { + if (!IS_DEBUG) { + return; + } + + const prefix = `SW ${process.pid}: ` + const data = util.format(...args).trim() + const message = data.split('\n').map(line => `${prefix}${line}\n`).join('') + fs.writeSync(2, message) +} + +module.exports = { + IS_DEBUG, + debug, +} diff --git a/node_modules/spawn-wrap/lib/exe-type.js b/node_modules/spawn-wrap/lib/exe-type.js new file mode 100644 index 0000000..482274a --- /dev/null +++ b/node_modules/spawn-wrap/lib/exe-type.js @@ -0,0 +1,53 @@ +'use strict'; + +const isWindows = require("is-windows") +const path = require("path") + +function isCmd(file) { + const comspec = path.basename(process.env.comspec || '').replace(/\.exe$/i, '') + return isWindows() && (file === comspec || /^cmd(?:\.exe)?$/i.test(file)) +} + +function isNode(file) { + const cmdname = path.basename(process.execPath).replace(/\.exe$/i, '') + return file === 'node' || cmdname === file +} + +function isNpm(file) { + // XXX is this even possible/necessary? + // wouldn't npm just be detected as a node shebang? + return file === 'npm' && !isWindows() +} + +function isSh(file) { + return ['dash', 'sh', 'bash', 'zsh'].includes(file) +} + +/** + * Returns the basename of the executable. + * + * On Windows, strips the `.exe` extension (if any) and normalizes the name to + * lowercase. + * + * @param exePath {string} Path of the executable as passed to spawned processes: + * either command or a path to a file. + * @return {string} Basename of the executable. + */ +function getExeBasename(exePath) { + const baseName = path.basename(exePath); + if (isWindows()) { + // Stripping `.exe` seems to be enough for our usage. We may eventually + // want to handle all executable extensions (such as `.bat` or `.cmd`). + return baseName.replace(/\.exe$/i, "").toLowerCase(); + } else { + return baseName; + } +} + +module.exports = { + isCmd, + isNode, + isNpm, + isSh, + getExeBasename, +} diff --git a/node_modules/spawn-wrap/lib/homedir.js b/node_modules/spawn-wrap/lib/homedir.js new file mode 100644 index 0000000..ee49f28 --- /dev/null +++ b/node_modules/spawn-wrap/lib/homedir.js @@ -0,0 +1,5 @@ +'use strict' + +const os = require('os') + +module.exports = process.env.SPAWN_WRAP_SHIM_ROOT || os.homedir() diff --git a/node_modules/spawn-wrap/lib/munge.js b/node_modules/spawn-wrap/lib/munge.js new file mode 100644 index 0000000..a7d3ec7 --- /dev/null +++ b/node_modules/spawn-wrap/lib/munge.js @@ -0,0 +1,84 @@ +'use strict'; + +const {isCmd, isNode, isNpm, isSh, getExeBasename} = require("./exe-type") +const mungeCmd = require("./mungers/cmd") +const mungeEnv = require("./mungers/env") +const mungeNode = require("./mungers/node") +const mungeNpm = require("./mungers/npm") +const mungeSh = require("./mungers/sh") +const mungeShebang = require("./mungers/shebang") + +/** + * @typedef {object} InternalSpawnOptions Options for the internal spawn functions + * `childProcess.ChildProcess.prototype.spawn` and `process.binding('spawn_sync').spawn`. + * These are the options mapped by the `munge` function to intercept spawned processes and + * handle the wrapping logic. + * + * @property {string} file File to execute: either an absolute system-dependent path or a + * command name. + * @property {string[]} args Command line arguments passed to the spawn process, including argv0. + * @property {string | undefined} cwd Optional path to the current working directory passed to the + * spawned process. Default: `process.cwd()` + * @property {boolean} windowsHide Boolean controlling if the process should be spawned as + * hidden (no GUI) on Windows. + * @property {boolean} windowsVerbatimArguments Boolean controlling if Node should preprocess + * the CLI arguments on Windows. + * @property {boolean} detached Boolean controlling if the child process should keep its parent + * alive or not. + * @property {string[]} envPairs Array of serialized environment variable key/value pairs. The + * variables serialized as `key + "=" + value`. + * @property {import("child_process").StdioOptions} stdio Stdio options, with the same semantics + * as the `stdio` parameter from the public API. + * @property {number | undefined} uid User id for the spawn process, same as the `uid` parameter + * from the public API. + * @property {number | undefined} gid Group id for the spawn process, same as the `gid` parameter + * from the public API. + * + * @property {string | undefined} originalNode Custom property only used by `spawn-wrap`. It is + * used to remember the original Node executable that was intended to be spawned by the user. + */ + +/** + * Returns updated internal spawn options to redirect the process through the shim and wrapper. + * + * This works on the options passed to `childProcess.ChildProcess.prototype.spawn` and + * `process.binding('spawn_sync').spawn`. + * + * This function works by trying to identify the spawn process and map the options accordingly. + * `spawn-wrap` recognizes most shells, Windows `cmd.exe`, Node and npm invocations; when spawn + * either directly or through a script with a shebang line. + * It also unconditionally updates the environment variables so bare `node` commands execute + * the shim script instead of Node's binary. + * + * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files. + * @param options {InternalSpawnOptions} Original internal spawn options. + * @return {InternalSpawnOptions} Updated internal spawn options. + */ +function munge(workingDir, options) { + const basename = getExeBasename(options.file); + + // XXX: dry this + if (isSh(basename)) { + options = mungeSh(workingDir, options) + } else if (isCmd(basename)) { + options = mungeCmd(workingDir, options) + } else if (isNode(basename)) { + options = mungeNode(workingDir, options) + } else if (isNpm(basename)) { + // XXX unnecessary? on non-windows, npm is just another shebang + options = mungeNpm(workingDir, options) + } else { + options = mungeShebang(workingDir, options) + } + + // now the options are munged into shape. + // whether we changed something or not, we still update the PATH + // so that if a script somewhere calls `node foo`, it gets our + // wrapper instead. + + options = mungeEnv(workingDir, options) + + return options +} + +module.exports = munge diff --git a/node_modules/spawn-wrap/lib/mungers/cmd.js b/node_modules/spawn-wrap/lib/mungers/cmd.js new file mode 100644 index 0000000..d2c13bd --- /dev/null +++ b/node_modules/spawn-wrap/lib/mungers/cmd.js @@ -0,0 +1,59 @@ +'use strict'; + +const path = require("path") +const whichOrUndefined = require("../which-or-undefined") + +/** + * Intercepts Node and npm processes spawned through Windows' `cmd.exe`. + * + * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files. + * @param options {import("../munge").InternalSpawnOptions} Original internal spawn options. + * @return {import("../munge").InternalSpawnOptions} Updated internal spawn options. + */ +function mungeCmd(workingDir, options) { + const cmdi = options.args.indexOf('/c') + if (cmdi === -1) { + return {...options} + } + + const re = /^\s*("*)([^"]*?\bnode(?:\.exe|\.EXE)?)("*)( .*)?$/ + const npmre = /^\s*("*)([^"]*?\b(?:npm))("*)( |$)/ + + const command = options.args[cmdi + 1] + if (command === undefined) { + return {...options} + } + + let newArgs = [...options.args]; + // Remember the original Node command to use it in the shim + let originalNode; + + let m = command.match(re) + let replace + if (m) { + originalNode = m[2] + // TODO: Remove `replace`: seems unused + replace = m[1] + path.join(workingDir, 'node.cmd') + m[3] + m[4] + newArgs[cmdi + 1] = m[1] + m[2] + m[3] + + ' "' + path.join(workingDir, 'node') + '"' + m[4] + } else { + // XXX probably not a good idea to rewrite to the first npm in the + // path if it's a full path to npm. And if it's not a full path to + // npm, then the dirname will not work properly! + m = command.match(npmre) + if (m === null) { + return {...options} + } + + let npmPath = whichOrUndefined('npm') || 'npm' + npmPath = path.join(path.dirname(npmPath), 'node_modules', 'npm', 'bin', 'npm-cli.js') + replace = m[1] + '"' + path.join(workingDir, 'node.cmd') + '"' + + ' "' + npmPath + '"' + + m[3] + m[4] + newArgs[cmdi + 1] = command.replace(npmre, replace) + } + + return {...options, args: newArgs, originalNode}; +} + +module.exports = mungeCmd diff --git a/node_modules/spawn-wrap/lib/mungers/env.js b/node_modules/spawn-wrap/lib/mungers/env.js new file mode 100644 index 0000000..c4a558a --- /dev/null +++ b/node_modules/spawn-wrap/lib/mungers/env.js @@ -0,0 +1,49 @@ +'use strict'; + +const isWindows = require("is-windows") +const path = require("path") +const homedir = require("../homedir") + +const pathRe = isWindows() ? /^PATH=/i : /^PATH=/; + +/** + * Updates the environment variables to intercept `node` commands and pass down options. + * + * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files. + * @param options {import("../munge").InternalSpawnOptions} Original internal spawn options. + * @return {import("../munge").InternalSpawnOptions} Updated internal spawn options. + */ +function mungeEnv(workingDir, options) { + let pathEnv + + const envPairs = options.envPairs.map((ep) => { + if (pathRe.test(ep)) { + // `PATH` env var: prefix its value with `workingDir` + // `5` corresponds to the length of `PATH=` + pathEnv = ep.substr(5) + const k = ep.substr(0, 5) + return k + workingDir + path.delimiter + pathEnv + } else { + // Return as-is + return ep; + } + }); + + if (pathEnv === undefined) { + envPairs.push((isWindows() ? 'Path=' : 'PATH=') + workingDir) + } + if (options.originalNode) { + const key = path.basename(workingDir).substr('.node-spawn-wrap-'.length) + envPairs.push('SW_ORIG_' + key + '=' + options.originalNode) + } + + envPairs.push('SPAWN_WRAP_SHIM_ROOT=' + homedir) + + if (process.env.SPAWN_WRAP_DEBUG === '1') { + envPairs.push('SPAWN_WRAP_DEBUG=1') + } + + return {...options, envPairs}; +} + +module.exports = mungeEnv diff --git a/node_modules/spawn-wrap/lib/mungers/node.js b/node_modules/spawn-wrap/lib/mungers/node.js new file mode 100644 index 0000000..76b3e05 --- /dev/null +++ b/node_modules/spawn-wrap/lib/mungers/node.js @@ -0,0 +1,79 @@ +'use strict'; + +const path = require('path') +const {debug} = require("../debug") +const {getExeBasename} = require("../exe-type") +const whichOrUndefined = require("../which-or-undefined") + +/** + * Intercepts Node spawned processes. + * + * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files. + * @param options {import("../munge").InternalSpawnOptions} Original internal spawn options. + * @return {import("../munge").InternalSpawnOptions} Updated internal spawn options. + */ +function mungeNode(workingDir, options) { + // Remember the original Node command to use it in the shim + const originalNode = options.file + + const command = getExeBasename(options.file) + // make sure it has a main script. + // otherwise, just let it through. + let a = 0 + let hasMain = false + let mainIndex = 1 + for (a = 1; !hasMain && a < options.args.length; a++) { + switch (options.args[a]) { + case '-p': + case '-i': + case '--interactive': + case '--eval': + case '-e': + case '-pe': + hasMain = false + a = options.args.length + continue + + case '-r': + case '--require': + a += 1 + continue + + default: + // TODO: Double-check this part + if (options.args[a].startsWith('-')) { + continue + } else { + hasMain = true + mainIndex = a + a = options.args.length + break + } + } + } + + const newArgs = [...options.args]; + let newFile = options.file; + + if (hasMain) { + const replace = path.join(workingDir, command) + newArgs.splice(mainIndex, 0, replace) + } + + // If the file is just something like 'node' then that'll + // resolve to our shim, and so to prevent double-shimming, we need + // to resolve that here first. + // This also handles the case where there's not a main file, like + // `node -e 'program'`, where we want to avoid the shim entirely. + if (options.file === command) { + const realNode = whichOrUndefined(options.file) || process.execPath + newArgs[0] = realNode + newFile = realNode + } + + debug('mungeNode after', options.file, options.args) + + return {...options, file: newFile, args: newArgs, originalNode}; +} + +module.exports = mungeNode diff --git a/node_modules/spawn-wrap/lib/mungers/npm.js b/node_modules/spawn-wrap/lib/mungers/npm.js new file mode 100644 index 0000000..803b050 --- /dev/null +++ b/node_modules/spawn-wrap/lib/mungers/npm.js @@ -0,0 +1,32 @@ +'use strict'; + +const path = require("path") +const {debug} = require("../debug") +const whichOrUndefined = require("../which-or-undefined") + +/** + * Intercepts npm spawned processes. + * + * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files. + * @param options {import("../munge").InternalSpawnOptions} Original internal spawn options. + * @return {import("../munge").InternalSpawnOptions} Updated internal spawn options. + */ +function mungeNpm(workingDir, options) { + debug('munge npm') + // XXX weird effects of replacing a specific npm with a global one + const npmPath = whichOrUndefined('npm') + + if (npmPath === undefined) { + return {...options}; + } + + const newArgs = [...options.args] + + newArgs[0] = npmPath + const file = path.join(workingDir, 'node') + newArgs.unshift(file) + + return {...options, file, args: newArgs} +} + +module.exports = mungeNpm diff --git a/node_modules/spawn-wrap/lib/mungers/sh.js b/node_modules/spawn-wrap/lib/mungers/sh.js new file mode 100644 index 0000000..4107cb4 --- /dev/null +++ b/node_modules/spawn-wrap/lib/mungers/sh.js @@ -0,0 +1,61 @@ +'use strict'; + +const isWindows = require("is-windows") +const path = require("path") +const {debug} = require("../debug") +const {isNode} = require("../exe-type") +const whichOrUndefined = require("../which-or-undefined") + +/** + * Intercepts Node and npm processes spawned through a Linux shell. + * + * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files. + * @param options {import("../munge").InternalSpawnOptions} Original internal spawn options. + * @return {import("../munge").InternalSpawnOptions} Updated internal spawn options. + */ +function mungeSh(workingDir, options) { + const cmdi = options.args.indexOf('-c') + if (cmdi === -1) { + return {...options} // no -c argument + } + + let c = options.args[cmdi + 1] + const re = /^\s*((?:[^\= ]*\=[^\=\s]*)*[\s]*)([^\s]+|"[^"]+"|'[^']+')( .*)?$/ + const match = c.match(re) + if (match === null) { + return {...options} // not a command invocation. weird but possible + } + + let command = match[2] + // strip quotes off the command + const quote = command.charAt(0) + if ((quote === '"' || quote === '\'') && command.endsWith(quote)) { + command = command.slice(1, -1) + } + const exe = path.basename(command) + + let newArgs = [...options.args]; + // Remember the original Node command to use it in the shim + let originalNode; + const workingNode = path.join(workingDir, 'node') + + if (isNode(exe)) { + originalNode = command + c = `${match[1]}${match[2]} "${workingNode}" ${match[3]}` + newArgs[cmdi + 1] = c + } else if (exe === 'npm' && !isWindows()) { + // XXX this will exhibit weird behavior when using /path/to/npm, + // if some other npm is first in the path. + const npmPath = whichOrUndefined('npm') + + if (npmPath) { + c = c.replace(re, `$1 "${workingNode}" "${npmPath}" $3`) + newArgs[cmdi + 1] = c + debug('npm munge!', c) + } + } + + return {...options, args: newArgs, originalNode}; +} + +module.exports = mungeSh diff --git a/node_modules/spawn-wrap/lib/mungers/shebang.js b/node_modules/spawn-wrap/lib/mungers/shebang.js new file mode 100644 index 0000000..6357347 --- /dev/null +++ b/node_modules/spawn-wrap/lib/mungers/shebang.js @@ -0,0 +1,43 @@ +'use strict'; + +const fs = require("fs") +const path = require("path") +const {isNode} = require("../exe-type") +const whichOrUndefined = require("../which-or-undefined") + +/** + * Intercepts processes spawned through a script with a shebang line. + * + * @param workingDir {string} Absolute system-dependent path to the directory containing the shim files. + * @param options {import("../munge").InternalSpawnOptions} Original internal spawn options. + * @return {import("../munge").InternalSpawnOptions} Updated internal spawn options. + */ +function mungeShebang(workingDir, options) { + const resolved = whichOrUndefined(options.file) + if (resolved === undefined) { + return {...options} + } + + const shebang = fs.readFileSync(resolved, 'utf8') + const match = shebang.match(/^#!([^\r\n]+)/) + if (!match) { + return {...options} // not a shebang script, probably a binary + } + + const shebangbin = match[1].split(' ')[0] + const maybeNode = path.basename(shebangbin) + if (!isNode(maybeNode)) { + return {...options} // not a node shebang, leave untouched + } + + const originalNode = shebangbin + const file = shebangbin + const args = [shebangbin, path.join(workingDir, maybeNode)] + .concat(resolved) + .concat(match[1].split(' ').slice(1)) + .concat(options.args.slice(1)) + + return {...options, file, args, originalNode}; +} + +module.exports = mungeShebang diff --git a/node_modules/spawn-wrap/lib/which-or-undefined.js b/node_modules/spawn-wrap/lib/which-or-undefined.js new file mode 100644 index 0000000..2cdf4f1 --- /dev/null +++ b/node_modules/spawn-wrap/lib/which-or-undefined.js @@ -0,0 +1,12 @@ +'use strict'; + +const which = require("which") + +function whichOrUndefined(executable) { + try { + return which.sync(executable) + } catch (error) { + } +} + +module.exports = whichOrUndefined diff --git a/node_modules/spawn-wrap/node_modules/foreground-child/CHANGELOG.md b/node_modules/spawn-wrap/node_modules/foreground-child/CHANGELOG.md new file mode 100644 index 0000000..8d055c9 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/foreground-child/CHANGELOG.md @@ -0,0 +1,99 @@ +# Changes + +## v2.0.0 + +* BREAKING CHANGE: Require Node 8 +* Internal: Add lock file +* Support async before exit callback +* Update various dependencies + +## v1.5.6 + +* Fix 'childHangup is undefined' + +## v1.5.5 + +* add files list to package.json +* neveragain.tech pledge request + +## v1.5.4 + +* update tap to v8 +* Let the child decide if signals should be fatal + +## v1.5.3 + +* bump deps + +## v1.5.2 + +* add an automatic changelog script +* replace cross-spawn-async with cross-spawn +* test: stay alive long enough to be signaled + +## v1.5.1 + +* avoid race condition in test +* Use fd numbers instead of 'inherit' for Node v0.10 compatibility + +## v1.5.0 + +* add caveats re IPC and arbitrary FDs +* Forward IPC messages to foregrounded child process + +## v1.4.0 + +* Set `process.exitCode` based on the child’s exit code + +## v1.3.5 + +* Better testing for when cross-spawn-async needed +* appveyor: node v0.10 on windows is too flaky + +## v1.3.4 + +* Only use cross-spawn-async for shebangs +* update vanity badges and package.json for repo move +* appveyor + +## v1.3.3 + +* Skip signals in tests on Windows +* update to tap@4 +* use cross-spawn-async on windows + +## v1.3.2 + +* Revert "switch to win-spawn" +* Revert "Transparently translate high-order exit code to appropriate signal" +* update travis versions +* Transparently translate high-order exit code to appropriate signal +* ignore coverage folder + +## v1.3.1 + +* switch to win-spawn + +## v1.3.0 + +* note skipped test in test output +* left an unused var c in +* slice arguments, added documentation +* added a unit test, because I strive to be a good open-source-citizen +* make travis also work on 0.12 and iojs again +* added badge +* patch for travis exit weirdness +* fix typo in .gitignore +* beforeExit hook + +## v1.2.0 + +* Use signal-exit, fix kill(process.pid) race + +## v1.1.0 + +* Enforce that parent always gets a 'exit' event + +## v1.0.0 + +* first diff --git a/node_modules/spawn-wrap/node_modules/foreground-child/LICENSE b/node_modules/spawn-wrap/node_modules/foreground-child/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/foreground-child/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/spawn-wrap/node_modules/foreground-child/README.md b/node_modules/spawn-wrap/node_modules/foreground-child/README.md new file mode 100644 index 0000000..54425f5 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/foreground-child/README.md @@ -0,0 +1,62 @@ +# foreground-child + +[![Build Status](https://travis-ci.org/tapjs/foreground-child.svg)](https://travis-ci.org/tapjs/foreground-child) [![Build status](https://ci.appveyor.com/api/projects/status/kq9ylvx9fyr9khx0?svg=true)](https://ci.appveyor.com/project/isaacs/foreground-child) + +Run a child as if it's the foreground process. Give it stdio. Exit +when it exits. + +Mostly this module is here to support some use cases around wrapping +child processes for test coverage and such. + +## USAGE + +```js +var foreground = require('foreground-child') + +// cats out this file +var child = foreground('cat', [__filename]) + +// At this point, it's best to just do nothing else. +// return or whatever. +// If the child gets a signal, or just exits, then this +// parent process will exit in the same way. +``` + +A callback can optionally be provided, if you want to perform an action +before your foreground-child exits: + +```js +var child = foreground('cat', [__filename], function (done) { + // perform an action. + return done() +}) +``` + +The callback can return a Promise instead of calling `done`: + +```js +var child = foreground('cat', [__filename], async function () { + // perform an action. +}) +``` + +The callback must not throw or reject. + +## Caveats + +The "normal" standard IO file descriptors (0, 1, and 2 for stdin, +stdout, and stderr respectively) are shared with the child process. +Additionally, if there is an IPC channel set up in the parent, then +messages are proxied to the child on file descriptor 3. + +However, in Node, it's possible to also map arbitrary file descriptors +into a child process. In these cases, foreground-child will not map +the file descriptors into the child. If file descriptors 0, 1, or 2 +are used for the IPC channel, then strange behavior may happen (like +printing IPC messages to stderr, for example). + +Note that a SIGKILL will always kill the parent process, _and never +the child process_, because SIGKILL cannot be caught or proxied. The +only way to do this would be if Node provided a way to truly exec a +process as the new foreground program in the same process space, +without forking a separate child process. diff --git a/node_modules/spawn-wrap/node_modules/foreground-child/changelog.sh b/node_modules/spawn-wrap/node_modules/foreground-child/changelog.sh new file mode 100644 index 0000000..be61b4f --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/foreground-child/changelog.sh @@ -0,0 +1,10 @@ +#!/bin/bash +( + echo '# Changes' + echo '' + git log --first-parent --pretty=format:'%s' \ + | grep -v '^update changelog' \ + | grep -v 'beta' \ + | perl -p -e 's/^((v?[0-9]+\.?)+)?$/\n## \1\n/g' \ + | perl -p -e 's/^([^#\s].*)$/* \1/g' +)> CHANGELOG.md diff --git a/node_modules/spawn-wrap/node_modules/foreground-child/index.js b/node_modules/spawn-wrap/node_modules/foreground-child/index.js new file mode 100644 index 0000000..3a3f051 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/foreground-child/index.js @@ -0,0 +1,133 @@ +const signalExit = require('signal-exit') +/* istanbul ignore next */ +const spawn = process.platform === 'win32' ? require('cross-spawn') : require('child_process').spawn + +/** + * Normalizes the arguments passed to `foregroundChild`. + * + * See the signature of `foregroundChild` for the supported arguments. + * + * @param fgArgs Array of arguments passed to `foregroundChild`. + * @return Normalized arguments + * @internal + */ +function normalizeFgArgs(fgArgs) { + let program, args, cb; + let processArgsEnd = fgArgs.length; + const lastFgArg = fgArgs[fgArgs.length - 1]; + if (typeof lastFgArg === "function") { + cb = lastFgArg; + processArgsEnd -= 1; + } else { + cb = (done) => done(); + } + + if (Array.isArray(fgArgs[0])) { + [program, ...args] = fgArgs[0]; + } else { + program = fgArgs[0]; + args = Array.isArray(fgArgs[1]) ? fgArgs[1] : fgArgs.slice(1, processArgsEnd); + } + + return {program, args, cb}; +} + +/** + * + * Signatures: + * ``` + * (program: string | string[], cb?: CloseHandler); + * (program: string, args: string[], cb?: CloseHandler); + * (program: string, ...args: string[], cb?: CloseHandler); + * ``` + */ +function foregroundChild (...fgArgs) { + const {program, args, cb} = normalizeFgArgs(fgArgs); + + const spawnOpts = { stdio: [0, 1, 2] } + + if (process.send) { + spawnOpts.stdio.push('ipc') + } + + const child = spawn(program, args, spawnOpts) + + const unproxySignals = proxySignals(process, child) + process.on('exit', childHangup) + function childHangup () { + child.kill('SIGHUP') + } + + child.on('close', (code, signal) => { + // Allow the callback to inspect the child’s exit code and/or modify it. + process.exitCode = signal ? 128 + signal : code + + let done = false; + const doneCB = () => { + if (done) { + return + } + + done = true + unproxySignals() + process.removeListener('exit', childHangup) + if (signal) { + // If there is nothing else keeping the event loop alive, + // then there's a race between a graceful exit and getting + // the signal to this process. Put this timeout here to + // make sure we're still alive to get the signal, and thus + // exit with the intended signal code. + /* istanbul ignore next */ + setTimeout(function () {}, 200) + process.kill(process.pid, signal) + } else { + process.exit(process.exitCode) + } + }; + + const result = cb(doneCB); + if (result && result.then) { + result.then(doneCB); + } + }) + + if (process.send) { + process.removeAllListeners('message') + + child.on('message', (message, sendHandle) => { + process.send(message, sendHandle) + }) + + process.on('message', (message, sendHandle) => { + child.send(message, sendHandle) + }) + } + + return child +} + +/** + * Starts forwarding signals to `child` through `parent`. + * + * @param parent Parent process. + * @param child Child Process. + * @return `unproxy` function to stop the forwarding. + * @internal + */ +function proxySignals (parent, child) { + const listeners = new Map() + + for (const sig of signalExit.signals()) { + const listener = () => child.kill(sig) + listeners.set(sig, listener) + parent.on(sig, listener) + } + + return function unproxySignals () { + for (const [sig, listener] of listeners) { + parent.removeListener(sig, listener) + } + } +} + +module.exports = foregroundChild diff --git a/node_modules/spawn-wrap/node_modules/foreground-child/package.json b/node_modules/spawn-wrap/node_modules/foreground-child/package.json new file mode 100644 index 0000000..f7454f1 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/foreground-child/package.json @@ -0,0 +1,40 @@ +{ + "name": "foreground-child", + "version": "2.0.0", + "description": "Run a child as if it's the foreground process. Give it stdio. Exit when it exits.", + "main": "index.js", + "engines": { + "node": ">=8.0.0" + }, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "devDependencies": { + "tap": "^14.6.1" + }, + "scripts": { + "test": "tap", + "changelog": "bash changelog.sh", + "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}" + }, + "tap": { + "jobs": 1 + }, + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/foreground-child.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/tapjs/foreground-child/issues" + }, + "homepage": "https://github.com/tapjs/foreground-child#readme", + "directories": { + "test": "test" + }, + "files": [ + "index.js" + ] +} diff --git a/node_modules/spawn-wrap/node_modules/signal-exit/LICENSE.txt b/node_modules/spawn-wrap/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 0000000..eead04a --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/spawn-wrap/node_modules/signal-exit/README.md b/node_modules/spawn-wrap/node_modules/signal-exit/README.md new file mode 100644 index 0000000..f9c7c00 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/signal-exit/README.md @@ -0,0 +1,39 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the process to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/node_modules/spawn-wrap/node_modules/signal-exit/index.js b/node_modules/spawn-wrap/node_modules/signal-exit/index.js new file mode 100644 index 0000000..93703f3 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/signal-exit/index.js @@ -0,0 +1,202 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +var process = global.process + +const processOk = function (process) { + return process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function' +} + +// some kind of non-node environment, just no-op +/* istanbul ignore if */ +if (!processOk(process)) { + module.exports = function () { + return function () {} + } +} else { + var assert = require('assert') + var signals = require('./signals.js') + var isWin = /^win/i.test(process.platform) + + var EE = require('events') + /* istanbul ignore if */ + if (typeof EE !== 'function') { + EE = EE.EventEmitter + } + + var emitter + if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ + } else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} + } + + // Because this emitter is a global, we have to check to see if a + // previous version of this library failed to enable infinite listeners. + // I know what you're about to say. But literally everything about + // signal-exit is a compromise with evil. Get used to it. + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true + } + + module.exports = function (cb, opts) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return function () {} + } + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove + } + + var unload = function unload () { + if (!loaded || !processOk(global.process)) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 + } + module.exports.unload = unload + + var emit = function emit (event, code, signal) { + /* istanbul ignore if */ + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) + } + + // { : , ... } + var sigListeners = {} + signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + if (isWin && sig === 'SIGHUP') { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + sig = 'SIGINT' + } + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } + }) + + module.exports.signals = function () { + return signals + } + + var loaded = false + + var load = function load () { + if (loaded || !processOk(global.process)) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit + } + module.exports.load = load + + var originalProcessReallyExit = process.reallyExit + var processReallyExit = function processReallyExit (code) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + process.exitCode = code || /* istanbul ignore next */ 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) + } + + var originalProcessEmit = process.emit + var processEmit = function processEmit (ev, arg) { + if (ev === 'exit' && processOk(global.process)) { + /* istanbul ignore else */ + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + /* istanbul ignore next */ + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } + } +} diff --git a/node_modules/spawn-wrap/node_modules/signal-exit/package.json b/node_modules/spawn-wrap/node_modules/signal-exit/package.json new file mode 100644 index 0000000..e1a0031 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/signal-exit/package.json @@ -0,0 +1,38 @@ +{ + "name": "signal-exit", + "version": "3.0.7", + "description": "when you want to fire an event no matter how a process exits.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "files": [ + "index.js", + "signals.js" + ], + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, + "keywords": [ + "signal", + "exit" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "homepage": "https://github.com/tapjs/signal-exit", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^3.1.1", + "nyc": "^15.1.0", + "standard-version": "^9.3.1", + "tap": "^15.1.1" + } +} diff --git a/node_modules/spawn-wrap/node_modules/signal-exit/signals.js b/node_modules/spawn-wrap/node_modules/signal-exit/signals.js new file mode 100644 index 0000000..3bd67a8 --- /dev/null +++ b/node_modules/spawn-wrap/node_modules/signal-exit/signals.js @@ -0,0 +1,53 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/node_modules/spawn-wrap/package.json b/node_modules/spawn-wrap/package.json new file mode 100644 index 0000000..e0cfc5c --- /dev/null +++ b/node_modules/spawn-wrap/package.json @@ -0,0 +1,45 @@ +{ + "name": "spawn-wrap", + "version": "2.0.0", + "description": "Wrap all spawned Node.js child processes by adding environs and arguments ahead of the main JavaScript file argument.", + "main": "index.js", + "engines": { + "node": ">=8" + }, + "dependencies": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "scripts": { + "test": "tap", + "release": "standard-version", + "clean": "rm -rf ~/.node-spawn-wrap-*" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/istanbuljs/spawn-wrap.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/istanbuljs/spawn-wrap/issues" + }, + "homepage": "https://github.com/istanbuljs/spawn-wrap#readme", + "devDependencies": { + "standard-version": "^7.1.0", + "tap": "^14.10.5" + }, + "files": [ + "lib/", + "index.js", + "shim.js" + ], + "tap": { + "coverage": false, + "timeout": 240 + } +} diff --git a/node_modules/spawn-wrap/shim.js b/node_modules/spawn-wrap/shim.js new file mode 100644 index 0000000..ae3ffc5 --- /dev/null +++ b/node_modules/spawn-wrap/shim.js @@ -0,0 +1,156 @@ +'use strict' + +// This module should *only* be loaded as a main script +// by child processes wrapped by spawn-wrap. It sets up +// argv to include the injected argv (including the user's +// wrapper script) and any environment variables specified. +// +// If any argv were passed in (ie, if it's used to force +// a wrapper script, and not just ensure that an env is kept +// around through all the child procs), then we also set up +// a require('spawn-wrap').runMain() function that will strip +// off the injected arguments and run the main file. + +// wrap in iife for babylon to handle module-level return +;(function () { + + if (module !== require.main) { + throw new Error('spawn-wrap: cli wrapper invoked as non-main script') + } + + const Module = require('module') + const path = require('path') + const settings = require('./settings.json') + const {debug} = require(settings.deps.debug) + + debug('shim', [process.argv[0]].concat(process.execArgv, process.argv.slice(1))) + + const foregroundChild = require(settings.deps.foregroundChild) + const IS_WINDOWS = settings.isWindows + const argv = settings.argv + const nargs = argv.length + const env = settings.env + const key = settings.key + const node = process.env['SW_ORIG_' + key] || process.execPath + + Object.assign(process.env, env) + + const needExecArgv = settings.execArgv || [] + + // If the user added their OWN wrapper pre-load script, then + // this will pop that off of the argv, and load the "real" main + function runMain () { + debug('runMain pre', process.argv) + process.argv.splice(1, nargs) + process.argv[1] = path.resolve(process.argv[1]) + delete require.cache[process.argv[1]] + debug('runMain post', process.argv) + Module.runMain() + debug('runMain after') + } + + // Argv coming in looks like: + // bin shim execArgv main argv + // + // Turn it into: + // bin settings.execArgv execArgv settings.argv main argv + // + // If we don't have a main script, then just run with the necessary + // execArgv + let hasMain = false + for (let a = 2; !hasMain && a < process.argv.length; a++) { + switch (process.argv[a]) { + case '-i': + case '--interactive': + case '--eval': + case '-e': + case '-p': + case '-pe': + hasMain = false + a = process.argv.length + continue + + case '-r': + case '--require': + a += 1 + continue + + default: + // TODO: Double-check what's going on + if (process.argv[a].startsWith('-')) { + continue + } else { + hasMain = a + a = process.argv.length + break + } + } + } + debug('after argv parse hasMain=%j', hasMain) + + if (hasMain > 2) { + // if the main file is above #2, then it means that there + // was a --exec_arg *before* it. This means that we need + // to slice everything from 2 to hasMain, and pass that + // directly to node. This also splices out the user-supplied + // execArgv from the argv. + const addExecArgv = process.argv.splice(2, hasMain - 2) + needExecArgv.push(...addExecArgv) + } + + if (!hasMain) { + // we got loaded by mistake for a `node -pe script` or something. + const args = process.execArgv.concat(needExecArgv, process.argv.slice(2)) + debug('no main file!', args) + foregroundChild(node, args) + return + } + + // If there are execArgv, and they're not the same as how this module + // was executed, then we need to inject those. This is for stuff like + // --harmony or --use_strict that needs to be *before* the main + // module. + if (needExecArgv.length) { + const pexec = process.execArgv + if (JSON.stringify(pexec) !== JSON.stringify(needExecArgv)) { + debug('need execArgv for this', pexec, '=>', needExecArgv) + const sargs = pexec.concat(needExecArgv).concat(process.argv.slice(1)) + foregroundChild(node, sargs) + return + } + } + + // At this point, we've verified that we got the correct execArgv, + // and that we have a main file, and that the main file is sitting at + // argv[2]. Splice this shim off the list so it looks like the main. + process.argv.splice(1, 1, ...argv) + + // Unwrap the PATH environment var so that we're not mucking + // with the environment. It'll get re-added if they spawn anything + if (IS_WINDOWS) { + for (const i in process.env) { + if (/^path$/i.test(i)) { + process.env[i] = process.env[i].replace(__dirname + ';', '') + } + } + } else { + process.env.PATH = process.env.PATH.replace(__dirname + ':', '') + } + + const spawnWrap = require(settings.module) + if (nargs) { + spawnWrap.runMain = function (original) { + return function () { + spawnWrap.runMain = original + runMain() + } + }(spawnWrap.runMain) + } + spawnWrap(argv, env, __dirname) + + debug('shim runMain', process.argv) + delete require.cache[process.argv[1]] + Module.runMain() + +// end iife wrapper for babylon +})() diff --git a/node_modules/sprintf-js/.npmignore b/node_modules/sprintf-js/.npmignore new file mode 100644 index 0000000..096746c --- /dev/null +++ b/node_modules/sprintf-js/.npmignore @@ -0,0 +1 @@ +/node_modules/ \ No newline at end of file diff --git a/node_modules/sprintf-js/LICENSE b/node_modules/sprintf-js/LICENSE new file mode 100644 index 0000000..663ac52 --- /dev/null +++ b/node_modules/sprintf-js/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2007-2014, Alexandru Marasteanu +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of this software nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/sprintf-js/README.md b/node_modules/sprintf-js/README.md new file mode 100644 index 0000000..8386356 --- /dev/null +++ b/node_modules/sprintf-js/README.md @@ -0,0 +1,88 @@ +# sprintf.js +**sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. + +Its prototype is simple: + + string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) + +The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: + +* An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. +* An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. +* An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. +* An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. +* An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. +* An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. +* A type specifier that can be any of: + * `%` — yields a literal `%` character + * `b` — yields an integer as a binary number + * `c` — yields an integer as the character with that ASCII value + * `d` or `i` — yields an integer as a signed decimal number + * `e` — yields a float using scientific notation + * `u` — yields an integer as an unsigned decimal number + * `f` — yields a float as is; see notes on precision above + * `g` — yields a float as is; see notes on precision above + * `o` — yields an integer as an octal number + * `s` — yields a string as is + * `x` — yields an integer as a hexadecimal number (lower-case) + * `X` — yields an integer as a hexadecimal number (upper-case) + * `j` — yields a JavaScript object or array as a JSON encoded string + +## JavaScript `vsprintf` +`vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: + + vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) + +## Argument swapping +You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: + + sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") +And, of course, you can repeat the placeholders without having to increase the number of arguments. + +## Named arguments +Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: + + var user = { + name: "Dolly" + } + sprintf("Hello %(name)s", user) // Hello Dolly +Keywords in replacement fields can be optionally followed by any number of keywords or indexes: + + var users = [ + {name: "Dolly"}, + {name: "Molly"}, + {name: "Polly"} + ] + sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly +Note: mixing positional and named placeholders is not (yet) supported + +## Computed values +You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. + + sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 + sprintf("Current date and time: %s", function() { return new Date().toString() }) + +# AngularJS +You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. + +# Installation + +## Via Bower + + bower install sprintf + +## Or as a node.js module + + npm install sprintf-js + +### Usage + + var sprintf = require("sprintf-js").sprintf, + vsprintf = require("sprintf-js").vsprintf + + sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") + vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) + +# License + +**sprintf.js** is licensed under the terms of the 3-clause BSD license. diff --git a/node_modules/sprintf-js/bower.json b/node_modules/sprintf-js/bower.json new file mode 100644 index 0000000..d90a759 --- /dev/null +++ b/node_modules/sprintf-js/bower.json @@ -0,0 +1,14 @@ +{ + "name": "sprintf", + "description": "JavaScript sprintf implementation", + "version": "1.0.3", + "main": "src/sprintf.js", + "license": "BSD-3-Clause-Clear", + "keywords": ["sprintf", "string", "formatting"], + "authors": ["Alexandru Marasteanu (http://alexei.ro/)"], + "homepage": "https://github.com/alexei/sprintf.js", + "repository": { + "type": "git", + "url": "git://github.com/alexei/sprintf.js.git" + } +} diff --git a/node_modules/sprintf-js/demo/angular.html b/node_modules/sprintf-js/demo/angular.html new file mode 100644 index 0000000..3559efd --- /dev/null +++ b/node_modules/sprintf-js/demo/angular.html @@ -0,0 +1,20 @@ + + + + + + + + +
{{ "%+010d"|sprintf:-123 }}
+
{{ "%+010d"|vsprintf:[-123] }}
+
{{ "%+010d"|fmt:-123 }}
+
{{ "%+010d"|vfmt:[-123] }}
+
{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
+
{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
+ + + + diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js b/node_modules/sprintf-js/dist/angular-sprintf.min.js new file mode 100644 index 0000000..dbaf744 --- /dev/null +++ b/node_modules/sprintf-js/dist/angular-sprintf.min.js @@ -0,0 +1,4 @@ +/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ + +angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); +//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/node_modules/sprintf-js/dist/angular-sprintf.min.js.map new file mode 100644 index 0000000..055964c --- /dev/null +++ b/node_modules/sprintf-js/dist/angular-sprintf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.map b/node_modules/sprintf-js/dist/angular-sprintf.min.map new file mode 100644 index 0000000..055964c --- /dev/null +++ b/node_modules/sprintf-js/dist/angular-sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js b/node_modules/sprintf-js/dist/sprintf.min.js new file mode 100644 index 0000000..dc61e51 --- /dev/null +++ b/node_modules/sprintf-js/dist/sprintf.min.js @@ -0,0 +1,4 @@ +/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ + +!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); +//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js.map b/node_modules/sprintf-js/dist/sprintf.min.js.map new file mode 100644 index 0000000..369dbaf --- /dev/null +++ b/node_modules/sprintf-js/dist/sprintf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAA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AbtB,KADAC,EAAWA,EAAWzB,QAAU2B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG3B,UACnE,GAA8D,QAAzD2B,EAAcjD,EAAGQ,WAAWqC,KAAKG,IAClCD,EAAWA,EAAWzB,QAAU2B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAcjD,EAAGS,aAAaoC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.map b/node_modules/sprintf-js/dist/sprintf.min.map new file mode 100644 index 0000000..ee011aa --- /dev/null +++ b/node_modules/sprintf-js/dist/sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GAvLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,UACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAI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D,EAAWA,EAAW1B,QAAU4B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAclD,EAAGS,aAAaqC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAW1B,QAAU4B,EAAY,GAUxDlC,EAAM,GAAKgC,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAInB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC4B,EAAOA,EAAKL,UAAUvB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIwC,GAAW,SAASR,EAAK/B,EAAMwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/gruntfile.js b/node_modules/sprintf-js/gruntfile.js new file mode 100644 index 0000000..246e1c3 --- /dev/null +++ b/node_modules/sprintf-js/gruntfile.js @@ -0,0 +1,36 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + + uglify: { + options: { + banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", + sourceMap: true + }, + build: { + files: [ + { + src: "src/sprintf.js", + dest: "dist/sprintf.min.js" + }, + { + src: "src/angular-sprintf.js", + dest: "dist/angular-sprintf.min.js" + } + ] + } + }, + + watch: { + js: { + files: "src/*.js", + tasks: ["uglify"] + } + } + }) + + grunt.loadNpmTasks("grunt-contrib-uglify") + grunt.loadNpmTasks("grunt-contrib-watch") + + grunt.registerTask("default", ["uglify", "watch"]) +} diff --git a/node_modules/sprintf-js/package.json b/node_modules/sprintf-js/package.json new file mode 100644 index 0000000..75f7eca --- /dev/null +++ b/node_modules/sprintf-js/package.json @@ -0,0 +1,22 @@ +{ + "name": "sprintf-js", + "version": "1.0.3", + "description": "JavaScript sprintf implementation", + "author": "Alexandru Marasteanu (http://alexei.ro/)", + "main": "src/sprintf.js", + "scripts": { + "test": "mocha test/test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/alexei/sprintf.js.git" + }, + "license": "BSD-3-Clause", + "readmeFilename": "README.md", + "devDependencies": { + "mocha": "*", + "grunt": "*", + "grunt-contrib-watch": "*", + "grunt-contrib-uglify": "*" + } +} diff --git a/node_modules/sprintf-js/src/angular-sprintf.js b/node_modules/sprintf-js/src/angular-sprintf.js new file mode 100644 index 0000000..9c69123 --- /dev/null +++ b/node_modules/sprintf-js/src/angular-sprintf.js @@ -0,0 +1,18 @@ +angular. + module("sprintf", []). + filter("sprintf", function() { + return function() { + return sprintf.apply(null, arguments) + } + }). + filter("fmt", ["$filter", function($filter) { + return $filter("sprintf") + }]). + filter("vsprintf", function() { + return function(format, argv) { + return vsprintf(format, argv) + } + }). + filter("vfmt", ["$filter", function($filter) { + return $filter("vsprintf") + }]) diff --git a/node_modules/sprintf-js/src/sprintf.js b/node_modules/sprintf-js/src/sprintf.js new file mode 100644 index 0000000..c0fc7c0 --- /dev/null +++ b/node_modules/sprintf-js/src/sprintf.js @@ -0,0 +1,208 @@ +(function(window) { + var re = { + not_string: /[^s]/, + number: /[diefg]/, + json: /[j]/, + not_json: /[^j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, + key: /^([a-z_][a-z_\d]*)/i, + key_access: /^\.([a-z_][a-z_\d]*)/i, + index_access: /^\[(\d+)\]/, + sign: /^[\+\-]/ + } + + function sprintf() { + var key = arguments[0], cache = sprintf.cache + if (!(cache[key] && cache.hasOwnProperty(key))) { + cache[key] = sprintf.parse(key) + } + return sprintf.format.call(null, cache[key], arguments) + } + + sprintf.format = function(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" + for (i = 0; i < tree_length; i++) { + node_type = get_type(parse_tree[i]) + if (node_type === "string") { + output[output.length] = parse_tree[i] + } + else if (node_type === "array") { + match = parse_tree[i] // convenience purposes only + if (match[2]) { // keyword argument + arg = argv[cursor] + for (k = 0; k < match[2].length; k++) { + if (!arg.hasOwnProperty(match[2][k])) { + throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) + } + arg = arg[match[2][k]] + } + } + else if (match[1]) { // positional argument (explicit) + arg = argv[match[1]] + } + else { // positional argument (implicit) + arg = argv[cursor++] + } + + if (get_type(arg) == "function") { + arg = arg() + } + + if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { + throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) + } + + if (re.number.test(match[8])) { + is_positive = arg >= 0 + } + + switch (match[8]) { + case "b": + arg = arg.toString(2) + break + case "c": + arg = String.fromCharCode(arg) + break + case "d": + case "i": + arg = parseInt(arg, 10) + break + case "j": + arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) + break + case "e": + arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() + break + case "f": + arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) + break + case "g": + arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) + break + case "o": + arg = arg.toString(8) + break + case "s": + arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) + break + case "u": + arg = arg >>> 0 + break + case "x": + arg = arg.toString(16) + break + case "X": + arg = arg.toString(16).toUpperCase() + break + } + if (re.json.test(match[8])) { + output[output.length] = arg + } + else { + if (re.number.test(match[8]) && (!is_positive || match[3])) { + sign = is_positive ? "+" : "-" + arg = arg.toString().replace(re.sign, "") + } + else { + sign = "" + } + pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " + pad_length = match[6] - (sign + arg).length + pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" + output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) + } + } + } + return output.join("") + } + + sprintf.cache = {} + + sprintf.parse = function(fmt) { + var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 + while (_fmt) { + if ((match = re.text.exec(_fmt)) !== null) { + parse_tree[parse_tree.length] = match[0] + } + else if ((match = re.modulo.exec(_fmt)) !== null) { + parse_tree[parse_tree.length] = "%" + } + else if ((match = re.placeholder.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1 + var field_list = [], replacement_field = match[2], field_match = [] + if ((field_match = re.key.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { + if ((field_match = re.key_access.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + } + else if ((field_match = re.index_access.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + } + else { + throw new SyntaxError("[sprintf] failed to parse named argument key") + } + } + } + else { + throw new SyntaxError("[sprintf] failed to parse named argument key") + } + match[2] = field_list + } + else { + arg_names |= 2 + } + if (arg_names === 3) { + throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") + } + parse_tree[parse_tree.length] = match + } + else { + throw new SyntaxError("[sprintf] unexpected placeholder") + } + _fmt = _fmt.substring(match[0].length) + } + return parse_tree + } + + var vsprintf = function(fmt, argv, _argv) { + _argv = (argv || []).slice(0) + _argv.splice(0, 0, fmt) + return sprintf.apply(null, _argv) + } + + /** + * helpers + */ + function get_type(variable) { + return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() + } + + function str_repeat(input, multiplier) { + return Array(multiplier + 1).join(input) + } + + /** + * export to either browser or node.js + */ + if (typeof exports !== "undefined") { + exports.sprintf = sprintf + exports.vsprintf = vsprintf + } + else { + window.sprintf = sprintf + window.vsprintf = vsprintf + + if (typeof define === "function" && define.amd) { + define(function() { + return { + sprintf: sprintf, + vsprintf: vsprintf + } + }) + } + } +})(typeof window === "undefined" ? this : window); diff --git a/node_modules/sprintf-js/test/test.js b/node_modules/sprintf-js/test/test.js new file mode 100644 index 0000000..6f57b25 --- /dev/null +++ b/node_modules/sprintf-js/test/test.js @@ -0,0 +1,82 @@ +var assert = require("assert"), + sprintfjs = require("../src/sprintf.js"), + sprintf = sprintfjs.sprintf, + vsprintf = sprintfjs.vsprintf + +describe("sprintfjs", function() { + var pi = 3.141592653589793 + + it("should return formated strings for simple placeholders", function() { + assert.equal("%", sprintf("%%")) + assert.equal("10", sprintf("%b", 2)) + assert.equal("A", sprintf("%c", 65)) + assert.equal("2", sprintf("%d", 2)) + assert.equal("2", sprintf("%i", 2)) + assert.equal("2", sprintf("%d", "2")) + assert.equal("2", sprintf("%i", "2")) + assert.equal('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) + assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) + assert.equal("2e+0", sprintf("%e", 2)) + assert.equal("2", sprintf("%u", 2)) + assert.equal("4294967294", sprintf("%u", -2)) + assert.equal("2.2", sprintf("%f", 2.2)) + assert.equal("3.141592653589793", sprintf("%g", pi)) + assert.equal("10", sprintf("%o", 8)) + assert.equal("%s", sprintf("%s", "%s")) + assert.equal("ff", sprintf("%x", 255)) + assert.equal("FF", sprintf("%X", 255)) + assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) + assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) + }) + + it("should return formated strings for complex placeholders", function() { + // sign + assert.equal("2", sprintf("%d", 2)) + assert.equal("-2", sprintf("%d", -2)) + assert.equal("+2", sprintf("%+d", 2)) + assert.equal("-2", sprintf("%+d", -2)) + assert.equal("2", sprintf("%i", 2)) + assert.equal("-2", sprintf("%i", -2)) + assert.equal("+2", sprintf("%+i", 2)) + assert.equal("-2", sprintf("%+i", -2)) + assert.equal("2.2", sprintf("%f", 2.2)) + assert.equal("-2.2", sprintf("%f", -2.2)) + assert.equal("+2.2", sprintf("%+f", 2.2)) + assert.equal("-2.2", sprintf("%+f", -2.2)) + assert.equal("-2.3", sprintf("%+.1f", -2.34)) + assert.equal("-0.0", sprintf("%+.1f", -0.01)) + assert.equal("3.14159", sprintf("%.6g", pi)) + assert.equal("3.14", sprintf("%.3g", pi)) + assert.equal("3", sprintf("%.1g", pi)) + assert.equal("-000000123", sprintf("%+010d", -123)) + assert.equal("______-123", sprintf("%+'_10d", -123)) + assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) + + // padding + assert.equal("-0002", sprintf("%05d", -2)) + assert.equal("-0002", sprintf("%05i", -2)) + assert.equal(" <", sprintf("%5s", "<")) + assert.equal("0000<", sprintf("%05s", "<")) + assert.equal("____<", sprintf("%'_5s", "<")) + assert.equal("> ", sprintf("%-5s", ">")) + assert.equal(">0000", sprintf("%0-5s", ">")) + assert.equal(">____", sprintf("%'_-5s", ">")) + assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) + assert.equal("1234", sprintf("%02u", 1234)) + assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) + assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) + assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) + assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) + + // precision + assert.equal("2.3", sprintf("%.1f", 2.345)) + assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) + assert.equal(" x", sprintf("%5.1s", "xxxxxx")) + + }) + + it("should return formated strings for callbacks", function() { + assert.equal("foobar", sprintf("%s", function() { return "foobar" })) + assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... + }) +}) diff --git a/node_modules/sqlstring/HISTORY.md b/node_modules/sqlstring/HISTORY.md new file mode 100644 index 0000000..aea1dfc --- /dev/null +++ b/node_modules/sqlstring/HISTORY.md @@ -0,0 +1,53 @@ +2.3.3 / 2022-03-06 +================== + + * Fix escaping `Date` objects from foreign isolates + +2.3.2 / 2020-04-15 +================== + + * perf: remove outdated array pattern + +2.3.1 / 2018-02-24 +================== + + * Fix incorrectly replacing non-placeholders in SQL + +2.3.0 / 2017-10-01 +================== + + * Add `.toSqlString()` escape overriding + * Add `raw` method to wrap raw strings for escape overriding + * Small performance improvement on `escapeId` + +2.2.0 / 2016-11-01 +================== + + * Escape invalid `Date` objects as `NULL` + +2.1.0 / 2016-09-26 +================== + + * Accept numbers and other value types in `escapeId` + * Run `buffer.toString()` through escaping + +2.0.1 / 2016-06-06 +================== + + * Fix npm package to include missing `lib/` directory + +2.0.0 / 2016-06-06 +================== + + * Bring repository up-to-date with `mysql` module changes + * Support Node.js 0.6.x + +1.0.0 / 2014-11-09 +================== + + * Support Node.js 0.8.x + +0.0.1 / 2014-02-25 +================== + + * Initial release diff --git a/node_modules/sqlstring/LICENSE b/node_modules/sqlstring/LICENSE new file mode 100644 index 0000000..c7ff12a --- /dev/null +++ b/node_modules/sqlstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/node_modules/sqlstring/README.md b/node_modules/sqlstring/README.md new file mode 100644 index 0000000..a00c560 --- /dev/null +++ b/node_modules/sqlstring/README.md @@ -0,0 +1,205 @@ +# sqlstring + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +Simple SQL escape and format for MySQL + +## Install + +```sh +$ npm install sqlstring +``` + +## Usage + + +```js +var SqlString = require('sqlstring'); +``` + +### Escaping query values + +**Caution** These methods of escaping values only works when the +[NO_BACKSLASH_ESCAPES](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_backslash_escapes) +SQL mode is disabled (which is the default state for MySQL servers). + +In order to avoid SQL Injection attacks, you should always escape any user +provided data before using it inside a SQL query. You can do so using the +`SqlString.escape()` method: + +```js +var userId = 'some user provided value'; +var sql = 'SELECT * FROM users WHERE id = ' + SqlString.escape(userId); +console.log(sql); // SELECT * FROM users WHERE id = 'some user provided value' +``` + +Alternatively, you can use `?` characters as placeholders for values you would +like to have escaped like this: + +```js +var userId = 1; +var sql = SqlString.format('SELECT * FROM users WHERE id = ?', [userId]); +console.log(sql); // SELECT * FROM users WHERE id = 1 +``` + +Multiple placeholders are mapped to values in the same order as passed. For example, +in the following query `foo` equals `a`, `bar` equals `b`, `baz` equals `c`, and +`id` will be `userId`: + +```js +var userId = 1; +var sql = SqlString.format('UPDATE users SET foo = ?, bar = ?, baz = ? WHERE id = ?', + ['a', 'b', 'c', userId]); +console.log(sql); // UPDATE users SET foo = 'a', bar = 'b', baz = 'c' WHERE id = 1 +``` + +This looks similar to prepared statements in MySQL, however it really just uses +the same `SqlString.escape()` method internally. + +**Caution** This also differs from prepared statements in that all `?` are +replaced, even those contained in comments and strings. + +Different value types are escaped differently, here is how: + +* Numbers are left untouched +* Booleans are converted to `true` / `false` +* Date objects are converted to `'YYYY-mm-dd HH:ii:ss'` strings +* Buffers are converted to hex strings, e.g. `X'0fa5'` +* Strings are safely escaped +* Arrays are turned into list, e.g. `['a', 'b']` turns into `'a', 'b'` +* Nested arrays are turned into grouped lists (for bulk inserts), e.g. `[['a', + 'b'], ['c', 'd']]` turns into `('a', 'b'), ('c', 'd')` +* Objects that have a `toSqlString` method will have `.toSqlString()` called + and the returned value is used as the raw SQL. +* Objects are turned into `key = 'val'` pairs for each enumerable property on + the object. If the property's value is a function, it is skipped; if the + property's value is an object, toString() is called on it and the returned + value is used. +* `undefined` / `null` are converted to `NULL` +* `NaN` / `Infinity` are left as-is. MySQL does not support these, and trying + to insert them as values will trigger MySQL errors until they implement + support. + +You may have noticed that this escaping allows you to do neat things like this: + +```js +var post = {id: 1, title: 'Hello MySQL'}; +var sql = SqlString.format('INSERT INTO posts SET ?', post); +console.log(sql); // INSERT INTO posts SET `id` = 1, `title` = 'Hello MySQL' +``` + +And the `toSqlString` method allows you to form complex queries with functions: + +```js +var CURRENT_TIMESTAMP = { toSqlString: function() { return 'CURRENT_TIMESTAMP()'; } }; +var sql = SqlString.format('UPDATE posts SET modified = ? WHERE id = ?', [CURRENT_TIMESTAMP, 42]); +console.log(sql); // UPDATE posts SET modified = CURRENT_TIMESTAMP() WHERE id = 42 +``` + +To generate objects with a `toSqlString` method, the `SqlString.raw()` method can +be used. This creates an object that will be left un-touched when using in a `?` +placeholder, useful for using functions as dynamic values: + +**Caution** The string provided to `SqlString.raw()` will skip all escaping +functions when used, so be careful when passing in unvalidated input. + +```js +var CURRENT_TIMESTAMP = SqlString.raw('CURRENT_TIMESTAMP()'); +var sql = SqlString.format('UPDATE posts SET modified = ? WHERE id = ?', [CURRENT_TIMESTAMP, 42]); +console.log(sql); // UPDATE posts SET modified = CURRENT_TIMESTAMP() WHERE id = 42 +``` + +If you feel the need to escape queries by yourself, you can also use the escaping +function directly: + +```js +var sql = 'SELECT * FROM posts WHERE title=' + SqlString.escape('Hello MySQL'); +console.log(sql); // SELECT * FROM posts WHERE title='Hello MySQL' +``` + +### Escaping query identifiers + +If you can't trust an SQL identifier (database / table / column name) because it is +provided by a user, you should escape it with `SqlString.escapeId(identifier)` like this: + +```js +var sorter = 'date'; +var sql = 'SELECT * FROM posts ORDER BY ' + SqlString.escapeId(sorter); +console.log(sql); // SELECT * FROM posts ORDER BY `date` +``` + +It also supports adding qualified identifiers. It will escape both parts. + +```js +var sorter = 'date'; +var sql = 'SELECT * FROM posts ORDER BY ' + SqlString.escapeId('posts.' + sorter); +console.log(sql); // SELECT * FROM posts ORDER BY `posts`.`date` +``` + +If you do not want to treat `.` as qualified identifiers, you can set the second +argument to `true` in order to keep the string as a literal identifier: + +```js +var sorter = 'date.2'; +var sql = 'SELECT * FROM posts ORDER BY ' + SqlString.escapeId(sorter, true); +console.log(sql); // SELECT * FROM posts ORDER BY `date.2` +``` + +Alternatively, you can use `??` characters as placeholders for identifiers you would +like to have escaped like this: + +```js +var userId = 1; +var columns = ['username', 'email']; +var sql = SqlString.format('SELECT ?? FROM ?? WHERE id = ?', [columns, 'users', userId]); +console.log(sql); // SELECT `username`, `email` FROM `users` WHERE id = 1 +``` +**Please note that this last character sequence is experimental and syntax might change** + +When you pass an Object to `.escape()` or `.format()`, `.escapeId()` is used to avoid SQL injection in object keys. + +### Formatting queries + +You can use `SqlString.format` to prepare a query with multiple insertion points, +utilizing the proper escaping for ids and values. A simple example of this follows: + +```js +var userId = 1; +var inserts = ['users', 'id', userId]; +var sql = SqlString.format('SELECT * FROM ?? WHERE ?? = ?', inserts); +console.log(sql); // SELECT * FROM `users` WHERE `id` = 1 +``` + +Following this you then have a valid, escaped query that you can then send to the database safely. +This is useful if you are looking to prepare the query before actually sending it to the database. +You also have the option (but are not required) to pass in `stringifyObject` and `timeZone`, +allowing you provide a custom means of turning objects into strings, as well as a +location-specific/timezone-aware `Date`. + +This can be further combined with the `SqlString.raw()` helper to generate SQL +that includes MySQL functions as dynamic vales: + +```js +var userId = 1; +var data = { email: 'foobar@example.com', modified: SqlString.raw('NOW()') }; +var sql = SqlString.format('UPDATE ?? SET ? WHERE `id` = ?', ['users', data, userId]); +console.log(sql); // UPDATE `users` SET `email` = 'foobar@example.com', `modified` = NOW() WHERE `id` = 1 +``` + +## License + +[MIT](LICENSE) + +[npm-version-image]: https://img.shields.io/npm/v/sqlstring.svg +[npm-downloads-image]: https://img.shields.io/npm/dm/sqlstring.svg +[npm-url]: https://npmjs.org/package/sqlstring +[coveralls-image]: https://img.shields.io/coveralls/mysqljs/sqlstring/master.svg +[coveralls-url]: https://coveralls.io/r/mysqljs/sqlstring?branch=master +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/mysqljs/sqlstring/ci/master?label=build +[github-actions-ci-url]: https://github.com/mysqljs/sqlstring/actions/workflows/ci.yml +[node-image]: https://img.shields.io/node/v/sqlstring.svg +[node-url]: https://nodejs.org/en/download diff --git a/node_modules/sqlstring/index.js b/node_modules/sqlstring/index.js new file mode 100644 index 0000000..4ef5944 --- /dev/null +++ b/node_modules/sqlstring/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/SqlString'); diff --git a/node_modules/sqlstring/lib/SqlString.js b/node_modules/sqlstring/lib/SqlString.js new file mode 100644 index 0000000..8206dad --- /dev/null +++ b/node_modules/sqlstring/lib/SqlString.js @@ -0,0 +1,237 @@ +var SqlString = exports; + +var ID_GLOBAL_REGEXP = /`/g; +var QUAL_GLOBAL_REGEXP = /\./g; +var CHARS_GLOBAL_REGEXP = /[\0\b\t\n\r\x1a\"\'\\]/g; // eslint-disable-line no-control-regex +var CHARS_ESCAPE_MAP = { + '\0' : '\\0', + '\b' : '\\b', + '\t' : '\\t', + '\n' : '\\n', + '\r' : '\\r', + '\x1a' : '\\Z', + '"' : '\\"', + '\'' : '\\\'', + '\\' : '\\\\' +}; + +SqlString.escapeId = function escapeId(val, forbidQualified) { + if (Array.isArray(val)) { + var sql = ''; + + for (var i = 0; i < val.length; i++) { + sql += (i === 0 ? '' : ', ') + SqlString.escapeId(val[i], forbidQualified); + } + + return sql; + } else if (forbidQualified) { + return '`' + String(val).replace(ID_GLOBAL_REGEXP, '``') + '`'; + } else { + return '`' + String(val).replace(ID_GLOBAL_REGEXP, '``').replace(QUAL_GLOBAL_REGEXP, '`.`') + '`'; + } +}; + +SqlString.escape = function escape(val, stringifyObjects, timeZone) { + if (val === undefined || val === null) { + return 'NULL'; + } + + switch (typeof val) { + case 'boolean': return (val) ? 'true' : 'false'; + case 'number': return val + ''; + case 'object': + if (Object.prototype.toString.call(val) === '[object Date]') { + return SqlString.dateToString(val, timeZone || 'local'); + } else if (Array.isArray(val)) { + return SqlString.arrayToList(val, timeZone); + } else if (Buffer.isBuffer(val)) { + return SqlString.bufferToString(val); + } else if (typeof val.toSqlString === 'function') { + return String(val.toSqlString()); + } else if (stringifyObjects) { + return escapeString(val.toString()); + } else { + return SqlString.objectToValues(val, timeZone); + } + default: return escapeString(val); + } +}; + +SqlString.arrayToList = function arrayToList(array, timeZone) { + var sql = ''; + + for (var i = 0; i < array.length; i++) { + var val = array[i]; + + if (Array.isArray(val)) { + sql += (i === 0 ? '' : ', ') + '(' + SqlString.arrayToList(val, timeZone) + ')'; + } else { + sql += (i === 0 ? '' : ', ') + SqlString.escape(val, true, timeZone); + } + } + + return sql; +}; + +SqlString.format = function format(sql, values, stringifyObjects, timeZone) { + if (values == null) { + return sql; + } + + if (!Array.isArray(values)) { + values = [values]; + } + + var chunkIndex = 0; + var placeholdersRegex = /\?+/g; + var result = ''; + var valuesIndex = 0; + var match; + + while (valuesIndex < values.length && (match = placeholdersRegex.exec(sql))) { + var len = match[0].length; + + if (len > 2) { + continue; + } + + var value = len === 2 + ? SqlString.escapeId(values[valuesIndex]) + : SqlString.escape(values[valuesIndex], stringifyObjects, timeZone); + + result += sql.slice(chunkIndex, match.index) + value; + chunkIndex = placeholdersRegex.lastIndex; + valuesIndex++; + } + + if (chunkIndex === 0) { + // Nothing was replaced + return sql; + } + + if (chunkIndex < sql.length) { + return result + sql.slice(chunkIndex); + } + + return result; +}; + +SqlString.dateToString = function dateToString(date, timeZone) { + var dt = new Date(date); + + if (isNaN(dt.getTime())) { + return 'NULL'; + } + + var year; + var month; + var day; + var hour; + var minute; + var second; + var millisecond; + + if (timeZone === 'local') { + year = dt.getFullYear(); + month = dt.getMonth() + 1; + day = dt.getDate(); + hour = dt.getHours(); + minute = dt.getMinutes(); + second = dt.getSeconds(); + millisecond = dt.getMilliseconds(); + } else { + var tz = convertTimezone(timeZone); + + if (tz !== false && tz !== 0) { + dt.setTime(dt.getTime() + (tz * 60000)); + } + + year = dt.getUTCFullYear(); + month = dt.getUTCMonth() + 1; + day = dt.getUTCDate(); + hour = dt.getUTCHours(); + minute = dt.getUTCMinutes(); + second = dt.getUTCSeconds(); + millisecond = dt.getUTCMilliseconds(); + } + + // YYYY-MM-DD HH:mm:ss.mmm + var str = zeroPad(year, 4) + '-' + zeroPad(month, 2) + '-' + zeroPad(day, 2) + ' ' + + zeroPad(hour, 2) + ':' + zeroPad(minute, 2) + ':' + zeroPad(second, 2) + '.' + + zeroPad(millisecond, 3); + + return escapeString(str); +}; + +SqlString.bufferToString = function bufferToString(buffer) { + return 'X' + escapeString(buffer.toString('hex')); +}; + +SqlString.objectToValues = function objectToValues(object, timeZone) { + var sql = ''; + + for (var key in object) { + var val = object[key]; + + if (typeof val === 'function') { + continue; + } + + sql += (sql.length === 0 ? '' : ', ') + SqlString.escapeId(key) + ' = ' + SqlString.escape(val, true, timeZone); + } + + return sql; +}; + +SqlString.raw = function raw(sql) { + if (typeof sql !== 'string') { + throw new TypeError('argument sql must be a string'); + } + + return { + toSqlString: function toSqlString() { return sql; } + }; +}; + +function escapeString(val) { + var chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex = 0; + var escapedVal = ''; + var match; + + while ((match = CHARS_GLOBAL_REGEXP.exec(val))) { + escapedVal += val.slice(chunkIndex, match.index) + CHARS_ESCAPE_MAP[match[0]]; + chunkIndex = CHARS_GLOBAL_REGEXP.lastIndex; + } + + if (chunkIndex === 0) { + // Nothing was escaped + return "'" + val + "'"; + } + + if (chunkIndex < val.length) { + return "'" + escapedVal + val.slice(chunkIndex) + "'"; + } + + return "'" + escapedVal + "'"; +} + +function zeroPad(number, length) { + number = number.toString(); + while (number.length < length) { + number = '0' + number; + } + + return number; +} + +function convertTimezone(tz) { + if (tz === 'Z') { + return 0; + } + + var m = tz.match(/([\+\-\s])(\d\d):?(\d\d)?/); + if (m) { + return (m[1] === '-' ? -1 : 1) * (parseInt(m[2], 10) + ((m[3] ? parseInt(m[3], 10) : 0) / 60)) * 60; + } + return false; +} diff --git a/node_modules/sqlstring/package.json b/node_modules/sqlstring/package.json new file mode 100644 index 0000000..5aa57f1 --- /dev/null +++ b/node_modules/sqlstring/package.json @@ -0,0 +1,47 @@ +{ + "name": "sqlstring", + "description": "Simple SQL escape and format for MySQL", + "version": "2.3.3", + "contributors": [ + "Adri Van Houdt ", + "Douglas Christopher Wilson ", + "fengmk2 (http://fengmk2.github.com)", + "Kevin Jose Martin ", + "Nathan Woltman ", + "Sergej Sintschilin " + ], + "license": "MIT", + "keywords": [ + "sqlstring", + "sql", + "escape", + "sql escape" + ], + "repository": "mysqljs/sqlstring", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "nyc": "15.1.0", + "urun": "0.0.8", + "utest": "0.0.8" + }, + "files": [ + "lib/", + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "node test/run.js", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/statuses/HISTORY.md b/node_modules/statuses/HISTORY.md new file mode 100644 index 0000000..dc549b8 --- /dev/null +++ b/node_modules/statuses/HISTORY.md @@ -0,0 +1,87 @@ +2.0.2 / 2025-06-06 +================== + + * Migrate to `String.prototype.slice()` + +2.0.1 / 2021-01-03 +================== + + * Fix returning values from `Object.prototype` + +2.0.0 / 2020-04-19 +================== + + * Drop support for Node.js 0.6 + * Fix messaging casing of `418 I'm a Teapot` + * Remove code 306 + * Remove `status[code]` exports; use `status.message[code]` + * Remove `status[msg]` exports; use `status.code[msg]` + * Rename `425 Unordered Collection` to standard `425 Too Early` + * Rename `STATUS_CODES` export to `message` + * Return status message for `statuses(code)` when given code + +1.5.0 / 2018-03-27 +================== + + * Add `103 Early Hints` + +1.4.0 / 2017-10-20 +================== + + * Add `STATUS_CODES` export + +1.3.1 / 2016-11-11 +================== + + * Fix return type in JSDoc + +1.3.0 / 2016-05-17 +================== + + * Add `421 Misdirected Request` + * perf: enable strict mode + +1.2.1 / 2015-02-01 +================== + + * Fix message for status 451 + - `451 Unavailable For Legal Reasons` + +1.2.0 / 2014-09-28 +================== + + * Add `208 Already Repored` + * Add `226 IM Used` + * Add `306 (Unused)` + * Add `415 Unable For Legal Reasons` + * Add `508 Loop Detected` + +1.1.1 / 2014-09-24 +================== + + * Add missing 308 to `codes.json` + +1.1.0 / 2014-09-21 +================== + + * Add `codes.json` for universal support + +1.0.4 / 2014-08-20 +================== + + * Package cleanup + +1.0.3 / 2014-06-08 +================== + + * Add 308 to `.redirect` category + +1.0.2 / 2014-03-13 +================== + + * Add `.retry` category + +1.0.1 / 2014-03-12 +================== + + * Initial release diff --git a/node_modules/statuses/LICENSE b/node_modules/statuses/LICENSE new file mode 100644 index 0000000..28a3161 --- /dev/null +++ b/node_modules/statuses/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/statuses/README.md b/node_modules/statuses/README.md new file mode 100644 index 0000000..89d542f --- /dev/null +++ b/node_modules/statuses/README.md @@ -0,0 +1,139 @@ +# statuses + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] +[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer] + +HTTP status utility for node. + +This module provides a list of status codes and messages sourced from +a few different projects: + + * The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) + * The [Node.js project](https://nodejs.org/) + * The [NGINX project](https://www.nginx.com/) + * The [Apache HTTP Server project](https://httpd.apache.org/) + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install statuses +``` + +## API + + + +```js +var status = require('statuses') +``` + +### status(code) + +Returns the status message string for a known HTTP status code. The code +may be a number or a string. An error is thrown for an unknown status code. + + + +```js +status(403) // => 'Forbidden' +status('403') // => 'Forbidden' +status(306) // throws +``` + +### status(msg) + +Returns the numeric status code for a known HTTP status message. The message +is case-insensitive. An error is thrown for an unknown status message. + + + +```js +status('forbidden') // => 403 +status('Forbidden') // => 403 +status('foo') // throws +``` + +### status.codes + +Returns an array of all the status codes as `Integer`s. + +### status.code[msg] + +Returns the numeric status code for a known status message (in lower-case), +otherwise `undefined`. + + + +```js +status['not found'] // => 404 +``` + +### status.empty[code] + +Returns `true` if a status code expects an empty body. + + + +```js +status.empty[200] // => undefined +status.empty[204] // => true +status.empty[304] // => true +``` + +### status.message[code] + +Returns the string message for a known numeric status code, otherwise +`undefined`. This object is the same format as the +[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes). + + + +```js +status.message[404] // => 'Not Found' +``` + +### status.redirect[code] + +Returns `true` if a status code is a valid redirect status. + + + +```js +status.redirect[200] // => undefined +status.redirect[301] // => true +``` + +### status.retry[code] + +Returns `true` if you should retry the rest. + + + +```js +status.retry[501] // => undefined +status.retry[503] // => true +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci +[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master +[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master +[node-version-image]: https://badgen.net/npm/node/statuses +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/statuses +[npm-url]: https://npmjs.org/package/statuses +[npm-version-image]: https://badgen.net/npm/v/statuses +[ossf-scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/jshttp/statuses/badge +[ossf-scorecard-visualizer]: https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/jshttp/statuses diff --git a/node_modules/statuses/codes.json b/node_modules/statuses/codes.json new file mode 100644 index 0000000..1333ed1 --- /dev/null +++ b/node_modules/statuses/codes.json @@ -0,0 +1,65 @@ +{ + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "103": "Early Hints", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a Teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Too Early", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" +} diff --git a/node_modules/statuses/index.js b/node_modules/statuses/index.js new file mode 100644 index 0000000..ea351c5 --- /dev/null +++ b/node_modules/statuses/index.js @@ -0,0 +1,146 @@ +/*! + * statuses + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var codes = require('./codes.json') + +/** + * Module exports. + * @public + */ + +module.exports = status + +// status code to message map +status.message = codes + +// status message (lower-case) to code map +status.code = createMessageToStatusCodeMap(codes) + +// array of status codes +status.codes = createStatusCodeList(codes) + +// status codes for redirects +status.redirect = { + 300: true, + 301: true, + 302: true, + 303: true, + 305: true, + 307: true, + 308: true +} + +// status codes for empty bodies +status.empty = { + 204: true, + 205: true, + 304: true +} + +// status codes for when you should retry the request +status.retry = { + 502: true, + 503: true, + 504: true +} + +/** + * Create a map of message to status code. + * @private + */ + +function createMessageToStatusCodeMap (codes) { + var map = {} + + Object.keys(codes).forEach(function forEachCode (code) { + var message = codes[code] + var status = Number(code) + + // populate map + map[message.toLowerCase()] = status + }) + + return map +} + +/** + * Create a list of all status codes. + * @private + */ + +function createStatusCodeList (codes) { + return Object.keys(codes).map(function mapCode (code) { + return Number(code) + }) +} + +/** + * Get the status code for given message. + * @private + */ + +function getStatusCode (message) { + var msg = message.toLowerCase() + + if (!Object.prototype.hasOwnProperty.call(status.code, msg)) { + throw new Error('invalid status message: "' + message + '"') + } + + return status.code[msg] +} + +/** + * Get the status message for given code. + * @private + */ + +function getStatusMessage (code) { + if (!Object.prototype.hasOwnProperty.call(status.message, code)) { + throw new Error('invalid status code: ' + code) + } + + return status.message[code] +} + +/** + * Get the status code. + * + * Given a number, this will throw if it is not a known status + * code, otherwise the code will be returned. Given a string, + * the string will be parsed for a number and return the code + * if valid, otherwise will lookup the code assuming this is + * the status message. + * + * @param {string|number} code + * @returns {number} + * @public + */ + +function status (code) { + if (typeof code === 'number') { + return getStatusMessage(code) + } + + if (typeof code !== 'string') { + throw new TypeError('code must be a number or string') + } + + // '403' + var n = parseInt(code, 10) + if (!isNaN(n)) { + return getStatusMessage(n) + } + + return getStatusCode(code) +} diff --git a/node_modules/statuses/package.json b/node_modules/statuses/package.json new file mode 100644 index 0000000..b5d016e --- /dev/null +++ b/node_modules/statuses/package.json @@ -0,0 +1,49 @@ +{ + "name": "statuses", + "description": "HTTP status utility", + "version": "2.0.2", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "repository": "jshttp/statuses", + "license": "MIT", + "keywords": [ + "http", + "status", + "code" + ], + "files": [ + "HISTORY.md", + "index.js", + "codes.json", + "LICENSE" + ], + "devDependencies": { + "csv-parse": "4.16.3", + "eslint": "7.19.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-markdown": "1.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "8.4.0", + "nyc": "15.1.0", + "raw-body": "2.5.2", + "stream-to-array": "2.3.0" + }, + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "build": "node scripts/build.js", + "fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update": "npm run fetch && npm run build", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/stream-http/.airtap.yml b/node_modules/stream-http/.airtap.yml new file mode 100644 index 0000000..64a114c --- /dev/null +++ b/node_modules/stream-http/.airtap.yml @@ -0,0 +1,23 @@ +sauce_connect: true +browsers: + - name: chrome + version: 39..latest + - name: firefox + version: 34..latest + - name: safari + version: 8..latest + - name: MicrosoftEdge + version: 13..latest + - name: ie + version: 9..latest + - name: iphone + version: '9.3..latest' + - name: android + version: '4.4..6.0' # TODO: change this back to latest once https://github.com/airtap/browsers/issues/3 is fixed +server: ./test/server/index.js +scripts: + - "/ie8-polyfill.js" + - "/test-polyfill.js" +browserify: + - options: + dedupe: false \ No newline at end of file diff --git a/node_modules/stream-http/.travis.yml b/node_modules/stream-http/.travis.yml new file mode 100644 index 0000000..6ebc1ac --- /dev/null +++ b/node_modules/stream-http/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "node" +addons: + sauce_connect: true + hosts: + - airtap.local \ No newline at end of file diff --git a/node_modules/stream-http/LICENSE b/node_modules/stream-http/LICENSE new file mode 100644 index 0000000..7267465 --- /dev/null +++ b/node_modules/stream-http/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2015 John Hiesey + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/stream-http/README.md b/node_modules/stream-http/README.md new file mode 100644 index 0000000..94b6a50 --- /dev/null +++ b/node_modules/stream-http/README.md @@ -0,0 +1,144 @@ +# stream-http [![Build Status](https://travis-ci.org/jhiesey/stream-http.svg?branch=master)](https://travis-ci.org/jhiesey/stream-http) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/stream-http.svg)](https://saucelabs.com/u/stream-http) + +This module is an implementation of Node's native `http` module for the browser. +It tries to match Node's API and behavior as closely as possible, but some features +aren't available, since browsers don't give nearly as much control over requests. + +This is heavily inspired by, and intended to replace, [http-browserify](https://github.com/substack/http-browserify). + +## What does it do? + +In accordance with its name, `stream-http` tries to provide data to its caller before +the request has completed whenever possible. + +Backpressure, allowing the browser to only pull data from the server as fast as it is +consumed, is supported in: +* Chrome >= 58 (using `fetch` and `WritableStream`) + +The following browsers support true streaming, where only a small amount of the request +has to be held in memory at once: +* Chrome >= 43 (using the `fetch` API) +* Firefox >= 9 (using `moz-chunked-arraybuffer` responseType with xhr) + +The following browsers support pseudo-streaming, where the data is available before the +request finishes, but the entire response must be held in memory: +* Chrome +* Safari >= 5, and maybe older +* IE >= 10 +* Most other Webkit-based browsers, including the default Android browser + +All browsers newer than IE8 support binary responses. All of the above browsers that +support true streaming or pseudo-streaming support that for binary data as well +except for IE10. Old (presto-based) Opera also does not support binary streaming either. + +### IE8 note: +As of version 2.0.0, IE8 support requires the user to supply polyfills for +`Object.keys`, `Array.prototype.forEach`, and `Array.prototype.indexOf`. Example +implementations are provided in [ie8-polyfill.js](ie8-polyfill.js); alternately, +you may want to consider using [es5-shim](https://github.com/es-shims/es5-shim). +All browsers with full ES5 support shouldn't require any polyfills. + +## How do you use it? + +The intent is to have the same API as the client part of the +[Node HTTP module](https://nodejs.org/api/http.html). The interfaces are the same wherever +practical, although limitations in browsers make an exact clone of the Node API impossible. + +This module implements `http.request`, `http.get`, and most of `http.ClientRequest` +and `http.IncomingMessage` in addition to `http.METHODS` and `http.STATUS_CODES`. See the +Node docs for how these work. + +### Extra features compared to Node + +* The `message.url` property provides access to the final URL after all redirects. This +is useful since the browser follows all redirects silently, unlike Node. It is available +in Chrome 37 and newer, Firefox 32 and newer, and Safari 9 and newer. + +* The `options.withCredentials` boolean flag, used to indicate if the browser should send +cookies or authentication information with a CORS request. Default false. + +This module has to make some tradeoffs to support binary data and/or streaming. Generally, +the module can make a fairly good decision about which underlying browser features to use, +but sometimes it helps to get a little input from the developer. + +* The `options.mode` field passed into `http.request` or `http.get` can take on one of the +following values: + * 'default' (or any falsy value, including `undefined`): Try to provide partial data before +the request completes, but not at the cost of correctness for binary data or correctness of +the 'content-type' response header. This mode will also avoid slower code paths whenever +possible, which is particularly useful when making large requests in a browser like Safari +that has a weaker JavaScript engine. + * 'allow-wrong-content-type': Provides partial data in more cases than 'default', but +at the expense of causing the 'content-type' response header to be incorrectly reported +(as 'text/plain; charset=x-user-defined') in some browsers, notably Safari and Chrome 42 +and older. Preserves binary data whenever possible. In some cases the implementation may +also be a bit slow. This was the default in versions of this module before 1.5. + * 'prefer-stream': Provide data before the request completes even if binary data (anything +that isn't a single-byte ASCII or UTF8 character) will be corrupted. Of course, this option +is only safe for text data. May also cause the 'content-type' response header to be +incorrectly reported (as 'text/plain; charset=x-user-defined'). + * 'disable-fetch': Force the use of plain XHR regardless of the browser declaring a fetch +capability. Preserves the correctness of binary data and the 'content-type' response header. + * 'prefer-fast': Deprecated; now a synonym for 'default', which has the same performance +characteristics as this mode did in versions before 1.5. + +* `options.requestTimeout` allows setting a timeout in millisecionds for XHR and fetch (if +supported by the browser). This is a limit on how long the entire process takes from +beginning to end. Note that this is not the same as the node `setTimeout` functions, +which apply to pauses in data transfer over the underlying socket, or the node `timeout` +option, which applies to opening the connection. + +### Features missing compared to Node + +* `http.Agent` is only a stub +* The 'socket', 'connect', 'upgrade', and 'continue' events on `http.ClientRequest`. +* Any operations, including `request.setTimeout`, that operate directly on the underlying +socket. +* Any options that are disallowed for security reasons. This includes setting or getting +certain headers. +* `message.httpVersion` +* `message.rawHeaders` is modified by the browser, and may not quite match what is sent by +the server. +* `message.trailers` and `message.rawTrailers` will remain empty. +* Redirects are followed silently by the browser, so it isn't possible to access the 301/302 +redirect pages. +* The `timeout` event/option and `setTimeout` functions, which operate on the underlying +socket, are not available. However, see `options.requestTimeout` above. + +## Example + +``` js +http.get('/bundle.js', function (res) { + var div = document.getElementById('result'); + div.innerHTML += 'GET /beep
'; + + res.on('data', function (buf) { + div.innerHTML += buf; + }); + + res.on('end', function () { + div.innerHTML += '
__END__'; + }); +}) +``` + +## Running tests + +There are two sets of tests: the tests that run in Node (found in `test/node`) and the tests +that run in the browser (found in `test/browser`). Normally the browser tests run on +[Sauce Labs](http://saucelabs.com/). + +Running `npm test` will run both sets of tests, but in order for the Sauce Labs tests to run +you will need to sign up for an account (free for open source projects) and put the +credentials in a [`.zuulrc` file](https://github.com/defunctzombie/zuul/wiki/zuulrc). + +To run just the Node tests, run `npm run test-node`. + +To run the browser tests locally, run `npm run test-browser-local` and point your browser to +`http://localhost:8080/__zuul` + +## License + +MIT. Copyright (C) John Hiesey and other contributors. diff --git a/node_modules/stream-http/ie8-polyfill.js b/node_modules/stream-http/ie8-polyfill.js new file mode 100644 index 0000000..adea0fa --- /dev/null +++ b/node_modules/stream-http/ie8-polyfill.js @@ -0,0 +1,168 @@ +// These polyfills taken from MDN (developer.mozilla.org) + +// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys +if (!Object.keys) { + Object.keys = (function() { + 'use strict'; + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), + dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ], + dontEnumsLength = dontEnums.length; + + return function(obj) { + if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { + throw new TypeError('Object.keys called on non-object'); + } + + var result = [], prop, i; + + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } + } + + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } + } + } + return result; + }; + }()); +} + +// Production steps of ECMA-262, Edition 5, 15.4.4.18 +// Reference: http://es5.github.io/#x15.4.4.18 +if (!Array.prototype.forEach) { + + Array.prototype.forEach = function(callback, thisArg) { + + var T, k; + + if (this == null) { + throw new TypeError(' this is null or not defined'); + } + + // 1. Let O be the result of calling ToObject passing the |this| value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + // 4. If IsCallable(callback) is false, throw a TypeError exception. + // See: http://es5.github.com/#x9.11 + if (typeof callback !== "function") { + throw new TypeError(callback + ' is not a function'); + } + + // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (arguments.length > 1) { + T = thisArg; + } + + // 6. Let k be 0 + k = 0; + + // 7. Repeat, while k < len + while (k < len) { + + var kValue; + + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + if (k in O) { + + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[k]; + + // ii. Call the Call internal method of callback with T as the this value and + // argument list containing kValue, k, and O. + callback.call(T, kValue, k, O); + } + // d. Increase k by 1. + k++; + } + // 8. return undefined + }; +} + +// Production steps of ECMA-262, Edition 5, 15.4.4.14 +// Reference: http://es5.github.io/#x15.4.4.14 +if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function(searchElement, fromIndex) { + + var k; + + // 1. Let O be the result of calling ToObject passing + // the this value as the argument. + if (this == null) { + throw new TypeError('"this" is null or not defined'); + } + + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get + // internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + // 4. If len is 0, return -1. + if (len === 0) { + return -1; + } + + // 5. If argument fromIndex was passed let n be + // ToInteger(fromIndex); else let n be 0. + var n = +fromIndex || 0; + + if (Math.abs(n) === Infinity) { + n = 0; + } + + // 6. If n >= len, return -1. + if (n >= len) { + return -1; + } + + // 7. If n >= 0, then Let k be n. + // 8. Else, n<0, Let k be len - abs(n). + // If k is less than 0, then let k be 0. + k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); + + // 9. Repeat, while k < len + while (k < len) { + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the + // HasProperty internal method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + // i. Let elementK be the result of calling the Get + // internal method of O with the argument ToString(k). + // ii. Let same be the result of applying the + // Strict Equality Comparison Algorithm to + // searchElement and elementK. + // iii. If same is true, return k. + if (k in O && O[k] === searchElement) { + return k; + } + k++; + } + return -1; + }; +} \ No newline at end of file diff --git a/node_modules/stream-http/index.js b/node_modules/stream-http/index.js new file mode 100644 index 0000000..84bfe51 --- /dev/null +++ b/node_modules/stream-http/index.js @@ -0,0 +1,85 @@ +var ClientRequest = require('./lib/request') +var response = require('./lib/response') +var extend = require('xtend') +var statusCodes = require('builtin-status-codes') +var url = require('url') + +var http = exports + +http.request = function (opts, cb) { + if (typeof opts === 'string') + opts = url.parse(opts) + else + opts = extend(opts) + + // Normally, the page is loaded from http or https, so not specifying a protocol + // will result in a (valid) protocol-relative url. However, this won't work if + // the protocol is something else, like 'file:' + var defaultProtocol = global.location.protocol.search(/^https?:$/) === -1 ? 'http:' : '' + + var protocol = opts.protocol || defaultProtocol + var host = opts.hostname || opts.host + var port = opts.port + var path = opts.path || '/' + + // Necessary for IPv6 addresses + if (host && host.indexOf(':') !== -1) + host = '[' + host + ']' + + // This may be a relative url. The browser should always be able to interpret it correctly. + opts.url = (host ? (protocol + '//' + host) : '') + (port ? ':' + port : '') + path + opts.method = (opts.method || 'GET').toUpperCase() + opts.headers = opts.headers || {} + + // Also valid opts.auth, opts.mode + + var req = new ClientRequest(opts) + if (cb) + req.on('response', cb) + return req +} + +http.get = function get (opts, cb) { + var req = http.request(opts, cb) + req.end() + return req +} + +http.ClientRequest = ClientRequest +http.IncomingMessage = response.IncomingMessage + +http.Agent = function () {} +http.Agent.defaultMaxSockets = 4 + +http.globalAgent = new http.Agent() + +http.STATUS_CODES = statusCodes + +http.METHODS = [ + 'CHECKOUT', + 'CONNECT', + 'COPY', + 'DELETE', + 'GET', + 'HEAD', + 'LOCK', + 'M-SEARCH', + 'MERGE', + 'MKACTIVITY', + 'MKCOL', + 'MOVE', + 'NOTIFY', + 'OPTIONS', + 'PATCH', + 'POST', + 'PROPFIND', + 'PROPPATCH', + 'PURGE', + 'PUT', + 'REPORT', + 'SEARCH', + 'SUBSCRIBE', + 'TRACE', + 'UNLOCK', + 'UNSUBSCRIBE' +] \ No newline at end of file diff --git a/node_modules/stream-http/lib/capability.js b/node_modules/stream-http/lib/capability.js new file mode 100644 index 0000000..3a17334 --- /dev/null +++ b/node_modules/stream-http/lib/capability.js @@ -0,0 +1,73 @@ +exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream) + +exports.writableStream = isFunction(global.WritableStream) + +exports.abortController = isFunction(global.AbortController) + +exports.blobConstructor = false +try { + new Blob([new ArrayBuffer(1)]) + exports.blobConstructor = true +} catch (e) {} + +// The xhr request to example.com may violate some restrictive CSP configurations, +// so if we're running in a browser that supports `fetch`, avoid calling getXHR() +// and assume support for certain features below. +var xhr +function getXHR () { + // Cache the xhr value + if (xhr !== undefined) return xhr + + if (global.XMLHttpRequest) { + xhr = new global.XMLHttpRequest() + // If XDomainRequest is available (ie only, where xhr might not work + // cross domain), use the page location. Otherwise use example.com + // Note: this doesn't actually make an http request. + try { + xhr.open('GET', global.XDomainRequest ? '/' : 'https://example.com') + } catch(e) { + xhr = null + } + } else { + // Service workers don't have XHR + xhr = null + } + return xhr +} + +function checkTypeSupport (type) { + var xhr = getXHR() + if (!xhr) return false + try { + xhr.responseType = type + return xhr.responseType === type + } catch (e) {} + return false +} + +// For some strange reason, Safari 7.0 reports typeof global.ArrayBuffer === 'object'. +// Safari 7.1 appears to have fixed this bug. +var haveArrayBuffer = typeof global.ArrayBuffer !== 'undefined' +var haveSlice = haveArrayBuffer && isFunction(global.ArrayBuffer.prototype.slice) + +// If fetch is supported, then arraybuffer will be supported too. Skip calling +// checkTypeSupport(), since that calls getXHR(). +exports.arraybuffer = exports.fetch || (haveArrayBuffer && checkTypeSupport('arraybuffer')) + +// These next two tests unavoidably show warnings in Chrome. Since fetch will always +// be used if it's available, just return false for these to avoid the warnings. +exports.msstream = !exports.fetch && haveSlice && checkTypeSupport('ms-stream') +exports.mozchunkedarraybuffer = !exports.fetch && haveArrayBuffer && + checkTypeSupport('moz-chunked-arraybuffer') + +// If fetch is supported, then overrideMimeType will be supported too. Skip calling +// getXHR(). +exports.overrideMimeType = exports.fetch || (getXHR() ? isFunction(getXHR().overrideMimeType) : false) + +exports.vbArray = isFunction(global.VBArray) + +function isFunction (value) { + return typeof value === 'function' +} + +xhr = null // Help gc diff --git a/node_modules/stream-http/lib/request.js b/node_modules/stream-http/lib/request.js new file mode 100644 index 0000000..fcd533b --- /dev/null +++ b/node_modules/stream-http/lib/request.js @@ -0,0 +1,328 @@ +var capability = require('./capability') +var inherits = require('inherits') +var response = require('./response') +var stream = require('readable-stream') +var toArrayBuffer = require('to-arraybuffer') + +var IncomingMessage = response.IncomingMessage +var rStates = response.readyStates + +function decideMode (preferBinary, useFetch) { + if (capability.fetch && useFetch) { + return 'fetch' + } else if (capability.mozchunkedarraybuffer) { + return 'moz-chunked-arraybuffer' + } else if (capability.msstream) { + return 'ms-stream' + } else if (capability.arraybuffer && preferBinary) { + return 'arraybuffer' + } else if (capability.vbArray && preferBinary) { + return 'text:vbarray' + } else { + return 'text' + } +} + +var ClientRequest = module.exports = function (opts) { + var self = this + stream.Writable.call(self) + + self._opts = opts + self._body = [] + self._headers = {} + if (opts.auth) + self.setHeader('Authorization', 'Basic ' + new Buffer(opts.auth).toString('base64')) + Object.keys(opts.headers).forEach(function (name) { + self.setHeader(name, opts.headers[name]) + }) + + var preferBinary + var useFetch = true + if (opts.mode === 'disable-fetch' || ('requestTimeout' in opts && !capability.abortController)) { + // If the use of XHR should be preferred. Not typically needed. + useFetch = false + preferBinary = true + } else if (opts.mode === 'prefer-streaming') { + // If streaming is a high priority but binary compatibility and + // the accuracy of the 'content-type' header aren't + preferBinary = false + } else if (opts.mode === 'allow-wrong-content-type') { + // If streaming is more important than preserving the 'content-type' header + preferBinary = !capability.overrideMimeType + } else if (!opts.mode || opts.mode === 'default' || opts.mode === 'prefer-fast') { + // Use binary if text streaming may corrupt data or the content-type header, or for speed + preferBinary = true + } else { + throw new Error('Invalid value for opts.mode') + } + self._mode = decideMode(preferBinary, useFetch) + self._fetchTimer = null + + self.on('finish', function () { + self._onFinish() + }) +} + +inherits(ClientRequest, stream.Writable) + +ClientRequest.prototype.setHeader = function (name, value) { + var self = this + var lowerName = name.toLowerCase() + // This check is not necessary, but it prevents warnings from browsers about setting unsafe + // headers. To be honest I'm not entirely sure hiding these warnings is a good thing, but + // http-browserify did it, so I will too. + if (unsafeHeaders.indexOf(lowerName) !== -1) + return + + self._headers[lowerName] = { + name: name, + value: value + } +} + +ClientRequest.prototype.getHeader = function (name) { + var header = this._headers[name.toLowerCase()] + if (header) + return header.value + return null +} + +ClientRequest.prototype.removeHeader = function (name) { + var self = this + delete self._headers[name.toLowerCase()] +} + +ClientRequest.prototype._onFinish = function () { + var self = this + + if (self._destroyed) + return + var opts = self._opts + + var headersObj = self._headers + var body = null + if (opts.method !== 'GET' && opts.method !== 'HEAD') { + if (capability.arraybuffer) { + body = toArrayBuffer(Buffer.concat(self._body)) + } else if (capability.blobConstructor) { + body = new global.Blob(self._body.map(function (buffer) { + return toArrayBuffer(buffer) + }), { + type: (headersObj['content-type'] || {}).value || '' + }) + } else { + // get utf8 string + body = Buffer.concat(self._body).toString() + } + } + + // create flattened list of headers + var headersList = [] + Object.keys(headersObj).forEach(function (keyName) { + var name = headersObj[keyName].name + var value = headersObj[keyName].value + if (Array.isArray(value)) { + value.forEach(function (v) { + headersList.push([name, v]) + }) + } else { + headersList.push([name, value]) + } + }) + + if (self._mode === 'fetch') { + var signal = null + var fetchTimer = null + if (capability.abortController) { + var controller = new AbortController() + signal = controller.signal + self._fetchAbortController = controller + + if ('requestTimeout' in opts && opts.requestTimeout !== 0) { + self._fetchTimer = global.setTimeout(function () { + self.emit('requestTimeout') + if (self._fetchAbortController) + self._fetchAbortController.abort() + }, opts.requestTimeout) + } + } + + global.fetch(self._opts.url, { + method: self._opts.method, + headers: headersList, + body: body || undefined, + mode: 'cors', + credentials: opts.withCredentials ? 'include' : 'same-origin', + signal: signal + }).then(function (response) { + self._fetchResponse = response + self._connect() + }, function (reason) { + global.clearTimeout(self._fetchTimer) + if (!self._destroyed) + self.emit('error', reason) + }) + } else { + var xhr = self._xhr = new global.XMLHttpRequest() + try { + xhr.open(self._opts.method, self._opts.url, true) + } catch (err) { + process.nextTick(function () { + self.emit('error', err) + }) + return + } + + // Can't set responseType on really old browsers + if ('responseType' in xhr) + xhr.responseType = self._mode.split(':')[0] + + if ('withCredentials' in xhr) + xhr.withCredentials = !!opts.withCredentials + + if (self._mode === 'text' && 'overrideMimeType' in xhr) + xhr.overrideMimeType('text/plain; charset=x-user-defined') + + if ('requestTimeout' in opts) { + xhr.timeout = opts.requestTimeout + xhr.ontimeout = function () { + self.emit('requestTimeout') + } + } + + headersList.forEach(function (header) { + xhr.setRequestHeader(header[0], header[1]) + }) + + self._response = null + xhr.onreadystatechange = function () { + switch (xhr.readyState) { + case rStates.LOADING: + case rStates.DONE: + self._onXHRProgress() + break + } + } + // Necessary for streaming in Firefox, since xhr.response is ONLY defined + // in onprogress, not in onreadystatechange with xhr.readyState = 3 + if (self._mode === 'moz-chunked-arraybuffer') { + xhr.onprogress = function () { + self._onXHRProgress() + } + } + + xhr.onerror = function () { + if (self._destroyed) + return + self.emit('error', new Error('XHR error')) + } + + try { + xhr.send(body) + } catch (err) { + process.nextTick(function () { + self.emit('error', err) + }) + return + } + } +} + +/** + * Checks if xhr.status is readable and non-zero, indicating no error. + * Even though the spec says it should be available in readyState 3, + * accessing it throws an exception in IE8 + */ +function statusValid (xhr) { + try { + var status = xhr.status + return (status !== null && status !== 0) + } catch (e) { + return false + } +} + +ClientRequest.prototype._onXHRProgress = function () { + var self = this + + if (!statusValid(self._xhr) || self._destroyed) + return + + if (!self._response) + self._connect() + + self._response._onXHRProgress() +} + +ClientRequest.prototype._connect = function () { + var self = this + + if (self._destroyed) + return + + self._response = new IncomingMessage(self._xhr, self._fetchResponse, self._mode, self._fetchTimer) + self._response.on('error', function(err) { + self.emit('error', err) + }) + + self.emit('response', self._response) +} + +ClientRequest.prototype._write = function (chunk, encoding, cb) { + var self = this + + self._body.push(chunk) + cb() +} + +ClientRequest.prototype.abort = ClientRequest.prototype.destroy = function () { + var self = this + self._destroyed = true + global.clearTimeout(self._fetchTimer) + if (self._response) + self._response._destroyed = true + if (self._xhr) + self._xhr.abort() + else if (self._fetchAbortController) + self._fetchAbortController.abort() +} + +ClientRequest.prototype.end = function (data, encoding, cb) { + var self = this + if (typeof data === 'function') { + cb = data + data = undefined + } + + stream.Writable.prototype.end.call(self, data, encoding, cb) +} + +ClientRequest.prototype.flushHeaders = function () {} +ClientRequest.prototype.setTimeout = function () {} +ClientRequest.prototype.setNoDelay = function () {} +ClientRequest.prototype.setSocketKeepAlive = function () {} + +// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method +var unsafeHeaders = [ + 'accept-charset', + 'accept-encoding', + 'access-control-request-headers', + 'access-control-request-method', + 'connection', + 'content-length', + 'cookie', + 'cookie2', + 'date', + 'dnt', + 'expect', + 'host', + 'keep-alive', + 'origin', + 'referer', + 'te', + 'trailer', + 'transfer-encoding', + 'upgrade', + 'user-agent', + 'via' +] diff --git a/node_modules/stream-http/lib/response.js b/node_modules/stream-http/lib/response.js new file mode 100644 index 0000000..17d1fb7 --- /dev/null +++ b/node_modules/stream-http/lib/response.js @@ -0,0 +1,224 @@ +var capability = require('./capability') +var inherits = require('inherits') +var stream = require('readable-stream') + +var rStates = exports.readyStates = { + UNSENT: 0, + OPENED: 1, + HEADERS_RECEIVED: 2, + LOADING: 3, + DONE: 4 +} + +var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, fetchTimer) { + var self = this + stream.Readable.call(self) + + self._mode = mode + self.headers = {} + self.rawHeaders = [] + self.trailers = {} + self.rawTrailers = [] + + // Fake the 'close' event, but only once 'end' fires + self.on('end', function () { + // The nextTick is necessary to prevent the 'request' module from causing an infinite loop + process.nextTick(function () { + self.emit('close') + }) + }) + + if (mode === 'fetch') { + self._fetchResponse = response + + self.url = response.url + self.statusCode = response.status + self.statusMessage = response.statusText + + response.headers.forEach(function (header, key){ + self.headers[key.toLowerCase()] = header + self.rawHeaders.push(key, header) + }) + + if (capability.writableStream) { + var writable = new WritableStream({ + write: function (chunk) { + return new Promise(function (resolve, reject) { + if (self._destroyed) { + reject() + } else if(self.push(new Buffer(chunk))) { + resolve() + } else { + self._resumeFetch = resolve + } + }) + }, + close: function () { + global.clearTimeout(fetchTimer) + if (!self._destroyed) + self.push(null) + }, + abort: function (err) { + if (!self._destroyed) + self.emit('error', err) + } + }) + + try { + response.body.pipeTo(writable).catch(function (err) { + global.clearTimeout(fetchTimer) + if (!self._destroyed) + self.emit('error', err) + }) + return + } catch (e) {} // pipeTo method isn't defined. Can't find a better way to feature test this + } + // fallback for when writableStream or pipeTo aren't available + var reader = response.body.getReader() + function read () { + reader.read().then(function (result) { + if (self._destroyed) + return + if (result.done) { + global.clearTimeout(fetchTimer) + self.push(null) + return + } + self.push(new Buffer(result.value)) + read() + }).catch(function (err) { + global.clearTimeout(fetchTimer) + if (!self._destroyed) + self.emit('error', err) + }) + } + read() + } else { + self._xhr = xhr + self._pos = 0 + + self.url = xhr.responseURL + self.statusCode = xhr.status + self.statusMessage = xhr.statusText + var headers = xhr.getAllResponseHeaders().split(/\r?\n/) + headers.forEach(function (header) { + var matches = header.match(/^([^:]+):\s*(.*)/) + if (matches) { + var key = matches[1].toLowerCase() + if (key === 'set-cookie') { + if (self.headers[key] === undefined) { + self.headers[key] = [] + } + self.headers[key].push(matches[2]) + } else if (self.headers[key] !== undefined) { + self.headers[key] += ', ' + matches[2] + } else { + self.headers[key] = matches[2] + } + self.rawHeaders.push(matches[1], matches[2]) + } + }) + + self._charset = 'x-user-defined' + if (!capability.overrideMimeType) { + var mimeType = self.rawHeaders['mime-type'] + if (mimeType) { + var charsetMatch = mimeType.match(/;\s*charset=([^;])(;|$)/) + if (charsetMatch) { + self._charset = charsetMatch[1].toLowerCase() + } + } + if (!self._charset) + self._charset = 'utf-8' // best guess + } + } +} + +inherits(IncomingMessage, stream.Readable) + +IncomingMessage.prototype._read = function () { + var self = this + + var resolve = self._resumeFetch + if (resolve) { + self._resumeFetch = null + resolve() + } +} + +IncomingMessage.prototype._onXHRProgress = function () { + var self = this + + var xhr = self._xhr + + var response = null + switch (self._mode) { + case 'text:vbarray': // For IE9 + if (xhr.readyState !== rStates.DONE) + break + try { + // This fails in IE8 + response = new global.VBArray(xhr.responseBody).toArray() + } catch (e) {} + if (response !== null) { + self.push(new Buffer(response)) + break + } + // Falls through in IE8 + case 'text': + try { // This will fail when readyState = 3 in IE9. Switch mode and wait for readyState = 4 + response = xhr.responseText + } catch (e) { + self._mode = 'text:vbarray' + break + } + if (response.length > self._pos) { + var newData = response.substr(self._pos) + if (self._charset === 'x-user-defined') { + var buffer = new Buffer(newData.length) + for (var i = 0; i < newData.length; i++) + buffer[i] = newData.charCodeAt(i) & 0xff + + self.push(buffer) + } else { + self.push(newData, self._charset) + } + self._pos = response.length + } + break + case 'arraybuffer': + if (xhr.readyState !== rStates.DONE || !xhr.response) + break + response = xhr.response + self.push(new Buffer(new Uint8Array(response))) + break + case 'moz-chunked-arraybuffer': // take whole + response = xhr.response + if (xhr.readyState !== rStates.LOADING || !response) + break + self.push(new Buffer(new Uint8Array(response))) + break + case 'ms-stream': + response = xhr.response + if (xhr.readyState !== rStates.LOADING) + break + var reader = new global.MSStreamReader() + reader.onprogress = function () { + if (reader.result.byteLength > self._pos) { + self.push(new Buffer(new Uint8Array(reader.result.slice(self._pos)))) + self._pos = reader.result.byteLength + } + } + reader.onload = function () { + self.push(null) + } + // reader.onerror = ??? // TODO: this + reader.readAsArrayBuffer(response) + break + } + + // The ms-stream case handles end separately in reader.onload() + if (self._xhr.readyState === rStates.DONE && self._mode !== 'ms-stream') { + self.push(null) + } +} diff --git a/node_modules/stream-http/package.json b/node_modules/stream-http/package.json new file mode 100644 index 0000000..40d6f26 --- /dev/null +++ b/node_modules/stream-http/package.json @@ -0,0 +1,46 @@ +{ + "name": "stream-http", + "version": "2.8.2", + "description": "Streaming http in the browser", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/jhiesey/stream-http.git" + }, + "scripts": { + "test": "npm run test-node && ([ -n \"${TRAVIS_PULL_REQUEST}\" -a \"${TRAVIS_PULL_REQUEST}\" != 'false' ] || npm run test-browser)", + "test-node": "tape test/node/*.js", + "test-browser": "airtap --loopback airtap.local -- test/browser/*.js", + "test-browser-local": "airtap --no-instrument --local 8080 -- test/browser/*.js" + }, + "author": "John Hiesey", + "license": "MIT", + "bugs": { + "url": "https://github.com/jhiesey/stream-http/issues" + }, + "homepage": "https://github.com/jhiesey/stream-http#readme", + "keywords": [ + "http", + "stream", + "streaming", + "xhr", + "http-browserify" + ], + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + }, + "devDependencies": { + "airtap": "^0.0.5", + "basic-auth": "^2.0.0", + "brfs": "^1.6.1", + "cookie-parser": "^1.4.3", + "express": "^4.16.3", + "tape": "^4.9.0", + "ua-parser-js": "^0.7.18", + "webworkify": "^1.5.0" + } +} diff --git a/node_modules/stream-http/test/browser/abort.js b/node_modules/stream-http/test/browser/abort.js new file mode 100644 index 0000000..2cf43e9 --- /dev/null +++ b/node_modules/stream-http/test/browser/abort.js @@ -0,0 +1,55 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') + +var http = require('../..') + +test('abort before response', function (t) { + var req = http.get('/basic.txt', function (res) { + t.fail('unexpected response') + }) + req.abort() + t.end() +}) + +test('abort on response', function (t) { + var req = http.get('/basic.txt', function (res) { + req.abort() + t.end() + + res.on('end', function () { + t.fail('unexpected end') + }) + + res.on('data', function (data) { + t.fail('unexpected data') + }) + }) +}) + +test('abort on data', function (t) { + var req = http.get('/browserify.png?copies=5', function (res) { + var firstData = true + var failOnData = false + + res.on('end', function () { + t.fail('unexpected end') + }) + + res.on('data', function (data) { + if (failOnData) + t.fail('unexpected data') + else if (firstData) { + firstData = false + req.abort() + t.end() + process.nextTick(function () { + // Wait for any data that may have been queued + // in the stream before considering data events + // as errors + failOnData = true + }) + } + }) + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/auth.js b/node_modules/stream-http/test/browser/auth.js new file mode 100644 index 0000000..5c73115 --- /dev/null +++ b/node_modules/stream-http/test/browser/auth.js @@ -0,0 +1,22 @@ +var Buffer = require('buffer').Buffer +var test = require('tape') + +var http = require('../..') + +test('authentication', function (t) { + http.get({ + path: '/auth', + auth: 'TestUser:trustno1' + }, function (res) { + var buffers = [] + + res.on('end', function () { + t.ok(new Buffer('You\'re in!').equals(Buffer.concat(buffers)), 'authentication succeeded') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/binary-streaming.js b/node_modules/stream-http/test/browser/binary-streaming.js new file mode 100644 index 0000000..d1221df --- /dev/null +++ b/node_modules/stream-http/test/browser/binary-streaming.js @@ -0,0 +1,71 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') +var UAParser = require('ua-parser-js') + +var http = require('../..') + +var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser() +var browserName = browser.name +var browserVersion = browser.major +// Binary streaming doesn't work in IE10 or below +var skipStreamingCheck = (browserName === 'IE' && browserVersion <= 10) + +// Binary data gets corrupted in IE8 or below +var skipVerification = (browserName === 'IE' && browserVersion <= 8) + +// IE8 tends to throw up modal dialogs complaining about scripts running too long +// Since streaming doesn't actually work there anyway, just use one copy +var COPIES = skipVerification ? 1 : 20 +var MIN_PIECES = 2 + +var referenceOnce = fs.readFileSync(__dirname + '/../server/static/browserify.png') +var reference = new Buffer(referenceOnce.length * COPIES) +for(var i = 0; i < COPIES; i++) { + referenceOnce.copy(reference, referenceOnce.length * i) +} + +test('binary streaming', function (t) { + http.get({ + path: '/browserify.png?copies=' + COPIES, + mode: 'allow-wrong-content-type' + }, function (res) { + var buffers = [] + res.on('end', function () { + if (skipVerification) + t.skip('binary data not preserved on IE <= 8') + else + t.ok(reference.equals(Buffer.concat(buffers)), 'contents match') + + if (skipStreamingCheck) + t.skip('streaming not available on IE <= 8') + else + t.ok(buffers.length >= MIN_PIECES, 'received in multiple parts') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) + +test('large binary request without streaming', function (t) { + http.get({ + path: '/browserify.png?copies=' + COPIES, + mode: 'default', + }, function (res) { + var buffers = [] + res.on('end', function () { + if (skipVerification) + t.skip('binary data not preserved on IE <= 8') + else + t.ok(reference.equals(Buffer.concat(buffers)), 'contents match') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/binary.js b/node_modules/stream-http/test/browser/binary.js new file mode 100644 index 0000000..e116b8d --- /dev/null +++ b/node_modules/stream-http/test/browser/binary.js @@ -0,0 +1,32 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') +var UAParser = require('ua-parser-js') + +var http = require('../..') + +var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser() +var browserName = browser.name +var browserVersion = browser.major +// Binary data gets corrupted in IE8 or below +var skipVerification = (browserName === 'IE' && browserVersion <= 8) + +var reference = fs.readFileSync(__dirname + '/../server/static/browserify.png') + +test('binary download', function (t) { + http.get('/browserify.png', function (res) { + var buffers = [] + + res.on('end', function () { + if (skipVerification) + t.skip('binary data not preserved on IE <= 8') + else + t.ok(reference.equals(Buffer.concat(buffers)), 'contents match') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/body-empty.js b/node_modules/stream-http/test/browser/body-empty.js new file mode 100644 index 0000000..8e99bb7 --- /dev/null +++ b/node_modules/stream-http/test/browser/body-empty.js @@ -0,0 +1,29 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') + +var http = require('../..') + +var reference = fs.readFileSync(__dirname + '/../server/static/basic.txt') + +test('get body empty', function (t) { + var req = http.request({ + path: '/verifyEmpty', + method: 'GET' + }, function (res) { + var buffers = [] + + res.on('end', function () { + console.log(Buffer.concat(buffers).toString('utf8')) + t.ok(Buffer.from('empty').equals(Buffer.concat(buffers)), 'response body indicates request body was empty') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) + + req.write(reference) + req.end() +}) diff --git a/node_modules/stream-http/test/browser/cookie.js b/node_modules/stream-http/test/browser/cookie.js new file mode 100644 index 0000000..114c687 --- /dev/null +++ b/node_modules/stream-http/test/browser/cookie.js @@ -0,0 +1,25 @@ +var Buffer = require('buffer').Buffer +var test = require('tape') + +var http = require('../..') + +test('cookie', function (t) { + var cookie = 'hello=world' + window.document.cookie = cookie + + http.get({ + path: '/cookie', + withCredentials: false + }, function (res) { + var buffers = [] + + res.on('end', function () { + t.ok(new Buffer(cookie).equals(Buffer.concat(buffers)), 'hello cookie echoed') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) diff --git a/node_modules/stream-http/test/browser/disable-fetch.js b/node_modules/stream-http/test/browser/disable-fetch.js new file mode 100644 index 0000000..b50aa71 --- /dev/null +++ b/node_modules/stream-http/test/browser/disable-fetch.js @@ -0,0 +1,37 @@ +var Buffer = require('buffer').Buffer +var test = require('tape') + +var http = require('../..') + +test('disable fetch', function (t) { + var originalFetch + if (typeof fetch === 'function') { + originalFetch = fetch + } + + var fetchCalled = false + fetch = function (input, options) { + fetchCalled = true + if (originalFetch) { + return originalFetch(input, options) + } + } + + http.get({ + path: '/browserify.png', + mode: 'disable-fetch' + }, function (res) { + t.ok(!fetchCalled, 'fetch was not called') + + if (originalFetch) { + fetch = originalFetch + } + + res.on('end', function () { + t.ok(res.headers['content-type'] === 'image/png', 'content-type was set correctly') + t.end() + }) + + res.on('data', function () {}) + }) +}) diff --git a/node_modules/stream-http/test/browser/error.js.disabled b/node_modules/stream-http/test/browser/error.js.disabled new file mode 100644 index 0000000..4a328d6 --- /dev/null +++ b/node_modules/stream-http/test/browser/error.js.disabled @@ -0,0 +1,12 @@ +var Buffer = require('buffer').Buffer +var test = require('tape') + +var http = require('../..') + +test('error handling', function (t) { + var req = http.get('https://0.0.0.0:0/fail.txt') + req.on('error', function (err) { + t.ok(err && ('message' in err), 'got error') + t.end() + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/headers.js b/node_modules/stream-http/test/browser/headers.js new file mode 100644 index 0000000..9d0c77c --- /dev/null +++ b/node_modules/stream-http/test/browser/headers.js @@ -0,0 +1,116 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') +var UAParser = require('ua-parser-js') + +var http = require('../..') + +test('headers', function (t) { + http.get({ + path: '/testHeaders?Response-Header=bar&Response-Header-2=BAR2', + headers: { + 'Test-Request-Header': 'foo', + 'Test-Request-Header-2': 'FOO2' + } + }, function (res) { + var rawHeaders = [] + for (var i = 0; i < res.rawHeaders.length; i += 2) { + var lowerKey = res.rawHeaders[i].toLowerCase() + if (lowerKey.indexOf('test-') === 0) + rawHeaders.push(lowerKey, res.rawHeaders[i + 1]) + } + var header1Pos = rawHeaders.indexOf('test-response-header') + t.ok(header1Pos >= 0, 'raw response header 1 present') + t.equal(rawHeaders[header1Pos + 1], 'bar', 'raw response header value 1') + var header2Pos = rawHeaders.indexOf('test-response-header-2') + t.ok(header2Pos >= 0, 'raw response header 2 present') + t.equal(rawHeaders[header2Pos + 1], 'BAR2', 'raw response header value 2') + t.equal(rawHeaders.length, 4, 'correct number of raw headers') + + t.equal(res.headers['test-response-header'], 'bar', 'response header 1') + t.equal(res.headers['test-response-header-2'], 'BAR2', 'response header 2') + + var buffers = [] + + res.on('end', function () { + var body = JSON.parse(Buffer.concat(buffers).toString()) + t.equal(body['test-request-header'], 'foo', 'request header 1') + t.equal(body['test-request-header-2'], 'FOO2', 'request header 2') + t.equal(Object.keys(body).length, 2, 'correct number of request headers') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) + +test('arrays of headers', function (t) { + http.get({ + path: '/testHeaders?Response-Header=bar&Response-Header=BAR2', + headers: { + 'Test-Request-Header': ['foo', 'FOO2'] + } + }, function (res) { + var rawHeaders = [] + for (var i = 0; i < res.rawHeaders.length; i += 2) { + var lowerKey = res.rawHeaders[i].toLowerCase() + if (lowerKey.indexOf('test-') === 0) + rawHeaders.push(lowerKey, res.rawHeaders[i + 1]) + } + t.equal(rawHeaders[0], 'test-response-header', 'raw response header present') + t.equal(rawHeaders[1], 'bar, BAR2', 'raw response header value') + t.equal(rawHeaders.length, 2, 'correct number of raw headers') + + t.equal(res.headers['test-response-header'], 'bar, BAR2', 'response header') + + var buffers = [] + + res.on('end', function () { + var body = JSON.parse(Buffer.concat(buffers).toString()) + t.equal(body['test-request-header'], 'foo,FOO2', 'request headers') + t.equal(Object.keys(body).length, 1, 'correct number of request headers') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) + +test('content-type response header', function (t) { + http.get('/testHeaders', function (res) { + t.equal(res.headers['content-type'], 'application/json', 'content-type preserved') + t.end() + }) +}) + +var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser() +var browserName = browser.name +var browserVersion = browser.major +var browserMinorVersion = browser.minor || 0 +// The content-type header is broken when 'prefer-streaming' or 'allow-wrong-content-type' +// is passed in browsers that rely on xhr.overrideMimeType(), namely older chrome, safari 6-10.0, and the stock Android browser +// Note that Safari 10.0 on iOS 10.3 doesn't need to override the mime type, so the content-type is preserved. +var wrongMimeType = ((browserName === 'Chrome' && browserVersion <= 42) || + ((browserName === 'Safari' || browserName === 'Mobile Safari') && browserVersion >= 6 && (browserVersion < 10 || (browserVersion == 10 && browserMinorVersion == 0))) + || (browserName === 'Android Browser')) + +test('content-type response header with forced streaming', function (t) { + http.get({ + path: '/testHeaders', + mode: 'prefer-streaming' + }, function (res) { + if (wrongMimeType) { + // allow both the 'wrong' and correct mime type, since sometimes it's impossible to tell which to expect + // from the browser version alone (e.g. Safari 10.0 on iOS 10.2 vs iOS 10.3) + var contentType = res.headers['content-type'] + var correct = (contentType === 'text/plain; charset=x-user-defined') || (contentType === 'application/json') + t.ok(correct, 'content-type either preserved or overridden') + } else + t.equal(res.headers['content-type'], 'application/json', 'content-type preserved') + t.end() + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/lib/webworker-worker.js b/node_modules/stream-http/test/browser/lib/webworker-worker.js new file mode 100644 index 0000000..c3c8b91 --- /dev/null +++ b/node_modules/stream-http/test/browser/lib/webworker-worker.js @@ -0,0 +1,20 @@ +var Buffer = require('buffer').Buffer + +var http = require('../../..') + +module.exports = function (self) { + self.addEventListener('message', function (ev) { + var url = ev.data + http.get(url, function (res) { + var buffers = [] + + res.on('end', function () { + self.postMessage(Buffer.concat(buffers).buffer) + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) + }) +} \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/package.json b/node_modules/stream-http/test/browser/package.json new file mode 100644 index 0000000..f4f7b5e --- /dev/null +++ b/node_modules/stream-http/test/browser/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "brfs" ] + } +} diff --git a/node_modules/stream-http/test/browser/post-binary.js b/node_modules/stream-http/test/browser/post-binary.js new file mode 100644 index 0000000..52f3d7e --- /dev/null +++ b/node_modules/stream-http/test/browser/post-binary.js @@ -0,0 +1,41 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') +var UAParser = require('ua-parser-js') + +var http = require('../..') + +var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser() +var browserName = browser.name +var browserVersion = browser.major +// Binary request bodies don't work in a bunch of browsers +var skipVerification = ((browserName === 'IE' && browserVersion <= 10) || + (browserName === 'Safari' && browserVersion <= 5) || + (browserName === 'WebKit' && browserVersion <= 534) || // Old mobile safari + (browserName === 'Android Browser' && browserVersion <= 4)) + +var reference = fs.readFileSync(__dirname + '/../server/static/browserify.png') + +test('post binary', function (t) { + var req = http.request({ + path: '/echo', + method: 'POST' + }, function (res) { + var buffers = [] + + res.on('end', function () { + if (skipVerification) + t.skip('binary data not preserved on this browser') + else + t.ok(reference.equals(Buffer.concat(buffers)), 'echoed contents match') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) + + req.write(reference) + req.end() +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/post-text.js b/node_modules/stream-http/test/browser/post-text.js new file mode 100644 index 0000000..1cea8d7 --- /dev/null +++ b/node_modules/stream-http/test/browser/post-text.js @@ -0,0 +1,48 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') + +var http = require('../..') + +var reference = fs.readFileSync(__dirname + '/../server/static/basic.txt') + +test('post text', function (t) { + var req = http.request({ + path: '/echo', + method: 'POST' + }, function (res) { + var buffers = [] + + res.on('end', function () { + t.ok(reference.equals(Buffer.concat(buffers)), 'echoed contents match') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) + + req.write(reference) + req.end() +}) + +test('post text with data in end()', function (t) { + var req = http.request({ + path: '/echo', + method: 'POST' + }, function (res) { + var buffers = [] + + res.on('end', function () { + t.ok(reference.equals(Buffer.concat(buffers)), 'echoed contents match') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) + + req.end(reference) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/text-streaming.js b/node_modules/stream-http/test/browser/text-streaming.js new file mode 100644 index 0000000..21693af --- /dev/null +++ b/node_modules/stream-http/test/browser/text-streaming.js @@ -0,0 +1,43 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') +var UAParser = require('ua-parser-js') + +var http = require('../..') + +var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser() +var browserName = browser.name +var browserVersion = browser.major +// Streaming doesn't work in IE9 or below +var skipStreamingCheck = (browserName === 'IE' && browserVersion <= 9) + +var COPIES = 1000 +var MIN_PIECES = 5 + +var referenceOnce = fs.readFileSync(__dirname + '/../server/static/basic.txt') +var reference = new Buffer(referenceOnce.length * COPIES) +for(var i = 0; i < COPIES; i++) { + referenceOnce.copy(reference, referenceOnce.length * i) +} + +test('text streaming', function (t) { + http.get({ + path: '/basic.txt?copies=' + COPIES, + mode: 'prefer-streaming' + }, function (res) { + var buffers = [] + + res.on('end', function () { + if (skipStreamingCheck) + t.skip('streaming not available on IE <= 8') + else + t.ok(buffers.length >= MIN_PIECES, 'received in multiple parts') + t.ok(reference.equals(Buffer.concat(buffers)), 'contents match') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/text.js b/node_modules/stream-http/test/browser/text.js new file mode 100644 index 0000000..568380c --- /dev/null +++ b/node_modules/stream-http/test/browser/text.js @@ -0,0 +1,43 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') +var UAParser = require('ua-parser-js') +var url = require('url') + +var http = require('../..') + +var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser() +var browserName = browser.name +var browserVersion = browser.major +// Response urls don't work on many browsers +var skipResponseUrl = ((browserName === 'IE') || + (browserName === 'Edge') || + (browserName === 'Chrome' && browserVersion <= 36) || + (browserName === 'Firefox' && browserVersion <= 31) || + ((browserName === 'Safari' || browserName === 'Mobile Safari') && browserVersion <= 8) || + (browserName === 'WebKit') || // Old mobile safari + (browserName === 'Android Browser' && browserVersion <= 4)) + +var reference = fs.readFileSync(__dirname + '/../server/static/basic.txt') + +test('basic functionality', function (t) { + http.get('/basic.txt', function (res) { + if (!skipResponseUrl) { + var testUrl = url.resolve(global.location.href, '/basic.txt') + // Redirects aren't tested, but presumably only browser bugs + // would cause this to fail only after redirects. + t.equals(res.url, testUrl, 'response url correct') + } + + var buffers = [] + + res.on('end', function () { + t.ok(reference.equals(Buffer.concat(buffers)), 'contents match') + t.end() + }) + + res.on('data', function (data) { + buffers.push(data) + }) + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/timeout.js b/node_modules/stream-http/test/browser/timeout.js new file mode 100644 index 0000000..5e94c48 --- /dev/null +++ b/node_modules/stream-http/test/browser/timeout.js @@ -0,0 +1,43 @@ +var Buffer = require('buffer').Buffer +var fs = require('fs') +var test = require('tape') + +var http = require('../..') + +test('timeout', function (t) { + var req = http.get({ + path: '/browserify.png?copies=5', + requestTimeout: 10 // ms + }, function (res) { + res.on('data', function (data) { + }) + res.on('end', function () { + t.fail('request completed (should have timed out)') + }) + }) + req.on('requestTimeout', function () { + t.pass('got timeout') + t.end() + }) +}) + +// TODO: reenable this if there's a way to make it simultaneously +// fast and reliable +test.skip('no timeout after success', function (t) { + var req = http.get({ + path: '/basic.txt', + requestTimeout: 50000 // ms + }, function (res) { + res.on('data', function (data) { + }) + res.on('end', function () { + t.pass('success') + global.setTimeout(function () { + t.end() + }, 50000) + }) + }) + req.on('requestTimeout', function () { + t.fail('unexpected timeout') + }) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/browser/webworker.js b/node_modules/stream-http/test/browser/webworker.js new file mode 100644 index 0000000..063706c --- /dev/null +++ b/node_modules/stream-http/test/browser/webworker.js @@ -0,0 +1,31 @@ +var fs = require('fs') +var test = require('tape') +var UAParser = require('ua-parser-js') +var url = require('url') +var work = require('webworkify') + +var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser() +var browserName = browser.name +var browserVersion = browser.major +// Skip browsers with poor or nonexistant WebWorker support +var skip = ((browserName === 'IE' && browserVersion <= 10) || + (browserName === 'Safari' && browserVersion <= 5) || + (browserName === 'WebKit' && browserVersion <= 534) || // Old mobile safari + (browserName === 'Android Browser' && browserVersion <= 4)) + +var reference = fs.readFileSync(__dirname + '/../server/static/browserify.png') + +test('binary download in WebWorker', { + skip: skip +}, function (t) { + // We have to use a global url, since webworkify puts the worker in a Blob, + // which doesn't have a proper location + var testUrl = url.resolve(global.location.href, '/browserify.png') + var worker = work(require('./lib/webworker-worker.js')) + worker.addEventListener('message', function (ev) { + var data = new Buffer(new Uint8Array(ev.data)) + t.ok(reference.equals(data), 'contents match') + t.end() + }) + worker.postMessage(testUrl) +}) \ No newline at end of file diff --git a/node_modules/stream-http/test/node/http-browserify.js b/node_modules/stream-http/test/node/http-browserify.js new file mode 100644 index 0000000..42a718f --- /dev/null +++ b/node_modules/stream-http/test/node/http-browserify.js @@ -0,0 +1,147 @@ +// These tests are taken from http-browserify to ensure compatibility with +// that module +var test = require('tape') +var url = require('url') + +var location = 'http://localhost:8081/foo/123' + +var noop = function() {} +global.location = url.parse(location) +global.XMLHttpRequest = function() { + this.open = noop + this.send = noop + this.withCredentials = false +} + +var moduleName = require.resolve('../../') +delete require.cache[moduleName] +var http = require('../../') + +test('Make sure http object has correct properties', function (t) { + t.ok(http.Agent, 'Agent defined') + t.ok(http.ClientRequest, 'ClientRequest defined') + t.ok(http.ClientRequest.prototype, 'ClientRequest.prototype defined') + t.ok(http.IncomingMessage, 'IncomingMessage defined') + t.ok(http.IncomingMessage.prototype, 'IncomingMessage.prototype defined') + t.ok(http.METHODS, 'METHODS defined') + t.ok(http.STATUS_CODES, 'STATUS_CODES defined') + t.ok(http.get, 'get defined') + t.ok(http.globalAgent, 'globalAgent defined') + t.ok(http.request, 'request defined') + t.end() +}) + +test('Test simple url string', function(t) { + var testUrl = { path: '/api/foo' } + var request = http.get(testUrl, noop) + + var resolved = url.resolve(location, request._opts.url) + t.equal(resolved, 'http://localhost:8081/api/foo', 'Url should be correct') + t.end() + +}) + +test('Test full url object', function(t) { + var testUrl = { + host: "localhost:8081", + hostname: "localhost", + href: "http://localhost:8081/api/foo?bar=baz", + method: "GET", + path: "/api/foo?bar=baz", + pathname: "/api/foo", + port: "8081", + protocol: "http:", + query: "bar=baz", + search: "?bar=baz", + slashes: true + } + + var request = http.get(testUrl, noop) + + var resolved = url.resolve(location, request._opts.url) + t.equal(resolved, 'http://localhost:8081/api/foo?bar=baz', 'Url should be correct') + t.end() +}) + +test('Test alt protocol', function(t) { + var params = { + protocol: "foo:", + hostname: "localhost", + port: "3000", + path: "/bar" + } + + var request = http.get(params, noop) + + var resolved = url.resolve(location, request._opts.url) + t.equal(resolved, 'foo://localhost:3000/bar', 'Url should be correct') + t.end() +}) + +test('Test page with \'file:\' protocol', function (t) { + var params = { + hostname: 'localhost', + port: 3000, + path: '/bar' + } + + var fileLocation = 'file:///home/me/stuff/index.html' + + var normalLocation = global.location + global.location = url.parse(fileLocation) // Temporarily change the location + var request = http.get(params, noop) + global.location = normalLocation // Reset the location + + var resolved = url.resolve(fileLocation, request._opts.url) + t.equal(resolved, 'http://localhost:3000/bar', 'Url should be correct') + t.end() +}) + +test('Test string as parameters', function(t) { + var testUrl = '/api/foo' + var request = http.get(testUrl, noop) + + var resolved = url.resolve(location, request._opts.url) + t.equal(resolved, 'http://localhost:8081/api/foo', 'Url should be correct') + t.end() +}) + +test('Test withCredentials param', function(t) { + var url = '/api/foo' + + var request = http.get({ url: url, withCredentials: false }, noop) + t.equal(request._xhr.withCredentials, false, 'xhr.withCredentials should be false') + + var request = http.get({ url: url, withCredentials: true }, noop) + t.equal(request._xhr.withCredentials, true, 'xhr.withCredentials should be true') + + var request = http.get({ url: url }, noop) + t.equal(request._xhr.withCredentials, false, 'xhr.withCredentials should be false') + + t.end() +}) + +test('Test ipv6 address', function(t) { + var testUrl = 'http://[::1]:80/foo' + var request = http.get(testUrl, noop) + + var resolved = url.resolve(location, request._opts.url) + t.equal(resolved, 'http://[::1]:80/foo', 'Url should be correct') + t.end() +}) + +test('Test relative path in url', function(t) { + var params = { path: './bar' } + var request = http.get(params, noop) + + var resolved = url.resolve(location, request._opts.url) + t.equal(resolved, 'http://localhost:8081/foo/bar', 'Url should be correct') + t.end() +}) + +test('Cleanup', function (t) { + delete global.location + delete global.XMLHttpRequest + delete require.cache[moduleName] + t.end() +}) diff --git a/node_modules/stream-http/test/server/index.js b/node_modules/stream-http/test/server/index.js new file mode 100644 index 0000000..0a74aed --- /dev/null +++ b/node_modules/stream-http/test/server/index.js @@ -0,0 +1,137 @@ +var cookieParser = require('cookie-parser') +var basicAuth = require('basic-auth') +var express = require('express') +var fs = require('fs') +var http = require('http') +var path = require('path') +var url = require('url') + +var app = express() +var server = http.createServer(app) + +// Otherwise, use 'application/octet-stream' +var copiesMimeTypes = { + '/basic.txt': 'text/plain' +} + +var maxDelay = 5000 // ms + +// This should make sure bodies aren't cached +// so the streaming tests always pass +app.use(function (req, res, next) { + res.setHeader('Cache-Control', 'no-store') + next() +}) + +app.get('/testHeaders', function (req, res) { + var parsed = url.parse(req.url, true) + + // Values in query parameters are sent as response headers + Object.keys(parsed.query).forEach(function (key) { + res.setHeader('Test-' + key, parsed.query[key]) + }) + + res.setHeader('Content-Type', 'application/json') + res.setHeader('Cache-Control', 'no-cache') + + // Request headers are sent in the body as json + var reqHeaders = {} + Object.keys(req.headers).forEach(function (key) { + key = key.toLowerCase() + if (key.indexOf('test-') === 0) { + // different browsers format request headers with multiple values + // slightly differently, so normalize + reqHeaders[key] = req.headers[key].replace(', ', ',') + } + }) + + var body = JSON.stringify(reqHeaders) + res.setHeader('Content-Length', body.length) + res.write(body) + res.end() +}) + +app.get('/cookie', cookieParser(), function (req, res) { + res.setHeader('Content-Type', 'text/plain') + res.write('hello=' + req.cookies.hello) + res.end() +}) + +app.get('/auth', function (req, res) { + var user = basicAuth(req) + + if (!user || user.name !== 'TestUser' || user.pass !== 'trustno1') { + res.setHeader('WWW-Authenticate', 'Basic realm="example"') + res.end('Access denied') + } else { + res.setHeader('Content-Type', 'text/plain') + res.write('You\'re in!') + res.end() + } +}) + +app.post('/echo', function (req, res) { + res.setHeader('Content-Type', 'application/octet-stream') + req.pipe(res) +}) + +app.use('/verifyEmpty', function (req, res) { + var empty = true + req.on('data', function (buf) { + if (buf.length > 0) { + empty = false + } + }) + req.on('end', function () { + res.setHeader('Content-Type', 'text/plain') + + if (empty) { + res.end('empty') + } else { + res.end('not empty') + } + }) +}) + +app.use(function (req, res, next) { + var parsed = url.parse(req.url, true) + + if ('copies' in parsed.query) { + var totalCopies = parseInt(parsed.query.copies, 10) + function fail () { + res.statusCode = 500 + res.end() + } + fs.readFile(path.join(__dirname, 'static', parsed.pathname), function (err, data) { + if (err) + return fail() + + var mimeType = copiesMimeTypes[parsed.pathname] || 'application/octet-stream' + res.setHeader('Content-Type', mimeType) + res.setHeader('Content-Length', data.length * totalCopies) + var pieceDelay = maxDelay / totalCopies + if (pieceDelay > 100) + pieceDelay = 100 + + function write (copies) { + if (copies === 0) + return res.end() + + res.write(data, function (err) { + if (err) + return fail() + setTimeout(write.bind(null, copies - 1), pieceDelay) + }) + } + write(totalCopies) + }) + return + } + next() +}) + +app.use(express.static(path.join(__dirname, 'static'))) + +var port = parseInt(process.env.AIRTAP_PORT) || 8199 +console.log('Test server listening on port', port) +server.listen(port) diff --git a/node_modules/stream-http/test/server/static/basic.txt b/node_modules/stream-http/test/server/static/basic.txt new file mode 100644 index 0000000..aa7a0cc --- /dev/null +++ b/node_modules/stream-http/test/server/static/basic.txt @@ -0,0 +1,19 @@ +Mary had a little lamb, +His fleece was white as snow, +And everywhere that Mary went, +The lamb was sure to go. + +He followed her to school one day, +Which was against the rule, +It made the children laugh and play +To see a lamb at school. + +And so the teacher turned it out, +But still it lingered near, +And waited patiently about, +Till Mary did appear. + +"Why does the lamb love Mary so?" +The eager children cry. +"Why, Mary loves the lamb, you know." +The teacher did reply. diff --git a/node_modules/stream-http/test/server/static/browserify.png b/node_modules/stream-http/test/server/static/browserify.png new file mode 100644 index 0000000..98d6bf5 Binary files /dev/null and b/node_modules/stream-http/test/server/static/browserify.png differ diff --git a/node_modules/stream-http/test/server/static/test-polyfill.js b/node_modules/stream-http/test/server/static/test-polyfill.js new file mode 100644 index 0000000..f6a1a9d --- /dev/null +++ b/node_modules/stream-http/test/server/static/test-polyfill.js @@ -0,0 +1,9 @@ +if (!String.prototype.trim) { + (function() { + // Make sure we trim BOM and NBSP + var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; + String.prototype.trim = function() { + return this.replace(rtrim, ''); + }; + })(); +} diff --git a/node_modules/stream-wormhole/History.md b/node_modules/stream-wormhole/History.md new file mode 100644 index 0000000..b6e0e1d --- /dev/null +++ b/node_modules/stream-wormhole/History.md @@ -0,0 +1,35 @@ + +1.1.0 / 2018-08-15 +================== + +**features** + * [[`53ec1b2`](http://github.com/node-modules/stream-wormhole/commit/53ec1b21d0847c5c2d32391f60302cc9e96461f4)] - feat: support piped read stream (fengmk2 <>) + +**fixes** + * [[`b2b1aaf`](http://github.com/node-modules/stream-wormhole/commit/b2b1aaf4dcd7741c13b76449ed9ef604a34e1f35)] - fix: should removeListener error handlers (fengmk2 <>) + +1.0.4 / 2018-07-17 +================== + +**fixes** + * [[`968c008`](http://github.com/node-modules/stream-wormhole/commit/968c0088d18bbaaee7feaced306fd50f891d1743)] - fix: should resume stream first (#5) (fengmk2 <>) + +1.0.3 / 2016-07-25 +================== + + * chore: remove black-hole dep (#1) + +1.0.2 / 2016-07-15 +================== + + * fix: black-hole-stream should be deps + +1.0.1 / 2016-07-15 +================== + + * fix: should not throw error by default + +1.0.0 / 2016-07-15 +================== + + * init version diff --git a/node_modules/stream-wormhole/LICENSE b/node_modules/stream-wormhole/LICENSE new file mode 100644 index 0000000..2f00111 --- /dev/null +++ b/node_modules/stream-wormhole/LICENSE @@ -0,0 +1,21 @@ +This software is licensed under the MIT License. + +Copyright (c) 2016-present node-modules and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/stream-wormhole/README.md b/node_modules/stream-wormhole/README.md new file mode 100644 index 0000000..1fb39cd --- /dev/null +++ b/node_modules/stream-wormhole/README.md @@ -0,0 +1,46 @@ +stream-wormhole +======= + +[![NPM version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![Test coverage][codecov-image]][codecov-url] +[![David deps][david-image]][david-url] +[![Known Vulnerabilities][snyk-image]][snyk-url] +[![npm download][download-image]][download-url] + +[npm-image]: https://img.shields.io/npm/v/stream-wormhole.svg?style=flat-square +[npm-url]: https://npmjs.org/package/stream-wormhole +[travis-image]: https://img.shields.io/travis/node-modules/stream-wormhole.svg?style=flat-square +[travis-url]: https://travis-ci.org/node-modules/stream-wormhole +[codecov-image]: https://codecov.io/github/node-modules/stream-wormhole/coverage.svg?branch=master +[codecov-url]: https://codecov.io/github/node-modules/stream-wormhole?branch=master +[david-image]: https://img.shields.io/david/node-modules/stream-wormhole.svg?style=flat-square +[david-url]: https://david-dm.org/node-modules/stream-wormhole +[download-image]: https://img.shields.io/npm/dm/stream-wormhole.svg?style=flat-square +[download-url]: https://npmjs.org/package/stream-wormhole +[snyk-image]: https://snyk.io/test/npm/stream-wormhole/badge.svg?style=flat-square +[snyk-url]: https://snyk.io/test/npm/stream-wormhole + +Pipe ReadStream to a wormhole. + +## Usage + +```js +const sendToWormhole = require('stream-wormhole'); +const fs = require('fs'); + +const readStream = fs.createReadStream(__filename); + +// ignore all error by default +sendToWormhole(readStream, true) + .then(() => console.log('done')); + +// throw error +sendToWormhole(readStream, true) + .then(() => console.log('done')) + .catch(err => console.error(err)); +``` + +## License + +[MIT](LICENSE) diff --git a/node_modules/stream-wormhole/index.js b/node_modules/stream-wormhole/index.js new file mode 100644 index 0000000..a4832f0 --- /dev/null +++ b/node_modules/stream-wormhole/index.js @@ -0,0 +1,46 @@ +'use strict'; + +module.exports = (stream, throwError) => { + return new Promise((resolve, reject) => { + if (typeof stream.resume !== 'function') { + return resolve(); + } + + // unpipe it + stream.unpipe && stream.unpipe(); + // enable resume first + stream.resume(); + + if (stream._readableState && stream._readableState.ended) { + return resolve(); + } + if (!stream.readable || stream.destroyed) { + return resolve(); + } + + function cleanup() { + stream.removeListener('end', onEnd); + stream.removeListener('close', onEnd); + stream.removeListener('error', onError); + } + + function onEnd() { + cleanup(); + resolve(); + } + + function onError(err) { + cleanup(); + // don't throw error by default + if (throwError) { + reject(err); + } else { + resolve(); + } + } + + stream.on('end', onEnd); + stream.on('close', onEnd); + stream.on('error', onError); + }); +}; diff --git a/node_modules/stream-wormhole/package.json b/node_modules/stream-wormhole/package.json new file mode 100644 index 0000000..4a91f29 --- /dev/null +++ b/node_modules/stream-wormhole/package.json @@ -0,0 +1,48 @@ +{ + "name": "stream-wormhole", + "version": "1.1.0", + "description": "Pipe ReadStream to a wormhole", + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "npm run lint && mocha test/*.test.js -r thunk-mocha", + "test-cov": "istanbul cover _mocha -- test/*.test.js -r thunk-mocha", + "lint": "eslint *.js test", + "ci": "npm run lint && npm run test-cov" + }, + "dependencies": {}, + "devDependencies": { + "autod": "*", + "egg-ci": "^1.0.2", + "eslint": "3", + "eslint-config-egg": "3", + "istanbul": "*", + "mocha": "*", + "thunk-mocha": "^1.0.3" + }, + "homepage": "https://github.com/node-modules/stream-wormhole", + "repository": { + "type": "git", + "url": "git://github.com/node-modules/stream-wormhole.git", + "web": "https://github.com/node-modules/stream-wormhole" + }, + "bugs": { + "url": "https://github.com/node-modules/stream-wormhole/issues", + "email": "m@fengmk2.com" + }, + "keywords": [ + "stream-wormhole", + "wormhole", + "stream" + ], + "engines": { + "node": ">=4.0.0" + }, + "ci": { + "version": "4, 6, 8, 10" + }, + "author": "fengmk2 (http://fengmk2.com)", + "license": "MIT" +} diff --git a/node_modules/string-width-cjs/index.d.ts b/node_modules/string-width-cjs/index.d.ts new file mode 100644 index 0000000..12b5309 --- /dev/null +++ b/node_modules/string-width-cjs/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/string-width-cjs/index.js b/node_modules/string-width-cjs/index.js new file mode 100644 index 0000000..f4d261a --- /dev/null +++ b/node_modules/string-width-cjs/index.js @@ -0,0 +1,47 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/string-width-cjs/license b/node_modules/string-width-cjs/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/string-width-cjs/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width-cjs/node_modules/ansi-regex/index.d.ts b/node_modules/string-width-cjs/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000..2dbf6af --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/string-width-cjs/node_modules/ansi-regex/index.js b/node_modules/string-width-cjs/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..616ff83 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/string-width-cjs/node_modules/ansi-regex/license b/node_modules/string-width-cjs/node_modules/ansi-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width-cjs/node_modules/ansi-regex/package.json b/node_modules/string-width-cjs/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..017f531 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/string-width-cjs/node_modules/ansi-regex/readme.md b/node_modules/string-width-cjs/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..4d848bc --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/string-width-cjs/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/README.md b/node_modules/string-width-cjs/node_modules/emoji-regex/README.md new file mode 100644 index 0000000..f10e173 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/index.js b/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 0000000..b4cf3dc --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD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F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/text.js b/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 0000000..780309d --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{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}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/index.d.ts b/node_modules/string-width-cjs/node_modules/emoji-regex/index.d.ts new file mode 100644 index 0000000..1955b47 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,23 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/index.js b/node_modules/string-width-cjs/node_modules/emoji-regex/index.js new file mode 100644 index 0000000..d993a3a --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83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D83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/package.json b/node_modules/string-width-cjs/node_modules/emoji-regex/package.json new file mode 100644 index 0000000..6d32352 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/package.json @@ -0,0 +1,50 @@ +{ + "name": "emoji-regex", + "version": "8.0.0", + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/emoji-regex.git" + }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + } +} diff --git a/node_modules/string-width-cjs/node_modules/emoji-regex/text.js b/node_modules/string-width-cjs/node_modules/emoji-regex/text.js new file mode 100644 index 0000000..0a55ce2 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDD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-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/index.d.ts b/node_modules/string-width-cjs/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000..907fccc --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/index.js b/node_modules/string-width-cjs/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..9a593df --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/license b/node_modules/string-width-cjs/node_modules/strip-ansi/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/package.json b/node_modules/string-width-cjs/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..1a41108 --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/string-width-cjs/node_modules/strip-ansi/readme.md b/node_modules/string-width-cjs/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..7c4b56d --- /dev/null +++ b/node_modules/string-width-cjs/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/string-width-cjs/package.json b/node_modules/string-width-cjs/package.json new file mode 100644 index 0000000..28ba7b4 --- /dev/null +++ b/node_modules/string-width-cjs/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.3", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/string-width-cjs/readme.md b/node_modules/string-width-cjs/readme.md new file mode 100644 index 0000000..bdd3141 --- /dev/null +++ b/node_modules/string-width-cjs/readme.md @@ -0,0 +1,50 @@ +# string-width + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/string-width/index.d.ts b/node_modules/string-width/index.d.ts new file mode 100644 index 0000000..aed9fdf --- /dev/null +++ b/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +export interface Options { + /** + Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2). + + @default true + */ + readonly ambiguousIsNarrow: boolean; +} + +/** +Get the visual width of a string - the number of columns required to display it. + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +@example +``` +import stringWidth from 'string-width'; + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` +*/ +export default function stringWidth(string: string, options?: Options): number; diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js new file mode 100644 index 0000000..9294488 --- /dev/null +++ b/node_modules/string-width/index.js @@ -0,0 +1,54 @@ +import stripAnsi from 'strip-ansi'; +import eastAsianWidth from 'eastasianwidth'; +import emojiRegex from 'emoji-regex'; + +export default function stringWidth(string, options = {}) { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + options = { + ambiguousIsNarrow: true, + ...options + }; + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2; + let width = 0; + + for (const character of string) { + const codePoint = character.codePointAt(0); + + // Ignore control characters + if (codePoint <= 0x1F || (codePoint >= 0x7F && codePoint <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (codePoint >= 0x300 && codePoint <= 0x36F) { + continue; + } + + const code = eastAsianWidth.eastAsianWidth(character); + switch (code) { + case 'F': + case 'W': + width += 2; + break; + case 'A': + width += ambiguousCharacterWidth; + break; + default: + width += 1; + } + } + + return width; +} diff --git a/node_modules/string-width/license b/node_modules/string-width/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json new file mode 100644 index 0000000..f46d677 --- /dev/null +++ b/node_modules/string-width/package.json @@ -0,0 +1,59 @@ +{ + "name": "string-width", + "version": "5.1.2", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.14.0", + "xo": "^0.38.2" + } +} diff --git a/node_modules/string-width/readme.md b/node_modules/string-width/readme.md new file mode 100644 index 0000000..52910df --- /dev/null +++ b/node_modules/string-width/readme.md @@ -0,0 +1,67 @@ +# string-width + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + +## Install + +``` +$ npm install string-width +``` + +## Usage + +```js +import stringWidth from 'string-width'; + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + +## API + +### stringWidth(string, options?) + +#### string + +Type: `string` + +The string to be counted. + +#### options + +Type: `object` + +##### ambiguousIsNarrow + +Type: `boolean`\ +Default: `false` + +Count [ambiguous width characters](https://www.unicode.org/reports/tr11/#Ambiguous) as having narrow width (count of 1) instead of wide width (count of 2). + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/string_decoder/.travis.yml b/node_modules/string_decoder/.travis.yml new file mode 100644 index 0000000..3347a72 --- /dev/null +++ b/node_modules/string_decoder/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test diff --git a/node_modules/string_decoder/LICENSE b/node_modules/string_decoder/LICENSE new file mode 100644 index 0000000..778edb2 --- /dev/null +++ b/node_modules/string_decoder/LICENSE @@ -0,0 +1,48 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + diff --git a/node_modules/string_decoder/README.md b/node_modules/string_decoder/README.md new file mode 100644 index 0000000..5fd5831 --- /dev/null +++ b/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/node_modules/string_decoder/lib/string_decoder.js b/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 0000000..2e89e63 --- /dev/null +++ b/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/node_modules/string_decoder/node_modules/safe-buffer/LICENSE b/node_modules/string_decoder/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/string_decoder/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/string_decoder/node_modules/safe-buffer/README.md b/node_modules/string_decoder/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/string_decoder/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts b/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/string_decoder/node_modules/safe-buffer/index.js b/node_modules/string_decoder/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..22438da --- /dev/null +++ b/node_modules/string_decoder/node_modules/safe-buffer/index.js @@ -0,0 +1,62 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/string_decoder/node_modules/safe-buffer/package.json b/node_modules/string_decoder/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..623fbc3 --- /dev/null +++ b/node_modules/string_decoder/node_modules/safe-buffer/package.json @@ -0,0 +1,37 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/string_decoder/package.json b/node_modules/string_decoder/package.json new file mode 100644 index 0000000..518c3eb --- /dev/null +++ b/node_modules/string_decoder/package.json @@ -0,0 +1,31 @@ +{ + "name": "string_decoder", + "version": "1.1.1", + "description": "The string_decoder module from Node core", + "main": "lib/string_decoder.js", + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/parallel/*.js && node test/verify-dependencies", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT" +} diff --git a/node_modules/strip-ansi-cjs/index.d.ts b/node_modules/strip-ansi-cjs/index.d.ts new file mode 100644 index 0000000..907fccc --- /dev/null +++ b/node_modules/strip-ansi-cjs/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/strip-ansi-cjs/index.js b/node_modules/strip-ansi-cjs/index.js new file mode 100644 index 0000000..9a593df --- /dev/null +++ b/node_modules/strip-ansi-cjs/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/strip-ansi-cjs/license b/node_modules/strip-ansi-cjs/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/strip-ansi-cjs/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.d.ts b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000..2dbf6af --- /dev/null +++ b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..616ff83 --- /dev/null +++ b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..017f531 --- /dev/null +++ b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/strip-ansi-cjs/node_modules/ansi-regex/readme.md b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..4d848bc --- /dev/null +++ b/node_modules/strip-ansi-cjs/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/strip-ansi-cjs/package.json b/node_modules/strip-ansi-cjs/package.json new file mode 100644 index 0000000..1a41108 --- /dev/null +++ b/node_modules/strip-ansi-cjs/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/strip-ansi-cjs/readme.md b/node_modules/strip-ansi-cjs/readme.md new file mode 100644 index 0000000..7c4b56d --- /dev/null +++ b/node_modules/strip-ansi-cjs/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/strip-ansi/index.d.ts b/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000..44e954d --- /dev/null +++ b/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,15 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +export default function stripAnsi(string: string): string; diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..ba19750 --- /dev/null +++ b/node_modules/strip-ansi/index.js @@ -0,0 +1,14 @@ +import ansiRegex from 'ansi-regex'; + +const regex = ansiRegex(); + +export default function stripAnsi(string) { + if (typeof string !== 'string') { + throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``); + } + + // Even though the regex is global, we don't need to reset the `.lastIndex` + // because unlike `.exec()` and `.test()`, `.replace()` does it automatically + // and doing it manually has a performance penalty. + return string.replace(regex, ''); +} diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..2a59216 --- /dev/null +++ b/node_modules/strip-ansi/package.json @@ -0,0 +1,59 @@ +{ + "name": "strip-ansi", + "version": "7.1.2", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "funding": "https://github.com/chalk/strip-ansi?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "types": "./index.d.ts", + "sideEffects": false, + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "devDependencies": { + "ava": "^3.15.0", + "tsd": "^0.17.0", + "xo": "^0.44.0" + } +} diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..109b692 --- /dev/null +++ b/node_modules/strip-ansi/readme.md @@ -0,0 +1,37 @@ +# strip-ansi + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + +> [!NOTE] +> Node.js has this built-in now with [`stripVTControlCharacters`](https://nodejs.org/api/util.html#utilstripvtcontrolcharactersstr). The benefit of this package is consistent behavior across Node.js versions and faster improvements. The Node.js version is actually based on this package. + +## Install + +```sh +npm install strip-ansi +``` + +## Usage + +```js +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) diff --git a/node_modules/strip-bom/index.d.ts b/node_modules/strip-bom/index.d.ts new file mode 100644 index 0000000..8f2a524 --- /dev/null +++ b/node_modules/strip-bom/index.d.ts @@ -0,0 +1,14 @@ +/** +Strip UTF-8 [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string. + +@example +``` +import stripBom = require('strip-bom'); + +stripBom('\uFEFFunicorn'); +//=> 'unicorn' +``` +*/ +declare function stripBom(string: string): string; + +export = stripBom; diff --git a/node_modules/strip-bom/index.js b/node_modules/strip-bom/index.js new file mode 100644 index 0000000..82f9175 --- /dev/null +++ b/node_modules/strip-bom/index.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = string => { + if (typeof string !== 'string') { + throw new TypeError(`Expected a string, got ${typeof string}`); + } + + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM) + if (string.charCodeAt(0) === 0xFEFF) { + return string.slice(1); + } + + return string; +}; diff --git a/node_modules/strip-bom/license b/node_modules/strip-bom/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/strip-bom/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-bom/package.json b/node_modules/strip-bom/package.json new file mode 100644 index 0000000..f96ba34 --- /dev/null +++ b/node_modules/strip-bom/package.json @@ -0,0 +1,42 @@ +{ + "name": "strip-bom", + "version": "4.0.0", + "description": "Strip UTF-8 byte order mark (BOM) from a string", + "license": "MIT", + "repository": "sindresorhus/strip-bom", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "bom", + "byte", + "order", + "mark", + "unicode", + "utf8", + "utf-8", + "remove", + "delete", + "trim", + "text", + "string" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/strip-bom/readme.md b/node_modules/strip-bom/readme.md new file mode 100644 index 0000000..e826851 --- /dev/null +++ b/node_modules/strip-bom/readme.md @@ -0,0 +1,54 @@ +# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom) + +> Strip UTF-8 [byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string + +From Wikipedia: + +> The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8. + +--- + +
+ + Get professional support for 'strip-bom' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + +## Install + +``` +$ npm install strip-bom +``` + + +## Usage + +```js +const stripBom = require('strip-bom'); + +stripBom('\uFEFFunicorn'); +//=> 'unicorn' +``` + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Related + +- [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module +- [strip-bom-buf](https://github.com/sindresorhus/strip-bom-buf) - Buffer version of this module +- [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/strip-json-comments/index.d.ts b/node_modules/strip-json-comments/index.d.ts new file mode 100644 index 0000000..28ba3c8 --- /dev/null +++ b/node_modules/strip-json-comments/index.d.ts @@ -0,0 +1,36 @@ +declare namespace stripJsonComments { + interface Options { + /** + Replace comments with whitespace instead of stripping them entirely. + + @default true + */ + readonly whitespace?: boolean; + } +} + +/** +Strip comments from JSON. Lets you use comments in your JSON files! + +It will replace single-line comments `//` and multi-line comments `/**\/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. + +@param jsonString - Accepts a string with JSON. +@returns A JSON string without comments. + +@example +``` +const json = `{ + // Rainbows + "unicorn": "cake" +}`; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} +``` +*/ +declare function stripJsonComments( + jsonString: string, + options?: stripJsonComments.Options +): string; + +export = stripJsonComments; diff --git a/node_modules/strip-json-comments/index.js b/node_modules/strip-json-comments/index.js new file mode 100644 index 0000000..bb00b38 --- /dev/null +++ b/node_modules/strip-json-comments/index.js @@ -0,0 +1,77 @@ +'use strict'; +const singleComment = Symbol('singleComment'); +const multiComment = Symbol('multiComment'); +const stripWithoutWhitespace = () => ''; +const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); + +const isEscaped = (jsonString, quotePosition) => { + let index = quotePosition - 1; + let backslashCount = 0; + + while (jsonString[index] === '\\') { + index -= 1; + backslashCount += 1; + } + + return Boolean(backslashCount % 2); +}; + +module.exports = (jsonString, options = {}) => { + if (typeof jsonString !== 'string') { + throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``); + } + + const strip = options.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; + + let insideString = false; + let insideComment = false; + let offset = 0; + let result = ''; + + for (let i = 0; i < jsonString.length; i++) { + const currentCharacter = jsonString[i]; + const nextCharacter = jsonString[i + 1]; + + if (!insideComment && currentCharacter === '"') { + const escaped = isEscaped(jsonString, i); + if (!escaped) { + insideString = !insideString; + } + } + + if (insideString) { + continue; + } + + if (!insideComment && currentCharacter + nextCharacter === '//') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = singleComment; + i++; + } else if (insideComment === singleComment && currentCharacter + nextCharacter === '\r\n') { + i++; + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + continue; + } else if (insideComment === singleComment && currentCharacter === '\n') { + insideComment = false; + result += strip(jsonString, offset, i); + offset = i; + } else if (!insideComment && currentCharacter + nextCharacter === '/*') { + result += jsonString.slice(offset, i); + offset = i; + insideComment = multiComment; + i++; + continue; + } else if (insideComment === multiComment && currentCharacter + nextCharacter === '*/') { + i++; + insideComment = false; + result += strip(jsonString, offset, i + 1); + offset = i + 1; + continue; + } + } + + return result + (insideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset)); +}; diff --git a/node_modules/strip-json-comments/license b/node_modules/strip-json-comments/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/strip-json-comments/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/strip-json-comments/package.json b/node_modules/strip-json-comments/package.json new file mode 100644 index 0000000..ce7875a --- /dev/null +++ b/node_modules/strip-json-comments/package.json @@ -0,0 +1,47 @@ +{ + "name": "strip-json-comments", + "version": "3.1.1", + "description": "Strip comments from JSON. Lets you use comments in your JSON files!", + "license": "MIT", + "repository": "sindresorhus/strip-json-comments", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "json", + "strip", + "comments", + "remove", + "delete", + "trim", + "multiline", + "parse", + "config", + "configuration", + "settings", + "util", + "env", + "environment", + "jsonc" + ], + "devDependencies": { + "ava": "^1.4.1", + "matcha": "^0.7.0", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/strip-json-comments/readme.md b/node_modules/strip-json-comments/readme.md new file mode 100644 index 0000000..cc542e5 --- /dev/null +++ b/node_modules/strip-json-comments/readme.md @@ -0,0 +1,78 @@ +# strip-json-comments [![Build Status](https://travis-ci.com/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.com/github/sindresorhus/strip-json-comments) + +> Strip comments from JSON. Lets you use comments in your JSON files! + +This is now possible: + +```js +{ + // Rainbows + "unicorn": /* ❤ */ "cake" +} +``` + +It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source. + +Also available as a [Gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[Grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[Broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. + +## Install + +``` +$ npm install strip-json-comments +``` + +## Usage + +```js +const json = `{ + // Rainbows + "unicorn": /* ❤ */ "cake" +}`; + +JSON.parse(stripJsonComments(json)); +//=> {unicorn: 'cake'} +``` + +## API + +### stripJsonComments(jsonString, options?) + +#### jsonString + +Type: `string` + +Accepts a string with JSON and returns a string without comments. + +#### options + +Type: `object` + +##### whitespace + +Type: `boolean`\ +Default: `true` + +Replace comments with whitespace instead of stripping them entirely. + +## Benchmark + +``` +$ npm run bench +``` + +## Related + +- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module +- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/superagent/LICENSE b/node_modules/superagent/LICENSE new file mode 100644 index 0000000..1b188ba --- /dev/null +++ b/node_modules/superagent/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2016 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/superagent/README.md b/node_modules/superagent/README.md new file mode 100644 index 0000000..4ce4234 --- /dev/null +++ b/node_modules/superagent/README.md @@ -0,0 +1,273 @@ +# superagent + +[![build status](https://github.com/forwardemail/superagent/actions/workflows/ci.yml/badge.svg)](https://github.com/forwardemail/superagent/actions/workflows/ci.yml) +[![code coverage](https://img.shields.io/codecov/c/github/ladjs/superagent.svg)](https://codecov.io/gh/ladjs/superagent) +[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) +[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) +[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org) +[![license](https://img.shields.io/github/license/ladjs/superagent.svg)](LICENSE) + +> Small progressive client-side HTTP request library, and Node.js module with the same API, supporting many high-level HTTP client features. Maintained for [Forward Email](https://github.com/forwardemail) and [Lad](https://github.com/ladjs). + + +## Table of Contents + +* [Install](#install) +* [Usage](#usage) + * [Node](#node) + * [Browser](#browser) +* [Supported Platforms](#supported-platforms) + * [Required Browser Features](#required-browser-features) +* [Plugins](#plugins) +* [Upgrading from previous versions](#upgrading-from-previous-versions) +* [Contributors](#contributors) +* [License](#license) + + +## Install + +[npm][]: + +```sh +npm install superagent +``` + +[yarn][]: + +```sh +yarn add superagent +``` + + +## Usage + +### Node + +```js +const superagent = require('superagent'); + +// callback +superagent + .post('/api/pet') + .send({ name: 'Manny', species: 'cat' }) // sends a JSON post body + .set('X-API-Key', 'foobar') + .set('accept', 'json') + .end((err, res) => { + // Calling the end function will send the request + }); + +// promise with then/catch +superagent.post('/api/pet').then(console.log).catch(console.error); + +// promise with async/await +(async () => { + try { + const res = await superagent.post('/api/pet'); + console.log(res); + } catch (err) { + console.error(err); + } +})(); +``` + +### Browser + +**The browser-ready, minified version of `superagent` is only 50 KB (minified and gzipped).** + +Browser-ready versions of this module are available via [jsdelivr][], [unpkg][], and also in the `node_modules/superagent/dist` folder in downloads of the `superagent` package. + +> Note that we also provide unminified versions with `.js` instead of `.min.js` file extensions. + +#### VanillaJS + +This is the solution for you if you're just using ` + + + + +``` + +#### Bundler + +If you are using [browserify][], [webpack][], [rollup][], or another bundler, then you can follow the same usage as [Node](#node) above. + + +## Supported Platforms + +* Node: v14.18.0+ +* Browsers (see [.browserslistrc](.browserslistrc)): + + ```sh + npx browserslist + ``` + + ```sh + and_chr 102 + and_ff 101 + and_qq 10.4 + and_uc 12.12 + android 101 + chrome 103 + chrome 102 + chrome 101 + chrome 100 + edge 103 + edge 102 + edge 101 + firefox 101 + firefox 100 + firefox 91 + ios_saf 15.5 + ios_saf 15.4 + ios_saf 15.2-15.3 + ios_saf 15.0-15.1 + ios_saf 14.5-14.8 + ios_saf 14.0-14.4 + ios_saf 12.2-12.5 + kaios 2.5 + op_mini all + op_mob 64 + opera 86 + opera 85 + safari 15.5 + safari 15.4 + samsung 17.0 + samsung 16.0 + ``` + +### Required Browser Features + +We recommend using (specifically with the bundle mentioned in [VanillaJS](#vanillajs) above): + +```html + +``` + +* WeakRef is not supported in Opera 85, iOS Safari 12.2-12.5 +* BigInt is not supported in iOS Safari 12.2-12.5 + + +## Plugins + +SuperAgent is easily extended via plugins. + +```js +const nocache = require('superagent-no-cache'); +const superagent = require('superagent'); +const prefix = require('superagent-prefix')('/static'); + +superagent + .get('/some-url') + .query({ action: 'edit', city: 'London' }) // query string + .use(prefix) // Prefixes *only* this request + .use(nocache) // Prevents caching of *only* this request + .end((err, res) => { + // Do something + }); +``` + +Existing plugins: + +* [superagent-no-cache](https://github.com/johntron/superagent-no-cache) - prevents caching by including Cache-Control header +* [superagent-prefix](https://github.com/johntron/superagent-prefix) - prefixes absolute URLs (useful in test environment) +* [superagent-suffix](https://github.com/timneutkens1/superagent-suffix) - suffix URLs with a given path +* [superagent-mock](https://github.com/M6Web/superagent-mock) - simulate HTTP calls by returning data fixtures based on the requested URL +* [superagent-mocker](https://github.com/shuvalov-anton/superagent-mocker) — simulate REST API +* [superagent-cache](https://github.com/jpodwys/superagent-cache) - A global SuperAgent patch with built-in, flexible caching +* [superagent-cache-plugin](https://github.com/jpodwys/superagent-cache-plugin) - A SuperAgent plugin with built-in, flexible caching +* [superagent-jsonapify](https://github.com/alex94puchades/superagent-jsonapify) - A lightweight [json-api](http://jsonapi.org/format/) client addon for superagent +* [superagent-serializer](https://github.com/zzarcon/superagent-serializer) - Converts server payload into different cases +* [superagent-httpbackend](https://www.npmjs.com/package/superagent-httpbackend) - stub out requests using AngularJS' $httpBackend syntax +* [superagent-throttle](https://github.com/leviwheatcroft/superagent-throttle) - queues and intelligently throttles requests +* [superagent-charset](https://github.com/magicdawn/superagent-charset) - add charset support for node's SuperAgent +* [superagent-verbose-errors](https://github.com/jcoreio/superagent-verbose-errors) - include response body in error messages for failed requests +* [superagent-declare](https://github.com/damoclark/superagent-declare) - A simple [declarative](https://en.wikipedia.org/wiki/Declarative_programming) API for SuperAgent +* [superagent-node-http-timings](https://github.com/webuniverseio/superagent-node-http-timings) - measure http timings in node.js +* [superagent-cheerio](https://github.com/mmmmmrob/superagent-cheerio) - add [cheerio](https://www.npmjs.com/package/cheerio) to your response content automatically. Adds `res.$` for HTML and XML response bodies. +* [@certible/superagent-aws-sign](https://github.com/certible/superagent-aws-sign) - Sign AWS endpoint requests, it uses the aws4 to authenticate the SuperAgent requests + +Please prefix your plugin with `superagent-*` so that it can easily be found by others. + +For SuperAgent extensions such as couchdb and oauth visit the [wiki](https://github.com/ladjs/superagent/wiki). + + +## Upgrading from previous versions + +Please see [GitHub releases page](https://github.com/ladjs/superagent/releases) for the current changelog. + +Our breaking changes are mostly in rarely used functionality and from stricter error handling. + +* [6.0 to 6.1](https://github.com/ladjs/superagent/releases/tag/v6.1.0) + * Browser behaviour changed to match Node when serializing `application/x-www-form-urlencoded`, using `arrayFormat: 'indices'` semantics of `qs` library. (See: ) +* [5.x to 6.x](https://github.com/ladjs/superagent/releases/tag/v6.0.0): + * Retry behavior is still opt-in, however we now have a more fine-grained list of status codes and error codes that we retry against (see updated docs) + * A specific issue with Content-Type matching not being case-insensitive is fixed + * Set is now required for IE 9, see [Required Browser Features](#required-browser-features) for more insight +* [4.x to 5.x](https://github.com/ladjs/superagent/releases/tag/v5.0.0): + * We've implemented the build setup of [Lass](https://lass.js.org) to simplify our stack and linting + * Unminified browserified build size has been reduced from 48KB to 20KB (via `tinyify` and the latest version of Babel using `@babel/preset-env` and `.browserslistrc`) + * Linting support has been added using `caniuse-lite` and `eslint-plugin-compat` + * We can now target what versions of Node we wish to support more easily using `.babelrc` +* [3.x to 4.x](https://github.com/ladjs/superagent/releases/tag/v4.0.0-alpha.1): + * Ensure you're running Node 6 or later. We've dropped support for Node 4. + * We've started using ES6 and for compatibility with Internet Explorer you may need to use Babel. + * We suggest migrating from `.end()` callbacks to `.then()` or `await`. +* [2.x to 3.x](https://github.com/ladjs/superagent/releases/tag/v3.0.0): + * Ensure you're running Node 4 or later. We've dropped support for Node 0.x. + * Test code that calls `.send()` multiple times. Invalid calls to `.send()` will now throw instead of sending garbage. +* [1.x to 2.x](https://github.com/ladjs/superagent/releases/tag/v2.0.0): + * If you use `.parse()` in the *browser* version, rename it to `.serialize()`. + * If you rely on `undefined` in query-string values being sent literally as the text "undefined", switch to checking for missing value instead. `?key=undefined` is now `?key` (without a value). + * If you use `.then()` in Internet Explorer, ensure that you have a polyfill that adds a global `Promise` object. +* 0.x to 1.x: + * Instead of 1-argument callback `.end(function(res){})` use `.then(res => {})`. + + +## Contributors + +| Name | +| ------------------- | +| **Kornel Lesiński** | +| **Peter Lyons** | +| **Hunter Loftis** | +| **Nick Baugh** | + + +## License + +[MIT](LICENSE) © TJ Holowaychuk + + +## + +[npm]: https://www.npmjs.com/ + +[yarn]: https://yarnpkg.com/ + +[jsdelivr]: https://www.jsdelivr.com/ + +[unpkg]: https://unpkg.com/ + +[browserify]: https://github.com/browserify/browserify + +[webpack]: https://github.com/webpack/webpack + +[rollup]: https://github.com/rollup/rollup diff --git a/node_modules/superagent/dist/superagent.js b/node_modules/superagent/dist/superagent.js new file mode 100644 index 0000000..cebc498 --- /dev/null +++ b/node_modules/superagent/dist/superagent.js @@ -0,0 +1,3396 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.superagent = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i -1) { + return callBindBasic([intrinsic]); + } + return intrinsic; +}; + +},{"call-bind-apply-helpers":5,"get-intrinsic":22}],8:[function(require,module,exports){ +if (typeof module !== 'undefined') { + module.exports = Emitter; +} +function Emitter(obj) { + if (obj) return mixin(obj); +} +; +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} +Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) { + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn); + return this; +}; +Emitter.prototype.once = function (event, fn) { + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + on.fn = fn; + this.on(event, on); + return this; +}; +Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) { + this._callbacks = this._callbacks || {}; + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + if (callbacks.length === 0) { + delete this._callbacks['$' + event]; + } + return this; +}; +Emitter.prototype.emit = function (event) { + this._callbacks = this._callbacks || {}; + var args = new Array(arguments.length - 1), + callbacks = this._callbacks['$' + event]; + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + return this; +}; +Emitter.prototype.listeners = function (event) { + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; +}; +Emitter.prototype.hasListeners = function (event) { + return !!this.listeners(event).length; +}; + +},{}],9:[function(require,module,exports){ +'use strict'; + +var callBind = require('call-bind-apply-helpers'); +var gOPD = require('gopd'); +var hasProtoAccessor; +try { + hasProtoAccessor = [].__proto__ === Array.prototype; +} catch (e) { + if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { + throw e; + } +} +var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, '__proto__'); +var $Object = Object; +var $getPrototypeOf = $Object.getPrototypeOf; +module.exports = desc && typeof desc.get === 'function' ? callBind([desc.get]) : typeof $getPrototypeOf === 'function' ? function getDunder(value) { + return $getPrototypeOf(value == null ? value : $Object(value)); +} : false; + +},{"call-bind-apply-helpers":5,"gopd":27}],10:[function(require,module,exports){ +'use strict'; +var $defineProperty = Object.defineProperty || false; +if ($defineProperty) { + try { + $defineProperty({}, 'a', { + value: 1 + }); + } catch (e) { + $defineProperty = false; + } +} +module.exports = $defineProperty; + +},{}],11:[function(require,module,exports){ +'use strict'; +module.exports = EvalError; + +},{}],12:[function(require,module,exports){ +'use strict'; +module.exports = Error; + +},{}],13:[function(require,module,exports){ +'use strict'; +module.exports = RangeError; + +},{}],14:[function(require,module,exports){ +'use strict'; +module.exports = ReferenceError; + +},{}],15:[function(require,module,exports){ +'use strict'; +module.exports = SyntaxError; + +},{}],16:[function(require,module,exports){ +'use strict'; +module.exports = TypeError; + +},{}],17:[function(require,module,exports){ +'use strict'; +module.exports = URIError; + +},{}],18:[function(require,module,exports){ +'use strict'; +module.exports = Object; + +},{}],19:[function(require,module,exports){ +module.exports = stringify; +stringify.default = stringify; +stringify.stable = deterministicStringify; +stringify.stableStringify = deterministicStringify; +var LIMIT_REPLACE_NODE = '[...]'; +var CIRCULAR_REPLACE_NODE = '[Circular]'; +var arr = []; +var replacerStack = []; +function defaultOptions() { + return { + depthLimit: Number.MAX_SAFE_INTEGER, + edgesLimit: Number.MAX_SAFE_INTEGER + }; +} +function stringify(obj, replacer, spacer, options) { + if (typeof options === 'undefined') { + options = defaultOptions(); + } + decirc(obj, '', 0, [], undefined, 0, options); + var res; + try { + if (replacerStack.length === 0) { + res = JSON.stringify(obj, replacer, spacer); + } else { + res = JSON.stringify(obj, replaceGetterValues(replacer), spacer); + } + } catch (_) { + return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]'); + } finally { + while (arr.length !== 0) { + var part = arr.pop(); + if (part.length === 4) { + Object.defineProperty(part[0], part[1], part[3]); + } else { + part[0][part[1]] = part[2]; + } + } + } + return res; +} +function setReplace(replace, val, k, parent) { + var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k); + if (propertyDescriptor.get !== undefined) { + if (propertyDescriptor.configurable) { + Object.defineProperty(parent, k, { + value: replace + }); + arr.push([parent, k, val, propertyDescriptor]); + } else { + replacerStack.push([val, k, replace]); + } + } else { + parent[k] = replace; + arr.push([parent, k, val]); + } +} +function decirc(val, k, edgeIndex, stack, parent, depth, options) { + depth += 1; + var i; + if (typeof val === 'object' && val !== null) { + for (i = 0; i < stack.length; i++) { + if (stack[i] === val) { + setReplace(CIRCULAR_REPLACE_NODE, val, k, parent); + return; + } + } + if (typeof options.depthLimit !== 'undefined' && depth > options.depthLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + if (typeof options.edgesLimit !== 'undefined' && edgeIndex + 1 > options.edgesLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + stack.push(val); + if (Array.isArray(val)) { + for (i = 0; i < val.length; i++) { + decirc(val[i], i, i, stack, val, depth, options); + } + } else { + var keys = Object.keys(val); + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + decirc(val[key], key, i, stack, val, depth, options); + } + } + stack.pop(); + } +} +function compareFunction(a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; +} +function deterministicStringify(obj, replacer, spacer, options) { + if (typeof options === 'undefined') { + options = defaultOptions(); + } + var tmp = deterministicDecirc(obj, '', 0, [], undefined, 0, options) || obj; + var res; + try { + if (replacerStack.length === 0) { + res = JSON.stringify(tmp, replacer, spacer); + } else { + res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer); + } + } catch (_) { + return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]'); + } finally { + while (arr.length !== 0) { + var part = arr.pop(); + if (part.length === 4) { + Object.defineProperty(part[0], part[1], part[3]); + } else { + part[0][part[1]] = part[2]; + } + } + } + return res; +} +function deterministicDecirc(val, k, edgeIndex, stack, parent, depth, options) { + depth += 1; + var i; + if (typeof val === 'object' && val !== null) { + for (i = 0; i < stack.length; i++) { + if (stack[i] === val) { + setReplace(CIRCULAR_REPLACE_NODE, val, k, parent); + return; + } + } + try { + if (typeof val.toJSON === 'function') { + return; + } + } catch (_) { + return; + } + if (typeof options.depthLimit !== 'undefined' && depth > options.depthLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + if (typeof options.edgesLimit !== 'undefined' && edgeIndex + 1 > options.edgesLimit) { + setReplace(LIMIT_REPLACE_NODE, val, k, parent); + return; + } + stack.push(val); + if (Array.isArray(val)) { + for (i = 0; i < val.length; i++) { + deterministicDecirc(val[i], i, i, stack, val, depth, options); + } + } else { + var tmp = {}; + var keys = Object.keys(val).sort(compareFunction); + for (i = 0; i < keys.length; i++) { + var key = keys[i]; + deterministicDecirc(val[key], key, i, stack, val, depth, options); + tmp[key] = val[key]; + } + if (typeof parent !== 'undefined') { + arr.push([parent, k, val]); + parent[k] = tmp; + } else { + return tmp; + } + } + stack.pop(); + } +} +function replaceGetterValues(replacer) { + replacer = typeof replacer !== 'undefined' ? replacer : function (k, v) { + return v; + }; + return function (key, val) { + if (replacerStack.length > 0) { + for (var i = 0; i < replacerStack.length; i++) { + var part = replacerStack[i]; + if (part[1] === key && part[0] === val) { + val = part[2]; + replacerStack.splice(i, 1); + break; + } + } + } + return replacer.call(this, key, val); + }; +} + +},{}],20:[function(require,module,exports){ +'use strict'; +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var toStr = Object.prototype.toString; +var max = Math.max; +var funcType = '[object Function]'; +var concatty = function concatty(a, b) { + var arr = []; + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + return arr; +}; +var slicy = function slicy(arrLike, offset) { + var arr = []; + for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; +}; +var joiny = function (arr, joiner) { + var str = ''; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; +}; +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply(this, concatty(args, arguments)); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply(that, concatty(args, arguments)); + }; + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs[i] = '$' + i; + } + bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; +}; + +},{}],21:[function(require,module,exports){ +'use strict'; + +var implementation = require('./implementation'); +module.exports = Function.prototype.bind || implementation; + +},{"./implementation":20}],22:[function(require,module,exports){ +'use strict'; + +var undefined; +var $Object = require('es-object-atoms'); +var $Error = require('es-errors'); +var $EvalError = require('es-errors/eval'); +var $RangeError = require('es-errors/range'); +var $ReferenceError = require('es-errors/ref'); +var $SyntaxError = require('es-errors/syntax'); +var $TypeError = require('es-errors/type'); +var $URIError = require('es-errors/uri'); +var abs = require('math-intrinsics/abs'); +var floor = require('math-intrinsics/floor'); +var max = require('math-intrinsics/max'); +var min = require('math-intrinsics/min'); +var pow = require('math-intrinsics/pow'); +var round = require('math-intrinsics/round'); +var sign = require('math-intrinsics/sign'); +var $Function = Function; +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; +var $gOPD = require('gopd'); +var $defineProperty = require('es-define-property'); +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD ? function () { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } +}() : throwTypeError; +var hasSymbols = require('has-symbols')(); +var getProto = require('get-proto'); +var $ObjectGPO = require('get-proto/Object.getPrototypeOf'); +var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf'); +var $apply = require('call-bind-apply-helpers/functionApply'); +var $call = require('call-bind-apply-helpers/functionCall'); +var needsEval = {}; +var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); +var INTRINSICS = { + __proto__: null, + '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, + '%Array%': Array, + '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, + '%AsyncFromSyncIteratorPrototype%': undefined, + '%AsyncFunction%': needsEval, + '%AsyncGenerator%': needsEval, + '%AsyncGeneratorFunction%': needsEval, + '%AsyncIteratorPrototype%': needsEval, + '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, + '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, + '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, + '%Boolean%': Boolean, + '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '%Date%': Date, + '%decodeURI%': decodeURI, + '%decodeURIComponent%': decodeURIComponent, + '%encodeURI%': encodeURI, + '%encodeURIComponent%': encodeURIComponent, + '%Error%': $Error, + '%eval%': eval, + '%EvalError%': $EvalError, + '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, + '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, + '%Function%': $Function, + '%GeneratorFunction%': needsEval, + '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '%isFinite%': isFinite, + '%isNaN%': isNaN, + '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, + '%JSON%': typeof JSON === 'object' ? JSON : undefined, + '%Map%': typeof Map === 'undefined' ? undefined : Map, + '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), + '%Math%': Math, + '%Number%': Number, + '%Object%': $Object, + '%Object.getOwnPropertyDescriptor%': $gOPD, + '%parseFloat%': parseFloat, + '%parseInt%': parseInt, + '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '%RangeError%': $RangeError, + '%ReferenceError%': $ReferenceError, + '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '%RegExp%': RegExp, + '%Set%': typeof Set === 'undefined' ? undefined : Set, + '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), + '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '%String%': String, + '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, + '%Symbol%': hasSymbols ? Symbol : undefined, + '%SyntaxError%': $SyntaxError, + '%ThrowTypeError%': ThrowTypeError, + '%TypedArray%': TypedArray, + '%TypeError%': $TypeError, + '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '%URIError%': $URIError, + '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, + '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '%Function.prototype.call%': $call, + '%Function.prototype.apply%': $apply, + '%Object.defineProperty%': $defineProperty, + '%Object.getPrototypeOf%': $ObjectGPO, + '%Math.abs%': abs, + '%Math.floor%': floor, + '%Math.max%': max, + '%Math.min%': min, + '%Math.pow%': pow, + '%Math.round%': round, + '%Math.sign%': sign, + '%Reflect.getPrototypeOf%': $ReflectGPO +}; +if (getProto) { + try { + null.error; + } catch (e) { + var errorProto = getProto(getProto(e)); + INTRINSICS['%Error.prototype%'] = errorProto; + } +} +var doEval = function doEval(name) { + var value; + if (name === '%AsyncFunction%') { + value = getEvalledConstructor('async function () {}'); + } else if (name === '%GeneratorFunction%') { + value = getEvalledConstructor('function* () {}'); + } else if (name === '%AsyncGeneratorFunction%') { + value = getEvalledConstructor('async function* () {}'); + } else if (name === '%AsyncGenerator%') { + var fn = doEval('%AsyncGeneratorFunction%'); + if (fn) { + value = fn.prototype; + } + } else if (name === '%AsyncIteratorPrototype%') { + var gen = doEval('%AsyncGenerator%'); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + INTRINSICS[name] = value; + return value; +}; +var LEGACY_ALIASES = { + __proto__: null, + '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], + '%ArrayPrototype%': ['Array', 'prototype'], + '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], + '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], + '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], + '%ArrayProto_values%': ['Array', 'prototype', 'values'], + '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], + '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], + '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], + '%BooleanPrototype%': ['Boolean', 'prototype'], + '%DataViewPrototype%': ['DataView', 'prototype'], + '%DatePrototype%': ['Date', 'prototype'], + '%ErrorPrototype%': ['Error', 'prototype'], + '%EvalErrorPrototype%': ['EvalError', 'prototype'], + '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], + '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], + '%FunctionPrototype%': ['Function', 'prototype'], + '%Generator%': ['GeneratorFunction', 'prototype'], + '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], + '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], + '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], + '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], + '%JSONParse%': ['JSON', 'parse'], + '%JSONStringify%': ['JSON', 'stringify'], + '%MapPrototype%': ['Map', 'prototype'], + '%NumberPrototype%': ['Number', 'prototype'], + '%ObjectPrototype%': ['Object', 'prototype'], + '%ObjProto_toString%': ['Object', 'prototype', 'toString'], + '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], + '%PromisePrototype%': ['Promise', 'prototype'], + '%PromiseProto_then%': ['Promise', 'prototype', 'then'], + '%Promise_all%': ['Promise', 'all'], + '%Promise_reject%': ['Promise', 'reject'], + '%Promise_resolve%': ['Promise', 'resolve'], + '%RangeErrorPrototype%': ['RangeError', 'prototype'], + '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], + '%RegExpPrototype%': ['RegExp', 'prototype'], + '%SetPrototype%': ['Set', 'prototype'], + '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], + '%StringPrototype%': ['String', 'prototype'], + '%SymbolPrototype%': ['Symbol', 'prototype'], + '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], + '%TypedArrayPrototype%': ['TypedArray', 'prototype'], + '%TypeErrorPrototype%': ['TypeError', 'prototype'], + '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], + '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], + '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], + '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], + '%URIErrorPrototype%': ['URIError', 'prototype'], + '%WeakMapPrototype%': ['WeakMap', 'prototype'], + '%WeakSetPrototype%': ['WeakSet', 'prototype'] +}; +var bind = require('function-bind'); +var hasOwn = require('hasown'); +var $concat = bind.call($call, Array.prototype.concat); +var $spliceApply = bind.call($apply, Array.prototype.splice); +var $replace = bind.call($call, String.prototype.replace); +var $strSlice = bind.call($call, String.prototype.slice); +var $exec = bind.call($call, RegExp.prototype.exec); +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; +var stringToPath = function stringToPath(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === '%' && last !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); + } else if (last === '%' && first !== '%') { + throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); + } + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; + }); + return result; +}; +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = '%' + alias[0] + '%'; + } + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + return { + alias: alias, + name: intrinsicName, + value: value + }; + } + throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); +}; +module.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== 'string' || name.length === 0) { + throw new $TypeError('intrinsic name must be a non-empty string'); + } + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; + var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ((first === '"' || first === "'" || first === '`' || last === '"' || last === "'" || last === '`') && first !== last) { + throw new $SyntaxError('property names with quotes must have matching quotes'); + } + if (part === 'constructor' || !isOwn) { + skipFurtherCaching = true; + } + intrinsicBaseName += '.' + part; + intrinsicRealName = '%' + intrinsicBaseName + '%'; + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); + } + return void undefined; + } + if ($gOPD && i + 1 >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; +}; + +},{"call-bind-apply-helpers/functionApply":3,"call-bind-apply-helpers/functionCall":4,"es-define-property":10,"es-errors":12,"es-errors/eval":11,"es-errors/range":13,"es-errors/ref":14,"es-errors/syntax":15,"es-errors/type":16,"es-errors/uri":17,"es-object-atoms":18,"function-bind":21,"get-proto":25,"get-proto/Object.getPrototypeOf":23,"get-proto/Reflect.getPrototypeOf":24,"gopd":27,"has-symbols":28,"hasown":30,"math-intrinsics/abs":31,"math-intrinsics/floor":32,"math-intrinsics/max":34,"math-intrinsics/min":35,"math-intrinsics/pow":36,"math-intrinsics/round":37,"math-intrinsics/sign":38}],23:[function(require,module,exports){ +'use strict'; + +var $Object = require('es-object-atoms'); +module.exports = $Object.getPrototypeOf || null; + +},{"es-object-atoms":18}],24:[function(require,module,exports){ +'use strict'; +module.exports = typeof Reflect !== 'undefined' && Reflect.getPrototypeOf || null; + +},{}],25:[function(require,module,exports){ +'use strict'; + +var reflectGetProto = require('./Reflect.getPrototypeOf'); +var originalGetProto = require('./Object.getPrototypeOf'); +var getDunderProto = require('dunder-proto/get'); +module.exports = reflectGetProto ? function getProto(O) { + return reflectGetProto(O); +} : originalGetProto ? function getProto(O) { + if (!O || typeof O !== 'object' && typeof O !== 'function') { + throw new TypeError('getProto: not an object'); + } + return originalGetProto(O); +} : getDunderProto ? function getProto(O) { + return getDunderProto(O); +} : null; + +},{"./Object.getPrototypeOf":23,"./Reflect.getPrototypeOf":24,"dunder-proto/get":9}],26:[function(require,module,exports){ +'use strict'; +module.exports = Object.getOwnPropertyDescriptor; + +},{}],27:[function(require,module,exports){ +'use strict'; +var $gOPD = require('./gOPD'); +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + $gOPD = null; + } +} +module.exports = $gOPD; + +},{"./gOPD":26}],28:[function(require,module,exports){ +'use strict'; + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = require('./shams'); +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { + return false; + } + if (typeof Symbol !== 'function') { + return false; + } + if (typeof origSymbol('foo') !== 'symbol') { + return false; + } + if (typeof Symbol('bar') !== 'symbol') { + return false; + } + return hasSymbolSham(); +}; + +},{"./shams":29}],29:[function(require,module,exports){ +'use strict'; +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { + return false; + } + if (typeof Symbol.iterator === 'symbol') { + return true; + } + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { + return false; + } + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { + return false; + } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { + return false; + } + var symVal = 42; + obj[sym] = symVal; + for (var _ in obj) { + return false; + } + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { + return false; + } + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + return true; +}; + +},{}],30:[function(require,module,exports){ +'use strict'; + +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = require('function-bind'); +module.exports = bind.call(call, $hasOwn); + +},{"function-bind":21}],31:[function(require,module,exports){ +'use strict'; +module.exports = Math.abs; + +},{}],32:[function(require,module,exports){ +'use strict'; +module.exports = Math.floor; + +},{}],33:[function(require,module,exports){ +'use strict'; +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + +},{}],34:[function(require,module,exports){ +'use strict'; +module.exports = Math.max; + +},{}],35:[function(require,module,exports){ +'use strict'; +module.exports = Math.min; + +},{}],36:[function(require,module,exports){ +'use strict'; +module.exports = Math.pow; + +},{}],37:[function(require,module,exports){ +'use strict'; +module.exports = Math.round; + +},{}],38:[function(require,module,exports){ +'use strict'; + +var $isNaN = require('./isNaN'); +module.exports = function sign(number) { + if ($isNaN(number) || number === 0) { + return number; + } + return number < 0 ? -1 : +1; +}; + +},{"./isNaN":33}],39:[function(require,module,exports){ +(function (global){(function (){ +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; +var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var functionToString = Function.prototype.toString; +var $match = String.prototype.match; +var $slice = String.prototype.slice; +var $replace = String.prototype.replace; +var $toUpperCase = String.prototype.toUpperCase; +var $toLowerCase = String.prototype.toLowerCase; +var $test = RegExp.prototype.test; +var $concat = Array.prototype.concat; +var $join = Array.prototype.join; +var $arrSlice = Array.prototype.slice; +var $floor = Math.floor; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; +var gOPS = Object.getOwnPropertySymbols; +var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; +var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; +var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') ? Symbol.toStringTag : null; +var isEnumerable = Object.prototype.propertyIsEnumerable; +var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function (O) { + return O.__proto__; +} : null); +function addNumericSeparator(num, str) { + if (num === Infinity || num === -Infinity || num !== num || num && num > -1000 && num < 1000 || $test.call(/e/, str)) { + return str; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === 'number') { + var int = num < 0 ? -$floor(-num) : $floor(num); + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str, intStr.length + 1); + return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); + } + } + return $replace.call(str, sepRegex, '$&_'); +} +var utilInspect = require('./util.inspect'); +var inspectCustom = utilInspect.custom; +var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; +var quotes = { + __proto__: null, + 'double': '"', + single: "'" +}; +var quoteREs = { + __proto__: null, + 'double': /(["\\])/g, + single: /(['\\])/g +}; +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if (has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; + if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { + throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); + } + if (has(opts, 'indent') && opts.indent !== null && opts.indent !== '\t' && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + var str = String(obj); + return numericSeparator ? addNumericSeparator(obj, str) : str; + } + if (typeof obj === 'bigint') { + var bigIntStr = String(obj) + 'n'; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { + depth = 0; + } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return isArray(obj) ? '[Array]' : '[Object]'; + } + var indent = getIndent(opts, depth); + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + function inspect(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, 'quoteStyle')) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } + if (typeof obj === 'function' && !isRegExp(obj)) { + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect); + return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); + return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { + s += '...'; + } + s += ''; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { + return '[]'; + } + var xs = arrObjKeys(obj, inspect); + if (indent && !singleLineValues(xs)) { + return '[' + indentedJoin(xs, indent) + ']'; + } + return '[ ' + $join.call(xs, ', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { + return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; + } + if (parts.length === 0) { + return '[' + String(obj) + ']'; + } + return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; + } + if (typeof obj === 'object' && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { + return utilInspect(obj, { + depth: maxDepth - depth + }); + } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); + }); + } + return collectionOf('Map', mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + } + return collectionOf('Set', setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isWeakRef(obj)) { + return weakCollectionOf('WeakRef'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + if (typeof window !== 'undefined' && obj === window) { + return '{ [object Window] }'; + } + if (typeof globalThis !== 'undefined' && obj === globalThis || typeof global !== 'undefined' && obj === global) { + return '{ [object globalThis] }'; + } + if (!isDate(obj) && !isRegExp(obj)) { + var ys = arrObjKeys(obj, inspect); + var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? '' : 'null prototype'; + var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; + var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; + var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); + if (ys.length === 0) { + return tag + '{}'; + } + if (indent) { + return tag + '{' + indentedJoin(ys, indent) + '}'; + } + return tag + '{ ' + $join.call(ys, ', ') + ' }'; + } + return String(obj); +}; +function wrapQuotes(s, defaultStyle, opts) { + var style = opts.quoteStyle || defaultStyle; + var quoteChar = quotes[style]; + return quoteChar + s + quoteChar; +} +function quote(s) { + return $replace.call(String(s), /"/g, '"'); +} +function canTrustToString(obj) { + return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); +} +function isArray(obj) { + return toStr(obj) === '[object Array]' && canTrustToString(obj); +} +function isDate(obj) { + return toStr(obj) === '[object Date]' && canTrustToString(obj); +} +function isRegExp(obj) { + return toStr(obj) === '[object RegExp]' && canTrustToString(obj); +} +function isError(obj) { + return toStr(obj) === '[object Error]' && canTrustToString(obj); +} +function isString(obj) { + return toStr(obj) === '[object String]' && canTrustToString(obj); +} +function isNumber(obj) { + return toStr(obj) === '[object Number]' && canTrustToString(obj); +} +function isBoolean(obj) { + return toStr(obj) === '[object Boolean]' && canTrustToString(obj); +} +function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === 'object' && obj instanceof Symbol; + } + if (typeof obj === 'symbol') { + return true; + } + if (!obj || typeof obj !== 'object' || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e) {} + return false; +} +function isBigInt(obj) { + if (!obj || typeof obj !== 'object' || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e) {} + return false; +} +var hasOwn = Object.prototype.hasOwnProperty || function (key) { + return key in this; +}; +function has(obj, key) { + return hasOwn.call(obj, key); +} +function toStr(obj) { + return objectToString.call(obj); +} +function nameOf(f) { + if (f.name) { + return f.name; + } + var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); + if (m) { + return m[1]; + } + return null; +} +function indexOf(xs, x) { + if (xs.indexOf) { + return xs.indexOf(x); + } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { + return i; + } + } + return -1; +} +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; + } catch (e) {} + return false; +} +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; + } catch (e) {} + return false; +} +function isWeakRef(x) { + if (!weakRefDeref || !x || typeof x !== 'object') { + return false; + } + try { + weakRefDeref.call(x); + return true; + } catch (e) {} + return false; +} +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; + } catch (e) {} + return false; +} +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; + } catch (e) {} + return false; +} +function isElement(x) { + if (!x || typeof x !== 'object') { + return false; + } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} +function inspectString(str, opts) { + if (str.length > opts.maxStringLength) { + var remaining = str.length - opts.maxStringLength; + var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); + return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; + } + var quoteRE = quoteREs[opts.quoteStyle || 'single']; + quoteRE.lastIndex = 0; + var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', + 9: 't', + 10: 'n', + 12: 'f', + 13: 'r' + }[n]; + if (x) { + return '\\' + x; + } + return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); +} +function markBoxed(str) { + return 'Object(' + str + ')'; +} +function weakCollectionOf(type) { + return type + ' { ? }'; +} +function collectionOf(type, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); + return type + ' (' + size + ') {' + joinedEntries + '}'; +} +function singleLineValues(xs) { + for (var i = 0; i < xs.length; i++) { + if (indexOf(xs[i], '\n') >= 0) { + return false; + } + } + return true; +} +function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === '\t') { + baseIndent = '\t'; + } else if (typeof opts.indent === 'number' && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), ' '); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; +} +function indentedJoin(xs, indent) { + if (xs.length === 0) { + return ''; + } + var lineJoiner = '\n' + indent.prev + indent.base; + return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; +} +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + var syms = typeof gOPS === 'function' ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k = 0; k < syms.length; k++) { + symMap['$' + syms[k]] = syms[k]; + } + } + for (var key in obj) { + if (!has(obj, key)) { + continue; + } + if (isArr && String(Number(key)) === key && key < obj.length) { + continue; + } + if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { + continue; + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + if (typeof gOPS === 'function') { + for (var j = 0; j < syms.length; j++) { + if (isEnumerable.call(obj, syms[j])) { + xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); + } + } + } + return xs; +} + +}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./util.inspect":1}],40:[function(require,module,exports){ +'use strict'; + +var replace = String.prototype.replace; +var percentTwenties = /%20/g; +var Format = { + RFC1738: 'RFC1738', + RFC3986: 'RFC3986' +}; +module.exports = { + 'default': Format.RFC3986, + formatters: { + RFC1738: function (value) { + return replace.call(value, percentTwenties, '+'); + }, + RFC3986: function (value) { + return String(value); + } + }, + RFC1738: Format.RFC1738, + RFC3986: Format.RFC3986 +}; + +},{}],41:[function(require,module,exports){ +'use strict'; + +var stringify = require('./stringify'); +var parse = require('./parse'); +var formats = require('./formats'); +module.exports = { + formats: formats, + parse: parse, + stringify: stringify +}; + +},{"./formats":40,"./parse":42,"./stringify":43}],42:[function(require,module,exports){ +'use strict'; + +var utils = require('./utils'); +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; +var defaults = { + allowDots: false, + allowEmptyArrays: false, + allowPrototypes: false, + allowSparse: false, + arrayLimit: 20, + charset: 'utf-8', + charsetSentinel: false, + comma: false, + decodeDotInKeys: false, + decoder: utils.decode, + delimiter: '&', + depth: 5, + duplicates: 'combine', + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1000, + parseArrays: true, + plainObjects: false, + strictDepth: false, + strictNullHandling: false, + throwOnLimitExceeded: false +}; +var interpretNumericEntities = function (str) { + return str.replace(/&#(\d+);/g, function ($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); +}; +var parseArrayValue = function (val, options, currentArrayLength) { + if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { + return val.split(','); + } + if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { + throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); + } + return val; +}; +var isoSentinel = 'utf8=%26%2310003%3B'; +var charsetSentinel = 'utf8=%E2%9C%93'; +var parseValues = function parseQueryStringValues(str, options) { + var obj = { + __proto__: null + }; + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit); + if (options.throwOnLimitExceeded && parts.length > limit) { + throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); + } + var skipIndex = -1; + var i; + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; + } + } + } + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + var key; + var val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function (encodedVal) { + return options.decoder(encodedVal, defaults.decoder, charset, 'value'); + }); + } + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(String(val)); + } + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + var existing = has.call(obj, key); + if (existing && options.duplicates === 'combine') { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === 'last') { + obj[key] = val; + } + } + return obj; +}; +var parseObject = function (chain, val, options, valuesParsed) { + var currentArrayLength = 0; + if (chain.length > 0 && chain[chain.length - 1] === '[]') { + var parentKey = chain.slice(0, -1).join(''); + currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; + } + var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + if (root === '[]' && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === '' || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf); + } else { + obj = options.plainObjects ? { + __proto__: null + } : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === '') { + obj = { + 0: leaf + }; + } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit) { + obj = []; + obj[index] = leaf; + } else if (decodedRoot !== '__proto__') { + obj[decodedRoot] = leaf; + } + } + leaf = obj; + } + return leaf; +}; +var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + var keys = []; + if (parent) { + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(parent); + } + var i = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } + keys.push('[' + key.slice(segment.index) + ']'); + } + return parseObject(keys, val, options, valuesParsed); +}; +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { + throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); + } + if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { + throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); + } + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; + if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { + throw new TypeError('The duplicates option must be either combine, first, or last'); + } + var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + depth: typeof opts.depth === 'number' || opts.depth === false ? +opts.depth : defaults.depth, + duplicates: duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, + throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false + }; +}; +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? { + __proto__: null + } : {}; + } + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? { + __proto__: null + } : {}; + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); + obj = utils.merge(obj, newObj, options); + } + if (options.allowSparse === true) { + return obj; + } + return utils.compact(obj); +}; + +},{"./utils":44}],43:[function(require,module,exports){ +'use strict'; + +var getSideChannel = require('side-channel'); +var utils = require('./utils'); +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; +var toISO = Date.prototype.toISOString; +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + commaRoundTrip: false, + delimiter: '&', + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + filter: void undefined, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean' || typeof v === 'symbol' || typeof v === 'bigint'; +}; +var sentinel = {}; +var stringify = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { + var obj = object; + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + findFlag = true; + } + } + if (typeof tmpSc.get(sentinel) === 'undefined') { + step = 0; + } + } + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = utils.maybeMap(obj, function (value) { + if (value instanceof Date) { + return serializeDate(value); + } + return value; + }); + } + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; + } + obj = ''; + } + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + var values = []; + if (typeof obj === 'undefined') { + return values; + } + var objKeys; + if (generateArrayPrefix === 'comma' && isArray(obj)) { + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ + value: obj.length > 0 ? obj.join(',') || null : void undefined + }]; + } else if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); + var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; + if (allowEmptyArrays && isArray(obj) && obj.length === 0) { + return adjustedPrefix + '[]'; + } + for (var j = 0; j < objKeys.length; ++j) { + var key = objKeys[j]; + var value = typeof key === 'object' && key && typeof key.value !== 'undefined' ? key.value : obj[key]; + if (skipNulls && value === null) { + continue; + } + var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); + var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel)); + } + return values; +}; +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + var objKeys; + var filter; + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + var keys = []; + if (typeof obj !== 'object' || obj === null) { + return ''; + } + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + if (!objKeys) { + objKeys = Object.keys(obj); + } + if (options.sort) { + objKeys.sort(options.sort); + } + var sideChannel = getSideChannel(); + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + var value = obj[key]; + if (options.skipNulls && value === null) { + continue; + } + pushToArray(keys, stringify(value, key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel)); + } + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + prefix += 'utf8=%26%2310003%3B&'; + } else { + prefix += 'utf8=%E2%9C%93&'; + } + } + return joined.length > 0 ? prefix + joined : ''; +}; + +},{"./formats":40,"./utils":44,"side-channel":48}],44:[function(require,module,exports){ +'use strict'; + +var formats = require('./formats'); +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; +var hexTable = function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + return array; +}(); +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + if (isArray(obj)) { + var compacted = []; + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } + item.obj[item.prop] = compacted; + } + } +}; +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? { + __proto__: null + } : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + return obj; +}; +var merge = function merge(target, source, options) { + if (!source) { + return target; + } + if (typeof source !== 'object' && typeof source !== 'function') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + return target; + } + if (!target || typeof target !== 'object') { + return [target].concat(source); + } + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; +var decode = function (str, defaultDecoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; +var limit = 1024; +var encode = function encode(str, defaultEncoder, charset, kind, format) { + if (str.length === 0) { + return str; + } + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + var out = ''; + for (var j = 0; j < string.length; j += limit) { + var segment = string.length >= limit ? string.slice(j, j + limit) : string; + var arr = []; + for (var i = 0; i < segment.length; ++i) { + var c = segment.charCodeAt(i); + if (c === 0x2D || c === 0x2E || c === 0x5F || c === 0x7E || c >= 0x30 && c <= 0x39 || c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A || format === formats.RFC1738 && (c === 0x28 || c === 0x29)) { + arr[arr.length] = segment.charAt(i); + continue; + } + if (c < 0x80) { + arr[arr.length] = hexTable[c]; + continue; + } + if (c < 0x800) { + arr[arr.length] = hexTable[0xC0 | c >> 6] + hexTable[0x80 | c & 0x3F]; + continue; + } + if (c < 0xD800 || c >= 0xE000) { + arr[arr.length] = hexTable[0xE0 | c >> 12] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]; + continue; + } + i += 1; + c = 0x10000 + ((c & 0x3FF) << 10 | segment.charCodeAt(i) & 0x3FF); + arr[arr.length] = hexTable[0xF0 | c >> 18] + hexTable[0x80 | c >> 12 & 0x3F] + hexTable[0x80 | c >> 6 & 0x3F] + hexTable[0x80 | c & 0x3F]; + } + out += arr.join(''); + } + return out; +}; +var compact = function compact(value) { + var queue = [{ + obj: { + o: value + }, + prop: 'o' + }]; + var refs = []; + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ + obj: obj, + prop: key + }); + refs.push(val); + } + } + } + compactQueue(queue); + return value; +}; +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; +var combine = function combine(a, b) { + return [].concat(a, b); +}; +var maybeMap = function maybeMap(val, fn) { + if (isArray(val)) { + var mapped = []; + for (var i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i])); + } + return mapped; + } + return fn(val); +}; +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + maybeMap: maybeMap, + merge: merge +}; + +},{"./formats":40}],45:[function(require,module,exports){ +'use strict'; + +var inspect = require('object-inspect'); +var $TypeError = require('es-errors/type'); +var listGetNode = function (list, key, isDelete) { + var prev = list; + var curr; + for (; (curr = prev.next) != null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + if (!isDelete) { + curr.next = list.next; + list.next = curr; + } + return curr; + } + } +}; +var listGet = function (objects, key) { + if (!objects) { + return void undefined; + } + var node = listGetNode(objects, key); + return node && node.value; +}; +var listSet = function (objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + objects.next = { + key: key, + next: objects.next, + value: value + }; + } +}; +var listHas = function (objects, key) { + if (!objects) { + return false; + } + return !!listGetNode(objects, key); +}; +var listDelete = function (objects, key) { + if (objects) { + return listGetNode(objects, key, true); + } +}; +module.exports = function getSideChannelList() { + var $o; + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + var root = $o && $o.next; + var deletedNode = listDelete($o, key); + if (deletedNode && root && root === deletedNode) { + $o = void undefined; + } + return !!deletedNode; + }, + get: function (key) { + return listGet($o, key); + }, + has: function (key) { + return listHas($o, key); + }, + set: function (key, value) { + if (!$o) { + $o = { + next: void undefined + }; + } + listSet($o, key, value); + } + }; + return channel; +}; + +},{"es-errors/type":16,"object-inspect":39}],46:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); +var $TypeError = require('es-errors/type'); +var $Map = GetIntrinsic('%Map%', true); +var $mapGet = callBound('Map.prototype.get', true); +var $mapSet = callBound('Map.prototype.set', true); +var $mapHas = callBound('Map.prototype.has', true); +var $mapDelete = callBound('Map.prototype.delete', true); +var $mapSize = callBound('Map.prototype.size', true); +module.exports = !!$Map && function getSideChannelMap() { + var $m; + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($m) { + var result = $mapDelete($m, key); + if ($mapSize($m) === 0) { + $m = void undefined; + } + return result; + } + return false; + }, + get: function (key) { + if ($m) { + return $mapGet($m, key); + } + }, + has: function (key) { + if ($m) { + return $mapHas($m, key); + } + return false; + }, + set: function (key, value) { + if (!$m) { + $m = new $Map(); + } + $mapSet($m, key, value); + } + }; + return channel; +}; + +},{"call-bound":7,"es-errors/type":16,"get-intrinsic":22,"object-inspect":39}],47:[function(require,module,exports){ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); +var callBound = require('call-bound'); +var inspect = require('object-inspect'); +var getSideChannelMap = require('side-channel-map'); +var $TypeError = require('es-errors/type'); +var $WeakMap = GetIntrinsic('%WeakMap%', true); +var $weakMapGet = callBound('WeakMap.prototype.get', true); +var $weakMapSet = callBound('WeakMap.prototype.set', true); +var $weakMapHas = callBound('WeakMap.prototype.has', true); +var $weakMapDelete = callBound('WeakMap.prototype.delete', true); +module.exports = $WeakMap ? function getSideChannelWeakMap() { + var $wm; + var $m; + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapDelete($wm, key); + } + } else if (getSideChannelMap) { + if ($m) { + return $m['delete'](key); + } + } + return false; + }, + get: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapGet($wm, key); + } + } + return $m && $m.get(key); + }, + has: function (key) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if ($wm) { + return $weakMapHas($wm, key); + } + } + return !!$m && $m.has(key); + }, + set: function (key, value) { + if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if (getSideChannelMap) { + if (!$m) { + $m = getSideChannelMap(); + } + $m.set(key, value); + } + } + }; + return channel; +} : getSideChannelMap; + +},{"call-bound":7,"es-errors/type":16,"get-intrinsic":22,"object-inspect":39,"side-channel-map":46}],48:[function(require,module,exports){ +'use strict'; + +var $TypeError = require('es-errors/type'); +var inspect = require('object-inspect'); +var getSideChannelList = require('side-channel-list'); +var getSideChannelMap = require('side-channel-map'); +var getSideChannelWeakMap = require('side-channel-weakmap'); +var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; +module.exports = function getSideChannel() { + var $channelData; + var channel = { + assert: function (key) { + if (!channel.has(key)) { + throw new $TypeError('Side channel does not contain ' + inspect(key)); + } + }, + 'delete': function (key) { + return !!$channelData && $channelData['delete'](key); + }, + get: function (key) { + return $channelData && $channelData.get(key); + }, + has: function (key) { + return !!$channelData && $channelData.has(key); + }, + set: function (key, value) { + if (!$channelData) { + $channelData = makeChannel(); + } + $channelData.set(key, value); + } + }; + return channel; +}; + +},{"es-errors/type":16,"object-inspect":39,"side-channel-list":45,"side-channel-map":46,"side-channel-weakmap":47}],49:[function(require,module,exports){ +const defaults = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts']; +class Agent { + constructor() { + this._defaults = []; + } + _setDefaults(request) { + for (const def of this._defaults) { + request[def.fn](...def.args); + } + } +} +for (const fn of defaults) { + Agent.prototype[fn] = function (...args) { + this._defaults.push({ + fn, + args + }); + return this; + }; +} +module.exports = Agent; + +},{}],50:[function(require,module,exports){ +let root; +if (typeof window !== 'undefined') { + root = window; +} else if (typeof self === 'undefined') { + console.warn('Using browser-only version of superagent in non-browser environment'); + root = this; +} else { + root = self; +} +const Emitter = require('component-emitter'); +const safeStringify = require('fast-safe-stringify'); +const qs = require('qs'); +const RequestBase = require('./request-base'); +const { + isObject, + mixin, + hasOwn +} = require('./utils'); +const ResponseBase = require('./response-base'); +const Agent = require('./agent-base'); +function noop() {} +module.exports = function (method, url) { + if (typeof url === 'function') { + return new exports.Request('GET', method).end(url); + } + if (arguments.length === 1) { + return new exports.Request('GET', method); + } + return new exports.Request(method, url); +}; +exports = module.exports; +const request = exports; +exports.Request = Request; +request.getXHR = () => { + if (root.XMLHttpRequest) { + return new root.XMLHttpRequest(); + } + throw new Error('Browser-only version of superagent could not find XHR'); +}; +const trim = ''.trim ? s => s.trim() : s => s.replace(/(^\s*|\s*$)/g, ''); +function serialize(object) { + if (!isObject(object)) return object; + const pairs = []; + for (const key in object) { + if (hasOwn(object, key)) pushEncodedKeyValuePair(pairs, key, object[key]); + } + return pairs.join('&'); +} +function pushEncodedKeyValuePair(pairs, key, value) { + if (value === undefined) return; + if (value === null) { + pairs.push(encodeURI(key)); + return; + } + if (Array.isArray(value)) { + for (const v of value) { + pushEncodedKeyValuePair(pairs, key, v); + } + } else if (isObject(value)) { + for (const subkey in value) { + if (hasOwn(value, subkey)) pushEncodedKeyValuePair(pairs, `${key}[${subkey}]`, value[subkey]); + } + } else { + pairs.push(encodeURI(key) + '=' + encodeURIComponent(value)); + } +} +request.serializeObject = serialize; +function parseString(string_) { + const object = {}; + const pairs = string_.split('&'); + let pair; + let pos; + for (let i = 0, length_ = pairs.length; i < length_; ++i) { + pair = pairs[i]; + pos = pair.indexOf('='); + if (pos === -1) { + object[decodeURIComponent(pair)] = ''; + } else { + object[decodeURIComponent(pair.slice(0, pos))] = decodeURIComponent(pair.slice(pos + 1)); + } + } + return object; +} +request.parseString = parseString; +request.types = { + html: 'text/html', + json: 'application/json', + xml: 'text/xml', + urlencoded: 'application/x-www-form-urlencoded', + form: 'application/x-www-form-urlencoded', + 'form-data': 'application/x-www-form-urlencoded' +}; +request.serialize = { + 'application/x-www-form-urlencoded': obj => { + return qs.stringify(obj, { + indices: false, + strictNullHandling: true + }); + }, + 'application/json': safeStringify +}; +request.parse = { + 'application/x-www-form-urlencoded': parseString, + 'application/json': JSON.parse +}; +function parseHeader(string_) { + const lines = string_.split(/\r?\n/); + const fields = {}; + let index; + let line; + let field; + let value; + for (let i = 0, length_ = lines.length; i < length_; ++i) { + line = lines[i]; + index = line.indexOf(':'); + if (index === -1) { + continue; + } + field = line.slice(0, index).toLowerCase(); + value = trim(line.slice(index + 1)); + fields[field] = value; + } + return fields; +} +function isJSON(mime) { + return /[/+]json($|[^-\w])/i.test(mime); +} +function Response(request_) { + this.req = request_; + this.xhr = this.req.xhr; + this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null; + this.statusText = this.req.xhr.statusText; + let { + status + } = this.xhr; + if (status === 1223) { + status = 204; + } + this._setStatusProperties(status); + this.headers = parseHeader(this.xhr.getAllResponseHeaders()); + this.header = this.headers; + this.header['content-type'] = this.xhr.getResponseHeader('content-type'); + this._setHeaderProperties(this.header); + if (this.text === null && request_._responseType) { + this.body = this.xhr.response; + } else { + this.body = this.req.method === 'HEAD' ? null : this._parseBody(this.text ? this.text : this.xhr.response); + } +} +mixin(Response.prototype, ResponseBase.prototype); +Response.prototype._parseBody = function (string_) { + let parse = request.parse[this.type]; + if (this.req._parser) { + return this.req._parser(this, string_); + } + if (!parse && isJSON(this.type)) { + parse = request.parse['application/json']; + } + return parse && string_ && (string_.length > 0 || string_ instanceof Object) ? parse(string_) : null; +}; +Response.prototype.toError = function () { + const { + req + } = this; + const { + method + } = req; + const { + url + } = req; + const message = `cannot ${method} ${url} (${this.status})`; + const error = new Error(message); + error.status = this.status; + error.method = method; + error.url = url; + return error; +}; +request.Response = Response; +function Request(method, url) { + const self = this; + this._query = this._query || []; + this.method = method; + this.url = url; + this.header = {}; + this._header = {}; + this.on('end', () => { + let error = null; + let res = null; + try { + res = new Response(self); + } catch (err) { + error = new Error('Parser is unable to parse the response'); + error.parse = true; + error.original = err; + if (self.xhr) { + error.rawResponse = typeof self.xhr.responseType === 'undefined' ? self.xhr.responseText : self.xhr.response; + error.status = self.xhr.status ? self.xhr.status : null; + error.statusCode = error.status; + } else { + error.rawResponse = null; + error.status = null; + } + return self.callback(error); + } + self.emit('response', res); + let new_error; + try { + if (!self._isResponseOK(res)) { + new_error = new Error(res.statusText || res.text || 'Unsuccessful HTTP response'); + } + } catch (err) { + new_error = err; + } + if (new_error) { + new_error.original = error; + new_error.response = res; + new_error.status = new_error.status || res.status; + self.callback(new_error, res); + } else { + self.callback(null, res); + } + }); +} +Emitter(Request.prototype); +mixin(Request.prototype, RequestBase.prototype); +Request.prototype.type = function (type) { + this.set('Content-Type', request.types[type] || type); + return this; +}; +Request.prototype.accept = function (type) { + this.set('Accept', request.types[type] || type); + return this; +}; +Request.prototype.auth = function (user, pass, options) { + if (arguments.length === 1) pass = ''; + if (typeof pass === 'object' && pass !== null) { + options = pass; + pass = ''; + } + if (!options) { + options = { + type: typeof btoa === 'function' ? 'basic' : 'auto' + }; + } + const encoder = options.encoder ? options.encoder : string => { + if (typeof btoa === 'function') { + return btoa(string); + } + throw new Error('Cannot use basic auth, btoa is not a function'); + }; + return this._auth(user, pass, options, encoder); +}; +Request.prototype.query = function (value) { + if (typeof value !== 'string') value = serialize(value); + if (value) this._query.push(value); + return this; +}; +Request.prototype.attach = function (field, file, options) { + if (file) { + if (this._data) { + throw new Error("superagent can't mix .send() and .attach()"); + } + this._getFormData().append(field, file, options || file.name); + } + return this; +}; +Request.prototype._getFormData = function () { + if (!this._formData) { + this._formData = new root.FormData(); + } + return this._formData; +}; +Request.prototype.callback = function (error, res) { + if (this._shouldRetry(error, res)) { + return this._retry(); + } + const fn = this._callback; + this.clearTimeout(); + if (error) { + if (this._maxRetries) error.retries = this._retries - 1; + this.emit('error', error); + } + fn(error, res); +}; +Request.prototype.crossDomainError = function () { + const error = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'); + error.crossDomain = true; + error.status = this.status; + error.method = this.method; + error.url = this.url; + this.callback(error); +}; +Request.prototype.agent = function () { + console.warn('This is not supported in browser version of superagent'); + return this; +}; +Request.prototype.ca = Request.prototype.agent; +Request.prototype.buffer = Request.prototype.ca; +Request.prototype.write = () => { + throw new Error('Streaming is not supported in browser version of superagent'); +}; +Request.prototype.pipe = Request.prototype.write; +Request.prototype._isHost = function (object) { + return object && typeof object === 'object' && !Array.isArray(object) && Object.prototype.toString.call(object) !== '[object Object]'; +}; +Request.prototype.end = function (fn) { + if (this._endCalled) { + console.warn('Warning: .end() was called twice. This is not supported in superagent'); + } + this._endCalled = true; + this._callback = fn || noop; + this._finalizeQueryString(); + this._end(); +}; +Request.prototype._setUploadTimeout = function () { + const self = this; + if (this._uploadTimeout && !this._uploadTimeoutTimer) { + this._uploadTimeoutTimer = setTimeout(() => { + self._timeoutError('Upload timeout of ', self._uploadTimeout, 'ETIMEDOUT'); + }, this._uploadTimeout); + } +}; +Request.prototype._end = function () { + if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called')); + const self = this; + this.xhr = request.getXHR(); + const { + xhr + } = this; + let data = this._formData || this._data; + this._setTimeouts(); + xhr.addEventListener('readystatechange', () => { + const { + readyState + } = xhr; + if (readyState >= 2 && self._responseTimeoutTimer) { + clearTimeout(self._responseTimeoutTimer); + } + if (readyState !== 4) { + return; + } + let status; + try { + status = xhr.status; + } catch (err) { + status = 0; + } + if (!status) { + if (self.timedout || self._aborted) return; + return self.crossDomainError(); + } + self.emit('end'); + }); + const handleProgress = (direction, e) => { + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; + if (e.percent === 100) { + clearTimeout(self._uploadTimeoutTimer); + } + } + e.direction = direction; + self.emit('progress', e); + }; + if (this.hasListeners('progress')) { + try { + xhr.addEventListener('progress', handleProgress.bind(null, 'download')); + if (xhr.upload) { + xhr.upload.addEventListener('progress', handleProgress.bind(null, 'upload')); + } + } catch (err) {} + } + if (xhr.upload) { + this._setUploadTimeout(); + } + try { + if (this.username && this.password) { + xhr.open(this.method, this.url, true, this.username, this.password); + } else { + xhr.open(this.method, this.url, true); + } + } catch (err) { + return this.callback(err); + } + if (this._withCredentials) xhr.withCredentials = true; + if (!this._formData && this.method !== 'GET' && this.method !== 'HEAD' && typeof data !== 'string' && !this._isHost(data)) { + const contentType = this._header['content-type']; + let serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : '']; + if (!serialize && isJSON(contentType)) { + serialize = request.serialize['application/json']; + } + if (serialize) data = serialize(data); + } + for (const field in this.header) { + if (this.header[field] === null) continue; + if (hasOwn(this.header, field)) xhr.setRequestHeader(field, this.header[field]); + } + if (this._responseType) { + xhr.responseType = this._responseType; + } + this.emit('request', this); + xhr.send(typeof data === 'undefined' ? null : data); +}; +request.agent = () => new Agent(); +for (const method of ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE']) { + Agent.prototype[method.toLowerCase()] = function (url, fn) { + const request_ = new request.Request(method, url); + this._setDefaults(request_); + if (fn) { + request_.end(fn); + } + return request_; + }; +} +Agent.prototype.del = Agent.prototype.delete; +request.get = (url, data, fn) => { + const request_ = request('GET', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; +request.head = (url, data, fn) => { + const request_ = request('HEAD', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; +request.options = (url, data, fn) => { + const request_ = request('OPTIONS', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +function del(url, data, fn) { + const request_ = request('DELETE', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +} +request.del = del; +request.delete = del; +request.patch = (url, data, fn) => { + const request_ = request('PATCH', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +request.post = (url, data, fn) => { + const request_ = request('POST', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +request.put = (url, data, fn) => { + const request_ = request('PUT', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +},{"./agent-base":49,"./request-base":51,"./response-base":52,"./utils":53,"component-emitter":8,"fast-safe-stringify":19,"qs":41}],51:[function(require,module,exports){ +const { + isObject, + hasOwn +} = require('./utils'); +module.exports = RequestBase; +function RequestBase() {} +RequestBase.prototype.clearTimeout = function () { + clearTimeout(this._timer); + clearTimeout(this._responseTimeoutTimer); + clearTimeout(this._uploadTimeoutTimer); + delete this._timer; + delete this._responseTimeoutTimer; + delete this._uploadTimeoutTimer; + return this; +}; +RequestBase.prototype.parse = function (fn) { + this._parser = fn; + return this; +}; +RequestBase.prototype.responseType = function (value) { + this._responseType = value; + return this; +}; +RequestBase.prototype.serialize = function (fn) { + this._serializer = fn; + return this; +}; +RequestBase.prototype.timeout = function (options) { + if (!options || typeof options !== 'object') { + this._timeout = options; + this._responseTimeout = 0; + this._uploadTimeout = 0; + return this; + } + for (const option in options) { + if (hasOwn(options, option)) { + switch (option) { + case 'deadline': + this._timeout = options.deadline; + break; + case 'response': + this._responseTimeout = options.response; + break; + case 'upload': + this._uploadTimeout = options.upload; + break; + default: + console.warn('Unknown timeout option', option); + } + } + } + return this; +}; +RequestBase.prototype.retry = function (count, fn) { + if (arguments.length === 0 || count === true) count = 1; + if (count <= 0) count = 0; + this._maxRetries = count; + this._retries = 0; + this._retryCallback = fn; + return this; +}; +const ERROR_CODES = new Set(['ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN']); +const STATUS_CODES = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524]); +RequestBase.prototype._shouldRetry = function (error, res) { + if (!this._maxRetries || this._retries++ >= this._maxRetries) { + return false; + } + if (this._retryCallback) { + try { + const override = this._retryCallback(error, res); + if (override === true) return true; + if (override === false) return false; + } catch (err) { + console.error(err); + } + } + if (res && res.status && STATUS_CODES.has(res.status)) return true; + if (error) { + if (error.code && ERROR_CODES.has(error.code)) return true; + if (error.timeout && error.code === 'ECONNABORTED') return true; + if (error.crossDomain) return true; + } + return false; +}; +RequestBase.prototype._retry = function () { + this.clearTimeout(); + if (this.req) { + this.req = null; + this.req = this.request(); + } + this._aborted = false; + this.timedout = false; + this.timedoutError = null; + return this._end(); +}; +RequestBase.prototype.then = function (resolve, reject) { + if (!this._fullfilledPromise) { + const self = this; + if (this._endCalled) { + console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises'); + } + this._fullfilledPromise = new Promise((resolve, reject) => { + self.on('abort', () => { + if (this._maxRetries && this._maxRetries > this._retries) { + return; + } + if (this.timedout && this.timedoutError) { + reject(this.timedoutError); + return; + } + const error = new Error('Aborted'); + error.code = 'ABORTED'; + error.status = this.status; + error.method = this.method; + error.url = this.url; + reject(error); + }); + self.end((error, res) => { + if (error) reject(error);else resolve(res); + }); + }); + } + return this._fullfilledPromise.then(resolve, reject); +}; +RequestBase.prototype.catch = function (callback) { + return this.then(undefined, callback); +}; +RequestBase.prototype.use = function (fn) { + fn(this); + return this; +}; +RequestBase.prototype.ok = function (callback) { + if (typeof callback !== 'function') throw new Error('Callback required'); + this._okCallback = callback; + return this; +}; +RequestBase.prototype._isResponseOK = function (res) { + if (!res) { + return false; + } + if (this._okCallback) { + return this._okCallback(res); + } + return res.status >= 200 && res.status < 300; +}; +RequestBase.prototype.get = function (field) { + return this._header[field.toLowerCase()]; +}; +RequestBase.prototype.getHeader = RequestBase.prototype.get; +RequestBase.prototype.set = function (field, value) { + if (isObject(field)) { + for (const key in field) { + if (hasOwn(field, key)) this.set(key, field[key]); + } + return this; + } + this._header[field.toLowerCase()] = value; + this.header[field] = value; + return this; +}; +RequestBase.prototype.unset = function (field) { + delete this._header[field.toLowerCase()]; + delete this.header[field]; + return this; +}; +RequestBase.prototype.field = function (name, value, options) { + if (name === null || undefined === name) { + throw new Error('.field(name, val) name can not be empty'); + } + if (this._data) { + throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"); + } + if (isObject(name)) { + for (const key in name) { + if (hasOwn(name, key)) this.field(key, name[key]); + } + return this; + } + if (Array.isArray(value)) { + for (const i in value) { + if (hasOwn(value, i)) this.field(name, value[i]); + } + return this; + } + if (value === null || undefined === value) { + throw new Error('.field(name, val) val can not be empty'); + } + if (typeof value === 'boolean') { + value = String(value); + } + if (options) this._getFormData().append(name, value, options);else this._getFormData().append(name, value); + return this; +}; +RequestBase.prototype.abort = function () { + if (this._aborted) { + return this; + } + this._aborted = true; + if (this.xhr) this.xhr.abort(); + if (this.req) { + this.req.abort(); + } + this.clearTimeout(); + this.emit('abort'); + return this; +}; +RequestBase.prototype._auth = function (user, pass, options, base64Encoder) { + switch (options.type) { + case 'basic': + this.set('Authorization', `Basic ${base64Encoder(`${user}:${pass}`)}`); + break; + case 'auto': + this.username = user; + this.password = pass; + break; + case 'bearer': + this.set('Authorization', `Bearer ${user}`); + break; + default: + break; + } + return this; +}; +RequestBase.prototype.withCredentials = function (on) { + if (on === undefined) on = true; + this._withCredentials = on; + return this; +}; +RequestBase.prototype.redirects = function (n) { + this._maxRedirects = n; + return this; +}; +RequestBase.prototype.maxResponseSize = function (n) { + if (typeof n !== 'number') { + throw new TypeError('Invalid argument'); + } + this._maxResponseSize = n; + return this; +}; +RequestBase.prototype.toJSON = function () { + return { + method: this.method, + url: this.url, + data: this._data, + headers: this._header + }; +}; +RequestBase.prototype.send = function (data) { + const isObject_ = isObject(data); + let type = this._header['content-type']; + if (this._formData) { + throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"); + } + if (isObject_ && !this._data) { + if (Array.isArray(data)) { + this._data = []; + } else if (!this._isHost(data)) { + this._data = {}; + } + } else if (data && this._data && this._isHost(this._data)) { + throw new Error("Can't merge these send calls"); + } + if (isObject_ && isObject(this._data)) { + for (const key in data) { + if (typeof data[key] == 'bigint' && !data[key].toJSON) throw new Error('Cannot serialize BigInt value to json'); + if (hasOwn(data, key)) this._data[key] = data[key]; + } + } else if (typeof data === 'bigint') throw new Error("Cannot send value of type BigInt");else if (typeof data === 'string') { + if (!type) this.type('form'); + type = this._header['content-type']; + if (type) type = type.toLowerCase().trim(); + if (type === 'application/x-www-form-urlencoded') { + this._data = this._data ? `${this._data}&${data}` : data; + } else { + this._data = (this._data || '') + data; + } + } else { + this._data = data; + } + if (!isObject_ || this._isHost(data)) { + return this; + } + if (!type) this.type('json'); + return this; +}; +RequestBase.prototype.sortQuery = function (sort) { + this._sort = typeof sort === 'undefined' ? true : sort; + return this; +}; +RequestBase.prototype._finalizeQueryString = function () { + const query = this._query.join('&'); + if (query) { + this.url += (this.url.includes('?') ? '&' : '?') + query; + } + this._query.length = 0; + if (this._sort) { + const index = this.url.indexOf('?'); + if (index >= 0) { + const queryArray = this.url.slice(index + 1).split('&'); + if (typeof this._sort === 'function') { + queryArray.sort(this._sort); + } else { + queryArray.sort(); + } + this.url = this.url.slice(0, index) + '?' + queryArray.join('&'); + } + } +}; +RequestBase.prototype._appendQueryString = () => { + console.warn('Unsupported'); +}; +RequestBase.prototype._timeoutError = function (reason, timeout, errno) { + if (this._aborted) { + return; + } + const error = new Error(`${reason + timeout}ms exceeded`); + error.timeout = timeout; + error.code = 'ECONNABORTED'; + error.errno = errno; + this.timedout = true; + this.timedoutError = error; + this.abort(); + this.callback(error); +}; +RequestBase.prototype._setTimeouts = function () { + const self = this; + if (this._timeout && !this._timer) { + this._timer = setTimeout(() => { + self._timeoutError('Timeout of ', self._timeout, 'ETIME'); + }, this._timeout); + } + if (this._responseTimeout && !this._responseTimeoutTimer) { + this._responseTimeoutTimer = setTimeout(() => { + self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT'); + }, this._responseTimeout); + } +}; + +},{"./utils":53}],52:[function(require,module,exports){ +const utils = require('./utils'); +module.exports = ResponseBase; +function ResponseBase() {} +ResponseBase.prototype.get = function (field) { + return this.header[field.toLowerCase()]; +}; +ResponseBase.prototype._setHeaderProperties = function (header) { + const ct = header['content-type'] || ''; + this.type = utils.type(ct); + const parameters = utils.params(ct); + for (const key in parameters) { + if (Object.prototype.hasOwnProperty.call(parameters, key)) this[key] = parameters[key]; + } + this.links = {}; + try { + if (header.link) { + this.links = utils.parseLinks(header.link); + } + } catch (err) {} +}; +ResponseBase.prototype._setStatusProperties = function (status) { + const type = Math.trunc(status / 100); + this.statusCode = status; + this.status = this.statusCode; + this.statusType = type; + this.info = type === 1; + this.ok = type === 2; + this.redirect = type === 3; + this.clientError = type === 4; + this.serverError = type === 5; + this.error = type === 4 || type === 5 ? this.toError() : false; + this.created = status === 201; + this.accepted = status === 202; + this.noContent = status === 204; + this.badRequest = status === 400; + this.unauthorized = status === 401; + this.notAcceptable = status === 406; + this.forbidden = status === 403; + this.notFound = status === 404; + this.unprocessableEntity = status === 422; +}; + +},{"./utils":53}],53:[function(require,module,exports){ +exports.type = string_ => string_.split(/ *; */).shift(); +exports.params = value => { + const object = {}; + for (const string_ of value.split(/ *; */)) { + const parts = string_.split(/ *= */); + const key = parts.shift(); + const value = parts.shift(); + if (key && value) object[key] = value; + } + return object; +}; +exports.parseLinks = value => { + const object = {}; + for (const string_ of value.split(/ *, */)) { + const parts = string_.split(/ *; */); + const url = parts[0].slice(1, -1); + const rel = parts[1].split(/ *= */)[1].slice(1, -1); + object[rel] = url; + } + return object; +}; +exports.cleanHeader = (header, changesOrigin) => { + delete header['content-type']; + delete header['content-length']; + delete header['transfer-encoding']; + delete header.host; + if (changesOrigin) { + delete header.authorization; + delete header.cookie; + } + return header; +}; +exports.normalizeHostname = hostname => { + const [, normalized] = hostname.match(/^\[([^\]]+)\]$/) || []; + return normalized || hostname; +}; +exports.isObject = object => { + return object !== null && typeof object === 'object'; +}; +exports.hasOwn = Object.hasOwn || function (object, property) { + if (object == null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + return Object.prototype.hasOwnProperty.call(new Object(object), property); +}; +exports.mixin = (target, source) => { + for (const key in source) { + if (exports.hasOwn(source, key)) { + target[key] = source[key]; + } + } +}; +exports.isGzipOrDeflateEncoding = res => { + return new RegExp(/^\s*(?:deflate|gzip)\s*$/).test(res.headers['content-encoding']); +}; +exports.isBrotliEncoding = res => { + return new RegExp(/^\s*(?:br)\s*$/).test(res.headers['content-encoding']); +}; + +},{}]},{},[50])(50) +}); diff --git a/node_modules/superagent/dist/superagent.min.js b/node_modules/superagent/dist/superagent.min.js new file mode 100644 index 0000000..60e3264 --- /dev/null +++ b/node_modules/superagent/dist/superagent.min.js @@ -0,0 +1 @@ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).superagent=t()}}((function(){var t={exports:{}};function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,o=this._callbacks["$"+t];if(!o)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n=0;np.depthLimit)return void s("[...]",e,r,i);if(void 0!==p.edgesLimit&&o+1>p.edgesLimit)return void s("[...]",e,r,i);if(n.push(e),Array.isArray(e))for(u=0;ue?1:0}function u(t,e,r,a){void 0===a&&(a=i());var u,c=function t(e,r,n,i,a,u,l){var c;if(u+=1,"object"==typeof e&&null!==e){for(c=0;cl.depthLimit)return void s("[...]",e,r,a);if(void 0!==l.edgesLimit&&n+1>l.edgesLimit)return void s("[...]",e,r,a);if(i.push(e),Array.isArray(e))for(c=0;c0)for(var o=0;o-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var o=t<0?-j(-t):j(t);if(o!==t){var n=String(o),i=b.call(e,n.length+1);return v.call(n,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var F=f.custom,N=$(F)?F:null,M={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function q(t,e,r){var o=r.quoteStyle||e,n=M[o];return n+t+n}function L(t){return v.call(String(t),/"/g,""")}function B(t){return!k||!("object"==typeof t&&(k in t||void 0!==t[k]))}function W(t){return"[object Array]"===J(t)&&B(t)}function H(t){return"[object RegExp]"===J(t)&&B(t)}function $(t){if(R)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(e){}return!1}y=function e(r,i,a,y){var d=i||{};if(G(d,"quoteStyle")&&!G(M,d.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(d,"maxStringLength")&&("number"==typeof d.maxStringLength?d.maxStringLength<0&&d.maxStringLength!==1/0:null!==d.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var w=!G(d,"customInspect")||d.customInspect;if("boolean"!=typeof w&&"symbol"!==w)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(d,"indent")&&null!==d.indent&&"\t"!==d.indent&&!(parseInt(d.indent,10)===d.indent&&d.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(d,"numericSeparator")&&"boolean"!=typeof d.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var S=d.numericSeparator;if(void 0===r)return"undefined";if(null===r)return"null";if("boolean"==typeof r)return r?"true":"false";if("string"==typeof r)return function t(e,r){if(e.length>r.maxStringLength){var o=e.length-r.maxStringLength,n="... "+o+" more character"+(o>1?"s":"");return t(b.call(e,0,r.maxStringLength),r)+n}var i=U[r.quoteStyle||"single"];return i.lastIndex=0,q(v.call(v.call(e,i,"\\$1"),/[\x00-\x1f]/g,V),"single",r)}(r,d);if("number"==typeof r){if(0===r)return 1/0/r>0?"0":"-0";var j=String(r);return S?C(r,j):j}if("bigint"==typeof r){var P=String(r)+"n";return S?C(r,P):P}var F=void 0===d.depth?5:d.depth;if(void 0===a&&(a=0),a>=F&&F>0&&"object"==typeof r)return W(r)?"[Array]":"[Object]";var z,et=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=E.call(Array(t.indent+1)," ")}return{base:r,prev:E.call(Array(e+1),r)}}(d,a);if(void 0===y)y=[];else if(K(y,r)>=0)return"[Circular]";function rt(t,r,o){if(r&&(y=O.call(y)).push(r),o){var n={depth:d.depth};return G(d,"quoteStyle")&&(n.quoteStyle=d.quoteStyle),e(t,n,a+1,y)}return e(t,d,a+1,y)}if("function"==typeof r&&!H(r)){var ot=function(t){if(t.name)return t.name;var e=g.call(m.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(r),nt=tt(r,rt);return"[Function"+(ot?": "+ot:" (anonymous)")+"]"+(nt.length>0?" { "+E.call(nt,", ")+" }":"")}if($(r)){var it=R?v.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(r);return"object"!=typeof r||R?it:Q(it)}if((z=r)&&"object"==typeof z&&("undefined"!=typeof HTMLElement&&z instanceof HTMLElement||"string"==typeof z.nodeName&&"function"==typeof z.getAttribute)){for(var at="<"+_.call(String(r.nodeName)),st=r.attributes||[],pt=0;pt"}if(W(r)){if(0===r.length)return"[]";var ut=tt(r,rt);return et&&!function(t){for(var e=0;e=0)return!1;return!0}(ut)?"["+Z(ut,et)+"]":"[ "+E.call(ut,", ")+" ]"}if(function(t){return"[object Error]"===J(t)&&B(t)}(r)){var lt=tt(r,rt);return"cause"in Error.prototype||!("cause"in r)||I.call(r,"cause")?0===lt.length?"["+String(r)+"]":"{ ["+String(r)+"] "+E.call(lt,", ")+" }":"{ ["+String(r)+"] "+E.call(A.call("[cause]: "+rt(r.cause),lt),", ")+" }"}if("object"==typeof r&&w){if(N&&"function"==typeof r[N]&&f)return f(r,{depth:F-a});if("symbol"!==w&&"function"==typeof r.inspect)return r.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{s.call(t)}catch(at){return!0}return t instanceof Map}catch(e){}return!1}(r)){var ct=[];return n&&n.call(r,(function(t,e){ct.push(rt(e,r,!0)+" => "+rt(t,r))})),Y("Map",o.call(r),ct,et)}if(function(t){if(!s||!t||"object"!=typeof t)return!1;try{s.call(t);try{o.call(t)}catch(e){return!0}return t instanceof Set}catch(r){}return!1}(r)){var ft=[];return p&&p.call(r,(function(t){ft.push(rt(t,r))})),Y("Set",s.call(r),ft,et)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t,u);try{l.call(t,l)}catch(at){return!0}return t instanceof WeakMap}catch(e){}return!1}(r))return X("WeakMap");if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t,l);try{u.call(t,u)}catch(at){return!0}return t instanceof WeakSet}catch(e){}return!1}(r))return X("WeakSet");if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{return c.call(t),!0}catch(e){}return!1}(r))return X("WeakRef");if(function(t){return"[object Number]"===J(t)&&B(t)}(r))return Q(rt(Number(r)));if(function(t){if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(e){}return!1}(r))return Q(rt(T.call(r)));if(function(t){return"[object Boolean]"===J(t)&&B(t)}(r))return Q(h.call(r));if(function(t){return"[object String]"===J(t)&&B(t)}(r))return Q(rt(String(r)));if("undefined"!=typeof window&&r===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&r===globalThis||void 0!==t&&r===t)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===J(t)&&B(t)}(r)&&!H(r)){var yt=tt(r,rt),ht=D?D(r)===Object.prototype:r instanceof Object||r.constructor===Object,dt=r instanceof Object?"":"null prototype",mt=!ht&&k&&Object(r)===r&&k in r?b.call(J(r),8,-1):dt?"Object":"",gt=(ht||"function"!=typeof r.constructor?"":r.constructor.name?r.constructor.name+" ":"")+(mt||dt?"["+E.call(A.call([],mt||[],dt||[]),": ")+"] ":"");return 0===yt.length?gt+"{}":et?gt+"{"+Z(yt,et)+"}":gt+"{ "+E.call(yt,", ")+" }"}return String(r)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return z.call(t,e)}function J(t){return d.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===yt(/^%?[^%]*%?$/,t))throw new w("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=ft(t,0,1),r=ft(t,-1);if("%"===e&&"%"!==r)throw new w("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new w("invalid intrinsic syntax, expected opening `%`");var o=[];return ct(t,ht,(function(t,e,r,n){o[o.length]=r?ct(n,dt,"$1"):e||t})),o}(t),o=r.length>0?r[0]:"",n=mt("%"+o+"%",e),i=n.name,a=n.value,s=!1,p=n.alias;p&&(o=p[0],lt(r,ut([0,1],p)));for(var u=1,l=!0;u=r.length){var d=R(a,f);a=(l=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[f]}else l=Y(a,f),a=a[f];l&&!s&&(at[i]=a)}}return a},bt=$([gt("%String.prototype.indexOf%")]),vt=function(t,e){var r=gt(t,!!e);return"function"==typeof r&&bt(t,".prototype.")>-1?$([r]):r},wt=gt("%Map%",!0),_t=vt("Map.prototype.get",!0),St=vt("Map.prototype.set",!0),At=vt("Map.prototype.has",!0),Et=vt("Map.prototype.delete",!0),Ot=vt("Map.prototype.size",!0),jt=!!wt&&function(){var t,e={assert:function(t){if(!e.has(t))throw new c("Side channel does not contain "+y(t))},delete:function(e){if(t){var r=Et(t,e);return 0===Ot(t)&&(t=void 0),r}return!1},get:function(e){if(t)return _t(t,e)},has:function(e){return!!t&&At(t,e)},set:function(e,r){t||(t=new wt),St(t,e,r)}};return e},Tt=gt("%WeakMap%",!0),Pt=vt("WeakMap.prototype.get",!0),xt=vt("WeakMap.prototype.set",!0),Rt=vt("WeakMap.prototype.has",!0),kt=vt("WeakMap.prototype.delete",!0),It=(Tt?function(){var t,e,r={assert:function(t){if(!r.has(t))throw new c("Side channel does not contain "+y(t))},delete:function(r){if(Tt&&r&&("object"==typeof r||"function"==typeof r)){if(t)return kt(t,r)}else if(jt&&e)return e.delete(r);return!1},get:function(r){return Tt&&r&&("object"==typeof r||"function"==typeof r)&&t?Pt(t,r):e&&e.get(r)},has:function(r){return Tt&&r&&("object"==typeof r||"function"==typeof r)&&t?Rt(t,r):!!e&&e.has(r)},set:function(r,o){Tt&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new Tt),xt(t,r,o)):jt&&(e||(e=jt()),e.set(r,o))}};return r}:jt)||jt||function(){var t,e={assert:function(t){if(!e.has(t))throw new c("Side channel does not contain "+y(t))},delete:function(e){var r=t&&t.next,o=function(t,e){if(t)return h(t,e,!0)}(t,e);return o&&r&&r===o&&(t=void 0),!!o},get:function(e){return function(t,e){if(t){var r=h(t,e);return r&&r.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!h(t,e)}(t,e)},set:function(e,r){t||(t={next:void 0}),function(t,e,r){var o=h(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(t,e,r)}};return e},Dt=function(){var t,e={assert:function(t){if(!e.has(t))throw new c("Side channel does not contain "+y(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,r){t||(t=It()),t.set(e,r)}};return e},Ct=String.prototype.replace,Ft=/%20/g,Nt={default:"RFC3986",formatters:{RFC1738:function(t){return Ct.call(t,Ft,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:"RFC3986"},Mt=Object.prototype.hasOwnProperty,Ut=Array.isArray,qt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Lt={combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o1;){var e=t.pop(),r=e.obj[e.prop];if(Ut(r)){for(var o=[],n=0;n=1024?i.slice(s,s+1024):i,u=[],l=0;l=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||n===Nt.RFC1738&&(40===c||41===c)?u[u.length]=p.charAt(l):c<128?u[u.length]=qt[c]:c<2048?u[u.length]=qt[192|c>>6]+qt[128|63&c]:c<55296||c>=57344?u[u.length]=qt[224|c>>12]+qt[128|c>>6&63]+qt[128|63&c]:(l+=1,c=65536+((1023&c)<<10|1023&p.charCodeAt(l)),u[u.length]=qt[240|c>>18]+qt[128|c>>12&63]+qt[128|c>>6&63]+qt[128|63&c])}a+=u.join("")}return a},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(Ut(t)){for(var r=[],o=0;o0?w.join(",")||null:void 0}];else if(Ht(l))O=l;else{var T=Object.keys(w);O=c?T.sort(c):T}var P=p?String(r).replace(/\./g,"%2E"):String(r),x=n&&Ht(w)&&1===w.length?P+"[]":P;if(i&&Ht(w)&&0===w.length)return x+"[]";for(var R=0;R0?y+f:""}),Yt={type:t=>t.split(/ *; */).shift(),params:t=>{const e={};for(const r of t.split(/ *; */)){const t=r.split(/ *= */),o=t.shift(),n=t.shift();o&&n&&(e[o]=n)}return e},parseLinks:t=>{const e={};for(const r of t.split(/ *, */)){const t=r.split(/ *; */),o=t[0].slice(1,-1);e[t[1].split(/ *= */)[1].slice(1,-1)]=o}return e},isObject:t=>null!==t&&"object"==typeof t};Yt.hasOwn=Object.hasOwn||function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(t),e)},Yt.mixin=(t,e)=>{for(const r in e)Yt.hasOwn(e,r)&&(t[r]=e[r])};var Zt;const{isObject:te,hasOwn:ee}=Yt;function re(){}Zt=re,re.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},re.prototype.parse=function(t){return this._parser=t,this},re.prototype.responseType=function(t){return this._responseType=t,this},re.prototype.serialize=function(t){return this._serializer=t,this},re.prototype.timeout=function(t){if(!t||"object"!=typeof t)return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(const e in t)if(ee(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},re.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};const oe=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),ne=new Set([408,413,429,500,502,503,504,521,522,524]);re.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(r){console.error(r)}if(e&&e.status&&ne.has(e.status))return!0;if(t){if(t.code&&oe.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},re.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},re.prototype.then=function(t,e){if(!this._fullfilledPromise){const t=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((e,r)=>{t.on("abort",()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void r(this.timedoutError);const t=new Error("Aborted");t.code="ABORTED",t.status=this.status,t.method=this.method,t.url=this.url,r(t)}),t.end((t,o)=>{t?r(t):e(o)})})}return this._fullfilledPromise.then(t,e)},re.prototype.catch=function(t){return this.then(void 0,t)},re.prototype.use=function(t){return t(this),this},re.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},re.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},re.prototype.get=function(t){return this._header[t.toLowerCase()]},re.prototype.getHeader=re.prototype.get,re.prototype.set=function(t,e){if(te(t)){for(const e in t)ee(t,e)&&this.set(e,t[e]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},re.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},re.prototype.field=function(t,e,r){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(te(t)){for(const e in t)ee(t,e)&&this.field(e,t[e]);return this}if(Array.isArray(e)){for(const r in e)ee(e,r)&&this.field(t,e[r]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),r?this._getFormData().append(t,e,r):this._getFormData().append(t,e),this},re.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},re.prototype._auth=function(t,e,r,o){switch(r.type){case"basic":this.set("Authorization","Basic "+o(`${t}:${e}`));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer "+t)}return this},re.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},re.prototype.redirects=function(t){return this._maxRedirects=t,this},re.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},re.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},re.prototype.send=function(t){const e=te(t);let r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&te(this._data))for(const o in t){if("bigint"==typeof t[o]&&!t[o].toJSON)throw new Error("Cannot serialize BigInt value to json");ee(t,o)&&(this._data[o]=t[o])}else{if("bigint"==typeof t)throw new Error("Cannot send value of type BigInt");"string"==typeof t?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?`${this._data}&${t}`:t:(this._data||"")+t):this._data=t}return!e||this._isHost(t)||r||this.type("json"),this},re.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},re.prototype._finalizeQueryString=function(){const t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){const t=this.url.indexOf("?");if(t>=0){const e=this.url.slice(t+1).split("&");"function"==typeof this._sort?e.sort(this._sort):e.sort(),this.url=this.url.slice(0,t)+"?"+e.join("&")}}},re.prototype._appendQueryString=()=>{console.warn("Unsupported")},re.prototype._timeoutError=function(t,e,r){if(this._aborted)return;const o=new Error(t+e+"ms exceeded");o.timeout=e,o.code="ECONNABORTED",o.errno=r,this.timedout=!0,this.timedoutError=o,this.abort(),this.callback(o)},re.prototype._setTimeouts=function(){const t=this;this._timeout&&!this._timer&&(this._timer=setTimeout(()=>{t._timeoutError("Timeout of ",t._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(()=>{t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")},this._responseTimeout))};var ie;function ae(){}ie=ae,ae.prototype.get=function(t){return this.header[t.toLowerCase()]},ae.prototype._setHeaderProperties=function(t){const e=t["content-type"]||"";this.type=Yt.type(e);const r=Yt.params(e);for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(this[n]=r[n]);this.links={};try{t.link&&(this.links=Yt.parseLinks(t.link))}catch(o){}},ae.prototype._setStatusProperties=function(t){const e=Math.trunc(t/100);this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t};const se=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];class pe{constructor(){this._defaults=[]}_setDefaults(t){for(const e of this._defaults)t[e.fn](...e.args)}}for(const je of se)pe.prototype[je]=function(...t){return this._defaults.push({fn:je,args:t}),this};var ue=pe,le={};let ce;"undefined"!=typeof window?ce=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),ce=this):ce=self;const{isObject:fe,mixin:ye,hasOwn:he}=Yt;function de(){}const me=le=le=function(t,e){return"function"==typeof e?new le.Request("GET",t).end(e):1===arguments.length?new le.Request("GET",t):new le.Request(t,e)};le.Request=Ae,me.getXHR=()=>{if(ce.XMLHttpRequest)return new ce.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const ge="".trim?t=>t.trim():t=>t.replace(/(^\s*|\s*$)/g,"");function be(t){if(!fe(t))return t;const e=[];for(const r in t)he(t,r)&&ve(e,r,t[r]);return e.join("&")}function ve(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))for(const o of r)ve(t,e,o);else if(fe(r))for(const o in r)he(r,o)&&ve(t,`${e}[${o}]`,r[o]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function we(t){const e={},r=t.split("&");let o,n;for(let i=0,a=r.length;i{let t,e=null,o=null;try{o=new Se(r)}catch(n){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=n,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",o);try{r._isResponseOK(o)||(t=new Error(o.statusText||o.text||"Unsuccessful HTTP response"))}catch(n){t=n}t?(t.original=e,t.response=o,t.status=t.status||o.status,r.callback(t,o)):r.callback(null,o)})}me.serializeObject=be,me.parseString=we,me.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},me.serialize={"application/x-www-form-urlencoded":t=>Xt(t,{indices:!1,strictNullHandling:!0}),"application/json":r},me.parse={"application/x-www-form-urlencoded":we,"application/json":JSON.parse},ye(Se.prototype,ie.prototype),Se.prototype._parseBody=function(t){let e=me.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&_e(this.type)&&(e=me.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},Se.prototype.toError=function(){const{req:t}=this,{method:e}=t,{url:r}=t,o=`cannot ${e} ${r} (${this.status})`,n=new Error(o);return n.status=this.status,n.method=e,n.url=r,n},me.Response=Se,t(Ae.prototype),ye(Ae.prototype,Zt.prototype),Ae.prototype.type=function(t){return this.set("Content-Type",me.types[t]||t),this},Ae.prototype.accept=function(t){return this.set("Accept",me.types[t]||t),this},Ae.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"==typeof e&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});const o=r.encoder?r.encoder:t=>{if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,o)},Ae.prototype.query=function(t){return"string"!=typeof t&&(t=be(t)),t&&this._query.push(t),this},Ae.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},Ae.prototype._getFormData=function(){return this._formData||(this._formData=new ce.FormData),this._formData},Ae.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();const r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},Ae.prototype.crossDomainError=function(){const t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},Ae.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},Ae.prototype.ca=Ae.prototype.agent,Ae.prototype.buffer=Ae.prototype.ca,Ae.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},Ae.prototype.pipe=Ae.prototype.write,Ae.prototype._isHost=function(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},Ae.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||de,this._finalizeQueryString(),this._end()},Ae.prototype._setUploadTimeout=function(){const t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(()=>{t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},Ae.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const t=this;this.xhr=me.getXHR();const{xhr:e}=this;let r=this._formData||this._data;this._setTimeouts(),e.addEventListener("readystatechange",()=>{const{readyState:r}=e;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4!==r)return;let o;try{o=e.status}catch(n){o=0}if(!o){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")});const o=(e,r)=>{r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",o.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",o.bind(null,"upload"))}catch(n){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(n){return this.callback(n)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){const t=this._header["content-type"];let e=this._serializer||me.serialize[t?t.split(";")[0]:""];!e&&_e(t)&&(e=me.serialize["application/json"]),e&&(r=e(r))}for(const i in this.header)null!==this.header[i]&&he(this.header,i)&&e.setRequestHeader(i,this.header[i]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},me.agent=()=>new ue;for(const je of["GET","POST","OPTIONS","PATCH","PUT","DELETE"])ue.prototype[je.toLowerCase()]=function(t,e){const r=new me.Request(je,t);return this._setDefaults(r),e&&r.end(e),r};function Ee(t,e,r){const o=me("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o}return ue.prototype.del=ue.prototype.delete,me.get=(t,e,r)=>{const o=me("GET",t);return"function"==typeof e&&(r=e,e=null),e&&o.query(e),r&&o.end(r),o},me.head=(t,e,r)=>{const o=me("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&o.query(e),r&&o.end(r),o},me.options=(t,e,r)=>{const o=me("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},me.del=Ee,me.delete=Ee,me.patch=(t,e,r)=>{const o=me("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},me.post=(t,e,r)=>{const o=me("POST",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},me.put=(t,e,r)=>{const o=me("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&o.send(e),r&&o.end(r),o},le})); \ No newline at end of file diff --git a/node_modules/superagent/lib/agent-base.js b/node_modules/superagent/lib/agent-base.js new file mode 100644 index 0000000..b1a5e44 --- /dev/null +++ b/node_modules/superagent/lib/agent-base.js @@ -0,0 +1,25 @@ +"use strict"; + +const defaults = ['use', 'on', 'once', 'set', 'query', 'type', 'accept', 'auth', 'withCredentials', 'sortQuery', 'retry', 'ok', 'redirects', 'timeout', 'buffer', 'serialize', 'parse', 'ca', 'key', 'pfx', 'cert', 'disableTLSCerts']; +class Agent { + constructor() { + this._defaults = []; + } + _setDefaults(request) { + for (const def of this._defaults) { + request[def.fn](...def.args); + } + } +} +for (const fn of defaults) { + // Default setting for all requests from this agent + Agent.prototype[fn] = function (...args) { + this._defaults.push({ + fn, + args + }); + return this; + }; +} +module.exports = Agent; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJkZWZhdWx0cyIsIkFnZW50IiwiY29uc3RydWN0b3IiLCJfZGVmYXVsdHMiLCJfc2V0RGVmYXVsdHMiLCJyZXF1ZXN0IiwiZGVmIiwiZm4iLCJhcmdzIiwicHJvdG90eXBlIiwicHVzaCIsIm1vZHVsZSIsImV4cG9ydHMiXSwic291cmNlcyI6WyIuLi9zcmMvYWdlbnQtYmFzZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBkZWZhdWx0cyA9IFtcbiAgJ3VzZScsXG4gICdvbicsXG4gICdvbmNlJyxcbiAgJ3NldCcsXG4gICdxdWVyeScsXG4gICd0eXBlJyxcbiAgJ2FjY2VwdCcsXG4gICdhdXRoJyxcbiAgJ3dpdGhDcmVkZW50aWFscycsXG4gICdzb3J0UXVlcnknLFxuICAncmV0cnknLFxuICAnb2snLFxuICAncmVkaXJlY3RzJyxcbiAgJ3RpbWVvdXQnLFxuICAnYnVmZmVyJyxcbiAgJ3NlcmlhbGl6ZScsXG4gICdwYXJzZScsXG4gICdjYScsXG4gICdrZXknLFxuICAncGZ4JyxcbiAgJ2NlcnQnLFxuICAnZGlzYWJsZVRMU0NlcnRzJ1xuXVxuXG5jbGFzcyBBZ2VudCB7XG4gIGNvbnN0cnVjdG9yICgpIHtcbiAgICB0aGlzLl9kZWZhdWx0cyA9IFtdO1xuICB9XG5cbiAgX3NldERlZmF1bHRzIChyZXF1ZXN0KSB7XG4gICAgZm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BQUcsQ0FBQ0UsSUFBSSxDQUFDO0lBQzlCO0VBQ0Y7QUFDRjtBQUVBLEtBQUssTUFBTUQsRUFBRSxJQUFJUCxRQUFRLEVBQUU7RUFDekI7RUFDQUMsS0FBSyxDQUFDUSxTQUFTLENBQUNGLEVBQUUsQ0FBQyxHQUFHLFVBQVUsR0FBR0MsSUFBSSxFQUFFO0lBQ3ZDLElBQUksQ0FBQ0wsU0FBUyxDQUFDTyxJQUFJLENBQUM7TUFBRUgsRUFBRTtNQUFFQztJQUFLLENBQUMsQ0FBQztJQUNqQyxPQUFPLElBQUk7RUFDYixDQUFDO0FBQ0g7QUFHQUcsTUFBTSxDQUFDQyxPQUFPLEdBQUdYLEtBQUsiLCJpZ25vcmVMaXN0IjpbXX0= \ No newline at end of file diff --git a/node_modules/superagent/lib/client.js b/node_modules/superagent/lib/client.js new file mode 100644 index 0000000..5349b15 --- /dev/null +++ b/node_modules/superagent/lib/client.js @@ -0,0 +1,949 @@ +"use strict"; + +/** + * Root reference for iframes. + */ + +let root; +if (typeof window !== 'undefined') { + // Browser window + root = window; +} else if (typeof self === 'undefined') { + // Other environments + console.warn('Using browser-only version of superagent in non-browser environment'); + root = void 0; +} else { + // Web Worker + root = self; +} +const Emitter = require('component-emitter'); +const safeStringify = require('fast-safe-stringify'); +const qs = require('qs'); +const RequestBase = require('./request-base'); +const { + isObject, + mixin, + hasOwn +} = require('./utils'); +const ResponseBase = require('./response-base'); +const Agent = require('./agent-base'); + +/** + * Noop. + */ + +function noop() {} + +/** + * Expose `request`. + */ + +module.exports = function (method, url) { + // callback + if (typeof url === 'function') { + return new exports.Request('GET', method).end(url); + } + + // url first + if (arguments.length === 1) { + return new exports.Request('GET', method); + } + return new exports.Request(method, url); +}; +exports = module.exports; +const request = exports; +exports.Request = Request; + +/** + * Determine XHR. + */ + +request.getXHR = () => { + if (root.XMLHttpRequest) { + return new root.XMLHttpRequest(); + } + throw new Error('Browser-only version of superagent could not find XHR'); +}; + +/** + * Removes leading and trailing whitespace, added to support IE. + * + * @param {String} s + * @return {String} + * @api private + */ + +const trim = ''.trim ? s => s.trim() : s => s.replace(/(^\s*|\s*$)/g, ''); + +/** + * Serialize the given `obj`. + * + * @param {Object} obj + * @return {String} + * @api private + */ + +function serialize(object) { + if (!isObject(object)) return object; + const pairs = []; + for (const key in object) { + if (hasOwn(object, key)) pushEncodedKeyValuePair(pairs, key, object[key]); + } + return pairs.join('&'); +} + +/** + * Helps 'serialize' with serializing arrays. + * Mutates the pairs array. + * + * @param {Array} pairs + * @param {String} key + * @param {Mixed} val + */ + +function pushEncodedKeyValuePair(pairs, key, value) { + if (value === undefined) return; + if (value === null) { + pairs.push(encodeURI(key)); + return; + } + if (Array.isArray(value)) { + for (const v of value) { + pushEncodedKeyValuePair(pairs, key, v); + } + } else if (isObject(value)) { + for (const subkey in value) { + if (hasOwn(value, subkey)) pushEncodedKeyValuePair(pairs, `${key}[${subkey}]`, value[subkey]); + } + } else { + pairs.push(encodeURI(key) + '=' + encodeURIComponent(value)); + } +} + +/** + * Expose serialization method. + */ + +request.serializeObject = serialize; + +/** + * Parse the given x-www-form-urlencoded `str`. + * + * @param {String} str + * @return {Object} + * @api private + */ + +function parseString(string_) { + const object = {}; + const pairs = string_.split('&'); + let pair; + let pos; + for (let i = 0, length_ = pairs.length; i < length_; ++i) { + pair = pairs[i]; + pos = pair.indexOf('='); + if (pos === -1) { + object[decodeURIComponent(pair)] = ''; + } else { + object[decodeURIComponent(pair.slice(0, pos))] = decodeURIComponent(pair.slice(pos + 1)); + } + } + return object; +} + +/** + * Expose parser. + */ + +request.parseString = parseString; + +/** + * Default MIME type map. + * + * superagent.types.xml = 'application/xml'; + * + */ + +request.types = { + html: 'text/html', + json: 'application/json', + xml: 'text/xml', + urlencoded: 'application/x-www-form-urlencoded', + form: 'application/x-www-form-urlencoded', + 'form-data': 'application/x-www-form-urlencoded' +}; + +/** + * Default serialization map. + * + * superagent.serialize['application/xml'] = function(obj){ + * return 'generated xml here'; + * }; + * + */ + +request.serialize = { + 'application/x-www-form-urlencoded': obj => { + return qs.stringify(obj, { + indices: false, + strictNullHandling: true + }); + }, + 'application/json': safeStringify +}; + +/** + * Default parsers. + * + * superagent.parse['application/xml'] = function(str){ + * return { object parsed from str }; + * }; + * + */ + +request.parse = { + 'application/x-www-form-urlencoded': parseString, + 'application/json': JSON.parse +}; + +/** + * Parse the given header `str` into + * an object containing the mapped fields. + * + * @param {String} str + * @return {Object} + * @api private + */ + +function parseHeader(string_) { + const lines = string_.split(/\r?\n/); + const fields = {}; + let index; + let line; + let field; + let value; + for (let i = 0, length_ = lines.length; i < length_; ++i) { + line = lines[i]; + index = line.indexOf(':'); + if (index === -1) { + // could be empty line, just skip it + continue; + } + field = line.slice(0, index).toLowerCase(); + value = trim(line.slice(index + 1)); + fields[field] = value; + } + return fields; +} + +/** + * Check if `mime` is json or has +json structured syntax suffix. + * + * @param {String} mime + * @return {Boolean} + * @api private + */ + +function isJSON(mime) { + // should match /json or +json + // but not /json-seq + return /[/+]json($|[^-\w])/i.test(mime); +} + +/** + * Initialize a new `Response` with the given `xhr`. + * + * - set flags (.ok, .error, etc) + * - parse header + * + * Examples: + * + * Aliasing `superagent` as `request` is nice: + * + * request = superagent; + * + * We can use the promise-like API, or pass callbacks: + * + * request.get('/').end(function(res){}); + * request.get('/', function(res){}); + * + * Sending data can be chained: + * + * request + * .post('/user') + * .send({ name: 'tj' }) + * .end(function(res){}); + * + * Or passed to `.send()`: + * + * request + * .post('/user') + * .send({ name: 'tj' }, function(res){}); + * + * Or passed to `.post()`: + * + * request + * .post('/user', { name: 'tj' }) + * .end(function(res){}); + * + * Or further reduced to a single call for simple cases: + * + * request + * .post('/user', { name: 'tj' }, function(res){}); + * + * @param {XMLHTTPRequest} xhr + * @param {Object} options + * @api private + */ + +function Response(request_) { + this.req = request_; + this.xhr = this.req.xhr; + // responseText is accessible only if responseType is '' or 'text' and on older browsers + this.text = this.req.method !== 'HEAD' && (this.xhr.responseType === '' || this.xhr.responseType === 'text') || typeof this.xhr.responseType === 'undefined' ? this.xhr.responseText : null; + this.statusText = this.req.xhr.statusText; + let { + status + } = this.xhr; + // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request + if (status === 1223) { + status = 204; + } + this._setStatusProperties(status); + this.headers = parseHeader(this.xhr.getAllResponseHeaders()); + this.header = this.headers; + // getAllResponseHeaders sometimes falsely returns "" for CORS requests, but + // getResponseHeader still works. so we get content-type even if getting + // other headers fails. + this.header['content-type'] = this.xhr.getResponseHeader('content-type'); + this._setHeaderProperties(this.header); + if (this.text === null && request_._responseType) { + this.body = this.xhr.response; + } else { + this.body = this.req.method === 'HEAD' ? null : this._parseBody(this.text ? this.text : this.xhr.response); + } +} +mixin(Response.prototype, ResponseBase.prototype); + +/** + * Parse the given body `str`. + * + * Used for auto-parsing of bodies. Parsers + * are defined on the `superagent.parse` object. + * + * @param {String} str + * @return {Mixed} + * @api private + */ + +Response.prototype._parseBody = function (string_) { + let parse = request.parse[this.type]; + if (this.req._parser) { + return this.req._parser(this, string_); + } + if (!parse && isJSON(this.type)) { + parse = request.parse['application/json']; + } + return parse && string_ && (string_.length > 0 || string_ instanceof Object) ? parse(string_) : null; +}; + +/** + * Return an `Error` representative of this response. + * + * @return {Error} + * @api public + */ + +Response.prototype.toError = function () { + const { + req + } = this; + const { + method + } = req; + const { + url + } = req; + const message = `cannot ${method} ${url} (${this.status})`; + const error = new Error(message); + error.status = this.status; + error.method = method; + error.url = url; + return error; +}; + +/** + * Expose `Response`. + */ + +request.Response = Response; + +/** + * Initialize a new `Request` with the given `method` and `url`. + * + * @param {String} method + * @param {String} url + * @api public + */ + +function Request(method, url) { + const self = this; + this._query = this._query || []; + this.method = method; + this.url = url; + this.header = {}; // preserves header name case + this._header = {}; // coerces header names to lowercase + this.on('end', () => { + let error = null; + let res = null; + try { + res = new Response(self); + } catch (err) { + error = new Error('Parser is unable to parse the response'); + error.parse = true; + error.original = err; + // issue #675: return the raw response if the response parsing fails + if (self.xhr) { + // ie9 doesn't have 'response' property + error.rawResponse = typeof self.xhr.responseType === 'undefined' ? self.xhr.responseText : self.xhr.response; + // issue #876: return the http status code if the response parsing fails + error.status = self.xhr.status ? self.xhr.status : null; + error.statusCode = error.status; // backwards-compat only + } else { + error.rawResponse = null; + error.status = null; + } + return self.callback(error); + } + self.emit('response', res); + let new_error; + try { + if (!self._isResponseOK(res)) { + new_error = new Error(res.statusText || res.text || 'Unsuccessful HTTP response'); + } + } catch (err) { + new_error = err; // ok() callback can throw + } + + // #1000 don't catch errors from the callback to avoid double calling it + if (new_error) { + new_error.original = error; + new_error.response = res; + new_error.status = new_error.status || res.status; + self.callback(new_error, res); + } else { + self.callback(null, res); + } + }); +} + +/** + * Mixin `Emitter` and `RequestBase`. + */ + +// eslint-disable-next-line new-cap +Emitter(Request.prototype); +mixin(Request.prototype, RequestBase.prototype); + +/** + * Set Content-Type to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.xml = 'application/xml'; + * + * request.post('/') + * .type('xml') + * .send(xmlstring) + * .end(callback); + * + * request.post('/') + * .type('application/xml') + * .send(xmlstring) + * .end(callback); + * + * @param {String} type + * @return {Request} for chaining + * @api public + */ + +Request.prototype.type = function (type) { + this.set('Content-Type', request.types[type] || type); + return this; +}; + +/** + * Set Accept to `type`, mapping values from `request.types`. + * + * Examples: + * + * superagent.types.json = 'application/json'; + * + * request.get('/agent') + * .accept('json') + * .end(callback); + * + * request.get('/agent') + * .accept('application/json') + * .end(callback); + * + * @param {String} accept + * @return {Request} for chaining + * @api public + */ + +Request.prototype.accept = function (type) { + this.set('Accept', request.types[type] || type); + return this; +}; + +/** + * Set Authorization field value with `user` and `pass`. + * + * @param {String} user + * @param {String} [pass] optional in case of using 'bearer' as type + * @param {Object} options with 'type' property 'auto', 'basic' or 'bearer' (default 'basic') + * @return {Request} for chaining + * @api public + */ + +Request.prototype.auth = function (user, pass, options) { + if (arguments.length === 1) pass = ''; + if (typeof pass === 'object' && pass !== null) { + // pass is optional and can be replaced with options + options = pass; + pass = ''; + } + if (!options) { + options = { + type: typeof btoa === 'function' ? 'basic' : 'auto' + }; + } + const encoder = options.encoder ? options.encoder : string => { + if (typeof btoa === 'function') { + return btoa(string); + } + throw new Error('Cannot use basic auth, btoa is not a function'); + }; + return this._auth(user, pass, options, encoder); +}; + +/** + * Add query-string `val`. + * + * Examples: + * + * request.get('/shoes') + * .query('size=10') + * .query({ color: 'blue' }) + * + * @param {Object|String} val + * @return {Request} for chaining + * @api public + */ + +Request.prototype.query = function (value) { + if (typeof value !== 'string') value = serialize(value); + if (value) this._query.push(value); + return this; +}; + +/** + * Queue the given `file` as an attachment to the specified `field`, + * with optional `options` (or filename). + * + * ``` js + * request.post('/upload') + * .attach('content', new Blob(['hey!'], { type: "text/html"})) + * .end(callback); + * ``` + * + * @param {String} field + * @param {Blob|File} file + * @param {String|Object} options + * @return {Request} for chaining + * @api public + */ + +Request.prototype.attach = function (field, file, options) { + if (file) { + if (this._data) { + throw new Error("superagent can't mix .send() and .attach()"); + } + this._getFormData().append(field, file, options || file.name); + } + return this; +}; +Request.prototype._getFormData = function () { + if (!this._formData) { + this._formData = new root.FormData(); + } + return this._formData; +}; + +/** + * Invoke the callback with `err` and `res` + * and handle arity check. + * + * @param {Error} err + * @param {Response} res + * @api private + */ + +Request.prototype.callback = function (error, res) { + if (this._shouldRetry(error, res)) { + return this._retry(); + } + const fn = this._callback; + this.clearTimeout(); + if (error) { + if (this._maxRetries) error.retries = this._retries - 1; + this.emit('error', error); + } + fn(error, res); +}; + +/** + * Invoke callback with x-domain error. + * + * @api private + */ + +Request.prototype.crossDomainError = function () { + const error = new Error('Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'); + error.crossDomain = true; + error.status = this.status; + error.method = this.method; + error.url = this.url; + this.callback(error); +}; + +// This only warns, because the request is still likely to work +Request.prototype.agent = function () { + console.warn('This is not supported in browser version of superagent'); + return this; +}; +Request.prototype.ca = Request.prototype.agent; +Request.prototype.buffer = Request.prototype.ca; + +// This throws, because it can't send/receive data as expected +Request.prototype.write = () => { + throw new Error('Streaming is not supported in browser version of superagent'); +}; +Request.prototype.pipe = Request.prototype.write; + +/** + * Check if `obj` is a host object, + * we don't want to serialize these :) + * + * @param {Object} obj host object + * @return {Boolean} is a host object + * @api private + */ +Request.prototype._isHost = function (object) { + // Native objects stringify to [object File], [object Blob], [object FormData], etc. + return object && typeof object === 'object' && !Array.isArray(object) && Object.prototype.toString.call(object) !== '[object Object]'; +}; + +/** + * Initiate request, invoking callback `fn(res)` + * with an instanceof `Response`. + * + * @param {Function} fn + * @return {Request} for chaining + * @api public + */ + +Request.prototype.end = function (fn) { + if (this._endCalled) { + console.warn('Warning: .end() was called twice. This is not supported in superagent'); + } + this._endCalled = true; + + // store callback + this._callback = fn || noop; + + // querystring + this._finalizeQueryString(); + this._end(); +}; +Request.prototype._setUploadTimeout = function () { + const self = this; + + // upload timeout it's wokrs only if deadline timeout is off + if (this._uploadTimeout && !this._uploadTimeoutTimer) { + this._uploadTimeoutTimer = setTimeout(() => { + self._timeoutError('Upload timeout of ', self._uploadTimeout, 'ETIMEDOUT'); + }, this._uploadTimeout); + } +}; + +// eslint-disable-next-line complexity +Request.prototype._end = function () { + if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called')); + const self = this; + this.xhr = request.getXHR(); + const { + xhr + } = this; + let data = this._formData || this._data; + this._setTimeouts(); + + // state change + xhr.addEventListener('readystatechange', () => { + const { + readyState + } = xhr; + if (readyState >= 2 && self._responseTimeoutTimer) { + clearTimeout(self._responseTimeoutTimer); + } + if (readyState !== 4) { + return; + } + + // In IE9, reads to any property (e.g. status) off of an aborted XHR will + // result in the error "Could not complete the operation due to error c00c023f" + let status; + try { + status = xhr.status; + } catch (err) { + status = 0; + } + if (!status) { + if (self.timedout || self._aborted) return; + return self.crossDomainError(); + } + self.emit('end'); + }); + + // progress + const handleProgress = (direction, e) => { + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; + if (e.percent === 100) { + clearTimeout(self._uploadTimeoutTimer); + } + } + e.direction = direction; + self.emit('progress', e); + }; + if (this.hasListeners('progress')) { + try { + xhr.addEventListener('progress', handleProgress.bind(null, 'download')); + if (xhr.upload) { + xhr.upload.addEventListener('progress', handleProgress.bind(null, 'upload')); + } + } catch (err) { + // Accessing xhr.upload fails in IE from a web worker, so just pretend it doesn't exist. + // Reported here: + // https://connect.microsoft.com/IE/feedback/details/837245/xmlhttprequest-upload-throws-invalid-argument-when-used-from-web-worker-context + } + } + if (xhr.upload) { + this._setUploadTimeout(); + } + + // initiate request + try { + if (this.username && this.password) { + xhr.open(this.method, this.url, true, this.username, this.password); + } else { + xhr.open(this.method, this.url, true); + } + } catch (err) { + // see #1149 + return this.callback(err); + } + + // CORS + if (this._withCredentials) xhr.withCredentials = true; + + // body + if (!this._formData && this.method !== 'GET' && this.method !== 'HEAD' && typeof data !== 'string' && !this._isHost(data)) { + // serialize stuff + const contentType = this._header['content-type']; + let serialize = this._serializer || request.serialize[contentType ? contentType.split(';')[0] : '']; + if (!serialize && isJSON(contentType)) { + serialize = request.serialize['application/json']; + } + if (serialize) data = serialize(data); + } + + // set header fields + for (const field in this.header) { + if (this.header[field] === null) continue; + if (hasOwn(this.header, field)) xhr.setRequestHeader(field, this.header[field]); + } + if (this._responseType) { + xhr.responseType = this._responseType; + } + + // send stuff + this.emit('request', this); + + // IE11 xhr.send(undefined) sends 'undefined' string as POST payload (instead of nothing) + // We need null here if data is undefined + xhr.send(typeof data === 'undefined' ? null : data); +}; +request.agent = () => new Agent(); +for (const method of ['GET', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE']) { + Agent.prototype[method.toLowerCase()] = function (url, fn) { + const request_ = new request.Request(method, url); + this._setDefaults(request_); + if (fn) { + request_.end(fn); + } + return request_; + }; +} +Agent.prototype.del = Agent.prototype.delete; + +/** + * GET `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.get = (url, data, fn) => { + const request_ = request('GET', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; + +/** + * HEAD `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.head = (url, data, fn) => { + const request_ = request('HEAD', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.query(data); + if (fn) request_.end(fn); + return request_; +}; + +/** + * OPTIONS query to `url` with optional callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.options = (url, data, fn) => { + const request_ = request('OPTIONS', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +/** + * DELETE `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +function del(url, data, fn) { + const request_ = request('DELETE', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +} +request.del = del; +request.delete = del; + +/** + * PATCH `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.patch = (url, data, fn) => { + const request_ = request('PATCH', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +/** + * POST `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed} [data] + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.post = (url, data, fn) => { + const request_ = request('POST', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; + +/** + * PUT `url` with optional `data` and callback `fn(res)`. + * + * @param {String} url + * @param {Mixed|Function} [data] or fn + * @param {Function} [fn] + * @return {Request} + * @api public + */ + +request.put = (url, data, fn) => { + const request_ = request('PUT', url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) request_.send(data); + if (fn) request_.end(fn); + return request_; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJyb290Iiwid2luZG93Iiwic2VsZiIsImNvbnNvbGUiLCJ3YXJuIiwiRW1pdHRlciIsInJlcXVpcmUiLCJzYWZlU3RyaW5naWZ5IiwicXMiLCJSZXF1ZXN0QmFzZSIsImlzT2JqZWN0IiwibWl4aW4iLCJoYXNPd24iLCJSZXNwb25zZUJhc2UiLCJBZ2VudCIsIm5vb3AiLCJtb2R1bGUiLCJleHBvcnRzIiwibWV0aG9kIiwidXJsIiwiUmVxdWVzdCIsImVuZCIsImFyZ3VtZW50cyIsImxlbmd0aCIsInJlcXVlc3QiLCJnZXRYSFIiLCJYTUxIdHRwUmVxdWVzdCIsIkVycm9yIiwidHJpbSIsInMiLCJyZXBsYWNlIiwic2VyaWFsaXplIiwib2JqZWN0IiwicGFpcnMiLCJrZXkiLCJwdXNoRW5jb2RlZEtleVZhbHVlUGFpciIsImpvaW4iLCJ2YWx1ZSIsInVuZGVmaW5lZCIsInB1c2giLCJlbmNvZGVVUkkiLCJBcnJheSIsImlzQXJyYXkiLCJ2Iiwic3Via2V5IiwiZW5jb2RlVVJJQ29tcG9uZW50Iiwic2VyaWFsaXplT2JqZWN0IiwicGFyc2VTdHJpbmciLCJzdHJpbmdfIiwic3BsaXQiLCJwYWlyIiwicG9zIiwiaSIsImxlbmd0aF8iLCJpbmRleE9mIiwiZGVjb2RlVVJJQ29tcG9uZW50Iiwic2xpY2UiLCJ0eXBlcyIsImh0bWwiLCJqc29uIiwieG1sIiwidXJsZW5jb2RlZCIsImZvcm0iLCJvYmoiLCJzdHJpbmdpZnkiLCJpbmRpY2VzI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QztFQUM3QixJQUFJekIsRUFBRSxFQUFFMUQsUUFBUSxDQUFDM0QsR0FBRyxDQUFDcUgsRUFBRSxDQUFDO0VBQ3hCLE9BQU8xRCxRQUFRO0FBQ2pCLENBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBeEQsT0FBTyxDQUFDMEssR0FBRyxHQUFHLENBQUMvSyxHQUFHLEVBQUVnSixJQUFJLEVBQUV6QixFQUFFLEtBQUs7RUFDL0IsTUFBTTFELFFBQVEsR0FBR3hELE9BQU8sQ0FBQyxLQUFLLEVBQUVMLEdBQUcsQ0FBQztFQUNwQyxJQUFJLE9BQU9nSixJQUFJLEtBQUssVUFBVSxFQUFFO0lBQzlCekIsRUFBRSxHQUFHeUIsSUFBSTtJQUNUQSxJQUFJLEdBQUcsSUFBSTtFQUNiO0VBRUEsSUFBSUEsSUFBSSxFQUFFbkYsUUFBUSxDQUFDMEcsSUFBSSxDQUFDdkIsSUFBSSxDQUFDO0VBQzdCLElBQUl6QixFQUFFLEVBQUUxRCxRQUFRLENBQUMzRCxHQUFHLENBQUNxSCxFQUFFLENBQUM7RUFDeEIsT0FBTzFELFFBQVE7QUFDakIsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ== \ No newline at end of file diff --git a/node_modules/superagent/lib/node/agent.js b/node_modules/superagent/lib/node/agent.js new file mode 100644 index 0000000..d03ccf8 --- /dev/null +++ b/node_modules/superagent/lib/node/agent.js @@ -0,0 +1,101 @@ +"use strict"; + +/** + * Module dependencies. + */ + +const { + CookieJar +} = require('cookiejar'); +const { + CookieAccessInfo +} = require('cookiejar'); +const methods = require('methods'); +const request = require('../..'); +const AgentBase = require('../agent-base'); + +/** + * Initialize a new `Agent`. + * + * @api public + */ + +class Agent extends AgentBase { + constructor(options) { + super(); + this.jar = new CookieJar(); + if (options) { + if (options.ca) { + this.ca(options.ca); + } + if (options.key) { + this.key(options.key); + } + if (options.pfx) { + this.pfx(options.pfx); + } + if (options.cert) { + this.cert(options.cert); + } + if (options.rejectUnauthorized === false) { + this.disableTLSCerts(); + } + } + } + + /** + * Save the cookies in the given `res` to + * the agent's cookie jar for persistence. + * + * @param {Response} res + * @api private + */ + _saveCookies(res) { + const cookies = res.headers['set-cookie']; + if (cookies) { + var _res$request; + const url = new URL(((_res$request = res.request) === null || _res$request === void 0 ? void 0 : _res$request.url) || ''); + this.jar.setCookies(cookies, url.hostname, url.pathname); + } + } + + /** + * Attach cookies when available to the given `req`. + * + * @param {Request} req + * @api private + */ + _attachCookies(request_) { + const url = new URL(request_.url); + const access = new CookieAccessInfo(url.hostname, url.pathname, url.protocol === 'https:'); + const cookies = this.jar.getCookies(access).toValueString(); + request_.cookies = cookies; + } +} +for (const name of methods) { + const method = name.toUpperCase(); + if (method === "QUERY") continue; + Agent.prototype[name] = function (url, fn) { + const request_ = new request.Request(method, url); + request_.on('response', this._saveCookies.bind(this)); + request_.on('redirect', this._saveCookies.bind(this)); + request_.on('redirect', this._attachCookies.bind(this, request_)); + this._setDefaults(request_); + this._attachCookies(request_); + if (fn) { + request_.end(fn); + } + return request_; + }; +} +Agent.prototype.del = Agent.prototype.delete; + +// create a Proxy that can instantiate a new Agent without using `new` keyword +// (for backward compatibility and chaining) +const proxyAgent = new Proxy(Agent, { + apply(target, thisArg, argumentsList) { + return new target(...argumentsList); + } +}); +module.exports = proxyAgent; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJDb29raWVKYXIiLCJyZXF1aXJlIiwiQ29va2llQWNjZXNzSW5mbyIsIm1ldGhvZHMiLCJyZXF1ZXN0IiwiQWdlbnRCYXNlIiwiQWdlbnQiLCJjb25zdHJ1Y3RvciIsIm9wdGlvbnMiLCJqYXIiLCJjYSIsImtleSIsInBmeCIsImNlcnQiLCJyZWplY3RVbmF1dGhvcml6ZWQiLCJkaXNhYmxlVExTQ2VydHMiLCJfc2F2ZUNvb2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IgPSBuZXcgQ29va2llSmFyKCk7XG5cbiAgICBpZiAob3B0aW9ucykge1xuICAgICAgaWYgKG9wdGlvbnMuY2EpIHtcbiAgICAgICAgdGhpcy5jYShvcHRpb25zLmNhKTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMua2V5KSB7XG4gICAgICAgIHRoaXMua2V5KG9wdGlvbnMua2V5KTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMucGZ4KSB7XG4gICAgICAgIHRoaXMucGZ4KG9wdGlvbnMucGZ4KTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMuY2VydCkge1xuICAgICAgICB0aGlzLmNlcnQob3B0aW9ucy5jZXJ0KTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMucmVqZWN0VW5hdXRob3JpemVkID09PSBmYWxzZSkge1xuICAgICAgICB0aGlzLmRpc2FibGVUTFNDZXJ0cygpO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIC8qKlxuICAgKiBTYXZlIHRoZSBjb29raWVzIGluIHRoZSBnaXZlbiBgcmVzYCB0b1xuICAgKiB0aGUgYWdlbnQncyBjb29raWUgamFyIGZvciBwZXJzaXN0ZW5jZS5cbiAgICpcbiAgICogQHBhcmFtIHtSZXNwb25zZX0gcmVzXG4gICAqIEBhcGkgcHJpdmF0ZVxuICAgKi9cbiAgX3NhdmVDb29raWVzIChyZXMpIHtcbiAgICBjb25zdCBjb29raWVzID0gcmVzLmhlYWRlcnNbJ3NldC1jb29raWUnXTtcbiAgICBpZiAoY29va2llcykge1xuICAgICAgY29uc3QgdXJsID0gbmV3IFVSTChyZXMucmVxdWVzdD8udXJsIHx8ICcnKTtcbiAgICAgIHRoaXMuamFyLnNldENvb2tpZXMoY29va2llcywgdXJsLmhvc3RuYW1lLCB1cmwucGF0aG5hbWUpO1xuICAgIH1cbiAgfVxuXG4gIC8qKlxuICAgKiBBdHRhY2ggY29va2llcyB3aGVuIGF2YWlsYW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ules/superagent/lib/node/decompress.js b/node_modules/superagent/lib/node/decompress.js new file mode 100644 index 0000000..befe06c --- /dev/null +++ b/node_modules/superagent/lib/node/decompress.js @@ -0,0 +1,20 @@ +"use strict"; + +const zlib = require('zlib'); +const utils = require('../utils'); +const { + isGzipOrDeflateEncoding, + isBrotliEncoding +} = utils; +exports.chooseDecompresser = res => { + let decompresser; + if (isGzipOrDeflateEncoding(res)) { + decompresser = zlib.createUnzip(); + } else if (isBrotliEncoding(res)) { + decompresser = zlib.createBrotliDecompress(); + } else { + throw new Error('unknown content-encoding'); + } + return decompresser; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJ6bGliIiwicmVxdWlyZSIsInV0aWxzIiwiaXNHemlwT3JEZWZsYXRlRW5jb2RpbmciLCJpc0Jyb3RsaUVuY29kaW5nIiwiZXhwb3J0cyIsImNob29zZURlY29tcHJlc3NlciIsInJlcyIsImRlY29tcHJlc3NlciIsImNyZWF0ZVVuemlwIiwiY3JlYXRlQnJvdGxpRGVjb21wcmVzcyIsIkVycm9yIl0sInNvdXJjZXMiOlsiLi4vLi4vc3JjL25vZGUvZGVjb21wcmVzcy5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCB6bGliID0gcmVxdWlyZSgnemxpYicpO1xuY29uc3QgdXRpbHMgPSByZXF1aXJlKCcuLi91dGlscycpO1xuY29uc3QgeyBpc0d6aXBPckRlZmxhdGVFbmNvZGluZywgaXNCcm90bGlFbmNvZGluZyB9ID0gdXRpbHM7XG5cbmV4cG9ydHMuY2hvb3NlRGVjb21wcmVzc2VyID0gKHJlcykgPT4ge1xuICBsZXQgZGVjb21wcmVzc2VyO1xuICBpZiAoaXNHemlwT3JEZWZsYXRlRW5jb2RpbmcocmVzKSkge1xuICAgIGRlY29tcHJlc3NlciA9IHpsaWIuY3JlYXRlVW56aXAoKTtcbiAgfSBlbHNlIGlmIChpc0Jyb3RsaUVuY29kaW5nKHJlcykpIHtcbiAgICBkZWNvbXByZXNzZXIgPSB6bGliLmNyZWF0ZUJyb3RsaURlY29tcHJlc3MoKTtcbiAgfSBlbHNlIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoJ3Vua25vd24gY29udGVudC1lbmNvZGluZycpO1xuICB9XG4gIHJldHVybiBkZWNvbXByZXNzZXI7XG59XG4iXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTUEsSUFBSSxHQUFHQyxPQUFPLENBQUMsTUFBTSxDQUFDO0FBQzVCLE1BQU1DLEtBQUssR0FBR0QsT0FBTyxDQUFDLFVBQVUsQ0FBQztBQUNqQyxNQUFNO0VBQUVFLHVCQUF1QjtFQUFFQztBQUFpQixDQUFDLEdBQUdGLEtBQUs7QUFFM0RHLE9BQU8sQ0FBQ0Msa0JBQWtCLEdBQUlDLEdBQUcsSUFBSztFQUNwQyxJQUFJQyxZQUFZO0VBQ2hCLElBQUlMLHVCQUF1QixDQUFDSSxHQUFHLENBQUMsRUFBRTtJQUNoQ0MsWUFBWSxHQUFHUixJQUFJLENBQUNTLFdBQVcsQ0FBQyxDQUFDO0VBQ25DLENBQUMsTUFBTSxJQUFJTCxnQkFBZ0IsQ0FBQ0csR0FBRyxDQUFDLEVBQUU7SUFDaENDLFlBQVksR0FBR1IsSUFBSSxDQUFDVSxzQkFBc0IsQ0FBQyxDQUFDO0VBQzlDLENBQUMsTUFBTTtJQUNMLE1BQU0sSUFBSUMsS0FBSyxDQUFDLDBCQUEwQixDQUFDO0VBQzdDO0VBQ0EsT0FBT0gsWUFBWTtBQUNyQixDQUFDIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/superagent/lib/node/http2wrapper.js b/node_modules/superagent/lib/node/http2wrapper.js new file mode 100644 index 0000000..9ba0955 --- /dev/null +++ b/node_modules/superagent/lib/node/http2wrapper.js @@ -0,0 +1,158 @@ +"use strict"; + +const http2 = require('http2'); +const Stream = require('stream'); +const net = require('net'); +const tls = require('tls'); +const { + HTTP2_HEADER_PATH, + HTTP2_HEADER_STATUS, + HTTP2_HEADER_METHOD, + HTTP2_HEADER_AUTHORITY, + HTTP2_HEADER_HOST, + HTTP2_HEADER_SET_COOKIE, + NGHTTP2_CANCEL +} = http2.constants; +function setProtocol(protocol) { + return { + request(options) { + return new Request(protocol, options); + } + }; +} +function normalizeIpv6Host(host) { + return net.isIP(host) === 6 ? `[${host}]` : host; +} +class Request extends Stream { + constructor(protocol, options) { + super(); + const defaultPort = protocol === 'https:' ? 443 : 80; + const defaultHost = 'localhost'; + const port = options.port || defaultPort; + const host = options.host || defaultHost; + delete options.port; + delete options.host; + this.method = options.method; + this.path = options.path; + this.protocol = protocol; + this.host = host; + delete options.method; + delete options.path; + const sessionOptions = { + ...options + }; + if (options.socketPath) { + sessionOptions.socketPath = options.socketPath; + sessionOptions.createConnection = this.createUnixConnection.bind(this); + } + this._headers = {}; + const normalizedHost = normalizeIpv6Host(host); + const session = http2.connect(`${protocol}//${normalizedHost}:${port}`, sessionOptions); + this.setHeader('host', `${normalizedHost}:${port}`); + session.on('error', error => this.emit('error', error)); + this.session = session; + } + createUnixConnection(authority, options) { + switch (this.protocol) { + case 'http:': + return net.connect(options.socketPath); + case 'https:': + options.ALPNProtocols = ['h2']; + options.servername = this.host; + options.allowHalfOpen = true; + return tls.connect(options.socketPath, options); + default: + throw new Error('Unsupported protocol', this.protocol); + } + } + setNoDelay(bool) { + // We can not use setNoDelay with HTTP/2. + // Node 10 limits http2session.socket methods to ones safe to use with HTTP/2. + // See also https://nodejs.org/api/http2.html#http2_http2session_socket + } + getFrame() { + if (this.frame) { + return this.frame; + } + const method = { + [HTTP2_HEADER_PATH]: this.path, + [HTTP2_HEADER_METHOD]: this.method + }; + let headers = this.mapToHttp2Header(this._headers); + headers = Object.assign(headers, method); + const frame = this.session.request(headers); + frame.once('response', (headers, flags) => { + headers = this.mapToHttpHeader(headers); + frame.headers = headers; + frame.statusCode = headers[HTTP2_HEADER_STATUS]; + frame.status = frame.statusCode; + this.emit('response', frame); + }); + this._headerSent = true; + frame.once('drain', () => this.emit('drain')); + frame.on('error', error => this.emit('error', error)); + frame.on('close', () => this.session.close()); + this.frame = frame; + return frame; + } + mapToHttpHeader(headers) { + const keys = Object.keys(headers); + const http2Headers = {}; + for (let key of keys) { + let value = headers[key]; + key = key.toLowerCase(); + switch (key) { + case HTTP2_HEADER_SET_COOKIE: + value = Array.isArray(value) ? value : [value]; + break; + default: + break; + } + http2Headers[key] = value; + } + return http2Headers; + } + mapToHttp2Header(headers) { + const keys = Object.keys(headers); + const http2Headers = {}; + for (let key of keys) { + let value = headers[key]; + key = key.toLowerCase(); + switch (key) { + case HTTP2_HEADER_HOST: + key = HTTP2_HEADER_AUTHORITY; + value = /^http:\/\/|^https:\/\//.test(value) ? new URL(value).host : value; + break; + default: + break; + } + http2Headers[key] = value; + } + return http2Headers; + } + setHeader(name, value) { + this._headers[name.toLowerCase()] = value; + } + getHeader(name) { + return this._headers[name.toLowerCase()]; + } + write(data, encoding) { + const frame = this.getFrame(); + return frame.write(data, encoding); + } + pipe(stream, options) { + const frame = this.getFrame(); + return frame.pipe(stream, options); + } + end(data) { + const frame = this.getFrame(); + frame.end(data); + } + abort(data) { + const frame = this.getFrame(); + frame.close(NGHTTP2_CANCEL); + this.session.destroy(); + } +} +exports.setProtocol = setProtocol; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJodHRwMiIsInJlcXVpcmUiLCJTdHJlYW0iLCJuZXQiLCJ0bHMiLCJIVFRQMl9IRUFERVJfUEFUSCIsIkhUVFAyX0hFQURFUl9TVEFUVVMiLCJIVFRQMl9IRUFERVJfTUVUSE9EIiwiSFRUUDJfSEVBREVSX0FVVEhPUklUWSIsIkhUVFAyX0hFQURFUl9IT1NUIiwiSFRUUDJfSEVBREVSX1NFVF9DT09LSUUiLCJOR0hUVFAyX0NBTkNFTCIsImNvbnN0YW50cyIsInNldFByb3RvY29sIiwicH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FBQztJQUM3QkMsS0FBSyxDQUFDNEIsR0FBRyxDQUFDSixJQUFJLENBQUM7RUFDakI7RUFFQUssS0FBS0EsQ0FBQ0wsSUFBSSxFQUFFO0lBQ1YsTUFBTXhCLEtBQUssR0FBRyxJQUFJLENBQUNELFFBQVEsQ0FBQyxDQUFDO0lBQzdCQyxLQUFLLENBQUNXLEtBQUssQ0FBQ2hELGNBQWMsQ0FBQztJQUMzQixJQUFJLENBQUN1QixPQUFPLENBQUM0QyxPQUFPLENBQUMsQ0FBQztFQUN4QjtBQUNGO0FBRUFDLE9BQU8sQ0FBQ2xFLFdBQVcsR0FBR0EsV0FBVyIsImlnbm9yZUxpc3QiOltdfQ== \ No newline at end of file diff --git a/node_modules/superagent/lib/node/index.js b/node_modules/superagent/lib/node/index.js new file mode 100644 index 0000000..f12ccfd --- /dev/null +++ b/node_modules/superagent/lib/node/index.js @@ -0,0 +1,1332 @@ +"use strict"; + +/** + * Module dependencies. + */ + +const { + format +} = require('url'); +const Stream = require('stream'); +const https = require('https'); +const http = require('http'); +const fs = require('fs'); +const zlib = require('zlib'); +const util = require('util'); +const qs = require('qs'); +const mime = require('mime'); +let methods = require('methods'); +const FormData = require('form-data'); +const formidable = require('formidable'); +const debug = require('debug')('superagent'); +const CookieJar = require('cookiejar'); +const safeStringify = require('fast-safe-stringify'); +const utils = require('../utils'); +const RequestBase = require('../request-base'); +const http2 = require('./http2wrapper'); +const { + decompress +} = require('./unzip'); +const Response = require('./response'); +const { + mixin, + hasOwn, + isBrotliEncoding, + isGzipOrDeflateEncoding +} = utils; +const { + chooseDecompresser +} = require('./decompress'); +function request(method, url) { + // callback + if (typeof url === 'function') { + return new exports.Request('GET', method).end(url); + } + + // url first + if (arguments.length === 1) { + return new exports.Request('GET', method); + } + return new exports.Request(method, url); +} +module.exports = request; +exports = module.exports; + +/** + * Expose `Request`. + */ + +exports.Request = Request; + +/** + * Expose the agent function + */ + +exports.agent = require('./agent'); + +/** + * Noop. + */ + +function noop() {} + +/** + * Expose `Response`. + */ + +exports.Response = Response; + +/** + * Define "form" mime type. + */ + +mime.define({ + 'application/x-www-form-urlencoded': ['form', 'urlencoded', 'form-data'] +}, true); + +/** + * Protocol map. + */ + +exports.protocols = { + 'http:': http, + 'https:': https, + 'http2:': http2 +}; + +/** + * Default serialization map. + * + * superagent.serialize['application/xml'] = function(obj){ + * return 'generated xml here'; + * }; + * + */ + +exports.serialize = { + 'application/x-www-form-urlencoded': obj => { + return qs.stringify(obj, { + indices: false, + strictNullHandling: true + }); + }, + 'application/json': safeStringify +}; + +/** + * Default parsers. + * + * superagent.parse['application/xml'] = function(res, fn){ + * fn(null, res); + * }; + * + */ + +exports.parse = require('./parsers'); + +/** + * Default buffering map. Can be used to set certain + * response types to buffer/not buffer. + * + * superagent.buffer['application/xml'] = true; + */ +exports.buffer = {}; + +/** + * Initialize internal header tracking properties on a request instance. + * + * @param {Object} req the instance + * @api private + */ +function _initHeaders(request_) { + request_._header = { + // coerces header names to lowercase + }; + request_.header = { + // preserves header name case + }; +} + +/** + * Initialize a new `Request` with the given `method` and `url`. + * + * @param {String} method + * @param {String|Object} url + * @api public + */ + +function Request(method, url) { + Stream.call(this); + if (typeof url !== 'string') url = format(url); + this._enableHttp2 = Boolean(process.env.HTTP2_TEST); // internal only + this._agent = false; + this._formData = null; + this.method = method; + this.url = url; + _initHeaders(this); + this.writable = true; + this._redirects = 0; + this.redirects(method === 'HEAD' ? 0 : 5); + this.cookies = ''; + this.qs = {}; + this._query = []; + this.qsRaw = this._query; // Unused, for backwards compatibility only + this._redirectList = []; + this._streamRequest = false; + this._lookup = undefined; + this.once('end', this.clearTimeout.bind(this)); +} + +/** + * Inherit from `Stream` (which inherits from `EventEmitter`). + * Mixin `RequestBase`. + */ +util.inherits(Request, Stream); +mixin(Request.prototype, RequestBase.prototype); + +/** + * Enable or Disable http2. + * + * Enable http2. + * + * ``` js + * request.get('http://localhost/') + * .http2() + * .end(callback); + * + * request.get('http://localhost/') + * .http2(true) + * .end(callback); + * ``` + * + * Disable http2. + * + * ``` js + * request = request.http2(); + * request.get('http://localhost/') + * .http2(false) + * .end(callback); + * ``` + * + * @param {Boolean} enable + * @return {Request} for chaining + * @api public + */ + +Request.prototype.http2 = function (bool) { + if (exports.protocols['http2:'] === undefined) { + throw new Error('superagent: this version of Node.js does not support http2'); + } + this._enableHttp2 = bool === undefined ? true : bool; + return this; +}; + +/** + * Queue the given `file` as an attachment to the specified `field`, + * with optional `options` (or filename). + * + * ``` js + * request.post('http://localhost/upload') + * .attach('field', Buffer.from('Hello world'), 'hello.html') + * .end(callback); + * ``` + * + * A filename may also be used: + * + * ``` js + * request.post('http://localhost/upload') + * .attach('files', 'image.jpg') + * .end(callback); + * ``` + * + * @param {String} field + * @param {String|fs.ReadStream|Buffer} file + * @param {String|Object} options + * @return {Request} for chaining + * @api public + */ + +Request.prototype.attach = function (field, file, options) { + if (file) { + if (this._data) { + throw new Error("superagent can't mix .send() and .attach()"); + } + let o = options || {}; + if (typeof options === 'string') { + o = { + filename: options + }; + } + if (typeof file === 'string') { + if (!o.filename) o.filename = file; + debug('creating `fs.ReadStream` instance for file: %s', file); + file = fs.createReadStream(file); + file.on('error', error => { + const formData = this._getFormData(); + formData.emit('error', error); + }); + } else if (!o.filename && file.path) { + o.filename = file.path; + } + this._getFormData().append(field, file, o); + } + return this; +}; +Request.prototype._getFormData = function () { + if (!this._formData) { + this._formData = new FormData(); + this._formData.on('error', error => { + debug('FormData error', error); + if (this.called) { + // The request has already finished and the callback was called. + // Silently ignore the error. + return; + } + this.callback(error); + this.abort(); + }); + } + return this._formData; +}; + +/** + * Gets/sets the `Agent` to use for this HTTP request. The default (if this + * function is not called) is to opt out of connection pooling (`agent: false`). + * + * @param {http.Agent} agent + * @return {http.Agent} + * @api public + */ + +Request.prototype.agent = function (agent) { + if (arguments.length === 0) return this._agent; + this._agent = agent; + return this; +}; + +/** + * Gets/sets the `lookup` function to use custom DNS resolver. + * + * @param {Function} lookup + * @return {Function} + * @api public + */ + +Request.prototype.lookup = function (lookup) { + if (arguments.length === 0) return this._lookup; + this._lookup = lookup; + return this; +}; + +/** + * Set _Content-Type_ response header passed through `mime.getType()`. + * + * Examples: + * + * request.post('/') + * .type('xml') + * .send(xmlstring) + * .end(callback); + * + * request.post('/') + * .type('json') + * .send(jsonstring) + * .end(callback); + * + * request.post('/') + * .type('application/json') + * .send(jsonstring) + * .end(callback); + * + * @param {String} type + * @return {Request} for chaining + * @api public + */ + +Request.prototype.type = function (type) { + return this.set('Content-Type', type.includes('/') ? type : mime.getType(type)); +}; + +/** + * Set _Accept_ response header passed through `mime.getType()`. + * + * Examples: + * + * superagent.types.json = 'application/json'; + * + * request.get('/agent') + * .accept('json') + * .end(callback); + * + * request.get('/agent') + * .accept('application/json') + * .end(callback); + * + * @param {String} accept + * @return {Request} for chaining + * @api public + */ + +Request.prototype.accept = function (type) { + return this.set('Accept', type.includes('/') ? type : mime.getType(type)); +}; + +/** + * Add query-string `val`. + * + * Examples: + * + * request.get('/shoes') + * .query('size=10') + * .query({ color: 'blue' }) + * + * @param {Object|String} val + * @return {Request} for chaining + * @api public + */ + +Request.prototype.query = function (value) { + if (typeof value === 'string') { + this._query.push(value); + } else { + Object.assign(this.qs, value); + } + return this; +}; + +/** + * Write raw `data` / `encoding` to the socket. + * + * @param {Buffer|String} data + * @param {String} encoding + * @return {Boolean} + * @api public + */ + +Request.prototype.write = function (data, encoding) { + const request_ = this.request(); + if (!this._streamRequest) { + this._streamRequest = true; + } + return request_.write(data, encoding); +}; + +/** + * Pipe the request body to `stream`. + * + * @param {Stream} stream + * @param {Object} options + * @return {Stream} + * @api public + */ + +Request.prototype.pipe = function (stream, options) { + this.piped = true; // HACK... + this.buffer(false); + this.end(); + return this._pipeContinue(stream, options); +}; +Request.prototype._pipeContinue = function (stream, options) { + this.req.once('response', res => { + // redirect + if (isRedirect(res.statusCode) && this._redirects++ !== this._maxRedirects) { + return this._redirect(res) === this ? this._pipeContinue(stream, options) : undefined; + } + this.res = res; + this._emitResponse(); + if (this._aborted) return; + if (this._shouldDecompress(res)) { + let decompresser = chooseDecompresser(res); + decompresser.on('error', error => { + if (error && error.code === 'Z_BUF_ERROR') { + // unexpected end of file is ignored by browsers and curl + stream.emit('end'); + return; + } + stream.emit('error', error); + }); + res.pipe(decompresser).pipe(stream, options); + // don't emit 'end' until decompresser has completed writing all its data. + decompresser.once('end', () => this.emit('end')); + } else { + res.pipe(stream, options); + res.once('end', () => this.emit('end')); + } + }); + return stream; +}; + +/** + * Enable / disable buffering. + * + * @return {Boolean} [val] + * @return {Request} for chaining + * @api public + */ + +Request.prototype.buffer = function (value) { + this._buffer = value !== false; + return this; +}; + +/** + * Redirect to `url + * + * @param {IncomingMessage} res + * @return {Request} for chaining + * @api private + */ + +Request.prototype._redirect = function (res) { + let url = res.headers.location; + if (!url) { + return this.callback(new Error('No location header for redirect'), res); + } + debug('redirect %s -> %s', this.url, url); + + // location + url = new URL(url, this.url).href; + + // ensure the response is being consumed + // this is required for Node v0.10+ + res.resume(); + let headers = this.req.getHeaders ? this.req.getHeaders() : this.req._headers; + const changesOrigin = new URL(url).host !== new URL(this.url).host; + + // implementation of 302 following defacto standard + if (res.statusCode === 301 || res.statusCode === 302) { + // strip Content-* related fields + // in case of POST etc + headers = utils.cleanHeader(headers, changesOrigin); + + // force GET + this.method = this.method === 'HEAD' ? 'HEAD' : 'GET'; + + // clear data + this._data = null; + } + + // 303 is always GET + if (res.statusCode === 303) { + // strip Content-* related fields + // in case of POST etc + headers = utils.cleanHeader(headers, changesOrigin); + + // force method + this.method = 'GET'; + + // clear data + this._data = null; + } + + // 307 preserves method + // 308 preserves method + delete headers.host; + delete this.req; + delete this._formData; + + // remove all add header except User-Agent + _initHeaders(this); + + // redirect + this.res = res; + this._endCalled = false; + this.url = url; + this.qs = {}; + this._query.length = 0; + this.set(headers); + this._emitRedirect(); + this._redirectList.push(this.url); + this.end(this._callback); + return this; +}; + +/** + * Set Authorization field value with `user` and `pass`. + * + * Examples: + * + * .auth('tobi', 'learnboost') + * .auth('tobi:learnboost') + * .auth('tobi') + * .auth(accessToken, { type: 'bearer' }) + * + * @param {String} user + * @param {String} [pass] + * @param {Object} [options] options with authorization type 'basic' or 'bearer' ('basic' is default) + * @return {Request} for chaining + * @api public + */ + +Request.prototype.auth = function (user, pass, options) { + if (arguments.length === 1) pass = ''; + if (typeof pass === 'object' && pass !== null) { + // pass is optional and can be replaced with options + options = pass; + pass = ''; + } + if (!options) { + options = { + type: 'basic' + }; + } + const encoder = string => Buffer.from(string).toString('base64'); + return this._auth(user, pass, options, encoder); +}; + +/** + * Set the certificate authority option for https request. + * + * @param {Buffer | Array} cert + * @return {Request} for chaining + * @api public + */ + +Request.prototype.ca = function (cert) { + this._ca = cert; + return this; +}; + +/** + * Set the client certificate key option for https request. + * + * @param {Buffer | String} cert + * @return {Request} for chaining + * @api public + */ + +Request.prototype.key = function (cert) { + this._key = cert; + return this; +}; + +/** + * Set the key, certificate, and CA certs of the client in PFX or PKCS12 format. + * + * @param {Buffer | String} cert + * @return {Request} for chaining + * @api public + */ + +Request.prototype.pfx = function (cert) { + if (typeof cert === 'object' && !Buffer.isBuffer(cert)) { + this._pfx = cert.pfx; + this._passphrase = cert.passphrase; + } else { + this._pfx = cert; + } + return this; +}; + +/** + * Set the client certificate option for https request. + * + * @param {Buffer | String} cert + * @return {Request} for chaining + * @api public + */ + +Request.prototype.cert = function (cert) { + this._cert = cert; + return this; +}; + +/** + * Do not reject expired or invalid TLS certs. + * sets `rejectUnauthorized=true`. Be warned that this allows MITM attacks. + * + * @return {Request} for chaining + * @api public + */ + +Request.prototype.disableTLSCerts = function () { + this._disableTLSCerts = true; + return this; +}; + +/** + * Return an http[s] request. + * + * @return {OutgoingMessage} + * @api private + */ + +// eslint-disable-next-line complexity +Request.prototype.request = function () { + if (this.req) return this.req; + const options = {}; + try { + const query = qs.stringify(this.qs, { + indices: false, + strictNullHandling: true + }); + if (query) { + this.qs = {}; + this._query.push(query); + } + this._finalizeQueryString(); + } catch (err) { + return this.emit('error', err); + } + let { + url: urlString + } = this; + const retries = this._retries; + + // default to http:// + if (urlString.indexOf('http') !== 0) urlString = `http://${urlString}`; + const url = new URL(urlString); + let { + protocol + } = url; + let path = `${url.pathname}${url.search}`; + + // support unix sockets + if (/^https?\+unix:/.test(protocol) === true) { + // get the protocol + protocol = `${protocol.split('+')[0]}:`; + + // get the socket path + options.socketPath = url.hostname.replace(/%2F/g, '/'); + url.host = ''; + url.hostname = ''; + } + + // Override IP address of a hostname + if (this._connectOverride) { + const { + hostname + } = url; + const match = hostname in this._connectOverride ? this._connectOverride[hostname] : this._connectOverride['*']; + if (match) { + // backup the real host + if (!this._header.host) { + this.set('host', url.host); + } + let newHost; + let newPort; + if (typeof match === 'object') { + newHost = match.host; + newPort = match.port; + } else { + newHost = match; + newPort = url.port; + } + + // wrap [ipv6] + url.host = /:/.test(newHost) ? `[${newHost}]` : newHost; + if (newPort) { + url.host += `:${newPort}`; + url.port = newPort; + } + url.hostname = newHost; + } + } + + // options + options.method = this.method; + options.port = url.port; + options.path = path; + options.host = utils.normalizeHostname(url.hostname); // ex: [::1] -> ::1 + options.ca = this._ca; + options.key = this._key; + options.pfx = this._pfx; + options.cert = this._cert; + options.passphrase = this._passphrase; + options.agent = this._agent; + options.lookup = this._lookup; + options.rejectUnauthorized = typeof this._disableTLSCerts === 'boolean' ? !this._disableTLSCerts : process.env.NODE_TLS_REJECT_UNAUTHORIZED !== '0'; + + // Allows request.get('https://1.2.3.4/').set('Host', 'example.com') + if (this._header.host) { + options.servername = this._header.host.replace(/:\d+$/, ''); + } + if (this._trustLocalhost && /^(?:localhost|127\.0\.0\.\d+|(0*:)+:0*1)$/.test(url.hostname)) { + options.rejectUnauthorized = false; + } + + // initiate request + const module_ = this._enableHttp2 ? exports.protocols['http2:'].setProtocol(protocol) : exports.protocols[protocol]; + + // request + this.req = module_.request(options); + const { + req + } = this; + + // set tcp no delay + req.setNoDelay(true); + if (options.method !== 'HEAD') { + req.setHeader('Accept-Encoding', 'gzip, deflate'); + } + this.protocol = protocol; + this.host = url.host; + + // expose events + req.once('drain', () => { + this.emit('drain'); + }); + req.on('error', error => { + // flag abortion here for out timeouts + // because node will emit a faux-error "socket hang up" + // when request is aborted before a connection is made + if (this._aborted) return; + // if not the same, we are in the **old** (cancelled) request, + // so need to continue (same as for above) + if (this._retries !== retries) return; + // if we've received a response then we don't want to let + // an error in the request blow up the response + if (this.response) return; + this.callback(error); + }); + + // auth + if (url.username || url.password) { + this.auth(url.username, url.password); + } + if (this.username && this.password) { + this.auth(this.username, this.password); + } + for (const key in this.header) { + if (hasOwn(this.header, key)) req.setHeader(key, this.header[key]); + } + + // add cookies + if (this.cookies) { + if (hasOwn(this._header, 'cookie')) { + // merge + const temporaryJar = new CookieJar.CookieJar(); + temporaryJar.setCookies(this._header.cookie.split('; ')); + temporaryJar.setCookies(this.cookies.split('; ')); + req.setHeader('Cookie', temporaryJar.getCookies(CookieJar.CookieAccessInfo.All).toValueString()); + } else { + req.setHeader('Cookie', this.cookies); + } + } + return req; +}; + +/** + * Invoke the callback with `err` and `res` + * and handle arity check. + * + * @param {Error} err + * @param {Response} res + * @api private + */ + +Request.prototype.callback = function (error, res) { + if (this._shouldRetry(error, res)) { + return this._retry(); + } + + // Avoid the error which is emitted from 'socket hang up' to cause the fn undefined error on JS runtime. + const fn = this._callback || noop; + this.clearTimeout(); + if (this.called) return console.warn('superagent: double callback bug'); + this.called = true; + if (!error) { + try { + if (!this._isResponseOK(res)) { + let message = 'Unsuccessful HTTP response'; + if (res) { + message = http.STATUS_CODES[res.status] || message; + } + error = new Error(message); + error.status = res ? res.status : undefined; + } + } catch (err) { + error = err; + error.status = error.status || (res ? res.status : undefined); + } + } + + // It's important that the callback is called outside try/catch + // to avoid double callback + if (!error) { + return fn(null, res); + } + error.response = res; + if (this._maxRetries) error.retries = this._retries - 1; + + // only emit error event if there is a listener + // otherwise we assume the callback to `.end()` will get the error + if (error && this.listeners('error').length > 0) { + this.emit('error', error); + } + fn(error, res); +}; + +/** + * Check if `obj` is a host object, + * + * @param {Object} obj host object + * @return {Boolean} is a host object + * @api private + */ +Request.prototype._isHost = function (object) { + return Buffer.isBuffer(object) || object instanceof Stream || object instanceof FormData; +}; + +/** + * Initiate request, invoking callback `fn(err, res)` + * with an instanceof `Response`. + * + * @param {Function} fn + * @return {Request} for chaining + * @api public + */ + +Request.prototype._emitResponse = function (body, files) { + const response = new Response(this); + this.response = response; + response.redirects = this._redirectList; + if (undefined !== body) { + response.body = body; + } + response.files = files; + if (this._endCalled) { + response.pipe = function () { + throw new Error("end() has already been called, so it's too late to start piping"); + }; + } + this.emit('response', response); + return response; +}; + +/** + * Emit `redirect` event, passing an instanceof `Response`. + * + * @api private + */ + +Request.prototype._emitRedirect = function () { + const response = new Response(this); + response.redirects = this._redirectList; + this.emit('redirect', response); +}; +Request.prototype.end = function (fn) { + this.request(); + debug('%s %s', this.method, this.url); + if (this._endCalled) { + throw new Error('.end() was called twice. This is not supported in superagent'); + } + this._endCalled = true; + + // store callback + this._callback = fn || noop; + this._end(); +}; +Request.prototype._end = function () { + if (this._aborted) return this.callback(new Error('The request has been aborted even before .end() was called')); + let data = this._data; + const { + req + } = this; + const { + method + } = this; + this._setTimeouts(); + + // body + if (method !== 'HEAD' && !req._headerSent) { + // serialize stuff + if (typeof data !== 'string') { + let contentType = req.getHeader('Content-Type'); + // Parse out just the content type from the header (ignore the charset) + if (contentType) contentType = contentType.split(';')[0]; + let serialize = this._serializer || exports.serialize[contentType]; + if (!serialize && isJSON(contentType)) { + serialize = exports.serialize['application/json']; + } + if (serialize) data = serialize(data); + } + + // content-length + if (data && !req.getHeader('Content-Length')) { + req.setHeader('Content-Length', Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data)); + } + } + + // response + // eslint-disable-next-line complexity + req.once('response', res => { + debug('%s %s -> %s', this.method, this.url, res.statusCode); + if (this._responseTimeoutTimer) { + clearTimeout(this._responseTimeoutTimer); + } + if (this.piped) { + return; + } + const max = this._maxRedirects; + const mime = utils.type(res.headers['content-type'] || '') || 'text/plain'; + let type = mime.split('/')[0]; + if (type) type = type.toLowerCase().trim(); + const multipart = type === 'multipart'; + const redirect = isRedirect(res.statusCode); + const responseType = this._responseType; + this.res = res; + + // redirect + if (redirect && this._redirects++ !== max) { + return this._redirect(res); + } + if (this.method === 'HEAD') { + this.emit('end'); + this.callback(null, this._emitResponse()); + return; + } + + // zlib support + if (this._shouldDecompress(res)) { + decompress(req, res); + } + let buffer = this._buffer; + if (buffer === undefined && mime in exports.buffer) { + buffer = Boolean(exports.buffer[mime]); + } + let parser = this._parser; + if (undefined === buffer && parser) { + console.warn("A custom superagent parser has been set, but buffering strategy for the parser hasn't been configured. Call `req.buffer(true or false)` or set `superagent.buffer[mime] = true or false`"); + buffer = true; + } + if (!parser) { + if (responseType) { + parser = exports.parse.image; // It's actually a generic Buffer + buffer = true; + } else if (multipart) { + const form = formidable.formidable(); + parser = (res, callback) => { + // Create a PassThrough stream that acts as a proper HTTP request + const bridgeStream = new Stream.PassThrough(); + + // Add HTTP request properties from the current request context + bridgeStream.method = this.method || 'POST'; + bridgeStream.url = this.url || '/'; + bridgeStream.httpVersion = res.httpVersion || '1.1'; + bridgeStream.headers = res.headers || {}; + bridgeStream.socket = res.socket || { + readable: true + }; + + // Pipe the response data through the bridge stream + res.pipe(bridgeStream); + form.parse(bridgeStream, (err, fields, files) => { + if (err) return callback(err); + + // Formidable v3 always returns arrays, but SuperAgent expects single values + // Flatten single-item arrays to maintain backward compatibility + const flattenedFields = {}; + if (fields) { + for (const key in fields) { + const value = fields[key]; + flattenedFields[key] = Array.isArray(value) && value.length === 1 ? value[0] : value; + } + } + const flattenedFiles = {}; + if (files) { + for (const key in files) { + const value = files[key]; + flattenedFiles[key] = Array.isArray(value) && value.length === 1 ? value[0] : value; + } + } + + // Return flattened fields as the object parameter to match SuperAgent's expected format + callback(null, flattenedFields, flattenedFiles); + }); + }; + buffer = true; + } else if (isBinary(mime)) { + parser = exports.parse.image; + buffer = true; // For backwards-compatibility buffering default is ad-hoc MIME-dependent + } else if (exports.parse[mime]) { + parser = exports.parse[mime]; + } else if (type === 'text') { + parser = exports.parse.text; + buffer = buffer !== false; + // everyone wants their own white-labeled json + } else if (isJSON(mime)) { + parser = exports.parse['application/json']; + buffer = buffer !== false; + } else if (buffer) { + parser = exports.parse.text; + } else if (undefined === buffer) { + parser = exports.parse.image; // It's actually a generic Buffer + buffer = true; + } + } + + // by default only buffer text/*, json and messed up thing from hell + if (undefined === buffer && isText(mime) || isJSON(mime)) { + buffer = true; + } + this._resBuffered = buffer; + let parserHandlesEnd = false; + if (buffer) { + // Protectiona against zip bombs and other nuisance + let responseBytesLeft = this._maxResponseSize || 200000000; + res.on('data', buf => { + responseBytesLeft -= buf.byteLength || buf.length > 0 ? buf.length : 0; + if (responseBytesLeft < 0) { + // This will propagate through error event + const error = new Error('Maximum response size reached'); + error.code = 'ETOOLARGE'; + // Parsers aren't required to observe error event, + // so would incorrectly report success + parserHandlesEnd = false; + // Will not emit error event + res.destroy(error); + // so we do callback now + this.callback(error, null); + } + }); + } + if (parser) { + try { + // Unbuffered parsers are supposed to emit response early, + // which is weird BTW, because response.body won't be there. + parserHandlesEnd = buffer; + parser(res, (error, object, files) => { + if (this.timedout) { + // Timeout has already handled all callbacks + return; + } + + // Intentional (non-timeout) abort is supposed to preserve partial response, + // even if it doesn't parse. + if (error && !this._aborted) { + return this.callback(error); + } + if (parserHandlesEnd) { + this.emit('end'); + this.callback(null, this._emitResponse(object, files)); + } + }); + } catch (err) { + this.callback(err); + return; + } + } + this.res = res; + + // unbuffered + if (!buffer) { + debug('unbuffered %s %s', this.method, this.url); + this.callback(null, this._emitResponse()); + if (multipart) return; // allow multipart to handle end event + res.once('end', () => { + debug('end %s %s', this.method, this.url); + this.emit('end'); + }); + return; + } + + // terminating events + res.once('error', error => { + parserHandlesEnd = false; + this.callback(error, null); + }); + if (!parserHandlesEnd) res.once('end', () => { + debug('end %s %s', this.method, this.url); + // TODO: unless buffering emit earlier to stream + this.emit('end'); + this.callback(null, this._emitResponse()); + }); + }); + this.emit('request', this); + const getProgressMonitor = () => { + const lengthComputable = true; + const total = req.getHeader('Content-Length'); + let loaded = 0; + const progress = new Stream.Transform(); + progress._transform = (chunk, encoding, callback) => { + loaded += chunk.length; + this.emit('progress', { + direction: 'upload', + lengthComputable, + loaded, + total + }); + callback(null, chunk); + }; + return progress; + }; + const bufferToChunks = buffer => { + const chunkSize = 16 * 1024; // default highWaterMark value + const chunking = new Stream.Readable(); + const totalLength = buffer.length; + const remainder = totalLength % chunkSize; + const cutoff = totalLength - remainder; + for (let i = 0; i < cutoff; i += chunkSize) { + const chunk = buffer.slice(i, i + chunkSize); + chunking.push(chunk); + } + if (remainder > 0) { + const remainderBuffer = buffer.slice(-remainder); + chunking.push(remainderBuffer); + } + chunking.push(null); // no more data + + return chunking; + }; + + // if a FormData instance got created, then we send that as the request body + const formData = this._formData; + if (formData) { + // set headers + const headers = formData.getHeaders(); + for (const i in headers) { + if (hasOwn(headers, i)) { + debug('setting FormData header: "%s: %s"', i, headers[i]); + req.setHeader(i, headers[i]); + } + } + + // attempt to get "Content-Length" header + formData.getLength((error, length) => { + // TODO: Add chunked encoding when no length (if err) + if (error) debug('formData.getLength had error', error, length); + debug('got FormData Content-Length: %s', length); + if (typeof length === 'number') { + req.setHeader('Content-Length', length); + } + formData.pipe(getProgressMonitor()).pipe(req); + }); + } else if (Buffer.isBuffer(data)) { + bufferToChunks(data).pipe(getProgressMonitor()).pipe(req); + } else { + req.end(data); + } +}; + +// Check whether response has a non-0-sized gzip-encoded body +Request.prototype._shouldDecompress = res => { + return hasNonEmptyResponseContent(res) && (isGzipOrDeflateEncoding(res) || isBrotliEncoding(res)); +}; + +/** + * Overrides DNS for selected hostnames. Takes object mapping hostnames to IP addresses. + * + * When making a request to a URL with a hostname exactly matching a key in the object, + * use the given IP address to connect, instead of using DNS to resolve the hostname. + * + * A special host `*` matches every hostname (keep redirects in mind!) + * + * request.connect({ + * 'test.example.com': '127.0.0.1', + * 'ipv6.example.com': '::1', + * }) + */ +Request.prototype.connect = function (connectOverride) { + if (typeof connectOverride === 'string') { + this._connectOverride = { + '*': connectOverride + }; + } else if (typeof connectOverride === 'object') { + this._connectOverride = connectOverride; + } else { + this._connectOverride = undefined; + } + return this; +}; +Request.prototype.trustLocalhost = function (toggle) { + this._trustLocalhost = toggle === undefined ? true : toggle; + return this; +}; + +// generate HTTP verb methods +if (!methods.includes('del')) { + // create a copy so we don't cause conflicts with + // other packages using the methods package and + // npm 3.x + methods = [...methods]; + methods.push('del'); +} +for (let method of methods) { + const name = method; + method = method === 'del' ? 'delete' : method; + method = method.toUpperCase(); + request[name] = (url, data, fn) => { + const request_ = request(method, url); + if (typeof data === 'function') { + fn = data; + data = null; + } + if (data) { + if (method === 'GET' || method === 'HEAD') { + request_.query(data); + } else { + request_.send(data); + } + } + if (fn) request_.end(fn); + return request_; + }; +} + +/** + * Check if `mime` is text and should be buffered. + * + * @param {String} mime + * @return {Boolean} + * @api public + */ + +function isText(mime) { + const parts = mime.split('/'); + let type = parts[0]; + if (type) type = type.toLowerCase().trim(); + let subtype = parts[1]; + if (subtype) subtype = subtype.toLowerCase().trim(); + return type === 'text' || subtype === 'x-www-form-urlencoded'; +} + +// This is not a catchall, but a start. It might be useful +// in the long run to have file that includes all binary +// content types from https://www.iana.org/assignments/media-types/media-types.xhtml +function isBinary(mime) { + let [registry, name] = mime.split('/'); + if (registry) registry = registry.toLowerCase().trim(); + if (name) name = name.toLowerCase().trim(); + return ['audio', 'font', 'image', 'video'].includes(registry) || ['gz', 'gzip'].includes(name); +} + +/** + * Check if `mime` is json or has +json structured syntax suffix. + * + * @param {String} mime + * @return {Boolean} + * @api private + */ + +function isJSON(mime) { + // should match /json or +json + // but not /json-seq + return /[/+]json($|[^-\w])/i.test(mime); +} + +/** + * Check if we should follow the redirect `code`. + * + * @param {Number} code + * @return {Boolean} + * @api private + */ + +function isRedirect(code) { + return [301, 302, 303, 305, 307, 308].includes(code); +} +function hasNonEmptyResponseContent(res) { + if (res.statusCode === 204 || res.statusCode === 304) { + // These aren't supposed to have any body + return false; + } + + // header content is a string, and distinction between 0 and no information is crucial + if (res.headers['content-length'] === '0') { + // We know that the body is empty (unfortunately, this check does not cover chunked encoding) + return false; + } + return true; +} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJmb3JtYXQiLCJyZXF1aXJlIiwiU3RyZWFtIiwiaHR0cHMiLCJodHRwIiwiZnMiLCJ6bGliIiwidXRpbCIsInFzIiwibWltZSIsIm1ldGhvZHMiLCJGb3JtRGF0YSIsImZvcm1pZGFibGUiLCJkZWJ1ZyIsIkNvb2tpZUphciIsInNhZmVTdHJpbmdpZnkiLCJ1dGlscyIsIlJlcXVlc3RCYXNlIiwiaHR0cDIiLCJkZWNvbXByZXNzIiwiUmVzcG9uc2UiLCJtaXhpbiIsImhhc093biIsImlzQnJvdGxpRW5jb2RpbmciLCJpc0d6aXBPckRlZmxhdGVFbmNvZGluZyIsImNob29zZURlY29tcHJlc3NlciIsInJlcXVlc3QiLCJtZXRob2QiLCJ1cmwiLCJleHBvcnRzIiwiUmVxdWVzdCIsImVuZCIsImFyZ3VtZW50cyIsImxlbmd0aCIsIm1vZHVsZSIsImFnZW50Iiwibm9vcCIsImRlZmluZSIsInByb3RvY29scyIsInNlcmlhbGl6ZSIsIm9iaiIsInN0cmluZ2lmeSIsImluZGljZXMiLCJzdHJpY3ROdWxsSGFuZGxpbmciLCJwYXJzZSIsImJ1ZmZlciIsIl9pbml0SGVhZGVycyIsInJlcXVlc3RfIiwiX2hlYWRlciIsImhlYWRlciIsImNhbGwiLCJfZW5hYmxlSHR0cDIiLCJCb29sZWFuIiwicHJvY2VzcyIsImVudiIsIkhUVFAyX1RFU1QiLCJfYWdlbnQiLCJfZm9ybURhdGEiLCJ3cml0YWJsZSIsIl9yZWRpcmVjdHMiLCJyZWRpcmVjdHMiLCJjb29raWV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DQSxPQUFPLHFCQUFxQixDQUFDOEosSUFBSSxDQUFDOUosSUFBSSxDQUFDO0FBQ3pDOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLFNBQVN3RyxVQUFVQSxDQUFDUSxJQUFJLEVBQUU7RUFDeEIsT0FBTyxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLENBQUN6QixRQUFRLENBQUN5QixJQUFJLENBQUM7QUFDdEQ7QUFFQSxTQUFTc0osMEJBQTBCQSxDQUFDL0osR0FBRyxFQUFFO0VBQ3ZDLElBQUlBLEdBQUcsQ0FBQ0UsVUFBVSxLQUFLLEdBQUcsSUFBSUYsR0FBRyxDQUFDRSxVQUFVLEtBQUssR0FBRyxFQUFFO0lBQ3BEO0lBQ0EsT0FBTyxLQUFLO0VBQ2Q7O0VBRUE7RUFDQSxJQUFJRixHQUFHLENBQUNXLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxLQUFLLEdBQUcsRUFBRTtJQUN6QztJQUNBLE9BQU8sS0FBSztFQUNkO0VBRUEsT0FBTyxJQUFJO0FBQ2IiLCJpZ25vcmVMaXN0IjpbXX0= \ No newline at end of file diff --git a/node_modules/superagent/lib/node/parsers/image.js b/node_modules/superagent/lib/node/parsers/image.js new file mode 100644 index 0000000..c77432d --- /dev/null +++ b/node_modules/superagent/lib/node/parsers/image.js @@ -0,0 +1,13 @@ +"use strict"; + +module.exports = (res, fn) => { + const data = []; // Binary data needs binary storage + + res.on('data', chunk => { + data.push(chunk); + }); + res.on('end', () => { + fn(null, Buffer.concat(data)); + }); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJkYXRhIiwib24iLCJjaHVuayIsInB1c2giLCJCdWZmZXIiLCJjb25jYXQiXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbm9kZS9wYXJzZXJzL2ltYWdlLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgY29uc3QgZGF0YSA9IFtdOyAvLyBCaW5hcnkgZGF0YSBuZWVkcyBiaW5hcnkgc3RvcmFnZVxuXG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIGRhdGEucHVzaChjaHVuayk7XG4gIH0pO1xuICByZXMub24oJ2VuZCcsICgpID0+IHtcbiAgICBmbihudWxsLCBCdWZmZXIuY29uY2F0KGRhdGEpKTtcbiAgfSk7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQU8sR0FBRyxDQUFDQyxHQUFHLEVBQUVDLEVBQUUsS0FBSztFQUM1QixNQUFNQyxJQUFJLEdBQUcsRUFBRSxDQUFDLENBQUM7O0VBRWpCRixHQUFHLENBQUNHLEVBQUUsQ0FBQyxNQUFNLEVBQUdDLEtBQUssSUFBSztJQUN4QkYsSUFBSSxDQUFDRyxJQUFJLENBQUNELEtBQUssQ0FBQztFQUNsQixDQUFDLENBQUM7RUFDRkosR0FBRyxDQUFDRyxFQUFFLENBQUMsS0FBSyxFQUFFLE1BQU07SUFDbEJGLEVBQUUsQ0FBQyxJQUFJLEVBQUVLLE1BQU0sQ0FBQ0MsTUFBTSxDQUFDTCxJQUFJLENBQUMsQ0FBQztFQUMvQixDQUFDLENBQUM7QUFDSixDQUFDIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/superagent/lib/node/parsers/index.js b/node_modules/superagent/lib/node/parsers/index.js new file mode 100644 index 0000000..06052a5 --- /dev/null +++ b/node_modules/superagent/lib/node/parsers/index.js @@ -0,0 +1,11 @@ +"use strict"; + +exports['application/x-www-form-urlencoded'] = require('./urlencoded'); +exports['application/json'] = require('./json'); +exports.text = require('./text'); +exports['application/json-seq'] = exports.text; +const binary = require('./image'); +exports['application/octet-stream'] = binary; +exports['application/pdf'] = binary; +exports.image = binary; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnRzIiwicmVxdWlyZSIsInRleHQiLCJiaW5hcnkiLCJpbWFnZSJdLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ub2RlL3BhcnNlcnMvaW5kZXguanMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0c1snYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJ10gPSByZXF1aXJlKCcuL3VybGVuY29kZWQnKTtcbmV4cG9ydHNbJ2FwcGxpY2F0aW9uL2pzb24nXSA9IHJlcXVpcmUoJy4vanNvbicpO1xuZXhwb3J0cy50ZXh0ID0gcmVxdWlyZSgnLi90ZXh0Jyk7XG5cbmV4cG9ydHNbJ2FwcGxpY2F0aW9uL2pzb24tc2VxJ10gPSBleHBvcnRzLnRleHQ7XG5cbmNvbnN0IGJpbmFyeSA9IHJlcXVpcmUoJy4vaW1hZ2UnKTtcblxuZXhwb3J0c1snYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtJ10gPSBiaW5hcnk7XG5leHBvcnRzWydhcHBsaWNhdGlvbi9wZGYnXSA9IGJpbmFyeTtcbmV4cG9ydHMuaW1hZ2UgPSBiaW5hcnk7XG4iXSwibWFwcGluZ3MiOiI7O0FBQUFBLE9BQU8sQ0FBQyxtQ0FBbUMsQ0FBQyxHQUFHQyxPQUFPLENBQUMsY0FBYyxDQUFDO0FBQ3RFRCxPQUFPLENBQUMsa0JBQWtCLENBQUMsR0FBR0MsT0FBTyxDQUFDLFFBQVEsQ0FBQztBQUMvQ0QsT0FBTyxDQUFDRSxJQUFJLEdBQUdELE9BQU8sQ0FBQyxRQUFRLENBQUM7QUFFaENELE9BQU8sQ0FBQyxzQkFBc0IsQ0FBQyxHQUFHQSxPQUFPLENBQUNFLElBQUk7QUFFOUMsTUFBTUMsTUFBTSxHQUFHRixPQUFPLENBQUMsU0FBUyxDQUFDO0FBRWpDRCxPQUFPLENBQUMsMEJBQTBCLENBQUMsR0FBR0csTUFBTTtBQUM1Q0gsT0FBTyxDQUFDLGlCQUFpQixDQUFDLEdBQUdHLE1BQU07QUFDbkNILE9BQU8sQ0FBQ0ksS0FBSyxHQUFHRCxNQUFNIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/superagent/lib/node/parsers/json.js b/node_modules/superagent/lib/node/parsers/json.js new file mode 100644 index 0000000..bce03c9 --- /dev/null +++ b/node_modules/superagent/lib/node/parsers/json.js @@ -0,0 +1,25 @@ +"use strict"; + +module.exports = function (res, fn) { + res.text = ''; + res.setEncoding('utf8'); + res.on('data', chunk => { + res.text += chunk; + }); + res.on('end', () => { + let body; + let error; + try { + body = res.text && JSON.parse(res.text); + } catch (err) { + error = err; + // issue #675: return the raw response if the response parsing fails + error.rawResponse = res.text || null; + // issue #876: return the http status code if the response parsing fails + error.statusCode = res.statusCode; + } finally { + fn(error, body); + } + }); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIiwiYm9keSIsImVycm9yIiwiSlNPTiIsInBhcnNlIiwiZXJyIiwicmF3UmVzcG9uc2UiLCJzdGF0dXNDb2RlIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy9qc29uLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKHJlcywgZm4pIHtcbiAgcmVzLnRleHQgPSAnJztcbiAgcmVzLnNldEVuY29kaW5nKCd1dGY4Jyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykg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BQUs7SUFDVCxJQUFJO01BQ0ZELElBQUksR0FBR04sR0FBRyxDQUFDRSxJQUFJLElBQUlNLElBQUksQ0FBQ0MsS0FBSyxDQUFDVCxHQUFHLENBQUNFLElBQUksQ0FBQztJQUN6QyxDQUFDLENBQUMsT0FBT1EsR0FBRyxFQUFFO01BQ1pILEtBQUssR0FBR0csR0FBRztNQUNYO01BQ0FILEtBQUssQ0FBQ0ksV0FBVyxHQUFHWCxHQUFHLENBQUNFLElBQUksSUFBSSxJQUFJO01BQ3BDO01BQ0FLLEtBQUssQ0FBQ0ssVUFBVSxHQUFHWixHQUFHLENBQUNZLFVBQVU7SUFDbkMsQ0FBQyxTQUFTO01BQ1JYLEVBQUUsQ0FBQ00sS0FBSyxFQUFFRCxJQUFJLENBQUM7SUFDakI7RUFDRixDQUFDLENBQUM7QUFDSixDQUFDIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/superagent/lib/node/parsers/text.js b/node_modules/superagent/lib/node/parsers/text.js new file mode 100644 index 0000000..2304042 --- /dev/null +++ b/node_modules/superagent/lib/node/parsers/text.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = (res, fn) => { + res.text = ''; + res.setEncoding('utf8'); + res.on('data', chunk => { + res.text += chunk; + }); + res.on('end', fn); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy90ZXh0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgcmVzLnRleHQgPSAnJztcbiAgcmVzLnNldEVuY29kaW5nKCd1dGY4Jyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIHJlcy50ZXh0ICs9IGNodW5rO1xuICB9KTtcbiAgcmVzLm9uKCdlbmQnLCBmbik7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQU8sR0FBRyxDQUFDQyxHQUFHLEVBQUVDLEVBQUUsS0FBSztFQUM1QkQsR0FBRyxDQUFDRSxJQUFJLEdBQUcsRUFBRTtFQUNiRixHQUFHLENBQUNHLFdBQVcsQ0FBQyxNQUFNLENBQUM7RUFDdkJILEdBQUcsQ0FBQ0ksRUFBRSxDQUFDLE1BQU0sRUFBR0MsS0FBSyxJQUFLO0lBQ3hCTCxHQUFHLENBQUNFLElBQUksSUFBSUcsS0FBSztFQUNuQixDQUFDLENBQUM7RUFDRkwsR0FBRyxDQUFDSSxFQUFFLENBQUMsS0FBSyxFQUFFSCxFQUFFLENBQUM7QUFDbkIsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ== \ No newline at end of file diff --git a/node_modules/superagent/lib/node/parsers/urlencoded.js b/node_modules/superagent/lib/node/parsers/urlencoded.js new file mode 100644 index 0000000..ea58bfa --- /dev/null +++ b/node_modules/superagent/lib/node/parsers/urlencoded.js @@ -0,0 +1,22 @@ +"use strict"; + +/** + * Module dependencies. + */ + +const qs = require('qs'); +module.exports = (res, fn) => { + res.text = ''; + res.setEncoding('ascii'); + res.on('data', chunk => { + res.text += chunk; + }); + res.on('end', () => { + try { + fn(null, qs.parse(res.text)); + } catch (err) { + fn(err); + } + }); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJxcyIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIiwicGFyc2UiLCJlcnIiXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbm9kZS9wYXJzZXJzL3VybGVuY29kZWQuanMiXSwic291c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BQyxPQUFPSyxHQUFHLEVBQUU7TUFDWk4sRUFBRSxDQUFDTSxHQUFHLENBQUM7SUFDVDtFQUNGLENBQUMsQ0FBQztBQUNKLENBQUMiLCJpZ25vcmVMaXN0IjpbXX0= \ No newline at end of file diff --git a/node_modules/superagent/lib/node/response.js b/node_modules/superagent/lib/node/response.js new file mode 100644 index 0000000..3514fc7 --- /dev/null +++ b/node_modules/superagent/lib/node/response.js @@ -0,0 +1,143 @@ +"use strict"; + +/** + * Module dependencies. + */ + +const util = require('util'); +const Stream = require('stream'); +const ResponseBase = require('../response-base'); +const { + mixin +} = require('../utils'); + +/** + * Expose `Response`. + */ + +module.exports = Response; + +/** + * Initialize a new `Response` with the given `xhr`. + * + * - set flags (.ok, .error, etc) + * - parse header + * + * @param {Request} req + * @param {Object} options + * @constructor + * @extends {Stream} + * @implements {ReadableStream} + * @api private + */ + +function Response(request) { + Stream.call(this); + this.res = request.res; + const { + res + } = this; + this.request = request; + this.req = request.req; + this.text = res.text; + this.files = res.files || {}; + this.buffered = request._resBuffered; + this.headers = res.headers; + this.header = this.headers; + this._setStatusProperties(res.statusCode); + this._setHeaderProperties(this.header); + this.setEncoding = res.setEncoding.bind(res); + res.on('data', this.emit.bind(this, 'data')); + res.on('end', this.emit.bind(this, 'end')); + res.on('close', this.emit.bind(this, 'close')); + res.on('error', this.emit.bind(this, 'error')); +} + +// Lazy access res.body. +// https://github.com/nodejs/node/pull/39520#issuecomment-889697136 +Object.defineProperty(Response.prototype, 'body', { + get() { + return this._body !== undefined ? this._body : this.res.body !== undefined ? this.res.body : {}; + }, + set(value) { + this._body = value; + } +}); + +/** + * Inherit from `Stream`. + */ + +util.inherits(Response, Stream); +mixin(Response.prototype, ResponseBase.prototype); + +/** + * Implements methods of a `ReadableStream` + */ + +Response.prototype.destroy = function (error) { + this.res.destroy(error); +}; + +/** + * Pause. + */ + +Response.prototype.pause = function () { + this.res.pause(); +}; + +/** + * Resume. + */ + +Response.prototype.resume = function () { + this.res.resume(); +}; + +/** + * Return an `Error` representative of this response. + * + * @return {Error} + * @api public + */ + +Response.prototype.toError = function () { + const { + req + } = this; + const { + method + } = req; + const { + path + } = req; + const message = `cannot ${method} ${path} (${this.status})`; + const error = new Error(message); + error.status = this.status; + error.text = this.text; + error.method = method; + error.path = path; + return error; +}; +Response.prototype.setStatusProperties = function (status) { + console.warn('In superagent 2.x setStatusProperties is a private method'); + return this._setStatusProperties(status); +}; + +/** + * To json. + * + * @return {Object} + * @api public + */ + +Response.prototype.toJSON = function () { + return { + req: this.request.toJSON(), + header: this.header, + status: this.status, + text: this.text + }; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJ1dGlsIiwicmVxdWlyZSIsIlN0cmVhbSIsIlJlc3BvbnNlQmFzZSIsIm1peGluIiwibW9kdWxlIiwiZXhwb3J0cyIsIlJlc3BvbnNlIiwicmVxdWVzdCIsImNhbGwiLCJyZXMiLCJyZXEiLCJ0ZXh0IiwiZmlsZXMiLCJidWZmZXJlZCIsIl9yZXNCdWZmZXJlZCIsImhlYWRlcnMiLCJoZWFkZXIiLCJfc2V0U3RhdHVzUHJvcGVydGllcyIsInN0YXR1c0NvZGUiLCJfc2V0SGVhZGVyUHJvcGVydGllcyIsInNldEVuY29kaW5nIiwiYmluZCIsIm9uIiwiZW1pdCIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwicHJvdG90eXBlIiwiZ2V0IiwiX2JvZHkiLCJ1bmRlZmluZWQiLCJib2R5Iiwic2V0IiwidmFsdWUiLCJpbmhlcml0cyIsImRlc3Ryb3kiLCJlcnJvciIsInBhdXNlIiwicmVzdW1lIiwidG9FcnJvciIsIm1ldGhvZCIsInBhdGgiLCJtZXNzYWdlIiwic3RhdHVzIiwiRXJyb3IiLCJzZXRTdGF0dXNQcm9wZXJ0aWVzIiwiY29uc29sZSIsIndhcm4iLCJ0b0pTT04iXSwic291cmNlcyI6WyIuLi8uLi9zcmMvbm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dBQUdBLE1BQU07RUFDckJKLEtBQUssQ0FBQ0ssSUFBSSxHQUFHQSxJQUFJO0VBRWpCLE9BQU9MLEtBQUs7QUFDZCxDQUFDO0FBRUQ3QixRQUFRLENBQUNvQixTQUFTLENBQUNrQixtQkFBbUIsR0FBRyxVQUFVRixNQUFNLEVBQUU7RUFDekRHLE9BQU8sQ0FBQ0MsSUFBSSxDQUFDLDJEQUEyRCxDQUFDO0VBQ3pFLE9BQU8sSUFBSSxDQUFDN0Isb0JBQW9CLENBQUN5QixNQUFNLENBQUM7QUFDMUMsQ0FBQzs7QUFFRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUFwQyxRQUFRLENBQUNvQixTQUFTLENBQUNxQixNQUFNLEdBQUcsWUFBWTtFQUN0QyxPQUFPO0lBQ0xyQyxHQUFHLEVBQUUsSUFBSSxDQUFDSCxPQUFPLENBQUN3QyxNQUFNLENBQUMsQ0FBQztJQUMxQi9CLE1BQU0sRUFBRSxJQUFJLENBQUNBLE1BQU07SUFDbkIwQixNQUFNLEVBQUUsSUFBSSxDQUFDQSxNQUFNO0lBQ25CL0IsSUFBSSxFQUFFLElBQUksQ0FBQ0E7RUFDYixDQUFDO0FBQ0gsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ== \ No newline at end of file diff --git a/node_modules/superagent/lib/node/unzip.js b/node_modules/superagent/lib/node/unzip.js new file mode 100644 index 0000000..b473d16 --- /dev/null +++ b/node_modules/superagent/lib/node/unzip.js @@ -0,0 +1,74 @@ +"use strict"; + +/** + * Module dependencies. + */ + +const { + StringDecoder +} = require('string_decoder'); +const Stream = require('stream'); +const { + chooseDecompresser +} = require('./decompress'); + +/** + * Buffers response data events and re-emits when they're decompressed. + * + * @param {Request} req + * @param {Response} res + * @api private + */ + +exports.decompress = (request, res) => { + let decompresser = chooseDecompresser(res); + const stream = new Stream(); + let decoder; + + // make node responseOnEnd() happy + stream.req = request; + decompresser.on('error', error => { + if (error && error.code === 'Z_BUF_ERROR') { + // unexpected end of file is ignored by browsers and curl + stream.emit('end'); + return; + } + stream.emit('error', error); + }); + + // pipe to unzip + res.pipe(decompresser); + + // override `setEncoding` to capture encoding + res.setEncoding = type => { + decoder = new StringDecoder(type); + }; + + // decode upon decompressing with captured encoding + decompresser.on('data', buf => { + if (decoder) { + const string_ = decoder.write(buf); + if (string_.length > 0) stream.emit('data', string_); + } else { + stream.emit('data', buf); + } + }); + decompresser.on('end', () => { + stream.emit('end'); + }); + + // override `on` to capture data listeners + const _on = res.on; + res.on = function (type, fn) { + if (type === 'data' || type === 'end') { + stream.on(type, fn.bind(res)); + } else if (type === 'error') { + stream.on(type, fn.bind(res)); + _on.call(res, type, fn); + } else { + _on.call(res, type, fn); + } + return this; + }; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJTdHJpbmdEZWNvZGVyIiwicmVxdWlyZSIsIlN0cmVhbSIsImNob29zZURlY29tcHJlc3NlciIsImV4cG9ydHMiLCJkZWNvbXByZXNzIiwicmVxdWVzdCIsInJlcyIsImRlY29tcHJlc3NlciIsInN0cmVhbSIsImRlY29kZXIiLCJyZXEiLCJvbiIsImVycm9yIiwiY29kZSIsImVtaXQiLCJwaXBlIiwic2V0RW5jb2RpbmciLCJ0eXBlIiwiYnVmIiwic3RyaW5nXyIsIndyaXRlIiwibGVuZ3RoIiwiX29uIiwiZm4iLCJiaW5kIiwiY2FsbCJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ub2RlL3VuemlwLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogTW9kdWxlIGRlcGVuZGVuY2llcy5cbiAqL1xuXG5jb25zdCB7IFN0cmluZ0RlY29kZXIgfSA9IHJlcXVpcmUoJ3N0cmluZ19kZWNvZGVyJyk7XG5jb25zdCBTdHJlYW0gPSByZXF1aXJlKCdzdHJlYW0nKTtcbmNvbnN0IHsgY2hvb3NlRGVjb21wcmVzc2VyI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RyxFQUFFVyxJQUFJLEVBQUVNLEVBQUUsQ0FBQztJQUN6QjtJQUVBLE9BQU8sSUFBSTtFQUNiLENBQUM7QUFDSCxDQUFDIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/superagent/lib/request-base.js b/node_modules/superagent/lib/request-base.js new file mode 100644 index 0000000..19fbbd2 --- /dev/null +++ b/node_modules/superagent/lib/request-base.js @@ -0,0 +1,720 @@ +"use strict"; + +/** + * Module of mixed-in functions shared between node and client code + */ +const { + isObject, + hasOwn +} = require('./utils'); + +/** + * Expose `RequestBase`. + */ + +module.exports = RequestBase; + +/** + * Initialize a new `RequestBase`. + * + * @api public + */ + +function RequestBase() {} + +/** + * Clear previous timeout. + * + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.clearTimeout = function () { + clearTimeout(this._timer); + clearTimeout(this._responseTimeoutTimer); + clearTimeout(this._uploadTimeoutTimer); + delete this._timer; + delete this._responseTimeoutTimer; + delete this._uploadTimeoutTimer; + return this; +}; + +/** + * Override default response body parser + * + * This function will be called to convert incoming data into request.body + * + * @param {Function} + * @api public + */ + +RequestBase.prototype.parse = function (fn) { + this._parser = fn; + return this; +}; + +/** + * Set format of binary response body. + * In browser valid formats are 'blob' and 'arraybuffer', + * which return Blob and ArrayBuffer, respectively. + * + * In Node all values result in Buffer. + * + * Examples: + * + * req.get('/') + * .responseType('blob') + * .end(callback); + * + * @param {String} val + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.responseType = function (value) { + this._responseType = value; + return this; +}; + +/** + * Override default request body serializer + * + * This function will be called to convert data set via .send or .attach into payload to send + * + * @param {Function} + * @api public + */ + +RequestBase.prototype.serialize = function (fn) { + this._serializer = fn; + return this; +}; + +/** + * Set timeouts. + * + * - response timeout is time between sending request and receiving the first byte of the response. Includes DNS and connection time. + * - deadline is the time from start of the request to receiving response body in full. If the deadline is too short large files may not load at all on slow connections. + * - upload is the time since last bit of data was sent or received. This timeout works only if deadline timeout is off + * + * Value of 0 or false means no timeout. + * + * @param {Number|Object} ms or {response, deadline} + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.timeout = function (options) { + if (!options || typeof options !== 'object') { + this._timeout = options; + this._responseTimeout = 0; + this._uploadTimeout = 0; + return this; + } + for (const option in options) { + if (hasOwn(options, option)) { + switch (option) { + case 'deadline': + this._timeout = options.deadline; + break; + case 'response': + this._responseTimeout = options.response; + break; + case 'upload': + this._uploadTimeout = options.upload; + break; + default: + console.warn('Unknown timeout option', option); + } + } + } + return this; +}; + +/** + * Set number of retry attempts on error. + * + * Failed requests will be retried 'count' times if timeout or err.code >= 500. + * + * @param {Number} count + * @param {Function} [fn] + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.retry = function (count, fn) { + // Default to 1 if no count passed or true + if (arguments.length === 0 || count === true) count = 1; + if (count <= 0) count = 0; + this._maxRetries = count; + this._retries = 0; + this._retryCallback = fn; + return this; +}; + +// +// NOTE: we do not include ESOCKETTIMEDOUT because that is from `request` package +// +// +// NOTE: we do not include EADDRINFO because it was removed from libuv in 2014 +// +// +// +// +// TODO: expose these as configurable defaults +// +const ERROR_CODES = new Set(['ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN']); +const STATUS_CODES = new Set([408, 413, 429, 500, 502, 503, 504, 521, 522, 524]); + +// TODO: we would need to make this easily configurable before adding it in (e.g. some might want to add POST) +// const METHODS = new Set(['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE']); + +/** + * Determine if a request should be retried. + * (Inspired by https://github.com/sindresorhus/got#retry) + * + * @param {Error} err an error + * @param {Response} [res] response + * @returns {Boolean} if segment should be retried + */ +RequestBase.prototype._shouldRetry = function (error, res) { + if (!this._maxRetries || this._retries++ >= this._maxRetries) { + return false; + } + if (this._retryCallback) { + try { + const override = this._retryCallback(error, res); + if (override === true) return true; + if (override === false) return false; + // undefined falls back to defaults + } catch (err) { + console.error(err); + } + } + + // TODO: we would need to make this easily configurable before adding it in (e.g. some might want to add POST) + /* + if ( + this.req && + this.req.method && + !METHODS.has(this.req.method.toUpperCase()) + ) + return false; + */ + if (res && res.status && STATUS_CODES.has(res.status)) return true; + if (error) { + if (error.code && ERROR_CODES.has(error.code)) return true; + // Superagent timeout + if (error.timeout && error.code === 'ECONNABORTED') return true; + if (error.crossDomain) return true; + } + return false; +}; + +/** + * Retry request + * + * @return {Request} for chaining + * @api private + */ + +RequestBase.prototype._retry = function () { + this.clearTimeout(); + + // node + if (this.req) { + this.req = null; + this.req = this.request(); + } + this._aborted = false; + this.timedout = false; + this.timedoutError = null; + return this._end(); +}; + +/** + * Promise support + * + * @param {Function} resolve + * @param {Function} [reject] + * @return {Request} + */ + +RequestBase.prototype.then = function (resolve, reject) { + if (!this._fullfilledPromise) { + const self = this; + if (this._endCalled) { + console.warn('Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises'); + } + this._fullfilledPromise = new Promise((resolve, reject) => { + self.on('abort', () => { + if (this._maxRetries && this._maxRetries > this._retries) { + return; + } + if (this.timedout && this.timedoutError) { + reject(this.timedoutError); + return; + } + const error = new Error('Aborted'); + error.code = 'ABORTED'; + error.status = this.status; + error.method = this.method; + error.url = this.url; + reject(error); + }); + self.end((error, res) => { + if (error) reject(error);else resolve(res); + }); + }); + } + return this._fullfilledPromise.then(resolve, reject); +}; +RequestBase.prototype.catch = function (callback) { + return this.then(undefined, callback); +}; + +/** + * Allow for extension + */ + +RequestBase.prototype.use = function (fn) { + fn(this); + return this; +}; +RequestBase.prototype.ok = function (callback) { + if (typeof callback !== 'function') throw new Error('Callback required'); + this._okCallback = callback; + return this; +}; +RequestBase.prototype._isResponseOK = function (res) { + if (!res) { + return false; + } + if (this._okCallback) { + return this._okCallback(res); + } + return res.status >= 200 && res.status < 300; +}; + +/** + * Get request header `field`. + * Case-insensitive. + * + * @param {String} field + * @return {String} + * @api public + */ + +RequestBase.prototype.get = function (field) { + return this._header[field.toLowerCase()]; +}; + +/** + * Get case-insensitive header `field` value. + * This is a deprecated internal API. Use `.get(field)` instead. + * + * (getHeader is no longer used internally by the superagent code base) + * + * @param {String} field + * @return {String} + * @api private + * @deprecated + */ + +RequestBase.prototype.getHeader = RequestBase.prototype.get; + +/** + * Set header `field` to `val`, or multiple fields with one object. + * Case-insensitive. + * + * Examples: + * + * req.get('/') + * .set('Accept', 'application/json') + * .set('X-API-Key', 'foobar') + * .end(callback); + * + * req.get('/') + * .set({ Accept: 'application/json', 'X-API-Key': 'foobar' }) + * .end(callback); + * + * @param {String|Object} field + * @param {String} val + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.set = function (field, value) { + if (isObject(field)) { + for (const key in field) { + if (hasOwn(field, key)) this.set(key, field[key]); + } + return this; + } + this._header[field.toLowerCase()] = value; + this.header[field] = value; + return this; +}; + +/** + * Remove header `field`. + * Case-insensitive. + * + * Example: + * + * req.get('/') + * .unset('User-Agent') + * .end(callback); + * + * @param {String} field field name + */ +RequestBase.prototype.unset = function (field) { + delete this._header[field.toLowerCase()]; + delete this.header[field]; + return this; +}; + +/** + * Write the field `name` and `val`, or multiple fields with one object + * for "multipart/form-data" request bodies. + * + * ``` js + * request.post('/upload') + * .field('foo', 'bar') + * .end(callback); + * + * request.post('/upload') + * .field({ foo: 'bar', baz: 'qux' }) + * .end(callback); + * ``` + * + * @param {String|Object} name name of field + * @param {String|Blob|File|Buffer|fs.ReadStream} val value of field + * @param {String} options extra options, e.g. 'blob' + * @return {Request} for chaining + * @api public + */ +RequestBase.prototype.field = function (name, value, options) { + // name should be either a string or an object. + if (name === null || undefined === name) { + throw new Error('.field(name, val) name can not be empty'); + } + if (this._data) { + throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"); + } + if (isObject(name)) { + for (const key in name) { + if (hasOwn(name, key)) this.field(key, name[key]); + } + return this; + } + if (Array.isArray(value)) { + for (const i in value) { + if (hasOwn(value, i)) this.field(name, value[i]); + } + return this; + } + + // val should be defined now + if (value === null || undefined === value) { + throw new Error('.field(name, val) val can not be empty'); + } + if (typeof value === 'boolean') { + value = String(value); + } + + // fix https://github.com/ladjs/superagent/issues/1680 + if (options) this._getFormData().append(name, value, options);else this._getFormData().append(name, value); + return this; +}; + +/** + * Abort the request, and clear potential timeout. + * + * @return {Request} request + * @api public + */ +RequestBase.prototype.abort = function () { + if (this._aborted) { + return this; + } + this._aborted = true; + if (this.xhr) this.xhr.abort(); // browser + if (this.req) { + this.req.abort(); // node + } + this.clearTimeout(); + this.emit('abort'); + return this; +}; +RequestBase.prototype._auth = function (user, pass, options, base64Encoder) { + switch (options.type) { + case 'basic': + this.set('Authorization', `Basic ${base64Encoder(`${user}:${pass}`)}`); + break; + case 'auto': + this.username = user; + this.password = pass; + break; + case 'bearer': + // usage would be .auth(accessToken, { type: 'bearer' }) + this.set('Authorization', `Bearer ${user}`); + break; + default: + break; + } + return this; +}; + +/** + * Enable transmission of cookies with x-domain requests. + * + * Note that for this to work the origin must not be + * using "Access-Control-Allow-Origin" with a wildcard, + * and also must set "Access-Control-Allow-Credentials" + * to "true". + * @param {Boolean} [on=true] - Set 'withCredentials' state + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.withCredentials = function (on) { + // This is browser-only functionality. Node side is no-op. + if (on === undefined) on = true; + this._withCredentials = on; + return this; +}; + +/** + * Set the max redirects to `n`. Does nothing in browser XHR implementation. + * + * @param {Number} n + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.redirects = function (n) { + this._maxRedirects = n; + return this; +}; + +/** + * Maximum size of buffered response body, in bytes. Counts uncompressed size. + * Default 200MB. + * + * @param {Number} n number of bytes + * @return {Request} for chaining + */ +RequestBase.prototype.maxResponseSize = function (n) { + if (typeof n !== 'number') { + throw new TypeError('Invalid argument'); + } + this._maxResponseSize = n; + return this; +}; + +/** + * Convert to a plain javascript object (not JSON string) of scalar properties. + * Note as this method is designed to return a useful non-this value, + * it cannot be chained. + * + * @return {Object} describing method, url, and data of this request + * @api public + */ + +RequestBase.prototype.toJSON = function () { + return { + method: this.method, + url: this.url, + data: this._data, + headers: this._header + }; +}; + +/** + * Send `data` as the request body, defaulting the `.type()` to "json" when + * an object is given. + * + * Examples: + * + * // manual json + * request.post('/user') + * .type('json') + * .send('{"name":"tj"}') + * .end(callback) + * + * // auto json + * request.post('/user') + * .send({ name: 'tj' }) + * .end(callback) + * + * // manual x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send('name=tj') + * .end(callback) + * + * // auto x-www-form-urlencoded + * request.post('/user') + * .type('form') + * .send({ name: 'tj' }) + * .end(callback) + * + * // defaults to x-www-form-urlencoded + * request.post('/user') + * .send('name=tobi') + * .send('species=ferret') + * .end(callback) + * + * @param {String|Object} data + * @return {Request} for chaining + * @api public + */ + +// eslint-disable-next-line complexity +RequestBase.prototype.send = function (data) { + const isObject_ = isObject(data); + let type = this._header['content-type']; + if (this._formData) { + throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"); + } + if (isObject_ && !this._data) { + if (Array.isArray(data)) { + this._data = []; + } else if (!this._isHost(data)) { + this._data = {}; + } + } else if (data && this._data && this._isHost(this._data)) { + throw new Error("Can't merge these send calls"); + } + + // merge + if (isObject_ && isObject(this._data)) { + for (const key in data) { + if (typeof data[key] == 'bigint' && !data[key].toJSON) throw new Error('Cannot serialize BigInt value to json'); + if (hasOwn(data, key)) this._data[key] = data[key]; + } + } else if (typeof data === 'bigint') throw new Error("Cannot send value of type BigInt");else if (typeof data === 'string') { + // default to x-www-form-urlencoded + if (!type) this.type('form'); + type = this._header['content-type']; + if (type) type = type.toLowerCase().trim(); + if (type === 'application/x-www-form-urlencoded') { + this._data = this._data ? `${this._data}&${data}` : data; + } else { + this._data = (this._data || '') + data; + } + } else { + this._data = data; + } + if (!isObject_ || this._isHost(data)) { + return this; + } + + // default to json + if (!type) this.type('json'); + return this; +}; + +/** + * Sort `querystring` by the sort function + * + * + * Examples: + * + * // default order + * request.get('/user') + * .query('name=Nick') + * .query('search=Manny') + * .sortQuery() + * .end(callback) + * + * // customized sort function + * request.get('/user') + * .query('name=Nick') + * .query('search=Manny') + * .sortQuery(function(a, b){ + * return a.length - b.length; + * }) + * .end(callback) + * + * + * @param {Function} sort + * @return {Request} for chaining + * @api public + */ + +RequestBase.prototype.sortQuery = function (sort) { + // _sort default to true but otherwise can be a function or boolean + this._sort = typeof sort === 'undefined' ? true : sort; + return this; +}; + +/** + * Compose querystring to append to req.url + * + * @api private + */ +RequestBase.prototype._finalizeQueryString = function () { + const query = this._query.join('&'); + if (query) { + this.url += (this.url.includes('?') ? '&' : '?') + query; + } + this._query.length = 0; // Makes the call idempotent + + if (this._sort) { + const index = this.url.indexOf('?'); + if (index >= 0) { + const queryArray = this.url.slice(index + 1).split('&'); + if (typeof this._sort === 'function') { + queryArray.sort(this._sort); + } else { + queryArray.sort(); + } + this.url = this.url.slice(0, index) + '?' + queryArray.join('&'); + } + } +}; + +// For backwards compat only +RequestBase.prototype._appendQueryString = () => { + console.warn('Unsupported'); +}; + +/** + * Invoke callback with timeout error. + * + * @api private + */ + +RequestBase.prototype._timeoutError = function (reason, timeout, errno) { + if (this._aborted) { + return; + } + const error = new Error(`${reason + timeout}ms exceeded`); + error.timeout = timeout; + error.code = 'ECONNABORTED'; + error.errno = errno; + this.timedout = true; + this.timedoutError = error; + this.abort(); + this.callback(error); +}; +RequestBase.prototype._setTimeouts = function () { + const self = this; + + // deadline + if (this._timeout && !this._timer) { + this._timer = setTimeout(() => { + self._timeoutError('Timeout of ', self._timeout, 'ETIME'); + }, this._timeout); + } + + // response timeout + if (this._responseTimeout && !this._responseTimeoutTimer) { + this._responseTimeoutTimer = setTimeout(() => { + self._timeoutError('Response timeout of ', self._responseTimeout, 'ETIMEDOUT'); + }, this._responseTimeout); + } +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc09iamVjdCIsImhhc093biIsInJlcX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dGhpcy5fZnVsbGZpbGxlZFByb21pc2UgPSBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICBzZWxmLm9uKCdhYm9ydCcsICgpID0+IHtcbiAgICAgICAgaWYgKHRoaXMuX21heFJldHJpZXMgJiYgdGhpcy5fbWF4UmV0cmllcyA+IHRoaXMuX3JldHJpZXMpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy50aW1lZG91dCAmJiB0aGlzLnRpbWVkb3V0RXJyb3IpIHtcbiAgICAgICAgICByZWplY3QodGhpcy50aW1lZG91dEVycm9yKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBlcnJvciA9IG5ldyBFcnJvcignQWJvcnRlZCcpO1xuICAgICAgICBlcnJvci5jb2RlID0gJ0FCT1JURUQnO1xuICAgICAgICBlcnJvci5zdGF0dXMgPSB0aGlzLnN0YXR1cztcbiAgICAgICAgZXJyb3IubWV0aG9kID0gdGhpcy5tZXRob2Q7XG4gICAgICAgIGVycm9yLnVybCA9IHRoaXMudXJsO1xuICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgfSk7XG4gICAgICBzZWxmLmVuZCgoZXJyb3IsIHJlcykgPT4ge1xuICAgICAgICBpZiAoZXJyb3IpIHJlamVjdChlcnJvcik7XG4gICAgICAgIGVsc2UgcmVzb2x2ZShyZXMpO1xuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxuICByZXR1cm4gdGhpcy5fZnVsbGZpbGxlZFByb21pc2UudGhlbihyZXNvbHZlLCByZWplY3QpO1xufTtcblxuUmVxdWVzdEJhc2UucHJvdG90eXBlLmNhdGNoID0gZnVuY3Rpb24gKGNhbGxiYWNrKSB7XG4gIHJldHVybiB0aGlzLnRoZW4odW5kZWZpbmVkLCBjYWxsYmFjayk7XG59O1xuXG4vKipcbiAqIEFsbG93IGZvciBleHRlbnNpb25cbiA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BgZGF0YWAgYXMgdGhlIHJlcXVlc3QgYm9keSwgZGVmYXVsdGluZyB0aGUgYC50eXBlKClgIHRvIFwianNvblwiIHdoZW5cbiAqIGFuIG9iamVjdCBpcyBnaXZlbi5cbiAqXG4gKiBFeGFtcGxlczpcbiAqXG4gKiAgICAgICAvLyBtYW51YWwganNvblxuICogICAgICAgcmVxdWVzdC5wb3N0KCcvdXNlcicpXG4gKiAgICAgICAgIC50eXBlKCdqc29uJylcbiAqICAgICAgICAgLnNlbmQoJ3tcIm5hbWVcIjpcInRqXCJ9JylcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBhdXRvIGpzb25cbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAuc2VuZCh7IG5hbWU6ICd0aicgfSlcbiAqICAgICAgICAgLmVuZChjYWxsYmFjaylcbiAqXG4gKiAgICAgICAvLyBtYW51YWwgeC13d3ctZm9ybS11cmxlbmNvZGVkXG4gKiAgICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAgLnR5cGUoJ2Zvcm0nKVxuICogICAgICAgICAuc2VuZCgnbmFtZT10aicpXG4gKiAgICAgICAgIC5lbmQoY2FsbGJhY2spXG4gKlxuICogICAgICAgLy8gYXV0byB4LXd3dy1mb3JtLXVybGVuY29kZWRcbiAqICAgICAgIHJlcXVlc3QucG9zdCgnL3VzZXInKVxuICogICAgICAgICAudHlwZSgnZm9ybScpXG4gKiAgICAgICAgIC5zZW5kKHsgbmFtZTogJ3RqJyB9KVxuICogICAgICAgICAuZW5kKGNhbGxiYWNrKVxuICpcbiAqICAgICAgIC8vIGRlZmF1bHRzIHRvIHgtd3d3LWZvcm0tdXJsZW5jb2RlZFxuICogICAgICByZXF1ZXN0LnBvc3QoJy91c2VyJylcbiAqICAgICAgICAuc2VuZCgnbmFtZT10b2JpJylcbiAqICAgICAgICAuc2VuZCgnc3BlY2llcz1mZXJyZXQn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DRixDQUFDO0lBQ0gsQ0FBQyxFQUFFLElBQUksQ0FBQ0EsZ0JBQWdCLENBQUM7RUFDM0I7QUFDRixDQUFDIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/superagent/lib/response-base.js b/node_modules/superagent/lib/response-base.js new file mode 100644 index 0000000..32157bf --- /dev/null +++ b/node_modules/superagent/lib/response-base.js @@ -0,0 +1,120 @@ +"use strict"; + +/** + * Module dependencies. + */ + +const utils = require('./utils'); + +/** + * Expose `ResponseBase`. + */ + +module.exports = ResponseBase; + +/** + * Initialize a new `ResponseBase`. + * + * @api public + */ + +function ResponseBase() {} + +/** + * Get case-insensitive `field` value. + * + * @param {String} field + * @return {String} + * @api public + */ + +ResponseBase.prototype.get = function (field) { + return this.header[field.toLowerCase()]; +}; + +/** + * Set header related properties: + * + * - `.type` the content type without params + * + * A response of "Content-Type: text/plain; charset=utf-8" + * will provide you with a `.type` of "text/plain". + * + * @param {Object} header + * @api private + */ + +ResponseBase.prototype._setHeaderProperties = function (header) { + // TODO: moar! + // TODO: make this a util + + // content-type + const ct = header['content-type'] || ''; + this.type = utils.type(ct); + + // params + const parameters = utils.params(ct); + for (const key in parameters) { + if (Object.prototype.hasOwnProperty.call(parameters, key)) this[key] = parameters[key]; + } + this.links = {}; + + // links + try { + if (header.link) { + this.links = utils.parseLinks(header.link); + } + } catch (err) { + // ignore + } +}; + +/** + * Set flags such as `.ok` based on `status`. + * + * For example a 2xx response will give you a `.ok` of __true__ + * whereas 5xx will be __false__ and `.error` will be __true__. The + * `.clientError` and `.serverError` are also available to be more + * specific, and `.statusType` is the class of error ranging from 1..5 + * sometimes useful for mapping respond colors etc. + * + * "sugar" properties are also defined for common cases. Currently providing: + * + * - .noContent + * - .badRequest + * - .unauthorized + * - .notAcceptable + * - .notFound + * + * @param {Number} status + * @api private + */ + +ResponseBase.prototype._setStatusProperties = function (status) { + const type = Math.trunc(status / 100); + + // status / class + this.statusCode = status; + this.status = this.statusCode; + this.statusType = type; + + // basics + this.info = type === 1; + this.ok = type === 2; + this.redirect = type === 3; + this.clientError = type === 4; + this.serverError = type === 5; + this.error = type === 4 || type === 5 ? this.toError() : false; + + // sugar + this.created = status === 201; + this.accepted = status === 202; + this.noContent = status === 204; + this.badRequest = status === 400; + this.unauthorized = status === 401; + this.notAcceptable = status === 406; + this.forbidden = status === 403; + this.notFound = status === 404; + this.unprocessableEntity = status === 422; +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJ1dGlscyIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwiUmVzcG9uc2VCYXNlIiwicHJvdG90eXBlIiwiZ2V0IiwiZmllbGQiLCJoZWFkZXIiLCJ0b0xvd2VyQ2FzZSIsIl9zZXRIZWFkZXJQcm9wZXJ0aWVzIiwiY3QiLCJ0eXBlIiwicGFyYW1ldGVycyIsInBhcmFtcyIsImtleSIsIk9iamVjdCIsImhhc093blByb3BlcnR5IiwiY2FsbCIsImxpbmtzIiwibGluayIsInBhcnNlTGlua3MiLCJlcnIiLCJfc2V0U3RhdHVzUHJvcGVydGllcyIsInN0YXR1cyIsIk1hdGgiLCJ0cnVuYyIsInN0YXR1c0NvZGUiLCJzdGF0dXNUeXBlIiwiaW5mbyIsIm9rIiwicmVkaXJlY3QiLCJjbGllbnRFcnJvciIsInNlcnZlckVycm9yIiwiZXJyb3IiLCJ0b0Vycm9yIiwiY3JlYXRlZCIsImFjY2VwdGVkIiwibm9Db250ZW50IiwiYmFkUmVxdWVzdCIsInVuYXV0aG9yaXplZCIsIm5vdEFjY2VwdGFibGUiLCJmb3JiaWRkZW4iLCJub3RGb3VuZCIsInVucHJvY2Vzc2FibGVFbnRpdHkiXSwic291cmNlcyI6WyIuLi9zcmMvcmVzcG9uc2UtYmFzZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIE1vZHVsZSBkZXBlbmRlbmNpZXMuXG4gKi9cblxu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xLQUFLLEdBQUc7RUFDOUIsSUFBSSxDQUFDb0IsbUJBQW1CLEdBQUdwQixNQUFNLEtBQUssR0FBRztBQUMzQyxDQUFDIiwiaWdub3JlTGlzdCI6W119 \ No newline at end of file diff --git a/node_modules/superagent/lib/utils.js b/node_modules/superagent/lib/utils.js new file mode 100644 index 0000000..8a1c0bb --- /dev/null +++ b/node_modules/superagent/lib/utils.js @@ -0,0 +1,126 @@ +"use strict"; + +/** + * Return the mime type for the given `str`. + * + * @param {String} str + * @return {String} + * @api private + */ + +exports.type = string_ => string_.split(/ *; */).shift(); + +/** + * Return header field parameters. + * + * @param {String} str + * @return {Object} + * @api private + */ + +exports.params = value => { + const object = {}; + for (const string_ of value.split(/ *; */)) { + const parts = string_.split(/ *= */); + const key = parts.shift(); + const value = parts.shift(); + if (key && value) object[key] = value; + } + return object; +}; + +/** + * Parse Link header fields. + * + * @param {String} str + * @return {Object} + * @api private + */ + +exports.parseLinks = value => { + const object = {}; + for (const string_ of value.split(/ *, */)) { + const parts = string_.split(/ *; */); + const url = parts[0].slice(1, -1); + const rel = parts[1].split(/ *= */)[1].slice(1, -1); + object[rel] = url; + } + return object; +}; + +/** + * Strip content related fields from `header`. + * + * @param {Object} header + * @return {Object} header + * @api private + */ + +exports.cleanHeader = (header, changesOrigin) => { + delete header['content-type']; + delete header['content-length']; + delete header['transfer-encoding']; + delete header.host; + // secuirty + if (changesOrigin) { + delete header.authorization; + delete header.cookie; + } + return header; +}; +exports.normalizeHostname = hostname => { + const [, normalized] = hostname.match(/^\[([^\]]+)\]$/) || []; + return normalized || hostname; +}; + +/** + * Check if `obj` is an object. + * + * @param {Object} object + * @return {Boolean} + * @api private + */ +exports.isObject = object => { + return object !== null && typeof object === 'object'; +}; + +/** + * Object.hasOwn fallback/polyfill. + * + * @type {(object: object, property: string) => boolean} object + * @api private + */ +exports.hasOwn = Object.hasOwn || function (object, property) { + if (object == null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + return Object.prototype.hasOwnProperty.call(new Object(object), property); +}; +exports.mixin = (target, source) => { + for (const key in source) { + if (exports.hasOwn(source, key)) { + target[key] = source[key]; + } + } +}; + +/** + * Check if the response is compressed using Gzip or Deflate. + * @param {Object} res + * @return {Boolean} + */ + +exports.isGzipOrDeflateEncoding = res => { + return new RegExp(/^\s*(?:deflate|gzip)\s*$/).test(res.headers['content-encoding']); +}; + +/** + * Check if the response is compressed using Brotli. + * @param {Object} res + * @return {Boolean} + */ + +exports.isBrotliEncoding = res => { + return new RegExp(/^\s*(?:br)\s*$/).test(res.headers['content-encoding']); +}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJleHBvcnRzIiwidHlwZSIsInN0cmluZ18iLCJzcGxpdCIsInNoaWZ0IiwicGFyYW1zIiwidmFsdWUiLCJvYmplY3QiLCJwYXJ0cyIsImtleSIsInBhcnNlTGlua3MiLCJ1cmwiLCJzbGljZSIsInJlbCIsImNsZWFuSGVhZGVyIiwiaGVhZGVyIiwiY2hhbmdlc09yaWdpbiIsImhvc3QiLCJhdXRob3JpemF0aW9uIiwiY29va2llIiwibm9ybWFsaXplSG9zdG5hbWUiLCJob3N0bmFtZSIsIm5vcm1hbGl6ZWQiLCJtYXRjaCIsImlzT2JqZWN0IiwiaGFzT3duIiwiT2JqZWN0IiwicHJvcGVydHkiLCJUeXBlRXJyb3IiLCJwcm90b3R5cGUiLCJoYXNPd25Qcm9wZXJ0eSIsImNhbGwiLCJtaXhpbiIsInRhcmdldCIsInNvdXJjZSIsImlzR3ppcE9yRGVmbGF0ZUVuY29kaW5nIiwicmVzIiwiUmVnRXhwIiwidGVzdCIsImhlYWRlcnMiLCJpc0Jyb3RsaUVuY29kaW5nIl0sInNvdXJjZXMiOlsiLi4vc3JjL3V0aWxzLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlxuLyoqXG4gKiBSZXR1cm4gdGhlIG1pbWUgdHlwZSBmb3IgdGhlIGdpdmVuIGBzdHJ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LENBQUMsRUFBRW9CLFFBQVEsQ0FBQztBQUMzRSxDQUFDO0FBRUgzQixPQUFPLENBQUNnQyxLQUFLLEdBQUcsQ0FBQ0MsTUFBTSxFQUFFQyxNQUFNLEtBQUs7RUFDbEMsS0FBSyxNQUFNekIsR0FBRyxJQUFJeUIsTUFBTSxFQUFFO0lBQ3hCLElBQUlsQyxPQUFPLENBQUN5QixNQUFNLENBQUNTLE1BQU0sRUFBRXpCLEdBQUcsQ0FBQyxFQUFFO01BQy9Cd0IsTUFBTSxDQUFDeEIsR0FBRyxDQUFDLEdBQUd5QixNQUFNLENBQUN6QixHQUFHLENBQUM7SUFDM0I7RUFDRjtBQUNGLENBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQVQsT0FBTyxDQUFDbUMsdUJBQXVCLEdBQUlDLEdBQUcsSUFBSztFQUN6QyxPQUFPLElBQUlDLE1BQU0sQ0FBQywwQkFBMEIsQ0FBQyxDQUFDQyxJQUFJLENBQUNGLEdBQUcsQ0FBQ0csT0FBTyxDQUFDLGtCQUFrQixDQUFDLENBQUM7QUFDckYsQ0FBQzs7QUFFRDtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBdkMsT0FBTyxDQUFDd0MsZ0JBQWdCLEdBQUlKLEdBQUcsSUFBSztFQUNsQyxPQUFPLElBQUlDLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDQyxJQUFJLENBQUNGLEdBQUcsQ0FBQ0csT0FBTyxDQUFDLGtCQUFrQixDQUFDLENBQUM7QUFDM0UsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ== \ No newline at end of file diff --git a/node_modules/superagent/package.json b/node_modules/superagent/package.json new file mode 100644 index 0000000..973183a --- /dev/null +++ b/node_modules/superagent/package.json @@ -0,0 +1,132 @@ +{ + "name": "superagent", + "description": "elegant & feature rich browser / node HTTP with a fluent API", + "version": "10.2.3", + "author": "TJ Holowaychuk ", + "browser": { + "./src/node/index.js": "./src/client.js", + "./lib/node/index.js": "./lib/client.js", + "./test/support/server.js": "./test/support/blank.js" + }, + "bugs": { + "url": "https://github.com/ladjs/superagent/issues" + }, + "contributors": [ + "Kornel Lesiński ", + "Peter Lyons ", + "Hunter Loftis ", + "Nick Baugh " + ], + "dependencies": { + "component-emitter": "^1.3.1", + "cookiejar": "^2.1.4", + "debug": "^4.3.7", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.4", + "formidable": "^3.5.4", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.2" + }, + "devDependencies": { + "@babel/cli": "^7.20.7", + "@babel/core": "^7.20.12", + "@babel/plugin-transform-runtime": "^7.19.6", + "@babel/preset-env": "^7.20.2", + "@babel/runtime": "^7.20.13", + "@commitlint/cli": "^19.8.1", + "@commitlint/config-conventional": "^19.8.1", + "babelify": "^10.0.0", + "Base64": "^1.1.0", + "basic-auth-connect": "^1.0.0", + "body-parser": "^1.20.3", + "browserify": "^17.0.0", + "cookie-parser": "^1.4.7", + "cross-env": "^7.0.3", + "eslint": "^8.32.0", + "eslint-config-xo-lass": "2", + "eslint-plugin-compat": "4.0.2", + "eslint-plugin-node": "^11.1.0", + "express": "^4.18.3", + "express-session": "^1.17.3", + "fixpack": "^4.0.0", + "get-port": "4.2.0", + "husky": "^9.1.7", + "lint-staged": "^15.5.2", + "marked": "^4.2.12", + "mocha": "^6.2.3", + "multer": "1.4.5-lts.1", + "nyc": "^15.1.0", + "remark-cli": "^11.0.0", + "remark-preset-github": "4.0.4", + "rimraf": "3", + "should": "^13.2.3", + "should-http": "^0.1.1", + "tinyify": "3.0.0", + "xo": "^0.53.1", + "zuul": "^3.12.0" + }, + "engines": { + "node": ">=14.18.0" + }, + "files": [ + "dist/*.js", + "lib/**/*.js" + ], + "homepage": "https://github.com/ladjs/superagent", + "jsdelivr": "dist/superagent.min.js", + "keywords": [ + "agent", + "ajax", + "ajax", + "api", + "async", + "await", + "axios", + "cancel", + "client", + "frisbee", + "got", + "http", + "http", + "https", + "ky", + "promise", + "promise", + "promises", + "request", + "request", + "requests", + "response", + "rest", + "retry", + "super", + "superagent", + "timeout", + "transform", + "xhr", + "xmlhttprequest" + ], + "license": "MIT", + "main": "lib/node/index.js", + "repository": { + "type": "git", + "url": "git://github.com/ladjs/superagent.git" + }, + "scripts": { + "browserify": "browserify src/node/index.js -o dist/superagent.js -s superagent -g [ babelify --configFile ./.dist.babelrc ]", + "build": "npm run build:clean && npm run build:lib && npm run build:dist", + "build:clean": "rimraf lib dist", + "build:dist": "npm run browserify && npm run minify", + "build:lib": "babel --config-file ./.lib.babelrc src --out-dir lib", + "build:test": "babel --config-file ./.test.babelrc test --out-dir lib/node/test", + "coverage": "nyc report --reporter=text-lcov > coverage.lcov", + "lint": "eslint -c .eslintrc src test && remark . -qfo && eslint -c .lib.eslintrc lib/**/*.js && eslint -c .dist.eslintrc dist/**/*.js", + "minify": "cross-env NODE_ENV=production browserify src/node/index.js -o dist/superagent.min.js -s superagent -g [ babelify --configFile ./.dist.babelrc ] -p tinyify", + "nyc": "cross-env NODE_ENV=test nyc ava", + "test": "npm run build && npm run lint && make test", + "test-http2": "npm run build && npm run lint && make test-node-http2", + "prepare": "husky" + }, + "unpkg": "dist/superagent.min.js" +} diff --git a/node_modules/supertest/LICENSE b/node_modules/supertest/LICENSE new file mode 100644 index 0000000..a7693b0 --- /dev/null +++ b/node_modules/supertest/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/supertest/README.md b/node_modules/supertest/README.md new file mode 100644 index 0000000..089a6d6 --- /dev/null +++ b/node_modules/supertest/README.md @@ -0,0 +1,339 @@ +# [supertest](https://ladjs.github.io/superagent/) + +[![build status](https://github.com/forwardemail/supertest/actions/workflows/ci.yml/badge.svg)](https://github.com/forwardemail/supertest/actions/workflows/ci.yml) +[![code coverage](https://img.shields.io/codecov/c/github/ladjs/supertest.svg)](https://codecov.io/gh/ladjs/supertest) +[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) +[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) +[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org) +[![license](https://img.shields.io/github/license/ladjs/supertest.svg)](LICENSE) + +> HTTP assertions made easy via [superagent](http://github.com/ladjs/superagent). Maintained for [Forward Email](https://github.com/forwardemail) and [Lad](https://github.com/ladjs). + +## About + +The motivation with this module is to provide a high-level abstraction for testing +HTTP, while still allowing you to drop down to the [lower-level API](https://ladjs.github.io/superagent/) provided by superagent. + +## Getting Started + +Install supertest as an npm module and save it to your package.json file as a development dependency: + +```bash +npm install supertest --save-dev +``` + + Once installed it can now be referenced by simply calling ```require('supertest');``` + +## Example + +You may pass an `http.Server`, or a `Function` to `request()` - if the server is not +already listening for connections then it is bound to an ephemeral port for you so +there is no need to keep track of ports. + +supertest works with any test framework, here is an example without using any +test framework at all: + +```js +const request = require('supertest'); +const express = require('express'); + +const app = express(); + +app.get('/user', function(req, res) { + res.status(200).json({ name: 'john' }); +}); + +request(app) + .get('/user') + .expect('Content-Type', /json/) + .expect('Content-Length', '15') + .expect(200) + .end(function(err, res) { + if (err) throw err; + }); +``` + +To enable http2 protocol, simply append an options to `request` or `request.agent`: + +```js +const request = require('supertest'); +const express = require('express'); + +const app = express(); + +app.get('/user', function(req, res) { + res.status(200).json({ name: 'john' }); +}); + +request(app, { http2: true }) + .get('/user') + .expect('Content-Type', /json/) + .expect('Content-Length', '15') + .expect(200) + .end(function(err, res) { + if (err) throw err; + }); + +request.agent(app, { http2: true }) + .get('/user') + .expect('Content-Type', /json/) + .expect('Content-Length', '15') + .expect(200) + .end(function(err, res) { + if (err) throw err; + }); +``` + +Here's an example with mocha, note how you can pass `done` straight to any of the `.expect()` calls: + +```js +describe('GET /user', function() { + it('responds with json', function(done) { + request(app) + .get('/user') + .set('Accept', 'application/json') + .expect('Content-Type', /json/) + .expect(200, done); + }); +}); +``` + +You can use `auth` method to pass HTTP username and password in the same way as in the [superagent](http://ladjs.github.io/superagent/#authentication): + +```js +describe('GET /user', function() { + it('responds with json', function(done) { + request(app) + .get('/user') + .auth('username', 'password') + .set('Accept', 'application/json') + .expect('Content-Type', /json/) + .expect(200, done); + }); +}); +``` + +One thing to note with the above statement is that superagent now sends any HTTP +error (anything other than a 2XX response code) to the callback as the first argument if +you do not add a status code expect (i.e. `.expect(302)`). + +If you are using the `.end()` method `.expect()` assertions that fail will +not throw - they will return the assertion as an error to the `.end()` callback. In +order to fail the test case, you will need to rethrow or pass `err` to `done()`, as follows: + +```js +describe('POST /users', function() { + it('responds with json', function(done) { + request(app) + .post('/users') + .send({name: 'john'}) + .set('Accept', 'application/json') + .expect('Content-Type', /json/) + .expect(200) + .end(function(err, res) { + if (err) return done(err); + return done(); + }); + }); +}); +``` + +You can also use promises: + +```js +describe('GET /users', function() { + it('responds with json', function() { + return request(app) + .get('/users') + .set('Accept', 'application/json') + .expect('Content-Type', /json/) + .expect(200) + .then(response => { + expect(response.body.email).toEqual('foo@bar.com'); + }) + }); +}); +``` + +Or async/await syntax: + +```js +describe('GET /users', function() { + it('responds with json', async function() { + const response = await request(app) + .get('/users') + .set('Accept', 'application/json') + expect(response.headers["Content-Type"]).toMatch(/json/); + expect(response.status).toEqual(200); + expect(response.body.email).toEqual('foo@bar.com'); + }); +}); +``` + +Expectations are run in the order of definition. This characteristic can be used +to modify the response body or headers before executing an assertion. + +```js +describe('POST /user', function() { + it('user.name should be an case-insensitive match for "john"', function(done) { + request(app) + .post('/user') + .send('name=john') // x-www-form-urlencoded upload + .set('Accept', 'application/json') + .expect(function(res) { + res.body.id = 'some fixed id'; + res.body.name = res.body.name.toLowerCase(); + }) + .expect(200, { + id: 'some fixed id', + name: 'john' + }, done); + }); +}); +``` + +Anything you can do with superagent, you can do with supertest - for example multipart file uploads! + +```js +request(app) + .post('/') + .field('name', 'my awesome avatar') + .field('complex_object', '{"attribute": "value"}', {contentType: 'application/json'}) + .attach('avatar', 'test/fixtures/avatar.jpg') + ... +``` + +Passing the app or url each time is not necessary, if you're testing +the same host you may simply re-assign the request variable with the +initialization app or url, a new `Test` is created per `request.VERB()` call. + +```js +request = request('http://localhost:5555'); + +request.get('/').expect(200, function(err){ + console.log(err); +}); + +request.get('/').expect('heya', function(err){ + console.log(err); +}); +``` + +Here's an example with mocha that shows how to persist a request and its cookies: + +```js +const request = require('supertest'); +const should = require('should'); +const express = require('express'); +const cookieParser = require('cookie-parser'); + +describe('request.agent(app)', function() { + const app = express(); + app.use(cookieParser()); + + app.get('/', function(req, res) { + res.cookie('cookie', 'hey'); + res.send(); + }); + + app.get('/return', function(req, res) { + if (req.cookies.cookie) res.send(req.cookies.cookie); + else res.send(':(') + }); + + const agent = request.agent(app); + + it('should save cookies', function(done) { + agent + .get('/') + .expect('set-cookie', 'cookie=hey; Path=/', done); + }); + + it('should send cookies', function(done) { + agent + .get('/return') + .expect('hey', done); + }); +}); +``` + +There is another example that is introduced by the file [agency.js](https://github.com/ladjs/superagent/blob/master/test/node/agency.js) + +Here is an example where 2 cookies are set on the request. + +```js +agent(app) + .get('/api/content') + .set('Cookie', ['nameOne=valueOne;nameTwo=valueTwo']) + .send() + .expect(200) + .end((err, res) => { + if (err) { + return done(err); + } + expect(res.text).to.be.equal('hey'); + return done(); + }); +``` + +## API + +You may use any [superagent](http://github.com/ladjs/superagent) methods, +including `.write()`, `.pipe()` etc and perform assertions in the `.end()` callback +for lower-level needs. + +### .expect(status[, fn]) + +Assert response `status` code. + +### .expect(status, body[, fn]) + +Assert response `status` code and `body`. + +### .expect(body[, fn]) + +Assert response `body` text with a string, regular expression, or +parsed body object. + +### .expect(field, value[, fn]) + +Assert header `field` `value` with a string or regular expression. + +### .expect(function(res) {}) + +Pass a custom assertion function. It'll be given the response object to check. If the check fails, throw an error. + +```js +request(app) + .get('/') + .expect(hasPreviousAndNextKeys) + .end(done); + +function hasPreviousAndNextKeys(res) { + if (!('next' in res.body)) throw new Error("missing next key"); + if (!('prev' in res.body)) throw new Error("missing prev key"); +} +``` + +### .end(fn) + +Perform the request and invoke `fn(err, res)`. + +## Notes + +Inspired by [api-easy](https://github.com/flatiron/api-easy) minus vows coupling. + +## License + +MIT + +[coverage-badge]: https://img.shields.io/codecov/c/github/ladjs/supertest.svg +[coverage]: https://codecov.io/gh/ladjs/supertest +[travis-badge]: https://travis-ci.org/ladjs/supertest.svg?branch=master +[travis]: https://travis-ci.org/ladjs/supertest +[dependencies-badge]: https://david-dm.org/ladjs/supertest/status.svg +[dependencies]: https://david-dm.org/ladjs/supertest +[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square +[prs]: http://makeapullrequest.com +[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square +[license]: https://github.com/ladjs/supertest/blob/master/LICENSE diff --git a/node_modules/supertest/index.js b/node_modules/supertest/index.js new file mode 100644 index 0000000..f5bbc4b --- /dev/null +++ b/node_modules/supertest/index.js @@ -0,0 +1,61 @@ +'use strict'; + +/** + * Module dependencies. + */ +const methods = require('methods'); +let http2; +try { + http2 = require('http2'); // eslint-disable-line global-require +} catch (_) { + // eslint-disable-line no-empty +} +const Test = require('./lib/test.js'); +const agent = require('./lib/agent.js'); + +/** + * Test against the given `app`, + * returning a new `Test`. + * + * @param {Function|Server|String} app + * @return {Test} + * @api public + */ +module.exports = function(app, options = {}) { + const obj = {}; + + if (typeof app === 'function') { + if (options.http2) { + if (!http2) { + throw new Error( + 'supertest: this version of Node.js does not support http2' + ); + } + } + } + + methods.forEach(function(method) { + obj[method] = function(url) { + var test = new Test(app, method, url, options.http2); + if (options.http2) { + test.http2(); + } + return test; + }; + }); + + // Support previous use of del + obj.del = obj.delete; + + return obj; +}; + +/** + * Expose `Test` + */ +module.exports.Test = Test; + +/** + * Expose the agent function + */ +module.exports.agent = agent; diff --git a/node_modules/supertest/lib/agent.js b/node_modules/supertest/lib/agent.js new file mode 100644 index 0000000..eee7159 --- /dev/null +++ b/node_modules/supertest/lib/agent.js @@ -0,0 +1,100 @@ +'use strict'; + +/** + * Module dependencies. + */ + +const { agent: Agent } = require('superagent'); +const methods = require('methods'); +const http = require('http'); +let http2; +try { + http2 = require('http2'); // eslint-disable-line global-require +} catch (_) { + // eslint-disable-line no-empty +} +const Test = require('./test.js'); + +/** + * Initialize a new `TestAgent`. + * + * @param {Function|Server} app + * @param {Object} options + * @api public + */ + +function TestAgent(app, options = {}) { + if (!(this instanceof TestAgent)) return new TestAgent(app, options); + + const agent = new Agent(options); + Object.assign(this, agent); + + this._options = options; + + if (typeof app === 'function') { + if (options.http2) { + if (!http2) { + throw new Error( + 'supertest: this version of Node.js does not support http2' + ); + } + app = http2.createServer(app); // eslint-disable-line no-param-reassign + } else { + app = http.createServer(app); // eslint-disable-line no-param-reassign + } + } + this.app = app; +} + +/** + * Inherits from `Agent.prototype`. + */ + +Object.setPrototypeOf(TestAgent.prototype, Agent.prototype); + +// Preserve the original query method before overriding HTTP methods +const originalQuery = Agent.prototype.query; + +// set a host name +TestAgent.prototype.host = function(host) { + this._host = host; + return this; +}; + +// override HTTP verb methods +methods.forEach(function(method) { + // Skip 'query' method to prevent overwriting superagent's query functionality + if (method === 'query') { + return; + } + + TestAgent.prototype[method] = function(url, fn) { // eslint-disable-line no-unused-vars + const req = new Test(this.app, method.toUpperCase(), url); + if (this._options.http2) { + req.http2(); + } + + if (this._host) { + req.set('host', this._host); + } + + req.on('response', this._saveCookies.bind(this)); + req.on('redirect', this._saveCookies.bind(this)); + req.on('redirect', this._attachCookies.bind(this, req)); + this._setDefaults(req); + this._attachCookies(req); + + return req; + }; +}); + +// Restore the original query method +TestAgent.prototype.query = originalQuery; + +TestAgent.prototype.del = TestAgent.prototype.delete; + +/** + * Expose `Agent`. + */ + +module.exports = TestAgent; diff --git a/node_modules/supertest/lib/test.js b/node_modules/supertest/lib/test.js new file mode 100644 index 0000000..f830088 --- /dev/null +++ b/node_modules/supertest/lib/test.js @@ -0,0 +1,403 @@ +'use strict'; + +/** + * Module dependencies. + */ + +const { inspect } = require('util'); +const http = require('http'); +const { STATUS_CODES } = require('http'); +const { Server } = require('tls'); +const { deepStrictEqual } = require('assert'); +const { Request } = require('superagent'); +let http2; +try { + http2 = require('http2'); // eslint-disable-line global-require +} catch (_) { + // eslint-disable-line no-empty +} + +/** @typedef {import('superagent').Response} Response */ + +class Test extends Request { + /** + * Initialize a new `Test` with the given `app`, + * request `method` and `path`. + * + * @param {Server} app + * @param {String} method + * @param {String} path + * @api public + */ + constructor (app, method, path, optHttp2) { + super(method.toUpperCase(), path); + + if (typeof app === 'function') { + if (optHttp2) { + app = http2.createServer(app); // eslint-disable-line no-param-reassign + } else { + app = http.createServer(app); // eslint-disable-line no-param-reassign + } + } + + this.redirects(0); + this.buffer(); + this.app = app; + this._asserts = []; + this.url = typeof app === 'string' + ? app + path + : this.serverAddress(app, path); + } + + /** + * Returns a URL, extracted from a server. + * + * @param {Server} app + * @param {String} path + * @returns {String} URL address + * @api private + */ + serverAddress(app, path) { + const addr = app.address(); + + if (!addr) this._server = app.listen(0); + // } else { + // this._server = app; + // } + const port = app.address().port; + const protocol = app instanceof Server ? 'https' : 'http'; + return protocol + '://127.0.0.1:' + port + path; + } + + /** + * Expectations: + * + * .expect(200) + * .expect(200, fn) + * .expect(200, body) + * .expect('Some body') + * .expect('Some body', fn) + * .expect(['json array body', { key: 'val' }]) + * .expect('Content-Type', 'application/json') + * .expect('Content-Type', 'application/json', fn) + * .expect(fn) + * .expect([200, 404]) + * + * @return {Test} + * @api public + */ + expect(a, b, c) { + // callback + if (typeof a === 'function') { + this._asserts.push(wrapAssertFn(a)); + return this; + } + if (typeof b === 'function') this.end(b); + if (typeof c === 'function') this.end(c); + + // status + if (typeof a === 'number') { + this._asserts.push(wrapAssertFn(this._assertStatus.bind(this, a))); + // body + if (typeof b !== 'function' && arguments.length > 1) { + this._asserts.push(wrapAssertFn(this._assertBody.bind(this, b))); + } + return this; + } + + // multiple statuses + if (Array.isArray(a) && a.length > 0 && a.every(val => typeof val === 'number')) { + this._asserts.push(wrapAssertFn(this._assertStatusArray.bind(this, a))); + return this; + } + + // header field + if (typeof b === 'string' || typeof b === 'number' || b instanceof RegExp) { + this._asserts.push(wrapAssertFn(this._assertHeader.bind(this, { name: '' + a, value: b }))); + return this; + } + + // body + this._asserts.push(wrapAssertFn(this._assertBody.bind(this, a))); + + return this; + } + + /** + * Defer invoking superagent's `.end()` until + * the server is listening. + * + * @param {?Function} fn + * @api public + */ + end(fn) { + const server = this._server; + + super.end((err, res) => { + const localAssert = () => { + this.assert(err, res, fn); + }; + + if (server && server._handle) { + // Handle server closing with error handling for already closed servers + return server.close((closeError) => { + // Ignore ERR_SERVER_NOT_RUNNING errors as the server is already closed + if (closeError && closeError.code === 'ERR_SERVER_NOT_RUNNING') { + return localAssert(); + } + // For other errors, pass them through + if (closeError) { + return localAssert(); + } + localAssert(); + }); + } + + localAssert(); + }); + + return this; + } + + /** + * Perform assertions and invoke `fn(err, res)`. + * + * @param {?Error} resError + * @param {Response} res + * @param {Function} fn + * @api private + */ + assert(resError, res, fn) { + let errorObj; + + // check for unexpected network errors or server not running/reachable errors + // when there is no response and superagent sends back a System Error + // do not check further for other asserts, if any, in such case + // https://nodejs.org/api/errors.html#errors_common_system_errors + const sysErrors = { + ECONNREFUSED: 'Connection refused', + ECONNRESET: 'Connection reset by peer', + EPIPE: 'Broken pipe', + ETIMEDOUT: 'Operation timed out' + }; + + if (!res && resError) { + if (resError instanceof Error && resError.syscall === 'connect' + && Object.getOwnPropertyNames(sysErrors).indexOf(resError.code) >= 0) { + errorObj = new Error(resError.code + ': ' + sysErrors[resError.code]); + } else { + errorObj = resError; + } + } + + // asserts + for (let i = 0; i < this._asserts.length && !errorObj; i += 1) { + errorObj = this._assertFunction(this._asserts[i], res); + } + + // set unexpected superagent error if no other error has occurred. + if (!errorObj && resError instanceof Error && (!res || resError.status !== res.status)) { + errorObj = resError; + } + + if (fn) { + fn.call(this, errorObj || null, res); + } + } + + /* + * Adds a set Authorization Bearer + * + * @param {Bearer} Bearer Token + * Shortcut for .set('Authorization', `Bearer ${token}`) + */ + + bearer(token) { + this.set('Authorization', `Bearer ${token}`); + return this; + } + + /* + * Adds a set Authorization Bearer + * + * @param {Bearer} Bearer Token + * Shortcut for .set('Authorization', `Bearer ${token}`) + */ + + bearer(token) { + this.set('Authorization', `Bearer ${token}`); + return this; + } + + /** + * Perform assertions on a response body and return an Error upon failure. + * + * @param {Mixed} body + * @param {Response} res + * @return {?Error} + * @api private + */// eslint-disable-next-line class-methods-use-this + _assertBody(body, res) { + const isRegexp = body instanceof RegExp; + + // parsed + if (typeof body === 'object' && !isRegexp) { + try { + deepStrictEqual(body, res.body); + } catch (err) { + const a = inspect(body); + const b = inspect(res.body); + return error('expected ' + a + ' response body, got ' + b, body, res.body); + } + } else if (body !== res.text) { + // string + const a = inspect(body); + const b = inspect(res.text); + + // regexp + if (isRegexp) { + if (!body.test(res.text)) { + return error('expected body ' + b + ' to match ' + body, body, res.body); + } + } else { + return error('expected ' + a + ' response body, got ' + b, body, res.body); + } + } + } + + /** + * Perform assertions on a response header and return an Error upon failure. + * + * @param {Object} header + * @param {Response} res + * @return {?Error} + * @api private + */// eslint-disable-next-line class-methods-use-this + _assertHeader(header, res) { + const field = header.name; + const actual = res.header[field.toLowerCase()]; + const fieldExpected = header.value; + + if (typeof actual === 'undefined') return new Error('expected "' + field + '" header field'); + // This check handles header values that may be a String or single element Array + if ((Array.isArray(actual) && actual.toString() === fieldExpected) + || fieldExpected === actual) { + return; + } + if (fieldExpected instanceof RegExp) { + if (!fieldExpected.test(actual)) { + return new Error('expected "' + field + '" matching ' + + fieldExpected + ', got "' + actual + '"'); + } + } else { + return new Error('expected "' + field + '" of "' + fieldExpected + '", got "' + actual + '"'); + } + } + + /** + * Perform assertions on the response status and return an Error upon failure. + * + * @param {Number} status + * @param {Response} res + * @return {?Error} + * @api private + */// eslint-disable-next-line class-methods-use-this + _assertStatus(status, res) { + if (res.status !== status) { + const a = STATUS_CODES[status]; + const b = STATUS_CODES[res.status]; + return new Error('expected ' + status + ' "' + a + '", got ' + res.status + ' "' + b + '"'); + } + } + + /** + * Perform assertions on the response status and return an Error upon failure. + * + * @param {Array} statusArray + * @param {Response} res + * @return {?Error} + * @api private + */// eslint-disable-next-line class-methods-use-this + _assertStatusArray(statusArray, res) { + if (!statusArray.includes(res.status)) { + const b = STATUS_CODES[res.status]; + const expectedList = statusArray.join(', '); + return new Error( + 'expected one of "' + expectedList + '", got ' + res.status + ' "' + b + '"' + ); + } + } + + /** + * Performs an assertion by calling a function and return an Error upon failure. + * + * @param {Function} fn + * @param {Response} res + * @return {?Error} + * @api private + */// eslint-disable-next-line class-methods-use-this + _assertFunction(fn, res) { + let err; + try { + err = fn(res); + } catch (e) { + err = e; + } + if (err instanceof Error) return err; + } +} + +/** + * Wraps an assert function into another. + * The wrapper function edit the stack trace of any assertion error, prepending a more useful stack to it. + * + * @param {Function} assertFn + * @returns {Function} wrapped assert function + */ + +function wrapAssertFn(assertFn) { + const savedStack = new Error().stack.split('\n').slice(3); + + return function(res) { + let badStack; + let err; + try { + err = assertFn(res); + } catch (e) { + err = e; + } + if (err instanceof Error && err.stack) { + badStack = err.stack.replace(err.message, '').split('\n').slice(1); + err.stack = [err.toString()] + .concat(savedStack) + .concat('----') + .concat(badStack) + .join('\n'); + } + return err; + }; +} + +/** + * Return an `Error` with `msg` and results properties. + * + * @param {String} msg + * @param {Mixed} expected + * @param {Mixed} actual + * @return {Error} + * @api private + */ + +function error(msg, expected, actual) { + const err = new Error(msg); + err.expected = expected; + err.actual = actual; + err.showDiff = true; + return err; +} + +/** + * Expose `Test`. + */ + +module.exports = Test; diff --git a/node_modules/supertest/package.json b/node_modules/supertest/package.json new file mode 100644 index 0000000..b9c28b7 --- /dev/null +++ b/node_modules/supertest/package.json @@ -0,0 +1,55 @@ +{ + "name": "supertest", + "description": "SuperAgent driven library for testing HTTP servers", + "version": "7.1.4", + "author": "TJ Holowaychuk", + "contributors": [], + "dependencies": { + "methods": "^1.1.2", + "superagent": "^10.2.3" + }, + "devDependencies": { + "@commitlint/cli": "17", + "@commitlint/config-conventional": "17", + "body-parser": "^1.20.3", + "cookie-parser": "^1.4.7", + "eslint": "^8.32.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.27.5", + "express": "^4.18.3", + "mocha": "^10.2.0", + "nock": "^13.3.8", + "nyc": "^15.1.0", + "proxyquire": "^2.1.3", + "should": "^13.2.3" + }, + "engines": { + "node": ">=14.18.0" + }, + "files": [ + "index.js", + "lib" + ], + "keywords": [ + "bdd", + "http", + "request", + "superagent", + "tdd", + "test", + "testing" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/ladjs/supertest.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov > coverage.lcov", + "lint": "eslint lib/**/*.js test/**/*.js index.js", + "lint:fix": "eslint --fix lib/**/*.js test/**/*.js index.js", + "pretest": "npm run lint --if-present", + "test": "nyc --reporter=html --reporter=text mocha --exit --require should --reporter spec --check-leaks" + } +} diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js new file mode 100644 index 0000000..f097aec --- /dev/null +++ b/node_modules/supports-color/browser.js @@ -0,0 +1,24 @@ +/* eslint-env browser */ +'use strict'; + +function getChromeVersion() { + const matches = /(Chrome|Chromium)\/(?\d+)\./.exec(navigator.userAgent); + + if (!matches) { + return; + } + + return Number.parseInt(matches.groups.chromeVersion, 10); +} + +const colorSupport = getChromeVersion() >= 69 ? { + level: 1, + hasBasic: true, + has256: false, + has16m: false +} : false; + +module.exports = { + stdout: colorSupport, + stderr: colorSupport +}; diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js new file mode 100644 index 0000000..2dd2fcb --- /dev/null +++ b/node_modules/supports-color/index.js @@ -0,0 +1,152 @@ +'use strict'; +const os = require('os'); +const tty = require('tty'); +const hasFlag = require('has-flag'); + +const {env} = process; + +let flagForceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false') || + hasFlag('color=never')) { + flagForceColor = 0; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + flagForceColor = 1; +} + +function envForceColor() { + if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + return 1; + } + + if (env.FORCE_COLOR === 'false') { + return 0; + } + + return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== undefined) { + flagForceColor = noFlagForceColor; + } + + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + + if (forceColor === 0) { + return 0; + } + + if (sniffFlags) { + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +function getSupportLevel(stream, options = {}) { + const level = supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options + }); + + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel({isTTY: tty.isatty(1)}), + stderr: getSupportLevel({isTTY: tty.isatty(2)}) +}; diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json new file mode 100644 index 0000000..a97bf2a --- /dev/null +++ b/node_modules/supports-color/package.json @@ -0,0 +1,58 @@ +{ + "name": "supports-color", + "version": "8.1.1", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "funding": "https://github.com/chalk/supports-color?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "exports": { + "node": "./index.js", + "default": "./browser.js" + }, + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "import-fresh": "^3.2.2", + "xo": "^0.35.0" + }, + "browser": "browser.js" +} diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md new file mode 100644 index 0000000..3eedd1c --- /dev/null +++ b/node_modules/supports-color/readme.md @@ -0,0 +1,77 @@ +# supports-color + +> Detect whether a terminal supports color + +## Install + +``` +$ npm install supports-color +``` + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + +### `require('supports-color').supportsColor(stream, options?)` + +Additionally, `supports-color` exposes the `.supportsColor()` function that takes an arbitrary write stream (e.g. `process.stdout`) and an optional options object to (re-)evaluate color support for an arbitrary stream. + +For example, `require('supports-color').stdout` is the equivalent of `require('supports-color').supportsColor(process.stdout)`. + +The options object supports a single boolean property `sniffFlags`. By default it is `true`, which instructs `supportsColor()` to sniff `process.argv` for the multitude of `--color` flags (see _Info_ below). If `false`, then `process.argv` is not considered when determining color support. + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- diff --git a/node_modules/test-exclude/CHANGELOG.md b/node_modules/test-exclude/CHANGELOG.md new file mode 100644 index 0000000..9fb9ce0 --- /dev/null +++ b/node_modules/test-exclude/CHANGELOG.md @@ -0,0 +1,352 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [6.0.0](https://github.com/istanbuljs/test-exclude/compare/v6.0.0-alpha.3...v6.0.0) (2019-12-20) + + +### Features + +* Version bump only ([#41](https://github.com/istanbuljs/test-exclude/issues/41)) ([5708a16](https://github.com/istanbuljs/test-exclude/commit/5708a16cfc80dfec8fcf7a8a70c13278df0a91ba)) + +## [6.0.0-alpha.3](https://github.com/istanbuljs/test-exclude/compare/v6.0.0-alhpa.3...v6.0.0-alpha.3) (2019-12-09) + +## [6.0.0-alhpa.3](https://github.com/istanbuljs/test-exclude/compare/v6.0.0-alpha.2...v6.0.0-alhpa.3) (2019-12-08) + + +### Bug Fixes + +* Ignore options that are explicitly set undefined. ([#40](https://github.com/istanbuljs/test-exclude/issues/40)) ([b57e936](https://github.com/istanbuljs/test-exclude/commit/b57e9368aacdd548981ffd2ab6447bbd2c1e7de0)) + +## [6.0.0-alpha.2](https://github.com/istanbuljs/test-exclude/compare/v6.0.0-alpha.1...v6.0.0-alpha.2) (2019-12-07) + + +### ⚠ BREAKING CHANGES + +* `test-exclude` now exports a class so it is necessary +to use `new TestExclude()` when creating an instance. + +### Bug Fixes + +* Directly export class, document API. ([#39](https://github.com/istanbuljs/test-exclude/issues/39)) ([3acc196](https://github.com/istanbuljs/test-exclude/commit/3acc196482e03be734effd110aa83a4e78d3ebde)), closes [#33](https://github.com/istanbuljs/test-exclude/issues/33) +* Pull default settings from @istanbuljs/schema ([#38](https://github.com/istanbuljs/test-exclude/issues/38)) ([ffca696](https://github.com/istanbuljs/test-exclude/commit/ffca6968175c9030cebf018fb86d2c0386a61620)) + +## [6.0.0-alpha.1](https://github.com/istanbuljs/test-exclude/compare/v6.0.0-alpha.0...v6.0.0-alpha.1) (2019-09-24) + + +### Features + +* Add async glob function ([#30](https://github.com/istanbuljs/test-exclude/issues/30)) ([e45ac10](https://github.com/istanbuljs/test-exclude/commit/e45ac10)) + +# [6.0.0-alpha.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.3...test-exclude@6.0.0-alpha.0) (2019-06-19) + + +### Bug Fixes + +* **win32:** Detect files on different drive as outside project ([#422](https://github.com/istanbuljs/istanbuljs/issues/422)) ([5b4ee88](https://github.com/istanbuljs/istanbuljs/commit/5b4ee88)), closes [#418](https://github.com/istanbuljs/istanbuljs/issues/418) +* Ignore tests matching *.cjs, *.mjs and *.ts by default ([#381](https://github.com/istanbuljs/istanbuljs/issues/381)) ([0f077c2](https://github.com/istanbuljs/istanbuljs/commit/0f077c2)) + + +### Features + +* ignore files under test**s** directories by default ([#419](https://github.com/istanbuljs/istanbuljs/issues/419)) ([8ad5fd2](https://github.com/istanbuljs/istanbuljs/commit/8ad5fd2)) +* Remove configuration loading functionality ([#398](https://github.com/istanbuljs/istanbuljs/issues/398)) ([f5c93c3](https://github.com/istanbuljs/istanbuljs/commit/f5c93c3)), closes [#392](https://github.com/istanbuljs/istanbuljs/issues/392) +* Update dependencies, require Node.js 8 ([#401](https://github.com/istanbuljs/istanbuljs/issues/401)) ([bf3a539](https://github.com/istanbuljs/istanbuljs/commit/bf3a539)) + + +### BREAKING CHANGES + +* Node.js 8 is now required +* Remove configuration loading functionality + + + + + +## [5.2.3](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.2...test-exclude@5.2.3) (2019-04-24) + +**Note:** Version bump only for package test-exclude + + + + + +## [5.2.2](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.1...test-exclude@5.2.2) (2019-04-09) + +**Note:** Version bump only for package test-exclude + + + + + +## [5.2.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.2.0...test-exclude@5.2.1) (2019-04-03) + + +### Bug Fixes + +* Remove `**/node_modules/**` from defaultExclude. ([#351](https://github.com/istanbuljs/istanbuljs/issues/351)) ([deb3963](https://github.com/istanbuljs/istanbuljs/commit/deb3963)), closes [#347](https://github.com/istanbuljs/istanbuljs/issues/347) + + + + + +# [5.2.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.1.0...test-exclude@5.2.0) (2019-03-12) + + +### Features + +* Add TestExclude.globSync to find all files ([#309](https://github.com/istanbuljs/istanbuljs/issues/309)) ([2d7ea72](https://github.com/istanbuljs/istanbuljs/commit/2d7ea72)) +* Support turning of node_modules default exclude via flag ([#213](https://github.com/istanbuljs/istanbuljs/issues/213)) ([9b4b34c](https://github.com/istanbuljs/istanbuljs/commit/9b4b34c)) + + + + + +# [5.1.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.0.1...test-exclude@5.1.0) (2019-01-26) + + +### Features + +* Ignore babel.config.js. ([#279](https://github.com/istanbuljs/istanbuljs/issues/279)) ([24af6eb](https://github.com/istanbuljs/istanbuljs/commit/24af6eb)) + + + + + + +## [5.0.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@5.0.0...test-exclude@5.0.1) (2018-12-25) + + + + +**Note:** Version bump only for package test-exclude + + +# [5.0.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.2.2...test-exclude@5.0.0) (2018-06-26) + + +* test-exclude: bump read-pkg-up dependency (#184) ([bb58139](https://github.com/istanbuljs/istanbuljs/commit/bb58139)), closes [#184](https://github.com/istanbuljs/istanbuljs/issues/184) + + +### BREAKING CHANGES + +* Support for Node.js 4.x is dropped. + + + + + +## [4.2.2](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.2.1...test-exclude@4.2.2) (2018-06-06) + + + + +**Note:** Version bump only for package test-exclude + + +## [4.2.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.2.0...test-exclude@4.2.1) (2018-03-04) + + +### Bug Fixes + +* upgrade micromatch ([#142](https://github.com/istanbuljs/istanbuljs/issues/142)) ([24104a7](https://github.com/istanbuljs/istanbuljs/commit/24104a7)) + + + + + +# [4.2.0](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.1.1...test-exclude@4.2.0) (2018-02-13) + + +### Features + +* add additional patterns to default excludes ([#133](https://github.com/istanbuljs/istanbuljs/issues/133)) ([4cedf63](https://github.com/istanbuljs/istanbuljs/commit/4cedf63)) + + + + + +## [4.1.1](https://github.com/istanbuljs/istanbuljs/compare/test-exclude@4.1.0...test-exclude@4.1.1) (2017-05-27) + + +### Bug Fixes + +* add more general support for negated exclude rules ([#58](https://github.com/istanbuljs/istanbuljs/issues/58)) ([08445db](https://github.com/istanbuljs/istanbuljs/commit/08445db)) + + + + + +# [4.1.0](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.3...test-exclude@4.1.0) (2017-04-29) + + +### Features + +* add possibility to filter coverage maps when running reports post-hoc ([#24](https://github.com/istanbuljs/istanbuljs/issues/24)) ([e1c99d6](https://github.com/istanbuljs/test-exclude/commit/e1c99d6)) + + + + + +## [4.0.3](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.2...test-exclude@4.0.3) (2017-03-21) + + +## [4.0.2](https://github.com/istanbuljs/test-exclude/compare/test-exclude@4.0.0...test-exclude@4.0.2) (2017-03-21) + + +# [4.0.0](https://github.com/istanbuljs/test-exclude/compare/v3.3.0...v4.0.0) (2017-01-19) + + +### Features + +* add coverage to default excludes ([#23](https://github.com/istanbuljs/test-exclude/issues/23)) ([59e8bbf](https://github.com/istanbuljs/test-exclude/commit/59e8bbf)) + + +### BREAKING CHANGES + +* additional coverage folder is now excluded + + + + +# [3.3.0](https://github.com/istanbuljs/test-exclude/compare/v3.2.2...v3.3.0) (2016-11-22) + + +### Features + +* allow include/exclude rules to be a string rather than array ([#22](https://github.com/istanbuljs/test-exclude/issues/22)) ([f8f99c6](https://github.com/istanbuljs/test-exclude/commit/f8f99c6)) + + + + +## [3.2.2](https://github.com/istanbuljs/test-exclude/compare/v3.2.1...v3.2.2) (2016-11-14) + + +### Bug Fixes + +* we no longer need to add node_modules/** rule ([d0cfbc3](https://github.com/istanbuljs/test-exclude/commit/d0cfbc3)) + + + + +## [3.2.1](https://github.com/istanbuljs/test-exclude/compare/v3.2.0...v3.2.1) (2016-11-14) + + +### Bug Fixes + +* fix bug matching files in root, introduced by dotfiles setting ([27b249c](https://github.com/istanbuljs/test-exclude/commit/27b249c)) + + + + +# [3.2.0](https://github.com/istanbuljs/test-exclude/compare/v3.1.0...v3.2.0) (2016-11-14) + + +### Features + +* adds *.test.*.js exclude rule ([#20](https://github.com/istanbuljs/test-exclude/issues/20)) ([34f5cba](https://github.com/istanbuljs/test-exclude/commit/34f5cba)) + + + + +# [3.1.0](https://github.com/istanbuljs/test-exclude/compare/v3.0.0...v3.1.0) (2016-11-14) + + +### Features + +* we now support dot folders ([f2c1598](https://github.com/istanbuljs/test-exclude/commit/f2c1598)) + + + + +# [3.0.0](https://github.com/istanbuljs/test-exclude/compare/v2.1.3...v3.0.0) (2016-11-13) + + +### Features + +* always exclude node_modules ([#18](https://github.com/istanbuljs/test-exclude/issues/18)) ([b86d144](https://github.com/istanbuljs/test-exclude/commit/b86d144)) + + +### BREAKING CHANGES + +* `**/node_modules/**` is again added by default, but can be counteracted with `!**/node_modules/**`. + + + + +## [2.1.3](https://github.com/istanbuljs/test-exclude/compare/v2.1.2...v2.1.3) (2016-09-30) + + +### Bug Fixes + +* switch lodash.assign to object-assign ([#16](https://github.com/istanbuljs/test-exclude/issues/16)) ([45a5488](https://github.com/istanbuljs/test-exclude/commit/45a5488)) + + + + +## [2.1.2](https://github.com/istanbuljs/test-exclude/compare/v2.1.1...v2.1.2) (2016-08-31) + + +### Bug Fixes + +* **exclude-config:** Use the defaultExcludes for anything passed in that is not an array ([#15](https://github.com/istanbuljs/test-exclude/issues/15)) ([227042f](https://github.com/istanbuljs/test-exclude/commit/227042f)) + + + + +# [2.1.1](https://github.com/istanbuljs/test-exclude/compare/v2.1.0...v2.1.1) (2016-08-12) + + +### Bug Fixes + +* it should be possible to cover the node_modules folder ([#13](https://github.com/istanbuljs/test-exclude/issues/13)) ([09f2788](https://github.com/istanbuljs/test-exclude/commit/09f2788)) + + + +# [2.1.0](https://github.com/istanbuljs/test-exclude/compare/v2.0.0...v2.1.0) (2016-08-12) + + +### Features + +* export defaultExclude, so that it can be used in yargs' default settings ([#12](https://github.com/istanbuljs/test-exclude/issues/12)) ([5b3743b](https://github.com/istanbuljs/test-exclude/commit/5b3743b)) + + + + +# [2.0.0](https://github.com/istanbuljs/test-exclude/compare/v1.1.0...v2.0.0) (2016-08-12) + + +### Bug Fixes + +* use Array#reduce and remove unneeded branch in prepGlobPatterns ([#5](https://github.com/istanbuljs/test-exclude/issues/5)) ([c0f0f59](https://github.com/istanbuljs/test-exclude/commit/c0f0f59)) + + +### Features + +* don't exclude anything when empty array passed ([#11](https://github.com/istanbuljs/test-exclude/issues/11)) ([200ec07](https://github.com/istanbuljs/test-exclude/commit/200ec07)) + + +### BREAKING CHANGES + +* we now allow an empty array to be passed in, making it possible to disable the default exclude rules -- we will need to be mindful when pulling this logic into nyc. + + + + +# [1.1.0](https://github.com/bcoe/test-exclude/compare/v1.0.0...v1.1.0) (2016-06-08) + + +### Features + +* set configFound if we find a configuration key in package.json ([#2](https://github.com/bcoe/test-exclude/issues/2)) ([64da7b9](https://github.com/bcoe/test-exclude/commit/64da7b9)) + + + + +# 1.0.0 (2016-06-06) + + +### Features + +* initial commit, pulled over some of the functionality from nyc ([3f1fce3](https://github.com/bcoe/test-exclude/commit/3f1fce3)) +* you can now load include/exclude logic from a package.json stanza ([#1](https://github.com/bcoe/test-exclude/issues/1)) ([29b543d](https://github.com/bcoe/test-exclude/commit/29b543d)) diff --git a/node_modules/test-exclude/LICENSE.txt b/node_modules/test-exclude/LICENSE.txt new file mode 100644 index 0000000..836440b --- /dev/null +++ b/node_modules/test-exclude/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/test-exclude/README.md b/node_modules/test-exclude/README.md new file mode 100644 index 0000000..190783d --- /dev/null +++ b/node_modules/test-exclude/README.md @@ -0,0 +1,96 @@ +# test-exclude + +The file include/exclude logic used by [nyc] and [babel-plugin-istanbul]. + +[![Build Status](https://travis-ci.org/istanbuljs/test-exclude.svg)](https://travis-ci.org/istanbuljs/test-exclude) +[![Coverage Status](https://coveralls.io/repos/github/istanbuljs/test-exclude/badge.svg?branch=master)](https://coveralls.io/github/istanbuljs/test-exclude?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) +[![Greenkeeper badge](https://badges.greenkeeper.io/istanbuljs/test-exclude.svg)](https://greenkeeper.io/) + +## Usage + +```js +const TestExclude = require('test-exclude'); +const exclude = new TestExclude(); +if (exclude().shouldInstrument('./foo.js')) { + // let's instrument this file for test coverage! +} +``` + +### TestExclude(options) + +The test-exclude constructor accepts an options object. The defaults are taken from +[@istanbuljs/schema]. + +#### options.cwd + +This is the base directory by which all comparisons are performed. Files outside `cwd` +are not included. + +Default: `process.cwd()` + +#### options.exclude + +Array of path globs to be ignored. Note this list does not include `node_modules` which +is added separately. See [@istanbuljs/schema/default-excludes.js] for default list. + +#### options.excludeNodeModules + +By default `node_modules` is excluded. Setting this option `true` allows `node_modules` +to be included. + +#### options.include + +Array of path globs that can be included. By default this is unrestricted giving a result +similar to `['**']` but more optimized. + +#### options.extension + +Array of extensions that can be included. This ensures that nyc only attempts to process +files which it might understand. Note use of some formats may require adding parser +plugins to your nyc or babel configuration. + +Default: `['.js', '.cjs', '.mjs', '.ts', '.tsx', '.jsx']` + +### TestExclude#shouldInstrument(filename): boolean + +Test if `filename` matches the rules of this test-exclude instance. + +```js +const exclude = new TestExclude(); +exclude.shouldInstrument('index.js'); // true +exclude.shouldInstrument('test.js'); // false +exclude.shouldInstrument('README.md'); // false +exclude.shouldInstrument('node_modules/test-exclude/index.js'); // false +``` + +In this example code: +* `index.js` is true because it matches the default `options.extension` list + and is not part of the default `options.exclude` list. +* `test.js` is excluded because it matches the default `options.exclude` list. +* `README.md` is not matched by the default `options.extension` +* `node_modules/test-exclude/index.js` is excluded because `options.excludeNodeModules` + is true by default. + +### TestExculde#globSync(cwd = options.cwd): Array[string] + +This synchronously retrieves a list of files within `cwd` which should be instrumented. +Note that setting `cwd` to a parent of `options.cwd` is ineffective, this argument can +only be used to further restrict the result. + +### TestExclude#glob(cwd = options.cwd): Promise + +This function does the same as `TestExclude#globSync` but does so asynchronously. The +Promise resolves to an Array of strings. + + +## `test-exclude` for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `test-exclude` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-test-exclude?utm_source=npm-test-exclude&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +[nyc]: https://github.com/istanbuljs/nyc +[babel-plugin-istanbul]: https://github.com/istanbuljs/babel-plugin-istanbul +[@istanbuljs/schema]: https://github.com/istanbuljs/schema +[@istanbuljs/schema/default-excludes.js]: https://github.com/istanbuljs/schema/blob/master/default-exclude.js diff --git a/node_modules/test-exclude/index.js b/node_modules/test-exclude/index.js new file mode 100644 index 0000000..aecb72d --- /dev/null +++ b/node_modules/test-exclude/index.js @@ -0,0 +1,161 @@ +'use strict'; + +const path = require('path'); +const { promisify } = require('util'); +const glob = promisify(require('glob')); +const minimatch = require('minimatch'); +const { defaults } = require('@istanbuljs/schema'); +const isOutsideDir = require('./is-outside-dir'); + +class TestExclude { + constructor(opts = {}) { + Object.assign( + this, + {relativePath: true}, + defaults.testExclude + ); + + for (const [name, value] of Object.entries(opts)) { + if (value !== undefined) { + this[name] = value; + } + } + + if (typeof this.include === 'string') { + this.include = [this.include]; + } + + if (typeof this.exclude === 'string') { + this.exclude = [this.exclude]; + } + + if (typeof this.extension === 'string') { + this.extension = [this.extension]; + } else if (this.extension.length === 0) { + this.extension = false; + } + + if (this.include && this.include.length > 0) { + this.include = prepGlobPatterns([].concat(this.include)); + } else { + this.include = false; + } + + if ( + this.excludeNodeModules && + !this.exclude.includes('**/node_modules/**') + ) { + this.exclude = this.exclude.concat('**/node_modules/**'); + } + + this.exclude = prepGlobPatterns([].concat(this.exclude)); + + this.handleNegation(); + } + + /* handle the special case of negative globs + * (!**foo/bar); we create a new this.excludeNegated set + * of rules, which is applied after excludes and we + * move excluded include rules into this.excludes. + */ + handleNegation() { + const noNeg = e => e.charAt(0) !== '!'; + const onlyNeg = e => e.charAt(0) === '!'; + const stripNeg = e => e.slice(1); + + if (Array.isArray(this.include)) { + const includeNegated = this.include.filter(onlyNeg).map(stripNeg); + this.exclude.push(...prepGlobPatterns(includeNegated)); + this.include = this.include.filter(noNeg); + } + + this.excludeNegated = this.exclude.filter(onlyNeg).map(stripNeg); + this.exclude = this.exclude.filter(noNeg); + this.excludeNegated = prepGlobPatterns(this.excludeNegated); + } + + shouldInstrument(filename, relFile) { + if ( + this.extension && + !this.extension.some(ext => filename.endsWith(ext)) + ) { + return false; + } + + let pathToCheck = filename; + + if (this.relativePath) { + relFile = relFile || path.relative(this.cwd, filename); + + // Don't instrument files that are outside of the current working directory. + if (isOutsideDir(this.cwd, filename)) { + return false; + } + + pathToCheck = relFile.replace(/^\.[\\/]/, ''); // remove leading './' or '.\'. + } + + const dot = { dot: true }; + const matches = pattern => minimatch(pathToCheck, pattern, dot); + return ( + (!this.include || this.include.some(matches)) && + (!this.exclude.some(matches) || this.excludeNegated.some(matches)) + ); + } + + globSync(cwd = this.cwd) { + const globPatterns = getExtensionPattern(this.extension || []); + const globOptions = { cwd, nodir: true, dot: true }; + /* If we don't have any excludeNegated then we can optimize glob by telling + * it to not iterate into unwanted directory trees (like node_modules). */ + if (this.excludeNegated.length === 0) { + globOptions.ignore = this.exclude; + } + + return glob + .sync(globPatterns, globOptions) + .filter(file => this.shouldInstrument(path.resolve(cwd, file))); + } + + async glob(cwd = this.cwd) { + const globPatterns = getExtensionPattern(this.extension || []); + const globOptions = { cwd, nodir: true, dot: true }; + /* If we don't have any excludeNegated then we can optimize glob by telling + * it to not iterate into unwanted directory trees (like node_modules). */ + if (this.excludeNegated.length === 0) { + globOptions.ignore = this.exclude; + } + + const list = await glob(globPatterns, globOptions); + return list.filter(file => this.shouldInstrument(path.resolve(cwd, file))); + } +} + +function prepGlobPatterns(patterns) { + return patterns.reduce((result, pattern) => { + // Allow gitignore style of directory exclusion + if (!/\/\*\*$/.test(pattern)) { + result = result.concat(pattern.replace(/\/$/, '') + '/**'); + } + + // Any rules of the form **/foo.js, should also match foo.js. + if (/^\*\*\//.test(pattern)) { + result = result.concat(pattern.replace(/^\*\*\//, '')); + } + + return result.concat(pattern); + }, []); +} + +function getExtensionPattern(extension) { + switch (extension.length) { + case 0: + return '**'; + case 1: + return `**/*${extension[0]}`; + default: + return `**/*{${extension.join()}}`; + } +} + +module.exports = TestExclude; diff --git a/node_modules/test-exclude/is-outside-dir-posix.js b/node_modules/test-exclude/is-outside-dir-posix.js new file mode 100644 index 0000000..d6a7275 --- /dev/null +++ b/node_modules/test-exclude/is-outside-dir-posix.js @@ -0,0 +1,7 @@ +'use strict'; + +const path = require('path'); + +module.exports = function(dir, filename) { + return /^\.\./.test(path.relative(dir, filename)); +}; diff --git a/node_modules/test-exclude/is-outside-dir-win32.js b/node_modules/test-exclude/is-outside-dir-win32.js new file mode 100644 index 0000000..05e34a9 --- /dev/null +++ b/node_modules/test-exclude/is-outside-dir-win32.js @@ -0,0 +1,10 @@ +'use strict'; + +const path = require('path'); +const minimatch = require('minimatch'); + +const dot = { dot: true }; + +module.exports = function(dir, filename) { + return !minimatch(path.resolve(dir, filename), path.join(dir, '**'), dot); +}; diff --git a/node_modules/test-exclude/is-outside-dir.js b/node_modules/test-exclude/is-outside-dir.js new file mode 100644 index 0000000..c86a915 --- /dev/null +++ b/node_modules/test-exclude/is-outside-dir.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.platform === 'win32') { + module.exports = require('./is-outside-dir-win32'); +} else { + module.exports = require('./is-outside-dir-posix'); +} diff --git a/node_modules/test-exclude/node_modules/brace-expansion/LICENSE b/node_modules/test-exclude/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000..de32266 --- /dev/null +++ b/node_modules/test-exclude/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/test-exclude/node_modules/brace-expansion/README.md b/node_modules/test-exclude/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..6b4e0e1 --- /dev/null +++ b/node_modules/test-exclude/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/test-exclude/node_modules/brace-expansion/index.js b/node_modules/test-exclude/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..bd19fe6 --- /dev/null +++ b/node_modules/test-exclude/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/node_modules/test-exclude/node_modules/brace-expansion/package.json b/node_modules/test-exclude/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..3447888 --- /dev/null +++ b/node_modules/test-exclude/node_modules/brace-expansion/package.json @@ -0,0 +1,50 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.12", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh", + "bench": "matcha test/perf/bench.js" + }, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "publishConfig": { + "tag": "1.x" + } +} diff --git a/node_modules/test-exclude/node_modules/glob/LICENSE b/node_modules/test-exclude/node_modules/glob/LICENSE new file mode 100644 index 0000000..42ca266 --- /dev/null +++ b/node_modules/test-exclude/node_modules/glob/LICENSE @@ -0,0 +1,21 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +## Glob Logo + +Glob's logo created by Tanya Brassie , licensed +under a Creative Commons Attribution-ShareAlike 4.0 International License +https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/node_modules/test-exclude/node_modules/glob/README.md b/node_modules/test-exclude/node_modules/glob/README.md new file mode 100644 index 0000000..83f0c83 --- /dev/null +++ b/node_modules/test-exclude/node_modules/glob/README.md @@ -0,0 +1,378 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![a fun cartoon logo made of glob characters](logo/glob.png) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) +* `absolute` Set to true to always receive absolute paths for matched + files. Unlike `realpath`, this also affects the values returned in + the `match` event. +* `fs` File-system object with Node's `fs` API. By default, the built-in + `fs` module will be used. Set to a volume provided by a library like + `memfs` to avoid using the "real" file-system. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Glob Logo +Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). + +The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` + +![](oh-my-glob.gif) diff --git a/node_modules/test-exclude/node_modules/glob/common.js b/node_modules/test-exclude/node_modules/glob/common.js new file mode 100644 index 0000000..424c46e --- /dev/null +++ b/node_modules/test-exclude/node_modules/glob/common.js @@ -0,0 +1,238 @@ +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var fs = require("fs") +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasort (a, b) { + return a.localeCompare(b, 'en') +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + // always treat \ in patterns as escapes, not path separators + options.allowWindowsEscape = false + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/node_modules/test-exclude/node_modules/glob/glob.js b/node_modules/test-exclude/node_modules/glob/glob.js new file mode 100644 index 0000000..37a4d7e --- /dev/null +++ b/node_modules/test-exclude/node_modules/glob/glob.js @@ -0,0 +1,790 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + this._processing = 0 + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + self.fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} diff --git a/node_modules/test-exclude/node_modules/glob/package.json b/node_modules/test-exclude/node_modules/glob/package.json new file mode 100644 index 0000000..5940b64 --- /dev/null +++ b/node_modules/test-exclude/node_modules/glob/package.json @@ -0,0 +1,55 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "name": "glob", + "description": "a little globber", + "version": "7.2.3", + "publishConfig": { + "tag": "v7-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "memfs": "^3.2.0", + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^15.0.6", + "tick": "0.0.6" + }, + "tap": { + "before": "test/00-setup.js", + "after": "test/zz-cleanup.js", + "jobs": 1 + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } +} diff --git a/node_modules/test-exclude/node_modules/glob/sync.js b/node_modules/test-exclude/node_modules/glob/sync.js new file mode 100644 index 0000000..2c4f480 --- /dev/null +++ b/node_modules/test-exclude/node_modules/glob/sync.js @@ -0,0 +1,486 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert.ok(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert.ok(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || + isAbsolute(pattern.map(function (p) { + return typeof p === 'string' ? p : '[*]' + }).join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/node_modules/test-exclude/node_modules/minimatch/LICENSE b/node_modules/test-exclude/node_modules/minimatch/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/test-exclude/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/test-exclude/node_modules/minimatch/README.md b/node_modules/test-exclude/node_modules/minimatch/README.md new file mode 100644 index 0000000..33ede1d --- /dev/null +++ b/node_modules/test-exclude/node_modules/minimatch/README.md @@ -0,0 +1,230 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://travis-ci.org/isaacs/minimatch.svg?branch=master)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### allowWindowsEscape + +Windows path separator `\` is by default converted to `/`, which +prohibits the usage of `\` as a escape character. This flag skips that +behavior and allows using the escape character. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/test-exclude/node_modules/minimatch/minimatch.js b/node_modules/test-exclude/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..fda45ad --- /dev/null +++ b/node_modules/test-exclude/node_modules/minimatch/minimatch.js @@ -0,0 +1,947 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = (function () { try { return require('path') } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + assertValidPattern(pattern) + + if (!options) options = {} + + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/test-exclude/node_modules/minimatch/package.json b/node_modules/test-exclude/node_modules/minimatch/package.json new file mode 100644 index 0000000..566efdf --- /dev/null +++ b/node_modules/test-exclude/node_modules/minimatch/package.json @@ -0,0 +1,33 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "devDependencies": { + "tap": "^15.1.6" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ] +} diff --git a/node_modules/test-exclude/package.json b/node_modules/test-exclude/package.json new file mode 100644 index 0000000..e3185f5 --- /dev/null +++ b/node_modules/test-exclude/package.json @@ -0,0 +1,45 @@ +{ + "name": "test-exclude", + "version": "6.0.0", + "description": "test for inclusion or exclusion of paths using globs", + "main": "index.js", + "files": [ + "*.js", + "!nyc.config.js" + ], + "scripts": { + "release": "standard-version", + "test": "nyc tap", + "snap": "npm test -- --snapshot" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/istanbuljs/test-exclude.git" + }, + "keywords": [ + "exclude", + "include", + "glob", + "package", + "config" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/istanbuljs/test-exclude/issues" + }, + "homepage": "https://istanbul.js.org/", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "devDependencies": { + "nyc": "^15.0.0-beta.3", + "standard-version": "^7.0.0", + "tap": "^14.10.5" + }, + "engines": { + "node": ">=8" + } +} diff --git a/node_modules/thenify-all/History.md b/node_modules/thenify-all/History.md new file mode 100644 index 0000000..16e378c --- /dev/null +++ b/node_modules/thenify-all/History.md @@ -0,0 +1,11 @@ + +1.6.0 / 2015-01-11 +================== + + * feat: exports thenify + * support node 0.8+ + +1.5.0 / 2015-01-09 +================== + + * feat: support backward compatible with callback diff --git a/node_modules/thenify-all/LICENSE b/node_modules/thenify-all/LICENSE new file mode 100644 index 0000000..a7ae8ee --- /dev/null +++ b/node_modules/thenify-all/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/thenify-all/README.md b/node_modules/thenify-all/README.md new file mode 100644 index 0000000..8e7829e --- /dev/null +++ b/node_modules/thenify-all/README.md @@ -0,0 +1,66 @@ + +# thenify-all + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Dependency Status][david-image]][david-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] +[![Gittip][gittip-image]][gittip-url] + +Promisifies all the selected functions in an object. + +```js +var thenifyAll = require('thenify-all'); + +var fs = thenifyAll(require('fs'), {}, [ + 'readFile', + 'writeFile', +]); + +fs.readFile(__filename).then(function (buffer) { + console.log(buffer.toString()); +}); +``` + +## API + +### var obj = thenifyAll(source, [obj], [methods]) + +Promisifies all the selected functions in an object. + +- `source` - the source object for the async functions +- `obj` - the destination to set all the promisified methods +- `methods` - an array of method names of `source` + +### var obj = thenifyAll.withCallback(source, [obj], [methods]) + +Promisifies all the selected functions in an object and backward compatible with callback. + +- `source` - the source object for the async functions +- `obj` - the destination to set all the promisified methods +- `methods` - an array of method names of `source` + +### thenifyAll.thenify + +Exports [thenify](https://github.com/thenables/thenify) this package uses. + +[gitter-image]: https://badges.gitter.im/thenables/thenify-all.png +[gitter-url]: https://gitter.im/thenables/thenify-all +[npm-image]: https://img.shields.io/npm/v/thenify-all.svg?style=flat-square +[npm-url]: https://npmjs.org/package/thenify-all +[github-tag]: http://img.shields.io/github/tag/thenables/thenify-all.svg?style=flat-square +[github-url]: https://github.com/thenables/thenify-all/tags +[travis-image]: https://img.shields.io/travis/thenables/thenify-all.svg?style=flat-square +[travis-url]: https://travis-ci.org/thenables/thenify-all +[coveralls-image]: https://img.shields.io/coveralls/thenables/thenify-all.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/thenables/thenify-all +[david-image]: http://img.shields.io/david/thenables/thenify-all.svg?style=flat-square +[david-url]: https://david-dm.org/thenables/thenify-all +[license-image]: http://img.shields.io/npm/l/thenify-all.svg?style=flat-square +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/thenify-all.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/thenify-all +[gittip-image]: https://img.shields.io/gratipay/jonathanong.svg?style=flat-square +[gittip-url]: https://gratipay.com/jonathanong/ diff --git a/node_modules/thenify-all/index.js b/node_modules/thenify-all/index.js new file mode 100644 index 0000000..e0cc69c --- /dev/null +++ b/node_modules/thenify-all/index.js @@ -0,0 +1,73 @@ + +var thenify = require('thenify') + +module.exports = thenifyAll +thenifyAll.withCallback = withCallback +thenifyAll.thenify = thenify + +/** + * Promisifies all the selected functions in an object. + * + * @param {Object} source the source object for the async functions + * @param {Object} [destination] the destination to set all the promisified methods + * @param {Array} [methods] an array of method names of `source` + * @return {Object} + * @api public + */ + +function thenifyAll(source, destination, methods) { + return promisifyAll(source, destination, methods, thenify) +} + +/** + * Promisifies all the selected functions in an object and backward compatible with callback. + * + * @param {Object} source the source object for the async functions + * @param {Object} [destination] the destination to set all the promisified methods + * @param {Array} [methods] an array of method names of `source` + * @return {Object} + * @api public + */ + +function withCallback(source, destination, methods) { + return promisifyAll(source, destination, methods, thenify.withCallback) +} + +function promisifyAll(source, destination, methods, promisify) { + if (!destination) { + destination = {}; + methods = Object.keys(source) + } + + if (Array.isArray(destination)) { + methods = destination + destination = {} + } + + if (!methods) { + methods = Object.keys(source) + } + + if (typeof source === 'function') destination = promisify(source) + + methods.forEach(function (name) { + // promisify only if it's a function + if (typeof source[name] === 'function') destination[name] = promisify(source[name]) + }) + + // proxy the rest + Object.keys(source).forEach(function (name) { + if (deprecated(source, name)) return + if (destination[name]) return + destination[name] = source[name] + }) + + return destination +} + +function deprecated(source, name) { + var desc = Object.getOwnPropertyDescriptor(source, name) + if (!desc || !desc.get) return false + if (desc.get.name === 'deprecated') return true + return false +} diff --git a/node_modules/thenify-all/package.json b/node_modules/thenify-all/package.json new file mode 100644 index 0000000..768800f --- /dev/null +++ b/node_modules/thenify-all/package.json @@ -0,0 +1,34 @@ +{ + "name": "thenify-all", + "description": "Promisifies all the selected functions in an object", + "version": "1.6.0", + "author": "Jonathan Ong (http://jongleberry.com)", + "license": "MIT", + "repository": "thenables/thenify-all", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "devDependencies": { + "bluebird": "2", + "istanbul": "0", + "mocha": "2" + }, + "scripts": { + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/.bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter dot" + }, + "keywords": [ + "promisify", + "promise", + "thenify", + "then", + "es6" + ], + "files": [ + "index.js" + ], + "engines": { + "node": ">=0.8" + } +} diff --git a/node_modules/thenify/History.md b/node_modules/thenify/History.md new file mode 100644 index 0000000..9f016fb --- /dev/null +++ b/node_modules/thenify/History.md @@ -0,0 +1,11 @@ + +3.3.1 / 2020-06-18 +================== + +**fixes** + * [[`0d94a24`](http://github.com/thenables/thenify/commit/0d94a24eb933bc835d568f3009f4d269c4c4c17a)] - fix: remove eval (#30) (Yiyu He <>) + +3.3.0 / 2017-05-19 +================== + + * feat: support options.multiArgs and options.withCallback (#27) diff --git a/node_modules/thenify/LICENSE b/node_modules/thenify/LICENSE new file mode 100644 index 0000000..bed701c --- /dev/null +++ b/node_modules/thenify/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/thenify/README.md b/node_modules/thenify/README.md new file mode 100644 index 0000000..3afce3e --- /dev/null +++ b/node_modules/thenify/README.md @@ -0,0 +1,120 @@ + +# thenify + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Dependency Status][david-image]][david-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +Promisify a callback-based function using [`any-promise`](https://github.com/kevinbeaty/any-promise). + +- Preserves function names +- Uses a native promise implementation if available and tries to fall back to a promise implementation such as `bluebird` +- Converts multiple arguments from the callback into an `Array`, also support change the behavior by `options.multiArgs` +- Resulting function never deoptimizes +- Supports both callback and promise style + +An added benefit is that `throw`n errors in that async function will be caught by the promise! + +## API + +### fn = thenify(fn, options) + +Promisifies a function. + +### Options + +`options` are optional. + +- `options.withCallback` - support both callback and promise style, default to `false`. +- `options.multiArgs` - change the behavior when callback have multiple arguments. default to `true`. + - `true` - converts multiple arguments to an array + - `false`- always use the first argument + - `Array` - converts multiple arguments to an object with keys provided in `options.multiArgs` + +- Turn async functions into promises + +```js +var thenify = require('thenify'); + +var somethingAsync = thenify(function somethingAsync(a, b, c, callback) { + callback(null, a, b, c); +}); +``` + +- Backward compatible with callback + +```js +var thenify = require('thenify'); + +var somethingAsync = thenify(function somethingAsync(a, b, c, callback) { + callback(null, a, b, c); +}, { withCallback: true }); + +// somethingAsync(a, b, c).then(onFulfilled).catch(onRejected); +// somethingAsync(a, b, c, function () {}); +``` + +or use `thenify.withCallback()` + +```js +var thenify = require('thenify').withCallback; + +var somethingAsync = thenify(function somethingAsync(a, b, c, callback) { + callback(null, a, b, c); +}); + +// somethingAsync(a, b, c).then(onFulfilled).catch(onRejected); +// somethingAsync(a, b, c, function () {}); +``` + +- Always return the first argument in callback + +```js +var thenify = require('thenify'); + +var promise = thenify(function (callback) { + callback(null, 1, 2, 3); +}, { multiArgs: false }); + +// promise().then(function onFulfilled(value) { +// assert.equal(value, 1); +// }); +``` + +- Converts callback arguments to an object + +```js +var thenify = require('thenify'); + +var promise = thenify(function (callback) { + callback(null, 1, 2, 3); +}, { multiArgs: [ 'one', 'tow', 'three' ] }); + +// promise().then(function onFulfilled(value) { +// assert.deepEqual(value, { +// one: 1, +// tow: 2, +// three: 3 +// }); +// }); +``` + +[gitter-image]: https://badges.gitter.im/thenables/thenify.png +[gitter-url]: https://gitter.im/thenables/thenify +[npm-image]: https://img.shields.io/npm/v/thenify.svg?style=flat-square +[npm-url]: https://npmjs.org/package/thenify +[github-tag]: http://img.shields.io/github/tag/thenables/thenify.svg?style=flat-square +[github-url]: https://github.com/thenables/thenify/tags +[travis-image]: https://img.shields.io/travis/thenables/thenify.svg?style=flat-square +[travis-url]: https://travis-ci.org/thenables/thenify +[coveralls-image]: https://img.shields.io/coveralls/thenables/thenify.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/thenables/thenify +[david-image]: http://img.shields.io/david/thenables/thenify.svg?style=flat-square +[david-url]: https://david-dm.org/thenables/thenify +[license-image]: http://img.shields.io/npm/l/thenify.svg?style=flat-square +[license-url]: LICENSE +[downloads-image]: http://img.shields.io/npm/dm/thenify.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/thenify diff --git a/node_modules/thenify/index.js b/node_modules/thenify/index.js new file mode 100644 index 0000000..d633174 --- /dev/null +++ b/node_modules/thenify/index.js @@ -0,0 +1,77 @@ + +var Promise = require('any-promise') +var assert = require('assert') + +module.exports = thenify + +/** + * Turn async functions into promises + * + * @param {Function} fn + * @return {Function} + * @api public + */ + +function thenify(fn, options) { + assert(typeof fn === 'function') + return createWrapper(fn, options) +} + +/** + * Turn async functions into promises and backward compatible with callback + * + * @param {Function} fn + * @return {Function} + * @api public + */ + +thenify.withCallback = function (fn, options) { + assert(typeof fn === 'function') + options = options || {} + options.withCallback = true + return createWrapper(fn, options) +} + +function createCallback(resolve, reject, multiArgs) { + // default to true + if (multiArgs === undefined) multiArgs = true + return function(err, value) { + if (err) return reject(err) + var length = arguments.length + + if (length <= 2 || !multiArgs) return resolve(value) + + if (Array.isArray(multiArgs)) { + var values = {} + for (var i = 1; i < length; i++) values[multiArgs[i - 1]] = arguments[i] + return resolve(values) + } + + var values = new Array(length - 1) + for (var i = 1; i < length; ++i) values[i - 1] = arguments[i] + resolve(values) + } +} + +function createWrapper(fn, options) { + options = options || {} + var name = fn.name; + name = (name || '').replace(/\s|bound(?!$)/g, '') + var newFn = function () { + var self = this + var len = arguments.length + if (options.withCallback) { + var lastType = typeof arguments[len - 1] + if (lastType === 'function') return fn.apply(self, arguments) + } + var args = new Array(len + 1) + for (var i = 0; i < len; ++i) args[i] = arguments[i] + var lastIndex = i + return new Promise(function (resolve, reject) { + args[lastIndex] = createCallback(resolve, reject, options.multiArgs) + fn.apply(self, args) + }) + } + Object.defineProperty(newFn, 'name', { value: name }) + return newFn +} diff --git a/node_modules/thenify/package.json b/node_modules/thenify/package.json new file mode 100644 index 0000000..addf77e --- /dev/null +++ b/node_modules/thenify/package.json @@ -0,0 +1,31 @@ +{ + "name": "thenify", + "description": "Promisify a callback-based function", + "version": "3.3.1", + "author": "Jonathan Ong (http://jongleberry.com)", + "license": "MIT", + "repository": "thenables/thenify", + "dependencies": { + "any-promise": "^1.0.0" + }, + "devDependencies": { + "bluebird": "^3.1.1", + "istanbul": "^0.4.0", + "mocha": "^3.0.2" + }, + "scripts": { + "test": "mocha --reporter spec", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" + }, + "keywords": [ + "promisify", + "promise", + "thenify", + "then", + "es6" + ], + "files": [ + "index.js" + ] +} diff --git a/node_modules/through/.travis.yml b/node_modules/through/.travis.yml new file mode 100644 index 0000000..c693a93 --- /dev/null +++ b/node_modules/through/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - 0.6 + - 0.8 + - "0.10" diff --git a/node_modules/through/LICENSE.APACHE2 b/node_modules/through/LICENSE.APACHE2 new file mode 100644 index 0000000..6366c04 --- /dev/null +++ b/node_modules/through/LICENSE.APACHE2 @@ -0,0 +1,15 @@ +Apache License, Version 2.0 + +Copyright (c) 2011 Dominic Tarr + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/through/LICENSE.MIT b/node_modules/through/LICENSE.MIT new file mode 100644 index 0000000..6eafbd7 --- /dev/null +++ b/node_modules/through/LICENSE.MIT @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2011 Dominic Tarr + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/through/index.js b/node_modules/through/index.js new file mode 100644 index 0000000..ca5fc59 --- /dev/null +++ b/node_modules/through/index.js @@ -0,0 +1,108 @@ +var Stream = require('stream') + +// through +// +// a stream that does nothing but re-emit the input. +// useful for aggregating a series of changing but not ending streams into one stream) + +exports = module.exports = through +through.through = through + +//create a readable writable stream. + +function through (write, end, opts) { + write = write || function (data) { this.queue(data) } + end = end || function () { this.queue(null) } + + var ended = false, destroyed = false, buffer = [], _ended = false + var stream = new Stream() + stream.readable = stream.writable = true + stream.paused = false + +// stream.autoPause = !(opts && opts.autoPause === false) + stream.autoDestroy = !(opts && opts.autoDestroy === false) + + stream.write = function (data) { + write.call(this, data) + return !stream.paused + } + + function drain() { + while(buffer.length && !stream.paused) { + var data = buffer.shift() + if(null === data) + return stream.emit('end') + else + stream.emit('data', data) + } + } + + stream.queue = stream.push = function (data) { +// console.error(ended) + if(_ended) return stream + if(data === null) _ended = true + buffer.push(data) + drain() + return stream + } + + //this will be registered as the first 'end' listener + //must call destroy next tick, to make sure we're after any + //stream piped from here. + //this is only a problem if end is not emitted synchronously. + //a nicer way to do this is to make sure this is the last listener for 'end' + + stream.on('end', function () { + stream.readable = false + if(!stream.writable && stream.autoDestroy) + process.nextTick(function () { + stream.destroy() + }) + }) + + function _end () { + stream.writable = false + end.call(stream) + if(!stream.readable && stream.autoDestroy) + stream.destroy() + } + + stream.end = function (data) { + if(ended) return + ended = true + if(arguments.length) stream.write(data) + _end() // will emit or queue + return stream + } + + stream.destroy = function () { + if(destroyed) return + destroyed = true + ended = true + buffer.length = 0 + stream.writable = stream.readable = false + stream.emit('close') + return stream + } + + stream.pause = function () { + if(stream.paused) return + stream.paused = true + return stream + } + + stream.resume = function () { + if(stream.paused) { + stream.paused = false + stream.emit('resume') + } + drain() + //may have become paused again, + //as drain emits 'data'. + if(!stream.paused) + stream.emit('drain') + return stream + } + return stream +} + diff --git a/node_modules/through/package.json b/node_modules/through/package.json new file mode 100644 index 0000000..9862189 --- /dev/null +++ b/node_modules/through/package.json @@ -0,0 +1,36 @@ +{ + "name": "through", + "version": "2.3.8", + "description": "simplified stream construction", + "main": "index.js", + "scripts": { + "test": "set -e; for t in test/*.js; do node $t; done" + }, + "devDependencies": { + "stream-spec": "~0.3.5", + "tape": "~2.3.2", + "from": "~0.1.3" + }, + "keywords": [ + "stream", + "streams", + "user-streams", + "pipe" + ], + "author": "Dominic Tarr (dominictarr.com)", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/dominictarr/through.git" + }, + "homepage": "https://github.com/dominictarr/through", + "testling": { + "browsers": [ + "ie/8..latest", + "ff/15..latest", + "chrome/20..latest", + "safari/5.1..latest" + ], + "files": "test/*.js" + } +} diff --git a/node_modules/through/readme.markdown b/node_modules/through/readme.markdown new file mode 100644 index 0000000..cb34c81 --- /dev/null +++ b/node_modules/through/readme.markdown @@ -0,0 +1,64 @@ +#through + +[![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through) +[![testling badge](https://ci.testling.com/dominictarr/through.png)](https://ci.testling.com/dominictarr/through) + +Easy way to create a `Stream` that is both `readable` and `writable`. + +* Pass in optional `write` and `end` methods. +* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`. +* Use `this.pause()` and `this.resume()` to manage flow. +* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`). + +This function is the basis for most of the synchronous streams in +[event-stream](http://github.com/dominictarr/event-stream). + +``` js +var through = require('through') + +through(function write(data) { + this.queue(data) //data *must* not be null + }, + function end () { //optional + this.queue(null) + }) +``` + +Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`, +and this.emit('end') + +``` js +var through = require('through') + +through(function write(data) { + this.emit('data', data) + //this.pause() + }, + function end () { //optional + this.emit('end') + }) +``` + +## Extended Options + +You will probably not need these 99% of the time. + +### autoDestroy=false + +By default, `through` emits close when the writable +and readable side of the stream has ended. +If that is not desired, set `autoDestroy=false`. + +``` js +var through = require('through') + +//like this +var ts = through(write, end, {autoDestroy: false}) +//or like this +var ts = through(write, end) +ts.autoDestroy = false +``` + +## License + +MIT / Apache2 diff --git a/node_modules/through/test/async.js b/node_modules/through/test/async.js new file mode 100644 index 0000000..46bdbae --- /dev/null +++ b/node_modules/through/test/async.js @@ -0,0 +1,28 @@ +var from = require('from') +var through = require('../') + +var tape = require('tape') + +tape('simple async example', function (t) { + + var n = 0, expected = [1,2,3,4,5], actual = [] + from(expected) + .pipe(through(function(data) { + this.pause() + n ++ + setTimeout(function(){ + console.log('pushing data', data) + this.push(data) + this.resume() + }.bind(this), 300) + })).pipe(through(function(data) { + console.log('pushing data second time', data); + this.push(data) + })).on('data', function (d) { + actual.push(d) + }).on('end', function() { + t.deepEqual(actual, expected) + t.end() + }) + +}) diff --git a/node_modules/through/test/auto-destroy.js b/node_modules/through/test/auto-destroy.js new file mode 100644 index 0000000..9a8fd00 --- /dev/null +++ b/node_modules/through/test/auto-destroy.js @@ -0,0 +1,30 @@ +var test = require('tape') +var through = require('../') + +// must emit end before close. + +test('end before close', function (assert) { + var ts = through() + ts.autoDestroy = false + var ended = false, closed = false + + ts.on('end', function () { + assert.ok(!closed) + ended = true + }) + ts.on('close', function () { + assert.ok(ended) + closed = true + }) + + ts.write(1) + ts.write(2) + ts.write(3) + ts.end() + assert.ok(ended) + assert.notOk(closed) + ts.destroy() + assert.ok(closed) + assert.end() +}) + diff --git a/node_modules/through/test/buffering.js b/node_modules/through/test/buffering.js new file mode 100644 index 0000000..b0084bf --- /dev/null +++ b/node_modules/through/test/buffering.js @@ -0,0 +1,71 @@ +var test = require('tape') +var through = require('../') + +// must emit end before close. + +test('buffering', function(assert) { + var ts = through(function (data) { + this.queue(data) + }, function () { + this.queue(null) + }) + + var ended = false, actual = [] + + ts.on('data', actual.push.bind(actual)) + ts.on('end', function () { + ended = true + }) + + ts.write(1) + ts.write(2) + ts.write(3) + assert.deepEqual(actual, [1, 2, 3]) + ts.pause() + ts.write(4) + ts.write(5) + ts.write(6) + assert.deepEqual(actual, [1, 2, 3]) + ts.resume() + assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]) + ts.pause() + ts.end() + assert.ok(!ended) + ts.resume() + assert.ok(ended) + assert.end() +}) + +test('buffering has data in queue, when ends', function (assert) { + + /* + * If stream ends while paused with data in the queue, + * stream should still emit end after all data is written + * on resume. + */ + + var ts = through(function (data) { + this.queue(data) + }, function () { + this.queue(null) + }) + + var ended = false, actual = [] + + ts.on('data', actual.push.bind(actual)) + ts.on('end', function () { + ended = true + }) + + ts.pause() + ts.write(1) + ts.write(2) + ts.write(3) + ts.end() + assert.deepEqual(actual, [], 'no data written yet, still paused') + assert.ok(!ended, 'end not emitted yet, still paused') + ts.resume() + assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered') + assert.ok(ended, 'end should be emitted once all data was delivered') + assert.end(); +}) diff --git a/node_modules/through/test/end.js b/node_modules/through/test/end.js new file mode 100644 index 0000000..fa113f5 --- /dev/null +++ b/node_modules/through/test/end.js @@ -0,0 +1,45 @@ +var test = require('tape') +var through = require('../') + +// must emit end before close. + +test('end before close', function (assert) { + var ts = through() + var ended = false, closed = false + + ts.on('end', function () { + assert.ok(!closed) + ended = true + }) + ts.on('close', function () { + assert.ok(ended) + closed = true + }) + + ts.write(1) + ts.write(2) + ts.write(3) + ts.end() + assert.ok(ended) + assert.ok(closed) + assert.end() +}) + +test('end only once', function (t) { + + var ts = through() + var ended = false, closed = false + + ts.on('end', function () { + t.equal(ended, false) + ended = true + }) + + ts.queue(null) + ts.queue(null) + ts.queue(null) + + ts.resume() + + t.end() +}) diff --git a/node_modules/through/test/index.js b/node_modules/through/test/index.js new file mode 100644 index 0000000..96da82f --- /dev/null +++ b/node_modules/through/test/index.js @@ -0,0 +1,133 @@ + +var test = require('tape') +var spec = require('stream-spec') +var through = require('../') + +/* + I'm using these two functions, and not streams and pipe + so there is less to break. if this test fails it must be + the implementation of _through_ +*/ + +function write(array, stream) { + array = array.slice() + function next() { + while(array.length) + if(stream.write(array.shift()) === false) + return stream.once('drain', next) + + stream.end() + } + + next() +} + +function read(stream, callback) { + var actual = [] + stream.on('data', function (data) { + actual.push(data) + }) + stream.once('end', function () { + callback(null, actual) + }) + stream.once('error', function (err) { + callback(err) + }) +} + +test('simple defaults', function(assert) { + + var l = 1000 + , expected = [] + + while(l--) expected.push(l * Math.random()) + + var t = through() + var s = spec(t).through().pausable() + + read(t, function (err, actual) { + assert.ifError(err) + assert.deepEqual(actual, expected) + assert.end() + }) + + t.on('close', s.validate) + + write(expected, t) +}); + +test('simple functions', function(assert) { + + var l = 1000 + , expected = [] + + while(l--) expected.push(l * Math.random()) + + var t = through(function (data) { + this.emit('data', data*2) + }) + var s = spec(t).through().pausable() + + + read(t, function (err, actual) { + assert.ifError(err) + assert.deepEqual(actual, expected.map(function (data) { + return data*2 + })) + assert.end() + }) + + t.on('close', s.validate) + + write(expected, t) +}) + +test('pauses', function(assert) { + + var l = 1000 + , expected = [] + + while(l--) expected.push(l) //Math.random()) + + var t = through() + + var s = spec(t) + .through() + .pausable() + + t.on('data', function () { + if(Math.random() > 0.1) return + t.pause() + process.nextTick(function () { + t.resume() + }) + }) + + read(t, function (err, actual) { + assert.ifError(err) + assert.deepEqual(actual, expected) + }) + + t.on('close', function () { + s.validate() + assert.end() + }) + + write(expected, t) +}) + +test('does not soft-end on `undefined`', function(assert) { + var stream = through() + , count = 0 + + stream.on('data', function (data) { + count++ + }) + + stream.write(undefined) + stream.write(undefined) + + assert.equal(count, 2) + + assert.end() +}) diff --git a/node_modules/to-arraybuffer/.npmignore b/node_modules/to-arraybuffer/.npmignore new file mode 100644 index 0000000..6c3df58 --- /dev/null +++ b/node_modules/to-arraybuffer/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +node_modules +npm-debug.log +.zuulrc diff --git a/node_modules/to-arraybuffer/.travis.yml b/node_modules/to-arraybuffer/.travis.yml new file mode 100644 index 0000000..3428b14 --- /dev/null +++ b/node_modules/to-arraybuffer/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "4.1" \ No newline at end of file diff --git a/node_modules/to-arraybuffer/.zuul.yml b/node_modules/to-arraybuffer/.zuul.yml new file mode 100644 index 0000000..7e60601 --- /dev/null +++ b/node_modules/to-arraybuffer/.zuul.yml @@ -0,0 +1,16 @@ +ui: tape +browsers: + - name: chrome + version: 39..latest + - name: firefox + version: 34..latest + - name: safari + version: 5..latest + - name: ie + version: 10..latest + - name: opera + version: 11..latest + - name: iphone + version: 5.1..latest + - name: android + version: 4.0..latest \ No newline at end of file diff --git a/node_modules/to-arraybuffer/LICENSE b/node_modules/to-arraybuffer/LICENSE new file mode 100644 index 0000000..1e936da --- /dev/null +++ b/node_modules/to-arraybuffer/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2016 John Hiesey + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/to-arraybuffer/README.md b/node_modules/to-arraybuffer/README.md new file mode 100644 index 0000000..6bdef26 --- /dev/null +++ b/node_modules/to-arraybuffer/README.md @@ -0,0 +1,27 @@ +# to-arraybuffer [![Build Status](https://travis-ci.org/jhiesey/to-arraybuffer.svg?branch=master)](https://travis-ci.org/jhiesey/to-arraybuffer) + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/to-arraybuffer.svg)](https://saucelabs.com/u/to-arraybuffer) + +Convert from a Buffer to an ArrayBuffer as fast as possible. + +Note that in some cases the returned ArrayBuffer is backed by the same memory as the original +Buffer (but in other cases it is a copy), so **modifying the ArrayBuffer is not recommended**. + +This module is designed to work both in node.js and in all browsers with ArrayBuffer support +when using [the Buffer implementation provided by Browserify](https://www.npmjs.com/package/buffer). + +## Usage + +``` js +var toArrayBuffer = require('to-arraybuffer') + +var buffer = new Buffer(100) +// Fill the buffer with some data + +var ab = toArrayBuffer(buffer) +// `ab` now contains the same data as `buffer` +``` + +## License + +MIT \ No newline at end of file diff --git a/node_modules/to-arraybuffer/index.js b/node_modules/to-arraybuffer/index.js new file mode 100644 index 0000000..2f69ae0 --- /dev/null +++ b/node_modules/to-arraybuffer/index.js @@ -0,0 +1,27 @@ +var Buffer = require('buffer').Buffer + +module.exports = function (buf) { + // If the buffer is backed by a Uint8Array, a faster version will work + if (buf instanceof Uint8Array) { + // If the buffer isn't a subarray, return the underlying ArrayBuffer + if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) { + return buf.buffer + } else if (typeof buf.buffer.slice === 'function') { + // Otherwise we need to get a proper copy + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength) + } + } + + if (Buffer.isBuffer(buf)) { + // This is the slow version that will work with any Buffer + // implementation (even in old browsers) + var arrayCopy = new Uint8Array(buf.length) + var len = buf.length + for (var i = 0; i < len; i++) { + arrayCopy[i] = buf[i] + } + return arrayCopy.buffer + } else { + throw new Error('Argument must be a Buffer') + } +} diff --git a/node_modules/to-arraybuffer/package.json b/node_modules/to-arraybuffer/package.json new file mode 100644 index 0000000..fbfe6c0 --- /dev/null +++ b/node_modules/to-arraybuffer/package.json @@ -0,0 +1,34 @@ +{ + "name": "to-arraybuffer", + "version": "1.0.1", + "description": "Get an ArrayBuffer from a Buffer as fast as possible", + "main": "index.js", + "scripts": { + "test": "npm run test-node && ([ -n \"${TRAVIS_PULL_REQUEST}\" -a \"${TRAVIS_PULL_REQUEST}\" != 'false' ] || npm run test-browser)", + "test-node": "tape test.js", + "test-browser": "zuul --no-coverage -- test.js", + "test-browser-local": "zuul --local 8080 --no-coverage -- test.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/jhiesey/to-arraybuffer.git" + }, + "keywords": [ + "buffer", + "to", + "arraybuffer", + "fast", + "read", + "only" + ], + "author": "John Hiesey", + "license": "MIT", + "bugs": { + "url": "https://github.com/jhiesey/to-arraybuffer/issues" + }, + "homepage": "https://github.com/jhiesey/to-arraybuffer#readme", + "devDependencies": { + "tape": "^4.4.0", + "zuul": "^3.9.0" + } +} diff --git a/node_modules/to-arraybuffer/test.js b/node_modules/to-arraybuffer/test.js new file mode 100644 index 0000000..1814ae3 --- /dev/null +++ b/node_modules/to-arraybuffer/test.js @@ -0,0 +1,57 @@ +var Buffer = require('buffer').Buffer +var test = require('tape') + +var toArrayBuffer = require('.') + +function elementsEqual (ab, buffer) { + var view = new Uint8Array(ab) + for (var i = 0; i < view.length; i++) { + if (view[i] !== buffer[i]) { + return false + } + } + return true +} + +test('Basic behavior', function (t) { + var buf = new Buffer(10) + for (var i = 0; i < 10; i++) { + buf[i] = i + } + + var ab = toArrayBuffer(buf) + + t.equals(ab.byteLength, 10, 'correct length') + t.ok(elementsEqual(ab, buf), 'elements equal') + t.end() +}) + +test('Behavior when input is a subarray 1', function (t) { + var origBuf = new Buffer(10) + for (var i = 0; i < 10; i++) { + origBuf[i] = i + } + var buf = origBuf.slice(1) + + var ab = toArrayBuffer(buf) + + t.equals(ab.byteLength, 9, 'correct length') + t.ok(elementsEqual(ab, buf), 'elements equal') + t.notOk(ab === buf.buffer, 'the underlying ArrayBuffer is not returned when incorrect') + t.end() +}) + +test('Behavior when input is a subarray 2', function (t) { + var origBuf = new Buffer(10) + for (var i = 0; i < 10; i++) { + origBuf[i] = i + } + var buf = origBuf.slice(0, 9) + + var ab = toArrayBuffer(buf) + + t.equals(ab.byteLength, 9, 'correct length') + t.ok(elementsEqual(ab, buf), 'elements equal') + t.notOk(ab === buf.buffer, 'the underlying ArrayBuffer is not returned when incorrect') + t.end() +}) diff --git a/node_modules/toidentifier/HISTORY.md b/node_modules/toidentifier/HISTORY.md new file mode 100644 index 0000000..cb7cc89 --- /dev/null +++ b/node_modules/toidentifier/HISTORY.md @@ -0,0 +1,9 @@ +1.0.1 / 2021-11-14 +================== + + * pref: enable strict mode + +1.0.0 / 2018-07-09 +================== + + * Initial release diff --git a/node_modules/toidentifier/LICENSE b/node_modules/toidentifier/LICENSE new file mode 100644 index 0000000..de22d15 --- /dev/null +++ b/node_modules/toidentifier/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/toidentifier/README.md b/node_modules/toidentifier/README.md new file mode 100644 index 0000000..57e8a78 --- /dev/null +++ b/node_modules/toidentifier/README.md @@ -0,0 +1,61 @@ +# toidentifier + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][codecov-image]][codecov-url] + +> Convert a string of words to a JavaScript identifier + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install toidentifier +``` + +## Example + +```js +var toIdentifier = require('toidentifier') + +console.log(toIdentifier('Bad Request')) +// => "BadRequest" +``` + +## API + +This CommonJS module exports a single default function: `toIdentifier`. + +### toIdentifier(string) + +Given a string as the argument, it will be transformed according to +the following rules and the new string will be returned: + +1. Split into words separated by space characters (`0x20`). +2. Upper case the first character of each word. +3. Join the words together with no separator. +4. Remove all non-word (`[0-9a-z_]`) characters. + +## License + +[MIT](LICENSE) + +[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg +[codecov-url]: https://codecov.io/gh/component/toidentifier +[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg +[downloads-url]: https://npmjs.org/package/toidentifier +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci +[github-actions-ci-url]: https://github.com/component/toidentifier?query=workflow%3Aci +[npm-image]: https://img.shields.io/npm/v/toidentifier.svg +[npm-url]: https://npmjs.org/package/toidentifier + + +## + +[npm]: https://www.npmjs.com/ + +[yarn]: https://yarnpkg.com/ diff --git a/node_modules/toidentifier/index.js b/node_modules/toidentifier/index.js new file mode 100644 index 0000000..9295d02 --- /dev/null +++ b/node_modules/toidentifier/index.js @@ -0,0 +1,32 @@ +/*! + * toidentifier + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = toIdentifier + +/** + * Trasform the given string into a JavaScript identifier + * + * @param {string} str + * @returns {string} + * @public + */ + +function toIdentifier (str) { + return str + .split(' ') + .map(function (token) { + return token.slice(0, 1).toUpperCase() + token.slice(1) + }) + .join('') + .replace(/[^ _0-9a-z]/gi, '') +} diff --git a/node_modules/toidentifier/package.json b/node_modules/toidentifier/package.json new file mode 100644 index 0000000..42db1a6 --- /dev/null +++ b/node_modules/toidentifier/package.json @@ -0,0 +1,38 @@ +{ + "name": "toidentifier", + "description": "Convert a string of words to a JavaScript identifier", + "version": "1.0.1", + "author": "Douglas Christopher Wilson ", + "contributors": [ + "Douglas Christopher Wilson ", + "Nick Baugh (http://niftylettuce.com/)" + ], + "repository": "component/toidentifier", + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.3", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.1.3", + "nyc": "15.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "license": "MIT", + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/type-detect/LICENSE b/node_modules/type-detect/LICENSE new file mode 100644 index 0000000..7ea799f --- /dev/null +++ b/node_modules/type-detect/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2013 Jake Luer (http://alogicalparadox.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/type-detect/README.md b/node_modules/type-detect/README.md new file mode 100644 index 0000000..d2c4cb7 --- /dev/null +++ b/node_modules/type-detect/README.md @@ -0,0 +1,228 @@ +

+ + ChaiJS type-detect + +

+
+

+ Improved typeof detection for node and the browser. +

+ +

+ + license:mit + + + tag:? + + + build:? + + + coverage:? + + + npm:? + + + dependencies:? + + + devDependencies:? + +
+ + + + + + + + + + + + + + +
Supported Browsers
Chrome Edge Firefox Safari IE
9, 10, 11
+
+ + Join the Slack chat + + + Join the Gitter chat + +

+ +## What is Type-Detect? + +Type Detect is a module which you can use to detect the type of a given object. It returns a string representation of the object's type, either using [`typeof`](http://www.ecma-international.org/ecma-262/6.0/index.html#sec-typeof-operator) or [`@@toStringTag`](http://www.ecma-international.org/ecma-262/6.0/index.html#sec-symbol.tostringtag). It also normalizes some object names for consistency among browsers. + +## Why? + +The `typeof` operator will only specify primitive values; everything else is `"object"` (including `null`, arrays, regexps, etc). Many developers use `Object.prototype.toString()` - which is a fine alternative and returns many more types (null returns `[object Null]`, Arrays as `[object Array]`, regexps as `[object RegExp]` etc). + +Sadly, `Object.prototype.toString` is slow, and buggy. By slow - we mean it is slower than `typeof`. By buggy - we mean that some values (like Promises, the global object, iterators, dataviews, a bunch of HTML elements) all report different things in different browsers. + +`type-detect` fixes all of the shortcomings with `Object.prototype.toString`. We have extra code to speed up checks of JS and DOM objects, as much as 20-30x faster for some values. `type-detect` also fixes any consistencies with these objects. + +## Installation + +### Node.js + +`type-detect` is available on [npm](http://npmjs.org). To install it, type: + + $ npm install type-detect + +### Browsers + +You can also use it within the browser; install via npm and use the `type-detect.js` file found within the download. For example: + +```html + +``` + +## Usage + +The primary export of `type-detect` is function that can serve as a replacement for `typeof`. The results of this function will be more specific than that of native `typeof`. + +```js +var type = require('type-detect'); +``` + +#### array + +```js +assert(type([]) === 'Array'); +assert(type(new Array()) === 'Array'); +``` + +#### regexp + +```js +assert(type(/a-z/gi) === 'RegExp'); +assert(type(new RegExp('a-z')) === 'RegExp'); +``` + +#### function + +```js +assert(type(function () {}) === 'function'); +``` + +#### arguments + +```js +(function () { + assert(type(arguments) === 'Arguments'); +})(); +``` + +#### date + +```js +assert(type(new Date) === 'Date'); +``` + +#### number + +```js +assert(type(1) === 'number'); +assert(type(1.234) === 'number'); +assert(type(-1) === 'number'); +assert(type(-1.234) === 'number'); +assert(type(Infinity) === 'number'); +assert(type(NaN) === 'number'); +assert(type(new Number(1)) === 'Number'); // note - the object version has a capital N +``` + +#### string + +```js +assert(type('hello world') === 'string'); +assert(type(new String('hello')) === 'String'); // note - the object version has a capital S +``` + +#### null + +```js +assert(type(null) === 'null'); +assert(type(undefined) !== 'null'); +``` + +#### undefined + +```js +assert(type(undefined) === 'undefined'); +assert(type(null) !== 'undefined'); +``` + +#### object + +```js +var Noop = function () {}; +assert(type({}) === 'Object'); +assert(type(Noop) !== 'Object'); +assert(type(new Noop) === 'Object'); +assert(type(new Object) === 'Object'); +``` + +#### ECMA6 Types + +All new ECMAScript 2015 objects are also supported, such as Promises and Symbols: + +```js +assert(type(new Map() === 'Map'); +assert(type(new WeakMap()) === 'WeakMap'); +assert(type(new Set()) === 'Set'); +assert(type(new WeakSet()) === 'WeakSet'); +assert(type(Symbol()) === 'symbol'); +assert(type(new Promise(callback) === 'Promise'); +assert(type(new Int8Array()) === 'Int8Array'); +assert(type(new Uint8Array()) === 'Uint8Array'); +assert(type(new UInt8ClampedArray()) === 'Uint8ClampedArray'); +assert(type(new Int16Array()) === 'Int16Array'); +assert(type(new Uint16Array()) === 'Uint16Array'); +assert(type(new Int32Array()) === 'Int32Array'); +assert(type(new UInt32Array()) === 'Uint32Array'); +assert(type(new Float32Array()) === 'Float32Array'); +assert(type(new Float64Array()) === 'Float64Array'); +assert(type(new ArrayBuffer()) === 'ArrayBuffer'); +assert(type(new DataView(arrayBuffer)) === 'DataView'); +``` + +Also, if you use `Symbol.toStringTag` to change an Objects return value of the `toString()` Method, `type()` will return this value, e.g: + +```js +var myObject = {}; +myObject[Symbol.toStringTag] = 'myCustomType'; +assert(type(myObject) === 'myCustomType'); +``` diff --git a/node_modules/type-detect/index.js b/node_modules/type-detect/index.js new file mode 100644 index 0000000..98a1e03 --- /dev/null +++ b/node_modules/type-detect/index.js @@ -0,0 +1,378 @@ +/* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */ +const promiseExists = typeof Promise === 'function'; + +/* eslint-disable no-undef */ +const globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist + +const symbolExists = typeof Symbol !== 'undefined'; +const mapExists = typeof Map !== 'undefined'; +const setExists = typeof Set !== 'undefined'; +const weakMapExists = typeof WeakMap !== 'undefined'; +const weakSetExists = typeof WeakSet !== 'undefined'; +const dataViewExists = typeof DataView !== 'undefined'; +const symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; +const symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; +const setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; +const mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; +const setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); +const mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); +const arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; +const arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); +const stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; +const stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); +const toStringLeftSliceLength = 8; +const toStringRightSliceLength = -1; +/** + * ### typeOf (obj) + * + * Uses `Object.prototype.toString` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */ +export default function typeDetect(obj) { + /* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */ + const typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + + /* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */ + if (obj === null) { + return 'null'; + } + + /* ! Spec Conformance + * Test: `Object.prototype.toString.call(window)`` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: `Object.prototype.toString.call(this)`` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */ + if (obj === globalObject) { + return 'global'; + } + + /* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */ + if ( + Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj)) + ) { + return 'Array'; + } + + // Not caching existence of `window` and related properties due to potential + // for `window` to be unset before tests in quasi-browser environments. + if (typeof window === 'object' && window !== null) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The `Location` interface + * Test: `Object.prototype.toString.call(window.location)`` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */ + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The `Document` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: `Object.prototype.toString.call(document)`` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */ + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + + if (typeof window.navigator === 'object') { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: `Object.prototype.toString.call(navigator.mimeTypes)`` + * - IE <=10 === "[object MSMimeTypesCollection]" + */ + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: `Object.prototype.toString.call(navigator.plugins)`` + * - IE <=10 === "[object MSPluginsCollection]" + */ + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement` + * Test: `Object.prototype.toString.call(document.createElement('blockquote'))`` + * - IE <=10 === "[object HTMLBlockElement]" + */ + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + + /* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */ + const stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + + const objPrototype = Object.getPrototypeOf(obj); + /* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */ + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + + /* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */ + if (objPrototype === Date.prototype) { + return 'Date'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: `Object.prototype.toString.call(Promise.resolve())`` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */ + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + + /* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */ + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + + /* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */ + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + + /* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */ + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + + /* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */ + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))`` + * - Edge <=13 === "[object Object]" + */ + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: `Object.prototype.toString.call(new Map().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: `Object.prototype.toString.call(new Set().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: `Object.prototype.toString.call([][Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: `Object.prototype.toString.call(''[Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + + /* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */ + if (objPrototype === null) { + return 'Object'; + } + + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); +} diff --git a/node_modules/type-detect/package.json b/node_modules/type-detect/package.json new file mode 100644 index 0000000..bebf2d8 --- /dev/null +++ b/node_modules/type-detect/package.json @@ -0,0 +1 @@ +{"name":"type-detect","description":"Improved typeof detection for node.js and the browser.","keywords":["type","typeof","types"],"license":"MIT","author":"Jake Luer (http://alogicalparadox.com)","contributors":["Keith Cirkel (https://github.com/keithamus)","David Losert (https://github.com/davelosert)","Aleksey Shvayka (https://github.com/shvaikalesh)","Lucas Fernandes da Costa (https://github.com/lucasfcosta)","Grant Snodgrass (https://github.com/meeber)","Jeremy Tice (https://github.com/jetpacmonkey)","Edward Betts (https://github.com/EdwardBetts)","dvlsg (https://github.com/dvlsg)","Amila Welihinda (https://github.com/amilajack)","Jake Champion (https://github.com/JakeChampion)","Miroslav Bajtoš (https://github.com/bajtos)"],"files":["index.js","type-detect.js"],"main":"./type-detect.js","repository":{"type":"git","url":"git+ssh://git@github.com/chaijs/type-detect.git"},"scripts":{"bench":"node bench","build":"rollup -c rollup.conf.js","commit-msg":"commitlint -x angular","lint":"eslint --ignore-path .gitignore .","prepare":"cross-env NODE_ENV=production npm run build","semantic-release":"semantic-release pre && npm publish && semantic-release post","pretest:node":"cross-env NODE_ENV=test npm run build","pretest:browser":"cross-env NODE_ENV=test npm run build","test":"npm run test:node && npm run test:browser","test:browser":"karma start --singleRun=true","test:node":"nyc mocha type-detect.test.js","posttest:node":"nyc report --report-dir \"coverage/node-$(node --version)\" --reporter=lcovonly && npm run upload-coverage","posttest:browser":"npm run upload-coverage","upload-coverage":"codecov"},"eslintConfig":{"env":{"es6":true},"extends":["strict/es6"],"globals":{"HTMLElement":false},"rules":{"complexity":0,"max-statements":0,"prefer-rest-params":0}},"devDependencies":{"@commitlint/cli":"^4.2.2","benchmark":"^2.1.0","buble":"^0.16.0","codecov":"^3.0.0","commitlint-config-angular":"^4.2.1","cross-env":"^5.1.1","eslint":"^4.10.0","eslint-config-strict":"^14.0.0","eslint-plugin-filenames":"^1.2.0","husky":"^0.14.3","karma":"^1.7.1","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-detect-browsers":"^2.2.5","karma-edge-launcher":"^0.4.2","karma-firefox-launcher":"^1.0.1","karma-ie-launcher":"^1.0.0","karma-mocha":"^1.3.0","karma-opera-launcher":"^1.0.0","karma-safari-launcher":"^1.0.0","karma-safaritechpreview-launcher":"0.0.6","karma-sauce-launcher":"^1.2.0","mocha":"^4.0.1","nyc":"^11.3.0","rollup":"^0.50.0","rollup-plugin-buble":"^0.16.0","rollup-plugin-commonjs":"^8.2.6","rollup-plugin-istanbul":"^1.1.0","rollup-plugin-node-resolve":"^3.0.0","semantic-release":"^8.2.0","simple-assert":"^1.0.0"},"engines":{"node":">=4"},"version":"4.0.8"} diff --git a/node_modules/type-detect/type-detect.js b/node_modules/type-detect/type-detect.js new file mode 100644 index 0000000..2f55525 --- /dev/null +++ b/node_modules/type-detect/type-detect.js @@ -0,0 +1,388 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.typeDetect = factory()); +}(this, (function () { 'use strict'; + +/* ! + * type-detect + * Copyright(c) 2013 jake luer + * MIT Licensed + */ +var promiseExists = typeof Promise === 'function'; + +/* eslint-disable no-undef */ +var globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist + +var symbolExists = typeof Symbol !== 'undefined'; +var mapExists = typeof Map !== 'undefined'; +var setExists = typeof Set !== 'undefined'; +var weakMapExists = typeof WeakMap !== 'undefined'; +var weakSetExists = typeof WeakSet !== 'undefined'; +var dataViewExists = typeof DataView !== 'undefined'; +var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; +var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; +var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; +var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; +var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); +var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); +var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; +var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); +var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; +var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); +var toStringLeftSliceLength = 8; +var toStringRightSliceLength = -1; +/** + * ### typeOf (obj) + * + * Uses `Object.prototype.toString` to determine the type of an object, + * normalising behaviour across engine versions & well optimised. + * + * @param {Mixed} object + * @return {String} object type + * @api public + */ +function typeDetect(obj) { + /* ! Speed optimisation + * Pre: + * string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled) + * boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled) + * number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled) + * undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled) + * function x 2,556,769 ops/sec ±1.73% (77 runs sampled) + * Post: + * string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled) + * boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled) + * number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled) + * undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled) + * function x 31,296,870 ops/sec ±0.96% (83 runs sampled) + */ + var typeofObj = typeof obj; + if (typeofObj !== 'object') { + return typeofObj; + } + + /* ! Speed optimisation + * Pre: + * null x 28,645,765 ops/sec ±1.17% (82 runs sampled) + * Post: + * null x 36,428,962 ops/sec ±1.37% (84 runs sampled) + */ + if (obj === null) { + return 'null'; + } + + /* ! Spec Conformance + * Test: `Object.prototype.toString.call(window)`` + * - Node === "[object global]" + * - Chrome === "[object global]" + * - Firefox === "[object Window]" + * - PhantomJS === "[object Window]" + * - Safari === "[object Window]" + * - IE 11 === "[object Window]" + * - IE Edge === "[object Window]" + * Test: `Object.prototype.toString.call(this)`` + * - Chrome Worker === "[object global]" + * - Firefox Worker === "[object DedicatedWorkerGlobalScope]" + * - Safari Worker === "[object DedicatedWorkerGlobalScope]" + * - IE 11 Worker === "[object WorkerGlobalScope]" + * - IE Edge Worker === "[object WorkerGlobalScope]" + */ + if (obj === globalObject) { + return 'global'; + } + + /* ! Speed optimisation + * Pre: + * array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled) + * Post: + * array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled) + */ + if ( + Array.isArray(obj) && + (symbolToStringTagExists === false || !(Symbol.toStringTag in obj)) + ) { + return 'Array'; + } + + // Not caching existence of `window` and related properties due to potential + // for `window` to be unset before tests in quasi-browser environments. + if (typeof window === 'object' && window !== null) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/browsers.html#location) + * WhatWG HTML$7.7.3 - The `Location` interface + * Test: `Object.prototype.toString.call(window.location)`` + * - IE <=11 === "[object Object]" + * - IE Edge <=13 === "[object Object]" + */ + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#document) + * WhatWG HTML$3.1.1 - The `Document` object + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * WhatWG HTML states: + * > For historical reasons, Window objects must also have a + * > writable, configurable, non-enumerable property named + * > HTMLDocument whose value is the Document interface object. + * Test: `Object.prototype.toString.call(document)`` + * - Chrome === "[object HTMLDocument]" + * - Firefox === "[object HTMLDocument]" + * - Safari === "[object HTMLDocument]" + * - IE <=10 === "[object Document]" + * - IE 11 === "[object HTMLDocument]" + * - IE Edge <=13 === "[object HTMLDocument]" + */ + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + + if (typeof window.navigator === 'object') { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray + * Test: `Object.prototype.toString.call(navigator.mimeTypes)`` + * - IE <=10 === "[object MSMimeTypesCollection]" + */ + if (typeof window.navigator.mimeTypes === 'object' && + obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray + * Test: `Object.prototype.toString.call(navigator.plugins)`` + * - IE <=10 === "[object MSPluginsCollection]" + */ + if (typeof window.navigator.plugins === 'object' && + obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + + if ((typeof window.HTMLElement === 'function' || + typeof window.HTMLElement === 'object') && + obj instanceof window.HTMLElement) { + /* ! Spec Conformance + * (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray) + * WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement` + * Test: `Object.prototype.toString.call(document.createElement('blockquote'))`` + * - IE <=10 === "[object HTMLBlockElement]" + */ + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltabledatacellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('td')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + + /* ! Spec Conformance + * (https://html.spec.whatwg.org/#htmltableheadercellelement) + * WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement` + * Note: Most browsers currently adher to the W3C DOM Level 2 spec + * (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075) + * which suggests that browsers should use HTMLTableCellElement for + * both TD and TH elements. WhatWG separates these. + * Test: Object.prototype.toString.call(document.createElement('th')) + * - Chrome === "[object HTMLTableCellElement]" + * - Firefox === "[object HTMLTableCellElement]" + * - Safari === "[object HTMLTableCellElement]" + */ + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + + /* ! Speed optimisation + * Pre: + * Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled) + * Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled) + * Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled) + * Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled) + * Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled) + * Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled) + * Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled) + * Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled) + * Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled) + * Post: + * Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled) + * Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled) + * Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled) + * Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled) + * Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled) + * Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled) + * Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled) + * Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled) + * Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled) + */ + var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]); + if (typeof stringTag === 'string') { + return stringTag; + } + + var objPrototype = Object.getPrototypeOf(obj); + /* ! Speed optimisation + * Pre: + * regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled) + * regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled) + * Post: + * regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled) + * regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled) + */ + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + + /* ! Speed optimisation + * Pre: + * date x 2,130,074 ops/sec ±4.42% (68 runs sampled) + * Post: + * date x 3,953,779 ops/sec ±1.35% (77 runs sampled) + */ + if (objPrototype === Date.prototype) { + return 'Date'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag) + * ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise": + * Test: `Object.prototype.toString.call(Promise.resolve())`` + * - Chrome <=47 === "[object Object]" + * - Edge <=20 === "[object Object]" + * - Firefox 29-Latest === "[object Promise]" + * - Safari 7.1-Latest === "[object Promise]" + */ + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + + /* ! Speed optimisation + * Pre: + * set x 2,222,186 ops/sec ±1.31% (82 runs sampled) + * Post: + * set x 4,545,879 ops/sec ±1.13% (83 runs sampled) + */ + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + + /* ! Speed optimisation + * Pre: + * map x 2,396,842 ops/sec ±1.59% (81 runs sampled) + * Post: + * map x 4,183,945 ops/sec ±6.59% (82 runs sampled) + */ + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + + /* ! Speed optimisation + * Pre: + * weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled) + * Post: + * weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled) + */ + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + + /* ! Speed optimisation + * Pre: + * weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled) + * Post: + * weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled) + */ + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag) + * ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView": + * Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))`` + * - Edge <=13 === "[object Object]" + */ + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag) + * ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator": + * Test: `Object.prototype.toString.call(new Map().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag) + * ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator": + * Test: `Object.prototype.toString.call(new Set().entries())`` + * - Edge <=13 === "[object Object]" + */ + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag) + * ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator": + * Test: `Object.prototype.toString.call([][Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + + /* ! Spec Conformance + * (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag) + * ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator": + * Test: `Object.prototype.toString.call(''[Symbol.iterator]())`` + * - Edge <=13 === "[object Object]" + */ + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + + /* ! Speed optimisation + * Pre: + * object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled) + * Post: + * object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled) + */ + if (objPrototype === null) { + return 'Object'; + } + + return Object + .prototype + .toString + .call(obj) + .slice(toStringLeftSliceLength, toStringRightSliceLength); +} + +return typeDetect; + +}))); diff --git a/node_modules/type-fest/index.d.ts b/node_modules/type-fest/index.d.ts new file mode 100644 index 0000000..520df22 --- /dev/null +++ b/node_modules/type-fest/index.d.ts @@ -0,0 +1,20 @@ +// Basic +export * from './source/basic'; + +// Utilities +export {Except} from './source/except'; +export {Mutable} from './source/mutable'; +export {Merge} from './source/merge'; +export {MergeExclusive} from './source/merge-exclusive'; +export {RequireAtLeastOne} from './source/require-at-least-one'; +export {RequireExactlyOne} from './source/require-exactly-one'; +export {PartialDeep} from './source/partial-deep'; +export {ReadonlyDeep} from './source/readonly-deep'; +export {LiteralUnion} from './source/literal-union'; +export {Promisable} from './source/promisable'; +export {Opaque} from './source/opaque'; +export {SetOptional} from './source/set-optional'; +export {SetRequired} from './source/set-required'; + +// Miscellaneous +export {PackageJson} from './source/package-json'; diff --git a/node_modules/type-fest/license b/node_modules/type-fest/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/type-fest/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/type-fest/package.json b/node_modules/type-fest/package.json new file mode 100644 index 0000000..ea66211 --- /dev/null +++ b/node_modules/type-fest/package.json @@ -0,0 +1,51 @@ +{ + "name": "type-fest", + "version": "0.8.1", + "description": "A collection of essential TypeScript types", + "license": "(MIT OR CC0-1.0)", + "repository": "sindresorhus/type-fest", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && tsd" + }, + "files": [ + "index.d.ts", + "source" + ], + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "devDependencies": { + "@sindresorhus/tsconfig": "^0.4.0", + "@typescript-eslint/eslint-plugin": "^2.2.0", + "@typescript-eslint/parser": "^2.2.0", + "eslint-config-xo-typescript": "^0.18.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + }, + "xo": { + "extends": "xo-typescript", + "extensions": [ + "ts" + ], + "rules": { + "import/no-unresolved": "off", + "@typescript-eslint/indent": "off" + } + } +} diff --git a/node_modules/type-fest/readme.md b/node_modules/type-fest/readme.md new file mode 100644 index 0000000..1824bda --- /dev/null +++ b/node_modules/type-fest/readme.md @@ -0,0 +1,635 @@ +
+
+
+ type-fest +
+
+ A collection of essential TypeScript types +
+
+
+
+
+ +[![Build Status](https://travis-ci.com/sindresorhus/type-fest.svg?branch=master)](https://travis-ci.com/sindresorhus/type-fest) +[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 + +PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. + + +## Install + +``` +$ npm install type-fest +``` + +*Requires TypeScript >=3.2* + + +## Usage + +```ts +import {Except} from 'type-fest'; + +type Foo = { + unicorn: string; + rainbow: boolean; +}; + +type FooWithoutRainbow = Except; +//=> {unicorn: string} +``` + + +## API + +Click the type names for complete docs. + +### Basic + +- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. +- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. +- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. +- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +### Utilities + +- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). +- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly`. +- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. +- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys. +- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys. +- [`RequireExactlyOne`](source/require-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more. +- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep. +- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep. +- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). +- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`. +- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/). +- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional. +- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required. + +### Miscellaneous + +- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). + + +## Declined types + +*If we decline a type addition, we will make sure to document the better solution here.* + +- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. +- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. + + +## Tips + +### Built-in types + +There are many advanced types most users don't know about. + +- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/KYOwrgtgBAMg9gcxsAbsANlA3gKClAeQDMiAaPKAEWACMwFz8BRAJxbhcagDEBDAF17ocAXxw4AliH7AWRXgGNgUAHJwAJsADCcEEQkJsFXgAcTK3hGAAuKAGd+LKQgDcFEx363wEGrLf46IjIaOi28EioGG5iOArovHZ2qhrAAIJmAEJgEuiaLEb4Jk4oAsoKuvoIYCwCErq2apo6egZQALyF+FCm5pY2UABETelmg1xFnrYAzAAM8xNQQZGh4cFR6AB0xEQUIm4UFa0IABRHVbYACrws-BJCADwjLVUAfACUXfhEHFBnug4oABrYAATygcCIhBoACtgAp+JsQaC7P9ju9Prhut0joCwCZ1GUAGpCMDKTrnAwAbWRPWSyMhKWalQMAF0Dtj8BIoSd8YSZCT0GSOu1OmAQJp9CBgOpPkc7uBgBzOfwABYSOybSnVWp3XQ0sF04FgxnPFkIVkdKB84mkpUUfCxbEsYD8GogKBqjUBKBiWIAen9UGut3u6CeqReBlePXQQQA7skwMl+HAoMU4CgJJoISB0ODeOmbvwIVC1cAcIGmdpzVApDI5IpgJscNL49WMiZsrl8id3lrzScsD0zBYrLZBgAVOCUOCdwa+95uIA) + + ```ts + interface NodeConfig { + appName: string; + port: number; + } + + class NodeAppBuilder { + private configuration: NodeConfig = { + appName: 'NodeApp', + port: 3000 + }; + + config(config: Partial) { + type NodeConfigKey = keyof NodeConfig; + + for (const key of Object.keys(config) as NodeConfigKey[]) { + const updateValue = config[key]; + + if (updateValue === undefined) { + continue; + } + + this.configuration[key] = updateValue; + } + + return this; + } + } + + // `Partial`` allows us to provide only a part of the + // NodeConfig interface. + new NodeAppBuilder().config({appName: 'ToDoApp'}); + ``` +
+ +- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA) + + ```ts + interface ContactForm { + email?: string; + message?: string; + } + + function submitContactForm(formData: Required) { + // Send the form data to the server. + } + + submitContactForm({ + email: 'ex@mple.com', + message: 'Hi! Could you tell me more about…', + }); + + // TypeScript error: missing property 'message' + submitContactForm({ + email: 'ex@mple.com', + }); + ``` +
+ +- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA) + + ```ts + enum LogLevel { + Off, + Debug, + Error, + Fatal + }; + + interface LoggerConfig { + name: string; + level: LogLevel; + } + + class Logger { + config: Readonly; + + constructor({name, level}: LoggerConfig) { + this.config = {name, level}; + Object.freeze(this.config); + } + } + + const config: LoggerConfig = { + name: 'MyApp', + level: LogLevel.Debug + }; + + const logger = new Logger(config); + + // TypeScript Error: cannot assign to read-only property. + logger.config.level = LogLevel.Error; + + // We are able to edit config variable as we please. + config.level = LogLevel.Error; + ``` +
+ +- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA) + + ```ts + interface Article { + title: string; + thumbnail: string; + content: string; + } + + // Creates new type out of the `Article` interface composed + // from the Articles' two properties: `title` and `thumbnail`. + // `ArticlePreview = {title: string; thumbnail: string}` + type ArticlePreview = Pick; + + // Render a list of articles using only title and description. + function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement { + const articles = document.createElement('div'); + + for (const preview of previews) { + // Append preview to the articles. + } + + return articles; + } + + const articles = renderArticlePreviews([ + { + title: 'TypeScript tutorial!', + thumbnail: '/assets/ts.jpg' + } + ]); + ``` +
+ +- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA) + + ```ts + // Positions of employees in our company. + type MemberPosition = 'intern' | 'developer' | 'tech-lead'; + + // Interface describing properties of a single employee. + interface Employee { + firstName: string; + lastName: string; + yearsOfExperience: number; + } + + // Create an object that has all possible `MemberPosition` values set as keys. + // Those keys will store a collection of Employees of the same position. + const team: Record = { + intern: [], + developer: [], + 'tech-lead': [], + }; + + // Our team has decided to help John with his dream of becoming Software Developer. + team.intern.push({ + firstName: 'John', + lastName: 'Doe', + yearsOfExperience: 0 + }); + + // `Record` forces you to initialize all of the property keys. + // TypeScript Error: "tech-lead" property is missing + const teamEmpty: Record = { + intern: null, + developer: null, + }; + ``` +
+ +- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA) + + ```ts + interface ServerConfig { + port: null | string | number; + } + + type RequestHandler = (request: Request, response: Response) => void; + + // Exclude `null` type from `null | string | number`. + // In case the port is equal to `null`, we will use default value. + function getPortValue(port: Exclude): number { + if (typeof port === 'string') { + return parseInt(port, 10); + } + + return port; + } + + function startServer(handler: RequestHandler, config: ServerConfig): void { + const server = require('http').createServer(handler); + + const port = config.port === null ? 3000 : getPortValue(config.port); + server.listen(port); + } + ``` +
+ +- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA) + + ```ts + declare function uniqueId(): number; + + const ID = Symbol('ID'); + + interface Person { + [ID]: number; + name: string; + age: number; + } + + // Allows changing the person data as long as the property key is of string type. + function changePersonData< + Obj extends Person, + Key extends Extract, + Value extends Obj[Key] + > (obj: Obj, key: Key, value: Value): void { + obj[key] = value; + } + + // Tiny Andrew was born. + const andrew = { + [ID]: uniqueId(), + name: 'Andrew', + age: 0, + }; + + // Cool, we're fine with that. + changePersonData(andrew, 'name', 'Pony'); + + // Goverment didn't like the fact that you wanted to change your identity. + changePersonData(andrew, ID, uniqueId()); + ``` +
+ +- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. +
+ + Example + + Works with strictNullChecks set to true. (Read more here) + + [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA) + + ```ts + type PortNumber = string | number | null; + + /** Part of a class definition that is used to build a server */ + class ServerBuilder { + portNumber!: NonNullable; + + port(this: ServerBuilder, port: PortNumber): ServerBuilder { + if (port == null) { + this.portNumber = 8000; + } else { + this.portNumber = port; + } + + return this; + } + } + + const serverBuilder = new ServerBuilder(); + + serverBuilder + .port('8000') // portNumber = '8000' + .port(null) // portNumber = 8000 + .port(3000); // portNumber = 3000 + + // TypeScript error + serverBuilder.portNumber = null; + ``` +
+ +- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA) + + ```ts + function shuffle(input: any[]): void { + // Mutate array randomly changing its' elements indexes. + } + + function callNTimes any> (func: Fn, callCount: number) { + // Type that represents the type of the received function parameters. + type FunctionParameters = Parameters; + + return function (...args: FunctionParameters) { + for (let i = 0; i < callCount; i++) { + func(...args); + } + } + } + + const shuffleTwice = callNTimes(shuffle, 2); + ``` +
+ +- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA) + + ```ts + class ArticleModel { + title: string; + content?: string; + + constructor(title: string) { + this.title = title; + } + } + + class InstanceCache any)> { + private ClassConstructor: T; + private cache: Map> = new Map(); + + constructor (ctr: T) { + this.ClassConstructor = ctr; + } + + getInstance (...args: ConstructorParameters): InstanceType { + const hash = this.calculateArgumentsHash(...args); + + const existingInstance = this.cache.get(hash); + if (existingInstance !== undefined) { + return existingInstance; + } + + return new this.ClassConstructor(...args); + } + + private calculateArgumentsHash(...args: any[]): string { + // Calculate hash. + return 'hash'; + } + } + + const articleCache = new InstanceCache(ArticleModel); + const amazonArticle = articleCache.getInstance('Amazon forests burining!'); + ``` +
+ +- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */ + function mapIter< + Elem, + Func extends (elem: Elem) => any, + Ret extends ReturnType + >(iter: Iterable, callback: Func): Ret[] { + const mapped: Ret[] = []; + + for (const elem of iter) { + mapped.push(callback(elem)); + } + + return mapped; + } + + const setObject: Set = new Set(); + const mapObject: Map = new Map(); + + mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[] + + mapIter(mapObject, ([key, value]: [number, string]) => { + return key % 2 === 0 ? value : 'Odd'; + }); // string[] + ``` +
+ +- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + class IdleService { + doNothing (): void {} + } + + class News { + title: string; + content: string; + + constructor(title: string, content: string) { + this.title = title; + this.content = content; + } + } + + const instanceCounter: Map = new Map(); + + interface Constructor { + new(...args: any[]): any; + } + + // Keep track how many instances of `Constr` constructor have been created. + function getInstance< + Constr extends Constructor, + Args extends ConstructorParameters + >(constructor: Constr, ...args: Args): InstanceType { + let count = instanceCounter.get(constructor) || 0; + + const instance = new constructor(...args); + + instanceCounter.set(constructor, count + 1); + + console.log(`Created ${count + 1} instances of ${Constr.name} class`); + + return instance; + } + + + const idleService = getInstance(IdleService); + // Will log: `Created 1 instances of IdleService class` + const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...'); + // Will log: `Created 1 instances of News class` + ``` +
+ +- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA) + + ```ts + interface Animal { + imageUrl: string; + species: string; + images: string[]; + paragraphs: string[]; + } + + // Creates new type with all properties of the `Animal` interface + // except 'images' and 'paragraphs' properties. We can use this + // type to render small hover tooltip for a wiki entry list. + type AnimalShortInfo = Omit; + + function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { + const container = document.createElement('div'); + // Internal implementation. + return container; + } + ``` +
+ +You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Jarek Radosz](https://github.com/CvX) +- [Dimitri Benin](https://github.com/BendingBender) + + +## License + +(MIT OR CC0-1.0) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/type-fest/source/basic.d.ts b/node_modules/type-fest/source/basic.d.ts new file mode 100644 index 0000000..5969ce5 --- /dev/null +++ b/node_modules/type-fest/source/basic.d.ts @@ -0,0 +1,67 @@ +/// + +// TODO: This can just be `export type Primitive = not object` when the `not` keyword is out. +/** +Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +*/ +export type Primitive = + | null + | undefined + | string + | number + | boolean + | symbol + | bigint; + +// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default +/** +Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +*/ +export type Class = new(...arguments_: Arguments) => T; + +/** +Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +*/ +export type TypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; + +/** +Matches a JSON object. + +This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. +*/ +export type JsonObject = {[key: string]: JsonValue}; + +/** +Matches a JSON array. +*/ +export interface JsonArray extends Array {} + +/** +Matches any valid JSON value. +*/ +export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; + +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} + +/** +Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). +*/ +export interface ObservableLike { + subscribe(observer: (value: unknown) => void): void; + [Symbol.observable](): ObservableLike; +} diff --git a/node_modules/type-fest/source/except.d.ts b/node_modules/type-fest/source/except.d.ts new file mode 100644 index 0000000..7dedbaa --- /dev/null +++ b/node_modules/type-fest/source/except.d.ts @@ -0,0 +1,22 @@ +/** +Create a type from an object type without certain keys. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/30825) if you want to have the stricter version as a built-in in TypeScript. + +@example +``` +import {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; + c: boolean; +}; + +type FooWithoutA = Except; +//=> {b: string}; +``` +*/ +export type Except = Pick>; diff --git a/node_modules/type-fest/source/literal-union.d.ts b/node_modules/type-fest/source/literal-union.d.ts new file mode 100644 index 0000000..52e8de6 --- /dev/null +++ b/node_modules/type-fest/source/literal-union.d.ts @@ -0,0 +1,33 @@ +import {Primitive} from './basic'; + +/** +Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. + +Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. + +This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. + +@example +``` +import {LiteralUnion} from 'type-fest'; + +// Before + +type Pet = 'dog' | 'cat' | string; + +const pet: Pet = ''; +// Start typing in your TypeScript-enabled IDE. +// You **will not** get auto-completion for `dog` and `cat` literals. + +// After + +type Pet2 = LiteralUnion<'dog' | 'cat', string>; + +const pet: Pet2 = ''; +// You **will** get auto-completion for `dog` and `cat` literals. +``` + */ +export type LiteralUnion< + LiteralType extends BaseType, + BaseType extends Primitive +> = LiteralType | (BaseType & {_?: never}); diff --git a/node_modules/type-fest/source/merge-exclusive.d.ts b/node_modules/type-fest/source/merge-exclusive.d.ts new file mode 100644 index 0000000..059bd2c --- /dev/null +++ b/node_modules/type-fest/source/merge-exclusive.d.ts @@ -0,0 +1,39 @@ +// Helper type. Not useful on its own. +type Without = {[KeyType in Exclude]?: never}; + +/** +Create a type that has mutually exclusive keys. + +This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604). + +This type works with a helper type, called `Without`. `Without` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`. + +@example +``` +import {MergeExclusive} from 'type-fest'; + +interface ExclusiveVariation1 { + exclusive1: boolean; +} + +interface ExclusiveVariation2 { + exclusive2: string; +} + +type ExclusiveOptions = MergeExclusive; + +let exclusiveOptions: ExclusiveOptions; + +exclusiveOptions = {exclusive1: true}; +//=> Works +exclusiveOptions = {exclusive2: 'hi'}; +//=> Works +exclusiveOptions = {exclusive1: true, exclusive2: 'hi'}; +//=> Error +``` +*/ +export type MergeExclusive = + (FirstType | SecondType) extends object ? + (Without & SecondType) | (Without & FirstType) : + FirstType | SecondType; + diff --git a/node_modules/type-fest/source/merge.d.ts b/node_modules/type-fest/source/merge.d.ts new file mode 100644 index 0000000..4b3920b --- /dev/null +++ b/node_modules/type-fest/source/merge.d.ts @@ -0,0 +1,22 @@ +import {Except} from './except'; + +/** +Merge two types into a new type. Keys of the second type overrides keys of the first type. + +@example +``` +import {Merge} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type Bar = { + b: number; +}; + +const ab: Merge = {a: 1, b: 2}; +``` +*/ +export type Merge = Except> & SecondType; diff --git a/node_modules/type-fest/source/mutable.d.ts b/node_modules/type-fest/source/mutable.d.ts new file mode 100644 index 0000000..03d0dda --- /dev/null +++ b/node_modules/type-fest/source/mutable.d.ts @@ -0,0 +1,22 @@ +/** +Convert an object with `readonly` keys into a mutable object. Inverse of `Readonly`. + +This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), and [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509). + +@example +``` +import {Mutable} from 'type-fest'; + +type Foo = { + readonly a: number; + readonly b: string; +}; + +const mutableFoo: Mutable = {a: 1, b: '2'}; +mutableFoo.a = 3; +``` +*/ +export type Mutable = { + // For each `Key` in the keys of `ObjectType`, make a mapped type by removing the `readonly` modifier from the key. + -readonly [KeyType in keyof ObjectType]: ObjectType[KeyType]; +}; diff --git a/node_modules/type-fest/source/opaque.d.ts b/node_modules/type-fest/source/opaque.d.ts new file mode 100644 index 0000000..5311c1b --- /dev/null +++ b/node_modules/type-fest/source/opaque.d.ts @@ -0,0 +1,40 @@ +/** +Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly. + +The generic type parameter can be anything. It doesn't have to be an object. + +[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/) + +There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward: + - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408) + - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807) + +@example +``` +import {Opaque} from 'type-fest'; + +type AccountNumber = Opaque; +type AccountBalance = Opaque; + +function createAccountNumber(): AccountNumber { + return 2 as AccountNumber; +} + +function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance { + return 4 as AccountBalance; +} + +// This will compile successfully. +getMoneyForAccount(createAccountNumber()); + +// But this won't, because it has to be explicitly passed as an `AccountNumber` type. +getMoneyForAccount(2); + +// You can use opaque values like they aren't opaque too. +const accountNumber = createAccountNumber(); + +// This will compile successfully. +accountNumber + 2; +``` +*/ +export type Opaque = Type & {readonly __opaque__: unique symbol}; diff --git a/node_modules/type-fest/source/package-json.d.ts b/node_modules/type-fest/source/package-json.d.ts new file mode 100644 index 0000000..3179e58 --- /dev/null +++ b/node_modules/type-fest/source/package-json.d.ts @@ -0,0 +1,501 @@ +import {LiteralUnion} from '..'; + +declare namespace PackageJson { + /** + A person who has been involved in creating or maintaining the package. + */ + export type Person = + | string + | { + name: string; + url?: string; + email?: string; + }; + + export type BugsLocation = + | string + | { + /** + The URL to the package's issue tracker. + */ + url?: string; + + /** + The email address to which issues should be reported. + */ + email?: string; + }; + + export interface DirectoryLocations { + /** + Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder. + */ + bin?: string; + + /** + Location for Markdown files. + */ + doc?: string; + + /** + Location for example scripts. + */ + example?: string; + + /** + Location for the bulk of the library. + */ + lib?: string; + + /** + Location for man pages. Sugar to generate a `man` array by walking the folder. + */ + man?: string; + + /** + Location for test files. + */ + test?: string; + + [directoryType: string]: unknown; + } + + export type Scripts = { + /** + Run **before** the package is published (Also run on local `npm install` without any arguments). + */ + prepublish?: string; + + /** + Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`. + */ + prepare?: string; + + /** + Run **before** the package is prepared and packed, **only** on `npm publish`. + */ + prepublishOnly?: string; + + /** + Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies). + */ + prepack?: string; + + /** + Run **after** the tarball has been generated and moved to its final destination. + */ + postpack?: string; + + /** + Run **after** the package is published. + */ + publish?: string; + + /** + Run **after** the package is published. + */ + postpublish?: string; + + /** + Run **before** the package is installed. + */ + preinstall?: string; + + /** + Run **after** the package is installed. + */ + install?: string; + + /** + Run **after** the package is installed and after `install`. + */ + postinstall?: string; + + /** + Run **before** the package is uninstalled and before `uninstall`. + */ + preuninstall?: string; + + /** + Run **before** the package is uninstalled. + */ + uninstall?: string; + + /** + Run **after** the package is uninstalled. + */ + postuninstall?: string; + + /** + Run **before** bump the package version and before `version`. + */ + preversion?: string; + + /** + Run **before** bump the package version. + */ + version?: string; + + /** + Run **after** bump the package version. + */ + postversion?: string; + + /** + Run with the `npm test` command, before `test`. + */ + pretest?: string; + + /** + Run with the `npm test` command. + */ + test?: string; + + /** + Run with the `npm test` command, after `test`. + */ + posttest?: string; + + /** + Run with the `npm stop` command, before `stop`. + */ + prestop?: string; + + /** + Run with the `npm stop` command. + */ + stop?: string; + + /** + Run with the `npm stop` command, after `stop`. + */ + poststop?: string; + + /** + Run with the `npm start` command, before `start`. + */ + prestart?: string; + + /** + Run with the `npm start` command. + */ + start?: string; + + /** + Run with the `npm start` command, after `start`. + */ + poststart?: string; + + /** + Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + prerestart?: string; + + /** + Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + restart?: string; + + /** + Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + postrestart?: string; + } & { + [scriptName: string]: string; + }; + + /** + Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL. + */ + export interface Dependency { + [packageName: string]: string; + } + + export interface NonStandardEntryPoints { + /** + An ECMAScript module ID that is the primary entry point to the program. + */ + module?: string; + + /** + A module ID with untranspiled code that is the primary entry point to the program. + */ + esnext?: + | string + | { + main?: string; + browser?: string; + [moduleName: string]: string | undefined; + }; + + /** + A hint to JavaScript bundlers or component tools when packaging modules for client side use. + */ + browser?: + | string + | { + [moduleName: string]: string | false; + }; + } + + export interface TypeScriptConfiguration { + /** + Location of the bundled TypeScript declaration file. + */ + types?: string; + + /** + Location of the bundled TypeScript declaration file. Alias of `types`. + */ + typings?: string; + } + + export interface YarnConfiguration { + /** + If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command line, set this to `true`. + + Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an application), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line. + */ + flat?: boolean; + + /** + Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file. + */ + resolutions?: Dependency; + } + + export interface JSPMConfiguration { + /** + JSPM configuration. + */ + jspm?: PackageJson; + } +} + +/** +Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. +*/ +export type PackageJson = { + /** + The name of the package. + */ + name?: string; + + /** + Package version, parseable by [`node-semver`](https://github.com/npm/node-semver). + */ + version?: string; + + /** + Package description, listed in `npm search`. + */ + description?: string; + + /** + Keywords associated with package, listed in `npm search`. + */ + keywords?: string[]; + + /** + The URL to the package's homepage. + */ + homepage?: LiteralUnion<'.', string>; + + /** + The URL to the package's issue tracker and/or the email address to which issues should be reported. + */ + bugs?: PackageJson.BugsLocation; + + /** + The license for the package. + */ + license?: string; + + /** + The licenses for the package. + */ + licenses?: Array<{ + type?: string; + url?: string; + }>; + + author?: PackageJson.Person; + + /** + A list of people who contributed to the package. + */ + contributors?: PackageJson.Person[]; + + /** + A list of people who maintain the package. + */ + maintainers?: PackageJson.Person[]; + + /** + The files included in the package. + */ + files?: string[]; + + /** + The module ID that is the primary entry point to the program. + */ + main?: string; + + /** + The executable files that should be installed into the `PATH`. + */ + bin?: + | string + | { + [binary: string]: string; + }; + + /** + Filenames to put in place for the `man` program to find. + */ + man?: string | string[]; + + /** + Indicates the structure of the package. + */ + directories?: PackageJson.DirectoryLocations; + + /** + Location for the code repository. + */ + repository?: + | string + | { + type: string; + url: string; + }; + + /** + Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point. + */ + scripts?: PackageJson.Scripts; + + /** + Is used to set configuration parameters used in package scripts that persist across upgrades. + */ + config?: { + [configKey: string]: unknown; + }; + + /** + The dependencies of the package. + */ + dependencies?: PackageJson.Dependency; + + /** + Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling. + */ + devDependencies?: PackageJson.Dependency; + + /** + Dependencies that are skipped if they fail to install. + */ + optionalDependencies?: PackageJson.Dependency; + + /** + Dependencies that will usually be required by the package user directly or via another dependency. + */ + peerDependencies?: PackageJson.Dependency; + + /** + Package names that are bundled when the package is published. + */ + bundledDependencies?: string[]; + + /** + Alias of `bundledDependencies`. + */ + bundleDependencies?: string[]; + + /** + Engines that this package runs on. + */ + engines?: { + [EngineName in 'npm' | 'node' | string]: string; + }; + + /** + @deprecated + */ + engineStrict?: boolean; + + /** + Operating systems the module runs on. + */ + os?: Array>; + + /** + CPU architectures the module runs on. + */ + cpu?: Array>; + + /** + If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally. + + @deprecated + */ + preferGlobal?: boolean; + + /** + If set to `true`, then npm will refuse to publish it. + */ + private?: boolean; + + /** + * A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default. + */ + publishConfig?: { + [config: string]: unknown; + }; +} & +PackageJson.NonStandardEntryPoints & +PackageJson.TypeScriptConfiguration & +PackageJson.YarnConfiguration & +PackageJson.JSPMConfiguration & { + [key: string]: unknown; +}; diff --git a/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/type-fest/source/partial-deep.d.ts new file mode 100644 index 0000000..b962b84 --- /dev/null +++ b/node_modules/type-fest/source/partial-deep.d.ts @@ -0,0 +1,72 @@ +import {Primitive} from './basic'; + +/** +Create a type from another type with all keys and nested keys set to optional. + +Use-cases: +- Merging a default settings/config object with another object, the second object would be a deep partial of the default object. +- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test. + +@example +``` +import {PartialDeep} from 'type-fest'; + +const settings: Settings = { + textEditor: { + fontSize: 14; + fontColor: '#000000'; + fontWeight: 400; + } + autocomplete: false; + autosave: true; +}; + +const applySavedSettings = (savedSettings: PartialDeep) => { + return {...settings, ...savedSettings}; +} + +settings = applySavedSettings({textEditor: {fontWeight: 500}}); +``` +*/ +export type PartialDeep = T extends Primitive + ? Partial + : T extends Map + ? PartialMapDeep + : T extends Set + ? PartialSetDeep + : T extends ReadonlyMap + ? PartialReadonlyMapDeep + : T extends ReadonlySet + ? PartialReadonlySetDeep + : T extends ((...arguments: any[]) => unknown) + ? T | undefined + : T extends object + ? PartialObjectDeep + : unknown; + +/** +Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialMapDeep extends Map, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialSetDeep extends Set> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlyMapDeep extends ReadonlyMap, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlySetDeep extends ReadonlySet> {} + +/** +Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`. +*/ +type PartialObjectDeep = { + [KeyType in keyof ObjectType]?: PartialDeep +}; diff --git a/node_modules/type-fest/source/promisable.d.ts b/node_modules/type-fest/source/promisable.d.ts new file mode 100644 index 0000000..71242a5 --- /dev/null +++ b/node_modules/type-fest/source/promisable.d.ts @@ -0,0 +1,23 @@ +/** +Create a type that represents either the value or the value wrapped in `PromiseLike`. + +Use-cases: +- A function accepts a callback that may either return a value synchronously or may return a promised value. +- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript. + +@example +``` +import {Promisable} from 'type-fest'; + +async function logger(getLogEntry: () => Promisable): Promise { + const entry = await getLogEntry(); + console.log(entry); +} + +logger(() => 'foo'); +logger(() => Promise.resolve('bar')); +``` +*/ +export type Promisable = T | PromiseLike; diff --git a/node_modules/type-fest/source/readonly-deep.d.ts b/node_modules/type-fest/source/readonly-deep.d.ts new file mode 100644 index 0000000..b8c04de --- /dev/null +++ b/node_modules/type-fest/source/readonly-deep.d.ts @@ -0,0 +1,59 @@ +import {Primitive} from './basic'; + +/** +Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively. + +This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript. + +@example +``` +// data.json +{ + "foo": ["bar"] +} + +// main.ts +import {ReadonlyDeep} from 'type-fest'; +import dataJson = require('./data.json'); + +const data: ReadonlyDeep = dataJson; + +export default data; + +// test.ts +import data from './main'; + +data.foo.push('bar'); +//=> error TS2339: Property 'push' does not exist on type 'readonly string[]' +``` +*/ +export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) + ? T + : T extends ReadonlyMap + ? ReadonlyMapDeep + : T extends ReadonlySet + ? ReadonlySetDeep + : T extends object + ? ReadonlyObjectDeep + : unknown; + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlyMapDeep + extends ReadonlyMap, ReadonlyDeep> {} + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlySetDeep + extends ReadonlySet> {} + +/** +Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +type ReadonlyObjectDeep = { + readonly [KeyType in keyof ObjectType]: ReadonlyDeep +}; diff --git a/node_modules/type-fest/source/require-at-least-one.d.ts b/node_modules/type-fest/source/require-at-least-one.d.ts new file mode 100644 index 0000000..337379f --- /dev/null +++ b/node_modules/type-fest/source/require-at-least-one.d.ts @@ -0,0 +1,32 @@ +import {Except} from './except'; + +/** +Create a type that requires at least one of the given keys. The remaining keys are kept as is. + +@example +``` +import {RequireAtLeastOne} from 'type-fest'; + +type Responder = { + text?: () => string; + json?: () => string; + + secure?: boolean; +}; + +const responder: RequireAtLeastOne = { + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireAtLeastOne = + { + // For each Key in KeysType make a mapped type + [Key in KeysType]: ( + // …by picking that Key's type and making it required + Required> + ) + }[KeysType] + // …then, make intersection types by adding the remaining keys to each mapped type. + & Except; diff --git a/node_modules/type-fest/source/require-exactly-one.d.ts b/node_modules/type-fest/source/require-exactly-one.d.ts new file mode 100644 index 0000000..d8c71b7 --- /dev/null +++ b/node_modules/type-fest/source/require-exactly-one.d.ts @@ -0,0 +1,36 @@ +// TODO: Remove this when we target TypeScript >=3.5. +// eslint-disable-next-line @typescript-eslint/generic-type-naming +type _Omit = Pick>; + +/** +Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is. + +Use-cases: +- Creating interfaces for components that only need one of the keys to display properly. +- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`. + +The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about. + +@example +``` +import {RequireExactlyOne} from 'type-fest'; + +type Responder = { + text: () => string; + json: () => string; + secure: boolean; +}; + +const responder: RequireExactlyOne = { + // Adding a `text` key here would cause a compile error. + + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireExactlyOne = + {[Key in KeysType]: ( + Required> & + Partial, never>> + )}[KeysType] & _Omit; diff --git a/node_modules/type-fest/source/set-optional.d.ts b/node_modules/type-fest/source/set-optional.d.ts new file mode 100644 index 0000000..a9a256a --- /dev/null +++ b/node_modules/type-fest/source/set-optional.d.ts @@ -0,0 +1,32 @@ +/** +Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional. + +@example +``` +import {SetOptional} from 'type-fest'; + +type Foo = { + a: number; + b?: string; + c: boolean; +} + +type SomeOptional = SetOptional; +// type SomeOptional = { +// a: number; +// b?: string; // Was already optional and still is. +// c?: boolean; // Is now optional. +// } +``` +*/ +export type SetOptional = + // Pick just the keys that are not optional from the base type. + Pick> & + // Pick the keys that should be optional from the base type and make them optional. + Partial> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/type-fest/source/set-required.d.ts b/node_modules/type-fest/source/set-required.d.ts new file mode 100644 index 0000000..2572bc1 --- /dev/null +++ b/node_modules/type-fest/source/set-required.d.ts @@ -0,0 +1,32 @@ +/** +Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required. + +@example +``` +import {SetRequired} from 'type-fest'; + +type Foo = { + a?: number; + b: string; + c?: boolean; +} + +type SomeRequired = SetRequired; +// type SomeRequired = { +// a?: number; +// b: string; // Was already required and still is. +// c: boolean; // Is now required. +// } +``` +*/ +export type SetRequired = + // Pick just the keys that are not required from the base type. + Pick> & + // Pick the keys that should be required from the base type and make them required. + Required> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/type-is/HISTORY.md b/node_modules/type-is/HISTORY.md new file mode 100644 index 0000000..6812655 --- /dev/null +++ b/node_modules/type-is/HISTORY.md @@ -0,0 +1,292 @@ +2.0.1 / 2025-03-27 +========== + +2.0.0 / 2024-08-31 +========== + + * Drop node <18 + * Use `content-type@^1.0.5` and `media-typer@^1.0.0` for type validation + - No behavior changes, upgrades `media-typer` + * deps: mime-types@^3.0.0 + - Add `application/toml` with extension `.toml` + - Add `application/ubjson` with extension `.ubj` + - Add `application/x-keepass2` with extension `.kdbx` + - Add deprecated iWorks mime types and extensions + - Add extension `.amr` to `audio/amr` + - Add extension `.cjs` to `application/node` + - Add extension `.dbf` to `application/vnd.dbf` + - Add extension `.m4s` to `video/iso.segment` + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add extension `.mxmf` to `audio/mobile-xmf` + - Add extension `.opus` to `audio/ogg` + - Add extension `.rar` to `application/vnd.rar` + - Add extension `.td` to `application/urc-targetdesc+xml` + - Add extension `.trig` to `application/trig` + - Add extensions from IANA for `application/*+xml` types + - Add `image/avif` with extension `.avif` + - Add `image/ktx2` with extension `.ktx2` + - Add `image/vnd.ms-dds` with extension `.dds` + - Add new upstream MIME types + - Fix extension of `application/vnd.apple.keynote` to be `.key` + - Remove ambigious extensions from IANA for `application/*+xml` types + - Update primary extension to `.es` for `application/ecmascript` + +1.6.18 / 2019-04-26 +=================== + + * Fix regression passing request object to `typeis.is` + +1.6.17 / 2019-04-25 +=================== + + * deps: mime-types@~2.1.24 + - Add Apple file extensions from IANA + - Add extension `.csl` to `application/vnd.citationstyles.style+xml` + - Add extension `.es` to `application/ecmascript` + - Add extension `.nq` to `application/n-quads` + - Add extension `.nt` to `application/n-triples` + - Add extension `.owl` to `application/rdf+xml` + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add extensions from IANA for `image/*` types + - Add extensions from IANA for `model/*` types + - Add extensions to HEIC image types + - Add new mime types + - Add `text/mdx` with extension `.mdx` + * perf: prevent internal `throw` on invalid type + +1.6.16 / 2018-02-16 +=================== + + * deps: mime-types@~2.1.18 + - Add `application/raml+yaml` with extension `.raml` + - Add `application/wasm` with extension `.wasm` + - Add `text/shex` with extension `.shex` + - Add extensions for JPEG-2000 images + - Add extensions from IANA for `message/*` types + - Add extension `.mjs` to `application/javascript` + - Add extension `.wadl` to `application/vnd.sun.wadl+xml` + - Add extension `.gz` to `application/gzip` + - Add glTF types and extensions + - Add new mime types + - Update extensions `.md` and `.markdown` to be `text/markdown` + - Update font MIME types + - Update `text/hjson` to registered `application/hjson` + +1.6.15 / 2017-03-31 +=================== + + * deps: mime-types@~2.1.15 + - Add new mime types + +1.6.14 / 2016-11-18 +=================== + + * deps: mime-types@~2.1.13 + - Add new mime types + +1.6.13 / 2016-05-18 +=================== + + * deps: mime-types@~2.1.11 + - Add new mime types + +1.6.12 / 2016-02-28 +=================== + + * deps: mime-types@~2.1.10 + - Add new mime types + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + +1.6.11 / 2016-01-29 +=================== + + * deps: mime-types@~2.1.9 + - Add new mime types + +1.6.10 / 2015-12-01 +=================== + + * deps: mime-types@~2.1.8 + - Add new mime types + +1.6.9 / 2015-09-27 +================== + + * deps: mime-types@~2.1.7 + - Add new mime types + +1.6.8 / 2015-09-04 +================== + + * deps: mime-types@~2.1.6 + - Add new mime types + +1.6.7 / 2015-08-20 +================== + + * Fix type error when given invalid type to match against + * deps: mime-types@~2.1.5 + - Add new mime types + +1.6.6 / 2015-07-31 +================== + + * deps: mime-types@~2.1.4 + - Add new mime types + +1.6.5 / 2015-07-16 +================== + + * deps: mime-types@~2.1.3 + - Add new mime types + +1.6.4 / 2015-07-01 +================== + + * deps: mime-types@~2.1.2 + - Add new mime types + * perf: enable strict mode + * perf: remove argument reassignment + +1.6.3 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - Add new mime types + * perf: reduce try block size + * perf: remove bitwise operations + +1.6.2 / 2015-05-10 +================== + + * deps: mime-types@~2.0.11 + - Add new mime types + +1.6.1 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - Add new mime types + +1.6.0 / 2015-02-12 +================== + + * fix false-positives in `hasBody` `Transfer-Encoding` check + * support wildcard for both type and subtype (`*/*`) + +1.5.7 / 2015-02-09 +================== + + * fix argument reassignment + * deps: mime-types@~2.0.9 + - Add new mime types + +1.5.6 / 2015-01-29 +================== + + * deps: mime-types@~2.0.8 + - Add new mime types + +1.5.5 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - Add new mime types + - Fix missing extensions + - Fix various invalid MIME type entries + - Remove example template MIME types + - deps: mime-db@~1.5.0 + +1.5.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - Add new mime types + - deps: mime-db@~1.3.0 + +1.5.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - Add new mime types + - deps: mime-db@~1.2.0 + +1.5.2 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - Add new mime types + - deps: mime-db@~1.1.0 + +1.5.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + * deps: media-typer@0.3.0 + * deps: mime-types@~2.0.1 + - Support Node.js 0.6 + +1.5.0 / 2014-09-05 +================== + + * fix `hasbody` to be true for `content-length: 0` + +1.4.0 / 2014-09-02 +================== + + * update mime-types + +1.3.2 / 2014-06-24 +================== + + * use `~` range on mime-types + +1.3.1 / 2014-06-19 +================== + + * fix global variable leak + +1.3.0 / 2014-06-19 +================== + + * improve type parsing + + - invalid media type never matches + - media type not case-sensitive + - extra LWS does not affect results + +1.2.2 / 2014-06-19 +================== + + * fix behavior on unknown type argument + +1.2.1 / 2014-06-03 +================== + + * switch dependency from `mime` to `mime-types@1.0.0` + +1.2.0 / 2014-05-11 +================== + + * support suffix matching: + + - `+json` matches `application/vnd+json` + - `*/vnd+json` matches `application/vnd+json` + - `application/*+json` matches `application/vnd+json` + +1.1.0 / 2014-04-12 +================== + + * add non-array values support + * expose internal utilities: + + - `.is()` + - `.hasBody()` + - `.normalize()` + - `.match()` + +1.0.1 / 2014-03-30 +================== + + * add `multipart` as a shorthand diff --git a/node_modules/type-is/LICENSE b/node_modules/type-is/LICENSE new file mode 100644 index 0000000..386b7b6 --- /dev/null +++ b/node_modules/type-is/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/type-is/README.md b/node_modules/type-is/README.md new file mode 100644 index 0000000..d23946e --- /dev/null +++ b/node_modules/type-is/README.md @@ -0,0 +1,198 @@ +# type-is + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Infer the content-type of a request. + +## Install + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install type-is +``` + +## API + +```js +var http = require('http') +var typeis = require('type-is') + +http.createServer(function (req, res) { + var istext = typeis(req, ['text/*']) + res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text') +}) +``` + +### typeis(request, types) + +Checks if the `request` is one of the `types`. If the request has no body, +even if there is a `Content-Type` header, then `null` is returned. If the +`Content-Type` header is invalid or does not matches any of the `types`, then +`false` is returned. Otherwise, a string of the type that matched is returned. + +The `request` argument is expected to be a Node.js HTTP request. The `types` +argument is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +// req.headers.content-type = 'application/json' + +typeis(req, ['json']) // => 'json' +typeis(req, ['html', 'json']) // => 'json' +typeis(req, ['application/*']) // => 'application/json' +typeis(req, ['application/json']) // => 'application/json' + +typeis(req, ['html']) // => false +``` + +### typeis.hasBody(request) + +Returns a Boolean if the given `request` has a body, regardless of the +`Content-Type` header. + +Having a body has no relation to how large the body is (it may be 0 bytes). +This is similar to how file existence works. If a body does exist, then this +indicates that there is data to read from the Node.js request stream. + +```js +if (typeis.hasBody(req)) { + // read the body, since there is one + + req.on('data', function (chunk) { + // ... + }) +} +``` + +### typeis.is(mediaType, types) + +Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid +or does not matches any of the `types`, then `false` is returned. Otherwise, a +string of the type that matched is returned. + +The `mediaType` argument is expected to be a +[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument +is an array of type strings. + +Each type in the `types` array can be one of the following: + +- A file extension name such as `json`. This name will be returned if matched. +- A mime type such as `application/json`. +- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. + The full mime type will be returned if matched. +- A suffix such as `+json`. This can be combined with a wildcard such as + `*/vnd+json` or `application/*+json`. The full mime type will be returned + if matched. + +Some examples to illustrate the inputs and returned value: + +```js +var mediaType = 'application/json' + +typeis.is(mediaType, ['json']) // => 'json' +typeis.is(mediaType, ['html', 'json']) // => 'json' +typeis.is(mediaType, ['application/*']) // => 'application/json' +typeis.is(mediaType, ['application/json']) // => 'application/json' + +typeis.is(mediaType, ['html']) // => false +``` + +### typeis.match(expected, actual) + +Match the type string `expected` with `actual`, taking in to account wildcards. +A wildcard can only be in the type of the subtype part of a media type and only +in the `expected` value (as `actual` should be the real media type to match). A +suffix can still be included even with a wildcard subtype. If an input is +malformed, `false` will be returned. + +```js +typeis.match('text/html', 'text/html') // => true +typeis.match('*/html', 'text/html') // => true +typeis.match('text/*', 'text/html') // => true +typeis.match('*/*', 'text/html') // => true +typeis.match('*/*+json', 'application/x-custom+json') // => true +``` + +### typeis.normalize(type) + +Normalize a `type` string. This works by performing the following: + +- If the `type` is not a string, `false` is returned. +- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`), + then it is expanded to contain the complete wildcard notation of `*/*+suffix`. +- If the string contains a `/`, then it is returned as the type. +- Else the string is assumed to be a file extension and the mapped media type is + returned, or `false` is there is no mapping. + +This includes two special mappings: + +- `'multipart'` -> `'multipart/*'` +- `'urlencoded'` -> `'application/x-www-form-urlencoded'` + +## Examples + +### Example body parser + +```js +var express = require('express') +var typeis = require('type-is') + +var app = express() + +app.use(function bodyParser (req, res, next) { + if (!typeis.hasBody(req)) { + return next() + } + + switch (typeis(req, ['urlencoded', 'json', 'multipart'])) { + case 'urlencoded': + // parse urlencoded body + throw new Error('implement urlencoded body parsing') + case 'json': + // parse json body + throw new Error('implement json body parsing') + case 'multipart': + // parse multipart body + throw new Error('implement multipart body parsing') + default: + // 415 error code + res.statusCode = 415 + res.end() + break + } +}) +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci +[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master +[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master +[node-version-image]: https://badgen.net/npm/node/type-is +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/type-is +[npm-url]: https://npmjs.org/package/type-is +[npm-version-image]: https://badgen.net/npm/v/type-is +[travis-image]: https://badgen.net/travis/jshttp/type-is/master +[travis-url]: https://travis-ci.org/jshttp/type-is diff --git a/node_modules/type-is/index.js b/node_modules/type-is/index.js new file mode 100644 index 0000000..e773845 --- /dev/null +++ b/node_modules/type-is/index.js @@ -0,0 +1,250 @@ +/*! + * type-is + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var contentType = require('content-type') +var mime = require('mime-types') +var typer = require('media-typer') + +/** + * Module exports. + * @public + */ + +module.exports = typeofrequest +module.exports.is = typeis +module.exports.hasBody = hasbody +module.exports.normalize = normalize +module.exports.match = mimeMatch + +/** + * Compare a `value` content-type with `types`. + * Each `type` can be an extension like `html`, + * a special shortcut like `multipart` or `urlencoded`, + * or a mime type. + * + * If no types match, `false` is returned. + * Otherwise, the first `type` that matches is returned. + * + * @param {String} value + * @param {Array} types + * @public + */ + +function typeis (value, types_) { + var i + var types = types_ + + // remove parameters and normalize + var val = tryNormalizeType(value) + + // no type or invalid + if (!val) { + return false + } + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length - 1) + for (i = 0; i < types.length; i++) { + types[i] = arguments[i + 1] + } + } + + // no types, return the content type + if (!types || !types.length) { + return val + } + + var type + for (i = 0; i < types.length; i++) { + if (mimeMatch(normalize(type = types[i]), val)) { + return type[0] === '+' || type.indexOf('*') !== -1 + ? val + : type + } + } + + // no matches + return false +} + +/** + * Check if a request has a request body. + * A request with a body __must__ either have `transfer-encoding` + * or `content-length` headers set. + * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3 + * + * @param {Object} request + * @return {Boolean} + * @public + */ + +function hasbody (req) { + return req.headers['transfer-encoding'] !== undefined || + !isNaN(req.headers['content-length']) +} + +/** + * Check if the incoming request contains the "Content-Type" + * header field, and it contains any of the give mime `type`s. + * If there is no request body, `null` is returned. + * If there is no content type, `false` is returned. + * Otherwise, it returns the first `type` that matches. + * + * Examples: + * + * // With Content-Type: text/html; charset=utf-8 + * this.is('html'); // => 'html' + * this.is('text/html'); // => 'text/html' + * this.is('text/*', 'application/json'); // => 'text/html' + * + * // When Content-Type is application/json + * this.is('json', 'urlencoded'); // => 'json' + * this.is('application/json'); // => 'application/json' + * this.is('html', 'application/*'); // => 'application/json' + * + * this.is('html'); // => false + * + * @param {Object} req + * @param {(String|Array)} types... + * @return {(String|false|null)} + * @public + */ + +function typeofrequest (req, types_) { + // no body + if (!hasbody(req)) return null + // support flattened arguments + var types = arguments.length > 2 + ? Array.prototype.slice.call(arguments, 1) + : types_ + // request content type + var value = req.headers['content-type'] + + return typeis(value, types) +} + +/** + * Normalize a mime type. + * If it's a shorthand, expand it to a valid mime type. + * + * In general, you probably want: + * + * var type = is(req, ['urlencoded', 'json', 'multipart']); + * + * Then use the appropriate body parsers. + * These three are the most common request body types + * and are thus ensured to work. + * + * @param {String} type + * @return {String|false|null} + * @public + */ + +function normalize (type) { + if (typeof type !== 'string') { + // invalid type + return false + } + + switch (type) { + case 'urlencoded': + return 'application/x-www-form-urlencoded' + case 'multipart': + return 'multipart/*' + } + + if (type[0] === '+') { + // "+json" -> "*/*+json" expando + return '*/*' + type + } + + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if `expected` mime type + * matches `actual` mime type with + * wildcard and +suffix support. + * + * @param {String} expected + * @param {String} actual + * @return {Boolean} + * @public + */ + +function mimeMatch (expected, actual) { + // invalid type + if (expected === false) { + return false + } + + // split types + var actualParts = actual.split('/') + var expectedParts = expected.split('/') + + // invalid format + if (actualParts.length !== 2 || expectedParts.length !== 2) { + return false + } + + // validate type + if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) { + return false + } + + // validate suffix wildcard + if (expectedParts[1].slice(0, 2) === '*+') { + return expectedParts[1].length <= actualParts[1].length + 1 && + expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length) + } + + // validate subtype + if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) { + return false + } + + return true +} + +/** + * Normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function normalizeType (value) { + // Parse the type + var type = contentType.parse(value).type + + return typer.test(type) ? type : null +} + +/** + * Try to normalize a type and remove parameters. + * + * @param {string} value + * @return {(string|null)} + * @private + */ +function tryNormalizeType (value) { + try { + return value ? normalizeType(value) : null + } catch (err) { + return null + } +} diff --git a/node_modules/type-is/package.json b/node_modules/type-is/package.json new file mode 100644 index 0000000..08586d2 --- /dev/null +++ b/node_modules/type-is/package.json @@ -0,0 +1,47 @@ +{ + "name": "type-is", + "description": "Infer the content-type of a request.", + "version": "2.0.1", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/type-is", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "devDependencies": { + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "5.2.0", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.1", + "nyc": "15.1.0" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/", + "test-ci": "nyc --reporter=lcovonly --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "type", + "checking" + ] +} diff --git a/node_modules/typedarray-to-buffer/.airtap.yml b/node_modules/typedarray-to-buffer/.airtap.yml new file mode 100644 index 0000000..3417780 --- /dev/null +++ b/node_modules/typedarray-to-buffer/.airtap.yml @@ -0,0 +1,15 @@ +sauce_connect: true +loopback: airtap.local +browsers: + - name: chrome + version: latest + - name: firefox + version: latest + - name: safari + version: latest + - name: microsoftedge + version: latest + - name: ie + version: latest + - name: iphone + version: latest diff --git a/node_modules/typedarray-to-buffer/.travis.yml b/node_modules/typedarray-to-buffer/.travis.yml new file mode 100644 index 0000000..f25afbd --- /dev/null +++ b/node_modules/typedarray-to-buffer/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +node_js: + - lts/* +addons: + sauce_connect: true + hosts: + - airtap.local +env: + global: + - secure: i51rE9rZGHbcZWlL58j3H1qtL23OIV2r0X4TcQKNI3pw2mubdHFJmfPNNO19ItfReu8wwQMxOehKamwaNvqMiKWyHfn/QcThFQysqzgGZ6AgnUbYx9od6XFNDeWd1sVBf7QBAL07y7KWlYGWCwFwWjabSVySzQhEBdisPcskfkI= + - secure: BKq6/5z9LK3KDkTjs7BGeBZ1KsWgz+MsAXZ4P64NSeVGFaBdXU45+ww1mwxXFt5l22/mhyOQZfebQl+kGVqRSZ+DEgQeCymkNZ6CD8c6w6cLuOJXiXwuu/cDM2DD0tfGeu2YZC7yEikP7BqEFwH3D324rRzSGLF2RSAAwkOI7bE= diff --git a/node_modules/typedarray-to-buffer/LICENSE b/node_modules/typedarray-to-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/typedarray-to-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/typedarray-to-buffer/README.md b/node_modules/typedarray-to-buffer/README.md new file mode 100644 index 0000000..35761fb --- /dev/null +++ b/node_modules/typedarray-to-buffer/README.md @@ -0,0 +1,85 @@ +# typedarray-to-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/typedarray-to-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/typedarray-to-buffer +[npm-image]: https://img.shields.io/npm/v/typedarray-to-buffer.svg +[npm-url]: https://npmjs.org/package/typedarray-to-buffer +[downloads-image]: https://img.shields.io/npm/dm/typedarray-to-buffer.svg +[downloads-url]: https://npmjs.org/package/typedarray-to-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Convert a typed array to a [Buffer](https://github.com/feross/buffer) without a copy. + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[saucelabs-image]: https://saucelabs.com/browser-matrix/typedarray-to-buffer.svg +[saucelabs-url]: https://saucelabs.com/u/typedarray-to-buffer + +Say you're using the ['buffer'](https://github.com/feross/buffer) module on npm, or +[browserify](http://browserify.org/) and you're working with lots of binary data. + +Unfortunately, sometimes the browser or someone else's API gives you a typed array like +`Uint8Array` to work with and you need to convert it to a `Buffer`. What do you do? + +Of course: `Buffer.from(uint8array)` + +But, alas, every time you do `Buffer.from(uint8array)` **the entire array gets copied**. +The `Buffer` constructor does a copy; this is +defined by the [node docs](http://nodejs.org/api/buffer.html) and the 'buffer' module +matches the node API exactly. + +So, how can we avoid this expensive copy in +[performance critical applications](https://github.com/feross/buffer/issues/22)? + +***Simply use this module, of course!*** + +If you have an `ArrayBuffer`, you don't need this module, because +`Buffer.from(arrayBuffer)` +[is already efficient](https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length). + +## install + +```bash +npm install typedarray-to-buffer +``` + +## usage + +To convert a typed array to a `Buffer` **without a copy**, do this: + +```js +var toBuffer = require('typedarray-to-buffer') + +var arr = new Uint8Array([1, 2, 3]) +arr = toBuffer(arr) + +// arr is a buffer now! + +arr.toString() // '\u0001\u0002\u0003' +arr.readUInt16BE(0) // 258 +``` + +## how it works + +If the browser supports typed arrays, then `toBuffer` will **augment the typed array** you +pass in with the `Buffer` methods and return it. See [how does Buffer +work?](https://github.com/feross/buffer#how-does-it-work) for more about how augmentation +works. + +This module uses the typed array's underlying `ArrayBuffer` to back the new `Buffer`. This +respects the "view" on the `ArrayBuffer`, i.e. `byteOffset` and `byteLength`. In other +words, if you do `toBuffer(new Uint32Array([1, 2, 3]))`, then the new `Buffer` will +contain `[1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]`, **not** `[1, 2, 3]`. And it still doesn't +require a copy. + +If the browser doesn't support typed arrays, then `toBuffer` will create a new `Buffer` +object, copy the data into it, and return it. There's no simple performance optimization +we can do for old browsers. Oh well. + +If this module is used in node, then it will just call `Buffer.from`. This is just for +the convenience of modules that work in both node and the browser. + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/typedarray-to-buffer/index.js b/node_modules/typedarray-to-buffer/index.js new file mode 100644 index 0000000..5fa394d --- /dev/null +++ b/node_modules/typedarray-to-buffer/index.js @@ -0,0 +1,25 @@ +/** + * Convert a typed array to a Buffer without a copy + * + * Author: Feross Aboukhadijeh + * License: MIT + * + * `npm install typedarray-to-buffer` + */ + +var isTypedArray = require('is-typedarray').strict + +module.exports = function typedarrayToBuffer (arr) { + if (isTypedArray(arr)) { + // To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer + var buf = Buffer.from(arr.buffer) + if (arr.byteLength !== arr.buffer.byteLength) { + // Respect the "view", i.e. byteOffset and byteLength, without doing a copy + buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength) + } + return buf + } else { + // Pass through all other types to `Buffer.from` + return Buffer.from(arr) + } +} diff --git a/node_modules/typedarray-to-buffer/package.json b/node_modules/typedarray-to-buffer/package.json new file mode 100644 index 0000000..5ec5656 --- /dev/null +++ b/node_modules/typedarray-to-buffer/package.json @@ -0,0 +1,50 @@ +{ + "name": "typedarray-to-buffer", + "description": "Convert a typed array to a Buffer without a copy", + "version": "3.1.5", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org/" + }, + "bugs": { + "url": "https://github.com/feross/typedarray-to-buffer/issues" + }, + "dependencies": { + "is-typedarray": "^1.0.0" + }, + "devDependencies": { + "airtap": "0.0.4", + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "http://feross.org", + "keywords": [ + "buffer", + "typed array", + "convert", + "no copy", + "uint8array", + "uint16array", + "uint32array", + "int16array", + "int32array", + "float32array", + "float64array", + "browser", + "arraybuffer", + "dataview" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/typedarray-to-buffer.git" + }, + "scripts": { + "test": "standard && npm run test-node && npm run test-browser", + "test-browser": "airtap -- test/*.js", + "test-browser-local": "airtap --local -- test/*.js", + "test-node": "tape test/*.js" + } +} diff --git a/node_modules/typedarray-to-buffer/test/basic.js b/node_modules/typedarray-to-buffer/test/basic.js new file mode 100644 index 0000000..3521096 --- /dev/null +++ b/node_modules/typedarray-to-buffer/test/basic.js @@ -0,0 +1,50 @@ +var test = require('tape') +var toBuffer = require('../') + +test('convert to buffer from Uint8Array', function (t) { + if (typeof Uint8Array !== 'undefined') { + var arr = new Uint8Array([1, 2, 3]) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([1, 2, 3]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt8(0), 1) + t.equal(arr.readUInt8(1), 2) + t.equal(arr.readUInt8(2), 3) + } else { + t.pass('browser lacks Uint8Array support, skip test') + } + t.end() +}) + +test('convert to buffer from another arrayview type (Uint32Array)', function (t) { + if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) { + var arr = new Uint32Array([1, 2, 3]) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt32LE(0), 1) + t.equal(arr.readUInt32LE(4), 2) + t.equal(arr.readUInt32LE(8), 3) + t.equal(arr instanceof Uint8Array, true) + } else { + t.pass('browser lacks Uint32Array support, skip test') + } + t.end() +}) + +test('convert to buffer from ArrayBuffer', function (t) { + if (typeof Uint32Array !== 'undefined' && Buffer.TYPED_ARRAY_SUPPORT !== false) { + var arr = new Uint32Array([1, 2, 3]).subarray(1, 2) + arr = toBuffer(arr) + + t.deepEqual(arr, Buffer.from([2, 0, 0, 0]), 'contents equal') + t.ok(Buffer.isBuffer(arr), 'is buffer') + t.equal(arr.readUInt32LE(0), 2) + t.equal(arr instanceof Uint8Array, true) + } else { + t.pass('browser lacks ArrayBuffer support, skip test') + } + t.end() +}) diff --git a/node_modules/unescape/LICENSE b/node_modules/unescape/LICENSE new file mode 100644 index 0000000..8f77c6f --- /dev/null +++ b/node_modules/unescape/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2016-2017, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/unescape/README.md b/node_modules/unescape/README.md new file mode 100644 index 0000000..37142e6 --- /dev/null +++ b/node_modules/unescape/README.md @@ -0,0 +1,134 @@ +# unescape [![NPM version](https://img.shields.io/npm/v/unescape.svg?style=flat)](https://www.npmjs.com/package/unescape) [![NPM monthly downloads](https://img.shields.io/npm/dm/unescape.svg?style=flat)](https://npmjs.org/package/unescape) [![NPM total downloads](https://img.shields.io/npm/dt/unescape.svg?style=flat)](https://npmjs.org/package/unescape) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/unescape.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/unescape) + +> Convert HTML entities to HTML characters, e.g. `>` converts to `>`. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save unescape +``` + +## Usage + +```js +var decode = require('unescape'); + +console.log(decode('<div>abc</div>')); +//=> '
abc
' + +// get the default entities directly +console.log(decode.chars); +``` + +## Characters + +For performance, this library only handles the following common entities (split into groups for backward compatibility). + +### Default entities + +Only the following entities are converted by default. + +| **Character** | **Description** | **Entity Name** | **Entity Number** | +| --- | --- | --- | --- | +| `<` | less than | `<` | `<` | +| `>` | greater than | `>` | `>` | +| `&` | ampersand | `&` | `&` | +| `"` | double quotation mark | `"` | `"` | +| `'` | single quotation mark (apostrophe) | `'` | `'` | + +Get the default entities as an object: + +```js +console.log(decode.chars); +``` + +### Extra entities + +Only the following entities are converted when `'extras'` is passed as the second argument. + +| **Character** | **Description** | **Entity Name** | **Entity Number** | +| `¢` | cent | `¢` | `¢` | +| `£` | pound | `£` | `£` | +| `¥` | yen | `¥` | `¥` | +| `€` | euro | `€` | `€` | +| `©` | copyright | `©` | `©` | +| `®` | registered trademark | `®` | `®` | + +Example: + +```js +// convert only the "extras" characters +decode(str, 'extras'); +// get the object of `extras` characters +console.log(decode.extras); +``` + +### All entities + +Convert both the defaults and extras: + +```js +decode(str, 'all'); +``` + +Get all entities as an object: + +```js +console.log(decode.all); +``` + +## Alternatives + +If you need a more robust implementation, try one of the following libraries: + +* [html-entities](https://github.com/mdevils/node-html-entities) +* [ent](https://github.com/substack/node-ent) + +## About + +### Related projects + +* [html-elements](https://www.npmjs.com/package/html-elements): Array of all standard HTML and HTML5 elements. | [homepage](https://github.com/jonschlinkert/html-elements "Array of all standard HTML and HTML5 elements.") +* [html-tag](https://www.npmjs.com/package/html-tag): Generate HTML elements from a javascript object. | [homepage](https://github.com/jonschlinkert/html-tag "Generate HTML elements from a javascript object.") +* [html-toc](https://www.npmjs.com/package/html-toc): Generate a HTML table of contents using cheerio. | [homepage](https://github.com/jonschlinkert/html-toc "Generate a HTML table of contents using cheerio.") +* [is-self-closing](https://www.npmjs.com/package/is-self-closing): Returns true if the given name is a HTML void element or common SVG self-closing… [more](https://github.com/jonschlinkert/is-self-closing) | [homepage](https://github.com/jonschlinkert/is-self-closing "Returns true if the given name is a HTML void element or common SVG self-closing element.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 04, 2017._ \ No newline at end of file diff --git a/node_modules/unescape/index.js b/node_modules/unescape/index.js new file mode 100644 index 0000000..7592fb8 --- /dev/null +++ b/node_modules/unescape/index.js @@ -0,0 +1,103 @@ +'use strict'; + +var extend = require('extend-shallow'); +var regexCache = {}; +var all; + +var charSets = { + default: { + '"': '"', + '"': '"', + + ''': '\'', + ''': '\'', + + '&': '&', + '&': '&', + + '>': '>', + '>': '>', + + '<': '<', + '<': '<' + }, + extras: { + '¢': '¢', + '¢': '¢', + + '©': '©', + '©': '©', + + '€': '€', + '€': '€', + + '£': '£', + '£': '£', + + '®': '®', + '®': '®', + + '¥': '¥', + '¥': '¥' + } +}; + +// don't merge char sets unless "all" is explicitly called +Object.defineProperty(charSets, 'all', { + get: function() { + return all || (all = extend({}, charSets.default, charSets.extras)); + } +}); + +/** + * Convert HTML entities to HTML characters. + * + * @param {String} `str` String with HTML entities to un-escape. + * @return {String} + */ + +function unescape(str, type) { + if (!isString(str)) return ''; + var chars = charSets[type || 'default']; + var regex = toRegex(type, chars); + return str.replace(regex, function(m) { + return chars[m]; + }); +} + +function toRegex(type, chars) { + if (regexCache[type]) { + return regexCache[type]; + } + var keys = Object.keys(chars).join('|'); + var regex = new RegExp('(?=(' + keys + '))\\1', 'g'); + regexCache[type] = regex; + return regex; +} + +/** + * Returns true if str is a non-empty string + */ + +function isString(str) { + return str && typeof str === 'string'; +} + +/** + * Expose charSets + */ + +unescape.chars = charSets.default; +unescape.extras = charSets.extras; +// don't trip the "charSets" getter unless it's explicitly called +Object.defineProperty(unescape, 'all', { + get: function() { + return charSets.all; + } +}); + +/** + * Expose `unescape` + */ + +module.exports = unescape; diff --git a/node_modules/unescape/package.json b/node_modules/unescape/package.json new file mode 100644 index 0000000..cf63654 --- /dev/null +++ b/node_modules/unescape/package.json @@ -0,0 +1,67 @@ +{ + "name": "unescape", + "description": "Convert HTML entities to HTML characters, e.g. `>` converts to `>`.", + "version": "1.0.1", + "homepage": "https://github.com/jonschlinkert/unescape", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/unescape", + "bugs": { + "url": "https://github.com/jonschlinkert/unescape/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "keywords": [ + "char", + "character", + "characters", + "entities", + "entity", + "escape", + "html", + "string", + "un-escape", + "unescape", + "xml" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "html-elements", + "html-tag", + "html-toc", + "is-self-closing" + ] + }, + "reflinks": [ + "ent", + "html-entities" + ] + }, + "dependencies": { + "extend-shallow": "^2.0.1" + } +} diff --git a/node_modules/unpipe/HISTORY.md b/node_modules/unpipe/HISTORY.md new file mode 100644 index 0000000..85e0f8d --- /dev/null +++ b/node_modules/unpipe/HISTORY.md @@ -0,0 +1,4 @@ +1.0.0 / 2015-06-14 +================== + + * Initial release diff --git a/node_modules/unpipe/LICENSE b/node_modules/unpipe/LICENSE new file mode 100644 index 0000000..aed0138 --- /dev/null +++ b/node_modules/unpipe/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/unpipe/README.md b/node_modules/unpipe/README.md new file mode 100644 index 0000000..e536ad2 --- /dev/null +++ b/node_modules/unpipe/README.md @@ -0,0 +1,43 @@ +# unpipe + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Unpipe a stream from all destinations. + +## Installation + +```sh +$ npm install unpipe +``` + +## API + +```js +var unpipe = require('unpipe') +``` + +### unpipe(stream) + +Unpipes all destinations from a given stream. With stream 2+, this is +equivalent to `stream.unpipe()`. When used with streams 1 style streams +(typically Node.js 0.8 and below), this module attempts to undo the +actions done in `stream.pipe(dest)`. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/unpipe.svg +[npm-url]: https://npmjs.org/package/unpipe +[node-image]: https://img.shields.io/node/v/unpipe.svg +[node-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg +[travis-url]: https://travis-ci.org/stream-utils/unpipe +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master +[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg +[downloads-url]: https://npmjs.org/package/unpipe diff --git a/node_modules/unpipe/index.js b/node_modules/unpipe/index.js new file mode 100644 index 0000000..15c3d97 --- /dev/null +++ b/node_modules/unpipe/index.js @@ -0,0 +1,69 @@ +/*! + * unpipe + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = unpipe + +/** + * Determine if there are Node.js pipe-like data listeners. + * @private + */ + +function hasPipeDataListeners(stream) { + var listeners = stream.listeners('data') + + for (var i = 0; i < listeners.length; i++) { + if (listeners[i].name === 'ondata') { + return true + } + } + + return false +} + +/** + * Unpipe a stream from all destinations. + * + * @param {object} stream + * @public + */ + +function unpipe(stream) { + if (!stream) { + throw new TypeError('argument stream is required') + } + + if (typeof stream.unpipe === 'function') { + // new-style + stream.unpipe() + return + } + + // Node.js 0.8 hack + if (!hasPipeDataListeners(stream)) { + return + } + + var listener + var listeners = stream.listeners('close') + + for (var i = 0; i < listeners.length; i++) { + listener = listeners[i] + + if (listener.name !== 'cleanup' && listener.name !== 'onclose') { + continue + } + + // invoke the listener + listener.call(stream) + } +} diff --git a/node_modules/unpipe/package.json b/node_modules/unpipe/package.json new file mode 100644 index 0000000..a2b7358 --- /dev/null +++ b/node_modules/unpipe/package.json @@ -0,0 +1,27 @@ +{ + "name": "unpipe", + "description": "Unpipe a stream from all destinations", + "version": "1.0.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "stream-utils/unpipe", + "devDependencies": { + "istanbul": "0.3.15", + "mocha": "2.2.5", + "readable-stream": "1.1.13" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/node_modules/update-browserslist-db/LICENSE b/node_modules/update-browserslist-db/LICENSE new file mode 100644 index 0000000..377ae1b --- /dev/null +++ b/node_modules/update-browserslist-db/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Andrey Sitnik and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/update-browserslist-db/README.md b/node_modules/update-browserslist-db/README.md new file mode 100644 index 0000000..6a4770b --- /dev/null +++ b/node_modules/update-browserslist-db/README.md @@ -0,0 +1,30 @@ +# Update Browserslist DB + +Browserslist logo by Anton Popov + +CLI tool to update `caniuse-lite` with browsers DB +from [Browserslist](https://github.com/browserslist/browserslist/) config. + +Some queries like `last 2 versions` or `>1%` depend on actual data +from `caniuse-lite`. + +```sh +npx update-browserslist-db@latest +``` +Or if using `pnpm`: +```sh +pnpm exec update-browserslist-db latest +``` +Or if using `yarn`: +```sh +yarn dlx update-browserslist-db@latest +``` + + + Sponsored by Evil Martians + + +## Docs +Read full docs **[here](https://github.com/browserslist/update-db#readme)**. diff --git a/node_modules/update-browserslist-db/check-npm-version.js b/node_modules/update-browserslist-db/check-npm-version.js new file mode 100644 index 0000000..b06811a --- /dev/null +++ b/node_modules/update-browserslist-db/check-npm-version.js @@ -0,0 +1,17 @@ +let { execSync } = require('child_process') +let pico = require('picocolors') + +try { + let version = parseInt(execSync('npm -v')) + if (version <= 6) { + process.stderr.write( + pico.red( + 'Update npm or call ' + + pico.yellow('npx browserslist@latest --update-db') + + '\n' + ) + ) + process.exit(1) + } + // eslint-disable-next-line no-unused-vars +} catch (e) {} diff --git a/node_modules/update-browserslist-db/cli.js b/node_modules/update-browserslist-db/cli.js new file mode 100644 index 0000000..1388e94 --- /dev/null +++ b/node_modules/update-browserslist-db/cli.js @@ -0,0 +1,42 @@ +#!/usr/bin/env node + +let { readFileSync } = require('fs') +let { join } = require('path') + +require('./check-npm-version') +let updateDb = require('./') + +const ROOT = __dirname + +function getPackage() { + return JSON.parse(readFileSync(join(ROOT, 'package.json'))) +} + +let args = process.argv.slice(2) + +let USAGE = 'Usage:\n npx update-browserslist-db\n' + +function isArg(arg) { + return args.some(i => i === arg) +} + +function error(msg) { + process.stderr.write('update-browserslist-db: ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(getPackage().description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write('browserslist-lint ' + getPackage().version + '\n') +} else { + try { + updateDb() + } catch (e) { + if (e.name === 'BrowserslistUpdateError') { + error(e.message) + } else { + throw e + } + } +} diff --git a/node_modules/update-browserslist-db/index.d.ts b/node_modules/update-browserslist-db/index.d.ts new file mode 100644 index 0000000..7ae5acd --- /dev/null +++ b/node_modules/update-browserslist-db/index.d.ts @@ -0,0 +1,6 @@ +/** + * Run update and print output to terminal. + */ +declare function updateDb(print?: (str: string) => void): void + +export = updateDb diff --git a/node_modules/update-browserslist-db/index.js b/node_modules/update-browserslist-db/index.js new file mode 100644 index 0000000..4d6b439 --- /dev/null +++ b/node_modules/update-browserslist-db/index.js @@ -0,0 +1,348 @@ +let { execSync } = require('child_process') +let escalade = require('escalade/sync') +let { existsSync, readFileSync, writeFileSync } = require('fs') +let { join } = require('path') +let pico = require('picocolors') + +const { detectEOL, detectIndent } = require('./utils') + +function BrowserslistUpdateError(message) { + this.name = 'BrowserslistUpdateError' + this.message = message + this.browserslist = true + if (Error.captureStackTrace) { + Error.captureStackTrace(this, BrowserslistUpdateError) + } +} + +BrowserslistUpdateError.prototype = Error.prototype + +// Check if HADOOP_HOME is set to determine if this is running in a Hadoop environment +const IsHadoopExists = !!process.env.HADOOP_HOME +const yarnCommand = IsHadoopExists ? 'yarnpkg' : 'yarn' + +/* c8 ignore next 3 */ +function defaultPrint(str) { + process.stdout.write(str) +} + +function detectLockfile() { + let packageDir = escalade('.', (dir, names) => { + return names.indexOf('package.json') !== -1 ? dir : '' + }) + + if (!packageDir) { + throw new BrowserslistUpdateError( + 'Cannot find package.json. ' + + 'Is this the right directory to run `npx update-browserslist-db` in?' + ) + } + + let lockfileNpm = join(packageDir, 'package-lock.json') + let lockfileShrinkwrap = join(packageDir, 'npm-shrinkwrap.json') + let lockfileYarn = join(packageDir, 'yarn.lock') + let lockfilePnpm = join(packageDir, 'pnpm-lock.yaml') + let lockfileBun = join(packageDir, 'bun.lock') + let lockfileBunBinary = join(packageDir, 'bun.lockb') + + if (existsSync(lockfilePnpm)) { + return { file: lockfilePnpm, mode: 'pnpm' } + } else if (existsSync(lockfileBun) || existsSync(lockfileBunBinary)) { + return { file: lockfileBun, mode: 'bun' } + } else if (existsSync(lockfileNpm)) { + return { file: lockfileNpm, mode: 'npm' } + } else if (existsSync(lockfileYarn)) { + let lock = { file: lockfileYarn, mode: 'yarn' } + lock.content = readFileSync(lock.file).toString() + lock.version = /# yarn lockfile v1/.test(lock.content) ? 1 : 2 + return lock + } else if (existsSync(lockfileShrinkwrap)) { + return { file: lockfileShrinkwrap, mode: 'npm' } + } + throw new BrowserslistUpdateError( + 'No lockfile found. Run "npm install", "yarn install" or "pnpm install"' + ) +} + +function getLatestInfo(lock) { + if (lock.mode === 'yarn') { + if (lock.version === 1) { + return JSON.parse( + execSync(yarnCommand + ' info caniuse-lite --json').toString() + ).data + } else { + return JSON.parse( + execSync(yarnCommand + ' npm info caniuse-lite --json').toString() + ) + } + } + if (lock.mode === 'pnpm') { + return JSON.parse(execSync('pnpm info caniuse-lite --json').toString()) + } + if (lock.mode === 'bun') { + // TO-DO: No 'bun info' yet. Created issue: https://github.com/oven-sh/bun/issues/12280 + return JSON.parse(execSync(' npm info caniuse-lite --json').toString()) + } + + return JSON.parse(execSync('npm show caniuse-lite --json').toString()) +} + +function getBrowsers() { + let browserslist = require('browserslist') + return browserslist().reduce((result, entry) => { + if (!result[entry[0]]) { + result[entry[0]] = [] + } + result[entry[0]].push(entry[1]) + return result + }, {}) +} + +function diffBrowsers(old, current) { + let browsers = Object.keys(old).concat( + Object.keys(current).filter(browser => old[browser] === undefined) + ) + return browsers + .map(browser => { + let oldVersions = old[browser] || [] + let currentVersions = current[browser] || [] + let common = oldVersions.filter(v => currentVersions.includes(v)) + let added = currentVersions.filter(v => !common.includes(v)) + let removed = oldVersions.filter(v => !common.includes(v)) + return removed + .map(v => pico.red('- ' + browser + ' ' + v)) + .concat(added.map(v => pico.green('+ ' + browser + ' ' + v))) + }) + .reduce((result, array) => result.concat(array), []) + .join('\n') +} + +function updateNpmLockfile(lock, latest) { + let metadata = { latest, versions: [] } + let content = deletePackage(JSON.parse(lock.content), metadata) + metadata.content = JSON.stringify(content, null, detectIndent(lock.content)) + return metadata +} + +function deletePackage(node, metadata) { + if (node.dependencies) { + if (node.dependencies['caniuse-lite']) { + let version = node.dependencies['caniuse-lite'].version + metadata.versions[version] = true + delete node.dependencies['caniuse-lite'] + } + for (let i in node.dependencies) { + node.dependencies[i] = deletePackage(node.dependencies[i], metadata) + } + } + if (node.packages) { + for (let path in node.packages) { + if (path.endsWith('/caniuse-lite')) { + metadata.versions[node.packages[path].version] = true + delete node.packages[path] + } + } + } + return node +} + +let yarnVersionRe = /version "(.*?)"/ + +function updateYarnLockfile(lock, latest) { + let blocks = lock.content.split(/(\n{2,})/).map(block => { + return block.split('\n') + }) + let versions = {} + blocks.forEach(lines => { + if (lines[0].indexOf('caniuse-lite@') !== -1) { + let match = yarnVersionRe.exec(lines[1]) + versions[match[1]] = true + if (match[1] !== latest.version) { + lines[1] = lines[1].replace( + /version "[^"]+"/, + 'version "' + latest.version + '"' + ) + lines[2] = lines[2].replace( + /resolved "[^"]+"/, + 'resolved "' + latest.dist.tarball + '"' + ) + if (lines.length === 4) { + lines[3] = latest.dist.integrity + ? lines[3].replace( + /integrity .+/, + 'integrity ' + latest.dist.integrity + ) + : '' + } + } + } + }) + let content = blocks.map(lines => lines.join('\n')).join('') + return { content, versions } +} + +function updateLockfile(lock, latest) { + if (!lock.content) lock.content = readFileSync(lock.file).toString() + + let updatedLockFile + if (lock.mode === 'yarn') { + updatedLockFile = updateYarnLockfile(lock, latest) + } else { + updatedLockFile = updateNpmLockfile(lock, latest) + } + updatedLockFile.content = updatedLockFile.content.replace( + /\n/g, + detectEOL(lock.content) + ) + return updatedLockFile +} + +function updatePackageManually(print, lock, latest) { + let lockfileData = updateLockfile(lock, latest) + let caniuseVersions = Object.keys(lockfileData.versions).sort() + if (caniuseVersions.length === 1 && caniuseVersions[0] === latest.version) { + print( + 'Installed version: ' + + pico.bold(pico.green(caniuseVersions[0])) + + '\n' + + pico.bold(pico.green('caniuse-lite is up to date')) + + '\n' + ) + return + } + + if (caniuseVersions.length === 0) { + caniuseVersions[0] = 'none' + } + print( + 'Installed version' + + (caniuseVersions.length === 1 ? ': ' : 's: ') + + pico.bold(pico.red(caniuseVersions.join(', '))) + + '\n' + + 'Removing old caniuse-lite from lock file\n' + ) + writeFileSync(lock.file, lockfileData.content) + + let install = + lock.mode === 'yarn' ? yarnCommand + ' add -W' : lock.mode + ' install' + print( + 'Installing new caniuse-lite version\n' + + pico.yellow('$ ' + install + ' caniuse-lite baseline-browser-mapping') + + '\n' + ) + try { + execSync(install + ' caniuse-lite baseline-browser-mapping') + } catch (e) /* c8 ignore start */ { + print( + pico.red( + '\n' + + e.stack + + '\n\n' + + 'Problem with `' + + install + + ' caniuse-lite` call. ' + + 'Run it manually.\n' + ) + ) + process.exit(1) + } /* c8 ignore end */ + + let del = + lock.mode === 'yarn' ? yarnCommand + ' remove -W' : lock.mode + ' uninstall' + print( + 'Cleaning package.json dependencies from caniuse-lite\n' + + pico.yellow('$ ' + del + ' caniuse-lite baseline-browser-mapping') + + '\n' + ) + execSync(del + ' caniuse-lite baseline-browser-mapping') +} + +function updateWith(print, cmd) { + print('Updating caniuse-lite version\n' + pico.yellow('$ ' + cmd) + '\n') + try { + execSync(cmd) + } catch (e) /* c8 ignore start */ { + print(pico.red(e.stdout.toString())) + print( + pico.red( + '\n' + + e.stack + + '\n\n' + + 'Problem with `' + + cmd + + '` call. ' + + 'Run it manually.\n' + ) + ) + process.exit(1) + } /* c8 ignore end */ +} + +module.exports = function updateDB(print = defaultPrint) { + let lock = detectLockfile() + let latest = getLatestInfo(lock) + + let listError + let oldList + try { + oldList = getBrowsers() + } catch (e) { + listError = e + } + + print('Latest version: ' + pico.bold(pico.green(latest.version)) + '\n') + + if (lock.mode === 'yarn' && lock.version !== 1) { + updateWith( + print, + yarnCommand + ' up -R caniuse-lite baseline-browser-mapping' + ) + } else if (lock.mode === 'pnpm') { + let lockContent = readFileSync(lock.file).toString() + let packages = lockContent.includes('baseline-browser-mapping') + ? 'caniuse-lite baseline-browser-mapping' + : 'caniuse-lite' + updateWith(print, 'pnpm up --depth=Infinity --no-save ' + packages) + } else if (lock.mode === 'bun') { + updateWith(print, 'bun update caniuse-lite baseline-browser-mapping') + } else { + updatePackageManually(print, lock, latest) + } + + print('caniuse-lite has been successfully updated\n') + + let newList + if (!listError) { + try { + newList = getBrowsers() + } catch (e) /* c8 ignore start */ { + listError = e + } /* c8 ignore end */ + } + + if (listError) { + if (listError.message.includes("Cannot find module 'browserslist'")) { + print( + pico.gray( + 'Install `browserslist` to your direct dependencies ' + + 'to see target browser changes\n' + ) + ) + } else { + print( + pico.gray( + 'Problem with browser list retrieval.\n' + + 'Target browser changes won’t be shown.\n' + ) + ) + } + } else { + let changes = diffBrowsers(oldList, newList) + if (changes) { + print('\nTarget browser changes:\n') + print(changes + '\n') + } else { + print('\n' + pico.green('No target browser changes') + '\n') + } + } +} diff --git a/node_modules/update-browserslist-db/package.json b/node_modules/update-browserslist-db/package.json new file mode 100644 index 0000000..1c094d8 --- /dev/null +++ b/node_modules/update-browserslist-db/package.json @@ -0,0 +1,40 @@ +{ + "name": "update-browserslist-db", + "version": "1.2.2", + "description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config", + "keywords": [ + "caniuse", + "browsers", + "target" + ], + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "browserslist/update-db", + "types": "./index.d.ts", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + }, + "bin": "cli.js" +} diff --git a/node_modules/update-browserslist-db/utils.js b/node_modules/update-browserslist-db/utils.js new file mode 100644 index 0000000..c63b278 --- /dev/null +++ b/node_modules/update-browserslist-db/utils.js @@ -0,0 +1,25 @@ +const { EOL } = require('os') + +const getFirstRegexpMatchOrDefault = (text, regexp, defaultValue) => { + regexp.lastIndex = 0 // https://stackoverflow.com/a/11477448/4536543 + let match = regexp.exec(text) + if (match !== null) { + return match[1] + } else { + return defaultValue + } +} + +const DEFAULT_INDENT = ' ' +const INDENT_REGEXP = /^([ \t]+)[^\s]/m + +module.exports.detectIndent = text => + getFirstRegexpMatchOrDefault(text, INDENT_REGEXP, DEFAULT_INDENT) +module.exports.DEFAULT_INDENT = DEFAULT_INDENT + +const DEFAULT_EOL = EOL +const EOL_REGEXP = /(\r\n|\n|\r)/g + +module.exports.detectEOL = text => + getFirstRegexpMatchOrDefault(text, EOL_REGEXP, DEFAULT_EOL) +module.exports.DEFAULT_EOL = DEFAULT_EOL diff --git a/node_modules/urllib/LICENSE b/node_modules/urllib/LICENSE new file mode 100644 index 0000000..2ac9914 --- /dev/null +++ b/node_modules/urllib/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright(c) 2011 - 2014 fengmk2 and other contributors. +Copyright(c) 2015 - present node-modules and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/urllib/README.md b/node_modules/urllib/README.md new file mode 100644 index 0000000..a530ffa --- /dev/null +++ b/node_modules/urllib/README.md @@ -0,0 +1,462 @@ +# urllib@2 + +[![NPM version][npm-image]][npm-url] +[![Node.js CI](https://github.com/node-modules/urllib/actions/workflows/nodejs-2.x.yml/badge.svg)](https://github.com/node-modules/urllib/actions/workflows/nodejs-2.x.yml) +[![codecov](https://codecov.io/gh/node-modules/urllib/branch/2.x/graph/badge.svg?token=xXIihkywZr)](https://codecov.io/gh/node-modules/urllib) +[![Known Vulnerabilities][snyk-image]][snyk-url] +[![npm download][download-image]][download-url] + +[npm-image]: https://img.shields.io/npm/v/urllib.svg?style=flat-square +[npm-url]: https://npmjs.org/package/urllib +[snyk-image]: https://snyk.io/test/npm/urllib/badge.svg?style=flat-square +[snyk-url]: https://snyk.io/test/npm/urllib +[download-image]: https://img.shields.io/npm/dm/urllib.svg?style=flat-square +[download-url]: https://npmjs.org/package/urllib + +Request HTTP URLs in a complex world — basic +and digest authentication, redirections, cookies, timeout and more. + +## Install + +```bash +$ npm install urllib@2 --save +``` + +## Usage + +### callback + +```js +var urllib = require('urllib'); + +urllib.request('http://cnodejs.org/', function (err, data, res) { + if (err) { + throw err; // you need to handle error + } + console.log(res.statusCode); + console.log(res.headers); + // data is Buffer instance + console.log(data.toString()); +}); +``` + +### Promise + +If you've installed [bluebird][bluebird], +[bluebird][bluebird] will be used. +`urllib` does not install [bluebird][bluebird] for you. + +Otherwise, if you're using a node that has native v8 Promises (v0.11.13+), +then that will be used. + +Otherwise, this library will crash the process and exit, +so you might as well install [bluebird][bluebird] as a dependency! + +```js +var urllib = require('urllib'); + +urllib.request('http://nodejs.org').then(function (result) { + // result: {data: buffer, res: response object} + console.log('status: %s, body size: %d, headers: %j', result.res.statusCode, result.data.length, result.res.headers); +}).catch(function (err) { + console.error(err); +}); +``` + +### co & generator + +If you are using [co](https://github.com/visionmedia/co) or [koa](https://github.com/koajs/koa): + +```js +var co = require('co'); +var urllib = require('urllib'); + +co(function* () { + var result = yield urllib.requestThunk('http://nodejs.org'); + console.log('status: %s, body size: %d, headers: %j', + result.status, result.data.length, result.headers); +})(); +``` + +## Global `response` event + +You should create a urllib instance first. + +```js +var httpclient = require('urllib').create(); + +httpclient.on('response', function (info) { + error: err, + ctx: args.ctx, + req: { + url: url, + options: options, + size: requestSize, + }, + res: res +}); + +httpclient.request('http://nodejs.org', function (err, body) { + console.log('body size: %d', body.length); +}); +``` + +## API Doc + +### Method: `http.request(url[, options][, callback])` + +#### Arguments + +- **url** String | Object - The URL to request, either a String or a Object that return by [url.parse](http://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost). +- ***options*** Object - Optional + - ***method*** String - Request method, defaults to `GET`. Could be `GET`, `POST`, `DELETE` or `PUT`. Alias 'type'. + - ***data*** Object - Data to be sent. Will be stringify automatically. + - ***dataAsQueryString*** Boolean - Force convert `data` to query string. + - ***content*** String | [Buffer](http://nodejs.org/api/buffer.html) - Manually set the content of payload. If set, `data` will be ignored. + - ***stream*** [stream.Readable](http://nodejs.org/api/stream.html#stream_class_stream_readable) - Stream to be pipe to the remote. If set, `data` and `content` will be ignored. + - ***writeStream*** [stream.Writable](http://nodejs.org/api/stream.html#stream_class_stream_writable) - A writable stream to be piped by the response stream. Responding data will be write to this stream and `callback` will be called with `data` set `null` after finished writing. + - ***files*** {Array | Object | ReadStream | Buffer | String - The files will send with `multipart/form-data` format, base on `formstream`. If `method` not set, will use `POST` method by default. + - ***consumeWriteStream*** [true] - consume the writeStream, invoke the callback after writeStream close. + - ***contentType*** String - Type of request data. Could be `json` (**Notes**: not use `application/json` here). If it's `json`, will auto set `Content-Type: application/json` header. + - ***nestedQuerystring*** Boolean - urllib default use querystring to stringify form data which don't support nested object, will use [qs](https://github.com/ljharb/qs) instead of querystring to support nested object by set this option to true. + - ***dataType*** String - Type of response data. Could be `text` or `json`. If it's `text`, the `callback`ed `data` would be a String. If it's `json`, the `data` of callback would be a parsed JSON Object and will auto set `Accept: application/json` header. Default `callback`ed `data` would be a `Buffer`. + - **fixJSONCtlChars** Boolean - Fix the control characters (U+0000 through U+001F) before JSON parse response. Default is `false`. + - ***headers*** Object - Request headers. + - ***keepHeaderCase*** Boolean - by default will convert header keys to lowercase + - ***timeout*** Number | Array - Request timeout in milliseconds for connecting phase and response receiving phase. Defaults to `exports.TIMEOUT`, both are 5s. You can use `timeout: 5000` to tell urllib use same timeout on two phase or set them seperately such as `timeout: [3000, 5000]`, which will set connecting timeout to 3s and response 5s. + - ***auth*** String - `username:password` used in HTTP Basic Authorization. + - ***digestAuth*** String - `username:password` used in HTTP [Digest Authorization](http://en.wikipedia.org/wiki/Digest_access_authentication). + - ***agent*** [http.Agent](http://nodejs.org/api/http.html#http_class_http_agent) - HTTP Agent object. + Set `false` if you does not use agent. + - ***httpsAgent*** [https.Agent](http://nodejs.org/api/https.html#https_class_https_agent) - HTTPS Agent object. + Set `false` if you does not use agent. + - ***ca*** String | Buffer | Array - An array of strings or Buffers of trusted certificates. + If this is omitted several well known "root" CAs will be used, like VeriSign. + These are used to authorize connections. + **Notes**: This is necessary only if the server uses the self-signed certificate + - ***rejectUnauthorized*** Boolean - If true, the server certificate is verified against the list of supplied CAs. + An 'error' event is emitted if verification fails. Default: true. + - ***pfx*** String | Buffer - A string or Buffer containing the private key, + certificate and CA certs of the server in PFX or PKCS12 format. + - ***key*** String | Buffer - A string or Buffer containing the private key of the client in PEM format. + **Notes**: This is necessary only if using the client certificate authentication + - ***cert*** String | Buffer - A string or Buffer containing the certificate key of the client in PEM format. + **Notes**: This is necessary only if using the client certificate authentication + - ***passphrase*** String - A string of passphrase for the private key or pfx. + - ***ciphers*** String - A string describing the ciphers to use or exclude. + - ***secureProtocol*** String - The SSL method to use, e.g. SSLv3_method to force SSL version 3. + - ***followRedirect*** Boolean - follow HTTP 3xx responses as redirects. defaults to false. + - ***maxRedirects*** Number - The maximum number of redirects to follow, defaults to 10. + - ***formatRedirectUrl*** Function - Format the redirect url by your self. Default is `url.resolve(from, to)`. + - ***beforeRequest*** Function - Before request hook, you can change every thing here. + - ***streaming*** Boolean - let you get the `res` object when request connected, default `false`. alias `customResponse` + - ***gzip*** Boolean - Accept gzip response content and auto decode it, default is `false`. + - ***timing*** Boolean - Enable timing or not, default is `false`. + - ***enableProxy*** Boolean - Enable proxy request, default is `false`. + - ***proxy*** String | Object - proxy agent uri or options, default is `null`. + - ***lookup*** Function - Custom DNS lookup function, default is `dns.lookup`. Require node >= 4.0.0(for http protocol) and node >=8(for https protocol) + - ***checkAddress*** Function: optional, check request address to protect from SSRF and similar attacks. It receive tow arguments(`ip` and `family`) and should return true or false to identified the address is legal or not. It rely on `lookup` and have the same version requirement. + - ***trace*** Boolean - Enable capture stack include call site of library entrance, default is `false`. + - ***socketPath*** String - optional Unix Domain Socket. (Refer to [Node.js Document](https://nodejs.org/dist/latest-v14.x/docs/api/http.html#http_http_request_options_callback)) +- ***callback(err, data, res)*** Function - Optional callback. + - **err** Error - Would be `null` if no error accured. + - **data** Buffer | Object - The data responsed. Would be a Buffer if `dataType` is set to `text` or an JSON parsed into Object if it's set to `json`. + - **res** [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage) - The response. + +#### Returns + +[http.ClientRequest](http://nodejs.org/api/http.html#http_class_http_clientrequest) - The request. + +Calling `.abort()` method of the request stream can cancel the request. + +#### Options: `options.data` + +When making a request: + +```js +urllib.request('http://example.com', { + method: 'GET', + data: { + 'a': 'hello', + 'b': 'world' + } +}); +``` + +For `GET` request, `data` will be stringify to query string, e.g. `http://example.com/?a=hello&b=world`. + +For others like `POST`, `PATCH` or `PUT` request, +in defaults, the `data` will be stringify into `application/x-www-form-urlencoded` format +if `Content-Type` header is not set. + +If `Content-type` is `application/json`, the `data` will be `JSON.stringify` to JSON data format. + +#### Options: `options.content` + +`options.content` is useful when you wish to construct the request body by yourself, +for example making a `Content-Type: application/json` request. + +Notes that if you want to send a JSON body, you should stringify it yourself: + +```js +urllib.request('http://example.com', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + content: JSON.stringify({ + a: 'hello', + b: 'world' + }) +}); +``` + +It would make a HTTP request like: + +```http +POST / HTTP/1.1 +Host: example.com +Content-Type: application/json + +{ + "a": "hello", + "b": "world" +} +``` + +This exmaple can use `options.data` with `application/json` content type: + +```js +urllib.request('http://example.com', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + data: { + a: 'hello', + b: 'world' + } +}); +``` + +#### Options: `options.files` + +Upload a file with a `hello` field. + +```js +var urllib = request('urllib'); + +var req = urllib.request('http://my.server.com/upload', { + files: __filename, + data: { + hello: 'hello urllib', + }, +}, function (err, data, res) { + // upload finished +}); +``` + +Upload multi files with a `hello` field. + +```js +var urllib = request('urllib'); + +var req = urllib.request('http://my.server.com/upload', { + files: [ + __filename, + fs.createReadStream(__filename), + Buffer.from('mock file content'), + ], + data: { + hello: 'hello urllib with multi files', + }, +}, function (err, data, res) { + // upload finished +}); +``` + +Custom file field name with `uploadfile`. + +```js +var urllib = request('urllib'); + +var req = urllib.request('http://my.server.com/upload', { + files: { + uploadfile: __filename, + }, +}, function (err, data, res) { + // upload finished +}); +``` + +#### Options: `options.stream` + +Uploads a file with [formstream](https://github.com/node-modules/formstream): + +```js +var urllib = require('urllib'); +var formstream = require('formstream'); + +var form = formstream(); +form.file('file', __filename); +form.field('hello', '你好urllib'); + +var req = urllib.request('http://my.server.com/upload', { + method: 'POST', + headers: form.headers(), + stream: form +}, function (err, data, res) { + // upload finished +}); +``` + +### Response Object + +Response is normal object, it contains: + +* `status` or `statusCode`: response status code. + * `-1` meaning some network error like `ENOTFOUND` + * `-2` meaning ConnectionTimeoutError +* `statusMessage`: response status message. +* `headers`: response http headers, default is `{}` +* `size`: response size +* `aborted`: response was aborted or not +* `rt`: total request and response time in ms. +* `timing`: timing object if timing enable. +* `remoteAddress`: http server ip address +* `remotePort`: http server ip port +* `socketHandledRequests`: socket already handled request count +* `socketHandledResponses`: socket already handled response count + +#### Response: `res.aborted` + +If the underlaying connection was terminated before `response.end()` was called, +`res.aborted` should be `true`. + +```js +require('http').createServer(function (req, res) { + req.resume(); + req.on('end', function () { + res.write('foo haha\n'); + setTimeout(function () { + res.write('foo haha 2'); + setTimeout(function () { + res.socket.end(); + }, 300); + }, 200); + return; + }); +}).listen(1984); + +urllib.request('http://127.0.0.1:1984/socket.end', function (err, data, res) { + data.toString().should.equal('foo haha\nfoo haha 2'); + should.ok(res.aborted); + done(); +}); +``` + +### HttpClient2 + +HttpClient2 is a new instance for future. request method only return a promise, compatible with `async/await` and generator in co. + +#### Options + +options extends from urllib, besides below + +- ***retry*** Number - a retry count, when get an error, it will request again until reach the retry count. +- ***retryDelay*** Number - wait a delay(ms) between retries. +- ***isRetry*** Function - determine whether retry, a response object as the first argument. it will retry when status >= 500 by default. Request error is not included. + +#### Warning + +It's not supported by using retry and writeStream, because the retry request can't stop the stream which is consuming. + +## Proxy + +Support both `http` and `https` protocol. + +**Notice: Only support on Node.js >= 4.0.0** + +### Programming + +```js +urllib.request('https://twitter.com/', { + enableProxy: true, + proxy: 'http://localhost:8008', +}, (err, data, res) => { + console.log(res.status, res.headers); +}); +``` + +### System environment variable + +- http + +```bash +HTTP_PROXY=http://localhost:8008 +http_proxy=http://localhost:8008 +``` + +- https + +```bash +HTTP_PROXY=http://localhost:8008 +http_proxy=http://localhost:8008 +HTTPS_PROXY=https://localhost:8008 +https_proxy=https://localhost:8008 +``` + +```bash +$ http_proxy=http://localhost:8008 node index.js +``` + +### Trace +If set trace true, error stack will contains full call stack, like +``` +Error: connect ECONNREFUSED 127.0.0.1:11 + at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14) + -------------------- + at ~/workspace/urllib/lib/urllib.js:150:13 + at new Promise () + at Object.request (~/workspace/urllib/lib/urllib.js:149:10) + at Context. (~/workspace/urllib/test/urllib_promise.test.js:49:19) + .... +``` + +When open the trace, urllib may have poor perfomance, please consider carefully. + +## TODO + +* [ ] Support component +* [ ] Browser env use Ajax +* [√] Support Proxy +* [√] Upload file like form upload +* [√] Auto redirect handle +* [√] https & self-signed certificate +* [√] Connection timeout & Response timeout +* [√] Support `Accept-Encoding=gzip` by `options.gzip = true` +* [√] Support [Digest access authentication](http://en.wikipedia.org/wiki/Digest_access_authentication) + + + +## Contributors + +|[
fengmk2](https://github.com/fengmk2)
|[
dead-horse](https://github.com/dead-horse)
|[
xingrz](https://github.com/xingrz)
|[
popomore](https://github.com/popomore)
|[
JacksonTian](https://github.com/JacksonTian)
|[
ibigbug](https://github.com/ibigbug)
| +| :---: | :---: | :---: | :---: | :---: | :---: | +|[
greenkeeperio-bot](https://github.com/greenkeeperio-bot)
|[
atian25](https://github.com/atian25)
|[
paambaati](https://github.com/paambaati)
|[
denghongcai](https://github.com/denghongcai)
|[
XadillaX](https://github.com/XadillaX)
|[
alsotang](https://github.com/alsotang)
| +|[
leoner](https://github.com/leoner)
|[
hyj1991](https://github.com/hyj1991)
|[
isayme](https://github.com/isayme)
|[
killagu](https://github.com/killagu)
|[
cyjake](https://github.com/cyjake)
|[
whxaxes](https://github.com/whxaxes)
| +|[
chadxz](https://github.com/chadxz)
|[
danielwpz](https://github.com/danielwpz)
|[
danielsss](https://github.com/danielsss)
|[
Jeff-Tian](https://github.com/Jeff-Tian)
|[
jedahan](https://github.com/jedahan)
|[
nick-ng](https://github.com/nick-ng)
| +|[
rishavsharan](https://github.com/rishavsharan)
|[
willizm](https://github.com/willizm)
|[
davidkhala](https://github.com/davidkhala)
|[
aleafs](https://github.com/aleafs)
|[
Amunu](https://github.com/Amunu)
|[
azure-pipelines[bot]](https://github.com/apps/azure-pipelines)
| +|[
changzhiwin](https://github.com/changzhiwin)
|[
yuzhigang33](https://github.com/yuzhigang33)
|[
fishbar](https://github.com/fishbar)
|[
gxcsoccer](https://github.com/gxcsoccer)
|[
mars-coder](https://github.com/mars-coder)
|[
rockdai](https://github.com/rockdai)
| +[
dickeylth](https://github.com/dickeylth)
|[
aladdin-add](https://github.com/aladdin-add)
+ +This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Tue Jul 05 2022 16:17:31 GMT+0800`. + + + +## License + +[MIT](LICENSE) + + +[bluebird]: https://github.com/petkaantonov/bluebird diff --git a/node_modules/urllib/lib/detect_proxy_agent.js b/node_modules/urllib/lib/detect_proxy_agent.js new file mode 100644 index 0000000..e7240de --- /dev/null +++ b/node_modules/urllib/lib/detect_proxy_agent.js @@ -0,0 +1,31 @@ +'use strict'; + +var debug = require('util').debuglog('urllib:detect_proxy_agent'); +var getProxyFromURI = require('./get_proxy_from_uri'); + +var proxyAgents = {}; + +function detectProxyAgent(uri, args) { + if (!args.enableProxy && !process.env.URLLIB_ENABLE_PROXY) { + return null; + } + var proxy = args.proxy || process.env.URLLIB_PROXY; + if (!proxy) { + proxy = getProxyFromURI(uri); + if (!proxy) { + return null; + } + } + + var proxyAgent = proxyAgents[proxy]; + if (!proxyAgent) { + debug('create new proxy %s', proxy); + // lazy require, only support node >= 4 + proxyAgent = proxyAgents[proxy] = new (require('proxy-agent'))(proxy); + } + debug('get proxy: %s', proxy); + return proxyAgent; +} + +module.exports = detectProxyAgent; +module.exports.proxyAgents = proxyAgents; diff --git a/node_modules/urllib/lib/get_proxy_from_uri.js b/node_modules/urllib/lib/get_proxy_from_uri.js new file mode 100644 index 0000000..1ba14c7 --- /dev/null +++ b/node_modules/urllib/lib/get_proxy_from_uri.js @@ -0,0 +1,81 @@ +// copy from https://github.com/request/request/blob/90cf8c743bb9fd6a4cb683a56fb7844c6b316866/lib/getProxyFromURI.js + +'use strict' + +function formatHostname(hostname) { + // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' + return hostname.replace(/^\.*/, '.').toLowerCase() +} + +function parseNoProxyZone(zone) { + zone = zone.trim().toLowerCase() + + var zoneParts = zone.split(':', 2) + , zoneHost = formatHostname(zoneParts[0]) + , zonePort = zoneParts[1] + , hasPort = zone.indexOf(':') > -1 + + return {hostname: zoneHost, port: zonePort, hasPort: hasPort} +} + +function uriInNoProxy(uri, noProxy) { + var port = uri.port || (uri.protocol === 'https:' ? '443' : '80') + , hostname = formatHostname(uri.hostname) + , noProxyList = noProxy.split(',') + + // iterate through the noProxyList until it finds a match. + return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) { + var isMatchedAt = hostname.indexOf(noProxyZone.hostname) + , hostnameMatched = ( + isMatchedAt > -1 && + (isMatchedAt === hostname.length - noProxyZone.hostname.length) + ) + + if (noProxyZone.hasPort) { + return (port === noProxyZone.port) && hostnameMatched + } + + return hostnameMatched + }) +} + +function getProxyFromURI(uri) { + // Decide the proper request proxy to use based on the request URI object and the + // environmental variables (NO_PROXY, HTTP_PROXY, etc.) + // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html) + + var noProxy = process.env.NO_PROXY || process.env.no_proxy || '' + + // if the noProxy is a wildcard then return null + + if (noProxy === '*') { + return null + } + + // if the noProxy is not empty and the uri is found return null + + if (noProxy !== '' && uriInNoProxy(uri, noProxy)) { + return null + } + + // Check for HTTP or HTTPS Proxy in environment Else default to null + + if (uri.protocol === 'http:') { + return process.env.HTTP_PROXY || + process.env.http_proxy || null + } + + if (uri.protocol === 'https:') { + return process.env.HTTPS_PROXY || + process.env.https_proxy || + process.env.HTTP_PROXY || + process.env.http_proxy || null + } + + // if none of that works, return null + // (What uri protocol are you using then?) + + return null +} + +module.exports = getProxyFromURI diff --git a/node_modules/urllib/lib/httpclient.js b/node_modules/urllib/lib/httpclient.js new file mode 100644 index 0000000..a1cab8a --- /dev/null +++ b/node_modules/urllib/lib/httpclient.js @@ -0,0 +1,61 @@ +'use strict'; + +var EventEmitter = require('events').EventEmitter; +var util = require('util'); +var utility = require('utility'); +var urllib = require('./urllib'); + +module.exports = HttpClient; + +function HttpClient(options) { + EventEmitter.call(this); + options = options || {}; + + if (options.agent !== undefined) { + this.agent = options.agent; + this.hasCustomAgent = true; + } else { + this.agent = urllib.agent; + this.hasCustomAgent = false; + } + + if (options.httpsAgent !== undefined) { + this.httpsAgent = options.httpsAgent; + this.hasCustomHttpsAgent = true; + } else { + this.httpsAgent = urllib.httpsAgent; + this.hasCustomHttpsAgent = false; + } + this.defaultArgs = options.defaultArgs; +} +util.inherits(HttpClient, EventEmitter); + +HttpClient.prototype.request = HttpClient.prototype.curl = function (url, args, callback) { + if (typeof args === 'function') { + callback = args; + args = null; + } + args = args || {}; + if (this.defaultArgs) { + args = utility.assign({}, [ this.defaultArgs, args ]); + } + args.emitter = this; + args.agent = getAgent(args.agent, this.agent); + args.httpsAgent = getAgent(args.httpsAgent, this.httpsAgent); + return urllib.request(url, args, callback); +}; + +HttpClient.prototype.requestThunk = function (url, args) { + args = args || {}; + if (this.defaultArgs) { + args = utility.assign({}, [ this.defaultArgs, args ]); + } + args.emitter = this; + args.agent = getAgent(args.agent, this.agent); + args.httpsAgent = getAgent(args.httpsAgent, this.httpsAgent); + return urllib.requestThunk(url, args); +}; + +function getAgent(agent, defaultAgent) { + return agent === undefined ? defaultAgent : agent; +} diff --git a/node_modules/urllib/lib/httpclient2.js b/node_modules/urllib/lib/httpclient2.js new file mode 100644 index 0000000..504b112 --- /dev/null +++ b/node_modules/urllib/lib/httpclient2.js @@ -0,0 +1,83 @@ +'use strict'; + +var util = require('util'); +var debug = require('util').debuglog('urllib'); +var ms = require('humanize-ms'); +var HttpClient = require('./httpclient'); + +var _Promise; + +module.exports = HttpClient2; + +function HttpClient2(options) { + HttpClient.call(this, options); +} + +util.inherits(HttpClient2, HttpClient); + +HttpClient2.prototype.request = HttpClient2.prototype.curl = function request(url, args) { + var self = this; + args = args || {}; + args.retry = args.retry || 0; + if (args.retryDelay) { + args.retryDelay = ms(args.retryDelay); + } + args.isRetry = args.isRetry || function(res) { + return res.status >= 500; + }; + return HttpClient.prototype.request.call(self, url, args) + .then(function(res) { + if (args.retry > 0 && typeof args.isRetry === 'function' && args.isRetry(res)) { + args.retry--; + debug('retry request %s, remain %s', url, args.retry); + if (args.retryDelay) { + debug('retry after %sms', args.retryDelay); + return sleep(args.retryDelay).then(function() { return self.request(url, args); }); + } + return self.request(url, args); + } + return res; + }) + .catch(function(err) { + if (args.retry > 0) { + args.retry--; + debug('retry request %s, remain %s, err %s', url, args.retry, err); + if (args.retryDelay) { + debug('retry after %sms', args.retryDelay); + return sleep(args.retryDelay).then(function() { return self.request(url, args); }); + } + return self.request(url, args); + } + throw err; + }); +}; + +HttpClient2.prototype.requestThunk = function requestThunk(url, args) { + var self = this; + return function(callback) { + self.request(url, args) + .then(function(res) { + var cb = callback; + // make sure cb(null, res) throw error won't emit catch callback below + callback = null; + cb(null, res); + }) + .catch(function(err) { + if (!callback) { + // TODO: how to handle this error? + return; + } + callback(err); + }); + }; +}; + +function sleep(ms) { + if (!_Promise) { + _Promise = require('any-promise'); + } + + return new _Promise(function(resolve) { + setTimeout(resolve, ms); + }); +} diff --git a/node_modules/urllib/lib/index.d.ts b/node_modules/urllib/lib/index.d.ts new file mode 100644 index 0000000..9775d51 --- /dev/null +++ b/node_modules/urllib/lib/index.d.ts @@ -0,0 +1,280 @@ +import * as https from 'https'; +import * as http from 'http'; +import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; +import * as url from 'url'; +import { Readable, Writable } from 'stream'; +import { EventEmitter } from 'events'; +import { LookupFunction } from 'net'; + +export { IncomingHttpHeaders, OutgoingHttpHeaders }; +export type HttpMethod = "GET" | "POST" | "DELETE" | "PUT" | "HEAD" | "OPTIONS" | "PATCH" | "TRACE" | "CONNECT" + | "get" | "post" | "delete" | "put" | "head" | "options" | "patch" | "trace" | "connect"; + +export as namespace urllib; +export interface RequestOptions { + /** Request method, defaults to GET. Could be GET, POST, DELETE or PUT. Alias 'type'. */ + method?: HttpMethod; + /** Alias method */ + type?: HttpMethod; + /** Data to be sent. Will be stringify automatically. */ + data?: any; + /** Force convert data to query string. */ + dataAsQueryString?: boolean; + /** Manually set the content of payload. If set, data will be ignored. */ + content?: string | Buffer; + /** Stream to be pipe to the remote.If set, data and content will be ignored. */ + stream?: Readable; + /** + * A writable stream to be piped by the response stream. + * Responding data will be write to this stream and callback + * will be called with data set null after finished writing. + */ + writeStream?: Writable; + /** consume the writeStream, invoke the callback after writeStream close. */ + consumeWriteStream?: boolean; + /** + * The files will send with multipart/form-data format, base on formstream. + * If method not set, will use POST method by default. + */ + files?: Array | object | Readable | Buffer | string; + /** Type of request data.Could be json.If it's json, will auto set Content-Type: application/json header. */ + contentType?: string; + /** + * urllib default use querystring to stringify form data which don't support nested object, + * will use qs instead of querystring to support nested object by set this option to true. + */ + nestedQuerystring?: boolean; + /** + * Type of response data. Could be text or json. + * If it's text, the callbacked data would be a String. + * If it's json, the data of callback would be a parsed JSON Object + * and will auto set Accept: application/json header. Default callbacked data would be a Buffer. + */ + dataType?: string; + /** Fix the control characters (U+0000 through U+001F) before JSON parse response. Default is false. */ + fixJSONCtlChars?: boolean; + /** Request headers. */ + headers?: IncomingHttpHeaders; + /** by default will convert header keys to lowercase */ + keepHeaderCase?: boolean; + /** + * Request timeout in milliseconds for connecting phase and response receiving phase. + * Defaults to exports. + * TIMEOUT, both are 5s.You can use timeout: 5000 to tell urllib use same timeout on two phase or set them seperately such as + * timeout: [3000, 5000], which will set connecting timeout to 3s and response 5s. + */ + timeout?: number | number[]; + /** username:password used in HTTP Basic Authorization. */ + auth?: string; + /** username:password used in HTTP Digest Authorization. */ + digestAuth?: string; + /** HTTP Agent object.Set false if you does not use agent. */ + agent?: http.Agent; + /** HTTPS Agent object. Set false if you does not use agent. */ + httpsAgent?: https.Agent; + /** + * An array of strings or Buffers of trusted certificates. + * If this is omitted several well known "root" CAs will be used, like VeriSign. + * These are used to authorize connections. + * Notes: This is necessary only if the server uses the self - signed certificate + */ + ca?: string | Buffer | string[] | Buffer[]; + /** + * If true, the server certificate is verified against the list of supplied CAs. + * An 'error' event is emitted if verification fails.Default: true. + */ + rejectUnauthorized?: boolean; + /** A string or Buffer containing the private key, certificate and CA certs of the server in PFX or PKCS12 format. */ + pfx?: string | Buffer; + /** + * A string or Buffer containing the private key of the client in PEM format. + * Notes: This is necessary only if using the client certificate authentication + */ + key?: string | Buffer; + /** + * A string or Buffer containing the certificate key of the client in PEM format. + * Notes: This is necessary only if using the client certificate authentication + */ + cert?: string | Buffer; + /** A string of passphrase for the private key or pfx. */ + passphrase?: string; + /** A string describing the ciphers to use or exclude. */ + ciphers?: string; + /** The SSL method to use, e.g.SSLv3_method to force SSL version 3. */ + secureProtocol?: string; + /** follow HTTP 3xx responses as redirects. defaults to false. */ + followRedirect?: boolean; + /** The maximum number of redirects to follow, defaults to 10. */ + maxRedirects?: number; + /** Format the redirect url by your self. Default is url.resolve(from, to). */ + formatRedirectUrl?: (a: any, b: any) => void; + /** Before request hook, you can change every thing here. */ + beforeRequest?: (...args: any[]) => void; + /** let you get the res object when request connected, default false. alias customResponse */ + streaming?: boolean; + /** Accept gzip response content and auto decode it, default is false. */ + gzip?: boolean; + /** Enable timing or not, default is false. */ + timing?: boolean; + /** Enable proxy request, default is false. */ + enableProxy?: boolean; + /** proxy agent uri or options, default is null. */ + proxy?: string | { [key: string]: any }; + /** + * Custom DNS lookup function, default is dns.lookup. + * Require node >= 4.0.0(for http protocol) and node >=8(for https protocol) + */ + lookup?: LookupFunction; + /** + * check request address to protect from SSRF and similar attacks. + * It receive two arguments(ip and family) and should return true or false to identified the address is legal or not. + * It rely on lookup and have the same version requirement. + */ + checkAddress?: (ip: string, family: number | string, hostname: string) => boolean; + /** + * UNIX domain socket path. (Windows is not supported) + */ + socketPath?: string; +} + +export interface HttpClientResponse { + data: T; + status: number; + headers: OutgoingHttpHeaders; + res: http.IncomingMessage & { + /** + * https://eggjs.org/en/core/httpclient.html#timing-boolean + */ + timing?: { + queuing: number; + dnslookup: number; + connected: number; + requestSent: number; + waiting: number; + contentDownload: number; + } + }; +} + + +/** + * @param data Outgoing message + * @param res http response + */ +export type Callback = (err: Error, data: T, res: http.IncomingMessage) => void; + +/** + * Handle all http request, both http and https support well. + * + * @example + * // GET http://httptest.cnodejs.net + * urllib.request('http://httptest.cnodejs.net/test/get', function(err, data, res) {}); + * // POST http://httptest.cnodejs.net + * var args = { type: 'post', data: { foo: 'bar' } }; + * urllib.request('http://httptest.cnodejs.net/test/post', args, function(err, data, res) {}); + * + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function request(url: string | url.URL, options?: RequestOptions): Promise>; +/** + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function request(url: string | url.URL, callback: Callback): void; +/** + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function request(url: string | url.URL, options: RequestOptions, callback: Callback): void; + +/** + * Handle request with a callback. + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function requestWithCallback(url: string | url.URL, callback: Callback): void; +/** + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function requestWithCallback(url: string | url.URL, options: RequestOptions, callback: Callback): void; + +/** + * yield urllib.requestThunk(url, args) + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function requestThunk(url: string | url.URL, options?: RequestOptions): (callback: Callback) => void; + +/** + * alias to request. + * Handle all http request, both http and https support well. + * + * @example + * // GET http://httptest.cnodejs.net + * urllib.request('http://httptest.cnodejs.net/test/get', function(err, data, res) {}); + * // POST http://httptest.cnodejs.net + * var args = { type: 'post', data: { foo: 'bar' } }; + * urllib.request('http://httptest.cnodejs.net/test/post', args, function(err, data, res) {}); + * + * @param url The URL to request, either a String or a Object that return by url.parse. + * @param options Optional, @see RequestOptions. + */ +export function curl(url: string | url.URL, options?: RequestOptions): Promise>; +/** + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function curl(url: string | url.URL, callback: Callback): void; +/** + * @param url The URL to request, either a String or a Object that return by url.parse. + */ +export function curl(url: string | url.URL, options: RequestOptions, callback: Callback): void; +/** + * The default request timeout(in milliseconds). + */ +export const TIMEOUT: number; +/** + * The default request & response timeout(in milliseconds). + */ +export const TIMEOUTS: [number, number]; + +/** + * Request user agent. + */ +export const USER_AGENT: string; + +/** + * Request http agent. + */ +export const agent: http.Agent; + +/** + * Request https agent. + */ +export const httpsAgent: https.Agent; + +export class HttpClient extends EventEmitter { + request(url: string | url.URL): Promise>; + request(url: string | url.URL, options: O): Promise>; + request(url: string | url.URL, callback: Callback): void; + request(url: string | url.URL, options: O, callback: Callback): void; + + curl(url: string | url.URL, options: O): Promise>; + curl(url: string | url.URL): Promise>; + curl(url: string | url.URL, callback: Callback): void; + curl(url: string | url.URL, options: O, callback: Callback): void; + + requestThunk(url: string | url.URL, options?: O): (callback: (...args: any[]) => void) => void; +} + +export interface RequestOptions2 extends RequestOptions { + retry?: number; + retryDelay?: number; + isRetry?: (res: HttpClientResponse) => boolean; +} + +/** + * request method only return a promise, + * compatible with async/await and generator in co. + */ +export class HttpClient2 extends HttpClient {} + +/** + * Create a HttpClient instance. + */ +export function create(options?: RequestOptions): HttpClient; diff --git a/node_modules/urllib/lib/index.js b/node_modules/urllib/lib/index.js new file mode 100644 index 0000000..845ae90 --- /dev/null +++ b/node_modules/urllib/lib/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var urllib = require('./urllib'); + +exports.USER_AGENT = urllib.USER_AGENT; +exports.TIMEOUT = urllib.TIMEOUT; +exports.TIMEOUTS = urllib.TIMEOUTS; +exports.agent = urllib.agent; +exports.httpsAgent = urllib.httpsAgent; + +exports.curl = urllib.curl; +exports.request = urllib.request; +exports.requestWithCallback = urllib.requestWithCallback; +exports.requestThunk = urllib.requestThunk; + +exports.HttpClient = require('./httpclient'); +exports.HttpClient2 = require('./httpclient2'); + +exports.create = function (options) { + return new exports.HttpClient(options); +}; diff --git a/node_modules/urllib/lib/index.test-d.ts b/node_modules/urllib/lib/index.test-d.ts new file mode 100644 index 0000000..0a62ba2 --- /dev/null +++ b/node_modules/urllib/lib/index.test-d.ts @@ -0,0 +1,22 @@ +import { expectType } from 'tsd'; +import { curl } from '..'; + +// curl +expectType((await curl('http://a.com')).data); +// RequestOptions +expectType((await curl('http://a.com', {})).data); +expectType((await curl('http://a.com', { + method: 'HEAD', +})).data); +expectType((await curl('http://a.com', { + method: 'head', +})).data); + +// HttpClientResponse +const res = await curl('http://a.com'); +expectType(res.res.timing?.queuing); +expectType(res.res.timing?.dnslookup); +expectType(res.res.timing?.connected); +expectType(res.res.timing?.requestSent); +expectType(res.res.timing?.waiting); +expectType(res.res.timing?.contentDownload); diff --git a/node_modules/urllib/lib/urllib.js b/node_modules/urllib/lib/urllib.js new file mode 100644 index 0000000..61ce3d1 --- /dev/null +++ b/node_modules/urllib/lib/urllib.js @@ -0,0 +1,1317 @@ +'use strict'; + +var debug = require('util').debuglog('urllib'); +var path = require('path'); +var dns = require('dns'); +var net = require('net'); +var http = require('http'); +var https = require('https'); +var urlutil = require('url'); +var URL = urlutil.URL; +var util = require('util'); +var qs = require('qs'); +var querystring = require('querystring'); +var zlib = require('zlib'); +var ua = require('default-user-agent'); +var digestAuthHeader = require('digest-header'); +var ms = require('humanize-ms'); +var statuses = require('statuses'); +var contentTypeParser = require('content-type'); +var first = require('ee-first'); +var pump = require('pump'); +var utility = require('utility'); +var FormStream = require('formstream'); +var detectProxyAgent = require('./detect_proxy_agent'); + +var _Promise; +var _iconv; + +var pkg = require('../package.json'); + +var USER_AGENT = exports.USER_AGENT = ua('node-urllib', pkg.version); +var NODE_MAJOR_VERSION = parseInt(process.versions.node.split('.')[0]); + +// change Agent.maxSockets to 1000 +exports.agent = new http.Agent(); +exports.agent.maxSockets = 1000; + +exports.httpsAgent = new https.Agent(); +exports.httpsAgent.maxSockets = 1000; + +var LONG_STACK_DELIMITER = '\n --------------------\n'; + +/** + * The default request timeout(in milliseconds). + * @type {Number} + * @const + */ + +exports.TIMEOUT = ms('5s'); +exports.TIMEOUTS = [ms('5s'), ms('5s')]; + +var REQUEST_ID = 0; +var MAX_VALUE = Math.pow(2, 31) - 10; +var isNode010 = /^v0\.10\.\d+$/.test(process.version); +var isNode012 = /^v0\.12\.\d+$/.test(process.version); + +/** + * support data types + * will auto decode response body + * @type {Array} + */ +var TEXT_DATA_TYPES = [ + 'json', + 'text' +]; + +var PROTO_RE = /^https?:\/\//i; + +// Keep-Alive: timeout=5, max=100 +var KEEP_ALIVE_RE = /^timeout=(\d+)/i; + +var SOCKET_REQUEST_COUNT = '_URLLIB_SOCKET_REQUEST_COUNT'; +var SOCKET_RESPONSE_COUNT = '_URLLIB_SOCKET_RESPONSE_COUNT'; + +/** + * Handle all http request, both http and https support well. + * + * @example + * + * ```js + * // GET https://nodejs.org + * urllib.request('https://nodejs.org', function(err, data, res) {}); + * // POST https://nodejs.org + * var args = { type: 'post', data: { foo: 'bar' } }; + * urllib.request('https://nodejs.org', args, function(err, data, res) {}); + * ``` + * + * @param {String|Object} url: the request full URL. + * @param {Object} [args]: optional + * - {Object} [data]: request data, will auto be query stringify. + * - {Boolean} [dataAsQueryString]: force convert `data` to query string. + * - {String|Buffer} [content]: optional, if set content, `data` will ignore. + * - {ReadStream} [stream]: read stream to sent. + * - {WriteStream} [writeStream]: writable stream to save response data. + * If you use this, callback's data should be null. + * We will just `pipe(ws, {end: true})`. + * - {consumeWriteStream} [true]: consume the writeStream, invoke the callback after writeStream close. + * - {Array|Object|ReadStream|Buffer|String} [files]: optional, + * The files will send with `multipart/form-data` format, base on `formstream`. + * If `method` not set, will use `POST` method by default. + * - {String} [method]: optional, could be GET | POST | DELETE | PUT, default is GET + * - {String} [contentType]: optional, request data type, could be `json`, default is undefined + * - {String} [dataType]: optional, response data type, could be `text` or `json`, default is buffer + * - {Boolean|Function} [fixJSONCtlChars]: optional, fix the control characters (U+0000 through U+001F) + * before JSON parse response. Default is `false`. + * `fixJSONCtlChars` can be a function, will pass data to the first argument. e.g.: `data = fixJSONCtlChars(data)` + * - {Object} [headers]: optional, request headers + * - {Boolean} [keepHeaderCase]: optional, by default will convert header keys to lowercase + * - {Number|Array} [timeout]: request timeout(in milliseconds), default is `exports.TIMEOUTS containing connect timeout and response timeout` + * - {Agent} [agent]: optional, http agent. Set `false` if you does not use agent. + * - {Agent} [httpsAgent]: optional, https agent. Set `false` if you does not use agent. + * - {String} [auth]: Basic authentication i.e. 'user:password' to compute an Authorization header. + * - {String} [digestAuth]: Digest authentication i.e. 'user:password' to compute an Authorization header. + * - {String|Buffer|Array} [ca]: An array of strings or Buffers of trusted certificates. + * If this is omitted several well known "root" CAs will be used, like VeriSign. + * These are used to authorize connections. + * Notes: This is necessary only if the server uses the self-signed certificate + * - {Boolean} [rejectUnauthorized]: If true, the server certificate is verified against the list of supplied CAs. + * An 'error' event is emitted if verification fails. Default: true. + * - {String|Buffer} [pfx]: A string or Buffer containing the private key, + * certificate and CA certs of the server in PFX or PKCS12 format. + * - {String|Buffer} [key]: A string or Buffer containing the private key of the client in PEM format. + * Notes: This is necessary only if using the client certificate authentication + * - {String|Buffer} [cert]: A string or Buffer containing the certificate key of the client in PEM format. + * Notes: This is necessary only if using the client certificate authentication + * - {String} [passphrase]: A string of passphrase for the private key or pfx. + * - {String} [ciphers]: A string describing the ciphers to use or exclude. + * - {String} [secureProtocol]: The SSL method to use, e.g. SSLv3_method to force SSL version 3. + * The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS. + * - {Boolean} [followRedirect]: Follow HTTP 3xx responses as redirects. defaults to false. + * - {Number} [maxRedirects]: The maximum number of redirects to follow, defaults to 10. + * - {Function(from, to)} [formatRedirectUrl]: Format the redirect url by your self. Default is `url.resolve(from, to)` + * - {Function(options)} [beforeRequest]: Before request hook, you can change every thing here. + * - {Boolean} [streaming]: let you get the res object when request connected, default is `false`. alias `customResponse` + * - {Boolean} [gzip]: Accept gzip response content and auto decode it, default is `false`. + * - {Boolean} [timing]: Enable timing or not, default is `false`. + * - {Function} [lookup]: Custom DNS lookup function, default is `dns.lookup`. + * Require node >= 4.0.0 and only work on `http` protocol. + * - {Boolean} [enableProxy]: optional, enable proxy request. Default is `false`. + * - {String|Object} [proxy]: optional proxy agent uri or options. Default is `null`. + * - {String} [socketPath]: optional, unix domain socket file path. + * - {Function} checkAddress: optional, check request address to protect from SSRF and similar attacks. + * @param {Function} [callback]: callback(error, data, res). If missing callback, will return a promise object. + * @return {HttpRequest} req object. + * @api public + */ +exports.request = function request(url, args, callback) { + // request(url, callback) + if (arguments.length === 2 && typeof args === 'function') { + callback = args; + args = null; + } + if (typeof callback === 'function') { + return exports.requestWithCallback(url, args, callback); + } + + // Promise + if (!_Promise) { + _Promise = require('any-promise'); + } + return new _Promise(function (resolve, reject) { + exports.requestWithCallback(url, args, makeCallback(resolve, reject)); + }); +}; + +// alias to curl +exports.curl = exports.request; + +function makeCallback(resolve, reject) { + return function (err, data, res) { + if (err) { + return reject(err); + } + resolve({ + data: data, + status: res.statusCode, + headers: res.headers, + res: res + }); + }; +} + +// yield urllib.requestThunk(url, args) +exports.requestThunk = function requestThunk(url, args) { + return function (callback) { + exports.requestWithCallback(url, args, function (err, data, res) { + if (err) { + return callback(err); + } + callback(null, { + data: data, + status: res.statusCode, + headers: res.headers, + res: res + }); + }); + }; +}; + +function requestWithCallback(url, args, callback) { + var req; + // requestWithCallback(url, callback) + if (!url || (typeof url !== 'string' && typeof url !== 'object')) { + var msg = util.format('expect request url to be a string or a http request options, but got %j', url); + throw new Error(msg); + } + + if (arguments.length === 2 && typeof args === 'function') { + callback = args; + args = null; + } + + args = args || {}; + if (REQUEST_ID >= MAX_VALUE) { + REQUEST_ID = 0; + } + var reqId = ++REQUEST_ID; + + args.requestUrls = args.requestUrls || []; + + args.timeout = args.timeout || exports.TIMEOUTS; + args.maxRedirects = args.maxRedirects || 10; + args.streaming = args.streaming || args.customResponse; + var requestStartTime = Date.now(); + var parsedUrl; + + if (typeof url === 'string') { + if (!PROTO_RE.test(url)) { + // Support `request('www.server.com')` + url = 'http://' + url; + } + if (URL) { + parsedUrl = urlutil.parse(new URL(url).href); + } else { + parsedUrl = urlutil.parse(url); + } + } else { + parsedUrl = url; + } + + var reqMeta = { + requestId: reqId, + url: parsedUrl.href, + args: args, + ctx: args.ctx, + }; + if (args.emitter) { + args.emitter.emit('request', reqMeta); + } + + var method = (args.type || args.method || parsedUrl.method || 'GET').toUpperCase(); + var port = parsedUrl.port || 80; + var httplib = http; + var agent = getAgent(args.agent, exports.agent); + var fixJSONCtlChars = args.fixJSONCtlChars; + + if (parsedUrl.protocol === 'https:') { + httplib = https; + agent = getAgent(args.httpsAgent, exports.httpsAgent); + + if (!parsedUrl.port) { + port = 443; + } + } + + // request through proxy tunnel + var proxyTunnelAgent = detectProxyAgent(parsedUrl, args); + if (proxyTunnelAgent) { + agent = proxyTunnelAgent; + } + + var lookup = args.lookup; + // check address to protect from SSRF and similar attacks + if (args.checkAddress) { + var _lookup = lookup || dns.lookup; + lookup = function(host, dnsopts, callback) { + _lookup(host, dnsopts, function emitLookup(err, ip, family) { + // add check address logic in custom dns lookup + if (!err && !args.checkAddress(ip, family, host)) { + err = new Error('illegal address'); + err.name = 'IllegalAddressError'; + err.hostname = host; + err.ip = ip; + err.family = family; + } + callback(err, ip, family); + }); + }; + } + + var requestSize = 0; + var options = { + host: parsedUrl.hostname || parsedUrl.host || 'localhost', + path: parsedUrl.path || '/', + method: method, + port: port, + agent: agent, + headers: {}, + // default is dns.lookup + // https://github.com/nodejs/node/blob/master/lib/net.js#L986 + // custom dnslookup require node >= 4.0.0 (for http), node >=8 (for https) + // https://github.com/nodejs/node/blob/archived-io.js-v0.12/lib/net.js#L952 + lookup: lookup, + }; + + var originHeaderKeys = {}; + if (args.headers) { + // only allow enumerable and ownProperty value of args.headers + var names = utility.getOwnEnumerables(args.headers, true); + for (var i = 0; i < names.length; i++) { + var name = names[i]; + var key = name.toLowerCase(); + if (key !== name) { + originHeaderKeys[key] = name; + } + options.headers[key] = args.headers[name]; + } + } + if (args.socketPath) { + options.socketPath = args.socketPath; + } + + var sslNames = [ + 'pfx', + 'key', + 'passphrase', + 'cert', + 'ca', + 'ciphers', + 'rejectUnauthorized', + 'secureProtocol', + 'secureOptions', + ]; + for (var i = 0; i < sslNames.length; i++) { + var name = sslNames[i]; + if (args.hasOwnProperty(name)) { + options[name] = args[name]; + } + } + + // fix rejectUnauthorized when major version < 12 + if (NODE_MAJOR_VERSION < 12) { + if (options.rejectUnauthorized === false && !options.hasOwnProperty('secureOptions')) { + options.secureOptions = require('constants').SSL_OP_NO_TLSv1_2; + } + } + + var auth = args.auth || parsedUrl.auth; + if (auth) { + options.auth = auth; + } + + var body = null; + var dataAsQueryString = false; + + if (args.files) { + if (!options.method || options.method === 'GET' || options.method === 'HEAD') { + options.method = 'POST'; + } + var files = args.files; + var uploadFiles = []; + if (Array.isArray(files)) { + for (var i = 0; i < files.length; i++) { + var field = 'file' + (i === 0 ? '' : i); + uploadFiles.push([ field, files[i] ]); + } + } else { + if (Buffer.isBuffer(files) || typeof files.pipe === 'function' || typeof files === 'string') { + uploadFiles.push([ 'file', files ]); + } else if (typeof files === 'object') { + for (var field in files) { + uploadFiles.push([ field, files[field] ]); + } + } + } + var form = new FormStream(); + // set normal fields first + if (args.data) { + for (var fieldName in args.data) { + form.field(fieldName, args.data[fieldName]); + } + } + + for (var i = 0; i < uploadFiles.length; i++) { + var item = uploadFiles[i]; + if (Buffer.isBuffer(item[1])) { + form.buffer(item[0], item[1], 'bufferfile' + i); + } else if (typeof item[1].pipe === 'function') { + var filename = item[1].path || ('streamfile' + i); + filename = path.basename(filename); + form.stream(item[0], item[1], filename); + } else { + form.file(item[0], item[1]); + } + } + + var formHeaders = form.headers(); + var formHeaderNames = utility.getOwnEnumerables(formHeaders, true); + for (var i = 0; i < formHeaderNames.length; i++) { + var name = formHeaderNames[i]; + options.headers[name.toLowerCase()] = formHeaders[name]; + } + debug('set multipart headers: %j, method: %s', formHeaders, options.method); + args.stream = form; + } else { + body = args.content || args.data; + dataAsQueryString = method === 'GET' || method === 'HEAD' || args.dataAsQueryString; + if (!args.content) { + if (body && !(typeof body === 'string' || Buffer.isBuffer(body))) { + if (dataAsQueryString) { + // read: GET, HEAD, use query string + body = args.nestedQuerystring ? qs.stringify(body) : querystring.stringify(body); + } else { + var contentType = options.headers['content-type']; + // auto add application/x-www-form-urlencoded when using urlencode form request + if (!contentType) { + if (args.contentType === 'json') { + contentType = 'application/json'; + } else { + contentType = 'application/x-www-form-urlencoded'; + } + options.headers['content-type'] = contentType; + } + + if (parseContentType(contentType).type === 'application/json') { + body = JSON.stringify(body); + } else { + // 'application/x-www-form-urlencoded' + body = args.nestedQuerystring ? qs.stringify(body) : querystring.stringify(body); + } + } + } + } + } + + if (body) { + // if it's a GET or HEAD request, data should be sent as query string + if (dataAsQueryString) { + options.path += (parsedUrl.query ? '&' : '?') + body; + body = null; + } + + if (body) { + var length = body.length; + if (!Buffer.isBuffer(body)) { + length = Buffer.byteLength(body); + } + requestSize = length; + + options.headers['content-length'] = length.toString(); + } + } + + if (args.dataType === 'json') { + if (!options.headers.accept) { + options.headers.accept = 'application/json'; + } + } + + if (typeof args.beforeRequest === 'function') { + // you can use this hook to change every thing. + args.beforeRequest(options); + } + + var connectTimer = null; + var responseTimer = null; + var __err = null; + var connected = false; // socket connected or not + var keepAliveSocket = false; // request with keepalive socket + var socketHandledRequests = 0; // socket already handled request count + var socketHandledResponses = 0; // socket already handled response count + var responseSize = 0; + var statusCode = -1; + var statusMessage = null; + var responseAborted = false; + var remoteAddress = ''; + var remotePort = ''; + var timing = null; + if (args.timing) { + timing = { + // socket assigned + queuing: 0, + // dns lookup time + dnslookup: 0, + // socket connected + connected: 0, + // request sent + requestSent: 0, + // Time to first byte (TTFB) + waiting: 0, + contentDownload: 0, + }; + } + + function cancelConnectTimer() { + if (connectTimer) { + clearTimeout(connectTimer); + connectTimer = null; + debug('Request#%d connect timer canceled', reqId); + } + } + function cancelResponseTimer() { + if (responseTimer) { + clearTimeout(responseTimer); + responseTimer = null; + debug('Request#%d response timer canceled', reqId); + } + } + + function done(err, data, res) { + cancelConnectTimer(); + cancelResponseTimer(); + if (!callback) { + console.warn('[urllib:warn] [%s] [%s] [worker:%s] %s %s callback twice!!!', + Date(), reqId, process.pid, options.method, url); + // https://github.com/node-modules/urllib/pull/30 + if (err) { + console.warn('[urllib:warn] [%s] [%s] [worker:%s] %s: %s\nstack: %s', + Date(), reqId, process.pid, err.name, err.message, err.stack); + } + return; + } + + var cb = callback; + callback = null; + var headers = {}; + if (res) { + statusCode = res.statusCode; + statusMessage = res.statusMessage; + headers = res.headers; + } + + if (handleDigestAuth(res, cb)) { + return; + } + + var response = createCallbackResponse(data, res); + + debug('[%sms] done, %s bytes HTTP %s %s %s %s, keepAliveSocket: %s, timing: %j, socketHandledRequests: %s, socketHandledResponses: %s', + response.requestUseTime, responseSize, statusCode, options.method, options.host, options.path, + keepAliveSocket, timing, socketHandledRequests, socketHandledResponses); + + if (err) { + var agentStatus = ''; + if (agent && typeof agent.getCurrentStatus === 'function') { + // add current agent status to error message for logging and debug + agentStatus = ', agent status: ' + JSON.stringify(agent.getCurrentStatus()); + } + err.message += ', ' + options.method + ' ' + url + ' ' + statusCode + + ' (connected: ' + connected + ', keepalive socket: ' + keepAliveSocket + agentStatus + + ', socketHandledRequests: ' + socketHandledRequests + + ', socketHandledResponses: ' + socketHandledResponses + ')' + + '\nheaders: ' + JSON.stringify(headers); + err.data = data; + err.path = options.path; + err.status = statusCode; + err.headers = headers; + err.res = response; + addLongStackTrace(err, req); + } + + // only support agentkeepalive module for now + // agentkeepalive@4: agent.options.freeSocketTimeout + // agentkeepalive@3: agent.freeSocketKeepAliveTimeout + var freeSocketTimeout = agent && (agent.options && agent.options.freeSocketTimeout || agent.freeSocketKeepAliveTimeout); + if (agent && agent.keepAlive && freeSocketTimeout > 0 && + statusCode >= 200 && headers.connection === 'keep-alive' && headers['keep-alive']) { + // adjust freeSocketTimeout on the socket + var m = KEEP_ALIVE_RE.exec(headers['keep-alive']); + if (m) { + var seconds = parseInt(m[1]); + if (seconds > 0) { + // network delay 500ms + var serverSocketTimeout = seconds * 1000 - 500; + if (serverSocketTimeout < freeSocketTimeout) { + // https://github.com/node-modules/agentkeepalive/blob/master/lib/agent.js#L127 + // agentkeepalive@4 + var socket = res.socket || (req && req.socket); + if (agent.options && agent.options.freeSocketTimeout) { + socket.freeSocketTimeout = serverSocketTimeout; + } else { + socket.freeSocketKeepAliveTimeout = serverSocketTimeout; + } + } + } + } + } + + cb(err, data, args.streaming ? res : response); + + emitResponseEvent(err, response); + } + + function createAndEmitResponseEvent(data, res) { + var response = createCallbackResponse(data, res); + emitResponseEvent(null, response); + } + + function createCallbackResponse(data, res) { + var requestUseTime = Date.now() - requestStartTime; + if (timing) { + timing.contentDownload = requestUseTime; + } + + var headers = res && res.headers || {}; + var resStatusCode = res && res.statusCode || statusCode; + var resStatusMessage = res && res.statusMessage || statusMessage; + + return { + status: resStatusCode, + statusCode: resStatusCode, + statusMessage: resStatusMessage, + headers: headers, + size: responseSize, + aborted: responseAborted, + rt: requestUseTime, + keepAliveSocket: keepAliveSocket, + data: data, + requestUrls: args.requestUrls, + timing: timing, + remoteAddress: remoteAddress, + remotePort: remotePort, + socketHandledRequests: socketHandledRequests, + socketHandledResponses: socketHandledResponses, + }; + } + + function emitResponseEvent(err, response) { + if (args.emitter) { + // keep to use the same reqMeta object on request event before + reqMeta.url = parsedUrl.href; + reqMeta.socket = req && req.connection; + reqMeta.options = options; + reqMeta.size = requestSize; + + args.emitter.emit('response', { + requestId: reqId, + error: err, + ctx: args.ctx, + req: reqMeta, + res: response, + }); + } + } + + function handleDigestAuth(res, cb) { + var headers = {}; + if (res && res.headers) { + headers = res.headers; + } + // handle digest auth + if (statusCode === 401 && headers['www-authenticate'] + && !options.headers.authorization && args.digestAuth) { + var authenticate = headers['www-authenticate']; + if (authenticate.indexOf('Digest ') >= 0) { + debug('Request#%d %s: got digest auth header WWW-Authenticate: %s', reqId, url, authenticate); + options.headers.authorization = digestAuthHeader(options.method, options.path, authenticate, args.digestAuth); + debug('Request#%d %s: auth with digest header: %s', reqId, url, options.headers.authorization); + if (res.headers['set-cookie']) { + options.headers.cookie = res.headers['set-cookie'].join(';'); + } + args.headers = options.headers; + exports.requestWithCallback(url, args, cb); + return true; + } + } + return false; + } + + function handleRedirect(res) { + var err = null; + if (args.followRedirect && statuses.redirect[res.statusCode]) { // handle redirect + args._followRedirectCount = (args._followRedirectCount || 0) + 1; + var location = res.headers.location; + if (!location) { + err = new Error('Got statusCode ' + res.statusCode + ' but cannot resolve next location from headers'); + err.name = 'FollowRedirectError'; + } else if (args._followRedirectCount > args.maxRedirects) { + err = new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + url); + err.name = 'MaxRedirectError'; + } else { + var newUrl = args.formatRedirectUrl ? args.formatRedirectUrl(url, location) : urlutil.resolve(url, location); + debug('Request#%d %s: `redirected` from %s to %s', reqId, options.path, url, newUrl); + // make sure timer stop + cancelResponseTimer(); + // should clean up headers.host on `location: http://other-domain/url` + if (options.headers.host && PROTO_RE.test(location)) { + options.headers.host = null; + args.headers = options.headers; + } + // avoid done will be execute in the future change. + var cb = callback; + callback = null; + exports.requestWithCallback(newUrl, args, cb); + return { + redirect: true, + error: null + }; + } + } + return { + redirect: false, + error: err + }; + } + + // don't set user-agent + if (args.headers && (args.headers['User-Agent'] === null || args.headers['user-agent'] === null)) { + if (options.headers['user-agent']) { + delete options.headers['user-agent']; + } + } else { + // need to set user-agent + var hasAgentHeader = options.headers['user-agent']; + if (!hasAgentHeader) { + options.headers['user-agent'] = USER_AGENT; + } + } + + if (args.gzip) { + var isAcceptEncodingNull = (args.headers && (args.headers['Accept-Encoding'] === null || args.headers['accept-encoding'] === null)); + if (!isAcceptEncodingNull) { + var hasAcceptEncodingHeader = options.headers['accept-encoding']; + if (!hasAcceptEncodingHeader) { + options.headers['accept-encoding'] = 'gzip, deflate'; + } + } + } + + function decodeContent(res, body, cb) { + if (responseAborted) { + // err = new Error('Remote socket was terminated before `response.end()` was called'); + // err.name = 'RemoteSocketClosedError'; + debug('Request#%d %s: Remote socket was terminated before `response.end()` was called', reqId, url); + var err = responseError || new Error('Remote socket was terminated before `response.end()` was called'); + return cb(err); + } + var encoding = res.headers['content-encoding']; + if (body.length === 0 || !encoding) { + return cb(null, body, encoding); + } + + encoding = encoding.toLowerCase(); + switch (encoding) { + case 'gzip': + case 'deflate': + debug('unzip %d length body', body.length); + zlib.unzip(body, function(err, data) { + if (err && err.name === 'Error') { + err.name = 'UnzipError'; + } + cb(err, data); + }); + break; + default: + cb(null, body, encoding); + } + } + + var writeStream = args.writeStream; + var isWriteStreamClose = false; + + debug('Request#%d %s %s with headers %j, options.path: %s', + reqId, method, url, options.headers, options.path); + + args.requestUrls.push(parsedUrl.href); + + var hasResponse = false; + var responseError; + function onResponse(res) { + hasResponse = true; + socketHandledResponses = res.socket[SOCKET_RESPONSE_COUNT] = (res.socket[SOCKET_RESPONSE_COUNT] || 0) + 1; + if (timing) { + timing.waiting = Date.now() - requestStartTime; + } + debug('Request#%d %s `req response` event emit: status %d, headers: %j', + reqId, url, res.statusCode, res.headers); + + if (args.streaming) { + var result = handleRedirect(res); + if (result.redirect) { + res.resume(); + createAndEmitResponseEvent(null, res); + return; + } + if (result.error) { + res.resume(); + return done(result.error, null, res); + } + + return done(null, null, res); + } + + res.on('error', function (err) { + responseError = err; + debug('Request#%d %s: `res error` event emit, total size %d, socket handled %s requests and %s responses', + reqId, url, responseSize, socketHandledRequests, socketHandledResponses); + }); + + res.on('aborted', function () { + responseAborted = true; + debug('Request#%d %s: `res aborted` event emit, total size %d', + reqId, url, responseSize); + }); + + if (writeStream) { + // If there's a writable stream to recieve the response data, just pipe the + // response stream to that writable stream and call the callback when it has + // finished writing. + // + // NOTE that when the response stream `res` emits an 'end' event it just + // means that it has finished piping data to another stream. In the + // meanwhile that writable stream may still writing data to the disk until + // it emits a 'close' event. + // + // That means that we should not apply callback until the 'close' of the + // writable stream is emited. + // + // See also: + // - https://github.com/TBEDP/urllib/commit/959ac3365821e0e028c231a5e8efca6af410eabb + // - http://nodejs.org/api/stream.html#stream_event_end + // - http://nodejs.org/api/stream.html#stream_event_close_1 + var result = handleRedirect(res); + if (result.redirect) { + res.resume(); + createAndEmitResponseEvent(null, res); + return; + } + if (result.error) { + res.resume(); + // end ths stream first + writeStream.end(); + done(result.error, null, res); + return; + } + + // you can set consumeWriteStream false that only wait response end + if (args.consumeWriteStream === false) { + res.on('end', done.bind(null, null, null, res)); + pump(res, writeStream, function(err) { + if (isWriteStreamClose) { + return; + } + isWriteStreamClose = true; + debug('Request#%d %s: writeStream close, error: %s', reqId, url, err); + }); + return; + } + + // node 0.10, 0.12: only emit res aborted, writeStream close not fired + if (isNode010 || isNode012) { + first([ + [ writeStream, 'close' ], + [ res, 'aborted' ], + ], function(_, stream, event) { + debug('Request#%d %s: writeStream or res %s event emitted', reqId, url, event); + done(__err || null, null, res); + }); + res.pipe(writeStream); + return; + } + + debug('Request#%d %s: pump res to writeStream', reqId, url); + pump(res, writeStream, function(err) { + debug('Request#%d %s: writeStream close event emitted, error: %s, isWriteStreamClose: %s', + reqId, url, err, isWriteStreamClose); + if (isWriteStreamClose) { + return; + } + isWriteStreamClose = true; + done(__err || err, null, res); + }); + return; + } + + // Otherwise, just concat those buffers. + // + // NOTE that the `chunk` is not a String but a Buffer. It means that if + // you simply concat two chunk with `+` you're actually converting both + // Buffers into Strings before concating them. It'll cause problems when + // dealing with multi-byte characters. + // + // The solution is to store each chunk in an array and concat them with + // 'buffer-concat' when all chunks is recieved. + // + // See also: + // http://cnodejs.org/topic/4faf65852e8fb5bc65113403 + + var chunks = []; + + res.on('data', function (chunk) { + debug('Request#%d %s: `res data` event emit, size %d', reqId, url, chunk.length); + responseSize += chunk.length; + chunks.push(chunk); + }); + + var isEmitted = false; + function handleResponseCloseAndEnd(event) { + debug('Request#%d %s: `res %s` event emit, total size %d, socket handled %s requests and %s responses', + reqId, url, event, responseSize, socketHandledRequests, socketHandledResponses); + if (isEmitted) { + return; + } + isEmitted = true; + + var body = Buffer.concat(chunks, responseSize); + debug('Request#%d %s: _dumped: %s', + reqId, url, res._dumped); + + if (__err) { + // req.abort() after `res data` event emit. + return done(__err, body, res); + } + + var result = handleRedirect(res); + if (result.error) { + return done(result.error, body, res); + } + if (result.redirect) { + createAndEmitResponseEvent(null, res); + return; + } + + decodeContent(res, body, function (err, data, encoding) { + if (err) { + return done(err, body, res); + } + // if body not decode, dont touch it + if (!encoding && TEXT_DATA_TYPES.indexOf(args.dataType) >= 0) { + // try to decode charset + try { + data = decodeBodyByCharset(data, res); + } catch (e) { + debug('decodeBodyByCharset error: %s', e); + // if error, dont touch it + return done(null, data, res); + } + + if (args.dataType === 'json') { + if (responseSize === 0) { + data = null; + } else { + var r = parseJSON(data, fixJSONCtlChars); + if (r.error) { + err = r.error; + } else { + data = r.data; + } + } + } + } + + done(err, data, res); + }); + } + + // node >= 14 only emit close if req abort + res.on('close', function () { + handleResponseCloseAndEnd('close'); + }); + res.on('end', function () { + handleResponseCloseAndEnd('end'); + }); + } + + var connectTimeout, responseTimeout; + if (Array.isArray(args.timeout)) { + connectTimeout = ms(args.timeout[0]); + responseTimeout = ms(args.timeout[1]); + } else { // set both timeout equal + connectTimeout = responseTimeout = ms(args.timeout); + } + debug('ConnectTimeout: %d, ResponseTimeout: %d', connectTimeout, responseTimeout); + + function startConnectTimer() { + debug('Connect timer ticking, timeout: %d', connectTimeout); + connectTimer = setTimeout(function () { + connectTimer = null; + if (statusCode === -1) { + statusCode = -2; + } + var msg = 'Connect timeout for ' + connectTimeout + 'ms'; + var errorName = 'ConnectionTimeoutError'; + if (!req.socket) { + errorName = 'SocketAssignTimeoutError'; + msg += ', working sockets is full'; + } + __err = new Error(msg); + __err.name = errorName; + __err.requestId = reqId; + debug('ConnectTimeout: Request#%d %s %s: %s, connected: %s', reqId, url, __err.name, msg, connected); + abortRequest(); + }, connectTimeout); + } + + function startResposneTimer() { + debug('Response timer ticking, timeout: %d', responseTimeout); + responseTimer = setTimeout(function () { + responseTimer = null; + var msg = 'Response timeout for ' + responseTimeout + 'ms'; + var errorName = 'ResponseTimeoutError'; + __err = new Error(msg); + __err.name = errorName; + __err.requestId = reqId; + debug('ResponseTimeout: Request#%d %s %s: %s, connected: %s', reqId, url, __err.name, msg, connected); + abortRequest(); + }, responseTimeout); + } + + if (args.checkAddress) { + var hostname = parsedUrl.hostname; + // if request hostname is ip, custom lookup wont execute + var family = null; + if (net.isIPv4(hostname)) { + family = 4; + } else if (net.isIPv6(hostname)) { + family = 6; + } + if (family) { + if (!args.checkAddress(hostname, family, hostname)) { + var err = new Error('illegal address'); + err.name = 'IllegalAddressError'; + err.hostname = hostname; + err.ip = hostname; + err.family = family; + return done(err); + } + } + } + + // request headers checker will throw error + try { + var finalOptions = options; + + // restore origin header key + if (args.keepHeaderCase) { + var originKeys = Object.keys(originHeaderKeys); + if (originKeys.length) { + var finalHeaders = {}; + var names = utility.getOwnEnumerables(options.headers, true); + for (var i = 0; i < names.length; i++) { + var name = names[i]; + finalHeaders[originHeaderKeys[name] || name] = options.headers[name]; + } + + finalOptions = Object.assign({}, options); + finalOptions.headers = finalHeaders; + } + } + + req = httplib.request(finalOptions, onResponse); + if (args.trace) { + req._callSite = {}; + Error.captureStackTrace(req._callSite, requestWithCallback); + } + } catch (err) { + return done(err); + } + + // environment detection: browser or nodejs + if (typeof(window) === 'undefined') { + // start connect timer just after `request` return, and just in nodejs environment + startConnectTimer(); + } + + var isRequestAborted = false; + function abortRequest() { + if (isRequestAborted) { + return; + } + isRequestAborted = true; + + debug('Request#%d %s abort, connected: %s', reqId, url, connected); + // it wont case error event when req haven't been assigned a socket yet. + if (!req.socket) { + __err.noSocket = true; + done(__err); + } + req.abort(); + } + + if (timing) { + // request sent + req.on('finish', function() { + timing.requestSent = Date.now() - requestStartTime; + }); + } + + req.once('socket', function (socket) { + if (timing) { + // socket queuing time + timing.queuing = Date.now() - requestStartTime; + } + + // https://github.com/nodejs/node/blob/master/lib/net.js#L377 + // https://github.com/nodejs/node/blob/v0.10.40-release/lib/net.js#L352 + // should use socket.socket on 0.10.x + if (isNode010 && socket.socket) { + socket = socket.socket; + } + + var orginalSocketTimeout = getSocketTimeout(socket); + if (orginalSocketTimeout && orginalSocketTimeout < responseTimeout) { + // make sure socket live longer than the response timer + var socketTimeout = responseTimeout + 500; + debug('Request#%d socket.timeout(%s) < responseTimeout(%s), reset socket timeout to %s', + reqId, orginalSocketTimeout, responseTimeout, socketTimeout); + socket.setTimeout(socketTimeout); + } + + socketHandledRequests = socket[SOCKET_REQUEST_COUNT] = (socket[SOCKET_REQUEST_COUNT] || 0) + 1; + if (socket[SOCKET_RESPONSE_COUNT]) { + socketHandledResponses = socket[SOCKET_RESPONSE_COUNT]; + } + + var readyState = socket.readyState; + if (readyState === 'opening') { + socket.once('lookup', function(err, ip, addressType) { + debug('Request#%d %s lookup: %s, %s, %s', reqId, url, err, ip, addressType); + if (timing) { + timing.dnslookup = Date.now() - requestStartTime; + } + if (ip) { + remoteAddress = ip; + } + }); + socket.once('connect', function() { + if (timing) { + // socket connected + timing.connected = Date.now() - requestStartTime; + } + + // cancel socket timer at first and start tick for TTFB + cancelConnectTimer(); + startResposneTimer(); + + debug('Request#%d %s new socket connected', reqId, url); + connected = true; + if (!remoteAddress) { + remoteAddress = socket.remoteAddress; + } + remotePort = socket.remotePort; + }); + return; + } + + debug('Request#%d %s reuse socket connected, readyState: %s', reqId, url, readyState); + connected = true; + keepAliveSocket = true; + if (!remoteAddress) { + remoteAddress = socket.remoteAddress; + } + remotePort = socket.remotePort; + + // reuse socket, timer should be canceled. + cancelConnectTimer(); + startResposneTimer(); + }); + + if (writeStream) { + writeStream.once('error', function(err) { + err.message += ' (writeStream "error")'; + __err = err; + debug('Request#%d %s `writeStream error` event emit, %s: %s', reqId, url, err.name, err.message); + abortRequest(); + }); + } + + var isRequestDone = false; + function handleRequestError(err) { + if (!err) { + return; + } + // only ignore request error if response has been received + // if response has not received, socket error will emit on req + if (isRequestDone && hasResponse) { + return; + } + isRequestDone = true; + + if (err.name === 'Error') { + err.name = connected ? 'ResponseError' : 'RequestError'; + } + debug('Request#%d %s `req error` event emit, %s: %s', reqId, url, err.name, err.message); + done(__err || err); + } + if (args.stream) { + debug('Request#%d pump args.stream to req', reqId); + pump(args.stream, req, handleRequestError); + } else { + req.end(body, function () { + isRequestDone = true; + }); + } + // when stream already consumed, req's `finish` event is emitted and pump will ignore error after pipe finished + // but if server response timeout later, we will abort the request and emit an error in req + // so we must always manually listen to req's `error` event here to ensure this error is handled + req.on('error', handleRequestError); + req.requestId = reqId; + return req; +} + +exports.requestWithCallback = requestWithCallback; + +var JSONCtlCharsMap = { + '"': '\\"', // \u0022 + '\\': '\\\\', // \u005c + '\b': '\\b', // \u0008 + '\f': '\\f', // \u000c + '\n': '\\n', // \u000a + '\r': '\\r', // \u000d + '\t': '\\t' // \u0009 +}; +var JSONCtlCharsRE = /[\u0000-\u001F\u005C]/g; + +function _replaceOneChar(c) { + return JSONCtlCharsMap[c] || '\\u' + (c.charCodeAt(0) + 0x10000).toString(16).substr(1); +} + +function replaceJSONCtlChars(str) { + return str.replace(JSONCtlCharsRE, _replaceOneChar); +} + +function parseJSON(data, fixJSONCtlChars) { + var result = { + error: null, + data: null + }; + if (fixJSONCtlChars) { + if (typeof fixJSONCtlChars === 'function') { + data = fixJSONCtlChars(data); + } else { + // https://github.com/node-modules/urllib/pull/77 + // remote the control characters (U+0000 through U+001F) + data = replaceJSONCtlChars(data); + } + } + try { + result.data = JSON.parse(data); + } catch (err) { + if (err.name === 'SyntaxError') { + err.name = 'JSONResponseFormatError'; + } + if (data.length > 1024) { + // show 0~512 ... -512~end data + err.message += ' (data json format: ' + + JSON.stringify(data.slice(0, 512)) + ' ...skip... ' + JSON.stringify(data.slice(data.length - 512)) + ')'; + } else { + err.message += ' (data json format: ' + JSON.stringify(data) + ')'; + } + result.error = err; + } + return result; +} + + +/** + * decode response body by parse `content-type`'s charset + * @param {Buffer} data + * @param {Http(s)Response} res + * @return {String} + */ +function decodeBodyByCharset(data, res) { + var type = res.headers['content-type']; + if (!type) { + return data.toString(); + } + + var type = parseContentType(type); + var charset = type.parameters.charset || 'utf-8'; + + if (!Buffer.isEncoding(charset)) { + if (!_iconv) { + _iconv = require('iconv-lite'); + } + return _iconv.decode(data, charset); + } + + return data.toString(charset); +} + +function getAgent(agent, defaultAgent) { + return agent === undefined ? defaultAgent : agent; +} + +function parseContentType(str) { + try { + return contentTypeParser.parse(str); + } catch (err) { + // ignore content-type error, tread as default + return { parameters: {} }; + } +} + +function addLongStackTrace(err, req) { + if (!req) { + return; + } + var callSiteStack = req._callSite && req._callSite.stack; + if (!callSiteStack || typeof callSiteStack !== 'string') { + return; + } + if (err._longStack) { + return; + } + var index = callSiteStack.indexOf('\n'); + if (index !== -1) { + err._longStack = true; + err.stack += LONG_STACK_DELIMITER + callSiteStack.substr(index + 1); + } +} + +// node 8 don't has timeout attribute on socket +// https://github.com/nodejs/node/pull/21204/files#diff-e6ef024c3775d787c38487a6309e491dR408 +function getSocketTimeout(socket) { + return socket.timeout || socket._idleTimeout; +} diff --git a/node_modules/urllib/node_modules/iconv-lite/.github/dependabot.yml b/node_modules/urllib/node_modules/iconv-lite/.github/dependabot.yml new file mode 100644 index 0000000..e4a0e0a --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/.github/dependabot.yml @@ -0,0 +1,11 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: production diff --git a/node_modules/urllib/node_modules/iconv-lite/.idea/codeStyles/Project.xml b/node_modules/urllib/node_modules/iconv-lite/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..3f2688c --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/.idea/codeStyles/Project.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml b/node_modules/urllib/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/.idea/iconv-lite.iml b/node_modules/urllib/node_modules/iconv-lite/.idea/iconv-lite.iml new file mode 100644 index 0000000..0c8867d --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/.idea/iconv-lite.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml b/node_modules/urllib/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/.idea/modules.xml b/node_modules/urllib/node_modules/iconv-lite/.idea/modules.xml new file mode 100644 index 0000000..5d24f2e --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/.idea/vcs.xml b/node_modules/urllib/node_modules/iconv-lite/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/Changelog.md b/node_modules/urllib/node_modules/iconv-lite/Changelog.md new file mode 100644 index 0000000..464549b --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/Changelog.md @@ -0,0 +1,212 @@ +## 0.6.3 / 2021-05-23 + * Fix HKSCS encoding to prefer Big5 codes if both Big5 and HKSCS codes are possible (#264) + + +## 0.6.2 / 2020-07-08 + * Support Uint8Array-s decoding without conversion to Buffers, plus fix an edge case. + + +## 0.6.1 / 2020-06-28 + * Support Uint8Array-s directly when decoding (#246, by @gyzerok) + * Unify package.json version ranges to be strictly semver-compatible (#241) + * Fix minor issue in UTF-32 decoder's endianness detection code. + + +## 0.6.0 / 2020-06-08 + * Updated 'gb18030' encoding to :2005 edition (see https://github.com/whatwg/encoding/issues/22). + * Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work + in recent Node versions. + * Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be + excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using + `iconv.enableStreamingAPI(require('stream'))`. + * Updates to development environment & tests: + * Added ./test/webpack private package to test complex new use cases that need custom environment. + It's tested as a separate job in Travis CI. + * Updated generation code for the new EUC-KR index file format from Encoding Standard. + * Removed Buffer() constructor in tests (#197 by @gabrielschulhof). + + +## 0.5.2 / 2020-06-08 + * Added `iconv.getEncoder()` and `iconv.getDecoder()` methods to typescript definitions (#229). + * Fixed semver version to 6.1.2 to support Node 8.x (by @tanandara). + * Capped iconv version to 2.x as 3.x has dropped support for older Node versions. + * Switched from instanbul to c8 for code coverage. + + +## 0.5.1 / 2020-01-18 + + * Added cp720 encoding (#221, by @kr-deps) + * (minor) Changed Changelog.md formatting to use h2. + + +## 0.5.0 / 2019-06-26 + + * Added UTF-32 encoding, both little-endian and big-endian variants (UTF-32LE, UTF32-BE). If endianness + is not provided for decoding, it's deduced automatically from the stream using a heuristic similar to + what we use in UTF-16. (great work in #216 by @kshetline) + * Several minor updates to README (#217 by @oldj, plus some more) + * Added Node versions 10 and 12 to Travis test harness. + + +## 0.4.24 / 2018-08-22 + + * Added MIK encoding (#196, by @Ivan-Kalatchev) + + +## 0.4.23 / 2018-05-07 + + * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) + * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) + + +## 0.4.22 / 2018-05-05 + + * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) + * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) + + +## 0.4.21 / 2018-04-06 + + * Fix encoding canonicalization (#156) + * Fix the paths in the "browser" field in package.json (#174 by @LMLB) + * Removed "contributors" section in package.json - see Git history instead. + + +## 0.4.20 / 2018-04-06 + + * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) + + +## 0.4.19 / 2017-09-09 + + * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) + * Re-generated windows1255 codec, because it was updated in iconv project + * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 + + +## 0.4.18 / 2017-06-13 + + * Fixed CESU-8 regression in Node v8. + + +## 0.4.17 / 2017-04-22 + + * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) + + +## 0.4.16 / 2017-04-22 + + * Added support for React Native (#150) + * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) + * Fixed typo in Readme (#138 by @jiangzhuo) + * Fixed build for Node v6.10+ by making correct version comparison + * Added a warning if iconv-lite is loaded not as utf-8 (see #142) + + +## 0.4.15 / 2016-11-21 + + * Fixed typescript type definition (#137) + + +## 0.4.14 / 2016-11-20 + + * Preparation for v1.0 + * Added Node v6 and latest Node versions to Travis CI test rig + * Deprecated Node v0.8 support + * Typescript typings (@larssn) + * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) + * Add ms prefix to dbcs windows encodings (@rokoroku) + + +## 0.4.13 / 2015-10-01 + + * Fix silly mistake in deprecation notice. + + +## 0.4.12 / 2015-09-26 + + * Node v4 support: + * Added CESU-8 decoding (#106) + * Added deprecation notice for `extendNodeEncodings` + * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) + + +## 0.4.11 / 2015-07-03 + + * Added CESU-8 encoding. + + +## 0.4.10 / 2015-05-26 + + * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not + just spaces. This should minimize the importance of "default" endianness. + + +## 0.4.9 / 2015-05-24 + + * Streamlined BOM handling: strip BOM by default, add BOM when encoding if + addBOM: true. Added docs to Readme. + * UTF16 now uses UTF16-LE by default. + * Fixed minor issue with big5 encoding. + * Added io.js testing on Travis; updated node-iconv version to test against. + Now we just skip testing SBCS encodings that node-iconv doesn't support. + * (internal refactoring) Updated codec interface to use classes. + * Use strict mode in all files. + + +## 0.4.8 / 2015-04-14 + + * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) + + +## 0.4.7 / 2015-02-05 + + * stop official support of Node.js v0.8. Should still work, but no guarantees. + reason: Packages needed for testing are hard to get on Travis CI. + * work in environment where Object.prototype is monkey patched with enumerable + props (#89). + + +## 0.4.6 / 2015-01-12 + + * fix rare aliases of single-byte encodings (thanks @mscdex) + * double the timeout for dbcs tests to make them less flaky on travis + + +## 0.4.5 / 2014-11-20 + + * fix windows-31j and x-sjis encoding support (@nleush) + * minor fix: undefined variable reference when internal error happens + + +## 0.4.4 / 2014-07-16 + + * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) + * fixed streaming base64 encoding + + +## 0.4.3 / 2014-06-14 + + * added encodings UTF-16BE and UTF-16 with BOM + + +## 0.4.2 / 2014-06-12 + + * don't throw exception if `extendNodeEncodings()` is called more than once + + +## 0.4.1 / 2014-06-11 + + * codepage 808 added + + +## 0.4.0 / 2014-06-10 + + * code is rewritten from scratch + * all widespread encodings are supported + * streaming interface added + * browserify compatibility added + * (optional) extend core primitive encodings to make usage even simpler + * moved from vows to mocha as the testing framework + + diff --git a/node_modules/urllib/node_modules/iconv-lite/LICENSE b/node_modules/urllib/node_modules/iconv-lite/LICENSE new file mode 100644 index 0000000..d518d83 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/urllib/node_modules/iconv-lite/README.md b/node_modules/urllib/node_modules/iconv-lite/README.md new file mode 100644 index 0000000..3c97f87 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/README.md @@ -0,0 +1,130 @@ +## iconv-lite: Pure JS character encoding conversion + + * No need for native code compilation. Quick to install, works on Windows and in sandboxed environments like [Cloud9](http://c9.io). + * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. + * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). + * Intuitive encode/decode API, including Streaming support. + * In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). + * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. + * React Native is supported (need to install `stream` module to enable Streaming API). + * License: MIT. + +[![NPM Stats](https://nodei.co/npm/iconv-lite.png)](https://npmjs.org/package/iconv-lite/) +[![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) +[![npm](https://img.shields.io/npm/v/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) +[![npm downloads](https://img.shields.io/npm/dm/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) +[![npm bundle size](https://img.shields.io/bundlephobia/min/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) + +## Usage +### Basic API +```javascript +var iconv = require('iconv-lite'); + +// Convert from an encoded buffer to a js string. +str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); + +// Convert from a js string to an encoded buffer. +buf = iconv.encode("Sample input string", 'win1251'); + +// Check if encoding is supported +iconv.encodingExists("us-ascii") +``` + +### Streaming API +```javascript + +// Decode stream (from binary data stream to js strings) +http.createServer(function(req, res) { + var converterStream = iconv.decodeStream('win1251'); + req.pipe(converterStream); + + converterStream.on('data', function(str) { + console.log(str); // Do something with decoded strings, chunk-by-chunk. + }); +}); + +// Convert encoding streaming example +fs.createReadStream('file-in-win1251.txt') + .pipe(iconv.decodeStream('win1251')) + .pipe(iconv.encodeStream('ucs2')) + .pipe(fs.createWriteStream('file-in-ucs2.txt')); + +// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. +http.createServer(function(req, res) { + req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { + assert(typeof body == 'string'); + console.log(body); // full request body string + }); +}); +``` + +## Supported encodings + + * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. + * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. + Aliases like 'latin1', 'us-ascii' also supported. + * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. + +See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). + +Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! + +Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! + + +## Encoding/decoding speed + +Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). +Note: your results may vary, so please always check on your hardware. + + operation iconv@2.1.4 iconv-lite@0.4.7 + ---------------------------------------------------------- + encode('win1251') ~96 Mb/s ~320 Mb/s + decode('win1251') ~95 Mb/s ~246 Mb/s + +## BOM handling + + * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options + (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). + A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. + * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. + * Encoding: No BOM added, unless overridden by `addBOM: true` option. + +## UTF-16 Encodings + +This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be +smart about endianness in the following ways: + * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be + overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. + +## UTF-32 Encodings + +This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. + * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) + +## Other notes + +When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). + +## Testing + +```bash +$ git clone git@github.com:ashtuchkin/iconv-lite.git +$ cd iconv-lite +$ npm install +$ npm test + +$ # To view performance: +$ node test/performance.js + +$ # To view test coverage: +$ npm run coverage +$ open coverage/lcov-report/index.html +``` diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/dbcs-codec.js b/node_modules/urllib/node_modules/iconv-lite/encodings/dbcs-codec.js new file mode 100644 index 0000000..fa83917 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -0,0 +1,597 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. + +exports._dbcs = DBCSCodec; + +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; + +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; + + +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); + + // Load tables. + var mappingTable = codecOptions.table(); + + + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + var commonFourthByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + // Fill out the tree + var firstByteNode = this.decodeTables[0]; + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2"); + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue; + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3"); + } + + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) + fourthByteNode[l] = GB18030_CODE; + } + } + } + } + } + + this.defaultCharUnicode = iconv.defaultCharUnicode; + + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); +} + +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); + + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); + } + return node; +} + + +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } + else + writeTable[curAddr++] = code; // Basic char + } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; + } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; +} + +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; +} + +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; + } + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; +} + +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + var hasValues = false; + var subNodeEmpty = {}; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; + + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode); + hasValues = true; + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode; + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) + hasValues = true; + else + subNodeEmpty[subNodeIdx] = true; + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + hasValues = true; + } + } + return hasValues; +} + + + +// == Encoder ================================================================== + +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; +} + +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; + + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } + + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; + + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; + + } else if (resCode == undefined) { // Current character is not part of the sequence. + + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. + + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } else { + newBuf[j++] = dbcsCode >>> 24; + newBuf[j++] = (dbcsCode >>> 16) & 0xFF; + newBuf[j++] = (dbcsCode >>> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } + } + + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); +} + +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. + + var newBuf = Buffer.alloc(10), j = 0; + + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined; + } + + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; + } + + return newBuf.slice(0, j); +} + +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx; + + +// == Decoder ================================================================== + +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBytes = []; + + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; +} + +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, + seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. + uCode; + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; + + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; + + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0); + i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } + else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); + } else { + var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + + (curByte-0x30); + } + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); + + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000; + var uCodeLead = 0xD800 | (uCode >> 10); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; + + uCode = 0xDC00 | (uCode & 0x3FF); + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + + // Reset trie node. + nodeIdx = 0; seqStart = i+1; + } + + this.nodeIdx = nodeIdx; + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); + + return newBuf.slice(0, j).toString('ucs2'); +} + +DBCSDecoder.prototype.end = function() { + var ret = ''; + + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var bytesArr = this.prevBytes.slice(1); + + // Parse remaining as usual. + this.prevBytes = []; + this.nodeIdx = 0; + if (bytesArr.length > 0) + ret += this.write(bytesArr); + } + + this.prevBytes = []; + this.nodeIdx = 0; + return ret; +} + +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx(table, val) { + if (table[0] > val) + return -1; + + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + ((r-l+1) >> 1); + if (table[mid] <= val) + l = mid; + else + r = mid; + } + return l; +} + diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/dbcs-data.js b/node_modules/urllib/node_modules/iconv-lite/encodings/dbcs-data.js new file mode 100644 index 0000000..0d17e58 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/dbcs-data.js @@ -0,0 +1,188 @@ +"use strict"; + +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. + +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + + 'shiftjis': { + type: '_dbcs', + table: function() { return require('./tables/shiftjis.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', + + 'eucjp': { + type: '_dbcs', + table: function() { return require('./tables/eucjp.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, + + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + + + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', + + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json') }, + }, + + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', + + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + gb18030: function() { return require('./tables/gb18030-ranges.json') }, + encodeSkipVals: [0x80], + encodeAdd: {'€': 0xA2E3}, + }, + + 'chinese': 'gb18030', + + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return require('./tables/cp949.json') }, + }, + + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', + + + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json') }, + }, + + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, + ], + }, + + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/index.js b/node_modules/urllib/node_modules/iconv-lite/encodings/index.js new file mode 100644 index 0000000..d95c244 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/index.js @@ -0,0 +1,23 @@ +"use strict"; + +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + require("./internal"), + require("./utf32"), + require("./utf16"), + require("./utf7"), + require("./sbcs-codec"), + require("./sbcs-data"), + require("./sbcs-data-generated"), + require("./dbcs-codec"), + require("./dbcs-data"), +]; + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; +} diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/internal.js b/node_modules/urllib/node_modules/iconv-lite/encodings/internal.js new file mode 100644 index 0000000..dc1074f --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/internal.js @@ -0,0 +1,198 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec, +}; + +//------------------------------------------------------------------------------ + +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; + + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; + +//------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = require('string_decoder').StringDecoder; + +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; + + +function InternalDecoder(options, codec) { + this.decoder = new StringDecoder(codec.enc); +} + +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } + + return this.decoder.write(buf); +} + +InternalDecoder.prototype.end = function() { + return this.decoder.end(); +} + + +//------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder(options, codec) { + this.enc = codec.enc; +} + +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); +} + +InternalEncoder.prototype.end = function() { +} + + +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; +} + +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); + + return Buffer.from(str, "base64"); +} + +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} + + +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8(options, codec) { +} + +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + } + return buf.slice(0, bufIdx); +} + +InternalEncoderCesu8.prototype.end = function() { +} + +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; +} + +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; +} + +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-codec.js b/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-codec.js new file mode 100644 index 0000000..abac5ff --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -0,0 +1,72 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). + +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; + } + + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; + + this.encodeBuf = encodeBuf; +} + +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; + + +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; +} + +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; +} + +SBCSEncoder.prototype.end = function() { +} + + +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; +} + +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} + +SBCSDecoder.prototype.end = function() { +} diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-data-generated.js new file mode 100644 index 0000000..9b48236 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-data-generated.js @@ -0,0 +1,451 @@ +"use strict"; + +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-data.js b/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-data.js new file mode 100644 index 0000000..066f904 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/sbcs-data.js @@ -0,0 +1,179 @@ +"use strict"; + +// Manually added data to be used by sbcs codec in addition to generated one. + +module.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, + + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + + "cp720": { + "type": "_sbcs", + "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, + + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", + + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", + + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", + + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", + + "cp819": "iso88591", + "ibm819": "iso88591", + + "cyrillic": "iso88595", + + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", + + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", + + "hebrew": "iso88598", + "hebrew8": "iso88598", + + "turkish": "iso88599", + "turkish8": "iso88599", + + "thai": "iso885911", + "thai8": "iso885911", + + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", + + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", + + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", + + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", + + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", + + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", + + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", + + "strk10482002": "rk1048", + + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", + + "gb198880": "iso646cn", + "cn": "iso646cn", + + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", + + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", + + "mac": "macintosh", + "csmacintosh": "macintosh", +}; + diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/big5-added.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/big5-added.json new file mode 100644 index 0000000..3c3d3c2 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/big5-added.json @@ -0,0 +1,122 @@ +[ +["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], +["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], +["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], +["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], +["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], +["8940","𪎩𡅅"], +["8943","攊"], +["8946","丽滝鵎釟"], +["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], +["89a1","琑糼緍楆竉刧"], +["89ab","醌碸酞肼"], +["89b0","贋胶𠧧"], +["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], +["89c1","溚舾甙"], +["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], +["8a40","𧶄唥"], +["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], +["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], +["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], +["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], +["8aac","䠋𠆩㿺塳𢶍"], +["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], +["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], +["8ac9","𪘁𠸉𢫏𢳉"], +["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], +["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], +["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], +["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], +["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], +["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], +["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], +["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], +["8ca1","𣏹椙橃𣱣泿"], +["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], +["8cc9","顨杫䉶圽"], +["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], +["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], +["8d40","𠮟"], +["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], +["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], +["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], +["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], +["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], +["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], +["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], +["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], +["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], +["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], +["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], +["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], +["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], +["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], +["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], +["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], +["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], +["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], +["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], +["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], +["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], +["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], +["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], +["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], +["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], +["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], +["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], +["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], +["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], +["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], +["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], +["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], +["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], +["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], +["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], +["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], +["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], +["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], +["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], +["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], +["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], +["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], +["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], +["9fae","酙隁酜"], +["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], +["9fc1","𤤙盖鮝个𠳔莾衂"], +["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], +["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], +["9fe7","毺蠘罸"], +["9feb","嘠𪙊蹷齓"], +["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], +["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], +["a055","𡠻𦸅"], +["a058","詾𢔛"], +["a05b","惽癧髗鵄鍮鮏蟵"], +["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], +["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], +["a0a1","嵗𨯂迚𨸹"], +["a0a6","僙𡵆礆匲阸𠼻䁥"], +["a0ae","矾"], +["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], +["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], +["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], +["a3c0","␀",31,"␡"], +["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], +["c740","す",58,"ァアィイ"], +["c7a1","ゥ",81,"А",5,"ЁЖ",4], +["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], +["c8a1","龰冈龱𧘇"], +["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], +["c8f5","ʃɐɛɔɵœøŋʊɪ"], +["f9fe","■"], +["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], +["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], +["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], +["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], +["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], +["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], +["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], +["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], +["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], +["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] +] diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp936.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp936.json new file mode 100644 index 0000000..49ddb9a --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp936.json @@ -0,0 +1,264 @@ +[ +["0","\u0000",127,"€"], +["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], +["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], +["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], +["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], +["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], +["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], +["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], +["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], +["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], +["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], +["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], +["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], +["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], +["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], +["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], +["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], +["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], +["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], +["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], +["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], +["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], +["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], +["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], +["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], +["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], +["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], +["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], +["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], +["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], +["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], +["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], +["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], +["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], +["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], +["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], +["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], +["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], +["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], +["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], +["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], +["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], +["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], +["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], +["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], +["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], +["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], +["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], +["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], +["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], +["9980","檧檨檪檭",114,"欥欦欨",6], +["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], +["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], +["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], +["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], +["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], +["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], +["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], +["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], +["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], +["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], +["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], +["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], +["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], +["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], +["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], +["a2a1","ⅰ",9], +["a2b1","⒈",19,"⑴",19,"①",9], +["a2e5","㈠",9], +["a2f1","Ⅰ",11], +["a3a1","!"#¥%",88," ̄"], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], +["a6ee","︻︼︷︸︱"], +["a6f4","︳︴"], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], +["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], +["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], +["a8bd","ńň"], +["a8c0","ɡ"], +["a8c5","ㄅ",36], +["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], +["a959","℡㈱"], +["a95c","‐"], +["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], +["a980","﹢",4,"﹨﹩﹪﹫"], +["a996","〇"], +["a9a4","─",75], +["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], +["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], +["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], +["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], +["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], +["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], +["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], +["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], +["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], +["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], +["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], +["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], +["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], +["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], +["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], +["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], +["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], +["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], +["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], +["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], +["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], +["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], +["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], +["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], +["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], +["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], +["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], +["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], +["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], +["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], +["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], +["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], +["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], +["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], +["bb40","籃",9,"籎",36,"籵",5,"籾",9], +["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], +["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], +["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], +["bd40","紷",54,"絯",7], +["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], +["be40","継",12,"綧",6,"綯",42], +["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], +["bf40","緻",62], +["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], +["c040","繞",35,"纃",23,"纜纝纞"], +["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], +["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], +["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], +["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], +["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], +["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], +["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], +["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], +["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], +["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], +["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], +["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], +["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], +["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], +["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], +["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], +["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], +["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], +["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], +["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], +["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], +["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], +["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], +["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], +["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], +["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], +["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], +["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], +["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], +["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], +["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], +["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], +["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], +["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], +["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], +["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], +["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], +["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], +["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], +["d440","訞",31,"訿",8,"詉",21], +["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], +["d540","誁",7,"誋",7,"誔",46], +["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], +["d640","諤",34,"謈",27], +["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], +["d740","譆",31,"譧",4,"譭",25], +["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], +["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], +["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], +["d940","貮",62], +["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], +["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], +["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], +["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], +["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], +["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], +["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], +["dd40","軥",62], +["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], +["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], +["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], +["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], +["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], +["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], +["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], +["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], +["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], +["e240","釦",62], +["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], +["e340","鉆",45,"鉵",16], +["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], +["e440","銨",5,"銯",24,"鋉",31], +["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], +["e540","錊",51,"錿",10], +["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], +["e640","鍬",34,"鎐",27], +["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], +["e740","鏎",7,"鏗",54], +["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], +["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], +["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], +["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], +["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], +["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], +["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], +["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], +["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], +["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], +["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], +["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], +["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], +["ee40","頏",62], +["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], +["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], +["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], +["f040","餈",4,"餎餏餑",28,"餯",26], +["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], +["f140","馌馎馚",10,"馦馧馩",47], +["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], +["f240","駺",62], +["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], +["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], +["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], +["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], +["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], +["f540","魼",62], +["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], +["f640","鯜",62], +["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], +["f740","鰼",62], +["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], +["f840","鳣",62], +["f880","鴢",32], +["f940","鵃",62], +["f980","鶂",32], +["fa40","鶣",62], +["fa80","鷢",32], +["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], +["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], +["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], +["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], +["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], +["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], +["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] +] diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp949.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp949.json new file mode 100644 index 0000000..2022a00 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp949.json @@ -0,0 +1,273 @@ +[ +["0","\u0000",127], +["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], +["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], +["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], +["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], +["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], +["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], +["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], +["8361","긝",18,"긲긳긵긶긹긻긼"], +["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], +["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], +["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], +["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], +["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], +["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], +["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], +["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], +["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], +["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], +["8741","놞",9,"놩",15], +["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], +["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], +["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], +["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], +["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], +["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], +["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], +["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], +["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], +["8a61","둧",4,"둭",18,"뒁뒂"], +["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], +["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], +["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], +["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], +["8c41","똀",15,"똒똓똕똖똗똙",4], +["8c61","똞",6,"똦",5,"똭",6,"똵",5], +["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], +["8d41","뛃",16,"뛕",8], +["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], +["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], +["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], +["8e61","럂",4,"럈럊",19], +["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], +["8f41","뢅",7,"뢎",17], +["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], +["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], +["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], +["9061","륾",5,"릆릈릋릌릏",15], +["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], +["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], +["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], +["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], +["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], +["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], +["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], +["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], +["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], +["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], +["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], +["9461","봞",5,"봥",6,"봭",12], +["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], +["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], +["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], +["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], +["9641","뺸",23,"뻒뻓"], +["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], +["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], +["9741","뾃",16,"뾕",8], +["9761","뾞",17,"뾱",7], +["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], +["9841","쁀",16,"쁒",5,"쁙쁚쁛"], +["9861","쁝쁞쁟쁡",6,"쁪",15], +["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], +["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], +["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], +["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], +["9a41","숤숥숦숧숪숬숮숰숳숵",16], +["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], +["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], +["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], +["9b61","쌳",17,"썆",7], +["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], +["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], +["9c61","쏿",8,"쐉",6,"쐑",9], +["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], +["9d41","쒪",13,"쒹쒺쒻쒽",8], +["9d61","쓆",25], +["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], +["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], +["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], +["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], +["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], +["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], +["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], +["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], +["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], +["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], +["a141","좥좦좧좩",18,"좾좿죀죁"], +["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], +["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], +["a241","줐줒",5,"줙",18], +["a261","줭",6,"줵",18], +["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], +["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], +["a361","즑",6,"즚즜즞",16], +["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], +["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], +["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], +["a481","쨦쨧쨨쨪",28,"ㄱ",93], +["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], +["a561","쩫",17,"쩾",5,"쪅쪆"], +["a581","쪇",16,"쪙",14,"ⅰ",9], +["a5b0","Ⅰ",9], +["a5c1","Α",16,"Σ",6], +["a5e1","α",16,"σ",6], +["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], +["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], +["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], +["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], +["a761","쬪",22,"쭂쭃쭄"], +["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], +["a841","쭭",10,"쭺",14], +["a861","쮉",18,"쮝",6], +["a881","쮤",19,"쮹",11,"ÆÐªĦ"], +["a8a6","IJ"], +["a8a8","ĿŁØŒºÞŦŊ"], +["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], +["a941","쯅",14,"쯕",10], +["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], +["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], +["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], +["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], +["aa81","챳챴챶",29,"ぁ",82], +["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], +["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], +["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], +["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], +["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], +["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], +["acd1","а",5,"ёж",25], +["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], +["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], +["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], +["ae41","췆",5,"췍췎췏췑",16], +["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], +["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], +["af41","츬츭츮츯츲츴츶",19], +["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], +["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], +["b041","캚",5,"캢캦",5,"캮",12], +["b061","캻",5,"컂",19], +["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], +["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], +["b161","켥",6,"켮켲",5,"켹",11], +["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], +["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], +["b261","쾎",18,"쾢",5,"쾩"], +["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], +["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], +["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], +["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], +["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], +["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], +["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], +["b541","킕",14,"킦킧킩킪킫킭",5], +["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], +["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], +["b641","턅",7,"턎",17], +["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], +["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], +["b741","텮",13,"텽",6,"톅톆톇톉톊"], +["b761","톋",20,"톢톣톥톦톧"], +["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], +["b841","퇐",7,"퇙",17], +["b861","퇫",8,"퇵퇶퇷퇹",13], +["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], +["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], +["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], +["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], +["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], +["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], +["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], +["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], +["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], +["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], +["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], +["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], +["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], +["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], +["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], +["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], +["be41","퐸",7,"푁푂푃푅",14], +["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], +["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], +["bf41","풞",10,"풪",14], +["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], +["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], +["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], +["c061","픞",25], +["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], +["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], +["c161","햌햍햎햏햑",19,"햦햧"], +["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], +["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], +["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], +["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], +["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], +["c361","홢",4,"홨홪",5,"홲홳홵",11], +["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], +["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], +["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], +["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], +["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], +["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], +["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], +["c641","힍힎힏힑",6,"힚힜힞",5], +["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], +["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], +["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], +["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], +["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], +["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], +["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], +["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], +["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], +["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], +["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], +["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], +["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], +["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], +["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], +["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], +["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], +["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], +["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], +["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], +["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], +["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], +["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], +["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], +["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], +["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], +["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], +["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], +["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], +["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], +["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], +["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], +["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], +["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], +["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], +["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], +["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], +["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], +["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], +["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], +["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], +["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], +["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], +["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], +["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], +["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], +["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], +["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], +["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], +["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], +["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], +["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], +["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], +["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], +["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] +] diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp950.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp950.json new file mode 100644 index 0000000..d8bc871 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/cp950.json @@ -0,0 +1,177 @@ +[ +["0","\u0000",127], +["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], +["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], +["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], +["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], +["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], +["a3a1","ㄐ",25,"˙ˉˊˇˋ"], +["a3e1","€"], +["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], +["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], +["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], +["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], +["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], +["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], +["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], +["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], +["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], +["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], +["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], +["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], +["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], +["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], +["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], +["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], +["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], +["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], +["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], +["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], +["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], +["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], +["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], +["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], +["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], +["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], +["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], +["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], +["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], +["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], +["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], +["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], +["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], +["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], +["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], +["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], +["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], +["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], +["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], +["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], +["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], +["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], +["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], +["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], +["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], +["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], +["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], +["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], +["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], +["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], +["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], +["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], +["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], +["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], +["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], +["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], +["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], +["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], +["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], +["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], +["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], +["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], +["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], +["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], +["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], +["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], +["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], +["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], +["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], +["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], +["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], +["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], +["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], +["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], +["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], +["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], +["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], +["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], +["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], +["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], +["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], +["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], +["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], +["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], +["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], +["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], +["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], +["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], +["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], +["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], +["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], +["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], +["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], +["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], +["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], +["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], +["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], +["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], +["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], +["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], +["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], +["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], +["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], +["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], +["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], +["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], +["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], +["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], +["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], +["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], +["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], +["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], +["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], +["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], +["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], +["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], +["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], +["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], +["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], +["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], +["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], +["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], +["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], +["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], +["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], +["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], +["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], +["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], +["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], +["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], +["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], +["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], +["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], +["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], +["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], +["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], +["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], +["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], +["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], +["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], +["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], +["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], +["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], +["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], +["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], +["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], +["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], +["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], +["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], +["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], +["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], +["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], +["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], +["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], +["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], +["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], +["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], +["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], +["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], +["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], +["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], +["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], +["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], +["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], +["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], +["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], +["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] +] diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/eucjp.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/eucjp.json new file mode 100644 index 0000000..4fa61ca --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/eucjp.json @@ -0,0 +1,182 @@ +[ +["0","\u0000",127], +["8ea1","。",62], +["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], +["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], +["a2ba","∈∋⊆⊇⊂⊃∪∩"], +["a2ca","∧∨¬⇒⇔∀∃"], +["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["a2f2","ʼn♯♭♪†‡¶"], +["a2fe","◯"], +["a3b0","0",9], +["a3c1","A",25], +["a3e1","a",25], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["ada1","①",19,"Ⅰ",9], +["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], +["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], +["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], +["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], +["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], +["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], +["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], +["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], +["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], +["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], +["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], +["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], +["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], +["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], +["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], +["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], +["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], +["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], +["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], +["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], +["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], +["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], +["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], +["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], +["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], +["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], +["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], +["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], +["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], +["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], +["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], +["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], +["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], +["f4a1","堯槇遙瑤凜熙"], +["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], +["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], +["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["fcf1","ⅰ",9,"¬¦'""], +["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], +["8fa2c2","¡¦¿"], +["8fa2eb","ºª©®™¤№"], +["8fa6e1","ΆΈΉΊΪ"], +["8fa6e7","Ό"], +["8fa6e9","ΎΫ"], +["8fa6ec","Ώ"], +["8fa6f1","άέήίϊΐόςύϋΰώ"], +["8fa7c2","Ђ",10,"ЎЏ"], +["8fa7f2","ђ",10,"ўџ"], +["8fa9a1","ÆĐ"], +["8fa9a4","Ħ"], +["8fa9a6","IJ"], +["8fa9a8","ŁĿ"], +["8fa9ab","ŊØŒ"], +["8fa9af","ŦÞ"], +["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], +["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], +["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], +["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], +["8fabbd","ġĥíìïîǐ"], +["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], +["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], +["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], +["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], +["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], +["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], +["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], +["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], +["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], +["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], +["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], +["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], +["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], +["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], +["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], +["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], +["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], +["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], +["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], +["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], +["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], +["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], +["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], +["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], +["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], +["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], +["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], +["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], +["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], +["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], +["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], +["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], +["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], +["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], +["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], +["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], +["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], +["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], +["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], +["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], +["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], +["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], +["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], +["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], +["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], +["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], +["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], +["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], +["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], +["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], +["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], +["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], +["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], +["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], +["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], +["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], +["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], +["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], +["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], +["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], +["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], +["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], +["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] +] diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json new file mode 100644 index 0000000..85c6934 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json @@ -0,0 +1 @@ +{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/gbk-added.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/gbk-added.json new file mode 100644 index 0000000..b742e36 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -0,0 +1,56 @@ +[ +["a140","",62], +["a180","",32], +["a240","",62], +["a280","",32], +["a2ab","",5], +["a2e3","€"], +["a2ef",""], +["a2fd",""], +["a340","",62], +["a380","",31," "], +["a440","",62], +["a480","",32], +["a4f4","",10], +["a540","",62], +["a580","",32], +["a5f7","",7], +["a640","",62], +["a680","",32], +["a6b9","",7], +["a6d9","",6], +["a6ec",""], +["a6f3",""], +["a6f6","",8], +["a740","",62], +["a780","",32], +["a7c2","",14], +["a7f2","",12], +["a896","",10], +["a8bc","ḿ"], +["a8bf","ǹ"], +["a8c1",""], +["a8ea","",20], +["a958",""], +["a95b",""], +["a95d",""], +["a989","〾⿰",11], +["a997","",12], +["a9f0","",14], +["aaa1","",93], +["aba1","",93], +["aca1","",93], +["ada1","",93], +["aea1","",93], +["afa1","",93], +["d7fa","",4], +["f8a1","",93], +["f9a1","",93], +["faa1","",93], +["fba1","",93], +["fca1","",93], +["fda1","",93], +["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], +["8135f437",""] +] diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/tables/shiftjis.json b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/shiftjis.json new file mode 100644 index 0000000..5a3a43c --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/tables/shiftjis.json @@ -0,0 +1,125 @@ +[ +["0","\u0000",128], +["a1","。",62], +["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], +["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], +["81b8","∈∋⊆⊇⊂⊃∪∩"], +["81c8","∧∨¬⇒⇔∀∃"], +["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["81f0","ʼn♯♭♪†‡¶"], +["81fc","◯"], +["824f","0",9], +["8260","A",25], +["8281","a",25], +["829f","ぁ",82], +["8340","ァ",62], +["8380","ム",22], +["839f","Α",16,"Σ",6], +["83bf","α",16,"σ",6], +["8440","А",5,"ЁЖ",25], +["8470","а",5,"ёж",7], +["8480","о",17], +["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["8740","①",19,"Ⅰ",9], +["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["877e","㍻"], +["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], +["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], +["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], +["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], +["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], +["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], +["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], +["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], +["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], +["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], +["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], +["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], +["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], +["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], +["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], +["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], +["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], +["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], +["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], +["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], +["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], +["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], +["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], +["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], +["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], +["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], +["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], +["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], +["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], +["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], +["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], +["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], +["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], +["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], +["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], +["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], +["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["eeef","ⅰ",9,"¬¦'""], +["f040","",62], +["f080","",124], +["f140","",62], +["f180","",124], +["f240","",62], +["f280","",124], +["f340","",62], +["f380","",124], +["f440","",62], +["f480","",124], +["f540","",62], +["f580","",124], +["f640","",62], +["f680","",124], +["f740","",62], +["f780","",124], +["f840","",62], +["f880","",124], +["f940",""], +["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], +["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], +["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], +["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], +["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] +] diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/utf16.js b/node_modules/urllib/node_modules/iconv-lite/encodings/utf16.js new file mode 100644 index 0000000..97d0669 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/utf16.js @@ -0,0 +1,197 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js + +// == UTF16-BE codec. ========================================================== + +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { +} + +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf16BEEncoder() { +} + +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; + } + return buf; +} + +Utf16BEEncoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf16BEDecoder() { + this.overflowByte = -1; +} + +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; + + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; + + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; + } + + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } + + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; + + return buf2.slice(0, j).toString('ucs2'); +} + +Utf16BEDecoder.prototype.end = function() { + this.overflowByte = -1; +} + + +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); + +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). + +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; +} + +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; + + +// -- Encoding (pass-through) + +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); +} + +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); +} + +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); +} + + +// -- Decoding + +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + + this.options = options || {}; + this.iconv = codec.iconv; +} + +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + return ''; + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.write(buf); +} + +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + var trail = this.decoder.end(); + if (trail) + resStr += trail; + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + return this.decoder.end(); +} + +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. + + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; + if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; + } + + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } + + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; + if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-16le'; +} + + diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/utf32.js b/node_modules/urllib/node_modules/iconv-lite/encodings/utf32.js new file mode 100644 index 0000000..2fa900a --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/utf32.js @@ -0,0 +1,319 @@ +'use strict'; + +var Buffer = require('safer-buffer').Buffer; + +// == UTF32-LE/BE codec. ========================================================== + +exports._utf32 = Utf32Codec; + +function Utf32Codec(codecOptions, iconv) { + this.iconv = iconv; + this.bomAware = true; + this.isLE = codecOptions.isLE; +} + +exports.utf32le = { type: '_utf32', isLE: true }; +exports.utf32be = { type: '_utf32', isLE: false }; + +// Aliases +exports.ucs4le = 'utf32le'; +exports.ucs4be = 'utf32be'; + +Utf32Codec.prototype.encoder = Utf32Encoder; +Utf32Codec.prototype.decoder = Utf32Decoder; + +// -- Encoding + +function Utf32Encoder(options, codec) { + this.isLE = codec.isLE; + this.highSurrogate = 0; +} + +Utf32Encoder.prototype.write = function(str) { + var src = Buffer.from(str, 'ucs2'); + var dst = Buffer.alloc(src.length * 2); + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; + var offset = 0; + + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i); + var isHighSurrogate = (0xD800 <= code && code < 0xDC00); + var isLowSurrogate = (0xDC00 <= code && code < 0xE000); + + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset); + offset += 4; + } + else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; + + write32.call(dst, codepoint, offset); + offset += 4; + this.highSurrogate = 0; + + continue; + } + } + + if (isHighSurrogate) + this.highSurrogate = code; + else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset); + offset += 4; + this.highSurrogate = 0; + } + } + + if (offset < dst.length) + dst = dst.slice(0, offset); + + return dst; +}; + +Utf32Encoder.prototype.end = function() { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) + return; + + var buf = Buffer.alloc(4); + + if (this.isLE) + buf.writeUInt32LE(this.highSurrogate, 0); + else + buf.writeUInt32BE(this.highSurrogate, 0); + + this.highSurrogate = 0; + + return buf; +}; + +// -- Decoding + +function Utf32Decoder(options, codec) { + this.isLE = codec.isLE; + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); + this.overflow = []; +} + +Utf32Decoder.prototype.write = function(src) { + if (src.length === 0) + return ''; + + var i = 0; + var codepoint = 0; + var dst = Buffer.alloc(src.length + 4); + var offset = 0; + var isLE = this.isLE; + var overflow = this.overflow; + var badChar = this.badChar; + + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) + overflow.push(src[i]); + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); + } else { + codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); + } + overflow.length = 0; + + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + } + + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); + } else { + codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); + } + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]); + } + + return dst.slice(0, offset).toString('ucs2'); +}; + +function _writeCodepoint(dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar; + } + + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000; + + var high = 0xD800 | (codepoint >> 10); + dst[offset++] = high & 0xff; + dst[offset++] = high >> 8; + + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF); + } + + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff; + dst[offset++] = codepoint >> 8; + + return offset; +}; + +Utf32Decoder.prototype.end = function() { + this.overflow.length = 0; +}; + +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); + +// Encoder prepends BOM (which can be overridden with (addBOM: false}). + +exports.utf32 = Utf32AutoCodec; +exports.ucs4 = 'utf32'; + +function Utf32AutoCodec(options, iconv) { + this.iconv = iconv; +} + +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; + +// -- Encoding + +function Utf32AutoEncoder(options, codec) { + options = options || {}; + + if (options.addBOM === undefined) + options.addBOM = true; + + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); +} + +Utf32AutoEncoder.prototype.write = function(str) { + return this.encoder.write(str); +}; + +Utf32AutoEncoder.prototype.end = function() { + return this.encoder.end(); +}; + +// -- Decoding + +function Utf32AutoDecoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + this.options = options || {}; + this.iconv = codec.iconv; +} + +Utf32AutoDecoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + return ''; + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.write(buf); +}; + +Utf32AutoDecoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + var trail = this.decoder.end(); + if (trail) + resStr += trail; + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.end(); +}; + +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. + + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return 'utf-32le'; + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return 'utf-32be'; + } + } + + if (b[0] !== 0 || b[1] > 0x10) invalidBE++; + if (b[3] !== 0 || b[2] > 0x10) invalidLE++; + + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } + + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-32le'; +} diff --git a/node_modules/urllib/node_modules/iconv-lite/encodings/utf7.js b/node_modules/urllib/node_modules/iconv-lite/encodings/utf7.js new file mode 100644 index 0000000..eacae34 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/encodings/utf7.js @@ -0,0 +1,290 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 + +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; + + +// -- Encoding + +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; + +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; +} + +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); +} + +Utf7Encoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); + +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); + +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. + + +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; +} + +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; + + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } + + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } + + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } + } + } + + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; + + return buf.slice(0, bufIdx); +} + +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; + } + + return buf.slice(0, bufIdx); +} + + +// -- Decoding + +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; + +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + diff --git a/node_modules/urllib/node_modules/iconv-lite/lib/bom-handling.js b/node_modules/urllib/node_modules/iconv-lite/lib/bom-handling.js new file mode 100644 index 0000000..1050872 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/lib/bom-handling.js @@ -0,0 +1,52 @@ +"use strict"; + +var BOMChar = '\uFEFF'; + +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; +} + +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } + + return this.encoder.write(str); +} + +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); +} + + +//------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; +} + +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; + + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); + } + + this.pass = true; + return res; +} + +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); +} + diff --git a/node_modules/urllib/node_modules/iconv-lite/lib/index.d.ts b/node_modules/urllib/node_modules/iconv-lite/lib/index.d.ts new file mode 100644 index 0000000..99f200f --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/lib/index.d.ts @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * REQUIREMENT: This definition is dependent on the @types/node definition. + * Install with `npm install @types/node --save-dev` + *--------------------------------------------------------------------------------------------*/ + +declare module 'iconv-lite' { + // Basic API + export function decode(buffer: Buffer, encoding: string, options?: Options): string; + + export function encode(content: string, encoding: string, options?: Options): Buffer; + + export function encodingExists(encoding: string): boolean; + + // Stream API + export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; + + export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; + + // Low-level stream APIs + export function getEncoder(encoding: string, options?: Options): EncoderStream; + + export function getDecoder(encoding: string, options?: Options): DecoderStream; +} + +export interface Options { + stripBOM?: boolean; + addBOM?: boolean; + defaultEncoding?: string; +} + +export interface EncoderStream { + write(str: string): Buffer; + end(): Buffer | undefined; +} + +export interface DecoderStream { + write(buf: Buffer): string; + end(): string | undefined; +} diff --git a/node_modules/urllib/node_modules/iconv-lite/lib/index.js b/node_modules/urllib/node_modules/iconv-lite/lib/index.js new file mode 100644 index 0000000..657701c --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/lib/index.js @@ -0,0 +1,180 @@ +"use strict"; + +var Buffer = require("safer-buffer").Buffer; + +var bomHandling = require("./bom-handling"), + iconv = module.exports; + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; + +// Characters emitted in case of error. +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; + +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. + + var encoder = iconv.getEncoder(encoding, options); + + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; +} + +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } + + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. + } + + var decoder = iconv.getDecoder(encoding, options); + + var res = decoder.write(buf); + var trail = decoder.end(); + + return trail ? (res + trail) : res; +} + +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; + } +} + +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; + + var codecDef = iconv.encodings[enc]; + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; + + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; + + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); + + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + } +} + +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} + +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); + + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); + + return encoder; +} + +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); + + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); + + return decoder; +} + +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; + + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(stream_module); + + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; + + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } + + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } + + iconv.supportsStreams = true; +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = require("stream"); +} catch (e) {} + +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); + +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; +} + +if ("Ā" != "\u0100") { + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); +} diff --git a/node_modules/urllib/node_modules/iconv-lite/lib/streams.js b/node_modules/urllib/node_modules/iconv-lite/lib/streams.js new file mode 100644 index 0000000..a150648 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/lib/streams.js @@ -0,0 +1,109 @@ +"use strict"; + +var Buffer = require("safer-buffer").Buffer; + +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; + + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); + } + + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); + + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; + } + + + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); + } + + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); + + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; + } + + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; +}; diff --git a/node_modules/urllib/node_modules/iconv-lite/package.json b/node_modules/urllib/node_modules/iconv-lite/package.json new file mode 100644 index 0000000..d351115 --- /dev/null +++ b/node_modules/urllib/node_modules/iconv-lite/package.json @@ -0,0 +1,44 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.6.3", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "author": "Alexander Shtuchkin ", + "main": "./lib/index.js", + "typings": "./lib/index.d.ts", + "homepage": "https://github.com/ashtuchkin/iconv-lite", + "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", + "repository": { + "type": "git", + "url": "git://github.com/ashtuchkin/iconv-lite.git" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "coverage": "c8 _mocha --grep .", + "test": "mocha --reporter spec --grep ." + }, + "browser": { + "stream": false + }, + "devDependencies": { + "async": "^3.2.0", + "c8": "^7.2.0", + "errto": "^0.2.1", + "iconv": "^2.3.5", + "mocha": "^3.5.3", + "request": "^2.88.2", + "semver": "^6.3.0", + "unorm": "^1.6.0" + }, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } +} diff --git a/node_modules/urllib/node_modules/statuses/HISTORY.md b/node_modules/urllib/node_modules/statuses/HISTORY.md new file mode 100644 index 0000000..a1977b2 --- /dev/null +++ b/node_modules/urllib/node_modules/statuses/HISTORY.md @@ -0,0 +1,65 @@ +1.5.0 / 2018-03-27 +================== + + * Add `103 Early Hints` + +1.4.0 / 2017-10-20 +================== + + * Add `STATUS_CODES` export + +1.3.1 / 2016-11-11 +================== + + * Fix return type in JSDoc + +1.3.0 / 2016-05-17 +================== + + * Add `421 Misdirected Request` + * perf: enable strict mode + +1.2.1 / 2015-02-01 +================== + + * Fix message for status 451 + - `451 Unavailable For Legal Reasons` + +1.2.0 / 2014-09-28 +================== + + * Add `208 Already Repored` + * Add `226 IM Used` + * Add `306 (Unused)` + * Add `415 Unable For Legal Reasons` + * Add `508 Loop Detected` + +1.1.1 / 2014-09-24 +================== + + * Add missing 308 to `codes.json` + +1.1.0 / 2014-09-21 +================== + + * Add `codes.json` for universal support + +1.0.4 / 2014-08-20 +================== + + * Package cleanup + +1.0.3 / 2014-06-08 +================== + + * Add 308 to `.redirect` category + +1.0.2 / 2014-03-13 +================== + + * Add `.retry` category + +1.0.1 / 2014-03-12 +================== + + * Initial release diff --git a/node_modules/urllib/node_modules/statuses/LICENSE b/node_modules/urllib/node_modules/statuses/LICENSE new file mode 100644 index 0000000..28a3161 --- /dev/null +++ b/node_modules/urllib/node_modules/statuses/LICENSE @@ -0,0 +1,23 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2016 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/urllib/node_modules/statuses/README.md b/node_modules/urllib/node_modules/statuses/README.md new file mode 100644 index 0000000..0fe5720 --- /dev/null +++ b/node_modules/urllib/node_modules/statuses/README.md @@ -0,0 +1,127 @@ +# Statuses + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +HTTP status utility for node. + +This module provides a list of status codes and messages sourced from +a few different projects: + + * The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) + * The [Node.js project](https://nodejs.org/) + * The [NGINX project](https://www.nginx.com/) + * The [Apache HTTP Server project](https://httpd.apache.org/) + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install statuses +``` + +## API + + + +```js +var status = require('statuses') +``` + +### var code = status(Integer || String) + +If `Integer` or `String` is a valid HTTP code or status message, then the +appropriate `code` will be returned. Otherwise, an error will be thrown. + + + +```js +status(403) // => 403 +status('403') // => 403 +status('forbidden') // => 403 +status('Forbidden') // => 403 +status(306) // throws, as it's not supported by node.js +``` + +### status.STATUS_CODES + +Returns an object which maps status codes to status messages, in +the same format as the +[Node.js http module](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes). + +### status.codes + +Returns an array of all the status codes as `Integer`s. + +### var msg = status[code] + +Map of `code` to `status message`. `undefined` for invalid `code`s. + + + +```js +status[404] // => 'Not Found' +``` + +### var code = status[msg] + +Map of `status message` to `code`. `msg` can either be title-cased or +lower-cased. `undefined` for invalid `status message`s. + + + +```js +status['not found'] // => 404 +status['Not Found'] // => 404 +``` + +### status.redirect[code] + +Returns `true` if a status code is a valid redirect status. + + + +```js +status.redirect[200] // => undefined +status.redirect[301] // => true +``` + +### status.empty[code] + +Returns `true` if a status code expects an empty body. + + + +```js +status.empty[200] // => undefined +status.empty[204] // => true +status.empty[304] // => true +``` + +### status.retry[code] + +Returns `true` if you should retry the rest. + + + +```js +status.retry[501] // => undefined +status.retry[503] // => true +``` + +[npm-image]: https://img.shields.io/npm/v/statuses.svg +[npm-url]: https://npmjs.org/package/statuses +[node-version-image]: https://img.shields.io/node/v/statuses.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg +[travis-url]: https://travis-ci.org/jshttp/statuses +[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg +[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master +[downloads-image]: https://img.shields.io/npm/dm/statuses.svg +[downloads-url]: https://npmjs.org/package/statuses diff --git a/node_modules/urllib/node_modules/statuses/codes.json b/node_modules/urllib/node_modules/statuses/codes.json new file mode 100644 index 0000000..a09283a --- /dev/null +++ b/node_modules/urllib/node_modules/statuses/codes.json @@ -0,0 +1,66 @@ +{ + "100": "Continue", + "101": "Switching Protocols", + "102": "Processing", + "103": "Early Hints", + "200": "OK", + "201": "Created", + "202": "Accepted", + "203": "Non-Authoritative Information", + "204": "No Content", + "205": "Reset Content", + "206": "Partial Content", + "207": "Multi-Status", + "208": "Already Reported", + "226": "IM Used", + "300": "Multiple Choices", + "301": "Moved Permanently", + "302": "Found", + "303": "See Other", + "304": "Not Modified", + "305": "Use Proxy", + "306": "(Unused)", + "307": "Temporary Redirect", + "308": "Permanent Redirect", + "400": "Bad Request", + "401": "Unauthorized", + "402": "Payment Required", + "403": "Forbidden", + "404": "Not Found", + "405": "Method Not Allowed", + "406": "Not Acceptable", + "407": "Proxy Authentication Required", + "408": "Request Timeout", + "409": "Conflict", + "410": "Gone", + "411": "Length Required", + "412": "Precondition Failed", + "413": "Payload Too Large", + "414": "URI Too Long", + "415": "Unsupported Media Type", + "416": "Range Not Satisfiable", + "417": "Expectation Failed", + "418": "I'm a teapot", + "421": "Misdirected Request", + "422": "Unprocessable Entity", + "423": "Locked", + "424": "Failed Dependency", + "425": "Unordered Collection", + "426": "Upgrade Required", + "428": "Precondition Required", + "429": "Too Many Requests", + "431": "Request Header Fields Too Large", + "451": "Unavailable For Legal Reasons", + "500": "Internal Server Error", + "501": "Not Implemented", + "502": "Bad Gateway", + "503": "Service Unavailable", + "504": "Gateway Timeout", + "505": "HTTP Version Not Supported", + "506": "Variant Also Negotiates", + "507": "Insufficient Storage", + "508": "Loop Detected", + "509": "Bandwidth Limit Exceeded", + "510": "Not Extended", + "511": "Network Authentication Required" +} diff --git a/node_modules/urllib/node_modules/statuses/index.js b/node_modules/urllib/node_modules/statuses/index.js new file mode 100644 index 0000000..4df469a --- /dev/null +++ b/node_modules/urllib/node_modules/statuses/index.js @@ -0,0 +1,113 @@ +/*! + * statuses + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var codes = require('./codes.json') + +/** + * Module exports. + * @public + */ + +module.exports = status + +// status code to message map +status.STATUS_CODES = codes + +// array of status codes +status.codes = populateStatusesMap(status, codes) + +// status codes for redirects +status.redirect = { + 300: true, + 301: true, + 302: true, + 303: true, + 305: true, + 307: true, + 308: true +} + +// status codes for empty bodies +status.empty = { + 204: true, + 205: true, + 304: true +} + +// status codes for when you should retry the request +status.retry = { + 502: true, + 503: true, + 504: true +} + +/** + * Populate the statuses map for given codes. + * @private + */ + +function populateStatusesMap (statuses, codes) { + var arr = [] + + Object.keys(codes).forEach(function forEachCode (code) { + var message = codes[code] + var status = Number(code) + + // Populate properties + statuses[status] = message + statuses[message] = status + statuses[message.toLowerCase()] = status + + // Add to array + arr.push(status) + }) + + return arr +} + +/** + * Get the status code. + * + * Given a number, this will throw if it is not a known status + * code, otherwise the code will be returned. Given a string, + * the string will be parsed for a number and return the code + * if valid, otherwise will lookup the code assuming this is + * the status message. + * + * @param {string|number} code + * @returns {number} + * @public + */ + +function status (code) { + if (typeof code === 'number') { + if (!status[code]) throw new Error('invalid status code: ' + code) + return code + } + + if (typeof code !== 'string') { + throw new TypeError('code must be a number or string') + } + + // '403' + var n = parseInt(code, 10) + if (!isNaN(n)) { + if (!status[n]) throw new Error('invalid status code: ' + n) + return n + } + + n = status[code.toLowerCase()] + if (!n) throw new Error('invalid status message: "' + code + '"') + return n +} diff --git a/node_modules/urllib/node_modules/statuses/package.json b/node_modules/urllib/node_modules/statuses/package.json new file mode 100644 index 0000000..7595e2b --- /dev/null +++ b/node_modules/urllib/node_modules/statuses/package.json @@ -0,0 +1,48 @@ +{ + "name": "statuses", + "description": "HTTP status utility", + "version": "1.5.0", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "repository": "jshttp/statuses", + "license": "MIT", + "keywords": [ + "http", + "status", + "code" + ], + "files": [ + "HISTORY.md", + "index.js", + "codes.json", + "LICENSE" + ], + "devDependencies": { + "csv-parse": "1.2.4", + "eslint": "4.19.1", + "eslint-config-standard": "11.0.0", + "eslint-plugin-import": "2.9.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "6.0.1", + "eslint-plugin-promise": "3.7.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "1.21.5", + "raw-body": "2.3.2", + "stream-to-array": "2.3.0" + }, + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build.js", + "fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "update": "npm run fetch && npm run build" + } +} diff --git a/node_modules/urllib/package.json b/node_modules/urllib/package.json new file mode 100644 index 0000000..4e35756 --- /dev/null +++ b/node_modules/urllib/package.json @@ -0,0 +1,88 @@ +{ + "name": "urllib", + "version": "2.44.0", + "publishConfig": { + "tag": "latest-2" + }, + "description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more.", + "keywords": [ + "urllib", + "http", + "urlopen", + "curl", + "wget", + "request", + "https" + ], + "author": "fengmk2 (https://fengmk2.com)", + "homepage": "https://github.com/node-modules/urllib", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git://github.com/node-modules/urllib.git" + }, + "scripts": { + "tsd": "node test/tsd.js", + "test-local": "mocha -t 30000 test/*.test.js", + "test": "npm run lint && npm run test-local", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -t 30000 test/*.test.js", + "ci": "npm run lint && npm run tsd && npm run test-cov", + "lint": "jshint .", + "contributor": "git-contributor" + }, + "dependencies": { + "any-promise": "^1.3.0", + "content-type": "^1.0.2", + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "ee-first": "~1.1.1", + "formstream": "^1.1.0", + "humanize-ms": "^1.2.0", + "iconv-lite": "^0.6.3", + "pump": "^3.0.0", + "qs": "^6.4.0", + "statuses": "^1.3.1", + "utility": "^1.16.1" + }, + "peerDependencies": { + "proxy-agent": "^5.0.0" + }, + "peerDependenciesMeta": { + "proxy-agent": { + "optional": true + } + }, + "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^10.12.18", + "agentkeepalive": "^4.0.0", + "benchmark": "^2.1.4", + "bluebird": "*", + "busboy": "^0.2.14", + "co": "*", + "coffee": "1", + "git-contributor": "2", + "http-proxy": "^1.16.2", + "istanbul": "*", + "jshint": "*", + "mkdirp": "^0.5.1", + "mocha": "3", + "muk": "^0.5.3", + "pedding": "^1.1.0", + "proxy-agent": "^5.0.0", + "semver": "5", + "spy": "^1.0.0", + "tar": "^4.4.8", + "through2": "^2.0.3", + "tsd": "^0.18.0", + "typescript": "^4.4.4" + }, + "engines": { + "node": ">= 0.10.0" + }, + "license": "MIT" +} diff --git a/node_modules/util-deprecate/History.md b/node_modules/util-deprecate/History.md new file mode 100644 index 0000000..acc8675 --- /dev/null +++ b/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/node_modules/util-deprecate/LICENSE b/node_modules/util-deprecate/LICENSE new file mode 100644 index 0000000..6a60e8c --- /dev/null +++ b/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/README.md b/node_modules/util-deprecate/README.md new file mode 100644 index 0000000..75622fa --- /dev/null +++ b/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/util-deprecate/browser.js b/node_modules/util-deprecate/browser.js new file mode 100644 index 0000000..549ae2f --- /dev/null +++ b/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/node_modules/util-deprecate/node.js b/node_modules/util-deprecate/node.js new file mode 100644 index 0000000..5e6fcff --- /dev/null +++ b/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/node_modules/util-deprecate/package.json b/node_modules/util-deprecate/package.json new file mode 100644 index 0000000..2e79f89 --- /dev/null +++ b/node_modules/util-deprecate/package.json @@ -0,0 +1,27 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate" +} diff --git a/node_modules/utility/LICENSE.txt b/node_modules/utility/LICENSE.txt new file mode 100644 index 0000000..316ff2c --- /dev/null +++ b/node_modules/utility/LICENSE.txt @@ -0,0 +1,21 @@ +This software is licensed under the MIT License. + +Copyright(c) 2012 - present node-modules and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/utility/README.md b/node_modules/utility/README.md new file mode 100644 index 0000000..754128a --- /dev/null +++ b/node_modules/utility/README.md @@ -0,0 +1,338 @@ +# utility + +[![NPM version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![Test coverage][codecov-image]][codecov-url] +[![npm download][download-image]][download-url] +[![Dependency Status][dependency-image]][dependency-url] +[![devDependency Status][devDependency-image]][devDependency-url] + +[npm-image]: https://img.shields.io/npm/v/utility.svg?style=flat-square +[npm-url]: https://npmjs.org/package/utility +[travis-image]: https://img.shields.io/travis/node-modules/utility.svg?style=flat-square +[travis-url]: https://travis-ci.org/node-modules/utility +[codecov-image]: https://codecov.io/github/node-modules/utility/coverage.svg?branch=master +[codecov-url]: https://codecov.io/github/node-modules/utility?branch=master +[download-image]: https://img.shields.io/npm/dm/utility.svg?style=flat-square +[download-url]: https://npmjs.org/package/utility +[dependency-image]: https://david-dm.org/node-modules/utility.svg +[dependency-url]: https://david-dm.org/node-modules/utility +[devDependency-image]: https://david-dm.org/node-modules/utility/dev-status.svg +[devDependency-url]: https://david-dm.org/node-modules/utility#info=devDependencies + +A collection of useful utilities. + +## Install + +```bash +$ npm install utility +``` + +## Usage + +```js +const utils = require('utility'); +``` +Also you can use it within typescript, like this ↓ +```js +import * as utility from 'utility'; +``` + +### md5 + +```js +utils.md5('苏千').should.equal('5f733c47c58a077d61257102b2d44481'); +utils.md5(Buffer.from('苏千')).should.equal('5f733c47c58a077d61257102b2d44481'); +// md5 base64 format +utils.md5('苏千', 'base64'); // 'X3M8R8WKB31hJXECstREgQ==' + +// Object md5 hash. Sorted by key, and JSON.stringify. See source code for detail +utils.md5({foo: 'bar', bar: 'foo'}).should.equal(utils.md5({bar: 'foo', foo: 'bar'})); +``` + +### sha1 + +```js +utils.sha1('苏千').should.equal('0a4aff6bab634b9c2f99b71f25e976921fcde5a5'); +utils.sha1(Buffer.from('苏千')).should.equal('0a4aff6bab634b9c2f99b71f25e976921fcde5a5'); +// sha1 base64 format +utils.sha1('苏千', 'base64'); // 'Ckr/a6tjS5wvmbcfJel2kh/N5aU=' + +// Object sha1 hash. Sorted by key, and JSON.stringify. See source code for detail +utils.sha1({foo: 'bar', bar: 'foo'}).should.equal(utils.sha1({bar: 'foo', foo: 'bar'})); +``` + +### sha256 + +```js +utils.sha256(Buffer.from('苏千')).should.equal('75dd03e3fcdbba7d5bec07900bae740cc8e361d77e7df8949de421d3df5d3635'); +``` + +### hmac + +```js +// hmac-sha1 with base64 output encoding +utils.hmac('sha1', 'I am a key', 'hello world'); // 'pO6J0LKDxRRkvSECSEdxwKx84L0=' +``` + +### decode and encode + +```js +// base64 encode +utils.base64encode('你好¥'); // '5L2g5aW977+l' +utils.base64decode('5L2g5aW977+l') // '你好¥' + +// urlsafe base64 encode +utils.base64encode('你好¥', true); // '5L2g5aW977-l' +utils.base64decode('5L2g5aW977-l', true); // '你好¥' + +// html escape and unescape +utils.escape(' +``` + +### UMD + +To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs: + +**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**: + +```html + +``` + +**Using [jsDelivr](https://cdn.jsdelivr.net/npm/uuid@latest/dist/umd/)**: + +```html + +``` + +**Using [cdnjs](https://cdnjs.com/libraries/uuid)**: + +```html + +``` + +These CDNs all provide the same [`uuidv4()`](#uuidv4options-buffer-offset) method: + +```html + +``` + +Methods for the other algorithms ([`uuidv1()`](#uuidv1options-buffer-offset), [`uuidv3()`](#uuidv3name-namespace-buffer-offset) and [`uuidv5()`](#uuidv5name-namespace-buffer-offset)) are available from the files `uuidv1.min.js`, `uuidv3.min.js` and `uuidv5.min.js` respectively. + +## "getRandomValues() not supported" + +This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: + +### React Native / Expo + +1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) +1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: + +```javascript +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; +``` + +Note: If you are using Expo, you must be using at least `react-native-get-random-values@1.5.0` and `expo@39.0.0`. + +### Web Workers / Service Workers (Edge <= 18) + +[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please). + +## Upgrading From `uuid@7.x` + +### Only Named Exports Supported When Using with Node.js ESM + +`uuid@7.x` did not come with native ECMAScript Module (ESM) support for Node.js. Importing it in Node.js ESM consequently imported the CommonJS source with a default export. This library now comes with true Node.js ESM support and only provides named exports. + +Instead of doing: + +```javascript +import uuid from 'uuid'; +uuid.v4(); +``` + +you will now have to use the named exports: + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); +``` + +### Deep Requires No Longer Supported + +Deep requires like `require('uuid/v4')` [which have been deprecated in `uuid@7.x`](#deep-requires-now-deprecated) are no longer supported. + +## Upgrading From `uuid@3.x` + +"_Wait... what happened to `uuid@4.x` - `uuid@6.x`?!?_" + +In order to avoid confusion with RFC [version 4](#uuidv4options-buffer-offset) and [version 5](#uuidv5name-namespace-buffer-offset) UUIDs, and a possible [version 6](http://gh.peabody.io/uuidv6/), releases 4 thru 6 of this module have been skipped. + +### Deep Requires Now Deprecated + +`uuid@3.x` encouraged the use of deep requires to minimize the bundle size of browser builds: + +```javascript +const uuidv4 = require('uuid/v4'); // <== NOW DEPRECATED! +uuidv4(); +``` + +As of `uuid@7.x` this library now provides ECMAScript modules builds, which allow packagers like Webpack and Rollup to do "tree-shaking" to remove dead code. Instead, use the `import` syntax: + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); +``` + +... or for CommonJS: + +```javascript +const { v4: uuidv4 } = require('uuid'); +uuidv4(); +``` + +### Default Export Removed + +`uuid@3.x` was exporting the Version 4 UUID method as a default export: + +```javascript +const uuid = require('uuid'); // <== REMOVED! +``` + +This usage pattern was already discouraged in `uuid@3.x` and has been removed in `uuid@7.x`. + +---- +Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/node_modules/uuid/dist/bin/uuid b/node_modules/uuid/dist/bin/uuid new file mode 100644 index 0000000..f38d2ee --- /dev/null +++ b/node_modules/uuid/dist/bin/uuid @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('../uuid-bin'); diff --git a/node_modules/uuid/dist/esm-browser/index.js b/node_modules/uuid/dist/esm-browser/index.js new file mode 100644 index 0000000..1db6f6d --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/index.js @@ -0,0 +1,9 @@ +export { default as v1 } from './v1.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as NIL } from './nil.js'; +export { default as version } from './version.js'; +export { default as validate } from './validate.js'; +export { default as stringify } from './stringify.js'; +export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/md5.js b/node_modules/uuid/dist/esm-browser/md5.js new file mode 100644 index 0000000..8b5d46a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/md5.js @@ -0,0 +1,215 @@ +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (var i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + var output = []; + var length32 = input.length * 32; + var hexTab = '0123456789abcdef'; + + for (var i = 0; i < length32; i += 8) { + var x = input[i >> 5] >>> i % 32 & 0xff; + var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for (var i = 0; i < x.length; i += 16) { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + var length8 = input.length * 8; + var output = new Uint32Array(getOutputLength(length8)); + + for (var i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +export default md5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/nil.js b/node_modules/uuid/dist/esm-browser/nil.js new file mode 100644 index 0000000..b36324c --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/parse.js b/node_modules/uuid/dist/esm-browser/parse.js new file mode 100644 index 0000000..7c5b1d5 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/parse.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; + +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + var v; + var arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +export default parse; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/regex.js b/node_modules/uuid/dist/esm-browser/regex.js new file mode 100644 index 0000000..3da8673 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/rng.js b/node_modules/uuid/dist/esm-browser/rng.js new file mode 100644 index 0000000..8abbf2e --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/rng.js @@ -0,0 +1,19 @@ +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +var getRandomValues; +var rnds8 = new Uint8Array(16); +export default function rng() { + // lazy load so that environments that need to polyfill have a chance to do so + if (!getRandomValues) { + // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, + // find the complete implementation of crypto (msCrypto) on IE11. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/sha1.js b/node_modules/uuid/dist/esm-browser/sha1.js new file mode 100644 index 0000000..940548b --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/sha1.js @@ -0,0 +1,96 @@ +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (var i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + var l = bytes.length / 4 + 2; + var N = Math.ceil(l / 16); + var M = new Array(N); + + for (var _i = 0; _i < N; ++_i) { + var arr = new Uint32Array(16); + + for (var j = 0; j < 16; ++j) { + arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3]; + } + + M[_i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (var _i2 = 0; _i2 < N; ++_i2) { + var W = new Uint32Array(80); + + for (var t = 0; t < 16; ++t) { + W[t] = M[_i2][t]; + } + + for (var _t = 16; _t < 80; ++_t) { + W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1); + } + + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + for (var _t2 = 0; _t2 < 80; ++_t2) { + var s = Math.floor(_t2 / 20); + var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +export default sha1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/stringify.js b/node_modules/uuid/dist/esm-browser/stringify.js new file mode 100644 index 0000000..3102111 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/stringify.js @@ -0,0 +1,30 @@ +import validate from './validate.js'; +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +var byteToHex = []; + +for (var i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +export default stringify; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v1.js b/node_modules/uuid/dist/esm-browser/v1.js new file mode 100644 index 0000000..1a22591 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v1.js @@ -0,0 +1,95 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +var _nodeId; + +var _clockseq; // Previous uuid creation time + + +var _lastMSecs = 0; +var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || new Array(16); + options = options || {}; + var node = options.node || _nodeId; + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + var seedBytes = options.random || (options.rng || rng)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + var tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (var n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || stringify(b); +} + +export default v1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v3.js b/node_modules/uuid/dist/esm-browser/v3.js new file mode 100644 index 0000000..c9ab9a4 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v3.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import md5 from './md5.js'; +var v3 = v35('v3', 0x30, md5); +export default v3; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v35.js b/node_modules/uuid/dist/esm-browser/v35.js new file mode 100644 index 0000000..31dd8a1 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v35.js @@ -0,0 +1,64 @@ +import stringify from './stringify.js'; +import parse from './parse.js'; + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + var bytes = []; + + for (var i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +export var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function (name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + var bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return stringify(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v4.js b/node_modules/uuid/dist/esm-browser/v4.js new file mode 100644 index 0000000..404810a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v4.js @@ -0,0 +1,24 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; + +function v4(options, buf, offset) { + options = options || {}; + var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (var i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return stringify(rnds); +} + +export default v4; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/v5.js b/node_modules/uuid/dist/esm-browser/v5.js new file mode 100644 index 0000000..c08d96b --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v5.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import sha1 from './sha1.js'; +var v5 = v35('v5', 0x50, sha1); +export default v5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/validate.js b/node_modules/uuid/dist/esm-browser/validate.js new file mode 100644 index 0000000..f1cdc7a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/validate.js @@ -0,0 +1,7 @@ +import REGEX from './regex.js'; + +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} + +export default validate; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-browser/version.js b/node_modules/uuid/dist/esm-browser/version.js new file mode 100644 index 0000000..77530e9 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/version.js @@ -0,0 +1,11 @@ +import validate from './validate.js'; + +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +export default version; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/index.js b/node_modules/uuid/dist/esm-node/index.js new file mode 100644 index 0000000..1db6f6d --- /dev/null +++ b/node_modules/uuid/dist/esm-node/index.js @@ -0,0 +1,9 @@ +export { default as v1 } from './v1.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as NIL } from './nil.js'; +export { default as version } from './version.js'; +export { default as validate } from './validate.js'; +export { default as stringify } from './stringify.js'; +export { default as parse } from './parse.js'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/md5.js b/node_modules/uuid/dist/esm-node/md5.js new file mode 100644 index 0000000..4d68b04 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/md5.js @@ -0,0 +1,13 @@ +import crypto from 'crypto'; + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return crypto.createHash('md5').update(bytes).digest(); +} + +export default md5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/nil.js b/node_modules/uuid/dist/esm-node/nil.js new file mode 100644 index 0000000..b36324c --- /dev/null +++ b/node_modules/uuid/dist/esm-node/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/parse.js b/node_modules/uuid/dist/esm-node/parse.js new file mode 100644 index 0000000..6421c5d --- /dev/null +++ b/node_modules/uuid/dist/esm-node/parse.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; + +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +export default parse; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/regex.js b/node_modules/uuid/dist/esm-node/regex.js new file mode 100644 index 0000000..3da8673 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/rng.js b/node_modules/uuid/dist/esm-node/rng.js new file mode 100644 index 0000000..8006244 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/rng.js @@ -0,0 +1,12 @@ +import crypto from 'crypto'; +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + +let poolPtr = rnds8Pool.length; +export default function rng() { + if (poolPtr > rnds8Pool.length - 16) { + crypto.randomFillSync(rnds8Pool); + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/sha1.js b/node_modules/uuid/dist/esm-node/sha1.js new file mode 100644 index 0000000..e23850b --- /dev/null +++ b/node_modules/uuid/dist/esm-node/sha1.js @@ -0,0 +1,13 @@ +import crypto from 'crypto'; + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return crypto.createHash('sha1').update(bytes).digest(); +} + +export default sha1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/stringify.js b/node_modules/uuid/dist/esm-node/stringify.js new file mode 100644 index 0000000..f9bca12 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/stringify.js @@ -0,0 +1,29 @@ +import validate from './validate.js'; +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +export default stringify; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v1.js b/node_modules/uuid/dist/esm-node/v1.js new file mode 100644 index 0000000..ebf81ac --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v1.js @@ -0,0 +1,95 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; // **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html + +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || rng)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || stringify(b); +} + +export default v1; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v3.js b/node_modules/uuid/dist/esm-node/v3.js new file mode 100644 index 0000000..09063b8 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v3.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import md5 from './md5.js'; +const v3 = v35('v3', 0x30, md5); +export default v3; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v35.js b/node_modules/uuid/dist/esm-node/v35.js new file mode 100644 index 0000000..22f6a19 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v35.js @@ -0,0 +1,64 @@ +import stringify from './stringify.js'; +import parse from './parse.js'; + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function (name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return stringify(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v4.js b/node_modules/uuid/dist/esm-node/v4.js new file mode 100644 index 0000000..efad926 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v4.js @@ -0,0 +1,24 @@ +import rng from './rng.js'; +import stringify from './stringify.js'; + +function v4(options, buf, offset) { + options = options || {}; + const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return stringify(rnds); +} + +export default v4; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/v5.js b/node_modules/uuid/dist/esm-node/v5.js new file mode 100644 index 0000000..e87fe31 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/v5.js @@ -0,0 +1,4 @@ +import v35 from './v35.js'; +import sha1 from './sha1.js'; +const v5 = v35('v5', 0x50, sha1); +export default v5; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/validate.js b/node_modules/uuid/dist/esm-node/validate.js new file mode 100644 index 0000000..f1cdc7a --- /dev/null +++ b/node_modules/uuid/dist/esm-node/validate.js @@ -0,0 +1,7 @@ +import REGEX from './regex.js'; + +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} + +export default validate; \ No newline at end of file diff --git a/node_modules/uuid/dist/esm-node/version.js b/node_modules/uuid/dist/esm-node/version.js new file mode 100644 index 0000000..77530e9 --- /dev/null +++ b/node_modules/uuid/dist/esm-node/version.js @@ -0,0 +1,11 @@ +import validate from './validate.js'; + +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +export default version; \ No newline at end of file diff --git a/node_modules/uuid/dist/index.js b/node_modules/uuid/dist/index.js new file mode 100644 index 0000000..bf13b10 --- /dev/null +++ b/node_modules/uuid/dist/index.js @@ -0,0 +1,79 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "v1", { + enumerable: true, + get: function () { + return _v.default; + } +}); +Object.defineProperty(exports, "v3", { + enumerable: true, + get: function () { + return _v2.default; + } +}); +Object.defineProperty(exports, "v4", { + enumerable: true, + get: function () { + return _v3.default; + } +}); +Object.defineProperty(exports, "v5", { + enumerable: true, + get: function () { + return _v4.default; + } +}); +Object.defineProperty(exports, "NIL", { + enumerable: true, + get: function () { + return _nil.default; + } +}); +Object.defineProperty(exports, "version", { + enumerable: true, + get: function () { + return _version.default; + } +}); +Object.defineProperty(exports, "validate", { + enumerable: true, + get: function () { + return _validate.default; + } +}); +Object.defineProperty(exports, "stringify", { + enumerable: true, + get: function () { + return _stringify.default; + } +}); +Object.defineProperty(exports, "parse", { + enumerable: true, + get: function () { + return _parse.default; + } +}); + +var _v = _interopRequireDefault(require("./v1.js")); + +var _v2 = _interopRequireDefault(require("./v3.js")); + +var _v3 = _interopRequireDefault(require("./v4.js")); + +var _v4 = _interopRequireDefault(require("./v5.js")); + +var _nil = _interopRequireDefault(require("./nil.js")); + +var _version = _interopRequireDefault(require("./version.js")); + +var _validate = _interopRequireDefault(require("./validate.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +var _parse = _interopRequireDefault(require("./parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/node_modules/uuid/dist/md5-browser.js b/node_modules/uuid/dist/md5-browser.js new file mode 100644 index 0000000..7a4582a --- /dev/null +++ b/node_modules/uuid/dist/md5-browser.js @@ -0,0 +1,223 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/* + * Browser-compatible JavaScript MD5 + * + * Modification of JavaScript MD5 + * https://github.com/blueimp/JavaScript-MD5 + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ +function md5(bytes) { + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = new Uint8Array(msg.length); + + for (let i = 0; i < msg.length; ++i) { + bytes[i] = msg.charCodeAt(i); + } + } + + return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8)); +} +/* + * Convert an array of little-endian words to an array of bytes + */ + + +function md5ToHexEncodedArray(input) { + const output = []; + const length32 = input.length * 32; + const hexTab = '0123456789abcdef'; + + for (let i = 0; i < length32; i += 8) { + const x = input[i >> 5] >>> i % 32 & 0xff; + const hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16); + output.push(hex); + } + + return output; +} +/** + * Calculate output length with padding and bit length + */ + + +function getOutputLength(inputLength8) { + return (inputLength8 + 64 >>> 9 << 4) + 14 + 1; +} +/* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + + +function wordsToMd5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << len % 32; + x[getOutputLength(len) - 1] = len; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + + return [a, b, c, d]; +} +/* + * Convert an array bytes to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + + +function bytesToWords(input) { + if (input.length === 0) { + return []; + } + + const length8 = input.length * 8; + const output = new Uint32Array(getOutputLength(length8)); + + for (let i = 0; i < length8; i += 8) { + output[i >> 5] |= (input[i / 8] & 0xff) << i % 32; + } + + return output; +} +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + + +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return msw << 16 | lsw & 0xffff; +} +/* + * Bitwise rotate a 32-bit number to the left. + */ + + +function bitRotateLeft(num, cnt) { + return num << cnt | num >>> 32 - cnt; +} +/* + * These functions implement the four basic operations the algorithm uses. + */ + + +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} + +function md5ff(a, b, c, d, x, s, t) { + return md5cmn(b & c | ~b & d, a, b, x, s, t); +} + +function md5gg(a, b, c, d, x, s, t) { + return md5cmn(b & d | c & ~d, a, b, x, s, t); +} + +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} + +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} + +var _default = md5; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/md5.js b/node_modules/uuid/dist/md5.js new file mode 100644 index 0000000..824d481 --- /dev/null +++ b/node_modules/uuid/dist/md5.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('md5').update(bytes).digest(); +} + +var _default = md5; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/nil.js b/node_modules/uuid/dist/nil.js new file mode 100644 index 0000000..7ade577 --- /dev/null +++ b/node_modules/uuid/dist/nil.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = '00000000-0000-0000-0000-000000000000'; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/parse.js b/node_modules/uuid/dist/parse.js new file mode 100644 index 0000000..4c69fc3 --- /dev/null +++ b/node_modules/uuid/dist/parse.js @@ -0,0 +1,45 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parse(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + let v; + const arr = new Uint8Array(16); // Parse ########-....-....-....-............ + + arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; + arr[1] = v >>> 16 & 0xff; + arr[2] = v >>> 8 & 0xff; + arr[3] = v & 0xff; // Parse ........-####-....-....-............ + + arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; + arr[5] = v & 0xff; // Parse ........-....-####-....-............ + + arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; + arr[7] = v & 0xff; // Parse ........-....-....-####-............ + + arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; + arr[9] = v & 0xff; // Parse ........-....-....-....-############ + // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) + + arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff; + arr[11] = v / 0x100000000 & 0xff; + arr[12] = v >>> 24 & 0xff; + arr[13] = v >>> 16 & 0xff; + arr[14] = v >>> 8 & 0xff; + arr[15] = v & 0xff; + return arr; +} + +var _default = parse; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/regex.js b/node_modules/uuid/dist/regex.js new file mode 100644 index 0000000..1ef91d6 --- /dev/null +++ b/node_modules/uuid/dist/regex.js @@ -0,0 +1,8 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/rng-browser.js b/node_modules/uuid/dist/rng-browser.js new file mode 100644 index 0000000..91faeae --- /dev/null +++ b/node_modules/uuid/dist/rng-browser.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rng; +// Unique ID creation requires a high quality random # generator. In the browser we therefore +// require the crypto API and do not support built-in fallback to lower quality random number +// generators (like Math.random()). +let getRandomValues; +const rnds8 = new Uint8Array(16); + +function rng() { + // lazy load so that environments that need to polyfill have a chance to do so + if (!getRandomValues) { + // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, + // find the complete implementation of crypto (msCrypto) on IE11. + getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto); + + if (!getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + } + + return getRandomValues(rnds8); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/rng.js b/node_modules/uuid/dist/rng.js new file mode 100644 index 0000000..3507f93 --- /dev/null +++ b/node_modules/uuid/dist/rng.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = rng; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + +let poolPtr = rnds8Pool.length; + +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + _crypto.default.randomFillSync(rnds8Pool); + + poolPtr = 0; + } + + return rnds8Pool.slice(poolPtr, poolPtr += 16); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/sha1-browser.js b/node_modules/uuid/dist/sha1-browser.js new file mode 100644 index 0000000..24cbced --- /dev/null +++ b/node_modules/uuid/dist/sha1-browser.js @@ -0,0 +1,104 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +// Adapted from Chris Veness' SHA1 code at +// http://www.movable-type.co.uk/scripts/sha1.html +function f(s, x, y, z) { + switch (s) { + case 0: + return x & y ^ ~x & z; + + case 1: + return x ^ y ^ z; + + case 2: + return x & y ^ x & z ^ y & z; + + case 3: + return x ^ y ^ z; + } +} + +function ROTL(x, n) { + return x << n | x >>> 32 - n; +} + +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + + if (typeof bytes === 'string') { + const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape + + bytes = []; + + for (let i = 0; i < msg.length; ++i) { + bytes.push(msg.charCodeAt(i)); + } + } else if (!Array.isArray(bytes)) { + // Convert Array-like to Array + bytes = Array.prototype.slice.call(bytes); + } + + bytes.push(0x80); + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + + for (let j = 0; j < 16; ++j) { + arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3]; + } + + M[i] = arr; + } + + M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff; + + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + + H[0] = H[0] + a >>> 0; + H[1] = H[1] + b >>> 0; + H[2] = H[2] + c >>> 0; + H[3] = H[3] + d >>> 0; + H[4] = H[4] + e >>> 0; + } + + return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff]; +} + +var _default = sha1; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/sha1.js b/node_modules/uuid/dist/sha1.js new file mode 100644 index 0000000..03bdd63 --- /dev/null +++ b/node_modules/uuid/dist/sha1.js @@ -0,0 +1,23 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _crypto = _interopRequireDefault(require("crypto")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + + return _crypto.default.createHash('sha1').update(bytes).digest(); +} + +var _default = sha1; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/stringify.js b/node_modules/uuid/dist/stringify.js new file mode 100644 index 0000000..b8e7519 --- /dev/null +++ b/node_modules/uuid/dist/stringify.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +const byteToHex = []; + +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).substr(1)); +} + +function stringify(arr, offset = 0) { + // Note: Be careful editing this code! It's been tuned for performance + // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 + const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one + // of the following: + // - One or more input array values don't map to a hex octet (leading to + // "undefined" in the uuid) + // - Invalid input values for the RFC `version` or `variant` fields + + if (!(0, _validate.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + + return uuid; +} + +var _default = stringify; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuid.min.js b/node_modules/uuid/dist/umd/uuid.min.js new file mode 100644 index 0000000..639ca2f --- /dev/null +++ b/node_modules/uuid/dist/umd/uuid.min.js @@ -0,0 +1 @@ +!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self).uuid={})}(this,(function(r){"use strict";var e,n=new Uint8Array(16);function t(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(n)}var o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function a(r){return"string"==typeof r&&o.test(r)}for(var i,u,f=[],s=0;s<256;++s)f.push((s+256).toString(16).substr(1));function c(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(f[r[e+0]]+f[r[e+1]]+f[r[e+2]]+f[r[e+3]]+"-"+f[r[e+4]]+f[r[e+5]]+"-"+f[r[e+6]]+f[r[e+7]]+"-"+f[r[e+8]]+f[r[e+9]]+"-"+f[r[e+10]]+f[r[e+11]]+f[r[e+12]]+f[r[e+13]]+f[r[e+14]]+f[r[e+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n}var l=0,d=0;function v(r){if(!a(r))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(r.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(r.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(r.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(r.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function p(r,e,n){function t(r,t,o,a){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],n=0;n>>9<<4)+1}function y(r,e){var n=(65535&r)+(65535&e);return(r>>16)+(e>>16)+(n>>16)<<16|65535&n}function g(r,e,n,t,o,a){return y((i=y(y(e,r),y(t,a)))<<(u=o)|i>>>32-u,n);var i,u}function m(r,e,n,t,o,a,i){return g(e&n|~e&t,r,e,o,a,i)}function w(r,e,n,t,o,a,i){return g(e&t|n&~t,r,e,o,a,i)}function b(r,e,n,t,o,a,i){return g(e^n^t,r,e,o,a,i)}function A(r,e,n,t,o,a,i){return g(n^(e|~t),r,e,o,a,i)}var U=p("v3",48,(function(r){if("string"==typeof r){var e=unescape(encodeURIComponent(r));r=new Uint8Array(e.length);for(var n=0;n>5]>>>o%32&255,i=parseInt(t.charAt(a>>>4&15)+t.charAt(15&a),16);e.push(i)}return e}(function(r,e){r[e>>5]|=128<>5]|=(255&r[t/8])<>>32-e}var R=p("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var t=unescape(encodeURIComponent(r));r=[];for(var o=0;o>>0;w=m,m=g,g=C(y,30)>>>0,y=h,h=U}n[0]=n[0]+h>>>0,n[1]=n[1]+y>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+m>>>0,n[4]=n[4]+w>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));r.NIL="00000000-0000-0000-0000-000000000000",r.parse=v,r.stringify=c,r.v1=function(r,e,n){var o=e&&n||0,a=e||new Array(16),f=(r=r||{}).node||i,s=void 0!==r.clockseq?r.clockseq:u;if(null==f||null==s){var v=r.random||(r.rng||t)();null==f&&(f=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==s&&(s=u=16383&(v[6]<<8|v[7]))}var p=void 0!==r.msecs?r.msecs:Date.now(),h=void 0!==r.nsecs?r.nsecs:d+1,y=p-l+(h-d)/1e4;if(y<0&&void 0===r.clockseq&&(s=s+1&16383),(y<0||p>l)&&void 0===r.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");l=p,d=h,u=s;var g=(1e4*(268435455&(p+=122192928e5))+h)%4294967296;a[o++]=g>>>24&255,a[o++]=g>>>16&255,a[o++]=g>>>8&255,a[o++]=255&g;var m=p/4294967296*1e4&268435455;a[o++]=m>>>8&255,a[o++]=255&m,a[o++]=m>>>24&15|16,a[o++]=m>>>16&255,a[o++]=s>>>8|128,a[o++]=255&s;for(var w=0;w<6;++w)a[o+w]=f[w];return e||c(a)},r.v3=U,r.v4=function(r,e,n){var o=(r=r||{}).random||(r.rng||t)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(var a=0;a<16;++a)e[n+a]=o[a];return e}return c(o)},r.v5=R,r.validate=a,r.version=function(r){if(!a(r))throw TypeError("Invalid UUID");return parseInt(r.substr(14,1),16)},Object.defineProperty(r,"__esModule",{value:!0})})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidNIL.min.js b/node_modules/uuid/dist/umd/uuidNIL.min.js new file mode 100644 index 0000000..30b28a7 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidNIL.min.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidNIL=n()}(this,(function(){"use strict";return"00000000-0000-0000-0000-000000000000"})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidParse.min.js b/node_modules/uuid/dist/umd/uuidParse.min.js new file mode 100644 index 0000000..d48ea6a --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidParse.min.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidParse=n()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(n){if(!function(n){return"string"==typeof n&&e.test(n)}(n))throw TypeError("Invalid UUID");var t,i=new Uint8Array(16);return i[0]=(t=parseInt(n.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(n.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(n.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(n.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(n.slice(24,36),16))/1099511627776&255,i[11]=t/4294967296&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidStringify.min.js b/node_modules/uuid/dist/umd/uuidStringify.min.js new file mode 100644 index 0000000..fd39adc --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidStringify.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidStringify=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function t(t){return"string"==typeof t&&e.test(t)}for(var i=[],n=0;n<256;++n)i.push((n+256).toString(16).substr(1));return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,f=(i[e[n+0]]+i[e[n+1]]+i[e[n+2]]+i[e[n+3]]+"-"+i[e[n+4]]+i[e[n+5]]+"-"+i[e[n+6]]+i[e[n+7]]+"-"+i[e[n+8]]+i[e[n+9]]+"-"+i[e[n+10]]+i[e[n+11]]+i[e[n+12]]+i[e[n+13]]+i[e[n+14]]+i[e[n+15]]).toLowerCase();if(!t(f))throw TypeError("Stringified UUID is invalid");return f}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidValidate.min.js b/node_modules/uuid/dist/umd/uuidValidate.min.js new file mode 100644 index 0000000..378e5b9 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidValidate.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidValidate=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){return"string"==typeof t&&e.test(t)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidVersion.min.js b/node_modules/uuid/dist/umd/uuidVersion.min.js new file mode 100644 index 0000000..274bb09 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidVersion.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidVersion=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){if(!function(t){return"string"==typeof t&&e.test(t)}(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidv1.min.js b/node_modules/uuid/dist/umd/uuidv1.min.js new file mode 100644 index 0000000..2622889 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidv1.min.js @@ -0,0 +1 @@ +!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidv1=o()}(this,(function(){"use strict";var e,o=new Uint8Array(16);function t(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(o)}var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(e){return"string"==typeof e&&n.test(e)}for(var i,u,s=[],a=0;a<256;++a)s.push((a+256).toString(16).substr(1));var d=0,f=0;return function(e,o,n){var a=o&&n||0,c=o||new Array(16),l=(e=e||{}).node||i,p=void 0!==e.clockseq?e.clockseq:u;if(null==l||null==p){var v=e.random||(e.rng||t)();null==l&&(l=i=[1|v[0],v[1],v[2],v[3],v[4],v[5]]),null==p&&(p=u=16383&(v[6]<<8|v[7]))}var y=void 0!==e.msecs?e.msecs:Date.now(),m=void 0!==e.nsecs?e.nsecs:f+1,g=y-d+(m-f)/1e4;if(g<0&&void 0===e.clockseq&&(p=p+1&16383),(g<0||y>d)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=y,f=m,u=p;var h=(1e4*(268435455&(y+=122192928e5))+m)%4294967296;c[a++]=h>>>24&255,c[a++]=h>>>16&255,c[a++]=h>>>8&255,c[a++]=255&h;var w=y/4294967296*1e4&268435455;c[a++]=w>>>8&255,c[a++]=255&w,c[a++]=w>>>24&15|16,c[a++]=w>>>16&255,c[a++]=p>>>8|128,c[a++]=255&p;for(var b=0;b<6;++b)c[a+b]=l[b];return o||function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=(s[e[o+0]]+s[e[o+1]]+s[e[o+2]]+s[e[o+3]]+"-"+s[e[o+4]]+s[e[o+5]]+"-"+s[e[o+6]]+s[e[o+7]]+"-"+s[e[o+8]]+s[e[o+9]]+"-"+s[e[o+10]]+s[e[o+11]]+s[e[o+12]]+s[e[o+13]]+s[e[o+14]]+s[e[o+15]]).toLowerCase();if(!r(t))throw TypeError("Stringified UUID is invalid");return t}(c)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidv3.min.js b/node_modules/uuid/dist/umd/uuidv3.min.js new file mode 100644 index 0000000..8d37b62 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidv3.min.js @@ -0,0 +1 @@ +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(n="undefined"!=typeof globalThis?globalThis:n||self).uuidv3=r()}(this,(function(){"use strict";var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function r(r){return"string"==typeof r&&n.test(r)}for(var e=[],t=0;t<256;++t)e.push((t+256).toString(16).substr(1));function i(n){return 14+(n+64>>>9<<4)+1}function o(n,r){var e=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(e>>16)<<16|65535&e}function a(n,r,e,t,i,a){return o((f=o(o(r,n),o(t,a)))<<(u=i)|f>>>32-u,e);var f,u}function f(n,r,e,t,i,o,f){return a(r&e|~r&t,n,r,i,o,f)}function u(n,r,e,t,i,o,f){return a(r&t|e&~t,n,r,i,o,f)}function c(n,r,e,t,i,o,f){return a(r^e^t,n,r,i,o,f)}function s(n,r,e,t,i,o,f){return a(e^(r|~t),n,r,i,o,f)}return function(n,t,i){function o(n,o,a,f){if("string"==typeof n&&(n=function(n){n=unescape(encodeURIComponent(n));for(var r=[],e=0;e>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=255&e,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=255&e,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=255&e,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=255&e,t}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+n.length);if(u.set(o),u.set(n,o.length),(u=i(u))[6]=15&u[6]|t,u[8]=63&u[8]|128,a){f=f||0;for(var c=0;c<16;++c)a[f+c]=u[c];return a}return function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(e[n[t+0]]+e[n[t+1]]+e[n[t+2]]+e[n[t+3]]+"-"+e[n[t+4]]+e[n[t+5]]+"-"+e[n[t+6]]+e[n[t+7]]+"-"+e[n[t+8]]+e[n[t+9]]+"-"+e[n[t+10]]+e[n[t+11]]+e[n[t+12]]+e[n[t+13]]+e[n[t+14]]+e[n[t+15]]).toLowerCase();if(!r(i))throw TypeError("Stringified UUID is invalid");return i}(u)}try{o.name=n}catch(n){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v3",48,(function(n){if("string"==typeof n){var r=unescape(encodeURIComponent(n));n=new Uint8Array(r.length);for(var e=0;e>5]>>>i%32&255,a=parseInt(t.charAt(o>>>4&15)+t.charAt(15&o),16);r.push(a)}return r}(function(n,r){n[r>>5]|=128<>5]|=(255&n[t/8])<1&&void 0!==arguments[1]?arguments[1]:0,o=(i[t[e+0]]+i[t[e+1]]+i[t[e+2]]+i[t[e+3]]+"-"+i[t[e+4]]+i[t[e+5]]+"-"+i[t[e+6]]+i[t[e+7]]+"-"+i[t[e+8]]+i[t[e+9]]+"-"+i[t[e+10]]+i[t[e+11]]+i[t[e+12]]+i[t[e+13]]+i[t[e+14]]+i[t[e+15]]).toLowerCase();if(!r(o))throw TypeError("Stringified UUID is invalid");return o}(u)}})); \ No newline at end of file diff --git a/node_modules/uuid/dist/umd/uuidv5.min.js b/node_modules/uuid/dist/umd/uuidv5.min.js new file mode 100644 index 0000000..ba6fc63 --- /dev/null +++ b/node_modules/uuid/dist/umd/uuidv5.min.js @@ -0,0 +1 @@ +!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).uuidv5=e()}(this,(function(){"use strict";var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function e(e){return"string"==typeof e&&r.test(e)}for(var t=[],n=0;n<256;++n)t.push((n+256).toString(16).substr(1));function a(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:return e^t^n;case 2:return e&t^e&n^t&n;case 3:return e^t^n}}function o(r,e){return r<>>32-e}return function(r,n,a){function o(r,o,i,f){if("string"==typeof r&&(r=function(r){r=unescape(encodeURIComponent(r));for(var e=[],t=0;t>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(r.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(r.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(r.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(r.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n}(o)),16!==o.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var s=new Uint8Array(16+r.length);if(s.set(o),s.set(r,o.length),(s=a(s))[6]=15&s[6]|n,s[8]=63&s[8]|128,i){f=f||0;for(var u=0;u<16;++u)i[f+u]=s[u];return i}return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=(t[r[n+0]]+t[r[n+1]]+t[r[n+2]]+t[r[n+3]]+"-"+t[r[n+4]]+t[r[n+5]]+"-"+t[r[n+6]]+t[r[n+7]]+"-"+t[r[n+8]]+t[r[n+9]]+"-"+t[r[n+10]]+t[r[n+11]]+t[r[n+12]]+t[r[n+13]]+t[r[n+14]]+t[r[n+15]]).toLowerCase();if(!e(a))throw TypeError("Stringified UUID is invalid");return a}(s)}try{o.name=r}catch(r){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}("v5",80,(function(r){var e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){var n=unescape(encodeURIComponent(r));r=[];for(var i=0;i>>0;A=U,U=w,w=o(b,30)>>>0,b=g,g=C}t[0]=t[0]+g>>>0,t[1]=t[1]+b>>>0,t[2]=t[2]+w>>>0,t[3]=t[3]+U>>>0,t[4]=t[4]+A>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,255&t[0],t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,255&t[1],t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,255&t[2],t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,255&t[3],t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,255&t[4]]}))})); \ No newline at end of file diff --git a/node_modules/uuid/dist/uuid-bin.js b/node_modules/uuid/dist/uuid-bin.js new file mode 100644 index 0000000..50a7a9f --- /dev/null +++ b/node_modules/uuid/dist/uuid-bin.js @@ -0,0 +1,85 @@ +"use strict"; + +var _assert = _interopRequireDefault(require("assert")); + +var _v = _interopRequireDefault(require("./v1.js")); + +var _v2 = _interopRequireDefault(require("./v3.js")); + +var _v3 = _interopRequireDefault(require("./v4.js")); + +var _v4 = _interopRequireDefault(require("./v5.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC4122'); +} + +const args = process.argv.slice(2); + +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} + +const version = args.shift() || 'v4'; + +switch (version) { + case 'v1': + console.log((0, _v.default)()); + break; + + case 'v3': + { + const name = args.shift(); + let namespace = args.shift(); + (0, _assert.default)(name != null, 'v3 name not specified'); + (0, _assert.default)(namespace != null, 'v3 namespace not specified'); + + if (namespace === 'URL') { + namespace = _v2.default.URL; + } + + if (namespace === 'DNS') { + namespace = _v2.default.DNS; + } + + console.log((0, _v2.default)(name, namespace)); + break; + } + + case 'v4': + console.log((0, _v3.default)()); + break; + + case 'v5': + { + const name = args.shift(); + let namespace = args.shift(); + (0, _assert.default)(name != null, 'v5 name not specified'); + (0, _assert.default)(namespace != null, 'v5 namespace not specified'); + + if (namespace === 'URL') { + namespace = _v4.default.URL; + } + + if (namespace === 'DNS') { + namespace = _v4.default.DNS; + } + + console.log((0, _v4.default)(name, namespace)); + break; + } + + default: + usage(); + process.exit(1); +} \ No newline at end of file diff --git a/node_modules/uuid/dist/v1.js b/node_modules/uuid/dist/v1.js new file mode 100644 index 0000000..abb9b3d --- /dev/null +++ b/node_modules/uuid/dist/v1.js @@ -0,0 +1,107 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _rng = _interopRequireDefault(require("./rng.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// **`v1()` - Generate time-based UUID** +// +// Inspired by https://github.com/LiosK/UUID.js +// and http://docs.python.org/library/uuid.html +let _nodeId; + +let _clockseq; // Previous uuid creation time + + +let _lastMSecs = 0; +let _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details + +function v1(options, buf, offset) { + let i = buf && offset || 0; + const b = buf || new Array(16); + options = options || {}; + let node = options.node || _nodeId; + let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + + if (node == null || clockseq == null) { + const seedBytes = options.random || (options.rng || _rng.default)(); + + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; + } + + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + + + let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + + let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) + + const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression + + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + + + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } // Per 4.2.1.2 Throw error if too many uuids are requested + + + if (nsecs >= 10000) { + throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + + msecs += 12219292800000; // `time_low` + + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; // `time_mid` + + const tmh = msecs / 0x100000000 * 10000 & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; // `time_high_and_version` + + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + + b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + + b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` + + b[i++] = clockseq & 0xff; // `node` + + for (let n = 0; n < 6; ++n) { + b[i + n] = node[n]; + } + + return buf || (0, _stringify.default)(b); +} + +var _default = v1; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/v3.js b/node_modules/uuid/dist/v3.js new file mode 100644 index 0000000..6b47ff5 --- /dev/null +++ b/node_modules/uuid/dist/v3.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _v = _interopRequireDefault(require("./v35.js")); + +var _md = _interopRequireDefault(require("./md5.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v3 = (0, _v.default)('v3', 0x30, _md.default); +var _default = v3; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/v35.js b/node_modules/uuid/dist/v35.js new file mode 100644 index 0000000..f784c63 --- /dev/null +++ b/node_modules/uuid/dist/v35.js @@ -0,0 +1,78 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _default; +exports.URL = exports.DNS = void 0; + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +var _parse = _interopRequireDefault(require("./parse.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); // UTF8 escape + + const bytes = []; + + for (let i = 0; i < str.length; ++i) { + bytes.push(str.charCodeAt(i)); + } + + return bytes; +} + +const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.DNS = DNS; +const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = URL; + +function _default(name, version, hashfunc) { + function generateUUID(value, namespace, buf, offset) { + if (typeof value === 'string') { + value = stringToBytes(value); + } + + if (typeof namespace === 'string') { + namespace = (0, _parse.default)(namespace); + } + + if (namespace.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } // Compute hash of namespace and value, Per 4.3 + // Future: Use spread syntax when supported on all platforms, e.g. `bytes = + // hashfunc([...namespace, ... value])` + + + let bytes = new Uint8Array(16 + value.length); + bytes.set(namespace); + bytes.set(value, namespace.length); + bytes = hashfunc(bytes); + bytes[6] = bytes[6] & 0x0f | version; + bytes[8] = bytes[8] & 0x3f | 0x80; + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + + return buf; + } + + return (0, _stringify.default)(bytes); + } // Function#name is not settable on some platforms (#270) + + + try { + generateUUID.name = name; // eslint-disable-next-line no-empty + } catch (err) {} // For CommonJS default export support + + + generateUUID.DNS = DNS; + generateUUID.URL = URL; + return generateUUID; +} \ No newline at end of file diff --git a/node_modules/uuid/dist/v4.js b/node_modules/uuid/dist/v4.js new file mode 100644 index 0000000..838ce0b --- /dev/null +++ b/node_modules/uuid/dist/v4.js @@ -0,0 +1,37 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _rng = _interopRequireDefault(require("./rng.js")); + +var _stringify = _interopRequireDefault(require("./stringify.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function v4(options, buf, offset) { + options = options || {}; + + const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + offset = offset || 0; + + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + + return buf; + } + + return (0, _stringify.default)(rnds); +} + +var _default = v4; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/v5.js b/node_modules/uuid/dist/v5.js new file mode 100644 index 0000000..99d615e --- /dev/null +++ b/node_modules/uuid/dist/v5.js @@ -0,0 +1,16 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _v = _interopRequireDefault(require("./v35.js")); + +var _sha = _interopRequireDefault(require("./sha1.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const v5 = (0, _v.default)('v5', 0x50, _sha.default); +var _default = v5; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/validate.js b/node_modules/uuid/dist/validate.js new file mode 100644 index 0000000..fd05215 --- /dev/null +++ b/node_modules/uuid/dist/validate.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _regex = _interopRequireDefault(require("./regex.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function validate(uuid) { + return typeof uuid === 'string' && _regex.default.test(uuid); +} + +var _default = validate; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/dist/version.js b/node_modules/uuid/dist/version.js new file mode 100644 index 0000000..b72949c --- /dev/null +++ b/node_modules/uuid/dist/version.js @@ -0,0 +1,21 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _validate = _interopRequireDefault(require("./validate.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function version(uuid) { + if (!(0, _validate.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + + return parseInt(uuid.substr(14, 1), 16); +} + +var _default = version; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/uuid/package.json b/node_modules/uuid/package.json new file mode 100644 index 0000000..f0ab371 --- /dev/null +++ b/node_modules/uuid/package.json @@ -0,0 +1,135 @@ +{ + "name": "uuid", + "version": "8.3.2", + "description": "RFC4122 (v1, v4, and v5) UUIDs", + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "keywords": [ + "uuid", + "guid", + "rfc4122" + ], + "license": "MIT", + "bin": { + "uuid": "./dist/bin/uuid" + }, + "sideEffects": false, + "main": "./dist/index.js", + "exports": { + ".": { + "node": { + "module": "./dist/esm-node/index.js", + "require": "./dist/index.js", + "import": "./wrapper.mjs" + }, + "default": "./dist/esm-browser/index.js" + }, + "./package.json": "./package.json" + }, + "module": "./dist/esm-node/index.js", + "browser": { + "./dist/md5.js": "./dist/md5-browser.js", + "./dist/rng.js": "./dist/rng-browser.js", + "./dist/sha1.js": "./dist/sha1-browser.js", + "./dist/esm-node/index.js": "./dist/esm-browser/index.js" + }, + "files": [ + "CHANGELOG.md", + "CONTRIBUTING.md", + "LICENSE.md", + "README.md", + "dist", + "wrapper.mjs" + ], + "devDependencies": { + "@babel/cli": "7.11.6", + "@babel/core": "7.11.6", + "@babel/preset-env": "7.11.5", + "@commitlint/cli": "11.0.0", + "@commitlint/config-conventional": "11.0.0", + "@rollup/plugin-node-resolve": "9.0.0", + "babel-eslint": "10.1.0", + "bundlewatch": "0.3.1", + "eslint": "7.10.0", + "eslint-config-prettier": "6.12.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.22.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-prettier": "3.1.4", + "eslint-plugin-promise": "4.2.1", + "eslint-plugin-standard": "4.0.1", + "husky": "4.3.0", + "jest": "25.5.4", + "lint-staged": "10.4.0", + "npm-run-all": "4.1.5", + "optional-dev-dependency": "2.0.1", + "prettier": "2.1.2", + "random-seed": "0.3.0", + "rollup": "2.28.2", + "rollup-plugin-terser": "7.0.2", + "runmd": "1.3.2", + "standard-version": "9.0.0" + }, + "optionalDevDependencies": { + "@wdio/browserstack-service": "6.4.0", + "@wdio/cli": "6.4.0", + "@wdio/jasmine-framework": "6.4.0", + "@wdio/local-runner": "6.4.0", + "@wdio/spec-reporter": "6.4.0", + "@wdio/static-server-service": "6.4.0", + "@wdio/sync": "6.4.0" + }, + "scripts": { + "examples:browser:webpack:build": "cd examples/browser-webpack && npm install && npm run build", + "examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build", + "examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test", + "examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test", + "lint": "npm run eslint:check && npm run prettier:check", + "eslint:check": "eslint src/ test/ examples/ *.js", + "eslint:fix": "eslint --fix src/ test/ examples/ *.js", + "pretest": "[ -n $CI ] || npm run build", + "test": "BABEL_ENV=commonjs node --throw-deprecation node_modules/.bin/jest test/unit/", + "pretest:browser": "optional-dev-dependency && npm run build && npm-run-all --parallel examples:browser:**", + "test:browser": "wdio run ./wdio.conf.js", + "pretest:node": "npm run build", + "test:node": "npm-run-all --parallel examples:node:**", + "test:pack": "./scripts/testpack.sh", + "pretest:benchmark": "npm run build", + "test:benchmark": "cd examples/benchmark && npm install && npm test", + "prettier:check": "prettier --ignore-path .prettierignore --check '**/*.{js,jsx,json,md}'", + "prettier:fix": "prettier --ignore-path .prettierignore --write '**/*.{js,jsx,json,md}'", + "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", + "md": "runmd --watch --output=README.md README_js.md", + "docs": "( node --version | grep -q 'v12' ) && ( npm run build && runmd --output=README.md README_js.md )", + "docs:diff": "npm run docs && git diff --quiet README.md", + "build": "./scripts/build.sh", + "prepack": "npm run build", + "release": "standard-version --no-verify" + }, + "repository": { + "type": "git", + "url": "https://github.com/uuidjs/uuid.git" + }, + "husky": { + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS", + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,jsx,json,md}": [ + "prettier --write" + ], + "*.{js,jsx}": [ + "eslint --fix" + ] + }, + "standard-version": { + "scripts": { + "postchangelog": "prettier --write CHANGELOG.md" + } + } +} diff --git a/node_modules/uuid/wrapper.mjs b/node_modules/uuid/wrapper.mjs new file mode 100644 index 0000000..c31e9ce --- /dev/null +++ b/node_modules/uuid/wrapper.mjs @@ -0,0 +1,10 @@ +import uuid from './dist/index.js'; +export const v1 = uuid.v1; +export const v3 = uuid.v3; +export const v4 = uuid.v4; +export const v5 = uuid.v5; +export const NIL = uuid.NIL; +export const version = uuid.version; +export const validate = uuid.validate; +export const stringify = uuid.stringify; +export const parse = uuid.parse; diff --git a/node_modules/vary/HISTORY.md b/node_modules/vary/HISTORY.md new file mode 100644 index 0000000..f6cbcf7 --- /dev/null +++ b/node_modules/vary/HISTORY.md @@ -0,0 +1,39 @@ +1.1.2 / 2017-09-23 +================== + + * perf: improve header token parsing speed + +1.1.1 / 2017-03-20 +================== + + * perf: hoist regular expression + +1.1.0 / 2015-09-29 +================== + + * Only accept valid field names in the `field` argument + - Ensures the resulting string is a valid HTTP header value + +1.0.1 / 2015-07-08 +================== + + * Fix setting empty header from empty `field` + * perf: enable strict mode + * perf: remove argument reassignments + +1.0.0 / 2014-08-10 +================== + + * Accept valid `Vary` header string as `field` + * Add `vary.append` for low-level string manipulation + * Move to `jshttp` orgainzation + +0.1.0 / 2014-06-05 +================== + + * Support array of fields to set + +0.0.0 / 2014-06-04 +================== + + * Initial release diff --git a/node_modules/vary/LICENSE b/node_modules/vary/LICENSE new file mode 100644 index 0000000..84441fb --- /dev/null +++ b/node_modules/vary/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/vary/README.md b/node_modules/vary/README.md new file mode 100644 index 0000000..cc000b3 --- /dev/null +++ b/node_modules/vary/README.md @@ -0,0 +1,101 @@ +# vary + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Manipulate the HTTP Vary header + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install vary +``` + +## API + + + +```js +var vary = require('vary') +``` + +### vary(res, field) + +Adds the given header `field` to the `Vary` response header of `res`. +This can be a string of a single field, a string of a valid `Vary` +header, or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. + + + +```js +// Append "Origin" to the Vary header of the response +vary(res, 'Origin') +``` + +### vary.append(header, field) + +Adds the given header `field` to the `Vary` response header string `header`. +This can be a string of a single field, a string of a valid `Vary` header, +or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. The new header string is returned. + + + +```js +// Get header string appending "Origin" to "Accept, User-Agent" +vary.append('Accept, User-Agent', 'Origin') +``` + +## Examples + +### Updating the Vary header when content is based on it + +```js +var http = require('http') +var vary = require('vary') + +http.createServer(function onRequest (req, res) { + // about to user-agent sniff + vary(res, 'User-Agent') + + var ua = req.headers['user-agent'] || '' + var isMobile = /mobi|android|touch|mini/i.test(ua) + + // serve site, depending on isMobile + res.setHeader('Content-Type', 'text/html') + res.end('You are (probably) ' + (isMobile ? '' : 'not ') + 'a mobile user') +}) +``` + +## Testing + +```sh +$ npm test +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/vary.svg +[npm-url]: https://npmjs.org/package/vary +[node-version-image]: https://img.shields.io/node/v/vary.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/jshttp/vary/master.svg +[travis-url]: https://travis-ci.org/jshttp/vary +[coveralls-image]: https://img.shields.io/coveralls/jshttp/vary/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/vary +[downloads-image]: https://img.shields.io/npm/dm/vary.svg +[downloads-url]: https://npmjs.org/package/vary diff --git a/node_modules/vary/index.js b/node_modules/vary/index.js new file mode 100644 index 0000000..5b5e741 --- /dev/null +++ b/node_modules/vary/index.js @@ -0,0 +1,149 @@ +/*! + * vary + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = vary +module.exports.append = append + +/** + * RegExp to match field-name in RFC 7230 sec 3.2 + * + * field-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + */ + +var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/ + +/** + * Append a field to a vary header. + * + * @param {String} header + * @param {String|Array} field + * @return {String} + * @public + */ + +function append (header, field) { + if (typeof header !== 'string') { + throw new TypeError('header argument is required') + } + + if (!field) { + throw new TypeError('field argument is required') + } + + // get fields array + var fields = !Array.isArray(field) + ? parse(String(field)) + : field + + // assert on invalid field names + for (var j = 0; j < fields.length; j++) { + if (!FIELD_NAME_REGEXP.test(fields[j])) { + throw new TypeError('field argument contains an invalid header name') + } + } + + // existing, unspecified vary + if (header === '*') { + return header + } + + // enumerate current values + var val = header + var vals = parse(header.toLowerCase()) + + // unspecified vary + if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) { + return '*' + } + + for (var i = 0; i < fields.length; i++) { + var fld = fields[i].toLowerCase() + + // append value (case-preserving) + if (vals.indexOf(fld) === -1) { + vals.push(fld) + val = val + ? val + ', ' + fields[i] + : fields[i] + } + } + + return val +} + +/** + * Parse a vary header into an array. + * + * @param {String} header + * @return {Array} + * @private + */ + +function parse (header) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = header.length; i < len; i++) { + switch (header.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(header.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(header.substring(start, end)) + + return list +} + +/** + * Mark that a request is varied on a header field. + * + * @param {Object} res + * @param {String|Array} field + * @public + */ + +function vary (res, field) { + if (!res || !res.getHeader || !res.setHeader) { + // quack quack + throw new TypeError('res argument is required') + } + + // get existing header + var val = res.getHeader('Vary') || '' + var header = Array.isArray(val) + ? val.join(', ') + : String(val) + + // set new header + if ((val = append(header, field))) { + res.setHeader('Vary', val) + } +} diff --git a/node_modules/vary/package.json b/node_modules/vary/package.json new file mode 100644 index 0000000..028f72a --- /dev/null +++ b/node_modules/vary/package.json @@ -0,0 +1,43 @@ +{ + "name": "vary", + "description": "Manipulate the HTTP Vary header", + "version": "1.1.2", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "http", + "res", + "vary" + ], + "repository": "jshttp/vary", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "2.5.3", + "supertest": "1.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/node_modules/which-module/LICENSE b/node_modules/which-module/LICENSE new file mode 100644 index 0000000..ab601b6 --- /dev/null +++ b/node_modules/which-module/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/which-module/README.md b/node_modules/which-module/README.md new file mode 100644 index 0000000..008a1ae --- /dev/null +++ b/node_modules/which-module/README.md @@ -0,0 +1,58 @@ +# which-module + +> Find the module object for something that was require()d + +[![Build Status](https://travis-ci.org/nexdrew/which-module.svg?branch=master)](https://travis-ci.org/nexdrew/which-module) +[![Coverage Status](https://coveralls.io/repos/github/nexdrew/which-module/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/which-module?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) +[![Greenkeeper badge](https://badges.greenkeeper.io/nexdrew/which-module.svg)](https://greenkeeper.io/) + +Find the `module` object in `require.cache` for something that was `require()`d +or `import`ed - essentially a reverse `require()` lookup. + +Useful for libs that want to e.g. lookup a filename for a module or submodule +that it did not `require()` itself. + +## Install and Usage + +``` +npm install --save which-module +``` + +```js +const whichModule = require('which-module') + +console.log(whichModule(require('something'))) +// Module { +// id: '/path/to/project/node_modules/something/index.js', +// exports: [Function], +// parent: ..., +// filename: '/path/to/project/node_modules/something/index.js', +// loaded: true, +// children: [], +// paths: [ '/path/to/project/node_modules/something/node_modules', +// '/path/to/project/node_modules', +// '/path/to/node_modules', +// '/path/node_modules', +// '/node_modules' ] } +``` + +## API + +### `whichModule(exported)` + +Return the [`module` object](https://nodejs.org/api/modules.html#modules_the_module_object), +if any, that represents the given argument in the `require.cache`. + +`exported` can be anything that was previously `require()`d or `import`ed as a +module, submodule, or dependency - which means `exported` is identical to the +`module.exports` returned by this method. + +If `exported` did not come from the `exports` of a `module` in `require.cache`, +then this method returns `null`. + +## License + +ISC © Contributors + +[opensourceregistry_package_id]: # (458260416784685e5ef3091fee54001785dd4360406aa3000315ff256eef6878) diff --git a/node_modules/which-module/index.js b/node_modules/which-module/index.js new file mode 100644 index 0000000..45559b7 --- /dev/null +++ b/node_modules/which-module/index.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = function whichModule (exported) { + for (var i = 0, files = Object.keys(require.cache), mod; i < files.length; i++) { + mod = require.cache[files[i]] + if (mod.exports === exported) return mod + } + return null +} diff --git a/node_modules/which-module/package.json b/node_modules/which-module/package.json new file mode 100644 index 0000000..6553575 --- /dev/null +++ b/node_modules/which-module/package.json @@ -0,0 +1,41 @@ +{ + "name": "which-module", + "version": "2.0.1", + "description": "Find the module object for something that was require()d", + "main": "index.js", + "scripts": { + "pretest": "standard", + "test": "nyc ava", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "release": "standard-version" + }, + "files": [ + "index.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/nexdrew/which-module.git" + }, + "keywords": [ + "which", + "module", + "exports", + "filename", + "require", + "reverse", + "lookup" + ], + "author": "nexdrew", + "license": "ISC", + "bugs": { + "url": "https://github.com/nexdrew/which-module/issues" + }, + "homepage": "https://github.com/nexdrew/which-module#readme", + "devDependencies": { + "ava": "^2.0.0", + "coveralls": "^3.0.3", + "nyc": "^14.0.0", + "standard": "^14.0.0", + "standard-version": "^7.0.0" + } +} diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md new file mode 100644 index 0000000..7fb1f20 --- /dev/null +++ b/node_modules/which/CHANGELOG.md @@ -0,0 +1,166 @@ +# Changes + + +## 2.0.2 + +* Rename bin to `node-which` + +## 2.0.1 + +* generate changelog and publish on version bump +* enforce 100% test coverage +* Promise interface + +## 2.0.0 + +* Parallel tests, modern JavaScript, and drop support for node < 8 + +## 1.3.1 + +* update deps +* update travis + +## v1.3.0 + +* Add nothrow option to which.sync +* update tap + +## v1.2.14 + +* appveyor: drop node 5 and 0.x +* travis-ci: add node 6, drop 0.x + +## v1.2.13 + +* test: Pass missing option to pass on windows +* update tap +* update isexe to 2.0.0 +* neveragain.tech pledge request + +## v1.2.12 + +* Removed unused require + +## v1.2.11 + +* Prevent changelog script from being included in package + +## v1.2.10 + +* Use env.PATH only, not env.Path + +## v1.2.9 + +* fix for paths starting with ../ +* Remove unused `is-absolute` module + +## v1.2.8 + +* bullet items in changelog that contain (but don't start with) # + +## v1.2.7 + +* strip 'update changelog' changelog entries out of changelog + +## v1.2.6 + +* make the changelog bulleted + +## v1.2.5 + +* make a changelog, and keep it up to date +* don't include tests in package +* Properly handle relative-path executables +* appveyor +* Attach error code to Not Found error +* Make tests pass on Windows + +## v1.2.4 + +* Fix typo + +## v1.2.3 + +* update isexe, fix regression in pathExt handling + +## v1.2.2 + +* update deps, use isexe module, test windows + +## v1.2.1 + +* Sometimes windows PATH entries are quoted +* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. +* doc cli + +## v1.2.0 + +* Add support for opt.all and -as cli flags +* test the bin +* update travis +* Allow checking for multiple programs in bin/which +* tap 2 + +## v1.1.2 + +* travis +* Refactored and fixed undefined error on Windows +* Support strict mode + +## v1.1.1 + +* test +g exes against secondary groups, if available +* Use windows exe semantics on cygwin & msys +* cwd should be first in path on win32, not last +* Handle lower-case 'env.Path' on Windows +* Update docs +* use single-quotes + +## v1.1.0 + +* Add tests, depend on is-absolute + +## v1.0.9 + +* which.js: root is allowed to execute files owned by anyone + +## v1.0.8 + +* don't use graceful-fs + +## v1.0.7 + +* add license to package.json + +## v1.0.6 + +* isc license + +## 1.0.5 + +* Awful typo + +## 1.0.4 + +* Test for path absoluteness properly +* win: Allow '' as a pathext if cmd has a . in it + +## 1.0.3 + +* Remove references to execPath +* Make `which.sync()` work on Windows by honoring the PATHEXT variable. +* Make `isExe()` always return true on Windows. +* MIT + +## 1.0.2 + +* Only files can be exes + +## 1.0.1 + +* Respect the PATHEXT env for win32 support +* should 0755 the bin +* binary +* guts +* package +* 1st diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/which/README.md b/node_modules/which/README.md new file mode 100644 index 0000000..cd83350 --- /dev/null +++ b/node_modules/which/README.md @@ -0,0 +1,54 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +var which = require('which') + +// async usage +which('node', function (er, resolvedPath) { + // er is returned if no "node" is found on the PATH + // if it is found, then the absolute path to the exec is returned +}) + +// or promise +which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... }) + +// sync usage +// throws if not found +var resolved = which.sync('node') + +// if nothrow option is used, returns null if not found +resolved = which.sync('node', {nothrow: true}) + +// Pass options to override the PATH and PATHEXT environment vars. +which('node', { path: someOtherPath }, function (er, resolved) { + if (er) + throw er + console.log('found at %j', resolved) +}) +``` + +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/node_modules/which/bin/node-which b/node_modules/which/bin/node-which new file mode 100644 index 0000000..7cee372 --- /dev/null +++ b/node_modules/which/bin/node-which @@ -0,0 +1,52 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) + usage() + +function usage () { + console.error('usage: which [-as] program ...') + process.exit(1) +} + +var all = false +var silent = false +var dashdash = false +var args = process.argv.slice(2).filter(function (arg) { + if (dashdash || !/^-/.test(arg)) + return true + + if (arg === '--') { + dashdash = true + return false + } + + var flags = arg.substr(1).split('') + for (var f = 0; f < flags.length; f++) { + var flag = flags[f] + switch (flag) { + case 's': + silent = true + break + case 'a': + all = true + break + default: + console.error('which: illegal option -- ' + flag) + usage() + } + } + return false +}) + +process.exit(args.reduce(function (pv, current) { + try { + var f = which.sync(current, { all: all }) + if (all) + f = f.join('\n') + if (!silent) + console.log(f) + return pv; + } catch (e) { + return 1; + } +}, 0)) diff --git a/node_modules/which/package.json b/node_modules/which/package.json new file mode 100644 index 0000000..97ad7fb --- /dev/null +++ b/node_modules/which/package.json @@ -0,0 +1,43 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "2.0.2", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": { + "node-which": "./bin/node-which" + }, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.6.2", + "tap": "^14.6.9" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublish": "npm run changelog", + "prechangelog": "bash gen-changelog.sh", + "changelog": "git add CHANGELOG.md", + "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", + "postpublish": "git push origin --follow-tags" + }, + "files": [ + "which.js", + "bin/node-which" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">= 8" + } +} diff --git a/node_modules/which/which.js b/node_modules/which/which.js new file mode 100644 index 0000000..82afffd --- /dev/null +++ b/node_modules/which/which.js @@ -0,0 +1,125 @@ +const isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +const path = require('path') +const COLON = isWindows ? ';' : ':' +const isexe = require('isexe') + +const getNotFoundError = (cmd) => + Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) + +const getPathInfo = (cmd, opt) => { + const colon = opt.colon || COLON + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [''] + : ( + [ + // windows always checks the cwd first + ...(isWindows ? [process.cwd()] : []), + ...(opt.path || process.env.PATH || + /* istanbul ignore next: very unusual */ '').split(colon), + ] + ) + const pathExtExe = isWindows + ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' + : '' + const pathExt = isWindows ? pathExtExe.split(colon) : [''] + + if (isWindows) { + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + return { + pathEnv, + pathExt, + pathExtExe, + } +} + +const which = (cmd, opt, cb) => { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + if (!opt) + opt = {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + const step = i => new Promise((resolve, reject) => { + if (i === pathEnv.length) + return opt.all && found.length ? resolve(found) + : reject(getNotFoundError(cmd)) + + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + resolve(subStep(p, i, 0)) + }) + + const subStep = (p, i, ii) => new Promise((resolve, reject) => { + if (ii === pathExt.length) + return resolve(step(i + 1)) + const ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return resolve(p + ext) + } + return resolve(subStep(p, i, ii + 1)) + }) + }) + + return cb ? step(0).then(res => cb(null, res), cb) : step(0) +} + +const whichSync = (cmd, opt) => { + opt = opt || {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (let i = 0; i < pathEnv.length; i ++) { + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + for (let j = 0; j < pathExt.length; j ++) { + const cur = p + pathExt[j] + try { + const is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + if (opt.nothrow) + return null + + throw getNotFoundError(cmd) +} + +module.exports = which +which.sync = whichSync diff --git a/node_modules/win-release/index.js b/node_modules/win-release/index.js new file mode 100644 index 0000000..bb7d940 --- /dev/null +++ b/node_modules/win-release/index.js @@ -0,0 +1,35 @@ +'use strict'; +var os = require('os'); +var semver = require('semver'); + +var nameMap = { + '10.0': '10', + '6.3': '8.1', + '6.2': '8', + '6.1': '7', + '6.0': 'Vista', + '5.1': 'XP', + '5.0': '2000', + '4.9': 'ME', + '4.1': '98', + '4.0': '95' +}; + +module.exports = function (release) { + var verRe = /\d+\.\d+/; + var version = verRe.exec(release || os.release()); + + // workaround for Windows 10 on node < 3.1.0 + if (!release && process.platform === 'win32' && + semver.satisfies(process.version, '>=0.12.0 <3.1.0')) { + try { + version = verRe.exec(String(require('child_process').execSync('ver.exe', {timeout: 2000}))); + } catch (err) {} + } + + if (release && !version) { + throw new Error('`release` argument doesn\'t match `n.n`'); + } + + return nameMap[(version || [])[0]]; +}; diff --git a/node_modules/win-release/license b/node_modules/win-release/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/win-release/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/win-release/node_modules/.bin/semver b/node_modules/win-release/node_modules/.bin/semver new file mode 100644 index 0000000..384db49 --- /dev/null +++ b/node_modules/win-release/node_modules/.bin/semver @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver" "$@" +else + exec node "$basedir/../semver/bin/semver" "$@" +fi diff --git a/node_modules/win-release/node_modules/.bin/semver.cmd b/node_modules/win-release/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..22d9286 --- /dev/null +++ b/node_modules/win-release/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver" %* diff --git a/node_modules/win-release/node_modules/.bin/semver.ps1 b/node_modules/win-release/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..98c1b09 --- /dev/null +++ b/node_modules/win-release/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/win-release/node_modules/semver/LICENSE b/node_modules/win-release/node_modules/semver/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/win-release/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/win-release/node_modules/semver/README.md b/node_modules/win-release/node_modules/semver/README.md new file mode 100644 index 0000000..f8dfa5a --- /dev/null +++ b/node_modules/win-release/node_modules/semver/README.md @@ -0,0 +1,412 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install --save semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). diff --git a/node_modules/win-release/node_modules/semver/bin/semver b/node_modules/win-release/node_modules/semver/bin/semver new file mode 100644 index 0000000..801e77f --- /dev/null +++ b/node_modules/win-release/node_modules/semver/bin/semver @@ -0,0 +1,160 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-c': case '--coerce': + coerce = true + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v) || { version: v }).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } + + for (var i = 0, l = range.length; i < l; i++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error('--inc can only be used on a single version with no range') + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? 'rcompare' : 'compare' + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v, i, _) { console.log(v) }) +} + +function help () { + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) +} diff --git a/node_modules/win-release/node_modules/semver/package.json b/node_modules/win-release/node_modules/semver/package.json new file mode 100644 index 0000000..db035e9 --- /dev/null +++ b/node_modules/win-release/node_modules/semver/package.json @@ -0,0 +1,38 @@ +{ + "name": "semver", + "version": "5.7.2", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap test/ --100 --timeout=30", + "lint": "echo linting disabled", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap test/ --100 --timeout=30", + "posttest": "npm run lint" + }, + "devDependencies": { + "@npmcli/template-oss": "4.17.0", + "tap": "^12.7.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "./bin/semver" + }, + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "content": "./scripts/template-oss", + "version": "4.17.0" + } +} diff --git a/node_modules/win-release/node_modules/semver/range.bnf b/node_modules/win-release/node_modules/semver/range.bnf new file mode 100644 index 0000000..d4c6ae0 --- /dev/null +++ b/node_modules/win-release/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/win-release/node_modules/semver/semver.js b/node_modules/win-release/node_modules/semver/semver.js new file mode 100644 index 0000000..dcb6833 --- /dev/null +++ b/node_modules/win-release/node_modules/semver/semver.js @@ -0,0 +1,1525 @@ +exports = module.exports = SemVer + +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0' + +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +var MAX_SAFE_COMPONENT_LENGTH = 16 + +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +// The actual regexps go on exports.re +var re = exports.re = [] +var safeRe = exports.safeRe = [] +var src = exports.src = [] +var R = 0 + +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++ +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' +var NUMERICIDENTIFIERLOOSE = R++ +src[NUMERICIDENTIFIERLOOSE] = '\\d+' + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++ +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++ +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')' + +var MAINVERSIONLOOSE = R++ +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++ +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +var PRERELEASEIDENTIFIERLOOSE = R++ +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')' + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++ +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' + +var PRERELEASELOOSE = R++ +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++ +src[BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++ +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++ +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?' + +src[FULL] = '^' + FULLPLAIN + '$' + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?' + +var LOOSE = R++ +src[LOOSE] = '^' + LOOSEPLAIN + '$' + +var GTLT = R++ +src[GTLT] = '((?:<|>)?=?)' + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++ +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +var XRANGEIDENTIFIER = R++ +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' + +var XRANGEPLAIN = R++ +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGEPLAINLOOSE = R++ +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?' + +var XRANGE = R++ +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' +var XRANGELOOSE = R++ +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +var COERCE = R++ +src[COERCE] = '(?:^|[^\\d])' + + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + + '(?:$|[^\\d])' + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++ +src[LONETILDE] = '(?:~>?)' + +var TILDETRIM = R++ +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') +safeRe[TILDETRIM] = new RegExp(makeSafeRe(src[TILDETRIM]), 'g') +var tildeTrimReplace = '$1~' + +var TILDE = R++ +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' +var TILDELOOSE = R++ +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++ +src[LONECARET] = '(?:\\^)' + +var CARETTRIM = R++ +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') +safeRe[CARETTRIM] = new RegExp(makeSafeRe(src[CARETTRIM]), 'g') +var caretTrimReplace = '$1^' + +var CARET = R++ +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' +var CARETLOOSE = R++ +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++ +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' +var COMPARATOR = R++ +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++ +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') +safeRe[COMPARATORTRIM] = new RegExp(makeSafeRe(src[COMPARATORTRIM]), 'g') +var comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++ +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$' + +var HYPHENRANGELOOSE = R++ +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$' + +// Star ranges basically just allow anything at all. +var STAR = R++ +src[STAR] = '(<|>)?=?\\s*\\*' + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) + } +} + +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + if (version.length > MAX_LENGTH) { + return null + } + + var r = options.loose ? safeRe[LOOSE] : safeRe[FULL] + if (!r.test(version)) { + return null + } + + try { + return new SemVer(version, options) + } catch (er) { + return null + } +} + +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null +} + +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} + +exports.SemVer = SemVer + +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } + + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + + var m = version.trim().match(options.loose ? safeRe[LOOSE] : safeRe[FULL]) + + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() +} + +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} + +SemVer.prototype.toString = function () { + return this.version +} + +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return this.compareMain(other) || this.comparePre(other) +} + +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) +} + +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + var i = 0 + do { + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function (release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } + } + break + + default: + throw new Error('invalid increment argument: ' + release) + } + this.format() + this.raw = this.version + return this +} + +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined + } + + try { + return new SemVer(version, loose).inc(release, identifier).version + } catch (er) { + return null + } +} + +exports.diff = diff +function diff (version1, version2) { + if (eq(version1, version2)) { + return null + } else { + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' + if (v1.prerelease.length || v2.prerelease.length) { + prefix = 'pre' + var defaultResult = 'prerelease' + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return prefix + key + } + } + } + return defaultResult // may be undefined + } +} + +exports.compareIdentifiers = compareIdentifiers + +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) +} + +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major +} + +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor +} + +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch +} + +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) +} + +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) +} + +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) +} + +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compare(a, b, loose) + }) +} + +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.rcompare(a, b, loose) + }) +} + +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 +} + +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 +} + +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 +} + +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 +} + +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 +} + +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 +} + +exports.cmp = cmp +function cmp (a, op, b, loose) { + switch (op) { + case '===': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + + case '!==': + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) + } +} + +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) +} + +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR] + var m = comp.match(r) + + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) + } + + this.operator = m[1] + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY) { + return true + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp + + if (this.operator === '') { + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) + } else if (comp.operator === '') { + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) + } + + var sameDirectionIncreasing = + (this.operator === '>=' || this.operator === '>') && + (comp.operator === '>=' || comp.operator === '>') + var sameDirectionDecreasing = + (this.operator === '<=' || this.operator === '<') && + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version + var differentDirectionsInclusive = + (this.operator === '>=' || this.operator === '<=') && + (comp.operator === '>=' || comp.operator === '<=') + var oppositeDirectionsLessThan = + cmp(this.semver, '<', comp.semver, options) && + ((this.operator === '>=' || this.operator === '>') && + (comp.operator === '<=' || comp.operator === '<')) + var oppositeDirectionsGreaterThan = + cmp(this.semver, '>', comp.semver, options) && + ((this.operator === '<=' || this.operator === '<') && + (comp.operator === '>=' || comp.operator === '>')) + + return sameDirectionIncreasing || sameDirectionDecreasing || + (sameSemVer && differentDirectionsInclusive) || + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} + +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + if (range instanceof Range) { + if (range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + return new Range(range.value, options) + } + + if (!(this instanceof Range)) { + return new Range(range, options) + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { + // throw out any that are not relevant for whatever reason + return c.length + }) + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + this.raw) + } + + this.format() +} + +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} + +Range.prototype.toString = function () { + return this.range +} + +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[COMPARATORTRIM]) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(safeRe[TILDETRIM], tildeTrimReplace) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(safeRe[CARETTRIM], caretTrimReplace) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) + if (this.options.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) + } + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) + + return set +} + +Range.prototype.intersects = function (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some(function (thisComparators) { + return thisComparators.every(function (thisComparator) { + return range.set.some(function (rangeComparators) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + }) + }) +} + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') +} + +function replaceTilde (comp, options) { + var r = options.loose ? safeRe[TILDELOOSE] : safeRe[TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0 + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') +} + +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? safeRe[CARETLOOSE] : safeRe[CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0' + } + } + + debug('caret return', ret) + return ret + }) +} + +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') +} + +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? safeRe[XRANGELOOSE] : safeRe[XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + ret = gtlt + M + '.' + m + '.' + p + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars (comp, options) { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(safeRe[STAR], '') +} + +// This function is passed to string.replace(safeRe[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } + + return (from + ' ' + to).trim() +} + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false +} + +function testSet (set, version, options) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} + +exports.satisfies = satisfies +function satisfies (version, range, options) { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} + +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} + +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null + try { + var rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach(function (v) { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} + +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) +} + +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) + + var gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + var high = null + var low = null + + comparators.forEach(function (comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} + +exports.intersects = intersects +function intersects (r1, r2, options) { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2) +} + +exports.coerce = coerce +function coerce (version) { + if (version instanceof SemVer) { + return version + } + + if (typeof version !== 'string') { + return null + } + + var match = version.match(safeRe[COERCE]) + + if (match == null) { + return null + } + + return parse(match[1] + + '.' + (match[2] || '0') + + '.' + (match[3] || '0')) +} diff --git a/node_modules/win-release/package.json b/node_modules/win-release/package.json new file mode 100644 index 0000000..ec3b56c --- /dev/null +++ b/node_modules/win-release/package.json @@ -0,0 +1,41 @@ +{ + "name": "win-release", + "version": "1.1.1", + "description": "Get the name of a Windows version from the release number: 5.1.2600 → XP", + "license": "MIT", + "repository": "sindresorhus/win-release", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "os", + "win", + "win32", + "windows", + "operating", + "system", + "platform", + "name", + "title", + "release", + "version" + ], + "dependencies": { + "semver": "^5.0.1" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } +} diff --git a/node_modules/win-release/readme.md b/node_modules/win-release/readme.md new file mode 100644 index 0000000..9f44a0e --- /dev/null +++ b/node_modules/win-release/readme.md @@ -0,0 +1,54 @@ +# win-release [![Build Status](https://travis-ci.org/sindresorhus/win-release.svg?branch=master)](https://travis-ci.org/sindresorhus/win-release) + +> Get the name of a Windows version from the release number: `5.1.2600` → `XP` + + +## Install + +``` +$ npm install --save win-release +``` + + +## Usage + +```js +var os = require('os'); +var winRelease = require('win-release'); + +// on a Windows XP system + +winRelease(); +//=> 'XP' + +os.release(); +//=> '5.1.2600' + +winRelease(os.release()); +//=> 'XP' + +winRelease('4.9.3000'); +//=> 'ME' +``` + + +## API + +### winRelease([release]) + +#### release + +Type: `string` + +By default the current OS is used, but you can supply a custom release number, which is the output of [`os.release()`](http://nodejs.org/api/os.html#os_os_release). + + +## Related + +- [os-name](https://github.com/sindresorhus/os-name) - Get the name of the current operating system +- [osx-release](https://github.com/sindresorhus/osx-release) - Get the name and version of a OS X release from the Darwin version + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/workerpool/HISTORY.md b/node_modules/workerpool/HISTORY.md new file mode 100644 index 0000000..970aa5c --- /dev/null +++ b/node_modules/workerpool/HISTORY.md @@ -0,0 +1,444 @@ +# workerpool history +https://github.com/josdejong/workerpool + + +## 2025-09-10, version 9.3.4 + +- Fix: #516 improve error handling for errors containing nested classes by + using their `.toJSON` method when available. + + +## 2025-06-27, version 9.3.3 + +- Fix: #479 terminate worker even if abortListener resolved (#507). + Thanks @joshLong145. + + +## 2025-05-29, version 9.3.2 + +- Fix: #505 npm package missing `/src/generated/` files. + + +## 2025-05-29, version 9.3.1 + +- Fix: #505 npm package missing `/src/generated/` files. + + +## 2025-05-28, version 9.3.0 + +- Feat: support for events and std streams to parents from an + abort handler (#478). Thanks @joshLong145. +- feat: improve compatibility with standard Promise type (#504). + Thanks @joshkel. + + +## 2024-10-11, version 9.2.0 + +- Feat: implement support for abort handlers in the workers (#448). + Thanks @joshLong145. +- Feat: implement `Promise.finally()` on the custom promise class (#388). + Thanks @joshLong145 and @wmertens. +- Fix #460: `vite` example not working (#461). Thanks @datashaman. + + +## 2024-06-28, version 9.1.3 + +- Fix transferring from the worker (#455). Thanks @LeonidPolukhin. + + +## 2024-06-04, version 9.1.2 + +- Fix: #446 ensure the library can be used with older browsers. + + +## 2024-04-06, version 9.1.1 + +- Fix: events not emitted when using (#439). Thanks @t0oF-azpn. + + +## 2024-01-18, version 9.1.0 + +- Support capturing the stdout/stderr streams from the workers (#425, #423). + Thanks @cpendery. + + +## 2023-12-22, version 9.0.4 + +- Improve the logic to detect the Node.js platform (#421). Thanks @tamuratak. + + +## 2023-12-20, version 9.0.3 + +- Improve types: unwrap Promise types (#419). Thanks @joshkel. + + +## 2023-12-19, version 9.0.2 + +- Export the `Proxy` type (see #417). Thanks @tamuratak. +- Use workerpool's `Promise` type definition (see #417). Thanks @tamuratak. + + +## 2023-12-18, version 9.0.1 + +- Export the types `Pool`, `WorkerPoolOptions`, and `WorkerRegisterOptions`, + see #416. Thanks @joshkel. + + +## 2023-12-18, version 9.0.0 + +BREAKING CHANGE: the library now comes with TypeScript type definitions +included. There may be minor differences between the new, embedded type +definitions and the implementation from `@types/workerpool` that was needed +before. For example, `type WorkerPool` is called `type Pool` now. + +- Generate TypeScript types from JSDoc comments. Thanks @tamuratak. + + +## 2023-10-25, version 8.0.0 + +BREAKING CHANGE: the library now throws an Error when passing unknown or +inherited properties for `workerOpts`, `workerThreadOpts` and `forkOpts`. + +- Fix: throw an error in case of unknown properties or inherited properties + in `workerOpts`, `workerThreadOpts` and `forkOpts` to protect against + security issues related to prototype pollution + (see ea5368c5e53d97120b952ffad151a318c1ff073c). +- Fix: #56 document the return type of all functions. +- Docs: added a full usage example with Vite and Webpack5 (#408), + thanks @KonghaYao. + + +## 2023-10-25, version 7.0.0 + +BREAKING CHANGE: The setup to bundle `workerpool` has been replaced. This should +be a drop-in replacement, but it may have impact depending on your setup. + +- Switched build setup from Webpack to Rollup, see #403. Thanks @KonghaYao. + + +## 2023-10-11, version 6.5.1 + +- Fix: `workerThreadOpts` not working when `workerType: auto`, see #357. + + +## 2023-09-13, version 6.5.0 + +- Implement support for passing options to web workers constructors (#400, + #322). Thanks @DonatJR. + + +## 2023-08-21, version 6.4.2 + +- Fix: a bug in the timeout of termination (#395, #387). Thanks @Michsior14. + + +## 2023-08-17, version 6.4.1 + +- Fix: worker termination before it's ready (#394, #387). Thanks @Michsior14. + + +## 2023-02-24, version 6.4.0 + +- Support transferable objects (#3, #374). Thanks @Michsior14. +- Implement a new callback `onTerminate` at the worker side, which can be used + to clean up resources, and an option `workerTerminateTimeout` which forcefully + terminates a worker if it doesn't finish in time (#353, #377). + Thanks @Michsior14. +- Pass `workerThreadOpts` to the `onTerminateWorker` callback (#376). + Thanks @Michsior14. + + +## 2022-11-07, version 6.3.1 + +- Fix #318: debug ports not being released when terminating a pool. + + +## 2022-10-24, version 6.3.0 + +- Implement option `workerThreadOpts` to pass options to a worker of type + `thread`, a `worker_thread` (#357, fixes #356). Thanks @galElmalah. + +## 2022-04-11, version 6.2.1 + +- Fix #343: `.terminate()` sometimes throwing an exception. + + +## 2022-01-15, version 6.2.0 + +- Implement callbacks `onCreateWorker` and `onTerminateWorker`. Thanks @forty. +- Fix #326: robustness fix when terminating a workerpool. + + +## 2021-06-17, version 6.1.5 + +- Fix v6.1.4 not being marked as latest anymore on npm due to bug fix + release v2.3.4. + + +## 2021-04-05, version 6.1.4 + +- Fix terminating a pool throwing an error when used in the browser. + Regression introduced in `v6.1.3`. + + +## 2021-04-01, version 6.1.3 + +- Fix #147: disregard messages from terminated workers. + Thanks @hhprogram and @Madgvox. + + +## 2021-03-09, version 6.1.2 + +- Fix #253, add `./src` again in the published npm package, reverting the change + in `v6.1.1` (see also #243). + + +## 2021-03-08, version 6.1.1 + +- Remove redundant `./src` folder from the published npm package, see #243. + Thanks @Nytelife26. + + +## 2021-01-31, version 6.1.0 + +- Implemented support for sending events from the worker to the main thread, + see #51, #227. Thanks @Akryum. +- Fix an issue in Node.js nightly, see #230. Thanks @aduh95. +- Fix #232 `workerpool` not working on IE 10. + + +## 2021-01-16, version 6.0.4 + +- Make evaluation of offloaded functions a bit more secure by using + `new Function` instead of `eval`. Thanks @tjenkinson. + + +## 2020-10-28, version 6.0.3 + +- Fixes and more robustness in terminating workers. Thanks @boneskull. + + +## 2020-10-03, version 6.0.2 + +- Fix #32, #175: the promise returned by `Pool.terminate()` now waits until + subprocesses are dead before resolving. Thanks @boneskull. + + +## 2020-09-23, version 6.0.1 + +- Removed examples from the npm package. Thanks @madbence. + + +## 2020-05-13, version 6.0.0 + +BREAKING CHANGE: the library entry points are changed and new source maps are +added. This may have impact on your project depending on your setup. + +- Created separate library entry points in package.json for node.js and browser. + Thanks @boneskull. +- Generated source maps for both minified and non-minified bundles. +- Removed deprecation warnings for `options.nodeWorker` (renamed to + `options.workerType`) and `pool.clear()` (renamed to `pool.terminate()`). + + +## 2019-12-31, version 5.0.4 + +- Fixed #121: `isMainThread` not working when using `worker_threads`. +- Drop official support for node.js 8 (end of life). + + +## 2019-12-23, version 5.0.3 + +- Fixed library not working in the browser. See #106. + + +## 2019-11-06, version 5.0.2 + +- Fixed environment detection in browser. See #106. Thanks @acgrid. + + +## 2019-10-13, version 5.0.1 + +- Fixed #96: WorkerPool not cancelling any pending tasks on termination. + + +## 2019-08-25, version 5.0.0 + +- Deprecated option `nodeWorker` and created a new, more extensive option + `workerType` giving full control over the selected type of worker. + Added new option `'web'` to enforce use a Web Worker. See #85, #74. +- In a node.js environment, the default `workerType` is changed from + `'process'` to `'thread'`. See #85, #50. +- Improved detection of environment (`browser` or `node`), fixing wrong + detection in a Jest test environment. See #85. + + +## 2019-08-21, version 4.0.0 + +- Pass argument `--max-old-space-size` to child processes. Thanks @patte. +- Removed redundant dependencies, upgraded all devDependencies. +- Fixed Webpack issues of missing modules `child_process` and `worker_threads`. + See #43. +- Bundled library changed due to the upgrade to Webpack 4. This could possibly + lead to breaking changes. +- Implemented new option `maxQueueSize`. Thanks @colomboe. +- Fixed exiting workers when the parent process is killed. Thanks @RogerKang. +- Fixed #81: Option `minWorkers: 'max'` not using the configured `maxWorkers`. +- Fixed not passing `nodeWorker` to workers initialized when creating a pool. + Thanks @spacelan. +- Internal restructure of the code: moved from `lib` to `src`. + + +## 2019-03-12, version 3.1.2 + +- Improved error message when a node.js worker unexpectedly exits (see #58). + Thanks @stefanpenner. + +- Allocate debug ports safely, this fixes an issue cause workers to exit + unexpectedly if more then one worker pool is active, and the process is + started with a debugger (`node debug` or `node --inspect`). + Thanks @stefanpenner. + + +## 2019-02-25, version 3.1.1 + +- Fix option `nodeWorker: 'auto'` not using worker threads when available. + Thanks @stefanpenner. + + +## 2019-02-17, version 3.1.0 + +- Implemented support for using `worker_threads` in Node.js, via the new option + `nodeWorker: 'thread'`. Thanks @stefanpenner. + + +## 2018-12-11, version 3.0.0 + +- Enable usage in ES6 Webpack projects. +- Dropped support for AMD module system. + + +## 2021-06-17, version 2.3.4 + +- Backport fix for Node.js 16, see #309. Thanks @mansona. + + +## 2018-09-12, version 2.3.3 + +- Fixed space in license field in `package.json`. Thanks @sagotsky. + + +## 2018-09-08, version 2.3.2 + +- Add licence field to `package.json`. Thanks @greyd. + + +## 2018-07-24, version 2.3.1 + +- Fixed bug where tasks that are cancelled in a Pool's queue + causes following tasks to not run. Thanks @greemo. + + +## 2017-09-30, version 2.3.0 + +- New method `Pool.terminate(force, timeout)` which will replace + `Pool.clear(force)`. Thanks @jimsugg. +- Fixed issue with never terminating zombie child processes. + Thanks @jimsugg. + + +## 2017-08-20, version 2.2.4 + +- Fixed a debug issue: look for `--inspect` within argument strings, + instead of exact match. Thanks @jimsugg. + + +## 2017-08-19, version 2.2.3 + +- Updated all examples to neatly include `.catch(...)` callbacks. + + +## 2017-07-08, version 2.2.2 + +- Fixed #25: timer of a timeout starting when the task is created + instead of when the task is started. Thanks @eclipsesk for input. + + +## 2017-05-07, version 2.2.1 + +- Fixed #2 and #19: support for debugging child processes. Thanks @tptee. + + +## 2016-11-26, version 2.2.0 + +- Implemented #18: method `pool.stats()`. + + +## 2016-10-11, version 2.1.0 + +- Implemented support for registering the workers methods asynchronously. + This enables asynchronous initialization of workers, for example when + using AMD modules. Thanks @natlibfi-arlehiko. +- Implemented environment variables `platform`, `isMainThread`, and `cpus`. + Thanks @natlibfi-arlehiko. +- Implemented option `minWorkers`. Thanks @sergei202. + + +## 2016-09-18, version 2.0.0 + +- Replaced conversion of Error-objecting using serializerr to custom + implementation to prevent issues with serializing/deserializing functions. + This conversion implementation loses the prototype object which means that + e.g. 'TypeError' will become just 'Error' in the main code. See #8. + Thanks @natlibfi-arlehiko. + + +## 2016-09-12, version 1.3.1 + +- Fix for a bug in PhantomJS (see #7). Thanks @natlibfi-arlehiko. + + +## 2016-08-21, version 1.3.0 + +- Determine `maxWorkers` as the number of CPU's minus one in browsers too. See #6. + + +## 2016-06-25, version 1.2.1 + +- Fixed #5 error when loading via AMD or bundling using Webpack. + + +## 2016-05-22, version 1.2.0 + +- Implemented serializing errors with stacktrace. Thanks @mujx. + + +## 2016-01-25, version 1.1.0 + +- Added an error message when wrongly calling `pool.proxy`. +- Fixed function `worker.pool` not accepting both a script and options. See #1. + Thanks @freund17. + + +## 2014-05-29, version 1.0.0 + +- Merged function `Pool.run` into `Pool.exec`, simplifying the API. + + +## 2014-05-14, version 0.2.0 + +- Implemented support for cancelling running tasks. +- Implemented support for cancelling running tasks after a timeout. + + +## 2014-05-07, version 0.1.0 + +- Implemented support for both node.js and the browser. +- Implemented offloading functions. +- Implemented worker proxy. +- Added docs and examples. + + +## 2014-05-02, version 0.0.1 + +- Module name registered at npm. diff --git a/node_modules/workerpool/LICENSE b/node_modules/workerpool/LICENSE new file mode 100644 index 0000000..6e032fe --- /dev/null +++ b/node_modules/workerpool/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (C) 2014-2025 Jos de Jong wjosdejong@gmail.com + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/workerpool/README.md b/node_modules/workerpool/README.md new file mode 100644 index 0000000..a77d22b --- /dev/null +++ b/node_modules/workerpool/README.md @@ -0,0 +1,602 @@ +# workerpool + +[![NPM Version](https://img.shields.io/npm/v/workerpool)](https://www.npmjs.com/package/workerpool) +[![NPM Downloads](https://img.shields.io/npm/dm/workerpool)](https://npm-compare.com/workerpool/#timeRange=FIVE_YEARS) +[![NPM License](https://img.shields.io/npm/l/workerpool)](https://github.com/josdejong/workerpool/blob/master/LICENSE) + +**workerpool** offers an easy way to create a pool of workers for both dynamically offloading computations as well as managing a pool of dedicated workers. **workerpool** basically implements a [thread pool pattern](http://en.wikipedia.org/wiki/Thread_pool_pattern). There is a pool of workers to execute tasks. New tasks are put in a queue. A worker executes one task at a time, and once finished, picks a new task from the queue. Workers can be accessed via a natural, promise based proxy, as if they are available straight in the main application. + +**workerpool** runs on Node.js and in the browser. + +## Features + +- Easy to use +- Runs in the browser and on node.js +- Dynamically offload functions to a worker +- Access workers via a proxy +- Cancel running tasks +- Set a timeout on tasks +- Handles crashed workers +- Small: 9 kB minified and gzipped +- Supports transferable objects (only for web workers and worker_threads) + +## Why + +JavaScript is based upon a single event loop which handles one event at a time. Jeremy Epstein [explains this clearly](http://greenash.net.au/thoughts/2012/11/nodejs-itself-is-blocking-only-its-io-is-non-blocking/): + +> In Node.js everything runs in parallel, except your code. +> What this means is that all I/O code that you write in Node.js is non-blocking, +> while (conversely) all non-I/O code that you write in Node.js is blocking. + +This means that CPU heavy tasks will block other tasks from being executed. In case of a browser environment, the browser will not react to user events like a mouse click while executing a CPU intensive task (the browser "hangs"). In case of a node.js server, the server will not respond to any new request while executing a single, heavy request. + +For front-end processes, this is not a desired situation. +Therefore, CPU intensive tasks should be offloaded from the main event loop onto dedicated _workers_. In a browser environment, [Web Workers](http://www.html5rocks.com/en/tutorials/workers/basics/) can be used. In node.js, [child processes](https://nodejs.org/api/child_process.html) and [worker_threads](https://nodejs.org/api/worker_threads.html) are available. An application should be split in separate, decoupled parts, which can run independent of each other in a parallelized way. Effectively, this results in an architecture which achieves concurrency by means of isolated processes and message passing. + +## Install + +Install via npm: + + npm install workerpool + +## Load + +To load workerpool in a node.js application (both main application as well as workers): + +```js +const workerpool = require('workerpool'); +``` + +To load workerpool in the browser: + +```html + +``` + +To load workerpool in a web worker in the browser: + +```js +importScripts('workerpool.js'); +``` + +Setting up the workerpool with React or webpack5 requires additional configuration steps, as outlined in the [webpack5 section](examples%2Fwebpack5%2FREADME.md). + +## Use + +### Offload functions dynamically + +In the following example there is a function `add`, which is offloaded dynamically to a worker to be executed for a given set of arguments. + +**myApp.js** + +```js +const workerpool = require('workerpool'); +const pool = workerpool.pool(); + +function add(a, b) { + return a + b; +} + +pool + .exec(add, [3, 4]) + .then(function (result) { + console.log('result', result); // outputs 7 + }) + .catch(function (err) { + console.error(err); + }) + .then(function () { + pool.terminate(); // terminate all workers when done + }); +``` + +Note that both function and arguments must be static and stringifiable, as they need to be sent to the worker in a serialized form. In case of large functions or function arguments, the overhead of sending the data to the worker can be significant. + +### Dedicated workers + +A dedicated worker can be created in a separate script, and then used via a worker pool. + +**myWorker.js** + +```js +const workerpool = require('workerpool'); + +// a deliberately inefficient implementation of the fibonacci sequence +function fibonacci(n) { + if (n < 2) return n; + return fibonacci(n - 2) + fibonacci(n - 1); +} + +// create a worker and register public functions +workerpool.worker({ + fibonacci: fibonacci, +}); +``` + +This worker can be used by a worker pool: + +**myApp.js** + +```js +const workerpool = require('workerpool'); + +// create a worker pool using an external worker script +const pool = workerpool.pool(__dirname + '/myWorker.js'); + +// run registered functions on the worker via exec +pool + .exec('fibonacci', [10]) + .then(function (result) { + console.log('Result: ' + result); // outputs 55 + }) + .catch(function (err) { + console.error(err); + }) + .then(function () { + pool.terminate(); // terminate all workers when done + }); + +// or run registered functions on the worker via a proxy: +pool + .proxy() + .then(function (worker) { + return worker.fibonacci(10); + }) + .then(function (result) { + console.log('Result: ' + result); // outputs 55 + }) + .catch(function (err) { + console.error(err); + }) + .then(function () { + pool.terminate(); // terminate all workers when done + }); +``` + +Worker can also initialize asynchronously: + +**myAsyncWorker.js** + +```js +define(['workerpool/dist/workerpool'], function (workerpool) { + // a deliberately inefficient implementation of the fibonacci sequence + function fibonacci(n) { + if (n < 2) return n; + return fibonacci(n - 2) + fibonacci(n - 1); + } + + // create a worker and register public functions + workerpool.worker({ + fibonacci: fibonacci, + }); +}); +``` + +## Examples + +Examples are available in the examples directory: + +[https://github.com/josdejong/workerpool/tree/master/examples](https://github.com/josdejong/workerpool/tree/master/examples) + +## API + +The API of workerpool consists of two parts: a function `workerpool.pool` to create a worker pool, and a function `workerpool.worker` to create a worker. + +### pool + +A workerpool can be created using the function `workerpool.pool`: + +`workerpool.pool([script: string] [, options: Object]) : Pool` + +When a `script` argument is provided, the provided script will be started as a dedicated worker. When no `script` argument is provided, a default worker is started which can be used to offload functions dynamically via `Pool.exec`. Note that on node.js, `script` must be an absolute file path like `__dirname + '/myWorker.js'`. In a browser environment, `script` can also be a data URL like `'data:application/javascript;base64,...'`. This allows embedding the bundled code of a worker in your main application. See `examples/embeddedWorker` for a demo. + +The following options are available: + +- `minWorkers: number | 'max'`. The minimum number of workers that must be initialized and kept available. Setting this to `'max'` will create `maxWorkers` default workers (see below). +- `maxWorkers: number`. The default number of maxWorkers is the number of CPU's minus one. When the number of CPU's could not be determined (for example in older browsers), `maxWorkers` is set to 3. +- `maxQueueSize: number`. The maximum number of tasks allowed to be queued. Can be used to prevent running out of memory. If the maximum is exceeded, adding a new task will throw an error. The default value is `Infinity`. +- `workerType: 'auto' | 'web' | 'process' | 'thread'`. + - In case of `'auto'` (default), workerpool will automatically pick a suitable type of worker: when in a browser environment, `'web'` will be used. When in a node.js environment, `worker_threads` will be used if available (Node.js >= 11.7.0), else `child_process` will be used. + - In case of `'web'`, a Web Worker will be used. Only available in a browser environment. + - In case of `'process'`, `child_process` will be used. Only available in a node.js environment. + - In case of `'thread'`, `worker_threads` will be used. If `worker_threads` are not available, an error is thrown. Only available in a node.js environment. +- `workerTerminateTimeout: number`. The timeout in milliseconds to wait for a worker to cleanup it's resources on termination before stopping it forcefully. Default value is `1000`. +- `abortListenerTimeout: number`. The timeout in milliseconds to wait for abort listener's before stopping it forcefully, triggering cleanup. Default value is `1000`. +- `forkArgs: String[]`. For `process` worker type. An array passed as `args` to [child_process.fork](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options) +- `forkOpts: Object`. For `process` worker type. An object passed as `options` to [child_process.fork](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options). See nodejs documentation for available options. +- `workerOpts: Object`. For `web` worker type. An object passed to the [constructor of the web worker](https://html.spec.whatwg.org/multipage/workers.html#dom-worker). See [WorkerOptions specification](https://html.spec.whatwg.org/multipage/workers.html#workeroptions) for available options. +- `workerThreadOpts: Object`. For `worker` worker type. An object passed to [worker_threads.options](https://nodejs.org/api/worker_threads.html#new-workerfilename-options). See nodejs documentation for available options. +- `onCreateWorker: Function`. A callback that is called whenever a worker is being created. It can be used to allocate resources for each worker for example. The callback is passed as argument an object with the following properties: + - `forkArgs: String[]`: the `forkArgs` option of this pool + - `forkOpts: Object`: the `forkOpts` option of this pool + - `workerOpts: Object`: the `workerOpts` option of this pool + - `script: string`: the `script` option of this pool + Optionally, this callback can return an object containing one or more of the above properties. The provided properties will be used to override the Pool properties for the worker being created. +- `onTerminateWorker: Function`. A callback that is called whenever a worker is being terminated. It can be used to release resources that might have been allocated for this specific worker. The callback is passed as argument an object as described for `onCreateWorker`, with each property sets with the value for the worker being terminated. +- `emitStdStreams: boolean`. For `process` or `thread` worker type. If `true`, the worker will emit `stdout` and `stderr` events instead of passing it through to the parent streams. Default value is `false`. + +> Important note on `'workerType'`: when sending and receiving primitive data types (plain JSON) from and to a worker, the different worker types (`'web'`, `'process'`, `'thread'`) can be used interchangeably. However, when using more advanced data types like buffers, the API and returned results can vary. In these cases, it is best not to use the `'auto'` setting but have a fixed `'workerType'` and good unit testing in place. + +A worker pool contains the following functions: + +- `Pool.exec(method: Function | string, params: Array | null [, options: Object]) : Promise`
+ Execute a function on a worker with given arguments. + + - When `method` is a string, a method with this name must exist at the worker and must be registered to make it accessible via the pool. The function will be executed on the worker with given parameters. + - When `method` is a function, the provided function `fn` will be stringified, send to the worker, and executed there with the provided parameters. The provided function must be static, it must not depend on variables in a surrounding scope. + - The following options are available: + - `on: (payload: any) => void`. An event listener, to handle events sent by the worker for this execution. See [Events](#events) for more details. + - `transfer: Object[]`. A list of transferable objects to send to the worker. Not supported by `process` worker type. See [example](./examples/transferableObjects.js) for usage. + +- `Pool.proxy() : Promise`
+ Create a proxy for the worker pool. The proxy contains a proxy for all methods available on the worker. All methods return promises resolving the methods result. + +- `Pool.stats() : Object`
+ Retrieve statistics on workers, and active and pending tasks. + + Returns an object containing the following properties: + + ``` + { + totalWorkers: 0, + busyWorkers: 0, + idleWorkers: 0, + pendingTasks: 0, + activeTasks: 0 + } + ``` + +- `Pool.terminate([force: boolean [, timeout: number]]) : Promise` + + If parameter `force` is false (default), workers will finish the tasks they are working on before terminating themselves. Any pending tasks will be rejected with an error 'Pool terminated'. When `force` is true, all workers are terminated immediately without finishing running tasks. If `timeout` is provided, worker will be forced to terminate when the timeout expires and the worker has not finished. + +The function `Pool.exec` and the proxy functions all return a `Promise`. The promise has the following functions available: + +- `Promise.then(fn: Function) : Promise`
+ Get the result of the promise once resolve. +- `Promise.catch(fn: Function) : Promise`
+ Get the error of the promise when rejected. +- `Promise.finally(fn: Function)`
+ Logic to run when the Promise either `resolves` or `rejects` +- `Promise.cancel() : Promise`
+ A running task can be cancelled. The worker executing the task is enforced to terminate immediately. + The promise will be rejected with a `Promise.CancellationError`. +- `Promise.timeout(delay: number) : Promise`
+ Cancel a running task when it is not resolved or rejected within given delay in milliseconds. The timer will start when the task is actually started, not when the task is created and queued. + The worker executing the task is enforced to terminate immediately. + The promise will be rejected with a `Promise.TimeoutError`. + +Example usage: + +```js +const workerpool = require('workerpool'); + +function add(a, b) { + return a + b; +} + +const pool1 = workerpool.pool(); + +// offload a function to a worker +pool1 + .exec(add, [2, 4]) + .then(function (result) { + console.log(result); // will output 6 + }) + .catch(function (err) { + console.error(err); + }); + +// create a dedicated worker +const pool2 = workerpool.pool(__dirname + '/myWorker.js'); + +// supposed myWorker.js contains a function 'fibonacci' +pool2 + .exec('fibonacci', [10]) + .then(function (result) { + console.log(result); // will output 55 + }) + .catch(function (err) { + console.error(err); + }); + +// send a transferable object to the worker +// supposed myWorker.js contains a function 'sum' +const toTransfer = new Uint8Array(2).map((_v, i) => i) +pool2 + .exec('sum', [toTransfer], { transfer: [toTransfer.buffer] }) + .then(function (result) { + console.log(result); // will output 3 + }) + .catch(function (err) { + console.error(err); + }); + +// create a proxy to myWorker.js +pool2 + .proxy() + .then(function (myWorker) { + return myWorker.fibonacci(10); + }) + .then(function (result) { + console.log(result); // will output 55 + }) + .catch(function (err) { + console.error(err); + }); + +// create a pool with a specified maximum number of workers +const pool3 = workerpool.pool({ maxWorkers: 7 }); +``` + +### worker + +A worker is constructed as: + +`workerpool.worker([methods: Object] [, options: Object]) : void` + +Argument `methods` is optional and can be an object with functions available in the worker. Registered functions will be available via the worker pool. + +The following options are available: + +- `onTerminate: ([code: number]) => Promise | void`. A callback that is called whenever a worker is being terminated. It can be used to release resources that might have been allocated for this specific worker. The difference with pool's `onTerminateWorker` is that this callback runs in the worker context, while `onTerminateWorker` is executed on the main thread. + + +Example usage: + +```js +// file myWorker.js +const workerpool = require('workerpool'); + +function add(a, b) { + return a + b; +} + +function multiply(a, b) { + return a * b; +} + +// create a worker and register functions +workerpool.worker({ + add: add, + multiply: multiply, +}); +``` + +Asynchronous results can be handled by returning a Promise from a function in the worker: + +```js +// file myWorker.js +const workerpool = require('workerpool'); + +function timeout(delay) { + return new Promise(function (resolve, reject) { + setTimeout(resolve, delay); + }); +} + +// create a worker and register functions +workerpool.worker({ + timeout: timeout, +}); +``` + +Transferable objects can be sent back to the pool using `Transfer` helper class: + +```js +// file myWorker.js +const workerpool = require('workerpool'); + +function array(size) { + var array = new Uint8Array(size).map((_v, i) => i); + return new workerpool.Transfer(array, [array.buffer]); +} + +// create a worker and register functions +workerpool.worker({ + array: array, +}); +``` + +### Events + +You can send data back from workers to the pool while the task is being executed using the `workerEmit` function: + +`workerEmit(payload: any) : unknown` + +This function only works inside a worker **and** during a task. + +Example: + +```js +// file myWorker.js +const workerpool = require('workerpool'); + +function eventExample(delay) { + workerpool.workerEmit({ + status: 'in_progress', + }); + + workerpool.workerEmit({ + status: 'complete', + }); + + return true; +} + +// create a worker and register functions +workerpool.worker({ + eventExample: eventExample, +}); +``` + +To receive those events, you can use the `on` option of the pool `exec` method: + +```js +pool.exec('eventExample', [], { + on: function (payload) { + if (payload.status === 'in_progress') { + console.log('In progress...'); + } else if (payload.status === 'complete') { + console.log('Done!'); + } + }, +}); +``` + +### Worker API +Workers have access to a `worker` api which contains the following methods + +- `emit: (payload: unknown | Transfer): void` +- `addAbortListener: (listener: () => Promise): void` + +#### addAbortListener +Worker termination may be recoverable through `abort listeners` which are registered through `worker.addAbortListener`. If all registered listeners resolve then the worker will not be terminated, allowing for worker reuse in some cases. + +NOTE: For operations to successfully clean up, a worker implementation should be *async*. If the worker thread is blocked, then the worker will be killed. + +```js +function asyncTimeout() { + var me = this; + return new Promise(function (resolve) { + let timeout = setTimeout(() => { + resolve(); + }, 5000); + + // Register a listener which will resolve before the time out + // above triggers. + me.worker.addAbortListener(async function () { + clearTimeout(timeout); + resolve(); + }); + }); +} + +// create a worker and register public functions +workerpool.worker( + { + asyncTimeout: asyncTimeout, + }, + { + abortListenerTimeout: 1000 + } +); +``` + +#### emit +Events may also be emitted from the `worker` api through `worker.emit` + +```js +// file myWorker.js +const workerpool = require('workerpool'); + +function eventExample(delay) { + this.worker.emit({ + status: "in_progress", + }); + workerpool.workerEmit({ + status: 'complete', + }); + + return true; +} + +// create a worker and register functions +workerpool.worker({ + eventExample: eventExample, +}); +``` + +### Utilities + +Following properties are available for convenience: + +- **platform**: The Javascript platform. Either _node_ or _browser_ +- **isMainThread**: Whether the code is running in main thread or not (Workers) +- **cpus**: The number of CPUs/cores available + +## Roadmap + +- Implement functions for parallel processing: `map`, `reduce`, `forEach`, + `filter`, `some`, `every`, ... +- Implement graceful degradation on old browsers not supporting webworkers: + fallback to processing tasks in the main application. +- Implement session support: be able to handle a series of related tasks by a + single worker, which can keep a state for the session. + +## Related libraries + +- https://github.com/andywer/threads.js +- https://github.com/piscinajs/piscina +- https://github.com/learnboost/cluster +- https://github.com/adambom/parallel.js +- https://github.com/padolsey/operative +- https://github.com/calvinmetcalf/catiline +- https://github.com/Unitech/pm2 +- https://github.com/godaddy/node-cluster-service +- https://github.com/ramesaliyev/EasyWebWorker +- https://github.com/rvagg/node-worker-farm + +## Build + +First clone the project from github: + + git clone git://github.com/josdejong/workerpool.git + cd workerpool + +Install the project dependencies: + + npm install + +Then, the project can be build by executing the build script via npm: + + npm run build + +This will build the library workerpool.js and workerpool.min.js from the source +files and put them in the folder dist. + +## Test + +To execute tests for the library, install the project dependencies once: + + npm install + +Then, the tests can be executed: + + npm test + +To test code coverage of the tests: + + npm run coverage + +To see the coverage results, open the generated report in your browser: + + ./coverage/index.html + +## Publish + +- Describe changes in HISTORY.md. +- Update version in package.json, run `npm install` to update it in `package-lock.json` too. +- Push to GitHub. +- Deploy to npm via `npm publish`. +- Add a git tag with the version number like: + ``` + git tag v1.2.3 + git push --tags + ``` + +## License + +Copyright (C) 2014-2025 Jos de Jong + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/workerpool/dist/worker.js b/node_modules/workerpool/dist/worker.js new file mode 100644 index 0000000..254cd41 --- /dev/null +++ b/node_modules/workerpool/dist/worker.js @@ -0,0 +1,698 @@ +/** + * workerpool.js + * https://github.com/josdejong/workerpool + * + * Offload tasks to a pool of workers on node.js and in the browser. + * + * @version 9.3.4 + * @date 2025-09-10 + * + * @license + * Copyright (C) 2014-2022 Jos de Jong + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.worker = factory()); +})(this, (function () { 'use strict'; + + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + + function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + var worker$1 = {}; + + /** + * The helper class for transferring data from the worker to the main thread. + * + * @param {Object} message The object to deliver to the main thread. + * @param {Object[]} transfer An array of transferable Objects to transfer ownership of. + */ + function Transfer(message, transfer) { + this.message = message; + this.transfer = transfer; + } + var transfer = Transfer; + + var _Promise = {}; + + /** + * Promise + * + * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa + * @template T + * @template [E=Error] + * @param {Function} handler Called as handler(resolve: Function, reject: Function) + * @param {Promise} [parent] Parent promise for propagation of cancel and timeout + */ + function Promise$1(handler, parent) { + var me = this; + if (!(this instanceof Promise$1)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (typeof handler !== 'function') { + throw new SyntaxError('Function parameter handler(resolve, reject) missing'); + } + var _onSuccess = []; + var _onFail = []; + + // status + /** + * @readonly + */ + this.resolved = false; + /** + * @readonly + */ + this.rejected = false; + /** + * @readonly + */ + this.pending = true; + /** + * @readonly + */ + this[Symbol.toStringTag] = 'Promise'; + + /** + * Process onSuccess and onFail callbacks: add them to the queue. + * Once the promise is resolved, the function _promise is replace. + * @param {Function} onSuccess + * @param {Function} onFail + * @private + */ + var _process = function _process(onSuccess, onFail) { + _onSuccess.push(onSuccess); + _onFail.push(onFail); + }; + + /** + * Add an onSuccess callback and optionally an onFail callback to the Promise + * @template TT + * @template [TE=never] + * @param {(r: T) => TT | PromiseLike} onSuccess + * @param {(r: E) => TE | PromiseLike} [onFail] + * @returns {Promise} promise + */ + this.then = function (onSuccess, onFail) { + return new Promise$1(function (resolve, reject) { + var s = onSuccess ? _then(onSuccess, resolve, reject) : resolve; + var f = onFail ? _then(onFail, resolve, reject) : reject; + _process(s, f); + }, me); + }; + + /** + * Resolve the promise + * @param {*} result + * @type {Function} + */ + var _resolve2 = function _resolve(result) { + // update status + me.resolved = true; + me.rejected = false; + me.pending = false; + _onSuccess.forEach(function (fn) { + fn(result); + }); + _process = function _process(onSuccess, onFail) { + onSuccess(result); + }; + _resolve2 = _reject2 = function _reject() {}; + return me; + }; + + /** + * Reject the promise + * @param {Error} error + * @type {Function} + */ + var _reject2 = function _reject(error) { + // update status + me.resolved = false; + me.rejected = true; + me.pending = false; + _onFail.forEach(function (fn) { + fn(error); + }); + _process = function _process(onSuccess, onFail) { + onFail(error); + }; + _resolve2 = _reject2 = function _reject() {}; + return me; + }; + + /** + * Cancel the promise. This will reject the promise with a CancellationError + * @returns {this} self + */ + this.cancel = function () { + if (parent) { + parent.cancel(); + } else { + _reject2(new CancellationError()); + } + return me; + }; + + /** + * Set a timeout for the promise. If the promise is not resolved within + * the time, the promise will be cancelled and a TimeoutError is thrown. + * If the promise is resolved in time, the timeout is removed. + * @param {number} delay Delay in milliseconds + * @returns {this} self + */ + this.timeout = function (delay) { + if (parent) { + parent.timeout(delay); + } else { + var timer = setTimeout(function () { + _reject2(new TimeoutError('Promise timed out after ' + delay + ' ms')); + }, delay); + me.always(function () { + clearTimeout(timer); + }); + } + return me; + }; + + // attach handler passing the resolve and reject functions + handler(function (result) { + _resolve2(result); + }, function (error) { + _reject2(error); + }); + } + + /** + * Execute given callback, then call resolve/reject based on the returned result + * @param {Function} callback + * @param {Function} resolve + * @param {Function} reject + * @returns {Function} + * @private + */ + function _then(callback, resolve, reject) { + return function (result) { + try { + var res = callback(result); + if (res && typeof res.then === 'function' && typeof res['catch'] === 'function') { + // method returned a promise + res.then(resolve, reject); + } else { + resolve(res); + } + } catch (error) { + reject(error); + } + }; + } + + /** + * Add an onFail callback to the Promise + * @template TT + * @param {(error: E) => TT | PromiseLike} onFail + * @returns {Promise} promise + */ + Promise$1.prototype['catch'] = function (onFail) { + return this.then(null, onFail); + }; + + // TODO: add support for Promise.catch(Error, callback) + // TODO: add support for Promise.catch(Error, Error, callback) + + /** + * Execute given callback when the promise either resolves or rejects. + * @template TT + * @param {() => Promise} fn + * @returns {Promise} promise + */ + Promise$1.prototype.always = function (fn) { + return this.then(fn, fn); + }; + + /** + * Execute given callback when the promise either resolves or rejects. + * Same semantics as Node's Promise.finally() + * @param {Function | null | undefined} [fn] + * @returns {Promise} promise + */ + Promise$1.prototype.finally = function (fn) { + var me = this; + var final = function final() { + return new Promise$1(function (resolve) { + return resolve(); + }).then(fn).then(function () { + return me; + }); + }; + return this.then(final, final); + }; + + /** + * Create a promise which resolves when all provided promises are resolved, + * and fails when any of the promises resolves. + * @param {Promise[]} promises + * @returns {Promise} promise + */ + Promise$1.all = function (promises) { + return new Promise$1(function (resolve, reject) { + var remaining = promises.length, + results = []; + if (remaining) { + promises.forEach(function (p, i) { + p.then(function (result) { + results[i] = result; + remaining--; + if (remaining == 0) { + resolve(results); + } + }, function (error) { + remaining = 0; + reject(error); + }); + }); + } else { + resolve(results); + } + }); + }; + + /** + * Create a promise resolver + * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver + */ + Promise$1.defer = function () { + var resolver = {}; + resolver.promise = new Promise$1(function (resolve, reject) { + resolver.resolve = resolve; + resolver.reject = reject; + }); + return resolver; + }; + + /** + * Create a cancellation error + * @param {String} [message] + * @extends Error + */ + function CancellationError(message) { + this.message = message || 'promise cancelled'; + this.stack = new Error().stack; + } + CancellationError.prototype = new Error(); + CancellationError.prototype.constructor = Error; + CancellationError.prototype.name = 'CancellationError'; + Promise$1.CancellationError = CancellationError; + + /** + * Create a timeout error + * @param {String} [message] + * @extends Error + */ + function TimeoutError(message) { + this.message = message || 'timeout exceeded'; + this.stack = new Error().stack; + } + TimeoutError.prototype = new Error(); + TimeoutError.prototype.constructor = Error; + TimeoutError.prototype.name = 'TimeoutError'; + Promise$1.TimeoutError = TimeoutError; + _Promise.Promise = Promise$1; + + (function (exports) { + var Transfer = transfer; + + /** + * worker must handle async cleanup handlers. Use custom Promise implementation. + */ + var Promise = _Promise.Promise; + /** + * Special message sent by parent which causes the worker to terminate itself. + * Not a "message object"; this string is the entire message. + */ + var TERMINATE_METHOD_ID = '__workerpool-terminate__'; + + /** + * Special message by parent which causes a child process worker to perform cleaup + * steps before determining if the child process worker should be terminated. + */ + var CLEANUP_METHOD_ID = '__workerpool-cleanup__'; + // var nodeOSPlatform = require('./environment').nodeOSPlatform; + + var TIMEOUT_DEFAULT = 1000; + + // create a worker API for sending and receiving messages which works both on + // node.js and in the browser + var worker = { + exit: function exit() {} + }; + + // api for in worker communication with parent process + // works in both node.js and the browser + var publicWorker = { + /** + * Registers listeners which will trigger when a task is timed out or cancled. If all listeners resolve, the worker executing the given task will not be terminated. + * *Note*: If there is a blocking operation within a listener, the worker will be terminated. + * @param {() => Promise} listener + */ + addAbortListener: function addAbortListener(listener) { + worker.abortListeners.push(listener); + }, + /** + * Emit an event from the worker thread to the main thread. + * @param {any} payload + */ + emit: worker.emit + }; + if (typeof self !== 'undefined' && typeof postMessage === 'function' && typeof addEventListener === 'function') { + // worker in the browser + worker.on = function (event, callback) { + addEventListener(event, function (message) { + callback(message.data); + }); + }; + worker.send = function (message, transfer) { + transfer ? postMessage(message, transfer) : postMessage(message); + }; + } else if (typeof process !== 'undefined') { + // node.js + + var WorkerThreads; + try { + WorkerThreads = require('worker_threads'); + } catch (error) { + if (_typeof(error) === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') ; else { + throw error; + } + } + if (WorkerThreads && /* if there is a parentPort, we are in a WorkerThread */ + WorkerThreads.parentPort !== null) { + var parentPort = WorkerThreads.parentPort; + worker.send = parentPort.postMessage.bind(parentPort); + worker.on = parentPort.on.bind(parentPort); + worker.exit = process.exit.bind(process); + } else { + worker.on = process.on.bind(process); + // ignore transfer argument since it is not supported by process + worker.send = function (message) { + process.send(message); + }; + // register disconnect handler only for subprocess worker to exit when parent is killed unexpectedly + worker.on('disconnect', function () { + process.exit(1); + }); + worker.exit = process.exit.bind(process); + } + } else { + throw new Error('Script must be executed as a worker'); + } + function convertError(error) { + if (error && error.toJSON) { + return JSON.parse(JSON.stringify(error)); + } + + // turn a class like Error (having non-enumerable properties) into a plain object + return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error))); + } + + /** + * Test whether a value is a Promise via duck typing. + * @param {*} value + * @returns {boolean} Returns true when given value is an object + * having functions `then` and `catch`. + */ + function isPromise(value) { + return value && typeof value.then === 'function' && typeof value.catch === 'function'; + } + + // functions available externally + worker.methods = {}; + + /** + * Execute a function with provided arguments + * @param {String} fn Stringified function + * @param {Array} [args] Function arguments + * @returns {*} + */ + worker.methods.run = function run(fn, args) { + var f = new Function('return (' + fn + ').apply(this, arguments);'); + f.worker = publicWorker; + return f.apply(f, args); + }; + + /** + * Get a list with methods available on this worker + * @return {String[]} methods + */ + worker.methods.methods = function methods() { + return Object.keys(worker.methods); + }; + + /** + * Custom handler for when the worker is terminated. + */ + worker.terminationHandler = undefined; + worker.abortListenerTimeout = TIMEOUT_DEFAULT; + + /** + * Abort handlers for resolving errors which may cause a timeout or cancellation + * to occur from a worker context + */ + worker.abortListeners = []; + + /** + * Cleanup and exit the worker. + * @param {Number} code + * @returns {Promise} + */ + worker.terminateAndExit = function (code) { + var _exit = function _exit() { + worker.exit(code); + }; + if (!worker.terminationHandler) { + return _exit(); + } + var result = worker.terminationHandler(code); + if (isPromise(result)) { + result.then(_exit, _exit); + return result; + } else { + _exit(); + return new Promise(function (_resolve, reject) { + reject(new Error("Worker terminating")); + }); + } + }; + + /** + * Called within the worker message handler to run abort handlers if registered to perform cleanup operations. + * @param {Integer} [requestId] id of task which is currently executing in the worker + * @return {Promise} + */ + worker.cleanup = function (requestId) { + if (!worker.abortListeners.length) { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: convertError(new Error('Worker terminating')) + }); + + // If there are no handlers registered, reject the promise with an error as we want the handler to be notified + // that cleanup should begin and the handler should be GCed. + return new Promise(function (resolve) { + resolve(); + }); + } + var _exit = function _exit() { + worker.exit(); + }; + var _abort = function _abort() { + if (!worker.abortListeners.length) { + worker.abortListeners = []; + } + }; + var promises = worker.abortListeners.map(function (listener) { + return listener(); + }); + var timerId; + var timeoutPromise = new Promise(function (_resolve, reject) { + timerId = setTimeout(function () { + reject(new Error('Timeout occured waiting for abort handler, killing worker')); + }, worker.abortListenerTimeout); + }); + + // Once a promise settles we need to clear the timeout to prevet fulfulling the promise twice + var settlePromise = Promise.all(promises).then(function () { + clearTimeout(timerId); + _abort(); + }, function () { + clearTimeout(timerId); + _exit(); + }); + + // Returns a promise which will result in one of the following cases + // - Resolve once all handlers resolve + // - Reject if one or more handlers exceed the 'abortListenerTimeout' interval + // - Reject if one or more handlers reject + // Upon one of the above cases a message will be sent to the handler with the result of the handler execution + // which will either kill the worker if the result contains an error, or keep it in the pool if the result + // does not contain an error. + return new Promise(function (resolve, reject) { + settlePromise.then(resolve, reject); + timeoutPromise.then(resolve, reject); + }).then(function () { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: null + }); + }, function (err) { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: err ? convertError(err) : null + }); + }); + }; + var currentRequestId = null; + worker.on('message', function (request) { + if (request === TERMINATE_METHOD_ID) { + return worker.terminateAndExit(0); + } + if (request.method === CLEANUP_METHOD_ID) { + return worker.cleanup(request.id); + } + try { + var method = worker.methods[request.method]; + if (method) { + currentRequestId = request.id; + + // execute the function + var result = method.apply(method, request.params); + if (isPromise(result)) { + // promise returned, resolve this and then return + result.then(function (result) { + if (result instanceof Transfer) { + worker.send({ + id: request.id, + result: result.message, + error: null + }, result.transfer); + } else { + worker.send({ + id: request.id, + result: result, + error: null + }); + } + currentRequestId = null; + }).catch(function (err) { + worker.send({ + id: request.id, + result: null, + error: convertError(err) + }); + currentRequestId = null; + }); + } else { + // immediate result + if (result instanceof Transfer) { + worker.send({ + id: request.id, + result: result.message, + error: null + }, result.transfer); + } else { + worker.send({ + id: request.id, + result: result, + error: null + }); + } + currentRequestId = null; + } + } else { + throw new Error('Unknown method "' + request.method + '"'); + } + } catch (err) { + worker.send({ + id: request.id, + result: null, + error: convertError(err) + }); + } + }); + + /** + * Register methods to the worker + * @param {Object} [methods] + * @param {import('./types.js').WorkerRegisterOptions} [options] + */ + worker.register = function (methods, options) { + if (methods) { + for (var name in methods) { + if (methods.hasOwnProperty(name)) { + worker.methods[name] = methods[name]; + worker.methods[name].worker = publicWorker; + } + } + } + if (options) { + worker.terminationHandler = options.onTerminate; + // register listener timeout or default to 1 second + worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT; + } + worker.send('ready'); + }; + worker.emit = function (payload) { + if (currentRequestId) { + if (payload instanceof Transfer) { + worker.send({ + id: currentRequestId, + isEvent: true, + payload: payload.message + }, payload.transfer); + return; + } + worker.send({ + id: currentRequestId, + isEvent: true, + payload: payload + }); + } + }; + { + exports.add = worker.register; + exports.emit = worker.emit; + } + })(worker$1); + var worker = /*@__PURE__*/getDefaultExportFromCjs(worker$1); + + return worker; + +})); +//# sourceMappingURL=worker.js.map diff --git a/node_modules/workerpool/dist/worker.js.map b/node_modules/workerpool/dist/worker.js.map new file mode 100644 index 0000000..81a6cfe --- /dev/null +++ b/node_modules/workerpool/dist/worker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"worker.js","sources":["../src/transfer.js","../src/Promise.js","../src/worker.js"],"sourcesContent":["/**\n * The helper class for transferring data from the worker to the main thread.\n *\n * @param {Object} message The object to deliver to the main thread.\n * @param {Object[]} transfer An array of transferable Objects to transfer ownership of.\n */\nfunction Transfer(message, transfer) {\n this.message = message;\n this.transfer = transfer;\n}\n\nmodule.exports = Transfer;\n","'use strict';\n\n/**\n * Promise\n *\n * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa \n * @template T\n * @template [E=Error]\n * @param {Function} handler Called as handler(resolve: Function, reject: Function)\n * @param {Promise} [parent] Parent promise for propagation of cancel and timeout\n */\nfunction Promise(handler, parent) {\n var me = this;\n\n if (!(this instanceof Promise)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n if (typeof handler !== 'function') {\n throw new SyntaxError('Function parameter handler(resolve, reject) missing');\n }\n\n var _onSuccess = [];\n var _onFail = [];\n\n // status\n /**\n * @readonly\n */\n this.resolved = false;\n /**\n * @readonly\n */\n this.rejected = false;\n /**\n * @readonly\n */\n this.pending = true;\n /**\n * @readonly\n */\n this[Symbol.toStringTag] = 'Promise';\n\n /**\n * Process onSuccess and onFail callbacks: add them to the queue.\n * Once the promise is resolved, the function _promise is replace.\n * @param {Function} onSuccess\n * @param {Function} onFail\n * @private\n */\n var _process = function (onSuccess, onFail) {\n _onSuccess.push(onSuccess);\n _onFail.push(onFail);\n };\n\n /**\n * Add an onSuccess callback and optionally an onFail callback to the Promise\n * @template TT\n * @template [TE=never]\n * @param {(r: T) => TT | PromiseLike} onSuccess\n * @param {(r: E) => TE | PromiseLike} [onFail]\n * @returns {Promise} promise\n */\n this.then = function (onSuccess, onFail) {\n return new Promise(function (resolve, reject) {\n var s = onSuccess ? _then(onSuccess, resolve, reject) : resolve;\n var f = onFail ? _then(onFail, resolve, reject) : reject;\n\n _process(s, f);\n }, me);\n };\n\n /**\n * Resolve the promise\n * @param {*} result\n * @type {Function}\n */\n var _resolve = function (result) {\n // update status\n me.resolved = true;\n me.rejected = false;\n me.pending = false;\n\n _onSuccess.forEach(function (fn) {\n fn(result);\n });\n\n _process = function (onSuccess, onFail) {\n onSuccess(result);\n };\n\n _resolve = _reject = function () { };\n\n return me;\n };\n\n /**\n * Reject the promise\n * @param {Error} error\n * @type {Function}\n */\n var _reject = function (error) {\n // update status\n me.resolved = false;\n me.rejected = true;\n me.pending = false;\n\n _onFail.forEach(function (fn) {\n fn(error);\n });\n\n _process = function (onSuccess, onFail) {\n onFail(error);\n };\n\n _resolve = _reject = function () { }\n\n return me;\n };\n\n /**\n * Cancel the promise. This will reject the promise with a CancellationError\n * @returns {this} self\n */\n this.cancel = function () {\n if (parent) {\n parent.cancel();\n }\n else {\n _reject(new CancellationError());\n }\n\n return me;\n };\n\n /**\n * Set a timeout for the promise. If the promise is not resolved within\n * the time, the promise will be cancelled and a TimeoutError is thrown.\n * If the promise is resolved in time, the timeout is removed.\n * @param {number} delay Delay in milliseconds\n * @returns {this} self\n */\n this.timeout = function (delay) {\n if (parent) {\n parent.timeout(delay);\n }\n else {\n var timer = setTimeout(function () {\n _reject(new TimeoutError('Promise timed out after ' + delay + ' ms'));\n }, delay);\n\n me.always(function () {\n clearTimeout(timer);\n });\n }\n\n return me;\n };\n\n // attach handler passing the resolve and reject functions\n handler(function (result) {\n _resolve(result);\n }, function (error) {\n _reject(error);\n });\n}\n\n/**\n * Execute given callback, then call resolve/reject based on the returned result\n * @param {Function} callback\n * @param {Function} resolve\n * @param {Function} reject\n * @returns {Function}\n * @private\n */\nfunction _then(callback, resolve, reject) {\n return function (result) {\n try {\n var res = callback(result);\n if (res && typeof res.then === 'function' && typeof res['catch'] === 'function') {\n // method returned a promise\n res.then(resolve, reject);\n }\n else {\n resolve(res);\n }\n }\n catch (error) {\n reject(error);\n }\n }\n}\n\n/**\n * Add an onFail callback to the Promise\n * @template TT\n * @param {(error: E) => TT | PromiseLike} onFail\n * @returns {Promise} promise\n */\nPromise.prototype['catch'] = function (onFail) {\n return this.then(null, onFail);\n};\n\n// TODO: add support for Promise.catch(Error, callback)\n// TODO: add support for Promise.catch(Error, Error, callback)\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * @template TT\n * @param {() => Promise} fn\n * @returns {Promise} promise\n */\nPromise.prototype.always = function (fn) {\n return this.then(fn, fn);\n};\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * Same semantics as Node's Promise.finally()\n * @param {Function | null | undefined} [fn]\n * @returns {Promise} promise\n */\nPromise.prototype.finally = function (fn) {\n const me = this;\n\n const final = function() {\n return new Promise((resolve) => resolve())\n .then(fn)\n .then(() => me);\n };\n\n return this.then(final, final);\n}\n\n/**\n * Create a promise which resolves when all provided promises are resolved,\n * and fails when any of the promises resolves.\n * @param {Promise[]} promises\n * @returns {Promise} promise\n */\nPromise.all = function (promises){\n return new Promise(function (resolve, reject) {\n var remaining = promises.length,\n results = [];\n\n if (remaining) {\n promises.forEach(function (p, i) {\n p.then(function (result) {\n results[i] = result;\n remaining--;\n if (remaining == 0) {\n resolve(results);\n }\n }, function (error) {\n remaining = 0;\n reject(error);\n });\n });\n }\n else {\n resolve(results);\n }\n });\n};\n\n/**\n * Create a promise resolver\n * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver\n */\nPromise.defer = function () {\n var resolver = {};\n\n resolver.promise = new Promise(function (resolve, reject) {\n resolver.resolve = resolve;\n resolver.reject = reject;\n });\n\n return resolver;\n};\n\n/**\n * Create a cancellation error\n * @param {String} [message]\n * @extends Error\n */\nfunction CancellationError(message) {\n this.message = message || 'promise cancelled';\n this.stack = (new Error()).stack;\n}\n\nCancellationError.prototype = new Error();\nCancellationError.prototype.constructor = Error;\nCancellationError.prototype.name = 'CancellationError';\n\nPromise.CancellationError = CancellationError;\n\n\n/**\n * Create a timeout error\n * @param {String} [message]\n * @extends Error\n */\nfunction TimeoutError(message) {\n this.message = message || 'timeout exceeded';\n this.stack = (new Error()).stack;\n}\n\nTimeoutError.prototype = new Error();\nTimeoutError.prototype.constructor = Error;\nTimeoutError.prototype.name = 'TimeoutError';\n\nPromise.TimeoutError = TimeoutError;\n\n\nexports.Promise = Promise;\n","/**\n * worker must be started as a child process or a web worker.\n * It listens for RPC messages from the parent process.\n */\n\nvar Transfer = require('./transfer');\n\n/**\n * worker must handle async cleanup handlers. Use custom Promise implementation. \n*/\nvar Promise = require('./Promise').Promise;\n/**\n * Special message sent by parent which causes the worker to terminate itself.\n * Not a \"message object\"; this string is the entire message.\n */\nvar TERMINATE_METHOD_ID = '__workerpool-terminate__';\n\n/**\n * Special message by parent which causes a child process worker to perform cleaup\n * steps before determining if the child process worker should be terminated.\n*/\nvar CLEANUP_METHOD_ID = '__workerpool-cleanup__';\n// var nodeOSPlatform = require('./environment').nodeOSPlatform;\n\n\nvar TIMEOUT_DEFAULT = 1_000;\n\n// create a worker API for sending and receiving messages which works both on\n// node.js and in the browser\nvar worker = {\n exit: function() {}\n};\n\n// api for in worker communication with parent process\n// works in both node.js and the browser\nvar publicWorker = {\n /**\n * Registers listeners which will trigger when a task is timed out or cancled. If all listeners resolve, the worker executing the given task will not be terminated.\n * *Note*: If there is a blocking operation within a listener, the worker will be terminated.\n * @param {() => Promise} listener\n */\n addAbortListener: function(listener) {\n worker.abortListeners.push(listener);\n },\n\n /**\n * Emit an event from the worker thread to the main thread.\n * @param {any} payload\n */\n emit: worker.emit\n};\n\nif (typeof self !== 'undefined' && typeof postMessage === 'function' && typeof addEventListener === 'function') {\n // worker in the browser\n worker.on = function (event, callback) {\n addEventListener(event, function (message) {\n callback(message.data);\n })\n };\n worker.send = function (message, transfer) {\n transfer ? postMessage(message, transfer) : postMessage (message);\n };\n}\nelse if (typeof process !== 'undefined') {\n // node.js\n\n var WorkerThreads;\n try {\n WorkerThreads = require('worker_threads');\n } catch(error) {\n if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') {\n // no worker_threads, fallback to sub-process based workers\n } else {\n throw error;\n }\n }\n\n if (WorkerThreads &&\n /* if there is a parentPort, we are in a WorkerThread */\n WorkerThreads.parentPort !== null) {\n var parentPort = WorkerThreads.parentPort;\n worker.send = parentPort.postMessage.bind(parentPort);\n worker.on = parentPort.on.bind(parentPort);\n worker.exit = process.exit.bind(process);\n } else {\n worker.on = process.on.bind(process);\n // ignore transfer argument since it is not supported by process\n worker.send = function (message) {\n process.send(message);\n };\n // register disconnect handler only for subprocess worker to exit when parent is killed unexpectedly\n worker.on('disconnect', function () {\n process.exit(1);\n });\n worker.exit = process.exit.bind(process);\n }\n}\nelse {\n throw new Error('Script must be executed as a worker');\n}\n\nfunction convertError(error) {\n if (error && error.toJSON) {\n return JSON.parse(JSON.stringify(error));\n }\n\n // turn a class like Error (having non-enumerable properties) into a plain object\n return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error)));\n}\n\n/**\n * Test whether a value is a Promise via duck typing.\n * @param {*} value\n * @returns {boolean} Returns true when given value is an object\n * having functions `then` and `catch`.\n */\nfunction isPromise(value) {\n return value && (typeof value.then === 'function') && (typeof value.catch === 'function');\n}\n\n// functions available externally\nworker.methods = {};\n\n/**\n * Execute a function with provided arguments\n * @param {String} fn Stringified function\n * @param {Array} [args] Function arguments\n * @returns {*}\n */\nworker.methods.run = function run(fn, args) {\n var f = new Function('return (' + fn + ').apply(this, arguments);');\n f.worker = publicWorker;\n return f.apply(f, args);\n};\n\n/**\n * Get a list with methods available on this worker\n * @return {String[]} methods\n */\nworker.methods.methods = function methods() {\n return Object.keys(worker.methods);\n};\n\n/**\n * Custom handler for when the worker is terminated.\n */\nworker.terminationHandler = undefined;\n\nworker.abortListenerTimeout = TIMEOUT_DEFAULT;\n\n/**\n * Abort handlers for resolving errors which may cause a timeout or cancellation\n * to occur from a worker context\n */\nworker.abortListeners = [];\n\n/**\n * Cleanup and exit the worker.\n * @param {Number} code \n * @returns {Promise}\n */\nworker.terminateAndExit = function(code) {\n var _exit = function() {\n worker.exit(code);\n }\n\n if(!worker.terminationHandler) {\n return _exit();\n }\n \n var result = worker.terminationHandler(code);\n if (isPromise(result)) {\n result.then(_exit, _exit);\n\n return result;\n } else {\n _exit();\n return new Promise(function (_resolve, reject) {\n reject(new Error(\"Worker terminating\"));\n });\n }\n}\n\n\n\n/**\n * Called within the worker message handler to run abort handlers if registered to perform cleanup operations.\n * @param {Integer} [requestId] id of task which is currently executing in the worker\n * @return {Promise}\n*/\nworker.cleanup = function(requestId) {\n\n if (!worker.abortListeners.length) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: convertError(new Error('Worker terminating')),\n });\n\n // If there are no handlers registered, reject the promise with an error as we want the handler to be notified\n // that cleanup should begin and the handler should be GCed.\n return new Promise(function(resolve) { resolve(); });\n }\n \n\n var _exit = function() {\n worker.exit();\n }\n\n var _abort = function() {\n if (!worker.abortListeners.length) {\n worker.abortListeners = [];\n }\n }\n\n const promises = worker.abortListeners.map(listener => listener());\n let timerId;\n const timeoutPromise = new Promise((_resolve, reject) => {\n timerId = setTimeout(function () { \n reject(new Error('Timeout occured waiting for abort handler, killing worker'));\n }, worker.abortListenerTimeout);\n });\n\n // Once a promise settles we need to clear the timeout to prevet fulfulling the promise twice \n const settlePromise = Promise.all(promises).then(function() {\n clearTimeout(timerId);\n _abort();\n }, function() {\n clearTimeout(timerId);\n _exit();\n });\n\n // Returns a promise which will result in one of the following cases\n // - Resolve once all handlers resolve\n // - Reject if one or more handlers exceed the 'abortListenerTimeout' interval\n // - Reject if one or more handlers reject\n // Upon one of the above cases a message will be sent to the handler with the result of the handler execution\n // which will either kill the worker if the result contains an error, or keep it in the pool if the result\n // does not contain an error.\n return new Promise(function(resolve, reject) {\n settlePromise.then(resolve, reject);\n timeoutPromise.then(resolve, reject);\n }).then(function() {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: null,\n });\n }, function(err) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: err ? convertError(err) : null,\n });\n });\n}\n\nvar currentRequestId = null;\n\nworker.on('message', function (request) {\n if (request === TERMINATE_METHOD_ID) {\n return worker.terminateAndExit(0);\n }\n\n if (request.method === CLEANUP_METHOD_ID) {\n return worker.cleanup(request.id);\n }\n\n try {\n var method = worker.methods[request.method];\n\n if (method) {\n currentRequestId = request.id;\n \n // execute the function\n var result = method.apply(method, request.params);\n\n if (isPromise(result)) {\n // promise returned, resolve this and then return\n result\n .then(function (result) {\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n currentRequestId = null;\n })\n .catch(function (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err),\n });\n currentRequestId = null;\n });\n }\n else {\n // immediate result\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n\n currentRequestId = null;\n }\n }\n else {\n throw new Error('Unknown method \"' + request.method + '\"');\n }\n }\n catch (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err)\n });\n }\n});\n\n/**\n * Register methods to the worker\n * @param {Object} [methods]\n * @param {import('./types.js').WorkerRegisterOptions} [options]\n */\nworker.register = function (methods, options) {\n\n if (methods) {\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n worker.methods[name] = methods[name];\n worker.methods[name].worker = publicWorker;\n }\n }\n }\n\n if (options) {\n worker.terminationHandler = options.onTerminate;\n // register listener timeout or default to 1 second\n worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT;\n }\n\n worker.send('ready');\n};\n\nworker.emit = function (payload) {\n if (currentRequestId) {\n if (payload instanceof Transfer) {\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload: payload.message\n }, payload.transfer);\n return;\n }\n\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload\n });\n }\n};\n\n\nif (typeof exports !== 'undefined') {\n exports.add = worker.register;\n exports.emit = worker.emit;\n}\n"],"names":["Transfer","message","transfer","Promise","handler","parent","me","SyntaxError","_onSuccess","_onFail","resolved","rejected","pending","Symbol","toStringTag","_process","onSuccess","onFail","push","then","resolve","reject","s","_then","f","_resolve","result","forEach","fn","_reject","error","cancel","CancellationError","timeout","delay","timer","setTimeout","TimeoutError","always","clearTimeout","callback","res","prototype","finally","final","all","promises","remaining","length","results","p","i","defer","resolver","promise","stack","Error","constructor","name","_Promise","require$$0","require$$1","TERMINATE_METHOD_ID","CLEANUP_METHOD_ID","TIMEOUT_DEFAULT","worker","exit","publicWorker","addAbortListener","listener","abortListeners","emit","self","postMessage","addEventListener","on","event","data","send","process","WorkerThreads","require","_typeof","code","parentPort","bind","convertError","toJSON","JSON","parse","stringify","Object","getOwnPropertyNames","isPromise","value","catch","methods","run","args","Function","apply","keys","terminationHandler","undefined","abortListenerTimeout","terminateAndExit","_exit","cleanup","requestId","id","method","_abort","map","timerId","timeoutPromise","settlePromise","err","currentRequestId","request","params","register","options","hasOwnProperty","onTerminate","payload","isEvent","exports","add"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,SAASA,QAAQA,CAACC,OAAO,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A,GAAeN,MAAM,CAACM,IAAI;EAC5B,EAAA;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/workerpool/dist/worker.min.js b/node_modules/workerpool/dist/worker.min.js new file mode 100644 index 0000000..539c7e7 --- /dev/null +++ b/node_modules/workerpool/dist/worker.min.js @@ -0,0 +1,2 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).worker=n()}(this,(function(){"use strict";function e(n){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(n)}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t={};var r=function(e,n){this.message=e,this.transfer=n},o={};function i(e,n){var t=this;if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if("function"!=typeof e)throw new SyntaxError("Function parameter handler(resolve, reject) missing");var r=[],o=[];this.resolved=!1,this.rejected=!1,this.pending=!0,this[Symbol.toStringTag]="Promise";var a=function(e,n){r.push(e),o.push(n)};this.then=function(e,n){return new i((function(t,r){var o=e?s(e,t,r):t,i=n?s(n,t,r):r;a(o,i)}),t)};var f=function(e){return t.resolved=!0,t.rejected=!1,t.pending=!1,r.forEach((function(n){n(e)})),a=function(n,t){n(e)},f=d=function(){},t},d=function(e){return t.resolved=!1,t.rejected=!0,t.pending=!1,o.forEach((function(n){n(e)})),a=function(n,t){t(e)},f=d=function(){},t};this.cancel=function(){return n?n.cancel():d(new u),t},this.timeout=function(e){if(n)n.timeout(e);else{var r=setTimeout((function(){d(new c("Promise timed out after "+e+" ms"))}),e);t.always((function(){clearTimeout(r)}))}return t},e((function(e){f(e)}),(function(e){d(e)}))}function s(e,n,t){return function(r){try{var o=e(r);o&&"function"==typeof o.then&&"function"==typeof o.catch?o.then(n,t):n(o)}catch(e){t(e)}}}function u(e){this.message=e||"promise cancelled",this.stack=(new Error).stack}function c(e){this.message=e||"timeout exceeded",this.stack=(new Error).stack}return i.prototype.catch=function(e){return this.then(null,e)},i.prototype.always=function(e){return this.then(e,e)},i.prototype.finally=function(e){var n=this,t=function(){return new i((function(e){return e()})).then(e).then((function(){return n}))};return this.then(t,t)},i.all=function(e){return new i((function(n,t){var r=e.length,o=[];r?e.forEach((function(e,i){e.then((function(e){o[i]=e,0==--r&&n(o)}),(function(e){r=0,t(e)}))})):n(o)}))},i.defer=function(){var e={};return e.promise=new i((function(n,t){e.resolve=n,e.reject=t})),e},u.prototype=new Error,u.prototype.constructor=Error,u.prototype.name="CancellationError",i.CancellationError=u,c.prototype=new Error,c.prototype.constructor=Error,c.prototype.name="TimeoutError",i.TimeoutError=c,o.Promise=i,function(n){var t=r,i=o.Promise,s="__workerpool-cleanup__",u={exit:function(){}},c={addAbortListener:function(e){u.abortListeners.push(e)},emit:u.emit};if("undefined"!=typeof self&&"function"==typeof postMessage&&"function"==typeof addEventListener)u.on=function(e,n){addEventListener(e,(function(e){n(e.data)}))},u.send=function(e,n){n?postMessage(e,n):postMessage(e)};else{if("undefined"==typeof process)throw new Error("Script must be executed as a worker");var a;try{a=require("worker_threads")}catch(n){if("object"!==e(n)||null===n||"MODULE_NOT_FOUND"!==n.code)throw n}if(a&&null!==a.parentPort){var f=a.parentPort;u.send=f.postMessage.bind(f),u.on=f.on.bind(f),u.exit=process.exit.bind(process)}else u.on=process.on.bind(process),u.send=function(e){process.send(e)},u.on("disconnect",(function(){process.exit(1)})),u.exit=process.exit.bind(process)}function d(e){return e&&e.toJSON?JSON.parse(JSON.stringify(e)):JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)))}function l(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}u.methods={},u.methods.run=function(e,n){var t=new Function("return ("+e+").apply(this, arguments);");return t.worker=c,t.apply(t,n)},u.methods.methods=function(){return Object.keys(u.methods)},u.terminationHandler=void 0,u.abortListenerTimeout=1e3,u.abortListeners=[],u.terminateAndExit=function(e){var n=function(){u.exit(e)};if(!u.terminationHandler)return n();var t=u.terminationHandler(e);return l(t)?(t.then(n,n),t):(n(),new i((function(e,n){n(new Error("Worker terminating"))})))},u.cleanup=function(e){if(!u.abortListeners.length)return u.send({id:e,method:s,error:d(new Error("Worker terminating"))}),new i((function(e){e()}));var n,t=u.abortListeners.map((function(e){return e()})),r=new i((function(e,t){n=setTimeout((function(){t(new Error("Timeout occured waiting for abort handler, killing worker"))}),u.abortListenerTimeout)})),o=i.all(t).then((function(){clearTimeout(n),u.abortListeners.length||(u.abortListeners=[])}),(function(){clearTimeout(n),u.exit()}));return new i((function(e,n){o.then(e,n),r.then(e,n)})).then((function(){u.send({id:e,method:s,error:null})}),(function(n){u.send({id:e,method:s,error:n?d(n):null})}))};var p=null;u.on("message",(function(e){if("__workerpool-terminate__"===e)return u.terminateAndExit(0);if(e.method===s)return u.cleanup(e.id);try{var n=u.methods[e.method];if(!n)throw new Error('Unknown method "'+e.method+'"');p=e.id;var r=n.apply(n,e.params);l(r)?r.then((function(n){n instanceof t?u.send({id:e.id,result:n.message,error:null},n.transfer):u.send({id:e.id,result:n,error:null}),p=null})).catch((function(n){u.send({id:e.id,result:null,error:d(n)}),p=null})):(r instanceof t?u.send({id:e.id,result:r.message,error:null},r.transfer):u.send({id:e.id,result:r,error:null}),p=null)}catch(n){u.send({id:e.id,result:null,error:d(n)})}})),u.register=function(e,n){if(e)for(var t in e)e.hasOwnProperty(t)&&(u.methods[t]=e[t],u.methods[t].worker=c);n&&(u.terminationHandler=n.onTerminate,u.abortListenerTimeout=n.abortListenerTimeout||1e3),u.send("ready")},u.emit=function(e){if(p){if(e instanceof t)return void u.send({id:p,isEvent:!0,payload:e.message},e.transfer);u.send({id:p,isEvent:!0,payload:e})}},n.add=u.register,n.emit=u.emit}(t),n(t)})); +//# sourceMappingURL=worker.min.js.map diff --git a/node_modules/workerpool/dist/worker.min.js.map b/node_modules/workerpool/dist/worker.min.js.map new file mode 100644 index 0000000..1d9c85e --- /dev/null +++ b/node_modules/workerpool/dist/worker.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"worker.min.js","sources":["../src/transfer.js","../src/Promise.js","../src/worker.js"],"sourcesContent":["/**\n * The helper class for transferring data from the worker to the main thread.\n *\n * @param {Object} message The object to deliver to the main thread.\n * @param {Object[]} transfer An array of transferable Objects to transfer ownership of.\n */\nfunction Transfer(message, transfer) {\n this.message = message;\n this.transfer = transfer;\n}\n\nmodule.exports = Transfer;\n","'use strict';\n\n/**\n * Promise\n *\n * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa \n * @template T\n * @template [E=Error]\n * @param {Function} handler Called as handler(resolve: Function, reject: Function)\n * @param {Promise} [parent] Parent promise for propagation of cancel and timeout\n */\nfunction Promise(handler, parent) {\n var me = this;\n\n if (!(this instanceof Promise)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n if (typeof handler !== 'function') {\n throw new SyntaxError('Function parameter handler(resolve, reject) missing');\n }\n\n var _onSuccess = [];\n var _onFail = [];\n\n // status\n /**\n * @readonly\n */\n this.resolved = false;\n /**\n * @readonly\n */\n this.rejected = false;\n /**\n * @readonly\n */\n this.pending = true;\n /**\n * @readonly\n */\n this[Symbol.toStringTag] = 'Promise';\n\n /**\n * Process onSuccess and onFail callbacks: add them to the queue.\n * Once the promise is resolved, the function _promise is replace.\n * @param {Function} onSuccess\n * @param {Function} onFail\n * @private\n */\n var _process = function (onSuccess, onFail) {\n _onSuccess.push(onSuccess);\n _onFail.push(onFail);\n };\n\n /**\n * Add an onSuccess callback and optionally an onFail callback to the Promise\n * @template TT\n * @template [TE=never]\n * @param {(r: T) => TT | PromiseLike} onSuccess\n * @param {(r: E) => TE | PromiseLike} [onFail]\n * @returns {Promise} promise\n */\n this.then = function (onSuccess, onFail) {\n return new Promise(function (resolve, reject) {\n var s = onSuccess ? _then(onSuccess, resolve, reject) : resolve;\n var f = onFail ? _then(onFail, resolve, reject) : reject;\n\n _process(s, f);\n }, me);\n };\n\n /**\n * Resolve the promise\n * @param {*} result\n * @type {Function}\n */\n var _resolve = function (result) {\n // update status\n me.resolved = true;\n me.rejected = false;\n me.pending = false;\n\n _onSuccess.forEach(function (fn) {\n fn(result);\n });\n\n _process = function (onSuccess, onFail) {\n onSuccess(result);\n };\n\n _resolve = _reject = function () { };\n\n return me;\n };\n\n /**\n * Reject the promise\n * @param {Error} error\n * @type {Function}\n */\n var _reject = function (error) {\n // update status\n me.resolved = false;\n me.rejected = true;\n me.pending = false;\n\n _onFail.forEach(function (fn) {\n fn(error);\n });\n\n _process = function (onSuccess, onFail) {\n onFail(error);\n };\n\n _resolve = _reject = function () { }\n\n return me;\n };\n\n /**\n * Cancel the promise. This will reject the promise with a CancellationError\n * @returns {this} self\n */\n this.cancel = function () {\n if (parent) {\n parent.cancel();\n }\n else {\n _reject(new CancellationError());\n }\n\n return me;\n };\n\n /**\n * Set a timeout for the promise. If the promise is not resolved within\n * the time, the promise will be cancelled and a TimeoutError is thrown.\n * If the promise is resolved in time, the timeout is removed.\n * @param {number} delay Delay in milliseconds\n * @returns {this} self\n */\n this.timeout = function (delay) {\n if (parent) {\n parent.timeout(delay);\n }\n else {\n var timer = setTimeout(function () {\n _reject(new TimeoutError('Promise timed out after ' + delay + ' ms'));\n }, delay);\n\n me.always(function () {\n clearTimeout(timer);\n });\n }\n\n return me;\n };\n\n // attach handler passing the resolve and reject functions\n handler(function (result) {\n _resolve(result);\n }, function (error) {\n _reject(error);\n });\n}\n\n/**\n * Execute given callback, then call resolve/reject based on the returned result\n * @param {Function} callback\n * @param {Function} resolve\n * @param {Function} reject\n * @returns {Function}\n * @private\n */\nfunction _then(callback, resolve, reject) {\n return function (result) {\n try {\n var res = callback(result);\n if (res && typeof res.then === 'function' && typeof res['catch'] === 'function') {\n // method returned a promise\n res.then(resolve, reject);\n }\n else {\n resolve(res);\n }\n }\n catch (error) {\n reject(error);\n }\n }\n}\n\n/**\n * Add an onFail callback to the Promise\n * @template TT\n * @param {(error: E) => TT | PromiseLike} onFail\n * @returns {Promise} promise\n */\nPromise.prototype['catch'] = function (onFail) {\n return this.then(null, onFail);\n};\n\n// TODO: add support for Promise.catch(Error, callback)\n// TODO: add support for Promise.catch(Error, Error, callback)\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * @template TT\n * @param {() => Promise} fn\n * @returns {Promise} promise\n */\nPromise.prototype.always = function (fn) {\n return this.then(fn, fn);\n};\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * Same semantics as Node's Promise.finally()\n * @param {Function | null | undefined} [fn]\n * @returns {Promise} promise\n */\nPromise.prototype.finally = function (fn) {\n const me = this;\n\n const final = function() {\n return new Promise((resolve) => resolve())\n .then(fn)\n .then(() => me);\n };\n\n return this.then(final, final);\n}\n\n/**\n * Create a promise which resolves when all provided promises are resolved,\n * and fails when any of the promises resolves.\n * @param {Promise[]} promises\n * @returns {Promise} promise\n */\nPromise.all = function (promises){\n return new Promise(function (resolve, reject) {\n var remaining = promises.length,\n results = [];\n\n if (remaining) {\n promises.forEach(function (p, i) {\n p.then(function (result) {\n results[i] = result;\n remaining--;\n if (remaining == 0) {\n resolve(results);\n }\n }, function (error) {\n remaining = 0;\n reject(error);\n });\n });\n }\n else {\n resolve(results);\n }\n });\n};\n\n/**\n * Create a promise resolver\n * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver\n */\nPromise.defer = function () {\n var resolver = {};\n\n resolver.promise = new Promise(function (resolve, reject) {\n resolver.resolve = resolve;\n resolver.reject = reject;\n });\n\n return resolver;\n};\n\n/**\n * Create a cancellation error\n * @param {String} [message]\n * @extends Error\n */\nfunction CancellationError(message) {\n this.message = message || 'promise cancelled';\n this.stack = (new Error()).stack;\n}\n\nCancellationError.prototype = new Error();\nCancellationError.prototype.constructor = Error;\nCancellationError.prototype.name = 'CancellationError';\n\nPromise.CancellationError = CancellationError;\n\n\n/**\n * Create a timeout error\n * @param {String} [message]\n * @extends Error\n */\nfunction TimeoutError(message) {\n this.message = message || 'timeout exceeded';\n this.stack = (new Error()).stack;\n}\n\nTimeoutError.prototype = new Error();\nTimeoutError.prototype.constructor = Error;\nTimeoutError.prototype.name = 'TimeoutError';\n\nPromise.TimeoutError = TimeoutError;\n\n\nexports.Promise = Promise;\n","/**\n * worker must be started as a child process or a web worker.\n * It listens for RPC messages from the parent process.\n */\n\nvar Transfer = require('./transfer');\n\n/**\n * worker must handle async cleanup handlers. Use custom Promise implementation. \n*/\nvar Promise = require('./Promise').Promise;\n/**\n * Special message sent by parent which causes the worker to terminate itself.\n * Not a \"message object\"; this string is the entire message.\n */\nvar TERMINATE_METHOD_ID = '__workerpool-terminate__';\n\n/**\n * Special message by parent which causes a child process worker to perform cleaup\n * steps before determining if the child process worker should be terminated.\n*/\nvar CLEANUP_METHOD_ID = '__workerpool-cleanup__';\n// var nodeOSPlatform = require('./environment').nodeOSPlatform;\n\n\nvar TIMEOUT_DEFAULT = 1_000;\n\n// create a worker API for sending and receiving messages which works both on\n// node.js and in the browser\nvar worker = {\n exit: function() {}\n};\n\n// api for in worker communication with parent process\n// works in both node.js and the browser\nvar publicWorker = {\n /**\n * Registers listeners which will trigger when a task is timed out or cancled. If all listeners resolve, the worker executing the given task will not be terminated.\n * *Note*: If there is a blocking operation within a listener, the worker will be terminated.\n * @param {() => Promise} listener\n */\n addAbortListener: function(listener) {\n worker.abortListeners.push(listener);\n },\n\n /**\n * Emit an event from the worker thread to the main thread.\n * @param {any} payload\n */\n emit: worker.emit\n};\n\nif (typeof self !== 'undefined' && typeof postMessage === 'function' && typeof addEventListener === 'function') {\n // worker in the browser\n worker.on = function (event, callback) {\n addEventListener(event, function (message) {\n callback(message.data);\n })\n };\n worker.send = function (message, transfer) {\n transfer ? postMessage(message, transfer) : postMessage (message);\n };\n}\nelse if (typeof process !== 'undefined') {\n // node.js\n\n var WorkerThreads;\n try {\n WorkerThreads = require('worker_threads');\n } catch(error) {\n if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') {\n // no worker_threads, fallback to sub-process based workers\n } else {\n throw error;\n }\n }\n\n if (WorkerThreads &&\n /* if there is a parentPort, we are in a WorkerThread */\n WorkerThreads.parentPort !== null) {\n var parentPort = WorkerThreads.parentPort;\n worker.send = parentPort.postMessage.bind(parentPort);\n worker.on = parentPort.on.bind(parentPort);\n worker.exit = process.exit.bind(process);\n } else {\n worker.on = process.on.bind(process);\n // ignore transfer argument since it is not supported by process\n worker.send = function (message) {\n process.send(message);\n };\n // register disconnect handler only for subprocess worker to exit when parent is killed unexpectedly\n worker.on('disconnect', function () {\n process.exit(1);\n });\n worker.exit = process.exit.bind(process);\n }\n}\nelse {\n throw new Error('Script must be executed as a worker');\n}\n\nfunction convertError(error) {\n if (error && error.toJSON) {\n return JSON.parse(JSON.stringify(error));\n }\n\n // turn a class like Error (having non-enumerable properties) into a plain object\n return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error)));\n}\n\n/**\n * Test whether a value is a Promise via duck typing.\n * @param {*} value\n * @returns {boolean} Returns true when given value is an object\n * having functions `then` and `catch`.\n */\nfunction isPromise(value) {\n return value && (typeof value.then === 'function') && (typeof value.catch === 'function');\n}\n\n// functions available externally\nworker.methods = {};\n\n/**\n * Execute a function with provided arguments\n * @param {String} fn Stringified function\n * @param {Array} [args] Function arguments\n * @returns {*}\n */\nworker.methods.run = function run(fn, args) {\n var f = new Function('return (' + fn + ').apply(this, arguments);');\n f.worker = publicWorker;\n return f.apply(f, args);\n};\n\n/**\n * Get a list with methods available on this worker\n * @return {String[]} methods\n */\nworker.methods.methods = function methods() {\n return Object.keys(worker.methods);\n};\n\n/**\n * Custom handler for when the worker is terminated.\n */\nworker.terminationHandler = undefined;\n\nworker.abortListenerTimeout = TIMEOUT_DEFAULT;\n\n/**\n * Abort handlers for resolving errors which may cause a timeout or cancellation\n * to occur from a worker context\n */\nworker.abortListeners = [];\n\n/**\n * Cleanup and exit the worker.\n * @param {Number} code \n * @returns {Promise}\n */\nworker.terminateAndExit = function(code) {\n var _exit = function() {\n worker.exit(code);\n }\n\n if(!worker.terminationHandler) {\n return _exit();\n }\n \n var result = worker.terminationHandler(code);\n if (isPromise(result)) {\n result.then(_exit, _exit);\n\n return result;\n } else {\n _exit();\n return new Promise(function (_resolve, reject) {\n reject(new Error(\"Worker terminating\"));\n });\n }\n}\n\n\n\n/**\n * Called within the worker message handler to run abort handlers if registered to perform cleanup operations.\n * @param {Integer} [requestId] id of task which is currently executing in the worker\n * @return {Promise}\n*/\nworker.cleanup = function(requestId) {\n\n if (!worker.abortListeners.length) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: convertError(new Error('Worker terminating')),\n });\n\n // If there are no handlers registered, reject the promise with an error as we want the handler to be notified\n // that cleanup should begin and the handler should be GCed.\n return new Promise(function(resolve) { resolve(); });\n }\n \n\n var _exit = function() {\n worker.exit();\n }\n\n var _abort = function() {\n if (!worker.abortListeners.length) {\n worker.abortListeners = [];\n }\n }\n\n const promises = worker.abortListeners.map(listener => listener());\n let timerId;\n const timeoutPromise = new Promise((_resolve, reject) => {\n timerId = setTimeout(function () { \n reject(new Error('Timeout occured waiting for abort handler, killing worker'));\n }, worker.abortListenerTimeout);\n });\n\n // Once a promise settles we need to clear the timeout to prevet fulfulling the promise twice \n const settlePromise = Promise.all(promises).then(function() {\n clearTimeout(timerId);\n _abort();\n }, function() {\n clearTimeout(timerId);\n _exit();\n });\n\n // Returns a promise which will result in one of the following cases\n // - Resolve once all handlers resolve\n // - Reject if one or more handlers exceed the 'abortListenerTimeout' interval\n // - Reject if one or more handlers reject\n // Upon one of the above cases a message will be sent to the handler with the result of the handler execution\n // which will either kill the worker if the result contains an error, or keep it in the pool if the result\n // does not contain an error.\n return new Promise(function(resolve, reject) {\n settlePromise.then(resolve, reject);\n timeoutPromise.then(resolve, reject);\n }).then(function() {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: null,\n });\n }, function(err) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: err ? convertError(err) : null,\n });\n });\n}\n\nvar currentRequestId = null;\n\nworker.on('message', function (request) {\n if (request === TERMINATE_METHOD_ID) {\n return worker.terminateAndExit(0);\n }\n\n if (request.method === CLEANUP_METHOD_ID) {\n return worker.cleanup(request.id);\n }\n\n try {\n var method = worker.methods[request.method];\n\n if (method) {\n currentRequestId = request.id;\n \n // execute the function\n var result = method.apply(method, request.params);\n\n if (isPromise(result)) {\n // promise returned, resolve this and then return\n result\n .then(function (result) {\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n currentRequestId = null;\n })\n .catch(function (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err),\n });\n currentRequestId = null;\n });\n }\n else {\n // immediate result\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n\n currentRequestId = null;\n }\n }\n else {\n throw new Error('Unknown method \"' + request.method + '\"');\n }\n }\n catch (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err)\n });\n }\n});\n\n/**\n * Register methods to the worker\n * @param {Object} [methods]\n * @param {import('./types.js').WorkerRegisterOptions} [options]\n */\nworker.register = function (methods, options) {\n\n if (methods) {\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n worker.methods[name] = methods[name];\n worker.methods[name].worker = publicWorker;\n }\n }\n }\n\n if (options) {\n worker.terminationHandler = options.onTerminate;\n // register listener timeout or default to 1 second\n worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT;\n }\n\n worker.send('ready');\n};\n\nworker.emit = function (payload) {\n if (currentRequestId) {\n if (payload instanceof Transfer) {\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload: payload.message\n }, payload.transfer);\n return;\n }\n\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload\n });\n }\n};\n\n\nif (typeof exports !== 'undefined') {\n exports.add = worker.register;\n exports.emit = worker.emit;\n}\n"],"names":["transfer","message","this","Promise","handler","parent","me","SyntaxError","_onSuccess","_onFail","resolved","rejected","pending","Symbol","toStringTag","_process","onSuccess","onFail","push","then","resolve","reject","s","_then","f","_resolve","result","forEach","fn","_reject","error","cancel","CancellationError","timeout","delay","timer","setTimeout","TimeoutError","always","clearTimeout","callback","res","stack","Error","prototype","finally","final","all","promises","remaining","length","results","p","i","defer","resolver","promise","constructor","name","_Promise","Transfer","require$$0","require$$1","CLEANUP_METHOD_ID","worker","exit","publicWorker","addAbortListener","listener","abortListeners","emit","self","postMessage","addEventListener","on","event","data","send","process","WorkerThreads","require","_typeof","code","parentPort","bind","convertError","toJSON","JSON","parse","stringify","Object","getOwnPropertyNames","isPromise","value","catch","methods","run","args","Function","apply","keys","terminationHandler","undefined","abortListenerTimeout","terminateAndExit","_exit","cleanup","requestId","id","method","timerId","map","timeoutPromise","settlePromise","err","currentRequestId","request","params","register","options","hasOwnProperty","onTerminate","payload","isEvent","exports","add"],"mappings":"0jBAWA,IAAAA,EALA,SAAkBC,EAASD,GACzBE,KAAKD,QAAUA,EACfC,KAAKF,SAAWA,CAClB,OCEA,SAASG,EAAQC,EAASC,GACxB,IAAIC,EAAKJ,KAET,KAAMA,gBAAgBC,GACpB,MAAM,IAAII,YAAY,oDAGxB,GAAuB,mBAAZH,EACT,MAAM,IAAIG,YAAY,uDAGxB,IAAIC,EAAa,GACbC,EAAU,GAMdP,KAAKQ,UAAW,EAIhBR,KAAKS,UAAW,EAIhBT,KAAKU,SAAU,EAIfV,KAAKW,OAAOC,aAAe,UAS3B,IAAIC,EAAW,SAAUC,EAAWC,GAClCT,EAAWU,KAAKF,GAChBP,EAAQS,KAAKD,EACjB,EAUEf,KAAKiB,KAAO,SAAUH,EAAWC,GAC/B,OAAO,IAAId,GAAQ,SAAUiB,EAASC,GACpC,IAAIC,EAAIN,EAAYO,EAAMP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GACZlF,OAAQA,EAAOzB,QACf6B,MAAO,MACNJ,EAAO1B,UAEVgE,EAAOa,KAAK,CACV+B,GAAIQ,EAAQR,GACZlF,OAAQA,EACRI,MAAO,OAIXqF,EAAmB,KAM3B,CACE,MAAOD,GACLlD,EAAOa,KAAK,CACV+B,GAAIQ,EAAQR,GACZlF,OAAQ,KACRI,MAAOuD,EAAa6B,IAE1B,CACA,IAOAlD,EAAOsD,SAAW,SAAUvB,EAASwB,GAEnC,GAAIxB,EACF,IAAK,IAAIrC,KAAQqC,EACXA,EAAQyB,eAAe9D,KACzBM,EAAO+B,QAAQrC,GAAQqC,EAAQrC,GAC/BM,EAAO+B,QAAQrC,GAAMM,OAASE,GAKhCqD,IACFvD,EAAOqC,mBAAqBkB,EAAQE,YAEpCzD,EAAOuC,qBAAuBgB,EAAQhB,sBA3UpB,KA8UpBvC,EAAOa,KAAK,QACd,EAEAb,EAAOM,KAAO,SAAUoD,GACtB,GAAIP,EAAkB,CACpB,GAAIO,aAAmB9D,EAMrB,YALAI,EAAOa,KAAK,CACV+B,GAAIO,EACJQ,SAAS,EACTD,QAASA,EAAQzH,SAChByH,EAAQ1H,UAIbgE,EAAOa,KAAK,CACV+B,GAAIO,EACJQ,SAAS,EACTD,QAAAA,GAEN,CACA,EAIEE,EAAAC,IAAc7D,EAAOsD,SACrBM,EAAAtD,KAAeN,EAAOM"} \ No newline at end of file diff --git a/node_modules/workerpool/dist/workerpool.js b/node_modules/workerpool/dist/workerpool.js new file mode 100644 index 0000000..e921486 --- /dev/null +++ b/node_modules/workerpool/dist/workerpool.js @@ -0,0 +1,2087 @@ +/** + * workerpool.js + * https://github.com/josdejong/workerpool + * + * Offload tasks to a pool of workers on node.js and in the browser. + * + * @version 9.3.4 + * @date 2025-09-10 + * + * @license + * Copyright (C) 2014-2022 Jos de Jong + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.workerpool = {})); +})(this, (function (exports) { 'use strict'; + + var src = {}; + + var environment = {exports: {}}; + + (function (module) { + // source: https://github.com/flexdinesh/browser-or-node + // source: https://github.com/mozilla/pdf.js/blob/7ea0e40e588864cd938d1836ec61f1928d3877d3/src/shared/util.js#L24 + var isNode = function isNode(nodeProcess) { + return typeof nodeProcess !== 'undefined' && nodeProcess.versions != null && nodeProcess.versions.node != null && nodeProcess + '' === '[object process]'; + }; + module.exports.isNode = isNode; + + // determines the JavaScript platform: browser or node + module.exports.platform = typeof process !== 'undefined' && isNode(process) ? 'node' : 'browser'; + + // determines whether the code is running in main thread or not + // note that in node.js we have to check both worker_thread and child_process + var worker_threads = module.exports.platform === 'node' && require('worker_threads'); + module.exports.isMainThread = module.exports.platform === 'node' ? (!worker_threads || worker_threads.isMainThread) && !process.connected : typeof Window !== 'undefined'; + + // determines the number of cpus available + module.exports.cpus = module.exports.platform === 'browser' ? self.navigator.hardwareConcurrency : require('os').cpus().length; + })(environment); + var environmentExports = environment.exports; + + var _Promise$1 = {}; + + var hasRequired_Promise; + function require_Promise() { + if (hasRequired_Promise) return _Promise$1; + hasRequired_Promise = 1; + + /** + * Promise + * + * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa + * @template T + * @template [E=Error] + * @param {Function} handler Called as handler(resolve: Function, reject: Function) + * @param {Promise} [parent] Parent promise for propagation of cancel and timeout + */ + function Promise(handler, parent) { + var me = this; + if (!(this instanceof Promise)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + if (typeof handler !== 'function') { + throw new SyntaxError('Function parameter handler(resolve, reject) missing'); + } + var _onSuccess = []; + var _onFail = []; + + // status + /** + * @readonly + */ + this.resolved = false; + /** + * @readonly + */ + this.rejected = false; + /** + * @readonly + */ + this.pending = true; + /** + * @readonly + */ + this[Symbol.toStringTag] = 'Promise'; + + /** + * Process onSuccess and onFail callbacks: add them to the queue. + * Once the promise is resolved, the function _promise is replace. + * @param {Function} onSuccess + * @param {Function} onFail + * @private + */ + var _process = function _process(onSuccess, onFail) { + _onSuccess.push(onSuccess); + _onFail.push(onFail); + }; + + /** + * Add an onSuccess callback and optionally an onFail callback to the Promise + * @template TT + * @template [TE=never] + * @param {(r: T) => TT | PromiseLike} onSuccess + * @param {(r: E) => TE | PromiseLike} [onFail] + * @returns {Promise} promise + */ + this.then = function (onSuccess, onFail) { + return new Promise(function (resolve, reject) { + var s = onSuccess ? _then(onSuccess, resolve, reject) : resolve; + var f = onFail ? _then(onFail, resolve, reject) : reject; + _process(s, f); + }, me); + }; + + /** + * Resolve the promise + * @param {*} result + * @type {Function} + */ + var _resolve2 = function _resolve(result) { + // update status + me.resolved = true; + me.rejected = false; + me.pending = false; + _onSuccess.forEach(function (fn) { + fn(result); + }); + _process = function _process(onSuccess, onFail) { + onSuccess(result); + }; + _resolve2 = _reject2 = function _reject() {}; + return me; + }; + + /** + * Reject the promise + * @param {Error} error + * @type {Function} + */ + var _reject2 = function _reject(error) { + // update status + me.resolved = false; + me.rejected = true; + me.pending = false; + _onFail.forEach(function (fn) { + fn(error); + }); + _process = function _process(onSuccess, onFail) { + onFail(error); + }; + _resolve2 = _reject2 = function _reject() {}; + return me; + }; + + /** + * Cancel the promise. This will reject the promise with a CancellationError + * @returns {this} self + */ + this.cancel = function () { + if (parent) { + parent.cancel(); + } else { + _reject2(new CancellationError()); + } + return me; + }; + + /** + * Set a timeout for the promise. If the promise is not resolved within + * the time, the promise will be cancelled and a TimeoutError is thrown. + * If the promise is resolved in time, the timeout is removed. + * @param {number} delay Delay in milliseconds + * @returns {this} self + */ + this.timeout = function (delay) { + if (parent) { + parent.timeout(delay); + } else { + var timer = setTimeout(function () { + _reject2(new TimeoutError('Promise timed out after ' + delay + ' ms')); + }, delay); + me.always(function () { + clearTimeout(timer); + }); + } + return me; + }; + + // attach handler passing the resolve and reject functions + handler(function (result) { + _resolve2(result); + }, function (error) { + _reject2(error); + }); + } + + /** + * Execute given callback, then call resolve/reject based on the returned result + * @param {Function} callback + * @param {Function} resolve + * @param {Function} reject + * @returns {Function} + * @private + */ + function _then(callback, resolve, reject) { + return function (result) { + try { + var res = callback(result); + if (res && typeof res.then === 'function' && typeof res['catch'] === 'function') { + // method returned a promise + res.then(resolve, reject); + } else { + resolve(res); + } + } catch (error) { + reject(error); + } + }; + } + + /** + * Add an onFail callback to the Promise + * @template TT + * @param {(error: E) => TT | PromiseLike} onFail + * @returns {Promise} promise + */ + Promise.prototype['catch'] = function (onFail) { + return this.then(null, onFail); + }; + + // TODO: add support for Promise.catch(Error, callback) + // TODO: add support for Promise.catch(Error, Error, callback) + + /** + * Execute given callback when the promise either resolves or rejects. + * @template TT + * @param {() => Promise} fn + * @returns {Promise} promise + */ + Promise.prototype.always = function (fn) { + return this.then(fn, fn); + }; + + /** + * Execute given callback when the promise either resolves or rejects. + * Same semantics as Node's Promise.finally() + * @param {Function | null | undefined} [fn] + * @returns {Promise} promise + */ + Promise.prototype.finally = function (fn) { + var me = this; + var final = function final() { + return new Promise(function (resolve) { + return resolve(); + }).then(fn).then(function () { + return me; + }); + }; + return this.then(final, final); + }; + + /** + * Create a promise which resolves when all provided promises are resolved, + * and fails when any of the promises resolves. + * @param {Promise[]} promises + * @returns {Promise} promise + */ + Promise.all = function (promises) { + return new Promise(function (resolve, reject) { + var remaining = promises.length, + results = []; + if (remaining) { + promises.forEach(function (p, i) { + p.then(function (result) { + results[i] = result; + remaining--; + if (remaining == 0) { + resolve(results); + } + }, function (error) { + remaining = 0; + reject(error); + }); + }); + } else { + resolve(results); + } + }); + }; + + /** + * Create a promise resolver + * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver + */ + Promise.defer = function () { + var resolver = {}; + resolver.promise = new Promise(function (resolve, reject) { + resolver.resolve = resolve; + resolver.reject = reject; + }); + return resolver; + }; + + /** + * Create a cancellation error + * @param {String} [message] + * @extends Error + */ + function CancellationError(message) { + this.message = message || 'promise cancelled'; + this.stack = new Error().stack; + } + CancellationError.prototype = new Error(); + CancellationError.prototype.constructor = Error; + CancellationError.prototype.name = 'CancellationError'; + Promise.CancellationError = CancellationError; + + /** + * Create a timeout error + * @param {String} [message] + * @extends Error + */ + function TimeoutError(message) { + this.message = message || 'timeout exceeded'; + this.stack = new Error().stack; + } + TimeoutError.prototype = new Error(); + TimeoutError.prototype.constructor = Error; + TimeoutError.prototype.name = 'TimeoutError'; + Promise.TimeoutError = TimeoutError; + _Promise$1.Promise = Promise; + return _Promise$1; + } + + function _arrayLikeToArray(r, a) { + (null == a || a > r.length) && (a = r.length); + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; + return n; + } + function _createForOfIteratorHelper(r, e) { + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + if (!t) { + if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { + t && (r = t); + var n = 0, + F = function () {}; + return { + s: F, + n: function () { + return n >= r.length ? { + done: true + } : { + done: false, + value: r[n++] + }; + }, + e: function (r) { + throw r; + }, + f: F + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + var o, + a = true, + u = false; + return { + s: function () { + t = t.call(r); + }, + n: function () { + var r = t.next(); + return a = r.done, r; + }, + e: function (r) { + u = true, o = r; + }, + f: function () { + try { + a || null == t.return || t.return(); + } finally { + if (u) throw o; + } + } + }; + } + function _defineProperty(e, r, t) { + return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { + value: t, + enumerable: true, + configurable: true, + writable: true + }) : e[r] = t, e; + } + function ownKeys(e, r) { + var t = Object.keys(e); + if (Object.getOwnPropertySymbols) { + var o = Object.getOwnPropertySymbols(e); + r && (o = o.filter(function (r) { + return Object.getOwnPropertyDescriptor(e, r).enumerable; + })), t.push.apply(t, o); + } + return t; + } + function _objectSpread2(e) { + for (var r = 1; r < arguments.length; r++) { + var t = null != arguments[r] ? arguments[r] : {}; + r % 2 ? ownKeys(Object(t), true).forEach(function (r) { + _defineProperty(e, r, t[r]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); + }); + } + return e; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + function _unsupportedIterableToArray(r, a) { + if (r) { + if ("string" == typeof r) return _arrayLikeToArray(r, a); + var t = {}.toString.call(r).slice(8, -1); + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; + } + } + + var WorkerHandler = {exports: {}}; + + var validateOptions = {}; + + /** + * Validate that the object only contains known option names + * - Throws an error when unknown options are detected + * - Throws an error when some of the allowed options are attached + * @param {Object | undefined} options + * @param {string[]} allowedOptionNames + * @param {string} objectName + * @retrun {Object} Returns the original options + */ + var hasRequiredValidateOptions; + function requireValidateOptions() { + if (hasRequiredValidateOptions) return validateOptions; + hasRequiredValidateOptions = 1; + validateOptions.validateOptions = function validateOptions(options, allowedOptionNames, objectName) { + if (!options) { + return; + } + var optionNames = options ? Object.keys(options) : []; + + // check for unknown properties + var unknownOptionName = optionNames.find(function (optionName) { + return !allowedOptionNames.includes(optionName); + }); + if (unknownOptionName) { + throw new Error('Object "' + objectName + '" contains an unknown option "' + unknownOptionName + '"'); + } + + // check for inherited properties which are not present on the object itself + var illegalOptionName = allowedOptionNames.find(function (allowedOptionName) { + return Object.prototype[allowedOptionName] && !optionNames.includes(allowedOptionName); + }); + if (illegalOptionName) { + throw new Error('Object "' + objectName + '" contains an inherited option "' + illegalOptionName + '" which is ' + 'not defined in the object itself but in its prototype. Only plain objects are allowed. ' + 'Please remove the option from the prototype or override it with a value "undefined".'); + } + return options; + }; + + // source: https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker + validateOptions.workerOptsNames = ['credentials', 'name', 'type']; + + // source: https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options + validateOptions.forkOptsNames = ['cwd', 'detached', 'env', 'execPath', 'execArgv', 'gid', 'serialization', 'signal', 'killSignal', 'silent', 'stdio', 'uid', 'windowsVerbatimArguments', 'timeout']; + + // source: https://nodejs.org/api/worker_threads.html#new-workerfilename-options + validateOptions.workerThreadOptsNames = ['argv', 'env', 'eval', 'execArgv', 'stdin', 'stdout', 'stderr', 'workerData', 'trackUnmanagedFds', 'transferList', 'resourceLimits', 'name']; + return validateOptions; + } + + /** + * embeddedWorker.js contains an embedded version of worker.js. + * This file is automatically generated, + * changes made in this file will be overwritten. + */ + var embeddedWorker; + var hasRequiredEmbeddedWorker; + function requireEmbeddedWorker() { + if (hasRequiredEmbeddedWorker) return embeddedWorker; + hasRequiredEmbeddedWorker = 1; + embeddedWorker = "!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).worker=n()}(this,(function(){\"use strict\";function e(n){return e=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},e(n)}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}var t={};var r=function(e,n){this.message=e,this.transfer=n},o={};function i(e,n){var t=this;if(!(this instanceof i))throw new SyntaxError(\"Constructor must be called with the new operator\");if(\"function\"!=typeof e)throw new SyntaxError(\"Function parameter handler(resolve, reject) missing\");var r=[],o=[];this.resolved=!1,this.rejected=!1,this.pending=!0,this[Symbol.toStringTag]=\"Promise\";var a=function(e,n){r.push(e),o.push(n)};this.then=function(e,n){return new i((function(t,r){var o=e?s(e,t,r):t,i=n?s(n,t,r):r;a(o,i)}),t)};var f=function(e){return t.resolved=!0,t.rejected=!1,t.pending=!1,r.forEach((function(n){n(e)})),a=function(n,t){n(e)},f=d=function(){},t},d=function(e){return t.resolved=!1,t.rejected=!0,t.pending=!1,o.forEach((function(n){n(e)})),a=function(n,t){t(e)},f=d=function(){},t};this.cancel=function(){return n?n.cancel():d(new u),t},this.timeout=function(e){if(n)n.timeout(e);else{var r=setTimeout((function(){d(new c(\"Promise timed out after \"+e+\" ms\"))}),e);t.always((function(){clearTimeout(r)}))}return t},e((function(e){f(e)}),(function(e){d(e)}))}function s(e,n,t){return function(r){try{var o=e(r);o&&\"function\"==typeof o.then&&\"function\"==typeof o.catch?o.then(n,t):n(o)}catch(e){t(e)}}}function u(e){this.message=e||\"promise cancelled\",this.stack=(new Error).stack}function c(e){this.message=e||\"timeout exceeded\",this.stack=(new Error).stack}return i.prototype.catch=function(e){return this.then(null,e)},i.prototype.always=function(e){return this.then(e,e)},i.prototype.finally=function(e){var n=this,t=function(){return new i((function(e){return e()})).then(e).then((function(){return n}))};return this.then(t,t)},i.all=function(e){return new i((function(n,t){var r=e.length,o=[];r?e.forEach((function(e,i){e.then((function(e){o[i]=e,0==--r&&n(o)}),(function(e){r=0,t(e)}))})):n(o)}))},i.defer=function(){var e={};return e.promise=new i((function(n,t){e.resolve=n,e.reject=t})),e},u.prototype=new Error,u.prototype.constructor=Error,u.prototype.name=\"CancellationError\",i.CancellationError=u,c.prototype=new Error,c.prototype.constructor=Error,c.prototype.name=\"TimeoutError\",i.TimeoutError=c,o.Promise=i,function(n){var t=r,i=o.Promise,s=\"__workerpool-cleanup__\",u={exit:function(){}},c={addAbortListener:function(e){u.abortListeners.push(e)},emit:u.emit};if(\"undefined\"!=typeof self&&\"function\"==typeof postMessage&&\"function\"==typeof addEventListener)u.on=function(e,n){addEventListener(e,(function(e){n(e.data)}))},u.send=function(e,n){n?postMessage(e,n):postMessage(e)};else{if(\"undefined\"==typeof process)throw new Error(\"Script must be executed as a worker\");var a;try{a=require(\"worker_threads\")}catch(n){if(\"object\"!==e(n)||null===n||\"MODULE_NOT_FOUND\"!==n.code)throw n}if(a&&null!==a.parentPort){var f=a.parentPort;u.send=f.postMessage.bind(f),u.on=f.on.bind(f),u.exit=process.exit.bind(process)}else u.on=process.on.bind(process),u.send=function(e){process.send(e)},u.on(\"disconnect\",(function(){process.exit(1)})),u.exit=process.exit.bind(process)}function d(e){return e&&e.toJSON?JSON.parse(JSON.stringify(e)):JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)))}function l(e){return e&&\"function\"==typeof e.then&&\"function\"==typeof e.catch}u.methods={},u.methods.run=function(e,n){var t=new Function(\"return (\"+e+\").apply(this, arguments);\");return t.worker=c,t.apply(t,n)},u.methods.methods=function(){return Object.keys(u.methods)},u.terminationHandler=void 0,u.abortListenerTimeout=1e3,u.abortListeners=[],u.terminateAndExit=function(e){var n=function(){u.exit(e)};if(!u.terminationHandler)return n();var t=u.terminationHandler(e);return l(t)?(t.then(n,n),t):(n(),new i((function(e,n){n(new Error(\"Worker terminating\"))})))},u.cleanup=function(e){if(!u.abortListeners.length)return u.send({id:e,method:s,error:d(new Error(\"Worker terminating\"))}),new i((function(e){e()}));var n,t=u.abortListeners.map((function(e){return e()})),r=new i((function(e,t){n=setTimeout((function(){t(new Error(\"Timeout occured waiting for abort handler, killing worker\"))}),u.abortListenerTimeout)})),o=i.all(t).then((function(){clearTimeout(n),u.abortListeners.length||(u.abortListeners=[])}),(function(){clearTimeout(n),u.exit()}));return new i((function(e,n){o.then(e,n),r.then(e,n)})).then((function(){u.send({id:e,method:s,error:null})}),(function(n){u.send({id:e,method:s,error:n?d(n):null})}))};var p=null;u.on(\"message\",(function(e){if(\"__workerpool-terminate__\"===e)return u.terminateAndExit(0);if(e.method===s)return u.cleanup(e.id);try{var n=u.methods[e.method];if(!n)throw new Error('Unknown method \"'+e.method+'\"');p=e.id;var r=n.apply(n,e.params);l(r)?r.then((function(n){n instanceof t?u.send({id:e.id,result:n.message,error:null},n.transfer):u.send({id:e.id,result:n,error:null}),p=null})).catch((function(n){u.send({id:e.id,result:null,error:d(n)}),p=null})):(r instanceof t?u.send({id:e.id,result:r.message,error:null},r.transfer):u.send({id:e.id,result:r,error:null}),p=null)}catch(n){u.send({id:e.id,result:null,error:d(n)})}})),u.register=function(e,n){if(e)for(var t in e)e.hasOwnProperty(t)&&(u.methods[t]=e[t],u.methods[t].worker=c);n&&(u.terminationHandler=n.onTerminate,u.abortListenerTimeout=n.abortListenerTimeout||1e3),u.send(\"ready\")},u.emit=function(e){if(p){if(e instanceof t)return void u.send({id:p,isEvent:!0,payload:e.message},e.transfer);u.send({id:p,isEvent:!0,payload:e})}},n.add=u.register,n.emit=u.emit}(t),n(t)}));\n//# sourceMappingURL=worker.min.js.map\n"; + return embeddedWorker; + } + + var hasRequiredWorkerHandler; + function requireWorkerHandler() { + if (hasRequiredWorkerHandler) return WorkerHandler.exports; + hasRequiredWorkerHandler = 1; + var _require$$ = require_Promise(), + Promise = _require$$.Promise; + var environment = environmentExports; + var _require$$2 = requireValidateOptions(), + validateOptions = _require$$2.validateOptions, + forkOptsNames = _require$$2.forkOptsNames, + workerThreadOptsNames = _require$$2.workerThreadOptsNames, + workerOptsNames = _require$$2.workerOptsNames; + + /** + * Special message sent by parent which causes a child process worker to terminate itself. + * Not a "message object"; this string is the entire message. + */ + var TERMINATE_METHOD_ID = '__workerpool-terminate__'; + + /** + * Special message by parent which causes a child process worker to perform cleaup + * steps before determining if the child process worker should be terminated. + */ + var CLEANUP_METHOD_ID = '__workerpool-cleanup__'; + function ensureWorkerThreads() { + var WorkerThreads = tryRequireWorkerThreads(); + if (!WorkerThreads) { + throw new Error('WorkerPool: workerType = \'thread\' is not supported, Node >= 11.7.0 required'); + } + return WorkerThreads; + } + + // check whether Worker is supported by the browser + function ensureWebWorker() { + // Workaround for a bug in PhantomJS (Or QtWebkit): https://github.com/ariya/phantomjs/issues/14534 + if (typeof Worker !== 'function' && ((typeof Worker === "undefined" ? "undefined" : _typeof(Worker)) !== 'object' || typeof Worker.prototype.constructor !== 'function')) { + throw new Error('WorkerPool: Web Workers not supported'); + } + } + function tryRequireWorkerThreads() { + try { + return require('worker_threads'); + } catch (error) { + if (_typeof(error) === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') { + // no worker_threads available (old version of node.js) + return null; + } else { + throw error; + } + } + } + + // get the default worker script + function getDefaultWorker() { + if (environment.platform === 'browser') { + // test whether the browser supports all features that we need + if (typeof Blob === 'undefined') { + throw new Error('Blob not supported by the browser'); + } + if (!window.URL || typeof window.URL.createObjectURL !== 'function') { + throw new Error('URL.createObjectURL not supported by the browser'); + } + + // use embedded worker.js + var blob = new Blob([requireEmbeddedWorker()], { + type: 'text/javascript' + }); + return window.URL.createObjectURL(blob); + } else { + // use external worker.js in current directory + return __dirname + '/worker.js'; + } + } + function setupWorker(script, options) { + if (options.workerType === 'web') { + // browser only + ensureWebWorker(); + return setupBrowserWorker(script, options.workerOpts, Worker); + } else if (options.workerType === 'thread') { + // node.js only + WorkerThreads = ensureWorkerThreads(); + return setupWorkerThreadWorker(script, WorkerThreads, options); + } else if (options.workerType === 'process' || !options.workerType) { + // node.js only + return setupProcessWorker(script, resolveForkOptions(options), require('child_process')); + } else { + // options.workerType === 'auto' or undefined + if (environment.platform === 'browser') { + ensureWebWorker(); + return setupBrowserWorker(script, options.workerOpts, Worker); + } else { + // environment.platform === 'node' + var WorkerThreads = tryRequireWorkerThreads(); + if (WorkerThreads) { + return setupWorkerThreadWorker(script, WorkerThreads, options); + } else { + return setupProcessWorker(script, resolveForkOptions(options), require('child_process')); + } + } + } + } + function setupBrowserWorker(script, workerOpts, Worker) { + // validate the options right before creating the worker (not when creating the pool) + validateOptions(workerOpts, workerOptsNames, 'workerOpts'); + + // create the web worker + var worker = new Worker(script, workerOpts); + worker.isBrowserWorker = true; + // add node.js API to the web worker + worker.on = function (event, callback) { + this.addEventListener(event, function (message) { + callback(message.data); + }); + }; + worker.send = function (message, transfer) { + this.postMessage(message, transfer); + }; + return worker; + } + function setupWorkerThreadWorker(script, WorkerThreads, options) { + var _options$emitStdStrea, _options$emitStdStrea2; + // validate the options right before creating the worker thread (not when creating the pool) + validateOptions(options === null || options === void 0 ? void 0 : options.workerThreadOpts, workerThreadOptsNames, 'workerThreadOpts'); + var worker = new WorkerThreads.Worker(script, _objectSpread2({ + stdout: (_options$emitStdStrea = options === null || options === void 0 ? void 0 : options.emitStdStreams) !== null && _options$emitStdStrea !== void 0 ? _options$emitStdStrea : false, + // pipe worker.STDOUT to process.STDOUT if not requested + stderr: (_options$emitStdStrea2 = options === null || options === void 0 ? void 0 : options.emitStdStreams) !== null && _options$emitStdStrea2 !== void 0 ? _options$emitStdStrea2 : false + }, options === null || options === void 0 ? void 0 : options.workerThreadOpts)); + worker.isWorkerThread = true; + worker.send = function (message, transfer) { + this.postMessage(message, transfer); + }; + worker.kill = function () { + this.terminate(); + return true; + }; + worker.disconnect = function () { + this.terminate(); + }; + if (options !== null && options !== void 0 && options.emitStdStreams) { + worker.stdout.on('data', function (data) { + return worker.emit("stdout", data); + }); + worker.stderr.on('data', function (data) { + return worker.emit("stderr", data); + }); + } + return worker; + } + function setupProcessWorker(script, options, child_process) { + // validate the options right before creating the child process (not when creating the pool) + validateOptions(options.forkOpts, forkOptsNames, 'forkOpts'); + + // no WorkerThreads, fallback to sub-process based workers + var worker = child_process.fork(script, options.forkArgs, options.forkOpts); + + // ignore transfer argument since it is not supported by process + var send = worker.send; + worker.send = function (message) { + return send.call(worker, message); + }; + if (options.emitStdStreams) { + worker.stdout.on('data', function (data) { + return worker.emit("stdout", data); + }); + worker.stderr.on('data', function (data) { + return worker.emit("stderr", data); + }); + } + worker.isChildProcess = true; + return worker; + } + + // add debug flags to child processes if the node inspector is active + function resolveForkOptions(opts) { + opts = opts || {}; + var processExecArgv = process.execArgv.join(' '); + var inspectorActive = processExecArgv.indexOf('--inspect') !== -1; + var debugBrk = processExecArgv.indexOf('--debug-brk') !== -1; + var execArgv = []; + if (inspectorActive) { + execArgv.push('--inspect=' + opts.debugPort); + if (debugBrk) { + execArgv.push('--debug-brk'); + } + } + process.execArgv.forEach(function (arg) { + if (arg.indexOf('--max-old-space-size') > -1) { + execArgv.push(arg); + } + }); + return Object.assign({}, opts, { + forkArgs: opts.forkArgs, + forkOpts: Object.assign({}, opts.forkOpts, { + execArgv: (opts.forkOpts && opts.forkOpts.execArgv || []).concat(execArgv), + stdio: opts.emitStdStreams ? "pipe" : undefined + }) + }); + } + + /** + * Converts a serialized error to Error + * @param {Object} obj Error that has been serialized and parsed to object + * @return {Error} The equivalent Error. + */ + function objectToError(obj) { + var temp = new Error(''); + var props = Object.keys(obj); + for (var i = 0; i < props.length; i++) { + temp[props[i]] = obj[props[i]]; + } + return temp; + } + function handleEmittedStdPayload(handler, payload) { + // TODO: refactor if parallel task execution gets added + Object.values(handler.processing).forEach(function (task) { + var _task$options; + return task === null || task === void 0 || (_task$options = task.options) === null || _task$options === void 0 ? void 0 : _task$options.on(payload); + }); + Object.values(handler.tracking).forEach(function (task) { + var _task$options2; + return task === null || task === void 0 || (_task$options2 = task.options) === null || _task$options2 === void 0 ? void 0 : _task$options2.on(payload); + }); + } + + /** + * A WorkerHandler controls a single worker. This worker can be a child process + * on node.js or a WebWorker in a browser environment. + * @param {String} [script] If no script is provided, a default worker with a + * function run will be created. + * @param {import('./types.js').WorkerPoolOptions} [_options] See docs + * @constructor + */ + function WorkerHandler$1(script, _options) { + var me = this; + var options = _options || {}; + this.script = script || getDefaultWorker(); + this.worker = setupWorker(this.script, options); + this.debugPort = options.debugPort; + this.forkOpts = options.forkOpts; + this.forkArgs = options.forkArgs; + this.workerOpts = options.workerOpts; + this.workerThreadOpts = options.workerThreadOpts; + this.workerTerminateTimeout = options.workerTerminateTimeout; + + // The ready message is only sent if the worker.add method is called (And the default script is not used) + if (!script) { + this.worker.ready = true; + } + + // queue for requests that are received before the worker is ready + this.requestQueue = []; + this.worker.on("stdout", function (data) { + handleEmittedStdPayload(me, { + "stdout": data.toString() + }); + }); + this.worker.on("stderr", function (data) { + handleEmittedStdPayload(me, { + "stderr": data.toString() + }); + }); + this.worker.on('message', function (response) { + if (me.terminated) { + return; + } + if (typeof response === 'string' && response === 'ready') { + me.worker.ready = true; + dispatchQueuedRequests(); + } else { + // find the task from the processing queue, and run the tasks callback + var id = response.id; + var task = me.processing[id]; + if (task !== undefined) { + if (response.isEvent) { + if (task.options && typeof task.options.on === 'function') { + task.options.on(response.payload); + } + } else { + // remove the task from the queue + delete me.processing[id]; + + // test if we need to terminate + if (me.terminating === true) { + // complete worker termination if all tasks are finished + me.terminate(); + } + + // resolve the task's promise + if (response.error) { + task.resolver.reject(objectToError(response.error)); + } else { + task.resolver.resolve(response.result); + } + } + } else { + // if the task is not the current, it might be tracked for cleanup + var task = me.tracking[id]; + if (task !== undefined) { + if (response.isEvent) { + if (task.options && typeof task.options.on === 'function') { + task.options.on(response.payload); + } + } + } + } + if (response.method === CLEANUP_METHOD_ID) { + var trackedTask = me.tracking[response.id]; + if (trackedTask !== undefined) { + if (response.error) { + clearTimeout(trackedTask.timeoutId); + trackedTask.resolver.reject(objectToError(response.error)); + } else { + me.tracking && clearTimeout(trackedTask.timeoutId); + // if we do not encounter an error wrap the the original timeout error and reject + trackedTask.resolver.reject(new WrappedTimeoutError(trackedTask.error)); + } + } + delete me.tracking[id]; + } + } + }); + + // reject all running tasks on worker error + function onError(error) { + me.terminated = true; + for (var id in me.processing) { + if (me.processing[id] !== undefined) { + me.processing[id].resolver.reject(error); + } + } + me.processing = Object.create(null); + } + + // send all queued requests to worker + function dispatchQueuedRequests() { + var _iterator = _createForOfIteratorHelper(me.requestQueue.splice(0)), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var request = _step.value; + me.worker.send(request.message, request.transfer); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + var worker = this.worker; + // listen for worker messages error and exit + this.worker.on('error', onError); + this.worker.on('exit', function (exitCode, signalCode) { + var message = 'Workerpool Worker terminated Unexpectedly\n'; + message += ' exitCode: `' + exitCode + '`\n'; + message += ' signalCode: `' + signalCode + '`\n'; + message += ' workerpool.script: `' + me.script + '`\n'; + message += ' spawnArgs: `' + worker.spawnargs + '`\n'; + message += ' spawnfile: `' + worker.spawnfile + '`\n'; + message += ' stdout: `' + worker.stdout + '`\n'; + message += ' stderr: `' + worker.stderr + '`\n'; + onError(new Error(message)); + }); + this.processing = Object.create(null); // queue with tasks currently in progress + this.tracking = Object.create(null); // queue with tasks being monitored for cleanup status + this.terminating = false; + this.terminated = false; + this.cleaning = false; + this.terminationHandler = null; + this.lastId = 0; + } + + /** + * Get a list with methods available on the worker. + * @return {Promise.} methods + */ + WorkerHandler$1.prototype.methods = function () { + return this.exec('methods'); + }; + + /** + * Execute a method with given parameters on the worker + * @param {String} method + * @param {Array} [params] + * @param {{resolve: Function, reject: Function}} [resolver] + * @param {import('./types.js').ExecOptions} [options] + * @return {Promise.<*, Error>} result + */ + WorkerHandler$1.prototype.exec = function (method, params, resolver, options) { + if (!resolver) { + resolver = Promise.defer(); + } + + // generate a unique id for the task + var id = ++this.lastId; + + // register a new task as being in progress + this.processing[id] = { + id: id, + resolver: resolver, + options: options + }; + + // build a JSON-RPC request + var request = { + message: { + id: id, + method: method, + params: params + }, + transfer: options && options.transfer + }; + if (this.terminated) { + resolver.reject(new Error('Worker is terminated')); + } else if (this.worker.ready) { + // send the request to the worker + this.worker.send(request.message, request.transfer); + } else { + this.requestQueue.push(request); + } + + // on cancellation, force the worker to terminate + var me = this; + return resolver.promise.catch(function (error) { + if (error instanceof Promise.CancellationError || error instanceof Promise.TimeoutError) { + me.tracking[id] = { + id: id, + resolver: Promise.defer(), + options: options, + error: error + }; + + // remove this task from the queue. It is already rejected (hence this + // catch event), and else it will be rejected again when terminating + delete me.processing[id]; + me.tracking[id].resolver.promise = me.tracking[id].resolver.promise.catch(function (err) { + delete me.tracking[id]; + + // if we find the error is an instance of WrappedTimeoutError we know the error should not cause termination + // as the response from the worker did not contain an error. We still wish to throw the original timeout error + // to the caller. + if (err instanceof WrappedTimeoutError) { + throw err.error; + } + var promise = me.terminateAndNotify(true).then(function () { + throw err; + }, function (err) { + throw err; + }); + return promise; + }); + me.worker.send({ + id: id, + method: CLEANUP_METHOD_ID + }); + + /** + * Sets a timeout to reject the cleanup operation if the message sent to the worker + * does not receive a response. see worker.tryCleanup for worker cleanup operations. + * Here we use the workerTerminateTimeout as the worker will be terminated if the timeout does invoke. + * + * We need this timeout in either case of a Timeout or Cancellation Error as if + * the worker does not send a message we still need to give a window of time for a response. + * + * The workerTermniateTimeout is used here if this promise is rejected the worker cleanup + * operations will occure. + */ + me.tracking[id].timeoutId = setTimeout(function () { + me.tracking[id].resolver.reject(error); + }, me.workerTerminateTimeout); + return me.tracking[id].resolver.promise; + } else { + throw error; + } + }); + }; + + /** + * Test whether the worker is processing any tasks or cleaning up before termination. + * @return {boolean} Returns true if the worker is busy + */ + WorkerHandler$1.prototype.busy = function () { + return this.cleaning || Object.keys(this.processing).length > 0; + }; + + /** + * Terminate the worker. + * @param {boolean} [force=false] If false (default), the worker is terminated + * after finishing all tasks currently in + * progress. If true, the worker will be + * terminated immediately. + * @param {function} [callback=null] If provided, will be called when process terminates. + */ + WorkerHandler$1.prototype.terminate = function (force, callback) { + var me = this; + if (force) { + // cancel all tasks in progress + for (var id in this.processing) { + if (this.processing[id] !== undefined) { + this.processing[id].resolver.reject(new Error('Worker terminated')); + } + } + this.processing = Object.create(null); + } + + // If we are terminating, cancel all tracked task for cleanup + for (var _i = 0, _Object$values = Object.values(me.tracking); _i < _Object$values.length; _i++) { + var task = _Object$values[_i]; + clearTimeout(task.timeoutId); + task.resolver.reject(new Error('Worker Terminating')); + } + me.tracking = Object.create(null); + if (typeof callback === 'function') { + this.terminationHandler = callback; + } + if (!this.busy()) { + // all tasks are finished. kill the worker + var cleanup = function cleanup(err) { + me.terminated = true; + me.cleaning = false; + if (me.worker != null && me.worker.removeAllListeners) { + // removeAllListeners is only available for child_process + me.worker.removeAllListeners('message'); + } + me.worker = null; + me.terminating = false; + if (me.terminationHandler) { + me.terminationHandler(err, me); + } else if (err) { + throw err; + } + }; + if (this.worker) { + if (typeof this.worker.kill === 'function') { + if (this.worker.killed) { + cleanup(new Error('worker already killed!')); + return; + } + + // child process and worker threads + var cleanExitTimeout = setTimeout(function () { + if (me.worker) { + me.worker.kill(); + } + }, this.workerTerminateTimeout); + this.worker.once('exit', function () { + clearTimeout(cleanExitTimeout); + if (me.worker) { + me.worker.killed = true; + } + cleanup(); + }); + if (this.worker.ready) { + this.worker.send(TERMINATE_METHOD_ID); + } else { + this.requestQueue.push({ + message: TERMINATE_METHOD_ID + }); + } + + // mark that the worker is cleaning up resources + // to prevent new tasks from being executed + this.cleaning = true; + return; + } else if (typeof this.worker.terminate === 'function') { + this.worker.terminate(); // web worker + this.worker.killed = true; + } else { + throw new Error('Failed to terminate worker'); + } + } + cleanup(); + } else { + // we can't terminate immediately, there are still tasks being executed + this.terminating = true; + } + }; + + /** + * Terminate the worker, returning a Promise that resolves when the termination has been done. + * @param {boolean} [force=false] If false (default), the worker is terminated + * after finishing all tasks currently in + * progress. If true, the worker will be + * terminated immediately. + * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected + * after timeout if worker process has not been terminated. + * @return {Promise.} + */ + WorkerHandler$1.prototype.terminateAndNotify = function (force, timeout) { + var resolver = Promise.defer(); + if (timeout) { + resolver.promise.timeout(timeout); + } + this.terminate(force, function (err, worker) { + if (err) { + resolver.reject(err); + } else { + resolver.resolve(worker); + } + }); + return resolver.promise; + }; + + /** + * Wrapper error type to denote that a TimeoutError has already been proceesed + * and we should skip cleanup operations + * @param {Promise.TimeoutError} timeoutError + */ + function WrappedTimeoutError(timeoutError) { + this.error = timeoutError; + this.stack = new Error().stack; + } + WorkerHandler.exports = WorkerHandler$1; + WorkerHandler.exports._tryRequireWorkerThreads = tryRequireWorkerThreads; + WorkerHandler.exports._setupProcessWorker = setupProcessWorker; + WorkerHandler.exports._setupBrowserWorker = setupBrowserWorker; + WorkerHandler.exports._setupWorkerThreadWorker = setupWorkerThreadWorker; + WorkerHandler.exports.ensureWorkerThreads = ensureWorkerThreads; + return WorkerHandler.exports; + } + + var debugPortAllocator; + var hasRequiredDebugPortAllocator; + function requireDebugPortAllocator() { + if (hasRequiredDebugPortAllocator) return debugPortAllocator; + hasRequiredDebugPortAllocator = 1; + var MAX_PORTS = 65535; + debugPortAllocator = DebugPortAllocator; + function DebugPortAllocator() { + this.ports = Object.create(null); + this.length = 0; + } + DebugPortAllocator.prototype.nextAvailableStartingAt = function (starting) { + while (this.ports[starting] === true) { + starting++; + } + if (starting >= MAX_PORTS) { + throw new Error('WorkerPool debug port limit reached: ' + starting + '>= ' + MAX_PORTS); + } + this.ports[starting] = true; + this.length++; + return starting; + }; + DebugPortAllocator.prototype.releasePort = function (port) { + delete this.ports[port]; + this.length--; + }; + return debugPortAllocator; + } + + var Pool_1; + var hasRequiredPool; + function requirePool() { + if (hasRequiredPool) return Pool_1; + hasRequiredPool = 1; + var _require$$ = require_Promise(), + Promise = _require$$.Promise; + var WorkerHandler = requireWorkerHandler(); + var environment = environmentExports; + var DebugPortAllocator = requireDebugPortAllocator(); + var DEBUG_PORT_ALLOCATOR = new DebugPortAllocator(); + /** + * A pool to manage workers, which can be created using the function workerpool.pool. + * + * @param {String} [script] Optional worker script + * @param {import('./types.js').WorkerPoolOptions} [options] See docs + * @constructor + */ + function Pool(script, options) { + if (typeof script === 'string') { + /** @readonly */ + this.script = script || null; + } else { + this.script = null; + options = script; + } + + /** @private */ + this.workers = []; // queue with all workers + /** @private */ + this.tasks = []; // queue with tasks awaiting execution + + options = options || {}; + + /** @readonly */ + this.forkArgs = Object.freeze(options.forkArgs || []); + /** @readonly */ + this.forkOpts = Object.freeze(options.forkOpts || {}); + /** @readonly */ + this.workerOpts = Object.freeze(options.workerOpts || {}); + /** @readonly */ + this.workerThreadOpts = Object.freeze(options.workerThreadOpts || {}); + /** @private */ + this.debugPortStart = options.debugPortStart || 43210; + /** @readonly @deprecated */ + this.nodeWorker = options.nodeWorker; + /** @readonly + * @type {'auto' | 'web' | 'process' | 'thread'} + */ + this.workerType = options.workerType || options.nodeWorker || 'auto'; + /** @readonly */ + this.maxQueueSize = options.maxQueueSize || Infinity; + /** @readonly */ + this.workerTerminateTimeout = options.workerTerminateTimeout || 1000; + + /** @readonly */ + this.onCreateWorker = options.onCreateWorker || function () { + return null; + }; + /** @readonly */ + this.onTerminateWorker = options.onTerminateWorker || function () { + return null; + }; + + /** @readonly */ + this.emitStdStreams = options.emitStdStreams || false; + + // configuration + if (options && 'maxWorkers' in options) { + validateMaxWorkers(options.maxWorkers); + /** @readonly */ + this.maxWorkers = options.maxWorkers; + } else { + this.maxWorkers = Math.max((environment.cpus || 4) - 1, 1); + } + if (options && 'minWorkers' in options) { + if (options.minWorkers === 'max') { + /** @readonly */ + this.minWorkers = this.maxWorkers; + } else { + validateMinWorkers(options.minWorkers); + this.minWorkers = options.minWorkers; + this.maxWorkers = Math.max(this.minWorkers, this.maxWorkers); // in case minWorkers is higher than maxWorkers + } + this._ensureMinWorkers(); + } + + /** @private */ + this._boundNext = this._next.bind(this); + if (this.workerType === 'thread') { + WorkerHandler.ensureWorkerThreads(); + } + } + + /** + * Execute a function on a worker. + * + * Example usage: + * + * var pool = new Pool() + * + * // call a function available on the worker + * pool.exec('fibonacci', [6]) + * + * // offload a function + * function add(a, b) { + * return a + b + * }; + * pool.exec(add, [2, 4]) + * .then(function (result) { + * console.log(result); // outputs 6 + * }) + * .catch(function(error) { + * console.log(error); + * }); + * @template { (...args: any[]) => any } T + * @param {String | T} method Function name or function. + * If `method` is a string, the corresponding + * method on the worker will be executed + * If `method` is a Function, the function + * will be stringified and executed via the + * workers built-in function `run(fn, args)`. + * @param {Parameters | null} [params] Function arguments applied when calling the function + * @param {import('./types.js').ExecOptions} [options] Options + * @return {Promise>} + */ + Pool.prototype.exec = function (method, params, options) { + // validate type of arguments + if (params && !Array.isArray(params)) { + throw new TypeError('Array expected as argument "params"'); + } + if (typeof method === 'string') { + var resolver = Promise.defer(); + if (this.tasks.length >= this.maxQueueSize) { + throw new Error('Max queue size of ' + this.maxQueueSize + ' reached'); + } + + // add a new task to the queue + var tasks = this.tasks; + var task = { + method: method, + params: params, + resolver: resolver, + timeout: null, + options: options + }; + tasks.push(task); + + // replace the timeout method of the Promise with our own, + // which starts the timer as soon as the task is actually started + var originalTimeout = resolver.promise.timeout; + resolver.promise.timeout = function timeout(delay) { + if (tasks.indexOf(task) !== -1) { + // task is still queued -> start the timer later on + task.timeout = delay; + return resolver.promise; + } else { + // task is already being executed -> start timer immediately + return originalTimeout.call(resolver.promise, delay); + } + }; + + // trigger task execution + this._next(); + return resolver.promise; + } else if (typeof method === 'function') { + // send stringified function and function arguments to worker + return this.exec('run', [String(method), params], options); + } else { + throw new TypeError('Function or string expected as argument "method"'); + } + }; + + /** + * Create a proxy for current worker. Returns an object containing all + * methods available on the worker. All methods return promises resolving the methods result. + * @template { { [k: string]: (...args: any[]) => any } } T + * @return {Promise, Error>} Returns a promise which resolves with a proxy object + */ + Pool.prototype.proxy = function () { + if (arguments.length > 0) { + throw new Error('No arguments expected'); + } + var pool = this; + return this.exec('methods').then(function (methods) { + var proxy = {}; + methods.forEach(function (method) { + proxy[method] = function () { + return pool.exec(method, Array.prototype.slice.call(arguments)); + }; + }); + return proxy; + }); + }; + + /** + * Creates new array with the results of calling a provided callback function + * on every element in this array. + * @param {Array} array + * @param {function} callback Function taking two arguments: + * `callback(currentValue, index)` + * @return {Promise.} Returns a promise which resolves with an Array + * containing the results of the callback function + * executed for each of the array elements. + */ + /* TODO: implement map + Pool.prototype.map = function (array, callback) { + }; + */ + + /** + * Grab the first task from the queue, find a free worker, and assign the + * worker to the task. + * @private + */ + Pool.prototype._next = function () { + if (this.tasks.length > 0) { + // there are tasks in the queue + + // find an available worker + var worker = this._getWorker(); + if (worker) { + // get the first task from the queue + var me = this; + var task = this.tasks.shift(); + + // check if the task is still pending (and not cancelled -> promise rejected) + if (task.resolver.promise.pending) { + // send the request to the worker + var promise = worker.exec(task.method, task.params, task.resolver, task.options).then(me._boundNext).catch(function () { + // if the worker crashed and terminated, remove it from the pool + if (worker.terminated) { + return me._removeWorker(worker); + } + }).then(function () { + me._next(); // trigger next task in the queue + }); + + // start queued timer now + if (typeof task.timeout === 'number') { + promise.timeout(task.timeout); + } + } else { + // The task taken was already complete (either rejected or resolved), so just trigger next task in the queue + me._next(); + } + } + } + }; + + /** + * Get an available worker. If no worker is available and the maximum number + * of workers isn't yet reached, a new worker will be created and returned. + * If no worker is available and the maximum number of workers is reached, + * null will be returned. + * + * @return {WorkerHandler | null} worker + * @private + */ + Pool.prototype._getWorker = function () { + // find a non-busy worker + var workers = this.workers; + for (var i = 0; i < workers.length; i++) { + var worker = workers[i]; + if (worker.busy() === false) { + return worker; + } + } + if (workers.length < this.maxWorkers) { + // create a new worker + worker = this._createWorkerHandler(); + workers.push(worker); + return worker; + } + return null; + }; + + /** + * Remove a worker from the pool. + * Attempts to terminate worker if not already terminated, and ensures the minimum + * pool size is met. + * @param {WorkerHandler} worker + * @return {Promise} + * @private + */ + Pool.prototype._removeWorker = function (worker) { + var me = this; + DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort); + // _removeWorker will call this, but we need it to be removed synchronously + this._removeWorkerFromList(worker); + // If minWorkers set, spin up new workers to replace the crashed ones + this._ensureMinWorkers(); + // terminate the worker (if not already terminated) + return new Promise(function (resolve, reject) { + worker.terminate(false, function (err) { + me.onTerminateWorker({ + forkArgs: worker.forkArgs, + forkOpts: worker.forkOpts, + workerThreadOpts: worker.workerThreadOpts, + script: worker.script + }); + if (err) { + reject(err); + } else { + resolve(worker); + } + }); + }); + }; + + /** + * Remove a worker from the pool list. + * @param {WorkerHandler} worker + * @private + */ + Pool.prototype._removeWorkerFromList = function (worker) { + // remove from the list with workers + var index = this.workers.indexOf(worker); + if (index !== -1) { + this.workers.splice(index, 1); + } + }; + + /** + * Close all active workers. Tasks currently being executed will be finished first. + * @param {boolean} [force=false] If false (default), the workers are terminated + * after finishing all tasks currently in + * progress. If true, the workers will be + * terminated immediately. + * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected + * after timeout if worker process has not been terminated. + * @return {Promise.} + */ + Pool.prototype.terminate = function (force, timeout) { + var me = this; + + // cancel any pending tasks + this.tasks.forEach(function (task) { + task.resolver.reject(new Error('Pool terminated')); + }); + this.tasks.length = 0; + var f = function f(worker) { + DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort); + this._removeWorkerFromList(worker); + }; + var removeWorker = f.bind(this); + var promises = []; + var workers = this.workers.slice(); + workers.forEach(function (worker) { + var termPromise = worker.terminateAndNotify(force, timeout).then(removeWorker).always(function () { + me.onTerminateWorker({ + forkArgs: worker.forkArgs, + forkOpts: worker.forkOpts, + workerThreadOpts: worker.workerThreadOpts, + script: worker.script + }); + }); + promises.push(termPromise); + }); + return Promise.all(promises); + }; + + /** + * Retrieve statistics on tasks and workers. + * @return {{totalWorkers: number, busyWorkers: number, idleWorkers: number, pendingTasks: number, activeTasks: number}} Returns an object with statistics + */ + Pool.prototype.stats = function () { + var totalWorkers = this.workers.length; + var busyWorkers = this.workers.filter(function (worker) { + return worker.busy(); + }).length; + return { + totalWorkers: totalWorkers, + busyWorkers: busyWorkers, + idleWorkers: totalWorkers - busyWorkers, + pendingTasks: this.tasks.length, + activeTasks: busyWorkers + }; + }; + + /** + * Ensures that a minimum of minWorkers is up and running + * @private + */ + Pool.prototype._ensureMinWorkers = function () { + if (this.minWorkers) { + for (var i = this.workers.length; i < this.minWorkers; i++) { + this.workers.push(this._createWorkerHandler()); + } + } + }; + + /** + * Helper function to create a new WorkerHandler and pass all options. + * @return {WorkerHandler} + * @private + */ + Pool.prototype._createWorkerHandler = function () { + var overriddenParams = this.onCreateWorker({ + forkArgs: this.forkArgs, + forkOpts: this.forkOpts, + workerOpts: this.workerOpts, + workerThreadOpts: this.workerThreadOpts, + script: this.script + }) || {}; + return new WorkerHandler(overriddenParams.script || this.script, { + forkArgs: overriddenParams.forkArgs || this.forkArgs, + forkOpts: overriddenParams.forkOpts || this.forkOpts, + workerOpts: overriddenParams.workerOpts || this.workerOpts, + workerThreadOpts: overriddenParams.workerThreadOpts || this.workerThreadOpts, + debugPort: DEBUG_PORT_ALLOCATOR.nextAvailableStartingAt(this.debugPortStart), + workerType: this.workerType, + workerTerminateTimeout: this.workerTerminateTimeout, + emitStdStreams: this.emitStdStreams + }); + }; + + /** + * Ensure that the maxWorkers option is an integer >= 1 + * @param {*} maxWorkers + * @returns {boolean} returns true maxWorkers has a valid value + */ + function validateMaxWorkers(maxWorkers) { + if (!isNumber(maxWorkers) || !isInteger(maxWorkers) || maxWorkers < 1) { + throw new TypeError('Option maxWorkers must be an integer number >= 1'); + } + } + + /** + * Ensure that the minWorkers option is an integer >= 0 + * @param {*} minWorkers + * @returns {boolean} returns true when minWorkers has a valid value + */ + function validateMinWorkers(minWorkers) { + if (!isNumber(minWorkers) || !isInteger(minWorkers) || minWorkers < 0) { + throw new TypeError('Option minWorkers must be an integer number >= 0'); + } + } + + /** + * Test whether a variable is a number + * @param {*} value + * @returns {boolean} returns true when value is a number + */ + function isNumber(value) { + return typeof value === 'number'; + } + + /** + * Test whether a number is an integer + * @param {number} value + * @returns {boolean} Returns true if value is an integer + */ + function isInteger(value) { + return Math.round(value) == value; + } + Pool_1 = Pool; + return Pool_1; + } + + var worker$1 = {}; + + /** + * The helper class for transferring data from the worker to the main thread. + * + * @param {Object} message The object to deliver to the main thread. + * @param {Object[]} transfer An array of transferable Objects to transfer ownership of. + */ + var transfer; + var hasRequiredTransfer; + function requireTransfer() { + if (hasRequiredTransfer) return transfer; + hasRequiredTransfer = 1; + function Transfer(message, transfer) { + this.message = message; + this.transfer = transfer; + } + transfer = Transfer; + return transfer; + } + + var hasRequiredWorker; + function requireWorker() { + if (hasRequiredWorker) return worker$1; + hasRequiredWorker = 1; + (function (exports) { + var Transfer = requireTransfer(); + + /** + * worker must handle async cleanup handlers. Use custom Promise implementation. + */ + var Promise = require_Promise().Promise; + /** + * Special message sent by parent which causes the worker to terminate itself. + * Not a "message object"; this string is the entire message. + */ + var TERMINATE_METHOD_ID = '__workerpool-terminate__'; + + /** + * Special message by parent which causes a child process worker to perform cleaup + * steps before determining if the child process worker should be terminated. + */ + var CLEANUP_METHOD_ID = '__workerpool-cleanup__'; + // var nodeOSPlatform = require('./environment').nodeOSPlatform; + + var TIMEOUT_DEFAULT = 1000; + + // create a worker API for sending and receiving messages which works both on + // node.js and in the browser + var worker = { + exit: function exit() {} + }; + + // api for in worker communication with parent process + // works in both node.js and the browser + var publicWorker = { + /** + * Registers listeners which will trigger when a task is timed out or cancled. If all listeners resolve, the worker executing the given task will not be terminated. + * *Note*: If there is a blocking operation within a listener, the worker will be terminated. + * @param {() => Promise} listener + */ + addAbortListener: function addAbortListener(listener) { + worker.abortListeners.push(listener); + }, + /** + * Emit an event from the worker thread to the main thread. + * @param {any} payload + */ + emit: worker.emit + }; + if (typeof self !== 'undefined' && typeof postMessage === 'function' && typeof addEventListener === 'function') { + // worker in the browser + worker.on = function (event, callback) { + addEventListener(event, function (message) { + callback(message.data); + }); + }; + worker.send = function (message, transfer) { + transfer ? postMessage(message, transfer) : postMessage(message); + }; + } else if (typeof process !== 'undefined') { + // node.js + + var WorkerThreads; + try { + WorkerThreads = require('worker_threads'); + } catch (error) { + if (_typeof(error) === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') ; else { + throw error; + } + } + if (WorkerThreads && /* if there is a parentPort, we are in a WorkerThread */ + WorkerThreads.parentPort !== null) { + var parentPort = WorkerThreads.parentPort; + worker.send = parentPort.postMessage.bind(parentPort); + worker.on = parentPort.on.bind(parentPort); + worker.exit = process.exit.bind(process); + } else { + worker.on = process.on.bind(process); + // ignore transfer argument since it is not supported by process + worker.send = function (message) { + process.send(message); + }; + // register disconnect handler only for subprocess worker to exit when parent is killed unexpectedly + worker.on('disconnect', function () { + process.exit(1); + }); + worker.exit = process.exit.bind(process); + } + } else { + throw new Error('Script must be executed as a worker'); + } + function convertError(error) { + if (error && error.toJSON) { + return JSON.parse(JSON.stringify(error)); + } + + // turn a class like Error (having non-enumerable properties) into a plain object + return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error))); + } + + /** + * Test whether a value is a Promise via duck typing. + * @param {*} value + * @returns {boolean} Returns true when given value is an object + * having functions `then` and `catch`. + */ + function isPromise(value) { + return value && typeof value.then === 'function' && typeof value.catch === 'function'; + } + + // functions available externally + worker.methods = {}; + + /** + * Execute a function with provided arguments + * @param {String} fn Stringified function + * @param {Array} [args] Function arguments + * @returns {*} + */ + worker.methods.run = function run(fn, args) { + var f = new Function('return (' + fn + ').apply(this, arguments);'); + f.worker = publicWorker; + return f.apply(f, args); + }; + + /** + * Get a list with methods available on this worker + * @return {String[]} methods + */ + worker.methods.methods = function methods() { + return Object.keys(worker.methods); + }; + + /** + * Custom handler for when the worker is terminated. + */ + worker.terminationHandler = undefined; + worker.abortListenerTimeout = TIMEOUT_DEFAULT; + + /** + * Abort handlers for resolving errors which may cause a timeout or cancellation + * to occur from a worker context + */ + worker.abortListeners = []; + + /** + * Cleanup and exit the worker. + * @param {Number} code + * @returns {Promise} + */ + worker.terminateAndExit = function (code) { + var _exit = function _exit() { + worker.exit(code); + }; + if (!worker.terminationHandler) { + return _exit(); + } + var result = worker.terminationHandler(code); + if (isPromise(result)) { + result.then(_exit, _exit); + return result; + } else { + _exit(); + return new Promise(function (_resolve, reject) { + reject(new Error("Worker terminating")); + }); + } + }; + + /** + * Called within the worker message handler to run abort handlers if registered to perform cleanup operations. + * @param {Integer} [requestId] id of task which is currently executing in the worker + * @return {Promise} + */ + worker.cleanup = function (requestId) { + if (!worker.abortListeners.length) { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: convertError(new Error('Worker terminating')) + }); + + // If there are no handlers registered, reject the promise with an error as we want the handler to be notified + // that cleanup should begin and the handler should be GCed. + return new Promise(function (resolve) { + resolve(); + }); + } + var _exit = function _exit() { + worker.exit(); + }; + var _abort = function _abort() { + if (!worker.abortListeners.length) { + worker.abortListeners = []; + } + }; + var promises = worker.abortListeners.map(function (listener) { + return listener(); + }); + var timerId; + var timeoutPromise = new Promise(function (_resolve, reject) { + timerId = setTimeout(function () { + reject(new Error('Timeout occured waiting for abort handler, killing worker')); + }, worker.abortListenerTimeout); + }); + + // Once a promise settles we need to clear the timeout to prevet fulfulling the promise twice + var settlePromise = Promise.all(promises).then(function () { + clearTimeout(timerId); + _abort(); + }, function () { + clearTimeout(timerId); + _exit(); + }); + + // Returns a promise which will result in one of the following cases + // - Resolve once all handlers resolve + // - Reject if one or more handlers exceed the 'abortListenerTimeout' interval + // - Reject if one or more handlers reject + // Upon one of the above cases a message will be sent to the handler with the result of the handler execution + // which will either kill the worker if the result contains an error, or keep it in the pool if the result + // does not contain an error. + return new Promise(function (resolve, reject) { + settlePromise.then(resolve, reject); + timeoutPromise.then(resolve, reject); + }).then(function () { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: null + }); + }, function (err) { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: err ? convertError(err) : null + }); + }); + }; + var currentRequestId = null; + worker.on('message', function (request) { + if (request === TERMINATE_METHOD_ID) { + return worker.terminateAndExit(0); + } + if (request.method === CLEANUP_METHOD_ID) { + return worker.cleanup(request.id); + } + try { + var method = worker.methods[request.method]; + if (method) { + currentRequestId = request.id; + + // execute the function + var result = method.apply(method, request.params); + if (isPromise(result)) { + // promise returned, resolve this and then return + result.then(function (result) { + if (result instanceof Transfer) { + worker.send({ + id: request.id, + result: result.message, + error: null + }, result.transfer); + } else { + worker.send({ + id: request.id, + result: result, + error: null + }); + } + currentRequestId = null; + }).catch(function (err) { + worker.send({ + id: request.id, + result: null, + error: convertError(err) + }); + currentRequestId = null; + }); + } else { + // immediate result + if (result instanceof Transfer) { + worker.send({ + id: request.id, + result: result.message, + error: null + }, result.transfer); + } else { + worker.send({ + id: request.id, + result: result, + error: null + }); + } + currentRequestId = null; + } + } else { + throw new Error('Unknown method "' + request.method + '"'); + } + } catch (err) { + worker.send({ + id: request.id, + result: null, + error: convertError(err) + }); + } + }); + + /** + * Register methods to the worker + * @param {Object} [methods] + * @param {import('./types.js').WorkerRegisterOptions} [options] + */ + worker.register = function (methods, options) { + if (methods) { + for (var name in methods) { + if (methods.hasOwnProperty(name)) { + worker.methods[name] = methods[name]; + worker.methods[name].worker = publicWorker; + } + } + } + if (options) { + worker.terminationHandler = options.onTerminate; + // register listener timeout or default to 1 second + worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT; + } + worker.send('ready'); + }; + worker.emit = function (payload) { + if (currentRequestId) { + if (payload instanceof Transfer) { + worker.send({ + id: currentRequestId, + isEvent: true, + payload: payload.message + }, payload.transfer); + return; + } + worker.send({ + id: currentRequestId, + isEvent: true, + payload: payload + }); + } + }; + { + exports.add = worker.register; + exports.emit = worker.emit; + } + })(worker$1); + return worker$1; + } + + var platform = environmentExports.platform, + isMainThread = environmentExports.isMainThread, + cpus = environmentExports.cpus; + + /** @typedef {import("./Pool")} Pool */ + /** @typedef {import("./types.js").WorkerPoolOptions} WorkerPoolOptions */ + /** @typedef {import("./types.js").WorkerRegisterOptions} WorkerRegisterOptions */ + + /** + * @template { { [k: string]: (...args: any[]) => any } } T + * @typedef {import('./types.js').Proxy} Proxy + */ + + /** + * @overload + * Create a new worker pool + * @param {WorkerPoolOptions} [script] + * @returns {Pool} pool + */ + /** + * @overload + * Create a new worker pool + * @param {string} [script] + * @param {WorkerPoolOptions} [options] + * @returns {Pool} pool + */ + function pool(script, options) { + var Pool = requirePool(); + return new Pool(script, options); + } + var pool_1 = src.pool = pool; + + /** + * Create a worker and optionally register a set of methods to the worker. + * @param {{ [k: string]: (...args: any[]) => any }} [methods] + * @param {WorkerRegisterOptions} [options] + */ + function worker(methods, options) { + var worker = requireWorker(); + worker.add(methods, options); + } + var worker_1 = src.worker = worker; + + /** + * Sends an event to the parent worker pool. + * @param {any} payload + */ + function workerEmit(payload) { + var worker = requireWorker(); + worker.emit(payload); + } + var workerEmit_1 = src.workerEmit = workerEmit; + var _require$$ = require_Promise(), + Promise$1 = _require$$.Promise; + var _Promise = src.Promise = Promise$1; + var Transfer = src.Transfer = requireTransfer(); + var platform_1 = src.platform = platform; + var isMainThread_1 = src.isMainThread = isMainThread; + var cpus_1 = src.cpus = cpus; + + exports.Promise = _Promise; + exports.Transfer = Transfer; + exports.cpus = cpus_1; + exports.default = src; + exports.isMainThread = isMainThread_1; + exports.platform = platform_1; + exports.pool = pool_1; + exports.worker = worker_1; + exports.workerEmit = workerEmit_1; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=workerpool.js.map diff --git a/node_modules/workerpool/dist/workerpool.js.map b/node_modules/workerpool/dist/workerpool.js.map new file mode 100644 index 0000000..dff072c --- /dev/null +++ b/node_modules/workerpool/dist/workerpool.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workerpool.js","sources":["../src/environment.js","../src/Promise.js","../src/validateOptions.js","../src/generated/embeddedWorker.js","../src/WorkerHandler.js","../src/debug-port-allocator.js","../src/Pool.js","../src/transfer.js","../src/worker.js","../src/index.js"],"sourcesContent":["\n// source: https://github.com/flexdinesh/browser-or-node\n// source: https://github.com/mozilla/pdf.js/blob/7ea0e40e588864cd938d1836ec61f1928d3877d3/src/shared/util.js#L24\nvar isNode = function (nodeProcess) {\n return (\n typeof nodeProcess !== 'undefined' &&\n nodeProcess.versions != null &&\n nodeProcess.versions.node != null &&\n nodeProcess + '' === '[object process]'\n );\n}\nmodule.exports.isNode = isNode\n\n// determines the JavaScript platform: browser or node\nmodule.exports.platform = typeof process !== 'undefined' && isNode(process)\n ? 'node'\n : 'browser';\n\n// determines whether the code is running in main thread or not\n// note that in node.js we have to check both worker_thread and child_process\nvar worker_threads = module.exports.platform === 'node' && require('worker_threads');\nmodule.exports.isMainThread = module.exports.platform === 'node'\n ? ((!worker_threads || worker_threads.isMainThread) && !process.connected)\n : typeof Window !== 'undefined';\n\n// determines the number of cpus available\nmodule.exports.cpus = module.exports.platform === 'browser'\n ? self.navigator.hardwareConcurrency\n : require('os').cpus().length;\n\n","'use strict';\n\n/**\n * Promise\n *\n * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa \n * @template T\n * @template [E=Error]\n * @param {Function} handler Called as handler(resolve: Function, reject: Function)\n * @param {Promise} [parent] Parent promise for propagation of cancel and timeout\n */\nfunction Promise(handler, parent) {\n var me = this;\n\n if (!(this instanceof Promise)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n if (typeof handler !== 'function') {\n throw new SyntaxError('Function parameter handler(resolve, reject) missing');\n }\n\n var _onSuccess = [];\n var _onFail = [];\n\n // status\n /**\n * @readonly\n */\n this.resolved = false;\n /**\n * @readonly\n */\n this.rejected = false;\n /**\n * @readonly\n */\n this.pending = true;\n /**\n * @readonly\n */\n this[Symbol.toStringTag] = 'Promise';\n\n /**\n * Process onSuccess and onFail callbacks: add them to the queue.\n * Once the promise is resolved, the function _promise is replace.\n * @param {Function} onSuccess\n * @param {Function} onFail\n * @private\n */\n var _process = function (onSuccess, onFail) {\n _onSuccess.push(onSuccess);\n _onFail.push(onFail);\n };\n\n /**\n * Add an onSuccess callback and optionally an onFail callback to the Promise\n * @template TT\n * @template [TE=never]\n * @param {(r: T) => TT | PromiseLike} onSuccess\n * @param {(r: E) => TE | PromiseLike} [onFail]\n * @returns {Promise} promise\n */\n this.then = function (onSuccess, onFail) {\n return new Promise(function (resolve, reject) {\n var s = onSuccess ? _then(onSuccess, resolve, reject) : resolve;\n var f = onFail ? _then(onFail, resolve, reject) : reject;\n\n _process(s, f);\n }, me);\n };\n\n /**\n * Resolve the promise\n * @param {*} result\n * @type {Function}\n */\n var _resolve = function (result) {\n // update status\n me.resolved = true;\n me.rejected = false;\n me.pending = false;\n\n _onSuccess.forEach(function (fn) {\n fn(result);\n });\n\n _process = function (onSuccess, onFail) {\n onSuccess(result);\n };\n\n _resolve = _reject = function () { };\n\n return me;\n };\n\n /**\n * Reject the promise\n * @param {Error} error\n * @type {Function}\n */\n var _reject = function (error) {\n // update status\n me.resolved = false;\n me.rejected = true;\n me.pending = false;\n\n _onFail.forEach(function (fn) {\n fn(error);\n });\n\n _process = function (onSuccess, onFail) {\n onFail(error);\n };\n\n _resolve = _reject = function () { }\n\n return me;\n };\n\n /**\n * Cancel the promise. This will reject the promise with a CancellationError\n * @returns {this} self\n */\n this.cancel = function () {\n if (parent) {\n parent.cancel();\n }\n else {\n _reject(new CancellationError());\n }\n\n return me;\n };\n\n /**\n * Set a timeout for the promise. If the promise is not resolved within\n * the time, the promise will be cancelled and a TimeoutError is thrown.\n * If the promise is resolved in time, the timeout is removed.\n * @param {number} delay Delay in milliseconds\n * @returns {this} self\n */\n this.timeout = function (delay) {\n if (parent) {\n parent.timeout(delay);\n }\n else {\n var timer = setTimeout(function () {\n _reject(new TimeoutError('Promise timed out after ' + delay + ' ms'));\n }, delay);\n\n me.always(function () {\n clearTimeout(timer);\n });\n }\n\n return me;\n };\n\n // attach handler passing the resolve and reject functions\n handler(function (result) {\n _resolve(result);\n }, function (error) {\n _reject(error);\n });\n}\n\n/**\n * Execute given callback, then call resolve/reject based on the returned result\n * @param {Function} callback\n * @param {Function} resolve\n * @param {Function} reject\n * @returns {Function}\n * @private\n */\nfunction _then(callback, resolve, reject) {\n return function (result) {\n try {\n var res = callback(result);\n if (res && typeof res.then === 'function' && typeof res['catch'] === 'function') {\n // method returned a promise\n res.then(resolve, reject);\n }\n else {\n resolve(res);\n }\n }\n catch (error) {\n reject(error);\n }\n }\n}\n\n/**\n * Add an onFail callback to the Promise\n * @template TT\n * @param {(error: E) => TT | PromiseLike} onFail\n * @returns {Promise} promise\n */\nPromise.prototype['catch'] = function (onFail) {\n return this.then(null, onFail);\n};\n\n// TODO: add support for Promise.catch(Error, callback)\n// TODO: add support for Promise.catch(Error, Error, callback)\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * @template TT\n * @param {() => Promise} fn\n * @returns {Promise} promise\n */\nPromise.prototype.always = function (fn) {\n return this.then(fn, fn);\n};\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * Same semantics as Node's Promise.finally()\n * @param {Function | null | undefined} [fn]\n * @returns {Promise} promise\n */\nPromise.prototype.finally = function (fn) {\n const me = this;\n\n const final = function() {\n return new Promise((resolve) => resolve())\n .then(fn)\n .then(() => me);\n };\n\n return this.then(final, final);\n}\n\n/**\n * Create a promise which resolves when all provided promises are resolved,\n * and fails when any of the promises resolves.\n * @param {Promise[]} promises\n * @returns {Promise} promise\n */\nPromise.all = function (promises){\n return new Promise(function (resolve, reject) {\n var remaining = promises.length,\n results = [];\n\n if (remaining) {\n promises.forEach(function (p, i) {\n p.then(function (result) {\n results[i] = result;\n remaining--;\n if (remaining == 0) {\n resolve(results);\n }\n }, function (error) {\n remaining = 0;\n reject(error);\n });\n });\n }\n else {\n resolve(results);\n }\n });\n};\n\n/**\n * Create a promise resolver\n * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver\n */\nPromise.defer = function () {\n var resolver = {};\n\n resolver.promise = new Promise(function (resolve, reject) {\n resolver.resolve = resolve;\n resolver.reject = reject;\n });\n\n return resolver;\n};\n\n/**\n * Create a cancellation error\n * @param {String} [message]\n * @extends Error\n */\nfunction CancellationError(message) {\n this.message = message || 'promise cancelled';\n this.stack = (new Error()).stack;\n}\n\nCancellationError.prototype = new Error();\nCancellationError.prototype.constructor = Error;\nCancellationError.prototype.name = 'CancellationError';\n\nPromise.CancellationError = CancellationError;\n\n\n/**\n * Create a timeout error\n * @param {String} [message]\n * @extends Error\n */\nfunction TimeoutError(message) {\n this.message = message || 'timeout exceeded';\n this.stack = (new Error()).stack;\n}\n\nTimeoutError.prototype = new Error();\nTimeoutError.prototype.constructor = Error;\nTimeoutError.prototype.name = 'TimeoutError';\n\nPromise.TimeoutError = TimeoutError;\n\n\nexports.Promise = Promise;\n","/**\n * Validate that the object only contains known option names\n * - Throws an error when unknown options are detected\n * - Throws an error when some of the allowed options are attached\n * @param {Object | undefined} options\n * @param {string[]} allowedOptionNames\n * @param {string} objectName\n * @retrun {Object} Returns the original options\n */\nexports.validateOptions = function validateOptions(options, allowedOptionNames, objectName) {\n if (!options) {\n return\n }\n\n var optionNames = options ? Object.keys(options) : []\n\n // check for unknown properties\n var unknownOptionName = optionNames.find(optionName => !allowedOptionNames.includes(optionName))\n if (unknownOptionName) {\n throw new Error('Object \"' + objectName + '\" contains an unknown option \"' + unknownOptionName + '\"')\n }\n\n // check for inherited properties which are not present on the object itself\n var illegalOptionName = allowedOptionNames.find(allowedOptionName => {\n return Object.prototype[allowedOptionName] && !optionNames.includes(allowedOptionName)\n })\n if (illegalOptionName) {\n throw new Error('Object \"' + objectName + '\" contains an inherited option \"' + illegalOptionName + '\" which is ' +\n 'not defined in the object itself but in its prototype. Only plain objects are allowed. ' +\n 'Please remove the option from the prototype or override it with a value \"undefined\".')\n }\n\n return options\n}\n\n// source: https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker\nexports.workerOptsNames = [\n 'credentials', 'name', 'type' ]\n\n// source: https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options\nexports.forkOptsNames = [\n 'cwd', 'detached', 'env', 'execPath', 'execArgv', 'gid', 'serialization',\n 'signal', 'killSignal', 'silent', 'stdio', 'uid', 'windowsVerbatimArguments',\n 'timeout'\n]\n\n// source: https://nodejs.org/api/worker_threads.html#new-workerfilename-options\nexports.workerThreadOptsNames = [\n 'argv', 'env', 'eval', 'execArgv', 'stdin', 'stdout', 'stderr', 'workerData',\n 'trackUnmanagedFds', 'transferList', 'resourceLimits', 'name'\n]\n","/**\n * embeddedWorker.js contains an embedded version of worker.js.\n * This file is automatically generated,\n * changes made in this file will be overwritten.\n */\nmodule.exports = \"!function(e,n){\\\"object\\\"==typeof exports&&\\\"undefined\\\"!=typeof module?module.exports=n():\\\"function\\\"==typeof define&&define.amd?define(n):(e=\\\"undefined\\\"!=typeof globalThis?globalThis:e||self).worker=n()}(this,(function(){\\\"use strict\\\";function e(n){return e=\\\"function\\\"==typeof Symbol&&\\\"symbol\\\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\\\"function\\\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\\\"symbol\\\":typeof e},e(n)}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\\\"default\\\")?e.default:e}var t={};var r=function(e,n){this.message=e,this.transfer=n},o={};function i(e,n){var t=this;if(!(this instanceof i))throw new SyntaxError(\\\"Constructor must be called with the new operator\\\");if(\\\"function\\\"!=typeof e)throw new SyntaxError(\\\"Function parameter handler(resolve, reject) missing\\\");var r=[],o=[];this.resolved=!1,this.rejected=!1,this.pending=!0,this[Symbol.toStringTag]=\\\"Promise\\\";var a=function(e,n){r.push(e),o.push(n)};this.then=function(e,n){return new i((function(t,r){var o=e?s(e,t,r):t,i=n?s(n,t,r):r;a(o,i)}),t)};var f=function(e){return t.resolved=!0,t.rejected=!1,t.pending=!1,r.forEach((function(n){n(e)})),a=function(n,t){n(e)},f=d=function(){},t},d=function(e){return t.resolved=!1,t.rejected=!0,t.pending=!1,o.forEach((function(n){n(e)})),a=function(n,t){t(e)},f=d=function(){},t};this.cancel=function(){return n?n.cancel():d(new u),t},this.timeout=function(e){if(n)n.timeout(e);else{var r=setTimeout((function(){d(new c(\\\"Promise timed out after \\\"+e+\\\" ms\\\"))}),e);t.always((function(){clearTimeout(r)}))}return t},e((function(e){f(e)}),(function(e){d(e)}))}function s(e,n,t){return function(r){try{var o=e(r);o&&\\\"function\\\"==typeof o.then&&\\\"function\\\"==typeof o.catch?o.then(n,t):n(o)}catch(e){t(e)}}}function u(e){this.message=e||\\\"promise cancelled\\\",this.stack=(new Error).stack}function c(e){this.message=e||\\\"timeout exceeded\\\",this.stack=(new Error).stack}return i.prototype.catch=function(e){return this.then(null,e)},i.prototype.always=function(e){return this.then(e,e)},i.prototype.finally=function(e){var n=this,t=function(){return new i((function(e){return e()})).then(e).then((function(){return n}))};return this.then(t,t)},i.all=function(e){return new i((function(n,t){var r=e.length,o=[];r?e.forEach((function(e,i){e.then((function(e){o[i]=e,0==--r&&n(o)}),(function(e){r=0,t(e)}))})):n(o)}))},i.defer=function(){var e={};return e.promise=new i((function(n,t){e.resolve=n,e.reject=t})),e},u.prototype=new Error,u.prototype.constructor=Error,u.prototype.name=\\\"CancellationError\\\",i.CancellationError=u,c.prototype=new Error,c.prototype.constructor=Error,c.prototype.name=\\\"TimeoutError\\\",i.TimeoutError=c,o.Promise=i,function(n){var t=r,i=o.Promise,s=\\\"__workerpool-cleanup__\\\",u={exit:function(){}},c={addAbortListener:function(e){u.abortListeners.push(e)},emit:u.emit};if(\\\"undefined\\\"!=typeof self&&\\\"function\\\"==typeof postMessage&&\\\"function\\\"==typeof addEventListener)u.on=function(e,n){addEventListener(e,(function(e){n(e.data)}))},u.send=function(e,n){n?postMessage(e,n):postMessage(e)};else{if(\\\"undefined\\\"==typeof process)throw new Error(\\\"Script must be executed as a worker\\\");var a;try{a=require(\\\"worker_threads\\\")}catch(n){if(\\\"object\\\"!==e(n)||null===n||\\\"MODULE_NOT_FOUND\\\"!==n.code)throw n}if(a&&null!==a.parentPort){var f=a.parentPort;u.send=f.postMessage.bind(f),u.on=f.on.bind(f),u.exit=process.exit.bind(process)}else u.on=process.on.bind(process),u.send=function(e){process.send(e)},u.on(\\\"disconnect\\\",(function(){process.exit(1)})),u.exit=process.exit.bind(process)}function d(e){return e&&e.toJSON?JSON.parse(JSON.stringify(e)):JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)))}function l(e){return e&&\\\"function\\\"==typeof e.then&&\\\"function\\\"==typeof e.catch}u.methods={},u.methods.run=function(e,n){var t=new Function(\\\"return (\\\"+e+\\\").apply(this, arguments);\\\");return t.worker=c,t.apply(t,n)},u.methods.methods=function(){return Object.keys(u.methods)},u.terminationHandler=void 0,u.abortListenerTimeout=1e3,u.abortListeners=[],u.terminateAndExit=function(e){var n=function(){u.exit(e)};if(!u.terminationHandler)return n();var t=u.terminationHandler(e);return l(t)?(t.then(n,n),t):(n(),new i((function(e,n){n(new Error(\\\"Worker terminating\\\"))})))},u.cleanup=function(e){if(!u.abortListeners.length)return u.send({id:e,method:s,error:d(new Error(\\\"Worker terminating\\\"))}),new i((function(e){e()}));var n,t=u.abortListeners.map((function(e){return e()})),r=new i((function(e,t){n=setTimeout((function(){t(new Error(\\\"Timeout occured waiting for abort handler, killing worker\\\"))}),u.abortListenerTimeout)})),o=i.all(t).then((function(){clearTimeout(n),u.abortListeners.length||(u.abortListeners=[])}),(function(){clearTimeout(n),u.exit()}));return new i((function(e,n){o.then(e,n),r.then(e,n)})).then((function(){u.send({id:e,method:s,error:null})}),(function(n){u.send({id:e,method:s,error:n?d(n):null})}))};var p=null;u.on(\\\"message\\\",(function(e){if(\\\"__workerpool-terminate__\\\"===e)return u.terminateAndExit(0);if(e.method===s)return u.cleanup(e.id);try{var n=u.methods[e.method];if(!n)throw new Error('Unknown method \\\"'+e.method+'\\\"');p=e.id;var r=n.apply(n,e.params);l(r)?r.then((function(n){n instanceof t?u.send({id:e.id,result:n.message,error:null},n.transfer):u.send({id:e.id,result:n,error:null}),p=null})).catch((function(n){u.send({id:e.id,result:null,error:d(n)}),p=null})):(r instanceof t?u.send({id:e.id,result:r.message,error:null},r.transfer):u.send({id:e.id,result:r,error:null}),p=null)}catch(n){u.send({id:e.id,result:null,error:d(n)})}})),u.register=function(e,n){if(e)for(var t in e)e.hasOwnProperty(t)&&(u.methods[t]=e[t],u.methods[t].worker=c);n&&(u.terminationHandler=n.onTerminate,u.abortListenerTimeout=n.abortListenerTimeout||1e3),u.send(\\\"ready\\\")},u.emit=function(e){if(p){if(e instanceof t)return void u.send({id:p,isEvent:!0,payload:e.message},e.transfer);u.send({id:p,isEvent:!0,payload:e})}},n.add=u.register,n.emit=u.emit}(t),n(t)}));\\n//# sourceMappingURL=worker.min.js.map\\n\";\n","'use strict';\n\nvar {Promise} = require('./Promise');\nvar environment = require('./environment');\nconst {validateOptions, forkOptsNames, workerThreadOptsNames, workerOptsNames} = require(\"./validateOptions\");\n\n/**\n * Special message sent by parent which causes a child process worker to terminate itself.\n * Not a \"message object\"; this string is the entire message.\n */\nvar TERMINATE_METHOD_ID = '__workerpool-terminate__';\n\n/**\n * Special message by parent which causes a child process worker to perform cleaup\n * steps before determining if the child process worker should be terminated.\n */\nvar CLEANUP_METHOD_ID = '__workerpool-cleanup__';\n\nfunction ensureWorkerThreads() {\n var WorkerThreads = tryRequireWorkerThreads()\n if (!WorkerThreads) {\n throw new Error('WorkerPool: workerType = \\'thread\\' is not supported, Node >= 11.7.0 required')\n }\n\n return WorkerThreads;\n}\n\n// check whether Worker is supported by the browser\nfunction ensureWebWorker() {\n // Workaround for a bug in PhantomJS (Or QtWebkit): https://github.com/ariya/phantomjs/issues/14534\n if (typeof Worker !== 'function' && (typeof Worker !== 'object' || typeof Worker.prototype.constructor !== 'function')) {\n throw new Error('WorkerPool: Web Workers not supported');\n }\n}\n\nfunction tryRequireWorkerThreads() {\n try {\n return require('worker_threads');\n } catch(error) {\n if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') {\n // no worker_threads available (old version of node.js)\n return null;\n } else {\n throw error;\n }\n }\n}\n\n// get the default worker script\nfunction getDefaultWorker() {\n if (environment.platform === 'browser') {\n // test whether the browser supports all features that we need\n if (typeof Blob === 'undefined') {\n throw new Error('Blob not supported by the browser');\n }\n if (!window.URL || typeof window.URL.createObjectURL !== 'function') {\n throw new Error('URL.createObjectURL not supported by the browser');\n }\n\n // use embedded worker.js\n var blob = new Blob([require('./generated/embeddedWorker')], {type: 'text/javascript'});\n return window.URL.createObjectURL(blob);\n }\n else {\n // use external worker.js in current directory\n return __dirname + '/worker.js';\n }\n}\n\nfunction setupWorker(script, options) {\n if (options.workerType === 'web') { // browser only\n ensureWebWorker();\n return setupBrowserWorker(script, options.workerOpts, Worker);\n } else if (options.workerType === 'thread') { // node.js only\n WorkerThreads = ensureWorkerThreads();\n return setupWorkerThreadWorker(script, WorkerThreads, options);\n } else if (options.workerType === 'process' || !options.workerType) { // node.js only\n return setupProcessWorker(script, resolveForkOptions(options), require('child_process'));\n } else { // options.workerType === 'auto' or undefined\n if (environment.platform === 'browser') {\n ensureWebWorker();\n return setupBrowserWorker(script, options.workerOpts, Worker);\n }\n else { // environment.platform === 'node'\n var WorkerThreads = tryRequireWorkerThreads();\n if (WorkerThreads) {\n return setupWorkerThreadWorker(script, WorkerThreads, options);\n } else {\n return setupProcessWorker(script, resolveForkOptions(options), require('child_process'));\n }\n }\n }\n}\n\nfunction setupBrowserWorker(script, workerOpts, Worker) {\n // validate the options right before creating the worker (not when creating the pool)\n validateOptions(workerOpts, workerOptsNames, 'workerOpts')\n\n // create the web worker\n var worker = new Worker(script, workerOpts);\n\n worker.isBrowserWorker = true;\n // add node.js API to the web worker\n worker.on = function (event, callback) {\n this.addEventListener(event, function (message) {\n callback(message.data);\n });\n };\n worker.send = function (message, transfer) {\n this.postMessage(message, transfer);\n };\n return worker;\n}\n\nfunction setupWorkerThreadWorker(script, WorkerThreads, options) {\n // validate the options right before creating the worker thread (not when creating the pool)\n validateOptions(options?.workerThreadOpts, workerThreadOptsNames, 'workerThreadOpts')\n\n var worker = new WorkerThreads.Worker(script, {\n stdout: options?.emitStdStreams ?? false, // pipe worker.STDOUT to process.STDOUT if not requested\n stderr: options?.emitStdStreams ?? false, // pipe worker.STDERR to process.STDERR if not requested\n ...options?.workerThreadOpts\n });\n worker.isWorkerThread = true;\n worker.send = function(message, transfer) {\n this.postMessage(message, transfer);\n };\n\n worker.kill = function() {\n this.terminate();\n return true;\n };\n\n worker.disconnect = function() {\n this.terminate();\n };\n\n if (options?.emitStdStreams) {\n worker.stdout.on('data', (data) => worker.emit(\"stdout\", data))\n worker.stderr.on('data', (data) => worker.emit(\"stderr\", data))\n }\n\n return worker;\n}\n\nfunction setupProcessWorker(script, options, child_process) {\n // validate the options right before creating the child process (not when creating the pool)\n validateOptions(options.forkOpts, forkOptsNames, 'forkOpts')\n\n // no WorkerThreads, fallback to sub-process based workers\n var worker = child_process.fork(\n script,\n options.forkArgs,\n options.forkOpts\n );\n\n // ignore transfer argument since it is not supported by process\n var send = worker.send;\n worker.send = function (message) {\n return send.call(worker, message);\n };\n\n if (options.emitStdStreams) {\n worker.stdout.on('data', (data) => worker.emit(\"stdout\", data))\n worker.stderr.on('data', (data) => worker.emit(\"stderr\", data))\n }\n\n worker.isChildProcess = true;\n return worker;\n}\n\n// add debug flags to child processes if the node inspector is active\nfunction resolveForkOptions(opts) {\n opts = opts || {};\n\n var processExecArgv = process.execArgv.join(' ');\n var inspectorActive = processExecArgv.indexOf('--inspect') !== -1;\n var debugBrk = processExecArgv.indexOf('--debug-brk') !== -1;\n\n var execArgv = [];\n if (inspectorActive) {\n execArgv.push('--inspect=' + opts.debugPort);\n\n if (debugBrk) {\n execArgv.push('--debug-brk');\n }\n }\n\n process.execArgv.forEach(function(arg) {\n if (arg.indexOf('--max-old-space-size') > -1) {\n execArgv.push(arg)\n }\n })\n\n return Object.assign({}, opts, {\n forkArgs: opts.forkArgs,\n forkOpts: Object.assign({}, opts.forkOpts, {\n execArgv: (opts.forkOpts && opts.forkOpts.execArgv || [])\n .concat(execArgv),\n stdio: opts.emitStdStreams ? \"pipe\": undefined\n })\n });\n}\n\n/**\n * Converts a serialized error to Error\n * @param {Object} obj Error that has been serialized and parsed to object\n * @return {Error} The equivalent Error.\n */\nfunction objectToError (obj) {\n var temp = new Error('')\n var props = Object.keys(obj)\n\n for (var i = 0; i < props.length; i++) {\n temp[props[i]] = obj[props[i]]\n }\n\n return temp\n}\n\nfunction handleEmittedStdPayload(handler, payload) {\n // TODO: refactor if parallel task execution gets added\n Object.values(handler.processing)\n .forEach(task => task?.options?.on(payload));\n \n Object.values(handler.tracking)\n .forEach(task => task?.options?.on(payload)); \n}\n\n/**\n * A WorkerHandler controls a single worker. This worker can be a child process\n * on node.js or a WebWorker in a browser environment.\n * @param {String} [script] If no script is provided, a default worker with a\n * function run will be created.\n * @param {import('./types.js').WorkerPoolOptions} [_options] See docs\n * @constructor\n */\nfunction WorkerHandler(script, _options) {\n var me = this;\n var options = _options || {};\n\n this.script = script || getDefaultWorker();\n this.worker = setupWorker(this.script, options);\n this.debugPort = options.debugPort;\n this.forkOpts = options.forkOpts;\n this.forkArgs = options.forkArgs;\n this.workerOpts = options.workerOpts;\n this.workerThreadOpts = options.workerThreadOpts\n this.workerTerminateTimeout = options.workerTerminateTimeout;\n\n // The ready message is only sent if the worker.add method is called (And the default script is not used)\n if (!script) {\n this.worker.ready = true;\n }\n\n // queue for requests that are received before the worker is ready\n this.requestQueue = [];\n\n this.worker.on(\"stdout\", function (data) {\n handleEmittedStdPayload(me, {\"stdout\": data.toString()})\n })\n this.worker.on(\"stderr\", function (data) {\n handleEmittedStdPayload(me, {\"stderr\": data.toString()})\n })\n\n this.worker.on('message', function (response) {\n if (me.terminated) {\n return;\n }\n if (typeof response === 'string' && response === 'ready') {\n me.worker.ready = true;\n dispatchQueuedRequests();\n } else {\n // find the task from the processing queue, and run the tasks callback\n var id = response.id;\n var task = me.processing[id];\n if (task !== undefined) {\n if (response.isEvent) {\n if (task.options && typeof task.options.on === 'function') {\n task.options.on(response.payload);\n }\n } else {\n // remove the task from the queue\n delete me.processing[id];\n\n // test if we need to terminate\n if (me.terminating === true) {\n // complete worker termination if all tasks are finished\n me.terminate();\n }\n\n // resolve the task's promise\n if (response.error) {\n task.resolver.reject(objectToError(response.error));\n }\n else {\n task.resolver.resolve(response.result);\n }\n }\n } else {\n // if the task is not the current, it might be tracked for cleanup\n var task = me.tracking[id];\n if (task !== undefined) {\n if (response.isEvent) {\n if (task.options && typeof task.options.on === 'function') {\n task.options.on(response.payload);\n }\n }\n } \n }\n\n if (response.method === CLEANUP_METHOD_ID) {\n var trackedTask = me.tracking[response.id];\n if (trackedTask !== undefined) {\n if (response.error) {\n clearTimeout(trackedTask.timeoutId);\n trackedTask.resolver.reject(objectToError(response.error))\n } else {\n me.tracking && clearTimeout(trackedTask.timeoutId);\n // if we do not encounter an error wrap the the original timeout error and reject\n trackedTask.resolver.reject(new WrappedTimeoutError(trackedTask.error));\n }\n }\n delete me.tracking[id];\n }\n }\n });\n\n // reject all running tasks on worker error\n function onError(error) {\n me.terminated = true;\n\n for (var id in me.processing) {\n if (me.processing[id] !== undefined) {\n me.processing[id].resolver.reject(error);\n }\n }\n \n me.processing = Object.create(null);\n }\n\n // send all queued requests to worker\n function dispatchQueuedRequests()\n {\n for(const request of me.requestQueue.splice(0)) {\n me.worker.send(request.message, request.transfer);\n }\n }\n\n var worker = this.worker;\n // listen for worker messages error and exit\n this.worker.on('error', onError);\n this.worker.on('exit', function (exitCode, signalCode) {\n var message = 'Workerpool Worker terminated Unexpectedly\\n';\n\n message += ' exitCode: `' + exitCode + '`\\n';\n message += ' signalCode: `' + signalCode + '`\\n';\n\n message += ' workerpool.script: `' + me.script + '`\\n';\n message += ' spawnArgs: `' + worker.spawnargs + '`\\n';\n message += ' spawnfile: `' + worker.spawnfile + '`\\n'\n\n message += ' stdout: `' + worker.stdout + '`\\n'\n message += ' stderr: `' + worker.stderr + '`\\n'\n\n onError(new Error(message));\n });\n\n this.processing = Object.create(null); // queue with tasks currently in progress\n this.tracking = Object.create(null); // queue with tasks being monitored for cleanup status\n this.terminating = false;\n this.terminated = false;\n this.cleaning = false;\n this.terminationHandler = null;\n this.lastId = 0;\n}\n\n/**\n * Get a list with methods available on the worker.\n * @return {Promise.} methods\n */\nWorkerHandler.prototype.methods = function () {\n return this.exec('methods');\n};\n\n/**\n * Execute a method with given parameters on the worker\n * @param {String} method\n * @param {Array} [params]\n * @param {{resolve: Function, reject: Function}} [resolver]\n * @param {import('./types.js').ExecOptions} [options]\n * @return {Promise.<*, Error>} result\n */\nWorkerHandler.prototype.exec = function(method, params, resolver, options) {\n if (!resolver) {\n resolver = Promise.defer();\n }\n\n // generate a unique id for the task\n var id = ++this.lastId;\n\n // register a new task as being in progress\n this.processing[id] = {\n id: id,\n resolver: resolver,\n options: options\n };\n\n // build a JSON-RPC request\n var request = {\n message: {\n id: id,\n method: method,\n params: params\n },\n transfer: options && options.transfer\n };\n\n if (this.terminated) {\n resolver.reject(new Error('Worker is terminated'));\n } else if (this.worker.ready) {\n // send the request to the worker\n this.worker.send(request.message, request.transfer);\n } else {\n this.requestQueue.push(request);\n }\n\n // on cancellation, force the worker to terminate\n var me = this;\n return resolver.promise.catch(function (error) {\n if (error instanceof Promise.CancellationError || error instanceof Promise.TimeoutError) {\n me.tracking[id] = {\n id,\n resolver: Promise.defer(),\n options: options,\n error,\n };\n \n // remove this task from the queue. It is already rejected (hence this\n // catch event), and else it will be rejected again when terminating\n delete me.processing[id];\n\n me.tracking[id].resolver.promise = me.tracking[id].resolver.promise.catch(function(err) {\n delete me.tracking[id];\n\n // if we find the error is an instance of WrappedTimeoutError we know the error should not cause termination\n // as the response from the worker did not contain an error. We still wish to throw the original timeout error\n // to the caller.\n if (err instanceof WrappedTimeoutError) {\n throw err.error;\n }\n\n var promise = me.terminateAndNotify(true)\n .then(function() { \n throw err;\n }, function(err) {\n throw err;\n });\n\n return promise;\n });\n \n me.worker.send({\n id,\n method: CLEANUP_METHOD_ID \n });\n \n \n /**\n * Sets a timeout to reject the cleanup operation if the message sent to the worker\n * does not receive a response. see worker.tryCleanup for worker cleanup operations.\n * Here we use the workerTerminateTimeout as the worker will be terminated if the timeout does invoke.\n * \n * We need this timeout in either case of a Timeout or Cancellation Error as if\n * the worker does not send a message we still need to give a window of time for a response.\n * \n * The workerTermniateTimeout is used here if this promise is rejected the worker cleanup\n * operations will occure.\n */\n me.tracking[id].timeoutId = setTimeout(function() {\n me.tracking[id].resolver.reject(error);\n }, me.workerTerminateTimeout);\n\n return me.tracking[id].resolver.promise;\n } else {\n throw error;\n }\n })\n};\n\n/**\n * Test whether the worker is processing any tasks or cleaning up before termination.\n * @return {boolean} Returns true if the worker is busy\n */\nWorkerHandler.prototype.busy = function () {\n return this.cleaning || Object.keys(this.processing).length > 0;\n};\n\n/**\n * Terminate the worker.\n * @param {boolean} [force=false] If false (default), the worker is terminated\n * after finishing all tasks currently in\n * progress. If true, the worker will be\n * terminated immediately.\n * @param {function} [callback=null] If provided, will be called when process terminates.\n */\nWorkerHandler.prototype.terminate = function (force, callback) {\n var me = this;\n if (force) {\n // cancel all tasks in progress\n for (var id in this.processing) {\n if (this.processing[id] !== undefined) {\n this.processing[id].resolver.reject(new Error('Worker terminated'));\n }\n }\n\n this.processing = Object.create(null);\n }\n\n // If we are terminating, cancel all tracked task for cleanup\n for (var task of Object.values(me.tracking)) {\n clearTimeout(task.timeoutId);\n task.resolver.reject(new Error('Worker Terminating'));\n }\n\n me.tracking = Object.create(null);\n\n if (typeof callback === 'function') {\n this.terminationHandler = callback;\n }\n if (!this.busy()) {\n // all tasks are finished. kill the worker\n var cleanup = function(err) {\n me.terminated = true;\n me.cleaning = false;\n\n if (me.worker != null && me.worker.removeAllListeners) {\n // removeAllListeners is only available for child_process\n me.worker.removeAllListeners('message');\n }\n me.worker = null;\n me.terminating = false;\n if (me.terminationHandler) {\n me.terminationHandler(err, me);\n } else if (err) {\n throw err;\n }\n }\n\n if (this.worker) {\n if (typeof this.worker.kill === 'function') {\n if (this.worker.killed) {\n cleanup(new Error('worker already killed!'));\n return;\n }\n\n // child process and worker threads\n var cleanExitTimeout = setTimeout(function() {\n if (me.worker) {\n me.worker.kill();\n }\n }, this.workerTerminateTimeout);\n\n this.worker.once('exit', function() {\n clearTimeout(cleanExitTimeout);\n if (me.worker) {\n me.worker.killed = true;\n }\n cleanup();\n });\n\n if (this.worker.ready) {\n this.worker.send(TERMINATE_METHOD_ID);\n } else {\n this.requestQueue.push({ message: TERMINATE_METHOD_ID });\n }\n\n // mark that the worker is cleaning up resources\n // to prevent new tasks from being executed\n this.cleaning = true;\n return;\n }\n else if (typeof this.worker.terminate === 'function') {\n this.worker.terminate(); // web worker\n this.worker.killed = true;\n }\n else {\n throw new Error('Failed to terminate worker');\n }\n }\n cleanup();\n }\n else {\n // we can't terminate immediately, there are still tasks being executed\n this.terminating = true;\n }\n};\n\n/**\n * Terminate the worker, returning a Promise that resolves when the termination has been done.\n * @param {boolean} [force=false] If false (default), the worker is terminated\n * after finishing all tasks currently in\n * progress. If true, the worker will be\n * terminated immediately.\n * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected\n * after timeout if worker process has not been terminated.\n * @return {Promise.}\n */\nWorkerHandler.prototype.terminateAndNotify = function (force, timeout) {\n var resolver = Promise.defer();\n if (timeout) {\n resolver.promise.timeout(timeout);\n }\n this.terminate(force, function(err, worker) {\n if (err) {\n resolver.reject(err);\n } else {\n resolver.resolve(worker);\n }\n });\n return resolver.promise;\n};\n\n/**\n* Wrapper error type to denote that a TimeoutError has already been proceesed\n* and we should skip cleanup operations\n* @param {Promise.TimeoutError} timeoutError\n*/\nfunction WrappedTimeoutError(timeoutError) {\n this.error = timeoutError;\n this.stack = (new Error()).stack;\n}\n\nmodule.exports = WorkerHandler;\nmodule.exports._tryRequireWorkerThreads = tryRequireWorkerThreads;\nmodule.exports._setupProcessWorker = setupProcessWorker;\nmodule.exports._setupBrowserWorker = setupBrowserWorker;\nmodule.exports._setupWorkerThreadWorker = setupWorkerThreadWorker;\nmodule.exports.ensureWorkerThreads = ensureWorkerThreads;\n","'use strict';\n\nvar MAX_PORTS = 65535;\nmodule.exports = DebugPortAllocator;\nfunction DebugPortAllocator() {\n this.ports = Object.create(null);\n this.length = 0;\n}\n\nDebugPortAllocator.prototype.nextAvailableStartingAt = function(starting) {\n while (this.ports[starting] === true) {\n starting++;\n }\n\n if (starting >= MAX_PORTS) {\n throw new Error('WorkerPool debug port limit reached: ' + starting + '>= ' + MAX_PORTS );\n }\n\n this.ports[starting] = true;\n this.length++;\n return starting;\n};\n\nDebugPortAllocator.prototype.releasePort = function(port) {\n delete this.ports[port];\n this.length--;\n};\n\n","var {Promise} = require('./Promise');\nvar WorkerHandler = require('./WorkerHandler');\nvar environment = require('./environment');\nvar DebugPortAllocator = require('./debug-port-allocator');\nvar DEBUG_PORT_ALLOCATOR = new DebugPortAllocator();\n/**\n * A pool to manage workers, which can be created using the function workerpool.pool.\n *\n * @param {String} [script] Optional worker script\n * @param {import('./types.js').WorkerPoolOptions} [options] See docs\n * @constructor\n */\nfunction Pool(script, options) {\n if (typeof script === 'string') {\n /** @readonly */\n this.script = script || null;\n }\n else {\n this.script = null;\n options = script;\n }\n\n /** @private */\n this.workers = []; // queue with all workers\n /** @private */\n this.tasks = []; // queue with tasks awaiting execution\n\n options = options || {};\n\n /** @readonly */\n this.forkArgs = Object.freeze(options.forkArgs || []);\n /** @readonly */\n this.forkOpts = Object.freeze(options.forkOpts || {});\n /** @readonly */\n this.workerOpts = Object.freeze(options.workerOpts || {});\n /** @readonly */\n this.workerThreadOpts = Object.freeze(options.workerThreadOpts || {})\n /** @private */\n this.debugPortStart = (options.debugPortStart || 43210);\n /** @readonly @deprecated */\n this.nodeWorker = options.nodeWorker;\n /** @readonly\n * @type {'auto' | 'web' | 'process' | 'thread'}\n */\n this.workerType = options.workerType || options.nodeWorker || 'auto'\n /** @readonly */\n this.maxQueueSize = options.maxQueueSize || Infinity;\n /** @readonly */\n this.workerTerminateTimeout = options.workerTerminateTimeout || 1000;\n\n /** @readonly */\n this.onCreateWorker = options.onCreateWorker || (() => null);\n /** @readonly */\n this.onTerminateWorker = options.onTerminateWorker || (() => null);\n\n /** @readonly */\n this.emitStdStreams = options.emitStdStreams || false\n\n // configuration\n if (options && 'maxWorkers' in options) {\n validateMaxWorkers(options.maxWorkers);\n /** @readonly */\n this.maxWorkers = options.maxWorkers;\n }\n else {\n this.maxWorkers = Math.max((environment.cpus || 4) - 1, 1);\n }\n\n if (options && 'minWorkers' in options) {\n if(options.minWorkers === 'max') {\n /** @readonly */\n this.minWorkers = this.maxWorkers;\n } else {\n validateMinWorkers(options.minWorkers);\n this.minWorkers = options.minWorkers;\n this.maxWorkers = Math.max(this.minWorkers, this.maxWorkers); // in case minWorkers is higher than maxWorkers\n }\n this._ensureMinWorkers();\n }\n\n /** @private */\n this._boundNext = this._next.bind(this);\n\n\n if (this.workerType === 'thread') {\n WorkerHandler.ensureWorkerThreads();\n }\n}\n\n\n/**\n * Execute a function on a worker.\n *\n * Example usage:\n *\n * var pool = new Pool()\n *\n * // call a function available on the worker\n * pool.exec('fibonacci', [6])\n *\n * // offload a function\n * function add(a, b) {\n * return a + b\n * };\n * pool.exec(add, [2, 4])\n * .then(function (result) {\n * console.log(result); // outputs 6\n * })\n * .catch(function(error) {\n * console.log(error);\n * });\n * @template { (...args: any[]) => any } T\n * @param {String | T} method Function name or function.\n * If `method` is a string, the corresponding\n * method on the worker will be executed\n * If `method` is a Function, the function\n * will be stringified and executed via the\n * workers built-in function `run(fn, args)`.\n * @param {Parameters | null} [params] Function arguments applied when calling the function\n * @param {import('./types.js').ExecOptions} [options] Options\n * @return {Promise>}\n */\nPool.prototype.exec = function (method, params, options) {\n // validate type of arguments\n if (params && !Array.isArray(params)) {\n throw new TypeError('Array expected as argument \"params\"');\n }\n\n if (typeof method === 'string') {\n var resolver = Promise.defer();\n\n if (this.tasks.length >= this.maxQueueSize) {\n throw new Error('Max queue size of ' + this.maxQueueSize + ' reached');\n }\n\n // add a new task to the queue\n var tasks = this.tasks;\n var task = {\n method: method,\n params: params,\n resolver: resolver,\n timeout: null,\n options: options\n };\n tasks.push(task);\n\n // replace the timeout method of the Promise with our own,\n // which starts the timer as soon as the task is actually started\n var originalTimeout = resolver.promise.timeout;\n resolver.promise.timeout = function timeout (delay) {\n if (tasks.indexOf(task) !== -1) {\n // task is still queued -> start the timer later on\n task.timeout = delay;\n return resolver.promise;\n }\n else {\n // task is already being executed -> start timer immediately\n return originalTimeout.call(resolver.promise, delay);\n }\n };\n\n // trigger task execution\n this._next();\n\n return resolver.promise;\n }\n else if (typeof method === 'function') {\n // send stringified function and function arguments to worker\n return this.exec('run', [String(method), params], options);\n }\n else {\n throw new TypeError('Function or string expected as argument \"method\"');\n }\n};\n\n/**\n * Create a proxy for current worker. Returns an object containing all\n * methods available on the worker. All methods return promises resolving the methods result.\n * @template { { [k: string]: (...args: any[]) => any } } T\n * @return {Promise, Error>} Returns a promise which resolves with a proxy object\n */\nPool.prototype.proxy = function () {\n if (arguments.length > 0) {\n throw new Error('No arguments expected');\n }\n\n var pool = this;\n return this.exec('methods')\n .then(function (methods) {\n var proxy = {};\n\n methods.forEach(function (method) {\n proxy[method] = function () {\n return pool.exec(method, Array.prototype.slice.call(arguments));\n }\n });\n\n return proxy;\n });\n};\n\n/**\n * Creates new array with the results of calling a provided callback function\n * on every element in this array.\n * @param {Array} array\n * @param {function} callback Function taking two arguments:\n * `callback(currentValue, index)`\n * @return {Promise.} Returns a promise which resolves with an Array\n * containing the results of the callback function\n * executed for each of the array elements.\n */\n/* TODO: implement map\nPool.prototype.map = function (array, callback) {\n};\n*/\n\n/**\n * Grab the first task from the queue, find a free worker, and assign the\n * worker to the task.\n * @private\n */\nPool.prototype._next = function () {\n if (this.tasks.length > 0) {\n // there are tasks in the queue\n\n // find an available worker\n var worker = this._getWorker();\n if (worker) {\n // get the first task from the queue\n var me = this;\n var task = this.tasks.shift();\n\n // check if the task is still pending (and not cancelled -> promise rejected)\n if (task.resolver.promise.pending) {\n // send the request to the worker\n var promise = worker.exec(task.method, task.params, task.resolver, task.options)\n .then(me._boundNext)\n .catch(function () {\n // if the worker crashed and terminated, remove it from the pool\n if (worker.terminated) {\n return me._removeWorker(worker);\n }\n }).then(function() {\n me._next(); // trigger next task in the queue\n });\n\n // start queued timer now\n if (typeof task.timeout === 'number') {\n promise.timeout(task.timeout);\n }\n } else {\n // The task taken was already complete (either rejected or resolved), so just trigger next task in the queue\n me._next();\n }\n }\n }\n};\n\n/**\n * Get an available worker. If no worker is available and the maximum number\n * of workers isn't yet reached, a new worker will be created and returned.\n * If no worker is available and the maximum number of workers is reached,\n * null will be returned.\n *\n * @return {WorkerHandler | null} worker\n * @private\n */\nPool.prototype._getWorker = function() {\n // find a non-busy worker\n var workers = this.workers;\n for (var i = 0; i < workers.length; i++) {\n var worker = workers[i];\n if (worker.busy() === false) {\n return worker;\n }\n }\n\n if (workers.length < this.maxWorkers) {\n // create a new worker\n worker = this._createWorkerHandler();\n workers.push(worker);\n return worker;\n }\n\n return null;\n};\n\n/**\n * Remove a worker from the pool.\n * Attempts to terminate worker if not already terminated, and ensures the minimum\n * pool size is met.\n * @param {WorkerHandler} worker\n * @return {Promise}\n * @private\n */\nPool.prototype._removeWorker = function(worker) {\n var me = this;\n\n DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort);\n // _removeWorker will call this, but we need it to be removed synchronously\n this._removeWorkerFromList(worker);\n // If minWorkers set, spin up new workers to replace the crashed ones\n this._ensureMinWorkers();\n // terminate the worker (if not already terminated)\n return new Promise(function(resolve, reject) {\n worker.terminate(false, function(err) {\n me.onTerminateWorker({\n forkArgs: worker.forkArgs,\n forkOpts: worker.forkOpts,\n workerThreadOpts: worker.workerThreadOpts,\n script: worker.script\n });\n if (err) {\n reject(err);\n } else {\n resolve(worker);\n }\n });\n });\n};\n\n/**\n * Remove a worker from the pool list.\n * @param {WorkerHandler} worker\n * @private\n */\nPool.prototype._removeWorkerFromList = function(worker) {\n // remove from the list with workers\n var index = this.workers.indexOf(worker);\n if (index !== -1) {\n this.workers.splice(index, 1);\n }\n};\n\n/**\n * Close all active workers. Tasks currently being executed will be finished first.\n * @param {boolean} [force=false] If false (default), the workers are terminated\n * after finishing all tasks currently in\n * progress. If true, the workers will be\n * terminated immediately.\n * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected\n * after timeout if worker process has not been terminated.\n * @return {Promise.}\n */\nPool.prototype.terminate = function (force, timeout) {\n var me = this;\n\n // cancel any pending tasks\n this.tasks.forEach(function (task) {\n task.resolver.reject(new Error('Pool terminated'));\n });\n this.tasks.length = 0;\n\n var f = function (worker) {\n DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort);\n this._removeWorkerFromList(worker);\n };\n var removeWorker = f.bind(this);\n\n var promises = [];\n var workers = this.workers.slice();\n workers.forEach(function (worker) {\n var termPromise = worker.terminateAndNotify(force, timeout)\n .then(removeWorker)\n .always(function() {\n me.onTerminateWorker({\n forkArgs: worker.forkArgs,\n forkOpts: worker.forkOpts,\n workerThreadOpts: worker.workerThreadOpts,\n script: worker.script\n });\n });\n promises.push(termPromise);\n });\n return Promise.all(promises);\n};\n\n/**\n * Retrieve statistics on tasks and workers.\n * @return {{totalWorkers: number, busyWorkers: number, idleWorkers: number, pendingTasks: number, activeTasks: number}} Returns an object with statistics\n */\nPool.prototype.stats = function () {\n var totalWorkers = this.workers.length;\n var busyWorkers = this.workers.filter(function (worker) {\n return worker.busy();\n }).length;\n\n return {\n totalWorkers: totalWorkers,\n busyWorkers: busyWorkers,\n idleWorkers: totalWorkers - busyWorkers,\n\n pendingTasks: this.tasks.length,\n activeTasks: busyWorkers\n };\n};\n\n/**\n * Ensures that a minimum of minWorkers is up and running\n * @private\n */\nPool.prototype._ensureMinWorkers = function() {\n if (this.minWorkers) {\n for(var i = this.workers.length; i < this.minWorkers; i++) {\n this.workers.push(this._createWorkerHandler());\n }\n }\n};\n\n/**\n * Helper function to create a new WorkerHandler and pass all options.\n * @return {WorkerHandler}\n * @private\n */\nPool.prototype._createWorkerHandler = function () {\n const overriddenParams = this.onCreateWorker({\n forkArgs: this.forkArgs,\n forkOpts: this.forkOpts,\n workerOpts: this.workerOpts,\n workerThreadOpts: this.workerThreadOpts,\n script: this.script\n }) || {};\n\n return new WorkerHandler(overriddenParams.script || this.script, {\n forkArgs: overriddenParams.forkArgs || this.forkArgs,\n forkOpts: overriddenParams.forkOpts || this.forkOpts,\n workerOpts: overriddenParams.workerOpts || this.workerOpts,\n workerThreadOpts: overriddenParams.workerThreadOpts || this.workerThreadOpts,\n debugPort: DEBUG_PORT_ALLOCATOR.nextAvailableStartingAt(this.debugPortStart),\n workerType: this.workerType,\n workerTerminateTimeout: this.workerTerminateTimeout,\n emitStdStreams: this.emitStdStreams,\n });\n}\n\n/**\n * Ensure that the maxWorkers option is an integer >= 1\n * @param {*} maxWorkers\n * @returns {boolean} returns true maxWorkers has a valid value\n */\nfunction validateMaxWorkers(maxWorkers) {\n if (!isNumber(maxWorkers) || !isInteger(maxWorkers) || maxWorkers < 1) {\n throw new TypeError('Option maxWorkers must be an integer number >= 1');\n }\n}\n\n/**\n * Ensure that the minWorkers option is an integer >= 0\n * @param {*} minWorkers\n * @returns {boolean} returns true when minWorkers has a valid value\n */\nfunction validateMinWorkers(minWorkers) {\n if (!isNumber(minWorkers) || !isInteger(minWorkers) || minWorkers < 0) {\n throw new TypeError('Option minWorkers must be an integer number >= 0');\n }\n}\n\n/**\n * Test whether a variable is a number\n * @param {*} value\n * @returns {boolean} returns true when value is a number\n */\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n\n/**\n * Test whether a number is an integer\n * @param {number} value\n * @returns {boolean} Returns true if value is an integer\n */\nfunction isInteger(value) {\n return Math.round(value) == value;\n}\n\nmodule.exports = Pool;\n","/**\n * The helper class for transferring data from the worker to the main thread.\n *\n * @param {Object} message The object to deliver to the main thread.\n * @param {Object[]} transfer An array of transferable Objects to transfer ownership of.\n */\nfunction Transfer(message, transfer) {\n this.message = message;\n this.transfer = transfer;\n}\n\nmodule.exports = Transfer;\n","/**\n * worker must be started as a child process or a web worker.\n * It listens for RPC messages from the parent process.\n */\n\nvar Transfer = require('./transfer');\n\n/**\n * worker must handle async cleanup handlers. Use custom Promise implementation. \n*/\nvar Promise = require('./Promise').Promise;\n/**\n * Special message sent by parent which causes the worker to terminate itself.\n * Not a \"message object\"; this string is the entire message.\n */\nvar TERMINATE_METHOD_ID = '__workerpool-terminate__';\n\n/**\n * Special message by parent which causes a child process worker to perform cleaup\n * steps before determining if the child process worker should be terminated.\n*/\nvar CLEANUP_METHOD_ID = '__workerpool-cleanup__';\n// var nodeOSPlatform = require('./environment').nodeOSPlatform;\n\n\nvar TIMEOUT_DEFAULT = 1_000;\n\n// create a worker API for sending and receiving messages which works both on\n// node.js and in the browser\nvar worker = {\n exit: function() {}\n};\n\n// api for in worker communication with parent process\n// works in both node.js and the browser\nvar publicWorker = {\n /**\n * Registers listeners which will trigger when a task is timed out or cancled. If all listeners resolve, the worker executing the given task will not be terminated.\n * *Note*: If there is a blocking operation within a listener, the worker will be terminated.\n * @param {() => Promise} listener\n */\n addAbortListener: function(listener) {\n worker.abortListeners.push(listener);\n },\n\n /**\n * Emit an event from the worker thread to the main thread.\n * @param {any} payload\n */\n emit: worker.emit\n};\n\nif (typeof self !== 'undefined' && typeof postMessage === 'function' && typeof addEventListener === 'function') {\n // worker in the browser\n worker.on = function (event, callback) {\n addEventListener(event, function (message) {\n callback(message.data);\n })\n };\n worker.send = function (message, transfer) {\n transfer ? postMessage(message, transfer) : postMessage (message);\n };\n}\nelse if (typeof process !== 'undefined') {\n // node.js\n\n var WorkerThreads;\n try {\n WorkerThreads = require('worker_threads');\n } catch(error) {\n if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') {\n // no worker_threads, fallback to sub-process based workers\n } else {\n throw error;\n }\n }\n\n if (WorkerThreads &&\n /* if there is a parentPort, we are in a WorkerThread */\n WorkerThreads.parentPort !== null) {\n var parentPort = WorkerThreads.parentPort;\n worker.send = parentPort.postMessage.bind(parentPort);\n worker.on = parentPort.on.bind(parentPort);\n worker.exit = process.exit.bind(process);\n } else {\n worker.on = process.on.bind(process);\n // ignore transfer argument since it is not supported by process\n worker.send = function (message) {\n process.send(message);\n };\n // register disconnect handler only for subprocess worker to exit when parent is killed unexpectedly\n worker.on('disconnect', function () {\n process.exit(1);\n });\n worker.exit = process.exit.bind(process);\n }\n}\nelse {\n throw new Error('Script must be executed as a worker');\n}\n\nfunction convertError(error) {\n if (error && error.toJSON) {\n return JSON.parse(JSON.stringify(error));\n }\n\n // turn a class like Error (having non-enumerable properties) into a plain object\n return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error)));\n}\n\n/**\n * Test whether a value is a Promise via duck typing.\n * @param {*} value\n * @returns {boolean} Returns true when given value is an object\n * having functions `then` and `catch`.\n */\nfunction isPromise(value) {\n return value && (typeof value.then === 'function') && (typeof value.catch === 'function');\n}\n\n// functions available externally\nworker.methods = {};\n\n/**\n * Execute a function with provided arguments\n * @param {String} fn Stringified function\n * @param {Array} [args] Function arguments\n * @returns {*}\n */\nworker.methods.run = function run(fn, args) {\n var f = new Function('return (' + fn + ').apply(this, arguments);');\n f.worker = publicWorker;\n return f.apply(f, args);\n};\n\n/**\n * Get a list with methods available on this worker\n * @return {String[]} methods\n */\nworker.methods.methods = function methods() {\n return Object.keys(worker.methods);\n};\n\n/**\n * Custom handler for when the worker is terminated.\n */\nworker.terminationHandler = undefined;\n\nworker.abortListenerTimeout = TIMEOUT_DEFAULT;\n\n/**\n * Abort handlers for resolving errors which may cause a timeout or cancellation\n * to occur from a worker context\n */\nworker.abortListeners = [];\n\n/**\n * Cleanup and exit the worker.\n * @param {Number} code \n * @returns {Promise}\n */\nworker.terminateAndExit = function(code) {\n var _exit = function() {\n worker.exit(code);\n }\n\n if(!worker.terminationHandler) {\n return _exit();\n }\n \n var result = worker.terminationHandler(code);\n if (isPromise(result)) {\n result.then(_exit, _exit);\n\n return result;\n } else {\n _exit();\n return new Promise(function (_resolve, reject) {\n reject(new Error(\"Worker terminating\"));\n });\n }\n}\n\n\n\n/**\n * Called within the worker message handler to run abort handlers if registered to perform cleanup operations.\n * @param {Integer} [requestId] id of task which is currently executing in the worker\n * @return {Promise}\n*/\nworker.cleanup = function(requestId) {\n\n if (!worker.abortListeners.length) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: convertError(new Error('Worker terminating')),\n });\n\n // If there are no handlers registered, reject the promise with an error as we want the handler to be notified\n // that cleanup should begin and the handler should be GCed.\n return new Promise(function(resolve) { resolve(); });\n }\n \n\n var _exit = function() {\n worker.exit();\n }\n\n var _abort = function() {\n if (!worker.abortListeners.length) {\n worker.abortListeners = [];\n }\n }\n\n const promises = worker.abortListeners.map(listener => listener());\n let timerId;\n const timeoutPromise = new Promise((_resolve, reject) => {\n timerId = setTimeout(function () { \n reject(new Error('Timeout occured waiting for abort handler, killing worker'));\n }, worker.abortListenerTimeout);\n });\n\n // Once a promise settles we need to clear the timeout to prevet fulfulling the promise twice \n const settlePromise = Promise.all(promises).then(function() {\n clearTimeout(timerId);\n _abort();\n }, function() {\n clearTimeout(timerId);\n _exit();\n });\n\n // Returns a promise which will result in one of the following cases\n // - Resolve once all handlers resolve\n // - Reject if one or more handlers exceed the 'abortListenerTimeout' interval\n // - Reject if one or more handlers reject\n // Upon one of the above cases a message will be sent to the handler with the result of the handler execution\n // which will either kill the worker if the result contains an error, or keep it in the pool if the result\n // does not contain an error.\n return new Promise(function(resolve, reject) {\n settlePromise.then(resolve, reject);\n timeoutPromise.then(resolve, reject);\n }).then(function() {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: null,\n });\n }, function(err) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: err ? convertError(err) : null,\n });\n });\n}\n\nvar currentRequestId = null;\n\nworker.on('message', function (request) {\n if (request === TERMINATE_METHOD_ID) {\n return worker.terminateAndExit(0);\n }\n\n if (request.method === CLEANUP_METHOD_ID) {\n return worker.cleanup(request.id);\n }\n\n try {\n var method = worker.methods[request.method];\n\n if (method) {\n currentRequestId = request.id;\n \n // execute the function\n var result = method.apply(method, request.params);\n\n if (isPromise(result)) {\n // promise returned, resolve this and then return\n result\n .then(function (result) {\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n currentRequestId = null;\n })\n .catch(function (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err),\n });\n currentRequestId = null;\n });\n }\n else {\n // immediate result\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n\n currentRequestId = null;\n }\n }\n else {\n throw new Error('Unknown method \"' + request.method + '\"');\n }\n }\n catch (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err)\n });\n }\n});\n\n/**\n * Register methods to the worker\n * @param {Object} [methods]\n * @param {import('./types.js').WorkerRegisterOptions} [options]\n */\nworker.register = function (methods, options) {\n\n if (methods) {\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n worker.methods[name] = methods[name];\n worker.methods[name].worker = publicWorker;\n }\n }\n }\n\n if (options) {\n worker.terminationHandler = options.onTerminate;\n // register listener timeout or default to 1 second\n worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT;\n }\n\n worker.send('ready');\n};\n\nworker.emit = function (payload) {\n if (currentRequestId) {\n if (payload instanceof Transfer) {\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload: payload.message\n }, payload.transfer);\n return;\n }\n\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload\n });\n }\n};\n\n\nif (typeof exports !== 'undefined') {\n exports.add = worker.register;\n exports.emit = worker.emit;\n}\n","const {platform, isMainThread, cpus} = require('./environment');\n\n/** @typedef {import(\"./Pool\")} Pool */\n/** @typedef {import(\"./types.js\").WorkerPoolOptions} WorkerPoolOptions */\n/** @typedef {import(\"./types.js\").WorkerRegisterOptions} WorkerRegisterOptions */\n\n/**\n * @template { { [k: string]: (...args: any[]) => any } } T\n * @typedef {import('./types.js').Proxy} Proxy\n */\n\n/**\n * @overload\n * Create a new worker pool\n * @param {WorkerPoolOptions} [script]\n * @returns {Pool} pool\n */\n/**\n * @overload\n * Create a new worker pool\n * @param {string} [script]\n * @param {WorkerPoolOptions} [options]\n * @returns {Pool} pool\n */\nfunction pool(script, options) {\n var Pool = require('./Pool');\n\n return new Pool(script, options);\n};\nexports.pool = pool;\n\n/**\n * Create a worker and optionally register a set of methods to the worker.\n * @param {{ [k: string]: (...args: any[]) => any }} [methods]\n * @param {WorkerRegisterOptions} [options]\n */\nfunction worker(methods, options) {\n var worker = require('./worker');\n worker.add(methods, options);\n};\nexports.worker = worker;\n\n/**\n * Sends an event to the parent worker pool.\n * @param {any} payload \n */\nfunction workerEmit(payload) {\n var worker = require('./worker');\n worker.emit(payload);\n};\nexports.workerEmit = workerEmit;\n\nconst {Promise} = require('./Promise');\nexports.Promise = Promise;\n\nexports.Transfer = require('./transfer');\n\nexports.platform = platform;\nexports.isMainThread = isMainThread;\nexports.cpus = cpus;\n"],"names":["isNode","nodeProcess","versions","node","module","exports","platform","process","worker_threads","require","isMainThread","connected","Window","cpus","self","navigator","hardwareConcurrency","length","Promise","handler","parent","me","SyntaxError","_onSuccess","_onFail","resolved","rejected","pending","Symbol","toStringTag","_process","onSuccess","onFail","push","then","resolve","reject","s","_then","f","_resolve","result","forEach","fn","_reject","error","cancel","CancellationError","timeout","delay","timer","setTimeout","TimeoutError","always","clearTimeout","callback","res","prototype","finally","final","all","promises","remaining","results","p","i","defer","resolver","promise","message","stack","Error","constructor","name","_Promise","validateOptions","options","allowedOptionNames","objectName","optionNames","Object","keys","unknownOptionName","find","optionName","includes","illegalOptionName","allowedOptionName","workerOptsNames","forkOptsNames","workerThreadOptsNames","embeddedWorker","_require$$","require$$0","environment","require$$1","_require$$2","require$$2","TERMINATE_METHOD_ID","CLEANUP_METHOD_ID","ensureWorkerThreads","WorkerThreads","tryRequireWorkerThreads","ensureWebWorker","Worker","_typeof","code","getDefaultWorker","Blob","window","URL","createObjectURL","blob","require$$3","type","__dirname","setupWorker","script","workerType","setupBrowserWorker","workerOpts","setupWorkerThreadWorker","setupProcessWorker","resolveForkOptions","worker","isBrowserWorker","on","event","addEventListener","data","send","transfer","postMessage","_options$emitStdStrea","_options$emitStdStrea2","workerThreadOpts","_objectSpread","stdout","emitStdStreams","stderr","isWorkerThread","kill","terminate","disconnect","emit","child_process","forkOpts","fork","forkArgs","call","isChildProcess","opts","processExecArgv","execArgv","join","inspectorActive","indexOf","debugBrk","debugPort","arg","assign","concat","stdio","undefined","objectToError","obj","temp","props","handleEmittedStdPayload","payload","values","processing","task","_task$options","tracking","_task$options2","WorkerHandler","_options","workerTerminateTimeout","ready","requestQueue","toString","response","terminated","dispatchQueuedRequests","id","isEvent","terminating","method","trackedTask","timeoutId","WrappedTimeoutError","onError","create","_iterator","_createForOfIteratorHelper","splice","_step","n","done","request","value","err","e","exitCode","signalCode","spawnargs","spawnfile","cleaning","terminationHandler","lastId","methods","exec","params","catch","terminateAndNotify","busy","force","_i","_Object$values","cleanup","removeAllListeners","killed","cleanExitTimeout","once","timeoutError","WorkerHandlerModule","_tryRequireWorkerThreads","_setupProcessWorker","_setupBrowserWorker","_setupWorkerThreadWorker","MAX_PORTS","debugPortAllocator","DebugPortAllocator","ports","nextAvailableStartingAt","starting","releasePort","port","DEBUG_PORT_ALLOCATOR","Pool","workers","tasks","freeze","debugPortStart","nodeWorker","maxQueueSize","Infinity","onCreateWorker","onTerminateWorker","validateMaxWorkers","maxWorkers","Math","max","minWorkers","validateMinWorkers","_ensureMinWorkers","_boundNext","_next","bind","Array","isArray","TypeError","originalTimeout","String","proxy","arguments","pool","slice","_getWorker","shift","_removeWorker","_createWorkerHandler","_removeWorkerFromList","index","removeWorker","termPromise","stats","totalWorkers","busyWorkers","filter","idleWorkers","pendingTasks","activeTasks","overriddenParams","isNumber","isInteger","round","Pool_1","Transfer","TIMEOUT_DEFAULT","exit","publicWorker","addAbortListener","listener","abortListeners","parentPort","convertError","toJSON","JSON","parse","stringify","getOwnPropertyNames","isPromise","run","args","Function","apply","abortListenerTimeout","terminateAndExit","_exit","requestId","_abort","map","timerId","timeoutPromise","settlePromise","currentRequestId","register","hasOwnProperty","onTerminate","add","pool_1","src","worker_1","workerEmit","workerEmit_1","require$$4","platform_1","isMainThread_1","cpus_1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACA;EACA;EACA,EAAA,IAAIA,MAAM,GAAG,SAATA,MAAMA,CAAaC,WAAW,EAAE;MAClC,OACE,OAAOA,WAAW,KAAK,WAAW,IAClCA,WAAW,CAACC,QAAQ,IAAI,IAAI,IAC5BD,WAAW,CAACC,QAAQ,CAACC,IAAI,IAAI,IAAI,IACjCF,WAAW,GAAG,EAAE,KAAK,kBAAkB;IAE3C,CAAC;EACDG,EAAAA,MAAA,CAAAC,OAAA,CAAAL,MAAA,GAAwBA,MAAM;;EAE9B;EACAI,EAAAA,MAAA,CAAAC,OAAA,CAAAC,QAAA,GAA0B,OAAOC,OAAO,KAAK,WAAW,IAAIP,MAAM,CAACO,OAAO,CAAC,GACvE,MAAM,GACN,SAAS;;EAEb;EACA;EACA,EAAA,IAAIC,cAAc,GAAGJ,MAAM,CAACC,OAAO,CAACC,QAAQ,KAAK,MAAM,IAAIG,OAAA,CAAQ,gBAAgB,CAAC;EACpFL,EAAAA,MAAA,CAAAC,OAAA,CAAAK,YAAA,GAA8BN,MAAM,CAACC,OAAO,CAACC,QAAQ,KAAK,MAAM,GAC3D,CAAC,CAACE,cAAc,IAAIA,cAAc,CAACE,YAAY,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;EACA,SAASyM,UAAUA,CAAC5J,OAAO,EAAE;EAC3B,EAAA,IAAI7C,MAAM,GAAG3B,aAAA,EAAmB;EAChC2B,EAAAA,MAAM,CAACoB,IAAI,CAACyB,OAAO,CAAC;EACtB;AACA,MAAA6J,YAAA,GAAAH,GAAA,CAAAE,UAAkB,GAAGA;EAErB,IAAAzO,UAAA,GAAkBqB,iBAAoB;IAA/B/F,SAAO,GAAA0E,UAAA,CAAP1E,OAAO;AACd,MAAAwD,QAAA,GAAAyP,GAAA,CAAAjT,OAAe,GAAGA;AAElB,MAAA+Q,QAAA,GAAAkC,GAAA,CAAAlC,QAAgB,GAAGsC;AAEnB,MAAAC,UAAA,GAAAL,GAAA,CAAA7T,QAAgB,GAAGA;AACnB,MAAAmU,cAAA,GAAAN,GAAA,CAAAzT,YAAoB,GAAGA;AACvB,MAAAgU,MAAA,GAAAP,GAAA,CAAAtT,IAAY,GAAGA;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/workerpool/dist/workerpool.min.js b/node_modules/workerpool/dist/workerpool.min.js new file mode 100644 index 0000000..db3bc33 --- /dev/null +++ b/node_modules/workerpool/dist/workerpool.min.js @@ -0,0 +1,3 @@ +/*! For license information please see workerpool.min.js.LICENSE.txt */ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).workerpool={})}(this,(function(e){"use strict";var r={},t={exports:{}};!function(e){var r=function(e){return void 0!==e&&null!=e.versions&&null!=e.versions.node&&e+""=="[object process]"};e.exports.isNode=r,e.exports.platform="undefined"!=typeof process&&r(process)?"node":"browser";var t="node"===e.exports.platform&&require("worker_threads");e.exports.isMainThread="node"===e.exports.platform?(!t||t.isMainThread)&&!process.connected:"undefined"!=typeof Window,e.exports.cpus="browser"===e.exports.platform?self.navigator.hardwareConcurrency:require("os").cpus().length}(t);var n,o=t.exports,i={};function s(){if(n)return i;function e(n,i){var s=this;if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");if("function"!=typeof n)throw new SyntaxError("Function parameter handler(resolve, reject) missing");var u=[],a=[];this.resolved=!1,this.rejected=!1,this.pending=!0,this[Symbol.toStringTag]="Promise";var c=function(e,r){u.push(e),a.push(r)};this.then=function(t,n){return new e((function(e,o){var i=t?r(t,e,o):e,s=n?r(n,e,o):o;c(i,s)}),s)};var f=function(e){return s.resolved=!0,s.rejected=!1,s.pending=!1,u.forEach((function(r){r(e)})),c=function(r,t){r(e)},f=d=function(){},s},d=function(e){return s.resolved=!1,s.rejected=!0,s.pending=!1,a.forEach((function(r){r(e)})),c=function(r,t){t(e)},f=d=function(){},s};this.cancel=function(){return i?i.cancel():d(new t),s},this.timeout=function(e){if(i)i.timeout(e);else{var r=setTimeout((function(){d(new o("Promise timed out after "+e+" ms"))}),e);s.always((function(){clearTimeout(r)}))}return s},n((function(e){f(e)}),(function(e){d(e)}))}function r(e,r,t){return function(n){try{var o=e(n);o&&"function"==typeof o.then&&"function"==typeof o.catch?o.then(r,t):r(o)}catch(e){t(e)}}}function t(e){this.message=e||"promise cancelled",this.stack=(new Error).stack}function o(e){this.message=e||"timeout exceeded",this.stack=(new Error).stack}return n=1,e.prototype.catch=function(e){return this.then(null,e)},e.prototype.always=function(e){return this.then(e,e)},e.prototype.finally=function(r){var t=this,n=function(){return new e((function(e){return e()})).then(r).then((function(){return t}))};return this.then(n,n)},e.all=function(r){return new e((function(e,t){var n=r.length,o=[];n?r.forEach((function(r,i){r.then((function(r){o[i]=r,0==--n&&e(o)}),(function(e){n=0,t(e)}))})):e(o)}))},e.defer=function(){var r={};return r.promise=new e((function(e,t){r.resolve=e,r.reject=t})),r},t.prototype=new Error,t.prototype.constructor=Error,t.prototype.name="CancellationError",e.CancellationError=t,o.prototype=new Error,o.prototype.constructor=Error,o.prototype.name="TimeoutError",e.TimeoutError=o,i.Promise=e,i}function u(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==t.return||t.return()}finally{if(a)throw i}}}}function c(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function f(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var p,l,h,m,k,w,y,v,g={exports:{}},b={};function O(){return p||(p=1,b.validateOptions=function(e,r,t){if(e){var n=e?Object.keys(e):[],o=n.find((function(e){return!r.includes(e)}));if(o)throw new Error('Object "'+t+'" contains an unknown option "'+o+'"');var i=r.find((function(e){return Object.prototype[e]&&!n.includes(e)}));if(i)throw new Error('Object "'+t+'" contains an inherited option "'+i+'" which is not defined in the object itself but in its prototype. Only plain objects are allowed. Please remove the option from the prototype or override it with a value "undefined".');return e}},b.workerOptsNames=["credentials","name","type"],b.forkOptsNames=["cwd","detached","env","execPath","execArgv","gid","serialization","signal","killSignal","silent","stdio","uid","windowsVerbatimArguments","timeout"],b.workerThreadOptsNames=["argv","env","eval","execArgv","stdin","stdout","stderr","workerData","trackUnmanagedFds","transferList","resourceLimits","name"]),b}function T(){if(m)return g.exports;m=1;var e=s().Promise,r=o,t=O(),n=t.validateOptions,i=t.forkOptsNames,u=t.workerThreadOptsNames,p=t.workerOptsNames,k="__workerpool-terminate__",w="__workerpool-cleanup__";function y(){var e=b();if(!e)throw new Error("WorkerPool: workerType = 'thread' is not supported, Node >= 11.7.0 required");return e}function v(){if("function"!=typeof Worker&&("object"!==("undefined"==typeof Worker?"undefined":d(Worker))||"function"!=typeof Worker.prototype.constructor))throw new Error("WorkerPool: Web Workers not supported")}function b(){try{return require("worker_threads")}catch(e){if("object"===d(e)&&null!==e&&"MODULE_NOT_FOUND"===e.code)return null;throw e}}function T(e,r,t){n(r,p,"workerOpts");var o=new t(e,r);return o.isBrowserWorker=!0,o.on=function(e,r){this.addEventListener(e,(function(e){r(e.data)}))},o.send=function(e,r){this.postMessage(e,r)},o}function x(e,r,t){var o,i;n(null==t?void 0:t.workerThreadOpts,u,"workerThreadOpts");var s=new r.Worker(e,function(e){for(var r=1;r-1&&o.push(e)})),Object.assign({},e,{forkArgs:e.forkArgs,forkOpts:Object.assign({},e.forkOpts,{execArgv:(e.forkOpts&&e.forkOpts.execArgv||[]).concat(o),stdio:e.emitStdStreams?"pipe":void 0})})}function W(e){for(var r=new Error(""),t=Object.keys(e),n=0;n0},_.prototype.terminate=function(e,r){var t=this;if(e){for(var n in this.processing)void 0!==this.processing[n]&&this.processing[n].resolver.reject(new Error("Worker terminated"));this.processing=Object.create(null)}for(var o=0,i=Object.values(t.tracking);o=65535)throw new Error("WorkerPool debug port limit reached: "+e+">= 65535");return this.ports[e]=!0,this.length++,e},e.prototype.releasePort=function(e){delete this.ports[e],this.length--},k}());function i(e,n){"string"==typeof e?this.script=e||null:(this.script=null,n=e),this.workers=[],this.tasks=[],n=n||{},this.forkArgs=Object.freeze(n.forkArgs||[]),this.forkOpts=Object.freeze(n.forkOpts||{}),this.workerOpts=Object.freeze(n.workerOpts||{}),this.workerThreadOpts=Object.freeze(n.workerThreadOpts||{}),this.debugPortStart=n.debugPortStart||43210,this.nodeWorker=n.nodeWorker,this.workerType=n.workerType||n.nodeWorker||"auto",this.maxQueueSize=n.maxQueueSize||1/0,this.workerTerminateTimeout=n.workerTerminateTimeout||1e3,this.onCreateWorker=n.onCreateWorker||function(){return null},this.onTerminateWorker=n.onTerminateWorker||function(){return null},this.emitStdStreams=n.emitStdStreams||!1,n&&"maxWorkers"in n?(!function(e){if(!u(e)||!a(e)||e<1)throw new TypeError("Option maxWorkers must be an integer number >= 1")}(n.maxWorkers),this.maxWorkers=n.maxWorkers):this.maxWorkers=Math.max((t.cpus||4)-1,1),n&&"minWorkers"in n&&("max"===n.minWorkers?this.minWorkers=this.maxWorkers:(!function(e){if(!u(e)||!a(e)||e<0)throw new TypeError("Option minWorkers must be an integer number >= 0")}(n.minWorkers),this.minWorkers=n.minWorkers,this.maxWorkers=Math.max(this.minWorkers,this.maxWorkers)),this._ensureMinWorkers()),this._boundNext=this._next.bind(this),"thread"===this.workerType&&r.ensureWorkerThreads()}function u(e){return"number"==typeof e}function a(e){return Math.round(e)==e}return i.prototype.exec=function(r,t,n){if(t&&!Array.isArray(t))throw new TypeError('Array expected as argument "params"');if("string"==typeof r){var o=e.defer();if(this.tasks.length>=this.maxQueueSize)throw new Error("Max queue size of "+this.maxQueueSize+" reached");var i=this.tasks,s={method:r,params:t,resolver:o,timeout:null,options:n};i.push(s);var u=o.promise.timeout;return o.promise.timeout=function(e){return-1!==i.indexOf(s)?(s.timeout=e,o.promise):u.call(o.promise,e)},this._next(),o.promise}if("function"==typeof r)return this.exec("run",[String(r),t],n);throw new TypeError('Function or string expected as argument "method"')},i.prototype.proxy=function(){if(arguments.length>0)throw new Error("No arguments expected");var e=this;return this.exec("methods").then((function(r){var t={};return r.forEach((function(r){t[r]=function(){return e.exec(r,Array.prototype.slice.call(arguments))}})),t}))},i.prototype._next=function(){if(this.tasks.length>0){var e=this._getWorker();if(e){var r=this,t=this.tasks.shift();if(t.resolver.promise.pending){var n=e.exec(t.method,t.params,t.resolver,t.options).then(r._boundNext).catch((function(){if(e.terminated)return r._removeWorker(e)})).then((function(){r._next()}));"number"==typeof t.timeout&&n.timeout(t.timeout)}else r._next()}}},i.prototype._getWorker=function(){for(var e=this.workers,r=0;r + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ diff --git a/node_modules/workerpool/dist/workerpool.min.js.map b/node_modules/workerpool/dist/workerpool.min.js.map new file mode 100644 index 0000000..d3cc1c9 --- /dev/null +++ b/node_modules/workerpool/dist/workerpool.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workerpool.min.js","sources":["../src/environment.js","../src/Promise.js","../src/validateOptions.js","../src/WorkerHandler.js","../src/generated/embeddedWorker.js","../src/Pool.js","../src/debug-port-allocator.js","../src/transfer.js","../src/worker.js","../src/index.js"],"sourcesContent":["\n// source: https://github.com/flexdinesh/browser-or-node\n// source: https://github.com/mozilla/pdf.js/blob/7ea0e40e588864cd938d1836ec61f1928d3877d3/src/shared/util.js#L24\nvar isNode = function (nodeProcess) {\n return (\n typeof nodeProcess !== 'undefined' &&\n nodeProcess.versions != null &&\n nodeProcess.versions.node != null &&\n nodeProcess + '' === '[object process]'\n );\n}\nmodule.exports.isNode = isNode\n\n// determines the JavaScript platform: browser or node\nmodule.exports.platform = typeof process !== 'undefined' && isNode(process)\n ? 'node'\n : 'browser';\n\n// determines whether the code is running in main thread or not\n// note that in node.js we have to check both worker_thread and child_process\nvar worker_threads = module.exports.platform === 'node' && require('worker_threads');\nmodule.exports.isMainThread = module.exports.platform === 'node'\n ? ((!worker_threads || worker_threads.isMainThread) && !process.connected)\n : typeof Window !== 'undefined';\n\n// determines the number of cpus available\nmodule.exports.cpus = module.exports.platform === 'browser'\n ? self.navigator.hardwareConcurrency\n : require('os').cpus().length;\n\n","'use strict';\n\n/**\n * Promise\n *\n * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa \n * @template T\n * @template [E=Error]\n * @param {Function} handler Called as handler(resolve: Function, reject: Function)\n * @param {Promise} [parent] Parent promise for propagation of cancel and timeout\n */\nfunction Promise(handler, parent) {\n var me = this;\n\n if (!(this instanceof Promise)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n\n if (typeof handler !== 'function') {\n throw new SyntaxError('Function parameter handler(resolve, reject) missing');\n }\n\n var _onSuccess = [];\n var _onFail = [];\n\n // status\n /**\n * @readonly\n */\n this.resolved = false;\n /**\n * @readonly\n */\n this.rejected = false;\n /**\n * @readonly\n */\n this.pending = true;\n /**\n * @readonly\n */\n this[Symbol.toStringTag] = 'Promise';\n\n /**\n * Process onSuccess and onFail callbacks: add them to the queue.\n * Once the promise is resolved, the function _promise is replace.\n * @param {Function} onSuccess\n * @param {Function} onFail\n * @private\n */\n var _process = function (onSuccess, onFail) {\n _onSuccess.push(onSuccess);\n _onFail.push(onFail);\n };\n\n /**\n * Add an onSuccess callback and optionally an onFail callback to the Promise\n * @template TT\n * @template [TE=never]\n * @param {(r: T) => TT | PromiseLike} onSuccess\n * @param {(r: E) => TE | PromiseLike} [onFail]\n * @returns {Promise} promise\n */\n this.then = function (onSuccess, onFail) {\n return new Promise(function (resolve, reject) {\n var s = onSuccess ? _then(onSuccess, resolve, reject) : resolve;\n var f = onFail ? _then(onFail, resolve, reject) : reject;\n\n _process(s, f);\n }, me);\n };\n\n /**\n * Resolve the promise\n * @param {*} result\n * @type {Function}\n */\n var _resolve = function (result) {\n // update status\n me.resolved = true;\n me.rejected = false;\n me.pending = false;\n\n _onSuccess.forEach(function (fn) {\n fn(result);\n });\n\n _process = function (onSuccess, onFail) {\n onSuccess(result);\n };\n\n _resolve = _reject = function () { };\n\n return me;\n };\n\n /**\n * Reject the promise\n * @param {Error} error\n * @type {Function}\n */\n var _reject = function (error) {\n // update status\n me.resolved = false;\n me.rejected = true;\n me.pending = false;\n\n _onFail.forEach(function (fn) {\n fn(error);\n });\n\n _process = function (onSuccess, onFail) {\n onFail(error);\n };\n\n _resolve = _reject = function () { }\n\n return me;\n };\n\n /**\n * Cancel the promise. This will reject the promise with a CancellationError\n * @returns {this} self\n */\n this.cancel = function () {\n if (parent) {\n parent.cancel();\n }\n else {\n _reject(new CancellationError());\n }\n\n return me;\n };\n\n /**\n * Set a timeout for the promise. If the promise is not resolved within\n * the time, the promise will be cancelled and a TimeoutError is thrown.\n * If the promise is resolved in time, the timeout is removed.\n * @param {number} delay Delay in milliseconds\n * @returns {this} self\n */\n this.timeout = function (delay) {\n if (parent) {\n parent.timeout(delay);\n }\n else {\n var timer = setTimeout(function () {\n _reject(new TimeoutError('Promise timed out after ' + delay + ' ms'));\n }, delay);\n\n me.always(function () {\n clearTimeout(timer);\n });\n }\n\n return me;\n };\n\n // attach handler passing the resolve and reject functions\n handler(function (result) {\n _resolve(result);\n }, function (error) {\n _reject(error);\n });\n}\n\n/**\n * Execute given callback, then call resolve/reject based on the returned result\n * @param {Function} callback\n * @param {Function} resolve\n * @param {Function} reject\n * @returns {Function}\n * @private\n */\nfunction _then(callback, resolve, reject) {\n return function (result) {\n try {\n var res = callback(result);\n if (res && typeof res.then === 'function' && typeof res['catch'] === 'function') {\n // method returned a promise\n res.then(resolve, reject);\n }\n else {\n resolve(res);\n }\n }\n catch (error) {\n reject(error);\n }\n }\n}\n\n/**\n * Add an onFail callback to the Promise\n * @template TT\n * @param {(error: E) => TT | PromiseLike} onFail\n * @returns {Promise} promise\n */\nPromise.prototype['catch'] = function (onFail) {\n return this.then(null, onFail);\n};\n\n// TODO: add support for Promise.catch(Error, callback)\n// TODO: add support for Promise.catch(Error, Error, callback)\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * @template TT\n * @param {() => Promise} fn\n * @returns {Promise} promise\n */\nPromise.prototype.always = function (fn) {\n return this.then(fn, fn);\n};\n\n/**\n * Execute given callback when the promise either resolves or rejects.\n * Same semantics as Node's Promise.finally()\n * @param {Function | null | undefined} [fn]\n * @returns {Promise} promise\n */\nPromise.prototype.finally = function (fn) {\n const me = this;\n\n const final = function() {\n return new Promise((resolve) => resolve())\n .then(fn)\n .then(() => me);\n };\n\n return this.then(final, final);\n}\n\n/**\n * Create a promise which resolves when all provided promises are resolved,\n * and fails when any of the promises resolves.\n * @param {Promise[]} promises\n * @returns {Promise} promise\n */\nPromise.all = function (promises){\n return new Promise(function (resolve, reject) {\n var remaining = promises.length,\n results = [];\n\n if (remaining) {\n promises.forEach(function (p, i) {\n p.then(function (result) {\n results[i] = result;\n remaining--;\n if (remaining == 0) {\n resolve(results);\n }\n }, function (error) {\n remaining = 0;\n reject(error);\n });\n });\n }\n else {\n resolve(results);\n }\n });\n};\n\n/**\n * Create a promise resolver\n * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver\n */\nPromise.defer = function () {\n var resolver = {};\n\n resolver.promise = new Promise(function (resolve, reject) {\n resolver.resolve = resolve;\n resolver.reject = reject;\n });\n\n return resolver;\n};\n\n/**\n * Create a cancellation error\n * @param {String} [message]\n * @extends Error\n */\nfunction CancellationError(message) {\n this.message = message || 'promise cancelled';\n this.stack = (new Error()).stack;\n}\n\nCancellationError.prototype = new Error();\nCancellationError.prototype.constructor = Error;\nCancellationError.prototype.name = 'CancellationError';\n\nPromise.CancellationError = CancellationError;\n\n\n/**\n * Create a timeout error\n * @param {String} [message]\n * @extends Error\n */\nfunction TimeoutError(message) {\n this.message = message || 'timeout exceeded';\n this.stack = (new Error()).stack;\n}\n\nTimeoutError.prototype = new Error();\nTimeoutError.prototype.constructor = Error;\nTimeoutError.prototype.name = 'TimeoutError';\n\nPromise.TimeoutError = TimeoutError;\n\n\nexports.Promise = Promise;\n","/**\n * Validate that the object only contains known option names\n * - Throws an error when unknown options are detected\n * - Throws an error when some of the allowed options are attached\n * @param {Object | undefined} options\n * @param {string[]} allowedOptionNames\n * @param {string} objectName\n * @retrun {Object} Returns the original options\n */\nexports.validateOptions = function validateOptions(options, allowedOptionNames, objectName) {\n if (!options) {\n return\n }\n\n var optionNames = options ? Object.keys(options) : []\n\n // check for unknown properties\n var unknownOptionName = optionNames.find(optionName => !allowedOptionNames.includes(optionName))\n if (unknownOptionName) {\n throw new Error('Object \"' + objectName + '\" contains an unknown option \"' + unknownOptionName + '\"')\n }\n\n // check for inherited properties which are not present on the object itself\n var illegalOptionName = allowedOptionNames.find(allowedOptionName => {\n return Object.prototype[allowedOptionName] && !optionNames.includes(allowedOptionName)\n })\n if (illegalOptionName) {\n throw new Error('Object \"' + objectName + '\" contains an inherited option \"' + illegalOptionName + '\" which is ' +\n 'not defined in the object itself but in its prototype. Only plain objects are allowed. ' +\n 'Please remove the option from the prototype or override it with a value \"undefined\".')\n }\n\n return options\n}\n\n// source: https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker\nexports.workerOptsNames = [\n 'credentials', 'name', 'type' ]\n\n// source: https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options\nexports.forkOptsNames = [\n 'cwd', 'detached', 'env', 'execPath', 'execArgv', 'gid', 'serialization',\n 'signal', 'killSignal', 'silent', 'stdio', 'uid', 'windowsVerbatimArguments',\n 'timeout'\n]\n\n// source: https://nodejs.org/api/worker_threads.html#new-workerfilename-options\nexports.workerThreadOptsNames = [\n 'argv', 'env', 'eval', 'execArgv', 'stdin', 'stdout', 'stderr', 'workerData',\n 'trackUnmanagedFds', 'transferList', 'resourceLimits', 'name'\n]\n","'use strict';\n\nvar {Promise} = require('./Promise');\nvar environment = require('./environment');\nconst {validateOptions, forkOptsNames, workerThreadOptsNames, workerOptsNames} = require(\"./validateOptions\");\n\n/**\n * Special message sent by parent which causes a child process worker to terminate itself.\n * Not a \"message object\"; this string is the entire message.\n */\nvar TERMINATE_METHOD_ID = '__workerpool-terminate__';\n\n/**\n * Special message by parent which causes a child process worker to perform cleaup\n * steps before determining if the child process worker should be terminated.\n */\nvar CLEANUP_METHOD_ID = '__workerpool-cleanup__';\n\nfunction ensureWorkerThreads() {\n var WorkerThreads = tryRequireWorkerThreads()\n if (!WorkerThreads) {\n throw new Error('WorkerPool: workerType = \\'thread\\' is not supported, Node >= 11.7.0 required')\n }\n\n return WorkerThreads;\n}\n\n// check whether Worker is supported by the browser\nfunction ensureWebWorker() {\n // Workaround for a bug in PhantomJS (Or QtWebkit): https://github.com/ariya/phantomjs/issues/14534\n if (typeof Worker !== 'function' && (typeof Worker !== 'object' || typeof Worker.prototype.constructor !== 'function')) {\n throw new Error('WorkerPool: Web Workers not supported');\n }\n}\n\nfunction tryRequireWorkerThreads() {\n try {\n return require('worker_threads');\n } catch(error) {\n if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') {\n // no worker_threads available (old version of node.js)\n return null;\n } else {\n throw error;\n }\n }\n}\n\n// get the default worker script\nfunction getDefaultWorker() {\n if (environment.platform === 'browser') {\n // test whether the browser supports all features that we need\n if (typeof Blob === 'undefined') {\n throw new Error('Blob not supported by the browser');\n }\n if (!window.URL || typeof window.URL.createObjectURL !== 'function') {\n throw new Error('URL.createObjectURL not supported by the browser');\n }\n\n // use embedded worker.js\n var blob = new Blob([require('./generated/embeddedWorker')], {type: 'text/javascript'});\n return window.URL.createObjectURL(blob);\n }\n else {\n // use external worker.js in current directory\n return __dirname + '/worker.js';\n }\n}\n\nfunction setupWorker(script, options) {\n if (options.workerType === 'web') { // browser only\n ensureWebWorker();\n return setupBrowserWorker(script, options.workerOpts, Worker);\n } else if (options.workerType === 'thread') { // node.js only\n WorkerThreads = ensureWorkerThreads();\n return setupWorkerThreadWorker(script, WorkerThreads, options);\n } else if (options.workerType === 'process' || !options.workerType) { // node.js only\n return setupProcessWorker(script, resolveForkOptions(options), require('child_process'));\n } else { // options.workerType === 'auto' or undefined\n if (environment.platform === 'browser') {\n ensureWebWorker();\n return setupBrowserWorker(script, options.workerOpts, Worker);\n }\n else { // environment.platform === 'node'\n var WorkerThreads = tryRequireWorkerThreads();\n if (WorkerThreads) {\n return setupWorkerThreadWorker(script, WorkerThreads, options);\n } else {\n return setupProcessWorker(script, resolveForkOptions(options), require('child_process'));\n }\n }\n }\n}\n\nfunction setupBrowserWorker(script, workerOpts, Worker) {\n // validate the options right before creating the worker (not when creating the pool)\n validateOptions(workerOpts, workerOptsNames, 'workerOpts')\n\n // create the web worker\n var worker = new Worker(script, workerOpts);\n\n worker.isBrowserWorker = true;\n // add node.js API to the web worker\n worker.on = function (event, callback) {\n this.addEventListener(event, function (message) {\n callback(message.data);\n });\n };\n worker.send = function (message, transfer) {\n this.postMessage(message, transfer);\n };\n return worker;\n}\n\nfunction setupWorkerThreadWorker(script, WorkerThreads, options) {\n // validate the options right before creating the worker thread (not when creating the pool)\n validateOptions(options?.workerThreadOpts, workerThreadOptsNames, 'workerThreadOpts')\n\n var worker = new WorkerThreads.Worker(script, {\n stdout: options?.emitStdStreams ?? false, // pipe worker.STDOUT to process.STDOUT if not requested\n stderr: options?.emitStdStreams ?? false, // pipe worker.STDERR to process.STDERR if not requested\n ...options?.workerThreadOpts\n });\n worker.isWorkerThread = true;\n worker.send = function(message, transfer) {\n this.postMessage(message, transfer);\n };\n\n worker.kill = function() {\n this.terminate();\n return true;\n };\n\n worker.disconnect = function() {\n this.terminate();\n };\n\n if (options?.emitStdStreams) {\n worker.stdout.on('data', (data) => worker.emit(\"stdout\", data))\n worker.stderr.on('data', (data) => worker.emit(\"stderr\", data))\n }\n\n return worker;\n}\n\nfunction setupProcessWorker(script, options, child_process) {\n // validate the options right before creating the child process (not when creating the pool)\n validateOptions(options.forkOpts, forkOptsNames, 'forkOpts')\n\n // no WorkerThreads, fallback to sub-process based workers\n var worker = child_process.fork(\n script,\n options.forkArgs,\n options.forkOpts\n );\n\n // ignore transfer argument since it is not supported by process\n var send = worker.send;\n worker.send = function (message) {\n return send.call(worker, message);\n };\n\n if (options.emitStdStreams) {\n worker.stdout.on('data', (data) => worker.emit(\"stdout\", data))\n worker.stderr.on('data', (data) => worker.emit(\"stderr\", data))\n }\n\n worker.isChildProcess = true;\n return worker;\n}\n\n// add debug flags to child processes if the node inspector is active\nfunction resolveForkOptions(opts) {\n opts = opts || {};\n\n var processExecArgv = process.execArgv.join(' ');\n var inspectorActive = processExecArgv.indexOf('--inspect') !== -1;\n var debugBrk = processExecArgv.indexOf('--debug-brk') !== -1;\n\n var execArgv = [];\n if (inspectorActive) {\n execArgv.push('--inspect=' + opts.debugPort);\n\n if (debugBrk) {\n execArgv.push('--debug-brk');\n }\n }\n\n process.execArgv.forEach(function(arg) {\n if (arg.indexOf('--max-old-space-size') > -1) {\n execArgv.push(arg)\n }\n })\n\n return Object.assign({}, opts, {\n forkArgs: opts.forkArgs,\n forkOpts: Object.assign({}, opts.forkOpts, {\n execArgv: (opts.forkOpts && opts.forkOpts.execArgv || [])\n .concat(execArgv),\n stdio: opts.emitStdStreams ? \"pipe\": undefined\n })\n });\n}\n\n/**\n * Converts a serialized error to Error\n * @param {Object} obj Error that has been serialized and parsed to object\n * @return {Error} The equivalent Error.\n */\nfunction objectToError (obj) {\n var temp = new Error('')\n var props = Object.keys(obj)\n\n for (var i = 0; i < props.length; i++) {\n temp[props[i]] = obj[props[i]]\n }\n\n return temp\n}\n\nfunction handleEmittedStdPayload(handler, payload) {\n // TODO: refactor if parallel task execution gets added\n Object.values(handler.processing)\n .forEach(task => task?.options?.on(payload));\n \n Object.values(handler.tracking)\n .forEach(task => task?.options?.on(payload)); \n}\n\n/**\n * A WorkerHandler controls a single worker. This worker can be a child process\n * on node.js or a WebWorker in a browser environment.\n * @param {String} [script] If no script is provided, a default worker with a\n * function run will be created.\n * @param {import('./types.js').WorkerPoolOptions} [_options] See docs\n * @constructor\n */\nfunction WorkerHandler(script, _options) {\n var me = this;\n var options = _options || {};\n\n this.script = script || getDefaultWorker();\n this.worker = setupWorker(this.script, options);\n this.debugPort = options.debugPort;\n this.forkOpts = options.forkOpts;\n this.forkArgs = options.forkArgs;\n this.workerOpts = options.workerOpts;\n this.workerThreadOpts = options.workerThreadOpts\n this.workerTerminateTimeout = options.workerTerminateTimeout;\n\n // The ready message is only sent if the worker.add method is called (And the default script is not used)\n if (!script) {\n this.worker.ready = true;\n }\n\n // queue for requests that are received before the worker is ready\n this.requestQueue = [];\n\n this.worker.on(\"stdout\", function (data) {\n handleEmittedStdPayload(me, {\"stdout\": data.toString()})\n })\n this.worker.on(\"stderr\", function (data) {\n handleEmittedStdPayload(me, {\"stderr\": data.toString()})\n })\n\n this.worker.on('message', function (response) {\n if (me.terminated) {\n return;\n }\n if (typeof response === 'string' && response === 'ready') {\n me.worker.ready = true;\n dispatchQueuedRequests();\n } else {\n // find the task from the processing queue, and run the tasks callback\n var id = response.id;\n var task = me.processing[id];\n if (task !== undefined) {\n if (response.isEvent) {\n if (task.options && typeof task.options.on === 'function') {\n task.options.on(response.payload);\n }\n } else {\n // remove the task from the queue\n delete me.processing[id];\n\n // test if we need to terminate\n if (me.terminating === true) {\n // complete worker termination if all tasks are finished\n me.terminate();\n }\n\n // resolve the task's promise\n if (response.error) {\n task.resolver.reject(objectToError(response.error));\n }\n else {\n task.resolver.resolve(response.result);\n }\n }\n } else {\n // if the task is not the current, it might be tracked for cleanup\n var task = me.tracking[id];\n if (task !== undefined) {\n if (response.isEvent) {\n if (task.options && typeof task.options.on === 'function') {\n task.options.on(response.payload);\n }\n }\n } \n }\n\n if (response.method === CLEANUP_METHOD_ID) {\n var trackedTask = me.tracking[response.id];\n if (trackedTask !== undefined) {\n if (response.error) {\n clearTimeout(trackedTask.timeoutId);\n trackedTask.resolver.reject(objectToError(response.error))\n } else {\n me.tracking && clearTimeout(trackedTask.timeoutId);\n // if we do not encounter an error wrap the the original timeout error and reject\n trackedTask.resolver.reject(new WrappedTimeoutError(trackedTask.error));\n }\n }\n delete me.tracking[id];\n }\n }\n });\n\n // reject all running tasks on worker error\n function onError(error) {\n me.terminated = true;\n\n for (var id in me.processing) {\n if (me.processing[id] !== undefined) {\n me.processing[id].resolver.reject(error);\n }\n }\n \n me.processing = Object.create(null);\n }\n\n // send all queued requests to worker\n function dispatchQueuedRequests()\n {\n for(const request of me.requestQueue.splice(0)) {\n me.worker.send(request.message, request.transfer);\n }\n }\n\n var worker = this.worker;\n // listen for worker messages error and exit\n this.worker.on('error', onError);\n this.worker.on('exit', function (exitCode, signalCode) {\n var message = 'Workerpool Worker terminated Unexpectedly\\n';\n\n message += ' exitCode: `' + exitCode + '`\\n';\n message += ' signalCode: `' + signalCode + '`\\n';\n\n message += ' workerpool.script: `' + me.script + '`\\n';\n message += ' spawnArgs: `' + worker.spawnargs + '`\\n';\n message += ' spawnfile: `' + worker.spawnfile + '`\\n'\n\n message += ' stdout: `' + worker.stdout + '`\\n'\n message += ' stderr: `' + worker.stderr + '`\\n'\n\n onError(new Error(message));\n });\n\n this.processing = Object.create(null); // queue with tasks currently in progress\n this.tracking = Object.create(null); // queue with tasks being monitored for cleanup status\n this.terminating = false;\n this.terminated = false;\n this.cleaning = false;\n this.terminationHandler = null;\n this.lastId = 0;\n}\n\n/**\n * Get a list with methods available on the worker.\n * @return {Promise.} methods\n */\nWorkerHandler.prototype.methods = function () {\n return this.exec('methods');\n};\n\n/**\n * Execute a method with given parameters on the worker\n * @param {String} method\n * @param {Array} [params]\n * @param {{resolve: Function, reject: Function}} [resolver]\n * @param {import('./types.js').ExecOptions} [options]\n * @return {Promise.<*, Error>} result\n */\nWorkerHandler.prototype.exec = function(method, params, resolver, options) {\n if (!resolver) {\n resolver = Promise.defer();\n }\n\n // generate a unique id for the task\n var id = ++this.lastId;\n\n // register a new task as being in progress\n this.processing[id] = {\n id: id,\n resolver: resolver,\n options: options\n };\n\n // build a JSON-RPC request\n var request = {\n message: {\n id: id,\n method: method,\n params: params\n },\n transfer: options && options.transfer\n };\n\n if (this.terminated) {\n resolver.reject(new Error('Worker is terminated'));\n } else if (this.worker.ready) {\n // send the request to the worker\n this.worker.send(request.message, request.transfer);\n } else {\n this.requestQueue.push(request);\n }\n\n // on cancellation, force the worker to terminate\n var me = this;\n return resolver.promise.catch(function (error) {\n if (error instanceof Promise.CancellationError || error instanceof Promise.TimeoutError) {\n me.tracking[id] = {\n id,\n resolver: Promise.defer(),\n options: options,\n error,\n };\n \n // remove this task from the queue. It is already rejected (hence this\n // catch event), and else it will be rejected again when terminating\n delete me.processing[id];\n\n me.tracking[id].resolver.promise = me.tracking[id].resolver.promise.catch(function(err) {\n delete me.tracking[id];\n\n // if we find the error is an instance of WrappedTimeoutError we know the error should not cause termination\n // as the response from the worker did not contain an error. We still wish to throw the original timeout error\n // to the caller.\n if (err instanceof WrappedTimeoutError) {\n throw err.error;\n }\n\n var promise = me.terminateAndNotify(true)\n .then(function() { \n throw err;\n }, function(err) {\n throw err;\n });\n\n return promise;\n });\n \n me.worker.send({\n id,\n method: CLEANUP_METHOD_ID \n });\n \n \n /**\n * Sets a timeout to reject the cleanup operation if the message sent to the worker\n * does not receive a response. see worker.tryCleanup for worker cleanup operations.\n * Here we use the workerTerminateTimeout as the worker will be terminated if the timeout does invoke.\n * \n * We need this timeout in either case of a Timeout or Cancellation Error as if\n * the worker does not send a message we still need to give a window of time for a response.\n * \n * The workerTermniateTimeout is used here if this promise is rejected the worker cleanup\n * operations will occure.\n */\n me.tracking[id].timeoutId = setTimeout(function() {\n me.tracking[id].resolver.reject(error);\n }, me.workerTerminateTimeout);\n\n return me.tracking[id].resolver.promise;\n } else {\n throw error;\n }\n })\n};\n\n/**\n * Test whether the worker is processing any tasks or cleaning up before termination.\n * @return {boolean} Returns true if the worker is busy\n */\nWorkerHandler.prototype.busy = function () {\n return this.cleaning || Object.keys(this.processing).length > 0;\n};\n\n/**\n * Terminate the worker.\n * @param {boolean} [force=false] If false (default), the worker is terminated\n * after finishing all tasks currently in\n * progress. If true, the worker will be\n * terminated immediately.\n * @param {function} [callback=null] If provided, will be called when process terminates.\n */\nWorkerHandler.prototype.terminate = function (force, callback) {\n var me = this;\n if (force) {\n // cancel all tasks in progress\n for (var id in this.processing) {\n if (this.processing[id] !== undefined) {\n this.processing[id].resolver.reject(new Error('Worker terminated'));\n }\n }\n\n this.processing = Object.create(null);\n }\n\n // If we are terminating, cancel all tracked task for cleanup\n for (var task of Object.values(me.tracking)) {\n clearTimeout(task.timeoutId);\n task.resolver.reject(new Error('Worker Terminating'));\n }\n\n me.tracking = Object.create(null);\n\n if (typeof callback === 'function') {\n this.terminationHandler = callback;\n }\n if (!this.busy()) {\n // all tasks are finished. kill the worker\n var cleanup = function(err) {\n me.terminated = true;\n me.cleaning = false;\n\n if (me.worker != null && me.worker.removeAllListeners) {\n // removeAllListeners is only available for child_process\n me.worker.removeAllListeners('message');\n }\n me.worker = null;\n me.terminating = false;\n if (me.terminationHandler) {\n me.terminationHandler(err, me);\n } else if (err) {\n throw err;\n }\n }\n\n if (this.worker) {\n if (typeof this.worker.kill === 'function') {\n if (this.worker.killed) {\n cleanup(new Error('worker already killed!'));\n return;\n }\n\n // child process and worker threads\n var cleanExitTimeout = setTimeout(function() {\n if (me.worker) {\n me.worker.kill();\n }\n }, this.workerTerminateTimeout);\n\n this.worker.once('exit', function() {\n clearTimeout(cleanExitTimeout);\n if (me.worker) {\n me.worker.killed = true;\n }\n cleanup();\n });\n\n if (this.worker.ready) {\n this.worker.send(TERMINATE_METHOD_ID);\n } else {\n this.requestQueue.push({ message: TERMINATE_METHOD_ID });\n }\n\n // mark that the worker is cleaning up resources\n // to prevent new tasks from being executed\n this.cleaning = true;\n return;\n }\n else if (typeof this.worker.terminate === 'function') {\n this.worker.terminate(); // web worker\n this.worker.killed = true;\n }\n else {\n throw new Error('Failed to terminate worker');\n }\n }\n cleanup();\n }\n else {\n // we can't terminate immediately, there are still tasks being executed\n this.terminating = true;\n }\n};\n\n/**\n * Terminate the worker, returning a Promise that resolves when the termination has been done.\n * @param {boolean} [force=false] If false (default), the worker is terminated\n * after finishing all tasks currently in\n * progress. If true, the worker will be\n * terminated immediately.\n * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected\n * after timeout if worker process has not been terminated.\n * @return {Promise.}\n */\nWorkerHandler.prototype.terminateAndNotify = function (force, timeout) {\n var resolver = Promise.defer();\n if (timeout) {\n resolver.promise.timeout(timeout);\n }\n this.terminate(force, function(err, worker) {\n if (err) {\n resolver.reject(err);\n } else {\n resolver.resolve(worker);\n }\n });\n return resolver.promise;\n};\n\n/**\n* Wrapper error type to denote that a TimeoutError has already been proceesed\n* and we should skip cleanup operations\n* @param {Promise.TimeoutError} timeoutError\n*/\nfunction WrappedTimeoutError(timeoutError) {\n this.error = timeoutError;\n this.stack = (new Error()).stack;\n}\n\nmodule.exports = WorkerHandler;\nmodule.exports._tryRequireWorkerThreads = tryRequireWorkerThreads;\nmodule.exports._setupProcessWorker = setupProcessWorker;\nmodule.exports._setupBrowserWorker = setupBrowserWorker;\nmodule.exports._setupWorkerThreadWorker = setupWorkerThreadWorker;\nmodule.exports.ensureWorkerThreads = ensureWorkerThreads;\n","/**\n * embeddedWorker.js contains an embedded version of worker.js.\n * This file is automatically generated,\n * changes made in this file will be overwritten.\n */\nmodule.exports = \"!function(e,n){\\\"object\\\"==typeof exports&&\\\"undefined\\\"!=typeof module?module.exports=n():\\\"function\\\"==typeof define&&define.amd?define(n):(e=\\\"undefined\\\"!=typeof globalThis?globalThis:e||self).worker=n()}(this,(function(){\\\"use strict\\\";function e(n){return e=\\\"function\\\"==typeof Symbol&&\\\"symbol\\\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\\\"function\\\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\\\"symbol\\\":typeof e},e(n)}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\\\"default\\\")?e.default:e}var t={};var r=function(e,n){this.message=e,this.transfer=n},o={};function i(e,n){var t=this;if(!(this instanceof i))throw new SyntaxError(\\\"Constructor must be called with the new operator\\\");if(\\\"function\\\"!=typeof e)throw new SyntaxError(\\\"Function parameter handler(resolve, reject) missing\\\");var r=[],o=[];this.resolved=!1,this.rejected=!1,this.pending=!0,this[Symbol.toStringTag]=\\\"Promise\\\";var a=function(e,n){r.push(e),o.push(n)};this.then=function(e,n){return new i((function(t,r){var o=e?s(e,t,r):t,i=n?s(n,t,r):r;a(o,i)}),t)};var f=function(e){return t.resolved=!0,t.rejected=!1,t.pending=!1,r.forEach((function(n){n(e)})),a=function(n,t){n(e)},f=d=function(){},t},d=function(e){return t.resolved=!1,t.rejected=!0,t.pending=!1,o.forEach((function(n){n(e)})),a=function(n,t){t(e)},f=d=function(){},t};this.cancel=function(){return n?n.cancel():d(new u),t},this.timeout=function(e){if(n)n.timeout(e);else{var r=setTimeout((function(){d(new c(\\\"Promise timed out after \\\"+e+\\\" ms\\\"))}),e);t.always((function(){clearTimeout(r)}))}return t},e((function(e){f(e)}),(function(e){d(e)}))}function s(e,n,t){return function(r){try{var o=e(r);o&&\\\"function\\\"==typeof o.then&&\\\"function\\\"==typeof o.catch?o.then(n,t):n(o)}catch(e){t(e)}}}function u(e){this.message=e||\\\"promise cancelled\\\",this.stack=(new Error).stack}function c(e){this.message=e||\\\"timeout exceeded\\\",this.stack=(new Error).stack}return i.prototype.catch=function(e){return this.then(null,e)},i.prototype.always=function(e){return this.then(e,e)},i.prototype.finally=function(e){var n=this,t=function(){return new i((function(e){return e()})).then(e).then((function(){return n}))};return this.then(t,t)},i.all=function(e){return new i((function(n,t){var r=e.length,o=[];r?e.forEach((function(e,i){e.then((function(e){o[i]=e,0==--r&&n(o)}),(function(e){r=0,t(e)}))})):n(o)}))},i.defer=function(){var e={};return e.promise=new i((function(n,t){e.resolve=n,e.reject=t})),e},u.prototype=new Error,u.prototype.constructor=Error,u.prototype.name=\\\"CancellationError\\\",i.CancellationError=u,c.prototype=new Error,c.prototype.constructor=Error,c.prototype.name=\\\"TimeoutError\\\",i.TimeoutError=c,o.Promise=i,function(n){var t=r,i=o.Promise,s=\\\"__workerpool-cleanup__\\\",u={exit:function(){}},c={addAbortListener:function(e){u.abortListeners.push(e)},emit:u.emit};if(\\\"undefined\\\"!=typeof self&&\\\"function\\\"==typeof postMessage&&\\\"function\\\"==typeof addEventListener)u.on=function(e,n){addEventListener(e,(function(e){n(e.data)}))},u.send=function(e,n){n?postMessage(e,n):postMessage(e)};else{if(\\\"undefined\\\"==typeof process)throw new Error(\\\"Script must be executed as a worker\\\");var a;try{a=require(\\\"worker_threads\\\")}catch(n){if(\\\"object\\\"!==e(n)||null===n||\\\"MODULE_NOT_FOUND\\\"!==n.code)throw n}if(a&&null!==a.parentPort){var f=a.parentPort;u.send=f.postMessage.bind(f),u.on=f.on.bind(f),u.exit=process.exit.bind(process)}else u.on=process.on.bind(process),u.send=function(e){process.send(e)},u.on(\\\"disconnect\\\",(function(){process.exit(1)})),u.exit=process.exit.bind(process)}function d(e){return e&&e.toJSON?JSON.parse(JSON.stringify(e)):JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)))}function l(e){return e&&\\\"function\\\"==typeof e.then&&\\\"function\\\"==typeof e.catch}u.methods={},u.methods.run=function(e,n){var t=new Function(\\\"return (\\\"+e+\\\").apply(this, arguments);\\\");return t.worker=c,t.apply(t,n)},u.methods.methods=function(){return Object.keys(u.methods)},u.terminationHandler=void 0,u.abortListenerTimeout=1e3,u.abortListeners=[],u.terminateAndExit=function(e){var n=function(){u.exit(e)};if(!u.terminationHandler)return n();var t=u.terminationHandler(e);return l(t)?(t.then(n,n),t):(n(),new i((function(e,n){n(new Error(\\\"Worker terminating\\\"))})))},u.cleanup=function(e){if(!u.abortListeners.length)return u.send({id:e,method:s,error:d(new Error(\\\"Worker terminating\\\"))}),new i((function(e){e()}));var n,t=u.abortListeners.map((function(e){return e()})),r=new i((function(e,t){n=setTimeout((function(){t(new Error(\\\"Timeout occured waiting for abort handler, killing worker\\\"))}),u.abortListenerTimeout)})),o=i.all(t).then((function(){clearTimeout(n),u.abortListeners.length||(u.abortListeners=[])}),(function(){clearTimeout(n),u.exit()}));return new i((function(e,n){o.then(e,n),r.then(e,n)})).then((function(){u.send({id:e,method:s,error:null})}),(function(n){u.send({id:e,method:s,error:n?d(n):null})}))};var p=null;u.on(\\\"message\\\",(function(e){if(\\\"__workerpool-terminate__\\\"===e)return u.terminateAndExit(0);if(e.method===s)return u.cleanup(e.id);try{var n=u.methods[e.method];if(!n)throw new Error('Unknown method \\\"'+e.method+'\\\"');p=e.id;var r=n.apply(n,e.params);l(r)?r.then((function(n){n instanceof t?u.send({id:e.id,result:n.message,error:null},n.transfer):u.send({id:e.id,result:n,error:null}),p=null})).catch((function(n){u.send({id:e.id,result:null,error:d(n)}),p=null})):(r instanceof t?u.send({id:e.id,result:r.message,error:null},r.transfer):u.send({id:e.id,result:r,error:null}),p=null)}catch(n){u.send({id:e.id,result:null,error:d(n)})}})),u.register=function(e,n){if(e)for(var t in e)e.hasOwnProperty(t)&&(u.methods[t]=e[t],u.methods[t].worker=c);n&&(u.terminationHandler=n.onTerminate,u.abortListenerTimeout=n.abortListenerTimeout||1e3),u.send(\\\"ready\\\")},u.emit=function(e){if(p){if(e instanceof t)return void u.send({id:p,isEvent:!0,payload:e.message},e.transfer);u.send({id:p,isEvent:!0,payload:e})}},n.add=u.register,n.emit=u.emit}(t),n(t)}));\\n//# sourceMappingURL=worker.min.js.map\\n\";\n","var {Promise} = require('./Promise');\nvar WorkerHandler = require('./WorkerHandler');\nvar environment = require('./environment');\nvar DebugPortAllocator = require('./debug-port-allocator');\nvar DEBUG_PORT_ALLOCATOR = new DebugPortAllocator();\n/**\n * A pool to manage workers, which can be created using the function workerpool.pool.\n *\n * @param {String} [script] Optional worker script\n * @param {import('./types.js').WorkerPoolOptions} [options] See docs\n * @constructor\n */\nfunction Pool(script, options) {\n if (typeof script === 'string') {\n /** @readonly */\n this.script = script || null;\n }\n else {\n this.script = null;\n options = script;\n }\n\n /** @private */\n this.workers = []; // queue with all workers\n /** @private */\n this.tasks = []; // queue with tasks awaiting execution\n\n options = options || {};\n\n /** @readonly */\n this.forkArgs = Object.freeze(options.forkArgs || []);\n /** @readonly */\n this.forkOpts = Object.freeze(options.forkOpts || {});\n /** @readonly */\n this.workerOpts = Object.freeze(options.workerOpts || {});\n /** @readonly */\n this.workerThreadOpts = Object.freeze(options.workerThreadOpts || {})\n /** @private */\n this.debugPortStart = (options.debugPortStart || 43210);\n /** @readonly @deprecated */\n this.nodeWorker = options.nodeWorker;\n /** @readonly\n * @type {'auto' | 'web' | 'process' | 'thread'}\n */\n this.workerType = options.workerType || options.nodeWorker || 'auto'\n /** @readonly */\n this.maxQueueSize = options.maxQueueSize || Infinity;\n /** @readonly */\n this.workerTerminateTimeout = options.workerTerminateTimeout || 1000;\n\n /** @readonly */\n this.onCreateWorker = options.onCreateWorker || (() => null);\n /** @readonly */\n this.onTerminateWorker = options.onTerminateWorker || (() => null);\n\n /** @readonly */\n this.emitStdStreams = options.emitStdStreams || false\n\n // configuration\n if (options && 'maxWorkers' in options) {\n validateMaxWorkers(options.maxWorkers);\n /** @readonly */\n this.maxWorkers = options.maxWorkers;\n }\n else {\n this.maxWorkers = Math.max((environment.cpus || 4) - 1, 1);\n }\n\n if (options && 'minWorkers' in options) {\n if(options.minWorkers === 'max') {\n /** @readonly */\n this.minWorkers = this.maxWorkers;\n } else {\n validateMinWorkers(options.minWorkers);\n this.minWorkers = options.minWorkers;\n this.maxWorkers = Math.max(this.minWorkers, this.maxWorkers); // in case minWorkers is higher than maxWorkers\n }\n this._ensureMinWorkers();\n }\n\n /** @private */\n this._boundNext = this._next.bind(this);\n\n\n if (this.workerType === 'thread') {\n WorkerHandler.ensureWorkerThreads();\n }\n}\n\n\n/**\n * Execute a function on a worker.\n *\n * Example usage:\n *\n * var pool = new Pool()\n *\n * // call a function available on the worker\n * pool.exec('fibonacci', [6])\n *\n * // offload a function\n * function add(a, b) {\n * return a + b\n * };\n * pool.exec(add, [2, 4])\n * .then(function (result) {\n * console.log(result); // outputs 6\n * })\n * .catch(function(error) {\n * console.log(error);\n * });\n * @template { (...args: any[]) => any } T\n * @param {String | T} method Function name or function.\n * If `method` is a string, the corresponding\n * method on the worker will be executed\n * If `method` is a Function, the function\n * will be stringified and executed via the\n * workers built-in function `run(fn, args)`.\n * @param {Parameters | null} [params] Function arguments applied when calling the function\n * @param {import('./types.js').ExecOptions} [options] Options\n * @return {Promise>}\n */\nPool.prototype.exec = function (method, params, options) {\n // validate type of arguments\n if (params && !Array.isArray(params)) {\n throw new TypeError('Array expected as argument \"params\"');\n }\n\n if (typeof method === 'string') {\n var resolver = Promise.defer();\n\n if (this.tasks.length >= this.maxQueueSize) {\n throw new Error('Max queue size of ' + this.maxQueueSize + ' reached');\n }\n\n // add a new task to the queue\n var tasks = this.tasks;\n var task = {\n method: method,\n params: params,\n resolver: resolver,\n timeout: null,\n options: options\n };\n tasks.push(task);\n\n // replace the timeout method of the Promise with our own,\n // which starts the timer as soon as the task is actually started\n var originalTimeout = resolver.promise.timeout;\n resolver.promise.timeout = function timeout (delay) {\n if (tasks.indexOf(task) !== -1) {\n // task is still queued -> start the timer later on\n task.timeout = delay;\n return resolver.promise;\n }\n else {\n // task is already being executed -> start timer immediately\n return originalTimeout.call(resolver.promise, delay);\n }\n };\n\n // trigger task execution\n this._next();\n\n return resolver.promise;\n }\n else if (typeof method === 'function') {\n // send stringified function and function arguments to worker\n return this.exec('run', [String(method), params], options);\n }\n else {\n throw new TypeError('Function or string expected as argument \"method\"');\n }\n};\n\n/**\n * Create a proxy for current worker. Returns an object containing all\n * methods available on the worker. All methods return promises resolving the methods result.\n * @template { { [k: string]: (...args: any[]) => any } } T\n * @return {Promise, Error>} Returns a promise which resolves with a proxy object\n */\nPool.prototype.proxy = function () {\n if (arguments.length > 0) {\n throw new Error('No arguments expected');\n }\n\n var pool = this;\n return this.exec('methods')\n .then(function (methods) {\n var proxy = {};\n\n methods.forEach(function (method) {\n proxy[method] = function () {\n return pool.exec(method, Array.prototype.slice.call(arguments));\n }\n });\n\n return proxy;\n });\n};\n\n/**\n * Creates new array with the results of calling a provided callback function\n * on every element in this array.\n * @param {Array} array\n * @param {function} callback Function taking two arguments:\n * `callback(currentValue, index)`\n * @return {Promise.} Returns a promise which resolves with an Array\n * containing the results of the callback function\n * executed for each of the array elements.\n */\n/* TODO: implement map\nPool.prototype.map = function (array, callback) {\n};\n*/\n\n/**\n * Grab the first task from the queue, find a free worker, and assign the\n * worker to the task.\n * @private\n */\nPool.prototype._next = function () {\n if (this.tasks.length > 0) {\n // there are tasks in the queue\n\n // find an available worker\n var worker = this._getWorker();\n if (worker) {\n // get the first task from the queue\n var me = this;\n var task = this.tasks.shift();\n\n // check if the task is still pending (and not cancelled -> promise rejected)\n if (task.resolver.promise.pending) {\n // send the request to the worker\n var promise = worker.exec(task.method, task.params, task.resolver, task.options)\n .then(me._boundNext)\n .catch(function () {\n // if the worker crashed and terminated, remove it from the pool\n if (worker.terminated) {\n return me._removeWorker(worker);\n }\n }).then(function() {\n me._next(); // trigger next task in the queue\n });\n\n // start queued timer now\n if (typeof task.timeout === 'number') {\n promise.timeout(task.timeout);\n }\n } else {\n // The task taken was already complete (either rejected or resolved), so just trigger next task in the queue\n me._next();\n }\n }\n }\n};\n\n/**\n * Get an available worker. If no worker is available and the maximum number\n * of workers isn't yet reached, a new worker will be created and returned.\n * If no worker is available and the maximum number of workers is reached,\n * null will be returned.\n *\n * @return {WorkerHandler | null} worker\n * @private\n */\nPool.prototype._getWorker = function() {\n // find a non-busy worker\n var workers = this.workers;\n for (var i = 0; i < workers.length; i++) {\n var worker = workers[i];\n if (worker.busy() === false) {\n return worker;\n }\n }\n\n if (workers.length < this.maxWorkers) {\n // create a new worker\n worker = this._createWorkerHandler();\n workers.push(worker);\n return worker;\n }\n\n return null;\n};\n\n/**\n * Remove a worker from the pool.\n * Attempts to terminate worker if not already terminated, and ensures the minimum\n * pool size is met.\n * @param {WorkerHandler} worker\n * @return {Promise}\n * @private\n */\nPool.prototype._removeWorker = function(worker) {\n var me = this;\n\n DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort);\n // _removeWorker will call this, but we need it to be removed synchronously\n this._removeWorkerFromList(worker);\n // If minWorkers set, spin up new workers to replace the crashed ones\n this._ensureMinWorkers();\n // terminate the worker (if not already terminated)\n return new Promise(function(resolve, reject) {\n worker.terminate(false, function(err) {\n me.onTerminateWorker({\n forkArgs: worker.forkArgs,\n forkOpts: worker.forkOpts,\n workerThreadOpts: worker.workerThreadOpts,\n script: worker.script\n });\n if (err) {\n reject(err);\n } else {\n resolve(worker);\n }\n });\n });\n};\n\n/**\n * Remove a worker from the pool list.\n * @param {WorkerHandler} worker\n * @private\n */\nPool.prototype._removeWorkerFromList = function(worker) {\n // remove from the list with workers\n var index = this.workers.indexOf(worker);\n if (index !== -1) {\n this.workers.splice(index, 1);\n }\n};\n\n/**\n * Close all active workers. Tasks currently being executed will be finished first.\n * @param {boolean} [force=false] If false (default), the workers are terminated\n * after finishing all tasks currently in\n * progress. If true, the workers will be\n * terminated immediately.\n * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected\n * after timeout if worker process has not been terminated.\n * @return {Promise.}\n */\nPool.prototype.terminate = function (force, timeout) {\n var me = this;\n\n // cancel any pending tasks\n this.tasks.forEach(function (task) {\n task.resolver.reject(new Error('Pool terminated'));\n });\n this.tasks.length = 0;\n\n var f = function (worker) {\n DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort);\n this._removeWorkerFromList(worker);\n };\n var removeWorker = f.bind(this);\n\n var promises = [];\n var workers = this.workers.slice();\n workers.forEach(function (worker) {\n var termPromise = worker.terminateAndNotify(force, timeout)\n .then(removeWorker)\n .always(function() {\n me.onTerminateWorker({\n forkArgs: worker.forkArgs,\n forkOpts: worker.forkOpts,\n workerThreadOpts: worker.workerThreadOpts,\n script: worker.script\n });\n });\n promises.push(termPromise);\n });\n return Promise.all(promises);\n};\n\n/**\n * Retrieve statistics on tasks and workers.\n * @return {{totalWorkers: number, busyWorkers: number, idleWorkers: number, pendingTasks: number, activeTasks: number}} Returns an object with statistics\n */\nPool.prototype.stats = function () {\n var totalWorkers = this.workers.length;\n var busyWorkers = this.workers.filter(function (worker) {\n return worker.busy();\n }).length;\n\n return {\n totalWorkers: totalWorkers,\n busyWorkers: busyWorkers,\n idleWorkers: totalWorkers - busyWorkers,\n\n pendingTasks: this.tasks.length,\n activeTasks: busyWorkers\n };\n};\n\n/**\n * Ensures that a minimum of minWorkers is up and running\n * @private\n */\nPool.prototype._ensureMinWorkers = function() {\n if (this.minWorkers) {\n for(var i = this.workers.length; i < this.minWorkers; i++) {\n this.workers.push(this._createWorkerHandler());\n }\n }\n};\n\n/**\n * Helper function to create a new WorkerHandler and pass all options.\n * @return {WorkerHandler}\n * @private\n */\nPool.prototype._createWorkerHandler = function () {\n const overriddenParams = this.onCreateWorker({\n forkArgs: this.forkArgs,\n forkOpts: this.forkOpts,\n workerOpts: this.workerOpts,\n workerThreadOpts: this.workerThreadOpts,\n script: this.script\n }) || {};\n\n return new WorkerHandler(overriddenParams.script || this.script, {\n forkArgs: overriddenParams.forkArgs || this.forkArgs,\n forkOpts: overriddenParams.forkOpts || this.forkOpts,\n workerOpts: overriddenParams.workerOpts || this.workerOpts,\n workerThreadOpts: overriddenParams.workerThreadOpts || this.workerThreadOpts,\n debugPort: DEBUG_PORT_ALLOCATOR.nextAvailableStartingAt(this.debugPortStart),\n workerType: this.workerType,\n workerTerminateTimeout: this.workerTerminateTimeout,\n emitStdStreams: this.emitStdStreams,\n });\n}\n\n/**\n * Ensure that the maxWorkers option is an integer >= 1\n * @param {*} maxWorkers\n * @returns {boolean} returns true maxWorkers has a valid value\n */\nfunction validateMaxWorkers(maxWorkers) {\n if (!isNumber(maxWorkers) || !isInteger(maxWorkers) || maxWorkers < 1) {\n throw new TypeError('Option maxWorkers must be an integer number >= 1');\n }\n}\n\n/**\n * Ensure that the minWorkers option is an integer >= 0\n * @param {*} minWorkers\n * @returns {boolean} returns true when minWorkers has a valid value\n */\nfunction validateMinWorkers(minWorkers) {\n if (!isNumber(minWorkers) || !isInteger(minWorkers) || minWorkers < 0) {\n throw new TypeError('Option minWorkers must be an integer number >= 0');\n }\n}\n\n/**\n * Test whether a variable is a number\n * @param {*} value\n * @returns {boolean} returns true when value is a number\n */\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n\n/**\n * Test whether a number is an integer\n * @param {number} value\n * @returns {boolean} Returns true if value is an integer\n */\nfunction isInteger(value) {\n return Math.round(value) == value;\n}\n\nmodule.exports = Pool;\n","'use strict';\n\nvar MAX_PORTS = 65535;\nmodule.exports = DebugPortAllocator;\nfunction DebugPortAllocator() {\n this.ports = Object.create(null);\n this.length = 0;\n}\n\nDebugPortAllocator.prototype.nextAvailableStartingAt = function(starting) {\n while (this.ports[starting] === true) {\n starting++;\n }\n\n if (starting >= MAX_PORTS) {\n throw new Error('WorkerPool debug port limit reached: ' + starting + '>= ' + MAX_PORTS );\n }\n\n this.ports[starting] = true;\n this.length++;\n return starting;\n};\n\nDebugPortAllocator.prototype.releasePort = function(port) {\n delete this.ports[port];\n this.length--;\n};\n\n","/**\n * The helper class for transferring data from the worker to the main thread.\n *\n * @param {Object} message The object to deliver to the main thread.\n * @param {Object[]} transfer An array of transferable Objects to transfer ownership of.\n */\nfunction Transfer(message, transfer) {\n this.message = message;\n this.transfer = transfer;\n}\n\nmodule.exports = Transfer;\n","/**\n * worker must be started as a child process or a web worker.\n * It listens for RPC messages from the parent process.\n */\n\nvar Transfer = require('./transfer');\n\n/**\n * worker must handle async cleanup handlers. Use custom Promise implementation. \n*/\nvar Promise = require('./Promise').Promise;\n/**\n * Special message sent by parent which causes the worker to terminate itself.\n * Not a \"message object\"; this string is the entire message.\n */\nvar TERMINATE_METHOD_ID = '__workerpool-terminate__';\n\n/**\n * Special message by parent which causes a child process worker to perform cleaup\n * steps before determining if the child process worker should be terminated.\n*/\nvar CLEANUP_METHOD_ID = '__workerpool-cleanup__';\n// var nodeOSPlatform = require('./environment').nodeOSPlatform;\n\n\nvar TIMEOUT_DEFAULT = 1_000;\n\n// create a worker API for sending and receiving messages which works both on\n// node.js and in the browser\nvar worker = {\n exit: function() {}\n};\n\n// api for in worker communication with parent process\n// works in both node.js and the browser\nvar publicWorker = {\n /**\n * Registers listeners which will trigger when a task is timed out or cancled. If all listeners resolve, the worker executing the given task will not be terminated.\n * *Note*: If there is a blocking operation within a listener, the worker will be terminated.\n * @param {() => Promise} listener\n */\n addAbortListener: function(listener) {\n worker.abortListeners.push(listener);\n },\n\n /**\n * Emit an event from the worker thread to the main thread.\n * @param {any} payload\n */\n emit: worker.emit\n};\n\nif (typeof self !== 'undefined' && typeof postMessage === 'function' && typeof addEventListener === 'function') {\n // worker in the browser\n worker.on = function (event, callback) {\n addEventListener(event, function (message) {\n callback(message.data);\n })\n };\n worker.send = function (message, transfer) {\n transfer ? postMessage(message, transfer) : postMessage (message);\n };\n}\nelse if (typeof process !== 'undefined') {\n // node.js\n\n var WorkerThreads;\n try {\n WorkerThreads = require('worker_threads');\n } catch(error) {\n if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') {\n // no worker_threads, fallback to sub-process based workers\n } else {\n throw error;\n }\n }\n\n if (WorkerThreads &&\n /* if there is a parentPort, we are in a WorkerThread */\n WorkerThreads.parentPort !== null) {\n var parentPort = WorkerThreads.parentPort;\n worker.send = parentPort.postMessage.bind(parentPort);\n worker.on = parentPort.on.bind(parentPort);\n worker.exit = process.exit.bind(process);\n } else {\n worker.on = process.on.bind(process);\n // ignore transfer argument since it is not supported by process\n worker.send = function (message) {\n process.send(message);\n };\n // register disconnect handler only for subprocess worker to exit when parent is killed unexpectedly\n worker.on('disconnect', function () {\n process.exit(1);\n });\n worker.exit = process.exit.bind(process);\n }\n}\nelse {\n throw new Error('Script must be executed as a worker');\n}\n\nfunction convertError(error) {\n if (error && error.toJSON) {\n return JSON.parse(JSON.stringify(error));\n }\n\n // turn a class like Error (having non-enumerable properties) into a plain object\n return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error)));\n}\n\n/**\n * Test whether a value is a Promise via duck typing.\n * @param {*} value\n * @returns {boolean} Returns true when given value is an object\n * having functions `then` and `catch`.\n */\nfunction isPromise(value) {\n return value && (typeof value.then === 'function') && (typeof value.catch === 'function');\n}\n\n// functions available externally\nworker.methods = {};\n\n/**\n * Execute a function with provided arguments\n * @param {String} fn Stringified function\n * @param {Array} [args] Function arguments\n * @returns {*}\n */\nworker.methods.run = function run(fn, args) {\n var f = new Function('return (' + fn + ').apply(this, arguments);');\n f.worker = publicWorker;\n return f.apply(f, args);\n};\n\n/**\n * Get a list with methods available on this worker\n * @return {String[]} methods\n */\nworker.methods.methods = function methods() {\n return Object.keys(worker.methods);\n};\n\n/**\n * Custom handler for when the worker is terminated.\n */\nworker.terminationHandler = undefined;\n\nworker.abortListenerTimeout = TIMEOUT_DEFAULT;\n\n/**\n * Abort handlers for resolving errors which may cause a timeout or cancellation\n * to occur from a worker context\n */\nworker.abortListeners = [];\n\n/**\n * Cleanup and exit the worker.\n * @param {Number} code \n * @returns {Promise}\n */\nworker.terminateAndExit = function(code) {\n var _exit = function() {\n worker.exit(code);\n }\n\n if(!worker.terminationHandler) {\n return _exit();\n }\n \n var result = worker.terminationHandler(code);\n if (isPromise(result)) {\n result.then(_exit, _exit);\n\n return result;\n } else {\n _exit();\n return new Promise(function (_resolve, reject) {\n reject(new Error(\"Worker terminating\"));\n });\n }\n}\n\n\n\n/**\n * Called within the worker message handler to run abort handlers if registered to perform cleanup operations.\n * @param {Integer} [requestId] id of task which is currently executing in the worker\n * @return {Promise}\n*/\nworker.cleanup = function(requestId) {\n\n if (!worker.abortListeners.length) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: convertError(new Error('Worker terminating')),\n });\n\n // If there are no handlers registered, reject the promise with an error as we want the handler to be notified\n // that cleanup should begin and the handler should be GCed.\n return new Promise(function(resolve) { resolve(); });\n }\n \n\n var _exit = function() {\n worker.exit();\n }\n\n var _abort = function() {\n if (!worker.abortListeners.length) {\n worker.abortListeners = [];\n }\n }\n\n const promises = worker.abortListeners.map(listener => listener());\n let timerId;\n const timeoutPromise = new Promise((_resolve, reject) => {\n timerId = setTimeout(function () { \n reject(new Error('Timeout occured waiting for abort handler, killing worker'));\n }, worker.abortListenerTimeout);\n });\n\n // Once a promise settles we need to clear the timeout to prevet fulfulling the promise twice \n const settlePromise = Promise.all(promises).then(function() {\n clearTimeout(timerId);\n _abort();\n }, function() {\n clearTimeout(timerId);\n _exit();\n });\n\n // Returns a promise which will result in one of the following cases\n // - Resolve once all handlers resolve\n // - Reject if one or more handlers exceed the 'abortListenerTimeout' interval\n // - Reject if one or more handlers reject\n // Upon one of the above cases a message will be sent to the handler with the result of the handler execution\n // which will either kill the worker if the result contains an error, or keep it in the pool if the result\n // does not contain an error.\n return new Promise(function(resolve, reject) {\n settlePromise.then(resolve, reject);\n timeoutPromise.then(resolve, reject);\n }).then(function() {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: null,\n });\n }, function(err) {\n worker.send({\n id: requestId,\n method: CLEANUP_METHOD_ID,\n error: err ? convertError(err) : null,\n });\n });\n}\n\nvar currentRequestId = null;\n\nworker.on('message', function (request) {\n if (request === TERMINATE_METHOD_ID) {\n return worker.terminateAndExit(0);\n }\n\n if (request.method === CLEANUP_METHOD_ID) {\n return worker.cleanup(request.id);\n }\n\n try {\n var method = worker.methods[request.method];\n\n if (method) {\n currentRequestId = request.id;\n \n // execute the function\n var result = method.apply(method, request.params);\n\n if (isPromise(result)) {\n // promise returned, resolve this and then return\n result\n .then(function (result) {\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n currentRequestId = null;\n })\n .catch(function (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err),\n });\n currentRequestId = null;\n });\n }\n else {\n // immediate result\n if (result instanceof Transfer) {\n worker.send({\n id: request.id,\n result: result.message,\n error: null\n }, result.transfer);\n } else {\n worker.send({\n id: request.id,\n result: result,\n error: null\n });\n }\n\n currentRequestId = null;\n }\n }\n else {\n throw new Error('Unknown method \"' + request.method + '\"');\n }\n }\n catch (err) {\n worker.send({\n id: request.id,\n result: null,\n error: convertError(err)\n });\n }\n});\n\n/**\n * Register methods to the worker\n * @param {Object} [methods]\n * @param {import('./types.js').WorkerRegisterOptions} [options]\n */\nworker.register = function (methods, options) {\n\n if (methods) {\n for (var name in methods) {\n if (methods.hasOwnProperty(name)) {\n worker.methods[name] = methods[name];\n worker.methods[name].worker = publicWorker;\n }\n }\n }\n\n if (options) {\n worker.terminationHandler = options.onTerminate;\n // register listener timeout or default to 1 second\n worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT;\n }\n\n worker.send('ready');\n};\n\nworker.emit = function (payload) {\n if (currentRequestId) {\n if (payload instanceof Transfer) {\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload: payload.message\n }, payload.transfer);\n return;\n }\n\n worker.send({\n id: currentRequestId,\n isEvent: true,\n payload\n });\n }\n};\n\n\nif (typeof exports !== 'undefined') {\n exports.add = worker.register;\n exports.emit = worker.emit;\n}\n","const {platform, isMainThread, cpus} = require('./environment');\n\n/** @typedef {import(\"./Pool\")} Pool */\n/** @typedef {import(\"./types.js\").WorkerPoolOptions} WorkerPoolOptions */\n/** @typedef {import(\"./types.js\").WorkerRegisterOptions} WorkerRegisterOptions */\n\n/**\n * @template { { [k: string]: (...args: any[]) => any } } T\n * @typedef {import('./types.js').Proxy} Proxy\n */\n\n/**\n * @overload\n * Create a new worker pool\n * @param {WorkerPoolOptions} [script]\n * @returns {Pool} pool\n */\n/**\n * @overload\n * Create a new worker pool\n * @param {string} [script]\n * @param {WorkerPoolOptions} [options]\n * @returns {Pool} pool\n */\nfunction pool(script, options) {\n var Pool = require('./Pool');\n\n return new Pool(script, options);\n};\nexports.pool = pool;\n\n/**\n * Create a worker and optionally register a set of methods to the worker.\n * @param {{ [k: string]: (...args: any[]) => any }} [methods]\n * @param {WorkerRegisterOptions} [options]\n */\nfunction worker(methods, options) {\n var worker = require('./worker');\n worker.add(methods, options);\n};\nexports.worker = worker;\n\n/**\n * Sends an event to the parent worker pool.\n * @param {any} payload \n */\nfunction workerEmit(payload) {\n var worker = require('./worker');\n worker.emit(payload);\n};\nexports.workerEmit = workerEmit;\n\nconst {Promise} = require('./Promise');\nexports.Promise = Promise;\n\nexports.Transfer = require('./transfer');\n\nexports.platform = platform;\nexports.isMainThread = isMainThread;\nexports.cpus = cpus;\n"],"names":["isNode","nodeProcess","versions","node","module","exports","platform","process","worker_threads","require","isMainThread","connected","Window","cpus","self","navigator","hardwareConcurrency","length","Promise","handler","parent","me","this","SyntaxError","_onSuccess","_onFail","resolved","rejected","pending","Symbol","toStringTag","_process","onSuccess","onFail","push","then","resolve","reject","s","_then","f","_resolve","result","forEach","fn","_reject","error","cancel","CancellationError","timeout","delay","timer","setTimeout","TimeoutError","always","clearTimeout","callback","res","message","stack","Error","prototype","finally","final","all","promises","remaining","results","p","i","defer","resolver","promise","constructor","name","_Promise","validateOptions","options","allowedOptionNames","objectName","optionNames","Object","keys","unknownOptionName","find","optionName","includes","illegalOptionName","allowedOptionName","workerOptsNames","forkOptsNames","workerThreadOptsNames","require$$0","environment","require$$1","_require$$2","require$$2","TERMINATE_METHOD_ID","CLEANUP_METHOD_ID","ensureWorkerThreads","WorkerThreads","tryRequireWorkerThreads","ensureWebWorker","Worker","_typeof","code","setupBrowserWorker","script","workerOpts","worker","isBrowserWorker","on","event","addEventListener","data","send","transfer","postMessage","setupWorkerThreadWorker","_options$emitStdStrea","_options$emitStdStrea2","workerThreadOpts","_objectSpread","stdout","emitStdStreams","stderr","isWorkerThread","kill","terminate","disconnect","emit","setupProcessWorker","child_process","forkOpts","fork","forkArgs","call","isChildProcess","resolveForkOptions","opts","processExecArgv","execArgv","join","inspectorActive","indexOf","debugBrk","debugPort","arg","assign","concat","stdio","undefined","objectToError","obj","temp","props","handleEmittedStdPayload","payload","values","processing","task","_task$options","tracking","_task$options2","WorkerHandler","_options","onError","id","terminated","create","Blob","window","URL","createObjectURL","blob","embeddedWorker","type","__dirname","getDefaultWorker","workerType","setupWorker","workerTerminateTimeout","ready","requestQueue","toString","response","_step","_iterator","_createForOfIteratorHelper","splice","n","done","request","value","err","e","dispatchQueuedRequests","isEvent","terminating","method","trackedTask","timeoutId","WrappedTimeoutError","exitCode","signalCode","spawnargs","spawnfile","cleaning","terminationHandler","lastId","timeoutError","methods","exec","params","catch","terminateAndNotify","busy","force","_i","_Object$values","cleanup","removeAllListeners","killed","cleanExitTimeout","once","WorkerHandlerModule","_tryRequireWorkerThreads","_setupProcessWorker","_setupBrowserWorker","_setupWorkerThreadWorker","DEBUG_PORT_ALLOCATOR","DebugPortAllocator","ports","debugPortAllocator","nextAvailableStartingAt","starting","releasePort","port","require$$3","Pool","workers","tasks","freeze","debugPortStart","nodeWorker","maxQueueSize","Infinity","onCreateWorker","onTerminateWorker","maxWorkers","isNumber","isInteger","TypeError","validateMaxWorkers","Math","max","minWorkers","validateMinWorkers","_ensureMinWorkers","_boundNext","_next","bind","round","Array","isArray","originalTimeout","String","proxy","arguments","pool","slice","_getWorker","shift","_removeWorker","_createWorkerHandler","_removeWorkerFromList","index","removeWorker","termPromise","stats","totalWorkers","busyWorkers","filter","idleWorkers","pendingTasks","activeTasks","overriddenParams","Pool_1","Transfer","exit","publicWorker","addAbortListener","listener","abortListeners","parentPort","convertError","toJSON","JSON","parse","stringify","getOwnPropertyNames","isPromise","run","args","Function","apply","abortListenerTimeout","terminateAndExit","_exit","requestId","timerId","map","timeoutPromise","settlePromise","currentRequestId","register","hasOwnProperty","onTerminate","add","pool_1","src","worker_1","workerEmit_1","workerEmit","require$$4","platform_1","isMainThread_1","cpus_1"],"mappings":";uRAGA,IAAIA,EAAS,SAAUC,GACrB,YACyB,IAAhBA,GACiB,MAAxBA,EAAYC,UACiB,MAA7BD,EAAYC,SAASC,MACrBF,EAAc,IAAO,kBAEzB,EACAG,EAAAC,QAAAL,OAAwB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AAkT,EAAAC,EAAAnD,KALA,SAAclK,EAAQ9B,GAGpB,OAAO,IAFIiB,IAEJ,CAASa,EAAQ9B,EAC1B,EAYA,IAAAoP,EAAAD,EAAAnN,OAJA,SAAgBsG,EAAStI,GACVmB,IACN8N,IAAI3G,EAAStI,EACtB,EAWA,IAAAqP,EAAAF,EAAAG,WAJA,SAAoBtK,GACL7D,IACNkC,KAAK2B,EACd,EAGO3I,EAAW4N,IAAX5N,QACPyD,EAAAqP,EAAA9S,QAAkBA,EAElB8Q,EAAAgC,EAAAhC,SAAmBoC,IAEnBC,EAAAL,EAAA1T,SAAmBA,EACnBgU,EAAAN,EAAAtT,aAAuBA,EACvB6T,EAAAP,EAAAnT,KAAeA"} \ No newline at end of file diff --git a/node_modules/workerpool/package.json b/node_modules/workerpool/package.json new file mode 100644 index 0000000..b1de218 --- /dev/null +++ b/node_modules/workerpool/package.json @@ -0,0 +1,58 @@ +{ + "name": "workerpool", + "license": "Apache-2.0", + "version": "9.3.4", + "description": "Offload tasks to a pool of workers on node.js and in the browser", + "homepage": "https://github.com/josdejong/workerpool", + "author": "Jos de Jong (https://github.com/josdejong)", + "repository": { + "type": "git", + "url": "git://github.com/josdejong/workerpool.git" + }, + "keywords": [ + "worker", + "web worker", + "cluster", + "pool", + "isomorphic" + ], + "main": "src/index.js", + "browser": "dist/workerpool.js", + "types": "types/index.d.ts", + "files": [ + "dist", + "src", + "types", + "HISTORY.md", + "LICENSE", + "README.md" + ], + "scripts": { + "build": "rollup -c rollup.config.mjs && npm run build:types", + "build:types": "tsc -p .", + "watch": "rollup -c rollup.config.mjs -w", + "test": "npm run build && mocha test && npm run test:types", + "test:types": "tsc -p test/types", + "test:debug": "npm run build && mocha debug test", + "coverage": "npm run build && c8 mocha && c8 report --reporter=html && echo Coverage report is available at ./coverage/index.html", + "prepublishOnly": "npm run test && npm run build" + }, + "devDependencies": { + "@babel/core": "7.28.4", + "@babel/preset-env": "7.28.3", + "@rollup/plugin-babel": "6.0.4", + "@rollup/plugin-commonjs": "28.0.6", + "@rollup/plugin-json": "6.1.0", + "@rollup/plugin-node-resolve": "16.0.1", + "@rollup/plugin-terser": "0.4.4", + "@types/node": "24.3.1", + "c8": "10.1.3", + "core-js": "3.45.1", + "date-format": "4.0.14", + "find-process": "2.0.0", + "fs-extra": "11.3.1", + "mocha": "11.7.2", + "rollup": "4.50.1", + "typescript": "5.9.2" + } +} \ No newline at end of file diff --git a/node_modules/workerpool/src/Pool.js b/node_modules/workerpool/src/Pool.js new file mode 100644 index 0000000..3f762b2 --- /dev/null +++ b/node_modules/workerpool/src/Pool.js @@ -0,0 +1,476 @@ +var {Promise} = require('./Promise'); +var WorkerHandler = require('./WorkerHandler'); +var environment = require('./environment'); +var DebugPortAllocator = require('./debug-port-allocator'); +var DEBUG_PORT_ALLOCATOR = new DebugPortAllocator(); +/** + * A pool to manage workers, which can be created using the function workerpool.pool. + * + * @param {String} [script] Optional worker script + * @param {import('./types.js').WorkerPoolOptions} [options] See docs + * @constructor + */ +function Pool(script, options) { + if (typeof script === 'string') { + /** @readonly */ + this.script = script || null; + } + else { + this.script = null; + options = script; + } + + /** @private */ + this.workers = []; // queue with all workers + /** @private */ + this.tasks = []; // queue with tasks awaiting execution + + options = options || {}; + + /** @readonly */ + this.forkArgs = Object.freeze(options.forkArgs || []); + /** @readonly */ + this.forkOpts = Object.freeze(options.forkOpts || {}); + /** @readonly */ + this.workerOpts = Object.freeze(options.workerOpts || {}); + /** @readonly */ + this.workerThreadOpts = Object.freeze(options.workerThreadOpts || {}) + /** @private */ + this.debugPortStart = (options.debugPortStart || 43210); + /** @readonly @deprecated */ + this.nodeWorker = options.nodeWorker; + /** @readonly + * @type {'auto' | 'web' | 'process' | 'thread'} + */ + this.workerType = options.workerType || options.nodeWorker || 'auto' + /** @readonly */ + this.maxQueueSize = options.maxQueueSize || Infinity; + /** @readonly */ + this.workerTerminateTimeout = options.workerTerminateTimeout || 1000; + + /** @readonly */ + this.onCreateWorker = options.onCreateWorker || (() => null); + /** @readonly */ + this.onTerminateWorker = options.onTerminateWorker || (() => null); + + /** @readonly */ + this.emitStdStreams = options.emitStdStreams || false + + // configuration + if (options && 'maxWorkers' in options) { + validateMaxWorkers(options.maxWorkers); + /** @readonly */ + this.maxWorkers = options.maxWorkers; + } + else { + this.maxWorkers = Math.max((environment.cpus || 4) - 1, 1); + } + + if (options && 'minWorkers' in options) { + if(options.minWorkers === 'max') { + /** @readonly */ + this.minWorkers = this.maxWorkers; + } else { + validateMinWorkers(options.minWorkers); + this.minWorkers = options.minWorkers; + this.maxWorkers = Math.max(this.minWorkers, this.maxWorkers); // in case minWorkers is higher than maxWorkers + } + this._ensureMinWorkers(); + } + + /** @private */ + this._boundNext = this._next.bind(this); + + + if (this.workerType === 'thread') { + WorkerHandler.ensureWorkerThreads(); + } +} + + +/** + * Execute a function on a worker. + * + * Example usage: + * + * var pool = new Pool() + * + * // call a function available on the worker + * pool.exec('fibonacci', [6]) + * + * // offload a function + * function add(a, b) { + * return a + b + * }; + * pool.exec(add, [2, 4]) + * .then(function (result) { + * console.log(result); // outputs 6 + * }) + * .catch(function(error) { + * console.log(error); + * }); + * @template { (...args: any[]) => any } T + * @param {String | T} method Function name or function. + * If `method` is a string, the corresponding + * method on the worker will be executed + * If `method` is a Function, the function + * will be stringified and executed via the + * workers built-in function `run(fn, args)`. + * @param {Parameters | null} [params] Function arguments applied when calling the function + * @param {import('./types.js').ExecOptions} [options] Options + * @return {Promise>} + */ +Pool.prototype.exec = function (method, params, options) { + // validate type of arguments + if (params && !Array.isArray(params)) { + throw new TypeError('Array expected as argument "params"'); + } + + if (typeof method === 'string') { + var resolver = Promise.defer(); + + if (this.tasks.length >= this.maxQueueSize) { + throw new Error('Max queue size of ' + this.maxQueueSize + ' reached'); + } + + // add a new task to the queue + var tasks = this.tasks; + var task = { + method: method, + params: params, + resolver: resolver, + timeout: null, + options: options + }; + tasks.push(task); + + // replace the timeout method of the Promise with our own, + // which starts the timer as soon as the task is actually started + var originalTimeout = resolver.promise.timeout; + resolver.promise.timeout = function timeout (delay) { + if (tasks.indexOf(task) !== -1) { + // task is still queued -> start the timer later on + task.timeout = delay; + return resolver.promise; + } + else { + // task is already being executed -> start timer immediately + return originalTimeout.call(resolver.promise, delay); + } + }; + + // trigger task execution + this._next(); + + return resolver.promise; + } + else if (typeof method === 'function') { + // send stringified function and function arguments to worker + return this.exec('run', [String(method), params], options); + } + else { + throw new TypeError('Function or string expected as argument "method"'); + } +}; + +/** + * Create a proxy for current worker. Returns an object containing all + * methods available on the worker. All methods return promises resolving the methods result. + * @template { { [k: string]: (...args: any[]) => any } } T + * @return {Promise, Error>} Returns a promise which resolves with a proxy object + */ +Pool.prototype.proxy = function () { + if (arguments.length > 0) { + throw new Error('No arguments expected'); + } + + var pool = this; + return this.exec('methods') + .then(function (methods) { + var proxy = {}; + + methods.forEach(function (method) { + proxy[method] = function () { + return pool.exec(method, Array.prototype.slice.call(arguments)); + } + }); + + return proxy; + }); +}; + +/** + * Creates new array with the results of calling a provided callback function + * on every element in this array. + * @param {Array} array + * @param {function} callback Function taking two arguments: + * `callback(currentValue, index)` + * @return {Promise.} Returns a promise which resolves with an Array + * containing the results of the callback function + * executed for each of the array elements. + */ +/* TODO: implement map +Pool.prototype.map = function (array, callback) { +}; +*/ + +/** + * Grab the first task from the queue, find a free worker, and assign the + * worker to the task. + * @private + */ +Pool.prototype._next = function () { + if (this.tasks.length > 0) { + // there are tasks in the queue + + // find an available worker + var worker = this._getWorker(); + if (worker) { + // get the first task from the queue + var me = this; + var task = this.tasks.shift(); + + // check if the task is still pending (and not cancelled -> promise rejected) + if (task.resolver.promise.pending) { + // send the request to the worker + var promise = worker.exec(task.method, task.params, task.resolver, task.options) + .then(me._boundNext) + .catch(function () { + // if the worker crashed and terminated, remove it from the pool + if (worker.terminated) { + return me._removeWorker(worker); + } + }).then(function() { + me._next(); // trigger next task in the queue + }); + + // start queued timer now + if (typeof task.timeout === 'number') { + promise.timeout(task.timeout); + } + } else { + // The task taken was already complete (either rejected or resolved), so just trigger next task in the queue + me._next(); + } + } + } +}; + +/** + * Get an available worker. If no worker is available and the maximum number + * of workers isn't yet reached, a new worker will be created and returned. + * If no worker is available and the maximum number of workers is reached, + * null will be returned. + * + * @return {WorkerHandler | null} worker + * @private + */ +Pool.prototype._getWorker = function() { + // find a non-busy worker + var workers = this.workers; + for (var i = 0; i < workers.length; i++) { + var worker = workers[i]; + if (worker.busy() === false) { + return worker; + } + } + + if (workers.length < this.maxWorkers) { + // create a new worker + worker = this._createWorkerHandler(); + workers.push(worker); + return worker; + } + + return null; +}; + +/** + * Remove a worker from the pool. + * Attempts to terminate worker if not already terminated, and ensures the minimum + * pool size is met. + * @param {WorkerHandler} worker + * @return {Promise} + * @private + */ +Pool.prototype._removeWorker = function(worker) { + var me = this; + + DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort); + // _removeWorker will call this, but we need it to be removed synchronously + this._removeWorkerFromList(worker); + // If minWorkers set, spin up new workers to replace the crashed ones + this._ensureMinWorkers(); + // terminate the worker (if not already terminated) + return new Promise(function(resolve, reject) { + worker.terminate(false, function(err) { + me.onTerminateWorker({ + forkArgs: worker.forkArgs, + forkOpts: worker.forkOpts, + workerThreadOpts: worker.workerThreadOpts, + script: worker.script + }); + if (err) { + reject(err); + } else { + resolve(worker); + } + }); + }); +}; + +/** + * Remove a worker from the pool list. + * @param {WorkerHandler} worker + * @private + */ +Pool.prototype._removeWorkerFromList = function(worker) { + // remove from the list with workers + var index = this.workers.indexOf(worker); + if (index !== -1) { + this.workers.splice(index, 1); + } +}; + +/** + * Close all active workers. Tasks currently being executed will be finished first. + * @param {boolean} [force=false] If false (default), the workers are terminated + * after finishing all tasks currently in + * progress. If true, the workers will be + * terminated immediately. + * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected + * after timeout if worker process has not been terminated. + * @return {Promise.} + */ +Pool.prototype.terminate = function (force, timeout) { + var me = this; + + // cancel any pending tasks + this.tasks.forEach(function (task) { + task.resolver.reject(new Error('Pool terminated')); + }); + this.tasks.length = 0; + + var f = function (worker) { + DEBUG_PORT_ALLOCATOR.releasePort(worker.debugPort); + this._removeWorkerFromList(worker); + }; + var removeWorker = f.bind(this); + + var promises = []; + var workers = this.workers.slice(); + workers.forEach(function (worker) { + var termPromise = worker.terminateAndNotify(force, timeout) + .then(removeWorker) + .always(function() { + me.onTerminateWorker({ + forkArgs: worker.forkArgs, + forkOpts: worker.forkOpts, + workerThreadOpts: worker.workerThreadOpts, + script: worker.script + }); + }); + promises.push(termPromise); + }); + return Promise.all(promises); +}; + +/** + * Retrieve statistics on tasks and workers. + * @return {{totalWorkers: number, busyWorkers: number, idleWorkers: number, pendingTasks: number, activeTasks: number}} Returns an object with statistics + */ +Pool.prototype.stats = function () { + var totalWorkers = this.workers.length; + var busyWorkers = this.workers.filter(function (worker) { + return worker.busy(); + }).length; + + return { + totalWorkers: totalWorkers, + busyWorkers: busyWorkers, + idleWorkers: totalWorkers - busyWorkers, + + pendingTasks: this.tasks.length, + activeTasks: busyWorkers + }; +}; + +/** + * Ensures that a minimum of minWorkers is up and running + * @private + */ +Pool.prototype._ensureMinWorkers = function() { + if (this.minWorkers) { + for(var i = this.workers.length; i < this.minWorkers; i++) { + this.workers.push(this._createWorkerHandler()); + } + } +}; + +/** + * Helper function to create a new WorkerHandler and pass all options. + * @return {WorkerHandler} + * @private + */ +Pool.prototype._createWorkerHandler = function () { + const overriddenParams = this.onCreateWorker({ + forkArgs: this.forkArgs, + forkOpts: this.forkOpts, + workerOpts: this.workerOpts, + workerThreadOpts: this.workerThreadOpts, + script: this.script + }) || {}; + + return new WorkerHandler(overriddenParams.script || this.script, { + forkArgs: overriddenParams.forkArgs || this.forkArgs, + forkOpts: overriddenParams.forkOpts || this.forkOpts, + workerOpts: overriddenParams.workerOpts || this.workerOpts, + workerThreadOpts: overriddenParams.workerThreadOpts || this.workerThreadOpts, + debugPort: DEBUG_PORT_ALLOCATOR.nextAvailableStartingAt(this.debugPortStart), + workerType: this.workerType, + workerTerminateTimeout: this.workerTerminateTimeout, + emitStdStreams: this.emitStdStreams, + }); +} + +/** + * Ensure that the maxWorkers option is an integer >= 1 + * @param {*} maxWorkers + * @returns {boolean} returns true maxWorkers has a valid value + */ +function validateMaxWorkers(maxWorkers) { + if (!isNumber(maxWorkers) || !isInteger(maxWorkers) || maxWorkers < 1) { + throw new TypeError('Option maxWorkers must be an integer number >= 1'); + } +} + +/** + * Ensure that the minWorkers option is an integer >= 0 + * @param {*} minWorkers + * @returns {boolean} returns true when minWorkers has a valid value + */ +function validateMinWorkers(minWorkers) { + if (!isNumber(minWorkers) || !isInteger(minWorkers) || minWorkers < 0) { + throw new TypeError('Option minWorkers must be an integer number >= 0'); + } +} + +/** + * Test whether a variable is a number + * @param {*} value + * @returns {boolean} returns true when value is a number + */ +function isNumber(value) { + return typeof value === 'number'; +} + +/** + * Test whether a number is an integer + * @param {number} value + * @returns {boolean} Returns true if value is an integer + */ +function isInteger(value) { + return Math.round(value) == value; +} + +module.exports = Pool; diff --git a/node_modules/workerpool/src/Promise.js b/node_modules/workerpool/src/Promise.js new file mode 100644 index 0000000..3113283 --- /dev/null +++ b/node_modules/workerpool/src/Promise.js @@ -0,0 +1,315 @@ +'use strict'; + +/** + * Promise + * + * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa + * @template T + * @template [E=Error] + * @param {Function} handler Called as handler(resolve: Function, reject: Function) + * @param {Promise} [parent] Parent promise for propagation of cancel and timeout + */ +function Promise(handler, parent) { + var me = this; + + if (!(this instanceof Promise)) { + throw new SyntaxError('Constructor must be called with the new operator'); + } + + if (typeof handler !== 'function') { + throw new SyntaxError('Function parameter handler(resolve, reject) missing'); + } + + var _onSuccess = []; + var _onFail = []; + + // status + /** + * @readonly + */ + this.resolved = false; + /** + * @readonly + */ + this.rejected = false; + /** + * @readonly + */ + this.pending = true; + /** + * @readonly + */ + this[Symbol.toStringTag] = 'Promise'; + + /** + * Process onSuccess and onFail callbacks: add them to the queue. + * Once the promise is resolved, the function _promise is replace. + * @param {Function} onSuccess + * @param {Function} onFail + * @private + */ + var _process = function (onSuccess, onFail) { + _onSuccess.push(onSuccess); + _onFail.push(onFail); + }; + + /** + * Add an onSuccess callback and optionally an onFail callback to the Promise + * @template TT + * @template [TE=never] + * @param {(r: T) => TT | PromiseLike} onSuccess + * @param {(r: E) => TE | PromiseLike} [onFail] + * @returns {Promise} promise + */ + this.then = function (onSuccess, onFail) { + return new Promise(function (resolve, reject) { + var s = onSuccess ? _then(onSuccess, resolve, reject) : resolve; + var f = onFail ? _then(onFail, resolve, reject) : reject; + + _process(s, f); + }, me); + }; + + /** + * Resolve the promise + * @param {*} result + * @type {Function} + */ + var _resolve = function (result) { + // update status + me.resolved = true; + me.rejected = false; + me.pending = false; + + _onSuccess.forEach(function (fn) { + fn(result); + }); + + _process = function (onSuccess, onFail) { + onSuccess(result); + }; + + _resolve = _reject = function () { }; + + return me; + }; + + /** + * Reject the promise + * @param {Error} error + * @type {Function} + */ + var _reject = function (error) { + // update status + me.resolved = false; + me.rejected = true; + me.pending = false; + + _onFail.forEach(function (fn) { + fn(error); + }); + + _process = function (onSuccess, onFail) { + onFail(error); + }; + + _resolve = _reject = function () { } + + return me; + }; + + /** + * Cancel the promise. This will reject the promise with a CancellationError + * @returns {this} self + */ + this.cancel = function () { + if (parent) { + parent.cancel(); + } + else { + _reject(new CancellationError()); + } + + return me; + }; + + /** + * Set a timeout for the promise. If the promise is not resolved within + * the time, the promise will be cancelled and a TimeoutError is thrown. + * If the promise is resolved in time, the timeout is removed. + * @param {number} delay Delay in milliseconds + * @returns {this} self + */ + this.timeout = function (delay) { + if (parent) { + parent.timeout(delay); + } + else { + var timer = setTimeout(function () { + _reject(new TimeoutError('Promise timed out after ' + delay + ' ms')); + }, delay); + + me.always(function () { + clearTimeout(timer); + }); + } + + return me; + }; + + // attach handler passing the resolve and reject functions + handler(function (result) { + _resolve(result); + }, function (error) { + _reject(error); + }); +} + +/** + * Execute given callback, then call resolve/reject based on the returned result + * @param {Function} callback + * @param {Function} resolve + * @param {Function} reject + * @returns {Function} + * @private + */ +function _then(callback, resolve, reject) { + return function (result) { + try { + var res = callback(result); + if (res && typeof res.then === 'function' && typeof res['catch'] === 'function') { + // method returned a promise + res.then(resolve, reject); + } + else { + resolve(res); + } + } + catch (error) { + reject(error); + } + } +} + +/** + * Add an onFail callback to the Promise + * @template TT + * @param {(error: E) => TT | PromiseLike} onFail + * @returns {Promise} promise + */ +Promise.prototype['catch'] = function (onFail) { + return this.then(null, onFail); +}; + +// TODO: add support for Promise.catch(Error, callback) +// TODO: add support for Promise.catch(Error, Error, callback) + +/** + * Execute given callback when the promise either resolves or rejects. + * @template TT + * @param {() => Promise} fn + * @returns {Promise} promise + */ +Promise.prototype.always = function (fn) { + return this.then(fn, fn); +}; + +/** + * Execute given callback when the promise either resolves or rejects. + * Same semantics as Node's Promise.finally() + * @param {Function | null | undefined} [fn] + * @returns {Promise} promise + */ +Promise.prototype.finally = function (fn) { + const me = this; + + const final = function() { + return new Promise((resolve) => resolve()) + .then(fn) + .then(() => me); + }; + + return this.then(final, final); +} + +/** + * Create a promise which resolves when all provided promises are resolved, + * and fails when any of the promises resolves. + * @param {Promise[]} promises + * @returns {Promise} promise + */ +Promise.all = function (promises){ + return new Promise(function (resolve, reject) { + var remaining = promises.length, + results = []; + + if (remaining) { + promises.forEach(function (p, i) { + p.then(function (result) { + results[i] = result; + remaining--; + if (remaining == 0) { + resolve(results); + } + }, function (error) { + remaining = 0; + reject(error); + }); + }); + } + else { + resolve(results); + } + }); +}; + +/** + * Create a promise resolver + * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver + */ +Promise.defer = function () { + var resolver = {}; + + resolver.promise = new Promise(function (resolve, reject) { + resolver.resolve = resolve; + resolver.reject = reject; + }); + + return resolver; +}; + +/** + * Create a cancellation error + * @param {String} [message] + * @extends Error + */ +function CancellationError(message) { + this.message = message || 'promise cancelled'; + this.stack = (new Error()).stack; +} + +CancellationError.prototype = new Error(); +CancellationError.prototype.constructor = Error; +CancellationError.prototype.name = 'CancellationError'; + +Promise.CancellationError = CancellationError; + + +/** + * Create a timeout error + * @param {String} [message] + * @extends Error + */ +function TimeoutError(message) { + this.message = message || 'timeout exceeded'; + this.stack = (new Error()).stack; +} + +TimeoutError.prototype = new Error(); +TimeoutError.prototype.constructor = Error; +TimeoutError.prototype.name = 'TimeoutError'; + +Promise.TimeoutError = TimeoutError; + + +exports.Promise = Promise; diff --git a/node_modules/workerpool/src/WorkerHandler.js b/node_modules/workerpool/src/WorkerHandler.js new file mode 100644 index 0000000..6390d09 --- /dev/null +++ b/node_modules/workerpool/src/WorkerHandler.js @@ -0,0 +1,639 @@ +'use strict'; + +var {Promise} = require('./Promise'); +var environment = require('./environment'); +const {validateOptions, forkOptsNames, workerThreadOptsNames, workerOptsNames} = require("./validateOptions"); + +/** + * Special message sent by parent which causes a child process worker to terminate itself. + * Not a "message object"; this string is the entire message. + */ +var TERMINATE_METHOD_ID = '__workerpool-terminate__'; + +/** + * Special message by parent which causes a child process worker to perform cleaup + * steps before determining if the child process worker should be terminated. + */ +var CLEANUP_METHOD_ID = '__workerpool-cleanup__'; + +function ensureWorkerThreads() { + var WorkerThreads = tryRequireWorkerThreads() + if (!WorkerThreads) { + throw new Error('WorkerPool: workerType = \'thread\' is not supported, Node >= 11.7.0 required') + } + + return WorkerThreads; +} + +// check whether Worker is supported by the browser +function ensureWebWorker() { + // Workaround for a bug in PhantomJS (Or QtWebkit): https://github.com/ariya/phantomjs/issues/14534 + if (typeof Worker !== 'function' && (typeof Worker !== 'object' || typeof Worker.prototype.constructor !== 'function')) { + throw new Error('WorkerPool: Web Workers not supported'); + } +} + +function tryRequireWorkerThreads() { + try { + return require('worker_threads'); + } catch(error) { + if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') { + // no worker_threads available (old version of node.js) + return null; + } else { + throw error; + } + } +} + +// get the default worker script +function getDefaultWorker() { + if (environment.platform === 'browser') { + // test whether the browser supports all features that we need + if (typeof Blob === 'undefined') { + throw new Error('Blob not supported by the browser'); + } + if (!window.URL || typeof window.URL.createObjectURL !== 'function') { + throw new Error('URL.createObjectURL not supported by the browser'); + } + + // use embedded worker.js + var blob = new Blob([require('./generated/embeddedWorker')], {type: 'text/javascript'}); + return window.URL.createObjectURL(blob); + } + else { + // use external worker.js in current directory + return __dirname + '/worker.js'; + } +} + +function setupWorker(script, options) { + if (options.workerType === 'web') { // browser only + ensureWebWorker(); + return setupBrowserWorker(script, options.workerOpts, Worker); + } else if (options.workerType === 'thread') { // node.js only + WorkerThreads = ensureWorkerThreads(); + return setupWorkerThreadWorker(script, WorkerThreads, options); + } else if (options.workerType === 'process' || !options.workerType) { // node.js only + return setupProcessWorker(script, resolveForkOptions(options), require('child_process')); + } else { // options.workerType === 'auto' or undefined + if (environment.platform === 'browser') { + ensureWebWorker(); + return setupBrowserWorker(script, options.workerOpts, Worker); + } + else { // environment.platform === 'node' + var WorkerThreads = tryRequireWorkerThreads(); + if (WorkerThreads) { + return setupWorkerThreadWorker(script, WorkerThreads, options); + } else { + return setupProcessWorker(script, resolveForkOptions(options), require('child_process')); + } + } + } +} + +function setupBrowserWorker(script, workerOpts, Worker) { + // validate the options right before creating the worker (not when creating the pool) + validateOptions(workerOpts, workerOptsNames, 'workerOpts') + + // create the web worker + var worker = new Worker(script, workerOpts); + + worker.isBrowserWorker = true; + // add node.js API to the web worker + worker.on = function (event, callback) { + this.addEventListener(event, function (message) { + callback(message.data); + }); + }; + worker.send = function (message, transfer) { + this.postMessage(message, transfer); + }; + return worker; +} + +function setupWorkerThreadWorker(script, WorkerThreads, options) { + // validate the options right before creating the worker thread (not when creating the pool) + validateOptions(options?.workerThreadOpts, workerThreadOptsNames, 'workerThreadOpts') + + var worker = new WorkerThreads.Worker(script, { + stdout: options?.emitStdStreams ?? false, // pipe worker.STDOUT to process.STDOUT if not requested + stderr: options?.emitStdStreams ?? false, // pipe worker.STDERR to process.STDERR if not requested + ...options?.workerThreadOpts + }); + worker.isWorkerThread = true; + worker.send = function(message, transfer) { + this.postMessage(message, transfer); + }; + + worker.kill = function() { + this.terminate(); + return true; + }; + + worker.disconnect = function() { + this.terminate(); + }; + + if (options?.emitStdStreams) { + worker.stdout.on('data', (data) => worker.emit("stdout", data)) + worker.stderr.on('data', (data) => worker.emit("stderr", data)) + } + + return worker; +} + +function setupProcessWorker(script, options, child_process) { + // validate the options right before creating the child process (not when creating the pool) + validateOptions(options.forkOpts, forkOptsNames, 'forkOpts') + + // no WorkerThreads, fallback to sub-process based workers + var worker = child_process.fork( + script, + options.forkArgs, + options.forkOpts + ); + + // ignore transfer argument since it is not supported by process + var send = worker.send; + worker.send = function (message) { + return send.call(worker, message); + }; + + if (options.emitStdStreams) { + worker.stdout.on('data', (data) => worker.emit("stdout", data)) + worker.stderr.on('data', (data) => worker.emit("stderr", data)) + } + + worker.isChildProcess = true; + return worker; +} + +// add debug flags to child processes if the node inspector is active +function resolveForkOptions(opts) { + opts = opts || {}; + + var processExecArgv = process.execArgv.join(' '); + var inspectorActive = processExecArgv.indexOf('--inspect') !== -1; + var debugBrk = processExecArgv.indexOf('--debug-brk') !== -1; + + var execArgv = []; + if (inspectorActive) { + execArgv.push('--inspect=' + opts.debugPort); + + if (debugBrk) { + execArgv.push('--debug-brk'); + } + } + + process.execArgv.forEach(function(arg) { + if (arg.indexOf('--max-old-space-size') > -1) { + execArgv.push(arg) + } + }) + + return Object.assign({}, opts, { + forkArgs: opts.forkArgs, + forkOpts: Object.assign({}, opts.forkOpts, { + execArgv: (opts.forkOpts && opts.forkOpts.execArgv || []) + .concat(execArgv), + stdio: opts.emitStdStreams ? "pipe": undefined + }) + }); +} + +/** + * Converts a serialized error to Error + * @param {Object} obj Error that has been serialized and parsed to object + * @return {Error} The equivalent Error. + */ +function objectToError (obj) { + var temp = new Error('') + var props = Object.keys(obj) + + for (var i = 0; i < props.length; i++) { + temp[props[i]] = obj[props[i]] + } + + return temp +} + +function handleEmittedStdPayload(handler, payload) { + // TODO: refactor if parallel task execution gets added + Object.values(handler.processing) + .forEach(task => task?.options?.on(payload)); + + Object.values(handler.tracking) + .forEach(task => task?.options?.on(payload)); +} + +/** + * A WorkerHandler controls a single worker. This worker can be a child process + * on node.js or a WebWorker in a browser environment. + * @param {String} [script] If no script is provided, a default worker with a + * function run will be created. + * @param {import('./types.js').WorkerPoolOptions} [_options] See docs + * @constructor + */ +function WorkerHandler(script, _options) { + var me = this; + var options = _options || {}; + + this.script = script || getDefaultWorker(); + this.worker = setupWorker(this.script, options); + this.debugPort = options.debugPort; + this.forkOpts = options.forkOpts; + this.forkArgs = options.forkArgs; + this.workerOpts = options.workerOpts; + this.workerThreadOpts = options.workerThreadOpts + this.workerTerminateTimeout = options.workerTerminateTimeout; + + // The ready message is only sent if the worker.add method is called (And the default script is not used) + if (!script) { + this.worker.ready = true; + } + + // queue for requests that are received before the worker is ready + this.requestQueue = []; + + this.worker.on("stdout", function (data) { + handleEmittedStdPayload(me, {"stdout": data.toString()}) + }) + this.worker.on("stderr", function (data) { + handleEmittedStdPayload(me, {"stderr": data.toString()}) + }) + + this.worker.on('message', function (response) { + if (me.terminated) { + return; + } + if (typeof response === 'string' && response === 'ready') { + me.worker.ready = true; + dispatchQueuedRequests(); + } else { + // find the task from the processing queue, and run the tasks callback + var id = response.id; + var task = me.processing[id]; + if (task !== undefined) { + if (response.isEvent) { + if (task.options && typeof task.options.on === 'function') { + task.options.on(response.payload); + } + } else { + // remove the task from the queue + delete me.processing[id]; + + // test if we need to terminate + if (me.terminating === true) { + // complete worker termination if all tasks are finished + me.terminate(); + } + + // resolve the task's promise + if (response.error) { + task.resolver.reject(objectToError(response.error)); + } + else { + task.resolver.resolve(response.result); + } + } + } else { + // if the task is not the current, it might be tracked for cleanup + var task = me.tracking[id]; + if (task !== undefined) { + if (response.isEvent) { + if (task.options && typeof task.options.on === 'function') { + task.options.on(response.payload); + } + } + } + } + + if (response.method === CLEANUP_METHOD_ID) { + var trackedTask = me.tracking[response.id]; + if (trackedTask !== undefined) { + if (response.error) { + clearTimeout(trackedTask.timeoutId); + trackedTask.resolver.reject(objectToError(response.error)) + } else { + me.tracking && clearTimeout(trackedTask.timeoutId); + // if we do not encounter an error wrap the the original timeout error and reject + trackedTask.resolver.reject(new WrappedTimeoutError(trackedTask.error)); + } + } + delete me.tracking[id]; + } + } + }); + + // reject all running tasks on worker error + function onError(error) { + me.terminated = true; + + for (var id in me.processing) { + if (me.processing[id] !== undefined) { + me.processing[id].resolver.reject(error); + } + } + + me.processing = Object.create(null); + } + + // send all queued requests to worker + function dispatchQueuedRequests() + { + for(const request of me.requestQueue.splice(0)) { + me.worker.send(request.message, request.transfer); + } + } + + var worker = this.worker; + // listen for worker messages error and exit + this.worker.on('error', onError); + this.worker.on('exit', function (exitCode, signalCode) { + var message = 'Workerpool Worker terminated Unexpectedly\n'; + + message += ' exitCode: `' + exitCode + '`\n'; + message += ' signalCode: `' + signalCode + '`\n'; + + message += ' workerpool.script: `' + me.script + '`\n'; + message += ' spawnArgs: `' + worker.spawnargs + '`\n'; + message += ' spawnfile: `' + worker.spawnfile + '`\n' + + message += ' stdout: `' + worker.stdout + '`\n' + message += ' stderr: `' + worker.stderr + '`\n' + + onError(new Error(message)); + }); + + this.processing = Object.create(null); // queue with tasks currently in progress + this.tracking = Object.create(null); // queue with tasks being monitored for cleanup status + this.terminating = false; + this.terminated = false; + this.cleaning = false; + this.terminationHandler = null; + this.lastId = 0; +} + +/** + * Get a list with methods available on the worker. + * @return {Promise.} methods + */ +WorkerHandler.prototype.methods = function () { + return this.exec('methods'); +}; + +/** + * Execute a method with given parameters on the worker + * @param {String} method + * @param {Array} [params] + * @param {{resolve: Function, reject: Function}} [resolver] + * @param {import('./types.js').ExecOptions} [options] + * @return {Promise.<*, Error>} result + */ +WorkerHandler.prototype.exec = function(method, params, resolver, options) { + if (!resolver) { + resolver = Promise.defer(); + } + + // generate a unique id for the task + var id = ++this.lastId; + + // register a new task as being in progress + this.processing[id] = { + id: id, + resolver: resolver, + options: options + }; + + // build a JSON-RPC request + var request = { + message: { + id: id, + method: method, + params: params + }, + transfer: options && options.transfer + }; + + if (this.terminated) { + resolver.reject(new Error('Worker is terminated')); + } else if (this.worker.ready) { + // send the request to the worker + this.worker.send(request.message, request.transfer); + } else { + this.requestQueue.push(request); + } + + // on cancellation, force the worker to terminate + var me = this; + return resolver.promise.catch(function (error) { + if (error instanceof Promise.CancellationError || error instanceof Promise.TimeoutError) { + me.tracking[id] = { + id, + resolver: Promise.defer(), + options: options, + error, + }; + + // remove this task from the queue. It is already rejected (hence this + // catch event), and else it will be rejected again when terminating + delete me.processing[id]; + + me.tracking[id].resolver.promise = me.tracking[id].resolver.promise.catch(function(err) { + delete me.tracking[id]; + + // if we find the error is an instance of WrappedTimeoutError we know the error should not cause termination + // as the response from the worker did not contain an error. We still wish to throw the original timeout error + // to the caller. + if (err instanceof WrappedTimeoutError) { + throw err.error; + } + + var promise = me.terminateAndNotify(true) + .then(function() { + throw err; + }, function(err) { + throw err; + }); + + return promise; + }); + + me.worker.send({ + id, + method: CLEANUP_METHOD_ID + }); + + + /** + * Sets a timeout to reject the cleanup operation if the message sent to the worker + * does not receive a response. see worker.tryCleanup for worker cleanup operations. + * Here we use the workerTerminateTimeout as the worker will be terminated if the timeout does invoke. + * + * We need this timeout in either case of a Timeout or Cancellation Error as if + * the worker does not send a message we still need to give a window of time for a response. + * + * The workerTermniateTimeout is used here if this promise is rejected the worker cleanup + * operations will occure. + */ + me.tracking[id].timeoutId = setTimeout(function() { + me.tracking[id].resolver.reject(error); + }, me.workerTerminateTimeout); + + return me.tracking[id].resolver.promise; + } else { + throw error; + } + }) +}; + +/** + * Test whether the worker is processing any tasks or cleaning up before termination. + * @return {boolean} Returns true if the worker is busy + */ +WorkerHandler.prototype.busy = function () { + return this.cleaning || Object.keys(this.processing).length > 0; +}; + +/** + * Terminate the worker. + * @param {boolean} [force=false] If false (default), the worker is terminated + * after finishing all tasks currently in + * progress. If true, the worker will be + * terminated immediately. + * @param {function} [callback=null] If provided, will be called when process terminates. + */ +WorkerHandler.prototype.terminate = function (force, callback) { + var me = this; + if (force) { + // cancel all tasks in progress + for (var id in this.processing) { + if (this.processing[id] !== undefined) { + this.processing[id].resolver.reject(new Error('Worker terminated')); + } + } + + this.processing = Object.create(null); + } + + // If we are terminating, cancel all tracked task for cleanup + for (var task of Object.values(me.tracking)) { + clearTimeout(task.timeoutId); + task.resolver.reject(new Error('Worker Terminating')); + } + + me.tracking = Object.create(null); + + if (typeof callback === 'function') { + this.terminationHandler = callback; + } + if (!this.busy()) { + // all tasks are finished. kill the worker + var cleanup = function(err) { + me.terminated = true; + me.cleaning = false; + + if (me.worker != null && me.worker.removeAllListeners) { + // removeAllListeners is only available for child_process + me.worker.removeAllListeners('message'); + } + me.worker = null; + me.terminating = false; + if (me.terminationHandler) { + me.terminationHandler(err, me); + } else if (err) { + throw err; + } + } + + if (this.worker) { + if (typeof this.worker.kill === 'function') { + if (this.worker.killed) { + cleanup(new Error('worker already killed!')); + return; + } + + // child process and worker threads + var cleanExitTimeout = setTimeout(function() { + if (me.worker) { + me.worker.kill(); + } + }, this.workerTerminateTimeout); + + this.worker.once('exit', function() { + clearTimeout(cleanExitTimeout); + if (me.worker) { + me.worker.killed = true; + } + cleanup(); + }); + + if (this.worker.ready) { + this.worker.send(TERMINATE_METHOD_ID); + } else { + this.requestQueue.push({ message: TERMINATE_METHOD_ID }); + } + + // mark that the worker is cleaning up resources + // to prevent new tasks from being executed + this.cleaning = true; + return; + } + else if (typeof this.worker.terminate === 'function') { + this.worker.terminate(); // web worker + this.worker.killed = true; + } + else { + throw new Error('Failed to terminate worker'); + } + } + cleanup(); + } + else { + // we can't terminate immediately, there are still tasks being executed + this.terminating = true; + } +}; + +/** + * Terminate the worker, returning a Promise that resolves when the termination has been done. + * @param {boolean} [force=false] If false (default), the worker is terminated + * after finishing all tasks currently in + * progress. If true, the worker will be + * terminated immediately. + * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected + * after timeout if worker process has not been terminated. + * @return {Promise.} + */ +WorkerHandler.prototype.terminateAndNotify = function (force, timeout) { + var resolver = Promise.defer(); + if (timeout) { + resolver.promise.timeout(timeout); + } + this.terminate(force, function(err, worker) { + if (err) { + resolver.reject(err); + } else { + resolver.resolve(worker); + } + }); + return resolver.promise; +}; + +/** +* Wrapper error type to denote that a TimeoutError has already been proceesed +* and we should skip cleanup operations +* @param {Promise.TimeoutError} timeoutError +*/ +function WrappedTimeoutError(timeoutError) { + this.error = timeoutError; + this.stack = (new Error()).stack; +} + +module.exports = WorkerHandler; +module.exports._tryRequireWorkerThreads = tryRequireWorkerThreads; +module.exports._setupProcessWorker = setupProcessWorker; +module.exports._setupBrowserWorker = setupBrowserWorker; +module.exports._setupWorkerThreadWorker = setupWorkerThreadWorker; +module.exports.ensureWorkerThreads = ensureWorkerThreads; diff --git a/node_modules/workerpool/src/debug-port-allocator.js b/node_modules/workerpool/src/debug-port-allocator.js new file mode 100644 index 0000000..7688883 --- /dev/null +++ b/node_modules/workerpool/src/debug-port-allocator.js @@ -0,0 +1,28 @@ +'use strict'; + +var MAX_PORTS = 65535; +module.exports = DebugPortAllocator; +function DebugPortAllocator() { + this.ports = Object.create(null); + this.length = 0; +} + +DebugPortAllocator.prototype.nextAvailableStartingAt = function(starting) { + while (this.ports[starting] === true) { + starting++; + } + + if (starting >= MAX_PORTS) { + throw new Error('WorkerPool debug port limit reached: ' + starting + '>= ' + MAX_PORTS ); + } + + this.ports[starting] = true; + this.length++; + return starting; +}; + +DebugPortAllocator.prototype.releasePort = function(port) { + delete this.ports[port]; + this.length--; +}; + diff --git a/node_modules/workerpool/src/environment.js b/node_modules/workerpool/src/environment.js new file mode 100644 index 0000000..e20797a --- /dev/null +++ b/node_modules/workerpool/src/environment.js @@ -0,0 +1,30 @@ + +// source: https://github.com/flexdinesh/browser-or-node +// source: https://github.com/mozilla/pdf.js/blob/7ea0e40e588864cd938d1836ec61f1928d3877d3/src/shared/util.js#L24 +var isNode = function (nodeProcess) { + return ( + typeof nodeProcess !== 'undefined' && + nodeProcess.versions != null && + nodeProcess.versions.node != null && + nodeProcess + '' === '[object process]' + ); +} +module.exports.isNode = isNode + +// determines the JavaScript platform: browser or node +module.exports.platform = typeof process !== 'undefined' && isNode(process) + ? 'node' + : 'browser'; + +// determines whether the code is running in main thread or not +// note that in node.js we have to check both worker_thread and child_process +var worker_threads = module.exports.platform === 'node' && require('worker_threads'); +module.exports.isMainThread = module.exports.platform === 'node' + ? ((!worker_threads || worker_threads.isMainThread) && !process.connected) + : typeof Window !== 'undefined'; + +// determines the number of cpus available +module.exports.cpus = module.exports.platform === 'browser' + ? self.navigator.hardwareConcurrency + : require('os').cpus().length; + diff --git a/node_modules/workerpool/src/generated/embeddedWorker.js b/node_modules/workerpool/src/generated/embeddedWorker.js new file mode 100644 index 0000000..ba9b80a --- /dev/null +++ b/node_modules/workerpool/src/generated/embeddedWorker.js @@ -0,0 +1,6 @@ +/** + * embeddedWorker.js contains an embedded version of worker.js. + * This file is automatically generated, + * changes made in this file will be overwritten. + */ +module.exports = "!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).worker=n()}(this,(function(){\"use strict\";function e(n){return e=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},e(n)}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}var t={};var r=function(e,n){this.message=e,this.transfer=n},o={};function i(e,n){var t=this;if(!(this instanceof i))throw new SyntaxError(\"Constructor must be called with the new operator\");if(\"function\"!=typeof e)throw new SyntaxError(\"Function parameter handler(resolve, reject) missing\");var r=[],o=[];this.resolved=!1,this.rejected=!1,this.pending=!0,this[Symbol.toStringTag]=\"Promise\";var a=function(e,n){r.push(e),o.push(n)};this.then=function(e,n){return new i((function(t,r){var o=e?s(e,t,r):t,i=n?s(n,t,r):r;a(o,i)}),t)};var f=function(e){return t.resolved=!0,t.rejected=!1,t.pending=!1,r.forEach((function(n){n(e)})),a=function(n,t){n(e)},f=d=function(){},t},d=function(e){return t.resolved=!1,t.rejected=!0,t.pending=!1,o.forEach((function(n){n(e)})),a=function(n,t){t(e)},f=d=function(){},t};this.cancel=function(){return n?n.cancel():d(new u),t},this.timeout=function(e){if(n)n.timeout(e);else{var r=setTimeout((function(){d(new c(\"Promise timed out after \"+e+\" ms\"))}),e);t.always((function(){clearTimeout(r)}))}return t},e((function(e){f(e)}),(function(e){d(e)}))}function s(e,n,t){return function(r){try{var o=e(r);o&&\"function\"==typeof o.then&&\"function\"==typeof o.catch?o.then(n,t):n(o)}catch(e){t(e)}}}function u(e){this.message=e||\"promise cancelled\",this.stack=(new Error).stack}function c(e){this.message=e||\"timeout exceeded\",this.stack=(new Error).stack}return i.prototype.catch=function(e){return this.then(null,e)},i.prototype.always=function(e){return this.then(e,e)},i.prototype.finally=function(e){var n=this,t=function(){return new i((function(e){return e()})).then(e).then((function(){return n}))};return this.then(t,t)},i.all=function(e){return new i((function(n,t){var r=e.length,o=[];r?e.forEach((function(e,i){e.then((function(e){o[i]=e,0==--r&&n(o)}),(function(e){r=0,t(e)}))})):n(o)}))},i.defer=function(){var e={};return e.promise=new i((function(n,t){e.resolve=n,e.reject=t})),e},u.prototype=new Error,u.prototype.constructor=Error,u.prototype.name=\"CancellationError\",i.CancellationError=u,c.prototype=new Error,c.prototype.constructor=Error,c.prototype.name=\"TimeoutError\",i.TimeoutError=c,o.Promise=i,function(n){var t=r,i=o.Promise,s=\"__workerpool-cleanup__\",u={exit:function(){}},c={addAbortListener:function(e){u.abortListeners.push(e)},emit:u.emit};if(\"undefined\"!=typeof self&&\"function\"==typeof postMessage&&\"function\"==typeof addEventListener)u.on=function(e,n){addEventListener(e,(function(e){n(e.data)}))},u.send=function(e,n){n?postMessage(e,n):postMessage(e)};else{if(\"undefined\"==typeof process)throw new Error(\"Script must be executed as a worker\");var a;try{a=require(\"worker_threads\")}catch(n){if(\"object\"!==e(n)||null===n||\"MODULE_NOT_FOUND\"!==n.code)throw n}if(a&&null!==a.parentPort){var f=a.parentPort;u.send=f.postMessage.bind(f),u.on=f.on.bind(f),u.exit=process.exit.bind(process)}else u.on=process.on.bind(process),u.send=function(e){process.send(e)},u.on(\"disconnect\",(function(){process.exit(1)})),u.exit=process.exit.bind(process)}function d(e){return e&&e.toJSON?JSON.parse(JSON.stringify(e)):JSON.parse(JSON.stringify(e,Object.getOwnPropertyNames(e)))}function l(e){return e&&\"function\"==typeof e.then&&\"function\"==typeof e.catch}u.methods={},u.methods.run=function(e,n){var t=new Function(\"return (\"+e+\").apply(this, arguments);\");return t.worker=c,t.apply(t,n)},u.methods.methods=function(){return Object.keys(u.methods)},u.terminationHandler=void 0,u.abortListenerTimeout=1e3,u.abortListeners=[],u.terminateAndExit=function(e){var n=function(){u.exit(e)};if(!u.terminationHandler)return n();var t=u.terminationHandler(e);return l(t)?(t.then(n,n),t):(n(),new i((function(e,n){n(new Error(\"Worker terminating\"))})))},u.cleanup=function(e){if(!u.abortListeners.length)return u.send({id:e,method:s,error:d(new Error(\"Worker terminating\"))}),new i((function(e){e()}));var n,t=u.abortListeners.map((function(e){return e()})),r=new i((function(e,t){n=setTimeout((function(){t(new Error(\"Timeout occured waiting for abort handler, killing worker\"))}),u.abortListenerTimeout)})),o=i.all(t).then((function(){clearTimeout(n),u.abortListeners.length||(u.abortListeners=[])}),(function(){clearTimeout(n),u.exit()}));return new i((function(e,n){o.then(e,n),r.then(e,n)})).then((function(){u.send({id:e,method:s,error:null})}),(function(n){u.send({id:e,method:s,error:n?d(n):null})}))};var p=null;u.on(\"message\",(function(e){if(\"__workerpool-terminate__\"===e)return u.terminateAndExit(0);if(e.method===s)return u.cleanup(e.id);try{var n=u.methods[e.method];if(!n)throw new Error('Unknown method \"'+e.method+'\"');p=e.id;var r=n.apply(n,e.params);l(r)?r.then((function(n){n instanceof t?u.send({id:e.id,result:n.message,error:null},n.transfer):u.send({id:e.id,result:n,error:null}),p=null})).catch((function(n){u.send({id:e.id,result:null,error:d(n)}),p=null})):(r instanceof t?u.send({id:e.id,result:r.message,error:null},r.transfer):u.send({id:e.id,result:r,error:null}),p=null)}catch(n){u.send({id:e.id,result:null,error:d(n)})}})),u.register=function(e,n){if(e)for(var t in e)e.hasOwnProperty(t)&&(u.methods[t]=e[t],u.methods[t].worker=c);n&&(u.terminationHandler=n.onTerminate,u.abortListenerTimeout=n.abortListenerTimeout||1e3),u.send(\"ready\")},u.emit=function(e){if(p){if(e instanceof t)return void u.send({id:p,isEvent:!0,payload:e.message},e.transfer);u.send({id:p,isEvent:!0,payload:e})}},n.add=u.register,n.emit=u.emit}(t),n(t)}));\n//# sourceMappingURL=worker.min.js.map\n"; diff --git a/node_modules/workerpool/src/header.js b/node_modules/workerpool/src/header.js new file mode 100644 index 0000000..8beef14 --- /dev/null +++ b/node_modules/workerpool/src/header.js @@ -0,0 +1,24 @@ +/** + * workerpool.js + * https://github.com/josdejong/workerpool + * + * Offload tasks to a pool of workers on node.js and in the browser. + * + * @version @@version + * @date @@date + * + * @license + * Copyright (C) 2014-2022 Jos de Jong + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ diff --git a/node_modules/workerpool/src/index.js b/node_modules/workerpool/src/index.js new file mode 100644 index 0000000..c1e1a59 --- /dev/null +++ b/node_modules/workerpool/src/index.js @@ -0,0 +1,60 @@ +const {platform, isMainThread, cpus} = require('./environment'); + +/** @typedef {import("./Pool")} Pool */ +/** @typedef {import("./types.js").WorkerPoolOptions} WorkerPoolOptions */ +/** @typedef {import("./types.js").WorkerRegisterOptions} WorkerRegisterOptions */ + +/** + * @template { { [k: string]: (...args: any[]) => any } } T + * @typedef {import('./types.js').Proxy} Proxy + */ + +/** + * @overload + * Create a new worker pool + * @param {WorkerPoolOptions} [script] + * @returns {Pool} pool + */ +/** + * @overload + * Create a new worker pool + * @param {string} [script] + * @param {WorkerPoolOptions} [options] + * @returns {Pool} pool + */ +function pool(script, options) { + var Pool = require('./Pool'); + + return new Pool(script, options); +}; +exports.pool = pool; + +/** + * Create a worker and optionally register a set of methods to the worker. + * @param {{ [k: string]: (...args: any[]) => any }} [methods] + * @param {WorkerRegisterOptions} [options] + */ +function worker(methods, options) { + var worker = require('./worker'); + worker.add(methods, options); +}; +exports.worker = worker; + +/** + * Sends an event to the parent worker pool. + * @param {any} payload + */ +function workerEmit(payload) { + var worker = require('./worker'); + worker.emit(payload); +}; +exports.workerEmit = workerEmit; + +const {Promise} = require('./Promise'); +exports.Promise = Promise; + +exports.Transfer = require('./transfer'); + +exports.platform = platform; +exports.isMainThread = isMainThread; +exports.cpus = cpus; diff --git a/node_modules/workerpool/src/requireFoolWebpack.js b/node_modules/workerpool/src/requireFoolWebpack.js new file mode 100644 index 0000000..15b208e --- /dev/null +++ b/node_modules/workerpool/src/requireFoolWebpack.js @@ -0,0 +1,8 @@ +// source of inspiration: https://github.com/sindresorhus/require-fool-webpack +var requireFoolWebpack = eval( + 'typeof require !== \'undefined\' ' + + '? require ' + + ': function (module) { throw new Error(\'Module " + module + " not found.\') }' +); + +module.exports = requireFoolWebpack; diff --git a/node_modules/workerpool/src/transfer.js b/node_modules/workerpool/src/transfer.js new file mode 100644 index 0000000..2e51c09 --- /dev/null +++ b/node_modules/workerpool/src/transfer.js @@ -0,0 +1,12 @@ +/** + * The helper class for transferring data from the worker to the main thread. + * + * @param {Object} message The object to deliver to the main thread. + * @param {Object[]} transfer An array of transferable Objects to transfer ownership of. + */ +function Transfer(message, transfer) { + this.message = message; + this.transfer = transfer; +} + +module.exports = Transfer; diff --git a/node_modules/workerpool/src/types.js b/node_modules/workerpool/src/types.js new file mode 100644 index 0000000..c4709fe --- /dev/null +++ b/node_modules/workerpool/src/types.js @@ -0,0 +1,47 @@ +/** + * @typedef {Object} WorkerArg + * @property {string[]} [forkArgs] The `forkArgs` option of this pool + * @property {import('child_process').ForkOptions} [forkOpts] The `forkOpts` option of this pool + * @property {WorkerOptions} [workerOpts] The `workerOpts` option of this pool + * @property {import('worker_threads').WorkerOptions} [workerThreadOpts] The `workerThreadOpts` option of this pool + * @property {string} [script] The `script` option of this pool + */ + +/** + * @typedef {Object} WorkerPoolOptions + * @property {number | 'max'} [minWorkers] The minimum number of workers that must be initialized and kept available. Setting this to `'max'` will create `maxWorkers` default workers + * @property {number} [maxWorkers] The default number of maxWorkers is the number of CPU's minus one. When the number of CPU's could not be determined (for example in older browsers), `maxWorkers` is set to 3. + * @property {number} [maxQueueSize] The maximum number of tasks allowed to be queued. Can be used to prevent running out of memory. If the maximum is exceeded, adding a new task will throw an error. The default value is `Infinity`. + * @property {'auto' | 'web' | 'process' | 'thread'} [workerType] + * - In case of `'auto'` (default), workerpool will automatically pick a suitable type of worker: when in a browser environment, `'web'` will be used. When in a node.js environment, `worker_threads` will be used if available (Node.js >= 11.7.0), else `child_process` will be used. + * - In case of `'web'`, a Web Worker will be used. Only available in a browser environment. + * - In case of `'process'`, `child_process` will be used. Only available in a node.js environment. + * - In case of `'thread'`, `worker_threads` will be used. If `worker_threads` are not available, an error is thrown. Only available in a node.js environment. + * @property {number} [workerTerminateTimeout] The timeout in milliseconds to wait for a worker to clean up it's resources on termination before stopping it forcefully. Default value is `1000`. + * @property {string[]} [forkArgs] For `process` worker type. An array passed as `args` to [child_process.fork](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options) + * @property {import('child_process').ForkOptions} [forkOpts] For `process` worker type. An object passed as `options` to [child_process.fork](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options). + * @property {WorkerOptions} [workerOpts] For `web` worker type. An object passed to the [constructor of the web worker](https://html.spec.whatwg.org/multipage/workers.html#dom-worker). See [WorkerOptions specification](https://html.spec.whatwg.org/multipage/workers.html#workeroptions) for available options. + * @property {import('worker_threads').WorkerOptions} [workerThreadOpts] Object`. For `worker` worker type. An object passed to [worker_threads.options](https://nodejs.org/api/worker_threads.html#new-workerfilename-options). + * @property {boolean} [emitStdStreams] Capture stdout and stderr from the worker and emit them via the `stdout` and `stderr` events. Not supported by the `web` worker type. + * @property { (arg: WorkerArg) => WorkerArg | undefined } [onCreateWorker] A callback that is called whenever a worker is being created. It can be used to allocate resources for each worker for example. Optionally, this callback can return an object containing one or more of the `WorkerArg` properties. The provided properties will be used to override the Pool properties for the worker being created. + * @property { (arg: WorkerArg) => void } [onTerminateWorker] A callback that is called whenever a worker is being terminated. It can be used to release resources that might have been allocated for this specific worker. The callback is passed as argument an object as described for `onCreateWorker`, with each property sets with the value for the worker being terminated. + */ + +/** + * @typedef {Object} ExecOptions + * @property {(payload: any) => unknown} [on] An event listener, to handle events sent by the worker for this execution. + * @property {Object[]} [transfer] A list of transferable objects to send to the worker. Not supported by `process` worker type. See ./examples/transferableObjects.js for usage. + */ + +/** + * @typedef {Object} WorkerRegisterOptions + * @property {(code: number | undefined) => PromiseLike | void} [onTerminate] A callback that is called whenever a worker is being terminated. It can be used to release resources that might have been allocated for this specific worker. The difference with pool's `onTerminateWorker` is that this callback runs in the worker context, while onTerminateWorker is executed on the main thread. + * @property {number} [abortListenerTimeout] The timeout in milliseconds to wait for a worker to clean up it's resources if an abort listener does not resolve, before stopping the worker forcefully. Default value is `1000`. + */ + +/** + * @template { { [k: string]: (...args: any[]) => any } } T + * @typedef {{ [M in keyof T]: (...args: Parameters) => import('./Promise.js').Promise>; }} Proxy + */ + +module.exports = {} diff --git a/node_modules/workerpool/src/validateOptions.js b/node_modules/workerpool/src/validateOptions.js new file mode 100644 index 0000000..7ec2ed5 --- /dev/null +++ b/node_modules/workerpool/src/validateOptions.js @@ -0,0 +1,51 @@ +/** + * Validate that the object only contains known option names + * - Throws an error when unknown options are detected + * - Throws an error when some of the allowed options are attached + * @param {Object | undefined} options + * @param {string[]} allowedOptionNames + * @param {string} objectName + * @retrun {Object} Returns the original options + */ +exports.validateOptions = function validateOptions(options, allowedOptionNames, objectName) { + if (!options) { + return + } + + var optionNames = options ? Object.keys(options) : [] + + // check for unknown properties + var unknownOptionName = optionNames.find(optionName => !allowedOptionNames.includes(optionName)) + if (unknownOptionName) { + throw new Error('Object "' + objectName + '" contains an unknown option "' + unknownOptionName + '"') + } + + // check for inherited properties which are not present on the object itself + var illegalOptionName = allowedOptionNames.find(allowedOptionName => { + return Object.prototype[allowedOptionName] && !optionNames.includes(allowedOptionName) + }) + if (illegalOptionName) { + throw new Error('Object "' + objectName + '" contains an inherited option "' + illegalOptionName + '" which is ' + + 'not defined in the object itself but in its prototype. Only plain objects are allowed. ' + + 'Please remove the option from the prototype or override it with a value "undefined".') + } + + return options +} + +// source: https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker +exports.workerOptsNames = [ + 'credentials', 'name', 'type' ] + +// source: https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options +exports.forkOptsNames = [ + 'cwd', 'detached', 'env', 'execPath', 'execArgv', 'gid', 'serialization', + 'signal', 'killSignal', 'silent', 'stdio', 'uid', 'windowsVerbatimArguments', + 'timeout' +] + +// source: https://nodejs.org/api/worker_threads.html#new-workerfilename-options +exports.workerThreadOptsNames = [ + 'argv', 'env', 'eval', 'execArgv', 'stdin', 'stdout', 'stderr', 'workerData', + 'trackUnmanagedFds', 'transferList', 'resourceLimits', 'name' +] diff --git a/node_modules/workerpool/src/worker.js b/node_modules/workerpool/src/worker.js new file mode 100644 index 0000000..26b025c --- /dev/null +++ b/node_modules/workerpool/src/worker.js @@ -0,0 +1,386 @@ +/** + * worker must be started as a child process or a web worker. + * It listens for RPC messages from the parent process. + */ + +var Transfer = require('./transfer'); + +/** + * worker must handle async cleanup handlers. Use custom Promise implementation. +*/ +var Promise = require('./Promise').Promise; +/** + * Special message sent by parent which causes the worker to terminate itself. + * Not a "message object"; this string is the entire message. + */ +var TERMINATE_METHOD_ID = '__workerpool-terminate__'; + +/** + * Special message by parent which causes a child process worker to perform cleaup + * steps before determining if the child process worker should be terminated. +*/ +var CLEANUP_METHOD_ID = '__workerpool-cleanup__'; +// var nodeOSPlatform = require('./environment').nodeOSPlatform; + + +var TIMEOUT_DEFAULT = 1_000; + +// create a worker API for sending and receiving messages which works both on +// node.js and in the browser +var worker = { + exit: function() {} +}; + +// api for in worker communication with parent process +// works in both node.js and the browser +var publicWorker = { + /** + * Registers listeners which will trigger when a task is timed out or cancled. If all listeners resolve, the worker executing the given task will not be terminated. + * *Note*: If there is a blocking operation within a listener, the worker will be terminated. + * @param {() => Promise} listener + */ + addAbortListener: function(listener) { + worker.abortListeners.push(listener); + }, + + /** + * Emit an event from the worker thread to the main thread. + * @param {any} payload + */ + emit: worker.emit +}; + +if (typeof self !== 'undefined' && typeof postMessage === 'function' && typeof addEventListener === 'function') { + // worker in the browser + worker.on = function (event, callback) { + addEventListener(event, function (message) { + callback(message.data); + }) + }; + worker.send = function (message, transfer) { + transfer ? postMessage(message, transfer) : postMessage (message); + }; +} +else if (typeof process !== 'undefined') { + // node.js + + var WorkerThreads; + try { + WorkerThreads = require('worker_threads'); + } catch(error) { + if (typeof error === 'object' && error !== null && error.code === 'MODULE_NOT_FOUND') { + // no worker_threads, fallback to sub-process based workers + } else { + throw error; + } + } + + if (WorkerThreads && + /* if there is a parentPort, we are in a WorkerThread */ + WorkerThreads.parentPort !== null) { + var parentPort = WorkerThreads.parentPort; + worker.send = parentPort.postMessage.bind(parentPort); + worker.on = parentPort.on.bind(parentPort); + worker.exit = process.exit.bind(process); + } else { + worker.on = process.on.bind(process); + // ignore transfer argument since it is not supported by process + worker.send = function (message) { + process.send(message); + }; + // register disconnect handler only for subprocess worker to exit when parent is killed unexpectedly + worker.on('disconnect', function () { + process.exit(1); + }); + worker.exit = process.exit.bind(process); + } +} +else { + throw new Error('Script must be executed as a worker'); +} + +function convertError(error) { + if (error && error.toJSON) { + return JSON.parse(JSON.stringify(error)); + } + + // turn a class like Error (having non-enumerable properties) into a plain object + return JSON.parse(JSON.stringify(error, Object.getOwnPropertyNames(error))); +} + +/** + * Test whether a value is a Promise via duck typing. + * @param {*} value + * @returns {boolean} Returns true when given value is an object + * having functions `then` and `catch`. + */ +function isPromise(value) { + return value && (typeof value.then === 'function') && (typeof value.catch === 'function'); +} + +// functions available externally +worker.methods = {}; + +/** + * Execute a function with provided arguments + * @param {String} fn Stringified function + * @param {Array} [args] Function arguments + * @returns {*} + */ +worker.methods.run = function run(fn, args) { + var f = new Function('return (' + fn + ').apply(this, arguments);'); + f.worker = publicWorker; + return f.apply(f, args); +}; + +/** + * Get a list with methods available on this worker + * @return {String[]} methods + */ +worker.methods.methods = function methods() { + return Object.keys(worker.methods); +}; + +/** + * Custom handler for when the worker is terminated. + */ +worker.terminationHandler = undefined; + +worker.abortListenerTimeout = TIMEOUT_DEFAULT; + +/** + * Abort handlers for resolving errors which may cause a timeout or cancellation + * to occur from a worker context + */ +worker.abortListeners = []; + +/** + * Cleanup and exit the worker. + * @param {Number} code + * @returns {Promise} + */ +worker.terminateAndExit = function(code) { + var _exit = function() { + worker.exit(code); + } + + if(!worker.terminationHandler) { + return _exit(); + } + + var result = worker.terminationHandler(code); + if (isPromise(result)) { + result.then(_exit, _exit); + + return result; + } else { + _exit(); + return new Promise(function (_resolve, reject) { + reject(new Error("Worker terminating")); + }); + } +} + + + +/** + * Called within the worker message handler to run abort handlers if registered to perform cleanup operations. + * @param {Integer} [requestId] id of task which is currently executing in the worker + * @return {Promise} +*/ +worker.cleanup = function(requestId) { + + if (!worker.abortListeners.length) { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: convertError(new Error('Worker terminating')), + }); + + // If there are no handlers registered, reject the promise with an error as we want the handler to be notified + // that cleanup should begin and the handler should be GCed. + return new Promise(function(resolve) { resolve(); }); + } + + + var _exit = function() { + worker.exit(); + } + + var _abort = function() { + if (!worker.abortListeners.length) { + worker.abortListeners = []; + } + } + + const promises = worker.abortListeners.map(listener => listener()); + let timerId; + const timeoutPromise = new Promise((_resolve, reject) => { + timerId = setTimeout(function () { + reject(new Error('Timeout occured waiting for abort handler, killing worker')); + }, worker.abortListenerTimeout); + }); + + // Once a promise settles we need to clear the timeout to prevet fulfulling the promise twice + const settlePromise = Promise.all(promises).then(function() { + clearTimeout(timerId); + _abort(); + }, function() { + clearTimeout(timerId); + _exit(); + }); + + // Returns a promise which will result in one of the following cases + // - Resolve once all handlers resolve + // - Reject if one or more handlers exceed the 'abortListenerTimeout' interval + // - Reject if one or more handlers reject + // Upon one of the above cases a message will be sent to the handler with the result of the handler execution + // which will either kill the worker if the result contains an error, or keep it in the pool if the result + // does not contain an error. + return new Promise(function(resolve, reject) { + settlePromise.then(resolve, reject); + timeoutPromise.then(resolve, reject); + }).then(function() { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: null, + }); + }, function(err) { + worker.send({ + id: requestId, + method: CLEANUP_METHOD_ID, + error: err ? convertError(err) : null, + }); + }); +} + +var currentRequestId = null; + +worker.on('message', function (request) { + if (request === TERMINATE_METHOD_ID) { + return worker.terminateAndExit(0); + } + + if (request.method === CLEANUP_METHOD_ID) { + return worker.cleanup(request.id); + } + + try { + var method = worker.methods[request.method]; + + if (method) { + currentRequestId = request.id; + + // execute the function + var result = method.apply(method, request.params); + + if (isPromise(result)) { + // promise returned, resolve this and then return + result + .then(function (result) { + if (result instanceof Transfer) { + worker.send({ + id: request.id, + result: result.message, + error: null + }, result.transfer); + } else { + worker.send({ + id: request.id, + result: result, + error: null + }); + } + currentRequestId = null; + }) + .catch(function (err) { + worker.send({ + id: request.id, + result: null, + error: convertError(err), + }); + currentRequestId = null; + }); + } + else { + // immediate result + if (result instanceof Transfer) { + worker.send({ + id: request.id, + result: result.message, + error: null + }, result.transfer); + } else { + worker.send({ + id: request.id, + result: result, + error: null + }); + } + + currentRequestId = null; + } + } + else { + throw new Error('Unknown method "' + request.method + '"'); + } + } + catch (err) { + worker.send({ + id: request.id, + result: null, + error: convertError(err) + }); + } +}); + +/** + * Register methods to the worker + * @param {Object} [methods] + * @param {import('./types.js').WorkerRegisterOptions} [options] + */ +worker.register = function (methods, options) { + + if (methods) { + for (var name in methods) { + if (methods.hasOwnProperty(name)) { + worker.methods[name] = methods[name]; + worker.methods[name].worker = publicWorker; + } + } + } + + if (options) { + worker.terminationHandler = options.onTerminate; + // register listener timeout or default to 1 second + worker.abortListenerTimeout = options.abortListenerTimeout || TIMEOUT_DEFAULT; + } + + worker.send('ready'); +}; + +worker.emit = function (payload) { + if (currentRequestId) { + if (payload instanceof Transfer) { + worker.send({ + id: currentRequestId, + isEvent: true, + payload: payload.message + }, payload.transfer); + return; + } + + worker.send({ + id: currentRequestId, + isEvent: true, + payload + }); + } +}; + + +if (typeof exports !== 'undefined') { + exports.add = worker.register; + exports.emit = worker.emit; +} diff --git a/node_modules/workerpool/types/Pool.d.ts b/node_modules/workerpool/types/Pool.d.ts new file mode 100644 index 0000000..e6a9a2a --- /dev/null +++ b/node_modules/workerpool/types/Pool.d.ts @@ -0,0 +1,128 @@ +export = Pool; +/** + * A pool to manage workers, which can be created using the function workerpool.pool. + * + * @param {String} [script] Optional worker script + * @param {import('./types.js').WorkerPoolOptions} [options] See docs + * @constructor + */ +declare function Pool(script?: string, options?: import("./types.js").WorkerPoolOptions): void; +declare class Pool { + /** + * A pool to manage workers, which can be created using the function workerpool.pool. + * + * @param {String} [script] Optional worker script + * @param {import('./types.js').WorkerPoolOptions} [options] See docs + * @constructor + */ + constructor(script?: string, options?: import("./types.js").WorkerPoolOptions); + /** @readonly */ + readonly script: string | null; + /** @private */ + private workers; + /** @private */ + private tasks; + /** @readonly */ + readonly forkArgs: readonly string[]; + /** @readonly */ + readonly forkOpts: Readonly; + /** @readonly */ + readonly workerOpts: Readonly; + /** @readonly */ + readonly workerThreadOpts: Readonly; + /** @private */ + private debugPortStart; + /** @readonly @deprecated */ + readonly nodeWorker: any; + /** @readonly + * @type {'auto' | 'web' | 'process' | 'thread'} + */ + readonly workerType: "auto" | "web" | "process" | "thread"; + /** @readonly */ + readonly maxQueueSize: number; + /** @readonly */ + readonly workerTerminateTimeout: number; + /** @readonly */ + readonly onCreateWorker: ((arg: import("./types.js").WorkerArg) => import("./types.js").WorkerArg | undefined) | (() => null); + /** @readonly */ + readonly onTerminateWorker: (arg: import("./types.js").WorkerArg) => void; + /** @readonly */ + readonly emitStdStreams: boolean; + /** @readonly */ + readonly maxWorkers: number | undefined; + /** @readonly */ + readonly minWorkers: number | undefined; + /** @private */ + private _boundNext; + /** + * Execute a function on a worker. + * + * Example usage: + * + * var pool = new Pool() + * + * // call a function available on the worker + * pool.exec('fibonacci', [6]) + * + * // offload a function + * function add(a, b) { + * return a + b + * }; + * pool.exec(add, [2, 4]) + * .then(function (result) { + * console.log(result); // outputs 6 + * }) + * .catch(function(error) { + * console.log(error); + * }); + * @template { (...args: any[]) => any } T + * @param {String | T} method Function name or function. + * If `method` is a string, the corresponding + * method on the worker will be executed + * If `method` is a Function, the function + * will be stringified and executed via the + * workers built-in function `run(fn, args)`. + * @param {Parameters | null} [params] Function arguments applied when calling the function + * @param {import('./types.js').ExecOptions} [options] Options + * @return {Promise>} + */ + exec any>(method: string | T, params?: Parameters | null, options?: import("./types.js").ExecOptions): Promise>; + /** + * Create a proxy for current worker. Returns an object containing all + * methods available on the worker. All methods return promises resolving the methods result. + * @template { { [k: string]: (...args: any[]) => any } } T + * @return {Promise, Error>} Returns a promise which resolves with a proxy object + */ + proxy any; + }>(...args: any[]): Promise, Error>; + private _next; + private _getWorker; + private _removeWorker; + private _removeWorkerFromList; + /** + * Close all active workers. Tasks currently being executed will be finished first. + * @param {boolean} [force=false] If false (default), the workers are terminated + * after finishing all tasks currently in + * progress. If true, the workers will be + * terminated immediately. + * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected + * after timeout if worker process has not been terminated. + * @return {Promise.} + */ + terminate(force?: boolean, timeout?: number): Promise; + /** + * Retrieve statistics on tasks and workers. + * @return {{totalWorkers: number, busyWorkers: number, idleWorkers: number, pendingTasks: number, activeTasks: number}} Returns an object with statistics + */ + stats(): { + totalWorkers: number; + busyWorkers: number; + idleWorkers: number; + pendingTasks: number; + activeTasks: number; + }; + private _ensureMinWorkers; + private _createWorkerHandler; +} +import { Promise } from "./Promise"; diff --git a/node_modules/workerpool/types/Promise.d.ts b/node_modules/workerpool/types/Promise.d.ts new file mode 100644 index 0000000..6ff85af --- /dev/null +++ b/node_modules/workerpool/types/Promise.d.ts @@ -0,0 +1,136 @@ +/** + * Promise + * + * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa + * @template T + * @template [E=Error] + * @param {Function} handler Called as handler(resolve: Function, reject: Function) + * @param {Promise} [parent] Parent promise for propagation of cancel and timeout + */ +export function Promise(handler: Function, parent?: Promise): void; +export class Promise { + /** + * Promise + * + * Inspired by https://gist.github.com/RubaXa/8501359 from RubaXa + * @template T + * @template [E=Error] + * @param {Function} handler Called as handler(resolve: Function, reject: Function) + * @param {Promise} [parent] Parent promise for propagation of cancel and timeout + */ + constructor(handler: Function, parent?: Promise); + /** + * @readonly + */ + readonly resolved: boolean; + /** + * @readonly + */ + readonly rejected: boolean; + /** + * @readonly + */ + readonly pending: boolean; + /** + * Add an onSuccess callback and optionally an onFail callback to the Promise + * @template TT + * @template [TE=never] + * @param {(r: T) => TT | PromiseLike} onSuccess + * @param {(r: E) => TE | PromiseLike} [onFail] + * @returns {Promise} promise + */ + then: (onSuccess: (r: T) => TT | PromiseLike, onFail?: (r: E) => TE | PromiseLike) => Promise; + /** + * Cancel the promise. This will reject the promise with a CancellationError + * @returns {this} self + */ + cancel: () => this; + /** + * Set a timeout for the promise. If the promise is not resolved within + * the time, the promise will be cancelled and a TimeoutError is thrown. + * If the promise is resolved in time, the timeout is removed. + * @param {number} delay Delay in milliseconds + * @returns {this} self + */ + timeout: (delay: number) => this; + /** + * Add an onFail callback to the Promise + * @template TT + * @param {(error: E) => TT | PromiseLike} onFail + * @returns {Promise} promise + */ + catch(onFail: (error: E) => TT | PromiseLike): Promise; + /** + * Execute given callback when the promise either resolves or rejects. + * @template TT + * @param {() => Promise} fn + * @returns {Promise} promise + */ + always(fn: () => Promise): Promise; + /** + * Execute given callback when the promise either resolves or rejects. + * Same semantics as Node's Promise.finally() + * @param {Function | null | undefined} [fn] + * @returns {Promise} promise + */ + finally(fn?: Function | null | undefined): Promise; + /** + * @readonly + */ + readonly [Symbol.toStringTag]: string; +} +export namespace Promise { + /** + * Create a promise which resolves when all provided promises are resolved, + * and fails when any of the promises resolves. + * @param {Promise[]} promises + * @returns {Promise} promise + */ + export function all(promises: Promise[]): Promise; + /** + * Create a promise resolver + * @returns {{promise: Promise, resolve: Function, reject: Function}} resolver + */ + export function defer(): { + promise: Promise; + resolve: Function; + reject: Function; + }; + export { CancellationError }; + export { TimeoutError }; +} +/** + * Create a cancellation error + * @param {String} [message] + * @extends Error + */ +declare function CancellationError(message?: string): void; +declare class CancellationError { + /** + * Create a cancellation error + * @param {String} [message] + * @extends Error + */ + constructor(message?: string); + message: string; + stack: string | undefined; + name: string; +} +/** + * Create a timeout error + * @param {String} [message] + * @extends Error + */ +declare function TimeoutError(message?: string): void; +declare class TimeoutError { + /** + * Create a timeout error + * @param {String} [message] + * @extends Error + */ + constructor(message?: string); + message: string; + stack: string | undefined; + name: string; +} +export {}; diff --git a/node_modules/workerpool/types/WorkerHandler.d.ts b/node_modules/workerpool/types/WorkerHandler.d.ts new file mode 100644 index 0000000..552eb42 --- /dev/null +++ b/node_modules/workerpool/types/WorkerHandler.d.ts @@ -0,0 +1,88 @@ +export = WorkerHandler; +/** + * A WorkerHandler controls a single worker. This worker can be a child process + * on node.js or a WebWorker in a browser environment. + * @param {String} [script] If no script is provided, a default worker with a + * function run will be created. + * @param {import('./types.js').WorkerPoolOptions} [_options] See docs + * @constructor + */ +declare function WorkerHandler(script?: string, _options?: import("./types.js").WorkerPoolOptions): void; +declare class WorkerHandler { + /** + * A WorkerHandler controls a single worker. This worker can be a child process + * on node.js or a WebWorker in a browser environment. + * @param {String} [script] If no script is provided, a default worker with a + * function run will be created. + * @param {import('./types.js').WorkerPoolOptions} [_options] See docs + * @constructor + */ + constructor(script?: string, _options?: import("./types.js").WorkerPoolOptions); + script: any; + worker: any; + debugPort: any; + forkOpts: import("child_process").ForkOptions | undefined; + forkArgs: string[] | undefined; + workerOpts: WorkerOptions | undefined; + workerThreadOpts: import("worker_threads").WorkerOptions | undefined; + workerTerminateTimeout: number | undefined; + requestQueue: any[]; + processing: any; + tracking: any; + terminating: boolean; + terminated: boolean; + cleaning: boolean; + terminationHandler: Function | null; + lastId: number; + /** + * Get a list with methods available on the worker. + * @return {Promise.} methods + */ + methods(): Promise; + /** + * Execute a method with given parameters on the worker + * @param {String} method + * @param {Array} [params] + * @param {{resolve: Function, reject: Function}} [resolver] + * @param {import('./types.js').ExecOptions} [options] + * @return {Promise.<*, Error>} result + */ + exec(method: string, params?: any[], resolver?: { + resolve: Function; + reject: Function; + }, options?: import("./types.js").ExecOptions): Promise; + /** + * Test whether the worker is processing any tasks or cleaning up before termination. + * @return {boolean} Returns true if the worker is busy + */ + busy(): boolean; + /** + * Terminate the worker. + * @param {boolean} [force=false] If false (default), the worker is terminated + * after finishing all tasks currently in + * progress. If true, the worker will be + * terminated immediately. + * @param {function} [callback=null] If provided, will be called when process terminates. + */ + terminate(force?: boolean, callback?: Function): void; + /** + * Terminate the worker, returning a Promise that resolves when the termination has been done. + * @param {boolean} [force=false] If false (default), the worker is terminated + * after finishing all tasks currently in + * progress. If true, the worker will be + * terminated immediately. + * @param {number} [timeout] If provided and non-zero, worker termination promise will be rejected + * after timeout if worker process has not been terminated. + * @return {Promise.} + */ + terminateAndNotify(force?: boolean, timeout?: number): Promise; +} +declare namespace WorkerHandler { + export { tryRequireWorkerThreads as _tryRequireWorkerThreads, setupProcessWorker as _setupProcessWorker, setupBrowserWorker as _setupBrowserWorker, setupWorkerThreadWorker as _setupWorkerThreadWorker, ensureWorkerThreads }; +} +import { Promise } from "./Promise"; +declare function tryRequireWorkerThreads(): typeof import("worker_threads") | null; +declare function setupProcessWorker(script: any, options: any, child_process: any): any; +declare function setupBrowserWorker(script: any, workerOpts: any, Worker: any): any; +declare function setupWorkerThreadWorker(script: any, WorkerThreads: any, options: any): any; +declare function ensureWorkerThreads(): typeof import("worker_threads"); diff --git a/node_modules/workerpool/types/debug-port-allocator.d.ts b/node_modules/workerpool/types/debug-port-allocator.d.ts new file mode 100644 index 0000000..562ef06 --- /dev/null +++ b/node_modules/workerpool/types/debug-port-allocator.d.ts @@ -0,0 +1,8 @@ +export = DebugPortAllocator; +declare function DebugPortAllocator(): void; +declare class DebugPortAllocator { + ports: any; + length: number; + nextAvailableStartingAt(starting: any): any; + releasePort(port: any): void; +} diff --git a/node_modules/workerpool/types/environment.d.ts b/node_modules/workerpool/types/environment.d.ts new file mode 100644 index 0000000..ee85560 --- /dev/null +++ b/node_modules/workerpool/types/environment.d.ts @@ -0,0 +1,4 @@ +export const platform: "node" | "browser"; +export const isMainThread: boolean; +export const cpus: number; +export function isNode(nodeProcess: any): boolean; diff --git a/node_modules/workerpool/types/generated/embeddedWorker.d.ts b/node_modules/workerpool/types/generated/embeddedWorker.d.ts new file mode 100644 index 0000000..763ab62 --- /dev/null +++ b/node_modules/workerpool/types/generated/embeddedWorker.d.ts @@ -0,0 +1,2 @@ +declare const _exports: string; +export = _exports; diff --git a/node_modules/workerpool/types/index.d.ts b/node_modules/workerpool/types/index.d.ts new file mode 100644 index 0000000..3b61751 --- /dev/null +++ b/node_modules/workerpool/types/index.d.ts @@ -0,0 +1,43 @@ +export const Transfer: typeof import("./transfer"); +export type Pool = import("./Pool"); +export type WorkerPoolOptions = import("./types.js").WorkerPoolOptions; +export type WorkerRegisterOptions = import("./types.js").WorkerRegisterOptions; +/** + * + */ +export type Proxy any; +}> = import("./types.js").Proxy; +/** + * @overload + * Create a new worker pool + * @param {WorkerPoolOptions} [script] + * @returns {Pool} pool + */ +export function pool(script?: import("./types.js").WorkerPoolOptions | undefined): import("./Pool"); +/** + * @overload + * Create a new worker pool + * @param {string} [script] + * @param {WorkerPoolOptions} [options] + * @returns {Pool} pool + */ +export function pool(script?: string | undefined, options?: import("./types.js").WorkerPoolOptions | undefined): import("./Pool"); +/** + * Create a worker and optionally register a set of methods to the worker. + * @param {{ [k: string]: (...args: any[]) => any }} [methods] + * @param {WorkerRegisterOptions} [options] + */ +export function worker(methods?: { + [k: string]: (...args: any[]) => any; +}, options?: WorkerRegisterOptions): void; +/** + * Sends an event to the parent worker pool. + * @param {any} payload + */ +export function workerEmit(payload: any): void; +import { Promise } from "./Promise"; +import { platform } from "./environment"; +import { isMainThread } from "./environment"; +import { cpus } from "./environment"; +export { Promise, platform, isMainThread, cpus }; diff --git a/node_modules/workerpool/types/test.ts b/node_modules/workerpool/types/test.ts new file mode 100644 index 0000000..a8120f9 --- /dev/null +++ b/node_modules/workerpool/types/test.ts @@ -0,0 +1,11 @@ +import { pool } from '..' + +async function run() { + + const p = pool('./worker.js') + + const res = await p.exec('add', [2, 3]) + + const b = res +2 + +} diff --git a/node_modules/workerpool/types/transfer.d.ts b/node_modules/workerpool/types/transfer.d.ts new file mode 100644 index 0000000..dfbcdec --- /dev/null +++ b/node_modules/workerpool/types/transfer.d.ts @@ -0,0 +1,19 @@ +export = Transfer; +/** + * The helper class for transferring data from the worker to the main thread. + * + * @param {Object} message The object to deliver to the main thread. + * @param {Object[]} transfer An array of transferable Objects to transfer ownership of. + */ +declare function Transfer(message: Object, transfer: Object[]): void; +declare class Transfer { + /** + * The helper class for transferring data from the worker to the main thread. + * + * @param {Object} message The object to deliver to the main thread. + * @param {Object[]} transfer An array of transferable Objects to transfer ownership of. + */ + constructor(message: Object, transfer: Object[]); + message: Object; + transfer: Object[]; +} diff --git a/node_modules/workerpool/types/types.d.ts b/node_modules/workerpool/types/types.d.ts new file mode 100644 index 0000000..2728309 --- /dev/null +++ b/node_modules/workerpool/types/types.d.ts @@ -0,0 +1,101 @@ +export type WorkerArg = { + /** + * The `forkArgs` option of this pool + */ + forkArgs?: string[] | undefined; + /** + * The `forkOpts` option of this pool + */ + forkOpts?: import("child_process").ForkOptions | undefined; + /** + * The `workerOpts` option of this pool + */ + workerOpts?: WorkerOptions | undefined; + /** + * The `workerThreadOpts` option of this pool + */ + workerThreadOpts?: import("worker_threads").WorkerOptions | undefined; + /** + * The `script` option of this pool + */ + script?: string | undefined; +}; +export type WorkerPoolOptions = { + /** + * The minimum number of workers that must be initialized and kept available. Setting this to `'max'` will create `maxWorkers` default workers + */ + minWorkers?: number | "max" | undefined; + /** + * The default number of maxWorkers is the number of CPU's minus one. When the number of CPU's could not be determined (for example in older browsers), `maxWorkers` is set to 3. + */ + maxWorkers?: number | undefined; + /** + * The maximum number of tasks allowed to be queued. Can be used to prevent running out of memory. If the maximum is exceeded, adding a new task will throw an error. The default value is `Infinity`. + */ + maxQueueSize?: number | undefined; + /** + * - In case of `'auto'` (default), workerpool will automatically pick a suitable type of worker: when in a browser environment, `'web'` will be used. When in a node.js environment, `worker_threads` will be used if available (Node.js >= 11.7.0), else `child_process` will be used. + * - In case of `'web'`, a Web Worker will be used. Only available in a browser environment. + * - In case of `'process'`, `child_process` will be used. Only available in a node.js environment. + * - In case of `'thread'`, `worker_threads` will be used. If `worker_threads` are not available, an error is thrown. Only available in a node.js environment. + */ + workerType?: "auto" | "web" | "process" | "thread" | undefined; + /** + * The timeout in milliseconds to wait for a worker to clean up it's resources on termination before stopping it forcefully. Default value is `1000`. + */ + workerTerminateTimeout?: number | undefined; + /** + * For `process` worker type. An array passed as `args` to [child_process.fork](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options) + */ + forkArgs?: string[] | undefined; + /** + * For `process` worker type. An object passed as `options` to [child_process.fork](https://nodejs.org/api/child_process.html#child_processforkmodulepath-args-options). + */ + forkOpts?: import("child_process").ForkOptions | undefined; + /** + * For `web` worker type. An object passed to the [constructor of the web worker](https://html.spec.whatwg.org/multipage/workers.html#dom-worker). See [WorkerOptions specification](https://html.spec.whatwg.org/multipage/workers.html#workeroptions) for available options. + */ + workerOpts?: WorkerOptions | undefined; + /** + * Object`. For `worker` worker type. An object passed to [worker_threads.options](https://nodejs.org/api/worker_threads.html#new-workerfilename-options). + */ + workerThreadOpts?: import("worker_threads").WorkerOptions | undefined; + /** + * Capture stdout and stderr from the worker and emit them via the `stdout` and `stderr` events. Not supported by the `web` worker type. + */ + emitStdStreams?: boolean | undefined; + /** + * A callback that is called whenever a worker is being created. It can be used to allocate resources for each worker for example. Optionally, this callback can return an object containing one or more of the `WorkerArg` properties. The provided properties will be used to override the Pool properties for the worker being created. + */ + onCreateWorker?: ((arg: WorkerArg) => WorkerArg | undefined) | undefined; + /** + * A callback that is called whenever a worker is being terminated. It can be used to release resources that might have been allocated for this specific worker. The callback is passed as argument an object as described for `onCreateWorker`, with each property sets with the value for the worker being terminated. + */ + onTerminateWorker?: ((arg: WorkerArg) => void) | undefined; +}; +export type ExecOptions = { + /** + * An event listener, to handle events sent by the worker for this execution. + */ + on?: ((payload: any) => unknown) | undefined; + /** + * A list of transferable objects to send to the worker. Not supported by `process` worker type. See ./examples/transferableObjects.js for usage. + */ + transfer?: Object[] | undefined; +}; +export type WorkerRegisterOptions = { + /** + * A callback that is called whenever a worker is being terminated. It can be used to release resources that might have been allocated for this specific worker. The difference with pool's `onTerminateWorker` is that this callback runs in the worker context, while onTerminateWorker is executed on the main thread. + */ + onTerminate?: ((code: number | undefined) => PromiseLike | void) | undefined; + /** + * The timeout in milliseconds to wait for a worker to clean up it's resources if an abort listener does not resolve, before stopping the worker forcefully. Default value is `1000`. + */ + abortListenerTimeout?: number | undefined; +}; +/** + * + */ +export type Proxy any; +}> = { [M in keyof T]: (...args: Parameters) => import("./Promise.js").Promise>; }; diff --git a/node_modules/workerpool/types/validateOptions.d.ts b/node_modules/workerpool/types/validateOptions.d.ts new file mode 100644 index 0000000..7e4ec45 --- /dev/null +++ b/node_modules/workerpool/types/validateOptions.d.ts @@ -0,0 +1,4 @@ +export function validateOptions(options: Object | undefined, allowedOptionNames: string[], objectName: string): Object | undefined; +export const workerOptsNames: string[]; +export const forkOptsNames: string[]; +export const workerThreadOptsNames: string[]; diff --git a/node_modules/workerpool/types/worker.d.ts b/node_modules/workerpool/types/worker.d.ts new file mode 100644 index 0000000..c9c8d6d --- /dev/null +++ b/node_modules/workerpool/types/worker.d.ts @@ -0,0 +1,8 @@ +/** + * Register methods to the worker + * @param {Object} [methods] + * @param {import('./types.js').WorkerRegisterOptions} [options] + */ +declare function register(methods?: Object, options?: import("./types.js").WorkerRegisterOptions): void; +export function emit(payload: any): void; +export { register as add }; diff --git a/node_modules/wrap-ansi-cjs/index.js b/node_modules/wrap-ansi-cjs/index.js new file mode 100644 index 0000000..d502255 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/index.js @@ -0,0 +1,216 @@ +'use strict'; +const stringWidth = require('string-width'); +const stripAnsi = require('strip-ansi'); +const ansiStyles = require('ansi-styles'); + +const ESCAPES = new Set([ + '\u001B', + '\u009B' +]); + +const END_CODE = 39; + +const ANSI_ESCAPE_BELL = '\u0007'; +const ANSI_CSI = '['; +const ANSI_OSC = ']'; +const ANSI_SGR_TERMINATOR = 'm'; +const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; + +const wrapAnsi = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; +const wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`; + +// Calculate the length of words split on ' ', ignoring +// the extra characters added by ansi escape codes +const wordLengths = string => string.split(' ').map(character => stringWidth(character)); + +// Wrap a long word across multiple rows +// Ansi escape codes do not count towards length +const wrapWord = (rows, word, columns) => { + const characters = [...word]; + + let isInsideEscape = false; + let isInsideLinkEscape = false; + let visible = stringWidth(stripAnsi(rows[rows.length - 1])); + + for (const [index, character] of characters.entries()) { + const characterLength = stringWidth(character); + + if (visible + characterLength <= columns) { + rows[rows.length - 1] += character; + } else { + rows.push(character); + visible = 0; + } + + if (ESCAPES.has(character)) { + isInsideEscape = true; + isInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK); + } + + if (isInsideEscape) { + if (isInsideLinkEscape) { + if (character === ANSI_ESCAPE_BELL) { + isInsideEscape = false; + isInsideLinkEscape = false; + } + } else if (character === ANSI_SGR_TERMINATOR) { + isInsideEscape = false; + } + + continue; + } + + visible += characterLength; + + if (visible === columns && index < characters.length - 1) { + rows.push(''); + visible = 0; + } + } + + // It's possible that the last row we copy over is only + // ansi escape characters, handle this edge-case + if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { + rows[rows.length - 2] += rows.pop(); + } +}; + +// Trims spaces from a string ignoring invisible sequences +const stringVisibleTrimSpacesRight = string => { + const words = string.split(' '); + let last = words.length; + + while (last > 0) { + if (stringWidth(words[last - 1]) > 0) { + break; + } + + last--; + } + + if (last === words.length) { + return string; + } + + return words.slice(0, last).join(' ') + words.slice(last).join(''); +}; + +// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode +// +// 'hard' will never allow a string to take up more than columns characters +// +// 'soft' allows long words to expand past the column length +const exec = (string, columns, options = {}) => { + if (options.trim !== false && string.trim() === '') { + return ''; + } + + let returnValue = ''; + let escapeCode; + let escapeUrl; + + const lengths = wordLengths(string); + let rows = ['']; + + for (const [index, word] of string.split(' ').entries()) { + if (options.trim !== false) { + rows[rows.length - 1] = rows[rows.length - 1].trimStart(); + } + + let rowLength = stringWidth(rows[rows.length - 1]); + + if (index !== 0) { + if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { + // If we start with a new word but the current row length equals the length of the columns, add a new row + rows.push(''); + rowLength = 0; + } + + if (rowLength > 0 || options.trim === false) { + rows[rows.length - 1] += ' '; + rowLength++; + } + } + + // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns' + if (options.hard && lengths[index] > columns) { + const remainingColumns = (columns - rowLength); + const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); + const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); + if (breaksStartingNextLine < breaksStartingThisLine) { + rows.push(''); + } + + wrapWord(rows, word, columns); + continue; + } + + if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); + continue; + } + + rows.push(''); + } + + if (rowLength + lengths[index] > columns && options.wordWrap === false) { + wrapWord(rows, word, columns); + continue; + } + + rows[rows.length - 1] += word; + } + + if (options.trim !== false) { + rows = rows.map(stringVisibleTrimSpacesRight); + } + + const pre = [...rows.join('\n')]; + + for (const [index, character] of pre.entries()) { + returnValue += character; + + if (ESCAPES.has(character)) { + const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}}; + if (groups.code !== undefined) { + const code = Number.parseFloat(groups.code); + escapeCode = code === END_CODE ? undefined : code; + } else if (groups.uri !== undefined) { + escapeUrl = groups.uri.length === 0 ? undefined : groups.uri; + } + } + + const code = ansiStyles.codes.get(Number(escapeCode)); + + if (pre[index + 1] === '\n') { + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(''); + } + + if (escapeCode && code) { + returnValue += wrapAnsi(code); + } + } else if (character === '\n') { + if (escapeCode && code) { + returnValue += wrapAnsi(escapeCode); + } + + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(escapeUrl); + } + } + } + + return returnValue; +}; + +// For each newline, invoke the method separately +module.exports = (string, columns, options) => { + return String(string) + .normalize() + .replace(/\r\n/g, '\n') + .split('\n') + .map(line => exec(line, columns, options)) + .join('\n'); +}; diff --git a/node_modules/wrap-ansi-cjs/license b/node_modules/wrap-ansi-cjs/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/wrap-ansi-cjs/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.d.ts b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000..2dbf6af --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..616ff83 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..017f531 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/readme.md b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..4d848bc --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/README.md b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/README.md new file mode 100644 index 0000000..f10e173 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/index.js b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 0000000..b4cf3dc --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\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{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/text.js b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 0000000..780309d --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\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\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.d.ts b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.d.ts new file mode 100644 index 0000000..1955b47 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,23 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.js b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.js new file mode 100644 index 0000000..d993a3a --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF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uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27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-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/package.json b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/package.json new file mode 100644 index 0000000..6d32352 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/package.json @@ -0,0 +1,50 @@ +{ + "name": "emoji-regex", + "version": "8.0.0", + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/emoji-regex.git" + }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + } +} diff --git a/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/text.js b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/text.js new file mode 100644 index 0000000..0a55ce2 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9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DE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts b/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts new file mode 100644 index 0000000..12b5309 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/wrap-ansi-cjs/node_modules/string-width/index.js b/node_modules/wrap-ansi-cjs/node_modules/string-width/index.js new file mode 100644 index 0000000..f4d261a --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/string-width/index.js @@ -0,0 +1,47 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/wrap-ansi-cjs/node_modules/string-width/license b/node_modules/wrap-ansi-cjs/node_modules/string-width/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/wrap-ansi-cjs/node_modules/string-width/package.json b/node_modules/wrap-ansi-cjs/node_modules/string-width/package.json new file mode 100644 index 0000000..28ba7b4 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/string-width/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.3", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/wrap-ansi-cjs/node_modules/string-width/readme.md b/node_modules/wrap-ansi-cjs/node_modules/string-width/readme.md new file mode 100644 index 0000000..bdd3141 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/string-width/readme.md @@ -0,0 +1,50 @@ +# string-width + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.d.ts b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000..907fccc --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..9a593df --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..1a41108 --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/readme.md b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..7c4b56d --- /dev/null +++ b/node_modules/wrap-ansi-cjs/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/wrap-ansi-cjs/package.json b/node_modules/wrap-ansi-cjs/package.json new file mode 100644 index 0000000..dfb2f4f --- /dev/null +++ b/node_modules/wrap-ansi-cjs/package.json @@ -0,0 +1,62 @@ +{ + "name": "wrap-ansi", + "version": "7.0.0", + "description": "Wordwrap a string with ANSI escape codes", + "license": "MIT", + "repository": "chalk/wrap-ansi", + "funding": "https://github.com/chalk/wrap-ansi?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "wrap", + "break", + "wordwrap", + "wordbreak", + "linewrap", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "chalk": "^4.0.0", + "coveralls": "^3.0.3", + "has-ansi": "^4.0.0", + "nyc": "^15.0.1", + "xo": "^0.29.1" + } +} diff --git a/node_modules/wrap-ansi-cjs/readme.md b/node_modules/wrap-ansi-cjs/readme.md new file mode 100644 index 0000000..68779ba --- /dev/null +++ b/node_modules/wrap-ansi-cjs/readme.md @@ -0,0 +1,91 @@ +# wrap-ansi [![Build Status](https://travis-ci.com/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.com/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master) + +> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) + +## Install + +``` +$ npm install wrap-ansi +``` + +## Usage + +```js +const chalk = require('chalk'); +const wrapAnsi = require('wrap-ansi'); + +const input = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(wrapAnsi(input, 20)); +``` + + + +## API + +### wrapAnsi(string, columns, options?) + +Wrap words to the specified column width. + +#### string + +Type: `string` + +String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`. + +#### columns + +Type: `number` + +Number of columns to wrap the text to. + +#### options + +Type: `object` + +##### hard + +Type: `boolean`\ +Default: `false` + +By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width. + +##### wordWrap + +Type: `boolean`\ +Default: `true` + +By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. + +##### trim + +Type: `boolean`\ +Default: `true` + +Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim. + +## Related + +- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes +- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right +- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures. + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) +- [Benjamin Coe](https://github.com/bcoe) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/wrap-ansi/index.d.ts b/node_modules/wrap-ansi/index.d.ts new file mode 100644 index 0000000..95471ca --- /dev/null +++ b/node_modules/wrap-ansi/index.d.ts @@ -0,0 +1,41 @@ +export type Options = { + /** + By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width. + + @default false + */ + readonly hard?: boolean; + + /** + By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. + + @default true + */ + readonly wordWrap?: boolean; + + /** + Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim. + + @default true + */ + readonly trim?: boolean; +}; + +/** +Wrap words to the specified column width. + +@param string - String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`. +@param columns - Number of columns to wrap the text to. + +@example +``` +import chalk from 'chalk'; +import wrapAnsi from 'wrap-ansi'; + +const input = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(wrapAnsi(input, 20)); +``` +*/ +export default function wrapAnsi(string: string, columns: number, options?: Options): string; diff --git a/node_modules/wrap-ansi/index.js b/node_modules/wrap-ansi/index.js new file mode 100644 index 0000000..d80c74c --- /dev/null +++ b/node_modules/wrap-ansi/index.js @@ -0,0 +1,214 @@ +import stringWidth from 'string-width'; +import stripAnsi from 'strip-ansi'; +import ansiStyles from 'ansi-styles'; + +const ESCAPES = new Set([ + '\u001B', + '\u009B', +]); + +const END_CODE = 39; +const ANSI_ESCAPE_BELL = '\u0007'; +const ANSI_CSI = '['; +const ANSI_OSC = ']'; +const ANSI_SGR_TERMINATOR = 'm'; +const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`; + +const wrapAnsiCode = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`; +const wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`; + +// Calculate the length of words split on ' ', ignoring +// the extra characters added by ansi escape codes +const wordLengths = string => string.split(' ').map(character => stringWidth(character)); + +// Wrap a long word across multiple rows +// Ansi escape codes do not count towards length +const wrapWord = (rows, word, columns) => { + const characters = [...word]; + + let isInsideEscape = false; + let isInsideLinkEscape = false; + let visible = stringWidth(stripAnsi(rows[rows.length - 1])); + + for (const [index, character] of characters.entries()) { + const characterLength = stringWidth(character); + + if (visible + characterLength <= columns) { + rows[rows.length - 1] += character; + } else { + rows.push(character); + visible = 0; + } + + if (ESCAPES.has(character)) { + isInsideEscape = true; + isInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK); + } + + if (isInsideEscape) { + if (isInsideLinkEscape) { + if (character === ANSI_ESCAPE_BELL) { + isInsideEscape = false; + isInsideLinkEscape = false; + } + } else if (character === ANSI_SGR_TERMINATOR) { + isInsideEscape = false; + } + + continue; + } + + visible += characterLength; + + if (visible === columns && index < characters.length - 1) { + rows.push(''); + visible = 0; + } + } + + // It's possible that the last row we copy over is only + // ansi escape characters, handle this edge-case + if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { + rows[rows.length - 2] += rows.pop(); + } +}; + +// Trims spaces from a string ignoring invisible sequences +const stringVisibleTrimSpacesRight = string => { + const words = string.split(' '); + let last = words.length; + + while (last > 0) { + if (stringWidth(words[last - 1]) > 0) { + break; + } + + last--; + } + + if (last === words.length) { + return string; + } + + return words.slice(0, last).join(' ') + words.slice(last).join(''); +}; + +// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode +// +// 'hard' will never allow a string to take up more than columns characters +// +// 'soft' allows long words to expand past the column length +const exec = (string, columns, options = {}) => { + if (options.trim !== false && string.trim() === '') { + return ''; + } + + let returnValue = ''; + let escapeCode; + let escapeUrl; + + const lengths = wordLengths(string); + let rows = ['']; + + for (const [index, word] of string.split(' ').entries()) { + if (options.trim !== false) { + rows[rows.length - 1] = rows[rows.length - 1].trimStart(); + } + + let rowLength = stringWidth(rows[rows.length - 1]); + + if (index !== 0) { + if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { + // If we start with a new word but the current row length equals the length of the columns, add a new row + rows.push(''); + rowLength = 0; + } + + if (rowLength > 0 || options.trim === false) { + rows[rows.length - 1] += ' '; + rowLength++; + } + } + + // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns' + if (options.hard && lengths[index] > columns) { + const remainingColumns = (columns - rowLength); + const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); + const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); + if (breaksStartingNextLine < breaksStartingThisLine) { + rows.push(''); + } + + wrapWord(rows, word, columns); + continue; + } + + if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); + continue; + } + + rows.push(''); + } + + if (rowLength + lengths[index] > columns && options.wordWrap === false) { + wrapWord(rows, word, columns); + continue; + } + + rows[rows.length - 1] += word; + } + + if (options.trim !== false) { + rows = rows.map(row => stringVisibleTrimSpacesRight(row)); + } + + const pre = [...rows.join('\n')]; + + for (const [index, character] of pre.entries()) { + returnValue += character; + + if (ESCAPES.has(character)) { + const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}}; + if (groups.code !== undefined) { + const code = Number.parseFloat(groups.code); + escapeCode = code === END_CODE ? undefined : code; + } else if (groups.uri !== undefined) { + escapeUrl = groups.uri.length === 0 ? undefined : groups.uri; + } + } + + const code = ansiStyles.codes.get(Number(escapeCode)); + + if (pre[index + 1] === '\n') { + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(''); + } + + if (escapeCode && code) { + returnValue += wrapAnsiCode(code); + } + } else if (character === '\n') { + if (escapeCode && code) { + returnValue += wrapAnsiCode(escapeCode); + } + + if (escapeUrl) { + returnValue += wrapAnsiHyperlink(escapeUrl); + } + } + } + + return returnValue; +}; + +// For each newline, invoke the method separately +export default function wrapAnsi(string, columns, options) { + return String(string) + .normalize() + .replace(/\r\n/g, '\n') + .split('\n') + .map(line => exec(line, columns, options)) + .join('\n'); +} diff --git a/node_modules/wrap-ansi/license b/node_modules/wrap-ansi/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/wrap-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts b/node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts new file mode 100644 index 0000000..ee8bc27 --- /dev/null +++ b/node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,236 @@ +export type CSPair = { // eslint-disable-line @typescript-eslint/naming-convention + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; +}; + +export type ColorBase = { + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + + ansi(code: number): string; + + ansi256(code: number): string; + + ansi16m(red: number, green: number, blue: number): string; +}; + +export type Modifier = { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Make text overline. + + Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash. + */ + readonly overline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; +}; + +export type ForegroundColor = { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; +}; + +export type BackgroundColor = { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; +}; + +export type ConvertColor = { + /** + Convert from the RGB color space to the ANSI 256 color space. + + @param red - (`0...255`) + @param green - (`0...255`) + @param blue - (`0...255`) + */ + rgbToAnsi256(red: number, green: number, blue: number): number; + + /** + Convert from the RGB HEX color space to the RGB color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToRgb(hex: string): [red: number, green: number, blue: number]; + + /** + Convert from the RGB HEX color space to the ANSI 256 color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToAnsi256(hex: string): number; + + /** + Convert from the ANSI 256 color space to the ANSI 16 color space. + + @param code - A number representing the ANSI 256 color. + */ + ansi256ToAnsi(code: number): number; + + /** + Convert from the RGB color space to the ANSI 16 color space. + + @param red - (`0...255`) + @param green - (`0...255`) + @param blue - (`0...255`) + */ + rgbToAnsi(red: number, green: number, blue: number): number; + + /** + Convert from the RGB HEX color space to the ANSI 16 color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToAnsi(hex: string): number; +}; + +/** +Basic modifier names. +*/ +export type ModifierName = keyof Modifier; + +/** +Basic foreground color names. + +[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support) +*/ +export type ForegroundColorName = keyof ForegroundColor; + +/** +Basic background color names. + +[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support) +*/ +export type BackgroundColorName = keyof BackgroundColor; + +/** +Basic color names. The combination of foreground and background color names. + +[More colors here.](https://github.com/chalk/chalk/blob/main/readme.md#256-and-truecolor-color-support) +*/ +export type ColorName = ForegroundColorName | BackgroundColorName; + +/** +Basic modifier names. +*/ +export const modifierNames: readonly ModifierName[]; + +/** +Basic foreground color names. +*/ +export const foregroundColorNames: readonly ForegroundColorName[]; + +/** +Basic background color names. +*/ +export const backgroundColorNames: readonly BackgroundColorName[]; + +/* +Basic color names. The combination of foreground and background color names. +*/ +export const colorNames: readonly ColorName[]; + +declare const ansiStyles: { + readonly modifier: Modifier; + readonly color: ColorBase & ForegroundColor; + readonly bgColor: ColorBase & BackgroundColor; + readonly codes: ReadonlyMap; +} & ForegroundColor & BackgroundColor & Modifier & ConvertColor; + +export default ansiStyles; diff --git a/node_modules/wrap-ansi/node_modules/ansi-styles/index.js b/node_modules/wrap-ansi/node_modules/ansi-styles/index.js new file mode 100644 index 0000000..eaa7bed --- /dev/null +++ b/node_modules/wrap-ansi/node_modules/ansi-styles/index.js @@ -0,0 +1,223 @@ +const ANSI_BACKGROUND_OFFSET = 10; + +const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`; + +const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`; + +const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`; + +const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29], + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + + // Bright color + blackBright: [90, 39], + gray: [90, 39], // Alias of `blackBright` + grey: [90, 39], // Alias of `blackBright` + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39], + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgGray: [100, 49], // Alias of `bgBlackBright` + bgGrey: [100, 49], // Alias of `bgBlackBright` + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49], + }, +}; + +export const modifierNames = Object.keys(styles.modifier); +export const foregroundColorNames = Object.keys(styles.color); +export const backgroundColorNames = Object.keys(styles.bgColor); +export const colorNames = [...foregroundColorNames, ...backgroundColorNames]; + +function assembleStyles() { + const codes = new Map(); + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m`, + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false, + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false, + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + + // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js + Object.defineProperties(styles, { + rgbToAnsi256: { + value(red, green, blue) { + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + + if (red > 248) { + return 231; + } + + return Math.round(((red - 8) / 247) * 24) + 232; + } + + return 16 + + (36 * Math.round(red / 255 * 5)) + + (6 * Math.round(green / 255 * 5)) + + Math.round(blue / 255 * 5); + }, + enumerable: false, + }, + hexToRgb: { + value(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + + let [colorString] = matches; + + if (colorString.length === 3) { + colorString = [...colorString].map(character => character + character).join(''); + } + + const integer = Number.parseInt(colorString, 16); + + return [ + /* eslint-disable no-bitwise */ + (integer >> 16) & 0xFF, + (integer >> 8) & 0xFF, + integer & 0xFF, + /* eslint-enable no-bitwise */ + ]; + }, + enumerable: false, + }, + hexToAnsi256: { + value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false, + }, + ansi256ToAnsi: { + value(code) { + if (code < 8) { + return 30 + code; + } + + if (code < 16) { + return 90 + (code - 8); + } + + let red; + let green; + let blue; + + if (code >= 232) { + red = (((code - 232) * 10) + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + + const remainder = code % 36; + + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = (remainder % 6) / 5; + } + + const value = Math.max(red, green, blue) * 2; + + if (value === 0) { + return 30; + } + + // eslint-disable-next-line no-bitwise + let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red)); + + if (value === 2) { + result += 60; + } + + return result; + }, + enumerable: false, + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false, + }, + hexToAnsi: { + value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false, + }, + }); + + return styles; +} + +const ansiStyles = assembleStyles(); + +export default ansiStyles; diff --git a/node_modules/wrap-ansi/node_modules/ansi-styles/license b/node_modules/wrap-ansi/node_modules/ansi-styles/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/wrap-ansi/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/wrap-ansi/node_modules/ansi-styles/package.json b/node_modules/wrap-ansi/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..16b508f --- /dev/null +++ b/node_modules/wrap-ansi/node_modules/ansi-styles/package.json @@ -0,0 +1,54 @@ +{ + "name": "ansi-styles", + "version": "6.2.3", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": "./index.js", + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "ava": "^6.1.3", + "svg-term-cli": "^2.1.1", + "tsd": "^0.31.1", + "xo": "^0.58.0" + } +} diff --git a/node_modules/wrap-ansi/node_modules/ansi-styles/readme.md b/node_modules/wrap-ansi/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..6d04183 --- /dev/null +++ b/node_modules/wrap-ansi/node_modules/ansi-styles/readme.md @@ -0,0 +1,173 @@ +# ansi-styles + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + +![](screenshot.png) + +## Install + +```sh +npm install ansi-styles +``` + +## Usage + +```js +import styles from 'ansi-styles'; + +console.log(`${styles.green.open}Hello world!${styles.green.close}`); + + +// Color conversion between 256/truecolor +// NOTE: When converting from truecolor to 256 colors, the original color +// may be degraded to fit the new color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(`${styles.color.ansi(styles.rgbToAnsi(199, 20, 250))}Hello World${styles.color.close}`) +console.log(`${styles.color.ansi256(styles.rgbToAnsi256(199, 20, 250))}Hello World${styles.color.close}`) +console.log(`${styles.color.ansi16m(...styles.hexToRgb('#abcdef'))}Hello World${styles.color.close}`) +``` + +## API + +### `open` and `close` + +Each style has an `open` and `close` property. + +### `modifierNames`, `foregroundColorNames`, `backgroundColorNames`, and `colorNames` + +All supported style strings are exposed as an array of strings for convenience. `colorNames` is the combination of `foregroundColorNames` and `backgroundColorNames`. + +This can be useful if you need to validate input: + +```js +import {modifierNames, foregroundColorNames} from 'ansi-styles'; + +console.log(modifierNames.includes('bold')); +//=> true + +console.log(foregroundColorNames.includes('pink')); +//=> false +``` + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `overline` *Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash.* +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `styles.modifier` +- `styles.color` +- `styles.bgColor` + +###### Example + +```js +import styles from 'ansi-styles'; + +console.log(styles.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `styles.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +import styles from 'ansi-styles'; + +console.log(styles.codes.get(36)); +//=> 39 +``` + +## 16 / 256 / 16 million (TrueColor) support + +`ansi-styles` allows converting between various color formats and ANSI escapes, with support for 16, 256 and [16 million colors](https://gist.github.com/XVilka/8346728). + +The following color spaces are supported: + +- `rgb` +- `hex` +- `ansi256` +- `ansi` + +To use these, call the associated conversion function with the intended output, for example: + +```js +import styles from 'ansi-styles'; + +styles.color.ansi(styles.rgbToAnsi(100, 200, 15)); // RGB to 16 color ansi foreground code +styles.bgColor.ansi(styles.hexToAnsi('#C0FFEE')); // HEX to 16 color ansi foreground code + +styles.color.ansi256(styles.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code +styles.bgColor.ansi256(styles.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code + +styles.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code +styles.bgColor.ansi16m(...styles.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/wrap-ansi/package.json b/node_modules/wrap-ansi/package.json new file mode 100644 index 0000000..198a5db --- /dev/null +++ b/node_modules/wrap-ansi/package.json @@ -0,0 +1,69 @@ +{ + "name": "wrap-ansi", + "version": "8.1.0", + "description": "Wordwrap a string with ANSI escape codes", + "license": "MIT", + "repository": "chalk/wrap-ansi", + "funding": "https://github.com/chalk/wrap-ansi?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "type": "module", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "engines": { + "node": ">=12" + }, + "scripts": { + "test": "xo && nyc ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "wrap", + "break", + "wordwrap", + "wordbreak", + "linewrap", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "devDependencies": { + "ava": "^3.15.0", + "chalk": "^4.1.2", + "coveralls": "^3.1.1", + "has-ansi": "^5.0.1", + "nyc": "^15.1.0", + "tsd": "^0.25.0", + "xo": "^0.44.0" + } +} diff --git a/node_modules/wrap-ansi/readme.md b/node_modules/wrap-ansi/readme.md new file mode 100644 index 0000000..21f6fed --- /dev/null +++ b/node_modules/wrap-ansi/readme.md @@ -0,0 +1,91 @@ +# wrap-ansi + +> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) + +## Install + +``` +$ npm install wrap-ansi +``` + +## Usage + +```js +import chalk from 'chalk'; +import wrapAnsi from 'wrap-ansi'; + +const input = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(wrapAnsi(input, 20)); +``` + + + +## API + +### wrapAnsi(string, columns, options?) + +Wrap words to the specified column width. + +#### string + +Type: `string` + +String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`. + +#### columns + +Type: `number` + +Number of columns to wrap the text to. + +#### options + +Type: `object` + +##### hard + +Type: `boolean`\ +Default: `false` + +By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width. + +##### wordWrap + +Type: `boolean`\ +Default: `true` + +By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. + +##### trim + +Type: `boolean`\ +Default: `true` + +Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim. + +## Related + +- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes +- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right +- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures. + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) +- [Benjamin Coe](https://github.com/bcoe) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/wrappy/LICENSE b/node_modules/wrappy/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/wrappy/README.md b/node_modules/wrappy/README.md new file mode 100644 index 0000000..98eab25 --- /dev/null +++ b/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/node_modules/wrappy/package.json b/node_modules/wrappy/package.json new file mode 100644 index 0000000..1307520 --- /dev/null +++ b/node_modules/wrappy/package.json @@ -0,0 +1,29 @@ +{ + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" + ], + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy" +} diff --git a/node_modules/wrappy/wrappy.js b/node_modules/wrappy/wrappy.js new file mode 100644 index 0000000..bb7e7d6 --- /dev/null +++ b/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/node_modules/write-file-atomic/CHANGELOG.md b/node_modules/write-file-atomic/CHANGELOG.md new file mode 100644 index 0000000..d1a6c1b --- /dev/null +++ b/node_modules/write-file-atomic/CHANGELOG.md @@ -0,0 +1,32 @@ +# 3.0.0 + +* Implement options.tmpfileCreated callback. +* Drop Node.js 6, modernize code, return Promise from async function. +* Support write TypedArray's like in node fs.writeFile. +* Remove graceful-fs dependency. + +# 2.4.3 + +* Ignore errors raised by `fs.closeSync` when cleaning up after a write + error. + +# 2.4.2 + +* A pair of patches to fix some fd leaks. We would leak fds with sync use + when errors occured and with async use any time fsync was not in use. (#34) + +# 2.4.1 + +* Fix a bug where `signal-exit` instances would be leaked. This was fixed when addressing #35. + +# 2.4.0 + +## Features + +* Allow chown and mode options to be set to false to disable the defaulting behavior. (#20) +* Support passing encoding strings in options slot for compat with Node.js API. (#31) +* Add support for running inside of worker threads (#37) + +## Fixes + +* Remove unneeded call when returning success (#36) diff --git a/node_modules/write-file-atomic/LICENSE b/node_modules/write-file-atomic/LICENSE new file mode 100644 index 0000000..95e65a7 --- /dev/null +++ b/node_modules/write-file-atomic/LICENSE @@ -0,0 +1,6 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/node_modules/write-file-atomic/README.md b/node_modules/write-file-atomic/README.md new file mode 100644 index 0000000..caea799 --- /dev/null +++ b/node_modules/write-file-atomic/README.md @@ -0,0 +1,72 @@ +write-file-atomic +----------------- + +This is an extension for node's `fs.writeFile` that makes its operation +atomic and allows you set ownership (uid/gid of the file). + +### var writeFileAtomic = require('write-file-atomic')
writeFileAtomic(filename, data, [options], [callback]) + +* filename **String** +* data **String** | **Buffer** +* options **Object** | **String** + * chown **Object** default, uid & gid of existing file, if any + * uid **Number** + * gid **Number** + * encoding **String** | **Null** default = 'utf8' + * fsync **Boolean** default = true + * mode **Number** default, from existing file, if any + * tmpfileCreated **Function** called when the tmpfile is created +* callback **Function** + +Atomically and asynchronously writes data to a file, replacing the file if it already +exists. data can be a string or a buffer. + +The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. +Note that `require('worker_threads').threadId` is used in addition to `process.pid` if running inside of a worker thread. +If writeFile completes successfully then, if passed the **chown** option it will change +the ownership of the file. Finally it renames the file back to the filename you specified. If +it encounters errors at any of these steps it will attempt to unlink the temporary file and then +pass the error back to the caller. +If multiple writes are concurrently issued to the same file, the write operations are put into a queue and serialized in the order they were called, using Promises. Writes to different files are still executed in parallel. + +If provided, the **chown** option requires both **uid** and **gid** properties or else +you'll get an error. If **chown** is not specified it will default to using +the owner of the previous file. To prevent chown from being ran you can +also pass `false`, in which case the file will be created with the current user's credentials. + +If **mode** is not specified, it will default to using the permissions from +an existing file, if any. Expicitly setting this to `false` remove this default, resulting +in a file created with the system default permissions. + +If options is a String, it's assumed to be the **encoding** option. The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. + +If the **fsync** option is **false**, writeFile will skip the final fsync call. + +If the **tmpfileCreated** option is specified it will be called with the name of the tmpfile when created. + +Example: + +```javascript +writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { + if (err) throw err; + console.log('It\'s saved!'); +}); +``` + +This function also supports async/await: + +```javascript +(async () => { + try { + await writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}); + console.log('It\'s saved!'); + } catch (err) { + console.error(err); + process.exit(1); + } +})(); +``` + +### var writeFileAtomicSync = require('write-file-atomic').sync
writeFileAtomicSync(filename, data, [options]) + +The synchronous version of **writeFileAtomic**. diff --git a/node_modules/write-file-atomic/index.js b/node_modules/write-file-atomic/index.js new file mode 100644 index 0000000..df5b72a --- /dev/null +++ b/node_modules/write-file-atomic/index.js @@ -0,0 +1,259 @@ +'use strict' +module.exports = writeFile +module.exports.sync = writeFileSync +module.exports._getTmpname = getTmpname // for testing +module.exports._cleanupOnExit = cleanupOnExit + +const fs = require('fs') +const MurmurHash3 = require('imurmurhash') +const onExit = require('signal-exit') +const path = require('path') +const isTypedArray = require('is-typedarray') +const typedArrayToBuffer = require('typedarray-to-buffer') +const { promisify } = require('util') +const activeFiles = {} + +// if we run inside of a worker_thread, `process.pid` is not unique +/* istanbul ignore next */ +const threadId = (function getId () { + try { + const workerThreads = require('worker_threads') + + /// if we are in main thread, this is set to `0` + return workerThreads.threadId + } catch (e) { + // worker_threads are not available, fallback to 0 + return 0 + } +})() + +let invocations = 0 +function getTmpname (filename) { + return filename + '.' + + MurmurHash3(__filename) + .hash(String(process.pid)) + .hash(String(threadId)) + .hash(String(++invocations)) + .result() +} + +function cleanupOnExit (tmpfile) { + return () => { + try { + fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) + } catch (_) {} + } +} + +function serializeActiveFile (absoluteName) { + return new Promise(resolve => { + // make a queue if it doesn't already exist + if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] + + activeFiles[absoluteName].push(resolve) // add this job to the queue + if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one + }) +} + +// https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342 +function isChownErrOk (err) { + if (err.code === 'ENOSYS') { + return true + } + + const nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (err.code === 'EINVAL' || err.code === 'EPERM') { + return true + } + } + + return false +} + +async function writeFileAsync (filename, data, options = {}) { + if (typeof options === 'string') { + options = { encoding: options } + } + + let fd + let tmpfile + /* istanbul ignore next -- The closure only gets called when onExit triggers */ + const removeOnExitHandler = onExit(cleanupOnExit(() => tmpfile)) + const absoluteName = path.resolve(filename) + + try { + await serializeActiveFile(absoluteName) + const truename = await promisify(fs.realpath)(filename).catch(() => filename) + tmpfile = getTmpname(truename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + const stats = await promisify(fs.stat)(truename).catch(() => {}) + if (stats) { + if (options.mode == null) { + options.mode = stats.mode + } + + if (options.chown == null && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } + } + + fd = await promisify(fs.open)(tmpfile, 'w', options.mode) + if (options.tmpfileCreated) { + await options.tmpfileCreated(tmpfile) + } + if (isTypedArray(data)) { + data = typedArrayToBuffer(data) + } + if (Buffer.isBuffer(data)) { + await promisify(fs.write)(fd, data, 0, data.length, 0) + } else if (data != null) { + await promisify(fs.write)(fd, String(data), 0, String(options.encoding || 'utf8')) + } + + if (options.fsync !== false) { + await promisify(fs.fsync)(fd) + } + + await promisify(fs.close)(fd) + fd = null + + if (options.chown) { + await promisify(fs.chown)(tmpfile, options.chown.uid, options.chown.gid).catch(err => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + if (options.mode) { + await promisify(fs.chmod)(tmpfile, options.mode).catch(err => { + if (!isChownErrOk(err)) { + throw err + } + }) + } + + await promisify(fs.rename)(tmpfile, truename) + } finally { + if (fd) { + await promisify(fs.close)(fd).catch( + /* istanbul ignore next */ + () => {} + ) + } + removeOnExitHandler() + await promisify(fs.unlink)(tmpfile).catch(() => {}) + activeFiles[absoluteName].shift() // remove the element added by serializeSameFile + if (activeFiles[absoluteName].length > 0) { + activeFiles[absoluteName][0]() // start next job if one is pending + } else delete activeFiles[absoluteName] + } +} + +function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = {} + } + + const promise = writeFileAsync(filename, data, options) + if (callback) { + promise.then(callback, callback) + } + + return promise +} + +function writeFileSync (filename, data, options) { + if (typeof options === 'string') options = { encoding: options } + else if (!options) options = {} + try { + filename = fs.realpathSync(filename) + } catch (ex) { + // it's ok, it'll happen on a not yet existing file + } + const tmpfile = getTmpname(filename) + + if (!options.mode || !options.chown) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + const stats = fs.statSync(filename) + options = Object.assign({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + let fd + const cleanup = cleanupOnExit(tmpfile) + const removeOnExitHandler = onExit(cleanup) + + let threw = true + try { + fd = fs.openSync(tmpfile, 'w', options.mode || 0o666) + if (options.tmpfileCreated) { + options.tmpfileCreated(tmpfile) + } + if (isTypedArray(data)) { + data = typedArrayToBuffer(data) + } + if (Buffer.isBuffer(data)) { + fs.writeSync(fd, data, 0, data.length, 0) + } else if (data != null) { + fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) + } + if (options.fsync !== false) { + fs.fsyncSync(fd) + } + + fs.closeSync(fd) + fd = null + + if (options.chown) { + try { + fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + if (options.mode) { + try { + fs.chmodSync(tmpfile, options.mode) + } catch (err) { + if (!isChownErrOk(err)) { + throw err + } + } + } + + fs.renameSync(tmpfile, filename) + threw = false + } finally { + if (fd) { + try { + fs.closeSync(fd) + } catch (ex) { + // ignore close errors at this stage, error may have closed fd already. + } + } + removeOnExitHandler() + if (threw) { + cleanup() + } + } +} diff --git a/node_modules/write-file-atomic/node_modules/signal-exit/LICENSE.txt b/node_modules/write-file-atomic/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 0000000..eead04a --- /dev/null +++ b/node_modules/write-file-atomic/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/write-file-atomic/node_modules/signal-exit/README.md b/node_modules/write-file-atomic/node_modules/signal-exit/README.md new file mode 100644 index 0000000..f9c7c00 --- /dev/null +++ b/node_modules/write-file-atomic/node_modules/signal-exit/README.md @@ -0,0 +1,39 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the process to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/node_modules/write-file-atomic/node_modules/signal-exit/index.js b/node_modules/write-file-atomic/node_modules/signal-exit/index.js new file mode 100644 index 0000000..93703f3 --- /dev/null +++ b/node_modules/write-file-atomic/node_modules/signal-exit/index.js @@ -0,0 +1,202 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +// grab a reference to node's real process object right away +var process = global.process + +const processOk = function (process) { + return process && + typeof process === 'object' && + typeof process.removeListener === 'function' && + typeof process.emit === 'function' && + typeof process.reallyExit === 'function' && + typeof process.listeners === 'function' && + typeof process.kill === 'function' && + typeof process.pid === 'number' && + typeof process.on === 'function' +} + +// some kind of non-node environment, just no-op +/* istanbul ignore if */ +if (!processOk(process)) { + module.exports = function () { + return function () {} + } +} else { + var assert = require('assert') + var signals = require('./signals.js') + var isWin = /^win/i.test(process.platform) + + var EE = require('events') + /* istanbul ignore if */ + if (typeof EE !== 'function') { + EE = EE.EventEmitter + } + + var emitter + if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ + } else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} + } + + // Because this emitter is a global, we have to check to see if a + // previous version of this library failed to enable infinite listeners. + // I know what you're about to say. But literally everything about + // signal-exit is a compromise with evil. Get used to it. + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true + } + + module.exports = function (cb, opts) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return function () {} + } + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove + } + + var unload = function unload () { + if (!loaded || !processOk(global.process)) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 + } + module.exports.unload = unload + + var emit = function emit (event, code, signal) { + /* istanbul ignore if */ + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) + } + + // { : , ... } + var sigListeners = {} + signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + if (isWin && sig === 'SIGHUP') { + // "SIGHUP" throws an `ENOSYS` error on Windows, + // so use a supported signal instead + sig = 'SIGINT' + } + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } + }) + + module.exports.signals = function () { + return signals + } + + var loaded = false + + var load = function load () { + if (loaded || !processOk(global.process)) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit + } + module.exports.load = load + + var originalProcessReallyExit = process.reallyExit + var processReallyExit = function processReallyExit (code) { + /* istanbul ignore if */ + if (!processOk(global.process)) { + return + } + process.exitCode = code || /* istanbul ignore next */ 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) + } + + var originalProcessEmit = process.emit + var processEmit = function processEmit (ev, arg) { + if (ev === 'exit' && processOk(global.process)) { + /* istanbul ignore else */ + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + /* istanbul ignore next */ + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } + } +} diff --git a/node_modules/write-file-atomic/node_modules/signal-exit/package.json b/node_modules/write-file-atomic/node_modules/signal-exit/package.json new file mode 100644 index 0000000..e1a0031 --- /dev/null +++ b/node_modules/write-file-atomic/node_modules/signal-exit/package.json @@ -0,0 +1,38 @@ +{ + "name": "signal-exit", + "version": "3.0.7", + "description": "when you want to fire an event no matter how a process exits.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "files": [ + "index.js", + "signals.js" + ], + "repository": { + "type": "git", + "url": "https://github.com/tapjs/signal-exit.git" + }, + "keywords": [ + "signal", + "exit" + ], + "author": "Ben Coe ", + "license": "ISC", + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "homepage": "https://github.com/tapjs/signal-exit", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^3.1.1", + "nyc": "^15.1.0", + "standard-version": "^9.3.1", + "tap": "^15.1.1" + } +} diff --git a/node_modules/write-file-atomic/node_modules/signal-exit/signals.js b/node_modules/write-file-atomic/node_modules/signal-exit/signals.js new file mode 100644 index 0000000..3bd67a8 --- /dev/null +++ b/node_modules/write-file-atomic/node_modules/signal-exit/signals.js @@ -0,0 +1,53 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/node_modules/write-file-atomic/package.json b/node_modules/write-file-atomic/package.json new file mode 100644 index 0000000..98a29a0 --- /dev/null +++ b/node_modules/write-file-atomic/package.json @@ -0,0 +1,48 @@ +{ + "name": "write-file-atomic", + "version": "3.0.3", + "description": "Write files in an atomic fashion w/configurable ownership", + "main": "index.js", + "scripts": { + "test": "tap", + "posttest": "npm run lint", + "lint": "standard", + "postlint": "rimraf chowncopy good nochmod nochown nofsync nofsyncopt noopen norename \"norename nounlink\" nowrite", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "repository": { + "type": "git", + "url": "git://github.com/npm/write-file-atomic.git" + }, + "keywords": [ + "writeFile", + "atomic" + ], + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/write-file-atomic/issues" + }, + "homepage": "https://github.com/npm/write-file-atomic", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + }, + "devDependencies": { + "mkdirp": "^0.5.1", + "require-inject": "^1.4.4", + "rimraf": "^2.6.3", + "standard": "^14.3.1", + "tap": "^14.10.6" + }, + "files": [ + "index.js" + ], + "tap": { + "100": true + } +} diff --git a/node_modules/xml2js/LICENSE b/node_modules/xml2js/LICENSE new file mode 100644 index 0000000..e3b4222 --- /dev/null +++ b/node_modules/xml2js/LICENSE @@ -0,0 +1,19 @@ +Copyright 2010, 2011, 2012, 2013. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/node_modules/xml2js/README.md b/node_modules/xml2js/README.md new file mode 100644 index 0000000..67f2104 --- /dev/null +++ b/node_modules/xml2js/README.md @@ -0,0 +1,507 @@ +node-xml2js +=========== + +Ever had the urge to parse XML? And wanted to access the data in some sane, +easy way? Don't want to compile a C parser, for whatever reason? Then xml2js is +what you're looking for! + +Description +=========== + +Simple XML to JavaScript object converter. It supports bi-directional conversion. +Uses [sax-js](https://github.com/isaacs/sax-js/) and +[xmlbuilder-js](https://github.com/oozcitak/xmlbuilder-js/). + +Note: If you're looking for a full DOM parser, you probably want +[JSDom](https://github.com/tmpvar/jsdom). + +Installation +============ + +Simplest way to install `xml2js` is to use [npm](http://npmjs.org), just `npm +install xml2js` which will download xml2js and all dependencies. + +xml2js is also available via [Bower](http://bower.io/), just `bower install +xml2js` which will download xml2js and all dependencies. + +Usage +===== + +No extensive tutorials required because you are a smart developer! The task of +parsing XML should be an easy one, so let's make it so! Here's some examples. + +Shoot-and-forget usage +---------------------- + +You want to parse XML as simple and easy as possible? It's dangerous to go +alone, take this: + +```javascript +var parseString = require('xml2js').parseString; +var xml = "Hello xml2js!" +parseString(xml, function (err, result) { + console.dir(result); +}); +``` + +Can't get easier than this, right? This works starting with `xml2js` 0.2.3. +With CoffeeScript it looks like this: + +```coffeescript +{parseString} = require 'xml2js' +xml = "Hello xml2js!" +parseString xml, (err, result) -> + console.dir result +``` + +If you need some special options, fear not, `xml2js` supports a number of +options (see below), you can specify these as second argument: + +```javascript +parseString(xml, {trim: true}, function (err, result) { +}); +``` + +Simple as pie usage +------------------- + +That's right, if you have been using xml-simple or a home-grown +wrapper, this was added in 0.1.11 just for you: + +```javascript +var fs = require('fs'), + xml2js = require('xml2js'); + +var parser = new xml2js.Parser(); +fs.readFile(__dirname + '/foo.xml', function(err, data) { + parser.parseString(data, function (err, result) { + console.dir(result); + console.log('Done'); + }); +}); +``` + +Look ma, no event listeners! + +You can also use `xml2js` from +[CoffeeScript](https://github.com/jashkenas/coffeescript), further reducing +the clutter: + +```coffeescript +fs = require 'fs', +xml2js = require 'xml2js' + +parser = new xml2js.Parser() +fs.readFile __dirname + '/foo.xml', (err, data) -> + parser.parseString data, (err, result) -> + console.dir result + console.log 'Done.' +``` + +But what happens if you forget the `new` keyword to create a new `Parser`? In +the middle of a nightly coding session, it might get lost, after all. Worry +not, we got you covered! Starting with 0.2.8 you can also leave it out, in +which case `xml2js` will helpfully add it for you, no bad surprises and +inexplicable bugs! + +Promise usage +------------- + +```javascript +var xml2js = require('xml2js'); +var xml = ''; + +// With parser +var parser = new xml2js.Parser(/* options */); +parser.parseStringPromise(xml).then(function (result) { + console.dir(result); + console.log('Done'); +}) +.catch(function (err) { + // Failed +}); + +// Without parser +xml2js.parseStringPromise(xml /*, options */).then(function (result) { + console.dir(result); + console.log('Done'); +}) +.catch(function (err) { + // Failed +}); +``` + +Parsing multiple files +---------------------- + +If you want to parse multiple files, you have multiple possibilities: + + * You can create one `xml2js.Parser` per file. That's the recommended one + and is promised to always *just work*. + * You can call `reset()` on your parser object. + * You can hope everything goes well anyway. This behaviour is not + guaranteed work always, if ever. Use option #1 if possible. Thanks! + +So you wanna some JSON? +----------------------- + +Just wrap the `result` object in a call to `JSON.stringify` like this +`JSON.stringify(result)`. You get a string containing the JSON representation +of the parsed object that you can feed to JSON-hungry consumers. + +Displaying results +------------------ + +You might wonder why, using `console.dir` or `console.log` the output at some +level is only `[Object]`. Don't worry, this is not because `xml2js` got lazy. +That's because Node uses `util.inspect` to convert the object into strings and +that function stops after `depth=2` which is a bit low for most XML. + +To display the whole deal, you can use `console.log(util.inspect(result, false, +null))`, which displays the whole result. + +So much for that, but what if you use +[eyes](https://github.com/cloudhead/eyes.js) for nice colored output and it +truncates the output with `…`? Don't fear, there's also a solution for that, +you just need to increase the `maxLength` limit by creating a custom inspector +`var inspect = require('eyes').inspector({maxLength: false})` and then you can +easily `inspect(result)`. + +XML builder usage +----------------- + +Since 0.4.0, objects can be also be used to build XML: + +```javascript +var xml2js = require('xml2js'); + +var obj = {name: "Super", Surname: "Man", age: 23}; + +var builder = new xml2js.Builder(); +var xml = builder.buildObject(obj); +``` +will result in: + +```xml + + + Super + Man + 23 + +``` + +At the moment, a one to one bi-directional conversion is guaranteed only for +default configuration, except for `attrkey`, `charkey` and `explicitArray` options +you can redefine to your taste. Writing CDATA is supported via setting the `cdata` +option to `true`. + +To specify attributes: +```javascript +var xml2js = require('xml2js'); + +var obj = {root: {$: {id: "my id"}, _: "my inner text"}}; + +var builder = new xml2js.Builder(); +var xml = builder.buildObject(obj); +``` +will result in: +```xml + +my inner text +``` + +### Adding xmlns attributes + +You can generate XML that declares XML namespace prefix / URI pairs with xmlns attributes. + +Example declaring a default namespace on the root element: + +```javascript +let obj = { + Foo: { + $: { + "xmlns": "http://foo.com" + } + } +}; +``` +Result of `buildObject(obj)`: +```xml + +``` +Example declaring non-default namespaces on non-root elements: +```javascript +let obj = { + 'foo:Foo': { + $: { + 'xmlns:foo': 'http://foo.com' + }, + 'bar:Bar': { + $: { + 'xmlns:bar': 'http://bar.com' + } + } + } +} +``` +Result of `buildObject(obj)`: +```xml + + + +``` + + +Processing attribute, tag names and values +------------------------------------------ + +Since 0.4.1 you can optionally provide the parser with attribute name and tag name processors as well as element value processors (Since 0.4.14, you can also optionally provide the parser with attribute value processors): + +```javascript + +function nameToUpperCase(name){ + return name.toUpperCase(); +} + +//transform all attribute and tag names and values to uppercase +parseString(xml, { + tagNameProcessors: [nameToUpperCase], + attrNameProcessors: [nameToUpperCase], + valueProcessors: [nameToUpperCase], + attrValueProcessors: [nameToUpperCase]}, + function (err, result) { + // processed data +}); +``` + +The `tagNameProcessors` and `attrNameProcessors` options +accept an `Array` of functions with the following signature: + +```javascript +function (name){ + //do something with `name` + return name +} +``` + +The `attrValueProcessors` and `valueProcessors` options +accept an `Array` of functions with the following signature: + +```javascript +function (value, name) { + //`name` will be the node name or attribute name + //do something with `value`, (optionally) dependent on the node/attr name + return value +} +``` + +Some processors are provided out-of-the-box and can be found in `lib/processors.js`: + +- `normalize`: transforms the name to lowercase. +(Automatically used when `options.normalize` is set to `true`) + +- `firstCharLowerCase`: transforms the first character to lower case. +E.g. 'MyTagName' becomes 'myTagName' + +- `stripPrefix`: strips the xml namespace prefix. E.g `` will become 'Bar'. +(N.B.: the `xmlns` prefix is NOT stripped.) + +- `parseNumbers`: parses integer-like strings as integers and float-like strings as floats +E.g. "0" becomes 0 and "15.56" becomes 15.56 + +- `parseBooleans`: parses boolean-like strings to booleans +E.g. "true" becomes true and "False" becomes false + +Options +======= + +Apart from the default settings, there are a number of options that can be +specified for the parser. Options are specified by ``new Parser({optionName: +value})``. Possible options are: + + * `attrkey` (default: `$`): Prefix that is used to access the attributes. + Version 0.1 default was `@`. + * `charkey` (default: `_`): Prefix that is used to access the character + content. Version 0.1 default was `#`. + * `explicitCharkey` (default: `false`) Determines whether or not to use + a `charkey` prefix for elements with no attributes. + * `trim` (default: `false`): Trim the whitespace at the beginning and end of + text nodes. + * `normalizeTags` (default: `false`): Normalize all tag names to lowercase. + * `normalize` (default: `false`): Trim whitespaces inside text nodes. + * `explicitRoot` (default: `true`): Set this if you want to get the root + node in the resulting object. + * `emptyTag` (default: `''`): what will the value of empty nodes be. In case + you want to use an empty object as a default value, it is better to provide a factory + function `() => ({})` instead. Without this function a plain object would + become a shared reference across all occurrences with unwanted behavior. + * `explicitArray` (default: `true`): Always put child nodes in an array if + true; otherwise an array is created only if there is more than one. + * `ignoreAttrs` (default: `false`): Ignore all XML attributes and only create + text nodes. + * `mergeAttrs` (default: `false`): Merge attributes and child elements as + properties of the parent, instead of keying attributes off a child + attribute object. This option is ignored if `ignoreAttrs` is `true`. + * `validator` (default `null`): You can specify a callable that validates + the resulting structure somehow, however you want. See unit tests + for an example. + * `xmlns` (default `false`): Give each element a field usually called '$ns' + (the first character is the same as attrkey) that contains its local name + and namespace URI. + * `explicitChildren` (default `false`): Put child elements to separate + property. Doesn't work with `mergeAttrs = true`. If element has no children + then "children" won't be created. Added in 0.2.5. + * `childkey` (default `$$`): Prefix that is used to access child elements if + `explicitChildren` is set to `true`. Added in 0.2.5. + * `preserveChildrenOrder` (default `false`): Modifies the behavior of + `explicitChildren` so that the value of the "children" property becomes an + ordered array. When this is `true`, every node will also get a `#name` field + whose value will correspond to the XML nodeName, so that you may iterate + the "children" array and still be able to determine node names. The named + (and potentially unordered) properties are also retained in this + configuration at the same level as the ordered "children" array. Added in + 0.4.9. + * `charsAsChildren` (default `false`): Determines whether chars should be + considered children if `explicitChildren` is on. Added in 0.2.5. + * `includeWhiteChars` (default `false`): Determines whether whitespace-only + text nodes should be included. Added in 0.4.17. + * `async` (default `false`): Should the callbacks be async? This *might* be + an incompatible change if your code depends on sync execution of callbacks. + Future versions of `xml2js` might change this default, so the recommendation + is to not depend on sync execution anyway. Added in 0.2.6. + * `strict` (default `true`): Set sax-js to strict or non-strict parsing mode. + Defaults to `true` which is *highly* recommended, since parsing HTML which + is not well-formed XML might yield just about anything. Added in 0.2.7. + * `attrNameProcessors` (default: `null`): Allows the addition of attribute + name processing functions. Accepts an `Array` of functions with following + signature: + ```javascript + function (name){ + //do something with `name` + return name + } + ``` + Added in 0.4.14 + * `attrValueProcessors` (default: `null`): Allows the addition of attribute + value processing functions. Accepts an `Array` of functions with following + signature: + ```javascript + function (value, name){ + //do something with `name` + return name + } + ``` + Added in 0.4.1 + * `tagNameProcessors` (default: `null`): Allows the addition of tag name + processing functions. Accepts an `Array` of functions with following + signature: + ```javascript + function (name){ + //do something with `name` + return name + } + ``` + Added in 0.4.1 + * `valueProcessors` (default: `null`): Allows the addition of element value + processing functions. Accepts an `Array` of functions with following + signature: + ```javascript + function (value, name){ + //do something with `name` + return name + } + ``` + Added in 0.4.6 + +Options for the `Builder` class +------------------------------- +These options are specified by ``new Builder({optionName: value})``. +Possible options are: + + * `attrkey` (default: `$`): Prefix that is used to access the attributes. + Version 0.1 default was `@`. + * `charkey` (default: `_`): Prefix that is used to access the character + content. Version 0.1 default was `#`. + * `rootName` (default `root` or the root key name): root element name to be used in case + `explicitRoot` is `false` or to override the root element name. + * `renderOpts` (default `{ 'pretty': true, 'indent': ' ', 'newline': '\n' }`): + Rendering options for xmlbuilder-js. + * pretty: prettify generated XML + * indent: whitespace for indentation (only when pretty) + * newline: newline char (only when pretty) + * `xmldec` (default `{ 'version': '1.0', 'encoding': 'UTF-8', 'standalone': true }`: + XML declaration attributes. + * `xmldec.version` A version number string, e.g. 1.0 + * `xmldec.encoding` Encoding declaration, e.g. UTF-8 + * `xmldec.standalone` standalone document declaration: true or false + * `doctype` (default `null`): optional DTD. Eg. `{'ext': 'hello.dtd'}` + * `headless` (default: `false`): omit the XML header. Added in 0.4.3. + * `allowSurrogateChars` (default: `false`): allows using characters from the Unicode + surrogate blocks. + * `cdata` (default: `false`): wrap text nodes in `` instead of + escaping when necessary. Does not add `` if it is not required. + Added in 0.4.5. + +`renderOpts`, `xmldec`,`doctype` and `headless` pass through to +[xmlbuilder-js](https://github.com/oozcitak/xmlbuilder-js). + +Updating to new version +======================= + +Version 0.2 changed the default parsing settings, but version 0.1.14 introduced +the default settings for version 0.2, so these settings can be tried before the +migration. + +```javascript +var xml2js = require('xml2js'); +var parser = new xml2js.Parser(xml2js.defaults["0.2"]); +``` + +To get the 0.1 defaults in version 0.2 you can just use +`xml2js.defaults["0.1"]` in the same place. This provides you with enough time +to migrate to the saner way of parsing in `xml2js` 0.2. We try to make the +migration as simple and gentle as possible, but some breakage cannot be +avoided. + +So, what exactly did change and why? In 0.2 we changed some defaults to parse +the XML in a more universal and sane way. So we disabled `normalize` and `trim` +so `xml2js` does not cut out any text content. You can reenable this at will of +course. A more important change is that we return the root tag in the resulting +JavaScript structure via the `explicitRoot` setting, so you need to access the +first element. This is useful for anybody who wants to know what the root node +is and preserves more information. The last major change was to enable +`explicitArray`, so everytime it is possible that one might embed more than one +sub-tag into a tag, xml2js >= 0.2 returns an array even if the array just +includes one element. This is useful when dealing with APIs that return +variable amounts of subtags. + +Running tests, development +========================== + +[![Build Status](https://travis-ci.org/Leonidas-from-XIV/node-xml2js.svg?branch=master)](https://travis-ci.org/Leonidas-from-XIV/node-xml2js) +[![Coverage Status](https://coveralls.io/repos/Leonidas-from-XIV/node-xml2js/badge.svg?branch=)](https://coveralls.io/r/Leonidas-from-XIV/node-xml2js?branch=master) +[![Dependency Status](https://david-dm.org/Leonidas-from-XIV/node-xml2js.svg)](https://david-dm.org/Leonidas-from-XIV/node-xml2js) + +The development requirements are handled by npm, you just need to install them. +We also have a number of unit tests, they can be run using `npm test` directly +from the project root. This runs zap to discover all the tests and execute +them. + +If you like to contribute, keep in mind that `xml2js` is written in +CoffeeScript, so don't develop on the JavaScript files that are checked into +the repository for convenience reasons. Also, please write some unit test to +check your behaviour and if it is some user-facing thing, add some +documentation to this README, so people will know it exists. Thanks in advance! + +Getting support +=============== + +Please, if you have a problem with the library, first make sure you read this +README. If you read this far, thanks, you're good. Then, please make sure your +problem really is with `xml2js`. It is? Okay, then I'll look at it. Send me a +mail and we can talk. Please don't open issues, as I don't think that is the +proper forum for support problems. Some problems might as well really be bugs +in `xml2js`, if so I'll let you know to open an issue instead :) + +But if you know you really found a bug, feel free to open an issue instead. diff --git a/node_modules/xml2js/lib/bom.js b/node_modules/xml2js/lib/bom.js new file mode 100644 index 0000000..7b8fb27 --- /dev/null +++ b/node_modules/xml2js/lib/bom.js @@ -0,0 +1,12 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + "use strict"; + exports.stripBOM = function(str) { + if (str[0] === '\uFEFF') { + return str.substring(1); + } else { + return str; + } + }; + +}).call(this); diff --git a/node_modules/xml2js/lib/builder.js b/node_modules/xml2js/lib/builder.js new file mode 100644 index 0000000..58f3638 --- /dev/null +++ b/node_modules/xml2js/lib/builder.js @@ -0,0 +1,127 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + "use strict"; + var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, + hasProp = {}.hasOwnProperty; + + builder = require('xmlbuilder'); + + defaults = require('./defaults').defaults; + + requiresCDATA = function(entry) { + return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0); + }; + + wrapCDATA = function(entry) { + return ""; + }; + + escapeCDATA = function(entry) { + return entry.replace(']]>', ']]]]>'); + }; + + exports.Builder = (function() { + function Builder(opts) { + var key, ref, value; + this.options = {}; + ref = defaults["0.2"]; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this.options[key] = value; + } + for (key in opts) { + if (!hasProp.call(opts, key)) continue; + value = opts[key]; + this.options[key] = value; + } + } + + Builder.prototype.buildObject = function(rootObj) { + var attrkey, charkey, render, rootElement, rootName; + attrkey = this.options.attrkey; + charkey = this.options.charkey; + if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) { + rootName = Object.keys(rootObj)[0]; + rootObj = rootObj[rootName]; + } else { + rootName = this.options.rootName; + } + render = (function(_this) { + return function(element, obj) { + var attr, child, entry, index, key, value; + if (typeof obj !== 'object') { + if (_this.options.cdata && requiresCDATA(obj)) { + element.raw(wrapCDATA(obj)); + } else { + element.txt(obj); + } + } else if (Array.isArray(obj)) { + for (index in obj) { + if (!hasProp.call(obj, index)) continue; + child = obj[index]; + for (key in child) { + entry = child[key]; + element = render(element.ele(key), entry).up(); + } + } + } else { + for (key in obj) { + if (!hasProp.call(obj, key)) continue; + child = obj[key]; + if (key === attrkey) { + if (typeof child === "object") { + for (attr in child) { + value = child[attr]; + element = element.att(attr, value); + } + } + } else if (key === charkey) { + if (_this.options.cdata && requiresCDATA(child)) { + element = element.raw(wrapCDATA(child)); + } else { + element = element.txt(child); + } + } else if (Array.isArray(child)) { + for (index in child) { + if (!hasProp.call(child, index)) continue; + entry = child[index]; + if (typeof entry === 'string') { + if (_this.options.cdata && requiresCDATA(entry)) { + element = element.ele(key).raw(wrapCDATA(entry)).up(); + } else { + element = element.ele(key, entry).up(); + } + } else { + element = render(element.ele(key), entry).up(); + } + } + } else if (typeof child === "object") { + element = render(element.ele(key), child).up(); + } else { + if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) { + element = element.ele(key).raw(wrapCDATA(child)).up(); + } else { + if (child == null) { + child = ''; + } + element = element.ele(key, child.toString()).up(); + } + } + } + } + return element; + }; + })(this); + rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, { + headless: this.options.headless, + allowSurrogateChars: this.options.allowSurrogateChars + }); + return render(rootElement, rootObj).end(this.options.renderOpts); + }; + + return Builder; + + })(); + +}).call(this); diff --git a/node_modules/xml2js/lib/defaults.js b/node_modules/xml2js/lib/defaults.js new file mode 100644 index 0000000..0a21da0 --- /dev/null +++ b/node_modules/xml2js/lib/defaults.js @@ -0,0 +1,72 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + exports.defaults = { + "0.1": { + explicitCharkey: false, + trim: true, + normalize: true, + normalizeTags: false, + attrkey: "@", + charkey: "#", + explicitArray: false, + ignoreAttrs: false, + mergeAttrs: false, + explicitRoot: false, + validator: null, + xmlns: false, + explicitChildren: false, + childkey: '@@', + charsAsChildren: false, + includeWhiteChars: false, + async: false, + strict: true, + attrNameProcessors: null, + attrValueProcessors: null, + tagNameProcessors: null, + valueProcessors: null, + emptyTag: '' + }, + "0.2": { + explicitCharkey: false, + trim: false, + normalize: false, + normalizeTags: false, + attrkey: "$", + charkey: "_", + explicitArray: true, + ignoreAttrs: false, + mergeAttrs: false, + explicitRoot: true, + validator: null, + xmlns: false, + explicitChildren: false, + preserveChildrenOrder: false, + childkey: '$$', + charsAsChildren: false, + includeWhiteChars: false, + async: false, + strict: true, + attrNameProcessors: null, + attrValueProcessors: null, + tagNameProcessors: null, + valueProcessors: null, + rootName: 'root', + xmldec: { + 'version': '1.0', + 'encoding': 'UTF-8', + 'standalone': true + }, + doctype: null, + renderOpts: { + 'pretty': true, + 'indent': ' ', + 'newline': '\n' + }, + headless: false, + chunkSize: 10000, + emptyTag: '', + cdata: false + } + }; + +}).call(this); diff --git a/node_modules/xml2js/lib/parser.js b/node_modules/xml2js/lib/parser.js new file mode 100644 index 0000000..7fa2fc5 --- /dev/null +++ b/node_modules/xml2js/lib/parser.js @@ -0,0 +1,395 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + "use strict"; + var bom, defaults, defineProperty, events, isEmpty, processItem, processors, sax, setImmediate, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + sax = require('sax'); + + events = require('events'); + + bom = require('./bom'); + + processors = require('./processors'); + + setImmediate = require('timers').setImmediate; + + defaults = require('./defaults').defaults; + + isEmpty = function(thing) { + return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0; + }; + + processItem = function(processors, item, key) { + var i, len, process; + for (i = 0, len = processors.length; i < len; i++) { + process = processors[i]; + item = process(item, key); + } + return item; + }; + + defineProperty = function(obj, key, value) { + var descriptor; + descriptor = Object.create(null); + descriptor.value = value; + descriptor.writable = true; + descriptor.enumerable = true; + descriptor.configurable = true; + return Object.defineProperty(obj, key, descriptor); + }; + + exports.Parser = (function(superClass) { + extend(Parser, superClass); + + function Parser(opts) { + this.parseStringPromise = bind(this.parseStringPromise, this); + this.parseString = bind(this.parseString, this); + this.reset = bind(this.reset, this); + this.assignOrPush = bind(this.assignOrPush, this); + this.processAsync = bind(this.processAsync, this); + var key, ref, value; + if (!(this instanceof exports.Parser)) { + return new exports.Parser(opts); + } + this.options = {}; + ref = defaults["0.2"]; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this.options[key] = value; + } + for (key in opts) { + if (!hasProp.call(opts, key)) continue; + value = opts[key]; + this.options[key] = value; + } + if (this.options.xmlns) { + this.options.xmlnskey = this.options.attrkey + "ns"; + } + if (this.options.normalizeTags) { + if (!this.options.tagNameProcessors) { + this.options.tagNameProcessors = []; + } + this.options.tagNameProcessors.unshift(processors.normalize); + } + this.reset(); + } + + Parser.prototype.processAsync = function() { + var chunk, err; + try { + if (this.remaining.length <= this.options.chunkSize) { + chunk = this.remaining; + this.remaining = ''; + this.saxParser = this.saxParser.write(chunk); + return this.saxParser.close(); + } else { + chunk = this.remaining.substr(0, this.options.chunkSize); + this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length); + this.saxParser = this.saxParser.write(chunk); + return setImmediate(this.processAsync); + } + } catch (error1) { + err = error1; + if (!this.saxParser.errThrown) { + this.saxParser.errThrown = true; + return this.emit(err); + } + } + }; + + Parser.prototype.assignOrPush = function(obj, key, newValue) { + if (!(key in obj)) { + if (!this.options.explicitArray) { + return defineProperty(obj, key, newValue); + } else { + return defineProperty(obj, key, [newValue]); + } + } else { + if (!(obj[key] instanceof Array)) { + defineProperty(obj, key, [obj[key]]); + } + return obj[key].push(newValue); + } + }; + + Parser.prototype.reset = function() { + var attrkey, charkey, ontext, stack; + this.removeAllListeners(); + this.saxParser = sax.parser(this.options.strict, { + trim: false, + normalize: false, + xmlns: this.options.xmlns + }); + this.saxParser.errThrown = false; + this.saxParser.onerror = (function(_this) { + return function(error) { + _this.saxParser.resume(); + if (!_this.saxParser.errThrown) { + _this.saxParser.errThrown = true; + return _this.emit("error", error); + } + }; + })(this); + this.saxParser.onend = (function(_this) { + return function() { + if (!_this.saxParser.ended) { + _this.saxParser.ended = true; + return _this.emit("end", _this.resultObject); + } + }; + })(this); + this.saxParser.ended = false; + this.EXPLICIT_CHARKEY = this.options.explicitCharkey; + this.resultObject = null; + stack = []; + attrkey = this.options.attrkey; + charkey = this.options.charkey; + this.saxParser.onopentag = (function(_this) { + return function(node) { + var key, newValue, obj, processedKey, ref; + obj = {}; + obj[charkey] = ""; + if (!_this.options.ignoreAttrs) { + ref = node.attributes; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + if (!(attrkey in obj) && !_this.options.mergeAttrs) { + obj[attrkey] = {}; + } + newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key]; + processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key; + if (_this.options.mergeAttrs) { + _this.assignOrPush(obj, processedKey, newValue); + } else { + defineProperty(obj[attrkey], processedKey, newValue); + } + } + } + obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name; + if (_this.options.xmlns) { + obj[_this.options.xmlnskey] = { + uri: node.uri, + local: node.local + }; + } + return stack.push(obj); + }; + })(this); + this.saxParser.onclosetag = (function(_this) { + return function() { + var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath; + obj = stack.pop(); + nodeName = obj["#name"]; + if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) { + delete obj["#name"]; + } + if (obj.cdata === true) { + cdata = obj.cdata; + delete obj.cdata; + } + s = stack[stack.length - 1]; + if (obj[charkey].match(/^\s*$/) && !cdata) { + emptyStr = obj[charkey]; + delete obj[charkey]; + } else { + if (_this.options.trim) { + obj[charkey] = obj[charkey].trim(); + } + if (_this.options.normalize) { + obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim(); + } + obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey]; + if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { + obj = obj[charkey]; + } + } + if (isEmpty(obj)) { + if (typeof _this.options.emptyTag === 'function') { + obj = _this.options.emptyTag(); + } else { + obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr; + } + } + if (_this.options.validator != null) { + xpath = "/" + ((function() { + var i, len, results; + results = []; + for (i = 0, len = stack.length; i < len; i++) { + node = stack[i]; + results.push(node["#name"]); + } + return results; + })()).concat(nodeName).join("/"); + (function() { + var err; + try { + return obj = _this.options.validator(xpath, s && s[nodeName], obj); + } catch (error1) { + err = error1; + return _this.emit("error", err); + } + })(); + } + if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') { + if (!_this.options.preserveChildrenOrder) { + node = {}; + if (_this.options.attrkey in obj) { + node[_this.options.attrkey] = obj[_this.options.attrkey]; + delete obj[_this.options.attrkey]; + } + if (!_this.options.charsAsChildren && _this.options.charkey in obj) { + node[_this.options.charkey] = obj[_this.options.charkey]; + delete obj[_this.options.charkey]; + } + if (Object.getOwnPropertyNames(obj).length > 0) { + node[_this.options.childkey] = obj; + } + obj = node; + } else if (s) { + s[_this.options.childkey] = s[_this.options.childkey] || []; + objClone = {}; + for (key in obj) { + if (!hasProp.call(obj, key)) continue; + defineProperty(objClone, key, obj[key]); + } + s[_this.options.childkey].push(objClone); + delete obj["#name"]; + if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) { + obj = obj[charkey]; + } + } + } + if (stack.length > 0) { + return _this.assignOrPush(s, nodeName, obj); + } else { + if (_this.options.explicitRoot) { + old = obj; + obj = {}; + defineProperty(obj, nodeName, old); + } + _this.resultObject = obj; + _this.saxParser.ended = true; + return _this.emit("end", _this.resultObject); + } + }; + })(this); + ontext = (function(_this) { + return function(text) { + var charChild, s; + s = stack[stack.length - 1]; + if (s) { + s[charkey] += text; + if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) { + s[_this.options.childkey] = s[_this.options.childkey] || []; + charChild = { + '#name': '__text__' + }; + charChild[charkey] = text; + if (_this.options.normalize) { + charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim(); + } + s[_this.options.childkey].push(charChild); + } + return s; + } + }; + })(this); + this.saxParser.ontext = ontext; + return this.saxParser.oncdata = (function(_this) { + return function(text) { + var s; + s = ontext(text); + if (s) { + return s.cdata = true; + } + }; + })(this); + }; + + Parser.prototype.parseString = function(str, cb) { + var err; + if ((cb != null) && typeof cb === "function") { + this.on("end", function(result) { + this.reset(); + return cb(null, result); + }); + this.on("error", function(err) { + this.reset(); + return cb(err); + }); + } + try { + str = str.toString(); + if (str.trim() === '') { + this.emit("end", null); + return true; + } + str = bom.stripBOM(str); + if (this.options.async) { + this.remaining = str; + setImmediate(this.processAsync); + return this.saxParser; + } + return this.saxParser.write(str).close(); + } catch (error1) { + err = error1; + if (!(this.saxParser.errThrown || this.saxParser.ended)) { + this.emit('error', err); + return this.saxParser.errThrown = true; + } else if (this.saxParser.ended) { + throw err; + } + } + }; + + Parser.prototype.parseStringPromise = function(str) { + return new Promise((function(_this) { + return function(resolve, reject) { + return _this.parseString(str, function(err, value) { + if (err) { + return reject(err); + } else { + return resolve(value); + } + }); + }; + })(this)); + }; + + return Parser; + + })(events); + + exports.parseString = function(str, a, b) { + var cb, options, parser; + if (b != null) { + if (typeof b === 'function') { + cb = b; + } + if (typeof a === 'object') { + options = a; + } + } else { + if (typeof a === 'function') { + cb = a; + } + options = {}; + } + parser = new exports.Parser(options); + return parser.parseString(str, cb); + }; + + exports.parseStringPromise = function(str, a) { + var options, parser; + if (typeof a === 'object') { + options = a; + } + parser = new exports.Parser(options); + return parser.parseStringPromise(str); + }; + +}).call(this); diff --git a/node_modules/xml2js/lib/processors.js b/node_modules/xml2js/lib/processors.js new file mode 100644 index 0000000..89aa85f --- /dev/null +++ b/node_modules/xml2js/lib/processors.js @@ -0,0 +1,34 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + "use strict"; + var prefixMatch; + + prefixMatch = new RegExp(/(?!xmlns)^.*:/); + + exports.normalize = function(str) { + return str.toLowerCase(); + }; + + exports.firstCharLowerCase = function(str) { + return str.charAt(0).toLowerCase() + str.slice(1); + }; + + exports.stripPrefix = function(str) { + return str.replace(prefixMatch, ''); + }; + + exports.parseNumbers = function(str) { + if (!isNaN(str)) { + str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str); + } + return str; + }; + + exports.parseBooleans = function(str) { + if (/^(?:true|false)$/i.test(str)) { + str = str.toLowerCase() === 'true'; + } + return str; + }; + +}).call(this); diff --git a/node_modules/xml2js/lib/xml2js.bc.js b/node_modules/xml2js/lib/xml2js.bc.js new file mode 100644 index 0000000..a6924ff --- /dev/null +++ b/node_modules/xml2js/lib/xml2js.bc.js @@ -0,0 +1,28337 @@ +//# 1 ".xml2js.eobjs/jsoo/xml2js.bc.runtime.js" +// Generated by js_of_ocaml +//# buildInfo:effects=false, kind=unknown, use-js-string=true, version=5.2.0+git-0e29f0e-dirty +//# 3 ".xml2js.eobjs/jsoo/xml2js.bc.runtime.js" + +//# 7 ".xml2js.eobjs/jsoo/xml2js.bc.runtime.js" +(function + (Object){ + typeof globalThis !== "object" + && + (this + ? get() + : (Object.defineProperty + (Object.prototype, "_T_", {configurable: true, get: get}), + _T_)); + function get(){ + var global = this || self; + global.globalThis = global; + delete Object.prototype._T_; + } + } + (Object)); +(function(globalThis){ + "use strict"; + function caml_int64_is_zero(x){return + x.isZero();} + function caml_str_repeat(n, s){ + if(n == 0) return ""; + if(s.repeat) return s.repeat(n); + var r = "", l = 0; + for(;;){ + if(n & 1) r += s; + n >>= 1; + if(n == 0) return r; + s += s; + l++; + if(l == 9) s.slice(0, 1); + } + } + var caml_int64_offset = Math.pow(2, - 24); + function caml_raise_constant(tag){throw tag;} + var caml_global_data = [0]; + function caml_raise_zero_divide(){ + caml_raise_constant(caml_global_data.Division_by_zero); + } + function MlInt64(lo, mi, hi){ + this.lo = lo & 0xffffff; + this.mi = mi & 0xffffff; + this.hi = hi & 0xffff; + } + MlInt64.prototype.caml_custom = "_j"; + MlInt64.prototype.copy = + function(){return new MlInt64(this.lo, this.mi, this.hi);}; + MlInt64.prototype.ucompare = + function(x){ + if(this.hi > x.hi) return 1; + if(this.hi < x.hi) return - 1; + if(this.mi > x.mi) return 1; + if(this.mi < x.mi) return - 1; + if(this.lo > x.lo) return 1; + if(this.lo < x.lo) return - 1; + return 0; + }; + MlInt64.prototype.compare = + function(x){ + var hi = this.hi << 16, xhi = x.hi << 16; + if(hi > xhi) return 1; + if(hi < xhi) return - 1; + if(this.mi > x.mi) return 1; + if(this.mi < x.mi) return - 1; + if(this.lo > x.lo) return 1; + if(this.lo < x.lo) return - 1; + return 0; + }; + MlInt64.prototype.neg = + function(){ + var + lo = - this.lo, + mi = - this.mi + (lo >> 24), + hi = - this.hi + (mi >> 24); + return new MlInt64(lo, mi, hi); + }; + MlInt64.prototype.add = + function(x){ + var + lo = this.lo + x.lo, + mi = this.mi + x.mi + (lo >> 24), + hi = this.hi + x.hi + (mi >> 24); + return new MlInt64(lo, mi, hi); + }; + MlInt64.prototype.sub = + function(x){ + var + lo = this.lo - x.lo, + mi = this.mi - x.mi + (lo >> 24), + hi = this.hi - x.hi + (mi >> 24); + return new MlInt64(lo, mi, hi); + }; + MlInt64.prototype.mul = + function(x){ + var + lo = this.lo * x.lo, + mi = (lo * caml_int64_offset | 0) + this.mi * x.lo + this.lo * x.mi, + hi = + (mi * caml_int64_offset | 0) + this.hi * x.lo + this.mi * x.mi + + this.lo * x.hi; + return new MlInt64(lo, mi, hi); + }; + MlInt64.prototype.isZero = + function(){return (this.lo | this.mi | this.hi) == 0;}; + MlInt64.prototype.isNeg = function(){return this.hi << 16 < 0;}; + MlInt64.prototype.and = + function(x){ + return new MlInt64(this.lo & x.lo, this.mi & x.mi, this.hi & x.hi); + }; + MlInt64.prototype.or = + function(x){ + return new MlInt64(this.lo | x.lo, this.mi | x.mi, this.hi | x.hi); + }; + MlInt64.prototype.xor = + function(x){ + return new MlInt64(this.lo ^ x.lo, this.mi ^ x.mi, this.hi ^ x.hi); + }; + MlInt64.prototype.shift_left = + function(s){ + s = s & 63; + if(s == 0) return this; + if(s < 24) + return new + MlInt64 + (this.lo << s, + this.mi << s | this.lo >> 24 - s, + this.hi << s | this.mi >> 24 - s); + if(s < 48) + return new + MlInt64 + (0, this.lo << s - 24, this.mi << s - 24 | this.lo >> 48 - s); + return new MlInt64(0, 0, this.lo << s - 48); + }; + MlInt64.prototype.shift_right_unsigned = + function(s){ + s = s & 63; + if(s == 0) return this; + if(s < 24) + return new + MlInt64 + (this.lo >> s | this.mi << 24 - s, + this.mi >> s | this.hi << 24 - s, + this.hi >> s); + if(s < 48) + return new + MlInt64 + (this.mi >> s - 24 | this.hi << 48 - s, this.hi >> s - 24, 0); + return new MlInt64(this.hi >> s - 48, 0, 0); + }; + MlInt64.prototype.shift_right = + function(s){ + s = s & 63; + if(s == 0) return this; + var h = this.hi << 16 >> 16; + if(s < 24) + return new + MlInt64 + (this.lo >> s | this.mi << 24 - s, + this.mi >> s | h << 24 - s, + this.hi << 16 >> s >>> 16); + var sign = this.hi << 16 >> 31; + if(s < 48) + return new + MlInt64 + (this.mi >> s - 24 | this.hi << 48 - s, + this.hi << 16 >> s - 24 >> 16, + sign & 0xffff); + return new MlInt64(this.hi << 16 >> s - 32, sign, sign); + }; + MlInt64.prototype.lsl1 = + function(){ + this.hi = this.hi << 1 | this.mi >> 23; + this.mi = (this.mi << 1 | this.lo >> 23) & 0xffffff; + this.lo = this.lo << 1 & 0xffffff; + }; + MlInt64.prototype.lsr1 = + function(){ + this.lo = (this.lo >>> 1 | this.mi << 23) & 0xffffff; + this.mi = (this.mi >>> 1 | this.hi << 23) & 0xffffff; + this.hi = this.hi >>> 1; + }; + MlInt64.prototype.udivmod = + function(x){ + var + offset = 0, + modulus = this.copy(), + divisor = x.copy(), + quotient = new MlInt64(0, 0, 0); + while(modulus.ucompare(divisor) > 0){offset++; divisor.lsl1();} + while(offset >= 0){ + offset--; + quotient.lsl1(); + if(modulus.ucompare(divisor) >= 0){ + quotient.lo++; + modulus = modulus.sub(divisor); + } + divisor.lsr1(); + } + return {quotient: quotient, modulus: modulus}; + }; + MlInt64.prototype.div = + function(y){ + var x = this; + if(y.isZero()) caml_raise_zero_divide(); + var sign = x.hi ^ y.hi; + if(x.hi & 0x8000) x = x.neg(); + if(y.hi & 0x8000) y = y.neg(); + var q = x.udivmod(y).quotient; + if(sign & 0x8000) q = q.neg(); + return q; + }; + MlInt64.prototype.mod = + function(y){ + var x = this; + if(y.isZero()) caml_raise_zero_divide(); + var sign = x.hi; + if(x.hi & 0x8000) x = x.neg(); + if(y.hi & 0x8000) y = y.neg(); + var r = x.udivmod(y).modulus; + if(sign & 0x8000) r = r.neg(); + return r; + }; + MlInt64.prototype.toInt = function(){return this.lo | this.mi << 24;}; + MlInt64.prototype.toFloat = + function(){ + return (this.hi << 16) * Math.pow(2, 32) + this.mi * Math.pow(2, 24) + + this.lo; + }; + MlInt64.prototype.toArray = + function(){ + return [this.hi >> 8, + this.hi & 0xff, + this.mi >> 16, + this.mi >> 8 & 0xff, + this.mi & 0xff, + this.lo >> 16, + this.lo >> 8 & 0xff, + this.lo & 0xff]; + }; + MlInt64.prototype.lo32 = + function(){return this.lo | (this.mi & 0xff) << 24;}; + MlInt64.prototype.hi32 = + function(){return this.mi >>> 8 & 0xffff | this.hi << 16;}; + function caml_int64_of_int32(x){ + return new MlInt64(x & 0xffffff, x >> 24 & 0xffffff, x >> 31 & 0xffff); + } + function caml_int64_to_int32(x){return x.toInt();} + function caml_int64_is_negative(x){return + x.isNeg();} + function caml_int64_neg(x){return x.neg();} + function caml_jsbytes_of_string(x){return x;} + function jsoo_sys_getenv(n){ + var process = globalThis.process; + if(process && process.env && process.env[n] != undefined) + return process.env[n]; + if(globalThis.jsoo_static_env && globalThis.jsoo_static_env[n]) + return globalThis.jsoo_static_env[n]; + } + var caml_record_backtrace_flag = 0; + (function(){ + var r = jsoo_sys_getenv("OCAMLRUNPARAM"); + if(r !== undefined){ + var l = r.split(","); + for(var i = 0; i < l.length; i++) + if(l[i] == "b"){ + caml_record_backtrace_flag = 1; + break; + } + else if(l[i].startsWith("b=")) + caml_record_backtrace_flag = + l[i].slice(2); + else + continue; + } + } + ()); + function caml_exn_with_js_backtrace(exn, force){ + if(! exn.js_error || force || exn[0] == 248) + exn.js_error = new globalThis.Error("Js exception containing backtrace"); + return exn; + } + function caml_maybe_attach_backtrace(exn, force){ + return caml_record_backtrace_flag + ? caml_exn_with_js_backtrace(exn, force) + : exn; + } + function caml_raise_with_arg(tag, arg){ + throw caml_maybe_attach_backtrace([0, tag, arg]); + } + function caml_string_of_jsbytes(x){return x;} + function caml_raise_with_string(tag, msg){ + caml_raise_with_arg(tag, caml_string_of_jsbytes(msg)); + } + function caml_invalid_argument(msg){ + caml_raise_with_string(caml_global_data.Invalid_argument, msg); + } + function caml_parse_format(fmt){ + fmt = caml_jsbytes_of_string(fmt); + var len = fmt.length; + if(len > 31) caml_invalid_argument("format_int: format too long"); + var + f = + {justify: "+", + signstyle: "-", + filler: " ", + alternate: false, + base: 0, + signedconv: false, + width: 0, + uppercase: false, + sign: 1, + prec: - 1, + conv: "f"}; + for(var i = 0; i < len; i++){ + var c = fmt.charAt(i); + switch(c){ + case "-": + f.justify = "-"; break; + case "+": + case " ": + f.signstyle = c; break; + case "0": + f.filler = "0"; break; + case "#": + f.alternate = true; break; + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + f.width = 0; + while(c = fmt.charCodeAt(i) - 48, c >= 0 && c <= 9){f.width = f.width * 10 + c; i++;} + i--; + break; + case ".": + f.prec = 0; + i++; + while(c = fmt.charCodeAt(i) - 48, c >= 0 && c <= 9){f.prec = f.prec * 10 + c; i++;} + i--; + case "d": + case "i": + f.signedconv = true; + case "u": + f.base = 10; break; + case "x": + f.base = 16; break; + case "X": + f.base = 16; f.uppercase = true; break; + case "o": + f.base = 8; break; + case "e": + case "f": + case "g": + f.signedconv = true; f.conv = c; break; + case "E": + case "F": + case "G": + f.signedconv = true; + f.uppercase = true; + f.conv = c.toLowerCase(); + break; + } + } + return f; + } + function caml_finish_formatting(f, rawbuffer){ + if(f.uppercase) rawbuffer = rawbuffer.toUpperCase(); + var len = rawbuffer.length; + if(f.signedconv && (f.sign < 0 || f.signstyle != "-")) len++; + if(f.alternate){if(f.base == 8) len += 1; if(f.base == 16) len += 2;} + var buffer = ""; + if(f.justify == "+" && f.filler == " ") + for(var i = len; i < f.width; i++) buffer += " "; + if(f.signedconv) + if(f.sign < 0) + buffer += "-"; + else if(f.signstyle != "-") buffer += f.signstyle; + if(f.alternate && f.base == 8) buffer += "0"; + if(f.alternate && f.base == 16) buffer += f.uppercase ? "0X" : "0x"; + if(f.justify == "+" && f.filler == "0") + for(var i = len; i < f.width; i++) buffer += "0"; + buffer += rawbuffer; + if(f.justify == "-") for(var i = len; i < f.width; i++) buffer += " "; + return caml_string_of_jsbytes(buffer); + } + function caml_int64_format(fmt, x){ + var f = caml_parse_format(fmt); + if(f.signedconv && caml_int64_is_negative(x)){f.sign = - 1; x = caml_int64_neg(x);} + var + buffer = "", + wbase = caml_int64_of_int32(f.base), + cvtbl = "0123456789abcdef"; + do{ + var p = x.udivmod(wbase); + x = p.quotient; + buffer = cvtbl.charAt(caml_int64_to_int32(p.modulus)) + buffer; + } + while + (! caml_int64_is_zero(x)); + if(f.prec >= 0){ + f.filler = " "; + var n = f.prec - buffer.length; + if(n > 0) buffer = caml_str_repeat(n, "0") + buffer; + } + return caml_finish_formatting(f, buffer); + } + function caml_expm1_float(x){return Math.expm1(x);} + function caml_ml_condition_broadcast(t){return 0;} + function jsoo_is_ascii(s){ + if(s.length < 24){ + for(var i = 0; i < s.length; i++) if(s.charCodeAt(i) > 127) return false; + return true; + } + else + return ! /[^\x00-\x7f]/.test(s); + } + function caml_utf16_of_utf8(s){ + for(var b = "", t = "", c, c1, c2, v, i = 0, l = s.length; i < l; i++){ + c1 = s.charCodeAt(i); + if(c1 < 0x80){ + for(var j = i + 1; j < l && (c1 = s.charCodeAt(j)) < 0x80; j++) ; + if(j - i > 512){ + t.substr(0, 1); + b += t; + t = ""; + b += s.slice(i, j); + } + else + t += s.slice(i, j); + if(j == l) break; + i = j; + } + v = 1; + if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128){ + c = c2 + (c1 << 6); + if(c1 < 0xe0){ + v = c - 0x3080; + if(v < 0x80) v = 1; + } + else{ + v = 2; + if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128){ + c = c2 + (c << 6); + if(c1 < 0xf0){ + v = c - 0xe2080; + if(v < 0x800 || v >= 0xd7ff && v < 0xe000) v = 2; + } + else{ + v = 3; + if(++i < l && ((c2 = s.charCodeAt(i)) & - 64) == 128 && c1 < 0xf5){ + v = c2 - 0x3c82080 + (c << 6); + if(v < 0x10000 || v > 0x10ffff) v = 3; + } + } + } + } + } + if(v < 4){ + i -= v; + t += "\ufffd"; + } + else if(v > 0xffff) + t += String.fromCharCode(0xd7c0 + (v >> 10), 0xdc00 + (v & 0x3FF)); + else + t += String.fromCharCode(v); + if(t.length > 1024){t.substr(0, 1); b += t; t = "";} + } + return b + t; + } + function caml_jsstring_of_string(s){ + if(jsoo_is_ascii(s)) return s; + return caml_utf16_of_utf8(s); + } + function fs_node_supported(){ + return typeof globalThis.process !== "undefined" + && typeof globalThis.process.versions !== "undefined" + && typeof globalThis.process.versions.node !== "undefined"; + } + function make_path_is_absolute(){ + function posix(path){ + if(path.charAt(0) === "/") return ["", path.substring(1)]; + return; + } + function win32(path){ + var + splitDeviceRe = + /^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/, + result = splitDeviceRe.exec(path), + device = result[1] || "", + isUnc = Boolean(device && device.charAt(1) !== ":"); + if(Boolean(result[2] || isUnc)){ + var root = result[1] || "", sep = result[2] || ""; + return [root, path.substring(root.length + sep.length)]; + } + return; + } + return fs_node_supported() && globalThis.process + && globalThis.process.platform + ? globalThis.process.platform === "win32" ? win32 : posix + : posix; + } + var path_is_absolute = make_path_is_absolute(); + function caml_trailing_slash(name){ + return name.slice(- 1) !== "/" ? name + "/" : name; + } + if(fs_node_supported() && globalThis.process && globalThis.process.cwd) + var caml_current_dir = globalThis.process.cwd().replace(/\\/g, "/"); + else + var caml_current_dir = "/static"; + caml_current_dir = caml_trailing_slash(caml_current_dir); + function caml_make_path(name){ + name = caml_jsstring_of_string(name); + if(! path_is_absolute(name)) name = caml_current_dir + name; + var + comp0 = path_is_absolute(name), + comp = comp0[1].split("/"), + ncomp = []; + for(var i = 0; i < comp.length; i++) + switch(comp[i]){ + case "..": + if(ncomp.length > 1) ncomp.pop(); break; + case ".": break; + case "": break; + default: ncomp.push(comp[i]); break; + } + ncomp.unshift(comp0[0]); + ncomp.orig = name; + return ncomp; + } + function caml_utf8_of_utf16(s){ + for(var b = "", t = b, c, d, i = 0, l = s.length; i < l; i++){ + c = s.charCodeAt(i); + if(c < 0x80){ + for(var j = i + 1; j < l && (c = s.charCodeAt(j)) < 0x80; j++) ; + if(j - i > 512){ + t.substr(0, 1); + b += t; + t = ""; + b += s.slice(i, j); + } + else + t += s.slice(i, j); + if(j == l) break; + i = j; + } + if(c < 0x800){ + t += String.fromCharCode(0xc0 | c >> 6); + t += String.fromCharCode(0x80 | c & 0x3f); + } + else if(c < 0xd800 || c >= 0xdfff) + t += + String.fromCharCode + (0xe0 | c >> 12, 0x80 | c >> 6 & 0x3f, 0x80 | c & 0x3f); + else if + (c >= 0xdbff || i + 1 == l || (d = s.charCodeAt(i + 1)) < 0xdc00 + || d > 0xdfff) + t += "\xef\xbf\xbd"; + else{ + i++; + c = (c << 10) + d - 0x35fdc00; + t += + String.fromCharCode + (0xf0 | c >> 18, + 0x80 | c >> 12 & 0x3f, + 0x80 | c >> 6 & 0x3f, + 0x80 | c & 0x3f); + } + if(t.length > 1024){t.substr(0, 1); b += t; t = "";} + } + return b + t; + } + function caml_string_of_jsstring(s){ + return jsoo_is_ascii(s) + ? caml_string_of_jsbytes(s) + : caml_string_of_jsbytes(caml_utf8_of_utf16(s)); + } + var + unix_error = + ["E2BIG", + "EACCES", + "EAGAIN", + "EBADF", + "EBUSY", + "ECHILD", + "EDEADLK", + "EDOM", + "EEXIST", + "EFAULT", + "EFBIG", + "EINTR", + "EINVAL", + "EIO", + "EISDIR", + "EMFILE", + "EMLINK", + "ENAMETOOLONG", + "ENFILE", + "ENODEV", + "ENOENT", + "ENOEXEC", + "ENOLCK", + "ENOMEM", + "ENOSPC", + "ENOSYS", + "ENOTDIR", + "ENOTEMPTY", + "ENOTTY", + "ENXIO", + "EPERM", + "EPIPE", + "ERANGE", + "EROFS", + "ESPIPE", + "ESRCH", + "EXDEV", + "EWOULDBLOCK", + "EINPROGRESS", + "EALREADY", + "ENOTSOCK", + "EDESTADDRREQ", + "EMSGSIZE", + "EPROTOTYPE", + "ENOPROTOOPT", + "EPROTONOSUPPORT", + "ESOCKTNOSUPPORT", + "EOPNOTSUPP", + "EPFNOSUPPORT", + "EAFNOSUPPORT", + "EADDRINUSE", + "EADDRNOTAVAIL", + "ENETDOWN", + "ENETUNREACH", + "ENETRESET", + "ECONNABORTED", + "ECONNRESET", + "ENOBUFS", + "EISCONN", + "ENOTCONN", + "ESHUTDOWN", + "ETOOMANYREFS", + "ETIMEDOUT", + "ECONNREFUSED", + "EHOSTDOWN", + "EHOSTUNREACH", + "ELOOP", + "EOVERFLOW"]; + function make_unix_err_args(code, syscall, path, errno){ + var variant = unix_error.indexOf(code); + if(variant < 0){if(errno == null) errno = - 9999; variant = [0, errno];} + var + args = + [variant, + caml_string_of_jsstring(syscall || ""), + caml_string_of_jsstring(path || "")]; + return args; + } + var caml_named_values = {}; + function caml_named_value(nm){return caml_named_values[nm];} + function caml_raise_with_args(tag, args){ + throw caml_maybe_attach_backtrace([0, tag].concat(args)); + } + function caml_subarray_to_jsbytes(a, i, len){ + var f = String.fromCharCode; + if(i == 0 && len <= 4096 && len == a.length) return f.apply(null, a); + var s = ""; + for(; 0 < len; i += 1024, len -= 1024) + s += f.apply(null, a.slice(i, i + Math.min(len, 1024))); + return s; + } + function caml_convert_string_to_bytes(s){ + if(s.t == 2) + s.c += caml_str_repeat(s.l - s.c.length, "\0"); + else + s.c = caml_subarray_to_jsbytes(s.c, 0, s.c.length); + s.t = 0; + } + function MlBytes(tag, contents, length){ + this.t = tag; + this.c = contents; + this.l = length; + } + MlBytes.prototype.toString = + function(){ + switch(this.t){ + case 9: + return this.c; + default: caml_convert_string_to_bytes(this); + case 0: + if(jsoo_is_ascii(this.c)){this.t = 9; return this.c;} this.t = 8; + case 8: + return this.c; + } + }; + MlBytes.prototype.toUtf16 = + function(){ + var r = this.toString(); + if(this.t == 9) return r; + return caml_utf16_of_utf8(r); + }; + MlBytes.prototype.slice = + function(){ + var content = this.t == 4 ? this.c.slice() : this.c; + return new MlBytes(this.t, content, this.l); + }; + function caml_is_ml_bytes(s){return s instanceof MlBytes;} + function caml_is_ml_string(s){ + return typeof s === "string" && ! /[^\x00-\xff]/.test(s); + } + function caml_bytes_of_array(a){ + if(! (a instanceof Uint8Array)) a = new Uint8Array(a); + return new MlBytes(4, a, a.length); + } + function caml_bytes_of_jsbytes(s){return new MlBytes(0, s, s.length);} + function caml_bytes_of_string(s){ + return caml_bytes_of_jsbytes(caml_jsbytes_of_string(s)); + } + function caml_raise_sys_error(msg){ + caml_raise_with_string(caml_global_data.Sys_error, msg); + } + function caml_raise_no_such_file(name){ + caml_raise_sys_error(name + ": No such file or directory"); + } + function caml_convert_bytes_to_array(s){ + var a = new Uint8Array(s.l), b = s.c, l = b.length, i = 0; + for(; i < l; i++) a[i] = b.charCodeAt(i); + for(l = s.l; i < l; i++) a[i] = 0; + s.c = a; + s.t = 4; + return a; + } + function caml_uint8_array_of_bytes(s){ + if(s.t != 4) caml_convert_bytes_to_array(s); + return s.c; + } + function caml_create_bytes(len){ + if(len < 0) caml_invalid_argument("Bytes.create"); + return new MlBytes(len ? 2 : 9, "", len); + } + function caml_ml_bytes_length(s){return s.l;} + function caml_blit_bytes(s1, i1, s2, i2, len){ + if(len == 0) return 0; + if(i2 == 0 && (len >= s2.l || s2.t == 2 && len >= s2.c.length)){ + s2.c = + s1.t == 4 + ? caml_subarray_to_jsbytes(s1.c, i1, len) + : i1 == 0 && s1.c.length == len ? s1.c : s1.c.substr(i1, len); + s2.t = s2.c.length == s2.l ? 0 : 2; + } + else if(s2.t == 2 && i2 == s2.c.length){ + s2.c += + s1.t == 4 + ? caml_subarray_to_jsbytes(s1.c, i1, len) + : i1 == 0 && s1.c.length == len ? s1.c : s1.c.substr(i1, len); + s2.t = s2.c.length == s2.l ? 0 : 2; + } + else{ + if(s2.t != 4) caml_convert_bytes_to_array(s2); + var c1 = s1.c, c2 = s2.c; + if(s1.t == 4) + if(i2 <= i1) + for(var i = 0; i < len; i++) c2[i2 + i] = c1[i1 + i]; + else + for(var i = len - 1; i >= 0; i--) c2[i2 + i] = c1[i1 + i]; + else{ + var l = Math.min(len, c1.length - i1); + for(var i = 0; i < l; i++) c2[i2 + i] = c1.charCodeAt(i1 + i); + for(; i < len; i++) c2[i2 + i] = 0; + } + } + return 0; + } + function MlFile(){} + function MlFakeFile(content){this.data = content;} + MlFakeFile.prototype = new MlFile(); + MlFakeFile.prototype.constructor = MlFakeFile; + MlFakeFile.prototype.truncate = + function(len){ + var old = this.data; + this.data = caml_create_bytes(len | 0); + caml_blit_bytes(old, 0, this.data, 0, len); + }; + MlFakeFile.prototype.length = + function(){return caml_ml_bytes_length(this.data);}; + MlFakeFile.prototype.write = + function(offset, buf, pos, len){ + var clen = this.length(); + if(offset + len >= clen){ + var new_str = caml_create_bytes(offset + len), old_data = this.data; + this.data = new_str; + caml_blit_bytes(old_data, 0, this.data, 0, clen); + } + caml_blit_bytes(caml_bytes_of_array(buf), pos, this.data, offset, len); + return 0; + }; + MlFakeFile.prototype.read = + function(offset, buf, pos, len){ + var clen = this.length(); + if(offset + len >= clen) len = clen - offset; + if(len){ + var data = caml_create_bytes(len | 0); + caml_blit_bytes(this.data, offset, data, 0, len); + buf.set(caml_uint8_array_of_bytes(data), pos); + } + return len; + }; + function MlFakeFd(name, file, flags){ + this.file = file; + this.name = name; + this.flags = flags; + } + MlFakeFd.prototype.err_closed = + function(){ + caml_raise_sys_error(this.name + ": file descriptor already closed"); + }; + MlFakeFd.prototype.length = + function(){if(this.file) return this.file.length(); this.err_closed();}; + MlFakeFd.prototype.write = + function(offset, buf, pos, len){ + if(this.file) return this.file.write(offset, buf, pos, len); + this.err_closed(); + }; + MlFakeFd.prototype.read = + function(offset, buf, pos, len){ + if(this.file) return this.file.read(offset, buf, pos, len); + this.err_closed(); + }; + MlFakeFd.prototype.close = function(){this.file = undefined;}; + function MlFakeDevice(root, f){ + this.content = {}; + this.root = root; + this.lookupFun = f; + } + MlFakeDevice.prototype.nm = function(name){return this.root + name;}; + MlFakeDevice.prototype.create_dir_if_needed = + function(name){ + var comp = name.split("/"), res = ""; + for(var i = 0; i < comp.length - 1; i++){ + res += comp[i] + "/"; + if(this.content[res]) continue; + this.content[res] = Symbol("directory"); + } + }; + MlFakeDevice.prototype.slash = + function(name){return /\/$/.test(name) ? name : name + "/";}; + MlFakeDevice.prototype.lookup = + function(name){ + if(! this.content[name] && this.lookupFun){ + var + res = + this.lookupFun + (caml_string_of_jsbytes(this.root), caml_string_of_jsbytes(name)); + if(res !== 0){ + this.create_dir_if_needed(name); + this.content[name] = new MlFakeFile(caml_bytes_of_string(res[1])); + } + } + }; + MlFakeDevice.prototype.exists = + function(name){ + if(name == "") return 1; + var name_slash = this.slash(name); + if(this.content[name_slash]) return 1; + this.lookup(name); + return this.content[name] ? 1 : 0; + }; + MlFakeDevice.prototype.isFile = + function(name){return this.exists(name) && ! this.is_dir(name) ? 1 : 0;}; + MlFakeDevice.prototype.mkdir = + function(name, mode, raise_unix){ + var unix_error = raise_unix && caml_named_value("Unix.Unix_error"); + if(this.exists(name)) + if(unix_error) + caml_raise_with_args + (unix_error, make_unix_err_args("EEXIST", "mkdir", this.nm(name))); + else + caml_raise_sys_error(name + ": File exists"); + var parent = /^(.*)\/[^/]+/.exec(name); + parent = parent && parent[1] || ""; + if(! this.exists(parent)) + if(unix_error) + caml_raise_with_args + (unix_error, make_unix_err_args("ENOENT", "mkdir", this.nm(parent))); + else + caml_raise_sys_error(parent + ": No such file or directory"); + if(! this.is_dir(parent)) + if(unix_error) + caml_raise_with_args + (unix_error, make_unix_err_args("ENOTDIR", "mkdir", this.nm(parent))); + else + caml_raise_sys_error(parent + ": Not a directory"); + this.create_dir_if_needed(this.slash(name)); + }; + MlFakeDevice.prototype.rmdir = + function(name, raise_unix){ + var + unix_error = raise_unix && caml_named_value("Unix.Unix_error"), + name_slash = name == "" ? "" : this.slash(name), + r = new RegExp("^" + name_slash + "([^/]+)"); + if(! this.exists(name)) + if(unix_error) + caml_raise_with_args + (unix_error, make_unix_err_args("ENOENT", "rmdir", this.nm(name))); + else + caml_raise_sys_error(name + ": No such file or directory"); + if(! this.is_dir(name)) + if(unix_error) + caml_raise_with_args + (unix_error, make_unix_err_args("ENOTDIR", "rmdir", this.nm(name))); + else + caml_raise_sys_error(name + ": Not a directory"); + for(var n in this.content) + if(n.match(r)) + if(unix_error) + caml_raise_with_args + (unix_error, make_unix_err_args("ENOTEMPTY", "rmdir", this.nm(name))); + else + caml_raise_sys_error(this.nm(name) + ": Directory not empty"); + delete this.content[name_slash]; + }; + MlFakeDevice.prototype.readdir = + function(name){ + var name_slash = name == "" ? "" : this.slash(name); + if(! this.exists(name)) + caml_raise_sys_error(name + ": No such file or directory"); + if(! this.is_dir(name)) caml_raise_sys_error(name + ": Not a directory"); + var r = new RegExp("^" + name_slash + "([^/]+)"), seen = {}, a = []; + for(var n in this.content){ + var m = n.match(r); + if(m && ! seen[m[1]]){seen[m[1]] = true; a.push(m[1]);} + } + return a; + }; + MlFakeDevice.prototype.opendir = + function(name, raise_unix){ + var + unix_error = raise_unix && caml_named_value("Unix.Unix_error"), + a = this.readdir(name), + c = false, + i = 0; + return {readSync: + function(){ + if(c) + if(unix_error) + caml_raise_with_args + (unix_error, + make_unix_err_args("EBADF", "closedir", this.nm(name))); + else + caml_raise_sys_error(name + ": closedir failed"); + if(i == a.length) return null; + var entry = a[i]; + i++; + return {name: entry}; + }, + closeSync: + function(){ + if(c) + if(unix_error) + caml_raise_with_args + (unix_error, + make_unix_err_args("EBADF", "closedir", this.nm(name))); + else + caml_raise_sys_error(name + ": closedir failed"); + c = true; + a = []; + }}; + }; + MlFakeDevice.prototype.is_dir = + function(name){ + if(name == "") return true; + var name_slash = this.slash(name); + return this.content[name_slash] ? 1 : 0; + }; + MlFakeDevice.prototype.unlink = + function(name){ + var ok = this.content[name] ? true : false; + delete this.content[name]; + return ok; + }; + MlFakeDevice.prototype.open = + function(name, f){ + var file; + if(f.rdonly && f.wronly) + caml_raise_sys_error + (this.nm(name) + + " : flags Open_rdonly and Open_wronly are not compatible"); + if(f.text && f.binary) + caml_raise_sys_error + (this.nm(name) + + " : flags Open_text and Open_binary are not compatible"); + this.lookup(name); + if(this.content[name]){ + if(this.is_dir(name)) + caml_raise_sys_error(this.nm(name) + " : is a directory"); + if(f.create && f.excl) + caml_raise_sys_error(this.nm(name) + " : file already exists"); + file = this.content[name]; + if(f.truncate) file.truncate(); + } + else if(f.create){ + this.create_dir_if_needed(name); + this.content[name] = new MlFakeFile(caml_create_bytes(0)); + file = this.content[name]; + } + else + caml_raise_no_such_file(this.nm(name)); + return new MlFakeFd(this.nm(name), file, f); + }; + MlFakeDevice.prototype.open = + function(name, f){ + var file; + if(f.rdonly && f.wronly) + caml_raise_sys_error + (this.nm(name) + + " : flags Open_rdonly and Open_wronly are not compatible"); + if(f.text && f.binary) + caml_raise_sys_error + (this.nm(name) + + " : flags Open_text and Open_binary are not compatible"); + this.lookup(name); + if(this.content[name]){ + if(this.is_dir(name)) + caml_raise_sys_error(this.nm(name) + " : is a directory"); + if(f.create && f.excl) + caml_raise_sys_error(this.nm(name) + " : file already exists"); + file = this.content[name]; + if(f.truncate) file.truncate(); + } + else if(f.create){ + this.create_dir_if_needed(name); + this.content[name] = new MlFakeFile(caml_create_bytes(0)); + file = this.content[name]; + } + else + caml_raise_no_such_file(this.nm(name)); + return new MlFakeFd(this.nm(name), file, f); + }; + MlFakeDevice.prototype.register = + function(name, content){ + var file; + if(this.content[name]) + caml_raise_sys_error(this.nm(name) + " : file already exists"); + if(caml_is_ml_bytes(content)) file = new MlFakeFile(content); + if(caml_is_ml_string(content)) + file = new MlFakeFile(caml_bytes_of_string(content)); + else if(content instanceof Array) + file = new MlFakeFile(caml_bytes_of_array(content)); + else if(typeof content === "string") + file = new MlFakeFile(caml_bytes_of_jsbytes(content)); + else if(content.toString){ + var + bytes = + caml_bytes_of_string(caml_string_of_jsstring(content.toString())); + file = new MlFakeFile(bytes); + } + if(file){ + this.create_dir_if_needed(name); + this.content[name] = file; + } + else + caml_raise_sys_error + (this.nm(name) + " : registering file with invalid content type"); + }; + MlFakeDevice.prototype.constructor = MlFakeDevice; + function caml_ml_string_length(s){return s.length;} + function caml_string_unsafe_get(s, i){return s.charCodeAt(i);} + function caml_uint8_array_of_string(s){ + var l = caml_ml_string_length(s), a = new Array(l), i = 0; + for(; i < l; i++) a[i] = caml_string_unsafe_get(s, i); + return a; + } + function caml_bytes_bound_error(){ + caml_invalid_argument("index out of bounds"); + } + function caml_bytes_unsafe_set(s, i, c){ + c &= 0xff; + if(s.t != 4){ + if(i == s.c.length){ + s.c += String.fromCharCode(c); + if(i + 1 == s.l) s.t = 0; + return 0; + } + caml_convert_bytes_to_array(s); + } + s.c[i] = c; + return 0; + } + function caml_bytes_set(s, i, c){ + if(i >>> 0 >= s.l) caml_bytes_bound_error(); + return caml_bytes_unsafe_set(s, i, c); + } + function MlNodeFd(fd, flags){ + this.fs = require("fs"); + this.fd = fd; + this.flags = flags; + } + MlNodeFd.prototype = new MlFile(); + MlNodeFd.prototype.constructor = MlNodeFd; + MlNodeFd.prototype.truncate = + function(len){ + try{this.fs.ftruncateSync(this.fd, len | 0);} + catch(err){caml_raise_sys_error(err.toString());} + }; + MlNodeFd.prototype.length = + function(){ + try{return this.fs.fstatSync(this.fd).size;} + catch(err){caml_raise_sys_error(err.toString());} + }; + MlNodeFd.prototype.write = + function(offset, buf, buf_offset, len){ + try{ + if(this.flags.isCharacterDevice) + this.fs.writeSync(this.fd, buf, buf_offset, len); + else + this.fs.writeSync(this.fd, buf, buf_offset, len, offset); + } + catch(err){caml_raise_sys_error(err.toString());} + return 0; + }; + MlNodeFd.prototype.read = + function(offset, a, buf_offset, len){ + try{ + if(this.flags.isCharacterDevice) + var read = this.fs.readSync(this.fd, a, buf_offset, len); + else + var read = this.fs.readSync(this.fd, a, buf_offset, len, offset); + return read; + } + catch(err){caml_raise_sys_error(err.toString());} + }; + MlNodeFd.prototype.close = + function(){ + try{this.fs.closeSync(this.fd); return 0;} + catch(err){caml_raise_sys_error(err.toString());} + }; + function MlNodeDevice(root){this.fs = require("fs"); this.root = root;} + MlNodeDevice.prototype.nm = function(name){return this.root + name;}; + MlNodeDevice.prototype.exists = + function(name){ + try{return this.fs.existsSync(this.nm(name)) ? 1 : 0;} + catch(err){return 0;} + }; + MlNodeDevice.prototype.isFile = + function(name){ + try{return this.fs.statSync(this.nm(name)).isFile() ? 1 : 0;} + catch(err){caml_raise_sys_error(err.toString());} + }; + MlNodeDevice.prototype.mkdir = + function(name, mode, raise_unix){ + try{this.fs.mkdirSync(this.nm(name), {mode: mode}); return 0;} + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.rmdir = + function(name, raise_unix){ + try{this.fs.rmdirSync(this.nm(name)); return 0;} + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.readdir = + function(name, raise_unix){ + try{return this.fs.readdirSync(this.nm(name));} + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.is_dir = + function(name){ + try{return this.fs.statSync(this.nm(name)).isDirectory() ? 1 : 0;} + catch(err){caml_raise_sys_error(err.toString());} + }; + MlNodeDevice.prototype.unlink = + function(name, raise_unix){ + try{ + var b = this.fs.existsSync(this.nm(name)) ? 1 : 0; + this.fs.unlinkSync(this.nm(name)); + return b; + } + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.open = + function(name, f, raise_unix){ + var consts = require("constants"), res = 0; + for(var key in f) + switch(key){ + case "rdonly": + res |= consts.O_RDONLY; break; + case "wronly": + res |= consts.O_WRONLY; break; + case "append": + res |= consts.O_WRONLY | consts.O_APPEND; break; + case "create": + res |= consts.O_CREAT; break; + case "truncate": + res |= consts.O_TRUNC; break; + case "excl": + res |= consts.O_EXCL; break; + case "binary": + res |= consts.O_BINARY; break; + case "text": + res |= consts.O_TEXT; break; + case "nonblock": + res |= consts.O_NONBLOCK; break; + } + try{ + var + fd = this.fs.openSync(this.nm(name), res), + isCharacterDevice = + this.fs.lstatSync(this.nm(name)).isCharacterDevice(); + f.isCharacterDevice = isCharacterDevice; + return new MlNodeFd(fd, f); + } + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.rename = + function(o, n, raise_unix){ + try{this.fs.renameSync(this.nm(o), this.nm(n));} + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.stat = + function(name, raise_unix){ + try{ + var js_stats = this.fs.statSync(this.nm(name)); + return this.stats_from_js(js_stats); + } + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.lstat = + function(name, raise_unix){ + try{ + var js_stats = this.fs.lstatSync(this.nm(name)); + return this.stats_from_js(js_stats); + } + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.symlink = + function(to_dir, target, path, raise_unix){ + try{ + this.fs.symlinkSync + (this.nm(target), this.nm(path), to_dir ? "dir" : "file"); + return 0; + } + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.readlink = + function(name, raise_unix){ + try{ + var link = this.fs.readlinkSync(this.nm(name), "utf8"); + return caml_string_of_jsstring(link); + } + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.opendir = + function(name, raise_unix){ + try{return this.fs.opendirSync(this.nm(name));} + catch(err){this.raise_nodejs_error(err, raise_unix);} + }; + MlNodeDevice.prototype.raise_nodejs_error = + function(err, raise_unix){ + var unix_error = caml_named_value("Unix.Unix_error"); + if(raise_unix && unix_error){ + var + args = make_unix_err_args(err.code, err.syscall, err.path, err.errno); + caml_raise_with_args(unix_error, args); + } + else + caml_raise_sys_error(err.toString()); + }; + MlNodeDevice.prototype.stats_from_js = + function(js_stats){ + var file_kind; + if(js_stats.isFile()) + file_kind = 0; + else if(js_stats.isDirectory()) + file_kind = 1; + else if(js_stats.isCharacterDevice()) + file_kind = 2; + else if(js_stats.isBlockDevice()) + file_kind = 3; + else if(js_stats.isSymbolicLink()) + file_kind = 4; + else if(js_stats.isFIFO()) + file_kind = 5; + else if(js_stats.isSocket()) file_kind = 6; + return [0, + js_stats.dev, + js_stats.ino, + file_kind, + js_stats.mode, + js_stats.nlink, + js_stats.uid, + js_stats.gid, + js_stats.rdev, + js_stats.size, + js_stats.atimeMs, + js_stats.mtimeMs, + js_stats.ctimeMs]; + }; + MlNodeDevice.prototype.constructor = MlNodeDevice; + function caml_get_root(path){ + var x = path_is_absolute(path); + if(! x) return; + return x[0] + "/"; + } + function caml_failwith(msg){ + if(! caml_global_data.Failure) + caml_global_data.Failure = [248, caml_string_of_jsbytes("Failure"), - 3]; + caml_raise_with_string(caml_global_data.Failure, msg); + } + var + caml_root = + caml_get_root(caml_current_dir) + || caml_failwith("unable to compute caml_root"), + jsoo_mount_point = []; + if(fs_node_supported()) + jsoo_mount_point.push + ({path: caml_root, device: new MlNodeDevice(caml_root)}); + else + jsoo_mount_point.push + ({path: caml_root, device: new MlFakeDevice(caml_root)}); + jsoo_mount_point.push + ({path: "/static/", device: new MlFakeDevice("/static/")}); + function resolve_fs_device(name){ + var + path = caml_make_path(name), + name = path.join("/"), + name_slash = caml_trailing_slash(name), + res; + for(var i = 0; i < jsoo_mount_point.length; i++){ + var m = jsoo_mount_point[i]; + if + (name_slash.search(m.path) == 0 + && (! res || res.path.length < m.path.length)) + res = + {path: m.path, + device: m.device, + rest: name.substring(m.path.length, name.length)}; + } + if(! res && fs_node_supported()){ + var root = caml_get_root(name); + if(root && root.match(/^[a-zA-Z]:\/$/)){ + var m = {path: root, device: new MlNodeDevice(root)}; + jsoo_mount_point.push(m); + res = + {path: m.path, + device: m.device, + rest: name.substring(m.path.length, name.length)}; + } + } + if(res) return res; + caml_raise_sys_error("no device found for " + name_slash); + } + function caml_sys_is_directory(name){ + var root = resolve_fs_device(name), a = root.device.is_dir(root.rest); + return a ? 1 : 0; + } + function caml_raise_not_found(){ + caml_raise_constant(caml_global_data.Not_found); + } + function caml_sys_getenv(name){ + var r = jsoo_sys_getenv(caml_jsstring_of_string(name)); + if(r === undefined) caml_raise_not_found(); + return caml_string_of_jsstring(r); + } + function shift_right_nat(nat1, ofs1, len1, nat2, ofs2, nbits){ + if(nbits == 0){nat2.data[ofs2] = 0; return 0;} + var wrap = 0; + for(var i = len1 - 1; i >= 0; i--){ + var a = nat1.data[ofs1 + i] >>> 0; + nat1.data[ofs1 + i] = a >>> nbits | wrap; + wrap = a << 32 - nbits; + } + nat2.data[ofs2] = wrap; + return 0; + } + var caml_gr_state; + function caml_gr_state_get(){ + if(caml_gr_state) return caml_gr_state; + throw caml_maybe_attach_backtrace + ([0, + caml_named_value("Graphics.Graphic_failure"), + caml_string_of_jsbytes("Not initialized")]); + } + function caml_gr_point_color(x, y){ + var + s = caml_gr_state_get(), + im = s.context.getImageData(x, s.height - y, 1, 1), + d = im.data; + return (d[0] << 16) + (d[1] << 8) + d[2]; + } + function caml_runtime_events_user_resolve(){return 0;} + var MlObjectTable; + if(typeof globalThis.Map === "undefined") + MlObjectTable = + function(){ + function NaiveLookup(objs){this.objs = objs;} + NaiveLookup.prototype.get = + function(v){ + for(var i = 0; i < this.objs.length; i++) + if(this.objs[i] === v) return i; + }; + NaiveLookup.prototype.set = function(){}; + return function(){ + this.objs = []; + this.lookup = new NaiveLookup(this.objs);}; + } + (); + else + MlObjectTable = + function(){this.objs = []; this.lookup = new globalThis.Map();}; + MlObjectTable.prototype.store = + function(v){this.lookup.set(v, this.objs.length); this.objs.push(v);}; + MlObjectTable.prototype.recall = + function(v){ + var i = this.lookup.get(v); + return i === undefined ? undefined : this.objs.length - i; + }; + function caml_sys_rename(o, n){ + var o_root = resolve_fs_device(o), n_root = resolve_fs_device(n); + if(o_root.device != n_root.device) + caml_failwith("caml_sys_rename: cannot move file between two filesystem"); + if(! o_root.device.rename) + caml_failwith("caml_sys_rename: no implemented"); + o_root.device.rename(o_root.rest, n_root.rest); + } + function caml_log10_float(x){return Math.log10(x);} + var caml_runtime_warnings = 0; + function caml_ml_enable_runtime_warnings(bool){caml_runtime_warnings = bool; return 0; + } + function caml_classify_float(x){ + if(isFinite(x)){ + if(Math.abs(x) >= 2.2250738585072014e-308) return 0; + if(x != 0) return 1; + return 2; + } + return isNaN(x) ? 4 : 3; + } + var caml_ml_channels = new Array(); + function caml_refill(chan){ + if(chan.refill != null){ + var str = chan.refill(), str_a = caml_uint8_array_of_string(str); + if(str_a.length == 0) + chan.refill = null; + else{ + if(chan.buffer.length < chan.buffer_max + str_a.length){ + var b = new Uint8Array(chan.buffer_max + str_a.length); + b.set(chan.buffer); + chan.buffer = b; + } + chan.buffer.set(str_a, chan.buffer_max); + chan.offset += str_a.length; + chan.buffer_max += str_a.length; + } + } + else{ + var + nread = + chan.file.read + (chan.offset, + chan.buffer, + chan.buffer_max, + chan.buffer.length - chan.buffer_max); + chan.offset += nread; + chan.buffer_max += nread; + } + } + function caml_array_bound_error(){ + caml_invalid_argument("index out of bounds"); + } + function caml_ml_input_scan_line(chanid){ + var chan = caml_ml_channels[chanid], p = chan.buffer_curr; + do + if(p >= chan.buffer_max){ + if(chan.buffer_curr > 0){ + chan.buffer.set(chan.buffer.subarray(chan.buffer_curr), 0); + p -= chan.buffer_curr; + chan.buffer_max -= chan.buffer_curr; + chan.buffer_curr = 0; + } + if(chan.buffer_max >= chan.buffer.length) return - chan.buffer_max | 0; + var prev_max = chan.buffer_max; + caml_refill(chan); + if(prev_max == chan.buffer_max) return - chan.buffer_max | 0; + } + while + (chan.buffer[p++] != 10); + return p - chan.buffer_curr | 0; + } + function caml_gc_minor(unit){ + if(typeof globalThis.gc == "function") globalThis.gc(true); + return 0; + } + function caml_ml_condition_new(unit){return {condition: 1};} + function caml_int64_of_bytes(a){ + return new + MlInt64 + (a[7] << 0 | a[6] << 8 | a[5] << 16, + a[4] << 0 | a[3] << 8 | a[2] << 16, + a[1] << 0 | a[0] << 8); + } + function caml_ba_uint8_get64(ba, i0){ + var ofs = ba.offset(i0); + if(ofs + 7 >= ba.data.length) caml_array_bound_error(); + var + b1 = ba.get(ofs + 0), + b2 = ba.get(ofs + 1), + b3 = ba.get(ofs + 2), + b4 = ba.get(ofs + 3), + b5 = ba.get(ofs + 4), + b6 = ba.get(ofs + 5), + b7 = ba.get(ofs + 6), + b8 = ba.get(ofs + 7); + return caml_int64_of_bytes([b8, b7, b6, b5, b4, b3, b2, b1]); + } + function caml_int64_to_bytes(x){return x.toArray();} + function caml_int64_marshal(writer, v, sizes){ + var b = caml_int64_to_bytes(v); + for(var i = 0; i < 8; i++) writer.write(8, b[i]); + sizes[0] = 8; + sizes[1] = 8; + } + function caml_ba_num_dims(ba){return ba.dims.length;} + function caml_wrap_exception(e){ + { + if(e instanceof Array) return e; + var exn; + if + (globalThis.RangeError && e instanceof globalThis.RangeError + && e.message + && e.message.match(/maximum call stack/i)) + exn = caml_global_data.Stack_overflow; + else if + (globalThis.InternalError && e instanceof globalThis.InternalError + && e.message + && e.message.match(/too much recursion/i)) + exn = caml_global_data.Stack_overflow; + else if(e instanceof globalThis.Error && caml_named_value("jsError")) + exn = [0, caml_named_value("jsError"), e]; + else + exn = [0, caml_global_data.Failure, caml_string_of_jsstring(String(e))]; + if(e instanceof globalThis.Error) exn.js_error = e; + return exn; + } + } + function caml_create_file(name, content){ + var root = resolve_fs_device(name); + if(! root.device.register) caml_failwith("cannot register file"); + root.device.register(root.rest, content); + return 0; + } + function jsoo_create_file(name, content){ + var + name = caml_string_of_jsbytes(name), + content = caml_string_of_jsbytes(content); + return caml_create_file(name, content); + } + function caml_fs_init(){ + var tmp = globalThis.caml_fs_tmp; + if(tmp) + for(var i = 0; i < tmp.length; i++) + jsoo_create_file(tmp[i].name, tmp[i].content); + globalThis.jsoo_create_file = jsoo_create_file; + globalThis.caml_fs_tmp = []; + return 0; + } + function caml_get_continuation_callstack(){return [0];} + var caml_parser_trace = 0; + function caml_set_parser_trace(bool){ + var oldflag = caml_parser_trace; + caml_parser_trace = bool; + return oldflag; + } + function caml_list_of_js_array(a){ + var l = 0; + for(var i = a.length - 1; i >= 0; i--){var e = a[i]; l = [0, e, l];} + return l; + } + function caml_mul(a, b){return Math.imul(a, b);} + function caml_hash_mix_int(h, d){ + d = caml_mul(d, 0xcc9e2d51 | 0); + d = d << 15 | d >>> 32 - 15; + d = caml_mul(d, 0x1b873593); + h ^= d; + h = h << 13 | h >>> 32 - 13; + return (h + (h << 2) | 0) + (0xe6546b64 | 0) | 0; + } + function num_digits_nat(nat, ofs, len){ + for(var i = len - 1; i >= 0; i--) if(nat.data[ofs + i] != 0) return i + 1; + return 1; + } + function caml_hash_nat(x){ + var len = num_digits_nat(x, 0, x.data.length), h = 0; + for(var i = 0; i < len; i++) h = caml_hash_mix_int(h, x.data[i]); + return h; + } + function caml_call_gen(f, args){ + var + n = f.l >= 0 ? f.l : f.l = f.length, + argsLen = args.length, + d = n - argsLen; + if(d == 0) + return f.apply(null, args); + else if(d < 0){ + var g = f.apply(null, args.slice(0, n)); + if(typeof g !== "function") return g; + return caml_call_gen(g, args.slice(n)); + } + else{ + switch(d){ + case 1: + { + var + g = + function(x){ + var nargs = new Array(argsLen + 1); + for(var i = 0; i < argsLen; i++) nargs[i] = args[i]; + nargs[argsLen] = x; + return f.apply(null, nargs); + }; + break; + } + case 2: + { + var + g = + function(x, y){ + var nargs = new Array(argsLen + 2); + for(var i = 0; i < argsLen; i++) nargs[i] = args[i]; + nargs[argsLen] = x; + nargs[argsLen + 1] = y; + return f.apply(null, nargs); + }; + break; + } + default: + var + g = + function(){ + var + extra_args = arguments.length == 0 ? 1 : arguments.length, + nargs = new Array(args.length + extra_args); + for(var i = 0; i < args.length; i++) nargs[i] = args[i]; + for(var i = 0; i < arguments.length; i++) + nargs[args.length + i] = arguments[i]; + return caml_call_gen(f, nargs); + }; + } + g.l = d; + return g; + } + } + var caml_callback = caml_call_gen; + function caml_js_wrap_callback_arguments(f){ + return function(){ + var len = arguments.length, args = new Array(len); + for(var i = 0; i < len; i++) args[i] = arguments[i]; + return caml_callback(f, [args]);}; + } + function caml_sys_chdir(dir){ + var root = resolve_fs_device(dir); + if(root.device.exists(root.rest)){ + if(root.rest) + caml_current_dir = caml_trailing_slash(root.path + root.rest); + else + caml_current_dir = root.path; + return 0; + } + else + caml_raise_no_such_file(caml_jsbytes_of_string(dir)); + } + function caml_obj_tag(x){ + if(x instanceof Array && x[0] == x[0] >>> 0) + return x[0]; + else if(caml_is_ml_bytes(x)) + return 252; + else if(caml_is_ml_string(x)) + return 252; + else if(x instanceof Function || typeof x == "function") + return 247; + else if(x && x.caml_custom) return 255; else return 1000; + } + function caml_obj_update_tag(b, o, n){ + if(b[0] == o){b[0] = n; return 1;} + return 0; + } + var caml_ml_domain_unique_token_ = [0]; + function caml_ml_domain_unique_token(unit){return caml_ml_domain_unique_token_; + } + function caml_lazy_update_to_forcing(o){ + var t = caml_obj_tag(o); + if(t != 246 && t != 250 && t != 244) return 4; + if(caml_obj_update_tag(o, 246, 244)) + return 0; + else{ + var field0 = o[1]; + t = o[0]; + if(t == 244) + return field0 == caml_ml_domain_unique_token(0) ? 1 : 2; + else if(t == 250) return 3; else return 2; + } + } + function caml_gc_counters(){return [254, 0, 0, 0];} + function caml_gr_synchronize(){ + caml_failwith("caml_gr_synchronize not Implemented"); + } + function caml_unix_closedir(dir_handle){ + try{dir_handle.pointer.closeSync();} + catch(e){ + var unix_error = caml_named_value("Unix.Unix_error"); + caml_raise_with_args + (unix_error, make_unix_err_args("EBADF", "closedir", dir_handle.path)); + } + } + function caml_unix_opendir(path){ + var root = resolve_fs_device(path); + if(! root.device.opendir) + caml_failwith("caml_unix_opendir: not implemented"); + var dir_handle = root.device.opendir(root.rest, true); + return {pointer: dir_handle, path: path}; + } + function caml_unix_rewinddir(dir_handle){ + caml_unix_closedir(dir_handle); + var new_dir_handle = caml_unix_opendir(dir_handle.path); + dir_handle.pointer = new_dir_handle.pointer; + return 0; + } + function caml_raise_end_of_file(){ + caml_raise_constant(caml_global_data.End_of_file); + } + function caml_unix_readdir(dir_handle){ + var entry; + try{entry = dir_handle.pointer.readSync();} + catch(e){ + var unix_error = caml_named_value("Unix.Unix_error"); + caml_raise_with_args + (unix_error, make_unix_err_args("EBADF", "readdir", dir_handle.path)); + } + if(entry === null) + caml_raise_end_of_file(); + else + return caml_string_of_jsstring(entry.name); + } + function caml_unix_findfirst(path){ + var path_js = caml_jsstring_of_string(path); + path_js = path_js.replace(/(^|[\\\/])\*\.\*$/, ""); + path = caml_string_of_jsstring(path_js); + var + dir_handle = caml_unix_opendir(path), + first_entry = caml_unix_readdir(dir_handle); + return [0, first_entry, dir_handle]; + } + function caml_is_continuation_tag(t){return 0;} + var log2_ok = Math.log2 && Math.log2(1.1235582092889474E+307) == 1020; + function jsoo_floor_log2(x){ + if(log2_ok) return Math.floor(Math.log2(x)); + var i = 0; + if(x == 0) return - Infinity; + if(x >= 1) while(x >= 2){x /= 2; i++;} else while(x < 1){x *= 2; i--;} + return i; + } + function caml_int32_bits_of_float(x){ + var float32a = new Float32Array(1); + float32a[0] = x; + var int32a = new Int32Array(float32a.buffer); + return int32a[0] | 0; + } + function caml_int64_create_lo_mi_hi(lo, mi, hi){return new MlInt64(lo, mi, hi); + } + function caml_int64_bits_of_float(x){ + if(! isFinite(x)){ + if(isNaN(x)) return caml_int64_create_lo_mi_hi(1, 0, 0x7ff0); + return x > 0 + ? caml_int64_create_lo_mi_hi(0, 0, 0x7ff0) + : caml_int64_create_lo_mi_hi(0, 0, 0xfff0); + } + var sign = x == 0 && 1 / x == - Infinity ? 0x8000 : x >= 0 ? 0 : 0x8000; + if(sign) x = - x; + var exp = jsoo_floor_log2(x) + 1023; + if(exp <= 0){ + exp = 0; + x /= Math.pow(2, - 1026); + } + else{ + x /= Math.pow(2, exp - 1027); + if(x < 16){x *= 2; exp -= 1;} + if(exp == 0) x /= 2; + } + var k = Math.pow(2, 24), r3 = x | 0; + x = (x - r3) * k; + var r2 = x | 0; + x = (x - r2) * k; + var r1 = x | 0; + r3 = r3 & 0xf | sign | exp << 4; + return caml_int64_create_lo_mi_hi(r1, r2, r3); + } + function caml_ba_serialize(writer, ba, sz){ + writer.write(32, ba.dims.length); + writer.write(32, ba.kind | ba.layout << 8); + if(ba.caml_custom == "_bigarr02") + for(var i = 0; i < ba.dims.length; i++) + if(ba.dims[i] < 0xffff) + writer.write(16, ba.dims[i]); + else{ + writer.write(16, 0xffff); + writer.write(32, 0); + writer.write(32, ba.dims[i]); + } + else + for(var i = 0; i < ba.dims.length; i++) writer.write(32, ba.dims[i]); + switch(ba.kind){ + case 2: + case 3: + case 12: + for(var i = 0; i < ba.data.length; i++) writer.write(8, ba.data[i]); + break; + case 4: + case 5: + for(var i = 0; i < ba.data.length; i++) writer.write(16, ba.data[i]); + break; + case 6: + for(var i = 0; i < ba.data.length; i++) writer.write(32, ba.data[i]); + break; + case 8: + case 9: + writer.write(8, 0); + for(var i = 0; i < ba.data.length; i++) writer.write(32, ba.data[i]); + break; + case 7: + for(var i = 0; i < ba.data.length / 2; i++){ + var b = caml_int64_to_bytes(ba.get(i)); + for(var j = 0; j < 8; j++) writer.write(8, b[j]); + } + break; + case 1: + for(var i = 0; i < ba.data.length; i++){ + var b = caml_int64_to_bytes(caml_int64_bits_of_float(ba.get(i))); + for(var j = 0; j < 8; j++) writer.write(8, b[j]); + } + break; + case 0: + for(var i = 0; i < ba.data.length; i++){ + var b = caml_int32_bits_of_float(ba.get(i)); + writer.write(32, b); + } + break; + case 10: + for(var i = 0; i < ba.data.length / 2; i++){ + var j = ba.get(i); + writer.write(32, caml_int32_bits_of_float(j[1])); + writer.write(32, caml_int32_bits_of_float(j[2])); + } + break; + case 11: + for(var i = 0; i < ba.data.length / 2; i++){ + var + complex = ba.get(i), + b = caml_int64_to_bytes(caml_int64_bits_of_float(complex[1])); + for(var j = 0; j < 8; j++) writer.write(8, b[j]); + var b = caml_int64_to_bytes(caml_int64_bits_of_float(complex[2])); + for(var j = 0; j < 8; j++) writer.write(8, b[j]); + } + break; + } + sz[0] = (4 + ba.dims.length) * 4; + sz[1] = (4 + ba.dims.length) * 8; + } + function caml_ba_get_size_per_element(kind){ + switch(kind){case 7:case 10:case 11: return 2;default: return 1; + } + } + function caml_ba_create_buffer(kind, size){ + var view; + switch(kind){ + case 0: + view = Float32Array; break; + case 1: + view = Float64Array; break; + case 2: + view = Int8Array; break; + case 3: + view = Uint8Array; break; + case 4: + view = Int16Array; break; + case 5: + view = Uint16Array; break; + case 6: + view = Int32Array; break; + case 7: + view = Int32Array; break; + case 8: + view = Int32Array; break; + case 9: + view = Int32Array; break; + case 10: + view = Float32Array; break; + case 11: + view = Float64Array; break; + case 12: + view = Uint8Array; break; + } + if(! view) caml_invalid_argument("Bigarray.create: unsupported kind"); + var data = new view(size * caml_ba_get_size_per_element(kind)); + return data; + } + function caml_int32_float_of_bits(x){ + var int32a = new Int32Array(1); + int32a[0] = x; + var float32a = new Float32Array(int32a.buffer); + return float32a[0]; + } + function caml_int64_float_of_bits(x){ + var lo = x.lo, mi = x.mi, hi = x.hi, exp = (hi & 0x7fff) >> 4; + if(exp == 2047) + return (lo | mi | hi & 0xf) == 0 + ? hi & 0x8000 ? - Infinity : Infinity + : NaN; + var k = Math.pow(2, - 24), res = (lo * k + mi) * k + (hi & 0xf); + if(exp > 0){ + res += 16; + res *= Math.pow(2, exp - 1027); + } + else + res *= Math.pow(2, - 1026); + if(hi & 0x8000) res = - res; + return res; + } + function caml_ba_get_size(dims){ + var n_dims = dims.length, size = 1; + for(var i = 0; i < n_dims; i++){ + if(dims[i] < 0) + caml_invalid_argument("Bigarray.create: negative dimension"); + size = size * dims[i]; + } + return size; + } + function caml_int64_create_lo_hi(lo, hi){ + return new + MlInt64 + (lo & 0xffffff, + lo >>> 24 & 0xff | (hi & 0xffff) << 8, + hi >>> 16 & 0xffff); + } + function caml_int64_hi32(v){return v.hi32();} + function caml_int64_lo32(v){return v.lo32();} + var caml_ba_custom_name = "_bigarr02"; + function Ml_Bigarray(kind, layout, dims, buffer){ + this.kind = kind; + this.layout = layout; + this.dims = dims; + this.data = buffer; + } + Ml_Bigarray.prototype.caml_custom = caml_ba_custom_name; + Ml_Bigarray.prototype.offset = + function(arg){ + var ofs = 0; + if(typeof arg === "number") arg = [arg]; + if(! (arg instanceof Array)) + caml_invalid_argument("bigarray.js: invalid offset"); + if(this.dims.length != arg.length) + caml_invalid_argument("Bigarray.get/set: bad number of dimensions"); + if(this.layout == 0) + for(var i = 0; i < this.dims.length; i++){ + if(arg[i] < 0 || arg[i] >= this.dims[i]) caml_array_bound_error(); + ofs = ofs * this.dims[i] + arg[i]; + } + else + for(var i = this.dims.length - 1; i >= 0; i--){ + if(arg[i] < 1 || arg[i] > this.dims[i]) caml_array_bound_error(); + ofs = ofs * this.dims[i] + (arg[i] - 1); + } + return ofs; + }; + Ml_Bigarray.prototype.get = + function(ofs){ + switch(this.kind){ + case 7: + var l = this.data[ofs * 2 + 0], h = this.data[ofs * 2 + 1]; + return caml_int64_create_lo_hi(l, h); + case 10: + case 11: + var r = this.data[ofs * 2 + 0], i = this.data[ofs * 2 + 1]; + return [254, r, i]; + default: return this.data[ofs]; + } + }; + Ml_Bigarray.prototype.set = + function(ofs, v){ + switch(this.kind){ + case 7: + this.data[ofs * 2 + 0] = caml_int64_lo32(v); + this.data[ofs * 2 + 1] = caml_int64_hi32(v); + break; + case 10: + case 11: + this.data[ofs * 2 + 0] = v[1]; this.data[ofs * 2 + 1] = v[2]; break; + default: this.data[ofs] = v; break; + } + return 0; + }; + Ml_Bigarray.prototype.fill = + function(v){ + switch(this.kind){ + case 7: + var a = caml_int64_lo32(v), b = caml_int64_hi32(v); + if(a == b) + this.data.fill(a); + else + for(var i = 0; i < this.data.length; i++) + this.data[i] = i % 2 == 0 ? a : b; + break; + case 10: + case 11: + var im = v[1], re = v[2]; + if(im == re) + this.data.fill(im); + else + for(var i = 0; i < this.data.length; i++) + this.data[i] = i % 2 == 0 ? im : re; + break; + default: this.data.fill(v); break; + } + }; + Ml_Bigarray.prototype.compare = + function(b, total){ + if(this.layout != b.layout || this.kind != b.kind){ + var k1 = this.kind | this.layout << 8, k2 = b.kind | b.layout << 8; + return k2 - k1; + } + if(this.dims.length != b.dims.length) + return b.dims.length - this.dims.length; + for(var i = 0; i < this.dims.length; i++) + if(this.dims[i] != b.dims[i]) return this.dims[i] < b.dims[i] ? - 1 : 1; + switch(this.kind){ + case 0: + case 1: + case 10: + case 11: + var x, y; + for(var i = 0; i < this.data.length; i++){ + x = this.data[i]; + y = b.data[i]; + if(x < y) return - 1; + if(x > y) return 1; + if(x != y){ + if(! total) return NaN; + if(x == x) return 1; + if(y == y) return - 1; + } + } + break; + case 7: + for(var i = 0; i < this.data.length; i += 2){ + if(this.data[i + 1] < b.data[i + 1]) return - 1; + if(this.data[i + 1] > b.data[i + 1]) return 1; + if(this.data[i] >>> 0 < b.data[i] >>> 0) return - 1; + if(this.data[i] >>> 0 > b.data[i] >>> 0) return 1; + } + break; + case 2: + case 3: + case 4: + case 5: + case 6: + case 8: + case 9: + case 12: + for(var i = 0; i < this.data.length; i++){ + if(this.data[i] < b.data[i]) return - 1; + if(this.data[i] > b.data[i]) return 1; + } + break; + } + return 0; + }; + function Ml_Bigarray_c_1_1(kind, layout, dims, buffer){ + this.kind = kind; + this.layout = layout; + this.dims = dims; + this.data = buffer; + } + Ml_Bigarray_c_1_1.prototype = new Ml_Bigarray(); + Ml_Bigarray_c_1_1.prototype.offset = + function(arg){ + if(typeof arg !== "number") + if(arg instanceof Array && arg.length == 1) + arg = arg[0]; + else + caml_invalid_argument("Ml_Bigarray_c_1_1.offset"); + if(arg < 0 || arg >= this.dims[0]) caml_array_bound_error(); + return arg; + }; + Ml_Bigarray_c_1_1.prototype.get = function(ofs){return this.data[ofs];}; + Ml_Bigarray_c_1_1.prototype.set = + function(ofs, v){this.data[ofs] = v; return 0;}; + Ml_Bigarray_c_1_1.prototype.fill = + function(v){this.data.fill(v); return 0;}; + function caml_ba_create_unsafe(kind, layout, dims, data){ + var size_per_element = caml_ba_get_size_per_element(kind); + if(caml_ba_get_size(dims) * size_per_element != data.length) + caml_invalid_argument("length doesn't match dims"); + if(layout == 0 && dims.length == 1 && size_per_element == 1) + return new Ml_Bigarray_c_1_1(kind, layout, dims, data); + return new Ml_Bigarray(kind, layout, dims, data); + } + function caml_ba_deserialize(reader, sz, name){ + var num_dims = reader.read32s(); + if(num_dims < 0 || num_dims > 16) + caml_failwith("input_value: wrong number of bigarray dimensions"); + var + tag = reader.read32s(), + kind = tag & 0xff, + layout = tag >> 8 & 1, + dims = []; + if(name == "_bigarr02") + for(var i = 0; i < num_dims; i++){ + var size_dim = reader.read16u(); + if(size_dim == 0xffff){ + var size_dim_hi = reader.read32u(), size_dim_lo = reader.read32u(); + if(size_dim_hi != 0) + caml_failwith("input_value: bigarray dimension overflow in 32bit"); + size_dim = size_dim_lo; + } + dims.push(size_dim); + } + else + for(var i = 0; i < num_dims; i++) dims.push(reader.read32u()); + var + size = caml_ba_get_size(dims), + data = caml_ba_create_buffer(kind, size), + ba = caml_ba_create_unsafe(kind, layout, dims, data); + switch(kind){ + case 2: + for(var i = 0; i < size; i++) data[i] = reader.read8s(); break; + case 3: + case 12: + for(var i = 0; i < size; i++) data[i] = reader.read8u(); break; + case 4: + for(var i = 0; i < size; i++) data[i] = reader.read16s(); break; + case 5: + for(var i = 0; i < size; i++) data[i] = reader.read16u(); break; + case 6: + for(var i = 0; i < size; i++) data[i] = reader.read32s(); break; + case 8: + case 9: + var sixty = reader.read8u(); + if(sixty) + caml_failwith + ("input_value: cannot read bigarray with 64-bit OCaml ints"); + for(var i = 0; i < size; i++) data[i] = reader.read32s(); + break; + case 7: + var t = new Array(8); + for(var i = 0; i < size; i++){ + for(var j = 0; j < 8; j++) t[j] = reader.read8u(); + var int64 = caml_int64_of_bytes(t); + ba.set(i, int64); + } + break; + case 1: + var t = new Array(8); + for(var i = 0; i < size; i++){ + for(var j = 0; j < 8; j++) t[j] = reader.read8u(); + var f = caml_int64_float_of_bits(caml_int64_of_bytes(t)); + ba.set(i, f); + } + break; + case 0: + for(var i = 0; i < size; i++){ + var f = caml_int32_float_of_bits(reader.read32s()); + ba.set(i, f); + } + break; + case 10: + for(var i = 0; i < size; i++){ + var + re = caml_int32_float_of_bits(reader.read32s()), + im = caml_int32_float_of_bits(reader.read32s()); + ba.set(i, [254, re, im]); + } + break; + case 11: + var t = new Array(8); + for(var i = 0; i < size; i++){ + for(var j = 0; j < 8; j++) t[j] = reader.read8u(); + var re = caml_int64_float_of_bits(caml_int64_of_bytes(t)); + for(var j = 0; j < 8; j++) t[j] = reader.read8u(); + var im = caml_int64_float_of_bits(caml_int64_of_bytes(t)); + ba.set(i, [254, re, im]); + } + break; + } + sz[0] = (4 + num_dims) * 4; + return caml_ba_create_unsafe(kind, layout, dims, data); + } + function caml_ba_compare(a, b, total){return a.compare(b, total);} + function caml_hash_mix_int64(h, v){ + h = caml_hash_mix_int(h, caml_int64_lo32(v)); + h = caml_hash_mix_int(h, caml_int64_hi32(v)); + return h; + } + function caml_hash_mix_float(h, v0){ + return caml_hash_mix_int64(h, caml_int64_bits_of_float(v0)); + } + function caml_ba_hash(ba){ + var num_elts = caml_ba_get_size(ba.dims), h = 0; + switch(ba.kind){ + case 2: + case 3: + case 12: + if(num_elts > 256) num_elts = 256; + var w = 0, i = 0; + for(i = 0; i + 4 <= ba.data.length; i += 4){ + w = + ba.data[i + 0] | ba.data[i + 1] << 8 | ba.data[i + 2] << 16 + | ba.data[i + 3] << 24; + h = caml_hash_mix_int(h, w); + } + w = 0; + switch(num_elts & 3){ + case 3: + w = ba.data[i + 2] << 16; + case 2: + w |= ba.data[i + 1] << 8; + case 1: + w |= ba.data[i + 0]; h = caml_hash_mix_int(h, w); + } + break; + case 4: + case 5: + if(num_elts > 128) num_elts = 128; + var w = 0, i = 0; + for(i = 0; i + 2 <= ba.data.length; i += 2){ + w = ba.data[i + 0] | ba.data[i + 1] << 16; + h = caml_hash_mix_int(h, w); + } + if((num_elts & 1) != 0) h = caml_hash_mix_int(h, ba.data[i]); + break; + case 6: + if(num_elts > 64) num_elts = 64; + for(var i = 0; i < num_elts; i++) h = caml_hash_mix_int(h, ba.data[i]); + break; + case 8: + case 9: + if(num_elts > 64) num_elts = 64; + for(var i = 0; i < num_elts; i++) h = caml_hash_mix_int(h, ba.data[i]); + break; + case 7: + if(num_elts > 32) num_elts = 32; + num_elts *= 2; + for(var i = 0; i < num_elts; i++) h = caml_hash_mix_int(h, ba.data[i]); + break; + case 10: + num_elts *= 2; + case 0: + if(num_elts > 64) num_elts = 64; + for(var i = 0; i < num_elts; i++) + h = caml_hash_mix_float(h, ba.data[i]); + break; + case 11: + num_elts *= 2; + case 1: + if(num_elts > 32) num_elts = 32; + for(var i = 0; i < num_elts; i++) + h = caml_hash_mix_float(h, ba.data[i]); + break; + } + return h; + } + function caml_int32_unmarshal(reader, size){size[0] = 4; return reader.read32s(); + } + function caml_nativeint_unmarshal(reader, size){ + switch(reader.read8u()){ + case 1: + size[0] = 4; return reader.read32s(); + case 2: + caml_failwith("input_value: native integer value too large"); + default: caml_failwith("input_value: ill-formed native integer"); + } + } + function caml_int64_unmarshal(reader, size){ + var t = new Array(8); + for(var j = 0; j < 8; j++) t[j] = reader.read8u(); + size[0] = 8; + return caml_int64_of_bytes(t); + } + function caml_int64_compare(x, y, total){return x.compare(y);} + function caml_int64_hash(v){return v.lo32() ^ v.hi32();} + var + caml_custom_ops = + {"_j": + {deserialize: caml_int64_unmarshal, + serialize: caml_int64_marshal, + fixed_length: 8, + compare: caml_int64_compare, + hash: caml_int64_hash}, + "_i": {deserialize: caml_int32_unmarshal, fixed_length: 4}, + "_n": {deserialize: caml_nativeint_unmarshal, fixed_length: 4}, + "_bigarray": + {deserialize: + function(reader, sz){ + return caml_ba_deserialize(reader, sz, "_bigarray"); + }, + serialize: caml_ba_serialize, + compare: caml_ba_compare, + hash: caml_ba_hash}, + "_bigarr02": + {deserialize: + function(reader, sz){ + return caml_ba_deserialize(reader, sz, "_bigarr02"); + }, + serialize: caml_ba_serialize, + compare: caml_ba_compare, + hash: caml_ba_hash}}; + function caml_compare_val_get_custom(a){ + return caml_custom_ops[a.caml_custom] + && caml_custom_ops[a.caml_custom].compare; + } + function caml_compare_val_number_custom(num, custom, swap, total){ + var comp = caml_compare_val_get_custom(custom); + if(comp){ + var x = swap > 0 ? comp(custom, num, total) : comp(num, custom, total); + if(total && x != x) return swap; + if(+ x != + x) return + x; + if((x | 0) != 0) return x | 0; + } + return swap; + } + function caml_compare_val_tag(a){ + if(typeof a === "number") + return 1000; + else if(caml_is_ml_bytes(a)) + return 252; + else if(caml_is_ml_string(a)) + return 1252; + else if(a instanceof Array && a[0] === a[0] >>> 0 && a[0] <= 255){var tag = a[0] | 0; return tag == 254 ? 0 : tag;} + else if(a instanceof String) + return 12520; + else if(typeof a == "string") + return 12520; + else if(a instanceof Number) + return 1000; + else if(a && a.caml_custom) + return 1255; + else if(a && a.compare) + return 1256; + else if(typeof a == "function") + return 1247; + else if(typeof a == "symbol") return 1251; + return 1001; + } + function caml_int_compare(a, b){ + if(a < b) return - 1; + if(a == b) return 0; + return 1; + } + function caml_string_compare(s1, s2){ + return s1 < s2 ? - 1 : s1 > s2 ? 1 : 0; + } + function caml_bytes_compare(s1, s2){ + s1.t & 6 && caml_convert_string_to_bytes(s1); + s2.t & 6 && caml_convert_string_to_bytes(s2); + return s1.c < s2.c ? - 1 : s1.c > s2.c ? 1 : 0; + } + function caml_compare_val(a, b, total){ + var stack = []; + for(;;){ + if(! (total && a === b)){ + var tag_a = caml_compare_val_tag(a); + if(tag_a == 250){a = a[1]; continue;} + var tag_b = caml_compare_val_tag(b); + if(tag_b == 250){b = b[1]; continue;} + if(tag_a !== tag_b){ + if(tag_a == 1000){ + if(tag_b == 1255) + return caml_compare_val_number_custom(a, b, - 1, total); + return - 1; + } + if(tag_b == 1000){ + if(tag_a == 1255) + return caml_compare_val_number_custom(b, a, 1, total); + return 1; + } + return tag_a < tag_b ? - 1 : 1; + } + switch(tag_a){ + case 247: + caml_invalid_argument("compare: functional value"); break; + case 248: + var x = caml_int_compare(a[2], b[2]); if(x != 0) return x | 0; break; + case 249: + caml_invalid_argument("compare: functional value"); break; + case 250: + caml_invalid_argument("equal: got Forward_tag, should not happen"); + break; + case 251: + caml_invalid_argument("equal: abstract value"); break; + case 252: + if(a !== b){ + var x = caml_bytes_compare(a, b); + if(x != 0) return x | 0; + } + break; + case 253: + caml_invalid_argument("equal: got Double_tag, should not happen"); + break; + case 254: + caml_invalid_argument + ("equal: got Double_array_tag, should not happen"); + break; + case 255: + caml_invalid_argument("equal: got Custom_tag, should not happen"); + break; + case 1247: + caml_invalid_argument("compare: functional value"); break; + case 1255: + var comp = caml_compare_val_get_custom(a); + if(comp != caml_compare_val_get_custom(b)) + return a.caml_custom < b.caml_custom ? - 1 : 1; + if(! comp) caml_invalid_argument("compare: abstract value"); + var x = comp(a, b, total); + if(x != x) return total ? - 1 : x; + if(x !== (x | 0)) return - 1; + if(x != 0) return x | 0; + break; + case 1256: + var x = a.compare(b, total); + if(x != x) return total ? - 1 : x; + if(x !== (x | 0)) return - 1; + if(x != 0) return x | 0; + break; + case 1000: + a = + a; + b = + b; + if(a < b) return - 1; + if(a > b) return 1; + if(a != b){ + if(! total) return NaN; + if(a == a) return 1; + if(b == b) return - 1; + } + break; + case 1001: + if(a < b) return - 1; + if(a > b) return 1; + if(a != b){ + if(! total) return NaN; + if(a == a) return 1; + if(b == b) return - 1; + } + break; + case 1251: + if(a !== b){if(! total) return NaN; return 1;} break; + case 1252: + var a = caml_jsbytes_of_string(a), b = caml_jsbytes_of_string(b); + if(a !== b){if(a < b) return - 1; if(a > b) return 1;} + break; + case 12520: + var a = a.toString(), b = b.toString(); + if(a !== b){if(a < b) return - 1; if(a > b) return 1;} + break; + case 246: + case 254: + default: + if(caml_is_continuation_tag(tag_a)){ + caml_invalid_argument("compare: continuation value"); + break; + } + if(a.length != b.length) return a.length < b.length ? - 1 : 1; + if(a.length > 1) stack.push(a, b, 1); + break; + } + } + if(stack.length == 0) return 0; + var i = stack.pop(); + b = stack.pop(); + a = stack.pop(); + if(i + 1 < a.length) stack.push(a, b, i + 1); + a = a[i]; + b = b[i]; + } + } + function caml_greaterthan(x, y){ + return + (caml_compare_val(x, y, false) > 0); + } + function div_helper(a, b, c){ + var + x = a * 65536 + (b >>> 16), + y = Math.floor(x / c) * 65536, + z = x % c * 65536, + w = z + (b & 0x0000FFFF); + return [y + Math.floor(w / c), w % c]; + } + function div_digit_nat(natq, ofsq, natr, ofsr, nat1, ofs1, len, nat2, ofs2){ + var rem = nat1.data[ofs1 + len - 1] >>> 0; + for(var i = len - 2; i >= 0; i--){ + var + x = div_helper(rem, nat1.data[ofs1 + i] >>> 0, nat2.data[ofs2] >>> 0); + natq.data[ofsq + i] = x[0]; + rem = x[1]; + } + natr.data[ofsr] = rem; + return 0; + } + function num_leading_zero_bits_in_digit(nat, ofs){ + var a = nat.data[ofs], b = 0; + if(a & 0xFFFF0000){b += 16; a >>>= 16;} + if(a & 0xFF00){b += 8; a >>>= 8;} + if(a & 0xF0){b += 4; a >>>= 4;} + if(a & 12){b += 2; a >>>= 2;} + if(a & 2){b += 1; a >>>= 1;} + if(a & 1) b += 1; + return 32 - b; + } + function shift_left_nat(nat1, ofs1, len1, nat2, ofs2, nbits){ + if(nbits == 0){nat2.data[ofs2] = 0; return 0;} + var wrap = 0; + for(var i = 0; i < len1; i++){ + var a = nat1.data[ofs1 + i] >>> 0; + nat1.data[ofs1 + i] = a << nbits | wrap; + wrap = a >>> 32 - nbits; + } + nat2.data[ofs2] = wrap; + return 0; + } + function MlNat(x){ + this.data = new Int32Array(x); + this.length = this.data.length + 2; + } + MlNat.prototype.caml_custom = "_nat"; + function create_nat(size){ + var arr = new MlNat(size); + for(var i = 0; i < size; i++) arr.data[i] = - 1; + return arr; + } + function set_to_zero_nat(nat, ofs, len){ + for(var i = 0; i < len; i++) nat.data[ofs + i] = 0; + return 0; + } + function incr_nat(nat, ofs, len, carry_in){ + var carry = carry_in; + for(var i = 0; i < len; i++){ + var x = (nat.data[ofs + i] >>> 0) + carry; + nat.data[ofs + i] = x | 0; + if(x == x >>> 0){carry = 0; break;} else carry = 1; + } + return carry; + } + function add_nat(nat1, ofs1, len1, nat2, ofs2, len2, carry_in){ + var carry = carry_in; + for(var i = 0; i < len2; i++){ + var + x = (nat1.data[ofs1 + i] >>> 0) + (nat2.data[ofs2 + i] >>> 0) + carry; + nat1.data[ofs1 + i] = x; + if(x == x >>> 0) carry = 0; else carry = 1; + } + return incr_nat(nat1, ofs1 + len2, len1 - len2, carry); + } + function nat_of_array(l){return new MlNat(l);} + function mult_digit_nat(nat1, ofs1, len1, nat2, ofs2, len2, nat3, ofs3){ + var carry = 0, a = nat3.data[ofs3] >>> 0; + for(var i = 0; i < len2; i++){ + var + x1 = + (nat1.data[ofs1 + i] >>> 0) + + (nat2.data[ofs2 + i] >>> 0) * (a & 0x0000FFFF) + + carry, + x2 = (nat2.data[ofs2 + i] >>> 0) * (a >>> 16); + carry = Math.floor(x2 / 65536); + var x3 = x1 + x2 % 65536 * 65536; + nat1.data[ofs1 + i] = x3; + carry += Math.floor(x3 / 4294967296); + } + return len2 < len1 && carry + ? add_nat + (nat1, ofs1 + len2, len1 - len2, nat_of_array([carry]), 0, 1, 0) + : carry; + } + function decr_nat(nat, ofs, len, carry_in){ + var borrow = carry_in == 1 ? 0 : 1; + for(var i = 0; i < len; i++){ + var x = (nat.data[ofs + i] >>> 0) - borrow; + nat.data[ofs + i] = x; + if(x >= 0){borrow = 0; break;} else borrow = 1; + } + return borrow == 1 ? 0 : 1; + } + function sub_nat(nat1, ofs1, len1, nat2, ofs2, len2, carry_in){ + var borrow = carry_in == 1 ? 0 : 1; + for(var i = 0; i < len2; i++){ + var + x = (nat1.data[ofs1 + i] >>> 0) - (nat2.data[ofs2 + i] >>> 0) - borrow; + nat1.data[ofs1 + i] = x; + if(x >= 0) borrow = 0; else borrow = 1; + } + return decr_nat(nat1, ofs1 + len2, len1 - len2, borrow == 1 ? 0 : 1); + } + function compare_nat(nat1, ofs1, len1, nat2, ofs2, len2){ + var + a = num_digits_nat(nat1, ofs1, len1), + b = num_digits_nat(nat2, ofs2, len2); + if(a > b) return 1; + if(a < b) return - 1; + for(var i = len1 - 1; i >= 0; i--){ + if(nat1.data[ofs1 + i] >>> 0 > nat2.data[ofs2 + i] >>> 0) return 1; + if(nat1.data[ofs1 + i] >>> 0 < nat2.data[ofs2 + i] >>> 0) return - 1; + } + return 0; + } + function div_nat(nat1, ofs1, len1, nat2, ofs2, len2){ + if(len2 == 1){ + div_digit_nat(nat1, ofs1 + 1, nat1, ofs1, nat1, ofs1, len1, nat2, ofs2); + return 0; + } + var s = num_leading_zero_bits_in_digit(nat2, ofs2 + len2 - 1); + shift_left_nat(nat2, ofs2, len2, nat_of_array([0]), 0, s); + shift_left_nat(nat1, ofs1, len1, nat_of_array([0]), 0, s); + var d = (nat2.data[ofs2 + len2 - 1] >>> 0) + 1, a = create_nat(len2 + 1); + for(var i = len1 - 1; i >= len2; i--){ + var + quo = + d == 4294967296 + ? nat1.data[ofs1 + i] >>> 0 + : div_helper + (nat1.data[ofs1 + i] >>> 0, nat1.data[ofs1 + i - 1] >>> 0, d) + [0]; + set_to_zero_nat(a, 0, len2 + 1); + mult_digit_nat(a, 0, len2 + 1, nat2, ofs2, len2, nat_of_array([quo]), 0); + sub_nat(nat1, ofs1 + i - len2, len2 + 1, a, 0, len2 + 1, 1); + while + (nat1.data[ofs1 + i] != 0 + || compare_nat(nat1, ofs1 + i - len2, len2, nat2, ofs2, len2) >= 0){ + quo = quo + 1; + sub_nat(nat1, ofs1 + i - len2, len2 + 1, nat2, ofs2, len2, 1); + } + nat1.data[ofs1 + i] = quo; + } + shift_right_nat(nat1, ofs1, len2, nat_of_array([0]), 0, s); + shift_right_nat(nat2, ofs2, len2, nat_of_array([0]), 0, s); + return 0; + } + function caml_ba_blit(src, dst){ + if(dst.dims.length != src.dims.length) + caml_invalid_argument("Bigarray.blit: dimension mismatch"); + for(var i = 0; i < dst.dims.length; i++) + if(dst.dims[i] != src.dims[i]) + caml_invalid_argument("Bigarray.blit: dimension mismatch"); + dst.data.set(src.data); + return 0; + } + function is_digit_int(nat, ofs){if(nat.data[ofs] >= 0) return 1; return 0;} + function caml_int64_div(x, y){return x.div(y);} + function caml_js_html_entities(s){ + var entity = /^&#?[0-9a-zA-Z]+;$/; + if(s.match(entity)){ + var str, temp = document.createElement("p"); + temp.innerHTML = s; + str = temp.textContent || temp.innerText; + temp = null; + return str; + } + else + caml_failwith("Invalid entity " + s); + } + function caml_string_unsafe_set(s, i, c){ + caml_failwith("caml_string_unsafe_set"); + } + function caml_int64_of_float(x){ + if(x < 0) x = Math.ceil(x); + return new + MlInt64 + (x & 0xffffff, + Math.floor(x * caml_int64_offset) & 0xffffff, + Math.floor(x * caml_int64_offset * caml_int64_offset) & 0xffff); + } + function caml_ml_channel_size_64(chanid){ + var chan = caml_ml_channels[chanid]; + return caml_int64_of_float(chan.file.length()); + } + function caml_ba_set_2(ba, i0, i1, v){ + ba.set(ba.offset([i0, i1]), v); + return 0; + } + var + caml_argv = + function(){ + var process = globalThis.process, main = "a.out", args = []; + if(process && process.argv && process.argv.length > 1){ + var argv = process.argv; + main = argv[1]; + args = argv.slice(2); + } + var p = caml_string_of_jsstring(main), args2 = [0, p]; + for(var i = 0; i < args.length; i++) + args2.push(caml_string_of_jsstring(args[i])); + return args2; + } + (), + caml_executable_name = caml_argv[1]; + function caml_js_eval_string(s){return eval(caml_jsstring_of_string(s));} + function serialize_nat(writer, nat, sz){ + var len = nat.data.length; + writer.write(32, len); + for(var i = 0; i < len; i++) writer.write(32, nat.data[i]); + sz[0] = len * 4; + sz[1] = len * 8; + } + function caml_memprof_set(_control){return 0;} + function caml_sys_exit(code){ + if(globalThis.quit) globalThis.quit(code); + if(globalThis.process && globalThis.process.exit) + globalThis.process.exit(code); + caml_invalid_argument("Function 'exit' not implemented"); + } + function caml_channel_descriptor(chanid){ + var chan = caml_ml_channels[chanid]; + return chan.fd; + } + function caml_js_from_array(a){return a.slice(1);} + function caml_ba_reshape(ba, vind){ + vind = caml_js_from_array(vind); + var new_dim = [], num_dims = vind.length; + if(num_dims < 0 || num_dims > 16) + caml_invalid_argument("Bigarray.reshape: bad number of dimensions"); + var num_elts = 1; + for(var i = 0; i < num_dims; i++){ + new_dim[i] = vind[i]; + if(new_dim[i] < 0) + caml_invalid_argument("Bigarray.reshape: negative dimension"); + num_elts = num_elts * new_dim[i]; + } + var size = caml_ba_get_size(ba.dims); + if(num_elts != size) + caml_invalid_argument("Bigarray.reshape: size mismatch"); + return caml_ba_create_unsafe(ba.kind, ba.layout, new_dim, ba.data); + } + var caml_oo_last_id = 0; + function caml_set_oo_id(b){b[2] = caml_oo_last_id++; return b;} + function caml_gr_fill_rect(x, y, w, h){ + var s = caml_gr_state_get(); + s.context.fillRect(x, s.height - y, w, - h); + return 0; + } + function caml_bigstring_blit_string_to_ba(str1, pos1, ba2, pos2, len){ + if(12 != ba2.kind) + caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch"); + if(len == 0) return 0; + var ofs2 = ba2.offset(pos2); + if(pos1 + len > caml_ml_string_length(str1)) caml_array_bound_error(); + if(ofs2 + len > ba2.data.length) caml_array_bound_error(); + var slice = caml_uint8_array_of_string(str1).slice(pos1, pos1 + len); + ba2.data.set(slice, ofs2); + return 0; + } + function caml_gr_set_window_title(name){ + var s = caml_gr_state_get(); + s.title = name; + var jsname = caml_jsstring_of_string(name); + if(s.set_title) s.set_title(jsname); + return 0; + } + function caml_get_global_data(){return caml_global_data;} + function caml_int64_shift_right_unsigned(x, s){return x.shift_right_unsigned(s); + } + function caml_ba_uint8_get16(ba, i0){ + var ofs = ba.offset(i0); + if(ofs + 1 >= ba.data.length) caml_array_bound_error(); + var b1 = ba.get(ofs), b2 = ba.get(ofs + 1); + return b1 | b2 << 8; + } + function caml_compare(a, b){return caml_compare_val(a, b, true);} + var + caml_MD5Transform = + function(){ + function add(x, y){return x + y | 0;} + function xx(q, a, b, x, s, t){ + a = add(add(a, q), add(x, t)); + return add(a << s | a >>> 32 - s, b); + } + function ff(a, b, c, d, x, s, t){ + return xx(b & c | ~ b & d, a, b, x, s, t); + } + function gg(a, b, c, d, x, s, t){ + return xx(b & d | c & ~ d, a, b, x, s, t); + } + function hh(a, b, c, d, x, s, t){return xx(b ^ c ^ d, a, b, x, s, t);} + function ii(a, b, c, d, x, s, t){ + return xx(c ^ (b | ~ d), a, b, x, s, t); + } + return function(w, buffer){ + var a = w[0], b = w[1], c = w[2], d = w[3]; + a = ff(a, b, c, d, buffer[0], 7, 0xD76AA478); + d = ff(d, a, b, c, buffer[1], 12, 0xE8C7B756); + c = ff(c, d, a, b, buffer[2], 17, 0x242070DB); + b = ff(b, c, d, a, buffer[3], 22, 0xC1BDCEEE); + a = ff(a, b, c, d, buffer[4], 7, 0xF57C0FAF); + d = ff(d, a, b, c, buffer[5], 12, 0x4787C62A); + c = ff(c, d, a, b, buffer[6], 17, 0xA8304613); + b = ff(b, c, d, a, buffer[7], 22, 0xFD469501); + a = ff(a, b, c, d, buffer[8], 7, 0x698098D8); + d = ff(d, a, b, c, buffer[9], 12, 0x8B44F7AF); + c = ff(c, d, a, b, buffer[10], 17, 0xFFFF5BB1); + b = ff(b, c, d, a, buffer[11], 22, 0x895CD7BE); + a = ff(a, b, c, d, buffer[12], 7, 0x6B901122); + d = ff(d, a, b, c, buffer[13], 12, 0xFD987193); + c = ff(c, d, a, b, buffer[14], 17, 0xA679438E); + b = ff(b, c, d, a, buffer[15], 22, 0x49B40821); + a = gg(a, b, c, d, buffer[1], 5, 0xF61E2562); + d = gg(d, a, b, c, buffer[6], 9, 0xC040B340); + c = gg(c, d, a, b, buffer[11], 14, 0x265E5A51); + b = gg(b, c, d, a, buffer[0], 20, 0xE9B6C7AA); + a = gg(a, b, c, d, buffer[5], 5, 0xD62F105D); + d = gg(d, a, b, c, buffer[10], 9, 0x02441453); + c = gg(c, d, a, b, buffer[15], 14, 0xD8A1E681); + b = gg(b, c, d, a, buffer[4], 20, 0xE7D3FBC8); + a = gg(a, b, c, d, buffer[9], 5, 0x21E1CDE6); + d = gg(d, a, b, c, buffer[14], 9, 0xC33707D6); + c = gg(c, d, a, b, buffer[3], 14, 0xF4D50D87); + b = gg(b, c, d, a, buffer[8], 20, 0x455A14ED); + a = gg(a, b, c, d, buffer[13], 5, 0xA9E3E905); + d = gg(d, a, b, c, buffer[2], 9, 0xFCEFA3F8); + c = gg(c, d, a, b, buffer[7], 14, 0x676F02D9); + b = gg(b, c, d, a, buffer[12], 20, 0x8D2A4C8A); + a = hh(a, b, c, d, buffer[5], 4, 0xFFFA3942); + d = hh(d, a, b, c, buffer[8], 11, 0x8771F681); + c = hh(c, d, a, b, buffer[11], 16, 0x6D9D6122); + b = hh(b, c, d, a, buffer[14], 23, 0xFDE5380C); + a = hh(a, b, c, d, buffer[1], 4, 0xA4BEEA44); + d = hh(d, a, b, c, buffer[4], 11, 0x4BDECFA9); + c = hh(c, d, a, b, buffer[7], 16, 0xF6BB4B60); + b = hh(b, c, d, a, buffer[10], 23, 0xBEBFBC70); + a = hh(a, b, c, d, buffer[13], 4, 0x289B7EC6); + d = hh(d, a, b, c, buffer[0], 11, 0xEAA127FA); + c = hh(c, d, a, b, buffer[3], 16, 0xD4EF3085); + b = hh(b, c, d, a, buffer[6], 23, 0x04881D05); + a = hh(a, b, c, d, buffer[9], 4, 0xD9D4D039); + d = hh(d, a, b, c, buffer[12], 11, 0xE6DB99E5); + c = hh(c, d, a, b, buffer[15], 16, 0x1FA27CF8); + b = hh(b, c, d, a, buffer[2], 23, 0xC4AC5665); + a = ii(a, b, c, d, buffer[0], 6, 0xF4292244); + d = ii(d, a, b, c, buffer[7], 10, 0x432AFF97); + c = ii(c, d, a, b, buffer[14], 15, 0xAB9423A7); + b = ii(b, c, d, a, buffer[5], 21, 0xFC93A039); + a = ii(a, b, c, d, buffer[12], 6, 0x655B59C3); + d = ii(d, a, b, c, buffer[3], 10, 0x8F0CCC92); + c = ii(c, d, a, b, buffer[10], 15, 0xFFEFF47D); + b = ii(b, c, d, a, buffer[1], 21, 0x85845DD1); + a = ii(a, b, c, d, buffer[8], 6, 0x6FA87E4F); + d = ii(d, a, b, c, buffer[15], 10, 0xFE2CE6E0); + c = ii(c, d, a, b, buffer[6], 15, 0xA3014314); + b = ii(b, c, d, a, buffer[13], 21, 0x4E0811A1); + a = ii(a, b, c, d, buffer[4], 6, 0xF7537E82); + d = ii(d, a, b, c, buffer[11], 10, 0xBD3AF235); + c = ii(c, d, a, b, buffer[2], 15, 0x2AD7D2BB); + b = ii(b, c, d, a, buffer[9], 21, 0xEB86D391); + w[0] = add(a, w[0]); + w[1] = add(b, w[1]); + w[2] = add(c, w[2]); + w[3] = add(d, w[3]);}; + } + (); + function caml_MD5Update(ctx, input, input_len){ + var in_buf = ctx.len & 0x3f, input_pos = 0; + ctx.len += input_len; + if(in_buf){ + var missing = 64 - in_buf; + if(input_len < missing){ + ctx.b8.set(input.subarray(0, input_len), in_buf); + return; + } + ctx.b8.set(input.subarray(0, missing), in_buf); + caml_MD5Transform(ctx.w, ctx.b32); + input_len -= missing; + input_pos += missing; + } + while(input_len >= 64){ + ctx.b8.set(input.subarray(input_pos, input_pos + 64), 0); + caml_MD5Transform(ctx.w, ctx.b32); + input_len -= 64; + input_pos += 64; + } + if(input_len) + ctx.b8.set(input.subarray(input_pos, input_pos + input_len), 0); + } + function caml_runtime_events_read_poll(cursor, callbacks, num){return 0;} + function caml_fresh_oo_id(){return caml_oo_last_id++;} + function caml_int64_to_float(x){return x.toFloat();} + function caml_ba_get_1(ba, i0){return ba.get(ba.offset(i0));} + function caml_bigstring_memcmp(s1, pos1, s2, pos2, len){ + for(var i = 0; i < len; i++){ + var a = caml_ba_get_1(s1, pos1 + i), b = caml_ba_get_1(s2, pos2 + i); + if(a < b) return - 1; + if(a > b) return 1; + } + return 0; + } + function caml_new_string(s){return caml_string_of_jsbytes(s);} + function caml_erf_float(x){ + var + a1 = 0.254829592, + a2 = - 0.284496736, + a3 = 1.421413741, + a4 = - 1.453152027, + a5 = 1.061405429, + p = 0.3275911, + sign = 1; + if(x < 0) sign = - 1; + x = Math.abs(x); + var + t = 1.0 / (1.0 + p * x), + y = + 1.0 + - + ((((a5 * t + a4) * t + a3) * t + a2) * t + a1) * t + * Math.exp(- (x * x)); + return sign * y; + } + function caml_ba_uint8_get32(ba, i0){ + var ofs = ba.offset(i0); + if(ofs + 3 >= ba.data.length) caml_array_bound_error(); + var + b1 = ba.get(ofs + 0), + b2 = ba.get(ofs + 1), + b3 = ba.get(ofs + 2), + b4 = ba.get(ofs + 3); + return b1 << 0 | b2 << 8 | b3 << 16 | b4 << 24; + } + function caml_raw_backtrace_length(){return 0;} + function caml_str_initialize(unit){return 0;} + function caml_obj_block(tag, size){ + var o = new Array(size + 1); + o[0] = tag; + for(var i = 1; i <= size; i++) o[i] = 0; + return o; + } + function caml_gr_clear_graph(){ + var s = caml_gr_state_get(); + s.canvas.width = s.width; + s.canvas.height = s.height; + return 0; + } + function bigstring_to_array_buffer(bs){return bs.data.buffer;} + function caml_sys_const_naked_pointers_checked(_unit){return 0;} + function lxor_digit_nat(nat1, ofs1, nat2, ofs2){nat1.data[ofs1] ^= nat2.data[ofs2]; return 0; + } + function caml_obj_add_offset(v, offset){ + caml_failwith("Obj.add_offset is not supported"); + } + function caml_final_release(){return 0;} + var caml_marshal_header_size = 20; + function caml_js_to_array(a){ + var len = a.length, b = new Array(len + 1); + b[0] = 0; + for(var i = 0; i < len; i++) b[i + 1] = a[i]; + return b; + } + function caml_sys_is_regular_file(name){ + var root = resolve_fs_device(name); + return root.device.isFile(root.rest); + } + function caml_gr_plot(x, y){ + var + s = caml_gr_state_get(), + im = s.context.createImageData(1, 1), + d = im.data, + color = s.color; + d[0] = color >> 16 & 0xff; + d[1] = color >> 8 & 0xff, d[2] = color >> 0 & 0xff; + d[3] = 0xFF; + s.x = x; + s.y = y; + s.context.putImageData(im, x, s.height - y); + return 0; + } + function caml_bytes_set64(s, i, i64){ + if(i >>> 0 >= s.l - 7) caml_bytes_bound_error(); + var a = caml_int64_to_bytes(i64); + for(var j = 0; j < 8; j++) caml_bytes_unsafe_set(s, i + 7 - j, a[j]); + return 0; + } + function caml_string_set16(s, i, i16){caml_failwith("caml_string_set16");} + function caml_int64_bswap(x){ + var y = caml_int64_to_bytes(x); + return caml_int64_of_bytes + ([y[7], y[6], y[5], y[4], y[3], y[2], y[1], y[0]]); + } + function caml_gc_major(unit){ + if(typeof globalThis.gc == "function") globalThis.gc(); + return 0; + } + function caml_lex_array(s){ + s = caml_jsbytes_of_string(s); + var l = s.length / 2, a = new Array(l); + for(var i = 0; i < l; i++) + a[i] = (s.charCodeAt(2 * i) | s.charCodeAt(2 * i + 1) << 8) << 16 >> 16; + return a; + } + function caml_lex_engine(tbl, start_state, lexbuf){ + var + lex_buffer = 2, + lex_buffer_len = 3, + lex_start_pos = 5, + lex_curr_pos = 6, + lex_last_pos = 7, + lex_last_action = 8, + lex_eof_reached = 9, + lex_base = 1, + lex_backtrk = 2, + lex_default = 3, + lex_trans = 4, + lex_check = 5; + if(! tbl.lex_default){ + tbl.lex_base = caml_lex_array(tbl[lex_base]); + tbl.lex_backtrk = caml_lex_array(tbl[lex_backtrk]); + tbl.lex_check = caml_lex_array(tbl[lex_check]); + tbl.lex_trans = caml_lex_array(tbl[lex_trans]); + tbl.lex_default = caml_lex_array(tbl[lex_default]); + } + var + c, + state = start_state, + buffer = caml_uint8_array_of_bytes(lexbuf[lex_buffer]); + if(state >= 0){ + lexbuf[lex_last_pos] = lexbuf[lex_start_pos] = lexbuf[lex_curr_pos]; + lexbuf[lex_last_action] = - 1; + } + else + state = - state - 1; + for(;;){ + var base = tbl.lex_base[state]; + if(base < 0) return - base - 1; + var backtrk = tbl.lex_backtrk[state]; + if(backtrk >= 0){ + lexbuf[lex_last_pos] = lexbuf[lex_curr_pos]; + lexbuf[lex_last_action] = backtrk; + } + if(lexbuf[lex_curr_pos] >= lexbuf[lex_buffer_len]) + if(lexbuf[lex_eof_reached] == 0) return - state - 1; else c = 256; + else{c = buffer[lexbuf[lex_curr_pos]]; lexbuf[lex_curr_pos]++;} + if(tbl.lex_check[base + c] == state) + state = tbl.lex_trans[base + c]; + else + state = tbl.lex_default[state]; + if(state < 0){ + lexbuf[lex_curr_pos] = lexbuf[lex_last_pos]; + if(lexbuf[lex_last_action] == - 1) + caml_failwith("lexing: empty token"); + else + return lexbuf[lex_last_action]; + } + else if(c == 256) lexbuf[lex_eof_reached] = 0; + } + } + function caml_sys_file_exists(name){ + var root = resolve_fs_device(name); + return root.device.exists(root.rest); + } + function caml_convert_raw_backtrace_slot(){ + caml_failwith("caml_convert_raw_backtrace_slot"); + } + function caml_array_sub(a, i, len){ + var a2 = new Array(len + 1); + a2[0] = 0; + for(var i2 = 1, i1 = i + 1; i2 <= len; i2++, i1++) a2[i2] = a[i1]; + return a2; + } + function caml_bytes_equal(s1, s2){ + if(s1 === s2) return 1; + s1.t & 6 && caml_convert_string_to_bytes(s1); + s2.t & 6 && caml_convert_string_to_bytes(s2); + return s1.c == s2.c ? 1 : 0; + } + function caml_gr_size_x(){var s = caml_gr_state_get(); return s.width;} + function caml_ml_debug_info_status(){return 0;} + function caml_atomic_fetch_add(ref, i){ + var old = ref[1]; + ref[1] += i; + return old; + } + var + os_type = + globalThis.process && globalThis.process.platform + && globalThis.process.platform == "win32" + ? "Cygwin" + : "Unix"; + function caml_sys_const_ostype_cygwin(){return os_type == "Cygwin" ? 1 : 0; + } + function caml_cosh_float(x){return Math.cosh(x);} + function MlMutex(){this.locked = false;} + function caml_ml_mutex_new(unit){return new MlMutex();} + var caml_ephe_key_offset = 3; + function caml_ephe_check_key(x, i){ + var weak = x[caml_ephe_key_offset + i]; + if(globalThis.WeakRef && weak instanceof globalThis.WeakRef) + weak = weak.deref(); + return weak === undefined ? 0 : 1; + } + function caml_hash_mix_final(h){ + h ^= h >>> 16; + h = caml_mul(h, 0x85ebca6b | 0); + h ^= h >>> 13; + h = caml_mul(h, 0xc2b2ae35 | 0); + h ^= h >>> 16; + return h; + } + function caml_gr_text_size(txt){ + var + s = caml_gr_state_get(), + w = s.context.measureText(caml_jsstring_of_string(txt)).width; + return [0, w, s.text_size]; + } + function caml_lex_run_mem(s, i, mem, curr_pos){ + for(;;){ + var dst = s.charCodeAt(i); + i++; + if(dst == 0xff) return; + var src = s.charCodeAt(i); + i++; + if(src == 0xff) + mem[dst + 1] = curr_pos; + else + mem[dst + 1] = mem[src + 1]; + } + } + function caml_lex_run_tag(s, i, mem){ + for(;;){ + var dst = s.charCodeAt(i); + i++; + if(dst == 0xff) return; + var src = s.charCodeAt(i); + i++; + if(src == 0xff) mem[dst + 1] = - 1; else mem[dst + 1] = mem[src + 1]; + } + } + function caml_new_lex_engine(tbl, start_state, lexbuf){ + var + lex_buffer = 2, + lex_buffer_len = 3, + lex_start_pos = 5, + lex_curr_pos = 6, + lex_last_pos = 7, + lex_last_action = 8, + lex_eof_reached = 9, + lex_mem = 10, + lex_base = 1, + lex_backtrk = 2, + lex_default = 3, + lex_trans = 4, + lex_check = 5, + lex_base_code = 6, + lex_backtrk_code = 7, + lex_default_code = 8, + lex_trans_code = 9, + lex_check_code = 10, + lex_code = 11; + if(! tbl.lex_default){ + tbl.lex_base = caml_lex_array(tbl[lex_base]); + tbl.lex_backtrk = caml_lex_array(tbl[lex_backtrk]); + tbl.lex_check = caml_lex_array(tbl[lex_check]); + tbl.lex_trans = caml_lex_array(tbl[lex_trans]); + tbl.lex_default = caml_lex_array(tbl[lex_default]); + } + if(! tbl.lex_default_code){ + tbl.lex_base_code = caml_lex_array(tbl[lex_base_code]); + tbl.lex_backtrk_code = caml_lex_array(tbl[lex_backtrk_code]); + tbl.lex_check_code = caml_lex_array(tbl[lex_check_code]); + tbl.lex_trans_code = caml_lex_array(tbl[lex_trans_code]); + tbl.lex_default_code = caml_lex_array(tbl[lex_default_code]); + } + if(tbl.lex_code == null) + tbl.lex_code = caml_jsbytes_of_string(tbl[lex_code]); + var + c, + state = start_state, + buffer = caml_uint8_array_of_bytes(lexbuf[lex_buffer]); + if(state >= 0){ + lexbuf[lex_last_pos] = lexbuf[lex_start_pos] = lexbuf[lex_curr_pos]; + lexbuf[lex_last_action] = - 1; + } + else + state = - state - 1; + for(;;){ + var base = tbl.lex_base[state]; + if(base < 0){ + var pc_off = tbl.lex_base_code[state]; + caml_lex_run_tag(tbl.lex_code, pc_off, lexbuf[lex_mem]); + return - base - 1; + } + var backtrk = tbl.lex_backtrk[state]; + if(backtrk >= 0){ + var pc_off = tbl.lex_backtrk_code[state]; + caml_lex_run_tag(tbl.lex_code, pc_off, lexbuf[lex_mem]); + lexbuf[lex_last_pos] = lexbuf[lex_curr_pos]; + lexbuf[lex_last_action] = backtrk; + } + if(lexbuf[lex_curr_pos] >= lexbuf[lex_buffer_len]) + if(lexbuf[lex_eof_reached] == 0) return - state - 1; else c = 256; + else{c = buffer[lexbuf[lex_curr_pos]]; lexbuf[lex_curr_pos]++;} + var pstate = state; + if(tbl.lex_check[base + c] == state) + state = tbl.lex_trans[base + c]; + else + state = tbl.lex_default[state]; + if(state < 0){ + lexbuf[lex_curr_pos] = lexbuf[lex_last_pos]; + if(lexbuf[lex_last_action] == - 1) + caml_failwith("lexing: empty token"); + else + return lexbuf[lex_last_action]; + } + else{ + var base_code = tbl.lex_base_code[pstate], pc_off; + if(tbl.lex_check_code[base_code + c] == pstate) + pc_off = tbl.lex_trans_code[base_code + c]; + else + pc_off = tbl.lex_default_code[pstate]; + if(pc_off > 0) + caml_lex_run_mem + (tbl.lex_code, pc_off, lexbuf[lex_mem], lexbuf[lex_curr_pos]); + if(c == 256) lexbuf[lex_eof_reached] = 0; + } + } + } + function caml_ba_uint8_set64(ba, i0, v){ + var ofs = ba.offset(i0); + if(ofs + 7 >= ba.data.length) caml_array_bound_error(); + var v = caml_int64_to_bytes(v); + for(var i = 0; i < 8; i++) ba.set(ofs + i, v[7 - i]); + return 0; + } + function caml_sys_executable_name(a){return caml_executable_name;} + function caml_lessequal(x, y){ + return + (caml_compare_val(x, y, false) <= 0); + } + function caml_acosh_float(x){return Math.acosh(x);} + function caml_MD5Init(){ + var + buffer = new ArrayBuffer(64), + b32 = new Uint32Array(buffer), + b8 = new Uint8Array(buffer); + return {len: 0, + w: + new Uint32Array([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476]), + b32: b32, + b8: b8}; + } + function caml_ml_flush(chanid){ + var chan = caml_ml_channels[chanid]; + if(! chan.opened) caml_raise_sys_error("Cannot flush a closed channel"); + if(! chan.buffer || chan.buffer_curr == 0) return 0; + if(chan.output) + chan.output(caml_subarray_to_jsbytes(chan.buffer, 0, chan.buffer_curr)); + else + chan.file.write(chan.offset, chan.buffer, 0, chan.buffer_curr); + chan.offset += chan.buffer_curr; + chan.buffer_curr = 0; + return 0; + } + function caml_seek_out(chanid, pos){ + caml_ml_flush(chanid); + var chan = caml_ml_channels[chanid]; + chan.offset = pos; + return 0; + } + function caml_ml_seek_out_64(chanid, pos){ + var pos = caml_int64_to_float(pos); + return caml_seek_out(chanid, pos); + } + function compare_nat_real(nat1, nat2){ + return compare_nat(nat1, 0, nat1.data.length, nat2, 0, nat2.data.length); + } + function caml_gc_set(_control){return 0;} + function caml_js_get(o, f){return o[f];} + function caml_unix_isatty(fileDescriptor){ + if(fs_node_supported()){ + var tty = require("tty"); + return tty.isatty(fileDescriptor) ? 1 : 0; + } + else + return 0; + } + function caml_ml_set_buffered(chanid, v){ + caml_ml_channels[chanid].buffered = v; + if(! v) caml_ml_flush(chanid); + return 0; + } + function caml_gc_compaction(){return 0;} + function caml_ephe_get_key(x, i){ + if(i < 0 || caml_ephe_key_offset + i >= x.length) + caml_invalid_argument("Weak.get_key"); + var weak = x[caml_ephe_key_offset + i]; + if(globalThis.WeakRef && weak instanceof globalThis.WeakRef) + weak = weak.deref(); + return weak === undefined ? 0 : [0, weak]; + } + function caml_unix_localtime(t){ + var + d = new Date(t * 1000), + d_num = d.getTime(), + januaryfirst = new Date(d.getFullYear(), 0, 1).getTime(), + doy = Math.floor((d_num - januaryfirst) / 86400000), + jan = new Date(d.getFullYear(), 0, 1), + jul = new Date(d.getFullYear(), 6, 1), + stdTimezoneOffset = + Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); + return [0, + d.getSeconds(), + d.getMinutes(), + d.getHours(), + d.getDate(), + d.getMonth(), + d.getFullYear() - 1900, + d.getDay(), + doy, + d.getTimezoneOffset() < stdTimezoneOffset | 0]; + } + function caml_unix_mktime(tm){ + var + d = new Date(tm[6] + 1900, tm[5], tm[4], tm[3], tm[2], tm[1]).getTime(), + t = Math.floor(d / 1000), + tm2 = caml_unix_localtime(t); + return [0, t, tm2]; + } + function caml_bigstring_blit_bytes_to_ba(str1, pos1, ba2, pos2, len){ + if(12 != ba2.kind) + caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch"); + if(len == 0) return 0; + var ofs2 = ba2.offset(pos2); + if(pos1 + len > caml_ml_bytes_length(str1)) caml_array_bound_error(); + if(ofs2 + len > ba2.data.length) caml_array_bound_error(); + var slice = caml_uint8_array_of_bytes(str1).slice(pos1, pos1 + len); + ba2.data.set(slice, ofs2); + return 0; + } + var caml_sys_fds = new Array(3); + function caml_sys_close(fd){ + var file = caml_sys_fds[fd]; + if(file) file.close(); + delete caml_sys_fds[fd]; + return 0; + } + function caml_ml_close_channel(chanid){ + var chan = caml_ml_channels[chanid]; + chan.opened = false; + caml_sys_close(chan.fd); + return 0; + } + function caml_atomic_exchange(ref, v){ + var r = ref[1]; + ref[1] = v; + return r; + } + function caml_sys_isatty(_chan){return 0;} + function is_digit_zero(nat, ofs){ + if(nat.data[ofs] == 0) return 1; + return 0; + } + function caml_unix_lstat(name){ + var root = resolve_fs_device(name); + if(! root.device.lstat) caml_failwith("caml_unix_lstat: not implemented"); + return root.device.lstat(root.rest, true); + } + function caml_unix_lstat_64(name){ + var r = caml_unix_lstat(name); + r[9] = caml_int64_of_int32(r[9]); + } + function caml_js_set(o, f, v){o[f] = v; return 0;} + function caml_array_get(array, index){ + if(index < 0 || index >= array.length - 1) caml_array_bound_error(); + return array[index + 1]; + } + function caml_continuation_use_noexc(cont){ + var stack = cont[1]; + cont[1] = 0; + return stack; + } + function caml_unix_rmdir(name){ + var root = resolve_fs_device(name); + if(! root.device.rmdir) caml_failwith("caml_unix_rmdir: not implemented"); + return root.device.rmdir(root.rest, true); + } + function caml_log2_float(x){return Math.log2(x);} + function caml_gc_huge_fallback_count(unit){return 0;} + function caml_runtime_events_resume(){return 0;} + function caml_spacetime_only_works_for_native_code(){ + caml_failwith("Spacetime profiling only works for native code"); + } + function caml_int64_sub(x, y){return x.sub(y);} + function caml_seek_in(chanid, pos){ + var chan = caml_ml_channels[chanid]; + if(chan.refill != null) caml_raise_sys_error("Illegal seek"); + if + (pos >= chan.offset - chan.buffer_max && pos <= chan.offset + && chan.file.flags.binary) + chan.buffer_curr = chan.buffer_max - (chan.offset - pos); + else{chan.offset = pos; chan.buffer_curr = 0; chan.buffer_max = 0;} + return 0; + } + function caml_ml_seek_in_64(chanid, pos){ + var pos = caml_int64_to_float(pos); + return caml_seek_in(chanid, pos); + } + var caml_domain_id = 0; + function caml_ml_mutex_unlock(t){t.locked = false; return 0;} + var caml_domain_latest_idx = 1; + function caml_domain_spawn(f, mutex){ + var id = caml_domain_latest_idx++, old = caml_domain_id; + caml_domain_id = id; + caml_callback(f, [0]); + caml_domain_id = old; + caml_ml_mutex_unlock(mutex); + return id; + } + function caml_unix_mkdir(name, perm){ + var root = resolve_fs_device(name); + if(! root.device.mkdir) caml_failwith("caml_unix_mkdir: not implemented"); + return root.device.mkdir(root.rest, perm, true); + } + function caml_int64_shift_left(x, s){return x.shift_left(s);} + function caml_notequal(x, y){ + return + (caml_compare_val(x, y, false) != 0); + } + function caml_sys_const_int_size(){return 32;} + function caml_js_wrap_callback(f){ + return function(){ + var len = arguments.length; + if(len > 0){ + var args = new Array(len); + for(var i = 0; i < len; i++) args[i] = arguments[i]; + } + else + args = [undefined]; + var res = caml_callback(f, args); + return res instanceof Function ? caml_js_wrap_callback(res) : res;}; + } + function caml_js_wrap_meth_callback(f){ + return function(){ + var len = arguments.length, args = new Array(len + 1); + args[0] = this; + for(var i = 0; i < len; i++) args[i + 1] = arguments[i]; + var res = caml_callback(f, args); + return res instanceof Function ? caml_js_wrap_callback(res) : res;}; + } + function caml_is_js(){return 1;} + function caml_lazy_update_to_forward(o){ + caml_obj_update_tag(o, 244, 250); + return 0; + } + function caml_ba_dim(ba, i){ + if(i < 0 || i >= ba.dims.length) caml_invalid_argument("Bigarray.dim"); + return ba.dims[i]; + } + function caml_ba_dim_1(ba){return caml_ba_dim(ba, 0);} + function caml_js_meth_call(o, f, args){ + return o[caml_jsstring_of_string(f)].apply(o, caml_js_from_array(args)); + } + var caml_ephe_data_offset = 2; + function caml_weak_create(n){ + if(n < 0) caml_invalid_argument("Weak.create"); + var x = [251, "caml_ephe_list_head"]; + x.length = caml_ephe_key_offset + n; + return x; + } + function caml_ephe_create(n){var x = caml_weak_create(n); return x;} + function caml_js_to_byte_string(s){return caml_string_of_jsbytes(s);} + function caml_trampoline(res){ + var c = 1; + while(res && res.joo_tramp){ + res = res.joo_tramp.apply(null, res.joo_args); + c++; + } + return res; + } + function caml_maybe_print_stats(unit){return 0;} + function caml_bytes_unsafe_get(s, i){ + switch(s.t & 6){ + default: if(i >= s.c.length) return 0; + case 0: + return s.c.charCodeAt(i); + case 4: + return s.c[i]; + } + } + function caml_bytes_get64(s, i){ + if(i >>> 0 >= s.l - 7) caml_bytes_bound_error(); + var a = new Array(8); + for(var j = 0; j < 8; j++) a[7 - j] = caml_bytes_unsafe_get(s, i + j); + return caml_int64_of_bytes(a); + } + var caml_custom_event_index = 0; + function caml_runtime_events_user_register + (event_name, event_tag, event_type){ + caml_custom_event_index += 1; + return [0, caml_custom_event_index, event_name, event_type, event_tag]; + } + function caml_unix_has_symlink(unit){return fs_node_supported() ? 1 : 0;} + function caml_ephe_set_key(x, i, v){ + if(i < 0 || caml_ephe_key_offset + i >= x.length) + caml_invalid_argument("Weak.set"); + if(v instanceof Object && globalThis.WeakRef){ + if(x[1].register) x[1].register(v, undefined, v); + x[caml_ephe_key_offset + i] = new globalThis.WeakRef(v); + } + else + x[caml_ephe_key_offset + i] = v; + return 0; + } + function caml_ephe_unset_key(x, i){ + if(i < 0 || caml_ephe_key_offset + i >= x.length) + caml_invalid_argument("Weak.set"); + if + (globalThis.WeakRef + && x[caml_ephe_key_offset + i] instanceof globalThis.WeakRef + && x[1].unregister){ + var old = x[caml_ephe_key_offset + i].deref(); + if(old !== undefined){ + var count = 0; + for(var j = caml_ephe_key_offset; j < x.length; j++){ + var key = x[j]; + if(key instanceof globalThis.WeakRef){ + key = key.deref(); + if(key === old) count++; + } + } + if(count == 1) x[1].unregister(old); + } + } + x[caml_ephe_key_offset + i] = undefined; + return 0; + } + function caml_weak_set(x, i, v){ + if(v == 0) caml_ephe_unset_key(x, i); else caml_ephe_set_key(x, i, v[1]); + return 0; + } + function caml_sys_remove(name){ + var root = resolve_fs_device(name), ok = root.device.unlink(root.rest); + if(ok == 0) caml_raise_no_such_file(caml_jsbytes_of_string(name)); + return 0; + } + function caml_string_bound_error(){ + caml_invalid_argument("index out of bounds"); + } + function caml_string_get32(s, i){ + if(i >>> 0 >= caml_ml_string_length(s) - 3) caml_string_bound_error(); + var + b1 = caml_string_unsafe_get(s, i), + b2 = caml_string_unsafe_get(s, i + 1), + b3 = caml_string_unsafe_get(s, i + 2), + b4 = caml_string_unsafe_get(s, i + 3); + return b4 << 24 | b3 << 16 | b2 << 8 | b1; + } + function caml_bytes_get(s, i){ + if(i >>> 0 >= s.l) caml_bytes_bound_error(); + return caml_bytes_unsafe_get(s, i); + } + function caml_hypot_float(x, y){return Math.hypot(x, y);} + function caml_js_call(f, o, args){ + return f.apply(o, caml_js_from_array(args)); + } + function caml_sys_const_max_wosize(){return 0x7FFFFFFF / 4 | 0;} + function caml_unix_inet_addr_of_string(){return 0;} + function caml_hash_mix_bytes_arr(h, s){ + var len = s.length, i, w; + for(i = 0; i + 4 <= len; i += 4){ + w = s[i] | s[i + 1] << 8 | s[i + 2] << 16 | s[i + 3] << 24; + h = caml_hash_mix_int(h, w); + } + w = 0; + switch(len & 3){ + case 3: + w = s[i + 2] << 16; + case 2: + w |= s[i + 1] << 8; + case 1: + w |= s[i]; h = caml_hash_mix_int(h, w); + } + h ^= len; + return h; + } + function caml_hash_mix_jsbytes(h, s){ + var len = s.length, i, w; + for(i = 0; i + 4 <= len; i += 4){ + w = + s.charCodeAt(i) | s.charCodeAt(i + 1) << 8 | s.charCodeAt(i + 2) << 16 + | s.charCodeAt(i + 3) << 24; + h = caml_hash_mix_int(h, w); + } + w = 0; + switch(len & 3){ + case 3: + w = s.charCodeAt(i + 2) << 16; + case 2: + w |= s.charCodeAt(i + 1) << 8; + case 1: + w |= s.charCodeAt(i); h = caml_hash_mix_int(h, w); + } + h ^= len; + return h; + } + function caml_ml_bytes_content(s){ + switch(s.t & 6){ + default: caml_convert_string_to_bytes(s); + case 0: + return s.c; + case 4: + return s.c; + } + } + function caml_hash_mix_bytes(h, v){ + var content = caml_ml_bytes_content(v); + return typeof content === "string" + ? caml_hash_mix_jsbytes(h, content) + : caml_hash_mix_bytes_arr(h, content); + } + function caml_bytes_lessthan(s1, s2){ + s1.t & 6 && caml_convert_string_to_bytes(s1); + s2.t & 6 && caml_convert_string_to_bytes(s2); + return s1.c < s2.c ? 1 : 0; + } + function caml_erfc_float(x){return 1 - caml_erf_float(x);} + function caml_gr_fill_poly(ar){ + var s = caml_gr_state_get(); + s.context.beginPath(); + s.context.moveTo(ar[1][1], s.height - ar[1][2]); + for(var i = 2; i < ar.length; i++) + s.context.lineTo(ar[i][1], s.height - ar[i][2]); + s.context.lineTo(ar[1][1], s.height - ar[1][2]); + s.context.fill(); + return 0; + } + function caml_gc_quick_stat(){ + return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + } + function caml_ml_input_char(chanid){ + var chan = caml_ml_channels[chanid]; + if(chan.buffer_curr >= chan.buffer_max){ + chan.buffer_curr = 0; + chan.buffer_max = 0; + caml_refill(chan); + } + if(chan.buffer_curr >= chan.buffer_max) caml_raise_end_of_file(); + var res = chan.buffer[chan.buffer_curr]; + chan.buffer_curr++; + return res; + } + function caml_ml_input_int(chanid){ + var chan = caml_ml_channels[chanid], res = 0; + for(var i = 0; i < 4; i++) + res = (res << 8) + caml_ml_input_char(chanid) | 0; + return res | 0; + } + function caml_gr_display_mode(){ + caml_failwith("caml_gr_display_mode not Implemented"); + } + function caml_obj_reachable_words(o){return 0;} + function nth_digit_nat(nat, ofs){return nat.data[ofs];} + function caml_array_blit(a1, i1, a2, i2, len){ + if(i2 <= i1) + for(var j = 1; j <= len; j++) a2[i2 + j] = a1[i1 + j]; + else + for(var j = len; j >= 1; j--) a2[i2 + j] = a1[i1 + j]; + return 0; + } + function caml_float_of_string(s){ + var res; + s = caml_jsbytes_of_string(s); + res = + s; + if(s.length > 0 && res === res) return res; + s = s.replace(/_/g, ""); + res = + s; + if(s.length > 0 && res === res || /^[+-]?nan$/i.test(s)) return res; + var m = /^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(s); + if(m){ + var + m3 = m[3].replace(/0+$/, ""), + mantissa = parseInt(m[1] + m[2] + m3, 16), + exponent = (m[5] | 0) - 4 * m3.length; + res = mantissa * Math.pow(2, exponent); + return res; + } + if(/^\+?inf(inity)?$/i.test(s)) return Infinity; + if(/^-inf(inity)?$/i.test(s)) return - Infinity; + caml_failwith("float_of_string"); + } + function caml_sys_getcwd(){ + return caml_string_of_jsbytes(caml_current_dir); + } + function caml_int64_add(x, y){return x.add(y);} + function caml_int64_mul(x, y){return x.mul(y);} + function caml_int64_ult(x, y){return x.ucompare(y) < 0;} + function caml_parse_sign_and_base(s){ + var i = 0, len = caml_ml_string_length(s), base = 10, sign = 1; + if(len > 0) + switch(caml_string_unsafe_get(s, i)){ + case 45: + i++; sign = - 1; break; + case 43: + i++; sign = 1; break; + } + if(i + 1 < len && caml_string_unsafe_get(s, i) == 48) + switch(caml_string_unsafe_get(s, i + 1)){ + case 120: + case 88: + base = 16; i += 2; break; + case 111: + case 79: + base = 8; i += 2; break; + case 98: + case 66: + base = 2; i += 2; break; + case 117: + case 85: + i += 2; break; + } + return [i, sign, base]; + } + function caml_parse_digit(c){ + if(c >= 48 && c <= 57) return c - 48; + if(c >= 65 && c <= 90) return c - 55; + if(c >= 97 && c <= 122) return c - 87; + return - 1; + } + function caml_int64_of_string(s){ + var + r = caml_parse_sign_and_base(s), + i = r[0], + sign = r[1], + base = r[2], + base64 = caml_int64_of_int32(base), + threshold = + new MlInt64(0xffffff, 0xfffffff, 0xffff).udivmod(base64).quotient, + c = caml_string_unsafe_get(s, i), + d = caml_parse_digit(c); + if(d < 0 || d >= base) caml_failwith("int_of_string"); + var res = caml_int64_of_int32(d); + for(;;){ + i++; + c = caml_string_unsafe_get(s, i); + if(c == 95) continue; + d = caml_parse_digit(c); + if(d < 0 || d >= base) break; + if(caml_int64_ult(threshold, res)) caml_failwith("int_of_string"); + d = caml_int64_of_int32(d); + res = caml_int64_add(caml_int64_mul(base64, res), d); + if(caml_int64_ult(res, d)) caml_failwith("int_of_string"); + } + if(i != caml_ml_string_length(s)) caml_failwith("int_of_string"); + if(base == 10 && caml_int64_ult(new MlInt64(0, 0, 0x8000), res)) + caml_failwith("int_of_string"); + if(sign < 0) res = caml_int64_neg(res); + return res; + } + function caml_ba_set_1(ba, i0, v){ba.set(ba.offset(i0), v); return 0;} + function caml_int64_xor(x, y){return x.xor(y);} + function caml_int64_or(x, y){return x.or(y);} + function caml_lxm_next(v){ + function shift_l(x, k){return caml_int64_shift_left(x, k);} + function shift_r(x, k){return caml_int64_shift_right_unsigned(x, k);} + function or(a, b){return caml_int64_or(a, b);} + function xor(a, b){return caml_int64_xor(a, b);} + function add(a, b){return caml_int64_add(a, b);} + function mul(a, b){return caml_int64_mul(a, b);} + function rotl(x, k){return or(shift_l(x, k), shift_r(x, 64 - k));} + function get(a, i){return caml_ba_get_1(a, i);} + function set(a, i, x){return caml_ba_set_1(a, i, x);} + var + M = caml_int64_of_string(caml_new_string("0xd1342543de82ef95")), + daba = caml_int64_of_string(caml_new_string("0xdaba0b6eb09322e3")), + z, + q0, + q1, + st = v, + a = get(st, 0), + s = get(st, 1), + x0 = get(st, 2), + x1 = get(st, 3); + z = add(s, x0); + z = mul(xor(z, shift_r(z, 32)), daba); + z = mul(xor(z, shift_r(z, 32)), daba); + z = xor(z, shift_r(z, 32)); + set(st, 1, add(mul(s, M), a)); + var q0 = x0, q1 = x1; + q1 = xor(q1, q0); + q0 = rotl(q0, 24); + q0 = xor(xor(q0, q1), shift_l(q1, 16)); + q1 = rotl(q1, 37); + set(st, 2, q0); + set(st, 3, q1); + return z; + } + function caml_sys_const_big_endian(){return 0;} + function caml_list_to_js_array(l){ + var a = []; + for(; l !== 0; l = l[2]) a.push(l[1]); + return a; + } + var + caml_output_val = + function(){ + function Writer(){this.chunk = [];} + Writer.prototype = + {chunk_idx: 20, + block_len: 0, + obj_counter: 0, + size_32: 0, + size_64: 0, + write: + function(size, value){ + for(var i = size - 8; i >= 0; i -= 8) + this.chunk[this.chunk_idx++] = value >> i & 0xFF; + }, + write_at: + function(pos, size, value){ + var pos = pos; + for(var i = size - 8; i >= 0; i -= 8) + this.chunk[pos++] = value >> i & 0xFF; + }, + write_code: + function(size, code, value){ + this.chunk[this.chunk_idx++] = code; + for(var i = size - 8; i >= 0; i -= 8) + this.chunk[this.chunk_idx++] = value >> i & 0xFF; + }, + write_shared: + function(offset){ + if(offset < 1 << 8) + this.write_code(8, 0x04, offset); + else if(offset < 1 << 16) + this.write_code(16, 0x05, offset); + else + this.write_code(32, 0x06, offset); + }, + pos: function(){return this.chunk_idx;}, + finalize: + function(){ + this.block_len = this.chunk_idx - 20; + this.chunk_idx = 0; + this.write(32, 0x8495A6BE); + this.write(32, this.block_len); + this.write(32, this.obj_counter); + this.write(32, this.size_32); + this.write(32, this.size_64); + return this.chunk; + }}; + return function(v, flags){ + flags = caml_list_to_js_array(flags); + var + no_sharing = flags.indexOf(0) !== - 1, + closures = flags.indexOf(1) !== - 1; + if(closures) + console.warn + ("in caml_output_val: flag Marshal.Closures is not supported."); + var + writer = new Writer(), + stack = [], + intern_obj_table = no_sharing ? null : new MlObjectTable(); + function memo(v){ + if(no_sharing) return false; + var existing_offset = intern_obj_table.recall(v); + if(existing_offset){ + writer.write_shared(existing_offset); + return true; + } + else{intern_obj_table.store(v); return false;} + } + function extern_rec(v){ + if(v.caml_custom){ + if(memo(v)) return; + var + name = v.caml_custom, + ops = caml_custom_ops[name], + sz_32_64 = [0, 0]; + if(! ops.serialize) + caml_invalid_argument("output_value: abstract value (Custom)"); + if(ops.fixed_length == undefined){ + writer.write(8, 0x18); + for(var i = 0; i < name.length; i++) + writer.write(8, name.charCodeAt(i)); + writer.write(8, 0); + var header_pos = writer.pos(); + for(var i = 0; i < 12; i++) writer.write(8, 0); + ops.serialize(writer, v, sz_32_64); + writer.write_at(header_pos, 32, sz_32_64[0]); + writer.write_at(header_pos + 4, 32, 0); + writer.write_at(header_pos + 8, 32, sz_32_64[1]); + } + else{ + writer.write(8, 0x19); + for(var i = 0; i < name.length; i++) + writer.write(8, name.charCodeAt(i)); + writer.write(8, 0); + var old_pos = writer.pos(); + ops.serialize(writer, v, sz_32_64); + if(ops.fixed_length != writer.pos() - old_pos) + caml_failwith + ("output_value: incorrect fixed sizes specified by " + name); + } + writer.size_32 += 2 + (sz_32_64[0] + 3 >> 2); + writer.size_64 += 2 + (sz_32_64[1] + 7 >> 3); + } + else if(v instanceof Array && v[0] === (v[0] | 0)){ + if(v[0] == 251) + caml_failwith("output_value: abstract value (Abstract)"); + if(caml_is_continuation_tag(v[0])) + caml_invalid_argument("output_value: continuation value"); + if(v.length > 1 && memo(v)) return; + if(v[0] < 16 && v.length - 1 < 8) + writer.write(8, 0x80 + v[0] + (v.length - 1 << 4)); + else + writer.write_code(32, 0x08, v.length - 1 << 10 | v[0]); + writer.size_32 += v.length; + writer.size_64 += v.length; + if(v.length > 1) stack.push(v, 1); + } + else if(caml_is_ml_bytes(v)){ + if(! caml_is_ml_bytes(caml_string_of_jsbytes(""))) + caml_failwith + ("output_value: [Bytes.t] cannot safely be marshaled with [--enable use-js-string]"); + if(memo(v)) return; + var len = caml_ml_bytes_length(v); + if(len < 0x20) + writer.write(8, 0x20 + len); + else if(len < 0x100) + writer.write_code(8, 0x09, len); + else + writer.write_code(32, 0x0A, len); + for(var i = 0; i < len; i++) + writer.write(8, caml_bytes_unsafe_get(v, i)); + writer.size_32 += 1 + ((len + 4) / 4 | 0); + writer.size_64 += 1 + ((len + 8) / 8 | 0); + } + else if(caml_is_ml_string(v)){ + if(memo(v)) return; + var len = caml_ml_string_length(v); + if(len < 0x20) + writer.write(8, 0x20 + len); + else if(len < 0x100) + writer.write_code(8, 0x09, len); + else + writer.write_code(32, 0x0A, len); + for(var i = 0; i < len; i++) + writer.write(8, caml_string_unsafe_get(v, i)); + writer.size_32 += 1 + ((len + 4) / 4 | 0); + writer.size_64 += 1 + ((len + 8) / 8 | 0); + } + else if(v != (v | 0)){ + var type_of_v = typeof v; + caml_failwith("output_value: abstract value (" + type_of_v + ")"); + } + else if(v >= 0 && v < 0x40) + writer.write(8, 0X40 + v); + else if(v >= - (1 << 7) && v < 1 << 7) + writer.write_code(8, 0x00, v); + else if(v >= - (1 << 15) && v < 1 << 15) + writer.write_code(16, 0x01, v); + else + writer.write_code(32, 0x02, v); + } + extern_rec(v); + while(stack.length > 0){ + var i = stack.pop(), v = stack.pop(); + if(i + 1 < v.length) stack.push(v, i + 1); + extern_rec(v[i]); + } + if(intern_obj_table) + writer.obj_counter = intern_obj_table.objs.length; + writer.finalize(); + return writer.chunk;}; + } + (); + function caml_string_of_array(a){ + return caml_string_of_jsbytes(caml_subarray_to_jsbytes(a, 0, a.length)); + } + function caml_output_value_to_string(v, flags){ + return caml_string_of_array(caml_output_val(v, flags)); + } + function caml_raise_not_a_dir(name){ + caml_raise_sys_error(name + ": Not a directory"); + } + function caml_sys_system_command(cmd){ + var cmd = caml_jsstring_of_string(cmd); + if(typeof require != "undefined"){ + var child_process = require("child_process"); + if(child_process && child_process.execSync) + try{child_process.execSync(cmd, {stdio: "inherit"}); return 0;} + catch(e){return 1;} + } + else + return 127; + } + function caml_js_error_of_exception(exn){ + if(exn.js_error) return exn.js_error; + return null; + } + function caml_unix_getuid(unit){ + if(globalThis.process && globalThis.process.getuid) + return globalThis.process.getuid(); + caml_raise_not_found(); + } + function deserialize_nat(reader, sz){ + var len = reader.read32s(), nat = new MlNat(len); + for(var i = 0; i < len; i++) nat.data[i] = reader.read32s(); + sz[0] = len * 4; + return nat; + } + function initialize_nat(){ + caml_custom_ops["_nat"] = + {deserialize: deserialize_nat, + serialize: serialize_nat, + hash: caml_hash_nat}; + } + function caml_bytes_of_utf16_jsstring(s){ + var tag = 9; + if(! jsoo_is_ascii(s)) tag = 8, s = caml_utf8_of_utf16(s); + return new MlBytes(tag, s, s.length); + } + function caml_gr_open_subwindow(a, b, c, d){ + caml_failwith("caml_gr_open_subwindow not Implemented"); + } + function UInt8ArrayReader(s, i){this.s = s; this.i = i;} + UInt8ArrayReader.prototype = + {read8u: function(){return this.s[this.i++];}, + read8s: function(){return this.s[this.i++] << 24 >> 24;}, + read16u: + function(){ + var s = this.s, i = this.i; + this.i = i + 2; + return s[i] << 8 | s[i + 1]; + }, + read16s: + function(){ + var s = this.s, i = this.i; + this.i = i + 2; + return s[i] << 24 >> 16 | s[i + 1]; + }, + read32u: + function(){ + var s = this.s, i = this.i; + this.i = i + 4; + return (s[i] << 24 | s[i + 1] << 16 | s[i + 2] << 8 | s[i + 3]) >>> 0; + }, + read32s: + function(){ + var s = this.s, i = this.i; + this.i = i + 4; + return s[i] << 24 | s[i + 1] << 16 | s[i + 2] << 8 | s[i + 3]; + }, + readstr: + function(len){ + var i = this.i; + this.i = i + len; + return caml_string_of_array(this.s.subarray(i, i + len)); + }, + readuint8array: + function(len){ + var i = this.i; + this.i = i + len; + return this.s.subarray(i, i + len); + }}; + function caml_marshal_data_size(s, ofs){ + var r = new UInt8ArrayReader(caml_uint8_array_of_bytes(s), ofs); + function readvlq(overflow){ + var c = r.read8u(), n = c & 0x7F; + while((c & 0x80) != 0){ + c = r.read8u(); + var n7 = n << 7; + if(n != n7 >> 7) overflow[0] = true; + n = n7 | c & 0x7F; + } + return n; + } + switch(r.read32u()){ + case 0x8495A6BE: + var header_len = 20, data_len = r.read32u(); break; + case 0x8495A6BD: + var + header_len = r.read8u() & 0x3F, + overflow = [false], + data_len = readvlq(overflow); + if(overflow[0]) + caml_failwith + ("Marshal.data_size: object too large to be read back on this platform"); + break; + case 0x8495A6BF: + default: caml_failwith("Marshal.data_size: bad object"); break; + } + return header_len - caml_marshal_header_size + data_len; + } + function MlStringReader(s, i){ + this.s = caml_jsbytes_of_string(s); + this.i = i; + } + MlStringReader.prototype = + {read8u: function(){return this.s.charCodeAt(this.i++);}, + read8s: function(){return this.s.charCodeAt(this.i++) << 24 >> 24;}, + read16u: + function(){ + var s = this.s, i = this.i; + this.i = i + 2; + return s.charCodeAt(i) << 8 | s.charCodeAt(i + 1); + }, + read16s: + function(){ + var s = this.s, i = this.i; + this.i = i + 2; + return s.charCodeAt(i) << 24 >> 16 | s.charCodeAt(i + 1); + }, + read32u: + function(){ + var s = this.s, i = this.i; + this.i = i + 4; + return (s.charCodeAt(i) << 24 | s.charCodeAt(i + 1) << 16 + | s.charCodeAt(i + 2) << 8 + | s.charCodeAt(i + 3)) + >>> 0; + }, + read32s: + function(){ + var s = this.s, i = this.i; + this.i = i + 4; + return s.charCodeAt(i) << 24 | s.charCodeAt(i + 1) << 16 + | s.charCodeAt(i + 2) << 8 + | s.charCodeAt(i + 3); + }, + readstr: + function(len){ + var i = this.i; + this.i = i + len; + return caml_string_of_jsbytes(this.s.substring(i, i + len)); + }, + readuint8array: + function(len){ + var b = new Uint8Array(len), s = this.s, i = this.i; + for(var j = 0; j < len; j++) b[j] = s.charCodeAt(i + j); + this.i = i + len; + return b; + }}; + var + zstd_decompress = + function(){ + "use strict"; + var + ab = ArrayBuffer, + u8 = Uint8Array, + u16 = Uint16Array, + i16 = Int16Array, + u32 = Uint32Array, + i32 = Int32Array; + function slc(v, s, e){ + if(u8.prototype.slice) return u8.prototype.slice.call(v, s, e); + if(s == null || s < 0) s = 0; + if(e == null || e > v.length) e = v.length; + var n = new u8(e - s); + n.set(v.subarray(s, e)); + return n; + } + function fill(v, n, s, e){ + if(u8.prototype.fill) return u8.prototype.fill.call(v, n, s, e); + if(s == null || s < 0) s = 0; + if(e == null || e > v.length) e = v.length; + for(; s < e; ++s) v[s] = n; + return v; + } + function cpw(v, t, s, e){ + if(u8.prototype.copyWithin) + return u8.prototype.copyWithin.call(v, t, s, e); + if(s == null || s < 0) s = 0; + if(e == null || e > v.length) e = v.length; + while(s < e) v[t++] = v[s++]; + } + var + ec = + ["invalid zstd data", + "window size too large (>2046MB)", + "invalid block type", + "FSE accuracy too high", + "match distance too far back", + "unexpected EOF"]; + function err(ind, msg, nt){ + var e = new Error(msg || ec[ind]); + e.code = ind; + if(! nt) throw e; + return e; + } + function rb(d, b, n){ + var i = 0, o = 0; + for(; i < n; ++i) o |= d[b++] << (i << 3); + return o; + } + function b4(d, b){ + return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0; + } + function rzfh(dat, w){ + var n3 = dat[0] | dat[1] << 8 | dat[2] << 16; + if(n3 == 0x2FB528 && dat[3] == 253){ + var + flg = dat[4], + ss = flg >> 5 & 1, + cc = flg >> 2 & 1, + df = flg & 3, + fcf = flg >> 6; + if(flg & 8) err(0); + var bt = 6 - ss, db = df == 3 ? 4 : df, di = rb(dat, bt, db); + bt += db; + var + fsb = fcf ? 1 << fcf : ss, + fss = rb(dat, bt, fsb) + (fcf == 1 && 256), + ws = fss; + if(! ss){ + var wb = 1 << 10 + (dat[5] >> 3); + ws = wb + (wb >> 3) * (dat[5] & 7); + } + if(ws > 2145386496) err(1); + var buf = new u8((w == 1 ? fss || ws : w ? 0 : ws) + 12); + buf[0] = 1, buf[4] = 4, buf[8] = 8; + return {b: bt + fsb, + y: 0, + l: 0, + d: di, + w: w && w != 1 ? w : buf.subarray(12), + e: ws, + o: new i32(buf.buffer, 0, 3), + u: fss, + c: cc, + m: Math.min(131072, ws)}; + } + else if((n3 >> 4 | dat[3] << 20) == 0x184D2A5) return b4(dat, 4) + 8; + err(0); + } + function msb(val){ + var bits = 0; + for(; 1 << bits <= val; ++bits) ; + return bits - 1; + } + function rfse(dat, bt, mal){ + var tpos = (bt << 3) + 4, al = (dat[bt] & 15) + 5; + if(al > mal) err(3); + var + sz = 1 << al, + probs = sz, + sym = - 1, + re = - 1, + i = - 1, + ht = sz, + buf = new ab(512 + (sz << 2)), + freq = new i16(buf, 0, 256), + dstate = new u16(buf, 0, 256), + nstate = new u16(buf, 512, sz), + bb1 = 512 + (sz << 1), + syms = new u8(buf, bb1, sz), + nbits = new u8(buf, bb1 + sz); + while(sym < 255 && probs > 0){ + var + bits = msb(probs + 1), + cbt = tpos >> 3, + msk = (1 << bits + 1) - 1, + val = + (dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16) >> (tpos & 7) + & msk, + msk1fb = (1 << bits) - 1, + msv = msk - probs - 1, + sval = val & msk1fb; + if(sval < msv) + tpos += bits, val = sval; + else{tpos += bits + 1; if(val > msk1fb) val -= msv;} + freq[++sym] = --val; + if(val == - 1){probs += val; syms[--ht] = sym;} else probs -= val; + if(! val) + do{ + var rbt = tpos >> 3; + re = (dat[rbt] | dat[rbt + 1] << 8) >> (tpos & 7) & 3; + tpos += 2; + sym += re; + } + while + (re == 3); + } + if(sym > 255 || probs) err(0); + var sympos = 0, sstep = (sz >> 1) + (sz >> 3) + 3, smask = sz - 1; + for(var s = 0; s <= sym; ++s){ + var sf = freq[s]; + if(sf < 1){dstate[s] = - sf; continue;} + for(i = 0; i < sf; ++i){ + syms[sympos] = s; + do sympos = sympos + sstep & smask;while(sympos >= ht); + } + } + if(sympos) err(0); + for(i = 0; i < sz; ++i){ + var ns = dstate[syms[i]]++, nb = nbits[i] = al - msb(ns); + nstate[i] = (ns << nb) - sz; + } + return [tpos + 7 >> 3, {b: al, s: syms, n: nbits, t: nstate}]; + } + function rhu(dat, bt){ + var + i = 0, + wc = - 1, + buf = new u8(292), + hb = dat[bt], + hw = buf.subarray(0, 256), + rc = buf.subarray(256, 268), + ri = new u16(buf.buffer, 268); + if(hb < 128){ + var _a = rfse(dat, bt + 1, 6), ebt = _a[0], fdt = _a[1]; + bt += hb; + var epos = ebt << 3, lb = dat[bt]; + if(! lb) err(0); + var + st1 = 0, + st2 = 0, + btr1 = fdt.b, + btr2 = btr1, + fpos = (++bt << 3) - 8 + msb(lb); + for(;;){ + fpos -= btr1; + if(fpos < epos) break; + var cbt = fpos >> 3; + st1 += + (dat[cbt] | dat[cbt + 1] << 8) >> (fpos & 7) & (1 << btr1) - 1; + hw[++wc] = fdt.s[st1]; + fpos -= btr2; + if(fpos < epos) break; + cbt = fpos >> 3; + st2 += + (dat[cbt] | dat[cbt + 1] << 8) >> (fpos & 7) & (1 << btr2) - 1; + hw[++wc] = fdt.s[st2]; + btr1 = fdt.n[st1]; + st1 = fdt.t[st1]; + btr2 = fdt.n[st2]; + st2 = fdt.t[st2]; + } + if(++wc > 255) err(0); + } + else{ + wc = hb - 127; + for(; i < wc; i += 2){ + var byte = dat[++bt]; + hw[i] = byte >> 4; + hw[i + 1] = byte & 15; + } + ++bt; + } + var wes = 0; + for(i = 0; i < wc; ++i){ + var wt = hw[i]; + if(wt > 11) err(0); + wes += wt && 1 << wt - 1; + } + var mb = msb(wes) + 1, ts = 1 << mb, rem = ts - wes; + if(rem & rem - 1) err(0); + hw[wc++] = msb(rem) + 1; + for(i = 0; i < wc; ++i){ + var wt = hw[i]; + ++rc[hw[i] = wt && mb + 1 - wt]; + } + var + hbuf = new u8(ts << 1), + syms = hbuf.subarray(0, ts), + nb = hbuf.subarray(ts); + ri[mb] = 0; + for(i = mb; i > 0; --i){ + var pv = ri[i]; + fill(nb, i, pv, ri[i - 1] = pv + rc[i] * (1 << mb - i)); + } + if(ri[0] != ts) err(0); + for(i = 0; i < wc; ++i){ + var bits = hw[i]; + if(bits){ + var code = ri[bits]; + fill(syms, i, code, ri[bits] = code + (1 << mb - bits)); + } + } + return [bt, {n: nb, b: mb, s: syms}]; + } + var + dllt = + rfse + (new + u8 + ([81, + 16, + 99, + 140, + 49, + 198, + 24, + 99, + 12, + 33, + 196, + 24, + 99, + 102, + 102, + 134, + 70, + 146, + 4]), + 0, + 6) + [1], + dmlt = + rfse + (new + u8 + ([33, + 20, + 196, + 24, + 99, + 140, + 33, + 132, + 16, + 66, + 8, + 33, + 132, + 16, + 66, + 8, + 33, + 68, + 68, + 68, + 68, + 68, + 68, + 68, + 68, + 36, + 9]), + 0, + 6) + [1], + doct = + rfse + (new u8([32, 132, 16, 66, 102, 70, 68, 68, 68, 68, 36, 73, 2]), + 0, + 5) + [1]; + function b2bl(b, s){ + var len = b.length, bl = new i32(len); + for(var i = 0; i < len; ++i){bl[i] = s; s += 1 << b[i];} + return bl; + } + var + llb = + new + u8 + (new + i32 + ([0, + 0, + 0, + 0, + 16843009, + 50528770, + 134678020, + 202050057, + 269422093]).buffer, + 0, + 36), + llbl = b2bl(llb, 0), + mlb = + new + u8 + (new + i32 + ([0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 16843009, + 50528770, + 117769220, + 185207048, + 252579084, + 16]).buffer, + 0, + 53), + mlbl = b2bl(mlb, 3); + function dhu(dat, out, hu){ + var + len = dat.length, + ss = out.length, + lb = dat[len - 1], + msk = (1 << hu.b) - 1, + eb = - hu.b; + if(! lb) err(0); + var + st = 0, + btr = hu.b, + pos = (len << 3) - 8 + msb(lb) - btr, + i = - 1; + for(; pos > eb && i < ss;){ + var + cbt = pos >> 3, + val = + (dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16) >> (pos & 7); + st = (st << btr | val) & msk; + out[++i] = hu.s[st]; + pos -= btr = hu.n[st]; + } + if(pos != eb || i + 1 != ss) err(0); + } + function dhu4(dat, out, hu){ + var + bt = 6, + ss = out.length, + sz1 = ss + 3 >> 2, + sz2 = sz1 << 1, + sz3 = sz1 + sz2; + dhu + (dat.subarray(bt, bt += dat[0] | dat[1] << 8), + out.subarray(0, sz1), + hu); + dhu + (dat.subarray(bt, bt += dat[2] | dat[3] << 8), + out.subarray(sz1, sz2), + hu); + dhu + (dat.subarray(bt, bt += dat[4] | dat[5] << 8), + out.subarray(sz2, sz3), + hu); + dhu(dat.subarray(bt), out.subarray(sz3), hu); + } + function rzb(dat, st, out){ + var _a, bt = st.b, b0 = dat[bt], btype = b0 >> 1 & 3; + st.l = b0 & 1; + var + sz = b0 >> 3 | dat[bt + 1] << 5 | dat[bt + 2] << 13, + ebt = (bt += 3) + sz; + if(btype == 1){ + if(bt >= dat.length) return; + st.b = bt + 1; + if(out){fill(out, dat[bt], st.y, st.y += sz); return out;} + return fill(new u8(sz), dat[bt]); + } + if(ebt > dat.length) return; + if(btype == 0){ + st.b = ebt; + if(out){ + out.set(dat.subarray(bt, ebt), st.y); + st.y += sz; + return out; + } + return slc(dat, bt, ebt); + } + if(btype == 2){ + var + b3 = dat[bt], + lbt = b3 & 3, + sf = b3 >> 2 & 3, + lss = b3 >> 4, + lcs = 0, + s4 = 0; + if(lbt < 2) + if(sf & 1) + lss |= dat[++bt] << 4 | (sf & 2 && dat[++bt] << 12); + else + lss = b3 >> 3; + else{ + s4 = sf; + if(sf < 2) + lss |= (dat[++bt] & 63) << 4, lcs = dat[bt] >> 6 | dat[++bt] << 2; + else if(sf == 2) + lss |= dat[++bt] << 4 | (dat[++bt] & 3) << 12, + lcs = dat[bt] >> 2 | dat[++bt] << 6; + else + lss |= dat[++bt] << 4 | (dat[++bt] & 63) << 12, + lcs = dat[bt] >> 6 | dat[++bt] << 2 | dat[++bt] << 10; + } + ++bt; + var + buf = out ? out.subarray(st.y, st.y + st.m) : new u8(st.m), + spl = buf.length - lss; + if(lbt == 0) + buf.set(dat.subarray(bt, bt += lss), spl); + else if(lbt == 1) + fill(buf, dat[bt++], spl); + else{ + var hu = st.h; + if(lbt == 2){ + var hud = rhu(dat, bt); + lcs += bt - (bt = hud[0]); + st.h = hu = hud[1]; + } + else if(! hu) err(0); + (s4 ? dhu4 : dhu) + (dat.subarray(bt, bt += lcs), buf.subarray(spl), hu); + } + var ns = dat[bt++]; + if(ns){ + if(ns == 255) + ns = (dat[bt++] | dat[bt++] << 8) + 0x7F00; + else if(ns > 127) ns = ns - 128 << 8 | dat[bt++]; + var scm = dat[bt++]; + if(scm & 3) err(0); + var dts = [dmlt, doct, dllt]; + for(var i = 2; i > - 1; --i){ + var md = scm >> (i << 1) + 2 & 3; + if(md == 1){ + var rbuf = new u8([0, 0, dat[bt++]]); + dts[i] = + {s: rbuf.subarray(2, 3), + n: rbuf.subarray(0, 1), + t: new u16(rbuf.buffer, 0, 1), + b: 0}; + } + else if(md == 2) + _a = rfse(dat, bt, 9 - (i & 1)), bt = _a[0], dts[i] = _a[1]; + else if(md == 3){if(! st.t) err(0); dts[i] = st.t[i];} + } + var + _b = st.t = dts, + mlt = _b[0], + oct = _b[1], + llt = _b[2], + lb = dat[ebt - 1]; + if(! lb) err(0); + var + spos = (ebt << 3) - 8 + msb(lb) - llt.b, + cbt = spos >> 3, + oubt = 0, + lst = + (dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << llt.b) - 1; + cbt = (spos -= oct.b) >> 3; + var + ost = + (dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << oct.b) - 1; + cbt = (spos -= mlt.b) >> 3; + var + mst = + (dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << mlt.b) - 1; + for(++ns; --ns;){ + var + llc = llt.s[lst], + lbtr = llt.n[lst], + mlc = mlt.s[mst], + mbtr = mlt.n[mst], + ofc = oct.s[ost], + obtr = oct.n[ost]; + cbt = (spos -= ofc) >> 3; + var + ofp = 1 << ofc, + off = + ofp + + + ((dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16 + | dat[cbt + 3] << 24) + >>> (spos & 7) + & ofp - 1); + cbt = (spos -= mlb[mlc]) >> 3; + var + ml = + mlbl[mlc] + + + ((dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16) + >> (spos & 7) + & (1 << mlb[mlc]) - 1); + cbt = (spos -= llb[llc]) >> 3; + var + ll = + llbl[llc] + + + ((dat[cbt] | dat[cbt + 1] << 8 | dat[cbt + 2] << 16) + >> (spos & 7) + & (1 << llb[llc]) - 1); + cbt = (spos -= lbtr) >> 3; + lst = + llt.t[lst] + + + ((dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << lbtr) - 1); + cbt = (spos -= mbtr) >> 3; + mst = + mlt.t[mst] + + + ((dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << mbtr) - 1); + cbt = (spos -= obtr) >> 3; + ost = + oct.t[ost] + + + ((dat[cbt] | dat[cbt + 1] << 8) >> (spos & 7) & (1 << obtr) - 1); + if(off > 3){ + st.o[2] = st.o[1]; + st.o[1] = st.o[0]; + st.o[0] = off -= 3; + } + else{ + var idx = off - (ll != 0); + if(idx){ + off = idx == 3 ? st.o[0] - 1 : st.o[idx]; + if(idx > 1) st.o[2] = st.o[1]; + st.o[1] = st.o[0]; + st.o[0] = off; + } + else + off = st.o[0]; + } + for(var i = 0; i < ll; ++i) buf[oubt + i] = buf[spl + i]; + oubt += ll, spl += ll; + var stin = oubt - off; + if(stin < 0){ + var len = - stin, bs = st.e + stin; + if(len > ml) len = ml; + for(var i = 0; i < len; ++i) buf[oubt + i] = st.w[bs + i]; + oubt += len, ml -= len, stin = 0; + } + for(var i = 0; i < ml; ++i) buf[oubt + i] = buf[stin + i]; + oubt += ml; + } + if(oubt != spl) + while(spl < buf.length) buf[oubt++] = buf[spl++]; + else + oubt = buf.length; + if(out) st.y += oubt; else buf = slc(buf, 0, oubt); + } + else if(out){ + st.y += lss; + if(spl) for(var i = 0; i < lss; ++i) buf[i] = buf[spl + i]; + } + else if(spl) buf = slc(buf, spl); + st.b = ebt; + return buf; + } + err(2); + } + function cct(bufs, ol){ + if(bufs.length == 1) return bufs[0]; + var buf = new u8(ol); + for(var i = 0, b = 0; i < bufs.length; ++i){ + var chk = bufs[i]; + buf.set(chk, b); + b += chk.length; + } + return buf; + } + return function(dat, buf){ + var bt = 0, bufs = [], nb = + ! buf, ol = 0; + for(; dat.length;){ + var st = rzfh(dat, nb || buf); + if(typeof st == "object"){ + if(nb){ + buf = null; + if(st.w.length == st.u){bufs.push(buf = st.w); ol += st.u;} + } + else{bufs.push(buf); st.e = 0;} + for(; ! st.l;){ + var blk = rzb(dat, st, buf); + if(! blk) err(5); + if(buf) + st.e = st.y; + else{ + bufs.push(blk); + ol += blk.length; + cpw(st.w, 0, blk.length); + st.w.set(blk, st.w.length - blk.length); + } + } + bt = st.b + st.c * 4; + } + else + bt = st; + dat = dat.subarray(bt); + } + return cct(bufs, ol);}; + } + (); + function caml_float_of_bytes(a){ + return caml_int64_float_of_bits(caml_int64_of_bytes(a)); + } + function caml_input_value_from_reader(reader, ofs){ + function readvlq(overflow){ + var c = reader.read8u(), n = c & 0x7F; + while((c & 0x80) != 0){ + c = reader.read8u(); + var n7 = n << 7; + if(n != n7 >> 7) overflow[0] = true; + n = n7 | c & 0x7F; + } + return n; + } + var magic = reader.read32u(); + switch(magic){ + case 0x8495A6BE: + var + header_len = 20, + compressed = 0, + data_len = reader.read32u(), + uncompressed_data_len = data_len, + num_objects = reader.read32u(), + _size_32 = reader.read32u(), + _size_64 = reader.read32u(); + break; + case 0x8495A6BD: + var + header_len = reader.read8u() & 0x3F, + compressed = 1, + overflow = [false], + data_len = readvlq(overflow), + uncompressed_data_len = readvlq(overflow), + num_objects = readvlq(overflow), + _size_32 = readvlq(overflow), + _size_64 = readvlq(overflow); + if(overflow[0]) + caml_failwith + ("caml_input_value_from_reader: object too large to be read back on this platform"); + break; + case 0x8495A6BF: + caml_failwith + ("caml_input_value_from_reader: object too large to be read back on a 32-bit platform"); + break; + default: + caml_failwith("caml_input_value_from_reader: bad object"); break; + } + var + stack = [], + intern_obj_table = num_objects > 0 ? [] : null, + obj_counter = 0; + function intern_rec(reader){ + var code = reader.read8u(); + if(code >= 0x40) + if(code >= 0x80){ + var tag = code & 0xF, size = code >> 4 & 0x7, v = [tag]; + if(size == 0) return v; + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + stack.push(v, size); + return v; + } + else + return code & 0x3F; + else if(code >= 0x20){ + var len = code & 0x1F, v = reader.readstr(len); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + return v; + } + else + switch(code){ + case 0x00: + return reader.read8s(); + case 0x01: + return reader.read16s(); + case 0x02: + return reader.read32s(); + case 0x03: + caml_failwith("input_value: integer too large"); break; + case 0x04: + var offset = reader.read8u(); + if(compressed == 0) offset = obj_counter - offset; + return intern_obj_table[offset]; + case 0x05: + var offset = reader.read16u(); + if(compressed == 0) offset = obj_counter - offset; + return intern_obj_table[offset]; + case 0x06: + var offset = reader.read32u(); + if(compressed == 0) offset = obj_counter - offset; + return intern_obj_table[offset]; + case 0x08: + var + header = reader.read32u(), + tag = header & 0xFF, + size = header >> 10, + v = [tag]; + if(size == 0) return v; + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + stack.push(v, size); + return v; + case 0x13: + caml_failwith("input_value: data block too large"); break; + case 0x09: + var len = reader.read8u(), v = reader.readstr(len); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + return v; + case 0x0A: + var len = reader.read32u(), v = reader.readstr(len); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + return v; + case 0x0C: + var t = new Array(8); + for(var i = 0; i < 8; i++) t[7 - i] = reader.read8u(); + var v = caml_float_of_bytes(t); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + return v; + case 0x0B: + var t = new Array(8); + for(var i = 0; i < 8; i++) t[i] = reader.read8u(); + var v = caml_float_of_bytes(t); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + return v; + case 0x0E: + var len = reader.read8u(), v = new Array(len + 1); + v[0] = 254; + var t = new Array(8); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + for(var i = 1; i <= len; i++){ + for(var j = 0; j < 8; j++) t[7 - j] = reader.read8u(); + v[i] = caml_float_of_bytes(t); + } + return v; + case 0x0D: + var len = reader.read8u(), v = new Array(len + 1); + v[0] = 254; + var t = new Array(8); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + for(var i = 1; i <= len; i++){ + for(var j = 0; j < 8; j++) t[j] = reader.read8u(); + v[i] = caml_float_of_bytes(t); + } + return v; + case 0x07: + var len = reader.read32u(), v = new Array(len + 1); + v[0] = 254; + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + var t = new Array(8); + for(var i = 1; i <= len; i++){ + for(var j = 0; j < 8; j++) t[7 - j] = reader.read8u(); + v[i] = caml_float_of_bytes(t); + } + return v; + case 0x0F: + var len = reader.read32u(), v = new Array(len + 1); + v[0] = 254; + var t = new Array(8); + for(var i = 1; i <= len; i++){ + for(var j = 0; j < 8; j++) t[j] = reader.read8u(); + v[i] = caml_float_of_bytes(t); + } + return v; + case 0x10: + case 0x11: + caml_failwith("input_value: code pointer"); break; + case 0x12: + case 0x18: + case 0x19: + var c, s = ""; + while((c = reader.read8u()) != 0) s += String.fromCharCode(c); + var ops = caml_custom_ops[s], expected_size; + if(! ops) + caml_failwith("input_value: unknown custom block identifier"); + switch(code){ + case 0x12: break; + case 0x19: + if(! ops.fixed_length) + caml_failwith("input_value: expected a fixed-size custom block"); + expected_size = ops.fixed_length; + break; + case 0x18: + expected_size = reader.read32u(); + reader.read32s(); + reader.read32s(); + break; + } + var + old_pos = reader.i, + size = [0], + v = ops.deserialize(reader, size); + if(expected_size != undefined) + if(expected_size != size[0]) + caml_failwith + ("input_value: incorrect length of serialized custom block"); + if(intern_obj_table) intern_obj_table[obj_counter++] = v; + return v; + default: caml_failwith("input_value: ill-formed message"); + } + } + if(compressed) + var + data = reader.readuint8array(data_len), + res = new Uint8Array(uncompressed_data_len), + res = zstd_decompress(data, res), + reader = new UInt8ArrayReader(res, 0); + var res = intern_rec(reader); + while(stack.length > 0){ + var size = stack.pop(), v = stack.pop(), d = v.length; + if(d < size) stack.push(v, size); + v[d] = intern_rec(reader); + } + if(typeof ofs != "number") ofs[0] = reader.i; + return res; + } + function caml_string_of_bytes(s){ + s.t & 6 && caml_convert_string_to_bytes(s); + return caml_string_of_jsbytes(s.c); + } + function caml_input_value_from_bytes(s, ofs){ + var + reader = + new + MlStringReader + (caml_string_of_bytes(s), typeof ofs == "number" ? ofs : ofs[0]); + return caml_input_value_from_reader(reader, ofs); + } + function caml_input_value(chanid){ + var + chan = caml_ml_channels[chanid], + header = new Uint8Array(caml_marshal_header_size); + function block(buffer, offset, n){ + var r = 0; + while(r < n){ + if(chan.buffer_curr >= chan.buffer_max){ + chan.buffer_curr = 0; + chan.buffer_max = 0; + caml_refill(chan); + } + if(chan.buffer_curr >= chan.buffer_max) break; + buffer[offset + r] = chan.buffer[chan.buffer_curr]; + chan.buffer_curr++; + r++; + } + return r; + } + var r = block(header, 0, caml_marshal_header_size); + if(r == 0) + caml_raise_end_of_file(); + else if(r < caml_marshal_header_size) + caml_failwith("input_value: truncated object"); + var + len = caml_marshal_data_size(caml_bytes_of_array(header), 0), + buf = new Uint8Array(len + caml_marshal_header_size); + buf.set(header, 0); + var r = block(buf, caml_marshal_header_size, len); + if(r < len) + caml_failwith("input_value: truncated object " + r + " " + len); + var + offset = [0], + res = caml_input_value_from_bytes(caml_bytes_of_array(buf), offset); + chan.offset = chan.offset + offset[0]; + return res; + } + function caml_input_value_to_outside_heap(c){return caml_input_value(c);} + function caml_atomic_cas(ref, o, n){ + if(ref[1] === o){ref[1] = n; return 1;} + return 0; + } + function caml_copysign_float(x, y){ + if(y == 0) y = 1 / y; + x = Math.abs(x); + return y < 0 ? - x : x; + } + function caml_gr_set_text_size(size){ + var s = caml_gr_state_get(); + s.text_size = size; + s.context.font = s.text_size + "px " + caml_jsstring_of_string(s.font); + return 0; + } + function caml_atomic_load(ref){return ref[1];} + function caml_MD5Final(ctx){ + var in_buf = ctx.len & 0x3f; + ctx.b8[in_buf] = 0x80; + in_buf++; + if(in_buf > 56){ + for(var j = in_buf; j < 64; j++) ctx.b8[j] = 0; + caml_MD5Transform(ctx.w, ctx.b32); + for(var j = 0; j < 56; j++) ctx.b8[j] = 0; + } + else + for(var j = in_buf; j < 56; j++) ctx.b8[j] = 0; + ctx.b32[14] = ctx.len << 3; + ctx.b32[15] = ctx.len >> 29 & 0x1FFFFFFF; + caml_MD5Transform(ctx.w, ctx.b32); + var t = new Uint8Array(16); + for(var i = 0; i < 4; i++) + for(var j = 0; j < 4; j++) t[i * 4 + j] = ctx.w[i] >> 8 * j & 0xFF; + return t; + } + function caml_md5_bytes(s, ofs, len){ + var ctx = caml_MD5Init(), a = caml_uint8_array_of_bytes(s); + caml_MD5Update(ctx, a.subarray(ofs, ofs + len), len); + return caml_string_of_array(caml_MD5Final(ctx)); + } + function caml_ba_set_generic(ba, i, v){ + ba.set(ba.offset(caml_js_from_array(i)), v); + return 0; + } + function caml_ml_condition_wait(t, mutext){return 0;} + function caml_string_lessequal(s1, s2){return s1 <= s2 ? 1 : 0;} + function caml_string_greaterequal(s1, s2){return caml_string_lessequal(s2, s1); + } + function caml_nextafter_float(x, y){ + if(isNaN(x) || isNaN(y)) return NaN; + if(x == y) return y; + if(x == 0) return y < 0 ? - Math.pow(2, - 1074) : Math.pow(2, - 1074); + var bits = caml_int64_bits_of_float(x), one = caml_int64_of_int32(1); + if(x < y == x > 0) + bits = caml_int64_add(bits, one); + else + bits = caml_int64_sub(bits, one); + return caml_int64_float_of_bits(bits); + } + function caml_gr_size_y(){var s = caml_gr_state_get(); return s.height;} + function caml_pos_in(chanid){ + var chan = caml_ml_channels[chanid]; + return chan.offset - (chan.buffer_max - chan.buffer_curr) | 0; + } + function caml_ml_pos_in(chanid){return caml_pos_in(chanid);} + function caml_int64_and(x, y){return x.and(y);} + function caml_sys_const_word_size(){return 32;} + function caml_runtime_events_pause(){return 0;} + function caml_unix_unlink(name){ + var root = resolve_fs_device(name); + if(! root.device.unlink) + caml_failwith("caml_unix_unlink: not implemented"); + return root.device.unlink(root.rest, true); + } + function caml_sys_open_for_node(fd, flags){ + if(flags.name) + try{ + var fs = require("fs"), fd2 = fs.openSync(flags.name, "rs"); + return new MlNodeFd(fd2, flags); + } + catch(e){} + return new MlNodeFd(fd, flags); + } + function MlFakeFd_out(fd, flags){ + MlFakeFile.call(this, caml_create_bytes(0)); + this.log = function(s){return 0;}; + if(fd == 1 && typeof console.log == "function") + this.log = console.log; + else if(fd == 2 && typeof console.error == "function") + this.log = console.error; + else if(typeof console.log == "function") this.log = console.log; + this.flags = flags; + } + MlFakeFd_out.prototype.length = function(){return 0;}; + MlFakeFd_out.prototype.write = + function(offset, buf, pos, len){ + if(this.log){ + if + (len > 0 && pos >= 0 && pos + len <= buf.length + && buf[pos + len - 1] == 10) + len--; + var src = caml_create_bytes(len); + caml_blit_bytes(caml_bytes_of_array(buf), pos, src, 0, len); + this.log(src.toUtf16()); + return 0; + } + caml_raise_sys_error(this.fd + ": file descriptor already closed"); + }; + MlFakeFd_out.prototype.read = + function(offset, buf, pos, len){ + caml_raise_sys_error(this.fd + ": file descriptor is write only"); + }; + MlFakeFd_out.prototype.close = function(){this.log = undefined;}; + function caml_sys_open_internal(file, idx){ + if(idx == undefined) idx = caml_sys_fds.length; + caml_sys_fds[idx] = file; + return idx | 0; + } + function caml_sys_open(name, flags, _perms){ + var f = {}; + while(flags){ + switch(flags[1]){ + case 0: + f.rdonly = 1; break; + case 1: + f.wronly = 1; break; + case 2: + f.append = 1; break; + case 3: + f.create = 1; break; + case 4: + f.truncate = 1; break; + case 5: + f.excl = 1; break; + case 6: + f.binary = 1; break; + case 7: + f.text = 1; break; + case 8: + f.nonblock = 1; break; + } + flags = flags[2]; + } + if(f.rdonly && f.wronly) + caml_raise_sys_error + (caml_jsbytes_of_string(name) + + " : flags Open_rdonly and Open_wronly are not compatible"); + if(f.text && f.binary) + caml_raise_sys_error + (caml_jsbytes_of_string(name) + + " : flags Open_text and Open_binary are not compatible"); + var root = resolve_fs_device(name), file = root.device.open(root.rest, f); + return caml_sys_open_internal(file, undefined); + } + (function(){ + function file(fd, flags){ + return fs_node_supported() + ? caml_sys_open_for_node(fd, flags) + : new MlFakeFd_out(fd, flags); + } + caml_sys_open_internal + (file(0, {rdonly: 1, altname: "/dev/stdin", isCharacterDevice: true}), + 0); + caml_sys_open_internal + (file(1, {buffered: 2, wronly: 1, isCharacterDevice: true}), 1); + caml_sys_open_internal + (file(2, {buffered: 2, wronly: 1, isCharacterDevice: true}), 2); + } + ()); + function caml_string_get(s, i){ + if(i >>> 0 >= caml_ml_string_length(s)) caml_string_bound_error(); + return caml_string_unsafe_get(s, i); + } + var + re_match = + function(){ + var + re_word_letters = + [0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0xFF, + 0x03, + 0xFE, + 0xFF, + 0xFF, + 0x87, + 0xFE, + 0xFF, + 0xFF, + 0x07, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0xFF, + 0xFF, + 0x7F, + 0xFF, + 0xFF, + 0xFF, + 0x7F, + 0xFF], + opcodes = + {CHAR: 0, + CHARNORM: 1, + STRING: 2, + STRINGNORM: 3, + CHARCLASS: 4, + BOL: 5, + EOL: 6, + WORDBOUNDARY: 7, + BEGGROUP: 8, + ENDGROUP: 9, + REFGROUP: 10, + ACCEPT: 11, + SIMPLEOPT: 12, + SIMPLESTAR: 13, + SIMPLEPLUS: 14, + GOTO: 15, + PUSHBACK: 16, + SETMARK: 17, + CHECKPROGRESS: 18}; + function is_word_letter(c){ + return re_word_letters[c >> 3] >> (c & 7) & 1; + } + function in_bitset(s, i){ + return caml_string_get(s, i >> 3) >> (i & 7) & 1; + } + function re_match_impl(re, s, pos, partial){ + var + prog = caml_js_from_array(re[1]), + cpool = caml_js_from_array(re[2]), + normtable = caml_jsbytes_of_string(re[3]), + numgroups = re[4] | 0, + numregisters = re[5] | 0, + startchars = re[6] | 0, + s = caml_uint8_array_of_string(s), + pc = 0, + quit = false, + stack = [], + groups = new Array(numgroups), + re_register = new Array(numregisters); + for(var i = 0; i < groups.length; i++) + groups[i] = {start: - 1, end: - 1}; + groups[0].start = pos; + function backtrack(){ + while(stack.length){ + var item = stack.pop(); + if(item.undo) + item.undo.obj[item.undo.prop] = item.undo.value; + else if(item.pos){pc = item.pos.pc; pos = item.pos.txt; return;} + } + quit = true; + } + function push(item){stack.push(item);} + function accept(){ + groups[0].end = pos; + var result = new Array(1 + groups.length * 2); + result[0] = 0; + for(var i = 0; i < groups.length; i++){ + var g = groups[i]; + if(g.start < 0 || g.end < 0) g.start = g.end = - 1; + result[2 * i + 1] = g.start; + result[2 * i + 1 + 1] = g.end; + } + return result; + } + function prefix_match(){ + if(partial) return accept(); else backtrack(); + } + while(! quit){ + var + op = prog[pc] & 0xff, + sarg = prog[pc] >> 8, + uarg = sarg & 0xff, + c = s[pos], + group; + pc++; + switch(op){ + case opcodes.CHAR: + if(pos === s.length){prefix_match(); break;} + if(c === uarg) pos++; else backtrack(); + break; + case opcodes.CHARNORM: + if(pos === s.length){prefix_match(); break;} + if(normtable.charCodeAt(c) === uarg) pos++; else backtrack(); + break; + case opcodes.STRING: + for + (var arg = caml_jsbytes_of_string(cpool[uarg]), i = 0; + i < arg.length; + i++){ + if(pos === s.length){prefix_match(); break;} + if(c === arg.charCodeAt(i)) + c = s[++pos]; + else{backtrack(); break;} + } + break; + case opcodes.STRINGNORM: + for + (var arg = caml_jsbytes_of_string(cpool[uarg]), i = 0; + i < arg.length; + i++){ + if(pos === s.length){prefix_match(); break;} + if(normtable.charCodeAt(c) === arg.charCodeAt(i)) + c = s[++pos]; + else{backtrack(); break;} + } + break; + case opcodes.CHARCLASS: + if(pos === s.length){prefix_match(); break;} + if(in_bitset(cpool[uarg], c)) pos++; else backtrack(); + break; + case opcodes.BOL: + if(pos > 0 && s[pos - 1] != 10) backtrack(); break; + case opcodes.EOL: + if(pos < s.length && s[pos] != 10) backtrack(); break; + case opcodes.WORDBOUNDARY: + if(pos == 0){ + if(pos === s.length){prefix_match(); break;} + if(is_word_letter(s[0])) break; + backtrack(); + } + else if(pos === s.length){ + if(is_word_letter(s[pos - 1])) break; + backtrack(); + } + else{ + if(is_word_letter(s[pos - 1]) != is_word_letter(s[pos])) break; + backtrack(); + } + break; + case opcodes.BEGGROUP: + group = groups[uarg]; + push({undo: {obj: group, prop: "start", value: group.start}}); + group.start = pos; + break; + case opcodes.ENDGROUP: + group = groups[uarg]; + push({undo: {obj: group, prop: "end", value: group.end}}); + group.end = pos; + break; + case opcodes.REFGROUP: + group = groups[uarg]; + if(group.start < 0 || group.end < 0){backtrack(); break;} + for(var i = group.start; i < group.end; i++){ + if(pos === s.length){prefix_match(); break;} + if(s[i] != s[pos]){backtrack(); break;} + pos++; + } + break; + case opcodes.SIMPLEOPT: + if(in_bitset(cpool[uarg], c)) pos++; break; + case opcodes.SIMPLESTAR: + while(in_bitset(cpool[uarg], c)) c = s[++pos]; break; + case opcodes.SIMPLEPLUS: + if(pos === s.length){prefix_match(); break;} + if(in_bitset(cpool[uarg], c)) + do c = s[++pos];while(in_bitset(cpool[uarg], c)); + else + backtrack(); + break; + case opcodes.ACCEPT: return accept(); + case opcodes.GOTO: + pc = pc + sarg; break; + case opcodes.PUSHBACK: + push({pos: {pc: pc + sarg, txt: pos}}); break; + case opcodes.SETMARK: + push + ({undo: {obj: re_register, prop: uarg, value: re_register[uarg]}}); + re_register[uarg] = pos; + break; + case opcodes.CHECKPROGRESS: + if(re_register[uarg] === pos) backtrack(); break; + default: throw new Error("Invalid bytecode"); + } + } + return 0; + } + return re_match_impl; + } + (); + function re_search_backward(re, s, pos){ + if(pos < 0 || pos > caml_ml_string_length(s)) + caml_invalid_argument("Str.search_backward"); + while(pos >= 0){ + var res = re_match(re, s, pos, 0); + if(res) return res; + pos--; + } + return [0]; + } + function caml_js_from_string(s){return caml_jsstring_of_string(s);} + function caml_ba_sub(ba, ofs, len){ + var changed_dim, mul = 1; + if(ba.layout == 0){ + for(var i = 1; i < ba.dims.length; i++) mul = mul * ba.dims[i]; + changed_dim = 0; + } + else{ + for(var i = 0; i < ba.dims.length - 1; i++) mul = mul * ba.dims[i]; + changed_dim = ba.dims.length - 1; + ofs = ofs - 1; + } + if(ofs < 0 || len < 0 || ofs + len > ba.dims[changed_dim]) + caml_invalid_argument("Bigarray.sub: bad sub-array"); + var new_dims = []; + for(var i = 0; i < ba.dims.length; i++) new_dims[i] = ba.dims[i]; + new_dims[changed_dim] = len; + mul *= caml_ba_get_size_per_element(ba.kind); + var new_data = ba.data.subarray(ofs * mul, (ofs + len) * mul); + return caml_ba_create_unsafe(ba.kind, ba.layout, new_dims, new_data); + } + function caml_gc_full_major(unit){ + if(typeof globalThis.gc == "function") globalThis.gc(); + return 0; + } + function caml_ml_mutex_try_lock(t){ + if(! t.locked){t.locked = true; return 1;} + return 0; + } + function caml_bytes_set32(s, i, i32){ + if(i >>> 0 >= s.l - 3) caml_bytes_bound_error(); + var + b4 = 0xFF & i32 >> 24, + b3 = 0xFF & i32 >> 16, + b2 = 0xFF & i32 >> 8, + b1 = 0xFF & i32; + caml_bytes_unsafe_set(s, i + 0, b1); + caml_bytes_unsafe_set(s, i + 1, b2); + caml_bytes_unsafe_set(s, i + 2, b3); + caml_bytes_unsafe_set(s, i + 3, b4); + return 0; + } + function caml_gr_sigio_signal(){return 0;} + function caml_ba_uint8_set32(ba, i0, v){ + var ofs = ba.offset(i0); + if(ofs + 3 >= ba.data.length) caml_array_bound_error(); + ba.set(ofs + 0, v & 0xff); + ba.set(ofs + 1, v >>> 8 & 0xff); + ba.set(ofs + 2, v >>> 16 & 0xff); + ba.set(ofs + 3, v >>> 24 & 0xff); + return 0; + } + function caml_sys_const_ostype_unix(){return os_type == "Unix" ? 1 : 0;} + function caml_unix_gmtime(t){ + var + d = new Date(t * 1000), + d_num = d.getTime(), + januaryfirst = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)).getTime(), + doy = Math.floor((d_num - januaryfirst) / 86400000); + return [0, + d.getUTCSeconds(), + d.getUTCMinutes(), + d.getUTCHours(), + d.getUTCDate(), + d.getUTCMonth(), + d.getUTCFullYear() - 1900, + d.getUTCDay(), + doy, + false | 0]; + } + function caml_signbit_float(x){if(x == 0) x = 1 / x; return x < 0 ? 1 : 0;} + function caml_gr_current_x(){var s = caml_gr_state_get(); return s.x;} + function caml_gr_set_line_width(w){ + var s = caml_gr_state_get(); + s.line_width = w; + s.context.lineWidth = w; + return 0; + } + function caml_gr_set_font(f){ + var s = caml_gr_state_get(); + s.font = f; + s.context.font = s.text_size + "px " + caml_jsstring_of_string(s.font); + return 0; + } + function caml_gr_set_color(color){ + var s = caml_gr_state_get(); + function convert(number){ + var str = "" + number.toString(16); + while(str.length < 2) str = "0" + str; + return str; + } + var r = color >> 16 & 0xff, g = color >> 8 & 0xff, b = color >> 0 & 0xff; + s.color = color; + var c_str = "#" + convert(r) + convert(g) + convert(b); + s.context.fillStyle = c_str; + s.context.strokeStyle = c_str; + return 0; + } + function caml_gr_moveto(x, y){ + var s = caml_gr_state_get(); + s.x = x; + s.y = y; + return 0; + } + function caml_gr_resize_window(w, h){ + var s = caml_gr_state_get(); + s.width = w; + s.height = h; + s.canvas.width = w; + s.canvas.height = h; + return 0; + } + function caml_gr_state_init(){ + caml_gr_moveto(caml_gr_state.x, caml_gr_state.y); + caml_gr_resize_window(caml_gr_state.width, caml_gr_state.height); + caml_gr_set_line_width(caml_gr_state.line_width); + caml_gr_set_text_size(caml_gr_state.text_size); + caml_gr_set_font(caml_gr_state.font); + caml_gr_set_color(caml_gr_state.color); + caml_gr_set_window_title(caml_gr_state.title); + caml_gr_state.context.textBaseline = "bottom"; + } + function caml_ba_kind_of_typed_array(ta){ + var kind; + if(ta instanceof Float32Array) + kind = 0; + else if(ta instanceof Float64Array) + kind = 1; + else if(ta instanceof Int8Array) + kind = 2; + else if(ta instanceof Uint8Array) + kind = 3; + else if(ta instanceof Int16Array) + kind = 4; + else if(ta instanceof Uint16Array) + kind = 5; + else if(ta instanceof Int32Array) + kind = 6; + else if(ta instanceof Uint32Array) + kind = 6; + else + caml_invalid_argument("caml_ba_kind_of_typed_array: unsupported kind"); + return kind; + } + function caml_ba_from_typed_array(ta){ + var kind = caml_ba_kind_of_typed_array(ta); + return caml_ba_create_unsafe(kind, 0, [ta.length], ta); + } + function caml_ml_seek_out(chanid, pos){return caml_seek_out(chanid, pos);} + function caml_js_typeof(o){return typeof o;} + function caml_hash_mix_string(h, v){ + return caml_hash_mix_jsbytes(h, caml_jsbytes_of_string(v)); + } + function caml_string_hash(h, v){ + var h = caml_hash_mix_string(h, v), h = caml_hash_mix_final(h); + return h & 0x3FFFFFFF; + } + function caml_restore_raw_backtrace(exn, bt){return 0;} + function caml_gr_lineto(x, y){ + var s = caml_gr_state_get(); + s.context.beginPath(); + s.context.moveTo(s.x, s.height - s.y); + s.context.lineTo(x, s.height - y); + s.context.stroke(); + s.x = x; + s.y = y; + return 0; + } + function caml_js_function_arity(f){return f.l >= 0 ? f.l : f.l = f.length;} + function caml_js_wrap_meth_callback_unsafe(f){ + return function(){ + var len = caml_js_function_arity(f) - 1, args = new Array(len + 1); + args[0] = this; + for(var i = 0; i < len; i++) args[i + 1] = arguments[i]; + return caml_callback(f, args);}; + } + function caml_ba_dim_3(ba){return caml_ba_dim(ba, 2);} + function caml_is_special_exception(exn){ + switch(exn[2]){case - 8:case - 11:case - 12: return 1;default: return 0; + } + } + function caml_format_exception(exn){ + var r = ""; + if(exn[0] == 0){ + r += exn[1][1]; + if + (exn.length == 3 && exn[2][0] == 0 && caml_is_special_exception(exn[1])) + var bucket = exn[2], start = 1; + else + var start = 2, bucket = exn; + r += "("; + for(var i = start; i < bucket.length; i++){ + if(i > start) r += ", "; + var v = bucket[i]; + if(typeof v == "number") + r += v.toString(); + else if(v instanceof MlBytes) + r += '"' + v.toString() + '"'; + else if(typeof v == "string") + r += '"' + v.toString() + '"'; + else + r += "_"; + } + r += ")"; + } + else if(exn[0] == 248) r += exn[1]; + return r; + } + function caml_fatal_uncaught_exception(err){ + if(err instanceof Array && (err[0] == 0 || err[0] == 248)){ + var handler = caml_named_value("Printexc.handle_uncaught_exception"); + if(handler) + caml_callback(handler, [err, false]); + else{ + var + msg = caml_format_exception(err), + at_exit = caml_named_value("Pervasives.do_at_exit"); + if(at_exit) caml_callback(at_exit, [0]); + console.error("Fatal error: exception " + msg + "\n"); + if(err.js_error) throw err.js_error; + } + } + else + throw err; + } + function caml_ephe_check_data(x){ + return x[caml_ephe_data_offset] === undefined ? 0 : 1; + } + function caml_bytes_get16(s, i){ + if(i >>> 0 >= s.l - 1) caml_bytes_bound_error(); + var + b1 = caml_bytes_unsafe_get(s, i), + b2 = caml_bytes_unsafe_get(s, i + 1); + return b2 << 8 | b1; + } + function caml_obj_make_forward(b, v){b[0] = 250; b[1] = v; return 0;} + function caml_js_from_bool(x){return ! ! x;} + function caml_ml_set_channel_name(chanid, name){ + var chan = caml_ml_channels[chanid]; + chan.name = name; + return 0; + } + function caml_exp2_float(x){return Math.pow(2, x);} + function caml_gr_close_graph(){ + var s = caml_gr_state_get(); + s.canvas.width = 0; + s.canvas.height = 0; + return 0; + } + function caml_ml_domain_cpu_relax(unit){return 0;} + function caml_create_string(len){caml_invalid_argument("String.create");} + function caml_ml_input_block(chanid, ba, i, l){ + var + chan = caml_ml_channels[chanid], + n = l, + avail = chan.buffer_max - chan.buffer_curr; + if(l <= avail){ + ba.set(chan.buffer.subarray(chan.buffer_curr, chan.buffer_curr + l), i); + chan.buffer_curr += l; + } + else if(avail > 0){ + ba.set + (chan.buffer.subarray(chan.buffer_curr, chan.buffer_curr + avail), i); + chan.buffer_curr += avail; + n = avail; + } + else{ + chan.buffer_curr = 0; + chan.buffer_max = 0; + caml_refill(chan); + var avail = chan.buffer_max - chan.buffer_curr; + if(n > avail) n = avail; + ba.set(chan.buffer.subarray(chan.buffer_curr, chan.buffer_curr + n), i); + chan.buffer_curr += n; + } + return n | 0; + } + function caml_md5_chan(chanid, toread){ + var ctx = caml_MD5Init(), buffer = new Uint8Array(4096); + if(toread < 0) + while(true){ + var read = caml_ml_input_block(chanid, buffer, 0, buffer.length); + if(read == 0) break; + caml_MD5Update(ctx, buffer.subarray(0, read), read); + } + else + while(toread > 0){ + var + read = + caml_ml_input_block + (chanid, buffer, 0, toread > buffer.length ? buffer.length : toread); + if(read == 0) caml_raise_end_of_file(); + caml_MD5Update(ctx, buffer.subarray(0, read), read); + toread -= read; + } + return caml_string_of_array(caml_MD5Final(ctx)); + } + function caml_atanh_float(x){return Math.atanh(x);} + function caml_ml_condition_signal(t){return 0;} + function caml_unix_findnext(dir_handle){return caml_unix_readdir(dir_handle); + } + function caml_ml_output_bytes(chanid, buffer, offset, len){ + var chan = caml_ml_channels[chanid]; + if(! chan.opened) + caml_raise_sys_error("Cannot output to a closed channel"); + var buffer = caml_uint8_array_of_bytes(buffer); + buffer = buffer.subarray(offset, offset + len); + if(chan.buffer_curr + buffer.length > chan.buffer.length){ + var b = new Uint8Array(chan.buffer_curr + buffer.length); + b.set(chan.buffer); + chan.buffer = b; + } + switch(chan.buffered){ + case 0: + chan.buffer.set(buffer, chan.buffer_curr); + chan.buffer_curr += buffer.length; + caml_ml_flush(chanid); + break; + case 1: + chan.buffer.set(buffer, chan.buffer_curr); + chan.buffer_curr += buffer.length; + if(chan.buffer_curr >= chan.buffer.length) caml_ml_flush(chanid); + break; + case 2: + var id = buffer.lastIndexOf(10); + if(id < 0){ + chan.buffer.set(buffer, chan.buffer_curr); + chan.buffer_curr += buffer.length; + if(chan.buffer_curr >= chan.buffer.length) caml_ml_flush(chanid); + } + else{ + chan.buffer.set(buffer.subarray(0, id + 1), chan.buffer_curr); + chan.buffer_curr += id + 1; + caml_ml_flush(chanid); + chan.buffer.set(buffer.subarray(id + 1), chan.buffer_curr); + chan.buffer_curr += buffer.length - id - 1; + } + break; + } + return 0; + } + function caml_ml_output(chanid, buffer, offset, len){ + return caml_ml_output_bytes + (chanid, caml_bytes_of_string(buffer), offset, len); + } + function caml_ml_domain_id(unit){return caml_domain_id;} + function caml_ephe_get_data(x){ + return x[caml_ephe_data_offset] === undefined + ? 0 + : [0, x[caml_ephe_data_offset]]; + } + function caml_xmlhttprequest_create(unit){ + if(typeof globalThis.XMLHttpRequest !== "undefined") + try{return new globalThis.XMLHttpRequest();}catch(e){} + if(typeof globalThis.activeXObject !== "undefined"){ + try{return new globalThis.activeXObject("Msxml2.XMLHTTP");}catch(e){} + try{return new globalThis.activeXObject("Msxml3.XMLHTTP");}catch(e){} + try{return new globalThis.activeXObject("Microsoft.XMLHTTP");}catch(e){} + } + caml_failwith("Cannot create a XMLHttpRequest"); + } + function caml_trampoline_return(f, args){return {joo_tramp: f, joo_args: args}; + } + function caml_ml_is_buffered(chanid){ + return caml_ml_channels[chanid].buffered ? 1 : 0; + } + function caml_array_append(a1, a2){ + var l1 = a1.length, l2 = a2.length, l = l1 + l2 - 1, a = new Array(l); + a[0] = 0; + var i = 1, j = 1; + for(; i < l1; i++) a[i] = a1[i]; + for(; i < l; i++, j++) a[i] = a2[j]; + return a; + } + function caml_unix_gettimeofday(){return new Date().getTime() / 1000;} + function caml_unix_time(){return Math.floor(caml_unix_gettimeofday());} + function caml_ml_set_channel_refill(chanid, f){ + caml_ml_channels[chanid].refill = f; + return 0; + } + function caml_runtime_events_create_cursor(target){return {};} + function caml_fill_bytes(s, i, l, c){ + if(l > 0) + if(i == 0 && (l >= s.l || s.t == 2 && l >= s.c.length)) + if(c == 0){ + s.c = ""; + s.t = 2; + } + else{ + s.c = caml_str_repeat(l, String.fromCharCode(c)); + s.t = l == s.l ? 0 : 2; + } + else{ + if(s.t != 4) caml_convert_bytes_to_array(s); + for(l += i; i < l; i++) s.c[i] = c; + } + return 0; + } + function caml_js_expr(s){ + console.error("caml_js_expr: fallback to runtime evaluation\n"); + return eval(caml_jsstring_of_string(s)); + } + function caml_ml_runtime_warnings_enabled(_unit){return caml_runtime_warnings; + } + function caml_output_value_to_bytes(v, flags){ + return caml_bytes_of_array(caml_output_val(v, flags)); + } + function caml_eventlog_resume(unit){return 0;} + function caml_md5_string(s, ofs, len){ + return caml_md5_bytes(caml_bytes_of_string(s), ofs, len); + } + function caml_array_of_string(x){return caml_uint8_array_of_string(x);} + function caml_string_equal(s1, s2){if(s1 === s2) return 1; return 0;} + function caml_jsoo_flags_use_js_string(unit){return 1;} + function caml_output_value_to_buffer(s, ofs, len, v, flags){ + var t = caml_output_val(v, flags); + if(t.length > len) caml_failwith("Marshal.to_buffer: buffer overflow"); + caml_blit_bytes(t, 0, s, ofs, t.length); + return 0; + } + function re_replacement_text(repl, groups, orig){ + var + repl = caml_jsbytes_of_string(repl), + len = repl.length, + orig = caml_jsbytes_of_string(orig), + res = "", + n = 0, + cur, + start, + end, + c; + while(n < len){ + cur = repl.charAt(n++); + if(cur != "\\") + res += cur; + else{ + if(n == len) caml_failwith("Str.replace: illegal backslash sequence"); + cur = repl.charAt(n++); + switch(cur){ + case "\\": + res += cur; break; + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + c = + cur; + if(c * 2 >= groups.length - 1) + caml_failwith("Str.replace: reference to unmatched group"); + start = caml_array_get(groups, c * 2); + end = caml_array_get(groups, c * 2 + 1); + if(start == - 1) + caml_failwith("Str.replace: reference to unmatched group"); + res += orig.slice(start, end); + break; + default: res += "\\" + cur; + } + } + } + return caml_string_of_jsbytes(res); + } + function caml_pure_js_expr(s){ + console.error("caml_pure_js_expr: fallback to runtime evaluation\n"); + return eval(caml_jsstring_of_string(s)); + } + function caml_blit_string(a, b, c, d, e){ + caml_blit_bytes(caml_bytes_of_string(a), b, c, d, e); + return 0; + } + function blit_nat(nat1, ofs1, nat2, ofs2, len){ + for(var i = 0; i < len; i++) nat1.data[ofs1 + i] = nat2.data[ofs2 + i]; + return 0; + } + function caml_bigstring_blit_ba_to_bytes(ba1, pos1, bytes2, pos2, len){ + if(12 != ba1.kind) + caml_invalid_argument("caml_bigstring_blit_string_to_ba: kind mismatch"); + if(len == 0) return 0; + var ofs1 = ba1.offset(pos1); + if(ofs1 + len > ba1.data.length) caml_array_bound_error(); + if(pos2 + len > caml_ml_bytes_length(bytes2)) caml_array_bound_error(); + var slice = ba1.data.slice(ofs1, ofs1 + len); + caml_blit_bytes(caml_bytes_of_array(slice), 0, bytes2, pos2, len); + return 0; + } + function caml_unix_stat(name){ + var root = resolve_fs_device(name); + if(! root.device.stat) caml_failwith("caml_unix_stat: not implemented"); + return root.device.stat(root.rest, true); + } + function caml_register_named_value(nm, v){ + caml_named_values[caml_jsbytes_of_string(nm)] = v; + return 0; + } + function jsoo_create_file_extern(name, content){ + if(globalThis.jsoo_create_file) + globalThis.jsoo_create_file(name, content); + else{ + if(! globalThis.caml_fs_tmp) globalThis.caml_fs_tmp = []; + globalThis.caml_fs_tmp.push({name: name, content: content}); + } + return 0; + } + function caml_unix_stat_64(name){ + var r = caml_unix_stat(name); + r[9] = caml_int64_of_int32(r[9]); + } + function caml_to_js_string(s){return caml_jsstring_of_string(s);} + function caml_ml_mutex_lock(t){ + if(t.locked) + caml_failwith("Mutex.lock: mutex already locked. Cannot wait."); + else + t.locked = true; + return 0; + } + function re_search_forward(re, s, pos){ + if(pos < 0 || pos > caml_ml_string_length(s)) + caml_invalid_argument("Str.search_forward"); + while(pos <= caml_ml_string_length(s)){ + var res = re_match(re, s, pos, 0); + if(res) return res; + pos++; + } + return [0]; + } + function caml_make_vect(len, init){ + if(len < 0) caml_array_bound_error(); + var len = len + 1 | 0, b = new Array(len); + b[0] = 0; + for(var i = 1; i < len; i++) b[i] = init; + return b; + } + function caml_ml_seek_in(chanid, pos){return caml_seek_in(chanid, pos);} + function caml_sys_read_directory(name){ + var + root = resolve_fs_device(name), + a = root.device.readdir(root.rest), + l = new Array(a.length + 1); + l[0] = 0; + for(var i = 0; i < a.length; i++) l[i + 1] = caml_string_of_jsbytes(a[i]); + return l; + } + function caml_ml_output_char(chanid, c){ + var s = caml_string_of_jsbytes(String.fromCharCode(c)); + caml_ml_output(chanid, s, 0, 1); + return 0; + } + function caml_sys_const_ostype_win32(){return os_type == "Win32" ? 1 : 0;} + function caml_obj_is_block(x){return + (x instanceof Array);} + function caml_obj_set_raw_field(o, i, v){return o[i + 1] = v;} + function caml_js_var(x){ + var x = caml_jsstring_of_string(x); + if(! x.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*(\.[a-zA-Z_$][a-zA-Z_$0-9]*)*$/)) + console.error + ('caml_js_var: "' + x + + '" is not a valid JavaScript variable. continuing ..'); + return eval(x); + } + function caml_trunc_float(x){return Math.trunc(x);} + function caml_ephe_unset_data(x){ + if(globalThis.FinalizationRegistry && globalThis.WeakRef) + if(x[1] instanceof globalThis.FinalizationRegistry) + for(var j = caml_ephe_key_offset; j < x.length; j++){ + var key = x[j]; + if(key instanceof globalThis.WeakRef){ + key = key.deref(); + if(key) x[1].unregister(key); + } + } + x[caml_ephe_data_offset] = undefined; + return 0; + } + function caml_ephe_set_data(x, data){ + if(globalThis.FinalizationRegistry && globalThis.WeakRef) + if(! (x[1] instanceof globalThis.FinalizationRegistry)){ + x[1] = + new + globalThis.FinalizationRegistry + (function(){caml_ephe_unset_data(x);}); + for(var j = caml_ephe_key_offset; j < x.length; j++){ + var key = x[j]; + if(key instanceof globalThis.WeakRef){ + key = key.deref(); + if(key) x[1].register(key, undefined, key); + } + } + } + x[caml_ephe_data_offset] = data; + return 0; + } + function caml_ephe_blit_data(src, dst){ + var n = src[caml_ephe_data_offset]; + if(n === undefined) + caml_ephe_unset_data(dst); + else + caml_ephe_set_data(dst, n); + return 0; + } + function caml_is_printable(c){return + (c > 31 && c < 127);} + function caml_bytes_lessequal(s1, s2){ + s1.t & 6 && caml_convert_string_to_bytes(s1); + s2.t & 6 && caml_convert_string_to_bytes(s2); + return s1.c <= s2.c ? 1 : 0; + } + function caml_array_of_bytes(x){return caml_uint8_array_of_bytes(x);} + function caml_equal(x, y){return + (caml_compare_val(x, y, false) == 0);} + function re_partial_match(re, s, pos){ + if(pos < 0 || pos > caml_ml_string_length(s)) + caml_invalid_argument("Str.partial_match"); + var res = re_match(re, s, pos, 1); + return res ? res : [0]; + } + function caml_sys_random_seed(){ + if(globalThis.crypto) + if(typeof globalThis.crypto.getRandomValues === "function"){ + var a = new Uint32Array(1); + globalThis.crypto.getRandomValues(a); + return [0, a[0]]; + } + else if(globalThis.crypto.randomBytes === "function"){ + var buff = globalThis.crypto.randomBytes(4), a = new Uint32Array(buff); + return [0, a[0]]; + } + var now = new Date().getTime(), x = now ^ 0xffffffff * Math.random(); + return [0, x]; + } + var all_finalizers = new globalThis.Set(); + function caml_final_register_called_without_value(cb, a){ + if(globalThis.FinalizationRegistry && a instanceof Object){ + var + x = + new + globalThis.FinalizationRegistry + (function(x){all_finalizers.delete(x); cb(0); return;}); + x.register(a, x); + all_finalizers.add(x); + } + return 0; + } + function caml_ba_get_2(ba, i0, i1){return ba.get(ba.offset([i0, i1]));} + function caml_ba_uint8_set16(ba, i0, v){ + var ofs = ba.offset(i0); + if(ofs + 1 >= ba.data.length) caml_array_bound_error(); + ba.set(ofs + 0, v & 0xff); + ba.set(ofs + 1, v >>> 8 & 0xff); + return 0; + } + function caml_lazy_reset_to_lazy(o){ + caml_obj_update_tag(o, 244, 246); + return 0; + } + function caml_js_delete(o, f){delete o[f]; return 0;} + function caml_int_of_string(s){ + var + r = caml_parse_sign_and_base(s), + i = r[0], + sign = r[1], + base = r[2], + len = caml_ml_string_length(s), + threshold = - 1 >>> 0, + c = i < len ? caml_string_unsafe_get(s, i) : 0, + d = caml_parse_digit(c); + if(d < 0 || d >= base) caml_failwith("int_of_string"); + var res = d; + for(i++; i < len; i++){ + c = caml_string_unsafe_get(s, i); + if(c == 95) continue; + d = caml_parse_digit(c); + if(d < 0 || d >= base) break; + res = base * res + d; + if(res > threshold) caml_failwith("int_of_string"); + } + if(i != len) caml_failwith("int_of_string"); + res = sign * res; + if(base == 10 && (res | 0) != res) caml_failwith("int_of_string"); + return res | 0; + } + function caml_list_mount_point(){ + var prev = 0; + for(var i = 0; i < jsoo_mount_point.length; i++){ + var old = prev; + prev = [0, caml_string_of_jsbytes(jsoo_mount_point[i].path), old]; + } + return prev; + } + var + caml_marshal_constants = + {PREFIX_SMALL_BLOCK: 0x80, + PREFIX_SMALL_INT: 0x40, + PREFIX_SMALL_STRING: 0x20, + CODE_INT8: 0x00, + CODE_INT16: 0x01, + CODE_INT32: 0x02, + CODE_INT64: 0x03, + CODE_SHARED8: 0x04, + CODE_SHARED16: 0x05, + CODE_SHARED32: 0x06, + CODE_BLOCK32: 0x08, + CODE_BLOCK64: 0x13, + CODE_STRING8: 0x09, + CODE_STRING32: 0x0A, + CODE_DOUBLE_BIG: 0x0B, + CODE_DOUBLE_LITTLE: 0x0C, + CODE_DOUBLE_ARRAY8_BIG: 0x0D, + CODE_DOUBLE_ARRAY8_LITTLE: 0x0E, + CODE_DOUBLE_ARRAY32_BIG: 0x0F, + CODE_DOUBLE_ARRAY32_LITTLE: 0x07, + CODE_CODEPOINTER: 0x10, + CODE_INFIXPOINTER: 0x11, + CODE_CUSTOM: 0x12, + CODE_CUSTOM_LEN: 0x18, + CODE_CUSTOM_FIXED: 0x19}; + function caml_obj_raw_field(o, i){return o[i + 1];} + function caml_js_equals(x, y){return + (x == y);} + function caml_obj_compare_and_swap(x, i, old, n){ + if(x[i + 1] == old){x[i + 1] = n; return 1;} + return 0; + } + function bigstring_to_typed_array(bs){return bs.data;} + function caml_gr_arc_aux(ctx, cx, cy, ry, rx, a1, a2){ + while(a1 > a2) a2 += 360; + a1 /= 180; + a2 /= 180; + var + rot = 0, + xPos, + yPos, + xPos_prev, + yPos_prev, + space = 2, + num = (a2 - a1) * Math.PI * ((rx + ry) / 2) / space | 0, + delta = (a2 - a1) * Math.PI / num, + i = a1 * Math.PI; + for(var j = 0; j <= num; j++){ + xPos = + cx - rx * Math.sin(i) * Math.sin(rot * Math.PI) + + ry * Math.cos(i) * Math.cos(rot * Math.PI); + xPos = xPos.toFixed(2); + yPos = + cy + ry * Math.cos(i) * Math.sin(rot * Math.PI) + + rx * Math.sin(i) * Math.cos(rot * Math.PI); + yPos = yPos.toFixed(2); + if(j == 0) + ctx.moveTo(xPos, yPos); + else if(xPos_prev != xPos || yPos_prev != yPos) ctx.lineTo(xPos, yPos); + xPos_prev = xPos; + yPos_prev = yPos; + i -= delta; + } + return 0; + } + function caml_gr_fill_arc(x, y, rx, ry, a1, a2){ + var s = caml_gr_state_get(); + s.context.beginPath(); + caml_gr_arc_aux(s.context, x, s.height - y, rx, ry, a1, a2); + s.context.fill(); + return 0; + } + function caml_ba_slice(ba, vind){ + vind = caml_js_from_array(vind); + var num_inds = vind.length, index = [], sub_dims = [], ofs; + if(num_inds > ba.dims.length) + caml_invalid_argument("Bigarray.slice: too many indices"); + if(ba.layout == 0){ + for(var i = 0; i < num_inds; i++) index[i] = vind[i]; + for(; i < ba.dims.length; i++) index[i] = 0; + sub_dims = ba.dims.slice(num_inds); + } + else{ + for(var i = 0; i < num_inds; i++) + index[ba.dims.length - num_inds + i] = vind[i]; + for(var i = 0; i < ba.dims.length - num_inds; i++) index[i] = 1; + sub_dims = ba.dims.slice(0, ba.dims.length - num_inds); + } + ofs = ba.offset(index); + var + size = caml_ba_get_size(sub_dims), + size_per_element = caml_ba_get_size_per_element(ba.kind), + new_data = + ba.data.subarray + (ofs * size_per_element, (ofs + size) * size_per_element); + return caml_ba_create_unsafe(ba.kind, ba.layout, sub_dims, new_data); + } + function caml_js_wrap_callback_unsafe(f){ + return function(){ + var len = caml_js_function_arity(f), args = new Array(len); + for(var i = 0; i < len; i++) args[i] = arguments[i]; + return caml_callback(f, args);}; + } + function caml_ba_kind(ba){return ba.kind;} + function caml_alloc_dummy_infix(){ + return function f(x){return caml_call_gen(f.fun, [x]);}; + } + function caml_js_fun_call(f, a){ + switch(a.length){ + case 1: + return f(); + case 2: + return f(a[1]); + case 3: + return f(a[1], a[2]); + case 4: + return f(a[1], a[2], a[3]); + case 5: + return f(a[1], a[2], a[3], a[4]); + case 6: + return f(a[1], a[2], a[3], a[4], a[5]); + case 7: + return f(a[1], a[2], a[3], a[4], a[5], a[6]); + case 8: + return f(a[1], a[2], a[3], a[4], a[5], a[6], a[7]); + } + return f.apply(null, caml_js_from_array(a)); + } + function caml_gc_major_slice(work){return 0;} + function caml_js_pure_expr(f){return caml_callback(f, [0]);} + function compare_digits_nat(nat1, ofs1, nat2, ofs2){ + if(nat1.data[ofs1] > nat2.data[ofs2]) return 1; + if(nat1.data[ofs1] < nat2.data[ofs2]) return - 1; + return 0; + } + function caml_ml_input(chanid, b, i, l){ + var ba = caml_uint8_array_of_bytes(b); + return caml_ml_input_block(chanid, ba, i, l); + } + function caml_gr_wait_event(_evl){ + caml_failwith + ("caml_gr_wait_event not Implemented: use Graphics_js instead"); + } + function caml_gr_sigio_handler(){return 0;} + function caml_hash_mix_bigstring(h, bs){ + return caml_hash_mix_bytes_arr(h, bs.data); + } + function caml_record_backtrace(b){ + caml_record_backtrace_flag = b; + return 0; + } + function caml_unix_cleanup(){} + function caml_sys_get_config(){ + return [0, caml_string_of_jsbytes(os_type), 32, 0]; + } + function caml_sys_const_backend_type(){ + return [0, caml_string_of_jsbytes("js_of_ocaml")]; + } + function caml_obj_is_shared(x){return 1;} + function caml_ml_out_channels_list(){ + var l = 0; + for(var c = 0; c < caml_ml_channels.length; c++) + if + (caml_ml_channels[c] && caml_ml_channels[c].opened + && caml_ml_channels[c].out) + l = [0, caml_ml_channels[c].fd, l]; + return l; + } + function caml_asinh_float(x){return Math.asinh(x);} + function caml_pos_out(chanid){ + var chan = caml_ml_channels[chanid]; + return chan.offset + chan.buffer_curr; + } + function bigstring_of_array_buffer(ab){ + var ta = new Uint8Array(ab); + return caml_ba_create_unsafe(12, 0, [ta.length], ta); + } + function caml_mod(x, y){if(y == 0) caml_raise_zero_divide(); return x % y;} + function caml_ba_init(){return 0;} + function caml_unix_filedescr_of_fd(x){return x;} + function re_string_match(re, s, pos){ + if(pos < 0 || pos > caml_ml_string_length(s)) + caml_invalid_argument("Str.string_match"); + var res = re_match(re, s, pos, 0); + return res ? res : [0]; + } + function BigStringReader(bs, i){this.s = bs; this.i = i;} + BigStringReader.prototype = + {read8u: function(){return caml_ba_get_1(this.s, this.i++);}, + read8s: function(){return caml_ba_get_1(this.s, this.i++) << 24 >> 24;}, + read16u: + function(){ + var s = this.s, i = this.i; + this.i = i + 2; + return caml_ba_get_1(s, i) << 8 | caml_ba_get_1(s, i + 1); + }, + read16s: + function(){ + var s = this.s, i = this.i; + this.i = i + 2; + return caml_ba_get_1(s, i) << 24 >> 16 | caml_ba_get_1(s, i + 1); + }, + read32u: + function(){ + var s = this.s, i = this.i; + this.i = i + 4; + return (caml_ba_get_1(s, i) << 24 | caml_ba_get_1(s, i + 1) << 16 + | caml_ba_get_1(s, i + 2) << 8 + | caml_ba_get_1(s, i + 3)) + >>> 0; + }, + read32s: + function(){ + var s = this.s, i = this.i; + this.i = i + 4; + return caml_ba_get_1(s, i) << 24 | caml_ba_get_1(s, i + 1) << 16 + | caml_ba_get_1(s, i + 2) << 8 + | caml_ba_get_1(s, i + 3); + }, + readstr: + function(len){ + var i = this.i, arr = new Array(len); + for(var j = 0; j < len; j++) arr[j] = caml_ba_get_1(this.s, i + j); + this.i = i + len; + return caml_string_of_array(arr); + }, + readuint8array: + function(len){ + var i = this.i, offset = this.offset(i); + this.i = i + len; + return this.s.data.subarray(offset, offset + len); + }}; + function caml_gr_dump_image(im){ + var data = [0]; + for(var i = 0; i < im.height; i++){ + data[i + 1] = [0]; + for(var j = 0; j < im.width; j++){ + var + o = i * (im.width * 4) + j * 4, + r = im.data[o + 0], + g = im.data[o + 1], + b = im.data[o + 2]; + data[i + 1][j + 1] = (r << 16) + (g << 8) + b; + } + } + return data; + } + function caml_ba_get_generic(ba, i){ + var ofs = ba.offset(caml_js_from_array(i)); + return ba.get(ofs); + } + function caml_unix_startup(){} + function caml_get_exception_backtrace(){return 0;} + function caml_format_float(fmt, x){ + function toFixed(x, dp){ + if(Math.abs(x) < 1.0) + return x.toFixed(dp); + else{ + var e = parseInt(x.toString().split("+")[1]); + if(e > 20){ + e -= 20; + x /= Math.pow(10, e); + x += new Array(e + 1).join("0"); + if(dp > 0) x = x + "." + new Array(dp + 1).join("0"); + return x; + } + else + return x.toFixed(dp); + } + } + var s, f = caml_parse_format(fmt), prec = f.prec < 0 ? 6 : f.prec; + if(x < 0 || x == 0 && 1 / x == - Infinity){f.sign = - 1; x = - x;} + if(isNaN(x)){ + s = "nan"; + f.filler = " "; + } + else if(! isFinite(x)){ + s = "inf"; + f.filler = " "; + } + else + switch(f.conv){ + case "e": + var s = x.toExponential(prec), i = s.length; + if(s.charAt(i - 3) == "e") + s = s.slice(0, i - 1) + "0" + s.slice(i - 1); + break; + case "f": + s = toFixed(x, prec); break; + case "g": + prec = prec ? prec : 1; + s = x.toExponential(prec - 1); + var j = s.indexOf("e"), exp = + s.slice(j + 1); + if(exp < - 4 || x >= 1e21 || x.toFixed(0).length > prec){ + var i = j - 1; + while(s.charAt(i) == "0") i--; + if(s.charAt(i) == ".") i--; + s = s.slice(0, i + 1) + s.slice(j); + i = s.length; + if(s.charAt(i - 3) == "e") + s = s.slice(0, i - 1) + "0" + s.slice(i - 1); + break; + } + else{ + var p = prec; + if(exp < 0){ + p -= exp + 1; + s = x.toFixed(p); + } + else + while(s = x.toFixed(p), s.length > prec + 1) p--; + if(p){ + var i = s.length - 1; + while(s.charAt(i) == "0") i--; + if(s.charAt(i) == ".") i--; + s = s.slice(0, i + 1); + } + } + break; + } + return caml_finish_formatting(f, s); + } + function caml_mount_autoload(name, f){ + var + path = caml_make_path(name), + name = caml_trailing_slash(path.join("/")); + jsoo_mount_point.push({path: name, device: new MlFakeDevice(name, f)}); + return 0; + } + function caml_string_lessthan(s1, s2){return s1 < s2 ? 1 : 0;} + function caml_string_greaterthan(s1, s2){return caml_string_lessthan(s2, s1); + } + function caml_div(x, y){ + if(y == 0) caml_raise_zero_divide(); + return x / y | 0; + } + function caml_obj_dup(x){ + var l = x.length, a = new Array(l); + for(var i = 0; i < l; i++) a[i] = x[i]; + return a; + } + function caml_ephe_get_data_copy(x){ + return x[caml_ephe_data_offset] === undefined + ? 0 + : [0, caml_obj_dup(x[caml_ephe_data_offset])]; + } + function caml_memprof_start(rate, stack_size, tracker){return 0;} + function caml_sys_get_argv(a){return [0, caml_argv[1], caml_argv];} + function caml_ml_domain_set_name(_name){return 0;} + function caml_js_to_bool(x){return + x;} + function caml_gr_create_image(x, y){ + var s = caml_gr_state_get(); + return s.context.createImageData(x, y); + } + function caml_ephe_get_key_copy(x, i){ + if(i < 0 || caml_ephe_key_offset + i >= x.length) + caml_invalid_argument("Weak.get_copy"); + var y = caml_ephe_get_key(x, i); + if(y === 0) return y; + var z = y[1]; + if(z instanceof Array) return [0, caml_obj_dup(z)]; + return y; + } + function caml_lessthan(x, y){return + (caml_compare_val(x, y, false) < 0);} + function caml_raw_backtrace_next_slot(){return 0;} + function caml_build_symbols(toc){ + var symb; + while(toc) + if(caml_jsstring_of_string(toc[1][1]) == "SYJS"){symb = toc[1][2]; break;} + else + toc = toc[2]; + var r = {}; + if(symb) + for(var i = 1; i < symb.length; i++) + r[caml_jsstring_of_string(symb[i][1])] = symb[i][2]; + return r; + } + function caml_register_global(n, v, name_opt){ + if(name_opt){ + var name = name_opt; + if(globalThis.toplevelReloc) + n = caml_callback(globalThis.toplevelReloc, [name]); + else if(caml_global_data.toc){ + if(! caml_global_data.symbols) + caml_global_data.symbols = caml_build_symbols(caml_global_data.toc); + var nid = caml_global_data.symbols[name]; + if(nid >= 0) + n = nid; + else + caml_failwith("caml_register_global: cannot locate " + name); + } + } + caml_global_data[n + 1] = v; + if(name_opt) caml_global_data[name_opt] = v; + } + function mult_nat(nat1, ofs1, len1, nat2, ofs2, len2, nat3, ofs3, len3){ + var carry = 0; + for(var i = 0; i < len3; i++) + carry += + mult_digit_nat + (nat1, ofs1 + i, len1 - i, nat2, ofs2, len2, nat3, ofs3 + i); + return carry; + } + function square_nat(nat1, ofs1, len1, nat2, ofs2, len2){ + var carry = 0; + carry += add_nat(nat1, ofs1, len1, nat1, ofs1, len1, 0); + carry += mult_nat(nat1, ofs1, len1, nat2, ofs2, len2, nat2, ofs2, len2); + return carry; + } + function caml_js_from_float(x){return x;} + function caml_floatarray_create(len){ + if(len < 0) caml_array_bound_error(); + var len = len + 1 | 0, b = new Array(len); + b[0] = 254; + for(var i = 1; i < len; i++) b[i] = 0; + return b; + } + function caml_gc_stat(){ + return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + } + function caml_get_major_credit(n){return 0;} + function caml_sys_modify_argv(arg){caml_argv = arg; return 0;} + var caml_method_cache = []; + function caml_get_public_method(obj, tag, cacheid){ + var meths = obj[1], ofs = caml_method_cache[cacheid]; + if(ofs === undefined) + for(var i = caml_method_cache.length; i < cacheid; i++) + caml_method_cache[i] = 0; + else if(meths[ofs] === tag) return meths[ofs - 1]; + var li = 3, hi = meths[1] * 2 + 1, mi; + while(li < hi){ + mi = li + hi >> 1 | 1; + if(tag < meths[mi + 1]) hi = mi - 2; else li = mi; + } + caml_method_cache[cacheid] = li + 1; + return tag == meths[li + 1] ? meths[li] : 0; + } + function caml_js_get_console(){ + var + c = console, + m = + ["log", + "debug", + "info", + "warn", + "error", + "assert", + "dir", + "dirxml", + "trace", + "group", + "groupCollapsed", + "groupEnd", + "time", + "timeEnd"]; + function f(){} + for(var i = 0; i < m.length; i++) if(! c[m[i]]) c[m[i]] = f; + return c; + } + function caml_sys_unsafe_getenv(name){return caml_sys_getenv(name);} + function caml_ml_open_descriptor_in(fd){ + var file = caml_sys_fds[fd]; + if(file.flags.wronly) caml_raise_sys_error("fd " + fd + " is writeonly"); + var + refill = null, + channel = + {file: file, + offset: file.flags.append ? file.length() : 0, + fd: fd, + opened: true, + out: false, + buffer_curr: 0, + buffer_max: 0, + buffer: new Uint8Array(65536), + refill: refill}; + caml_ml_channels[channel.fd] = channel; + return channel.fd; + } + function bigstring_of_typed_array(ba){ + var + ta = + new + Uint8Array + (ba.buffer, ba.byteOffset, ba.length * ba.BYTES_PER_ELEMENT); + return caml_ba_create_unsafe(12, 0, [ta.length], ta); + } + function caml_round_float(x){return Math.round(x);} + function caml_ojs_new_arr(c, a){ + switch(a.length){ + case 0: + return new c(); + case 1: + return new c(a[0]); + case 2: + return new c(a[0], a[1]); + case 3: + return new c(a[0], a[1], a[2]); + case 4: + return new c(a[0], a[1], a[2], a[3]); + case 5: + return new c(a[0], a[1], a[2], a[3], a[4]); + case 6: + return new c(a[0], a[1], a[2], a[3], a[4], a[5]); + case 7: + return new c(a[0], a[1], a[2], a[3], a[4], a[5], a[6]); + } + function F(){return c.apply(this, a);} + F.prototype = c.prototype; + return new F(); + } + function complement_nat(nat, ofs, len){ + for(var i = 0; i < len; i++) + nat.data[ofs + i] = (- 1 >>> 0) - (nat.data[ofs + i] >>> 0); + } + var caml_domain_dls = [0]; + function caml_domain_dls_set(a){caml_domain_dls = a;} + function caml_lazy_read_result(o){ + return caml_obj_tag(o) == 250 ? o[1] : o; + } + var caml_js_regexps = {amp: /&/g, lt: / 1023){ + exp -= 1023; + x *= Math.pow(2, 1023); + if(exp > 1023){exp -= 1023; x *= Math.pow(2, 1023);} + } + if(exp < - 1023){exp += 1023; x *= Math.pow(2, - 1023);} + x *= Math.pow(2, exp); + return x; + } + function caml_gr_state_set(ctx){ + caml_gr_state = ctx; + caml_gr_state_init(); + return 0; + } + function caml_js_wrap_callback_strict(arity, f){ + return function(){ + var + n = arguments.length, + args = new Array(arity), + len = Math.min(arguments.length, arity); + for(var i = 0; i < len; i++) args[i] = arguments[i]; + return caml_callback(f, args);}; + } + function caml_gc_minor_words(unit){return 0;} + function caml_get_current_callstack(){return [0];} + function land_digit_nat(nat1, ofs1, nat2, ofs2){nat1.data[ofs1] &= nat2.data[ofs2]; return 0; + } + function caml_int64_mod(x, y){return x.mod(y);} + function caml_obj_set_tag(x, tag){x[0] = tag; return 0;} + function caml_int32_bswap(x){ + return (x & 0x000000FF) << 24 | (x & 0x0000FF00) << 8 + | (x & 0x00FF0000) >>> 8 + | (x & 0xFF000000) >>> 24; + } + function caml_ba_set_3(ba, i0, i1, i2, v){ + ba.set(ba.offset([i0, i1, i2]), v); + return 0; + } + function caml_js_instanceof(o, c){return o instanceof c ? 1 : 0;} + function caml_get_major_bucket(n){return 0;} + function nth_digit_nat_native(nat, ofs){return nat.data[ofs];} + function set_digit_nat_native(nat, ofs, digit){nat.data[ofs] = digit; return 0; + } + function caml_string_set64(s, i, i64){caml_failwith("caml_string_set64");} + function caml_gr_state_create(canvas, w, h){ + var context = canvas.getContext("2d"); + return {context: context, + canvas: canvas, + x: 0, + y: 0, + width: w, + height: h, + line_width: 1, + font: caml_string_of_jsbytes("fixed"), + text_size: 26, + color: 0x000000, + title: caml_string_of_jsbytes("")}; + } + function caml_gr_draw_arc(x, y, rx, ry, a1, a2){ + var s = caml_gr_state_get(); + s.context.beginPath(); + caml_gr_arc_aux(s.context, x, s.height - y, rx, ry, a1, a2); + s.context.stroke(); + return 0; + } + function caml_ba_map_file(vfd, kind, layout, shared, dims, pos){caml_failwith("caml_ba_map_file not implemented"); + } + function caml_ba_map_file_bytecode(argv, argn){ + return caml_ba_map_file + (argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); + } + function caml_ba_create_from(data1, data2, jstyp, kind, layout, dims){ + if(data2 || caml_ba_get_size_per_element(kind) == 2) + caml_invalid_argument + ("caml_ba_create_from: use return caml_ba_create_unsafe"); + return caml_ba_create_unsafe(kind, layout, dims, data1); + } + function caml_tanh_float(x){return Math.tanh(x);} + function caml_runtime_events_start(){return 0;} + function caml_gr_draw_str(str){ + var s = caml_gr_state_get(), m = s.context.measureText(str), dx = m.width; + s.context.fillText(str, s.x, s.height - s.y); + s.x += dx | 0; + return 0; + } + function caml_gr_draw_string(str){ + caml_gr_draw_str(caml_jsstring_of_string(str)); + return 0; + } + function caml_gr_draw_char(c){ + caml_gr_draw_str(String.fromCharCode(c)); + return 0; + } + function caml_unmount(name){ + var + path = caml_make_path(name), + name = caml_trailing_slash(path.join("/")), + idx = - 1; + for(var i = 0; i < jsoo_mount_point.length; i++) + if(jsoo_mount_point[i].path == name) idx = i; + if(idx > - 1) jsoo_mount_point.splice(idx, 1); + return 0; + } + function caml_bigstring_blit_ba_to_ba(ba1, pos1, ba2, pos2, len){ + if(12 != ba1.kind) + caml_invalid_argument("caml_bigstring_blit_ba_to_ba: kind mismatch"); + if(12 != ba2.kind) + caml_invalid_argument("caml_bigstring_blit_ba_to_ba: kind mismatch"); + if(len == 0) return 0; + var ofs1 = ba1.offset(pos1), ofs2 = ba2.offset(pos2); + if(ofs1 + len > ba1.data.length) caml_array_bound_error(); + if(ofs2 + len > ba2.data.length) caml_array_bound_error(); + var slice = ba1.data.subarray(ofs1, ofs1 + len); + ba2.data.set(slice, pos2); + return 0; + } + function caml_input_value_from_string(s, ofs){ + var reader = new MlStringReader(s, typeof ofs == "number" ? ofs : ofs[0]); + return caml_input_value_from_reader(reader, ofs); + } + function caml_ml_pos_in_64(chanid){ + return caml_int64_of_float(caml_pos_in(chanid)); + } + function caml_gr_draw_image(im, x, y){ + var s = caml_gr_state_get(); + if(! im.image){ + var canvas = document.createElement("canvas"); + canvas.width = s.width; + canvas.height = s.height; + canvas.getContext("2d").putImageData(im, 0, 0); + var image = new globalThis.Image(); + image.onload = + function(){ + s.context.drawImage(image, x, s.height - im.height - y); + im.image = image; + }; + image.src = canvas.toDataURL("image/png"); + } + else + s.context.drawImage(im.image, x, s.height - im.height - y); + return 0; + } + function caml_register_channel_for_spacetime(_channel){return 0;} + function caml_string_set(s, i, c){caml_failwith("caml_string_set");} + function caml_sys_rmdir(name){ + var root = resolve_fs_device(name); + root.device.rmdir(root.rest); + return 0; + } + function caml_unix_symlink(to_dir, src, dst){ + var src_root = resolve_fs_device(src), dst_root = resolve_fs_device(dst); + if(src_root.device != dst_root.device) + caml_failwith + ("caml_unix_symlink: cannot symlink between two filesystems"); + if(! src_root.device.symlink) + caml_failwith("caml_unix_symlink: not implemented"); + return src_root.device.symlink(to_dir, src_root.rest, dst_root.rest, true); + } + function caml_ml_pos_out(chanid){return caml_pos_out(chanid);} + function caml_spacetime_enabled(_unit){return 0;} + function caml_bytes_notequal(s1, s2){return 1 - caml_bytes_equal(s1, s2);} + function caml_runtime_parameters(_unit){return caml_string_of_jsbytes("");} + function caml_js_object(a){ + var o = {}; + for(var i = 1; i < a.length; i++){ + var p = a[i]; + o[caml_jsstring_of_string(p[1])] = p[2]; + } + return o; + } + function caml_ba_create(kind, layout, dims_ml){ + var + dims = caml_js_from_array(dims_ml), + data = caml_ba_create_buffer(kind, caml_ba_get_size(dims)); + return caml_ba_create_unsafe(kind, layout, dims, data); + } + function caml_gr_remember_mode(){ + caml_failwith("caml_gr_remember_mode not Implemented"); + } + function caml_fma_float(x, y, z){ + var + SPLIT = Math.pow(2, 27) + 1, + MIN_VALUE = Math.pow(2, - 1022), + EPSILON = Math.pow(2, - 52), + C = 416, + A = Math.pow(2, + C), + B = Math.pow(2, - C); + function multiply(a, b){ + var + at = SPLIT * a, + ahi = at - (at - a), + alo = a - ahi, + bt = SPLIT * b, + bhi = bt - (bt - b), + blo = b - bhi, + p = a * b, + e = ahi * bhi - p + ahi * blo + alo * bhi + alo * blo; + return {p: p, e: e}; + } + function add(a, b){ + var s = a + b, v = s - a, e = a - (s - v) + (b - v); + return {s: s, e: e}; + } + function adjust(x, y){ + return x !== 0 && y !== 0 && SPLIT * x - (SPLIT * x - x) === x + ? x * (1 + (x < 0 ? - 1 : + 1) * (y < 0 ? - 1 : + 1) * EPSILON) + : x; + } + if + (x === 0 || x !== x || x === + (1 / 0) || x === - (1 / 0) || y === 0 + || y !== y + || y === + (1 / 0) + || y === - (1 / 0)) + return x * y + z; + if(z === 0) return x * y; + if(z !== z || z === + (1 / 0) || z === - (1 / 0)) return z; + var scale = 1; + while(Math.abs(x) > A){scale *= A; x *= B;} + while(Math.abs(y) > A){scale *= A; y *= B;} + if(scale === 1 / 0) return x * y * scale; + while(Math.abs(x) < B){scale *= B; x *= A;} + while(Math.abs(y) < B){scale *= B; y *= A;} + if(scale === 0) return z; + var xs = x, ys = y, zs = z / scale; + if(Math.abs(zs) > Math.abs(xs * ys) * 4 / EPSILON) return z; + if(Math.abs(zs) < Math.abs(xs * ys) * EPSILON / 4 * EPSILON / 4) + zs = (z < 0 ? - 1 : + 1) * MIN_VALUE; + var + xy = multiply(xs, ys), + s = add(xy.p, zs), + u = add(xy.e, s.e), + i = add(s.s, u.s), + f = i.s + adjust(i.e, u.e); + if(f === 0) return f; + var fs = f * scale; + if(Math.abs(fs) > MIN_VALUE) return fs; + return fs + adjust(f - fs / scale, i.e) * scale; + } + function caml_recommended_domain_count(unit){return 1;} + function caml_bswap16(x){return (x & 0x00FF) << 8 | (x & 0xFF00) >> 8;} + function caml_ml_set_binary_mode(chanid, mode){ + var chan = caml_ml_channels[chanid]; + chan.file.flags.text = ! mode; + chan.file.flags.binary = mode; + return 0; + } + function caml_final_register(){return 0;} + function caml_gr_draw_rect(x, y, w, h){ + var s = caml_gr_state_get(); + s.context.strokeRect(x, s.height - y, w, - h); + return 0; + } + function caml_string_get16(s, i){ + if(i >>> 0 >= caml_ml_string_length(s) - 1) caml_string_bound_error(); + var + b1 = caml_string_unsafe_get(s, i), + b2 = caml_string_unsafe_get(s, i + 1); + return b2 << 8 | b1; + } + function caml_output_value(chanid, v, flags){ + var s = caml_output_value_to_string(v, flags); + caml_ml_output(chanid, s, 0, caml_ml_string_length(s)); + return 0; + } + function caml_ba_get_3(ba, i0, i1, i2){ + return ba.get(ba.offset([i0, i1, i2])); + } + function caml_ephe_blit_key(a1, i1, a2, i2, len){ + caml_array_blit + (a1, + caml_ephe_key_offset + i1 - 1, + a2, + caml_ephe_key_offset + i2 - 1, + len); + return 0; + } + var caml_initial_time = new Date().getTime() * 0.001; + function caml_sys_time(){ + var now = new Date().getTime(); + return now * 0.001 - caml_initial_time; + } + function caml_sys_time_include_children(b){return caml_sys_time();} + function caml_check_bound(array, index){ + if(index >>> 0 >= array.length - 1) caml_array_bound_error(); + return array; + } + function caml_unix_getpwuid(unit){caml_raise_not_found();} + function caml_hash(count, limit, seed, obj){ + var queue, rd, wr, sz, num, h, v, i, len; + sz = limit; + if(sz < 0 || sz > 256) sz = 256; + num = count; + h = seed; + queue = [obj]; + rd = 0; + wr = 1; + while(rd < wr && num > 0){ + v = queue[rd++]; + if(v && v.caml_custom){ + if + (caml_custom_ops[v.caml_custom] && caml_custom_ops[v.caml_custom].hash){ + var hh = caml_custom_ops[v.caml_custom].hash(v); + h = caml_hash_mix_int(h, hh); + num--; + } + } + else if(v instanceof Array && v[0] === (v[0] | 0)) + switch(v[0]){ + case 248: + h = caml_hash_mix_int(h, v[2]); num--; break; + case 250: + queue[--rd] = v[1]; break; + default: + if(caml_is_continuation_tag(v[0])) break; + var tag = v.length - 1 << 10 | v[0]; + h = caml_hash_mix_int(h, tag); + for(i = 1, len = v.length; i < len; i++){if(wr >= sz) break; queue[wr++] = v[i]; + } + break; + } + else if(caml_is_ml_bytes(v)){ + h = caml_hash_mix_bytes(h, v); + num--; + } + else if(caml_is_ml_string(v)){ + h = caml_hash_mix_string(h, v); + num--; + } + else if(typeof v === "string"){ + h = caml_hash_mix_jsbytes(h, v); + num--; + } + else if(v === (v | 0)){ + h = caml_hash_mix_int(h, v + v + 1); + num--; + } + else if(v === + v){h = caml_hash_mix_float(h, v); num--;} + } + h = caml_hash_mix_final(h); + return h & 0x3FFFFFFF; + } + function caml_ba_to_typed_array(ba){return ba.data;} + function caml_domain_dls_get(unit){return caml_domain_dls;} + function caml_bytes_get32(s, i){ + if(i >>> 0 >= s.l - 3) caml_bytes_bound_error(); + var + b1 = caml_bytes_unsafe_get(s, i), + b2 = caml_bytes_unsafe_get(s, i + 1), + b3 = caml_bytes_unsafe_get(s, i + 2), + b4 = caml_bytes_unsafe_get(s, i + 3); + return b4 << 24 | b3 << 16 | b2 << 8 | b1; + } + function caml_frexp_float(x){ + if(x == 0 || ! isFinite(x)) return [0, x, 0]; + var neg = x < 0; + if(neg) x = - x; + var exp = Math.max(- 1023, jsoo_floor_log2(x) + 1); + x *= Math.pow(2, - exp); + while(x < 0.5){x *= 2; exp--;} + while(x >= 1){x *= 0.5; exp++;} + if(neg) x = - x; + return [0, x, exp]; + } + function caml_string_get64(s, i){ + if(i >>> 0 >= caml_ml_string_length(s) - 7) caml_string_bound_error(); + var a = new Array(8); + for(var j = 0; j < 8; j++) a[7 - j] = caml_string_unsafe_get(s, i + j); + return caml_int64_of_bytes(a); + } + function caml_js_error_option_of_exception(exn){ + if(exn.js_error) return [0, exn.js_error]; + return 0; + } + function caml_ml_pos_out_64(chanid){ + return caml_int64_of_float(caml_pos_out(chanid)); + } + function caml_unix_findclose(dir_handle){return caml_unix_closedir(dir_handle); + } + function caml_gr_close_subwindow(a){ + caml_failwith("caml_gr_close_subwindow not Implemented"); + } + function caml_floatarray_blit(a1, i1, a2, i2, len){ + if(i2 <= i1) + for(var j = 1; j <= len; j++) a2[i2 + j] = a1[i1 + j]; + else + for(var j = len; j >= 1; j--) a2[i2 + j] = a1[i1 + j]; + return 0; + } + function caml_get_minor_free(unit){return 0;} + function caml_set_static_env(k, v){ + if(! globalThis.jsoo_static_env) globalThis.jsoo_static_env = {}; + globalThis.jsoo_static_env[k] = v; + return 0; + } + function caml_ba_change_layout(ba, layout){ + if(ba.layout == layout) return ba; + var new_dims = []; + for(var i = 0; i < ba.dims.length; i++) + new_dims[i] = ba.dims[ba.dims.length - i - 1]; + return caml_ba_create_unsafe(ba.kind, layout, new_dims, ba.data); + } + function caml_js_new(c, a){ + switch(a.length){ + case 1: + return new c(); + case 2: + return new c(a[1]); + case 3: + return new c(a[1], a[2]); + case 4: + return new c(a[1], a[2], a[3]); + case 5: + return new c(a[1], a[2], a[3], a[4]); + case 6: + return new c(a[1], a[2], a[3], a[4], a[5]); + case 7: + return new c(a[1], a[2], a[3], a[4], a[5], a[6]); + case 8: + return new c(a[1], a[2], a[3], a[4], a[5], a[6], a[7]); + } + function F(){return c.apply(this, caml_js_from_array(a));} + F.prototype = c.prototype; + return new F(); + } + function caml_gr_current_y(){var s = caml_gr_state_get(); return s.y;} + function caml_format_int(fmt, i){ + if(caml_jsbytes_of_string(fmt) == "%d") + return caml_string_of_jsbytes("" + i); + var f = caml_parse_format(fmt); + if(i < 0) if(f.signedconv){f.sign = - 1; i = - i;} else i >>>= 0; + var s = i.toString(f.base); + if(f.prec >= 0){ + f.filler = " "; + var n = f.prec - s.length; + if(n > 0) s = caml_str_repeat(n, "0") + s; + } + return caml_finish_formatting(f, s); + } + function jsoo_effect_not_supported(){ + caml_failwith("Effect handlers are not supported"); + } + function caml_continuation_use_and_update_handler_noexc + (cont, hval, hexn, heff){ + var stack = caml_continuation_use_noexc(cont); + stack[3] = [0, hval, hexn, heff]; + return stack; + } + function caml_obj_truncate(x, s){ + if(s <= 0 || s + 1 > x.length) caml_invalid_argument("Obj.truncate"); + if(x.length != s + 1) x.length = s + 1; + return 0; + } + function caml_js_to_string(s){return caml_string_of_jsstring(s);} + function is_digit_odd(nat, ofs){if(nat.data[ofs] & 1) return 1; return 0;} + function caml_runtime_variant(_unit){return caml_string_of_jsbytes("");} + function caml_ml_open_descriptor_out(fd){ + var file = caml_sys_fds[fd]; + if(file.flags.rdonly) caml_raise_sys_error("fd " + fd + " is readonly"); + var + buffered = file.flags.buffered !== undefined ? file.flags.buffered : 1, + channel = + {file: file, + offset: file.flags.append ? file.length() : 0, + fd: fd, + opened: true, + out: true, + buffer_curr: 0, + buffer: new Uint8Array(65536), + buffered: buffered}; + caml_ml_channels[channel.fd] = channel; + return channel.fd; + } + function caml_array_concat(l){ + var a = [0]; + while(l !== 0){ + var b = l[1]; + for(var i = 1; i < b.length; i++) a.push(b[i]); + l = l[2]; + } + return a; + } + function caml_gr_open_graph(info){ + var info = caml_jsstring_of_string(info); + function get(name){ + var res = info.match("(^|,) *" + name + " *= *([a-zA-Z0-9_]+) *(,|$)"); + if(res) return res[2]; + } + var specs = []; + if(! (info == "")) specs.push(info); + var target = get("target"); + if(! target) target = ""; + var status = get("status"); + if(! status) specs.push("status=1"); + var w = get("width"); + w = w ? parseInt(w) : 200; + specs.push("width=" + w); + var h = get("height"); + h = h ? parseInt(h) : 200; + specs.push("height=" + h); + var win = globalThis.open("about:blank", target, specs.join(",")); + if(! win) caml_failwith("Graphics.open_graph: cannot open the window"); + var doc = win.document, canvas = doc.createElement("canvas"); + canvas.width = w; + canvas.height = h; + var ctx = caml_gr_state_create(canvas, w, h); + ctx.set_title = function(title){doc.title = title;}; + caml_gr_state_set(ctx); + var body = doc.body; + body.style.margin = "0px"; + body.appendChild(canvas); + return 0; + } + function caml_make_float_vect(len){ + if(len < 0) caml_array_bound_error(); + var len = len + 1 | 0, b = new Array(len); + b[0] = 254; + for(var i = 1; i < len; i++) b[i] = 0; + return b; + } + function caml_cbrt_float(x){return Math.cbrt(x);} + function caml_eventlog_pause(unit){return 0;} + function caml_memprof_stop(unit){return 0;} + function caml_greaterequal(x, y){ + return + (caml_compare_val(x, y, false) >= 0); + } + function caml_get_exception_raw_backtrace(){return [0];} + function caml_log1p_float(x){return Math.log1p(x);} + function caml_runtime_events_free_cursor(cursor){return 0;} + function caml_lazy_make_forward(v){return [250, v];} + function lor_digit_nat(nat1, ofs1, nat2, ofs2){nat1.data[ofs1] |= nat2.data[ofs2]; return 0; + } + function caml_gr_blit_image(im, x, y){ + var + s = caml_gr_state_get(), + im2 = + s.context.getImageData + (x, s.height - im.height - y, im.width, im.height); + for(var i = 0; i < im2.data.length; i += 4){ + im.data[i] = im2.data[i]; + im.data[i + 1] = im2.data[i + 1]; + im.data[i + 2] = im2.data[i + 2]; + im.data[i + 3] = im2.data[i + 3]; + } + return 0; + } + function caml_gr_window_id(a){ + caml_failwith("caml_gr_window_id not Implemented"); + } + function caml_js_on_ie(){ + var ua = globalThis.navigator ? globalThis.navigator.userAgent : ""; + return ua.indexOf("MSIE") != - 1 && ua.indexOf("Opera") != 0; + } + function caml_int64_shift_right(x, s){return x.shift_right(s);} + function caml_ba_layout(ba){return ba.layout;} + function caml_convert_raw_backtrace(){return [0];} + function caml_array_set(array, index, newval){ + if(index < 0 || index >= array.length - 1) caml_array_bound_error(); + array[index + 1] = newval; + return 0; + } + function caml_alloc_stack(hv, hx, hf){return 0;} + function caml_bytes_greaterequal(s1, s2){return caml_bytes_lessequal(s2, s1); + } + function set_digit_nat(nat, ofs, digit){nat.data[ofs] = digit; return 0;} + function caml_bytes_set16(s, i, i16){ + if(i >>> 0 >= s.l - 1) caml_bytes_bound_error(); + var b2 = 0xFF & i16 >> 8, b1 = 0xFF & i16; + caml_bytes_unsafe_set(s, i + 0, b1); + caml_bytes_unsafe_set(s, i + 1, b2); + return 0; + } + function caml_gr_doc_of_state(state){ + if(state.canvas.ownerDocument) return state.canvas.ownerDocument; + } + function caml_ml_output_int(chanid, i){ + var + arr = [i >> 24 & 0xFF, i >> 16 & 0xFF, i >> 8 & 0xFF, i & 0xFF], + s = caml_string_of_array(arr); + caml_ml_output(chanid, s, 0, 4); + return 0; + } + function caml_obj_with_tag(tag, x){ + var l = x.length, a = new Array(l); + a[0] = tag; + for(var i = 1; i < l; i++) a[i] = x[i]; + return a; + } + function caml_ml_channel_size(chanid){ + var chan = caml_ml_channels[chanid]; + return chan.file.length(); + } + function caml_raw_backtrace_slot(){ + caml_invalid_argument + ("Printexc.get_raw_backtrace_slot: index out of bounds"); + } + function caml_hexstring_of_float(x, prec, style){ + if(! isFinite(x)){ + if(isNaN(x)) return caml_string_of_jsstring("nan"); + return caml_string_of_jsstring(x > 0 ? "infinity" : "-infinity"); + } + var sign = x == 0 && 1 / x == - Infinity ? 1 : x >= 0 ? 0 : 1; + if(sign) x = - x; + var exp = 0; + if(x == 0) + ; + else if(x < 1) + while(x < 1 && exp > - 1022){x *= 2; exp--;} + else + while(x >= 2){x /= 2; exp++;} + var exp_sign = exp < 0 ? "" : "+", sign_str = ""; + if(sign) + sign_str = "-"; + else + switch(style){ + case 43: + sign_str = "+"; break; + case 32: + sign_str = " "; break; + default: break; + } + if(prec >= 0 && prec < 13){ + var cst = Math.pow(2, prec * 4); + x = Math.round(x * cst) / cst; + } + var x_str = x.toString(16); + if(prec >= 0){ + var idx = x_str.indexOf("."); + if(idx < 0) + x_str += "." + caml_str_repeat(prec, "0"); + else{ + var size = idx + 1 + prec; + if(x_str.length < size) + x_str += caml_str_repeat(size - x_str.length, "0"); + else + x_str = x_str.substr(0, size); + } + } + return caml_string_of_jsstring + (sign_str + "0x" + x_str + "p" + exp_sign + exp.toString(10)); + } + function caml_runtime_events_user_write(event, event_content){return 0;} + function caml_js_wrap_meth_callback_strict(arity, f){ + return function(){ + var args = new Array(arity + 1), len = Math.min(arguments.length, arity); + args[0] = this; + for(var i = 0; i < len; i++) args[i + 1] = arguments[i]; + return caml_callback(f, args);}; + } + function caml_unix_readlink(name){ + var root = resolve_fs_device(name); + if(! root.device.readlink) + caml_failwith("caml_unix_readlink: not implemented"); + return root.device.readlink(root.rest, true); + } + function caml_backtrace_status(_unit){ + return caml_record_backtrace_flag ? 1 : 0; + } + function caml_install_signal_handler(){return 0;} + function caml_sys_argv(a){return caml_argv;} + function caml_ba_fill(ba, v){ba.fill(v); return 0;} + function caml_modf_float(x){ + if(isFinite(x)){ + var neg = 1 / x < 0; + x = Math.abs(x); + var i = Math.floor(x), f = x - i; + if(neg){i = - i; f = - f;} + return [0, f, i]; + } + if(isNaN(x)) return [0, NaN, NaN]; + return [0, 1 / x, x]; + } + function caml_gc_get(){return [0, 0, 0, 0, 0, 0, 0, 0, 0];} + function caml_float_compare(x, y){ + if(x === y) return 0; + if(x < y) return - 1; + if(x > y) return 1; + if(x === x) return 1; + if(y === y) return - 1; + return 0; + } + function caml_string_set32(s, i, i32){caml_failwith("caml_string_set32");} + function caml_parse_engine(tables, env, cmd, arg){ + var + ERRCODE = 256, + loop = 6, + testshift = 7, + shift = 8, + shift_recover = 9, + reduce = 10, + READ_TOKEN = 0, + RAISE_PARSE_ERROR = 1, + GROW_STACKS_1 = 2, + GROW_STACKS_2 = 3, + COMPUTE_SEMANTIC_ACTION = 4, + CALL_ERROR_FUNCTION = 5, + env_s_stack = 1, + env_v_stack = 2, + env_symb_start_stack = 3, + env_symb_end_stack = 4, + env_stacksize = 5, + env_stackbase = 6, + env_curr_char = 7, + env_lval = 8, + env_symb_start = 9, + env_symb_end = 10, + env_asp = 11, + env_rule_len = 12, + env_rule_number = 13, + env_sp = 14, + env_state = 15, + env_errflag = 16, + tbl_transl_const = 2, + tbl_transl_block = 3, + tbl_lhs = 4, + tbl_len = 5, + tbl_defred = 6, + tbl_dgoto = 7, + tbl_sindex = 8, + tbl_rindex = 9, + tbl_gindex = 10, + tbl_tablesize = 11, + tbl_table = 12, + tbl_check = 13, + tbl_names_const = 15, + tbl_names_block = 16; + function log(x){ + var s = caml_string_of_jsbytes(x + "\n"); + caml_ml_output(2, s, 0, caml_ml_string_length(s)); + } + function token_name(names, number){ + var str = caml_jsstring_of_string(names); + if(str[0] == "\x00") return ""; + return str.split("\x00")[number]; + } + function print_token(state, tok){ + var token, kind; + if(tok instanceof Array){ + token = token_name(tables[tbl_names_block], tok[0]); + if(typeof tok[1] == "number") + kind = "" + tok[1]; + else if(typeof tok[1] == "string") + kind = tok[1]; + else if(tok[1] instanceof MlBytes) + kind = caml_jsbytes_of_string(tok[1]); + else + kind = "_"; + log("State " + state + ": read token " + token + "(" + kind + ")"); + } + else{ + token = token_name(tables[tbl_names_const], tok); + log("State " + state + ": read token " + token); + } + } + if(! tables.dgoto){ + tables.defred = caml_lex_array(tables[tbl_defred]); + tables.sindex = caml_lex_array(tables[tbl_sindex]); + tables.check = caml_lex_array(tables[tbl_check]); + tables.rindex = caml_lex_array(tables[tbl_rindex]); + tables.table = caml_lex_array(tables[tbl_table]); + tables.len = caml_lex_array(tables[tbl_len]); + tables.lhs = caml_lex_array(tables[tbl_lhs]); + tables.gindex = caml_lex_array(tables[tbl_gindex]); + tables.dgoto = caml_lex_array(tables[tbl_dgoto]); + } + var + res = 0, + n, + n1, + n2, + state1, + sp = env[env_sp], + state = env[env_state], + errflag = env[env_errflag]; + exit: + for(;;) + next: + switch(cmd){ + case 0: + state = 0; errflag = 0; + case 6: + n = tables.defred[state]; + if(n != 0){cmd = reduce; break;} + if(env[env_curr_char] >= 0){cmd = testshift; break;} + res = READ_TOKEN; + break exit; + case 1: + if(arg instanceof Array){ + env[env_curr_char] = tables[tbl_transl_block][arg[0] + 1]; + env[env_lval] = arg[1]; + } + else{ + env[env_curr_char] = tables[tbl_transl_const][arg + 1]; + env[env_lval] = 0; + } + if(caml_parser_trace) print_token(state, arg); + case 7: + n1 = tables.sindex[state]; + n2 = n1 + env[env_curr_char]; + if + (n1 != 0 && n2 >= 0 && n2 <= tables[tbl_tablesize] + && tables.check[n2] == env[env_curr_char]){cmd = shift; break;} + n1 = tables.rindex[state]; + n2 = n1 + env[env_curr_char]; + if + (n1 != 0 && n2 >= 0 && n2 <= tables[tbl_tablesize] + && tables.check[n2] == env[env_curr_char]){ + n = tables.table[n2]; + cmd = reduce; + break; + } + if(errflag <= 0){res = CALL_ERROR_FUNCTION; break exit;} + case 5: + if(errflag < 3){ + errflag = 3; + for(;;){ + state1 = env[env_s_stack][sp + 1]; + n1 = tables.sindex[state1]; + n2 = n1 + ERRCODE; + if + (n1 != 0 && n2 >= 0 && n2 <= tables[tbl_tablesize] + && tables.check[n2] == ERRCODE){ + if(caml_parser_trace) log("Recovering in state " + state1); + cmd = shift_recover; + break next; + } + else{ + if(caml_parser_trace) log("Discarding state " + state1); + if(sp <= env[env_stackbase]){ + if(caml_parser_trace) log("No more states to discard"); + return RAISE_PARSE_ERROR; + } + sp--; + } + } + } + else{ + if(env[env_curr_char] == 0) return RAISE_PARSE_ERROR; + if(caml_parser_trace) log("Discarding last token read"); + env[env_curr_char] = - 1; + cmd = loop; + break; + } + case 8: + env[env_curr_char] = - 1; if(errflag > 0) errflag--; + case 9: + if(caml_parser_trace) + log("State " + state + ": shift to state " + tables.table[n2]); + state = tables.table[n2]; + sp++; + if(sp >= env[env_stacksize]){res = GROW_STACKS_1; break exit;} + case 2: + env[env_s_stack][sp + 1] = state; + env[env_v_stack][sp + 1] = env[env_lval]; + env[env_symb_start_stack][sp + 1] = env[env_symb_start]; + env[env_symb_end_stack][sp + 1] = env[env_symb_end]; + cmd = loop; + break; + case 10: + if(caml_parser_trace) log("State " + state + ": reduce by rule " + n); + var m = tables.len[n]; + env[env_asp] = sp; + env[env_rule_number] = n; + env[env_rule_len] = m; + sp = sp - m + 1; + m = tables.lhs[n]; + state1 = env[env_s_stack][sp]; + n1 = tables.gindex[m]; + n2 = n1 + state1; + if + (n1 != 0 && n2 >= 0 && n2 <= tables[tbl_tablesize] + && tables.check[n2] == state1) + state = tables.table[n2]; + else + state = tables.dgoto[m]; + if(sp >= env[env_stacksize]){res = GROW_STACKS_2; break exit;} + case 3: + res = COMPUTE_SEMANTIC_ACTION; break exit; + case 4: + env[env_s_stack][sp + 1] = state; + env[env_v_stack][sp + 1] = arg; + var asp = env[env_asp]; + env[env_symb_end_stack][sp + 1] = env[env_symb_end_stack][asp + 1]; + if(sp > asp) + env[env_symb_start_stack][sp + 1] = env[env_symb_end_stack][asp + 1]; + cmd = loop; + break; + default: return RAISE_PARSE_ERROR; + } + env[env_sp] = sp; + env[env_state] = state; + env[env_errflag] = errflag; + return res; + } + function caml_jsoo_flags_effects(unit){return 0;} + function caml_update_dummy(x, y){ + if(typeof y === "function"){x.fun = y; return 0;} + if(y.fun){x.fun = y.fun; return 0;} + var i = y.length; + while(i--) x[i] = y[i]; + return 0; + } + function caml_array_fill(array, ofs, len, v){ + for(var i = 0; i < len; i++) array[ofs + i + 1] = v; + return 0; + } + function caml_sys_mkdir(name, perm){ + var root = resolve_fs_device(name); + root.device.mkdir(root.rest, perm); + return 0; + } + function caml_string_notequal(s1, s2){ + return 1 - caml_string_equal(s1, s2); + } + function caml_bytes_greaterthan(s1, s2){return caml_bytes_lessthan(s2, s1); + } + function caml_gr_make_image(arr){ + var + s = caml_gr_state_get(), + h = arr.length - 1, + w = arr[1].length - 1, + im = s.context.createImageData(w, h); + for(var i = 0; i < h; i++) + for(var j = 0; j < w; j++){ + var c = arr[i + 1][j + 1], o = i * (w * 4) + j * 4; + if(c == - 1){ + im.data[o + 0] = 0; + im.data[o + 1] = 0; + im.data[o + 2] = 0; + im.data[o + 3] = 0; + } + else{ + im.data[o + 0] = c >> 16 & 0xff; + im.data[o + 1] = c >> 8 & 0xff; + im.data[o + 2] = c >> 0 & 0Xff; + im.data[o + 3] = 0xff; + } + } + return im; + } + function caml_ml_set_channel_output(chanid, f){ + var chan = caml_ml_channels[chanid]; + chan.output = function(s){f(s);}; + return 0; + } + function caml_read_file_content(name){ + var + name = typeof name == "string" ? caml_string_of_jsbytes(name) : name, + root = resolve_fs_device(name); + if(root.device.exists(root.rest)){ + var + file = root.device.open(root.rest, {rdonly: 1}), + len = file.length(), + buf = new Uint8Array(len); + file.read(0, buf, 0, len); + return caml_string_of_array(buf); + } + caml_raise_no_such_file(caml_jsbytes_of_string(name)); + } + function caml_js_to_float(x){return x;} + function caml_setup_uncaught_exception_handler(){ + var process = globalThis.process; + if(process && process.on) + process.on + ("uncaughtException", + function(err, origin){ + caml_fatal_uncaught_exception(err); + process.exit(2); + }); + else if(globalThis.addEventListener) + globalThis.addEventListener + ("error", + function(event){ + if(event.error) caml_fatal_uncaught_exception(event.error); + }); + } + caml_setup_uncaught_exception_handler(); + globalThis.jsoo_runtime = + {caml_runtime_events_read_poll: caml_runtime_events_read_poll, + caml_runtime_events_free_cursor: caml_runtime_events_free_cursor, + caml_runtime_events_create_cursor: caml_runtime_events_create_cursor, + caml_runtime_events_resume: caml_runtime_events_resume, + caml_runtime_events_pause: caml_runtime_events_pause, + caml_runtime_events_start: caml_runtime_events_start, + caml_runtime_events_user_resolve: caml_runtime_events_user_resolve, + caml_runtime_events_user_write: caml_runtime_events_user_write, + caml_runtime_events_user_register: caml_runtime_events_user_register, + caml_custom_event_index: caml_custom_event_index, + zstd_decompress: zstd_decompress, + jsoo_effect_not_supported: jsoo_effect_not_supported, + caml_ml_condition_signal: caml_ml_condition_signal, + caml_ml_condition_broadcast: caml_ml_condition_broadcast, + caml_ml_condition_wait: caml_ml_condition_wait, + caml_ml_condition_new: caml_ml_condition_new, + caml_get_continuation_callstack: caml_get_continuation_callstack, + caml_continuation_use_and_update_handler_noexc: + caml_continuation_use_and_update_handler_noexc, + caml_continuation_use_noexc: caml_continuation_use_noexc, + caml_alloc_stack: caml_alloc_stack, + caml_ml_mutex_unlock: caml_ml_mutex_unlock, + caml_ml_mutex_try_lock: caml_ml_mutex_try_lock, + caml_ml_mutex_lock: caml_ml_mutex_lock, + caml_ml_mutex_new: caml_ml_mutex_new, + MlMutex: MlMutex, + caml_lxm_next: caml_lxm_next, + caml_ml_domain_cpu_relax: caml_ml_domain_cpu_relax, + caml_ml_domain_id: caml_ml_domain_id, + caml_domain_spawn: caml_domain_spawn, + caml_domain_id: caml_domain_id, + caml_recommended_domain_count: caml_recommended_domain_count, + caml_ml_domain_set_name: caml_ml_domain_set_name, + caml_ml_domain_unique_token: caml_ml_domain_unique_token, + caml_atomic_exchange: caml_atomic_exchange, + caml_atomic_fetch_add: caml_atomic_fetch_add, + caml_atomic_cas: caml_atomic_cas, + caml_atomic_load: caml_atomic_load, + caml_domain_dls_get: caml_domain_dls_get, + caml_domain_dls_set: caml_domain_dls_set, + caml_domain_dls: caml_domain_dls, + caml_ephe_check_data: caml_ephe_check_data, + caml_ephe_unset_data: caml_ephe_unset_data, + caml_ephe_set_data: caml_ephe_set_data, + caml_ephe_get_data_copy: caml_ephe_get_data_copy, + caml_ephe_get_data: caml_ephe_get_data, + caml_ephe_blit_data: caml_ephe_blit_data, + caml_ephe_blit_key: caml_ephe_blit_key, + caml_ephe_check_key: caml_ephe_check_key, + caml_ephe_get_key_copy: caml_ephe_get_key_copy, + caml_ephe_get_key: caml_ephe_get_key, + caml_weak_set: caml_weak_set, + caml_weak_create: caml_weak_create, + caml_ephe_create: caml_ephe_create, + caml_ephe_unset_key: caml_ephe_unset_key, + caml_ephe_set_key: caml_ephe_set_key, + caml_ephe_data_offset: caml_ephe_data_offset, + caml_ephe_key_offset: caml_ephe_key_offset, + caml_unix_inet_addr_of_string: caml_unix_inet_addr_of_string, + caml_unix_findclose: caml_unix_findclose, + caml_unix_findnext: caml_unix_findnext, + caml_unix_findfirst: caml_unix_findfirst, + caml_unix_rewinddir: caml_unix_rewinddir, + caml_unix_closedir: caml_unix_closedir, + caml_unix_readdir: caml_unix_readdir, + caml_unix_opendir: caml_unix_opendir, + caml_unix_has_symlink: caml_unix_has_symlink, + caml_unix_getpwuid: caml_unix_getpwuid, + caml_unix_getuid: caml_unix_getuid, + caml_unix_unlink: caml_unix_unlink, + caml_unix_readlink: caml_unix_readlink, + caml_unix_symlink: caml_unix_symlink, + caml_unix_rmdir: caml_unix_rmdir, + caml_unix_mkdir: caml_unix_mkdir, + caml_unix_lstat_64: caml_unix_lstat_64, + caml_unix_lstat: caml_unix_lstat, + caml_unix_stat_64: caml_unix_stat_64, + caml_unix_stat: caml_unix_stat, + make_unix_err_args: make_unix_err_args, + caml_unix_isatty: caml_unix_isatty, + caml_unix_filedescr_of_fd: caml_unix_filedescr_of_fd, + caml_unix_cleanup: caml_unix_cleanup, + caml_unix_startup: caml_unix_startup, + caml_unix_mktime: caml_unix_mktime, + caml_unix_localtime: caml_unix_localtime, + caml_unix_gmtime: caml_unix_gmtime, + caml_unix_time: caml_unix_time, + caml_unix_gettimeofday: caml_unix_gettimeofday, + caml_str_initialize: caml_str_initialize, + re_replacement_text: re_replacement_text, + re_partial_match: re_partial_match, + re_string_match: re_string_match, + re_search_backward: re_search_backward, + re_search_forward: re_search_forward, + re_match: re_match, + caml_sys_is_regular_file: caml_sys_is_regular_file, + caml_spacetime_only_works_for_native_code: + caml_spacetime_only_works_for_native_code, + caml_register_channel_for_spacetime: caml_register_channel_for_spacetime, + caml_sys_const_naked_pointers_checked: + caml_sys_const_naked_pointers_checked, + caml_spacetime_enabled: caml_spacetime_enabled, + caml_ml_runtime_warnings_enabled: caml_ml_runtime_warnings_enabled, + caml_ml_enable_runtime_warnings: caml_ml_enable_runtime_warnings, + caml_runtime_warnings: caml_runtime_warnings, + caml_install_signal_handler: caml_install_signal_handler, + caml_runtime_parameters: caml_runtime_parameters, + caml_runtime_variant: caml_runtime_variant, + caml_sys_isatty: caml_sys_isatty, + caml_sys_get_config: caml_sys_get_config, + os_type: os_type, + caml_sys_const_backend_type: caml_sys_const_backend_type, + caml_sys_const_ostype_cygwin: caml_sys_const_ostype_cygwin, + caml_sys_const_ostype_win32: caml_sys_const_ostype_win32, + caml_sys_const_ostype_unix: caml_sys_const_ostype_unix, + caml_sys_const_max_wosize: caml_sys_const_max_wosize, + caml_sys_const_int_size: caml_sys_const_int_size, + caml_sys_const_word_size: caml_sys_const_word_size, + caml_sys_const_big_endian: caml_sys_const_big_endian, + caml_sys_random_seed: caml_sys_random_seed, + caml_sys_time_include_children: caml_sys_time_include_children, + caml_sys_time: caml_sys_time, + caml_sys_system_command: caml_sys_system_command, + caml_sys_executable_name: caml_sys_executable_name, + caml_sys_modify_argv: caml_sys_modify_argv, + caml_sys_argv: caml_sys_argv, + caml_sys_get_argv: caml_sys_get_argv, + caml_executable_name: caml_executable_name, + caml_argv: caml_argv, + caml_sys_unsafe_getenv: caml_sys_unsafe_getenv, + caml_sys_getenv: caml_sys_getenv, + jsoo_sys_getenv: jsoo_sys_getenv, + caml_set_static_env: caml_set_static_env, + caml_fatal_uncaught_exception: caml_fatal_uncaught_exception, + caml_format_exception: caml_format_exception, + caml_is_special_exception: caml_is_special_exception, + caml_sys_exit: caml_sys_exit, + caml_raise_sys_error: caml_raise_sys_error, + caml_maybe_print_stats: caml_maybe_print_stats, + caml_is_printable: caml_is_printable, + caml_get_global_data: caml_get_global_data, + caml_register_global: caml_register_global, + caml_build_symbols: caml_build_symbols, + caml_global_data: caml_global_data, + caml_named_value: caml_named_value, + caml_register_named_value: caml_register_named_value, + caml_named_values: caml_named_values, + caml_call_gen: caml_call_gen, + caml_set_parser_trace: caml_set_parser_trace, + caml_parse_engine: caml_parse_engine, + caml_parser_trace: caml_parser_trace, + caml_is_continuation_tag: caml_is_continuation_tag, + caml_lazy_read_result: caml_lazy_read_result, + caml_lazy_reset_to_lazy: caml_lazy_reset_to_lazy, + caml_lazy_update_to_forward: caml_lazy_update_to_forward, + caml_lazy_update_to_forcing: caml_lazy_update_to_forcing, + caml_obj_update_tag: caml_obj_update_tag, + caml_obj_add_offset: caml_obj_add_offset, + caml_obj_reachable_words: caml_obj_reachable_words, + caml_obj_set_raw_field: caml_obj_set_raw_field, + caml_obj_raw_field: caml_obj_raw_field, + caml_fresh_oo_id: caml_fresh_oo_id, + caml_set_oo_id: caml_set_oo_id, + caml_oo_last_id: caml_oo_last_id, + caml_get_public_method: caml_get_public_method, + caml_lazy_make_forward: caml_lazy_make_forward, + caml_obj_is_shared: caml_obj_is_shared, + caml_obj_compare_and_swap: caml_obj_compare_and_swap, + caml_obj_make_forward: caml_obj_make_forward, + caml_obj_truncate: caml_obj_truncate, + caml_obj_dup: caml_obj_dup, + caml_obj_with_tag: caml_obj_with_tag, + caml_obj_block: caml_obj_block, + caml_obj_set_tag: caml_obj_set_tag, + caml_obj_tag: caml_obj_tag, + caml_obj_is_block: caml_obj_is_block, + caml_alloc_dummy_infix: caml_alloc_dummy_infix, + caml_update_dummy: caml_update_dummy, + deserialize_nat: deserialize_nat, + serialize_nat: serialize_nat, + lxor_digit_nat: lxor_digit_nat, + lor_digit_nat: lor_digit_nat, + land_digit_nat: land_digit_nat, + compare_nat_real: compare_nat_real, + compare_nat: compare_nat, + compare_digits_nat: compare_digits_nat, + shift_right_nat: shift_right_nat, + div_nat: div_nat, + div_digit_nat: div_digit_nat, + div_helper: div_helper, + shift_left_nat: shift_left_nat, + square_nat: square_nat, + mult_nat: mult_nat, + mult_digit_nat: mult_digit_nat, + sub_nat: sub_nat, + decr_nat: decr_nat, + complement_nat: complement_nat, + add_nat: add_nat, + incr_nat: incr_nat, + is_digit_odd: is_digit_odd, + is_digit_zero: is_digit_zero, + is_digit_int: is_digit_int, + num_leading_zero_bits_in_digit: num_leading_zero_bits_in_digit, + num_digits_nat: num_digits_nat, + nth_digit_nat_native: nth_digit_nat_native, + set_digit_nat_native: set_digit_nat_native, + nth_digit_nat: nth_digit_nat, + set_digit_nat: set_digit_nat, + blit_nat: blit_nat, + set_to_zero_nat: set_to_zero_nat, + create_nat: create_nat, + nat_of_array: nat_of_array, + caml_hash_nat: caml_hash_nat, + MlNat: MlNat, + initialize_nat: initialize_nat, + caml_array_of_bytes: caml_array_of_bytes, + caml_array_of_string: caml_array_of_string, + caml_js_to_string: caml_js_to_string, + caml_to_js_string: caml_to_js_string, + caml_js_from_string: caml_js_from_string, + caml_new_string: caml_new_string, + caml_js_to_byte_string: caml_js_to_byte_string, + caml_is_ml_string: caml_is_ml_string, + caml_ml_bytes_content: caml_ml_bytes_content, + caml_is_ml_bytes: caml_is_ml_bytes, + caml_bytes_of_jsbytes: caml_bytes_of_jsbytes, + caml_string_of_jsstring: caml_string_of_jsstring, + caml_jsstring_of_string: caml_jsstring_of_string, + caml_jsbytes_of_string: caml_jsbytes_of_string, + caml_string_of_jsbytes: caml_string_of_jsbytes, + caml_bytes_of_string: caml_bytes_of_string, + caml_string_of_bytes: caml_string_of_bytes, + caml_string_lessthan: caml_string_lessthan, + caml_string_lessequal: caml_string_lessequal, + caml_string_equal: caml_string_equal, + caml_string_compare: caml_string_compare, + caml_ml_string_length: caml_ml_string_length, + caml_string_unsafe_set: caml_string_unsafe_set, + caml_string_unsafe_get: caml_string_unsafe_get, + caml_ml_bytes_length: caml_ml_bytes_length, + caml_blit_string: caml_blit_string, + caml_blit_bytes: caml_blit_bytes, + caml_fill_bytes: caml_fill_bytes, + caml_bytes_greaterthan: caml_bytes_greaterthan, + caml_string_greaterthan: caml_string_greaterthan, + caml_bytes_greaterequal: caml_bytes_greaterequal, + caml_string_greaterequal: caml_string_greaterequal, + caml_bytes_lessthan: caml_bytes_lessthan, + caml_bytes_lessequal: caml_bytes_lessequal, + caml_bytes_notequal: caml_bytes_notequal, + caml_string_notequal: caml_string_notequal, + caml_bytes_equal: caml_bytes_equal, + caml_bytes_compare: caml_bytes_compare, + caml_bytes_of_array: caml_bytes_of_array, + caml_string_of_array: caml_string_of_array, + caml_create_bytes: caml_create_bytes, + caml_create_string: caml_create_string, + caml_uint8_array_of_string: caml_uint8_array_of_string, + caml_uint8_array_of_bytes: caml_uint8_array_of_bytes, + caml_convert_bytes_to_array: caml_convert_bytes_to_array, + caml_convert_string_to_bytes: caml_convert_string_to_bytes, + MlBytes: MlBytes, + caml_bytes_of_utf16_jsstring: caml_bytes_of_utf16_jsstring, + caml_bytes_set: caml_bytes_set, + caml_string_set64: caml_string_set64, + caml_bytes_set64: caml_bytes_set64, + caml_string_set32: caml_string_set32, + caml_bytes_set32: caml_bytes_set32, + caml_string_set16: caml_string_set16, + caml_bytes_set16: caml_bytes_set16, + caml_string_set: caml_string_set, + caml_bytes_get: caml_bytes_get, + caml_bytes_get64: caml_bytes_get64, + caml_string_get64: caml_string_get64, + caml_bytes_get32: caml_bytes_get32, + caml_string_get32: caml_string_get32, + caml_bytes_get16: caml_bytes_get16, + caml_string_get16: caml_string_get16, + caml_string_get: caml_string_get, + caml_bytes_bound_error: caml_bytes_bound_error, + caml_string_bound_error: caml_string_bound_error, + caml_bytes_unsafe_set: caml_bytes_unsafe_set, + caml_bytes_unsafe_get: caml_bytes_unsafe_get, + jsoo_is_ascii: jsoo_is_ascii, + caml_utf16_of_utf8: caml_utf16_of_utf8, + caml_utf8_of_utf16: caml_utf8_of_utf16, + caml_subarray_to_jsbytes: caml_subarray_to_jsbytes, + caml_str_repeat: caml_str_repeat, + caml_md5_bytes: caml_md5_bytes, + caml_MD5Final: caml_MD5Final, + caml_MD5Update: caml_MD5Update, + caml_MD5Init: caml_MD5Init, + caml_MD5Transform: caml_MD5Transform, + caml_md5_string: caml_md5_string, + caml_md5_chan: caml_md5_chan, + caml_output_value_to_buffer: caml_output_value_to_buffer, + caml_output_value_to_bytes: caml_output_value_to_bytes, + caml_output_value_to_string: caml_output_value_to_string, + caml_output_val: caml_output_val, + MlObjectTable: MlObjectTable, + caml_marshal_data_size: caml_marshal_data_size, + caml_marshal_header_size: caml_marshal_header_size, + caml_input_value_from_reader: caml_input_value_from_reader, + caml_custom_ops: caml_custom_ops, + caml_nativeint_unmarshal: caml_nativeint_unmarshal, + caml_int32_unmarshal: caml_int32_unmarshal, + caml_int64_marshal: caml_int64_marshal, + caml_int64_unmarshal: caml_int64_unmarshal, + caml_input_value_from_bytes: caml_input_value_from_bytes, + caml_input_value_from_string: caml_input_value_from_string, + caml_float_of_bytes: caml_float_of_bytes, + BigStringReader: BigStringReader, + MlStringReader: MlStringReader, + UInt8ArrayReader: UInt8ArrayReader, + caml_marshal_constants: caml_marshal_constants, + caml_new_lex_engine: caml_new_lex_engine, + caml_lex_engine: caml_lex_engine, + caml_lex_array: caml_lex_array, + caml_js_error_of_exception: caml_js_error_of_exception, + caml_xmlhttprequest_create: caml_xmlhttprequest_create, + caml_js_get_console: caml_js_get_console, + caml_js_html_entities: caml_js_html_entities, + caml_js_html_escape: caml_js_html_escape, + caml_js_on_ie: caml_js_on_ie, + caml_js_object: caml_js_object, + caml_pure_js_expr: caml_pure_js_expr, + caml_js_expr: caml_js_expr, + caml_js_eval_string: caml_js_eval_string, + caml_js_equals: caml_js_equals, + caml_js_function_arity: caml_js_function_arity, + caml_js_wrap_meth_callback_unsafe: caml_js_wrap_meth_callback_unsafe, + caml_js_wrap_meth_callback_strict: caml_js_wrap_meth_callback_strict, + caml_js_wrap_meth_callback_arguments: + caml_js_wrap_meth_callback_arguments, + caml_js_wrap_meth_callback: caml_js_wrap_meth_callback, + caml_js_wrap_callback_unsafe: caml_js_wrap_callback_unsafe, + caml_js_wrap_callback_strict: caml_js_wrap_callback_strict, + caml_js_wrap_callback_arguments: caml_js_wrap_callback_arguments, + caml_js_wrap_callback: caml_js_wrap_callback, + caml_ojs_new_arr: caml_ojs_new_arr, + caml_js_new: caml_js_new, + caml_js_meth_call: caml_js_meth_call, + caml_js_fun_call: caml_js_fun_call, + caml_js_call: caml_js_call, + caml_js_var: caml_js_var, + caml_list_to_js_array: caml_list_to_js_array, + caml_list_of_js_array: caml_list_of_js_array, + caml_js_to_array: caml_js_to_array, + caml_js_from_array: caml_js_from_array, + caml_js_to_float: caml_js_to_float, + caml_js_from_float: caml_js_from_float, + caml_js_to_bool: caml_js_to_bool, + caml_js_from_bool: caml_js_from_bool, + caml_js_error_option_of_exception: caml_js_error_option_of_exception, + caml_exn_with_js_backtrace: caml_exn_with_js_backtrace, + caml_maybe_attach_backtrace: caml_maybe_attach_backtrace, + caml_wrap_exception: caml_wrap_exception, + caml_jsoo_flags_effects: caml_jsoo_flags_effects, + caml_jsoo_flags_use_js_string: caml_jsoo_flags_use_js_string, + caml_is_js: caml_is_js, + caml_callback: caml_callback, + caml_trampoline_return: caml_trampoline_return, + caml_trampoline: caml_trampoline, + caml_js_typeof: caml_js_typeof, + caml_js_instanceof: caml_js_instanceof, + caml_js_delete: caml_js_delete, + caml_js_get: caml_js_get, + caml_js_set: caml_js_set, + caml_js_pure_expr: caml_js_pure_expr, + caml_ml_set_buffered: caml_ml_set_buffered, + caml_ml_is_buffered: caml_ml_is_buffered, + caml_ml_output_int: caml_ml_output_int, + caml_ml_pos_out_64: caml_ml_pos_out_64, + caml_ml_pos_out: caml_ml_pos_out, + caml_pos_out: caml_pos_out, + caml_ml_seek_out_64: caml_ml_seek_out_64, + caml_ml_seek_out: caml_ml_seek_out, + caml_seek_out: caml_seek_out, + caml_output_value: caml_output_value, + caml_ml_output_char: caml_ml_output_char, + caml_ml_output: caml_ml_output, + caml_ml_output_bytes: caml_ml_output_bytes, + caml_ml_flush: caml_ml_flush, + caml_ml_input_scan_line: caml_ml_input_scan_line, + caml_ml_pos_in_64: caml_ml_pos_in_64, + caml_ml_pos_in: caml_ml_pos_in, + caml_pos_in: caml_pos_in, + caml_ml_seek_in_64: caml_ml_seek_in_64, + caml_ml_seek_in: caml_ml_seek_in, + caml_seek_in: caml_seek_in, + caml_ml_input_int: caml_ml_input_int, + caml_ml_input_char: caml_ml_input_char, + caml_input_value_to_outside_heap: caml_input_value_to_outside_heap, + caml_input_value: caml_input_value, + caml_ml_input_block: caml_ml_input_block, + caml_ml_input: caml_ml_input, + caml_refill: caml_refill, + caml_ml_set_channel_refill: caml_ml_set_channel_refill, + caml_ml_set_channel_output: caml_ml_set_channel_output, + caml_ml_channel_size_64: caml_ml_channel_size_64, + caml_ml_channel_size: caml_ml_channel_size, + caml_ml_close_channel: caml_ml_close_channel, + caml_ml_set_binary_mode: caml_ml_set_binary_mode, + caml_channel_descriptor: caml_channel_descriptor, + caml_ml_open_descriptor_in: caml_ml_open_descriptor_in, + caml_ml_open_descriptor_out: caml_ml_open_descriptor_out, + caml_ml_out_channels_list: caml_ml_out_channels_list, + caml_ml_channels: caml_ml_channels, + caml_ml_set_channel_name: caml_ml_set_channel_name, + caml_sys_open: caml_sys_open, + caml_sys_close: caml_sys_close, + caml_sys_fds: caml_sys_fds, + caml_int64_bswap: caml_int64_bswap, + caml_int32_bswap: caml_int32_bswap, + caml_bswap16: caml_bswap16, + caml_mod: caml_mod, + caml_div: caml_div, + caml_mul: caml_mul, + caml_int_of_string: caml_int_of_string, + caml_parse_digit: caml_parse_digit, + caml_parse_sign_and_base: caml_parse_sign_and_base, + caml_format_int: caml_format_int, + caml_int64_hash: caml_int64_hash, + caml_int64_to_bytes: caml_int64_to_bytes, + caml_int64_of_bytes: caml_int64_of_bytes, + caml_int64_hi32: caml_int64_hi32, + caml_int64_lo32: caml_int64_lo32, + caml_int64_create_lo_hi: caml_int64_create_lo_hi, + caml_int64_create_lo_mi_hi: caml_int64_create_lo_mi_hi, + caml_int64_of_string: caml_int64_of_string, + caml_int64_format: caml_int64_format, + caml_int64_of_float: caml_int64_of_float, + caml_int64_to_float: caml_int64_to_float, + caml_int64_to_int32: caml_int64_to_int32, + caml_int64_of_int32: caml_int64_of_int32, + caml_int64_mod: caml_int64_mod, + caml_int64_div: caml_int64_div, + caml_int64_shift_right: caml_int64_shift_right, + caml_int64_shift_right_unsigned: caml_int64_shift_right_unsigned, + caml_int64_shift_left: caml_int64_shift_left, + caml_int64_xor: caml_int64_xor, + caml_int64_or: caml_int64_or, + caml_int64_and: caml_int64_and, + caml_int64_is_negative: caml_int64_is_negative, + caml_int64_is_zero: caml_int64_is_zero, + caml_int64_mul: caml_int64_mul, + caml_int64_sub: caml_int64_sub, + caml_int64_add: caml_int64_add, + caml_int64_neg: caml_int64_neg, + caml_int64_compare: caml_int64_compare, + caml_int64_ult: caml_int64_ult, + MlInt64: MlInt64, + caml_int64_offset: caml_int64_offset, + caml_float_of_string: caml_float_of_string, + caml_format_float: caml_format_float, + caml_fma_float: caml_fma_float, + caml_erfc_float: caml_erfc_float, + caml_erf_float: caml_erf_float, + caml_cbrt_float: caml_cbrt_float, + caml_round_float: caml_round_float, + caml_atanh_float: caml_atanh_float, + caml_tanh_float: caml_tanh_float, + caml_asinh_float: caml_asinh_float, + caml_sinh_float: caml_sinh_float, + caml_acosh_float: caml_acosh_float, + caml_cosh_float: caml_cosh_float, + caml_log10_float: caml_log10_float, + caml_hypot_float: caml_hypot_float, + caml_log2_float: caml_log2_float, + caml_log1p_float: caml_log1p_float, + caml_exp2_float: caml_exp2_float, + caml_expm1_float: caml_expm1_float, + caml_signbit_float: caml_signbit_float, + caml_copysign_float: caml_copysign_float, + caml_float_compare: caml_float_compare, + caml_frexp_float: caml_frexp_float, + caml_ldexp_float: caml_ldexp_float, + caml_modf_float: caml_modf_float, + caml_classify_float: caml_classify_float, + caml_int32_float_of_bits: caml_int32_float_of_bits, + caml_trunc_float: caml_trunc_float, + caml_nextafter_float: caml_nextafter_float, + caml_int64_float_of_bits: caml_int64_float_of_bits, + caml_hexstring_of_float: caml_hexstring_of_float, + caml_int32_bits_of_float: caml_int32_bits_of_float, + caml_int64_bits_of_float: caml_int64_bits_of_float, + jsoo_floor_log2: jsoo_floor_log2, + caml_string_hash: caml_string_hash, + caml_hash: caml_hash, + caml_hash_mix_string: caml_hash_mix_string, + caml_hash_mix_bytes: caml_hash_mix_bytes, + caml_hash_mix_bytes_arr: caml_hash_mix_bytes_arr, + caml_hash_mix_jsbytes: caml_hash_mix_jsbytes, + caml_hash_mix_int64: caml_hash_mix_int64, + caml_hash_mix_float: caml_hash_mix_float, + caml_hash_mix_final: caml_hash_mix_final, + caml_hash_mix_int: caml_hash_mix_int, + caml_gr_close_subwindow: caml_gr_close_subwindow, + caml_gr_open_subwindow: caml_gr_open_subwindow, + caml_gr_window_id: caml_gr_window_id, + caml_gr_display_mode: caml_gr_display_mode, + caml_gr_remember_mode: caml_gr_remember_mode, + caml_gr_synchronize: caml_gr_synchronize, + caml_gr_wait_event: caml_gr_wait_event, + caml_gr_sigio_signal: caml_gr_sigio_signal, + caml_gr_sigio_handler: caml_gr_sigio_handler, + caml_gr_blit_image: caml_gr_blit_image, + caml_gr_create_image: caml_gr_create_image, + caml_gr_draw_image: caml_gr_draw_image, + caml_gr_dump_image: caml_gr_dump_image, + caml_gr_make_image: caml_gr_make_image, + caml_gr_text_size: caml_gr_text_size, + caml_gr_set_text_size: caml_gr_set_text_size, + caml_gr_set_font: caml_gr_set_font, + caml_gr_draw_string: caml_gr_draw_string, + caml_gr_draw_char: caml_gr_draw_char, + caml_gr_draw_str: caml_gr_draw_str, + caml_gr_fill_arc: caml_gr_fill_arc, + caml_gr_fill_poly: caml_gr_fill_poly, + caml_gr_fill_rect: caml_gr_fill_rect, + caml_gr_set_line_width: caml_gr_set_line_width, + caml_gr_draw_arc: caml_gr_draw_arc, + caml_gr_arc_aux: caml_gr_arc_aux, + caml_gr_draw_rect: caml_gr_draw_rect, + caml_gr_lineto: caml_gr_lineto, + caml_gr_current_y: caml_gr_current_y, + caml_gr_current_x: caml_gr_current_x, + caml_gr_moveto: caml_gr_moveto, + caml_gr_point_color: caml_gr_point_color, + caml_gr_plot: caml_gr_plot, + caml_gr_set_color: caml_gr_set_color, + caml_gr_size_y: caml_gr_size_y, + caml_gr_size_x: caml_gr_size_x, + caml_gr_clear_graph: caml_gr_clear_graph, + caml_gr_resize_window: caml_gr_resize_window, + caml_gr_set_window_title: caml_gr_set_window_title, + caml_gr_close_graph: caml_gr_close_graph, + caml_gr_doc_of_state: caml_gr_doc_of_state, + caml_gr_state_create: caml_gr_state_create, + caml_gr_state_init: caml_gr_state_init, + caml_gr_open_graph: caml_gr_open_graph, + caml_gr_state_set: caml_gr_state_set, + caml_gr_state_get: caml_gr_state_get, + caml_gr_state: caml_gr_state, + caml_get_major_credit: caml_get_major_credit, + caml_get_major_bucket: caml_get_major_bucket, + caml_get_minor_free: caml_get_minor_free, + caml_gc_minor_words: caml_gc_minor_words, + caml_gc_major_slice: caml_gc_major_slice, + caml_gc_huge_fallback_count: caml_gc_huge_fallback_count, + caml_eventlog_pause: caml_eventlog_pause, + caml_eventlog_resume: caml_eventlog_resume, + caml_memprof_stop: caml_memprof_stop, + caml_memprof_start: caml_memprof_start, + caml_final_release: caml_final_release, + caml_final_register_called_without_value: + caml_final_register_called_without_value, + caml_final_register: caml_final_register, + caml_memprof_set: caml_memprof_set, + caml_gc_get: caml_gc_get, + caml_gc_set: caml_gc_set, + caml_gc_stat: caml_gc_stat, + caml_gc_quick_stat: caml_gc_quick_stat, + caml_gc_counters: caml_gc_counters, + caml_gc_compaction: caml_gc_compaction, + caml_gc_full_major: caml_gc_full_major, + caml_gc_major: caml_gc_major, + caml_gc_minor: caml_gc_minor, + caml_sys_open_for_node: caml_sys_open_for_node, + MlNodeFd: MlNodeFd, + MlNodeDevice: MlNodeDevice, + fs_node_supported: fs_node_supported, + MlFakeFd: MlFakeFd, + MlFakeFd_out: MlFakeFd_out, + MlFakeFile: MlFakeFile, + MlFakeDevice: MlFakeDevice, + caml_read_file_content: caml_read_file_content, + jsoo_create_file: jsoo_create_file, + caml_create_file: caml_create_file, + caml_fs_init: caml_fs_init, + jsoo_create_file_extern: jsoo_create_file_extern, + caml_ba_map_file_bytecode: caml_ba_map_file_bytecode, + caml_ba_map_file: caml_ba_map_file, + caml_sys_rmdir: caml_sys_rmdir, + caml_sys_mkdir: caml_sys_mkdir, + caml_sys_rename: caml_sys_rename, + caml_sys_is_directory: caml_sys_is_directory, + caml_sys_remove: caml_sys_remove, + caml_sys_read_directory: caml_sys_read_directory, + caml_sys_file_exists: caml_sys_file_exists, + caml_raise_not_a_dir: caml_raise_not_a_dir, + caml_raise_no_such_file: caml_raise_no_such_file, + caml_sys_chdir: caml_sys_chdir, + caml_sys_getcwd: caml_sys_getcwd, + caml_unmount: caml_unmount, + caml_mount_autoload: caml_mount_autoload, + resolve_fs_device: resolve_fs_device, + caml_list_mount_point: caml_list_mount_point, + jsoo_mount_point: jsoo_mount_point, + caml_make_path: caml_make_path, + path_is_absolute: path_is_absolute, + MlFile: MlFile, + caml_root: caml_root, + caml_get_root: caml_get_root, + caml_current_dir: caml_current_dir, + caml_trailing_slash: caml_trailing_slash, + caml_finish_formatting: caml_finish_formatting, + caml_parse_format: caml_parse_format, + caml_array_bound_error: caml_array_bound_error, + caml_raise_not_found: caml_raise_not_found, + caml_raise_zero_divide: caml_raise_zero_divide, + caml_raise_end_of_file: caml_raise_end_of_file, + caml_invalid_argument: caml_invalid_argument, + caml_failwith: caml_failwith, + caml_raise_with_string: caml_raise_with_string, + caml_raise_with_args: caml_raise_with_args, + caml_raise_with_arg: caml_raise_with_arg, + caml_raise_constant: caml_raise_constant, + caml_lessthan: caml_lessthan, + caml_lessequal: caml_lessequal, + caml_greaterthan: caml_greaterthan, + caml_greaterequal: caml_greaterequal, + caml_notequal: caml_notequal, + caml_equal: caml_equal, + caml_int_compare: caml_int_compare, + caml_compare: caml_compare, + caml_compare_val: caml_compare_val, + caml_compare_val_number_custom: caml_compare_val_number_custom, + caml_compare_val_get_custom: caml_compare_val_get_custom, + caml_compare_val_tag: caml_compare_val_tag, + caml_bigstring_blit_ba_to_bytes: caml_bigstring_blit_ba_to_bytes, + caml_bigstring_blit_bytes_to_ba: caml_bigstring_blit_bytes_to_ba, + caml_bigstring_blit_string_to_ba: caml_bigstring_blit_string_to_ba, + caml_bigstring_blit_ba_to_ba: caml_bigstring_blit_ba_to_ba, + caml_bigstring_memcmp: caml_bigstring_memcmp, + bigstring_of_typed_array: bigstring_of_typed_array, + bigstring_of_array_buffer: bigstring_of_array_buffer, + bigstring_to_typed_array: bigstring_to_typed_array, + bigstring_to_array_buffer: bigstring_to_array_buffer, + caml_hash_mix_bigstring: caml_hash_mix_bigstring, + caml_ba_from_typed_array: caml_ba_from_typed_array, + caml_ba_kind_of_typed_array: caml_ba_kind_of_typed_array, + caml_ba_to_typed_array: caml_ba_to_typed_array, + caml_ba_hash: caml_ba_hash, + caml_ba_create_from: caml_ba_create_from, + caml_ba_deserialize: caml_ba_deserialize, + caml_ba_serialize: caml_ba_serialize, + caml_ba_reshape: caml_ba_reshape, + caml_ba_slice: caml_ba_slice, + caml_ba_sub: caml_ba_sub, + caml_ba_blit: caml_ba_blit, + caml_ba_fill: caml_ba_fill, + caml_ba_set_3: caml_ba_set_3, + caml_ba_set_2: caml_ba_set_2, + caml_ba_set_1: caml_ba_set_1, + caml_ba_uint8_set64: caml_ba_uint8_set64, + caml_ba_uint8_set32: caml_ba_uint8_set32, + caml_ba_uint8_set16: caml_ba_uint8_set16, + caml_ba_set_generic: caml_ba_set_generic, + caml_ba_get_3: caml_ba_get_3, + caml_ba_get_2: caml_ba_get_2, + caml_ba_get_1: caml_ba_get_1, + caml_ba_uint8_get64: caml_ba_uint8_get64, + caml_ba_uint8_get32: caml_ba_uint8_get32, + caml_ba_uint8_get16: caml_ba_uint8_get16, + caml_ba_get_generic: caml_ba_get_generic, + caml_ba_dim_3: caml_ba_dim_3, + caml_ba_dim_2: caml_ba_dim_2, + caml_ba_dim_1: caml_ba_dim_1, + caml_ba_dim: caml_ba_dim, + caml_ba_num_dims: caml_ba_num_dims, + caml_ba_layout: caml_ba_layout, + caml_ba_kind: caml_ba_kind, + caml_ba_change_layout: caml_ba_change_layout, + caml_ba_create: caml_ba_create, + caml_ba_create_unsafe: caml_ba_create_unsafe, + caml_ba_compare: caml_ba_compare, + Ml_Bigarray_c_1_1: Ml_Bigarray_c_1_1, + Ml_Bigarray: Ml_Bigarray, + caml_ba_custom_name: caml_ba_custom_name, + caml_ba_create_buffer: caml_ba_create_buffer, + caml_ba_get_size_per_element: caml_ba_get_size_per_element, + caml_ba_get_size: caml_ba_get_size, + caml_ba_init: caml_ba_init, + caml_convert_raw_backtrace_slot: caml_convert_raw_backtrace_slot, + caml_get_current_callstack: caml_get_current_callstack, + caml_restore_raw_backtrace: caml_restore_raw_backtrace, + caml_raw_backtrace_slot: caml_raw_backtrace_slot, + caml_raw_backtrace_next_slot: caml_raw_backtrace_next_slot, + caml_raw_backtrace_length: caml_raw_backtrace_length, + caml_convert_raw_backtrace: caml_convert_raw_backtrace, + caml_record_backtrace: caml_record_backtrace, + caml_get_exception_raw_backtrace: caml_get_exception_raw_backtrace, + caml_get_exception_backtrace: caml_get_exception_backtrace, + caml_backtrace_status: caml_backtrace_status, + caml_ml_debug_info_status: caml_ml_debug_info_status, + caml_record_backtrace_flag: caml_record_backtrace_flag, + caml_floatarray_create: caml_floatarray_create, + caml_make_float_vect: caml_make_float_vect, + caml_make_vect: caml_make_vect, + caml_check_bound: caml_check_bound, + caml_array_fill: caml_array_fill, + caml_array_get: caml_array_get, + caml_array_set: caml_array_set, + caml_floatarray_blit: caml_floatarray_blit, + caml_array_blit: caml_array_blit, + caml_array_concat: caml_array_concat, + caml_array_append: caml_array_append, + caml_array_sub: caml_array_sub}; + var + cst_Assert_failure = "Assert_failure", + cst_Division_by_zero = "Division_by_zero", + cst_End_of_file = "End_of_file", + cst_Failure = "Failure", + cst_Invalid_argument = "Invalid_argument", + cst_Match_failure = "Match_failure", + cst_Not_found = "Not_found", + cst_Out_of_memory = "Out_of_memory", + cst_Stack_overflow = "Stack_overflow", + cst_Sys_blocked_io = "Sys_blocked_io", + cst_Sys_error = "Sys_error", + cst_Undefined_recursive_module = "Undefined_recursive_module"; + caml_fs_init(); + caml_register_global(0, [248, cst_Out_of_memory, -1], cst_Out_of_memory); + caml_register_global(1, [248, cst_Sys_error, -2], cst_Sys_error); + caml_register_global(2, [248, cst_Failure, -3], cst_Failure); + caml_register_global + (3, [248, cst_Invalid_argument, -4], cst_Invalid_argument); + caml_register_global(4, [248, cst_End_of_file, -5], cst_End_of_file); + caml_register_global + (5, [248, cst_Division_by_zero, -6], cst_Division_by_zero); + caml_register_global(6, [248, cst_Not_found, -7], cst_Not_found); + caml_register_global(7, [248, cst_Match_failure, -8], cst_Match_failure); + caml_register_global(8, [248, cst_Stack_overflow, -9], cst_Stack_overflow); + caml_register_global(9, [248, cst_Sys_blocked_io, -10], cst_Sys_blocked_io); + caml_register_global + (10, [248, cst_Assert_failure, -11], cst_Assert_failure); + caml_register_global + (11, + [248, cst_Undefined_recursive_module, -12], + cst_Undefined_recursive_module); + return; + } + (globalThis)); + + +(function(a){"use strict";var +ai="Js_of_ocaml__Dom_events",bl="Js_of_ocaml__EventSource",ah="Sys_blocked_io",ag="Js_of_ocaml__Worker",bk="Js_of_ocaml__File",bj="Stdlib__Fun",ad=110,ae="Stdlib__MoreLabels",af="Std_exit",bi="Stdlib__Seq",bg="Stdlib__Weak",bh="Js_of_ocaml__Url",ac="Dune__exe",ab="Stdlib__Queue",aa="Stdlib__Parsing",bf="Stdlib__BytesLabels",$="Stdlib__Obj",be="Stdlib__ArrayLabels",_=112,bd="Stdlib__Buffer",Z="Js_of_ocaml__Json",bc="Js_of_ocaml__ResizeObserver",Y="Js_of_ocaml",W="Jsoo_runtime__",X="CamlinternalMod",a$="Stdlib__Printf",ba="Stdlib__Out_channel",bb=105,a8=102,a9="CamlinternalLazy",a_="Js_of_ocaml__Dom_svg",V="Js_of_ocaml__Js",a7="Stdlib__String",a6="Stdlib__Result",T="Stdlib__Bigarray",U=104,a5="Stdlib__Either",S="CamlinternalAtomic",R="Invalid_argument",a4="Js_of_ocaml__Import",P=113,Q=106,a2="Stdlib__Sys",a3="Stdlib__Random",N="Stdlib__Format",O="Match_failure",M="Stdlib__Scanf",a0="Stdlib__Oo",a1="Failure",L="Js_of_ocaml__Dom_html",aZ="Stdlib__Pervasives",K="Js_of_ocaml__",aY="CamlinternalOO",aX="Stdlib__Array",G="Stdlib__Bool",H="Jsoo_runtime",I=101,J="Division_by_zero",aW="Stdlib__Genlex",aU="Js_of_ocaml__Dom",aV=111,F="Js_of_ocaml__Firebug",aT="Not_found",E="Stdlib__Arg",aR="Stdlib__Lazy",aS="Js_of_ocaml__PerformanceObserver",D=107,aP="Stdlib__Map",aQ="Stdlib__Char",B="Stdlib__StringLabels",C="CamlinternalFormatBasics",aO="Stdlib__Digest",A="Js_of_ocaml__XmlHttpRequest",aM="Stdlib__Ephemeron",aN="Stdlib__Callback",z="Jsoo_runtime__Runtime_version",aL="Js_of_ocaml__Form",y="Stdlib__Uchar",x="Stdlib__List",aK="Stdlib__In_channel",w="Stdlib__Atomic",aJ="Stdlib",v=100,aI="Stdlib__Printexc",t="Stdlib__Int64",u=109,s="Sys_error",aG="Js_of_ocaml__CSS",aH="Js_of_ocaml__Geolocation",q="Stdlib__Lexing",r="CamlinternalFormat",p="Stdlib__Gc",aC="Stdlib__Bytes",aD="Js_of_ocaml__Typed_array",aE="Js_of_ocaml__Lib_version",aF=103,o="Stdlib__Int",l="Stdlib__Hashtbl",m="Stdlib__ListLabels",n="Js_of_ocaml__Jstable",ay="Stdlib__Unit",az="Stdlib__Option",aA="Js_of_ocaml__IntersectionObserver",aB="Dune__exe__Xml2js",j="Stdlib__Int32",k="End_of_file",ax="Out_of_memory",aw="Js_of_ocaml__Intl",i="Stdlib__Stack",av="Js_of_ocaml__Sys_js",h="Stack_overflow",aq="Stdlib__Stream",ar="Stdlib__Float",as="Stdlib__Complex",at="Dune__exe__Parser",au="Stdlib__StdLabels",g="Stdlib__Nativeint",ao="Js_of_ocaml__WebGL",ap="Stdlib__Filename",e="Js_of_ocaml__WebSockets",f=108,al="Stdlib__Marshal",am="Assert_failure",an="Js_of_ocaml__MutationObserver",d="Undefined_recursive_module",ak="Js_of_ocaml__Regexp",c="Xmlm",aj="Stdlib__Set",bm=a.jsoo_runtime,b=bm.caml_get_global_data();b.prim_count=845;var +bn=[2,X],bo=[2,aB],bp=[2,Y],bq=[2,ai],br=[0,0,[2,bl],U,0,1],bs=[2,a_],bt=[2,F],bu=[2,aH],bv=[0,0,[2,aw],f,0,1],bw=[2,aA],bx=[2,n],by=[0,0,[2,Z],v,0,1],bz=[2,an],bA=[2,bh],bB=[2,af],bC=[2,bf],bD=[2,ap],bE=[2,aW],bF=[2,aK],bG=[2,m],bH=[2,ae],bI=[2,au];b.toc=[0,[0,"SYMB",[0,114,[0,[0,[0,[0,[0,[0,0,[2,am],0,0,1],[2,S],13,[0,0,[2,r],46,0,1],2],[2,C],12,[0,[0,0,[2,a9],19,[0,[0,0,bn,62,0,1],[2,aY],60,0,2],3],[2,J],1,[0,[0,0,[2,ac],ad,0,1],[2,at],aV,[0,[0,0,bo,_,0,1],[2,k],2,0,2],3],4],5],[2,a1],3,[0,[0,[0,[0,0,[2,R],4,[0,0,bp,u,0,1],2],[2,K],80,[0,0,[2,aG],I,0,1],3],[2,aU],83,[0,[0,[0,0,bq,a8,0,1],[2,L],86,[0,0,bs,aF,br,2],3],[2,bk],85,[0,[0,0,bt,bb,0,1],[2,aL],87,[0,0,bu,Q,0,1],2],4],5],[2,a4],81,[0,[0,[0,[0,0,bw,D,bv,2],[2,V],82,[0,by,bx,99,0,2],3],[2,aE],94,[0,[0,0,bz,98,0,1],[2,aS],97,0,2],4],[2,ak],92,[0,[0,0,[2,bc],96,0,1],[2,av],95,0,2],5],6],7],[2,aD],84,[0,[0,[0,[0,[0,[0,0,bA,93,0,1],[2,ao],91,0,2],[2,e],90,0,3],[2,ag],89,[0,0,[2,A],88,0,1],4],[2,H],79,[0,[0,0,[2,W],77,[0,0,[2,z],78,0,1],2],[2,O],5,[0,[0,0,[2,aT],6,0,1],[2,ax],7,[0,0,[2,h],8,[0,0,bB,P,0,1],2],3],4],5],[2,aJ],14,[0,[0,[0,0,[2,E],48,0,1],[2,aX],33,[0,[0,0,[2,be],67,0,1],[2,w],49,[0,0,[2,T],73,0,1],2],3],[2,G],24,[0,[0,[0,0,[2,bd],45,0,1],[2,aC],29,[0,[0,0,bC,69,0,1],[2,aN],59,0,2],3],[2,aQ],25,[0,[0,0,[2,as],66,0,1],[2,aO],53,0,2],4],5],6],8],[2,a5],16,[0,[0,[0,[0,[0,[0,0,[2,aM],64,[0,0,bD,65,0,1],2],[2,ar],34,[0,0,[2,N],57,0,1],3],[2,bj],51,[0,0,[2,p],52,[0,[0,0,bE,63,0,1],[2,l],55,[0,0,bF,74,0,1],2],3],4],[2,o],28,[0,0,[2,j],35,[0,0,[2,t],36,0,1],2],5],[2,aR],20,[0,[0,[0,0,[2,q],38,0,1],[2,x],27,[0,[0,[0,0,bG,68,0,1],[2,aP],41,0,2],[2,al],32,[0,[0,0,bH,71,0,1],[2,g],37,0,2],3],4],[2,$],18,[0,[0,0,[2,a0],61,0,1],[2,az],22,[0,[0,0,[2,ba],75,0,1],[2,aa],39,0,2],3],5],6],[2,aZ],15,[0,[0,[0,[0,[0,0,[2,aI],50,0,1],[2,a$],47,0,2],[2,ab],43,[0,[0,0,[2,a3],54,0,1],[2,a6],23,[0,0,[2,M],58,0,1],2],3],[2,bi],21,[0,[0,0,[2,aj],40,0,1],[2,i],42,[0,[0,[0,0,bI,72,0,1],[2,aq],44,0,2],[2,a7],30,[0,0,[2,B],70,0,1],3],4],5],[2,a2],17,[0,[0,0,[2,y],26,[0,0,[2,ay],31,[0,0,[2,bg],56,0,1],2],3],[2,ah],9,[0,0,[2,s],10,[0,0,[2,d],11,[0,0,[2,c],76,0,1],2],3],4],6],7],9]]],[0,[0,"SYJS",[0,[0,c,76],[0,d,11],[0,s,10],[0,ah,9],[0,bg,56],[0,ay,31],[0,y,26],[0,a2,17],[0,B,70],[0,a7,30],[0,aq,44],[0,au,72],[0,i,42],[0,aj,40],[0,bi,21],[0,M,58],[0,a6,23],[0,a3,54],[0,ab,43],[0,a$,47],[0,aI,50],[0,aZ,15],[0,aa,39],[0,ba,75],[0,az,22],[0,a0,61],[0,$,18],[0,g,37],[0,ae,71],[0,al,32],[0,aP,41],[0,m,68],[0,x,27],[0,q,38],[0,aR,20],[0,t,36],[0,j,35],[0,o,28],[0,aK,74],[0,l,55],[0,aW,63],[0,p,52],[0,bj,51],[0,N,57],[0,ar,34],[0,ap,65],[0,aM,64],[0,a5,16],[0,aO,53],[0,as,66],[0,aQ,25],[0,aN,59],[0,bf,69],[0,aC,29],[0,bd,45],[0,G,24],[0,T,73],[0,w,49],[0,be,67],[0,aX,33],[0,E,48],[0,aJ,14],[0,af,P],[0,h,8],[0,ax,7],[0,aT,6],[0,O,5],[0,z,78],[0,W,77],[0,H,79],[0,A,88],[0,ag,89],[0,e,90],[0,ao,91],[0,bh,93],[0,aD,84],[0,av,95],[0,bc,96],[0,ak,92],[0,aS,97],[0,an,98],[0,aE,94],[0,n,99],[0,Z,v],[0,V,82],[0,aw,f],[0,aA,D],[0,a4,81],[0,aH,Q],[0,aL,87],[0,F,bb],[0,bk,85],[0,bl,U],[0,a_,aF],[0,L,86],[0,ai,a8],[0,aU,83],[0,aG,I],[0,K,80],[0,Y,u],[0,R,4],[0,a1,3],[0,k,2],[0,aB,_],[0,at,aV],[0,ac,ad],[0,J,1],[0,aY,60],[0,X,62],[0,a9,19],[0,C,12],[0,r,46],[0,S,13],[0,am,0]]],[0,[0,"CRCS",0],[0,[0,"PRIM","%caml_format_int_special\0%direct_int_div\0%direct_int_mod\0%direct_int_mul\0%identity\0%int_add\0%int_and\0%int_asr\0%int_div\0%int_lsl\0%int_lsr\0%int_mod\0%int_mul\0%int_neg\0%int_or\0%int_sub\0%int_xor\0BigStringReader\0MlBytes\0MlFakeDevice\0MlFakeFd\0MlFakeFd_out\0MlFakeFile\0MlFile\0MlInt64\0MlMutex\0MlNat\0MlNodeDevice\0MlNodeFd\0MlObjectTable\0MlStringReader\0Ml_Bigarray\0Ml_Bigarray_c_1_1\0UInt8ArrayReader\0add_nat\0bigstring_of_array_buffer\0bigstring_of_typed_array\0bigstring_to_array_buffer\0bigstring_to_typed_array\0blit_nat\0caml_MD5Final\0caml_MD5Init\0caml_MD5Transform\0caml_MD5Update\0caml_abs_float\0caml_acos_float\0caml_acosh_float\0caml_add_float\0caml_alloc_dummy\0caml_alloc_dummy_float\0caml_alloc_dummy_infix\0caml_alloc_stack\0caml_argv\0caml_array_append\0caml_array_blit\0caml_array_bound_error\0caml_array_concat\0caml_array_fill\0caml_array_get\0caml_array_get_addr\0caml_array_get_float\0caml_array_of_bytes\0caml_array_of_string\0caml_array_set\0caml_array_set_addr\0caml_array_set_float\0caml_array_sub\0caml_array_unsafe_get\0caml_array_unsafe_get_float\0caml_array_unsafe_set\0caml_array_unsafe_set_float\0caml_asin_float\0caml_asinh_float\0caml_atan2_float\0caml_atan_float\0caml_atanh_float\0caml_atomic_cas\0caml_atomic_exchange\0caml_atomic_fetch_add\0caml_atomic_load\0caml_ba_blit\0caml_ba_change_layout\0caml_ba_compare\0caml_ba_create\0caml_ba_create_buffer\0caml_ba_create_from\0caml_ba_create_unsafe\0caml_ba_custom_name\0caml_ba_deserialize\0caml_ba_dim\0caml_ba_dim_1\0caml_ba_dim_2\0caml_ba_dim_3\0caml_ba_fill\0caml_ba_from_typed_array\0caml_ba_get_1\0caml_ba_get_2\0caml_ba_get_3\0caml_ba_get_generic\0caml_ba_get_size\0caml_ba_get_size_per_element\0caml_ba_hash\0caml_ba_init\0caml_ba_kind\0caml_ba_kind_of_typed_array\0caml_ba_layout\0caml_ba_map_file\0caml_ba_map_file_bytecode\0caml_ba_num_dims\0caml_ba_reshape\0caml_ba_serialize\0caml_ba_set_1\0caml_ba_set_2\0caml_ba_set_3\0caml_ba_set_generic\0caml_ba_slice\0caml_ba_sub\0caml_ba_to_typed_array\0caml_ba_uint8_get16\0caml_ba_uint8_get32\0caml_ba_uint8_get64\0caml_ba_uint8_set16\0caml_ba_uint8_set32\0caml_ba_uint8_set64\0caml_backtrace_status\0caml_bigstring_blit_ba_to_ba\0caml_bigstring_blit_ba_to_bytes\0caml_bigstring_blit_bytes_to_ba\0caml_bigstring_blit_string_to_ba\0caml_bigstring_memcmp\0caml_blit_bytes\0caml_blit_string\0caml_bswap16\0caml_build_symbols\0caml_bytes_bound_error\0caml_bytes_compare\0caml_bytes_equal\0caml_bytes_get\0caml_bytes_get16\0caml_bytes_get32\0caml_bytes_get64\0caml_bytes_greaterequal\0caml_bytes_greaterthan\0caml_bytes_lessequal\0caml_bytes_lessthan\0caml_bytes_notequal\0caml_bytes_of_array\0caml_bytes_of_jsbytes\0caml_bytes_of_string\0caml_bytes_of_utf16_jsstring\0caml_bytes_set\0caml_bytes_set16\0caml_bytes_set32\0caml_bytes_set64\0caml_bytes_unsafe_get\0caml_bytes_unsafe_set\0caml_call_gen\0caml_callback\0caml_cbrt_float\0caml_ceil_float\0caml_channel_descriptor\0caml_check_bound\0caml_classify_float\0caml_compare\0caml_compare_val\0caml_compare_val_get_custom\0caml_compare_val_number_custom\0caml_compare_val_tag\0caml_continuation_use_and_update_handler_noexc\0caml_continuation_use_noexc\0caml_convert_bytes_to_array\0caml_convert_raw_backtrace\0caml_convert_raw_backtrace_slot\0caml_convert_string_to_bytes\0caml_copysign_float\0caml_cos_float\0caml_cosh_float\0caml_create_bytes\0caml_create_file\0caml_create_string\0caml_current_dir\0caml_custom_event_index\0caml_custom_ops\0caml_div\0caml_div_float\0caml_domain_dls\0caml_domain_dls_get\0caml_domain_dls_set\0caml_domain_id\0caml_domain_spawn\0caml_ensure_stack_capacity\0caml_ephe_blit_data\0caml_ephe_blit_key\0caml_ephe_check_data\0caml_ephe_check_key\0caml_ephe_create\0caml_ephe_data_offset\0caml_ephe_get_data\0caml_ephe_get_data_copy\0caml_ephe_get_key\0caml_ephe_get_key_copy\0caml_ephe_key_offset\0caml_ephe_set_data\0caml_ephe_set_key\0caml_ephe_unset_data\0caml_ephe_unset_key\0caml_eq_float\0caml_equal\0caml_erf_float\0caml_erfc_float\0caml_eventlog_pause\0caml_eventlog_resume\0caml_executable_name\0caml_exn_with_js_backtrace\0caml_exp2_float\0caml_exp_float\0caml_expm1_float\0caml_failwith\0caml_fatal_uncaught_exception\0caml_fill_bytes\0caml_fill_string\0caml_final_register\0caml_final_register_called_without_value\0caml_final_release\0caml_finish_formatting\0caml_float_compare\0caml_float_of_bytes\0caml_float_of_int\0caml_float_of_string\0caml_floatarray_blit\0caml_floatarray_create\0caml_floatarray_get\0caml_floatarray_set\0caml_floatarray_unsafe_get\0caml_floatarray_unsafe_set\0caml_floor_float\0caml_fma_float\0caml_fmod_float\0caml_format_exception\0caml_format_float\0caml_format_int\0caml_fresh_oo_id\0caml_frexp_float\0caml_fs_init\0caml_gc_compaction\0caml_gc_counters\0caml_gc_full_major\0caml_gc_get\0caml_gc_huge_fallback_count\0caml_gc_major\0caml_gc_major_slice\0caml_gc_minor\0caml_gc_minor_words\0caml_gc_quick_stat\0caml_gc_set\0caml_gc_stat\0caml_ge_float\0caml_get_continuation_callstack\0caml_get_current_callstack\0caml_get_exception_backtrace\0caml_get_exception_raw_backtrace\0caml_get_global_data\0caml_get_major_bucket\0caml_get_major_credit\0caml_get_minor_free\0caml_get_public_method\0caml_get_root\0caml_global_data\0caml_gr_arc_aux\0caml_gr_blit_image\0caml_gr_clear_graph\0caml_gr_close_graph\0caml_gr_close_subwindow\0caml_gr_create_image\0caml_gr_current_x\0caml_gr_current_y\0caml_gr_display_mode\0caml_gr_doc_of_state\0caml_gr_draw_arc\0caml_gr_draw_char\0caml_gr_draw_image\0caml_gr_draw_rect\0caml_gr_draw_str\0caml_gr_draw_string\0caml_gr_dump_image\0caml_gr_fill_arc\0caml_gr_fill_poly\0caml_gr_fill_rect\0caml_gr_lineto\0caml_gr_make_image\0caml_gr_moveto\0caml_gr_open_graph\0caml_gr_open_subwindow\0caml_gr_plot\0caml_gr_point_color\0caml_gr_remember_mode\0caml_gr_resize_window\0caml_gr_set_color\0caml_gr_set_font\0caml_gr_set_line_width\0caml_gr_set_text_size\0caml_gr_set_window_title\0caml_gr_sigio_handler\0caml_gr_sigio_signal\0caml_gr_size_x\0caml_gr_size_y\0caml_gr_state\0caml_gr_state_create\0caml_gr_state_get\0caml_gr_state_init\0caml_gr_state_set\0caml_gr_synchronize\0caml_gr_text_size\0caml_gr_wait_event\0caml_gr_window_id\0caml_greaterequal\0caml_greaterthan\0caml_gt_float\0caml_hash\0caml_hash_mix_bigstring\0caml_hash_mix_bytes\0caml_hash_mix_bytes_arr\0caml_hash_mix_final\0caml_hash_mix_float\0caml_hash_mix_int\0caml_hash_mix_int64\0caml_hash_mix_jsbytes\0caml_hash_mix_string\0caml_hash_nat\0caml_hexstring_of_float\0caml_hypot_float\0caml_input_value\0caml_input_value_from_bytes\0caml_input_value_from_reader\0caml_input_value_from_string\0caml_input_value_to_outside_heap\0caml_install_signal_handler\0caml_int32_add\0caml_int32_and\0caml_int32_bits_of_float\0caml_int32_bswap\0caml_int32_compare\0caml_int32_div\0caml_int32_float_of_bits\0caml_int32_format\0caml_int32_mod\0caml_int32_mul\0caml_int32_neg\0caml_int32_of_float\0caml_int32_of_int\0caml_int32_of_string\0caml_int32_or\0caml_int32_shift_left\0caml_int32_shift_right\0caml_int32_shift_right_unsigned\0caml_int32_sub\0caml_int32_to_float\0caml_int32_to_int\0caml_int32_unmarshal\0caml_int32_xor\0caml_int64_add\0caml_int64_and\0caml_int64_bits_of_float\0caml_int64_bswap\0caml_int64_compare\0caml_int64_create_lo_hi\0caml_int64_create_lo_mi_hi\0caml_int64_div\0caml_int64_float_of_bits\0caml_int64_format\0caml_int64_hash\0caml_int64_hi32\0caml_int64_is_negative\0caml_int64_is_zero\0caml_int64_lo32\0caml_int64_marshal\0caml_int64_mod\0caml_int64_mul\0caml_int64_neg\0caml_int64_of_bytes\0caml_int64_of_float\0caml_int64_of_int\0caml_int64_of_int32\0caml_int64_of_nativeint\0caml_int64_of_string\0caml_int64_offset\0caml_int64_or\0caml_int64_shift_left\0caml_int64_shift_right\0caml_int64_shift_right_unsigned\0caml_int64_sub\0caml_int64_to_bytes\0caml_int64_to_float\0caml_int64_to_int\0caml_int64_to_int32\0caml_int64_to_nativeint\0caml_int64_ult\0caml_int64_unmarshal\0caml_int64_xor\0caml_int_compare\0caml_int_of_float\0caml_int_of_string\0caml_invalid_argument\0caml_is_continuation_tag\0caml_is_js\0caml_is_ml_bytes\0caml_is_ml_string\0caml_is_printable\0caml_is_special_exception\0caml_js_call\0caml_js_delete\0caml_js_equals\0caml_js_error_of_exception\0caml_js_error_option_of_exception\0caml_js_eval_string\0caml_js_expr\0caml_js_from_array\0caml_js_from_bool\0caml_js_from_float\0caml_js_from_string\0caml_js_fun_call\0caml_js_function_arity\0caml_js_get\0caml_js_get_console\0caml_js_html_entities\0caml_js_html_escape\0caml_js_instanceof\0caml_js_meth_call\0caml_js_new\0caml_js_object\0caml_js_on_ie\0caml_js_pure_expr\0caml_js_set\0caml_js_to_array\0caml_js_to_bool\0caml_js_to_byte_string\0caml_js_to_float\0caml_js_to_string\0caml_js_typeof\0caml_js_var\0caml_js_wrap_callback\0caml_js_wrap_callback_arguments\0caml_js_wrap_callback_strict\0caml_js_wrap_callback_unsafe\0caml_js_wrap_meth_callback\0caml_js_wrap_meth_callback_arguments\0caml_js_wrap_meth_callback_strict\0caml_js_wrap_meth_callback_unsafe\0caml_jsbytes_of_string\0caml_jsoo_flags_effects\0caml_jsoo_flags_use_js_string\0caml_jsstring_of_string\0caml_lazy_make_forward\0caml_lazy_read_result\0caml_lazy_reset_to_lazy\0caml_lazy_update_to_forcing\0caml_lazy_update_to_forward\0caml_ldexp_float\0caml_le_float\0caml_lessequal\0caml_lessthan\0caml_lex_array\0caml_lex_engine\0caml_list_mount_point\0caml_list_of_js_array\0caml_list_to_js_array\0caml_log10_float\0caml_log1p_float\0caml_log2_float\0caml_log_float\0caml_lt_float\0caml_lxm_next\0caml_make_array\0caml_make_float_vect\0caml_make_path\0caml_make_vect\0caml_marshal_constants\0caml_marshal_data_size\0caml_marshal_header_size\0caml_maybe_attach_backtrace\0caml_maybe_print_stats\0caml_md5_bytes\0caml_md5_chan\0caml_md5_string\0caml_memprof_set\0caml_memprof_start\0caml_memprof_stop\0caml_ml_bytes_content\0caml_ml_bytes_length\0caml_ml_channel_size\0caml_ml_channel_size_64\0caml_ml_channels\0caml_ml_close_channel\0caml_ml_condition_broadcast\0caml_ml_condition_new\0caml_ml_condition_signal\0caml_ml_condition_wait\0caml_ml_debug_info_status\0caml_ml_domain_cpu_relax\0caml_ml_domain_id\0caml_ml_domain_set_name\0caml_ml_domain_unique_token\0caml_ml_enable_runtime_warnings\0caml_ml_flush\0caml_ml_input\0caml_ml_input_block\0caml_ml_input_char\0caml_ml_input_int\0caml_ml_input_scan_line\0caml_ml_is_buffered\0caml_ml_mutex_lock\0caml_ml_mutex_new\0caml_ml_mutex_try_lock\0caml_ml_mutex_unlock\0caml_ml_open_descriptor_in\0caml_ml_open_descriptor_out\0caml_ml_out_channels_list\0caml_ml_output\0caml_ml_output_bytes\0caml_ml_output_char\0caml_ml_output_int\0caml_ml_pos_in\0caml_ml_pos_in_64\0caml_ml_pos_out\0caml_ml_pos_out_64\0caml_ml_runtime_warnings_enabled\0caml_ml_seek_in\0caml_ml_seek_in_64\0caml_ml_seek_out\0caml_ml_seek_out_64\0caml_ml_set_binary_mode\0caml_ml_set_buffered\0caml_ml_set_channel_name\0caml_ml_set_channel_output\0caml_ml_set_channel_refill\0caml_ml_string_length\0caml_mod\0caml_modf_float\0caml_mount_autoload\0caml_mul\0caml_mul_float\0caml_named_value\0caml_named_values\0caml_nativeint_add\0caml_nativeint_and\0caml_nativeint_bswap\0caml_nativeint_compare\0caml_nativeint_div\0caml_nativeint_format\0caml_nativeint_mod\0caml_nativeint_mul\0caml_nativeint_neg\0caml_nativeint_of_float\0caml_nativeint_of_int\0caml_nativeint_of_int32\0caml_nativeint_of_string\0caml_nativeint_or\0caml_nativeint_shift_left\0caml_nativeint_shift_right\0caml_nativeint_shift_right_unsigned\0caml_nativeint_sub\0caml_nativeint_to_float\0caml_nativeint_to_int\0caml_nativeint_to_int32\0caml_nativeint_unmarshal\0caml_nativeint_xor\0caml_neg_float\0caml_neq_float\0caml_new_lex_engine\0caml_new_string\0caml_nextafter_float\0caml_notequal\0caml_obj_add_offset\0caml_obj_block\0caml_obj_compare_and_swap\0caml_obj_dup\0caml_obj_is_block\0caml_obj_is_shared\0caml_obj_make_forward\0caml_obj_raw_field\0caml_obj_reachable_words\0caml_obj_set_raw_field\0caml_obj_set_tag\0caml_obj_tag\0caml_obj_truncate\0caml_obj_update_tag\0caml_obj_with_tag\0caml_ojs_new_arr\0caml_oo_last_id\0caml_output_val\0caml_output_value\0caml_output_value_to_buffer\0caml_output_value_to_bytes\0caml_output_value_to_string\0caml_parse_digit\0caml_parse_engine\0caml_parse_format\0caml_parse_sign_and_base\0caml_parser_trace\0caml_pos_in\0caml_pos_out\0caml_power_float\0caml_pure_js_expr\0caml_raise_constant\0caml_raise_end_of_file\0caml_raise_no_such_file\0caml_raise_not_a_dir\0caml_raise_not_found\0caml_raise_sys_error\0caml_raise_with_arg\0caml_raise_with_args\0caml_raise_with_string\0caml_raise_zero_divide\0caml_raw_backtrace_length\0caml_raw_backtrace_next_slot\0caml_raw_backtrace_slot\0caml_read_file_content\0caml_recommended_domain_count\0caml_record_backtrace\0caml_record_backtrace_flag\0caml_refill\0caml_register_channel_for_spacetime\0caml_register_global\0caml_register_named_value\0caml_restore_raw_backtrace\0caml_root\0caml_round_float\0caml_runtime_events_create_cursor\0caml_runtime_events_free_cursor\0caml_runtime_events_pause\0caml_runtime_events_read_poll\0caml_runtime_events_resume\0caml_runtime_events_start\0caml_runtime_events_user_register\0caml_runtime_events_user_resolve\0caml_runtime_events_user_write\0caml_runtime_parameters\0caml_runtime_variant\0caml_runtime_warnings\0caml_seek_in\0caml_seek_out\0caml_set_oo_id\0caml_set_parser_trace\0caml_set_static_env\0caml_signbit_float\0caml_sin_float\0caml_sinh_float\0caml_spacetime_enabled\0caml_spacetime_only_works_for_native_code\0caml_sqrt_float\0caml_str_initialize\0caml_str_repeat\0caml_string_bound_error\0caml_string_compare\0caml_string_equal\0caml_string_get\0caml_string_get16\0caml_string_get32\0caml_string_get64\0caml_string_greaterequal\0caml_string_greaterthan\0caml_string_hash\0caml_string_lessequal\0caml_string_lessthan\0caml_string_notequal\0caml_string_of_array\0caml_string_of_bytes\0caml_string_of_jsbytes\0caml_string_of_jsstring\0caml_string_set\0caml_string_set16\0caml_string_set32\0caml_string_set64\0caml_string_unsafe_get\0caml_string_unsafe_set\0caml_sub_float\0caml_subarray_to_jsbytes\0caml_sys_argv\0caml_sys_chdir\0caml_sys_close\0caml_sys_const_backend_type\0caml_sys_const_big_endian\0caml_sys_const_int_size\0caml_sys_const_max_wosize\0caml_sys_const_naked_pointers_checked\0caml_sys_const_ostype_cygwin\0caml_sys_const_ostype_unix\0caml_sys_const_ostype_win32\0caml_sys_const_word_size\0caml_sys_executable_name\0caml_sys_exit\0caml_sys_fds\0caml_sys_file_exists\0caml_sys_get_argv\0caml_sys_get_config\0caml_sys_getcwd\0caml_sys_getenv\0caml_sys_is_directory\0caml_sys_is_regular_file\0caml_sys_isatty\0caml_sys_mkdir\0caml_sys_modify_argv\0caml_sys_open\0caml_sys_open_for_node\0caml_sys_random_seed\0caml_sys_read_directory\0caml_sys_remove\0caml_sys_rename\0caml_sys_rmdir\0caml_sys_system_command\0caml_sys_time\0caml_sys_time_include_children\0caml_sys_unsafe_getenv\0caml_tan_float\0caml_tanh_float\0caml_to_js_string\0caml_trailing_slash\0caml_trampoline\0caml_trampoline_return\0caml_trunc_float\0caml_uint8_array_of_bytes\0caml_uint8_array_of_string\0caml_unix_cleanup\0caml_unix_closedir\0caml_unix_filedescr_of_fd\0caml_unix_findclose\0caml_unix_findfirst\0caml_unix_findnext\0caml_unix_getpwuid\0caml_unix_gettimeofday\0caml_unix_getuid\0caml_unix_gmtime\0caml_unix_has_symlink\0caml_unix_inet_addr_of_string\0caml_unix_isatty\0caml_unix_localtime\0caml_unix_lstat\0caml_unix_lstat_64\0caml_unix_mkdir\0caml_unix_mktime\0caml_unix_opendir\0caml_unix_readdir\0caml_unix_readlink\0caml_unix_rewinddir\0caml_unix_rmdir\0caml_unix_startup\0caml_unix_stat\0caml_unix_stat_64\0caml_unix_symlink\0caml_unix_time\0caml_unix_unlink\0caml_unmount\0caml_update_dummy\0caml_utf16_of_utf8\0caml_utf8_of_utf16\0caml_weak_blit\0caml_weak_check\0caml_weak_create\0caml_weak_get\0caml_weak_get_copy\0caml_weak_set\0caml_wrap_exception\0caml_xmlhttprequest_create\0compare_digits_nat\0compare_nat\0compare_nat_real\0complement_nat\0create_nat\0decr_nat\0deserialize_nat\0div_digit_nat\0div_helper\0div_nat\0fs_node_supported\0incr_nat\0initialize_nat\0is_digit_int\0is_digit_odd\0is_digit_zero\0jsoo_create_file\0jsoo_create_file_extern\0jsoo_effect_not_supported\0jsoo_floor_log2\0jsoo_is_ascii\0jsoo_mount_point\0jsoo_sys_getenv\0land_digit_nat\0lor_digit_nat\0lxor_digit_nat\0make_unix_err_args\0mult_digit_nat\0mult_nat\0nat_of_array\0nth_digit_nat\0nth_digit_nat_native\0num_digits_nat\0num_leading_zero_bits_in_digit\0os_type\0path_is_absolute\0re_match\0re_partial_match\0re_replacement_text\0re_search_backward\0re_search_forward\0re_string_match\0resolve_fs_device\0serialize_nat\0set_digit_nat\0set_digit_nat_native\0set_to_zero_nat\0shift_left_nat\0shift_right_nat\0square_nat\0sub_nat\0unix_closedir\0unix_getpwuid\0unix_gettimeofday\0unix_getuid\0unix_gmtime\0unix_has_symlink\0unix_inet_addr_of_string\0unix_isatty\0unix_localtime\0unix_lstat\0unix_lstat_64\0unix_mkdir\0unix_mktime\0unix_opendir\0unix_readdir\0unix_readlink\0unix_rewinddir\0unix_rmdir\0unix_stat\0unix_stat_64\0unix_symlink\0unix_time\0unix_unlink\0win_cleanup\0win_filedescr_of_channel\0win_findclose\0win_findfirst\0win_findnext\0win_handle_fd\0win_startup\0zstd_decompress\0"],0]]]];return}(globalThis)); +//# 1 "../.js/default/stdlib/stdlib.cma.js" +// Generated by js_of_ocaml +//# 3 "../.js/default/stdlib/stdlib.cma.js" + +//# 5 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function erase_rel(param){ + if(typeof param === "number") return 0; + switch(param[0]){ + case 0: + var rest = param[1]; return [0, erase_rel(rest)]; + case 1: + var rest$0 = param[1]; return [1, erase_rel(rest$0)]; + case 2: + var rest$1 = param[1]; return [2, erase_rel(rest$1)]; + case 3: + var rest$2 = param[1]; return [3, erase_rel(rest$2)]; + case 4: + var rest$3 = param[1]; return [4, erase_rel(rest$3)]; + case 5: + var rest$4 = param[1]; return [5, erase_rel(rest$4)]; + case 6: + var rest$5 = param[1]; return [6, erase_rel(rest$5)]; + case 7: + var rest$6 = param[1]; return [7, erase_rel(rest$6)]; + case 8: + var rest$7 = param[2], ty = param[1]; + return [8, ty, erase_rel(rest$7)]; + case 9: + var rest$8 = param[3], ty1 = param[1]; + return [9, ty1, ty1, erase_rel(rest$8)]; + case 10: + var rest$9 = param[1]; return [10, erase_rel(rest$9)]; + case 11: + var rest$10 = param[1]; return [11, erase_rel(rest$10)]; + case 12: + var rest$11 = param[1]; return [12, erase_rel(rest$11)]; + case 13: + var rest$12 = param[1]; return [13, erase_rel(rest$12)]; + default: var rest$13 = param[1]; return [14, erase_rel(rest$13)]; + } + } + function concat_fmtty(fmtty1, fmtty2){ + if(typeof fmtty1 === "number") return fmtty2; + switch(fmtty1[0]){ + case 0: + var rest = fmtty1[1]; return [0, concat_fmtty(rest, fmtty2)]; + case 1: + var rest$0 = fmtty1[1]; return [1, concat_fmtty(rest$0, fmtty2)]; + case 2: + var rest$1 = fmtty1[1]; return [2, concat_fmtty(rest$1, fmtty2)]; + case 3: + var rest$2 = fmtty1[1]; return [3, concat_fmtty(rest$2, fmtty2)]; + case 4: + var rest$3 = fmtty1[1]; return [4, concat_fmtty(rest$3, fmtty2)]; + case 5: + var rest$4 = fmtty1[1]; return [5, concat_fmtty(rest$4, fmtty2)]; + case 6: + var rest$5 = fmtty1[1]; return [6, concat_fmtty(rest$5, fmtty2)]; + case 7: + var rest$6 = fmtty1[1]; return [7, concat_fmtty(rest$6, fmtty2)]; + case 8: + var rest$7 = fmtty1[2], ty = fmtty1[1]; + return [8, ty, concat_fmtty(rest$7, fmtty2)]; + case 9: + var rest$8 = fmtty1[3], ty2 = fmtty1[2], ty1 = fmtty1[1]; + return [9, ty1, ty2, concat_fmtty(rest$8, fmtty2)]; + case 10: + var rest$9 = fmtty1[1]; return [10, concat_fmtty(rest$9, fmtty2)]; + case 11: + var rest$10 = fmtty1[1]; return [11, concat_fmtty(rest$10, fmtty2)]; + case 12: + var rest$11 = fmtty1[1]; return [12, concat_fmtty(rest$11, fmtty2)]; + case 13: + var rest$12 = fmtty1[1]; return [13, concat_fmtty(rest$12, fmtty2)]; + default: + var rest$13 = fmtty1[1]; return [14, concat_fmtty(rest$13, fmtty2)]; + } + } + function concat_fmt(fmt1, fmt2){ + if(typeof fmt1 === "number") return fmt2; + switch(fmt1[0]){ + case 0: + var rest = fmt1[1]; return [0, concat_fmt(rest, fmt2)]; + case 1: + var rest$0 = fmt1[1]; return [1, concat_fmt(rest$0, fmt2)]; + case 2: + var rest$1 = fmt1[2], pad = fmt1[1]; + return [2, pad, concat_fmt(rest$1, fmt2)]; + case 3: + var rest$2 = fmt1[2], pad$0 = fmt1[1]; + return [3, pad$0, concat_fmt(rest$2, fmt2)]; + case 4: + var rest$3 = fmt1[4], prec = fmt1[3], pad$1 = fmt1[2], iconv = fmt1[1]; + return [4, iconv, pad$1, prec, concat_fmt(rest$3, fmt2)]; + case 5: + var + rest$4 = fmt1[4], + prec$0 = fmt1[3], + pad$2 = fmt1[2], + iconv$0 = fmt1[1]; + return [5, iconv$0, pad$2, prec$0, concat_fmt(rest$4, fmt2)]; + case 6: + var + rest$5 = fmt1[4], + prec$1 = fmt1[3], + pad$3 = fmt1[2], + iconv$1 = fmt1[1]; + return [6, iconv$1, pad$3, prec$1, concat_fmt(rest$5, fmt2)]; + case 7: + var + rest$6 = fmt1[4], + prec$2 = fmt1[3], + pad$4 = fmt1[2], + iconv$2 = fmt1[1]; + return [7, iconv$2, pad$4, prec$2, concat_fmt(rest$6, fmt2)]; + case 8: + var + rest$7 = fmt1[4], + prec$3 = fmt1[3], + pad$5 = fmt1[2], + fconv = fmt1[1]; + return [8, fconv, pad$5, prec$3, concat_fmt(rest$7, fmt2)]; + case 9: + var rest$8 = fmt1[2], pad$6 = fmt1[1]; + return [9, pad$6, concat_fmt(rest$8, fmt2)]; + case 10: + var rest$9 = fmt1[1]; return [10, concat_fmt(rest$9, fmt2)]; + case 11: + var rest$10 = fmt1[2], str = fmt1[1]; + return [11, str, concat_fmt(rest$10, fmt2)]; + case 12: + var rest$11 = fmt1[2], chr = fmt1[1]; + return [12, chr, concat_fmt(rest$11, fmt2)]; + case 13: + var rest$12 = fmt1[3], fmtty = fmt1[2], pad$7 = fmt1[1]; + return [13, pad$7, fmtty, concat_fmt(rest$12, fmt2)]; + case 14: + var rest$13 = fmt1[3], fmtty$0 = fmt1[2], pad$8 = fmt1[1]; + return [14, pad$8, fmtty$0, concat_fmt(rest$13, fmt2)]; + case 15: + var rest$14 = fmt1[1]; return [15, concat_fmt(rest$14, fmt2)]; + case 16: + var rest$15 = fmt1[1]; return [16, concat_fmt(rest$15, fmt2)]; + case 17: + var rest$16 = fmt1[2], fmting_lit = fmt1[1]; + return [17, fmting_lit, concat_fmt(rest$16, fmt2)]; + case 18: + var rest$17 = fmt1[2], fmting_gen = fmt1[1]; + return [18, fmting_gen, concat_fmt(rest$17, fmt2)]; + case 19: + var rest$18 = fmt1[1]; return [19, concat_fmt(rest$18, fmt2)]; + case 20: + var rest$19 = fmt1[3], char_set = fmt1[2], width_opt = fmt1[1]; + return [20, width_opt, char_set, concat_fmt(rest$19, fmt2)]; + case 21: + var rest$20 = fmt1[2], counter = fmt1[1]; + return [21, counter, concat_fmt(rest$20, fmt2)]; + case 22: + var rest$21 = fmt1[1]; return [22, concat_fmt(rest$21, fmt2)]; + case 23: + var rest$22 = fmt1[2], ign = fmt1[1]; + return [23, ign, concat_fmt(rest$22, fmt2)]; + default: + var rest$23 = fmt1[3], f = fmt1[2], arity = fmt1[1]; + return [24, arity, f, concat_fmt(rest$23, fmt2)]; + } + } + var CamlinternalFormatBasics = [0, concat_fmtty, erase_rel, concat_fmt]; + runtime.caml_register_global + (0, CamlinternalFormatBasics, "CamlinternalFormatBasics"); + return; + } + (globalThis)); + +//# 179 "../.js/default/stdlib/stdlib.cma.js" +(function(globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function make(v){return [0, v];} + function get(r){return r[1];} + function set(r, v){r[1] = v; return 0;} + function exchange(r, v){var cur = r[1]; r[1] = v; return cur;} + function compare_and_set(r, seen, v){ + var cur = r[1]; + return cur === seen ? (r[1] = v, 1) : 0; + } + function fetch_and_add(r, n){ + var cur = r[1]; + r[1] = cur + n | 0; + return cur; + } + function incr(r){fetch_and_add(r, 1); return 0;} + function decr(r){fetch_and_add(r, -1); return 0;} + var + CamlinternalAtomic = + [0, + make, + get, + set, + exchange, + compare_and_set, + fetch_and_add, + incr, + decr]; + runtime.caml_register_global(0, CamlinternalAtomic, "CamlinternalAtomic"); + return; + } + (globalThis)); + +//# 215 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_false$0 = "false", + cst_true$0 = "true", + caml_blit_string = runtime.caml_blit_string, + caml_create_bytes = runtime.caml_create_bytes, + caml_float_of_string = runtime.caml_float_of_string, + caml_int64_float_of_bits = runtime.caml_int64_float_of_bits, + caml_int_of_string = runtime.caml_int_of_string, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_bytes_length = runtime.caml_ml_bytes_length, + caml_ml_channel_size = runtime.caml_ml_channel_size, + caml_ml_channel_size_64 = runtime.caml_ml_channel_size_64, + caml_ml_close_channel = runtime.caml_ml_close_channel, + caml_ml_flush = runtime.caml_ml_flush, + caml_ml_input = runtime.caml_ml_input, + caml_ml_input_char = runtime.caml_ml_input_char, + caml_ml_open_descriptor_in = runtime.caml_ml_open_descriptor_in, + caml_ml_open_descriptor_out = runtime.caml_ml_open_descriptor_out, + caml_ml_output = runtime.caml_ml_output, + caml_ml_output_bytes = runtime.caml_ml_output_bytes, + caml_ml_output_char = runtime.caml_ml_output_char, + caml_ml_set_binary_mode = runtime.caml_ml_set_binary_mode, + caml_ml_set_channel_name = runtime.caml_ml_set_channel_name, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_notequal = runtime.caml_string_notequal, + caml_string_of_bytes = runtime.caml_string_of_bytes, + caml_sys_open = runtime.caml_sys_open, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + cst$0 = "%,", + cst = ".", + CamlinternalAtomic = global_data.CamlinternalAtomic, + CamlinternalFormatBasics = global_data.CamlinternalFormatBasics, + Invalid_argument = global_data.Invalid_argument, + Failure = global_data.Failure, + Match_failure = global_data.Match_failure, + Assert_failure = global_data.Assert_failure, + Not_found = global_data.Not_found, + Out_of_memory = global_data.Out_of_memory, + Stack_overflow = global_data.Stack_overflow, + Sys_error = global_data.Sys_error, + End_of_file = global_data.End_of_file, + Division_by_zero = global_data.Division_by_zero, + Sys_blocked_io = global_data.Sys_blocked_io, + Undefined_recursive_module = global_data.Undefined_recursive_module, + cst_really_input = "really_input", + cst_input = "input", + _l_ = [0, 0, [0, 6, 0]], + _k_ = [0, 0, [0, 7, 0]], + cst_output_substring = "output_substring", + cst_output = "output", + _j_ = [0, 1, [0, 3, [0, 4, [0, 6, 0]]]], + _i_ = [0, 1, [0, 3, [0, 4, [0, 7, 0]]]], + _g_ = [0, 1], + _h_ = [0, 0], + cst_bool_of_string = "bool_of_string", + cst_true = cst_true$0, + cst_false = cst_false$0, + cst_char_of_int = "char_of_int", + cst_Stdlib_Exit = "Stdlib.Exit", + _a_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 32752), + _b_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 65520), + _c_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 32752), + _d_ = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 32751), + _e_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 16), + _f_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 15536); + function failwith(s){ + throw caml_maybe_attach_backtrace([0, Failure, s], 1); + } + function invalid_arg(s){ + throw caml_maybe_attach_backtrace([0, Invalid_argument, s], 1); + } + var Exit = [248, cst_Stdlib_Exit, runtime.caml_fresh_oo_id(0)]; + function min(x, y){return runtime.caml_lessequal(x, y) ? x : y;} + function max(x, y){return runtime.caml_greaterequal(x, y) ? x : y;} + function abs(x){return 0 <= x ? x : - x | 0;} + function lnot(x){return x ^ -1;} + var + infinity = caml_int64_float_of_bits(_a_), + neg_infinity = caml_int64_float_of_bits(_b_), + nan = caml_int64_float_of_bits(_c_), + max_float = caml_int64_float_of_bits(_d_), + min_float = caml_int64_float_of_bits(_e_), + epsilon_float = caml_int64_float_of_bits(_f_), + max_int = 2147483647, + min_int = -2147483648; + function symbol(s1, s2){ + var + l1 = caml_ml_string_length(s1), + l2 = caml_ml_string_length(s2), + s = caml_create_bytes(l1 + l2 | 0); + caml_blit_string(s1, 0, s, 0, l1); + caml_blit_string(s2, 0, s, l1, l2); + return caml_string_of_bytes(s); + } + function char_of_int(n){ + if(0 <= n && 255 >= n) return n; + return invalid_arg(cst_char_of_int); + } + function string_of_bool(b){return b ? cst_true : cst_false;} + function bool_of_string(param){ + return caml_string_notequal(param, cst_false$0) + ? caml_string_notequal + (param, cst_true$0) + ? invalid_arg(cst_bool_of_string) + : 1 + : 0; + } + function bool_of_string_opt(param){ + return caml_string_notequal(param, cst_false$0) + ? caml_string_notequal(param, cst_true$0) ? 0 : _g_ + : _h_; + } + function string_of_int(n){return "" + n;} + function int_of_string_opt(s){ + try{var _B_ = [0, caml_int_of_string(s)]; return _B_;} + catch(_C_){ + var _A_ = caml_wrap_exception(_C_); + if(_A_[1] === Failure) return 0; + throw caml_maybe_attach_backtrace(_A_, 0); + } + } + function valid_float_lexem(s){ + var l = caml_ml_string_length(s), i = 0; + for(;;){ + if(l <= i) return symbol(s, cst); + var match = runtime.caml_string_get(s, i), switch$0 = 0; + if(48 <= match){ + if(58 > match) switch$0 = 1; + } + else if(45 === match) switch$0 = 1; + if(! switch$0) return s; + var i$0 = i + 1 | 0, i = i$0; + } + } + function string_of_float(f){ + return valid_float_lexem(runtime.caml_format_float("%.12g", f)); + } + function float_of_string_opt(s){ + try{var _y_ = [0, caml_float_of_string(s)]; return _y_;} + catch(_z_){ + var _x_ = caml_wrap_exception(_z_); + if(_x_[1] === Failure) return 0; + throw caml_maybe_attach_backtrace(_x_, 0); + } + } + function symbol$0(l1, l2){ + if(! l1) return l2; + var tl = l1[2], hd = l1[1]; + return [0, hd, symbol$0(tl, l2)]; + } + var + stdin = caml_ml_open_descriptor_in(0), + stdout = caml_ml_open_descriptor_out(1), + stderr = caml_ml_open_descriptor_out(2); + function open_out_gen(mode, perm, name){ + var c = caml_ml_open_descriptor_out(caml_sys_open(name, mode, perm)); + caml_ml_set_channel_name(c, name); + return c; + } + function open_out(name){return open_out_gen(_i_, 438, name);} + function open_out_bin(name){return open_out_gen(_j_, 438, name);} + function flush_all(param){ + var param$0 = runtime.caml_ml_out_channels_list(0); + for(;;){ + if(! param$0) return 0; + var l = param$0[2], a = param$0[1]; + try{caml_ml_flush(a);} + catch(_w_){ + var _v_ = caml_wrap_exception(_w_); + if(_v_[1] !== Sys_error) throw caml_maybe_attach_backtrace(_v_, 0); + } + var param$0 = l; + } + } + function output_bytes(oc, s){ + return caml_ml_output_bytes(oc, s, 0, caml_ml_bytes_length(s)); + } + function output_string(oc, s){ + return caml_ml_output(oc, s, 0, caml_ml_string_length(s)); + } + function output(oc, s, ofs, len){ + if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs) + return caml_ml_output_bytes(oc, s, ofs, len); + return invalid_arg(cst_output); + } + function output_substring(oc, s, ofs, len){ + if(0 <= ofs && 0 <= len && (caml_ml_string_length(s) - len | 0) >= ofs) + return caml_ml_output(oc, s, ofs, len); + return invalid_arg(cst_output_substring); + } + function output_value(chan, v){ + return runtime.caml_output_value(chan, v, 0); + } + function close_out(oc){ + caml_ml_flush(oc); + return caml_ml_close_channel(oc); + } + function close_out_noerr(oc){ + try{caml_ml_flush(oc);}catch(_u_){} + try{var _s_ = caml_ml_close_channel(oc); return _s_;}catch(_t_){return 0;} + } + function open_in_gen(mode, perm, name){ + var c = caml_ml_open_descriptor_in(caml_sys_open(name, mode, perm)); + caml_ml_set_channel_name(c, name); + return c; + } + function open_in(name){return open_in_gen(_k_, 0, name);} + function open_in_bin(name){return open_in_gen(_l_, 0, name);} + function input(ic, s, ofs, len){ + if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs) + return caml_ml_input(ic, s, ofs, len); + return invalid_arg(cst_input); + } + function unsafe_really_input(ic, s, ofs, len){ + var ofs$0 = ofs, len$0 = len; + for(;;){ + if(0 >= len$0) return 0; + var r = caml_ml_input(ic, s, ofs$0, len$0); + if(0 === r) throw caml_maybe_attach_backtrace(End_of_file, 1); + var + len$1 = len$0 - r | 0, + ofs$1 = ofs$0 + r | 0, + ofs$0 = ofs$1, + len$0 = len$1; + } + } + function really_input(ic, s, ofs, len){ + if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs) + return unsafe_really_input(ic, s, ofs, len); + return invalid_arg(cst_really_input); + } + function really_input_string(ic, len){ + var s = caml_create_bytes(len); + really_input(ic, s, 0, len); + return caml_string_of_bytes(s); + } + function input_line(chan){ + function build_result(buf, pos, param){ + var pos$0 = pos, param$0 = param; + for(;;){ + if(! param$0) return buf; + var tl = param$0[2], hd = param$0[1], len = caml_ml_bytes_length(hd); + runtime.caml_blit_bytes(hd, 0, buf, pos$0 - len | 0, len); + var pos$1 = pos$0 - len | 0, pos$0 = pos$1, param$0 = tl; + } + } + var accu = 0, len = 0; + for(;;){ + var n = runtime.caml_ml_input_scan_line(chan); + if(0 === n){ + if(! accu) throw caml_maybe_attach_backtrace(End_of_file, 1); + var _r_ = build_result(caml_create_bytes(len), len, accu); + } + else{ + if(0 >= n){ + var beg = caml_create_bytes(- n | 0); + caml_ml_input(chan, beg, 0, - n | 0); + var + len$1 = len - n | 0, + accu$0 = [0, beg, accu], + accu = accu$0, + len = len$1; + continue; + } + var res = caml_create_bytes(n - 1 | 0); + caml_ml_input(chan, res, 0, n - 1 | 0); + caml_ml_input_char(chan); + if(accu) + var + len$0 = (len + n | 0) - 1 | 0, + _r_ = build_result(caml_create_bytes(len$0), len$0, [0, res, accu]); + else + var _r_ = res; + } + return caml_string_of_bytes(_r_); + } + } + function close_in_noerr(ic){ + try{var _p_ = caml_ml_close_channel(ic); return _p_;}catch(_q_){return 0;} + } + function print_char(c){return caml_ml_output_char(stdout, c);} + function print_string(s){return output_string(stdout, s);} + function print_bytes(s){return output_bytes(stdout, s);} + function print_int(i){return output_string(stdout, "" + i);} + function print_float(f){return output_string(stdout, string_of_float(f));} + function print_endline(s){ + output_string(stdout, s); + caml_ml_output_char(stdout, 10); + return caml_ml_flush(stdout); + } + function print_newline(param){ + caml_ml_output_char(stdout, 10); + return caml_ml_flush(stdout); + } + function prerr_char(c){return caml_ml_output_char(stderr, c);} + function prerr_string(s){return output_string(stderr, s);} + function prerr_bytes(s){return output_bytes(stderr, s);} + function prerr_int(i){return output_string(stderr, "" + i);} + function prerr_float(f){return output_string(stderr, string_of_float(f));} + function prerr_endline(s){ + output_string(stderr, s); + caml_ml_output_char(stderr, 10); + return caml_ml_flush(stderr); + } + function prerr_newline(param){ + caml_ml_output_char(stderr, 10); + return caml_ml_flush(stderr); + } + function read_line(param){caml_ml_flush(stdout); return input_line(stdin);} + function read_int(param){return caml_int_of_string(read_line(0));} + function read_int_opt(param){return int_of_string_opt(read_line(0));} + function read_float(param){return caml_float_of_string(read_line(0));} + function read_float_opt(param){return float_of_string_opt(read_line(0));} + function string_of_format(param){var str = param[2]; return str;} + function symbol$1(param, _n_){ + var + str2 = _n_[2], + fmt2 = _n_[1], + str1 = param[2], + fmt1 = param[1], + _o_ = symbol(str1, symbol(cst$0, str2)); + return [0, caml_call2(CamlinternalFormatBasics[3], fmt1, fmt2), _o_]; + } + var exit_function = caml_call1(CamlinternalAtomic[1], flush_all); + function at_exit(f){ + for(;;){ + var + f_yet_to_run = caml_call1(CamlinternalAtomic[1], 1), + old_exit = caml_call1(CamlinternalAtomic[2], exit_function), + new_exit$0 = + function(f_yet_to_run, old_exit){ + function new_exit(param){ + if(caml_call3(CamlinternalAtomic[5], f_yet_to_run, 1, 0)) + caml_call1(f, 0); + return caml_call1(old_exit, 0); + } + return new_exit; + }, + new_exit = new_exit$0(f_yet_to_run, old_exit), + success = + caml_call3(CamlinternalAtomic[5], exit_function, old_exit, new_exit), + _m_ = 1 - success; + if(_m_) continue; + return _m_; + } + } + function do_at_exit(param){ + return caml_call1(caml_call1(CamlinternalAtomic[2], exit_function), 0); + } + function exit(retcode){ + do_at_exit(0); + return runtime.caml_sys_exit(retcode); + } + runtime.caml_register_named_value("Pervasives.do_at_exit", do_at_exit); + var + Stdlib = + [0, + invalid_arg, + failwith, + Exit, + Match_failure, + Assert_failure, + Invalid_argument, + Failure, + Not_found, + Out_of_memory, + Stack_overflow, + Sys_error, + End_of_file, + Division_by_zero, + Sys_blocked_io, + Undefined_recursive_module, + min, + max, + abs, + max_int, + min_int, + lnot, + infinity, + neg_infinity, + nan, + max_float, + min_float, + epsilon_float, + symbol, + char_of_int, + string_of_bool, + bool_of_string_opt, + bool_of_string, + string_of_int, + int_of_string_opt, + string_of_float, + float_of_string_opt, + symbol$0, + stdin, + stdout, + stderr, + print_char, + print_string, + print_bytes, + print_int, + print_float, + print_endline, + print_newline, + prerr_char, + prerr_string, + prerr_bytes, + prerr_int, + prerr_float, + prerr_endline, + prerr_newline, + read_line, + read_int_opt, + read_int, + read_float_opt, + read_float, + open_out, + open_out_bin, + open_out_gen, + caml_ml_flush, + flush_all, + caml_ml_output_char, + output_string, + output_bytes, + output, + output_substring, + caml_ml_output_char, + runtime.caml_ml_output_int, + output_value, + runtime.caml_ml_seek_out, + runtime.caml_ml_pos_out, + caml_ml_channel_size, + close_out, + close_out_noerr, + caml_ml_set_binary_mode, + open_in, + open_in_bin, + open_in_gen, + caml_ml_input_char, + input_line, + input, + really_input, + really_input_string, + caml_ml_input_char, + runtime.caml_ml_input_int, + runtime.caml_input_value, + runtime.caml_ml_seek_in, + runtime.caml_ml_pos_in, + caml_ml_channel_size, + caml_ml_close_channel, + close_in_noerr, + caml_ml_set_binary_mode, + [0, + runtime.caml_ml_seek_out_64, + runtime.caml_ml_pos_out_64, + caml_ml_channel_size_64, + runtime.caml_ml_seek_in_64, + runtime.caml_ml_pos_in_64, + caml_ml_channel_size_64], + string_of_format, + symbol$1, + exit, + at_exit, + valid_float_lexem, + unsafe_really_input, + do_at_exit]; + runtime.caml_register_global(46, Stdlib, "Stdlib"); + return; + } + (globalThis)); + +//# 996 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_wrap_exception = runtime.caml_wrap_exception, + global_data = runtime.caml_get_global_data(), + ocaml_version = "4.14.1", + ocaml_release = [0, 4, 14, 1, 0], + Stdlib = global_data.Stdlib, + executable_name = runtime.caml_sys_executable_name(0), + os_type = runtime.caml_sys_get_config(0)[1], + backend_type = [0, "js_of_ocaml"], + unix = runtime.caml_sys_const_ostype_unix(0), + win32 = runtime.caml_sys_const_ostype_win32(0), + cygwin = runtime.caml_sys_const_ostype_cygwin(0), + max_array_length = runtime.caml_sys_const_max_wosize(0), + max_floatarray_length = max_array_length / 2 | 0, + max_string_length = (4 * max_array_length | 0) - 1 | 0, + cst_Stdlib_Sys_Break = "Stdlib.Sys.Break", + big_endian = 0, + word_size = 32, + int_size = 32; + function getenv_opt(s){ + try{var _d_ = [0, runtime.caml_sys_getenv(s)]; return _d_;} + catch(_e_){ + var _c_ = caml_wrap_exception(_e_); + if(_c_ === Stdlib[8]) return 0; + throw caml_maybe_attach_backtrace(_c_, 0); + } + } + var interactive = [0, 0]; + function set_signal(sig_num, sig_beh){return 0;} + var + Break = [248, cst_Stdlib_Sys_Break, runtime.caml_fresh_oo_id(0)], + sigabrt = -1, + sigalrm = -2, + sigfpe = -3, + sighup = -4, + sigill = -5, + sigint = -6, + sigkill = -7, + sigpipe = -8, + sigquit = -9, + sigsegv = -10, + sigterm = -11, + sigusr1 = -12, + sigusr2 = -13, + sigchld = -14, + sigcont = -15, + sigstop = -16, + sigtstp = -17, + sigttin = -18, + sigttou = -19, + sigvtalrm = -20, + sigprof = -21, + sigbus = -22, + sigpoll = -23, + sigsys = -24, + sigtrap = -25, + sigurg = -26, + sigxcpu = -27, + sigxfsz = -28; + function catch_break(on){return on ? 0 : 0;} + var development_version = 0; + function Make(_b_, _a_){return [0, 1];} + var + Immediate64 = [0, Make], + Stdlib_Sys = + [0, + executable_name, + getenv_opt, + interactive, + os_type, + backend_type, + unix, + win32, + cygwin, + word_size, + int_size, + big_endian, + max_string_length, + max_array_length, + max_floatarray_length, + set_signal, + sigabrt, + sigalrm, + sigfpe, + sighup, + sigill, + sigint, + sigkill, + sigpipe, + sigquit, + sigsegv, + sigterm, + sigusr1, + sigusr2, + sigchld, + sigcont, + sigstop, + sigtstp, + sigttin, + sigttou, + sigvtalrm, + sigprof, + sigbus, + sigpoll, + sigsys, + sigtrap, + sigurg, + sigxcpu, + sigxfsz, + Break, + catch_break, + ocaml_version, + development_version, + ocaml_release, + runtime.caml_ml_enable_runtime_warnings, + runtime.caml_ml_runtime_warnings_enabled, + Immediate64]; + runtime.caml_register_global(4, Stdlib_Sys, "Stdlib__Sys"); + return; + } + (globalThis)); + +//# 1125 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_Obj_extension_constructor$1 = "Obj.extension_constructor", + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_obj_tag = runtime.caml_obj_tag; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Assert_failure = global_data.Assert_failure, + Stdlib_Sys = global_data.Stdlib__Sys, + cst_Obj_Ephemeron_blit_key = "Obj.Ephemeron.blit_key", + cst_Obj_Ephemeron_check_key = "Obj.Ephemeron.check_key", + cst_Obj_Ephemeron_unset_key = "Obj.Ephemeron.unset_key", + cst_Obj_Ephemeron_set_key = "Obj.Ephemeron.set_key", + cst_Obj_Ephemeron_get_key_copy = "Obj.Ephemeron.get_key_copy", + cst_Obj_Ephemeron_get_key = "Obj.Ephemeron.get_key", + cst_Obj_Ephemeron_create = "Obj.Ephemeron.create", + cst_Obj_extension_constructor$0 = cst_Obj_extension_constructor$1, + cst_Obj_extension_constructor = cst_Obj_extension_constructor$1, + _a_ = [0, "obj.ml", 95, 4]; + function is_block(a){return 1 - (typeof a === "number" ? 1 : 0);} + var + double_field = runtime.caml_array_get, + set_double_field = runtime.caml_array_set, + first_non_constant_constructor = 0, + last_non_constant_constructor_ = 245, + lazy_tag = 246, + closure_tag = 247, + object_tag = 248, + infix_tag = 249, + forward_tag = 250, + no_scan_tag = 251, + abstract_tag = 251, + string_tag = 252, + double_tag = 253, + double_array_tag = 254, + custom_tag = 255, + int_tag = 1000, + out_of_heap_tag = 1001, + unaligned_tag = 1002; + function info(obj){ + if(caml_obj_tag(obj) !== 247) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + var + info = runtime.caml_obj_raw_field(obj, 1), + arity = 64 === Stdlib_Sys[9] ? info >> 56 : info >> 24, + start_env = info << 8 >>> 9 | 0; + return [0, arity, start_env]; + } + function of_val(x){ + var switch$0 = 0; + if(is_block(x) && caml_obj_tag(x) !== 248 && 1 <= x.length - 1){var slot = x[1]; switch$0 = 1;} + if(! switch$0) var slot = x; + var switch$1 = 0; + if(is_block(slot) && caml_obj_tag(slot) === 248){var name = slot[1]; switch$1 = 1;} + if(! switch$1) + var name = caml_call1(Stdlib[1], cst_Obj_extension_constructor$0); + return caml_obj_tag(name) === 252 + ? slot + : caml_call1(Stdlib[1], cst_Obj_extension_constructor); + } + function name(slot){return slot[1];} + function id(slot){return slot[2];} + var + Extension_constructor = [0, of_val, name, id], + extension_constructor = Extension_constructor[1], + extension_name = Extension_constructor[2], + extension_id = Extension_constructor[3], + max_ephe_length = Stdlib_Sys[13] - 2 | 0; + function create(l){ + var _g_ = 0 <= l ? 1 : 0, _h_ = _g_ ? l <= max_ephe_length ? 1 : 0 : _g_; + if(1 - _h_) caml_call1(Stdlib[1], cst_Obj_Ephemeron_create); + return runtime.caml_ephe_create(l); + } + function length(x){return x.length - 1 - 2 | 0;} + function raise_if_invalid_offset(e, o, msg){ + var + _d_ = 0 <= o ? 1 : 0, + _e_ = _d_ ? o < length(e) ? 1 : 0 : _d_, + _f_ = 1 - _e_; + return _f_ ? caml_call1(Stdlib[1], msg) : _f_; + } + function get_key(e, o){ + raise_if_invalid_offset(e, o, cst_Obj_Ephemeron_get_key); + return runtime.caml_ephe_get_key(e, o); + } + function get_key_copy(e, o){ + raise_if_invalid_offset(e, o, cst_Obj_Ephemeron_get_key_copy); + return runtime.caml_ephe_get_key_copy(e, o); + } + function set_key(e, o, x){ + raise_if_invalid_offset(e, o, cst_Obj_Ephemeron_set_key); + return runtime.caml_ephe_set_key(e, o, x); + } + function unset_key(e, o){ + raise_if_invalid_offset(e, o, cst_Obj_Ephemeron_unset_key); + return runtime.caml_ephe_unset_key(e, o); + } + function check_key(e, o){ + raise_if_invalid_offset(e, o, cst_Obj_Ephemeron_check_key); + return runtime.caml_ephe_check_key(e, o); + } + function blit_key(e1, o1, e2, o2, l){ + if + (0 <= l + && + 0 <= o1 + && (length(e1) - l | 0) >= o1 && 0 <= o2 && (length(e2) - l | 0) >= o2){ + var + _b_ = 0 !== l ? 1 : 0, + _c_ = _b_ ? runtime.caml_ephe_blit_key(e1, o1, e2, o2, l) : _b_; + return _c_; + } + return caml_call1(Stdlib[1], cst_Obj_Ephemeron_blit_key); + } + var + Stdlib_Obj = + [0, + is_block, + double_field, + set_double_field, + first_non_constant_constructor, + last_non_constant_constructor_, + lazy_tag, + closure_tag, + object_tag, + infix_tag, + forward_tag, + no_scan_tag, + abstract_tag, + string_tag, + double_tag, + double_array_tag, + custom_tag, + custom_tag, + int_tag, + out_of_heap_tag, + unaligned_tag, + [0, info], + Extension_constructor, + extension_constructor, + extension_name, + extension_id, + [0, + create, + length, + get_key, + get_key_copy, + set_key, + unset_key, + check_key, + blit_key, + runtime.caml_ephe_get_data, + runtime.caml_ephe_get_data_copy, + runtime.caml_ephe_set_data, + runtime.caml_ephe_unset_data, + runtime.caml_ephe_check_data, + runtime.caml_ephe_blit_data, + max_ephe_length]]; + runtime.caml_register_global(13, Stdlib_Obj, "Stdlib__Obj"); + return; + } + (globalThis)); + +//# 1299 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_obj_make_forward = runtime.caml_obj_make_forward, + caml_obj_tag = runtime.caml_obj_tag, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Obj = global_data.Stdlib__Obj, + Undefined = + [248, "CamlinternalLazy.Undefined", runtime.caml_fresh_oo_id(0)]; + function raise_undefined(param){ + throw caml_maybe_attach_backtrace(Undefined, 1); + } + function force_lazy_block(blk){ + var closure = blk[1]; + blk[1] = raise_undefined; + try{ + var result = caml_call1(closure, 0); + caml_obj_make_forward(blk, result); + return result; + } + catch(e$0){ + var e = caml_wrap_exception(e$0); + blk[1] = function(param){throw caml_maybe_attach_backtrace(e, 0);}; + throw caml_maybe_attach_backtrace(e, 0); + } + } + function force_val_lazy_block(blk){ + var closure = blk[1]; + blk[1] = raise_undefined; + var result = caml_call1(closure, 0); + caml_obj_make_forward(blk, result); + return result; + } + function force(lzv){ + var t = caml_obj_tag(lzv); + return t === Stdlib_Obj[10] + ? lzv[1] + : t !== Stdlib_Obj[6] ? lzv : force_lazy_block(lzv); + } + function force_val(lzv){ + var t = caml_obj_tag(lzv); + return t === Stdlib_Obj[10] + ? lzv[1] + : t !== Stdlib_Obj[6] ? lzv : force_val_lazy_block(lzv); + } + var + CamlinternalLazy = + [0, Undefined, force_lazy_block, force_val_lazy_block, force, force_val]; + runtime.caml_register_global(2, CamlinternalLazy, "CamlinternalLazy"); + return; + } + (globalThis)); + +//# 1364 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime, caml_obj_tag = runtime.caml_obj_tag; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + var + global_data = runtime.caml_get_global_data(), + CamlinternalLazy = global_data.CamlinternalLazy, + Stdlib_Obj = global_data.Stdlib__Obj, + Undefined = CamlinternalLazy[1], + force_val = CamlinternalLazy[5]; + function from_fun(f){ + var x = runtime.caml_obj_block(Stdlib_Obj[6], 1); + x[1] = f; + return x; + } + function from_val(v){ + var t = caml_obj_tag(v); + if(t !== Stdlib_Obj[10] && t !== Stdlib_Obj[6] && t !== Stdlib_Obj[14]) + return v; + return runtime.caml_lazy_make_forward(v); + } + function is_val(l){ + var _i_ = Stdlib_Obj[6]; + return caml_obj_tag(l) !== _i_ ? 1 : 0; + } + function map(f, x){ + return [246, + function(_f_){ + var + _g_ = caml_obj_tag(x), + _h_ = + 250 === _g_ + ? x[1] + : 246 === _g_ ? caml_call1(CamlinternalLazy[2], x) : x; + return caml_call1(f, _h_); + }]; + } + function map_val(f, x){ + if(! is_val(x)) + return [246, + function(_c_){ + var + _d_ = caml_obj_tag(x), + _e_ = + 250 === _d_ + ? x[1] + : 246 === _d_ ? caml_call1(CamlinternalLazy[2], x) : x; + return caml_call1(f, _e_); + }]; + var + _a_ = caml_obj_tag(x), + _b_ = + 250 === _a_ + ? x[1] + : 246 === _a_ ? caml_call1(CamlinternalLazy[2], x) : x; + return from_val(caml_call1(f, _b_)); + } + var + Stdlib_Lazy = + [0, + Undefined, + map, + is_val, + from_val, + map_val, + from_fun, + force_val, + from_fun, + from_val, + is_val]; + runtime.caml_register_global(2, Stdlib_Lazy, "Stdlib__Lazy"); + return; + } + (globalThis)); + +//# 1446 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + Assert_failure = global_data.Assert_failure, + CamlinternalAtomic = global_data.CamlinternalAtomic, + CamlinternalLazy = global_data.CamlinternalLazy, + Stdlib = global_data.Stdlib, + Stdlib_Lazy = global_data.Stdlib__Lazy, + _a_ = [0, "seq.ml", 596, 4], + cst_Seq_drop = "Seq.drop", + cst_Seq_take = "Seq.take", + cst_Seq_init = "Seq.init", + cst_Stdlib_Seq_Forced_twice = "Stdlib.Seq.Forced_twice"; + function empty(param){return 0;} + function return$0(x, param){return [0, x, empty];} + function cons(x, next, param){return [0, x, next];} + function append(seq1, seq2, param){ + var match = caml_call1(seq1, 0); + if(! match) return caml_call1(seq2, 0); + var next = match[2], x = match[1]; + return [0, x, function(_aM_){return append(next, seq2, _aM_);}]; + } + function map(f, seq, param){ + var match = caml_call1(seq, 0); + if(! match) return 0; + var next = match[2], x = match[1]; + function _aK_(_aL_){return map(f, next, _aL_);} + return [0, caml_call1(f, x), _aK_]; + } + function filter_map(f, seq, param){ + var seq$0 = seq; + for(;;){ + var match = caml_call1(seq$0, 0); + if(! match) return 0; + var next = match[2], x = match[1], match$0 = caml_call1(f, x); + if(match$0){ + var y = match$0[1]; + return [0, y, function(_aJ_){return filter_map(f, next, _aJ_);}]; + } + var seq$0 = next; + } + } + function filter(f, seq, param){ + var seq$0 = seq; + for(;;){ + var match = caml_call1(seq$0, 0); + if(! match) return 0; + var next = match[2], x = match[1]; + if(caml_call1(f, x)) + return [0, x, function(_aI_){return filter(f, next, _aI_);}]; + var seq$0 = next; + } + } + function concat(seq, param){ + var match = caml_call1(seq, 0); + if(! match) return 0; + var next = match[2], x = match[1], _aG_ = 0; + return append(x, function(_aH_){return concat(next, _aH_);}, _aG_); + } + function flat_map(f, seq, param){ + var match = caml_call1(seq, 0); + if(! match) return 0; + var next = match[2], x = match[1], _aD_ = 0; + function _aE_(_aF_){return flat_map(f, next, _aF_);} + return append(caml_call1(f, x), _aE_, _aD_); + } + function fold_left(f, acc, seq){ + var acc$0 = acc, seq$0 = seq; + for(;;){ + var match = caml_call1(seq$0, 0); + if(! match) return acc$0; + var + next = match[2], + x = match[1], + acc$1 = caml_call2(f, acc$0, x), + acc$0 = acc$1, + seq$0 = next; + } + } + function iter(f, seq){ + var seq$0 = seq; + for(;;){ + var match = caml_call1(seq$0, 0); + if(! match) return 0; + var next = match[2], x = match[1]; + caml_call1(f, x); + var seq$0 = next; + } + } + function unfold(f, u, param){ + var match = caml_call1(f, u); + if(! match) return 0; + var match$0 = match[1], u$0 = match$0[2], x = match$0[1]; + return [0, x, function(_aC_){return unfold(f, u$0, _aC_);}]; + } + function is_empty(xs){return caml_call1(xs, 0) ? 0 : 1;} + function uncons(xs){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1]; + return [0, [0, x, xs$0]]; + } + function length(xs$1){ + var accu = 0, xs = xs$1; + for(;;){ + var match = caml_call1(xs, 0); + if(! match) return accu; + var xs$0 = match[2], accu$0 = accu + 1 | 0, accu = accu$0, xs = xs$0; + } + } + function iteri(f, xs$1){ + var i = 0, xs = xs$1; + for(;;){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1]; + caml_call2(f, i, x); + var i$0 = i + 1 | 0, i = i$0, xs = xs$0; + } + } + function fold_lefti(f, accu$1, xs$1){ + var accu = accu$1, i = 0, xs = xs$1; + for(;;){ + var match = caml_call1(xs, 0); + if(! match) return accu; + var + xs$0 = match[2], + x = match[1], + accu$0 = caml_call3(f, accu, i, x), + i$0 = i + 1 | 0, + accu = accu$0, + i = i$0, + xs = xs$0; + } + } + function for_all(p, xs){ + var xs$0 = xs; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 1; + var xs$1 = match[2], x = match[1], _aB_ = caml_call1(p, x); + if(! _aB_) return _aB_; + var xs$0 = xs$1; + } + } + function exists(p, xs){ + var xs$0 = xs; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], x = match[1], _aA_ = caml_call1(p, x); + if(_aA_) return _aA_; + var xs$0 = xs$1; + } + } + function find(p, xs){ + var xs$0 = xs; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], x = match[1]; + if(caml_call1(p, x)) return [0, x]; + var xs$0 = xs$1; + } + } + function find_map(f, xs){ + var xs$0 = xs; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], x = match[1], result = caml_call1(f, x); + if(result) return result; + var xs$0 = xs$1; + } + } + function iter2(f, xs, ys){ + var xs$0 = xs, ys$0 = ys; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], x = match[1], match$0 = caml_call1(ys$0, 0); + if(! match$0) return 0; + var ys$1 = match$0[2], y = match$0[1]; + caml_call2(f, x, y); + var xs$0 = xs$1, ys$0 = ys$1; + } + } + function fold_left2(f, accu, xs, ys){ + var accu$0 = accu, xs$0 = xs, ys$0 = ys; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return accu$0; + var xs$1 = match[2], x = match[1], match$0 = caml_call1(ys$0, 0); + if(! match$0) return accu$0; + var + ys$1 = match$0[2], + y = match$0[1], + accu$1 = caml_call3(f, accu$0, x, y), + accu$0 = accu$1, + xs$0 = xs$1, + ys$0 = ys$1; + } + } + function for_all2(f, xs, ys){ + var xs$0 = xs, ys$0 = ys; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 1; + var xs$1 = match[2], x = match[1], match$0 = caml_call1(ys$0, 0); + if(! match$0) return 1; + var ys$1 = match$0[2], y = match$0[1], _az_ = caml_call2(f, x, y); + if(! _az_) return _az_; + var xs$0 = xs$1, ys$0 = ys$1; + } + } + function exists2(f, xs, ys){ + var xs$0 = xs, ys$0 = ys; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], x = match[1], match$0 = caml_call1(ys$0, 0); + if(! match$0) return 0; + var ys$1 = match$0[2], y = match$0[1], _ay_ = caml_call2(f, x, y); + if(_ay_) return _ay_; + var xs$0 = xs$1, ys$0 = ys$1; + } + } + function equal(eq, xs, ys){ + var xs$0 = xs, ys$0 = ys; + for(;;){ + var match = caml_call1(xs$0, 0), match$0 = caml_call1(ys$0, 0); + if(match){ + if(match$0){ + var + ys$1 = match$0[2], + y = match$0[1], + xs$1 = match[2], + x = match[1], + _ax_ = caml_call2(eq, x, y); + if(! _ax_) return _ax_; + var xs$0 = xs$1, ys$0 = ys$1; + continue; + } + } + else if(! match$0) return 1; + return 0; + } + } + function compare(cmp, xs, ys){ + var xs$0 = xs, ys$0 = ys; + for(;;){ + var match = caml_call1(xs$0, 0), match$0 = caml_call1(ys$0, 0); + if(! match) return match$0 ? -1 : 0; + var xs$1 = match[2], x = match[1]; + if(! match$0) return 1; + var ys$1 = match$0[2], y = match$0[1], c = caml_call2(cmp, x, y); + if(0 !== c) return c; + var xs$0 = xs$1, ys$0 = ys$1; + } + } + function init_aux(f, i, j, param){ + if(i >= j) return 0; + var _au_ = i + 1 | 0; + function _av_(_aw_){return init_aux(f, _au_, j, _aw_);} + return [0, caml_call1(f, i), _av_]; + } + function init(n, f){ + if(0 > n) return caml_call1(Stdlib[1], cst_Seq_init); + var _as_ = 0; + return function(_at_){return init_aux(f, _as_, n, _at_);}; + } + function repeat(x, param){ + return [0, x, function(_ar_){return repeat(x, _ar_);}]; + } + function forever(f, param){ + function _ap_(_aq_){return forever(f, _aq_);} + return [0, caml_call1(f, 0), _ap_]; + } + function cycle_nonempty(xs, param){ + var _an_ = 0; + return append(xs, function(_ao_){return cycle_nonempty(xs, _ao_);}, _an_); + } + function cycle(xs, param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1]; + function _ak_(_am_){return cycle_nonempty(xs, _am_);} + return [0, x, function(_al_){return append(xs$0, _ak_, _al_);}]; + } + function iterate1(f, x, param){ + var y = caml_call1(f, x); + return [0, y, function(_aj_){return iterate1(f, y, _aj_);}]; + } + function iterate(f, x){ + function _ag_(_ai_){return iterate1(f, x, _ai_);} + return function(_ah_){return [0, x, _ag_];}; + } + function mapi_aux(f, i, xs, param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1], _ad_ = i + 1 | 0; + function _ae_(_af_){return mapi_aux(f, _ad_, xs$0, _af_);} + return [0, caml_call2(f, i, x), _ae_]; + } + function mapi(f, xs){ + var _ab_ = 0; + return function(_ac_){return mapi_aux(f, _ab_, xs, _ac_);}; + } + function tail_scan(f, s, xs, param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1], s$0 = caml_call2(f, s, x); + return [0, s$0, function(_aa_){return tail_scan(f, s$0, xs$0, _aa_);}]; + } + function scan(f, s, xs){ + function _Z_(_$_){return tail_scan(f, s, xs, _$_);} + return function(___){return [0, s, _Z_];}; + } + function take_aux(n, xs){ + return 0 === n + ? empty + : function + (param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1]; + return [0, x, take_aux(n - 1 | 0, xs$0)]; + }; + } + function take(n, xs){ + if(n < 0) caml_call1(Stdlib[1], cst_Seq_take); + return take_aux(n, xs); + } + function drop(n, xs){ + return 0 <= n + ? 0 + === n + ? xs + : function + (param){ + var n$0 = n, xs$0 = xs; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], n$1 = n$0 - 1 | 0; + if(0 === n$1) return caml_call1(xs$1, 0); + var n$0 = n$1, xs$0 = xs$1; + } + } + : caml_call1(Stdlib[1], cst_Seq_drop); + } + function take_while(p, xs, param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1]; + return caml_call1(p, x) + ? [0, x, function(_Y_){return take_while(p, xs$0, _Y_);}] + : 0; + } + function drop_while(p, xs, param){ + var xs$0 = xs; + for(;;){ + var node = caml_call1(xs$0, 0); + if(! node) return 0; + var xs$1 = node[2], x = node[1]; + if(! caml_call1(p, x)) return node; + var xs$0 = xs$1; + } + } + function group(eq, xs, param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1], _P_ = caml_call1(eq, x); + function _Q_(_X_){return drop_while(_P_, xs$0, _X_);} + function _R_(_W_){return group(eq, _Q_, _W_);} + var _S_ = caml_call1(eq, x); + function _T_(_V_){return take_while(_S_, xs$0, _V_);} + return [0, function(_U_){return [0, x, _T_];}, _R_]; + } + var + Forced_twice = + [248, cst_Stdlib_Seq_Forced_twice, runtime.caml_fresh_oo_id(0)], + to_lazy = Stdlib_Lazy[6]; + function failure(param){ + throw caml_maybe_attach_backtrace(Forced_twice, 1); + } + function memoize(xs){ + function s$0(param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1]; + return [0, x, memoize(xs$0)]; + } + var s = caml_call1(to_lazy, s$0); + return function(_O_){ + var _N_ = runtime.caml_obj_tag(s); + return 250 === _N_ + ? s[1] + : 246 === _N_ ? caml_call1(CamlinternalLazy[2], s) : s;}; + } + function once(xs){ + function f(param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1]; + return [0, x, once(xs$0)]; + } + var action = caml_call1(CamlinternalAtomic[1], f); + return function(param){ + var f = caml_call2(CamlinternalAtomic[4], action, failure); + return caml_call1(f, 0);}; + } + function zip(xs, ys, param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0); + if(! match$0) return 0; + var ys$0 = match$0[2], y = match$0[1]; + return [0, [0, x, y], function(_M_){return zip(xs$0, ys$0, _M_);}]; + } + function map2(f, xs, ys, param){ + var match = caml_call1(xs, 0); + if(! match) return 0; + var xs$0 = match[2], x = match[1], match$0 = caml_call1(ys, 0); + if(! match$0) return 0; + var ys$0 = match$0[2], y = match$0[1]; + function _K_(_L_){return map2(f, xs$0, ys$0, _L_);} + return [0, caml_call2(f, x, y), _K_]; + } + function interleave(xs, ys, param){ + var match = caml_call1(xs, 0); + if(! match) return caml_call1(ys, 0); + var xs$0 = match[2], x = match[1]; + return [0, x, function(_J_){return interleave(ys, xs$0, _J_);}]; + } + function sorted_merge1(cmp, x, xs, y, ys){ + return 0 < caml_call2(cmp, x, y) + ? [0, + y, + function(_H_){ + var match = caml_call1(ys, 0); + if(! match) return [0, x, xs]; + var ys$0 = match[2], y = match[1]; + return sorted_merge1(cmp, x, xs, y, ys$0); + }] + : [0, + x, + function(_I_){ + var match = caml_call1(xs, 0); + if(! match) return [0, y, ys]; + var xs$0 = match[2], x = match[1]; + return sorted_merge1(cmp, x, xs$0, y, ys); + }]; + } + function sorted_merge(cmp, xs, ys, param){ + var match = caml_call1(xs, 0), match$0 = caml_call1(ys, 0); + if(match){ + if(match$0){ + var ys$0 = match$0[2], y = match$0[1], xs$0 = match[2], x = match[1]; + return sorted_merge1(cmp, x, xs$0, y, ys$0); + } + var c = match; + } + else{if(! match$0) return 0; var c = match$0;} + return c; + } + function map_fst(xys, param){ + var match = caml_call1(xys, 0); + if(! match) return 0; + var xys$0 = match[2], x = match[1][1]; + return [0, x, function(_G_){return map_fst(xys$0, _G_);}]; + } + function map_snd(xys, param){ + var match = caml_call1(xys, 0); + if(! match) return 0; + var xys$0 = match[2], y = match[1][2]; + return [0, y, function(_F_){return map_snd(xys$0, _F_);}]; + } + function unzip(xys){ + function _C_(_E_){return map_snd(xys, _E_);} + return [0, function(_D_){return map_fst(xys, _D_);}, _C_]; + } + function filter_map_find_left_map(f, xs, param){ + var xs$0 = xs; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], x = match[1], match$0 = caml_call1(f, x); + if(0 === match$0[0]){ + var y = match$0[1]; + return [0, + y, + function(_B_){return filter_map_find_left_map(f, xs$1, _B_);}]; + } + var xs$0 = xs$1; + } + } + function filter_map_find_right_map(f, xs, param){ + var xs$0 = xs; + for(;;){ + var match = caml_call1(xs$0, 0); + if(! match) return 0; + var xs$1 = match[2], x = match[1], match$0 = caml_call1(f, x); + if(0 === match$0[0]){var xs$0 = xs$1; continue;} + var z = match$0[1]; + return [0, + z, + function(_A_){return filter_map_find_right_map(f, xs$1, _A_);}]; + } + } + function partition_map(f, xs){ + function _x_(_z_){return filter_map_find_right_map(f, xs, _z_);} + return [0, + function(_y_){return filter_map_find_left_map(f, xs, _y_);}, + _x_]; + } + function partition(p, xs){ + function _t_(x){return 1 - caml_call1(p, x);} + function _u_(_w_){return filter(_t_, xs, _w_);} + return [0, function(_v_){return filter(p, xs, _v_);}, _u_]; + } + function peel(xss){ + return unzip(function(_s_){return filter_map(uncons, xss, _s_);}); + } + function transpose(xss, param){ + var match = peel(xss), tails = match[2], heads = match[1]; + if(! is_empty(heads)) + return [0, heads, function(_r_){return transpose(tails, _r_);}]; + if(is_empty(tails)) return 0; + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + } + function _b_(remainders, xss, param){ + var match = caml_call1(xss, 0); + if(! match) return transpose(remainders, 0); + var xss$0 = match[2], xs = match[1], match$0 = caml_call1(xs, 0); + if(match$0){ + var + xs$0 = match$0[2], + x = match$0[1], + match$1 = peel(remainders), + tails = match$1[2], + heads = match$1[1], + _l_ = function(_q_){return [0, xs$0, tails];}, + _m_ = function(_p_){return _b_(_l_, xss$0, _p_);}; + return [0, function(_o_){return [0, x, heads];}, _m_]; + } + var + match$2 = peel(remainders), + tails$0 = match$2[2], + heads$0 = match$2[1]; + return [0, heads$0, function(_n_){return _b_(tails$0, xss$0, _n_);}]; + } + function map_product(f, xs, ys){ + function _f_(x){ + function _j_(y){return caml_call2(f, x, y);} + return function(_k_){return map(_j_, ys, _k_);}; + } + function xss(_i_){return map(_f_, xs, _i_);} + function _e_(_h_){return _b_(empty, xss, _h_);} + return function(_g_){return concat(_e_, _g_);}; + } + function product(xs, ys){ + return map_product(function(x, y){return [0, x, y];}, xs, ys); + } + function of_dispenser(it){ + function c(param){ + var match = caml_call1(it, 0); + if(! match) return 0; + var x = match[1]; + return [0, x, c]; + } + return c; + } + function to_dispenser(xs){ + var s = [0, xs]; + return function(param){ + var match = caml_call1(s[1], 0); + if(! match) return 0; + var xs = match[2], x = match[1]; + s[1] = xs; + return [0, x];}; + } + function ints(i, param){ + var _c_ = i + 1 | 0; + return [0, i, function(_d_){return ints(_c_, _d_);}]; + } + var + Stdlib_Seq = + [0, + is_empty, + uncons, + length, + iter, + fold_left, + iteri, + fold_lefti, + for_all, + exists, + find, + find_map, + iter2, + fold_left2, + for_all2, + exists2, + equal, + compare, + empty, + return$0, + cons, + init, + unfold, + repeat, + forever, + cycle, + iterate, + map, + mapi, + filter, + filter_map, + scan, + take, + drop, + take_while, + drop_while, + group, + memoize, + Forced_twice, + once, + transpose, + append, + concat, + flat_map, + flat_map, + zip, + map2, + interleave, + sorted_merge, + product, + map_product, + unzip, + unzip, + partition_map, + partition, + of_dispenser, + to_dispenser, + ints]; + runtime.caml_register_global(10, Stdlib_Seq, "Stdlib__Seq"); + return; + } + (globalThis)); + +//# 2119 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib = global_data.Stdlib, + cst_option_is_None = "option is None", + none = 0; + function some(v){return [0, v];} + function value(o, default$0){ + if(! o) return default$0; + var v = o[1]; + return v; + } + function get(param){ + if(! param) return caml_call1(Stdlib[1], cst_option_is_None); + var v = param[1]; + return v; + } + function bind(o, f){ + if(! o) return 0; + var v = o[1]; + return caml_call1(f, v); + } + function join(param){if(! param) return 0; var o = param[1]; return o;} + function map(f, o){ + if(! o) return 0; + var v = o[1]; + return [0, caml_call1(f, v)]; + } + function fold(none, some, param){ + if(! param) return none; + var v = param[1]; + return caml_call1(some, v); + } + function iter(f, param){ + if(! param) return 0; + var v = param[1]; + return caml_call1(f, v); + } + function is_none(param){return param ? 0 : 1;} + function is_some(param){return param ? 1 : 0;} + function equal(eq, o0, o1){ + if(o0){ + if(o1){var v1 = o1[1], v0 = o0[1]; return caml_call2(eq, v0, v1);} + } + else if(! o1) return 1; + return 0; + } + function compare(cmp, o0, o1){ + if(! o0) return o1 ? -1 : 0; + var v0 = o0[1]; + if(! o1) return 1; + var v1 = o1[1]; + return caml_call2(cmp, v0, v1); + } + function to_result(none, param){ + if(! param) return [1, none]; + var v = param[1]; + return [0, v]; + } + function to_list(param){ + if(! param) return 0; + var v = param[1]; + return [0, v, 0]; + } + function to_seq(param){ + if(! param) return Stdlib_Seq[18]; + var v = param[1]; + return caml_call1(Stdlib_Seq[19], v); + } + var + Stdlib_Option = + [0, + none, + some, + value, + get, + bind, + join, + map, + fold, + iter, + is_none, + is_some, + equal, + compare, + to_result, + to_list, + to_seq]; + runtime.caml_register_global(3, Stdlib_Option, "Stdlib__Option"); + return; + } + (globalThis)); + +//# 2391 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, + caml_create_bytes = runtime.caml_create_bytes, + caml_string_of_bytes = runtime.caml_string_of_bytes; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + var + global_data = runtime.caml_get_global_data(), + cst = "\\\\", + cst$0 = "\\'", + Stdlib = global_data.Stdlib, + cst_b = "\\b", + cst_t = "\\t", + cst_n = "\\n", + cst_r = "\\r", + cst_Char_chr = "Char.chr"; + function chr(n){ + if(0 <= n && 255 >= n) return n; + return caml_call1(Stdlib[1], cst_Char_chr); + } + function escaped(c){ + var switch$0 = 0; + if(40 <= c){ + if(92 === c) return cst; + if(127 > c) switch$0 = 1; + } + else if(32 <= c){ + if(39 <= c) return cst$0; + switch$0 = 1; + } + else if(14 > c) + switch(c){ + case 8: + return cst_b; + case 9: + return cst_t; + case 10: + return cst_n; + case 13: + return cst_r; + } + if(switch$0){ + var s$0 = caml_create_bytes(1); + caml_bytes_unsafe_set(s$0, 0, c); + return caml_string_of_bytes(s$0); + } + var s = caml_create_bytes(4); + caml_bytes_unsafe_set(s, 0, 92); + caml_bytes_unsafe_set(s, 1, 48 + (c / 100 | 0) | 0); + caml_bytes_unsafe_set(s, 2, 48 + ((c / 10 | 0) % 10 | 0) | 0); + caml_bytes_unsafe_set(s, 3, 48 + (c % 10 | 0) | 0); + return caml_string_of_bytes(s); + } + function lowercase(c){ + var _b_ = c - 192 | 0, switch$0 = 0; + if(30 < _b_ >>> 0){ + if(25 >= _b_ + 127 >>> 0) switch$0 = 1; + } + else if(23 !== _b_) switch$0 = 1; + return switch$0 ? c + 32 | 0 : c; + } + function uppercase(c){ + var _a_ = c - 224 | 0, switch$0 = 0; + if(30 < _a_ >>> 0){ + if(25 >= _a_ + 127 >>> 0) switch$0 = 1; + } + else if(23 !== _a_) switch$0 = 1; + return switch$0 ? c - 32 | 0 : c; + } + function lowercase_ascii(c){return 25 < c - 65 >>> 0 ? c : c + 32 | 0;} + function uppercase_ascii(c){return 25 < c - 97 >>> 0 ? c : c - 32 | 0;} + function compare(c1, c2){return c1 - c2 | 0;} + function equal(c1, c2){return 0 === (c1 - c2 | 0) ? 1 : 0;} + var + Stdlib_Char = + [0, + chr, + escaped, + lowercase, + uppercase, + lowercase_ascii, + uppercase_ascii, + compare, + equal]; + runtime.caml_register_global(8, Stdlib_Char, "Stdlib__Char"); + return; + } + (globalThis)); + +//# 2489 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_uchar_ml = "uchar.ml", + caml_format_int = runtime.caml_format_int, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + err_no_pred = "U+0000 has no predecessor", + err_no_succ = "U+10FFFF has no successor", + Assert_failure = global_data.Assert_failure, + Stdlib = global_data.Stdlib, + _d_ = [0, cst_uchar_ml, 88, 18], + _c_ = [0, cst_uchar_ml, 91, 7], + _b_ = [0, cst_uchar_ml, 80, 18], + _a_ = [0, cst_uchar_ml, 85, 7], + cst_is_not_a_latin1_character = " is not a latin1 character", + cst_U = "U+", + cst_is_not_an_Unicode_scalar_v = " is not an Unicode scalar value", + min = 0, + max = 1114111, + lo_bound = 55295, + hi_bound = 57344, + bom = 65279, + rep = 65533; + function succ(u){ + return u === 55295 + ? hi_bound + : u === 1114111 ? caml_call1(Stdlib[1], err_no_succ) : u + 1 | 0; + } + function pred(u){ + return u === 57344 + ? lo_bound + : u === 0 ? caml_call1(Stdlib[1], err_no_pred) : u - 1 | 0; + } + function is_valid(i){ + var _o_ = 0 <= i ? 1 : 0, _p_ = _o_ ? i <= 55295 ? 1 : 0 : _o_; + if(_p_) + var _q_ = _p_; + else + var _r_ = 57344 <= i ? 1 : 0, _q_ = _r_ ? i <= 1114111 ? 1 : 0 : _r_; + return _q_; + } + function of_int(i){ + if(is_valid(i)) return i; + var + _n_ = + caml_call2 + (Stdlib[28], caml_format_int("%X", i), cst_is_not_an_Unicode_scalar_v); + return caml_call1(Stdlib[1], _n_); + } + function is_char(u){return u < 256 ? 1 : 0;} + function of_char(c){return c;} + function to_char(u){ + if(255 >= u) return u; + var + _l_ = + caml_call2 + (Stdlib[28], + caml_format_int("%04X", u), + cst_is_not_a_latin1_character), + _m_ = caml_call2(Stdlib[28], cst_U, _l_); + return caml_call1(Stdlib[1], _m_); + } + function unsafe_to_char(_k_){return _k_;} + function equal(_j_, _i_){return _j_ === _i_ ? 1 : 0;} + var compare = runtime.caml_int_compare; + function hash(_h_){return _h_;} + function utf_decode_is_valid(d){return 1 === (d >>> 27 | 0) ? 1 : 0;} + function utf_decode_length(d){return (d >>> 24 | 0) & 7;} + function utf_decode_uchar(d){return d & 16777215;} + function utf_decode(n, u){return (8 | n) << 24 | u;} + function utf_decode_invalid(n){return n << 24 | 65533;} + function utf_8_byte_length(u){ + if(0 > u) throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + if(127 >= u) return 1; + if(2047 >= u) return 2; + if(65535 >= u) return 3; + if(1114111 < u) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + return 4; + } + function utf_16_byte_length(u){ + if(0 > u) throw caml_maybe_attach_backtrace([0, Assert_failure, _d_], 1); + if(65535 >= u) return 2; + if(1114111 < u) + throw caml_maybe_attach_backtrace([0, Assert_failure, _c_], 1); + return 4; + } + function _e_(_g_){return _g_;} + var + Stdlib_Uchar = + [0, + min, + max, + bom, + rep, + succ, + pred, + is_valid, + of_int, + function(_f_){return _f_;}, + _e_, + is_char, + of_char, + to_char, + unsafe_to_char, + equal, + compare, + hash, + utf_decode_is_valid, + utf_decode_uchar, + utf_decode_length, + utf_decode, + utf_decode_invalid, + utf_8_byte_length, + utf_16_byte_length]; + runtime.caml_register_global(13, Stdlib_Uchar, "Stdlib__Uchar"); + return; + } + (globalThis)); + +//# 2625 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_List_nth$1 = "List.nth", + caml_compare = runtime.caml_compare, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib_Sys = global_data.Stdlib__Sys, + cst_List_map2 = "List.map2", + cst_List_iter2 = "List.iter2", + cst_List_fold_left2 = "List.fold_left2", + cst_List_fold_right2 = "List.fold_right2", + cst_List_for_all2 = "List.for_all2", + cst_List_exists2 = "List.exists2", + _b_ = [0, 0, 0], + cst_List_combine = "List.combine", + cst_List_rev_map2 = "List.rev_map2", + cst_List_init = "List.init", + cst_List_nth$0 = cst_List_nth$1, + cst_nth = "nth", + cst_List_nth = cst_List_nth$1, + cst_tl = "tl", + cst_hd = "hd"; + function length(l$0){ + var len = 0, param = l$0; + for(;;){ + if(! param) return len; + var l = param[2], len$0 = len + 1 | 0, len = len$0, param = l; + } + } + function cons(a, l){return [0, a, l];} + function hd(param){ + if(! param) return caml_call1(Stdlib[2], cst_hd); + var a = param[1]; + return a; + } + function tl(param){ + if(! param) return caml_call1(Stdlib[2], cst_tl); + var l = param[2]; + return l; + } + function nth(l, n){ + if(0 > n) return caml_call1(Stdlib[1], cst_List_nth); + var l$0 = l, n$0 = n; + for(;;){ + if(! l$0) return caml_call1(Stdlib[2], cst_nth); + var l$1 = l$0[2], a = l$0[1]; + if(0 === n$0) return a; + var n$1 = n$0 - 1 | 0, l$0 = l$1, n$0 = n$1; + } + } + function nth_opt(l, n){ + if(0 > n) return caml_call1(Stdlib[1], cst_List_nth$0); + var l$0 = l, n$0 = n; + for(;;){ + if(! l$0) return 0; + var l$1 = l$0[2], a = l$0[1]; + if(0 === n$0) return [0, a]; + var n$1 = n$0 - 1 | 0, l$0 = l$1, n$0 = n$1; + } + } + var append = Stdlib[37]; + function rev_append(l1, l2){ + var l1$0 = l1, l2$0 = l2; + for(;;){ + if(! l1$0) return l2$0; + var + l1$1 = l1$0[2], + a = l1$0[1], + l2$1 = [0, a, l2$0], + l1$0 = l1$1, + l2$0 = l2$1; + } + } + function rev(l){return rev_append(l, 0);} + function init_aux(i, n, f){ + if(n <= i) return 0; + var r = caml_call1(f, i); + return [0, r, init_aux(i + 1 | 0, n, f)]; + } + var rev_init_threshold = typeof Stdlib_Sys[5] === "number" ? 10000 : 50; + function init(len, f){ + if(0 > len) return caml_call1(Stdlib[1], cst_List_init); + if(rev_init_threshold >= len) return init_aux(0, len, f); + var acc = 0, i = 0; + for(;;){ + if(len <= i) return rev(acc); + var + i$0 = i + 1 | 0, + acc$0 = [0, caml_call1(f, i), acc], + acc = acc$0, + i = i$0; + } + } + function flatten(param){ + if(! param) return 0; + var r = param[2], l = param[1], _J_ = flatten(r); + return caml_call2(Stdlib[37], l, _J_); + } + function map(f, param){ + if(! param) return 0; + var l = param[2], a = param[1], r = caml_call1(f, a); + return [0, r, map(f, l)]; + } + function _a_(i, f, param){ + if(! param) return 0; + var l = param[2], a = param[1], r = caml_call2(f, i, a); + return [0, r, _a_(i + 1 | 0, f, l)]; + } + function mapi(f, l){return _a_(0, f, l);} + function rev_map(f, l){ + var accu = 0, param = l; + for(;;){ + if(! param) return accu; + var + l$0 = param[2], + a = param[1], + accu$0 = [0, caml_call1(f, a), accu], + accu = accu$0, + param = l$0; + } + } + function iter(f, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], a = param$0[1]; + caml_call1(f, a); + var param$0 = l; + } + } + function iteri(f, l$0){ + var i = 0, param = l$0; + for(;;){ + if(! param) return 0; + var l = param[2], a = param[1]; + caml_call2(f, i, a); + var i$0 = i + 1 | 0, i = i$0, param = l; + } + } + function fold_left(f, accu, l){ + var accu$0 = accu, l$0 = l; + for(;;){ + if(! l$0) return accu$0; + var + l$1 = l$0[2], + a = l$0[1], + accu$1 = caml_call2(f, accu$0, a), + accu$0 = accu$1, + l$0 = l$1; + } + } + function fold_right(f, l, accu){ + if(! l) return accu; + var l$0 = l[2], a = l[1]; + return caml_call2(f, a, fold_right(f, l$0, accu)); + } + function map2(f, l1, l2){ + if(l1){ + if(l2){ + var + l2$0 = l2[2], + a2 = l2[1], + l1$0 = l1[2], + a1 = l1[1], + r = caml_call2(f, a1, a2); + return [0, r, map2(f, l1$0, l2$0)]; + } + } + else if(! l2) return 0; + return caml_call1(Stdlib[1], cst_List_map2); + } + function rev_map2(f, l1, l2){ + var accu = 0, l1$0 = l1, l2$0 = l2; + for(;;){ + if(l1$0){ + if(l2$0){ + var + l2$1 = l2$0[2], + a2 = l2$0[1], + l1$1 = l1$0[2], + a1 = l1$0[1], + accu$0 = [0, caml_call2(f, a1, a2), accu], + accu = accu$0, + l1$0 = l1$1, + l2$0 = l2$1; + continue; + } + } + else if(! l2$0) return accu; + return caml_call1(Stdlib[1], cst_List_rev_map2); + } + } + function iter2(f, l1, l2){ + var l1$0 = l1, l2$0 = l2; + for(;;){ + if(l1$0){ + if(l2$0){ + var l2$1 = l2$0[2], a2 = l2$0[1], l1$1 = l1$0[2], a1 = l1$0[1]; + caml_call2(f, a1, a2); + var l1$0 = l1$1, l2$0 = l2$1; + continue; + } + } + else if(! l2$0) return 0; + return caml_call1(Stdlib[1], cst_List_iter2); + } + } + function fold_left2(f, accu, l1, l2){ + var accu$0 = accu, l1$0 = l1, l2$0 = l2; + for(;;){ + if(l1$0){ + if(l2$0){ + var + l2$1 = l2$0[2], + a2 = l2$0[1], + l1$1 = l1$0[2], + a1 = l1$0[1], + accu$1 = caml_call3(f, accu$0, a1, a2), + accu$0 = accu$1, + l1$0 = l1$1, + l2$0 = l2$1; + continue; + } + } + else if(! l2$0) return accu$0; + return caml_call1(Stdlib[1], cst_List_fold_left2); + } + } + function fold_right2(f, l1, l2, accu){ + if(l1){ + if(l2){ + var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1]; + return caml_call3(f, a1, a2, fold_right2(f, l1$0, l2$0, accu)); + } + } + else if(! l2) return accu; + return caml_call1(Stdlib[1], cst_List_fold_right2); + } + function for_all(p, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 1; + var l = param$0[2], a = param$0[1], _I_ = caml_call1(p, a); + if(! _I_) return _I_; + var param$0 = l; + } + } + function exists(p, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], a = param$0[1], _H_ = caml_call1(p, a); + if(_H_) return _H_; + var param$0 = l; + } + } + function for_all2(p, l1, l2){ + var l1$0 = l1, l2$0 = l2; + for(;;){ + if(l1$0){ + if(l2$0){ + var + l2$1 = l2$0[2], + a2 = l2$0[1], + l1$1 = l1$0[2], + a1 = l1$0[1], + _G_ = caml_call2(p, a1, a2); + if(! _G_) return _G_; + var l1$0 = l1$1, l2$0 = l2$1; + continue; + } + } + else if(! l2$0) return 1; + return caml_call1(Stdlib[1], cst_List_for_all2); + } + } + function exists2(p, l1, l2){ + var l1$0 = l1, l2$0 = l2; + for(;;){ + if(l1$0){ + if(l2$0){ + var + l2$1 = l2$0[2], + a2 = l2$0[1], + l1$1 = l1$0[2], + a1 = l1$0[1], + _F_ = caml_call2(p, a1, a2); + if(_F_) return _F_; + var l1$0 = l1$1, l2$0 = l2$1; + continue; + } + } + else if(! l2$0) return 0; + return caml_call1(Stdlib[1], cst_List_exists2); + } + } + function mem(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var + l = param$0[2], + a = param$0[1], + _E_ = 0 === caml_compare(a, x) ? 1 : 0; + if(_E_) return _E_; + var param$0 = l; + } + } + function memq(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], a = param$0[1], _D_ = a === x ? 1 : 0; + if(_D_) return _D_; + var param$0 = l; + } + } + function assoc(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; + if(0 === caml_compare(a, x)) return b; + var param$0 = l; + } + } + function assoc_opt(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; + if(0 === caml_compare(a, x)) return [0, b]; + var param$0 = l; + } + } + function assq(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; + if(a === x) return b; + var param$0 = l; + } + } + function assq_opt(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], match = param$0[1], b = match[2], a = match[1]; + if(a === x) return [0, b]; + var param$0 = l; + } + } + function mem_assoc(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var + l = param$0[2], + a = param$0[1][1], + _C_ = 0 === caml_compare(a, x) ? 1 : 0; + if(_C_) return _C_; + var param$0 = l; + } + } + function mem_assq(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], a = param$0[1][1], _B_ = a === x ? 1 : 0; + if(_B_) return _B_; + var param$0 = l; + } + } + function remove_assoc(x, param){ + if(! param) return 0; + var l = param[2], pair = param[1], a = pair[1]; + return 0 === caml_compare(a, x) ? l : [0, pair, remove_assoc(x, l)]; + } + function remove_assq(x, param){ + if(! param) return 0; + var l = param[2], pair = param[1], a = pair[1]; + return a === x ? l : [0, pair, remove_assq(x, l)]; + } + function find(p, param){ + var param$0 = param; + for(;;){ + if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var l = param$0[2], x = param$0[1]; + if(caml_call1(p, x)) return x; + var param$0 = l; + } + } + function find_opt(p, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], x = param$0[1]; + if(caml_call1(p, x)) return [0, x]; + var param$0 = l; + } + } + function find_map(f, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], x = param$0[1], result = caml_call1(f, x); + if(result) return result; + var param$0 = l; + } + } + function find_all(p){ + var accu = 0; + return function(param$0){ + var accu$0 = accu, param = param$0; + for(;;){ + if(! param) return rev(accu$0); + var l = param[2], x = param[1]; + if(caml_call1(p, x)){ + var accu$1 = [0, x, accu$0], accu$0 = accu$1, param = l; + continue; + } + var param = l; + }}; + } + function filteri(p, l){ + var i = 0, acc = 0, param = l; + for(;;){ + if(! param) return rev(acc); + var + l$0 = param[2], + x = param[1], + acc$0 = caml_call2(p, i, x) ? [0, x, acc] : acc, + i$0 = i + 1 | 0, + i = i$0, + acc = acc$0, + param = l$0; + } + } + function filter_map(f){ + var accu = 0; + return function(param$0){ + var accu$0 = accu, param = param$0; + for(;;){ + if(! param) return rev(accu$0); + var l = param[2], x = param[1], match = caml_call1(f, x); + if(match){ + var v = match[1], accu$1 = [0, v, accu$0], accu$0 = accu$1, param = l; + continue; + } + var param = l; + }}; + } + function concat_map(f, l){ + var acc = 0, param = l; + for(;;){ + if(! param) return rev(acc); + var + l$0 = param[2], + x = param[1], + xs = caml_call1(f, x), + acc$0 = rev_append(xs, acc), + acc = acc$0, + param = l$0; + } + } + function fold_left_map(f, accu, l){ + var accu$0 = accu, l_accu = 0, param = l; + for(;;){ + if(! param) return [0, accu$0, rev(l_accu)]; + var + l$0 = param[2], + x = param[1], + match = caml_call2(f, accu$0, x), + x$0 = match[2], + accu$1 = match[1], + l_accu$0 = [0, x$0, l_accu], + accu$0 = accu$1, + l_accu = l_accu$0, + param = l$0; + } + } + function partition(p, l){ + var yes = 0, no = 0, param = l; + for(;;){ + if(! param){var _A_ = rev(no); return [0, rev(yes), _A_];} + var l$0 = param[2], x = param[1]; + if(caml_call1(p, x)){ + var yes$0 = [0, x, yes], yes = yes$0, param = l$0; + continue; + } + var no$0 = [0, x, no], no = no$0, param = l$0; + } + } + function partition_map(p, l){ + var left = 0, right = 0, param = l; + for(;;){ + if(! param){var _z_ = rev(right); return [0, rev(left), _z_];} + var l$0 = param[2], x = param[1], match = caml_call1(p, x); + if(0 === match[0]){ + var v = match[1], left$0 = [0, v, left], left = left$0, param = l$0; + continue; + } + var + v$0 = match[1], + right$0 = [0, v$0, right], + right = right$0, + param = l$0; + } + } + function split(param){ + if(! param) return _b_; + var + l = param[2], + match = param[1], + y = match[2], + x = match[1], + match$0 = split(l), + ry = match$0[2], + rx = match$0[1]; + return [0, [0, x, rx], [0, y, ry]]; + } + function combine(l1, l2){ + if(l1){ + if(l2){ + var l2$0 = l2[2], a2 = l2[1], l1$0 = l1[2], a1 = l1[1]; + return [0, [0, a1, a2], combine(l1$0, l2$0)]; + } + } + else if(! l2) return 0; + return caml_call1(Stdlib[1], cst_List_combine); + } + function merge(cmp, l1, l2){ + if(! l1) return l2; + if(! l2) return l1; + var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; + return 0 < caml_call2(cmp, h1, h2) + ? [0, h2, merge(cmp, l1, t2)] + : [0, h1, merge(cmp, t1, l2)]; + } + function stable_sort(cmp, l){ + function sort(n, l){ + if(2 === n){ + if(l){ + var match = l[2]; + if(match){ + var + tl = match[2], + x2 = match[1], + x1 = l[1], + s = + 0 < caml_call2(cmp, x1, x2) + ? [0, x2, [0, x1, 0]] + : [0, x1, [0, x2, 0]]; + return [0, s, tl]; + } + } + } + else if(3 === n && l){ + var _y_ = l[2]; + if(_y_){ + var match$2 = _y_[2]; + if(match$2){ + var + tl$1 = match$2[2], + x3 = match$2[1], + x2$0 = _y_[1], + x1$0 = l[1], + s$0 = + 0 < caml_call2(cmp, x1$0, x2$0) + ? 0 + < caml_call2(cmp, x1$0, x3) + ? 0 + < caml_call2(cmp, x2$0, x3) + ? [0, x3, [0, x2$0, [0, x1$0, 0]]] + : [0, x2$0, [0, x3, [0, x1$0, 0]]] + : [0, x2$0, [0, x1$0, [0, x3, 0]]] + : 0 + < caml_call2(cmp, x2$0, x3) + ? 0 + < caml_call2(cmp, x1$0, x3) + ? [0, x3, [0, x1$0, [0, x2$0, 0]]] + : [0, x1$0, [0, x3, [0, x2$0, 0]]] + : [0, x1$0, [0, x2$0, [0, x3, 0]]]; + return [0, s$0, tl$1]; + } + } + } + var + n1 = n >> 1, + n2 = n - n1 | 0, + match$0 = rev_sort(n1, l), + l2$0 = match$0[2], + s1 = match$0[1], + match$1 = rev_sort(n2, l2$0), + tl$0 = match$1[2], + s2 = match$1[1], + l1 = s1, + l2 = s2, + accu = 0; + for(;;){ + if(l1){ + if(l2){ + var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; + if(0 < caml_call2(cmp, h1, h2)){ + var accu$0 = [0, h1, accu], l1 = t1, accu = accu$0; + continue; + } + var accu$1 = [0, h2, accu], l2 = t2, accu = accu$1; + continue; + } + var _x_ = rev_append(l1, accu); + } + else + var _x_ = rev_append(l2, accu); + return [0, _x_, tl$0]; + } + } + function rev_sort(n, l){ + if(2 === n){ + if(l){ + var match = l[2]; + if(match){ + var + tl = match[2], + x2 = match[1], + x1 = l[1], + s = + 0 < caml_call2(cmp, x1, x2) + ? [0, x1, [0, x2, 0]] + : [0, x2, [0, x1, 0]]; + return [0, s, tl]; + } + } + } + else if(3 === n && l){ + var _w_ = l[2]; + if(_w_){ + var match$2 = _w_[2]; + if(match$2){ + var + tl$1 = match$2[2], + x3 = match$2[1], + x2$0 = _w_[1], + x1$0 = l[1], + s$0 = + 0 < caml_call2(cmp, x1$0, x2$0) + ? 0 + < caml_call2(cmp, x2$0, x3) + ? [0, x1$0, [0, x2$0, [0, x3, 0]]] + : 0 + < caml_call2(cmp, x1$0, x3) + ? [0, x1$0, [0, x3, [0, x2$0, 0]]] + : [0, x3, [0, x1$0, [0, x2$0, 0]]] + : 0 + < caml_call2(cmp, x1$0, x3) + ? [0, x2$0, [0, x1$0, [0, x3, 0]]] + : 0 + < caml_call2(cmp, x2$0, x3) + ? [0, x2$0, [0, x3, [0, x1$0, 0]]] + : [0, x3, [0, x2$0, [0, x1$0, 0]]]; + return [0, s$0, tl$1]; + } + } + } + var + n1 = n >> 1, + n2 = n - n1 | 0, + match$0 = sort(n1, l), + l2$0 = match$0[2], + s1 = match$0[1], + match$1 = sort(n2, l2$0), + tl$0 = match$1[2], + s2 = match$1[1], + l1 = s1, + l2 = s2, + accu = 0; + for(;;){ + if(l1){ + if(l2){ + var t2 = l2[2], h2 = l2[1], t1 = l1[2], h1 = l1[1]; + if(0 < caml_call2(cmp, h1, h2)){ + var accu$0 = [0, h2, accu], l2 = t2, accu = accu$0; + continue; + } + var accu$1 = [0, h1, accu], l1 = t1, accu = accu$1; + continue; + } + var _v_ = rev_append(l1, accu); + } + else + var _v_ = rev_append(l2, accu); + return [0, _v_, tl$0]; + } + } + var len = length(l); + return 2 <= len ? sort(len, l)[1] : l; + } + function sort_uniq(cmp, l){ + function sort(n, l){ + if(2 === n){ + if(l){ + var match = l[2]; + if(match){ + var + tl = match[2], + x2 = match[1], + x1 = l[1], + c$0 = caml_call2(cmp, x1, x2), + s = + 0 === c$0 + ? [0, x1, 0] + : 0 <= c$0 ? [0, x2, [0, x1, 0]] : [0, x1, [0, x2, 0]]; + return [0, s, tl]; + } + } + } + else if(3 === n && l){ + var _p_ = l[2]; + if(_p_){ + var match$2 = _p_[2]; + if(match$2){ + var + tl$1 = match$2[2], + x3 = match$2[1], + x2$0 = _p_[1], + x1$0 = l[1], + c$1 = caml_call2(cmp, x1$0, x2$0); + if(0 === c$1) + var + c$2 = caml_call2(cmp, x2$0, x3), + _q_ = + 0 === c$2 + ? [0, x2$0, 0] + : 0 <= c$2 ? [0, x3, [0, x2$0, 0]] : [0, x2$0, [0, x3, 0]], + s$0 = _q_; + else if(0 <= c$1){ + var c$3 = caml_call2(cmp, x1$0, x3); + if(0 === c$3) + var _r_ = [0, x2$0, [0, x1$0, 0]]; + else if(0 <= c$3) + var + c$4 = caml_call2(cmp, x2$0, x3), + _s_ = + 0 === c$4 + ? [0, x2$0, [0, x1$0, 0]] + : 0 + <= c$4 + ? [0, x3, [0, x2$0, [0, x1$0, 0]]] + : [0, x2$0, [0, x3, [0, x1$0, 0]]], + _r_ = _s_; + else + var _r_ = [0, x2$0, [0, x1$0, [0, x3, 0]]]; + var s$0 = _r_; + } + else{ + var c$5 = caml_call2(cmp, x2$0, x3); + if(0 === c$5) + var _t_ = [0, x1$0, [0, x2$0, 0]]; + else if(0 <= c$5) + var + c$6 = caml_call2(cmp, x1$0, x3), + _u_ = + 0 === c$6 + ? [0, x1$0, [0, x2$0, 0]] + : 0 + <= c$6 + ? [0, x3, [0, x1$0, [0, x2$0, 0]]] + : [0, x1$0, [0, x3, [0, x2$0, 0]]], + _t_ = _u_; + else + var _t_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; + var s$0 = _t_; + } + return [0, s$0, tl$1]; + } + } + } + var + n1 = n >> 1, + n2 = n - n1 | 0, + match$0 = rev_sort(n1, l), + l2$0 = match$0[2], + s1 = match$0[1], + match$1 = rev_sort(n2, l2$0), + tl$0 = match$1[2], + s2 = match$1[1], + l1 = s1, + l2 = s2, + accu = 0; + for(;;){ + if(l1){ + if(l2){ + var + t2 = l2[2], + h2 = l2[1], + t1 = l1[2], + h1 = l1[1], + c = caml_call2(cmp, h1, h2); + if(0 === c){ + var accu$0 = [0, h1, accu], l1 = t1, l2 = t2, accu = accu$0; + continue; + } + if(0 < c){ + var accu$1 = [0, h1, accu], l1 = t1, accu = accu$1; + continue; + } + var accu$2 = [0, h2, accu], l2 = t2, accu = accu$2; + continue; + } + var _o_ = rev_append(l1, accu); + } + else + var _o_ = rev_append(l2, accu); + return [0, _o_, tl$0]; + } + } + function rev_sort(n, l){ + if(2 === n){ + if(l){ + var match = l[2]; + if(match){ + var + tl = match[2], + x2 = match[1], + x1 = l[1], + c$0 = caml_call2(cmp, x1, x2), + s = + 0 === c$0 + ? [0, x1, 0] + : 0 < c$0 ? [0, x1, [0, x2, 0]] : [0, x2, [0, x1, 0]]; + return [0, s, tl]; + } + } + } + else if(3 === n && l){ + var _i_ = l[2]; + if(_i_){ + var match$2 = _i_[2]; + if(match$2){ + var + tl$1 = match$2[2], + x3 = match$2[1], + x2$0 = _i_[1], + x1$0 = l[1], + c$1 = caml_call2(cmp, x1$0, x2$0); + if(0 === c$1) + var + c$2 = caml_call2(cmp, x2$0, x3), + _j_ = + 0 === c$2 + ? [0, x2$0, 0] + : 0 < c$2 ? [0, x2$0, [0, x3, 0]] : [0, x3, [0, x2$0, 0]], + s$0 = _j_; + else if(0 < c$1){ + var c$3 = caml_call2(cmp, x2$0, x3); + if(0 === c$3) + var _k_ = [0, x1$0, [0, x2$0, 0]]; + else if(0 < c$3) + var _k_ = [0, x1$0, [0, x2$0, [0, x3, 0]]]; + else + var + c$4 = caml_call2(cmp, x1$0, x3), + _l_ = + 0 === c$4 + ? [0, x1$0, [0, x2$0, 0]] + : 0 + < c$4 + ? [0, x1$0, [0, x3, [0, x2$0, 0]]] + : [0, x3, [0, x1$0, [0, x2$0, 0]]], + _k_ = _l_; + var s$0 = _k_; + } + else{ + var c$5 = caml_call2(cmp, x1$0, x3); + if(0 === c$5) + var _m_ = [0, x2$0, [0, x1$0, 0]]; + else if(0 < c$5) + var _m_ = [0, x2$0, [0, x1$0, [0, x3, 0]]]; + else + var + c$6 = caml_call2(cmp, x2$0, x3), + _n_ = + 0 === c$6 + ? [0, x2$0, [0, x1$0, 0]] + : 0 + < c$6 + ? [0, x2$0, [0, x3, [0, x1$0, 0]]] + : [0, x3, [0, x2$0, [0, x1$0, 0]]], + _m_ = _n_; + var s$0 = _m_; + } + return [0, s$0, tl$1]; + } + } + } + var + n1 = n >> 1, + n2 = n - n1 | 0, + match$0 = sort(n1, l), + l2$0 = match$0[2], + s1 = match$0[1], + match$1 = sort(n2, l2$0), + tl$0 = match$1[2], + s2 = match$1[1], + l1 = s1, + l2 = s2, + accu = 0; + for(;;){ + if(l1){ + if(l2){ + var + t2 = l2[2], + h2 = l2[1], + t1 = l1[2], + h1 = l1[1], + c = caml_call2(cmp, h1, h2); + if(0 === c){ + var accu$0 = [0, h1, accu], l1 = t1, l2 = t2, accu = accu$0; + continue; + } + if(0 <= c){ + var accu$1 = [0, h2, accu], l2 = t2, accu = accu$1; + continue; + } + var accu$2 = [0, h1, accu], l1 = t1, accu = accu$2; + continue; + } + var _h_ = rev_append(l1, accu); + } + else + var _h_ = rev_append(l2, accu); + return [0, _h_, tl$0]; + } + } + var len = length(l); + return 2 <= len ? sort(len, l)[1] : l; + } + function compare_lengths(l1, l2){ + var l1$0 = l1, l2$0 = l2; + for(;;){ + if(! l1$0) return l2$0 ? -1 : 0; + if(! l2$0) return 1; + var l2$1 = l2$0[2], l1$1 = l1$0[2], l1$0 = l1$1, l2$0 = l2$1; + } + } + function compare_length_with(l, n){ + var l$0 = l, n$0 = n; + for(;;){ + if(! l$0) return 0 === n$0 ? 0 : 0 < n$0 ? -1 : 1; + var l$1 = l$0[2]; + if(0 >= n$0) return 1; + var n$1 = n$0 - 1 | 0, l$0 = l$1, n$0 = n$1; + } + } + function equal(eq, l1, l2){ + var l1$0 = l1, l2$0 = l2; + for(;;){ + if(l1$0){ + if(l2$0){ + var + l2$1 = l2$0[2], + a2 = l2$0[1], + l1$1 = l1$0[2], + a1 = l1$0[1], + _g_ = caml_call2(eq, a1, a2); + if(! _g_) return _g_; + var l1$0 = l1$1, l2$0 = l2$1; + continue; + } + } + else if(! l2$0) return 1; + return 0; + } + } + function compare(cmp, l1, l2){ + var l1$0 = l1, l2$0 = l2; + for(;;){ + if(! l1$0) return l2$0 ? -1 : 0; + var l1$1 = l1$0[2], a1 = l1$0[1]; + if(! l2$0) return 1; + var l2$1 = l2$0[2], a2 = l2$0[1], c = caml_call2(cmp, a1, a2); + if(0 !== c) return c; + var l1$0 = l1$1, l2$0 = l2$1; + } + } + function to_seq(l){ + function aux(l, param){ + if(! l) return 0; + var tail = l[2], x = l[1]; + return [0, x, function(_f_){return aux(tail, _f_);}]; + } + return function(_e_){return aux(l, _e_);}; + } + function of_seq(seq){ + function direct(depth, seq){ + if(0 === depth){ + var _c_ = 0, _d_ = function(acc, x){return [0, x, acc];}; + return rev(caml_call3(Stdlib_Seq[5], _d_, _c_, seq)); + } + var match = caml_call1(seq, 0); + if(! match) return 0; + var next = match[2], x = match[1]; + return [0, x, direct(depth - 1 | 0, next)]; + } + return direct(500, seq); + } + var + Stdlib_List = + [0, + length, + compare_lengths, + compare_length_with, + cons, + hd, + tl, + nth, + nth_opt, + rev, + init, + append, + rev_append, + flatten, + flatten, + equal, + compare, + iter, + iteri, + map, + mapi, + rev_map, + filter_map, + concat_map, + fold_left_map, + fold_left, + fold_right, + iter2, + map2, + rev_map2, + fold_left2, + fold_right2, + for_all, + exists, + for_all2, + exists2, + mem, + memq, + find, + find_opt, + find_map, + find_all, + find_all, + filteri, + partition, + partition_map, + assoc, + assoc_opt, + assq, + assq_opt, + mem_assoc, + mem_assq, + remove_assoc, + remove_assq, + split, + combine, + stable_sort, + stable_sort, + stable_sort, + sort_uniq, + merge, + to_seq, + of_seq]; + runtime.caml_register_global(18, Stdlib_List, "Stdlib__List"); + return; + } + (globalThis)); + +//# 3724 "../.js/default/stdlib/stdlib.cma.js" +(function(globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime, zero = 0, one = 1, minus_one = -1; + function abs(x){return 0 <= x ? x : - x | 0;} + var max_int = 2147483647, min_int = -2147483648; + function lognot(x){return x ^ -1;} + function equal(_b_, _a_){return _b_ === _a_ ? 1 : 0;} + var compare = runtime.caml_int_compare; + function min(x, y){return x <= y ? x : y;} + function max(x, y){return y <= x ? x : y;} + function to_string(x){return "" + x;} + var + Stdlib_Int = + [0, + zero, + one, + minus_one, + abs, + max_int, + min_int, + lognot, + equal, + compare, + min, + max, + to_string]; + runtime.caml_register_global(1, Stdlib_Int, "Stdlib__Int"); + return; + } + (globalThis)); + +//# 3757 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_bytes_ml = "bytes.ml", + cst_index_out_of_bounds$3 = "index out of bounds", + caml_blit_bytes = runtime.caml_blit_bytes, + caml_bswap16 = runtime.caml_bswap16, + caml_bytes_get = runtime.caml_bytes_get, + caml_bytes_get16 = runtime.caml_bytes_get16, + caml_bytes_get32 = runtime.caml_bytes_get32, + caml_bytes_get64 = runtime.caml_bytes_get64, + caml_bytes_of_string = runtime.caml_bytes_of_string, + caml_bytes_set = runtime.caml_bytes_set, + caml_bytes_set16 = runtime.caml_bytes_set16, + caml_bytes_set32 = runtime.caml_bytes_set32, + caml_bytes_set64 = runtime.caml_bytes_set64, + caml_bytes_unsafe_get = runtime.caml_bytes_unsafe_get, + caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, + caml_create_bytes = runtime.caml_create_bytes, + caml_fill_bytes = runtime.caml_fill_bytes, + caml_int32_bswap = runtime.caml_int32_bswap, + caml_int64_bswap = runtime.caml_int64_bswap, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_bytes_length = runtime.caml_ml_bytes_length, + caml_string_of_bytes = runtime.caml_string_of_bytes, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Uchar = global_data.Stdlib__Uchar, + Assert_failure = global_data.Assert_failure, + Stdlib_Sys = global_data.Stdlib__Sys, + Stdlib_Int = global_data.Stdlib__Int, + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib_Char = global_data.Stdlib__Char, + cst_index_out_of_bounds$2 = cst_index_out_of_bounds$3, + _f_ = [0, cst_bytes_ml, 808, 20], + _e_ = [0, cst_bytes_ml, 819, 9], + cst_index_out_of_bounds$1 = cst_index_out_of_bounds$3, + cst_index_out_of_bounds$0 = cst_index_out_of_bounds$3, + _d_ = [0, cst_bytes_ml, 754, 20], + _c_ = [0, cst_bytes_ml, 765, 9], + cst_index_out_of_bounds = cst_index_out_of_bounds$3, + _b_ = [0, cst_bytes_ml, 642, 20], + _a_ = [0, cst_bytes_ml, 667, 9], + cst_Bytes_of_seq_cannot_grow_b = "Bytes.of_seq: cannot grow bytes", + cst_String_rcontains_from_Byte = + "String.rcontains_from / Bytes.rcontains_from", + cst_String_contains_from_Bytes = + "String.contains_from / Bytes.contains_from", + cst_String_rindex_from_opt_Byt = + "String.rindex_from_opt / Bytes.rindex_from_opt", + cst_String_rindex_from_Bytes_r = "String.rindex_from / Bytes.rindex_from", + cst_String_index_from_opt_Byte = + "String.index_from_opt / Bytes.index_from_opt", + cst_String_index_from_Bytes_in = "String.index_from / Bytes.index_from", + cst_Bytes_concat = "Bytes.concat", + cst_String_blit_Bytes_blit_str = "String.blit / Bytes.blit_string", + cst_Bytes_blit = "Bytes.blit", + cst_String_fill_Bytes_fill = "String.fill / Bytes.fill", + cst_Bytes_extend = "Bytes.extend", + cst_String_sub_Bytes_sub = "String.sub / Bytes.sub"; + function make(n, c){ + var s = caml_create_bytes(n); + caml_fill_bytes(s, 0, n, c); + return s; + } + function init(n, f){ + var s = caml_create_bytes(n), _aq_ = n - 1 | 0, _ap_ = 0; + if(_aq_ >= 0){ + var i = _ap_; + for(;;){ + caml_bytes_unsafe_set(s, i, caml_call1(f, i)); + var _ar_ = i + 1 | 0; + if(_aq_ !== i){var i = _ar_; continue;} + break; + } + } + return s; + } + var empty = caml_create_bytes(0); + function copy(s){ + var len = caml_ml_bytes_length(s), r = caml_create_bytes(len); + caml_blit_bytes(s, 0, r, 0, len); + return r; + } + function to_string(b){return caml_string_of_bytes(copy(b));} + function of_string(s){return copy(caml_bytes_of_string(s));} + function sub(s, ofs, len){ + if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs){ + var r = caml_create_bytes(len); + caml_blit_bytes(s, ofs, r, 0, len); + return r; + } + return caml_call1(Stdlib[1], cst_String_sub_Bytes_sub); + } + function sub_string(b, ofs, len){ + return caml_string_of_bytes(sub(b, ofs, len)); + } + function symbol(a, b){ + var + c = a + b | 0, + _ao_ = b < 0 ? 1 : 0, + match = c < 0 ? 1 : 0, + switch$0 = 0; + if(a < 0){ + if(_ao_ && ! match) switch$0 = 1; + } + else if(! _ao_ && match) switch$0 = 1; + return switch$0 ? caml_call1(Stdlib[1], cst_Bytes_extend) : c; + } + function extend(s, left, right){ + var + len = symbol(symbol(caml_ml_bytes_length(s), left), right), + r = caml_create_bytes(len); + if(0 <= left) + var dstoff = left, srcoff = 0; + else + var dstoff = 0, srcoff = - left | 0; + var + cpylen = + caml_call2 + (Stdlib_Int[10], + caml_ml_bytes_length(s) - srcoff | 0, + len - dstoff | 0); + if(0 < cpylen) caml_blit_bytes(s, srcoff, r, dstoff, cpylen); + return r; + } + function fill(s, ofs, len, c){ + if(0 <= ofs && 0 <= len && (caml_ml_bytes_length(s) - len | 0) >= ofs) + return caml_fill_bytes(s, ofs, len, c); + return caml_call1(Stdlib[1], cst_String_fill_Bytes_fill); + } + function blit(s1, ofs1, s2, ofs2, len){ + if + (0 <= len + && + 0 <= ofs1 + && + (caml_ml_bytes_length(s1) - len | 0) >= ofs1 + && 0 <= ofs2 && (caml_ml_bytes_length(s2) - len | 0) >= ofs2) + return caml_blit_bytes(s1, ofs1, s2, ofs2, len); + return caml_call1(Stdlib[1], cst_Bytes_blit); + } + function blit_string(s1, ofs1, s2, ofs2, len){ + if + (0 <= len + && + 0 <= ofs1 + && + (runtime.caml_ml_string_length(s1) - len | 0) >= ofs1 + && 0 <= ofs2 && (caml_ml_bytes_length(s2) - len | 0) >= ofs2) + return runtime.caml_blit_string(s1, ofs1, s2, ofs2, len); + return caml_call1(Stdlib[1], cst_String_blit_Bytes_blit_str); + } + function iter(f, a){ + var _am_ = caml_ml_bytes_length(a) - 1 | 0, _al_ = 0; + if(_am_ >= 0){ + var i = _al_; + for(;;){ + caml_call1(f, caml_bytes_unsafe_get(a, i)); + var _an_ = i + 1 | 0; + if(_am_ !== i){var i = _an_; continue;} + break; + } + } + return 0; + } + function iteri(f, a){ + var _aj_ = caml_ml_bytes_length(a) - 1 | 0, _ai_ = 0; + if(_aj_ >= 0){ + var i = _ai_; + for(;;){ + caml_call2(f, i, caml_bytes_unsafe_get(a, i)); + var _ak_ = i + 1 | 0; + if(_aj_ !== i){var i = _ak_; continue;} + break; + } + } + return 0; + } + function concat(sep, l){ + if(! l) return empty; + var seplen = caml_ml_bytes_length(sep), acc = 0, param = l, pos$1 = 0; + for(;;){ + if(param){ + var hd = param[1]; + if(param[2]){ + var + tl = param[2], + x = (caml_ml_bytes_length(hd) + seplen | 0) + acc | 0, + acc$0 = acc <= x ? x : caml_call1(Stdlib[1], cst_Bytes_concat), + acc = acc$0, + param = tl; + continue; + } + var _ah_ = caml_ml_bytes_length(hd) + acc | 0; + } + else + var _ah_ = acc; + var dst = caml_create_bytes(_ah_), pos = pos$1, param$0 = l; + for(;;){ + if(! param$0) return dst; + var hd$0 = param$0[1]; + if(param$0[2]){ + var tl$0 = param$0[2]; + caml_blit_bytes(hd$0, 0, dst, pos, caml_ml_bytes_length(hd$0)); + caml_blit_bytes + (sep, 0, dst, pos + caml_ml_bytes_length(hd$0) | 0, seplen); + var + pos$0 = (pos + caml_ml_bytes_length(hd$0) | 0) + seplen | 0, + pos = pos$0, + param$0 = tl$0; + continue; + } + caml_blit_bytes(hd$0, 0, dst, pos, caml_ml_bytes_length(hd$0)); + return dst; + } + } + } + function cat(s1, s2){ + var + l1 = caml_ml_bytes_length(s1), + l2 = caml_ml_bytes_length(s2), + r = caml_create_bytes(l1 + l2 | 0); + caml_blit_bytes(s1, 0, r, 0, l1); + caml_blit_bytes(s2, 0, r, l1, l2); + return r; + } + function is_space(param){ + var _ag_ = param - 9 | 0, switch$0 = 0; + if(4 < _ag_ >>> 0){ + if(23 === _ag_) switch$0 = 1; + } + else if(2 !== _ag_) switch$0 = 1; + return switch$0 ? 1 : 0; + } + function trim(s){ + var len = caml_ml_bytes_length(s), i = [0, 0]; + for(;;){ + if(i[1] < len && is_space(caml_bytes_unsafe_get(s, i[1]))){i[1]++; continue;} + var j = [0, len - 1 | 0]; + for(;;){ + if(i[1] <= j[1] && is_space(caml_bytes_unsafe_get(s, j[1]))){j[1] += -1; continue;} + return i[1] <= j[1] ? sub(s, i[1], (j[1] - i[1] | 0) + 1 | 0) : empty; + } + } + } + function escaped(s){ + var n = [0, 0], _$_ = caml_ml_bytes_length(s) - 1 | 0, ___ = 0; + if(_$_ >= 0){ + var i$0 = ___; + for(;;){ + var match = caml_bytes_unsafe_get(s, i$0), switch$0 = 0; + if(32 <= match){ + var _ad_ = match - 34 | 0, switch$1 = 0; + if(58 < _ad_ >>> 0){ + if(93 > _ad_) switch$1 = 1; + } + else if(56 < _ad_ - 1 >>> 0) switch$0 = 1; else switch$1 = 1; + if(switch$1){var _ae_ = 1; switch$0 = 2;} + } + else + if(11 <= match){ + if(13 === match) switch$0 = 1; + } + else if(8 <= match) switch$0 = 1; + switch(switch$0){ + case 0: + var _ae_ = 4; break; + case 1: + var _ae_ = 2; break; + } + n[1] = n[1] + _ae_ | 0; + var _af_ = i$0 + 1 | 0; + if(_$_ !== i$0){var i$0 = _af_; continue;} + break; + } + } + if(n[1] === caml_ml_bytes_length(s)) return copy(s); + var s$0 = caml_create_bytes(n[1]); + n[1] = 0; + var _ab_ = caml_ml_bytes_length(s) - 1 | 0, _aa_ = 0; + if(_ab_ >= 0){ + var i = _aa_; + for(;;){ + var c = caml_bytes_unsafe_get(s, i), switch$2 = 0; + if(35 <= c) + if(92 === c) + switch$2 = 2; + else if(127 <= c) switch$2 = 1; else switch$2 = 3; + else if(32 <= c) + if(34 <= c) switch$2 = 2; else switch$2 = 3; + else if(14 <= c) + switch$2 = 1; + else + switch(c){ + case 8: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 98); + break; + case 9: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 116); + break; + case 10: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 110); + break; + case 13: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 114); + break; + default: switch$2 = 1; + } + switch(switch$2){ + case 1: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 48 + (c / 100 | 0) | 0); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 48 + ((c / 10 | 0) % 10 | 0) | 0); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], 48 + (c % 10 | 0) | 0); + break; + case 2: + caml_bytes_unsafe_set(s$0, n[1], 92); + n[1]++; + caml_bytes_unsafe_set(s$0, n[1], c); + break; + case 3: + caml_bytes_unsafe_set(s$0, n[1], c); break; + } + n[1]++; + var _ac_ = i + 1 | 0; + if(_ab_ !== i){var i = _ac_; continue;} + break; + } + } + return s$0; + } + function map(f, s){ + var l = caml_ml_bytes_length(s); + if(0 === l) return s; + var r = caml_create_bytes(l), _Y_ = l - 1 | 0, _X_ = 0; + if(_Y_ >= 0){ + var i = _X_; + for(;;){ + caml_bytes_unsafe_set(r, i, caml_call1(f, caml_bytes_unsafe_get(s, i))); + var _Z_ = i + 1 | 0; + if(_Y_ !== i){var i = _Z_; continue;} + break; + } + } + return r; + } + function mapi(f, s){ + var l = caml_ml_bytes_length(s); + if(0 === l) return s; + var r = caml_create_bytes(l), _V_ = l - 1 | 0, _U_ = 0; + if(_V_ >= 0){ + var i = _U_; + for(;;){ + caml_bytes_unsafe_set + (r, i, caml_call2(f, i, caml_bytes_unsafe_get(s, i))); + var _W_ = i + 1 | 0; + if(_V_ !== i){var i = _W_; continue;} + break; + } + } + return r; + } + function fold_left(f, x, a){ + var r = [0, x], _S_ = caml_ml_bytes_length(a) - 1 | 0, _R_ = 0; + if(_S_ >= 0){ + var i = _R_; + for(;;){ + r[1] = caml_call2(f, r[1], caml_bytes_unsafe_get(a, i)); + var _T_ = i + 1 | 0; + if(_S_ !== i){var i = _T_; continue;} + break; + } + } + return r[1]; + } + function fold_right(f, a, x){ + var r = [0, x], _P_ = caml_ml_bytes_length(a) - 1 | 0; + if(_P_ >= 0){ + var i = _P_; + for(;;){ + r[1] = caml_call2(f, caml_bytes_unsafe_get(a, i), r[1]); + var _Q_ = i - 1 | 0; + if(0 !== i){var i = _Q_; continue;} + break; + } + } + return r[1]; + } + function exists(p, s){ + var n = caml_ml_bytes_length(s), i = 0; + for(;;){ + if(i === n) return 0; + if(caml_call1(p, caml_bytes_unsafe_get(s, i))) return 1; + var i$0 = i + 1 | 0, i = i$0; + } + } + function for_all(p, s){ + var n = caml_ml_bytes_length(s), i = 0; + for(;;){ + if(i === n) return 1; + if(! caml_call1(p, caml_bytes_unsafe_get(s, i))) return 0; + var i$0 = i + 1 | 0, i = i$0; + } + } + function uppercase_ascii(s){return map(Stdlib_Char[6], s);} + function lowercase_ascii(s){return map(Stdlib_Char[5], s);} + function apply1(f, s){ + if(0 === caml_ml_bytes_length(s)) return s; + var r = copy(s); + caml_bytes_unsafe_set(r, 0, caml_call1(f, caml_bytes_unsafe_get(s, 0))); + return r; + } + function capitalize_ascii(s){return apply1(Stdlib_Char[6], s);} + function uncapitalize_ascii(s){return apply1(Stdlib_Char[5], s);} + function starts_with(prefix, s){ + var + len_s = caml_ml_bytes_length(s), + len_pre = caml_ml_bytes_length(prefix), + _O_ = len_pre <= len_s ? 1 : 0; + if(! _O_) return _O_; + var i = 0; + for(;;){ + if(i === len_pre) return 1; + if(caml_bytes_unsafe_get(s, i) !== caml_bytes_unsafe_get(prefix, i)) + return 0; + var i$0 = i + 1 | 0, i = i$0; + } + } + function ends_with(suffix, s){ + var + len_s = caml_ml_bytes_length(s), + len_suf = caml_ml_bytes_length(suffix), + diff = len_s - len_suf | 0, + _N_ = 0 <= diff ? 1 : 0; + if(! _N_) return _N_; + var i = 0; + for(;;){ + if(i === len_suf) return 1; + if + (caml_bytes_unsafe_get(s, diff + i | 0) + !== caml_bytes_unsafe_get(suffix, i)) + return 0; + var i$0 = i + 1 | 0, i = i$0; + } + } + function index_rec(s, lim, i, c){ + var i$0 = i; + for(;;){ + if(lim <= i$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(caml_bytes_unsafe_get(s, i$0) === c) return i$0; + var i$1 = i$0 + 1 | 0, i$0 = i$1; + } + } + function index(s, c){return index_rec(s, caml_ml_bytes_length(s), 0, c);} + function index_rec_opt(s, lim, i, c){ + var i$0 = i; + for(;;){ + if(lim <= i$0) return 0; + if(caml_bytes_unsafe_get(s, i$0) === c) return [0, i$0]; + var i$1 = i$0 + 1 | 0, i$0 = i$1; + } + } + function index_opt(s, c){ + return index_rec_opt(s, caml_ml_bytes_length(s), 0, c); + } + function index_from(s, i, c){ + var l = caml_ml_bytes_length(s); + if(0 <= i && l >= i) return index_rec(s, l, i, c); + return caml_call1(Stdlib[1], cst_String_index_from_Bytes_in); + } + function index_from_opt(s, i, c){ + var l = caml_ml_bytes_length(s); + if(0 <= i && l >= i) return index_rec_opt(s, l, i, c); + return caml_call1(Stdlib[1], cst_String_index_from_opt_Byte); + } + function rindex_rec(s, i, c){ + var i$0 = i; + for(;;){ + if(0 > i$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(caml_bytes_unsafe_get(s, i$0) === c) return i$0; + var i$1 = i$0 - 1 | 0, i$0 = i$1; + } + } + function rindex(s, c){ + return rindex_rec(s, caml_ml_bytes_length(s) - 1 | 0, c); + } + function rindex_from(s, i, c){ + if(-1 <= i && caml_ml_bytes_length(s) > i) return rindex_rec(s, i, c); + return caml_call1(Stdlib[1], cst_String_rindex_from_Bytes_r); + } + function rindex_rec_opt(s, i, c){ + var i$0 = i; + for(;;){ + if(0 > i$0) return 0; + if(caml_bytes_unsafe_get(s, i$0) === c) return [0, i$0]; + var i$1 = i$0 - 1 | 0, i$0 = i$1; + } + } + function rindex_opt(s, c){ + return rindex_rec_opt(s, caml_ml_bytes_length(s) - 1 | 0, c); + } + function rindex_from_opt(s, i, c){ + if(-1 <= i && caml_ml_bytes_length(s) > i) return rindex_rec_opt(s, i, c); + return caml_call1(Stdlib[1], cst_String_rindex_from_opt_Byt); + } + function contains_from(s, i, c){ + var l = caml_ml_bytes_length(s); + if(0 <= i && l >= i) + try{index_rec(s, l, i, c); var _L_ = 1; return _L_;} + catch(_M_){ + var _K_ = caml_wrap_exception(_M_); + if(_K_ === Stdlib[8]) return 0; + throw caml_maybe_attach_backtrace(_K_, 0); + } + return caml_call1(Stdlib[1], cst_String_contains_from_Bytes); + } + function contains(s, c){return contains_from(s, 0, c);} + function rcontains_from(s, i, c){ + if(0 <= i && caml_ml_bytes_length(s) > i) + try{rindex_rec(s, i, c); var _I_ = 1; return _I_;} + catch(_J_){ + var _H_ = caml_wrap_exception(_J_); + if(_H_ === Stdlib[8]) return 0; + throw caml_maybe_attach_backtrace(_H_, 0); + } + return caml_call1(Stdlib[1], cst_String_rcontains_from_Byte); + } + var compare = runtime.caml_bytes_compare; + function split_on_char(sep, s){ + var + r = [0, 0], + j = [0, caml_ml_bytes_length(s)], + _D_ = caml_ml_bytes_length(s) - 1 | 0; + if(_D_ >= 0){ + var i = _D_; + for(;;){ + if(caml_bytes_unsafe_get(s, i) === sep){ + var _F_ = r[1]; + r[1] = [0, sub(s, i + 1 | 0, (j[1] - i | 0) - 1 | 0), _F_]; + j[1] = i; + } + var _G_ = i - 1 | 0; + if(0 !== i){var i = _G_; continue;} + break; + } + } + var _E_ = r[1]; + return [0, sub(s, 0, j[1]), _E_]; + } + function uppercase(s){return map(Stdlib_Char[4], s);} + function lowercase(s){return map(Stdlib_Char[3], s);} + function capitalize(s){return apply1(Stdlib_Char[4], s);} + function uncapitalize(s){return apply1(Stdlib_Char[3], s);} + function to_seq(s){ + function aux(i, param){ + if(i === caml_ml_bytes_length(s)) return 0; + var x = caml_bytes_get(s, i), _B_ = i + 1 | 0; + return [0, x, function(_C_){return aux(_B_, _C_);}]; + } + var _z_ = 0; + return function(_A_){return aux(_z_, _A_);}; + } + function to_seqi(s){ + function aux(i, param){ + if(i === caml_ml_bytes_length(s)) return 0; + var x = caml_bytes_get(s, i), _x_ = i + 1 | 0; + return [0, [0, i, x], function(_y_){return aux(_x_, _y_);}]; + } + var _v_ = 0; + return function(_w_){return aux(_v_, _w_);}; + } + function of_seq(i){ + var n = [0, 0], buf = [0, make(256, 0)]; + function _u_(c){ + if(n[1] === caml_ml_bytes_length(buf[1])){ + var + new_len = + caml_call2 + (Stdlib_Int[10], + 2 * caml_ml_bytes_length(buf[1]) | 0, + Stdlib_Sys[12]); + if(caml_ml_bytes_length(buf[1]) === new_len) + caml_call1(Stdlib[2], cst_Bytes_of_seq_cannot_grow_b); + var new_buf = make(new_len, 0); + blit(buf[1], 0, new_buf, 0, n[1]); + buf[1] = new_buf; + } + caml_bytes_set(buf[1], n[1], c); + n[1]++; + return 0; + } + caml_call2(Stdlib_Seq[4], _u_, i); + return sub(buf[1], 0, n[1]); + } + function unsafe_get_uint16_le(b, i){ + return Stdlib_Sys[11] + ? caml_bswap16(caml_bytes_get16(b, i)) + : caml_bytes_get16(b, i); + } + function unsafe_get_uint16_be(b, i){ + return Stdlib_Sys[11] + ? caml_bytes_get16(b, i) + : caml_bswap16(caml_bytes_get16(b, i)); + } + function get_int8(b, i){ + var _s_ = Stdlib_Sys[10] - 8 | 0, _t_ = Stdlib_Sys[10] - 8 | 0; + return caml_bytes_get(b, i) << _t_ >> _s_; + } + function get_uint16_le(b, i){ + return Stdlib_Sys[11] + ? caml_bswap16(caml_bytes_get16(b, i)) + : caml_bytes_get16(b, i); + } + function get_uint16_be(b, i){ + return Stdlib_Sys[11] + ? caml_bytes_get16(b, i) + : caml_bswap16(caml_bytes_get16(b, i)); + } + function get_int16_ne(b, i){ + var _q_ = Stdlib_Sys[10] - 16 | 0, _r_ = Stdlib_Sys[10] - 16 | 0; + return caml_bytes_get16(b, i) << _r_ >> _q_; + } + function get_int16_le(b, i){ + var _o_ = Stdlib_Sys[10] - 16 | 0, _p_ = Stdlib_Sys[10] - 16 | 0; + return get_uint16_le(b, i) << _p_ >> _o_; + } + function get_int16_be(b, i){ + var _m_ = Stdlib_Sys[10] - 16 | 0, _n_ = Stdlib_Sys[10] - 16 | 0; + return get_uint16_be(b, i) << _n_ >> _m_; + } + function get_int32_le(b, i){ + return Stdlib_Sys[11] + ? caml_int32_bswap(caml_bytes_get32(b, i)) + : caml_bytes_get32(b, i); + } + function get_int32_be(b, i){ + return Stdlib_Sys[11] + ? caml_bytes_get32(b, i) + : caml_int32_bswap(caml_bytes_get32(b, i)); + } + function get_int64_le(b, i){ + return Stdlib_Sys[11] + ? caml_int64_bswap(caml_bytes_get64(b, i)) + : caml_bytes_get64(b, i); + } + function get_int64_be(b, i){ + return Stdlib_Sys[11] + ? caml_bytes_get64(b, i) + : caml_int64_bswap(caml_bytes_get64(b, i)); + } + function unsafe_set_uint16_le(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set16(b, i, caml_bswap16(x)) + : caml_bytes_set16(b, i, x); + } + function unsafe_set_uint16_be(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set16(b, i, x) + : caml_bytes_set16(b, i, caml_bswap16(x)); + } + function set_int16_le(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set16(b, i, caml_bswap16(x)) + : caml_bytes_set16(b, i, x); + } + function set_int16_be(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set16(b, i, x) + : caml_bytes_set16(b, i, caml_bswap16(x)); + } + function set_int32_le(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set32(b, i, caml_int32_bswap(x)) + : caml_bytes_set32(b, i, x); + } + function set_int32_be(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set32(b, i, x) + : caml_bytes_set32(b, i, caml_int32_bswap(x)); + } + function set_int64_le(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set64(b, i, caml_int64_bswap(x)) + : caml_bytes_set64(b, i, x); + } + function set_int64_be(b, i, x){ + return Stdlib_Sys[11] + ? caml_bytes_set64(b, i, x) + : caml_bytes_set64(b, i, caml_int64_bswap(x)); + } + var + set_uint8 = caml_bytes_set, + set_uint16_ne = caml_bytes_set16, + dec_invalid = Stdlib_Uchar[22]; + function dec_ret(n, u){ + var _l_ = caml_call1(Stdlib_Uchar[9], u); + return caml_call2(Stdlib_Uchar[21], n, _l_); + } + function not_in_x80_to_xBF(b){return 2 !== (b >>> 6 | 0) ? 1 : 0;} + function not_in_xA0_to_xBF(b){return 5 !== (b >>> 5 | 0) ? 1 : 0;} + function not_in_x80_to_x9F(b){return 4 !== (b >>> 5 | 0) ? 1 : 0;} + function not_in_x90_to_xBF(b){ + var _j_ = b < 144 ? 1 : 0, _k_ = _j_ || (191 < b ? 1 : 0); + return _k_; + } + function not_in_x80_to_x8F(b){return 8 !== (b >>> 4 | 0) ? 1 : 0;} + function utf_8_uchar_3(b0, b1, b2){ + return (b0 & 15) << 12 | (b1 & 63) << 6 | b2 & 63; + } + function utf_8_uchar_4(b0, b1, b2, b3){ + return (b0 & 7) << 18 | (b1 & 63) << 12 | (b2 & 63) << 6 | b3 & 63; + } + function get_utf_8_uchar(b, i){ + var b0 = caml_bytes_get(b, i), max = caml_ml_bytes_length(b) - 1 | 0; + if(224 <= b0){ + var switch$0 = 0; + if(237 <= b0){ + if(245 > b0) + switch(b0 - 237 | 0){ + case 0: + var i$0 = i + 1 | 0; + if(max < i$0) return caml_call1(dec_invalid, 1); + var b1 = caml_bytes_unsafe_get(b, i$0); + if(not_in_x80_to_x9F(b1)) return caml_call1(dec_invalid, 1); + var i$1 = i$0 + 1 | 0; + if(max < i$1) return caml_call1(dec_invalid, 2); + var b2 = caml_bytes_unsafe_get(b, i$1); + return not_in_x80_to_xBF(b2) + ? caml_call1(dec_invalid, 2) + : dec_ret(3, utf_8_uchar_3(b0, b1, b2)); + case 3: + var i$4 = i + 1 | 0; + if(max < i$4) return caml_call1(dec_invalid, 1); + var b1$1 = caml_bytes_unsafe_get(b, i$4); + if(not_in_x90_to_xBF(b1$1)) return caml_call1(dec_invalid, 1); + var i$5 = i$4 + 1 | 0; + if(max < i$5) return caml_call1(dec_invalid, 2); + var b2$1 = caml_bytes_unsafe_get(b, i$5); + if(not_in_x80_to_xBF(b2$1)) return caml_call1(dec_invalid, 2); + var i$6 = i$5 + 1 | 0; + if(max < i$6) return caml_call1(dec_invalid, 3); + var b3 = caml_bytes_unsafe_get(b, i$6); + return not_in_x80_to_xBF(b3) + ? caml_call1(dec_invalid, 3) + : dec_ret(4, utf_8_uchar_4(b0, b1$1, b2$1, b3)); + case 7: + var i$10 = i + 1 | 0; + if(max < i$10) return caml_call1(dec_invalid, 1); + var b1$3 = caml_bytes_unsafe_get(b, i$10); + if(not_in_x80_to_x8F(b1$3)) return caml_call1(dec_invalid, 1); + var i$11 = i$10 + 1 | 0; + if(max < i$11) return caml_call1(dec_invalid, 2); + var b2$3 = caml_bytes_unsafe_get(b, i$11); + if(not_in_x80_to_xBF(b2$3)) return caml_call1(dec_invalid, 2); + var i$12 = i$11 + 1 | 0; + if(max < i$12) return caml_call1(dec_invalid, 3); + var b3$1 = caml_bytes_unsafe_get(b, i$12); + return not_in_x80_to_xBF(b3$1) + ? caml_call1(dec_invalid, 3) + : dec_ret(4, utf_8_uchar_4(b0, b1$3, b2$3, b3$1)); + case 1: + case 2: + switch$0 = 1; break; + default: + var i$7 = i + 1 | 0; + if(max < i$7) return caml_call1(dec_invalid, 1); + var b1$2 = caml_bytes_unsafe_get(b, i$7); + if(not_in_x80_to_xBF(b1$2)) return caml_call1(dec_invalid, 1); + var i$8 = i$7 + 1 | 0; + if(max < i$8) return caml_call1(dec_invalid, 2); + var b2$2 = caml_bytes_unsafe_get(b, i$8); + if(not_in_x80_to_xBF(b2$2)) return caml_call1(dec_invalid, 2); + var i$9 = i$8 + 1 | 0; + if(max < i$9) return caml_call1(dec_invalid, 3); + var b3$0 = caml_bytes_unsafe_get(b, i$9); + return not_in_x80_to_xBF(b3$0) + ? caml_call1(dec_invalid, 3) + : dec_ret(4, utf_8_uchar_4(b0, b1$2, b2$2, b3$0)); + } + } + else{ + if(225 > b0){ + var i$13 = i + 1 | 0; + if(max < i$13) return caml_call1(dec_invalid, 1); + var b1$4 = caml_bytes_unsafe_get(b, i$13); + if(not_in_xA0_to_xBF(b1$4)) return caml_call1(dec_invalid, 1); + var i$14 = i$13 + 1 | 0; + if(max < i$14) return caml_call1(dec_invalid, 2); + var b2$4 = caml_bytes_unsafe_get(b, i$14); + return not_in_x80_to_xBF(b2$4) + ? caml_call1(dec_invalid, 2) + : dec_ret(3, utf_8_uchar_3(b0, b1$4, b2$4)); + } + switch$0 = 1; + } + if(switch$0){ + var i$2 = i + 1 | 0; + if(max < i$2) return caml_call1(dec_invalid, 1); + var b1$0 = caml_bytes_unsafe_get(b, i$2); + if(not_in_x80_to_xBF(b1$0)) return caml_call1(dec_invalid, 1); + var i$3 = i$2 + 1 | 0; + if(max < i$3) return caml_call1(dec_invalid, 2); + var b2$0 = caml_bytes_unsafe_get(b, i$3); + return not_in_x80_to_xBF(b2$0) + ? caml_call1(dec_invalid, 2) + : dec_ret(3, utf_8_uchar_3(b0, b1$0, b2$0)); + } + } + else{ + if(128 > b0) return dec_ret(1, b0); + if(194 <= b0){ + var i$15 = i + 1 | 0; + if(max < i$15) return caml_call1(dec_invalid, 1); + var b1$5 = caml_bytes_unsafe_get(b, i$15); + return not_in_x80_to_xBF(b1$5) + ? caml_call1(dec_invalid, 1) + : dec_ret(2, (b0 & 31) << 6 | b1$5 & 63); + } + } + return caml_call1(dec_invalid, 1); + } + function set_utf_8_uchar(b, i, u){ + function set(_i_, _h_, _g_){ + caml_bytes_unsafe_set(_i_, _h_, _g_); + return 0; + } + var + max = caml_ml_bytes_length(b) - 1 | 0, + u$0 = caml_call1(Stdlib_Uchar[10], u); + if(0 > u$0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + if(127 >= u$0){caml_bytes_set(b, i, u$0); return 1;} + if(2047 >= u$0){ + var last$1 = i + 1 | 0; + return max < last$1 + ? 0 + : (caml_bytes_set + (b, i, 192 | u$0 >>> 6 | 0), + set(b, last$1, 128 | u$0 & 63), + 2); + } + if(65535 >= u$0){ + var last$0 = i + 2 | 0; + return max < last$0 + ? 0 + : (caml_bytes_set + (b, i, 224 | u$0 >>> 12 | 0), + set(b, i + 1 | 0, 128 | (u$0 >>> 6 | 0) & 63), + set(b, last$0, 128 | u$0 & 63), + 3); + } + if(1114111 < u$0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + var last = i + 3 | 0; + return max < last + ? 0 + : (caml_bytes_set + (b, i, 240 | u$0 >>> 18 | 0), + set(b, i + 1 | 0, 128 | (u$0 >>> 12 | 0) & 63), + set(b, i + 2 | 0, 128 | (u$0 >>> 6 | 0) & 63), + set(b, last, 128 | u$0 & 63), + 4); + } + function is_valid_utf_8(b){ + var max = caml_ml_bytes_length(b) - 1 | 0, i = 0; + for(;;){ + if(max < i) return 1; + var match = caml_bytes_unsafe_get(b, i); + if(224 <= match){ + var switch$0 = 0; + if(237 <= match){ + if(245 > match) + switch(match - 237 | 0){ + case 0: + var last = i + 2 | 0; + if + (max >= last + && + ! + not_in_x80_to_x9F(caml_bytes_unsafe_get(b, i + 1 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last))){var i$0 = last + 1 | 0, i = i$0; continue;} + return 0; + case 3: + var last$1 = i + 3 | 0; + if + (max >= last$1 + && + ! + not_in_x90_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) + && + ! + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$1))){var i$2 = last$1 + 1 | 0, i = i$2; continue;} + return 0; + case 7: + var last$3 = i + 3 | 0; + if + (max >= last$3 + && + ! + not_in_x80_to_x8F(caml_bytes_unsafe_get(b, i + 1 | 0)) + && + ! + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$3))){var i$4 = last$3 + 1 | 0, i = i$4; continue;} + return 0; + case 1: + case 2: + switch$0 = 1; break; + default: + var last$2 = i + 3 | 0; + if + (max >= last$2 + && + ! + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) + && + ! + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 2 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$2))){var i$3 = last$2 + 1 | 0, i = i$3; continue;} + return 0; + } + } + else{ + if(225 > match){ + var last$4 = i + 2 | 0; + if + (max >= last$4 + && + ! + not_in_xA0_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$4))){var i$5 = last$4 + 1 | 0, i = i$5; continue;} + return 0; + } + switch$0 = 1; + } + if(switch$0){ + var last$0 = i + 2 | 0; + if + (max >= last$0 + && + ! + not_in_x80_to_xBF(caml_bytes_unsafe_get(b, i + 1 | 0)) + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$0))){var i$1 = last$0 + 1 | 0, i = i$1; continue;} + return 0; + } + } + else{ + if(128 > match){var i$7 = i + 1 | 0, i = i$7; continue;} + if(194 <= match){ + var last$5 = i + 1 | 0; + if + (max >= last$5 + && ! not_in_x80_to_xBF(caml_bytes_unsafe_get(b, last$5))){var i$6 = last$5 + 1 | 0, i = i$6; continue;} + return 0; + } + } + return 0; + } + } + function get_utf_16be_uchar(b, i){ + var max = caml_ml_bytes_length(b) - 1 | 0; + if(0 <= i && max >= i){ + if(i === max) return caml_call1(dec_invalid, 1); + var hi = unsafe_get_uint16_be(b, i); + if(55296 <= hi && 57343 >= hi){ + if(56319 < hi) return caml_call1(dec_invalid, 2); + var last = i + 3 | 0; + if(max < last) return caml_call1(dec_invalid, (max - i | 0) + 1 | 0); + var lo = unsafe_get_uint16_be(b, i + 2 | 0); + if(56320 <= lo && 57343 >= lo){ + var u = ((hi & 1023) << 10 | lo & 1023) + 65536 | 0; + return dec_ret(4, u); + } + return caml_call1(dec_invalid, 2); + } + return dec_ret(2, hi); + } + return caml_call1(Stdlib[1], cst_index_out_of_bounds); + } + function set_utf_16be_uchar(b, i, u){ + var max = caml_ml_bytes_length(b) - 1 | 0; + if(0 <= i && max >= i){ + var u$0 = caml_call1(Stdlib_Uchar[10], u); + if(0 > u$0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _d_], 1); + if(65535 >= u$0){ + var last$0 = i + 1 | 0; + return max < last$0 ? 0 : (unsafe_set_uint16_be(b, i, u$0), 2); + } + if(1114111 < u$0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _c_], 1); + var last = i + 3 | 0; + if(max < last) return 0; + var + u$1 = u$0 - 65536 | 0, + hi = 55296 | u$1 >>> 10 | 0, + lo = 56320 | u$1 & 1023; + unsafe_set_uint16_be(b, i, hi); + unsafe_set_uint16_be(b, i + 2 | 0, lo); + return 4; + } + return caml_call1(Stdlib[1], cst_index_out_of_bounds$0); + } + function is_valid_utf_16be(b){ + var max = caml_ml_bytes_length(b) - 1 | 0, i = 0; + for(;;){ + if(max < i) return 1; + if(i === max) return 0; + var u = unsafe_get_uint16_be(b, i); + if(55296 <= u && 57343 >= u){ + if(56319 < u) return 0; + var last = i + 3 | 0; + if(max < last) return 0; + var u$0 = unsafe_get_uint16_be(b, i + 2 | 0); + if(56320 <= u$0 && 57343 >= u$0){ + var i$1 = i + 4 | 0, i = i$1; + continue; + } + return 0; + } + var i$0 = i + 2 | 0, i = i$0; + } + } + function get_utf_16le_uchar(b, i){ + var max = caml_ml_bytes_length(b) - 1 | 0; + if(0 <= i && max >= i){ + if(i === max) return caml_call1(dec_invalid, 1); + var hi = unsafe_get_uint16_le(b, i); + if(55296 <= hi && 57343 >= hi){ + if(56319 < hi) return caml_call1(dec_invalid, 2); + var last = i + 3 | 0; + if(max < last) return caml_call1(dec_invalid, (max - i | 0) + 1 | 0); + var lo = unsafe_get_uint16_le(b, i + 2 | 0); + if(56320 <= lo && 57343 >= lo){ + var u = ((hi & 1023) << 10 | lo & 1023) + 65536 | 0; + return dec_ret(4, u); + } + return caml_call1(dec_invalid, 2); + } + return dec_ret(2, hi); + } + return caml_call1(Stdlib[1], cst_index_out_of_bounds$1); + } + function set_utf_16le_uchar(b, i, u){ + var max = caml_ml_bytes_length(b) - 1 | 0; + if(0 <= i && max >= i){ + var u$0 = caml_call1(Stdlib_Uchar[10], u); + if(0 > u$0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _f_], 1); + if(65535 >= u$0){ + var last$0 = i + 1 | 0; + return max < last$0 ? 0 : (unsafe_set_uint16_le(b, i, u$0), 2); + } + if(1114111 < u$0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _e_], 1); + var last = i + 3 | 0; + if(max < last) return 0; + var + u$1 = u$0 - 65536 | 0, + hi = 55296 | u$1 >>> 10 | 0, + lo = 56320 | u$1 & 1023; + unsafe_set_uint16_le(b, i, hi); + unsafe_set_uint16_le(b, i + 2 | 0, lo); + return 4; + } + return caml_call1(Stdlib[1], cst_index_out_of_bounds$2); + } + function is_valid_utf_16le(b){ + var max = caml_ml_bytes_length(b) - 1 | 0, i = 0; + for(;;){ + if(max < i) return 1; + if(i === max) return 0; + var u = unsafe_get_uint16_le(b, i); + if(55296 <= u && 57343 >= u){ + if(56319 < u) return 0; + var last = i + 3 | 0; + if(max < last) return 0; + var u$0 = unsafe_get_uint16_le(b, i + 2 | 0); + if(56320 <= u$0 && 57343 >= u$0){ + var i$1 = i + 4 | 0, i = i$1; + continue; + } + return 0; + } + var i$0 = i + 2 | 0, i = i$0; + } + } + var + Stdlib_Bytes = + [0, + make, + init, + empty, + copy, + of_string, + to_string, + sub, + sub_string, + extend, + fill, + blit, + blit_string, + concat, + cat, + iter, + iteri, + map, + mapi, + fold_left, + fold_right, + for_all, + exists, + trim, + escaped, + index, + index_opt, + rindex, + rindex_opt, + index_from, + index_from_opt, + rindex_from, + rindex_from_opt, + contains, + contains_from, + rcontains_from, + uppercase, + lowercase, + capitalize, + uncapitalize, + uppercase_ascii, + lowercase_ascii, + capitalize_ascii, + uncapitalize_ascii, + compare, + runtime.caml_bytes_equal, + starts_with, + ends_with, + caml_string_of_bytes, + caml_bytes_of_string, + split_on_char, + to_seq, + to_seqi, + of_seq, + get_utf_8_uchar, + set_utf_8_uchar, + is_valid_utf_8, + get_utf_16be_uchar, + set_utf_16be_uchar, + is_valid_utf_16be, + get_utf_16le_uchar, + set_utf_16le_uchar, + is_valid_utf_16le, + caml_bytes_get, + get_int8, + caml_bytes_get16, + get_uint16_be, + get_uint16_le, + get_int16_ne, + get_int16_be, + get_int16_le, + caml_bytes_get32, + get_int32_be, + get_int32_le, + caml_bytes_get64, + get_int64_be, + get_int64_le, + set_uint8, + caml_bytes_set, + set_uint16_ne, + set_int16_be, + set_int16_le, + caml_bytes_set16, + set_int16_be, + set_int16_le, + caml_bytes_set32, + set_int32_be, + set_int32_le, + caml_bytes_set64, + set_int64_be, + set_int64_le]; + runtime.caml_register_global(30, Stdlib_Bytes, "Stdlib__Bytes"); + return; + } + (globalThis)); + +//# 4971 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst$0 = "", + caml_blit_string = runtime.caml_blit_string, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_equal = runtime.caml_string_equal, + caml_string_unsafe_get = runtime.caml_string_unsafe_get, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + cst = cst$0, + empty = cst$0, + Stdlib = global_data.Stdlib, + Stdlib_Bytes = global_data.Stdlib__Bytes, + bts = Stdlib_Bytes[48], + bos = Stdlib_Bytes[49], + cst_String_rcontains_from_Byte = + "String.rcontains_from / Bytes.rcontains_from", + cst_String_contains_from_Bytes = + "String.contains_from / Bytes.contains_from", + cst_String_rindex_from_opt_Byt = + "String.rindex_from_opt / Bytes.rindex_from_opt", + cst_String_rindex_from_Bytes_r = "String.rindex_from / Bytes.rindex_from", + cst_String_index_from_opt_Byte = + "String.index_from_opt / Bytes.index_from_opt", + cst_String_index_from_Bytes_in = "String.index_from / Bytes.index_from", + cst_String_concat = "String.concat"; + function make(n, c){ + return caml_call1(bts, caml_call2(Stdlib_Bytes[1], n, c)); + } + function init(n, f){ + return caml_call1(bts, caml_call2(Stdlib_Bytes[2], n, f)); + } + function copy(s){ + var _ac_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[4], _ac_)); + } + var of_bytes = Stdlib_Bytes[6], to_bytes = Stdlib_Bytes[5]; + function sub(s, ofs, len){ + var _ab_ = caml_call1(bos, s); + return caml_call1(bts, caml_call3(Stdlib_Bytes[7], _ab_, ofs, len)); + } + var fill = Stdlib_Bytes[10], blit = Stdlib_Bytes[12]; + function concat(sep, l){ + if(! l) return cst; + var seplen = caml_ml_string_length(sep), acc = 0, param = l, pos$1 = 0; + for(;;){ + if(param){ + var hd = param[1]; + if(param[2]){ + var + tl = param[2], + x = (caml_ml_string_length(hd) + seplen | 0) + acc | 0, + acc$0 = acc <= x ? x : caml_call1(Stdlib[1], cst_String_concat), + acc = acc$0, + param = tl; + continue; + } + var _aa_ = caml_ml_string_length(hd) + acc | 0; + } + else + var _aa_ = acc; + var dst = runtime.caml_create_bytes(_aa_), pos = pos$1, param$0 = l; + for(;;){ + if(param$0){ + var hd$0 = param$0[1]; + if(param$0[2]){ + var tl$0 = param$0[2]; + caml_blit_string(hd$0, 0, dst, pos, caml_ml_string_length(hd$0)); + caml_blit_string + (sep, 0, dst, pos + caml_ml_string_length(hd$0) | 0, seplen); + var + pos$0 = (pos + caml_ml_string_length(hd$0) | 0) + seplen | 0, + pos = pos$0, + param$0 = tl$0; + continue; + } + caml_blit_string(hd$0, 0, dst, pos, caml_ml_string_length(hd$0)); + } + return caml_call1(bts, dst); + } + } + } + var cat = Stdlib[28]; + function iter(f, s){ + var ___ = caml_ml_string_length(s) - 1 | 0, _Z_ = 0; + if(___ >= 0){ + var i = _Z_; + for(;;){ + caml_call1(f, caml_string_unsafe_get(s, i)); + var _$_ = i + 1 | 0; + if(___ !== i){var i = _$_; continue;} + break; + } + } + return 0; + } + function iteri(f, s){ + var _X_ = caml_ml_string_length(s) - 1 | 0, _W_ = 0; + if(_X_ >= 0){ + var i = _W_; + for(;;){ + caml_call2(f, i, caml_string_unsafe_get(s, i)); + var _Y_ = i + 1 | 0; + if(_X_ !== i){var i = _Y_; continue;} + break; + } + } + return 0; + } + function map(f, s){ + var _V_ = caml_call1(bos, s); + return caml_call1(bts, caml_call2(Stdlib_Bytes[17], f, _V_)); + } + function mapi(f, s){ + var _U_ = caml_call1(bos, s); + return caml_call1(bts, caml_call2(Stdlib_Bytes[18], f, _U_)); + } + function fold_right(f, x, a){ + var _T_ = caml_call1(bos, x); + return caml_call3(Stdlib_Bytes[20], f, _T_, a); + } + function fold_left(f, a, x){ + var _S_ = caml_call1(bos, x); + return caml_call3(Stdlib_Bytes[19], f, a, _S_); + } + function exists(f, s){ + var _R_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[22], f, _R_); + } + function for_all(f, s){ + var _Q_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[21], f, _Q_); + } + function is_space(param){ + var _P_ = param - 9 | 0, switch$0 = 0; + if(4 < _P_ >>> 0){ + if(23 === _P_) switch$0 = 1; + } + else if(2 !== _P_) switch$0 = 1; + return switch$0 ? 1 : 0; + } + function trim(s){ + if(caml_string_equal(s, cst$0)) return s; + if + (! + is_space(caml_string_unsafe_get(s, 0)) + && + ! + is_space(caml_string_unsafe_get(s, caml_ml_string_length(s) - 1 | 0))) + return s; + var _O_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[23], _O_)); + } + function escaped(s){ + var n = caml_ml_string_length(s), i = 0; + for(;;){ + if(n <= i) return s; + var _M_ = caml_string_unsafe_get(s, i) - 32 | 0, switch$0 = 0; + if(59 < _M_ >>> 0){ + if(33 < _M_ - 61 >>> 0) switch$0 = 1; + } + else if(2 === _M_) switch$0 = 1; + if(switch$0){ + var _N_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[24], _N_)); + } + var i$0 = i + 1 | 0, i = i$0; + } + } + function index_rec(s, lim, i, c){ + var i$0 = i; + for(;;){ + if(lim <= i$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(caml_string_unsafe_get(s, i$0) === c) return i$0; + var i$1 = i$0 + 1 | 0, i$0 = i$1; + } + } + function index(s, c){return index_rec(s, caml_ml_string_length(s), 0, c);} + function index_rec_opt(s, lim, i, c){ + var i$0 = i; + for(;;){ + if(lim <= i$0) return 0; + if(caml_string_unsafe_get(s, i$0) === c) return [0, i$0]; + var i$1 = i$0 + 1 | 0, i$0 = i$1; + } + } + function index_opt(s, c){ + return index_rec_opt(s, caml_ml_string_length(s), 0, c); + } + function index_from(s, i, c){ + var l = caml_ml_string_length(s); + if(0 <= i && l >= i) return index_rec(s, l, i, c); + return caml_call1(Stdlib[1], cst_String_index_from_Bytes_in); + } + function index_from_opt(s, i, c){ + var l = caml_ml_string_length(s); + if(0 <= i && l >= i) return index_rec_opt(s, l, i, c); + return caml_call1(Stdlib[1], cst_String_index_from_opt_Byte); + } + function rindex_rec(s, i, c){ + var i$0 = i; + for(;;){ + if(0 > i$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(caml_string_unsafe_get(s, i$0) === c) return i$0; + var i$1 = i$0 - 1 | 0, i$0 = i$1; + } + } + function rindex(s, c){ + return rindex_rec(s, caml_ml_string_length(s) - 1 | 0, c); + } + function rindex_from(s, i, c){ + if(-1 <= i && caml_ml_string_length(s) > i) return rindex_rec(s, i, c); + return caml_call1(Stdlib[1], cst_String_rindex_from_Bytes_r); + } + function rindex_rec_opt(s, i, c){ + var i$0 = i; + for(;;){ + if(0 > i$0) return 0; + if(caml_string_unsafe_get(s, i$0) === c) return [0, i$0]; + var i$1 = i$0 - 1 | 0, i$0 = i$1; + } + } + function rindex_opt(s, c){ + return rindex_rec_opt(s, caml_ml_string_length(s) - 1 | 0, c); + } + function rindex_from_opt(s, i, c){ + if(-1 <= i && caml_ml_string_length(s) > i) + return rindex_rec_opt(s, i, c); + return caml_call1(Stdlib[1], cst_String_rindex_from_opt_Byt); + } + function contains_from(s, i, c){ + var l = caml_ml_string_length(s); + if(0 <= i && l >= i) + try{index_rec(s, l, i, c); var _K_ = 1; return _K_;} + catch(_L_){ + var _J_ = caml_wrap_exception(_L_); + if(_J_ === Stdlib[8]) return 0; + throw caml_maybe_attach_backtrace(_J_, 0); + } + return caml_call1(Stdlib[1], cst_String_contains_from_Bytes); + } + function contains(s, c){return contains_from(s, 0, c);} + function rcontains_from(s, i, c){ + if(0 <= i && caml_ml_string_length(s) > i) + try{rindex_rec(s, i, c); var _H_ = 1; return _H_;} + catch(_I_){ + var _G_ = caml_wrap_exception(_I_); + if(_G_ === Stdlib[8]) return 0; + throw caml_maybe_attach_backtrace(_G_, 0); + } + return caml_call1(Stdlib[1], cst_String_rcontains_from_Byte); + } + function uppercase_ascii(s){ + var _F_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[40], _F_)); + } + function lowercase_ascii(s){ + var _E_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[41], _E_)); + } + function capitalize_ascii(s){ + var _D_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[42], _D_)); + } + function uncapitalize_ascii(s){ + var _C_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[43], _C_)); + } + function starts_with(prefix, s){ + var + len_s = caml_ml_string_length(s), + len_pre = caml_ml_string_length(prefix), + _B_ = len_pre <= len_s ? 1 : 0; + if(! _B_) return _B_; + var i = 0; + for(;;){ + if(i === len_pre) return 1; + if(caml_string_unsafe_get(s, i) !== caml_string_unsafe_get(prefix, i)) + return 0; + var i$0 = i + 1 | 0, i = i$0; + } + } + function ends_with(suffix, s){ + var + len_s = caml_ml_string_length(s), + len_suf = caml_ml_string_length(suffix), + diff = len_s - len_suf | 0, + _A_ = 0 <= diff ? 1 : 0; + if(! _A_) return _A_; + var i = 0; + for(;;){ + if(i === len_suf) return 1; + if + (caml_string_unsafe_get(s, diff + i | 0) + !== caml_string_unsafe_get(suffix, i)) + return 0; + var i$0 = i + 1 | 0, i = i$0; + } + } + function split_on_char(sep, s){ + var + r = [0, 0], + j = [0, caml_ml_string_length(s)], + _w_ = caml_ml_string_length(s) - 1 | 0; + if(_w_ >= 0){ + var i = _w_; + for(;;){ + if(caml_string_unsafe_get(s, i) === sep){ + var _y_ = r[1]; + r[1] = [0, sub(s, i + 1 | 0, (j[1] - i | 0) - 1 | 0), _y_]; + j[1] = i; + } + var _z_ = i - 1 | 0; + if(0 !== i){var i = _z_; continue;} + break; + } + } + var _x_ = r[1]; + return [0, sub(s, 0, j[1]), _x_]; + } + function uppercase(s){ + var _v_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[36], _v_)); + } + function lowercase(s){ + var _u_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[37], _u_)); + } + function capitalize(s){ + var _t_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[38], _t_)); + } + function uncapitalize(s){ + var _s_ = caml_call1(bos, s); + return caml_call1(bts, caml_call1(Stdlib_Bytes[39], _s_)); + } + var compare = runtime.caml_string_compare; + function to_seq(s){ + var _r_ = caml_call1(bos, s); + return caml_call1(Stdlib_Bytes[51], _r_); + } + function to_seqi(s){ + var _q_ = caml_call1(bos, s); + return caml_call1(Stdlib_Bytes[52], _q_); + } + function of_seq(g){ + return caml_call1(bts, caml_call1(Stdlib_Bytes[53], g)); + } + function get_utf_8_uchar(s, i){ + var _p_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[54], _p_, i); + } + function is_valid_utf_8(s){ + var _o_ = caml_call1(bos, s); + return caml_call1(Stdlib_Bytes[56], _o_); + } + function get_utf_16be_uchar(s, i){ + var _n_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[57], _n_, i); + } + function is_valid_utf_16be(s){ + var _m_ = caml_call1(bos, s); + return caml_call1(Stdlib_Bytes[59], _m_); + } + function get_utf_16le_uchar(s, i){ + var _l_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[60], _l_, i); + } + function is_valid_utf_16le(s){ + var _k_ = caml_call1(bos, s); + return caml_call1(Stdlib_Bytes[62], _k_); + } + function get_int8(s, i){ + var _j_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[64], _j_, i); + } + function get_uint16_le(s, i){ + var _i_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[67], _i_, i); + } + function get_uint16_be(s, i){ + var _h_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[66], _h_, i); + } + function get_int16_ne(s, i){ + var _g_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[68], _g_, i); + } + function get_int16_le(s, i){ + var _f_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[70], _f_, i); + } + function get_int16_be(s, i){ + var _e_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[69], _e_, i); + } + function get_int32_le(s, i){ + var _d_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[73], _d_, i); + } + function get_int32_be(s, i){ + var _c_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[72], _c_, i); + } + function get_int64_le(s, i){ + var _b_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[76], _b_, i); + } + function get_int64_be(s, i){ + var _a_ = caml_call1(bos, s); + return caml_call2(Stdlib_Bytes[75], _a_, i); + } + var + Stdlib_String = + [0, + make, + init, + empty, + of_bytes, + to_bytes, + concat, + cat, + caml_string_equal, + compare, + starts_with, + ends_with, + contains_from, + rcontains_from, + contains, + sub, + split_on_char, + map, + mapi, + fold_left, + fold_right, + for_all, + exists, + trim, + escaped, + uppercase_ascii, + lowercase_ascii, + capitalize_ascii, + uncapitalize_ascii, + iter, + iteri, + index_from, + index_from_opt, + rindex_from, + rindex_from_opt, + index, + index_opt, + rindex, + rindex_opt, + to_seq, + to_seqi, + of_seq, + get_utf_8_uchar, + is_valid_utf_8, + get_utf_16be_uchar, + is_valid_utf_16be, + get_utf_16le_uchar, + is_valid_utf_16le, + blit, + copy, + fill, + uppercase, + lowercase, + capitalize, + uncapitalize, + runtime.caml_string_get, + get_int8, + runtime.caml_string_get16, + get_uint16_be, + get_uint16_le, + get_int16_ne, + get_int16_be, + get_int16_le, + runtime.caml_string_get32, + get_int32_be, + get_int32_le, + runtime.caml_string_get64, + get_int64_be, + get_int64_le]; + runtime.caml_register_global(12, Stdlib_String, "Stdlib__String"); + return; + } + (globalThis)); + +//# 5558 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_array_sub = runtime.caml_array_sub, + caml_check_bound = runtime.caml_check_bound, + caml_make_vect = runtime.caml_make_vect, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Seq = global_data.Stdlib__Seq, + Assert_failure = global_data.Assert_failure, + Stdlib = global_data.Stdlib, + make_float = runtime.caml_make_float_vect, + Floatarray = [0], + _a_ = [0, "array.ml", 322, 4], + cst_Array_combine = "Array.combine", + cst_Array_exists2 = "Array.exists2", + cst_Array_for_all2 = "Array.for_all2", + cst_Array_map2_arrays_must_hav = + "Array.map2: arrays must have the same length", + cst_Array_iter2_arrays_must_ha = + "Array.iter2: arrays must have the same length", + cst_Array_blit = "Array.blit", + cst_Array_fill = "Array.fill", + cst_Array_sub = "Array.sub", + cst_Array_init = "Array.init", + cst_Stdlib_Array_Bottom = "Stdlib.Array.Bottom"; + function init(l, f){ + if(0 === l) return [0]; + if(0 > l) return caml_call1(Stdlib[1], cst_Array_init); + var res = caml_make_vect(l, caml_call1(f, 0)), _as_ = l - 1 | 0, _ar_ = 1; + if(_as_ >= 1){ + var i = _ar_; + for(;;){ + res[1 + i] = caml_call1(f, i); + var _at_ = i + 1 | 0; + if(_as_ !== i){var i = _at_; continue;} + break; + } + } + return res; + } + function make_matrix(sx, sy, init){ + var res = caml_make_vect(sx, [0]), _ap_ = sx - 1 | 0, _ao_ = 0; + if(_ap_ >= 0){ + var x = _ao_; + for(;;){ + res[1 + x] = caml_make_vect(sy, init); + var _aq_ = x + 1 | 0; + if(_ap_ !== x){var x = _aq_; continue;} + break; + } + } + return res; + } + function copy(a){ + var l = a.length - 1; + return 0 === l ? [0] : caml_array_sub(a, 0, l); + } + function append(a1, a2){ + var l1 = a1.length - 1; + return 0 === l1 + ? copy(a2) + : 0 + === a2.length - 1 + ? caml_array_sub(a1, 0, l1) + : runtime.caml_array_append(a1, a2); + } + function sub(a, ofs, len){ + if(0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs) + return caml_array_sub(a, ofs, len); + return caml_call1(Stdlib[1], cst_Array_sub); + } + function fill(a, ofs, len, v){ + if(0 <= ofs && 0 <= len && (a.length - 1 - len | 0) >= ofs) + return runtime.caml_array_fill(a, ofs, len, v); + return caml_call1(Stdlib[1], cst_Array_fill); + } + function blit(a1, ofs1, a2, ofs2, len){ + if + (0 <= len + && + 0 <= ofs1 + && + (a1.length - 1 - len | 0) >= ofs1 + && 0 <= ofs2 && (a2.length - 1 - len | 0) >= ofs2) + return runtime.caml_array_blit(a1, ofs1, a2, ofs2, len); + return caml_call1(Stdlib[1], cst_Array_blit); + } + function iter(f, a){ + var _am_ = a.length - 1 - 1 | 0, _al_ = 0; + if(_am_ >= 0){ + var i = _al_; + for(;;){ + caml_call1(f, a[1 + i]); + var _an_ = i + 1 | 0; + if(_am_ !== i){var i = _an_; continue;} + break; + } + } + return 0; + } + function iter2(f, a, b){ + if(a.length - 1 !== b.length - 1) + return caml_call1(Stdlib[1], cst_Array_iter2_arrays_must_ha); + var _aj_ = a.length - 1 - 1 | 0, _ai_ = 0; + if(_aj_ >= 0){ + var i = _ai_; + for(;;){ + caml_call2(f, a[1 + i], b[1 + i]); + var _ak_ = i + 1 | 0; + if(_aj_ !== i){var i = _ak_; continue;} + break; + } + } + return 0; + } + function map(f, a){ + var l = a.length - 1; + if(0 === l) return [0]; + var + r = caml_make_vect(l, caml_call1(f, a[1])), + _ag_ = l - 1 | 0, + _af_ = 1; + if(_ag_ >= 1){ + var i = _af_; + for(;;){ + r[1 + i] = caml_call1(f, a[1 + i]); + var _ah_ = i + 1 | 0; + if(_ag_ !== i){var i = _ah_; continue;} + break; + } + } + return r; + } + function map2(f, a, b){ + var la = a.length - 1, lb = b.length - 1; + if(la !== lb) + return caml_call1(Stdlib[1], cst_Array_map2_arrays_must_hav); + if(0 === la) return [0]; + var + r = caml_make_vect(la, caml_call2(f, a[1], b[1])), + _ad_ = la - 1 | 0, + _ac_ = 1; + if(_ad_ >= 1){ + var i = _ac_; + for(;;){ + r[1 + i] = caml_call2(f, a[1 + i], b[1 + i]); + var _ae_ = i + 1 | 0; + if(_ad_ !== i){var i = _ae_; continue;} + break; + } + } + return r; + } + function iteri(f, a){ + var _aa_ = a.length - 1 - 1 | 0, _$_ = 0; + if(_aa_ >= 0){ + var i = _$_; + for(;;){ + caml_call2(f, i, a[1 + i]); + var _ab_ = i + 1 | 0; + if(_aa_ !== i){var i = _ab_; continue;} + break; + } + } + return 0; + } + function mapi(f, a){ + var l = a.length - 1; + if(0 === l) return [0]; + var + r = caml_make_vect(l, caml_call2(f, 0, a[1])), + _Z_ = l - 1 | 0, + _Y_ = 1; + if(_Z_ >= 1){ + var i = _Y_; + for(;;){ + r[1 + i] = caml_call2(f, i, a[1 + i]); + var ___ = i + 1 | 0; + if(_Z_ !== i){var i = ___; continue;} + break; + } + } + return r; + } + function to_list(a){ + var i$1 = a.length - 1 - 1 | 0, i = i$1, res = 0; + for(;;){ + if(0 > i) return res; + var res$0 = [0, a[1 + i], res], i$0 = i - 1 | 0, i = i$0, res = res$0; + } + } + function list_length(accu, param){ + var accu$0 = accu, param$0 = param; + for(;;){ + if(! param$0) return accu$0; + var + t = param$0[2], + accu$1 = accu$0 + 1 | 0, + accu$0 = accu$1, + param$0 = t; + } + } + function of_list(l){ + if(! l) return [0]; + var + tl = l[2], + hd = l[1], + a = caml_make_vect(list_length(0, l), hd), + i = 1, + param = tl; + for(;;){ + if(! param) return a; + var tl$0 = param[2], hd$0 = param[1]; + a[1 + i] = hd$0; + var i$0 = i + 1 | 0, i = i$0, param = tl$0; + } + } + function fold_left(f, x, a){ + var r = [0, x], _W_ = a.length - 1 - 1 | 0, _V_ = 0; + if(_W_ >= 0){ + var i = _V_; + for(;;){ + r[1] = caml_call2(f, r[1], a[1 + i]); + var _X_ = i + 1 | 0; + if(_W_ !== i){var i = _X_; continue;} + break; + } + } + return r[1]; + } + function fold_left_map(f, acc, input_array){ + var len = input_array.length - 1; + if(0 === len) return [0, acc, [0]]; + var + match = caml_call2(f, acc, input_array[1]), + elt = match[2], + acc$0 = match[1], + output_array = caml_make_vect(len, elt), + acc$1 = [0, acc$0], + _T_ = len - 1 | 0, + _S_ = 1; + if(_T_ >= 1){ + var i = _S_; + for(;;){ + var + match$0 = caml_call2(f, acc$1[1], input_array[1 + i]), + elt$0 = match$0[2], + acc$2 = match$0[1]; + acc$1[1] = acc$2; + output_array[1 + i] = elt$0; + var _U_ = i + 1 | 0; + if(_T_ !== i){var i = _U_; continue;} + break; + } + } + return [0, acc$1[1], output_array]; + } + function fold_right(f, a, x){ + var r = [0, x], _Q_ = a.length - 1 - 1 | 0; + if(_Q_ >= 0){ + var i = _Q_; + for(;;){ + r[1] = caml_call2(f, a[1 + i], r[1]); + var _R_ = i - 1 | 0; + if(0 !== i){var i = _R_; continue;} + break; + } + } + return r[1]; + } + function exists(p, a){ + var n = a.length - 1, i = 0; + for(;;){ + if(i === n) return 0; + if(caml_call1(p, a[1 + i])) return 1; + var i$0 = i + 1 | 0, i = i$0; + } + } + function for_all(p, a){ + var n = a.length - 1, i = 0; + for(;;){ + if(i === n) return 1; + if(! caml_call1(p, a[1 + i])) return 0; + var i$0 = i + 1 | 0, i = i$0; + } + } + function for_all2(p, l1, l2){ + var n1 = l1.length - 1, n2 = l2.length - 1; + if(n1 !== n2) return caml_call1(Stdlib[1], cst_Array_for_all2); + var i = 0; + for(;;){ + if(i === n1) return 1; + if(! caml_call2(p, l1[1 + i], l2[1 + i])) return 0; + var i$0 = i + 1 | 0, i = i$0; + } + } + function exists2(p, l1, l2){ + var n1 = l1.length - 1, n2 = l2.length - 1; + if(n1 !== n2) return caml_call1(Stdlib[1], cst_Array_exists2); + var i = 0; + for(;;){ + if(i === n1) return 0; + if(caml_call2(p, l1[1 + i], l2[1 + i])) return 1; + var i$0 = i + 1 | 0, i = i$0; + } + } + function mem(x, a){ + var n = a.length - 1, i = 0; + for(;;){ + if(i === n) return 0; + if(0 === runtime.caml_compare(a[1 + i], x)) return 1; + var i$0 = i + 1 | 0, i = i$0; + } + } + function memq(x, a){ + var n = a.length - 1, i = 0; + for(;;){ + if(i === n) return 0; + if(x === a[1 + i]) return 1; + var i$0 = i + 1 | 0, i = i$0; + } + } + function find_opt(p, a){ + var n = a.length - 1, i = 0; + for(;;){ + if(i === n) return 0; + var x = a[1 + i]; + if(caml_call1(p, x)) return [0, x]; + var i$0 = i + 1 | 0, i = i$0; + } + } + function find_map(f, a){ + var n = a.length - 1, i = 0; + for(;;){ + if(i === n) return 0; + var r = caml_call1(f, a[1 + i]); + if(r) return r; + var i$0 = i + 1 | 0, i = i$0; + } + } + function split(x){ + if(runtime.caml_equal(x, [0])) return [0, [0], [0]]; + var + match = x[1], + b0 = match[2], + a0 = match[1], + n = x.length - 1, + a = caml_make_vect(n, a0), + b = caml_make_vect(n, b0), + _O_ = n - 1 | 0, + _N_ = 1; + if(_O_ >= 1){ + var i = _N_; + for(;;){ + var match$0 = x[1 + i], bi = match$0[2], ai = match$0[1]; + a[1 + i] = ai; + b[1 + i] = bi; + var _P_ = i + 1 | 0; + if(_O_ !== i){var i = _P_; continue;} + break; + } + } + return [0, a, b]; + } + function combine(a, b){ + var na = a.length - 1, nb = b.length - 1; + if(na !== nb) caml_call1(Stdlib[1], cst_Array_combine); + if(0 === na) return [0]; + var x = caml_make_vect(na, [0, a[1], b[1]]), _L_ = na - 1 | 0, _K_ = 1; + if(_L_ >= 1){ + var i = _K_; + for(;;){ + x[1 + i] = [0, a[1 + i], b[1 + i]]; + var _M_ = i + 1 | 0; + if(_L_ !== i){var i = _M_; continue;} + break; + } + } + return x; + } + var Bottom = [248, cst_Stdlib_Array_Bottom, runtime.caml_fresh_oo_id(0)]; + function sort(cmp, a){ + function maxson(l, i){ + var i31 = ((i + i | 0) + i | 0) + 1 | 0, x = [0, i31]; + if((i31 + 2 | 0) < l){ + var _D_ = i31 + 1 | 0, _E_ = caml_check_bound(a, _D_)[1 + _D_]; + if(caml_call2(cmp, caml_check_bound(a, i31)[1 + i31], _E_) < 0) + x[1] = i31 + 1 | 0; + var + _F_ = i31 + 2 | 0, + _G_ = caml_check_bound(a, _F_)[1 + _F_], + _H_ = x[1]; + if(caml_call2(cmp, caml_check_bound(a, _H_)[1 + _H_], _G_) < 0) + x[1] = i31 + 2 | 0; + return x[1]; + } + if((i31 + 1 | 0) < l){ + var _I_ = i31 + 1 | 0, _J_ = caml_check_bound(a, _I_)[1 + _I_]; + if(0 > caml_call2(cmp, caml_check_bound(a, i31)[1 + i31], _J_)) + return i31 + 1 | 0; + } + if(i31 < l) return i31; + throw caml_maybe_attach_backtrace([0, Bottom, i], 1); + } + var l = a.length - 1, _x_ = ((l + 1 | 0) / 3 | 0) - 1 | 0; + if(_x_ >= 0){ + var i$6 = _x_; + for(;;){ + var e$1 = caml_check_bound(a, i$6)[1 + i$6]; + try{ + var i = i$6; + for(;;){ + var j = maxson(l, i); + if(0 < caml_call2(cmp, caml_check_bound(a, j)[1 + j], e$1)){ + var _u_ = caml_check_bound(a, j)[1 + j]; + caml_check_bound(a, i)[1 + i] = _u_; + var i = j; + continue; + } + caml_check_bound(a, i)[1 + i] = e$1; + break; + } + } + catch(exn$0){ + var exn = caml_wrap_exception(exn$0); + if(exn[1] !== Bottom) throw caml_maybe_attach_backtrace(exn, 0); + var i$0 = exn[2]; + caml_check_bound(a, i$0)[1 + i$0] = e$1; + } + var _C_ = i$6 - 1 | 0; + if(0 !== i$6){var i$6 = _C_; continue;} + break; + } + } + var _y_ = l - 1 | 0; + if(_y_ >= 2){ + var i$4 = _y_; + a: + for(;;){ + var e$0 = caml_check_bound(a, i$4)[1 + i$4]; + a[1 + i$4] = caml_check_bound(a, 0)[1]; + var i$5 = 0; + try{ + var i$1 = i$5; + for(;;){ + var j$0 = maxson(i$4, i$1), _v_ = caml_check_bound(a, j$0)[1 + j$0]; + caml_check_bound(a, i$1)[1 + i$1] = _v_; + var i$1 = j$0; + } + } + catch(exn){ + var exn$0 = caml_wrap_exception(exn); + if(exn$0[1] !== Bottom) throw caml_maybe_attach_backtrace(exn$0, 0); + var i$2 = exn$0[2], i$3 = i$2; + for(;;){ + var father = (i$3 - 1 | 0) / 3 | 0; + if(i$3 === father) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + if(0 <= caml_call2(cmp, caml_check_bound(a, father)[1 + father], e$0)) + caml_check_bound(a, i$3)[1 + i$3] = e$0; + else{ + var _w_ = caml_check_bound(a, father)[1 + father]; + caml_check_bound(a, i$3)[1 + i$3] = _w_; + if(0 < father){var i$3 = father; continue;} + caml_check_bound(a, 0)[1] = e$0; + } + var _B_ = i$4 - 1 | 0; + if(2 !== i$4){var i$4 = _B_; continue a;} + break; + } + } + break; + } + } + var _z_ = 1 < l ? 1 : 0; + if(_z_){ + var e = caml_check_bound(a, 1)[2]; + a[2] = caml_check_bound(a, 0)[1]; + a[1] = e; + var _A_ = 0; + } + else + var _A_ = _z_; + return _A_; + } + function stable_sort(cmp, a){ + function merge(src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs){ + var + src1r = src1ofs + src1len | 0, + src2r = src2ofs + src2len | 0, + s2$1 = caml_check_bound(src2, src2ofs)[1 + src2ofs], + s1$1 = caml_check_bound(a, src1ofs)[1 + src1ofs], + i1 = src1ofs, + s1 = s1$1, + i2 = src2ofs, + s2 = s2$1, + d = dstofs; + for(;;){ + if(0 < caml_call2(cmp, s1, s2)){ + caml_check_bound(dst, d)[1 + d] = s2; + var i2$0 = i2 + 1 | 0; + if(i2$0 >= src2r) return blit(a, i1, dst, d + 1 | 0, src1r - i1 | 0); + var + d$0 = d + 1 | 0, + s2$0 = caml_check_bound(src2, i2$0)[1 + i2$0], + i2 = i2$0, + s2 = s2$0, + d = d$0; + continue; + } + caml_check_bound(dst, d)[1 + d] = s1; + var i1$0 = i1 + 1 | 0; + if(i1$0 >= src1r) return blit(src2, i2, dst, d + 1 | 0, src2r - i2 | 0); + var + d$1 = d + 1 | 0, + s1$0 = caml_check_bound(a, i1$0)[1 + i1$0], + i1 = i1$0, + s1 = s1$0, + d = d$1; + } + } + function isortto(srcofs, dst, dstofs, len){ + var _m_ = len - 1 | 0, _l_ = 0; + if(_m_ >= 0){ + var i = _l_; + a: + for(;;){ + var + _n_ = srcofs + i | 0, + e = caml_check_bound(a, _n_)[1 + _n_], + j = [0, (dstofs + i | 0) - 1 | 0]; + for(;;){ + if(dstofs <= j[1]){ + var _o_ = j[1]; + if(0 < caml_call2(cmp, caml_check_bound(dst, _o_)[1 + _o_], e)){ + var + _p_ = j[1], + _q_ = caml_check_bound(dst, _p_)[1 + _p_], + _r_ = j[1] + 1 | 0; + caml_check_bound(dst, _r_)[1 + _r_] = _q_; + j[1] += -1; + continue; + } + } + var _s_ = j[1] + 1 | 0; + caml_check_bound(dst, _s_)[1 + _s_] = e; + var _t_ = i + 1 | 0; + if(_m_ !== i){var i = _t_; continue a;} + break; + } + break; + } + } + return 0; + } + function sortto(srcofs, dst, dstofs, len){ + if(len <= 5) return isortto(srcofs, dst, dstofs, len); + var l1 = len / 2 | 0, l2 = len - l1 | 0; + sortto(srcofs + l1 | 0, dst, dstofs + l1 | 0, l2); + sortto(srcofs, a, srcofs + l2 | 0, l1); + return merge(srcofs + l2 | 0, l1, dst, dstofs + l1 | 0, l2, dst, dstofs); + } + var l = a.length - 1; + if(l <= 5) return isortto(0, a, 0, l); + var + l1 = l / 2 | 0, + l2 = l - l1 | 0, + t = caml_make_vect(l2, caml_check_bound(a, 0)[1]); + sortto(l1, t, 0, l2); + sortto(0, a, l2, l1); + return merge(l2, l1, t, 0, l2, a, 0); + } + function to_seq(a){ + function aux(i, param){ + if(i >= a.length - 1) return 0; + var x = a[1 + i], _j_ = i + 1 | 0; + return [0, x, function(_k_){return aux(_j_, _k_);}]; + } + var _h_ = 0; + return function(_i_){return aux(_h_, _i_);}; + } + function to_seqi(a){ + function aux(i, param){ + if(i >= a.length - 1) return 0; + var x = a[1 + i], _f_ = i + 1 | 0; + return [0, [0, i, x], function(_g_){return aux(_f_, _g_);}]; + } + var _d_ = 0; + return function(_e_){return aux(_d_, _e_);}; + } + function of_seq(i$2){ + var _b_ = 0; + function _c_(acc, x){return [0, x, acc];} + var l = caml_call3(Stdlib_Seq[5], _c_, _b_, i$2); + if(! l) return [0]; + var + tl = l[2], + hd = l[1], + len = list_length(0, l), + a = caml_make_vect(len, hd), + i$1 = len - 2 | 0, + i = i$1, + param = tl; + for(;;){ + if(! param) return a; + var tl$0 = param[2], hd$0 = param[1]; + a[1 + i] = hd$0; + var i$0 = i - 1 | 0, i = i$0, param = tl$0; + } + } + var + Stdlib_Array = + [0, + make_float, + init, + make_matrix, + make_matrix, + append, + runtime.caml_array_concat, + sub, + copy, + fill, + blit, + to_list, + of_list, + iter, + iteri, + map, + mapi, + fold_left, + fold_left_map, + fold_right, + iter2, + map2, + for_all, + exists, + for_all2, + exists2, + mem, + memq, + find_opt, + find_map, + split, + combine, + sort, + stable_sort, + stable_sort, + to_seq, + to_seqi, + of_seq, + Floatarray]; + runtime.caml_register_global(14, Stdlib_Array, "Stdlib__Array"); + return; + } + (globalThis)); + +//# 6998 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_greaterequal = runtime.caml_greaterequal, + caml_int_compare = runtime.caml_int_compare, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_mul = runtime.caml_mul, + caml_wrap_exception = runtime.caml_wrap_exception, + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Sys = global_data.Stdlib__Sys, + Assert_failure = global_data.Assert_failure, + _b_ = [0, "int32.ml", 69, 6], + zero = 0, + one = 1, + minus_one = -1; + function succ(n){return n + 1 | 0;} + function pred(n){return n - 1 | 0;} + function abs(n){return caml_greaterequal(n, 0) ? n : - n | 0;} + var min_int = -2147483648, max_int = 2147483647; + function lognot(n){return n ^ -1;} + var _a_ = Stdlib_Sys[9]; + if(32 === _a_) + var + max_int$0 = Stdlib[19], + unsigned_to_int = + function(n){ + if(0 >= caml_int_compare(0, n) && 0 >= caml_int_compare(n, max_int$0)) + return [0, n]; + return 0; + }; + else{ + if(64 !== _a_) + throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + var unsigned_to_int = function(n){return [0, n & -1];}; + } + function to_string(n){return runtime.caml_format_int("%d", n);} + function of_string_opt(s){ + try{var _d_ = [0, runtime.caml_int_of_string(s)]; return _d_;} + catch(_e_){ + var _c_ = caml_wrap_exception(_e_); + if(_c_[1] === Stdlib[7]) return 0; + throw caml_maybe_attach_backtrace(_c_, 0); + } + } + var compare = caml_int_compare; + function equal(x, y){return 0 === caml_int_compare(x, y) ? 1 : 0;} + function unsigned_compare(n, m){ + return caml_int_compare(n + 2147483648 | 0, m + 2147483648 | 0); + } + function min(x, y){return runtime.caml_lessequal(x, y) ? x : y;} + function max(x, y){return caml_greaterequal(x, y) ? x : y;} + function unsigned_div(n, d){ + if(runtime.caml_lessthan(d, 0)) + return 0 <= unsigned_compare(n, d) ? one : zero; + var q = runtime.caml_div(n >>> 1 | 0, d) << 1, r = n - caml_mul(q, d) | 0; + return 0 <= unsigned_compare(r, d) ? q + 1 | 0 : q; + } + function unsigned_rem(n, d){ + return n - caml_mul(unsigned_div(n, d), d) | 0; + } + var + Stdlib_Int32 = + [0, + zero, + one, + minus_one, + unsigned_div, + unsigned_rem, + succ, + pred, + abs, + max_int, + min_int, + lognot, + unsigned_to_int, + of_string_opt, + to_string, + compare, + unsigned_compare, + equal, + min, + max]; + runtime.caml_register_global(14, Stdlib_Int32, "Stdlib__Int32"); + return; + } + (globalThis)); + +//# 7090 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_greaterequal = runtime.caml_greaterequal, + caml_int64_compare = runtime.caml_int64_compare, + caml_int64_mul = runtime.caml_int64_mul, + caml_int64_sub = runtime.caml_int64_sub, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_wrap_exception = runtime.caml_wrap_exception, + global_data = runtime.caml_get_global_data(), + zero = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), + one = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), + minus_one = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 65535), + min_int = runtime.caml_int64_create_lo_mi_hi(0, 0, 32768), + max_int = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 32767), + Stdlib = global_data.Stdlib, + _d_ = runtime.caml_int64_create_lo_mi_hi(16777215, 16777215, 65535), + _c_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), + _b_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), + _a_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0); + function succ(n){return runtime.caml_int64_add(n, _a_);} + function pred(n){return caml_int64_sub(n, _b_);} + function abs(n){ + return caml_greaterequal(n, _c_) ? n : runtime.caml_int64_neg(n); + } + function lognot(n){return runtime.caml_int64_xor(n, _d_);} + var max_int$0 = runtime.caml_int64_of_int32(Stdlib[19]); + function unsigned_to_int(n){ + if + (0 >= caml_int64_compare(zero, n) + && 0 >= caml_int64_compare(n, max_int$0)) + return [0, runtime.caml_int64_to_int32(n)]; + return 0; + } + function to_string(n){return runtime.caml_int64_format("%d", n);} + function of_string_opt(s){ + try{var _f_ = [0, runtime.caml_int64_of_string(s)]; return _f_;} + catch(_g_){ + var _e_ = caml_wrap_exception(_g_); + if(_e_[1] === Stdlib[7]) return 0; + throw caml_maybe_attach_backtrace(_e_, 0); + } + } + function compare(x, y){return caml_int64_compare(x, y);} + function equal(x, y){return 0 === caml_int64_compare(x, y) ? 1 : 0;} + function unsigned_compare(n, m){ + return caml_int64_compare + (caml_int64_sub(n, min_int), caml_int64_sub(m, min_int)); + } + function min(x, y){return runtime.caml_lessequal(x, y) ? x : y;} + function max(x, y){return caml_greaterequal(x, y) ? x : y;} + function unsigned_div(n, d){ + if(runtime.caml_lessthan(d, zero)) + return 0 <= unsigned_compare(n, d) ? one : zero; + var + q = + runtime.caml_int64_shift_left + (runtime.caml_int64_div + (runtime.caml_int64_shift_right_unsigned(n, 1), d), + 1), + r = caml_int64_sub(n, caml_int64_mul(q, d)); + return 0 <= unsigned_compare(r, d) ? succ(q) : q; + } + function unsigned_rem(n, d){ + return caml_int64_sub(n, caml_int64_mul(unsigned_div(n, d), d)); + } + var + Stdlib_Int64 = + [0, + zero, + one, + minus_one, + unsigned_div, + unsigned_rem, + succ, + pred, + abs, + max_int, + min_int, + lognot, + unsigned_to_int, + of_string_opt, + to_string, + compare, + unsigned_compare, + equal, + min, + max]; + runtime.caml_register_global(11, Stdlib_Int64, "Stdlib__Int64"); + return; + } + (globalThis)); + +//# 7187 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_greaterequal = runtime.caml_greaterequal, + caml_int_compare = runtime.caml_int_compare, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_mul = runtime.caml_mul, + caml_wrap_exception = runtime.caml_wrap_exception, + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Sys = global_data.Stdlib__Sys, + zero = 0, + one = 1, + minus_one = -1; + function succ(n){return n + 1 | 0;} + function pred(n){return n - 1 | 0;} + function abs(n){return caml_greaterequal(n, 0) ? n : - n | 0;} + var + size = Stdlib_Sys[9], + min_int = 1 << (size - 1 | 0), + max_int = min_int - 1 | 0; + function lognot(n){return n ^ -1;} + var max_int$0 = Stdlib[19]; + function unsigned_to_int(n){ + if(0 >= caml_int_compare(0, n) && 0 >= caml_int_compare(n, max_int$0)) + return [0, n]; + return 0; + } + function to_string(n){return runtime.caml_format_int("%d", n);} + function of_string_opt(s){ + try{var _b_ = [0, runtime.caml_int_of_string(s)]; return _b_;} + catch(_c_){ + var _a_ = caml_wrap_exception(_c_); + if(_a_[1] === Stdlib[7]) return 0; + throw caml_maybe_attach_backtrace(_a_, 0); + } + } + var compare = caml_int_compare; + function equal(x, y){return 0 === caml_int_compare(x, y) ? 1 : 0;} + function unsigned_compare(n, m){ + return caml_int_compare(n - min_int | 0, m - min_int | 0); + } + function min(x, y){return runtime.caml_lessequal(x, y) ? x : y;} + function max(x, y){return caml_greaterequal(x, y) ? x : y;} + function unsigned_div(n, d){ + if(runtime.caml_lessthan(d, 0)) + return 0 <= unsigned_compare(n, d) ? one : zero; + var q = runtime.caml_div(n >>> 1 | 0, d) << 1, r = n - caml_mul(q, d) | 0; + return 0 <= unsigned_compare(r, d) ? q + 1 | 0 : q; + } + function unsigned_rem(n, d){ + return n - caml_mul(unsigned_div(n, d), d) | 0; + } + var + Stdlib_Nativeint = + [0, + zero, + one, + minus_one, + unsigned_div, + unsigned_rem, + succ, + pred, + abs, + size, + max_int, + min_int, + lognot, + unsigned_to_int, + of_string_opt, + to_string, + compare, + unsigned_compare, + equal, + min, + max]; + runtime.caml_register_global(12, Stdlib_Nativeint, "Stdlib__Nativeint"); + return; + } + (globalThis)); + +//# 8572 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_Map_bal$3 = "Map.bal", + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Assert_failure = global_data.Assert_failure, + Stdlib_Seq = global_data.Stdlib__Seq, + cst_Map_remove_min_elt = "Map.remove_min_elt", + _a_ = [0, 0, 0, 0], + _b_ = [0, "map.ml", 400, 10], + _c_ = [0, 0, 0], + cst_Map_bal = cst_Map_bal$3, + cst_Map_bal$0 = cst_Map_bal$3, + cst_Map_bal$1 = cst_Map_bal$3, + cst_Map_bal$2 = cst_Map_bal$3, + Stdlib_Map = + [0, + function(Ord){ + function height(param){ + if(! param) return 0; + var h = param[5]; + return h; + } + function create(l, x, d, r){ + var + hl = height(l), + hr = height(r), + _L_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + return [0, l, x, d, r, _L_]; + } + function singleton(x, d){return [0, 0, x, d, 0, 1];} + function bal(l, x, d, r){ + if(l) var h = l[5], hl = h; else var hl = 0; + if(r) var h$0 = r[5], hr = h$0; else var hr = 0; + if((hr + 2 | 0) < hl){ + if(! l) return caml_call1(Stdlib[1], cst_Map_bal$0); + var lr = l[4], ld = l[3], lv = l[2], ll = l[1], _G_ = height(lr); + if(_G_ <= height(ll)) + return create(ll, lv, ld, create(lr, x, d, r)); + if(! lr) return caml_call1(Stdlib[1], cst_Map_bal); + var + lrr = lr[4], + lrd = lr[3], + lrv = lr[2], + lrl = lr[1], + _H_ = create(lrr, x, d, r); + return create(create(ll, lv, ld, lrl), lrv, lrd, _H_); + } + if((hl + 2 | 0) >= hr){ + var _K_ = hr <= hl ? hl + 1 | 0 : hr + 1 | 0; + return [0, l, x, d, r, _K_]; + } + if(! r) return caml_call1(Stdlib[1], cst_Map_bal$2); + var rr = r[4], rd = r[3], rv = r[2], rl = r[1], _I_ = height(rl); + if(_I_ <= height(rr)) return create(create(l, x, d, rl), rv, rd, rr); + if(! rl) return caml_call1(Stdlib[1], cst_Map_bal$1); + var + rlr = rl[4], + rld = rl[3], + rlv = rl[2], + rll = rl[1], + _J_ = create(rlr, rv, rd, rr); + return create(create(l, x, d, rll), rlv, rld, _J_); + } + var empty = 0; + function is_empty(param){return param ? 0 : 1;} + function add(x, data, m){ + if(! m) return [0, 0, x, data, 0, 1]; + var + h = m[5], + r = m[4], + d = m[3], + v = m[2], + l = m[1], + c = caml_call2(Ord[1], x, v); + if(0 === c) return d === data ? m : [0, l, x, data, r, h]; + if(0 <= c){ + var rr = add(x, data, r); + return r === rr ? m : bal(l, v, d, rr); + } + var ll = add(x, data, l); + return l === ll ? m : bal(ll, v, d, r); + } + function find(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + r = param$0[4], + d = param$0[3], + v = param$0[2], + l = param$0[1], + c = caml_call2(Ord[1], x, v); + if(0 === c) return d; + var r$0 = 0 <= c ? r : l, param$0 = r$0; + } + } + function find_first(f, param$0){ + var param$1 = param$0; + for(;;){ + if(! param$1) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + r$0 = param$1[4], + d0$1 = param$1[3], + v0$1 = param$1[2], + l$0 = param$1[1]; + if(! caml_call1(f, v0$1)){var param$1 = r$0; continue;} + var v0 = v0$1, d0 = d0$1, param = l$0; + for(;;){ + if(! param) return [0, v0, d0]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + if(caml_call1(f, v0$0)){ + var v0 = v0$0, d0 = d0$0, param = l; + continue; + } + var param = r; + } + } + } + function find_first_opt(f, param$0){ + var param$1 = param$0; + for(;;){ + if(! param$1) return 0; + var + r$0 = param$1[4], + d0$1 = param$1[3], + v0$1 = param$1[2], + l$0 = param$1[1]; + if(! caml_call1(f, v0$1)){var param$1 = r$0; continue;} + var v0 = v0$1, d0 = d0$1, param = l$0; + for(;;){ + if(! param) return [0, [0, v0, d0]]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + if(caml_call1(f, v0$0)){ + var v0 = v0$0, d0 = d0$0, param = l; + continue; + } + var param = r; + } + } + } + function find_last(f, param$0){ + var param$1 = param$0; + for(;;){ + if(! param$1) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + r$0 = param$1[4], + d0$1 = param$1[3], + v0$1 = param$1[2], + l$0 = param$1[1]; + if(! caml_call1(f, v0$1)){var param$1 = l$0; continue;} + var v0 = v0$1, d0 = d0$1, param = r$0; + for(;;){ + if(! param) return [0, v0, d0]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + if(caml_call1(f, v0$0)){ + var v0 = v0$0, d0 = d0$0, param = r; + continue; + } + var param = l; + } + } + } + function find_last_opt(f, param$0){ + var param$1 = param$0; + for(;;){ + if(! param$1) return 0; + var + r$0 = param$1[4], + d0$1 = param$1[3], + v0$1 = param$1[2], + l$0 = param$1[1]; + if(! caml_call1(f, v0$1)){var param$1 = l$0; continue;} + var v0 = v0$1, d0 = d0$1, param = r$0; + for(;;){ + if(! param) return [0, [0, v0, d0]]; + var r = param[4], d0$0 = param[3], v0$0 = param[2], l = param[1]; + if(caml_call1(f, v0$0)){ + var v0 = v0$0, d0 = d0$0, param = r; + continue; + } + var param = l; + } + } + } + function find_opt(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var + r = param$0[4], + d = param$0[3], + v = param$0[2], + l = param$0[1], + c = caml_call2(Ord[1], x, v); + if(0 === c) return [0, d]; + var r$0 = 0 <= c ? r : l, param$0 = r$0; + } + } + function mem(x, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var + r = param$0[4], + v = param$0[2], + l = param$0[1], + c = caml_call2(Ord[1], x, v), + _F_ = 0 === c ? 1 : 0; + if(_F_) return _F_; + var r$0 = 0 <= c ? r : l, param$0 = r$0; + } + } + function min_binding(param){ + var param$0 = param; + for(;;){ + if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var l = param$0[1]; + if(l){var param$0 = l; continue;} + var d = param$0[3], v = param$0[2]; + return [0, v, d]; + } + } + function min_binding_opt(param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[1]; + if(l){var param$0 = l; continue;} + var d = param$0[3], v = param$0[2]; + return [0, [0, v, d]]; + } + } + function max_binding(param){ + var param$0 = param; + for(;;){ + if(! param$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(param$0[4]){var r = param$0[4], param$0 = r; continue;} + var d = param$0[3], v = param$0[2]; + return [0, v, d]; + } + } + function max_binding_opt(param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + if(param$0[4]){var r = param$0[4], param$0 = r; continue;} + var d = param$0[3], v = param$0[2]; + return [0, [0, v, d]]; + } + } + function remove_min_binding(param){ + if(! param) return caml_call1(Stdlib[1], cst_Map_remove_min_elt); + var l = param[1]; + if(l){ + var r = param[4], d = param[3], v = param[2]; + return bal(remove_min_binding(l), v, d, r); + } + var r$0 = param[4]; + return r$0; + } + function _d_(t1, t2){ + if(! t1) return t2; + if(! t2) return t1; + var match = min_binding(t2), d = match[2], x = match[1]; + return bal(t1, x, d, remove_min_binding(t2)); + } + function remove(x, m){ + if(! m) return 0; + var + r = m[4], + d = m[3], + v = m[2], + l = m[1], + c = caml_call2(Ord[1], x, v); + if(0 === c) return _d_(l, r); + if(0 <= c){ + var rr = remove(x, r); + return r === rr ? m : bal(l, v, d, rr); + } + var ll = remove(x, l); + return l === ll ? m : bal(ll, v, d, r); + } + function update(x, f, m){ + if(! m){ + var match$0 = caml_call1(f, 0); + if(! match$0) return 0; + var data$0 = match$0[1]; + return [0, 0, x, data$0, 0, 1]; + } + var + h = m[5], + r = m[4], + d = m[3], + v = m[2], + l = m[1], + c = caml_call2(Ord[1], x, v); + if(0 === c){ + var match = caml_call1(f, [0, d]); + if(! match) return _d_(l, r); + var data = match[1]; + return d === data ? m : [0, l, x, data, r, h]; + } + if(0 <= c){ + var rr = update(x, f, r); + return r === rr ? m : bal(l, v, d, rr); + } + var ll = update(x, f, l); + return l === ll ? m : bal(ll, v, d, r); + } + function iter(f, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var r = param$0[4], d = param$0[3], v = param$0[2], l = param$0[1]; + iter(f, l); + caml_call2(f, v, d); + var param$0 = r; + } + } + function map(f, param){ + if(! param) return 0; + var + h = param[5], + r = param[4], + d = param[3], + v = param[2], + l = param[1], + l$0 = map(f, l), + d$0 = caml_call1(f, d), + r$0 = map(f, r); + return [0, l$0, v, d$0, r$0, h]; + } + function mapi(f, param){ + if(! param) return 0; + var + h = param[5], + r = param[4], + d = param[3], + v = param[2], + l = param[1], + l$0 = mapi(f, l), + d$0 = caml_call2(f, v, d), + r$0 = mapi(f, r); + return [0, l$0, v, d$0, r$0, h]; + } + function fold(f, m, accu){ + var m$0 = m, accu$0 = accu; + for(;;){ + if(! m$0) return accu$0; + var + r = m$0[4], + d = m$0[3], + v = m$0[2], + l = m$0[1], + accu$1 = caml_call3(f, v, d, fold(f, l, accu$0)), + m$0 = r, + accu$0 = accu$1; + } + } + function for_all(p, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 1; + var + r = param$0[4], + d = param$0[3], + v = param$0[2], + l = param$0[1], + _C_ = caml_call2(p, v, d); + if(_C_){ + var _D_ = for_all(p, l); + if(_D_){var param$0 = r; continue;} + var _E_ = _D_; + } + else + var _E_ = _C_; + return _E_; + } + } + function exists(p, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var + r = param$0[4], + d = param$0[3], + v = param$0[2], + l = param$0[1], + _z_ = caml_call2(p, v, d); + if(_z_) + var _A_ = _z_; + else{ + var _B_ = exists(p, l); + if(! _B_){var param$0 = r; continue;} + var _A_ = _B_; + } + return _A_; + } + } + function add_min_binding(k, x, param){ + if(! param) return singleton(k, x); + var r = param[4], d = param[3], v = param[2], l = param[1]; + return bal(add_min_binding(k, x, l), v, d, r); + } + function add_max_binding(k, x, param){ + if(! param) return singleton(k, x); + var r = param[4], d = param[3], v = param[2], l = param[1]; + return bal(l, v, d, add_max_binding(k, x, r)); + } + function join(l, v, d, r){ + if(! l) return add_min_binding(v, d, r); + if(! r) return add_max_binding(v, d, l); + var + rh = r[5], + rr = r[4], + rd = r[3], + rv = r[2], + rl = r[1], + lh = l[5], + lr = l[4], + ld = l[3], + lv = l[2], + ll = l[1]; + return (rh + 2 | 0) < lh + ? bal(ll, lv, ld, join(lr, v, d, r)) + : (lh + + 2 + | 0) + < rh + ? bal(join(l, v, d, rl), rv, rd, rr) + : create(l, v, d, r); + } + function concat(t1, t2){ + if(! t1) return t2; + if(! t2) return t1; + var match = min_binding(t2), d = match[2], x = match[1]; + return join(t1, x, d, remove_min_binding(t2)); + } + function concat_or_join(t1, v, d, t2){ + if(! d) return concat(t1, t2); + var d$0 = d[1]; + return join(t1, v, d$0, t2); + } + function split(x, param){ + if(! param) return _a_; + var + r = param[4], + d = param[3], + v = param[2], + l = param[1], + c = caml_call2(Ord[1], x, v); + if(0 === c) return [0, l, [0, d], r]; + if(0 <= c){ + var + match = split(x, r), + rr = match[3], + pres = match[2], + lr = match[1]; + return [0, join(l, v, d, lr), pres, rr]; + } + var + match$0 = split(x, l), + rl = match$0[3], + pres$0 = match$0[2], + ll = match$0[1]; + return [0, ll, pres$0, join(rl, v, d, r)]; + } + function merge(f, s1, s2){ + if(s1){ + var h1 = s1[5], r1 = s1[4], d1 = s1[3], v1 = s1[2], l1 = s1[1]; + if(height(s2) <= h1){ + var + match = split(v1, s2), + r2 = match[3], + d2 = match[2], + l2 = match[1], + _v_ = merge(f, r1, r2), + _w_ = caml_call3(f, v1, [0, d1], d2); + return concat_or_join(merge(f, l1, l2), v1, _w_, _v_); + } + } + else if(! s2) return 0; + if(! s2) + throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + var + r2$0 = s2[4], + d2$0 = s2[3], + v2 = s2[2], + l2$0 = s2[1], + match$0 = split(v2, s1), + r1$0 = match$0[3], + d1$0 = match$0[2], + l1$0 = match$0[1], + _x_ = merge(f, r1$0, r2$0), + _y_ = caml_call3(f, v2, d1$0, [0, d2$0]); + return concat_or_join(merge(f, l1$0, l2$0), v2, _y_, _x_); + } + function union(f, s1, s2){ + if(s1){ + if(s2){ + var + h2 = s2[5], + r2 = s2[4], + d2 = s2[3], + v2 = s2[2], + l2 = s2[1], + h1 = s1[5], + r1 = s1[4], + d1 = s1[3], + v1 = s1[2], + l1 = s1[1]; + if(h2 <= h1){ + var + match = split(v1, s2), + r2$0 = match[3], + d2$0 = match[2], + l2$0 = match[1], + l = union(f, l1, l2$0), + r = union(f, r1, r2$0); + if(! d2$0) return join(l, v1, d1, r); + var d2$1 = d2$0[1]; + return concat_or_join(l, v1, caml_call3(f, v1, d1, d2$1), r); + } + var + match$0 = split(v2, s1), + r1$0 = match$0[3], + d1$0 = match$0[2], + l1$0 = match$0[1], + l$0 = union(f, l1$0, l2), + r$0 = union(f, r1$0, r2); + if(! d1$0) return join(l$0, v2, d2, r$0); + var d1$1 = d1$0[1]; + return concat_or_join(l$0, v2, caml_call3(f, v2, d1$1, d2), r$0); + } + var s = s1; + } + else + var s = s2; + return s; + } + function filter(p, m){ + if(! m) return 0; + var + r = m[4], + d = m[3], + v = m[2], + l = m[1], + l$0 = filter(p, l), + pvd = caml_call2(p, v, d), + r$0 = filter(p, r); + if(! pvd) return concat(l$0, r$0); + if(l === l$0 && r === r$0) return m; + return join(l$0, v, d, r$0); + } + function filter_map(f, param){ + if(! param) return 0; + var + r = param[4], + d = param[3], + v = param[2], + l = param[1], + l$0 = filter_map(f, l), + fvd = caml_call2(f, v, d), + r$0 = filter_map(f, r); + if(! fvd) return concat(l$0, r$0); + var d$0 = fvd[1]; + return join(l$0, v, d$0, r$0); + } + function partition(p, param){ + if(! param) return _c_; + var + r = param[4], + d = param[3], + v = param[2], + l = param[1], + match = partition(p, l), + lf = match[2], + lt = match[1], + pvd = caml_call2(p, v, d), + match$0 = partition(p, r), + rf = match$0[2], + rt = match$0[1]; + if(pvd){ + var _t_ = concat(lf, rf); + return [0, join(lt, v, d, rt), _t_]; + } + var _u_ = join(lf, v, d, rf); + return [0, concat(lt, rt), _u_]; + } + function cons_enum(m, e){ + var m$0 = m, e$0 = e; + for(;;){ + if(! m$0) return e$0; + var + r = m$0[4], + d = m$0[3], + v = m$0[2], + l = m$0[1], + e$1 = [0, v, d, r, e$0], + m$0 = l, + e$0 = e$1; + } + } + function compare(cmp, m1, m2){ + var + e2$2 = cons_enum(m2, 0), + e1$2 = cons_enum(m1, 0), + e1 = e1$2, + e2 = e2$2; + for(;;){ + if(! e1) return e2 ? -1 : 0; + if(! e2) return 1; + var + e2$0 = e2[4], + r2 = e2[3], + d2 = e2[2], + v2 = e2[1], + e1$0 = e1[4], + r1 = e1[3], + d1 = e1[2], + v1 = e1[1], + c = caml_call2(Ord[1], v1, v2); + if(0 !== c) return c; + var c$0 = caml_call2(cmp, d1, d2); + if(0 !== c$0) return c$0; + var + e2$1 = cons_enum(r2, e2$0), + e1$1 = cons_enum(r1, e1$0), + e1 = e1$1, + e2 = e2$1; + } + } + function equal(cmp, m1, m2){ + var + e2$2 = cons_enum(m2, 0), + e1$2 = cons_enum(m1, 0), + e1 = e1$2, + e2 = e2$2; + for(;;){ + if(! e1) return e2 ? 0 : 1; + if(! e2) return 0; + var + e2$0 = e2[4], + r2 = e2[3], + d2 = e2[2], + v2 = e2[1], + e1$0 = e1[4], + r1 = e1[3], + d1 = e1[2], + v1 = e1[1], + _q_ = 0 === caml_call2(Ord[1], v1, v2) ? 1 : 0; + if(_q_){ + var _r_ = caml_call2(cmp, d1, d2); + if(_r_){ + var + e2$1 = cons_enum(r2, e2$0), + e1$1 = cons_enum(r1, e1$0), + e1 = e1$1, + e2 = e2$1; + continue; + } + var _s_ = _r_; + } + else + var _s_ = _q_; + return _s_; + } + } + function cardinal(param){ + if(! param) return 0; + var r = param[4], l = param[1], _p_ = cardinal(r); + return (cardinal(l) + 1 | 0) + _p_ | 0; + } + function bindings_aux(accu, param){ + var accu$0 = accu, param$0 = param; + for(;;){ + if(! param$0) return accu$0; + var + r = param$0[4], + d = param$0[3], + v = param$0[2], + l = param$0[1], + accu$1 = [0, [0, v, d], bindings_aux(accu$0, r)], + accu$0 = accu$1, + param$0 = l; + } + } + function bindings(s){return bindings_aux(0, s);} + function add_seq(i, m){ + function _o_(m, param){ + var v = param[2], k = param[1]; + return add(k, v, m); + } + return caml_call3(Stdlib_Seq[5], _o_, m, i); + } + function of_seq(i){return add_seq(i, empty);} + function seq_of_enum(c, param){ + if(! c) return 0; + var + rest = c[4], + t = c[3], + v = c[2], + k = c[1], + _m_ = cons_enum(t, rest); + return [0, [0, k, v], function(_n_){return seq_of_enum(_m_, _n_);}]; + } + function to_seq(m){ + var _k_ = cons_enum(m, 0); + return function(_l_){return seq_of_enum(_k_, _l_);}; + } + function snoc_enum(s, e){ + var s$0 = s, e$0 = e; + for(;;){ + if(! s$0) return e$0; + var + r = s$0[4], + d = s$0[3], + v = s$0[2], + l = s$0[1], + e$1 = [0, v, d, l, e$0], + s$0 = r, + e$0 = e$1; + } + } + function rev_seq_of_enum(c, param){ + if(! c) return 0; + var + rest = c[4], + t = c[3], + v = c[2], + k = c[1], + _i_ = snoc_enum(t, rest); + return [0, + [0, k, v], + function(_j_){return rev_seq_of_enum(_i_, _j_);}]; + } + function to_rev_seq(c){ + var _g_ = snoc_enum(c, 0); + return function(_h_){return rev_seq_of_enum(_g_, _h_);}; + } + function to_seq_from(low, m){ + var m$0 = m, c = 0; + for(;;){ + if(m$0){ + var + r = m$0[4], + d = m$0[3], + v = m$0[2], + l = m$0[1], + n = caml_call2(Ord[1], v, low); + if(0 !== n){ + if(0 <= n){var c$0 = [0, v, d, r, c], m$0 = l, c = c$0; continue;} + var m$0 = r; + continue; + } + var _e_ = [0, v, d, r, c]; + } + else + var _e_ = c; + return function(_f_){return seq_of_enum(_e_, _f_);}; + } + } + return [0, + empty, + is_empty, + mem, + add, + update, + singleton, + remove, + merge, + union, + compare, + equal, + iter, + fold, + for_all, + exists, + filter, + filter_map, + partition, + cardinal, + bindings, + min_binding, + min_binding_opt, + max_binding, + max_binding_opt, + min_binding, + min_binding_opt, + split, + find, + find_opt, + find_first, + find_first_opt, + find_last, + find_last_opt, + map, + mapi, + to_seq, + to_rev_seq, + to_seq_from, + add_seq, + of_seq]; + }]; + runtime.caml_register_global(11, Stdlib_Map, "Stdlib__Map"); + return; + } + (globalThis)); + +//# 9404 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib_List = global_data.Stdlib__List, + Empty = [248, "Stdlib.Stack.Empty", runtime.caml_fresh_oo_id(0)]; + function create(param){return [0, 0, 0];} + function clear(s){s[1] = 0; s[2] = 0; return 0;} + function copy(s){return [0, s[1], s[2]];} + function push(x, s){s[1] = [0, x, s[1]]; s[2] = s[2] + 1 | 0; return 0;} + function pop(s){ + var match = s[1]; + if(! match) throw caml_maybe_attach_backtrace(Empty, 1); + var tl = match[2], hd = match[1]; + s[1] = tl; + s[2] = s[2] - 1 | 0; + return hd; + } + function pop_opt(s){ + var match = s[1]; + if(! match) return 0; + var tl = match[2], hd = match[1]; + s[1] = tl; + s[2] = s[2] - 1 | 0; + return [0, hd]; + } + function top(s){ + var match = s[1]; + if(! match) throw caml_maybe_attach_backtrace(Empty, 1); + var hd = match[1]; + return hd; + } + function top_opt(s){ + var match = s[1]; + if(! match) return 0; + var hd = match[1]; + return [0, hd]; + } + function is_empty(s){return 0 === s[1] ? 1 : 0;} + function length(s){return s[2];} + function iter(f, s){return caml_call2(Stdlib_List[17], f, s[1]);} + function fold(f, acc, s){return caml_call3(Stdlib_List[25], f, acc, s[1]);} + function to_seq(s){return caml_call1(Stdlib_List[61], s[1]);} + function add_seq(q, i){ + function _a_(x){return push(x, q);} + return caml_call2(Stdlib_Seq[4], _a_, i); + } + function of_seq(g){var s = create(0); add_seq(s, g); return s;} + var + Stdlib_Stack = + [0, + Empty, + create, + push, + pop, + pop_opt, + top, + top_opt, + clear, + copy, + is_empty, + length, + iter, + fold, + to_seq, + add_seq, + of_seq]; + runtime.caml_register_global(3, Stdlib_Stack, "Stdlib__Stack"); + return; + } + (globalThis)); + +//# 9498 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Seq = global_data.Stdlib__Seq, + Empty = [248, "Stdlib.Queue.Empty", runtime.caml_fresh_oo_id(0)]; + function create(param){return [0, 0, 0, 0];} + function clear(q){q[1] = 0; q[2] = 0; q[3] = 0; return 0;} + function add(x, q){ + var cell = [0, x, 0], match = q[3]; + return match + ? (q[1] = q[1] + 1 | 0, match[2] = cell, q[3] = cell, 0) + : (q[1] = 1, q[2] = cell, q[3] = cell, 0); + } + function peek(q){ + var match = q[2]; + if(! match) throw caml_maybe_attach_backtrace(Empty, 1); + var content = match[1]; + return content; + } + function peek_opt(q){ + var match = q[2]; + if(! match) return 0; + var content = match[1]; + return [0, content]; + } + function take(q){ + var _g_ = q[2]; + if(! _g_) throw caml_maybe_attach_backtrace(Empty, 1); + var content = _g_[1]; + if(_g_[2]){ + var next = _g_[2]; + q[1] = q[1] - 1 | 0; + q[2] = next; + return content; + } + clear(q); + return content; + } + function take_opt(q){ + var _f_ = q[2]; + if(! _f_) return 0; + var content = _f_[1]; + if(_f_[2]){ + var next = _f_[2]; + q[1] = q[1] - 1 | 0; + q[2] = next; + return [0, content]; + } + clear(q); + return [0, content]; + } + function copy(q){ + var cell$0 = q[2], q_res = [0, q[1], 0, 0], prev = 0, cell = cell$0; + for(;;){ + if(! cell){q_res[3] = prev; return q_res;} + var content = cell[1], next = cell[2], prev$0 = [0, content, 0]; + if(prev) prev[2] = prev$0; else q_res[2] = prev$0; + var prev = prev$0, cell = next; + } + } + function is_empty(q){return 0 === q[1] ? 1 : 0;} + function length(q){return q[1];} + function iter(f, q){ + var cell$0 = q[2], cell = cell$0; + for(;;){ + if(! cell) return 0; + var content = cell[1], next = cell[2]; + caml_call1(f, content); + var cell = next; + } + } + function fold(f, accu$1, q){ + var cell$0 = q[2], accu = accu$1, cell = cell$0; + for(;;){ + if(! cell) return accu; + var + content = cell[1], + next = cell[2], + accu$0 = caml_call2(f, accu, content), + accu = accu$0, + cell = next; + } + } + function transfer(q1, q2){ + var _e_ = 0 < q1[1] ? 1 : 0; + if(! _e_) return _e_; + var match = q2[3]; + return match + ? (q2 + [1] + = q2[1] + q1[1] | 0, + match[2] = q1[2], + q2[3] = q1[3], + clear(q1)) + : (q2[1] = q1[1], q2[2] = q1[2], q2[3] = q1[3], clear(q1)); + } + function to_seq(q){ + function aux(c, param){ + if(! c) return 0; + var x = c[1], next = c[2]; + return [0, x, function(_d_){return aux(next, _d_);}]; + } + var _b_ = q[2]; + return function(_c_){return aux(_b_, _c_);}; + } + function add_seq(q, i){ + function _a_(x){return add(x, q);} + return caml_call2(Stdlib_Seq[4], _a_, i); + } + function of_seq(g){var q = create(0); add_seq(q, g); return q;} + var + Stdlib_Queue = + [0, + Empty, + create, + add, + add, + take, + take_opt, + take, + peek, + peek_opt, + peek, + clear, + copy, + is_empty, + length, + iter, + fold, + transfer, + to_seq, + add_seq, + of_seq]; + runtime.caml_register_global(2, Stdlib_Queue, "Stdlib__Queue"); + return; + } + (globalThis)); + +//# 10019 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_buffer_ml = "buffer.ml", + caml_blit_string = runtime.caml_blit_string, + caml_bswap16 = runtime.caml_bswap16, + caml_bytes_unsafe_get = runtime.caml_bytes_unsafe_get, + caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, + caml_create_bytes = runtime.caml_create_bytes, + caml_int32_bswap = runtime.caml_int32_bswap, + caml_int64_bswap = runtime.caml_int64_bswap, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_bytes_length = runtime.caml_ml_bytes_length, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_get = runtime.caml_string_get; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); + } + function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Bytes = global_data.Stdlib__Bytes, + Stdlib_Sys = global_data.Stdlib__Sys, + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib = global_data.Stdlib, + Stdlib_String = global_data.Stdlib__String, + Assert_failure = global_data.Assert_failure, + cst_Buffer_truncate = "Buffer.truncate", + _d_ = [0, cst_buffer_ml, 231, 9], + cst_Buffer_add_channel = "Buffer.add_channel", + _c_ = [0, cst_buffer_ml, 212, 2], + cst_Buffer_add_substring_add_s = "Buffer.add_substring/add_subbytes", + cst_Buffer_add_cannot_grow_buf = "Buffer.add: cannot grow buffer", + _b_ = [0, cst_buffer_ml, 93, 2], + _a_ = [0, cst_buffer_ml, 94, 2], + cst_Buffer_nth = "Buffer.nth", + cst_Buffer_blit = "Buffer.blit", + cst_Buffer_sub = "Buffer.sub"; + function create(n){ + var + n$0 = 1 <= n ? n : 1, + n$1 = Stdlib_Sys[12] < n$0 ? Stdlib_Sys[12] : n$0, + s = caml_create_bytes(n$1); + return [0, s, 0, n$1, s]; + } + function contents(b){return caml_call3(Stdlib_Bytes[8], b[1], 0, b[2]);} + function to_bytes(b){return caml_call3(Stdlib_Bytes[7], b[1], 0, b[2]);} + function sub(b, ofs, len){ + if(0 <= ofs && 0 <= len && (b[2] - len | 0) >= ofs) + return caml_call3(Stdlib_Bytes[8], b[1], ofs, len); + return caml_call1(Stdlib[1], cst_Buffer_sub); + } + function blit(src, srcoff, dst, dstoff, len){ + if + (0 <= len + && + 0 <= srcoff + && + (src[2] - len | 0) >= srcoff + && 0 <= dstoff && (caml_ml_bytes_length(dst) - len | 0) >= dstoff) + return runtime.caml_blit_bytes(src[1], srcoff, dst, dstoff, len); + return caml_call1(Stdlib[1], cst_Buffer_blit); + } + function nth(b, ofs){ + if(0 <= ofs && b[2] > ofs) return caml_bytes_unsafe_get(b[1], ofs); + return caml_call1(Stdlib[1], cst_Buffer_nth); + } + function length(b){return b[2];} + function clear(b){b[2] = 0; return 0;} + function reset(b){ + b[2] = 0; + b[1] = b[4]; + b[3] = caml_ml_bytes_length(b[1]); + return 0; + } + function resize(b, more){ + var old_pos = b[2], old_len = b[3], new_len = [0, old_len]; + for(;;){ + if(new_len[1] < (old_pos + more | 0)){ + new_len[1] = 2 * new_len[1] | 0; + continue; + } + if(Stdlib_Sys[12] < new_len[1]) + if((old_pos + more | 0) <= Stdlib_Sys[12]) + new_len[1] = Stdlib_Sys[12]; + else + caml_call1(Stdlib[2], cst_Buffer_add_cannot_grow_buf); + var new_buffer = caml_create_bytes(new_len[1]); + caml_call5(Stdlib_Bytes[11], b[1], 0, new_buffer, 0, b[2]); + b[1] = new_buffer; + b[3] = new_len[1]; + if((b[2] + more | 0) > b[3]) + throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + if((old_pos + more | 0) <= b[3]) return 0; + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + } + } + function add_char(b, c){ + var pos = b[2]; + if(b[3] <= pos) resize(b, 1); + caml_bytes_unsafe_set(b[1], pos, c); + b[2] = pos + 1 | 0; + return 0; + } + var uchar_utf_8_byte_length_max = 4, uchar_utf_16_byte_length_max = 4; + function add_utf_8_uchar(b, u){ + for(;;){ + var pos = b[2]; + if(b[3] <= pos) resize(b, uchar_utf_8_byte_length_max); + var n = caml_call3(Stdlib_Bytes[55], b[1], pos, u); + if(0 === n){resize(b, uchar_utf_8_byte_length_max); continue;} + b[2] = pos + n | 0; + return 0; + } + } + function add_utf_16be_uchar(b, u){ + for(;;){ + var pos = b[2]; + if(b[3] <= pos) resize(b, uchar_utf_16_byte_length_max); + var n = caml_call3(Stdlib_Bytes[58], b[1], pos, u); + if(0 === n){resize(b, uchar_utf_16_byte_length_max); continue;} + b[2] = pos + n | 0; + return 0; + } + } + function add_utf_16le_uchar(b, u){ + for(;;){ + var pos = b[2]; + if(b[3] <= pos) resize(b, uchar_utf_16_byte_length_max); + var n = caml_call3(Stdlib_Bytes[61], b[1], pos, u); + if(0 === n){resize(b, uchar_utf_16_byte_length_max); continue;} + b[2] = pos + n | 0; + return 0; + } + } + function add_substring(b, s, offset, len){ + var _u_ = offset < 0 ? 1 : 0; + if(_u_) + var _v_ = _u_; + else + var + _w_ = len < 0 ? 1 : 0, + _v_ = _w_ || ((caml_ml_string_length(s) - len | 0) < offset ? 1 : 0); + if(_v_) caml_call1(Stdlib[1], cst_Buffer_add_substring_add_s); + var new_position = b[2] + len | 0; + if(b[3] < new_position) resize(b, len); + caml_blit_string(s, offset, b[1], b[2], len); + b[2] = new_position; + return 0; + } + function add_subbytes(b, s, offset, len){ + return add_substring(b, caml_call1(Stdlib_Bytes[48], s), offset, len); + } + function add_string(b, s){ + var len = caml_ml_string_length(s), new_position = b[2] + len | 0; + if(b[3] < new_position) resize(b, len); + caml_blit_string(s, 0, b[1], b[2], len); + b[2] = new_position; + return 0; + } + function add_bytes(b, s){ + return add_string(b, caml_call1(Stdlib_Bytes[48], s)); + } + function add_buffer(b, bs){return add_subbytes(b, bs[1], 0, bs[2]);} + function add_channel(b, ic, to_read$1){ + var + _s_ = to_read$1 < 0 ? 1 : 0, + _t_ = _s_ || (Stdlib_Sys[12] < to_read$1 ? 1 : 0); + if(_t_) caml_call1(Stdlib[1], cst_Buffer_add_channel); + if(b[3] < (b[2] + to_read$1 | 0)) resize(b, to_read$1); + var + ofs$1 = b[2], + buf = b[1], + already_read = 0, + ofs = ofs$1, + to_read = to_read$1; + for(;;){ + if(0 !== to_read){ + var r = caml_call4(Stdlib[84], ic, buf, ofs, to_read); + if(0 !== r){ + var + already_read$0 = already_read + r | 0, + ofs$0 = ofs + r | 0, + to_read$0 = to_read - r | 0, + already_read = already_read$0, + ofs = ofs$0, + to_read = to_read$0; + continue; + } + } + if((b[2] + already_read | 0) > b[3]) + throw caml_maybe_attach_backtrace([0, Assert_failure, _c_], 1); + b[2] = b[2] + already_read | 0; + if(already_read < to_read$1) + throw caml_maybe_attach_backtrace(Stdlib[12], 1); + return 0; + } + } + function output_buffer(oc, b){ + return caml_call4(Stdlib[68], oc, b[1], 0, b[2]); + } + function add_substitute(b, f, s){ + var lim$1 = caml_ml_string_length(s), previous = 32, i$4 = 0; + for(;;){ + if(i$4 >= lim$1){ + var _r_ = 92 === previous ? 1 : 0; + return _r_ ? add_char(b, previous) : _r_; + } + var previous$0 = caml_string_get(s, i$4); + if(36 !== previous$0){ + if(92 === previous){ + add_char(b, 92); + add_char(b, previous$0); + var i$6 = i$4 + 1 | 0, previous = 32, i$4 = i$6; + continue; + } + if(92 === previous$0){ + var i$7 = i$4 + 1 | 0, previous = previous$0, i$4 = i$7; + continue; + } + add_char(b, previous$0); + var i$8 = i$4 + 1 | 0, previous = previous$0, i$4 = i$8; + continue; + } + if(92 === previous){ + add_char(b, previous$0); + var i$5 = i$4 + 1 | 0, previous = 32, i$4 = i$5; + continue; + } + var start$0 = i$4 + 1 | 0; + if(lim$1 <= start$0) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var opening = caml_string_get(s, start$0), switch$0 = 0; + if(40 !== opening && 123 !== opening){ + var + start = start$0 + 1 | 0, + lim$0 = caml_ml_string_length(s), + i$2 = start; + for(;;){ + if(lim$0 <= i$2) + var stop$0 = lim$0; + else{ + var match = caml_string_get(s, i$2), switch$1 = 0; + if(91 <= match){ + if(97 <= match){ + if(123 > match) switch$1 = 1; + } + else if(95 === match) switch$1 = 1; + } + else + if(58 <= match){ + if(65 <= match) switch$1 = 1; + } + else if(48 <= match) switch$1 = 1; + if(switch$1){var i$3 = i$2 + 1 | 0, i$2 = i$3; continue;} + var stop$0 = i$2; + } + var + match$0 = + [0, + caml_call3(Stdlib_String[15], s, start$0, stop$0 - start$0 | 0), + stop$0]; + switch$0 = 1; + break; + } + } + if(! switch$0){ + var new_start = start$0 + 1 | 0, k$2 = 0; + if(40 === opening) + var closing = 41; + else{ + if(123 !== opening) + throw caml_maybe_attach_backtrace([0, Assert_failure, _d_], 1); + var closing = 125; + } + var lim = caml_ml_string_length(s), k = k$2, stop = new_start; + for(;;){ + if(lim <= stop) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(caml_string_get(s, stop) === opening){ + var i = stop + 1 | 0, k$0 = k + 1 | 0, k = k$0, stop = i; + continue; + } + if(caml_string_get(s, stop) !== closing){ + var i$1 = stop + 1 | 0, stop = i$1; + continue; + } + if(0 !== k){ + var i$0 = stop + 1 | 0, k$1 = k - 1 | 0, k = k$1, stop = i$0; + continue; + } + var + match$0 = + [0, + caml_call3 + (Stdlib_String[15], s, new_start, (stop - start$0 | 0) - 1 | 0), + stop + 1 | 0]; + break; + } + } + var next_i = match$0[2], ident = match$0[1]; + add_string(b, caml_call1(f, ident)); + var previous = 32, i$4 = next_i; + } + } + function truncate(b, len){ + if(0 <= len && b[2] >= len){b[2] = len; return 0;} + return caml_call1(Stdlib[1], cst_Buffer_truncate); + } + function to_seq(b){ + function aux(i, param){ + if(b[2] <= i) return 0; + var x = caml_bytes_unsafe_get(b[1], i), _p_ = i + 1 | 0; + return [0, x, function(_q_){return aux(_p_, _q_);}]; + } + var _n_ = 0; + return function(_o_){return aux(_n_, _o_);}; + } + function to_seqi(b){ + function aux(i, param){ + if(b[2] <= i) return 0; + var x = caml_bytes_unsafe_get(b[1], i), _l_ = i + 1 | 0; + return [0, [0, i, x], function(_m_){return aux(_l_, _m_);}]; + } + var _j_ = 0; + return function(_k_){return aux(_j_, _k_);}; + } + function add_seq(b, seq){ + function _h_(_i_){return add_char(b, _i_);} + return caml_call2(Stdlib_Seq[4], _h_, seq); + } + function of_seq(i){var b = create(32); add_seq(b, i); return b;} + function add_int8(b, x){ + var new_position = b[2] + 1 | 0; + if(b[3] < new_position) resize(b, 1); + caml_bytes_unsafe_set(b[1], b[2], x); + b[2] = new_position; + return 0; + } + function add_int16_ne(b, x){ + var new_position = b[2] + 2 | 0; + if(b[3] < new_position) resize(b, 2); + runtime.caml_bytes_set16(b[1], b[2], x); + b[2] = new_position; + return 0; + } + function add_int32_ne(b, x){ + var new_position = b[2] + 4 | 0; + if(b[3] < new_position) resize(b, 4); + runtime.caml_bytes_set32(b[1], b[2], x); + b[2] = new_position; + return 0; + } + function add_int64_ne(b, x){ + var new_position = b[2] + 8 | 0; + if(b[3] < new_position) resize(b, 8); + runtime.caml_bytes_set64(b[1], b[2], x); + b[2] = new_position; + return 0; + } + function add_int16_le(b, x){ + var _g_ = Stdlib_Sys[11] ? caml_bswap16(x) : x; + return add_int16_ne(b, _g_); + } + function add_int16_be(b, x){ + var x$0 = Stdlib_Sys[11] ? x : caml_bswap16(x); + return add_int16_ne(b, x$0); + } + function add_int32_le(b, x){ + var _f_ = Stdlib_Sys[11] ? caml_int32_bswap(x) : x; + return add_int32_ne(b, _f_); + } + function add_int32_be(b, x){ + var x$0 = Stdlib_Sys[11] ? x : caml_int32_bswap(x); + return add_int32_ne(b, x$0); + } + function add_int64_le(b, x){ + var _e_ = Stdlib_Sys[11] ? caml_int64_bswap(x) : x; + return add_int64_ne(b, _e_); + } + function add_int64_be(b, x){ + var x$0 = Stdlib_Sys[11] ? x : caml_int64_bswap(x); + return add_int64_ne(b, x$0); + } + var + Stdlib_Buffer = + [0, + create, + contents, + to_bytes, + sub, + blit, + nth, + length, + clear, + reset, + output_buffer, + truncate, + add_char, + add_utf_8_uchar, + add_utf_16le_uchar, + add_utf_16be_uchar, + add_string, + add_bytes, + add_substring, + add_subbytes, + add_substitute, + add_buffer, + add_channel, + to_seq, + to_seqi, + add_seq, + of_seq, + add_int8, + add_int8, + add_int16_ne, + add_int16_be, + add_int16_le, + add_int16_ne, + add_int16_be, + add_int16_le, + add_int32_ne, + add_int32_be, + add_int32_le, + add_int64_ne, + add_int64_be, + add_int64_le]; + runtime.caml_register_global(17, Stdlib_Buffer, "Stdlib__Buffer"); + return; + } + (globalThis)); + +//# 10474 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst$43 = "", + cst_and = " and ", + cst_Li$3 = "%Li", + cst_i$3 = "%i", + cst_li$3 = "%li", + cst_ni$3 = "%ni", + cst_u$0 = "%u", + cst$42 = "' '", + cst$41 = "'#'", + cst$39 = "'*'", + cst$40 = "'+'", + cst$44 = ", ", + cst_0$3 = "0", + cst_at_character_number = ": at character number ", + cst$38 = "@[", + cst$37 = "@{", + cst_bad_input_format_type_mism = + "bad input: format type mismatch between ", + cst_bad_input_format_type_mism$0 = + "bad input: format type mismatch between %S and %S", + cst_camlinternalFormat_ml = "camlinternalFormat.ml", + cst_invalid_format = "invalid format ", + cst_precision$3 = "precision", + caml_blit_string = runtime.caml_blit_string, + caml_bytes_set = runtime.caml_bytes_set, + caml_create_bytes = runtime.caml_create_bytes, + caml_format_float = runtime.caml_format_float, + caml_format_int = runtime.caml_format_int, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_notequal = runtime.caml_notequal, + caml_string_get = runtime.caml_string_get, + caml_string_notequal = runtime.caml_string_notequal, + caml_string_unsafe_get = runtime.caml_string_unsafe_get, + caml_trampoline = runtime.caml_trampoline, + caml_trampoline_return = runtime.caml_trampoline_return, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); + } + function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var + global_data = runtime.caml_get_global_data(), + cst$9 = "%{", + cst$10 = "%}", + cst$11 = "%(", + cst$12 = "%)", + cst$13 = "%?", + cst$18 = cst$37, + cst$19 = cst$38, + cst$20 = cst$37, + cst$21 = cst$38, + cst$22 = cst$37, + cst$23 = cst$38, + cst$26 = cst$39, + cst$24 = "'-'", + cst$25 = cst$39, + cst$27 = cst$40, + cst$28 = cst$41, + cst$29 = cst$42, + cst$30 = cst$40, + cst$31 = "'_'", + sub_format = [0, 0, cst$43], + formatting_lit = [0, "@;", 1, 0], + cst$35 = cst$41, + cst$32 = cst$40, + cst$33 = cst$40, + cst$34 = cst$42, + cst$36 = cst$40, + cst$17 = ".", + cst$14 = "%!", + cst$15 = cst$37, + cst$16 = cst$38, + cst$8 = "%%", + cst$0 = "@]", + cst$1 = "@}", + cst$2 = "@?", + cst$3 = "@\n", + cst$4 = "@.", + cst$5 = "@@", + cst$6 = "@%", + cst$7 = "@", + cst = ".*", + Assert_failure = global_data.Assert_failure, + CamlinternalFormatBasics = global_data.CamlinternalFormatBasics, + Stdlib = global_data.Stdlib, + Stdlib_Buffer = global_data.Stdlib__Buffer, + Stdlib_String = global_data.Stdlib__String, + Stdlib_Sys = global_data.Stdlib__Sys, + Stdlib_Char = global_data.Stdlib__Char, + Stdlib_Bytes = global_data.Stdlib__Bytes, + Stdlib_Int = global_data.Stdlib__Int, + cst_c = "%c", + cst_s = "%s", + cst_i = cst_i$3, + cst_li = cst_li$3, + cst_ni = cst_ni$3, + cst_Li = cst_Li$3, + cst_f = "%f", + cst_B = "%B", + cst_a = "%a", + cst_t = "%t", + cst_r = "%r", + cst_r$0 = "%_r", + _b_ = [0, cst_camlinternalFormat_ml, 850, 23], + _m_ = [0, cst_camlinternalFormat_ml, 814, 21], + _e_ = [0, cst_camlinternalFormat_ml, 815, 21], + _n_ = [0, cst_camlinternalFormat_ml, 818, 21], + _f_ = [0, cst_camlinternalFormat_ml, 819, 21], + _o_ = [0, cst_camlinternalFormat_ml, 822, 19], + _g_ = [0, cst_camlinternalFormat_ml, 823, 19], + _p_ = [0, cst_camlinternalFormat_ml, 826, 22], + _h_ = [0, cst_camlinternalFormat_ml, 827, 22], + _q_ = [0, cst_camlinternalFormat_ml, 831, 30], + _i_ = [0, cst_camlinternalFormat_ml, 832, 30], + _k_ = [0, cst_camlinternalFormat_ml, 836, 26], + _c_ = [0, cst_camlinternalFormat_ml, 837, 26], + _l_ = [0, cst_camlinternalFormat_ml, 846, 28], + _d_ = [0, cst_camlinternalFormat_ml, 847, 28], + _j_ = [0, cst_camlinternalFormat_ml, 851, 23], + _s_ = [0, cst_camlinternalFormat_ml, 1558, 4], + cst_Printf_bad_conversion = "Printf: bad conversion %[", + _t_ = [0, cst_camlinternalFormat_ml, 1626, 39], + _u_ = [0, cst_camlinternalFormat_ml, 1649, 31], + _v_ = [0, cst_camlinternalFormat_ml, 1650, 31], + cst_Printf_bad_conversion$0 = "Printf: bad conversion %_", + _w_ = [0, cst_camlinternalFormat_ml, 1830, 8], + ___ = + [0, + [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]], + cst_bad_input_format_type_mism$0], + _Z_ = + [0, + [11, cst_bad_input_format_type_mism, [3, 0, [11, cst_and, [3, 0, 0]]]], + cst_bad_input_format_type_mism$0], + _C_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, 0, 0, 0, [11, ", duplicate flag ", [1, 0]]]]]], + "invalid format %S: at character number %d, duplicate flag %C"], + cst_0 = cst_0$3, + cst_padding = "padding", + _D_ = [0, 1, 0], + _E_ = [0, 0], + cst_precision = cst_precision$3, + _F_ = [1, 0], + _G_ = [1, 1], + cst_0$2 = "'0'", + cst_0$0 = cst_0$3, + _I_ = [1, 1], + cst_0$1 = cst_0$3, + cst_precision$0 = cst_precision$3, + _H_ = [1, 1], + cst_precision$1 = cst_precision$3, + _M_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, + 0, + 0, + 0, + [11, + ", flag ", + [1, + [11, + " is only allowed after the '", + [12, 37, [11, "', before padding and precision", 0]]]]]]]]], + "invalid format %S: at character number %d, flag %C is only allowed after the '%%', before padding and precision"], + _J_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, + 0, + 0, + 0, + [11, ', invalid conversion "', [12, 37, [0, [12, 34, 0]]]]]]]], + 'invalid format %S: at character number %d, invalid conversion "%%%c"'], + _K_ = [0, 0], + cst_padding$0 = "`padding'", + _L_ = [0, 0], + cst_precision$2 = "`precision'", + _N_ = [0, [12, 64, 0]], + _O_ = [0, "@ ", 1, 0], + _P_ = [0, "@,", 0, 0], + _Q_ = [2, 60], + _R_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + ": '", + [12, + 37, + [11, + "' alone is not accepted in character sets, use ", + [12, + 37, + [12, + 37, + [11, " instead at position ", [4, 0, 0, 0, [12, 46, 0]]]]]]]]]], + "invalid format %S: '%%' alone is not accepted in character sets, use %%%% instead at position %d."], + _S_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + ": integer ", + [4, 0, 0, 0, [11, " is greater than the limit ", [4, 0, 0, 0, 0]]]]]], + "invalid format %S: integer %d is greater than the limit %d"], + cst_digit = "digit", + _T_ = [0, cst_camlinternalFormat_ml, 2837, 11], + _U_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + ': unclosed sub-format, expected "', + [12, 37, [0, [11, '" at character number ', [4, 0, 0, 0, 0]]]]]]], + 'invalid format %S: unclosed sub-format, expected "%%%c" at character number %d'], + cst_character = "character ')'", + cst_character$0 = "character '}'", + _V_ = [0, cst_camlinternalFormat_ml, 2899, 34], + _W_ = [0, cst_camlinternalFormat_ml, 2935, 28], + _X_ = [0, cst_camlinternalFormat_ml, 2957, 11], + _Y_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, + 0, + 0, + 0, + [11, + cst$44, + [2, + 0, + [11, + " is incompatible with '", + [0, [11, "' in sub-format ", [3, 0, 0]]]]]]]]]], + "invalid format %S: at character number %d, %s is incompatible with '%c' in sub-format %S"], + _B_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, 0, 0, 0, [11, cst$44, [2, 0, [11, " expected, read ", [1, 0]]]]]]]], + "invalid format %S: at character number %d, %s expected, read %C"], + _A_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, + cst_at_character_number, + [4, 0, 0, 0, [11, ", '", [0, [11, "' without ", [2, 0, 0]]]]]]]], + "invalid format %S: at character number %d, '%c' without %s"], + cst_non_zero_widths_are_unsupp = + "non-zero widths are unsupported for %c conversions", + cst_unexpected_end_of_format = "unexpected end of format", + _z_ = + [0, + [11, + cst_invalid_format, + [3, + 0, + [11, cst_at_character_number, [4, 0, 0, 0, [11, cst$44, [2, 0, 0]]]]]], + "invalid format %S: at character number %d, %s"], + _y_ = + [0, + [11, "invalid box description ", [3, 0, 0]], + "invalid box description %S"], + _x_ = [0, 0, 4], + cst_nan = "nan", + cst_neg_infinity = "neg_infinity", + cst_infinity = "infinity", + _r_ = [0, 103], + cst_nd$0 = "%+nd", + cst_nd$1 = "% nd", + cst_ni$1 = "%+ni", + cst_ni$2 = "% ni", + cst_nx = "%nx", + cst_nx$0 = "%#nx", + cst_nX = "%nX", + cst_nX$0 = "%#nX", + cst_no = "%no", + cst_no$0 = "%#no", + cst_nd = "%nd", + cst_ni$0 = cst_ni$3, + cst_nu = "%nu", + cst_ld$0 = "%+ld", + cst_ld$1 = "% ld", + cst_li$1 = "%+li", + cst_li$2 = "% li", + cst_lx = "%lx", + cst_lx$0 = "%#lx", + cst_lX = "%lX", + cst_lX$0 = "%#lX", + cst_lo = "%lo", + cst_lo$0 = "%#lo", + cst_ld = "%ld", + cst_li$0 = cst_li$3, + cst_lu = "%lu", + cst_Ld$0 = "%+Ld", + cst_Ld$1 = "% Ld", + cst_Li$1 = "%+Li", + cst_Li$2 = "% Li", + cst_Lx = "%Lx", + cst_Lx$0 = "%#Lx", + cst_LX = "%LX", + cst_LX$0 = "%#LX", + cst_Lo = "%Lo", + cst_Lo$0 = "%#Lo", + cst_Ld = "%Ld", + cst_Li$0 = cst_Li$3, + cst_Lu = "%Lu", + cst_d$0 = "%+d", + cst_d$1 = "% d", + cst_i$1 = "%+i", + cst_i$2 = "% i", + cst_x = "%x", + cst_x$0 = "%#x", + cst_X = "%X", + cst_X$0 = "%#X", + cst_o = "%o", + cst_o$0 = "%#o", + cst_d = "%d", + cst_i$0 = cst_i$3, + cst_u = cst_u$0, + cst_0c = "0c", + _a_ = [0, 0, 0], + cst_CamlinternalFormat_Type_mi = "CamlinternalFormat.Type_mismatch"; + function create_char_set(param){return caml_call2(Stdlib_Bytes[1], 32, 0);} + function add_in_char_set(char_set, c){ + var + str_ind = c >>> 3 | 0, + mask = 1 << (c & 7), + _dU_ = runtime.caml_bytes_get(char_set, str_ind) | mask; + return caml_bytes_set(char_set, str_ind, caml_call1(Stdlib[29], _dU_)); + } + function freeze_char_set(char_set){ + return caml_call1(Stdlib_Bytes[6], char_set); + } + function rev_char_set(char_set){ + var char_set$0 = create_char_set(0), i = 0; + for(;;){ + var _dS_ = caml_string_get(char_set, i) ^ 255; + caml_bytes_set(char_set$0, i, caml_call1(Stdlib[29], _dS_)); + var _dT_ = i + 1 | 0; + if(31 === i) return caml_call1(Stdlib_Bytes[48], char_set$0); + var i = _dT_; + } + } + function is_in_char_set(char_set, c){ + var str_ind = c >>> 3 | 0, mask = 1 << (c & 7); + return 0 !== (caml_string_get(char_set, str_ind) & mask) ? 1 : 0; + } + function pad_of_pad_opt(pad_opt){ + if(! pad_opt) return 0; + var width = pad_opt[1]; + return [0, 1, width]; + } + function param_format_of_ignored_format(ign, fmt){ + if(typeof ign === "number") + switch(ign){ + case 0: + return [0, [0, fmt]]; + case 1: + return [0, [1, fmt]]; + case 2: + return [0, [19, fmt]]; + default: return [0, [22, fmt]]; + } + switch(ign[0]){ + case 0: + var pad_opt = ign[1]; return [0, [2, pad_of_pad_opt(pad_opt), fmt]]; + case 1: + var pad_opt$0 = ign[1]; + return [0, [3, pad_of_pad_opt(pad_opt$0), fmt]]; + case 2: + var pad_opt$1 = ign[2], iconv = ign[1]; + return [0, [4, iconv, pad_of_pad_opt(pad_opt$1), 0, fmt]]; + case 3: + var pad_opt$2 = ign[2], iconv$0 = ign[1]; + return [0, [5, iconv$0, pad_of_pad_opt(pad_opt$2), 0, fmt]]; + case 4: + var pad_opt$3 = ign[2], iconv$1 = ign[1]; + return [0, [6, iconv$1, pad_of_pad_opt(pad_opt$3), 0, fmt]]; + case 5: + var pad_opt$4 = ign[2], iconv$2 = ign[1]; + return [0, [7, iconv$2, pad_of_pad_opt(pad_opt$4), 0, fmt]]; + case 6: + var prec_opt = ign[2], pad_opt$5 = ign[1]; + if(prec_opt) + var ndec = prec_opt[1], _dR_ = [0, ndec]; + else + var _dR_ = 0; + return [0, [8, _a_, pad_of_pad_opt(pad_opt$5), _dR_, fmt]]; + case 7: + var pad_opt$6 = ign[1]; + return [0, [9, pad_of_pad_opt(pad_opt$6), fmt]]; + case 8: + var fmtty = ign[2], pad_opt$7 = ign[1]; + return [0, [13, pad_opt$7, fmtty, fmt]]; + case 9: + var fmtty$0 = ign[2], pad_opt$8 = ign[1]; + return [0, [14, pad_opt$8, fmtty$0, fmt]]; + case 10: + var char_set = ign[2], width_opt = ign[1]; + return [0, [20, width_opt, char_set, fmt]]; + default: var counter = ign[1]; return [0, [21, counter, fmt]]; + } + } + function default_float_precision(fconv){return 5 === fconv[2] ? 12 : -6;} + function buffer_create(init_size){ + return [0, 0, caml_create_bytes(init_size)]; + } + function buffer_check_size(buf, overhead){ + var + len = runtime.caml_ml_bytes_length(buf[2]), + min_len = buf[1] + overhead | 0, + _dP_ = len < min_len ? 1 : 0; + if(_dP_){ + var + new_len = caml_call2(Stdlib_Int[11], len * 2 | 0, min_len), + new_str = caml_create_bytes(new_len); + caml_call5(Stdlib_Bytes[11], buf[2], 0, new_str, 0, len); + buf[2] = new_str; + var _dQ_ = 0; + } + else + var _dQ_ = _dP_; + return _dQ_; + } + function buffer_add_char(buf, c){ + buffer_check_size(buf, 1); + caml_bytes_set(buf[2], buf[1], c); + buf[1] = buf[1] + 1 | 0; + return 0; + } + function buffer_add_string(buf, s){ + var str_len = caml_ml_string_length(s); + buffer_check_size(buf, str_len); + caml_call5(Stdlib_String[48], s, 0, buf[2], buf[1], str_len); + buf[1] = buf[1] + str_len | 0; + return 0; + } + function buffer_contents(buf){ + return caml_call3(Stdlib_Bytes[8], buf[2], 0, buf[1]); + } + function char_of_iconv(iconv){ + switch(iconv){ + case 6: + case 7: + return 120; + case 8: + case 9: + return 88; + case 10: + case 11: + return 111; + case 12: + case 15: + return 117; + case 0: + case 1: + case 2: + case 13: + return 100; + default: return 105; + } + } + function char_of_fconv(opt, fconv){ + if(opt) var sth = opt[1], cF = sth; else var cF = 70; + switch(fconv[2]){ + case 0: + return 102; + case 1: + return 101; + case 2: + return 69; + case 3: + return 103; + case 4: + return 71; + case 5: + return cF; + case 6: + return 104; + case 7: + return 72; + default: return 70; + } + } + function bprint_padty(buf, padty){ + switch(padty){ + case 0: + return buffer_add_char(buf, 45); + case 1: + return 0; + default: return buffer_add_char(buf, 48); + } + } + function bprint_ignored_flag(buf, ign_flag){ + return ign_flag ? buffer_add_char(buf, 95) : ign_flag; + } + function bprint_pad_opt(buf, pad_opt){ + if(! pad_opt) return 0; + var width = pad_opt[1]; + return buffer_add_string(buf, caml_call1(Stdlib_Int[12], width)); + } + function bprint_padding(buf, pad){ + if(typeof pad === "number") return 0; + if(0 === pad[0]){ + var n = pad[2], padty = pad[1]; + bprint_padty(buf, padty); + return buffer_add_string(buf, caml_call1(Stdlib_Int[12], n)); + } + var padty$0 = pad[1]; + bprint_padty(buf, padty$0); + return buffer_add_char(buf, 42); + } + function bprint_precision(buf, prec){ + if(typeof prec === "number") + return prec ? buffer_add_string(buf, cst) : 0; + var n = prec[1]; + buffer_add_char(buf, 46); + return buffer_add_string(buf, caml_call1(Stdlib_Int[12], n)); + } + function bprint_iconv_flag(buf, iconv){ + switch(iconv){ + case 1: + case 4: + return buffer_add_char(buf, 43); + case 2: + case 5: + return buffer_add_char(buf, 32); + case 7: + case 9: + case 11: + case 13: + case 14: + case 15: + return buffer_add_char(buf, 35); + default: return 0; + } + } + function bprint_altint_fmt(buf, ign_flag, iconv, pad, prec, c){ + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag); + bprint_iconv_flag(buf, iconv); + bprint_padding(buf, pad); + bprint_precision(buf, prec); + buffer_add_char(buf, c); + return buffer_add_char(buf, char_of_iconv(iconv)); + } + function bprint_fconv_flag(buf, fconv){ + switch(fconv[1]){ + case 0: break; + case 1: + buffer_add_char(buf, 43); break; + default: buffer_add_char(buf, 32); + } + return 8 <= fconv[2] ? buffer_add_char(buf, 35) : 0; + } + function string_of_formatting_lit(formatting_lit){ + if(typeof formatting_lit === "number") + switch(formatting_lit){ + case 0: + return cst$0; + case 1: + return cst$1; + case 2: + return cst$2; + case 3: + return cst$3; + case 4: + return cst$4; + case 5: + return cst$5; + default: return cst$6; + } + switch(formatting_lit[0]){ + case 0: + var str = formatting_lit[1]; return str; + case 1: + var str$0 = formatting_lit[1]; return str$0; + default: + var c = formatting_lit[1], _dO_ = caml_call2(Stdlib_String[1], 1, c); + return caml_call2(Stdlib[28], cst$7, _dO_); + } + } + function bprint_char_literal(buf, chr){ + return 37 === chr + ? buffer_add_string(buf, cst$8) + : buffer_add_char(buf, chr); + } + function bprint_string_literal(buf, str){ + var _dM_ = caml_ml_string_length(str) - 1 | 0, _dL_ = 0; + if(_dM_ >= 0){ + var i = _dL_; + for(;;){ + bprint_char_literal(buf, caml_string_get(str, i)); + var _dN_ = i + 1 | 0; + if(_dM_ !== i){var i = _dN_; continue;} + break; + } + } + return 0; + } + function bprint_fmtty(buf, fmtty){ + var fmtty$0 = fmtty; + for(;;){ + if(typeof fmtty$0 === "number") return 0; + switch(fmtty$0[0]){ + case 0: + var fmtty$1 = fmtty$0[1]; + buffer_add_string(buf, cst_c); + var fmtty$0 = fmtty$1; + continue; + case 1: + var fmtty$2 = fmtty$0[1]; + buffer_add_string(buf, cst_s); + var fmtty$0 = fmtty$2; + continue; + case 2: + var fmtty$3 = fmtty$0[1]; + buffer_add_string(buf, cst_i); + var fmtty$0 = fmtty$3; + continue; + case 3: + var fmtty$4 = fmtty$0[1]; + buffer_add_string(buf, cst_li); + var fmtty$0 = fmtty$4; + continue; + case 4: + var fmtty$5 = fmtty$0[1]; + buffer_add_string(buf, cst_ni); + var fmtty$0 = fmtty$5; + continue; + case 5: + var fmtty$6 = fmtty$0[1]; + buffer_add_string(buf, cst_Li); + var fmtty$0 = fmtty$6; + continue; + case 6: + var fmtty$7 = fmtty$0[1]; + buffer_add_string(buf, cst_f); + var fmtty$0 = fmtty$7; + continue; + case 7: + var fmtty$8 = fmtty$0[1]; + buffer_add_string(buf, cst_B); + var fmtty$0 = fmtty$8; + continue; + case 8: + var fmtty$9 = fmtty$0[2], sub_fmtty = fmtty$0[1]; + buffer_add_string(buf, cst$9); + bprint_fmtty(buf, sub_fmtty); + buffer_add_string(buf, cst$10); + var fmtty$0 = fmtty$9; + continue; + case 9: + var fmtty$10 = fmtty$0[3], sub_fmtty$0 = fmtty$0[1]; + buffer_add_string(buf, cst$11); + bprint_fmtty(buf, sub_fmtty$0); + buffer_add_string(buf, cst$12); + var fmtty$0 = fmtty$10; + continue; + case 10: + var fmtty$11 = fmtty$0[1]; + buffer_add_string(buf, cst_a); + var fmtty$0 = fmtty$11; + continue; + case 11: + var fmtty$12 = fmtty$0[1]; + buffer_add_string(buf, cst_t); + var fmtty$0 = fmtty$12; + continue; + case 12: + var fmtty$13 = fmtty$0[1]; + buffer_add_string(buf, cst$13); + var fmtty$0 = fmtty$13; + continue; + case 13: + var fmtty$14 = fmtty$0[1]; + buffer_add_string(buf, cst_r); + var fmtty$0 = fmtty$14; + continue; + default: + var fmtty$15 = fmtty$0[1]; + buffer_add_string(buf, cst_r$0); + var fmtty$0 = fmtty$15; + continue; + } + } + } + function int_of_custom_arity(param){ + if(! param) return 0; + var x = param[1]; + return 1 + int_of_custom_arity(x) | 0; + } + function string_of_fmt(fmt){ + var buf = buffer_create(16); + function fmtiter(fmt, ign_flag){ + var fmt$0 = fmt, ign_flag$0 = ign_flag; + a: + for(;;){ + if(typeof fmt$0 === "number") return 0; + switch(fmt$0[0]){ + case 0: + var rest = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + buffer_add_char(buf, 99); + var fmt$0 = rest, ign_flag$0 = 0; + continue; + case 1: + var rest$0 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + buffer_add_char(buf, 67); + var fmt$0 = rest$0, ign_flag$0 = 0; + continue; + case 2: + var rest$1 = fmt$0[2], pad = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_padding(buf, pad); + buffer_add_char(buf, 115); + var fmt$0 = rest$1, ign_flag$0 = 0; + continue; + case 3: + var rest$2 = fmt$0[2], pad$0 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_padding(buf, pad$0); + buffer_add_char(buf, 83); + var fmt$0 = rest$2, ign_flag$0 = 0; + continue; + case 4: + var + rest$3 = fmt$0[4], + prec = fmt$0[3], + pad$1 = fmt$0[2], + iconv = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_iconv_flag(buf, iconv); + bprint_padding(buf, pad$1); + bprint_precision(buf, prec); + buffer_add_char(buf, char_of_iconv(iconv)); + var fmt$0 = rest$3, ign_flag$0 = 0; + continue; + case 5: + var + rest$4 = fmt$0[4], + prec$0 = fmt$0[3], + pad$2 = fmt$0[2], + iconv$0 = fmt$0[1]; + bprint_altint_fmt(buf, ign_flag$0, iconv$0, pad$2, prec$0, 108); + var fmt$0 = rest$4, ign_flag$0 = 0; + continue; + case 6: + var + rest$5 = fmt$0[4], + prec$1 = fmt$0[3], + pad$3 = fmt$0[2], + iconv$1 = fmt$0[1]; + bprint_altint_fmt(buf, ign_flag$0, iconv$1, pad$3, prec$1, 110); + var fmt$0 = rest$5, ign_flag$0 = 0; + continue; + case 7: + var + rest$6 = fmt$0[4], + prec$2 = fmt$0[3], + pad$4 = fmt$0[2], + iconv$2 = fmt$0[1]; + bprint_altint_fmt(buf, ign_flag$0, iconv$2, pad$4, prec$2, 76); + var fmt$0 = rest$6, ign_flag$0 = 0; + continue; + case 8: + var + rest$7 = fmt$0[4], + prec$3 = fmt$0[3], + pad$5 = fmt$0[2], + fconv = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_fconv_flag(buf, fconv); + bprint_padding(buf, pad$5); + bprint_precision(buf, prec$3); + buffer_add_char(buf, char_of_fconv(0, fconv)); + var fmt$0 = rest$7, ign_flag$0 = 0; + continue; + case 9: + var rest$8 = fmt$0[2], pad$6 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_padding(buf, pad$6); + buffer_add_char(buf, 66); + var fmt$0 = rest$8, ign_flag$0 = 0; + continue; + case 10: + var rest$9 = fmt$0[1]; + buffer_add_string(buf, cst$14); + var fmt$0 = rest$9; + continue; + case 11: + var rest$10 = fmt$0[2], str = fmt$0[1]; + bprint_string_literal(buf, str); + var fmt$0 = rest$10; + continue; + case 12: + var rest$11 = fmt$0[2], chr = fmt$0[1]; + bprint_char_literal(buf, chr); + var fmt$0 = rest$11; + continue; + case 13: + var rest$12 = fmt$0[3], fmtty = fmt$0[2], pad_opt = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_pad_opt(buf, pad_opt); + buffer_add_char(buf, 123); + bprint_fmtty(buf, fmtty); + buffer_add_char(buf, 37); + buffer_add_char(buf, 125); + var fmt$0 = rest$12, ign_flag$0 = 0; + continue; + case 14: + var rest$13 = fmt$0[3], fmtty$0 = fmt$0[2], pad_opt$0 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_pad_opt(buf, pad_opt$0); + buffer_add_char(buf, 40); + bprint_fmtty(buf, fmtty$0); + buffer_add_char(buf, 37); + buffer_add_char(buf, 41); + var fmt$0 = rest$13, ign_flag$0 = 0; + continue; + case 15: + var rest$14 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + buffer_add_char(buf, 97); + var fmt$0 = rest$14, ign_flag$0 = 0; + continue; + case 16: + var rest$15 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + buffer_add_char(buf, 116); + var fmt$0 = rest$15, ign_flag$0 = 0; + continue; + case 17: + var rest$16 = fmt$0[2], fmting_lit = fmt$0[1]; + bprint_string_literal(buf, string_of_formatting_lit(fmting_lit)); + var fmt$0 = rest$16; + continue; + case 18: + var rest$17 = fmt$0[2], fmting_gen = fmt$0[1]; + if(0 === fmting_gen[0]){ + var str$0 = fmting_gen[1][2]; + buffer_add_string(buf, cst$15); + buffer_add_string(buf, str$0); + } + else{ + var str$1 = fmting_gen[1][2]; + buffer_add_string(buf, cst$16); + buffer_add_string(buf, str$1); + } + var fmt$0 = rest$17; + continue; + case 19: + var rest$18 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + buffer_add_char(buf, 114); + var fmt$0 = rest$18, ign_flag$0 = 0; + continue; + case 20: + var rest$19 = fmt$0[3], char_set = fmt$0[2], width_opt = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_pad_opt(buf, width_opt); + var + print_char = + function(buf, i){ + var c = caml_call1(Stdlib[29], i); + return 37 === c + ? (buffer_add_char(buf, 37), buffer_add_char(buf, 37)) + : 64 + === c + ? (buffer_add_char(buf, 37), buffer_add_char(buf, 64)) + : buffer_add_char(buf, c); + }; + buffer_add_char(buf, 91); + var + set = + is_in_char_set(char_set, 0) + ? (buffer_add_char(buf, 94), rev_char_set(char_set)) + : char_set, + is_alone$0 = + function(set){ + function is_alone(c){ + var + after = caml_call1(Stdlib_Char[1], c + 1 | 0), + before = caml_call1(Stdlib_Char[1], c - 1 | 0), + _dH_ = is_in_char_set(set, c); + if(_dH_) + var + _dI_ = is_in_char_set(set, before), + _dJ_ = _dI_ ? is_in_char_set(set, after) : _dI_, + _dK_ = 1 - _dJ_; + else + var _dK_ = _dH_; + return _dK_; + } + return is_alone; + }, + is_alone = is_alone$0(set); + if(is_alone(93)) buffer_add_char(buf, 93); + var i = 1; + b: + for(;;){ + if(i < 256){ + if(! is_in_char_set(set, caml_call1(Stdlib[29], i))){var i$0 = i + 1 | 0, i = i$0; continue;} + var switcher = caml_call1(Stdlib[29], i) - 45 | 0, switch$0 = 0; + if(48 < switcher >>> 0) + if(210 <= switcher) print_char(buf, 255); else switch$0 = 1; + else{ + if(46 < switcher - 1 >>> 0){ + var i$2 = i + 1 | 0, i = i$2; + continue; + } + switch$0 = 1; + } + if(switch$0){ + var i$1 = i + 1 | 0; + if(! is_in_char_set(set, caml_call1(Stdlib[29], i$1))){ + print_char(buf, i$1 - 1 | 0); + var i$6 = i$1 + 1 | 0, i = i$6; + continue; + } + var + switcher$0 = caml_call1(Stdlib[29], i$1) - 45 | 0, + switch$1 = 0; + if(48 < switcher$0 >>> 0){ + if(210 <= switcher$0){ + print_char(buf, 254); + print_char(buf, 255); + switch$1 = 1; + } + } + else if + (46 < switcher$0 - 1 >>> 0 + && ! is_in_char_set(set, caml_call1(Stdlib[29], i$1 + 1 | 0))){ + print_char(buf, i$1 - 1 | 0); + var i$5 = i$1 + 1 | 0, i = i$5; + continue; + } + if(! switch$1){ + if(! is_in_char_set(set, caml_call1(Stdlib[29], i$1 + 1 | 0))){ + print_char(buf, i$1 - 1 | 0); + print_char(buf, i$1); + var i$4 = i$1 + 2 | 0, i = i$4; + continue; + } + var j = i$1 + 2 | 0, i$3 = i$1 - 1 | 0, j$0 = j; + for(;;){ + if + (256 !== j$0 + && is_in_char_set(set, caml_call1(Stdlib[29], j$0))){var j$1 = j$0 + 1 | 0, j$0 = j$1; continue;} + print_char(buf, i$3); + print_char(buf, 45); + print_char(buf, j$0 - 1 | 0); + if(j$0 < 256){var i$7 = j$0 + 1 | 0, i = i$7; continue b;} + break; + } + } + } + } + if(is_alone(45)) buffer_add_char(buf, 45); + buffer_add_char(buf, 93); + var fmt$0 = rest$19, ign_flag$0 = 0; + continue a; + } + case 21: + var rest$20 = fmt$0[2], counter = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + switch(counter){ + case 0: + var _dD_ = 108; break; + case 1: + var _dD_ = 110; break; + default: var _dD_ = 78; + } + buffer_add_char(buf, _dD_); + var fmt$0 = rest$20, ign_flag$0 = 0; + continue; + case 22: + var rest$21 = fmt$0[1]; + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + bprint_string_literal(buf, cst_0c); + var fmt$0 = rest$21, ign_flag$0 = 0; + continue; + case 23: + var + rest$22 = fmt$0[2], + ign = fmt$0[1], + fmt$1 = param_format_of_ignored_format(ign, rest$22)[1], + fmt$0 = fmt$1, + ign_flag$0 = 1; + continue; + default: + var + rest$23 = fmt$0[3], + arity = fmt$0[1], + _dF_ = int_of_custom_arity(arity), + _dE_ = 1; + if(_dF_ >= 1){ + var i$8 = _dE_; + for(;;){ + buffer_add_char(buf, 37); + bprint_ignored_flag(buf, ign_flag$0); + buffer_add_char(buf, 63); + var _dG_ = i$8 + 1 | 0; + if(_dF_ !== i$8){var i$8 = _dG_; continue;} + break; + } + } + var fmt$0 = rest$23, ign_flag$0 = 0; + continue; + } + } + } + fmtiter(fmt, 0); + return buffer_contents(buf); + } + function symm(param){ + if(typeof param === "number") return 0; + switch(param[0]){ + case 0: + var rest = param[1]; return [0, symm(rest)]; + case 1: + var rest$0 = param[1]; return [1, symm(rest$0)]; + case 2: + var rest$1 = param[1]; return [2, symm(rest$1)]; + case 3: + var rest$2 = param[1]; return [3, symm(rest$2)]; + case 4: + var rest$3 = param[1]; return [4, symm(rest$3)]; + case 5: + var rest$4 = param[1]; return [5, symm(rest$4)]; + case 6: + var rest$5 = param[1]; return [6, symm(rest$5)]; + case 7: + var rest$6 = param[1]; return [7, symm(rest$6)]; + case 8: + var rest$7 = param[2], ty = param[1]; return [8, ty, symm(rest$7)]; + case 9: + var rest$8 = param[3], ty2 = param[2], ty1 = param[1]; + return [9, ty2, ty1, symm(rest$8)]; + case 10: + var rest$9 = param[1]; return [10, symm(rest$9)]; + case 11: + var rest$10 = param[1]; return [11, symm(rest$10)]; + case 12: + var rest$11 = param[1]; return [12, symm(rest$11)]; + case 13: + var rest$12 = param[1]; return [13, symm(rest$12)]; + default: var rest$13 = param[1]; return [14, symm(rest$13)]; + } + } + function fmtty_rel_det(param){ + if(typeof param !== "number") + switch(param[0]){ + case 0: + var + rest = param[1], + match = fmtty_rel_det(rest), + de = match[4], + ed = match[3], + af = match[2], + fa = match[1], + _di_ = function(param){af(0); return 0;}; + return [0, function(param){fa(0); return 0;}, _di_, ed, de]; + case 1: + var + rest$0 = param[1], + match$0 = fmtty_rel_det(rest$0), + de$0 = match$0[4], + ed$0 = match$0[3], + af$0 = match$0[2], + fa$0 = match$0[1], + _dj_ = function(param){af$0(0); return 0;}; + return [0, function(param){fa$0(0); return 0;}, _dj_, ed$0, de$0]; + case 2: + var + rest$1 = param[1], + match$1 = fmtty_rel_det(rest$1), + de$1 = match$1[4], + ed$1 = match$1[3], + af$1 = match$1[2], + fa$1 = match$1[1], + _dk_ = function(param){af$1(0); return 0;}; + return [0, function(param){fa$1(0); return 0;}, _dk_, ed$1, de$1]; + case 3: + var + rest$2 = param[1], + match$2 = fmtty_rel_det(rest$2), + de$2 = match$2[4], + ed$2 = match$2[3], + af$2 = match$2[2], + fa$2 = match$2[1], + _dl_ = function(param){af$2(0); return 0;}; + return [0, function(param){fa$2(0); return 0;}, _dl_, ed$2, de$2]; + case 4: + var + rest$3 = param[1], + match$3 = fmtty_rel_det(rest$3), + de$3 = match$3[4], + ed$3 = match$3[3], + af$3 = match$3[2], + fa$3 = match$3[1], + _dm_ = function(param){af$3(0); return 0;}; + return [0, function(param){fa$3(0); return 0;}, _dm_, ed$3, de$3]; + case 5: + var + rest$4 = param[1], + match$4 = fmtty_rel_det(rest$4), + de$4 = match$4[4], + ed$4 = match$4[3], + af$4 = match$4[2], + fa$4 = match$4[1], + _dn_ = function(param){af$4(0); return 0;}; + return [0, function(param){fa$4(0); return 0;}, _dn_, ed$4, de$4]; + case 6: + var + rest$5 = param[1], + match$5 = fmtty_rel_det(rest$5), + de$5 = match$5[4], + ed$5 = match$5[3], + af$5 = match$5[2], + fa$5 = match$5[1], + _do_ = function(param){af$5(0); return 0;}; + return [0, function(param){fa$5(0); return 0;}, _do_, ed$5, de$5]; + case 7: + var + rest$6 = param[1], + match$6 = fmtty_rel_det(rest$6), + de$6 = match$6[4], + ed$6 = match$6[3], + af$6 = match$6[2], + fa$6 = match$6[1], + _dp_ = function(param){af$6(0); return 0;}; + return [0, function(param){fa$6(0); return 0;}, _dp_, ed$6, de$6]; + case 8: + var + rest$7 = param[2], + match$7 = fmtty_rel_det(rest$7), + de$7 = match$7[4], + ed$7 = match$7[3], + af$7 = match$7[2], + fa$7 = match$7[1], + _dq_ = function(param){af$7(0); return 0;}; + return [0, function(param){fa$7(0); return 0;}, _dq_, ed$7, de$7]; + case 9: + var + rest$8 = param[3], + ty2 = param[2], + ty1 = param[1], + match$8 = fmtty_rel_det(rest$8), + de$8 = match$8[4], + ed$8 = match$8[3], + af$8 = match$8[2], + fa$8 = match$8[1], + ty = trans(symm(ty1), ty2), + match$9 = fmtty_rel_det(ty), + jd = match$9[4], + dj = match$9[3], + ga = match$9[2], + ag = match$9[1], + _dr_ = function(param){jd(0); de$8(0); return 0;}, + _ds_ = function(param){ed$8(0); dj(0); return 0;}, + _dt_ = function(param){ga(0); af$8(0); return 0;}; + return [0, + function(param){fa$8(0); ag(0); return 0;}, + _dt_, + _ds_, + _dr_]; + case 10: + var + rest$9 = param[1], + match$10 = fmtty_rel_det(rest$9), + de$9 = match$10[4], + ed$9 = match$10[3], + af$9 = match$10[2], + fa$9 = match$10[1], + _du_ = function(param){af$9(0); return 0;}; + return [0, function(param){fa$9(0); return 0;}, _du_, ed$9, de$9]; + case 11: + var + rest$10 = param[1], + match$11 = fmtty_rel_det(rest$10), + de$10 = match$11[4], + ed$10 = match$11[3], + af$10 = match$11[2], + fa$10 = match$11[1], + _dv_ = function(param){af$10(0); return 0;}; + return [0, function(param){fa$10(0); return 0;}, _dv_, ed$10, de$10]; + case 12: + var + rest$11 = param[1], + match$12 = fmtty_rel_det(rest$11), + de$11 = match$12[4], + ed$11 = match$12[3], + af$11 = match$12[2], + fa$11 = match$12[1], + _dw_ = function(param){af$11(0); return 0;}; + return [0, function(param){fa$11(0); return 0;}, _dw_, ed$11, de$11]; + case 13: + var + rest$12 = param[1], + match$13 = fmtty_rel_det(rest$12), + de$12 = match$13[4], + ed$12 = match$13[3], + af$12 = match$13[2], + fa$12 = match$13[1], + _dx_ = function(param){de$12(0); return 0;}, + _dy_ = function(param){ed$12(0); return 0;}, + _dz_ = function(param){af$12(0); return 0;}; + return [0, function(param){fa$12(0); return 0;}, _dz_, _dy_, _dx_]; + default: + var + rest$13 = param[1], + match$14 = fmtty_rel_det(rest$13), + de$13 = match$14[4], + ed$13 = match$14[3], + af$13 = match$14[2], + fa$13 = match$14[1], + _dA_ = function(param){de$13(0); return 0;}, + _dB_ = function(param){ed$13(0); return 0;}, + _dC_ = function(param){af$13(0); return 0;}; + return [0, function(param){fa$13(0); return 0;}, _dC_, _dB_, _dA_]; + } + function _df_(param){return 0;} + function _dg_(param){return 0;} + function _dh_(param){return 0;} + return [0, function(param){return 0;}, _dh_, _dg_, _df_]; + } + function trans(ty1, ty2){ + var switch$0 = 0; + if(typeof ty1 === "number"){ + if(typeof ty2 === "number") return 0; + switch(ty2[0]){ + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + default: + throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + } + } + else + switch(ty1[0]){ + case 0: + var rest1 = ty1[1], switch$1 = 0; + if(typeof ty2 === "number") + switch$1 = 1; + else + switch(ty2[0]){ + case 0: + var rest2 = ty2[1]; return [0, trans(rest1, rest2)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$1 = 1; + } + if(switch$1) switch$0 = 7; + break; + case 1: + var rest1$0 = ty1[1], switch$2 = 0; + if(typeof ty2 === "number") + switch$2 = 1; + else + switch(ty2[0]){ + case 1: + var rest2$0 = ty2[1]; return [1, trans(rest1$0, rest2$0)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$2 = 1; + } + if(switch$2) switch$0 = 7; + break; + case 2: + var rest1$1 = ty1[1], switch$3 = 0; + if(typeof ty2 === "number") + switch$3 = 1; + else + switch(ty2[0]){ + case 2: + var rest2$1 = ty2[1]; return [2, trans(rest1$1, rest2$1)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$3 = 1; + } + if(switch$3) switch$0 = 7; + break; + case 3: + var rest1$2 = ty1[1], switch$4 = 0; + if(typeof ty2 === "number") + switch$4 = 1; + else + switch(ty2[0]){ + case 3: + var rest2$2 = ty2[1]; return [3, trans(rest1$2, rest2$2)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$4 = 1; + } + if(switch$4) switch$0 = 7; + break; + case 4: + var rest1$3 = ty1[1], switch$5 = 0; + if(typeof ty2 === "number") + switch$5 = 1; + else + switch(ty2[0]){ + case 4: + var rest2$3 = ty2[1]; return [4, trans(rest1$3, rest2$3)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$5 = 1; + } + if(switch$5) switch$0 = 7; + break; + case 5: + var rest1$4 = ty1[1], switch$6 = 0; + if(typeof ty2 === "number") + switch$6 = 1; + else + switch(ty2[0]){ + case 5: + var rest2$4 = ty2[1]; return [5, trans(rest1$4, rest2$4)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$6 = 1; + } + if(switch$6) switch$0 = 7; + break; + case 6: + var rest1$5 = ty1[1], switch$7 = 0; + if(typeof ty2 === "number") + switch$7 = 1; + else + switch(ty2[0]){ + case 6: + var rest2$5 = ty2[1]; return [6, trans(rest1$5, rest2$5)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$7 = 1; + } + if(switch$7) switch$0 = 7; + break; + case 7: + var rest1$6 = ty1[1], switch$8 = 0; + if(typeof ty2 === "number") + switch$8 = 1; + else + switch(ty2[0]){ + case 7: + var rest2$6 = ty2[1]; return [7, trans(rest1$6, rest2$6)]; + case 8: + switch$0 = 5; break; + case 9: + switch$0 = 6; break; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$8 = 1; + } + if(switch$8) switch$0 = 7; + break; + case 8: + var rest1$7 = ty1[2], ty1$0 = ty1[1], switch$9 = 0; + if(typeof ty2 === "number") + switch$9 = 1; + else + switch(ty2[0]){ + case 8: + var + rest2$7 = ty2[2], + ty2$0 = ty2[1], + _de_ = trans(rest1$7, rest2$7); + return [8, trans(ty1$0, ty2$0), _de_]; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$9 = 1; + } + if(switch$9) + throw caml_maybe_attach_backtrace([0, Assert_failure, _k_], 1); + break; + case 9: + var rest1$8 = ty1[3], ty12 = ty1[2], ty11 = ty1[1], switch$10 = 0; + if(typeof ty2 === "number") + switch$10 = 1; + else + switch(ty2[0]){ + case 8: + switch$0 = 5; break; + case 9: + var + rest2$8 = ty2[3], + ty22 = ty2[2], + ty21 = ty2[1], + ty = trans(symm(ty12), ty21), + match = fmtty_rel_det(ty), + f4 = match[4], + f2 = match[2]; + f2(0); + f4(0); + return [9, ty11, ty22, trans(rest1$8, rest2$8)]; + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + switch$0 = 4; break; + default: switch$10 = 1; + } + if(switch$10) + throw caml_maybe_attach_backtrace([0, Assert_failure, _l_], 1); + break; + case 10: + var rest1$9 = ty1[1]; + if(typeof ty2 !== "number" && 10 === ty2[0]){ + var rest2$9 = ty2[1]; + return [10, trans(rest1$9, rest2$9)]; + } + throw caml_maybe_attach_backtrace([0, Assert_failure, _m_], 1); + case 11: + var rest1$10 = ty1[1], switch$11 = 0; + if(typeof ty2 === "number") + switch$11 = 1; + else + switch(ty2[0]){ + case 10: break; + case 11: + var rest2$10 = ty2[1]; return [11, trans(rest1$10, rest2$10)]; + default: switch$11 = 1; + } + if(switch$11) + throw caml_maybe_attach_backtrace([0, Assert_failure, _n_], 1); + break; + case 12: + var rest1$11 = ty1[1], switch$12 = 0; + if(typeof ty2 === "number") + switch$12 = 1; + else + switch(ty2[0]){ + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + var rest2$11 = ty2[1]; return [12, trans(rest1$11, rest2$11)]; + default: switch$12 = 1; + } + if(switch$12) + throw caml_maybe_attach_backtrace([0, Assert_failure, _o_], 1); + break; + case 13: + var rest1$12 = ty1[1], switch$13 = 0; + if(typeof ty2 === "number") + switch$13 = 1; + else + switch(ty2[0]){ + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + var rest2$12 = ty2[1]; return [13, trans(rest1$12, rest2$12)]; + default: switch$13 = 1; + } + if(switch$13) + throw caml_maybe_attach_backtrace([0, Assert_failure, _p_], 1); + break; + default: + var rest1$13 = ty1[1], switch$14 = 0; + if(typeof ty2 === "number") + switch$14 = 1; + else + switch(ty2[0]){ + case 10: break; + case 11: + switch$0 = 1; break; + case 12: + switch$0 = 2; break; + case 13: + switch$0 = 3; break; + case 14: + var rest2$13 = ty2[1]; return [14, trans(rest1$13, rest2$13)]; + default: switch$14 = 1; + } + if(switch$14) + throw caml_maybe_attach_backtrace([0, Assert_failure, _q_], 1); + } + switch(switch$0){ + case 0: + throw caml_maybe_attach_backtrace([0, Assert_failure, _e_], 1); + case 1: + throw caml_maybe_attach_backtrace([0, Assert_failure, _f_], 1); + case 2: + throw caml_maybe_attach_backtrace([0, Assert_failure, _g_], 1); + case 3: + throw caml_maybe_attach_backtrace([0, Assert_failure, _h_], 1); + case 4: + throw caml_maybe_attach_backtrace([0, Assert_failure, _i_], 1); + case 5: + throw caml_maybe_attach_backtrace([0, Assert_failure, _c_], 1); + case 6: + throw caml_maybe_attach_backtrace([0, Assert_failure, _d_], 1); + default: throw caml_maybe_attach_backtrace([0, Assert_failure, _j_], 1); + } + } + function fmtty_of_padding_fmtty(pad, fmtty){ + return typeof pad === "number" ? fmtty : 0 === pad[0] ? fmtty : [2, fmtty]; + } + function fmtty_of_custom(arity, fmtty){ + if(! arity) return fmtty; + var arity$0 = arity[1]; + return [12, fmtty_of_custom(arity$0, fmtty)]; + } + function fmtty_of_fmt(fmtty){ + var fmtty$0 = fmtty; + for(;;){ + if(typeof fmtty$0 === "number") return 0; + switch(fmtty$0[0]){ + case 0: + var rest = fmtty$0[1]; return [0, fmtty_of_fmt(rest)]; + case 1: + var rest$0 = fmtty$0[1]; return [0, fmtty_of_fmt(rest$0)]; + case 2: + var rest$1 = fmtty$0[2], pad = fmtty$0[1]; + return fmtty_of_padding_fmtty(pad, [1, fmtty_of_fmt(rest$1)]); + case 3: + var rest$2 = fmtty$0[2], pad$0 = fmtty$0[1]; + return fmtty_of_padding_fmtty(pad$0, [1, fmtty_of_fmt(rest$2)]); + case 4: + var + rest$3 = fmtty$0[4], + prec = fmtty$0[3], + pad$1 = fmtty$0[2], + ty_rest = fmtty_of_fmt(rest$3), + prec_ty = fmtty_of_precision_fmtty(prec, [2, ty_rest]); + return fmtty_of_padding_fmtty(pad$1, prec_ty); + case 5: + var + rest$4 = fmtty$0[4], + prec$0 = fmtty$0[3], + pad$2 = fmtty$0[2], + ty_rest$0 = fmtty_of_fmt(rest$4), + prec_ty$0 = fmtty_of_precision_fmtty(prec$0, [3, ty_rest$0]); + return fmtty_of_padding_fmtty(pad$2, prec_ty$0); + case 6: + var + rest$5 = fmtty$0[4], + prec$1 = fmtty$0[3], + pad$3 = fmtty$0[2], + ty_rest$1 = fmtty_of_fmt(rest$5), + prec_ty$1 = fmtty_of_precision_fmtty(prec$1, [4, ty_rest$1]); + return fmtty_of_padding_fmtty(pad$3, prec_ty$1); + case 7: + var + rest$6 = fmtty$0[4], + prec$2 = fmtty$0[3], + pad$4 = fmtty$0[2], + ty_rest$2 = fmtty_of_fmt(rest$6), + prec_ty$2 = fmtty_of_precision_fmtty(prec$2, [5, ty_rest$2]); + return fmtty_of_padding_fmtty(pad$4, prec_ty$2); + case 8: + var + rest$7 = fmtty$0[4], + prec$3 = fmtty$0[3], + pad$5 = fmtty$0[2], + ty_rest$3 = fmtty_of_fmt(rest$7), + prec_ty$3 = fmtty_of_precision_fmtty(prec$3, [6, ty_rest$3]); + return fmtty_of_padding_fmtty(pad$5, prec_ty$3); + case 9: + var rest$8 = fmtty$0[2], pad$6 = fmtty$0[1]; + return fmtty_of_padding_fmtty(pad$6, [7, fmtty_of_fmt(rest$8)]); + case 10: + var fmtty$1 = fmtty$0[1], fmtty$0 = fmtty$1; continue; + case 11: + var fmtty$2 = fmtty$0[2], fmtty$0 = fmtty$2; continue; + case 12: + var fmtty$3 = fmtty$0[2], fmtty$0 = fmtty$3; continue; + case 13: + var rest$9 = fmtty$0[3], ty = fmtty$0[2]; + return [8, ty, fmtty_of_fmt(rest$9)]; + case 14: + var rest$10 = fmtty$0[3], ty$0 = fmtty$0[2]; + return [9, ty$0, ty$0, fmtty_of_fmt(rest$10)]; + case 15: + var rest$11 = fmtty$0[1]; return [10, fmtty_of_fmt(rest$11)]; + case 16: + var rest$12 = fmtty$0[1]; return [11, fmtty_of_fmt(rest$12)]; + case 17: + var fmtty$4 = fmtty$0[2], fmtty$0 = fmtty$4; continue; + case 18: + var + rest$13 = fmtty$0[2], + formatting_gen = fmtty$0[1], + _db_ = fmtty_of_fmt(rest$13); + if(0 === formatting_gen[0]) + var fmt = formatting_gen[1][1], _dc_ = fmtty_of_fmt(fmt); + else + var fmt$0 = formatting_gen[1][1], _dc_ = fmtty_of_fmt(fmt$0); + return caml_call2(CamlinternalFormatBasics[1], _dc_, _db_); + case 19: + var rest$14 = fmtty$0[1]; return [13, fmtty_of_fmt(rest$14)]; + case 20: + var rest$15 = fmtty$0[3]; return [1, fmtty_of_fmt(rest$15)]; + case 21: + var rest$16 = fmtty$0[2]; return [2, fmtty_of_fmt(rest$16)]; + case 22: + var rest$17 = fmtty$0[1]; return [0, fmtty_of_fmt(rest$17)]; + case 23: + var fmtty$5 = fmtty$0[2], ign = fmtty$0[1]; + if(typeof ign === "number") + switch(ign){ + case 0: + var fmtty$0 = fmtty$5; continue; + case 1: + var fmtty$0 = fmtty$5; continue; + case 2: + return [14, fmtty_of_fmt(fmtty$5)]; + default: var fmtty$0 = fmtty$5; continue; + } + switch(ign[0]){ + case 0: + var fmtty$0 = fmtty$5; continue; + case 1: + var fmtty$0 = fmtty$5; continue; + case 2: + var fmtty$0 = fmtty$5; continue; + case 3: + var fmtty$0 = fmtty$5; continue; + case 4: + var fmtty$0 = fmtty$5; continue; + case 5: + var fmtty$0 = fmtty$5; continue; + case 6: + var fmtty$0 = fmtty$5; continue; + case 7: + var fmtty$0 = fmtty$5; continue; + case 8: + var fmtty$0 = fmtty$5; continue; + case 9: + var fmtty$6 = ign[2], _dd_ = fmtty_of_fmt(fmtty$5); + return caml_call2(CamlinternalFormatBasics[1], fmtty$6, _dd_); + case 10: + var fmtty$0 = fmtty$5; continue; + default: var fmtty$0 = fmtty$5; continue; + } + default: + var rest$18 = fmtty$0[3], arity = fmtty$0[1]; + return fmtty_of_custom(arity, fmtty_of_fmt(rest$18)); + } + } + } + function fmtty_of_precision_fmtty(prec, fmtty){ + return typeof prec === "number" ? prec ? [2, fmtty] : fmtty : fmtty; + } + var + Type_mismatch = + [248, cst_CamlinternalFormat_Type_mi, runtime.caml_fresh_oo_id(0)]; + function type_padding(pad, fmtty){ + if(typeof pad === "number") return [0, 0, fmtty]; + if(0 === pad[0]){ + var w = pad[2], padty = pad[1]; + return [0, [0, padty, w], fmtty]; + } + if(typeof fmtty !== "number" && 2 === fmtty[0]){ + var rest = fmtty[1], padty$0 = pad[1]; + return [0, [1, padty$0], rest]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + } + function type_padprec(pad, prec, fmtty){ + var match = type_padding(pad, fmtty); + if(typeof prec !== "number"){ + var rest$1 = match[2], pad$2 = match[1], p = prec[1]; + return [0, pad$2, [0, p], rest$1]; + } + if(! prec){ + var rest$0 = match[2], pad$1 = match[1]; + return [0, pad$1, 0, rest$0]; + } + var match$0 = match[2]; + if(typeof match$0 !== "number" && 2 === match$0[0]){ + var rest = match$0[1], pad$0 = match[1]; + return [0, pad$0, 1, rest]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + } + function type_format(fmt, fmtty){ + var _da_ = type_format_gen(fmt, fmtty); + if(typeof _da_[2] !== "number") + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + var fmt$0 = _da_[1]; + return fmt$0; + } + function type_ignored_param_one(ign, fmt, fmtty){ + var + match = type_format_gen(fmt, fmtty), + fmtty$0 = match[2], + fmt$0 = match[1]; + return [0, [23, ign, fmt$0], fmtty$0]; + } + function type_format_gen(fmt, fmtty0){ + if(typeof fmt === "number") return [0, 0, fmtty0]; + switch(fmt[0]){ + case 0: + if(typeof fmtty0 !== "number" && 0 === fmtty0[0]){ + var + fmtty_rest = fmtty0[1], + fmt_rest = fmt[1], + match = type_format_gen(fmt_rest, fmtty_rest), + fmtty = match[2], + fmt$0 = match[1]; + return [0, [0, fmt$0], fmtty]; + } + break; + case 1: + if(typeof fmtty0 !== "number" && 0 === fmtty0[0]){ + var + fmtty_rest$0 = fmtty0[1], + fmt_rest$0 = fmt[1], + match$0 = type_format_gen(fmt_rest$0, fmtty_rest$0), + fmtty$0 = match$0[2], + fmt$1 = match$0[1]; + return [0, [1, fmt$1], fmtty$0]; + } + break; + case 2: + var + fmt_rest$1 = fmt[2], + pad = fmt[1], + match$1 = type_padding(pad, fmtty0), + pad$0 = match$1[1], + match$2 = match$1[2]; + if(typeof match$2 !== "number" && 1 === match$2[0]){ + var + fmtty_rest$1 = match$2[1], + match$3 = type_format_gen(fmt_rest$1, fmtty_rest$1), + fmtty$1 = match$3[2], + fmt$2 = match$3[1]; + return [0, [2, pad$0, fmt$2], fmtty$1]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 3: + var + fmt_rest$2 = fmt[2], + pad$1 = fmt[1], + match$4 = type_padding(pad$1, fmtty0), + pad$2 = match$4[1], + match$5 = match$4[2]; + if(typeof match$5 !== "number" && 1 === match$5[0]){ + var + fmtty_rest$2 = match$5[1], + match$6 = type_format_gen(fmt_rest$2, fmtty_rest$2), + fmtty$2 = match$6[2], + fmt$3 = match$6[1]; + return [0, [3, pad$2, fmt$3], fmtty$2]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 4: + var + fmt_rest$3 = fmt[4], + prec = fmt[3], + pad$3 = fmt[2], + iconv = fmt[1], + match$7 = type_padprec(pad$3, prec, fmtty0), + pad$4 = match$7[1], + match$8 = match$7[3]; + if(typeof match$8 !== "number" && 2 === match$8[0]){ + var + fmtty_rest$3 = match$8[1], + prec$0 = match$7[2], + match$9 = type_format_gen(fmt_rest$3, fmtty_rest$3), + fmtty$3 = match$9[2], + fmt$4 = match$9[1]; + return [0, [4, iconv, pad$4, prec$0, fmt$4], fmtty$3]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 5: + var + fmt_rest$4 = fmt[4], + prec$1 = fmt[3], + pad$5 = fmt[2], + iconv$0 = fmt[1], + match$10 = type_padprec(pad$5, prec$1, fmtty0), + pad$6 = match$10[1], + match$11 = match$10[3]; + if(typeof match$11 !== "number" && 3 === match$11[0]){ + var + fmtty_rest$4 = match$11[1], + prec$2 = match$10[2], + match$12 = type_format_gen(fmt_rest$4, fmtty_rest$4), + fmtty$4 = match$12[2], + fmt$5 = match$12[1]; + return [0, [5, iconv$0, pad$6, prec$2, fmt$5], fmtty$4]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 6: + var + fmt_rest$5 = fmt[4], + prec$3 = fmt[3], + pad$7 = fmt[2], + iconv$1 = fmt[1], + match$13 = type_padprec(pad$7, prec$3, fmtty0), + pad$8 = match$13[1], + match$14 = match$13[3]; + if(typeof match$14 !== "number" && 4 === match$14[0]){ + var + fmtty_rest$5 = match$14[1], + prec$4 = match$13[2], + match$15 = type_format_gen(fmt_rest$5, fmtty_rest$5), + fmtty$5 = match$15[2], + fmt$6 = match$15[1]; + return [0, [6, iconv$1, pad$8, prec$4, fmt$6], fmtty$5]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 7: + var + fmt_rest$6 = fmt[4], + prec$5 = fmt[3], + pad$9 = fmt[2], + iconv$2 = fmt[1], + match$16 = type_padprec(pad$9, prec$5, fmtty0), + pad$10 = match$16[1], + match$17 = match$16[3]; + if(typeof match$17 !== "number" && 5 === match$17[0]){ + var + fmtty_rest$6 = match$17[1], + prec$6 = match$16[2], + match$18 = type_format_gen(fmt_rest$6, fmtty_rest$6), + fmtty$6 = match$18[2], + fmt$7 = match$18[1]; + return [0, [7, iconv$2, pad$10, prec$6, fmt$7], fmtty$6]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 8: + var + fmt_rest$7 = fmt[4], + prec$7 = fmt[3], + pad$11 = fmt[2], + fconv = fmt[1], + match$19 = type_padprec(pad$11, prec$7, fmtty0), + pad$12 = match$19[1], + match$20 = match$19[3]; + if(typeof match$20 !== "number" && 6 === match$20[0]){ + var + fmtty_rest$7 = match$20[1], + prec$8 = match$19[2], + match$21 = type_format_gen(fmt_rest$7, fmtty_rest$7), + fmtty$7 = match$21[2], + fmt$8 = match$21[1]; + return [0, [8, fconv, pad$12, prec$8, fmt$8], fmtty$7]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 9: + var + fmt_rest$8 = fmt[2], + pad$13 = fmt[1], + match$22 = type_padding(pad$13, fmtty0), + pad$14 = match$22[1], + match$23 = match$22[2]; + if(typeof match$23 !== "number" && 7 === match$23[0]){ + var + fmtty_rest$8 = match$23[1], + match$24 = type_format_gen(fmt_rest$8, fmtty_rest$8), + fmtty$8 = match$24[2], + fmt$9 = match$24[1]; + return [0, [9, pad$14, fmt$9], fmtty$8]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + case 10: + var + fmt_rest$9 = fmt[1], + match$25 = type_format_gen(fmt_rest$9, fmtty0), + fmtty$9 = match$25[2], + fmt$10 = match$25[1]; + return [0, [10, fmt$10], fmtty$9]; + case 11: + var + fmt_rest$10 = fmt[2], + str = fmt[1], + match$26 = type_format_gen(fmt_rest$10, fmtty0), + fmtty$10 = match$26[2], + fmt$11 = match$26[1]; + return [0, [11, str, fmt$11], fmtty$10]; + case 12: + var + fmt_rest$11 = fmt[2], + chr = fmt[1], + match$27 = type_format_gen(fmt_rest$11, fmtty0), + fmtty$11 = match$27[2], + fmt$12 = match$27[1]; + return [0, [12, chr, fmt$12], fmtty$11]; + case 13: + if(typeof fmtty0 !== "number" && 8 === fmtty0[0]){ + var + fmtty_rest$9 = fmtty0[2], + sub_fmtty = fmtty0[1], + fmt_rest$12 = fmt[3], + sub_fmtty$0 = fmt[2], + pad_opt = fmt[1]; + if(caml_notequal([0, sub_fmtty$0], [0, sub_fmtty])) + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + var + match$28 = type_format_gen(fmt_rest$12, fmtty_rest$9), + fmtty$12 = match$28[2], + fmt$13 = match$28[1]; + return [0, [13, pad_opt, sub_fmtty, fmt$13], fmtty$12]; + } + break; + case 14: + if(typeof fmtty0 !== "number" && 9 === fmtty0[0]){ + var + fmtty_rest$10 = fmtty0[3], + sub_fmtty1 = fmtty0[1], + fmt_rest$13 = fmt[3], + sub_fmtty$1 = fmt[2], + pad_opt$0 = fmt[1], + _c__ = [0, caml_call1(CamlinternalFormatBasics[2], sub_fmtty1)]; + if + (caml_notequal + ([0, caml_call1(CamlinternalFormatBasics[2], sub_fmtty$1)], _c__)) + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + var + match$29 = + type_format_gen + (fmt_rest$13, + caml_call1(CamlinternalFormatBasics[2], fmtty_rest$10)), + fmtty$13 = match$29[2], + fmt$14 = match$29[1]; + return [0, [14, pad_opt$0, sub_fmtty1, fmt$14], fmtty$13]; + } + break; + case 15: + if(typeof fmtty0 !== "number" && 10 === fmtty0[0]){ + var + fmtty_rest$11 = fmtty0[1], + fmt_rest$14 = fmt[1], + match$30 = type_format_gen(fmt_rest$14, fmtty_rest$11), + fmtty$14 = match$30[2], + fmt$15 = match$30[1]; + return [0, [15, fmt$15], fmtty$14]; + } + break; + case 16: + if(typeof fmtty0 !== "number" && 11 === fmtty0[0]){ + var + fmtty_rest$12 = fmtty0[1], + fmt_rest$15 = fmt[1], + match$31 = type_format_gen(fmt_rest$15, fmtty_rest$12), + fmtty$15 = match$31[2], + fmt$16 = match$31[1]; + return [0, [16, fmt$16], fmtty$15]; + } + break; + case 17: + var + fmt_rest$16 = fmt[2], + formatting_lit = fmt[1], + match$32 = type_format_gen(fmt_rest$16, fmtty0), + fmtty$16 = match$32[2], + fmt$17 = match$32[1]; + return [0, [17, formatting_lit, fmt$17], fmtty$16]; + case 18: + var fmt_rest$17 = fmt[2], formatting_gen = fmt[1]; + if(0 === formatting_gen[0]){ + var + match$36 = formatting_gen[1], + str$0 = match$36[2], + fmt1 = match$36[1], + match$37 = type_format_gen(fmt1, fmtty0), + fmtty2 = match$37[2], + fmt2 = match$37[1], + match$38 = type_format_gen(fmt_rest$17, fmtty2), + fmtty3 = match$38[2], + fmt3 = match$38[1]; + return [0, [18, [0, [0, fmt2, str$0]], fmt3], fmtty3]; + } + var + match$39 = formatting_gen[1], + str$1 = match$39[2], + fmt1$0 = match$39[1], + match$40 = type_format_gen(fmt1$0, fmtty0), + fmtty2$0 = match$40[2], + fmt2$0 = match$40[1], + match$41 = type_format_gen(fmt_rest$17, fmtty2$0), + fmtty3$0 = match$41[2], + fmt3$0 = match$41[1]; + return [0, [18, [1, [0, fmt2$0, str$1]], fmt3$0], fmtty3$0]; + case 19: + if(typeof fmtty0 !== "number" && 13 === fmtty0[0]){ + var + fmtty_rest$13 = fmtty0[1], + fmt_rest$18 = fmt[1], + match$33 = type_format_gen(fmt_rest$18, fmtty_rest$13), + fmtty$17 = match$33[2], + fmt$18 = match$33[1]; + return [0, [19, fmt$18], fmtty$17]; + } + break; + case 20: + if(typeof fmtty0 !== "number" && 1 === fmtty0[0]){ + var + fmtty_rest$14 = fmtty0[1], + fmt_rest$19 = fmt[3], + char_set = fmt[2], + width_opt = fmt[1], + match$34 = type_format_gen(fmt_rest$19, fmtty_rest$14), + fmtty$18 = match$34[2], + fmt$19 = match$34[1]; + return [0, [20, width_opt, char_set, fmt$19], fmtty$18]; + } + break; + case 21: + if(typeof fmtty0 !== "number" && 2 === fmtty0[0]){ + var + fmtty_rest$15 = fmtty0[1], + fmt_rest$20 = fmt[2], + counter = fmt[1], + match$35 = type_format_gen(fmt_rest$20, fmtty_rest$15), + fmtty$19 = match$35[2], + fmt$20 = match$35[1]; + return [0, [21, counter, fmt$20], fmtty$19]; + } + break; + case 23: + var rest = fmt[2], ign = fmt[1]; + if(typeof ign !== "number") + switch(ign[0]){ + case 0: + return type_ignored_param_one(ign, rest, fmtty0); + case 1: + return type_ignored_param_one(ign, rest, fmtty0); + case 2: + return type_ignored_param_one(ign, rest, fmtty0); + case 3: + return type_ignored_param_one(ign, rest, fmtty0); + case 4: + return type_ignored_param_one(ign, rest, fmtty0); + case 5: + return type_ignored_param_one(ign, rest, fmtty0); + case 6: + return type_ignored_param_one(ign, rest, fmtty0); + case 7: + return type_ignored_param_one(ign, rest, fmtty0); + case 8: + var sub_fmtty$2 = ign[2], pad_opt$1 = ign[1]; + return type_ignored_param_one + ([8, pad_opt$1, sub_fmtty$2], rest, fmtty0); + case 9: + var + sub_fmtty$3 = ign[2], + pad_opt$2 = ign[1], + _c$_ = type_ignored_format_substituti(sub_fmtty$3, rest, fmtty0), + match$43 = _c$_[2], + fmtty$21 = match$43[2], + fmt$22 = match$43[1], + sub_fmtty$4 = _c$_[1]; + return [0, [23, [9, pad_opt$2, sub_fmtty$4], fmt$22], fmtty$21]; + case 10: + return type_ignored_param_one(ign, rest, fmtty0); + default: return type_ignored_param_one(ign, rest, fmtty0); + } + switch(ign){ + case 0: + return type_ignored_param_one(ign, rest, fmtty0); + case 1: + return type_ignored_param_one(ign, rest, fmtty0); + case 2: + if(typeof fmtty0 !== "number" && 14 === fmtty0[0]){ + var + fmtty_rest$16 = fmtty0[1], + match$42 = type_format_gen(rest, fmtty_rest$16), + fmtty$20 = match$42[2], + fmt$21 = match$42[1]; + return [0, [23, 2, fmt$21], fmtty$20]; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + default: return type_ignored_param_one(ign, rest, fmtty0); + } + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + } + function type_ignored_format_substituti(sub_fmtty, fmt, fmtty){ + if(typeof sub_fmtty === "number") + return [0, 0, type_format_gen(fmt, fmtty)]; + switch(sub_fmtty[0]){ + case 0: + if(typeof fmtty !== "number" && 0 === fmtty[0]){ + var + fmtty_rest = fmtty[1], + sub_fmtty_rest = sub_fmtty[1], + match = + type_ignored_format_substituti(sub_fmtty_rest, fmt, fmtty_rest), + fmt$0 = match[2], + sub_fmtty_rest$0 = match[1]; + return [0, [0, sub_fmtty_rest$0], fmt$0]; + } + break; + case 1: + if(typeof fmtty !== "number" && 1 === fmtty[0]){ + var + fmtty_rest$0 = fmtty[1], + sub_fmtty_rest$1 = sub_fmtty[1], + match$0 = + type_ignored_format_substituti(sub_fmtty_rest$1, fmt, fmtty_rest$0), + fmt$1 = match$0[2], + sub_fmtty_rest$2 = match$0[1]; + return [0, [1, sub_fmtty_rest$2], fmt$1]; + } + break; + case 2: + if(typeof fmtty !== "number" && 2 === fmtty[0]){ + var + fmtty_rest$1 = fmtty[1], + sub_fmtty_rest$3 = sub_fmtty[1], + match$1 = + type_ignored_format_substituti(sub_fmtty_rest$3, fmt, fmtty_rest$1), + fmt$2 = match$1[2], + sub_fmtty_rest$4 = match$1[1]; + return [0, [2, sub_fmtty_rest$4], fmt$2]; + } + break; + case 3: + if(typeof fmtty !== "number" && 3 === fmtty[0]){ + var + fmtty_rest$2 = fmtty[1], + sub_fmtty_rest$5 = sub_fmtty[1], + match$2 = + type_ignored_format_substituti(sub_fmtty_rest$5, fmt, fmtty_rest$2), + fmt$3 = match$2[2], + sub_fmtty_rest$6 = match$2[1]; + return [0, [3, sub_fmtty_rest$6], fmt$3]; + } + break; + case 4: + if(typeof fmtty !== "number" && 4 === fmtty[0]){ + var + fmtty_rest$3 = fmtty[1], + sub_fmtty_rest$7 = sub_fmtty[1], + match$3 = + type_ignored_format_substituti(sub_fmtty_rest$7, fmt, fmtty_rest$3), + fmt$4 = match$3[2], + sub_fmtty_rest$8 = match$3[1]; + return [0, [4, sub_fmtty_rest$8], fmt$4]; + } + break; + case 5: + if(typeof fmtty !== "number" && 5 === fmtty[0]){ + var + fmtty_rest$4 = fmtty[1], + sub_fmtty_rest$9 = sub_fmtty[1], + match$4 = + type_ignored_format_substituti(sub_fmtty_rest$9, fmt, fmtty_rest$4), + fmt$5 = match$4[2], + sub_fmtty_rest$10 = match$4[1]; + return [0, [5, sub_fmtty_rest$10], fmt$5]; + } + break; + case 6: + if(typeof fmtty !== "number" && 6 === fmtty[0]){ + var + fmtty_rest$5 = fmtty[1], + sub_fmtty_rest$11 = sub_fmtty[1], + match$5 = + type_ignored_format_substituti + (sub_fmtty_rest$11, fmt, fmtty_rest$5), + fmt$6 = match$5[2], + sub_fmtty_rest$12 = match$5[1]; + return [0, [6, sub_fmtty_rest$12], fmt$6]; + } + break; + case 7: + if(typeof fmtty !== "number" && 7 === fmtty[0]){ + var + fmtty_rest$6 = fmtty[1], + sub_fmtty_rest$13 = sub_fmtty[1], + match$6 = + type_ignored_format_substituti + (sub_fmtty_rest$13, fmt, fmtty_rest$6), + fmt$7 = match$6[2], + sub_fmtty_rest$14 = match$6[1]; + return [0, [7, sub_fmtty_rest$14], fmt$7]; + } + break; + case 8: + if(typeof fmtty !== "number" && 8 === fmtty[0]){ + var + fmtty_rest$7 = fmtty[2], + sub2_fmtty = fmtty[1], + sub_fmtty_rest$15 = sub_fmtty[2], + sub2_fmtty$0 = sub_fmtty[1]; + if(caml_notequal([0, sub2_fmtty$0], [0, sub2_fmtty])) + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + var + match$7 = + type_ignored_format_substituti + (sub_fmtty_rest$15, fmt, fmtty_rest$7), + fmt$8 = match$7[2], + sub_fmtty_rest$16 = match$7[1]; + return [0, [8, sub2_fmtty, sub_fmtty_rest$16], fmt$8]; + } + break; + case 9: + if(typeof fmtty !== "number" && 9 === fmtty[0]){ + var + fmtty_rest$8 = fmtty[3], + sub2_fmtty$1 = fmtty[2], + sub1_fmtty = fmtty[1], + sub_fmtty_rest$17 = sub_fmtty[3], + sub2_fmtty$2 = sub_fmtty[2], + sub1_fmtty$0 = sub_fmtty[1], + _c8_ = [0, caml_call1(CamlinternalFormatBasics[2], sub1_fmtty)]; + if + (caml_notequal + ([0, caml_call1(CamlinternalFormatBasics[2], sub1_fmtty$0)], _c8_)) + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + var _c9_ = [0, caml_call1(CamlinternalFormatBasics[2], sub2_fmtty$1)]; + if + (caml_notequal + ([0, caml_call1(CamlinternalFormatBasics[2], sub2_fmtty$2)], _c9_)) + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + var + sub_fmtty$0 = trans(symm(sub1_fmtty), sub2_fmtty$1), + match$8 = fmtty_rel_det(sub_fmtty$0), + f4 = match$8[4], + f2 = match$8[2]; + f2(0); + f4(0); + var + match$9 = + type_ignored_format_substituti + (caml_call1(CamlinternalFormatBasics[2], sub_fmtty_rest$17), + fmt, + fmtty_rest$8), + fmt$9 = match$9[2], + sub_fmtty_rest$18 = match$9[1]; + return [0, + [9, sub1_fmtty, sub2_fmtty$1, symm(sub_fmtty_rest$18)], + fmt$9]; + } + break; + case 10: + if(typeof fmtty !== "number" && 10 === fmtty[0]){ + var + fmtty_rest$9 = fmtty[1], + sub_fmtty_rest$19 = sub_fmtty[1], + match$10 = + type_ignored_format_substituti + (sub_fmtty_rest$19, fmt, fmtty_rest$9), + fmt$10 = match$10[2], + sub_fmtty_rest$20 = match$10[1]; + return [0, [10, sub_fmtty_rest$20], fmt$10]; + } + break; + case 11: + if(typeof fmtty !== "number" && 11 === fmtty[0]){ + var + fmtty_rest$10 = fmtty[1], + sub_fmtty_rest$21 = sub_fmtty[1], + match$11 = + type_ignored_format_substituti + (sub_fmtty_rest$21, fmt, fmtty_rest$10), + fmt$11 = match$11[2], + sub_fmtty_rest$22 = match$11[1]; + return [0, [11, sub_fmtty_rest$22], fmt$11]; + } + break; + case 13: + if(typeof fmtty !== "number" && 13 === fmtty[0]){ + var + fmtty_rest$11 = fmtty[1], + sub_fmtty_rest$23 = sub_fmtty[1], + match$12 = + type_ignored_format_substituti + (sub_fmtty_rest$23, fmt, fmtty_rest$11), + fmt$12 = match$12[2], + sub_fmtty_rest$24 = match$12[1]; + return [0, [13, sub_fmtty_rest$24], fmt$12]; + } + break; + case 14: + if(typeof fmtty !== "number" && 14 === fmtty[0]){ + var + fmtty_rest$12 = fmtty[1], + sub_fmtty_rest$25 = sub_fmtty[1], + match$13 = + type_ignored_format_substituti + (sub_fmtty_rest$25, fmt, fmtty_rest$12), + fmt$13 = match$13[2], + sub_fmtty_rest$26 = match$13[1]; + return [0, [14, sub_fmtty_rest$26], fmt$13]; + } + break; + } + throw caml_maybe_attach_backtrace(Type_mismatch, 1); + } + function recast(fmt, fmtty){ + var _c7_ = symm(fmtty); + return type_format(fmt, caml_call1(CamlinternalFormatBasics[2], _c7_)); + } + function fix_padding(padty, width, str){ + var + len = caml_ml_string_length(str), + padty$0 = 0 <= width ? padty : 0, + width$0 = caml_call1(Stdlib[18], width); + if(width$0 <= len) return str; + var + _c6_ = 2 === padty$0 ? 48 : 32, + res = caml_call2(Stdlib_Bytes[1], width$0, _c6_); + switch(padty$0){ + case 0: + caml_call5(Stdlib_String[48], str, 0, res, 0, len); break; + case 1: + caml_call5(Stdlib_String[48], str, 0, res, width$0 - len | 0, len); + break; + default: + var switch$0 = 0; + if(0 < len){ + var switch$1 = 0; + if + (43 !== caml_string_get(str, 0) + && 45 !== caml_string_get(str, 0) && 32 !== caml_string_get(str, 0)){switch$0 = 1; switch$1 = 1;} + if(! switch$1){ + caml_bytes_set(res, 0, caml_string_get(str, 0)); + caml_call5 + (Stdlib_String[48], + str, + 1, + res, + (width$0 - len | 0) + 1 | 0, + len - 1 | 0); + } + } + else + switch$0 = 1; + if(switch$0){ + var switch$2 = 0; + if(1 < len && 48 === caml_string_get(str, 0)){ + var switch$3 = 0; + if(120 === caml_string_get(str, 1) || 88 === caml_string_get(str, 1)) + switch$3 = 1; + if(switch$3){ + caml_bytes_set(res, 1, caml_string_get(str, 1)); + caml_call5 + (Stdlib_String[48], + str, + 2, + res, + (width$0 - len | 0) + 2 | 0, + len - 2 | 0); + switch$2 = 1; + } + } + if(! switch$2) + caml_call5(Stdlib_String[48], str, 0, res, width$0 - len | 0, len); + } + } + return caml_call1(Stdlib_Bytes[48], res); + } + function fix_int_precision(prec, str){ + var + prec$0 = caml_call1(Stdlib[18], prec), + len = caml_ml_string_length(str), + c = caml_string_get(str, 0), + switch$0 = 0; + if(58 <= c){ + if(71 <= c){ + if(5 >= c - 97 >>> 0) switch$0 = 1; + } + else if(65 <= c) switch$0 = 1; + } + else{ + var switch$1 = 0; + if(32 === c) + switch$1 = 1; + else if(43 <= c) + switch(c - 43 | 0){ + case 5: + if(len < (prec$0 + 2 | 0) && 1 < len){ + var switch$2 = 0; + if + (120 !== caml_string_get(str, 1) && 88 !== caml_string_get(str, 1)) + switch$2 = 1; + if(! switch$2){ + var res$1 = caml_call2(Stdlib_Bytes[1], prec$0 + 2 | 0, 48); + caml_bytes_set(res$1, 1, caml_string_get(str, 1)); + caml_call5 + (Stdlib_String[48], + str, + 2, + res$1, + (prec$0 - len | 0) + 4 | 0, + len - 2 | 0); + return caml_call1(Stdlib_Bytes[48], res$1); + } + } + switch$0 = 1; + break; + case 0: + case 2: + switch$1 = 1; break; + case 1: + case 3: + case 4: break; + default: switch$0 = 1; + } + if(switch$1 && len < (prec$0 + 1 | 0)){ + var res$0 = caml_call2(Stdlib_Bytes[1], prec$0 + 1 | 0, 48); + caml_bytes_set(res$0, 0, c); + caml_call5 + (Stdlib_String[48], + str, + 1, + res$0, + (prec$0 - len | 0) + 2 | 0, + len - 1 | 0); + return caml_call1(Stdlib_Bytes[48], res$0); + } + } + if(switch$0 && len < prec$0){ + var res = caml_call2(Stdlib_Bytes[1], prec$0, 48); + caml_call5(Stdlib_String[48], str, 0, res, prec$0 - len | 0, len); + return caml_call1(Stdlib_Bytes[48], res); + } + return str; + } + function string_to_caml_string(str){ + var + str$0 = caml_call1(Stdlib_String[24], str), + l = caml_ml_string_length(str$0), + res = caml_call2(Stdlib_Bytes[1], l + 2 | 0, 34); + caml_blit_string(str$0, 0, res, 1, l); + return caml_call1(Stdlib_Bytes[48], res); + } + function format_of_fconv(fconv, prec){ + var + prec$0 = caml_call1(Stdlib[18], prec), + symb = char_of_fconv(_r_, fconv), + buf = buffer_create(16); + buffer_add_char(buf, 37); + bprint_fconv_flag(buf, fconv); + buffer_add_char(buf, 46); + buffer_add_string(buf, caml_call1(Stdlib_Int[12], prec$0)); + buffer_add_char(buf, symb); + return buffer_contents(buf); + } + function transform_int_alt(iconv, s){ + if(13 > iconv) return s; + var n = [0, 0], _c1_ = caml_ml_string_length(s) - 1 | 0, _c0_ = 0; + if(_c1_ >= 0){ + var i$0 = _c0_; + for(;;){ + if(9 >= caml_string_unsafe_get(s, i$0) - 48 >>> 0) n[1]++; + var _c5_ = i$0 + 1 | 0; + if(_c1_ !== i$0){var i$0 = _c5_; continue;} + break; + } + } + var + digits = n[1], + buf = + caml_create_bytes + (caml_ml_string_length(s) + ((digits - 1 | 0) / 3 | 0) | 0), + pos = [0, 0]; + function put(c){caml_bytes_set(buf, pos[1], c); pos[1]++; return 0;} + var + left = [0, ((digits - 1 | 0) % 3 | 0) + 1 | 0], + _c3_ = caml_ml_string_length(s) - 1 | 0, + _c2_ = 0; + if(_c3_ >= 0){ + var i = _c2_; + for(;;){ + var c = caml_string_unsafe_get(s, i); + if(9 < c - 48 >>> 0) + put(c); + else{if(0 === left[1]){put(95); left[1] = 3;} left[1] += -1; put(c);} + var _c4_ = i + 1 | 0; + if(_c3_ !== i){var i = _c4_; continue;} + break; + } + } + return caml_call1(Stdlib_Bytes[48], buf); + } + function convert_int(iconv, n){ + switch(iconv){ + case 1: + var _cZ_ = cst_d$0; break; + case 2: + var _cZ_ = cst_d$1; break; + case 4: + var _cZ_ = cst_i$1; break; + case 5: + var _cZ_ = cst_i$2; break; + case 6: + var _cZ_ = cst_x; break; + case 7: + var _cZ_ = cst_x$0; break; + case 8: + var _cZ_ = cst_X; break; + case 9: + var _cZ_ = cst_X$0; break; + case 10: + var _cZ_ = cst_o; break; + case 11: + var _cZ_ = cst_o$0; break; + case 0: + case 13: + var _cZ_ = cst_d; break; + case 3: + case 14: + var _cZ_ = cst_i$0; break; + default: var _cZ_ = cst_u; + } + return transform_int_alt(iconv, caml_format_int(_cZ_, n)); + } + function convert_int32(iconv, n){ + switch(iconv){ + case 1: + var _cY_ = cst_ld$0; break; + case 2: + var _cY_ = cst_ld$1; break; + case 4: + var _cY_ = cst_li$1; break; + case 5: + var _cY_ = cst_li$2; break; + case 6: + var _cY_ = cst_lx; break; + case 7: + var _cY_ = cst_lx$0; break; + case 8: + var _cY_ = cst_lX; break; + case 9: + var _cY_ = cst_lX$0; break; + case 10: + var _cY_ = cst_lo; break; + case 11: + var _cY_ = cst_lo$0; break; + case 0: + case 13: + var _cY_ = cst_ld; break; + case 3: + case 14: + var _cY_ = cst_li$0; break; + default: var _cY_ = cst_lu; + } + return transform_int_alt(iconv, caml_format_int(_cY_, n)); + } + function convert_nativeint(iconv, n){ + switch(iconv){ + case 1: + var _cX_ = cst_nd$0; break; + case 2: + var _cX_ = cst_nd$1; break; + case 4: + var _cX_ = cst_ni$1; break; + case 5: + var _cX_ = cst_ni$2; break; + case 6: + var _cX_ = cst_nx; break; + case 7: + var _cX_ = cst_nx$0; break; + case 8: + var _cX_ = cst_nX; break; + case 9: + var _cX_ = cst_nX$0; break; + case 10: + var _cX_ = cst_no; break; + case 11: + var _cX_ = cst_no$0; break; + case 0: + case 13: + var _cX_ = cst_nd; break; + case 3: + case 14: + var _cX_ = cst_ni$0; break; + default: var _cX_ = cst_nu; + } + return transform_int_alt(iconv, caml_format_int(_cX_, n)); + } + function convert_int64(iconv, n){ + switch(iconv){ + case 1: + var _cW_ = cst_Ld$0; break; + case 2: + var _cW_ = cst_Ld$1; break; + case 4: + var _cW_ = cst_Li$1; break; + case 5: + var _cW_ = cst_Li$2; break; + case 6: + var _cW_ = cst_Lx; break; + case 7: + var _cW_ = cst_Lx$0; break; + case 8: + var _cW_ = cst_LX; break; + case 9: + var _cW_ = cst_LX$0; break; + case 10: + var _cW_ = cst_Lo; break; + case 11: + var _cW_ = cst_Lo$0; break; + case 0: + case 13: + var _cW_ = cst_Ld; break; + case 3: + case 14: + var _cW_ = cst_Li$0; break; + default: var _cW_ = cst_Lu; + } + return transform_int_alt(iconv, runtime.caml_int64_format(_cW_, n)); + } + function convert_float(fconv, prec, x){ + function hex(param){ + switch(fconv[1]){ + case 0: + var sign = 45; break; + case 1: + var sign = 43; break; + default: var sign = 32; + } + return runtime.caml_hexstring_of_float(x, prec, sign); + } + function caml_special_val(str){ + var match = runtime.caml_classify_float(x); + return 3 === match + ? x < 0. ? cst_neg_infinity : cst_infinity + : 4 <= match ? cst_nan : str; + } + switch(fconv[2]){ + case 5: + var + str = caml_format_float(format_of_fconv(fconv, prec), x), + len = caml_ml_string_length(str), + i = 0; + for(;;){ + if(i === len) + var _cT_ = 0; + else{ + var _cS_ = caml_string_get(str, i) - 46 | 0, switch$0 = 0; + if(23 < _cS_ >>> 0){ + if(55 === _cS_) switch$0 = 1; + } + else if(21 < _cS_ - 1 >>> 0) switch$0 = 1; + if(! switch$0){var i$0 = i + 1 | 0, i = i$0; continue;} + var _cT_ = 1; + } + var _cU_ = _cT_ ? str : caml_call2(Stdlib[28], str, cst$17); + return caml_special_val(_cU_); + } + case 6: + return hex(0); + case 7: + var _cV_ = hex(0); return caml_call1(Stdlib_String[25], _cV_); + case 8: + return caml_special_val(hex(0)); + default: return caml_format_float(format_of_fconv(fconv, prec), x); + } + } + function string_of_fmtty(fmtty){ + var buf = buffer_create(16); + bprint_fmtty(buf, fmtty); + return buffer_contents(buf); + } + function make_int_padding_precision(k, acc, fmt, pad, prec, trans, iconv){ + if(typeof pad === "number"){ + if(typeof prec === "number") + return prec + ? function + (p, x){ + var str = fix_int_precision(p, caml_call2(trans, iconv, x)); + return make_printf(k, [4, acc, str], fmt); + } + : function + (x){ + var str = caml_call2(trans, iconv, x); + return make_printf(k, [4, acc, str], fmt); + }; + var p = prec[1]; + return function(x){ + var str = fix_int_precision(p, caml_call2(trans, iconv, x)); + return make_printf(k, [4, acc, str], fmt);}; + } + if(0 === pad[0]){ + var w = pad[2], padty = pad[1]; + if(typeof prec === "number") + return prec + ? function + (p, x){ + var + str = + fix_padding + (padty, + w, + fix_int_precision(p, caml_call2(trans, iconv, x))); + return make_printf(k, [4, acc, str], fmt); + } + : function + (x){ + var str = fix_padding(padty, w, caml_call2(trans, iconv, x)); + return make_printf(k, [4, acc, str], fmt); + }; + var p$0 = prec[1]; + return function(x){ + var + str = + fix_padding + (padty, w, fix_int_precision(p$0, caml_call2(trans, iconv, x))); + return make_printf(k, [4, acc, str], fmt);}; + } + var padty$0 = pad[1]; + if(typeof prec === "number") + return prec + ? function + (w, p, x){ + var + str = + fix_padding + (padty$0, + w, + fix_int_precision(p, caml_call2(trans, iconv, x))); + return make_printf(k, [4, acc, str], fmt); + } + : function + (w, x){ + var str = fix_padding(padty$0, w, caml_call2(trans, iconv, x)); + return make_printf(k, [4, acc, str], fmt); + }; + var p$1 = prec[1]; + return function(w, x){ + var + str = + fix_padding + (padty$0, w, fix_int_precision(p$1, caml_call2(trans, iconv, x))); + return make_printf(k, [4, acc, str], fmt);}; + } + function make_padding(k, acc, fmt, pad, trans){ + if(typeof pad === "number") + return function(x){ + var new_acc = [4, acc, caml_call1(trans, x)]; + return make_printf(k, new_acc, fmt);}; + if(0 === pad[0]){ + var width = pad[2], padty = pad[1]; + return function(x){ + var new_acc = [4, acc, fix_padding(padty, width, caml_call1(trans, x))]; + return make_printf(k, new_acc, fmt);}; + } + var padty$0 = pad[1]; + return function(w, x){ + var new_acc = [4, acc, fix_padding(padty$0, w, caml_call1(trans, x))]; + return make_printf(k, new_acc, fmt);}; + } + function make_printf$0(counter, k, acc, fmt){ + var k$0 = k, acc$0 = acc, fmt$0 = fmt; + for(;;){ + if(typeof fmt$0 === "number") return caml_call1(k$0, acc$0); + switch(fmt$0[0]){ + case 0: + var rest = fmt$0[1]; + return function(c){ + var new_acc = [5, acc$0, c]; + return make_printf(k$0, new_acc, rest);}; + case 1: + var rest$0 = fmt$0[1]; + return function(c){ + var + str = caml_call1(Stdlib_Char[2], c), + l = caml_ml_string_length(str), + res = caml_call2(Stdlib_Bytes[1], l + 2 | 0, 39); + caml_blit_string(str, 0, res, 1, l); + var new_acc = [4, acc$0, caml_call1(Stdlib_Bytes[48], res)]; + return make_printf(k$0, new_acc, rest$0);}; + case 2: + var rest$1 = fmt$0[2], pad = fmt$0[1]; + return make_padding + (k$0, acc$0, rest$1, pad, function(str){return str;}); + case 3: + var rest$2 = fmt$0[2], pad$0 = fmt$0[1]; + return make_padding(k$0, acc$0, rest$2, pad$0, string_to_caml_string); + case 4: + var + rest$3 = fmt$0[4], + prec = fmt$0[3], + pad$1 = fmt$0[2], + iconv = fmt$0[1]; + return make_int_padding_precision + (k$0, acc$0, rest$3, pad$1, prec, convert_int, iconv); + case 5: + var + rest$4 = fmt$0[4], + prec$0 = fmt$0[3], + pad$2 = fmt$0[2], + iconv$0 = fmt$0[1]; + return make_int_padding_precision + (k$0, acc$0, rest$4, pad$2, prec$0, convert_int32, iconv$0); + case 6: + var + rest$5 = fmt$0[4], + prec$1 = fmt$0[3], + pad$3 = fmt$0[2], + iconv$1 = fmt$0[1]; + return make_int_padding_precision + (k$0, + acc$0, + rest$5, + pad$3, + prec$1, + convert_nativeint, + iconv$1); + case 7: + var + rest$6 = fmt$0[4], + prec$2 = fmt$0[3], + pad$4 = fmt$0[2], + iconv$2 = fmt$0[1]; + return make_int_padding_precision + (k$0, acc$0, rest$6, pad$4, prec$2, convert_int64, iconv$2); + case 8: + var + rest$7 = fmt$0[4], + prec$3 = fmt$0[3], + pad$5 = fmt$0[2], + fconv = fmt$0[1]; + if(typeof pad$5 === "number"){ + if(typeof prec$3 === "number") + return prec$3 + ? function + (p, x){ + var str = convert_float(fconv, p, x); + return make_printf(k$0, [4, acc$0, str], rest$7); + } + : function + (x){ + var + str = + convert_float(fconv, default_float_precision(fconv), x); + return make_printf(k$0, [4, acc$0, str], rest$7); + }; + var p = prec$3[1]; + return function(x){ + var str = convert_float(fconv, p, x); + return make_printf(k$0, [4, acc$0, str], rest$7);}; + } + if(0 === pad$5[0]){ + var w = pad$5[2], padty = pad$5[1]; + if(typeof prec$3 === "number") + return prec$3 + ? function + (p, x){ + var str = fix_padding(padty, w, convert_float(fconv, p, x)); + return make_printf(k$0, [4, acc$0, str], rest$7); + } + : function + (x){ + var + str = + convert_float(fconv, default_float_precision(fconv), x), + str$0 = fix_padding(padty, w, str); + return make_printf(k$0, [4, acc$0, str$0], rest$7); + }; + var p$0 = prec$3[1]; + return function(x){ + var str = fix_padding(padty, w, convert_float(fconv, p$0, x)); + return make_printf(k$0, [4, acc$0, str], rest$7);}; + } + var padty$0 = pad$5[1]; + if(typeof prec$3 === "number") + return prec$3 + ? function + (w, p, x){ + var + str = fix_padding(padty$0, w, convert_float(fconv, p, x)); + return make_printf(k$0, [4, acc$0, str], rest$7); + } + : function + (w, x){ + var + str = + convert_float(fconv, default_float_precision(fconv), x), + str$0 = fix_padding(padty$0, w, str); + return make_printf(k$0, [4, acc$0, str$0], rest$7); + }; + var p$1 = prec$3[1]; + return function(w, x){ + var str = fix_padding(padty$0, w, convert_float(fconv, p$1, x)); + return make_printf(k$0, [4, acc$0, str], rest$7);}; + case 9: + var rest$8 = fmt$0[2], pad$6 = fmt$0[1]; + return make_padding(k$0, acc$0, rest$8, pad$6, Stdlib[30]); + case 10: + var + rest$9 = fmt$0[1], + acc$1 = [7, acc$0], + acc$0 = acc$1, + fmt$0 = rest$9; + continue; + case 11: + var + rest$10 = fmt$0[2], + str = fmt$0[1], + acc$2 = [2, acc$0, str], + acc$0 = acc$2, + fmt$0 = rest$10; + continue; + case 12: + var + rest$11 = fmt$0[2], + chr = fmt$0[1], + acc$3 = [3, acc$0, chr], + acc$0 = acc$3, + fmt$0 = rest$11; + continue; + case 13: + var + rest$12 = fmt$0[3], + sub_fmtty = fmt$0[2], + ty = string_of_fmtty(sub_fmtty); + return function(str){ + return make_printf(k$0, [4, acc$0, ty], rest$12);}; + case 14: + var rest$13 = fmt$0[3], fmtty = fmt$0[2]; + return function(param){ + var fmt = param[1], _cR_ = recast(fmt, fmtty); + return make_printf + (k$0, + acc$0, + caml_call2(CamlinternalFormatBasics[3], _cR_, rest$13));}; + case 15: + var rest$14 = fmt$0[1]; + return function(f, x){ + return make_printf + (k$0, + [6, acc$0, function(o){return caml_call2(f, o, x);}], + rest$14);}; + case 16: + var rest$15 = fmt$0[1]; + return function(f){return make_printf(k$0, [6, acc$0, f], rest$15);}; + case 17: + var + rest$16 = fmt$0[2], + fmting_lit = fmt$0[1], + acc$4 = [0, acc$0, fmting_lit], + acc$0 = acc$4, + fmt$0 = rest$16; + continue; + case 18: + var _cP_ = fmt$0[1]; + if(0 === _cP_[0]){ + var + rest$17 = fmt$0[2], + fmt$1 = _cP_[1][1], + k$3 = + function(acc, k, rest){ + function k$0(kacc){ + return make_printf(k, [1, acc, [0, kacc]], rest); + } + return k$0; + }, + k$1 = k$3(acc$0, k$0, rest$17), + k$0 = k$1, + acc$0 = 0, + fmt$0 = fmt$1; + continue; + } + var + rest$18 = fmt$0[2], + fmt$2 = _cP_[1][1], + k$4 = + function(acc, k, rest){ + function k$0(kacc){ + return make_printf(k, [1, acc, [1, kacc]], rest); + } + return k$0; + }, + k$2 = k$4(acc$0, k$0, rest$18), + k$0 = k$2, + acc$0 = 0, + fmt$0 = fmt$2; + continue; + case 19: + throw caml_maybe_attach_backtrace([0, Assert_failure, _s_], 1); + case 20: + var + rest$19 = fmt$0[3], + new_acc = [8, acc$0, cst_Printf_bad_conversion]; + return function(param){return make_printf(k$0, new_acc, rest$19);}; + case 21: + var rest$20 = fmt$0[2]; + return function(n){ + var new_acc = [4, acc$0, caml_format_int(cst_u$0, n)]; + return make_printf(k$0, new_acc, rest$20);}; + case 22: + var rest$21 = fmt$0[1]; + return function(c){ + var new_acc = [5, acc$0, c]; + return make_printf(k$0, new_acc, rest$21);}; + case 23: + var rest$22 = fmt$0[2], ign = fmt$0[1]; + if(counter >= 50) + return caml_trampoline_return + (make_ignored_param$0, [0, k$0, acc$0, ign, rest$22]); + var counter$1 = counter + 1 | 0; + return make_ignored_param$0(counter$1, k$0, acc$0, ign, rest$22); + default: + var + rest$23 = fmt$0[3], + f = fmt$0[2], + arity = fmt$0[1], + _cQ_ = caml_call1(f, 0); + if(counter >= 50) + return caml_trampoline_return + (make_custom$0, [0, k$0, acc$0, rest$23, arity, _cQ_]); + var counter$0 = counter + 1 | 0; + return make_custom$0(counter$0, k$0, acc$0, rest$23, arity, _cQ_); + } + } + } + function make_ignored_param$0(counter, k, acc, ign, fmt){ + if(typeof ign === "number") + switch(ign){ + case 0: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$0 = counter + 1 | 0; + return make_invalid_arg(counter$0, k, acc, fmt); + case 1: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$1 = counter + 1 | 0; + return make_invalid_arg(counter$1, k, acc, fmt); + case 2: + throw caml_maybe_attach_backtrace([0, Assert_failure, _t_], 1); + default: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$2 = counter + 1 | 0; + return make_invalid_arg(counter$2, k, acc, fmt); + } + switch(ign[0]){ + case 0: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$3 = counter + 1 | 0; + return make_invalid_arg(counter$3, k, acc, fmt); + case 1: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$4 = counter + 1 | 0; + return make_invalid_arg(counter$4, k, acc, fmt); + case 2: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$5 = counter + 1 | 0; + return make_invalid_arg(counter$5, k, acc, fmt); + case 3: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$6 = counter + 1 | 0; + return make_invalid_arg(counter$6, k, acc, fmt); + case 4: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$7 = counter + 1 | 0; + return make_invalid_arg(counter$7, k, acc, fmt); + case 5: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$8 = counter + 1 | 0; + return make_invalid_arg(counter$8, k, acc, fmt); + case 6: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$9 = counter + 1 | 0; + return make_invalid_arg(counter$9, k, acc, fmt); + case 7: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$10 = counter + 1 | 0; + return make_invalid_arg(counter$10, k, acc, fmt); + case 8: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$11 = counter + 1 | 0; + return make_invalid_arg(counter$11, k, acc, fmt); + case 9: + var fmtty = ign[2]; + if(counter >= 50) + return caml_trampoline_return + (make_from_fmtty$0, [0, k, acc, fmtty, fmt]); + var counter$14 = counter + 1 | 0; + return make_from_fmtty$0(counter$14, k, acc, fmtty, fmt); + case 10: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$12 = counter + 1 | 0; + return make_invalid_arg(counter$12, k, acc, fmt); + default: + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$13 = counter + 1 | 0; + return make_invalid_arg(counter$13, k, acc, fmt); + } + } + function make_from_fmtty$0(counter, k, acc, fmtty, fmt){ + if(typeof fmtty !== "number") + switch(fmtty[0]){ + case 0: + var rest = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest, fmt);}; + case 1: + var rest$0 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$0, fmt);}; + case 2: + var rest$1 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$1, fmt);}; + case 3: + var rest$2 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$2, fmt);}; + case 4: + var rest$3 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$3, fmt);}; + case 5: + var rest$4 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$4, fmt);}; + case 6: + var rest$5 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$5, fmt);}; + case 7: + var rest$6 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$6, fmt);}; + case 8: + var rest$7 = fmtty[2]; + return function(param){return make_from_fmtty(k, acc, rest$7, fmt);}; + case 9: + var + rest$8 = fmtty[3], + ty2 = fmtty[2], + ty1 = fmtty[1], + ty = trans(symm(ty1), ty2); + return function(param){ + return make_from_fmtty + (k, + acc, + caml_call2(CamlinternalFormatBasics[1], ty, rest$8), + fmt);}; + case 10: + var rest$9 = fmtty[1]; + return function(param, _cO_){ + return make_from_fmtty(k, acc, rest$9, fmt);}; + case 11: + var rest$10 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$10, fmt);}; + case 12: + var rest$11 = fmtty[1]; + return function(param){return make_from_fmtty(k, acc, rest$11, fmt);}; + case 13: + throw caml_maybe_attach_backtrace([0, Assert_failure, _u_], 1); + default: + throw caml_maybe_attach_backtrace([0, Assert_failure, _v_], 1); + } + if(counter >= 50) + return caml_trampoline_return(make_invalid_arg, [0, k, acc, fmt]); + var counter$0 = counter + 1 | 0; + return make_invalid_arg(counter$0, k, acc, fmt); + } + function make_invalid_arg(counter, k, acc, fmt){ + var _cN_ = [8, acc, cst_Printf_bad_conversion$0]; + if(counter >= 50) + return caml_trampoline_return(make_printf$0, [0, k, _cN_, fmt]); + var counter$0 = counter + 1 | 0; + return make_printf$0(counter$0, k, _cN_, fmt); + } + function make_custom$0(counter, k, acc, rest, arity, f){ + if(arity){ + var arity$0 = arity[1]; + return function(x){ + return make_custom(k, acc, rest, arity$0, caml_call1(f, x));}; + } + var _cM_ = [4, acc, f]; + if(counter >= 50) + return caml_trampoline_return(make_printf$0, [0, k, _cM_, rest]); + var counter$0 = counter + 1 | 0; + return make_printf$0(counter$0, k, _cM_, rest); + } + function make_printf(k, acc, fmt){ + return caml_trampoline(make_printf$0(0, k, acc, fmt)); + } + function make_ignored_param(k, acc, ign, fmt){ + return caml_trampoline(make_ignored_param$0(0, k, acc, ign, fmt)); + } + function make_from_fmtty(k, acc, fmtty, fmt){ + return caml_trampoline(make_from_fmtty$0(0, k, acc, fmtty, fmt)); + } + function make_custom(k, acc, rest, arity, f){ + return caml_trampoline(make_custom$0(0, k, acc, rest, arity, f)); + } + function fn_of_padding_precision(k, o, fmt, pad, prec){ + if(typeof pad === "number"){ + if(typeof prec !== "number"){ + var _cl_ = make_iprintf(k, o, fmt); + return function(_cL_){return _cl_;}; + } + if(prec){ + var _ci_ = make_iprintf(k, o, fmt), _cj_ = function(_cK_){return _ci_;}; + return function(_cJ_){return _cj_;}; + } + var _ck_ = make_iprintf(k, o, fmt); + return function(_cI_){return _ck_;}; + } + if(0 === pad[0]){ + if(typeof prec !== "number"){ + var _cp_ = make_iprintf(k, o, fmt); + return function(_cH_){return _cp_;}; + } + if(prec){ + var _cm_ = make_iprintf(k, o, fmt), _cn_ = function(_cG_){return _cm_;}; + return function(_cF_){return _cn_;}; + } + var _co_ = make_iprintf(k, o, fmt); + return function(_cE_){return _co_;}; + } + if(typeof prec !== "number"){ + var _cv_ = make_iprintf(k, o, fmt), _cw_ = function(_cD_){return _cv_;}; + return function(_cC_){return _cw_;}; + } + if(prec){ + var + _cq_ = make_iprintf(k, o, fmt), + _cr_ = function(_cB_){return _cq_;}, + _cs_ = function(_cA_){return _cr_;}; + return function(_cz_){return _cs_;}; + } + var _ct_ = make_iprintf(k, o, fmt); + function _cu_(_cy_){return _ct_;} + return function(_cx_){return _cu_;}; + } + function make_iprintf$0(counter, k, o, fmt){ + var k$0 = k, fmt$0 = fmt; + for(;;){ + if(typeof fmt$0 === "number") return caml_call1(k$0, o); + switch(fmt$0[0]){ + case 0: + var rest = fmt$0[1], _by_ = make_iprintf(k$0, o, rest); + return function(_ch_){return _by_;}; + case 1: + var rest$0 = fmt$0[1], _bz_ = make_iprintf(k$0, o, rest$0); + return function(_cg_){return _bz_;}; + case 2: + var _bA_ = fmt$0[1]; + if(typeof _bA_ === "number"){ + var rest$1 = fmt$0[2], _bB_ = make_iprintf(k$0, o, rest$1); + return function(_cf_){return _bB_;}; + } + if(0 === _bA_[0]){ + var rest$2 = fmt$0[2], _bC_ = make_iprintf(k$0, o, rest$2); + return function(_ce_){return _bC_;}; + } + var + rest$3 = fmt$0[2], + _bD_ = make_iprintf(k$0, o, rest$3), + _bE_ = function(_cd_){return _bD_;}; + return function(_cc_){return _bE_;}; + case 3: + var _bF_ = fmt$0[1]; + if(typeof _bF_ === "number"){ + var rest$4 = fmt$0[2], _bG_ = make_iprintf(k$0, o, rest$4); + return function(_cb_){return _bG_;}; + } + if(0 === _bF_[0]){ + var rest$5 = fmt$0[2], _bH_ = make_iprintf(k$0, o, rest$5); + return function(_ca_){return _bH_;}; + } + var + rest$6 = fmt$0[2], + _bI_ = make_iprintf(k$0, o, rest$6), + _bJ_ = function(_b$_){return _bI_;}; + return function(_b__){return _bJ_;}; + case 4: + var rest$7 = fmt$0[4], prec = fmt$0[3], pad = fmt$0[2]; + return fn_of_padding_precision(k$0, o, rest$7, pad, prec); + case 5: + var rest$8 = fmt$0[4], prec$0 = fmt$0[3], pad$0 = fmt$0[2]; + return fn_of_padding_precision(k$0, o, rest$8, pad$0, prec$0); + case 6: + var rest$9 = fmt$0[4], prec$1 = fmt$0[3], pad$1 = fmt$0[2]; + return fn_of_padding_precision(k$0, o, rest$9, pad$1, prec$1); + case 7: + var rest$10 = fmt$0[4], prec$2 = fmt$0[3], pad$2 = fmt$0[2]; + return fn_of_padding_precision(k$0, o, rest$10, pad$2, prec$2); + case 8: + var rest$11 = fmt$0[4], prec$3 = fmt$0[3], pad$3 = fmt$0[2]; + return fn_of_padding_precision(k$0, o, rest$11, pad$3, prec$3); + case 9: + var _bK_ = fmt$0[1]; + if(typeof _bK_ === "number"){ + var rest$12 = fmt$0[2], _bL_ = make_iprintf(k$0, o, rest$12); + return function(_b9_){return _bL_;}; + } + if(0 === _bK_[0]){ + var rest$13 = fmt$0[2], _bM_ = make_iprintf(k$0, o, rest$13); + return function(_b8_){return _bM_;}; + } + var + rest$14 = fmt$0[2], + _bN_ = make_iprintf(k$0, o, rest$14), + _bO_ = function(_b7_){return _bN_;}; + return function(_b6_){return _bO_;}; + case 10: + var rest$15 = fmt$0[1], fmt$0 = rest$15; continue; + case 11: + var rest$16 = fmt$0[2], fmt$0 = rest$16; continue; + case 12: + var rest$17 = fmt$0[2], fmt$0 = rest$17; continue; + case 13: + var rest$18 = fmt$0[3], _bP_ = make_iprintf(k$0, o, rest$18); + return function(_b5_){return _bP_;}; + case 14: + var rest$19 = fmt$0[3], fmtty = fmt$0[2]; + return function(param){ + var fmt = param[1], _b4_ = recast(fmt, fmtty); + return make_iprintf + (k$0, + o, + caml_call2(CamlinternalFormatBasics[3], _b4_, rest$19));}; + case 15: + var + rest$20 = fmt$0[1], + _bQ_ = make_iprintf(k$0, o, rest$20), + _bR_ = function(_b3_){return _bQ_;}; + return function(_b2_){return _bR_;}; + case 16: + var rest$21 = fmt$0[1], _bS_ = make_iprintf(k$0, o, rest$21); + return function(_b1_){return _bS_;}; + case 17: + var rest$22 = fmt$0[2], fmt$0 = rest$22; continue; + case 18: + var _bT_ = fmt$0[1]; + if(0 === _bT_[0]){ + var + rest$23 = fmt$0[2], + fmt$1 = _bT_[1][1], + k$3 = + function(k, rest){ + function k$0(koc){return make_iprintf(k, koc, rest);} + return k$0; + }, + k$1 = k$3(k$0, rest$23), + k$0 = k$1, + fmt$0 = fmt$1; + continue; + } + var + rest$24 = fmt$0[2], + fmt$2 = _bT_[1][1], + k$4 = + function(k, rest){ + function k$0(koc){return make_iprintf(k, koc, rest);} + return k$0; + }, + k$2 = k$4(k$0, rest$24), + k$0 = k$2, + fmt$0 = fmt$2; + continue; + case 19: + throw caml_maybe_attach_backtrace([0, Assert_failure, _w_], 1); + case 20: + var rest$25 = fmt$0[3], _bU_ = make_iprintf(k$0, o, rest$25); + return function(_b0_){return _bU_;}; + case 21: + var rest$26 = fmt$0[2], _bV_ = make_iprintf(k$0, o, rest$26); + return function(_bZ_){return _bV_;}; + case 22: + var rest$27 = fmt$0[1], _bW_ = make_iprintf(k$0, o, rest$27); + return function(_bY_){return _bW_;}; + case 23: + var rest$28 = fmt$0[2], ign = fmt$0[1], _bX_ = 0; + return make_ignored_param + (function(param){return caml_call1(k$0, o);}, + _bX_, + ign, + rest$28); + default: + var rest$29 = fmt$0[3], arity = fmt$0[1]; + if(counter >= 50) + return caml_trampoline_return + (fn_of_custom_arity$0, [0, k$0, o, rest$29, arity]); + var counter$0 = counter + 1 | 0; + return fn_of_custom_arity$0(counter$0, k$0, o, rest$29, arity); + } + } + } + function fn_of_custom_arity$0(counter, k, o, fmt, param){ + if(param){ + var arity = param[1], _bw_ = fn_of_custom_arity(k, o, fmt, arity); + return function(_bx_){return _bw_;}; + } + if(counter >= 50) + return caml_trampoline_return(make_iprintf$0, [0, k, o, fmt]); + var counter$0 = counter + 1 | 0; + return make_iprintf$0(counter$0, k, o, fmt); + } + function make_iprintf(k, o, fmt){ + return caml_trampoline(make_iprintf$0(0, k, o, fmt)); + } + function fn_of_custom_arity(k, o, fmt, param){ + return caml_trampoline(fn_of_custom_arity$0(0, k, o, fmt, param)); + } + function output_acc(o, acc){ + var acc$0 = acc; + for(;;){ + if(typeof acc$0 === "number") return 0; + switch(acc$0[0]){ + case 0: + var + fmting_lit = acc$0[2], + p = acc$0[1], + s = string_of_formatting_lit(fmting_lit); + output_acc(o, p); + return caml_call2(Stdlib[66], o, s); + case 1: + var match = acc$0[2], p$0 = acc$0[1]; + if(0 === match[0]){ + var acc$1 = match[1]; + output_acc(o, p$0); + caml_call2(Stdlib[66], o, cst$18); + var acc$0 = acc$1; + continue; + } + var acc$2 = match[1]; + output_acc(o, p$0); + caml_call2(Stdlib[66], o, cst$19); + var acc$0 = acc$2; + continue; + case 6: + var f = acc$0[2], p$3 = acc$0[1]; + output_acc(o, p$3); + return caml_call1(f, o); + case 7: + var p$4 = acc$0[1]; + output_acc(o, p$4); + return caml_call1(Stdlib[63], o); + case 8: + var msg = acc$0[2], p$5 = acc$0[1]; + output_acc(o, p$5); + return caml_call1(Stdlib[1], msg); + case 2: + case 4: + var s$0 = acc$0[2], p$1 = acc$0[1]; + output_acc(o, p$1); + return caml_call2(Stdlib[66], o, s$0); + default: + var c = acc$0[2], p$2 = acc$0[1]; + output_acc(o, p$2); + return caml_call2(Stdlib[65], o, c); + } + } + } + function bufput_acc(b, acc){ + var acc$0 = acc; + for(;;){ + if(typeof acc$0 === "number") return 0; + switch(acc$0[0]){ + case 0: + var + fmting_lit = acc$0[2], + p = acc$0[1], + s = string_of_formatting_lit(fmting_lit); + bufput_acc(b, p); + return caml_call2(Stdlib_Buffer[16], b, s); + case 1: + var match = acc$0[2], p$0 = acc$0[1]; + if(0 === match[0]){ + var acc$1 = match[1]; + bufput_acc(b, p$0); + caml_call2(Stdlib_Buffer[16], b, cst$20); + var acc$0 = acc$1; + continue; + } + var acc$2 = match[1]; + bufput_acc(b, p$0); + caml_call2(Stdlib_Buffer[16], b, cst$21); + var acc$0 = acc$2; + continue; + case 6: + var f = acc$0[2], p$3 = acc$0[1]; + bufput_acc(b, p$3); + return caml_call1(f, b); + case 7: + var acc$3 = acc$0[1], acc$0 = acc$3; continue; + case 8: + var msg = acc$0[2], p$4 = acc$0[1]; + bufput_acc(b, p$4); + return caml_call1(Stdlib[1], msg); + case 2: + case 4: + var s$0 = acc$0[2], p$1 = acc$0[1]; + bufput_acc(b, p$1); + return caml_call2(Stdlib_Buffer[16], b, s$0); + default: + var c = acc$0[2], p$2 = acc$0[1]; + bufput_acc(b, p$2); + return caml_call2(Stdlib_Buffer[12], b, c); + } + } + } + function strput_acc(b, acc){ + var acc$0 = acc; + for(;;){ + if(typeof acc$0 === "number") return 0; + switch(acc$0[0]){ + case 0: + var + fmting_lit = acc$0[2], + p = acc$0[1], + s = string_of_formatting_lit(fmting_lit); + strput_acc(b, p); + return caml_call2(Stdlib_Buffer[16], b, s); + case 1: + var match = acc$0[2], p$0 = acc$0[1]; + if(0 === match[0]){ + var acc$1 = match[1]; + strput_acc(b, p$0); + caml_call2(Stdlib_Buffer[16], b, cst$22); + var acc$0 = acc$1; + continue; + } + var acc$2 = match[1]; + strput_acc(b, p$0); + caml_call2(Stdlib_Buffer[16], b, cst$23); + var acc$0 = acc$2; + continue; + case 6: + var f = acc$0[2], p$3 = acc$0[1]; + strput_acc(b, p$3); + var _bv_ = caml_call1(f, 0); + return caml_call2(Stdlib_Buffer[16], b, _bv_); + case 7: + var acc$3 = acc$0[1], acc$0 = acc$3; continue; + case 8: + var msg = acc$0[2], p$4 = acc$0[1]; + strput_acc(b, p$4); + return caml_call1(Stdlib[1], msg); + case 2: + case 4: + var s$0 = acc$0[2], p$1 = acc$0[1]; + strput_acc(b, p$1); + return caml_call2(Stdlib_Buffer[16], b, s$0); + default: + var c = acc$0[2], p$2 = acc$0[1]; + strput_acc(b, p$2); + return caml_call2(Stdlib_Buffer[12], b, c); + } + } + } + function failwith_message(param){ + var fmt = param[1], buf = caml_call1(Stdlib_Buffer[1], 256); + function k(acc){ + strput_acc(buf, acc); + var _bu_ = caml_call1(Stdlib_Buffer[2], buf); + return caml_call1(Stdlib[2], _bu_); + } + return make_printf(k, 0, fmt); + } + function open_box_of_string(str){ + if(runtime.caml_string_equal(str, cst$43)) return _x_; + var len = caml_ml_string_length(str); + function invalid_box(param){ + return caml_call1(failwith_message(_y_), str); + } + function parse_spaces(i){ + var i$0 = i; + for(;;){ + if(i$0 === len) return i$0; + var match = caml_string_get(str, i$0); + if(9 !== match && 32 !== match) return i$0; + var i$1 = i$0 + 1 | 0, i$0 = i$1; + } + } + var wstart = parse_spaces(0), wend = wstart; + for(;;){ + if(wend !== len && 25 >= caml_string_get(str, wend) - 97 >>> 0){var j = wend + 1 | 0, wend = j; continue;} + var + box_name = caml_call3(Stdlib_String[15], str, wstart, wend - wstart | 0), + nstart = parse_spaces(wend), + nend = nstart; + for(;;){ + if(nend !== len){ + var match = caml_string_get(str, nend), switch$0 = 0; + if(48 <= match){ + if(58 > match) switch$0 = 1; + } + else if(45 === match) switch$0 = 1; + if(switch$0){var j$0 = nend + 1 | 0, nend = j$0; continue;} + } + if(nstart === nend) + var indent = 0; + else + try{ + var + _bs_ = + runtime.caml_int_of_string + (caml_call3(Stdlib_String[15], str, nstart, nend - nstart | 0)), + indent = _bs_; + } + catch(_bt_){ + var _br_ = caml_wrap_exception(_bt_); + if(_br_[1] !== Stdlib[7]) throw caml_maybe_attach_backtrace(_br_, 0); + var indent = invalid_box(0); + } + var exp_end = parse_spaces(nend); + if(exp_end !== len) invalid_box(0); + var switch$1 = 0; + if + (caml_string_notequal(box_name, cst$43) + && caml_string_notequal(box_name, "b")) + var + box_type = + caml_string_notequal(box_name, "h") + ? caml_string_notequal + (box_name, "hov") + ? caml_string_notequal + (box_name, "hv") + ? caml_string_notequal(box_name, "v") ? invalid_box(0) : 1 + : 2 + : 3 + : 0; + else + switch$1 = 1; + if(switch$1) var box_type = 4; + return [0, indent, box_type]; + } + } + } + function make_padding_fmt_ebb(pad, fmt){ + if(typeof pad === "number") return [0, 0, fmt]; + if(0 === pad[0]){var w = pad[2], s = pad[1]; return [0, [0, s, w], fmt];} + var s$0 = pad[1]; + return [0, [1, s$0], fmt]; + } + function make_padprec_fmt_ebb(pad, prec, fmt){ + if(typeof prec === "number") + var match = prec ? [0, 1, fmt] : [0, 0, fmt]; + else + var p = prec[1], match = [0, [0, p], fmt]; + var prec$0 = match[1]; + if(typeof pad === "number") return [0, 0, prec$0, fmt]; + if(0 === pad[0]){ + var w = pad[2], s = pad[1]; + return [0, [0, s, w], prec$0, fmt]; + } + var s$0 = pad[1]; + return [0, [1, s$0], prec$0, fmt]; + } + function fmt_ebb_of_string(legacy_behavior, str){ + if(legacy_behavior) + var flag = legacy_behavior[1], legacy_behavior$0 = flag; + else + var legacy_behavior$0 = 1; + function invalid_format_message(str_ind, msg){ + return caml_call3(failwith_message(_z_), str, str_ind, msg); + } + function unexpected_end_of_format(end_ind){ + return invalid_format_message(end_ind, cst_unexpected_end_of_format); + } + function invalid_format_without(str_ind, c, s){ + return caml_call4(failwith_message(_A_), str, str_ind, c, s); + } + function expected_character(str_ind, expected, read){ + return caml_call4(failwith_message(_B_), str, str_ind, expected, read); + } + function add_literal(lit_start, str_ind, fmt){ + var size = str_ind - lit_start | 0; + return 0 === size + ? [0, fmt] + : 1 + === size + ? [0, [12, caml_string_get(str, lit_start), fmt]] + : [0, + [11, + caml_call3(Stdlib_String[15], str, lit_start, size), + fmt]]; + } + function parse(lit_start, end_ind){ + var str_ind = lit_start; + for(;;){ + if(str_ind === end_ind) return add_literal(lit_start, str_ind, 0); + var match = caml_string_get(str, str_ind); + if(37 === match){ + var str_ind$2 = str_ind + 1 | 0; + if(str_ind$2 === end_ind) unexpected_end_of_format(end_ind); + var + match$1 = + 95 === caml_string_get(str, str_ind$2) + ? parse_flags(str_ind, str_ind$2 + 1 | 0, end_ind, 1) + : parse_flags(str_ind, str_ind$2, end_ind, 0), + fmt_rest = match$1[1]; + return add_literal(lit_start, str_ind, fmt_rest); + } + if(64 !== match){ + var str_ind$1 = str_ind + 1 | 0, str_ind = str_ind$1; + continue; + } + var str_ind$0 = str_ind + 1 | 0; + if(str_ind$0 === end_ind) + var match$0 = _N_; + else{ + var c = caml_string_get(str, str_ind$0), switch$0 = 0; + if(65 <= c) + if(94 <= c){ + var switcher = c - 123 | 0; + if(2 < switcher >>> 0) + switch$0 = 1; + else + switch(switcher){ + case 0: + var match$0 = parse_tag(1, str_ind$0 + 1 | 0, end_ind); break; + case 1: + switch$0 = 1; break; + default: + var + fmt_rest$2 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 1, fmt_rest$2]]; + } + } + else if(91 <= c) + switch(c - 91 | 0){ + case 0: + var match$0 = parse_tag(0, str_ind$0 + 1 | 0, end_ind); break; + case 1: + switch$0 = 1; break; + default: + var + fmt_rest$3 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 0, fmt_rest$3]]; + } + else + switch$0 = 1; + else if(10 === c) + var + fmt_rest$4 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 3, fmt_rest$4]]; + else if(32 <= c) + switch(c - 32 | 0){ + case 0: + var + fmt_rest$5 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, _O_, fmt_rest$5]]; + break; + case 5: + var switch$1 = 0; + if + ((str_ind$0 + 1 | 0) < end_ind + && 37 === caml_string_get(str, str_ind$0 + 1 | 0)) + var + fmt_rest$6 = parse(str_ind$0 + 2 | 0, end_ind)[1], + match$0 = [0, [17, 6, fmt_rest$6]]; + else + switch$1 = 1; + if(switch$1) + var + fmt_rest$7 = parse(str_ind$0, end_ind)[1], + match$0 = [0, [12, 64, fmt_rest$7]]; + break; + case 12: + var + fmt_rest$8 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, _P_, fmt_rest$8]]; + break; + case 14: + var + fmt_rest$9 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 4, fmt_rest$9]]; + break; + case 27: + var str_ind$3 = str_ind$0 + 1 | 0; + try{ + var + _bg_ = str_ind$3 === end_ind ? 1 : 0, + _bh_ = _bg_ || (60 !== caml_string_get(str, str_ind$3) ? 1 : 0); + if(_bh_) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + str_ind_1 = parse_spaces(str_ind$3 + 1 | 0, end_ind), + match$2 = caml_string_get(str, str_ind_1), + switch$2 = 0; + if(48 <= match$2){ + if(58 > match$2) switch$2 = 1; + } + else if(45 === match$2) switch$2 = 1; + if(! switch$2) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + match$3 = parse_integer(str_ind_1, end_ind), + width = match$3[2], + str_ind_2 = match$3[1], + str_ind_3 = parse_spaces(str_ind_2, end_ind), + switcher$0 = caml_string_get(str, str_ind_3) - 45 | 0, + switch$3 = 0; + if(12 < switcher$0 >>> 0) + if(17 === switcher$0) + var + s = + caml_call3 + (Stdlib_String[15], + str, + str_ind$3 - 2 | 0, + (str_ind_3 - str_ind$3 | 0) + 3 | 0), + _bi_ = [0, s, width, 0], + _bj_ = str_ind_3 + 1 | 0, + formatting_lit$0 = _bi_, + next_ind = _bj_; + else + switch$3 = 1; + else if(1 < switcher$0 - 1 >>> 0){ + var + match$4 = parse_integer(str_ind_3, end_ind), + offset = match$4[2], + str_ind_4 = match$4[1], + str_ind_5 = parse_spaces(str_ind_4, end_ind); + if(62 !== caml_string_get(str, str_ind_5)) + throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + s$0 = + caml_call3 + (Stdlib_String[15], + str, + str_ind$3 - 2 | 0, + (str_ind_5 - str_ind$3 | 0) + 3 | 0), + _bk_ = [0, s$0, width, offset], + _bl_ = str_ind_5 + 1 | 0, + formatting_lit$0 = _bk_, + next_ind = _bl_; + } + else + switch$3 = 1; + if(switch$3) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + } + catch(_bq_){ + var _bf_ = caml_wrap_exception(_bq_); + if(_bf_ !== Stdlib[8] && _bf_[1] !== Stdlib[7]) + throw caml_maybe_attach_backtrace(_bf_, 0); + var formatting_lit$0 = formatting_lit, next_ind = str_ind$3; + } + var + fmt_rest$12 = parse(next_ind, end_ind)[1], + match$0 = [0, [17, formatting_lit$0, fmt_rest$12]]; + break; + case 28: + var str_ind$4 = str_ind$0 + 1 | 0; + try{ + var + str_ind_1$0 = parse_spaces(str_ind$4, end_ind), + match$6 = caml_string_get(str, str_ind_1$0), + switch$4 = 0; + if(48 <= match$6){ + if(58 > match$6) switch$4 = 1; + } + else if(45 === match$6) switch$4 = 1; + if(switch$4){ + var + match$7 = parse_integer(str_ind_1$0, end_ind), + size = match$7[2], + str_ind_2$0 = match$7[1], + str_ind_3$0 = parse_spaces(str_ind_2$0, end_ind); + if(62 !== caml_string_get(str, str_ind_3$0)) + throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + s$1 = + caml_call3 + (Stdlib_String[15], + str, + str_ind$4 - 2 | 0, + (str_ind_3$0 - str_ind$4 | 0) + 3 | 0), + _bo_ = [0, [0, str_ind_3$0 + 1 | 0, [1, s$1, size]]]; + } + else + var _bo_ = 0; + var _bn_ = _bo_; + } + catch(_bp_){ + var _bm_ = caml_wrap_exception(_bp_); + if(_bm_ !== Stdlib[8] && _bm_[1] !== Stdlib[7]) + throw caml_maybe_attach_backtrace(_bm_, 0); + var _bn_ = 0; + } + if(_bn_) + var + match$5 = _bn_[1], + formatting_lit$1 = match$5[2], + next_ind$0 = match$5[1], + fmt_rest$13 = parse(next_ind$0, end_ind)[1], + _be_ = [0, [17, formatting_lit$1, fmt_rest$13]]; + else + var + fmt_rest$14 = parse(str_ind$4, end_ind)[1], + _be_ = [0, [17, _Q_, fmt_rest$14]]; + var match$0 = _be_; + break; + case 31: + var + fmt_rest$10 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 2, fmt_rest$10]]; + break; + case 32: + var + fmt_rest$11 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, 5, fmt_rest$11]]; + break; + default: switch$0 = 1; + } + else + switch$0 = 1; + if(switch$0) + var + fmt_rest$1 = parse(str_ind$0 + 1 | 0, end_ind)[1], + match$0 = [0, [17, [2, c], fmt_rest$1]]; + } + var fmt_rest$0 = match$0[1]; + return add_literal(lit_start, str_ind, fmt_rest$0); + } + } + function parse_conversion + (pct_ind, + str_ind, + end_ind, + plus, + hash, + space, + ign, + pad, + prec, + padprec, + symb){ + var + plus_used = [0, 0], + hash_used = [0, 0], + space_used = [0, 0], + ign_used = [0, 0], + pad_used = [0, 0], + prec_used = [0, 0]; + function get_plus(param){plus_used[1] = 1; return plus;} + function get_hash(param){hash_used[1] = 1; return hash;} + function get_space(param){space_used[1] = 1; return space;} + function get_ign(param){ign_used[1] = 1; return ign;} + function get_pad(param){pad_used[1] = 1; return pad;} + function get_prec(param){prec_used[1] = 1; return prec;} + function get_padprec(param){pad_used[1] = 1; return padprec;} + function get_int_pad(param){ + var pad = get_pad(0), match = get_prec(0); + if(typeof match === "number" && ! match) return pad; + if(typeof pad === "number") return 0; + if(0 !== pad[0]) + return 2 <= pad[1] + ? legacy_behavior$0 + ? _H_ + : incompatible_flag(pct_ind, str_ind, 48, cst_precision$1) + : pad; + if(2 > pad[1]) return pad; + var n = pad[2]; + return legacy_behavior$0 + ? [0, 1, n] + : incompatible_flag(pct_ind, str_ind, 48, cst_precision$0); + } + function check_no_0(symb, pad){ + if(typeof pad === "number") return pad; + if(0 !== pad[0]) + return 2 <= pad[1] + ? legacy_behavior$0 + ? _I_ + : incompatible_flag(pct_ind, str_ind, symb, cst_0$1) + : pad; + if(2 > pad[1]) return pad; + var width = pad[2]; + return legacy_behavior$0 + ? [0, 1, width] + : incompatible_flag(pct_ind, str_ind, symb, cst_0$0); + } + function opt_of_pad(c, pad){ + if(typeof pad === "number") return 0; + if(0 === pad[0]) + switch(pad[1]){ + case 0: + var width = pad[2]; + return legacy_behavior$0 + ? [0, width] + : incompatible_flag(pct_ind, str_ind, c, cst$24); + case 1: + var width$0 = pad[2]; return [0, width$0]; + default: + var width$1 = pad[2]; + return legacy_behavior$0 + ? [0, width$1] + : incompatible_flag(pct_ind, str_ind, c, cst_0$2); + } + return incompatible_flag(pct_ind, str_ind, c, cst$25); + } + function get_pad_opt(c){return opt_of_pad(c, get_pad(0));} + function get_padprec_opt(c){return opt_of_pad(c, get_padprec(0));} + var switch$0 = 0; + if(124 <= symb) + switch$0 = 1; + else + switch(symb){ + case 33: + var + fmt_rest$5 = parse(str_ind, end_ind)[1], + fmt_result = [0, [10, fmt_rest$5]]; + break; + case 40: + var + sub_end = search_subformat_end(str_ind, end_ind, 41), + fmt_rest$7 = parse(sub_end + 2 | 0, end_ind)[1], + sub_fmt = parse(str_ind, sub_end)[1], + sub_fmtty = fmtty_of_fmt(sub_fmt); + if(get_ign(0)) + var + ignored$2 = [9, get_pad_opt(95), sub_fmtty], + _aN_ = [0, [23, ignored$2, fmt_rest$7]]; + else + var _aN_ = [0, [14, get_pad_opt(40), sub_fmtty, fmt_rest$7]]; + var fmt_result = _aN_; + break; + case 44: + var fmt_result = parse(str_ind, end_ind); break; + case 67: + var + fmt_rest$10 = parse(str_ind, end_ind)[1], + _aP_ = + get_ign(0) ? [0, [23, 1, fmt_rest$10]] : [0, [1, fmt_rest$10]], + fmt_result = _aP_; + break; + case 78: + var fmt_rest$14 = parse(str_ind, end_ind)[1], counter$0 = 2; + if(get_ign(0)) + var + ignored$6 = [11, counter$0], + _aV_ = [0, [23, ignored$6, fmt_rest$14]]; + else + var _aV_ = [0, [21, counter$0, fmt_rest$14]]; + var fmt_result = _aV_; + break; + case 83: + var + pad$6 = check_no_0(symb, get_padprec(0)), + fmt_rest$15 = parse(str_ind, end_ind)[1]; + if(get_ign(0)) + var + ignored$7 = [1, get_padprec_opt(95)], + _aW_ = [0, [23, ignored$7, fmt_rest$15]]; + else + var + match$5 = make_padding_fmt_ebb(pad$6, fmt_rest$15), + fmt_rest$16 = match$5[2], + pad$7 = match$5[1], + _aW_ = [0, [3, pad$7, fmt_rest$16]]; + var fmt_result = _aW_; + break; + case 91: + if(str_ind === end_ind) unexpected_end_of_format(end_ind); + var + char_set = create_char_set(0), + add_char = function(c){return add_in_char_set(char_set, c);}, + add_range = + function(c$0, c){ + if(c >= c$0){ + var i = c$0; + for(;;){ + add_in_char_set(char_set, caml_call1(Stdlib[29], i)); + var _bd_ = i + 1 | 0; + if(c !== i){var i = _bd_; continue;} + break; + } + } + return 0; + }, + fail_single_percent = + function(str_ind){ + return caml_call2(failwith_message(_R_), str, str_ind); + }, + parse_char_set_content = + function(counter, str_ind, end_ind){ + var str_ind$0 = str_ind; + for(;;){ + if(str_ind$0 === end_ind) unexpected_end_of_format(end_ind); + var c = caml_string_get(str, str_ind$0); + if(45 === c){ + add_char(45); + var str_ind$1 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$1; + continue; + } + if(93 === c) return str_ind$0 + 1 | 0; + var _bc_ = str_ind$0 + 1 | 0; + if(counter >= 50) + return caml_trampoline_return + (parse_char_set_after_char$0, [0, _bc_, end_ind, c]); + var counter$0 = counter + 1 | 0; + return parse_char_set_after_char$0(counter$0, _bc_, end_ind, c); + } + }, + parse_char_set_after_char$0 = + function(counter, str_ind, end_ind, c){ + var str_ind$0 = str_ind, c$0 = c; + for(;;){ + if(str_ind$0 === end_ind) unexpected_end_of_format(end_ind); + var c$1 = caml_string_get(str, str_ind$0), switch$0 = 0; + if(46 <= c$1){ + if(64 === c$1) + switch$0 = 1; + else if(93 === c$1){add_char(c$0); return str_ind$0 + 1 | 0;} + } + else if(37 === c$1) + switch$0 = 1; + else if(45 <= c$1){ + var str_ind$2 = str_ind$0 + 1 | 0; + if(str_ind$2 === end_ind) unexpected_end_of_format(end_ind); + var c$2 = caml_string_get(str, str_ind$2); + if(37 === c$2){ + if((str_ind$2 + 1 | 0) === end_ind) + unexpected_end_of_format(end_ind); + var c$3 = caml_string_get(str, str_ind$2 + 1 | 0); + if(37 !== c$3 && 64 !== c$3) + return fail_single_percent(str_ind$2); + add_range(c$0, c$3); + var _ba_ = str_ind$2 + 2 | 0; + if(counter >= 50) + return caml_trampoline_return + (parse_char_set_content, [0, _ba_, end_ind]); + var counter$2 = counter + 1 | 0; + return parse_char_set_content(counter$2, _ba_, end_ind); + } + if(93 === c$2){ + add_char(c$0); + add_char(45); + return str_ind$2 + 1 | 0; + } + add_range(c$0, c$2); + var _bb_ = str_ind$2 + 1 | 0; + if(counter >= 50) + return caml_trampoline_return + (parse_char_set_content, [0, _bb_, end_ind]); + var counter$1 = counter + 1 | 0; + return parse_char_set_content(counter$1, _bb_, end_ind); + } + if(switch$0 && 37 === c$0){ + add_char(c$1); + var _a$_ = str_ind$0 + 1 | 0; + if(counter >= 50) + return caml_trampoline_return + (parse_char_set_content, [0, _a$_, end_ind]); + var counter$0 = counter + 1 | 0; + return parse_char_set_content(counter$0, _a$_, end_ind); + } + if(37 === c$0) fail_single_percent(str_ind$0); + add_char(c$0); + var + str_ind$1 = str_ind$0 + 1 | 0, + str_ind$0 = str_ind$1, + c$0 = c$1; + } + }, + parse_char_set_after_char = + function(str_ind, end_ind, c){ + return caml_trampoline + (parse_char_set_after_char$0(0, str_ind, end_ind, c)); + }; + if(str_ind === end_ind) unexpected_end_of_format(end_ind); + if(94 === caml_string_get(str, str_ind)) + var str_ind$0 = str_ind + 1 | 0, reverse = 1, str_ind$1 = str_ind$0; + else + var reverse = 0, str_ind$1 = str_ind; + if(str_ind$1 === end_ind) unexpected_end_of_format(end_ind); + var + c = caml_string_get(str, str_ind$1), + next_ind = parse_char_set_after_char(str_ind$1 + 1 | 0, end_ind, c), + char_set$0 = freeze_char_set(char_set), + char_set$1 = reverse ? rev_char_set(char_set$0) : char_set$0, + fmt_rest$19 = parse(next_ind, end_ind)[1]; + if(get_ign(0)) + var + ignored$9 = [10, get_pad_opt(95), char_set$1], + _a1_ = [0, [23, ignored$9, fmt_rest$19]]; + else + var _a1_ = [0, [20, get_pad_opt(91), char_set$1, fmt_rest$19]]; + var fmt_result = _a1_; + break; + case 97: + var + fmt_rest$20 = parse(str_ind, end_ind)[1], + fmt_result = [0, [15, fmt_rest$20]]; + break; + case 99: + var + char_format = + function(fmt_rest){ + return get_ign(0) ? [0, [23, 0, fmt_rest]] : [0, [0, fmt_rest]]; + }, + fmt_rest$21 = parse(str_ind, end_ind)[1], + match$7 = get_pad_opt(99); + if(match$7){ + if(0 === match$7[1]) + var + _a2_ = + get_ign(0) ? [0, [23, 3, fmt_rest$21]] : [0, [22, fmt_rest$21]], + _a3_ = _a2_; + else + var + _a3_ = + legacy_behavior$0 + ? char_format(fmt_rest$21) + : invalid_format_message + (str_ind, cst_non_zero_widths_are_unsupp); + var _a4_ = _a3_; + } + else + var _a4_ = char_format(fmt_rest$21); + var fmt_result = _a4_; + break; + case 114: + var + fmt_rest$22 = parse(str_ind, end_ind)[1], + _a5_ = + get_ign(0) ? [0, [23, 2, fmt_rest$22]] : [0, [19, fmt_rest$22]], + fmt_result = _a5_; + break; + case 115: + var + pad$9 = check_no_0(symb, get_padprec(0)), + fmt_rest$23 = parse(str_ind, end_ind)[1]; + if(get_ign(0)) + var + ignored$10 = [0, get_padprec_opt(95)], + _a6_ = [0, [23, ignored$10, fmt_rest$23]]; + else + var + match$8 = make_padding_fmt_ebb(pad$9, fmt_rest$23), + fmt_rest$24 = match$8[2], + pad$10 = match$8[1], + _a6_ = [0, [2, pad$10, fmt_rest$24]]; + var fmt_result = _a6_; + break; + case 116: + var + fmt_rest$25 = parse(str_ind, end_ind)[1], + fmt_result = [0, [16, fmt_rest$25]]; + break; + case 123: + var + sub_end$0 = search_subformat_end(str_ind, end_ind, 125), + sub_fmt$0 = parse(str_ind, sub_end$0)[1], + fmt_rest$26 = parse(sub_end$0 + 2 | 0, end_ind)[1], + sub_fmtty$0 = fmtty_of_fmt(sub_fmt$0); + if(get_ign(0)) + var + ignored$11 = [8, get_pad_opt(95), sub_fmtty$0], + _a7_ = [0, [23, ignored$11, fmt_rest$26]]; + else + var _a7_ = [0, [13, get_pad_opt(123), sub_fmtty$0, fmt_rest$26]]; + var fmt_result = _a7_; + break; + case 66: + case 98: + var + pad$3 = check_no_0(symb, get_padprec(0)), + fmt_rest$8 = parse(str_ind, end_ind)[1]; + if(get_ign(0)) + var + ignored$3 = [7, get_padprec_opt(95)], + _aO_ = [0, [23, ignored$3, fmt_rest$8]]; + else + var + match$3 = make_padding_fmt_ebb(pad$3, fmt_rest$8), + fmt_rest$9 = match$3[2], + pad$4 = match$3[1], + _aO_ = [0, [9, pad$4, fmt_rest$9]]; + var fmt_result = _aO_; + break; + case 37: + case 64: + var + fmt_rest$6 = parse(str_ind, end_ind)[1], + fmt_result = [0, [12, symb, fmt_rest$6]]; + break; + case 76: + case 108: + case 110: + var switch$1 = 0; + if(str_ind === end_ind) + switch$1 = 1; + else{ + var + symb$0 = caml_string_get(str, str_ind), + _a8_ = symb$0 - 88 | 0, + switch$2 = 0; + if(32 >= _a8_ >>> 0) + switch(_a8_){ + case 0: + case 12: + case 17: + case 23: + case 29: + case 32: + var _aU_ = 1; switch$2 = 1; break; + } + if(! switch$2) var _aU_ = 0; + if(_aU_) switch$0 = 1; else switch$1 = 1; + } + if(switch$1){ + var fmt_rest$13 = parse(str_ind, end_ind)[1], switch$3 = 0; + if(108 <= symb){ + if(111 > symb) + switch(symb - 108 | 0){ + case 0: + var counter = 0; switch$3 = 1; break; + case 1: break; + default: var counter = 1; switch$3 = 1; + } + } + else if(76 === symb){var counter = 2; switch$3 = 1;} + if(! switch$3) + throw caml_maybe_attach_backtrace([0, Assert_failure, _V_], 1); + if(get_ign(0)) + var + ignored$5 = [11, counter], + _aT_ = [0, [23, ignored$5, fmt_rest$13]]; + else + var _aT_ = [0, [21, counter, fmt_rest$13]]; + var fmt_result = _aT_; + } + break; + case 32: + case 35: + case 43: + case 45: + case 95: + var + fmt_result = caml_call3(failwith_message(_M_), str, pct_ind, symb); + break; + case 88: + case 100: + case 105: + case 111: + case 117: + case 120: + var + _aX_ = get_space(0), + _aY_ = get_hash(0), + iconv$2 = + compute_int_conv(pct_ind, str_ind, get_plus(0), _aY_, _aX_, symb), + fmt_rest$17 = parse(str_ind, end_ind)[1]; + if(get_ign(0)) + var + ignored$8 = [2, iconv$2, get_pad_opt(95)], + _aZ_ = [0, [23, ignored$8, fmt_rest$17]]; + else + var + _a0_ = get_prec(0), + match$6 = make_padprec_fmt_ebb(get_int_pad(0), _a0_, fmt_rest$17), + fmt_rest$18 = match$6[3], + prec$4 = match$6[2], + pad$8 = match$6[1], + _aZ_ = [0, [4, iconv$2, pad$8, prec$4, fmt_rest$18]]; + var fmt_result = _aZ_; + break; + case 69: + case 70: + case 71: + case 72: + case 101: + case 102: + case 103: + case 104: + var + space$1 = get_space(0), + hash$1 = get_hash(0), + plus$2 = get_plus(0), + flag = + plus$2 + ? space$1 + ? legacy_behavior$0 + ? 1 + : incompatible_flag(pct_ind, str_ind, 32, cst$36) + : 1 + : space$1 ? 2 : 0, + switch$4 = 0; + if(73 <= symb){ + var switcher = symb - 101 | 0; + if(3 < switcher >>> 0) + switch$4 = 1; + else{ + switch(switcher){ + case 0: + var _a9_ = 1; break; + case 1: + var _a9_ = 0; break; + case 2: + var _a9_ = 3; break; + default: var _a9_ = 6; + } + var kind = _a9_; + } + } + else if(69 <= symb){ + var switch$5 = 0; + switch(symb - 69 | 0){ + case 0: + var _a__ = 2; break; + case 1: + switch$4 = 1; switch$5 = 1; break; + case 2: + var _a__ = 4; break; + default: var _a__ = 7; + } + if(! switch$5) var kind = _a__; + } + else + switch$4 = 1; + if(switch$4){ + var switch$6 = 0; + if(hash$1){ + if(70 === symb){var kind = 8; switch$6 = 1;} + } + else if(70 === symb){var kind = 5; switch$6 = 1;} + if(! switch$6) + throw caml_maybe_attach_backtrace([0, Assert_failure, _X_], 1); + } + var + fconv = [0, flag, kind], + fmt_rest$11 = parse(str_ind, end_ind)[1]; + if(get_ign(0)){ + var match = get_prec(0); + if(typeof match === "number") + var + _aQ_ = match ? incompatible_flag(pct_ind, str_ind, 95, cst$26) : 0; + else + var ndec = match[1], _aQ_ = [0, ndec]; + var + ignored$4 = [6, get_pad_opt(95), _aQ_], + _aR_ = [0, [23, ignored$4, fmt_rest$11]]; + } + else + var + _aS_ = get_prec(0), + match$4 = make_padprec_fmt_ebb(get_pad(0), _aS_, fmt_rest$11), + fmt_rest$12 = match$4[3], + prec$3 = match$4[2], + pad$5 = match$4[1], + _aR_ = [0, [8, fconv, pad$5, prec$3, fmt_rest$12]]; + var fmt_result = _aR_; + break; + default: switch$0 = 1; + } + if(switch$0){ + var switch$7 = 0; + if(108 <= symb){ + if(111 > symb){ + var switch$8 = 0; + switch(symb - 108 | 0){ + case 0: + var + _ax_ = caml_string_get(str, str_ind), + _ay_ = get_space(0), + _az_ = get_hash(0), + iconv = + compute_int_conv + (pct_ind, str_ind + 1 | 0, get_plus(0), _az_, _ay_, _ax_), + fmt_rest = parse(str_ind + 1 | 0, end_ind)[1]; + if(get_ign(0)) + var + ignored = [3, iconv, get_pad_opt(95)], + _aA_ = [0, [23, ignored, fmt_rest]]; + else + var + _aC_ = get_prec(0), + match$0 = make_padprec_fmt_ebb(get_int_pad(0), _aC_, fmt_rest), + fmt_rest$0 = match$0[3], + prec$0 = match$0[2], + pad$0 = match$0[1], + _aA_ = [0, [5, iconv, pad$0, prec$0, fmt_rest$0]]; + var _aB_ = _aA_; + switch$8 = 1; + break; + case 1: break; + default: + var + _aD_ = caml_string_get(str, str_ind), + _aE_ = get_space(0), + _aF_ = get_hash(0), + iconv$0 = + compute_int_conv + (pct_ind, str_ind + 1 | 0, get_plus(0), _aF_, _aE_, _aD_), + fmt_rest$1 = parse(str_ind + 1 | 0, end_ind)[1]; + if(get_ign(0)) + var + ignored$0 = [4, iconv$0, get_pad_opt(95)], + _aG_ = [0, [23, ignored$0, fmt_rest$1]]; + else + var + _aH_ = get_prec(0), + match$1 = make_padprec_fmt_ebb(get_int_pad(0), _aH_, fmt_rest$1), + fmt_rest$2 = match$1[3], + prec$1 = match$1[2], + pad$1 = match$1[1], + _aG_ = [0, [6, iconv$0, pad$1, prec$1, fmt_rest$2]]; + var _aB_ = _aG_; + switch$8 = 1; + } + if(switch$8){var fmt_result = _aB_; switch$7 = 1;} + } + } + else if(76 === symb){ + var + _aI_ = caml_string_get(str, str_ind), + _aJ_ = get_space(0), + _aK_ = get_hash(0), + iconv$1 = + compute_int_conv + (pct_ind, str_ind + 1 | 0, get_plus(0), _aK_, _aJ_, _aI_), + fmt_rest$3 = parse(str_ind + 1 | 0, end_ind)[1]; + if(get_ign(0)) + var + ignored$1 = [5, iconv$1, get_pad_opt(95)], + _aL_ = [0, [23, ignored$1, fmt_rest$3]]; + else + var + _aM_ = get_prec(0), + match$2 = make_padprec_fmt_ebb(get_int_pad(0), _aM_, fmt_rest$3), + fmt_rest$4 = match$2[3], + prec$2 = match$2[2], + pad$2 = match$2[1], + _aL_ = [0, [7, iconv$1, pad$2, prec$2, fmt_rest$4]]; + var fmt_result = _aL_; + switch$7 = 1; + } + if(! switch$7) + var + fmt_result = + caml_call3(failwith_message(_J_), str, str_ind - 1 | 0, symb); + } + if(1 - legacy_behavior$0){ + var _ao_ = 1 - plus_used[1], plus$0 = _ao_ ? plus : _ao_; + if(plus$0) incompatible_flag(pct_ind, str_ind, symb, cst$27); + var _ap_ = 1 - hash_used[1], hash$0 = _ap_ ? hash : _ap_; + if(hash$0) incompatible_flag(pct_ind, str_ind, symb, cst$28); + var _aq_ = 1 - space_used[1], space$0 = _aq_ ? space : _aq_; + if(space$0) incompatible_flag(pct_ind, str_ind, symb, cst$29); + var + _ar_ = 1 - pad_used[1], + _as_ = _ar_ ? caml_notequal([0, pad], _K_) : _ar_; + if(_as_) incompatible_flag(pct_ind, str_ind, symb, cst_padding$0); + var + _at_ = 1 - prec_used[1], + _au_ = _at_ ? caml_notequal([0, prec], _L_) : _at_; + if(_au_){ + var _av_ = ign ? 95 : symb; + incompatible_flag(pct_ind, str_ind, _av_, cst_precision$2); + } + var plus$1 = ign ? plus : ign; + if(plus$1) incompatible_flag(pct_ind, str_ind, 95, cst$30); + } + var _aw_ = 1 - ign_used[1], ign$0 = _aw_ ? ign : _aw_; + if(ign$0){ + var switch$9 = 0; + if(38 <= symb){ + if(44 !== symb && 64 !== symb) switch$9 = 1; + } + else if(33 !== symb && 37 > symb) switch$9 = 1; + var switch$10 = 0; + if(switch$9 || ! legacy_behavior$0) switch$10 = 1; + if(switch$10) incompatible_flag(pct_ind, str_ind, symb, cst$31); + } + return fmt_result; + } + function parse_after_precision + (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad, prec){ + if(str_ind === end_ind) unexpected_end_of_format(end_ind); + function parse_conv(padprec){ + return parse_conversion + (pct_ind, + str_ind + 1 | 0, + end_ind, + plus, + hash, + space, + ign, + pad, + prec, + padprec, + caml_string_get(str, str_ind)); + } + if(typeof pad !== "number") return parse_conv(pad); + if(typeof prec === "number" && ! prec) return parse_conv(0); + if(minus){ + if(typeof prec === "number") return parse_conv(_F_); + var n = prec[1]; + return parse_conv([0, 0, n]); + } + if(typeof prec === "number") return parse_conv(_G_); + var n$0 = prec[1]; + return parse_conv([0, 1, n$0]); + } + function parse_after_padding + (pct_ind, str_ind, end_ind, minus, plus, hash, space, ign, pad){ + if(str_ind === end_ind) unexpected_end_of_format(end_ind); + var symb = caml_string_get(str, str_ind); + if(46 !== symb) + return parse_conversion + (pct_ind, + str_ind + 1 | 0, + end_ind, + plus, + hash, + space, + ign, + pad, + 0, + pad, + symb); + var str_ind$0 = str_ind + 1 | 0; + if(str_ind$0 === end_ind) unexpected_end_of_format(end_ind); + function parse_literal(minus, str_ind){ + var + match = parse_positive(str_ind, end_ind, 0), + prec = match[2], + new_ind = match[1]; + return parse_after_precision + (pct_ind, + new_ind, + end_ind, + minus, + plus, + hash, + space, + ign, + pad, + [0, prec]); + } + var symb$0 = caml_string_get(str, str_ind$0); + if(48 <= symb$0){ + if(58 > symb$0) return parse_literal(minus, str_ind$0); + } + else if(42 <= symb$0) + switch(symb$0 - 42 | 0){ + case 0: + return parse_after_precision + (pct_ind, + str_ind$0 + 1 | 0, + end_ind, + minus, + plus, + hash, + space, + ign, + pad, + 1); + case 1: + case 3: + if(legacy_behavior$0){ + var + _an_ = str_ind$0 + 1 | 0, + minus$0 = minus || (45 === symb$0 ? 1 : 0); + return parse_literal(minus$0, _an_); + } + break; + } + return legacy_behavior$0 + ? parse_after_precision + (pct_ind, + str_ind$0, + end_ind, + minus, + plus, + hash, + space, + ign, + pad, + _E_) + : invalid_format_without(str_ind$0 - 1 | 0, 46, cst_precision); + } + function parse_flags(pct_ind, str_ind, end_ind, ign){ + var + zero = [0, 0], + minus = [0, 0], + plus = [0, 0], + space = [0, 0], + hash = [0, 0]; + function set_flag(str_ind, flag){ + var _ak_ = flag[1], _al_ = _ak_ ? 1 - legacy_behavior$0 : _ak_; + if(_al_){ + var _am_ = caml_string_get(str, str_ind); + caml_call3(failwith_message(_C_), str, str_ind, _am_); + } + flag[1] = 1; + return 0; + } + var str_ind$0 = str_ind; + for(;;){ + if(str_ind$0 === end_ind) unexpected_end_of_format(end_ind); + var switcher = caml_string_get(str, str_ind$0) - 32 | 0; + if(16 >= switcher >>> 0) + switch(switcher){ + case 0: + set_flag(str_ind$0, space); + var str_ind$1 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$1; + continue; + case 3: + set_flag(str_ind$0, hash); + var str_ind$2 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$2; + continue; + case 11: + set_flag(str_ind$0, plus); + var str_ind$3 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$3; + continue; + case 13: + set_flag(str_ind$0, minus); + var str_ind$4 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$4; + continue; + case 16: + set_flag(str_ind$0, zero); + var str_ind$5 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$5; + continue; + } + var + space$0 = space[1], + hash$0 = hash[1], + plus$0 = plus[1], + minus$0 = minus[1], + zero$0 = zero[1]; + if(str_ind$0 === end_ind) unexpected_end_of_format(end_ind); + var + padty = + zero$0 + ? minus$0 + ? legacy_behavior$0 + ? 0 + : incompatible_flag(pct_ind, str_ind$0, 45, cst_0) + : 2 + : minus$0 ? 0 : 1, + match = caml_string_get(str, str_ind$0); + if(48 <= match){ + if(58 > match){ + var + match$0 = parse_positive(str_ind$0, end_ind, 0), + width = match$0[2], + new_ind = match$0[1]; + return parse_after_padding + (pct_ind, + new_ind, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + [0, padty, width]); + } + } + else if(42 === match) + return parse_after_padding + (pct_ind, + str_ind$0 + 1 | 0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + [1, padty]); + switch(padty){ + case 0: + if(1 - legacy_behavior$0) + invalid_format_without(str_ind$0 - 1 | 0, 45, cst_padding); + return parse_after_padding + (pct_ind, + str_ind$0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + 0); + case 1: + return parse_after_padding + (pct_ind, + str_ind$0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + 0); + default: + return parse_after_padding + (pct_ind, + str_ind$0, + end_ind, + minus$0, + plus$0, + hash$0, + space$0, + ign, + _D_); + } + } + } + function parse_tag(is_open_tag, str_ind, end_ind){ + try{ + if(str_ind === end_ind) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + if(60 !== caml_string_get(str, str_ind)) + throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var ind = caml_call3(Stdlib_String[31], str, str_ind + 1 | 0, 62); + if(end_ind <= ind) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var + sub_str = + caml_call3 + (Stdlib_String[15], str, str_ind, (ind - str_ind | 0) + 1 | 0), + fmt_rest$0 = parse(ind + 1 | 0, end_ind)[1], + sub_fmt = parse(str_ind, ind + 1 | 0)[1], + sub_format$0 = [0, sub_fmt, sub_str], + formatting$0 = is_open_tag ? [0, sub_format$0] : [1, sub_format$0], + _ai_ = [0, [18, formatting$0, fmt_rest$0]]; + return _ai_; + } + catch(_aj_){ + var _ah_ = caml_wrap_exception(_aj_); + if(_ah_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_ah_, 0); + var + fmt_rest = parse(str_ind, end_ind)[1], + formatting = is_open_tag ? [0, sub_format] : [1, sub_format]; + return [0, [18, formatting, fmt_rest]]; + } + } + function parse_spaces(str_ind, end_ind){ + var str_ind$0 = str_ind; + for(;;){ + if(str_ind$0 === end_ind) unexpected_end_of_format(end_ind); + if(32 !== caml_string_get(str, str_ind$0)) return str_ind$0; + var str_ind$1 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$1; + } + } + function parse_positive(str_ind, end_ind, acc){ + var str_ind$0 = str_ind, acc$0 = acc; + for(;;){ + if(str_ind$0 === end_ind) unexpected_end_of_format(end_ind); + var c = caml_string_get(str, str_ind$0); + if(9 < c - 48 >>> 0) return [0, str_ind$0, acc$0]; + var new_acc = (acc$0 * 10 | 0) + (c - 48 | 0) | 0; + if(Stdlib_Sys[12] < new_acc){ + var _ag_ = Stdlib_Sys[12]; + return caml_call3(failwith_message(_S_), str, new_acc, _ag_); + } + var + str_ind$1 = str_ind$0 + 1 | 0, + str_ind$0 = str_ind$1, + acc$0 = new_acc; + } + } + function parse_integer(str_ind, end_ind){ + if(str_ind === end_ind) unexpected_end_of_format(end_ind); + var match = caml_string_get(str, str_ind); + if(48 <= match){ + if(58 > match) return parse_positive(str_ind, end_ind, 0); + } + else if(45 === match){ + if((str_ind + 1 | 0) === end_ind) unexpected_end_of_format(end_ind); + var c = caml_string_get(str, str_ind + 1 | 0); + if(9 < c - 48 >>> 0) + return expected_character(str_ind + 1 | 0, cst_digit, c); + var + match$0 = parse_positive(str_ind + 1 | 0, end_ind, 0), + n = match$0[2], + next_ind = match$0[1]; + return [0, next_ind, - n | 0]; + } + throw caml_maybe_attach_backtrace([0, Assert_failure, _T_], 1); + } + function search_subformat_end(str_ind, end_ind, c){ + var str_ind$0 = str_ind; + for(;;){ + if(str_ind$0 === end_ind) + caml_call3(failwith_message(_U_), str, c, end_ind); + if(37 !== caml_string_get(str, str_ind$0)){ + var str_ind$7 = str_ind$0 + 1 | 0, str_ind$0 = str_ind$7; + continue; + } + if((str_ind$0 + 1 | 0) === end_ind) unexpected_end_of_format(end_ind); + if(caml_string_get(str, str_ind$0 + 1 | 0) === c) return str_ind$0; + var match = caml_string_get(str, str_ind$0 + 1 | 0); + if(95 <= match){ + if(123 <= match){ + if(126 > match) + switch(match - 123 | 0){ + case 0: + var + sub_end = search_subformat_end(str_ind$0 + 2 | 0, end_ind, 125), + str_ind$2 = sub_end + 2 | 0, + str_ind$0 = str_ind$2; + continue; + case 1: break; + default: + return expected_character(str_ind$0 + 1 | 0, cst_character, 125); + } + } + else if(96 > match){ + if((str_ind$0 + 2 | 0) === end_ind) unexpected_end_of_format(end_ind); + var match$0 = caml_string_get(str, str_ind$0 + 2 | 0); + if(40 === match$0){ + var + sub_end$0 = search_subformat_end(str_ind$0 + 3 | 0, end_ind, 41), + str_ind$3 = sub_end$0 + 2 | 0, + str_ind$0 = str_ind$3; + continue; + } + if(123 === match$0){ + var + sub_end$1 = search_subformat_end(str_ind$0 + 3 | 0, end_ind, 125), + str_ind$4 = sub_end$1 + 2 | 0, + str_ind$0 = str_ind$4; + continue; + } + var str_ind$5 = str_ind$0 + 3 | 0, str_ind$0 = str_ind$5; + continue; + } + } + else{ + if(40 === match){ + var + sub_end$2 = search_subformat_end(str_ind$0 + 2 | 0, end_ind, 41), + str_ind$6 = sub_end$2 + 2 | 0, + str_ind$0 = str_ind$6; + continue; + } + if(41 === match) + return expected_character(str_ind$0 + 1 | 0, cst_character$0, 41); + } + var str_ind$1 = str_ind$0 + 2 | 0, str_ind$0 = str_ind$1; + } + } + function incompatible_flag(pct_ind, str_ind, symb, option){ + var + subfmt = + caml_call3(Stdlib_String[15], str, pct_ind, str_ind - pct_ind | 0); + return caml_call5 + (failwith_message(_Y_), str, pct_ind, option, symb, subfmt); + } + function compute_int_conv(pct_ind, str_ind, plus, hash, space, symb){ + var plus$0 = plus, hash$0 = hash, space$0 = space; + for(;;){ + var switch$0 = 0; + if(plus$0){ + if(hash$0) + switch$0 = 1; + else if(! space$0){ + if(100 === symb) return 1; + if(105 === symb) return 4; + } + } + else if(hash$0) + if(space$0) + switch$0 = 1; + else{ + var switcher$0 = symb - 88 | 0; + if(32 < switcher$0 >>> 0) + switch$0 = 1; + else + switch(switcher$0){ + case 0: + return 9; + case 12: + return 13; + case 17: + return 14; + case 23: + return 11; + case 29: + return 15; + case 32: + return 7; + default: switch$0 = 1; + } + } + else if(space$0){ + if(100 === symb) return 2; + if(105 === symb) return 5; + } + else{ + var switcher$1 = symb - 88 | 0; + if(32 >= switcher$1 >>> 0) + switch(switcher$1){ + case 0: + return 8; + case 12: + return 0; + case 17: + return 3; + case 23: + return 10; + case 29: + return 12; + case 32: + return 6; + } + } + if(switch$0){ + var switcher = symb - 88 | 0; + if(32 >= switcher >>> 0) + switch(switcher){ + case 0: + if(legacy_behavior$0) return 9; break; + case 23: + if(legacy_behavior$0) return 11; break; + case 32: + if(legacy_behavior$0) return 7; break; + case 12: + case 17: + case 29: + if(! legacy_behavior$0) + return incompatible_flag(pct_ind, str_ind, symb, cst$35); + var hash$0 = 0; + continue; + } + } + if(! plus$0){ + if(! space$0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _W_], 1); + if(! legacy_behavior$0) + return incompatible_flag(pct_ind, str_ind, symb, cst$34); + var space$0 = 0; + continue; + } + if(space$0){ + if(! legacy_behavior$0) + return incompatible_flag(pct_ind, str_ind, 32, cst$32); + var space$0 = 0; + continue; + } + if(! legacy_behavior$0) + return incompatible_flag(pct_ind, str_ind, symb, cst$33); + var plus$0 = 0; + } + } + return parse(0, caml_ml_string_length(str)); + } + function format_of_string_fmtty(str, fmtty){ + var fmt = fmt_ebb_of_string(0, str)[1]; + try{var _ae_ = [0, type_format(fmt, fmtty), str]; return _ae_;} + catch(_af_){ + var _ac_ = caml_wrap_exception(_af_); + if(_ac_ !== Type_mismatch) throw caml_maybe_attach_backtrace(_ac_, 0); + var _ad_ = string_of_fmtty(fmtty); + return caml_call2(failwith_message(_Z_), str, _ad_); + } + } + function format_of_string_format(str, param){ + var + str$0 = param[2], + fmt = param[1], + fmt$0 = fmt_ebb_of_string(0, str)[1]; + try{ + var _aa_ = [0, type_format(fmt$0, fmtty_of_fmt(fmt)), str]; + return _aa_; + } + catch(_ab_){ + var _$_ = caml_wrap_exception(_ab_); + if(_$_ === Type_mismatch) + return caml_call2(failwith_message(___), str, str$0); + throw caml_maybe_attach_backtrace(_$_, 0); + } + } + var + CamlinternalFormat = + [0, + is_in_char_set, + rev_char_set, + create_char_set, + add_in_char_set, + freeze_char_set, + param_format_of_ignored_format, + make_printf, + make_iprintf, + output_acc, + bufput_acc, + strput_acc, + type_format, + fmt_ebb_of_string, + format_of_string_fmtty, + format_of_string_format, + char_of_iconv, + string_of_formatting_lit, + string_of_fmtty, + string_of_fmt, + open_box_of_string, + symm, + trans, + recast]; + runtime.caml_register_global(197, CamlinternalFormat, "CamlinternalFormat"); + return; + } + (globalThis)); + +//# 15752 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib_Buffer = global_data.Stdlib__Buffer, + CamlinternalFormat = global_data.CamlinternalFormat, + Stdlib = global_data.Stdlib; + function kfprintf(k, o, param){ + var fmt = param[1], _g_ = 0; + function _h_(acc){ + caml_call2(CamlinternalFormat[9], o, acc); + return caml_call1(k, o); + } + return caml_call3(CamlinternalFormat[7], _h_, _g_, fmt); + } + function kbprintf(k, b, param){ + var fmt = param[1], _e_ = 0; + function _f_(acc){ + caml_call2(CamlinternalFormat[10], b, acc); + return caml_call1(k, b); + } + return caml_call3(CamlinternalFormat[7], _f_, _e_, fmt); + } + function ikfprintf(k, oc, param){ + var fmt = param[1]; + return caml_call3(CamlinternalFormat[8], k, oc, fmt); + } + function fprintf(oc, fmt){ + return kfprintf(function(_d_){return 0;}, oc, fmt); + } + function bprintf(b, fmt){ + return kbprintf(function(_c_){return 0;}, b, fmt); + } + function ifprintf(oc, fmt){ + return ikfprintf(function(_b_){return 0;}, oc, fmt); + } + function ibprintf(b, fmt){ + return ikfprintf(function(_a_){return 0;}, b, fmt); + } + function printf(fmt){return fprintf(Stdlib[39], fmt);} + function eprintf(fmt){return fprintf(Stdlib[40], fmt);} + function ksprintf(k, param){ + var fmt = param[1]; + function k$0(acc){ + var buf = caml_call1(Stdlib_Buffer[1], 64); + caml_call2(CamlinternalFormat[11], buf, acc); + return caml_call1(k, caml_call1(Stdlib_Buffer[2], buf)); + } + return caml_call3(CamlinternalFormat[7], k$0, 0, fmt); + } + function sprintf(fmt){return ksprintf(function(s){return s;}, fmt);} + var + Stdlib_Printf = + [0, + fprintf, + printf, + eprintf, + sprintf, + bprintf, + ifprintf, + ibprintf, + kfprintf, + ikfprintf, + ksprintf, + kbprintf, + ikfprintf, + ksprintf]; + runtime.caml_register_global(3, Stdlib_Printf, "Stdlib__Printf"); + return; + } + (globalThis)); + +//# 16542 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + global_data = runtime.caml_get_global_data(), + CamlinternalAtomic = global_data.CamlinternalAtomic, + make = CamlinternalAtomic[1], + get = CamlinternalAtomic[2], + set = CamlinternalAtomic[3], + exchange = CamlinternalAtomic[4], + compare_and_set = CamlinternalAtomic[5], + fetch_and_add = CamlinternalAtomic[6], + incr = CamlinternalAtomic[7], + decr = CamlinternalAtomic[8], + Stdlib_Atomic = + [0, + make, + get, + set, + exchange, + compare_and_set, + fetch_and_add, + incr, + decr]; + runtime.caml_register_global(1, Stdlib_Atomic, "Stdlib__Atomic"); + return; + } + (globalThis)); + +//# 16574 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst$4 = "", + cst_s = "%s\n", + cst_Program_not_linked_with_g_$0 = + "(Program not linked with -g, cannot print stack backtrace)\n", + cst_characters = ", characters ", + cst_Fatal_error_exception = "Fatal error: exception ", + cst_Fatal_error_exception_s = "Fatal error: exception %s\n", + cst_Uncaught_exception = "Uncaught exception: ", + cst_Uncaught_exception_s = "Uncaught exception: %s\n", + caml_check_bound = runtime.caml_check_bound, + caml_get_exception_raw_backtra = runtime.caml_get_exception_raw_backtrace, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_obj_tag = runtime.caml_obj_tag, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + function caml_call6(f, a0, a1, a2, a3, a4, a5){ + return (f.l >= 0 ? f.l : f.l = f.length) == 6 + ? f(a0, a1, a2, a3, a4, a5) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5]); + } + function caml_call8(f, a0, a1, a2, a3, a4, a5, a6, a7){ + return (f.l >= 0 ? f.l : f.l = f.length) == 8 + ? f(a0, a1, a2, a3, a4, a5, a6, a7) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5, a6, a7]); + } + var + global_data = runtime.caml_get_global_data(), + cst$0 = cst$4, + cst$3 = cst$4, + partial = [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, 0]]], + cst$1 = cst$4, + cst$2 = cst$4, + cst = "_", + locfmt = + [0, + [11, + 'File "', + [2, + 0, + [11, + '", line ', + [4, + 0, + 0, + 0, + [11, + cst_characters, + [4, 0, 0, 0, [12, 45, [4, 0, 0, 0, [11, ": ", [2, 0, 0]]]]]]]]]], + 'File "%s", line %d, characters %d-%d: %s'], + Stdlib_Printf = global_data.Stdlib__Printf, + Stdlib_Atomic = global_data.Stdlib__Atomic, + Stdlib = global_data.Stdlib, + Stdlib_Buffer = global_data.Stdlib__Buffer, + Stdlib_Obj = global_data.Stdlib__Obj, + printers = caml_call1(Stdlib_Atomic[1], 0), + _c_ = [0, [11, ", ", [2, 0, [2, 0, 0]]], ", %s%s"], + _o_ = + [0, + [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], + cst_Fatal_error_exception_s], + _p_ = + [0, + [11, + "Fatal error in uncaught exception handler: exception ", + [2, 0, [12, 10, 0]]], + "Fatal error in uncaught exception handler: exception %s\n"], + cst_Fatal_error_out_of_memory_ = + "Fatal error: out of memory in uncaught exception handler", + _n_ = + [0, + [11, cst_Fatal_error_exception, [2, 0, [12, 10, 0]]], + cst_Fatal_error_exception_s], + _l_ = [0, [2, 0, [12, 10, 0]], cst_s], + cst_Program_not_linked_with_g_ = cst_Program_not_linked_with_g_$0, + _j_ = [0, [2, 0, [12, 10, 0]], cst_s], + _k_ = + [0, + [11, cst_Program_not_linked_with_g_$0, 0], + cst_Program_not_linked_with_g_$0], + cst_Raised_at = "Raised at", + cst_Re_raised_at = "Re-raised at", + cst_Raised_by_primitive_operat = "Raised by primitive operation at", + cst_Called_from = "Called from", + cst_inlined = " (inlined)", + _h_ = + [0, + [2, + 0, + [12, + 32, + [2, + 0, + [11, + ' in file "', + [2, + 0, + [12, + 34, + [2, + 0, + [11, ", line ", [4, 0, 0, 0, [11, cst_characters, partial]]]]]]]]]], + '%s %s in file "%s"%s, line %d, characters %d-%d'], + _i_ = [0, [2, 0, [11, " unknown location", 0]], "%s unknown location"], + _g_ = + [0, + [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]], + cst_Uncaught_exception_s], + _f_ = + [0, + [11, cst_Uncaught_exception, [2, 0, [12, 10, 0]]], + cst_Uncaught_exception_s], + cst_Out_of_memory = "Out of memory", + cst_Stack_overflow = "Stack overflow", + cst_Pattern_matching_failed = "Pattern matching failed", + cst_Assertion_failed = "Assertion failed", + cst_Undefined_recursive_module = "Undefined recursive module", + _d_ = [0, [12, 40, [2, 0, [2, 0, [12, 41, 0]]]], "(%s%s)"], + _e_ = [0, [12, 40, [2, 0, [12, 41, 0]]], "(%s)"], + _b_ = [0, [4, 0, 0, 0, 0], "%d"], + _a_ = [0, [3, 0, 0], "%S"], + _m_ = + [0, + cst$4, + "(Cannot print locations:\n bytecode executable program file not found)", + "(Cannot print locations:\n bytecode executable program file appears to be corrupt)", + "(Cannot print locations:\n bytecode executable program file has wrong magic number)", + "(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"]; + function field(x, i){ + var f = x[1 + i]; + if(! caml_call1(Stdlib_Obj[1], f)) + return caml_call2(Stdlib_Printf[4], _b_, f); + var _al_ = Stdlib_Obj[13]; + if(caml_obj_tag(f) === _al_) return caml_call2(Stdlib_Printf[4], _a_, f); + var _am_ = Stdlib_Obj[14]; + return caml_obj_tag(f) === _am_ ? caml_call1(Stdlib[35], f) : cst; + } + function other_fields(x, i){ + if(x.length - 1 <= i) return cst$0; + var _aj_ = other_fields(x, i + 1 | 0), _ak_ = field(x, i); + return caml_call3(Stdlib_Printf[4], _c_, _ak_, _aj_); + } + function use_printers(x){ + var param = caml_call1(Stdlib_Atomic[2], printers); + for(;;){ + if(! param) return 0; + var tl = param[2], hd = param[1], switch$0 = 0; + try{var val = caml_call1(hd, x);}catch(_ai_){switch$0 = 1;} + if(! switch$0 && val){var s = val[1]; return [0, s];} + var param = tl; + } + } + function to_string_default(x){ + if(x === Stdlib[9]) return cst_Out_of_memory; + if(x === Stdlib[10]) return cst_Stack_overflow; + if(x[1] === Stdlib[4]){ + var + match$0 = x[2], + char$0 = match$0[3], + line = match$0[2], + file = match$0[1]; + return caml_call6 + (Stdlib_Printf[4], + locfmt, + file, + line, + char$0, + char$0 + 5 | 0, + cst_Pattern_matching_failed); + } + if(x[1] === Stdlib[5]){ + var + match$1 = x[2], + char$1 = match$1[3], + line$0 = match$1[2], + file$0 = match$1[1]; + return caml_call6 + (Stdlib_Printf[4], + locfmt, + file$0, + line$0, + char$1, + char$1 + 6 | 0, + cst_Assertion_failed); + } + if(x[1] === Stdlib[15]){ + var + match$2 = x[2], + char$2 = match$2[3], + line$1 = match$2[2], + file$1 = match$2[1]; + return caml_call6 + (Stdlib_Printf[4], + locfmt, + file$1, + line$1, + char$2, + char$2 + 6 | 0, + cst_Undefined_recursive_module); + } + if(0 !== caml_obj_tag(x)) return x[1]; + var constructor = x[1][1], match = x.length - 1; + if(2 < match >>> 0) + var + _ae_ = other_fields(x, 2), + _af_ = field(x, 1), + _ah_ = caml_call3(Stdlib_Printf[4], _d_, _af_, _ae_); + else + switch(match){ + case 0: + var _ah_ = cst$1; break; + case 1: + var _ah_ = cst$2; break; + default: + var + _ag_ = field(x, 1), + _ah_ = caml_call2(Stdlib_Printf[4], _e_, _ag_); + } + return caml_call2(Stdlib[28], constructor, _ah_); + } + function to_string(e){ + var match = use_printers(e); + if(! match) return to_string_default(e); + var s = match[1]; + return s; + } + function print(fct, arg){ + try{var _ad_ = caml_call1(fct, arg); return _ad_;} + catch(x$0){ + var x = caml_wrap_exception(x$0), _ac_ = to_string(x); + caml_call2(Stdlib_Printf[3], _f_, _ac_); + caml_call1(Stdlib[63], Stdlib[40]); + throw caml_maybe_attach_backtrace(x, 0); + } + } + function catch$0(fct, arg){ + try{var _ab_ = caml_call1(fct, arg); return _ab_;} + catch(x$0){ + var x = caml_wrap_exception(x$0); + caml_call1(Stdlib[63], Stdlib[39]); + var _aa_ = to_string(x); + caml_call2(Stdlib_Printf[3], _g_, _aa_); + return caml_call1(Stdlib[99], 2); + } + } + function raw_backtrace_entries(bt){return bt;} + function convert_raw_backtrace(bt){ + return [0, runtime.caml_convert_raw_backtrace(bt)]; + } + function format_backtrace_slot(pos, slot){ + function info(is_raise){ + return is_raise + ? 0 === pos ? cst_Raised_at : cst_Re_raised_at + : 0 === pos ? cst_Raised_by_primitive_operat : cst_Called_from; + } + if(0 === slot[0]){ + var + _U_ = slot[5], + _V_ = slot[4], + _W_ = slot[3], + _X_ = slot[6] ? cst_inlined : cst$3, + _Y_ = slot[2], + _Z_ = slot[7], + ___ = info(slot[1]); + return [0, + caml_call8 + (Stdlib_Printf[4], _h_, ___, _Z_, _Y_, _X_, _W_, _V_, _U_)]; + } + if(slot[1]) return 0; + var _$_ = info(0); + return [0, caml_call2(Stdlib_Printf[4], _i_, _$_)]; + } + function print_raw_backtrace(outchan, raw_backtrace){ + var backtrace = convert_raw_backtrace(raw_backtrace); + if(! backtrace) return caml_call2(Stdlib_Printf[1], outchan, _k_); + var a = backtrace[1], _S_ = a.length - 1 - 1 | 0, _R_ = 0; + if(_S_ >= 0){ + var i = _R_; + for(;;){ + var match = format_backtrace_slot(i, caml_check_bound(a, i)[1 + i]); + if(match){ + var str = match[1]; + caml_call3(Stdlib_Printf[1], outchan, _j_, str); + } + var _T_ = i + 1 | 0; + if(_S_ !== i){var i = _T_; continue;} + break; + } + } + return 0; + } + function print_backtrace(outchan){ + return print_raw_backtrace(outchan, caml_get_exception_raw_backtra(0)); + } + function raw_backtrace_to_string(raw_backtrace){ + var backtrace = convert_raw_backtrace(raw_backtrace); + if(! backtrace) return cst_Program_not_linked_with_g_; + var + a = backtrace[1], + b = caml_call1(Stdlib_Buffer[1], 1024), + _P_ = a.length - 1 - 1 | 0, + _O_ = 0; + if(_P_ >= 0){ + var i = _O_; + for(;;){ + var match = format_backtrace_slot(i, caml_check_bound(a, i)[1 + i]); + if(match){ + var str = match[1]; + caml_call3(Stdlib_Printf[5], b, _l_, str); + } + var _Q_ = i + 1 | 0; + if(_P_ !== i){var i = _Q_; continue;} + break; + } + } + return caml_call1(Stdlib_Buffer[2], b); + } + function backtrace_slot_is_raise(param){ + return 0 === param[0] ? param[1] : param[1]; + } + function backtrace_slot_is_inline(param){return 0 === param[0] ? param[6] : 0; + } + function backtrace_slot_location(param){ + return 0 === param[0] + ? [0, [0, param[2], param[3], param[4], param[5]]] + : 0; + } + function backtrace_slot_defname(param){ + if(0 === param[0] && runtime.caml_string_notequal(param[7], cst$4)) + return [0, param[7]]; + return 0; + } + function backtrace_slots(raw_backtrace){ + var match = convert_raw_backtrace(raw_backtrace); + if(! match) return 0; + var backtrace = match[1], i$1 = backtrace.length - 1 - 1 | 0, i = i$1; + for(;;){ + if(-1 === i) + var _N_ = 0; + else{ + var _M_ = 0 === caml_check_bound(backtrace, i)[1 + i][0] ? 1 : 0; + if(! _M_){var i$0 = i - 1 | 0, i = i$0; continue;} + var _N_ = _M_; + } + return _N_ ? [0, backtrace] : 0; + } + } + function backtrace_slots_of_raw_entry(entry){return backtrace_slots([0, entry]); + } + function raw_backtrace_length(bt){return bt.length - 1;} + function get_backtrace(param){ + return raw_backtrace_to_string(caml_get_exception_raw_backtra(0)); + } + function register_printer(fn){ + for(;;){ + var + old_printers = caml_call1(Stdlib_Atomic[2], printers), + new_printers = [0, fn, old_printers], + success = + caml_call3(Stdlib_Atomic[5], printers, old_printers, new_printers), + _L_ = 1 - success; + if(_L_) continue; + return _L_; + } + } + function exn_slot(x){return 0 === caml_obj_tag(x) ? x[1] : x;} + function exn_slot_id(x){var slot = exn_slot(x); return slot[2];} + function exn_slot_name(x){var slot = exn_slot(x); return slot[1];} + var errors = _m_.slice(); + function default_uncaught_exception_han(exn, raw_backtrace){ + var _I_ = to_string(exn); + caml_call2(Stdlib_Printf[3], _n_, _I_); + print_raw_backtrace(Stdlib[40], raw_backtrace); + var status = runtime.caml_ml_debug_info_status(0); + if(status < 0){ + var + _J_ = caml_call1(Stdlib[18], status), + _K_ = caml_check_bound(errors, _J_)[1 + _J_]; + caml_call1(Stdlib[53], _K_); + } + return caml_call1(Stdlib[63], Stdlib[40]); + } + var uncaught_exception_handler = [0, default_uncaught_exception_han]; + function set_uncaught_exception_handler(fn){ + uncaught_exception_handler[1] = fn; + return 0; + } + var empty_backtrace = [0]; + function handle_uncaught_exception(exn$0, debugger_in_use){ + try{ + try{ + var + raw_backtrace = + debugger_in_use ? empty_backtrace : caml_get_exception_raw_backtra(0); + try{caml_call1(Stdlib[103], 0);}catch(_H_){} + try{ + var + _D_ = caml_call2(uncaught_exception_handler[1], exn$0, raw_backtrace), + _C_ = _D_; + } + catch(exn$1){ + var + exn = caml_wrap_exception(exn$1), + raw_backtrace$0 = caml_get_exception_raw_backtra(0), + _A_ = to_string(exn$0); + caml_call2(Stdlib_Printf[3], _o_, _A_); + print_raw_backtrace(Stdlib[40], raw_backtrace); + var _B_ = to_string(exn); + caml_call2(Stdlib_Printf[3], _p_, _B_); + print_raw_backtrace(Stdlib[40], raw_backtrace$0); + var _C_ = caml_call1(Stdlib[63], Stdlib[40]); + } + var _E_ = _C_; + } + catch(_G_){ + var _z_ = caml_wrap_exception(_G_); + if(_z_ !== Stdlib[9]) throw caml_maybe_attach_backtrace(_z_, 0); + var _E_ = caml_call1(Stdlib[53], cst_Fatal_error_out_of_memory_); + } + return _E_; + } + catch(_F_){return 0;} + } + runtime.caml_register_named_value + ("Printexc.handle_uncaught_exception", handle_uncaught_exception); + function _q_(_y_){return runtime.caml_raw_backtrace_next_slot(_y_);} + function _r_(_x_){return runtime.caml_convert_raw_backtrace_slot(_x_);} + function _s_(_w_, _v_){return runtime.caml_raw_backtrace_slot(_w_, _v_);} + var + _t_ = + [0, + backtrace_slot_is_raise, + backtrace_slot_is_inline, + backtrace_slot_location, + backtrace_slot_defname, + format_backtrace_slot], + Stdlib_Printexc = + [0, + to_string, + to_string_default, + print, + catch$0, + print_backtrace, + get_backtrace, + runtime.caml_record_backtrace, + runtime.caml_backtrace_status, + register_printer, + use_printers, + raw_backtrace_entries, + function(_u_){return caml_get_exception_raw_backtra(_u_);}, + print_raw_backtrace, + raw_backtrace_to_string, + default_uncaught_exception_han, + set_uncaught_exception_handler, + backtrace_slots, + backtrace_slots_of_raw_entry, + _t_, + raw_backtrace_length, + _s_, + _r_, + _q_, + exn_slot_id, + exn_slot_name]; + runtime.caml_register_global(42, Stdlib_Printexc, "Stdlib__Printexc"); + return; + } + (globalThis)); + +//# 17293 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_Digest_from_hex$1 = "Digest.from_hex", + caml_bytes_unsafe_set = runtime.caml_bytes_unsafe_set, + caml_create_bytes = runtime.caml_create_bytes, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_md5_string = runtime.caml_md5_string, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_get = runtime.caml_string_get, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Char = global_data.Stdlib__Char, + Stdlib_Bytes = global_data.Stdlib__Bytes, + Stdlib_String = global_data.Stdlib__String, + compare = Stdlib_String[9], + equal = Stdlib_String[8], + cst_Digest_from_hex$0 = cst_Digest_from_hex$1, + cst_Digest_from_hex = cst_Digest_from_hex$1, + cst_Digest_to_hex = "Digest.to_hex", + cst_Digest_substring = "Digest.substring"; + function string(str){ + return caml_md5_string(str, 0, caml_ml_string_length(str)); + } + function bytes(b){return string(caml_call1(Stdlib_Bytes[48], b));} + function substring(str, ofs, len){ + if(0 <= ofs && 0 <= len && (caml_ml_string_length(str) - len | 0) >= ofs) + return caml_md5_string(str, ofs, len); + return caml_call1(Stdlib[1], cst_Digest_substring); + } + function subbytes(b, ofs, len){ + return substring(caml_call1(Stdlib_Bytes[48], b), ofs, len); + } + function file(filename){ + var ic = caml_call1(Stdlib[80], filename); + try{var d = runtime.caml_md5_chan(ic, -1);} + catch(e$0){ + var e = caml_wrap_exception(e$0); + caml_call1(Stdlib[93], ic); + throw caml_maybe_attach_backtrace(e, 0); + } + caml_call1(Stdlib[93], ic); + return d; + } + function output(chan, digest){return caml_call2(Stdlib[66], chan, digest);} + function input(chan){return caml_call2(Stdlib[86], chan, 16);} + function char_hex(n){var _e_ = 10 <= n ? 87 : 48; return n + _e_ | 0;} + function to_hex(d){ + if(16 !== caml_ml_string_length(d)) + caml_call1(Stdlib[1], cst_Digest_to_hex); + var result = caml_create_bytes(32), i = 0; + for(;;){ + var x = caml_string_get(d, i); + caml_bytes_unsafe_set(result, i * 2 | 0, char_hex(x >>> 4 | 0)); + caml_bytes_unsafe_set(result, (i * 2 | 0) + 1 | 0, char_hex(x & 15)); + var _d_ = i + 1 | 0; + if(15 === i) return caml_call1(Stdlib_Bytes[48], result); + var i = _d_; + } + } + function from_hex(s){ + if(32 !== caml_ml_string_length(s)) + caml_call1(Stdlib[1], cst_Digest_from_hex); + function digit(c){ + if(65 <= c){ + if(97 <= c){ + if(103 > c) return (c - 97 | 0) + 10 | 0; + } + else if(71 > c) return (c - 65 | 0) + 10 | 0; + } + else if(9 >= c - 48 >>> 0) return c - 48 | 0; + throw caml_maybe_attach_backtrace + ([0, Stdlib[6], cst_Digest_from_hex$0], 1); + } + var result = caml_create_bytes(16), i = 0; + for(;;){ + var + i$0 = 2 * i | 0, + _a_ = digit(caml_string_get(s, i$0 + 1 | 0)), + _b_ = (digit(caml_string_get(s, i$0)) << 4) + _a_ | 0; + runtime.caml_bytes_set(result, i, caml_call1(Stdlib_Char[1], _b_)); + var _c_ = i + 1 | 0; + if(15 === i) return caml_call1(Stdlib_Bytes[48], result); + var i = _c_; + } + } + var + Stdlib_Digest = + [0, + compare, + equal, + string, + bytes, + substring, + subbytes, + file, + output, + input, + to_hex, + from_hex]; + runtime.caml_register_global(8, Stdlib_Digest, "Stdlib__Digest"); + return; + } + (globalThis)); + +//# 17414 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_check_bound = runtime.caml_check_bound, + caml_greaterthan = runtime.caml_greaterthan, + caml_int64_of_int32 = runtime.caml_int64_of_int32, + caml_int64_or = runtime.caml_int64_or, + caml_int64_shift_left = runtime.caml_int64_shift_left, + caml_int64_shift_right_unsigne = runtime.caml_int64_shift_right_unsigned, + caml_int64_sub = runtime.caml_int64_sub, + caml_int64_to_int32 = runtime.caml_int64_to_int32, + caml_lessequal = runtime.caml_lessequal, + caml_mod = runtime.caml_mod, + caml_string_get = runtime.caml_string_get, + caml_sys_random_seed = runtime.caml_sys_random_seed; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib, + Stdlib_Int32 = global_data.Stdlib__Int32, + Stdlib_Int64 = global_data.Stdlib__Int64, + Stdlib_Int = global_data.Stdlib__Int, + Stdlib_Digest = global_data.Stdlib__Digest, + Stdlib_Array = global_data.Stdlib__Array, + Stdlib_Nativeint = global_data.Stdlib__Nativeint, + _a_ = runtime.caml_int64_create_lo_mi_hi(1, 0, 0), + _b_ = runtime.caml_int64_create_lo_mi_hi(0, 0, 0), + cst_Random_int64 = "Random.int64", + cst_Random_int32 = "Random.int32", + cst_Random_full_int = "Random.full_int", + cst_Random_int = "Random.int", + cst_x = "x", + _c_ = + [0, + 987910699, + 495797812, + 364182224, + 414272206, + 318284740, + 990407751, + 383018966, + 270373319, + 840823159, + 24560019, + 536292337, + 512266505, + 189156120, + 730249596, + 143776328, + 51606627, + 140166561, + 366354223, + 1003410265, + 700563762, + 981890670, + 913149062, + 526082594, + 1021425055, + 784300257, + 667753350, + 630144451, + 949649812, + 48546892, + 415514493, + 258888527, + 511570777, + 89983870, + 283659902, + 308386020, + 242688715, + 482270760, + 865188196, + 1027664170, + 207196989, + 193777847, + 619708188, + 671350186, + 149669678, + 257044018, + 87658204, + 558145612, + 183450813, + 28133145, + 901332182, + 710253903, + 510646120, + 652377910, + 409934019, + 801085050]; + function new_state(param){return [0, runtime.caml_make_vect(55, 0), 0];} + function assign(st1, st2){ + caml_call5(Stdlib_Array[10], st2[1], 0, st1[1], 0, 55); + st1[2] = st2[2]; + return 0; + } + function full_init(s, seed){ + var + seed$0 = 0 === seed.length - 1 ? [0, 0] : seed, + l = seed$0.length - 1, + i$0 = 0; + for(;;){ + caml_check_bound(s[1], i$0)[1 + i$0] = i$0; + var _q_ = i$0 + 1 | 0; + if(54 !== i$0){var i$0 = _q_; continue;} + var + accu = [0, cst_x], + _n_ = 54 + caml_call2(Stdlib_Int[11], 55, l) | 0, + _m_ = 0; + if(_n_ >= 0){ + var i = _m_; + for(;;){ + var + j = i % 55 | 0, + k = caml_mod(i, l), + x = caml_check_bound(seed$0, k)[1 + k], + accu$0 = accu[1], + _g_ = caml_call1(Stdlib_Int[12], x), + _h_ = caml_call2(Stdlib[28], accu$0, _g_); + accu[1] = caml_call1(Stdlib_Digest[3], _h_); + var + d = accu[1], + _i_ = caml_string_get(d, 3) << 24, + _j_ = caml_string_get(d, 2) << 16, + _k_ = caml_string_get(d, 1) << 8, + _l_ = ((caml_string_get(d, 0) + _k_ | 0) + _j_ | 0) + _i_ | 0, + _o_ = (caml_check_bound(s[1], j)[1 + j] ^ _l_) & 1073741823; + caml_check_bound(s[1], j)[1 + j] = _o_; + var _p_ = i + 1 | 0; + if(_n_ !== i){var i = _p_; continue;} + break; + } + } + s[2] = 0; + return 0; + } + } + function make(seed){ + var result = new_state(0); + full_init(result, seed); + return result; + } + function make_self_init(param){return make(caml_sys_random_seed(0));} + function copy(s){ + var result = new_state(0); + assign(result, s); + return result; + } + function bits(s){ + s[2] = (s[2] + 1 | 0) % 55 | 0; + var + _d_ = s[2], + curval = caml_check_bound(s[1], _d_)[1 + _d_], + _e_ = (s[2] + 24 | 0) % 55 | 0, + newval = + caml_check_bound(s[1], _e_)[1 + _e_] + + (curval ^ (curval >>> 25 | 0) & 31) + | 0, + newval30 = newval & 1073741823, + _f_ = s[2]; + caml_check_bound(s[1], _f_)[1 + _f_] = newval30; + return newval30; + } + function intaux(s, n){ + for(;;){ + var r = bits(s), v = caml_mod(r, n); + if(((1073741823 - n | 0) + 1 | 0) < (r - v | 0)) continue; + return v; + } + } + function int$0(s, bound){ + if(1073741823 >= bound && 0 < bound) return intaux(s, bound); + return caml_call1(Stdlib[1], cst_Random_int); + } + function full_int(s, bound){ + if(0 >= bound) return caml_call1(Stdlib[1], cst_Random_full_int); + if(1073741823 >= bound) return intaux(s, bound); + for(;;){ + var b1 = bits(s), b2 = bits(s), max_int_32 = 2147483647; + if(bound <= 2147483647) + var + bpos = (b2 & 1073725440) << 1 | b1 >>> 15 | 0, + max_int = max_int_32, + r = bpos; + else + var + b3 = bits(s), + r$0 = ((b3 & 1073741312) << 12 | b2 >>> 9 | 0) << 20 | b1 >>> 10 | 0, + max_int$0 = Stdlib[19], + max_int = max_int$0, + r = r$0; + var v = caml_mod(r, bound); + if(((max_int - bound | 0) + 1 | 0) < (r - v | 0)) continue; + return v; + } + } + function int32(s, bound){ + if(caml_lessequal(bound, 0)) + return caml_call1(Stdlib[1], cst_Random_int32); + for(;;){ + var + b1 = bits(s), + b2 = (bits(s) & 1) << 30, + r = b1 | b2, + v = caml_mod(r, bound); + if(caml_greaterthan(r - v | 0, (Stdlib_Int32[9] - bound | 0) + 1 | 0)) + continue; + return v; + } + } + function int64(s, bound){ + if(caml_lessequal(bound, _b_)) + return caml_call1(Stdlib[1], cst_Random_int64); + for(;;){ + var + b1 = caml_int64_of_int32(bits(s)), + b2 = caml_int64_shift_left(caml_int64_of_int32(bits(s)), 30), + b3 = caml_int64_shift_left(caml_int64_of_int32(bits(s) & 7), 60), + r = caml_int64_or(b1, caml_int64_or(b2, b3)), + v = runtime.caml_int64_mod(r, bound); + if + (caml_greaterthan + (caml_int64_sub(r, v), + runtime.caml_int64_add(caml_int64_sub(Stdlib_Int64[9], bound), _a_))) + continue; + return v; + } + } + var + nativeint = + 32 === Stdlib_Nativeint[9] + ? function(s, bound){return int32(s, bound);} + : function + (s, bound){ + return caml_int64_to_int32(int64(s, caml_int64_of_int32(bound))); + }; + function float$0(s, bound){ + var r1 = bits(s), r2 = bits(s); + return (r1 / 1073741824. + r2) / 1073741824. * bound; + } + function bool(s){return 0 === (bits(s) & 1) ? 1 : 0;} + function bits32(s){ + var b1 = bits(s) >>> 14 | 0, b2 = bits(s) >>> 14 | 0; + return b1 | b2 << 16; + } + function bits64(s){ + var + b1 = caml_int64_shift_right_unsigne(caml_int64_of_int32(bits(s)), 9), + b2 = caml_int64_shift_right_unsigne(caml_int64_of_int32(bits(s)), 9), + b3 = caml_int64_shift_right_unsigne(caml_int64_of_int32(bits(s)), 8); + return caml_int64_or + (b1, + caml_int64_or + (caml_int64_shift_left(b2, 21), caml_int64_shift_left(b3, 42))); + } + var + nativebits = + 32 === Stdlib_Nativeint[9] + ? function(s){return bits32(s);} + : function(s){return caml_int64_to_int32(bits64(s));}, + default$0 = [0, _c_.slice(), 0]; + function bits$0(param){return bits(default$0);} + function int$1(bound){return int$0(default$0, bound);} + function full_int$0(bound){return full_int(default$0, bound);} + function int32$0(bound){return int32(default$0, bound);} + function nativeint$0(bound){return nativeint(default$0, bound);} + function int64$0(bound){return int64(default$0, bound);} + function float$1(scale){return float$0(default$0, scale);} + function bool$0(param){return bool(default$0);} + function bits32$0(param){return bits32(default$0);} + function bits64$0(param){return bits64(default$0);} + function nativebits$0(param){return nativebits(default$0);} + function full_init$0(seed){return full_init(default$0, seed);} + function init(seed){return full_init(default$0, [0, seed]);} + function self_init(param){return full_init$0(caml_sys_random_seed(0));} + function get_state(param){return copy(default$0);} + function set_state(s){return assign(default$0, s);} + var + Stdlib_Random = + [0, + init, + full_init$0, + self_init, + bits$0, + int$1, + full_int$0, + int32$0, + nativeint$0, + int64$0, + float$1, + bool$0, + bits32$0, + bits64$0, + nativebits$0, + [0, + make, + make_self_init, + copy, + bits, + int$0, + full_int, + int32, + nativeint, + int64, + float$0, + bool, + bits32, + bits64, + nativebits], + get_state, + set_state]; + runtime.caml_register_global(18, Stdlib_Random, "Stdlib__Random"); + return; + } + (globalThis)); + +//# 17747 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_check_bound = runtime.caml_check_bound, + caml_compare = runtime.caml_compare, + caml_hash = runtime.caml_hash, + caml_make_vect = runtime.caml_make_vect, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_obj_tag = runtime.caml_obj_tag, + caml_sys_getenv = runtime.caml_sys_getenv, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); + } + var + global_data = runtime.caml_get_global_data(), + cst = "", + Stdlib_Sys = global_data.Stdlib__Sys, + Stdlib = global_data.Stdlib, + CamlinternalLazy = global_data.CamlinternalLazy, + Stdlib_Random = global_data.Stdlib__Random, + Stdlib_Seq = global_data.Stdlib__Seq, + Stdlib_Int = global_data.Stdlib__Int, + Stdlib_Array = global_data.Stdlib__Array; + global_data.Assert_failure; + var + Stdlib_String = global_data.Stdlib__String, + cst_Hashtbl_unsupported_hash_t = "Hashtbl: unsupported hash table format", + _d_ = [0, 0]; + function ongoing_traversal(h){ + var _aE_ = h.length - 1 < 4 ? 1 : 0, _aF_ = _aE_ || (h[4] < 0 ? 1 : 0); + return _aF_; + } + function flip_ongoing_traversal(h){h[4] = - h[4] | 0; return 0;} + try{var _f_ = caml_sys_getenv("OCAMLRUNPARAM"), params = _f_;} + catch(_aC_){ + var _a_ = caml_wrap_exception(_aC_); + if(_a_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_a_, 0); + try{var _e_ = caml_sys_getenv("CAMLRUNPARAM"), _c_ = _e_;} + catch(_aD_){ + var _b_ = caml_wrap_exception(_aD_); + if(_b_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_b_, 0); + var _c_ = cst; + } + var params = _c_; + } + var + randomized_default = caml_call2(Stdlib_String[14], params, 82), + randomized = [0, randomized_default]; + function randomize(param){randomized[1] = 1; return 0;} + function is_randomized(param){return randomized[1];} + var + prng = [246, function(_aB_){return caml_call1(Stdlib_Random[15][2], 0);}]; + function power_2_above(x, n){ + var x$0 = x; + for(;;){ + if(n <= x$0) return x$0; + if(Stdlib_Sys[13] < (x$0 * 2 | 0)) return x$0; + var x$1 = x$0 * 2 | 0, x$0 = x$1; + } + } + function create(opt, initial_size){ + if(opt) var sth = opt[1], random = sth; else var random = randomized[1]; + var s = power_2_above(16, initial_size); + if(random) + var + _az_ = caml_obj_tag(prng), + _aA_ = + 250 === _az_ + ? prng[1] + : 246 === _az_ ? caml_call1(CamlinternalLazy[2], prng) : prng, + seed = caml_call1(Stdlib_Random[15][4], _aA_); + else + var seed = 0; + return [0, 0, caml_make_vect(s, 0), seed, s]; + } + function clear(h){ + var _ay_ = 0 < h[1] ? 1 : 0; + return _ay_ + ? (h + [1] + = 0, + caml_call4(Stdlib_Array[9], h[2], 0, h[2].length - 1, 0)) + : _ay_; + } + function reset(h){ + var len = h[2].length - 1; + if(4 <= h.length - 1 && len !== caml_call1(Stdlib[18], h[4])){ + h[1] = 0; + h[2] = caml_make_vect(caml_call1(Stdlib[18], h[4]), 0); + return 0; + } + return clear(h); + } + function copy_bucketlist(param){ + if(! param) return 0; + var + key = param[1], + data = param[2], + next = param[3], + prec$1 = [0, key, data, next], + prec = prec$1, + param$0 = next; + for(;;){ + if(! param$0) return prec$1; + var + key$0 = param$0[1], + data$0 = param$0[2], + next$0 = param$0[3], + prec$0 = [0, key$0, data$0, next$0]; + prec[3] = prec$0; + var prec = prec$0, param$0 = next$0; + } + } + function copy(h){ + var + _av_ = h[4], + _aw_ = h[3], + _ax_ = caml_call2(Stdlib_Array[15], copy_bucketlist, h[2]); + return [0, h[1], _ax_, _aw_, _av_]; + } + function length(h){return h[1];} + function insert_all_buckets(indexfun, inplace, odata, ndata){ + var + nsize = ndata.length - 1, + ndata_tail = caml_make_vect(nsize, 0), + _ap_ = odata.length - 1 - 1 | 0, + _ao_ = 0; + if(_ap_ >= 0){ + var i$0 = _ao_; + a: + for(;;){ + var cell$1 = caml_check_bound(odata, i$0)[1 + i$0], cell = cell$1; + for(;;){ + if(cell){ + var + key = cell[1], + data = cell[2], + next = cell[3], + cell$0 = inplace ? cell : [0, key, data, 0], + nidx = caml_call1(indexfun, key), + match = caml_check_bound(ndata_tail, nidx)[1 + nidx]; + if(match) + match[3] = cell$0; + else + caml_check_bound(ndata, nidx)[1 + nidx] = cell$0; + caml_check_bound(ndata_tail, nidx)[1 + nidx] = cell$0; + var cell = next; + continue; + } + var _au_ = i$0 + 1 | 0; + if(_ap_ !== i$0){var i$0 = _au_; continue a;} + break; + } + break; + } + } + if(inplace){ + var _ar_ = nsize - 1 | 0, _aq_ = 0; + if(_ar_ >= 0){ + var i = _aq_; + for(;;){ + var match$0 = caml_check_bound(ndata_tail, i)[1 + i]; + if(match$0) match$0[3] = 0; + var _at_ = i + 1 | 0; + if(_ar_ !== i){var i = _at_; continue;} + break; + } + } + var _as_ = 0; + } + else + var _as_ = inplace; + return _as_; + } + function resize(indexfun, h){ + var + odata = h[2], + osize = odata.length - 1, + nsize = osize * 2 | 0, + _an_ = nsize < Stdlib_Sys[13] ? 1 : 0; + if(! _an_) return _an_; + var ndata = caml_make_vect(nsize, 0), inplace = 1 - ongoing_traversal(h); + h[2] = ndata; + return insert_all_buckets(caml_call1(indexfun, h), inplace, odata, ndata); + } + function iter(f, h){ + var old_trav = ongoing_traversal(h); + if(1 - old_trav) flip_ongoing_traversal(h); + try{ + var d = h[2], _aj_ = d.length - 1 - 1 | 0, _ai_ = 0; + if(_aj_ >= 0){ + var i = _ai_; + a: + for(;;){ + var param = caml_check_bound(d, i)[1 + i]; + for(;;){ + if(param){ + var key = param[1], data = param[2], next = param[3]; + caml_call2(f, key, data); + var param = next; + continue; + } + var _am_ = i + 1 | 0; + if(_aj_ !== i){var i = _am_; continue a;} + break; + } + break; + } + } + var _ak_ = 1 - old_trav, _al_ = _ak_ ? flip_ongoing_traversal(h) : _ak_; + return _al_; + } + catch(exn$0){ + var exn = caml_wrap_exception(exn$0); + if(old_trav) throw caml_maybe_attach_backtrace(exn, 0); + flip_ongoing_traversal(h); + throw caml_maybe_attach_backtrace(exn, 0); + } + } + function filter_map_inplace(f, h){ + var d = h[2], old_trav = ongoing_traversal(h); + if(1 - old_trav) flip_ongoing_traversal(h); + try{ + var _ae_ = d.length - 1 - 1 | 0, _ad_ = 0; + if(_ae_ >= 0){ + var i = _ad_; + a: + for(;;){ + var slot$0 = caml_check_bound(h[2], i)[1 + i], prec = 0, slot = slot$0; + for(;;){ + if(slot){ + var + key = slot[1], + data = slot[2], + next = slot[3], + match = caml_call2(f, key, data); + if(! match){h[1] = h[1] - 1 | 0; var slot = next; continue;} + var data$0 = match[1]; + if(prec) + prec[3] = slot; + else + caml_check_bound(h[2], i)[1 + i] = slot; + slot[2] = data$0; + var prec = slot, slot = next; + continue; + } + if(prec) prec[3] = 0; else caml_check_bound(h[2], i)[1 + i] = 0; + var _ah_ = i + 1 | 0; + if(_ae_ !== i){var i = _ah_; continue a;} + break; + } + break; + } + } + var _af_ = 1 - old_trav, _ag_ = _af_ ? flip_ongoing_traversal(h) : _af_; + return _ag_; + } + catch(exn$0){ + var exn = caml_wrap_exception(exn$0); + if(old_trav) throw caml_maybe_attach_backtrace(exn, 0); + flip_ongoing_traversal(h); + throw caml_maybe_attach_backtrace(exn, 0); + } + } + function fold(f, h, init){ + var old_trav = ongoing_traversal(h); + if(1 - old_trav) flip_ongoing_traversal(h); + try{ + var d = h[2], accu$1 = [0, init], _aa_ = d.length - 1 - 1 | 0, _$_ = 0; + if(_aa_ >= 0){ + var i = _$_; + a: + for(;;){ + var + accu$2 = accu$1[1], + b$0 = caml_check_bound(d, i)[1 + i], + b = b$0, + accu = accu$2; + for(;;){ + if(b){ + var + key = b[1], + data = b[2], + next = b[3], + accu$0 = caml_call3(f, key, data, accu), + b = next, + accu = accu$0; + continue; + } + accu$1[1] = accu; + var _ac_ = i + 1 | 0; + if(_aa_ !== i){var i = _ac_; continue a;} + break; + } + break; + } + } + if(1 - old_trav) flip_ongoing_traversal(h); + var _ab_ = accu$1[1]; + return _ab_; + } + catch(exn$0){ + var exn = caml_wrap_exception(exn$0); + if(old_trav) throw caml_maybe_attach_backtrace(exn, 0); + flip_ongoing_traversal(h); + throw caml_maybe_attach_backtrace(exn, 0); + } + } + function bucket_length(accu, param){ + var accu$0 = accu, param$0 = param; + for(;;){ + if(! param$0) return accu$0; + var + next = param$0[3], + accu$1 = accu$0 + 1 | 0, + accu$0 = accu$1, + param$0 = next; + } + } + function stats(h){ + var _V_ = h[2], _W_ = 0; + function _X_(m, b){ + var ___ = bucket_length(0, b); + return caml_call2(Stdlib_Int[11], m, ___); + } + var + mbl = caml_call3(Stdlib_Array[17], _X_, _W_, _V_), + histo = caml_make_vect(mbl + 1 | 0, 0), + _Y_ = h[2]; + function _Z_(b){ + var l = bucket_length(0, b); + histo[1 + l] = caml_check_bound(histo, l)[1 + l] + 1 | 0; + return 0; + } + caml_call2(Stdlib_Array[13], _Z_, _Y_); + return [0, h[1], h[2].length - 1, mbl, histo]; + } + function to_seq(tbl){ + var tbl_data = tbl[2]; + function aux(i, buck, param){ + var i$0 = i, buck$0 = buck; + for(;;){ + if(buck$0){ + var key = buck$0[1], data = buck$0[2], next = buck$0[3]; + return [0, [0, key, data], function(_U_){return aux(i$0, next, _U_);}]; + } + if(i$0 === tbl_data.length - 1) return 0; + var + buck$1 = caml_check_bound(tbl_data, i$0)[1 + i$0], + i$1 = i$0 + 1 | 0, + i$0 = i$1, + buck$0 = buck$1; + } + } + var _R_ = 0, _S_ = 0; + return function(_T_){return aux(_S_, _R_, _T_);}; + } + function to_seq_keys(m){ + var _O_ = to_seq(m); + function _P_(_Q_){return _Q_[1];} + return caml_call2(Stdlib_Seq[27], _P_, _O_); + } + function to_seq_values(m){ + var _L_ = to_seq(m); + function _M_(_N_){return _N_[2];} + return caml_call2(Stdlib_Seq[27], _M_, _L_); + } + function MakeSeeded(H){ + function key_index(h, key){ + var _K_ = h[2].length - 1 - 1 | 0; + return caml_call2(H[2], h[3], key) & _K_; + } + function add(h, key, data){ + var + i = key_index(h, key), + bucket = [0, key, data, caml_check_bound(h[2], i)[1 + i]]; + caml_check_bound(h[2], i)[1 + i] = bucket; + h[1] = h[1] + 1 | 0; + var _J_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + return _J_ ? resize(key_index, h) : _J_; + } + function remove(h, key){ + var + i = key_index(h, key), + c = caml_check_bound(h[2], i)[1 + i], + prec$0 = 0, + prec = c; + for(;;){ + if(! prec) return 0; + var k = prec[1], next = prec[3]; + if(caml_call2(H[1], k, key)){ + h[1] = h[1] - 1 | 0; + return prec$0 + ? (prec$0[3] = next, 0) + : (caml_check_bound(h[2], i)[1 + i] = next, 0); + } + var prec$0 = prec, prec = next; + } + } + function find(h, key){ + var + _I_ = key_index(h, key), + match = caml_check_bound(h[2], _I_)[1 + _I_]; + if(! match) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k1 = match[1], d1 = match[2], next1 = match[3]; + if(caml_call2(H[1], key, k1)) return d1; + if(! next1) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k2 = next1[1], d2 = next1[2], next2 = next1[3]; + if(caml_call2(H[1], key, k2)) return d2; + if(! next2) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k3 = next2[1], d3 = next2[2], next3 = next2[3]; + if(caml_call2(H[1], key, k3)) return d3; + var param = next3; + for(;;){ + if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k = param[1], data = param[2], next = param[3]; + if(caml_call2(H[1], key, k)) return data; + var param = next; + } + } + function find_opt(h, key){ + var + _H_ = key_index(h, key), + match = caml_check_bound(h[2], _H_)[1 + _H_]; + if(! match) return 0; + var k1 = match[1], d1 = match[2], next1 = match[3]; + if(caml_call2(H[1], key, k1)) return [0, d1]; + if(! next1) return 0; + var k2 = next1[1], d2 = next1[2], next2 = next1[3]; + if(caml_call2(H[1], key, k2)) return [0, d2]; + if(! next2) return 0; + var k3 = next2[1], d3 = next2[2], next3 = next2[3]; + if(caml_call2(H[1], key, k3)) return [0, d3]; + var param = next3; + for(;;){ + if(! param) return 0; + var k = param[1], data = param[2], next = param[3]; + if(caml_call2(H[1], key, k)) return [0, data]; + var param = next; + } + } + function find_all(h, key){ + function find_in_bucket(param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var k = param$0[1], d = param$0[2], next = param$0[3]; + if(caml_call2(H[1], k, key)) return [0, d, find_in_bucket(next)]; + var param$0 = next; + } + } + var _G_ = key_index(h, key); + return find_in_bucket(caml_check_bound(h[2], _G_)[1 + _G_]); + } + function replace(h, key, data){ + var + i = key_index(h, key), + l = caml_check_bound(h[2], i)[1 + i], + slot = l; + for(;;){ + if(slot){ + var k = slot[1], next = slot[3]; + if(! caml_call2(H[1], k, key)){var slot = next; continue;} + slot[1] = key; + slot[2] = data; + var _D_ = 0; + } + else + var _D_ = 1; + if(_D_){ + caml_check_bound(h[2], i)[1 + i] = [0, key, data, l]; + h[1] = h[1] + 1 | 0; + var _E_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + if(_E_) return resize(key_index, h); + var _F_ = _E_; + } + else + var _F_ = _D_; + return _F_; + } + } + function mem(h, key){ + var + _C_ = key_index(h, key), + param = caml_check_bound(h[2], _C_)[1 + _C_]; + for(;;){ + if(! param) return 0; + var k = param[1], next = param[3], _B_ = caml_call2(H[1], k, key); + if(_B_) return _B_; + var param = next; + } + } + function add_seq(tbl, i){ + function _A_(param){ + var v = param[2], k = param[1]; + return add(tbl, k, v); + } + return caml_call2(Stdlib_Seq[4], _A_, i); + } + function replace_seq(tbl, i){ + function _z_(param){ + var v = param[2], k = param[1]; + return replace(tbl, k, v); + } + return caml_call2(Stdlib_Seq[4], _z_, i); + } + function of_seq(i){ + var tbl = create(0, 16); + replace_seq(tbl, i); + return tbl; + } + return [0, + create, + clear, + reset, + copy, + add, + remove, + find, + find_opt, + find_all, + replace, + mem, + iter, + filter_map_inplace, + fold, + length, + stats, + to_seq, + to_seq_keys, + to_seq_values, + add_seq, + replace_seq, + of_seq]; + } + function Make(H){ + var equal = H[1]; + function hash(seed, x){return caml_call1(H[2], x);} + var + include = MakeSeeded([0, equal, hash]), + clear = include[2], + reset = include[3], + copy = include[4], + add = include[5], + remove = include[6], + find = include[7], + find_opt = include[8], + find_all = include[9], + replace = include[10], + mem = include[11], + iter = include[12], + filter_map_inplace = include[13], + fold = include[14], + length = include[15], + stats = include[16], + to_seq = include[17], + to_seq_keys = include[18], + to_seq_values = include[19], + add_seq = include[20], + replace_seq = include[21], + _y_ = include[1]; + function create(sz){return caml_call2(_y_, _d_, sz);} + function of_seq(i){ + var tbl = create(16); + caml_call2(replace_seq, tbl, i); + return tbl; + } + return [0, + create, + clear, + reset, + copy, + add, + remove, + find, + find_opt, + find_all, + replace, + mem, + iter, + filter_map_inplace, + fold, + length, + stats, + to_seq, + to_seq_keys, + to_seq_values, + add_seq, + replace_seq, + of_seq]; + } + function hash(x){return caml_hash(10, 100, 0, x);} + function hash_param(n1, n2, x){return caml_hash(n1, n2, 0, x);} + function seeded_hash(seed, x){return caml_hash(10, 100, seed, x);} + function key_index(h, key){ + return 4 <= h.length - 1 + ? caml_hash(10, 100, h[3], key) & (h[2].length - 1 - 1 | 0) + : caml_call1(Stdlib[1], cst_Hashtbl_unsupported_hash_t); + } + function add(h, key, data){ + var + i = key_index(h, key), + bucket = [0, key, data, caml_check_bound(h[2], i)[1 + i]]; + caml_check_bound(h[2], i)[1 + i] = bucket; + h[1] = h[1] + 1 | 0; + var _x_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + return _x_ ? resize(key_index, h) : _x_; + } + function remove(h, key){ + var + i = key_index(h, key), + c = caml_check_bound(h[2], i)[1 + i], + prec$0 = 0, + prec = c; + for(;;){ + if(! prec) return 0; + var k = prec[1], next = prec[3]; + if(0 === caml_compare(k, key)){ + h[1] = h[1] - 1 | 0; + return prec$0 + ? (prec$0[3] = next, 0) + : (caml_check_bound(h[2], i)[1 + i] = next, 0); + } + var prec$0 = prec, prec = next; + } + } + function find(h, key){ + var _w_ = key_index(h, key), match = caml_check_bound(h[2], _w_)[1 + _w_]; + if(! match) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k1 = match[1], d1 = match[2], next1 = match[3]; + if(0 === caml_compare(key, k1)) return d1; + if(! next1) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k2 = next1[1], d2 = next1[2], next2 = next1[3]; + if(0 === caml_compare(key, k2)) return d2; + if(! next2) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k3 = next2[1], d3 = next2[2], next3 = next2[3]; + if(0 === caml_compare(key, k3)) return d3; + var param = next3; + for(;;){ + if(! param) throw caml_maybe_attach_backtrace(Stdlib[8], 1); + var k = param[1], data = param[2], next = param[3]; + if(0 === caml_compare(key, k)) return data; + var param = next; + } + } + function find_opt(h, key){ + var _v_ = key_index(h, key), match = caml_check_bound(h[2], _v_)[1 + _v_]; + if(! match) return 0; + var k1 = match[1], d1 = match[2], next1 = match[3]; + if(0 === caml_compare(key, k1)) return [0, d1]; + if(! next1) return 0; + var k2 = next1[1], d2 = next1[2], next2 = next1[3]; + if(0 === caml_compare(key, k2)) return [0, d2]; + if(! next2) return 0; + var k3 = next2[1], d3 = next2[2], next3 = next2[3]; + if(0 === caml_compare(key, k3)) return [0, d3]; + var param = next3; + for(;;){ + if(! param) return 0; + var k = param[1], data = param[2], next = param[3]; + if(0 === caml_compare(key, k)) return [0, data]; + var param = next; + } + } + function find_all(h, key){ + function find_in_bucket(param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var k = param$0[1], data = param$0[2], next = param$0[3]; + if(0 === caml_compare(k, key)) return [0, data, find_in_bucket(next)]; + var param$0 = next; + } + } + var _u_ = key_index(h, key); + return find_in_bucket(caml_check_bound(h[2], _u_)[1 + _u_]); + } + function replace(h, key, data){ + var i = key_index(h, key), l = caml_check_bound(h[2], i)[1 + i], slot = l; + for(;;){ + if(slot){ + var k = slot[1], next = slot[3]; + if(0 !== caml_compare(k, key)){var slot = next; continue;} + slot[1] = key; + slot[2] = data; + var _r_ = 0; + } + else + var _r_ = 1; + if(_r_){ + caml_check_bound(h[2], i)[1 + i] = [0, key, data, l]; + h[1] = h[1] + 1 | 0; + var _s_ = h[2].length - 1 << 1 < h[1] ? 1 : 0; + if(_s_) return resize(key_index, h); + var _t_ = _s_; + } + else + var _t_ = _r_; + return _t_; + } + } + function mem(h, key){ + var _q_ = key_index(h, key), param = caml_check_bound(h[2], _q_)[1 + _q_]; + for(;;){ + if(! param) return 0; + var + k = param[1], + next = param[3], + _p_ = 0 === caml_compare(k, key) ? 1 : 0; + if(_p_) return _p_; + var param = next; + } + } + function add_seq(tbl, i){ + function _o_(param){ + var v = param[2], k = param[1]; + return add(tbl, k, v); + } + return caml_call2(Stdlib_Seq[4], _o_, i); + } + function replace_seq(tbl, i){ + function _n_(param){ + var v = param[2], k = param[1]; + return replace(tbl, k, v); + } + return caml_call2(Stdlib_Seq[4], _n_, i); + } + function of_seq(i){ + var tbl = create(0, 16); + replace_seq(tbl, i); + return tbl; + } + function rebuild(opt, h){ + if(opt) var sth = opt[1], random = sth; else var random = randomized[1]; + var s = power_2_above(16, h[2].length - 1); + if(random) + var + _g_ = caml_obj_tag(prng), + _h_ = + 250 === _g_ + ? prng[1] + : 246 === _g_ ? caml_call1(CamlinternalLazy[2], prng) : prng, + seed = caml_call1(Stdlib_Random[15][4], _h_); + else + var seed = 4 <= h.length - 1 ? h[3] : 0; + var + _i_ = 4 <= h.length - 1 ? h[4] : s, + h$0 = [0, h[1], caml_make_vect(s, 0), seed, _i_], + _j_ = h$0[2], + _k_ = h[2], + _l_ = 0; + insert_all_buckets + (function(_m_){return key_index(h$0, _m_);}, _l_, _k_, _j_); + return h$0; + } + var + Stdlib_Hashtbl = + [0, + create, + clear, + reset, + copy, + add, + find, + find_opt, + find_all, + mem, + remove, + replace, + iter, + filter_map_inplace, + fold, + length, + randomize, + is_randomized, + rebuild, + stats, + to_seq, + to_seq_keys, + to_seq_values, + add_seq, + replace_seq, + of_seq, + Make, + MakeSeeded, + hash, + seeded_hash, + hash_param, + caml_hash]; + runtime.caml_register_global(15, Stdlib_Hashtbl, "Stdlib__Hashtbl"); + return; + } + (globalThis)); + +//# 19058 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst$17 = "", + cst$18 = ">", + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_string_length = runtime.caml_ml_string_length; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + var + global_data = runtime.caml_get_global_data(), + cst$15 = cst$17, + cst$16 = cst$17, + cst$14 = ".", + cst$11 = cst$18, + cst$12 = "<\/", + cst$13 = cst$17, + cst$8 = cst$18, + cst$9 = "<", + cst$10 = cst$17, + cst$7 = "\n", + cst$3 = cst$17, + cst$4 = cst$17, + cst$5 = cst$17, + cst$6 = cst$17, + cst = cst$17, + cst$0 = cst$17, + cst$1 = cst$17, + cst$2 = cst$17, + Stdlib_Queue = global_data.Stdlib__Queue, + CamlinternalFormat = global_data.CamlinternalFormat, + Stdlib = global_data.Stdlib, + Stdlib_String = global_data.Stdlib__String, + Stdlib_Buffer = global_data.Stdlib__Buffer, + Stdlib_List = global_data.Stdlib__List, + Stdlib_Stack = global_data.Stdlib__Stack, + Stdlib_Int = global_data.Stdlib__Int, + Stdlib_Bytes = global_data.Stdlib__Bytes, + _f_ = [3, 0, 3], + cst_Format_pp_set_geometry = "Format.pp_set_geometry: ", + _e_ = [1, "max_indent < 2"], + _c_ = [1, "margin <= max_indent"], + _d_ = [0, 0], + _b_ = [0, cst$17], + _a_ = [0, cst$17, 0, cst$17], + cst_Stdlib_Format_String_tag = "Stdlib.Format.String_tag"; + function id(x){return x;} + var + String_tag = + [248, cst_Stdlib_Format_String_tag, runtime.caml_fresh_oo_id(0)], + zero = 0, + unknown = -1; + function pp_enqueue(state, token){ + state[13] = state[13] + token[3] | 0; + return caml_call2(Stdlib_Queue[3], token, state[28]); + } + var pp_infinity = 1000000010; + function pp_output_string(state, s){ + return caml_call3(state[17], s, 0, caml_ml_string_length(s)); + } + function pp_output_newline(state){return caml_call1(state[19], 0);} + function format_pp_text(state, size, text){ + state[9] = state[9] - size | 0; + pp_output_string(state, text); + state[11] = 0; + return 0; + } + function format_string(state, s){ + var _bX_ = runtime.caml_string_notequal(s, cst$17); + return _bX_ ? format_pp_text(state, caml_ml_string_length(s), s) : _bX_; + } + function break_new_line(state, param, width){ + var after = param[3], offset = param[2], before = param[1]; + format_string(state, before); + pp_output_newline(state); + state[11] = 1; + var + indent = (state[6] - width | 0) + offset | 0, + real_indent = caml_call2(Stdlib_Int[10], state[8], indent); + state[10] = real_indent; + state[9] = state[6] - state[10] | 0; + var n = state[10]; + caml_call1(state[21], n); + return format_string(state, after); + } + function break_line(state, width){ + return break_new_line(state, _a_, width); + } + function break_same_line(state, param){ + var after = param[3], width = param[2], before = param[1]; + format_string(state, before); + state[9] = state[9] - width | 0; + caml_call1(state[20], width); + return format_string(state, after); + } + function format_pp_token(state, size$0, param){ + if(typeof param === "number") + switch(param){ + case 0: + var match$3 = caml_call1(Stdlib_Stack[7], state[3]); + if(! match$3) return 0; + var + tabs = match$3[1][1], + add_tab = + function(n, ls){ + if(! ls) return [0, n, 0]; + var l = ls[2], x = ls[1]; + return runtime.caml_lessthan(n, x) + ? [0, n, ls] + : [0, x, add_tab(n, l)]; + }; + tabs[1] = add_tab(state[6] - state[9] | 0, tabs[1]); + return 0; + case 1: + caml_call1(Stdlib_Stack[5], state[2]); return 0; + case 2: + caml_call1(Stdlib_Stack[5], state[3]); return 0; + case 3: + var match$4 = caml_call1(Stdlib_Stack[7], state[2]); + if(! match$4) return pp_output_newline(state); + var width$0 = match$4[1][2]; + return break_line(state, width$0); + case 4: + var _bV_ = state[10] !== (state[6] - state[9] | 0) ? 1 : 0; + if(! _bV_) return _bV_; + var match$1 = caml_call1(Stdlib_Queue[6], state[28]); + if(! match$1) return 0; + var match$2 = match$1[1], size = match$2[1], length = match$2[3]; + state[12] = state[12] - length | 0; + state[9] = state[9] + size | 0; + return 0; + default: + var match$5 = caml_call1(Stdlib_Stack[5], state[5]); + if(! match$5) return 0; + var tag_name = match$5[1], marker = caml_call1(state[25], tag_name); + return pp_output_string(state, marker); + } + switch(param[0]){ + case 0: + var s = param[1]; return format_pp_text(state, size$0, s); + case 1: + var + breaks = param[2], + fits = param[1], + off = breaks[2], + before = breaks[1], + match$6 = caml_call1(Stdlib_Stack[7], state[2]); + if(! match$6) return 0; + var + match$7 = match$6[1], + width$1 = match$7[2], + box_type$0 = match$7[1]; + switch(box_type$0){ + case 0: + return break_same_line(state, fits); + case 1: + return break_new_line(state, breaks, width$1); + case 2: + return break_new_line(state, breaks, width$1); + case 3: + return state[9] < (size$0 + caml_ml_string_length(before) | 0) + ? break_new_line(state, breaks, width$1) + : break_same_line(state, fits); + case 4: + return state[11] + ? break_same_line(state, fits) + : state + [9] + < (size$0 + caml_ml_string_length(before) | 0) + ? break_new_line(state, breaks, width$1) + : ((state + [6] + - width$1 + | 0) + + off + | 0) + < state[10] + ? break_new_line(state, breaks, width$1) + : break_same_line(state, fits); + default: return break_same_line(state, fits); + } + case 2: + var + off$0 = param[2], + n = param[1], + insertion_point = state[6] - state[9] | 0, + match$8 = caml_call1(Stdlib_Stack[7], state[3]); + if(! match$8) return 0; + var tabs$0 = match$8[1][1], match$9 = tabs$0[1]; + if(match$9){ + var first = match$9[1], param$0 = tabs$0[1]; + for(;;){ + if(param$0){ + var tail = param$0[2], head = param$0[1]; + if(insertion_point > head){var param$0 = tail; continue;} + var _bW_ = head; + } + else + var _bW_ = first; + var tab = _bW_; + break; + } + } + else + var tab = insertion_point; + var offset = tab - insertion_point | 0; + return 0 <= offset + ? break_same_line(state, [0, cst$0, offset + n | 0, cst]) + : break_new_line + (state, [0, cst$2, tab + off$0 | 0, cst$1], state[6]); + case 3: + var + ty = param[2], + off$1 = param[1], + insertion_point$0 = state[6] - state[9] | 0; + if(state[8] < insertion_point$0){ + var match = caml_call1(Stdlib_Stack[7], state[2]); + if(match){ + var match$0 = match[1], width = match$0[2], box_type = match$0[1]; + if(state[9] < width && 3 >= box_type - 1 >>> 0) + break_line(state, width); + } + else + pp_output_newline(state); + } + var + width$2 = state[9] - off$1 | 0, + box_type$1 = 1 === ty ? 1 : state[9] < size$0 ? ty : 5; + return caml_call2(Stdlib_Stack[3], [0, box_type$1, width$2], state[2]); + case 4: + var tbox = param[1]; + return caml_call2(Stdlib_Stack[3], tbox, state[3]); + default: + var + tag_name$0 = param[1], + marker$0 = caml_call1(state[24], tag_name$0); + pp_output_string(state, marker$0); + return caml_call2(Stdlib_Stack[3], tag_name$0, state[5]); + } + } + function advance_left(state){ + for(;;){ + var match = caml_call1(Stdlib_Queue[9], state[28]); + if(! match) return 0; + var + match$0 = match[1], + size = match$0[1], + length = match$0[3], + token = match$0[2], + pending_count = state[13] - state[12] | 0, + _bT_ = 0 <= size ? 1 : 0, + _bU_ = _bT_ || (state[9] <= pending_count ? 1 : 0); + if(! _bU_) return _bU_; + caml_call1(Stdlib_Queue[5], state[28]); + var size$0 = 0 <= size ? size : pp_infinity; + format_pp_token(state, size$0, token); + state[12] = length + state[12] | 0; + } + } + function enqueue_advance(state, tok){ + pp_enqueue(state, tok); + return advance_left(state); + } + function enqueue_string_as(state, size, s){ + return enqueue_advance(state, [0, size, [0, s], size]); + } + function initialize_scan_stack(stack){ + caml_call1(Stdlib_Stack[8], stack); + var queue_elem = [0, unknown, _b_, 0]; + return caml_call2(Stdlib_Stack[3], [0, -1, queue_elem], stack); + } + function set_size(state, ty){ + var match = caml_call1(Stdlib_Stack[7], state[1]); + if(! match) return 0; + var + match$0 = match[1], + queue_elem = match$0[2], + left_total = match$0[1], + size = queue_elem[1]; + if(left_total < state[12]) return initialize_scan_stack(state[1]); + var _bP_ = queue_elem[2]; + if(typeof _bP_ !== "number") + switch(_bP_[0]){ + case 3: + var + _bR_ = 1 - ty, + _bS_ = + _bR_ + ? (queue_elem + [1] + = state[13] + size | 0, + caml_call1(Stdlib_Stack[5], state[1]), + 0) + : _bR_; + return _bS_; + case 1: + case 2: + var + _bQ_ = + ty + ? (queue_elem + [1] + = state[13] + size | 0, + caml_call1(Stdlib_Stack[5], state[1]), + 0) + : ty; + return _bQ_; + } + return 0; + } + function scan_push(state, b, token){ + pp_enqueue(state, token); + if(b) set_size(state, 1); + var elem = [0, state[13], token]; + return caml_call2(Stdlib_Stack[3], elem, state[1]); + } + function pp_open_box_gen(state, indent, br_ty){ + state[14] = state[14] + 1 | 0; + if(state[14] < state[15]){ + var size = - state[13] | 0, elem = [0, size, [3, indent, br_ty], 0]; + return scan_push(state, 0, elem); + } + var _bO_ = state[14] === state[15] ? 1 : 0; + if(! _bO_) return _bO_; + var s = state[16]; + return enqueue_string_as(state, caml_ml_string_length(s), s); + } + function pp_close_box(state, param){ + var _bM_ = 1 < state[14] ? 1 : 0; + if(_bM_){ + if(state[14] < state[15]){ + pp_enqueue(state, [0, zero, 1, 0]); + set_size(state, 1); + set_size(state, 0); + } + state[14] = state[14] - 1 | 0; + var _bN_ = 0; + } + else + var _bN_ = _bM_; + return _bN_; + } + function pp_open_stag(state, tag_name){ + if(state[22]){ + caml_call2(Stdlib_Stack[3], tag_name, state[4]); + caml_call1(state[26], tag_name); + } + var _bL_ = state[23]; + if(! _bL_) return _bL_; + var token = [5, tag_name]; + return pp_enqueue(state, [0, zero, token, 0]); + } + function pp_close_stag(state, param){ + if(state[23]) pp_enqueue(state, [0, zero, 5, 0]); + var _bJ_ = state[22]; + if(_bJ_){ + var match = caml_call1(Stdlib_Stack[5], state[4]); + if(match){ + var tag_name = match[1]; + return caml_call1(state[27], tag_name); + } + var _bK_ = 0; + } + else + var _bK_ = _bJ_; + return _bK_; + } + function pp_open_tag(state, s){ + return pp_open_stag(state, [0, String_tag, s]); + } + function pp_close_tag(state, param){return pp_close_stag(state, 0);} + function pp_set_print_tags(state, b){state[22] = b; return 0;} + function pp_set_mark_tags(state, b){state[23] = b; return 0;} + function pp_get_print_tags(state, param){return state[22];} + function pp_get_mark_tags(state, param){return state[23];} + function pp_set_tags(state, b){ + pp_set_print_tags(state, b); + return pp_set_mark_tags(state, b); + } + function pp_get_formatter_stag_function(state, param){ + return [0, state[24], state[25], state[26], state[27]]; + } + function pp_set_formatter_stag_function(state, param){ + var pct = param[4], pot = param[3], mct = param[2], mot = param[1]; + state[24] = mot; + state[25] = mct; + state[26] = pot; + state[27] = pct; + return 0; + } + function pp_rinit(state){ + state[12] = 1; + state[13] = 1; + caml_call1(Stdlib_Queue[11], state[28]); + initialize_scan_stack(state[1]); + caml_call1(Stdlib_Stack[8], state[2]); + caml_call1(Stdlib_Stack[8], state[3]); + caml_call1(Stdlib_Stack[8], state[4]); + caml_call1(Stdlib_Stack[8], state[5]); + state[10] = 0; + state[14] = 0; + state[9] = state[6]; + return pp_open_box_gen(state, 0, 3); + } + function pp_flush_queue(state, b){ + var _bH_ = state[4]; + function _bI_(param){return pp_close_tag(state, 0);} + caml_call2(Stdlib_Stack[12], _bI_, _bH_); + for(;;){ + if(1 < state[14]){pp_close_box(state, 0); continue;} + state[13] = pp_infinity; + advance_left(state); + if(b) pp_output_newline(state); + return pp_rinit(state); + } + } + function pp_print_as_size(state, size, s){ + var _bG_ = state[14] < state[15] ? 1 : 0; + return _bG_ ? enqueue_string_as(state, size, s) : _bG_; + } + function pp_print_as(state, isize, s){ + return pp_print_as_size(state, isize, s); + } + function pp_print_string(state, s){ + return pp_print_as(state, caml_ml_string_length(s), s); + } + function pp_print_bytes(state, s){ + return pp_print_as + (state, + runtime.caml_ml_bytes_length(s), + caml_call1(Stdlib_Bytes[6], s)); + } + function pp_print_int(state, i){ + return pp_print_string(state, caml_call1(Stdlib_Int[12], i)); + } + function pp_print_float(state, f){ + return pp_print_string(state, caml_call1(Stdlib[35], f)); + } + function pp_print_bool(state, b){ + return pp_print_string(state, caml_call1(Stdlib[30], b)); + } + function pp_print_char(state, c){ + return pp_print_as(state, 1, caml_call2(Stdlib_String[1], 1, c)); + } + function pp_open_hbox(state, param){return pp_open_box_gen(state, 0, 0);} + function pp_open_vbox(state, indent){ + return pp_open_box_gen(state, indent, 1); + } + function pp_open_hvbox(state, indent){ + return pp_open_box_gen(state, indent, 2); + } + function pp_open_hovbox(state, indent){ + return pp_open_box_gen(state, indent, 3); + } + function pp_open_box(state, indent){ + return pp_open_box_gen(state, indent, 4); + } + function pp_print_newline(state, param){ + pp_flush_queue(state, 1); + return caml_call1(state[18], 0); + } + function pp_print_flush(state, param){ + pp_flush_queue(state, 0); + return caml_call1(state[18], 0); + } + function pp_force_newline(state, param){ + var _bF_ = state[14] < state[15] ? 1 : 0; + return _bF_ ? enqueue_advance(state, [0, zero, 3, 0]) : _bF_; + } + function pp_print_if_newline(state, param){ + var _bE_ = state[14] < state[15] ? 1 : 0; + return _bE_ ? enqueue_advance(state, [0, zero, 4, 0]) : _bE_; + } + function pp_print_custom_break(state, fits, breaks){ + var + after = fits[3], + width = fits[2], + before = fits[1], + _bD_ = state[14] < state[15] ? 1 : 0; + if(! _bD_) return _bD_; + var + size = - state[13] | 0, + token = [1, fits, breaks], + length = + (caml_ml_string_length(before) + width | 0) + + caml_ml_string_length(after) + | 0, + elem = [0, size, token, length]; + return scan_push(state, 1, elem); + } + function pp_print_break(state, width, offset){ + return pp_print_custom_break + (state, [0, cst$6, width, cst$5], [0, cst$4, offset, cst$3]); + } + function pp_print_space(state, param){return pp_print_break(state, 1, 0);} + function pp_print_cut(state, param){return pp_print_break(state, 0, 0);} + function pp_open_tbox(state, param){ + state[14] = state[14] + 1 | 0; + var _bC_ = state[14] < state[15] ? 1 : 0; + if(! _bC_) return _bC_; + var elem = [0, zero, [4, [0, [0, 0]]], 0]; + return enqueue_advance(state, elem); + } + function pp_close_tbox(state, param){ + var _bz_ = 1 < state[14] ? 1 : 0; + if(_bz_){ + var _bA_ = state[14] < state[15] ? 1 : 0; + if(_bA_){ + var elem = [0, zero, 2, 0]; + enqueue_advance(state, elem); + state[14] = state[14] - 1 | 0; + var _bB_ = 0; + } + else + var _bB_ = _bA_; + } + else + var _bB_ = _bz_; + return _bB_; + } + function pp_print_tbreak(state, width, offset){ + var _by_ = state[14] < state[15] ? 1 : 0; + if(! _by_) return _by_; + var size = - state[13] | 0, elem = [0, size, [2, width, offset], width]; + return scan_push(state, 1, elem); + } + function pp_print_tab(state, param){return pp_print_tbreak(state, 0, 0);} + function pp_set_tab(state, param){ + var _bx_ = state[14] < state[15] ? 1 : 0; + if(! _bx_) return _bx_; + var elem = [0, zero, 0, 0]; + return enqueue_advance(state, elem); + } + function pp_set_max_boxes(state, n){ + var _bv_ = 1 < n ? 1 : 0, _bw_ = _bv_ ? (state[15] = n, 0) : _bv_; + return _bw_; + } + function pp_get_max_boxes(state, param){return state[15];} + function pp_over_max_boxes(state, param){return state[14] === state[15] ? 1 : 0; + } + function pp_set_ellipsis_text(state, s){state[16] = s; return 0;} + function pp_get_ellipsis_text(state, param){return state[16];} + function pp_limit(n){return n < 1000000010 ? n : 1000000009;} + function pp_set_max_indent(state, n$0){ + var _bu_ = 1 < n$0 ? 1 : 0; + if(! _bu_) return _bu_; + var n$1 = state[6] - n$0 | 0, _bt_ = 1 <= n$1 ? 1 : 0; + if(! _bt_) return _bt_; + var n = pp_limit(n$1); + state[7] = n; + state[8] = state[6] - state[7] | 0; + return pp_rinit(state); + } + function pp_get_max_indent(state, param){return state[8];} + function pp_set_margin(state, n){ + var _br_ = 1 <= n ? 1 : 0; + if(! _br_) return _br_; + var n$0 = pp_limit(n); + state[6] = n$0; + if(state[8] <= state[6]) + var new_max_indent = state[8]; + else + var + _bs_ = + caml_call2(Stdlib_Int[11], state[6] - state[7] | 0, state[6] / 2 | 0), + new_max_indent = caml_call2(Stdlib_Int[11], _bs_, 1); + return pp_set_max_indent(state, new_max_indent); + } + function validate_geometry(param){ + var margin = param[2], max_indent = param[1]; + return 2 <= max_indent ? margin <= max_indent ? _c_ : _d_ : _e_; + } + function check_geometry(geometry){ + return 0 === validate_geometry(geometry)[0] ? 1 : 0; + } + function pp_get_margin(state, param){return state[6];} + function pp_set_full_geometry(state, param){ + var margin = param[2], max_indent = param[1]; + pp_set_margin(state, margin); + pp_set_max_indent(state, max_indent); + return 0; + } + function pp_set_geometry(state, max_indent, margin){ + var + geometry = [0, max_indent, margin], + match = validate_geometry(geometry); + if(0 === match[0]) return pp_set_full_geometry(state, geometry); + var + msg = match[1], + _bq_ = caml_call2(Stdlib[28], cst_Format_pp_set_geometry, msg); + throw caml_maybe_attach_backtrace([0, Stdlib[6], _bq_], 1); + } + function pp_safe_set_geometry(state, max_indent, margin){ + var geometry = [0, max_indent, margin]; + return 0 === validate_geometry(geometry)[0] + ? pp_set_full_geometry(state, geometry) + : 0; + } + function pp_get_geometry(state, param){return [0, state[8], state[6]];} + function pp_update_geometry(state, update){ + var geometry = pp_get_geometry(state, 0); + return pp_set_full_geometry(state, caml_call1(update, geometry)); + } + function pp_set_formatter_out_functions(state, param){ + var j = param[5], i = param[4], h = param[3], g = param[2], f = param[1]; + state[17] = f; + state[18] = g; + state[19] = h; + state[20] = i; + state[21] = j; + return 0; + } + function pp_get_formatter_out_functions(state, param){ + return [0, state[17], state[18], state[19], state[20], state[21]]; + } + function pp_set_formatter_output_functi(state, f, g){state[17] = f; state[18] = g; return 0; + } + function pp_get_formatter_output_functi(state, param){return [0, state[17], state[18]]; + } + function display_newline(state, param){ + return caml_call3(state[17], cst$7, 0, 1); + } + var blank_line = caml_call2(Stdlib_String[1], 80, 32); + function display_blanks(state, n){ + var n$0 = n; + for(;;){ + var _bp_ = 0 < n$0 ? 1 : 0; + if(! _bp_) return _bp_; + if(80 >= n$0) return caml_call3(state[17], blank_line, 0, n$0); + caml_call3(state[17], blank_line, 0, 80); + var n$1 = n$0 - 80 | 0, n$0 = n$1; + } + } + function pp_set_formatter_out_channel(state, oc){ + state[17] = caml_call1(Stdlib[69], oc); + state[18] = function(param){return caml_call1(Stdlib[63], oc);}; + state[19] = function(_bo_){return display_newline(state, _bo_);}; + state[20] = function(_bn_){return display_blanks(state, _bn_);}; + state[21] = function(_bm_){return display_blanks(state, _bm_);}; + return 0; + } + function default_pp_mark_open_tag(param){ + if(param[1] !== String_tag) return cst$10; + var s = param[2], _bl_ = caml_call2(Stdlib[28], s, cst$8); + return caml_call2(Stdlib[28], cst$9, _bl_); + } + function default_pp_mark_close_tag(param){ + if(param[1] !== String_tag) return cst$13; + var s = param[2], _bk_ = caml_call2(Stdlib[28], s, cst$11); + return caml_call2(Stdlib[28], cst$12, _bk_); + } + function default_pp_print_open_tag(_bj_){return 0;} + function default_pp_print_close_tag(_bi_){return 0;} + function pp_make_formatter(f, g, h, i, j){ + var + pp_queue = caml_call1(Stdlib_Queue[2], 0), + sys_tok = [0, unknown, _f_, 0]; + caml_call2(Stdlib_Queue[3], sys_tok, pp_queue); + var scan_stack = caml_call1(Stdlib_Stack[2], 0); + initialize_scan_stack(scan_stack); + caml_call2(Stdlib_Stack[3], [0, 1, sys_tok], scan_stack); + var + _be_ = Stdlib[19], + _bf_ = caml_call1(Stdlib_Stack[2], 0), + _bg_ = caml_call1(Stdlib_Stack[2], 0), + _bh_ = caml_call1(Stdlib_Stack[2], 0); + return [0, + scan_stack, + caml_call1(Stdlib_Stack[2], 0), + _bh_, + _bg_, + _bf_, + 78, + 10, + 68, + 78, + 0, + 1, + 1, + 1, + 1, + _be_, + cst$14, + f, + g, + h, + i, + j, + 0, + 0, + default_pp_mark_open_tag, + default_pp_mark_close_tag, + default_pp_print_open_tag, + default_pp_print_close_tag, + pp_queue]; + } + function formatter_of_out_functions(out_funs){ + return pp_make_formatter + (out_funs[1], out_funs[2], out_funs[3], out_funs[4], out_funs[5]); + } + function make_formatter(output, flush){ + function _a8_(_bd_){return 0;} + function _a9_(_bc_){return 0;} + var + ppf = + pp_make_formatter(output, flush, function(_bb_){return 0;}, _a9_, _a8_); + ppf[19] = function(_ba_){return display_newline(ppf, _ba_);}; + ppf[20] = function(_a$_){return display_blanks(ppf, _a$_);}; + ppf[21] = function(_a__){return display_blanks(ppf, _a__);}; + return ppf; + } + function formatter_of_out_channel(oc){ + function _a7_(param){return caml_call1(Stdlib[63], oc);} + return make_formatter(caml_call1(Stdlib[69], oc), _a7_); + } + function formatter_of_buffer(b){ + function _a5_(_a6_){return 0;} + return make_formatter(caml_call1(Stdlib_Buffer[18], b), _a5_); + } + var pp_buffer_size = 512; + function pp_make_buffer(param){ + return caml_call1(Stdlib_Buffer[1], pp_buffer_size); + } + var + stdbuf = pp_make_buffer(0), + std_formatter = formatter_of_out_channel(Stdlib[39]), + err_formatter = formatter_of_out_channel(Stdlib[40]), + str_formatter = formatter_of_buffer(stdbuf); + function flush_buffer_formatter(buf, ppf){ + pp_flush_queue(ppf, 0); + var s = caml_call1(Stdlib_Buffer[2], buf); + caml_call1(Stdlib_Buffer[9], buf); + return s; + } + function flush_str_formatter(param){ + return flush_buffer_formatter(stdbuf, str_formatter); + } + function make_symbolic_output_buffer(param){return [0, 0];} + function clear_symbolic_output_buffer(sob){sob[1] = 0; return 0;} + function get_symbolic_output_buffer(sob){ + return caml_call1(Stdlib_List[9], sob[1]); + } + function flush_symbolic_output_buffer(sob){ + var items = get_symbolic_output_buffer(sob); + clear_symbolic_output_buffer(sob); + return items; + } + function add_symbolic_output_item(sob, item){sob[1] = [0, item, sob[1]]; return 0; + } + function formatter_of_symbolic_output_b(sob){ + function f(s, i, n){ + return add_symbolic_output_item + (sob, [0, caml_call3(Stdlib_String[15], s, i, n)]); + } + function g(_a4_){return add_symbolic_output_item(sob, 0);} + function h(_a3_){return add_symbolic_output_item(sob, 1);} + function i(n){return add_symbolic_output_item(sob, [1, n]);} + function j(n){return add_symbolic_output_item(sob, [2, n]);} + return pp_make_formatter(f, g, h, i, j); + } + function open_hbox(_a2_){return pp_open_hbox(std_formatter, _a2_);} + function open_vbox(_a1_){return pp_open_vbox(std_formatter, _a1_);} + function open_hvbox(_a0_){return pp_open_hvbox(std_formatter, _a0_);} + function open_hovbox(_aZ_){return pp_open_hovbox(std_formatter, _aZ_);} + function open_box(_aY_){return pp_open_box(std_formatter, _aY_);} + function close_box(_aX_){return pp_close_box(std_formatter, _aX_);} + function open_tag(_aW_){return pp_open_tag(std_formatter, _aW_);} + function close_tag(_aV_){return pp_close_tag(std_formatter, _aV_);} + function open_stag(_aU_){return pp_open_stag(std_formatter, _aU_);} + function close_stag(_aT_){return pp_close_stag(std_formatter, _aT_);} + function print_as(_aR_, _aS_){ + return pp_print_as(std_formatter, _aR_, _aS_); + } + function print_string(_aQ_){return pp_print_string(std_formatter, _aQ_);} + function print_bytes(_aP_){return pp_print_bytes(std_formatter, _aP_);} + function print_int(_aO_){return pp_print_int(std_formatter, _aO_);} + function print_float(_aN_){return pp_print_float(std_formatter, _aN_);} + function print_char(_aM_){return pp_print_char(std_formatter, _aM_);} + function print_bool(_aL_){return pp_print_bool(std_formatter, _aL_);} + function print_break(_aJ_, _aK_){ + return pp_print_break(std_formatter, _aJ_, _aK_); + } + function print_cut(_aI_){return pp_print_cut(std_formatter, _aI_);} + function print_space(_aH_){return pp_print_space(std_formatter, _aH_);} + function force_newline(_aG_){return pp_force_newline(std_formatter, _aG_);} + function print_flush(_aF_){return pp_print_flush(std_formatter, _aF_);} + function print_newline(_aE_){return pp_print_newline(std_formatter, _aE_);} + function print_if_newline(_aD_){ + return pp_print_if_newline(std_formatter, _aD_); + } + function open_tbox(_aC_){return pp_open_tbox(std_formatter, _aC_);} + function close_tbox(_aB_){return pp_close_tbox(std_formatter, _aB_);} + function print_tbreak(_az_, _aA_){ + return pp_print_tbreak(std_formatter, _az_, _aA_); + } + function set_tab(_ay_){return pp_set_tab(std_formatter, _ay_);} + function print_tab(_ax_){return pp_print_tab(std_formatter, _ax_);} + function set_margin(_aw_){return pp_set_margin(std_formatter, _aw_);} + function get_margin(_av_){return std_formatter[6];} + function set_max_indent(_au_){ + return pp_set_max_indent(std_formatter, _au_); + } + function get_max_indent(_at_){return std_formatter[8];} + function set_geometry(_ar_, _as_){ + return pp_set_geometry(std_formatter, _ar_, _as_); + } + function safe_set_geometry(_ap_, _aq_){ + return pp_safe_set_geometry(std_formatter, _ap_, _aq_); + } + function get_geometry(_ao_){return pp_get_geometry(std_formatter, _ao_);} + function update_geometry(_an_){ + return pp_update_geometry(std_formatter, _an_); + } + function set_max_boxes(_am_){return pp_set_max_boxes(std_formatter, _am_);} + function get_max_boxes(_al_){return std_formatter[15];} + function over_max_boxes(_ak_){ + return pp_over_max_boxes(std_formatter, _ak_); + } + function set_ellipsis_text(_aj_){ + return pp_set_ellipsis_text(std_formatter, _aj_); + } + function get_ellipsis_text(_ai_){return std_formatter[16];} + function set_formatter_out_channel(_ah_){ + return pp_set_formatter_out_channel(std_formatter, _ah_); + } + function set_formatter_out_functions(_ag_){ + return pp_set_formatter_out_functions(std_formatter, _ag_); + } + function get_formatter_out_functions(_af_){ + return pp_get_formatter_out_functions(std_formatter, _af_); + } + function set_formatter_output_functions(_ad_, _ae_){ + return pp_set_formatter_output_functi(std_formatter, _ad_, _ae_); + } + function get_formatter_output_functions(_ac_){ + return pp_get_formatter_output_functi(std_formatter, _ac_); + } + function set_formatter_stag_functions(_ab_){ + return pp_set_formatter_stag_function(std_formatter, _ab_); + } + function get_formatter_stag_functions(_aa_){ + return pp_get_formatter_stag_function(std_formatter, _aa_); + } + function set_print_tags(_$_){return pp_set_print_tags(std_formatter, _$_);} + function get_print_tags(___){return std_formatter[22];} + function set_mark_tags(_Z_){return pp_set_mark_tags(std_formatter, _Z_);} + function get_mark_tags(_Y_){return std_formatter[23];} + function set_tags(_X_){return pp_set_tags(std_formatter, _X_);} + function pp_print_list(opt, pp_v, ppf, param){ + var opt$0 = opt, param$0 = param; + for(;;){ + if(opt$0) + var sth = opt$0[1], pp_sep = sth; + else + var pp_sep = pp_print_cut; + if(! param$0) return 0; + var v = param$0[1]; + if(! param$0[2]) return caml_call2(pp_v, ppf, v); + var vs = param$0[2]; + caml_call2(pp_v, ppf, v); + caml_call2(pp_sep, ppf, 0); + var opt$1 = [0, pp_sep], opt$0 = opt$1, param$0 = vs; + } + } + function pp_print_seq(opt, pp_v, ppf, seq$1){ + if(opt) var sth = opt[1], pp_sep = sth; else var pp_sep = pp_print_cut; + var match$0 = caml_call1(seq$1, 0); + if(! match$0) return 0; + var seq$2 = match$0[2], v$0 = match$0[1]; + caml_call2(pp_v, ppf, v$0); + var seq = seq$2; + for(;;){ + var match = caml_call1(seq, 0); + if(! match) return 0; + var seq$0 = match[2], v = match[1]; + caml_call2(pp_sep, ppf, 0); + caml_call2(pp_v, ppf, v); + var seq = seq$0; + } + } + function pp_print_text(ppf, s){ + var len = caml_ml_string_length(s), left = [0, 0], right = [0, 0]; + function flush(param){ + pp_print_string + (ppf, caml_call3(Stdlib_String[15], s, left[1], right[1] - left[1] | 0)); + right[1]++; + left[1] = right[1]; + return 0; + } + for(;;){ + if(right[1] === len){ + var _W_ = left[1] !== len ? 1 : 0; + return _W_ ? flush(0) : _W_; + } + var match = runtime.caml_string_get(s, right[1]); + if(10 === match){ + flush(0); + pp_force_newline(ppf, 0); + } + else if(32 === match){flush(0); pp_print_space(ppf, 0);} else right[1]++; + } + } + function pp_print_option(opt, pp_v, ppf, param){ + if(opt) + var sth = opt[1], none = sth; + else + var none = function(param, _V_){return 0;}; + if(! param) return caml_call2(none, ppf, 0); + var v = param[1]; + return caml_call2(pp_v, ppf, v); + } + function pp_print_result(ok, error, ppf, param){ + if(0 === param[0]){var v = param[1]; return caml_call2(ok, ppf, v);} + var e = param[1]; + return caml_call2(error, ppf, e); + } + function pp_print_either(left, right, ppf, param){ + if(0 === param[0]){var l = param[1]; return caml_call2(left, ppf, l);} + var r = param[1]; + return caml_call2(right, ppf, r); + } + function compute_tag(output, tag_acc){ + var + buf = caml_call1(Stdlib_Buffer[1], 16), + ppf = formatter_of_buffer(buf); + caml_call2(output, ppf, tag_acc); + pp_print_flush(ppf, 0); + var len = caml_call1(Stdlib_Buffer[7], buf); + return 2 <= len + ? caml_call3(Stdlib_Buffer[4], buf, 1, len - 2 | 0) + : caml_call1(Stdlib_Buffer[2], buf); + } + function output_formatting_lit(ppf, fmting_lit){ + if(typeof fmting_lit === "number") + switch(fmting_lit){ + case 0: + return pp_close_box(ppf, 0); + case 1: + return pp_close_tag(ppf, 0); + case 2: + return pp_print_flush(ppf, 0); + case 3: + return pp_force_newline(ppf, 0); + case 4: + return pp_print_newline(ppf, 0); + case 5: + return pp_print_char(ppf, 64); + default: return pp_print_char(ppf, 37); + } + switch(fmting_lit[0]){ + case 0: + var offset = fmting_lit[3], width = fmting_lit[2]; + return pp_print_break(ppf, width, offset); + case 1: + return 0; + default: + var c = fmting_lit[1]; + pp_print_char(ppf, 64); + return pp_print_char(ppf, c); + } + } + function output_acc(ppf, acc){ + var switch$0 = 0; + if(typeof acc === "number") return 0; + switch(acc[0]){ + case 0: + var f = acc[2], p = acc[1]; + output_acc(ppf, p); + return output_formatting_lit(ppf, f); + case 1: + var match = acc[2], p$0 = acc[1]; + if(0 === match[0]){ + var acc$0 = match[1]; + output_acc(ppf, p$0); + return pp_open_stag + (ppf, [0, String_tag, compute_tag(output_acc, acc$0)]); + } + var acc$1 = match[1]; + output_acc(ppf, p$0); + var + _M_ = compute_tag(output_acc, acc$1), + match$0 = caml_call1(CamlinternalFormat[20], _M_), + bty = match$0[2], + indent = match$0[1]; + return pp_open_box_gen(ppf, indent, bty); + case 2: + var _N_ = acc[1], switch$1 = 0; + if(typeof _N_ === "number" || ! (0 === _N_[0])) + switch$1 = 1; + else{ + var _O_ = _N_[2], switch$2 = 0; + if(typeof _O_ === "number" || ! (1 === _O_[0])) + switch$2 = 1; + else + var s$0 = acc[2], size = _O_[2], p$2 = _N_[1]; + if(switch$2) switch$1 = 1; + } + if(switch$1){var s = acc[2], p$1 = _N_; switch$0 = 2;} + break; + case 3: + var _P_ = acc[1], switch$3 = 0; + if(typeof _P_ === "number" || ! (0 === _P_[0])) + switch$3 = 1; + else{ + var _Q_ = _P_[2], switch$4 = 0; + if(typeof _Q_ === "number" || ! (1 === _Q_[0])) + switch$4 = 1; + else{var c$0 = acc[2], size$0 = _Q_[2], p$4 = _P_[1]; switch$0 = 1;} + if(switch$4) switch$3 = 1; + } + if(switch$3){var c = acc[2], p$3 = _P_; switch$0 = 3;} + break; + case 4: + var _R_ = acc[1], switch$5 = 0; + if(typeof _R_ === "number" || ! (0 === _R_[0])) + switch$5 = 1; + else{ + var _S_ = _R_[2], switch$6 = 0; + if(typeof _S_ === "number" || ! (1 === _S_[0])) + switch$6 = 1; + else + var s$0 = acc[2], size = _S_[2], p$2 = _R_[1]; + if(switch$6) switch$5 = 1; + } + if(switch$5){var s = acc[2], p$1 = _R_; switch$0 = 2;} + break; + case 5: + var _T_ = acc[1], switch$7 = 0; + if(typeof _T_ === "number" || ! (0 === _T_[0])) + switch$7 = 1; + else{ + var _U_ = _T_[2], switch$8 = 0; + if(typeof _U_ === "number" || ! (1 === _U_[0])) + switch$8 = 1; + else{var c$0 = acc[2], size$0 = _U_[2], p$4 = _T_[1]; switch$0 = 1;} + if(switch$8) switch$7 = 1; + } + if(switch$7){var c = acc[2], p$3 = _T_; switch$0 = 3;} + break; + case 6: + var f$0 = acc[2], p$5 = acc[1]; + output_acc(ppf, p$5); + return caml_call1(f$0, ppf); + case 7: + var p$6 = acc[1]; output_acc(ppf, p$6); return pp_print_flush(ppf, 0); + default: + var msg = acc[2], p$7 = acc[1]; + output_acc(ppf, p$7); + return caml_call1(Stdlib[1], msg); + } + switch(switch$0){ + case 0: + output_acc(ppf, p$2); return pp_print_as_size(ppf, size, s$0); + case 1: + output_acc(ppf, p$4); + return pp_print_as_size + (ppf, size$0, caml_call2(Stdlib_String[1], 1, c$0)); + case 2: + output_acc(ppf, p$1); return pp_print_string(ppf, s); + default: output_acc(ppf, p$3); return pp_print_char(ppf, c); + } + } + function strput_acc(ppf, acc){ + var switch$0 = 0; + if(typeof acc === "number") return 0; + switch(acc[0]){ + case 0: + var f = acc[2], p = acc[1]; + strput_acc(ppf, p); + return output_formatting_lit(ppf, f); + case 1: + var match = acc[2], p$0 = acc[1]; + if(0 === match[0]){ + var acc$0 = match[1]; + strput_acc(ppf, p$0); + return pp_open_stag + (ppf, [0, String_tag, compute_tag(strput_acc, acc$0)]); + } + var acc$1 = match[1]; + strput_acc(ppf, p$0); + var + _D_ = compute_tag(strput_acc, acc$1), + match$0 = caml_call1(CamlinternalFormat[20], _D_), + bty = match$0[2], + indent = match$0[1]; + return pp_open_box_gen(ppf, indent, bty); + case 2: + var _E_ = acc[1], switch$1 = 0; + if(typeof _E_ === "number" || ! (0 === _E_[0])) + switch$1 = 1; + else{ + var _F_ = _E_[2], switch$2 = 0; + if(typeof _F_ === "number" || ! (1 === _F_[0])) + switch$2 = 1; + else + var s$0 = acc[2], size = _F_[2], p$2 = _E_[1]; + if(switch$2) switch$1 = 1; + } + if(switch$1){var s = acc[2], p$1 = _E_; switch$0 = 2;} + break; + case 3: + var _G_ = acc[1], switch$3 = 0; + if(typeof _G_ === "number" || ! (0 === _G_[0])) + switch$3 = 1; + else{ + var _H_ = _G_[2], switch$4 = 0; + if(typeof _H_ === "number" || ! (1 === _H_[0])) + switch$4 = 1; + else{var c$0 = acc[2], size$0 = _H_[2], p$4 = _G_[1]; switch$0 = 1;} + if(switch$4) switch$3 = 1; + } + if(switch$3){var c = acc[2], p$3 = _G_; switch$0 = 3;} + break; + case 4: + var _I_ = acc[1], switch$5 = 0; + if(typeof _I_ === "number" || ! (0 === _I_[0])) + switch$5 = 1; + else{ + var _J_ = _I_[2], switch$6 = 0; + if(typeof _J_ === "number" || ! (1 === _J_[0])) + switch$6 = 1; + else + var s$0 = acc[2], size = _J_[2], p$2 = _I_[1]; + if(switch$6) switch$5 = 1; + } + if(switch$5){var s = acc[2], p$1 = _I_; switch$0 = 2;} + break; + case 5: + var _K_ = acc[1], switch$7 = 0; + if(typeof _K_ === "number" || ! (0 === _K_[0])) + switch$7 = 1; + else{ + var _L_ = _K_[2], switch$8 = 0; + if(typeof _L_ === "number" || ! (1 === _L_[0])) + switch$8 = 1; + else{var c$0 = acc[2], size$0 = _L_[2], p$4 = _K_[1]; switch$0 = 1;} + if(switch$8) switch$7 = 1; + } + if(switch$7){var c = acc[2], p$3 = _K_; switch$0 = 3;} + break; + case 6: + var p$5 = acc[1]; + if(typeof p$5 !== "number" && 0 === p$5[0]){ + var match$1 = p$5[2]; + if(typeof match$1 !== "number" && 1 === match$1[0]){ + var f$1 = acc[2], size$1 = match$1[2], p$6 = p$5[1]; + strput_acc(ppf, p$6); + return pp_print_as_size(ppf, size$1, caml_call1(f$1, 0)); + } + } + var f$0 = acc[2]; + strput_acc(ppf, p$5); + return pp_print_string(ppf, caml_call1(f$0, 0)); + case 7: + var p$7 = acc[1]; strput_acc(ppf, p$7); return pp_print_flush(ppf, 0); + default: + var msg = acc[2], p$8 = acc[1]; + strput_acc(ppf, p$8); + return caml_call1(Stdlib[1], msg); + } + switch(switch$0){ + case 0: + strput_acc(ppf, p$2); return pp_print_as_size(ppf, size, s$0); + case 1: + strput_acc(ppf, p$4); + return pp_print_as_size + (ppf, size$0, caml_call2(Stdlib_String[1], 1, c$0)); + case 2: + strput_acc(ppf, p$1); return pp_print_string(ppf, s); + default: strput_acc(ppf, p$3); return pp_print_char(ppf, c); + } + } + function kfprintf(k, ppf, param){ + var fmt = param[1], _B_ = 0; + function _C_(acc){output_acc(ppf, acc); return caml_call1(k, ppf);} + return caml_call3(CamlinternalFormat[7], _C_, _B_, fmt); + } + function ikfprintf(k, ppf, param){ + var fmt = param[1]; + return caml_call3(CamlinternalFormat[8], k, ppf, fmt); + } + function ifprintf(ppf, param){ + var fmt = param[1], _y_ = 0; + function _z_(_A_){return 0;} + return caml_call3(CamlinternalFormat[8], _z_, _y_, fmt); + } + function fprintf(ppf){ + function _v_(_x_){return 0;} + return function(_w_){return kfprintf(_v_, ppf, _w_);}; + } + function printf(fmt){return fprintf(std_formatter)(fmt);} + function eprintf(fmt){return fprintf(err_formatter)(fmt);} + function kdprintf(k, param){ + var fmt = param[1], _t_ = 0; + function _u_(acc){ + return caml_call1(k, function(ppf){return output_acc(ppf, acc);}); + } + return caml_call3(CamlinternalFormat[7], _u_, _t_, fmt); + } + function dprintf(fmt){return kdprintf(function(i){return i;}, fmt);} + function ksprintf(k, param){ + var fmt = param[1], b = pp_make_buffer(0), ppf = formatter_of_buffer(b); + function k$0(acc){ + strput_acc(ppf, acc); + return caml_call1(k, flush_buffer_formatter(b, ppf)); + } + return caml_call3(CamlinternalFormat[7], k$0, 0, fmt); + } + function sprintf(fmt){return ksprintf(id, fmt);} + function kasprintf(k, param){ + var fmt = param[1], b = pp_make_buffer(0), ppf = formatter_of_buffer(b); + function k$0(acc){ + output_acc(ppf, acc); + return caml_call1(k, flush_buffer_formatter(b, ppf)); + } + return caml_call3(CamlinternalFormat[7], k$0, 0, fmt); + } + function asprintf(fmt){return kasprintf(id, fmt);} + function flush_standard_formatters(param){ + pp_print_flush(std_formatter, 0); + return pp_print_flush(err_formatter, 0); + } + caml_call1(Stdlib[100], flush_standard_formatters); + function pp_set_all_formatter_output_fu(state, f, g, h, i){ + pp_set_formatter_output_functi(state, f, g); + state[19] = h; + state[20] = i; + return 0; + } + function pp_get_all_formatter_output_fu(state, param){ + return [0, state[17], state[18], state[19], state[20]]; + } + function set_all_formatter_output_funct(_p_, _q_, _r_, _s_){ + return pp_set_all_formatter_output_fu(std_formatter, _p_, _q_, _r_, _s_); + } + function get_all_formatter_output_funct(_o_){ + return pp_get_all_formatter_output_fu(std_formatter, _o_); + } + function bprintf(b, param){ + var fmt = param[1], ppf = formatter_of_buffer(b); + function k(acc){output_acc(ppf, acc); return pp_flush_queue(ppf, 0);} + return caml_call3(CamlinternalFormat[7], k, 0, fmt); + } + function pp_set_formatter_tag_functions(state, param){ + var pct = param[4], pot = param[3], mct = param[2], mot = param[1]; + function stringify(f, e, param){ + if(param[1] !== String_tag) return e; + var s = param[2]; + return caml_call1(f, s); + } + state[24] = function(_n_){return stringify(mot, cst$15, _n_);}; + state[25] = function(_m_){return stringify(mct, cst$16, _m_);}; + var _i_ = 0; + state[26] = function(_l_){return stringify(pot, _i_, _l_);}; + var _j_ = 0; + state[27] = function(_k_){return stringify(pct, _j_, _k_);}; + return 0; + } + function pp_get_formatter_tag_functions(fmt, param){ + var funs = pp_get_formatter_stag_function(fmt, 0); + function mark_open_tag(s){return caml_call1(funs[1], [0, String_tag, s]);} + function mark_close_tag(s){ + return caml_call1(funs[2], [0, String_tag, s]); + } + function print_open_tag(s){ + return caml_call1(funs[3], [0, String_tag, s]); + } + function print_close_tag(s){ + return caml_call1(funs[4], [0, String_tag, s]); + } + return [0, mark_open_tag, mark_close_tag, print_open_tag, print_close_tag]; + } + function set_formatter_tag_functions(_h_){ + return pp_set_formatter_tag_functions(std_formatter, _h_); + } + function get_formatter_tag_functions(_g_){ + return pp_get_formatter_tag_functions(std_formatter, _g_); + } + var + Stdlib_Format = + [0, + pp_open_box, + open_box, + pp_close_box, + close_box, + pp_open_hbox, + open_hbox, + pp_open_vbox, + open_vbox, + pp_open_hvbox, + open_hvbox, + pp_open_hovbox, + open_hovbox, + pp_print_string, + print_string, + pp_print_bytes, + print_bytes, + pp_print_as, + print_as, + pp_print_int, + print_int, + pp_print_float, + print_float, + pp_print_char, + print_char, + pp_print_bool, + print_bool, + pp_print_space, + print_space, + pp_print_cut, + print_cut, + pp_print_break, + print_break, + pp_print_custom_break, + pp_force_newline, + force_newline, + pp_print_if_newline, + print_if_newline, + pp_print_flush, + print_flush, + pp_print_newline, + print_newline, + pp_set_margin, + set_margin, + pp_get_margin, + get_margin, + pp_set_max_indent, + set_max_indent, + pp_get_max_indent, + get_max_indent, + check_geometry, + pp_set_geometry, + set_geometry, + pp_safe_set_geometry, + safe_set_geometry, + pp_update_geometry, + update_geometry, + pp_get_geometry, + get_geometry, + pp_set_max_boxes, + set_max_boxes, + pp_get_max_boxes, + get_max_boxes, + pp_over_max_boxes, + over_max_boxes, + pp_open_tbox, + open_tbox, + pp_close_tbox, + close_tbox, + pp_set_tab, + set_tab, + pp_print_tab, + print_tab, + pp_print_tbreak, + print_tbreak, + pp_set_ellipsis_text, + set_ellipsis_text, + pp_get_ellipsis_text, + get_ellipsis_text, + String_tag, + pp_open_stag, + open_stag, + pp_close_stag, + close_stag, + pp_set_tags, + set_tags, + pp_set_print_tags, + set_print_tags, + pp_set_mark_tags, + set_mark_tags, + pp_get_print_tags, + get_print_tags, + pp_get_mark_tags, + get_mark_tags, + pp_set_formatter_out_channel, + set_formatter_out_channel, + pp_set_formatter_output_functi, + set_formatter_output_functions, + pp_get_formatter_output_functi, + get_formatter_output_functions, + pp_set_formatter_out_functions, + set_formatter_out_functions, + pp_get_formatter_out_functions, + get_formatter_out_functions, + pp_set_formatter_stag_function, + set_formatter_stag_functions, + pp_get_formatter_stag_function, + get_formatter_stag_functions, + formatter_of_out_channel, + std_formatter, + err_formatter, + formatter_of_buffer, + stdbuf, + str_formatter, + flush_str_formatter, + make_formatter, + formatter_of_out_functions, + make_symbolic_output_buffer, + clear_symbolic_output_buffer, + get_symbolic_output_buffer, + flush_symbolic_output_buffer, + add_symbolic_output_item, + formatter_of_symbolic_output_b, + pp_print_list, + pp_print_seq, + pp_print_text, + pp_print_option, + pp_print_result, + pp_print_either, + fprintf, + printf, + eprintf, + sprintf, + asprintf, + dprintf, + ifprintf, + kfprintf, + kdprintf, + ikfprintf, + ksprintf, + kasprintf, + bprintf, + ksprintf, + set_all_formatter_output_funct, + get_all_formatter_output_funct, + pp_set_all_formatter_output_fu, + pp_get_all_formatter_output_fu, + pp_open_tag, + open_tag, + pp_close_tag, + close_tag, + pp_set_formatter_tag_functions, + set_formatter_tag_functions, + pp_get_formatter_tag_functions, + get_formatter_tag_functions]; + runtime.caml_register_global(36, Stdlib_Format, "Stdlib__Format"); + return; + } + (globalThis)); + +//# 22228 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + caml_register_named_value = runtime.caml_register_named_value, + global_data = runtime.caml_get_global_data(), + Stdlib_Obj = global_data.Stdlib__Obj, + register = caml_register_named_value; + function register_exception(name, exn){ + var + _a_ = Stdlib_Obj[8], + slot = runtime.caml_obj_tag(exn) === _a_ ? exn : exn[1]; + return caml_register_named_value(name, slot); + } + var Stdlib_Callback = [0, register, register_exception]; + runtime.caml_register_global(1, Stdlib_Callback, "Stdlib__Callback"); + return; + } + (globalThis)); + +//# 22251 "../.js/default/stdlib/stdlib.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst_camlinternalOO_ml = "camlinternalOO.ml", + caml_check_bound = runtime.caml_check_bound, + caml_div = runtime.caml_div, + caml_get_public_method = runtime.caml_get_public_method, + caml_make_vect = runtime.caml_make_vect, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_obj_block = runtime.caml_obj_block, + caml_set_oo_id = runtime.caml_set_oo_id, + caml_string_compare = runtime.caml_string_compare, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var + global_data = runtime.caml_get_global_data(), + Assert_failure = global_data.Assert_failure, + Stdlib_Sys = global_data.Stdlib__Sys, + Stdlib_Obj = global_data.Stdlib__Obj, + Stdlib = global_data.Stdlib, + Stdlib_Array = global_data.Stdlib__Array, + Stdlib_List = global_data.Stdlib__List, + Stdlib_Map = global_data.Stdlib__Map, + _g_ = [0, cst_camlinternalOO_ml, 439, 17], + _f_ = [0, cst_camlinternalOO_ml, 421, 13], + _e_ = [0, cst_camlinternalOO_ml, 418, 13], + _d_ = [0, cst_camlinternalOO_ml, 415, 13], + _c_ = [0, cst_camlinternalOO_ml, 412, 13], + _b_ = [0, cst_camlinternalOO_ml, 409, 13], + _a_ = [0, cst_camlinternalOO_ml, 281, 50]; + function copy(o){var o$0 = o.slice(); return caml_set_oo_id(o$0);} + var params = [0, 1, 1, 1, 3, 16], initial_object_size = 2, dummy_item = 0; + function public_method_label(s){ + var + accu = [0, 0], + _aE_ = runtime.caml_ml_string_length(s) - 1 | 0, + _aD_ = 0; + if(_aE_ >= 0){ + var i = _aD_; + for(;;){ + var _aF_ = runtime.caml_string_get(s, i); + accu[1] = (223 * accu[1] | 0) + _aF_ | 0; + var _aG_ = i + 1 | 0; + if(_aE_ !== i){var i = _aG_; continue;} + break; + } + } + accu[1] = accu[1] & 2147483647; + var tag = 1073741823 < accu[1] ? accu[1] + 2147483648 | 0 : accu[1]; + return tag; + } + var + compare = caml_string_compare, + Vars = caml_call1(Stdlib_Map[1], [0, compare]), + compare$0 = caml_string_compare, + Meths = caml_call1(Stdlib_Map[1], [0, compare$0]), + compare$1 = runtime.caml_int_compare, + Labs = caml_call1(Stdlib_Map[1], [0, compare$1]), + dummy_table = [0, 0, [0, dummy_item], Meths[1], Labs[1], 0, 0, Vars[1], 0], + table_count = [0, 0], + dummy_met = caml_obj_block(0, 0); + function fit_size(n){ + return 2 < n ? fit_size((n + 1 | 0) / 2 | 0) * 2 | 0 : n; + } + function new_table(pub_labels){ + table_count[1]++; + var + len = pub_labels.length - 1, + methods = caml_make_vect((len * 2 | 0) + 2 | 0, dummy_met); + caml_check_bound(methods, 0)[1] = len; + var + _aw_ = Stdlib_Sys[9], + _ax_ = (runtime.caml_mul(fit_size(len), _aw_) / 8 | 0) - 1 | 0; + caml_check_bound(methods, 1)[2] = _ax_; + var _az_ = len - 1 | 0, _ay_ = 0; + if(_az_ >= 0){ + var i = _ay_; + for(;;){ + var + _aB_ = (i * 2 | 0) + 3 | 0, + _aA_ = caml_check_bound(pub_labels, i)[1 + i]; + caml_check_bound(methods, _aB_)[1 + _aB_] = _aA_; + var _aC_ = i + 1 | 0; + if(_az_ !== i){var i = _aC_; continue;} + break; + } + } + return [0, + initial_object_size, + methods, + Meths[1], + Labs[1], + 0, + 0, + Vars[1], + 0]; + } + function resize(array, new_size){ + var old_size = array[2].length - 1, _au_ = old_size < new_size ? 1 : 0; + if(_au_){ + var new_buck = caml_make_vect(new_size, dummy_met); + caml_call5(Stdlib_Array[10], array[2], 0, new_buck, 0, old_size); + array[2] = new_buck; + var _av_ = 0; + } + else + var _av_ = _au_; + return _av_; + } + var method_count = [0, 0], inst_var_count = [0, 0]; + function new_method(table){ + var index = table[2].length - 1; + resize(table, index + 1 | 0); + return index; + } + function get_method_label(table, name){ + try{var _as_ = caml_call2(Meths[28], name, table[3]); return _as_;} + catch(_at_){ + var _ar_ = caml_wrap_exception(_at_); + if(_ar_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_ar_, 0); + var label = new_method(table); + table[3] = caml_call3(Meths[4], name, label, table[3]); + table[4] = caml_call3(Labs[4], label, 1, table[4]); + return label; + } + } + function get_method_labels(table, names){ + function _ap_(_aq_){return get_method_label(table, _aq_);} + return caml_call2(Stdlib_Array[15], _ap_, names); + } + function set_method(table, label, element){ + method_count[1]++; + return caml_call2(Labs[28], label, table[4]) + ? (resize + (table, label + 1 | 0), + caml_check_bound(table[2], label)[1 + label] = element, + 0) + : (table[6] = [0, [0, label, element], table[6]], 0); + } + function get_method(table, label){ + try{var _an_ = caml_call2(Stdlib_List[46], label, table[6]); return _an_;} + catch(_ao_){ + var _am_ = caml_wrap_exception(_ao_); + if(_am_ === Stdlib[8]) + return caml_check_bound(table[2], label)[1 + label]; + throw caml_maybe_attach_backtrace(_am_, 0); + } + } + function to_list(arr){ + return 0 === arr ? 0 : caml_call1(Stdlib_Array[11], arr); + } + function narrow(table, vars, virt_meths, concr_meths){ + var + vars$0 = to_list(vars), + virt_meths$0 = to_list(virt_meths), + concr_meths$0 = to_list(concr_meths); + function _X_(_al_){return get_method_label(table, _al_);} + var virt_meth_labs = caml_call2(Stdlib_List[19], _X_, virt_meths$0); + function _Y_(_ak_){return get_method_label(table, _ak_);} + var concr_meth_labs = caml_call2(Stdlib_List[19], _Y_, concr_meths$0); + table[5] = + [0, + [0, table[3], table[4], table[6], table[7], virt_meth_labs, vars$0], + table[5]]; + var _Z_ = Vars[1], ___ = table[7]; + function _$_(lab, info, tvars){ + return caml_call2(Stdlib_List[36], lab, vars$0) + ? caml_call3(Vars[4], lab, info, tvars) + : tvars; + } + table[7] = caml_call3(Vars[13], _$_, ___, _Z_); + var by_name = [0, Meths[1]], by_label = [0, Labs[1]]; + function _aa_(met, label){ + by_name[1] = caml_call3(Meths[4], met, label, by_name[1]); + var _af_ = by_label[1]; + try{var _ai_ = caml_call2(Labs[28], label, table[4]), _ah_ = _ai_;} + catch(_aj_){ + var _ag_ = caml_wrap_exception(_aj_); + if(_ag_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_ag_, 0); + var _ah_ = 1; + } + by_label[1] = caml_call3(Labs[4], label, _ah_, _af_); + return 0; + } + caml_call3(Stdlib_List[27], _aa_, concr_meths$0, concr_meth_labs); + function _ab_(met, label){ + by_name[1] = caml_call3(Meths[4], met, label, by_name[1]); + by_label[1] = caml_call3(Labs[4], label, 0, by_label[1]); + return 0; + } + caml_call3(Stdlib_List[27], _ab_, virt_meths$0, virt_meth_labs); + table[3] = by_name[1]; + table[4] = by_label[1]; + var _ac_ = 0, _ad_ = table[6]; + function _ae_(met, hm){ + var lab = met[1]; + return caml_call2(Stdlib_List[36], lab, virt_meth_labs) + ? hm + : [0, met, hm]; + } + table[6] = caml_call3(Stdlib_List[26], _ae_, _ad_, _ac_); + return 0; + } + function widen(table){ + var + match = caml_call1(Stdlib_List[5], table[5]), + vars = match[6], + virt_meths = match[5], + saved_vars = match[4], + saved_hidden_meths = match[3], + by_label = match[2], + by_name = match[1]; + table[5] = caml_call1(Stdlib_List[6], table[5]); + function _T_(s, v){ + var _W_ = caml_call2(Vars[28], v, table[7]); + return caml_call3(Vars[4], v, _W_, s); + } + table[7] = caml_call3(Stdlib_List[25], _T_, saved_vars, vars); + table[3] = by_name; + table[4] = by_label; + var _U_ = table[6]; + function _V_(met, hm){ + var lab = met[1]; + return caml_call2(Stdlib_List[36], lab, virt_meths) ? hm : [0, met, hm]; + } + table[6] = caml_call3(Stdlib_List[26], _V_, _U_, saved_hidden_meths); + return 0; + } + function new_variable(table, name){ + try{var _R_ = caml_call2(Vars[28], name, table[7]); return _R_;} + catch(_S_){ + var _Q_ = caml_wrap_exception(_S_); + if(_Q_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_Q_, 0); + var index = table[1]; + table[1] = index + 1 | 0; + if(runtime.caml_string_notequal(name, "")) + table[7] = caml_call3(Vars[4], name, index, table[7]); + return index; + } + } + function to_array(arr){return runtime.caml_equal(arr, 0) ? [0] : arr;} + function new_methods_variables(table, meths, vals){ + var + meths$0 = to_array(meths), + nmeths = meths$0.length - 1, + nvals = vals.length - 1, + res = caml_make_vect(nmeths + nvals | 0, 0), + _I_ = nmeths - 1 | 0, + _H_ = 0; + if(_I_ >= 0){ + var i$0 = _H_; + for(;;){ + var + _O_ = get_method_label(table, caml_check_bound(meths$0, i$0)[1 + i$0]); + caml_check_bound(res, i$0)[1 + i$0] = _O_; + var _P_ = i$0 + 1 | 0; + if(_I_ !== i$0){var i$0 = _P_; continue;} + break; + } + } + var _K_ = nvals - 1 | 0, _J_ = 0; + if(_K_ >= 0){ + var i = _J_; + for(;;){ + var + _M_ = i + nmeths | 0, + _L_ = new_variable(table, caml_check_bound(vals, i)[1 + i]); + caml_check_bound(res, _M_)[1 + _M_] = _L_; + var _N_ = i + 1 | 0; + if(_K_ !== i){var i = _N_; continue;} + break; + } + } + return res; + } + function get_variable(table, name){ + try{var _F_ = caml_call2(Vars[28], name, table[7]); return _F_;} + catch(_G_){ + var _E_ = caml_wrap_exception(_G_); + if(_E_ === Stdlib[8]) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + throw caml_maybe_attach_backtrace(_E_, 0); + } + } + function get_variables(table, names){ + function _C_(_D_){return get_variable(table, _D_);} + return caml_call2(Stdlib_Array[15], _C_, names); + } + function add_initializer(table, f){table[8] = [0, f, table[8]]; return 0;} + function create_table(public_methods){ + if(0 === public_methods) return new_table([0]); + var + tags = caml_call2(Stdlib_Array[15], public_method_label, public_methods), + table = new_table(tags); + function _B_(i, met){ + var lab = (i * 2 | 0) + 2 | 0; + table[3] = caml_call3(Meths[4], met, lab, table[3]); + table[4] = caml_call3(Labs[4], lab, 1, table[4]); + return 0; + } + caml_call2(Stdlib_Array[14], _B_, public_methods); + return table; + } + function init_class(table){ + inst_var_count[1] = (inst_var_count[1] + table[1] | 0) - 1 | 0; + table[8] = caml_call1(Stdlib_List[9], table[8]); + var _A_ = Stdlib_Sys[9]; + return resize + (table, + 3 + caml_div(caml_check_bound(table[2], 1)[2] * 16 | 0, _A_) | 0); + } + function inherits(cla, vals, virt_meths, concr_meths, param, top){ + var env = param[4], super$0 = param[2]; + narrow(cla, vals, virt_meths, concr_meths); + var init = top ? caml_call2(super$0, cla, env) : caml_call1(super$0, cla); + widen(cla); + var _s_ = 0, _t_ = to_array(concr_meths); + function _u_(nm){return get_method(cla, get_method_label(cla, nm));} + var + _v_ = [0, caml_call2(Stdlib_Array[15], _u_, _t_), _s_], + _w_ = to_array(vals); + function _x_(_z_){return get_variable(cla, _z_);} + var + _y_ = [0, [0, init], [0, caml_call2(Stdlib_Array[15], _x_, _w_), _v_]]; + return caml_call1(Stdlib_Array[6], _y_); + } + function make_class(pub_meths, class_init){ + var + table = create_table(pub_meths), + env_init = caml_call1(class_init, table); + init_class(table); + return [0, caml_call1(env_init, 0), class_init, env_init, 0]; + } + function make_class_store(pub_meths, class_init, init_table){ + var + table = create_table(pub_meths), + env_init = caml_call1(class_init, table); + init_class(table); + init_table[2] = class_init; + init_table[1] = env_init; + return 0; + } + function dummy_class(loc){ + function undef(param){ + throw caml_maybe_attach_backtrace([0, Stdlib[15], loc], 1); + } + return [0, undef, undef, undef, 0]; + } + function create_object(table){ + var obj = caml_obj_block(Stdlib_Obj[8], table[1]); + obj[1] = table[2]; + return caml_set_oo_id(obj); + } + function create_object_opt(obj_0, table){ + if(obj_0) return obj_0; + var obj = caml_obj_block(Stdlib_Obj[8], table[1]); + obj[1] = table[2]; + return caml_set_oo_id(obj); + } + function iter_f(obj, param){ + var param$0 = param; + for(;;){ + if(! param$0) return 0; + var l = param$0[2], f = param$0[1]; + caml_call1(f, obj); + var param$0 = l; + } + } + function run_initializers(obj, table){ + var inits = table[8], _r_ = 0 !== inits ? 1 : 0; + return _r_ ? iter_f(obj, inits) : _r_; + } + function run_initializers_opt(obj_0, obj, table){ + if(obj_0) return obj; + var inits = table[8]; + if(0 !== inits) iter_f(obj, inits); + return obj; + } + function create_object_and_run_initiali(obj_0, table){ + if(obj_0) return obj_0; + var obj = create_object(table); + run_initializers(obj, table); + return obj; + } + function get_data(param){ + if(param) return param[2]; + throw caml_maybe_attach_backtrace([0, Assert_failure, _e_], 1); + } + function build_path(n, keys, tables){ + var res = [0, 0, 0, 0], r = [0, res], _o_ = 0; + if(n >= 0){ + var i = _o_; + for(;;){ + var _p_ = r[1]; + r[1] = [0, caml_check_bound(keys, i)[1 + i], _p_, 0]; + var _q_ = i + 1 | 0; + if(n !== i){var i = _q_; continue;} + break; + } + } + var v = r[1]; + if(! tables) + throw caml_maybe_attach_backtrace([0, Assert_failure, _b_], 1); + tables[2] = v; + return res; + } + function lookup_tables(root, keys){ + var root_data = get_data(root); + if(! root_data) return build_path(keys.length - 1 - 1 | 0, keys, root); + var i$1 = keys.length - 1 - 1 | 0, i = i$1, tables$0 = root_data; + a: + for(;;){ + if(0 > i) return tables$0; + var key = caml_check_bound(keys, i)[1 + i], tables$1 = tables$0; + for(;;){ + if(! tables$1) + throw caml_maybe_attach_backtrace([0, Assert_failure, _d_], 1); + if(tables$1[1] === key){ + var tables_data = get_data(tables$1); + if(! tables_data) + throw caml_maybe_attach_backtrace([0, Assert_failure, _g_], 1); + var i$0 = i - 1 | 0, i = i$0, tables$0 = tables_data; + continue a; + } + if(! tables$1) + throw caml_maybe_attach_backtrace([0, Assert_failure, _f_], 1); + var tables = tables$1[3]; + if(tables){var tables$1 = tables; continue;} + var next = [0, key, 0, 0]; + if(! tables$1) + throw caml_maybe_attach_backtrace([0, Assert_failure, _c_], 1); + tables$1[3] = next; + return build_path(i - 1 | 0, keys, next); + } + } + } + function new_cache(table){ + var n = new_method(table), switch$0 = 0; + if(0 !== (n % 2 | 0)){ + var _n_ = Stdlib_Sys[9]; + if + ((2 + caml_div(caml_check_bound(table[2], 1)[2] * 16 | 0, _n_) | 0) >= n){var n$0 = new_method(table); switch$0 = 1;} + } + if(! switch$0) var n$0 = n; + caml_check_bound(table[2], n$0)[1 + n$0] = 0; + return n$0; + } + function set_methods(table, methods){ + var len = methods.length - 1, i = [0, 0]; + for(;;){ + if(i[1] >= len) return 0; + var + _h_ = i[1], + label = caml_check_bound(methods, _h_)[1 + _h_], + next = + function(param){ + i[1]++; + var _m_ = i[1]; + return caml_check_bound(methods, _m_)[1 + _m_]; + }, + clo = next(0); + if(typeof clo === "number") + switch(clo){ + case 0: + var + x = next(0), + clo$0 = function(x){return function(obj){return x;};}(x); + break; + case 1: + var + n = next(0), + clo$0 = function(n){return function(obj){return obj[1 + n];};}(n); + break; + case 2: + var + e = next(0), + n$0 = next(0), + clo$0 = + function(e, n){return function(obj){return obj[1 + e][1 + n];};} + (e, n$0); + break; + case 3: + var + n$1 = next(0), + clo$0 = + function(n){ + return function(obj){return caml_call1(obj[1][1 + n], obj);}; + } + (n$1); + break; + case 4: + var + n$2 = next(0), + clo$0 = + function(n){return function(obj, x){obj[1 + n] = x; return 0;};} + (n$2); + break; + case 5: + var + f = next(0), + x$0 = next(0), + clo$0 = + function(f, x){return function(obj){return caml_call1(f, x);};} + (f, x$0); + break; + case 6: + var + f$0 = next(0), + n$3 = next(0), + clo$0 = + function(f, n){ + return function(obj){return caml_call1(f, obj[1 + n]);}; + } + (f$0, n$3); + break; + case 7: + var + f$1 = next(0), + e$0 = next(0), + n$4 = next(0), + clo$0 = + function(f, e, n){ + return function(obj){return caml_call1(f, obj[1 + e][1 + n]);}; + } + (f$1, e$0, n$4); + break; + case 8: + var + f$2 = next(0), + n$5 = next(0), + clo$0 = + function(f, n){ + return function(obj){ + return caml_call1(f, caml_call1(obj[1][1 + n], obj));}; + } + (f$2, n$5); + break; + case 9: + var + f$3 = next(0), + x$1 = next(0), + y = next(0), + clo$0 = + function(f, x, y){ + return function(obj){return caml_call2(f, x, y);}; + } + (f$3, x$1, y); + break; + case 10: + var + f$4 = next(0), + x$2 = next(0), + n$6 = next(0), + clo$0 = + function(f, x, n){ + return function(obj){return caml_call2(f, x, obj[1 + n]);}; + } + (f$4, x$2, n$6); + break; + case 11: + var + f$5 = next(0), + x$3 = next(0), + e$1 = next(0), + n$7 = next(0), + clo$0 = + function(f, x, e, n){ + return function(obj){ + return caml_call2(f, x, obj[1 + e][1 + n]);}; + } + (f$5, x$3, e$1, n$7); + break; + case 12: + var + f$6 = next(0), + x$4 = next(0), + n$8 = next(0), + clo$0 = + function(f, x, n){ + return function(obj){ + return caml_call2(f, x, caml_call1(obj[1][1 + n], obj));}; + } + (f$6, x$4, n$8); + break; + case 13: + var + f$7 = next(0), + n$9 = next(0), + x$5 = next(0), + clo$0 = + function(f, n, x){ + return function(obj){return caml_call2(f, obj[1 + n], x);}; + } + (f$7, n$9, x$5); + break; + case 14: + var + f$8 = next(0), + e$2 = next(0), + n$10 = next(0), + x$6 = next(0), + clo$0 = + function(f, e, n, x){ + return function(obj){ + return caml_call2(f, obj[1 + e][1 + n], x);}; + } + (f$8, e$2, n$10, x$6); + break; + case 15: + var + f$9 = next(0), + n$11 = next(0), + x$7 = next(0), + clo$0 = + function(f, n, x){ + return function(obj){ + return caml_call2(f, caml_call1(obj[1][1 + n], obj), x);}; + } + (f$9, n$11, x$7); + break; + case 16: + var + n$12 = next(0), + x$8 = next(0), + clo$0 = + function(n, x){ + return function(obj){return caml_call2(obj[1][1 + n], obj, x);}; + } + (n$12, x$8); + break; + case 17: + var + n$13 = next(0), + m = next(0), + clo$0 = + function(n, m){ + return function(obj){ + return caml_call2(obj[1][1 + n], obj, obj[1 + m]);}; + } + (n$13, m); + break; + case 18: + var + n$14 = next(0), + e$3 = next(0), + m$0 = next(0), + clo$0 = + function(n, e, m){ + return function(obj){ + return caml_call2(obj[1][1 + n], obj, obj[1 + e][1 + m]);}; + } + (n$14, e$3, m$0); + break; + case 19: + var + n$15 = next(0), + m$1 = next(0), + clo$0 = + function(n, m){ + return function(obj){ + var _k_ = caml_call1(obj[1][1 + m], obj); + return caml_call2(obj[1][1 + n], obj, _k_);}; + } + (n$15, m$1); + break; + case 20: + var m$2 = next(0), x$9 = next(0); + new_cache(table); + var + clo$0 = + function(m, x){ + return function(obj){ + return caml_call1(caml_get_public_method(x, m, 0), x);}; + } + (m$2, x$9); + break; + case 21: + var m$3 = next(0), n$16 = next(0); + new_cache(table); + var + clo$0 = + function(m, n){ + return function(obj){ + var _j_ = obj[1 + n]; + return caml_call1(caml_get_public_method(_j_, m, 0), _j_);}; + } + (m$3, n$16); + break; + case 22: + var m$4 = next(0), e$4 = next(0), n$17 = next(0); + new_cache(table); + var + clo$0 = + function(m, e, n){ + return function(obj){ + var _i_ = obj[1 + e][1 + n]; + return caml_call1(caml_get_public_method(_i_, m, 0), _i_);}; + } + (m$4, e$4, n$17); + break; + default: + var m$5 = next(0), n$18 = next(0); + new_cache(table); + var + clo$0 = + function(m, n){ + return function(obj){ + var _l_ = caml_call1(obj[1][1 + n], obj); + return caml_call1(caml_get_public_method(_l_, m, 0), _l_);}; + } + (m$5, n$18); + } + else + var clo$0 = clo; + set_method(table, label, clo$0); + i[1]++; + } + } + function stats(param){ + return [0, table_count[1], method_count[1], inst_var_count[1]]; + } + var + CamlinternalOO = + [0, + public_method_label, + new_method, + new_variable, + new_methods_variables, + get_variable, + get_variables, + get_method_label, + get_method_labels, + get_method, + set_method, + set_methods, + narrow, + widen, + add_initializer, + dummy_table, + create_table, + init_class, + inherits, + make_class, + make_class_store, + dummy_class, + copy, + create_object, + create_object_opt, + run_initializers, + run_initializers_opt, + create_object_and_run_initiali, + lookup_tables, + params, + stats]; + runtime.caml_register_global(17, CamlinternalOO, "CamlinternalOO"); + return; + } + (globalThis)); + + +//# 1 "../.js/default/xmlm/xmlm.cma.js" +// Generated by js_of_ocaml +//# 3 "../.js/default/xmlm/xmlm.cma.js" + +//# 6 "../.js/default/xmlm/xmlm.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst$25 = "", + cst$31 = '"', + cst$29 = ")", + cst_D$1 = "", + cst$28 = ">", + cst$30 = "?>", + cst$26 = "@ ", + cst$27 = "@,", + cst_None = "None", + cst_El_end = "`El_end", + cst_src_xmlm_ml = "src/xmlm.ml", + caml_compare = runtime.caml_compare, + caml_fresh_oo_id = runtime.caml_fresh_oo_id, + caml_maybe_attach_backtrace = runtime.caml_maybe_attach_backtrace, + caml_ml_string_length = runtime.caml_ml_string_length, + caml_string_get = runtime.caml_string_get, + caml_wrap_exception = runtime.caml_wrap_exception; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + function caml_call4(f, a0, a1, a2, a3){ + return (f.l >= 0 ? f.l : f.l = f.length) == 4 + ? f(a0, a1, a2, a3) + : runtime.caml_call_gen(f, [a0, a1, a2, a3]); + } + function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + function caml_call6(f, a0, a1, a2, a3, a4, a5){ + return (f.l >= 0 ? f.l : f.l = f.length) == 6 + ? f(a0, a1, a2, a3, a4, a5) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4, a5]); + } + var + global_data = runtime.caml_get_global_data(), + partial = [12, 41, [17, 0, 0]], + cst$21 = "/>", + cst$22 = "<\/", + cst$23 = cst$28, + cst$24 = cst$28, + cst$20 = '="', + cst$19 = "\xef\xbf\xbd", + cst$18 = cst$25, + cst$17 = cst$29, + context = [0, 0, 0], + cst$15 = cst$30, + cst$16 = cst$30, + cst$14 = "]]>", + cst$13 = "(Some@ %S)@]"], + _n_ = [0, [11, cst_None, 0], cst_None], + _k_ = [0, [12, 59, [17, [0, cst$26, 1, 0], 0]], ";@ "], + _l_ = + [0, + [18, + [1, [0, [11, cst_1, 0], cst_1]], + [12, + 40, + [15, + [12, + 44, + [17, + [0, cst$27, 0, 0], + [18, + [1, [0, [11, cst_1, 0], cst_1]], + [12, 91, [15, [12, 93, [17, 0, partial]]]]]]]]]], + "@[<1>(%a,@,@[<1>[%a]@])@]"], + _j_ = + [0, + [18, + [1, [0, [11, cst_1, 0], cst_1]], + [12, + 40, + [15, [12, 44, [17, [0, cst$27, 0, 0], [3, 0, [12, 41, [17, 0, 0]]]]]]]], + "@[<1>(%a,@,%S)@]"], + _h_ = [0, [2, 0, [12, 58, [2, 0, 0]]], "%s:%s"], + _i_ = [0, [2, 0, 0], "%s"], + _g_ = [0, cst_src_xmlm_ml, 1110, 12], + cst_xml_version_1_0_encoding_U = + '\n', + cst_lt$0 = "<", + cst_gt$0 = ">", + cst_quot$0 = """, + cst_amp$0 = "&", + cst_unbound_namespace = "unbound namespace (", + _e_ = [0, cst_src_xmlm_ml, 916, 17], + _f_ = [0, cst_src_xmlm_ml, 923, 18], + cst_D$0 = cst_D$1, + _d_ = [0, cst_src_xmlm_ml, 848, 45], + _c_ = [0, cst_src_xmlm_ml, 822, 9], + cst_D = cst_D$1, + _b_ = [0, 3407540, 0], + cst_maximal_buffer_size_exceed = "maximal buffer size exceeded", + cst_unexpected_end_of_input = "unexpected end of input", + cst_malformed_character_stream = "malformed character stream", + cst_expected_root_element = "expected root element", + cst_character_sequence_illegal = 'character sequence illegal here ("', + cst_illegal_character_referenc = "illegal character reference (#", + cst_unknown_encoding = "unknown encoding (", + cst_unknown_namespace_prefix = "unknown namespace prefix (", + cst_found = 'found "', + cst_expected_one_of_these_char = + "expected one of these character sequence: ", + cst_unknown_entity_reference = "unknown entity reference (", + cst_CDATA = "CDATA[", + cst_http_www_w3_org_XML_1998_n = "http://www.w3.org/XML/1998/namespace", + cst_http_www_w3_org_2000_xmlns = "http://www.w3.org/2000/xmlns/", + cst_xml = "xml", + cst_xmlns = "xmlns", + cst_space = "space", + cst_version = "version", + cst_encoding = "encoding", + cst_standalone = "standalone", + cst_yes = "yes", + cst_no = "no", + cst_preserve = "preserve", + cst_default = "default", + cst_1_0 = "1.0", + cst_1_1 = "1.1", + cst_utf_8 = "utf-8", + cst_utf_16 = "utf-16", + cst_utf_16be = "utf-16be", + cst_utf_16le = "utf-16le", + cst_iso_8859_1 = "iso-8859-1", + cst_us_ascii = "us-ascii", + cst_ascii = "ascii", + cst_Xmlm_Make_String_Buffer_Er = "Xmlm.Make(String)(Buffer).Error", + cst_lt = "lt", + cst_gt = "gt", + cst_amp = "amp", + cst_apos = "apos", + cst_quot = "quot", + _a_ = [0, cst_src_xmlm_ml, 150, 9], + cst_Xmlm_Buffer_Full = "Xmlm.Buffer.Full"; + function uchar_utf8(i){ + var + b0 = caml_call1(i, 0), + match = runtime.caml_check_bound(utf8_len, b0)[1 + b0]; + if(4 < match >>> 0) + throw caml_maybe_attach_backtrace([0, Assert_failure, _a_], 1); + switch(match){ + case 0: + throw caml_maybe_attach_backtrace(Malformed, 1); + case 1: + return b0; + case 2: + var b1 = caml_call1(i, 0); + if(2 === (b1 >>> 6 | 0)) return (b0 & 31) << 6 | b1 & 63; + throw caml_maybe_attach_backtrace(Malformed, 1); + case 3: + var b1$0 = caml_call1(i, 0), b2 = caml_call1(i, 0); + if(2 !== (b2 >>> 6 | 0)) + throw caml_maybe_attach_backtrace(Malformed, 1); + if(224 === b0){ + var switch$0 = 0; + if(160 > b1$0 || 191 < b1$0) switch$0 = 1; + if(switch$0) throw caml_maybe_attach_backtrace(Malformed, 1); + } + else if(237 === b0){ + var switch$1 = 0; + if(128 <= b1$0 && 159 >= b1$0) switch$1 = 1; + if(! switch$1) throw caml_maybe_attach_backtrace(Malformed, 1); + } + else if(2 !== (b1$0 >>> 6 | 0)) + throw caml_maybe_attach_backtrace(Malformed, 1); + return (b0 & 15) << 12 | (b1$0 & 63) << 6 | b2 & 63; + default: + var + b1$1 = caml_call1(i, 0), + b2$0 = caml_call1(i, 0), + b3 = caml_call1(i, 0); + if(2 === (b3 >>> 6 | 0) && 2 === (b2$0 >>> 6 | 0)){ + if(240 === b0){ + var switch$2 = 0; + if(144 > b1$1 || 191 < b1$1) switch$2 = 1; + if(switch$2) throw caml_maybe_attach_backtrace(Malformed, 1); + } + else if(244 === b0){ + var switch$3 = 0; + if(128 <= b1$1 && 143 >= b1$1) switch$3 = 1; + if(! switch$3) throw caml_maybe_attach_backtrace(Malformed, 1); + } + else if(2 !== (b1$1 >>> 6 | 0)) + throw caml_maybe_attach_backtrace(Malformed, 1); + return (b0 & 7) << 18 | (b1$1 & 63) << 12 | (b2$0 & 63) << 6 | b3 & 63; + } + throw caml_maybe_attach_backtrace(Malformed, 1); + } + } + function int16_be(i){ + var b0 = caml_call1(i, 0), b1 = caml_call1(i, 0); + return b0 << 8 | b1; + } + function int16_le(i){ + var b0 = caml_call1(i, 0), b1 = caml_call1(i, 0); + return b1 << 8 | b0; + } + function uchar_utf16(int16, i){ + var c0 = caml_call1(int16, i); + if(55296 <= c0 && 57343 >= c0){ + if(56319 < c0) throw caml_maybe_attach_backtrace(Malformed, 1); + var c1 = caml_call1(int16, i); + return ((c0 & 1023) << 10 | c1 & 1023) + 65536 | 0; + } + return c0; + } + function uchar_utf16be(_bo_){return uchar_utf16(int16_be, _bo_);} + function uchar_utf16le(_bn_){return uchar_utf16(int16_le, _bn_);} + function uchar_byte(i){return caml_call1(i, 0);} + function uchar_iso_8859_1(i){return caml_call1(i, 0);} + function uchar_ascii(i){ + var b = caml_call1(i, 0); + if(127 < b) throw caml_maybe_attach_backtrace(Malformed, 1); + return b; + } + function Make(String, Buffer){ + var str = String[6]; + function str_eq(s$0, s){return 0 === caml_compare(s$0, s) ? 1 : 0;} + function str_empty(s){return 0 === caml_compare(s, String[1]) ? 1 : 0;} + var cat = String[3]; + function str_of_char(u){ + var b = caml_call1(Buffer[2], 4); + caml_call2(Buffer[3], b, u); + return caml_call1(Buffer[5], b); + } + var + hash = Stdlib_Hashtbl[28], + Ht = caml_call1(Stdlib_Hashtbl[26], [0, str_eq, hash]), + s_cdata = caml_call1(str, cst_CDATA), + ns_xml = caml_call1(str, cst_http_www_w3_org_XML_1998_n), + ns_xmlns = caml_call1(str, cst_http_www_w3_org_2000_xmlns), + n_xml = caml_call1(str, cst_xml), + n_xmlns = caml_call1(str, cst_xmlns), + n_space = caml_call1(str, cst_space), + n_version = caml_call1(str, cst_version), + n_encoding = caml_call1(str, cst_encoding), + n_standalone = caml_call1(str, cst_standalone), + v_yes = caml_call1(str, cst_yes), + v_no = caml_call1(str, cst_no), + v_preserve = caml_call1(str, cst_preserve), + v_default = caml_call1(str, cst_default), + v_version_1_0 = caml_call1(str, cst_1_0), + v_version_1_1 = caml_call1(str, cst_1_1), + v_utf_8 = caml_call1(str, cst_utf_8), + v_utf_16 = caml_call1(str, cst_utf_16), + v_utf_16be = caml_call1(str, cst_utf_16be), + v_utf_16le = caml_call1(str, cst_utf_16le), + v_iso_8859_1 = caml_call1(str, cst_iso_8859_1), + v_us_ascii = caml_call1(str, cst_us_ascii), + v_ascii = caml_call1(str, cst_ascii), + u_nl = 10, + u_cr = 13, + u_space = 32, + u_quot = 34, + u_sharp = 35, + u_amp = 38, + u_apos = 39, + u_minus = 45, + u_slash = 47, + u_colon = 58, + u_scolon = 59, + u_lt = 60, + u_eq = 61, + u_gt = 62, + u_qmark = 63, + u_emark = 33, + u_lbrack = 91, + u_rbrack = 93, + u_x = 120, + u_bom = 65279, + u_9 = 57, + u_F = 70, + u_D = 68; + function name_str(param){ + var l = param[2], p = param[1]; + return str_empty(p) + ? l + : caml_call2(cat, p, caml_call2(cat, caml_call1(str, cst), l)); + } + var Error = [248, cst_Xmlm_Make_String_Buffer_Er, caml_fresh_oo_id(0)]; + function error_message(e){ + function bracket(l, v, r){ + var _bm_ = caml_call2(cat, v, caml_call1(str, r)); + return caml_call2(cat, caml_call1(str, l), _bm_); + } + if(typeof e === "number") + return -95440847 <= e + ? 891487781 + <= e + ? caml_call1(str, cst_maximal_buffer_size_exceed) + : caml_call1(str, cst_unexpected_end_of_input) + : -372779099 + <= e + ? caml_call1(str, cst_malformed_character_stream) + : caml_call1(str, cst_expected_root_element); + var _bk_ = e[1]; + if(-108708553 > _bk_){ + if(-261531242 <= _bk_){ + var + match = e[2], + fnd = match[2], + exps = match[1], + exp = + function(acc, v){ + return caml_call2(cat, acc, bracket(cst$5, v, cst$4)); + }, + exps$0 = caml_call3(Stdlib_List[25], exp, String[1], exps), + _bl_ = caml_call2(cat, exps$0, bracket(cst_found, fnd, cst$6)); + return caml_call2 + (cat, caml_call1(str, cst_expected_one_of_these_char), _bl_); + } + var e$2 = e[2]; + return bracket(cst_unknown_entity_reference, e$2, cst$7); + } + if(719894387 <= _bk_){ + if(719944127 <= _bk_){ + var s = e[2]; + return bracket(cst_character_sequence_illegal, s, cst$0); + } + var s$0 = e[2]; + return bracket(cst_illegal_character_referenc, s$0, cst$1); + } + if(-6915192 <= _bk_){ + var e$0 = e[2]; + return bracket(cst_unknown_encoding, e$0, cst$2); + } + var e$1 = e[2]; + return bracket(cst_unknown_namespace_prefix, e$1, cst$3); + } + function err(i, e){ + throw caml_maybe_attach_backtrace([0, Error, [0, i[9], i[10]], e], 1); + } + function err_illegal_char(i, u){ + return err(i, [0, 719944127, str_of_char(u)]); + } + function err_expected_seqs(i, exps, s){ + return err(i, [0, -261531242, [0, exps, s]]); + } + function err_expected_chars(i, exps){ + var _bj_ = str_of_char(i[7]); + return err + (i, + [0, + -261531242, + [0, caml_call2(Stdlib_List[19], str_of_char, exps), _bj_]]); + } + var + u_eoi = Stdlib[19], + u_start_doc = u_eoi - 1 | 0, + u_end_doc = u_start_doc - 1 | 0, + signal_start_stream = [0, 758940234, String[1]]; + function make_input(opt, _bg_, _bf_, _be_, src){ + if(opt) var sth = opt[1], enc = sth; else var enc = 0; + if(_bg_) var sth$0 = _bg_[1], strip = sth$0; else var strip = 0; + if(_bf_) + var sth$1 = _bf_[1], ns = sth$1; + else + var ns = function(param){return 0;}; + if(_be_) + var sth$2 = _be_[1], entity = sth$2; + else + var entity = function(param){return 0;}; + var _bh_ = src[1]; + if(3507231 === _bh_) + var f = src[2], i = f; + else if(438511779 <= _bh_) + var + ic = src[2], + i = function(param){return caml_call1(Stdlib[87], ic);}; + else + var + match = src[2], + s = match[2], + pos = match[1], + len = caml_ml_string_length(s), + pos$0 = [0, pos - 1 | 0], + i = + function(param){ + pos$0[1]++; + if(pos$0[1] === len) + throw caml_maybe_attach_backtrace(Stdlib[12], 1); + return caml_string_get(s, pos$0[1]); + }; + var bindings = caml_call1(Ht[1], 15); + caml_call3(Ht[5], bindings, String[1], String[1]); + caml_call3(Ht[5], bindings, n_xml, ns_xml); + caml_call3(Ht[5], bindings, n_xmlns, ns_xmlns); + var _bi_ = caml_call1(Buffer[2], 1024); + return [0, + enc, + strip, + ns, + entity, + i, + uchar_byte, + u_start_doc, + 0, + 1, + 0, + 3, + signal_start_stream, + strip, + 1, + 0, + bindings, + caml_call1(Buffer[2], 64), + _bi_]; + } + function r(u, a, b){ + var _bc_ = a <= u ? 1 : 0, _bd_ = _bc_ ? u <= b ? 1 : 0 : _bc_; + return _bd_; + } + function is_white(param){ + var _bb_ = param - 9 | 0, switch$0 = 0; + if(4 < _bb_ >>> 0){ + if(23 === _bb_) switch$0 = 1; + } + else if(1 < _bb_ - 2 >>> 0) switch$0 = 1; + return switch$0 ? 1 : 0; + } + function is_char(u){ + if(r(u, 32, 55295)) return 1; + var switch$0 = 0; + if(11 <= u){if(13 === u) switch$0 = 1;} else if(9 <= u) switch$0 = 1; + if(switch$0) return 1; + if(! r(u, 57344, 65533) && ! r(u, 65536, 1114111)) return 0; + return 1; + } + function is_digit(u){return r(u, 48, 57);} + function is_hex_digit(u){ + var _a__ = r(u, 48, 57); + if(_a__) + var _a$_ = _a__; + else{ + var _ba_ = r(u, 65, 70); + if(! _ba_) return r(u, 97, 102); + var _a$_ = _ba_; + } + return _a$_; + } + function comm_range(u){ + var _aY_ = r(u, 192, 214); + if(_aY_) + var _aZ_ = _aY_; + else{ + var _a0_ = r(u, 216, 246); + if(_a0_) + var _aZ_ = _a0_; + else{ + var _a1_ = r(u, 248, 767); + if(_a1_) + var _aZ_ = _a1_; + else{ + var _a2_ = r(u, 880, 893); + if(_a2_) + var _aZ_ = _a2_; + else{ + var _a3_ = r(u, 895, 8191); + if(_a3_) + var _aZ_ = _a3_; + else{ + var _a4_ = r(u, 8204, 8205); + if(_a4_) + var _aZ_ = _a4_; + else{ + var _a5_ = r(u, 8304, 8591); + if(_a5_) + var _aZ_ = _a5_; + else{ + var _a6_ = r(u, 11264, 12271); + if(_a6_) + var _aZ_ = _a6_; + else{ + var _a7_ = r(u, 12289, 55295); + if(_a7_) + var _aZ_ = _a7_; + else{ + var _a8_ = r(u, 63744, 64975); + if(_a8_) + var _aZ_ = _a8_; + else{ + var _a9_ = r(u, 65008, 65533); + if(! _a9_) return r(u, 65536, 983039); + var _aZ_ = _a9_; + } + } + } + } + } + } + } + } + } + } + return _aZ_; + } + function is_name_start_char(u){ + if(! r(u, 97, 122) && ! r(u, 65, 90)) + return is_white(u) ? 0 : 95 === u ? 1 : comm_range(u) ? 1 : 0; + return 1; + } + function is_name_char(u){ + if(! r(u, 97, 122) && ! r(u, 65, 90)){ + if(is_white(u)) return 0; + if(r(u, 48, 57)) return 1; + var _aX_ = u - 45 | 0, switch$0 = 0; + if(50 < _aX_ >>> 0){ + if(138 === _aX_) switch$0 = 1; + } + else if(47 < _aX_ - 2 >>> 0) switch$0 = 1; + if(switch$0) return 1; + if(! comm_range(u) && ! r(u, 768, 879) && ! r(u, 8255, 8256)) return 0; + return 1; + } + return 1; + } + function nextc(i){ + if(i[7] === u_eoi) err(i, -95440847); + if(i[7] === 10){ + i[9] = i[9] + 1 | 0; + i[10] = 1; + } + else + i[10] = i[10] + 1 | 0; + i[7] = caml_call1(i[6], i[5]); + if(1 - is_char(i[7])) throw caml_maybe_attach_backtrace(Malformed, 1); + var _aV_ = i[8], _aW_ = _aV_ ? i[7] === 10 ? 1 : 0 : _aV_; + if(_aW_) i[7] = caml_call1(i[6], i[5]); + return i[7] === 13 ? (i[8] = 1, i[7] = u_nl, 0) : (i[8] = 0, 0); + } + function nextc_eof(i){ + try{var _aT_ = nextc(i); return _aT_;} + catch(_aU_){ + var _aS_ = caml_wrap_exception(_aU_); + if(_aS_ !== Stdlib[12]) throw caml_maybe_attach_backtrace(_aS_, 0); + i[7] = u_eoi; + return 0; + } + } + function skip_white(i){for(;;){if(! is_white(i[7])) return 0; nextc(i);}} + function skip_white_eof(i){ + for(;;){if(! is_white(i[7])) return 0; nextc_eof(i);} + } + function accept(i, c){ + return i[7] === c ? nextc(i) : err_expected_chars(i, [0, c, 0]); + } + function clear_ident(i){return caml_call1(Buffer[4], i[17]);} + function clear_data(i){return caml_call1(Buffer[4], i[18]);} + function addc_ident(i, c){return caml_call2(Buffer[3], i[17], c);} + function addc_data(i, c){return caml_call2(Buffer[3], i[18], c);} + function addc_data_strip(i, c){ + if(is_white(c)){i[14] = 1; return 0;} + var + _aQ_ = i[14], + _aR_ = _aQ_ ? 0 !== caml_call1(Buffer[6], i[18]) ? 1 : 0 : _aQ_; + if(_aR_) addc_data(i, u_space); + i[14] = 0; + return addc_data(i, c); + } + function expand_name(i, param){ + var local = param[2], prefix = param[1]; + function external(prefix){ + var match = caml_call1(i[3], prefix); + if(! match) return err(i, [0, -108708553, prefix]); + var uri = match[1]; + return uri; + } + try{ + var + uri = caml_call2(Ht[7], i[16], prefix), + _aO_ = + str_empty(uri) + ? str_empty + (prefix) + ? [0, String[1], local] + : [0, external(prefix), local] + : [0, uri, local]; + return _aO_; + } + catch(_aP_){ + var _aN_ = caml_wrap_exception(_aP_); + if(_aN_ === Stdlib[8]) return [0, external(prefix), local]; + throw caml_maybe_attach_backtrace(_aN_, 0); + } + } + function find_encoding(i){ + function reset(uchar, i){i[6] = uchar; i[10] = 0; return nextc(i);} + var match = i[1]; + if(! match){ + nextc(i); + var _aM_ = i[7]; + if(240 <= _aM_){ + if(254 === _aM_){ + nextc(i); + if(255 !== i[7]) err(i, -372779099); + reset(uchar_utf16be, i); + return 1; + } + if(255 === _aM_){ + nextc(i); + if(254 !== i[7]) err(i, -372779099); + reset(uchar_utf16le, i); + return 1; + } + } + else if(60 !== _aM_ && 239 <= _aM_){ + nextc(i); + if(187 !== i[7]) err(i, -372779099); + nextc(i); + if(191 !== i[7]) err(i, -372779099); + reset(uchar_utf8, i); + return 1; + } + i[6] = uchar_utf8; + return 0; + } + var e = match[1]; + if(143365725 <= e) + if(423112016 <= e) + if(684370880 <= e){ + reset(uchar_utf8, i); + if(i[7] === 65279){i[10] = 0; nextc(i);} + } + else + reset(uchar_ascii, i); + else if(338302576 <= e) + reset(uchar_iso_8859_1, i); + else{ + nextc(i); + var b0 = i[7]; + nextc(i); + var b1 = i[7], switch$0 = 0; + if(254 === b0){ + if(255 === b1){reset(uchar_utf16be, i); switch$0 = 1;} + } + else if(255 === b0 && 254 === b1){ + reset(uchar_utf16le, i); + switch$0 = 1; + } + if(! switch$0) err(i, -372779099); + } + else if(-211555818 <= e){ + reset(uchar_utf16le, i); + if(i[7] === 65279){i[10] = 0; nextc(i);} + } + else{reset(uchar_utf16be, i); if(i[7] === 65279){i[10] = 0; nextc(i);}} + return 1; + } + function p_ncname(i){ + clear_ident(i); + if(! is_name_start_char(i[7])) return err_illegal_char(i, i[7]); + addc_ident(i, i[7]); + nextc(i); + for(;;){ + if(! is_name_char(i[7])) return caml_call1(Buffer[5], i[17]); + addc_ident(i, i[7]); + nextc(i); + } + } + function p_qname(i){ + var n = p_ncname(i); + return i[7] !== 58 ? [0, String[1], n] : (nextc(i), [0, n, p_ncname(i)]); + } + function p_charref(i){ + var c = [0, 0]; + clear_ident(i); + nextc(i); + if(i[7] === 59) + err(i, [0, 719894387, String[1]]); + else + try{ + if(i[7] === 120){ + addc_ident(i, i[7]); + nextc(i); + for(;;){ + if(i[7] !== 59){ + addc_ident(i, i[7]); + if(! is_hex_digit(i[7])) + throw caml_maybe_attach_backtrace(Stdlib[3], 1); + var + _aK_ = + i[7] <= 57 + ? i[7] - 48 | 0 + : i[7] <= 70 ? i[7] - 55 | 0 : i[7] - 87 | 0; + c[1] = (c[1] * 16 | 0) + _aK_ | 0; + nextc(i); + continue; + } + break; + } + } + else + for(;;){ + if(i[7] !== 59){ + addc_ident(i, i[7]); + if(! is_digit(i[7])) + throw caml_maybe_attach_backtrace(Stdlib[3], 1); + c[1] = (c[1] * 10 | 0) + (i[7] - 48 | 0) | 0; + nextc(i); + continue; + } + break; + } + } + catch(_aL_){ + var _aJ_ = caml_wrap_exception(_aL_); + if(_aJ_ !== Stdlib[3]) throw caml_maybe_attach_backtrace(_aJ_, 0); + c[1] = -1; + for(;;){ + if(i[7] !== 59){addc_ident(i, i[7]); nextc(i); continue;} + break; + } + } + nextc(i); + return is_char(c[1]) + ? (clear_ident + (i), + addc_ident(i, c[1]), + caml_call1(Buffer[5], i[17])) + : err(i, [0, 719894387, caml_call1(Buffer[5], i[17])]); + } + var predefined_entities = caml_call1(Ht[1], 5); + function e(k, v){ + var _aH_ = caml_call1(str, v), _aI_ = caml_call1(str, k); + return caml_call3(Ht[5], predefined_entities, _aI_, _aH_); + } + e(cst_lt, cst$8); + e(cst_gt, cst$9); + e(cst_amp, cst$10); + e(cst_apos, cst$11); + e(cst_quot, cst$12); + function p_entity_ref(i){ + var ent = p_ncname(i); + accept(i, u_scolon); + try{var _aF_ = caml_call2(Ht[7], predefined_entities, ent); return _aF_;} + catch(_aG_){ + var _aE_ = caml_wrap_exception(_aG_); + if(_aE_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_aE_, 0); + var match = caml_call1(i[4], ent); + if(! match) return err(i, [0, -739719956, ent]); + var s = match[1]; + return s; + } + } + function p_reference(i){ + nextc(i); + return i[7] === 35 ? p_charref(i) : p_entity_ref(i); + } + function p_attr_value(i){ + skip_white(i); + var switch$0 = 0; + if(i[7] !== 34 && i[7] !== 39){ + var delim = err_expected_chars(i, [0, u_quot, [0, u_apos, 0]]); + switch$0 = 1; + } + if(! switch$0) var delim = i[7]; + nextc(i); + skip_white(i); + clear_data(i); + i[14] = 1; + for(;;){ + if(i[7] === delim){nextc(i); return caml_call1(Buffer[5], i[18]);} + if(i[7] === 60){err_illegal_char(i, u_lt); continue;} + if(i[7] === 38){ + var + _aB_ = p_reference(i), + _aC_ = function(_aD_){return addc_data_strip(i, _aD_);}; + caml_call2(String[5], _aC_, _aB_); + continue; + } + addc_data_strip(i, i[7]); + nextc(i); + } + } + function p_attributes(i){ + var pre_acc = 0, acc = 0; + for(;;){ + if(! is_white(i[7])) return [0, pre_acc, acc]; + skip_white(i); + if(i[7] !== 47 && i[7] !== 62){ + var n = p_qname(i), local = n[2], prefix = n[1]; + skip_white(i); + accept(i, u_eq); + var v = p_attr_value(i), att = [0, n, v]; + if(str_empty(prefix) && str_eq(local, n_xmlns)){ + caml_call3(Ht[5], i[16], String[1], v); + var + acc$0 = [0, att, acc], + pre_acc$0 = [0, String[1], pre_acc], + pre_acc = pre_acc$0, + acc = acc$0; + continue; + } + if(str_eq(prefix, n_xmlns)){ + caml_call3(Ht[5], i[16], local, v); + var + acc$1 = [0, att, acc], + pre_acc$1 = [0, local, pre_acc], + pre_acc = pre_acc$1, + acc = acc$1; + continue; + } + if(str_eq(prefix, n_xml) && str_eq(local, n_space)){ + if(str_eq(v, v_preserve)) + i[13] = 0; + else if(str_eq(v, v_default)) i[13] = i[2]; + var acc$2 = [0, att, acc], acc = acc$2; + continue; + } + var acc$3 = [0, att, acc], acc = acc$3; + continue; + } + return [0, pre_acc, acc]; + } + } + function p_limit(i){ + if(i[7] === u_eoi) + var _ax_ = 4; + else if(i[7] !== 60) + var _ax_ = 3; + else{ + nextc(i); + if(i[7] === 63){ + nextc(i); + var _ax_ = [2, p_qname(i)]; + } + else if(i[7] === 47){ + nextc(i); + var n = p_qname(i); + skip_white(i); + var _ax_ = [1, n]; + } + else if(i[7] === 33){ + nextc(i); + if(i[7] === 45){ + nextc(i); + accept(i, u_minus); + var _ax_ = 0; + } + else if(i[7] === 68) + var _ax_ = 2; + else if(i[7] === 91){ + nextc(i); + clear_ident(i); + var k = 1; + for(;;){ + addc_ident(i, i[7]); + nextc(i); + var _az_ = k + 1 | 0; + if(6 !== k){var k = _az_; continue;} + var + cdata = caml_call1(Buffer[5], i[17]), + _ay_ = + str_eq(cdata, s_cdata) + ? 1 + : err_expected_seqs(i, [0, s_cdata, 0], cdata), + _ax_ = _ay_; + break; + } + } + else + var + _aA_ = str_of_char(i[7]), + _ax_ = + err + (i, + [0, 719944127, caml_call2(cat, caml_call1(str, cst$13), _aA_)]); + } + else + var _ax_ = [0, p_qname(i)]; + } + i[11] = _ax_; + return 0; + } + function skip_comment(i){ + a: + for(;;) + for(;;){ + if(i[7] !== 45){nextc(i); continue;} + nextc(i); + if(i[7] !== 45) continue a; + nextc(i); + if(i[7] !== 62) err_expected_chars(i, [0, u_gt, 0]); + return nextc_eof(i); + } + } + function skip_pi(i){ + a: + for(;;) + for(;;){ + if(i[7] !== 63){nextc(i); continue;} + nextc(i); + if(i[7] !== 62) continue a; + return nextc_eof(i); + } + } + function skip_misc(i, allow_xmlpi){ + for(;;){ + var _aw_ = i[11]; + if(typeof _aw_ === "number") + switch(_aw_){ + case 0: + skip_comment(i); p_limit(i); continue; + case 3: + if(is_white(i[7])){skip_white_eof(i); p_limit(i); continue;} break; + } + else if(2 === _aw_[0]){ + var match = _aw_[1], l = match[2], p = match[1]; + if(str_empty(p) && str_eq(n_xml, caml_call1(String[4], l))) + return allow_xmlpi ? 0 : err(i, [0, 719944127, l]); + skip_pi(i); + p_limit(i); + continue; + } + return 0; + } + } + function p_chardata(addc, i){ + a: + for(;;){ + if(i[7] === 60) return 0; + if(i[7] === 38){ + var _au_ = p_reference(i), _av_ = caml_call1(addc, i); + caml_call2(String[5], _av_, _au_); + continue; + } + if(i[7] !== 93){caml_call2(addc, i, i[7]); nextc(i); continue;} + caml_call2(addc, i, i[7]); + nextc(i); + if(i[7] !== 93) continue; + caml_call2(addc, i, i[7]); + nextc(i); + for(;;){ + if(i[7] === 93){caml_call2(addc, i, i[7]); nextc(i); continue;} + if(i[7] !== 62) continue a; + err(i, [0, 719944127, caml_call1(str, cst$14)]); + continue a; + } + } + } + function p_cdata(addc, i){ + try{ + for(;;){ + if(i[7] === 93){ + nextc(i); + for(;;){ + if(i[7] === 93){ + nextc(i); + if(i[7] === 62){ + nextc(i); + throw caml_maybe_attach_backtrace(Stdlib[3], 1); + } + caml_call2(addc, i, u_rbrack); + continue; + } + caml_call2(addc, i, u_rbrack); + break; + } + } + caml_call2(addc, i, i[7]); + nextc(i); + } + } + catch(_at_){ + var _as_ = caml_wrap_exception(_at_); + if(_as_ === Stdlib[3]) return 0; + throw caml_maybe_attach_backtrace(_as_, 0); + } + } + function p_xml_decl(i, ignore_enc, ignore_utf16){ + var yes_no = [0, v_yes, [0, v_no, 0]]; + function p_val(i){ + skip_white(i); + accept(i, u_eq); + skip_white(i); + return p_attr_value(i); + } + function p_val_exp(i, exp){ + var v = p_val(i); + function _ap_(_ar_){return str_eq(v, _ar_);} + var _aq_ = 1 - caml_call2(Stdlib_List[33], _ap_, exp); + return _aq_ ? err_expected_seqs(i, exp, v) : _aq_; + } + var _an_ = i[11]; + if(typeof _an_ !== "number" && 2 === _an_[0]){ + var match = _an_[1], l = match[2], p = match[1]; + if(str_empty(p) && str_eq(l, n_xml)){ + skip_white(i); + var v = p_ncname(i); + if(1 - str_eq(v, n_version)) + err_expected_seqs(i, [0, n_version, 0], v); + p_val_exp(i, [0, v_version_1_0, [0, v_version_1_1, 0]]); + skip_white(i); + if(i[7] !== 63){ + var n = p_ncname(i); + if(str_eq(n, n_encoding)){ + var _ao_ = p_val(i), enc = caml_call1(String[4], _ao_); + if(1 - ignore_enc) + if(str_eq(enc, v_utf_8)) + i[6] = uchar_utf8; + else if(str_eq(enc, v_utf_16be)) + i[6] = uchar_utf16be; + else if(str_eq(enc, v_utf_16le)) + i[6] = uchar_utf16le; + else if(str_eq(enc, v_iso_8859_1)) + i[6] = uchar_iso_8859_1; + else if(str_eq(enc, v_us_ascii) || str_eq(enc, v_ascii)) + i[6] = uchar_ascii; + else + if(str_eq(enc, v_utf_16)){ + if(! ignore_utf16) err(i, -372779099); + } + else + err(i, [0, -6915192, enc]); + skip_white(i); + if(i[7] !== 63){ + var n$0 = p_ncname(i); + if(str_eq(n$0, n_standalone)) + p_val_exp(i, yes_no); + else + err_expected_seqs + (i, [0, n_standalone, [0, caml_call1(str, cst$15), 0]], n$0); + } + } + else if(str_eq(n, n_standalone)) + p_val_exp(i, yes_no); + else + err_expected_seqs + (i, + [0, n_encoding, [0, n_standalone, [0, caml_call1(str, cst$16), 0]]], + n); + } + skip_white(i); + accept(i, u_qmark); + accept(i, u_gt); + return p_limit(i); + } + } + return 0; + } + function p_dtd_signal(i){ + skip_misc(i, 0); + if(2 !== i[11]) return _b_; + function buf(_am_){return addc_data(i, _am_);} + var nest = [0, 1]; + clear_data(i); + buf(u_lt); + buf(u_emark); + a: + for(;;){ + if(0 >= nest[1]){ + var dtd = caml_call1(Buffer[5], i[18]); + p_limit(i); + skip_misc(i, 0); + return [0, 3407540, [0, dtd]]; + } + if(i[7] === 60){ + nextc(i); + if(i[7] !== 33){buf(u_lt); nest[1]++; continue;} + nextc(i); + if(i[7] !== 45){buf(u_lt); buf(u_emark); nest[1]++; continue;} + nextc(i); + if(i[7] !== 45){ + buf(u_lt); + buf(u_emark); + buf(u_minus); + nest[1]++; + continue; + } + nextc(i); + skip_comment(i); + continue; + } + if(i[7] !== 34 && i[7] !== 39){ + if(i[7] === 62){buf(u_gt); nextc(i); nest[1] += -1; continue;} + buf(i[7]); + nextc(i); + continue; + } + var c = i[7]; + buf(c); + nextc(i); + for(;;){ + if(i[7] !== c){buf(i[7]); nextc(i); continue;} + buf(c); + nextc(i); + continue a; + } + } + } + function p_data(i){ + clear_data(i); + i[14] = 1; + var addc_data_strip$0 = i[13] ? addc_data_strip : addc_data; + for(;;){ + var _al_ = i[11]; + if(typeof _al_ === "number") + switch(_al_){ + case 0: + skip_comment(i); p_limit(i); continue; + case 1: + p_cdata(addc_data_strip$0, i); p_limit(i); continue; + case 2: + err(i, [0, 719944127, caml_call1(str, cst_D)]); break; + case 3: + p_chardata(addc_data_strip$0, i); p_limit(i); continue; + default: err(i, -95440847); + } + else if(2 === _al_[0]){skip_pi(i); p_limit(i); continue;} + var d = caml_call1(Buffer[5], i[18]); + return d; + } + } + function p_el_start_signal(i, n){ + function expand_att(att){ + var v = att[2], n = att[1], local = n[2], prefix = n[1]; + return str_eq(prefix, String[1]) + ? str_eq(local, n_xmlns) ? [0, [0, ns_xmlns, n_xmlns], v] : att + : [0, expand_name(i, n), v]; + } + var + strip = i[13], + match = p_attributes(i), + atts = match[2], + prefixes = match[1]; + i[15] = [0, [0, n, prefixes, strip], i[15]]; + var _ak_ = caml_call2(Stdlib_List[21], expand_att, atts); + return [0, -174483606, [0, expand_name(i, n), _ak_]]; + } + function p_el_end_signal(i, n){ + var _ah_ = i[15]; + if(! _ah_) + throw caml_maybe_attach_backtrace([0, Assert_failure, _c_], 1); + var + scopes = _ah_[2], + match = _ah_[1], + strip = match[3], + prefixes = match[2], + n$0 = match[1]; + if(i[7] !== 62) err_expected_chars(i, [0, u_gt, 0]); + if(1 - str_eq(n, n$0)){ + var _ai_ = name_str(n); + err_expected_seqs(i, [0, name_str(n$0), 0], _ai_); + } + i[15] = scopes; + i[13] = strip; + var _aj_ = caml_call1(Ht[6], i[16]); + caml_call2(Stdlib_List[17], _aj_, prefixes); + if(0 === scopes) i[7] = u_end_doc; else{nextc(i); p_limit(i);} + return 83809507; + } + function p_signal(i){ + if(0 === i[15]){ + var match = i[11]; + if(typeof match !== "number" && 0 === match[0]){ + var n = match[1]; + return p_el_start_signal(i, n); + } + return err(i, -764030554); + } + var _af_ = i[12], switch$0 = 0; + if(typeof _af_ !== "number" && -174483606 === _af_[1]){ + skip_white(i); + if(i[7] === 62){ + accept(i, u_gt); + p_limit(i); + } + else if(i[7] === 47){ + var _ag_ = i[15]; + if(! _ag_) + throw caml_maybe_attach_backtrace([0, Assert_failure, _d_], 1); + var tag = _ag_[1][1]; + nextc(i); + i[11] = [1, tag]; + } + else + err_expected_chars(i, [0, u_slash, [0, u_gt, 0]]); + switch$0 = 1; + } + for(;;){ + var match$0 = i[11]; + if(typeof match$0 !== "number") + switch(match$0[0]){ + case 0: + var n$0 = match$0[1]; return p_el_start_signal(i, n$0); + case 1: + var n$1 = match$0[1]; return p_el_end_signal(i, n$1); + default: skip_pi(i); p_limit(i); continue; + } + switch(match$0){ + case 0: + skip_comment(i); p_limit(i); continue; + case 2: + return err(i, [0, 719944127, caml_call1(str, cst_D$0)]); + case 4: + return err(i, -95440847); + default: + var d = p_data(i); + if(str_empty(d)) continue; + return [0, 758940234, d]; + } + } + } + function eoi(i){ + try{ + if(i[7] === u_eoi) + var _ad_ = 1; + else if(i[7] !== u_start_doc) + var _ad_ = 0; + else if(83809507 === i[12]){ + nextc_eof(i); + p_limit(i); + var + _ad_ = + i[7] === u_eoi + ? 1 + : (skip_misc + (i, 1), + i[7] === u_eoi + ? 1 + : (p_xml_decl(i, 0, 1), i[12] = p_dtd_signal(i), 0)); + } + else{ + var ignore_enc = find_encoding(i); + p_limit(i); + p_xml_decl(i, ignore_enc, 0); + i[12] = p_dtd_signal(i); + var _ad_ = 0; + } + return _ad_; + } + catch(_ae_){ + var _ac_ = caml_wrap_exception(_ae_); + if(_ac_ === Buffer[1]) return err(i, 891487781); + if(_ac_ === Malformed) return err(i, -372779099); + if(_ac_ === Stdlib[12]) return err(i, -95440847); + throw caml_maybe_attach_backtrace(_ac_, 0); + } + } + function peek(i){return eoi(i) ? err(i, -95440847) : i[12];} + function input(i){ + try{ + if(i[7] === u_end_doc){ + i[7] = u_start_doc; + var _aa_ = i[12]; + } + else{var s = peek(i); i[12] = p_signal(i); var _aa_ = s;} + return _aa_; + } + catch(_ab_){ + var _$_ = caml_wrap_exception(_ab_); + if(_$_ === Buffer[1]) return err(i, 891487781); + if(_$_ === Malformed) return err(i, -372779099); + if(_$_ === Stdlib[12]) return err(i, -95440847); + throw caml_maybe_attach_backtrace(_$_, 0); + } + } + function input_tree(el, data, i){ + var match = input(i); + if(typeof match !== "number"){ + var _Z_ = match[1]; + if(-174483606 === _Z_){ + var + tag = match[2], + tags$2 = [0, tag, 0], + tags = tags$2, + context$0 = context; + for(;;){ + var match$0 = input(i); + if(typeof match$0 === "number"){ + if(! tags) + throw caml_maybe_attach_backtrace([0, Assert_failure, _e_], 1); + var + context$1 = context$0[2], + childs = context$0[1], + tags$0 = tags[2], + tag$0 = tags[1], + el$0 = caml_call2(el, tag$0, caml_call1(Stdlib_List[9], childs)); + if(! context$1) return el$0; + var + context$2 = context$1[2], + parent = context$1[1], + context$3 = [0, [0, el$0, parent], context$2], + tags = tags$0, + context$0 = context$3; + continue; + } + var ___ = match$0[1]; + if(3407540 === ___) + throw caml_maybe_attach_backtrace([0, Assert_failure, _f_], 1); + if(758940234 <= ___){ + var + d = match$0[2], + context$4 = context$0[2], + childs$0 = context$0[1], + context$5 = [0, [0, caml_call1(data, d), childs$0], context$4], + context$0 = context$5; + continue; + } + var + tag$1 = match$0[2], + context$6 = [0, 0, context$0], + tags$1 = [0, tag$1, tags], + tags = tags$1, + context$0 = context$6; + } + } + if(758940234 === _Z_){var d$0 = match[2]; return caml_call1(data, d$0);} + } + return caml_call1(Stdlib[1], err_input_tree); + } + function input_doc_tree(el, data, i){ + var match = input(i); + if(typeof match !== "number" && 3407540 === match[1]){ + var d = match[2]; + return [0, d, input_tree(el, data, i)]; + } + return caml_call1(Stdlib[1], err_input_doc_tree); + } + function pos(i){return [0, i[9], i[10]];} + function err_prefix(uri){ + var _Y_ = caml_call2(Stdlib[28], uri, cst$17); + return caml_call2(Stdlib[28], cst_unbound_namespace, _Y_); + } + function make_output(opt, _U_, _T_, _S_, d){ + if(opt) var sth = opt[1], decl = sth; else var decl = 1; + if(_U_) var sth$0 = _U_[1], nl = sth$0; else var nl = 0; + if(_T_) var sth$1 = _T_[1], indent = sth$1; else var indent = 0; + if(_S_) + var sth$2 = _S_[1], ns_prefix = sth$2; + else + var ns_prefix = function(param){return 0;}; + var _V_ = d[1]; + if(86585632 === _V_) + var + b = d[2], + outc = caml_call1(Stdlib_Buffer[12], b), + outs = caml_call1(Stdlib_Buffer[18], b), + outc$0 = outc, + outs$0 = outs; + else if(438511779 <= _V_) + var + c = d[2], + outc$1 = caml_call1(Stdlib[65], c), + outc$0 = outc$1, + outs$0 = caml_call1(Stdlib[69], c); + else + var + f = d[2], + os = + function(s, p, l){ + var _W_ = (p + l | 0) - 1 | 0; + if(_W_ >= p){ + var i = p; + for(;;){ + caml_call1(f, caml_string_get(s, i)); + var _X_ = i + 1 | 0; + if(_W_ !== i){var i = _X_; continue;} + break; + } + } + return 0; + }, + oc = function(c){return caml_call1(f, c);}, + outc$0 = oc, + outs$0 = os; + var prefixes = caml_call1(Ht[1], 10); + caml_call3(Ht[5], prefixes, String[1], String[1]); + caml_call3(Ht[5], prefixes, ns_xml, n_xml); + caml_call3(Ht[5], prefixes, ns_xmlns, n_xmlns); + return [0, + decl, + nl, + indent, + ns_prefix, + prefixes, + outs$0, + outc$0, + 0, + 0, + -1]; + } + function output_depth(o){return o[10];} + function outs(o, s){ + return caml_call3(o[6], s, 0, caml_ml_string_length(s)); + } + function str_utf_8(s){ + function _R_(param, s){return s;} + return caml_call3(String[7], _R_, cst$18, s); + } + function out_utf_8(o, s){ + function _Q_(o, s){outs(o, s); return o;} + caml_call3(String[7], _Q_, o, s); + return 0; + } + function prefix_name(o, param){ + var local = param[2], ns = param[1]; + try{ + var switch$0 = 0; + if(str_eq(ns, ns_xmlns) && str_eq(local, n_xmlns)){var _O_ = [0, String[1], n_xmlns]; switch$0 = 1;} + if(! switch$0) var _O_ = [0, caml_call2(Ht[7], o[5], ns), local]; + return _O_; + } + catch(_P_){ + var _M_ = caml_wrap_exception(_P_); + if(_M_ !== Stdlib[8]) throw caml_maybe_attach_backtrace(_M_, 0); + var match = caml_call1(o[4], ns); + if(match){var prefix = match[1]; return [0, prefix, local];} + var _N_ = err_prefix(str_utf_8(ns)); + return caml_call1(Stdlib[1], _N_); + } + } + function bind_prefixes(o, atts){ + function add(acc, param){ + var uri = param[2], match = param[1], local = match[2], ns = match[1]; + if(! str_eq(ns, ns_xmlns)) return acc; + var prefix = str_eq(local, n_xmlns) ? String[1] : local; + caml_call3(Ht[5], o[5], uri, prefix); + return [0, uri, acc]; + } + return caml_call3(Stdlib_List[25], add, 0, atts); + } + function out_data(o, s){ + function out(param, s){ + var len = caml_ml_string_length(s), start = [0, 0], last = [0, 0]; + function escape(e){ + caml_call3(o[6], s, start[1], last[1] - start[1] | 0); + outs(o, e); + last[1]++; + start[1] = last[1]; + return 0; + } + for(;;){ + if(last[1] >= len) + return caml_call3(o[6], s, start[1], last[1] - start[1] | 0); + var c = caml_string_get(s, last[1]), switch$0 = 0; + if(34 <= c) + if(38 === c) + escape(cst_amp$0); + else if(60 <= c) + if(63 <= c) + switch$0 = 1; + else{ + var switch$1 = 0; + switch(c - 60 | 0){ + case 0: + escape(cst_lt$0); switch$1 = 1; break; + case 1: + switch$0 = 1; break; + default: escape(cst_gt$0); switch$1 = 1; + } + } + else if(35 <= c) switch$0 = 1; else escape(cst_quot$0); + else{ + var switch$2 = 0; + if(11 <= c) + if(13 === c) switch$2 = 1; else switch$0 = 1; + else if(9 <= c) switch$2 = 1; else switch$0 = 1; + if(switch$2) last[1]++; + } + if(switch$0) if(32 <= c) last[1]++; else escape(cst$19); + } + } + return caml_call3(String[7], out, 0, s); + } + function out_qname(o, param){ + var l = param[2], p = param[1]; + if(1 - str_empty(p)){out_utf_8(o, p); caml_call1(o[7], 58);} + return out_utf_8(o, l); + } + function out_attribute(o, param){ + var v = param[2], n = param[1]; + caml_call1(o[7], 32); + out_qname(o, prefix_name(o, n)); + outs(o, cst$20); + out_data(o, v); + return caml_call1(o[7], 34); + } + function output(o, s){ + function indent(o){ + var match = o[3]; + if(! match) return 0; + var c = match[1], _K_ = runtime.caml_mul(o[10], c), _J_ = 1; + if(_K_ >= 1){ + var i = _J_; + for(;;){ + caml_call1(o[7], 32); + var _L_ = i + 1 | 0; + if(_K_ !== i){var i = _L_; continue;} + break; + } + } + return 0; + } + function unindent(o){return o[3] ? caml_call1(o[7], 10) : 0;} + if(-1 === o[10]){ + if(typeof s === "number") return caml_call1(Stdlib[1], err_el_end); + var _D_ = s[1]; + if(3407540 !== _D_) + return 758940234 <= _D_ + ? caml_call1(Stdlib[1], err_data) + : caml_call1(Stdlib[1], err_el_start); + var d = s[2]; + if(o[1]) outs(o, cst_xml_version_1_0_encoding_U); + if(d){var dtd = d[1]; out_utf_8(o, dtd); caml_call1(o[7], 10);} + o[10] = 0; + return 0; + } + if(typeof s === "number"){ + var _E_ = o[9]; + if(! _E_) return caml_call1(Stdlib[1], err_el_end); + var scopes = _E_[2], match = _E_[1], uris = match[2], n = match[1]; + o[10] = o[10] - 1 | 0; + if(o[8]) + outs(o, cst$21); + else{indent(o); outs(o, cst$22); out_qname(o, n); caml_call1(o[7], 62);} + o[9] = scopes; + var _F_ = caml_call1(Ht[6], o[5]); + caml_call2(Stdlib_List[17], _F_, uris); + o[8] = 0; + if(0 !== o[10]) return unindent(o); + if(o[2]) caml_call1(o[7], 10); + o[10] = -1; + return 0; + } + var _G_ = s[1]; + if(3407540 === _G_) return caml_call1(Stdlib[2], err_dtd); + if(758940234 <= _G_){ + var d$0 = s[2]; + if(o[8]){outs(o, cst$23); unindent(o);} + indent(o); + out_data(o, d$0); + unindent(o); + o[8] = 0; + return 0; + } + var match$0 = s[2], atts = match$0[2], n$0 = match$0[1]; + if(o[8]){outs(o, cst$24); unindent(o);} + indent(o); + var uris$0 = bind_prefixes(o, atts), qn = prefix_name(o, n$0); + caml_call1(o[7], 60); + out_qname(o, qn); + function _H_(_I_){return out_attribute(o, _I_);} + caml_call2(Stdlib_List[17], _H_, atts); + o[9] = [0, [0, qn, uris$0], o[9]]; + o[10] = o[10] + 1 | 0; + o[8] = 1; + return 0; + } + function output_tree(frag, o, v){ + var param = [0, [0, v, 0], 0]; + for(;;){ + if(! param) + throw caml_maybe_attach_backtrace([0, Assert_failure, _g_], 1); + var match = param[1]; + if(! match){ + var context$0 = param[2]; + if(! context$0) return 0; + output(o, 83809507); + var param = context$0; + continue; + } + var + context = param[2], + rest = match[2], + v$0 = match[1], + signal = caml_call1(frag, v$0); + if(758940234 <= signal[1]){ + output(o, signal); + var param = [0, rest, context]; + continue; + } + var match$0 = signal[2], childs = match$0[2], tag = match$0[1]; + output(o, [0, -174483606, tag]); + var param = [0, childs, [0, rest, context]]; + } + } + function output_doc_tree(frag, o, param){ + var v = param[2], dtd = param[1]; + output(o, [0, 3407540, dtd]); + return output_tree(frag, o, v); + } + return [0, + str, + str_eq, + str_empty, + cat, + str_of_char, + Ht, + u_nl, + u_cr, + u_space, + u_quot, + u_sharp, + u_amp, + u_apos, + u_minus, + u_slash, + u_colon, + u_scolon, + u_lt, + u_eq, + u_gt, + u_qmark, + u_emark, + u_lbrack, + u_rbrack, + u_x, + u_bom, + u_9, + u_F, + u_D, + s_cdata, + ns_xml, + ns_xmlns, + n_xml, + n_xmlns, + n_space, + n_version, + n_encoding, + n_standalone, + v_yes, + v_no, + v_preserve, + v_default, + v_version_1_0, + v_version_1_1, + v_utf_8, + v_utf_16, + v_utf_16be, + v_utf_16le, + v_iso_8859_1, + v_us_ascii, + v_ascii, + name_str, + Error, + error_message, + err_input_tree, + err_input_doc_tree, + err, + err_illegal_char, + err_expected_seqs, + err_expected_chars, + u_eoi, + u_start_doc, + u_end_doc, + signal_start_stream, + make_input, + r, + is_white, + is_char, + is_digit, + is_hex_digit, + comm_range, + is_name_start_char, + is_name_char, + nextc, + nextc_eof, + skip_white, + skip_white_eof, + accept, + clear_ident, + clear_data, + addc_ident, + addc_data, + addc_data_strip, + expand_name, + find_encoding, + p_ncname, + p_qname, + p_charref, + predefined_entities, + p_entity_ref, + p_reference, + p_attr_value, + p_attributes, + p_limit, + skip_comment, + skip_pi, + skip_misc, + p_chardata, + p_cdata, + p_xml_decl, + p_dtd_signal, + p_data, + p_el_start_signal, + p_el_end_signal, + p_signal, + eoi, + peek, + input, + input_tree, + input_doc_tree, + pos, + err_prefix, + err_dtd, + err_el_start, + err_el_end, + err_data, + make_output, + output_depth, + outs, + str_utf_8, + out_utf_8, + prefix_name, + bind_prefixes, + out_data, + out_qname, + out_attribute, + output, + output_tree, + output_doc_tree]; + } + var + length = caml_ml_string_length, + append = Stdlib[28], + lowercase = Stdlib_String[26]; + function iter(f, s){ + var len = caml_ml_string_length(s), pos = [0, -1]; + function i(param){ + pos[1]++; + if(pos[1] === len) throw caml_maybe_attach_backtrace(Stdlib[3], 1); + return caml_string_get(s, pos[1]); + } + try{for(;;) caml_call1(f, uchar_utf8(i));} + catch(_C_){ + var _B_ = caml_wrap_exception(_C_); + if(_B_ === Stdlib[3]) return 0; + throw caml_maybe_attach_backtrace(_B_, 0); + } + } + function of_string(s){return s;} + function to_utf_8(f, v, x){return caml_call2(f, v, x);} + var + compare = Stdlib_String[9], + String = + [0, + empty, + length, + append, + lowercase, + iter, + of_string, + to_utf_8, + compare], + Full = [248, cst_Xmlm_Buffer_Full, caml_fresh_oo_id(0)], + create = Stdlib_Buffer[1]; + function add_uchar(b, u){ + try{ + var + buf = + function(c){ + var _A_ = caml_call1(Stdlib_Char[1], c); + return caml_call2(Stdlib_Buffer[12], b, _A_); + }, + _y_ = + 127 < u + ? 2047 + < u + ? 65535 + < u + ? (buf + (240 | u >>> 18 | 0), + buf(128 | (u >>> 12 | 0) & 63), + buf(128 | (u >>> 6 | 0) & 63), + buf(128 | u & 63)) + : (buf + (224 | u >>> 12 | 0), + buf(128 | (u >>> 6 | 0) & 63), + buf(128 | u & 63)) + : (buf(192 | u >>> 6 | 0), buf(128 | u & 63)) + : buf(u); + return _y_; + } + catch(_z_){ + var _x_ = caml_wrap_exception(_z_); + if(_x_[1] === Stdlib[7]) throw caml_maybe_attach_backtrace(Full, 1); + throw caml_maybe_attach_backtrace(_x_, 0); + } + } + function clear(b){return caml_call1(Stdlib_Buffer[8], b);} + var + contents = Stdlib_Buffer[2], + length$0 = Stdlib_Buffer[7], + Buffer = [0, Full, create, add_uchar, clear, contents, length$0], + include = Make(String, Buffer), + ns_xml = include[31], + ns_xmlns = include[32], + Error = include[53], + error_message = include[54], + make_input = include[65], + eoi = include[106], + peek = include[107], + input = include[108], + input_tree = include[109], + input_doc_tree = include[110], + pos = include[111], + make_output = include[117], + output_depth = include[118], + output = include[127], + output_tree = include[128], + output_doc_tree = include[129], + pp = Stdlib_Format[129]; + function pp_name(ppf, param){ + var l = param[2], p = param[1]; + return runtime.caml_string_notequal(p, cst$25) + ? caml_call4(pp, ppf, _h_, p, l) + : caml_call3(pp, ppf, _i_, l); + } + function pp_attribute(ppf, param){ + var v = param[2], n = param[1]; + return caml_call5(pp, ppf, _j_, pp_name, n, v); + } + function pp_tag(ppf, param){ + var atts = param[2], name = param[1]; + return caml_call6 + (pp, + ppf, + _l_, + pp_name, + name, + function(ppf, param$0){ + var param = param$0; + for(;;){ + if(! param) return 0; + var vs = param[2], v = param[1]; + pp_attribute(ppf, v); + var _w_ = 0 !== vs ? 1 : 0; + if(! _w_) return _w_; + caml_call2(pp, ppf, _k_); + var param = vs; + } + }, + atts); + } + function pp_dtd(ppf, param){ + if(! param) return caml_call2(pp, ppf, _n_); + var dtd = param[1]; + return caml_call3(pp, ppf, _m_, dtd); + } + function pp_signal(ppf, param){ + if(typeof param === "number") return caml_call2(pp, ppf, _o_); + var _v_ = param[1]; + if(3407540 === _v_){ + var dtd = param[2]; + return caml_call4(pp, ppf, _p_, pp_dtd, dtd); + } + if(758940234 <= _v_){ + var s = param[2]; + return caml_call3(pp, ppf, _q_, s); + } + var tag = param[2]; + return caml_call4(pp, ppf, _r_, pp_tag, tag); + } + var + Xmlm = + [0, + ns_xml, + ns_xmlns, + pp_dtd, + pp_name, + pp_attribute, + pp_tag, + pp_signal, + error_message, + Error, + make_input, + input, + input_tree, + input_doc_tree, + peek, + eoi, + pos, + make_output, + output, + output_depth, + output_tree, + output_doc_tree, + function(_t_, _s_){ + var _u_ = Make(_t_, _s_); + return [0, + _u_[31], + _u_[32], + _u_[53], + _u_[54], + _u_[65], + _u_[108], + _u_[109], + _u_[110], + _u_[107], + _u_[106], + _u_[111], + _u_[117], + _u_[118], + _u_[127], + _u_[128], + _u_[129]]; + }]; + runtime.caml_register_global(112, Xmlm, "Xmlm"); + return; + } + (globalThis)); + + +//# 1 "../.js/default/js_of_ocaml-compiler.runtime/jsoo_runtime.cma.js" +// Generated by js_of_ocaml +//# 3 "../.js/default/js_of_ocaml-compiler.runtime/jsoo_runtime.cma.js" + +//# 18 "../.js/default/js_of_ocaml-compiler.runtime/jsoo_runtime.cma.js" +(function(globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + s = "5.2.0", + git_version = "0e29f0e-dirty", + Jsoo_runtime_Runtime_version = [0, s, git_version]; + runtime.caml_register_global + (2, Jsoo_runtime_Runtime_version, "Jsoo_runtime__Runtime_version"); + return; + } + (globalThis)); + +//# 33 "../.js/default/js_of_ocaml-compiler.runtime/jsoo_runtime.cma.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + Jsoo_runtime_Runtime_version = global_data.Jsoo_runtime__Runtime_version, + Stdlib_Callback = global_data.Stdlib__Callback, + Js = [0], + Config = [0], + version = Jsoo_runtime_Runtime_version[1], + git_version = Jsoo_runtime_Runtime_version[2], + Sys = [0, Config, version, git_version], + Exn = [248, "Jsoo_runtime.Error.Exn", runtime.caml_fresh_oo_id(0)]; + caml_call2(Stdlib_Callback[2], "jsError", [0, Exn, [0]]); + function raise(exn){throw exn;} + var + Error = + [0, + raise, + runtime.caml_exn_with_js_backtrace, + runtime.caml_js_error_option_of_exception, + Exn], + For_compatibility_only = [0], + Bigstring = [0], + Typed_array = [0, Bigstring], + Int64 = [0], + Jsoo_runtime = + [0, Js, Sys, Error, For_compatibility_only, Typed_array, Int64]; + runtime.caml_register_global(5, Jsoo_runtime, "Jsoo_runtime"); + return; + } + (globalThis)); + + +//# 1 "../.js/default/js_of_ocaml/js_of_ocaml.cma.js" +// Generated by js_of_ocaml +//# 3 "../.js/default/js_of_ocaml/js_of_ocaml.cma.js" + +//# 19 "../.js/default/js_of_ocaml/js_of_ocaml.cma.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + global_data = runtime.caml_get_global_data(), + Stdlib_String = global_data.Stdlib__String, + Stdlib_Char = global_data.Stdlib__Char, + Poly = [0]; + function max(x, y){return y <= x ? x : y;} + function min(x, y){return x <= y ? x : y;} + var + Int_replace_polymorphic_compar = [0, max, min], + make = Stdlib_String[1], + init = Stdlib_String[2], + empty = Stdlib_String[3], + of_bytes = Stdlib_String[4], + to_bytes = Stdlib_String[5], + concat = Stdlib_String[6], + cat = Stdlib_String[7], + compare = Stdlib_String[9], + starts_with = Stdlib_String[10], + ends_with = Stdlib_String[11], + contains_from = Stdlib_String[12], + rcontains_from = Stdlib_String[13], + contains = Stdlib_String[14], + sub = Stdlib_String[15], + split_on_char = Stdlib_String[16], + map = Stdlib_String[17], + mapi = Stdlib_String[18], + fold_left = Stdlib_String[19], + fold_right = Stdlib_String[20], + for_all = Stdlib_String[21], + exists = Stdlib_String[22], + trim = Stdlib_String[23], + escaped = Stdlib_String[24], + uppercase_ascii = Stdlib_String[25], + lowercase_ascii = Stdlib_String[26], + capitalize_ascii = Stdlib_String[27], + uncapitalize_ascii = Stdlib_String[28], + iter = Stdlib_String[29], + iteri = Stdlib_String[30], + index_from = Stdlib_String[31], + index_from_opt = Stdlib_String[32], + rindex_from = Stdlib_String[33], + rindex_from_opt = Stdlib_String[34], + index = Stdlib_String[35], + index_opt = Stdlib_String[36], + rindex = Stdlib_String[37], + rindex_opt = Stdlib_String[38], + to_seq = Stdlib_String[39], + to_seqi = Stdlib_String[40], + of_seq = Stdlib_String[41], + get_utf_8_uchar = Stdlib_String[42], + is_valid_utf_8 = Stdlib_String[43], + get_utf_16be_uchar = Stdlib_String[44], + is_valid_utf_16be = Stdlib_String[45], + get_utf_16le_uchar = Stdlib_String[46], + is_valid_utf_16le = Stdlib_String[47], + blit = Stdlib_String[48], + copy = Stdlib_String[49], + fill = Stdlib_String[50], + uppercase = Stdlib_String[51], + lowercase = Stdlib_String[52], + capitalize = Stdlib_String[53], + uncapitalize = Stdlib_String[54], + get_uint8 = Stdlib_String[55], + get_int8 = Stdlib_String[56], + get_uint16_ne = Stdlib_String[57], + get_uint16_be = Stdlib_String[58], + get_uint16_le = Stdlib_String[59], + get_int16_ne = Stdlib_String[60], + get_int16_be = Stdlib_String[61], + get_int16_le = Stdlib_String[62], + get_int32_ne = Stdlib_String[63], + get_int32_be = Stdlib_String[64], + get_int32_le = Stdlib_String[65], + get_int64_ne = Stdlib_String[66], + get_int64_be = Stdlib_String[67], + get_int64_le = Stdlib_String[68], + equal = runtime.caml_string_equal, + String = + [0, + make, + init, + empty, + of_bytes, + to_bytes, + concat, + cat, + compare, + starts_with, + ends_with, + contains_from, + rcontains_from, + contains, + sub, + split_on_char, + map, + mapi, + fold_left, + fold_right, + for_all, + exists, + trim, + escaped, + uppercase_ascii, + lowercase_ascii, + capitalize_ascii, + uncapitalize_ascii, + iter, + iteri, + index_from, + index_from_opt, + rindex_from, + rindex_from_opt, + index, + index_opt, + rindex, + rindex_opt, + to_seq, + to_seqi, + of_seq, + get_utf_8_uchar, + is_valid_utf_8, + get_utf_16be_uchar, + is_valid_utf_16be, + get_utf_16le_uchar, + is_valid_utf_16le, + blit, + copy, + fill, + uppercase, + lowercase, + capitalize, + uncapitalize, + get_uint8, + get_int8, + get_uint16_ne, + get_uint16_be, + get_uint16_le, + get_int16_ne, + get_int16_be, + get_int16_le, + get_int32_ne, + get_int32_be, + get_int32_le, + get_int64_ne, + get_int64_be, + get_int64_le, + equal], + chr = Stdlib_Char[1], + escaped$0 = Stdlib_Char[2], + lowercase$0 = Stdlib_Char[3], + uppercase$0 = Stdlib_Char[4], + lowercase_ascii$0 = Stdlib_Char[5], + uppercase_ascii$0 = Stdlib_Char[6], + compare$0 = Stdlib_Char[7]; + function equal$0(x, y){return x === y ? 1 : 0;} + var + Char = + [0, + chr, + escaped$0, + lowercase$0, + uppercase$0, + lowercase_ascii$0, + uppercase_ascii$0, + compare$0, + equal$0], + max$0 = Int_replace_polymorphic_compar[1], + min$0 = Int_replace_polymorphic_compar[2], + Js_of_ocaml_Import = + [0, Poly, Int_replace_polymorphic_compar, String, Char, max$0, min$0]; + runtime.caml_register_global(2, Js_of_ocaml_Import, "Js_of_ocaml__Import"); + return; + } + (globalThis)); + +//# 200 "../.js/default/js_of_ocaml/js_of_ocaml.cma.js" +(function + (globalThis){ + "use strict"; + var + jsoo_exports = typeof module === "object" && module.exports || globalThis, + runtime = globalThis.jsoo_runtime, + cst_parseFloat$0 = "parseFloat", + cst_parseInt$0 = "parseInt", + caml_js_get = runtime.caml_js_get, + caml_js_set = runtime.caml_js_set, + caml_js_wrap_callback = runtime.caml_js_wrap_callback, + caml_string_of_jsstring = runtime.caml_string_of_jsstring; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + Js_of_ocaml_Import = global_data.Js_of_ocaml__Import, + Stdlib = global_data.Stdlib, + Jsoo_runtime = global_data.Jsoo_runtime, + Stdlib_Printexc = global_data.Stdlib__Printexc, + global = globalThis, + Unsafe = [0, global], + null$0 = null, + undefined$0 = undefined, + cst_function = "function", + cst_parseFloat = cst_parseFloat$0, + cst_parseInt = cst_parseInt$0; + function return$0(_z_){return _z_;} + function map(x, f){return x == null$0 ? null$0 : caml_call1(f, x);} + function bind(x, f){return x == null$0 ? null$0 : caml_call1(f, x);} + function test(x){return 1 - (x == null$0 ? 1 : 0);} + function iter(x, f){ + var _y_ = 1 - (x == null$0 ? 1 : 0); + return _y_ ? caml_call1(f, x) : _y_; + } + function case$0(x, f, g){ + return x == null$0 ? caml_call1(f, 0) : caml_call1(g, x); + } + function get(x, f){return x == null$0 ? caml_call1(f, 0) : x;} + function option(x){if(! x) return null$0; var x$0 = x[1]; return x$0;} + function to_option(x){ + function _x_(x){return [0, x];} + return case$0(x, function(param){return 0;}, _x_); + } + var + Opt = + [0, + null$0, + return$0, + map, + bind, + test, + iter, + case$0, + get, + option, + to_option]; + function return$1(_w_){return _w_;} + function map$0(x, f){ + return x === undefined$0 ? undefined$0 : caml_call1(f, x); + } + function bind$0(x, f){ + return x === undefined$0 ? undefined$0 : caml_call1(f, x); + } + function test$0(x){return x !== undefined$0 ? 1 : 0;} + function iter$0(x, f){ + var _v_ = x !== undefined$0 ? 1 : 0; + return _v_ ? caml_call1(f, x) : _v_; + } + function case$1(x, f, g){ + return x === undefined$0 ? caml_call1(f, 0) : caml_call1(g, x); + } + function get$0(x, f){return x === undefined$0 ? caml_call1(f, 0) : x;} + function option$0(x){ + if(! x) return undefined$0; + var x$0 = x[1]; + return x$0; + } + function to_option$0(x){ + function _u_(x){return [0, x];} + return case$1(x, function(param){return 0;}, _u_); + } + var + Optdef = + [0, + undefined$0, + return$1, + map$0, + bind$0, + test$0, + iter$0, + case$1, + get$0, + option$0, + to_option$0]; + function coerce(x, f, g){ + function _s_(param){return caml_call1(g, x);} + var _t_ = caml_call1(f, x); + return caml_call2(Opt[8], _t_, _s_); + } + function coerce_opt(x, f, g){ + function _q_(param){return caml_call1(g, x);} + var _r_ = caml_call2(Opt[4], x, f); + return caml_call2(Opt[8], _r_, _q_); + } + var + true$0 = true, + false$0 = false, + nfc = "NFC", + nfd = "NFD", + nfkc = "NFKC", + nfkd = "NFKD", + t0 = Unsafe[1], + string_constr = t0.String, + t1 = Unsafe[1], + regExp = t1.RegExp, + t2 = Unsafe[1], + object_constructor = t2.Object; + function object_keys(o){return object_constructor.keys(o);} + var + t5 = Unsafe[1], + array_constructor = t5.Array, + array_get = caml_js_get, + array_set = caml_js_set; + function array_map(f, a){ + return a.map + (caml_js_wrap_callback + (function(x, idx, param){return caml_call1(f, x);})); + } + function array_mapi(f, a){ + return a.map + (caml_js_wrap_callback + (function(x, idx, param){return caml_call2(f, idx, x);})); + } + function str_array(_p_){return _p_;} + function match_result(_o_){return _o_;} + var + t8 = Unsafe[1], + date_constr = t8.Date, + t9 = Unsafe[1], + math = t9.Math, + t10 = Unsafe[1], + error_constr = t10.Error, + include = Jsoo_runtime[3], + raise = include[1], + exn_with_js_backtrace = include[2], + of_exn = include[3], + Error = include[4]; + function name(t11){return caml_string_of_jsstring(t11.name);} + function message(t12){return caml_string_of_jsstring(t12.message);} + function stack(t13){ + var _n_ = caml_call2(Opt[3], t13.stack, caml_string_of_jsstring); + return caml_call1(Opt[10], _n_); + } + function to_string(e){return caml_string_of_jsstring(e.toString());} + function raise_js_error(e){return caml_call1(raise, e);} + function string_of_error(e){return to_string(e);} + var t15 = Unsafe[1], JSON = t15.JSON; + function decodeURI(s){var t16 = Unsafe[1]; return t16.decodeURI(s);} + function decodeURIComponent(s){ + var t17 = Unsafe[1]; + return t17.decodeURIComponent(s); + } + function encodeURI(s){var t18 = Unsafe[1]; return t18.encodeURI(s);} + function encodeURIComponent(s){ + var t19 = Unsafe[1]; + return t19.encodeURIComponent(s); + } + function escape(s){var t20 = Unsafe[1]; return t20.escape(s);} + function unescape(s){var t21 = Unsafe[1]; return t21.unescape(s);} + function isNaN(i){var t22 = Unsafe[1]; return t22.isNaN(i) | 0;} + function parseInt(s){ + var t23 = Unsafe[1], s$0 = t23.parseInt(s); + return isNaN(s$0) ? caml_call1(Stdlib[2], cst_parseInt) : s$0; + } + function parseFloat(s){ + var t24 = Unsafe[1], s$0 = t24.parseFloat(s); + return isNaN(s$0) ? caml_call1(Stdlib[2], cst_parseFloat) : s$0; + } + function _a_(param){ + if(param[1] !== Error) return 0; + var e = param[2]; + return [0, to_string(e)]; + } + caml_call1(Stdlib_Printexc[9], _a_); + function _b_(e){ + return e instanceof array_constructor + ? 0 + : [0, caml_string_of_jsstring(e.toString())]; + } + caml_call1(Stdlib_Printexc[9], _b_); + function export_js(field, x){ + var _l_ = caml_string_of_jsstring(typeof x), switch$0 = 0; + if + (caml_call2(Js_of_ocaml_Import[3][68], _l_, cst_function) && 0 < x.length){var _m_ = caml_js_wrap_callback(x); switch$0 = 1;} + if(! switch$0) var _m_ = x; + return jsoo_exports[field] = _m_; + } + function export$0(field, x){ + return export_js(runtime.caml_jsstring_of_string(field), x); + } + function export_all(obj){ + var keys = object_keys(obj); + return keys.forEach + (caml_js_wrap_callback + (function(key, param, _k_){return export_js(key, obj[key]);})); + } + var _c_ = runtime.caml_js_error_of_exception; + function _d_(_j_){return _j_;} + var + _e_ = + [0, + to_string, + name, + message, + stack, + raise, + exn_with_js_backtrace, + of_exn, + Error, + function(_i_){return _i_;}, + _d_]; + function _f_(_h_){return _h_;} + var + Js_of_ocaml_Js = + [0, + null$0, + function(_g_){return _g_;}, + undefined$0, + _f_, + Opt, + Optdef, + true$0, + false$0, + nfd, + nfc, + nfkd, + nfkc, + string_constr, + regExp, + regExp, + regExp, + object_keys, + array_constructor, + array_constructor, + array_get, + array_set, + array_map, + array_mapi, + str_array, + match_result, + date_constr, + date_constr, + date_constr, + date_constr, + date_constr, + date_constr, + date_constr, + date_constr, + date_constr, + math, + error_constr, + _e_, + JSON, + decodeURI, + decodeURIComponent, + encodeURI, + encodeURIComponent, + escape, + unescape, + isNaN, + parseInt, + parseFloat, + coerce, + coerce_opt, + export$0, + export_all, + Unsafe, + string_of_error, + raise_js_error, + exn_with_js_backtrace, + _c_, + Error]; + runtime.caml_register_global(43, Js_of_ocaml_Js, "Js_of_ocaml__Js"); + return; + } + (globalThis)); + + +//# 1 ".xml2js.eobjs/jsoo/dune__exe.cmo.js" +// Generated by js_of_ocaml +//# 3 ".xml2js.eobjs/jsoo/dune__exe.cmo.js" + +//# 5 ".xml2js.eobjs/jsoo/dune__exe.cmo.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime, Dune_exe = [0]; + runtime.caml_register_global(0, Dune_exe, "Dune__exe"); + return; + } + (globalThis)); + + +//# 1 ".xml2js.eobjs/jsoo/dune__exe__Parser.cmo.js" +// Generated by js_of_ocaml +//# 3 ".xml2js.eobjs/jsoo/dune__exe__Parser.cmo.js" + +//# 6 ".xml2js.eobjs/jsoo/dune__exe__Parser.cmo.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function caml_call3(f, a0, a1, a2){ + return (f.l >= 0 ? f.l : f.l = f.length) == 3 + ? f(a0, a1, a2) + : runtime.caml_call_gen(f, [a0, a1, a2]); + } + function caml_call5(f, a0, a1, a2, a3, a4){ + return (f.l >= 0 ? f.l : f.l = f.length) == 5 + ? f(a0, a1, a2, a3, a4) + : runtime.caml_call_gen(f, [a0, a1, a2, a3, a4]); + } + var global_data = runtime.caml_get_global_data(), Xmlm = global_data.Xmlm; + function parse(data){ + var + input = caml_call5(Xmlm[10], 0, 0, 0, 0, [0, -976970511, [0, 0, data]]); + function el(tag, subtrees){return [0, tag, subtrees];} + function data$0(text){return [1, text];} + var doc_tree = caml_call3(Xmlm[13], el, data$0, input)[2]; + return doc_tree; + } + var Dune_exe_Parser = [0, parse]; + runtime.caml_register_global(1, Dune_exe_Parser, "Dune__exe__Parser"); + return; + } + (globalThis)); + + +//# 1 ".xml2js.eobjs/jsoo/dune__exe__Xml2js.cmo.js" +// Generated by js_of_ocaml +//# 3 ".xml2js.eobjs/jsoo/dune__exe__Xml2js.cmo.js" + +//# 6 ".xml2js.eobjs/jsoo/dune__exe__Xml2js.cmo.js" +(function + (globalThis){ + "use strict"; + var + runtime = globalThis.jsoo_runtime, + cst$2 = "", + cst_foo = "foo", + caml_js_wrap_meth_callback = runtime.caml_js_wrap_meth_callback, + caml_string_notequal = runtime.caml_string_notequal; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + function caml_call2(f, a0, a1){ + return (f.l >= 0 ? f.l : f.l = f.length) == 2 + ? f(a0, a1) + : runtime.caml_call_gen(f, [a0, a1]); + } + var + global_data = runtime.caml_get_global_data(), + cst$0 = ":", + cst$1 = "$", + cst = "_", + Stdlib_List = global_data.Stdlib__List, + Stdlib_Array = global_data.Stdlib__Array, + Dune_exe_Parser = global_data.Dune__exe__Parser, + Js_of_ocaml_Js = global_data.Js_of_ocaml__Js; + global_data.CamlinternalOO; + var + Stdlib = global_data.Stdlib, + Stdlib_Option = global_data.Stdlib__Option, + Stdlib_String = global_data.Stdlib__String, + _f_ = [0, cst_foo], + _e_ = [1, 42], + _d_ = [2, 23.], + _c_ = [4, [0, [1, 42], 0]], + _b_ = [3, [0, [0, cst_foo, [0, "bar"]], 0]], + cst_TODO_parsing_error = "TODO parsing error", + _a_ = [0, "TODO, unclear semantics"]; + function js_of_json(param){ + switch(param[0]){ + case 0: + var s = param[1]; return runtime.caml_jsstring_of_string(s); + case 1: + var i = param[1]; return i; + case 2: + var f = param[1]; return f; + case 3: + var + content = param[1], + _q_ = + function(param){ + var v = param[2], key = param[1], v$0 = js_of_json(v); + return [0, key, v$0]; + }, + _r_ = caml_call1(caml_call1(Stdlib_List[19], _q_), content), + content$0 = caml_call1(Stdlib_Array[12], _r_); + return runtime.caml_js_object(content$0); + default: + var + content$1 = param[1], + _s_ = caml_call1(caml_call1(Stdlib_List[19], js_of_json), content$1), + content$2 = + runtime.caml_js_from_array(caml_call1(Stdlib_Array[12], _s_)); + return content$2; + } + } + function t7(param, str, cb){ + try{var tree$0 = caml_call1(Dune_exe_Parser[1], str);} + catch(_p_){ + var _g_ = Js_of_ocaml_Js[1]; + return cb(caml_call1(Js_of_ocaml_Js[2], cst_TODO_parsing_error), _g_); + } + function convert(param$0){ + if(0 !== param$0[0]){ + var + s = param$0[1], + match$0 = + caml_string_notequal(caml_call1(Stdlib_String[23], s), cst$2) ? 0 : 1; + return match$0 ? 0 : [0, [0, s]]; + } + var + subtrees = param$0[2], + tag = param$0[1], + attrs = tag[2], + tag_name = tag[1], + tag_name_local = tag_name[2], + tag_name_uri = tag_name[1]; + if(caml_string_notequal(tag_name_uri, cst$2)) + var + _k_ = caml_call2(Stdlib[28], cst$0, tag_name_local), + out_name = caml_call2(Stdlib[28], tag_name_uri, _k_); + else + var out_name = tag_name_local; + if(attrs) + var + _l_ = + function(param){ + var value = param[2], local = param[1][2]; + return [0, local, [0, value]]; + }, + _m_ = caml_call1(caml_call1(Stdlib_List[19], _l_), attrs), + attributes = caml_call1(Stdlib_Option[2], _m_); + else + var attributes = 0; + var subtrees$0 = caml_call2(Stdlib_List[22], convert, subtrees); + if(attributes) + var + attributes$0 = attributes[1], + temp = [3, [0, [0, cst$1, [3, attributes$0]], 0]], + subtrees$1 = [0, temp, subtrees$0]; + else + var subtrees$1 = subtrees$0; + function _i_(param){ + switch(param[0]){ + case 3: + var _o_ = param[1]; + if(_o_ && ! _o_[2]){ + var match = _o_[1], v = match[2], k = match[1]; + return [0, [0, k, v]]; + } + break; + case 4: break; + default: return [0, [0, cst, param]]; + } + return 0; + } + var names = caml_call2(Stdlib_List[19], _i_, subtrees$1); + if(caml_call2(Stdlib_List[32], Stdlib_Option[11], names)){ + var + _j_ = function(_n_){return _n_;}, + kvs = caml_call2(Stdlib_List[22], _j_, names), + opt = 0, + param = kvs; + for(;;){ + if(opt) var sth = opt[1], acc = sth; else var acc = 0; + if(param){ + var xs = param[2], k = param[1][1]; + if(! caml_call2(Stdlib_List[36], k, acc)){ + var opt$0 = [0, [0, k, acc]], opt = opt$0, param = xs; + continue; + } + var match = 0; + } + else + var match = 1; + var subtrees$2 = match ? [3, kvs] : [4, subtrees$1]; + break; + } + } + else + var subtrees$2 = [4, subtrees$1]; + return [0, [3, [0, [0, out_name, subtrees$2], 0]]]; + } + var match = convert(tree$0); + if(match) var json = match[1], json$0 = json; else var json$0 = _a_; + var tree = js_of_json(json$0), _h_ = caml_call1(Js_of_ocaml_Js[2], tree); + return cb(Js_of_ocaml_Js[1], _h_); + } + function t6(param){return js_of_json(_b_);} + function t5(param){return js_of_json(_c_);} + function t4(param){return js_of_json(_d_);} + function t3(param){return js_of_json(_e_);} + function t2(param){return js_of_json(_f_);} + caml_call1 + (Js_of_ocaml_Js[51], + {test1: caml_js_wrap_meth_callback(t2), + test2: caml_js_wrap_meth_callback(t3), + test3: caml_js_wrap_meth_callback(t4), + test4: caml_js_wrap_meth_callback(t5), + test5: caml_js_wrap_meth_callback(t6), + parseString: caml_js_wrap_meth_callback(t7)}); + var Dune_exe_Xml2js = [0]; + runtime.caml_register_global(29, Dune_exe_Xml2js, "Dune__exe__Xml2js"); + return; + } + (globalThis)); + + +//# 1 "../.js/default/stdlib/std_exit.cmo.js" +// Generated by js_of_ocaml +//# 3 "../.js/default/stdlib/std_exit.cmo.js" + +//# 6 "../.js/default/stdlib/std_exit.cmo.js" +(function + (globalThis){ + "use strict"; + var runtime = globalThis.jsoo_runtime; + function caml_call1(f, a0){ + return (f.l >= 0 ? f.l : f.l = f.length) == 1 + ? f(a0) + : runtime.caml_call_gen(f, [a0]); + } + var + global_data = runtime.caml_get_global_data(), + Stdlib = global_data.Stdlib; + caml_call1(Stdlib[103], 0); + var Std_exit = [0]; + runtime.caml_register_global(1, Std_exit, "Std_exit"); + return; + } + (globalThis)); + + +//# sourceMappingURL=data:application/json;base64,ey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Vsc2UgdCArPSBzLnNsaWNlKGksIGopO1xuICAgICAgaWYgKGogPT0gbCkgYnJlYWs7XG4gICAgICBpID0gajtcbiAgICB9XG4gICAgdiA9IDE7XG4gICAgaWYgKCgrK2kgPCBsKSAmJiAoKChjMiA9IHMuY2hhckNvZGVBdChpKSkgJiAtNjQpID09IDEyOCkpIHtcbiAgICAgIGMgPSBjMiArIChjMSA8PCA2KTtcbiAgICAgIGlmIChjMSA8IDB4ZTApIHtcbiAgICAgICAgdiA9IGMgLSAweDMwODA7XG4gICAgICAgIGlmICh2IDwgMHg4MCkgdiA9IDE7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2ID0gMjtcbiAgICAgICAgaWYgKCgrK2kgPCBsKSAmJiAoKChjMiA9IHMuY2hhckNvZGVBdChpKSkgJiAtNjQpID09IDEyOCkpIHtcbiAgICAgICAgICBjID0gYzIgKyAoYyA8PCA2KTtcbiAgICAgICAgICBpZiAoYzEgPCAweGYwKSB7XG4gICAgICAgICAgICB2ID0gYyAtIDB4ZTIwODA7XG4gICAgICAgICAgICBpZiAoKHYgPCAweDgwMCkgfHwgKCh2ID49IDB4ZDdmZikgJiYgKHYgPCAweGUwMDApKSkgdiA9IDI7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHYgPSAzO1xuICAgICAgICAgICAgaWYgKCgrK2kgPCBsKSAmJiAoKChjMiA9IHMuY2hhckNvZGVBdChpKSkgJiAtNjQpID09IDEyOCkgJiZcbiAgICAgICAgICAgICAgICAoYzEgPCAweGY1KSkge1xuICAgICAgICAgICAgICB2ID0gYzIgLSAweDNjODIwODAgKyAoYyA8PCA2KTtcbiAgICAgICAgICAgICAgaWYgKHYgPCAweDEwMDAwIHx8IHYgPiAweDEwZmZmZikgdiA9IDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGlmICh2IDwgNCkgeyAvLyBJbnZhbGlkIHNlcXVlbmNl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A6IGZpbGVfcGVybTsgICAgICAgICgqKiBBY2Nlc3MgcmlnaHRzICopXG4gICAqICAgIHN0X25saW5rIDogaW50OyAgICAgICAgICAgICAoKiogTnVtYmVyIG9mIGxpbmtzICopXG4gICAqICAgIHN0X3VpZCA6IGludDsgICAgICAgICAgICAgICAoKiogVXNlciBpZCBvZiB0aGUgb3duZXIgKilcbiAgICogICAgc3RfZ2lkIDogaW50OyAgICAgICAgICAgICAgICgqKiBHcm91cCBJRCBvZiB0aGUgZmlsZSdzIGdyb3VwICopXG4gICAqICAgIHN0X3JkZXYgOiBpbnQ7ICAgICAgICAgICAgICAoKiogRGV2aWNlIElEIChpZiBzcGVjaWFsIGZpbGUpICopXG4gICAqICAgIHN0X3NpemUgOiBpbnQ7ICAgICAgICAgICAgICAoKiogU2l6ZSBpbiBieXRlcyAqKVxuICAgKiAgICBzdF9hdGltZSA6IGZsb2F0OyAgICAgICAgICAgKCoqIExhc3QgYWNjZXNzIHRpbWUgKilcbiAgICogICAgc3RfbXRpbWUgOiBmbG9hdDsgICAgICAgICAgICgqKiBMYXN0IG1vZGlmaWNhdGlvbiB0aW1lICopXG4gICAqICAgIHN0X2N0aW1lIDogZmxvYXQ7ICAgICAgICAgICAoKiogTGFzdCBzdGF0dXMgY2hhbmdlIHRpbWUgKilcbiAgICogIH1cbiAgICovXG4gIHJldHVybiBCTE9DSyhcbiAgICAwLFxuICAgIGpzX3N0YXRzLmRldixcbiAgICBqc19zdGF0cy5pbm8sXG4gICAgZmlsZV9raW5kLFxuICAgIGpzX3N0YXRzLm1vZGUsXG4gICAganNfc3RhdHMubmxpbmssXG4gICAganNfc3RhdHMudWlkLFxuICAgIGpzX3N0YXRzLmdpZCxcbiAgICBqc19zdGF0cy5yZGV2LFxuICAgIGpzX3N0YXRzLnNpemUsXG4gICAganNfc3RhdHMuYXRpbWVNcyxcbiAgICBqc19zdGF0cy5tdGltZU1zLFxuICAgIGpzX3N0YXRzLmN0aW1lTXNcbiAgKTtcbn1cblx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ICAgMHgwNCxcbiAgQ09ERV9TSEFSRUQxNjogICAgICAgICAgICAgIDB4MDUsXG4gIENPREVfU0hBUkVEMzI6ICAgICAgICAgICAgICAweDA2LFxuICBDT0RFX0JMT0NLMzI6ICAgICAgICAgICAgICAgMHgwOCxcbiAgQ09ERV9CTE9DSzY0OiAgICAgICAgICAgICAgIDB4MTMsXG4gIENPREVfU1RSSU5HODogICAgICAgICAgICAgICAweDA5LFxuICBDT0RFX1NUUklORzMyOiAgICAgICAgICAgICAgMHgwQSxcbiAgQ09ERV9ET1VCTEVfQklHOiAgICAgICAgICAgIDB4MEIsXG4gIENPREVfRE9VQkxFX0xJVFRMRTogICAgICAgICAweDBDLFxuICBDT0RFX0RPVUJMRV9BUlJBWThfQklHOiAgICAgMHgwRCxcbiAgQ09ERV9ET1VCTEVfQVJSQVk4X0xJVFRMRTogIDB4MEUsXG4gIENPREVfRE9VQkxFX0FSUkFZMzJfQklHOiAgICAweDBGLFxuICBDT0RFX0RPVUJMRV9BUlJBWTMyX0xJVFRMRTogMHgwNyxcbiAgQ09ERV9DT0RFUE9JTlRFUjogICAgICAgICAgIDB4MTAsXG4gIENPREVfSU5GSVhQT0lOVEVSOiAgICAgICAgICAweDExLFxuICBDT0RFX0NVU1RPTTogICAgICAgICAgICAgICAgMHgxMixcbiAgQ09ERV9DVVNUT01fTEVOOiAgICAgICAgICAgIDB4MTgsXG4gIENPREVfQ1VTVE9NX0ZJWEVEOiAgICAgICAgICAweDE5XG59XG5cblxuLy9Qcm92aWRlczogVUludDhBcnJheVJlYWRlclxuLy9SZXF1aXJlczogY2FtbF9zdHJpbmdfb2ZfYXJyYXksIGNhbWxfanNieXRlc19vZl9zdHJpbmdcbmZ1bmN0aW9uIFVJbnQ4QXJyYXlSZWFkZXIgKHMsIGkpIHsgdGhpcy5zID0gczsgdGhpcy5pID0gaTsgfVxuVUludDhBcnJheVJlYWRlci5wcm90b3R5cGUgPSB7XG4gIHJlYWQ4dTpmdW5jdGlvbiAoKSB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2O1xuICAgICAgICBpZiAoaW50ZXJuX29ial90YWJsZSkgaW50ZXJuX29ial90YWJsZVtvYmpfY291bnRlcisrXSA9IHY7XG4gICAgICAgIHN0YWNrLnB1c2godiwgc2l6ZSk7XG4gICAgICAgIHJldHVybiB2O1xuICAgICAgfSBlbHNlXG4gICAgICAgIHJldHVybiAoY29kZSAmIDB4M0YpO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoY29kZSA+PSAweDIwLypjc3QuUFJFRklYX1NNQUxMX1NUUklORyAqLykge1xuICAgICAgICB2YXIgbGVuID0gY29kZSAmIDB4MUY7XG4gICAgICAgIHZhciB2ID0gcmVhZGVyLnJlYWRzdHIgKGxlbik7XG4gICAgICAgIGlmIChpbnRlcm5fb2JqX3RhYmxlKSBpbnRlcm5fb2JqX3RhYmxlW29ial9jb3VudGVyKytdID0gdjtcbiAgICAgICAgcmV0dXJuIHY7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBzd2l0Y2goY29kZSkge1xuICAgICAgICBjYXNlIDB4MDA6IC8vY3N0LkNPREVfSU5UODpcbiAgICAgICAgICByZXR1cm4gcmVhZGVyLnJlYWQ4cyAoKTtcbiAgICAgICAgY2FzZSAweDAxOiAvL2NzdC5DT0RFX0lOVDE2OlxuICAgICAgICAgIHJldHVybiByZWFkZXIucmVhZDE2cyAoKTtcbiAgICAgICAgY2FzZSAweDAyOiAvL2NzdC5DT0RFX0lOVDMyOlxuICAgICAgICAgIHJldHVybiByZWFkZXIucmVhZDMycyAoKTtcbiAgICAgICAgY2FzZSAweDAzOiAvL2NzdC5DT0RFX0lOVDY0OlxuICAgICAgICAgIGNhbWxfZmFpbHdpdGgoXCJpbnB1dF92YWx1ZTogaW50ZWdlciB0b28gbGFyZ2VcIik7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMHgwNDogLy9jc3QuQ09ERV9TSEFSRUQ4OlxuICAgICAgICAgIHZhciBvZmZzZXQgPSByZWFkZXIucmVhZDh1ICg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weDEzOiAvL2NzdC5DT0RFX0JMT0NLNjQ6XG4gICAgICAgICAgY2FtbF9mYWlsd2l0aCAoXCJpbnB1dF92YWx1ZTogZGF0YSBibG9jayB0b28gbGFyZ2VcIik7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgMHgwOTogLy9jc3QuQ09ERV9TVFJJTkc4OlxuICAgICAgICAgIHZhciBsZW4gPSByZWFkZXIucmVhZDh1KCk7XG4gICAgICAgICAgdmFyIHYgPSByZWFkZXIucmVhZHN0ciAobGVuKTtcbiAgICAgICAgICBpZiAoaW50ZXJuX29ial90YWJsZSkgaW50ZXJuX29ial90YWJsZVtvYmpfY291bnRlcisrXSA9IHY7XG4gICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgIGNhc2UgMHgwQTogLy9jc3QuQ09ERV9TVFJJTkczMjpcbiAgICAgICAgICB2YXIgbGVuID0gcmVhZGVyLnJlYWQzMnUoKTtcbiAgICAgICAgICB2YXIgdiA9IHJlYWRlci5yZWFkc3RyIChsZW4pO1xuICAgICAgICAgIGlmIChpbnRlcm5fb2JqX3RhYmxlKSBpbnRlcm5fb2JqX3RhYmxlW29ial9jb3VudGVyKytdID0gdjtcbiAgICAgICAgICByZXR1cm4gdjtcbiAgICAgICAgY2FzZSAweDBDOiAvL2NzdC5DT0RFX0RPVUJMRV9MSVRUTEU6XG4gICAgICAgICAgdmFyIHQgPSBuZXcgQXJyYXkoOCk7O1xuICAgICAgICAgIGZvciAodmFyIGkgPSAwO2kgPCA4O2krKykgdFs3IC0gaV0gPSByZWFkZXIucmVhZDh1ICgpO1xuICAgICAgICAgIHZhciB2ID0gY2FtbF9mbG9hdF9vZl9ieXRlcyAodCk7XG4gICAgICAgICAgaWYgKGludGVybl9vYmpfdGFibGUpIGludGVybl9vYmpfdGFibGVbb2JqX2NvdW50ZXIrK10gPSB2O1xuICAgICAgICAgIHJldHVybiB2O1xuICAgICAgICBjYXNlIDB4MEI6IC8vY3N0LkNPREVfRE9VQk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dCA9IG5ldyBBcnJheSg4KTs7XG4gICAgICAgICAgaWYgKGludGVybl9vYmpfdGFibGUpIGludGVybl9vYmpfdGFibGVbb2JqX2NvdW50ZXIrK10gPSB2O1xuICAgICAgICAgIGZvciAodmFyIGkgPSAxO2kgPD0gbGVuO2krKykge1xuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7aiA8IDg7aisrKSB0W2pdID0gcmVhZGVyLnJlYWQ4dSgpO1xuICAgICAgICAgICAgdiBbaV0gPSBjYW1sX2Zsb2F0X29mX2J5dGVzICh0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgIGNhc2UgMHgwNzogLy9jc3QuQ09ERV9ET1VCTEVfQVJSQVkzMl9MSVRUTEU6XG4gICAgICAgICAgdmFyIGxlbiA9IHJlYWRlci5yZWFkMzJ1KCk7XG4gICAgICAgICAgdmFyIHYgPSBuZXcgQXJyYXkobGVuKzEpO1xuICAgICAgICAgIHZbMF0gPSAyNTQ7XG4gICAgICAgICAgaWYgKGludGVybl9vYmpfdGFibGUpIGludGVybl9vYmpfdGFibGVbb2JqX2NvdW50ZXIrK10gPSB2O1xuICAgICAgICAgIHZhciB0ID0gbmV3IEFycmF5KDgpOztcbiAgICAgICAgICBmb3IgKHZhciBpID0gMTtpIDw9IGxlbjtpKyspIHtcbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwO2ogPCA4O2orKykgdFs3IC0gal0gPSByZWFkZXIucmVhZDh1KCk7XG4gICAgICAgICAgICB2W2ldID0gY2FtbF9mbG9hdF9vZl9ieXRlcyAodCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB2O1xuICAgICAgICBjYXNlIDB4MEY6IC8vY3N0LkNPREVfRE9VQkxFX0FSUkFZMzJfQklHOlxuICAgICAgICAgIHZhciBsZW4gPSByZWFkZXIucmVhZDMydSgpO1xuICAgICAgICAgIHZhciB2ID0gbmV3IEFycmF5KGxlbisxKTtcbiAgICAgICAgICB2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xfaW50NjRfYml0c19vZl9mbG9hdCh2KSk7XG4gICAgICAgICAgLy8gICAgICAgICAgd3JpdGVyLndyaXRlICg4LCAweDBCIC8qY3N0LkNPREVfRE9VQkxFX0JJRyovKTtcbiAgICAgICAgICAvLyAgICAgICAgICBmb3IodmFyIGkgPSAwOyBpPDg7IGkrKyl7d3JpdGVyLndyaXRlKDgsdFtpXSl9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodiA+PSAwICYmIHYgPCAweDQwKSB7XG4gICAgICAgICAgd3JpdGVyLndyaXRlICg4LCAwWDQwIC8qY3N0LlBSRUZJWF9TTUFMTF9JTlQqLyArIHYpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICh2ID49IC0oMSA8PCA3KSAmJiB2IDwgKDEgPDwgNykpXG4gICAgICAgICAgICB3cml0ZXIud3JpdGVfY29kZSg4LCAweDAwIC8qY3N0LkNPREVfSU5UOCovLCB2KTtcbiAgICAgICAgICBlbHNlIGlmICh2ID49IC0oMSA8PCAxNSkgJiYgdiA8ICgxIDw8IDE1KSlcbiAgICAgICAgICAgIHdyaXRlci53cml0ZV9jb2RlKDE2LCAweDAxIC8qY3N0LkNPREVfSU5UMTYqLywgdik7XG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgd3JpdGVyLndyaXRlX2NvZGUoMzIsIDB4MDIgLypjc3QuQ09ERV9JTlQzMiovLCB2KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICBleHRlcm5fcmVjICh2KTtcbiAgICB3aGlsZSAoc3RhY2subGVuZ3RoID4gMCkge1xuICAgICAgdmFyIGkgPSBzdGFjay5wb3AgKCk7XG4gICAgICB2YXIgdiA9IHN0YWNrLnBvcCAoKTtcbiAgICAgIGlmIChpICsgMSA8IHYubGVuZ3RoKSBzdGFjay5wdXNoICh2LCBpICsgMSk7XG4gICAgICBleHRlcm5fcmVjICh2W2ldKTtcbiAgICB9XG4gICAgaWYgKGludGVybl9vYmp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jYW1sX2JhX2Zyb21fdHlwZWRfYXJyYXkgbXV0YWJsZVxuLy9SZXF1aXJlczogY2FtbF9iYV9raW5kX29mX3R5cGVkX2FycmF5XG4vL1JlcXVpcmVzOiBjYW1sX2JhX2NyZWF0ZV91bnNhZmVcbmZ1bmN0aW9uIGNhbWxfYmFfZnJvbV90eXBlZF9hcnJheSh0YSl7XG4gIHZhciBraW5kID0gY2FtbF9iYV9raW5kX29mX3R5cGVkX2FycmF5KHRhKTtcbiAgcmV0dXJuIGNhbWxfYmFfY3JlYXRlX3Vuc2FmZShraW5kLCAwLCBbdGEubGVuZ3RoXSwgdGEpO1xufVxuIiwiLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqL1xuLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuLyogICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3RpdmUgQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuLyogICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAqL1xuLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqL1xuLyogIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAqL1xuLyogIGVuIEF1dG9tYXRpcXVlLiAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCAgICAqL1xuLyogIHVuZGVyIHRoZSB0ZXJ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0ZSA9IHRhYmxlcy50YWJsZVtuMl07XG4gICAgICBzcCsrO1xuICAgICAgaWYgKHNwID49IGVudltlbnZfc3RhY2tzaXplXSkge1xuICAgICAgICByZXMgPSBHUk9XX1NUQUNLU18xO1xuICAgICAgICBicmVhayBleGl0O1xuICAgICAgfVxuICAgICAgLy8gRmFsbCB0aHJvdWdoXG4gICAgICAvKiBUaGUgTUwgY29kZSByZXNpemVzIHRoZSBzdGFja3MgKi9cbiAgICBjYXNlIDI6Ly9TVEFDS1NfR1JPV05fMTpcbiAgICAgIGVudltlbnZfc19zdGFja11bc3AgKyAxXSA9IHN0YXRlO1xuICAgICAgZW52W2Vudl92X3N0YWNrXVtzcCArIDFdID0gZW52W2Vudl9sdmFsXTtcbiAgICAgIGVudltlbnZfc3ltYl9zdGFydF9zdGFja11bc3AgKyAxXSA9IGVudltlbnZfc3ltYl9zdGFydF07XG4gICAgICBlbnZbZW52X3N5bWJfZW5kX3N0YWNrXVtzcCArIDFdID0gZW52W2Vudl9zeW1iX2VuZF07XG4gICAgICBjbWQgPSBsb29wO1xuICAgICAgYnJlYWs7XG5cbiAgICBjYXNlIDEwOi8vcmVkdWNlOlxuICAgICAgaWYgKGNhbWxfcGFyc2VyX3RyYWNlKVxuICAgICAgICBsb2coXCJTdGF0ZSBcIiArIHN0YXRlICsgXCI6IHJlZHVjZSBieSBydWxlIFwiICsgbik7XG4gICAgICB2YXIgbSA9IHRhYmxlcy5sZW5bbl07XG4gICAgICBlbnZbZW52X2FzcF0gPSBzcDtcbiAgICAgIGVudltlbnZfcnVsZV9udW1iZXJdID0gbjtcbiAgICAgIGVudltlbnZfcnVsZV9sZW5dID0gbTtcbiAgICAgIHNwID0gc3AgLSBtICsgMTtcbiAgICAgIG0gPSB0YWJsZXMubGhzW25dO1xuICAgICAgc3RhdGUxID0gZW52W2Vudl9zX3N0YWNrXVtzcF07XG4gICAgICBuMSA9IHRhYmxlcy5naW5kZXhbbV07XG4gICAgICBuMiA9IG4xICsgc3Rh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lxuICAgICAgICBpZihjYW1sX2lzX2NvbnRpbnVhdGlvbl90YWcodlswXSkpIHtcbiAgICAgICAgICAvKiBBbGwgY29udGludWF0aW9ucyBoYXNoIHRvIHRoZSBzYW1lIHZhbHVlLFxuICAgICAgICAgICAgIHNpbmNlIHdlIGhhdmUgbm8gaWRlYSBob3cgdG8gZGlzdGluZ3Vpc2ggdGhlbS4gKi9cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICB2YXIgdGFnID0gKCh2Lmxlbmd0aCAtIDEpIDw8IDEwKSB8IHZbMF07XG4gICAgICAgIGggPSBjYW1sX2hhc2hfbWl4X2ludChoLCB0YWcpO1xuICAgICAgICBmb3IgKGkgPSAxLCBsZW4gPSB2Lmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgICAgICAgaWYgKHdyID49IHN6KSBicmVhaztcbiAgICAgICAgICBxdWV1ZVt3cisrXSA9IHZbaV07XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChjYW1sX2lzX21sX2J5dGVzKHYpKSB7XG4gICAgICBoID0gY2FtbF9oYXNoX21peF9ieXRlcyhoLHYpXG4gICAgICBudW0tLTtcbiAgICB9IGVsc2UgaWYgKGNhbWxfaXNfbWxfc3RyaW5nKHYpKSB7XG4gICAgICBoID0gY2FtbF9oYXNoX21peF9zdHJpbmcoaCx2KVxuICAgICAgbnVtLS07XG4gICAgfSBlbHNlIGlmICh0eXBlb2YgdiA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgaCA9IGNhbWxfaGFzaF9taXhfanNieXRlcyhoLHYpXG4gICAgICBudW0tLTtcbiAgICB9IGVsc2UgaWYgKHYgPT09ICh2fDApKSB7XG4gICAgICAvLyBJbnRlZ2VyXG4gICAgICBoID0gY2FtbF9oYXNoX21peF9pbnQoaCwgdit2KzEpO1xuICAgICAgbnVtLS07XG4gICAgfSBlbHNlIGlmICh2ID09PSArdikge1xuIC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wYXJpc29uXG4gICAgICAgIC8vIC0gaWYgYSBvciBiIGFyZSBub3Qgc3RyaW5ncywgY29udmVydCBhIGFuZCBiIHRvIG51bWJlclxuICAgICAgICAvLyAgIGFuZCBhcHBseSBzdGFuZGFyZCBjb21wYXJpc29uXG4gICAgICAgIC8vXG4gICAgICAgIC8vIEV4Y2VwdGlvbjogYCE9YCB3aWxsIG5vdCBjb2VyY2UvY29udmVydCBpZiBib3RoIGEgYW5kIGIgYXJlIG9iamVjdHNcbiAgICAgICAgaWYgKGEgPCBiKSByZXR1cm4gLTE7XG4gICAgICAgIGlmIChhID4gYikgcmV0dXJuIDE7XG4gICAgICAgIGlmIChhICE9IGIpIHtcbiAgICAgICAgICBpZiAoIXRvdGFsKSByZXR1cm4gTmFOO1xuICAgICAgICAgIGlmIChhID09IGEpIHJldHVybiAxO1xuICAgICAgICAgIGlmIChiID09IGIpIHJldHVybiAtMTtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMTI1MTogLy8gSmF2YVNjcmlwdCBTeW1ib2wsIG5vIG9yZGVyaW5nLlxuICAgICAgICBpZihhICE9PSBiKSB7XG4gICAgICAgICAgaWYgKCF0b3RhbCkgcmV0dXJuIE5hTjtcbiAgICAgICAgICByZXR1cm4gMTtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgMTI1MjogLy8gb2NhbWwgc3RyaW5nc1xuICAgICAgICB2YXIgYSA9IGNhbWxfanNieXRlc19vZl9zdHJpbmcoYSk7XG4gICAgICAgIHZhciBiID0gY2FtbF9qc2J5dGVzX29mX3N0cmluZyhiKTtcbiAgICAgICAgaWYoYSAhPT0gYikge1xuICAgICAgICAgIGlmKGEgPCBiKSByZXR1cm4gLTE7XG4gICAgICAgICAgaWYoYSA+IGIpIHJldHVybiAxO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSAxMjUyMDogLy8gamF2YXNjcmlwdCBzdHJpbmdz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J0IDwgMCB8fCBnLmVuZCA8IDApIHtcbiAgICAgICAgICBnLnN0YXJ0ID0gZy5lbmQgPSAtMTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHRbMippICsgMSBdID0gZy5zdGFydDtcbiAgICAgICAgcmVzdWx0WzIqaSArIDEgKyAxIF0gPSBnLmVuZDtcbiAgICAgIH07XG4gICAgICByZXR1cm4gcmVzdWx0XG4gICAgfTtcblxuICAgIHZhciBwcmVmaXhfbWF0Y2ggPSBmdW5jdGlvbiAoKSB7XG4gICAgICBpZihwYXJ0aWFsKSByZXR1cm4gYWNjZXB0ICgpO1xuICAgICAgZWxzZSBiYWNrdHJhY2sgKCk7XG4gICAgfVxuXG4gICAgLyogTWFpbiBERkEgaW50ZXJwcmV0ZXIgbG9vcCAqL1xuICAgIHdoaWxlICghcXVpdCkge1xuICAgICAgdmFyIG9wID0gcHJvZ1twY10gJiAweGZmLFxuICAgICAgICAgIHNhcmcgPSBwcm9nW3BjXSA+PiA4LFxuICAgICAgICAgIHVhcmcgPSBzYXJnICYgMHhmZixcbiAgICAgICAgICBjID0gc1twb3NdLFxuICAgICAgICAgIGdyb3VwO1xuXG4gICAgICBwYysrO1xuXG4gICAgICBzd2l0Y2ggKG9wKSB7XG4gICAgICBjYXNlIG9wY29kZXMuQ0hBUjpcbiAgICAgICAgaWYocG9zID09PSBzLmxlbmd0aCkge3ByZWZpeF9tYXRjaCAoKTsgYnJlYWt9O1xuICAgICAgICBpZiAoYyA9PT0gdWFyZykgcG9zKys7XG4gICAgICAgIGVsc2UgYmFja3RyYWNrKCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvcGNvZGVzLkNIQVJOT1JNOlxuICAgICAgICBpZihwb3MgPT09IHMubGVuZ3RoKSB7cHJlZml4X21hdGNoICgpOyBicmVha307XG4gICAgICAgIGlmIChub3JtdGFibGUuY2hhckNvZGVBdChjKSA9PT0gdWFyZykgcG9zKys7XG4gICAgICAgIGVsc2UgYmFja3RyYWNrKCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvcGNvZGVzLlNUUklORzpcbiAgICAgICAgZm9yICh2YXIgYXJnID0gY2FtbF9qc2J5dGVzX29mX3N0cmluZyhjcG9vbFt1YXJnXSksIGkgPSAwOyBpIDwgYXJnLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgaWYocG9zID09PSBzLmxlbmd0aCkge3ByZWZpeF9tYXRjaCAoKTsgYnJlYWt9O1xuICAgICAgICAgIGlmIChjID09PSBhcmcuY2hhckNvZGVBdChpKSlcbiAgICAgICAgICAgIGMgPSBzWysrcG9zXTtcbiAgICAgICAgICBlbHNlIHsgYmFja3RyYWNrKCk7IGJyZWFrOyB9XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIG9wY29kZXMuU1RSSU5HTk9STTpcbiAgICAgICAgZm9yICh2YXIgYXJnID0gY2FtbF9qc2J5dGVzX29mX3N0cmluZyhjcG9vbFt1YXJnXSksIGkgPSAwOyBpIDwgYXJnLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgaWYocG9zID09PSBzLmxlbmd0aCkge3ByZWZpeF9tYXRjaCAoKTsgYnJlYWt9O1xuICAgICAgICAgIGlmIChub3JtdGFibGUuY2hhckNvZGVBdChjKSA9PT0gYXJnLmNoYXJDb2RlQXQoaSkpXG4gICAgICAgICAgICBjID0gc1srK3Bvc107XG4gICAgICAgICAgZWxzZSB7IGJhY2t0cmFjaygpOyBicmVhazsgfVxuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvcGNvZGVzLkNIQVJDTEFTUzpcbiAgICAgICAgaWYocG9zID09PSBzLmxlbmd0aCkge3ByZWZpeF9tYXRjaCAoKTsgYnJlYWt9O1xuICAgICAgICBpZiAoaW5fYml0c2V0KGNwb29sW3VhcmddLCBjKSkgcG9zKys7XG4gICAgICAgIGVsc2UgYmFja3RyYWNrKCk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvcGNvZGVzLkJPTDpcbiAgICAgICAgaWYocG9zID4gMCAmJiBzW3BvcyAtIDFdICE9IDEwIC8qIFxcbiAqLykge2JhY2t0cmFjaygpfVxuICAgICAgICBicmVhaztcbiAgICAgIGNhc2Ugb3Bjb2Rlcy5FT0w6XG4gICAgICAgIGlmKHBvcyA8IHMubGVuZ3RoICYmIHNbcG9zXSAhPSAxMCAvKiBcXG4gKi8pIHtiYWNrdHJhY2soKX1cbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlIG9wY29kZXMuV09SREJPVU5EQVJZOlxuICAgICAgICBpZihwb3MgPT0gMCkge1xuICAgICAgICAgIGlmKHBvcyA9PT0gcy5sZW5ndGgpIHtwcmVmaXhfbWF0Y2ggKCk7IGJyZWFrfTtcbiAgICAgICAgICBpZihpc193b3JkX2xldHRlcihzWzBdKSkgYnJlYWs7XG4gICAgICAgICAgYmFja3RyYWNrKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAocG9zID09PSBzLmxlbmd0aCkge1xuICAgICAgICAgIGlmKGlzX3dvcmRfbGV0dGVyKHNbcG9zIC0gMV0pKSBicmVhaztcbiAgICAgICAgICBiYWNrdHJhY2sgKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgaWYoaXNfd29yZF9sZXR0ZXIoc1twb3MgLSAxXSkgIT0gaXNfd29yZF9sZXR0ZXIoc1twb3NdKSkgYnJlYWs7XG4gICAgICAgICAgYmFja3RyYWNrICgpO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgICAgY2FzZSBvcGNvZGVzLkJFR0dST1VQOlxuICAgICAgICBncm91cCA9IGdyb3Vwc1t1YXJnXTtcbiAgICAgICAgcHVzaCh7dW5kbzoge29iajpncm91cCxcbiAgICAgICAgICAgICAgICAgICAgIHByb3A6J3N0YXJ0JyxcbiAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBncm91cC5zdGFydH19KTt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IGMgPSArY3VyO1xuICAgICAgICBpZiAoYyoyID49IGdyb3Vwcy5sZW5ndGggLSAxIClcbiAgICAgICAgICBjYW1sX2ZhaWx3aXRoKFwiU3RyLnJlcGxhY2U6IHJlZmVyZW5jZSB0byB1bm1hdGNoZWQgZ3JvdXBcIiApO1xuICAgICAgICBzdGFydCA9IGNhbWxfYXJyYXlfZ2V0KGdyb3VwcyxjKjIpO1xuICAgICAgICBlbmQgPSBjYW1sX2FycmF5X2dldChncm91cHMsIGMqMiArMSk7XG4gICAgICAgIGlmIChzdGFydCA9PSAtMSlcbiAgICAgICAgICBjYW1sX2ZhaWx3aXRoKFwiU3RyLnJlcGxhY2U6IHJlZmVyZW5jZSB0byB1bm1hdGNoZWQgZ3JvdXBcIik7XG4gICAgICAgIHJlcys9b3JpZy5zbGljZShzdGFydCxlbmQpO1xuICAgICAgICBicmVhaztcbiAgICAgIGRlZmF1bHQ6XG4gICAgICAgIHJlcyArPSAoJ1xcXFwnICArIGN1cik7XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBjYW1sX3N0cmluZ19vZl9qc2J5dGVzKHJlcyk7IH1cblxuXG4vL1Byb3ZpZGVzOiBjYW1sX3N0cl9pbml0aWFsaXplXG5mdW5jdGlvbiBjYW1sX3N0cl9pbml0aWFsaXplKHVuaXQpIHtcbiAgcmV0dXJuIDA7XG59XG4iLCIvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXG4vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovXG4vKiAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdGl2ZSBDYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICovXG4vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovXG4vKiAgICAgICAgICAgIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICovXG4vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovXG4vKiAgQ29weXJpZ2h0IDE5OTYgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICovXG4vKiAgZW4gQXV0b21hdGlxdWUuICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkICAgICovXG4vKiAgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UsIHdpdGggICAgICovXG4vKiAgdGhlIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIGZpbGUgLi4vTElDRU5TRS4gICAgICovXG4vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovXG4vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovXG5cbi8qICRJZDogbGV4aW5nLmMgNjA0NSAyMDA0LTAxLTAxIDE2OjQyOjQzWiBkb2xpZ2V6ICQgKi9cblxuLyogVGhlIHRhYmxlLWRyaXZlbiBhdXRvbWF0b24gZm9yIGxleGVycyBnZW5lcmF0ZWQgYnkgY2FtbGxleC4gKi9cblxuLy9Qcm92aWRlczogY2FtbF9sZXhfYXJyYXlcbi8vUmVxdWlyZXM6IGNhbWxfanNieXRlc19vZl9zdHJpbmdcbmZ1bmN0aW9uIGNhbWxfbGV4X2FycmF5KHMpIHtcbiAgcyA9IGNhbWxfanNieXRlc19vZl9zdHJpbmcocyk7XG4gIHZhci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uICAgICAgICB2YXIgZnNiID0gZmNmID8gKDEgPDwgZmNmKSA6IHNzO1xuICAgICAgICAvLyBmcmFtZSBzb3VyY2Ugc2l6ZVxuICAgICAgICB2YXIgZnNzID0gcmIoZGF0LCBidCwgZnNiKSArICgoZmNmID09IDEpICYmIDI1Nik7XG4gICAgICAgIC8vIHdpbmRvdyBzaXplXG4gICAgICAgIHZhciB3cyA9IGZzcztcbiAgICAgICAgaWYgKCFzcykge1xuICAgICAgICAgICAgLy8gd2luZG93IGRlc2NyaXB0b3JcbiAgICAgICAgICAgIHZhciB3YiA9IDEgPDwgKDEwICsgKGRhdFs1XSA+PiAzKSk7XG4gICAgICAgICAgICB3cyA9IHdiICsgKHdiID4+IDMpICogKGRhdFs1XSAmIDcpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh3cyA+IDIxNDUzODY0OTYpXG4gICAgICAgICAgICBlcnIoMSk7XG4gICAgICAgIHZhciBidWYgPSBuZXcgdTgoKHcgPT0gMSA/IChmc3MgfHwgd3MpIDogdyA/IDAgOiB3cykgKyAxMik7XG4gICAgICAgIGJ1ZlswXSA9IDEsIGJ1Zls0XSA9IDQsIGJ1Zls4XSA9IDg7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBiOiBidCArIGZzYixcbiAgICAgICAgICAgIHk6IDAsXG4gICAgICAgICAgICBsOiAwLFxuICAgICAgICAgICAgZDogZGksXG4gICAgICAgICAgICB3OiAodyAmJiB3ICE9IDEpID8gdyA6IGJ1Zi5zdWJhcnJheSgxMiksXG4gICAgICAgICAgICBlOiB3cyxcbiAgICAgICAgICAgIG86IG5ldyBpMzIoYnVmLmJ1ZmZlciwgMCwgMyksXG4gICAgICAgICAgICB1OiBmc3MsXG4gICAgICAgICAgICBjOiBjYyxcbiAgICAgICAgICAgIG06IE1hdGgubWluKDEzMTA3Miwgd3MpXG4gICAgICAgIH07XG4gICAgfVxuICAgIGVsc2UgaWYgKCgobjMgPj4gNCkgfCAoZGF0WzNdIDw8I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BhcyBKUyBpcyBoaWdoZXItbGV2ZWwgdGhhdCBpcyB1bm5lY2Vzc2FyeVxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2Y7ICsraSkge1xuICAgICAgICAgICAgc3ltc1tzeW1wb3NdID0gcztcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBzeW1wb3MgPSAoc3ltcG9zICsgc3N0ZXApICYgc21hc2s7XG4gICAgICAgICAgICB9IHdoaWxlIChzeW1wb3MgPj0gaHQpO1xuICAgICAgICB9XG4gICAgfVxuICAgIC8vIEFmdGVyIHNwcmVhZGluZyBzeW1ib2xzLCBzaG91bGQgYmUgemVybyBhZ2FpblxuICAgIGlmIChzeW1wb3MpXG4gICAgICAgIGVycigwKTtcbiAgICBmb3IgKGkgPSAwOyBpIDwgc3o7ICsraSkge1xuICAgICAgICAvLyBuZXh0IHN0YXRlXG4gICAgICAgIHZhciBucyA9IGRzdGF0ZVtzeW1zW2ldXSsrO1xuICAgICAgICAvLyBudW0gYml0c1xuICAgICAgICB2YXIgbmIgPSBuYml0c1tpXSA9IGFsIC0gbXNiKG5zKTtcbiAgICAgICAgbnN0YXRlW2ldID0gKG5zIDw8IG5iKSAtIHN6O1xuICAgIH1cbiAgICByZXR1cm4gWyh0cG9zICsgNykgPj4gMywge1xuICAgICAgICAgICAgYjogYWwsXG4gICAgICAgICAgICBzOiBzeW1zLFxuICAgICAgICAgICAgbjogbmJpdHMsXG4gICAgICAgICAgICB0OiBuc3RhdGVcbiAgICAgICAgfV07XG59O1xuLy8gcmVhZCBodWZmbWFuXG52YXIgcmh1ID0gZnVuY3Rpb24gKGRhdCwgYnQpIHtcbiAgICAvLyAgaW5kZXggIHdlaWdodCBjb3VudFxuICAgIHZhciBpID0gMCwgd2MgPSAtMTtcbiAgICAvLyAgICBidWZmZXIgICAgICAgICAgICAgaGVhZGVyIGJ5dGVcbiAgICB2YXIgYnVmID0gbmV3IHU4KDI5MiksIGhiID0gZGF0W2J0XTtcbiA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aztcbiAgICAgICAgICAgIHZhciBjYnQgPSBmcG9zID4+IDM7XG4gICAgICAgICAgICBzdDEgKz0gKChkYXRbY2J0XSB8IChkYXRbY2J0ICsgMV0gPDwgOCkpID4+IChmcG9zICYgNykpICYgKCgxIDw8IGJ0cjEpIC0gMSk7XG4gICAgICAgICAgICBod1srK3djXSA9IGZkdC5zW3N0MV07XG4gICAgICAgICAgICBmcG9zIC09IGJ0cjI7XG4gICAgICAgICAgICBpZiAoZnBvcyA8IGVwb3MpXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYnQgPSBmcG9zID4+IDM7XG4gICAgICAgICAgICBzdDIgKz0gKChkYXRbY2J0XSB8IChkYXRbY2J0ICsgMV0gPDwgOCkpID4+IChmcG9zICYgNykpICYgKCgxIDw8IGJ0cjIpIC0gMSk7XG4gICAgICAgICAgICBod1srK3djXSA9IGZkdC5zW3N0Ml07XG4gICAgICAgICAgICBidHIxID0gZmR0Lm5bc3QxXTtcbiAgICAgICAgICAgIHN0MSA9IGZkdC50W3N0MV07XG4gICAgICAgICAgICBidHIyID0gZmR0Lm5bc3QyXTtcbiAgICAgICAgICAgIHN0MiA9IGZkdC50W3N0Ml07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCsrd2MgPiAyNTUpXG4gICAgICAgICAgICBlcnIoMCk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICB3YyA9IGhiIC0gMTI3O1xuICAgICAgICBmb3IgKDsgaSA8IHdjOyBpICs9IDIpIHtcbiAgICAgICAgICAgIHZhciBieXRlID0gZGF0WysrYnRdO1xuICAgICAgICAgICAgaHdbaV0gPSBieXRlID4+IDQ7XG4gICAgICAgICAgICBod1tpICsgMV0gPSBieXRlICYgMTU7XG4gICAgICAgIH1cbiAgICAgICAgKytidDtcbiAgICB9XG4gICAgLy8gd2VpZ2h0IGV4cG9uZW50aWFsIHN1bVxuICAgIHZhciB3ZXMgPSAwO1xuICAgIGZvciAoaSA9IDA7IG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dC55ICs9IHN6KTtcbiAgICAgICAgICAgIHJldHVybiBvdXQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZpbGwobmV3IHU4KHN6KSwgZGF0W2J0XSk7XG4gICAgfVxuICAgIGlmIChlYnQgPiBkYXQubGVuZ3RoKVxuICAgICAgICByZXR1cm47XG4gICAgaWYgKGJ0eXBlID09IDApIHtcbiAgICAgICAgc3QuYiA9IGVidDtcbiAgICAgICAgaWYgKG91dCkge1xuICAgICAgICAgICAgb3V0LnNldChkYXQuc3ViYXJyYXkoYnQsIGVidCksIHN0LnkpO1xuICAgICAgICAgICAgc3QueSArPSBzejtcbiAgICAgICAgICAgIHJldHVybiBvdXQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNsYyhkYXQsIGJ0LCBlYnQpO1xuICAgIH1cbiAgICBpZiAoYnR5cGUgPT0gMikge1xuICAgICAgICAvLyAgICBieXRlIDMgICAgICAgIGxpdCBidHlwZSAgICAgc2l6ZSBmb3JtYXRcbiAgICAgICAgdmFyIGIzID0gZGF0W2J0XSwgbGJ0ID0gYjMgJiAzLCBzZiA9IChiMyA+PiAyKSAmIDM7XG4gICAgICAgIC8vIGxpdCBzcmMgc2l6ZSAgbGl0IGNtcCBzeiA0IHN0cmVhbXNcbiAgICAgICAgdmFyIGxzcyA9IGIzID4+IDQsIGxjcyA9IDAsIHM0ID0gMDtcbiAgICAgICAgaWYgKGxidCA8IDIpIHtcbiAgICAgICAgICAgIGlmIChzZiAmIDEpXG4gICAgICAgICAgICAgICAgbHNzIHw9IChkYXRbKytidF0gPDwgNCkgfCAoKHNmICYgMikgJiYgKGRhdFsrK2J0XSA8PCAxMikpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIGxzcyA9IGIzID4+IDM7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBzNCA9IHNmO1xuICAgICAgICAgICAgaWYgKHNmIDwgMilcbiAgICAgICAgICAgIC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hYmxlXG4gICAgICAgICAgICB2YXIgaHUgPSBzdC5oO1xuICAgICAgICAgICAgaWYgKGxidCA9PSAyKSB7XG4gICAgICAgICAgICAgICAgdmFyIGh1ZCA9IHJodShkYXQsIGJ0KTtcbiAgICAgICAgICAgICAgICAvLyBzdWJ0cmFjdCBkZXNjcmlwdGlvbiBsZW5ndGhcbiAgICAgICAgICAgICAgICBsY3MgKz0gYnQgLSAoYnQgPSBodWRbMF0pO1xuICAgICAgICAgICAgICAgIHN0LmggPSBodSA9IGh1ZFsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCFodSlcbiAgICAgICAgICAgICAgICBlcnIoMCk7XG4gICAgICAgICAgICAoczQgPyBkaHU0IDogZGh1KShkYXQuc3ViYXJyYXkoYnQsIGJ0ICs9IGxjcyksIGJ1Zi5zdWJhcnJheShzcGwpLCBodSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gbnVtIHNlcXVlbmNlc1xuICAgICAgICB2YXIgbnMgPSBkYXRbYnQrK107XG4gICAgICAgIGlmIChucykge1xuICAgICAgICAgICAgaWYgKG5zID09IDI1NSlcbiAgICAgICAgICAgICAgICBucyA9IChkYXRbYnQrK10gfCAoZGF0W2J0KytdIDw8IDgpKSArIDB4N0YwMDtcbiAgICAgICAgICAgIGVsc2UgaWYgKG5zID4gMTI3KVxuICAgICAgICAgICAgICAgIG5zID0gKChucyAtIDEyOCkgPDwgOCkgfCBkYXRbYnQrK107XG4gICAgICAgICAgICAvLyBzeW1ib2wgY29tcHJlc3Npb24gbW9kZXNcbiAgICAgICAgICAgIHZhciBzY20gPSBkYXRbYnQrK107XG4gICAgICAgICAgICBpZiAoc2NtICYgMylcbiAgICAgICAgICAgICAgICBlcnIoMCk7XG4gICAgICAgICAgICB2YXIgZHRzID0gW2RtbHQsIGRvY3QsIGRsbHRdO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDI7IGkgPiAtMTsgLS1pKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1kID0gKHNjbSA+PiAoKGkgPDwgMSkgKyAyKSkgJiAzO1xuICAgICAgICAgICAgICAgIGlmIChtZCA9PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHJsZSBidWZcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJidWYgPSBuZXcgdTgoWzAsIDAsIGRhdFtidCsrXV0pO1xuICAgICAgICAgICAgICAgICAgICBkdHNbaV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzOiByYnVmLnN1YmFycmF5KDIsIDMpLFxuICAgICAgICAgICAgICAgICAgICAgICAgbjogcmJ1Zi5zdWJhcnJheSgwLCAxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHQ6IG5ldyB1MTYocmJ1Zi5idWZmZXIsIDAsIDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgYjogMFxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChtZCA9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGFjY3VyYWN5IGxvZyA4IGZvciBvZmZzZXRzLCA5IGZvciBvdGhlcnNcbiAgICAgICAgICAgICAgICAgICAgX2EgPSByZnNlKGRhdCwgYnQsIDkgLSAoaSAmIDEpKSwgYnQgPSBfYVswXSwgZHRzW2ldID0gX2FbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1kID09IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdC50KVxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyKDApO1xuICAgICAgICAgICAgICAgICAgICBkdHNbaV0gPSBzdC50W2ldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBfYiA9IHN0LnQgPSBkdHMsIG1sdCA9IF9iWzBdLCBvY3QgPSBfYlsxXSwgbGx0ID0gX2JbMl07XG4gICAgICAgICAgICB2YXIgbGIgPSBkYXRbZWJ0IC0gMV07XG4gICAgICAgICAgICBpZiAoIWxiKVxuICAgICAgICAgICAgICAgIGVycigwKTtcbiAgICAgICAgICAgIHZhciBzcG9zID0gKGVidCA8PCAzKSAtIDggKyBtc2IobGIpIC0gbGx0LmIsIGNidCA9IHNwb3MgPj4gMywgb3VidCA9IDA7XG4gICAgICAgICAgICB2YXIgbHN0ID0gKChkYXRbY2J0XSB8IChkYXRbY2J0ICsgMV0gPDwgOCkpID4+IChzcG9zICYgNykpICYgKCgxIDw8IGxsdC5iKSAtIDEpO1xuICAgICAgICAgICAgY2J0ID0gKHNwb3MgLT0gb2N0LmIpID4+IDM7XG4gICAgICAgICAgICB2YXIgb3N0ID0gKChkYXRbY2J0XSB8IChkYXRbY2J0ICsgMV0gPDwgOCkpID4+IChzcG9zICYgNykpICYgKCgxIDw8IG9jdC5iKSAtIDEpO1xuICAgICAgICAgICAgY2J0ID0gKHNwb3MgLT0gbWx0LmIpID4+IDM7XG4gICAgICAgICAgICB2YXIgbXN0ID0gKChkYXRbY2J0XSB8IChkYXRbY2J0ICsgMV0gPDwgOCkpID4+IChzcG9zICYgNykpICYgKCgxIDw8IG1sdC5iKSAtIDEpO1xuICAgICAgICAgICAgZm9yICgrK25zOyAtLW5zOykge1xuICAgICAgICAgICAgICAgIHZhciBsbGMgPSBsbHQuc1tsc3RdO1xuICAgICAgICAgICAgICAgIHZhciBsYnRyID0gbGx0Lm5bbHN0XTtcbiAgICAgICAgICAgICAgICB2YXIgbWxjID0gbWx0LnNbbXN0XTtcbiAgICAgICAgICAgICAgICB2YXIgbWJ0ciA9IG1sdC5uW21zdF07XG4gICAgICAgICAgICAgICAgdmFyIG9mYyA9IG9jdC5zW29zdF07XG4gICAgICAgICAgICAgICAgdmFyIG9idHIgPSBvY3Qubltvc3RdO1xuICAgICAgICAgICAgICAgIGNidCA9IChzcG9zIC09IG9mYykgPj4gMztcbiAgICAgICAgICAgICAgICB2YXIgb2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gICAgICAgICAgICAgICBjYnQgPSAoc3BvcyAtPSBvYnRyKSA+PiAzO1xuICAgICAgICAgICAgICAgIG9zdCA9IG9jdC50W29zdF0gKyAoKChkYXRbY2J0XSB8IChkYXRbY2J0ICsgMV0gPDwgOCkpID4+IChzcG9zICYgNykpICYgKCgxIDw8IG9idHIpIC0gMSkpO1xuICAgICAgICAgICAgICAgIGlmIChvZmYgPiAzKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0Lm9bMl0gPSBzdC5vWzFdO1xuICAgICAgICAgICAgICAgICAgICBzdC5vWzFdID0gc3Qub1swXTtcbiAgICAgICAgICAgICAgICAgICAgc3Qub1swXSA9IG9mZiAtPSAzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGlkeCA9IG9mZiAtIChsbCAhPSAwKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkeCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgb2ZmID0gaWR4ID09IDMgPyBzdC5vWzBdIC0gMSA6IHN0Lm9baWR4XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZHggPiAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0Lm9bMl0gPSBzdC5vWzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3Qub1sxXSA9IHN0Lm9bMF07XG4gICAgICAgICAgICAgICAgICAgICAgICBzdC5vWzBdID0gb2ZmO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIG9mZiA9IHN0Lm9bMF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGw7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICBidWZbb3VidCArIGldID0gYnVmW3NwbCArIGldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBvdWJ0ICs9IGxsLCBzcGwgKz0gbGw7XG4gICAgICAgICAgICAgICAgdmFyIHN0aW4gPSBvdWJ0IC0gb2ZmO1xuICAgICAgICAgICAgICAgIGlmIChzdGluIDwgMCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbGVuID0gLXN0aW47XG4gICAgICAgICAgICAgICAgICAgIHZhciBicyA9IHN0LmUgKyBzdGluO1xuICAgICAgICAgICAgICAgICAgICBpZiAobGVuID4gbWwpXG4gICAgICAgICAgICAgICAgICAgICAgICBsZW4gPSBtbDtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW47ICsraSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnVmW291YnQgKyBpXSA9IHN0LndbYnMgKyBpXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBvdWJ0ICs9IGxlbiwgbWwgLT0gbGVuLCBzdGluID0gMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBtbDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIGJ1ZltvdWJ0ICsgaV0gPSBidWZbc3RpbiArIGldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBvdWJ0ICs9IG1sO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG91YnQgIT0gc3BsKSB7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHNwbCA8IGJ1Zi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYnVmW291YnQrK10gPSBidWZbc3BsKytdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvdWJ0ID0gYnVmLmxlbmd0aDtcbiAgICAgICAgICAgIGlmIChvdXQpXG4gICAgICAgICAgICAgICAgc3QueSArPSBvdWJ0O1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIGJ1ZiA9IHNsYyhidWYsIDAsIG91YnQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKG91dCkge1xuICAgICAgICAgICAgICAgIHN0LnkgKz0gbHNzO1xuICAgICAgICAgICAgICAgIGlmIChzcGwpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsc3M7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnVmW2ldID0gYnVmW3NwbCArIGldO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoc3BsKVxuICAgICAgICAgICAgICAgIGJ1ZiA9IHNsYyhidWYsIHNwbCk7XG4gICAgICAgIH1cbiAgICAgICAgc3QuYiA9IGVidDtcbiAgICAgICAgcmV0dXJuIGJ1ZjtcbiAgICB9XG4gICAgZXJyKDIpO1xufTtcbi8vIGNvbmNhdFxudmFyIGNjdCA9IGZ1bmN0aW9uIChidWZzLCBvbCkge1xuICAgIGlmIChidWZzLmxlbmd0aCA9PSAxKVxuICAgICAgICByZXR1cm4gYnVmc1swXTtcbiAgICB2YXIgYnVmID0gbmV3IHU4KG9sKTtcbiAgICBmb3IgKHZhciBpID0gMCwgYiA9IDA7IGkgPCBidWZzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIHZhciBjaGsgPSBidWZzW2ldO1xuICAgICAgICBidWYuc2V0KGNoaywgYik7XG4gICAgICAgIGIgKz0gY2hrLmxlbmd0aDtcbiAgICB9XG4gICAgcmV0dXJuIGJ1Zjtcbn07XG4vKipcbiAqIERlY29tcHJlc3NlcyBac3RhbmRhcmQgZGF0YVxuICogQHBhcmFtIGRhdCBUaGUgaW5wdXQgZGF0YVxuICogQHBhcmFtIGJ1ZiBUaGUgb3V0cHV0IGJ1ZmZlci4gSWYgdW5zcGVjaWZpZWQsIHRoZSBmdW5jdGlvbiB3aWxsIGFsbG9jYXRlXG4gKiAgICAgICAgICAgIGV4YWN0bHkgZW5vdWdoIG1lbW9yeSB0byBmaXQgdGhlIGRlY29tcHJlc3NlZCBkYXRhLiBJZiB5b3VyXG4gKiAgICAgICAgICAgIGRhdGEgaGFzIG11bHRpcGxlIGZyYW1lcyBhbmQgeW91IGtub3cgdGhlIG91dHB1dCBzaXplLCBzcGVjaWZ5aW5nXG4gKiAgICAgICAgICAgIGl0IHdpbGwgeWllbGQgYmV0dGVyIHBlcmZvcm1hbmNlLlxuICogQHJldHVybnMgVGhlIGRlY29tcHJlc3NlZCBkYXRhXG4gKi9cbnJldHVybiBmdW5jdGlvbiBkZWNvbXByZXNzKGRhdCwgYnVmKSB7XG4gICAgdmFyIGJ0ID0gMCwgYnVmcyA9IFtdLCBuYiA9ICshYnVmLCBvbCA9IDA7XG4gICAgZm9yICg7IGRhdC5sZW5ndGg7KSB7XG4gICAgICAgIHZhciBzdCA9IHJ6ZmgoZGF0LCBuYiB8fCBidWYpO1xuICAgICAgICBpZiAodHlwZW9mIHN0ID09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICBpZiAobmIpIHtcbiAgICAgICAgICAgICAgICBidWYgPSBudWxsO1xuICAgICAgICAgICAgICAgIGlmIChzdC53Lmxlbmd0aCA9PSBzdC51KSB7XG4gICAgICAgICAgICAgICAgICAgIGJ1ZnMucHVzaChidWYgPSBzdC53KTtcbiAgICAgICAgICAgICAgICAgICAgb2wgKz0gc3QudTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBidWZzLnB1c2goYnVmKTtcbiAgICAgICAgICAgICAgICBzdC5lID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAoOyAhc3QubDspIHtcbiAgICAgICAgICAgICAgICB2YXIgYmxrID0gcnpiKGRhdCwgc3QsIGJ1Zik7XG4gICAgICAgICAgICAgICAgaWYgKCFibGspXG4gICAgICAgICAgICAgICAgICAgIGVycig1KTtcbiAgICAgICAgICAgICAgICBpZiAoYnVmKVxuICAgICAgICAgICAgICAgICAgICBzdC5lID0gc3QueTtcbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYnVmcy5wdXNoKGJsayk7XG4gICAgICAgICAgICAgICAgICAgIG9sICs9IGJsay5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGNwdyhzdC53LCAwLCBibGsubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgc3Qudy5zZXQoYmxrLCBzdC53Lmxlbmd0aCAtIGJsay5sZW5ndGgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGJ0ID0gc3QuYiArIChzdC5jICogNCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZVxuICAgICAgICAgICAgYnQgPSBzdDtcbiAgICAgICAgZGF0ID0gZGF0LnN1YmFycmF5KGJ0KTtcbiAgICB9XG4gICAgcmV0dXJuIGNjdChidWZzLCBvbCk7XG59XG59KSAoKVxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgIEJlbm9pdCBWYXVnb24sIEVOU1RBICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMjAxNCBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG4oKiBQYWRkaW5nIHBvc2l0aW9uLiAqKVxudHlwZSBwYWR0eSA9XG4gIHwgTGVmdCAgICgqIFRleHQgaXMgbGVmdCBqdXN0aWZpZWQgKCctJyBvcHRpb24pLiAgICAgICAgICAgICAgICopXG4gIHwgUmlnaHQgICgqIFRleHQgaXMgcmlnaHQganVzdGlmaWVkIChubyAnLScgb3B0aW9uKS4gICAgICAgICAgICopXG4gIHwgWmVyb3MgICgqIFRleHQgaXMgcmlnaHQganVzdGlmaWVkIGJ5IHplcm9zIChzZWUgJzAnIG9wdGlvbikuICopXG5cbigqKiopXG5cbigqIEludGVnZXIgY29udmVyc2lvbi4gKilcbnR5cGUgaW50X2NvbnYgPVxuICB8IEludF9kIHwgSW50X3BkIHwgSW50X3NkICAgICAgICAoKiAgJWQgfCAlK2QgfCAlIGQgICopXG4gIHwgSW50X2kgfCBJbnRfcGkgfCBJbnRfc2kgICAgICAgICgqICAlaSB8ICUraSB8ICUgaSAgKilcbiAgfCBJbnRfeCB8IEludF9DeCAgICAgICAgICAgICAgICAgKCogICV4IHwgJSN4ICAgICAgICAqKVxuICB8IEludF9YIHwgSW50X0NYICAgICAgICAgICAgICAgICAoKiAgJVggfCAlI1ggICAgICAgICopXG4gIHwgSW50X28gfCBJbnRfQ28gICAgICAgICAgICAgICAgICgqICAlbyB8ICUjbyAgICAgICAgKilcbiAgfCBJbnRfdSAgICAgICAgICAgICAgICAgICAgICAgICAgKCogICV1ICAgICAgICAgICAgICAqKVxuICB8IEludF9DZCB8IEludF9DaSB8IEludF9DdSAgICAgICAoKiAgJSNkIHwgJSNpIHwgJSN1ICopXG5cbigqIEZsb2F0IGNvbnZlcnNpb24uICopXG50eXBlIGZsb2F0X2ZsYWdfY29udiA9XG4gIHwgRmxvYXRfZmxhZ18gICAgICAgICAgICAgICAgICAgICgqICVbZmVFZ0dGaEhdICopXG4gIHwgRmxvYXRfZmxhZ19wICAgICAgICAgICAgICAgICAgICgqICUrW2ZlRWdHRmhIXSAqKVxuICB8IEZsb2F0X2ZsYWdfcyAgICAgICAgICAgICAgICAgICAoKiAlIFtmZUVnR0ZoSF0gKilcbnR5cGUgZmxvYXRfa2luZF9jb252ID1cbiAgfCBGbG9hdF9mICAgICAgICAgICAgICAgICAgICAgICAgKCogICVmIHwgJStmIHwgJSBmICAqKVxuICB8IEZsb2F0X2UgICAgICAgICAgICAgICAgICAgICAgICAoKiAgJWUgfCAlK2UgfCAlIGUgICopXG4gIHwgRmxvYXRfRSAgICAgICAgICAgICAgICAgICAgICAgICgqICAlRSB8ICUrRSB8ICUgRSAgKilcbiAgfCBGbG9hdF9nICAgICAgICAgICAgICAgICAgICAgICAgKCogICVnIHwgJStnIHwgJSBnICAqKVxuICB8IEZsb2F0X0cgICAgICAgICAgICAgICAgICAgICAgICAoKiAgJUcgfCAlK0cgfCAlIEcgICopXG4gIHwgRmxvYXRfRiAgICAgICAgICAgICAgICAgICAgICAgICgqICAlRiB8ICUrRiB8ICUgRiAgKilcbiAgfCBGbG9hdF9oICAgICAgICAgICAgICAgICAgICAgICAgKCogICVoIHwgJStoIHwgJSBoICAqKVxuICB8IEZsb2F0X0ggICAgICAgICAgICAgICAgICAgICAgICAoKiAgJUggfCAlK0ggfCAlIEggICopXG4gIHwgRmxvYXRfQ0YgICAgICAgICAgICAgICAgICAgICAgICgqICAlI0Z8ICUrI0Z8ICUgI0YgKilcbnR5cGUgZmxvYXRfY29udiA9IGZsb2F0X2ZsYWdfY29udiAqIGZsb2F0X2tpbmRfY29udlxuXG4oKioqKVxuXG4oKiBDaGFyIHNldHMgKHNlZSAlWy4uLl0pIGFyZSBiaXRtYXBzIGltcGxlbWVudGVkIGFzIDMyLWNoYXIgc3RyaW5ncy4gKilcbnR5cGUgY2hhcl9zZXQgPSBzdHJpbmdcblxuKCoqKilcblxuKCogQ291bnRlciB1c2VkIGluIFNjYW5mLiAqKVxudHlwZSBjb3VudGVyID1cbiAgfCBMaW5lX2NvdW50ZXIgICAgICgqICAlbCAgICAgICopXG4gIHwgQ2hhcl9jb3VudGVyICAgICAoKiAgJW4gICAgICAqKVxuICB8IFRva2VuX2NvdW50ZXIgICAgKCogICVOLCAlTCAgKilcblxuKCoqKilcblxuKCogUGFkZGluZyBvZiBzdHJpbmdzIGFuZCBudW1iZXJzLiAqKVxudHlwZSAoJ2EsICdiKSBwYWRkaW5nID1cbiAgKCogTm8gcGFkZGluZyAoZXg6IFwiJWRcIikgKilcbiAgfCBOb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IFBwX2ZpdHMgICAoKiBJbnRlcm5hbCB1c2FnZTogd2hlbiBhIGJsb2NrIGZpdHMgb24gYSBzaW5nbGUgbGluZSAqKVxuXG4oKiBGb3JtYXR0aW5nIGVsZW1lbnQgdXNlZCBieSB0aGUgRm9ybWF0IHByZXR0eS1wcmludGVyLiAqKVxudHlwZSBmb3JtYXR0aW5nX2xpdCA9XG4gIHwgQ2xvc2VfYm94ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqIEBdICAgKilcbiAgfCBDbG9zZV90YWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogQH0gICAqKVxuICB8IEJyZWFrIG9mIHN0cmluZyAqIGludCAqIGludCAgICAgICAgICAoKiBALCB8IEAgIHwgQDsgfCBAOzw+ICopXG4gIHwgRkZsdXNoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqIEA/ICAgKilcbiAgfCBGb3JjZV9uZXdsaW5lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogQFxcbiAgKilcbiAgfCBGbHVzaF9uZXdsaW5lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogQC4gICAqKVxuICB8IE1hZ2ljX3NpemUgb2Ygc3RyaW5nICogaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAoKiBAPG4+ICopXG4gIHwgRXNjYXBlZF9hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqIEBAICAgKilcbiAgfCBFc2NhcGVkX3BlcmNlbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogQCUlICAqKVxuICB8IFNjYW5faW5kaWMgb2YgY2hhciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiBAWCAgICopXG5cbigqIEZvcm1hdHRpbmcgZWxlbWVudCB1c2VkIGJ5IHRoZSBGb3JtYXQgcHJldHR5LXBy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nIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVTICopXG4gICAgICAoJ3gsIHN0cmluZyAtPiAnYSkgcGFkZGluZyAqICgnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXQgLT5cbiAgICAgICAgKCd4LCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdFxuICB8IEludCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVbZGl4WHVvXSAqKVxuICAgICAgaW50X2NvbnYgKiAoJ3gsICd5KSBwYWRkaW5nICogKCd5LCBpbnQgLT4gJ2EpIHByZWNpc2lvbiAqXG4gICAgICAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10IC0+XG4gICAgICAgICgneCwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXRcbiAgfCBJbnQzMiA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAlbFtkaXhYdW9dICopXG4gICAgICBpbnRfY29udiAqICgneCwgJ3kpIHBhZGRpbmcgKiAoJ3ksIGludDMyIC0+ICdhKSBwcmVjaXNpb24gKlxuICAgICAgKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdCAtPlxuICAgICAgICAoJ3gsICdiLCAnYywgJ2QsICdlLCAnZikgZm10XG4gIHwgTmF0aXZlaW50IDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJW5bZGl4WHVvXSAqKVxuICAgICAgaW50X2NvbnYgKiAoJ3gsICd5KSBwYWRkaW5nICogKCd5LCBuYXRpdmVpbnQgLT4gJ2EpIHByZWNpc2lvbiAqXG4gICAgICAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10IC0+XG4gICAgICAgICgneCwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXRcbiAgfCBJbnQ2NCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAlTFtkaXhYdW9dICopXG4gICAgICBpbnRfY29udiAqICgneCwgJ3kpIHBhZGRpbmcgKiAoJ3ksIGludDY0IC0+ICdhKSBwcmVjaXNpb24gKlxuICAgICAgKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdCAtPlxuICAgICAgICAoJ3gsICdiLCAnYywgJ2QsICdlLCAnZikgZm10XG4gIHwgRmxvYXQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJVtmZUVnR0ZoSF0gKilcbiAgICAgIGZsb2F0X2NvbnYgKiAoJ3gsICd5KSBwYWRkaW5nICogKCd5LCBmbG9hdCAtPiAnYSkgcHJlY2lzaW9uICpcbiAgICAgICgnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXQgLT5cbiAgICAgICAgKCd4LCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdFxuICB8IEJvb2wgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVbYkJdICopXG4gICAgICAoJ3gsIGJvb2wgLT4gJ2EpIHBhZGRpbmcgKiAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10IC0+XG4gICAgICAgICgneCwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXRcbiAgfCBGbHVzaCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAlISAqKVxuICAgICAgKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdCAtPlxuICAgICAgICAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10XG5cbiAgfCBTdHJpbmdfbGl0ZXJhbCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiBhYmMgKilcbiAgICAgIHN0cmluZyAqICgnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXQgLT5cbiAgICAgICAgKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdFxuICB8IENoYXJfbGl0ZXJhbCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqIHggKilcbiAgICAgIGNoYXIgKiAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10IC0+XG4gICAgICAgICgnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXRcblxuICB8IEZvcm1hdF9hcmcgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICV7Li4uJX0gKilcbiAgICAgIHBhZF9vcHRpb24gKiAoJ2csICdoLCAnaSwgJ2osICdrLCAnbCkgZm10dHkgKlxuICAgICAgKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdCAtPlxuICAgICAgICAoKCdnLCAnaCwgJ2ksICdqLCAnaywgJ2wpIGZvcm1hdDYgLT4gJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10XG4gIHwgRm9ybWF0X3N1YnN0IDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJSguLi4lKSAqKVxuICAgICAgcGFkX29wdGlvbiAqXG4gICAgICAoJ2csICdoLCAnaSwgJ2osICdrLCAnbCxcbiAgICAgICAnZzIsICdiLCAnYywgJ2oyLCAnZCwgJ2EpIGZtdHR5X3JlbCAqXG4gICAgICAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10IC0+XG4gICAgICAoKCdnLCAnaCwgJ2ksICdqLCAnaywgJ2wpIGZvcm1hdDYgLT4gJ2cyLCAnYiwgJ2MsICdqMiwgJ2UsICdmKSBmbXRcblxuICAoKiBQcmludGYgYW5kIEZvcm1hdCBzcGVjaWZpYyBjb25zdHJ1Y3Rvci4gKilcbiAgfCBBbHBoYSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAlYSAqKVxuICAgICAgKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdCAtPlxuICAgICAgICAoKCdiIC0+ICd4IC0+ICdjKSAtPiAneCAtPiAnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXRcbiAgfCBUaGV0YSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAldCAqKVxuICAgICAgKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdCAtPlxuICAgICAgICAoKCdiIC0+ICdjKSAtPiAnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmbXRcblxuICAoKiBGb3JtYXQgc3BlY2lmaWMgY29uc3RydWN0b3I6ICopXG4gIHwgRm9ybWF0dGluZ19saXQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogQF8gKilcbiAgICAgIGZvcm1hdHRpbmdfbGl0ICogKCdhLCAnYiwgJ2MsICdkLCAnZSwgJ2YpIGZtdCAtPlxuICAgICAgICAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10XG4gIHwgRm9ybWF0dGluZ19nZW4gOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqIEBfICopXG4gICAgICAoJ2ExLCAnYiwgJ2MsICdkMSwgJ2UxLCAnZjEpIGZvcm1hdHRpbmdfZ2VuICpcbiAgICAgICgnZjEsICdiLCAnYywgJ2UxLCAnZTIsICdmMikgZm10IC0+ICgnYTEsICdiLCAnYywgJ2QxLCAnZTIsICdmMikgZm10XG5cbiAgKCogU2NhbmYgc3BlY2lmaWMgY29uc3RydWN0b3JzOiAqKVxuICB8IFJlYWRlciA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVyICopXG4gICAgICAoJ2EsICdiLCAnYywgJ2QsICdlLCAnZikgZm10IC0+XG4gICAgICAgICgneCAtPiAnYSwgJ2IsICdjL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NpZmljYXRpb24gKilcbiAgfCBFbmRfb2ZfZm9ybWF0IDpcbiAgICAgICAgKCdmLCAnYiwgJ2MsICdlLCAnZSwgJ2YpIGZtdFxuXG4oKioqKVxuXG4oKiBUeXBlIGZvciBpZ25vcmVkIHBhcmFtZXRlcnMgKHNlZSBcIiVfXCIpLiAqKVxuYW5kICgnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBpZ25vcmVkID1cbiAgfCBJZ25vcmVkX2NoYXIgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAlX2MgKilcbiAgICAgICgnYSwgJ2IsICdjLCAnZCwgJ2QsICdhKSBpZ25vcmVkXG4gIHwgSWdub3JlZF9jYW1sX2NoYXIgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJV9DICopXG4gICAgICAoJ2EsICdiLCAnYywgJ2QsICdkLCAnYSkgaWdub3JlZFxuICB8IElnbm9yZWRfc3RyaW5nIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVfcyAqKVxuICAgICAgcGFkX29wdGlvbiAtPiAoJ2EsICdiLCAnYywgJ2QsICdkLCAnYSkgaWdub3JlZFxuICB8IElnbm9yZWRfY2FtbF9zdHJpbmcgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVfUyAqKVxuICAgICAgcGFkX29wdGlvbiAtPiAoJ2EsICdiLCAnYywgJ2QsICdkLCAnYSkgaWdub3JlZFxuICB8IElnbm9yZWRfaW50IDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVfZCAqKVxuICAgICAgaW50X2NvbnYgKiBwYWRfb3B0aW9uIC0+ICgnYSwgJ2IsICdjLCAnZCwgJ2QsICdhKSBpZ25vcmVkXG4gIHwgSWdub3JlZF9pbnQzMiA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJV9sZCAqKVxuICAgICAgaW50X2NvbnYgKiBwYWRfb3B0aW9uIC0+ICgnYSwgJ2IsICdjLCAnZCwgJ2QsICdhKSBpZ25vcmVkXG4gIHwgSWdub3JlZF9uYXRpdmVpbnQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJV9uZCAqKVxuICAgICAgaW50X2NvbnYgKiBwYWRfb3B0aW9uIC0+ICgnYSwgJ2IsICdjLCAnZCwgJ2QsICdhKSBpZ25vcmVkXG4gIHwgSWdub3JlZF9pbnQ2NCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJV9MZCAqKVxuICAgICAgaW50X2NvbnYgKiBwYWRfb3B0aW9uIC0+ICgnYSwgJ2IsICdjLCAnZCwgJ2QsICdhKSBpZ25vcmVkXG4gIHwgSWdub3JlZF9mbG9hdCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCogJV9mICopXG4gICAgICBwYWRfb3B0aW9uICogcHJlY19vcHRpb24gLT4gKCdhLCAnYiwgJ2MsICdkLCAnZCwgJ2EpIGlnbm9yZWRcbiAgfCBJZ25vcmVkX2Jvb2wgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAlX0IgKilcbiAgICAgIHBhZF9vcHRpb24gLT4gKCdhLCAnYiwgJ2MsICdkLCAnZCwgJ2EpIGlnbm9yZWRcbiAgfCBJZ25vcmVkX2Zvcm1hdF9hcmcgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiAlX3suLi4lfSAqKVxuICAgICAgcGFkX29wdGlvbiAqICgnZywgJ2gsICdpLCAnaiwgJ2ssICdsKSBmbXR0eSAtPlxuICAgICAgICAoJ2EsICdiLCAnYywgJ2QsICdkLCAnYSkgaWdub3JlZFxuICB8IElnbm9yZWRfZm9ybWF0X3N1YnN0IDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqICVfKC4uLiUpICopX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NvbmNhdF9mbXQgcmVzdCBmbXQyKVxuICB8IElnbm9yZWRfcGFyYW0gKGlnbiwgcmVzdCkgLT5cbiAgICBJZ25vcmVkX3BhcmFtIChpZ24sIGNvbmNhdF9mbXQgcmVzdCBmbXQyKVxuXG4gIHwgRm9ybWF0dGluZ19saXQgKGZtdGluZ19saXQsIHJlc3QpIC0+XG4gICAgRm9ybWF0dGluZ19saXQgKGZtdGluZ19saXQsIGNvbmNhdF9mbXQgcmVzdCBmbXQyKVxuICB8IEZvcm1hdHRpbmdfZ2VuIChmbXRpbmdfZ2VuLCByZXN0KSAtPlxuICAgIEZvcm1hdHRpbmdfZ2VuIChmbXRpbmdfZ2VuLCBjb25jYXRfZm10IHJlc3QgZm10MilcblxuICB8IEVuZF9vZl9mb3JtYXQgLT5cbiAgICBmbXQyXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBHYWJyaWVsIFNjaGVyZXIsIHByb2pldCBQYXJ0b3V0LCBJTlJJQSBQYXJpcy1TYWNsYXkgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDIwIEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbigqIENhbWxpbnRlcm5hbEF0b21pYyBpcyBhIGRlcGVuZGVuY3kgb2YgU3RkbGliLCBzbyBpdCBpcyBjb21waWxlZCB3aXRoXG4gICAtbm9wZXJ2YXNpdmVzLiAqKVxuZXh0ZXJuYWwgKCA9PSApIDogJ2EgLT4gJ2EgLT4gYm9vbCA9IFwiJWVxXCJcbmV4dGVybmFsICggKyApIDogaW50IC0+IGludCAtPiBpbnQgPSBcIiVhZGRpbnRcIlxuZXh0ZXJuYWwgaWdub3JlIDogJ2EgLT4gdW5pdCA9IFwiJWlnbm9yZVwiXG5cbigqIFdlIGFyZSBub3QgcmV1c2luZyAoJ2EgcmVmKSBkaXJlY3RseSB0byBtYWtlIGl0IGVhc2llciB0byByZWFzb25cbiAgIGFib3V0IGF0b21pY2l0eSBpZi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A9IGlnbm9yZSAoZmV0Y2hfYW5kX2FkZCByIDEpXG5sZXQgZGVjciByID0gaWdub3JlIChmZXRjaF9hbmRfYWRkIHIgKC0xKSlcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDE5OTYgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxuKCogRXhjZXB0aW9ucyAqKVxuXG5leHRlcm5hbCByZWdpc3Rlcl9uYW1lZF92YWx1ZSA6IHN0cmluZyAtPiAnYSAtPiB1bml0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IFwiY2FtbF9yZWdpc3Rlcl9uYW1lZF92YWx1ZVwiXG5cbmxldCAoKSA9XG4gICgqIGZvciBydW50aW1lL2ZhaWxfbmF0LmMgKilcbiAgcmVnaXN0ZXJfbmFtZWRfdmFsdWUgXCJQZXJ2YXNpdmVzLmFycmF5X2JvdW5kX2Vycm9yXCJcbiAgICAoSW52YWxpZF9hcmd1bWVudCBcImluZGV4IG91dCBvZiBib3VuZHNcIilcblxuZXh0ZXJuYWwgcmFpc2UgOiBleG4gLT4gJ2EgPSBcIiVyYWlzZVwiXG5leHRlcm5hbCByYWlzZV9ub3RyYWNlIDogZXhuIC0+ICdhID0gXCIlcmFpc2Vfbm90cmFjZVwiXG5cbmxldCBmYWlsd2l0aCBzID0gcmFpc2UoRmFpbHVyZSBzKVxubGV0IGludmFsaWRfYXJnIHMgPSByYWlzZShJbnZhbGlkX2FyZ3VtZW50IHMpXG5cbmV4Y2VwdGlvbiBFeGl0XG5leGNlcHRpb24gTWF0Y2hfZmFpbHVyZSA9IE1hdGNoX2ZhaWx1cmVcbmV4Y2VwdGlvbiBBc3NlcnRfZmFpbHVyZSA9IEFzc2VydF9mYWlsdXJlXG5leGNlcHRpb24gSW52YWxpZF9hcmd1bWVudCA9IEludm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FxubW9kdWxlIFNjYW5mICAgICAgICA9IFNjYW5mXG5tb2R1bGUgU2VxICAgICAgICAgID0gU2VxXG5tb2R1bGUgU2V0ICAgICAgICAgID0gU2V0XG5tb2R1bGUgU3RhY2sgICAgICAgID0gU3RhY2tcbm1vZHVsZSBTdGRMYWJlbHMgICAgPSBTdGRMYWJlbHNcbm1vZHVsZSBTdHJlYW0gICAgICAgPSBTdHJlYW1cbm1vZHVsZSBTdHJpbmcgICAgICAgPSBTdHJpbmdcbm1vZHVsZSBTdHJpbmdMYWJlbHMgPSBTdHJpbmdMYWJlbHNcbm1vZHVsZSBTeXMgICAgICAgICAgPSBTeXNcbm1vZHVsZSBVY2hhciAgICAgICAgPSBVY2hhclxubW9kdWxlIFVuaXQgICAgICAgICA9IFVuaXRcbm1vZHVsZSBXZWFrICAgICAgICAgPSBXZWFrXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICBKZXJlbWllIERpbWlubywgSmFuZSBTdHJlZXQgRXVyb3BlICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDE3IEphbmUgU3RyZWV0IEdyb3VwIExMQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbigqKiBAZGVwcmVjYXRlZCBVc2UgeyFTdGRsaWJ9ICopXG5cbmV4dGVybmFsIHJhaXNlIDogZXhuIC0+ICdhID0gXCIlcmFpc2VcIlxuZXh0ZXJuYWwgcmFpc2Vfbm90cmFjZSA6IGV4biAtPiAnYSA9IFwiJXJhaXNlX25vdHJhY2VcIlxubGV0IGludmFsaWRfYXJnID0gaW52YWxpZF9hcmdcbmxldCBmYWlsd2l0aCA9IGZhaWx3aXRoXG5leGNlcHRpb24gRXhpdFxuZXh0ZXJuYWwgKCA9ICkgOiAnYSAtPiAnYSAtPiBib29sID0gXCIlZXF1YWxcIlxuZXh0ZXJuYWwgKCA8PiApIDogJ2EgLT4gJ2EgLT4gYm9vbCA9IFwiJW5vdGVxdWFsXCJcbmV4dGVybmFsICggPCApIDogJ2EgLT4gJ2EgLT4gYm9vbCA9IFwiJWxlc3N0aGFuXCJcbmV4dGVybmFsICggPiApIDogJ2EgLT4gJ2EgLT4gYm9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gJ2UsICdmKSBmb3JtYXQ2IC0+XG4gICgnYSwgJ2IsICdjLCAnZCwgJ2UsICdmKSBmb3JtYXQ2ID0gXCIlaWRlbnRpdHlcIlxubGV0ICggXl4gKSA9ICggXl4gKVxubGV0IGV4aXQgPSBleGl0XG5sZXQgYXRfZXhpdCA9IGF0X2V4aXRcbmxldCB2YWxpZF9mbG9hdF9sZXhlbSA9IHZhbGlkX2Zsb2F0X2xleGVtXG5sZXQgZG9fYXRfZXhpdCA9IGRvX2F0X2V4aXRcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgR2FicmllbCBTY2hlcmVyLCBwcm9qZXQgUGFyc2lmYWwsIElOUklBIFNhY2xheSAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMTkgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxs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KilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDE5OTYgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxuKCogT3BlcmF0aW9ucyBvbiBpbnRlcm5hbCByZXByZXNlbnRhdGlvbnMgb2YgdmFsdWVzICopXG5c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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgIERhbWllbiBEb2xpZ2V6LCBwcm9qZXQgUGFyYSwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDE5OTcgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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lzIG5vdCB0YWtlbiBpdCB3aWxsIGlzc3VlIGFcbiAgICAgICB3YXJuaW5nIDU5IChtb2RpZmljYXRpb24gb2YgYW4gaW1tdXRhYmxlIHZhbHVlKSAqKVxuICBsZXQgbHp2ID0gU3lzLm9wYXF1ZV9pZGVudGl0eSBsenYgaW5cbiAgbGV0IHggPSBPYmoucmVwciBsenYgaW5cbiAgbGV0IHQgPSBPYmoudGFnIHggaW5cbiAgaWYgdCA9IE9iai5mb3J3YXJkX3RhZyB0aGVuIChPYmoub2JqIChPYmouZmllbGQgeCAwKSA6ICdhcmcpIGVsc2VcbiAgaWYgdCA8PiBPYmoubGF6eV90YWcgdGhlbiAoT2JqLm9iaiB4IDogJ2FyZylcbiAgZWxzZSBmb3JjZV9sYXp5X2Jsb2NrIGx6dlxuXG5cbmxldCBmb3JjZV92YWwgKGx6diA6ICdhcmcgbGF6eV90KSA9XG4gIGxldCB4ID0gT2JqLnJlcHIgbHp2IGluXG4gIGxldCB0ID0gT2JqLnRhZyB4IGluXG4gIGlmIHQgPSBPYmouZm9yd2FyZF90YWcgdGhlbiAoT2JqLm9iaiAoT2JqLmZpZWxkIHggMCkgOiAnYXJnKSBlbHNlXG4gIGlmIHQgPD4gT2JqLmxhenlfdGFnIHRoZW4gKE9iai5vYmogeCA6ICdhcmcpXG4gIGVsc2UgZm9yY2VfdmFsX2xhenlfYmxvY2sgbHp2XG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBEYW1pZW4gRG9saWdleiwgcHJvamV0IFBhcmEsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk3IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbigqIE1vZHVsZSBbTGF6eV06IGRlZmVycmVkIGNvbXB1dGF0aW9ucyAqKVxuXG5cbigqXG4gICBXQVJOSU5HOiBzb21lIHB1cnBsZSBtYWdpYyBpcyBnb2luZyBvbiBoZ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2KSBpblxuICBpZiB0ID0gT2JqLmZvcndhcmRfdGFnIHx8IHQgPSBPYmoubGF6eV90YWcgfHwgdCA9IE9iai5kb3VibGVfdGFnIHRoZW4gYmVnaW5cbiAgICBtYWtlX2ZvcndhcmQgdlxuICBlbmQgZWxzZSBiZWdpblxuICAgIChPYmoubWFnaWMgdiA6ICdhcmcgdClcbiAgZW5kXG5cblxubGV0IGlzX3ZhbCAobCA6ICdhcmcgdCkgPSBPYmoudGFnIChPYmoucmVwciBsKSA8PiBPYmoubGF6eV90YWdcblxubGV0IGxhenlfZnJvbV9mdW4gPSBmcm9tX2Z1blxuXG5sZXQgbGF6eV9mcm9tX3ZhbCA9IGZyb21fdmFsXG5cbmxldCBsYXp5X2lzX3ZhbCA9IGlzX3ZhbFxuXG5cbmxldCBtYXAgZiB4ID1cbiAgbGF6eSAoZiAoZm9yY2UgeCkpXG5cbmxldCBtYXBfdmFsIGYgeCA9XG4gIGlmIGlzX3ZhbCB4XG4gIHRoZW4gbGF6eV9mcm9tX3ZhbCAoZiAoZm9yY2UgeCkpXG4gIGVsc2UgbGF6eSAoZiAoZm9yY2UgeCkpXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgU2ltb24gQ3J1YW5lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDE3IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbigqIE1vZHVsZSBbU2VxXTogZnVuY3Rpb25hbCBpdGVyYXRvcnMgKilcblxudHlwZSArJ2Egbm9kZSA9XG4gIHwgTmlsXG4gIHwgQ29ucyBvZiAnYSAqICdhIHRcblxuYW5kICdhIHQgPSB1bml0IC0+ICdhIG5vZGVcblxubGV0IGVtcHR5ICgpID0gTmlsXG5cbmxldCByZXR1cm4geCAoKSA9IENvbnMgKHgsIGVtcHR5KVxuXG5sZXQgY29ucyB4IG5leHQgKCkgPSBDb25z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4c3MgPVxuICBkaWFnb25hbHMgZW1wdHkgeHNzXG5cbmxldCBtYXBfcHJvZHVjdCBmIHhzIHlzID1cbiAgY29uY2F0IChkaWFnb25hbHMgKFxuICAgIG1hcCAoZnVuIHggLT5cbiAgICAgIG1hcCAoZnVuIHkgLT5cbiAgICAgICAgZiB4IHlcbiAgICAgICkgeXNcbiAgICApIHhzXG4gICkpXG5cbmxldCBwcm9kdWN0IHhzIHlzID1cbiAgbWFwX3Byb2R1Y3QgKGZ1biB4IHkgLT4gKHgsIHkpKSB4cyB5c1xuXG5sZXQgb2ZfZGlzcGVuc2VyIGl0ID1cbiAgbGV0IHJlYyBjICgpID1cbiAgICBtYXRjaCBpdCgpIHdpdGhcbiAgICB8IE5vbmUgLT5cbiAgICAgICAgTmlsXG4gICAgfCBTb21lIHggLT5cbiAgICAgICAgQ29ucyAoeCwgYylcbiAgaW5cbiAgY1xuXG5sZXQgdG9fZGlzcGVuc2VyIHhzID1cbiAgbGV0IHMgPSByZWYgeHMgaW5cbiAgZnVuICgpIC0+XG4gICAgbWF0Y2ggKCFzKSgpIHdpdGhcbiAgICB8IE5pbCAtPlxuICAgICAgICBOb25lXG4gICAgfCBDb25zICh4LCB4cykgLT5cbiAgICAgICAgcyA6PSB4cztcbiAgICAgICAgU29tZSB4XG5cblxuXG5sZXQgcmVjIGludHMgaSAoKSA9XG4gIENvbnMgKGksIGludHMgKGkgKyAxKSlcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBPQ2FtbCBwcm9ncmFtbWVycyAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMTggSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxudHlwZSAnYSB0ID0gJ2Egb3B0aW9uID0gTm9uZSB8IFNvbWUgb2YgJ2FcblxubGV0IG5vbmUgPSBOb25lXG5sZXQgc29tZSB2ID0gU29tZSB2XG5sZXQgdmFsdWUgbyB+ZGVmYX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N0aW9uIE5vbmUgLT4gRXJyb3Igbm9uZSB8IFNvbWUgdiAtPiBPayB2XG5sZXQgdG9fbGlzdCA9IGZ1bmN0aW9uIE5vbmUgLT4gW10gfCBTb21lIHYgLT4gW3ZdXG5sZXQgdG9fc2VxID0gZnVuY3Rpb24gTm9uZSAtPiBTZXEuZW1wdHkgfCBTb21lIHYgLT4gU2VxLnJldHVybiB2XG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgT0NhbWwgcHJvZ3JhbW1lcnMgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDE4IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQ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iAtPiBTZXEucmV0dXJuIHYgfCBFcnJvciBfIC0+IFNlcS5lbXB0eVxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgVGhlIE9DYW1sIHByb2dyYW1tZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMjAxOCBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG50eXBlIHQgPSBib29sID0gZmFsc2UgfCB0cnVlXG5cbmV4dGVybmFsIG5vdCA6IGJvb2wgLT4gYm9vbCA9IFwiJWJvb2xub3RcIlxuZXh0ZXJuYWwgKCAmJiApIDogYm9vbCAtPiBib29sIC0+IGJvb2wgPSBcIiVzZXF1YW5kXCJcbmV4dGVybmFsICggfHwgKSA6IGJvb2wgLT4gYm9vbCAtPiBib29sID0gXCIlc2VxdW9yXCJcbmxldCBlcXVhbCA6IGJvb2wgLT4gYm9vbCAtPiBib29sID0gKCA9IClcbmxldCBjb21wYXJlIDogYm9vbCAtPiBib29sIC0+IGludCA9IFN0ZGxpYi5jb21wYXJlXG5leHRlcm5hbCB0b19pbnQgOiBib29sIC0+IGludCA9IFwiJWlkZW50aXR5XCJcbmxldCB0b19mbG9hdCA9IGZ1bmN0aW9uIGZhbHNlIC0+IDAuIHwgdHJ1ZSAtPiAxLlxuXG4oKlxubGV0IG9mX3N0cmluZyA9IGZ1bmN0aW9uXG58IFwiZmFsc2VcIiAtPiBTb21lIGZhbHNlXG58IFwidHJ1ZVwiIC0+IFNvbWUgdHJ1ZVxufCBfIC0+IE5vbmVcbiopXG5cbmxldCB0b19zdHJpbmcgPSBmdW5jdGlvbiBmYWxzZSAtPiBcImZhbHNlXCIgfCB0cnVlIC0+IFwidHJ1ZVwiXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICop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5cbnR5cGUgdCA9IGNoYXJcblxubGV0IGNvbXBhcmUgYzEgYzIgPSBjb2RlIGMxIC0gY29kZSBjMlxubGV0IGVxdWFsIChjMTogdCkgKGMyOiB0KSA9IGNvbXBhcmUgYzEgYzIgPSAwXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgIERhbmllbCBDLiBCdWVuemxpICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDE0IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIEx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3aGVuIHUgPD0gMHgwN0ZGIC0+IDJcbnwgdSB3aGVuIHUgPD0gMHhGRkZGIC0+IDNcbnwgdSB3aGVuIHUgPD0gMHgxMEZGRkYgLT4gNFxufCBfIC0+IGFzc2VydCBmYWxzZVxuXG5sZXQgdXRmXzE2X2J5dGVfbGVuZ3RoIHUgPSBtYXRjaCB0b19pbnQgdSB3aXRoXG58IHUgd2hlbiB1IDwgMCAtPiBhc3NlcnQgZmFsc2VcbnwgdSB3aGVuIHUgPD0gMHhGRkZGIC0+IDJcbnwgdSB3aGVuIHUgPD0gMHgxMEZGRkYgLT4gNFxufCBfIC0+IGFzc2VydCBmYWxzZVxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG4oKiBBbiBhbGlhcyBmb3IgdGhlIHR5cGUgb2YgbGlzdHMuICopXG50eXBlICdhIHQgPSAnYSBsaXN0ID0gW10gfCAoOjopIG9mICdhICogJ2EgbGlzdFxuXG4oKiBMaXN0IG9wZXJhdGlvbnMgKilcblxubGV0IHJlYyBsZW5ndGhfYXV4IGxlbiA9IGZ1bmN0aW9uXG4gICAgW10gLT4gbGVuXG4gIHwgXzo6bCAtPiBsZW5ndGhfYXV4IChsZW4gKyAxKSBsXG5cbmxldCBsZW5ndGggbCA9IGxlbmd0aF9hdXggMCBsXG5cbmxldCBjb25zIGEgbCA9IGE6OmxcblxubGV0IGhkID0gZnVuY3Rpb25cbiAgICBbXSAtPiBmYWlsd2l0aCBcImhkXCJcbiAgfCBhOjpfIC0+IGFcblxubGV0IHRsID0gZnVuY3Rpb25cbiAgICBbXSAtPiBmYWlsd2l0aCBcInRsXCJcbiAgfCBfOjpsIC0+IGxcblxubG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3JldiBsMSB0MiAoaDI6OmFjY3UpXG4gIGluXG4gIGxldCByZWMgc29ydCBuIGwgPVxuICAgIG1hdGNoIG4sIGwgd2l0aFxuICAgIHwgMiwgeDEgOjogeDIgOjogdGwgLT5cbiAgICAgICAgbGV0IHMgPVxuICAgICAgICAgIGxldCBjID0gY21wIHgxIHgyIGluXG4gICAgICAgICAgaWYgYyA9IDAgdGhlbiBbeDFdIGVsc2UgaWYgYyA8IDAgdGhlbiBbeDE7IHgyXSBlbHNlIFt4MjsgeDFdXG4gICAgICAgIGluXG4gICAgICAgIChzLCB0bClcbiAgICB8IDMsIHgxIDo6IHgyIDo6IHgzIDo6IHRsIC0+XG4gICAgICAgIGxldCBzID1cbiAgICAgICAgICBsZXQgYyA9IGNtcCB4MSB4MiBpblxuICAgICAgICAgIGlmIGMgPSAwIHRoZW5cbiAgICAgICAgICAgIGxldCBjID0gY21wIHgyIHgzIGluXG4gICAgICAgICAgICBpZiBjID0gMCB0aGVuIFt4Ml0gZWxzZSBpZiBjIDwgMCB0aGVuIFt4MjsgeDNdIGVsc2UgW3gzOyB4Ml1cbiAgICAgICAgICBlbHNlIGlmIGMgPCAwIHRoZW5cbiAgICAgICAgICAgIGxldCBjID0gY21wIHgyIHgzIGluXG4gICAgICAgICAgICBpZiBjID0gMCB0aGVuIFt4MTsgeDJdXG4gICAgICAgICAgICBlbHNlIGlmIGMgPCAwIHRoZW4gW3gxOyB4MjsgeDNdXG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgIGxldCBjID0gY21wIHgxIHgzIGluXG4gICAgICAgICAgICAgIGlmIGMgPSAwIHRoZW4gW3gxOyB4Ml1cbiAgICAgICAgICAgICAgZWxzZSBpZiBjIDwgMCB0aGVuIFt4MTsgeDM7IHgyXVxuICAgICAgICAgICAgICBlbHNlIFt4MzsgeDE7IHgyXVxuICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIGxldCBjID0gY21wIHgxIHgzIGluXG4gICAgICAgICAgICBpZiBjID0gMCB0aGVuIFt4MjsgeDFdXG4gICAgICAgICAgICBlbHNlIGlmIGMgPCAwIHRoZW4gW3gyOyB4MTsgeDNdXG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgIGxldCBjID0gY21wIHgyIHgzIGluXG4gICAgICAgICAgICAgIGlmIGMgPSAwIHRoZW4gW3gyOyB4MV1cbiAgICAgICAgICAgICAgZWxzZSBpZiBjIDwgMCB0aGVuIFt4MjsgeDM7IHgxXVxuICAgICAgICAgICAgICBlbHNlIFt4MzsgeDI7IHgxXVxuICAgICAgICBpblxuICAgICAgICAocywgdGwpXG4gICAgfCBuLCBsIC0+XG4gICAgICAgIGxldCBuMSA9IG4gYXNyIDEgaW5cbiAgICAgICAgbGV0IG4yID0gbiAtIG4xIGluXG4gICAgICAgIGxldCBzMSwgbDIgPSByZXZfc29ydCBuMSBsIGluXG4gICAgICAgIGxldCBzMiwgdGwgPSByZXZfc29ydCBuMiBsMiBpblxuICAgICAgICAocmV2X21lcmdlX3JldiBzMSBzMiBbXSwgdGwpXG4gIGFuZCByZXZfc29ydCBuIGwgPVxuICAgIG1hdGNoIG4sIGwgd2l0aFxuICAgIHwgMiwgeDEgOjogeDIgOjogdGwgLT5cbiAgICAgICAgbGV0IHMgPVxuICAgICAgICAgIGxldCBjID0gY21wIHgxIHgyIGluXG4gICAgICAgICAgaWYgYyA9IDAgdGhlbiBbeDFdIGVsc2UgaWYgYyA+IDAgdGhlbiBbeDE7IHgyXSBlbHNlIFt4MjsgeDFdXG4gICAgICAgIGluXG4gICAgICAgIChzLCB0bClcbiAgICB8IDMsIHgxIDo6IHgyIDo6IHgzIDo6IHRsIC0+XG4gICAgICAgIGxldCBzID1cbiAgICAgICAgICBsZXQgYyA9IGNtcCB4MSB4MiBpblxuICAgICAgICAgIGlmIGMgPSAwIHRoZW5cbiAgICAgICAgICAgIGxldCBjID0gY21wIHgyIHgzIGluXG4gICAgICAgICAgICBpZiBjID0gMCB0aGVuIFt4Ml0gZWxzZSBpZiBjID4gMCB0aGVuIFt4MjsgeDNdIGVsc2UgW3gzOyB4Ml1cbiAgICAgICAgICBlbHNlIGlmIGMgPiAwIHRoZW5cbiAgICAgICAgICAgIGxldCBjID0gY21wIHgyIHgzIGluXG4gICAgICAgICAgICBpZiBjID0gMCB0aGVuIFt4MTsgeDJdXG4gICAgICAgICAgICBlbHNlIGlmIGMgPiAwIHRoZW4gW3gxOyB4MjsgeDNdXG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgIGxldCBjID0gY21wIHgxIHgzIGluXG4gICAgICAgICAgICAgIGlmIGMgPSAwIHRoZW4gW3gxOyB4Ml1cbiAgICAgICAgICAgICAgZWxzZSBpZiBjID4gMCB0aGVuIFt4MTsgeDM7IHgyXVxuICAgICAgICAgICAgICBlbHNlIFt4MzsgeDE7IHgyXVxuICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIGxldCBjID0gY21wIHgxIHgzIGluXG4gICAgICAgICAgICBpZiBjID0gMCB0aGVuIFt4MjsgeDFdXG4gICAgICAgICAgICBlbHNlIGlmIGMgPiAwIHRoZW4gW3gyOyB4MTsgeDNdXG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgIGxldCBjID0gY21wIHgyIHgzIGluXG4gICAgICAgICAgICAgIGlmIGMgPSAwIHRoZW4gW3gyOyB4MV1cbiAgICAgICAgICAgICAgZWxzZSBpZiBjID4gMCB0aGVuIFt4MjsgeDM7IHgxXVxuICAgICAgICAgICAgICBlbHNlIFt4MzsgeDI7IHgxXVxuICAgICAgICBpblxuICAgICAgICAocywgdGwpXG4gICAgfCBuLCBsIC0+XG4gICAgICAgIGxldCBuMSA9IG4gYXNyIDEgaW5cbiAgICAgICAgbGV0IG4yID0gbiAtIG4xIGluXG4gICAgICAgIGxldCBzMSwgbDIgPSBzb3J0IG4xIGwgaW5cbiAgICAgICAgbGV0IHMyLCB0bCA9IHNvcnQgbjIgbDIgaW5cbiAgICAgICAgKHJldl9tZXJnZSBzMSB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FcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBPQ2FtbCBwcm9ncmFtbWVycyAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMTggSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxudHlwZSB0ID0gaW50XG5cbmxldCB6ZXJvID0gMFxubGV0IG9uZSA9IDFcbmxldCBtaW51c19vbmUgPSAtMVxuZXh0ZXJuYWwgbmVnIDogaW50IC0+IGludCA9IFwiJW5lZ2ludFwiXG5leHRlcm5hbCBhZGQgOiBpbnQgLT4gaW50IC0+IGludCA9IFwiJWFkZGludFwiXG5leHRlcm5hbCBzdWIgOiBpbnQgLT4gaW50IC0+IGludCA9IFwiJXN1YmludFwiXG5leHRlcm5hbCBtdWwgOiBpbnQgLT4gaW50IC0+IGludCA9IFwiJW11bGludFwiXG5leHRlcm5hbCBkaXYgOiBpbnQgLT4gaW50IC0+IGludCA9IFwiJWRpdmludFwiXG5leHRlcm5hbCByZW0gOiBpbnQgLT4gaW50IC0+IGludCA9IFwiJW1vZGludFwiXG5leHRlcm5hbCBzdWNjIDogaW50IC0+IGludCA9IFwiJXN1Y2NpbnRcIlxuZXh0ZXJuYWwgcHJlZCA6IGludCAtPiBpbnQgPSBcIiVwcmVkaW50XCJcbmxldCBhYnMgeCA9IGlmIHggPj0gMCB0aGVuIHggZWxzZSAteFxubGV0IG1heF9pbnQgPSAoLTEpIGxzciAxXG5sZXQgbWluX2ludCA9IG1heF9pbnQgKyAxXG5leHRlcm5hbCBsb2dhbmQgOiBpbnQgLT4gaW50IC0+IGludCA9IFwiJWFuZGludFwiXG5leHRlcm5hbCBsb2dvciA6IGludCAtPiBpbnQgLT4gaW50ID0gXCIlb3JpbnRcIlxuZXh0ZXJuYWwgbG9neG9yIDogaW50IC0+IGludCAtPiBpbnQgPSBcIiV4b3JpbnRcIlxubGV0IGxvZ25vdCB4ID0gbG9neG9yIHggKC0xKVx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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDE5OTYgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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AoZ2V0IGIgKGkgKyAxKSlcbiAgICAgICAgfHwgbm90X2luX3g4MF90b194QkYgKGdldCBiIGxhc3QpXG4gICAgICAgIHRoZW4gZmFsc2VcbiAgICAgICAgZWxzZSBsb29wIG1heCBiIChsYXN0ICsgMSlcbiAgICB8ICdcXHhFMScgLi4gJ1xceEVDJyB8ICdcXHhFRScgLi4gJ1xceEVGJyAtPlxuICAgICAgICBsZXQgbGFzdCA9IGkgKyAyIGluXG4gICAgICAgIGlmIGxhc3QgPiBtYXhcbiAgICAgICAgfHwgbm90X2luX3g4MF90b194QkYgKGdldCBiIChpICsgMSkpXG4gICAgICAgIHx8IG5vdF9pbl94ODBfdG9feEJGIChnZXQgYiBsYXN0KVxuICAgICAgICB0aGVuIGZhbHNlXG4gICAgICAgIGVsc2UgbG9vcCBtYXggYiAobGFzdCArIDEpXG4gICAgfCAnXFx4RUQnIC0+XG4gICAgICAgIGxldCBsYXN0ID0gaSArIDIgaW5cbiAgICAgICAgaWYgbGFzdCA+IG1heFxuICAgICAgICB8fCBub3RfaW5feDgwX3RvX3g5RiAoZ2V0IGIgKGkgKyAxKSlcbiAgICAgICAgfHwgbm90X2luX3g4MF90b194QkYgKGdldCBiIGxhc3QpXG4gICAgICAgIHRoZW4gZmFsc2VcbiAgICAgICAgZWxzZSBsb29wIG1heCBiIChsYXN0ICsgMSlcbiAgICB8ICdcXHhGMCcgLT5cbiAgICAgICAgbGV0IGxhc3QgPSBpICsgMyBpblxuICAgICAgICBpZiBsYXN0ID4gbWF4XG4gICAgICAgIHx8IG5vdF9pbl94OTBfdG9feEJGIChnZXQgYiAoaSArIDEpKVxuICAgICAgICB8fCBub3RfaW5feDgwX3RvX3hCRiAoZ2V0IGIgKGkgKyAyKSlcbiAgICAgICAgfHwgbm90X2luX3g4MF90b194QkYgKGdldCBiIGxhc3QpXG4gICAgICAgIHRoZW4gZmFsc2VcbiAgICAgICAgZWxzZSBsb29wIG1heCBiIChsYXN0ICsgMSlcbiAgICB8ICdcX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dpdGhcbiAgICAgICAgfCB1IHdoZW4gdSA8IDB4REMwMCB8fCB1ID4gMHhERkZGIC0+IGZhbHNlXG4gICAgICAgIHwgX2xvIC0+IGxvb3AgbWF4IGIgKGkgKyA0KVxuICBpblxuICBsb29wIChsZW5ndGggYiAtIDEpIGIgMFxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgIERhbWllbiBEb2xpZ2V6LCBwcm9qZXQgR2FsbGl1bSwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMjAxNCBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxu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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBPQ2FtbCBwcm9ncmFtbWVycyAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMTggSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxudHlwZSB0ID0gdW5pdCA9ICgpXG5cbmxldCBlcXVhbCAoKSAoKSA9IHRydWVcbmxldCBjb21wYXJlICgpICgpID0gMFxubGV0IHRvX3N0cmluZyAoKSA9IFwiKClcIlxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NyBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKC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qKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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vZl9zZXEgaSA9XG4gIGxldCBsID0gU2VxLmZvbGRfbGVmdCAoZnVuIGFjYyB4IC0+IHg6OmFjYykgW10gaSBpblxuICBvZl9yZXZfbGlzdCBsXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgIE5pY29sYXMgT2plZGEgQmFyLCBMZXhpRmkgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDE4IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGh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9nZXQgYSBpKSlcbiAgICBkb25lO1xuICAgIHJcblxuZW5kXG5cbm1vZHVsZSBBcnJheUxhYmVscyA9IEFycmF5XG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgIC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wgKHVuc2lnbmVkX2RpdiBuIGQpIGQpXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpb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GQgPVxuICBzdWIgbiAobXVsICh1bnNpZ25lZF9kaXYgbiBkKSBkKVxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVja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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oK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mbmFtZSA9IGxjcC5wb3NfZm5hbWV9O1xuICBsYi5sZXhfYnVmZmVyX2xlbiA8LSAwO1xuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG4oKiBUaGUgcGFyc2luZyBlbmdpbmUgKilcblxub3BlbiBMZXhpbmdcblxuKCogSW50ZXJuYWwgaW50ZXJmYWNlIHRvIHRoZSBwYXJzaW5nIGVuZ2luZSAqKVxuXG50eXBlIHBhcnNlcl9lbnYgPVxuICB7IG11dGFibGUgc19zdGFjayA6IGludCBhcnJheTsgICAgICAgICgqIFN0YXRlcyAqKVxuICAgIG11dGFibGUgdl9zdGFjayA6IE9iai50IGFycmF5OyAgICAgICgqIFNlbWFudGljIGF0dHJpYnV0ZXMgKilcbiAgICBtdXRhYmxlIHN5bWJfc3RhcnRfc3RhY2sgOiBwb3NpdGlvbiBhcnJheTsgKCogU3RhcnQgcG9zaXRpb25zICopXG4gICAgbXV0YWJsZSBzeW1iX2VuZF9zdGFjayA6IHBvc2l0aW9uIGFycmF5OyAgICgqIEVuZCBwb3NpdGlvbnMgKilcbiAgICBtdXRhYmxlIHN0YWNrc2l6ZSA6IGludDsgICAgICAgICAgICAoKiBTaXplIG9mIHRoZSBzdGFja3MgKilcbiAgICBtdXRhYmxlIHN0YWNrYmFzZSA6IGludDsgICAgICAgICAgICAoKiBCYXNlIHNwIGZvciBjdXJyZW50IHBhcnNlICopXG4gICAgbXV0YWJsZSBjdXJyX2NoYXIgOiBpbnQ7ICAgICAgICAgICAgKCogTGFzdCB0b2tlbiByZWFkICopXG4gICAgbXV0YWJsZSBsdmFsIDogT2JqLnQ7ICAgICAgICAgICAgICAgKCogSXRzIHNlbW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XQgcGFyc2VfZXJyb3IgKF8gOiBzdHJpbmcpID0gKClcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDE5OTYgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxuKCogU2V0cyBvdmVyIG9yZGVyZWQgdHlwZXMgKilcblxubW9kdWxlIHR5cGUgT3JkZXJlZFR5cGUgPVxuICBzaWdcbiAgICB0eXBlIHRcbiAgICB2YWwgY29tcGFyZTogdCAtPiB0IC0+IGludFxuICBlbmRcblxubW9kdWxlIHR5cGUgUyA9XG4gIHNpZ1xuICAgIHR5cGUgZWx0XG4gICAgdHlwZSB0XG4gICAgdmFsIGVtcHR5OiB0XG4gICAgdmFsIGlzX2VtcHR5OiB0IC0+IGJvb2xcbiAgICB2YWwgbWVtOiBlbHQgLT4gdCAtPiBib29sXG4gICAgdmFsIGFkZDogZWx0IC0+IHQgLT4gdFxuICAgIHZhbCBzaW5nbGV0b246IGVsdCAtPiB0XG4gICAgdmFsIHJlbW92ZTogZWx0IC0+IHQgLT4gdFxuICAgIHZhbCB1bmlvbjogdCAtPiB0IC0+IHRcbiAgICB2YWwgaW50ZXI6IHQgLT4gdCAtPiB0XG4gICAgdmFsIGRpc2pvaW50OiB0IC0+IHQgLT4gYm9vbFxuICAgIHZhbCBkaWZmOiB0IC0+IHQgLT4gdFxuICAgIHZhbCBjb21wYXJlOiB0IC0+IHQgLT4gaW50XG4gICAgdmFsIGVxdWFsOiB0IC0+IHQgLT4gYm9vbFxuICAgIHZhbCBzdWJzZXQ6IHQgLT4gdCAtPiBib29sXG4gICAgdmFsIGl0ZXI6IChlbHQgLT4gdW5pdCkgLT4gdCAtPiB1bml0XG4gICAgdmFsIG1hcDogKGVsdCAtPiBlbHQpIC0+IHQgLT4gdFxuICAgIHZhbCBmb2xkOiAoZWx0I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HRoZW5cbiAgICAgICAgICAgICAgY3JlYXRlIGxsIGx2IChjcmVhdGUgbHIgdiByKVxuICAgICAgICAgICAgZWxzZSBiZWdpblxuICAgICAgICAgICAgICBtYXRjaCBsciB3aXRoXG4gICAgICAgICAgICAgICAgRW1wdHkgLT4gaW52YWxpZF9hcmcgXCJTZXQuYmFsXCJcbiAgICAgICAgICAgICAgfCBOb2Rle2w9bHJsOyB2PWxydjsgcj1scnJ9LT5cbiAgICAgICAgICAgICAgICAgIGNyZWF0ZSAoY3JlYXRlIGxsIGx2IGxybCkgbHJ2IChjcmVhdGUgbHJyIHYgcilcbiAgICAgICAgICAgIGVuZFxuICAgICAgZW5kIGVsc2UgaWYgaHIgPiBobCArIDIgdGhlbiBiZWdpblxuICAgICAgICBtYXRjaCByIHdpdGhcbiAgICAgICAgICBFbXB0eSAtPiBpbnZhbGlkX2FyZyBcIlNldC5iYWxcIlxuICAgICAgICB8IE5vZGV7bD1ybDsgdj1ydjsgcj1ycn0gLT5cbiAgICAgICAgICAgIGlmIGhlaWdodCByciA+PSBoZWlnaHQgcmwgdGhlblxuICAgICAgICAgICAgICBjcmVhdGUgKGNyZWF0ZSBsIHYgcmwpIHJ2IHJyXG4gICAgICAgICAgICBlbHNlIGJlZ2luXG4gICAgICAgICAgICAgIG1hdGNoIHJsIHdpdGhcbiAgICAgICAgICAgICAgICBFbXB0eSAtPiBpbnZhbGlkX2FyZyBcIlNldC5iYWxcIlxuICAgICAgICAgICAgICB8IE5vZGV7bD1ybGw7IHY9cmx2OyByPXJscn0gLT5cbiAgICAgICAgICAgICAgICAgIGNyZWF0ZSAoY3JlYXRlIGwgdiBybGwpIHJsdiAoY3JlYXRlIHJsciBydiBycilcbiAgICAgICAgICAgIGVuZFxuICAgICAgZW5kIGVsc2VcbiAgICAgICAgTm9kZXtsOyB2OyByOyBoPShpZiBobCA+PSBociB0aGVuIGhsICsgMSBlbHNlIGhyICsgMSl9XG5cbiAgICAoKiBJbnNlcnRpb24gb2Ygb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AgICAgICBlbHNlXG4gICAgICAgICAgICBpZiBjIDwgMCB0aGVuXG4gICAgICAgICAgICAgIGxldCBsbCA9IHJlbW92ZSB4IGwgaW5cbiAgICAgICAgICAgICAgaWYgbCA9PSBsbCB0aGVuIHRcbiAgICAgICAgICAgICAgZWxzZSBiYWwgbGwgdiByXG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgIGxldCByciA9IHJlbW92ZSB4IHIgaW5cbiAgICAgICAgICAgICAgaWYgciA9PSByciB0aGVuIHRcbiAgICAgICAgICAgICAgZWxzZSBiYWwgbCB2IHJyXG5cbiAgICBsZXQgcmVjIHVuaW9uIHMxIHMyID1cbiAgICAgIG1hdGNoIChzMSwgczIpIHdpdGhcbiAgICAgICAgKEVtcHR5LCB0MikgLT4gdDJcbiAgICAgIHwgKHQxLCBFbXB0eSkgLT4gdDFcbiAgICAgIHwgKE5vZGV7bD1sMTsgdj12MTsgcj1yMTsgaD1oMX0sIE5vZGV7bD1sMjsgdj12Mjsgcj1yMjsgaD1oMn0pIC0+XG4gICAgICAgICAgaWYgaDEgPj0gaDIgdGhlblxuICAgICAgICAgICAgaWYgaDIgPSAxIHRoZW4gYWRkIHYyIHMxIGVsc2UgYmVnaW5cbiAgICAgICAgICAgICAgbGV0IChsMiwgXywgcjIpID0gc3BsaXQgdjEgczIgaW5cbiAgICAgICAgICAgICAgam9pbiAodW5pb24gbDEgbDIpIHYxICh1bmlvbiByMSByMilcbiAgICAgICAgICAgIGVuZFxuICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIGlmIGgxID0gMSB0aGVuIGFkZCB2MSBzMiBlbHNlIGJlZ2luXG4gICAgICAgICAgICAgIGxldCAobDEsIF8sIHIxKSA9IHNwbGl0IHYyIHMxIGluXG4gICAgICAgICAgICAgIGpvaW4gKHVuaW9uIGwxIGwyKSB2MiAodW5pb24gcjEgcjIpXG4gICAgICAgICAgICBlbmRcblxuICAgIGxldCByZWMgaW50ZXIgczEgczIgPVxuICAgICAgb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gICB8IF8gLT4gYXV4IGxvdyBsIChNb3JlICh2LCByLCBjKSlcbiAgICAgICAgICAgIGVuZFxuICAgICAgaW5cbiAgICAgIHNlcV9vZl9lbnVtXyAoYXV4IGxvdyBzIEVuZClcbiAgZW5kXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgU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bmN0aW9uXG4gICAgICAgIEVtcHR5IC0+XG4gICAgICAgICAgKHYwLCBkMClcbiAgICAgIHwgTm9kZSB7bDsgdjsgZDsgcn0gLT5cbiAgICAgICAgICBpZiBmIHYgdGhlblxuICAgICAgICAgICAgZmluZF9maXJzdF9hdXggdiBkIGYgbFxuICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgIGZpbmRfZmlyc3RfYXV4IHYwIGQwIGYgclxuXG4gICAgbGV0IHJlYyBmaW5kX2ZpcnN0IGYgPSBmdW5jdGlvblxuICAgICAgICBFbXB0eSAtPlxuICAgICAgICAgIHJhaXNlIE5vdF9mb3VuZFxuICAgICAgfCBOb2RlIHtsOyB2OyBkOyByfSAtPlxuICAgICAgICAgIGlmIGYgdiB0aGVuXG4gICAgICAgICAgICBmaW5kX2ZpcnN0X2F1eCB2IGQgZiBsXG4gICAgICAgICAgZWxzZVxuICAgICAgICAgICAgZmluZF9maXJzdCBmIHJcblxuICAgIGxldCByZWMgZmluZF9maXJzdF9vcHRfYXV4IHYwIGQwIGYgPSBmdW5jdGlvblxuICAgICAgICBFbXB0eSAtPlxuICAgICAgICAgIFNvbWUgKHYwLCBkMClcbiAgICAgIHwgTm9kZSB7bDsgdjsgZDsgcn0gLT5cbiAgICAgICAgICBpZiBmIHYgdGhlblxuICAgICAgICAgICAgZmluZF9maXJzdF9vcHRfYXV4IHYgZCBmIGxcbiAgICAgICAgICBlbHNlXG4gICAgICAgICAgICBmaW5kX2ZpcnN0X29wdF9hdXggdjAgZDAgZiByXG5cbiAgICBsZXQgcmVjIGZpbmRfZmlyc3Rfb3B0IGYgPSBmdW5jdGlvblxuICAgICAgICBFbXB0eSAtPlxuICAgICAgICAgIE5vbmVcbiAgICAgIHwgTm9kZSB7bDsgdjsgZDsgcn0gLT5cbiAgICAgICAgICBpZiBmIHYgdGhlblxuICAgICAgICAgICAgZmluZF9maXJzdF9vcHRfYXV4IHYgZCBmIGxcbiAgICAgICAgICBlbHNlXG4gICAgICAgICAg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c3QpKVxuXG4gICAgbGV0IHRvX3Jldl9zZXEgYyA9XG4gICAgICByZXZfc2VxX29mX2VudW1fIChzbm9jX2VudW0gYyBFbmQpXG5cbiAgICBsZXQgdG9fc2VxX2Zyb20gbG93IG0gPVxuICAgICAgbGV0IHJlYyBhdXggbG93IG0gYyA9IG1hdGNoIG0gd2l0aFxuICAgICAgICB8IEVtcHR5IC0+IGNcbiAgICAgICAgfCBOb2RlIHtsOyB2OyBkOyByOyBffSAtPlxuICAgICAgICAgICAgYmVnaW4gbWF0Y2ggT3JkLmNvbXBhcmUgdiBsb3cgd2l0aFxuICAgICAgICAgICAgICB8IDAgLT4gTW9yZSAodiwgZCwgciwgYylcbiAgICAgICAgICAgICAgfCBuIHdoZW4gbjwwIC0+IGF1eCBsb3cgciBjXG4gICAgICAgICAgICAgIHwgXyAtPiBhdXggbG93IGwgKE1vcmUgKHYsIGQsIHIsIGMpKVxuICAgICAgICAgICAgZW5kXG4gICAgICBpblxuICAgICAgc2VxX29mX2VudW1fIChhdXggbG93IG0gRW5kKVxuZW5kXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbnR5cGUgJ2EgdCA9IHsgbXV0YWJsZSBjIDogJ2EgbGlzdDsgbXV0YWJsZSBsZW4gOiBpbnQ7IH1cblxuZXhjZXB0aW9uIEVtcHR5XG5cbmxldCBjcmVhdGUgKCkgPSB7IGMgPSBbXTsgbGVuID0gMDsgfVxuXG5sZXQgY2xlYXIgcyA9IHMuYyA8LSBbXTsgcy5sZW4gPC0gMFxuXG5sZXQgY29weSBzID0geyBjID0gcy5jOyBsZW4gPSBzLmxlbjsgfVxuXG5sZXQgcHVzaCB4IHMgPSBzLmMgPC0geCA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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgRnJhbmNvaXMgUG90dGllciwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgSmVyZW1pZSBEaW1pbm8sIEphbmUgU3RyZWV0IEV1cm9wZSAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMDIgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAg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0IDwtIHExLmZpcnN0O1xuICAgICAgcTIubGFzdCA8LSBxMS5sYXN0O1xuICAgICAgY2xlYXIgcTFcbiAgICB8IENvbnMgbGFzdCAtPlxuICAgICAgcTIubGVuZ3RoIDwtIHEyLmxlbmd0aCArIHExLmxlbmd0aDtcbiAgICAgIGxhc3QubmV4dCA8LSBxMS5maXJzdDtcbiAgICAgIHEyLmxhc3QgPC0gcTEubGFzdDtcbiAgICAgIGNsZWFyIHExXG5cbigqKiB7MSBJdGVyYXRvcnN9ICopXG5cbmxldCB0b19zZXEgcSA9XG4gIGxldCByZWMgYXV4IGMgKCkgPSBtYXRjaCBjIHdpdGhcbiAgICB8IE5pbCAtPiBTZXEuTmlsXG4gICAgfCBDb25zIHsgY29udGVudD14OyBuZXh0OyB9IC0+IFNlcS5Db25zICh4LCBhdXggbmV4dClcbiAgaW5cbiAgYXV4IHEuZmlyc3RcblxubGV0IGFkZF9zZXEgcSBpID0gU2VxLml0ZXIgKGZ1biB4IC0+IHB1c2ggeCBxKSBpXG5cbmxldCBvZl9zZXEgZyA9XG4gIGxldCBxID0gY3JlYXRlKCkgaW5cbiAgYWRkX3NlcSBxIGc7XG4gIHFcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgRGFuaWVsIGRlIFJhdWdsYXVkcmUsIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDE5OTcgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxudHlwZSAnYSB0ID0gJ2EgY2VsbCBvcHRpb25cbmFuZCAnYSBjZWxsID0geyBtdXRhYmxlIGNvdW50IDogaW50OyBtdXRhYmxlIGRhdGEgOiAnYSBkYXRhIH1cbmFuZCAnYSBkYXRhID1cbiAgICBTZW1wdHlcbiAgfCBTY29ucyBvZiAnYSAqICdhIGRhdGFcbiAgfCBTYXBwIG9mICdhIGRhdGEgKiAnYSBkYXRhXG4gIHwgU2xhenkgb2YgJ2EgZ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XCI7XG4gICAgICBmIGE7XG4gICAgICBwcmludF9zdHJpbmcgXCIsIFwiO1xuICAgICAgZHVtcF9kYXRhIGYgZDtcbiAgICAgIHByaW50X3N0cmluZyBcIilcIlxuICB8IFNhcHAgKGQxLCBkMikgLT5cbiAgICAgIHByaW50X3N0cmluZyBcIlNhcHAgKFwiO1xuICAgICAgZHVtcF9kYXRhIGYgZDE7XG4gICAgICBwcmludF9zdHJpbmcgXCIsIFwiO1xuICAgICAgZHVtcF9kYXRhIGYgZDI7XG4gICAgICBwcmludF9zdHJpbmcgXCIpXCJcbiAgfCBTbGF6eSBfIC0+IHByaW50X3N0cmluZyBcIlNsYXp5XCJcbiAgfCBTZ2VuIF8gLT4gcHJpbnRfc3RyaW5nIFwiU2dlblwiXG4gIHwgU2J1ZmZpbyBfIC0+IHByaW50X3N0cmluZyBcIlNidWZmaW9cIlxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgUGllcnJlIFdlaXMgYW5kIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5OSBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG4oKiBFeHRlbnNpYmxlIGJ1ZmZlcnMgKilcblxudHlwZSB0ID1cbiB7bXV0YWJsZSBidWZmZXIgOiBieXRlcztcbiAgbXV0YWJsZSBwb3NpdGlvbiA6IGludDtcbiAgbXV0YWJsZSBsZW5ndGggOiBpbnQ7XG4gIGluaXRpYWxfYnVmZmVyIDogYnl0ZXN9XG4oKiBJbnZhcmlhbnRzOiBhbGwgcGFydHMgb2YgdGhlIGNvZGUgcHJlc2VydmUgdGhlIGludmFyaWFudHMgdGhhdDpcbiAgIC0gWzAgPD0gYi5wb3NpdGlvbiA8PSBiLmxlbmd0aF1cbiAgIC0gW2IubGVuZ3RoID0gQnl0ZXMubGVuZ3RoIGIuYnVmZmVyXVxuXG4gICB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gYWRkX2ludDMyX25lIGIgKGlmIFN5cy5iaWdfZW5kaWFuIHRoZW4gc3dhcDMyIHggZWxzZSB4KVxuXG5sZXQgYWRkX2ludDMyX2JlIGIgeCA9XG4gIGFkZF9pbnQzMl9uZSBiIChpZiBTeXMuYmlnX2VuZGlhbiB0aGVuIHggZWxzZSBzd2FwMzIgeClcblxubGV0IGFkZF9pbnQ2NF9sZSBiIHggPVxuICBhZGRfaW50NjRfbmUgYiAoaWYgU3lzLmJpZ19lbmRpYW4gdGhlbiBzd2FwNjQgeCBlbHNlIHgpXG5cbmxldCBhZGRfaW50NjRfYmUgYiB4ID1cbiAgYWRkX2ludDY0X25lIGIgKGlmIFN5cy5iaWdfZW5kaWFuIHRoZW4geCBlbHNlIHN3YXA2NCB4KVxuXG5sZXQgYWRkX3VpbnQ4ID0gYWRkX2ludDhcbmxldCBhZGRfdWludDE2X25lID0gYWRkX2ludDE2X25lXG5sZXQgYWRkX3VpbnQxNl9sZSA9IGFkZF9pbnQxNl9sZVxubGV0IGFkZF91aW50MTZfYmUgPSBhZGRfaW50MTZfYmVcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICBCZW5vaXQgVmF1Z29uLCBFTlNUQSAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMTQgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxub3BlbiBDYW1saW50ZXJuYWxGb3JtYXRCYXNpY3NcblxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbiAgICAgICAgICAgKCogVG9vbHMgdG8gbWFuaXB1bGF0ZSBzY2FubmluZyBzZXQgb2YgY2hhcnMgKHNlZSAlWy4uLl0pICopXG5cbnR5cGUgbXV0YWJsZV9jaGFyX3NldCA9IGJ5dGVzXG5cbigqIENyZWF0ZSBhIGZyZXNoLCBlbXB0eSwgbXV0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AtPiBzdHJwdXRfYWNjIGIgcDsgaW52YWxpZF9hcmcgbXNnO1xuICB8IEVuZF9vZl9hY2MgICAgICAgICAgICAgICAtPiAoKVxuXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAoKiBFcnJvciBtYW5hZ2VtZW50ICopXG5cbigqIFJhaXNlIFtGYWlsdXJlXSB3aXRoIGEgcHJldHR5LXByaW50ZWQgZXJyb3IgbWVzc2FnZS4gKilcbmxldCBmYWlsd2l0aF9tZXNzYWdlIChGb3JtYXQgKGZtdCwgXykpID1cbiAgbGV0IGJ1ZiA9IEJ1ZmZlci5jcmVhdGUgMjU2IGluXG4gIGxldCBrIGFjYyA9IHN0cnB1dF9hY2MgYnVmIGFjYzsgZmFpbHdpdGggKEJ1ZmZlci5jb250ZW50cyBidWYpIGluXG4gIG1ha2VfcHJpbnRmIGsgRW5kX29mX2FjYyBmbXRcblxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiBGb3JtYXR0aW5nIHRvb2xzICopXG5cbigqIENvbnZlcnQgYSBzdHJpbmcgdG8gYW4gb3BlbiBibG9jayBkZXNjcmlwdGlvbiAoaW5kZW50LCBibG9ja190eXBlKSAqKVxubGV0IG9wZW5fYm94X29mX3N0cmluZyBzdHIgPVxuICBpZiBzdHIgPSBcIlwiIHRoZW4gKDAsIFBwX2JveCkgZWxzZVxuICAgIGxldCBsZW4gPSBTdHJpbmcubGVuZ3RoIHN0ciBpblxuICAgIGxldCBpbnZhbGlkX2JveCAoKSA9IGZhaWx3aXRoX21lc3NhZ2UgXCJpbnZhbGlkIGJveCBkZXNjcmlwdGlvbiAlU1wiIHN0ciBpblxuICAgIGxldCByZWMgc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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbiAgKCogICAtIGxpdF9zdGFydDogc3RhcnQgb2YgdGhlIGxpdGVyYWwgc2VxdWVuY2UuICAgICAgICAgICAgICAgICAgICAqKVxuICAoKiAgIC0gc3RyX2luZDogY3VycmVudCBpbmRleCBpbiB0aGUgc3RyaW5nLiAgICAgICAgICAgICAgICAgICAgICAgICopXG4gICgqICAgLSBlbmRfaW5kOiBlbmQgb2YgdGhlIGN1cnJlbnQgKHN1Yi0pZm9ybWF0LiAgICAgICAgICAgICAgICAgICAgKilcbiAgKCogICAtIHBjdF9pbmQ6IGluZGV4IG9mIHRoZSAnJScgaW4gdGhlIGN1cnJlbnQgbWljcm8tZm9ybWF0LiAgICAgICAqKVxuICAoKiAgIC0gemVybzogIGlzIHRoZSAnMCcgZmxhZyBkZWZpbmVkIGluIHRoZSBjdXJyZW50IG1pY3JvLWZvcm1hdC4gICopXG4gICgqICAgLSBtaW51czogaXMgdGhlICctJyBmbGFnIGRlZmluZWQgaW4gdGhlIGN1cnJlbnQgbWljcm8tZm9ybWF0LiAgKilcbiAgKCogICAtIHBsdXM6ICBpcyB0aGUgJysnIGZsYWcgZGVmaW5lZCBpbiB0aGUgY3VycmVudCBtaWNyby1mb3JtYXQuICAqKVxuICAoKiAgIC0gaGFzaDogIGlzIHRoZSAnIycgZmxhZyBkZWZpbmVkIGluIHRoZSBjdXJyZW50IG1pY3JvLWZvcm1hdC4gICopXG4gICgqICAgLSBzcGFjZTogaXMgdGhlICcgJyBmbGFnIGRlZmluZWQgaW4gdGhlIGN1cnJlbnQgbWljcm8tZm9ybWF0LiAgKilcbiAgKCogICAtIGlnbjogICBpcyB0aGUgJ18nIGZsYWcgZGVmaW5lZCBpbiB0aGUgY3VycmVudCBtaWNyby1mb3JtYXQuICAqKVxuICAoKiAgIC0gcGFkOiBwYWRkaW5nIG9mIHRoZSBjdXJyZW50IG1pY3JvLWZvcm1hdC4gICAgICAgICAgICAgICAgICAg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JiYWQgaW5wdXQ6IGZvcm1hdCB0eXBlIG1pc21hdGNoIGJldHdlZW4gJVMgYW5kICVTXCJcbiAgICAgIHN0ciAoc3RyaW5nX29mX2ZtdHR5IGZtdHR5KVxuXG4oKiBDb252ZXJ0IGEgc3RyaW5nIHRvIGEgZm9ybWF0IGNvbXBhdGlibGUgd2l0aCBhbiBvdGhlciBmb3JtYXQuICopXG4oKiBSYWlzZSBbRmFpbHVyZV0gd2l0aCBhbiBlcnJvciBtZXNzYWdlIGluIGNhc2Ugb2YgdHlwZSBtaXNtYXRjaC4gKilcbmxldCBmb3JtYXRfb2Zfc3RyaW5nX2Zvcm1hdCBzdHIgKEZvcm1hdCAoZm10Jywgc3RyJykpID1cbiAgbGV0IEZtdF9FQkIgZm10ID0gZm10X2ViYl9vZl9zdHJpbmcgc3RyIGluXG4gIHRyeSBGb3JtYXQgKHR5cGVfZm9ybWF0IGZtdCAoZm10dHlfb2ZfZm10IGZtdCcpLCBzdHIpXG4gIHdpdGggVHlwZV9taXNtYXRjaCAtPlxuICAgIGZhaWx3aXRoX21lc3NhZ2VcbiAgICAgIFwiYmFkIGlucHV0OiBmb3JtYXQgdHlwZSBtaXNtYXRjaCBiZXR3ZWVuICVTIGFuZCAlU1wiIHN0ciBzdHInXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIFhhdmllciBMZXJveSBhbmQgUGllcnJlIFdlaXMsIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbm9wZW4gQ2FtbGludGVybmFsRm9ybWF0QmFzaWNzXG5vcGVuIENhbWxpbnRlcm5hbEZvcm1hdFxuXG5sZXQga2ZwcmludGYgayBvIChGb3JtYXQgKGZtdCwgXykpID1cbiAgbWFrZV9wcmludGYgKGZ1biBhY2MgLT4gb3V0cHV0X2FjYyBvIGFjYzsgayBvKSBF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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgRGFtaWVuIERvbGlnZXosIHByb2pldCBQYXJhLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioq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YSBmbG9hdCBhcmd1bWVudCAqKVxuICB8IFNldF9mbG9hdCBvZiBmbG9hdCByZWYgICAgICgqIFNldCB0aGUgcmVmZXJlbmNlIHRvIHRoZSBmbG9hdCBhcmd1bWVudCAqKVxuICB8IFR1cGxlIG9mIHNwZWMgbGlzdCAgICAgICAgICgqIFRha2Ugc2V2ZXJhbCBhcmd1bWVudHMgYWNjb3JkaW5nIHRvIHRoZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWMgbGlzdCAqKVxuICB8IFN5bWJvbCBvZiBzdHJpbmcgbGlzdCAqIChzdHJpbmcgLT4gdW5pdClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKiBUYWtlIG9uZSBvZiB0aGUgc3ltYm9scyBhcyBhcmd1bWVudCBhbmRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsIHRoZSBmdW5jdGlvbiB3aXRoIHRoZSBzeW1ib2wuICopXG4gIHwgUmVzdCBvZiAoc3RyaW5nIC0+IHVuaXQpICAgKCogU3RvcCBpbnRlcnByZXRpbmcga2V5d29yZHMgYW5kIGNhbGwgdGhlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gd2l0aCBlYWNoIHJlbWFpbmluZyBhcmd1bWVudCAqKVxuICB8IFJlc3RfYWxsIG9mIChzdHJpbmcgbGlzdCAtPiB1bml0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqIFN0b3AgaW50ZXJwcmV0aW5nIGtleXdvcmRzIGFuZCBjYWxsIHRoZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHdpdGggYWxsIHJlbWFpbmluZyBhcmd1bWVudHMuICopXG4gIHwgRXhwYW5kIG9mIChzdHJpbmcgLT4gc3RyaW5nIGFycmF5KSAoKiBJZiB0aGUgcmVtYWluaW5nIGFyZ3VtZW50cyB0byBwcm9jZXNzXG4gICAgICAgIC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xuICAgICAgICBpblxuICAgICAgICBsZXQgbm9fYXJnICgpID1cbiAgICAgICAgICBtYXRjaCBmb2xsb3cgd2l0aFxuICAgICAgICAgIHwgTm9uZSAtPiAoKVxuICAgICAgICAgIHwgU29tZSBhcmcgLT4gcmFpc2UgKFN0b3AgKFdyb25nIChzLCBhcmcsIFwibm8gYXJndW1lbnRcIikpKSBpblxuICAgICAgICBsZXQgZ2V0X2FyZyAoKSA9XG4gICAgICAgICAgbWF0Y2ggZm9sbG93IHdpdGhcbiAgICAgICAgICB8IE5vbmUgLT5cbiAgICAgICAgICAgICAgaWYgIWN1cnJlbnQgKyAxIDwgKEFycmF5Lmxlbmd0aCAhYXJndikgdGhlbiAhYXJndi4oIWN1cnJlbnQgKyAxKVxuICAgICAgICAgICAgICBlbHNlIHJhaXNlIChTdG9wIChNaXNzaW5nIHMpKVxuICAgICAgICAgIHwgU29tZSBhcmcgLT4gYXJnXG4gICAgICAgIGluXG4gICAgICAgIGxldCBjb25zdW1lX2FyZyAoKSA9XG4gICAgICAgICAgbWF0Y2ggZm9sbG93IHdpdGhcbiAgICAgICAgICB8IE5vbmUgLT4gaW5jciBjdXJyZW50XG4gICAgICAgICAgfCBTb21lIF8gLT4gKClcbiAgICAgICAgaW5cbiAgICAgICAgbGV0IHJlYyB0cmVhdF9hY3Rpb24gPSBmdW5jdGlvblxuICAgICAgICB8IFVuaXQgZiAtPiBub19hcmcgKCk7IGYgKCk7XG4gICAgICAgIHwgQm9vbCBmIC0+XG4gICAgICAgICAgICBsZXQgYXJnID0gZ2V0X2FyZyAoKSBpblxuICAgICAgICAgICAgYmVnaW4gbWF0Y2ggYm9vbF9vZl9zdHJpbmdfb3B0IGFyZyB3aXRoXG4gICAgICAgICAgICB8IE5vbmUgLT4gcmFpc2UgKFN0b3AgKFdyb25nIChzLCBhcmcsIFwiYSBib29sZWFuXCIpKSlcbiAgICAgICAgICAgIHwgU29tZSBzIC0+IGYgc1xuICAgICAgICAgICAgZW5kO1xuICAgICAgICAgICAgY29uc3VtZV9hcmcgKCk7XG4gICAgICAgIHwgU2V0IHIgLT4gbm9fYXJnICgpOyByIDo9IHRydWU7XG4gICAgICAgIHwgQ2xlYXIgciAtPiBub19hcmcgKCk7IHIgOj0gZmFsc2U7XG4gICAgICAgIHwgU3RyaW5nIGYgLT5cbiAgICAgICAgICAgIGxldCBhcmcgPSBnZXRfYXJnICgpIGluXG4gICAgICAgICAgICBmIGFyZztcbiAgICAgICAgICAgIGNvbnN1bWVfYXJnICgpO1xuICAgICAgICB8IFN5bWJvbCAoc3ltYiwgZikgLT5cbiAgICAgICAgICAgIGxldCBhcmcgPSBnZXRfYXJnICgpIGluXG4gICAgICAgICAgICBpZiBMaXN0Lm1lbSBhcmcgc3ltYiB0aGVuIGJlZ2luXG4gICAgICAgICAgICAgIGYgYXJnO1xuICAgICAgICAgICAgICBjb25zdW1lX2FyZyAoKTtcbiAgICAgICAgICAgIGVuZCBlbHNlIGJlZ2luXG4gICAgICAgICAgICAgIHJhaXNlIChTdG9wIChXcm9uZyAocywgYXJnLCBcIm9uZSBvZjogXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4gKG1ha2Vfc3ltbGlzdCBcIlwiIFwiIFwiIFwiXCIgc3ltYikpKSlcbiAgICAgICAgICAgIGVuZFxuICAgICAgICB8IFNldF9zdHJpbmcgciAtPlxuICAgICAgICAgICAgciA6PSBnZXRfYXJnICgpO1xuICAgICAgICAgICAgY29uc3VtZV9hcmcgKCk7XG4gICAgICAgIHwgSW50IGYgLT5cbiAgICAgICAgICAgIGxldCBhcmcgPSBnZXRfYXJnICgpIGluXG4gICAgICAgICAgICBiZWdpbiBtYXRjaCBpbnRfb2Zfc3RyaW5nX29wdCBhcmcgd2l0aFxuICAgICAgICAgICAgfCBOb25lIC0+IHJhaXNlIChTdG9wIChXcm9uZyAocywgYXJnLCBcImFuIGludGVnZXJcIikpKVxuICAgICAgICAgICAgfCBTb21lIHggLT4gZiB4XG4gICAgICAgICAgICBlbmQ7XG4gICAgICAgICAgICBjb25zdW1lX2FyZyAoKTtcbiAgICAgICAgfCBTZXRfaW50IHIgLT5cbiAgICAgICAgICAgIGxldCBhcmcgPSBnZXRfYXJnICgpIGluXG4gICAgICAgICAgICBiZWdpbiBtYXRjaCBpbnRfb2Zfc3RyaW5nX29wdCBhcmcgd2l0aFxuICAgICAgICAgICAgfCBOb25lIC0+IHJhaXNlIChTdG9wIChXcm9uZyAocywgYXJnLCBcImFuIGludGVnZXJcIikpKVxuICAgICAgICAgICAgfCBTb21lIHggLT4gciA6PSB4XG4gICAgICAgICAgICBlbmQ7XG4gICAgICAgICAgICBjb25zdW1lX2FyZyAoKTtcbiAgICAgICAgfCBGbG9hdCBmIC0+XG4gICAgICAgICAgICBsZXQgYXJnID0gZ2V0X2FyZyAoKSBpblxuICAgICAgICAgICAgYmVnaW4gbWF0Y2ggZmxvYXRfb2Zfc3RyaW5nX29wdCBhcmcgd2l0aFxuICAgICAgICAgICAgfCBOb25lIC0+IHJhaXNlIChTdG9wIChXcm9uZyAocywgYXJnLCBcImEgZmxvYXRcIikpKVxuICAgICAgICAgICAgfCBTb21lIHggLT4gZiB4XG4gICAgICAgICAgICBlbmQ7XG4gICAgICAgICAgICBjb25zdW1lX2FyZyAoKTtcbiAgICAgICAgfCBTZXRfZmxvYXQgciAtPlxuICAgICAgICAgICAgbGV0IGFyZyA9IGdldF9hcmcgKCkgaW5cbiAgICAgICAgICAgIGJlZ2luIG1hdGNoIGZsb2F0X29mX3N0cmluZ19vcHQgYXJnIHdpdGhcbiAgICAgICAgICAgIHwgTm9uZSAtPiByYWlzZSAoU3RvcCAoV3JvbmcgKHMsIGFyZywgXCJhIGZsb2F0XCIpKSlcbiAgICAgICAgICAgIHwgU29tZSB4IC0+IHIgOj0geFxuICAgICAgICAgICAgZW5kO1xuICAgICAgICAgICAgY29uc3VtZV9hcmcgKCk7XG4gICAgICAgIHwgVHVwbGUgc3BlY3MgLT5cbiAgICAgICAgICAgIG5vX2FyZyAoKTtcbiAgICAgICAgICAgIExpc3QuaXRlciB0cmVhdF9hY3Rpb24gc3BlY3M7XG4gICAgICAgIHwgUmVzdCBmIC0+XG4gICAgICAgICAgICBub19hcmcgKCk7XG4gICAgICAgICAgICB3aGlsZSAhY3VycmVudCA8IChBcnJheS5sZW5ndGggIWFyZ3YpIC0gMSBkb1xuICAgICAgICAgICAgICBmICFhcmd2LighY3VycmVudCArIDEpO1xuICAgICAgICAgICAgICBjb25zdW1lX2FyZyAoKTtcbiAgICAgICAgICAgIGRvbmU7XG4gICAgICAgIHwgUmVzdF9hbGwgZiAtPlxuICAgICAgICAgICAgbm9fYXJnICgpO1xuICAgICAgICAgICAgbGV0IGFjYyA9IHJlZiBbXSBpblxuICAgICAgICAgICAgd2hpbGUgIWN1cnJlbnQgPCBBcnJheS5sZW5ndGggIWFyZ3YgLSAxIGRvXG4gICAgICAgICAgICAgIGFjYyA6PSAhYXJndi4oIWN1cnJlbnQgKyAxKSA6OiAhYWNjO1xuICAgICAgICAgICAgICBjb25zdW1lX2FyZyAoKTtcbiAgICAgICAgICAgIGRvbmU7XG4gICAgICAgICAgICBmIChMaXN0LnJldiAhYWNjKVxuICAgICAgICB8IEV4cGFuZCBmIC0+XG4gICAgICAgICAgICBpZiBub3QgYWxsb3dfZXhwYW5kIHRoZW5cbiAgICAgICAgICAgICAgcmFpc2UgKEludmFsaWRfYXJndW1lbnQgXCJBcmcuRXhwYW5kIGlzIGlzIG9ubHkgYWxsb3dlZCB3aXRoIFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBcmcucGFyc2VfYW5kX2V4cGFuZF9hcmd2X2R5bmFtaWNcIik7XG4gICAgICAgICAgICBsZXQgYXJnID0gZ2V0X2FyZyAoKSBpblxuICAgICAgICAgICAgbGV0IG5ld2FyZyA9IGYgYXJnIGluXG4gICAgICAgICAgICBjb25zdW1lX2FyZyAoKTtcbiAgICAgICAgICAgIGxldCBiZWZvcmU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YXJnMCA9IHJlYWRfYXV4IGZhbHNlICdcXHgwMCdcblxubGV0IHdyaXRlX2F1eCBzZXAgZmlsZSBhcmdzID1cbiAgbGV0IG9jID0gb3Blbl9vdXRfYmluIGZpbGUgaW5cbiAgQXJyYXkuaXRlciAoZnVuIHMgLT4gZnByaW50ZiBvYyBcIiVzJWNcIiBzIHNlcCkgYXJncztcbiAgY2xvc2Vfb3V0IG9jXG5cbmxldCB3cml0ZV9hcmcgPSB3cml0ZV9hdXggJ1xcbidcblxubGV0IHdyaXRlX2FyZzAgPSB3cml0ZV9hdXggJ1xceDAwJ1xuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG5vcGVuIFByaW50ZlxuXG50eXBlIHQgPSBleG4gPSAuLlxuXG5sZXQgcHJpbnRlcnMgPSBBdG9taWMubWFrZSBbXVxuXG5sZXQgbG9jZm10ID0gZm9ybWF0X29mX3N0cmluZyBcIkZpbGUgXFxcIiVzXFxcIiwgbGluZSAlZCwgY2hhcmFjdGVycyAlZC0lZDogJXNcIlxuXG5sZXQgZmllbGQgeCBpID1cbiAgbGV0IGYgPSBPYmouZmllbGQgeCBpIGluXG4gIGlmIG5vdCAoT2JqLmlzX2Jsb2NrIGYpIHRoZW5cbiAgICBzcHJpbnRmIFwiJWRcIiAoT2JqLm1hZ2ljIGYgOiBpbnQpICAgICAgICAgICAoKiBjYW4gYWxzbyBiZSBhIGNoYXIgKilcbiAgZWxzZSBpZiBPYmoudGFnIGYgPSBPYmouc3RyaW5nX3RhZyB0aGVuXG4gICAgc3ByaW50ZiBcIiVTXCIgKE9iai5tYWdpYyBmIDogc3RyaW5nKVxuICBlbHNlIGlmIE9iai50YW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lZF92YWx1ZSA6IHN0cmluZyAtPiAnYSAtPiB1bml0XG4gID0gXCJjYW1sX3JlZ2lzdGVyX25hbWVkX3ZhbHVlXCJcblxubGV0ICgpID1cbiAgcmVnaXN0ZXJfbmFtZWRfdmFsdWUgXCJQcmludGV4Yy5oYW5kbGVfdW5jYXVnaHRfZXhjZXB0aW9uXCJcbiAgICBoYW5kbGVfdW5jYXVnaHRfZXhjZXB0aW9uXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgT0NhbWwgcHJvZ3JhbW1lcnMgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDE4IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbmV4dGVybmFsIGlkIDogJ2EgLT4gJ2EgPSBcIiVpZGVudGl0eVwiXG5sZXQgY29uc3QgYyBfID0gY1xubGV0IGZsaXAgZiB4IHkgPSBmIHkgeFxubGV0IG5lZ2F0ZSBwIHYgPSBub3QgKHAgdilcblxuZXhjZXB0aW9uIEZpbmFsbHlfcmFpc2VkIG9mIGV4blxuXG5sZXQgKCkgPSBQcmludGV4Yy5yZWdpc3Rlcl9wcmludGVyIEBAIGZ1bmN0aW9uXG58IEZpbmFsbHlfcmFpc2VkIGV4biAtPiBTb21lIChcIkZ1bi5GaW5hbGx5X3JhaXNlZDogXCIgXiBQcmludGV4Yy50b19zdHJpbmcgZXhuKVxufCBfIC0+IE5vbmVcblxubGV0IHByb3RlY3QgfihmaW5hbGx5IDogdW5pdCAtPiB1bml0KSB3b3JrID1cbiAgbGV0IGZpbmFsbHlfbm9fZXhuICgpID1cbiAgICB0cnkgZmluYWxseSAoKSB3aXRoIGUgLT5cbiAgICAgIGxldCBidCA9IFByaW50ZXhjLmdldF9yYXdfYmFja3RyYWNlICgpIGluXG4gICAgICBQcmludGV4Yy5yYWlzZV93aXRoX2JhY2t0cmFjZSAoRmluYWxseV9yYWlzZWQgZSkgYnRcbiAgaW5cbiAgbWF0Y2ggd29yayAoKSB3aXRoXG4gIHwgcmVzdWx0IC0+IGZpbmFsbHlfbm9fZXhuICgpIDsgcmVzdWx0XG4gIHwgZXhjZXB0aW9uIHdvcmtfZXhuIC0+XG4gICAgICBsZXQgd29ya19idCA9IFByaW50ZXhjLmdldF9yYXdfYmFja3RyYWNlICgpIGluXG4gICAgICBmaW5hbGx5X25vX2V4biAoKSA7XG4gICAgICBQcmludGV4Yy5yYWlzZV93aXRoX2JhY2t0cmFjZSB3b3JrX2V4biB3b3JrX2J0XG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgIERhbWllbiBEb2xpZ2V6LCBwcm9qZXQgUGFyYSwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgIEphY3F1ZXMtSGVucmkgSm91cmRhbiwgcHJvamV0IEdhbGxpdW0sIElOUklBIFBhcmlzICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2LTIwMTYgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSAgICopXG4oKiAgICAgZXQgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbnR5cGUgc3RhdCA9IHtcbiAgbWlub3Jfd29yZHMgOiBmbG9hdDtcbiAgcHJvbW90ZWRfd29yZHMgOiBmbG9hdDtcbiAgbWFqb3Jfd29yZHMgOiBmbG9hdDtcbiAgbWlub3JfY29sbGVjdGlvbnMgOiBpbnQ7XG4gIG1ham9yX2NvbGxlY3Rpb25zIDogaW50O1xuICBoZWFwX3dvcmRzIDogaW50O1xuICBoZWFwX2NodW5rcyA6IGludDtcbiAgbGl2ZV93b3JkcyA6IGludDtcbiAgbGl2ZV9ibG9ja3MgOiBpbnQ7XG4gIGZyZWVfd29yZHMgOiBpbnQ7XG4gIGZyZWVfYmxvY2tzIDogaW50O1xuICBsYXJnZXN0X2ZyZWUgOiBpbnQ7XG4gIGZyYWdtZW50cyA6IGludDtcbiAgY29tcGFjdGlvbnMgOiBpbnQ7XG4gIHRv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3IgPSAoZnVuIF8gLT4gTm9uZSk7XG4gICAgICBwcm9tb3RlID0gKGZ1biBfIC0+IE5vbmUpO1xuICAgICAgZGVhbGxvY19taW5vciA9IChmdW4gXyAtPiAoKSk7XG4gICAgICBkZWFsbG9jX21ham9yID0gKGZ1biBfIC0+ICgpKTtcbiAgICB9XG5cbiAgICBleHRlcm5hbCBjX3N0YXJ0IDpcbiAgICAgIGZsb2F0IC0+IGludCAtPiAoJ21pbm9yLCAnbWFqb3IpIHRyYWNrZXIgLT4gdW5pdFxuICAgICAgPSBcImNhbWxfbWVtcHJvZl9zdGFydFwiXG5cbiAgICBsZXQgc3RhcnRcbiAgICAgIH5zYW1wbGluZ19yYXRlXG4gICAgICA/KGNhbGxzdGFja19zaXplID0gbWF4X2ludClcbiAgICAgIHRyYWNrZXIgPVxuICAgICAgY19zdGFydCBzYW1wbGluZ19yYXRlIGNhbGxzdGFja19zaXplIHRyYWNrZXJcblxuICAgIGV4dGVybmFsIHN0b3AgOiB1bml0IC0+IHVuaXQgPSBcImNhbWxfbWVtcHJvZl9zdG9wXCJcbiAgZW5kXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbigqIE1lc3NhZ2UgZGlnZXN0IChNRDUpICopXG5cbnR5cGUgdCA9IHN0cmluZ1xuXG5sZXQgY29tcGFyZSA9IFN0cmluZy5jb21wYXJlXG5sZXQgZXF1YWwgPSBTdHJpbmcuZXF1YWxcblxuZXh0ZXJuYWwgdW5zYWZlX3N0cmluZzogc3RyaW5nIC0+IGludCAtPiBpbnQgLT4gdCA9IFwiY2FtbF9tZDVfc3RyaW5nXCJcbmV4dGVybmFsIGNoYW5uZWw6IGluX2NoYW5uZWwgLT4g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HJpbmcgcmVzdWx0XG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgIERhbWllbiBEb2xpZ2V6LCBwcm9qZXQgUGFyYSwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3J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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioq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AtPiBFbXB0eVxuICB8IENvbnMge2tleTsgZGF0YTsgbmV4dH0gLT5cbiAgICAgIGxldCByZWMgbG9vcCBwcmVjID0gZnVuY3Rpb25cbiAgICAgICAgfCBFbXB0eSAtPiAoKVxuICAgICAgICB8IENvbnMge2tleTsgZGF0YTsgbmV4dH0gLT5cbiAgICAgICAgICAgIGxldCByID0gQ29ucyB7a2V5OyBkYXRhOyBuZXh0fSBpblxuICAgICAgICAgICAgYmVnaW4gbWF0Y2ggcHJlYyB3aXRoXG4gICAgICAgICAgICB8IEVtcHR5IC0+IGFzc2VydCBmYWxzZVxuICAgICAgICAgICAgfCBDb25zIHByZWMgLT4gIHByZWMubmV4dCA8LSByXG4gICAgICAgICAgICBlbmQ7XG4gICAgICAgICAgICBsb29wIHIgbmV4dFxuICAgICAgaW5cbiAgICAgIGxldCByID0gQ29ucyB7a2V5OyBkYXRhOyBuZXh0fSBpblxuICAgICAgbG9vcCByIG5leHQ7XG4gICAgICByXG5cbmxldCBjb3B5IGggPSB7IGggd2l0aCBkYXRhID0gQXJyYXkubWFwIGNvcHlfYnVja2V0bGlzdCBoLmRhdGEgfVxuXG5sZXQgbGVuZ3RoIGggPSBoLnNpemVcblxubGV0IGluc2VydF9hbGxfYnVja2V0cyBpbmRleGZ1biBpbnBsYWNlIG9kYXRhIG5kYXRhID1cbiAgbGV0IG5zaXplID0gQXJyYXkubGVuZ3RoIG5kYXRhIGluXG4gIGxldCBuZGF0YV90YWlsID0gQXJyYXkubWFrZSBuc2l6ZSBFbXB0eSBpblxuICBsZXQgcmVjIGluc2VydF9idWNrZXQgPSBmdW5jdGlvblxuICAgIHwgRW1wdHkgLT4gKClcbiAgICB8IENvbnMge2tleTsgZGF0YTsgbmV4dH0gYXMgY2VsbCAtPlxuICAgICAgICBsZXQgY2VsbCA9XG4gICAgICAgICAgaWYgaW5wbGFjZSB0aGVuIGNlbGxcbiAgICAgICAgICBlbHNlIENvbnMge2tleTsgZGF0YTsgbmV4dCA9IEVtcHR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b25cbiAgICAgIHwgRW1wdHkgLT5cbiAgICAgICAgICBbXVxuICAgICAgfCBDb25ze2tleT1rOyBkYXRhPWQ7IG5leHR9IC0+XG4gICAgICAgICAgaWYgSC5lcXVhbCBrIGtleVxuICAgICAgICAgIHRoZW4gZCA6OiBmaW5kX2luX2J1Y2tldCBuZXh0XG4gICAgICAgICAgZWxzZSBmaW5kX2luX2J1Y2tldCBuZXh0IGluXG4gICAgICBmaW5kX2luX2J1Y2tldCBoLmRhdGEuKGtleV9pbmRleCBoIGtleSlcblxuICAgIGxldCByZWMgcmVwbGFjZV9idWNrZXQga2V5IGRhdGEgPSBmdW5jdGlvblxuICAgICAgfCBFbXB0eSAtPlxuICAgICAgICAgIHRydWVcbiAgICAgIHwgQ29ucyAoe2tleT1rOyBuZXh0fSBhcyBzbG90KSAtPlxuICAgICAgICAgIGlmIEguZXF1YWwgayBrZXlcbiAgICAgICAgICB0aGVuIChzbG90LmtleSA8LSBrZXk7IHNsb3QuZGF0YSA8LSBkYXRhOyBmYWxzZSlcbiAgICAgICAgICBlbHNlIHJlcGxhY2VfYnVja2V0IGtleSBkYXRhIG5leHRcblxuICAgIGxldCByZXBsYWNlIGgga2V5IGRhdGEgPVxuICAgICAgbGV0IGkgPSBrZXlfaW5kZXggaCBrZXkgaW5cbiAgICAgIGxldCBsID0gaC5kYXRhLihpKSBpblxuICAgICAgaWYgcmVwbGFjZV9idWNrZXQga2V5IGRhdGEgbCB0aGVuIGJlZ2luXG4gICAgICAgIGguZGF0YS4oaSkgPC0gQ29uc3trZXk7IGRhdGE7IG5leHQ9bH07XG4gICAgICAgIGguc2l6ZSA8LSBoLnNpemUgKyAxO1xuICAgICAgICBpZiBoLnNpemUgPiBBcnJheS5sZW5ndGggaC5kYXRhIGxzbCAxIHRoZW4gcmVzaXplIGtleV9pbmRleCBoXG4gICAgICBlbmRcblxuICAgIGxldCBtZW0gaCBrZXkgPVxuICAgICAgbGV0IHJlYyBtZW1faW5fYnVja2V0ID0gZnVu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20uU3RhdGUuYml0cyAoTGF6eS5mb3JjZSBwcm5nKVxuICAgIGVsc2UgaWYgT2JqLnNpemUgKE9iai5yZXByIGgpID49IDQgdGhlbiBoLnNlZWRcbiAgICBlbHNlIDAgaW5cbiAgbGV0IGgnID0ge1xuICAgIHNpemUgPSBoLnNpemU7XG4gICAgZGF0YSA9IEFycmF5Lm1ha2UgcyBFbXB0eTtcbiAgICBzZWVkID0gc2VlZDtcbiAgICBpbml0aWFsX3NpemUgPSBpZiBPYmouc2l6ZSAoT2JqLnJlcHIgaCkgPj0gNCB0aGVuIGguaW5pdGlhbF9zaXplIGVsc2Ugc1xuICB9IGluXG4gIGluc2VydF9hbGxfYnVja2V0cyAoa2V5X2luZGV4IGgnKSBmYWxzZSBoLmRhdGEgaCcuZGF0YTtcbiAgaCdcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgIERhbWllbiBEb2xpZ2V6LCBwcm9qZXQgUGFyYSwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDE5OTcgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxuKCoqIFdlYWsgYXJyYXkgb3BlcmF0aW9ucyAqKVxuXG50eXBlICEnYSB0XG5cbmV4dGVybmFsIGNyZWF0ZSA6IGludCAtPiAnYSB0ID0gXCJjYW1sX3dlYWtfY3JlYXRlXCJcblxubGV0IGNyZWF0ZSBsID1cbiAgaWYgbm90ICgwIDw9IGwgJiYgbCA8PSBPYmouRXBoZW1lcm9uLm1heF9lcGhlX2xlbmd0aCkgdGhlblxuICAgIGludmFsaWRfYXJnKFwiV2Vhay5jcmVhdGVcIik7XG4gIGNyZWF0ZSBsXG5cbigqKiBudW1iZXIgb2YgYWRkaXRpb25hbCB2YWx1ZXMgaW4gYSB3ZWFrIHBvaW50ZXIgKilcbmxldCBhZGRpdGlvbmFsX3ZhbHVlcyA9IDJcblxubGV0IGxlbmd0aCB4ID0gT2JqLnNpemUoT2Jq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gKCArICkgMCBsZW5zIGluXG4gICAgKGxlbiwgY291bnQgdCwgdG90bGVuLCBsZW5zLigwKSwgbGVucy4obGVuLzIpLCBsZW5zLihsZW4tMSkpXG5cblxuZW5kXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBQaWVycmUgV2VpcywgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbigqIEEgcHJldHR5LXByaW50aW5nIGZhY2lsaXR5IGFuZCBkZWZpbml0aW9uIG9mIGZvcm1hdHRlcnMgZm9yICdwYXJhbGxlbCdcbiAgIChpLmUuIHVucmVsYXRlZCBvciBpbmRlcGVuZGVudCkgcHJldHR5LXByaW50aW5nIG9uIG11bHRpcGxlIG91dCBjaGFubmVscy4gKilcblxuKCpcbiAgIFRoZSBwcmV0dHktcHJpbnRpbmcgZW5naW5lIGludGVybmFsIGRhdGEgc3RydWN0dXJlcy5cbiopXG5cbmxldCBpZCB4ID0geFxuXG4oKiBBIGRldm90ZWQgdHlwZSBmb3Igc2l6ZXMgdG8gYXZvaWQgY29uZnVzaW9uXG4gICBiZXR3ZWVuIHNpemVzIGFuZCBtZXJlIGludGVnZXJzLiAqKVxubW9kdWxlIFNpemUgOiBzaWdcbiAgdHlwZSB0XG5cbiAgdmFsIHRvX2ludCA6IHQgLT4gaW50XG4gIHZhbCBvZl9pbnQgOiBpbnQgLT4gdFxuICB2YWwgemVybyA6IHRcbiAgdmFsIHVua25vd24gOiB0XG4gIHZhbCBpc19rbm93biA6IHQgLT4gYm9vbFxuZW5kICA9IHN0cnVjdFxuICB0eXBlIHQgPSBpbnRcblxuICBsZXQgdG9faW50ID0gaWRcbiAgbGV0IG9mX2ludCA9IGlkXG4gIGxldCB6ZXJvID0gMFxuICBsZXQgdW5rbm93biA9IC0xXG4gIGxldCBpc19rbm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ib3ggfCBQcF9odmJveCB8IFBwX2hvdmJveCB8IFBwX2JveCB8IFBwX2ZpdHNcblxuXG4oKiBUaGUgcHJldHR5LXByaW50aW5nIHRva2VucyBkZWZpbml0aW9uOlxuICAgYXJlIGVpdGhlciB0ZXh0IHRvIHByaW50IG9yIHByZXR0eSBwcmludGluZ1xuICAgZWxlbWVudHMgdGhhdCBkcml2ZSBpbmRlbnRhdGlvbiBhbmQgbGluZSBzcGxpdHRpbmcuICopXG50eXBlIHBwX3Rva2VuID1cbiAgfCBQcF90ZXh0IG9mIHN0cmluZyAgICAgICAgICAoKiBub3JtYWwgdGV4dCAqKVxuICB8IFBwX2JyZWFrIG9mIHsgICAgICAgICAgICAgICgqIGNvbXBsZXRlIGJyZWFrICopXG4gICAgICBmaXRzOiBzdHJpbmcgKiBpbnQgKiBzdHJpbmc7ICAgKCogbGluZSBpcyBub3Qgc3BsaXQgKilcbiAgICAgIGJyZWFrczogc3RyaW5nICogaW50ICogc3RyaW5nOyAoKiBsaW5lIGlzIHNwbGl0ICopXG4gICAgfVxuICB8IFBwX3RicmVhayBvZiBpbnQgKiBpbnQgICAgICgqIGdvIHRvIG5leHQgdGFidWxhdGlvbiAqKVxuICB8IFBwX3N0YWIgICAgICAgICAgICAgICAgICAgICgqIHNldCBhIHRhYnVsYXRpb24gKilcbiAgfCBQcF9iZWdpbiBvZiBpbnQgKiBib3hfdHlwZSAoKiBiZWdpbm5pbmcgb2YgYSBib3ggKilcbiAgfCBQcF9lbmQgICAgICAgICAgICAgICAgICAgICAoKiBlbmQgb2YgYSBib3ggKilcbiAgfCBQcF90YmVnaW4gb2YgdGJveCAgICAgICAgICAoKiBiZWdpbm5pbmcgb2YgYSB0YWJ1bGF0aW9uIGJveCAqKVxuICB8IFBwX3RlbmQgICAgICAgICAgICAgICAgICAgICgqIGVuZCBvZiBhIHRhYnVsYXRpb24gYm94ICopXG4gIHwgUHBfbmV3bGluZSAgICAgICAgICAgICAgICAgKCogdG8gZm9yY2UgYSB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VuY3Rpb25zID1cbiAgcHBfc2V0X2Zvcm1hdHRlcl90YWdfZnVuY3Rpb25zIHN0ZF9mb3JtYXR0ZXJcbmFuZCBnZXRfZm9ybWF0dGVyX3RhZ19mdW5jdGlvbnMgPVxuICBwcF9nZXRfZm9ybWF0dGVyX3RhZ19mdW5jdGlvbnMgc3RkX2Zvcm1hdHRlclxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgUGllcnJlIFdlaXMsIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMjAwMiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHR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XQgKFwiXFxcIlwiIF4gU3RyaW5nLmVzY2FwZWQgcyBeIFwiXFxcIlwiKSBmbXQgKGZ1biB4IC0+IHgpXG5cblxubGV0IHVuZXNjYXBlZCBzID1cbiAgc3NjYW5mIChcIlxcXCJcIiBeIHMgXiBcIlxcXCJcIikgXCIlUyUhXCIgKGZ1biB4IC0+IHgpXG5cblxuKCogRGVwcmVjYXRlZCAqKVxubGV0IGtmc2NhbmYgaWMgZWYgZm10ID0ga2JzY2FuZiAoU2Nhbm5pbmcubWVtb19mcm9tX2NoYW5uZWwgaWMpIGVmIGZtdFxubGV0IGZzY2FuZiBpYyBmbXQgPSBrc2NhbmYgKFNjYW5uaW5nLm1lbW9fZnJvbV9jaGFubmVsIGljKSBzY2FuZl9iYWRfaW5wdXQgZm10XG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbigqIFJlZ2lzdGVyaW5nIE9DYW1sIHZhbHVlcyB3aXRoIHRoZSBDIHJ1bnRpbWUgZm9yIGxhdGVyIGNhbGxiYWNrcyAqKVxuXG5leHRlcm5hbCByZWdpc3Rlcl9uYW1lZF92YWx1ZSA6IHN0cmluZyAtPiBPYmoudCAtPiB1bml0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9IFwiY2FtbF9yZWdpc3Rlcl9uYW1lZF92YWx1ZVwiXG5cbmxldCByZWdpc3RlciBuYW1lIHYgPVxuICByZWdpc3Rlcl9uYW1lZF92YWx1ZSBuYW1lIChPYmoucmVwciB2KVxuXG5sZXQgcmVnaXN0ZXJfZXhjZXB0aW9uIG5hbWUgKGV4biA6IGV4bikgPVxuICBsZXQgZXhuID0gT2JqLnJlcHIgZXhuIGluXG4gIGxldCBzbG90ID0gaWYgT2JqLnRhZyBleG4gPSBPYmoub2JqZWN0X3RhZyB0aGVuIGV4biBlbHNlIE9iai5maWVsZCBleG4gMCBpblxuICByZWdpc3Rlcl9uYW1lZF92YWx1ZSBuYW1lIHNsb3RcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgIEplcm9tZSBWb3VpbGxvbiwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMDIgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxub3BlbiBPYmpcblxuKCoqKiogT2JqZWN0IHJlcHJlc2VudGF0aW9uICoqKiopXG5cbmV4dGVybmFsIHNldF9pZDogJ2EgLT4gJ2EgPSBcImNhbWxfc2V0X29vX2lkXCIgW0BAbm9hbGxvY11cblxuKCoqKiogT2JqZWN0IGNvcHkgKioqKilcblxubGV0IGNvcHkgbyA9XG4gIGxldCBvID0gKE9iai5vYmogKE9iai5kdXAgKE9iai5yZXByIG8pKSkgaW5cbiAgc2V0X2lkIG9cblxuKCoqKiogQ29tcHJlc3Npb24gb3B0aW9ucyAqKioqKVxuKCogUGFyYW1ldGVycyAqKVxudHlwZSBwYXJhbXMgPSB7XG4gICAgbXV0YWJsZSBjb21wYWN0X3RhYmxlIDogYm9vbDtcbiAgICBtdXRhYmxlIGNvcHlfcGFyZW50IDogYm9vbDtcbiAgICBtdXRhYmxlIGNsZWFuX3doZW5fY29weWluZyA6IGJvb2w7XG4gICAgbXV0YWJsZSByZXRyeV9jb3VudCA6IGludDtcbiAgICBtdXRhYmxlIGJ1Y2tldF9zbWFsbF9zaXplIDogaW50XG4gIH1cblxubGV0IHBhcmFtcyA9IHtcbiAgY29tcGFjdF90YWJsZSA9IHRydWU7XG4gIGNvcHlfcGFyZW50ID0gdHJ1ZTtcbiAgY2xlYW5fd2hlbl9jb3B5aW5nID0gdHJ1ZTtcbiAgcmV0cnlfY291bnQgPSAzO1xuICBidWNrZX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W1ldGhvZF9jb3VudDsgaW5zdF92YXJzID0gIWluc3RfdmFyX2NvdW50OyB9XG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICBYYXZpZXIgTGVyb3ksIHByb2pldCBDcmlzdGFsLCBJTlJJQSBSb2NxdWVuY291cnQgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAyMDA0IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbnR5cGUgc2hhcGUgPVxuICB8IEZ1bmN0aW9uXG4gIHwgTGF6eVxuICB8IENsYXNzXG4gIHwgTW9kdWxlIG9mIHNoYXBlIGFycmF5XG4gIHwgVmFsdWUgb2YgT2JqLnRcblxubGV0IHJlYyBpbml0X21vZF9maWVsZCBtb2R1IGkgbG9jIHNoYXBlID1cbiAgbGV0IGluaXQgPVxuICAgIG1hdGNoIHNoYXBlIHdpdGhcbiAgICB8IEZ1bmN0aW9uIC0+XG4gICAgICAgbGV0IHJlYyBmbiAoeCA6ICdhKSA9XG4gICAgICAgICBsZXQgZm4nIDogJ2EgLT4gJ2IgPSBPYmoub2JqIChPYmouZmllbGQgbW9kdSBpKSBpblxuICAgICAgICAgaWYgZm4gPT0gZm4nIHRoZW5cbiAgICAgICAgICAgcmFpc2UgKFVuZGVmaW5lZF9yZWN1cnNpdmVfbW9kdWxlIGxvYylcbiAgICAgICAgIGVsc2VcbiAgICAgICAgICAgZm4nIHggaW5cbiAgICAgICBPYmoucmVwciBmblxuICAgIHwgTGF6eSAtPlxuICAgICAgIGxldCByZWMgbCA9XG4gICAgICAgICBsYXp5IChcbiAgICAgICAgICAgbGV0IGwnID0gT2JqLm9iaiAoT2JqLmZpZWxkIG1vZHUgaSkgaW5cbiAgICAgICAgICAgaWYgbCA9PSBsJyB0aGVuXG4gICAgICAgICAgICAgcmFpc2UgKFVuZGVmaW5lZF9yZWN1cnNpdmVfbW9kdWxlIGxvYylcbiAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgIExh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IG4gPSAwICYmIE9iai5zaXplIG4gPSA0KTtcbiAgICAgbGV0IGNsID0gT2JqLmZpZWxkIG1vZHUgaSBpblxuICAgICBmb3IgaiA9IDAgdG8gMyBkb1xuICAgICAgIE9iai5zZXRfZmllbGQgY2wgaiAoT2JqLmZpZWxkIG4gailcbiAgICAgZG9uZVxuICB8IE1vZHVsZSBjb21wcyAtPlxuICAgICB1cGRhdGVfbW9kX2Jsb2NrIGNvbXBzIChPYmouZmllbGQgbW9kdSBpKSBuXG5cbmFuZCB1cGRhdGVfbW9kX2Jsb2NrIGNvbXBzIG8gbiA9XG4gIGFzc2VydCAoT2JqLnRhZyBuID0gMCAmJiBPYmouc2l6ZSBuID49IEFycmF5Lmxlbmd0aCBjb21wcyk7XG4gIGZvciBpID0gMCB0byBBcnJheS5sZW5ndGggY29tcHMgLSAxIGRvXG4gICAgdXBkYXRlX21vZF9maWVsZCBvIGkgY29tcHMuKGkpIChPYmouZmllbGQgbiBpKVxuICBkb25lXG5cbmxldCB1cGRhdGVfbW9kIHNoYXBlIG8gbiA9XG4gIG1hdGNoIHNoYXBlIHdpdGhcbiAgfCBNb2R1bGUgY29tcHMgLT5cbiAgICAgdXBkYXRlX21vZF9ibG9jayBjb21wcyBvIG5cbiAgfCBfIC0+IGZhaWx3aXRoIFwiQ2FtbGludGVybmFsTW9kLnVwZGF0ZV9tb2Q6IG5vdCBhIG1vZHVsZVwiXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk2IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbltAQEBvY2FtbC53YXJuaW5nIFwiLTNcIl0gKCogaWdub3JlIGRlcHJlY2F0aW9uIHdhcm5pbmcgYWJvdXQgbW9kdWxlIFN0cmVhbSAqKVxuXG50eXBlIHRva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cm1fXztcbiAgICAgICAgbGV0IHMgPSBzdHJtX18gaW4gcmVzZXRfYnVmZmVyICgpOyBzdG9yZSBjOyBpZGVudDIgc1xuICAgIHwgU29tZSAoJzAnLi4nOScgYXMgYykgLT5cbiAgICAgICAgU3RyZWFtLmp1bmsgc3RybV9fO1xuICAgICAgICBsZXQgcyA9IHN0cm1fXyBpbiByZXNldF9idWZmZXIgKCk7IHN0b3JlIGM7IG51bWJlciBzXG4gICAgfCBTb21lICdcXCcnIC0+XG4gICAgICAgIFN0cmVhbS5qdW5rIHN0cm1fXztcbiAgICAgICAgbGV0IGMgPVxuICAgICAgICAgIHRyeSBjaGFyIHN0cm1fXyB3aXRoXG4gICAgICAgICAgICBTdHJlYW0uRmFpbHVyZSAtPiByYWlzZSAoU3RyZWFtLkVycm9yIFwiXCIpXG4gICAgICAgIGluXG4gICAgICAgIGJlZ2luIG1hdGNoIFN0cmVhbS5wZWVrIHN0cm1fXyB3aXRoXG4gICAgICAgICAgU29tZSAnXFwnJyAtPiBTdHJlYW0uanVuayBzdHJtX187IFNvbWUgKENoYXIgYylcbiAgICAgICAgfCBfIC0+IHJhaXNlIChTdHJlYW0uRXJyb3IgXCJcIilcbiAgICAgICAgZW5kXG4gICAgfCBTb21lICdcXFwiJyAtPlxuICAgICAgICBTdHJlYW0uanVuayBzdHJtX187XG4gICAgICAgIGxldCBzID0gc3RybV9fIGluIHJlc2V0X2J1ZmZlciAoKTsgU29tZSAoU3RyaW5nIChzdHJpbmcgcykpXG4gICAgfCBTb21lICctJyAtPiBTdHJlYW0uanVuayBzdHJtX187IG5lZ19udW1iZXIgc3RybV9fXG4gICAgfCBTb21lICcoJyAtPiBTdHJlYW0uanVuayBzdHJtX187IG1heWJlX2NvbW1lbnQgc3RybV9fXG4gICAgfCBTb21lIGMgLT4gU3RyZWFtLmp1bmsgc3RybV9fOyBTb21lIChrZXl3b3JkX29yX2Vycm9yIGMpXG4gICAgfCBfIC0+IE5vbmVcbiAgYW5kIGlkZW50I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fIC0+IFN0cmVhbS5qdW5rIHN0cm1fXzsgY29tbWVudCBzdHJtX19cbiAgICB8IF8gLT4gcmFpc2UgU3RyZWFtLkZhaWx1cmVcbiAgYW5kIG1heWJlX25lc3RlZF9jb21tZW50IChzdHJtX18gOiBfIFN0cmVhbS50KSA9XG4gICAgbWF0Y2ggU3RyZWFtLnBlZWsgc3RybV9fIHdpdGhcbiAgICAgIFNvbWUgJyonIC0+IFN0cmVhbS5qdW5rIHN0cm1fXzsgbGV0IHMgPSBzdHJtX18gaW4gY29tbWVudCBzOyBjb21tZW50IHNcbiAgICB8IFNvbWUgXyAtPiBTdHJlYW0uanVuayBzdHJtX187IGNvbW1lbnQgc3RybV9fXG4gICAgfCBfIC0+IHJhaXNlIFN0cmVhbS5GYWlsdXJlXG4gIGFuZCBtYXliZV9lbmRfY29tbWVudCAoc3RybV9fIDogXyBTdHJlYW0udCkgPVxuICAgIG1hdGNoIFN0cmVhbS5wZWVrIHN0cm1fXyB3aXRoXG4gICAgICBTb21lICcpJyAtPiBTdHJlYW0uanVuayBzdHJtX187ICgpXG4gICAgfCBTb21lICcqJyAtPiBTdHJlYW0uanVuayBzdHJtX187IG1heWJlX2VuZF9jb21tZW50IHN0cm1fX1xuICAgIHwgU29tZSBfIC0+IFN0cmVhbS5qdW5rIHN0cm1fXzsgY29tbWVudCBzdHJtX19cbiAgICB8IF8gLT4gcmFpc2UgU3RyZWFtLkZhaWx1cmVcbiAgaW5cbiAgZnVuIGlucHV0IC0+IFN0cmVhbS5mcm9tIChmdW4gX2NvdW50IC0+IG5leHRfdG9rZW4gaW5wdXQpXG4iLCIoKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9DYW1sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICBEYW1pZW4gRG9saWdleiwgcHJvamV0IFBhcmEsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIENvcHlyaWdodCAxOTk3IEluc3RpdHV0IE5hdGlvbmFsIGRlIFJlY2hlcmNoZSBlbiBJbmZvcm1hdGlxdWUgZXQgICAgICopXG4oKiAgICAgZW4gQXV0b21hdGlxdWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKiAgIEFsbCByaWdodHMgcmVzZXJ2ZWQuICBUaGlzIGZpbGUgaXMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIHRlcm1zIG9mICAgICopXG4oKiAgIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyLjEsIHdpdGggdGhlICAgICAgICAgICopXG4oKiAgIHNwZWNpYWwgZXhjZXB0aW9uIG9uIGxpbmtpbmcgZGVzY3JpYmVkIGluIHRoZSBmaWxlIExJQ0VOU0UuICAgICAgICAgICopXG4oKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICopXG4oKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiopXG5cbltAQEBvY2FtbC53YX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gSC5jcmVhdGUga2V5IGluZm8gaW5cbiAgICAgIGxldCBidWNrZXQgPSBDb25zKGhrZXksIGNvbnRhaW5lciwgaC5kYXRhLihpKSkgaW5cbiAgICAgIGguZGF0YS4oaSkgPC0gYnVja2V0O1xuICAgICAgaC5zaXplIDwtIGguc2l6ZSArIDE7XG4gICAgICBpZiBoLnNpemUgPiBBcnJheS5sZW5ndGggaC5kYXRhIGxzbCAxIHRoZW4gcmVzaXplIGhcblxuICAgIGxldCByZW1vdmUgaCBrZXkgPVxuICAgICAgbGV0IGhrZXkgPSBILmhhc2ggaC5zZWVkIGtleSBpblxuICAgICAgbGV0IHJlYyByZW1vdmVfYnVja2V0ID0gZnVuY3Rpb25cbiAgICAgICAgfCBFbXB0eSAtPiBFbXB0eVxuICAgICAgICB8IENvbnMoaGssIGMsIG5leHQpIHdoZW4gaGtleSA9IGhrIC0+XG4gICAgICAgICAgICBiZWdpbiBtYXRjaCBILmVxdWFsIGMga2V5IHdpdGhcbiAgICAgICAgICAgIHwgRVRydWUgLT4gaC5zaXplIDwtIGguc2l6ZSAtIDE7IG5leHRcbiAgICAgICAgICAgIHwgRUZhbHNlIC0+IENvbnMoaGssIGMsIHJlbW92ZV9idWNrZXQgbmV4dClcbiAgICAgICAgICAgIHwgRURlYWQgLT5cbiAgICAgICAgICAgICAgICAoKiBUaGUgZGVhZCBrZXkgaXMgYXV0b21hdGljYWxseSByZW1vdmVkLiBJdCBpcyBhY2NlcHRhYmxlXG4gICAgICAgICAgICAgICAgICAgIGZvciB0aGlzIGZ1bmN0aW9uIHNpbmNlIGl0IGFscmVhZHkgcmVtb3ZlcyBhIGJpbmRpbmcgKilcbiAgICAgICAgICAgICAgICBoLnNpemUgPC0gaC5zaXplIC0gMTtcbiAgICAgICAgICAgICAgICByZW1vdmVfYnVja2V0IG5leHRcbiAgICAgICAgICAgIGVuZFxuICAgICAgICB8IENvbnMoaGssYyxuZXh0KSAtPiBDb25zKGhrLCBjLCByZW1vdmVfYnVja2V0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IHJlc3RcbiAgICAgICAgICB8IEVEZWFkIC0+XG4gICAgICAgICAgICAgIGZpbmRfcmVjIGtleSBoa2V5IHJlc3RcbiAgICAgICAgICBlbmRcbiAgICAgIHwgQ29ucyhfLCBfLCByZXN0KSAtPlxuICAgICAgICAgIGZpbmRfcmVjIGtleSBoa2V5IHJlc3RcblxuICAgIGxldCBmaW5kIGgga2V5ID1cbiAgICAgIGxldCBoa2V5ID0gSC5oYXNoIGguc2VlZCBrZXkgaW5cbiAgICAgICgqIFRPRE8gaW5saW5lIDMgaXRlcmF0aW9ucyAqKVxuICAgICAgZmluZF9yZWMga2V5IGhrZXkgKGguZGF0YS4oa2V5X2luZGV4IGggaGtleSkpXG5cbiAgICBsZXQgcmVjIGZpbmRfcmVjX29wdCBrZXkgaGtleSA9IGZ1bmN0aW9uXG4gICAgICB8IEVtcHR5IC0+XG4gICAgICAgICAgTm9uZVxuICAgICAgfCBDb25zKGhrLCBjLCByZXN0KSB3aGVuIGhrZXkgPSBoayAgLT5cbiAgICAgICAgICBiZWdpbiBtYXRjaCBILmVxdWFsIGMga2V5IHdpdGhcbiAgICAgICAgICB8IEVUcnVlIC0+XG4gICAgICAgICAgICAgIGJlZ2luIG1hdGNoIEguZ2V0X2RhdGEgYyB3aXRoXG4gICAgICAgICAgICAgIHwgTm9uZSAtPlxuICAgICAgICAgICAgICAgICAgKCogVGhpcyBjYXNlIGlzIG5vdCBpbXBvc3NpYmxlIGJlY2F1c2UgdGhlIGdjIGNhbiBydW4gYmV0d2VlblxuICAgICAgICAgICAgICAgICAgICAgIEguZXF1YWwgYW5kIEguZ2V0X2RhdGEgKilcbiAgICAgICAgICAgICAgICAgIGZpbmRfcmVjX29wdCBrZXkgaGtleSByZXN0XG4gICAgICAgICAgICAgIHwgU29tZSBfIGFzIGQgLT4gZFxuICAgICAgICAgICAgICBlbmRcbiAgICAgICAgICB8IEVGYWxzZSAtPiBmaW5kX3JlY19vcHQga2V5IGhrZXkgcmVzdFxuICAgICAgICA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AgIGxldCBoa2V5ID0gSC5oYXNoIGguc2VlZCBrZXkgaW5cbiAgICAgIGxldCByZWMgbWVtX2luX2J1Y2tldCA9IGZ1bmN0aW9uXG4gICAgICB8IEVtcHR5IC0+XG4gICAgICAgICAgZmFsc2VcbiAgICAgIHwgQ29ucyhoaywgYywgcmVzdCkgd2hlbiBoayA9IGhrZXkgLT5cbiAgICAgICAgICBiZWdpbiBtYXRjaCBILmVxdWFsIGMga2V5IHdpdGhcbiAgICAgICAgICB8IEVUcnVlIC0+IHRydWVcbiAgICAgICAgICB8IEVGYWxzZSB8IEVEZWFkIC0+IG1lbV9pbl9idWNrZXQgcmVzdFxuICAgICAgICAgIGVuZFxuICAgICAgfCBDb25zKF9oaywgX2MsIHJlc3QpIC0+IG1lbV9pbl9idWNrZXQgcmVzdCBpblxuICAgICAgbWVtX2luX2J1Y2tldCBoLmRhdGEuKGtleV9pbmRleCBoIGhrZXkpXG5cbiAgICBsZXQgaXRlciBmIGggPVxuICAgICAgbGV0IHJlYyBkb19idWNrZXQgPSBmdW5jdGlvblxuICAgICAgICB8IEVtcHR5IC0+XG4gICAgICAgICAgICAoKVxuICAgICAgICB8IENvbnMoXywgYywgcmVzdCkgLT5cbiAgICAgICAgICAgIGJlZ2luIG1hdGNoIEguZ2V0X2tleSBjLCBILmdldF9kYXRhIGMgd2l0aFxuICAgICAgICAgICAgfCBOb25lLCBfIHwgXywgTm9uZSAtPiAoKVxuICAgICAgICAgICAgfCBTb21lIGssIFNvbWUgZCAtPiBmIGsgZFxuICAgICAgICAgICAgZW5kOyBkb19idWNrZXQgcmVzdCBpblxuICAgICAgbGV0IGQgPSBoLmRhdGEgaW5cbiAgICAgIGZvciBpID0gMCB0byBBcnJheS5sZW5ndGggZCAtIDEgZG9cbiAgICAgICAgZG9fYnVja2V0IGQuKGkpXG4gICAgICBkb25lXG5cbiAgICBsZXQgZm9sZCBmIGggaW5pdCA9XG4gICAgICBsZXQgcmVjIGRvX2J1Y2tldCBiIGFjY3UgPVxuICAgICAgICBtYXRjaCBiIHdpdGhcbiAgICAgICAgICBFbXB0eSAtPlxuICAgICAgICAgICAgYWNjdVxuICAgICAgICB8IENvbnMoXywgYywgcmVzdCkgLT5cbiAgICAgICAgICAgIGxldCBhY2N1ID0gYmVnaW4gbWF0Y2ggSC5nZXRfa2V5IGMsIEguZ2V0X2RhdGEgYyB3aXRoXG4gICAgICAgICAgICAgIHwgTm9uZSwgXyB8IF8sIE5vbmUgLT4gYWNjdVxuICAgICAgICAgICAgICB8IFNvbWUgaywgU29tZSBkIC0+IGYgayBkIGFjY3VcbiAgICAgICAgICAgIGVuZCBpblxuICAgICAgICAgICAgZG9fYnVja2V0IHJlc3QgYWNjdSAgaW5cbiAgICAgIGxldCBkID0gaC5kYXRhIGluXG4gICAgICBsZXQgYWNjdSA9IHJlZiBpbml0IGluXG4gICAgICBmb3IgaSA9IDAgdG8gQXJyYXkubGVuZ3RoIGQgLSAxIGRvXG4gICAgICAgIGFjY3UgOj0gZG9fYnVja2V0IGQuKGkpICFhY2N1XG4gICAgICBkb25lO1xuICAgICAgIWFjY3VcblxuICAgIGxldCBmaWx0ZXJfbWFwX2lucGxhY2UgZiBoID1cbiAgICAgIGxldCByZWMgZG9fYnVja2V0ID0gZnVuY3Rpb25cbiAgICAgICAgfCBFbXB0eSAtPlxuICAgICAgICAgICAgRW1wdHlcbiAgICAgICAgfCBDb25zKGhrLCBjLCByZXN0KSAtPlxuICAgICAgICAgICAgbWF0Y2ggSC5nZXRfa2V5IGMsIEguZ2V0X2RhdGEgYyB3aXRoXG4gICAgICAgICAgICB8IE5vbmUsIF8gfCBfLCBOb25lIC0+XG4gICAgICAgICAgICAgICAgZG9fYnVja2V0IHJlc3RcbiAgICAgICAgICAgIHwgU29tZSBrLCBTb21lIGQgLT5cbiAgICAgICAgICAgICAgICBtYXRjaCBmIGsgZCB3aXRoXG4gICAgICAgICAgICAgICAgfCBOb25lIC0+XG4gICAgICAgICAgICAgICAgICAgIGRvX2J1Y2tldCByZXN0XG4gICAgICAgICAgICAgICAgfCBTb21lIG5ld19kIC0+XG4gICAgICAgICAgICAgICAgICAgIEguc2V0X2tleV9kYXRhIGMgayBuZXdfZDtcbiAgICAgICAgICAgICAgICAgICAgQ29ucyhoaywgYywgZG9fYnVja2V0IHJlc3QpXG4gICAgICBpblxuICAgICAgbGV0IGQgPSBoLmRhdGEgaW5cbiAgICAgIGZvciBpID0gMCB0byBBcnJheS5sZW5ndGggZCAtIDEgZG9cbiAgICAgICAgZC4oaSkgPC0gZG9fYnVja2V0IGQuKGkpXG4gICAgICBkb25lXG5cbiAgICBsZXQgbGVuZ3RoIGggPSBoLnNpemVcblxuICAgIGxldCByZWMgYnVja2V0X2xlbmd0aCBhY2N1ID0gZnVuY3Rpb25cbiAgICAgIHwgRW1wdHkgLT4gYWNjdVxuICAgICAgfCBDb25zKF8sIF8sIHJlc3QpIC0+IGJ1Y2tldF9sZW5ndGggKGFjY3UgKyAxKSByZXN0XG5cbiAgICBsZXQgc3RhdHMgaCA9XG4gICAgICBsZXQgbWJsID1cbiAgICAgICAgQXJyYXkuZm9sZF9sZWZ0IChmdW4gbSBiIC0+IEludC5tYXggbSAoYnVja2V0X2xlbmd0aCAwIGIpKSAwIGguZGF0YSBpblxuICAgICAgbGV0IGhpc3RvID0gQXJyYXkubWFrZSAobWJsICsgMSkgMCBpblxuICAgICAgQXJyYXkuaXRlclxuICAgICAgICAoZnVuIGIgLT5cbiAgICAgICAgICAgbGV0IGwgPSBidWNrZXRfbGVuZ3RoIDAgYiBpblxuICAgICAgICAgICBoaXN0by4obCkgPC0gaGlzdG8uKGwpICsgMSlcbiAgICAgICAgaC5kYXRhO1xuICAgICAgeyBIYXNodGJsLm51bV9iaW5kaW5ncyA9IGguc2l6ZTtcbiAgICAgICAgbnVtX2J1Y2tldHMgPSBBcnJheS5sZW5ndGggaC5kYXRhO1xuICAgICAgICBtYXhfYnVja2V0X2xlbmd0aCA9IG1ibDtcbiAgICAgICAgYnVja2V0X2hp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50IGFycmF5XG4gICAgICBsZXQgY3JlYXRlIGsgZCA9XG4gICAgICAgIGxldCBjID0gY3JlYXRlIChBcnJheS5sZW5ndGggaykgaW5cbiAgICAgICAgc2V0X2RhdGEgYyBkO1xuICAgICAgICBmb3IgaT0wIHRvIEFycmF5Lmxlbmd0aCBrIC0xIGRvXG4gICAgICAgICAgc2V0X2tleSBjIGkgay4oaSk7XG4gICAgICAgIGRvbmU7XG4gICAgICAgIGNcbiAgICAgIGxldCBoYXNoIHNlZWQgayA9XG4gICAgICAgIGxldCBoID0gcmVmIDAgaW5cbiAgICAgICAgZm9yIGk9MCB0byBBcnJheS5sZW5ndGggayAtMSBkb1xuICAgICAgICAgIGggOj0gSC5oYXNoIHNlZWQgay4oaSkgKiA2NTU5OSArICFoO1xuICAgICAgICBkb25lO1xuICAgICAgICAhaFxuICAgICAgbGV0IGVxdWFsIGMgayA9XG4gICAgICAgIGxldCBsZW4gID0gQXJyYXkubGVuZ3RoIGsgaW5cbiAgICAgICAgbGV0IGxlbicgPSBsZW5ndGggYyBpblxuICAgICAgICBpZiBsZW4gIT0gbGVuJyB0aGVuIEdlbkhhc2hUYWJsZS5FRmFsc2VcbiAgICAgICAgZWxzZVxuICAgICAgICAgIGxldCByZWMgZXF1YWxfYXJyYXkgayBjIGkgPVxuICAgICAgICAgICAgaWYgaSA8IDAgdGhlbiBHZW5IYXNoVGFibGUuRVRydWVcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgbWF0Y2ggZ2V0X2tleSBjIGkgd2l0aFxuICAgICAgICAgICAgICB8IE5vbmUgLT4gR2VuSGFzaFRhYmxlLkVEZWFkXG4gICAgICAgICAgICAgIHwgU29tZSBraSAtPlxuICAgICAgICAgICAgICAgICAgaWYgSC5lcXVhbCBrLihpKSBraVxuICAgICAgICAgICAgICAgICAgdGhlbiBlcXVhbF9hcnJheSBrIGMgKGktMSlcbiAgICAgICAgICAgICAgICAgIGVsc2UgR2VuSGFzaFRhYmxlLkVGYWxzZVxuICAgICAgICAgIGluXG4gICAgICAgICAgZXF1YWxfYXJyYXkgayBjIChsZW4tMSlcbiAgICAgIGxldCBnZXRfZGF0YSA9IGdldF9kYXRhXG4gICAgICBsZXQgZ2V0X2tleSBjID1cbiAgICAgICAgbGV0IGxlbiA9IGxlbmd0aCBjIGluXG4gICAgICAgIGlmIGxlbiA9IDAgdGhlbiBTb21lIFt8fF1cbiAgICAgICAgZWxzZVxuICAgICAgICAgIG1hdGNoIGdldF9rZXkgYyAwIHdpdGhcbiAgICAgICAgICB8IE5vbmUgLT4gTm9uZVxuICAgICAgICAgIHwgU29tZSBrMCAtPlxuICAgICAgICAgICAgICBsZXQgcmVjIGZpbGwgYSBpID1cbiAgICAgICAgICAgICAgICBpZiBpIDwgMSB0aGVuIFNvbWUgYVxuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgIG1hdGNoIGdldF9rZXkgYyBpIHdpdGhcbiAgICAgICAgICAgICAgICAgIHwgTm9uZSAtPiBOb25lXG4gICAgICAgICAgICAgICAgICB8IFNvbWUga2kgLT5cbiAgICAgICAgICAgICAgICAgICAgICBhLihpKSA8LSBraTtcbiAgICAgICAgICAgICAgICAgICAgICBmaWxsIGEgKGktMSlcbiAgICAgICAgICAgICAgaW5cbiAgICAgICAgICAgICAgbGV0IGEgPSBBcnJheS5tYWtlIGxlbiBrMCBpblxuICAgICAgICAgICAgICBmaWxsIGEgKGxlbi0xKVxuICAgICAgbGV0IHNldF9rZXlfZGF0YSBjIGsgZCA9XG4gICAgICAgIHVuc2V0X2RhdGEgYztcbiAgICAgICAgZm9yIGk9MCB0byBBcnJheS5sZW5ndGggayAtMSBkb1xuICAgICAgICAgIHNldF9rZXkgYyBpIGsuKGkpO1xuICAgICAgICBkb25lO1xuICAgICAgICBzZXRfZGF0YSBjIGRcbiAgICAgIGxldCBjaGVja19rZXkgYyA9XG4gICAgICAgIGxldCByZWMgY2hlY2sgYyBpID1cbiAgICAgICAgICBpIDwgMC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uIHggPT0gay4oaSkgLT4gKClcbiAgICAgICAgICB8IF8gLT4gcmFpc2UgRXhpdFxuICAgICAgICBkb25lO1xuICAgICAgICB0cnVlXG4gICAgICB3aXRoIEV4aXQgLT4gZmFsc2VcblxuICAgIGxldCByZW1vdmUgYiBrID1cbiAgICAgIGxldCByZWMgbG9vcCBsIGFjYyA9XG4gICAgICAgIG1hdGNoIGwgd2l0aFxuICAgICAgICB8IFtdIC0+ICgpXG4gICAgICAgIHwgaCA6OiB0IHdoZW4gdGVzdF9rZXlzIGsgaCAtPiBiIDo9IExpc3QucmV2X2FwcGVuZCBhY2MgdFxuICAgICAgICB8IGggOjogdCAtPiBsb29wIHQgKGggOjogYWNjKVxuICAgICAgaW5cbiAgICAgIGxvb3AgIWIgW11cblxuICAgIGxldCBmaW5kIGIgayA9XG4gICAgICBtYXRjaCBMaXN0LmZpbmRfb3B0ICh0ZXN0X2tleXMgaykgIWIgd2l0aFxuICAgICAgfCBTb21lIGUgLT4gZ2V0X2RhdGEgZVxuICAgICAgfCBOb25lIC0+IE5vbmVcblxuICAgIGxldCBsZW5ndGggYiA9IExpc3QubGVuZ3RoICFiXG4gICAgbGV0IGNsZWFyIGIgPSBiIDo9IFtdXG5cbiAgZW5kXG5cbmVuZFxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgIFhhdmllciBMZXJveSBhbmQgRGFtaWVuIERvbGlnZXosIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG5sZXQgZ2VuZXJpY19xdW90ZSBxdW90ZXF1b3RlIHMgPVxuICBsZXQgbCA9IFN0cmluZy5sZW5ndGggcyBpblxuICBsZXQgYiA9IEJ1ZmZlci5jcmVhdGUgKGwgKyAyMCkgaW5cbiAgQnVmZmVyLmFkZF9jaGFyIGIgJ1xcJyc7XG4gIGZvciBpID0gMCB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VmZml4IGluXG4gICAgdHJ5XG4gICAgICBjbG9zZV9kZXNjKG9wZW5fZGVzYyBuYW1lIFtPcGVuX3dyb25seTsgT3Blbl9jcmVhdDsgT3Blbl9leGNsXSAwbzYwMCk7XG4gICAgICBuYW1lXG4gICAgd2l0aCBTeXNfZXJyb3IgXyBhcyBlIC0+XG4gICAgICBpZiBjb3VudGVyID49IDEwMDAgdGhlbiByYWlzZSBlIGVsc2UgdHJ5X25hbWUgKGNvdW50ZXIgKyAxKVxuICBpbiB0cnlfbmFtZSAwXG5cbmxldCBvcGVuX3RlbXBfZmlsZSA/KG1vZGUgPSBbT3Blbl90ZXh0XSkgPyhwZXJtcyA9IDBvNjAwKVxuICAgICAgICAgICAgICAgICAgID8odGVtcF9kaXIgPSAhY3VycmVudF90ZW1wX2Rpcl9uYW1lKSBwcmVmaXggc3VmZml4ID1cbiAgbGV0IHJlYyB0cnlfbmFtZSBjb3VudGVyID1cbiAgICBsZXQgbmFtZSA9IHRlbXBfZmlsZV9uYW1lIHRlbXBfZGlyIHByZWZpeCBzdWZmaXggaW5cbiAgICB0cnlcbiAgICAgIChuYW1lLFxuICAgICAgIG9wZW5fb3V0X2dlbiAoT3Blbl93cm9ubHk6Ok9wZW5fY3JlYXQ6Ok9wZW5fZXhjbDo6bW9kZSkgcGVybXMgbmFtZSlcbiAgICB3aXRoIFN5c19lcnJvciBfIGFzIGUgLT5cbiAgICAgIGlmIGNvdW50ZXIgPj0gMTAwMCB0aGVuIHJhaXNlIGUgZWxzZSB0cnlfbmFtZSAoY291bnRlciArIDEpXG4gIGluIHRyeV9uYW1lIDBcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgIFhhdmllciBMZXJveSwgcHJvamV0IENyaXN0YWwsIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMDIgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxuKCogQ29tcGxleCBudW1iZXJzICopXG5cbnR5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ICAgIHRoZW4geyByZSA9IHc7ICBpbSA9IDAuNSAqLiB4LmltIC8uIHcgfVxuICAgIGVsc2UgeyByZSA9IDAuNSAqLiBpIC8uIHc7ICBpbSA9IGlmIHguaW0gPj0gMC4wIHRoZW4gdyBlbHNlIC0uIHcgfVxuICBlbmRcblxubGV0IGV4cCB4ID1cbiAgbGV0IGUgPSBleHAgeC5yZSBpbiB7IHJlID0gZSAqLiBjb3MgeC5pbTsgaW0gPSBlICouIHNpbiB4LmltIH1cblxubGV0IGxvZyB4ID0geyByZSA9IGxvZyAobm9ybSB4KTsgaW0gPSBhdGFuMiB4LmltIHgucmUgfVxuXG5sZXQgcG93IHggeSA9IGV4cCAobXVsIHkgKGxvZyB4KSlcbiIsIigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT0NhbWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICBNYW51ZWwgU2VycmFubyBldCBYYXZpZXIgTGVyb3ksIElOUklBIFJvY3F1ZW5jb3VydCAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQ29weXJpZ2h0IDIwMDAgSW5zdGl0dXQgTmF0aW9uYWwgZGUgUmVjaGVyY2hlIGVuIEluZm9ybWF0aXF1ZSBldCAgICAgKilcbigqICAgICBlbiBBdXRvbWF0aXF1ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqICAgQWxsIHJpZ2h0cyByZXNlcnZlZC4gIFRoaXMgZmlsZSBpcyBkaXN0cmlidXRlZCB1bmRlciB0aGUgdGVybXMgb2YgICAgKilcbigqICAgdGhlIEdOVSBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2ZXJzaW9uIDIuMSwgd2l0aCB0aGUgICAgICAgICAgKilcbigqICAgc3BlY2lhbCBleGNlcHRpb24gb24gbGlua2luZyBkZXNjcmliZWQgaW4gdGhlIGZpbGUgTElDRU5TRS4gICAgICAgICAgKilcbigqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKilcbigqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKilcblxuKCogTW9kdWxlIFtCaWdhcnJheV06IGxhcmdlLCBtdWx0aS1kaW1lbnNpb25hbCwgbnVtZXJpY2FsIGFycmF5cyAqKVxuXG4oKiBUaGVzZSB0eXBlcyBpbiBtdXN0IGJlIGtlcHQgaW4gc3luYyB3aXRoIHRoZSB0YWJsZXMgaW5cbiAgIC4uL3R5cGluZy90eXBlb3B0Lm1sICopXG5cbnR5cGUgZmxvYXQzMl9lbHQgPSBGbG9hdDMyX2VsdFxudHlwZSBmbG9hdDY0X2VsdCA9IEZsb2F0NjRfZWx0XG50eXBlIGludDhfc2lnbmVkX2VsdCA9IEludDhfc2lnbmVkX2VsdFxudHlwZSBpbnQ4X3Vuc2lnbmVkX2VsdCA9IEludDhfdW5zaWduZWRfZWx0XG50eXBlIGludDE2X3NpZ25lZF9lbHQgPSBJbnQxNl9zaWduZWRfZWx0XG50eXBlIGludDE2X3Vuc2lnbmVkX2VsdCA9IEludD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C0+IHVuaXQgPSBcImNhbWxfYmFfc2V0XzNcIlxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMjAyMSBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdG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KioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMjAyMSBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICA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uc29tZVxuICAgIChKcy5VbnNhZmUuY2FsbGJhY2sgKGZ1biBlIC0+XG4gICAgICAgICAoKiBkZXBlbmRpbmcgb24gdGhlIGludGVybmV0IGV4cGxvcmVyIHZlcnNpb24sIGUgY2FuIGJlIG51bGwgb3IgdW5kZWZpbmVkLiAqKVxuICAgICAgICAgaWYgbm90IChKcy5PcHQudGVzdCAoc29tZSBlKSlcbiAgICAgICAgIHRoZW4gKFxuICAgICAgICAgICBsZXQgZSA9IHdpbmRvd19ldmVudCAoKSBpblxuICAgICAgICAgICBsZXQgcmVzID0gZiBlIGluXG4gICAgICAgICAgIGlmIG5vdCAoSnMudG9fYm9vbCByZXMpIHRoZW4gZSMjLnJldHVyblZhbHVlIDo9IHJlcztcbiAgICAgICAgICAgcmVzKVxuICAgICAgICAgZWxzZVxuICAgICAgICAgICBsZXQgcmVzID0gZiBlIGluXG4gICAgICAgICAgIGlmIG5vdCAoSnMudG9fYm9vbCByZXMpIHRoZW4gKEpzLlVuc2FmZS5jb2VyY2UgZSkjI3ByZXZlbnREZWZhdWx0O1xuICAgICAgICAgICByZXMpKVxuXG5sZXQgZnVsbF9oYW5kbGVyIGYgPVxuICBKcy5zb21lXG4gICAgKEpzLlVuc2FmZS5tZXRoX2NhbGxiYWNrIChmdW4gdGhpcyBlIC0+XG4gICAgICAgICAoKiBkZXBlbmRpbmcgb24gdGhlIGludGVybmV0IGV4cGxvcmVyIHZlcnNpb24sIGUgY2FuIGJlIG51bGwgb3IgdW5kZWZpbmVkICopXG4gICAgICAgICBpZiBub3QgKEpzLk9wdC50ZXN0IChzb21lIGUpKVxuICAgICAgICAgdGhlbiAoXG4gICAgICAgICAgIGxldCBlID0gd2luZG93X2V2ZW50ICgpIGluXG4gICAgICAgICAgIGxldCByZXMgPSBmIHRoaXMgZSBpblxuICAgICAgICAgICBpZiBub3QgKEpzLnRvX2Jvb2wgcmVzKSB0aGVuIGUjIy5yZXR1cm5WYWx1ZSA6PSByZXM7XG4gICAgICAgICAgI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19vcHRpb24gZWx0IyMubXVsdGlwbGUgd2l0aFxuICAgICAgICAgICAgICAgIHwgTm9uZSB8IFNvbWUgZmFsc2UgLT4gKFxuICAgICAgICAgICAgICAgICAgICBtYXRjaCBPcHQudG9fb3B0aW9uIChsaXN0IyNpdGVtIDApIHdpdGhcbiAgICAgICAgICAgICAgICAgICAgfCBOb25lIC0+IFtdXG4gICAgICAgICAgICAgICAgICAgIHwgU29tZSBmaWxlIC0+IFsgbmFtZSwgYEZpbGUgZmlsZSBdKVxuICAgICAgICAgICAgICAgIHwgU29tZSB0cnVlIC0+XG4gICAgICAgICAgICAgICAgICAgIGZpbHRlcl9tYXBcbiAgICAgICAgICAgICAgICAgICAgICAoZnVuIGYgLT5cbiAgICAgICAgICAgICAgICAgICAgICAgIG1hdGNoIE9wdC50b19vcHRpb24gZiB3aXRoXG4gICAgICAgICAgICAgICAgICAgICAgICB8IE5vbmUgLT4gTm9uZVxuICAgICAgICAgICAgICAgICAgICAgICAgfCBTb21lIGZpbGUgLT4gU29tZSAobmFtZSwgYEZpbGUgZmlsZSkpXG4gICAgICAgICAgICAgICAgICAgICAgKEFycmF5LnRvX2xpc3QgKEFycmF5LmluaXQgbGlzdCMjLmxlbmd0aCAoZnVuIGkgLT4gbGlzdCMjaXRlbSBpKSkpKSlcbiAgICB8IF8gLT4gWyBuYW1lLCBgU3RyaW5nIHZhbHVlIF1cbiAgZWxzZSBbXVxuXG5sZXQgZ2V0X2Zvcm1fZWxlbWVudHMgKGZvcm0gOiBmb3JtRWxlbWVudCB0KSA9XG4gIGxldCByZWMgbG9vcCBhY2MgaSA9XG4gICAgaWYgaSA8IDBcbiAgICB0aGVuIGFjY1xuICAgIGVsc2VcbiAgICAgIG1hdGNoIE9wdC50b19vcHRpb24gKGZvcm0jIy5lbGVtZW50cyMjaXRlbSBpKSB3aXRoXG4gICAgICB8IE5vbmUgLT4gbG9vcCBhY2MgKGkgLSBpKVxuICAgICAgfCBTb21lIHggLT4gbG9vcCAoeCA6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biAgICBsZXQgaHNsYV9yZSA9XG4gICAgICBuZXclanMgSnMucmVnRXhwXG4gICAgICAgIChKcy5ieXRlc3RyaW5nIFwiXmhzbGFcXFxcKFxcXFxzKlxcXFxkKixcXFxccypcXFxcZColLFxcXFxzKlxcXFxkKiUsXFxcXGQqXFxcXC4/XFxcXGQqXFxcXCkkXCIpXG4gICAgaW5cbiAgICBpZiBKcy50b19ib29sIChyZ2JfcmUjI3Rlc3QgcylcbiAgICAgICB8fCBKcy50b19ib29sIChyZ2JhX3JlIyN0ZXN0IHMpXG4gICAgICAgfHwgSnMudG9fYm9vbCAocmdiX3BjdF9yZSMjdGVzdCBzKVxuICAgICAgIHx8IEpzLnRvX2Jvb2wgKHJnYmFfcGN0X3JlIyN0ZXN0IHMpXG4gICAgICAgfHwgSnMudG9fYm9vbCAoaHNsX3JlIyN0ZXN0IHMpXG4gICAgICAgfHwgSnMudG9fYm9vbCAoaHNsYV9yZSMjdGVzdCBzKVxuICAgIHRoZW4gc1xuICAgIGVsc2UgaWYgTGlzdC5tZW1cbiAgICAgICAgICAgICAgKEpzLnRvX3N0cmluZyBzKVxuICAgICAgICAgICAgICBbIFwiYWxpY2VibHVlXCJcbiAgICAgICAgICAgICAgOyBcImFudGlxdWV3aGl0ZVwiXG4gICAgICAgICAgICAgIDsgXCJhcXVhXCJcbiAgICAgICAgICAgICAgOyBcImFxdWFtYXJpbmVcIlxuICAgICAgICAgICAgICA7IFwiYXp1cmVcIlxuICAgICAgICAgICAgICA7IFwiYmVpZ2VcIlxuICAgICAgICAgICAgICA7IFwiYmlzcXVlXCJcbiAgICAgICAgICAgICAgOyBcImJsYWNrXCJcbiAgICAgICAgICAgICAgOyBcImJsYW5jaGVkYWxtb25kXCJcbiAgICAgICAgICAgICAgOyBcImJsdWVcIlxuICAgICAgICAgICAgICA7IFwiYmx1ZXZpb2xldFwiXG4gICAgICAgICAgICAgIDsgXCJicm93blwiXG4gICAgICAgICAgICAgIDsgXCJidXJseXdvb2RcIlxuICAgICAgICAgICAgICA7IFwiY2FkZXRibHVlXCJcbiAgICAgICAgICAgICAgOyBcImNoYXJ0cmV1c2VcIlxuICAgICAgICAgICAgICA7IFwiY2hvY29sYXRlXCJcbiAgICAgICAgICAgICAgOyBcImNvcmFsXCJcbiAgICAgICAgICAgICAgOyBcImNvcm5mbG93ZXJibHVlXCJcbiAgICAgICAgICAgICAgOyBcImNvcm5zaWxrXCJcbiAgICAgICAgICAgICAgOyBcImNyaW1zb25cIlxuICAgICAgICAgICAgICA7IFwiY3lhblwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrYmx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrY3lhblwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrZ29sZGVucm9kXCJcbiAgICAgICAgICAgICAgOyBcImRhcmtncmF5XCJcbiAgICAgICAgICAgICAgOyBcImRhcmtncmVlblwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrZ3JleVwiXG4gICAgICAgICAgICAgIDsgXCJkYXJra2hha2lcIlxuICAgICAgICAgICAgICA7IFwiZGFya21hZ2VudGFcIlxuICAgICAgICAgICAgICA7IFwiZGFya29saXZlZ3JlZW5cIlxuICAgICAgICAgICAgICA7IFwiZGFya29yYW5nZVwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrb3JjaGlkXCJcbiAgICAgICAgICAgICAgOyBcImRhcmtyZWRcIlxuICAgICAgICAgICAgICA7IFwiZGFya3NhbG1vblwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrc2VhZ3JlZW5cIlxuICAgICAgICAgICAgICA7IFwiZGFya3NsYXRlYmx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrc2xhdGVncmF5XCJcbiAgICAgICAgICAgICAgOyBcImRhcmtzbGF0ZWdyZXlcIlxuICAgICAgICAgICAgICA7IFwiZGFya3R1cnF1b2lzZVwiXG4gICAgICAgICAgICAgIDsgXCJkYXJrdmlvbGV0XCJcbiAgICAgICAgICAgICAgOyBcImRlZXBwaW5rXCJcbiAgICAgICAgICAgICAgOyBcImRlZXBza3libHVlXCJcbiAgICAgICAgICAgICAgOyBcImRpbWdyYXlcIlxuICAgICAgICAgICAgICA7IFwiZGltZ3JleVwiXG4gICAgICAgICAgICAgIDsgXCJkb2RnZXJibHVlXCJcbiAgICAgICAgICAgICAgOyBcImZpcmVicmlja1wiXG4gICAgICAgICAgICAgIDsgXCJmbG9yYWx3aGl0ZVwiXG4gICAgICAgICAgICAgIDsgXCJmb3Jlc3RncmVlblwiXG4gICAgICAgICAgICAgIDsgXCJmdWNoc2lhXCJcbiAgICAgICAgICAgICAgOyBcImdhaW5zYm9yb1wiXG4gICAgICAgICAgICAgIDsgXCJnaG9zdHdoaXRlXCJcbiAgICAgICAgICAgICAgOyBcImdvbGRcIlxuICAgICAgICAgICAgICA7IFwiZ29sZGVucm9kXCJcbiAgICAgICAgICAgICAgOyBcImdyYXlcIlxuICAgICAgICAgICAgICA7IFwiZ3JlZW5cIlxuICAgICAgICAgICAgICA7IFwiZ3JlZW55ZWxsb3dcIlxuICAgICAgICAgICAgICA7IFwiZ3JleVwiXG4gICAgICAgICAgICAgIDsgXCJob25leWRld1wiXG4gICAgICAgICAgICAgIDsgXCJob3RwaW5rXCJcbiAgICAgICAgICAgICAgOyBcImluZGlhbnJlZFwiXG4gICAgICAgICAgICAgIDsgXCJpbmRpZ29cIlxuICAgICAgICAgICAgICA7IFwiaXZvcnlcIlxuICAgICAgICAgICAgICA7IFwia2hha2lcIlxuICAgICAgICAgICAgICA7IFwibGF2ZW5kZXJcIlxuICAgICAgICAgICAgICA7IFwibGF2ZW5kZXJibHVzaFwiXG4gICAgICAgICAgICAgIDsgXCJsYXduZ3JlZW5cIlxuICAgICAgICAgICAgICA7IFwibGVtb25jaGlmZm9uXCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0Ymx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJsaWdodGNvcmFsXCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0Y3lhblwiXG4gICAgICAgICAgICAgIDsgXCJsaWdodGdvbGRlbnJvZHllbGxvd1wiXG4gICAgICAgICAgICAgIDsgXCJsaWdodGdyYXlcIlxuICAgICAgICAgICAgICA7IFwibGlnaHRncmVlblwiXG4gICAgICAgICAgICAgIDsgXCJsaWdodGdyZXlcIlxuICAgICAgICAgICAgICA7IFwibGlnaHRwaW5rXCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0c2FsbW9uXCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0c2VhZ3JlZW5cIlxuICAgICAgICAgICAgICA7IFwibGlnaHRza3libHVlXCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0c2xhdGVncmF5XCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0c2xhdGVncmV5XCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0c3RlZWxibHVlXCJcbiAgICAgICAgICAgICAgOyBcImxpZ2h0eWVsbG93XCJcbiAgICAgICAgICAgICAgOyBcImxpbWVcIlxuICAgICAgICAgICAgICA7IFwibGltZWdyZWVuXCJcbiAgICAgICAgICAgICAgOyBcImxpbmVuXCJcbiAgICAgICAgICAgICAgOyBcIm1hZ2VudGFcIlxuICAgICAgICAgICAgICA7IFwibWFyb29uXCJcbiAgICAgICAgICAgICAgOyBcIm1lZGl1bWFxdWFtYXJpbmVcIlxuICAgICAgICAgICAgICA7IFwibWVkaXVtYmx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJtZWRpdW1vcmNoaWRcIlxuICAgICAgICAgICAgICA7IFwibWVkaXVtcHVycGxlXCJcbiAgICAgICAgICAgICAgOyBcIm1lZGl1bXNlYWdyZWVuXCJcbiAgICAgICAgICAgICAgOyBcIm1lZGl1bXNsYXRlYmx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJtZWRpdW1zcHJpbmdncmVlblwiXG4gICAgICAgICAgICAgIDsgXCJtZWRpdW10dXJxdW9pc2VcIlxuICAgICAgICAgICAgICA7IFwibWVkaXVtdmlvbGV0cmVkXCJcbiAgICAgICAgICAgICAgOyBcIm1pZG5pZ2h0Ymx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJtaW50Y3JlYW1cIlxuICAgICAgICAgICAgICA7IFwibWlzdHlyb3NlXCJcbiAgICAgICAgICAgICAgOyBcIm1vY2Nhc2luXCJcbiAgICAgICAgICAgICAgOyBcIm5hdmFqb3doaXRlXCJcbiAgICAgICAgICAgICAgOyBcIm5hdnlcIlxuICAgICAgICAgICAgICA7IFwib2xkbGFjZVwiXG4gICAgICAgICAgICAgIDsgXCJvbGl2ZVwiXG4gICAgICAgICAgICAgIDsgXCJvbGl2ZWRyYWJcIlxuICAgICAgICAgICAgICA7IFwib3JhbmdlXCJcbiAgICAgICAgICAgICAgOyBcIm9yYW5nZXJlZFwiXG4gICAgICAgICAgICAgIDsgXCJvcmNoaWRcIlxuICAgICAgICAgICAgICA7IFwicGFsZWdvbGRlbnJvZFwiXG4gICAgICAgICAgICAgIDsgXCJwYWxlZ3JlZW5cIlxuICAgICAgICAgICAgICA7IFwicGFsZXR1cnF1b2lzZVwiXG4gICAgICAgICAgICAgIDsgXCJwYWxldmlvbGV0cmVkXCJcbiAgICAgICAgICAgICAgOyBcInBhcGF5YXdoaXBcIlxuICAgICAgICAgICAgICA7IFwicGVhY2hwdWZmXCJcbiAgICAgICAgICAgICAgOyBcInBlcnVcIlxuICAgICAgICAgICAgICA7IFwicGlua1wiXG4gICAgICAgICAgICAgIDsgXCJwbHVtXCJcbiAgICAgICAgICAgICAgOyBcInBvd2RlcmJsdWVcIlxuICAgICAgICAgICAgICA7IFwicHVycGxlXCJcbiAgICAgICAgICAgICAgOyBcInJlZFwiXG4gICAgICAgICAgICAgIDsgXCJyb3N5YnJvd25cIlxuICAgICAgICAgICAgICA7IFwicm95YWxibHVlXCJcbiAgICAgICAgICAgICAgOyBcInNhZGRsZWJyb3duXCJcbiAgICAgICAgICAgICAgOyBcInNhbG1vblwiXG4gICAgICAgICAgICAgIDsgXCJzYW5keWJyb3duXCJcbiAgICAgICAgICAgICAgOyBcInNlYWdyZWVuXCJcbiAgICAgICAgICAgICAgOyBcInNlYXNoZWxsXCJcbiAgICAgICAgICAgICAgOyBcInNpZW5uYVwiXG4gICAgICAgICAgICAgIDsgXCJzaWx2ZXJcIlxuICAgICAgICAgICAgICA7IFwic2t5Ymx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJzbGF0ZWJsdWVcIlxuICAgICAgICAgICAgICA7IFwic2xhdGVncmF5XCJcbiAgICAgICAgICAgICAgOyBcInNsYXRlZ3JleVwiXG4gICAgICAgICAgICAgIDsgXCJzbm93XCJcbiAgICAgICAgICAgICAgOyBcInNwcmluZ2dyZWVuXCJcbiAgICAgICAgICAgICAgOyBcInN0ZWVsYmx1ZVwiXG4gICAgICAgICAgICAgIDsgXCJ0YW5cIlxuICAgICAgICAgICAgICA7IFwidGVhbFwiXG4gICAgICAgICAgICAgIDsgXCJ0aGlzdGxlXCJcbiAgICAgICAgICAgICAgOyBcInRvbWF0b1wiXG4gICAgICAgICAgICAgIDsgXCJ0dXJxdW9pc2VcIlxuICAgICAgICAgICAgICA7IFwidmlvbGV0XCJcbiAgICAgICAgICAgICAgOyBcIndoZWF0XCJcbiAgICAgICAgICAgICAgOyBcIndoaXRlXCJcbiAgICAgICAgICAgICAgOyBcIndoaXRlc21va2VcIlxuICAgICAgICAgICAgICA7IFwieWVsbG93XCJcbiAgICAgICAgICAgICAgOyBcInllbGxvd2dyZWVuXCJcbiAgICAgICAgICAgICAgXVxuICAgIHRoZW4gc1xuICAgIGVsc2UgcmFpc2UgKEludmFsaWRfYXJndW1lbnQgKEpzLnRvX3N0cmluZyBzIF4gXCIgaXMgbm90IGEgdmFsaWQgY29sb3JcIikpXG5cbiAgbGV0IG5hbWUgY24gPSBKcy5zdHJpbmcgKHN0cmluZ19vZl9uYW1lIGNuKVxuXG4gIGxldCBqcyA9IGZ1bmN0aW9uXG4gICAgfCBOYW1lIG4gLT4gbmFtZSBuXG4gICA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XG4gICAgICAgICAgfCBTb21lIFwicmdiYVwiIC0+IChcbiAgICAgICAgICAgICAgbWF0Y2ggYWxwaGEgd2l0aFxuICAgICAgICAgICAgICB8IE5vbmUgLT4gZmFpbCAoKVxuICAgICAgICAgICAgICB8IFNvbWUgYSAtPiBSR0JBIChpX29mX3NfbyByZWQsIGlfb2Zfc19vIGdyZWVuLCBpX29mX3NfbyBibHVlLCBmX29mX3MgYSkpXG4gICAgICAgICAgfCBTb21lIF8gfCBOb25lIC0+IGZhaWwgKCkpXG4gICAgICB8IE5vbmUgLT4gKFxuICAgICAgICAgIG1hdGNoIFJlZ2V4cC5zdHJpbmdfbWF0Y2ggcmVfcmdiX3BjdCBzIDAgd2l0aFxuICAgICAgICAgIHwgU29tZSByIC0+IChcbiAgICAgICAgICAgICAgbGV0IHJlZCA9IFJlZ2V4cC5tYXRjaGVkX2dyb3VwIHIgMiBpblxuICAgICAgICAgICAgICBsZXQgZ3JlZW4gPSBSZWdleHAubWF0Y2hlZF9ncm91cCByIDMgaW5cbiAgICAgICAgICAgICAgbGV0IGJsdWUgPSBSZWdleHAubWF0Y2hlZF9ncm91cCByIDQgaW5cbiAgICAgICAgICAgICAgbGV0IGFscGhhID0gUmVnZXhwLm1hdGNoZWRfZ3JvdXAgciA1IGluXG4gICAgICAgICAgICAgIG1hdGNoIFJlZ2V4cC5tYXRjaGVkX2dyb3VwIHIgMSB3aXRoXG4gICAgICAgICAgICAgIHwgU29tZSBcInJnYlwiIC0+IChcbiAgICAgICAgICAgICAgICAgIG1hdGNoIGFscGhhIHdpdGhcbiAgICAgICAgICAgICAgICAgIHwgU29tZSBfIC0+IGZhaWwgKClcbiAgICAgICAgICAgICAgICAgIHwgTm9uZSAtPiBSR0JfcGVyY2VudCAoaV9vZl9zX28gcmVkLCBpX29mX3NfbyBncmVlbiwgaV9vZl9zX28gYmx1ZSkpXG4gICAgICAgICAgICAgIHwgU29tZSBcInJnYmFcIiAtPiAoXG4gICAgICAgICAgICAgICAgICBtYXRjaCBhbHBoYSB3aXRoXG4gICAgICAgICAgICAgICAgICB8IE5vbmUgLT4gZmFpbCAoKVxuICAgICAgICAgICAgICAgICAgfCBTb21lIGEgLT5cbiAgICAgICAgICAgICAgICAgICAgICBSR0JBX3BlcmNlbnQgKGlfb2Zfc19vIHJlZCwgaV9vZl9zX28gZ3JlZW4sIGlfb2Zfc19vIGJsdWUsIGZfb2ZfcyBhKVxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICB8IFNvbWUgXyB8IE5vbmUgLT4gZmFpbCAoKSlcbiAgICAgICAgICB8IE5vbmUgLT4gKFxuICAgICAgICAgICAgICBtYXRjaCBSZWdleHAuc3RyaW5nX21hdGNoIHJlX2hzbCBzIDAgd2l0aFxuICAgICAgICAgICAgICB8IFNvbWUgciAtPiAoXG4gICAgICAgICAgICAgICAgICBsZXQgcmVkID0gUmVnZXhwLm1hdGNoZWRfZ3JvdXAgciAyIGluXG4gICAgICAgICAgICAgICAgICBsZXQgZ3JlZW4gPSBSZWdleHAubWF0Y2hlZF9ncm91cCByIDMgaW5cbiAgICAgICAgICAgICAgICAgIGxldCBibHVlID0gUmVnZXhwLm1hdGNoZWRfZ3JvdXAgciA0IGluXG4gICAgICAgICAgICAgICAgICBsZXQgYWxwaGEgPSBSZWdleHAubWF0Y2hlZF9ncm91cCByIDUgaW5cbiAgICAgICAgICAgICAgICAgIG1hdGNoIFJlZ2V4cC5tYXRjaGVkX2dyb3VwIHIgMSB3aXRoXG4gICAgICAgICAgICAgICAgICB8IFNvbWUgXCJoc2xcIiAtPiAoXG4gICAgICAgICAgICAgICAgICAgICAgbWF0Y2ggYWxwaGEgd2l0aFxuICAgICAgICAgICAgICAgICAgICAgIHwgU29tZSBfIC0+IGZhaWwgKClcbiAgICAgICAgICAgICAgICAgICAgICB8IE5vbmUgLT4gSFNMIChpX29mX3NfbyByZWQsIGlfb2Zfc19vIGdyZWVuLCBpX29mX3NfbyBibHVlKSlcbiAgICAgICAgICAgICAgIC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PSBKcy5zdHJpbmcgKHN0cmluZ19vZl90IHQpXG5cbiAgbGV0IG1sIHQgPVxuICAgIGxldCBzID0gSnMudG9fc3RyaW5nIHQgaW5cbiAgICBpZiBTdHJpbmcuZXF1YWwgcyBcIjBcIlxuICAgIHRoZW4gWmVyb1xuICAgIGVsc2VcbiAgICAgIGxldCBmYWlsICgpID0gcmFpc2UgKEludmFsaWRfYXJndW1lbnQgKHMgXiBcIiBpcyBub3QgYSB2YWxpZCBsZW5ndGhcIikpIGluXG4gICAgICBsZXQgcmUgPSBSZWdleHAucmVnZXhwIFwiXihcXFxcZCooPzpcXFxcLlxcXFxkKik/KVxcXFxzKihcXFxcUyopJFwiIGluXG4gICAgICBtYXRjaCBSZWdleHAuc3RyaW5nX21hdGNoIHJlIHMgMCB3aXRoXG4gICAgICB8IE5vbmUgLT4gZmFpbCAoKVxuICAgICAgfCBTb21lIHIgLT4gKFxuICAgICAgICAgIGxldCBmID1cbiAgICAgICAgICAgIG1hdGNoIFJlZ2V4cC5tYXRjaGVkX2dyb3VwIHIgMSB3aXRoXG4gICAgICAgICAgICB8IE5vbmUgLT4gZmFpbCAoKVxuICAgICAgICAgICAgfCBTb21lIGYgLT4gKFxuICAgICAgICAgICAgICAgIHRyeSBmbG9hdF9vZl9zdHJpbmcgZlxuICAgICAgICAgICAgICAgIHdpdGggSW52YWxpZF9hcmd1bWVudCBzIC0+XG4gICAgICAgICAgICAgICAgICByYWlzZSAoSW52YWxpZF9hcmd1bWVudCAoXCJsZW5ndGggY29udmVyc2lvbiBlcnJvcjogXCIgXiBzKSkpXG4gICAgICAgICAgaW5cbiAgICAgICAgICBtYXRjaCBSZWdleHAubWF0Y2hlZF9ncm91cCByIDIgd2l0aFxuICAgICAgICAgIHwgTm9uZSAtPiBmYWlsICgpXG4gICAgICAgICAgfCBTb21lIFwiZW1cIiAtPiBFbSBmXG4gICAgICAgICAgfCBTb21lIFwiZXhcIiAtPiBFeCBmXG4gICAgICAgICAgfCBTb21lIFwicH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E9iamVjdCBbIChcImZvb1wiLCBTdHJpbmcgXCJiYXJcIikgXSlcblxuICAgICAgIG1ldGhvZCBwYXJzZVN0cmluZyBzdHIgY2IgPVxuICAgICAgICAgbWF0Y2ggUGFyc2VyLnBhcnNlIHN0ciB3aXRoXG4gICAgICAgICB8IHRyZWUgLT5cbiAgICAgICAgICAgICBsZXQgdHJlZSA9IHRyZWVfdG9fanMgdHJlZSBpblxuICAgICAgICAgICAgIEpzLlVuc2FmZS5mdW5fY2FsbCBjYlxuICAgICAgICAgICAgICAgW3wgSnMuVW5zYWZlLmluamVjdCBKcy5udWxsOyBKcy5VbnNhZmUuaW5qZWN0IEBAIEpzLnNvbWUgdHJlZSB8XVxuICAgICAgICAgfCBleGNlcHRpb24gXyAtPlxuICAgICAgICAgICAgIEpzLlVuc2FmZS5mdW5fY2FsbCBjYlxuICAgICAgICAgICAgICAgW3xcbiAgICAgICAgICAgICAgICAgSnMuVW5zYWZlLmluamVjdCBAQCBKcy5zb21lIFwiVE9ETyBwYXJzaW5nIGVycm9yXCI7XG4gICAgICAgICAgICAgICAgIEpzLlVuc2FmZS5pbmplY3QgSnMubnVsbDtcbiAgICAgICAgICAgICAgIHxdXG4gICAgICAgKCogbWV0aG9kIHBhcnNlU3RyaW5nX3dpdGhPcHRzIHN0ciBfb3B0cyBfY2IgPSBQYXJzZXIucGFyc2Ugc3RyICopXG4gICAgZW5kKVxuIiwiKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQ2FtbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgWGF2aWVyIExlcm95LCBwcm9qZXQgQ3Jpc3RhbCwgSU5SSUEgUm9jcXVlbmNvdXJ0ICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBDb3B5cmlnaHQgMTk5NiBJbnN0aXR1dCBOYXRpb25hbCBkZSBSZWNoZXJjaGUgZW4gSW5mb3JtYXRpcXVlIGV0ICAgICAqKVxuKCogICAgIGVuIEF1dG9tYXRpcXVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCogICBBbGwgcmlnaHRzIHJlc2VydmVkLiAgVGhpcyBmaWxlIGlzIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSB0ZXJtcyBvZiAgICAqKVxuKCogICB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIHZlcnNpb24gMi4xLCB3aXRoIHRoZSAgICAgICAgICAqKVxuKCogICBzcGVjaWFsIGV4Y2VwdGlvbiBvbiBsaW5raW5nIGRlc2NyaWJlZCBpbiB0aGUgZmlsZSBMSUNFTlNFLiAgICAgICAgICAqKVxuKCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKVxuKCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKVxuXG4oKiBFbnN1cmUgdGhhdCBbYXRfZXhpdF0gZnVuY3Rpb25zIGFyZSBjYWxsZWQgYXQgdGhlIGVuZCBvZiBldmVyeSBwcm9ncmFtICopXG5cbmxldCBfID0gZG9fYXRfZXhpdCgpXG4iXX0= diff --git a/node_modules/xml2js/lib/xml2js.js b/node_modules/xml2js/lib/xml2js.js new file mode 100644 index 0000000..24b6e69 --- /dev/null +++ b/node_modules/xml2js/lib/xml2js.js @@ -0,0 +1,39 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + "use strict"; + var builder, defaults, parser, processors, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + defaults = require('./defaults'); + + builder = require('./builder'); + + parser = require('./parser'); + + processors = require('./processors'); + + exports.defaults = defaults.defaults; + + exports.processors = processors; + + exports.ValidationError = (function(superClass) { + extend(ValidationError, superClass); + + function ValidationError(message) { + this.message = message; + } + + return ValidationError; + + })(Error); + + exports.Builder = builder.Builder; + + exports.Parser = parser.Parser; + + exports.parseString = parser.parseString; + + exports.parseStringPromise = parser.parseStringPromise; + +}).call(this); diff --git a/node_modules/xml2js/package.json b/node_modules/xml2js/package.json new file mode 100644 index 0000000..d241d68 --- /dev/null +++ b/node_modules/xml2js/package.json @@ -0,0 +1,93 @@ +{ + "name": "xml2js", + "description": "Simple XML to JavaScript object converter.", + "keywords": [ + "xml", + "json" + ], + "homepage": "https://github.com/Leonidas-from-XIV/node-xml2js", + "version": "0.6.2", + "author": "Marek Kubica (https://xivilization.net)", + "contributors": [ + "maqr (https://github.com/maqr)", + "Ben Weaver (http://benweaver.com/)", + "Jae Kwon (https://github.com/jaekwon)", + "Jim Robert", + "Ștefan Rusu (http://www.saltwaterc.eu/)", + "Carter Cole (http://cartercole.com/)", + "Kurt Raschke (http://www.kurtraschke.com/)", + "Contra (https://github.com/Contra)", + "Marcelo Diniz (https://github.com/mdiniz)", + "Michael Hart (https://github.com/mhart)", + "Zachary Scott (http://zacharyscott.net/)", + "Raoul Millais (https://github.com/raoulmillais)", + "Salsita Software (http://www.salsitasoft.com/)", + "Mike Schilling (http://www.emotive.com/)", + "Jackson Tian (http://weibo.com/shyvo)", + "Mikhail Zyatin (https://github.com/Sitin)", + "Chris Tavares (https://github.com/christav)", + "Frank Xu (http://f2e.us/)", + "Guido D'Albore (http://www.bitstorm.it/)", + "Jack Senechal (http://jacksenechal.com/)", + "Matthias Hölzl (https://github.com/hoelzl)", + "Camille Reynders (http://www.creynders.be/)", + "Taylor Gautier (https://github.com/tsgautier)", + "Todd Bryan (https://github.com/toddrbryan)", + "Leore Avidar (http://leoreavidar.com/)", + "Dave Aitken (http://www.actionshrimp.com/)", + "Shaney Orrowe ", + "Candle ", + "Jess Telford (http://jes.st)", + "Tom Hughes < (http://compton.nu/)", + "Piotr Rochala (http://rocha.la/)", + "Michael Avila (https://github.com/michaelavila)", + "Ryan Gahl (https://github.com/ryedin)", + "Eric Laberge (https://github.com/elaberge)", + "Benjamin E. Coe (https://twitter.com/benjamincoe)", + "Stephen Cresswell (https://github.com/cressie176)", + "Pascal Ehlert (http://www.hacksrus.net/)", + "Tom Spencer (http://fiznool.com/)", + "Tristian Flanagan (https://github.com/tflanagan)", + "Tim Johns (https://github.com/TimJohns)", + "Bogdan Chadkin (https://github.com/TrySound)", + "David Wood (http://codesleuth.co.uk/)", + "Nicolas Maquet (https://github.com/nmaquet)", + "Lovell Fuller (http://lovell.info/)", + "d3adc0d3 (https://github.com/d3adc0d3)", + "James Crosby (https://github.com/autopulated)" + ], + "main": "./lib/xml2js", + "files": [ + "lib" + ], + "directories": { + "lib": "./lib" + }, + "scripts": { + "build": "cake build", + "test": "zap", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", + "doc": "cake doc" + }, + "repository": { + "type": "git", + "url": "https://github.com/Leonidas-from-XIV/node-xml2js.git" + }, + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "devDependencies": { + "coffeescript": ">=1.10.0 <2", + "coveralls": "^3.0.1", + "diff": ">=1.0.8", + "docco": ">=0.6.2", + "nyc": ">=2.2.1", + "zap": ">=0.2.9 <1" + }, + "engines": { + "node": ">=4.0.0" + }, + "license": "MIT" +} diff --git a/node_modules/xmlbuilder/CHANGELOG.md b/node_modules/xmlbuilder/CHANGELOG.md new file mode 100644 index 0000000..610f412 --- /dev/null +++ b/node_modules/xmlbuilder/CHANGELOG.md @@ -0,0 +1,470 @@ +# Change Log + +All notable changes to this project are documented in this file. This project adheres to [Semantic Versioning](http://semver.org/#semantic-versioning-200). + +## [11.0.0] - 2019-02-18 +- Calling `end()` with arguments no longer overwrites writer options. See [#120](https://github.com/oozcitak/xmlbuilder-js/issues/120). +- Added writer state and customizable space and endline functions to help customize writer behavior. Also added `openNode` and `closeNode` functions to writer. See [#193](https://github.com/oozcitak/xmlbuilder-js/issues/193). +- Fixed a bug where writer functions would not be called for nodes with a single child node in pretty print mode. See [#195](https://github.com/oozcitak/xmlbuilder-js/issues/195). +- Renamed `elEscape` to `textEscape` in `XMLStringifier`. +- Fixed a bug where empty arrays would produce child nodes. See [#190](https://github.com/oozcitak/xmlbuilder-js/issues/190). +- Removed the `skipNullAttributes` option. `null` attributes are now skipped by default. Added the `keepNullAttributes` option in case someone needs the old behavior. +- Removed the `skipNullNodes` option. `null` nodes are now skipped by default. Added the `keepNullNodes` option in case someone needs the old behavior. +- `undefined` values are now skipped when converting JS objects. +- Renamed stringify functions. See [#194](https://github.com/oozcitak/xmlbuilder-js/issues/194): + * `eleName` -> `name` + * `attName` -> `name` + * `eleText` -> `text` +- Fixed argument order for `attribute` function in the writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196). +- Added `openAttribute` and `closeAttribute` functions to writer. See [#196](https://github.com/oozcitak/xmlbuilder-js/issues/196). +- Added node types to node objects. Node types and writer states are exported by the module with the `nodeType` and `writerState` properties. +- Fixed a bug where array items would not be correctly converted. See [#159](https://github.com/oozcitak/xmlbuilder-js/issues/159). +- Fixed a bug where mixed-content inside JS objects with `#text` decorator would not be correctly converted. See [#171](https://github.com/oozcitak/xmlbuilder-js/issues/171). +- Fixed a bug where JS objects would not be expanded in callback mode. See [#173](https://github.com/oozcitak/xmlbuilder-js/issues/173). +- Fixed a bug where character validation would not obey document's XML version. Added separate validation for XML 1.0 and XML 1.1 documents. See [#169](https://github.com/oozcitak/xmlbuilder-js/issues/169). +- Fixed a bug where names would not be validated according to the spec. See [#49](https://github.com/oozcitak/xmlbuilder-js/issues/49). +- Renamed `text` property to `value` in comment and cdata nodes to unify the API. +- Removed `doctype` function to prevent name clash with DOM implementation. Use the `dtd` function instead. +- Removed dummy nodes from the XML tree (Those were created while chain-building the tree). +- Renamed `attributes`property to `attribs` to prevent name clash with DOM property with the same name. +- Implemented the DOM standard (read-only) to support XPath lookups. XML namespaces are not currently supported. See [#122](https://github.com/oozcitak/xmlbuilder-js/issues/122). + +## [10.1.1] - 2018-10-24 +- Fixed an edge case where a null node at root level would be printed although `skipNullNodes` was set. See [#187](https://github.com/oozcitak/xmlbuilder-js/issues/187). + +## [10.1.0] - 2018-10-10 +- Added the `skipNullNodes` option to skip nodes with null values. See [#158](https://github.com/oozcitak/xmlbuilder-js/issues/158). + +## [10.0.0] - 2018-04-26 +- Added current indentation level as a parameter to the onData function when in callback mode. See [#125](https://github.com/oozcitak/xmlbuilder-js/issues/125). +- Added name of the current node and parent node to error messages where possible. See [#152](https://github.com/oozcitak/xmlbuilder-js/issues/152). This has the potential to break code depending on the content of error messages. +- Fixed an issue where objects created with Object.create(null) created an error. See [#176](https://github.com/oozcitak/xmlbuilder-js/issues/176). +- Added test builds for node.js v8 and v10. + +## [9.0.7] - 2018-02-09 +- Simplified regex used for validating encoding. + +## [9.0.4] - 2017-08-16 +- `spacebeforeslash` writer option accepts `true` as well as space char(s). + +## [9.0.3] - 2017-08-15 +- `spacebeforeslash` writer option can now be used with XML fragments. + +## [9.0.2] - 2017-08-15 +- Added the `spacebeforeslash` writer option to add a space character before closing tags of empty elements. See +[#157](https://github.com/oozcitak/xmlbuilder-js/issues/157). + +## [9.0.1] - 2017-06-19 +- Fixed character validity checks to work with node.js 4.0 and 5.0. See +[#161](https://github.com/oozcitak/xmlbuilder-js/issues/161). + +## [9.0.0] - 2017-05-05 +- Removed case conversion options. +- Removed support for node.js 4.0 and 5.0. Minimum required version is now 6.0. +- Fixed valid char filter to use XML 1.1 instead of 1.0. See +[#147](https://github.com/oozcitak/xmlbuilder-js/issues/147). +- Added options for negative indentation and suppressing pretty printing of text +nodes. See +[#145](https://github.com/oozcitak/xmlbuilder-js/issues/145). + +## [8.2.2] - 2016-04-08 +- Falsy values can now be used as a text node in callback mode. + +## [8.2.1] - 2016-04-07 +- Falsy values can now be used as a text node. See +[#117](https://github.com/oozcitak/xmlbuilder-js/issues/117). + +## [8.2.0] - 2016-04-01 +- Removed lodash dependency to keep the library small and simple. See +[#114](https://github.com/oozcitak/xmlbuilder-js/issues/114), +[#53](https://github.com/oozcitak/xmlbuilder-js/issues/53), +and [#43](https://github.com/oozcitak/xmlbuilder-js/issues/43). +- Added title case to name conversion options. + +## [8.1.0] - 2016-03-29 +- Added the callback option to the `begin` export function. When used with a +callback function, the XML document will be generated in chunks and each chunk +will be passed to the supplied function. In this mode, `begin` uses a different +code path and the builder should use much less memory since the entire XML tree +is not kept. There are a few drawbacks though. For example, traversing the document +tree or adding attributes to a node after it is written is not possible. It is +also not possible to remove nodes or attributes. + +``` js +var result = ''; + +builder.begin(function(chunk) { result += chunk; }) + .dec() + .ele('root') + .ele('xmlbuilder').up() + .end(); +``` + +- Replaced native `Object.assign` with `lodash.assign` to support old JS engines. See [#111](https://github.com/oozcitak/xmlbuilder-js/issues/111). + +## [8.0.0] - 2016-03-25 +- Added the `begin` export function. See the wiki for details. +- Added the ability to add comments and processing instructions before and after the root element. Added `commentBefore`, `commentAfter`, `instructionBefore` and `instructionAfter` functions for this purpose. +- Dropped support for old node.js releases. Minimum required node.js version is now 4.0. + +## [7.0.0] - 2016-03-21 +- Processing instructions are now created as regular nodes. This is a major breaking change if you are using processing instructions. Previously processing instructions were inserted before their parent node. After this change processing instructions are appended to the children of the parent node. Note that it is not currently possible to insert processing instructions before or after the root element. +```js +root.ele('node').ins('pi'); +// pre-v7 + +// v7 + +``` + +## [6.0.0] - 2016-03-20 +- Added custom XML writers. The default string conversion functions are now collected under the `XMLStringWriter` class which can be accessed by the `stringWriter(options)` function exported by the module. An `XMLStreamWriter` is also added which outputs the XML document to a writable stream. A stream writer can be created by calling the `streamWriter(stream, options)` function exported by the module. Both classes are heavily customizable and the details are added to the wiki. It is also possible to write an XML writer from scratch and use it when calling `end()` on the XML document. + +## [5.0.1] - 2016-03-08 +- Moved require statements for text case conversion to the top of files to reduce lazy requires. + +## [5.0.0] - 2016-03-05 +- Added text case option for element names and attribute names. Valid cases are `lower`, `upper`, `camel`, `kebab` and `snake`. +- Attribute and element values are escaped according to the [Canonical XML 1.0 specification](http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping). See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54) and [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86). +- Added the `allowEmpty` option to `end()`. When this option is set, empty elements are not self-closed. +- Added support for [nested CDATA](https://en.wikipedia.org/wiki/CDATA#Nesting). The triad `]]>` in CDATA is now automatically replaced with `]]]]>`. + +## [4.2.1] - 2016-01-15 +- Updated lodash dependency to 4.0.0. + +## [4.2.0] - 2015-12-16 +- Added the `noDoubleEncoding` option to `create()` to control whether existing html entities are encoded. + +## [4.1.0] - 2015-11-11 +- Added the `separateArrayItems` option to `create()` to control how arrays are handled when converting from objects. e.g. + +```js +root.ele({ number: [ "one", "two" ]}); +// with separateArrayItems: true + + + + +// with separateArrayItems: false +one +two +``` + +## [4.0.0] - 2015-11-01 +- Removed the `#list` decorator. Array items are now created as child nodes by default. +- Fixed a bug where the XML encoding string was checked partially. + +## [3.1.0] - 2015-09-19 +- `#list` decorator ignores empty arrays. + +## [3.0.0] - 2015-09-10 +- Allow `\r`, `\n` and `\t` in attribute values without escaping. See [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86). + +## [2.6.5] - 2015-09-09 +- Use native `isArray` instead of lodash. +- Indentation of processing instructions are set to the parent element's. + +## [2.6.4] - 2015-05-27 +- Updated lodash dependency to 3.5.0. + +## [2.6.3] - 2015-05-27 +- Bumped version because previous release was not published on npm. + +## [2.6.2] - 2015-03-10 +- Updated lodash dependency to 3.5.0. + +## [2.6.1] - 2015-02-20 +- Updated lodash dependency to 3.3.0. + +## [2.6.0] - 2015-02-20 +- Fixed a bug where the `XMLNode` constructor overwrote the super class parent. +- Removed document property from cloned nodes. +- Switched to mocha.js for testing. + +## [2.5.2] - 2015-02-16 +- Updated lodash dependency to 3.2.0. + +## [2.5.1] - 2015-02-09 +- Updated lodash dependency to 3.1.0. +- Support all node >= 0.8. + +## [2.5.0] - 2015-00-03 +- Updated lodash dependency to 3.0.0. + +## [2.4.6] - 2015-01-26 +- Show more information from attribute creation with null values. +- Added iojs as an engine. +- Self close elements with empty text. + +## [2.4.5] - 2014-11-15 +- Fixed prepublish script to run on windows. +- Fixed bug in XMLStringifier where an undefined value was used while reporting an invalid encoding value. +- Moved require statements to the top of files to reduce lazy requires. See [#62](https://github.com/oozcitak/xmlbuilder-js/issues/62). + +## [2.4.4] - 2014-09-08 +- Added the `offset` option to `toString()` for use in XML fragments. + +## [2.4.3] - 2014-08-13 +- Corrected license in package description. + +## [2.4.2] - 2014-08-13 +- Dropped performance test and memwatch dependency. + +## [2.4.1] - 2014-08-12 +- Fixed a bug where empty indent string was omitted when pretty printing. See [#59](https://github.com/oozcitak/xmlbuilder-js/issues/59). + +## [2.4.0] - 2014-08-04 +- Correct cases of pubID and sysID. +- Use single lodash instead of separate npm modules. See [#53](https://github.com/oozcitak/xmlbuilder-js/issues/53). +- Escape according to Canonical XML 1.0. See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54). + +## [2.3.0] - 2014-07-17 +- Convert objects to JS primitives while sanitizing user input. +- Object builder preserves items with null values. See [#44](https://github.com/oozcitak/xmlbuilder-js/issues/44). +- Use modularized lodash functions to cut down dependencies. +- Process empty objects when converting from objects so that we don't throw on empty child objects. + +## [2.2.1] - 2014-04-04 +- Bumped version because previous release was not published on npm. + +## [2.2.0] - 2014-04-04 +- Switch to lodash from underscore. +- Removed legacy `ext` option from `create()`. +- Drop old node versions: 0.4, 0.5, 0.6. 0.8 is the minimum requirement from now on. + +## [2.1.0] - 2013-12-30 +- Removed duplicate null checks from constructors. +- Fixed node count in performance test. +- Added option for skipping null attribute values. See [#26](https://github.com/oozcitak/xmlbuilder-js/issues/26). +- Allow multiple values in `att()` and `ins()`. +- Added ability to run individual performance tests. +- Added flag for ignoring decorator strings. + +## [2.0.1] - 2013-12-24 +- Removed performance tests from npm package. + +## [2.0.0] - 2013-12-24 +- Combined loops for speed up. +- Added support for the DTD and XML declaration. +- `clone` includes attributes. +- Added performance tests. +- Evaluate attribute value if function. +- Evaluate instruction value if function. + +## [1.1.2] - 2013-12-11 +- Changed processing instruction decorator to `?`. + +## [1.1.1] - 2013-12-11 +- Added processing instructions to JS object conversion. + +## [1.1.0] - 2013-12-10 +- Added license to package. +- `create()` and `element()` accept JS object to fully build the document. +- Added `nod()` and `n()` aliases for `node()`. +- Renamed `convertAttChar` decorator to `convertAttKey`. +- Ignore empty decorator strings when converting JS objects. + +## [1.0.2] - 2013-11-27 +- Removed temp file which was accidentally included in the package. + +## [1.0.1] - 2013-11-27 +- Custom stringify functions affect current instance only. + +## [1.0.0] - 2013-11-27 +- Added processing instructions. +- Added stringify functions to sanitize and convert input values. +- Added option for headless XML documents. +- Added vows tests. +- Removed Makefile. Using npm publish scripts instead. +- Removed the `begin()` function. `create()` begins the document by creating the root node. + +## [0.4.3] - 2013-11-08 +- Added option to include surrogate pairs in XML content. See [#29](https://github.com/oozcitak/xmlbuilder-js/issues/29). +- Fixed empty value string representation in pretty mode. +- Added pre and postpublish scripts to package.json. +- Filtered out prototype properties when appending attributes. See [#31](https://github.com/oozcitak/xmlbuilder-js/issues/31). + +## [0.4.2] - 2012-09-14 +- Removed README.md from `.npmignore`. + +## [0.4.1] - 2012-08-31 +- Removed `begin()` calls in favor of `XMLBuilder` constructor. +- Added the `end()` function. `end()` is a convenience over `doc().toString()`. + +## [0.4.0] - 2012-08-31 +- Added arguments to `XMLBuilder` constructor to allow the name of the root element and XML prolog to be defined in one line. +- Soft deprecated `begin()`. + +## [0.3.11] - 2012-08-13 +- Package keywords are fixed to be an array of values. + +## [0.3.10] - 2012-08-13 +- Brought back npm package contents which were lost due to incorrect configuration of `package.json` in previous releases. + +## [0.3.3] - 2012-07-27 +- Implemented `importXMLBuilder()`. + +## [0.3.2] - 2012-07-20 +- Fixed a duplicated escaping problem on `element()`. +- Fixed a problem with text node creation from empty string. +- Calling `root()` on the document element returns the root element. +- `XMLBuilder` no longer extends `XMLFragment`. + +## [0.3.1] - 2011-11-28 +- Added guards for document element so that nodes cannot be inserted at document level. + +## [0.3.0] - 2011-11-28 +- Added `doc()` to return the document element. + +## [0.2.2] - 2011-11-28 +- Prevent code relying on `up()`'s older behavior to break. + +## [0.2.1] - 2011-11-28 +- Added the `root()` function. + +## [0.2.0] - 2011-11-21 +- Added Travis-CI integration. +- Added coffee-script dependency. +- Added insert, traversal and delete functions. + +## [0.1.7] - 2011-10-25 +- No changes. Accidental release. + +## [0.1.6] - 2011-10-25 +- Corrected `package.json` bugs link to `url` from `web`. + +## [0.1.5] - 2011-08-08 +- Added missing npm package contents. + +## [0.1.4] - 2011-07-29 +- Text-only nodes are no longer indented. +- Added documentation for multiple instances. + +## [0.1.3] - 2011-07-27 +- Exported the `create()` function to return a new instance. This allows multiple builder instances to be constructed. +- Fixed `u()` function so that it now correctly calls `up()`. +- Fixed typo in `element()` so that `attributes` and `text` can be passed interchangeably. + +## [0.1.2] - 2011-06-03 +- `ele()` accepts element text. +- `attributes()` now overrides existing attributes if passed the same attribute name. + +## [0.1.1] - 2011-05-19 +- Added the raw output option. +- Removed most validity checks. + +## [0.1.0] - 2011-04-27 +- `text()` and `cdata()` now return parent element. +- Attribute values are escaped. + +## [0.0.7] - 2011-04-23 +- Coerced text values to string. + +## [0.0.6] - 2011-02-23 +- Added support for XML comments. +- Text nodes are checked against CharData. + +## [0.0.5] - 2010-12-31 +- Corrected the name of the main npm module in `package.json`. + +## [0.0.4] - 2010-12-28 +- Added `.npmignore`. + +## [0.0.3] - 2010-12-27 +- root element is now constructed in `begin()`. +- moved prolog to `begin()`. +- Added the ability to have CDATA in element text. +- Removed unused prolog aliases. +- Removed `builder()` function from main module. +- Added the name of the main npm module in `package.json`. + +## [0.0.2] - 2010-11-03 +- `element()` expands nested arrays. +- Added pretty printing. +- Added the `up()`, `build()` and `prolog()` functions. +- Added readme. + +## 0.0.1 - 2010-11-02 +- Initial release + +[11.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.1...v11.0.0 +[10.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.1.0...v10.1.1 +[10.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v10.0.0...v10.1.0 +[10.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.7...v10.0.0 +[9.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.4...v9.0.7 +[9.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.3...v9.0.4 +[9.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.2...v9.0.3 +[9.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.1...v9.0.2 +[9.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.0...v9.0.1 +[9.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.2...v9.0.0 +[8.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.1...v8.2.2 +[8.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.0...v8.2.1 +[8.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.1.0...v8.2.0 +[8.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.0.0...v8.1.0 +[8.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v7.0.0...v8.0.0 +[7.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v6.0.0...v7.0.0 +[6.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.1...v6.0.0 +[5.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.0...v5.0.1 +[5.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.1...v5.0.0 +[4.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.0...v4.2.1 +[4.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.1.0...v4.2.0 +[4.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.0.0...v4.1.0 +[4.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.1.0...v4.0.0 +[3.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.0.0...v3.1.0 +[3.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.5...v3.0.0 +[2.6.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.4...v2.6.5 +[2.6.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.3...v2.6.4 +[2.6.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.2...v2.6.3 +[2.6.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.1...v2.6.2 +[2.6.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.0...v2.6.1 +[2.6.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.2...v2.6.0 +[2.5.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.1...v2.5.2 +[2.5.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.0...v2.5.1 +[2.5.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.6...v2.5.0 +[2.4.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.5...v2.4.6 +[2.4.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.4...v2.4.5 +[2.4.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.3...v2.4.4 +[2.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.2...v2.4.3 +[2.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.1...v2.4.2 +[2.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.0...v2.4.1 +[2.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.3.0...v2.4.0 +[2.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.1...v2.3.0 +[2.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.1.0...v2.2.0 +[2.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.1...v2.1.0 +[2.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.2...v2.0.0 +[1.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.1...v1.1.2 +[1.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.0...v1.1.1 +[1.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.2...v1.1.0 +[1.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.3...v1.0.0 +[0.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.2...v0.4.3 +[0.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.1...v0.4.2 +[0.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.0...v0.4.1 +[0.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.11...v0.4.0 +[0.3.11]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.10...v0.3.11 +[0.3.10]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.3...v0.3.10 +[0.3.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.2...v0.3.3 +[0.3.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.1...v0.3.2 +[0.3.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.0...v0.3.1 +[0.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.2...v0.3.0 +[0.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.1...v0.2.2 +[0.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.0...v0.2.1 +[0.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.7...v0.2.0 +[0.1.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.6...v0.1.7 +[0.1.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.5...v0.1.6 +[0.1.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.4...v0.1.5 +[0.1.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.3...v0.1.4 +[0.1.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.2...v0.1.3 +[0.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.1...v0.1.2 +[0.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.0...v0.1.1 +[0.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.7...v0.1.0 +[0.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.6...v0.0.7 +[0.0.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.5...v0.0.6 +[0.0.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.4...v0.0.5 +[0.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.3...v0.0.4 +[0.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.2...v0.0.3 +[0.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.1...v0.0.2 + diff --git a/node_modules/xmlbuilder/LICENSE b/node_modules/xmlbuilder/LICENSE new file mode 100644 index 0000000..e7cbac9 --- /dev/null +++ b/node_modules/xmlbuilder/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Ozgur Ozcitak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/xmlbuilder/README.md b/node_modules/xmlbuilder/README.md new file mode 100644 index 0000000..efcb4b1 --- /dev/null +++ b/node_modules/xmlbuilder/README.md @@ -0,0 +1,86 @@ +# xmlbuilder-js + +An XML builder for [node.js](https://nodejs.org/) similar to +[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder). + +[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT) +[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) +[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder) + +[![Travis Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js) +[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/bf7odb20hj77isry?svg=true)](https://ci.appveyor.com/project/oozcitak/xmlbuilder-js) +[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js) +[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js) + +### Installation: + +``` sh +npm install xmlbuilder +``` + +### Usage: + +``` js +var builder = require('xmlbuilder'); +var xml = builder.create('root') + .ele('xmlbuilder') + .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git') + .end({ pretty: true}); + +console.log(xml); +``` + +will result in: + +``` xml + + + + git://github.com/oozcitak/xmlbuilder-js.git + + +``` + +It is also possible to convert objects into nodes: + +``` js +builder.create({ + root: { + xmlbuilder: { + repo: { + '@type': 'git', // attributes start with @ + '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node + } + } + } +}); +``` + +If you need to do some processing: + +``` js +var root = builder.create('squares'); +root.com('f(x) = x^2'); +for(var i = 1; i <= 5; i++) +{ + var item = root.ele('data'); + item.att('x', i); + item.att('y', i * i); +} +``` + +This will result in: + +``` xml + + + + + + + + + +``` + +See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples. diff --git a/node_modules/xmlbuilder/appveyor.yml b/node_modules/xmlbuilder/appveyor.yml new file mode 100644 index 0000000..39a2628 --- /dev/null +++ b/node_modules/xmlbuilder/appveyor.yml @@ -0,0 +1,20 @@ +environment: + matrix: + - nodejs_version: "4" + - nodejs_version: "5" + - nodejs_version: "6" + - nodejs_version: "8" + - nodejs_version: "10" + - nodejs_version: "" # latest + +install: + - ps: "Install-Product node $env:nodejs_version" + - "npm install" + +test_script: + - "node --version" + - "npm --version" + - "npm test" + +build: off + diff --git a/node_modules/xmlbuilder/lib/Derivation.js b/node_modules/xmlbuilder/lib/Derivation.js new file mode 100644 index 0000000..2abfd08 --- /dev/null +++ b/node_modules/xmlbuilder/lib/Derivation.js @@ -0,0 +1,10 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + module.exports = { + Restriction: 1, + Extension: 2, + Union: 4, + List: 8 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/DocumentPosition.js b/node_modules/xmlbuilder/lib/DocumentPosition.js new file mode 100644 index 0000000..1cbd21c --- /dev/null +++ b/node_modules/xmlbuilder/lib/DocumentPosition.js @@ -0,0 +1,12 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + module.exports = { + Disconnected: 1, + Preceding: 2, + Following: 4, + Contains: 8, + ContainedBy: 16, + ImplementationSpecific: 32 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/NodeType.js b/node_modules/xmlbuilder/lib/NodeType.js new file mode 100644 index 0000000..4c200e3 --- /dev/null +++ b/node_modules/xmlbuilder/lib/NodeType.js @@ -0,0 +1,23 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + module.exports = { + Element: 1, + Attribute: 2, + Text: 3, + CData: 4, + EntityReference: 5, + EntityDeclaration: 6, + ProcessingInstruction: 7, + Comment: 8, + Document: 9, + DocType: 10, + DocumentFragment: 11, + NotationDeclaration: 12, + Declaration: 201, + Raw: 202, + AttributeDeclaration: 203, + ElementDeclaration: 204, + Dummy: 205 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/OperationType.js b/node_modules/xmlbuilder/lib/OperationType.js new file mode 100644 index 0000000..29428f6 --- /dev/null +++ b/node_modules/xmlbuilder/lib/OperationType.js @@ -0,0 +1,11 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + module.exports = { + Clones: 1, + Imported: 2, + Deleted: 3, + Renamed: 4, + Adopted: 5 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/Utility.js b/node_modules/xmlbuilder/lib/Utility.js new file mode 100644 index 0000000..1d42cfd --- /dev/null +++ b/node_modules/xmlbuilder/lib/Utility.js @@ -0,0 +1,83 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, + slice = [].slice, + hasProp = {}.hasOwnProperty; + + assign = function() { + var i, key, len, source, sources, target; + target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : []; + if (isFunction(Object.assign)) { + Object.assign.apply(null, arguments); + } else { + for (i = 0, len = sources.length; i < len; i++) { + source = sources[i]; + if (source != null) { + for (key in source) { + if (!hasProp.call(source, key)) continue; + target[key] = source[key]; + } + } + } + } + return target; + }; + + isFunction = function(val) { + return !!val && Object.prototype.toString.call(val) === '[object Function]'; + }; + + isObject = function(val) { + var ref; + return !!val && ((ref = typeof val) === 'function' || ref === 'object'); + }; + + isArray = function(val) { + if (isFunction(Array.isArray)) { + return Array.isArray(val); + } else { + return Object.prototype.toString.call(val) === '[object Array]'; + } + }; + + isEmpty = function(val) { + var key; + if (isArray(val)) { + return !val.length; + } else { + for (key in val) { + if (!hasProp.call(val, key)) continue; + return false; + } + return true; + } + }; + + isPlainObject = function(val) { + var ctor, proto; + return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object)); + }; + + getValue = function(obj) { + if (isFunction(obj.valueOf)) { + return obj.valueOf(); + } else { + return obj; + } + }; + + module.exports.assign = assign; + + module.exports.isFunction = isFunction; + + module.exports.isObject = isObject; + + module.exports.isArray = isArray; + + module.exports.isEmpty = isEmpty; + + module.exports.isPlainObject = isPlainObject; + + module.exports.getValue = getValue; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/WriterState.js b/node_modules/xmlbuilder/lib/WriterState.js new file mode 100644 index 0000000..0923eec --- /dev/null +++ b/node_modules/xmlbuilder/lib/WriterState.js @@ -0,0 +1,10 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + module.exports = { + None: 0, + OpenTag: 1, + InsideTag: 2, + CloseTag: 3 + }; + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLAttribute.js b/node_modules/xmlbuilder/lib/XMLAttribute.js new file mode 100644 index 0000000..c208566 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLAttribute.js @@ -0,0 +1,108 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLAttribute, XMLNode; + + NodeType = require('./NodeType'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLAttribute = (function() { + function XMLAttribute(parent, name, value) { + this.parent = parent; + if (this.parent) { + this.options = this.parent.options; + this.stringify = this.parent.stringify; + } + if (name == null) { + throw new Error("Missing attribute name. " + this.debugInfo(name)); + } + this.name = this.stringify.name(name); + this.value = this.stringify.attValue(value); + this.type = NodeType.Attribute; + this.isId = false; + this.schemaTypeInfo = null; + } + + Object.defineProperty(XMLAttribute.prototype, 'nodeType', { + get: function() { + return this.type; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'ownerElement', { + get: function() { + return this.parent; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'textContent', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'namespaceURI', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'prefix', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'localName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLAttribute.prototype, 'specified', { + get: function() { + return true; + } + }); + + XMLAttribute.prototype.clone = function() { + return Object.create(this); + }; + + XMLAttribute.prototype.toString = function(options) { + return this.options.writer.attribute(this, this.options.writer.filterOptions(options)); + }; + + XMLAttribute.prototype.debugInfo = function(name) { + name = name || this.name; + if (name == null) { + return "parent: <" + this.parent.name + ">"; + } else { + return "attribute: {" + name + "}, parent: <" + this.parent.name + ">"; + } + }; + + XMLAttribute.prototype.isEqualNode = function(node) { + if (node.namespaceURI !== this.namespaceURI) { + return false; + } + if (node.prefix !== this.prefix) { + return false; + } + if (node.localName !== this.localName) { + return false; + } + if (node.value !== this.value) { + return false; + } + return true; + }; + + return XMLAttribute; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLCData.js b/node_modules/xmlbuilder/lib/XMLCData.js new file mode 100644 index 0000000..c732ec5 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLCData.js @@ -0,0 +1,36 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLCData, XMLCharacterData, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType = require('./NodeType'); + + XMLCharacterData = require('./XMLCharacterData'); + + module.exports = XMLCData = (function(superClass) { + extend(XMLCData, superClass); + + function XMLCData(parent, text) { + XMLCData.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing CDATA text. " + this.debugInfo()); + } + this.name = "#cdata-section"; + this.type = NodeType.CData; + this.value = this.stringify.cdata(text); + } + + XMLCData.prototype.clone = function() { + return Object.create(this); + }; + + XMLCData.prototype.toString = function(options) { + return this.options.writer.cdata(this, this.options.writer.filterOptions(options)); + }; + + return XMLCData; + + })(XMLCharacterData); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLCharacterData.js b/node_modules/xmlbuilder/lib/XMLCharacterData.js new file mode 100644 index 0000000..c007a18 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLCharacterData.js @@ -0,0 +1,79 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLCharacterData, XMLNode, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode = require('./XMLNode'); + + module.exports = XMLCharacterData = (function(superClass) { + extend(XMLCharacterData, superClass); + + function XMLCharacterData(parent) { + XMLCharacterData.__super__.constructor.call(this, parent); + this.value = ''; + } + + Object.defineProperty(XMLCharacterData.prototype, 'data', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + Object.defineProperty(XMLCharacterData.prototype, 'length', { + get: function() { + return this.value.length; + } + }); + + Object.defineProperty(XMLCharacterData.prototype, 'textContent', { + get: function() { + return this.value; + }, + set: function(value) { + return this.value = value || ''; + } + }); + + XMLCharacterData.prototype.clone = function() { + return Object.create(this); + }; + + XMLCharacterData.prototype.substringData = function(offset, count) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.appendData = function(arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.insertData = function(offset, arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.deleteData = function(offset, count) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.replaceData = function(offset, count, arg) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLCharacterData.prototype.isEqualNode = function(node) { + if (!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.data !== this.data) { + return false; + } + return true; + }; + + return XMLCharacterData; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLComment.js b/node_modules/xmlbuilder/lib/XMLComment.js new file mode 100644 index 0000000..8287216 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLComment.js @@ -0,0 +1,36 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLCharacterData, XMLComment, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType = require('./NodeType'); + + XMLCharacterData = require('./XMLCharacterData'); + + module.exports = XMLComment = (function(superClass) { + extend(XMLComment, superClass); + + function XMLComment(parent, text) { + XMLComment.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing comment text. " + this.debugInfo()); + } + this.name = "#comment"; + this.type = NodeType.Comment; + this.value = this.stringify.comment(text); + } + + XMLComment.prototype.clone = function() { + return Object.create(this); + }; + + XMLComment.prototype.toString = function(options) { + return this.options.writer.comment(this, this.options.writer.filterOptions(options)); + }; + + return XMLComment; + + })(XMLCharacterData); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js b/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js new file mode 100644 index 0000000..b331b86 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMConfiguration.js @@ -0,0 +1,64 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList; + + XMLDOMErrorHandler = require('./XMLDOMErrorHandler'); + + XMLDOMStringList = require('./XMLDOMStringList'); + + module.exports = XMLDOMConfiguration = (function() { + function XMLDOMConfiguration() { + var clonedSelf; + this.defaultParams = { + "canonical-form": false, + "cdata-sections": false, + "comments": false, + "datatype-normalization": false, + "element-content-whitespace": true, + "entities": true, + "error-handler": new XMLDOMErrorHandler(), + "infoset": true, + "validate-if-schema": false, + "namespaces": true, + "namespace-declarations": true, + "normalize-characters": false, + "schema-location": '', + "schema-type": '', + "split-cdata-sections": true, + "validate": false, + "well-formed": true + }; + this.params = clonedSelf = Object.create(this.defaultParams); + } + + Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', { + get: function() { + return new XMLDOMStringList(Object.keys(this.defaultParams)); + } + }); + + XMLDOMConfiguration.prototype.getParameter = function(name) { + if (this.params.hasOwnProperty(name)) { + return this.params[name]; + } else { + return null; + } + }; + + XMLDOMConfiguration.prototype.canSetParameter = function(name, value) { + return true; + }; + + XMLDOMConfiguration.prototype.setParameter = function(name, value) { + if (value != null) { + return this.params[name] = value; + } else { + return delete this.params[name]; + } + }; + + return XMLDOMConfiguration; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js b/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js new file mode 100644 index 0000000..4a0446c --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js @@ -0,0 +1,16 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMErrorHandler; + + module.exports = XMLDOMErrorHandler = (function() { + function XMLDOMErrorHandler() {} + + XMLDOMErrorHandler.prototype.handleError = function(error) { + throw new Error(error); + }; + + return XMLDOMErrorHandler; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMImplementation.js b/node_modules/xmlbuilder/lib/XMLDOMImplementation.js new file mode 100644 index 0000000..4f9f9db --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMImplementation.js @@ -0,0 +1,32 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMImplementation; + + module.exports = XMLDOMImplementation = (function() { + function XMLDOMImplementation() {} + + XMLDOMImplementation.prototype.hasFeature = function(feature, version) { + return true; + }; + + XMLDOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) { + throw new Error("This DOM method is not implemented."); + }; + + XMLDOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) { + throw new Error("This DOM method is not implemented."); + }; + + XMLDOMImplementation.prototype.createHTMLDocument = function(title) { + throw new Error("This DOM method is not implemented."); + }; + + XMLDOMImplementation.prototype.getFeature = function(feature, version) { + throw new Error("This DOM method is not implemented."); + }; + + return XMLDOMImplementation; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDOMStringList.js b/node_modules/xmlbuilder/lib/XMLDOMStringList.js new file mode 100644 index 0000000..ba558c5 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDOMStringList.js @@ -0,0 +1,28 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLDOMStringList; + + module.exports = XMLDOMStringList = (function() { + function XMLDOMStringList(arr) { + this.arr = arr || []; + } + + Object.defineProperty(XMLDOMStringList.prototype, 'length', { + get: function() { + return this.arr.length; + } + }); + + XMLDOMStringList.prototype.item = function(index) { + return this.arr[index] || null; + }; + + XMLDOMStringList.prototype.contains = function(str) { + return this.arr.indexOf(str) !== -1; + }; + + return XMLDOMStringList; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDAttList.js b/node_modules/xmlbuilder/lib/XMLDTDAttList.js new file mode 100644 index 0000000..aca9dbd --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDAttList.js @@ -0,0 +1,55 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDTDAttList, XMLNode, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + module.exports = XMLDTDAttList = (function(superClass) { + extend(XMLDTDAttList, superClass); + + function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { + XMLDTDAttList.__super__.constructor.call(this, parent); + if (elementName == null) { + throw new Error("Missing DTD element name. " + this.debugInfo()); + } + if (attributeName == null) { + throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName)); + } + if (!attributeType) { + throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName)); + } + if (!defaultValueType) { + throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName)); + } + if (defaultValueType.indexOf('#') !== 0) { + defaultValueType = '#' + defaultValueType; + } + if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) { + throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName)); + } + if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) { + throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName)); + } + this.elementName = this.stringify.name(elementName); + this.type = NodeType.AttributeDeclaration; + this.attributeName = this.stringify.name(attributeName); + this.attributeType = this.stringify.dtdAttType(attributeType); + if (defaultValue) { + this.defaultValue = this.stringify.dtdAttDefault(defaultValue); + } + this.defaultValueType = defaultValueType; + } + + XMLDTDAttList.prototype.toString = function(options) { + return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDAttList; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDElement.js b/node_modules/xmlbuilder/lib/XMLDTDElement.js new file mode 100644 index 0000000..f8f1ae7 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDElement.js @@ -0,0 +1,38 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDTDElement, XMLNode, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + module.exports = XMLDTDElement = (function(superClass) { + extend(XMLDTDElement, superClass); + + function XMLDTDElement(parent, name, value) { + XMLDTDElement.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing DTD element name. " + this.debugInfo()); + } + if (!value) { + value = '(#PCDATA)'; + } + if (Array.isArray(value)) { + value = '(' + value.join(',') + ')'; + } + this.name = this.stringify.name(name); + this.type = NodeType.ElementDeclaration; + this.value = this.stringify.dtdElementValue(value); + } + + XMLDTDElement.prototype.toString = function(options) { + return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDElement; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDEntity.js b/node_modules/xmlbuilder/lib/XMLDTDEntity.js new file mode 100644 index 0000000..0a940d6 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDEntity.js @@ -0,0 +1,97 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDTDEntity, XMLNode, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isObject = require('./Utility').isObject; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + module.exports = XMLDTDEntity = (function(superClass) { + extend(XMLDTDEntity, superClass); + + function XMLDTDEntity(parent, pe, name, value) { + XMLDTDEntity.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing DTD entity name. " + this.debugInfo(name)); + } + if (value == null) { + throw new Error("Missing DTD entity value. " + this.debugInfo(name)); + } + this.pe = !!pe; + this.name = this.stringify.name(name); + this.type = NodeType.EntityDeclaration; + if (!isObject(value)) { + this.value = this.stringify.dtdEntityValue(value); + this.internal = true; + } else { + if (!value.pubID && !value.sysID) { + throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name)); + } + if (value.pubID && !value.sysID) { + throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name)); + } + this.internal = false; + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + if (value.nData != null) { + this.nData = this.stringify.dtdNData(value.nData); + } + if (this.pe && this.nData) { + throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name)); + } + } + } + + Object.defineProperty(XMLDTDEntity.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'notationName', { + get: function() { + return this.nData || null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'inputEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'xmlEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDTDEntity.prototype, 'xmlVersion', { + get: function() { + return null; + } + }); + + XMLDTDEntity.prototype.toString = function(options) { + return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDEntity; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDTDNotation.js b/node_modules/xmlbuilder/lib/XMLDTDNotation.js new file mode 100644 index 0000000..57a119d --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDTDNotation.js @@ -0,0 +1,52 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDTDNotation, XMLNode, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + module.exports = XMLDTDNotation = (function(superClass) { + extend(XMLDTDNotation, superClass); + + function XMLDTDNotation(parent, name, value) { + XMLDTDNotation.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing DTD notation name. " + this.debugInfo(name)); + } + if (!value.pubID && !value.sysID) { + throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name)); + } + this.name = this.stringify.name(name); + this.type = NodeType.NotationDeclaration; + if (value.pubID != null) { + this.pubID = this.stringify.dtdPubID(value.pubID); + } + if (value.sysID != null) { + this.sysID = this.stringify.dtdSysID(value.sysID); + } + } + + Object.defineProperty(XMLDTDNotation.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDTDNotation.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + XMLDTDNotation.prototype.toString = function(options) { + return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options)); + }; + + return XMLDTDNotation; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDeclaration.js b/node_modules/xmlbuilder/lib/XMLDeclaration.js new file mode 100644 index 0000000..d4f7f44 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDeclaration.js @@ -0,0 +1,43 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDeclaration, XMLNode, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isObject = require('./Utility').isObject; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + module.exports = XMLDeclaration = (function(superClass) { + extend(XMLDeclaration, superClass); + + function XMLDeclaration(parent, version, encoding, standalone) { + var ref; + XMLDeclaration.__super__.constructor.call(this, parent); + if (isObject(version)) { + ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone; + } + if (!version) { + version = '1.0'; + } + this.type = NodeType.Declaration; + this.version = this.stringify.xmlVersion(version); + if (encoding != null) { + this.encoding = this.stringify.xmlEncoding(encoding); + } + if (standalone != null) { + this.standalone = this.stringify.xmlStandalone(standalone); + } + } + + XMLDeclaration.prototype.toString = function(options) { + return this.options.writer.declaration(this, this.options.writer.filterOptions(options)); + }; + + return XMLDeclaration; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocType.js b/node_modules/xmlbuilder/lib/XMLDocType.js new file mode 100644 index 0000000..ef043f4 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocType.js @@ -0,0 +1,186 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNamedNodeMap, XMLNode, isObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isObject = require('./Utility').isObject; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + XMLDTDAttList = require('./XMLDTDAttList'); + + XMLDTDEntity = require('./XMLDTDEntity'); + + XMLDTDElement = require('./XMLDTDElement'); + + XMLDTDNotation = require('./XMLDTDNotation'); + + XMLNamedNodeMap = require('./XMLNamedNodeMap'); + + module.exports = XMLDocType = (function(superClass) { + extend(XMLDocType, superClass); + + function XMLDocType(parent, pubID, sysID) { + var child, i, len, ref, ref1, ref2; + XMLDocType.__super__.constructor.call(this, parent); + this.type = NodeType.DocType; + if (parent.children) { + ref = parent.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType.Element) { + this.name = child.name; + break; + } + } + } + this.documentObject = parent; + if (isObject(pubID)) { + ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID; + } + if (sysID == null) { + ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1]; + } + if (pubID != null) { + this.pubID = this.stringify.dtdPubID(pubID); + } + if (sysID != null) { + this.sysID = this.stringify.dtdSysID(sysID); + } + } + + Object.defineProperty(XMLDocType.prototype, 'entities', { + get: function() { + var child, i, len, nodes, ref; + nodes = {}; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if ((child.type === NodeType.EntityDeclaration) && !child.pe) { + nodes[child.name] = child; + } + } + return new XMLNamedNodeMap(nodes); + } + }); + + Object.defineProperty(XMLDocType.prototype, 'notations', { + get: function() { + var child, i, len, nodes, ref; + nodes = {}; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType.NotationDeclaration) { + nodes[child.name] = child; + } + } + return new XMLNamedNodeMap(nodes); + } + }); + + Object.defineProperty(XMLDocType.prototype, 'publicId', { + get: function() { + return this.pubID; + } + }); + + Object.defineProperty(XMLDocType.prototype, 'systemId', { + get: function() { + return this.sysID; + } + }); + + Object.defineProperty(XMLDocType.prototype, 'internalSubset', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + XMLDocType.prototype.element = function(name, value) { + var child; + child = new XMLDTDElement(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var child; + child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.entity = function(name, value) { + var child; + child = new XMLDTDEntity(this, false, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.pEntity = function(name, value) { + var child; + child = new XMLDTDEntity(this, true, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.notation = function(name, value) { + var child; + child = new XMLDTDNotation(this, name, value); + this.children.push(child); + return this; + }; + + XMLDocType.prototype.toString = function(options) { + return this.options.writer.docType(this, this.options.writer.filterOptions(options)); + }; + + XMLDocType.prototype.ele = function(name, value) { + return this.element(name, value); + }; + + XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); + }; + + XMLDocType.prototype.ent = function(name, value) { + return this.entity(name, value); + }; + + XMLDocType.prototype.pent = function(name, value) { + return this.pEntity(name, value); + }; + + XMLDocType.prototype.not = function(name, value) { + return this.notation(name, value); + }; + + XMLDocType.prototype.up = function() { + return this.root() || this.documentObject; + }; + + XMLDocType.prototype.isEqualNode = function(node) { + if (!XMLDocType.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.name !== this.name) { + return false; + } + if (node.publicId !== this.publicId) { + return false; + } + if (node.systemId !== this.systemId) { + return false; + } + return true; + }; + + return XMLDocType; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocument.js b/node_modules/xmlbuilder/lib/XMLDocument.js new file mode 100644 index 0000000..88df56c --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocument.js @@ -0,0 +1,242 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + isPlainObject = require('./Utility').isPlainObject; + + XMLDOMImplementation = require('./XMLDOMImplementation'); + + XMLDOMConfiguration = require('./XMLDOMConfiguration'); + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + XMLStringifier = require('./XMLStringifier'); + + XMLStringWriter = require('./XMLStringWriter'); + + module.exports = XMLDocument = (function(superClass) { + extend(XMLDocument, superClass); + + function XMLDocument(options) { + XMLDocument.__super__.constructor.call(this, null); + this.name = "#document"; + this.type = NodeType.Document; + this.documentURI = null; + this.domConfig = new XMLDOMConfiguration(); + options || (options = {}); + if (!options.writer) { + options.writer = new XMLStringWriter(); + } + this.options = options; + this.stringify = new XMLStringifier(options); + } + + Object.defineProperty(XMLDocument.prototype, 'implementation', { + value: new XMLDOMImplementation() + }); + + Object.defineProperty(XMLDocument.prototype, 'doctype', { + get: function() { + var child, i, len, ref; + ref = this.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + if (child.type === NodeType.DocType) { + return child; + } + } + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'documentElement', { + get: function() { + return this.rootObject || null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'inputEncoding', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'strictErrorChecking', { + get: function() { + return false; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlEncoding', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) { + return this.children[0].encoding; + } else { + return null; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlStandalone', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) { + return this.children[0].standalone === 'yes'; + } else { + return false; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'xmlVersion', { + get: function() { + if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) { + return this.children[0].version; + } else { + return "1.0"; + } + } + }); + + Object.defineProperty(XMLDocument.prototype, 'URL', { + get: function() { + return this.documentURI; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'origin', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'compatMode', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'characterSet', { + get: function() { + return null; + } + }); + + Object.defineProperty(XMLDocument.prototype, 'contentType', { + get: function() { + return null; + } + }); + + XMLDocument.prototype.end = function(writer) { + var writerOptions; + writerOptions = {}; + if (!writer) { + writer = this.options.writer; + } else if (isPlainObject(writer)) { + writerOptions = writer; + writer = this.options.writer; + } + return writer.document(this, writer.filterOptions(writerOptions)); + }; + + XMLDocument.prototype.toString = function(options) { + return this.options.writer.document(this, this.options.writer.filterOptions(options)); + }; + + XMLDocument.prototype.createElement = function(tagName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createDocumentFragment = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createTextNode = function(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createComment = function(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createCDATASection = function(data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createProcessingInstruction = function(target, data) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createAttribute = function(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createEntityReference = function(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementsByTagName = function(tagname) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.importNode = function(importedNode, deep) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementById = function(elementId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.adoptNode = function(source) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.normalizeDocument = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.getElementsByClassName = function(classNames) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createEvent = function(eventInterface) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createRange = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + return XMLDocument; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocumentCB.js b/node_modules/xmlbuilder/lib/XMLDocumentCB.js new file mode 100644 index 0000000..ca1aa1c --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocumentCB.js @@ -0,0 +1,528 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref, + hasProp = {}.hasOwnProperty; + + ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue; + + NodeType = require('./NodeType'); + + XMLDocument = require('./XMLDocument'); + + XMLElement = require('./XMLElement'); + + XMLCData = require('./XMLCData'); + + XMLComment = require('./XMLComment'); + + XMLRaw = require('./XMLRaw'); + + XMLText = require('./XMLText'); + + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + + XMLDeclaration = require('./XMLDeclaration'); + + XMLDocType = require('./XMLDocType'); + + XMLDTDAttList = require('./XMLDTDAttList'); + + XMLDTDEntity = require('./XMLDTDEntity'); + + XMLDTDElement = require('./XMLDTDElement'); + + XMLDTDNotation = require('./XMLDTDNotation'); + + XMLAttribute = require('./XMLAttribute'); + + XMLStringifier = require('./XMLStringifier'); + + XMLStringWriter = require('./XMLStringWriter'); + + WriterState = require('./WriterState'); + + module.exports = XMLDocumentCB = (function() { + function XMLDocumentCB(options, onData, onEnd) { + var writerOptions; + this.name = "?xml"; + this.type = NodeType.Document; + options || (options = {}); + writerOptions = {}; + if (!options.writer) { + options.writer = new XMLStringWriter(); + } else if (isPlainObject(options.writer)) { + writerOptions = options.writer; + options.writer = new XMLStringWriter(); + } + this.options = options; + this.writer = options.writer; + this.writerOptions = this.writer.filterOptions(writerOptions); + this.stringify = new XMLStringifier(options); + this.onDataCallback = onData || function() {}; + this.onEndCallback = onEnd || function() {}; + this.currentNode = null; + this.currentLevel = -1; + this.openTags = {}; + this.documentStarted = false; + this.documentCompleted = false; + this.root = null; + } + + XMLDocumentCB.prototype.createChildNode = function(node) { + var att, attName, attributes, child, i, len, ref1, ref2; + switch (node.type) { + case NodeType.CData: + this.cdata(node.value); + break; + case NodeType.Comment: + this.comment(node.value); + break; + case NodeType.Element: + attributes = {}; + ref1 = node.attribs; + for (attName in ref1) { + if (!hasProp.call(ref1, attName)) continue; + att = ref1[attName]; + attributes[attName] = att.value; + } + this.node(node.name, attributes); + break; + case NodeType.Dummy: + this.dummy(); + break; + case NodeType.Raw: + this.raw(node.value); + break; + case NodeType.Text: + this.text(node.value); + break; + case NodeType.ProcessingInstruction: + this.instruction(node.target, node.value); + break; + default: + throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name); + } + ref2 = node.children; + for (i = 0, len = ref2.length; i < len; i++) { + child = ref2[i]; + this.createChildNode(child); + if (child.type === NodeType.Element) { + this.up(); + } + } + return this; + }; + + XMLDocumentCB.prototype.dummy = function() { + return this; + }; + + XMLDocumentCB.prototype.node = function(name, attributes, text) { + var ref1; + if (name == null) { + throw new Error("Missing node name."); + } + if (this.root && this.currentLevel === -1) { + throw new Error("Document can only have one root node. " + this.debugInfo(name)); + } + this.openCurrent(); + name = getValue(name); + if (attributes == null) { + attributes = {}; + } + attributes = getValue(attributes); + if (!isObject(attributes)) { + ref1 = [attributes, text], text = ref1[0], attributes = ref1[1]; + } + this.currentNode = new XMLElement(this, name, attributes); + this.currentNode.children = false; + this.currentLevel++; + this.openTags[this.currentLevel] = this.currentNode; + if (text != null) { + this.text(text); + } + return this; + }; + + XMLDocumentCB.prototype.element = function(name, attributes, text) { + var child, i, len, oldValidationFlag, ref1, root; + if (this.currentNode && this.currentNode.type === NodeType.DocType) { + this.dtdElement.apply(this, arguments); + } else { + if (Array.isArray(name) || isObject(name) || isFunction(name)) { + oldValidationFlag = this.options.noValidation; + this.options.noValidation = true; + root = new XMLDocument(this.options).element('TEMP_ROOT'); + root.element(name); + this.options.noValidation = oldValidationFlag; + ref1 = root.children; + for (i = 0, len = ref1.length; i < len; i++) { + child = ref1[i]; + this.createChildNode(child); + if (child.type === NodeType.Element) { + this.up(); + } + } + } else { + this.node(name, attributes, text); + } + } + return this; + }; + + XMLDocumentCB.prototype.attribute = function(name, value) { + var attName, attValue; + if (!this.currentNode || this.currentNode.children) { + throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name)); + } + if (name != null) { + name = getValue(name); + } + if (isObject(name)) { + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (this.options.keepNullAttributes && (value == null)) { + this.currentNode.attribs[name] = new XMLAttribute(this, name, ""); + } else if (value != null) { + this.currentNode.attribs[name] = new XMLAttribute(this, name, value); + } + } + return this; + }; + + XMLDocumentCB.prototype.text = function(value) { + var node; + this.openCurrent(); + node = new XMLText(this, value); + this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.cdata = function(value) { + var node; + this.openCurrent(); + node = new XMLCData(this, value); + this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.comment = function(value) { + var node; + this.openCurrent(); + node = new XMLComment(this, value); + this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.raw = function(value) { + var node; + this.openCurrent(); + node = new XMLRaw(this, value); + this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.instruction = function(target, value) { + var i, insTarget, insValue, len, node; + this.openCurrent(); + if (target != null) { + target = getValue(target); + } + if (value != null) { + value = getValue(value); + } + if (Array.isArray(target)) { + for (i = 0, len = target.length; i < len; i++) { + insTarget = target[i]; + this.instruction(insTarget); + } + } else if (isObject(target)) { + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + node = new XMLProcessingInstruction(this, target, value); + this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + } + return this; + }; + + XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) { + var node; + this.openCurrent(); + if (this.documentStarted) { + throw new Error("declaration() must be the first node."); + } + node = new XMLDeclaration(this, version, encoding, standalone); + this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) { + this.openCurrent(); + if (root == null) { + throw new Error("Missing root node name."); + } + if (this.root) { + throw new Error("dtd() must come before the root node."); + } + this.currentNode = new XMLDocType(this, pubID, sysID); + this.currentNode.rootNodeName = root; + this.currentNode.children = false; + this.currentLevel++; + this.openTags[this.currentLevel] = this.currentNode; + return this; + }; + + XMLDocumentCB.prototype.dtdElement = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDElement(this, name, value); + this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { + var node; + this.openCurrent(); + node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue); + this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.entity = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDEntity(this, false, name, value); + this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.pEntity = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDEntity(this, true, name, value); + this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.notation = function(name, value) { + var node; + this.openCurrent(); + node = new XMLDTDNotation(this, name, value); + this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1); + return this; + }; + + XMLDocumentCB.prototype.up = function() { + if (this.currentLevel < 0) { + throw new Error("The document node has no parent."); + } + if (this.currentNode) { + if (this.currentNode.children) { + this.closeNode(this.currentNode); + } else { + this.openNode(this.currentNode); + } + this.currentNode = null; + } else { + this.closeNode(this.openTags[this.currentLevel]); + } + delete this.openTags[this.currentLevel]; + this.currentLevel--; + return this; + }; + + XMLDocumentCB.prototype.end = function() { + while (this.currentLevel >= 0) { + this.up(); + } + return this.onEnd(); + }; + + XMLDocumentCB.prototype.openCurrent = function() { + if (this.currentNode) { + this.currentNode.children = true; + return this.openNode(this.currentNode); + } + }; + + XMLDocumentCB.prototype.openNode = function(node) { + var att, chunk, name, ref1; + if (!node.isOpen) { + if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) { + this.root = node; + } + chunk = ''; + if (node.type === NodeType.Element) { + this.writerOptions.state = WriterState.OpenTag; + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '<' + node.name; + ref1 = node.attribs; + for (name in ref1) { + if (!hasProp.call(ref1, name)) continue; + att = ref1[name]; + chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel); + } + chunk += (node.children ? '>' : '/>') + this.writer.endline(node, this.writerOptions, this.currentLevel); + this.writerOptions.state = WriterState.InsideTag; + } else { + this.writerOptions.state = WriterState.OpenTag; + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ''; + } + chunk += this.writer.endline(node, this.writerOptions, this.currentLevel); + } + this.onData(chunk, this.currentLevel); + return node.isOpen = true; + } + }; + + XMLDocumentCB.prototype.closeNode = function(node) { + var chunk; + if (!node.isClosed) { + chunk = ''; + this.writerOptions.state = WriterState.CloseTag; + if (node.type === NodeType.Element) { + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + '' + this.writer.endline(node, this.writerOptions, this.currentLevel); + } else { + chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + ']>' + this.writer.endline(node, this.writerOptions, this.currentLevel); + } + this.writerOptions.state = WriterState.None; + this.onData(chunk, this.currentLevel); + return node.isClosed = true; + } + }; + + XMLDocumentCB.prototype.onData = function(chunk, level) { + this.documentStarted = true; + return this.onDataCallback(chunk, level + 1); + }; + + XMLDocumentCB.prototype.onEnd = function() { + this.documentCompleted = true; + return this.onEndCallback(); + }; + + XMLDocumentCB.prototype.debugInfo = function(name) { + if (name == null) { + return ""; + } else { + return "node: <" + name + ">"; + } + }; + + XMLDocumentCB.prototype.ele = function() { + return this.element.apply(this, arguments); + }; + + XMLDocumentCB.prototype.nod = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLDocumentCB.prototype.txt = function(value) { + return this.text(value); + }; + + XMLDocumentCB.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLDocumentCB.prototype.com = function(value) { + return this.comment(value); + }; + + XMLDocumentCB.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLDocumentCB.prototype.dec = function(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + }; + + XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) { + return this.doctype(root, pubID, sysID); + }; + + XMLDocumentCB.prototype.e = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLDocumentCB.prototype.n = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLDocumentCB.prototype.t = function(value) { + return this.text(value); + }; + + XMLDocumentCB.prototype.d = function(value) { + return this.cdata(value); + }; + + XMLDocumentCB.prototype.c = function(value) { + return this.comment(value); + }; + + XMLDocumentCB.prototype.r = function(value) { + return this.raw(value); + }; + + XMLDocumentCB.prototype.i = function(target, value) { + return this.instruction(target, value); + }; + + XMLDocumentCB.prototype.att = function() { + if (this.currentNode && this.currentNode.type === NodeType.DocType) { + return this.attList.apply(this, arguments); + } else { + return this.attribute.apply(this, arguments); + } + }; + + XMLDocumentCB.prototype.a = function() { + if (this.currentNode && this.currentNode.type === NodeType.DocType) { + return this.attList.apply(this, arguments); + } else { + return this.attribute.apply(this, arguments); + } + }; + + XMLDocumentCB.prototype.ent = function(name, value) { + return this.entity(name, value); + }; + + XMLDocumentCB.prototype.pent = function(name, value) { + return this.pEntity(name, value); + }; + + XMLDocumentCB.prototype.not = function(name, value) { + return this.notation(name, value); + }; + + return XMLDocumentCB; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDocumentFragment.js b/node_modules/xmlbuilder/lib/XMLDocumentFragment.js new file mode 100644 index 0000000..5d6039c --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDocumentFragment.js @@ -0,0 +1,24 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDocumentFragment, XMLNode, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + module.exports = XMLDocumentFragment = (function(superClass) { + extend(XMLDocumentFragment, superClass); + + function XMLDocumentFragment() { + XMLDocumentFragment.__super__.constructor.call(this, null); + this.name = "#document-fragment"; + this.type = NodeType.DocumentFragment; + } + + return XMLDocumentFragment; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLDummy.js b/node_modules/xmlbuilder/lib/XMLDummy.js new file mode 100644 index 0000000..b26083a --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLDummy.js @@ -0,0 +1,31 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLDummy, XMLNode, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + module.exports = XMLDummy = (function(superClass) { + extend(XMLDummy, superClass); + + function XMLDummy(parent) { + XMLDummy.__super__.constructor.call(this, parent); + this.type = NodeType.Dummy; + } + + XMLDummy.prototype.clone = function() { + return Object.create(this); + }; + + XMLDummy.prototype.toString = function(options) { + return ''; + }; + + return XMLDummy; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLElement.js b/node_modules/xmlbuilder/lib/XMLElement.js new file mode 100644 index 0000000..c165729 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLElement.js @@ -0,0 +1,298 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue; + + XMLNode = require('./XMLNode'); + + NodeType = require('./NodeType'); + + XMLAttribute = require('./XMLAttribute'); + + XMLNamedNodeMap = require('./XMLNamedNodeMap'); + + module.exports = XMLElement = (function(superClass) { + extend(XMLElement, superClass); + + function XMLElement(parent, name, attributes) { + var child, j, len, ref1; + XMLElement.__super__.constructor.call(this, parent); + if (name == null) { + throw new Error("Missing element name. " + this.debugInfo()); + } + this.name = this.stringify.name(name); + this.type = NodeType.Element; + this.attribs = {}; + this.schemaTypeInfo = null; + if (attributes != null) { + this.attribute(attributes); + } + if (parent.type === NodeType.Document) { + this.isRoot = true; + this.documentObject = parent; + parent.rootObject = this; + if (parent.children) { + ref1 = parent.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + if (child.type === NodeType.DocType) { + child.name = this.name; + break; + } + } + } + } + } + + Object.defineProperty(XMLElement.prototype, 'tagName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLElement.prototype, 'namespaceURI', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLElement.prototype, 'prefix', { + get: function() { + return ''; + } + }); + + Object.defineProperty(XMLElement.prototype, 'localName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLElement.prototype, 'id', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'className', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'classList', { + get: function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + Object.defineProperty(XMLElement.prototype, 'attributes', { + get: function() { + if (!this.attributeMap || !this.attributeMap.nodes) { + this.attributeMap = new XMLNamedNodeMap(this.attribs); + } + return this.attributeMap; + } + }); + + XMLElement.prototype.clone = function() { + var att, attName, clonedSelf, ref1; + clonedSelf = Object.create(this); + if (clonedSelf.isRoot) { + clonedSelf.documentObject = null; + } + clonedSelf.attribs = {}; + ref1 = this.attribs; + for (attName in ref1) { + if (!hasProp.call(ref1, attName)) continue; + att = ref1[attName]; + clonedSelf.attribs[attName] = att.clone(); + } + clonedSelf.children = []; + this.children.forEach(function(child) { + var clonedChild; + clonedChild = child.clone(); + clonedChild.parent = clonedSelf; + return clonedSelf.children.push(clonedChild); + }); + return clonedSelf; + }; + + XMLElement.prototype.attribute = function(name, value) { + var attName, attValue; + if (name != null) { + name = getValue(name); + } + if (isObject(name)) { + for (attName in name) { + if (!hasProp.call(name, attName)) continue; + attValue = name[attName]; + this.attribute(attName, attValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + if (this.options.keepNullAttributes && (value == null)) { + this.attribs[name] = new XMLAttribute(this, name, ""); + } else if (value != null) { + this.attribs[name] = new XMLAttribute(this, name, value); + } + } + return this; + }; + + XMLElement.prototype.removeAttribute = function(name) { + var attName, j, len; + if (name == null) { + throw new Error("Missing attribute name. " + this.debugInfo()); + } + name = getValue(name); + if (Array.isArray(name)) { + for (j = 0, len = name.length; j < len; j++) { + attName = name[j]; + delete this.attribs[attName]; + } + } else { + delete this.attribs[name]; + } + return this; + }; + + XMLElement.prototype.toString = function(options) { + return this.options.writer.element(this, this.options.writer.filterOptions(options)); + }; + + XMLElement.prototype.att = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.a = function(name, value) { + return this.attribute(name, value); + }; + + XMLElement.prototype.getAttribute = function(name) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name].value; + } else { + return null; + } + }; + + XMLElement.prototype.setAttribute = function(name, value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getAttributeNode = function(name) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name]; + } else { + return null; + } + }; + + XMLElement.prototype.setAttributeNode = function(newAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.removeAttributeNode = function(oldAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagName = function(name) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getAttributeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.removeAttributeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getAttributeNodeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setAttributeNodeNS = function(newAttr) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.hasAttribute = function(name) { + return this.attribs.hasOwnProperty(name); + }; + + XMLElement.prototype.hasAttributeNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setIdAttribute = function(name, isId) { + if (this.attribs.hasOwnProperty(name)) { + return this.attribs[name].isId; + } else { + return isId; + } + }; + + XMLElement.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.setIdAttributeNode = function(idAttr, isId) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagName = function(tagname) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.getElementsByClassName = function(classNames) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLElement.prototype.isEqualNode = function(node) { + var i, j, ref1; + if (!XMLElement.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.namespaceURI !== this.namespaceURI) { + return false; + } + if (node.prefix !== this.prefix) { + return false; + } + if (node.localName !== this.localName) { + return false; + } + if (node.attribs.length !== this.attribs.length) { + return false; + } + for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) { + if (!this.attribs[i].isEqualNode(node.attribs[i])) { + return false; + } + } + return true; + }; + + return XMLElement; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js b/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js new file mode 100644 index 0000000..885402d --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNamedNodeMap.js @@ -0,0 +1,58 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLNamedNodeMap; + + module.exports = XMLNamedNodeMap = (function() { + function XMLNamedNodeMap(nodes) { + this.nodes = nodes; + } + + Object.defineProperty(XMLNamedNodeMap.prototype, 'length', { + get: function() { + return Object.keys(this.nodes).length || 0; + } + }); + + XMLNamedNodeMap.prototype.clone = function() { + return this.nodes = null; + }; + + XMLNamedNodeMap.prototype.getNamedItem = function(name) { + return this.nodes[name]; + }; + + XMLNamedNodeMap.prototype.setNamedItem = function(node) { + var oldNode; + oldNode = this.nodes[node.nodeName]; + this.nodes[node.nodeName] = node; + return oldNode || null; + }; + + XMLNamedNodeMap.prototype.removeNamedItem = function(name) { + var oldNode; + oldNode = this.nodes[name]; + delete this.nodes[name]; + return oldNode || null; + }; + + XMLNamedNodeMap.prototype.item = function(index) { + return this.nodes[Object.keys(this.nodes)[index]] || null; + }; + + XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented."); + }; + + XMLNamedNodeMap.prototype.setNamedItemNS = function(node) { + throw new Error("This DOM method is not implemented."); + }; + + XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) { + throw new Error("This DOM method is not implemented."); + }; + + return XMLNamedNodeMap; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNode.js b/node_modules/xmlbuilder/lib/XMLNode.js new file mode 100644 index 0000000..e2c7bb7 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNode.js @@ -0,0 +1,785 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1, + hasProp = {}.hasOwnProperty; + + ref1 = require('./Utility'), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue; + + XMLElement = null; + + XMLCData = null; + + XMLComment = null; + + XMLDeclaration = null; + + XMLDocType = null; + + XMLRaw = null; + + XMLText = null; + + XMLProcessingInstruction = null; + + XMLDummy = null; + + NodeType = null; + + XMLNodeList = null; + + XMLNamedNodeMap = null; + + DocumentPosition = null; + + module.exports = XMLNode = (function() { + function XMLNode(parent1) { + this.parent = parent1; + if (this.parent) { + this.options = this.parent.options; + this.stringify = this.parent.stringify; + } + this.value = null; + this.children = []; + this.baseURI = null; + if (!XMLElement) { + XMLElement = require('./XMLElement'); + XMLCData = require('./XMLCData'); + XMLComment = require('./XMLComment'); + XMLDeclaration = require('./XMLDeclaration'); + XMLDocType = require('./XMLDocType'); + XMLRaw = require('./XMLRaw'); + XMLText = require('./XMLText'); + XMLProcessingInstruction = require('./XMLProcessingInstruction'); + XMLDummy = require('./XMLDummy'); + NodeType = require('./NodeType'); + XMLNodeList = require('./XMLNodeList'); + XMLNamedNodeMap = require('./XMLNamedNodeMap'); + DocumentPosition = require('./DocumentPosition'); + } + } + + Object.defineProperty(XMLNode.prototype, 'nodeName', { + get: function() { + return this.name; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nodeType', { + get: function() { + return this.type; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nodeValue', { + get: function() { + return this.value; + } + }); + + Object.defineProperty(XMLNode.prototype, 'parentNode', { + get: function() { + return this.parent; + } + }); + + Object.defineProperty(XMLNode.prototype, 'childNodes', { + get: function() { + if (!this.childNodeList || !this.childNodeList.nodes) { + this.childNodeList = new XMLNodeList(this.children); + } + return this.childNodeList; + } + }); + + Object.defineProperty(XMLNode.prototype, 'firstChild', { + get: function() { + return this.children[0] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'lastChild', { + get: function() { + return this.children[this.children.length - 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'previousSibling', { + get: function() { + var i; + i = this.parent.children.indexOf(this); + return this.parent.children[i - 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'nextSibling', { + get: function() { + var i; + i = this.parent.children.indexOf(this); + return this.parent.children[i + 1] || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'ownerDocument', { + get: function() { + return this.document() || null; + } + }); + + Object.defineProperty(XMLNode.prototype, 'textContent', { + get: function() { + var child, j, len, ref2, str; + if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) { + str = ''; + ref2 = this.children; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + if (child.textContent) { + str += child.textContent; + } + } + return str; + } else { + return null; + } + }, + set: function(value) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + } + }); + + XMLNode.prototype.setParent = function(parent) { + var child, j, len, ref2, results; + this.parent = parent; + if (parent) { + this.options = parent.options; + this.stringify = parent.stringify; + } + ref2 = this.children; + results = []; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + results.push(child.setParent(this)); + } + return results; + }; + + XMLNode.prototype.element = function(name, attributes, text) { + var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val; + lastChild = null; + if (attributes === null && (text == null)) { + ref2 = [{}, null], attributes = ref2[0], text = ref2[1]; + } + if (attributes == null) { + attributes = {}; + } + attributes = getValue(attributes); + if (!isObject(attributes)) { + ref3 = [attributes, text], text = ref3[0], attributes = ref3[1]; + } + if (name != null) { + name = getValue(name); + } + if (Array.isArray(name)) { + for (j = 0, len = name.length; j < len; j++) { + item = name[j]; + lastChild = this.element(item); + } + } else if (isFunction(name)) { + lastChild = this.element(name.apply()); + } else if (isObject(name)) { + for (key in name) { + if (!hasProp.call(name, key)) continue; + val = name[key]; + if (isFunction(val)) { + val = val.apply(); + } + if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) { + lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); + } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) { + lastChild = this.dummy(); + } else if (isObject(val) && isEmpty(val)) { + lastChild = this.element(key); + } else if (!this.options.keepNullNodes && (val == null)) { + lastChild = this.dummy(); + } else if (!this.options.separateArrayItems && Array.isArray(val)) { + for (k = 0, len1 = val.length; k < len1; k++) { + item = val[k]; + childNode = {}; + childNode[key] = item; + lastChild = this.element(childNode); + } + } else if (isObject(val)) { + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.element(val); + } else { + lastChild = this.element(key); + lastChild.element(val); + } + } else { + lastChild = this.element(key, val); + } + } + } else if (!this.options.keepNullNodes && text === null) { + lastChild = this.dummy(); + } else { + if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) { + lastChild = this.text(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) { + lastChild = this.cdata(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) { + lastChild = this.comment(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) { + lastChild = this.raw(text); + } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) { + lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text); + } else { + lastChild = this.node(name, attributes, text); + } + } + if (lastChild == null) { + throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo()); + } + return lastChild; + }; + + XMLNode.prototype.insertBefore = function(name, attributes, text) { + var child, i, newChild, refChild, removed; + if (name != null ? name.type : void 0) { + newChild = name; + refChild = attributes; + newChild.setParent(this); + if (refChild) { + i = children.indexOf(refChild); + removed = children.splice(i); + children.push(newChild); + Array.prototype.push.apply(children, removed); + } else { + children.push(newChild); + } + return newChild; + } else { + if (this.isRoot) { + throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + } + }; + + XMLNode.prototype.insertAfter = function(name, attributes, text) { + var child, i, removed; + if (this.isRoot) { + throw new Error("Cannot insert elements at root level. " + this.debugInfo(name)); + } + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.element(name, attributes, text); + Array.prototype.push.apply(this.parent.children, removed); + return child; + }; + + XMLNode.prototype.remove = function() { + var i, ref2; + if (this.isRoot) { + throw new Error("Cannot remove the root element. " + this.debugInfo()); + } + i = this.parent.children.indexOf(this); + [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2; + return this.parent; + }; + + XMLNode.prototype.node = function(name, attributes, text) { + var child, ref2; + if (name != null) { + name = getValue(name); + } + attributes || (attributes = {}); + attributes = getValue(attributes); + if (!isObject(attributes)) { + ref2 = [attributes, text], text = ref2[0], attributes = ref2[1]; + } + child = new XMLElement(this, name, attributes); + if (text != null) { + child.text(text); + } + this.children.push(child); + return child; + }; + + XMLNode.prototype.text = function(value) { + var child; + if (isObject(value)) { + this.element(value); + } + child = new XMLText(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.cdata = function(value) { + var child; + child = new XMLCData(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.comment = function(value) { + var child; + child = new XMLComment(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.commentBefore = function(value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.comment(value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.commentAfter = function(value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.comment(value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.raw = function(value) { + var child; + child = new XMLRaw(this, value); + this.children.push(child); + return this; + }; + + XMLNode.prototype.dummy = function() { + var child; + child = new XMLDummy(this); + return child; + }; + + XMLNode.prototype.instruction = function(target, value) { + var insTarget, insValue, instruction, j, len; + if (target != null) { + target = getValue(target); + } + if (value != null) { + value = getValue(value); + } + if (Array.isArray(target)) { + for (j = 0, len = target.length; j < len; j++) { + insTarget = target[j]; + this.instruction(insTarget); + } + } else if (isObject(target)) { + for (insTarget in target) { + if (!hasProp.call(target, insTarget)) continue; + insValue = target[insTarget]; + this.instruction(insTarget, insValue); + } + } else { + if (isFunction(value)) { + value = value.apply(); + } + instruction = new XMLProcessingInstruction(this, target, value); + this.children.push(instruction); + } + return this; + }; + + XMLNode.prototype.instructionBefore = function(target, value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i); + child = this.parent.instruction(target, value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.instructionAfter = function(target, value) { + var child, i, removed; + i = this.parent.children.indexOf(this); + removed = this.parent.children.splice(i + 1); + child = this.parent.instruction(target, value); + Array.prototype.push.apply(this.parent.children, removed); + return this; + }; + + XMLNode.prototype.declaration = function(version, encoding, standalone) { + var doc, xmldec; + doc = this.document(); + xmldec = new XMLDeclaration(doc, version, encoding, standalone); + if (doc.children.length === 0) { + doc.children.unshift(xmldec); + } else if (doc.children[0].type === NodeType.Declaration) { + doc.children[0] = xmldec; + } else { + doc.children.unshift(xmldec); + } + return doc.root() || doc; + }; + + XMLNode.prototype.dtd = function(pubID, sysID) { + var child, doc, doctype, i, j, k, len, len1, ref2, ref3; + doc = this.document(); + doctype = new XMLDocType(doc, pubID, sysID); + ref2 = doc.children; + for (i = j = 0, len = ref2.length; j < len; i = ++j) { + child = ref2[i]; + if (child.type === NodeType.DocType) { + doc.children[i] = doctype; + return doctype; + } + } + ref3 = doc.children; + for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) { + child = ref3[i]; + if (child.isRoot) { + doc.children.splice(i, 0, doctype); + return doctype; + } + } + doc.children.push(doctype); + return doctype; + }; + + XMLNode.prototype.up = function() { + if (this.isRoot) { + throw new Error("The root node has no parent. Use doc() if you need to get the document object."); + } + return this.parent; + }; + + XMLNode.prototype.root = function() { + var node; + node = this; + while (node) { + if (node.type === NodeType.Document) { + return node.rootObject; + } else if (node.isRoot) { + return node; + } else { + node = node.parent; + } + } + }; + + XMLNode.prototype.document = function() { + var node; + node = this; + while (node) { + if (node.type === NodeType.Document) { + return node; + } else { + node = node.parent; + } + } + }; + + XMLNode.prototype.end = function(options) { + return this.document().end(options); + }; + + XMLNode.prototype.prev = function() { + var i; + i = this.parent.children.indexOf(this); + if (i < 1) { + throw new Error("Already at the first node. " + this.debugInfo()); + } + return this.parent.children[i - 1]; + }; + + XMLNode.prototype.next = function() { + var i; + i = this.parent.children.indexOf(this); + if (i === -1 || i === this.parent.children.length - 1) { + throw new Error("Already at the last node. " + this.debugInfo()); + } + return this.parent.children[i + 1]; + }; + + XMLNode.prototype.importDocument = function(doc) { + var clonedRoot; + clonedRoot = doc.root().clone(); + clonedRoot.parent = this; + clonedRoot.isRoot = false; + this.children.push(clonedRoot); + return this; + }; + + XMLNode.prototype.debugInfo = function(name) { + var ref2, ref3; + name = name || this.name; + if ((name == null) && !((ref2 = this.parent) != null ? ref2.name : void 0)) { + return ""; + } else if (name == null) { + return "parent: <" + this.parent.name + ">"; + } else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) { + return "node: <" + name + ">"; + } else { + return "node: <" + name + ">, parent: <" + this.parent.name + ">"; + } + }; + + XMLNode.prototype.ele = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.nod = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.txt = function(value) { + return this.text(value); + }; + + XMLNode.prototype.dat = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.com = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.ins = function(target, value) { + return this.instruction(target, value); + }; + + XMLNode.prototype.doc = function() { + return this.document(); + }; + + XMLNode.prototype.dec = function(version, encoding, standalone) { + return this.declaration(version, encoding, standalone); + }; + + XMLNode.prototype.e = function(name, attributes, text) { + return this.element(name, attributes, text); + }; + + XMLNode.prototype.n = function(name, attributes, text) { + return this.node(name, attributes, text); + }; + + XMLNode.prototype.t = function(value) { + return this.text(value); + }; + + XMLNode.prototype.d = function(value) { + return this.cdata(value); + }; + + XMLNode.prototype.c = function(value) { + return this.comment(value); + }; + + XMLNode.prototype.r = function(value) { + return this.raw(value); + }; + + XMLNode.prototype.i = function(target, value) { + return this.instruction(target, value); + }; + + XMLNode.prototype.u = function() { + return this.up(); + }; + + XMLNode.prototype.importXMLBuilder = function(doc) { + return this.importDocument(doc); + }; + + XMLNode.prototype.replaceChild = function(newChild, oldChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.removeChild = function(oldChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.appendChild = function(newChild) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.hasChildNodes = function() { + return this.children.length !== 0; + }; + + XMLNode.prototype.cloneNode = function(deep) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.normalize = function() { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.isSupported = function(feature, version) { + return true; + }; + + XMLNode.prototype.hasAttributes = function() { + return this.attribs.length !== 0; + }; + + XMLNode.prototype.compareDocumentPosition = function(other) { + var ref, res; + ref = this; + if (ref === other) { + return 0; + } else if (this.document() !== other.document()) { + res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific; + if (Math.random() < 0.5) { + res |= DocumentPosition.Preceding; + } else { + res |= DocumentPosition.Following; + } + return res; + } else if (ref.isAncestor(other)) { + return DocumentPosition.Contains | DocumentPosition.Preceding; + } else if (ref.isDescendant(other)) { + return DocumentPosition.Contains | DocumentPosition.Following; + } else if (ref.isPreceding(other)) { + return DocumentPosition.Preceding; + } else { + return DocumentPosition.Following; + } + }; + + XMLNode.prototype.isSameNode = function(other) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.lookupPrefix = function(namespaceURI) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.isDefaultNamespace = function(namespaceURI) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.lookupNamespaceURI = function(prefix) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.isEqualNode = function(node) { + var i, j, ref2; + if (node.nodeType !== this.nodeType) { + return false; + } + if (node.children.length !== this.children.length) { + return false; + } + for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) { + if (!this.children[i].isEqualNode(node.children[i])) { + return false; + } + } + return true; + }; + + XMLNode.prototype.getFeature = function(feature, version) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.setUserData = function(key, data, handler) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.getUserData = function(key) { + throw new Error("This DOM method is not implemented." + this.debugInfo()); + }; + + XMLNode.prototype.contains = function(other) { + if (!other) { + return false; + } + return other === this || this.isDescendant(other); + }; + + XMLNode.prototype.isDescendant = function(node) { + var child, isDescendantChild, j, len, ref2; + ref2 = this.children; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + if (node === child) { + return true; + } + isDescendantChild = child.isDescendant(node); + if (isDescendantChild) { + return true; + } + } + return false; + }; + + XMLNode.prototype.isAncestor = function(node) { + return node.isDescendant(this); + }; + + XMLNode.prototype.isPreceding = function(node) { + var nodePos, thisPos; + nodePos = this.treePosition(node); + thisPos = this.treePosition(this); + if (nodePos === -1 || thisPos === -1) { + return false; + } else { + return nodePos < thisPos; + } + }; + + XMLNode.prototype.isFollowing = function(node) { + var nodePos, thisPos; + nodePos = this.treePosition(node); + thisPos = this.treePosition(this); + if (nodePos === -1 || thisPos === -1) { + return false; + } else { + return nodePos > thisPos; + } + }; + + XMLNode.prototype.treePosition = function(node) { + var found, pos; + pos = 0; + found = false; + this.foreachTreeNode(this.document(), function(childNode) { + pos++; + if (!found && childNode === node) { + return found = true; + } + }); + if (found) { + return pos; + } else { + return -1; + } + }; + + XMLNode.prototype.foreachTreeNode = function(node, func) { + var child, j, len, ref2, res; + node || (node = this.document()); + ref2 = node.children; + for (j = 0, len = ref2.length; j < len; j++) { + child = ref2[j]; + if (res = func(child)) { + return res; + } else { + res = this.foreachTreeNode(child, func); + if (res) { + return res; + } + } + } + }; + + return XMLNode; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNodeFilter.js b/node_modules/xmlbuilder/lib/XMLNodeFilter.js new file mode 100644 index 0000000..ce32fd5 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNodeFilter.js @@ -0,0 +1,48 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLNodeFilter; + + module.exports = XMLNodeFilter = (function() { + function XMLNodeFilter() {} + + XMLNodeFilter.prototype.FilterAccept = 1; + + XMLNodeFilter.prototype.FilterReject = 2; + + XMLNodeFilter.prototype.FilterSkip = 3; + + XMLNodeFilter.prototype.ShowAll = 0xffffffff; + + XMLNodeFilter.prototype.ShowElement = 0x1; + + XMLNodeFilter.prototype.ShowAttribute = 0x2; + + XMLNodeFilter.prototype.ShowText = 0x4; + + XMLNodeFilter.prototype.ShowCDataSection = 0x8; + + XMLNodeFilter.prototype.ShowEntityReference = 0x10; + + XMLNodeFilter.prototype.ShowEntity = 0x20; + + XMLNodeFilter.prototype.ShowProcessingInstruction = 0x40; + + XMLNodeFilter.prototype.ShowComment = 0x80; + + XMLNodeFilter.prototype.ShowDocument = 0x100; + + XMLNodeFilter.prototype.ShowDocumentType = 0x200; + + XMLNodeFilter.prototype.ShowDocumentFragment = 0x400; + + XMLNodeFilter.prototype.ShowNotation = 0x800; + + XMLNodeFilter.prototype.acceptNode = function(node) { + throw new Error("This DOM method is not implemented."); + }; + + return XMLNodeFilter; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLNodeList.js b/node_modules/xmlbuilder/lib/XMLNodeList.js new file mode 100644 index 0000000..3414a3e --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLNodeList.js @@ -0,0 +1,28 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLNodeList; + + module.exports = XMLNodeList = (function() { + function XMLNodeList(nodes) { + this.nodes = nodes; + } + + Object.defineProperty(XMLNodeList.prototype, 'length', { + get: function() { + return this.nodes.length || 0; + } + }); + + XMLNodeList.prototype.clone = function() { + return this.nodes = null; + }; + + XMLNodeList.prototype.item = function(index) { + return this.nodes[index] || null; + }; + + return XMLNodeList; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js b/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js new file mode 100644 index 0000000..d4333d4 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js @@ -0,0 +1,49 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLCharacterData, XMLProcessingInstruction, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType = require('./NodeType'); + + XMLCharacterData = require('./XMLCharacterData'); + + module.exports = XMLProcessingInstruction = (function(superClass) { + extend(XMLProcessingInstruction, superClass); + + function XMLProcessingInstruction(parent, target, value) { + XMLProcessingInstruction.__super__.constructor.call(this, parent); + if (target == null) { + throw new Error("Missing instruction target. " + this.debugInfo()); + } + this.type = NodeType.ProcessingInstruction; + this.target = this.stringify.insTarget(target); + this.name = this.target; + if (value) { + this.value = this.stringify.insValue(value); + } + } + + XMLProcessingInstruction.prototype.clone = function() { + return Object.create(this); + }; + + XMLProcessingInstruction.prototype.toString = function(options) { + return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options)); + }; + + XMLProcessingInstruction.prototype.isEqualNode = function(node) { + if (!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) { + return false; + } + if (node.target !== this.target) { + return false; + } + return true; + }; + + return XMLProcessingInstruction; + + })(XMLCharacterData); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLRaw.js b/node_modules/xmlbuilder/lib/XMLRaw.js new file mode 100644 index 0000000..b592850 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLRaw.js @@ -0,0 +1,35 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, XMLNode, XMLRaw, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType = require('./NodeType'); + + XMLNode = require('./XMLNode'); + + module.exports = XMLRaw = (function(superClass) { + extend(XMLRaw, superClass); + + function XMLRaw(parent, text) { + XMLRaw.__super__.constructor.call(this, parent); + if (text == null) { + throw new Error("Missing raw text. " + this.debugInfo()); + } + this.type = NodeType.Raw; + this.value = this.stringify.raw(text); + } + + XMLRaw.prototype.clone = function() { + return Object.create(this); + }; + + XMLRaw.prototype.toString = function(options) { + return this.options.writer.raw(this, this.options.writer.filterOptions(options)); + }; + + return XMLRaw; + + })(XMLNode); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLStreamWriter.js b/node_modules/xmlbuilder/lib/XMLStreamWriter.js new file mode 100644 index 0000000..159dc6b --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLStreamWriter.js @@ -0,0 +1,176 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, WriterState, XMLStreamWriter, XMLWriterBase, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + NodeType = require('./NodeType'); + + XMLWriterBase = require('./XMLWriterBase'); + + WriterState = require('./WriterState'); + + module.exports = XMLStreamWriter = (function(superClass) { + extend(XMLStreamWriter, superClass); + + function XMLStreamWriter(stream, options) { + this.stream = stream; + XMLStreamWriter.__super__.constructor.call(this, options); + } + + XMLStreamWriter.prototype.endline = function(node, options, level) { + if (node.isLastRootNode && options.state === WriterState.CloseTag) { + return ''; + } else { + return XMLStreamWriter.__super__.endline.call(this, node, options, level); + } + }; + + XMLStreamWriter.prototype.document = function(doc, options) { + var child, i, j, k, len, len1, ref, ref1, results; + ref = doc.children; + for (i = j = 0, len = ref.length; j < len; i = ++j) { + child = ref[i]; + child.isLastRootNode = i === doc.children.length - 1; + } + options = this.filterOptions(options); + ref1 = doc.children; + results = []; + for (k = 0, len1 = ref1.length; k < len1; k++) { + child = ref1[k]; + results.push(this.writeChildNode(child, options, 0)); + } + return results; + }; + + XMLStreamWriter.prototype.attribute = function(att, options, level) { + return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level)); + }; + + XMLStreamWriter.prototype.cdata = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.comment = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.declaration = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.docType = function(node, options, level) { + var child, j, len, ref; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + this.stream.write(this.indent(node, options, level)); + this.stream.write(' 0) { + this.stream.write(' ['); + this.stream.write(this.endline(node, options, level)); + options.state = WriterState.InsideTag; + ref = node.children; + for (j = 0, len = ref.length; j < len; j++) { + child = ref[j]; + this.writeChildNode(child, options, level + 1); + } + options.state = WriterState.CloseTag; + this.stream.write(']'); + } + options.state = WriterState.CloseTag; + this.stream.write(options.spaceBeforeSlash + '>'); + this.stream.write(this.endline(node, options, level)); + options.state = WriterState.None; + return this.closeNode(node, options, level); + }; + + XMLStreamWriter.prototype.element = function(node, options, level) { + var att, child, childNodeCount, firstChildNode, j, len, name, prettySuppressed, ref, ref1; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + this.stream.write(this.indent(node, options, level) + '<' + node.name); + ref = node.attribs; + for (name in ref) { + if (!hasProp.call(ref, name)) continue; + att = ref[name]; + this.attribute(att, options, level); + } + childNodeCount = node.children.length; + firstChildNode = childNodeCount === 0 ? null : node.children[0]; + if (childNodeCount === 0 || node.children.every(function(e) { + return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === ''; + })) { + if (options.allowEmpty) { + this.stream.write('>'); + options.state = WriterState.CloseTag; + this.stream.write(''); + } else { + options.state = WriterState.CloseTag; + this.stream.write(options.spaceBeforeSlash + '/>'); + } + } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) { + this.stream.write('>'); + options.state = WriterState.InsideTag; + options.suppressPrettyCount++; + prettySuppressed = true; + this.writeChildNode(firstChildNode, options, level + 1); + options.suppressPrettyCount--; + prettySuppressed = false; + options.state = WriterState.CloseTag; + this.stream.write(''); + } else { + this.stream.write('>' + this.endline(node, options, level)); + options.state = WriterState.InsideTag; + ref1 = node.children; + for (j = 0, len = ref1.length; j < len; j++) { + child = ref1[j]; + this.writeChildNode(child, options, level + 1); + } + options.state = WriterState.CloseTag; + this.stream.write(this.indent(node, options, level) + ''); + } + this.stream.write(this.endline(node, options, level)); + options.state = WriterState.None; + return this.closeNode(node, options, level); + }; + + XMLStreamWriter.prototype.processingInstruction = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.raw = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.text = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdAttList = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdElement = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdEntity = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level)); + }; + + XMLStreamWriter.prototype.dtdNotation = function(node, options, level) { + return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level)); + }; + + return XMLStreamWriter; + + })(XMLWriterBase); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLStringWriter.js b/node_modules/xmlbuilder/lib/XMLStringWriter.js new file mode 100644 index 0000000..7187017 --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLStringWriter.js @@ -0,0 +1,35 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLStringWriter, XMLWriterBase, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + XMLWriterBase = require('./XMLWriterBase'); + + module.exports = XMLStringWriter = (function(superClass) { + extend(XMLStringWriter, superClass); + + function XMLStringWriter(options) { + XMLStringWriter.__super__.constructor.call(this, options); + } + + XMLStringWriter.prototype.document = function(doc, options) { + var child, i, len, r, ref; + options = this.filterOptions(options); + r = ''; + ref = doc.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + r += this.writeChildNode(child, options, 0); + } + if (options.pretty && r.slice(-options.newline.length) === options.newline) { + r = r.slice(0, -options.newline.length); + } + return r; + }; + + return XMLStringWriter; + + })(XMLWriterBase); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/XMLStringifier.js b/node_modules/xmlbuilder/lib/XMLStringifier.js new file mode 100644 index 0000000..a39475c --- /dev/null +++ b/node_modules/xmlbuilder/lib/XMLStringifier.js @@ -0,0 +1,240 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var XMLStringifier, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + hasProp = {}.hasOwnProperty; + + module.exports = XMLStringifier = (function() { + function XMLStringifier(options) { + this.assertLegalName = bind(this.assertLegalName, this); + this.assertLegalChar = bind(this.assertLegalChar, this); + var key, ref, value; + options || (options = {}); + this.options = options; + if (!this.options.version) { + this.options.version = '1.0'; + } + ref = options.stringify || {}; + for (key in ref) { + if (!hasProp.call(ref, key)) continue; + value = ref[key]; + this[key] = value; + } + } + + XMLStringifier.prototype.name = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalName('' + val || ''); + }; + + XMLStringifier.prototype.text = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar(this.textEscape('' + val || '')); + }; + + XMLStringifier.prototype.cdata = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + val = val.replace(']]>', ']]]]>'); + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.comment = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (val.match(/--/)) { + throw new Error("Comment text cannot contain double-hypen: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.raw = function(val) { + if (this.options.noValidation) { + return val; + } + return '' + val || ''; + }; + + XMLStringifier.prototype.attValue = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar(this.attEscape(val = '' + val || '')); + }; + + XMLStringifier.prototype.insTarget = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.insValue = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (val.match(/\?>/)) { + throw new Error("Invalid processing instruction value: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.xmlVersion = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (!val.match(/1\.[0-9]+/)) { + throw new Error("Invalid version number: " + val); + } + return val; + }; + + XMLStringifier.prototype.xmlEncoding = function(val) { + if (this.options.noValidation) { + return val; + } + val = '' + val || ''; + if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) { + throw new Error("Invalid encoding: " + val); + } + return this.assertLegalChar(val); + }; + + XMLStringifier.prototype.xmlStandalone = function(val) { + if (this.options.noValidation) { + return val; + } + if (val) { + return "yes"; + } else { + return "no"; + } + }; + + XMLStringifier.prototype.dtdPubID = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdSysID = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdElementValue = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdAttType = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdAttDefault = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdEntityValue = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.dtdNData = function(val) { + if (this.options.noValidation) { + return val; + } + return this.assertLegalChar('' + val || ''); + }; + + XMLStringifier.prototype.convertAttKey = '@'; + + XMLStringifier.prototype.convertPIKey = '?'; + + XMLStringifier.prototype.convertTextKey = '#text'; + + XMLStringifier.prototype.convertCDataKey = '#cdata'; + + XMLStringifier.prototype.convertCommentKey = '#comment'; + + XMLStringifier.prototype.convertRawKey = '#raw'; + + XMLStringifier.prototype.assertLegalChar = function(str) { + var regex, res; + if (this.options.noValidation) { + return str; + } + regex = ''; + if (this.options.version === '1.0') { + regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex)) { + throw new Error("Invalid character in string: " + str + " at index " + res.index); + } + } else if (this.options.version === '1.1') { + regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; + if (res = str.match(regex)) { + throw new Error("Invalid character in string: " + str + " at index " + res.index); + } + } + return str; + }; + + XMLStringifier.prototype.assertLegalName = function(str) { + var regex; + if (this.options.noValidation) { + return str; + } + this.assertLegalChar(str); + regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/; + if (!str.match(regex)) { + throw new Error("Invalid character in name"); + } + return str; + }; + + XMLStringifier.prototype.textEscape = function(str) { + var ampregex; + if (this.options.noValidation) { + return str; + } + ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; + return str.replace(ampregex, '&').replace(//g, '>').replace(/\r/g, ' '); + }; + + XMLStringifier.prototype.attEscape = function(str) { + var ampregex; + if (this.options.noValidation) { + return str; + } + ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; + return str.replace(ampregex, '&').replace(/ 0) { + return new Array(indentLevel).join(options.indent); + } + } + return ''; + }; + + XMLWriterBase.prototype.endline = function(node, options, level) { + if (!options.pretty || options.suppressPrettyCount) { + return ''; + } else { + return options.newline; + } + }; + + XMLWriterBase.prototype.attribute = function(att, options, level) { + var r; + this.openAttribute(att, options, level); + r = ' ' + att.name + '="' + att.value + '"'; + this.closeAttribute(att, options, level); + return r; + }; + + XMLWriterBase.prototype.cdata = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.comment = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.declaration = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + ''; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.docType = function(node, options, level) { + var child, i, len, r, ref; + level || (level = 0); + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level); + r += ' 0) { + r += ' ['; + r += this.endline(node, options, level); + options.state = WriterState.InsideTag; + ref = node.children; + for (i = 0, len = ref.length; i < len; i++) { + child = ref[i]; + r += this.writeChildNode(child, options, level + 1); + } + options.state = WriterState.CloseTag; + r += ']'; + } + options.state = WriterState.CloseTag; + r += options.spaceBeforeSlash + '>'; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.element = function(node, options, level) { + var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2; + level || (level = 0); + prettySuppressed = false; + r = ''; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r += this.indent(node, options, level) + '<' + node.name; + ref = node.attribs; + for (name in ref) { + if (!hasProp.call(ref, name)) continue; + att = ref[name]; + r += this.attribute(att, options, level); + } + childNodeCount = node.children.length; + firstChildNode = childNodeCount === 0 ? null : node.children[0]; + if (childNodeCount === 0 || node.children.every(function(e) { + return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === ''; + })) { + if (options.allowEmpty) { + r += '>'; + options.state = WriterState.CloseTag; + r += '' + this.endline(node, options, level); + } else { + options.state = WriterState.CloseTag; + r += options.spaceBeforeSlash + '/>' + this.endline(node, options, level); + } + } else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && (firstChildNode.value != null)) { + r += '>'; + options.state = WriterState.InsideTag; + options.suppressPrettyCount++; + prettySuppressed = true; + r += this.writeChildNode(firstChildNode, options, level + 1); + options.suppressPrettyCount--; + prettySuppressed = false; + options.state = WriterState.CloseTag; + r += '' + this.endline(node, options, level); + } else { + if (options.dontPrettyTextNodes) { + ref1 = node.children; + for (i = 0, len = ref1.length; i < len; i++) { + child = ref1[i]; + if ((child.type === NodeType.Text || child.type === NodeType.Raw) && (child.value != null)) { + options.suppressPrettyCount++; + prettySuppressed = true; + break; + } + } + } + r += '>' + this.endline(node, options, level); + options.state = WriterState.InsideTag; + ref2 = node.children; + for (j = 0, len1 = ref2.length; j < len1; j++) { + child = ref2[j]; + r += this.writeChildNode(child, options, level + 1); + } + options.state = WriterState.CloseTag; + r += this.indent(node, options, level) + ''; + if (prettySuppressed) { + options.suppressPrettyCount--; + } + r += this.endline(node, options, level); + options.state = WriterState.None; + } + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.writeChildNode = function(node, options, level) { + switch (node.type) { + case NodeType.CData: + return this.cdata(node, options, level); + case NodeType.Comment: + return this.comment(node, options, level); + case NodeType.Element: + return this.element(node, options, level); + case NodeType.Raw: + return this.raw(node, options, level); + case NodeType.Text: + return this.text(node, options, level); + case NodeType.ProcessingInstruction: + return this.processingInstruction(node, options, level); + case NodeType.Dummy: + return ''; + case NodeType.Declaration: + return this.declaration(node, options, level); + case NodeType.DocType: + return this.docType(node, options, level); + case NodeType.AttributeDeclaration: + return this.dtdAttList(node, options, level); + case NodeType.ElementDeclaration: + return this.dtdElement(node, options, level); + case NodeType.EntityDeclaration: + return this.dtdEntity(node, options, level); + case NodeType.NotationDeclaration: + return this.dtdNotation(node, options, level); + default: + throw new Error("Unknown XML node type: " + node.constructor.name); + } + }; + + XMLWriterBase.prototype.processingInstruction = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + ''; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.raw = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level); + options.state = WriterState.InsideTag; + r += node.value; + options.state = WriterState.CloseTag; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.text = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level); + options.state = WriterState.InsideTag; + r += node.value; + options.state = WriterState.CloseTag; + r += this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdAttList = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdElement = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdEntity = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.dtdNotation = function(node, options, level) { + var r; + this.openNode(node, options, level); + options.state = WriterState.OpenTag; + r = this.indent(node, options, level) + '' + this.endline(node, options, level); + options.state = WriterState.None; + this.closeNode(node, options, level); + return r; + }; + + XMLWriterBase.prototype.openNode = function(node, options, level) {}; + + XMLWriterBase.prototype.closeNode = function(node, options, level) {}; + + XMLWriterBase.prototype.openAttribute = function(att, options, level) {}; + + XMLWriterBase.prototype.closeAttribute = function(att, options, level) {}; + + return XMLWriterBase; + + })(); + +}).call(this); diff --git a/node_modules/xmlbuilder/lib/index.js b/node_modules/xmlbuilder/lib/index.js new file mode 100644 index 0000000..b1ed263 --- /dev/null +++ b/node_modules/xmlbuilder/lib/index.js @@ -0,0 +1,65 @@ +// Generated by CoffeeScript 1.12.7 +(function() { + var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref; + + ref = require('./Utility'), assign = ref.assign, isFunction = ref.isFunction; + + XMLDOMImplementation = require('./XMLDOMImplementation'); + + XMLDocument = require('./XMLDocument'); + + XMLDocumentCB = require('./XMLDocumentCB'); + + XMLStringWriter = require('./XMLStringWriter'); + + XMLStreamWriter = require('./XMLStreamWriter'); + + NodeType = require('./NodeType'); + + WriterState = require('./WriterState'); + + module.exports.create = function(name, xmldec, doctype, options) { + var doc, root; + if (name == null) { + throw new Error("Root element needs a name."); + } + options = assign({}, xmldec, doctype, options); + doc = new XMLDocument(options); + root = doc.element(name); + if (!options.headless) { + doc.declaration(options); + if ((options.pubID != null) || (options.sysID != null)) { + doc.dtd(options); + } + } + return root; + }; + + module.exports.begin = function(options, onData, onEnd) { + var ref1; + if (isFunction(options)) { + ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1]; + options = {}; + } + if (onData) { + return new XMLDocumentCB(options, onData, onEnd); + } else { + return new XMLDocument(options); + } + }; + + module.exports.stringWriter = function(options) { + return new XMLStringWriter(options); + }; + + module.exports.streamWriter = function(stream, options) { + return new XMLStreamWriter(stream, options); + }; + + module.exports.implementation = new XMLDOMImplementation(); + + module.exports.nodeType = NodeType; + + module.exports.writerState = WriterState; + +}).call(this); diff --git a/node_modules/xmlbuilder/package.json b/node_modules/xmlbuilder/package.json new file mode 100644 index 0000000..512cd97 --- /dev/null +++ b/node_modules/xmlbuilder/package.json @@ -0,0 +1,39 @@ +{ + "name": "xmlbuilder", + "version": "11.0.1", + "keywords": [ + "xml", + "xmlbuilder" + ], + "homepage": "http://github.com/oozcitak/xmlbuilder-js", + "description": "An XML builder for node.js", + "author": "Ozgur Ozcitak ", + "contributors": [], + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/oozcitak/xmlbuilder-js.git" + }, + "bugs": { + "url": "http://github.com/oozcitak/xmlbuilder-js/issues" + }, + "main": "./lib/index", + "typings": "./typings/index.d.ts", + "engines": { + "node": ">=4.0" + }, + "dependencies": {}, + "devDependencies": { + "coffeescript": "1.*", + "mocha": "*", + "coffee-coverage": "2.*", + "istanbul": "*", + "coveralls": "*", + "xpath": "*" + }, + "scripts": { + "prepublishOnly": "coffee -co lib src", + "postpublish": "rm -rf lib", + "test": "mocha \"test/**/*.coffee\" && istanbul report text lcov" + } +} diff --git a/node_modules/xmlbuilder/typings/index.d.ts b/node_modules/xmlbuilder/typings/index.d.ts new file mode 100644 index 0000000..3e0e5b0 --- /dev/null +++ b/node_modules/xmlbuilder/typings/index.d.ts @@ -0,0 +1,153 @@ +// Type definitions for xmlbuilder +// Project: https://github.com/oozcitak/xmlbuilder-js +// Definitions by: Wallymathieu +// : GaikwadPratik +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = xmlbuilder; + +declare namespace xmlbuilder { + + class XMLDocType { + clone(): XMLDocType; + element(name: string, value?: Object): XMLDocType; + attList(elementName: string, attributeName: string, attributeType: string, defaultValueType?: string, defaultValue?: any): XMLDocType; + entity(name: string, value: any): XMLDocType; + pEntity(name: string, value: any): XMLDocType; + notation(name: string, value: any): XMLDocType; + cdata(value: string): XMLDocType; + comment(value: string): XMLDocType; + instruction(target: string, value: any): XMLDocType; + root(): XMLDocType; + document(): any; + toString(options?: XMLToStringOptions, level?: Number): string; + + ele(name: string, value?: Object): XMLDocType; + att(elementName: string, attributeName: string, attributeType: string, defaultValueType?: string, defaultValue?: any): XMLDocType; + ent(name: string, value: any): XMLDocType; + pent(name: string, value: any): XMLDocType; + not(name: string, value: any): XMLDocType; + dat(value: string): XMLDocType; + com(value: string): XMLDocType; + ins(target: string, value: any): XMLDocType; + up(): XMLDocType; + doc(): any; + } + + class XMLElementOrXMLNode { + // XMLElement: + clone(): XMLElementOrXMLNode; + attribute(name: any, value?: any): XMLElementOrXMLNode; + att(name: any, value?: any): XMLElementOrXMLNode; + removeAttribute(name: string): XMLElementOrXMLNode; + instruction(target: string, value: any): XMLElementOrXMLNode; + instruction(array: Array): XMLElementOrXMLNode; + instruction(obj: Object): XMLElementOrXMLNode; + ins(target: string, value: any): XMLElementOrXMLNode; + ins(array: Array): XMLElementOrXMLNode; + ins(obj: Object): XMLElementOrXMLNode; + a(name: any, value?: any): XMLElementOrXMLNode; + i(target: string, value: any): XMLElementOrXMLNode; + i(array: Array): XMLElementOrXMLNode; + i(obj: Object): XMLElementOrXMLNode; + toString(options?: XMLToStringOptions, level?: Number): string; + // XMLNode: + element(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + ele(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + insertBefore(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + insertAfter(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + remove(): XMLElementOrXMLNode; + node(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + text(value: string): XMLElementOrXMLNode; + cdata(value: string): XMLElementOrXMLNode; + comment(value: string): XMLElementOrXMLNode; + raw(value: string): XMLElementOrXMLNode; + declaration(version: string, encoding: string, standalone: boolean): XMLElementOrXMLNode; + doctype(pubID: string, sysID: string): XMLDocType; + up(): XMLElementOrXMLNode; + importDocument(input: XMLElementOrXMLNode): XMLElementOrXMLNode; + root(): XMLElementOrXMLNode; + document(): any; + end(options?: XMLEndOptions): string; + prev(): XMLElementOrXMLNode; + next(): XMLElementOrXMLNode; + nod(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + txt(value: string): XMLElementOrXMLNode; + dat(value: string): XMLElementOrXMLNode; + com(value: string): XMLElementOrXMLNode; + doc(): XMLElementOrXMLNode; + dec(version: string, encoding: string, standalone: boolean): XMLElementOrXMLNode; + dtd(pubID: string, sysID: string): XMLDocType; + e(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + n(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + t(value: string): XMLElementOrXMLNode; + d(value: string): XMLElementOrXMLNode; + c(value: string): XMLElementOrXMLNode; + r(value: string): XMLElementOrXMLNode; + u(): XMLElementOrXMLNode; + } + + interface XMLDec { + version?: string; + encoding?: string; + standalone?: boolean; + } + + interface XMLDtd { + pubID?: string; + sysID?: string; + } + + interface XMLStringifier { + [x: string]: ((v: any) => string) | string; + } + + interface XMLWriter { + [x: string]: ((e: XMLElementOrXMLNode, options: WriterOptions, level?: number) => void); + } + + interface XMLCreateOptions { + headless?: boolean; + keepNullNodes?: boolean; + keepNullAttributes?: boolean; + ignoreDecorators?: boolean; + separateArrayItems?: boolean; + noDoubleEncoding?: boolean; + stringify?: XMLStringifier; + } + + interface XMLToStringOptions { + pretty?: boolean; + indent?: string; + offset?: number; + newline?: string; + allowEmpty?: boolean; + spacebeforeslash?: string; + } + + interface XMLEndOptions extends XMLToStringOptions { + writer?: XMLWriter; + } + + interface WriterOptions { + pretty?: boolean; + indent?: string; + newline?: string; + offset?: number; + allowEmpty?: boolean; + dontPrettyTextNodes?: boolean; + spaceBeforeSlash?: string | boolean; + user? :any; + state?: WriterState; + } + + enum WriterState { + None = 0, + OpenTag = 1, + InsideTag = 2, + CloseTag = 3 + } + + function create(nameOrObjSpec: string | { [name: string]: Object }, xmldecOrOptions?: XMLDec | XMLCreateOptions, doctypeOrOptions?: XMLDtd | XMLCreateOptions, options?: XMLCreateOptions): XMLElementOrXMLNode; + function begin(): XMLElementOrXMLNode; +} \ No newline at end of file diff --git a/node_modules/xtend/.jshintrc b/node_modules/xtend/.jshintrc new file mode 100644 index 0000000..77887b5 --- /dev/null +++ b/node_modules/xtend/.jshintrc @@ -0,0 +1,30 @@ +{ + "maxdepth": 4, + "maxstatements": 200, + "maxcomplexity": 12, + "maxlen": 80, + "maxparams": 5, + + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": false, + "noarg": true, + "noempty": true, + "nonew": true, + "undef": true, + "unused": "vars", + "trailing": true, + + "quotmark": true, + "expr": true, + "asi": true, + + "browser": false, + "esnext": true, + "devel": false, + "node": false, + "nonstandard": false, + + "predef": ["require", "module", "__dirname", "__filename"] +} diff --git a/node_modules/xtend/LICENSE b/node_modules/xtend/LICENSE new file mode 100644 index 0000000..0099f4f --- /dev/null +++ b/node_modules/xtend/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) +Copyright (c) 2012-2014 Raynos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/xtend/README.md b/node_modules/xtend/README.md new file mode 100644 index 0000000..4a2703c --- /dev/null +++ b/node_modules/xtend/README.md @@ -0,0 +1,32 @@ +# xtend + +[![browser support][3]][4] + +[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) + +Extend like a boss + +xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. + +## Examples + +```js +var extend = require("xtend") + +// extend returns a new object. Does not mutate arguments +var combination = extend({ + a: "a", + b: "c" +}, { + b: "b" +}) +// { a: "a", b: "b" } +``` + +## Stability status: Locked + +## MIT Licensed + + + [3]: http://ci.testling.com/Raynos/xtend.png + [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/xtend/immutable.js b/node_modules/xtend/immutable.js new file mode 100644 index 0000000..94889c9 --- /dev/null +++ b/node_modules/xtend/immutable.js @@ -0,0 +1,19 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/xtend/mutable.js b/node_modules/xtend/mutable.js new file mode 100644 index 0000000..72debed --- /dev/null +++ b/node_modules/xtend/mutable.js @@ -0,0 +1,17 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json new file mode 100644 index 0000000..f7a39d1 --- /dev/null +++ b/node_modules/xtend/package.json @@ -0,0 +1,55 @@ +{ + "name": "xtend", + "version": "4.0.2", + "description": "extend like a boss", + "keywords": [ + "extend", + "merge", + "options", + "opts", + "object", + "array" + ], + "author": "Raynos ", + "repository": "git://github.com/Raynos/xtend.git", + "main": "immutable", + "scripts": { + "test": "node test" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~1.1.0" + }, + "homepage": "https://github.com/Raynos/xtend", + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Matt Esch" + } + ], + "bugs": { + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" + }, + "license": "MIT", + "testling": { + "files": "test.js", + "browsers": [ + "ie/7..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest" + ] + }, + "engines": { + "node": ">=0.4" + } +} diff --git a/node_modules/xtend/test.js b/node_modules/xtend/test.js new file mode 100644 index 0000000..b895b42 --- /dev/null +++ b/node_modules/xtend/test.js @@ -0,0 +1,103 @@ +var test = require("tape") +var extend = require("./") +var mutableExtend = require("./mutable") + +test("merge", function(assert) { + var a = { a: "foo" } + var b = { b: "bar" } + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("replace", function(assert) { + var a = { a: "foo" } + var b = { a: "bar" } + + assert.deepEqual(extend(a, b), { a: "bar" }) + assert.end() +}) + +test("undefined", function(assert) { + var a = { a: undefined } + var b = { b: "foo" } + + assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) + assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) + assert.end() +}) + +test("handle 0", function(assert) { + var a = { a: "default" } + var b = { a: 0 } + + assert.deepEqual(extend(a, b), { a: 0 }) + assert.deepEqual(extend(b, a), { a: "default" }) + assert.end() +}) + +test("is immutable", function (assert) { + var record = {} + + extend(record, { foo: "bar" }) + assert.equal(record.foo, undefined) + assert.end() +}) + +test("null as argument", function (assert) { + var a = { foo: "bar" } + var b = null + var c = void 0 + + assert.deepEqual(extend(b, a, c), { foo: "bar" }) + assert.end() +}) + +test("mutable", function (assert) { + var a = { foo: "bar" } + + mutableExtend(a, { bar: "baz" }) + + assert.equal(a.bar, "baz") + assert.end() +}) + +test("null prototype", function(assert) { + var a = { a: "foo" } + var b = Object.create(null) + b.b = "bar"; + + assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) + assert.end() +}) + +test("null prototype mutable", function (assert) { + var a = { foo: "bar" } + var b = Object.create(null) + b.bar = "baz"; + + mutableExtend(a, b) + + assert.equal(a.bar, "baz") + assert.end() +}) + +test("prototype pollution", function (assert) { + var a = {} + var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' + + assert.strictEqual(a.oops, undefined) + extend({}, maliciousPayload) + assert.strictEqual(a.oops, undefined) + assert.end() +}) + +test("prototype pollution mutable", function (assert) { + var a = {} + var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' + + assert.strictEqual(a.oops, undefined) + mutableExtend({}, maliciousPayload) + assert.strictEqual(a.oops, undefined) + assert.end() +}) diff --git a/node_modules/y18n/CHANGELOG.md b/node_modules/y18n/CHANGELOG.md new file mode 100644 index 0000000..244d838 --- /dev/null +++ b/node_modules/y18n/CHANGELOG.md @@ -0,0 +1,100 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [5.0.8](https://www.github.com/yargs/y18n/compare/v5.0.7...v5.0.8) (2021-04-07) + + +### Bug Fixes + +* **deno:** force modern release for Deno ([b1c215a](https://www.github.com/yargs/y18n/commit/b1c215aed714bee5830e76de3e335504dc2c4dab)) + +### [5.0.7](https://www.github.com/yargs/y18n/compare/v5.0.6...v5.0.7) (2021-04-07) + + +### Bug Fixes + +* **deno:** force release for deno ([#121](https://www.github.com/yargs/y18n/issues/121)) ([d3f2560](https://www.github.com/yargs/y18n/commit/d3f2560e6cedf2bfa2352e9eec044da53f9a06b2)) + +### [5.0.6](https://www.github.com/yargs/y18n/compare/v5.0.5...v5.0.6) (2021-04-05) + + +### Bug Fixes + +* **webpack:** skip readFileSync if not defined ([#117](https://www.github.com/yargs/y18n/issues/117)) ([6966fa9](https://www.github.com/yargs/y18n/commit/6966fa91d2881cc6a6c531e836099e01f4da1616)) + +### [5.0.5](https://www.github.com/yargs/y18n/compare/v5.0.4...v5.0.5) (2020-10-25) + + +### Bug Fixes + +* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/a9ac604abf756dec9687be3843e2c93bfe581f25)) + +### [5.0.4](https://www.github.com/yargs/y18n/compare/v5.0.3...v5.0.4) (2020-10-16) + + +### Bug Fixes + +* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#105](https://www.github.com/yargs/y18n/issues/105)) ([4f85d80](https://www.github.com/yargs/y18n/commit/4f85d80dbaae6d2c7899ae394f7ad97805df4886)) + +### [5.0.3](https://www.github.com/yargs/y18n/compare/v5.0.2...v5.0.3) (2020-10-16) + + +### Bug Fixes + +* **exports:** node 13.0-13.6 require a string fallback ([#103](https://www.github.com/yargs/y18n/issues/103)) ([e39921e](https://www.github.com/yargs/y18n/commit/e39921e1017f88f5d8ea97ddea854ffe92d68e74)) + +### [5.0.2](https://www.github.com/yargs/y18n/compare/v5.0.1...v5.0.2) (2020-10-01) + + +### Bug Fixes + +* **deno:** update types for deno ^1.4.0 ([#100](https://www.github.com/yargs/y18n/issues/100)) ([3834d9a](https://www.github.com/yargs/y18n/commit/3834d9ab1332f2937c935ada5e76623290efae81)) + +### [5.0.1](https://www.github.com/yargs/y18n/compare/v5.0.0...v5.0.1) (2020-09-05) + + +### Bug Fixes + +* main had old index path ([#98](https://www.github.com/yargs/y18n/issues/98)) ([124f7b0](https://www.github.com/yargs/y18n/commit/124f7b047ba9596bdbdf64459988304e77f3de1b)) + +## [5.0.0](https://www.github.com/yargs/y18n/compare/v4.0.0...v5.0.0) (2020-09-05) + + +### ⚠ BREAKING CHANGES + +* exports maps are now used, which modifies import behavior. +* drops Node 6 and 4. begin following Node.js LTS schedule (#89) + +### Features + +* add support for ESM and Deno [#95](https://www.github.com/yargs/y18n/issues/95)) ([4d7ae94](https://www.github.com/yargs/y18n/commit/4d7ae94bcb42e84164e2180366474b1cd321ed94)) + + +### Build System + +* drops Node 6 and 4. begin following Node.js LTS schedule ([#89](https://www.github.com/yargs/y18n/issues/89)) ([3cc0c28](https://www.github.com/yargs/y18n/commit/3cc0c287240727b84eaf1927f903612ec80f5e43)) + +### 4.0.1 (2020-10-25) + + +### Bug Fixes + +* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/7de58ca0d315990cdb38234e97fc66254cdbcd71)) + +## [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10) + + +### Bug Fixes + +* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123)) + + +### Features + +* **__:** added tagged template literal support ([#44](https://github.com/yargs/y18n/issues/44)) ([0598daf](https://github.com/yargs/y18n/commit/0598daf)) + + +### BREAKING CHANGES + +* **__:** dropping Node 0.10/Node 0.12 support diff --git a/node_modules/y18n/LICENSE b/node_modules/y18n/LICENSE new file mode 100644 index 0000000..3c157f0 --- /dev/null +++ b/node_modules/y18n/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/node_modules/y18n/README.md b/node_modules/y18n/README.md new file mode 100644 index 0000000..5102bb1 --- /dev/null +++ b/node_modules/y18n/README.md @@ -0,0 +1,127 @@ +# y18n + +[![NPM version][npm-image]][npm-url] +[![js-standard-style][standard-image]][standard-url] +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) + +The bare-bones internationalization library used by yargs. + +Inspired by [i18n](https://www.npmjs.com/package/i18n). + +## Examples + +_simple string translation:_ + +```js +const __ = require('y18n')().__; + +console.log(__('my awesome string %s', 'foo')); +``` + +output: + +`my awesome string foo` + +_using tagged template literals_ + +```js +const __ = require('y18n')().__; + +const str = 'foo'; + +console.log(__`my awesome string ${str}`); +``` + +output: + +`my awesome string foo` + +_pluralization support:_ + +```js +const __n = require('y18n')().__n; + +console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')); +``` + +output: + +`2 fishes foo` + +## Deno Example + +As of `v5` `y18n` supports [Deno](https://github.com/denoland/deno): + +```typescript +import y18n from "https://deno.land/x/y18n/deno.ts"; + +const __ = y18n({ + locale: 'pirate', + directory: './test/locales' +}).__ + +console.info(__`Hi, ${'Ben'} ${'Coe'}!`) +``` + +You will need to run with `--allow-read` to load alternative locales. + +## JSON Language Files + +The JSON language files should be stored in a `./locales` folder. +File names correspond to locales, e.g., `en.json`, `pirate.json`. + +When strings are observed for the first time they will be +added to the JSON file corresponding to the current locale. + +## Methods + +### require('y18n')(config) + +Create an instance of y18n with the config provided, options include: + +* `directory`: the locale directory, default `./locales`. +* `updateFiles`: should newly observed strings be updated in file, default `true`. +* `locale`: what locale should be used. +* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) + be allowed if a file matching the locale does not exist (e.g. `en_US.json`), + default `true`. + +### y18n.\_\_(str, arg, arg, arg) + +Print a localized string, `%s` will be replaced with `arg`s. + +This function can also be used as a tag for a template literal. You can use it +like this: __`hello ${'world'}`. This will be equivalent to +`__('hello %s', 'world')`. + +### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) + +Print a localized string with appropriate pluralization. If `%d` is provided +in the string, the `count` will replace this placeholder. + +### y18n.setLocale(str) + +Set the current locale being used. + +### y18n.getLocale() + +What locale is currently being used? + +### y18n.updateLocale(obj) + +Update the current locale with the key value pairs in `obj`. + +## Supported Node.js Versions + +Libraries in this ecosystem make a best effort to track +[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a +post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). + +## License + +ISC + +[npm-url]: https://npmjs.org/package/y18n +[npm-image]: https://img.shields.io/npm/v/y18n.svg +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg +[standard-url]: https://github.com/feross/standard diff --git a/node_modules/y18n/build/index.cjs b/node_modules/y18n/build/index.cjs new file mode 100644 index 0000000..b2731e1 --- /dev/null +++ b/node_modules/y18n/build/index.cjs @@ -0,0 +1,203 @@ +'use strict'; + +var fs = require('fs'); +var util = require('util'); +var path = require('path'); + +let shim; +class Y18N { + constructor(opts) { + // configurable options. + opts = opts || {}; + this.directory = opts.directory || './locales'; + this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true; + this.locale = opts.locale || 'en'; + this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true; + // internal stuff. + this.cache = Object.create(null); + this.writeQueue = []; + } + __(...args) { + if (typeof arguments[0] !== 'string') { + return this._taggedLiteral(arguments[0], ...arguments); + } + const str = args.shift(); + let cb = function () { }; // start with noop. + if (typeof args[args.length - 1] === 'function') + cb = args.pop(); + cb = cb || function () { }; // noop. + if (!this.cache[this.locale]) + this._readLocaleFile(); + // we've observed a new string, update the language file. + if (!this.cache[this.locale][str] && this.updateFiles) { + this.cache[this.locale][str] = str; + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite({ + directory: this.directory, + locale: this.locale, + cb + }); + } + else { + cb(); + } + return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args)); + } + __n() { + const args = Array.prototype.slice.call(arguments); + const singular = args.shift(); + const plural = args.shift(); + const quantity = args.shift(); + let cb = function () { }; // start with noop. + if (typeof args[args.length - 1] === 'function') + cb = args.pop(); + if (!this.cache[this.locale]) + this._readLocaleFile(); + let str = quantity === 1 ? singular : plural; + if (this.cache[this.locale][singular]) { + const entry = this.cache[this.locale][singular]; + str = entry[quantity === 1 ? 'one' : 'other']; + } + // we've observed a new string, update the language file. + if (!this.cache[this.locale][singular] && this.updateFiles) { + this.cache[this.locale][singular] = { + one: singular, + other: plural + }; + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite({ + directory: this.directory, + locale: this.locale, + cb + }); + } + else { + cb(); + } + // if a %d placeholder is provided, add quantity + // to the arguments expanded by util.format. + const values = [str]; + if (~str.indexOf('%d')) + values.push(quantity); + return shim.format.apply(shim.format, values.concat(args)); + } + setLocale(locale) { + this.locale = locale; + } + getLocale() { + return this.locale; + } + updateLocale(obj) { + if (!this.cache[this.locale]) + this._readLocaleFile(); + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + this.cache[this.locale][key] = obj[key]; + } + } + } + _taggedLiteral(parts, ...args) { + let str = ''; + parts.forEach(function (part, i) { + const arg = args[i + 1]; + str += part; + if (typeof arg !== 'undefined') { + str += '%s'; + } + }); + return this.__.apply(this, [str].concat([].slice.call(args, 1))); + } + _enqueueWrite(work) { + this.writeQueue.push(work); + if (this.writeQueue.length === 1) + this._processWriteQueue(); + } + _processWriteQueue() { + const _this = this; + const work = this.writeQueue[0]; + // destructure the enqueued work. + const directory = work.directory; + const locale = work.locale; + const cb = work.cb; + const languageFile = this._resolveLocaleFile(directory, locale); + const serializedLocale = JSON.stringify(this.cache[locale], null, 2); + shim.fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) { + _this.writeQueue.shift(); + if (_this.writeQueue.length > 0) + _this._processWriteQueue(); + cb(err); + }); + } + _readLocaleFile() { + let localeLookup = {}; + const languageFile = this._resolveLocaleFile(this.directory, this.locale); + try { + // When using a bundler such as webpack, readFileSync may not be defined: + if (shim.fs.readFileSync) { + localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, 'utf-8')); + } + } + catch (err) { + if (err instanceof SyntaxError) { + err.message = 'syntax error in ' + languageFile; + } + if (err.code === 'ENOENT') + localeLookup = {}; + else + throw err; + } + this.cache[this.locale] = localeLookup; + } + _resolveLocaleFile(directory, locale) { + let file = shim.resolve(directory, './', locale + '.json'); + if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) { + // attempt fallback to language only + const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json'); + if (this._fileExistsSync(languageFile)) + file = languageFile; + } + return file; + } + _fileExistsSync(file) { + return shim.exists(file); + } +} +function y18n$1(opts, _shim) { + shim = _shim; + const y18n = new Y18N(opts); + return { + __: y18n.__.bind(y18n), + __n: y18n.__n.bind(y18n), + setLocale: y18n.setLocale.bind(y18n), + getLocale: y18n.getLocale.bind(y18n), + updateLocale: y18n.updateLocale.bind(y18n), + locale: y18n.locale + }; +} + +var nodePlatformShim = { + fs: { + readFileSync: fs.readFileSync, + writeFile: fs.writeFile + }, + format: util.format, + resolve: path.resolve, + exists: (file) => { + try { + return fs.statSync(file).isFile(); + } + catch (err) { + return false; + } + } +}; + +const y18n = (opts) => { + return y18n$1(opts, nodePlatformShim); +}; + +module.exports = y18n; diff --git a/node_modules/y18n/build/lib/cjs.js b/node_modules/y18n/build/lib/cjs.js new file mode 100644 index 0000000..ff58470 --- /dev/null +++ b/node_modules/y18n/build/lib/cjs.js @@ -0,0 +1,6 @@ +import { y18n as _y18n } from './index.js'; +import nodePlatformShim from './platform-shims/node.js'; +const y18n = (opts) => { + return _y18n(opts, nodePlatformShim); +}; +export default y18n; diff --git a/node_modules/y18n/build/lib/index.js b/node_modules/y18n/build/lib/index.js new file mode 100644 index 0000000..e38f335 --- /dev/null +++ b/node_modules/y18n/build/lib/index.js @@ -0,0 +1,174 @@ +let shim; +class Y18N { + constructor(opts) { + // configurable options. + opts = opts || {}; + this.directory = opts.directory || './locales'; + this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true; + this.locale = opts.locale || 'en'; + this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true; + // internal stuff. + this.cache = Object.create(null); + this.writeQueue = []; + } + __(...args) { + if (typeof arguments[0] !== 'string') { + return this._taggedLiteral(arguments[0], ...arguments); + } + const str = args.shift(); + let cb = function () { }; // start with noop. + if (typeof args[args.length - 1] === 'function') + cb = args.pop(); + cb = cb || function () { }; // noop. + if (!this.cache[this.locale]) + this._readLocaleFile(); + // we've observed a new string, update the language file. + if (!this.cache[this.locale][str] && this.updateFiles) { + this.cache[this.locale][str] = str; + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite({ + directory: this.directory, + locale: this.locale, + cb + }); + } + else { + cb(); + } + return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args)); + } + __n() { + const args = Array.prototype.slice.call(arguments); + const singular = args.shift(); + const plural = args.shift(); + const quantity = args.shift(); + let cb = function () { }; // start with noop. + if (typeof args[args.length - 1] === 'function') + cb = args.pop(); + if (!this.cache[this.locale]) + this._readLocaleFile(); + let str = quantity === 1 ? singular : plural; + if (this.cache[this.locale][singular]) { + const entry = this.cache[this.locale][singular]; + str = entry[quantity === 1 ? 'one' : 'other']; + } + // we've observed a new string, update the language file. + if (!this.cache[this.locale][singular] && this.updateFiles) { + this.cache[this.locale][singular] = { + one: singular, + other: plural + }; + // include the current directory and locale, + // since these values could change before the + // write is performed. + this._enqueueWrite({ + directory: this.directory, + locale: this.locale, + cb + }); + } + else { + cb(); + } + // if a %d placeholder is provided, add quantity + // to the arguments expanded by util.format. + const values = [str]; + if (~str.indexOf('%d')) + values.push(quantity); + return shim.format.apply(shim.format, values.concat(args)); + } + setLocale(locale) { + this.locale = locale; + } + getLocale() { + return this.locale; + } + updateLocale(obj) { + if (!this.cache[this.locale]) + this._readLocaleFile(); + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + this.cache[this.locale][key] = obj[key]; + } + } + } + _taggedLiteral(parts, ...args) { + let str = ''; + parts.forEach(function (part, i) { + const arg = args[i + 1]; + str += part; + if (typeof arg !== 'undefined') { + str += '%s'; + } + }); + return this.__.apply(this, [str].concat([].slice.call(args, 1))); + } + _enqueueWrite(work) { + this.writeQueue.push(work); + if (this.writeQueue.length === 1) + this._processWriteQueue(); + } + _processWriteQueue() { + const _this = this; + const work = this.writeQueue[0]; + // destructure the enqueued work. + const directory = work.directory; + const locale = work.locale; + const cb = work.cb; + const languageFile = this._resolveLocaleFile(directory, locale); + const serializedLocale = JSON.stringify(this.cache[locale], null, 2); + shim.fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) { + _this.writeQueue.shift(); + if (_this.writeQueue.length > 0) + _this._processWriteQueue(); + cb(err); + }); + } + _readLocaleFile() { + let localeLookup = {}; + const languageFile = this._resolveLocaleFile(this.directory, this.locale); + try { + // When using a bundler such as webpack, readFileSync may not be defined: + if (shim.fs.readFileSync) { + localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, 'utf-8')); + } + } + catch (err) { + if (err instanceof SyntaxError) { + err.message = 'syntax error in ' + languageFile; + } + if (err.code === 'ENOENT') + localeLookup = {}; + else + throw err; + } + this.cache[this.locale] = localeLookup; + } + _resolveLocaleFile(directory, locale) { + let file = shim.resolve(directory, './', locale + '.json'); + if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) { + // attempt fallback to language only + const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json'); + if (this._fileExistsSync(languageFile)) + file = languageFile; + } + return file; + } + _fileExistsSync(file) { + return shim.exists(file); + } +} +export function y18n(opts, _shim) { + shim = _shim; + const y18n = new Y18N(opts); + return { + __: y18n.__.bind(y18n), + __n: y18n.__n.bind(y18n), + setLocale: y18n.setLocale.bind(y18n), + getLocale: y18n.getLocale.bind(y18n), + updateLocale: y18n.updateLocale.bind(y18n), + locale: y18n.locale + }; +} diff --git a/node_modules/y18n/build/lib/platform-shims/node.js b/node_modules/y18n/build/lib/platform-shims/node.js new file mode 100644 index 0000000..181208b --- /dev/null +++ b/node_modules/y18n/build/lib/platform-shims/node.js @@ -0,0 +1,19 @@ +import { readFileSync, statSync, writeFile } from 'fs'; +import { format } from 'util'; +import { resolve } from 'path'; +export default { + fs: { + readFileSync, + writeFile + }, + format, + resolve, + exists: (file) => { + try { + return statSync(file).isFile(); + } + catch (err) { + return false; + } + } +}; diff --git a/node_modules/y18n/index.mjs b/node_modules/y18n/index.mjs new file mode 100644 index 0000000..46c8213 --- /dev/null +++ b/node_modules/y18n/index.mjs @@ -0,0 +1,8 @@ +import shim from './build/lib/platform-shims/node.js' +import { y18n as _y18n } from './build/lib/index.js' + +const y18n = (opts) => { + return _y18n(opts, shim) +} + +export default y18n diff --git a/node_modules/y18n/package.json b/node_modules/y18n/package.json new file mode 100644 index 0000000..4e5c1ca --- /dev/null +++ b/node_modules/y18n/package.json @@ -0,0 +1,70 @@ +{ + "name": "y18n", + "version": "5.0.8", + "description": "the bare-bones internationalization library used by yargs", + "exports": { + ".": [ + { + "import": "./index.mjs", + "require": "./build/index.cjs" + }, + "./build/index.cjs" + ] + }, + "type": "module", + "module": "./build/lib/index.js", + "keywords": [ + "i18n", + "internationalization", + "yargs" + ], + "homepage": "https://github.com/yargs/y18n", + "bugs": { + "url": "https://github.com/yargs/y18n/issues" + }, + "repository": "yargs/y18n", + "license": "ISC", + "author": "Ben Coe ", + "main": "./build/index.cjs", + "scripts": { + "check": "standardx **/*.ts **/*.cjs **/*.mjs", + "fix": "standardx --fix **/*.ts **/*.cjs **/*.mjs", + "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", + "test": "c8 --reporter=text --reporter=html mocha test/*.cjs", + "test:esm": "c8 --reporter=text --reporter=html mocha test/esm/*.mjs", + "posttest": "npm run check", + "coverage": "c8 report --check-coverage", + "precompile": "rimraf build", + "compile": "tsc", + "postcompile": "npm run build:cjs", + "build:cjs": "rollup -c", + "prepare": "npm run compile" + }, + "devDependencies": { + "@types/node": "^14.6.4", + "@wessberg/rollup-plugin-ts": "^1.3.1", + "c8": "^7.3.0", + "chai": "^4.0.1", + "cross-env": "^7.0.2", + "gts": "^3.0.0", + "mocha": "^8.0.0", + "rimraf": "^3.0.2", + "rollup": "^2.26.10", + "standardx": "^7.0.0", + "ts-transform-default-export": "^1.0.2", + "typescript": "^4.0.0" + }, + "files": [ + "build", + "index.mjs", + "!*.d.ts" + ], + "engines": { + "node": ">=10" + }, + "standardx": { + "ignore": [ + "build" + ] + } +} diff --git a/node_modules/yallist/LICENSE b/node_modules/yallist/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/node_modules/yallist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/yallist/README.md b/node_modules/yallist/README.md new file mode 100644 index 0000000..f586101 --- /dev/null +++ b/node_modules/yallist/README.md @@ -0,0 +1,204 @@ +# yallist + +Yet Another Linked List + +There are many doubly-linked list implementations like it, but this +one is mine. + +For when an array would be too big, and a Map can't be iterated in +reverse order. + + +[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) + +## basic usage + +```javascript +var yallist = require('yallist') +var myList = yallist.create([1, 2, 3]) +myList.push('foo') +myList.unshift('bar') +// of course pop() and shift() are there, too +console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] +myList.forEach(function (k) { + // walk the list head to tail +}) +myList.forEachReverse(function (k, index, list) { + // walk the list tail to head +}) +var myDoubledList = myList.map(function (k) { + return k + k +}) +// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] +// mapReverse is also a thing +var myDoubledListReverse = myList.mapReverse(function (k) { + return k + k +}) // ['foofoo', 6, 4, 2, 'barbar'] + +var reduced = myList.reduce(function (set, entry) { + set += entry + return set +}, 'start') +console.log(reduced) // 'startfoo123bar' +``` + +## api + +The whole API is considered "public". + +Functions with the same name as an Array method work more or less the +same way. + +There's reverse versions of most things because that's the point. + +### Yallist + +Default export, the class that holds and manages a list. + +Call it with either a forEach-able (like an array) or a set of +arguments, to initialize the list. + +The Array-ish methods all act like you'd expect. No magic length, +though, so if you change that it won't automatically prune or add +empty spots. + +### Yallist.create(..) + +Alias for Yallist function. Some people like factories. + +#### yallist.head + +The first node in the list + +#### yallist.tail + +The last node in the list + +#### yallist.length + +The number of nodes in the list. (Change this at your peril. It is +not magic like Array length.) + +#### yallist.toArray() + +Convert the list to an array. + +#### yallist.forEach(fn, [thisp]) + +Call a function on each item in the list. + +#### yallist.forEachReverse(fn, [thisp]) + +Call a function on each item in the list, in reverse order. + +#### yallist.get(n) + +Get the data at position `n` in the list. If you use this a lot, +probably better off just using an Array. + +#### yallist.getReverse(n) + +Get the data at position `n`, counting from the tail. + +#### yallist.map(fn, thisp) + +Create a new Yallist with the result of calling the function on each +item. + +#### yallist.mapReverse(fn, thisp) + +Same as `map`, but in reverse. + +#### yallist.pop() + +Get the data from the list tail, and remove the tail from the list. + +#### yallist.push(item, ...) + +Insert one or more items to the tail of the list. + +#### yallist.reduce(fn, initialValue) + +Like Array.reduce. + +#### yallist.reduceReverse + +Like Array.reduce, but in reverse. + +#### yallist.reverse + +Reverse the list in place. + +#### yallist.shift() + +Get the data from the list head, and remove the head from the list. + +#### yallist.slice([from], [to]) + +Just like Array.slice, but returns a new Yallist. + +#### yallist.sliceReverse([from], [to]) + +Just like yallist.slice, but the result is returned in reverse. + +#### yallist.toArray() + +Create an array representation of the list. + +#### yallist.toArrayReverse() + +Create a reversed array representation of the list. + +#### yallist.unshift(item, ...) + +Insert one or more items to the head of the list. + +#### yallist.unshiftNode(node) + +Move a Node object to the front of the list. (That is, pull it out of +wherever it lives, and make it the new head.) + +If the node belongs to a different list, then that list will remove it +first. + +#### yallist.pushNode(node) + +Move a Node object to the end of the list. (That is, pull it out of +wherever it lives, and make it the new tail.) + +If the node belongs to a list already, then that list will remove it +first. + +#### yallist.removeNode(node) + +Remove a node from the list, preserving referential integrity of head +and tail and other nodes. + +Will throw an error if you try to have a list remove a node that +doesn't belong to it. + +### Yallist.Node + +The class that holds the data and is actually the list. + +Call with `var n = new Node(value, previousNode, nextNode)` + +Note that if you do direct operations on Nodes themselves, it's very +easy to get into weird states where the list is broken. Be careful :) + +#### node.next + +The next node in the list. + +#### node.prev + +The previous node in the list. + +#### node.value + +The data the node contains. + +#### node.list + +The list to which this node belongs. (Null if it does not belong to +any list.) diff --git a/node_modules/yallist/iterator.js b/node_modules/yallist/iterator.js new file mode 100644 index 0000000..d41c97a --- /dev/null +++ b/node_modules/yallist/iterator.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} diff --git a/node_modules/yallist/package.json b/node_modules/yallist/package.json new file mode 100644 index 0000000..2712809 --- /dev/null +++ b/node_modules/yallist/package.json @@ -0,0 +1,29 @@ +{ + "name": "yallist", + "version": "3.1.1", + "description": "Yet Another Linked List", + "main": "yallist.js", + "directories": { + "test": "test" + }, + "files": [ + "yallist.js", + "iterator.js" + ], + "dependencies": {}, + "devDependencies": { + "tap": "^12.1.0" + }, + "scripts": { + "test": "tap test/*.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/node_modules/yallist/yallist.js b/node_modules/yallist/yallist.js new file mode 100644 index 0000000..ed4e730 --- /dev/null +++ b/node_modules/yallist/yallist.js @@ -0,0 +1,426 @@ +'use strict' +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null + + return next +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.splice = function (start, deleteCount /*, ...nodes */) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 2; i < arguments.length; i++) { + walker = insert(this, walker, arguments[i]) + } + return ret; +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + require('./iterator.js')(Yallist) +} catch (er) {} diff --git a/node_modules/yargs-parser/CHANGELOG.md b/node_modules/yargs-parser/CHANGELOG.md new file mode 100644 index 0000000..584eb86 --- /dev/null +++ b/node_modules/yargs-parser/CHANGELOG.md @@ -0,0 +1,308 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [21.1.1](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.1.0...yargs-parser-v21.1.1) (2022-08-04) + + +### Bug Fixes + +* **typescript:** ignore .cts files during publish ([#454](https://github.com/yargs/yargs-parser/issues/454)) ([d69f9c3](https://github.com/yargs/yargs-parser/commit/d69f9c3a91c3ad2f9494d0a94e29a8b76c41b81b)), closes [#452](https://github.com/yargs/yargs-parser/issues/452) + +## [21.1.0](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.0.1...yargs-parser-v21.1.0) (2022-08-03) + + +### Features + +* allow the browser build to be imported ([#443](https://github.com/yargs/yargs-parser/issues/443)) ([a89259f](https://github.com/yargs/yargs-parser/commit/a89259ff41d6f5312b3ce8a30bef343a993f395a)) + + +### Bug Fixes + +* **halt-at-non-option:** prevent known args from being parsed when "unknown-options-as-args" is enabled ([#438](https://github.com/yargs/yargs-parser/issues/438)) ([c474bc1](https://github.com/yargs/yargs-parser/commit/c474bc10c3aa0ae864b95e5722730114ef15f573)) +* node version check now uses process.versions.node ([#450](https://github.com/yargs/yargs-parser/issues/450)) ([d07bcdb](https://github.com/yargs/yargs-parser/commit/d07bcdbe43075f7201fbe8a08e491217247fe1f1)) +* parse options ending with 3+ hyphens ([#434](https://github.com/yargs/yargs-parser/issues/434)) ([4f1060b](https://github.com/yargs/yargs-parser/commit/4f1060b50759fadbac3315c5117b0c3d65b0a7d8)) + +### [21.0.1](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.0.0...yargs-parser-v21.0.1) (2022-02-27) + + +### Bug Fixes + +* return deno env object ([#432](https://github.com/yargs/yargs-parser/issues/432)) ([b00eb87](https://github.com/yargs/yargs-parser/commit/b00eb87b4860a890dd2dab0d6058241bbfd2b3ec)) + +## [21.0.0](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.9...yargs-parser-v21.0.0) (2021-11-15) + + +### ⚠ BREAKING CHANGES + +* drops support for 10 (#421) + +### Bug Fixes + +* esm json import ([#416](https://www.github.com/yargs/yargs-parser/issues/416)) ([90f970a](https://www.github.com/yargs/yargs-parser/commit/90f970a6482dd4f5b5eb18d38596dd6f02d73edf)) +* parser should preserve inner quotes ([#407](https://www.github.com/yargs/yargs-parser/issues/407)) ([ae11f49](https://www.github.com/yargs/yargs-parser/commit/ae11f496a8318ea8885aa25015d429b33713c314)) + + +### Code Refactoring + +* drops support for 10 ([#421](https://www.github.com/yargs/yargs-parser/issues/421)) ([3aaf878](https://www.github.com/yargs/yargs-parser/commit/3aaf8784f5c7f2aec6108c1c6a55537fa7e3b5c1)) + +### [20.2.9](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.8...yargs-parser-v20.2.9) (2021-06-20) + + +### Bug Fixes + +* **build:** fixed automated release pipeline ([1fe9135](https://www.github.com/yargs/yargs-parser/commit/1fe9135884790a083615419b2861683e2597dac3)) + +### [20.2.8](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.7...yargs-parser-v20.2.8) (2021-06-20) + + +### Bug Fixes + +* **locale:** Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase ([2617303](https://www.github.com/yargs/yargs-parser/commit/261730383e02448562f737b94bbd1f164aed5143)) +* **perf:** address slow parse when using unknown-options-as-args ([#394](https://www.github.com/yargs/yargs-parser/issues/394)) ([441f059](https://www.github.com/yargs/yargs-parser/commit/441f059d585d446551068ad213db79ac91daf83a)) +* **string-utils:** detect [0,1] ranged values as numbers ([#388](https://www.github.com/yargs/yargs-parser/issues/388)) ([efcc32c](https://www.github.com/yargs/yargs-parser/commit/efcc32c2d6b09aba31abfa2db9bd947befe5586b)) + +### [20.2.7](https://www.github.com/yargs/yargs-parser/compare/v20.2.6...v20.2.7) (2021-03-10) + + +### Bug Fixes + +* **deno:** force release for Deno ([6687c97](https://www.github.com/yargs/yargs-parser/commit/6687c972d0f3ca7865a97908dde3080b05f8b026)) + +### [20.2.6](https://www.github.com/yargs/yargs-parser/compare/v20.2.5...v20.2.6) (2021-02-22) + + +### Bug Fixes + +* **populate--:** -- should always be array ([#354](https://www.github.com/yargs/yargs-parser/issues/354)) ([585ae8f](https://www.github.com/yargs/yargs-parser/commit/585ae8ffad74cc02974f92d788e750137fd65146)) + +### [20.2.5](https://www.github.com/yargs/yargs-parser/compare/v20.2.4...v20.2.5) (2021-02-13) + + +### Bug Fixes + +* do not lowercase camel cased string ([#348](https://www.github.com/yargs/yargs-parser/issues/348)) ([5f4da1f](https://www.github.com/yargs/yargs-parser/commit/5f4da1f17d9d50542d2aaa206c9806ce3e320335)) + +### [20.2.4](https://www.github.com/yargs/yargs-parser/compare/v20.2.3...v20.2.4) (2020-11-09) + + +### Bug Fixes + +* **deno:** address import issues in Deno ([#339](https://www.github.com/yargs/yargs-parser/issues/339)) ([3b54e5e](https://www.github.com/yargs/yargs-parser/commit/3b54e5eef6e9a7b7c6eec7c12bab3ba3b8ba8306)) + +### [20.2.3](https://www.github.com/yargs/yargs-parser/compare/v20.2.2...v20.2.3) (2020-10-16) + + +### Bug Fixes + +* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#336](https://www.github.com/yargs/yargs-parser/issues/336)) ([3ae7242](https://www.github.com/yargs/yargs-parser/commit/3ae7242040ff876d28dabded60ac226e00150c88)) + +### [20.2.2](https://www.github.com/yargs/yargs-parser/compare/v20.2.1...v20.2.2) (2020-10-14) + + +### Bug Fixes + +* **exports:** node 13.0-13.6 require a string fallback ([#333](https://www.github.com/yargs/yargs-parser/issues/333)) ([291aeda](https://www.github.com/yargs/yargs-parser/commit/291aeda06b685b7a015d83bdf2558e180b37388d)) + +### [20.2.1](https://www.github.com/yargs/yargs-parser/compare/v20.2.0...v20.2.1) (2020-10-01) + + +### Bug Fixes + +* **deno:** update types for deno ^1.4.0 ([#330](https://www.github.com/yargs/yargs-parser/issues/330)) ([0ab92e5](https://www.github.com/yargs/yargs-parser/commit/0ab92e50b090f11196334c048c9c92cecaddaf56)) + +## [20.2.0](https://www.github.com/yargs/yargs-parser/compare/v20.1.0...v20.2.0) (2020-09-21) + + +### Features + +* **string-utils:** export looksLikeNumber helper ([#324](https://www.github.com/yargs/yargs-parser/issues/324)) ([c8580a2](https://www.github.com/yargs/yargs-parser/commit/c8580a2327b55f6342acecb6e72b62963d506750)) + + +### Bug Fixes + +* **unknown-options-as-args:** convert positionals that look like numbers ([#326](https://www.github.com/yargs/yargs-parser/issues/326)) ([f85ebb4](https://www.github.com/yargs/yargs-parser/commit/f85ebb4face9d4b0f56147659404cbe0002f3dad)) + +## [20.1.0](https://www.github.com/yargs/yargs-parser/compare/v20.0.0...v20.1.0) (2020-09-20) + + +### Features + +* adds parse-positional-numbers configuration ([#321](https://www.github.com/yargs/yargs-parser/issues/321)) ([9cec00a](https://www.github.com/yargs/yargs-parser/commit/9cec00a622251292ffb7dce6f78f5353afaa0d4c)) + + +### Bug Fixes + +* **build:** update release-please; make labels kick off builds ([#323](https://www.github.com/yargs/yargs-parser/issues/323)) ([09f448b](https://www.github.com/yargs/yargs-parser/commit/09f448b4cd66e25d2872544718df46dab8af062a)) + +## [20.0.0](https://www.github.com/yargs/yargs-parser/compare/v19.0.4...v20.0.0) (2020-09-09) + + +### ⚠ BREAKING CHANGES + +* do not ship type definitions (#318) + +### Bug Fixes + +* only strip camel case if hyphenated ([#316](https://www.github.com/yargs/yargs-parser/issues/316)) ([95a9e78](https://www.github.com/yargs/yargs-parser/commit/95a9e785127b9bbf2d1db1f1f808ca1fb100e82a)), closes [#315](https://www.github.com/yargs/yargs-parser/issues/315) + + +### Code Refactoring + +* do not ship type definitions ([#318](https://www.github.com/yargs/yargs-parser/issues/318)) ([8fbd56f](https://www.github.com/yargs/yargs-parser/commit/8fbd56f1d0b6c44c30fca62708812151ca0ce330)) + +### [19.0.4](https://www.github.com/yargs/yargs-parser/compare/v19.0.3...v19.0.4) (2020-08-27) + + +### Bug Fixes + +* **build:** fixing publication ([#310](https://www.github.com/yargs/yargs-parser/issues/310)) ([5d3c6c2](https://www.github.com/yargs/yargs-parser/commit/5d3c6c29a9126248ba601920d9cf87c78e161ff5)) + +### [19.0.3](https://www.github.com/yargs/yargs-parser/compare/v19.0.2...v19.0.3) (2020-08-27) + + +### Bug Fixes + +* **build:** switch to action for publish ([#308](https://www.github.com/yargs/yargs-parser/issues/308)) ([5c2f305](https://www.github.com/yargs/yargs-parser/commit/5c2f30585342bcd8aaf926407c863099d256d174)) + +### [19.0.2](https://www.github.com/yargs/yargs-parser/compare/v19.0.1...v19.0.2) (2020-08-27) + + +### Bug Fixes + +* **types:** envPrefix should be optional ([#305](https://www.github.com/yargs/yargs-parser/issues/305)) ([ae3f180](https://www.github.com/yargs/yargs-parser/commit/ae3f180e14df2de2fd962145f4518f9aa0e76523)) + +### [19.0.1](https://www.github.com/yargs/yargs-parser/compare/v19.0.0...v19.0.1) (2020-08-09) + + +### Bug Fixes + +* **build:** push tag created for deno ([2186a14](https://www.github.com/yargs/yargs-parser/commit/2186a14989749887d56189867602e39e6679f8b0)) + +## [19.0.0](https://www.github.com/yargs/yargs-parser/compare/v18.1.3...v19.0.0) (2020-08-09) + + +### ⚠ BREAKING CHANGES + +* adds support for ESM and Deno (#295) +* **ts:** projects using `@types/yargs-parser` may see variations in type definitions. +* drops Node 6. begin following Node.js LTS schedule (#278) + +### Features + +* adds support for ESM and Deno ([#295](https://www.github.com/yargs/yargs-parser/issues/295)) ([195bc4a](https://www.github.com/yargs/yargs-parser/commit/195bc4a7f20c2a8f8e33fbb6ba96ef6e9a0120a1)) +* expose camelCase and decamelize helpers ([#296](https://www.github.com/yargs/yargs-parser/issues/296)) ([39154ce](https://www.github.com/yargs/yargs-parser/commit/39154ceb5bdcf76b5f59a9219b34cedb79b67f26)) +* **deps:** update to latest camelcase/decamelize ([#281](https://www.github.com/yargs/yargs-parser/issues/281)) ([8931ab0](https://www.github.com/yargs/yargs-parser/commit/8931ab08f686cc55286f33a95a83537da2be5516)) + + +### Bug Fixes + +* boolean numeric short option ([#294](https://www.github.com/yargs/yargs-parser/issues/294)) ([f600082](https://www.github.com/yargs/yargs-parser/commit/f600082c959e092076caf420bbbc9d7a231e2418)) +* raise permission error for Deno if config load fails ([#298](https://www.github.com/yargs/yargs-parser/issues/298)) ([1174e2b](https://www.github.com/yargs/yargs-parser/commit/1174e2b3f0c845a1cd64e14ffc3703e730567a84)) +* **deps:** update dependency decamelize to v3 ([#274](https://www.github.com/yargs/yargs-parser/issues/274)) ([4d98698](https://www.github.com/yargs/yargs-parser/commit/4d98698bc6767e84ec54a0842908191739be73b7)) +* **types:** switch back to using Partial types ([#293](https://www.github.com/yargs/yargs-parser/issues/293)) ([bdc80ba](https://www.github.com/yargs/yargs-parser/commit/bdc80ba59fa13bc3025ce0a85e8bad9f9da24ea7)) + + +### Build System + +* drops Node 6. begin following Node.js LTS schedule ([#278](https://www.github.com/yargs/yargs-parser/issues/278)) ([9014ed7](https://www.github.com/yargs/yargs-parser/commit/9014ed722a32768b96b829e65a31705db5c1458a)) + + +### Code Refactoring + +* **ts:** move index.js to TypeScript ([#292](https://www.github.com/yargs/yargs-parser/issues/292)) ([f78d2b9](https://www.github.com/yargs/yargs-parser/commit/f78d2b97567ac4828624406e420b4047c710b789)) + +### [18.1.3](https://www.github.com/yargs/yargs-parser/compare/v18.1.2...v18.1.3) (2020-04-16) + + +### Bug Fixes + +* **setArg:** options using camel-case and dot-notation populated twice ([#268](https://www.github.com/yargs/yargs-parser/issues/268)) ([f7e15b9](https://www.github.com/yargs/yargs-parser/commit/f7e15b9800900b9856acac1a830a5f35847be73e)) + +### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26) + + +### Bug Fixes + +* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13)) + +### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16) + + +### Bug Fixes + +* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential +prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2)) + +## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07) + + +### Features + +* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f)) + +## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02) + + +### ⚠ BREAKING CHANGES + +* the narg count is now enforced when parsing arrays. + +### Features + +* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c)) + +## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01) + + +### Features + +* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb)) + +### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29) + + +### Bug Fixes + +* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba)) + +## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10) + + +### ⚠ BREAKING CHANGES + +* this reverts parsing behavior of booleans to that of yargs@14 +* objects used during parsing are now created with a null +prototype. There may be some scenarios where this change in behavior +leaks externally. + +### Features + +* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5)) +* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732)) + + +### Bug Fixes + +* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346)) +* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c)) +* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de)) +* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5)) + +## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01) + + +### ⚠ BREAKING CHANGES + +* populate error if incompatible narg/count or array/count options are used (#191) + +### Features + +* options that have had their default value used are now tracked ([#211](https://www.github.com/yargs/yargs-parser/issues/211)) ([a525234](https://www.github.com/yargs/yargs-parser/commit/a525234558c847deedd73f8792e0a3b77b26e2c0)) +* populate error if incompatible narg/count or array/count options are used ([#191](https://www.github.com/yargs/yargs-parser/issues/191)) ([84a401f](https://www.github.com/yargs/yargs-parser/commit/84a401f0fa3095e0a19661670d1570d0c3b9d3c9)) + + +### Reverts + +* revert 16.0.0 CHANGELOG entry ([920320a](https://www.github.com/yargs/yargs-parser/commit/920320ad9861bbfd58eda39221ae211540fc1daf)) diff --git a/node_modules/yargs-parser/LICENSE.txt b/node_modules/yargs-parser/LICENSE.txt new file mode 100644 index 0000000..836440b --- /dev/null +++ b/node_modules/yargs-parser/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/yargs-parser/README.md b/node_modules/yargs-parser/README.md new file mode 100644 index 0000000..2614840 --- /dev/null +++ b/node_modules/yargs-parser/README.md @@ -0,0 +1,518 @@ +# yargs-parser + +![ci](https://github.com/yargs/yargs-parser/workflows/ci/badge.svg) +[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) +![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/yargs-parser) + +The mighty option parser used by [yargs](https://github.com/yargs/yargs). + +visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions. + + + +## Example + +```sh +npm i yargs-parser --save +``` + +```js +const argv = require('yargs-parser')(process.argv.slice(2)) +console.log(argv) +``` + +```console +$ node example.js --foo=33 --bar hello +{ _: [], foo: 33, bar: 'hello' } +``` + +_or parse a string!_ + +```js +const argv = require('yargs-parser')('--foo=99 --bar=33') +console.log(argv) +``` + +```console +{ _: [], foo: 99, bar: 33 } +``` + +Convert an array of mixed types before passing to `yargs-parser`: + +```js +const parse = require('yargs-parser') +parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string +parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings +``` + +## Deno Example + +As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno): + +```typescript +import parser from "https://deno.land/x/yargs_parser/deno.ts"; + +const argv = parser('--foo=99 --bar=9987930', { + string: ['bar'] +}) +console.log(argv) +``` + +## ESM Example + +As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_): + +**Node.js:** + +```js +import parser from 'yargs-parser' + +const argv = parser('--foo=99 --bar=9987930', { + string: ['bar'] +}) +console.log(argv) +``` + +**Browsers:** + +```html + + + + +``` + +## API + +### parser(args, opts={}) + +Parses command line arguments returning a simple mapping of keys and values. + +**expects:** + +* `args`: a string or array of strings representing the options to parse. +* `opts`: provide a set of hints indicating how `args` should be parsed: + * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. + * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
+ Indicate that keys should be parsed as an array and coerced to booleans / numbers:
+ `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. + * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. + * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided + (or throws an error). For arrays the function is called only once for the entire array:
+ `{coerce: {foo: function (arg) {return modifiedArg}}}`. + * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). + * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:
+ `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. + * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). + * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. + * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. + * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. + * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. + * `opts.normalize`: `path.normalize()` will be applied to values set to this key. + * `opts.number`: keys should be treated as numbers. + * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). + +**returns:** + +* `obj`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. + * [optional] `--`: an array with arguments after the end-of-options flag `--`. + +### require('yargs-parser').detailed(args, opts={}) + +Parses a command line string, returning detailed information required by the +yargs engine. + +**expects:** + +* `args`: a string or array of strings representing options to parse. +* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`. + +**returns:** + +* `argv`: an object representing the parsed value of `args` + * `key/value`: key value pairs for each argument and their aliases. + * `_`: an array representing the positional arguments. + * [optional] `--`: an array with arguments after the end-of-options flag `--`. +* `error`: populated with an error object if an exception occurred during parsing. +* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`. +* `newAliases`: any new aliases added via camel-case expansion: + * `boolean`: `{ fooBar: true }` +* `defaulted`: any new argument created by `opts.default`, no aliases included. + * `boolean`: `{ foo: true }` +* `configuration`: given by default settings and `opts.configuration`. + + + +### Configuration + +The yargs-parser applies several automated transformations on the keys provided +in `args`. These features can be turned on and off using the `configuration` field +of `opts`. + +```js +var parsed = parser(['--no-dice'], { + configuration: { + 'boolean-negation': false + } +}) +``` + +### short option groups + +* default: `true`. +* key: `short-option-groups`. + +Should a group of short-options be treated as boolean flags? + +```console +$ node example.js -abc +{ _: [], a: true, b: true, c: true } +``` + +_if disabled:_ + +```console +$ node example.js -abc +{ _: [], abc: true } +``` + +### camel-case expansion + +* default: `true`. +* key: `camel-case-expansion`. + +Should hyphenated arguments be expanded into camel-case aliases? + +```console +$ node example.js --foo-bar +{ _: [], 'foo-bar': true, fooBar: true } +``` + +_if disabled:_ + +```console +$ node example.js --foo-bar +{ _: [], 'foo-bar': true } +``` + +### dot-notation + +* default: `true` +* key: `dot-notation` + +Should keys that contain `.` be treated as objects? + +```console +$ node example.js --foo.bar +{ _: [], foo: { bar: true } } +``` + +_if disabled:_ + +```console +$ node example.js --foo.bar +{ _: [], "foo.bar": true } +``` + +### parse numbers + +* default: `true` +* key: `parse-numbers` + +Should keys that look like numbers be treated as such? + +```console +$ node example.js --foo=99.3 +{ _: [], foo: 99.3 } +``` + +_if disabled:_ + +```console +$ node example.js --foo=99.3 +{ _: [], foo: "99.3" } +``` + +### parse positional numbers + +* default: `true` +* key: `parse-positional-numbers` + +Should positional keys that look like numbers be treated as such. + +```console +$ node example.js 99.3 +{ _: [99.3] } +``` + +_if disabled:_ + +```console +$ node example.js 99.3 +{ _: ['99.3'] } +``` + +### boolean negation + +* default: `true` +* key: `boolean-negation` + +Should variables prefixed with `--no` be treated as negations? + +```console +$ node example.js --no-foo +{ _: [], foo: false } +``` + +_if disabled:_ + +```console +$ node example.js --no-foo +{ _: [], "no-foo": true } +``` + +### combine arrays + +* default: `false` +* key: `combine-arrays` + +Should arrays be combined when provided by both command line arguments and +a configuration file. + +### duplicate arguments array + +* default: `true` +* key: `duplicate-arguments-array` + +Should arguments be coerced into an array when duplicated: + +```console +$ node example.js -x 1 -x 2 +{ _: [], x: [1, 2] } +``` + +_if disabled:_ + +```console +$ node example.js -x 1 -x 2 +{ _: [], x: 2 } +``` + +### flatten duplicate arrays + +* default: `true` +* key: `flatten-duplicate-arrays` + +Should array arguments be coerced into a single array when duplicated: + +```console +$ node example.js -x 1 2 -x 3 4 +{ _: [], x: [1, 2, 3, 4] } +``` + +_if disabled:_ + +```console +$ node example.js -x 1 2 -x 3 4 +{ _: [], x: [[1, 2], [3, 4]] } +``` + +### greedy arrays + +* default: `true` +* key: `greedy-arrays` + +Should arrays consume more than one positional argument following their flag. + +```console +$ node example --arr 1 2 +{ _: [], arr: [1, 2] } +``` + +_if disabled:_ + +```console +$ node example --arr 1 2 +{ _: [2], arr: [1] } +``` + +**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** + +### nargs eats options + +* default: `false` +* key: `nargs-eats-options` + +Should nargs consume dash options as well as positional arguments. + +### negation prefix + +* default: `no-` +* key: `negation-prefix` + +The prefix to use for negated boolean variables. + +```console +$ node example.js --no-foo +{ _: [], foo: false } +``` + +_if set to `quux`:_ + +```console +$ node example.js --quuxfoo +{ _: [], foo: false } +``` + +### populate -- + +* default: `false`. +* key: `populate--` + +Should unparsed flags be stored in `--` or `_`. + +_If disabled:_ + +```console +$ node example.js a -b -- x y +{ _: [ 'a', 'x', 'y' ], b: true } +``` + +_If enabled:_ + +```console +$ node example.js a -b -- x y +{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true } +``` + +### set placeholder key + +* default: `false`. +* key: `set-placeholder-key`. + +Should a placeholder be added for keys not set via the corresponding CLI argument? + +_If disabled:_ + +```console +$ node example.js -a 1 -c 2 +{ _: [], a: 1, c: 2 } +``` + +_If enabled:_ + +```console +$ node example.js -a 1 -c 2 +{ _: [], a: 1, b: undefined, c: 2 } +``` + +### halt at non-option + +* default: `false`. +* key: `halt-at-non-option`. + +Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. + +_If disabled:_ + +```console +$ node example.js -a run b -x y +{ _: [ 'b' ], a: 'run', x: 'y' } +``` + +_If enabled:_ + +```console +$ node example.js -a run b -x y +{ _: [ 'b', '-x', 'y' ], a: 'run' } +``` + +### strip aliased + +* default: `false` +* key: `strip-aliased` + +Should aliases be removed before returning results? + +_If disabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } +``` + +_If enabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +### strip dashed + +* default: `false` +* key: `strip-dashed` + +Should dashed keys be removed before returning results? This option has no effect if +`camel-case-expansion` is disabled. + +_If disabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +_If enabled:_ + +```console +$ node example.js --test-field 1 +{ _: [], testField: 1 } +``` + +### unknown options as args + +* default: `false` +* key: `unknown-options-as-args` + +Should unknown options be treated like regular arguments? An unknown option is one that is not +configured in `opts`. + +_If disabled_ + +```console +$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } +``` + +_If enabled_ + +```console +$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } +``` + +## Supported Node.js Versions + +Libraries in this ecosystem make a best effort to track +[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a +post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). + +## Special Thanks + +The yargs project evolves from optimist and minimist. It owes its +existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/ + +## License + +ISC diff --git a/node_modules/yargs-parser/browser.js b/node_modules/yargs-parser/browser.js new file mode 100644 index 0000000..241202c --- /dev/null +++ b/node_modules/yargs-parser/browser.js @@ -0,0 +1,29 @@ +// Main entrypoint for ESM web browser environments. Avoids using Node.js +// specific libraries, such as "path". +// +// TODO: figure out reasonable web equivalents for "resolve", "normalize", etc. +import { camelCase, decamelize, looksLikeNumber } from './build/lib/string-utils.js' +import { YargsParser } from './build/lib/yargs-parser.js' +const parser = new YargsParser({ + cwd: () => { return '' }, + format: (str, arg) => { return str.replace('%s', arg) }, + normalize: (str) => { return str }, + resolve: (str) => { return str }, + require: () => { + throw Error('loading config from files not currently supported in browser') + }, + env: () => {} +}) + +const yargsParser = function Parser (args, opts) { + const result = parser.parse(args.slice(), opts) + return result.argv +} +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts) +} +yargsParser.camelCase = camelCase +yargsParser.decamelize = decamelize +yargsParser.looksLikeNumber = looksLikeNumber + +export default yargsParser diff --git a/node_modules/yargs-parser/build/index.cjs b/node_modules/yargs-parser/build/index.cjs new file mode 100644 index 0000000..cf6f50f --- /dev/null +++ b/node_modules/yargs-parser/build/index.cjs @@ -0,0 +1,1050 @@ +'use strict'; + +var util = require('util'); +var path = require('path'); +var fs = require('fs'); + +function camelCase(str) { + const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); + if (!isCamelCase) { + str = str.toLowerCase(); + } + if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { + return str; + } + else { + let camelcase = ''; + let nextChrUpper = false; + const leadingHyphens = str.match(/^-+/); + for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { + let chr = str.charAt(i); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i !== 0 && (chr === '-' || chr === '_')) { + nextChrUpper = true; + } + else if (chr !== '-' && chr !== '_') { + camelcase += chr; + } + } + return camelcase; + } +} +function decamelize(str, joinString) { + const lowercase = str.toLowerCase(); + joinString = joinString || '-'; + let notCamelcase = ''; + for (let i = 0; i < str.length; i++) { + const chrLower = lowercase.charAt(i); + const chrString = str.charAt(i); + if (chrLower !== chrString && i > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i)}`; + } + else { + notCamelcase += chrString; + } + } + return notCamelcase; +} +function looksLikeNumber(x) { + if (x === null || x === undefined) + return false; + if (typeof x === 'number') + return true; + if (/^0x[0-9a-f]+$/i.test(x)) + return true; + if (/^0[^.]/.test(x)) + return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + +function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e); + } + argString = argString.trim(); + let i = 0; + let prevC = null; + let c = null; + let opening = null; + const args = []; + for (let ii = 0; ii < argString.length; ii++) { + prevC = c; + c = argString.charAt(ii); + if (c === ' ' && !opening) { + if (!(prevC === ' ')) { + i++; + } + continue; + } + if (c === opening) { + opening = null; + } + else if ((c === "'" || c === '"') && !opening) { + opening = c; + } + if (!args[i]) + args[i] = ''; + args[i] += c; + } + return args; +} + +var DefaultValuesForTypeKey; +(function (DefaultValuesForTypeKey) { + DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; + DefaultValuesForTypeKey["STRING"] = "string"; + DefaultValuesForTypeKey["NUMBER"] = "number"; + DefaultValuesForTypeKey["ARRAY"] = "array"; +})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); + +let mixin; +class YargsParser { + constructor(_mixin) { + mixin = _mixin; + } + parse(argsInput, options) { + const opts = Object.assign({ + alias: undefined, + array: undefined, + boolean: undefined, + config: undefined, + configObjects: undefined, + configuration: undefined, + coerce: undefined, + count: undefined, + default: undefined, + envPrefix: undefined, + narg: undefined, + normalize: undefined, + string: undefined, + number: undefined, + __: undefined, + key: undefined + }, options); + const args = tokenizeArgString(argsInput); + const inputIsString = typeof argsInput === 'string'; + const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); + const configuration = Object.assign({ + 'boolean-negation': true, + 'camel-case-expansion': true, + 'combine-arrays': false, + 'dot-notation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true, + 'greedy-arrays': true, + 'halt-at-non-option': false, + 'nargs-eats-options': false, + 'negation-prefix': 'no-', + 'parse-numbers': true, + 'parse-positional-numbers': true, + 'populate--': false, + 'set-placeholder-key': false, + 'short-option-groups': true, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false + }, opts.configuration); + const defaults = Object.assign(Object.create(null), opts.default); + const configObjects = opts.configObjects || []; + const envPrefix = opts.envPrefix; + const notFlagsOption = configuration['populate--']; + const notFlagsArgv = notFlagsOption ? '--' : '_'; + const newAliases = Object.create(null); + const defaulted = Object.create(null); + const __ = opts.__ || mixin.format; + const flags = { + aliases: Object.create(null), + arrays: Object.create(null), + bools: Object.create(null), + strings: Object.create(null), + numbers: Object.create(null), + counts: Object.create(null), + normalize: Object.create(null), + configs: Object.create(null), + nargs: Object.create(null), + coercions: Object.create(null), + keys: [] + }; + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; + const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); + [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { + const key = typeof opt === 'object' ? opt.key : opt; + const assignment = Object.keys(opt).map(function (key) { + const arrayFlagKeys = { + boolean: 'bools', + string: 'strings', + number: 'numbers' + }; + return arrayFlagKeys[key]; + }).filter(Boolean).pop(); + if (assignment) { + flags[assignment][key] = true; + } + flags.arrays[key] = true; + flags.keys.push(key); + }); + [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + flags.keys.push(key); + }); + [].concat(opts.string || []).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + flags.keys.push(key); + }); + [].concat(opts.number || []).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true; + flags.keys.push(key); + }); + [].concat(opts.count || []).filter(Boolean).forEach(function (key) { + flags.counts[key] = true; + flags.keys.push(key); + }); + [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true; + flags.keys.push(key); + }); + if (typeof opts.narg === 'object') { + Object.entries(opts.narg).forEach(([key, value]) => { + if (typeof value === 'number') { + flags.nargs[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.coerce === 'object') { + Object.entries(opts.coerce).forEach(([key, value]) => { + if (typeof value === 'function') { + flags.coercions[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.config !== 'undefined') { + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + [].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true; + }); + } + else if (typeof opts.config === 'object') { + Object.entries(opts.config).forEach(([key, value]) => { + if (typeof value === 'boolean' || typeof value === 'function') { + flags.configs[key] = value; + } + }); + } + } + extendAliases(opts.key, aliases, opts.default, flags.arrays); + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key]; + }); + }); + let error = null; + checkConfiguration(); + let notFlags = []; + const argv = Object.assign(Object.create(null), { _: [] }); + const argvReturn = {}; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const truncatedArg = arg.replace(/^-{3,}/, '---'); + let broken; + let key; + let letters; + let m; + let next; + let value; + if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) { + pushPositional(arg); + } + else if (truncatedArg.match(/^---+(=|$)/)) { + pushPositional(arg); + continue; + } + else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { + m = arg.match(/^--?([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]); + } + else if (checkAllAliases(m[1], flags.nargs) !== false) { + i = eatNargs(i, m[1], args, m[2]); + } + else { + setArg(m[1], m[2], true); + } + } + } + else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { + m = arg.match(negatedBoolean); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); + } + } + else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { + m = arg.match(/^--?(.+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + setArg(m[1], m[2]); + } + } + else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1]; + m = arg.match(/^-(.\..+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split(''); + broken = false; + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3); + key = letters[j]; + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args, value); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + i = eatNargs(i, key, args, value); + } + else { + setArg(key, value); + } + broken = true; + break; + } + if (next === '-') { + setArg(letters[j], next); + continue; + } + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && + checkAllAliases(next, flags.bools) === false) { + setArg(letters[j], next); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next); + broken = true; + break; + } + else { + setArg(letters[j], defaultValue(letters[j])); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools)) { + key = arg.slice(1); + setArg(key, defaultValue(key)); + } + else if (arg === '--') { + notFlags = args.slice(i + 1); + break; + } + else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i); + break; + } + else { + pushPositional(arg); + } + } + applyEnvVars(argv, true); + applyEnvVars(argv, false); + setConfig(argv); + setConfigObjects(); + applyDefaultsAndAliases(argv, flags.aliases, defaults, true); + applyCoercions(argv); + if (configuration['set-placeholder-key']) + setPlaceholderKeys(argv); + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) + setArg(key, 0); + }); + if (notFlagsOption && notFlags.length) + argv[notFlagsArgv] = []; + notFlags.forEach(function (key) { + argv[notFlagsArgv].push(key); + }); + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key]; + }); + } + if (configuration['strip-aliased']) { + [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion'] && alias.includes('-')) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; + } + delete argv[alias]; + }); + } + function pushPositional(arg) { + const maybeCoercedNumber = maybeCoerceNumber('_', arg); + if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { + argv._.push(maybeCoercedNumber); + } + } + function eatNargs(i, key, args, argAfterEqualSign) { + let ii; + let toEat = checkAllAliases(key, flags.nargs); + toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error(__('Argument unexpected for: %s', key)); + } + setArg(key, defaultValue(key)); + return i; + } + let available = isUndefined(argAfterEqualSign) ? 0 : 1; + if (configuration['nargs-eats-options']) { + if (args.length - (i + 1) + available < toEat) { + error = Error(__('Not enough arguments following: %s', key)); + } + available = toEat; + } + else { + for (ii = i + 1; ii < args.length; ii++) { + if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) + available++; + else + break; + } + if (available < toEat) + error = Error(__('Not enough arguments following: %s', key)); + } + let consumed = Math.min(available, toEat); + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign); + consumed--; + } + for (ii = i + 1; ii < (consumed + i + 1); ii++) { + setArg(key, args[ii]); + } + return (i + consumed); + } + function eatArray(i, key, args, argAfterEqualSign) { + let argsToSet = []; + let next = argAfterEqualSign || args[i + 1]; + const nargsCount = checkAllAliases(key, flags.nargs); + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true); + } + else if (isUndefined(next) || + (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + if (defaults[key] !== undefined) { + const defVal = defaults[key]; + argsToSet = Array.isArray(defVal) ? defVal : [defVal]; + } + } + else { + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push(processValue(key, argAfterEqualSign, true)); + } + for (let ii = i + 1; ii < args.length; ii++) { + if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || + (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) + break; + next = args[ii]; + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) + break; + i = ii; + argsToSet.push(processValue(key, next, inputIsString)); + } + } + if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0))) { + error = Error(__('Not enough arguments following: %s', key)); + } + setArg(key, argsToSet); + return i; + } + function setArg(key, val, shouldStripQuotes = inputIsString) { + if (/-/.test(key) && configuration['camel-case-expansion']) { + const alias = key.split('.').map(function (prop) { + return camelCase(prop); + }).join('.'); + addNewAlias(key, alias); + } + const value = processValue(key, val, shouldStripQuotes); + const splitKey = key.split('.'); + setKey(argv, splitKey, value); + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + const keyProperties = x.split('.'); + setKey(argv, keyProperties, value); + }); + } + if (splitKey.length > 1 && configuration['dot-notation']) { + (flags.aliases[splitKey[0]] || []).forEach(function (x) { + let keyProperties = x.split('.'); + const a = [].concat(splitKey); + a.shift(); + keyProperties = keyProperties.concat(a); + if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { + setKey(argv, keyProperties, value); + } + }); + } + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + const keys = [key].concat(flags.aliases[key] || []); + keys.forEach(function (key) { + Object.defineProperty(argvReturn, key, { + enumerable: true, + get() { + return val; + }, + set(value) { + val = typeof value === 'string' ? mixin.normalize(value) : value; + } + }); + }); + } + } + function addNewAlias(key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias]; + newAliases[alias] = true; + } + if (!(flags.aliases[alias] && flags.aliases[alias].length)) { + addNewAlias(alias, key); + } + } + function processValue(key, val, shouldStripQuotes) { + if (shouldStripQuotes) { + val = stripQuotes(val); + } + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') + val = val === 'true'; + } + let value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v); }) + : maybeCoerceNumber(key, val); + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment(); + } + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) + value = val.map((val) => { return mixin.normalize(val); }); + else + value = mixin.normalize(val); + } + return value; + } + function maybeCoerceNumber(key, value) { + if (!configuration['parse-positional-numbers'] && key === '_') + return value; + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { + const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); + if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { + value = Number(value); + } + } + return value; + } + function setConfig(argv) { + const configLookup = Object.create(null); + applyDefaultsAndAliases(configLookup, flags.aliases, defaults); + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = argv[configKey] || configLookup[configKey]; + if (configPath) { + try { + let config = null; + const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); + const resolveConfig = flags.configs[configKey]; + if (typeof resolveConfig === 'function') { + try { + config = resolveConfig(resolvedConfigPath); + } + catch (e) { + config = e; + } + if (config instanceof Error) { + error = config; + return; + } + } + else { + config = mixin.require(resolvedConfigPath); + } + setConfigObject(config); + } + catch (ex) { + if (ex.name === 'PermissionDenied') + error = ex; + else if (argv[configKey]) + error = Error(__('Invalid JSON config file: %s', configPath)); + } + } + }); + } + function setConfigObject(config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key]; + const fullKey = prev ? prev + '.' + key : key; + if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { + setConfigObject(value, fullKey); + } + else { + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { + setArg(fullKey, value); + } + } + }); + } + function setConfigObjects() { + if (typeof configObjects !== 'undefined') { + configObjects.forEach(function (configObject) { + setConfigObject(configObject); + }); + } + } + function applyEnvVars(argv, configOnly) { + if (typeof envPrefix === 'undefined') + return; + const prefix = typeof envPrefix === 'string' ? envPrefix : ''; + const env = mixin.env(); + Object.keys(env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + const keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length); + } + return camelCase(key); + }); + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { + setArg(keys.join('.'), env[envVar]); + } + } + }); + } + function applyCoercions(argv) { + let coerce; + const applied = new Set(); + Object.keys(argv).forEach(function (key) { + if (!applied.has(key)) { + coerce = checkAllAliases(key, flags.coercions); + if (typeof coerce === 'function') { + try { + const value = maybeCoerceNumber(key, coerce(argv[key])); + ([].concat(flags.aliases[key] || [], key)).forEach(ali => { + applied.add(ali); + argv[ali] = value; + }); + } + catch (err) { + error = err; + } + } + } + }); + } + function setPlaceholderKeys(argv) { + flags.keys.forEach((key) => { + if (~key.indexOf('.')) + return; + if (typeof argv[key] === 'undefined') + argv[key] = undefined; + }); + return argv; + } + function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]); + if (canLog) + defaulted[key] = true; + (aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) + return; + setKey(obj, x.split('.'), defaults[key]); + }); + } + }); + } + function hasKey(obj, keys) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}); + }); + const key = keys[keys.length - 1]; + if (typeof o !== 'object') + return false; + else + return key in o; + } + function setKey(obj, keys, value) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + key = sanitizeKey(key); + if (typeof o === 'object' && o[key] === undefined) { + o[key] = {}; + } + if (typeof o[key] !== 'object' || Array.isArray(o[key])) { + if (Array.isArray(o[key])) { + o[key].push({}); + } + else { + o[key] = [o[key], {}]; + } + o = o[key][o[key].length - 1]; + } + else { + o = o[key]; + } + }); + const key = sanitizeKey(keys[keys.length - 1]); + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); + const isValueArray = Array.isArray(value); + let duplicate = configuration['duplicate-arguments-array']; + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true; + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined; + } + } + if (value === increment()) { + o[key] = increment(o[key]); + } + else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); + } + else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value; + } + else { + o[key] = o[key].concat([value]); + } + } + else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value]; + } + else if (duplicate && !(o[key] === undefined || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools))) { + o[key] = [o[key], value]; + } + else { + o[key] = value; + } + } + function extendAliases(...args) { + args.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + if (flags.aliases[key]) + return; + flags.aliases[key] = [].concat(aliases[key] || []); + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + const c = camelCase(x); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + const c = decamelize(x, '-'); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + }); + } + function checkAllAliases(key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key); + const keys = Object.keys(flag); + const setAlias = toCheck.find(key => keys.includes(key)); + return setAlias ? flag[setAlias] : false; + } + function hasAnyFlag(key) { + const flagsKeys = Object.keys(flags); + const toCheck = [].concat(flagsKeys.map(k => flags[k])); + return toCheck.some(function (flag) { + return Array.isArray(flag) ? flag.includes(key) : flag[key]; + }); + } + function hasFlagsMatching(arg, ...patterns) { + const toCheck = [].concat(...patterns); + return toCheck.some(function (pattern) { + const match = arg.match(pattern); + return match && hasAnyFlag(match[1]); + }); + } + function hasAllShortFlags(arg) { + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { + return false; + } + let hasAllFlags = true; + let next; + const letters = arg.slice(1).split(''); + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false; + break; + } + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break; + } + } + return hasAllFlags; + } + function isUnknownOptionAsArg(arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg); + } + function isUnknownOption(arg) { + arg = arg.replace(/^-{3,}/, '--'); + if (arg.match(negative)) { + return false; + } + if (hasAllShortFlags(arg)) { + return false; + } + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; + const normalFlag = /^-+([^=]+?)$/; + const flagEndingInHyphen = /^-+([^=]+?)-$/; + const flagEndingInDigits = /^-+([^=]+?\d+)$/; + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); + } + function defaultValue(key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key]; + } + else { + return defaultForType(guessType(key)); + } + } + function defaultForType(type) { + const def = { + [DefaultValuesForTypeKey.BOOLEAN]: true, + [DefaultValuesForTypeKey.STRING]: '', + [DefaultValuesForTypeKey.NUMBER]: undefined, + [DefaultValuesForTypeKey.ARRAY]: [] + }; + return def[type]; + } + function guessType(key) { + let type = DefaultValuesForTypeKey.BOOLEAN; + if (checkAllAliases(key, flags.strings)) + type = DefaultValuesForTypeKey.STRING; + else if (checkAllAliases(key, flags.numbers)) + type = DefaultValuesForTypeKey.NUMBER; + else if (checkAllAliases(key, flags.bools)) + type = DefaultValuesForTypeKey.BOOLEAN; + else if (checkAllAliases(key, flags.arrays)) + type = DefaultValuesForTypeKey.ARRAY; + return type; + } + function isUndefined(num) { + return num === undefined; + } + function checkConfiguration() { + Object.keys(flags.counts).find(key => { + if (checkAllAliases(key, flags.arrays)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); + return true; + } + else if (checkAllAliases(key, flags.nargs)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); + return true; + } + return false; + }); + } + return { + aliases: Object.assign({}, flags.aliases), + argv: Object.assign(argvReturn, argv), + configuration: configuration, + defaulted: Object.assign({}, defaulted), + error: error, + newAliases: Object.assign({}, newAliases) + }; + } +} +function combineAliases(aliases) { + const aliasArrays = []; + const combined = Object.create(null); + let change = true; + Object.keys(aliases).forEach(function (key) { + aliasArrays.push([].concat(aliases[key], key)); + }); + while (change) { + change = false; + for (let i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1; + }); + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); + aliasArrays.splice(ii, 1); + change = true; + break; + } + } + } + } + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i; + }); + const lastAlias = aliasArray.pop(); + if (lastAlias !== undefined && typeof lastAlias === 'string') { + combined[lastAlias] = aliasArray; + } + }); + return combined; +} +function increment(orig) { + return orig !== undefined ? orig + 1 : 1; +} +function sanitizeKey(key) { + if (key === '__proto__') + return '___proto___'; + return key; +} +function stripQuotes(val) { + return (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0]) + ? val.substring(1, val.length - 1) + : val; +} + +var _a, _b, _c; +const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 12; +const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1); +if (nodeVersion) { + const major = Number(nodeVersion.match(/^([^.]+)/)[1]); + if (major < minNodeVersion) { + throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); + } +} +const env = process ? process.env : {}; +const parser = new YargsParser({ + cwd: process.cwd, + env: () => { + return env; + }, + format: util.format, + normalize: path.normalize, + resolve: path.resolve, + require: (path) => { + if (typeof require !== 'undefined') { + return require(path); + } + else if (path.match(/\.json$/)) { + return JSON.parse(fs.readFileSync(path, 'utf8')); + } + else { + throw Error('only .json config files are supported in ESM'); + } + } +}); +const yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); + return result.argv; +}; +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts); +}; +yargsParser.camelCase = camelCase; +yargsParser.decamelize = decamelize; +yargsParser.looksLikeNumber = looksLikeNumber; + +module.exports = yargsParser; diff --git a/node_modules/yargs-parser/build/lib/index.js b/node_modules/yargs-parser/build/lib/index.js new file mode 100644 index 0000000..43ef485 --- /dev/null +++ b/node_modules/yargs-parser/build/lib/index.js @@ -0,0 +1,62 @@ +/** + * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js + * CJS and ESM environments. + * + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +var _a, _b, _c; +import { format } from 'util'; +import { normalize, resolve } from 'path'; +import { camelCase, decamelize, looksLikeNumber } from './string-utils.js'; +import { YargsParser } from './yargs-parser.js'; +import { readFileSync } from 'fs'; +// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our +// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only. +const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION) + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 12; +const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1); +if (nodeVersion) { + const major = Number(nodeVersion.match(/^([^.]+)/)[1]); + if (major < minNodeVersion) { + throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); + } +} +// Creates a yargs-parser instance using Node.js standard libraries: +const env = process ? process.env : {}; +const parser = new YargsParser({ + cwd: process.cwd, + env: () => { + return env; + }, + format, + normalize, + resolve, + // TODO: figure out a way to combine ESM and CJS coverage, such that + // we can exercise all the lines below: + require: (path) => { + if (typeof require !== 'undefined') { + return require(path); + } + else if (path.match(/\.json$/)) { + // Addresses: https://github.com/yargs/yargs/issues/2040 + return JSON.parse(readFileSync(path, 'utf8')); + } + else { + throw Error('only .json config files are supported in ESM'); + } + } +}); +const yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); + return result.argv; +}; +yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts); +}; +yargsParser.camelCase = camelCase; +yargsParser.decamelize = decamelize; +yargsParser.looksLikeNumber = looksLikeNumber; +export default yargsParser; diff --git a/node_modules/yargs-parser/build/lib/string-utils.js b/node_modules/yargs-parser/build/lib/string-utils.js new file mode 100644 index 0000000..4e8bd99 --- /dev/null +++ b/node_modules/yargs-parser/build/lib/string-utils.js @@ -0,0 +1,65 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +export function camelCase(str) { + // Handle the case where an argument is provided as camel case, e.g., fooBar. + // by ensuring that the string isn't already mixed case: + const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase(); + if (!isCamelCase) { + str = str.toLowerCase(); + } + if (str.indexOf('-') === -1 && str.indexOf('_') === -1) { + return str; + } + else { + let camelcase = ''; + let nextChrUpper = false; + const leadingHyphens = str.match(/^-+/); + for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { + let chr = str.charAt(i); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i !== 0 && (chr === '-' || chr === '_')) { + nextChrUpper = true; + } + else if (chr !== '-' && chr !== '_') { + camelcase += chr; + } + } + return camelcase; + } +} +export function decamelize(str, joinString) { + const lowercase = str.toLowerCase(); + joinString = joinString || '-'; + let notCamelcase = ''; + for (let i = 0; i < str.length; i++) { + const chrLower = lowercase.charAt(i); + const chrString = str.charAt(i); + if (chrLower !== chrString && i > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i)}`; + } + else { + notCamelcase += chrString; + } + } + return notCamelcase; +} +export function looksLikeNumber(x) { + if (x === null || x === undefined) + return false; + // if loaded from config, may already be a number. + if (typeof x === 'number') + return true; + // hexadecimal. + if (/^0x[0-9a-f]+$/i.test(x)) + return true; + // don't treat 0123 as a number; as it drops the leading '0'. + if (/^0[^.]/.test(x)) + return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} diff --git a/node_modules/yargs-parser/build/lib/tokenize-arg-string.js b/node_modules/yargs-parser/build/lib/tokenize-arg-string.js new file mode 100644 index 0000000..5e732ef --- /dev/null +++ b/node_modules/yargs-parser/build/lib/tokenize-arg-string.js @@ -0,0 +1,40 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +// take an un-split argv string and tokenize it. +export function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e); + } + argString = argString.trim(); + let i = 0; + let prevC = null; + let c = null; + let opening = null; + const args = []; + for (let ii = 0; ii < argString.length; ii++) { + prevC = c; + c = argString.charAt(ii); + // split on spaces unless we're in quotes. + if (c === ' ' && !opening) { + if (!(prevC === ' ')) { + i++; + } + continue; + } + // don't split the string if we're in matching + // opening or closing single and double quotes. + if (c === opening) { + opening = null; + } + else if ((c === "'" || c === '"') && !opening) { + opening = c; + } + if (!args[i]) + args[i] = ''; + args[i] += c; + } + return args; +} diff --git a/node_modules/yargs-parser/build/lib/yargs-parser-types.js b/node_modules/yargs-parser/build/lib/yargs-parser-types.js new file mode 100644 index 0000000..63b7c31 --- /dev/null +++ b/node_modules/yargs-parser/build/lib/yargs-parser-types.js @@ -0,0 +1,12 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +export var DefaultValuesForTypeKey; +(function (DefaultValuesForTypeKey) { + DefaultValuesForTypeKey["BOOLEAN"] = "boolean"; + DefaultValuesForTypeKey["STRING"] = "string"; + DefaultValuesForTypeKey["NUMBER"] = "number"; + DefaultValuesForTypeKey["ARRAY"] = "array"; +})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); diff --git a/node_modules/yargs-parser/build/lib/yargs-parser.js b/node_modules/yargs-parser/build/lib/yargs-parser.js new file mode 100644 index 0000000..415d4bc --- /dev/null +++ b/node_modules/yargs-parser/build/lib/yargs-parser.js @@ -0,0 +1,1045 @@ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +import { tokenizeArgString } from './tokenize-arg-string.js'; +import { DefaultValuesForTypeKey } from './yargs-parser-types.js'; +import { camelCase, decamelize, looksLikeNumber } from './string-utils.js'; +let mixin; +export class YargsParser { + constructor(_mixin) { + mixin = _mixin; + } + parse(argsInput, options) { + const opts = Object.assign({ + alias: undefined, + array: undefined, + boolean: undefined, + config: undefined, + configObjects: undefined, + configuration: undefined, + coerce: undefined, + count: undefined, + default: undefined, + envPrefix: undefined, + narg: undefined, + normalize: undefined, + string: undefined, + number: undefined, + __: undefined, + key: undefined + }, options); + // allow a string argument to be passed in rather + // than an argv array. + const args = tokenizeArgString(argsInput); + // tokenizeArgString adds extra quotes to args if argsInput is a string + // only strip those extra quotes in processValue if argsInput is a string + const inputIsString = typeof argsInput === 'string'; + // aliases might have transitive relationships, normalize this. + const aliases = combineAliases(Object.assign(Object.create(null), opts.alias)); + const configuration = Object.assign({ + 'boolean-negation': true, + 'camel-case-expansion': true, + 'combine-arrays': false, + 'dot-notation': true, + 'duplicate-arguments-array': true, + 'flatten-duplicate-arrays': true, + 'greedy-arrays': true, + 'halt-at-non-option': false, + 'nargs-eats-options': false, + 'negation-prefix': 'no-', + 'parse-numbers': true, + 'parse-positional-numbers': true, + 'populate--': false, + 'set-placeholder-key': false, + 'short-option-groups': true, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false + }, opts.configuration); + const defaults = Object.assign(Object.create(null), opts.default); + const configObjects = opts.configObjects || []; + const envPrefix = opts.envPrefix; + const notFlagsOption = configuration['populate--']; + const notFlagsArgv = notFlagsOption ? '--' : '_'; + const newAliases = Object.create(null); + const defaulted = Object.create(null); + // allow a i18n handler to be passed in, default to a fake one (util.format). + const __ = opts.__ || mixin.format; + const flags = { + aliases: Object.create(null), + arrays: Object.create(null), + bools: Object.create(null), + strings: Object.create(null), + numbers: Object.create(null), + counts: Object.create(null), + normalize: Object.create(null), + configs: Object.create(null), + nargs: Object.create(null), + coercions: Object.create(null), + keys: [] + }; + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; + const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)'); + [].concat(opts.array || []).filter(Boolean).forEach(function (opt) { + const key = typeof opt === 'object' ? opt.key : opt; + // assign to flags[bools|strings|numbers] + const assignment = Object.keys(opt).map(function (key) { + const arrayFlagKeys = { + boolean: 'bools', + string: 'strings', + number: 'numbers' + }; + return arrayFlagKeys[key]; + }).filter(Boolean).pop(); + // assign key to be coerced + if (assignment) { + flags[assignment][key] = true; + } + flags.arrays[key] = true; + flags.keys.push(key); + }); + [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + flags.keys.push(key); + }); + [].concat(opts.string || []).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + flags.keys.push(key); + }); + [].concat(opts.number || []).filter(Boolean).forEach(function (key) { + flags.numbers[key] = true; + flags.keys.push(key); + }); + [].concat(opts.count || []).filter(Boolean).forEach(function (key) { + flags.counts[key] = true; + flags.keys.push(key); + }); + [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) { + flags.normalize[key] = true; + flags.keys.push(key); + }); + if (typeof opts.narg === 'object') { + Object.entries(opts.narg).forEach(([key, value]) => { + if (typeof value === 'number') { + flags.nargs[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.coerce === 'object') { + Object.entries(opts.coerce).forEach(([key, value]) => { + if (typeof value === 'function') { + flags.coercions[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.config !== 'undefined') { + if (Array.isArray(opts.config) || typeof opts.config === 'string') { + ; + [].concat(opts.config).filter(Boolean).forEach(function (key) { + flags.configs[key] = true; + }); + } + else if (typeof opts.config === 'object') { + Object.entries(opts.config).forEach(([key, value]) => { + if (typeof value === 'boolean' || typeof value === 'function') { + flags.configs[key] = value; + } + }); + } + } + // create a lookup table that takes into account all + // combinations of aliases: {f: ['foo'], foo: ['f']} + extendAliases(opts.key, aliases, opts.default, flags.arrays); + // apply default values to all aliases. + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key]; + }); + }); + let error = null; + checkConfiguration(); + let notFlags = []; + const argv = Object.assign(Object.create(null), { _: [] }); + // TODO(bcoe): for the first pass at removing object prototype we didn't + // remove all prototypes from objects returned by this API, we might want + // to gradually move towards doing so. + const argvReturn = {}; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const truncatedArg = arg.replace(/^-{3,}/, '---'); + let broken; + let key; + let letters; + let m; + let next; + let value; + // any unknown option (except for end-of-options, "--") + if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) { + pushPositional(arg); + // ---, ---=, ----, etc, + } + else if (truncatedArg.match(/^---+(=|$)/)) { + // options without key name are invalid. + pushPositional(arg); + continue; + // -- separated by = + } + else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + m = arg.match(/^--?([^=]+)=([\s\S]*)$/); + // arrays format = '--f=a b c' + if (m !== null && Array.isArray(m) && m.length >= 3) { + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]); + } + else if (checkAllAliases(m[1], flags.nargs) !== false) { + // nargs format = '--f=monkey washing cat' + i = eatNargs(i, m[1], args, m[2]); + } + else { + setArg(m[1], m[2], true); + } + } + } + else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { + m = arg.match(negatedBoolean); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); + } + // -- separated by space. + } + else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) { + m = arg.match(/^--?(.+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '--foo a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '--foo a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + // dot-notation flag separated by '='. + } + else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + setArg(m[1], m[2]); + } + // dot-notation flag separated by space. + } + else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1]; + m = arg.match(/^-(.\..+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (next !== undefined && !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split(''); + broken = false; + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (letters[j + 1] && letters[j + 1] === '=') { + value = arg.slice(j + 3); + key = letters[j]; + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f=a b c' + i = eatArray(i, key, args, value); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f=monkey washing cat' + i = eatNargs(i, key, args, value); + } + else { + setArg(key, value); + } + broken = true; + break; + } + if (next === '-') { + setArg(letters[j], next); + continue; + } + // current letter is an alphabetic character and next value is a number + if (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && + checkAllAliases(next, flags.bools) === false) { + setArg(letters[j], next); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next); + broken = true; + break; + } + else { + setArg(letters[j], defaultValue(letters[j])); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (checkAllAliases(key, flags.arrays)) { + // array format = '-f a b c' + i = eatArray(i, key, args); + } + else if (checkAllAliases(key, flags.nargs) !== false) { + // nargs format = '-f a b c' + // should be truthy even if: flags.nargs[key] === 0 + i = eatNargs(i, key, args); + } + else { + next = args[i + 1]; + if (next !== undefined && (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } + else { + setArg(key, defaultValue(key)); + } + } + } + } + else if (arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools)) { + // single-digit boolean alias, e.g: xargs -0 + key = arg.slice(1); + setArg(key, defaultValue(key)); + } + else if (arg === '--') { + notFlags = args.slice(i + 1); + break; + } + else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i); + break; + } + else { + pushPositional(arg); + } + } + // order of precedence: + // 1. command line arg + // 2. value from env var + // 3. value from config file + // 4. value from config objects + // 5. configured default value + applyEnvVars(argv, true); // special case: check env vars that point to config file + applyEnvVars(argv, false); + setConfig(argv); + setConfigObjects(); + applyDefaultsAndAliases(argv, flags.aliases, defaults, true); + applyCoercions(argv); + if (configuration['set-placeholder-key']) + setPlaceholderKeys(argv); + // for any counts either not in args or without an explicit default, set to 0 + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) + setArg(key, 0); + }); + // '--' defaults to undefined. + if (notFlagsOption && notFlags.length) + argv[notFlagsArgv] = []; + notFlags.forEach(function (key) { + argv[notFlagsArgv].push(key); + }); + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key]; + }); + } + if (configuration['strip-aliased']) { + ; + [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion'] && alias.includes('-')) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')]; + } + delete argv[alias]; + }); + } + // Push argument into positional array, applying numeric coercion: + function pushPositional(arg) { + const maybeCoercedNumber = maybeCoerceNumber('_', arg); + if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') { + argv._.push(maybeCoercedNumber); + } + } + // how many arguments should we consume, based + // on the nargs option? + function eatNargs(i, key, args, argAfterEqualSign) { + let ii; + let toEat = checkAllAliases(key, flags.nargs); + // NaN has a special meaning for the array type, indicating that one or + // more values are expected. + toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat; + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error(__('Argument unexpected for: %s', key)); + } + setArg(key, defaultValue(key)); + return i; + } + let available = isUndefined(argAfterEqualSign) ? 0 : 1; + if (configuration['nargs-eats-options']) { + // classic behavior, yargs eats positional and dash arguments. + if (args.length - (i + 1) + available < toEat) { + error = Error(__('Not enough arguments following: %s', key)); + } + available = toEat; + } + else { + // nargs will not consume flag arguments, e.g., -abc, --foo, + // and terminates when one is observed. + for (ii = i + 1; ii < args.length; ii++) { + if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii])) + available++; + else + break; + } + if (available < toEat) + error = Error(__('Not enough arguments following: %s', key)); + } + let consumed = Math.min(available, toEat); + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign); + consumed--; + } + for (ii = i + 1; ii < (consumed + i + 1); ii++) { + setArg(key, args[ii]); + } + return (i + consumed); + } + // if an option is an array, eat all non-hyphenated arguments + // following it... YUM! + // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] + function eatArray(i, key, args, argAfterEqualSign) { + let argsToSet = []; + let next = argAfterEqualSign || args[i + 1]; + // If both array and nargs are configured, enforce the nargs count: + const nargsCount = checkAllAliases(key, flags.nargs); + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true); + } + else if (isUndefined(next) || + (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + // for keys without value ==> argsToSet remains an empty [] + // set user default value, if available + if (defaults[key] !== undefined) { + const defVal = defaults[key]; + argsToSet = Array.isArray(defVal) ? defVal : [defVal]; + } + } + else { + // value in --option=value is eaten as is + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push(processValue(key, argAfterEqualSign, true)); + } + for (let ii = i + 1; ii < args.length; ii++) { + if ((!configuration['greedy-arrays'] && argsToSet.length > 0) || + (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount)) + break; + next = args[ii]; + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) + break; + i = ii; + argsToSet.push(processValue(key, next, inputIsString)); + } + } + // If both array and nargs are configured, create an error if less than + // nargs positionals were found. NaN has special meaning, indicating + // that at least one value is required (more are okay). + if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0))) { + error = Error(__('Not enough arguments following: %s', key)); + } + setArg(key, argsToSet); + return i; + } + function setArg(key, val, shouldStripQuotes = inputIsString) { + if (/-/.test(key) && configuration['camel-case-expansion']) { + const alias = key.split('.').map(function (prop) { + return camelCase(prop); + }).join('.'); + addNewAlias(key, alias); + } + const value = processValue(key, val, shouldStripQuotes); + const splitKey = key.split('.'); + setKey(argv, splitKey, value); + // handle populating aliases of the full key + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + const keyProperties = x.split('.'); + setKey(argv, keyProperties, value); + }); + } + // handle populating aliases of the first element of the dot-notation key + if (splitKey.length > 1 && configuration['dot-notation']) { + ; + (flags.aliases[splitKey[0]] || []).forEach(function (x) { + let keyProperties = x.split('.'); + // expand alias with nested objects in key + const a = [].concat(splitKey); + a.shift(); // nuke the old key. + keyProperties = keyProperties.concat(a); + // populate alias only if is not already an alias of the full key + // (already populated above) + if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) { + setKey(argv, keyProperties, value); + } + }); + } + // Set normalize getter and setter when key is in 'normalize' but isn't an array + if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { + const keys = [key].concat(flags.aliases[key] || []); + keys.forEach(function (key) { + Object.defineProperty(argvReturn, key, { + enumerable: true, + get() { + return val; + }, + set(value) { + val = typeof value === 'string' ? mixin.normalize(value) : value; + } + }); + }); + } + } + function addNewAlias(key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias]; + newAliases[alias] = true; + } + if (!(flags.aliases[alias] && flags.aliases[alias].length)) { + addNewAlias(alias, key); + } + } + function processValue(key, val, shouldStripQuotes) { + // strings may be quoted, clean this up as we assign values. + if (shouldStripQuotes) { + val = stripQuotes(val); + } + // handle parsing boolean arguments --foo=true --bar false. + if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { + if (typeof val === 'string') + val = val === 'true'; + } + let value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v); }) + : maybeCoerceNumber(key, val); + // increment a count given as arg (either no value or value parsed as boolean) + if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { + value = increment(); + } + // Set normalized value when key is in 'normalize' and in 'arrays' + if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { + if (Array.isArray(val)) + value = val.map((val) => { return mixin.normalize(val); }); + else + value = mixin.normalize(val); + } + return value; + } + function maybeCoerceNumber(key, value) { + if (!configuration['parse-positional-numbers'] && key === '_') + return value; + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { + const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`)))); + if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) { + value = Number(value); + } + } + return value; + } + // set args from config.json file, this should be + // applied last so that defaults can be applied. + function setConfig(argv) { + const configLookup = Object.create(null); + // expand defaults/aliases, in-case any happen to reference + // the config.json file. + applyDefaultsAndAliases(configLookup, flags.aliases, defaults); + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = argv[configKey] || configLookup[configKey]; + if (configPath) { + try { + let config = null; + const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); + const resolveConfig = flags.configs[configKey]; + if (typeof resolveConfig === 'function') { + try { + config = resolveConfig(resolvedConfigPath); + } + catch (e) { + config = e; + } + if (config instanceof Error) { + error = config; + return; + } + } + else { + config = mixin.require(resolvedConfigPath); + } + setConfigObject(config); + } + catch (ex) { + // Deno will receive a PermissionDenied error if an attempt is + // made to load config without the --allow-read flag: + if (ex.name === 'PermissionDenied') + error = ex; + else if (argv[configKey]) + error = Error(__('Invalid JSON config file: %s', configPath)); + } + } + }); + } + // set args from config object. + // it recursively checks nested objects. + function setConfigObject(config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key]; + const fullKey = prev ? prev + '.' + key : key; + // if the value is an inner object and we have dot-notation + // enabled, treat inner objects in config the same as + // heavily nested dot notations (foo.bar.apple). + if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) { + // if the value is an object but not an array, check nested object + setConfigObject(value, fullKey); + } + else { + // setting arguments via CLI takes precedence over + // values within the config file. + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { + setArg(fullKey, value); + } + } + }); + } + // set all config objects passed in opts + function setConfigObjects() { + if (typeof configObjects !== 'undefined') { + configObjects.forEach(function (configObject) { + setConfigObject(configObject); + }); + } + } + function applyEnvVars(argv, configOnly) { + if (typeof envPrefix === 'undefined') + return; + const prefix = typeof envPrefix === 'string' ? envPrefix : ''; + const env = mixin.env(); + Object.keys(env).forEach(function (envVar) { + if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) { + // get array of nested keys and convert them to camel case + const keys = envVar.split('__').map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length); + } + return camelCase(key); + }); + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { + setArg(keys.join('.'), env[envVar]); + } + } + }); + } + function applyCoercions(argv) { + let coerce; + const applied = new Set(); + Object.keys(argv).forEach(function (key) { + if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases + coerce = checkAllAliases(key, flags.coercions); + if (typeof coerce === 'function') { + try { + const value = maybeCoerceNumber(key, coerce(argv[key])); + ([].concat(flags.aliases[key] || [], key)).forEach(ali => { + applied.add(ali); + argv[ali] = value; + }); + } + catch (err) { + error = err; + } + } + } + }); + } + function setPlaceholderKeys(argv) { + flags.keys.forEach((key) => { + // don't set placeholder keys for dot notation options 'foo.bar'. + if (~key.indexOf('.')) + return; + if (typeof argv[key] === 'undefined') + argv[key] = undefined; + }); + return argv; + } + function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) { + Object.keys(defaults).forEach(function (key) { + if (!hasKey(obj, key.split('.'))) { + setKey(obj, key.split('.'), defaults[key]); + if (canLog) + defaulted[key] = true; + (aliases[key] || []).forEach(function (x) { + if (hasKey(obj, x.split('.'))) + return; + setKey(obj, x.split('.'), defaults[key]); + }); + } + }); + } + function hasKey(obj, keys) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + o = (o[key] || {}); + }); + const key = keys[keys.length - 1]; + if (typeof o !== 'object') + return false; + else + return key in o; + } + function setKey(obj, keys, value) { + let o = obj; + if (!configuration['dot-notation']) + keys = [keys.join('.')]; + keys.slice(0, -1).forEach(function (key) { + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + key = sanitizeKey(key); + if (typeof o === 'object' && o[key] === undefined) { + o[key] = {}; + } + if (typeof o[key] !== 'object' || Array.isArray(o[key])) { + // ensure that o[key] is an array, and that the last item is an empty object. + if (Array.isArray(o[key])) { + o[key].push({}); + } + else { + o[key] = [o[key], {}]; + } + // we want to update the empty object at the end of the o[key] array, so set o to that object + o = o[key][o[key].length - 1]; + } + else { + o = o[key]; + } + }); + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + const key = sanitizeKey(keys[keys.length - 1]); + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays); + const isValueArray = Array.isArray(value); + let duplicate = configuration['duplicate-arguments-array']; + // nargs has higher priority than duplicate + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true; + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined; + } + } + if (value === increment()) { + o[key] = increment(o[key]); + } + else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); + } + else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { + o[key] = value; + } + else { + o[key] = o[key].concat([value]); + } + } + else if (o[key] === undefined && isTypeArray) { + o[key] = isValueArray ? value : [value]; + } + else if (duplicate && !(o[key] === undefined || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools))) { + o[key] = [o[key], value]; + } + else { + o[key] = value; + } + } + // extend the aliases list with inferred aliases. + function extendAliases(...args) { + args.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + // short-circuit if we've already added a key + // to the aliases array, for example it might + // exist in both 'opts.default' and 'opts.key'. + if (flags.aliases[key]) + return; + flags.aliases[key] = [].concat(aliases[key] || []); + // For "--option-name", also set argv.optionName + flags.aliases[key].concat(key).forEach(function (x) { + if (/-/.test(x) && configuration['camel-case-expansion']) { + const c = camelCase(x); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + // For "--optionName", also set argv['option-name'] + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + const c = decamelize(x, '-'); + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + }); + } + function checkAllAliases(key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key); + const keys = Object.keys(flag); + const setAlias = toCheck.find(key => keys.includes(key)); + return setAlias ? flag[setAlias] : false; + } + function hasAnyFlag(key) { + const flagsKeys = Object.keys(flags); + const toCheck = [].concat(flagsKeys.map(k => flags[k])); + return toCheck.some(function (flag) { + return Array.isArray(flag) ? flag.includes(key) : flag[key]; + }); + } + function hasFlagsMatching(arg, ...patterns) { + const toCheck = [].concat(...patterns); + return toCheck.some(function (pattern) { + const match = arg.match(pattern); + return match && hasAnyFlag(match[1]); + }); + } + // based on a simplified version of the short flag group parsing logic + function hasAllShortFlags(arg) { + // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { + return false; + } + let hasAllFlags = true; + let next; + const letters = arg.slice(1).split(''); + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false; + break; + } + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break; + } + } + return hasAllFlags; + } + function isUnknownOptionAsArg(arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg); + } + function isUnknownOption(arg) { + arg = arg.replace(/^-{3,}/, '--'); + // ignore negative numbers + if (arg.match(negative)) { + return false; + } + // if this is a short option group and all of them are configured, it isn't unknown + if (hasAllShortFlags(arg)) { + return false; + } + // e.g. '--count=2' + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; + // e.g. '-a' or '--arg' + const normalFlag = /^-+([^=]+?)$/; + // e.g. '-a-' + const flagEndingInHyphen = /^-+([^=]+?)-$/; + // e.g. '-abc123' + const flagEndingInDigits = /^-+([^=]+?\d+)$/; + // e.g. '-a/usr/local' + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; + // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); + } + // make a best effort to pick a default value + // for an option based on name and type. + function defaultValue(key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key]; + } + else { + return defaultForType(guessType(key)); + } + } + // return a default value, given the type of a flag., + function defaultForType(type) { + const def = { + [DefaultValuesForTypeKey.BOOLEAN]: true, + [DefaultValuesForTypeKey.STRING]: '', + [DefaultValuesForTypeKey.NUMBER]: undefined, + [DefaultValuesForTypeKey.ARRAY]: [] + }; + return def[type]; + } + // given a flag, enforce a default type. + function guessType(key) { + let type = DefaultValuesForTypeKey.BOOLEAN; + if (checkAllAliases(key, flags.strings)) + type = DefaultValuesForTypeKey.STRING; + else if (checkAllAliases(key, flags.numbers)) + type = DefaultValuesForTypeKey.NUMBER; + else if (checkAllAliases(key, flags.bools)) + type = DefaultValuesForTypeKey.BOOLEAN; + else if (checkAllAliases(key, flags.arrays)) + type = DefaultValuesForTypeKey.ARRAY; + return type; + } + function isUndefined(num) { + return num === undefined; + } + // check user configuration settings for inconsistencies + function checkConfiguration() { + // count keys should not be set as array/narg + Object.keys(flags.counts).find(key => { + if (checkAllAliases(key, flags.arrays)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key)); + return true; + } + else if (checkAllAliases(key, flags.nargs)) { + error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key)); + return true; + } + return false; + }); + } + return { + aliases: Object.assign({}, flags.aliases), + argv: Object.assign(argvReturn, argv), + configuration: configuration, + defaulted: Object.assign({}, defaulted), + error: error, + newAliases: Object.assign({}, newAliases) + }; + } +} +// if any aliases reference each other, we should +// merge them together. +function combineAliases(aliases) { + const aliasArrays = []; + const combined = Object.create(null); + let change = true; + // turn alias lookup hash {key: ['alias1', 'alias2']} into + // a simple array ['key', 'alias1', 'alias2'] + Object.keys(aliases).forEach(function (key) { + aliasArrays.push([].concat(aliases[key], key)); + }); + // combine arrays until zero changes are + // made in an iteration. + while (change) { + change = false; + for (let i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1; + }); + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); + aliasArrays.splice(ii, 1); + change = true; + break; + } + } + } + } + // map arrays back to the hash-lookup (de-dupe while + // we're at it). + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i; + }); + const lastAlias = aliasArray.pop(); + if (lastAlias !== undefined && typeof lastAlias === 'string') { + combined[lastAlias] = aliasArray; + } + }); + return combined; +} +// this function should only be called when a count is given as an arg +// it is NOT called to set a default value +// thus we can start the count at 1 instead of 0 +function increment(orig) { + return orig !== undefined ? orig + 1 : 1; +} +// TODO(bcoe): in the next major version of yargs, switch to +// Object.create(null) for dot notation: +function sanitizeKey(key) { + if (key === '__proto__') + return '___proto___'; + return key; +} +function stripQuotes(val) { + return (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0]) + ? val.substring(1, val.length - 1) + : val; +} diff --git a/node_modules/yargs-parser/package.json b/node_modules/yargs-parser/package.json new file mode 100644 index 0000000..decd0c3 --- /dev/null +++ b/node_modules/yargs-parser/package.json @@ -0,0 +1,92 @@ +{ + "name": "yargs-parser", + "version": "21.1.1", + "description": "the mighty option parser used by yargs", + "main": "build/index.cjs", + "exports": { + ".": [ + { + "import": "./build/lib/index.js", + "require": "./build/index.cjs" + }, + "./build/index.cjs" + ], + "./browser": [ + "./browser.js" + ] + }, + "type": "module", + "module": "./build/lib/index.js", + "scripts": { + "check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'", + "fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'", + "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", + "test": "c8 --reporter=text --reporter=html mocha test/*.cjs", + "test:esm": "c8 --reporter=text --reporter=html mocha test/*.mjs", + "test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'", + "pretest:typescript": "npm run pretest", + "test:typescript": "c8 mocha ./build/test/typescript/*.js", + "coverage": "c8 report --check-coverage", + "precompile": "rimraf build", + "compile": "tsc", + "postcompile": "npm run build:cjs", + "build:cjs": "rollup -c", + "prepare": "npm run compile" + }, + "repository": { + "type": "git", + "url": "https://github.com/yargs/yargs-parser.git" + }, + "keywords": [ + "argument", + "parser", + "yargs", + "command", + "cli", + "parsing", + "option", + "args", + "argument" + ], + "author": "Ben Coe ", + "license": "ISC", + "devDependencies": { + "@types/chai": "^4.2.11", + "@types/mocha": "^9.0.0", + "@types/node": "^16.11.4", + "@typescript-eslint/eslint-plugin": "^3.10.1", + "@typescript-eslint/parser": "^3.10.1", + "c8": "^7.3.0", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "eslint": "^7.0.0", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-node": "^11.0.0", + "gts": "^3.0.0", + "mocha": "^10.0.0", + "puppeteer": "^16.0.0", + "rimraf": "^3.0.2", + "rollup": "^2.22.1", + "rollup-plugin-cleanup": "^3.1.1", + "rollup-plugin-ts": "^3.0.2", + "serve": "^14.0.0", + "standardx": "^7.0.0", + "start-server-and-test": "^1.11.2", + "ts-transform-default-export": "^1.0.2", + "typescript": "^4.0.0" + }, + "files": [ + "browser.js", + "build", + "!*.d.ts", + "!*.d.cts" + ], + "engines": { + "node": ">=12" + }, + "standardx": { + "ignore": [ + "build" + ] + } +} diff --git a/node_modules/yargs-unparser/CHANGELOG.md b/node_modules/yargs-unparser/CHANGELOG.md new file mode 100644 index 0000000..0211982 --- /dev/null +++ b/node_modules/yargs-unparser/CHANGELOG.md @@ -0,0 +1,82 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [2.0.0](https://www.github.com/yargs/yargs-unparser/compare/v1.6.4...v2.0.0) (2020-10-02) + + +### ⚠ BREAKING CHANGES + +* upgrade deps drop Node 6/8 (#71) + +### Code Refactoring + +* upgrade deps drop Node 6/8 ([#71](https://www.github.com/yargs/yargs-unparser/issues/71)) ([c686882](https://www.github.com/yargs/yargs-unparser/commit/c686882f5ad554be44169e3745e741cb4ec898d0)) + +### [1.6.4](https://www.github.com/yargs/yargs-unparser/compare/v1.6.3...v1.6.4) (2020-10-01) + + +### Bug Fixes + +* **security:** upgraded flat to version ^5.0.2 ([9bd7c67](https://www.github.com/yargs/yargs-unparser/commit/9bd7c672e12417319c5d4de79070d9c7cd5107f2)) + +### [1.6.3](https://www.github.com/yargs/yargs-unparser/compare/v1.6.2...v1.6.3) (2020-06-17) + + +### Bug Fixes + +* test automatic publish ([209a487](https://www.github.com/yargs/yargs-unparser/commit/209a4870af799f4b200c2a89d7b7e50c9fd5fd1f)) + +### [1.6.2](https://www.github.com/yargs/yargs-unparser/compare/v1.6.1...v1.6.2) (2020-06-17) + + +### Bug Fixes + +* **readme:** marketing was injected dubiously into README ([#60](https://www.github.com/yargs/yargs-unparser/issues/60)) ([1167667](https://www.github.com/yargs/yargs-unparser/commit/1167667886fcb103c747e3c9855f353ee0e41c03)) + +### [1.6.1](https://www.github.com/yargs/yargs-unparser/compare/v1.6.0...v1.6.1) (2020-06-17) + + +### Bug Fixes + +* **deps:** downgrade yargs, such that we continue supporting Node 6 ([#57](https://www.github.com/yargs/yargs-unparser/issues/57)) ([f69406c](https://www.github.com/yargs/yargs-unparser/commit/f69406c34bead63011590f7b51a24a6f311c1a48)) + +## 1.6.0 (2019-07-30) + + +### Bug Fixes + +* **security:** update deps addressing recent audit vulnerabilities ([#40](https://github.com/yargs/yargs-unparser/issues/40)) ([2e74f1b](https://github.com/yargs/yargs-unparser/commit/2e74f1b)) +* address bug with camelCased flattened keys ([#32](https://github.com/yargs/yargs-unparser/issues/32)) ([981533a](https://github.com/yargs/yargs-unparser/commit/981533a)) +* **deps:** updated the lodash version to fix vulnerability ([#39](https://github.com/yargs/yargs-unparser/issues/39)) ([7375966](https://github.com/yargs/yargs-unparser/commit/7375966)) +* **package:** update yargs to version 10.0.3 ([f1eb4cb](https://github.com/yargs/yargs-unparser/commit/f1eb4cb)) +* **package:** update yargs to version 11.0.0 ([6aa7c91](https://github.com/yargs/yargs-unparser/commit/6aa7c91)) + + +### Features + +* add interoperation with minimist ([ba477f5](https://github.com/yargs/yargs-unparser/commit/ba477f5)) + + +# 1.5.0 (2018-11-30) + + +### Bug Fixes + +* **package:** update yargs to version 10.0.3 ([f1eb4cb](https://github.com/yargs/yargs-unparser/commit/f1eb4cb)) +* **package:** update yargs to version 11.0.0 ([6aa7c91](https://github.com/yargs/yargs-unparser/commit/6aa7c91)) + + +### Features + +* add interoperation with minimist ([ba477f5](https://github.com/yargs/yargs-unparser/commit/ba477f5)) + + + + +# [1.4.0](https://github.com/moxystudio/yargs-unparser/compare/v1.3.0...v1.4.0) (2017-12-30) + + +### Features + +* add interoperation with minimist ([ba477f5](https://github.com/moxystudio/yargs-unparser/commit/ba477f5)) diff --git a/node_modules/yargs-unparser/LICENSE b/node_modules/yargs-unparser/LICENSE new file mode 100644 index 0000000..347e735 --- /dev/null +++ b/node_modules/yargs-unparser/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Made With MOXY Lda + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/yargs-unparser/README.md b/node_modules/yargs-unparser/README.md new file mode 100644 index 0000000..a47cc4b --- /dev/null +++ b/node_modules/yargs-unparser/README.md @@ -0,0 +1,86 @@ +# yargs-unparser + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] + +[npm-url]:https://npmjs.org/package/yargs-unparser +[npm-image]:http://img.shields.io/npm/v/yargs-unparser.svg +[downloads-image]:http://img.shields.io/npm/dm/yargs-unparser.svg + +Converts back a `yargs` argv object to its original array form. + +Probably the unparser word doesn't even exist, but it sounds nice and goes well with [yargs-parser](https://github.com/yargs/yargs-parser). + +The code originally lived in [MOXY](https://github.com/moxystudio)'s GitHub but was later moved here for discoverability. + + +## Installation + +`$ npm install yargs-unparser` + + +## Usage + +```js +const parse = require('yargs-parser'); +const unparse = require('yargs-unparser'); + +const argv = parse(['--no-boolean', '--number', '4', '--string', 'foo'], { + boolean: ['boolean'], + number: ['number'], + string: ['string'], +}); +// { boolean: false, number: 4, string: 'foo', _: [] } + +const unparsedArgv = unparse(argv); +// ['--no-boolean', '--number', '4', '--string', 'foo']; +``` + +The second argument of `unparse` accepts an options object: + +- `alias`: The [aliases](https://github.com/yargs/yargs-parser#requireyargs-parserargs-opts) so that duplicate options aren't generated +- `default`: The [default](https://github.com/yargs/yargs-parser#requireyargs-parserargs-opts) values so that the options with default values are omitted +- `command`: The [command](https://github.com/yargs/yargs/blob/master/docs/advanced.md#commands) first argument so that command names and positional arguments are handled correctly + +### Example with `command` options + +```js +const yargs = require('yargs'); +const unparse = require('yargs-unparser'); + +const argv = yargs + .command('my-command ', 'My awesome command', (yargs) => + yargs + .option('boolean', { type: 'boolean' }) + .option('number', { type: 'number' }) + .option('string', { type: 'string' }) + ) + .parse(['my-command', 'hello', '--no-boolean', '--number', '4', '--string', 'foo']); +// { positional: 'hello', boolean: false, number: 4, string: 'foo', _: ['my-command'] } + +const unparsedArgv = unparse(argv, { + command: 'my-command ', +}); +// ['my-command', 'hello', '--no-boolean', '--number', '4', '--string', 'foo']; +``` + +### Caveats + +The returned array can be parsed again by `yargs-parser` using the default configuration. If you used custom configuration that you want `yargs-unparser` to be aware, please fill an [issue](https://github.com/yargs/yargs-unparser/issues). + +If you `coerce` in weird ways, things might not work correctly. + + +## Tests + +`$ npm test` +`$ npm test -- --watch` during development + +## Supported Node.js Versions + +Libraries in this ecosystem make a best effort to track +[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a +post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). + +## License + +[MIT License](http://opensource.org/licenses/MIT) diff --git a/node_modules/yargs-unparser/index.js b/node_modules/yargs-unparser/index.js new file mode 100644 index 0000000..c2b7581 --- /dev/null +++ b/node_modules/yargs-unparser/index.js @@ -0,0 +1,166 @@ +'use strict'; + +const flatten = require('flat'); +const camelcase = require('camelcase'); +const decamelize = require('decamelize'); +const isPlainObj = require('is-plain-obj'); + +function isAlias(key, alias) { + // TODO Switch to Object.values one Node.js 6 is dropped + return Object.keys(alias).some((id) => [].concat(alias[id]).indexOf(key) !== -1); +} + +function hasDefaultValue(key, value, defaults) { + return value === defaults[key]; +} + +function isCamelCased(key, argv) { + return /[A-Z]/.test(key) && camelcase(key) === key && // Is it camel case? + argv[decamelize(key, '-')] != null; // Is the standard version defined? +} + +function keyToFlag(key) { + return key.length === 1 ? `-${key}` : `--${key}`; +} + +function parseCommand(cmd) { + const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' '); + const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/); + const bregex = /\.*[\][<>]/g; + const firstCommand = splitCommand.shift(); + + if (!firstCommand) { throw new Error(`No command found in: ${cmd}`); } + const parsedCommand = { + cmd: firstCommand.replace(bregex, ''), + demanded: [], + optional: [], + }; + + splitCommand.forEach((cmd, i) => { + let variadic = false; + + cmd = cmd.replace(/\s/g, ''); + if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1) { variadic = true; } + if (/^\[/.test(cmd)) { + parsedCommand.optional.push({ + cmd: cmd.replace(bregex, '').split('|'), + variadic, + }); + } else { + parsedCommand.demanded.push({ + cmd: cmd.replace(bregex, '').split('|'), + variadic, + }); + } + }); + + return parsedCommand; +} + +function unparseOption(key, value, unparsed) { + if (typeof value === 'string') { + unparsed.push(keyToFlag(key), value); + } else if (value === true) { + unparsed.push(keyToFlag(key)); + } else if (value === false) { + unparsed.push(`--no-${key}`); + } else if (Array.isArray(value)) { + value.forEach((item) => unparseOption(key, item, unparsed)); + } else if (isPlainObj(value)) { + const flattened = flatten(value, { safe: true }); + + for (const flattenedKey in flattened) { + if (!isCamelCased(flattenedKey, flattened)) { + unparseOption(`${key}.${flattenedKey}`, flattened[flattenedKey], unparsed); + } + } + // Fallback case (numbers and other types) + } else if (value != null) { + unparsed.push(keyToFlag(key), `${value}`); + } +} + +function unparsePositional(argv, options, unparsed) { + const knownPositional = []; + + // Unparse command if set, collecting all known positional arguments + // e.g.: build + if (options.command) { + const { 0: cmd, index } = options.command.match(/[^<[]*/); + const { demanded, optional } = parseCommand(`foo ${options.command.substr(index + cmd.length)}`); + + // Push command (can be a deep command) + unparsed.push(...cmd.trim().split(/\s+/)); + + // Push positional arguments + [...demanded, ...optional].forEach(({ cmd: cmds, variadic }) => { + knownPositional.push(...cmds); + + const cmd = cmds[0]; + const args = (variadic ? argv[cmd] || [] : [argv[cmd]]) + .filter((arg) => arg != null) + .map((arg) => `${arg}`); + + unparsed.push(...args); + }); + } + + // Unparse unkown positional arguments + argv._ && unparsed.push(...argv._.slice(knownPositional.length)); + + return knownPositional; +} + +function unparseOptions(argv, options, knownPositional, unparsed) { + for (const key of Object.keys(argv)) { + const value = argv[key]; + + if ( + // Remove positional arguments + knownPositional.includes(key) || + // Remove special _, -- and $0 + ['_', '--', '$0'].includes(key) || + // Remove aliases + isAlias(key, options.alias) || + // Remove default values + hasDefaultValue(key, value, options.default) || + // Remove camel-cased + isCamelCased(key, argv) + ) { + continue; + } + + unparseOption(key, argv[key], unparsed); + } +} + +function unparseEndOfOptions(argv, options, unparsed) { + // Unparse ending (--) arguments if set + argv['--'] && unparsed.push('--', ...argv['--']); +} + +// ------------------------------------------------------------ + +function unparser(argv, options) { + options = Object.assign({ + alias: {}, + default: {}, + command: null, + }, options); + + const unparsed = []; + + // Unparse known & unknown positional arguments (foo [rest...]) + // All known positional will be returned so that they are not added as flags + const knownPositional = unparsePositional(argv, options, unparsed); + + // Unparse option arguments (--foo hello --bar hi) + unparseOptions(argv, options, knownPositional, unparsed); + + // Unparse "end-of-options" arguments (stuff after " -- ") + unparseEndOfOptions(argv, options, unparsed); + + return unparsed; +} + +module.exports = unparser; diff --git a/node_modules/yargs-unparser/node_modules/camelcase/index.d.ts b/node_modules/yargs-unparser/node_modules/camelcase/index.d.ts new file mode 100644 index 0000000..9db94e5 --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/camelcase/index.d.ts @@ -0,0 +1,103 @@ +declare namespace camelcase { + interface Options { + /** + Uppercase the first character: `foo-bar` → `FooBar`. + + @default false + */ + readonly pascalCase?: boolean; + + /** + Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. + + @default false + */ + readonly preserveConsecutiveUppercase?: boolean; + + /** + The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. + + Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm. + + Default: The host environment’s current locale. + + @example + ``` + import camelCase = require('camelcase'); + + camelCase('lorem-ipsum', {locale: 'en-US'}); + //=> 'loremIpsum' + camelCase('lorem-ipsum', {locale: 'tr-TR'}); + //=> 'loremİpsum' + camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); + //=> 'loremIpsum' + camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); + //=> 'loremİpsum' + ``` + */ + readonly locale?: false | string | readonly string[]; + } +} + +/** +Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. + +Correctly handles Unicode strings. + +@param input - String to convert to camel case. + +@example +``` +import camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('розовый_пушистый_единорог'); +//=> 'розовыйПушистыйЕдинорог' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); +//=> 'fooBAR' + +camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); +//=> 'FooBAR' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' + +camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) +//=> 'FooBAR' + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' +``` +*/ +declare function camelcase( + input: string | readonly string[], + options?: camelcase.Options +): string; + +export = camelcase; diff --git a/node_modules/yargs-unparser/node_modules/camelcase/index.js b/node_modules/yargs-unparser/node_modules/camelcase/index.js new file mode 100644 index 0000000..6ff4ee8 --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/camelcase/index.js @@ -0,0 +1,113 @@ +'use strict'; + +const UPPERCASE = /[\p{Lu}]/u; +const LOWERCASE = /[\p{Ll}]/u; +const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu; +const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u; +const SEPARATORS = /[_.\- ]+/; + +const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source); +const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu'); +const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu'); + +const preserveCamelCase = (string, toLowerCase, toUpperCase) => { + let isLastCharLower = false; + let isLastCharUpper = false; + let isLastLastCharUpper = false; + + for (let i = 0; i < string.length; i++) { + const character = string[i]; + + if (isLastCharLower && UPPERCASE.test(character)) { + string = string.slice(0, i) + '-' + string.slice(i); + isLastCharLower = false; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = true; + i++; + } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) { + string = string.slice(0, i - 1) + '-' + string.slice(i - 1); + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = false; + isLastCharLower = true; + } else { + isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character; + } + } + + return string; +}; + +const preserveConsecutiveUppercase = (input, toLowerCase) => { + LEADING_CAPITAL.lastIndex = 0; + + return input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1)); +}; + +const postProcess = (input, toUpperCase) => { + SEPARATORS_AND_IDENTIFIER.lastIndex = 0; + NUMBERS_AND_IDENTIFIER.lastIndex = 0; + + return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)) + .replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m)); +}; + +const camelCase = (input, options) => { + if (!(typeof input === 'string' || Array.isArray(input))) { + throw new TypeError('Expected the input to be `string | string[]`'); + } + + options = { + pascalCase: false, + preserveConsecutiveUppercase: false, + ...options + }; + + if (Array.isArray(input)) { + input = input.map(x => x.trim()) + .filter(x => x.length) + .join('-'); + } else { + input = input.trim(); + } + + if (input.length === 0) { + return ''; + } + + const toLowerCase = options.locale === false ? + string => string.toLowerCase() : + string => string.toLocaleLowerCase(options.locale); + const toUpperCase = options.locale === false ? + string => string.toUpperCase() : + string => string.toLocaleUpperCase(options.locale); + + if (input.length === 1) { + return options.pascalCase ? toUpperCase(input) : toLowerCase(input); + } + + const hasUpperCase = input !== toLowerCase(input); + + if (hasUpperCase) { + input = preserveCamelCase(input, toLowerCase, toUpperCase); + } + + input = input.replace(LEADING_SEPARATORS, ''); + + if (options.preserveConsecutiveUppercase) { + input = preserveConsecutiveUppercase(input, toLowerCase); + } else { + input = toLowerCase(input); + } + + if (options.pascalCase) { + input = toUpperCase(input.charAt(0)) + input.slice(1); + } + + return postProcess(input, toUpperCase); +}; + +module.exports = camelCase; +// TODO: Remove this for the next major release +module.exports.default = camelCase; diff --git a/node_modules/yargs-unparser/node_modules/camelcase/license b/node_modules/yargs-unparser/node_modules/camelcase/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/camelcase/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yargs-unparser/node_modules/camelcase/package.json b/node_modules/yargs-unparser/node_modules/camelcase/package.json new file mode 100644 index 0000000..c433579 --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/camelcase/package.json @@ -0,0 +1,44 @@ +{ + "name": "camelcase", + "version": "6.3.0", + "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", + "license": "MIT", + "repository": "sindresorhus/camelcase", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert", + "pascalcase", + "pascal-case" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.11.0", + "xo": "^0.28.3" + } +} diff --git a/node_modules/yargs-unparser/node_modules/camelcase/readme.md b/node_modules/yargs-unparser/node_modules/camelcase/readme.md new file mode 100644 index 0000000..0ff8f9e --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/camelcase/readme.md @@ -0,0 +1,144 @@ +# camelcase + +> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` + +Correctly handles Unicode strings. + +If you use this on untrusted user input, don't forget to limit the length to something reasonable. + +## Install + +``` +$ npm install camelcase +``` + +*If you need to support Firefox < 78, stay on version 5 as version 6 uses regex features not available in Firefox < 78.* + +## Usage + +```js +const camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('розовый_пушистый_единорог'); +//=> 'розовыйПушистыйЕдинорог' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); +//=> 'fooBAR' + +camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); +//=> 'FooBAR' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' + +camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) +//=> 'FooBAR' + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' +``` + +## API + +### camelCase(input, options?) + +#### input + +Type: `string | string[]` + +String to convert to camel case. + +#### options + +Type: `object` + +##### pascalCase + +Type: `boolean`\ +Default: `false` + +Uppercase the first character: `foo-bar` → `FooBar` + +##### preserveConsecutiveUppercase + +Type: `boolean`\ +Default: `false` + +Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. + +##### locale + +Type: `false | string | string[]`\ +Default: The host environment’s current locale. + +The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. + +```js +const camelCase = require('camelcase'); + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' + +camelCase('lorem-ipsum', {locale: 'tr-TR'}); +//=> 'loremİpsum' + +camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); +//=> 'loremIpsum' + +camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); +//=> 'loremİpsum' +``` + +Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm: + +```js +const camelCase = require('camelcase'); + +// On a platform with 'tr-TR' + +camelCase('lorem-ipsum'); +//=> 'loremİpsum' + +camelCase('lorem-ipsum', {locale: false}); +//=> 'loremIpsum' +``` + +## camelcase for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of camelcase and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module +- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase +- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string +- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one +- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - Convert object keys to camel case diff --git a/node_modules/yargs-unparser/node_modules/decamelize/index.d.ts b/node_modules/yargs-unparser/node_modules/decamelize/index.d.ts new file mode 100644 index 0000000..a751feb --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/decamelize/index.d.ts @@ -0,0 +1,20 @@ +/** +Convert a camelized string into a lowercased one with a custom separator: `unicornRainbow` → `unicorn_rainbow`. + +@param string - The camelcase string to decamelize. +@param separator - The separator to use to put in between the words from `string`. Default: `'_'`. + +@example +``` +import decamelize = require('decamelize'); + +decamelize('unicornRainbow'); +//=> 'unicorn_rainbow' + +decamelize('unicornRainbow', '-'); +//=> 'unicorn-rainbow' +``` +*/ +declare function decamelize(string: string, separator?: string): string; + +export = decamelize; diff --git a/node_modules/yargs-unparser/node_modules/decamelize/index.js b/node_modules/yargs-unparser/node_modules/decamelize/index.js new file mode 100644 index 0000000..702e270 --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/decamelize/index.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = (text, separator = '_') => { + if (!(typeof text === 'string' && typeof separator === 'string')) { + throw new TypeError('The `text` and `separator` arguments should be of type `string`'); + } + + return text + .replace(/([\p{Lowercase_Letter}\d])(\p{Uppercase_Letter})/gu, `$1${separator}$2`) + .replace(/(\p{Uppercase_Letter}+)(\p{Uppercase_Letter}\p{Lowercase_Letter}+)/gu, `$1${separator}$2`) + .toLowerCase(); +}; diff --git a/node_modules/yargs-unparser/node_modules/decamelize/license b/node_modules/yargs-unparser/node_modules/decamelize/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/decamelize/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yargs-unparser/node_modules/decamelize/package.json b/node_modules/yargs-unparser/node_modules/decamelize/package.json new file mode 100644 index 0000000..116ae7a --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/decamelize/package.json @@ -0,0 +1,40 @@ +{ + "name": "decamelize", + "version": "4.0.0", + "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow", + "license": "MIT", + "repository": "sindresorhus/decamelize", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "decamelize", + "decamelcase", + "camelcase", + "lowercase", + "case", + "dash", + "hyphen", + "string", + "text", + "convert" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.11.0", + "xo": "^0.24.0" + } +} diff --git a/node_modules/yargs-unparser/node_modules/decamelize/readme.md b/node_modules/yargs-unparser/node_modules/decamelize/readme.md new file mode 100644 index 0000000..4fd4e2c --- /dev/null +++ b/node_modules/yargs-unparser/node_modules/decamelize/readme.md @@ -0,0 +1,51 @@ +# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize) + +> Convert a camelized string into a lowercased one with a custom separator
+> Example: `unicornRainbow` → `unicorn_rainbow` + +## Install + +``` +$ npm install decamelize +``` + +## Usage + +```js +const decamelize = require('decamelize'); + +decamelize('unicornRainbow'); +//=> 'unicorn_rainbow' + +decamelize('unicornRainbow', '-'); +//=> 'unicorn-rainbow' +``` + +## API + +### decamelize(input, separator?) + +#### input + +Type: `string` + +#### separator + +Type: `string`\ +Default: `'_'` + +## Related + +See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse. + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/yargs-unparser/package.json b/node_modules/yargs-unparser/package.json new file mode 100644 index 0000000..1cd24a1 --- /dev/null +++ b/node_modules/yargs-unparser/package.json @@ -0,0 +1,49 @@ +{ + "name": "yargs-unparser", + "description": "Converts back a yargs argv object to its original array form", + "version": "2.0.0", + "keywords": [ + "yargs", + "unparse", + "expand", + "inverse", + "argv" + ], + "author": "André Cruz ", + "engines": { + "node": ">=10" + }, + "homepage": "https://github.com/yargs/yargs-unparser", + "repository": "yargs/yargs-unparser", + "license": "MIT", + "main": "index.js", + "files": [], + "scripts": { + "lint": "eslint .", + "fix": "eslint . --fix", + "test": "jest --env node --coverage", + "prerelease": "npm t && npm run lint", + "precommit": "lint-staged" + }, + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ] + }, + "devDependencies": { + "eslint": "^6.1.0", + "eslint-config-moxy": "^7.1.0", + "husky": "^3.0.1", + "jest": "^24.9.0", + "lint-staged": "^9.5.0", + "minimist": "^1.2.5", + "yargs-parser": "^18.1.3" + }, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + } +} diff --git a/node_modules/yargs/LICENSE b/node_modules/yargs/LICENSE new file mode 100644 index 0000000..b0145ca --- /dev/null +++ b/node_modules/yargs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/yargs/README.md b/node_modules/yargs/README.md new file mode 100644 index 0000000..51f5b22 --- /dev/null +++ b/node_modules/yargs/README.md @@ -0,0 +1,204 @@ +

+ +

+

Yargs

+

+ Yargs be a node.js library fer hearties tryin' ter parse optstrings +

+ +
+ +![ci](https://github.com/yargs/yargs/workflows/ci/badge.svg) +[![NPM version][npm-image]][npm-url] +[![js-standard-style][standard-image]][standard-url] +[![Coverage][coverage-image]][coverage-url] +[![Conventional Commits][conventional-commits-image]][conventional-commits-url] +[![Slack][slack-image]][slack-url] + +## Description +Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. + +It gives you: + +* commands and (grouped) options (`my-program.js serve --port=5000`). +* a dynamically generated help menu based on your arguments: + +``` +mocha [spec..] + +Run tests with Mocha + +Commands + mocha inspect [spec..] Run tests with Mocha [default] + mocha init create a client-side Mocha setup at + +Rules & Behavior + --allow-uncaught Allow uncaught errors to propagate [boolean] + --async-only, -A Require all tests to use a callback (async) or + return a Promise [boolean] +``` + +* bash-completion shortcuts for commands and options. +* and [tons more](/docs/api.md). + +## Installation + +Stable version: +```bash +npm i yargs +``` + +Bleeding edge version with the most recent features: +```bash +npm i yargs@next +``` + +## Usage + +### Simple Example + +```javascript +#!/usr/bin/env node +const yargs = require('yargs/yargs') +const { hideBin } = require('yargs/helpers') +const argv = yargs(hideBin(process.argv)).argv + +if (argv.ships > 3 && argv.distance < 53.5) { + console.log('Plunder more riffiwobbles!') +} else { + console.log('Retreat from the xupptumblers!') +} +``` + +```bash +$ ./plunder.js --ships=4 --distance=22 +Plunder more riffiwobbles! + +$ ./plunder.js --ships 12 --distance 98.7 +Retreat from the xupptumblers! +``` + +> Note: `hideBin` is a shorthand for [`process.argv.slice(2)`](https://nodejs.org/en/knowledge/command-line/how-to-parse-command-line-arguments/). It has the benefit that it takes into account variations in some environments, e.g., [Electron](https://github.com/electron/electron/issues/4690). + +### Complex Example + +```javascript +#!/usr/bin/env node +const yargs = require('yargs/yargs') +const { hideBin } = require('yargs/helpers') + +yargs(hideBin(process.argv)) + .command('serve [port]', 'start the server', (yargs) => { + return yargs + .positional('port', { + describe: 'port to bind on', + default: 5000 + }) + }, (argv) => { + if (argv.verbose) console.info(`start server on :${argv.port}`) + serve(argv.port) + }) + .option('verbose', { + alias: 'v', + type: 'boolean', + description: 'Run with verbose logging' + }) + .parse() +``` + +Run the example above with `--help` to see the help for the application. + +## Supported Platforms + +### TypeScript + +yargs has type definitions at [@types/yargs][type-definitions]. + +``` +npm i @types/yargs --save-dev +``` + +See usage examples in [docs](/docs/typescript.md). + +### Deno + +As of `v16`, `yargs` supports [Deno](https://github.com/denoland/deno): + +```typescript +import yargs from 'https://deno.land/x/yargs/deno.ts' +import { Arguments } from 'https://deno.land/x/yargs/deno-types.ts' + +yargs(Deno.args) + .command('download ', 'download a list of files', (yargs: any) => { + return yargs.positional('files', { + describe: 'a list of files to do something with' + }) + }, (argv: Arguments) => { + console.info(argv) + }) + .strictCommands() + .demandCommand(1) + .parse() +``` + +### ESM + +As of `v16`,`yargs` supports ESM imports: + +```js +import yargs from 'yargs' +import { hideBin } from 'yargs/helpers' + +yargs(hideBin(process.argv)) + .command('curl ', 'fetch the contents of the URL', () => {}, (argv) => { + console.info(argv) + }) + .demandCommand(1) + .parse() +``` + +### Usage in Browser + +See examples of using yargs in the browser in [docs](/docs/browser.md). + +## Community + +Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). + +## Documentation + +### Table of Contents + +* [Yargs' API](/docs/api.md) +* [Examples](/docs/examples.md) +* [Parsing Tricks](/docs/tricks.md) + * [Stop the Parser](/docs/tricks.md#stop) + * [Negating Boolean Arguments](/docs/tricks.md#negate) + * [Numbers](/docs/tricks.md#numbers) + * [Arrays](/docs/tricks.md#arrays) + * [Objects](/docs/tricks.md#objects) + * [Quotes](/docs/tricks.md#quotes) +* [Advanced Topics](/docs/advanced.md) + * [Composing Your App Using Commands](/docs/advanced.md#commands) + * [Building Configurable CLI Apps](/docs/advanced.md#configuration) + * [Customizing Yargs' Parser](/docs/advanced.md#customizing) + * [Bundling yargs](/docs/bundling.md) +* [Contributing](/contributing.md) + +## Supported Node.js Versions + +Libraries in this ecosystem make a best effort to track +[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a +post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a). + +[npm-url]: https://www.npmjs.com/package/yargs +[npm-image]: https://img.shields.io/npm/v/yargs.svg +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg +[standard-url]: http://standardjs.com/ +[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg +[conventional-commits-url]: https://conventionalcommits.org/ +[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg +[slack-url]: http://devtoolscommunity.herokuapp.com +[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs +[coverage-image]: https://img.shields.io/nycrc/yargs/yargs +[coverage-url]: https://github.com/yargs/yargs/blob/main/.nycrc diff --git a/node_modules/yargs/browser.d.ts b/node_modules/yargs/browser.d.ts new file mode 100644 index 0000000..21f3fc6 --- /dev/null +++ b/node_modules/yargs/browser.d.ts @@ -0,0 +1,5 @@ +import {YargsFactory} from './build/lib/yargs-factory'; + +declare const Yargs: ReturnType; + +export default Yargs; diff --git a/node_modules/yargs/browser.mjs b/node_modules/yargs/browser.mjs new file mode 100644 index 0000000..2d0d6e9 --- /dev/null +++ b/node_modules/yargs/browser.mjs @@ -0,0 +1,7 @@ +// Bootstrap yargs for browser: +import browserPlatformShim from './lib/platform-shims/browser.mjs'; +import {YargsFactory} from './build/lib/yargs-factory.js'; + +const Yargs = YargsFactory(browserPlatformShim); + +export default Yargs; diff --git a/node_modules/yargs/build/index.cjs b/node_modules/yargs/build/index.cjs new file mode 100644 index 0000000..e9cf013 --- /dev/null +++ b/node_modules/yargs/build/index.cjs @@ -0,0 +1 @@ +"use strict";var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(du)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h(" [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const M=/(^\*)|(^\$0)/;class _{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!M.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(M,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(x(h)){s.getInternalMethods().getUsageInstance().freeze();const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(s.getInternalMethods().getUsageInstance().freeze(),l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=M.test(e.original)?e.original.replace(M,"").trim():e.original,i=t.filter((t=>!M.test(t)));return i.push(s),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,e,s,i,n,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(n,a,r.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const i=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,r,o,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!r.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=C(s,o,h,!0);return f(l)?l.then((s=>this.handleValidationAndGetResult(t,e,s,i,r,o,h,a))):this.handleValidationAndGetResult(t,e,l,i,r,o,h,a)}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])})),Object.keys(a.argv).forEach((n=>{s.includes(n)&&(e[n]||(e[n]=a.argv[n]),!this.isInConfigs(i,n)&&!this.isDefaulted(i,n)&&Object.prototype.hasOwnProperty.call(t,n)&&Object.prototype.hasOwnProperty.call(a.argv,n)&&(Array.isArray(t[n])||Array.isArray(a.argv[n]))?t[n]=[].concat(t[n],a.argv[n]):t[n]=a.argv[n])}))}}isDefaulted(t,e){const{default:s}=t.getOptions();return Object.prototype.hasOwnProperty.call(s,e)||Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:s}=t.getOptions();return s.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||s.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=M.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(x(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,i=Object.keys(require.cache);s{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;n.wrap=t=>{b=!0,y=t},n.getWrap=()=>s.getEnv("YARGS_DISABLE_WRAP")?null:(b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y);const v="__yargsString__:";function O(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let w;function C(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function j(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>v+t,n.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(C),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=n.getWrap(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach((t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})})),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";u.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:O(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()})),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(l.alias[t]||[]).indexOf(e)))));const _=i("Options:");h[_]||(h[_]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(g,l.alias,h,_);const k=t=>/^--/.test(I(t)),x=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(C).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>k(t)===k(e)?0:k(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>k(e[t])))))&&x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;k(e[t])&&(e[t]=(s=e[t],i=4,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),x.forEach((({groupName:e,normalizedKeys:s,switches:o})=>{b.div(e),s.forEach((e=>{const s=o[e];let h=p[e]||"",c=null;h.includes(v)&&(h=i(h.substring(16))),l.boolean.includes(e)&&(c=`[${i("boolean")}]`),l.count.includes(e)&&(c=`[${i("count")}]`),l.string.includes(e)&&(c=`[${i("string")}]`),l.normalize.includes(e)&&(c=`[${i("string")}]`),l.array.includes(e)&&(c=`[${i("array")}]`),l.number.includes(e)&&(c=`[${i("number")}]`);const f=[e in a?(d=a[e],"string"==typeof d?`[${i("deprecated: %s",d)}]`:`[${i("deprecated")}]`):null,c,e in r?`[${i("required")}]`:null,l.choices&&l.choices[e]?`[${i("choices:")} ${n.stringifiedValues(l.choices[e])}]`:null,j(l.default[e],l.defaultDescription[e])].filter(Boolean).join(" ");var d;b.span({text:I(s),padding:[0,2,0,2+$(s)],width:O(o,y)+4},h);const u=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];f&&!u?b.div({text:f,padding:[0,0,0,2],align:"right"}):b.div()})),b.div()})),d.length&&(b.div(i("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:O(d,y)+4},{text:t[1]})})),b.div()),m.length>0){const t=m.map((t=>t.replace(/\$0/g,e))).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){w=this.help()},n.clearCachedHelpMessage=function(){w=void 0},n.hasCachedHelpMessage=function(){return!!w},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,(e=>!t[e])),n};const _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=_.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class D{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const s=this.yargs.getOptions(),n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach((r=>{const o=!!s.configuration["boolean-negation"]&&s.boolean.includes(r);n.includes(r)||s.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||this.completeOptionKey(r,t,i,o&&!!s.default[r])}))}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s){const i=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(i(e))return!0;if(s&&i(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(i(t))return!0;return!1}completeOptionKey(t,e,s,i){var n,r,o,a;let h=t;if(this.zshShell){const e=this.usage.getDescriptions(),s=null===(r=null===(n=null==this?void 0:this.aliases)||void 0===n?void 0:n[t])||void 0===r?void 0:r.find((t=>{const s=e[t];return"string"==typeof s&&s.length>0})),i=s?e[s]:void 0,l=null!==(a=null!==(o=e[t])&&void 0!==o?o:i)&&void 0!==a?a:"";h=`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const l=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";e.push(l+h),i&&e.push(l+"no-"+h)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function N(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,W,q,U,F,L,V,G,R,T,B,Y,K,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt,yt;const bt=Symbol("copyDoubleDash"),vt=Symbol("copyDoubleDash"),Ot=Symbol("deleteFromParserHintObject"),wt=Symbol("emitWarning"),Ct=Symbol("freeze"),jt=Symbol("getDollarZero"),Mt=Symbol("getParserConfiguration"),_t=Symbol("getUsageConfiguration"),kt=Symbol("guessLocale"),xt=Symbol("guessVersion"),Et=Symbol("parsePositionalNumbers"),At=Symbol("pkgUp"),Pt=Symbol("populateParserHintArray"),St=Symbol("populateParserHintSingleValueDictionary"),$t=Symbol("populateParserHintArrayDictionary"),It=Symbol("populateParserHintDictionary"),Dt=Symbol("sanitizeKey"),Nt=Symbol("setKey"),Ht=Symbol("unfreeze"),zt=Symbol("validateAsync"),Wt=Symbol("getCommandInstance"),qt=Symbol("getContext"),Ut=Symbol("getHasOutput"),Ft=Symbol("getLoggerInstance"),Lt=Symbol("getParseContext"),Vt=Symbol("getUsageInstance"),Gt=Symbol("getValidationInstance"),Rt=Symbol("hasParseCallback"),Tt=Symbol("isGlobalContext"),Bt=Symbol("postProcess"),Yt=Symbol("rebase"),Kt=Symbol("reset"),Jt=Symbol("runYargsParserAndExecuteCommands"),Zt=Symbol("runValidation"),Xt=Symbol("setHasOutput"),Qt=Symbol("kTrackManuallySetKeys");class te{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),W.set(this,void 0),q.set(this,{commands:[],fullCommands:[]}),U.set(this,null),F.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),B.set(this,[]),Y.set(this,void 0),K.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,{}),mt.set(this,null),yt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,W,e,"f"),O(this,st,s,"f"),O(this,Y,new w(this),"f"),this.$0=this[jt](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,yt,v(this,yt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[vt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[Ot](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h(" [string|array]",[t,e],arguments.length),this[$t](this.alias.bind(this),"alias",t,e),this}array(t){return h("",[t],arguments.length),this[Pt]("array",t),this[Qt](t),this}boolean(t){return h("",[t],arguments.length),this[Pt]("boolean",t),this[Qt](t),this}check(t,e){return h(" [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e,s.getOptions())),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h(" [string|array]",[t,e],arguments.length),this[$t](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h(" [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,Y,"f").addCoerceMiddleware(((i,n)=>{let r;return Object.prototype.hasOwnProperty.call(i,t)?j((()=>(r=n.getAliases(),s(i[t]))),(e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)})):i}),t),this}conflicts(t,e){return h(" [string|array]",[t,e],arguments.length),v(this,yt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,et,"f").config[t]=s||!0})),this):(t=n(t,v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,F,t||v(this,F,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,F,"f"),e),s&&v(this,U,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h(" [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h(" [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("",[t],arguments.length),this[Pt]("count",t),this[Qt](t),this}default(t,e,s){return h(" [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[St](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h(" [string]",[t,e],arguments.length),this[St](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h(" [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h(" [string]",[t,e],arguments.length),this[Nt](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h(" [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h(" [function]",[t,e],arguments.length),e?v(this,U,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,U,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,K,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,pt,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,pt,"f").help()))}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h(" [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)})),this}group(t,e){h(" ",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,K,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,K,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h(" [number|string|array]",[t,e],arguments.length),v(this,yt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),void 0===t?(this[kt](),v(this,ct,"f").y18n.getLocale()):(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this)}middleware(t,e,s){return v(this,Y,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h(" [number]",[t,e],arguments.length),this[St](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("",[t],arguments.length),this[Pt]("normalize",t),this}number(t){return h("",[t],arguments.length),this[Pt]("number",t),this[Qt](t),this}option(t,e){if(h(" [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Qt](t),!v(this,mt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[wt](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc,r=v(this,pt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof n||this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[Ct](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Jt](t,!!e),n=this.parsed;return v(this,U,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t))).catch((t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t})).finally((()=>{this[Ht](),this.parsed=n})):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Ht](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h(" [string]",[t,e],arguments.length);let s=null;const i=this[At](e||v(this,W,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h(" ",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,q,"f").fullCommands[v(this,q,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h(" [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[St](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,U,"f").generateCompletionScript(t,e||v(this,F,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("",[t],arguments.length),this[Pt]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("",[t],arguments.length),this[Pt]("string",t),this[Qt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h(" [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}usageConfiguration(t){return h("",[t],arguments.length),O(this,gt,t,"f"),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,mt,"f")&&(this[Ot](v(this,mt,"f")),v(this,pt,"f").version(void 0),O(this,mt,null,"f")),0===arguments.length)s=this[xt](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,mt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,mt,"f")),this.describe(v(this,mt,"f"),e),this}wrap(t){return h("",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,W=new WeakMap,q=new WeakMap,U=new WeakMap,F=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,B=new WeakMap,Y=new WeakMap,K=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt=new WeakMap,bt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[vt](){return{log:(...t)=>{this[Rt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Rt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[Ot](t){p(v(this,et,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,pt,"f").getDescriptions()[t]}[wt](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[Ct](){v(this,B,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,K,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,F,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,yt,"f").freeze(),v(this,z,"f").freeze(),v(this,Y,"f").freeze()}[jt](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Yt](v(this,W,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.lengthe.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Pt](t,e){(e=[].concat(e)).forEach((e=>{e=this[Dt](e),v(this,et,"f")[t].push(e)}))}[St](t,e,s,i){this[It](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=s}))}[$t](t,e,s,i){this[It](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)}))}[It](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[Dt](s),i)}[Dt](t){return"__proto__"===t?"___proto___":t}[Nt](t,e){return this[St](this[Nt].bind(this),"key",t,e),this}[Ht](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,B,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,K,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,F,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,yt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,Y,"f").unfreeze()}[zt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Wt].bind(this),getContext:this[qt].bind(this),getHasOutput:this[Ut].bind(this),getLoggerInstance:this[Ft].bind(this),getParseContext:this[Lt].bind(this),getParserConfiguration:this[Mt].bind(this),getUsageConfiguration:this[_t].bind(this),getUsageInstance:this[Vt].bind(this),getValidationInstance:this[Gt].bind(this),hasParseCallback:this[Rt].bind(this),isGlobalContext:this[Tt].bind(this),postProcess:this[Bt].bind(this),reset:this[Kt].bind(this),runValidation:this[Zt].bind(this),runYargsParserAndExecuteCommands:this[Jt].bind(this),setHasOutput:this[Xt].bind(this)}}[Wt](){return v(this,z,"f")}[qt](){return v(this,q,"f")}[Ut](){return v(this,J,"f")}[Ft](){return v(this,Q,"f")}[Lt](){return v(this,rt,"f")||{}}[Vt](){return v(this,pt,"f")}[Gt](){return v(this,yt,"f")}[Rt](){return!!v(this,nt,"f")}[Tt](){return v(this,X,"f")}[Bt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[bt](t));return(this[Mt]()["parse-positional-numbers"]||void 0===this[Mt]()["parse-positional-numbers"])&&(t=this[Et](t)),i&&(t=C(t,this,v(this,Y,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,at,"f"),Object.keys(v(this,K,"f")).reduce(((t,e)=>{const i=v(this,K,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,K,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,et,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,et,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,yt,v(this,yt,"f")?v(this,yt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(ri._.max)&&(ri._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h(" [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h(" [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=N(t,e);s<=3&&s!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new _(t,e,s,i)}(v(this,pt,"f"),v(this,yt,"f"),v(this,Y,"f"),v(this,ct,"f")),"f"),v(this,U,"f")||O(this,U,function(t,e,s,i){return new D(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,Y,"f").reset(),O(this,F,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Yt](t,e){return v(this,ct,"f").path.relative(t,e)}[Jt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[Mt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,mt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[kt](),s)return this[Bt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,U,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,F,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(!t&&e!==v(this,F,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,yt,"f").recommendCommands(t,h)}v(this,F,"f")&&c._.includes(v(this,F,"f"))&&!m&&(v(this,T,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(m){v(this,T,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,U,"f").completionKey}`)+1);return v(this,U,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,Q,"f").log(t)})),this.exit(0)})),this[Bt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&E(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Zt](u,{},l.error);i||(d=C(c,this,v(this,Y,"f").getMiddleware(),!0)),d=this[zt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,Y,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Bt](null!=d?d:c,a,!!i,!0)}[Zt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,yt,"f").nonOptionCount(o),v(this,yt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,yt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,yt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,yt,"f").unknownArguments(o,t,{},!1,!1),v(this,yt,"f").limitedChoices(o),v(this,yt,"f").implications(o),v(this,yt,"f").conflicting(o)}}[Xt](){O(this,J,!0,"f")}[Qt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var ee,se;const{readFileSync:ie}=require("fs"),{inspect:ne}=require("util"),{resolve:re}=require("path"),oe=require("y18n"),ae=require("yargs-parser");var he,le={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:ne,mainFilename:null!==(se=null===(ee=null===require||void 0===require?void 0:require.main)||void 0===ee?void 0:ee.filename)&&void 0!==se?se:process.cwd(),Parser:ae,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ie,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:oe({directory:re(__dirname,"../locales"),updateFiles:!1})};const ce=(null===(he=null===process||void 0===process?void 0:process.env)||void 0===he?void 0:he.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1]){const i=new te(t,e,s,de);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:fe,processArgv:b,YError:e};module.exports=ue; diff --git a/node_modules/yargs/build/lib/argsert.js b/node_modules/yargs/build/lib/argsert.js new file mode 100644 index 0000000..be5b3aa --- /dev/null +++ b/node_modules/yargs/build/lib/argsert.js @@ -0,0 +1,62 @@ +import { YError } from './yerror.js'; +import { parseCommand } from './parse-command.js'; +const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth']; +export function argsert(arg1, arg2, arg3) { + function parseArgs() { + return typeof arg1 === 'object' + ? [{ demanded: [], optional: [] }, arg1, arg2] + : [ + parseCommand(`cmd ${arg1}`), + arg2, + arg3, + ]; + } + try { + let position = 0; + const [parsed, callerArguments, _length] = parseArgs(); + const args = [].slice.call(callerArguments); + while (args.length && args[args.length - 1] === undefined) + args.pop(); + const length = _length || args.length; + if (length < parsed.demanded.length) { + throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`); + } + const totalCommands = parsed.demanded.length + parsed.optional.length; + if (length > totalCommands) { + throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`); + } + parsed.demanded.forEach(demanded => { + const arg = args.shift(); + const observedType = guessType(arg); + const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*'); + if (matchingTypes.length === 0) + argumentTypeError(observedType, demanded.cmd, position); + position += 1; + }); + parsed.optional.forEach(optional => { + if (args.length === 0) + return; + const arg = args.shift(); + const observedType = guessType(arg); + const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*'); + if (matchingTypes.length === 0) + argumentTypeError(observedType, optional.cmd, position); + position += 1; + }); + } + catch (err) { + console.warn(err.stack); + } +} +function guessType(arg) { + if (Array.isArray(arg)) { + return 'array'; + } + else if (arg === null) { + return 'null'; + } + return typeof arg; +} +function argumentTypeError(observedType, allowedTypes, position) { + throw new YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`); +} diff --git a/node_modules/yargs/build/lib/command.js b/node_modules/yargs/build/lib/command.js new file mode 100644 index 0000000..47c1ed6 --- /dev/null +++ b/node_modules/yargs/build/lib/command.js @@ -0,0 +1,449 @@ +import { assertNotStrictEqual, } from './typings/common-types.js'; +import { isPromise } from './utils/is-promise.js'; +import { applyMiddleware, commandMiddlewareFactory, } from './middleware.js'; +import { parseCommand } from './parse-command.js'; +import { isYargsInstance, } from './yargs-factory.js'; +import { maybeAsyncResult } from './utils/maybe-async-result.js'; +import whichModule from './utils/which-module.js'; +const DEFAULT_MARKER = /(^\*)|(^\$0)/; +export class CommandInstance { + constructor(usage, validation, globalMiddleware, shim) { + this.requireCache = new Set(); + this.handlers = {}; + this.aliasMap = {}; + this.frozens = []; + this.shim = shim; + this.usage = usage; + this.globalMiddleware = globalMiddleware; + this.validation = validation; + } + addDirectory(dir, req, callerFile, opts) { + opts = opts || {}; + if (typeof opts.recurse !== 'boolean') + opts.recurse = false; + if (!Array.isArray(opts.extensions)) + opts.extensions = ['js']; + const parentVisit = typeof opts.visit === 'function' ? opts.visit : (o) => o; + opts.visit = (obj, joined, filename) => { + const visited = parentVisit(obj, joined, filename); + if (visited) { + if (this.requireCache.has(joined)) + return visited; + else + this.requireCache.add(joined); + this.addHandler(visited); + } + return visited; + }; + this.shim.requireDirectory({ require: req, filename: callerFile }, dir, opts); + } + addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) { + let aliases = []; + const middlewares = commandMiddlewareFactory(commandMiddleware); + handler = handler || (() => { }); + if (Array.isArray(cmd)) { + if (isCommandAndAliases(cmd)) { + [cmd, ...aliases] = cmd; + } + else { + for (const command of cmd) { + this.addHandler(command); + } + } + } + else if (isCommandHandlerDefinition(cmd)) { + let command = Array.isArray(cmd.command) || typeof cmd.command === 'string' + ? cmd.command + : this.moduleName(cmd); + if (cmd.aliases) + command = [].concat(command).concat(cmd.aliases); + this.addHandler(command, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated); + return; + } + else if (isCommandBuilderDefinition(builder)) { + this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated); + return; + } + if (typeof cmd === 'string') { + const parsedCommand = parseCommand(cmd); + aliases = aliases.map(alias => parseCommand(alias).cmd); + let isDefault = false; + const parsedAliases = [parsedCommand.cmd].concat(aliases).filter(c => { + if (DEFAULT_MARKER.test(c)) { + isDefault = true; + return false; + } + return true; + }); + if (parsedAliases.length === 0 && isDefault) + parsedAliases.push('$0'); + if (isDefault) { + parsedCommand.cmd = parsedAliases[0]; + aliases = parsedAliases.slice(1); + cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd); + } + aliases.forEach(alias => { + this.aliasMap[alias] = parsedCommand.cmd; + }); + if (description !== false) { + this.usage.command(cmd, description, isDefault, aliases, deprecated); + } + this.handlers[parsedCommand.cmd] = { + original: cmd, + description, + handler, + builder: builder || {}, + middlewares, + deprecated, + demanded: parsedCommand.demanded, + optional: parsedCommand.optional, + }; + if (isDefault) + this.defaultCommand = this.handlers[parsedCommand.cmd]; + } + } + getCommandHandlers() { + return this.handlers; + } + getCommands() { + return Object.keys(this.handlers).concat(Object.keys(this.aliasMap)); + } + hasDefaultCommand() { + return !!this.defaultCommand; + } + runCommand(command, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) { + const commandHandler = this.handlers[command] || + this.handlers[this.aliasMap[command]] || + this.defaultCommand; + const currentContext = yargs.getInternalMethods().getContext(); + const parentCommands = currentContext.commands.slice(); + const isDefaultCommand = !command; + if (command) { + currentContext.commands.push(command); + currentContext.fullCommands.push(commandHandler.original); + } + const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet); + return isPromise(builderResult) + ? builderResult.then(result => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) + : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs); + } + applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) { + const builder = commandHandler.builder; + let innerYargs = yargs; + if (isCommandBuilderCallback(builder)) { + yargs.getInternalMethods().getUsageInstance().freeze(); + const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet); + if (isPromise(builderOutput)) { + return builderOutput.then(output => { + innerYargs = isYargsInstance(output) ? output : yargs; + return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly); + }); + } + } + else if (isCommandBuilderOptionDefinitions(builder)) { + yargs.getInternalMethods().getUsageInstance().freeze(); + innerYargs = yargs.getInternalMethods().reset(aliases); + Object.keys(commandHandler.builder).forEach(key => { + innerYargs.option(key, builder[key]); + }); + } + return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly); + } + parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) { + if (isDefaultCommand) + innerYargs.getInternalMethods().getUsageInstance().unfreeze(true); + if (this.shouldUpdateUsage(innerYargs)) { + innerYargs + .getInternalMethods() + .getUsageInstance() + .usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description); + } + const innerArgv = innerYargs + .getInternalMethods() + .runYargsParserAndExecuteCommands(null, undefined, true, commandIndex, helpOnly); + return isPromise(innerArgv) + ? innerArgv.then(argv => ({ + aliases: innerYargs.parsed.aliases, + innerArgv: argv, + })) + : { + aliases: innerYargs.parsed.aliases, + innerArgv: innerArgv, + }; + } + shouldUpdateUsage(yargs) { + return (!yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && + yargs.getInternalMethods().getUsageInstance().getUsage().length === 0); + } + usageFromParentCommandsCommandHandler(parentCommands, commandHandler) { + const c = DEFAULT_MARKER.test(commandHandler.original) + ? commandHandler.original.replace(DEFAULT_MARKER, '').trim() + : commandHandler.original; + const pc = parentCommands.filter(c => { + return !DEFAULT_MARKER.test(c); + }); + pc.push(c); + return `$0 ${pc.join(' ')}`; + } + handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) { + if (!yargs.getInternalMethods().getHasOutput()) { + const validation = yargs + .getInternalMethods() + .runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand); + innerArgv = maybeAsyncResult(innerArgv, result => { + validation(result); + return result; + }); + } + if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) { + yargs.getInternalMethods().setHasOutput(); + const populateDoubleDash = !!yargs.getOptions().configuration['populate--']; + yargs + .getInternalMethods() + .postProcess(innerArgv, populateDoubleDash, false, false); + innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false); + innerArgv = maybeAsyncResult(innerArgv, result => { + const handlerResult = commandHandler.handler(result); + return isPromise(handlerResult) + ? handlerResult.then(() => result) + : result; + }); + if (!isDefaultCommand) { + yargs.getInternalMethods().getUsageInstance().cacheHelpMessage(); + } + if (isPromise(innerArgv) && + !yargs.getInternalMethods().hasParseCallback()) { + innerArgv.catch(error => { + try { + yargs.getInternalMethods().getUsageInstance().fail(null, error); + } + catch (_err) { + } + }); + } + } + if (!isDefaultCommand) { + currentContext.commands.pop(); + currentContext.fullCommands.pop(); + } + return innerArgv; + } + applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) { + let positionalMap = {}; + if (helpOnly) + return innerArgv; + if (!yargs.getInternalMethods().getHasOutput()) { + positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs); + } + const middlewares = this.globalMiddleware + .getMiddleware() + .slice(0) + .concat(commandHandler.middlewares); + const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true); + return isPromise(maybePromiseArgv) + ? maybePromiseArgv.then(resolvedInnerArgv => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap)) + : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap); + } + populatePositionals(commandHandler, argv, context, yargs) { + argv._ = argv._.slice(context.commands.length); + const demanded = commandHandler.demanded.slice(0); + const optional = commandHandler.optional.slice(0); + const positionalMap = {}; + this.validation.positionalCount(demanded.length, argv._.length); + while (demanded.length) { + const demand = demanded.shift(); + this.populatePositional(demand, argv, positionalMap); + } + while (optional.length) { + const maybe = optional.shift(); + this.populatePositional(maybe, argv, positionalMap); + } + argv._ = context.commands.concat(argv._.map(a => '' + a)); + this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs); + return positionalMap; + } + populatePositional(positional, argv, positionalMap) { + const cmd = positional.cmd[0]; + if (positional.variadic) { + positionalMap[cmd] = argv._.splice(0).map(String); + } + else { + if (argv._.length) + positionalMap[cmd] = [String(argv._.shift())]; + } + } + cmdToParseOptions(cmdString) { + const parseOptions = { + array: [], + default: {}, + alias: {}, + demand: {}, + }; + const parsed = parseCommand(cmdString); + parsed.demanded.forEach(d => { + const [cmd, ...aliases] = d.cmd; + if (d.variadic) { + parseOptions.array.push(cmd); + parseOptions.default[cmd] = []; + } + parseOptions.alias[cmd] = aliases; + parseOptions.demand[cmd] = true; + }); + parsed.optional.forEach(o => { + const [cmd, ...aliases] = o.cmd; + if (o.variadic) { + parseOptions.array.push(cmd); + parseOptions.default[cmd] = []; + } + parseOptions.alias[cmd] = aliases; + }); + return parseOptions; + } + postProcessPositionals(argv, positionalMap, parseOptions, yargs) { + const options = Object.assign({}, yargs.getOptions()); + options.default = Object.assign(parseOptions.default, options.default); + for (const key of Object.keys(parseOptions.alias)) { + options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]); + } + options.array = options.array.concat(parseOptions.array); + options.config = {}; + const unparsed = []; + Object.keys(positionalMap).forEach(key => { + positionalMap[key].map(value => { + if (options.configuration['unknown-options-as-args']) + options.key[key] = true; + unparsed.push(`--${key}`); + unparsed.push(value); + }); + }); + if (!unparsed.length) + return; + const config = Object.assign({}, options.configuration, { + 'populate--': false, + }); + const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, { + configuration: config, + })); + if (parsed.error) { + yargs + .getInternalMethods() + .getUsageInstance() + .fail(parsed.error.message, parsed.error); + } + else { + const positionalKeys = Object.keys(positionalMap); + Object.keys(positionalMap).forEach(key => { + positionalKeys.push(...parsed.aliases[key]); + }); + Object.keys(parsed.argv).forEach(key => { + if (positionalKeys.includes(key)) { + if (!positionalMap[key]) + positionalMap[key] = parsed.argv[key]; + if (!this.isInConfigs(yargs, key) && + !this.isDefaulted(yargs, key) && + Object.prototype.hasOwnProperty.call(argv, key) && + Object.prototype.hasOwnProperty.call(parsed.argv, key) && + (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) { + argv[key] = [].concat(argv[key], parsed.argv[key]); + } + else { + argv[key] = parsed.argv[key]; + } + } + }); + } + } + isDefaulted(yargs, key) { + const { default: defaults } = yargs.getOptions(); + return (Object.prototype.hasOwnProperty.call(defaults, key) || + Object.prototype.hasOwnProperty.call(defaults, this.shim.Parser.camelCase(key))); + } + isInConfigs(yargs, key) { + const { configObjects } = yargs.getOptions(); + return (configObjects.some(c => Object.prototype.hasOwnProperty.call(c, key)) || + configObjects.some(c => Object.prototype.hasOwnProperty.call(c, this.shim.Parser.camelCase(key)))); + } + runDefaultBuilderOn(yargs) { + if (!this.defaultCommand) + return; + if (this.shouldUpdateUsage(yargs)) { + const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) + ? this.defaultCommand.original + : this.defaultCommand.original.replace(/^[^[\]<>]*/, '$0 '); + yargs + .getInternalMethods() + .getUsageInstance() + .usage(commandString, this.defaultCommand.description); + } + const builder = this.defaultCommand.builder; + if (isCommandBuilderCallback(builder)) { + return builder(yargs, true); + } + else if (!isCommandBuilderDefinition(builder)) { + Object.keys(builder).forEach(key => { + yargs.option(key, builder[key]); + }); + } + return undefined; + } + moduleName(obj) { + const mod = whichModule(obj); + if (!mod) + throw new Error(`No command name given for module: ${this.shim.inspect(obj)}`); + return this.commandFromFilename(mod.filename); + } + commandFromFilename(filename) { + return this.shim.path.basename(filename, this.shim.path.extname(filename)); + } + extractDesc({ describe, description, desc }) { + for (const test of [describe, description, desc]) { + if (typeof test === 'string' || test === false) + return test; + assertNotStrictEqual(test, true, this.shim); + } + return false; + } + freeze() { + this.frozens.push({ + handlers: this.handlers, + aliasMap: this.aliasMap, + defaultCommand: this.defaultCommand, + }); + } + unfreeze() { + const frozen = this.frozens.pop(); + assertNotStrictEqual(frozen, undefined, this.shim); + ({ + handlers: this.handlers, + aliasMap: this.aliasMap, + defaultCommand: this.defaultCommand, + } = frozen); + } + reset() { + this.handlers = {}; + this.aliasMap = {}; + this.defaultCommand = undefined; + this.requireCache = new Set(); + return this; + } +} +export function command(usage, validation, globalMiddleware, shim) { + return new CommandInstance(usage, validation, globalMiddleware, shim); +} +export function isCommandBuilderDefinition(builder) { + return (typeof builder === 'object' && + !!builder.builder && + typeof builder.handler === 'function'); +} +function isCommandAndAliases(cmd) { + return cmd.every(c => typeof c === 'string'); +} +export function isCommandBuilderCallback(builder) { + return typeof builder === 'function'; +} +function isCommandBuilderOptionDefinitions(builder) { + return typeof builder === 'object'; +} +export function isCommandHandlerDefinition(cmd) { + return typeof cmd === 'object' && !Array.isArray(cmd); +} diff --git a/node_modules/yargs/build/lib/completion-templates.js b/node_modules/yargs/build/lib/completion-templates.js new file mode 100644 index 0000000..2c4dcb5 --- /dev/null +++ b/node_modules/yargs/build/lib/completion-templates.js @@ -0,0 +1,48 @@ +export const completionShTemplate = `###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc +# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. +# +_{{app_name}}_yargs_completions() +{ + local cur_word args type_list + + cur_word="\${COMP_WORDS[COMP_CWORD]}" + args=("\${COMP_WORDS[@]}") + + # ask yargs to generate completions. + type_list=$({{app_path}} --get-yargs-completions "\${args[@]}") + + COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) ) + + # if no match was found, fall back to filename completion + if [ \${#COMPREPLY[@]} -eq 0 ]; then + COMPREPLY=() + fi + + return 0 +} +complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +`; +export const completionZshTemplate = `#compdef {{app_name}} +###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc +# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX. +# +_{{app_name}}_yargs_completions() +{ + local reply + local si=$IFS + IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}")) + IFS=$si + _describe 'values' reply +} +compdef _{{app_name}}_yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +`; diff --git a/node_modules/yargs/build/lib/completion.js b/node_modules/yargs/build/lib/completion.js new file mode 100644 index 0000000..cef2bbe --- /dev/null +++ b/node_modules/yargs/build/lib/completion.js @@ -0,0 +1,243 @@ +import { isCommandBuilderCallback } from './command.js'; +import { assertNotStrictEqual } from './typings/common-types.js'; +import * as templates from './completion-templates.js'; +import { isPromise } from './utils/is-promise.js'; +import { parseCommand } from './parse-command.js'; +export class Completion { + constructor(yargs, usage, command, shim) { + var _a, _b, _c; + this.yargs = yargs; + this.usage = usage; + this.command = command; + this.shim = shim; + this.completionKey = 'get-yargs-completions'; + this.aliases = null; + this.customCompletionFunction = null; + this.indexAfterLastReset = 0; + this.zshShell = + (_c = (((_a = this.shim.getEnv('SHELL')) === null || _a === void 0 ? void 0 : _a.includes('zsh')) || + ((_b = this.shim.getEnv('ZSH_NAME')) === null || _b === void 0 ? void 0 : _b.includes('zsh')))) !== null && _c !== void 0 ? _c : false; + } + defaultCompletion(args, argv, current, done) { + const handlers = this.command.getCommandHandlers(); + for (let i = 0, ii = args.length; i < ii; ++i) { + if (handlers[args[i]] && handlers[args[i]].builder) { + const builder = handlers[args[i]].builder; + if (isCommandBuilderCallback(builder)) { + this.indexAfterLastReset = i + 1; + const y = this.yargs.getInternalMethods().reset(); + builder(y, true); + return y.argv; + } + } + } + const completions = []; + this.commandCompletions(completions, args, current); + this.optionCompletions(completions, args, argv, current); + this.choicesFromOptionsCompletions(completions, args, argv, current); + this.choicesFromPositionalsCompletions(completions, args, argv, current); + done(null, completions); + } + commandCompletions(completions, args, current) { + const parentCommands = this.yargs + .getInternalMethods() + .getContext().commands; + if (!current.match(/^-/) && + parentCommands[parentCommands.length - 1] !== current && + !this.previousArgHasChoices(args)) { + this.usage.getCommands().forEach(usageCommand => { + const commandName = parseCommand(usageCommand[0]).cmd; + if (args.indexOf(commandName) === -1) { + if (!this.zshShell) { + completions.push(commandName); + } + else { + const desc = usageCommand[1] || ''; + completions.push(commandName.replace(/:/g, '\\:') + ':' + desc); + } + } + }); + } + } + optionCompletions(completions, args, argv, current) { + if ((current.match(/^-/) || (current === '' && completions.length === 0)) && + !this.previousArgHasChoices(args)) { + const options = this.yargs.getOptions(); + const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; + Object.keys(options.key).forEach(key => { + const negable = !!options.configuration['boolean-negation'] && + options.boolean.includes(key); + const isPositionalKey = positionalKeys.includes(key); + if (!isPositionalKey && + !options.hiddenOptions.includes(key) && + !this.argsContainKey(args, key, negable)) { + this.completeOptionKey(key, completions, current, negable && !!options.default[key]); + } + }); + } + } + choicesFromOptionsCompletions(completions, args, argv, current) { + if (this.previousArgHasChoices(args)) { + const choices = this.getPreviousArgChoices(args); + if (choices && choices.length > 0) { + completions.push(...choices.map(c => c.replace(/:/g, '\\:'))); + } + } + } + choicesFromPositionalsCompletions(completions, args, argv, current) { + if (current === '' && + completions.length > 0 && + this.previousArgHasChoices(args)) { + return; + } + const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; + const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + + 1); + const positionalKey = positionalKeys[argv._.length - offset - 1]; + if (!positionalKey) { + return; + } + const choices = this.yargs.getOptions().choices[positionalKey] || []; + for (const choice of choices) { + if (choice.startsWith(current)) { + completions.push(choice.replace(/:/g, '\\:')); + } + } + } + getPreviousArgChoices(args) { + if (args.length < 1) + return; + let previousArg = args[args.length - 1]; + let filter = ''; + if (!previousArg.startsWith('-') && args.length > 1) { + filter = previousArg; + previousArg = args[args.length - 2]; + } + if (!previousArg.startsWith('-')) + return; + const previousArgKey = previousArg.replace(/^-+/, ''); + const options = this.yargs.getOptions(); + const possibleAliases = [ + previousArgKey, + ...(this.yargs.getAliases()[previousArgKey] || []), + ]; + let choices; + for (const possibleAlias of possibleAliases) { + if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) && + Array.isArray(options.choices[possibleAlias])) { + choices = options.choices[possibleAlias]; + break; + } + } + if (choices) { + return choices.filter(choice => !filter || choice.startsWith(filter)); + } + } + previousArgHasChoices(args) { + const choices = this.getPreviousArgChoices(args); + return choices !== undefined && choices.length > 0; + } + argsContainKey(args, key, negable) { + const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? '-' : '--') + s) !== -1; + if (argsContains(key)) + return true; + if (negable && argsContains(`no-${key}`)) + return true; + if (this.aliases) { + for (const alias of this.aliases[key]) { + if (argsContains(alias)) + return true; + } + } + return false; + } + completeOptionKey(key, completions, current, negable) { + var _a, _b, _c, _d; + let keyWithDesc = key; + if (this.zshShell) { + const descs = this.usage.getDescriptions(); + const aliasKey = (_b = (_a = this === null || this === void 0 ? void 0 : this.aliases) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.find(alias => { + const desc = descs[alias]; + return typeof desc === 'string' && desc.length > 0; + }); + const descFromAlias = aliasKey ? descs[aliasKey] : undefined; + const desc = (_d = (_c = descs[key]) !== null && _c !== void 0 ? _c : descFromAlias) !== null && _d !== void 0 ? _d : ''; + keyWithDesc = `${key.replace(/:/g, '\\:')}:${desc + .replace('__yargsString__:', '') + .replace(/(\r\n|\n|\r)/gm, ' ')}`; + } + const startsByTwoDashes = (s) => /^--/.test(s); + const isShortOption = (s) => /^[^0-9]$/.test(s); + const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--'; + completions.push(dashes + keyWithDesc); + if (negable) { + completions.push(dashes + 'no-' + keyWithDesc); + } + } + customCompletion(args, argv, current, done) { + assertNotStrictEqual(this.customCompletionFunction, null, this.shim); + if (isSyncCompletionFunction(this.customCompletionFunction)) { + const result = this.customCompletionFunction(current, argv); + if (isPromise(result)) { + return result + .then(list => { + this.shim.process.nextTick(() => { + done(null, list); + }); + }) + .catch(err => { + this.shim.process.nextTick(() => { + done(err, undefined); + }); + }); + } + return done(null, result); + } + else if (isFallbackCompletionFunction(this.customCompletionFunction)) { + return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), completions => { + done(null, completions); + }); + } + else { + return this.customCompletionFunction(current, argv, completions => { + done(null, completions); + }); + } + } + getCompletion(args, done) { + const current = args.length ? args[args.length - 1] : ''; + const argv = this.yargs.parse(args, true); + const completionFunction = this.customCompletionFunction + ? (argv) => this.customCompletion(args, argv, current, done) + : (argv) => this.defaultCompletion(args, argv, current, done); + return isPromise(argv) + ? argv.then(completionFunction) + : completionFunction(argv); + } + generateCompletionScript($0, cmd) { + let script = this.zshShell + ? templates.completionZshTemplate + : templates.completionShTemplate; + const name = this.shim.path.basename($0); + if ($0.match(/\.js$/)) + $0 = `./${$0}`; + script = script.replace(/{{app_name}}/g, name); + script = script.replace(/{{completion_command}}/g, cmd); + return script.replace(/{{app_path}}/g, $0); + } + registerFunction(fn) { + this.customCompletionFunction = fn; + } + setParsed(parsed) { + this.aliases = parsed.aliases; + } +} +export function completion(yargs, usage, command, shim) { + return new Completion(yargs, usage, command, shim); +} +function isSyncCompletionFunction(completionFunction) { + return completionFunction.length < 3; +} +function isFallbackCompletionFunction(completionFunction) { + return completionFunction.length > 3; +} diff --git a/node_modules/yargs/build/lib/middleware.js b/node_modules/yargs/build/lib/middleware.js new file mode 100644 index 0000000..4e561a7 --- /dev/null +++ b/node_modules/yargs/build/lib/middleware.js @@ -0,0 +1,88 @@ +import { argsert } from './argsert.js'; +import { isPromise } from './utils/is-promise.js'; +export class GlobalMiddleware { + constructor(yargs) { + this.globalMiddleware = []; + this.frozens = []; + this.yargs = yargs; + } + addMiddleware(callback, applyBeforeValidation, global = true, mutates = false) { + argsert(' [boolean] [boolean] [boolean]', [callback, applyBeforeValidation, global], arguments.length); + if (Array.isArray(callback)) { + for (let i = 0; i < callback.length; i++) { + if (typeof callback[i] !== 'function') { + throw Error('middleware must be a function'); + } + const m = callback[i]; + m.applyBeforeValidation = applyBeforeValidation; + m.global = global; + } + Array.prototype.push.apply(this.globalMiddleware, callback); + } + else if (typeof callback === 'function') { + const m = callback; + m.applyBeforeValidation = applyBeforeValidation; + m.global = global; + m.mutates = mutates; + this.globalMiddleware.push(callback); + } + return this.yargs; + } + addCoerceMiddleware(callback, option) { + const aliases = this.yargs.getAliases(); + this.globalMiddleware = this.globalMiddleware.filter(m => { + const toCheck = [...(aliases[option] || []), option]; + if (!m.option) + return true; + else + return !toCheck.includes(m.option); + }); + callback.option = option; + return this.addMiddleware(callback, true, true, true); + } + getMiddleware() { + return this.globalMiddleware; + } + freeze() { + this.frozens.push([...this.globalMiddleware]); + } + unfreeze() { + const frozen = this.frozens.pop(); + if (frozen !== undefined) + this.globalMiddleware = frozen; + } + reset() { + this.globalMiddleware = this.globalMiddleware.filter(m => m.global); + } +} +export function commandMiddlewareFactory(commandMiddleware) { + if (!commandMiddleware) + return []; + return commandMiddleware.map(middleware => { + middleware.applyBeforeValidation = false; + return middleware; + }); +} +export function applyMiddleware(argv, yargs, middlewares, beforeValidation) { + return middlewares.reduce((acc, middleware) => { + if (middleware.applyBeforeValidation !== beforeValidation) { + return acc; + } + if (middleware.mutates) { + if (middleware.applied) + return acc; + middleware.applied = true; + } + if (isPromise(acc)) { + return acc + .then(initialObj => Promise.all([initialObj, middleware(initialObj, yargs)])) + .then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj)); + } + else { + const result = middleware(acc, yargs); + return isPromise(result) + ? result.then(middlewareObj => Object.assign(acc, middlewareObj)) + : Object.assign(acc, result); + } + }, argv); +} diff --git a/node_modules/yargs/build/lib/parse-command.js b/node_modules/yargs/build/lib/parse-command.js new file mode 100644 index 0000000..4989f53 --- /dev/null +++ b/node_modules/yargs/build/lib/parse-command.js @@ -0,0 +1,32 @@ +export function parseCommand(cmd) { + const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' '); + const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/); + const bregex = /\.*[\][<>]/g; + const firstCommand = splitCommand.shift(); + if (!firstCommand) + throw new Error(`No command found in: ${cmd}`); + const parsedCommand = { + cmd: firstCommand.replace(bregex, ''), + demanded: [], + optional: [], + }; + splitCommand.forEach((cmd, i) => { + let variadic = false; + cmd = cmd.replace(/\s/g, ''); + if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1) + variadic = true; + if (/^\[/.test(cmd)) { + parsedCommand.optional.push({ + cmd: cmd.replace(bregex, '').split('|'), + variadic, + }); + } + else { + parsedCommand.demanded.push({ + cmd: cmd.replace(bregex, '').split('|'), + variadic, + }); + } + }); + return parsedCommand; +} diff --git a/node_modules/yargs/build/lib/typings/common-types.js b/node_modules/yargs/build/lib/typings/common-types.js new file mode 100644 index 0000000..73e1773 --- /dev/null +++ b/node_modules/yargs/build/lib/typings/common-types.js @@ -0,0 +1,9 @@ +export function assertNotStrictEqual(actual, expected, shim, message) { + shim.assert.notStrictEqual(actual, expected, message); +} +export function assertSingleKey(actual, shim) { + shim.assert.strictEqual(typeof actual, 'string'); +} +export function objectKeys(object) { + return Object.keys(object); +} diff --git a/node_modules/yargs/build/lib/typings/yargs-parser-types.js b/node_modules/yargs/build/lib/typings/yargs-parser-types.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/node_modules/yargs/build/lib/typings/yargs-parser-types.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/yargs/build/lib/usage.js b/node_modules/yargs/build/lib/usage.js new file mode 100644 index 0000000..0127c13 --- /dev/null +++ b/node_modules/yargs/build/lib/usage.js @@ -0,0 +1,584 @@ +import { objFilter } from './utils/obj-filter.js'; +import { YError } from './yerror.js'; +import setBlocking from './utils/set-blocking.js'; +function isBoolean(fail) { + return typeof fail === 'boolean'; +} +export function usage(yargs, shim) { + const __ = shim.y18n.__; + const self = {}; + const fails = []; + self.failFn = function failFn(f) { + fails.push(f); + }; + let failMessage = null; + let globalFailMessage = null; + let showHelpOnFail = true; + self.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) { + const [enabled, message] = typeof arg1 === 'string' ? [true, arg1] : [arg1, arg2]; + if (yargs.getInternalMethods().isGlobalContext()) { + globalFailMessage = message; + } + failMessage = message; + showHelpOnFail = enabled; + return self; + }; + let failureOutput = false; + self.fail = function fail(msg, err) { + const logger = yargs.getInternalMethods().getLoggerInstance(); + if (fails.length) { + for (let i = fails.length - 1; i >= 0; --i) { + const fail = fails[i]; + if (isBoolean(fail)) { + if (err) + throw err; + else if (msg) + throw Error(msg); + } + else { + fail(msg, err, self); + } + } + } + else { + if (yargs.getExitProcess()) + setBlocking(true); + if (!failureOutput) { + failureOutput = true; + if (showHelpOnFail) { + yargs.showHelp('error'); + logger.error(); + } + if (msg || err) + logger.error(msg || err); + const globalOrCommandFailMessage = failMessage || globalFailMessage; + if (globalOrCommandFailMessage) { + if (msg || err) + logger.error(''); + logger.error(globalOrCommandFailMessage); + } + } + err = err || new YError(msg); + if (yargs.getExitProcess()) { + return yargs.exit(1); + } + else if (yargs.getInternalMethods().hasParseCallback()) { + return yargs.exit(1, err); + } + else { + throw err; + } + } + }; + let usages = []; + let usageDisabled = false; + self.usage = (msg, description) => { + if (msg === null) { + usageDisabled = true; + usages = []; + return self; + } + usageDisabled = false; + usages.push([msg, description || '']); + return self; + }; + self.getUsage = () => { + return usages; + }; + self.getUsageDisabled = () => { + return usageDisabled; + }; + self.getPositionalGroupName = () => { + return __('Positionals:'); + }; + let examples = []; + self.example = (cmd, description) => { + examples.push([cmd, description || '']); + }; + let commands = []; + self.command = function command(cmd, description, isDefault, aliases, deprecated = false) { + if (isDefault) { + commands = commands.map(cmdArray => { + cmdArray[2] = false; + return cmdArray; + }); + } + commands.push([cmd, description || '', isDefault, aliases, deprecated]); + }; + self.getCommands = () => commands; + let descriptions = {}; + self.describe = function describe(keyOrKeys, desc) { + if (Array.isArray(keyOrKeys)) { + keyOrKeys.forEach(k => { + self.describe(k, desc); + }); + } + else if (typeof keyOrKeys === 'object') { + Object.keys(keyOrKeys).forEach(k => { + self.describe(k, keyOrKeys[k]); + }); + } + else { + descriptions[keyOrKeys] = desc; + } + }; + self.getDescriptions = () => descriptions; + let epilogs = []; + self.epilog = msg => { + epilogs.push(msg); + }; + let wrapSet = false; + let wrap; + self.wrap = cols => { + wrapSet = true; + wrap = cols; + }; + self.getWrap = () => { + if (shim.getEnv('YARGS_DISABLE_WRAP')) { + return null; + } + if (!wrapSet) { + wrap = windowWidth(); + wrapSet = true; + } + return wrap; + }; + const deferY18nLookupPrefix = '__yargsString__:'; + self.deferY18nLookup = str => deferY18nLookupPrefix + str; + self.help = function help() { + if (cachedHelpMessage) + return cachedHelpMessage; + normalizeAliases(); + const base$0 = yargs.customScriptName + ? yargs.$0 + : shim.path.basename(yargs.$0); + const demandedOptions = yargs.getDemandedOptions(); + const demandedCommands = yargs.getDemandedCommands(); + const deprecatedOptions = yargs.getDeprecatedOptions(); + const groups = yargs.getGroups(); + const options = yargs.getOptions(); + let keys = []; + keys = keys.concat(Object.keys(descriptions)); + keys = keys.concat(Object.keys(demandedOptions)); + keys = keys.concat(Object.keys(demandedCommands)); + keys = keys.concat(Object.keys(options.default)); + keys = keys.filter(filterHiddenOptions); + keys = Object.keys(keys.reduce((acc, key) => { + if (key !== '_') + acc[key] = true; + return acc; + }, {})); + const theWrap = self.getWrap(); + const ui = shim.cliui({ + width: theWrap, + wrap: !!theWrap, + }); + if (!usageDisabled) { + if (usages.length) { + usages.forEach(usage => { + ui.div({ text: `${usage[0].replace(/\$0/g, base$0)}` }); + if (usage[1]) { + ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] }); + } + }); + ui.div(); + } + else if (commands.length) { + let u = null; + if (demandedCommands._) { + u = `${base$0} <${__('command')}>\n`; + } + else { + u = `${base$0} [${__('command')}]\n`; + } + ui.div(`${u}`); + } + } + if (commands.length > 1 || (commands.length === 1 && !commands[0][2])) { + ui.div(__('Commands:')); + const context = yargs.getInternalMethods().getContext(); + const parentCommands = context.commands.length + ? `${context.commands.join(' ')} ` + : ''; + if (yargs.getInternalMethods().getParserConfiguration()['sort-commands'] === + true) { + commands = commands.sort((a, b) => a[0].localeCompare(b[0])); + } + const prefix = base$0 ? `${base$0} ` : ''; + commands.forEach(command => { + const commandString = `${prefix}${parentCommands}${command[0].replace(/^\$0 ?/, '')}`; + ui.span({ + text: commandString, + padding: [0, 2, 0, 2], + width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4, + }, { text: command[1] }); + const hints = []; + if (command[2]) + hints.push(`[${__('default')}]`); + if (command[3] && command[3].length) { + hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`); + } + if (command[4]) { + if (typeof command[4] === 'string') { + hints.push(`[${__('deprecated: %s', command[4])}]`); + } + else { + hints.push(`[${__('deprecated')}]`); + } + } + if (hints.length) { + ui.div({ + text: hints.join(' '), + padding: [0, 0, 0, 2], + align: 'right', + }); + } + else { + ui.div(); + } + }); + ui.div(); + } + const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []); + keys = keys.filter(key => !yargs.parsed.newAliases[key] && + aliasKeys.every(alias => (options.alias[alias] || []).indexOf(key) === -1)); + const defaultGroup = __('Options:'); + if (!groups[defaultGroup]) + groups[defaultGroup] = []; + addUngroupedKeys(keys, options.alias, groups, defaultGroup); + const isLongSwitch = (sw) => /^--/.test(getText(sw)); + const displayedGroups = Object.keys(groups) + .filter(groupName => groups[groupName].length > 0) + .map(groupName => { + const normalizedKeys = groups[groupName] + .filter(filterHiddenOptions) + .map(key => { + if (aliasKeys.includes(key)) + return key; + for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) { + if ((options.alias[aliasKey] || []).includes(key)) + return aliasKey; + } + return key; + }); + return { groupName, normalizedKeys }; + }) + .filter(({ normalizedKeys }) => normalizedKeys.length > 0) + .map(({ groupName, normalizedKeys }) => { + const switches = normalizedKeys.reduce((acc, key) => { + acc[key] = [key] + .concat(options.alias[key] || []) + .map(sw => { + if (groupName === self.getPositionalGroupName()) + return sw; + else { + return ((/^[0-9]$/.test(sw) + ? options.boolean.includes(key) + ? '-' + : '--' + : sw.length > 1 + ? '--' + : '-') + sw); + } + }) + .sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) + ? 0 + : isLongSwitch(sw1) + ? 1 + : -1) + .join(', '); + return acc; + }, {}); + return { groupName, normalizedKeys, switches }; + }); + const shortSwitchesUsed = displayedGroups + .filter(({ groupName }) => groupName !== self.getPositionalGroupName()) + .some(({ normalizedKeys, switches }) => !normalizedKeys.every(key => isLongSwitch(switches[key]))); + if (shortSwitchesUsed) { + displayedGroups + .filter(({ groupName }) => groupName !== self.getPositionalGroupName()) + .forEach(({ normalizedKeys, switches }) => { + normalizedKeys.forEach(key => { + if (isLongSwitch(switches[key])) { + switches[key] = addIndentation(switches[key], '-x, '.length); + } + }); + }); + } + displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => { + ui.div(groupName); + normalizedKeys.forEach(key => { + const kswitch = switches[key]; + let desc = descriptions[key] || ''; + let type = null; + if (desc.includes(deferY18nLookupPrefix)) + desc = __(desc.substring(deferY18nLookupPrefix.length)); + if (options.boolean.includes(key)) + type = `[${__('boolean')}]`; + if (options.count.includes(key)) + type = `[${__('count')}]`; + if (options.string.includes(key)) + type = `[${__('string')}]`; + if (options.normalize.includes(key)) + type = `[${__('string')}]`; + if (options.array.includes(key)) + type = `[${__('array')}]`; + if (options.number.includes(key)) + type = `[${__('number')}]`; + const deprecatedExtra = (deprecated) => typeof deprecated === 'string' + ? `[${__('deprecated: %s', deprecated)}]` + : `[${__('deprecated')}]`; + const extra = [ + key in deprecatedOptions + ? deprecatedExtra(deprecatedOptions[key]) + : null, + type, + key in demandedOptions ? `[${__('required')}]` : null, + options.choices && options.choices[key] + ? `[${__('choices:')} ${self.stringifiedValues(options.choices[key])}]` + : null, + defaultString(options.default[key], options.defaultDescription[key]), + ] + .filter(Boolean) + .join(' '); + ui.span({ + text: getText(kswitch), + padding: [0, 2, 0, 2 + getIndentation(kswitch)], + width: maxWidth(switches, theWrap) + 4, + }, desc); + const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()['hide-types'] === + true; + if (extra && !shouldHideOptionExtras) + ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' }); + else + ui.div(); + }); + ui.div(); + }); + if (examples.length) { + ui.div(__('Examples:')); + examples.forEach(example => { + example[0] = example[0].replace(/\$0/g, base$0); + }); + examples.forEach(example => { + if (example[1] === '') { + ui.div({ + text: example[0], + padding: [0, 2, 0, 2], + }); + } + else { + ui.div({ + text: example[0], + padding: [0, 2, 0, 2], + width: maxWidth(examples, theWrap) + 4, + }, { + text: example[1], + }); + } + }); + ui.div(); + } + if (epilogs.length > 0) { + const e = epilogs + .map(epilog => epilog.replace(/\$0/g, base$0)) + .join('\n'); + ui.div(`${e}\n`); + } + return ui.toString().replace(/\s*$/, ''); + }; + function maxWidth(table, theWrap, modifier) { + let width = 0; + if (!Array.isArray(table)) { + table = Object.values(table).map(v => [v]); + } + table.forEach(v => { + width = Math.max(shim.stringWidth(modifier ? `${modifier} ${getText(v[0])}` : getText(v[0])) + getIndentation(v[0]), width); + }); + if (theWrap) + width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10)); + return width; + } + function normalizeAliases() { + const demandedOptions = yargs.getDemandedOptions(); + const options = yargs.getOptions(); + (Object.keys(options.alias) || []).forEach(key => { + options.alias[key].forEach(alias => { + if (descriptions[alias]) + self.describe(key, descriptions[alias]); + if (alias in demandedOptions) + yargs.demandOption(key, demandedOptions[alias]); + if (options.boolean.includes(alias)) + yargs.boolean(key); + if (options.count.includes(alias)) + yargs.count(key); + if (options.string.includes(alias)) + yargs.string(key); + if (options.normalize.includes(alias)) + yargs.normalize(key); + if (options.array.includes(alias)) + yargs.array(key); + if (options.number.includes(alias)) + yargs.number(key); + }); + }); + } + let cachedHelpMessage; + self.cacheHelpMessage = function () { + cachedHelpMessage = this.help(); + }; + self.clearCachedHelpMessage = function () { + cachedHelpMessage = undefined; + }; + self.hasCachedHelpMessage = function () { + return !!cachedHelpMessage; + }; + function addUngroupedKeys(keys, aliases, groups, defaultGroup) { + let groupedKeys = []; + let toCheck = null; + Object.keys(groups).forEach(group => { + groupedKeys = groupedKeys.concat(groups[group]); + }); + keys.forEach(key => { + toCheck = [key].concat(aliases[key]); + if (!toCheck.some(k => groupedKeys.indexOf(k) !== -1)) { + groups[defaultGroup].push(key); + } + }); + return groupedKeys; + } + function filterHiddenOptions(key) { + return (yargs.getOptions().hiddenOptions.indexOf(key) < 0 || + yargs.parsed.argv[yargs.getOptions().showHiddenOpt]); + } + self.showHelp = (level) => { + const logger = yargs.getInternalMethods().getLoggerInstance(); + if (!level) + level = 'error'; + const emit = typeof level === 'function' ? level : logger[level]; + emit(self.help()); + }; + self.functionDescription = fn => { + const description = fn.name + ? shim.Parser.decamelize(fn.name, '-') + : __('generated-value'); + return ['(', description, ')'].join(''); + }; + self.stringifiedValues = function stringifiedValues(values, separator) { + let string = ''; + const sep = separator || ', '; + const array = [].concat(values); + if (!values || !array.length) + return string; + array.forEach(value => { + if (string.length) + string += sep; + string += JSON.stringify(value); + }); + return string; + }; + function defaultString(value, defaultDescription) { + let string = `[${__('default:')} `; + if (value === undefined && !defaultDescription) + return null; + if (defaultDescription) { + string += defaultDescription; + } + else { + switch (typeof value) { + case 'string': + string += `"${value}"`; + break; + case 'object': + string += JSON.stringify(value); + break; + default: + string += value; + } + } + return `${string}]`; + } + function windowWidth() { + const maxWidth = 80; + if (shim.process.stdColumns) { + return Math.min(maxWidth, shim.process.stdColumns); + } + else { + return maxWidth; + } + } + let version = null; + self.version = ver => { + version = ver; + }; + self.showVersion = level => { + const logger = yargs.getInternalMethods().getLoggerInstance(); + if (!level) + level = 'error'; + const emit = typeof level === 'function' ? level : logger[level]; + emit(version); + }; + self.reset = function reset(localLookup) { + failMessage = null; + failureOutput = false; + usages = []; + usageDisabled = false; + epilogs = []; + examples = []; + commands = []; + descriptions = objFilter(descriptions, k => !localLookup[k]); + return self; + }; + const frozens = []; + self.freeze = function freeze() { + frozens.push({ + failMessage, + failureOutput, + usages, + usageDisabled, + epilogs, + examples, + commands, + descriptions, + }); + }; + self.unfreeze = function unfreeze(defaultCommand = false) { + const frozen = frozens.pop(); + if (!frozen) + return; + if (defaultCommand) { + descriptions = { ...frozen.descriptions, ...descriptions }; + commands = [...frozen.commands, ...commands]; + usages = [...frozen.usages, ...usages]; + examples = [...frozen.examples, ...examples]; + epilogs = [...frozen.epilogs, ...epilogs]; + } + else { + ({ + failMessage, + failureOutput, + usages, + usageDisabled, + epilogs, + examples, + commands, + descriptions, + } = frozen); + } + }; + return self; +} +function isIndentedText(text) { + return typeof text === 'object'; +} +function addIndentation(text, indent) { + return isIndentedText(text) + ? { text: text.text, indentation: text.indentation + indent } + : { text, indentation: indent }; +} +function getIndentation(text) { + return isIndentedText(text) ? text.indentation : 0; +} +function getText(text) { + return isIndentedText(text) ? text.text : text; +} diff --git a/node_modules/yargs/build/lib/utils/apply-extends.js b/node_modules/yargs/build/lib/utils/apply-extends.js new file mode 100644 index 0000000..0e593b4 --- /dev/null +++ b/node_modules/yargs/build/lib/utils/apply-extends.js @@ -0,0 +1,59 @@ +import { YError } from '../yerror.js'; +let previouslyVisitedConfigs = []; +let shim; +export function applyExtends(config, cwd, mergeExtends, _shim) { + shim = _shim; + let defaultConfig = {}; + if (Object.prototype.hasOwnProperty.call(config, 'extends')) { + if (typeof config.extends !== 'string') + return defaultConfig; + const isPath = /\.json|\..*rc$/.test(config.extends); + let pathToDefault = null; + if (!isPath) { + try { + pathToDefault = require.resolve(config.extends); + } + catch (_err) { + return config; + } + } + else { + pathToDefault = getPathToDefaultConfig(cwd, config.extends); + } + checkForCircularExtends(pathToDefault); + previouslyVisitedConfigs.push(pathToDefault); + defaultConfig = isPath + ? JSON.parse(shim.readFileSync(pathToDefault, 'utf8')) + : require(config.extends); + delete config.extends; + defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim); + } + previouslyVisitedConfigs = []; + return mergeExtends + ? mergeDeep(defaultConfig, config) + : Object.assign({}, defaultConfig, config); +} +function checkForCircularExtends(cfgPath) { + if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) { + throw new YError(`Circular extended configurations: '${cfgPath}'.`); + } +} +function getPathToDefaultConfig(cwd, pathToExtend) { + return shim.path.resolve(cwd, pathToExtend); +} +function mergeDeep(config1, config2) { + const target = {}; + function isObject(obj) { + return obj && typeof obj === 'object' && !Array.isArray(obj); + } + Object.assign(target, config1); + for (const key of Object.keys(config2)) { + if (isObject(config2[key]) && isObject(target[key])) { + target[key] = mergeDeep(config1[key], config2[key]); + } + else { + target[key] = config2[key]; + } + } + return target; +} diff --git a/node_modules/yargs/build/lib/utils/is-promise.js b/node_modules/yargs/build/lib/utils/is-promise.js new file mode 100644 index 0000000..d250c08 --- /dev/null +++ b/node_modules/yargs/build/lib/utils/is-promise.js @@ -0,0 +1,5 @@ +export function isPromise(maybePromise) { + return (!!maybePromise && + !!maybePromise.then && + typeof maybePromise.then === 'function'); +} diff --git a/node_modules/yargs/build/lib/utils/levenshtein.js b/node_modules/yargs/build/lib/utils/levenshtein.js new file mode 100644 index 0000000..60575ef --- /dev/null +++ b/node_modules/yargs/build/lib/utils/levenshtein.js @@ -0,0 +1,34 @@ +export function levenshtein(a, b) { + if (a.length === 0) + return b.length; + if (b.length === 0) + return a.length; + const matrix = []; + let i; + for (i = 0; i <= b.length; i++) { + matrix[i] = [i]; + } + let j; + for (j = 0; j <= a.length; j++) { + matrix[0][j] = j; + } + for (i = 1; i <= b.length; i++) { + for (j = 1; j <= a.length; j++) { + if (b.charAt(i - 1) === a.charAt(j - 1)) { + matrix[i][j] = matrix[i - 1][j - 1]; + } + else { + if (i > 1 && + j > 1 && + b.charAt(i - 2) === a.charAt(j - 1) && + b.charAt(i - 1) === a.charAt(j - 2)) { + matrix[i][j] = matrix[i - 2][j - 2] + 1; + } + else { + matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1)); + } + } + } + } + return matrix[b.length][a.length]; +} diff --git a/node_modules/yargs/build/lib/utils/maybe-async-result.js b/node_modules/yargs/build/lib/utils/maybe-async-result.js new file mode 100644 index 0000000..8c6a40c --- /dev/null +++ b/node_modules/yargs/build/lib/utils/maybe-async-result.js @@ -0,0 +1,17 @@ +import { isPromise } from './is-promise.js'; +export function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => { + throw err; +}) { + try { + const result = isFunction(getResult) ? getResult() : getResult; + return isPromise(result) + ? result.then((result) => resultHandler(result)) + : resultHandler(result); + } + catch (err) { + return errorHandler(err); + } +} +function isFunction(arg) { + return typeof arg === 'function'; +} diff --git a/node_modules/yargs/build/lib/utils/obj-filter.js b/node_modules/yargs/build/lib/utils/obj-filter.js new file mode 100644 index 0000000..cd68ad2 --- /dev/null +++ b/node_modules/yargs/build/lib/utils/obj-filter.js @@ -0,0 +1,10 @@ +import { objectKeys } from '../typings/common-types.js'; +export function objFilter(original = {}, filter = () => true) { + const obj = {}; + objectKeys(original).forEach(key => { + if (filter(key, original[key])) { + obj[key] = original[key]; + } + }); + return obj; +} diff --git a/node_modules/yargs/build/lib/utils/process-argv.js b/node_modules/yargs/build/lib/utils/process-argv.js new file mode 100644 index 0000000..74dc9e4 --- /dev/null +++ b/node_modules/yargs/build/lib/utils/process-argv.js @@ -0,0 +1,17 @@ +function getProcessArgvBinIndex() { + if (isBundledElectronApp()) + return 0; + return 1; +} +function isBundledElectronApp() { + return isElectronApp() && !process.defaultApp; +} +function isElectronApp() { + return !!process.versions.electron; +} +export function hideBin(argv) { + return argv.slice(getProcessArgvBinIndex() + 1); +} +export function getProcessArgvBin() { + return process.argv[getProcessArgvBinIndex()]; +} diff --git a/node_modules/yargs/build/lib/utils/set-blocking.js b/node_modules/yargs/build/lib/utils/set-blocking.js new file mode 100644 index 0000000..88fb806 --- /dev/null +++ b/node_modules/yargs/build/lib/utils/set-blocking.js @@ -0,0 +1,12 @@ +export default function setBlocking(blocking) { + if (typeof process === 'undefined') + return; + [process.stdout, process.stderr].forEach(_stream => { + const stream = _stream; + if (stream._handle && + stream.isTTY && + typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(blocking); + } + }); +} diff --git a/node_modules/yargs/build/lib/utils/which-module.js b/node_modules/yargs/build/lib/utils/which-module.js new file mode 100644 index 0000000..5974e22 --- /dev/null +++ b/node_modules/yargs/build/lib/utils/which-module.js @@ -0,0 +1,10 @@ +export default function whichModule(exported) { + if (typeof require === 'undefined') + return null; + for (let i = 0, files = Object.keys(require.cache), mod; i < files.length; i++) { + mod = require.cache[files[i]]; + if (mod.exports === exported) + return mod; + } + return null; +} diff --git a/node_modules/yargs/build/lib/validation.js b/node_modules/yargs/build/lib/validation.js new file mode 100644 index 0000000..bd2e1b8 --- /dev/null +++ b/node_modules/yargs/build/lib/validation.js @@ -0,0 +1,305 @@ +import { argsert } from './argsert.js'; +import { assertNotStrictEqual, } from './typings/common-types.js'; +import { levenshtein as distance } from './utils/levenshtein.js'; +import { objFilter } from './utils/obj-filter.js'; +const specialKeys = ['$0', '--', '_']; +export function validation(yargs, usage, shim) { + const __ = shim.y18n.__; + const __n = shim.y18n.__n; + const self = {}; + self.nonOptionCount = function nonOptionCount(argv) { + const demandedCommands = yargs.getDemandedCommands(); + const positionalCount = argv._.length + (argv['--'] ? argv['--'].length : 0); + const _s = positionalCount - yargs.getInternalMethods().getContext().commands.length; + if (demandedCommands._ && + (_s < demandedCommands._.min || _s > demandedCommands._.max)) { + if (_s < demandedCommands._.min) { + if (demandedCommands._.minMsg !== undefined) { + usage.fail(demandedCommands._.minMsg + ? demandedCommands._.minMsg + .replace(/\$0/g, _s.toString()) + .replace(/\$1/, demandedCommands._.min.toString()) + : null); + } + else { + usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', _s, _s.toString(), demandedCommands._.min.toString())); + } + } + else if (_s > demandedCommands._.max) { + if (demandedCommands._.maxMsg !== undefined) { + usage.fail(demandedCommands._.maxMsg + ? demandedCommands._.maxMsg + .replace(/\$0/g, _s.toString()) + .replace(/\$1/, demandedCommands._.max.toString()) + : null); + } + else { + usage.fail(__n('Too many non-option arguments: got %s, maximum of %s', 'Too many non-option arguments: got %s, maximum of %s', _s, _s.toString(), demandedCommands._.max.toString())); + } + } + } + }; + self.positionalCount = function positionalCount(required, observed) { + if (observed < required) { + usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', observed, observed + '', required + '')); + } + }; + self.requiredArguments = function requiredArguments(argv, demandedOptions) { + let missing = null; + for (const key of Object.keys(demandedOptions)) { + if (!Object.prototype.hasOwnProperty.call(argv, key) || + typeof argv[key] === 'undefined') { + missing = missing || {}; + missing[key] = demandedOptions[key]; + } + } + if (missing) { + const customMsgs = []; + for (const key of Object.keys(missing)) { + const msg = missing[key]; + if (msg && customMsgs.indexOf(msg) < 0) { + customMsgs.push(msg); + } + } + const customMsg = customMsgs.length ? `\n${customMsgs.join('\n')}` : ''; + usage.fail(__n('Missing required argument: %s', 'Missing required arguments: %s', Object.keys(missing).length, Object.keys(missing).join(', ') + customMsg)); + } + }; + self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) { + var _a; + const commandKeys = yargs + .getInternalMethods() + .getCommandInstance() + .getCommands(); + const unknown = []; + const currentContext = yargs.getInternalMethods().getContext(); + Object.keys(argv).forEach(key => { + if (!specialKeys.includes(key) && + !Object.prototype.hasOwnProperty.call(positionalMap, key) && + !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) && + !self.isValidAndSomeAliasIsNotNew(key, aliases)) { + unknown.push(key); + } + }); + if (checkPositionals && + (currentContext.commands.length > 0 || + commandKeys.length > 0 || + isDefaultCommand)) { + argv._.slice(currentContext.commands.length).forEach(key => { + if (!commandKeys.includes('' + key)) { + unknown.push('' + key); + } + }); + } + if (checkPositionals) { + const demandedCommands = yargs.getDemandedCommands(); + const maxNonOptDemanded = ((_a = demandedCommands._) === null || _a === void 0 ? void 0 : _a.max) || 0; + const expected = currentContext.commands.length + maxNonOptDemanded; + if (expected < argv._.length) { + argv._.slice(expected).forEach(key => { + key = String(key); + if (!currentContext.commands.includes(key) && + !unknown.includes(key)) { + unknown.push(key); + } + }); + } + } + if (unknown.length) { + usage.fail(__n('Unknown argument: %s', 'Unknown arguments: %s', unknown.length, unknown.map(s => (s.trim() ? s : `"${s}"`)).join(', '))); + } + }; + self.unknownCommands = function unknownCommands(argv) { + const commandKeys = yargs + .getInternalMethods() + .getCommandInstance() + .getCommands(); + const unknown = []; + const currentContext = yargs.getInternalMethods().getContext(); + if (currentContext.commands.length > 0 || commandKeys.length > 0) { + argv._.slice(currentContext.commands.length).forEach(key => { + if (!commandKeys.includes('' + key)) { + unknown.push('' + key); + } + }); + } + if (unknown.length > 0) { + usage.fail(__n('Unknown command: %s', 'Unknown commands: %s', unknown.length, unknown.join(', '))); + return true; + } + else { + return false; + } + }; + self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) { + if (!Object.prototype.hasOwnProperty.call(aliases, key)) { + return false; + } + const newAliases = yargs.parsed.newAliases; + return [key, ...aliases[key]].some(a => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]); + }; + self.limitedChoices = function limitedChoices(argv) { + const options = yargs.getOptions(); + const invalid = {}; + if (!Object.keys(options.choices).length) + return; + Object.keys(argv).forEach(key => { + if (specialKeys.indexOf(key) === -1 && + Object.prototype.hasOwnProperty.call(options.choices, key)) { + [].concat(argv[key]).forEach(value => { + if (options.choices[key].indexOf(value) === -1 && + value !== undefined) { + invalid[key] = (invalid[key] || []).concat(value); + } + }); + } + }); + const invalidKeys = Object.keys(invalid); + if (!invalidKeys.length) + return; + let msg = __('Invalid values:'); + invalidKeys.forEach(key => { + msg += `\n ${__('Argument: %s, Given: %s, Choices: %s', key, usage.stringifiedValues(invalid[key]), usage.stringifiedValues(options.choices[key]))}`; + }); + usage.fail(msg); + }; + let implied = {}; + self.implies = function implies(key, value) { + argsert(' [array|number|string]', [key, value], arguments.length); + if (typeof key === 'object') { + Object.keys(key).forEach(k => { + self.implies(k, key[k]); + }); + } + else { + yargs.global(key); + if (!implied[key]) { + implied[key] = []; + } + if (Array.isArray(value)) { + value.forEach(i => self.implies(key, i)); + } + else { + assertNotStrictEqual(value, undefined, shim); + implied[key].push(value); + } + } + }; + self.getImplied = function getImplied() { + return implied; + }; + function keyExists(argv, val) { + const num = Number(val); + val = isNaN(num) ? val : num; + if (typeof val === 'number') { + val = argv._.length >= val; + } + else if (val.match(/^--no-.+/)) { + val = val.match(/^--no-(.+)/)[1]; + val = !Object.prototype.hasOwnProperty.call(argv, val); + } + else { + val = Object.prototype.hasOwnProperty.call(argv, val); + } + return val; + } + self.implications = function implications(argv) { + const implyFail = []; + Object.keys(implied).forEach(key => { + const origKey = key; + (implied[key] || []).forEach(value => { + let key = origKey; + const origValue = value; + key = keyExists(argv, key); + value = keyExists(argv, value); + if (key && !value) { + implyFail.push(` ${origKey} -> ${origValue}`); + } + }); + }); + if (implyFail.length) { + let msg = `${__('Implications failed:')}\n`; + implyFail.forEach(value => { + msg += value; + }); + usage.fail(msg); + } + }; + let conflicting = {}; + self.conflicts = function conflicts(key, value) { + argsert(' [array|string]', [key, value], arguments.length); + if (typeof key === 'object') { + Object.keys(key).forEach(k => { + self.conflicts(k, key[k]); + }); + } + else { + yargs.global(key); + if (!conflicting[key]) { + conflicting[key] = []; + } + if (Array.isArray(value)) { + value.forEach(i => self.conflicts(key, i)); + } + else { + conflicting[key].push(value); + } + } + }; + self.getConflicting = () => conflicting; + self.conflicting = function conflictingFn(argv) { + Object.keys(argv).forEach(key => { + if (conflicting[key]) { + conflicting[key].forEach(value => { + if (value && argv[key] !== undefined && argv[value] !== undefined) { + usage.fail(__('Arguments %s and %s are mutually exclusive', key, value)); + } + }); + } + }); + if (yargs.getInternalMethods().getParserConfiguration()['strip-dashed']) { + Object.keys(conflicting).forEach(key => { + conflicting[key].forEach(value => { + if (value && + argv[shim.Parser.camelCase(key)] !== undefined && + argv[shim.Parser.camelCase(value)] !== undefined) { + usage.fail(__('Arguments %s and %s are mutually exclusive', key, value)); + } + }); + }); + } + }; + self.recommendCommands = function recommendCommands(cmd, potentialCommands) { + const threshold = 3; + potentialCommands = potentialCommands.sort((a, b) => b.length - a.length); + let recommended = null; + let bestDistance = Infinity; + for (let i = 0, candidate; (candidate = potentialCommands[i]) !== undefined; i++) { + const d = distance(cmd, candidate); + if (d <= threshold && d < bestDistance) { + bestDistance = d; + recommended = candidate; + } + } + if (recommended) + usage.fail(__('Did you mean %s?', recommended)); + }; + self.reset = function reset(localLookup) { + implied = objFilter(implied, k => !localLookup[k]); + conflicting = objFilter(conflicting, k => !localLookup[k]); + return self; + }; + const frozens = []; + self.freeze = function freeze() { + frozens.push({ + implied, + conflicting, + }); + }; + self.unfreeze = function unfreeze() { + const frozen = frozens.pop(); + assertNotStrictEqual(frozen, undefined, shim); + ({ implied, conflicting } = frozen); + }; + return self; +} diff --git a/node_modules/yargs/build/lib/yargs-factory.js b/node_modules/yargs/build/lib/yargs-factory.js new file mode 100644 index 0000000..c4b1d50 --- /dev/null +++ b/node_modules/yargs/build/lib/yargs-factory.js @@ -0,0 +1,1512 @@ +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +}; +var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _YargsInstance_command, _YargsInstance_cwd, _YargsInstance_context, _YargsInstance_completion, _YargsInstance_completionCommand, _YargsInstance_defaultShowHiddenOpt, _YargsInstance_exitError, _YargsInstance_detectLocale, _YargsInstance_emittedWarnings, _YargsInstance_exitProcess, _YargsInstance_frozens, _YargsInstance_globalMiddleware, _YargsInstance_groups, _YargsInstance_hasOutput, _YargsInstance_helpOpt, _YargsInstance_isGlobalContext, _YargsInstance_logger, _YargsInstance_output, _YargsInstance_options, _YargsInstance_parentRequire, _YargsInstance_parserConfig, _YargsInstance_parseFn, _YargsInstance_parseContext, _YargsInstance_pkgs, _YargsInstance_preservedGroups, _YargsInstance_processArgs, _YargsInstance_recommendCommands, _YargsInstance_shim, _YargsInstance_strict, _YargsInstance_strictCommands, _YargsInstance_strictOptions, _YargsInstance_usage, _YargsInstance_usageConfig, _YargsInstance_versionOpt, _YargsInstance_validation; +import { command as Command, } from './command.js'; +import { assertNotStrictEqual, assertSingleKey, objectKeys, } from './typings/common-types.js'; +import { YError } from './yerror.js'; +import { usage as Usage } from './usage.js'; +import { argsert } from './argsert.js'; +import { completion as Completion, } from './completion.js'; +import { validation as Validation, } from './validation.js'; +import { objFilter } from './utils/obj-filter.js'; +import { applyExtends } from './utils/apply-extends.js'; +import { applyMiddleware, GlobalMiddleware, } from './middleware.js'; +import { isPromise } from './utils/is-promise.js'; +import { maybeAsyncResult } from './utils/maybe-async-result.js'; +import setBlocking from './utils/set-blocking.js'; +export function YargsFactory(_shim) { + return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => { + const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim); + Object.defineProperty(yargs, 'argv', { + get: () => { + return yargs.parse(); + }, + enumerable: true, + }); + yargs.help(); + yargs.version(); + return yargs; + }; +} +const kCopyDoubleDash = Symbol('copyDoubleDash'); +const kCreateLogger = Symbol('copyDoubleDash'); +const kDeleteFromParserHintObject = Symbol('deleteFromParserHintObject'); +const kEmitWarning = Symbol('emitWarning'); +const kFreeze = Symbol('freeze'); +const kGetDollarZero = Symbol('getDollarZero'); +const kGetParserConfiguration = Symbol('getParserConfiguration'); +const kGetUsageConfiguration = Symbol('getUsageConfiguration'); +const kGuessLocale = Symbol('guessLocale'); +const kGuessVersion = Symbol('guessVersion'); +const kParsePositionalNumbers = Symbol('parsePositionalNumbers'); +const kPkgUp = Symbol('pkgUp'); +const kPopulateParserHintArray = Symbol('populateParserHintArray'); +const kPopulateParserHintSingleValueDictionary = Symbol('populateParserHintSingleValueDictionary'); +const kPopulateParserHintArrayDictionary = Symbol('populateParserHintArrayDictionary'); +const kPopulateParserHintDictionary = Symbol('populateParserHintDictionary'); +const kSanitizeKey = Symbol('sanitizeKey'); +const kSetKey = Symbol('setKey'); +const kUnfreeze = Symbol('unfreeze'); +const kValidateAsync = Symbol('validateAsync'); +const kGetCommandInstance = Symbol('getCommandInstance'); +const kGetContext = Symbol('getContext'); +const kGetHasOutput = Symbol('getHasOutput'); +const kGetLoggerInstance = Symbol('getLoggerInstance'); +const kGetParseContext = Symbol('getParseContext'); +const kGetUsageInstance = Symbol('getUsageInstance'); +const kGetValidationInstance = Symbol('getValidationInstance'); +const kHasParseCallback = Symbol('hasParseCallback'); +const kIsGlobalContext = Symbol('isGlobalContext'); +const kPostProcess = Symbol('postProcess'); +const kRebase = Symbol('rebase'); +const kReset = Symbol('reset'); +const kRunYargsParserAndExecuteCommands = Symbol('runYargsParserAndExecuteCommands'); +const kRunValidation = Symbol('runValidation'); +const kSetHasOutput = Symbol('setHasOutput'); +const kTrackManuallySetKeys = Symbol('kTrackManuallySetKeys'); +export class YargsInstance { + constructor(processArgs = [], cwd, parentRequire, shim) { + this.customScriptName = false; + this.parsed = false; + _YargsInstance_command.set(this, void 0); + _YargsInstance_cwd.set(this, void 0); + _YargsInstance_context.set(this, { commands: [], fullCommands: [] }); + _YargsInstance_completion.set(this, null); + _YargsInstance_completionCommand.set(this, null); + _YargsInstance_defaultShowHiddenOpt.set(this, 'show-hidden'); + _YargsInstance_exitError.set(this, null); + _YargsInstance_detectLocale.set(this, true); + _YargsInstance_emittedWarnings.set(this, {}); + _YargsInstance_exitProcess.set(this, true); + _YargsInstance_frozens.set(this, []); + _YargsInstance_globalMiddleware.set(this, void 0); + _YargsInstance_groups.set(this, {}); + _YargsInstance_hasOutput.set(this, false); + _YargsInstance_helpOpt.set(this, null); + _YargsInstance_isGlobalContext.set(this, true); + _YargsInstance_logger.set(this, void 0); + _YargsInstance_output.set(this, ''); + _YargsInstance_options.set(this, void 0); + _YargsInstance_parentRequire.set(this, void 0); + _YargsInstance_parserConfig.set(this, {}); + _YargsInstance_parseFn.set(this, null); + _YargsInstance_parseContext.set(this, null); + _YargsInstance_pkgs.set(this, {}); + _YargsInstance_preservedGroups.set(this, {}); + _YargsInstance_processArgs.set(this, void 0); + _YargsInstance_recommendCommands.set(this, false); + _YargsInstance_shim.set(this, void 0); + _YargsInstance_strict.set(this, false); + _YargsInstance_strictCommands.set(this, false); + _YargsInstance_strictOptions.set(this, false); + _YargsInstance_usage.set(this, void 0); + _YargsInstance_usageConfig.set(this, {}); + _YargsInstance_versionOpt.set(this, null); + _YargsInstance_validation.set(this, void 0); + __classPrivateFieldSet(this, _YargsInstance_shim, shim, "f"); + __classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f"); + __classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f"); + __classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f"); + __classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f"); + this.$0 = this[kGetDollarZero](); + this[kReset](); + __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f"), "f"); + __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), "f"); + __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f"), "f"); + __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f"), "f"); + __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f"); + __classPrivateFieldSet(this, _YargsInstance_logger, this[kCreateLogger](), "f"); + } + addHelpOpt(opt, msg) { + const defaultHelpOpt = 'help'; + argsert('[string|boolean] [string]', [opt, msg], arguments.length); + if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) { + this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")); + __classPrivateFieldSet(this, _YargsInstance_helpOpt, null, "f"); + } + if (opt === false && msg === undefined) + return this; + __classPrivateFieldSet(this, _YargsInstance_helpOpt, typeof opt === 'string' ? opt : defaultHelpOpt, "f"); + this.boolean(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")); + this.describe(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show help')); + return this; + } + help(opt, msg) { + return this.addHelpOpt(opt, msg); + } + addShowHiddenOpt(opt, msg) { + argsert('[string|boolean] [string]', [opt, msg], arguments.length); + if (opt === false && msg === undefined) + return this; + const showHiddenOpt = typeof opt === 'string' ? opt : __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f"); + this.boolean(showHiddenOpt); + this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show hidden options')); + __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt; + return this; + } + showHidden(opt, msg) { + return this.addShowHiddenOpt(opt, msg); + } + alias(key, value) { + argsert(' [string|array]', [key, value], arguments.length); + this[kPopulateParserHintArrayDictionary](this.alias.bind(this), 'alias', key, value); + return this; + } + array(keys) { + argsert('', [keys], arguments.length); + this[kPopulateParserHintArray]('array', keys); + this[kTrackManuallySetKeys](keys); + return this; + } + boolean(keys) { + argsert('', [keys], arguments.length); + this[kPopulateParserHintArray]('boolean', keys); + this[kTrackManuallySetKeys](keys); + return this; + } + check(f, global) { + argsert(' [boolean]', [f, global], arguments.length); + this.middleware((argv, _yargs) => { + return maybeAsyncResult(() => { + return f(argv, _yargs.getOptions()); + }, (result) => { + if (!result) { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__('Argument check failed: %s', f.toString())); + } + else if (typeof result === 'string' || result instanceof Error) { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result); + } + return argv; + }, (err) => { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err); + return argv; + }); + }, false, global); + return this; + } + choices(key, value) { + argsert(' [string|array]', [key, value], arguments.length); + this[kPopulateParserHintArrayDictionary](this.choices.bind(this), 'choices', key, value); + return this; + } + coerce(keys, value) { + argsert(' [function]', [keys, value], arguments.length); + if (Array.isArray(keys)) { + if (!value) { + throw new YError('coerce callback must be provided'); + } + for (const key of keys) { + this.coerce(key, value); + } + return this; + } + else if (typeof keys === 'object') { + for (const key of Object.keys(keys)) { + this.coerce(key, keys[key]); + } + return this; + } + if (!value) { + throw new YError('coerce callback must be provided'); + } + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true; + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => { + let aliases; + const shouldCoerce = Object.prototype.hasOwnProperty.call(argv, keys); + if (!shouldCoerce) { + return argv; + } + return maybeAsyncResult(() => { + aliases = yargs.getAliases(); + return value(argv[keys]); + }, (result) => { + argv[keys] = result; + const stripAliased = yargs + .getInternalMethods() + .getParserConfiguration()['strip-aliased']; + if (aliases[keys] && stripAliased !== true) { + for (const alias of aliases[keys]) { + argv[alias] = result; + } + } + return argv; + }, (err) => { + throw new YError(err.message); + }); + }, keys); + return this; + } + conflicts(key1, key2) { + argsert(' [string|array]', [key1, key2], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicts(key1, key2); + return this; + } + config(key = 'config', msg, parseFn) { + argsert('[object|string] [string|function] [function]', [key, msg, parseFn], arguments.length); + if (typeof key === 'object' && !Array.isArray(key)) { + key = applyExtends(key, __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(key); + return this; + } + if (typeof msg === 'function') { + parseFn = msg; + msg = undefined; + } + this.describe(key, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Path to JSON config file')); + (Array.isArray(key) ? key : [key]).forEach(k => { + __classPrivateFieldGet(this, _YargsInstance_options, "f").config[k] = parseFn || true; + }); + return this; + } + completion(cmd, desc, fn) { + argsert('[string] [string|boolean|function] [function]', [cmd, desc, fn], arguments.length); + if (typeof desc === 'function') { + fn = desc; + desc = undefined; + } + __classPrivateFieldSet(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || 'completion', "f"); + if (!desc && desc !== false) { + desc = 'generate completion script'; + } + this.command(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), desc); + if (fn) + __classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn); + return this; + } + command(cmd, description, builder, handler, middlewares, deprecated) { + argsert(' [string|boolean] [function|object] [function] [array] [boolean|string]', [cmd, description, builder, handler, middlewares, deprecated], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler, middlewares, deprecated); + return this; + } + commands(cmd, description, builder, handler, middlewares, deprecated) { + return this.command(cmd, description, builder, handler, middlewares, deprecated); + } + commandDir(dir, opts) { + argsert(' [object]', [dir, opts], arguments.length); + const req = __classPrivateFieldGet(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").require; + __classPrivateFieldGet(this, _YargsInstance_command, "f").addDirectory(dir, req, __classPrivateFieldGet(this, _YargsInstance_shim, "f").getCallerFile(), opts); + return this; + } + count(keys) { + argsert('', [keys], arguments.length); + this[kPopulateParserHintArray]('count', keys); + this[kTrackManuallySetKeys](keys); + return this; + } + default(key, value, defaultDescription) { + argsert(' [*] [string]', [key, value, defaultDescription], arguments.length); + if (defaultDescription) { + assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription; + } + if (typeof value === 'function') { + assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key]) + __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = + __classPrivateFieldGet(this, _YargsInstance_usage, "f").functionDescription(value); + value = value.call(); + } + this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), 'default', key, value); + return this; + } + defaults(key, value, defaultDescription) { + return this.default(key, value, defaultDescription); + } + demandCommand(min = 1, max, minMsg, maxMsg) { + argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length); + if (typeof max !== 'number') { + minMsg = max; + max = Infinity; + } + this.global('_', false); + __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands._ = { + min, + max, + minMsg, + maxMsg, + }; + return this; + } + demand(keys, max, msg) { + if (Array.isArray(max)) { + max.forEach(key => { + assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + this.demandOption(key, msg); + }); + max = Infinity; + } + else if (typeof max !== 'number') { + msg = max; + max = Infinity; + } + if (typeof keys === 'number') { + assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + this.demandCommand(keys, max, msg, msg); + } + else if (Array.isArray(keys)) { + keys.forEach(key => { + assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + this.demandOption(key, msg); + }); + } + else { + if (typeof msg === 'string') { + this.demandOption(keys, msg); + } + else if (msg === true || typeof msg === 'undefined') { + this.demandOption(keys); + } + } + return this; + } + demandOption(keys, msg) { + argsert(' [string]', [keys, msg], arguments.length); + this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), 'demandedOptions', keys, msg); + return this; + } + deprecateOption(option, message) { + argsert(' [string|boolean]', [option, message], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions[option] = message; + return this; + } + describe(keys, description) { + argsert(' [string]', [keys, description], arguments.length); + this[kSetKey](keys, true); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").describe(keys, description); + return this; + } + detectLocale(detect) { + argsert('', [detect], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_detectLocale, detect, "f"); + return this; + } + env(prefix) { + argsert('[string|boolean]', [prefix], arguments.length); + if (prefix === false) + delete __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix; + else + __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix = prefix || ''; + return this; + } + epilogue(msg) { + argsert('', [msg], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").epilog(msg); + return this; + } + epilog(msg) { + return this.epilogue(msg); + } + example(cmd, description) { + argsert(' [string]', [cmd, description], arguments.length); + if (Array.isArray(cmd)) { + cmd.forEach(exampleParams => this.example(...exampleParams)); + } + else { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").example(cmd, description); + } + return this; + } + exit(code, err) { + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + __classPrivateFieldSet(this, _YargsInstance_exitError, err, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.exit(code); + } + exitProcess(enabled = true) { + argsert('[boolean]', [enabled], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_exitProcess, enabled, "f"); + return this; + } + fail(f) { + argsert('', [f], arguments.length); + if (typeof f === 'boolean' && f !== false) { + throw new YError("Invalid first argument. Expected function or boolean 'false'"); + } + __classPrivateFieldGet(this, _YargsInstance_usage, "f").failFn(f); + return this; + } + getAliases() { + return this.parsed ? this.parsed.aliases : {}; + } + async getCompletion(args, done) { + argsert(' [function]', [args, done], arguments.length); + if (!done) { + return new Promise((resolve, reject) => { + __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => { + if (err) + reject(err); + else + resolve(completions); + }); + }); + } + else { + return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done); + } + } + getDemandedOptions() { + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedOptions; + } + getDemandedCommands() { + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands; + } + getDeprecatedOptions() { + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions; + } + getDetectLocale() { + return __classPrivateFieldGet(this, _YargsInstance_detectLocale, "f"); + } + getExitProcess() { + return __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"); + } + getGroups() { + return Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_groups, "f"), __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")); + } + getHelp() { + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) { + if (!this.parsed) { + const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), undefined, undefined, 0, true); + if (isPromise(parse)) { + return parse.then(() => { + return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help(); + }); + } + } + const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this); + if (isPromise(builderResponse)) { + return builderResponse.then(() => { + return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help(); + }); + } + } + return Promise.resolve(__classPrivateFieldGet(this, _YargsInstance_usage, "f").help()); + } + getOptions() { + return __classPrivateFieldGet(this, _YargsInstance_options, "f"); + } + getStrict() { + return __classPrivateFieldGet(this, _YargsInstance_strict, "f"); + } + getStrictCommands() { + return __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"); + } + getStrictOptions() { + return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"); + } + global(globals, global) { + argsert(' [boolean]', [globals, global], arguments.length); + globals = [].concat(globals); + if (global !== false) { + __classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter(l => globals.indexOf(l) === -1); + } + else { + globals.forEach(g => { + if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g)) + __classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g); + }); + } + return this; + } + group(opts, groupName) { + argsert(' ', [opts, groupName], arguments.length); + const existing = __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName]; + if (__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]) { + delete __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]; + } + const seen = {}; + __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter(key => { + if (seen[key]) + return false; + return (seen[key] = true); + }); + return this; + } + hide(key) { + argsert('', [key], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_options, "f").hiddenOptions.push(key); + return this; + } + implies(key, value) { + argsert(' [number|string|array]', [key, value], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").implies(key, value); + return this; + } + locale(locale) { + argsert('[string]', [locale], arguments.length); + if (locale === undefined) { + this[kGuessLocale](); + return __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.getLocale(); + } + __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f"); + __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale); + return this; + } + middleware(callback, applyBeforeValidation, global) { + return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global); + } + nargs(key, value) { + argsert(' [number]', [key, value], arguments.length); + this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), 'narg', key, value); + return this; + } + normalize(keys) { + argsert('', [keys], arguments.length); + this[kPopulateParserHintArray]('normalize', keys); + return this; + } + number(keys) { + argsert('', [keys], arguments.length); + this[kPopulateParserHintArray]('number', keys); + this[kTrackManuallySetKeys](keys); + return this; + } + option(key, opt) { + argsert(' [object]', [key, opt], arguments.length); + if (typeof key === 'object') { + Object.keys(key).forEach(k => { + this.options(k, key[k]); + }); + } + else { + if (typeof opt !== 'object') { + opt = {}; + } + this[kTrackManuallySetKeys](key); + if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && (key === 'version' || (opt === null || opt === void 0 ? void 0 : opt.alias) === 'version')) { + this[kEmitWarning]([ + '"version" is a reserved word.', + 'Please do one of the following:', + '- Disable version with `yargs.version(false)` if using "version" as an option', + '- Use the built-in `yargs.version` method instead (if applicable)', + '- Use a different option key', + 'https://yargs.js.org/docs/#api-reference-version', + ].join('\n'), undefined, 'versionWarning'); + } + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[key] = true; + if (opt.alias) + this.alias(key, opt.alias); + const deprecate = opt.deprecate || opt.deprecated; + if (deprecate) { + this.deprecateOption(key, deprecate); + } + const demand = opt.demand || opt.required || opt.require; + if (demand) { + this.demand(key, demand); + } + if (opt.demandOption) { + this.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined); + } + if (opt.conflicts) { + this.conflicts(key, opt.conflicts); + } + if ('default' in opt) { + this.default(key, opt.default); + } + if (opt.implies !== undefined) { + this.implies(key, opt.implies); + } + if (opt.nargs !== undefined) { + this.nargs(key, opt.nargs); + } + if (opt.config) { + this.config(key, opt.configParser); + } + if (opt.normalize) { + this.normalize(key); + } + if (opt.choices) { + this.choices(key, opt.choices); + } + if (opt.coerce) { + this.coerce(key, opt.coerce); + } + if (opt.group) { + this.group(key, opt.group); + } + if (opt.boolean || opt.type === 'boolean') { + this.boolean(key); + if (opt.alias) + this.boolean(opt.alias); + } + if (opt.array || opt.type === 'array') { + this.array(key); + if (opt.alias) + this.array(opt.alias); + } + if (opt.number || opt.type === 'number') { + this.number(key); + if (opt.alias) + this.number(opt.alias); + } + if (opt.string || opt.type === 'string') { + this.string(key); + if (opt.alias) + this.string(opt.alias); + } + if (opt.count || opt.type === 'count') { + this.count(key); + } + if (typeof opt.global === 'boolean') { + this.global(key, opt.global); + } + if (opt.defaultDescription) { + __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription; + } + if (opt.skipValidation) { + this.skipValidation(key); + } + const desc = opt.describe || opt.description || opt.desc; + const descriptions = __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions(); + if (!Object.prototype.hasOwnProperty.call(descriptions, key) || + typeof desc === 'string') { + this.describe(key, desc); + } + if (opt.hidden) { + this.hide(key); + } + if (opt.requiresArg) { + this.requiresArg(key); + } + } + return this; + } + options(key, opt) { + return this.option(key, opt); + } + parse(args, shortCircuit, _parseFn) { + argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length); + this[kFreeze](); + if (typeof args === 'undefined') { + args = __classPrivateFieldGet(this, _YargsInstance_processArgs, "f"); + } + if (typeof shortCircuit === 'object') { + __classPrivateFieldSet(this, _YargsInstance_parseContext, shortCircuit, "f"); + shortCircuit = _parseFn; + } + if (typeof shortCircuit === 'function') { + __classPrivateFieldSet(this, _YargsInstance_parseFn, shortCircuit, "f"); + shortCircuit = false; + } + if (!shortCircuit) + __classPrivateFieldSet(this, _YargsInstance_processArgs, args, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) + __classPrivateFieldSet(this, _YargsInstance_exitProcess, false, "f"); + const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit); + const tmpParsed = this.parsed; + __classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed); + if (isPromise(parsed)) { + return parsed + .then(argv => { + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) + __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f")); + return argv; + }) + .catch(err => { + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) { + __classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f")); + } + throw err; + }) + .finally(() => { + this[kUnfreeze](); + this.parsed = tmpParsed; + }); + } + else { + if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) + __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet(this, _YargsInstance_output, "f")); + this[kUnfreeze](); + this.parsed = tmpParsed; + } + return parsed; + } + parseAsync(args, shortCircuit, _parseFn) { + const maybePromise = this.parse(args, shortCircuit, _parseFn); + return !isPromise(maybePromise) + ? Promise.resolve(maybePromise) + : maybePromise; + } + parseSync(args, shortCircuit, _parseFn) { + const maybePromise = this.parse(args, shortCircuit, _parseFn); + if (isPromise(maybePromise)) { + throw new YError('.parseSync() must not be used with asynchronous builders, handlers, or middleware'); + } + return maybePromise; + } + parserConfiguration(config) { + argsert('', [config], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_parserConfig, config, "f"); + return this; + } + pkgConf(key, rootPath) { + argsert(' [string]', [key, rootPath], arguments.length); + let conf = null; + const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f")); + if (obj[key] && typeof obj[key] === 'object') { + conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(conf); + } + return this; + } + positional(key, opts) { + argsert(' ', [key, opts], arguments.length); + const supportedOpts = [ + 'default', + 'defaultDescription', + 'implies', + 'normalize', + 'choices', + 'conflicts', + 'coerce', + 'type', + 'describe', + 'desc', + 'description', + 'alias', + ]; + opts = objFilter(opts, (k, v) => { + if (k === 'type' && !['string', 'number', 'boolean'].includes(v)) + return false; + return supportedOpts.includes(k); + }); + const fullCommand = __classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands.length - 1]; + const parseOptions = fullCommand + ? __classPrivateFieldGet(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand) + : { + array: [], + alias: {}, + default: {}, + demand: {}, + }; + objectKeys(parseOptions).forEach(pk => { + const parseOption = parseOptions[pk]; + if (Array.isArray(parseOption)) { + if (parseOption.indexOf(key) !== -1) + opts[pk] = true; + } + else { + if (parseOption[key] && !(pk in opts)) + opts[pk] = parseOption[key]; + } + }); + this.group(key, __classPrivateFieldGet(this, _YargsInstance_usage, "f").getPositionalGroupName()); + return this.option(key, opts); + } + recommendCommands(recommend = true) { + argsert('[boolean]', [recommend], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_recommendCommands, recommend, "f"); + return this; + } + required(keys, max, msg) { + return this.demand(keys, max, msg); + } + require(keys, max, msg) { + return this.demand(keys, max, msg); + } + requiresArg(keys) { + argsert(' [number]', [keys], arguments.length); + if (typeof keys === 'string' && __classPrivateFieldGet(this, _YargsInstance_options, "f").narg[keys]) { + return this; + } + else { + this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), 'narg', keys, NaN); + } + return this; + } + showCompletionScript($0, cmd) { + argsert('[string] [string]', [$0, cmd], arguments.length); + $0 = $0 || this.$0; + __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || 'completion')); + return this; + } + showHelp(level) { + argsert('[string|function]', [level], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) { + if (!this.parsed) { + const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), undefined, undefined, 0, true); + if (isPromise(parse)) { + parse.then(() => { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); + }); + return this; + } + } + const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this); + if (isPromise(builderResponse)) { + builderResponse.then(() => { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); + }); + return this; + } + } + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level); + return this; + } + scriptName(scriptName) { + this.customScriptName = true; + this.$0 = scriptName; + return this; + } + showHelpOnFail(enabled, message) { + argsert('[boolean|string] [string]', [enabled, message], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelpOnFail(enabled, message); + return this; + } + showVersion(level) { + argsert('[string|function]', [level], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion(level); + return this; + } + skipValidation(keys) { + argsert('', [keys], arguments.length); + this[kPopulateParserHintArray]('skipValidation', keys); + return this; + } + strict(enabled) { + argsert('[boolean]', [enabled], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_strict, enabled !== false, "f"); + return this; + } + strictCommands(enabled) { + argsert('[boolean]', [enabled], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_strictCommands, enabled !== false, "f"); + return this; + } + strictOptions(enabled) { + argsert('[boolean]', [enabled], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_strictOptions, enabled !== false, "f"); + return this; + } + string(keys) { + argsert('', [keys], arguments.length); + this[kPopulateParserHintArray]('string', keys); + this[kTrackManuallySetKeys](keys); + return this; + } + terminalWidth() { + argsert([], 0); + return __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.stdColumns; + } + updateLocale(obj) { + return this.updateStrings(obj); + } + updateStrings(obj) { + argsert('', [obj], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f"); + __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj); + return this; + } + usage(msg, description, builder, handler) { + argsert(' [string|boolean] [function|object] [function]', [msg, description, builder, handler], arguments.length); + if (description !== undefined) { + assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + if ((msg || '').match(/^\$0( |$)/)) { + return this.command(msg, description, builder, handler); + } + else { + throw new YError('.usage() description must start with $0 if being used as alias for .command()'); + } + } + else { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").usage(msg); + return this; + } + } + usageConfiguration(config) { + argsert('', [config], arguments.length); + __classPrivateFieldSet(this, _YargsInstance_usageConfig, config, "f"); + return this; + } + version(opt, msg, ver) { + const defaultVersionOpt = 'version'; + argsert('[boolean|string] [string] [string]', [opt, msg, ver], arguments.length); + if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")) { + this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(undefined); + __classPrivateFieldSet(this, _YargsInstance_versionOpt, null, "f"); + } + if (arguments.length === 0) { + ver = this[kGuessVersion](); + opt = defaultVersionOpt; + } + else if (arguments.length === 1) { + if (opt === false) { + return this; + } + ver = opt; + opt = defaultVersionOpt; + } + else if (arguments.length === 2) { + ver = msg; + msg = undefined; + } + __classPrivateFieldSet(this, _YargsInstance_versionOpt, typeof opt === 'string' ? opt : defaultVersionOpt, "f"); + msg = msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show version number'); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(ver || undefined); + this.boolean(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")); + this.describe(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"), msg); + return this; + } + wrap(cols) { + argsert('', [cols], arguments.length); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols); + return this; + } + [(_YargsInstance_command = new WeakMap(), _YargsInstance_cwd = new WeakMap(), _YargsInstance_context = new WeakMap(), _YargsInstance_completion = new WeakMap(), _YargsInstance_completionCommand = new WeakMap(), _YargsInstance_defaultShowHiddenOpt = new WeakMap(), _YargsInstance_exitError = new WeakMap(), _YargsInstance_detectLocale = new WeakMap(), _YargsInstance_emittedWarnings = new WeakMap(), _YargsInstance_exitProcess = new WeakMap(), _YargsInstance_frozens = new WeakMap(), _YargsInstance_globalMiddleware = new WeakMap(), _YargsInstance_groups = new WeakMap(), _YargsInstance_hasOutput = new WeakMap(), _YargsInstance_helpOpt = new WeakMap(), _YargsInstance_isGlobalContext = new WeakMap(), _YargsInstance_logger = new WeakMap(), _YargsInstance_output = new WeakMap(), _YargsInstance_options = new WeakMap(), _YargsInstance_parentRequire = new WeakMap(), _YargsInstance_parserConfig = new WeakMap(), _YargsInstance_parseFn = new WeakMap(), _YargsInstance_parseContext = new WeakMap(), _YargsInstance_pkgs = new WeakMap(), _YargsInstance_preservedGroups = new WeakMap(), _YargsInstance_processArgs = new WeakMap(), _YargsInstance_recommendCommands = new WeakMap(), _YargsInstance_shim = new WeakMap(), _YargsInstance_strict = new WeakMap(), _YargsInstance_strictCommands = new WeakMap(), _YargsInstance_strictOptions = new WeakMap(), _YargsInstance_usage = new WeakMap(), _YargsInstance_usageConfig = new WeakMap(), _YargsInstance_versionOpt = new WeakMap(), _YargsInstance_validation = new WeakMap(), kCopyDoubleDash)](argv) { + if (!argv._ || !argv['--']) + return argv; + argv._.push.apply(argv._, argv['--']); + try { + delete argv['--']; + } + catch (_err) { } + return argv; + } + [kCreateLogger]() { + return { + log: (...args) => { + if (!this[kHasParseCallback]()) + console.log(...args); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + '\n', "f"); + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(' '), "f"); + }, + error: (...args) => { + if (!this[kHasParseCallback]()) + console.error(...args); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length) + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + '\n', "f"); + __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(' '), "f"); + }, + }; + } + [kDeleteFromParserHintObject](optionKey) { + objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => { + if (((key) => key === 'configObjects')(hintKey)) + return; + const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey]; + if (Array.isArray(hint)) { + if (hint.includes(optionKey)) + hint.splice(hint.indexOf(optionKey), 1); + } + else if (typeof hint === 'object') { + delete hint[optionKey]; + } + }); + delete __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions()[optionKey]; + } + [kEmitWarning](warning, type, deduplicationId) { + if (!__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) { + __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.emitWarning(warning, type); + __classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true; + } + } + [kFreeze]() { + __classPrivateFieldGet(this, _YargsInstance_frozens, "f").push({ + options: __classPrivateFieldGet(this, _YargsInstance_options, "f"), + configObjects: __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects.slice(0), + exitProcess: __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"), + groups: __classPrivateFieldGet(this, _YargsInstance_groups, "f"), + strict: __classPrivateFieldGet(this, _YargsInstance_strict, "f"), + strictCommands: __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"), + strictOptions: __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"), + completionCommand: __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), + output: __classPrivateFieldGet(this, _YargsInstance_output, "f"), + exitError: __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), + hasOutput: __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"), + parsed: this.parsed, + parseFn: __classPrivateFieldGet(this, _YargsInstance_parseFn, "f"), + parseContext: __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"), + }); + __classPrivateFieldGet(this, _YargsInstance_usage, "f").freeze(); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").freeze(); + __classPrivateFieldGet(this, _YargsInstance_command, "f").freeze(); + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").freeze(); + } + [kGetDollarZero]() { + let $0 = ''; + let default$0; + if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) { + default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(1, 2); + } + else { + default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(0, 1); + } + $0 = default$0 + .map(x => { + const b = this[kRebase](__classPrivateFieldGet(this, _YargsInstance_cwd, "f"), x); + return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x; + }) + .join(' ') + .trim(); + if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('_') && + __classPrivateFieldGet(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('_')) { + $0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f") + .getEnv('_') + .replace(`${__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.execPath())}/`, ''); + } + return $0; + } + [kGetParserConfiguration]() { + return __classPrivateFieldGet(this, _YargsInstance_parserConfig, "f"); + } + [kGetUsageConfiguration]() { + return __classPrivateFieldGet(this, _YargsInstance_usageConfig, "f"); + } + [kGuessLocale]() { + if (!__classPrivateFieldGet(this, _YargsInstance_detectLocale, "f")) + return; + const locale = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LC_ALL') || + __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LC_MESSAGES') || + __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LANG') || + __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LANGUAGE') || + 'en_US'; + this.locale(locale.replace(/[.:].*/, '')); + } + [kGuessVersion]() { + const obj = this[kPkgUp](); + return obj.version || 'unknown'; + } + [kParsePositionalNumbers](argv) { + const args = argv['--'] ? argv['--'] : argv._; + for (let i = 0, arg; (arg = args[i]) !== undefined; i++) { + if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) && + Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) { + args[i] = Number(arg); + } + } + return argv; + } + [kPkgUp](rootPath) { + const npath = rootPath || '*'; + if (__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]) + return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]; + let obj = {}; + try { + let startDir = rootPath || __classPrivateFieldGet(this, _YargsInstance_shim, "f").mainFilename; + if (!rootPath && __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.extname(startDir)) { + startDir = __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(startDir); + } + const pkgJsonPath = __classPrivateFieldGet(this, _YargsInstance_shim, "f").findUp(startDir, (dir, names) => { + if (names.includes('package.json')) { + return 'package.json'; + } + else { + return undefined; + } + }); + assertNotStrictEqual(pkgJsonPath, undefined, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, 'utf8')); + } + catch (_noop) { } + __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {}; + return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath]; + } + [kPopulateParserHintArray](type, keys) { + keys = [].concat(keys); + keys.forEach(key => { + key = this[kSanitizeKey](key); + __classPrivateFieldGet(this, _YargsInstance_options, "f")[type].push(key); + }); + } + [kPopulateParserHintSingleValueDictionary](builder, type, key, value) { + this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => { + __classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] = value; + }); + } + [kPopulateParserHintArrayDictionary](builder, type, key, value) { + this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => { + __classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] || []).concat(value); + }); + } + [kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) { + if (Array.isArray(key)) { + key.forEach(k => { + builder(k, value); + }); + } + else if (((key) => typeof key === 'object')(key)) { + for (const k of objectKeys(key)) { + builder(k, key[k]); + } + } + else { + singleKeyHandler(type, this[kSanitizeKey](key), value); + } + } + [kSanitizeKey](key) { + if (key === '__proto__') + return '___proto___'; + return key; + } + [kSetKey](key, set) { + this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), 'key', key, set); + return this; + } + [kUnfreeze]() { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + const frozen = __classPrivateFieldGet(this, _YargsInstance_frozens, "f").pop(); + assertNotStrictEqual(frozen, undefined, __classPrivateFieldGet(this, _YargsInstance_shim, "f")); + let configObjects; + (_a = this, _b = this, _c = this, _d = this, _e = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l = this, _m = this, { + options: ({ set value(_o) { __classPrivateFieldSet(_a, _YargsInstance_options, _o, "f"); } }).value, + configObjects, + exitProcess: ({ set value(_o) { __classPrivateFieldSet(_b, _YargsInstance_exitProcess, _o, "f"); } }).value, + groups: ({ set value(_o) { __classPrivateFieldSet(_c, _YargsInstance_groups, _o, "f"); } }).value, + output: ({ set value(_o) { __classPrivateFieldSet(_d, _YargsInstance_output, _o, "f"); } }).value, + exitError: ({ set value(_o) { __classPrivateFieldSet(_e, _YargsInstance_exitError, _o, "f"); } }).value, + hasOutput: ({ set value(_o) { __classPrivateFieldSet(_f, _YargsInstance_hasOutput, _o, "f"); } }).value, + parsed: this.parsed, + strict: ({ set value(_o) { __classPrivateFieldSet(_g, _YargsInstance_strict, _o, "f"); } }).value, + strictCommands: ({ set value(_o) { __classPrivateFieldSet(_h, _YargsInstance_strictCommands, _o, "f"); } }).value, + strictOptions: ({ set value(_o) { __classPrivateFieldSet(_j, _YargsInstance_strictOptions, _o, "f"); } }).value, + completionCommand: ({ set value(_o) { __classPrivateFieldSet(_k, _YargsInstance_completionCommand, _o, "f"); } }).value, + parseFn: ({ set value(_o) { __classPrivateFieldSet(_l, _YargsInstance_parseFn, _o, "f"); } }).value, + parseContext: ({ set value(_o) { __classPrivateFieldSet(_m, _YargsInstance_parseContext, _o, "f"); } }).value, + } = frozen); + __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = configObjects; + __classPrivateFieldGet(this, _YargsInstance_usage, "f").unfreeze(); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").unfreeze(); + __classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze(); + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze(); + } + [kValidateAsync](validation, argv) { + return maybeAsyncResult(argv, result => { + validation(result); + return result; + }); + } + getInternalMethods() { + return { + getCommandInstance: this[kGetCommandInstance].bind(this), + getContext: this[kGetContext].bind(this), + getHasOutput: this[kGetHasOutput].bind(this), + getLoggerInstance: this[kGetLoggerInstance].bind(this), + getParseContext: this[kGetParseContext].bind(this), + getParserConfiguration: this[kGetParserConfiguration].bind(this), + getUsageConfiguration: this[kGetUsageConfiguration].bind(this), + getUsageInstance: this[kGetUsageInstance].bind(this), + getValidationInstance: this[kGetValidationInstance].bind(this), + hasParseCallback: this[kHasParseCallback].bind(this), + isGlobalContext: this[kIsGlobalContext].bind(this), + postProcess: this[kPostProcess].bind(this), + reset: this[kReset].bind(this), + runValidation: this[kRunValidation].bind(this), + runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this), + setHasOutput: this[kSetHasOutput].bind(this), + }; + } + [kGetCommandInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_command, "f"); + } + [kGetContext]() { + return __classPrivateFieldGet(this, _YargsInstance_context, "f"); + } + [kGetHasOutput]() { + return __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"); + } + [kGetLoggerInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_logger, "f"); + } + [kGetParseContext]() { + return __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") || {}; + } + [kGetUsageInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_usage, "f"); + } + [kGetValidationInstance]() { + return __classPrivateFieldGet(this, _YargsInstance_validation, "f"); + } + [kHasParseCallback]() { + return !!__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"); + } + [kIsGlobalContext]() { + return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f"); + } + [kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) { + if (calledFromCommand) + return argv; + if (isPromise(argv)) + return argv; + if (!populateDoubleDash) { + argv = this[kCopyDoubleDash](argv); + } + const parsePositionalNumbers = this[kGetParserConfiguration]()['parse-positional-numbers'] || + this[kGetParserConfiguration]()['parse-positional-numbers'] === undefined; + if (parsePositionalNumbers) { + argv = this[kParsePositionalNumbers](argv); + } + if (runGlobalMiddleware) { + argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false); + } + return argv; + } + [kReset](aliases = {}) { + __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f"); + const tmpOptions = {}; + tmpOptions.local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local || []; + tmpOptions.configObjects = __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []; + const localLookup = {}; + tmpOptions.local.forEach(l => { + localLookup[l] = true; + (aliases[l] || []).forEach(a => { + localLookup[a] = true; + }); + }); + Object.assign(__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => { + const keys = __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName].filter(key => !(key in localLookup)); + if (keys.length > 0) { + acc[groupName] = keys; + } + return acc; + }, {})); + __classPrivateFieldSet(this, _YargsInstance_groups, {}, "f"); + const arrayOptions = [ + 'array', + 'boolean', + 'string', + 'skipValidation', + 'count', + 'normalize', + 'number', + 'hiddenOptions', + ]; + const objectOptions = [ + 'narg', + 'key', + 'alias', + 'default', + 'defaultDescription', + 'config', + 'choices', + 'demandedOptions', + 'demandedCommands', + 'deprecatedOptions', + ]; + arrayOptions.forEach(k => { + tmpOptions[k] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[k] || []).filter((k) => !localLookup[k]); + }); + objectOptions.forEach((k) => { + tmpOptions[k] = objFilter(__classPrivateFieldGet(this, _YargsInstance_options, "f")[k], k => !localLookup[k]); + }); + tmpOptions.envPrefix = __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix; + __classPrivateFieldSet(this, _YargsInstance_options, tmpOptions, "f"); + __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f") + ? __classPrivateFieldGet(this, _YargsInstance_usage, "f").reset(localLookup) + : Usage(this, __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f") + ? __classPrivateFieldGet(this, _YargsInstance_validation, "f").reset(localLookup) + : Validation(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f") + ? __classPrivateFieldGet(this, _YargsInstance_command, "f").reset() + : Command(__classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_validation, "f"), __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + if (!__classPrivateFieldGet(this, _YargsInstance_completion, "f")) + __classPrivateFieldSet(this, _YargsInstance_completion, Completion(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_command, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f"); + __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").reset(); + __classPrivateFieldSet(this, _YargsInstance_completionCommand, null, "f"); + __classPrivateFieldSet(this, _YargsInstance_output, '', "f"); + __classPrivateFieldSet(this, _YargsInstance_exitError, null, "f"); + __classPrivateFieldSet(this, _YargsInstance_hasOutput, false, "f"); + this.parsed = false; + return this; + } + [kRebase](base, dir) { + return __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.relative(base, dir); + } + [kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) { + let skipValidation = !!calledFromCommand || helpOnly; + args = args || __classPrivateFieldGet(this, _YargsInstance_processArgs, "f"); + __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__; + __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration](); + const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration['populate--']; + const config = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, { + 'populate--': true, + }); + const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), { + configuration: { 'parse-positional-numbers': false, ...config }, + })); + const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f")); + let argvPromise = undefined; + const aliases = parsed.aliases; + let helpOptSet = false; + let versionOptSet = false; + Object.keys(argv).forEach(key => { + if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) { + helpOptSet = true; + } + else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) { + versionOptSet = true; + } + }); + argv.$0 = this.$0; + this.parsed = parsed; + if (commandIndex === 0) { + __classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage(); + } + try { + this[kGuessLocale](); + if (shortCircuit) { + return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false); + } + if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) { + const helpCmds = [__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] + .concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || []) + .filter(k => k.length > 1); + if (helpCmds.includes('' + argv._[argv._.length - 1])) { + argv._.pop(); + helpOptSet = true; + } + } + __classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f"); + const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands(); + const requestCompletions = __classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey in argv; + const skipRecommendation = helpOptSet || requestCompletions || helpOnly; + if (argv._.length) { + if (handlerKeys.length) { + let firstUnknownCommand; + for (let i = commandIndex || 0, cmd; argv._[i] !== undefined; i++) { + cmd = String(argv._[i]); + if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) { + const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly); + return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false); + } + else if (!firstUnknownCommand && + cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) { + firstUnknownCommand = cmd; + break; + } + } + if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && + __classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") && + firstUnknownCommand && + !skipRecommendation) { + __classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys); + } + } + if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") && + argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) && + !requestCompletions) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + this.showCompletionScript(); + this.exit(0); + } + } + if (__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) { + const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly); + return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false); + } + if (requestCompletions) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + args = [].concat(args); + const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey}`) + 1); + __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => { + if (err) + throw new YError(err.message); + (completions || []).forEach(completion => { + __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(completion); + }); + this.exit(0); + }); + return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false); + } + if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) { + if (helpOptSet) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + skipValidation = true; + this.showHelp('log'); + this.exit(0); + } + else if (versionOptSet) { + if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f")) + setBlocking(true); + skipValidation = true; + __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion('log'); + this.exit(0); + } + } + if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) { + skipValidation = Object.keys(argv).some(key => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true); + } + if (!skipValidation) { + if (parsed.error) + throw new YError(parsed.error.message); + if (!requestCompletions) { + const validation = this[kRunValidation](aliases, {}, parsed.error); + if (!calledFromCommand) { + argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true); + } + argvPromise = this[kValidateAsync](validation, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv); + if (isPromise(argvPromise) && !calledFromCommand) { + argvPromise = argvPromise.then(() => { + return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false); + }); + } + } + } + } + catch (err) { + if (err instanceof YError) + __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err); + else + throw err; + } + return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true); + } + [kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) { + const demandedOptions = { ...this.getDemandedOptions() }; + return (argv) => { + if (parseErrors) + throw new YError(parseErrors.message); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions); + let failedStrictCommands = false; + if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) { + failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv); + } + if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) { + __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand); + } + else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) { + __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false); + } + __classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv); + __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv); + }; + } + [kSetHasOutput]() { + __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f"); + } + [kTrackManuallySetKeys](keys) { + if (typeof keys === 'string') { + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true; + } + else { + for (const k of keys) { + __classPrivateFieldGet(this, _YargsInstance_options, "f").key[k] = true; + } + } + } +} +export function isYargsInstance(y) { + return !!y && typeof y.getInternalMethods === 'function'; +} diff --git a/node_modules/yargs/build/lib/yerror.js b/node_modules/yargs/build/lib/yerror.js new file mode 100644 index 0000000..7a36684 --- /dev/null +++ b/node_modules/yargs/build/lib/yerror.js @@ -0,0 +1,9 @@ +export class YError extends Error { + constructor(msg) { + super(msg || 'yargs error'); + this.name = 'YError'; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, YError); + } + } +} diff --git a/node_modules/yargs/helpers/helpers.mjs b/node_modules/yargs/helpers/helpers.mjs new file mode 100644 index 0000000..3f96b3d --- /dev/null +++ b/node_modules/yargs/helpers/helpers.mjs @@ -0,0 +1,10 @@ +import {applyExtends as _applyExtends} from '../build/lib/utils/apply-extends.js'; +import {hideBin} from '../build/lib/utils/process-argv.js'; +import Parser from 'yargs-parser'; +import shim from '../lib/platform-shims/esm.mjs'; + +const applyExtends = (config, cwd, mergeExtends) => { + return _applyExtends(config, cwd, mergeExtends, shim); +}; + +export {applyExtends, hideBin, Parser}; diff --git a/node_modules/yargs/helpers/index.js b/node_modules/yargs/helpers/index.js new file mode 100644 index 0000000..8ab79a3 --- /dev/null +++ b/node_modules/yargs/helpers/index.js @@ -0,0 +1,14 @@ +const { + applyExtends, + cjsPlatformShim, + Parser, + processArgv, +} = require('../build/index.cjs'); + +module.exports = { + applyExtends: (config, cwd, mergeExtends) => { + return applyExtends(config, cwd, mergeExtends, cjsPlatformShim); + }, + hideBin: processArgv.hideBin, + Parser, +}; diff --git a/node_modules/yargs/helpers/package.json b/node_modules/yargs/helpers/package.json new file mode 100644 index 0000000..5bbefff --- /dev/null +++ b/node_modules/yargs/helpers/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/yargs/index.cjs b/node_modules/yargs/index.cjs new file mode 100644 index 0000000..d1eee82 --- /dev/null +++ b/node_modules/yargs/index.cjs @@ -0,0 +1,53 @@ +'use strict'; +// classic singleton yargs API, to use yargs +// without running as a singleton do: +// require('yargs/yargs')(process.argv.slice(2)) +const {Yargs, processArgv} = require('./build/index.cjs'); + +Argv(processArgv.hideBin(process.argv)); + +module.exports = Argv; + +function Argv(processArgs, cwd) { + const argv = Yargs(processArgs, cwd, require); + singletonify(argv); + // TODO(bcoe): warn if argv.parse() or argv.argv is used directly. + return argv; +} + +function defineGetter(obj, key, getter) { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: true, + get: getter, + }); +} +function lookupGetter(obj, key) { + const desc = Object.getOwnPropertyDescriptor(obj, key); + if (typeof desc !== 'undefined') { + return desc.get; + } +} + +/* Hack an instance of Argv with process.argv into Argv + so people can do + require('yargs')(['--beeble=1','-z','zizzle']).argv + to parse a list of args and + require('yargs').argv + to get a parsed version of process.argv. +*/ +function singletonify(inst) { + [ + ...Object.keys(inst), + ...Object.getOwnPropertyNames(inst.constructor.prototype), + ].forEach(key => { + if (key === 'argv') { + defineGetter(Argv, key, lookupGetter(inst, key)); + } else if (typeof inst[key] === 'function') { + Argv[key] = inst[key].bind(inst); + } else { + defineGetter(Argv, '$0', () => inst.$0); + defineGetter(Argv, 'parsed', () => inst.parsed); + } + }); +} diff --git a/node_modules/yargs/index.mjs b/node_modules/yargs/index.mjs new file mode 100644 index 0000000..c6440b9 --- /dev/null +++ b/node_modules/yargs/index.mjs @@ -0,0 +1,8 @@ +'use strict'; + +// Bootstraps yargs for ESM: +import esmPlatformShim from './lib/platform-shims/esm.mjs'; +import {YargsFactory} from './build/lib/yargs-factory.js'; + +const Yargs = YargsFactory(esmPlatformShim); +export default Yargs; diff --git a/node_modules/yargs/lib/platform-shims/browser.mjs b/node_modules/yargs/lib/platform-shims/browser.mjs new file mode 100644 index 0000000..5f8ec61 --- /dev/null +++ b/node_modules/yargs/lib/platform-shims/browser.mjs @@ -0,0 +1,95 @@ +/* eslint-disable no-unused-vars */ +'use strict'; + +import cliui from 'https://unpkg.com/cliui@7.0.1/index.mjs'; // eslint-disable-line +import Parser from 'https://unpkg.com/yargs-parser@19.0.0/browser.js'; // eslint-disable-line +import {getProcessArgvBin} from '../../build/lib/utils/process-argv.js'; +import {YError} from '../../build/lib/yerror.js'; + +const REQUIRE_ERROR = 'require is not supported in browser'; +const REQUIRE_DIRECTORY_ERROR = + 'loading a directory of commands is not supported in browser'; + +export default { + assert: { + notStrictEqual: (a, b) => { + // noop. + }, + strictEqual: (a, b) => { + // noop. + }, + }, + cliui, + findUp: () => undefined, + getEnv: key => { + // There is no environment in browser: + return undefined; + }, + inspect: console.log, + getCallerFile: () => { + throw new YError(REQUIRE_DIRECTORY_ERROR); + }, + getProcessArgvBin, + mainFilename: 'yargs', + Parser, + path: { + basename: str => str, + dirname: str => str, + extname: str => str, + relative: str => str, + }, + process: { + argv: () => [], + cwd: () => '', + emitWarning: (warning, name) => {}, + execPath: () => '', + // exit is noop browser: + exit: () => {}, + nextTick: cb => { + // eslint-disable-next-line no-undef + window.setTimeout(cb, 1); + }, + stdColumns: 80, + }, + readFileSync: () => { + return ''; + }, + require: () => { + throw new YError(REQUIRE_ERROR); + }, + requireDirectory: () => { + throw new YError(REQUIRE_DIRECTORY_ERROR); + }, + stringWidth: str => { + return [...str].length; + }, + // TODO: replace this with y18n once it's ported to ESM: + y18n: { + __: (...str) => { + if (str.length === 0) return ''; + const args = str.slice(1); + return sprintf(str[0], ...args); + }, + __n: (str1, str2, count, ...args) => { + if (count === 1) { + return sprintf(str1, ...args); + } else { + return sprintf(str2, ...args); + } + }, + getLocale: () => { + return 'en_US'; + }, + setLocale: () => {}, + updateLocale: () => {}, + }, +}; + +function sprintf(_str, ...args) { + let str = ''; + const split = _str.split('%s'); + split.forEach((token, i) => { + str += `${token}${split[i + 1] !== undefined && args[i] ? args[i] : ''}`; + }); + return str; +} diff --git a/node_modules/yargs/lib/platform-shims/esm.mjs b/node_modules/yargs/lib/platform-shims/esm.mjs new file mode 100644 index 0000000..c25baa5 --- /dev/null +++ b/node_modules/yargs/lib/platform-shims/esm.mjs @@ -0,0 +1,73 @@ +'use strict' + +import { notStrictEqual, strictEqual } from 'assert' +import cliui from 'cliui' +import escalade from 'escalade/sync' +import { inspect } from 'util' +import { readFileSync } from 'fs' +import { fileURLToPath } from 'url'; +import Parser from 'yargs-parser' +import { basename, dirname, extname, relative, resolve } from 'path' +import { getProcessArgvBin } from '../../build/lib/utils/process-argv.js' +import { YError } from '../../build/lib/yerror.js' +import y18n from 'y18n' + +const REQUIRE_ERROR = 'require is not supported by ESM' +const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supported yet for ESM' + +let __dirname; +try { + __dirname = fileURLToPath(import.meta.url); +} catch (e) { + __dirname = process.cwd(); +} +const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules')); + +export default { + assert: { + notStrictEqual, + strictEqual + }, + cliui, + findUp: escalade, + getEnv: (key) => { + return process.env[key] + }, + inspect, + getCallerFile: () => { + throw new YError(REQUIRE_DIRECTORY_ERROR) + }, + getProcessArgvBin, + mainFilename: mainFilename || process.cwd(), + Parser, + path: { + basename, + dirname, + extname, + relative, + resolve + }, + process: { + argv: () => process.argv, + cwd: process.cwd, + emitWarning: (warning, type) => process.emitWarning(warning, type), + execPath: () => process.execPath, + exit: process.exit, + nextTick: process.nextTick, + stdColumns: typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null + }, + readFileSync, + require: () => { + throw new YError(REQUIRE_ERROR) + }, + requireDirectory: () => { + throw new YError(REQUIRE_DIRECTORY_ERROR) + }, + stringWidth: (str) => { + return [...str].length + }, + y18n: y18n({ + directory: resolve(__dirname, '../../../locales'), + updateFiles: false + }) +} diff --git a/node_modules/yargs/locales/be.json b/node_modules/yargs/locales/be.json new file mode 100644 index 0000000..e28fa30 --- /dev/null +++ b/node_modules/yargs/locales/be.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Каманды:", + "Options:": "Опцыі:", + "Examples:": "Прыклады:", + "boolean": "булевы тып", + "count": "падлік", + "string": "радковы тып", + "number": "лік", + "array": "масіў", + "required": "неабходна", + "default": "па змаўчанні", + "default:": "па змаўчанні:", + "choices:": "магчымасці:", + "aliases:": "аліасы:", + "generated-value": "згенераванае значэнне", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s", + "other": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s", + "other": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s" + }, + "Missing argument value: %s": { + "one": "Не хапае значэння аргументу: %s", + "other": "Не хапае значэнняў аргументаў: %s" + }, + "Missing required argument: %s": { + "one": "Не хапае неабходнага аргументу: %s", + "other": "Не хапае неабходных аргументаў: %s" + }, + "Unknown argument: %s": { + "one": "Невядомы аргумент: %s", + "other": "Невядомыя аргументы: %s" + }, + "Invalid values:": "Несапраўдныя значэння:", + "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Дадзенае значэнне: %s, Магчымасці: %s", + "Argument check failed: %s": "Праверка аргументаў не ўдалася: %s", + "Implications failed:": "Дадзены аргумент патрабуе наступны дадатковы аргумент:", + "Not enough arguments following: %s": "Недастаткова наступных аргументаў: %s", + "Invalid JSON config file: %s": "Несапраўдны файл канфігурацыі JSON: %s", + "Path to JSON config file": "Шлях да файла канфігурацыі JSON", + "Show help": "Паказаць дапамогу", + "Show version number": "Паказаць нумар версіі", + "Did you mean %s?": "Вы мелі на ўвазе %s?" +} diff --git a/node_modules/yargs/locales/cs.json b/node_modules/yargs/locales/cs.json new file mode 100644 index 0000000..6394875 --- /dev/null +++ b/node_modules/yargs/locales/cs.json @@ -0,0 +1,51 @@ +{ + "Commands:": "Příkazy:", + "Options:": "Možnosti:", + "Examples:": "Příklady:", + "boolean": "logická hodnota", + "count": "počet", + "string": "řetězec", + "number": "číslo", + "array": "pole", + "required": "povinné", + "default": "výchozí", + "default:": "výchozí:", + "choices:": "volby:", + "aliases:": "aliasy:", + "generated-value": "generovaná-hodnota", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Nedostatek argumentů: zadáno %s, je potřeba alespoň %s", + "other": "Nedostatek argumentů: zadáno %s, je potřeba alespoň %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Příliš mnoho argumentů: zadáno %s, maximálně %s", + "other": "Příliš mnoho argumentů: zadáno %s, maximálně %s" + }, + "Missing argument value: %s": { + "one": "Chybí hodnota argumentu: %s", + "other": "Chybí hodnoty argumentů: %s" + }, + "Missing required argument: %s": { + "one": "Chybí požadovaný argument: %s", + "other": "Chybí požadované argumenty: %s" + }, + "Unknown argument: %s": { + "one": "Neznámý argument: %s", + "other": "Neznámé argumenty: %s" + }, + "Invalid values:": "Neplatné hodnoty:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Zadáno: %s, Možnosti: %s", + "Argument check failed: %s": "Kontrola argumentů se nezdařila: %s", + "Implications failed:": "Chybí závislé argumenty:", + "Not enough arguments following: %s": "Následuje nedostatek argumentů: %s", + "Invalid JSON config file: %s": "Neplatný konfigurační soubor JSON: %s", + "Path to JSON config file": "Cesta ke konfiguračnímu souboru JSON", + "Show help": "Zobrazit nápovědu", + "Show version number": "Zobrazit číslo verze", + "Did you mean %s?": "Měl jste na mysli %s?", + "Arguments %s and %s are mutually exclusive" : "Argumenty %s a %s se vzájemně vylučují", + "Positionals:": "Poziční:", + "command": "příkaz", + "deprecated": "zastaralé", + "deprecated: %s": "zastaralé: %s" +} diff --git a/node_modules/yargs/locales/de.json b/node_modules/yargs/locales/de.json new file mode 100644 index 0000000..dc73ec3 --- /dev/null +++ b/node_modules/yargs/locales/de.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Kommandos:", + "Options:": "Optionen:", + "Examples:": "Beispiele:", + "boolean": "boolean", + "count": "Zähler", + "string": "string", + "number": "Zahl", + "array": "array", + "required": "erforderlich", + "default": "Standard", + "default:": "Standard:", + "choices:": "Möglichkeiten:", + "aliases:": "Aliase:", + "generated-value": "Generierter-Wert", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt", + "other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt", + "other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt" + }, + "Missing argument value: %s": { + "one": "Fehlender Argumentwert: %s", + "other": "Fehlende Argumentwerte: %s" + }, + "Missing required argument: %s": { + "one": "Fehlendes Argument: %s", + "other": "Fehlende Argumente: %s" + }, + "Unknown argument: %s": { + "one": "Unbekanntes Argument: %s", + "other": "Unbekannte Argumente: %s" + }, + "Invalid values:": "Unzulässige Werte:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s", + "Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s", + "Implications failed:": "Fehlende abhängige Argumente:", + "Not enough arguments following: %s": "Nicht genügend Argumente nach: %s", + "Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s", + "Path to JSON config file": "Pfad zur JSON-Config Datei", + "Show help": "Hilfe anzeigen", + "Show version number": "Version anzeigen", + "Did you mean %s?": "Meintest du %s?" +} diff --git a/node_modules/yargs/locales/en.json b/node_modules/yargs/locales/en.json new file mode 100644 index 0000000..af096a1 --- /dev/null +++ b/node_modules/yargs/locales/en.json @@ -0,0 +1,55 @@ +{ + "Commands:": "Commands:", + "Options:": "Options:", + "Examples:": "Examples:", + "boolean": "boolean", + "count": "count", + "string": "string", + "number": "number", + "array": "array", + "required": "required", + "default": "default", + "default:": "default:", + "choices:": "choices:", + "aliases:": "aliases:", + "generated-value": "generated-value", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Not enough non-option arguments: got %s, need at least %s", + "other": "Not enough non-option arguments: got %s, need at least %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Too many non-option arguments: got %s, maximum of %s", + "other": "Too many non-option arguments: got %s, maximum of %s" + }, + "Missing argument value: %s": { + "one": "Missing argument value: %s", + "other": "Missing argument values: %s" + }, + "Missing required argument: %s": { + "one": "Missing required argument: %s", + "other": "Missing required arguments: %s" + }, + "Unknown argument: %s": { + "one": "Unknown argument: %s", + "other": "Unknown arguments: %s" + }, + "Unknown command: %s": { + "one": "Unknown command: %s", + "other": "Unknown commands: %s" + }, + "Invalid values:": "Invalid values:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s", + "Argument check failed: %s": "Argument check failed: %s", + "Implications failed:": "Missing dependent arguments:", + "Not enough arguments following: %s": "Not enough arguments following: %s", + "Invalid JSON config file: %s": "Invalid JSON config file: %s", + "Path to JSON config file": "Path to JSON config file", + "Show help": "Show help", + "Show version number": "Show version number", + "Did you mean %s?": "Did you mean %s?", + "Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive", + "Positionals:": "Positionals:", + "command": "command", + "deprecated": "deprecated", + "deprecated: %s": "deprecated: %s" +} diff --git a/node_modules/yargs/locales/es.json b/node_modules/yargs/locales/es.json new file mode 100644 index 0000000..d77b461 --- /dev/null +++ b/node_modules/yargs/locales/es.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Comandos:", + "Options:": "Opciones:", + "Examples:": "Ejemplos:", + "boolean": "booleano", + "count": "cuenta", + "string": "cadena de caracteres", + "number": "número", + "array": "tabla", + "required": "requerido", + "default": "defecto", + "default:": "defecto:", + "choices:": "selección:", + "aliases:": "alias:", + "generated-value": "valor-generado", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s", + "other": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s", + "other": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s" + }, + "Missing argument value: %s": { + "one": "Falta argumento: %s", + "other": "Faltan argumentos: %s" + }, + "Missing required argument: %s": { + "one": "Falta argumento requerido: %s", + "other": "Faltan argumentos requeridos: %s" + }, + "Unknown argument: %s": { + "one": "Argumento desconocido: %s", + "other": "Argumentos desconocidos: %s" + }, + "Invalid values:": "Valores inválidos:", + "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Seleccionados: %s", + "Argument check failed: %s": "Verificación de argumento ha fallado: %s", + "Implications failed:": "Implicaciones fallidas:", + "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s", + "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s", + "Path to JSON config file": "Ruta al archivo de configuración JSON", + "Show help": "Muestra ayuda", + "Show version number": "Muestra número de versión", + "Did you mean %s?": "Quisiste decir %s?" +} diff --git a/node_modules/yargs/locales/fi.json b/node_modules/yargs/locales/fi.json new file mode 100644 index 0000000..481feb7 --- /dev/null +++ b/node_modules/yargs/locales/fi.json @@ -0,0 +1,49 @@ +{ + "Commands:": "Komennot:", + "Options:": "Valinnat:", + "Examples:": "Esimerkkejä:", + "boolean": "totuusarvo", + "count": "lukumäärä", + "string": "merkkijono", + "number": "numero", + "array": "taulukko", + "required": "pakollinen", + "default": "oletusarvo", + "default:": "oletusarvo:", + "choices:": "vaihtoehdot:", + "aliases:": "aliakset:", + "generated-value": "generoitu-arvo", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s", + "other": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s", + "other": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s" + }, + "Missing argument value: %s": { + "one": "Argumentin arvo puuttuu: %s", + "other": "Argumentin arvot puuttuvat: %s" + }, + "Missing required argument: %s": { + "one": "Pakollinen argumentti puuttuu: %s", + "other": "Pakollisia argumentteja puuttuu: %s" + }, + "Unknown argument: %s": { + "one": "Tuntematon argumentti: %s", + "other": "Tuntemattomia argumentteja: %s" + }, + "Invalid values:": "Virheelliset arvot:", + "Argument: %s, Given: %s, Choices: %s": "Argumentti: %s, Annettu: %s, Vaihtoehdot: %s", + "Argument check failed: %s": "Argumentin tarkistus epäonnistui: %s", + "Implications failed:": "Riippuvia argumentteja puuttuu:", + "Not enough arguments following: %s": "Argumentin perässä ei ole tarpeeksi argumentteja: %s", + "Invalid JSON config file: %s": "Epävalidi JSON-asetustiedosto: %s", + "Path to JSON config file": "JSON-asetustiedoston polku", + "Show help": "Näytä ohje", + "Show version number": "Näytä versionumero", + "Did you mean %s?": "Tarkoititko %s?", + "Arguments %s and %s are mutually exclusive" : "Argumentit %s ja %s eivät ole yhteensopivat", + "Positionals:": "Sijaintiparametrit:", + "command": "komento" +} diff --git a/node_modules/yargs/locales/fr.json b/node_modules/yargs/locales/fr.json new file mode 100644 index 0000000..edd743f --- /dev/null +++ b/node_modules/yargs/locales/fr.json @@ -0,0 +1,53 @@ +{ + "Commands:": "Commandes :", + "Options:": "Options :", + "Examples:": "Exemples :", + "boolean": "booléen", + "count": "compteur", + "string": "chaîne de caractères", + "number": "nombre", + "array": "tableau", + "required": "requis", + "default": "défaut", + "default:": "défaut :", + "choices:": "choix :", + "aliases:": "alias :", + "generated-value": "valeur générée", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Pas assez d'arguments (hors options) : reçu %s, besoin d'au moins %s", + "other": "Pas assez d'arguments (hors options) : reçus %s, besoin d'au moins %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Trop d'arguments (hors options) : reçu %s, maximum de %s", + "other": "Trop d'arguments (hors options) : reçus %s, maximum de %s" + }, + "Missing argument value: %s": { + "one": "Argument manquant : %s", + "other": "Arguments manquants : %s" + }, + "Missing required argument: %s": { + "one": "Argument requis manquant : %s", + "other": "Arguments requis manquants : %s" + }, + "Unknown argument: %s": { + "one": "Argument inconnu : %s", + "other": "Arguments inconnus : %s" + }, + "Unknown command: %s": { + "one": "Commande inconnue : %s", + "other": "Commandes inconnues : %s" + }, + "Invalid values:": "Valeurs invalides :", + "Argument: %s, Given: %s, Choices: %s": "Argument : %s, donné : %s, choix : %s", + "Argument check failed: %s": "Echec de la vérification de l'argument : %s", + "Implications failed:": "Arguments dépendants manquants :", + "Not enough arguments following: %s": "Pas assez d'arguments après : %s", + "Invalid JSON config file: %s": "Fichier de configuration JSON invalide : %s", + "Path to JSON config file": "Chemin du fichier de configuration JSON", + "Show help": "Affiche l'aide", + "Show version number": "Affiche le numéro de version", + "Did you mean %s?": "Vouliez-vous dire %s ?", + "Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs", + "Positionals:": "Arguments positionnels :", + "command": "commande" +} diff --git a/node_modules/yargs/locales/hi.json b/node_modules/yargs/locales/hi.json new file mode 100644 index 0000000..a9de77c --- /dev/null +++ b/node_modules/yargs/locales/hi.json @@ -0,0 +1,49 @@ +{ + "Commands:": "आदेश:", + "Options:": "विकल्प:", + "Examples:": "उदाहरण:", + "boolean": "सत्यता", + "count": "संख्या", + "string": "वर्णों का तार ", + "number": "अंक", + "array": "सरणी", + "required": "आवश्यक", + "default": "डिफॉल्ट", + "default:": "डिफॉल्ट:", + "choices:": "विकल्प:", + "aliases:": "उपनाम:", + "generated-value": "उत्पन्न-मूल्य", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है", + "other": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य", + "other": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य" + }, + "Missing argument value: %s": { + "one": "कुछ तर्को के मूल्य गुम हैं: %s", + "other": "कुछ तर्को के मूल्य गुम हैं: %s" + }, + "Missing required argument: %s": { + "one": "आवश्यक तर्क गुम हैं: %s", + "other": "आवश्यक तर्क गुम हैं: %s" + }, + "Unknown argument: %s": { + "one": "अज्ञात तर्क प्राप्त: %s", + "other": "अज्ञात तर्क प्राप्त: %s" + }, + "Invalid values:": "अमान्य मूल्य:", + "Argument: %s, Given: %s, Choices: %s": "तर्क: %s, प्राप्त: %s, विकल्प: %s", + "Argument check failed: %s": "तर्क जांच विफल: %s", + "Implications failed:": "दिए गए तर्क के लिए अतिरिक्त तर्क की अपेक्षा है:", + "Not enough arguments following: %s": "निम्नलिखित के बाद पर्याप्त तर्क नहीं प्राप्त: %s", + "Invalid JSON config file: %s": "अमान्य JSON config फाइल: %s", + "Path to JSON config file": "JSON config फाइल का पथ", + "Show help": "सहायता दिखाएँ", + "Show version number": "Version संख्या दिखाएँ", + "Did you mean %s?": "क्या आपका मतलब है %s?", + "Arguments %s and %s are mutually exclusive" : "तर्क %s और %s परस्पर अनन्य हैं", + "Positionals:": "स्थानीय:", + "command": "आदेश" +} diff --git a/node_modules/yargs/locales/hu.json b/node_modules/yargs/locales/hu.json new file mode 100644 index 0000000..21492d0 --- /dev/null +++ b/node_modules/yargs/locales/hu.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Parancsok:", + "Options:": "Opciók:", + "Examples:": "Példák:", + "boolean": "boolean", + "count": "számláló", + "string": "szöveg", + "number": "szám", + "array": "tömb", + "required": "kötelező", + "default": "alapértelmezett", + "default:": "alapértelmezett:", + "choices:": "lehetőségek:", + "aliases:": "aliaszok:", + "generated-value": "generált-érték", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell", + "other": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet", + "other": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet" + }, + "Missing argument value: %s": { + "one": "Hiányzó argumentum érték: %s", + "other": "Hiányzó argumentum értékek: %s" + }, + "Missing required argument: %s": { + "one": "Hiányzó kötelező argumentum: %s", + "other": "Hiányzó kötelező argumentumok: %s" + }, + "Unknown argument: %s": { + "one": "Ismeretlen argumentum: %s", + "other": "Ismeretlen argumentumok: %s" + }, + "Invalid values:": "Érvénytelen érték:", + "Argument: %s, Given: %s, Choices: %s": "Argumentum: %s, Megadott: %s, Lehetőségek: %s", + "Argument check failed: %s": "Argumentum ellenőrzés sikertelen: %s", + "Implications failed:": "Implikációk sikertelenek:", + "Not enough arguments following: %s": "Nem elég argumentum követi: %s", + "Invalid JSON config file: %s": "Érvénytelen JSON konfigurációs file: %s", + "Path to JSON config file": "JSON konfigurációs file helye", + "Show help": "Súgo megjelenítése", + "Show version number": "Verziószám megjelenítése", + "Did you mean %s?": "Erre gondoltál %s?" +} diff --git a/node_modules/yargs/locales/id.json b/node_modules/yargs/locales/id.json new file mode 100644 index 0000000..125867c --- /dev/null +++ b/node_modules/yargs/locales/id.json @@ -0,0 +1,50 @@ + +{ + "Commands:": "Perintah:", + "Options:": "Pilihan:", + "Examples:": "Contoh:", + "boolean": "boolean", + "count": "jumlah", + "number": "nomor", + "string": "string", + "array": "larik", + "required": "diperlukan", + "default": "bawaan", + "default:": "bawaan:", + "aliases:": "istilah lain:", + "choices:": "pilihan:", + "generated-value": "nilai-yang-dihasilkan", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Argumen wajib kurang: hanya %s, minimal %s", + "other": "Argumen wajib kurang: hanya %s, minimal %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Terlalu banyak argumen wajib: ada %s, maksimal %s", + "other": "Terlalu banyak argumen wajib: ada %s, maksimal %s" + }, + "Missing argument value: %s": { + "one": "Kurang argumen: %s", + "other": "Kurang argumen: %s" + }, + "Missing required argument: %s": { + "one": "Kurang argumen wajib: %s", + "other": "Kurang argumen wajib: %s" + }, + "Unknown argument: %s": { + "one": "Argumen tak diketahui: %s", + "other": "Argumen tak diketahui: %s" + }, + "Invalid values:": "Nilai-nilai tidak valid:", + "Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s", + "Argument check failed: %s": "Pemeriksaan argument gagal: %s", + "Implications failed:": "Implikasi gagal:", + "Not enough arguments following: %s": "Kurang argumen untuk: %s", + "Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s", + "Path to JSON config file": "Alamat berkas konfigurasi JSON", + "Show help": "Lihat bantuan", + "Show version number": "Lihat nomor versi", + "Did you mean %s?": "Maksud Anda: %s?", + "Arguments %s and %s are mutually exclusive" : "Argumen %s dan %s saling eksklusif", + "Positionals:": "Posisional-posisional:", + "command": "perintah" +} diff --git a/node_modules/yargs/locales/it.json b/node_modules/yargs/locales/it.json new file mode 100644 index 0000000..fde5756 --- /dev/null +++ b/node_modules/yargs/locales/it.json @@ -0,0 +1,46 @@ +{ + "Commands:": "Comandi:", + "Options:": "Opzioni:", + "Examples:": "Esempi:", + "boolean": "booleano", + "count": "contatore", + "string": "stringa", + "number": "numero", + "array": "vettore", + "required": "richiesto", + "default": "predefinito", + "default:": "predefinito:", + "choices:": "scelte:", + "aliases:": "alias:", + "generated-value": "valore generato", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s", + "other": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s", + "other": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s" + }, + "Missing argument value: %s": { + "one": "Argomento mancante: %s", + "other": "Argomenti mancanti: %s" + }, + "Missing required argument: %s": { + "one": "Argomento richiesto mancante: %s", + "other": "Argomenti richiesti mancanti: %s" + }, + "Unknown argument: %s": { + "one": "Argomento sconosciuto: %s", + "other": "Argomenti sconosciuti: %s" + }, + "Invalid values:": "Valori non validi:", + "Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s", + "Argument check failed: %s": "Controllo dell'argomento fallito: %s", + "Implications failed:": "Argomenti dipendenti mancanti:", + "Not enough arguments following: %s": "Argomenti insufficienti dopo: %s", + "Invalid JSON config file: %s": "File di configurazione JSON non valido: %s", + "Path to JSON config file": "Percorso del file di configurazione JSON", + "Show help": "Mostra la schermata di aiuto", + "Show version number": "Mostra il numero di versione", + "Did you mean %s?": "Intendi forse %s?" +} diff --git a/node_modules/yargs/locales/ja.json b/node_modules/yargs/locales/ja.json new file mode 100644 index 0000000..3954ae6 --- /dev/null +++ b/node_modules/yargs/locales/ja.json @@ -0,0 +1,51 @@ +{ + "Commands:": "コマンド:", + "Options:": "オプション:", + "Examples:": "例:", + "boolean": "真偽", + "count": "カウント", + "string": "文字列", + "number": "数値", + "array": "配列", + "required": "必須", + "default": "デフォルト", + "default:": "デフォルト:", + "choices:": "選択してください:", + "aliases:": "エイリアス:", + "generated-value": "生成された値", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:", + "other": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:", + "other": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:" + }, + "Missing argument value: %s": { + "one": "引数の値が見つかりません: %s", + "other": "引数の値が見つかりません: %s" + }, + "Missing required argument: %s": { + "one": "必須の引数が見つかりません: %s", + "other": "必須の引数が見つかりません: %s" + }, + "Unknown argument: %s": { + "one": "未知の引数です: %s", + "other": "未知の引数です: %s" + }, + "Invalid values:": "不正な値です:", + "Argument: %s, Given: %s, Choices: %s": "引数は %s です。与えられた値: %s, 選択してください: %s", + "Argument check failed: %s": "引数のチェックに失敗しました: %s", + "Implications failed:": "オプションの組み合わせで不正が生じました:", + "Not enough arguments following: %s": "次の引数が不足しています。: %s", + "Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s", + "Path to JSON config file": "JSONの設定ファイルまでのpath", + "Show help": "ヘルプを表示", + "Show version number": "バージョンを表示", + "Did you mean %s?": "もしかして %s?", + "Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません", + "Positionals:": "位置:", + "command": "コマンド", + "deprecated": "非推奨", + "deprecated: %s": "非推奨: %s" +} diff --git a/node_modules/yargs/locales/ko.json b/node_modules/yargs/locales/ko.json new file mode 100644 index 0000000..746bc89 --- /dev/null +++ b/node_modules/yargs/locales/ko.json @@ -0,0 +1,49 @@ +{ + "Commands:": "명령:", + "Options:": "옵션:", + "Examples:": "예시:", + "boolean": "불리언", + "count": "개수", + "string": "문자열", + "number": "숫자", + "array": "배열", + "required": "필수", + "default": "기본값", + "default:": "기본값:", + "choices:": "선택지:", + "aliases:": "별칭:", + "generated-value": "생성된 값", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "옵션이 아닌 인수가 충분하지 않습니다: %s개 입력받음, 최소 %s개 입력 필요", + "other": "옵션이 아닌 인수가 충분하지 않습니다: %s개 입력받음, 최소 %s개 입력 필요" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "옵션이 아닌 인수가 너무 많습니다: %s개 입력받음, 최대 %s개 입력 가능", + "other": "옵션이 아닌 인수가 너무 많습니다: %s개 입력받음, 최대 %s개 입력 가능" + }, + "Missing argument value: %s": { + "one": "인수가 주어지지 않았습니다: %s", + "other": "인수가 주어지지 않았습니다: %s" + }, + "Missing required argument: %s": { + "one": "필수 인수가 주어지지 않았습니다: %s", + "other": "필수 인수가 주어지지 않았습니다: %s" + }, + "Unknown argument: %s": { + "one": "알 수 없는 인수입니다: %s", + "other": "알 수 없는 인수입니다: %s" + }, + "Invalid values:": "유효하지 않은 값:", + "Argument: %s, Given: %s, Choices: %s": "인수: %s, 주어진 값: %s, 선택지: %s", + "Argument check failed: %s": "인수 체크에 실패했습니다: %s", + "Implications failed:": "주어진 인수에 필요한 추가 인수가 주어지지 않았습니다:", + "Not enough arguments following: %s": "다음 인수가 주어지지 않았습니다: %s", + "Invalid JSON config file: %s": "유효하지 않은 JSON 설정 파일: %s", + "Path to JSON config file": "JSON 설정 파일 경로", + "Show help": "도움말 표시", + "Show version number": "버전 표시", + "Did you mean %s?": "%s을(를) 찾으시나요?", + "Arguments %s and %s are mutually exclusive" : "인수 %s과(와) %s은(는) 동시에 지정할 수 없습니다", + "Positionals:": "위치:", + "command": "명령" +} diff --git a/node_modules/yargs/locales/nb.json b/node_modules/yargs/locales/nb.json new file mode 100644 index 0000000..6f410ed --- /dev/null +++ b/node_modules/yargs/locales/nb.json @@ -0,0 +1,44 @@ +{ + "Commands:": "Kommandoer:", + "Options:": "Alternativer:", + "Examples:": "Eksempler:", + "boolean": "boolsk", + "count": "antall", + "string": "streng", + "number": "nummer", + "array": "matrise", + "required": "obligatorisk", + "default": "standard", + "default:": "standard:", + "choices:": "valg:", + "generated-value": "generert-verdi", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s", + "other": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s", + "other": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s" + }, + "Missing argument value: %s": { + "one": "Mangler argument verdi: %s", + "other": "Mangler argument verdier: %s" + }, + "Missing required argument: %s": { + "one": "Mangler obligatorisk argument: %s", + "other": "Mangler obligatoriske argumenter: %s" + }, + "Unknown argument: %s": { + "one": "Ukjent argument: %s", + "other": "Ukjente argumenter: %s" + }, + "Invalid values:": "Ugyldige verdier:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s", + "Argument check failed: %s": "Argumentsjekk mislyktes: %s", + "Implications failed:": "Konsekvensene mislyktes:", + "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s", + "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", + "Path to JSON config file": "Bane til JSON konfigurasjonsfil", + "Show help": "Vis hjelp", + "Show version number": "Vis versjonsnummer" +} diff --git a/node_modules/yargs/locales/nl.json b/node_modules/yargs/locales/nl.json new file mode 100644 index 0000000..9ff95c5 --- /dev/null +++ b/node_modules/yargs/locales/nl.json @@ -0,0 +1,49 @@ +{ + "Commands:": "Commando's:", + "Options:": "Opties:", + "Examples:": "Voorbeelden:", + "boolean": "booleaans", + "count": "aantal", + "string": "string", + "number": "getal", + "array": "lijst", + "required": "verplicht", + "default": "standaard", + "default:": "standaard:", + "choices:": "keuzes:", + "aliases:": "aliassen:", + "generated-value": "gegenereerde waarde", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig", + "other": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s", + "other": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s" + }, + "Missing argument value: %s": { + "one": "Missende argumentwaarde: %s", + "other": "Missende argumentwaarden: %s" + }, + "Missing required argument: %s": { + "one": "Missend verplicht argument: %s", + "other": "Missende verplichte argumenten: %s" + }, + "Unknown argument: %s": { + "one": "Onbekend argument: %s", + "other": "Onbekende argumenten: %s" + }, + "Invalid values:": "Ongeldige waarden:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s", + "Argument check failed: %s": "Argumentcontrole mislukt: %s", + "Implications failed:": "Ontbrekende afhankelijke argumenten:", + "Not enough arguments following: %s": "Niet genoeg argumenten na: %s", + "Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s", + "Path to JSON config file": "Pad naar JSON-config-bestand", + "Show help": "Toon help", + "Show version number": "Toon versienummer", + "Did you mean %s?": "Bedoelde u misschien %s?", + "Arguments %s and %s are mutually exclusive": "Argumenten %s en %s kunnen niet tegelijk gebruikt worden", + "Positionals:": "Positie-afhankelijke argumenten", + "command": "commando" +} diff --git a/node_modules/yargs/locales/nn.json b/node_modules/yargs/locales/nn.json new file mode 100644 index 0000000..24479ac --- /dev/null +++ b/node_modules/yargs/locales/nn.json @@ -0,0 +1,44 @@ +{ + "Commands:": "Kommandoar:", + "Options:": "Alternativ:", + "Examples:": "Døme:", + "boolean": "boolsk", + "count": "mengd", + "string": "streng", + "number": "nummer", + "array": "matrise", + "required": "obligatorisk", + "default": "standard", + "default:": "standard:", + "choices:": "val:", + "generated-value": "generert-verdi", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s", + "other": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "For mange ikkje-alternativ argument: fekk %s, maksimum %s", + "other": "For mange ikkje-alternativ argument: fekk %s, maksimum %s" + }, + "Missing argument value: %s": { + "one": "Manglar argumentverdi: %s", + "other": "Manglar argumentverdiar: %s" + }, + "Missing required argument: %s": { + "one": "Manglar obligatorisk argument: %s", + "other": "Manglar obligatoriske argument: %s" + }, + "Unknown argument: %s": { + "one": "Ukjent argument: %s", + "other": "Ukjende argument: %s" + }, + "Invalid values:": "Ugyldige verdiar:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s", + "Argument check failed: %s": "Argumentsjekk mislukkast: %s", + "Implications failed:": "Konsekvensane mislukkast:", + "Not enough arguments following: %s": "Ikkje nok fylgjande argument: %s", + "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", + "Path to JSON config file": "Bane til JSON konfigurasjonsfil", + "Show help": "Vis hjelp", + "Show version number": "Vis versjonsnummer" +} diff --git a/node_modules/yargs/locales/pirate.json b/node_modules/yargs/locales/pirate.json new file mode 100644 index 0000000..dcb5cb7 --- /dev/null +++ b/node_modules/yargs/locales/pirate.json @@ -0,0 +1,13 @@ +{ + "Commands:": "Choose yer command:", + "Options:": "Options for me hearties!", + "Examples:": "Ex. marks the spot:", + "required": "requi-yar-ed", + "Missing required argument: %s": { + "one": "Ye be havin' to set the followin' argument land lubber: %s", + "other": "Ye be havin' to set the followin' arguments land lubber: %s" + }, + "Show help": "Parlay this here code of conduct", + "Show version number": "'Tis the version ye be askin' fer", + "Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench" +} diff --git a/node_modules/yargs/locales/pl.json b/node_modules/yargs/locales/pl.json new file mode 100644 index 0000000..a41d4bd --- /dev/null +++ b/node_modules/yargs/locales/pl.json @@ -0,0 +1,49 @@ +{ + "Commands:": "Polecenia:", + "Options:": "Opcje:", + "Examples:": "Przykłady:", + "boolean": "boolean", + "count": "ilość", + "string": "ciąg znaków", + "number": "liczba", + "array": "tablica", + "required": "wymagany", + "default": "domyślny", + "default:": "domyślny:", + "choices:": "dostępne:", + "aliases:": "aliasy:", + "generated-value": "wygenerowana-wartość", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s", + "other": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s", + "other": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s" + }, + "Missing argument value: %s": { + "one": "Brak wartości dla argumentu: %s", + "other": "Brak wartości dla argumentów: %s" + }, + "Missing required argument: %s": { + "one": "Brak wymaganego argumentu: %s", + "other": "Brak wymaganych argumentów: %s" + }, + "Unknown argument: %s": { + "one": "Nieznany argument: %s", + "other": "Nieznane argumenty: %s" + }, + "Invalid values:": "Nieprawidłowe wartości:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s", + "Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s", + "Implications failed:": "Założenia nie zostały spełnione:", + "Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s", + "Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s", + "Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON", + "Show help": "Pokaż pomoc", + "Show version number": "Pokaż numer wersji", + "Did you mean %s?": "Czy chodziło Ci o %s?", + "Arguments %s and %s are mutually exclusive": "Argumenty %s i %s wzajemnie się wykluczają", + "Positionals:": "Pozycyjne:", + "command": "polecenie" +} diff --git a/node_modules/yargs/locales/pt.json b/node_modules/yargs/locales/pt.json new file mode 100644 index 0000000..0c8ac99 --- /dev/null +++ b/node_modules/yargs/locales/pt.json @@ -0,0 +1,45 @@ +{ + "Commands:": "Comandos:", + "Options:": "Opções:", + "Examples:": "Exemplos:", + "boolean": "boolean", + "count": "contagem", + "string": "cadeia de caracteres", + "number": "número", + "array": "arranjo", + "required": "requerido", + "default": "padrão", + "default:": "padrão:", + "choices:": "escolhas:", + "generated-value": "valor-gerado", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s", + "other": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Excesso de argumentos não opcionais: recebido %s, máximo de %s", + "other": "Excesso de argumentos não opcionais: recebido %s, máximo de %s" + }, + "Missing argument value: %s": { + "one": "Falta valor de argumento: %s", + "other": "Falta valores de argumento: %s" + }, + "Missing required argument: %s": { + "one": "Falta argumento obrigatório: %s", + "other": "Faltando argumentos obrigatórios: %s" + }, + "Unknown argument: %s": { + "one": "Argumento desconhecido: %s", + "other": "Argumentos desconhecidos: %s" + }, + "Invalid values:": "Valores inválidos:", + "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s", + "Argument check failed: %s": "Verificação de argumento falhou: %s", + "Implications failed:": "Implicações falharam:", + "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s", + "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s", + "Path to JSON config file": "Caminho para o arquivo de configuração em JSON", + "Show help": "Mostra ajuda", + "Show version number": "Mostra número de versão", + "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos" +} diff --git a/node_modules/yargs/locales/pt_BR.json b/node_modules/yargs/locales/pt_BR.json new file mode 100644 index 0000000..eae1ec6 --- /dev/null +++ b/node_modules/yargs/locales/pt_BR.json @@ -0,0 +1,48 @@ +{ + "Commands:": "Comandos:", + "Options:": "Opções:", + "Examples:": "Exemplos:", + "boolean": "booleano", + "count": "contagem", + "string": "string", + "number": "número", + "array": "array", + "required": "obrigatório", + "default:": "padrão:", + "choices:": "opções:", + "aliases:": "sinônimos:", + "generated-value": "valor-gerado", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s", + "other": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Excesso de argumentos: recebido %s, máximo de %s", + "other": "Excesso de argumentos: recebido %s, máximo de %s" + }, + "Missing argument value: %s": { + "one": "Falta valor de argumento: %s", + "other": "Falta valores de argumento: %s" + }, + "Missing required argument: %s": { + "one": "Falta argumento obrigatório: %s", + "other": "Faltando argumentos obrigatórios: %s" + }, + "Unknown argument: %s": { + "one": "Argumento desconhecido: %s", + "other": "Argumentos desconhecidos: %s" + }, + "Invalid values:": "Valores inválidos:", + "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s", + "Argument check failed: %s": "Verificação de argumento falhou: %s", + "Implications failed:": "Implicações falharam:", + "Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s", + "Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s", + "Path to JSON config file": "Caminho para o arquivo JSON de configuração", + "Show help": "Exibe ajuda", + "Show version number": "Exibe a versão", + "Did you mean %s?": "Você quis dizer %s?", + "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos", + "Positionals:": "Posicionais:", + "command": "comando" +} diff --git a/node_modules/yargs/locales/ru.json b/node_modules/yargs/locales/ru.json new file mode 100644 index 0000000..d5c9e32 --- /dev/null +++ b/node_modules/yargs/locales/ru.json @@ -0,0 +1,51 @@ +{ + "Commands:": "Команды:", + "Options:": "Опции:", + "Examples:": "Примеры:", + "boolean": "булевый тип", + "count": "подсчет", + "string": "строковой тип", + "number": "число", + "array": "массив", + "required": "необходимо", + "default": "по умолчанию", + "default:": "по умолчанию:", + "choices:": "возможности:", + "aliases:": "алиасы:", + "generated-value": "генерированное значение", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s", + "other": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s", + "other": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s" + }, + "Missing argument value: %s": { + "one": "Не хватает значения аргумента: %s", + "other": "Не хватает значений аргументов: %s" + }, + "Missing required argument: %s": { + "one": "Не хватает необходимого аргумента: %s", + "other": "Не хватает необходимых аргументов: %s" + }, + "Unknown argument: %s": { + "one": "Неизвестный аргумент: %s", + "other": "Неизвестные аргументы: %s" + }, + "Invalid values:": "Недействительные значения:", + "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Данное значение: %s, Возможности: %s", + "Argument check failed: %s": "Проверка аргументов не удалась: %s", + "Implications failed:": "Данный аргумент требует следующий дополнительный аргумент:", + "Not enough arguments following: %s": "Недостаточно следующих аргументов: %s", + "Invalid JSON config file: %s": "Недействительный файл конфигурации JSON: %s", + "Path to JSON config file": "Путь к файлу конфигурации JSON", + "Show help": "Показать помощь", + "Show version number": "Показать номер версии", + "Did you mean %s?": "Вы имели в виду %s?", + "Arguments %s and %s are mutually exclusive": "Аргументы %s и %s являются взаимоисключающими", + "Positionals:": "Позиционные аргументы:", + "command": "команда", + "deprecated": "устар.", + "deprecated: %s": "устар.: %s" +} diff --git a/node_modules/yargs/locales/th.json b/node_modules/yargs/locales/th.json new file mode 100644 index 0000000..33b048e --- /dev/null +++ b/node_modules/yargs/locales/th.json @@ -0,0 +1,46 @@ +{ + "Commands:": "คอมมาน", + "Options:": "ออฟชั่น", + "Examples:": "ตัวอย่าง", + "boolean": "บูลีน", + "count": "นับ", + "string": "สตริง", + "number": "ตัวเลข", + "array": "อาเรย์", + "required": "จำเป็น", + "default": "ค่าเริ่มต้", + "default:": "ค่าเริ่มต้น", + "choices:": "ตัวเลือก", + "aliases:": "เอเลียส", + "generated-value": "ค่าที่ถูกสร้างขึ้น", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า", + "other": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า", + "other": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า" + }, + "Missing argument value: %s": { + "one": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s", + "other": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s" + }, + "Missing required argument: %s": { + "one": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s", + "other": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s" + }, + "Unknown argument: %s": { + "one": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s", + "other": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s" + }, + "Invalid values:": "ค่าไม่ถูกต้อง:", + "Argument: %s, Given: %s, Choices: %s": "อาร์กิวเมนต์: %s, ได้รับ: %s, ตัวเลือก: %s", + "Argument check failed: %s": "ตรวจสอบพบอาร์กิวเมนต์ที่ไม่ถูกต้อง: %s", + "Implications failed:": "Implications ไม่สำเร็จ:", + "Not enough arguments following: %s": "ใส่อาร์กิวเมนต์ไม่ครบ: %s", + "Invalid JSON config file: %s": "ไฟล์คอนฟิค JSON ไม่ถูกต้อง: %s", + "Path to JSON config file": "พาทไฟล์คอนฟิค JSON", + "Show help": "ขอความช่วยเหลือ", + "Show version number": "แสดงตัวเลขเวอร์ชั่น", + "Did you mean %s?": "คุณหมายถึง %s?" +} diff --git a/node_modules/yargs/locales/tr.json b/node_modules/yargs/locales/tr.json new file mode 100644 index 0000000..0d0d2cc --- /dev/null +++ b/node_modules/yargs/locales/tr.json @@ -0,0 +1,48 @@ +{ + "Commands:": "Komutlar:", + "Options:": "Seçenekler:", + "Examples:": "Örnekler:", + "boolean": "boolean", + "count": "sayı", + "string": "string", + "number": "numara", + "array": "array", + "required": "zorunlu", + "default": "varsayılan", + "default:": "varsayılan:", + "choices:": "seçimler:", + "aliases:": "takma adlar:", + "generated-value": "oluşturulan-değer", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli", + "other": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s", + "other": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s" + }, + "Missing argument value: %s": { + "one": "Eksik argüman değeri: %s", + "other": "Eksik argüman değerleri: %s" + }, + "Missing required argument: %s": { + "one": "Eksik zorunlu argüman: %s", + "other": "Eksik zorunlu argümanlar: %s" + }, + "Unknown argument: %s": { + "one": "Bilinmeyen argüman: %s", + "other": "Bilinmeyen argümanlar: %s" + }, + "Invalid values:": "Geçersiz değerler:", + "Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s", + "Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s", + "Implications failed:": "Sonuçlar başarısız oldu:", + "Not enough arguments following: %s": "%s için yeterli argüman bulunamadı", + "Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s", + "Path to JSON config file": "JSON yapılandırma dosya konumu", + "Show help": "Yardım detaylarını göster", + "Show version number": "Versiyon detaylarını göster", + "Did you mean %s?": "Bunu mu demek istediniz: %s?", + "Positionals:": "Sıralılar:", + "command": "komut" +} diff --git a/node_modules/yargs/locales/uk_UA.json b/node_modules/yargs/locales/uk_UA.json new file mode 100644 index 0000000..0af0e99 --- /dev/null +++ b/node_modules/yargs/locales/uk_UA.json @@ -0,0 +1,51 @@ +{ + "Commands:": "Команди:", + "Options:": "Опції:", + "Examples:": "Приклади:", + "boolean": "boolean", + "count": "кількість", + "string": "строка", + "number": "число", + "array": "масива", + "required": "обов'язково", + "default": "за замовчуванням", + "default:": "за замовчуванням:", + "choices:": "доступні варіанти:", + "aliases:": "псевдоніми:", + "generated-value": "згенероване значення", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "Недостатньо аргументів: наразі %s, потрібно %s або більше", + "other": "Недостатньо аргументів: наразі %s, потрібно %s або більше" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "Забагато аргументів: наразі %s, максимум %s", + "other": "Too many non-option arguments: наразі %s, максимум of %s" + }, + "Missing argument value: %s": { + "one": "Відсутнє значення для аргументу: %s", + "other": "Відсутні значення для аргументу: %s" + }, + "Missing required argument: %s": { + "one": "Відсутній обов'язковий аргумент: %s", + "other": "Відсутні обов'язкові аргументи: %s" + }, + "Unknown argument: %s": { + "one": "Аргумент %s не підтримується", + "other": "Аргументи %s не підтримуються" + }, + "Invalid values:": "Некоректні значення:", + "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Введено: %s, Доступні варіанти: %s", + "Argument check failed: %s": "Аргумент не пройшов перевірку: %s", + "Implications failed:": "Відсутні залежні аргументи:", + "Not enough arguments following: %s": "Не достатньо аргументів після: %s", + "Invalid JSON config file: %s": "Некоректний JSON-файл конфігурації: %s", + "Path to JSON config file": "Шлях до JSON-файлу конфігурації", + "Show help": "Показати довідку", + "Show version number": "Показати версію", + "Did you mean %s?": "Можливо, ви мали на увазі %s?", + "Arguments %s and %s are mutually exclusive" : "Аргументи %s та %s взаємовиключні", + "Positionals:": "Позиційні:", + "command": "команда", + "deprecated": "застарілий", + "deprecated: %s": "застарілий: %s" +} diff --git a/node_modules/yargs/locales/uz.json b/node_modules/yargs/locales/uz.json new file mode 100644 index 0000000..0d07168 --- /dev/null +++ b/node_modules/yargs/locales/uz.json @@ -0,0 +1,52 @@ +{ + "Commands:": "Buyruqlar:", + "Options:": "Imkoniyatlar:", + "Examples:": "Misollar:", + "boolean": "boolean", + "count": "sanoq", + "string": "satr", + "number": "raqam", + "array": "massiv", + "required": "majburiy", + "default": "boshlang'ich", + "default:": "boshlang'ich:", + "choices:": "tanlovlar:", + "aliases:": "taxalluslar:", + "generated-value": "yaratilgan-qiymat", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "No-imkoniyat argumentlar yetarli emas: berilgan %s, minimum %s", + "other": "No-imkoniyat argumentlar yetarli emas: berilgan %s, minimum %s" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "No-imkoniyat argumentlar juda ko'p: berilgan %s, maksimum %s", + "other": "No-imkoniyat argumentlar juda ko'p: got %s, maksimum %s" + }, + "Missing argument value: %s": { + "one": "Argument qiymati berilmagan: %s", + "other": "Argument qiymatlari berilmagan: %s" + }, + "Missing required argument: %s": { + "one": "Majburiy argument berilmagan: %s", + "other": "Majburiy argumentlar berilmagan: %s" + }, + "Unknown argument: %s": { + "one": "Noma'lum argument berilmagan: %s", + "other": "Noma'lum argumentlar berilmagan: %s" + }, + "Invalid values:": "Nosoz qiymatlar:", + "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Berilgan: %s, Tanlovlar: %s", + "Argument check failed: %s": "Muvaffaqiyatsiz argument tekshiruvi: %s", + "Implications failed:": "Bog'liq argumentlar berilmagan:", + "Not enough arguments following: %s": "Quyidagi argumentlar yetarli emas: %s", + "Invalid JSON config file: %s": "Nosoz JSON konfiguratsiya fayli: %s", + "Path to JSON config file": "JSON konfiguratsiya fayli joylashuvi", + "Show help": "Yordam ko'rsatish", + "Show version number": "Versiyani ko'rsatish", + "Did you mean %s?": "%s ni nazarda tutyapsizmi?", + "Arguments %s and %s are mutually exclusive" : "%s va %s argumentlari alohida", + "Positionals:": "Positsionallar:", + "command": "buyruq", + "deprecated": "eskirgan", + "deprecated: %s": "eskirgan: %s" + } + \ No newline at end of file diff --git a/node_modules/yargs/locales/zh_CN.json b/node_modules/yargs/locales/zh_CN.json new file mode 100644 index 0000000..257d26b --- /dev/null +++ b/node_modules/yargs/locales/zh_CN.json @@ -0,0 +1,48 @@ +{ + "Commands:": "命令:", + "Options:": "选项:", + "Examples:": "示例:", + "boolean": "布尔", + "count": "计数", + "string": "字符串", + "number": "数字", + "array": "数组", + "required": "必需", + "default": "默认值", + "default:": "默认值:", + "choices:": "可选值:", + "generated-value": "生成的值", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个", + "other": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个", + "other": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个" + }, + "Missing argument value: %s": { + "one": "没有给此选项指定值:%s", + "other": "没有给这些选项指定值:%s" + }, + "Missing required argument: %s": { + "one": "缺少必须的选项:%s", + "other": "缺少这些必须的选项:%s" + }, + "Unknown argument: %s": { + "one": "无法识别的选项:%s", + "other": "无法识别这些选项:%s" + }, + "Invalid values:": "无效的选项值:", + "Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s", + "Argument check failed: %s": "选项值验证失败:%s", + "Implications failed:": "缺少依赖的选项:", + "Not enough arguments following: %s": "没有提供足够的值给此选项:%s", + "Invalid JSON config file: %s": "无效的 JSON 配置文件:%s", + "Path to JSON config file": "JSON 配置文件的路径", + "Show help": "显示帮助信息", + "Show version number": "显示版本号", + "Did you mean %s?": "是指 %s?", + "Arguments %s and %s are mutually exclusive" : "选项 %s 和 %s 是互斥的", + "Positionals:": "位置:", + "command": "命令" +} diff --git a/node_modules/yargs/locales/zh_TW.json b/node_modules/yargs/locales/zh_TW.json new file mode 100644 index 0000000..e38495d --- /dev/null +++ b/node_modules/yargs/locales/zh_TW.json @@ -0,0 +1,51 @@ +{ + "Commands:": "命令:", + "Options:": "選項:", + "Examples:": "範例:", + "boolean": "布林", + "count": "次數", + "string": "字串", + "number": "數字", + "array": "陣列", + "required": "必填", + "default": "預設值", + "default:": "預設值:", + "choices:": "可選值:", + "aliases:": "別名:", + "generated-value": "生成的值", + "Not enough non-option arguments: got %s, need at least %s": { + "one": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個", + "other": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個" + }, + "Too many non-option arguments: got %s, maximum of %s": { + "one": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個", + "other": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個" + }, + "Missing argument value: %s": { + "one": "此引數無指定值:%s", + "other": "這些引數無指定值:%s" + }, + "Missing required argument: %s": { + "one": "缺少必須的引數:%s", + "other": "缺少這些必須的引數:%s" + }, + "Unknown argument: %s": { + "one": "未知的引數:%s", + "other": "未知的引數:%s" + }, + "Invalid values:": "無效的選項值:", + "Argument: %s, Given: %s, Choices: %s": "引數名稱: %s, 傳入的值: %s, 可選的值:%s", + "Argument check failed: %s": "引數驗證失敗:%s", + "Implications failed:": "缺少依賴引數:", + "Not enough arguments following: %s": "沒有提供足夠的值給此引數:%s", + "Invalid JSON config file: %s": "無效的 JSON 設置文件:%s", + "Path to JSON config file": "JSON 設置文件的路徑", + "Show help": "顯示說明", + "Show version number": "顯示版本", + "Did you mean %s?": "您是指 %s 嗎?", + "Arguments %s and %s are mutually exclusive" : "引數 %s 和 %s 互斥", + "Positionals:": "位置:", + "command": "命令", + "deprecated": "已淘汰", + "deprecated: %s": "已淘汰:%s" + } diff --git a/node_modules/yargs/node_modules/ansi-regex/index.d.ts b/node_modules/yargs/node_modules/ansi-regex/index.d.ts new file mode 100644 index 0000000..2dbf6af --- /dev/null +++ b/node_modules/yargs/node_modules/ansi-regex/index.d.ts @@ -0,0 +1,37 @@ +declare namespace ansiRegex { + interface Options { + /** + Match only the first ANSI escape. + + @default false + */ + onlyFirst: boolean; + } +} + +/** +Regular expression for matching ANSI escape codes. + +@example +``` +import ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` +*/ +declare function ansiRegex(options?: ansiRegex.Options): RegExp; + +export = ansiRegex; diff --git a/node_modules/yargs/node_modules/ansi-regex/index.js b/node_modules/yargs/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..616ff83 --- /dev/null +++ b/node_modules/yargs/node_modules/ansi-regex/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = ({onlyFirst = false} = {}) => { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/yargs/node_modules/ansi-regex/license b/node_modules/yargs/node_modules/ansi-regex/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/yargs/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yargs/node_modules/ansi-regex/package.json b/node_modules/yargs/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..017f531 --- /dev/null +++ b/node_modules/yargs/node_modules/ansi-regex/package.json @@ -0,0 +1,55 @@ +{ + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/yargs/node_modules/ansi-regex/readme.md b/node_modules/yargs/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..4d848bc --- /dev/null +++ b/node_modules/yargs/node_modules/ansi-regex/readme.md @@ -0,0 +1,78 @@ +# ansi-regex + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex(options?) + +Returns a regex for matching ANSI escape codes. + +#### options + +Type: `object` + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/yargs/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/yargs/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yargs/node_modules/emoji-regex/README.md b/node_modules/yargs/node_modules/emoji-regex/README.md new file mode 100644 index 0000000..f10e173 --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/yargs/node_modules/emoji-regex/es2015/index.js b/node_modules/yargs/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 0000000..b4cf3dc --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{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u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/yargs/node_modules/emoji-regex/es2015/text.js b/node_modules/yargs/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 0000000..780309d --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\u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F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/node_modules/yargs/node_modules/emoji-regex/index.d.ts b/node_modules/yargs/node_modules/emoji-regex/index.d.ts new file mode 100644 index 0000000..1955b47 --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,23 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} + +declare module 'emoji-regex/es2015/text' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/node_modules/yargs/node_modules/emoji-regex/index.js b/node_modules/yargs/node_modules/emoji-regex/index.js new file mode 100644 index 0000000..d993a3a --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\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uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/yargs/node_modules/emoji-regex/package.json b/node_modules/yargs/node_modules/emoji-regex/package.json new file mode 100644 index 0000000..6d32352 --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/package.json @@ -0,0 +1,50 @@ +{ + "name": "emoji-regex", + "version": "8.0.0", + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "homepage": "https://mths.be/emoji-regex", + "main": "index.js", + "types": "index.d.ts", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/emoji-regex.git" + }, + "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "devDependencies": { + "@babel/cli": "^7.2.3", + "@babel/core": "^7.3.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/preset-env": "^7.3.4", + "mocha": "^6.0.2", + "regexgen": "^1.3.0", + "unicode-12.0.0": "^0.7.9" + } +} diff --git a/node_modules/yargs/node_modules/emoji-regex/text.js b/node_modules/yargs/node_modules/emoji-regex/text.js new file mode 100644 index 0000000..0a55ce2 --- /dev/null +++ b/node_modules/yargs/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47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uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; +}; diff --git a/node_modules/yargs/node_modules/string-width/index.d.ts b/node_modules/yargs/node_modules/string-width/index.d.ts new file mode 100644 index 0000000..12b5309 --- /dev/null +++ b/node_modules/yargs/node_modules/string-width/index.d.ts @@ -0,0 +1,29 @@ +declare const stringWidth: { + /** + Get the visual width of a string - the number of columns required to display it. + + Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + + @example + ``` + import stringWidth = require('string-width'); + + stringWidth('a'); + //=> 1 + + stringWidth('古'); + //=> 2 + + stringWidth('\u001B[1m古\u001B[22m'); + //=> 2 + ``` + */ + (string: string): number; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function stringWidth(string: string): number; + // export = stringWidth; + default: typeof stringWidth; +} + +export = stringWidth; diff --git a/node_modules/yargs/node_modules/string-width/index.js b/node_modules/yargs/node_modules/string-width/index.js new file mode 100644 index 0000000..f4d261a --- /dev/null +++ b/node_modules/yargs/node_modules/string-width/index.js @@ -0,0 +1,47 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex'); + +const stringWidth = string => { + if (typeof string !== 'string' || string.length === 0) { + return 0; + } + + string = stripAnsi(string); + + if (string.length === 0) { + return 0; + } + + string = string.replace(emojiRegex(), ' '); + + let width = 0; + + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; + +module.exports = stringWidth; +// TODO: remove this in the next major version +module.exports.default = stringWidth; diff --git a/node_modules/yargs/node_modules/string-width/license b/node_modules/yargs/node_modules/string-width/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/yargs/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yargs/node_modules/string-width/package.json b/node_modules/yargs/node_modules/string-width/package.json new file mode 100644 index 0000000..28ba7b4 --- /dev/null +++ b/node_modules/yargs/node_modules/string-width/package.json @@ -0,0 +1,56 @@ +{ + "name": "string-width", + "version": "4.2.3", + "description": "Get the visual width of a string - the number of columns required to display it", + "license": "MIT", + "repository": "sindresorhus/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "string", + "character", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + } +} diff --git a/node_modules/yargs/node_modules/string-width/readme.md b/node_modules/yargs/node_modules/string-width/readme.md new file mode 100644 index 0000000..bdd3141 --- /dev/null +++ b/node_modules/yargs/node_modules/string-width/readme.md @@ -0,0 +1,50 @@ +# string-width + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('a'); +//=> 1 + +stringWidth('古'); +//=> 2 + +stringWidth('\u001B[1m古\u001B[22m'); +//=> 2 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/node_modules/yargs/node_modules/strip-ansi/index.d.ts b/node_modules/yargs/node_modules/strip-ansi/index.d.ts new file mode 100644 index 0000000..907fccc --- /dev/null +++ b/node_modules/yargs/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,17 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +declare function stripAnsi(string: string): string; + +export = stripAnsi; diff --git a/node_modules/yargs/node_modules/strip-ansi/index.js b/node_modules/yargs/node_modules/strip-ansi/index.js new file mode 100644 index 0000000..9a593df --- /dev/null +++ b/node_modules/yargs/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/yargs/node_modules/strip-ansi/license b/node_modules/yargs/node_modules/strip-ansi/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/yargs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yargs/node_modules/strip-ansi/package.json b/node_modules/yargs/node_modules/strip-ansi/package.json new file mode 100644 index 0000000..1a41108 --- /dev/null +++ b/node_modules/yargs/node_modules/strip-ansi/package.json @@ -0,0 +1,54 @@ +{ + "name": "strip-ansi", + "version": "6.0.1", + "description": "Strip ANSI escape codes from a string", + "license": "MIT", + "repository": "chalk/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.10.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/yargs/node_modules/strip-ansi/readme.md b/node_modules/yargs/node_modules/strip-ansi/readme.md new file mode 100644 index 0000000..7c4b56d --- /dev/null +++ b/node_modules/yargs/node_modules/strip-ansi/readme.md @@ -0,0 +1,46 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## strip-ansi for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + diff --git a/node_modules/yargs/package.json b/node_modules/yargs/package.json new file mode 100644 index 0000000..389cc6b --- /dev/null +++ b/node_modules/yargs/package.json @@ -0,0 +1,123 @@ +{ + "name": "yargs", + "version": "17.7.2", + "description": "yargs the modern, pirate-themed, successor to optimist.", + "main": "./index.cjs", + "exports": { + "./package.json": "./package.json", + ".": [ + { + "import": "./index.mjs", + "require": "./index.cjs" + }, + "./index.cjs" + ], + "./helpers": { + "import": "./helpers/helpers.mjs", + "require": "./helpers/index.js" + }, + "./browser": { + "import": "./browser.mjs", + "types": "./browser.d.ts" + }, + "./yargs": [ + { + "import": "./yargs.mjs", + "require": "./yargs" + }, + "./yargs" + ] + }, + "type": "module", + "module": "./index.mjs", + "contributors": [ + { + "name": "Yargs Contributors", + "url": "https://github.com/yargs/yargs/graphs/contributors" + } + ], + "files": [ + "browser.mjs", + "browser.d.ts", + "index.cjs", + "helpers/*.js", + "helpers/*", + "index.mjs", + "yargs", + "yargs.mjs", + "build", + "locales", + "LICENSE", + "lib/platform-shims/*.mjs", + "!*.d.ts", + "!**/*.d.ts" + ], + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "devDependencies": { + "@types/chai": "^4.2.11", + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "c8": "^7.7.0", + "chai": "^4.2.0", + "chalk": "^4.0.0", + "coveralls": "^3.0.9", + "cpr": "^3.0.1", + "cross-env": "^7.0.2", + "cross-spawn": "^7.0.0", + "eslint": "^7.23.0", + "gts": "^3.0.0", + "hashish": "0.0.4", + "mocha": "^9.0.0", + "rimraf": "^3.0.2", + "rollup": "^2.23.0", + "rollup-plugin-cleanup": "^3.1.1", + "rollup-plugin-terser": "^7.0.2", + "rollup-plugin-ts": "^2.0.4", + "typescript": "^4.0.2", + "which": "^2.0.0", + "yargs-test-extends": "^1.0.1" + }, + "scripts": { + "fix": "gts fix && npm run fix:js", + "fix:js": "eslint . --ext cjs --ext mjs --ext js --fix", + "posttest": "npm run check", + "test": "c8 mocha --enable-source-maps ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks", + "test:esm": "c8 mocha --enable-source-maps ./test/esm/*.mjs --check-leaks", + "coverage": "c8 report --check-coverage", + "prepare": "npm run compile", + "pretest": "npm run compile -- -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs", + "compile": "rimraf build && tsc", + "postcompile": "npm run build:cjs", + "build:cjs": "rollup -c rollup.config.cjs", + "postbuild:cjs": "rimraf ./build/index.cjs.d.ts", + "check": "gts lint && npm run check:js", + "check:js": "eslint . --ext cjs --ext mjs --ext js", + "clean": "gts clean" + }, + "repository": { + "type": "git", + "url": "https://github.com/yargs/yargs.git" + }, + "homepage": "https://yargs.js.org/", + "keywords": [ + "argument", + "args", + "option", + "parser", + "parsing", + "cli", + "command" + ], + "license": "MIT", + "engines": { + "node": ">=12" + } +} diff --git a/node_modules/yargs/yargs b/node_modules/yargs/yargs new file mode 100644 index 0000000..8460d10 --- /dev/null +++ b/node_modules/yargs/yargs @@ -0,0 +1,9 @@ +// TODO: consolidate on using a helpers file at some point in the future, which +// is the approach currently used to export Parser and applyExtends for ESM: +const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs') +Yargs.applyExtends = (config, cwd, mergeExtends) => { + return applyExtends(config, cwd, mergeExtends, cjsPlatformShim) +} +Yargs.hideBin = processArgv.hideBin +Yargs.Parser = Parser +module.exports = Yargs diff --git a/node_modules/yargs/yargs.mjs b/node_modules/yargs/yargs.mjs new file mode 100644 index 0000000..6d9f390 --- /dev/null +++ b/node_modules/yargs/yargs.mjs @@ -0,0 +1,10 @@ +// TODO: consolidate on using a helpers file at some point in the future, which +// is the approach currently used to export Parser and applyExtends for ESM: +import pkg from './build/index.cjs'; +const {applyExtends, cjsPlatformShim, Parser, processArgv, Yargs} = pkg; +Yargs.applyExtends = (config, cwd, mergeExtends) => { + return applyExtends(config, cwd, mergeExtends, cjsPlatformShim); +}; +Yargs.hideBin = processArgv.hideBin; +Yargs.Parser = Parser; +export default Yargs; diff --git a/node_modules/yocto-queue/index.d.ts b/node_modules/yocto-queue/index.d.ts new file mode 100644 index 0000000..9541986 --- /dev/null +++ b/node_modules/yocto-queue/index.d.ts @@ -0,0 +1,56 @@ +declare class Queue implements Iterable { + /** + The size of the queue. + */ + readonly size: number; + + /** + Tiny queue data structure. + + The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. + + @example + ``` + import Queue = require('yocto-queue'); + + const queue = new Queue(); + + queue.enqueue('🦄'); + queue.enqueue('🌈'); + + console.log(queue.size); + //=> 2 + + console.log(...queue); + //=> '🦄 🌈' + + console.log(queue.dequeue()); + //=> '🦄' + + console.log(queue.dequeue()); + //=> '🌈' + ``` + */ + constructor(); + + [Symbol.iterator](): IterableIterator; + + /** + Add a value to the queue. + */ + enqueue(value: ValueType): void; + + /** + Remove the next value in the queue. + + @returns The removed value or `undefined` if the queue is empty. + */ + dequeue(): ValueType | undefined; + + /** + Clear the queue. + */ + clear(): void; +} + +export = Queue; diff --git a/node_modules/yocto-queue/index.js b/node_modules/yocto-queue/index.js new file mode 100644 index 0000000..2f3e6dc --- /dev/null +++ b/node_modules/yocto-queue/index.js @@ -0,0 +1,68 @@ +class Node { + /// value; + /// next; + + constructor(value) { + this.value = value; + + // TODO: Remove this when targeting Node.js 12. + this.next = undefined; + } +} + +class Queue { + // TODO: Use private class fields when targeting Node.js 12. + // #_head; + // #_tail; + // #_size; + + constructor() { + this.clear(); + } + + enqueue(value) { + const node = new Node(value); + + if (this._head) { + this._tail.next = node; + this._tail = node; + } else { + this._head = node; + this._tail = node; + } + + this._size++; + } + + dequeue() { + const current = this._head; + if (!current) { + return; + } + + this._head = this._head.next; + this._size--; + return current.value; + } + + clear() { + this._head = undefined; + this._tail = undefined; + this._size = 0; + } + + get size() { + return this._size; + } + + * [Symbol.iterator]() { + let current = this._head; + + while (current) { + yield current.value; + current = current.next; + } + } +} + +module.exports = Queue; diff --git a/node_modules/yocto-queue/license b/node_modules/yocto-queue/license new file mode 100644 index 0000000..fa7ceba --- /dev/null +++ b/node_modules/yocto-queue/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/yocto-queue/package.json b/node_modules/yocto-queue/package.json new file mode 100644 index 0000000..71a9101 --- /dev/null +++ b/node_modules/yocto-queue/package.json @@ -0,0 +1,43 @@ +{ + "name": "yocto-queue", + "version": "0.1.0", + "description": "Tiny queue data structure", + "license": "MIT", + "repository": "sindresorhus/yocto-queue", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "queue", + "data", + "structure", + "algorithm", + "queues", + "queuing", + "list", + "array", + "linkedlist", + "fifo", + "enqueue", + "dequeue", + "data-structure" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.13.1", + "xo": "^0.35.0" + } +} diff --git a/node_modules/yocto-queue/readme.md b/node_modules/yocto-queue/readme.md new file mode 100644 index 0000000..c72fefc --- /dev/null +++ b/node_modules/yocto-queue/readme.md @@ -0,0 +1,64 @@ +# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue) + +> Tiny queue data structure + +You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays. + +> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle. + +## Install + +``` +$ npm install yocto-queue +``` + +## Usage + +```js +const Queue = require('yocto-queue'); + +const queue = new Queue(); + +queue.enqueue('🦄'); +queue.enqueue('🌈'); + +console.log(queue.size); +//=> 2 + +console.log(...queue); +//=> '🦄 🌈' + +console.log(queue.dequeue()); +//=> '🦄' + +console.log(queue.dequeue()); +//=> '🌈' +``` + +## API + +### `queue = new Queue()` + +The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow. + +#### `.enqueue(value)` + +Add a value to the queue. + +#### `.dequeue()` + +Remove the next value in the queue. + +Returns the removed value or `undefined` if the queue is empty. + +#### `.clear()` + +Clear the queue. + +#### `.size` + +The size of the queue. + +## Related + +- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache diff --git a/oss-config.js b/oss-config.js new file mode 100644 index 0000000..1f7d8af --- /dev/null +++ b/oss-config.js @@ -0,0 +1,8 @@ +// 阿里云OSS配置 +module.exports = { + region: 'oss-cn-chengdu', // OSS区域,例如 'oss-cn-hangzhou' + accessKeyId: 'LTAI5tRT6ReeHUdmqFpmLZi7', // 访问密钥ID + accessKeySecret: 'zTnK27IAphwgCDMmyJzMUsHYxGsDBE', // 访问密钥Secret + bucket: 'my-supplier-photos', // OSS存储桶名称 + endpoint: 'oss-cn-chengdu.aliyuncs.com' // 注意:不要在endpoint中包含bucket名称 +}; \ No newline at end of file diff --git a/oss-uploader.js b/oss-uploader.js new file mode 100644 index 0000000..69cbc3a --- /dev/null +++ b/oss-uploader.js @@ -0,0 +1,320 @@ +const fs = require('fs'); +const path = require('path'); +const { createHash } = require('crypto'); +const OSSClient = require('ali-oss'); +const ossConfig = require('./oss-config'); + +// 创建OSS客户端 - ali-oss 6.23.0版本的正确配置 +let client = null; + +// 初始化OSS客户端的函数 +function initOSSClient() { + try { + console.log('初始化OSS客户端配置:', { + region: ossConfig.region, + accessKeyId: ossConfig.accessKeyId ? '已配置' : '未配置', + accessKeySecret: ossConfig.accessKeySecret ? '已配置' : '未配置', + bucket: ossConfig.bucket, + endpoint: `https://${ossConfig.endpoint}` + }); + + client = new OSSClient({ + region: ossConfig.region, + accessKeyId: ossConfig.accessKeyId, + accessKeySecret: ossConfig.accessKeySecret, + bucket: ossConfig.bucket, + endpoint: ossConfig.endpoint, // 直接使用配置的endpoint,不添加前缀 + secure: true, // 启用HTTPS + cname: false // 对于标准OSS域名,不需要启用cname模式 + }); + + return client; + } catch (error) { + console.error('初始化OSS客户端失败:', error); + throw error; + } +} + +// 延迟初始化,避免应用启动时就连接OSS +function getOSSClient() { + if (!client) { + return initOSSClient(); + } + return client; +} + +class OssUploader { + /** + * 上传文件到OSS + * @param {String} filePath - 本地文件路径 + * @param {String} folder - OSS上的文件夹路径 + * @param {String} fileType - 文件类型,默认为'image' + * @returns {Promise} - 上传后的文件URL + */ + /** + * 计算文件的MD5哈希值 + * @param {String} filePath - 文件路径 + * @returns {Promise} - MD5哈希值 + */ + static async getFileHash(filePath) { + return new Promise((resolve, reject) => { + const hash = createHash('md5'); + const stream = fs.createReadStream(filePath); + + stream.on('error', reject); + stream.on('data', chunk => hash.update(chunk)); + stream.on('end', () => resolve(hash.digest('hex'))); + }); + } + + /** + * 计算缓冲区的MD5哈希值 + * @param {Buffer} buffer - 数据缓冲区 + * @returns {String} - MD5哈希值 + */ + static getBufferHash(buffer) { + return createHash('md5').update(buffer).digest('hex'); + } + + static async uploadFile(filePath, folder = 'images', fileType = 'image') { + try { + console.log('【OSS上传】开始上传文件:', filePath, '到目录:', folder); + + // 确保文件存在 + const fileExists = await fs.promises.access(filePath).then(() => true).catch(() => false); + if (!fileExists) { + throw new Error(`文件不存在: ${filePath}`); + } + + // 获取文件扩展名 + const extname = path.extname(filePath).toLowerCase(); + if (!extname) { + throw new Error(`无法获取文件扩展名: ${filePath}`); + } + + // 基于文件内容计算MD5哈希值,实现文件级去重 + console.log('【文件去重】开始计算文件哈希值...'); + const fileHash = await this.getFileHash(filePath); + console.log(`【文件去重】文件哈希计算完成: ${fileHash}`); + + // 使用哈希值作为文件名,确保相同内容的文件生成相同的文件名 + const uniqueFilename = `${fileHash}${extname}`; + const ossFilePath = `${folder}/${fileType}/${uniqueFilename}`; + + console.log(`【文件去重】使用基于内容的文件名: ${uniqueFilename}`); + + // 获取OSS客户端,延迟初始化 + const ossClient = getOSSClient(); + + // 测试OSS连接 + try { + await ossClient.list({ max: 1 }); + console.log('OSS连接测试成功'); + } catch (connError) { + console.error('OSS连接测试失败,尝试重新初始化客户端:', connError.message); + // 尝试重新初始化客户端 + initOSSClient(); + } + + // 检查OSS客户端配置 + console.log('【OSS上传】OSS配置检查 - region:', ossClient.options.region, 'bucket:', ossClient.options.bucket); + + // 上传文件,明确设置为公共读权限 + console.log(`开始上传文件到OSS: ${filePath} -> ${ossFilePath}`); + const result = await ossClient.put(ossFilePath, filePath, { + headers: { + 'x-oss-object-acl': 'public-read' // 确保文件可以公开访问 + }, + acl: 'public-read' // 额外设置ACL参数,确保文件公开可读 + }); + console.log(`文件上传成功: ${result.url}`); + console.log('已设置文件为公共读权限'); + + // 返回完整的文件URL + return result.url; + } catch (error) { + console.error('【OSS上传】上传文件失败:', error); + console.error('【OSS上传】错误详情:', error.message); + console.error('【OSS上传】错误栈:', error.stack); + throw error; + } + } + + /** + * 从缓冲区上传文件到OSS + * @param {Buffer} buffer - 文件数据缓冲区 + * @param {String} filename - 文件名 + * @param {String} folder - OSS上的文件夹路径 + * @param {String} fileType - 文件类型,默认为'image' + * @returns {Promise} - 上传后的文件URL + */ + static async uploadBuffer(buffer, filename, folder = 'images', fileType = 'image') { + try { + // 获取文件扩展名 + const extname = path.extname(filename).toLowerCase(); + if (!extname) { + throw new Error(`无法获取文件扩展名: ${filename}`); + } + + // 基于文件内容计算MD5哈希值,实现文件级去重 + console.log('【文件去重】开始计算缓冲区哈希值...'); + const bufferHash = this.getBufferHash(buffer); + console.log(`【文件去重】缓冲区哈希计算完成: ${bufferHash}`); + + // 使用哈希值作为文件名,确保相同内容的文件生成相同的文件名 + const uniqueFilename = `${bufferHash}${extname}`; + const ossFilePath = `${folder}/${fileType}/${uniqueFilename}`; + + console.log(`【文件去重】使用基于内容的文件名: ${uniqueFilename}`); + + // 获取OSS客户端,延迟初始化 + const ossClient = getOSSClient(); + + // 上传缓冲区,明确设置为公共读权限 + console.log(`开始上传缓冲区到OSS: ${ossFilePath}`); + const result = await ossClient.put(ossFilePath, buffer, { + headers: { + 'x-oss-object-acl': 'public-read' // 确保文件可以公开访问 + }, + acl: 'public-read' // 额外设置ACL参数,确保文件公开可读 + }); + console.log(`缓冲区上传成功: ${result.url}`); + console.log('已设置文件为公共读权限'); + + // 返回完整的文件URL + return result.url; + } catch (error) { + console.error('OSS缓冲区上传失败:', error); + console.error('OSS缓冲区上传错误详情:', error.message); + console.error('OSS缓冲区上传错误栈:', error.stack); + throw error; + } + } + + /** + * 批量上传文件到OSS + * @param {Array} filePaths - 本地文件路径数组 + * @param {String} folder - OSS上的文件夹路径 + * @param {String} fileType - 文件类型,默认为'image' + * @returns {Promise>} - 上传后的文件URL数组 + */ + static async uploadFiles(filePaths, folder = 'images', fileType = 'image') { + try { + const uploadPromises = filePaths.map(filePath => + this.uploadFile(filePath, folder, fileType) + ); + + const urls = await Promise.all(uploadPromises); + console.log(`批量上传完成,成功上传${urls.length}个文件`); + return urls; + } catch (error) { + console.error('OSS批量上传失败:', error); + throw error; + } + } + +/** + * 删除OSS上的文件 + * @param {String} ossFilePath - OSS上的文件路径 + * @returns {Promise} - 删除是否成功 + */ +static async deleteFile(ossFilePath) { + try { + console.log(`【OSS删除】开始删除OSS文件: ${ossFilePath}`); + const ossClient = getOSSClient(); + + // 【新增】记录OSS客户端配置信息(隐藏敏感信息) + console.log(`【OSS删除】OSS客户端配置 - region: ${ossClient.options.region}, bucket: ${ossClient.options.bucket}`); + + const result = await ossClient.delete(ossFilePath); + console.log(`【OSS删除】OSS文件删除成功: ${ossFilePath}`, result); + return true; + } catch (error) { + console.error('【OSS删除】OSS文件删除失败:', ossFilePath, '错误:', error.message); + console.error('【OSS删除】错误详情:', error); + + // 【增强日志】详细分析错误类型 + console.log('【OSS删除】=== 错误详细分析开始 ==='); + console.log('【OSS删除】错误名称:', error.name); + console.log('【OSS删除】错误代码:', error.code); + console.log('【OSS删除】HTTP状态码:', error.status); + console.log('【OSS删除】请求ID:', error.requestId); + console.log('【OSS删除】主机ID:', error.hostId); + + // 【关键检查】判断是否为权限不足错误 + const isPermissionError = + error.code === 'AccessDenied' || + error.status === 403 || + error.message.includes('permission') || + error.message.includes('AccessDenied') || + error.message.includes('do not have write permission'); + + if (isPermissionError) { + console.error('【OSS删除】❌ 确认是权限不足错误!'); + console.error('【OSS删除】❌ 当前AccessKey缺少删除文件的权限'); + console.error('【OSS删除】❌ 请检查RAM策略是否包含 oss:DeleteObject 权限'); + console.error('【OSS删除】❌ 建议在RAM中授予 AliyunOSSFullAccess 或自定义删除权限'); + } + + console.log('【OSS删除】=== 错误详细分析结束 ==='); + + // 如果文件不存在,也算删除成功 + if (error.code === 'NoSuchKey' || error.status === 404) { + console.log(`【OSS删除】文件不存在,视为删除成功: ${ossFilePath}`); + return true; + } + + // 【新增】对于权限错误,提供更友好的错误信息 + if (isPermissionError) { + const permissionError = new Error(`OSS删除权限不足: ${error.message}`); + permissionError.code = 'OSS_ACCESS_DENIED'; + permissionError.originalError = error; + throw permissionError; + } + + throw error; + } +} + /** + * 获取OSS配置信息 + * @returns {Object} - OSS配置信息 + */ + static getConfig() { + return { + region: ossConfig.region, + bucket: ossConfig.bucket, + endpoint: ossConfig.endpoint + }; + } + + /** + * 测试OSS连接 + * @returns {Promise} - 连接测试结果 + */ + static async testConnection() { + try { + console.log('【OSS连接测试】开始测试OSS连接...'); + const ossClient = getOSSClient(); + + // 执行简单的list操作来验证连接 + const result = await ossClient.list({ max: 1 }); + console.log('【OSS连接测试】连接成功,存储桶中有', result.objects.length, '个对象'); + + return { + success: true, + message: 'OSS连接成功', + region: ossClient.options.region, + bucket: ossClient.options.bucket + }; + } catch (error) { + console.error('【OSS连接测试】连接失败:', error.message); + return { + success: false, + message: `OSS连接失败: ${error.message}`, + error: error.message + }; + } + } +} + +module.exports = OssUploader; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0ba49cc --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5354 @@ +{ +<<<<<<< Updated upstream + "name": "Review2", +======= + "name": "boss", +>>>>>>> Stashed changes + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "ali-oss": "^6.23.0", + "axios": "^1.13.2", + "body-parser": "^2.2.1", + "cors": "^2.8.5", + "express": "^5.1.0", + "mysql2": "^3.15.3", + "sharp": "^0.34.5" + }, + "devDependencies": { + "chai": "^6.2.1", + "mocha": "^11.7.5", + "nyc": "^17.1.0", + "sinon": "^21.0.0", + "supertest": "^7.1.4" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.5.tgz", + "integrity": "sha512-6uFXyCayocRbqhZOB+6XcuZbkMNimwfVGFji8CTZnCzOHVGvDqzvitu1re2AU5LROliz7eQPhB8CpAMvnx9EjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.5.tgz", + "integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-compilation-targets": "^7.27.2", + "@babel/helper-module-transforms": "^7.28.3", + "@babel/helpers": "^7.28.4", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/traverse": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", + "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "@babel/types": "^7.28.5", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz", + "integrity": "sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.27.2", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", + "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.27.1", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.3.tgz", + "integrity": "sha512-gytXUbs8k2sXS9PnQptz5o0QnpLL51SwASIORY6XaBKF88nsOT0Zw9szLqlSGQDP/4TljBAD5y98p2U1fqkdsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.27.1", + "@babel/helper-validator-identifier": "^7.27.1", + "@babel/traverse": "^7.28.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.4.tgz", + "integrity": "sha512-HFN59MmQXGHVyYadKLVumYsA9dBFun/ldYxipEjzA4196jpLZd8UjEEBLkbEkvfYreDqJhZxYAWFPtrfhNpj4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.27.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", + "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/parser": "^7.27.2", + "@babel/types": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.27.1", + "@babel/generator": "^7.28.5", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.28.5", + "@babel/template": "^7.27.2", + "@babel/types": "^7.28.5", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", + "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", + "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "13.0.5", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-13.0.5.tgz", + "integrity": "sha512-36/hTbH2uaWuGVERyC6da9YwGWnzUZXuPro/F2LfsdOsLnCojz/iSH8MxUt/FD2S5XBSVPhmArFUXcpCQ2Hkiw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1" + } + }, + "node_modules/@sinonjs/samsam": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.3.tgz", + "integrity": "sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "type-detect": "^4.1.0" + } + }, + "node_modules/@sinonjs/samsam/node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/address": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/address/-/address-1.2.2.tgz", + "integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.3.tgz", + "integrity": "sha512-yqXL+k5rr8+ZRpOAntkaaRgWgE5o8ESAj5DyRmVTCSoZxXmqemb9Dd7T4i5UzwuERdLAJUy6XzR9zFVuf0kzkw==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ali-oss": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/ali-oss/-/ali-oss-6.23.0.tgz", + "integrity": "sha512-FipRmyd16Pr/tEey/YaaQ/24Pc3HEpLM9S1DRakEuXlSLXNIJnu1oJtHM53eVYpvW3dXapSjrip3xylZUTIZVQ==", + "license": "MIT", + "dependencies": { + "address": "^1.2.2", + "agentkeepalive": "^3.4.1", + "bowser": "^1.6.0", + "copy-to": "^2.0.1", + "dateformat": "^2.0.0", + "debug": "^4.3.4", + "destroy": "^1.0.4", + "end-or-error": "^1.0.1", + "get-ready": "^1.0.0", + "humanize-ms": "^1.2.0", + "is-type-of": "^1.4.0", + "js-base64": "^2.5.2", + "jstoxml": "^2.0.0", + "lodash": "^4.17.21", + "merge-descriptors": "^1.0.1", + "mime": "^2.4.5", + "platform": "^1.3.1", + "pump": "^3.0.0", + "qs": "^6.4.0", + "sdk-base": "^2.0.1", + "stream-http": "2.8.2", + "stream-wormhole": "^1.0.4", + "urllib": "^2.44.0", + "utility": "^1.18.0", + "xml2js": "^0.6.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ali-oss/node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "license": "MIT" + }, + "node_modules/append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-require-extensions": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/axios": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.3.tgz", + "integrity": "sha512-8QdH6czo+G7uBsNo0GiUfouPN1lRzKdJTGnKXwe12gkFbnnOUaUKGN55dMkfy+mnxmvjwl9zcI4VncczcVXDhA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.js" + } + }, + "node_modules/body-parser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.1.tgz", + "integrity": "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bowser": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.9.4.tgz", + "integrity": "sha512-9IdMmj2KjigRq6oWhmwv1W36pDuA4STQZ8q6YO9um+x07xgYNCD3Oou+WP/3L1HNz7iqythGet3/p4wvc8AAwQ==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001759", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz", + "integrity": "sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.1.tgz", + "integrity": "sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/copy-to": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==", + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha512-GODcnWq3YGoTnygPfi02ygEiRxqUxpJwuRHjdhJYuxpcZmDq4rjBiXYmbCCzStxo176ixfLT6i4NPwQooRySnw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-require-extensions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", + "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "strip-bom": "^4.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-user-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-user-agent/-/default-user-agent-1.0.0.tgz", + "integrity": "sha512-bDF7bg6OSNcSwFWPu4zYKpVkJZQYVrAANMYB8bc9Szem1D0yKdm4sa/rOCs2aC9+2GMqQ7KnwtZRvDhmLF0dXw==", + "license": "MIT", + "dependencies": { + "os-name": "~1.0.3" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/diff": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/digest-header": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/digest-header/-/digest-header-1.1.0.tgz", + "integrity": "sha512-glXVh42vz40yZb9Cq2oMOt70FIoWiv+vxNvdKdU8CwjLad25qHM3trLxhl9bVjdr6WaslIXhWpn0NO8T/67Qjg==", + "license": "MIT", + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.266", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.266.tgz", + "integrity": "sha512-kgWEglXvkEfMH7rxP5OSZZwnaDWT7J9EoZCujhnpLbfi0bbNtRkgdX2E3gt0Uer11c61qCYktB3hwkAS325sJg==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/end-or-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/end-or-error/-/end-or-error-1.0.1.tgz", + "integrity": "sha512-OclLMSug+k2A0JKuf494im25ANRBVW8qsjmwbgX7lQ8P82H21PQ1PWkoYwb9y5yMBS69BPlwtzdIFClo3+7kOQ==", + "license": "MIT", + "engines": { + "node": ">= 0.11.14" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/formidable": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.4.tgz", + "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", + "dezalgo": "^1.0.4", + "once": "^1.4.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/formstream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/formstream/-/formstream-1.5.2.tgz", + "integrity": "sha512-NASf0lgxC1AyKNXQIrXTEYkiX99LhCEXTkiGObXAkpBui86a4u8FjH1o2bGb3PpqI3kafC+yw4zWeK6l6VHTgg==", + "license": "MIT", + "dependencies": { + "destroy": "^1.0.4", + "mime": "^2.5.2", + "node-hex": "^1.0.1", + "pause-stream": "~0.0.11" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-ready": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-ready/-/get-ready-1.0.0.tgz", + "integrity": "sha512-mFXCZPJIlcYcth+N8267+mghfYN9h3EhsDa6JSnbA3Wrhh/XFpuowviFcsDeYZtKspQyWyJqfs4O6P8CHeTwzw==", + "license": "MIT" + }, + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz", + "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-class-hotfix": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz", + "integrity": "sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ==", + "license": "MIT" + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "append-transform": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-processinfo": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "dev": true, + "license": "ISC", + "dependencies": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "license": "BSD-3-Clause" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jstoxml": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/jstoxml/-/jstoxml-2.2.9.tgz", + "integrity": "sha512-OYWlK0j+roh+eyaMROlNbS5cd5R25Y+IUpdl7cNdB8HNrkgwQzIS7L9MegxOiWNBj9dQhA/yAxiMwCC5mwNoBw==", + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/lru.min": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.2.tgz", + "integrity": "sha512-Nv9KddBcQSlQopmBHXSsZVY5xsdlZkdH/Iey0BlcBYggMd4two7cZnKOK9vmy3nY0O5RGH99z1PCeTpPqszUYg==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mocha": { + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^9.0.5", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mysql2": { + "version": "3.15.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.15.3.tgz", + "integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.7.0", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-hex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/node-hex/-/node-hex-1.0.1.tgz", + "integrity": "sha512-iwpZdvW6Umz12ICmu9IYPRxg0tOLGmU3Tq2tKetejCj3oZd7b2nUXwP3a7QA5M9glWy8wlPS1G3RwM/CdsUbdQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "process-on-spawn": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-releases": { + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nyc": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-17.1.0.tgz", + "integrity": "sha512-U42vQ4czpKa0QdI1hu950XuNhYqgoM+ZF1HT+VuUHL9hPfDPVvNQyltmMqdE9bUHMVa+8yNbc3QKTj8zQhlVxQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^3.3.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^6.0.2", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "bin": { + "nyc": "bin/nyc.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/nyc/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/nyc/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/nyc/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/nyc/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/nyc/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nyc/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nyc/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/nyc/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/nyc/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-name": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-1.0.3.tgz", + "integrity": "sha512-f5estLO2KN8vgtTRaILIgEGBoBrMnZ3JQ7W9TMZCnOIGwHe8TRGSpcagnWDo+Dfhd/z08k9Xe75hvciJJ8Qaew==", + "license": "MIT", + "dependencies": { + "osx-release": "^1.0.0", + "win-release": "^1.0.0" + }, + "bin": { + "os-name": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osx-release": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/osx-release/-/osx-release-1.1.0.tgz", + "integrity": "sha512-ixCMMwnVxyHFQLQnINhmIpWqXIfS2YOXchwQrk+OFzmo6nDjQ0E4KXAyyUh0T0MZgV4bUhkRrAbVqlE4yLVq4A==", + "license": "MIT", + "dependencies": { + "minimist": "^1.1.0" + }, + "bin": { + "osx-release": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-scurry/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/process-on-spawn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.1.0.tgz", + "integrity": "sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "fromentries": "^1.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.1.tgz", + "integrity": "sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.7.0", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", + "dev": true, + "license": "ISC", + "dependencies": { + "es6-error": "^4.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true, + "license": "ISC" + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz", + "integrity": "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==", + "license": "BlueOak-1.0.0" + }, + "node_modules/sdk-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/sdk-base/-/sdk-base-2.0.1.tgz", + "integrity": "sha512-eeG26wRwhtwYuKGCDM3LixCaxY27Pa/5lK4rLKhQa7HBjJ3U3Y+f81MMZQRsDw/8SC2Dao/83yJTXJ8aULuN8Q==", + "license": "MIT", + "dependencies": { + "get-ready": "~1.0.0" + } + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true, + "license": "ISC" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sinon": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.0.tgz", + "integrity": "sha512-TOgRcwFPbfGtpqvZw+hyqJDvqfapr1qUlOizROIk4bBLjlsjlB00Pg6wMFXNtJRpu+eCZuVOaLatG7M8105kAw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.1", + "@sinonjs/fake-timers": "^13.0.5", + "@sinonjs/samsam": "^8.0.1", + "diff": "^7.0.0", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/spawn-wrap/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/spawn-wrap/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-http": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.2.tgz", + "integrity": "sha512-QllfrBhqF1DPcz46WxKTs6Mz1Bpc+8Qm6vbqOpVav5odAXwbyzwnEczoWqtxrsmlO+cJqtPrp/8gWKWjaKLLlA==", + "license": "MIT", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/stream-wormhole": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stream-wormhole/-/stream-wormhole-1.1.0.tgz", + "integrity": "sha512-gHFfL3px0Kctd6Po0M8TzEvt3De/xu6cnRrjlfYNhwbhLPLwigI2t1nc6jrzNuaYg5C4YF78PPFuQPzRiqn9ew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/superagent": { + "version": "10.2.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.3.tgz", + "integrity": "sha512-y/hkYGeXAj7wUMjxRbB21g/l6aAEituGXM9Rwl4o20+SX3e8YOSV6BxFXl+dL3Uk0mjSL3kCbNkwURm8/gEDig==", + "dev": true, + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.1", + "cookiejar": "^2.1.4", + "debug": "^4.3.7", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.4", + "formidable": "^3.5.4", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.2" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/supertest": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-7.1.4.tgz", + "integrity": "sha512-tjLPs7dVyqgItVFirHYqe2T+MfWc2VOBQ8QFKKbWTA3PU7liZR8zoSpAi/C1k1ilm9RsXIKYf197oap9wXGVYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "methods": "^1.1.2", + "superagent": "^10.2.3" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, + "node_modules/to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==", + "license": "MIT" + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "optional": true + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/unescape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unescape/-/unescape-1.0.1.tgz", + "integrity": "sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz", + "integrity": "sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/urllib": { + "version": "2.44.0", + "resolved": "https://registry.npmjs.org/urllib/-/urllib-2.44.0.tgz", + "integrity": "sha512-zRCJqdfYllRDA9bXUtx+vccyRqtJPKsw85f44zH7zPD28PIvjMqIgw9VwoTLV7xTBWZsbebUFVHU5ghQcWku2A==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.3.0", + "content-type": "^1.0.2", + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "ee-first": "~1.1.1", + "formstream": "^1.1.0", + "humanize-ms": "^1.2.0", + "iconv-lite": "^0.6.3", + "pump": "^3.0.0", + "qs": "^6.4.0", + "statuses": "^1.3.1", + "utility": "^1.16.1" + }, + "engines": { + "node": ">= 0.10.0" + }, + "peerDependencies": { + "proxy-agent": "^5.0.0" + }, + "peerDependenciesMeta": { + "proxy-agent": { + "optional": true + } + } + }, + "node_modules/urllib/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/urllib/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/win-release": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha512-iCRnKVvGxOQdsKhcQId2PXV1vV3J/sDPXKA4Oe9+Eti2nb2ESEsYHRYls/UjoUW3bIc5ZDO8dTH50A/5iVN+bw==", + "license": "MIT", + "dependencies": { + "semver": "^5.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/win-release/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/workerpool": { + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..74cddf2 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "dependencies": { + "ali-oss": "^6.23.0", + "axios": "^1.13.2", + "body-parser": "^2.2.1", + "cors": "^2.8.5", + "express": "^5.1.0", + "mysql2": "^3.15.3", + "sharp": "^0.34.5" + }, + "devDependencies": { + "chai": "^6.2.1", + "mocha": "^11.7.5", + "nyc": "^17.1.0", + "sinon": "^21.0.0", + "supertest": "^7.1.4" + } +} diff --git a/supply-manager.example.js b/supply-manager.example.js new file mode 100644 index 0000000..f1e9837 --- /dev/null +++ b/supply-manager.example.js @@ -0,0 +1,66 @@ +// 货源管理模块使用示例 +// 本文件展示如何在页面中使用SupplyManager类 + +const SupplyManager = require('./supply-manager.js'); + +// 页面实例示例 +const pageInstance = { + data: {}, + setData: function(data) { + this.data = { ...this.data, ...data }; + console.log('页面数据更新:', this.data); + } +}; + +// 初始化货源管理器 +const supplyManager = new SupplyManager(pageInstance); + +// 使用示例 +async function exampleUsage() { + console.log('===== 货源管理模块使用示例 ====='); + + try { + // 1. 加载货源列表 + console.log('1. 加载货源列表...'); + await supplyManager.loadSupplies(); + console.log(' 加载完成,货源数量:', supplyManager.data.supplies.length); + + // 2. 搜索货源 + console.log('2. 搜索货源...'); + supplyManager.data.searchKeyword = '罗曼粉'; + supplyManager.searchSupplies(); + console.log(' 搜索完成,结果数量:', supplyManager.data.publishedSupplies.length); + + // 3. 添加新货源 + console.log('3. 添加新货源...'); + supplyManager.data.newSupply = { + name: '罗曼粉', + price: '10.5', + minOrder: '50', + yolk: '红心', + spec: '格子装', + region: '北京市 北京市 朝阳区', + imageUrls: [] + }; + // 注意:实际添加货源需要登录状态和网络请求 + // await supplyManager.addSupply(); + console.log(' 新货源准备完成,等待发布'); + + // 4. 处理图片 + console.log('4. 处理图片URL...'); + const processedImages = supplyManager.processImageUrls(['http://example.com/image1.jpg', 'placeholder://example']); + console.log(' 图片处理结果:', processedImages); + + // 5. 格式化时间 + console.log('5. 格式化时间...'); + const formattedTime = supplyManager.formatCreateTime(new Date()); + console.log(' 格式化后的时间:', formattedTime); + + console.log('===== 示例运行完成 ====='); + } catch (error) { + console.error('示例运行出错:', error); + } +} + +// 运行示例 +exampleUsage(); diff --git a/supply-manager.js b/supply-manager.js new file mode 100644 index 0000000..a22c956 --- /dev/null +++ b/supply-manager.js @@ -0,0 +1,1120 @@ +// 货源管理模块 - 抽离自seller页面 +// 不包含联系客服和入驻功能 + +const API = require('./api.js'); + +class SupplyManager { + constructor(pageInstance) { + this.page = pageInstance; + this.data = { + supplies: [], + publishedSupplies: [], + pendingSupplies: [], + rejectedSupplies: [], + draftSupplies: [], + showModal: false, + showEditModal: false, + showRejectReasonModal: false, + currentRejectSupply: null, + rejectReason: '', + showTabBar: true, + showSpecSelectModal: false, + modalSpecSearchKeyword: '', + filteredModalSpecOptions: [], + selectedModalSpecIndex: -1, + currentSpecMode: 'create', + showNameSelectModal: false, + showYolkSelectModal: false, + selectedNameIndex: -1, + selectedYolkIndex: -1, + productNameOptions: ['罗曼粉', '伊莎粉', '罗曼灰', '海蓝灰', '海蓝褐', '绿壳', '粉一', '粉二', '粉八', '京粉1号', '京红', '京粉6号', '京粉3号', '农大系列', '黑鸡土蛋', '双黄蛋', '大午金凤', '黑凤'], + yolkOptions: ['红心', '黄心', '双色'], + specOptions: ['格子装', '散托', '不限规格', '净重47+', '净重46-47', '净重45-46', '净重44-45', '净重43-44', '净重42-43', '净重41-42', '净重40-41', '净重39-40', '净重38-39', '净重37-39', '净重37-38', '净重36-38', '净重36-37', '净重35-36', '净重34-35', '净重33-34', '净重32-33', '净重32-34', '净重31-32', '净重30-35', '净重30-34', '净重30-32', '净重30-31', '净重29-31', '净重29-30', '净重28-29', '净重28以下', '毛重52以上', '毛重50-51', '毛重48-49', '毛重47-48', '毛重46-47', '毛重45-47', '毛重45-46', '毛重44-45', '毛重43-44', '毛重42-43', '毛重41-42', '毛重40-41', '毛重38-39', '毛重36-37', '毛重34-35', '毛重32-33', '毛重30-31', '毛重30以下'], + specSearchKeyword: '', + editSpecSearchKeyword: '', + filteredSpecOptions: [], + filteredEditSpecOptions: [], + productingOptions: ['1*360枚新包装', '1*360枚旧包新拖', '1*360枚旧包旧拖', '1*420枚新包装', '1*480枚新包装', '30枚蛋托散装', '360枚散托'], + productingSearchKeyword: '', + editProductingSearchKeyword: '', + filteredProductingOptions: [], + filteredEditProductingOptions: [], + showProductingSelectModal: false, + currentProductingMode: 'create', + showRegionSelectModal: false, + currentRegionMode: 'create', + regionOptions: [ + // 地区数据 - 这里简化处理,实际使用时可以从原始文件复制完整数据 + { + name: '北京市', + cities: [{ + name: '北京市', + districts: ['东城区', '西城区', '朝阳区', '丰台区', '石景山区', '海淀区'] + }] + } + // 更多地区数据可以根据需要添加 + ], + selectedProvinceIndex: 0, + selectedCityIndex: 0, + selectedDistrictIndex: 0, + currentCities: [], + currentDistricts: [], + regionSearchKeyword: '', + editRegionSearchKeyword: '', + filteredRegionOptions: [], + showSearchResults: false, + newSupply: { + name: '', + price: '', + minOrder: '', + yolk: '', + yolkIndex: 0, + spec: '', + specIndex: 0, + region: '', + grossWeight: '', + imageUrls: [] + }, + newSupplyRegionArray: [], + editSupplyRegionArray: [], + editSupply: { + yolkIndex: 0, + specIndex: 0 + }, + currentImageIndex: 0, + searchKeyword: '', + scale: 1, + offsetX: 0, + offsetY: 0, + lastDistance: 0, + lastTouchPoint: null, + imageWidth: 375, + imageHeight: 375, + minScale: 1, + maxScale: 4, + doubleTapTimeout: null, + doubleTapCount: 0, + pagination: { + published: { page: 1, pageSize: 20, hasMore: true, loading: false }, + pending: { page: 1, pageSize: 20, hasMore: true, loading: false }, + rejected: { page: 1, pageSize: 20, hasMore: true, loading: false }, + draft: { page: 1, pageSize: 20, hasMore: true, loading: false } + }, + currentLoadingType: null, + isPublishedExpanded: true, + isPendingExpanded: true, + isRejectedExpanded: true, + isDraftExpanded: true, + autoPublishAfterEdit: false, + _hasLoadedOnShow: false, + pageScrollLock: false, + touchMoveBlocked: false, + showAuthModal: false, + showOneKeyLoginModal: false, + pendingUserType: 'seller', + avatarUrl: '/images/default-avatar.png', + partnerstatus: '' + }; + + // 初始化规格搜索相关数据 + this.initData(); + } + + initData() { + this.data.filteredSpecOptions = this.data.specOptions; + this.data.filteredEditSpecOptions = this.data.specOptions; + this.data.currentCities = this.data.regionOptions[this.data.selectedProvinceIndex].cities; + this.data.currentDistricts = this.data.regionOptions[this.data.selectedProvinceIndex].cities[this.data.selectedCityIndex].districts; + + // 更新页面数据 + this.updatePageData(); + } + + updatePageData() { + if (this.page && this.page.setData) { + this.page.setData(this.data); + } + } + + // 加载货源列表 + loadSupplies() { + console.log('开始加载货源数据 - 分页模式'); + + // 重置所有分页状态 + this.resetAllPagination(); + + // 并行加载所有类型的货源 + return Promise.all([ + this.loadSuppliesFromServer('published', 1), + this.loadSuppliesFromServer('pending', 1), + this.loadSuppliesFromServer('rejected', 1), + this.loadSuppliesFromServer('draft', 1) + ]); + } + + // 重置所有分页状态 + resetAllPagination() { + this.data.pagination.published = { page: 1, pageSize: 20, hasMore: true, loading: false }; + this.data.pagination.pending = { page: 1, pageSize: 20, hasMore: true, loading: false }; + this.data.pagination.rejected = { page: 1, pageSize: 20, hasMore: true, loading: false }; + this.data.pagination.draft = { page: 1, pageSize: 20, hasMore: true, loading: false }; + this.data.currentLoadingType = null; + + this.updatePageData(); + } + + // 搜索货源 + searchSupplies() { + console.log('搜索货源,关键词:', this.data.searchKeyword); + + const keyword = this.data.searchKeyword.toLowerCase().trim(); + if (!keyword) { + // 如果关键词为空,重新加载所有数据 + return this.loadSupplies(); + } + + // 从所有货源中搜索 + const allSupplies = this.data.supplies; + + // 过滤符合条件的货源 + const filteredSupplies = allSupplies.filter(supply => { + const name = (supply.name || '').toLowerCase(); + const productName = (supply.productName || '').toLowerCase(); + const yolk = (supply.yolk || '').toLowerCase(); + const spec = (supply.spec || '').toLowerCase(); + + return name.includes(keyword) || + productName.includes(keyword) || + yolk.includes(keyword) || + spec.includes(keyword); + }); + + // 将过滤后的货源按照状态分类 + this.data.publishedSupplies = filteredSupplies.filter(s => s.status === 'published'); + this.data.pendingSupplies = filteredSupplies.filter(s => s.status === 'pending_review' || s.status === 'reviewed'); + this.data.rejectedSupplies = filteredSupplies.filter(s => s.status === 'rejected'); + this.data.draftSupplies = filteredSupplies.filter(s => s.status === 'draft' || s.status === 'sold_out'); + + this.updatePageData(); + } + + // 处理图片URL + processImageUrls(imageUrls) { + if (!imageUrls || !Array.isArray(imageUrls)) { + return []; + } + + return imageUrls.map(url => { + if (!url || typeof url !== 'string') return ''; + + let processedUrl = url.trim(); + + // 处理占位符URL - 替换为本地默认图片 + if (processedUrl.startsWith('placeholder://')) { + return '/images/default-product.png'; + } + + // 处理临时文件路径 + if (processedUrl.startsWith('http://tmp/') || processedUrl.startsWith('wxfile://')) { + return processedUrl; + } + + // 确保HTTP URL格式正确 + if (processedUrl.startsWith('//')) { + processedUrl = 'https:' + processedUrl; + } else if (!processedUrl.startsWith('http') && !processedUrl.startsWith('/')) { + processedUrl = '/' + processedUrl; + } + + return processedUrl; + }).filter(url => url && url !== ''); + } + + // 从服务器获取货源数据 + loadSuppliesFromServer(type = 'all', page = 1) { + return new Promise((resolve, reject) => { + const openid = wx.getStorageSync('openid'); + console.log(`loadSuppliesFromServer - type: ${type}, page: ${page}, openid:`, openid); + + if (!openid) { + console.warn('openid不存在,显示空数据状态'); + this.data.supplies = []; + this.data.publishedSupplies = []; + this.data.pendingSupplies = []; + this.data.rejectedSupplies = []; + this.data.draftSupplies = []; + this.updatePageData(); + resolve([]); + return; + } + + let status = []; + let pageSize = 20; + + switch (type) { + case 'published': + status = ['published']; + pageSize = this.data.pagination.published.pageSize; + this.data.pagination.published.loading = true; + this.data.currentLoadingType = 'published'; + break; + case 'pending': + status = ['pending_review', 'reviewed']; + pageSize = this.data.pagination.pending.pageSize; + this.data.pagination.pending.loading = true; + this.data.currentLoadingType = 'pending'; + break; + case 'rejected': + status = ['rejected']; + pageSize = this.data.pagination.rejected.pageSize; + this.data.pagination.rejected.loading = true; + this.data.currentLoadingType = 'rejected'; + break; + case 'draft': + status = ['draft', 'sold_out']; + pageSize = this.data.pagination.draft.pageSize; + this.data.pagination.draft.loading = true; + this.data.currentLoadingType = 'draft'; + break; + default: + status = ['all']; + pageSize = 100; + } + + const requestData = { + openid: openid, + viewMode: 'seller', + status: status, + page: page, + pageSize: pageSize + }; + + API.getAllSupplies(requestData) + .then(res => { + console.log(`从服务器获取${type}类型数据响应:`, res); + + if (res && res.success && res.products) { + const serverSupplies = res.products + .filter(product => product.status !== 'hidden') + .map(serverProduct => { + const mappedStatus = serverProduct.status; + let imageUrls = this.processImageUrls(serverProduct.imageUrls); + const createdAt = serverProduct.created_at || null; + const formattedCreatedAt = this.formatCreateTime(createdAt); + + return { + id: serverProduct.productId, + name: serverProduct.productName, + productName: serverProduct.productName, + price: serverProduct.price, + minOrder: serverProduct.quantity, + grossWeight: serverProduct.grossWeight, + yolk: serverProduct.yolk, + spec: serverProduct.specification, + region: serverProduct.region || '未知地区', + serverProductId: serverProduct.productId, + status: mappedStatus, + rejectReason: serverProduct.rejectReason || '', + imageUrls: imageUrls, + created_at: createdAt, + formattedCreatedAt: formattedCreatedAt, + currentImageIndex: 0, + product_contact: serverProduct.product_contact || '', + contact_phone: serverProduct.contact_phone || '' + }; + }); + + this.updateSuppliesByType(type, serverSupplies, res, page); + resolve(serverSupplies); + } else { + this.handleNoData(type); + resolve([]); + } + }) + .catch(err => { + console.error(`从服务器获取${type}类型数据失败:`, err); + this.handleLoadError(type, err); + reject(err); + }) + .finally(() => { + this.resetLoadingState(type); + }); + }); + } + + // 根据类型更新货源数据 + updateSuppliesByType(type, newSupplies, response, currentPage) { + const paginationKey = `pagination.${type}`; + + // 更新分页信息 + const hasMore = currentPage < (response.totalPages || 1); + this.data.pagination[type].hasMore = hasMore; + this.data.pagination[type].page = currentPage; + + // 更新货源列表 + if (currentPage === 1) { + this.data[`${type}Supplies`] = newSupplies; + } else { + const existingSupplies = this.data[`${type}Supplies`] || []; + this.data[`${type}Supplies`] = [...existingSupplies, ...newSupplies]; + } + + // 更新总列表 + this.updateAllSupplies(); + + this.updatePageData(); + } + + // 更新所有货源列表 + updateAllSupplies() { + this.data.supplies = [ + ...this.data.publishedSupplies, + ...this.data.pendingSupplies, + ...this.data.rejectedSupplies, + ...this.data.draftSupplies + ]; + } + + // 处理无数据情况 + handleNoData(type) { + this.data.pagination[type].hasMore = false; + this.data[`${type}Supplies`] = []; + this.updatePageData(); + } + + // 处理加载错误 + handleLoadError(type, err) { + this.data.pagination[type].loading = false; + this.updatePageData(); + } + + // 重置加载状态 + resetLoadingState(type) { + if (type !== 'all') { + this.data.pagination[type].loading = false; + this.data.currentLoadingType = null; + this.updatePageData(); + } + } + + // 加载更多货源 + loadMoreSupplies(type) { + const pagination = this.data.pagination[type]; + + if (!pagination.hasMore || pagination.loading) { + return; + } + + const nextPage = pagination.page + 1; + return this.loadSuppliesFromServer(type, nextPage); + } + + // 格式化创建时间 + formatCreateTime(timeValue) { + if (!timeValue) { + return '无'; + } + + try { + let date; + + if (typeof timeValue === 'string') { + date = new Date(timeValue); + + if (isNaN(date.getTime())) { + const cleanTime = timeValue.replace(/[^\d\-T:.]/g, ''); + date = new Date(cleanTime); + } + } else if (typeof timeValue === 'number') { + date = new Date(timeValue); + } else { + date = new Date(timeValue); + } + + if (isNaN(date.getTime())) { + return '无'; + } + + const year = date.getFullYear(); + const month = (date.getMonth() + 1).toString().padStart(2, '0'); + const day = date.getDate().toString().padStart(2, '0'); + const hours = date.getHours().toString().padStart(2, '0'); + const minutes = date.getMinutes().toString().padStart(2, '0'); + + return `${year}/${month}/${day} ${hours}:${minutes}`; + } catch (error) { + console.error('时间格式化错误:', error); + return '无'; + } + } + + // 显示添加货源弹窗 + showAddSupply(e) { + if (e && e.stopPropagation) { + e.stopPropagation(); + } + + // 尝试从本地存储加载保存的表单数据,支持多种格式 + let savedSupply = wx.getStorageSync('newSupplyDraft'); + let webFormDraft = wx.getStorageSync('supplyFormDraft'); + + // 如果没有找到保存的数据,使用默认数据 + if (!savedSupply || typeof savedSupply !== 'object') { + savedSupply = { name: '', price: '', minOrder: '', yolk: '', spec: '', grossWeight: '', region: '', imageUrls: [] }; + } + + // 如果有web格式的表单数据,优先使用 + if (webFormDraft) { + try { + const formData = typeof webFormDraft === 'string' ? JSON.parse(webFormDraft) : webFormDraft; + // 转换字段名以匹配小程序格式 + savedSupply = { + name: formData.productName || savedSupply.name, + price: formData.price || savedSupply.price, + minOrder: formData.quantity || savedSupply.minOrder, + grossWeight: formData.grossWeight || savedSupply.grossWeight, + yolk: formData.yolk || savedSupply.yolk, + spec: formData.specification || savedSupply.spec, + region: formData.region || savedSupply.region, + imageUrls: formData.imageUrls || savedSupply.imageUrls || [] + }; + console.log('已加载web格式的表单数据'); + } catch (e) { + console.error('加载web格式表单数据失败:', e); + } + } + + this.data.showImagePreview = false; + this.data.showModal = true; + this.data.newSupply = savedSupply; + + this.updatePageData(); + this.disablePageScroll(); + console.log('已加载保存的货源草稿数据'); + } + + // 隐藏弹窗 + hideModal() { + this.data.showModal = false; + this.data.showImagePreview = false; + this.updatePageData(); + this.enablePageScroll(); + } + + // 输入内容处理 + onInput(e) { + const field = e.currentTarget.dataset.field; + const value = e.detail.value; + this.data.newSupply[field] = value; + this.updatePageData(); + + // 实时保存到本地存储,支持多种格式以兼容不同页面 + wx.setStorageSync('newSupplyDraft', this.data.newSupply); + + // 同时保存为web格式,以便与网页端兼容 + const webFormData = { + productName: this.data.newSupply.name, + price: this.data.newSupply.price, + quantity: this.data.newSupply.minOrder, + grossWeight: this.data.newSupply.grossWeight, + yolk: this.data.newSupply.yolk, + specification: this.data.newSupply.spec, + region: this.data.newSupply.region, + imageUrls: this.data.newSupply.imageUrls || [] + }; + wx.setStorageSync('supplyFormDraft', JSON.stringify(webFormData)); + + console.log(`字段 ${field} 已更新并保存`); + } + + // 编辑输入处理 + onEditInput(e) { + const field = e.currentTarget.dataset.field; + const value = e.detail.value; + this.data.editSupply[field] = value; + this.updatePageData(); + } + + // 添加新货源 + addSupply() { + const userId = wx.getStorageSync('userId'); + const openid = wx.getStorageSync('openid'); + const userInfo = wx.getStorageSync('userInfo'); + + if (!userId || !openid || !userInfo) { + wx.showModal({ + title: '登录提示', + content: '请先登录再发布商品', + showCancel: true, + confirmText: '去登录', + success: (res) => { + if (res.confirm) { + this.data.showAuthModal = true; + this.updatePageData(); + } + } + }); + return; + } + + const { name, price, minOrder, yolk, spec, region, imageUrls, grossWeight } = this.data.newSupply; + if (!name || !price || !minOrder || !yolk) { + wx.showToast({ title: '请填写完整信息', icon: 'none', duration: 2000 }); + return; + } + + wx.showLoading({ title: '正在创建商品...', mask: true }); + + const productData = { + productName: name, + price: price, + quantity: Number(minOrder), + grossWeight: grossWeight && grossWeight !== '' ? grossWeight : "", + yolk: yolk, + specification: spec || '', + region: region || '', + rejectReason: '', + imageUrls: [] + }; + + API.publishProduct(productData) + .then(res => { + console.log('商品创建成功:', res); + + // 第二步:如果有图片,上传图片到已创建的商品 + if (imageUrls && imageUrls.length > 0) { + const productId = res.productId || res.data?.productId || res.product?.productId; + if (productId) { + return this.uploadImagesToExistingProduct(productId, imageUrls, openid); + } + } + return res; + }) + .then(finalRes => { + wx.hideLoading(); + wx.showToast({ + title: imageUrls && imageUrls.length > 0 ? '创建成功,图片已上传' : '创建成功', + duration: 3000 + }); + + // 重置表单 + this.data.showModal = false; + this.data.newSupply = { name: '', price: '', minOrder: '', yolk: '', spec: '', grossWeight: '', region: '', imageUrls: [] }; + + // 清除所有保存的草稿数据,包括小程序和网页格式 + wx.removeStorageSync('newSupplyDraft'); + wx.removeStorageSync('supplyFormDraft'); + + this.updatePageData(); + this.enablePageScroll(); + this.loadSupplies(); + + console.log('商品创建成功,所有草稿数据已清除'); + }) + .catch(err => { + console.error('商品创建或图片上传失败:', err); + wx.hideLoading(); + + let errorMsg = '上传服务器失败'; + if (err.message && err.message.includes('商品不存在')) { + errorMsg = '商品创建失败,无法上传图片'; + } + wx.showModal({ + title: '发布失败', + content: errorMsg + '\n\n错误详情: ' + (err.message || JSON.stringify(err)), + showCancel: false, + success: () => { + this.loadSupplies(); + } + }); + + // 失败时保持保存的草稿数据 + console.log('商品创建失败,保持草稿数据'); + }); + } + + // 上传图片到已存在商品 + uploadImagesToExistingProduct(productId, imageUrls, openid) { + return new Promise((resolve, reject) => { + if (!productId) { + reject(new Error('商品ID不能为空')); + return; + } + + if (!imageUrls || imageUrls.length === 0) { + resolve({ success: true, message: '没有图片需要上传' }); + return; + } + + const uploadSequentially = async () => { + const results = []; + + for (let i = 0; i < imageUrls.length; i++) { + try { + const result = await new Promise((resolveUpload, rejectUpload) => { + const formData = { + productId: productId, + openid: openid, + action: 'add_images_only', + imageIndex: i, + totalImages: imageUrls.length, + isUpdate: 'true', + timestamp: Date.now() + }; + + wx.uploadFile({ + url: API.BASE_URL + '/api/products/upload', + filePath: imageUrls[i], + name: 'images', + formData: formData, + success: (res) => { + if (res.statusCode === 200) { + try { + const data = JSON.parse(res.data); + if (data.success) { + resolveUpload(data); + } else { + rejectUpload(new Error(data.message || '图片上传失败')); + } + } catch (parseError) { + rejectUpload(new Error('服务器响应格式错误')); + } + } else { + rejectUpload(new Error(`HTTP ${res.statusCode}`)); + } + }, + fail: (err) => { + rejectUpload(new Error('网络错误: ' + err.errMsg)); + } + }); + }); + + results.push(result); + + // 添加延迟,避免服务器处理压力过大 + if (i < imageUrls.length - 1) { + await new Promise(resolve => setTimeout(resolve, 500)); + } + } catch (error) { + results.push({ success: false, error: error.message }); + } + } + + return results; + }; + + uploadSequentially() + .then(results => { + const successfulResults = results.filter(r => r && r.success); + if (successfulResults.length > 0) { + const lastResult = successfulResults[successfulResults.length - 1]; + resolve({ + success: true, + message: `成功上传${successfulResults.length}张图片`, + imageUrls: lastResult.imageUrls || [], + allImageUrls: lastResult.allImageUrls || [], + uploadedCount: successfulResults.length, + totalCount: lastResult.totalCount || successfulResults.length, + results: results + }); + } else { + reject(new Error('所有图片上传失败')); + } + }) + .catch(error => { + console.error('图片上传失败:', error); + reject(error); + }); + }); + } + + // 显示编辑弹窗 + showEditSupply(e, isPublishOperation = false) { + this.data.showImagePreview = false; + this.updatePageData(); + + const id = e.currentTarget.dataset.id; + if (!id) { + wx.showToast({ title: '操作失败,缺少货源信息', icon: 'none', duration: 2000 }); + return; + } + + // 在所有货源列表中查找 + let supply = this.data.supplies.find(s => s.id === id); + + if (!supply) { + wx.showToast({ title: '未找到该货源', icon: 'none', duration: 2000 }); + this.loadSupplies(); + return; + } + + // 计算蛋黄和规格的索引值 + const yolkIndex = this.data.yolkOptions.indexOf(supply.yolk) >= 0 ? this.data.yolkOptions.indexOf(supply.yolk) : 0; + const specIndex = this.data.specOptions.indexOf(supply.spec) >= 0 ? this.data.specOptions.indexOf(supply.spec) : 0; + + // 设置编辑货源数据 + const productName = supply.productName || supply.name; + this.data.editSupply = { + ...supply, + formattedCreatedAt: this.formatCreateTime(supply.created_at), + region: supply.region || '', + name: productName, + productName: productName, + yolkIndex: yolkIndex, + specIndex: specIndex + }; + + // 解析地区字符串为省市区数组 + let editSupplyRegionArray = []; + if (supply.region) { + editSupplyRegionArray = supply.region.split(' ').filter(item => item.trim() !== ''); + } + this.data.editSupplyRegionArray = editSupplyRegionArray; + + // 设置自动上架标志 + this.data.autoPublishAfterEdit = isPublishOperation; + this.data.showEditModal = true; + + this.updatePageData(); + this.disablePageScroll(); + } + + // 保存编辑后的货源信息 + saveEdit() { + const { editSupply, autoPublishAfterEdit } = this.data; + + if (!editSupply.name || !editSupply.price || !editSupply.minOrder || !editSupply.yolk) { + wx.showToast({ title: '请填写完整信息', icon: 'none', duration: 2000 }); + return; + } + + wx.showLoading({ title: '正在同步...', mask: true }); + + const openid = wx.getStorageSync('openid'); + + if (!openid) { + wx.hideLoading(); + wx.showModal({ + title: '登录状态异常', + content: '您的登录状态已失效,请重新登录后再尝试保存', + showCancel: false, + success: () => { + this.data.showEditModal = false; + this.updatePageData(); + this.enablePageScroll(); + } + }); + return; + } + + const productName = editSupply.productName || editSupply.name; + const productData = { + productName: productName, + price: editSupply.price, + quantity: Number(editSupply.minOrder), + grossWeight: editSupply.grossWeight !== undefined && editSupply.grossWeight !== null && editSupply.grossWeight !== '' ? editSupply.grossWeight : "", + yolk: editSupply.yolk, + specification: editSupply.spec || '', + region: editSupply.region || '', + imageUrls: editSupply.imageUrls || [], + created_at: new Date().toISOString(), + status: autoPublishAfterEdit ? 'pending_review' : '' + }; + + if (editSupply.serverProductId) { + // 编辑现有商品 + productData.productId = editSupply.serverProductId; + + const requestData = { + openid: openid, + productId: editSupply.serverProductId, + product: { + productName: productData.productName, + price: productData.price, + quantity: productData.quantity, + grossWeight: productData.grossWeight, + yolk: productData.yolk, + specification: productData.specification, + region: productData.region, + imageUrls: productData.imageUrls + }, + status: productData.status || '' + }; + + wx.request({ + url: API.BASE_URL + '/api/product/edit', + method: 'POST', + data: requestData, + success: (res) => { + wx.hideLoading(); + this.data.showEditModal = false; + this.updatePageData(); + this.enablePageScroll(); + wx.showToast({ title: '更新成功', duration: 2000 }); + this.loadSupplies(); + }, + fail: (err) => { + console.error('编辑商品失败:', err); + wx.hideLoading(); + wx.showToast({ title: '保存失败,请重试', icon: 'none', duration: 2000 }); + } + }); + } else { + // 创建新商品 + wx.request({ + url: API.BASE_URL + '/api/product/add', + method: 'POST', + data: productData, + success: (res) => { + wx.hideLoading(); + this.data.showEditModal = false; + this.updatePageData(); + this.enablePageScroll(); + wx.showToast({ title: '更新成功,等待审核', duration: 2000 }); + this.loadSupplies(); + }, + fail: (err) => { + console.error('商品创建失败:', err); + wx.hideLoading(); + wx.showToast({ title: '创建失败,请重试', icon: 'none', duration: 2000 }); + } + }); + } + } + + // 下架货源 + unpublishSupply(e) { + const supplyId = e.currentTarget.dataset.id; + + wx.showModal({ + title: '确认下架', + content: '确定要下架该商品吗?', + confirmText: '确定', + cancelText: '取消', + success: (res) => { + if (res.confirm) { + let supply = this.data.supplies.find(s => s.id === supplyId); + + if (!supply) { + supply = this.data.publishedSupplies.find(s => s.id === supplyId); + } + + if (!supply) { + // 直接使用ID尝试下架 + this.disablePageScroll(); + wx.showLoading({ title: '下架中...', mask: true }); + + API.hideProduct(supplyId) + .then(res => { + wx.hideLoading(); + this.enablePageScroll(); + wx.showToast({ title: '已下架', icon: 'success', duration: 2000 }); + this.loadSupplies(); + }) + .catch(err => { + wx.hideLoading(); + this.enablePageScroll(); + wx.showToast({ title: '下架失败,请重试', icon: 'none', duration: 2000 }); + }); + return; + } + + if (!supply.serverProductId) { + wx.showToast({ title: '无法下架,商品未上传到服务器', icon: 'none', duration: 2000 }); + return; + } + + this.disablePageScroll(); + wx.showLoading({ title: '下架中...', mask: true }); + + API.hideProduct(supply.serverProductId) + .then(res => { + wx.hideLoading(); + this.enablePageScroll(); + wx.showToast({ title: '已下架', icon: 'success', duration: 2000 }); + this.loadSupplies(); + }) + .catch(err => { + wx.hideLoading(); + this.enablePageScroll(); + wx.showToast({ title: '服务器同步失败,请重试', icon: 'none', duration: 3000 }); + this.loadSupplies(); + }); + } + } + }); + } + + // 删除货源 + deleteSupply(e) { + const id = e.currentTarget.dataset.id; + const supply = this.data.supplies.find(s => s.id === id); + + if (!supply) { + wx.showToast({ title: '货源不存在', icon: 'none', duration: 2000 }); + return; + } + + wx.showModal({ + title: '确认删除', + content: '确定要删除该货源吗?删除后将不再显示,但数据会保留。', + success: (res) => { + if (res.confirm) { + wx.showLoading({ title: '删除中...' }); + + let productIdToHide; + const idStr = String(id); + + if (supply.serverProductId) { + productIdToHide = supply.serverProductId; + } else if (idStr.startsWith('product_')) { + productIdToHide = id; + } else { + productIdToHide = id; + } + + API.deleteProduct(productIdToHide).then(() => { + wx.hideLoading(); + wx.showToast({ title: '删除成功', icon: 'success', duration: 2000 }); + this.loadSupplies(); + }).catch(error => { + wx.hideLoading(); + this.loadSupplies(); + wx.showToast({ title: '删除失败,请重试', icon: 'none', duration: 3000 }); + }); + } + } + }); + } + + // 显示审核失败原因弹窗 + showRejectReason(e) { + const id = e.currentTarget.dataset.id; + + wx.showLoading({ + title: '获取最新审核原因...', + mask: true + }); + + API.getProductList('rejected', { + page: 1, + pageSize: 20, + timestamp: new Date().getTime() + }).then(data => { + if (data && data.products && Array.isArray(data.products)) { + const supply = data.products.find(product => product.id === id); + + if (supply) { + this.data.rejectedSupplies = data.products; + this.data.currentRejectSupply = supply; + this.data.rejectReason = supply.rejectReason || '暂无详细的审核失败原因'; + this.data.showRejectReasonModal = true; + this.updatePageData(); + this.disablePageScroll(); + } else { + wx.showToast({ title: '未找到该货源', icon: 'none', duration: 2000 }); + } + } + }).catch(err => { + console.error('获取审核失败商品列表失败:', err); + let localSupply = this.data.supplies.find(s => s.id === id); + + if (localSupply) { + this.data.currentRejectSupply = localSupply; + this.data.rejectReason = localSupply.rejectReason || '暂无详细的审核失败原因'; + this.data.showRejectReasonModal = true; + this.updatePageData(); + this.disablePageScroll(); + } else { + wx.showToast({ title: '未找到该货源', icon: 'none', duration: 2000 }); + } + }).finally(() => { + wx.hideLoading(); + }); + } + + // 关闭审核失败原因弹窗 + closeRejectReasonModal() { + this.data.showRejectReasonModal = false; + this.updatePageData(); + this.enablePageScroll(); + } + + // 选择图片方法 + chooseImage(e) { + const type = e.currentTarget.dataset.type || 'new'; + let currentImages = type === 'new' ? this.data.newSupply.imageUrls || [] : this.data.editSupply.imageUrls || []; + + const maxCount = 5 - currentImages.length; + if (maxCount <= 0) { + wx.showToast({ title: '最多只能上传5张图片', icon: 'none', duration: 2000 }); + return; + } + + wx.chooseImage({ + count: maxCount, + sizeType: ['compressed'], + sourceType: ['album', 'camera'], + success: (res) => { + const tempFilePaths = res.tempFilePaths; + const updatedImages = [...currentImages, ...tempFilePaths]; + + if (type === 'new') { + this.data.newSupply.imageUrls = updatedImages; + } else { + this.data.editSupply.imageUrls = updatedImages; + } + + this.updatePageData(); + + // 实时保存到本地存储 + if (type === 'new') { + wx.setStorageSync('newSupplyDraft', this.data.newSupply); + } + }, + fail: (err) => { + console.error('选择图片失败:', err); + if (err.errMsg !== 'chooseImage:fail cancel') { + wx.showToast({ title: '选择图片失败,请重试', icon: 'none', duration: 2000 }); + } + } + }); + } + + // 删除图片 + deleteImage(e) { + const index = e.currentTarget.dataset.index; + const type = e.currentTarget.dataset.type || 'new'; + + if (type === 'new') { + this.data.newSupply.imageUrls.splice(index, 1); + this.updatePageData(); + wx.setStorageSync('newSupplyDraft', this.data.newSupply); + } else { + this.data.editSupply.imageUrls.splice(index, 1); + this.updatePageData(); + } + } + + // 禁用页面滚动 + disablePageScroll() { + if (this.page) { + this.page.setData({ pageScrollLock: true }); + } + } + + // 启用页面滚动 + enablePageScroll() { + if (this.page) { + this.page.setData({ pageScrollLock: false }); + } + } + + // iOS设备检测 + isIOS() { + const systemInfo = wx.getSystemInfoSync(); + return systemInfo.platform === 'ios'; + } +} + +module.exports = SupplyManager; diff --git a/supply.html b/supply.html new file mode 100644 index 0000000..bf33266 --- /dev/null +++ b/supply.html @@ -0,0 +1,6956 @@ + + + + + + 货源管理 + + + +
+ +
+
+ +

我的货源

+
+
+ + +
+
+ + +
+ + +
+
+ + +
+ +
+ + +
+
+
已上架货源 (0)
+
+
+
+
暂无已上架的货源
+
+
+ + + + + + + + +
+
+
下架状态货源 (0)
+
+
+
+
暂无下架状态的货源
+
+
+
+ + + + + +
+
+ + + + + + + + + + + +
+
+
+ + +
+
+
+

选择货源类型

+ +
+
+
平台货源: 直接包场货源
+
鸡场直销: 鸡场直销货源
+
第三方货源: 贸易商货源
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择商品名称

+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择蛋黄类型

+ +
+
+
请按实际情况选择蛋黄颜色,对于脏次或者冻库蛋不知道蛋黄颜色的情况下可以填写未知
+
(如果有色卡可以在货源描述里面填写色度)
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择联系人

+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择规格

+ +
+
+
+ 按重量选择该批次货最多的重量区间 +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择地区

+ +
+ +
+
+ +
+
+
+
+ +
+
+ + +
+
+
+

选择种类

+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择产品包装

+ +
+ +
+
+ +
+
+ +
+
+ + + + + + + + +
+
+
+

选择规格

+ +
+
+
+ 按重量选择该批次货最多的重量区间 +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择货源类型

+ +
+
+
平台货源: 直接包场货源
+
鸡场直销: 鸡场直销货源
+
第三方货源: 贸易商货源
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择种类

+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择商品名称

+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择蛋黄类型

+ +
+
+
请按实际情况选择蛋黄颜色,对于脏次或者冻库蛋不知道蛋黄颜色的情况下可以填写未知
+
(如果有色卡可以在货源描述里面填写色度)
+
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择联系人

+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择产品包装

+ +
+ +
+
+ +
+
+ +
+
+ + +
+
+
+

选择地区

+ +
+ +
+
+ +
+
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/tatus b/tatus new file mode 100644 index 0000000..2a6a1dc --- /dev/null +++ b/tatus @@ -0,0 +1,410 @@ + + SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS + + Commands marked with * may be preceded by a number, _N. + Notes in parentheses indicate the behavior if _N is given. + A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. + + h H Display this help. + q :q Q :Q ZZ Exit. + --------------------------------------------------------------------------- + + MMOOVVIINNGG + + e ^E j ^N CR * Forward one line (or _N lines). + y ^Y k ^K ^P * Backward one line (or _N lines). + ESC-j * Forward one file line (or _N file lines). + ESC-k * Backward one file line (or _N file lines). + f ^F ^V SPACE * Forward one window (or _N lines). + b ^B ESC-v * Backward one window (or _N lines). + z * Forward one window (and set window to _N). + w * Backward one window (and set window to _N). + ESC-SPACE * Forward one window, but don't stop at end-of-file. + ESC-b * Backward one window, but don't stop at beginning-of-file. + d ^D * Forward one half-window (and set half-window to _N). + u ^U * Backward one half-window (and set half-window to _N). + ESC-) RightArrow * Right one half screen width (or _N positions). + ESC-( LeftArrow * Left one half screen width (or _N positions). + ESC-} ^RightArrow Right to last column displayed. + ESC-{ ^LeftArrow Left to first column. + F Forward forever; like "tail -f". + ESC-F Like F but stop when search pattern is found. + r ^R ^L Repaint screen. + R Repaint screen, discarding buffered input. + --------------------------------------------------- + Default "window" is the screen height. + Default "half-window" is half of the screen height. + --------------------------------------------------------------------------- + + SSEEAARRCCHHIINNGG + + /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. + ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. + n * Repeat previous search (for _N-th occurrence). + N * Repeat previous search in reverse direction. + ESC-n * Repeat previous search, spanning files. + ESC-N * Repeat previous search, reverse dir. & spanning files. + ^O^N ^On * Search forward for (_N-th) OSC8 hyperlink. + ^O^P ^Op * Search backward for (_N-th) OSC8 hyperlink. + ^O^L ^Ol Jump to the currently selected OSC8 hyperlink. + ESC-u Undo (toggle) search highlighting. + ESC-U Clear search highlighting. + &_p_a_t_t_e_r_n * Display only matching lines. + --------------------------------------------------- + Search is case-sensitive unless changed with -i or -I. + A search pattern may begin with one or more of: + ^N or ! Search for NON-matching lines. + ^E or * Search multiple files (pass thru END OF FILE). + ^F or @ Start search at FIRST file (for /) or last file (for ?). + ^K Highlight matches, but don't move (KEEP position). + ^R Don't use REGULAR EXPRESSIONS. + ^S _n Search for match in _n-th parenthesized subpattern. + ^W WRAP search if no match found. + ^L Enter next character literally into pattern. + --------------------------------------------------------------------------- + + JJUUMMPPIINNGG + + g < ESC-< * Go to first line in file (or line _N). + G > ESC-> * Go to last line in file (or line _N). + p % * Go to beginning of file (or _N percent into file). + t * Go to the (_N-th) next tag. + T * Go to the (_N-th) previous tag. + { ( [ * Find close bracket } ) ]. + } ) ] * Find open bracket { ( [. + ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. + ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>. + --------------------------------------------------- + Each "find close bracket" command goes forward to the close bracket + matching the (_N-th) open bracket in the top line. + Each "find open bracket" command goes backward to the open bracket + matching the (_N-th) close bracket in the bottom line. + + m_<_l_e_t_t_e_r_> Mark the current top line with . + M_<_l_e_t_t_e_r_> Mark the current bottom line with . + '_<_l_e_t_t_e_r_> Go to a previously marked position. + '' Go to the previous position. + ^X^X Same as '. + ESC-m_<_l_e_t_t_e_r_> Clear a mark. + --------------------------------------------------- + A mark is any upper-case or lower-case letter. + Certain marks are predefined: + ^ means beginning of the file + $ means end of the file + --------------------------------------------------------------------------- + + CCHHAANNGGIINNGG FFIILLEESS + + :e [_f_i_l_e] Examine a new file. + ^X^V Same as :e. + :n * Examine the (_N-th) next file from the command line. + :p * Examine the (_N-th) previous file from the command line. + :x * Examine the first (or _N-th) file from the command line. + ^O^O Open the currently selected OSC8 hyperlink. + :d Delete the current file from the command line list. + = ^G :f Print current file name. + --------------------------------------------------------------------------- + + MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS + + -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below]. + --_<_n_a_m_e_> Toggle a command line option, by name. + __<_f_l_a_g_> Display the setting of a command line option. + ___<_n_a_m_e_> Display the setting of an option, by name. + +_c_m_d Execute the less cmd each time a new file is examined. + + !_c_o_m_m_a_n_d Execute the shell command with $SHELL. + #_c_o_m_m_a_n_d Execute the shell command, expanded like a prompt. + |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. + s _f_i_l_e Save input to a file. + v Edit the current file with $VISUAL or $EDITOR. + V Print version number of "less". + --------------------------------------------------------------------------- + + OOPPTTIIOONNSS + + Most options may be changed either on the command line, + or from within less by using the - or -- command. + Options may be given in one of two forms: either a single + character preceded by a -, or a name preceded by --. + + -? ........ --help + Display help (from command line). + -a ........ --search-skip-screen + Search skips current screen. + -A ........ --SEARCH-SKIP-SCREEN + Search starts just after target line. + -b [_N] .... --buffers=[_N] + Number of buffers. + -B ........ --auto-buffers + Don't automatically allocate buffers for pipes. + -c ........ --clear-screen + Repaint by clearing rather than scrolling. + -d ........ --dumb + Dumb terminal. + -D xx_c_o_l_o_r . --color=xx_c_o_l_o_r + Set screen colors. + -e -E .... --quit-at-eof --QUIT-AT-EOF + Quit at end of file. + -f ........ --force + Force open non-regular files. + -F ........ --quit-if-one-screen + Quit if entire file fits on first screen. + -g ........ --hilite-search + Highlight only last match for searches. + -G ........ --HILITE-SEARCH + Don't highlight any matches for searches. + -h [_N] .... --max-back-scroll=[_N] + Backward scroll limit. + -i ........ --ignore-case + Ignore case in searches that do not contain uppercase. + -I ........ --IGNORE-CASE + Ignore case in all searches. + -j [_N] .... --jump-target=[_N] + Screen position of target lines. + -J ........ --status-column + Display a status column at left edge of screen. + -k _f_i_l_e ... --lesskey-file=_f_i_l_e + Use a compiled lesskey file. + -K ........ --quit-on-intr + Exit less in response to ctrl-C. + -L ........ --no-lessopen + Ignore the LESSOPEN environment variable. + -m -M .... --long-prompt --LONG-PROMPT + Set prompt style. + -n ......... --line-numbers + Suppress line numbers in prompts and messages. + -N ......... --LINE-NUMBERS + Display line number at start of each line. + -o [_f_i_l_e] .. --log-file=[_f_i_l_e] + Copy to log file (standard input only). + -O [_f_i_l_e] .. --LOG-FILE=[_f_i_l_e] + Copy to log file (unconditionally overwrite). + -p _p_a_t_t_e_r_n . --pattern=[_p_a_t_t_e_r_n] + Start at pattern (from command line). + -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t] + Define new prompt. + -q -Q .... --quiet --QUIET --silent --SILENT + Quiet the terminal bell. + -r -R .... --raw-control-chars --RAW-CONTROL-CHARS + Output "raw" control characters. + -s ........ --squeeze-blank-lines + Squeeze multiple blank lines. + -S ........ --chop-long-lines + Chop (truncate) long lines rather than wrapping. + -t _t_a_g .... --tag=[_t_a_g] + Find a tag. + -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e] + Use an alternate tags file. + -u -U .... --underline-special --UNDERLINE-SPECIAL + Change handling of backspaces, tabs and carriage returns. + -V ........ --version + Display the version number of "less". + -w ........ --hilite-unread + Highlight first new line after forward-screen. + -W ........ --HILITE-UNREAD + Highlight first new line after any forward movement. + -x [_N[,...]] --tabs=[_N[,...]] + Set tab stops. + -X ........ --no-init + Don't use termcap init/deinit strings. + -y [_N] .... --max-forw-scroll=[_N] + Forward scroll limit. + -z [_N] .... --window=[_N] + Set size of window. + -" [_c[_c]] . --quotes=[_c[_c]] + Set shell quote characters. + -~ ........ --tilde + Don't display tildes after end of file. + -# [_N] .... --shift=[_N] + Set horizontal scroll amount (0 = one half screen width). + + --exit-follow-on-close + Exit F command on a pipe when writer closes pipe. + --file-size + Automatically determine the size of the input file. + --follow-name + The F command changes files if the input file is renamed. + --form-feed + Stop scrolling when a form feed character is reached. + --header=[_L[,_C[,_N]]] + Use _L lines (starting at line _N) and _C columns as headers. + --incsearch + Search file as each pattern character is typed in. + --intr=[_C] + Use _C instead of ^X to interrupt a read. + --lesskey-context=_t_e_x_t + Use lesskey source file contents. + --lesskey-src=_f_i_l_e + Use a lesskey source file. + --line-num-width=[_N] + Set the width of the -N line number field to _N characters. + --match-shift=[_N] + Show at least _N characters to the left of a search match. + --modelines=[_N] + Read _N lines from the input file and look for vim modelines. + --mouse + Enable mouse input. + --no-edit-warn + Don't warn when using v command on a file opened via LESSOPEN. + --no-keypad + Don't send termcap keypad init/deinit strings. + --no-histdups + Remove duplicates from command history. + --no-number-headers + Don't give line numbers to header lines. + --no-paste + Ignore pasted input. + --no-search-header-lines + Searches do not include header lines. + --no-search-header-columns + Searches do not include header columns. + --no-search-headers + Searches do not include header lines or columns. + --no-vbell + Disable the terminal's visual bell. + --redraw-on-quit + Redraw final screen when quitting. + --rscroll=[_C] + Set the character used to mark truncated lines. + --save-marks + Retain marks across invocations of less. + --search-options=[EFKNRW-] + Set default options for every search. + --show-preproc-errors + Display a message if preprocessor exits with an error status. + --proc-backspace + Process backspaces for bold/underline. + --PROC-BACKSPACE + Treat backspaces as control characters. + --proc-return + Delete carriage returns before newline. + --PROC-RETURN + Treat carriage returns as control characters. + --proc-tab + Expand tabs to spaces. + --PROC-TAB + Treat tabs as control characters. + --status-col-width=[_N] + Set the width of the -J status column to _N characters. + --status-line + Highlight or color the entire line containing a mark. + --use-backslash + Subsequent options use backslash as escape char. + --use-color + Enables colored text. + --wheel-lines=[_N] + Each click of the mouse wheel moves _N lines. + --wordwrap + Wrap lines at spaces. + + + --------------------------------------------------------------------------- + + LLIINNEE EEDDIITTIINNGG + + These keys can be used to edit text being entered + on the "command line" at the bottom of the screen. + + RightArrow ..................... ESC-l ... Move cursor right one character. + LeftArrow ...................... ESC-h ... Move cursor left one character. + ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word. + ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word. + HOME ........................... ESC-0 ... Move cursor to start of line. + END ............................ ESC-$ ... Move cursor to end of line. + BACKSPACE ................................ Delete char to left of cursor. + DELETE ......................... ESC-x ... Delete char under cursor. + ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor. + ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor. + ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line. + UpArrow ........................ ESC-k ... Retrieve previous command line. + DownArrow ...................... ESC-j ... Retrieve next command line. + TAB ...................................... Complete filename & cycle. + SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle. + ctrl-L ................................... Complete filename, list all. + + SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS + + Commands marked with * may be preceded by a number, _N. + Notes in parentheses indicate the behavior if _N is given. + A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. + + h H Display this help. + q :q Q :Q ZZ Exit. + --------------------------------------------------------------------------- + + MMOOVVIINNGG + + e ^E j ^N CR * Forward one line (or _N lines). + y ^Y k ^K ^P * Backward one line (or _N lines). + ESC-j * Forward one file line (or _N file lines). + ESC-k * Backward one file line (or _N file lines). + f ^F ^V SPACE * Forward one window (or _N lines). + b ^B ESC-v * Backward one window (or _N lines). + z * Forward one window (and set window to _N). + w * Backward one window (and set window to _N). + ESC-SPACE * Forward one window, but don't stop at end-of-file. + ESC-b * Backward one window, but don't stop at beginning-of-file. + d ^D * Forward one half-window (and set half-window to _N). + u ^U * Backward one half-window (and set half-window to _N). + ESC-) RightArrow * Right one half screen width (or _N positions). + ESC-( LeftArrow * Left one half screen width (or _N positions). + ESC-} ^RightArrow Right to last column displayed. + ESC-{ ^LeftArrow Left to first column. + F Forward forever; like "tail -f". + ESC-F Like F but stop when search pattern is found. + r ^R ^L Repaint screen. + R Repaint screen, discarding buffered input. + --------------------------------------------------- + Default "window" is the screen height. + Default "half-window" is half of the screen height. + --------------------------------------------------------------------------- + + SSEEAARRCCHHIINNGG + + /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. + ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. + n * Repeat previous search (for _N-th occurrence). + N * Repeat previous search in reverse direction. + ESC-n * Repeat previous search, spanning files. + ESC-N * Repeat previous search, reverse dir. & spanning files. + ^O^N ^On * Search forward for (_N-th) OSC8 hyperlink. + ^O^P ^Op * Search backward for (_N-th) OSC8 hyperlink. + ^O^L ^Ol Jump to the currently selected OSC8 hyperlink. + ESC-u Undo (toggle) search highlighting. + ESC-U Clear search highlighting. + &_p_a_t_t_e_r_n * Display only matching lines. + --------------------------------------------------- + Search is case-sensitive unless changed with -i or -I. + A search pattern may begin with one or more of: + ^N or ! Search for NON-matching lines. + ^E or * Search multiple files (pass thru END OF FILE). + ^F or @ Start search at FIRST file (for /) or last file (for ?). + ^K Highlight matches, but don't move (KEEP position). + ^R Don't use REGULAR EXPRESSIONS. + ^S _n Search for match in _n-th parenthesized subpattern. + ^W WRAP search if no match found. + ^L Enter next character literally into pattern. + --------------------------------------------------------------------------- + + JJUUMMPPIINNGG + + g < ESC-< * Go to first line in file (or line _N). + G > ESC-> * Go to last line in file (or line _N). + p % * Go to beginning of file (or _N percent into file). + t * Go to the (_N-th) next tag. + T * Go to the (_N-th) previous tag. + { ( [ * Find close bracket } ) ]. + } ) ] * Find open bracket { ( [. + ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. + ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>. + --------------------------------------------------- + Each "find close bracket" command goes forward to the close bracket + matching the (_N-th) open bracket in the top line. + Each "find open bracket" command goes backward to the open bracket + matching the (_N-th) close bracket in the bottom line. + + m_<_l_e_t_t_e_r_> Mark the current top line with . + M_<_l_e_t_t_e_r_> Mark the current bottom line with . + '_<_l_e_t_t_e_r_> Go to a previously marked position. + '' Go to the previous position. diff --git a/test-watermark-update.js b/test-watermark-update.js new file mode 100644 index 0000000..93cf220 --- /dev/null +++ b/test-watermark-update.js @@ -0,0 +1,63 @@ +const fs = require('fs'); +const path = require('path'); +const ImageProcessor = require('./image-processor'); + +// 测试水印功能 +async function testWatermark() { + console.log('开始测试水印功能...'); + + try { + // 创建一个简单的测试图片(Base64编码的1x1像素图片) + const testImageBase64 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=='; + + console.log('1. 测试ImageProcessor模块导入...'); + if (!ImageProcessor || typeof ImageProcessor.addWatermark !== 'function') { + throw new Error('ImageProcessor模块导入失败或缺少必要方法'); + } + console.log('✓ 模块导入成功'); + + console.log('2. 测试水印添加功能...'); + console.log(' - 水印文字: 又鸟蛋平台'); + console.log(' - 透明度: rgba(0,0,0,0.3)'); + console.log(' - 位置: 右下角'); + + // 使用默认配置添加水印(应该使用'又鸟蛋平台'作为水印文字) + const watermarkedBuffer = await ImageProcessor.addWatermarkToBase64(testImageBase64); + + if (!watermarkedBuffer || !(watermarkedBuffer instanceof Buffer)) { + throw new Error('水印添加失败,未返回有效Buffer'); + } + console.log('✓ 水印添加成功'); + + // 保存测试结果到文件 + const outputPath = path.join(__dirname, 'watermark-test-update-output.png'); + fs.writeFileSync(outputPath, watermarkedBuffer); + console.log(`✓ 测试结果已保存到: ${outputPath}`); + + // 验证配置正确性 + console.log('3. 验证水印配置...'); + console.log(' - 默认水印文字: 又鸟蛋平台'); + console.log(' - 默认透明度: rgba(0,0,0,0.3)'); + console.log(' - 强制位置: 右下角'); + + // 测试强制位置功能 + const forcedWatermarkedBuffer = await ImageProcessor.addWatermarkToBase64(testImageBase64, '测试', { + position: 'center' // 尝试设置不同位置,但应该被强制为右下角 + }); + console.log('✓ 位置强制功能测试成功'); + + console.log('\n🎉 所有测试通过! 水印功能已成功更新:'); + console.log(' - 水印文字: 又鸟蛋平台'); + console.log(' - 透明度: rgba(0,0,0,0.3) (更透明)'); + console.log(' - 位置: 右下角 (统一位置)'); + console.log(' - 后端服务已重启,新配置已生效'); + + } catch (error) { + console.error('❌ 测试失败:', error.message); + console.error('错误详情:', error); + process.exit(1); + } +} + +// 运行测试 +testWatermark(); \ No newline at end of file diff --git a/test-watermark.js b/test-watermark.js new file mode 100644 index 0000000..4638d93 --- /dev/null +++ b/test-watermark.js @@ -0,0 +1,61 @@ +const fs = require('fs'); +const path = require('path'); +const ImageProcessor = require('./image-processor'); + +// 测试添加水印功能 +async function testAddWatermark() { + try { + console.log('开始测试图片水印功能...'); + + // 创建一个简单的测试图片Buffer(使用Base64编码的1x1像素黑色图片) + const base64TestImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=='; + + // 处理水印 + const watermarkedBuffer = await ImageProcessor.addWatermarkToBase64( + base64TestImage, + '测试水印 - 供应商ID: test123', + { + fontSize: 16, + color: 'rgba(255,0,0,0.8)', + position: 'bottom-right', + marginX: 10, + marginY: 10 + } + ); + + // 保存测试结果到文件 + const testOutputPath = path.join(__dirname, 'watermark-test-output.png'); + await fs.promises.writeFile(testOutputPath, watermarkedBuffer); + + console.log(`✅ 水印测试成功! 输出文件已保存至: ${testOutputPath}`); + console.log('\n测试总结:'); + console.log('- ✅ 成功导入ImageProcessor模块'); + console.log('- ✅ 成功添加文字水印到图片'); + console.log('- ✅ 成功将带水印的图片保存为文件'); + console.log('- ✅ Sharp库功能正常工作'); + console.log('\n提示: 在实际API调用中,水印功能会在创建货源时自动应用到上传的图片上。'); + + return true; + } catch (error) { + console.error('❌ 水印测试失败:', error.message); + console.error('错误详情:', error); + return false; + } +} + +// 运行测试 +(async () => { + console.log('===================================='); + console.log(' 图片水印功能测试脚本 '); + console.log('===================================='); + + const success = await testAddWatermark(); + + if (success) { + console.log('\n✅ 所有测试通过! 水印功能已准备就绪,可以在创建货源API中使用。'); + } else { + console.log('\n❌ 测试失败,请检查错误信息并修复问题。'); + } + + console.log('===================================='); +})(); diff --git a/test/api.test.js b/test/api.test.js new file mode 100644 index 0000000..5ebac20 --- /dev/null +++ b/test/api.test.js @@ -0,0 +1,224 @@ +const request = require('supertest'); +const expect = require('chai').expect; +const app = require('../Reject.js'); + +// 测试API端点 +describe('API Endpoints', () => { + // 测试数据库连接 + describe('GET /api/test-db', () => { + it('should return database connection status', async () => { + const res = await request(app) + .get('/api/test-db') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(200); + expect(res.body).to.be.an('object'); + expect(res.body).to.have.property('success'); + }); + }); + + // 测试获取货源列表 + describe('GET /api/supplies', () => { + it('should return supplies list', async () => { + const res = await request(app) + .get('/api/supplies') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(200); + expect(res.body).to.be.an('object'); + expect(res.body).to.have.property('success'); + expect(res.body).to.have.property('data'); + }); + }); + + // 测试获取供应商列表 + describe('GET /api/suppliers', () => { + it('should return suppliers list', async () => { + const res = await request(app) + .get('/api/suppliers') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(200); + expect(res.body).to.be.an('object'); + expect(res.body).to.have.property('success'); + expect(res.body).to.have.property('data'); + }); + }); + + // 测试获取联系人列表 + describe('GET /api/contacts', () => { + it('should return contacts list', async () => { + const res = await request(app) + .get('/api/contacts') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(200); + expect(res.body).to.be.an('object'); + expect(res.body).to.have.property('success'); + expect(res.body).to.have.property('data'); + }); + }); + + // 测试获取审核失败原因 + describe('GET /api/supplies/:id/reject-reason', () => { + it('should return reject reason for supply', async () => { + // 首先获取一个货源ID + const suppliesRes = await request(app) + .get('/api/supplies') + .set('Accept', 'application/json'); + + if (suppliesRes.body.data && suppliesRes.body.data.length > 0) { + const supplyId = suppliesRes.body.data[0].id; + const res = await request(app) + .get(`/api/supplies/${supplyId}/reject-reason`) + .set('Accept', 'application/json'); + + expect(res.status).to.equal(200); + expect(res.body).to.be.an('object'); + expect(res.body).to.have.property('success'); + } + }); + }); + + // 测试获取拒绝审核API路由注册 + describe('GET /api/supplies/:id/reject', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/supplies/1/reject') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取供应商审核通过API路由注册 + describe('GET /api/suppliers/:id/approve', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/suppliers/1/approve') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取供应商审核拒绝API路由注册 + describe('GET /api/suppliers/:id/reject', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/suppliers/1/reject') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取供应商开始合作API路由注册 + describe('GET /api/suppliers/:id/cooperate', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/suppliers/1/cooperate') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取供应商终止合作API路由注册 + describe('GET /api/suppliers/:id/terminate', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/suppliers/1/terminate') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取创建货源API路由注册 + describe('GET /api/supplies/create', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/supplies/create') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取图片上传API路由注册 + describe('GET /api/upload-image', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/upload-image') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取下架货源API路由注册 + describe('GET /api/supplies/:id/unpublish', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/supplies/1/unpublish') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取上架货源API路由注册 + describe('GET /api/supplies/:id/publish', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/supplies/1/publish') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取删除货源API路由注册 + describe('GET /api/supplies/:id/delete', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/supplies/1/delete') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取更新货源状态API路由注册 + describe('GET /api/supplies/:id', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/supplies/1') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); + + // 测试获取编辑货源API路由注册 + describe('GET /api/supplies/:id/edit', () => { + it('should return method not allowed for GET', async () => { + const res = await request(app) + .get('/api/supplies/1/edit') + .set('Accept', 'application/json'); + + expect(res.status).to.equal(405); // Method Not Allowed + }); + }); +}); + +// 测试服务器启动 +describe('Server', () => { + it('should be listening on port 3000', () => { + // 这个测试主要验证app对象是否被正确导出 + expect(app).to.be.an('object'); + expect(app).to.have.property('listen'); + expect(app.listen).to.be.a('function'); + }); +}); diff --git a/watermark-test-output.png b/watermark-test-output.png new file mode 100644 index 0000000..71f7cd2 Binary files /dev/null and b/watermark-test-output.png differ diff --git a/watermark-test-update-output.png b/watermark-test-update-output.png new file mode 100644 index 0000000..71f7cd2 Binary files /dev/null and b/watermark-test-update-output.png differ